Konclude-v0.6.2-544-SourceCode/0000755000175000017500000000000012637543753015041 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/WinGitBuildScript.bat0000644000175000017500000000125212235423354021063 0ustar jonasjonas REM @Set /A "Counter=0" REM @git log --oneline > tmpGitLog.txt REM @FOR /F "delims=" %%A IN (tmpGitLog.txt) DO @SET /A "Counter+=1" REM @echo #define KONCLUDE_VERSION_GIT_REVISION_NUMBER %Counter% > revision-git.h REM @set VersionName=Unknown REM @git describe --tags --match v*.*.* --abbrev=0 > tmpGitTagName.txt REM @SET /p VersionName=> revision-git.h REM @set VersionHash=Unknown REM @git log --pretty=format:%%h -n 1 > tmpGitHash.txt REM @set /p VersionHash=> revision-git.hKonclude-v0.6.2-544-SourceCode/Tests/0000755000175000017500000000000012613407262016127 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Tests/test-request.xml0000644000175000017500000000455012235424264021323 0ustar jonasjonas Konclude-v0.6.2-544-SourceCode/Tests/galen.owl.xml0000644000175000017500000452664512235701614020563 0ustar jonasjonas Konclude-v0.6.2-544-SourceCode/Tests/roberts-family-full-D.owl.xml0000644000175000017500000117701412121333270023533 0ustar jonasjonas Konclude-v0.6.2-544-SourceCode/Tests/1b-satisfiability-request.xml0000644000175000017500000001547511473335602023674 0ustar jonasjonas Konclude-v0.6.2-544-SourceCode/Tests/galen-classify-request.xml0000644000175000017500000000110212236540006023225 0ustar jonasjonas Konclude-v0.6.2-544-SourceCode/Tests/roberts-family-full-D-classify-realize-request.xml0000644000175000017500000000111512126751366027667 0ustar jonasjonas Konclude-v0.6.2-544-SourceCode/Konclude-VS05.sln0000644000175000017500000000260212401011704017765 0ustar jonasjonas Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Konclude-VS05", "Konclude-VS05.vcproj", "{ECFD4EA0-F893-4C82-97BC-7EF023EA536F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {ECFD4EA0-F893-4C82-97BC-7EF023EA536F}.Debug|Win32.ActiveCfg = Debug|x64 {ECFD4EA0-F893-4C82-97BC-7EF023EA536F}.Debug|Win32.Build.0 = Debug|x64 {ECFD4EA0-F893-4C82-97BC-7EF023EA536F}.Debug|x64.ActiveCfg = Debug|x64 {ECFD4EA0-F893-4C82-97BC-7EF023EA536F}.Debug|x64.Build.0 = Debug|x64 {ECFD4EA0-F893-4C82-97BC-7EF023EA536F}.Release|Win32.ActiveCfg = Release|Win32 {ECFD4EA0-F893-4C82-97BC-7EF023EA536F}.Release|Win32.Build.0 = Release|Win32 {ECFD4EA0-F893-4C82-97BC-7EF023EA536F}.Release|x64.ActiveCfg = Release|x64 {ECFD4EA0-F893-4C82-97BC-7EF023EA536F}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution QtVersion = Qt4.8.5 EndGlobalSection GlobalSection(Qt) = preSolution Integration = True EndGlobalSection EndGlobal Konclude-v0.6.2-544-SourceCode/Source/0000755000175000017500000000000012613407262016265 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Test/0000755000175000017500000000000012613407262017204 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestfileTestResult.cpp0000644000175000017500000000513712520551350025331 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerTestfileTestResult.h" namespace Konclude { namespace Test { CReasonerTestfileTestResult::CReasonerTestfileTestResult() { avgResponseTime = 0; corrRespCount = 0; totTestCount = 0; crashCount = 0; timeoutCount = 0; wrongRespCount = 0; failedCount = 0; errorCount = 0; } CReasonerTestfileTestResult::~CReasonerTestfileTestResult() { } double CReasonerTestfileTestResult::getAverageCorrectResponseTime() { return avgResponseTime; } qint64 CReasonerTestfileTestResult::getCorrectResponseCount() { return corrRespCount; } qint64 CReasonerTestfileTestResult::getWrongResponseCount() { return wrongRespCount; } qint64 CReasonerTestfileTestResult::getFailedCount() { return failedCount; } qint64 CReasonerTestfileTestResult::getCrashCount() { return crashCount; } qint64 CReasonerTestfileTestResult::getErrorCount() { return errorCount; } qint64 CReasonerTestfileTestResult::getTimeoutCount() { return timeoutCount; } qint64 CReasonerTestfileTestResult::getTotalTestCount() { return totTestCount; } CReasonerTestfileTestResult *CReasonerTestfileTestResult::addFailedResult() { totTestCount++; failedCount++; return this; } CReasonerTestfileTestResult *CReasonerTestfileTestResult::addTestResult(bool crashed, bool timeout, bool error, bool correctResponse, double responseTime) { totTestCount++; if (crashed) { crashCount++; if (timeout) { timeoutCount++; } } else if (timeout) { timeoutCount++; } else if (error) { errorCount++; } else { if (correctResponse) { corrRespCount++; avgResponseTime = avgResponseTime + (1./corrRespCount) * (responseTime - avgResponseTime); } } return this; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/COWLPigeonholePrincipleGenerator.h0000644000175000017500000000507212520551350025647 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLPigeonholePrincipleGenerator_H #define KONCLUDE_TEST_COWLPigeonholePrincipleGenerator_H // Libraries includes #include // Namespace includes #include "Utilities/UtilitiesSettings.h" // Other includes #include // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Logger; using namespace Utilities; namespace Test { /*! * * \class COWLPigeonholePrincipleGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLPigeonholePrincipleGenerator : public CLogIdentifier { // public methods public: //! Constructor COWLPigeonholePrincipleGenerator(); //! Destructor virtual ~COWLPigeonholePrincipleGenerator(); void generatePigeonholePrinciple(cint64 size, const QString& filename); // protected methods protected: QDomElement getOWLClassDeclaration(const QString& className); QDomElement getOWLClass(const QString& className); QDomElement getOWLComplementClass(const QString& className); QDomElement getOWLClass(const QString& className, bool negated); QDomElement getOWLUnion(const QList& list); QDomElement getOWLUnion(const QDomElement& u1, const QDomElement& u2); QDomElement getOWLIntersection(const QList& list); QDomElement getOWLEquivalentClass(const QDomElement& eq1, const QDomElement& eq2); // protected variables protected: QString owllinkNS; QString owlNS; QDomDocument document; QDomElement rootNode; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLPigeonholePrincipleGenerator_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/0000755000175000017500000000000012613407262021313 5ustar jonasjonas././@LongLink0000644000000000000000000000020300000000000011576 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerStatist0000644000175000017500000000604412520551330032605 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERSTATISTICVALUECSVCOMPARISONANALYSER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERSTATISTICVALUECSVCOMPARISONANALYSER_H // Libraries includes #include #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGNUPlotPlotter.h" #include "CReasonerEvaluationHighchartPlotter.h" #include "CReasonerEvaluationAnalyseContext.h" #include "CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" #include "CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h" #include "CReasonerEvaluationDoubleDataValue.h" #include "CReasonerEvaluationTableMultiFormatOutputWriter.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser : public CReasonerEvaluationGroupRequestReasonerComparisonAnalyser { // public methods public: //! Constructor CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser(); //! Destructor virtual ~CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser(); QString getPrettyTitleFromOutputFile(const QString& outputFile); // protected methods protected: virtual bool analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector); // protected variables protected: QString mOutputFileName; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERSTATISTICVALUECSVCOMPARISONANALYSER_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationTableMultiFormatOutputWriter.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationTableMultiFormatOutputWrite0000644000175000017500000006003412520551340032534 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTABLEMULTIFORMATOUTPUTWRITER_CPP #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTABLEMULTIFORMATOUTPUTWRITER_CPP #include "CReasonerEvaluationTableMultiFormatOutputWriter.h" namespace Konclude { namespace Test { namespace Evaluation { template CReasonerEvaluationTableMultiFormatOutputWriter::CReasonerEvaluationTableMultiFormatOutputWriter() { mLastRow = nullptr; mSortedIndexBuilded = false; } template CReasonerEvaluationTableMultiFormatOutputWriter::~CReasonerEvaluationTableMultiFormatOutputWriter() { } template QStringList CReasonerEvaluationTableMultiFormatOutputWriter::writeCVSTable(const QString& baseFileName, QString (*convertStringFunction)(const T&)) { QStringList outputFileList; QString outputFileString(baseFileName+"-table.csv"); QFile outputFile(outputFileString); if (outputFile.open(QIODevice::WriteOnly)) { outputFileList<mTitle+"\t"; foreach (T value, row->mRowValueList) { QString valueString = (*convertStringFunction)(value); rowString += QString("%1\t").arg(valueString); } rowString += "\r\n"; outputFile.write(rowString.toLocal8Bit()); } } return outputFileList; } template QStringList CReasonerEvaluationTableMultiFormatOutputWriter::writeGNUPlotDataTable(const QString& baseFileName, QString (*convertStringFunction)(const T&)) { QStringList outputFileList; QString outputFileString(baseFileName+"-table.dat"); QFile outputFile(outputFileString); if (outputFile.open(QIODevice::WriteOnly)) { outputFileList<mTitle)).arg(rowIndex++); foreach (T value, row->mRowValueList) { QString valueString = (*convertStringFunction)(value); rowString += QString("%1\t").arg(valueString); } rowString += "\r\n"; outputFile.write(rowString.toLocal8Bit()); } } return outputFileList; } template QStringList CReasonerEvaluationTableMultiFormatOutputWriter::writeGNUPlotDataTablesSorted(const QString& baseFileName, QString (*convertStringFunction)(const T&)) { QStringList outputFileList; cint64 titleIndex = 0; cint64 rowCount = mRowList.count(); foreach (QString title, mTitles) { QString outputFileASCString(baseFileName+QString("-sorted-ascending-by-%1-table.dat").arg(title)); QString outputFileDESString(baseFileName+QString("-sorted-descending-by-%1-table.dat").arg(title)); QString desFileContentString; QFile outputFileASC(outputFileASCString); if (outputFileASC.open(QIODevice::WriteOnly)) { QStringList mIndexAddedTitleList(mTitles); mIndexAddedTitleList.insert(1,"Index"); QString titleString = QString("\"%1\"\r\n").arg(mIndexAddedTitleList.join("\"\t\"")); outputFileASC.write(titleString.toLocal8Bit()); cint64 rowIndex = 0; if (titleIndex == 0) { for (typename QMap::const_iterator it = mTitleColumnSortedMap.constBegin(), itEnd = mTitleColumnSortedMap.constEnd(); it != itEnd; ++it) { CReasonerEvaluationTableRow* row = it.value(); QString rowASCString = QString("\"%1\"\t%2\t").arg(getGNUPlotCompatibleTitle(row->mTitle)).arg(rowIndex); QString rowDESString = QString("\"%1\"\t%2\t").arg(getGNUPlotCompatibleTitle(row->mTitle)).arg(rowCount-rowIndex-1); foreach (T value, row->mRowValueList) { QString valueString = (*convertStringFunction)(value); rowASCString += QString("%1\t").arg(valueString); rowDESString += QString("%1\t").arg(valueString); } rowASCString += "\r\n"; rowDESString += "\r\n"; outputFileASC.write(rowASCString.toLocal8Bit()); desFileContentString.prepend(rowDESString); ++rowIndex; } } else { QMap* sortedMap = mColumnSortMapList.at(titleIndex-1); for (typename QMap::const_iterator it = sortedMap->constBegin(), itEnd = sortedMap->constEnd(); it != itEnd; ++it) { CReasonerEvaluationTableRow* row = it.value(); QString rowASCString = QString("\"%1\"\t%2\t").arg(getGNUPlotCompatibleTitle(row->mTitle)).arg(rowIndex); QString rowDESString = QString("\"%1\"\t%2\t").arg(getGNUPlotCompatibleTitle(row->mTitle)).arg(rowCount-rowIndex-1); foreach (T value, row->mRowValueList) { QString valueString = (*convertStringFunction)(value); rowASCString += QString("%1\t").arg(valueString); rowDESString += QString("%1\t").arg(valueString); } rowASCString += "\r\n"; rowDESString += "\r\n"; outputFileASC.write(rowASCString.toLocal8Bit()); desFileContentString.prepend(rowDESString); ++rowIndex; } } outputFileList< QStringList CReasonerEvaluationTableMultiFormatOutputWriter::writeGNUPlotDataTablesSeparateSorted(const QString& baseFileName, QString (*convertStringFunction)(const T&)) { QStringList outputFileList; QString outputFileASCString(baseFileName+QString("-separate-sorted-ascending-table.dat")); QString outputFileDESString(baseFileName+QString("-separate-sorted-descending-table.dat")); QString desFileContentString; cint64 rowCount = mRowList.count(); QFile outputFileASC(outputFileASCString); if (outputFileASC.open(QIODevice::WriteOnly)) { QStringList mIndexAddedTitleList(mTitles); mIndexAddedTitleList.insert(1,"Index"); QString titleString = QString("\"%1\"\r\n").arg(mIndexAddedTitleList.join("\"\t\"")); outputFileASC.write(titleString.toLocal8Bit()); typename QMap::iterator itTitles = mTitleColumnSortedMap.begin(), itTitlesEnd = mTitleColumnSortedMap.end(); QList< typename QMap::iterator > itList; for (typename QList< QMap* >::const_iterator it = mColumnSortMapList.constBegin(), itEnd = mColumnSortMapList.constEnd(); it != itEnd; ++it) { QMap* sortMap = *it; itList.append(sortMap->begin()); } cint64 rowIndex = 0; while (itTitles != itTitlesEnd) { QString rowASCTitleString = QString("\"%1\"\t%2\t").arg(getGNUPlotCompatibleTitle(itTitles.key())).arg(rowIndex); QString rowDESTitleString = QString("\"%1\"\t%2\t").arg(getGNUPlotCompatibleTitle(itTitles.key())).arg(rowCount-rowIndex-1); cint64 colIndex = 0; for (typename QList< typename QMap::iterator >::iterator it = itList.begin(), itEnd = itList.end(); it != itEnd; ++it) { typename QMap::iterator& itCol = *it; CReasonerEvaluationTableRow* row = itCol.value(); T value = row->mRowValueList.at(colIndex); QString valueString = (*convertStringFunction)(value); rowASCTitleString += QString("%1\t").arg(valueString); rowDESTitleString += QString("%1\t").arg(valueString); ++itCol; ++colIndex; } rowASCTitleString += "\r\n"; rowDESTitleString += "\r\n"; outputFileASC.write(rowASCTitleString.toLocal8Bit()); desFileContentString.prepend(rowDESTitleString); ++itTitles; ++rowIndex; } desFileContentString.prepend(titleString); QFile outputFileDES(outputFileDESString); if (outputFileDES.open(QIODevice::WriteOnly)) { outputFileDES.write(desFileContentString.toLocal8Bit()); outputFileDES.close(); outputFileList< QStringList CReasonerEvaluationTableMultiFormatOutputWriter::writeGNUPlotDataTablesSortedSplitted(cint64 splitSize, const QString& baseFileName, QString (*convertStringFunction)(const T&)) { QStringList outputFileList; cint64 rowCount = mRowList.count(); for (cint64 rowStartIndex = 0; rowStartIndex < rowCount; rowStartIndex += splitSize) { cint64 rowEndIndex = rowStartIndex+splitSize; rowEndIndex = qMin(rowEndIndex,rowCount); cint64 titleIndex = 0; foreach (QString title, mTitles) { QString outputFileASCString(baseFileName+QString("-sorted-ascending-by-%1-split-from-%2-to-%3-table.dat").arg(title).arg(getSplitIndexString(rowStartIndex+1,rowCount)).arg(getSplitIndexString(rowEndIndex,rowCount))); QString outputFileDESString(baseFileName+QString("-sorted-descending-by-%1-split-from-%2-to-%3-table.dat").arg(title).arg(getSplitIndexString(rowCount-rowEndIndex+1,rowCount)).arg(getSplitIndexString(rowCount-rowStartIndex,rowCount))); QString desFileContentString; QFile outputFileASC(outputFileASCString); if (outputFileASC.open(QIODevice::WriteOnly)) { QStringList mIndexAddedTitleList(mTitles); mIndexAddedTitleList.insert(1,"Index"); QString titleString = QString("\"%1\"\r\n").arg(mIndexAddedTitleList.join("\"\t\"")); outputFileASC.write(titleString.toLocal8Bit()); cint64 rowIndex = 0; if (titleIndex == 0) { cint64 rowIndex = 0; for (typename QMap::const_iterator it = mTitleColumnSortedMap.constBegin(), itEnd = mTitleColumnSortedMap.constEnd(); it != itEnd; ++it) { if (rowIndex >= rowStartIndex && rowIndex < rowEndIndex) { CReasonerEvaluationTableRow* row = it.value(); QString rowASCString = QString("\"%1\"\t%2\t").arg(getGNUPlotCompatibleTitle(row->mTitle)).arg(rowIndex-rowStartIndex); QString rowDESString = QString("\"%1\"\t%2\t").arg(getGNUPlotCompatibleTitle(row->mTitle)).arg(rowEndIndex-rowIndex-1); foreach (T value, row->mRowValueList) { QString valueString = (*convertStringFunction)(value); rowASCString += QString("%1\t").arg(valueString); rowDESString += QString("%1\t").arg(valueString); } rowASCString += "\r\n"; rowDESString += "\r\n"; outputFileASC.write(rowASCString.toLocal8Bit()); desFileContentString.prepend(rowDESString); } ++rowIndex; } } else { cint64 rowIndex = 0; QMap* sortedMap = mColumnSortMapList.at(titleIndex-1); for (typename QMap::const_iterator it = sortedMap->constBegin(), itEnd = sortedMap->constEnd(); it != itEnd; ++it) { if (rowIndex >= rowStartIndex && rowIndex < rowEndIndex) { CReasonerEvaluationTableRow* row = it.value(); QString rowASCString = QString("\"%1\"\t%2\t").arg(getGNUPlotCompatibleTitle(row->mTitle)).arg(rowIndex-rowStartIndex); QString rowDESString = QString("\"%1\"\t%2\t").arg(getGNUPlotCompatibleTitle(row->mTitle)).arg(rowEndIndex-rowIndex-1); foreach (T value, row->mRowValueList) { QString valueString = (*convertStringFunction)(value); rowASCString += QString("%1\t").arg(valueString); rowDESString += QString("%1\t").arg(valueString); } rowASCString += "\r\n"; rowDESString += "\r\n"; outputFileASC.write(rowASCString.toLocal8Bit()); desFileContentString.prepend(rowDESString); } ++rowIndex; } } outputFileList< QString CReasonerEvaluationTableMultiFormatOutputWriter::getGNUPlotCompatibleTitle(const QString& string) { QString comString = string; comString.replace("-request.xml",""); comString.replace("_","-"); if (comString.length() >= 40) { comString = comString.mid(0,37); comString += "..."; } return comString; } template QString CReasonerEvaluationTableMultiFormatOutputWriter::getSplitIndexString(cint64 index, cint64 maxIndex) { QString maxIndString = QString::number(maxIndex); QString indexString = QString::number(index); while (indexString.size() < maxIndString.size()) { indexString.insert(0,"0"); } return indexString; } template QStringList CReasonerEvaluationTableMultiFormatOutputWriter::writeCVSTablesSortedSplitted(cint64 splitSize, const QString& baseFileName, QString (*convertStringFunction)(const T&)) { QStringList outputFileList; cint64 rowCount = mRowList.count(); for (cint64 rowStartIndex = 0; rowStartIndex < rowCount; rowStartIndex += splitSize) { cint64 rowEndIndex = rowStartIndex+splitSize; rowEndIndex = qMin(rowEndIndex,rowCount); cint64 titleIndex = 0; foreach (QString title, mTitles) { QString outputFileASCString(baseFileName+QString("-sorted-ascending-by-%1-split-from-%2-to-%3-table.csv").arg(title).arg(getSplitIndexString(rowStartIndex+1,rowCount)).arg(getSplitIndexString(rowEndIndex,rowCount))); QString outputFileDESString(baseFileName+QString("-sorted-descending-by-%1-split-from-%2-to-%3-table.csv").arg(title).arg(getSplitIndexString(rowCount-rowEndIndex+1,rowCount)).arg(getSplitIndexString(rowCount-rowStartIndex,rowCount))); QString desFileContentString; QFile outputFileASC(outputFileASCString); if (outputFileASC.open(QIODevice::WriteOnly)) { QString titleString = QString("%1\r\n").arg(mTitles.join("\t")); outputFileASC.write(titleString.toLocal8Bit()); if (titleIndex == 0) { cint64 rowIndex = 0; for (typename QMap::const_iterator it = mTitleColumnSortedMap.constBegin(), itEnd = mTitleColumnSortedMap.constEnd(); it != itEnd; ++it) { if (rowIndex >= rowStartIndex && rowIndex < rowEndIndex) { CReasonerEvaluationTableRow* row = it.value(); QString rowString = row->mTitle+"\t"; foreach (T value, row->mRowValueList) { QString valueString = (*convertStringFunction)(value); rowString += QString("%1\t").arg(valueString); } rowString += "\r\n"; outputFileASC.write(rowString.toLocal8Bit()); desFileContentString.prepend(rowString); } ++rowIndex; } } else { QMap* sortedMap = mColumnSortMapList.at(titleIndex-1); cint64 rowIndex = 0; for (typename QMap::const_iterator it = sortedMap->constBegin(), itEnd = sortedMap->constEnd(); it != itEnd; ++it) { if (rowIndex >= rowStartIndex && rowIndex < rowEndIndex) { CReasonerEvaluationTableRow* row = it.value(); QString rowString = row->mTitle+"\t"; foreach (T value, row->mRowValueList) { QString valueString = (*convertStringFunction)(value); rowString += QString("%1\t").arg(valueString); } rowString += "\r\n"; outputFileASC.write(rowString.toLocal8Bit()); desFileContentString.prepend(rowString); } ++rowIndex; } } outputFileList< QStringList CReasonerEvaluationTableMultiFormatOutputWriter::writeCVSTablesSorted(const QString& baseFileName, QString (*convertStringFunction)(const T&)) { QStringList outputFileList; cint64 titleIndex = 0; foreach (QString title, mTitles) { QString outputFileASCString(baseFileName+QString("-sorted-ascending-by-%1-table.csv").arg(title)); QString outputFileDESString(baseFileName+QString("-sorted-descending-by-%1-table.csv").arg(title)); QString desFileContentString; QFile outputFileASC(outputFileASCString); if (outputFileASC.open(QIODevice::WriteOnly)) { QString titleString = QString("%1\r\n").arg(mTitles.join("\t")); outputFileASC.write(titleString.toLocal8Bit()); if (titleIndex == 0) { for (typename QMap::const_iterator it = mTitleColumnSortedMap.constBegin(), itEnd = mTitleColumnSortedMap.constEnd(); it != itEnd; ++it) { CReasonerEvaluationTableRow* row = it.value(); QString rowString = row->mTitle+"\t"; foreach (T value, row->mRowValueList) { QString valueString = (*convertStringFunction)(value); rowString += QString("%1\t").arg(valueString); } rowString += "\r\n"; outputFileASC.write(rowString.toLocal8Bit()); desFileContentString.prepend(rowString); } } else { QMap* sortedMap = mColumnSortMapList.at(titleIndex-1); for (typename QMap::const_iterator it = sortedMap->constBegin(), itEnd = sortedMap->constEnd(); it != itEnd; ++it) { CReasonerEvaluationTableRow* row = it.value(); QString rowString = row->mTitle+"\t"; foreach (T value, row->mRowValueList) { QString valueString = (*convertStringFunction)(value); rowString += QString("%1\t").arg(valueString); } rowString += "\r\n"; outputFileASC.write(rowString.toLocal8Bit()); desFileContentString.prepend(rowString); } } outputFileList< QStringList CReasonerEvaluationTableMultiFormatOutputWriter::writeCVSTablesSeparateSorted(const QString& baseFileName, QString (*convertStringFunction)(const T&)) { QStringList outputFileList; QString outputFileString(baseFileName+QString("-separate-sorted-table.csv")); QFile outputFile(outputFileString); if (outputFile.open(QIODevice::WriteOnly)) { outputFileList.append(outputFileString); QString titleString = QString("%1\r\n").arg(mTitles.join("\t")); outputFile.write(titleString.toLocal8Bit()); typename QMap::iterator itTitles = mTitleColumnSortedMap.begin(), itTitlesEnd = mTitleColumnSortedMap.end(); QList< typename QMap::iterator > itList; for (typename QList< QMap* >::const_iterator it = mColumnSortMapList.constBegin(), itEnd = mColumnSortMapList.constEnd(); it != itEnd; ++it) { QMap* sortMap = *it; itList.append(sortMap->begin()); } while (itTitles != itTitlesEnd) { QString rowTitleString = QString("%1\t").arg(itTitles.key()); cint64 colIndex = 0; for (typename QList< typename QMap::iterator >::iterator it = itList.begin(), itEnd = itList.end(); it != itEnd; ++it) { typename QMap::iterator& itCol = *it; CReasonerEvaluationTableRow* row = itCol.value(); T value = row->mRowValueList.at(colIndex); QString valueString = (*convertStringFunction)(value); rowTitleString += QString("%1\t").arg(valueString); ++itCol; ++colIndex; } rowTitleString += "\r\n"; outputFile.write(rowTitleString.toLocal8Bit()); ++itTitles; } } return outputFileList; } template CReasonerEvaluationTableMultiFormatOutputWriter* CReasonerEvaluationTableMultiFormatOutputWriter::addColumnTitles(const QStringList& titleList) { mTitles += titleList; mSortedIndexBuilded = false; return this; } template CReasonerEvaluationTableMultiFormatOutputWriter* CReasonerEvaluationTableMultiFormatOutputWriter::addNewTableRow(const QString& rowTitle, const QList& rowValues) { mLastRow = new CReasonerEvaluationTableRow(); mLastRow->mTitle = rowTitle; mLastRow->mRowValueList += rowValues; mRowList.append(mLastRow); mSortedIndexBuilded = false; return this; } template CReasonerEvaluationTableMultiFormatOutputWriter* CReasonerEvaluationTableMultiFormatOutputWriter::addValuesToLastTableRow(const QList& rowValues) { mLastRow->mRowValueList += rowValues; mSortedIndexBuilded = false; return this; } template CReasonerEvaluationTableMultiFormatOutputWriter* CReasonerEvaluationTableMultiFormatOutputWriter::addNewTableRow(const QString& rowTitle) { mLastRow = new CReasonerEvaluationTableRow(); mLastRow->mTitle = rowTitle; mRowList.append(mLastRow); mSortedIndexBuilded = false; return this; } template CReasonerEvaluationTableMultiFormatOutputWriter* CReasonerEvaluationTableMultiFormatOutputWriter::buildSortedIndex() { if (!mSortedIndexBuilded) { if (!mColumnSortMapList.isEmpty()) { qDeleteAll(mColumnSortMapList); mColumnSortMapList.clear(); mTitleColumnSortedMap.clear(); } mSortedIndexBuilded = true; foreach (CReasonerEvaluationTableRow* row, mRowList) { mTitleColumnSortedMap.insertMulti(row->mTitle,row); cint64 columnIndex = 0; foreach (T value, row->mRowValueList) { if (mColumnSortMapList.count() <= columnIndex) { mColumnSortMapList.append(new QMap()); } QMap* columnSortMap = mColumnSortMapList.at(columnIndex); columnSortMap->insertMulti(value,row); ++columnIndex; } } } return this; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTABLEMULTIFORMATOUTPUTWRITER_CPP ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDataValueGroupCollectionReasonerComparison.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDataValueGroupCollectionRea0000644000175000017500000000507512520551322032420 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUEGROUPCOLLECTIONREASONERCOMPARISON_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUEGROUPCOLLECTIONREASONERCOMPARISON_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValueGroupCollection.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationDataValueGroupCollectionReasonerComparison * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationDataValueGroupCollectionReasonerComparison { // public methods public: //! Constructor CReasonerEvaluationDataValueGroupCollectionReasonerComparison(QStringList reasonerList); //! Destructor virtual ~CReasonerEvaluationDataValueGroupCollectionReasonerComparison(); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* addReasonerCollection(const QString& reasoner, CReasonerEvaluationDataValueGroupCollection* collection); QMap* getReasonerCollectionMap(); QStringList getReasonerList(); // protected methods protected: // protected variables protected: QMap mReasonerCollectionMap; QStringList mReasonerList; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUEGROUPCOLLECTIONREASONERCOMPARISON_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationProgram.h0000644000175000017500000000602712520551334026727 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPROGRAM_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPROGRAM_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationProgram * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationProgram { // public methods public: //! Constructor CReasonerEvaluationProgram(); CReasonerEvaluationProgram* setConfigFileString(const QString& configFileString); CReasonerEvaluationProgram* setInputDirectoryString(const QString& inputString); CReasonerEvaluationProgram* setOutputDirectoryString(const QString& outputString); CReasonerEvaluationProgram* setAnalyserDirectoryString(const QString& analyserString); CReasonerEvaluationProgram* setProgramName(const QString& programName); CReasonerEvaluationProgram* appendReasonerString(const QString& reasonerString); CReasonerEvaluationProgram* appendAnalyserString(const QString& analyserString); CReasonerEvaluationProgram* appendFilterString(const QString& filterString); QString getConfigFileString(); QString getInputDirectoryString(); QString getOutputDirectoryString(); QString getAnalyserDirectoryString(); QString getProgramName(); QStringList getReasonerStringList(); QStringList getAnalyserStringList(); QStringList getFilterStringList(); // protected methods protected: // protected variables protected: QString mProgramName; QString mConfigFileString; QString mInputDirString; QString mOutputDirString; QString mAnalyserDirString; QStringList mReasonerStringList; QStringList mAnalyserStringList; QStringList mFilterStringList; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPROGRAM_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationStatisticsValueExtractor.h0000644000175000017500000000542512520551336032346 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSTATISTICSVALUEEXTRACTOR_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSTATISTICSVALUEEXTRACTOR_H // Libraries includes #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" #include "CReasonerEvaluationExtractor.h" #include "CReasonerEvaluationDoubleDataValue.h" #include "CReasonerEvaluationDataValueCacher.h" #include "CReasonerEvaluationStringValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationStatisticsValueExtractor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationStatisticsValueExtractor : public CReasonerEvaluationExtractor { // public methods public: //! Constructor CReasonerEvaluationStatisticsValueExtractor(const QString& statName, QSet* statNameSet, double timelimit = -1, double errorPunishmentTime = 0, CReasonerEvaluationDataValueCacher* cacher = nullptr); virtual CReasonerEvaluationDataValue* extractEvaluationData(const QString& responseFileString); // protected methods protected: virtual CReasonerEvaluationDoubleDataValue* extractSpecifiedStatisticsValueEvaluationData(QDomDocument& document, const QString& responseFileString, const QString& statName); // protected variables protected: CReasonerEvaluationDataValueCacher* mCacher; double mTimelimit; double mErrorPunishmentTime; QString mStatName; QSet* mStatNameSet; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSTATISTICSVALUEEXTRACTOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationProfileRequestSelector.cpp0000644000175000017500000000533112520551334032322 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationProfileRequestSelector.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationProfileRequestSelector::CReasonerEvaluationProfileRequestSelector(cint64 profile, const QString& baseExpressivityDir) { mProfile = profile; mBaseExpressivityDir = baseExpressivityDir; } bool CReasonerEvaluationProfileRequestSelector::isGroupSelected(const QString& groupString) { return true; } QString CReasonerEvaluationProfileRequestSelector::getProfileKeyString(cint64 profile) { if (profile == REPRS_PROFILE_DL) { return "DLProfile:"; } else if (profile == REPRS_PROFILE_EL) { return "ELProfile:"; } else if (profile == REPRS_PROFILE_QL) { return "QLProfile:"; } else if (profile == REPRS_PROFILE_RL) { return "RLProfile:"; } return ""; } bool CReasonerEvaluationProfileRequestSelector::isRequestSelected(const QString& groupString, const QString& requestString) { QString profileString; bool foundProfile = false; QString infoFileString = mBaseExpressivityDir+groupString+requestString+".txt"; QFile infoFile(infoFileString); if (infoFile.open(QIODevice::ReadOnly)) { while (!foundProfile && !infoFile.atEnd()) { QString line = infoFile.readLine(); QStringList keyValueLists = line.split("\t"); if (keyValueLists.count() >= 2) { QString profileKeyString = getProfileKeyString(mProfile); if (keyValueLists.first().trimmed() == profileKeyString) { foundProfile = true; profileString = keyValueLists.last().trimmed(); } } } infoFile.close(); } if (!foundProfile) { return false; } else { if (profileString == "1") { return true; } else if (profileString == "0") { return false; } } return true; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationTimeoutErrorExtractor.cpp0000644000175000017500000000416512520551340032205 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationTimeoutErrorExtractor.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationTimeoutErrorExtractor::CReasonerEvaluationTimeoutErrorExtractor(double timelimit) { mTimelimit = timelimit; } CReasonerEvaluationTimeoutErrorExtractor::~CReasonerEvaluationTimeoutErrorExtractor() { } CReasonerEvaluationDataValue* CReasonerEvaluationTimeoutErrorExtractor::extractEvaluationData(const QString& responseFileString) { CReasonerEvaluationDoubleDataValue* doubleErrorValue = nullptr; QFile responseFile(responseFileString); cint64 errorValue = 0; if (responseFile.open(QIODevice::ReadOnly)) { QDomDocument document; document.setContent(&responseFile,false); QDomElement rootEl = document.documentElement(); QString respTimeString = rootEl.attribute("response-time","timeout"); if (respTimeString == "timeout") { errorValue = 1; } if (errorValue == 0) { QDomElement classResEl = rootEl.firstChildElement("Error"); if (!classResEl.isNull()) { errorValue = 1; } } responseFile.close(); } doubleErrorValue = new CReasonerEvaluationDoubleDataValue(errorValue); return doubleErrorValue; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExecutionCallbackContextData.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExecutionCallbackContextDat0000644000175000017500000000242012520551324032440 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationExecutionCallbackContextData.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationExecutionCallbackContextData::CReasonerEvaluationExecutionCallbackContextData(bool failed) { mExecutionFailed = failed; } bool CReasonerEvaluationExecutionCallbackContextData::getExecutionFailed() { return mExecutionFailed; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestSelector.cpp0000644000175000017500000000334712520551330032017 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationGroupRequestSelector.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationGroupRequestSelector::CReasonerEvaluationGroupRequestSelector() : CLinkerBase(this) { } QString CReasonerEvaluationGroupRequestSelector::getNameString() { return mNameString; } QString CReasonerEvaluationGroupRequestSelector::getOutputString() { return mOutputString; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationGroupRequestSelector::setNameString(const QString& name) { mNameString = name; return this; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationGroupRequestSelector::setOutputString(const QString& output) { mOutputString = output; return this; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000020500000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerAccumul0000644000175000017500000000606212520551326032550 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERACCUMULATEDCOUNTCSVCOMPARISONANALYSER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERACCUMULATEDCOUNTCSVCOMPARISONANALYSER_H // Libraries includes #include #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGNUPlotPlotter.h" #include "CReasonerEvaluationHighchartPlotter.h" #include "CReasonerEvaluationAnalyseContext.h" #include "CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" #include "CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h" #include "CReasonerEvaluationDoubleDataValue.h" #include "CReasonerEvaluationTableMultiFormatOutputWriter.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser : public CReasonerEvaluationGroupRequestReasonerComparisonAnalyser { // public methods public: //! Constructor CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser(); //! Destructor virtual ~CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser(); QString getPrettyTitleFromOutputFile(const QString& outputFile); // protected methods protected: virtual bool analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector); // protected variables protected: QString mOutputFileName; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERACCUMULATEDCOUNTCSVCOMPARISONANALYSER_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationStatisticsValueExtractor.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationStatisticsValueExtractor.cp0000644000175000017500000001275612520551336032526 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationStatisticsValueExtractor.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationStatisticsValueExtractor::CReasonerEvaluationStatisticsValueExtractor(const QString& statName, QSet* statNameSet, double timelimit, double errorPunishmentTime, CReasonerEvaluationDataValueCacher* cacher) { mTimelimit = timelimit; mErrorPunishmentTime = errorPunishmentTime; mCacher = cacher; mStatName = statName; mStatNameSet = statNameSet; } CReasonerEvaluationDoubleDataValue* CReasonerEvaluationStatisticsValueExtractor::extractSpecifiedStatisticsValueEvaluationData(QDomDocument& document, const QString& responseFileString, const QString& statName) { CReasonerEvaluationDoubleDataValue* doubleEvalValue = nullptr; if (mCacher) { doubleEvalValue = dynamic_cast(mCacher->getCachedDataValue(responseFileString,statName)); } if (!doubleEvalValue) { double doubleValue = 0; bool errorOccured = false; bool timeoutOccured = false; bool allRespTimeValid = true; bool dataAvailable = false; QDomElement rootEl = document.documentElement(); cint64 queryNumber = 0; QList elementList; elementList.append(rootEl); while (!elementList.isEmpty()) { QDomElement element = elementList.takeFirst(); if (element.hasAttribute("request-command")) { QString statName = element.attribute("request-command"); ++queryNumber; QString foundStatName; if (statName == "Classify") { foundStatName = QString("query-%1-classify-response-time").arg(queryNumber); } else if (statName == "Realize") { foundStatName = QString("query-%1-realize-response-time").arg(queryNumber); } else if (statName == "IsKBSatisfiable") { foundStatName = QString("query-%1-consistency-response-time").arg(queryNumber); } if (foundStatName == statName) { dataAvailable = true; QString statValueString = element.attribute("response-time","0"); bool validStatValue = false; double statValue = statValueString.toDouble(&validStatValue); if (validStatValue) { doubleValue += statValue; } allRespTimeValid &= validStatValue; } } if (element.hasAttribute("statistic-name")) { QString foundStatName = element.attribute("statistic-name"); if (foundStatName == statName) { dataAvailable = true; QString statValueString = element.attribute("statistic-value","0"); bool validStatValue = false; double statValue = statValueString.toDouble(&validStatValue); if (validStatValue) { doubleValue += statValue; } allRespTimeValid &= validStatValue; } } if (element.tagName() == "Error") { errorOccured = false; } QString timeoutString = element.attribute("timeout"); if (timeoutString == "1") { timeoutOccured = true; } QDomElement childElement = element.firstChildElement(); while (!childElement.isNull()) { elementList.append(childElement); childElement = childElement.nextSiblingElement(); } } doubleEvalValue = new CReasonerEvaluationDoubleDataValue(doubleValue); if (!dataAvailable) { doubleEvalValue->setDataNotAvailableFlag(); } if (mCacher) { mCacher->addDataValueToCache(responseFileString,statName,doubleEvalValue); } } return doubleEvalValue; } CReasonerEvaluationDataValue* CReasonerEvaluationStatisticsValueExtractor::extractEvaluationData(const QString& responseFileString) { CReasonerEvaluationDataValue* evalValue = nullptr; if (mCacher) { evalValue = mCacher->getCachedDataValue(responseFileString,mStatName); } if (!evalValue) { QFile responseFile(responseFileString); if (responseFile.open(QIODevice::ReadOnly)) { QDomDocument document; document.setContent(&responseFile,false); QDomElement rootEl = document.documentElement(); responseFile.close(); evalValue = extractSpecifiedStatisticsValueEvaluationData(document,responseFileString,mStatName); for (QSet::const_iterator it = mStatNameSet->constBegin(), itEnd = mStatNameSet->constEnd(); it != itEnd; ++it) { QString statName(*it); if (statName != mStatName) { extractSpecifiedStatisticsValueEvaluationData(document,responseFileString,statName); } } } } if (evalValue) { evalValue = evalValue->getCopy(); } return evalValue; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationResponseTimeExtractor.h0000644000175000017500000000444212520551336031632 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONRESPONSETIMEEXTRACTOR_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONRESPONSETIMEEXTRACTOR_H // Libraries includes #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" #include "CReasonerEvaluationExtractor.h" #include "CReasonerEvaluationDoubleDataValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationResponseTimeExtractor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationResponseTimeExtractor : public CReasonerEvaluationExtractor { // public methods public: //! Constructor CReasonerEvaluationResponseTimeExtractor(double timelimit = -1); //! Destructor virtual ~CReasonerEvaluationResponseTimeExtractor(); virtual CReasonerEvaluationDataValue* extractEvaluationData(const QString& responseFile); // protected methods protected: // protected variables protected: double mTimelimit; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONRESPONSETIMEEXTRACTOR_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationResponseFileListSummarizer.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationResponseFileListSummarizer.0000644000175000017500000000443312520551336032462 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONRESPONSEFILELISTSUMMARIZER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONRESPONSEFILELISTSUMMARIZER_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" #include "CReasonerEvaluationSummarizer.h" #include "CReasonerEvaluationStringValue.h" #include "CReasonerEvaluationStringListValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationResponseFileListSummarizer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationResponseFileListSummarizer : public CReasonerEvaluationSummarizer { // public methods public: //! Constructor CReasonerEvaluationResponseFileListSummarizer(); //! Destructor virtual ~CReasonerEvaluationResponseFileListSummarizer(); virtual CReasonerEvaluationDataValue* summarizeEvaluationData(CReasonerEvaluationDataValue* dataValues); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONRESPONSEFILELISTSUMMARIZER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationConfigurationLoader.cpp0000644000175000017500000001027112520551320031600 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationConfigurationLoader.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationConfigurationLoader::CReasonerEvaluationConfigurationLoader() { mLoaderConfig = nullptr; mConfLogProcessingTimes = false; } CReasonerEvaluationConfigurationLoader::~CReasonerEvaluationConfigurationLoader() { } bool CReasonerEvaluationConfigurationLoader::loadConfiguration(const QString& owllinkConfigFile, CConfiguration *config) { mLoaderConfig = config; mReqFileString = owllinkConfigFile; mBlockUntilProcessed = true; mConfLogProcessingTimes = false; CConfigData* data = config->getLastConfigChange("Konclude.OWLlink.LoggingExtendedProcessingTimes"); if (data) { mConfLogProcessingTimes = data->getBoolean(); } reasonerCommander = CConfigManagerReader::readCommanderManagerConfig(config); mConfigSucessfullyLoaded = false; startProcessing(); if (mBlockUntilProcessed) { mBlockingSem.acquire(); } stopThread(); return mConfigSucessfullyLoaded; } CConfiguration* CReasonerEvaluationConfigurationLoader::getConfiguration() { if (!reasonerCommander) { return mLoaderConfig; } else { CGetDescriptionCommand *getDesComm = new CGetDescriptionCommand(); reasonerCommander->delegateCommand(getDesComm); CCommandExecutedBlocker commExeBlocker; commExeBlocker.waitExecutedCommand(getDesComm); CConfiguration *config = getDesComm->getConfiguration(); return config; } } COWLlinkProcessor* CReasonerEvaluationConfigurationLoader::initializeOWLlinkContent() { mResponseTime.start(); if (!mReqFileString.isEmpty()) { QFile file(mReqFileString); LOG(INFO,getLogDomain(),logTr("Processing OWLlink configuration request from file '%1'.").arg(mReqFileString),this); if (file.open(QIODevice::ReadOnly)) { fileContent = file.readAll(); COWLlinkQtXMLCommandParser *owllinkCommandParser = new COWLlinkQtXMLCommandParser(); defaultCommandDelegater = preSynchronizer; CParseOWLlinkCommandsCommand *parseCommand = new CParseOWLlinkCommandsCommand(&fileContent,mReqFileString); parseCommand->setReportErrorFromSubCommands(false); CCommandProcessedCallbackEvent *proComm = new CCommandProcessedCallbackEvent(this,parseCommand); parseCommand->addProcessedCallback(proComm); owllinkCommandParser->realizeCommand(parseCommand,preSynchronizer); delete owllinkCommandParser; if (mConfLogProcessingTimes) { cint64 readMilliSeconds = mResponseTime.elapsed(); LOG(INFO,getLogDomain(),logTr("Read XML content in %1 ms.").arg(readMilliSeconds),this); } file.close(); mConfigSucessfullyLoaded = true; } else { LOG(ERROR,getLogDomain(),logTr("OWLlink configuration request file '%1' not found.").arg(mReqFileString),this); concludeOWLlinkContent(); } } return this; } COWLlinkProcessor* CReasonerEvaluationConfigurationLoader::concludeOWLlinkContent() { if (mConfLogProcessingTimes) { cint64 responseMilliSeconds = mResponseTime.elapsed(); LOG(INFO,getLogDomain(),logTr("OWLlink request processed in %1 ms.").arg(responseMilliSeconds),this); } if (mBlockUntilProcessed) { mBlockingSem.release(); } return this; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationRequestClientThread.h0000644000175000017500000001117312520551334031235 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTCLIENTTHREAD_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTCLIENTTHREAD_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationRequestClient.h" #include "CReasonerEvaluationRequestResult.h" #include "CReasonerEvaluationExecutionCallbackContextData.h" // Other includes #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" #include "Test/Evaluation/Events/CReasonerEvaluationStartEvent.h" #include "Test/Evaluation/Events/CReasonerEvaluationNextEvent.h" #include "Concurrent/CIntervalThread.h" #include "Network/HTTP/CQtHttpTransactionManager.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Config; using namespace Concurrent; using namespace Network::HTTP; namespace Test { namespace Evaluation { using namespace Events; /*! * * \class CReasonerEvaluationRequestClientThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationRequestClientThread : public CIntervalThread, public CReasonerEvaluationRequestClient, public CLogIdentifier { // public methods public: //! Constructor CReasonerEvaluationRequestClientThread(); //! Destructor virtual ~CReasonerEvaluationRequestClientThread(); bool evaluateReasoner(const QString& initFileString, const QString& testFileString, const QString& addressString, CConfiguration* configuration, CCallbackData* callback); CReasonerEvaluationRequestResult* getReasonerEvaluationResult(); // protected methods protected: virtual bool processTimer(qint64 timerID); virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); virtual void threadStarted(); virtual void threadStopped(); bool loadReasonerRequests(const QString& initFileString, const QString& testFileString); bool loadReasonerRequest(const QString& requestFileString); QDomElement getAdabtedRequestNode(QDomElement& el); QDomElement getResolvedAbbreviatedIRIsNode(QDomElement& el, const QHash& appreviatePrefixHash, const QString& xmlBase); bool startsWithScheme(const QString& uriString); bool sendNextRequest(); bool hasNextRequest(); QDomDocument createRequestDocument(const QDomElement& reqNode); bool closeNextRequest(); bool closeAllRequestTimeout(); bool finishReasonerRequests(); QDomElement getModifiedRequestNode(const QDomElement& el); // protected variables protected: CQtHttpTransactionManager* mTransManager; CConfiguration* mConfig; CReasonerEvaluationRequestResult* mResponse; QString mInitFileString; QString mTestFileString; QString mAddressString; CCallbackData* mRequestFinishedCallback; cint64 mRequestTimeout; cint64 mTotalTimeout; QList mRemainingRequestList; cint64 mNumberInitRequests; CReasonerEvaluationRequestResponse* mNextReqRes; CHttpResponse* mWebResponse; CHttpRequest* mWebRequest; cint64 mCurrentRequestCount; cint64 mTotalRequestCount; QTime mNextRequestTiming; QTime mTotalTiming; QTime mTestingTiming; cint64 mCurrentOperationNumber; bool mModifyRequestAbsolutePaths; bool mReplaceLoadOntologiesWithTells; bool mResolveAppreviatedIRIsForReplacedTells; const static cint64 TIMERIDREQUESTTIMEOUT = 1; const static cint64 TIMERIDTOTALTIMEOUT = 2; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTCLIENTTHREAD_H ././@LongLink0000644000000000000000000000021500000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerStatist0000644000175000017500000000662712520551330032614 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERSTATISTICVALUECOLLECTINGCSVCOMPARISONANALYSER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERSTATISTICVALUECOLLECTINGCSVCOMPARISONANALYSER_H // Libraries includes #include #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGNUPlotPlotter.h" #include "CReasonerEvaluationHighchartPlotter.h" #include "CReasonerEvaluationAnalyseContext.h" #include "CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" #include "CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h" #include "CReasonerEvaluationDoubleDataValue.h" #include "CReasonerEvaluationTableMultiFormatOutputWriter.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser : public CReasonerEvaluationGroupRequestReasonerComparisonAnalyser { // public methods public: //! Constructor CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser(); //! Destructor virtual ~CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser(); CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser* addNextStatisticName(const QString& statName); QString getPrettyTitleFromOutputFile(const QString& outputFile); // protected methods protected: virtual bool analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector); // protected variables protected: QString mOutputFileName; QHash< CReasonerEvaluationGroupRequestSelector*, QHash,double>* > mSelectorReasonerRequestValueHash; QStringList mStatNameList; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERSTATISTICVALUECOLLECTINGCSVCOMPARISONANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationRequestResponse.cpp0000644000175000017500000000533112520551334031017 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationRequestResponse.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationRequestResponse::CReasonerEvaluationRequestResponse() { mResponseTime = 0; mTimedOut = false; mResponseError = false; } CReasonerEvaluationRequestResponse* CReasonerEvaluationRequestResponse::setResponseTime(cint64 responseTime) { mResponseTime = responseTime; return this; } CReasonerEvaluationRequestResponse* CReasonerEvaluationRequestResponse::setTimedOut(bool timedOut) { mTimedOut = timedOut; return this; } CReasonerEvaluationRequestResponse* CReasonerEvaluationRequestResponse::setResponseError(bool responseError) { mResponseError = responseError; return this; } CReasonerEvaluationRequestResponse* CReasonerEvaluationRequestResponse::setRequestNode(const QDomElement& reqNode) { mRequestNode = reqNode; return this; } CReasonerEvaluationRequestResponse* CReasonerEvaluationRequestResponse::setResponseNode(const QDomElement& resNode) { mResponseNode = resNode; return this; } CReasonerEvaluationRequestResponse* CReasonerEvaluationRequestResponse::setModifiedNode(const QDomElement& resNode) { mModifiedNode = resNode; return this; } cint64 CReasonerEvaluationRequestResponse::getResponseTime() { return mResponseTime; } QDomElement CReasonerEvaluationRequestResponse::getRequestNode() { return mRequestNode; } QDomElement CReasonerEvaluationRequestResponse::getResponseNode() { return mResponseNode; } QDomElement CReasonerEvaluationRequestResponse::getModifiedNode() { return mModifiedNode; } bool CReasonerEvaluationRequestResponse::isTimedOut() { return mTimedOut; } bool CReasonerEvaluationRequestResponse::hasResponseError() { return mResponseError; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerOWLlinkEvaluationProvider.h0000644000175000017500000000564612520551342030357 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEROWLLINKEVALUATIONPROVIDER_H #define KONCLUDE_TEST_EVALUATION_CREASONEROWLLINKEVALUATIONPROVIDER_H // Libraries includes #include #include #include #include #include // Namespace includes #include "CReasonerEvaluationTerminationResult.h" #include "CReasonerEvaluationProvider.h" // Other includes #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerOWLlinkEvaluationProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerOWLlinkEvaluationProvider : public QObject, public CReasonerEvaluationProvider { Q_OBJECT // public methods public: //! Constructor CReasonerOWLlinkEvaluationProvider(); //! Destructor virtual ~CReasonerOWLlinkEvaluationProvider(); virtual bool createReasoner(CConfiguration *config); virtual CReasonerEvaluationTerminationResult* destroyReasoner(); virtual QString getReasonerAddressString(); // protected methods protected: void addLibrariesRecursive(const QString& dirString, QStringList& jarStringList); public slots: void processError(QProcess::ProcessError error); void processFinished(int exitCode, QProcess::ExitStatus exitStatus); // protected variables protected: QString mReasonerName; QString mReasonerClassCallName; cint64 mReasonerPort; cint64 mMemoryLimit; QString mReasonerLibDirectory; QString mReasonerLibSeparator; QString mReasonerAdditionalParameters; QString mSupportProcessString; QProcess* mSupportProcess; QProcess* mAdapterProcess; bool mProcessError; bool mProcessFinished; cint64 mKillTimeout; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEROWLLINKEVALUATIONPROVIDER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationRequestClientThread.cpp0000644000175000017500000004054512520551334031575 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationRequestClientThread.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationRequestClientThread::CReasonerEvaluationRequestClientThread() : CIntervalThread("Reasoner-Evaluation-Request-Client"),CLogIdentifier("::Konclude::Test::ReasonerEvaluationRequestClient",this) { startThread(); } CReasonerEvaluationRequestClientThread::~CReasonerEvaluationRequestClientThread() { stopThread(); } bool CReasonerEvaluationRequestClientThread::evaluateReasoner(const QString& initFileString, const QString& testFileString, const QString& addressString, CConfiguration* configuration, CCallbackData* callback) { postEvent(new CReasonerEvaluationStartEvent(initFileString,testFileString,addressString,configuration,callback)); return true; } CReasonerEvaluationRequestResult* CReasonerEvaluationRequestClientThread::getReasonerEvaluationResult() { return mResponse; } bool CReasonerEvaluationRequestClientThread::processTimer(qint64 timerID) { if (timerID == TIMERIDREQUESTTIMEOUT || timerID == TIMERIDTOTALTIMEOUT) { ++mCurrentOperationNumber; closeAllRequestTimeout(); return true; } return false; } void CReasonerEvaluationRequestClientThread::threadStarted() { CIntervalThread::threadStarted(); mCurrentOperationNumber = 0; mModifyRequestAbsolutePaths = true; mReplaceLoadOntologiesWithTells = false; mResolveAppreviatedIRIsForReplacedTells = false; mResponse = nullptr; mTransManager = new CQtHttpTransactionManager(1000*60*60*24*14); } void CReasonerEvaluationRequestClientThread::threadStopped() { CIntervalThread::threadStopped(); delete mTransManager; } bool CReasonerEvaluationRequestClientThread::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CIntervalThread::processCustomsEvents(type,event)) { return true; } else if (type == CReasonerEvaluationStartEvent::EVENTTYPE) { CReasonerEvaluationStartEvent* rese = (CReasonerEvaluationStartEvent *)event; mResponse = new CReasonerEvaluationRequestResult(); mInitFileString = rese->getInitFileString(); mTestFileString = rese->getTestFileString(); mAddressString = rese->getAddressString(); mConfig = rese->getConfiguration(); mRequestFinishedCallback = rese->getCallback(); ++mCurrentOperationNumber; mRequestTimeout = CConfigDataReader::readConfigInteger(mConfig,"Konclude.Evaluation.RequestTimeout"); mTotalTimeout = CConfigDataReader::readConfigInteger(mConfig,"Konclude.Evaluation.TestingTimeout"); mModifyRequestAbsolutePaths = CConfigDataReader::readConfigInteger(mConfig,"Konclude.Evaluation.RequestFileAbsolutePathsModification"); mReplaceLoadOntologiesWithTells = CConfigDataReader::readConfigInteger(mConfig,"Konclude.Evaluation.RequestReplaceLoadOntologiesWithTell"); mResolveAppreviatedIRIsForReplacedTells = CConfigDataReader::readConfigInteger(mConfig,"Konclude.Evaluation.ResolveAppreviatedIRIsForReplacedTells"); loadReasonerRequests(mInitFileString,mTestFileString); mTotalTiming.start(); startTimerWithIntervalLimited(TIMERIDTOTALTIMEOUT,mTotalTimeout,1); bool sendedNextRequest = false; while (!sendedNextRequest) { if (hasNextRequest()) { sendedNextRequest = sendNextRequest(); } else { finishReasonerRequests(); break; } } return this; } else if (type == CReasonerEvaluationNextEvent::EVENTTYPE) { CReasonerEvaluationNextEvent* rene = (CReasonerEvaluationNextEvent *)event; if (rene->getOperationNumber() == mCurrentOperationNumber) { closeNextRequest(); bool sendedNextRequest = false; while (!sendedNextRequest) { if (hasNextRequest()) { sendedNextRequest = sendNextRequest(); } else { finishReasonerRequests(); break; } } } return this; } return false; } bool CReasonerEvaluationRequestClientThread::finishReasonerRequests() { cint64 totalTime = mTotalTiming.elapsed(); cint64 testingTime = mTestingTiming.elapsed(); mResponse->setResponseTime(testingTime); stopTimer(TIMERIDREQUESTTIMEOUT); stopTimer(TIMERIDTOTALTIMEOUT); if (mRequestFinishedCallback) { mRequestFinishedCallback->doCallback(); mRequestFinishedCallback = nullptr; } return true; } bool CReasonerEvaluationRequestClientThread::closeAllRequestTimeout() { cint64 elapsedTime = mNextRequestTiming.elapsed(); mNextReqRes->setResponseTime(elapsedTime); LOG(INFO,getLogDomain(),logTr("OWLlink request %1 of %2 timed out.").arg(1+mCurrentRequestCount++).arg(mTotalRequestCount),this); mNextReqRes->setTimedOut(true); mResponse->setResponsedInTime(false); mResponse->addResponse(mNextReqRes,mNumberInitRequests-- > 0); while (!mRemainingRequestList.isEmpty()) { CReasonerEvaluationRequestResponse* nextReqResp = mRemainingRequestList.takeFirst(); nextReqResp->setResponseError(true); mResponse->addResponse(nextReqResp,mNumberInitRequests-- > 0); } finishReasonerRequests(); return true; } bool CReasonerEvaluationRequestClientThread::closeNextRequest() { stopTimer(TIMERIDREQUESTTIMEOUT); cint64 elapsedTime = mNextRequestTiming.elapsed(); mNextReqRes->setResponseTime(elapsedTime); LOG(INFO,getLogDomain(),logTr("Received OWLlink response %1 of %2 in %3 ms.").arg(1+mCurrentRequestCount++).arg(mTotalRequestCount).arg(elapsedTime),this); QString* siteText = mTransManager->getExtractedText(mWebResponse); bool responseError = false; if (siteText && !siteText->isEmpty()) { QDomDocument document; if (document.setContent(*siteText)) { QDomElement rootNode = document.documentElement(); QDomElement responseNode = rootNode.firstChildElement(); mNextReqRes->setResponseNode(responseNode); if (responseNode.isNull()) { responseError = true; } } else { responseError = true; } delete siteText; } else { responseError = true; } mNextReqRes->setResponseError(responseError); if (!responseError) { mResponse->setSucessfullReasonerCommunication(true); } mResponse->addResponse(mNextReqRes,mNumberInitRequests-- > 0); mNextReqRes = nullptr; mTransManager->releaseResponse(mWebResponse); return true; } bool CReasonerEvaluationRequestClientThread::hasNextRequest() { return !mRemainingRequestList.isEmpty(); } bool CReasonerEvaluationRequestClientThread::sendNextRequest() { if (mRemainingRequestList.isEmpty()) { return false; } mNextReqRes = mRemainingRequestList.takeFirst(); QDomElement requestElement = mNextReqRes->getModifiedNode(); QString nodeTagString(requestElement.tagName()); if (nodeTagString == "#comment" || nodeTagString == "#text") { LOG(INFO,getLogDomain(),logTr("Skipped OWLlink request %1 of %2, because it is text or comment.").arg(mCurrentRequestCount+1).arg(mTotalRequestCount),this); mNextReqRes->setResponseNode(requestElement); mResponse->addResponse(mNextReqRes,mNumberInitRequests-- > 0); return false; } else { QDomDocument document = createRequestDocument(getAdabtedRequestNode(requestElement)); QByteArray transReqByteArray(document.toByteArray()); if (mNumberInitRequests == 0) { mTestingTiming.start(); } mWebRequest = mTransManager->createRequest(QString("http://%1").arg(mAddressString),transReqByteArray); mNextRequestTiming.start(); startTimerWithIntervalLimited(TIMERIDREQUESTTIMEOUT,mRequestTimeout,1); mWebResponse = mTransManager->getResponse(mWebRequest); mTransManager->callbackFinishedRequest(mWebResponse,new CReasonerEvaluationNextEvent(this,mCurrentOperationNumber)); LOG(INFO,getLogDomain(),logTr("Sending OWLlink request %1 of %2 with command '%3' to '%4'.").arg(mCurrentRequestCount+1).arg(mTotalRequestCount).arg(requestElement.tagName()).arg(mAddressString),this); return true; } } QDomElement CReasonerEvaluationRequestClientThread::getAdabtedRequestNode(QDomElement& el) { if (mModifyRequestAbsolutePaths && el.tagName() == "OntologyIRI") { QString ontoIRI = el.attribute("IRI"); QString relFileString = ontoIRI; relFileString = relFileString.remove(0,5); QDir currFilePath(QDir::currentPath()); QString absFileString = currFilePath.absoluteFilePath(relFileString); if (ontoIRI.startsWith("file:") && !ontoIRI.startsWith("file://")) { absFileString = QUrl::fromLocalFile(absFileString).toString(); el.setAttribute("IRI",absFileString); LOG(INFO,getLogDomain(),logTr("Changed relative filepath '%1' to absolute filepath '%2'.").arg(ontoIRI).arg(absFileString),this); } return el; } if (mReplaceLoadOntologiesWithTells && el.tagName() == "LoadOntologies") { QString kbString = el.attribute("kb"); QDomDocument document; QString owllinkNS = "http://www.owllink.org/owllink#"; QString owlNS = "http://www.w3.org/2002/07/owl#"; QDomElement newTellNode; newTellNode = document.createElementNS(owllinkNS,"Tell"); //newTellNode.setAttributeNS("xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); newTellNode.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); newTellNode.setAttribute("xmlns:owl",owlNS); document.appendChild(newTellNode); newTellNode.setAttribute("kb",kbString); QDomElement ontNode = el.firstChildElement("OntologyIRI"); while (!ontNode.isNull()) { QString ontoIRI = ontNode.attribute("IRI"); QHash appreviatePrefixHash; QString relFileString = ontoIRI; relFileString = relFileString.remove(0,5); QFile ontAxFile(relFileString); if (ontAxFile.open(QIODevice::ReadOnly)) { QDomDocument ontAxDoc; ontAxDoc.setContent(&ontAxFile,true); QDomElement rootNode = ontAxDoc.firstChildElement(); QString xmlBase = rootNode.attribute("base"); QDomElement prefixNode = rootNode.firstChildElement("Prefix"); while (!prefixNode.isNull()) { const QString& prefixName = prefixNode.attribute("name"); const QString& prefixIRI = prefixNode.attribute("IRI"); appreviatePrefixHash.insert(prefixName,prefixIRI); prefixNode = prefixNode.nextSiblingElement("Prefix"); } QDomElement axiomNode = rootNode.firstChildElement(); while (!axiomNode.isNull()) { if (!mResolveAppreviatedIRIsForReplacedTells || axiomNode.tagName() != "Prefix") { QDomElement importedAxiomNode = document.importNode(axiomNode,true).toElement(); if (mResolveAppreviatedIRIsForReplacedTells) { importedAxiomNode = getResolvedAbbreviatedIRIsNode(importedAxiomNode,appreviatePrefixHash,xmlBase); } newTellNode.appendChild(importedAxiomNode); } axiomNode = axiomNode.nextSiblingElement(); } ontAxFile.close(); } ontNode = ontNode.nextSiblingElement("OntologyIRI"); } return newTellNode; } QDomElement child(el.firstChildElement()); while (!child.isNull()) { getAdabtedRequestNode(child); child = child.nextSiblingElement(); } return el; } bool CReasonerEvaluationRequestClientThread::startsWithScheme(const QString& uriString) { for (int i = 0; i < uriString.count()-1; ++i) { const QChar& c = uriString.at(i); if (!c.isLetterOrNumber() && c != '.') { if (c == ':') { return i != 0; } return false; } } return false; } QDomElement CReasonerEvaluationRequestClientThread::getResolvedAbbreviatedIRIsNode(QDomElement& el, const QHash& appreviatePrefixHash, const QString& xmlBase) { QString nextXMLBase = xmlBase; if (el.hasAttribute("base")) { nextXMLBase = el.attribute("base"); } if (el.hasAttribute("IRI")) { QString iriString = el.attribute("IRI"); if (!startsWithScheme(iriString)) { QString iriStringWithXMLBase = nextXMLBase+iriString; el.setAttribute("IRI",iriStringWithXMLBase); } } if (el.hasAttribute("abbreviatedIRI")) { QString abbreviatedIRIString = el.attribute("abbreviatedIRI"); el.removeAttribute("abbreviatedIRI"); cint64 colonPos = abbreviatedIRIString.indexOf(":"); QString prefixName = abbreviatedIRIString.mid(0,colonPos); QString extensionName = appreviatePrefixHash.value(prefixName); QString resolvedName = extensionName+abbreviatedIRIString.mid(colonPos+1); el.setAttribute("IRI",resolvedName); } QDomElement childNode = el.firstChildElement(); while (!childNode.isNull()) { getResolvedAbbreviatedIRIsNode(childNode,appreviatePrefixHash,nextXMLBase); childNode = childNode.nextSiblingElement(); } return el; } bool CReasonerEvaluationRequestClientThread::loadReasonerRequests(const QString& initFileString, const QString& testFileString) { mCurrentRequestCount = 0; mTotalRequestCount = 0; bool loaded = loadReasonerRequest(initFileString); mNumberInitRequests = mRemainingRequestList.count(); loaded &= loadReasonerRequest(testFileString); return loaded; } bool CReasonerEvaluationRequestClientThread::loadReasonerRequest(const QString& requestFileString) { QFile file(requestFileString); if (file.open(QIODevice::ReadOnly)) { QDomDocument document; document.setContent(&file,false); file.close(); QDomElement rootEl = document.documentElement(); cint64 loadedRequestCount = 0; QDomElement childEl = rootEl.firstChildElement(); while (!childEl.isNull()) { CReasonerEvaluationRequestResponse* requestRespone = new CReasonerEvaluationRequestResponse(); requestRespone->setRequestNode(childEl); QDomElement modifiedEl = getModifiedRequestNode(childEl); requestRespone->setModifiedNode(modifiedEl); mRemainingRequestList.append(requestRespone); ++mTotalRequestCount; ++loadedRequestCount; childEl = childEl.nextSiblingElement(); } LOG(INFO,getLogDomain(),logTr("Loaded %1 OWLlink requests from file '%2'.").arg(loadedRequestCount).arg(requestFileString),this); } return true; } QDomDocument CReasonerEvaluationRequestClientThread::createRequestDocument(const QDomElement& reqNode) { QDomDocument document; QString owllinkNS = "http://www.owllink.org/owllink#"; QString owlNS = "http://www.w3.org/2002/07/owl#"; QDomElement rootNode; rootNode = document.createElementNS(owllinkNS,"RequestMessage"); //rootNode.setAttributeNS("xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttribute("xmlns:owl",owlNS); document.appendChild(rootNode); QDomNode importedReqNode = document.importNode(reqNode,true); rootNode.appendChild(importedReqNode); return document; } QDomElement CReasonerEvaluationRequestClientThread::getModifiedRequestNode(const QDomElement& el) { QDomElement modNode = el; QDomElement exResNode = modNode.firstChildElement("ExpectedResult"); while (!exResNode.isNull()) { modNode.removeChild(exResNode); exResNode = modNode.firstChildElement("ExpectedResult"); } return modNode; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationAnalyserChecker.h0000644000175000017500000000515512520551320030357 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONANALYSERCHECKER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONANALYSERCHECKER_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationAnalyserChecker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationAnalyserChecker : public CLogIdentifier { // public methods public: //! Constructor CReasonerEvaluationAnalyserChecker(); //! Destructor virtual ~CReasonerEvaluationAnalyserChecker(); bool checkAnalysingUpdateNecessary(const QStringList& reasonerPathList, const QString& analyserCheckFileString, cint64 maxAnalyseCount); bool saveAnalysingUpdateCheckFile(const QString& analyserCheckFileString); // protected methods protected: bool checkDirsAnalysingUpdateNecessary(const QString& directory, const QString& baseDirectory); bool checkFilesAnalysingUpdateNecessary(const QString& directory, const QString& requestFileString); bool checkAnalysingUpdateNecessary(const QString& baseDirectory); bool loadAnalysingUpdateCheckFile(const QString& analyserCheckFileString); // protected variables protected: // private methods private: QHash mAnalysedResponseCountHash; cint64 mMaxAnalyseCount; // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONANALYSERCHECKER_H ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupReasonerWinnerCountCSV0000644000175000017500000000573012520551326032436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREASONERWINNERCOUNTCSVCOMPARISONANALYSER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREASONERWINNERCOUNTCSVCOMPARISONANALYSER_H // Libraries includes #include #include #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" #include "CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h" #include "CReasonerEvaluationDoubleDataValue.h" #include "CReasonerEvaluationTableMultiFormatOutputWriter.h" #include "CReasonerEvaluationHighchartPlotter.h" // Other includes #include "Config/CConfiguration.h" #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Utilities; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser : public CReasonerEvaluationGroupRequestReasonerComparisonAnalyser { // public methods public: //! Constructor CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser(); //! Destructor virtual ~CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser(); // protected methods protected: virtual bool analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector); QString getPrettyTitleFromOutputFile(const QString& outputFile); // protected variables protected: QString mOutputFileName; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREASONERWINNERCOUNTCSVCOMPARISONANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDoubleDataValue.h0000644000175000017500000000426312520551322030316 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDOUBLEDATAVALUE_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDOUBLEDATAVALUE_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationDoubleDataValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationDoubleDataValue : public CReasonerEvaluationDataValue { // public methods public: //! Constructor CReasonerEvaluationDoubleDataValue(double value = 0.); //! Destructor virtual ~CReasonerEvaluationDoubleDataValue(); virtual CReasonerEvaluationDataValue* getCopy(); virtual QString generateString(); double getValue(); CReasonerEvaluationDoubleDataValue* setValue(double value); // protected methods protected: // protected variables protected: double mValue; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDOUBLEDATAVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/0000755000175000017500000000000012613407262022557 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/CReasonerEvaluationTestsuiteEvent.cpp0000644000175000017500000000315712520551316032113 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationTestsuiteEvent.h" namespace Konclude { namespace Test { namespace Evaluation { namespace Events { CReasonerEvaluationTestsuiteEvent::CReasonerEvaluationTestsuiteEvent(CReasonerEvaluationTestsuite* testsuite, CCallbackData* callbackData) : CCustomEvent(EVENTTYPE) { mEvalTestsuite = testsuite; mCallbackData = callbackData; } CReasonerEvaluationTestsuiteEvent::~CReasonerEvaluationTestsuiteEvent() { } CReasonerEvaluationTestsuite* CReasonerEvaluationTestsuiteEvent::getEvaluationTestsuite() { return mEvalTestsuite; } CCallbackData* CReasonerEvaluationTestsuiteEvent::getCallbackData() { return mCallbackData; } }; // end namespace Events }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/CReasonerEvaluationTestsuiteEvent.h0000644000175000017500000000472612520551316031563 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONTESTSUITEEVENT_H #define KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONTESTSUITEEVENT_H // Libraries includes // Namespace includes #include "../EvaluationSettings.h" #include "../CReasonerEvaluationTestsuite.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Test { namespace Evaluation { namespace Events { /*! * \class CReasonerEvaluationTestsuiteEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CReasonerEvaluationTestsuiteEvent : public CCustomEvent { // public methods public: //! Constructor CReasonerEvaluationTestsuiteEvent(CReasonerEvaluationTestsuite* testsuite, CCallbackData* callbackData); //! Destructor virtual ~CReasonerEvaluationTestsuiteEvent(); static const QEvent::Type EVENTTYPE = EVENTREASONEREVALUATIONTESTSUITE; CReasonerEvaluationTestsuite* getEvaluationTestsuite(); CCallbackData* getCallbackData(); // protected methods protected: // protected variables protected: CReasonerEvaluationTestsuite* mEvalTestsuite; CCallbackData* mCallbackData; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONTESTSUITEEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/CReasonerEvaluationProgramEvent.h0000644000175000017500000000455212520551316031176 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONPROGRAMEVENT_H #define KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONPROGRAMEVENT_H // Libraries includes #include // Namespace includes #include "../EvaluationSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Control/Command/Instructions/CEvaluateTestsuiteCommand.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Control::Command::Instructions; namespace Test { namespace Evaluation { namespace Events { /*! * \class CReasonerEvaluationProgramEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CReasonerEvaluationProgramEvent : public CCustomEvent { // public methods public: //! Constructor CReasonerEvaluationProgramEvent(CEvaluateTestsuiteCommand* evalTestsuiteComm); //! Destructor virtual ~CReasonerEvaluationProgramEvent(); static const QEvent::Type EVENTTYPE = EVENTREASONEREVALUATIONPROGRAM; CEvaluateTestsuiteCommand* getEvaluationTestsuiteCommand(); // protected methods protected: // protected variables protected: CEvaluateTestsuiteCommand* mEvalTestsuiteComm; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONPROGRAMEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/CReasonerEvaluationStartEvent.cpp0000644000175000017500000000403112520551316031207 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationStartEvent.h" namespace Konclude { namespace Test { namespace Evaluation { namespace Events { CReasonerEvaluationStartEvent::CReasonerEvaluationStartEvent(const QString& initFile, const QString& testFile, const QString& addressString, CConfiguration* configuration, CCallbackData* callbackData) : CCustomEvent(EVENTTYPE) { mInitFileString = initFile; mTestFileString = testFile; mAddressString = addressString; mConfiguration = configuration; mCallbackData = callbackData; } CReasonerEvaluationStartEvent::~CReasonerEvaluationStartEvent() { } QString CReasonerEvaluationStartEvent::getInitFileString() { return mInitFileString; } QString CReasonerEvaluationStartEvent::getTestFileString() { return mTestFileString; } CCallbackData* CReasonerEvaluationStartEvent::getCallback() { return mCallbackData; } QString CReasonerEvaluationStartEvent::getAddressString() { return mAddressString; } CConfiguration* CReasonerEvaluationStartEvent::getConfiguration() { return mConfiguration; } }; // end namespace Events }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/CReasonerEvaluationProgramFileChangedEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/CReasonerEvaluationProgramFileChangedEv0000644000175000017500000000271312520551316032310 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationProgramFileChangedEvent.h" namespace Konclude { namespace Test { namespace Evaluation { namespace Events { CReasonerEvaluationProgramFileChangedEvent::CReasonerEvaluationProgramFileChangedEvent(const QString& changedFile) : CCustomEvent(EVENTTYPE) { mChangedFile = changedFile; } CReasonerEvaluationProgramFileChangedEvent::~CReasonerEvaluationProgramFileChangedEvent() { } QString CReasonerEvaluationProgramFileChangedEvent::getChangedFile() { return mChangedFile; } }; // end namespace Events }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/CReasonerEvaluationNextEvent.cpp0000644000175000017500000000304612520551316031035 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationNextEvent.h" namespace Konclude { namespace Test { namespace Evaluation { namespace Events { CReasonerEvaluationNextEvent::CReasonerEvaluationNextEvent(CThread* recieverThread, cint64 operationNumber) : CCustomEvent(EVENTTYPE) { mRecieverThread = recieverThread; mOperationNumber = operationNumber; } CReasonerEvaluationNextEvent::~CReasonerEvaluationNextEvent() { } void CReasonerEvaluationNextEvent::doCallback() { mRecieverThread->postEvent(this); } cint64 CReasonerEvaluationNextEvent::getOperationNumber() { return mOperationNumber; } }; // end namespace Events }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/CReasonerEvaluationNextEvent.h0000644000175000017500000000470212520551316030502 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONNEXTEVENT_H #define KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONNEXTEVENT_H // Libraries includes #include // Namespace includes #include "../EvaluationSettings.h" #include "../CReasonerEvaluationTestsuite.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" #include "Concurrent/CThread.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Test { namespace Evaluation { namespace Events { /*! * \class CReasonerEvaluationNextEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CReasonerEvaluationNextEvent : public CCustomEvent, public CCallbackData { // public methods public: //! Constructor CReasonerEvaluationNextEvent(CThread* recieverThread, cint64 operationNumber); //! Destructor virtual ~CReasonerEvaluationNextEvent(); static const QEvent::Type EVENTTYPE = EVENTREASONEREVALUATIONNEXT; virtual void doCallback(); cint64 getOperationNumber(); // protected methods protected: // protected variables protected: CThread* mRecieverThread; cint64 mOperationNumber; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONNEXTEVENT_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/CReasonerEvaluationProgramFileChangedEvent.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/CReasonerEvaluationProgramFileChangedEv0000644000175000017500000000437012520551316032311 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONPROGRAMFILECHANGEDEVENT_H #define KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONPROGRAMFILECHANGEDEVENT_H // Libraries includes #include // Namespace includes #include "../EvaluationSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Test { namespace Evaluation { namespace Events { /*! * \class CReasonerEvaluationProgramFileChangedEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CReasonerEvaluationProgramFileChangedEvent : public CCustomEvent { // public methods public: //! Constructor CReasonerEvaluationProgramFileChangedEvent(const QString& changedFile); //! Destructor virtual ~CReasonerEvaluationProgramFileChangedEvent(); static const QEvent::Type EVENTTYPE = EVENTREASONEREVALUATIONCHANGEDFILE; QString getChangedFile(); // protected methods protected: // protected variables protected: QString mChangedFile; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONPROGRAMFILECHANGEDEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/CReasonerEvaluationStartEvent.h0000644000175000017500000000534612520551316030666 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONSTARTEVENT_H #define KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONSTARTEVENT_H // Libraries includes #include // Namespace includes #include "../EvaluationSettings.h" #include "../CReasonerEvaluationTestsuite.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; using namespace Config; namespace Test { namespace Evaluation { namespace Events { /*! * \class CReasonerEvaluationStartEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CReasonerEvaluationStartEvent : public CCustomEvent { // public methods public: //! Constructor CReasonerEvaluationStartEvent(const QString& initFile, const QString& testFile, const QString& addressString, CConfiguration* configuration, CCallbackData* callbackData); //! Destructor virtual ~CReasonerEvaluationStartEvent(); static const QEvent::Type EVENTTYPE = EVENTREASONEREVALUATIONSTART; QString getInitFileString(); QString getTestFileString(); QString getAddressString(); CConfiguration* getConfiguration(); CCallbackData* getCallback(); // protected methods protected: // protected variables protected: QString mInitFileString; QString mTestFileString; QString mAddressString; CConfiguration* mConfiguration; CCallbackData* mCallbackData; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONSTARTEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/CReasonerEvaluationUpdateEvent.cpp0000644000175000017500000000260312520551316031337 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationUpdateEvent.h" namespace Konclude { namespace Test { namespace Evaluation { namespace Events { CReasonerEvaluationUpdateEvent::CReasonerEvaluationUpdateEvent(const QString& programFile) : CCustomEvent(EVENTTYPE) { mProgramFile = programFile; } CReasonerEvaluationUpdateEvent::~CReasonerEvaluationUpdateEvent() { } QString CReasonerEvaluationUpdateEvent::getProgramFile() { return mProgramFile; } }; // end namespace Events }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/CReasonerEvaluationProgramEvent.cpp0000644000175000017500000000271712520551316031532 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationProgramEvent.h" namespace Konclude { namespace Test { namespace Evaluation { namespace Events { CReasonerEvaluationProgramEvent::CReasonerEvaluationProgramEvent(CEvaluateTestsuiteCommand* evalTestsuiteComm) : CCustomEvent(EVENTTYPE) { mEvalTestsuiteComm = evalTestsuiteComm; } CReasonerEvaluationProgramEvent::~CReasonerEvaluationProgramEvent() { } CEvaluateTestsuiteCommand* CReasonerEvaluationProgramEvent::getEvaluationTestsuiteCommand() { return mEvalTestsuiteComm; } }; // end namespace Events }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/Events/CReasonerEvaluationUpdateEvent.h0000644000175000017500000000423712520551316031011 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONUPDATEEVENT_H #define KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONUPDATEEVENT_H // Libraries includes #include // Namespace includes #include "../EvaluationSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Test { namespace Evaluation { namespace Events { /*! * \class CReasonerEvaluationUpdateEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CReasonerEvaluationUpdateEvent : public CCustomEvent { // public methods public: //! Constructor CReasonerEvaluationUpdateEvent(const QString& programFile); //! Destructor virtual ~CReasonerEvaluationUpdateEvent(); static const QEvent::Type EVENTTYPE = EVENTREASONEREVALUATIONUPDATE; QString getProgramFile(); // protected methods protected: // protected variables protected: QString mProgramFile; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_EVENTS_CREASONEREVALUATIONUPDATEEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExecutor.h0000644000175000017500000000354012520551324027112 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXECUTOR_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXECUTOR_H // Libraries includes // Namespace includes #include "CReasonerEvaluationTestsuite.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationExecutor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationExecutor { // public methods public: //! Constructor CReasonerEvaluationExecutor(); //! Destructor virtual ~CReasonerEvaluationExecutor(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXECUTOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationManagerThread.h0000644000175000017500000001437312520551332030023 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONMANAGERTHREAD_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONMANAGERTHREAD_H // Libraries includes #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationManager.h" #include "CReasonerEvaluationExecutorThread.h" #include "CReasonerEvaluationTestsuite.h" #include "CReasonerEvaluationCollector.h" #include "CReasonerEvaluationClassificationTimeExtractor.h" #include "CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" #include "CReasonerEvaluationAvaragerSummarizer.h" #include "CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser.h" #include "CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser.h" #include "CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser.h" #include "CReasonerEvaluationHighchartPlotter.h" #include "CReasonerEvaluationPathConverter.h" #include "CReasonerEvaluationExpressivitySelectorFactory.h" #include "CReasonerEvaluationDirectoryStructureSelectorFactory.h" #include "CReasonerEvaluationLoadingTimeExtractor.h" #include "CReasonerEvaluationAnalyserChecker.h" #include "CReasonerEvaluationResponseFileExtractor.h" #include "CReasonerEvaluationResponseFileListSummarizer.h" #include "CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser.h" #include "CReasonerEvaluationResponseTimeExtractor.h" #include "CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser.h" #include "CReasonerEvaluationHTMLNavigationOverviewSummarizer.h" #include "CReasonerEvaluationGroupRequestReasonerErrorAnalyser.h" #include "CReasonerEvaluationTimeoutErrorExtractor.h" #include "CReasonerEvaluationProfileSelectorFactory.h" #include "CReasonerEvaluationSpecifiedTimeExtractor.h" #include "CReasonerEvaluationDataValueCacher.h" #include "CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser.h" #include "CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser.h" #include "CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser.h" #include "CReasonerEvaluationStatisticsValueExtractor.h" #include "CReasonerEvaluationStatisticsNameCollectingExtractor.h" #include "CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser.h" #include "CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser.h" // Other includes #include "Config/CConfiguration.h" #include "Concurrent/CThread.h" #include "Test/Evaluation/Events/CReasonerEvaluationProgramEvent.h" #include "Control/Command/CConfigManagerReader.h" #include "Control/Command/Records/CStartProcessCommandRecord.h" #include "Control/Command/Records/CStopProcessCommandRecord.h" #include "Control/Command/Records/CFinishProcessCommandRecord.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Config; using namespace Logger; using namespace Concurrent; using namespace Control::Command; using namespace Control::Command::Records; using namespace Control::Command::Instructions; namespace Test { namespace Evaluation { using namespace Evaluation::Events; /*! * * \class CReasonerEvaluationManagerThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationManagerThread : public CThread, public CReasonerEvaluationManager, public CLogIdentifier { // public methods public: //! Constructor CReasonerEvaluationManagerThread(CConfiguration *config); //! Destructor virtual ~CReasonerEvaluationManagerThread(); virtual CReasonerEvaluationManager* realizeEvaluationCommand(CEvaluateTestsuiteCommand* evalTestsuiteComm); // protected methods protected: virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent* event); bool evaluationProgram(CEvaluateTestsuiteCommand* evalTestsuiteComm); CReasonerEvaluationManager* analysingProgram(CEvaluateTestsuiteCommand* evalTestsuiteComm); bool analyseTimes(const QString& analysingDirectoryString, const QString& evaluationProgramName, const QString& plattform, const QString& analyserOutputDirectoryName, const QString& requestDirectory, cint64 testCountCut, cint64 timeoutCut, cint64 errorPunishmentTime, CReasonerEvaluationDataValueCacher* dataValueCacher, CReasonerEvaluationExtractor::EXTRACTORTYPE extractorType, const QString& extractionName, const QString& contextSpecificationName); CReasonerEvaluationManager* initEvaluationProgram(CEvaluateTestsuiteCommand* evalTestsuiteComm); CReasonerEvaluationGroupRequestSelector* getSelectors(const QString& requestDirecroty); QString getAnalyserOutputDirectory(const QString& baseDirectory, const QString& evaluationProgramName, const QString& platformName, const QString& analyserName); // protected variables protected: CConfiguration* mConfig; QStringList mReasonerNameStringList; QStringList mReasonerOutputDirStringList; cint64 mTestTimeout; cint64 mTestCount; QString mSatisticBasePath; QStringList mFailedReasonerStringList; QStringList mFitlerStringList; CReasonerEvaluationFiltering* mFiltering; bool mOneReasonerFailed; bool mAllReasonerFailed; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONMANAGERTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGNUPlotPlotter.h0000644000175000017500000000526212520551326030163 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGNUPLOTPLOTTER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGNUPLOTPLOTTER_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationGNUPlotPlotter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationGNUPlotPlotter { // public methods public: //! Constructor CReasonerEvaluationGNUPlotPlotter(CReasonerEvaluationAnalyseContext* context); //! Destructor virtual ~CReasonerEvaluationGNUPlotPlotter(); CReasonerEvaluationGNUPlotPlotter* createReasonerComparisonPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile); CReasonerEvaluationGNUPlotPlotter* createReasonerOverviewPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile); // protected methods protected: QString getColorString(const QString& reasonerString, QSet* usedReasonerColorSet = nullptr); CReasonerEvaluationGNUPlotPlotter* plotScriptFile(const QString& scriptFileString); // protected variables protected: CReasonerEvaluationAnalyseContext* mContext; QString mReasCompTemplateString; QString mReasOverTemplateString; QHash mReasColorHash; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGNUPLOTPLOTTER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationAnalyseContext.h0000644000175000017500000000542612520551320030256 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONANALYSECONTEXT_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONANALYSECONTEXT_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Context; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationAnalyseContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationAnalyseContext : public CContext { // public methods public: //! Constructor CReasonerEvaluationAnalyseContext(CConfiguration* configuration = nullptr, const QString& additionalTitleString = QString(), const QString& additionalFileString = QString()); //! Destructor virtual ~CReasonerEvaluationAnalyseContext(); CMemoryAllocationManager* getMemoryAllocationManager(); CConfiguration* getConfiguration(); CReasonerEvaluationGNUPlotPlotter* getGNUPlotPlotter(); CReasonerEvaluationHighchartPlotter* getHighchartPlotter(); QString getAdditionalTitleString(); QString getAdditionalFileString(); bool isGNUPlottingActivated(); bool isHighchartPlottingActivated(); // protected methods protected: // protected variables protected: CConfiguration* mConfiguration; CReasonerEvaluationGNUPlotPlotter* mGNUPlotPlotter; CReasonerEvaluationHighchartPlotter* mHighchartPlotter; QString mAdditionalTitleString; QString mAdditionalFileString; bool mGNUPlot; bool mHighchartPlot; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONANALYSECONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerExecutableEvaluationProvider.h0000644000175000017500000000537312520551340031114 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREXECUTABLEEVALUATIONPROVIDER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREXECUTABLEEVALUATIONPROVIDER_H // Libraries includes #include #include #include #include #include // Namespace includes #include "CReasonerEvaluationTerminationResult.h" #include "CReasonerEvaluationProvider.h" // Other includes #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerExecutableEvaluationProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerExecutableEvaluationProvider : public QObject, public CReasonerEvaluationProvider { Q_OBJECT // public methods public: //! Constructor CReasonerExecutableEvaluationProvider(); //! Destructor virtual ~CReasonerExecutableEvaluationProvider(); virtual bool createReasoner(CConfiguration *config); virtual CReasonerEvaluationTerminationResult* destroyReasoner(); virtual QString getReasonerAddressString(); // protected methods protected: bool assistTermination(Q_PID processID); public slots: void processError(QProcess::ProcessError error); void processFinished(int exitCode, QProcess::ExitStatus exitStatus); // protected variables protected: QString mReasonerName; QString mReasonerBinaryFile; QString mReasonerBinaryArguments; cint64 mReasonerPort; QProcess* mProcess; bool mProcessError; bool mProcessFinished; cint64 mKillTimeout; QString mKillScriptString; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREXECUTABLEEVALUATIONPROVIDER_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerCompari0000644000175000017500000001206012520551330032537 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationGroupRequestReasonerComparisonAnalyser::CReasonerEvaluationGroupRequestReasonerComparisonAnalyser() { } CReasonerEvaluationGroupRequestReasonerComparisonAnalyser::~CReasonerEvaluationGroupRequestReasonerComparisonAnalyser() { } CReasonerEvaluationAnalyser* CReasonerEvaluationGroupRequestReasonerComparisonAnalyser::analyseEvaluationData(CReasonerEvaluationDataValueGroupCollectionReasonerComparison* evaluationData, CReasonerEvaluationAnalyseContext* context, const QString& outputDirectory, CReasonerEvaluationGroupRequestSelector* selectors) { QStringList reasonerList; QStringList groubList; QStringList requestList; QSet groupStringSet; QSet requestStringSet; mGroupRequestSetHash.clear(); mReasonerCollectionMap = evaluationData->getReasonerCollectionMap(); for (QMap::const_iterator it1 = mReasonerCollectionMap->constBegin(), it1End = mReasonerCollectionMap->constEnd(); it1 != it1End; ++it1) { QString reasonerString(it1.key()); reasonerList.append(reasonerString); CReasonerEvaluationDataValueGroupCollection* groupCollection(it1.value()); QMap* nameGroupMap = groupCollection->getNameGroupMap(); for (QMap::const_iterator it2 = nameGroupMap->constBegin(), it2End = nameGroupMap->constEnd(); it2 != it2End; ++it2) { QString groupString(it2.key()); groupStringSet.insert(groupString); QSet* groupRequestSet = mGroupRequestSetHash.value(groupString); if (!groupRequestSet) { groupRequestSet = new QSet(); mRequestSetContainer.append(groupRequestSet); mGroupRequestSetHash.insert(groupString,groupRequestSet); } CReasonerEvaluationDataValueGroup* group(it2.value()); QMap* requestDataValueMap = group->getRequestDataValueMap(); for (QMap::const_iterator it3 = requestDataValueMap->constBegin(), it3End = requestDataValueMap->constEnd(); it3 != it3End; ++it3) { QString requestString(it3.key()); requestStringSet.insert(requestString); groupRequestSet->insert(requestString); } } } for (QSet::const_iterator it1 = groupStringSet.constBegin(), it1End = groupStringSet.constEnd(); it1 != it1End; ++it1) { groubList.append(*it1); } for (QSet::const_iterator it1 = requestStringSet.constBegin(), it1End = requestStringSet.constEnd(); it1 != it1End; ++it1) { requestList.append(*it1); } for (CReasonerEvaluationGroupRequestSelector* selectorsIt = selectors; selectorsIt; selectorsIt = selectorsIt->getNext()) { analyseGroupedEvaluationData(groubList,requestList,reasonerList,outputDirectory,context,selectorsIt); } qDeleteAll(mRequestSetContainer); mRequestSetContainer.clear(); return this; } QSet* CReasonerEvaluationGroupRequestReasonerComparisonAnalyser::getGroupRequests(const QString& groupName) { return mGroupRequestSetHash.value(groupName); } CReasonerEvaluationDataValue* CReasonerEvaluationGroupRequestReasonerComparisonAnalyser::getGroupRequestReasonerEvaluationData(const QString& groupName, const QString& requstName, const QString& reasonerName) { CReasonerEvaluationDataValue* evaluationData = nullptr; CReasonerEvaluationDataValueGroupCollection* groupCollection = mReasonerCollectionMap->value(reasonerName); if (groupCollection) { QMap* nameGroupMap = groupCollection->getNameGroupMap(); if (nameGroupMap) { CReasonerEvaluationDataValueGroup* group = nameGroupMap->value(groupName); if (group) { QMap* requestDataValueMap = group->getRequestDataValueMap(); if (requestDataValueMap) { evaluationData = requestDataValueMap->value(requstName); } } } } return evaluationData; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationAvaragerSummarizer.h0000644000175000017500000000426712520551320031126 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CReasonerEvaluationAvaragerSummarizer_H #define KONCLUDE_TEST_EVALUATION_CReasonerEvaluationAvaragerSummarizer_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" #include "CReasonerEvaluationSummarizer.h" #include "CReasonerEvaluationDoubleDataValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationAvaragerSummarizer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationAvaragerSummarizer : public CReasonerEvaluationSummarizer { // public methods public: //! Constructor CReasonerEvaluationAvaragerSummarizer(); //! Destructor virtual ~CReasonerEvaluationAvaragerSummarizer(); virtual CReasonerEvaluationDataValue* summarizeEvaluationData(CReasonerEvaluationDataValue* dataValues); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CReasonerEvaluationAvaragerSummarizer_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CCriticalSystemProcessTester.h0000644000175000017500000000377512520551320027260 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CCRITICALSYSTEMPROCESSTESTER_H #define KONCLUDE_TEST_EVALUATION_CCRITICALSYSTEMPROCESSTESTER_H // Libraries includes #include #include #include #include #include // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CCriticalSystemProcessTester * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCriticalSystemProcessTester { // public methods public: //! Constructor CCriticalSystemProcessTester(CConfiguration *config); bool hasCriticalSystemProcesses(); // protected methods protected: // protected variables protected: CConfiguration* mConfig; QString mTestScriptString; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CCRITICALSYSTEMPROCESSTESTER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationAnalyser.cpp0000644000175000017500000000220012520551320027411 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationAnalyser.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationAnalyser::CReasonerEvaluationAnalyser() { } CReasonerEvaluationAnalyser::~CReasonerEvaluationAnalyser() { } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationEvaluatedCallbackContextData.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationEvaluatedCallbackContextDat0000644000175000017500000000527212520551322032415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEVALUATEDCALLBACKCONTEXTDATA_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEVALUATEDCALLBACKCONTEXTDATA_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Concurrent/Callback/CCallbackDataContext.h" #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; using namespace Utilities; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationEvaluatedCallbackContextData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationEvaluatedCallbackContextData : public CCallbackDataContext { // public methods public: //! Constructor CReasonerEvaluationEvaluatedCallbackContextData(bool failed); CReasonerEvaluationEvaluatedCallbackContextData(bool runned, const QString& reasonerNameString, const QString& reasonerOutputDirString, cint64 testTimeout, cint64 testCount); bool getEvaluationRunned(); bool getEvaluationFailed(); CReasonerEvaluationEvaluatedCallbackContextData* getEvaluationRunned(bool runned); QString getReasonerNameString(); QString getReasonerOutputDirectoryString(); cint64 getTestTimeout(); cint64 getTestCount(); // protected methods protected: // protected variables protected: bool mEvaluationRunned; bool mEvaluationFailed; QString mReasonerNameString; QString mReasonerOutputDirectoryString; cint64 mTestTimeout; cint64 mTestCount; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEVALUATEDCALLBACKCONTEXTDATA_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationManager.h0000644000175000017500000000407212520551332026666 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONMANAGER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONMANAGER_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" #include "Control/Command/Instructions/CEvaluateTestsuiteCommand.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Control::Command::Instructions; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationManager { // public methods public: //! Constructor CReasonerEvaluationManager(); //! Destructor virtual ~CReasonerEvaluationManager(); virtual CReasonerEvaluationManager* realizeEvaluationCommand(CEvaluateTestsuiteCommand* evalTestsuiteComm) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExecutor.cpp0000644000175000017500000000220012520551324027435 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationExecutor.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationExecutor::CReasonerEvaluationExecutor() { } CReasonerEvaluationExecutor::~CReasonerEvaluationExecutor() { } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerKoncludeEvaluationProvider.h0000644000175000017500000000535512520551342030601 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONERKONCLUDEEVALUATIONPROVIDER_H #define KONCLUDE_TEST_EVALUATION_CREASONERKONCLUDEEVALUATIONPROVIDER_H // Libraries includes #include #include #include #include #include // Namespace includes #include "CReasonerEvaluationTerminationResult.h" #include "CReasonerEvaluationProvider.h" // Other includes #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerKoncludeEvaluationProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerKoncludeEvaluationProvider : public QObject, public CReasonerEvaluationProvider { Q_OBJECT // public methods public: //! Constructor CReasonerKoncludeEvaluationProvider(); //! Destructor virtual ~CReasonerKoncludeEvaluationProvider(); virtual bool createReasoner(CConfiguration *config); virtual CReasonerEvaluationTerminationResult* destroyReasoner(); virtual QString getReasonerAddressString(); // protected methods protected: bool assistTermination(Q_PID processID); public slots: void processError(QProcess::ProcessError error); void processFinished(int exitCode, QProcess::ExitStatus exitStatus); // protected variables protected: QString mReasonerName; QString mReasonerBinaryFile; QString mReasonerBinaryArguments; cint64 mReasonerPort; QProcess* mProcess; bool mProcessError; bool mProcessFinished; cint64 mKillTimeout; QString mKillScriptString; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONERKONCLUDEEVALUATIONPROVIDER_H ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupReasonerWinnerCountCSV0000644000175000017500000002336412520551326032441 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser::CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser() { } CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser::~CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser() { } bool CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser::analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector) { mOutputFileName = QString("%1").arg(selector->getOutputString()); cint64 reasonerCount = reasonerList.count(); bool hasSelectedRequestFile = false; QDir outDir(outputDirectory); outDir.mkpath(mOutputFileName); cint64** winnerTable = new cint64*[reasonerCount]; for (cint64 i = 0; i < reasonerCount; ++i) { cint64* tmpVec = new cint64[reasonerCount]; winnerTable[i] = tmpVec; for (cint64 j = 0; j < reasonerCount; ++j) { tmpVec[j] = 0; } } cint64** timesFasterTable = new cint64*[reasonerCount]; for (cint64 i = 0; i < reasonerCount; ++i) { cint64* tmpVec = new cint64[reasonerCount]; timesFasterTable[i] = tmpVec; for (cint64 j = 0; j < reasonerCount; ++j) { tmpVec[j] = 0; } } double** fasterTable = new double*[reasonerCount]; for (cint64 i = 0; i < reasonerCount; ++i) { double* tmpVec = new double[reasonerCount]; fasterTable[i] = tmpVec; for (cint64 j = 0; j < reasonerCount; ++j) { tmpVec[j] = 0.; } } QHash reasonerWinnerCountHash; QHash reasonerTimesFasterCountHash; QHash reasonerFasterHash; QHash reasonerIndexHash; cint64 index = 0; foreach (QString reasonerString, reasonerList) { reasonerWinnerCountHash.insert(reasonerString,winnerTable[index]); reasonerTimesFasterCountHash.insert(reasonerString,timesFasterTable[index]); reasonerFasterHash.insert(reasonerString,fasterTable[index]); reasonerIndexHash.insert(reasonerString,index++); } cint64 requestCount = 0; foreach (QString groupString, groubList) { if (selector->isGroupSelected(groupString)) { QSet* groupRequestList = getGroupRequests(groupString); foreach (QString requestString, *groupRequestList) { if (selector->isRequestSelected(groupString,requestString)) { bool allDataAvailable = true; foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); if (!evalData || evalData->hasDataNotAvailableFlag()) { allDataAvailable = false; } } if (allDataAvailable) { hasSelectedRequestFile = true; requestCount++; QMap timeReasonerMap; QString requestReasonerTabList(requestString); foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); CReasonerEvaluationDoubleDataValue* doubleEvalData = dynamic_cast(evalData); if (doubleEvalData) { timeReasonerMap.insertMulti(doubleEvalData->getValue(),reasonerString); } } cint64 index = 0; for (QMap::const_iterator it = timeReasonerMap.constBegin(), itEnd = timeReasonerMap.constEnd(); it != itEnd; ++it) { QString reasonerString = it.value(); cint64* tmpWinnerVec = reasonerWinnerCountHash.value(reasonerString); ++tmpWinnerVec[index]; cint64* tmpTimesFasterVec = reasonerTimesFasterCountHash.value(reasonerString); QMap::const_iterator it2 = it; for (++it2; it2 != itEnd; ++it2) { QString slowerReasonerString = it2.value(); cint64 slowerReasonerIndex = reasonerIndexHash.value(slowerReasonerString); ++tmpTimesFasterVec[slowerReasonerIndex]; } double* tmpFasterVec = reasonerFasterHash.value(reasonerString); for (QMap::const_iterator it2 = timeReasonerMap.constBegin(); it2 != itEnd; ++it2) { if (it != it2) { double val1 = it.key(); double val2 = it2.key(); QString otherReasonerString = it2.value(); cint64 otherReasonerIndex = reasonerIndexHash.value(otherReasonerString); double faster = (val2 / val1)-1; if (val2 < val1) { faster = -((val1 / val2)-1); } if (val2 == val1 || val1 == 0 || val2 == 0) { faster = 0.; } tmpFasterVec[otherReasonerIndex] += faster; } } ++index; } } } } } } for (cint64 i = 0; i < reasonerCount; ++i) { for (cint64 j = 0; j < reasonerCount; ++j) { fasterTable[i][j] = fasterTable[i][j] / (double)requestCount; } } if (hasSelectedRequestFile) { CReasonerEvaluationTableMultiFormatOutputWriter winnerCountOutputWriter; winnerCountOutputWriter.addColumnTitles(QStringList()<<"Ranking"<()<isHighchartPlottingActivated()) { foreach (QString plotFileString, reasonerCompHighchartPlotFileList) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createReasonerWinnerCountPlot(plotFileString,context->getAdditionalTitleString()+title+" and Rankings",reasonerList,outputFile,selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } CReasonerEvaluationTableMultiFormatOutputWriter fasterCountOutputWriter; fasterCountOutputWriter.addColumnTitles(QStringList()<<"Reasoner"<()< avgFasterOutputWriter; avgFasterOutputWriter.addColumnTitles(QStringList()<<"Reasoner"<()<= 0) { title = title.mid(slashPos+1); } title.replace("-"," "); title.replace("winner","Winner"); title.replace("count","Count"); return title; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationProgram.cpp0000644000175000017500000000635712520551334027270 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationProgram.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationProgram::CReasonerEvaluationProgram() { } CReasonerEvaluationProgram* CReasonerEvaluationProgram::setConfigFileString(const QString& configFileString) { mConfigFileString = configFileString; return this; } CReasonerEvaluationProgram* CReasonerEvaluationProgram::setInputDirectoryString(const QString& inputString) { mInputDirString = inputString; return this; } CReasonerEvaluationProgram* CReasonerEvaluationProgram::setOutputDirectoryString(const QString& outputString) { mOutputDirString = outputString; return this; } CReasonerEvaluationProgram* CReasonerEvaluationProgram::setAnalyserDirectoryString(const QString& analyserString) { mAnalyserDirString = analyserString; return this; } CReasonerEvaluationProgram* CReasonerEvaluationProgram::setProgramName(const QString& programName) { mProgramName = programName; return this; } CReasonerEvaluationProgram* CReasonerEvaluationProgram::appendReasonerString(const QString& reasonerString) { mReasonerStringList.append(reasonerString); return this; } CReasonerEvaluationProgram* CReasonerEvaluationProgram::appendAnalyserString(const QString& analyserString) { mAnalyserStringList.append(analyserString); return this; } CReasonerEvaluationProgram* CReasonerEvaluationProgram::appendFilterString(const QString& filterString) { mFilterStringList.append(filterString); return this; } QString CReasonerEvaluationProgram::getConfigFileString() { return mConfigFileString; } QString CReasonerEvaluationProgram::getInputDirectoryString() { return mInputDirString; } QString CReasonerEvaluationProgram::getOutputDirectoryString() { return mOutputDirString; } QStringList CReasonerEvaluationProgram::getReasonerStringList() { return mReasonerStringList; } QStringList CReasonerEvaluationProgram::getAnalyserStringList() { return mAnalyserStringList; } QStringList CReasonerEvaluationProgram::getFilterStringList() { return mFilterStringList; } QString CReasonerEvaluationProgram::getAnalyserDirectoryString() { return mAnalyserDirString; } QString CReasonerEvaluationProgram::getProgramName() { return mProgramName; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExpressivityRequestSelector.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExpressivityRequestSelector0000644000175000017500000000563312520551324032663 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXPRESSIVITYREQUESTSELECTOR_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXPRESSIVITYREQUESTSELECTOR_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGroupRequestSelector.h" // Other includes #include "Reasoner/Ontology/COntologyExpressivity.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Reasoner::Ontology; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationExpressivityRequestSelector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationExpressivityRequestSelector : public CReasonerEvaluationGroupRequestSelector { // public methods public: //! Constructor CReasonerEvaluationExpressivityRequestSelector(); CReasonerEvaluationExpressivityRequestSelector(const QList& equalBoundList, const QString& baseExpressivityDir); CReasonerEvaluationExpressivityRequestSelector(const QList& lowerNotIncludedBoundList, const QList& upperIncludedBoundList, const QString& baseExpressivityDir); virtual bool isGroupSelected(const QString& groupString); virtual bool isRequestSelected(const QString& groupString, const QString& requestString); // protected methods protected: // protected variables protected: QList mEqualBoundList; QList mExcludedBoundList; QList mLowerNotIncludedBoundList; QList mLowerIncludedBoundList; QList mUpperNotIncludedBoundList; QList mUpperIncludedBoundList; QString mBaseExpressivityDir; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXPRESSIVITYREQUESTSELECTOR_H ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerResultD0000644000175000017500000001001712520551330032527 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERRESULTDIFFERENCEANALYSER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERRESULTDIFFERENCEANALYSER_H // Libraries includes #include #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGNUPlotPlotter.h" #include "CReasonerEvaluationHighchartPlotter.h" #include "CReasonerEvaluationAnalyseContext.h" #include "CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" #include "CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h" #include "CReasonerEvaluationDoubleDataValue.h" #include "CReasonerEvaluationTableMultiFormatOutputWriter.h" #include "CReasonerEvaluationStringListValue.h" // Other includes #include "Config/CConfiguration.h" #include "Parser/COWLlinkQtXMLResultParser.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Parser; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser : public CReasonerEvaluationGroupRequestReasonerComparisonAnalyser { // public methods public: //! Constructor CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser(); //! Destructor virtual ~CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser(); // protected methods protected: virtual bool analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector); QString getPrettyTitleFromOutputFile(const QString& outputFile); cint64 compareResultsSimilarityWithOtherReasoners(const QString& groupString, const QString& requestString, const QString& reasonerString, CReasonerEvaluationStringListValue* stringListDataValue, const QStringList& reasonerList); bool isClassHierarchyResultSimilarTo(CClassHierarchyResult* classHierResult, cint64 nodeNumber, const QString& otherResponseFileString); bool isBooleanResultSimilarTo(CBooleanQueryResult* booleanResult, cint64 nodeNumber, const QString& otherResponseFileString); bool isClassesResultSimilarTo(CClassesResult* classesResult, cint64 nodeNumber, const QString& otherResponseFileString); // protected variables protected: QString mOutputFileName; COWLlinkQtXMLResultParser mResultParser; QHash,cint64>* > mNumberCompareDiffCountHashHash; QHash,cint64> mReasonerCompareDiffCountHash; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERRESULTDIFFERENCEANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationProfileSelectorFactory.cpp0000644000175000017500000001043612520551334032303 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationProfileSelectorFactory.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationProfileSelectorFactory::CReasonerEvaluationProfileSelectorFactory(const QString& baseEvalName, const QString& baseOutputDir, const QString& expressivityDir) { mBaseEvalName = baseEvalName; mBaseOutputDir = baseOutputDir; mExpressivityDir = expressivityDir; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationProfileSelectorFactory::getSelectors(CReasonerEvaluationGroupRequestSelector* prevSelector) { CReasonerEvaluationGroupRequestSelector* selectors = prevSelector; selectors = getSelectorsForDLProfile(selectors); selectors = getSelectorsForRLProfile(selectors); selectors = getSelectorsForQLProfile(selectors); selectors = getSelectorsForELProfile(selectors); return selectors; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationProfileSelectorFactory::getSelectorsForDLProfile(CReasonerEvaluationGroupRequestSelector* prevSelector) { CReasonerEvaluationGroupRequestSelector* selectors = prevSelector; CReasonerEvaluationGroupRequestSelector* tmpSelector = nullptr; tmpSelector = new CReasonerEvaluationProfileRequestSelector(CReasonerEvaluationProfileRequestSelector::REPRS_PROFILE_DL,mExpressivityDir); tmpSelector->setNameString(mBaseEvalName+" :: OWL-DL"); tmpSelector->setOutputString(mBaseOutputDir+"OWL-DL/"); selectors = tmpSelector->append(selectors); return selectors; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationProfileSelectorFactory::getSelectorsForRLProfile(CReasonerEvaluationGroupRequestSelector* prevSelector) { CReasonerEvaluationGroupRequestSelector* selectors = prevSelector; CReasonerEvaluationGroupRequestSelector* tmpSelector = nullptr; tmpSelector = new CReasonerEvaluationProfileRequestSelector(CReasonerEvaluationProfileRequestSelector::REPRS_PROFILE_RL,mExpressivityDir); tmpSelector->setNameString(mBaseEvalName+" :: OWL-RL"); tmpSelector->setOutputString(mBaseOutputDir+"OWL-RL/"); selectors = tmpSelector->append(selectors); return selectors; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationProfileSelectorFactory::getSelectorsForELProfile(CReasonerEvaluationGroupRequestSelector* prevSelector) { CReasonerEvaluationGroupRequestSelector* selectors = prevSelector; CReasonerEvaluationGroupRequestSelector* tmpSelector = nullptr; tmpSelector = new CReasonerEvaluationProfileRequestSelector(CReasonerEvaluationProfileRequestSelector::REPRS_PROFILE_EL,mExpressivityDir); tmpSelector->setNameString(mBaseEvalName+" :: OWL-EL"); tmpSelector->setOutputString(mBaseOutputDir+"OWL-EL/"); selectors = tmpSelector->append(selectors); return selectors; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationProfileSelectorFactory::getSelectorsForQLProfile(CReasonerEvaluationGroupRequestSelector* prevSelector) { CReasonerEvaluationGroupRequestSelector* selectors = prevSelector; CReasonerEvaluationGroupRequestSelector* tmpSelector = nullptr; tmpSelector = new CReasonerEvaluationProfileRequestSelector(CReasonerEvaluationProfileRequestSelector::REPRS_PROFILE_QL,mExpressivityDir); tmpSelector->setNameString(mBaseEvalName+" :: OWL-QL"); tmpSelector->setOutputString(mBaseOutputDir+"OWL-QL/"); selectors = tmpSelector->append(selectors); return selectors; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationRequestClient.h0000644000175000017500000000353112520551334030104 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTCLIENT_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTCLIENT_H // Libraries includes // Namespace includes // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationRequestClient * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationRequestClient { // public methods public: //! Constructor CReasonerEvaluationRequestClient(); //! Destructor virtual ~CReasonerEvaluationRequestClient(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTCLIENT_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationAnalyser.h0000644000175000017500000000352612520551320027072 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONANALYSER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONANALYSER_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationAnalyser { // public methods public: //! Constructor CReasonerEvaluationAnalyser(); //! Destructor virtual ~CReasonerEvaluationAnalyser(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationSummarizer.h0000644000175000017500000000400112520551340027441 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSUMMARIZER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSUMMARIZER_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationSummarizer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationSummarizer { // public methods public: //! Constructor CReasonerEvaluationSummarizer(); //! Destructor virtual ~CReasonerEvaluationSummarizer(); virtual CReasonerEvaluationDataValue* summarizeEvaluationData(CReasonerEvaluationDataValue* dataValues) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSUMMARIZER_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExpressivitySelectorFactory.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExpressivitySelectorFactory0000644000175000017500000001615412520551324032642 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationExpressivitySelectorFactory.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationExpressivitySelectorFactory::CReasonerEvaluationExpressivitySelectorFactory(const QString& baseEvalName, const QString& baseOutputDir, const QString& expressivityDir) { mBaseEvalName = baseEvalName; mBaseOutputDir = baseOutputDir; mExpressivityDir = expressivityDir; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationExpressivitySelectorFactory::getSelectors(CReasonerEvaluationGroupRequestSelector* prevSelector) { CReasonerEvaluationGroupRequestSelector* selectors = prevSelector; selectors = getSelectorsForELToELPlusPlus(selectors); selectors = getSelectorsForALToSHIQ(selectors); selectors = getSelectorsForALToSROIQ(selectors); selectors = getSelectorsForSHIQToSROIQ(selectors); selectors = getSelectorsForALEHIFTransivityToSROIQ(selectors); selectors = getSelectorsForALToALEHIFTransivity(selectors); selectors = getSelectorsForALToALERTransivity(selectors); return selectors; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationExpressivitySelectorFactory::getSelectorsForELToELPlusPlus(CReasonerEvaluationGroupRequestSelector* prevSelector) { CReasonerEvaluationGroupRequestSelector* selectors = prevSelector; CReasonerEvaluationGroupRequestSelector* tmpSelector = nullptr; tmpSelector = new CReasonerEvaluationExpressivityRequestSelector(QList()<setNameString(mBaseEvalName+" :: [EL-EL++]"); tmpSelector->setOutputString(mBaseOutputDir+"[EL-EL++]/"); selectors = tmpSelector->append(selectors); return selectors; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationExpressivitySelectorFactory::getSelectorsForALToSHIQ(CReasonerEvaluationGroupRequestSelector* prevSelector) { QString outputDirString = mBaseOutputDir+"[AL-SHIQ]/"; CReasonerEvaluationGroupRequestSelector* selectors = prevSelector; CReasonerEvaluationGroupRequestSelector* tmpSelector = nullptr; tmpSelector = new CReasonerEvaluationExpressivityRequestSelector(QList(),QList()<setNameString(mBaseEvalName+" :: [AL-SHIQ]"); tmpSelector->setOutputString(outputDirString); selectors = tmpSelector->append(selectors); return selectors; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationExpressivitySelectorFactory::getSelectorsForALToSROIQ(CReasonerEvaluationGroupRequestSelector* prevSelector) { QString outputDirString = mBaseOutputDir+"[AL-SROIQ]/"; CReasonerEvaluationGroupRequestSelector* selectors = prevSelector; CReasonerEvaluationGroupRequestSelector* tmpSelector = nullptr; tmpSelector = new CReasonerEvaluationExpressivityRequestSelector(QList(),QList()<setNameString(mBaseEvalName+" :: [AL-SROIQ]"); tmpSelector->setOutputString(outputDirString); selectors = tmpSelector->append(selectors); return selectors; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationExpressivitySelectorFactory::getSelectorsForSHIQToSROIQ(CReasonerEvaluationGroupRequestSelector* prevSelector) { QString outputDirString = mBaseOutputDir+"(SHIQ-SROIQ]/"; CReasonerEvaluationGroupRequestSelector* selectors = prevSelector; CReasonerEvaluationGroupRequestSelector* tmpSelector = nullptr; tmpSelector = new CReasonerEvaluationExpressivityRequestSelector(QList()<()<setNameString(mBaseEvalName+" :: (SHIQ-SROIQ]"); tmpSelector->setOutputString(outputDirString); selectors = tmpSelector->append(selectors); return selectors; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationExpressivitySelectorFactory::getSelectorsForALEHIFTransivityToSROIQ(CReasonerEvaluationGroupRequestSelector* prevSelector) { QString outputDirString = mBaseOutputDir+"(ALEHIF+-SROIQ]/"; CReasonerEvaluationGroupRequestSelector* selectors = prevSelector; CReasonerEvaluationGroupRequestSelector* tmpSelector = nullptr; tmpSelector = new CReasonerEvaluationExpressivityRequestSelector(QList()<()<setNameString(mBaseEvalName+" :: (ALEHIF+-SROIQ]"); tmpSelector->setOutputString(outputDirString); selectors = tmpSelector->append(selectors); return selectors; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationExpressivitySelectorFactory::getSelectorsForALToALEHIFTransivity(CReasonerEvaluationGroupRequestSelector* prevSelector) { QString outputDirString = mBaseOutputDir+"[AL-ALEHIF+]/"; CReasonerEvaluationGroupRequestSelector* selectors = prevSelector; CReasonerEvaluationGroupRequestSelector* tmpSelector = nullptr; tmpSelector = new CReasonerEvaluationExpressivityRequestSelector(QList(),QList()<setNameString(mBaseEvalName+" :: [AL-ALEHIF+]"); tmpSelector->setOutputString(outputDirString); selectors = tmpSelector->append(selectors); return selectors; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationExpressivitySelectorFactory::getSelectorsForALToALERTransivity(CReasonerEvaluationGroupRequestSelector* prevSelector) { QString outputDirString = mBaseOutputDir+"[AL-ALER+]/"; CReasonerEvaluationGroupRequestSelector* selectors = prevSelector; CReasonerEvaluationGroupRequestSelector* tmpSelector = nullptr; tmpSelector = new CReasonerEvaluationExpressivityRequestSelector(QList(),QList()<setNameString(mBaseEvalName + " :: [AL-ALER+]"); tmpSelector->setOutputString(outputDirString); selectors = tmpSelector->append(selectors); return selectors; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationStatisticsNameCollectingExtractor.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationStatisticsNameCollectingExt0000644000175000017500000000530412520551336032511 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CReasonerEvaluationStatisticsNameCollectingExtractor_H #define KONCLUDE_TEST_EVALUATION_CReasonerEvaluationStatisticsNameCollectingExtractor_H // Libraries includes #include #include #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" #include "CReasonerEvaluationExtractor.h" #include "CReasonerEvaluationDoubleDataValue.h" #include "CReasonerEvaluationDataValueCacher.h" #include "CReasonerEvaluationStringValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationStatisticsNameCollectingExtractor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationStatisticsNameCollectingExtractor : public CReasonerEvaluationExtractor { // public methods public: //! Constructor CReasonerEvaluationStatisticsNameCollectingExtractor(QSet* statisticsNamesSet, CReasonerEvaluationDataValueCacher* cacher = nullptr); virtual CReasonerEvaluationDataValue* extractEvaluationData(const QString& responseFileString); // protected methods protected: virtual bool extractEvaluationData(QDomDocument& document, const QString& responseFileString); // protected variables protected: CReasonerEvaluationDataValueCacher* mCacher; double mTimelimit; double mErrorPunishmentTime; QSet* mStatisticsNamesSet; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CReasonerEvaluationStatisticsNameCollectingExtractor_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationProvider.h0000644000175000017500000000407212520551334027110 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPROVIDER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPROVIDER_H // Libraries includes #include // Namespace includes #include "CReasonerEvaluationTerminationResult.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationProvider { // public methods public: //! Constructor CReasonerEvaluationProvider(); //! Destructor virtual ~CReasonerEvaluationProvider(); virtual bool createReasoner(CConfiguration *config) = 0; virtual CReasonerEvaluationTerminationResult* destroyReasoner() = 0; virtual QString getReasonerAddressString() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPROVIDER_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationTableMultiFormatOutputWriter.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationTableMultiFormatOutputWrite0000644000175000017500000001113112520551340032526 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTABLEMULTIFORMATOUTPUTWRITER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTABLEMULTIFORMATOUTPUTWRITER_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { template QString defaultConvertToStringFunction(const T& value) { return QString("%1").arg(value); } /*! * * \class CReasonerEvaluationTableMultiFormatOutputWriter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CReasonerEvaluationTableMultiFormatOutputWriter { // public methods public: //! Constructor CReasonerEvaluationTableMultiFormatOutputWriter(); //! Destructor virtual ~CReasonerEvaluationTableMultiFormatOutputWriter(); QStringList writeCVSTable(const QString& baseFileName, QString (*convertStringFunction)(const T&) = &defaultConvertToStringFunction); QStringList writeGNUPlotDataTable(const QString& baseFileName, QString (*convertStringFunction)(const T&) = &defaultConvertToStringFunction); QStringList writeCVSTablesSorted(const QString& baseFileName, QString (*convertStringFunction)(const T&) = &defaultConvertToStringFunction); QStringList writeGNUPlotDataTablesSorted(const QString& baseFileName, QString (*convertStringFunction)(const T&) = &defaultConvertToStringFunction); QStringList writeCVSTablesSortedSplitted(cint64 splitSize, const QString& baseFileName, QString (*convertStringFunction)(const T&) = &defaultConvertToStringFunction); QStringList writeGNUPlotDataTablesSortedSplitted(cint64 splitSize, const QString& baseFileName, QString (*convertStringFunction)(const T&) = &defaultConvertToStringFunction); QStringList writeCVSTablesSeparateSorted(const QString& baseFileName, QString (*convertStringFunction)(const T&) = &defaultConvertToStringFunction); QStringList writeGNUPlotDataTablesSeparateSorted(const QString& baseFileName, QString (*convertStringFunction)(const T&) = &defaultConvertToStringFunction); CReasonerEvaluationTableMultiFormatOutputWriter* buildSortedIndex(); QString getSplitIndexString(cint64 index, cint64 maxIndex); CReasonerEvaluationTableMultiFormatOutputWriter* addColumnTitles(const QStringList& titleList); CReasonerEvaluationTableMultiFormatOutputWriter* addNewTableRow(const QString& rowTitle, const QList& rowValues); CReasonerEvaluationTableMultiFormatOutputWriter* addNewTableRow(const QString& rowTitle); CReasonerEvaluationTableMultiFormatOutputWriter* addValuesToLastTableRow(const QList& rowValues); // protected methods protected: QString getGNUPlotCompatibleTitle(const QString& string); // protected variables protected: class CReasonerEvaluationTableRow { public: QString mTitle; QList mRowValueList; }; QStringList mTitles; QList mRowList; CReasonerEvaluationTableRow* mLastRow; QMap mTitleColumnSortedMap; QList< QMap* > mColumnSortMapList; bool mSortedIndexBuilded; // private methods private: // private variables private: }; class CTestReasonerEvaluationTableMultiFormatOutputWriter : public CReasonerEvaluationTableMultiFormatOutputWriter { }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #include "CReasonerEvaluationTableMultiFormatOutputWriter.cpp" #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTABLEMULTIFORMATOUTPUTWRITER_H ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerBucketC0000644000175000017500000000611012520551326032471 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERBUCKETCSVCOMPARISONANALYSER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERBUCKETCSVCOMPARISONANALYSER_H // Libraries includes #include #include #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" #include "CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h" #include "CReasonerEvaluationDoubleDataValue.h" #include "CReasonerEvaluationTableMultiFormatOutputWriter.h" #include "CReasonerEvaluationHighchartPlotter.h" // Other includes #include "Config/CConfiguration.h" #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Utilities; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser : public CReasonerEvaluationGroupRequestReasonerComparisonAnalyser { // public methods public: //! Constructor CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser(double bucketsStart, double bucketsEnd, double bucketsIncreaseFactor, double timeoutsEnd); // protected methods protected: virtual bool analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector); QString getPrettyTitleFromOutputFile(const QString& outputFile); // protected variables protected: QString mOutputFileName; double mBucketsStart; double mBucketsEnd; double mBucketsIncreaseFactor; double mTimeoutsEnd; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERBUCKETCSVCOMPARISONANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationAnalyserChecker.cpp0000644000175000017500000001247112520551320030711 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationAnalyserChecker.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationAnalyserChecker::CReasonerEvaluationAnalyserChecker() : CLogIdentifier("::Konclude::Test::Evaluation::AnalyserUpdateChecker",this) { } CReasonerEvaluationAnalyserChecker::~CReasonerEvaluationAnalyserChecker() { } bool CReasonerEvaluationAnalyserChecker::loadAnalysingUpdateCheckFile(const QString& analyserCheckFileString) { mAnalysedResponseCountHash.clear(); QFile analyserCheckFile(analyserCheckFileString); if (analyserCheckFile.open(QIODevice::ReadOnly)) { LOG(INFO,getLogDomain(),logTr("Loading alraedy analysed data from file '%1'.").arg(analyserCheckFileString),this); while (!analyserCheckFile.atEnd()) { QString analysedCheckLine(analyserCheckFile.readLine()); QStringList analysedParsedList = analysedCheckLine.trimmed().split(" "); if (analysedParsedList.count() == 2) { cint64 analysdCount = analysedParsedList.first().toInt(); QString analysedFileString = analysedParsedList.last(); if (analysdCount > 0 && !analysedFileString.isEmpty()) { mAnalysedResponseCountHash.insert(analysedFileString,analysdCount); } } } analyserCheckFile.close(); return true; } else { LOG(ERROR,getLogDomain(),logTr("Could not load alraedy analysed data from file '%1'.").arg(analyserCheckFileString),this); } return false; } bool CReasonerEvaluationAnalyserChecker::saveAnalysingUpdateCheckFile(const QString& analyserCheckFileString) { QFile analyserCheckFile(analyserCheckFileString); if (analyserCheckFile.open(QIODevice::WriteOnly)) { LOG(INFO,getLogDomain(),logTr("Save updated analysed data to file '%1'.").arg(analyserCheckFileString),this); for (QHash::const_iterator it = mAnalysedResponseCountHash.constBegin(), itEnd = mAnalysedResponseCountHash.constEnd(); it != itEnd; ++it) { QString writeLine = QString("%1 %2\n").arg(it.value()).arg(it.key()); analyserCheckFile.write(writeLine.toLocal8Bit()); } analyserCheckFile.close(); return true; } else { LOG(ERROR,getLogDomain(),logTr("Could not save updated analysed data to file '%1'.").arg(analyserCheckFileString),this); } return false; } bool CReasonerEvaluationAnalyserChecker::checkAnalysingUpdateNecessary(const QStringList& reasonerPathList, const QString& analyserCheckFileString, cint64 maxAnalyseCount) { mMaxAnalyseCount = maxAnalyseCount; bool updateNecessary = false; loadAnalysingUpdateCheckFile(analyserCheckFileString); foreach (const QString& reasonerPath, reasonerPathList) { updateNecessary |= checkAnalysingUpdateNecessary(reasonerPath); } return updateNecessary; } bool CReasonerEvaluationAnalyserChecker::checkAnalysingUpdateNecessary(const QString& baseDirectory) { return checkDirsAnalysingUpdateNecessary(baseDirectory,baseDirectory); } bool CReasonerEvaluationAnalyserChecker::checkDirsAnalysingUpdateNecessary(const QString& directory, const QString& baseDirectory) { bool updateNecessary = false; QDir dir(directory); QStringList dirList = dir.entryList(QDir::Dirs,QDir::Name|QDir::IgnoreCase); foreach (QString dirString, dirList) { if (dirString != "." && dirString != "..") { LOG(INFO,getLogDomain(),logTr("Checking analysing update necessary for data from '%1'.").arg(dirString),this); updateNecessary |= checkFilesAnalysingUpdateNecessary(directory+dirString+"/",dirString); } } foreach (QString dirString, dirList) { if (dirString != "." && dirString != "..") { updateNecessary |= checkDirsAnalysingUpdateNecessary(directory+dirString+"/",baseDirectory); } } return updateNecessary; } bool CReasonerEvaluationAnalyserChecker::checkFilesAnalysingUpdateNecessary(const QString& directory, const QString& requestFileString) { bool updateNecessary = false; QDir dir(directory); QStringList fileList = dir.entryList(QDir::Files,QDir::Name|QDir::IgnoreCase); cint64 fileCount = fileList.count(); cint64 analysedCount = mAnalysedResponseCountHash.value(directory,0); if (analysedCount < mMaxAnalyseCount) { if (fileCount > analysedCount) { analysedCount = qMin(mMaxAnalyseCount,fileCount); updateNecessary = true; mAnalysedResponseCountHash.insert(directory,analysedCount); } } return updateNecessary; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationCollector.h0000644000175000017500000000604312520551320027237 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONCOLLECTOR_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONCOLLECTOR_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationSummarizer.h" #include "CReasonerEvaluationExtractor.h" #include "CReasonerEvaluationFiltering.h" #include "CReasonerEvaluationDataValueGroupCollection.h" #include "CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationCollector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationCollector : public CLogIdentifier { // public methods public: //! Constructor CReasonerEvaluationCollector(CReasonerEvaluationExtractor* extractor, CReasonerEvaluationSummarizer* summarizer, CReasonerEvaluationFiltering* filtering = nullptr); //! Destructor virtual ~CReasonerEvaluationCollector(); bool collectReasonerEvaluationDataValues(CReasonerEvaluationDataValueGroupCollectionReasonerComparison *reasonerComp, const QString& reasonerName, const QString& reasonerPath); CReasonerEvaluationDataValueGroupCollection* collectEvaluationDataValues(const QString& baseDirectory); // protected methods protected: bool collectEvaluationDatas(const QString& directory, const QString& subDirectory, const QString& baseDirectory, CReasonerEvaluationDataValueGroupCollection* groupCollection); bool collectGroupEvaluationDatas(const QString& directory, const QString& requestFileString, CReasonerEvaluationDataValueGroup* group); // protected variables protected: // private methods private: CReasonerEvaluationExtractor* mExtractor; CReasonerEvaluationSummarizer* mSummarizer; CReasonerEvaluationFiltering* mFiltering; // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONCOLLECTOR_H ././@LongLink0000644000000000000000000000020500000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerWithMea0000644000175000017500000003230612520551330032510 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser::CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser() { } CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser::~CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser() { } bool CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser::analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector) { mOutputFileName = QString("%1").arg(selector->getOutputString()); QDir outDir(outputDirectory); outDir.mkpath(mOutputFileName); QString outputFileString(outputDirectory+mOutputFileName+context->getAdditionalFileString()+"time-mmm"); QString outputBestFileString(outputDirectory+mOutputFileName+context->getAdditionalFileString()+"time-ratio"); QStringList titleList; titleList.append("Requests"); titleList.append(reasonerList); titleList.append("Average"); titleList.append("Min"); titleList.append("Max"); QStringList bestTitleList; bestTitleList.append("Requests"); foreach (const QString& reasonerString, reasonerList) { bestTitleList.append(reasonerString); } bestTitleList.append("Average"); CReasonerEvaluationTableMultiFormatOutputWriter tableMultiFormatOutputWriter; tableMultiFormatOutputWriter.addColumnTitles(titleList); CReasonerEvaluationTableMultiFormatOutputWriter bestTableMultiFormatOutputWriter; bestTableMultiFormatOutputWriter.addColumnTitles(bestTitleList); bool hasSelectedRequestFile = false; foreach (QString groupString, groubList) { if (selector->isGroupSelected(groupString)) { QSet* groupRequestList = getGroupRequests(groupString); foreach (QString requestString, *groupRequestList) { if (selector->isRequestSelected(groupString,requestString)) { bool allDataAvailable = true; foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); if (!evalData || evalData->hasDataNotAvailableFlag()) { allDataAvailable = false; } } if (allDataAvailable) { hasSelectedRequestFile = true; double min = DOUBLE_MAX; double max = DOUBLE_MIN; double mean = 0.; cint64 count = 0; tableMultiFormatOutputWriter.addNewTableRow(requestString); bestTableMultiFormatOutputWriter.addNewTableRow(requestString); foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); CReasonerEvaluationDoubleDataValue* doubleDataValue = dynamic_cast(evalData); if (doubleDataValue) { double tmpValue = doubleDataValue->getValue(); tableMultiFormatOutputWriter.addValuesToLastTableRow(QList()<()<(evalData); if (doubleDataValue) { double tmpValue = doubleDataValue->getValue(); if (tmpValue > mean) { tmpValue = - (tmpValue / mean - 1); } else { tmpValue = (mean / tmpValue - 1); } bestTableMultiFormatOutputWriter.addValuesToLastTableRow(QList()<()<isGNUPlottingActivated()) { reasonerCompGNUPlotFileList += tableMultiFormatOutputWriter.writeGNUPlotDataTable(outputFileString); reasonerCompGNUPlotFileList += tableMultiFormatOutputWriter.writeGNUPlotDataTablesSorted(outputFileString); reasonerCompGNUPlotFileList += tableMultiFormatOutputWriter.writeGNUPlotDataTablesSortedSplitted(30,outputFileString); foreach (QString plotFileString, reasonerCompGNUPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".dat"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getGNUPlotPlotter()->createReasonerComparisonPlot(plotFileString,context->getAdditionalTitleString()+title+"[milliseconds]",reasonerList,outputFile); } } } if (context->isHighchartPlottingActivated()) { foreach (QString plotFileString, reasonerCompHighchartPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createReasonerComparisonPlot(plotFileString,context->getAdditionalTitleString()+title+"[milliseconds]",reasonerList,outputFile,selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } if (!reasonerCompHighchartSplitPlotFileList.isEmpty()) { QStringList reasonerCompHighchartSplitPlotTitleList; foreach (QString plotFileString, reasonerCompHighchartSplitPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); reasonerCompHighchartSplitPlotTitleList.append(context->getAdditionalTitleString()+title+"[milliseconds]"); } } context->getHighchartPlotter()->createReasonerComparisonSplitPlot(reasonerCompHighchartSplitPlotFileList,reasonerCompHighchartSplitPlotTitleList,reasonerList,selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } QStringList reasonerCompHighchartBestPlotFileList; QStringList reasonerCompHighchartBestSplitPlotFileList; bestTableMultiFormatOutputWriter.buildSortedIndex(); reasonerCompHighchartBestPlotFileList += bestTableMultiFormatOutputWriter.writeCVSTable(outputBestFileString); reasonerCompHighchartBestPlotFileList += bestTableMultiFormatOutputWriter.writeCVSTablesSorted(outputBestFileString); reasonerCompHighchartBestSplitPlotFileList += bestTableMultiFormatOutputWriter.writeCVSTablesSortedSplitted(30,outputBestFileString); if (context->isHighchartPlottingActivated()) { foreach (QString plotFileString, reasonerCompHighchartBestPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createReasonerFasterPlot(plotFileString,context->getAdditionalTitleString()+title+"[times faster than Average]",reasonerList,outputFile,selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } if (!reasonerCompHighchartBestSplitPlotFileList.isEmpty()) { QStringList reasonerCompHighchartSplitPlotTitleList; foreach (QString plotFileString, reasonerCompHighchartBestSplitPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); reasonerCompHighchartSplitPlotTitleList.append(context->getAdditionalTitleString()+title+"[times faster than Average]"); } } context->getHighchartPlotter()->createReasonerFasterSplitPlot(reasonerCompHighchartBestSplitPlotFileList,reasonerCompHighchartSplitPlotTitleList,reasonerList,selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } QStringList mmmExtendedReasonerListGNU(reasonerList); mmmExtendedReasonerListGNU<<"Average"<<"Max"<<"Min"; QStringList reasonerOverPlotFileList; if (context->isGNUPlottingActivated()) { reasonerOverPlotFileList = tableMultiFormatOutputWriter.writeGNUPlotDataTablesSeparateSorted(outputFileString); foreach (QString plotFileString, reasonerOverPlotFileList) { if (true) { QString outputFile = plotFileString; outputFile.remove(".dat"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getGNUPlotPlotter()->createReasonerOverviewPlot(plotFileString,context->getAdditionalTitleString()+title+"[milliseconds]",reasonerList,outputFile); context->getGNUPlotPlotter()->createReasonerOverviewPlot(plotFileString,context->getAdditionalTitleString()+title+"[milliseconds]",mmmExtendedReasonerListGNU,outputFile+"-mmm"); } } } QStringList mmmExtendedReasonerListHC(reasonerList); mmmExtendedReasonerListHC<<"Max"<<"Min"; QStringList reasonerHCOverPlotFileList; if (context->isHighchartPlottingActivated()) { reasonerHCOverPlotFileList = tableMultiFormatOutputWriter.writeCVSTablesSeparateSorted(outputFileString); foreach (QString plotFileString, reasonerHCOverPlotFileList) { if (true) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createReasonerOverviewPlot(plotFileString,context->getAdditionalTitleString()+title+"[milliseconds]",reasonerList,outputFile,selector->getNameString()+" :: "+context->getAdditionalTitleString()); context->getHighchartPlotter()->createReasonerOverviewPlot(plotFileString,context->getAdditionalTitleString()+title+"[milliseconds]",mmmExtendedReasonerListHC,outputFile+"-mmm",selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } } } return true; } QString CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser::getPrettyTitleFromOutputFile(const QString& outputFile) { QString title = outputFile; title.remove("table"); cint64 slashPos = title.lastIndexOf("/"); if (slashPos >= 0) { title = title.mid(slashPos+1); } title.replace("-"," "); if (title.contains("sorted")) { title.replace("ratio","Ratio to Average,"); } else { title.replace("ratio","Ratio to Average"); } title.replace("time mmm","Time Comparision,"); title.replace("sorted","Sorted"); title.replace("time","Time,"); title.replace("separate","Separate"); if (title.contains(" ascending")) { title.replace(" ascending",""); if (title.contains(" split")) { title.insert(title.indexOf(" split")," in Ascending Order"); } else { title.append("in Ascending Order "); } } if (title.contains(" descending")) { title.replace(" descending",""); if (title.contains(" split")) { title.insert(title.indexOf(" split")," in Descending Order"); } else { title.append("in Descending Order "); } } return title; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationTestsuite.cpp0000644000175000017500000000625112520551340027640 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationTestsuite.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationTestsuite::CReasonerEvaluationTestsuite() { } CReasonerEvaluationTestsuite* CReasonerEvaluationTestsuite::initEvaluationTestsuite(const QString& globalConfig, const QString& reasonerConfig, const QString& testDirectory, const QString& evaluationDirectory, const QString& plattform, CReasonerEvaluationFiltering* evalFiltering) { mGlobalConfig = globalConfig; mReasonerConfig = reasonerConfig; mTestsDirectory = testDirectory; mEvaluationDirectory = evaluationDirectory; mPlatform = plattform; mFiltering = evalFiltering; return this; } QString CReasonerEvaluationTestsuite::getGlobalConfigString() { return mGlobalConfig; } QString CReasonerEvaluationTestsuite::getReasonerConfigString() { return mReasonerConfig; } QString CReasonerEvaluationTestsuite::getTestsDirectoryString() { return mTestsDirectory; } QString CReasonerEvaluationTestsuite::getEvaluationDirectoryString() { return mEvaluationDirectory; } QString CReasonerEvaluationTestsuite::getPlatformString() { return mPlatform; } CReasonerEvaluationFiltering* CReasonerEvaluationTestsuite::getEvaluationFiltering() { return mFiltering; } CReasonerEvaluationTestsuite* CReasonerEvaluationTestsuite::setGlobalConfigString(const QString& string) { mGlobalConfig = string; return this; } CReasonerEvaluationTestsuite* CReasonerEvaluationTestsuite::setReasonerConfigString(const QString& string) { mReasonerConfig = string; return this; } CReasonerEvaluationTestsuite* CReasonerEvaluationTestsuite::setTestsDirectoryString(const QString& string) { mTestsDirectory = string; return this; } CReasonerEvaluationTestsuite* CReasonerEvaluationTestsuite::setEvaluationDirectoryString(const QString& string) { mEvaluationDirectory = string; return this; } CReasonerEvaluationTestsuite* CReasonerEvaluationTestsuite::setPlatformString(const QString& string) { mPlatform = string; return this; } CReasonerEvaluationTestsuite* CReasonerEvaluationTestsuite::setEvaluationFiltering(CReasonerEvaluationFiltering* evalFiltering) { mFiltering = evalFiltering; return this; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationStringListValue.h0000644000175000017500000000433012520551336030414 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSTRINGLISTVALUE_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSTRINGLISTVALUE_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationStringListValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationStringListValue : public CReasonerEvaluationDataValue { // public methods public: //! Constructor CReasonerEvaluationStringListValue(const QStringList& value); //! Destructor virtual ~CReasonerEvaluationStringListValue(); virtual CReasonerEvaluationDataValue* getCopy(); virtual QString generateString(); const QStringList& getValue(); CReasonerEvaluationStringListValue* setValue(const QStringList& string); // protected methods protected: // protected variables protected: QStringList mValue; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSTRINGLISTVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationIntegerDataValue.cpp0000644000175000017500000000303312520551332031027 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationIntegerDataValue.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationIntegerDataValue::CReasonerEvaluationIntegerDataValue(cint64 value) { mValue = value; } CReasonerEvaluationIntegerDataValue::~CReasonerEvaluationIntegerDataValue() { } QString CReasonerEvaluationIntegerDataValue::generateString() { return QString::number(mValue); } cint64 CReasonerEvaluationIntegerDataValue::getValue() { return mValue; } CReasonerEvaluationIntegerDataValue* CReasonerEvaluationIntegerDataValue::setValue(cint64 value) { mValue = value; return this; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationLoadingTimeExtractor.h0000644000175000017500000000443312520551332031405 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONLOADINGTIMEEXTRACTOR_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONLOADINGTIMEEXTRACTOR_H // Libraries includes #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" #include "CReasonerEvaluationExtractor.h" #include "CReasonerEvaluationDoubleDataValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationLoadingTimeExtractor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationLoadingTimeExtractor : public CReasonerEvaluationExtractor { // public methods public: //! Constructor CReasonerEvaluationLoadingTimeExtractor(double timelimit = -1); //! Destructor virtual ~CReasonerEvaluationLoadingTimeExtractor(); virtual CReasonerEvaluationDataValue* extractEvaluationData(const QString& responseFile); // protected methods protected: // protected variables protected: double mTimelimit; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONLOADINGTIMEEXTRACTOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationFiltering.h0000644000175000017500000000524312520551326027243 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTERING_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTERING_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationFilter.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationFiltering * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationFiltering : public CLogIdentifier { // public methods public: //! Constructor CReasonerEvaluationFiltering(const QString& statisticsBasePath); bool loadEmptyFilter(); bool loadFilterFromFile(const QString& filterNameString); bool loadFiltersFromFile(const QStringList& filterNameStringList); bool testSatisfiesFilter(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString, const QStringList& statisticList); bool testSatisfiesFilter(const QStringList& statisticList); bool testSatisfiesFilter(const QString& testFileNameString, const QStringList& statisticList); QStringList loadStatistics(const QString& testFileNameString, const QString& subDirPathString); QStringList loadStatistics(const QString& subDirPathTestFileNameString); // protected methods protected: // protected variables protected: QList mFilterList; QString mStatisticsBasePath; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTERING_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationStringValue.cpp0000644000175000017500000000317612520551336030122 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationStringValue.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationStringValue::CReasonerEvaluationStringValue(const QString& value) { mValue = value; } CReasonerEvaluationStringValue::~CReasonerEvaluationStringValue() { } CReasonerEvaluationDataValue* CReasonerEvaluationStringValue::getCopy() { return new CReasonerEvaluationStringValue(*this); } QString CReasonerEvaluationStringValue::generateString() { return mValue; } const QString& CReasonerEvaluationStringValue::getValue() { return mValue; } CReasonerEvaluationStringValue* CReasonerEvaluationStringValue::setValue(const QString& value) { mValue = value; return this; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDataValueCacher.cpp0000644000175000017500000000447512520551322030631 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationDataValueCacher.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationDataValueCacher::CReasonerEvaluationDataValueCacher() { } CReasonerEvaluationDataValue* CReasonerEvaluationDataValueCacher::getCachedDataValue(const QString& responseName, cint64 extractionType) { CReasonerEvaluationDataValue* dataValue = nullptr; dataValue = mResponseTypeDataValueHash.value(QPair(responseName,extractionType)); return dataValue; } bool CReasonerEvaluationDataValueCacher::addDataValueToCache(const QString& responseName, cint64 extractionType, CReasonerEvaluationDataValue* dataValue) { mResponseTypeDataValueHash.insert(QPair(responseName,extractionType),dataValue); return true; } CReasonerEvaluationDataValue* CReasonerEvaluationDataValueCacher::getCachedDataValue(const QString& responseName, const QString& extractionTypeName) { CReasonerEvaluationDataValue* dataValue = nullptr; dataValue = mResponseTypeStringDataValueHash.value(QPair(responseName,extractionTypeName)); return dataValue; } bool CReasonerEvaluationDataValueCacher::addDataValueToCache(const QString& responseName, const QString& extractionTypeName, CReasonerEvaluationDataValue* dataValue) { mResponseTypeStringDataValueHash.insert(QPair(responseName,extractionTypeName),dataValue); return true; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExecutorThread.h0000644000175000017500000001265612520551324030252 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXECUTORTHREAD_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXECUTORTHREAD_H // Libraries includes // Namespace includes #include "CReasonerEvaluationExecutor.h" #include "CReasonerEvaluationProvider.h" #include "CConfigDependendReasonerEvaluationFactory.h" #include "CReasonerEvaluationRequestClientThread.h" #include "CReasonerEvaluationEvaluator.h" #include "CReasonerEvaluationEvaluatedCallbackContextData.h" #include "CReasonerEvaluationExecutionCallbackContextData.h" #include "CReasonerEvaluationPathConverter.h" #include "CReasonerEvaluationFiltering.h" #include "CCriticalSystemProcessTester.h" // Other includes #include "Test/Evaluation/Events/CReasonerEvaluationTestsuiteEvent.h" #include "Test/Evaluation/Events/CReasonerEvaluationNextEvent.h" #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" #include "Concurrent/CIntervalThread.h" #include "Control/Command/Events/CCommandProcessedCallbackEvent.h" #include "Concurrent/Callback/CBlockingCallbackData.h" #include "Control/Command/CCommanderManager.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Config; using namespace Concurrent; using namespace Concurrent::Callback; using namespace Control::Command::Events; using namespace Control::Command; namespace Test { namespace Evaluation { using namespace Evaluation::Events; /*! * * \class CReasonerEvaluationExecutorThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationExecutorThread : public CThread, public CReasonerEvaluationExecutor, public CLogIdentifier { // public methods public: //! Constructor CReasonerEvaluationExecutorThread(CConfiguration *config, CWatchDog *watchDog = nullptr); //! Destructor virtual ~CReasonerEvaluationExecutorThread(); bool executeEvaluation(CReasonerEvaluationTestsuite* evaluationTestsuite, CCallbackData* callbackData); // protected methods protected: bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); bool loadConfigurations(); bool initEvaluationTests(); bool finishEvaluationTests(); bool failedEvaluationTests(); QString nextEvaluationTestfile(); bool prepareNextEvaluationTest(); bool testSystemReadyForNextEvaluationTest(); void delayNextEvaluationTestUntilSystemReady(); bool executeNextEvaluationTest(const QString& testcaseInit, const QString& testcaseInput); bool evaluateExecutedTest(CReasonerEvaluationTerminationResult* terminationResults, CReasonerEvaluationRequestResult* requestResults, const QString& testcaseOutput); QString getNumberString(cint64 number); QString getNextOutputFileString(); bool testExistFile(const QString& fileString); bool testFileFiltered(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString); QString getCorrectedPathString(const QString& string); // protected variables protected: CReasonerEvaluationTestsuite* mEvalTestsuite; CConfiguration* mLoaderConfig; CCommanderManager* mCommanderManager; CConfiguration* mConfiguration; CCallbackData* mExecutedCallback; bool mExecutedTest; bool mFirstTest; cint64 mErrorCommBreakCount; QString mPlatformName; CReasonerEvaluationFiltering* mFiltering; QString mInputDir; QString mOutputDir; QString mReasonerName; QString mReasonerOutputDirectory; QString mConfigName; QStringList mRemainingSubDirs; QStringList mRemainingFiles; cint64 mTestCount; cint64 mNumberStringSize; QString mNextTestInputFile; QString mNextTestOutputDir; QString mReasonerInitFileString; cint64 mNextTestRemainingExecutionCount; cint64 mNextTestExecutionNumber; cint64 mTestTimeout; cint64 mWaitingTimeBetweenTests; cint64 mSystemReadyRetestTimeForTests; cint64 mWaitingTimeAfterReasonerCreation; bool mFirstTestWarmUp; bool mAllTestsWarmUp; CReasonerEvaluationProvider* mReasonerProvider; CReasonerEvaluationFactory* mReasonerEvalFactory; CReasonerEvaluationEvaluator* mReasonerEvaluator; CReasonerEvaluationRequestClientThread* mReasonerClient; CCriticalSystemProcessTester* mCriticalProcessesTester; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXECUTORTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDataValueCacher.h0000644000175000017500000000511012520551322030261 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUECACHER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUECACHER_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationDataValueCacher * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationDataValueCacher { // public methods public: //! Constructor CReasonerEvaluationDataValueCacher(); CReasonerEvaluationDataValue* getCachedDataValue(const QString& responseName, cint64 extractionType); bool addDataValueToCache(const QString& responseName, cint64 extractionType, CReasonerEvaluationDataValue* dataValue); CReasonerEvaluationDataValue* getCachedDataValue(const QString& responseName, const QString& extractionTypeName); bool addDataValueToCache(const QString& responseName, const QString& extractionTypeName, CReasonerEvaluationDataValue* dataValue); // protected methods protected: // protected variables protected: // private methods private: QHash< QPair,CReasonerEvaluationDataValue* > mResponseTypeDataValueHash; QHash< QPair,CReasonerEvaluationDataValue* > mResponseTypeStringDataValueHash; // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUECACHER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationAvaragerSummarizer.cpp0000644000175000017500000000441012520551320031447 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationAvaragerSummarizer.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationAvaragerSummarizer::CReasonerEvaluationAvaragerSummarizer() { } CReasonerEvaluationAvaragerSummarizer::~CReasonerEvaluationAvaragerSummarizer() { } CReasonerEvaluationDataValue* CReasonerEvaluationAvaragerSummarizer::summarizeEvaluationData(CReasonerEvaluationDataValue* dataValues) { CReasonerEvaluationDoubleDataValue* doubDataValues = dynamic_cast(dataValues); if (doubDataValues) { cint64 averagedDataFlags = 0; double doubleValue = 0; cint64 valueCount = 0; CReasonerEvaluationDoubleDataValue* doubDataValueIt = doubDataValues; while (doubDataValueIt) { doubleValue += doubDataValueIt->getValue(); averagedDataFlags |= doubDataValueIt->getDataFlags(); ++valueCount; CReasonerEvaluationDoubleDataValue* tmpDoubDataValue = doubDataValueIt; doubDataValueIt = (CReasonerEvaluationDoubleDataValue*)doubDataValueIt->getNext(); } if (valueCount != 0) { doubleValue /= valueCount; } CReasonerEvaluationDoubleDataValue* summarizedDoubDataValues = new CReasonerEvaluationDoubleDataValue(doubleValue); summarizedDoubDataValues->setDataFlags(averagedDataFlags); return summarizedDoubDataValues; } return nullptr; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationProvider.cpp0000644000175000017500000000220012520551334027432 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationProvider.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationProvider::CReasonerEvaluationProvider() { } CReasonerEvaluationProvider::~CReasonerEvaluationProvider() { } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerAccumul0000644000175000017500000000601712520551326032550 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERACCUMULATEDCSVCOMPARISONANALYSER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERACCUMULATEDCSVCOMPARISONANALYSER_H // Libraries includes #include #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGNUPlotPlotter.h" #include "CReasonerEvaluationHighchartPlotter.h" #include "CReasonerEvaluationAnalyseContext.h" #include "CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" #include "CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h" #include "CReasonerEvaluationDoubleDataValue.h" #include "CReasonerEvaluationTableMultiFormatOutputWriter.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser : public CReasonerEvaluationGroupRequestReasonerComparisonAnalyser { // public methods public: //! Constructor CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser(); //! Destructor virtual ~CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser(); QString getPrettyTitleFromOutputFile(const QString& outputFile); // protected methods protected: virtual bool analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector); // protected variables protected: QString mOutputFileName; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERACCUMULATEDCSVCOMPARISONANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationResponseFileExtractor.h0000644000175000017500000000436112520551336031613 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONRESPONSEFILEEXTRACTOR_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONRESPONSEFILEEXTRACTOR_H // Libraries includes #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" #include "CReasonerEvaluationExtractor.h" #include "CReasonerEvaluationStringValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationResponseFileExtractor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationResponseFileExtractor : public CReasonerEvaluationExtractor { // public methods public: //! Constructor CReasonerEvaluationResponseFileExtractor(); //! Destructor virtual ~CReasonerEvaluationResponseFileExtractor(); virtual CReasonerEvaluationDataValue* extractEvaluationData(const QString& responseFile); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONRESPONSEFILEEXTRACTOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationPathConverter.cpp0000644000175000017500000003154712520551332030442 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationPathConverter.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationPathConverter::CReasonerEvaluationPathConverter() { } QString CReasonerEvaluationPathConverter::getCorrectedPathString(const QString& pathString) { QString updatedPathString = pathString; cint64 nextPos = 0; while (updatedPathString.indexOf("$$",nextPos) != -1) { nextPos = updatedPathString.indexOf("$$",nextPos); if (updatedPathString.indexOf("$$_LATEST+1_$$") == nextPos) { cint64 latestStartPos = updatedPathString.indexOf("$$_LATEST+1_$$"); cint64 latestEndPos = latestStartPos+QString("$$_LATEST+1_$$").length(); QString latestBeginString = updatedPathString.mid(0,latestStartPos); cint64 lastSlashPos = latestBeginString.lastIndexOf("/"); QString firstPathPart = latestBeginString.mid(0,lastSlashPos); QDir firstPathDir(firstPathPart); QStringList entryList = firstPathDir.entryList(QDir::Files | QDir::Dirs); cint64 maxNumber = 0; cint64 maxNumberStringLength = 3; foreach (QString entry, entryList) { QString numberString; for (QString::const_iterator it = entry.constBegin(), itEnd = entry.constEnd(); it != itEnd; ++it) { QChar charater = *it; if (charater.isDigit()) { numberString += charater; } } bool convertSucc; cint64 number = numberString.toLongLong(&convertSucc); if (convertSucc) { maxNumber = qMax(maxNumber,number); maxNumberStringLength = qMax((cint64)numberString.length(),maxNumberStringLength); } } QString newNumberString = QString::number(maxNumber+1); while (newNumberString.length() < maxNumberStringLength) { newNumberString.prepend("0"); } updatedPathString.replace(latestStartPos,latestEndPos-latestStartPos,newNumberString); } else if (updatedPathString.indexOf("$$_LATEST_$$") == nextPos) { cint64 latestStartPos = updatedPathString.indexOf("$$_LATEST_$$"); cint64 latestEndPos = latestStartPos+QString("$$_LATEST_$$").length(); QString latestBeginString = updatedPathString.mid(0,latestStartPos); cint64 lastSlashPos = latestBeginString.lastIndexOf("/"); QString firstPathPart = latestBeginString.mid(0,lastSlashPos); QDir firstPathDir(firstPathPart); QStringList entryList = firstPathDir.entryList(QDir::Files | QDir::Dirs); cint64 maxNumber = 0; cint64 maxNumberStringLength = 0; foreach (QString entry, entryList) { QString numberString; for (QString::const_iterator it = entry.constBegin(), itEnd = entry.constEnd(); it != itEnd; ++it) { QChar charater = *it; if (charater.isDigit()) { numberString += charater; } } bool convertSucc; cint64 number = numberString.toLongLong(&convertSucc); if (convertSucc) { maxNumber = qMax(maxNumber,number); maxNumberStringLength = qMax((cint64)numberString.length(),maxNumberStringLength); } } QString newNumberString = QString::number(maxNumber); while (newNumberString.length() < maxNumberStringLength) { newNumberString.prepend("0"); } updatedPathString.replace(latestStartPos,latestEndPos-latestStartPos,newNumberString); } else if (updatedPathString.indexOf("$$_DATETIME_$$") == nextPos) { cint64 latestStartPos = updatedPathString.indexOf("$$_DATETIME_$$"); cint64 latestEndPos = latestStartPos+QString("$$_DATETIME_$$").length(); updatedPathString.replace(latestStartPos,latestEndPos-latestStartPos,QDateTime::currentDateTime().toString(Qt::ISODate).replace(":","-").replace(".","-")); } else if (updatedPathString.indexOf("$$_DATE_$$") == nextPos) { cint64 latestStartPos = updatedPathString.indexOf("$$_DATE_$$"); cint64 latestEndPos = latestStartPos+QString("$$_DATE_$$").length(); updatedPathString.replace(latestStartPos,latestEndPos-latestStartPos,QDateTime::currentDateTime().date().toString(Qt::ISODate).replace(":","-").replace(".","-")); } else if (updatedPathString.indexOf("$$_TIME_$$") == nextPos) { cint64 latestStartPos = updatedPathString.indexOf("$$_TIME_$$"); cint64 latestEndPos = latestStartPos+QString("$$_TIME_$$").length(); updatedPathString.replace(latestStartPos,latestEndPos-latestStartPos,QDateTime::currentDateTime().time().toString(Qt::ISODate).replace(":","-").replace(".","-")); } else if (updatedPathString.indexOf("$$_LATEST_STRING_$$") == nextPos) { cint64 latestStartPos = updatedPathString.indexOf("$$_LATEST_STRING_$$"); cint64 latestEndPos = latestStartPos+QString("$$_LATEST_STRING_$$").length(); QString latestBeginString = updatedPathString.mid(0,latestStartPos); cint64 lastSlashPos = latestBeginString.lastIndexOf("/"); QString firstPathPart = latestBeginString.mid(0,lastSlashPos); QDir firstPathDir(firstPathPart); QStringList entryList = firstPathDir.entryList(QDir::Files | QDir::Dirs); cint64 maxNumber = 0; QString maxNumberString; foreach (QString entry, entryList) { QString numberString; for (QString::const_iterator it = entry.constBegin(), itEnd = entry.constEnd(); it != itEnd; ++it) { QChar charater = *it; if (charater.isDigit()) { numberString += charater; } } bool convertSucc; cint64 number = numberString.toLongLong(&convertSucc); if (convertSucc) { if (maxNumberString.isEmpty() || number > maxNumber) { maxNumberString = entry; maxNumber = number; } } } updatedPathString.replace(latestStartPos,latestEndPos-latestStartPos,maxNumberString); } else if (updatedPathString.indexOf("$$_LATEST_VERSION_$$") == nextPos) { cint64 latestStartPos = updatedPathString.indexOf("$$_LATEST_VERSION_$$"); cint64 latestEndPos = latestStartPos+QString("$$_LATEST_VERSION_$$").length(); QString latestBeginString = updatedPathString.mid(0,latestStartPos); cint64 lastSlashPos = latestBeginString.lastIndexOf("/"); QString firstPathPart = latestBeginString.mid(0,lastSlashPos); QString beginMatchPart = latestBeginString.mid(lastSlashPos+1,latestStartPos-lastSlashPos-1); QString endMatchPart = latestBeginString.mid(latestEndPos,updatedPathString.indexOf("/",latestEndPos)-latestEndPos); QDir firstPathDir(firstPathPart); QStringList entryList = firstPathDir.entryList(QDir::Files | QDir::Dirs); cint64 maxNumber = 0; QMap versionNumberItemMap; foreach (QString entry, entryList) { bool hasFirstNumber = false; bool stopUseNummers = false; if (beginMatchPart.isEmpty() || entry.startsWith(beginMatchPart)) { QString endMatch; CVersionNumbersItem versionNumberItem; QString numberString; for (QString::const_iterator it = entry.constBegin(), itEnd = entry.constEnd(); it != itEnd; ++it) { QChar charater = *it; bool nonNumber = false; if (charater.isDigit()) { if (!stopUseNummers) { numberString += charater; hasFirstNumber = true; } } else if (charater.isLetter()) { nonNumber = true; if (hasFirstNumber) { stopUseNummers = true; } } else { nonNumber = true; } if (nonNumber) { if (!numberString.isEmpty()) { bool convertSucc; cint64 number = numberString.toLongLong(&convertSucc); if (convertSucc) { versionNumberItem.addNumber(number); } numberString.clear(); } } if (stopUseNummers) { endMatch += charater; } } if (!numberString.isEmpty()) { bool convertSucc; cint64 number = numberString.toLongLong(&convertSucc); if (convertSucc) { versionNumberItem.addNumber(number); } numberString.clear(); } if (endMatchPart.isEmpty() || endMatch == endMatchPart) { versionNumberItemMap.insert(versionNumberItem,entry); } } } if (!versionNumberItemMap.isEmpty()) { QMap::const_iterator it = versionNumberItemMap.constBegin(); QString maxNumberString(it.value()); updatedPathString.replace(latestStartPos,latestEndPos-latestStartPos,maxNumberString); } } else if (updatedPathString.indexOf("$$_LATEST_VERSION-") == nextPos) { cint64 latestSubstractNumberBegin = nextPos+QString("$$_LATEST_VERSION-").length(); cint64 latestSubstractNumberEnd = updatedPathString.indexOf("_$$",latestSubstractNumberBegin); QString latestSubstractNumberString = updatedPathString.mid(latestSubstractNumberBegin,latestSubstractNumberBegin-latestSubstractNumberEnd); QString latestMinusXString = latestSubstractNumberString; if (updatedPathString.indexOf(latestMinusXString) == nextPos) { cint64 substractNumber = latestSubstractNumberString.toLongLong(); cint64 latestStartPos = updatedPathString.indexOf(latestMinusXString); cint64 latestEndPos = latestStartPos+QString(latestMinusXString).length(); QString latestBeginString = updatedPathString.mid(0,latestStartPos); cint64 lastSlashPos = latestBeginString.lastIndexOf("/"); QString firstPathPart = latestBeginString.mid(0,lastSlashPos); QString beginMatchPart = latestBeginString.mid(lastSlashPos+1,latestStartPos-lastSlashPos-1); QString endMatchPart = latestBeginString.mid(latestEndPos,updatedPathString.indexOf("/",latestEndPos)-latestEndPos); QDir firstPathDir(firstPathPart); QStringList entryList = firstPathDir.entryList(QDir::Files | QDir::Dirs); cint64 maxNumber = 0; QMap versionNumberItemMap; foreach (QString entry, entryList) { bool hasFirstNumber = false; bool stopUseNummers = false; if (beginMatchPart.isEmpty() || entry.startsWith(beginMatchPart)) { QString endMatch; CVersionNumbersItem versionNumberItem; QString numberString; for (QString::const_iterator it = entry.constBegin(), itEnd = entry.constEnd(); it != itEnd; ++it) { QChar charater = *it; bool nonNumber = false; if (charater.isDigit()) { if (!stopUseNummers) { numberString += charater; hasFirstNumber = true; } } else if (charater.isLetter()) { nonNumber = true; if (hasFirstNumber) { stopUseNummers = true; } } else { nonNumber = true; } if (nonNumber) { if (!numberString.isEmpty()) { bool convertSucc; cint64 number = numberString.toLongLong(&convertSucc); if (convertSucc) { versionNumberItem.addNumber(number); } numberString.clear(); } } if (stopUseNummers) { endMatch += charater; } } if (!numberString.isEmpty()) { bool convertSucc; cint64 number = numberString.toLongLong(&convertSucc); if (convertSucc) { versionNumberItem.addNumber(number); } numberString.clear(); } if (endMatchPart.isEmpty() || endMatch == endMatchPart) { versionNumberItemMap.insert(versionNumberItem,entry); } } } if (versionNumberItemMap.count() > substractNumber) { QMap::const_iterator it = versionNumberItemMap.constBegin(); while (substractNumber > 0) { --substractNumber; ++it; } QString maxNumberString(it.value()); updatedPathString.replace(latestStartPos,latestEndPos-latestStartPos,maxNumberString); } } } ++nextPos; } return updatedPathString; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CConfigDependendReasonerEvaluationFactory.h0000644000175000017500000000450412520551316031662 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CCONFIGDEPENDENDREASONEREVALUATIONFACTORY_H #define KONCLUDE_TEST_EVALUATION_CCONFIGDEPENDENDREASONEREVALUATIONFACTORY_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationProvider.h" #include "CReasonerEvaluationFactory.h" #include "CReasonerOWLlinkEvaluationProvider.h" #include "CReasonerExecutableEvaluationProvider.h" #include "CReasonerKoncludeEvaluationProvider.h" // Other includes #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CConfigDependendReasonerEvaluationFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConfigDependendReasonerEvaluationFactory : public CReasonerEvaluationFactory { // public methods public: //! Constructor CConfigDependendReasonerEvaluationFactory(); //! Destructor virtual ~CConfigDependendReasonerEvaluationFactory(); virtual CReasonerEvaluationProvider* createReasonerProvider(CConfiguration *config); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CCONFIGDEPENDENDREASONEREVALUATIONFACTORY_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationClassificationTimeExtractor.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationClassificationTimeExtractor0000644000175000017500000000511212520551320032525 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CReasonerEvaluationClassificationTimeExtractor_H #define KONCLUDE_TEST_EVALUATION_CReasonerEvaluationClassificationTimeExtractor_H // Libraries includes #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" #include "CReasonerEvaluationExtractor.h" #include "CReasonerEvaluationDoubleDataValue.h" #include "CReasonerEvaluationDataValueCacher.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationClassificationTimeExtractor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationClassificationTimeExtractor : public CReasonerEvaluationExtractor { // public methods public: //! Constructor CReasonerEvaluationClassificationTimeExtractor(double timelimit = -1, double errorPunishmentTime = 0, CReasonerEvaluationDataValueCacher* cacher = nullptr); //! Destructor virtual ~CReasonerEvaluationClassificationTimeExtractor(); virtual CReasonerEvaluationDataValue* extractEvaluationData(const QString& responseFile); // protected methods protected: // protected variables protected: CReasonerEvaluationDataValueCacher* mCacher; double mTimelimit; double mErrorPunishmentTime; EXTRACTORTYPE mExtractorType; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CReasonerEvaluationClassificationTimeExtractor_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExecutionCallbackContextData.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExecutionCallbackContextDat0000644000175000017500000000413212520551324032442 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXECUTIONCALLBACKCONTEXTDATA_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXECUTIONCALLBACKCONTEXTDATA_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Concurrent/Callback/CCallbackDataContext.h" #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; using namespace Utilities; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationExecutionCallbackContextData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationExecutionCallbackContextData : public CCallbackDataContext { // public methods public: //! Constructor CReasonerEvaluationExecutionCallbackContextData(bool failed); bool getExecutionFailed(); // protected methods protected: // protected variables protected: bool mExecutionFailed; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXECUTIONCALLBACKCONTEXTDATA_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationFilter.h0000644000175000017500000000464412520551324026547 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTER_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationFilterCondition.h" #include "CReasonerEvaluationFilterStringCondition.h" #include "CReasonerEvaluationFilterIntegerCondition.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationFilter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationFilter { // public methods public: //! Constructor CReasonerEvaluationFilter(); bool loadFilterConditionFile(const QString& filterNameString); bool testSatisfiesFilterConditions(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString, const QStringList& statisticList); bool testSatisfiesFilterConditions(const QStringList& statisticList); bool testSatisfiesFilterConditions(const QString& testFileNameString, const QStringList& statisticList); // protected methods protected: // protected variables protected: QList mCondList; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationUpdaterThread.h0000644000175000017500000000545712520551340030057 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONUPDATERTHREAD_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONUPDATERTHREAD_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationUpdater.h" // Other includes #include "Config/CConfiguration.h" #include "Concurrent/CThread.h" #include "Test/Evaluation/Events/CReasonerEvaluationUpdateEvent.h" #include "Test/Evaluation/Events/CReasonerEvaluationProgramFileChangedEvent.h" #include "Control/Command/CConfigManagerReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Concurrent; using namespace Control::Command; namespace Test { namespace Evaluation { using namespace Evaluation::Events; /*! * * \class CReasonerEvaluationUpdaterThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationUpdaterThread : public CThread, public CReasonerEvaluationUpdater { Q_OBJECT // public methods public: //! Constructor CReasonerEvaluationUpdaterThread(); //! Destructor virtual ~CReasonerEvaluationUpdaterThread(); void addProgramFile(const QString& changedFile); // protected methods protected: virtual void threadStarted(); virtual void threadStopped(); virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent* event); // protected slots protected slots: void watchedProgramFileChanged(const QString& changedFile); // protected variables protected: QFileSystemWatcher* mSystemWatcher; QStringList mNextChangedProgramFileList; QSet mNextChangedProgramFileSet; bool mProgramRunning; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONUPDATERTHREAD_H ././@LongLink0000644000000000000000000000020700000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerAccumul0000644000175000017500000001374112520551326032552 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser::CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser() { } CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser::~CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser() { } bool CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser::analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector) { mOutputFileName = QString("%1").arg(selector->getOutputString()); bool hasSelectedRequestFile = false; QDir outDir(outputDirectory); outDir.mkpath(mOutputFileName); QString outputFileString(outputDirectory+mOutputFileName+context->getAdditionalFileString()+"accumulated-time"); QVector accumCountVec; foreach (QString reasonerString, reasonerList) { accumCountVec.append(0.); } foreach (QString groupString, groubList) { if (selector->isGroupSelected(groupString)) { QSet* groupRequestList = getGroupRequests(groupString); foreach (QString requestString, *groupRequestList) { if (selector->isRequestSelected(groupString,requestString)) { bool allDataAvailable = true; foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); if (!evalData || evalData->hasDataNotAvailableFlag()) { allDataAvailable = false; } } if (allDataAvailable) { hasSelectedRequestFile = true; cint64 reasonerNumber = 0; foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); CReasonerEvaluationDoubleDataValue* doubleDataValue = dynamic_cast(evalData); if (doubleDataValue) { double tmpValue = doubleDataValue->getValue(); accumCountVec[reasonerNumber] += tmpValue; reasonerNumber++; } } } } } } } if (hasSelectedRequestFile) { QStringList titleList; titleList.append("Reasoner"); titleList.append("Accumulated Count"); CReasonerEvaluationTableMultiFormatOutputWriter tableMultiFormatOutputWriter; tableMultiFormatOutputWriter.addColumnTitles(titleList); cint64 reasonerNumber = 0; foreach (QString reasonerString, reasonerList) { tableMultiFormatOutputWriter.addNewTableRow(reasonerString); double reasonerAccCount = accumCountVec[reasonerNumber++]; tableMultiFormatOutputWriter.addValuesToLastTableRow(QList()<isGNUPlottingActivated()) { reasonerCompGNUPlotFileList += tableMultiFormatOutputWriter.writeGNUPlotDataTable(outputFileString); foreach (QString plotFileString, reasonerCompGNUPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".dat"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getGNUPlotPlotter()->createReasonerComparisonPlot(plotFileString,title,QStringList()<<"Accumulated Count",outputFile); } } } if (context->isHighchartPlottingActivated()) { foreach (QString plotFileString, reasonerCompHighchartPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createReasonerAccumulatedCountPlot(plotFileString,title,QStringList()<<"Accumulated Count",outputFile,selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } } } return true; } QString CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser::getPrettyTitleFromOutputFile(const QString& outputFile) { QString title = outputFile; title.remove("table"); cint64 slashPos = title.lastIndexOf("/"); if (slashPos >= 0) { title = title.mid(slashPos+1); } title.replace("-"," "); title.replace("error","Error"); title.replace("timeout","Timeout"); title.replace("accumulated ",""); title.insert(0,"Accumulated "); title.replace("time","Count"); return title; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationPathConverter.h0000644000175000017500000000534012520551332030077 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPATHCONVERTER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPATHCONVERTER_H // Libraries includes #include #include // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Test { namespace Evaluation { class CVersionNumbersItem { public: bool operator<(const CVersionNumbersItem& item) const { // sort version with highest numbers first in the map QList tmpList1(mNumberList); QList tmpList2(item.mNumberList); while (!tmpList1.isEmpty() && !tmpList2.isEmpty()) { cint64 number1 = tmpList1.takeFirst(); cint64 number2 = tmpList2.takeFirst(); if (number1 > number2) { return true; } else if (number2 > number1) { return false; } } if (tmpList2.isEmpty()) { return true; } else { return false; } } CVersionNumbersItem* addNumber(cint64 number) { mNumberList.append(number); return this; } QList mNumberList; }; /*! * * \class CReasonerEvaluationPathConverter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationPathConverter { // public variables public: // public methods public: //! Constructor CReasonerEvaluationPathConverter(); static QString getCorrectedPathString(const QString& pathString); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPATHCONVERTER_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationStatisticsNameCollectingExtractor.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationStatisticsNameCollectingExt0000644000175000017500000000603412520551336032512 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationStatisticsNameCollectingExtractor.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationStatisticsNameCollectingExtractor::CReasonerEvaluationStatisticsNameCollectingExtractor(QSet* statisticsNamesSet, CReasonerEvaluationDataValueCacher* cacher) { mCacher = cacher; mStatisticsNamesSet = statisticsNamesSet; } bool CReasonerEvaluationStatisticsNameCollectingExtractor::extractEvaluationData(QDomDocument& document, const QString& responseFileString) { QDomElement rootEl = document.documentElement(); QList elementList; elementList.append(rootEl); cint64 queryNumber = 0; while (!elementList.isEmpty()) { QDomElement element = elementList.takeFirst(); if (element.hasAttribute("statistic-name")) { QString statName = element.attribute("statistic-name"); mStatisticsNamesSet->insert(statName); } if (element.hasAttribute("request-command")) { QString statName = element.attribute("request-command"); ++queryNumber; if (statName == "Classify") { mStatisticsNamesSet->insert(QString("query-%1-classify-response-time").arg(queryNumber)); } else if (statName == "Realize") { mStatisticsNamesSet->insert(QString("query-%1-realize-response-time").arg(queryNumber)); } else if (statName == "IsKBSatisfiable") { mStatisticsNamesSet->insert(QString("query-%1-consistency-response-time").arg(queryNumber)); } } QDomElement childElement = element.firstChildElement(); while (!childElement.isNull()) { elementList.append(childElement); childElement = childElement.nextSiblingElement(); } } return true; } CReasonerEvaluationDataValue* CReasonerEvaluationStatisticsNameCollectingExtractor::extractEvaluationData(const QString& responseFileString) { QFile responseFile(responseFileString); if (responseFile.open(QIODevice::ReadOnly)) { QDomDocument document; document.setContent(&responseFile,false); extractEvaluationData(document,responseFileString); responseFile.close(); } return nullptr; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationFactory.cpp0000644000175000017500000000217312520551324027257 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationFactory.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationFactory::CReasonerEvaluationFactory() { } CReasonerEvaluationFactory::~CReasonerEvaluationFactory() { } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationResponseTimeExtractor.cpp0000644000175000017500000000410612520551336032162 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationResponseTimeExtractor.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationResponseTimeExtractor::CReasonerEvaluationResponseTimeExtractor(double timelimit) { mTimelimit = timelimit; } CReasonerEvaluationResponseTimeExtractor::~CReasonerEvaluationResponseTimeExtractor() { } CReasonerEvaluationDataValue* CReasonerEvaluationResponseTimeExtractor::extractEvaluationData(const QString& responseFileString) { CReasonerEvaluationDoubleDataValue* doubleEvalValue = nullptr; double doubleValue = 0; QFile responseFile(responseFileString); if (responseFile.open(QIODevice::ReadOnly)) { QDomDocument document; document.setContent(&responseFile,false); QDomElement rootEl = document.documentElement(); QString respTimeString = rootEl.attribute("response-time","timeout"); bool validRespTime = false; doubleValue = respTimeString.toDouble(&validRespTime); if (validRespTime) { if (mTimelimit >= 0) { doubleValue = qMin(mTimelimit,doubleValue); } doubleEvalValue = new CReasonerEvaluationDoubleDataValue(doubleValue); } } return doubleEvalValue; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExtractor.h0000644000175000017500000000446712520551324027300 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXTRACTOR_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXTRACTOR_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationExtractor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationExtractor { // public methods public: //! Constructor CReasonerEvaluationExtractor(); //! Destructor virtual ~CReasonerEvaluationExtractor(); enum EXTRACTORTYPE { CLASSIFICATIONTIMEEXTRACTOR, CONSISTENCYTIMEEXTRACTOR, SATISFIABILITYTIMEEXTRACTOR, REALIZATIONTIMEEXTRACTOR, CALCULATIONTIMEEXTRACTOR, LOADINGTIMEEXTRACTOR, TOTALRESPONSETIMEEXTRACTOR, TIMEOUTERROREXTRACTOR, RESPONSEFILEEXTRACTOR, ERROREXTRACTOR, TIMEOUTEXTRACTOR, REQUESTFILEEXTRACTOR }; virtual CReasonerEvaluationDataValue* extractEvaluationData(const QString& responseFile) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXTRACTOR_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationHTMLNavigationOverviewSummarizer.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationHTMLNavigationOverviewSumma0000644000175000017500000000605612520551332032410 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONHTMLNAVIGATIONOVERVIEWSUMMARIZER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONHTMLNAVIGATIONOVERVIEWSUMMARIZER_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" #include "CKoncludeInfo.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationHTMLNavigationOverviewSummarizer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationHTMLNavigationOverviewSummarizer { // public methods public: //! Constructor CReasonerEvaluationHTMLNavigationOverviewSummarizer(); //! Destructor virtual ~CReasonerEvaluationHTMLNavigationOverviewSummarizer(); CReasonerEvaluationHTMLNavigationOverviewSummarizer* createHTMLNavigationOverview(const QString& directory, const QString& evaluationProgramName, const QStringList& reasonerNameList, const QStringList& filterNameList, cint64 testTimeout, cint64 testCount); // protected methods protected: bool loadConditionedFiltersFromFile(const QString& fileString, QHash* filterConditionedHash); bool loadFiltersFromFile(const QString& fileString, QSet* filterSet); QString loadTemplateFromFile(const QString& fileString); QString createHTMLForDirectory(const QString& directory, const QString& relativePathString, const QString& groupFilterString, cint64* addContentCounter = nullptr); bool isAcceptedByFilters(const QString& name); // protected variables protected: CReasonerEvaluationAnalyseContext* mContext; QString mDirLinConString; QString mDirLinOveString; QString mDirLinSubString; QString mDirLinSecString; QHash mFilterConditionedHash; QSet mFilterSet; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONHTMLNAVIGATIONOVERVIEWSUMMARIZER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationTestsuite.h0000644000175000017500000000576312520551340027314 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTESTSUITE_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTESTSUITE_H // Libraries includes // Namespace includes #include "CReasonerEvaluationFiltering.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationTestsuite * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationTestsuite { // public methods public: //! Constructor CReasonerEvaluationTestsuite(); CReasonerEvaluationTestsuite* initEvaluationTestsuite(const QString& globalConfig, const QString& reasonerConfig, const QString& testDirectory, const QString& evaluationDirectory, const QString& plattform, CReasonerEvaluationFiltering* evalFiltering); QString getGlobalConfigString(); QString getReasonerConfigString(); QString getTestsDirectoryString(); QString getEvaluationDirectoryString(); QString getPlatformString(); CReasonerEvaluationFiltering* getEvaluationFiltering(); CReasonerEvaluationTestsuite* setGlobalConfigString(const QString& string); CReasonerEvaluationTestsuite* setReasonerConfigString(const QString& string); CReasonerEvaluationTestsuite* setTestsDirectoryString(const QString& string); CReasonerEvaluationTestsuite* setEvaluationDirectoryString(const QString& string); CReasonerEvaluationTestsuite* setPlatformString(const QString& string); CReasonerEvaluationTestsuite* setEvaluationFiltering(CReasonerEvaluationFiltering* evalFiltering); // protected methods protected: // protected variables protected: QString mGlobalConfig; QString mReasonerConfig; QString mTestsDirectory; QString mEvaluationDirectory; QString mPlatform; CReasonerEvaluationFiltering* mFiltering; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTESTSUITE_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationAnalyseContext.cpp0000644000175000017500000000556112520551320030611 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationAnalyseContext.h" #include "CReasonerEvaluationGNUPlotPlotter.h" #include "CReasonerEvaluationHighchartPlotter.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationAnalyseContext::CReasonerEvaluationAnalyseContext(CConfiguration* configuration, const QString& additionalTitleString, const QString& additionalfileString) { mConfiguration = nullptr; mGNUPlotPlotter = new CReasonerEvaluationGNUPlotPlotter(this); mHighchartPlotter = new CReasonerEvaluationHighchartPlotter(this); mAdditionalTitleString = additionalTitleString; mAdditionalFileString = additionalfileString; mGNUPlot = false; mHighchartPlot = true; if (mConfiguration) { mGNUPlot = CConfigDataReader::readConfigBoolean(mConfiguration,"Konclude.Evaluation.Analyser.CreateGNUPlots"); mHighchartPlot = CConfigDataReader::readConfigBoolean(mConfiguration,"Konclude.Evaluation.Analyser.CreateGNUPlots"); } } CReasonerEvaluationAnalyseContext::~CReasonerEvaluationAnalyseContext() { delete mGNUPlotPlotter; } CMemoryAllocationManager* CReasonerEvaluationAnalyseContext::getMemoryAllocationManager() { return nullptr; } CConfiguration* CReasonerEvaluationAnalyseContext::getConfiguration() { return mConfiguration; } CReasonerEvaluationGNUPlotPlotter* CReasonerEvaluationAnalyseContext::getGNUPlotPlotter() { return mGNUPlotPlotter; } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationAnalyseContext::getHighchartPlotter() { return mHighchartPlotter; } QString CReasonerEvaluationAnalyseContext::getAdditionalTitleString() { return mAdditionalTitleString; } QString CReasonerEvaluationAnalyseContext::getAdditionalFileString() { return mAdditionalFileString; } bool CReasonerEvaluationAnalyseContext::isGNUPlottingActivated() { return mGNUPlot; } bool CReasonerEvaluationAnalyseContext::isHighchartPlottingActivated() { return mHighchartPlot; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationSpecifiedTimeExtractor.h0000644000175000017500000001131212520551336031721 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSPECIFIEDTIMEEXTRACTOR_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSPECIFIEDTIMEEXTRACTOR_H // Libraries includes #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" #include "CReasonerEvaluationExtractor.h" #include "CReasonerEvaluationDoubleDataValue.h" #include "CReasonerEvaluationDataValueCacher.h" #include "CReasonerEvaluationStringValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationSpecifiedTimeExtractor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationSpecifiedTimeExtractor : public CReasonerEvaluationExtractor { // public methods public: //! Constructor CReasonerEvaluationSpecifiedTimeExtractor(CReasonerEvaluationExtractor::EXTRACTORTYPE extractorType, double timelimit = -1, double errorPunishmentTime = 0, CReasonerEvaluationDataValueCacher* cacher = nullptr); virtual CReasonerEvaluationDataValue* extractEvaluationData(const QString& responseFileString); // protected methods protected: virtual CReasonerEvaluationDoubleDataValue* extractSpecifiedTimesEvaluationData(QDomDocument& document, const QString& responseFileString, const QStringList& extractionTagList, CReasonerEvaluationExtractor::EXTRACTORTYPE extractionType); virtual CReasonerEvaluationDoubleDataValue* extractCalculationEvaluationData(QDomDocument& document, const QString& responseFileString); virtual CReasonerEvaluationDoubleDataValue* extractSatisfiabilityEvaluationData(QDomDocument& document, const QString& responseFileString); virtual CReasonerEvaluationDoubleDataValue* extractConsistencyEvaluationData(QDomDocument& document, const QString& responseFileString); virtual CReasonerEvaluationDoubleDataValue* extractClassificationEvaluationData(QDomDocument& document, const QString& responseFileString); virtual CReasonerEvaluationDoubleDataValue* extractRealizationEvaluationData(QDomDocument& document, const QString& responseFileString); virtual CReasonerEvaluationDoubleDataValue* extractLoadingEvaluationData(QDomDocument& document, const QString& responseFileString); virtual CReasonerEvaluationDoubleDataValue* extractTotalResponseEvaluationData(QDomDocument& document, const QString& responseFileString); virtual CReasonerEvaluationDoubleDataValue* extractTimeoutErrorEvaluationData(QDomDocument& document, const QString& responseFileString); virtual CReasonerEvaluationDoubleDataValue* extractErrorEvaluationData(QDomDocument& document, const QString& responseFileString); virtual CReasonerEvaluationDoubleDataValue* extractTimeoutEvaluationData(QDomDocument& document, const QString& responseFileString); virtual CReasonerEvaluationStringValue* extractResponseFileEvaluationData(QDomDocument& document, const QString& responseFileString); virtual CReasonerEvaluationStringValue* extractRequestFileEvaluationData(QDomDocument& document, const QString& responseFileString); // protected variables protected: CReasonerEvaluationDataValueCacher* mCacher; double mTimelimit; double mErrorPunishmentTime; QStringList mClassificationExtractionTagList; QStringList mRealizationExtractionTagList; QStringList mConsistencyExtractionTagList; QStringList mSatisfiabilityExtractionTagList; QStringList mCalculationExtractionTagList; EXTRACTORTYPE mExtractorType; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSPECIFIEDTIMEEXTRACTOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationLoadingTimeExtractor.cpp0000644000175000017500000000561212520551332031740 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationLoadingTimeExtractor.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationLoadingTimeExtractor::CReasonerEvaluationLoadingTimeExtractor(double timelimit) { mTimelimit = timelimit; } CReasonerEvaluationLoadingTimeExtractor::~CReasonerEvaluationLoadingTimeExtractor() { } CReasonerEvaluationDataValue* CReasonerEvaluationLoadingTimeExtractor::extractEvaluationData(const QString& responseFileString) { CReasonerEvaluationDoubleDataValue* doubleEvalValue = nullptr; double doubleValue = 0; QFile responseFile(responseFileString); if (responseFile.open(QIODevice::ReadOnly)) { QDomDocument document; document.setContent(&responseFile,false); QDomElement rootEl = document.documentElement(); QDomElement classResEl = rootEl.firstChildElement(); bool allRespTimeValid = true; bool oneRespTimeValid = false; if (!classResEl.isNull()) { while (!classResEl.isNull()) { if (classResEl.attribute("request-command") == "LoadOntologies") { QString respTimeString = classResEl.attribute("response-time","timeout"); bool validRespTime = false; double respTime = respTimeString.toDouble(&validRespTime); allRespTimeValid &= validRespTime; oneRespTimeValid |= validRespTime; doubleValue += respTime; } classResEl = classResEl.nextSiblingElement(); } } if (!oneRespTimeValid) { QString respTimeString = rootEl.attribute("response-time","timeout"); bool validRespTime = false; double respTime = respTimeString.toDouble(&validRespTime); allRespTimeValid &= validRespTime; oneRespTimeValid |= validRespTime; doubleValue += respTime; } responseFile.close(); if (oneRespTimeValid) { if (mTimelimit >= 0) { doubleValue = qMin(mTimelimit,doubleValue); } doubleEvalValue = new CReasonerEvaluationDoubleDataValue(doubleValue); } } return doubleEvalValue; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationIntegerDataValue.h0000644000175000017500000000420412520551332030475 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONINTEGERDATAVALUE_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONINTEGERDATAVALUE_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationIntegerDataValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationIntegerDataValue : public CReasonerEvaluationDataValue { // public methods public: //! Constructor CReasonerEvaluationIntegerDataValue(cint64 value = 0); //! Destructor virtual ~CReasonerEvaluationIntegerDataValue(); virtual QString generateString(); cint64 getValue(); CReasonerEvaluationIntegerDataValue* setValue(cint64 value); // protected methods protected: // protected variables protected: cint64 mValue; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONINTEGERDATAVALUE_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationStringMatchGroupSelector.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationStringMatchGroupSelector.cp0000644000175000017500000000343112520551336032432 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationStringMatchGroupSelector.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationStringMatchGroupSelector::CReasonerEvaluationStringMatchGroupSelector(const QSet& groupStringSet) { mGroupStringSet = groupStringSet; } CReasonerEvaluationStringMatchGroupSelector::CReasonerEvaluationStringMatchGroupSelector() { } bool CReasonerEvaluationStringMatchGroupSelector::isGroupSelected(const QString& groupString) { return mGroupStringSet.contains(groupString); } bool CReasonerEvaluationStringMatchGroupSelector::isRequestSelected(const QString& groupString, const QString& requestString) { return true; } CReasonerEvaluationStringMatchGroupSelector* CReasonerEvaluationStringMatchGroupSelector::addGroupString(const QString& groupString) { mGroupStringSet.insert(groupString); return this; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000020500000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerStatist0000644000175000017500000001735712520551330032616 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser::CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser() { } CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser::~CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser() { } bool CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser::analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector) { mOutputFileName = QString("%1").arg(selector->getOutputString()); QDir outDir(outputDirectory); outDir.mkpath(mOutputFileName); QString outputFileString(outputDirectory+mOutputFileName+context->getAdditionalFileString()+"values"); QStringList titleList; titleList.append("Requests"); titleList.append(reasonerList); titleList.append("Average"); titleList.append("Min"); titleList.append("Max"); CReasonerEvaluationTableMultiFormatOutputWriter tableMultiFormatOutputWriter; tableMultiFormatOutputWriter.addColumnTitles(titleList); bool hasSelectedRequestFile = false; foreach (QString groupString, groubList) { if (selector->isGroupSelected(groupString)) { QSet* groupRequestList = getGroupRequests(groupString); foreach (QString requestString, *groupRequestList) { if (selector->isRequestSelected(groupString,requestString)) { bool allDataAvailable = true; foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); if (!evalData || evalData->hasDataNotAvailableFlag()) { allDataAvailable = false; } } if (allDataAvailable) { hasSelectedRequestFile = true; double min = DOUBLE_MAX; double max = DOUBLE_MIN; double mean = 0.; cint64 count = 0; tableMultiFormatOutputWriter.addNewTableRow(requestString); foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); CReasonerEvaluationDoubleDataValue* doubleDataValue = dynamic_cast(evalData); if (doubleDataValue) { double tmpValue = doubleDataValue->getValue(); tableMultiFormatOutputWriter.addValuesToLastTableRow(QList()<()<<0); } } mean /= (double)count; tableMultiFormatOutputWriter.addValuesToLastTableRow(QList()<isGNUPlottingActivated()) { reasonerCompGNUPlotFileList += tableMultiFormatOutputWriter.writeGNUPlotDataTable(outputFileString); foreach (QString plotFileString, reasonerCompGNUPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".dat"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getGNUPlotPlotter()->createReasonerComparisonPlot(plotFileString,title,reasonerList,outputFile); } } } if (context->isHighchartPlottingActivated()) { foreach (QString plotFileString, reasonerCompHighchartPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createReasonerComparisonPlot(plotFileString,title,reasonerList,outputFile,selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } } QStringList mmmExtendedReasonerListGNU(reasonerList); mmmExtendedReasonerListGNU<<"Average"<<"Max"<<"Min"; QStringList reasonerOverPlotFileList; if (context->isGNUPlottingActivated()) { reasonerOverPlotFileList = tableMultiFormatOutputWriter.writeGNUPlotDataTablesSeparateSorted(outputFileString); foreach (QString plotFileString, reasonerOverPlotFileList) { if (true) { QString outputFile = plotFileString; outputFile.remove(".dat"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getGNUPlotPlotter()->createReasonerOverviewPlot(plotFileString,title,reasonerList,outputFile); context->getGNUPlotPlotter()->createReasonerOverviewPlot(plotFileString,title,mmmExtendedReasonerListGNU,outputFile+"-mmm"); } } } QStringList mmmExtendedReasonerListHC(reasonerList); mmmExtendedReasonerListHC<<"Max"<<"Min"; QStringList reasonerHCOverPlotFileList; if (context->isHighchartPlottingActivated()) { reasonerHCOverPlotFileList = tableMultiFormatOutputWriter.writeCVSTablesSeparateSorted(outputFileString); foreach (QString plotFileString, reasonerHCOverPlotFileList) { if (true) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createReasonerOverviewPlot(plotFileString,title,reasonerList,outputFile,selector->getNameString()+" :: "+context->getAdditionalTitleString()); context->getHighchartPlotter()->createReasonerOverviewPlot(plotFileString,title,mmmExtendedReasonerListHC,outputFile+"-mmm",selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } } } return true; } QString CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser::getPrettyTitleFromOutputFile(const QString& outputFile) { QString title = outputFile; title.remove("table"); cint64 slashPos = title.lastIndexOf("/"); if (slashPos >= 0) { title = title.mid(slashPos+1); } title.replace("-"," "); title.replace("mmm","Comparision,"); title.replace("sorted","Sorted"); title.replace("separate","Separate"); return title; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDataValue.h0000644000175000017500000000536112520551320027161 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUE_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUE_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Utilities::Container; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationDataValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationDataValue : public CLinkerBase { // public methods public: //! Constructor CReasonerEvaluationDataValue(); //! Destructor virtual ~CReasonerEvaluationDataValue(); virtual CReasonerEvaluationDataValue* getCopy() = 0; virtual QString generateString() = 0; static const cint64 REDFDATANOTAVAILABLE = 0x0001; static const cint64 REDFDATAERROROCCURED = 0x0002; bool hasDataFlags(cint64 flags, bool testPartial); CReasonerEvaluationDataValue* setDataFlags(cint64 flags); CReasonerEvaluationDataValue* clearDataFlags(cint64 flags); CReasonerEvaluationDataValue* setDataFlags(cint64 flags, bool value); bool hasErrorOccuredFlag(); bool hasDataNotAvailableFlag(); CReasonerEvaluationDataValue* setErrorOccuredFlag(bool value = true); CReasonerEvaluationDataValue* setDataNotAvailableFlag(bool value = true); cint64 getDataFlags(); // protected methods protected: // protected variables protected: cint64 mDataFlags; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationRequestResult.cpp0000644000175000017500000000510712520551334030500 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationRequestResult.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationRequestResult::CReasonerEvaluationRequestResult() { mResponsedInTime = false; mResponseTime = 0; mSucessfullCommunication = false; } CReasonerEvaluationRequestResult::~CReasonerEvaluationRequestResult() { qDeleteAll(mResponseList); qDeleteAll(mInitResponseList); } CReasonerEvaluationRequestResult* CReasonerEvaluationRequestResult::addResponse(CReasonerEvaluationRequestResponse* response, bool initRequestResponse) { if (initRequestResponse) { mInitResponseList.append(response); } else { mResponseList.append(response); } return this; } QList* CReasonerEvaluationRequestResult::getResponseList() { return &mResponseList; } CReasonerEvaluationRequestResult* CReasonerEvaluationRequestResult::setResponseTime(cint64 responseTime) { mResponseTime = responseTime; return this; } CReasonerEvaluationRequestResult* CReasonerEvaluationRequestResult::setResponsedInTime(bool responsedInTime) { mResponsedInTime = responsedInTime; return this; } bool CReasonerEvaluationRequestResult::hasSucessfullReasonerCommunication() { return mSucessfullCommunication; } CReasonerEvaluationRequestResult* CReasonerEvaluationRequestResult::setSucessfullReasonerCommunication(bool sucessfull) { mSucessfullCommunication = sucessfull; return this; } bool CReasonerEvaluationRequestResult::getResponsedInTime() { return mResponsedInTime; } cint64 CReasonerEvaluationRequestResult::getResponseTime() { return mResponseTime; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationEvaluator.cpp0000644000175000017500000001124512520551322027610 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationEvaluator.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationEvaluator::CReasonerEvaluationEvaluator() { } CReasonerEvaluationEvaluator::~CReasonerEvaluationEvaluator() { } bool CReasonerEvaluationEvaluator::evaluateResults(CReasonerEvaluationRequestResult* requestResult, CReasonerEvaluationTerminationResult* terminationResult, const QString& inputFileString, const QString& responseFileString, CConfiguration* config) { QDomDocument document = createResponseDocument(); QDomElement responseNode = document.documentElement(); responseNode.setAttribute("response-time",requestResult->getResponseTime()); responseNode.setAttribute("test",inputFileString); if (!requestResult->getResponsedInTime()) { responseNode.setAttribute("timeout",1); } else { responseNode.setAttribute("timeout",0); } QDateTime dateTime = QDateTime::currentDateTime(); responseNode.appendChild(document.createComment(QString("Executed date: %1").arg(dateTime.toString()))); if (terminationResult->hasProcessError()) { responseNode.appendChild(document.createComment(QString("Reasoner error: %1").arg(terminationResult->getErrorText()))); } QString output = terminationResult->getStandardOutputText(); if (output.isEmpty()) { output = terminationResult->getErrorOutputText(); } responseNode.appendChild(document.createComment(QString("Reasoner output:\r\n%1").arg(output))); QList* responseList = requestResult->getResponseList(); foreach (CReasonerEvaluationRequestResponse* response, *responseList) { if (response->isTimedOut()) { QDomElement errorElm = document.createElement("Error"); errorElm.setAttribute("timeout",1); cint64 responseTime = response->getResponseTime(); errorElm.setAttribute("response-time",responseTime); errorElm.setAttribute("error","timeout"); errorElm.setAttribute("request-command",response->getRequestNode().tagName()); responseNode.appendChild(errorElm); } else if (response->hasResponseError()) { QDomElement errorElm = document.createElement("Error"); cint64 responseTime = response->getResponseTime(); errorElm.setAttribute("response-time",responseTime); errorElm.setAttribute("error","unknown error"); errorElm.setAttribute("request-command",response->getRequestNode().tagName()); responseNode.appendChild(errorElm); } else { QDomElement domElm = response->getResponseNode(); cint64 responseTime = response->getResponseTime(); QDomNode importedNode = document.importNode(domElm,true); QDomElement impDomElm = importedNode.toElement(); impDomElm.setAttribute("response-time",responseTime); impDomElm.setAttribute("request-command",response->getRequestNode().tagName()); responseNode.appendChild(impDomElm); } } QFile file(responseFileString); if (file.open(QIODevice::WriteOnly)) { file.write(document.toByteArray()); file.close(); } return true; } QDomDocument CReasonerEvaluationEvaluator::createResponseDocument() { QDomDocument document; QString owllinkNS = "http://www.owllink.org/owllink#"; QString owlNS = "http://www.w3.org/2002/07/owl#"; QDomElement rootNode; rootNode = document.createElementNS(owllinkNS,"ResponseMessage"); //rootNode.setAttributeNS("xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttribute("xmlns:owl",owlNS); document.appendChild(rootNode); return document; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerCSVComp0000644000175000017500000000762612520551330032433 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser::CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser() { } CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser::~CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser() { } bool CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser::analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector) { mOutputFileName = QString("%1").arg(selector->getOutputString()); bool hasSelectedRequestFile = false; foreach (QString groupString, groubList) { if (selector->isGroupSelected(groupString)) { QSet* groupRequestList = getGroupRequests(groupString); foreach (QString requestString, *groupRequestList) { if (selector->isRequestSelected(groupString,requestString)) { hasSelectedRequestFile = true; } } } } if (hasSelectedRequestFile) { QDir outDir(outputDirectory); outDir.mkpath(mOutputFileName); QFile outputFile(outputDirectory+mOutputFileName+context->getAdditionalFileString()+"time-table.csv"); if (outputFile.open(QIODevice::WriteOnly)) { QString reasonerTabList("OntologyRequest"); foreach (QString reasonerString, reasonerList) { reasonerTabList += QString("\t%1").arg(reasonerString); } reasonerTabList += QString("\r\n"); outputFile.write(reasonerTabList.toLocal8Bit()); foreach (QString groupString, groubList) { QSet* groupRequestList = getGroupRequests(groupString); foreach (QString requestString, *groupRequestList) { if (selector->isRequestSelected(groupString,requestString)) { bool allDataAvailable = true; foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); if (!evalData || evalData->hasDataNotAvailableFlag()) { allDataAvailable = false; } } if (allDataAvailable) { QString requestReasonerTabList(requestString); foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); if (evalData) { requestReasonerTabList += QString("\t%1").arg(evalData->generateString()); } else { requestReasonerTabList += QString("\t-"); } } requestReasonerTabList += QString("\r\n"); outputFile.write(requestReasonerTabList.toLocal8Bit()); } } } } outputFile.close(); } } return true; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationEvaluator.h0000644000175000017500000000431212520551322027252 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEVALUATOR_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEVALUATOR_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationTerminationResult.h" #include "CReasonerEvaluationRequestResult.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationEvaluator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationEvaluator { // public methods public: //! Constructor CReasonerEvaluationEvaluator(); //! Destructor virtual ~CReasonerEvaluationEvaluator(); bool evaluateResults(CReasonerEvaluationRequestResult* requestResult, CReasonerEvaluationTerminationResult* terminationResult, const QString& inputFileString, const QString& responseFileString, CConfiguration* config); // protected methods protected: // protected variables protected: QDomDocument createResponseDocument(); // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEVALUATOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationFilterIntegerCondition.h0000644000175000017500000000462012520551326031730 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTERINTEGERCONDITION_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTERINTEGERCONDITION_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationFilterCondition.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationFilterIntegerCondition * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationFilterIntegerCondition : public CReasonerEvaluationFilterCondition { // public methods public: //! Constructor CReasonerEvaluationFilterIntegerCondition(const QString& statisticNameString, const QString& statisticComperator, const QString& statisticCompareValueString); CReasonerEvaluationFilterIntegerCondition(const QString& statisticNameString, const QString& statisticComperator, cint64 statisticCompareValue); virtual bool isStatisticConditionSatisfied(const QString& statisticString, const QString& statisticValueString); // protected methods protected: // protected variables protected: cint64 mStatisticCompareValue; QString mStatisticComperator; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTERINTEGERCONDITION_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationRequestClient.cpp0000644000175000017500000000223112520551334030433 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationRequestClient.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationRequestClient::CReasonerEvaluationRequestClient() { } CReasonerEvaluationRequestClient::~CReasonerEvaluationRequestClient() { } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDataValueGroup.h0000644000175000017500000000457412520551322030205 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUEGROUP_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUEGROUP_H // Libraries includes #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationDataValueGroup * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationDataValueGroup { // public methods public: //! Constructor CReasonerEvaluationDataValueGroup(); //! Destructor virtual ~CReasonerEvaluationDataValueGroup(); CReasonerEvaluationDataValueGroup* setGroupName(const QString& string); CReasonerEvaluationDataValueGroup* addRequestDataValue(const QString& requestString, CReasonerEvaluationDataValue* dataValue); QMap* getRequestDataValueMap(); QString getGroupName(); bool isEmpty(); // protected methods protected: // protected variables protected: QMap mRequestDataValueMap; QString mGroupName; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUEGROUP_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationTimeoutErrorExtractor.h0000644000175000017500000000444212520551340031650 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTIMEOUTERROREXTRACTOR_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTIMEOUTERROREXTRACTOR_H // Libraries includes #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" #include "CReasonerEvaluationExtractor.h" #include "CReasonerEvaluationDoubleDataValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationTimeoutErrorExtractor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationTimeoutErrorExtractor : public CReasonerEvaluationExtractor { // public methods public: //! Constructor CReasonerEvaluationTimeoutErrorExtractor(double timelimit = -1); //! Destructor virtual ~CReasonerEvaluationTimeoutErrorExtractor(); virtual CReasonerEvaluationDataValue* extractEvaluationData(const QString& responseFile); // protected methods protected: // protected variables protected: double mTimelimit; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTIMEOUTERROREXTRACTOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationTerminationResult.cpp0000644000175000017500000000437712520551340031346 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationTerminationResult.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationTerminationResult::CReasonerEvaluationTerminationResult() { mInTimeTerminated = false; mTerminationForced = false; mProcessError = false; } CReasonerEvaluationTerminationResult* CReasonerEvaluationTerminationResult::initResult(bool processError, bool inTimeTerminated, bool forcedTermination, const QString& errorText, const QString& stnOutText, const QString& errOutText) { mProcessError = processError; mInTimeTerminated = inTimeTerminated; mTerminationForced = forcedTermination; mStandardOutputText = stnOutText; mErrorOutputText = errOutText; mErrorText = errorText; return this; } bool CReasonerEvaluationTerminationResult::isInTimeTerminated() { return mInTimeTerminated; } bool CReasonerEvaluationTerminationResult::isTerminationForced() { return mTerminationForced; } bool CReasonerEvaluationTerminationResult::hasProcessError() { return mProcessError; } QString CReasonerEvaluationTerminationResult::getStandardOutputText() { return mStandardOutputText; } QString CReasonerEvaluationTerminationResult::getErrorOutputText() { return mErrorOutputText; } QString CReasonerEvaluationTerminationResult::getErrorText() { return mErrorText; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationProfileRequestSelector.h0000644000175000017500000000556212520551334031775 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPROFILEREQUESTSELECTOR_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPROFILEREQUESTSELECTOR_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGroupRequestSelector.h" // Other includes #include "Reasoner/Ontology/COntologyExpressivity.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Reasoner::Ontology; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationProfileRequestSelector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationProfileRequestSelector : public CReasonerEvaluationGroupRequestSelector { // public methods public: //! Constructor CReasonerEvaluationProfileRequestSelector(cint64 profile, const QString& baseExpressivityDir); virtual bool isGroupSelected(const QString& groupString); virtual bool isRequestSelected(const QString& groupString, const QString& requestString); const static cint64 REPRS_PROFILE_DL = 0x0001; const static cint64 REPRS_PROFILE_EL = 0x0002; const static cint64 REPRS_PROFILE_RL = 0x0004; const static cint64 REPRS_PROFILE_QL = 0x0008; // protected methods protected: virtual QString getProfileKeyString(cint64 profile); // protected variables protected: cint64 mProfile; QList mEqualBoundList; QList mExcludedBoundList; QList mLowerNotIncludedBoundList; QList mLowerIncludedBoundList; QList mUpperNotIncludedBoundList; QList mUpperIncludedBoundList; QString mBaseExpressivityDir; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPROFILEREQUESTSELECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestSelector.h0000644000175000017500000000475512520551330031470 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTSELECTOR_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTSELECTOR_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Utilities::Container; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationGroupRequestSelector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationGroupRequestSelector : public CLinkerBase { // public methods public: //! Constructor CReasonerEvaluationGroupRequestSelector(); virtual bool isGroupSelected(const QString& groupString) = 0; virtual bool isRequestSelected(const QString& groupString, const QString& requestString) = 0; QString getNameString(); QString getOutputString(); CReasonerEvaluationGroupRequestSelector* setNameString(const QString& name); CReasonerEvaluationGroupRequestSelector* setOutputString(const QString& output); // protected methods protected: // protected variables protected: QString mNameString; QString mOutputString; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTSELECTOR_H ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestStatisticsCSVCo0000644000175000017500000001633312520551332032447 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser::CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser(CReasonerEvaluationFiltering* filtering) { mFiltering = filtering; } CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser::~CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser() { } bool CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser::analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector) { mOutputFileName = QString("%1").arg(selector->getOutputString()); QDir outDir(outputDirectory); outDir.mkpath(mOutputFileName); QString outputFileString(outputDirectory+mOutputFileName+"request-statistics"); QStringList titleList; titleList.append("Statistic"); titleList.append("Minimum"); titleList.append("Maximum"); titleList.append("Mean"); titleList.append("StandardDerivation"); titleList.append("Median"); titleList.append("Sum"); CReasonerEvaluationTableMultiFormatOutputWriter tableMultiFormatOutputWriter; tableMultiFormatOutputWriter.addColumnTitles(titleList); QHash statisticNameDataHash; bool hasSelectedRequestFile = false; foreach (QString groupString, groubList) { if (selector->isGroupSelected(groupString)) { QSet* groupRequestList = getGroupRequests(groupString); foreach (QString requestString, *groupRequestList) { if (selector->isRequestSelected(groupString,requestString)) { bool allReasonerResultAvailable = true; QString pathRequestString; foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); if (!evalData || evalData->hasDataNotAvailableFlag()) { allReasonerResultAvailable = false; } else { CReasonerEvaluationStringListValue* stringListDataValue = dynamic_cast(evalData); if (stringListDataValue) { QStringList stringList = stringListDataValue->getValue(); if (!stringList.isEmpty()) { pathRequestString = stringList.first(); } else { allReasonerResultAvailable = false; } } else { allReasonerResultAvailable = false; } } } if (allReasonerResultAvailable && !pathRequestString.isEmpty()) { hasSelectedRequestFile = true; QStringList statisticList = mFiltering->loadStatistics(pathRequestString); if (statisticList.isEmpty()) { statisticList.append(QString("%1\t%2").arg("StatisticsMissing:").arg("1")); statisticList.append(QString("%1\t%2").arg("StatisticsAvailable:").arg("0")); } else { statisticList.append(QString("%1\t%2").arg("StatisticsMissing:").arg("0")); statisticList.append(QString("%1\t%2").arg("StatisticsAvailable:").arg("1")); } statisticList.append(QString("%1\t%2").arg("RequestFiles:").arg("1")); foreach (const QString& statisticString, statisticList) { QStringList statisticValueList = statisticString.split("\t"); if (statisticValueList.count() == 2) { QString statisticNameString = statisticValueList.first().trimmed(); QString statisticValueString = statisticValueList.last().trimmed(); bool statisticValueConvertionSuccessfull = false; double statisticValue = statisticValueString.toDouble(&statisticValueConvertionSuccessfull); if (statisticValueConvertionSuccessfull) { CRequestStatisticsData& reqStatData = statisticNameDataHash[statisticNameString]; if (!reqStatData.mInitialized) { reqStatData.setDataName(statisticNameString); reqStatData.mInitialized = true; } reqStatData.addData(statisticValue,pathRequestString); } } } } } } } } if (hasSelectedRequestFile) { for (QHash::iterator it = statisticNameDataHash.begin(), itEnd = statisticNameDataHash.end(); it != itEnd; ++it) { const QString& statisticName(it.key()); CRequestStatisticsData& statisticData(it.value()); tableMultiFormatOutputWriter.addNewTableRow(statisticName); statisticData.calculateStatistics(); QList statisticValueList; statisticValueList.append(statisticData.mMinValue); statisticValueList.append(statisticData.mMaxValue); statisticValueList.append(statisticData.mMeanValue); statisticValueList.append(statisticData.mStandardDerivationValue); statisticValueList.append(statisticData.mMedianValue); statisticValueList.append(statisticData.mSumValue); tableMultiFormatOutputWriter.addValuesToLastTableRow(statisticValueList); } QStringList reasonerCompHighchartPlotFileList; tableMultiFormatOutputWriter.buildSortedIndex(); reasonerCompHighchartPlotFileList += tableMultiFormatOutputWriter.writeCVSTable(outputFileString); if (context->isHighchartPlottingActivated()) { foreach (QString plotFileString, reasonerCompHighchartPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createRequestStatisticsPlot(plotFileString,context->getAdditionalTitleString()+title,titleList,outputFile,selector->getNameString()); } } } } return true; } QString CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser::getPrettyTitleFromOutputFile(const QString& outputFile) { QString title = outputFile; title.remove("table"); cint64 slashPos = title.lastIndexOf("/"); if (slashPos >= 0) { title = title.mid(slashPos+1); } title.replace("-"," "); return title; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationFilterCondition.cpp0000644000175000017500000000340012520551324030736 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationFilterCondition.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationFilterCondition::CReasonerEvaluationFilterCondition(const QString& statisticNameString) { mStatisticName = statisticNameString; } bool CReasonerEvaluationFilterCondition::isStatisticConditionSatisfied(const QStringList& statisticList) { foreach (const QString& statisticString, statisticList) { QStringList statsStringList = statisticString.split("\t"); if (statsStringList.count() == 2) { QString statisticNameString = statsStringList.first(); QString statisticValueString = statsStringList.last(); if (statisticNameString == mStatisticName) { if (isStatisticConditionSatisfied(statisticNameString,statisticValueString)) { return true; } } } } return false; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerCompari0000644000175000017500000000644512520551330032551 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERCOMPARISONANALYSER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERCOMPARISONANALYSER_H // Libraries includes #include #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationAnalyser.h" #include "CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h" #include "CReasonerEvaluationAnalyseContext.h" #include "CReasonerEvaluationGroupRequestSelector.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationGroupRequestReasonerComparisonAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationGroupRequestReasonerComparisonAnalyser : public CReasonerEvaluationAnalyser { // public methods public: //! Constructor CReasonerEvaluationGroupRequestReasonerComparisonAnalyser(); //! Destructor virtual ~CReasonerEvaluationGroupRequestReasonerComparisonAnalyser(); CReasonerEvaluationAnalyser* analyseEvaluationData(CReasonerEvaluationDataValueGroupCollectionReasonerComparison* evaluationData, CReasonerEvaluationAnalyseContext* context, const QString& outputDirectory, CReasonerEvaluationGroupRequestSelector* selectors); // protected methods protected: virtual bool analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector) = 0; CReasonerEvaluationDataValue* getGroupRequestReasonerEvaluationData(const QString& groupName, const QString& requstName, const QString& reasonerName); QSet* getGroupRequests(const QString& groupName); // protected variables protected: QMap* mReasonerCollectionMap; QHash* > mGroupRequestSetHash; QList< QSet* > mRequestSetContainer; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERCOMPARISONANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/EvaluationSettings.h0000644000175000017500000000374712520551342025323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_TESTSETTINGS #define KONCLUDE_TEST_EVALUATION_TESTSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Test { namespace Evaluation { /*! * * \file TestSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CReasonerEvaluationGNUPlotPlotter; class CReasonerEvaluationHighchartPlotter; class CReasonerEvaluationAnalyseContext; // Custom Events >= 2000 const QEvent::Type EVENTREASONEREVALUATIONTESTSUITE = (QEvent::Type)3002; const QEvent::Type EVENTREASONEREVALUATIONSTART = (QEvent::Type)3003; const QEvent::Type EVENTREASONEREVALUATIONNEXT = (QEvent::Type)3004; const QEvent::Type EVENTREASONEREVALUATIONPROGRAM = (QEvent::Type)3005; const QEvent::Type EVENTREASONEREVALUATIONCHANGEDFILE = (QEvent::Type)3006; const QEvent::Type EVENTREASONEREVALUATIONUPDATE = (QEvent::Type)3007; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // end KONCLUDE_TEST_EVALUATION_TESTSETTINGS Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationFilterIntegerCondition.cpp0000644000175000017500000000501312520551326032260 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationFilterIntegerCondition.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationFilterIntegerCondition::CReasonerEvaluationFilterIntegerCondition(const QString& statisticNameString, const QString& statisticComperator, const QString& statisticCompareValueString) : CReasonerEvaluationFilterCondition(statisticNameString) { mStatisticCompareValue = statisticCompareValueString.toLongLong(); mStatisticComperator = statisticComperator; } CReasonerEvaluationFilterIntegerCondition::CReasonerEvaluationFilterIntegerCondition(const QString& statisticNameString, const QString& statisticComperator, cint64 statisticCompareValue) : CReasonerEvaluationFilterCondition(statisticNameString) { mStatisticCompareValue = statisticCompareValue; mStatisticComperator = statisticComperator; } bool CReasonerEvaluationFilterIntegerCondition::isStatisticConditionSatisfied(const QString& statisticString, const QString& statisticValueString) { cint64 statisticValue = statisticValueString.toLongLong(); if (mStatisticComperator == "=" || mStatisticComperator == "==") { if (statisticValue == mStatisticCompareValue) { return true; } } else if (mStatisticComperator == "<") { if (statisticValue < mStatisticCompareValue) { return true; } } else if (mStatisticComperator == ">") { if (statisticValue > mStatisticCompareValue) { return true; } } else if (mStatisticComperator == "!=" || mStatisticComperator == "!") { if (statisticValue != mStatisticCompareValue) { return true; } } return false; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationResponseFileListSummarizer.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationResponseFileListSummarizer.0000644000175000017500000000437012520551336032462 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationResponseFileListSummarizer.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationResponseFileListSummarizer::CReasonerEvaluationResponseFileListSummarizer() { } CReasonerEvaluationResponseFileListSummarizer::~CReasonerEvaluationResponseFileListSummarizer() { } CReasonerEvaluationDataValue* CReasonerEvaluationResponseFileListSummarizer::summarizeEvaluationData(CReasonerEvaluationDataValue* dataValues) { CReasonerEvaluationStringValue* respFileValues = dynamic_cast(dataValues); if (respFileValues) { cint64 averagedDataFlags = 0; QStringList responseFileList; CReasonerEvaluationStringValue* respFileValueIt = respFileValues; while (respFileValueIt) { responseFileList.append(respFileValueIt->getValue()); averagedDataFlags |= respFileValueIt->getDataFlags(); CReasonerEvaluationStringValue* tmpRespFileDataValue = respFileValueIt; respFileValueIt = (CReasonerEvaluationStringValue*)respFileValueIt->getNext(); delete tmpRespFileDataValue; } CReasonerEvaluationStringListValue* summarizedRespFileDataValues = new CReasonerEvaluationStringListValue(responseFileList); summarizedRespFileDataValues->setDataFlags(averagedDataFlags); return summarizedRespFileDataValues; } return nullptr; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationFilterStringCondition.h0000644000175000017500000000436512520551326031607 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTERSTRINGCONDITION_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTERSTRINGCONDITION_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationFilterCondition.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationFilterStringCondition * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationFilterStringCondition : public CReasonerEvaluationFilterCondition { // public methods public: //! Constructor CReasonerEvaluationFilterStringCondition(const QString& statisticNameString, const QString& statisticComperator, const QString& statisticCompareValueString); virtual bool isStatisticConditionSatisfied(const QString& statisticString, const QString& statisticValueString); // protected methods protected: // protected variables protected: QString mStatisticCompareValue; QString mStatisticComperator; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTERSTRINGCONDITION_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationFilterCondition.h0000644000175000017500000000422712520551326030415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTERCONDITION_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTERCONDITION_H // Libraries includes #include #include #include // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationFilterCondition * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationFilterCondition { // public methods public: //! Constructor CReasonerEvaluationFilterCondition(const QString& statisticNameString); virtual bool isStatisticConditionSatisfied(const QString& statisticNameString, const QString& statisticValueString) = 0; virtual bool isStatisticConditionSatisfied(const QStringList& statisticList); // protected methods protected: // protected variables protected: QString mStatisticName; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFILTERCONDITION_H ././@LongLink0000644000000000000000000000021700000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerStatist0000644000175000017500000001764212520551330032613 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser::CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser() { } CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser::~CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser() { } CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser* CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser::addNextStatisticName(const QString& statName) { mStatNameList.append(statName); return this; } bool CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser::analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector) { mOutputFileName = QString("%1").arg(selector->getOutputString()); QDir outDir(outputDirectory); outDir.mkpath(mOutputFileName); QHash< QPair,double >* reasonerRequestValueHash = mSelectorReasonerRequestValueHash[selector]; if (!reasonerRequestValueHash) { reasonerRequestValueHash = new QHash< QPair,double >(); mSelectorReasonerRequestValueHash[selector] = reasonerRequestValueHash; } bool hasDataSelected = false; foreach (QString groupString, groubList) { if (selector->isGroupSelected(groupString)) { QSet* groupRequestList = getGroupRequests(groupString); foreach (QString requestString, *groupRequestList) { if (selector->isRequestSelected(groupString,requestString)) { bool allDataAvailable = true; foreach (QString reasonerString, reasonerList) { bool dataAvailable = false; CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); if (!evalData || evalData->hasDataNotAvailableFlag()) { allDataAvailable = false; } else if (evalData) { CReasonerEvaluationDoubleDataValue* doubleDataValue = dynamic_cast(evalData); if (doubleDataValue) { hasDataSelected = true; dataAvailable = true; reasonerRequestValueHash->insertMulti(QPair(reasonerString,groupString+requestString),doubleDataValue->getValue()); } } if (!dataAvailable) { reasonerRequestValueHash->insertMulti(QPair(reasonerString,groupString+requestString),0.); } } } } } } if (hasDataSelected) { foreach (QString reasonerString, reasonerList) { QString outputFileString(outputDirectory+mOutputFileName+reasonerString+"-statistic-values"); CReasonerEvaluationTableMultiFormatOutputWriter tableMultiFormatOutputWriter; QStringList titleList; titleList.append("Request"); titleList.append(mStatNameList); tableMultiFormatOutputWriter.addColumnTitles(titleList); bool tableFilled = false; QString outputFileGroupString(outputDirectory+mOutputFileName+reasonerString+"-included-grouping-statistic-values"); CReasonerEvaluationTableMultiFormatOutputWriter groupTableMultiFormatOutputWriter; QStringList groupTitleList; groupTitleList.append("Request\tGroup"); groupTitleList.append(mStatNameList); groupTableMultiFormatOutputWriter.addColumnTitles(groupTitleList); foreach (const QString& groupString, groubList) { if (selector->isGroupSelected(groupString)) { QSet* groupRequestList = getGroupRequests(groupString); foreach (QString requestString, *groupRequestList) { if (selector->isRequestSelected(groupString,requestString)) { QList valueList(reasonerRequestValueHash->values(QPair(reasonerString,groupString+requestString))); if (valueList.count() >= mStatNameList.count()) { groupTableMultiFormatOutputWriter.addNewTableRow(requestString+"\t"+groupString); tableMultiFormatOutputWriter.addNewTableRow(requestString); QList reverseDoubleValueList; foreach (double doubleDataValue, valueList) { reverseDoubleValueList.prepend(doubleDataValue); tableFilled = true; } foreach (double doubleValue, reverseDoubleValueList) { tableMultiFormatOutputWriter.addValuesToLastTableRow(QList()<()<isGNUPlottingActivated()) { reasonerCompGNUPlotFileList += tableMultiFormatOutputWriter.writeGNUPlotDataTable(outputFileString); foreach (QString plotFileString, reasonerCompGNUPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".dat"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getGNUPlotPlotter()->createReasonerComparisonPlot(plotFileString,title,mStatNameList,outputFile); } } } if (context->isHighchartPlottingActivated()) { foreach (QString plotFileString, reasonerCompHighchartPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createReasonerComparisonPlot(plotFileString,title,mStatNameList,outputFile,selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } } } } } return true; } QString CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser::getPrettyTitleFromOutputFile(const QString& outputFile) { QString title = outputFile; title.remove("table"); cint64 slashPos = title.lastIndexOf("/"); if (slashPos >= 0) { title = title.mid(slashPos+1); } title.replace("-"," "); title.replace("mmm","Comparision,"); title.replace("sorted","Sorted"); title.replace("separate","Separate"); return title; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationFilterStringCondition.cpp0000644000175000017500000000537012520551326032137 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationFilterStringCondition.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationFilterStringCondition::CReasonerEvaluationFilterStringCondition(const QString& statisticNameString, const QString& statisticComperator, const QString& statisticCompareValueString) : CReasonerEvaluationFilterCondition(statisticNameString) { mStatisticCompareValue = statisticCompareValueString; mStatisticComperator = statisticComperator; } bool CReasonerEvaluationFilterStringCondition::isStatisticConditionSatisfied(const QString& statisticString, const QString& statisticValueString) { if (mStatisticComperator == "=" || mStatisticComperator == "==") { if (statisticValueString == mStatisticCompareValue) { return true; } } else if (mStatisticComperator == "!=" || mStatisticComperator == "!") { if (statisticValueString != mStatisticCompareValue) { return true; } } else if (mStatisticComperator == "contains") { if (statisticValueString.contains(mStatisticCompareValue)) { return true; } } else if (mStatisticComperator == "CONTAINS") { if (statisticValueString.toUpper().contains(mStatisticCompareValue)) { return true; } } else if (mStatisticComperator == "startsWith") { if (statisticValueString.startsWith(mStatisticCompareValue)) { return true; } } else if (mStatisticComperator == "STARTSWITH") { if (statisticValueString.toUpper().startsWith(mStatisticCompareValue)) { return true; } } else if (mStatisticComperator == "endsWith") { if (statisticValueString.endsWith(mStatisticCompareValue)) { return true; } } else if (mStatisticComperator == "ENDSWITH") { if (statisticValueString.toUpper().endsWith(mStatisticCompareValue)) { return true; } } return false; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationStringListValue.cpp0000644000175000017500000000330312520551336030746 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationStringListValue.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationStringListValue::CReasonerEvaluationStringListValue(const QStringList& value) { mValue = value; } CReasonerEvaluationStringListValue::~CReasonerEvaluationStringListValue() { } CReasonerEvaluationDataValue* CReasonerEvaluationStringListValue::getCopy() { return new CReasonerEvaluationStringListValue(*this); } QString CReasonerEvaluationStringListValue::generateString() { return mValue.join("\n"); } const QStringList& CReasonerEvaluationStringListValue::getValue() { return mValue; } CReasonerEvaluationStringListValue* CReasonerEvaluationStringListValue::setValue(const QStringList& value) { mValue = value; return this; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationUpdater.h0000644000175000017500000000352012520551340026714 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONUPDATER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONUPDATER_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationUpdater * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationUpdater { // public methods public: //! Constructor CReasonerEvaluationUpdater(); //! Destructor virtual ~CReasonerEvaluationUpdater(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONUPDATER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationStringMatchGroupSelector.h0000644000175000017500000000444712520551336032267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSTRINGMATCHGROUPSELECTOR_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSTRINGMATCHGROUPSELECTOR_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGroupRequestSelector.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationStringMatchGroupSelector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationStringMatchGroupSelector : public CReasonerEvaluationGroupRequestSelector { // public methods public: //! Constructor CReasonerEvaluationStringMatchGroupSelector(); CReasonerEvaluationStringMatchGroupSelector(const QSet& groupStringSet); virtual bool isGroupSelected(const QString& groupString); virtual bool isRequestSelected(const QString& groupString, const QString& requestString); CReasonerEvaluationStringMatchGroupSelector* addGroupString(const QString& groupString); // protected methods protected: // protected variables protected: QSet mGroupStringSet; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSTRINGMATCHGROUPSELECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDataValueGroupCollection.h0000644000175000017500000000442712520551322032216 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUEGROUPCOLLECTION_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUEGROUPCOLLECTION_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValueGroup.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationDataValueGroupCollection * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationDataValueGroupCollection { // public methods public: //! Constructor CReasonerEvaluationDataValueGroupCollection(); //! Destructor virtual ~CReasonerEvaluationDataValueGroupCollection(); CReasonerEvaluationDataValueGroupCollection* addNameGroupEvaluationData(const QString& groupName, CReasonerEvaluationDataValueGroup* group); QMap* getNameGroupMap(); // protected methods protected: // protected variables protected: QMap mNameGroupMap; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDATAVALUEGROUPCOLLECTION_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDataValueGroupCollection.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDataValueGroupCollection.cp0000644000175000017500000000314712520551322032367 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationDataValueGroupCollection.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationDataValueGroupCollection::CReasonerEvaluationDataValueGroupCollection() { } CReasonerEvaluationDataValueGroupCollection::~CReasonerEvaluationDataValueGroupCollection() { } CReasonerEvaluationDataValueGroupCollection* CReasonerEvaluationDataValueGroupCollection::addNameGroupEvaluationData(const QString& groupName, CReasonerEvaluationDataValueGroup* group) { mNameGroupMap.insert(groupName,group); return this; } QMap* CReasonerEvaluationDataValueGroupCollection::getNameGroupMap() { return &mNameGroupMap; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerResultD0000644000175000017500000004265112520551330032540 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser::CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser() { } CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser::~CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser() { } cint64 CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser::compareResultsSimilarityWithOtherReasoners(const QString& groupString, const QString& requestString, const QString& reasonerString, CReasonerEvaluationStringListValue* stringListDataValue, const QStringList& reasonerList) { cint64 totalDifferentResultCount = 0; const QStringList& responseFileStringList = stringListDataValue->getValue(); if (!responseFileStringList.isEmpty()) { QString responseFileString = responseFileStringList.first(); QFile responseFile(responseFileString); bool fileOpened = false; QDomDocument document; CClassHierarchyResult* lastClassHierResult = nullptr; cint64 lastClassHierResultNumber = 0; foreach (const QString& otherReasoner, reasonerList) { if (otherReasoner != reasonerString) { cint64 reasonerDifferentResultCount = 0; CReasonerEvaluationDataValue* otherReasonerEvalData = getGroupRequestReasonerEvaluationData(groupString,requestString,otherReasoner); CReasonerEvaluationStringListValue* otherReasonerStringListDataValue = dynamic_cast(otherReasonerEvalData); if (otherReasonerStringListDataValue) { const QStringList& otherResponseFileStringList = otherReasonerStringListDataValue->getValue(); if (!otherResponseFileStringList.isEmpty()) { CReasonerEvaluationStringListValue* minVal = qMin(stringListDataValue,otherReasonerStringListDataValue); CReasonerEvaluationStringListValue* maxVal = qMax(stringListDataValue,otherReasonerStringListDataValue); if (mReasonerCompareDiffCountHash.contains(QPair(minVal,maxVal))) { reasonerDifferentResultCount += mReasonerCompareDiffCountHash.value(QPair(minVal,maxVal)); } else { if (!fileOpened) { if (responseFile.open(QIODevice::ReadOnly)) { document.setContent(&responseFile,false); responseFile.close(); } fileOpened = true; } QDomElement rootEl = document.documentElement(); QDomElement classResEl = rootEl.firstChildElement(); bool foundResult = false; bool foundError = false; cint64 nodeNumber = 0; if (!classResEl.isNull()) { while (!classResEl.isNull()) { if (classResEl.nodeName() == "Error") { foundError = true; break; } else if (classResEl.nodeName() == "ClassHierarchy" || classResEl.nodeName() == "BooleanResponse" || classResEl.nodeName() == "Classes") { foundResult = true; CClassHierarchyResult* classHierResult = nullptr; if (lastClassHierResult && lastClassHierResultNumber == nodeNumber) { classHierResult = lastClassHierResult; } CBooleanQueryResult* booleanResult = nullptr; CClassesResult* classesResult = nullptr; cint64 diffCount = 0; QHash,cint64>*& compareDiffCountHash = mNumberCompareDiffCountHashHash[nodeNumber]; if (!compareDiffCountHash) { compareDiffCountHash = new QHash,cint64>(); } if (compareDiffCountHash->contains(QPair(minVal,maxVal))) { diffCount += compareDiffCountHash->value(QPair(minVal,maxVal)); } else { if (classResEl.nodeName() == "ClassHierarchy") { if (!classHierResult) { classHierResult = mResultParser.parseClassHierarchyResult(&classResEl); } QString otherResponseFileString = otherResponseFileStringList.first(); LOG(INFO,"::Konclude::Test::Evaluation::ResultDifferenceAnalyser",logTr("Comparing classification results between '%1' and '%2'.").arg(responseFileString).arg(otherResponseFileString),this); if (!isClassHierarchyResultSimilarTo(classHierResult,nodeNumber,otherResponseFileString)) { diffCount = 1; } } else if (classResEl.nodeName() == "BooleanResponse") { if (!booleanResult) { booleanResult = mResultParser.parseBooleanQueryResult(&classResEl); } QString otherResponseFileString = otherResponseFileStringList.first(); LOG(INFO,"::Konclude::Test::Evaluation::ResultDifferenceAnalyser",logTr("Comparing boolean results between '%1' and '%2'.").arg(responseFileString).arg(otherResponseFileString),this); if (!isBooleanResultSimilarTo(booleanResult,nodeNumber,otherResponseFileString)) { diffCount = 1; } } else if (classResEl.nodeName() == "Classes") { if (!classesResult) { classesResult = mResultParser.parseClassesResult(&classResEl); } QString otherResponseFileString = otherResponseFileStringList.first(); LOG(INFO,"::Konclude::Test::Evaluation::ResultDifferenceAnalyser",logTr("Comparing classes results between '%1' and '%2'.").arg(responseFileString).arg(otherResponseFileString),this); if (!isClassesResultSimilarTo(classesResult,nodeNumber,otherResponseFileString)) { diffCount = 1; } } compareDiffCountHash->insert(QPair(minVal,maxVal),diffCount); } reasonerDifferentResultCount += diffCount; if (classHierResult) { if (!lastClassHierResult) { lastClassHierResult = classHierResult; lastClassHierResultNumber = nodeNumber; } else { if (lastClassHierResult != classHierResult) { delete classHierResult; } } } if (booleanResult) { delete booleanResult; } if (classesResult) { delete classesResult; } } ++nodeNumber; classResEl = classResEl.nextSiblingElement(); } } mReasonerCompareDiffCountHash.insert(QPair(minVal,maxVal),reasonerDifferentResultCount); } } } totalDifferentResultCount += reasonerDifferentResultCount; } } if (lastClassHierResult) { delete lastClassHierResult; } } return totalDifferentResultCount; } bool CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser::isClassHierarchyResultSimilarTo(CClassHierarchyResult* classHierResult, cint64 nodeNumber, const QString& otherResponseFileString) { bool resultSimilar = true; QFile responseFile(otherResponseFileString); if (responseFile.open(QIODevice::ReadOnly)) { QDomDocument document; document.setContent(&responseFile,false); QDomElement rootEl = document.documentElement(); QDomElement classResEl = rootEl.firstChildElement(); cint64 currNodeNumber = 0; if (!classResEl.isNull()) { while (!classResEl.isNull()) { if (classResEl.nodeName() == "Error") { break; } else if (currNodeNumber == nodeNumber && classResEl.nodeName() == "ClassHierarchy") { CClassHierarchyResult* otherClassHierResult = mResultParser.parseClassHierarchyResult(&classResEl); if (otherClassHierResult) { if (!classHierResult->isResultEquivalentTo(otherClassHierResult)) { resultSimilar = false; } delete otherClassHierResult; } break; } else { ++currNodeNumber; if (currNodeNumber > nodeNumber) { break; } classResEl = classResEl.nextSiblingElement(); } } } } return resultSimilar; } bool CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser::isBooleanResultSimilarTo(CBooleanQueryResult* booleanResult, cint64 nodeNumber, const QString& otherResponseFileString) { bool resultSimilar = true; QFile responseFile(otherResponseFileString); if (responseFile.open(QIODevice::ReadOnly)) { QDomDocument document; document.setContent(&responseFile,false); QDomElement rootEl = document.documentElement(); QDomElement classResEl = rootEl.firstChildElement(); cint64 currNodeNumber = 0; if (!classResEl.isNull()) { while (!classResEl.isNull()) { if (classResEl.nodeName() == "Error") { break; } else if (currNodeNumber == nodeNumber && classResEl.nodeName() == "BooleanResponse") { CBooleanQueryResult* otherBooleanResult = mResultParser.parseBooleanQueryResult(&classResEl); if (otherBooleanResult) { if (!booleanResult->isResultEquivalentTo(otherBooleanResult)) { resultSimilar = false; } delete otherBooleanResult; } break; } else { ++currNodeNumber; if (currNodeNumber > nodeNumber) { break; } classResEl = classResEl.nextSiblingElement(); } } } } return resultSimilar; } bool CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser::isClassesResultSimilarTo(CClassesResult* classesResult, cint64 nodeNumber, const QString& otherResponseFileString) { bool resultSimilar = true; QFile responseFile(otherResponseFileString); if (responseFile.open(QIODevice::ReadOnly)) { QDomDocument document; document.setContent(&responseFile,false); QDomElement rootEl = document.documentElement(); QDomElement classResEl = rootEl.firstChildElement(); cint64 currNodeNumber = 0; if (!classResEl.isNull()) { while (!classResEl.isNull()) { if (classResEl.nodeName() == "Error") { break; } else if (currNodeNumber == nodeNumber && classResEl.nodeName() == "Classes") { CClassesResult* otherClassesResult = mResultParser.parseClassesResult(&classResEl); if (otherClassesResult) { if (!classesResult->isResultEquivalentTo(otherClassesResult)) { resultSimilar = false; } delete otherClassesResult; } break; } else { ++currNodeNumber; if (currNodeNumber > nodeNumber) { break; } classResEl = classResEl.nextSiblingElement(); } } } } return resultSimilar; } bool CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser::analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector) { mOutputFileName = QString("%1").arg(selector->getOutputString()); bool hasSelectedRequestFile = false; QStringList titleList; titleList.append("Requests"); titleList.append(reasonerList); titleList.append("Average"); titleList.append("Min"); titleList.append("Max"); QDir outDir(outputDirectory); outDir.mkpath(mOutputFileName); QString outputFileString(outputDirectory+mOutputFileName+"result-difference-to-other-reasoners"); CReasonerEvaluationTableMultiFormatOutputWriter tableMultiFormatOutputWriter; tableMultiFormatOutputWriter.addColumnTitles(titleList); foreach (QString groupString, groubList) { if (selector->isGroupSelected(groupString)) { QSet* groupRequestList = getGroupRequests(groupString); foreach (QString requestString, *groupRequestList) { if (selector->isRequestSelected(groupString,requestString)) { bool allDataAvailable = true; foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); if (!evalData || evalData->hasDataNotAvailableFlag()) { allDataAvailable = false; } } if (allDataAvailable) { hasSelectedRequestFile = true; double min = DOUBLE_MAX; double max = DOUBLE_MIN; double mean = 0.; cint64 count = 0; tableMultiFormatOutputWriter.addNewTableRow(requestString); foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); CReasonerEvaluationStringListValue* stringListDataValue = dynamic_cast(evalData); if (stringListDataValue) { QStringList responseFiles = stringListDataValue->getValue(); double diffCount = compareResultsSimilarityWithOtherReasoners(groupString,requestString,reasonerString,stringListDataValue,reasonerList); tableMultiFormatOutputWriter.addValuesToLastTableRow(QList()<()<isGNUPlottingActivated()) { reasonerCompGNUPlotFileList += tableMultiFormatOutputWriter.writeGNUPlotDataTable(outputFileString); reasonerCompGNUPlotFileList += tableMultiFormatOutputWriter.writeGNUPlotDataTablesSorted(outputFileString); foreach (QString plotFileString, reasonerCompGNUPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".dat"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getGNUPlotPlotter()->createReasonerComparisonPlot(plotFileString,context->getAdditionalTitleString()+title+"[# differences]",reasonerList,outputFile); } } } if (context->isHighchartPlottingActivated()) { foreach (QString plotFileString, reasonerCompHighchartPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createReasonerDifferencePlot(plotFileString,context->getAdditionalTitleString()+title+"[# differences]",reasonerList,outputFile,selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } } } return true; } QString CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser::getPrettyTitleFromOutputFile(const QString& outputFile) { QString title = outputFile; title.remove("table"); cint64 slashPos = title.lastIndexOf("/"); if (slashPos >= 0) { title = title.mid(slashPos+1); } title.replace("-"," "); title.replace("result difference to other reasoners","Result Differences to other Reasoners, "); title.replace("sorted","Sorted"); if (title.contains(" ascending")) { title.replace(" ascending",""); title.append(" in Ascending Order "); } if (title.contains(" descending")) { title.replace(" descending",""); title.append(" in Descending Order "); } return title; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000020300000000000011576 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerWithMea0000644000175000017500000000604412520551330032510 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERWITHMEANMINMAXCSVCOMPARISONANALYSER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERWITHMEANMINMAXCSVCOMPARISONANALYSER_H // Libraries includes #include #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGNUPlotPlotter.h" #include "CReasonerEvaluationHighchartPlotter.h" #include "CReasonerEvaluationAnalyseContext.h" #include "CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" #include "CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h" #include "CReasonerEvaluationDoubleDataValue.h" #include "CReasonerEvaluationTableMultiFormatOutputWriter.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser : public CReasonerEvaluationGroupRequestReasonerComparisonAnalyser { // public methods public: //! Constructor CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser(); //! Destructor virtual ~CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser(); QString getPrettyTitleFromOutputFile(const QString& outputFile); // protected methods protected: virtual bool analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector); // protected variables protected: QString mOutputFileName; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERWITHMEANMINMAXCSVCOMPARISONANALYSER_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExpressivityRequestSelector.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExpressivityRequestSelector0000644000175000017500000001015412520551324032655 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationExpressivityRequestSelector.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationExpressivityRequestSelector::CReasonerEvaluationExpressivityRequestSelector(const QList& equalBoundList, const QString& baseExpressivityDir) { mEqualBoundList = equalBoundList; mBaseExpressivityDir = baseExpressivityDir; } CReasonerEvaluationExpressivityRequestSelector::CReasonerEvaluationExpressivityRequestSelector(const QList& lowerNotIncludedBoundList, const QList& upperIncludedBoundList, const QString& baseExpressivityDir) { mLowerNotIncludedBoundList = lowerNotIncludedBoundList; mUpperIncludedBoundList = upperIncludedBoundList; mBaseExpressivityDir = baseExpressivityDir; } CReasonerEvaluationExpressivityRequestSelector::CReasonerEvaluationExpressivityRequestSelector() { } bool CReasonerEvaluationExpressivityRequestSelector::isGroupSelected(const QString& groupString) { return true; } bool CReasonerEvaluationExpressivityRequestSelector::isRequestSelected(const QString& groupString, const QString& requestString) { QString expressivityString; bool foundExpressivity = false; QString infoFileString = mBaseExpressivityDir+groupString+requestString+".txt"; QFile infoFile(infoFileString); if (infoFile.open(QIODevice::ReadOnly)) { while (!foundExpressivity && !infoFile.atEnd()) { QString line = infoFile.readLine(); QStringList keyValueLists = line.split("\t"); if (keyValueLists.count() >= 2) { if (keyValueLists.first().trimmed() == "Expressivness:") { foundExpressivity = true; expressivityString = keyValueLists.last().trimmed(); } } } infoFile.close(); } if (!foundExpressivity) { return false; } else { COntologyExpressivity expressivity(expressivityString); foreach (COntologyExpressivity expBound, mEqualBoundList) { if (expressivity.isExpressivityEqual(&expBound)) { return true; } } if (!mEqualBoundList.isEmpty()) { return false; } foreach (COntologyExpressivity expBound, mExcludedBoundList) { if (expressivity.isExpressivityEqual(&expBound)) { return false; } } foreach (COntologyExpressivity expBound, mLowerNotIncludedBoundList) { if (expBound.isExpressivityEntailed(&expressivity)) { return false; } } foreach (COntologyExpressivity expBound, mLowerIncludedBoundList) { if (expBound.isExpressivityEntailed(&expressivity) && !expressivity.isExpressivityEqual(&expBound)) { return false; } } bool entailedByOneUpperBounds = false; foreach (COntologyExpressivity expBound, mUpperNotIncludedBoundList) { if (expBound.isExpressivityEntailed(&expressivity) || !expressivity.isExpressivityEqual(&expBound)) { entailedByOneUpperBounds |= true; } } foreach (COntologyExpressivity expBound, mUpperIncludedBoundList) { if (expBound.isExpressivityEntailed(&expressivity)) { entailedByOneUpperBounds |= true; } } if (!entailedByOneUpperBounds) { return false; } } return true; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationSummarizer.cpp0000644000175000017500000000221212520551340027776 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationSummarizer.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationSummarizer::CReasonerEvaluationSummarizer() { } CReasonerEvaluationSummarizer::~CReasonerEvaluationSummarizer() { } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CConfigDependendReasonerEvaluationFactory.cpp0000644000175000017500000000356012520551316032216 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfigDependendReasonerEvaluationFactory.h" namespace Konclude { namespace Test { namespace Evaluation { CConfigDependendReasonerEvaluationFactory::CConfigDependendReasonerEvaluationFactory() { } CConfigDependendReasonerEvaluationFactory::~CConfigDependendReasonerEvaluationFactory() { } CReasonerEvaluationProvider* CConfigDependendReasonerEvaluationFactory::createReasonerProvider(CConfiguration *config) { CReasonerEvaluationProvider* evalProv = nullptr; QString reasonerExecutionTyp = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.Reasoner.ExecutionType"); if (reasonerExecutionTyp == "OWLlinkOWLAPIServerAdapter") { evalProv = new CReasonerOWLlinkEvaluationProvider(); } else if (reasonerExecutionTyp == "Binary") { evalProv = new CReasonerExecutableEvaluationProvider(); } else if (reasonerExecutionTyp == "Konclude") { evalProv = new CReasonerKoncludeEvaluationProvider(); } return evalProv; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationHighchartPlotter.h0000644000175000017500000001743512520551332030576 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONHIGHCHARTPLOTTER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONHIGHCHARTPLOTTER_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationHighchartPlotter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationHighchartPlotter { // public methods public: //! Constructor CReasonerEvaluationHighchartPlotter(CReasonerEvaluationAnalyseContext* context); //! Destructor virtual ~CReasonerEvaluationHighchartPlotter(); CReasonerEvaluationHighchartPlotter* createReasonerFasterPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& selectionString, const QString& outputFile); CReasonerEvaluationHighchartPlotter* createReasonerComparisonPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& selectionString, const QString& outputFile); CReasonerEvaluationHighchartPlotter* createReasonerDifferencePlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& selectionString, const QString& outputFile); CReasonerEvaluationHighchartPlotter* createReasonerErrorPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& selectionString, const QString& outputFile); CReasonerEvaluationHighchartPlotter* createReasonerAccumulatedPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& selectionString, const QString& outputFile); CReasonerEvaluationHighchartPlotter* createReasonerOverviewPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& selectionString, const QString& outputFile); CReasonerEvaluationHighchartPlotter* createReasonerAccumulatedCountPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& selectionString, const QString& outputFile); CReasonerEvaluationHighchartPlotter* createRequestStatisticsPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& selectionString, const QString& outputFile); CReasonerEvaluationHighchartPlotter* createReasonerWinnerCountPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& selectionString, const QString& outputFile); CReasonerEvaluationHighchartPlotter* createReasonerStackedBucketPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& selectionString, const QString& outputFile); CReasonerEvaluationHighchartPlotter* createReasonerBucketPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& selectionString, const QString& outputFile); CReasonerEvaluationHighchartPlotter* createReasonerCumulativeBucketPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& selectionString, const QString& outputFile); CReasonerEvaluationHighchartPlotter* createReasonerComparisonSplitPlot(const QStringList& dataFileStringList, const QStringList& plotTitleList, const QStringList& reasonerNameList, const QString& selectionString); CReasonerEvaluationHighchartPlotter* createReasonerFasterSplitPlot(const QStringList& dataFileStringList, const QStringList& plotTitleList, const QStringList& reasonerNameList, const QString& selectionString); // protected methods protected: QMap loadReasonerStringIndexMap(const QString& dataFileString); QString loadTemplateFromFile(const QString& fileString); bool hasValidColorsForAllReasoenrs(const QStringList& reasonerList); bool loadReasonerComparisonData(const QString& dataFileString, QStringList& labelList, QMap& valueListMap); QString getColorString(const QString& reasonerString, QSet* usedReasonerColorSet = nullptr); QString getFileNameWithoutDirectory(const QString& fileNameString); CReasonerEvaluationHighchartPlotter* createReasonerPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QHash& reasTemplateStringHash, const QString& selectionString, const QString& curveString = "type: 'column',"); CReasonerEvaluationHighchartPlotter* sortAndCreateReasonerSplitPlot(const QStringList& dataFileStringList, const QStringList& plotTitleList, const QStringList& reasonerNameList, const QHash& reasTemplateOverStringHash, const QHash& reasTemplateContStringHash, const QString& selectionString); CReasonerEvaluationHighchartPlotter* createReasonerSplitPlot(const QStringList& dataFileStringList, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QHash& reasTemplateOverStringHash, const QHash& reasTemplateContStringHash, const QString& selectionString); bool loadReasonerColorData(const QString& dataFileString, QHash& reasColorHash); // protected variables protected: CReasonerEvaluationAnalyseContext* mContext; QString mReasCompTemplateString; QString mReasOverTemplateString; QHash mReasCompTemplateStringHash; QHash mReasFasterTemplateStringHash; QHash mReasDiffTemplateStringHash; QHash mReasErrorTemplateStringHash; QHash mReasAccumTemplateStringHash; QHash mReasOverviewTemplateStringHash; QHash mReasWinnerTemplateStringHash; QHash mReasStackedBucketTemplateStringHash; QHash mReasBucketTemplateStringHash; QHash mReasCumulativeBucketTemplateStringHash; QHash mReasAccumCountTemplateStringHash; QHash mRequestStatisticsTemplateStringHash; QHash mReasCompSplitOverTemplateStringHash; QHash mReasCompSplitContentTemplateStringHash; QHash mReasFasterSplitOverTemplateStringHash; QHash mReasFasterSplitContentTemplateStringHash; QHash mReasColorHash; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONHIGHCHARTPLOTTER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationProfileSelectorFactory.h0000644000175000017500000000533712520551334031754 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPROFILESELECTORFACTORY_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPROFILESELECTORFACTORY_H // Libraries includes #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGroupRequestSelector.h" #include "CReasonerEvaluationProfileRequestSelector.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationProfileSelectorFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationProfileSelectorFactory { // public methods public: //! Constructor CReasonerEvaluationProfileSelectorFactory(const QString& baseEvalName, const QString& baseOutputDir, const QString& expressivityDir); CReasonerEvaluationGroupRequestSelector* getSelectors(CReasonerEvaluationGroupRequestSelector* prevSelector); CReasonerEvaluationGroupRequestSelector* getSelectorsForDLProfile(CReasonerEvaluationGroupRequestSelector* prevSelector); CReasonerEvaluationGroupRequestSelector* getSelectorsForELProfile(CReasonerEvaluationGroupRequestSelector* prevSelector); CReasonerEvaluationGroupRequestSelector* getSelectorsForQLProfile(CReasonerEvaluationGroupRequestSelector* prevSelector); CReasonerEvaluationGroupRequestSelector* getSelectorsForRLProfile(CReasonerEvaluationGroupRequestSelector* prevSelector); // protected methods protected: // protected variables protected: QString mBaseEvalName; QString mBaseOutputDir; QString mExpressivityDir; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONPROFILESELECTORFACTORY_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationUpdaterThread.cpp0000644000175000017500000000540112520551340030377 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationUpdaterThread.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationUpdaterThread::CReasonerEvaluationUpdaterThread() : CThread("ReasonerEvaluationUpdaterThread") { startThread(); } CReasonerEvaluationUpdaterThread::~CReasonerEvaluationUpdaterThread() { } void CReasonerEvaluationUpdaterThread::addProgramFile(const QString& changedFile) { postEvent(new CReasonerEvaluationUpdateEvent(changedFile)); } void CReasonerEvaluationUpdaterThread::threadStarted() { CThread::threadStarted(); mSystemWatcher = new QFileSystemWatcher(this); connect(mSystemWatcher,SIGNAL(fileChanged(const QString&)),this,SLOT(watchedProgramFileChanged(const QString&))); } void CReasonerEvaluationUpdaterThread::threadStopped() { CThread::threadStopped(); disconnect(mSystemWatcher,SIGNAL(fileChanged(const QString&)),this,SLOT(watchedProgramFileChanged(const QString&))); } bool CReasonerEvaluationUpdaterThread::processCustomsEvents(QEvent::Type type, CCustomEvent* event) { if (CThread::processCustomsEvents(type,event)) { return true; } else { if (type == CReasonerEvaluationUpdateEvent::EVENTTYPE) { CReasonerEvaluationUpdateEvent* repe = (CReasonerEvaluationUpdateEvent*)event; QString programString = repe->getProgramFile(); mSystemWatcher->addPath(programString); return true; } else if (type == CReasonerEvaluationProgramFileChangedEvent::EVENTTYPE) { CReasonerEvaluationProgramFileChangedEvent* repfce = (CReasonerEvaluationProgramFileChangedEvent*)event; QString changedFile = repfce->getChangedFile(); return true; } } return false; } void CReasonerEvaluationUpdaterThread::watchedProgramFileChanged(const QString& changedFile) { postEvent(new CReasonerEvaluationProgramFileChangedEvent(changedFile)); } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationFiltering.cpp0000644000175000017500000001033612520551326027575 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationFiltering.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationFiltering::CReasonerEvaluationFiltering(const QString& statisticsBasePath) : CLogIdentifier("::Konclude::Test::Evaluation::Filtering",this) { mStatisticsBasePath = statisticsBasePath; } bool CReasonerEvaluationFiltering::loadFilterFromFile(const QString& filterNameString) { CReasonerEvaluationFilter* filter = new CReasonerEvaluationFilter(); LOG(INFO,getLogDomain(),logTr("Loading filter from file '%1'.").arg(filterNameString),this); if (filter->loadFilterConditionFile(filterNameString)) { mFilterList.append(filter); LOG(INFO,getLogDomain(),logTr("Successfully loaded filter from file '%1'.").arg(filterNameString),this); return true; } else { delete filter; LOG(ERROR,getLogDomain(),logTr("Loading filter from file '%1' failed.").arg(filterNameString),this); return false; } } bool CReasonerEvaluationFiltering::loadEmptyFilter() { CReasonerEvaluationFilter* filter = new CReasonerEvaluationFilter(); mFilterList.append(filter); return true; } bool CReasonerEvaluationFiltering::loadFiltersFromFile(const QStringList& filterNameStringList) { bool loadedOne = false; foreach (const QString& fileName, filterNameStringList) { loadedOne |= loadFilterFromFile(fileName); } return loadedOne; } bool CReasonerEvaluationFiltering::testSatisfiesFilter(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString, const QStringList& statisticList) { foreach (CReasonerEvaluationFilter* filter, mFilterList) { if (filter->testSatisfiesFilterConditions(testFileNameString,testFilePathString,subDirPathString,statisticList)) { return true; } } return false; } bool CReasonerEvaluationFiltering::testSatisfiesFilter(const QStringList& statisticList) { foreach (CReasonerEvaluationFilter* filter, mFilterList) { if (filter->testSatisfiesFilterConditions(statisticList)) { return true; } } return false; } bool CReasonerEvaluationFiltering::testSatisfiesFilter(const QString& testFileNameString, const QStringList& statisticList) { foreach (CReasonerEvaluationFilter* filter, mFilterList) { if (filter->testSatisfiesFilterConditions(testFileNameString,statisticList)) { return true; } } return false; } QStringList CReasonerEvaluationFiltering::loadStatistics(const QString& testFileNameString, const QString& subDirPathString) { return loadStatistics(subDirPathString+testFileNameString); } QStringList CReasonerEvaluationFiltering::loadStatistics(const QString& subDirPathTestFileNameString) { QString useStatisticsBasePath = mStatisticsBasePath; QStringList statisticList; QString statisticFileString = useStatisticsBasePath+subDirPathTestFileNameString+".txt"; QFile statisticFile(statisticFileString); if (statisticFile.open(QIODevice::ReadOnly)) { while (!statisticFile.atEnd()) { QByteArray statDataLine(statisticFile.readLine()); statisticList.append(statDataLine.trimmed()); } statisticFile.close(); } else { LOG(INFO,getLogDomain(),logTr("Could not open statistics file '%1'.").arg(statisticFileString),this); } return statisticList; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationSpecifiedTimeExtractor.cpp0000644000175000017500000005005612520551336032264 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationSpecifiedTimeExtractor.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationSpecifiedTimeExtractor::CReasonerEvaluationSpecifiedTimeExtractor(CReasonerEvaluationExtractor::EXTRACTORTYPE extractorType, double timelimit, double errorPunishmentTime, CReasonerEvaluationDataValueCacher* cacher) { mTimelimit = timelimit; mErrorPunishmentTime = errorPunishmentTime; mCacher = cacher; mExtractorType = extractorType; mClassificationExtractionTagList << "Classify"; mConsistencyExtractionTagList << "IsKBSatisfiable"; mSatisfiabilityExtractionTagList << "IsClassSatisfiable"; mRealizationExtractionTagList << "Realize"; mCalculationExtractionTagList += mClassificationExtractionTagList; mCalculationExtractionTagList += mConsistencyExtractionTagList; mCalculationExtractionTagList += mSatisfiabilityExtractionTagList; mCalculationExtractionTagList += mRealizationExtractionTagList; } CReasonerEvaluationDoubleDataValue* CReasonerEvaluationSpecifiedTimeExtractor::extractSpecifiedTimesEvaluationData(QDomDocument& document, const QString& responseFileString, const QStringList& extractionTagList, CReasonerEvaluationExtractor::EXTRACTORTYPE extractionType) { CReasonerEvaluationDoubleDataValue* doubleEvalValue = nullptr; if (mCacher) { doubleEvalValue = dynamic_cast(mCacher->getCachedDataValue(responseFileString,(cint64)extractionType)); } if (!doubleEvalValue) { double doubleValue = 0; bool errorOccured = false; bool timeoutOccured = false; bool allRespTimeValid = true; bool lastTimeoutOccured = false; bool dataAvailable = false; QDomElement rootEl = document.documentElement(); QDomElement childEl = rootEl.firstChildElement(); while (!childEl.isNull()) { QString timeoutString = childEl.attribute("timeout"); if (timeoutString == "1") { lastTimeoutOccured = true; } QString requestCommandString = childEl.attribute("request-command"); bool useTagTime = false; foreach (const QString& extractionTag, extractionTagList) { if (requestCommandString == extractionTag) { useTagTime = true; dataAvailable = true; break; } } if (useTagTime) { if (lastTimeoutOccured) { timeoutOccured = true; } if (!timeoutOccured) { bool validResponseTime = false; QString respTimeString = childEl.attribute("response-time","timeout"); double respTime = respTimeString.toDouble(&validResponseTime); if (validResponseTime) { doubleValue += respTime; } if (childEl.tagName() == "Error") { validResponseTime = false; } allRespTimeValid &= validResponseTime; } } childEl = childEl.nextSiblingElement(); } if (timeoutOccured) { doubleValue = mTimelimit; } if (mTimelimit >= 0) { doubleValue = qMin(mTimelimit,doubleValue); } //if (errorOccured || !allRespTimeValid) { // if (mTimelimit >= 0) { // doubleValue = mTimelimit+mErrorPunishmentTime; // } else { // doubleValue = mErrorPunishmentTime; // } //} doubleEvalValue = new CReasonerEvaluationDoubleDataValue(doubleValue); if (!dataAvailable) { doubleEvalValue->setDataNotAvailableFlag(); } if (mCacher) { mCacher->addDataValueToCache(responseFileString,(cint64)extractionType,doubleEvalValue); } } return doubleEvalValue; } CReasonerEvaluationDoubleDataValue* CReasonerEvaluationSpecifiedTimeExtractor::extractClassificationEvaluationData(QDomDocument& document, const QString& responseFileString) { return extractSpecifiedTimesEvaluationData(document,responseFileString,mClassificationExtractionTagList,CReasonerEvaluationExtractor::CLASSIFICATIONTIMEEXTRACTOR); } CReasonerEvaluationDoubleDataValue* CReasonerEvaluationSpecifiedTimeExtractor::extractRealizationEvaluationData(QDomDocument& document, const QString& responseFileString) { return extractSpecifiedTimesEvaluationData(document,responseFileString,mRealizationExtractionTagList,CReasonerEvaluationExtractor::REALIZATIONTIMEEXTRACTOR); } CReasonerEvaluationDoubleDataValue* CReasonerEvaluationSpecifiedTimeExtractor::extractConsistencyEvaluationData(QDomDocument& document, const QString& responseFileString) { return extractSpecifiedTimesEvaluationData(document,responseFileString,mConsistencyExtractionTagList,CReasonerEvaluationExtractor::CONSISTENCYTIMEEXTRACTOR); } CReasonerEvaluationDoubleDataValue* CReasonerEvaluationSpecifiedTimeExtractor::extractSatisfiabilityEvaluationData(QDomDocument& document, const QString& responseFileString) { return extractSpecifiedTimesEvaluationData(document,responseFileString,mSatisfiabilityExtractionTagList,CReasonerEvaluationExtractor::SATISFIABILITYTIMEEXTRACTOR); } CReasonerEvaluationDoubleDataValue* CReasonerEvaluationSpecifiedTimeExtractor::extractCalculationEvaluationData(QDomDocument& document, const QString& responseFileString) { return extractSpecifiedTimesEvaluationData(document,responseFileString,mCalculationExtractionTagList,CReasonerEvaluationExtractor::CALCULATIONTIMEEXTRACTOR); } CReasonerEvaluationDoubleDataValue* CReasonerEvaluationSpecifiedTimeExtractor::extractLoadingEvaluationData(QDomDocument& document, const QString& responseFileString) { CReasonerEvaluationDoubleDataValue* doubleEvalValue = nullptr; if (mCacher) { doubleEvalValue = dynamic_cast(mCacher->getCachedDataValue(responseFileString,(cint64)CReasonerEvaluationExtractor::LOADINGTIMEEXTRACTOR)); } if (!doubleEvalValue) { double doubleValue = 0; bool errorOccured = false; bool timeoutOccured = false; bool allRespTimeValid = true; bool lastTimeoutOccured = false; QDomElement rootEl = document.documentElement(); QDomElement childEl = rootEl.firstChildElement(); while (!childEl.isNull()) { QString timeoutString = childEl.attribute("timeout"); if (timeoutString == "1") { lastTimeoutOccured = true; } QString requestCommandString = childEl.attribute("request-command"); if (requestCommandString == "Tell" || requestCommandString == "LoadOntologies") { if (lastTimeoutOccured) { timeoutOccured = true; } if (!timeoutOccured) { bool validResponseTime = false; QString respTimeString = childEl.attribute("response-time","timeout"); double respTime = respTimeString.toDouble(&validResponseTime); if (validResponseTime) { doubleValue += respTime; } if (childEl.tagName() != "OK") { validResponseTime = false; } allRespTimeValid &= validResponseTime; } } childEl = childEl.nextSiblingElement(); } if (timeoutOccured) { doubleValue = mTimelimit; } if (mTimelimit >= 0) { doubleValue = qMin(mTimelimit,doubleValue); } //if (errorOccured || !allRespTimeValid) { // if (mTimelimit >= 0) { // doubleValue = mTimelimit+mErrorPunishmentTime; // } else { // doubleValue = mErrorPunishmentTime; // } //} doubleEvalValue = new CReasonerEvaluationDoubleDataValue(doubleValue); if (mCacher) { mCacher->addDataValueToCache(responseFileString,(cint64)CReasonerEvaluationExtractor::LOADINGTIMEEXTRACTOR,doubleEvalValue); } } return doubleEvalValue; } CReasonerEvaluationDoubleDataValue* CReasonerEvaluationSpecifiedTimeExtractor::extractTotalResponseEvaluationData(QDomDocument& document, const QString& responseFileString) { CReasonerEvaluationDoubleDataValue* doubleEvalValue = nullptr; if (mCacher) { doubleEvalValue = dynamic_cast(mCacher->getCachedDataValue(responseFileString,(cint64)CReasonerEvaluationExtractor::TOTALRESPONSETIMEEXTRACTOR)); } if (!doubleEvalValue) { double doubleValue = 0; bool errorOccured = false; bool timeoutOccured = false; bool validResponseTime = false; QDomElement rootEl = document.documentElement(); QString respTimeString = rootEl.attribute("response-time"); double respTime = respTimeString.toDouble(&validResponseTime); if (validResponseTime) { doubleValue += respTime; } QDomElement childEl = rootEl.firstChildElement(); while (!childEl.isNull()) { QString timeoutString = childEl.attribute("timeout"); if (timeoutString == "1") { timeoutOccured = true; } if (!timeoutOccured) { QString requestCommandString = childEl.tagName(); if (requestCommandString == "Error") { errorOccured = true; } } childEl = childEl.nextSiblingElement(); } if (timeoutOccured) { doubleValue = mTimelimit; } if (mTimelimit >= 0) { doubleValue = qMin(mTimelimit,doubleValue); } //if (errorOccured || !validResponseTime) { // if (mTimelimit >= 0) { // doubleValue = mTimelimit+mErrorPunishmentTime; // } else { // doubleValue = mErrorPunishmentTime; // } //} doubleEvalValue = new CReasonerEvaluationDoubleDataValue(doubleValue); if (mCacher) { mCacher->addDataValueToCache(responseFileString,(cint64)CReasonerEvaluationExtractor::TOTALRESPONSETIMEEXTRACTOR,doubleEvalValue); } } return doubleEvalValue; } CReasonerEvaluationDoubleDataValue* CReasonerEvaluationSpecifiedTimeExtractor::extractTimeoutErrorEvaluationData(QDomDocument& document, const QString& responseFileString) { CReasonerEvaluationDoubleDataValue* doubleEvalValue = nullptr; if (mCacher) { doubleEvalValue = dynamic_cast(mCacher->getCachedDataValue(responseFileString,(cint64)CReasonerEvaluationExtractor::TIMEOUTERROREXTRACTOR)); } if (!doubleEvalValue) { cint64 errorTimeoutValue = 0; bool errorOccured = false; bool timeoutOccured = false; QDomElement rootEl = document.documentElement(); QDomElement childEl = rootEl.firstChildElement(); while (!childEl.isNull()) { QString timeoutString = childEl.attribute("timeout"); if (timeoutString == "1") { timeoutOccured = true; } if (!timeoutOccured) { QString requestCommandString = childEl.tagName(); if (requestCommandString == "Error") { errorOccured = true; } } childEl = childEl.nextSiblingElement(); } if (timeoutOccured || errorOccured) { ++errorTimeoutValue; } doubleEvalValue = new CReasonerEvaluationDoubleDataValue(errorTimeoutValue); if (mCacher) { mCacher->addDataValueToCache(responseFileString,(cint64)CReasonerEvaluationSpecifiedTimeExtractor::TIMEOUTERROREXTRACTOR,doubleEvalValue); } } return doubleEvalValue; } CReasonerEvaluationDoubleDataValue* CReasonerEvaluationSpecifiedTimeExtractor::extractErrorEvaluationData(QDomDocument& document, const QString& responseFileString) { CReasonerEvaluationDoubleDataValue* doubleEvalValue = nullptr; if (mCacher) { doubleEvalValue = dynamic_cast(mCacher->getCachedDataValue(responseFileString,(cint64)CReasonerEvaluationExtractor::ERROREXTRACTOR)); } if (!doubleEvalValue) { cint64 errorTimeoutValue = 0; bool errorOccured = false; bool timeoutOccured = false; QDomElement rootEl = document.documentElement(); QDomElement childEl = rootEl.firstChildElement(); while (!childEl.isNull()) { QString timeoutString = childEl.attribute("timeout"); if (timeoutString == "1") { timeoutOccured = true; } if (!timeoutOccured) { QString requestCommandString = childEl.tagName(); if (requestCommandString == "Error") { errorOccured = true; } } childEl = childEl.nextSiblingElement(); } if (errorOccured) { ++errorTimeoutValue; } doubleEvalValue = new CReasonerEvaluationDoubleDataValue(errorTimeoutValue); if (mCacher) { mCacher->addDataValueToCache(responseFileString,(cint64)CReasonerEvaluationSpecifiedTimeExtractor::ERROREXTRACTOR,doubleEvalValue); } } return doubleEvalValue; } CReasonerEvaluationDoubleDataValue* CReasonerEvaluationSpecifiedTimeExtractor::extractTimeoutEvaluationData(QDomDocument& document, const QString& responseFileString) { CReasonerEvaluationDoubleDataValue* doubleEvalValue = nullptr; if (mCacher) { doubleEvalValue = dynamic_cast(mCacher->getCachedDataValue(responseFileString,(cint64)CReasonerEvaluationExtractor::TIMEOUTEXTRACTOR)); } if (!doubleEvalValue) { cint64 errorTimeoutValue = 0; bool errorOccured = false; bool timeoutOccured = false; QDomElement rootEl = document.documentElement(); QDomElement childEl = rootEl.firstChildElement(); while (!childEl.isNull()) { QString timeoutString = childEl.attribute("timeout"); if (timeoutString == "1") { timeoutOccured = true; } childEl = childEl.nextSiblingElement(); } if (timeoutOccured) { ++errorTimeoutValue; } doubleEvalValue = new CReasonerEvaluationDoubleDataValue(errorTimeoutValue); if (mCacher) { mCacher->addDataValueToCache(responseFileString,(cint64)CReasonerEvaluationSpecifiedTimeExtractor::TIMEOUTEXTRACTOR,doubleEvalValue); } } return doubleEvalValue; } CReasonerEvaluationStringValue* CReasonerEvaluationSpecifiedTimeExtractor::extractResponseFileEvaluationData(QDomDocument& document, const QString& responseFileString) { CReasonerEvaluationStringValue* responseFileEvalValue = nullptr; if (mCacher) { responseFileEvalValue = dynamic_cast(mCacher->getCachedDataValue(responseFileString,(cint64)CReasonerEvaluationExtractor::RESPONSEFILEEXTRACTOR)); } if (!responseFileEvalValue) { responseFileEvalValue = new CReasonerEvaluationStringValue(responseFileString); if (mCacher) { mCacher->addDataValueToCache(responseFileString,(cint64)CReasonerEvaluationExtractor::RESPONSEFILEEXTRACTOR,responseFileEvalValue); } } return responseFileEvalValue; } CReasonerEvaluationStringValue* CReasonerEvaluationSpecifiedTimeExtractor::extractRequestFileEvaluationData(QDomDocument& document, const QString& responseFileString) { CReasonerEvaluationStringValue* requestFileEvalValue = nullptr; if (mCacher) { requestFileEvalValue = dynamic_cast(mCacher->getCachedDataValue(responseFileString,(cint64)CReasonerEvaluationExtractor::REQUESTFILEEXTRACTOR)); } if (!requestFileEvalValue) { QDomElement rootEl = document.documentElement(); QString requestFileString = rootEl.attribute("test"); requestFileString = requestFileString.replace("./",""); requestFileString = requestFileString.replace("Evaluation/Requests/",""); requestFileEvalValue = new CReasonerEvaluationStringValue(requestFileString); if (mCacher) { mCacher->addDataValueToCache(responseFileString,(cint64)CReasonerEvaluationExtractor::REQUESTFILEEXTRACTOR,requestFileEvalValue); } } return requestFileEvalValue; } CReasonerEvaluationDataValue* CReasonerEvaluationSpecifiedTimeExtractor::extractEvaluationData(const QString& responseFileString) { CReasonerEvaluationDataValue* evalValue = nullptr; if (mCacher) { evalValue = mCacher->getCachedDataValue(responseFileString,(cint64)mExtractorType); } if (!evalValue) { QFile responseFile(responseFileString); if (responseFile.open(QIODevice::ReadOnly)) { QDomDocument document; document.setContent(&responseFile,false); QDomElement rootEl = document.documentElement(); responseFile.close(); CReasonerEvaluationDoubleDataValue* doubleClassificationEvalValue = extractClassificationEvaluationData(document,responseFileString); if (mExtractorType == CReasonerEvaluationExtractor::CLASSIFICATIONTIMEEXTRACTOR) { evalValue = doubleClassificationEvalValue; } CReasonerEvaluationDoubleDataValue* doubleRealizationEvalValue = extractRealizationEvaluationData(document,responseFileString); if (mExtractorType == CReasonerEvaluationExtractor::REALIZATIONTIMEEXTRACTOR) { evalValue = doubleRealizationEvalValue; } CReasonerEvaluationDoubleDataValue* doubleConsistencyEvalValue = extractConsistencyEvaluationData(document,responseFileString); if (mExtractorType == CReasonerEvaluationExtractor::CONSISTENCYTIMEEXTRACTOR) { evalValue = doubleConsistencyEvalValue; } CReasonerEvaluationDoubleDataValue* doubleSatisfiabilityEvalValue = extractSatisfiabilityEvaluationData(document,responseFileString); if (mExtractorType == CReasonerEvaluationExtractor::SATISFIABILITYTIMEEXTRACTOR) { evalValue = doubleSatisfiabilityEvalValue; } CReasonerEvaluationDoubleDataValue* doubleCalculationEvalValue = extractCalculationEvaluationData(document,responseFileString); if (mExtractorType == CReasonerEvaluationExtractor::CALCULATIONTIMEEXTRACTOR) { evalValue = doubleCalculationEvalValue; } CReasonerEvaluationDoubleDataValue* doubleLoadingEvalValue = extractLoadingEvaluationData(document,responseFileString); if (mExtractorType == CReasonerEvaluationExtractor::LOADINGTIMEEXTRACTOR) { evalValue = doubleLoadingEvalValue; } CReasonerEvaluationDoubleDataValue* doubleTotalEvalValue = extractTotalResponseEvaluationData(document,responseFileString); if (mExtractorType == CReasonerEvaluationExtractor::TOTALRESPONSETIMEEXTRACTOR) { evalValue = doubleTotalEvalValue; } CReasonerEvaluationDoubleDataValue* doubleTimeoutErrorEvalValue = extractTimeoutErrorEvaluationData(document,responseFileString); if (mExtractorType == CReasonerEvaluationExtractor::TIMEOUTERROREXTRACTOR) { evalValue = doubleTimeoutErrorEvalValue; } CReasonerEvaluationDoubleDataValue* doubleErrorEvalValue = extractErrorEvaluationData(document,responseFileString); if (mExtractorType == CReasonerEvaluationExtractor::ERROREXTRACTOR) { evalValue = doubleErrorEvalValue; } CReasonerEvaluationDoubleDataValue* doubleTimeoutEvalValue = extractTimeoutEvaluationData(document,responseFileString); if (mExtractorType == CReasonerEvaluationExtractor::TIMEOUTEXTRACTOR) { evalValue = doubleTimeoutEvalValue; } CReasonerEvaluationStringValue* stringResponseFileEvalValue = extractResponseFileEvaluationData(document,responseFileString); if (mExtractorType == CReasonerEvaluationExtractor::RESPONSEFILEEXTRACTOR) { evalValue = stringResponseFileEvalValue; } CReasonerEvaluationStringValue* stringRequestFileEvalValue = extractRequestFileEvaluationData(document,responseFileString); if (mExtractorType == CReasonerEvaluationExtractor::REQUESTFILEEXTRACTOR) { evalValue = stringRequestFileEvalValue; } } } if (evalValue) { evalValue = evalValue->getCopy(); } return evalValue; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationManagerThread.cpp0000644000175000017500000012361712520551332030360 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationManagerThread.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationManagerThread::CReasonerEvaluationManagerThread(CConfiguration *config) : CThread("ReasonerEvaluationManagerThread"), CLogIdentifier("::Konclude::Test::Evaluation::ReasonerEvaluationManagerThread",this) { mConfig = config; mSatisticBasePath = "Evaluation/Infos/Statistics/Requests/"; startThread(); } CReasonerEvaluationManagerThread::~CReasonerEvaluationManagerThread() { } CReasonerEvaluationManager* CReasonerEvaluationManagerThread::realizeEvaluationCommand(CEvaluateTestsuiteCommand* evalTestsuiteComm) { postEvent(new CReasonerEvaluationProgramEvent(evalTestsuiteComm)); return this; } bool CReasonerEvaluationManagerThread::processCustomsEvents(QEvent::Type type, CCustomEvent* event) { if (CThread::processCustomsEvents(type,event)) { return true; } else { if (type == CReasonerEvaluationProgramEvent::EVENTTYPE) { CReasonerEvaluationProgramEvent* repe = (CReasonerEvaluationProgramEvent*)event; CEvaluateTestsuiteCommand* evalTestComm = repe->getEvaluationTestsuiteCommand(); CCommandRecordRouter commandRecordRouter(evalTestComm,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); initEvaluationProgram(evalTestComm); evaluationProgram(evalTestComm); analysingProgram(evalTestComm); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); return true; } } return false; } CReasonerEvaluationManager* CReasonerEvaluationManagerThread::initEvaluationProgram(CEvaluateTestsuiteCommand* evalTestsuiteComm) { CReasonerEvaluationProgram* evalProg = evalTestsuiteComm->getEvaluationTestsuite(); mReasonerNameStringList.clear(); mReasonerOutputDirStringList.clear(); mTestTimeout = 0; mTestCount = 0; mOneReasonerFailed = false; mAllReasonerFailed = true; mFiltering = new CReasonerEvaluationFiltering(mSatisticBasePath); if (!evalProg->getFilterStringList().isEmpty()) { mFitlerStringList = evalProg->getFilterStringList(); mFiltering->loadFiltersFromFile(mFitlerStringList); } else { mFiltering->loadEmptyFilter(); } return this; } bool CReasonerEvaluationManagerThread::evaluationProgram(CEvaluateTestsuiteCommand* evalTestsuiteComm) { CReasonerEvaluationProgram* evalProg = evalTestsuiteComm->getEvaluationTestsuite(); QStringList reasonerConfigList = evalProg->getReasonerStringList(); QString testInputDirectory = evalProg->getInputDirectoryString(); QString testOutputDirectory = evalProg->getOutputDirectoryString(); QString plattform = CConfigDataReader::readConfigString(mConfig,"Konclude.Evaluation.Platform"); QString globalConfig = evalProg->getConfigFileString(); bool evaluationRunned = false; if (plattform != "UNSPECIFIED") { QTime totalTimer; totalTimer.start(); LOG(INFO,getLogDomain(),logTr("Starting evaluation."),this); foreach (QString reasonerConfig, reasonerConfigList) { QTime timer; timer.start(); LOG(INFO,getLogDomain(),logTr("Starting evaluation for reasoner '%1'.").arg(reasonerConfig),this); CReasonerEvaluationTestsuite* reasonerEvalTestsuite = new CReasonerEvaluationTestsuite(); reasonerEvalTestsuite->initEvaluationTestsuite(globalConfig,reasonerConfig,testInputDirectory,testOutputDirectory,plattform,mFiltering); CBlockingCallbackData blockCallData; CReasonerEvaluationExecutorThread* reasonerExecutorThread = new CReasonerEvaluationExecutorThread(mConfig); reasonerExecutorThread->executeEvaluation(reasonerEvalTestsuite,&blockCallData); blockCallData.waitForCallback(); CReasonerEvaluationEvaluatedCallbackContextData* evaluatedCallbackContextData = (CReasonerEvaluationEvaluatedCallbackContextData*)blockCallData.getCallbackDataContext(); if (!evaluatedCallbackContextData->getEvaluationFailed()) { evaluationRunned |= evaluatedCallbackContextData->getEvaluationRunned(); mReasonerNameStringList.append(evaluatedCallbackContextData->getReasonerNameString()); mReasonerOutputDirStringList.append(evaluatedCallbackContextData->getReasonerOutputDirectoryString()); mTestTimeout = evaluatedCallbackContextData->getTestTimeout(); mTestCount = evaluatedCallbackContextData->getTestCount(); mAllReasonerFailed = false; } else { mOneReasonerFailed = true; mFailedReasonerStringList.append(reasonerConfig); } delete reasonerExecutorThread; cint64 elapsedTime = timer.elapsed(); LOG(INFO,getLogDomain(),logTr("Finished evaluation for reasoner '%1' in '%2' seconds.").arg(reasonerConfig).arg(elapsedTime/1000),this); } cint64 totalElapsedTime = totalTimer.elapsed(); LOG(INFO,getLogDomain(),logTr("Finished evaluation in '%1' seconds.").arg(totalElapsedTime/1000),this); } else { LOG(ERROR,getLogDomain(),logTr("Evaluation not possible, platform not specified."),this); } return evaluationRunned; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationManagerThread::getSelectors(const QString& requestDirectory) { CReasonerEvaluationGroupRequestSelector* selectors = nullptr; CReasonerEvaluationExpressivitySelectorFactory expEvalSelFactory("ExpressivenessGrouped","ExpressivenessGrouped/",mSatisticBasePath); selectors = expEvalSelFactory.getSelectors(selectors); CReasonerEvaluationDirectoryStructureSelectorFactory dirEvalSelFactory(requestDirectory,requestDirectory,"DirectoryGrouped","DirectoryGrouped/"); selectors = dirEvalSelFactory.getSelectors(selectors); CReasonerEvaluationProfileSelectorFactory profileEvalSelFactory("ProfileGrouped","ProfileGrouped/",mSatisticBasePath); selectors = profileEvalSelFactory.getSelectors(selectors); return selectors; } QString CReasonerEvaluationManagerThread::getAnalyserOutputDirectory(const QString& baseDirectory, const QString& evaluationProgramName, const QString& platformName, const QString& analyserName) { QString outputDirectory = baseDirectory; if (outputDirectory.contains("$$_ANALYSER_NAME_$$")) { outputDirectory = outputDirectory.replace("$$_ANALYSER_NAME_$$",analyserName); outputDirectory = outputDirectory.replace("$$_EVALUATION_PROGRAM_NAME_$$",evaluationProgramName); outputDirectory = outputDirectory.replace("$$_PLATFORM_$$",platformName); } else { outputDirectory = outputDirectory+evaluationProgramName+"/"+platformName+"/"+analyserName+"/"; } QDir currDir("."); currDir.mkpath(outputDirectory); return outputDirectory; } bool CReasonerEvaluationManagerThread::analyseTimes(const QString& analysingDirectoryString, const QString& evaluationProgramName, const QString& plattform, const QString& analyserOutputDirectoryName, const QString& requestDirectory, cint64 testCountCut, cint64 timeoutCut, cint64 errorPunishmentTime, CReasonerEvaluationDataValueCacher* dataValueCacher, CReasonerEvaluationExtractor::EXTRACTORTYPE extractorType, const QString& extractionName, const QString& contextSpecificationName) { bool analysed = false; QString outputDirectory = getAnalyserOutputDirectory(analysingDirectoryString,evaluationProgramName,plattform,analyserOutputDirectoryName); CReasonerEvaluationAnalyserChecker analysingUpdateChecker; if (analysingUpdateChecker.checkAnalysingUpdateNecessary(mReasonerOutputDirStringList,outputDirectory+"AnalysingUpdateCheckingData.dat",testCountCut)) { LOG(INFO,getLogDomain(),logTr("Analysing %1 times for '%2' into directory '%3'.").arg(extractionName).arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); CReasonerEvaluationSpecifiedTimeExtractor* timeExtractor = new CReasonerEvaluationSpecifiedTimeExtractor(extractorType,timeoutCut,errorPunishmentTime,dataValueCacher); CReasonerEvaluationAvaragerSummarizer* avarageSummarize = new CReasonerEvaluationAvaragerSummarizer(); CReasonerEvaluationAnalyseContext* reasonerEvaluationContext = new CReasonerEvaluationAnalyseContext(mConfig,contextSpecificationName); CReasonerEvaluationCollector* collector = new CReasonerEvaluationCollector(timeExtractor,avarageSummarize,mFiltering); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* reasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(mReasonerNameStringList); for (QStringList::const_iterator it1 = mReasonerNameStringList.constBegin(), it2 = mReasonerOutputDirStringList.constBegin(), it1End = mReasonerNameStringList.constEnd(), it2End = mReasonerOutputDirStringList.constEnd(); it1 != it1End && it2 != it2End; ++it1, ++it2) { QString reasonerName(*it1); QString reasonerPath(*it2); LOG(INFO,getLogDomain(),logTr("Extracting %1 times for reasoner '%2' from responses in directory '%3'.").arg(extractionName).arg(reasonerName).arg(reasonerPath),this); collector->collectReasonerEvaluationDataValues(reasonerComp,reasonerName,reasonerPath); } LOG(INFO,getLogDomain(),logTr("Comparing %1 times for '%2'.").arg(extractionName).arg(mReasonerNameStringList.join(", ")),this); CReasonerEvaluationGroupRequestSelector* selectors = getSelectors(requestDirectory); CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser* analyser1 = new CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser(); analyser1->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser* analyser2 = new CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser(); analyser2->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser* analyser3 = new CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser(); analyser3->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser* analyser4 = new CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser(100.,timeoutCut,qSqrt(10.),timeoutCut); analyser4->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser* analyser5 = new CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser(100.,timeoutCut,10.,timeoutCut); analyser5->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors); LOG(INFO,getLogDomain(),logTr("Compared %1 times for '%2' into directory '%3'.").arg(extractionName).arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); analysingUpdateChecker.saveAnalysingUpdateCheckFile(outputDirectory+"AnalysingUpdateCheckingData.dat"); analysed = true; } else { LOG(WARNING,getLogDomain(),logTr("Compared %1 times for '%2' in directory '%3' are already up to date.").arg(extractionName).arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); } return analysed; } CReasonerEvaluationManager* CReasonerEvaluationManagerThread::analysingProgram(CEvaluateTestsuiteCommand* evalTestsuiteComm) { CReasonerEvaluationProgram* evalProg = evalTestsuiteComm->getEvaluationTestsuite(); bool analysed = false; QString plattform = CConfigDataReader::readConfigString(mConfig,"Konclude.Evaluation.Platform"); QString analysingDirectoryString = CReasonerEvaluationPathConverter::getCorrectedPathString(evalProg->getAnalyserDirectoryString()); if (!analysingDirectoryString.endsWith("/")) { analysingDirectoryString += "/"; } QString requestDirectory = evalProg->getInputDirectoryString(); if (!requestDirectory.endsWith("/")) { requestDirectory += "/"; } QString evaluationProgramName = evalProg->getProgramName(); cint64 testCountCut = mTestCount; cint64 timeoutCut = mTestTimeout; cint64 errorPunishmentTime = 1; CReasonerEvaluationDataValueCacher* dataValueCacher = new CReasonerEvaluationDataValueCacher(); if (!mAllReasonerFailed) { QString dataString = QDateTime::currentDateTime().date().toString(Qt::ISODate); if (plattform != "UNSPECIFIED") { QTime totalTimer; totalTimer.start(); LOG(INFO,getLogDomain(),logTr("Starting analysing."),this); QStringList analysingStringList = evalProg->getAnalyserStringList(); foreach (QString ananysingString, analysingStringList) { QTime timer; timer.start(); LOG(INFO,getLogDomain(),logTr("Starting analysing for '%1'.").arg(ananysingString),this); if (ananysingString == "ReasonerEvaluationClassificationTimesComparer") { analyseTimes(analysingDirectoryString,evaluationProgramName,plattform,"ClassificationTimeComparison",requestDirectory,testCountCut,timeoutCut,errorPunishmentTime,dataValueCacher,CReasonerEvaluationExtractor::CLASSIFICATIONTIMEEXTRACTOR,"classification","Classification "); } if (ananysingString == "ReasonerEvaluationRealizationTimesComparer") { analyseTimes(analysingDirectoryString,evaluationProgramName,plattform,"RealizationTimeComparison",requestDirectory,testCountCut,timeoutCut,errorPunishmentTime,dataValueCacher,CReasonerEvaluationExtractor::REALIZATIONTIMEEXTRACTOR,"realization","Realization "); } if (ananysingString == "ReasonerEvaluationConsistencyTimesComparer") { analyseTimes(analysingDirectoryString,evaluationProgramName,plattform,"ConsistencyTimeComparison",requestDirectory,testCountCut,timeoutCut,errorPunishmentTime,dataValueCacher,CReasonerEvaluationExtractor::CONSISTENCYTIMEEXTRACTOR,"consistency","Consistency "); } if (ananysingString == "ReasonerEvaluationSatisfiabilityTimesComparer") { analyseTimes(analysingDirectoryString,evaluationProgramName,plattform,"SatisfiabilityTimeComparison",requestDirectory,testCountCut,timeoutCut,errorPunishmentTime,dataValueCacher,CReasonerEvaluationExtractor::SATISFIABILITYTIMEEXTRACTOR,"satisfiability","Satisfiability "); } if (ananysingString == "ReasonerEvaluationLoadingTimesComparer") { analyseTimes(analysingDirectoryString,evaluationProgramName,plattform,"LoadingTimeComparison",requestDirectory,testCountCut,timeoutCut,errorPunishmentTime,dataValueCacher,CReasonerEvaluationExtractor::LOADINGTIMEEXTRACTOR,"loading","Loading "); } if (ananysingString == "ReasonerEvaluationResponseTimesComparer") { analyseTimes(analysingDirectoryString,evaluationProgramName,plattform,"ResponseTimeComparison",requestDirectory,testCountCut,timeoutCut,errorPunishmentTime,dataValueCacher,CReasonerEvaluationExtractor::TOTALRESPONSETIMEEXTRACTOR,"response","Response "); } if (ananysingString == "ReasonerEvaluationAccumulatedTimesComparer") { QString outputDirectory = getAnalyserOutputDirectory(analysingDirectoryString,evaluationProgramName,plattform,"AccumulatedTimeComparison"); CReasonerEvaluationAnalyserChecker analysingUpdateChecker; if (analysingUpdateChecker.checkAnalysingUpdateNecessary(mReasonerOutputDirStringList,outputDirectory+"AnalysingUpdateCheckingData.dat",testCountCut)) { LOG(INFO,getLogDomain(),logTr("Analysing accumulated times for '%1' to '%2'.").arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); CReasonerEvaluationSpecifiedTimeExtractor* classTimeExtractor = new CReasonerEvaluationSpecifiedTimeExtractor(CReasonerEvaluationExtractor::CLASSIFICATIONTIMEEXTRACTOR,timeoutCut,errorPunishmentTime,dataValueCacher); CReasonerEvaluationSpecifiedTimeExtractor* consTimeExtractor = new CReasonerEvaluationSpecifiedTimeExtractor(CReasonerEvaluationExtractor::CONSISTENCYTIMEEXTRACTOR,timeoutCut,errorPunishmentTime,dataValueCacher); CReasonerEvaluationSpecifiedTimeExtractor* satTimeExtractor = new CReasonerEvaluationSpecifiedTimeExtractor(CReasonerEvaluationExtractor::SATISFIABILITYTIMEEXTRACTOR,timeoutCut,errorPunishmentTime,dataValueCacher); CReasonerEvaluationSpecifiedTimeExtractor* realTimeExtractor = new CReasonerEvaluationSpecifiedTimeExtractor(CReasonerEvaluationExtractor::REALIZATIONTIMEEXTRACTOR,timeoutCut,errorPunishmentTime,dataValueCacher); CReasonerEvaluationSpecifiedTimeExtractor* loadTimeExtractor = new CReasonerEvaluationSpecifiedTimeExtractor(CReasonerEvaluationExtractor::LOADINGTIMEEXTRACTOR,timeoutCut,errorPunishmentTime,dataValueCacher); CReasonerEvaluationSpecifiedTimeExtractor* reponseTimeExtractor = new CReasonerEvaluationSpecifiedTimeExtractor(CReasonerEvaluationExtractor::TOTALRESPONSETIMEEXTRACTOR,timeoutCut,errorPunishmentTime,dataValueCacher); CReasonerEvaluationSpecifiedTimeExtractor* errorExtractor = new CReasonerEvaluationSpecifiedTimeExtractor(CReasonerEvaluationExtractor::ERROREXTRACTOR,timeoutCut,errorPunishmentTime,dataValueCacher); CReasonerEvaluationSpecifiedTimeExtractor* timeoutExtractor = new CReasonerEvaluationSpecifiedTimeExtractor(CReasonerEvaluationExtractor::TIMEOUTEXTRACTOR,timeoutCut,errorPunishmentTime,dataValueCacher); CReasonerEvaluationAvaragerSummarizer* avarageSummarize = new CReasonerEvaluationAvaragerSummarizer(); CReasonerEvaluationCollector* responseCollector = new CReasonerEvaluationCollector(reponseTimeExtractor,avarageSummarize,mFiltering); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* responceReasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(mReasonerNameStringList); CReasonerEvaluationCollector* loadingCollector = new CReasonerEvaluationCollector(loadTimeExtractor,avarageSummarize,mFiltering); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* loadingReasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(mReasonerNameStringList); CReasonerEvaluationCollector* classificationCollector = new CReasonerEvaluationCollector(classTimeExtractor,avarageSummarize,mFiltering); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* classificationReasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(mReasonerNameStringList); CReasonerEvaluationCollector* realizationCollector = new CReasonerEvaluationCollector(realTimeExtractor,avarageSummarize,mFiltering); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* realizationReasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(mReasonerNameStringList); CReasonerEvaluationCollector* consistencyCollector = new CReasonerEvaluationCollector(consTimeExtractor,avarageSummarize,mFiltering); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* consistencyReasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(mReasonerNameStringList); CReasonerEvaluationCollector* satisfiabilityCollector = new CReasonerEvaluationCollector(satTimeExtractor,avarageSummarize,mFiltering); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* satisfiabilityReasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(mReasonerNameStringList); CReasonerEvaluationCollector* errorCollector = new CReasonerEvaluationCollector(errorExtractor,avarageSummarize,mFiltering); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* errorReasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(mReasonerNameStringList); CReasonerEvaluationCollector* timeoutCollector = new CReasonerEvaluationCollector(timeoutExtractor,avarageSummarize,mFiltering); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* timeoutReasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(mReasonerNameStringList); for (QStringList::const_iterator it1 = mReasonerNameStringList.constBegin(), it2 = mReasonerOutputDirStringList.constBegin(), it1End = mReasonerNameStringList.constEnd(), it2End = mReasonerOutputDirStringList.constEnd(); it1 != it1End && it2 != it2End; ++it1, ++it2) { QString reasonerName(*it1); QString reasonerPath(*it2); LOG(INFO,getLogDomain(),logTr("Extracting accumulated times for '%1' reasoner from responses in directory '%2'.").arg(reasonerName).arg(reasonerPath),this); responseCollector->collectReasonerEvaluationDataValues(responceReasonerComp,reasonerName,reasonerPath); loadingCollector->collectReasonerEvaluationDataValues(loadingReasonerComp,reasonerName,reasonerPath); classificationCollector->collectReasonerEvaluationDataValues(classificationReasonerComp,reasonerName,reasonerPath); realizationCollector->collectReasonerEvaluationDataValues(realizationReasonerComp,reasonerName,reasonerPath); consistencyCollector->collectReasonerEvaluationDataValues(consistencyReasonerComp,reasonerName,reasonerPath); satisfiabilityCollector->collectReasonerEvaluationDataValues(satisfiabilityReasonerComp,reasonerName,reasonerPath); errorCollector->collectReasonerEvaluationDataValues(errorReasonerComp,reasonerName,reasonerPath); timeoutCollector->collectReasonerEvaluationDataValues(timeoutReasonerComp,reasonerName,reasonerPath); } LOG(INFO,getLogDomain(),logTr("Comparing accumulated times for '%1'.").arg(mReasonerNameStringList.join(", ")),this); CReasonerEvaluationGroupRequestSelector* selectors = getSelectors(requestDirectory); CReasonerEvaluationAnalyseContext* responseReasonerEvaluationContext = new CReasonerEvaluationAnalyseContext(mConfig,"Response ","response-"); CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser* responseAnalyser1 = new CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser(); responseAnalyser1->analyseEvaluationData(responceReasonerComp,responseReasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationAnalyseContext* loadingReasonerEvaluationContext = new CReasonerEvaluationAnalyseContext(mConfig,"Loading ","loading-"); CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser* loadingAnalyser1 = new CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser(); loadingAnalyser1->analyseEvaluationData(loadingReasonerComp,loadingReasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationAnalyseContext* classificationReasonerEvaluationContext = new CReasonerEvaluationAnalyseContext(mConfig,"Classification ","classification-"); CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser* classificationAnalyser1 = new CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser(); classificationAnalyser1->analyseEvaluationData(classificationReasonerComp,classificationReasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationAnalyseContext* realizationReasonerEvaluationContext = new CReasonerEvaluationAnalyseContext(mConfig,"Realization ","realization-"); CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser* realizationAnalyser1 = new CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser(); realizationAnalyser1->analyseEvaluationData(realizationReasonerComp,realizationReasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationAnalyseContext* consistencyReasonerEvaluationContext = new CReasonerEvaluationAnalyseContext(mConfig,"Consistency ","consistency-"); CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser* consistencyAnalyser1 = new CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser(); consistencyAnalyser1->analyseEvaluationData(consistencyReasonerComp,consistencyReasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationAnalyseContext* satisfiabilityReasonerEvaluationContext = new CReasonerEvaluationAnalyseContext(mConfig,"Satisfiability ","satisfiability-"); CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser* satisfiabilityAnalyser1 = new CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser(); satisfiabilityAnalyser1->analyseEvaluationData(satisfiabilityReasonerComp,satisfiabilityReasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationAnalyseContext* errorReasonerEvaluationContext = new CReasonerEvaluationAnalyseContext(mConfig,"Error ","error-"); CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser* errorAnalyser1 = new CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser(); errorAnalyser1->analyseEvaluationData(errorReasonerComp,errorReasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationAnalyseContext* timeoutReasonerEvaluationContext = new CReasonerEvaluationAnalyseContext(mConfig,"Timeout ","timeout-"); CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser* timeoutAnalyser1 = new CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser(); timeoutAnalyser1->analyseEvaluationData(timeoutReasonerComp,timeoutReasonerEvaluationContext,outputDirectory,selectors); LOG(INFO,getLogDomain(),logTr("Accumulated times for '%1' compared to '%2'.").arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); analysingUpdateChecker.saveAnalysingUpdateCheckFile(outputDirectory+"AnalysingUpdateCheckingData.dat"); analysed = true; } else { LOG(WARNING,getLogDomain(),logTr("Accumulated times for '%1' in '%2' already up to date.").arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); } } if (ananysingString == "ReasonerEvaluationStatisticValuesComparer") { QString outputDirectory = getAnalyserOutputDirectory(analysingDirectoryString,evaluationProgramName,plattform,"StatisticValuesComparison"); CReasonerEvaluationAnalyserChecker analysingUpdateChecker; if (analysingUpdateChecker.checkAnalysingUpdateNecessary(mReasonerOutputDirStringList,outputDirectory+"AnalysingUpdateCheckingData.dat",testCountCut)) { LOG(INFO,getLogDomain(),logTr("Collecting statistic names for '%1' to '%2'.").arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); QSet staticticNamesSet; CReasonerEvaluationStatisticsNameCollectingExtractor* statNameCollectingExtractor = new CReasonerEvaluationStatisticsNameCollectingExtractor(&staticticNamesSet,dataValueCacher); CReasonerEvaluationAvaragerSummarizer* avarageSummarize = new CReasonerEvaluationAvaragerSummarizer(); CReasonerEvaluationCollector* statNameCollector = new CReasonerEvaluationCollector(statNameCollectingExtractor,avarageSummarize,mFiltering); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* statNameReasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(mReasonerNameStringList); for (QStringList::const_iterator it1 = mReasonerNameStringList.constBegin(), it2 = mReasonerOutputDirStringList.constBegin(), it1End = mReasonerNameStringList.constEnd(), it2End = mReasonerOutputDirStringList.constEnd(); it1 != it1End && it2 != it2End; ++it1, ++it2) { QString reasonerName(*it1); QString reasonerPath(*it2); LOG(INFO,getLogDomain(),logTr("Extracting statistic names for '%1' reasoner from responses in directory '%2'.").arg(reasonerName).arg(reasonerPath),this); statNameCollector->collectReasonerEvaluationDataValues(statNameReasonerComp,reasonerName,reasonerPath); } LOG(INFO,getLogDomain(),logTr("Analysing statistic values for '%1' to '%2'.").arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser* analyser4 = new CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser(); CReasonerEvaluationGroupRequestSelector* selectors = getSelectors(requestDirectory); for (QSet::const_iterator it = staticticNamesSet.constBegin(), itEnd = staticticNamesSet.constEnd(); it != itEnd; ++it) { QString statName(*it); analyser4->addNextStatisticName(statName); CReasonerEvaluationStatisticsValueExtractor* statValueExtractor = new CReasonerEvaluationStatisticsValueExtractor(statName,&staticticNamesSet,timeoutCut,errorPunishmentTime,dataValueCacher); CReasonerEvaluationCollector* statValueCollector = new CReasonerEvaluationCollector(statValueExtractor,avarageSummarize,mFiltering); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* statValueReasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(mReasonerNameStringList); for (QStringList::const_iterator it1 = mReasonerNameStringList.constBegin(), it2 = mReasonerOutputDirStringList.constBegin(), it1End = mReasonerNameStringList.constEnd(), it2End = mReasonerOutputDirStringList.constEnd(); it1 != it1End && it2 != it2End; ++it1, ++it2) { QString reasonerName(*it1); QString reasonerPath(*it2); LOG(INFO,getLogDomain(),logTr("Extracting statistic values for '%1' reasoner from responses in directory '%2'.").arg(reasonerName).arg(reasonerPath),this); statValueCollector->collectReasonerEvaluationDataValues(statValueReasonerComp,reasonerName,reasonerPath); } LOG(INFO,getLogDomain(),logTr("Comparing statistic values for '%1'.").arg(mReasonerNameStringList.join(", ")),this); CReasonerEvaluationAnalyseContext* reasonerEvaluationContext = new CReasonerEvaluationAnalyseContext(mConfig,QString("%1 Statistics").arg(statName.toUpper()),statName+"-"); CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser* analyser1 = new CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser(); analyser1->analyseEvaluationData(statValueReasonerComp,reasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser* analyser2 = new CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser(); analyser2->analyseEvaluationData(statValueReasonerComp,reasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser* analyser3 = new CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser(); analyser3->analyseEvaluationData(statValueReasonerComp,reasonerEvaluationContext,outputDirectory,selectors); analyser4->analyseEvaluationData(statValueReasonerComp,reasonerEvaluationContext,outputDirectory,selectors); LOG(INFO,getLogDomain(),logTr("Statistics values for '%1' compared to '%2'.").arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); analysingUpdateChecker.saveAnalysingUpdateCheckFile(outputDirectory+"AnalysingUpdateCheckingData.dat"); analysed = true; } } else { LOG(WARNING,getLogDomain(),logTr("Statistic values for '%1' in '%2' already up to date.").arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); } } if (ananysingString == "ReasonerEvaluationResultDifferencesComparer") { QString outputDirectory = getAnalyserOutputDirectory(analysingDirectoryString,evaluationProgramName,plattform,"ResultDifferenceComparison"); CReasonerEvaluationAnalyserChecker analysingUpdateChecker; if (analysingUpdateChecker.checkAnalysingUpdateNecessary(mReasonerOutputDirStringList,outputDirectory+"AnalysingUpdateCheckingData.dat",testCountCut)) { LOG(INFO,getLogDomain(),logTr("Analysing result differences for '%1' to '%2'.").arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); CReasonerEvaluationSpecifiedTimeExtractor* respFileExtractor = new CReasonerEvaluationSpecifiedTimeExtractor(CReasonerEvaluationExtractor::RESPONSEFILEEXTRACTOR,timeoutCut,errorPunishmentTime,dataValueCacher); CReasonerEvaluationResponseFileListSummarizer* respFileListSummarizer = new CReasonerEvaluationResponseFileListSummarizer(); CReasonerEvaluationAnalyseContext* reasonerEvaluationContext = new CReasonerEvaluationAnalyseContext(mConfig); CReasonerEvaluationCollector* collector = new CReasonerEvaluationCollector(respFileExtractor,respFileListSummarizer,mFiltering); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* reasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(mReasonerNameStringList); for (QStringList::const_iterator it1 = mReasonerNameStringList.constBegin(), it2 = mReasonerOutputDirStringList.constBegin(), it1End = mReasonerNameStringList.constEnd(), it2End = mReasonerOutputDirStringList.constEnd(); it1 != it1End && it2 != it2End; ++it1, ++it2) { QString reasonerName(*it1); QString reasonerPath(*it2); LOG(INFO,getLogDomain(),logTr("Collecting response files for '%1' reasoner in directory '%2'.").arg(reasonerName).arg(reasonerPath),this); collector->collectReasonerEvaluationDataValues(reasonerComp,reasonerName,reasonerPath); } LOG(INFO,getLogDomain(),logTr("Comparing result differences for '%1'.").arg(mReasonerNameStringList.join(", ")),this); CReasonerEvaluationGroupRequestSelector* selectors = getSelectors(requestDirectory); CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser* analyser1 = new CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser(); analyser1->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors); LOG(INFO,getLogDomain(),logTr("Result differences for '%1' compared to '%2'.").arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); analysingUpdateChecker.saveAnalysingUpdateCheckFile(outputDirectory+"AnalysingUpdateCheckingData.dat"); analysed = true; } else { LOG(WARNING,getLogDomain(),logTr("Result differences for '%1' in '%2' already up to date.").arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); } } if (ananysingString == "ReasonerEvaluationErrorTimeoutComparer") { QString outputDirectory = getAnalyserOutputDirectory(analysingDirectoryString,evaluationProgramName,plattform,"ErrorTimeoutComparison"); CReasonerEvaluationAnalyserChecker analysingUpdateChecker; if (analysingUpdateChecker.checkAnalysingUpdateNecessary(mReasonerOutputDirStringList,outputDirectory+"AnalysingUpdateCheckingData.dat",testCountCut)) { LOG(INFO,getLogDomain(),logTr("Analysing errors and timeouts for '%1' to '%2'.").arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); CReasonerEvaluationSpecifiedTimeExtractor* errorExtractor = new CReasonerEvaluationSpecifiedTimeExtractor(CReasonerEvaluationExtractor::TIMEOUTERROREXTRACTOR,timeoutCut,errorPunishmentTime,dataValueCacher); CReasonerEvaluationAvaragerSummarizer* avarageSummarize = new CReasonerEvaluationAvaragerSummarizer(); CReasonerEvaluationAnalyseContext* reasonerEvaluationContext = new CReasonerEvaluationAnalyseContext(mConfig); CReasonerEvaluationCollector* collector = new CReasonerEvaluationCollector(errorExtractor,avarageSummarize,mFiltering); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* reasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(mReasonerNameStringList); for (QStringList::const_iterator it1 = mReasonerNameStringList.constBegin(), it2 = mReasonerOutputDirStringList.constBegin(), it1End = mReasonerNameStringList.constEnd(), it2End = mReasonerOutputDirStringList.constEnd(); it1 != it1End && it2 != it2End; ++it1, ++it2) { QString reasonerName(*it1); QString reasonerPath(*it2); LOG(INFO,getLogDomain(),logTr("Collecting errors/timeouts for '%1' reasoner in directory '%2'.").arg(reasonerName).arg(reasonerPath),this); collector->collectReasonerEvaluationDataValues(reasonerComp,reasonerName,reasonerPath); } LOG(INFO,getLogDomain(),logTr("Comparing errors/timeouts for '%1'.").arg(mReasonerNameStringList.join(", ")),this); CReasonerEvaluationGroupRequestSelector* selectors = getSelectors(requestDirectory); CReasonerEvaluationGroupRequestReasonerErrorAnalyser* analyser1 = new CReasonerEvaluationGroupRequestReasonerErrorAnalyser(); analyser1->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors); LOG(INFO,getLogDomain(),logTr("Errors/timeouts for '%1' compared to '%2'.").arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); analysingUpdateChecker.saveAnalysingUpdateCheckFile(outputDirectory+"AnalysingUpdateCheckingData.dat"); analysed = true; } else { LOG(WARNING,getLogDomain(),logTr("Errors/timeouts for '%1' in '%2' already up to date.").arg(mReasonerNameStringList.join(", ")).arg(outputDirectory),this); } } if (ananysingString == "RequestStatisticsComparer") { QString outputDirectory = getAnalyserOutputDirectory(analysingDirectoryString,evaluationProgramName,plattform,"RequestStatisticsComparison"); CReasonerEvaluationAnalyserChecker analysingUpdateChecker; if (analysingUpdateChecker.checkAnalysingUpdateNecessary(mReasonerOutputDirStringList,outputDirectory+"AnalysingUpdateCheckingData.dat",testCountCut)) { LOG(INFO,getLogDomain(),logTr("Analysing request files of '%1'.").arg(outputDirectory),this); CReasonerEvaluationSpecifiedTimeExtractor* requestFileExtractor = new CReasonerEvaluationSpecifiedTimeExtractor(CReasonerEvaluationExtractor::REQUESTFILEEXTRACTOR,timeoutCut,errorPunishmentTime,dataValueCacher); CReasonerEvaluationResponseFileListSummarizer* respFileListSummarizer = new CReasonerEvaluationResponseFileListSummarizer(); CReasonerEvaluationAnalyseContext* reasonerEvaluationContext = new CReasonerEvaluationAnalyseContext(mConfig); CReasonerEvaluationCollector* collector = new CReasonerEvaluationCollector(requestFileExtractor,respFileListSummarizer,mFiltering); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* reasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(mReasonerNameStringList); for (QStringList::const_iterator it1 = mReasonerNameStringList.constBegin(), it2 = mReasonerOutputDirStringList.constBegin(), it1End = mReasonerNameStringList.constEnd(), it2End = mReasonerOutputDirStringList.constEnd(); it1 != it1End && it2 != it2End; ++it1, ++it2) { QString reasonerName(*it1); QString reasonerPath(*it2); LOG(INFO,getLogDomain(),logTr("Collecting request files for '%1' reasoner in directory '%2'.").arg(reasonerName).arg(reasonerPath),this); collector->collectReasonerEvaluationDataValues(reasonerComp,reasonerName,reasonerPath); } CReasonerEvaluationGroupRequestSelector* selectors = getSelectors(requestDirectory); CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser* analyser1 = new CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser(mFiltering); analyser1->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors); LOG(INFO,getLogDomain(),logTr("Request statistics evaluated to '%1'.").arg(outputDirectory),this); analysingUpdateChecker.saveAnalysingUpdateCheckFile(outputDirectory+"AnalysingUpdateCheckingData.dat"); analysed = true; } else { LOG(WARNING,getLogDomain(),logTr("Request statistics evaluation of '%1' already up to date.").arg(outputDirectory),this); } } cint64 elapsedTime = timer.elapsed(); LOG(INFO,getLogDomain(),logTr("Finished analysing for '%1' in '%2' seconds.").arg(ananysingString).arg(elapsedTime/1000),this); } cint64 totalElapsedTime = totalTimer.elapsed(); LOG(INFO,getLogDomain(),logTr("Finished analysing in '%1' seconds.").arg(totalElapsedTime/1000),this); } else { LOG(ERROR,getLogDomain(),logTr("Analysing not possible, platform not specified."),this); } if (analysed) { LOG(INFO,getLogDomain(),logTr("Creation HTML navigation overview site."),this); CReasonerEvaluationHTMLNavigationOverviewSummarizer* htmlNavOvSumm = new CReasonerEvaluationHTMLNavigationOverviewSummarizer(); QString outputDirectory = getAnalyserOutputDirectory(analysingDirectoryString,evaluationProgramName,plattform,"."); htmlNavOvSumm->createHTMLNavigationOverview(outputDirectory,evaluationProgramName,mReasonerNameStringList,mFitlerStringList,mTestTimeout,mTestCount); delete htmlNavOvSumm; } } if (!mFailedReasonerStringList.isEmpty()) { LOG(WARNING,getLogDomain(),logTr("Evaluation failed for the following reasoner configuration files:\r\n%1.").arg(mFailedReasonerStringList.join(",\r\n")),this); } return this; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerCSVComp0000644000175000017500000000533212520551330032423 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERCSVCOMPARISONANALYSER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERCSVCOMPARISONANALYSER_H // Libraries includes #include #include #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" #include "CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h" // Other includes #include "Config/CConfiguration.h" #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Utilities; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser : public CReasonerEvaluationGroupRequestReasonerComparisonAnalyser { // public methods public: //! Constructor CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser(); //! Destructor virtual ~CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser(); // protected methods protected: virtual bool analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector); // protected variables protected: QString mOutputFileName; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERCSVCOMPARISONANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CCriticalSystemProcessTester.cpp0000644000175000017500000000320312520551320027575 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCriticalSystemProcessTester.h" namespace Konclude { namespace Test { namespace Evaluation { CCriticalSystemProcessTester::CCriticalSystemProcessTester(CConfiguration *config) { mConfig = config; mTestScriptString = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.CriticalSystemProcessTesterProgram"); } bool CCriticalSystemProcessTester::hasCriticalSystemProcesses() { if (!mTestScriptString.isEmpty()) { QProcess testProcess; testProcess.start(mTestScriptString); if (!testProcess.waitForStarted()) { return false; } if (!testProcess.waitForFinished()) { return false; } if (testProcess.exitCode() != 0) { return true; } } return false; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDataValue.cpp0000644000175000017500000000510412520551320027507 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationDataValue.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationDataValue::CReasonerEvaluationDataValue() : CLinkerBase(this) { mDataFlags = 0; } CReasonerEvaluationDataValue::~CReasonerEvaluationDataValue() { } bool CReasonerEvaluationDataValue::hasDataFlags(cint64 flags, bool testPartial) { if (testPartial) { return (mDataFlags & flags) != 0; } else { return (mDataFlags & flags) == flags; } } CReasonerEvaluationDataValue* CReasonerEvaluationDataValue::setDataFlags(cint64 flags) { mDataFlags |= flags; return this; } CReasonerEvaluationDataValue* CReasonerEvaluationDataValue::clearDataFlags(cint64 flags) { mDataFlags = mDataFlags & ~flags; return this; } CReasonerEvaluationDataValue* CReasonerEvaluationDataValue::setDataFlags(cint64 flags, bool value) { if (value) { return setDataFlags(flags); } else { return clearDataFlags(flags); } } bool CReasonerEvaluationDataValue::hasErrorOccuredFlag() { return hasDataFlags(REDFDATAERROROCCURED,true); } CReasonerEvaluationDataValue* CReasonerEvaluationDataValue::setErrorOccuredFlag(bool value) { return setDataFlags(REDFDATAERROROCCURED,value); } bool CReasonerEvaluationDataValue::hasDataNotAvailableFlag() { return hasDataFlags(REDFDATANOTAVAILABLE,true); } CReasonerEvaluationDataValue* CReasonerEvaluationDataValue::setDataNotAvailableFlag(bool value) { return setDataFlags(REDFDATANOTAVAILABLE,value); } cint64 CReasonerEvaluationDataValue::getDataFlags() { return mDataFlags; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationEvaluatedCallbackContextData.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationEvaluatedCallbackContextDat0000644000175000017500000000510412520551322032407 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationEvaluatedCallbackContextData.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationEvaluatedCallbackContextData::CReasonerEvaluationEvaluatedCallbackContextData(bool failed) { mEvaluationRunned = false; mTestTimeout = 0; mTestCount = 0; mEvaluationFailed = failed; } CReasonerEvaluationEvaluatedCallbackContextData::CReasonerEvaluationEvaluatedCallbackContextData(bool runned, const QString& reasonerNameString, const QString& reasonerOutputDirString, cint64 testTimeout, cint64 testCount) { mEvaluationRunned = runned; mReasonerNameString = reasonerNameString; mReasonerOutputDirectoryString = reasonerOutputDirString; mTestTimeout = testTimeout; mTestCount = testCount; mEvaluationFailed = false; } bool CReasonerEvaluationEvaluatedCallbackContextData::getEvaluationRunned() { return mEvaluationRunned; } bool CReasonerEvaluationEvaluatedCallbackContextData::getEvaluationFailed() { return mEvaluationFailed; } CReasonerEvaluationEvaluatedCallbackContextData* CReasonerEvaluationEvaluatedCallbackContextData::getEvaluationRunned(bool runned) { mEvaluationRunned = runned; return this; } QString CReasonerEvaluationEvaluatedCallbackContextData::getReasonerNameString() { return mReasonerNameString; } QString CReasonerEvaluationEvaluatedCallbackContextData::getReasonerOutputDirectoryString() { return mReasonerOutputDirectoryString; } cint64 CReasonerEvaluationEvaluatedCallbackContextData::getTestTimeout() { return mTestTimeout; } cint64 CReasonerEvaluationEvaluatedCallbackContextData::getTestCount() { return mTestCount; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerErrorAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerErrorAn0000644000175000017500000000625312520551330032524 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERERRORANALYSER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERERRORANALYSER_H // Libraries includes #include #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGNUPlotPlotter.h" #include "CReasonerEvaluationHighchartPlotter.h" #include "CReasonerEvaluationAnalyseContext.h" #include "CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" #include "CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h" #include "CReasonerEvaluationDoubleDataValue.h" #include "CReasonerEvaluationTableMultiFormatOutputWriter.h" #include "CReasonerEvaluationStringListValue.h" // Other includes #include "Config/CConfiguration.h" #include "Parser/COWLlinkQtXMLResultParser.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Parser; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationGroupRequestReasonerErrorAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationGroupRequestReasonerErrorAnalyser : public CReasonerEvaluationGroupRequestReasonerComparisonAnalyser { // public methods public: //! Constructor CReasonerEvaluationGroupRequestReasonerErrorAnalyser(); //! Destructor virtual ~CReasonerEvaluationGroupRequestReasonerErrorAnalyser(); // protected methods protected: virtual bool analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector); QString getPrettyTitleFromOutputFile(const QString& outputFile); // protected variables protected: QString mOutputFileName; COWLlinkQtXMLResultParser mResultParser; QHash,cint64> mCompareDiffCountHash; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTREASONERERRORANALYSER_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerErrorAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerErrorAn0000644000175000017500000001452312520551330032523 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationGroupRequestReasonerErrorAnalyser.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationGroupRequestReasonerErrorAnalyser::CReasonerEvaluationGroupRequestReasonerErrorAnalyser() { } CReasonerEvaluationGroupRequestReasonerErrorAnalyser::~CReasonerEvaluationGroupRequestReasonerErrorAnalyser() { } bool CReasonerEvaluationGroupRequestReasonerErrorAnalyser::analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector) { mOutputFileName = QString("%1").arg(selector->getOutputString()); bool hasSelectedRequestFile = false; QStringList titleList; titleList.append("Requests"); titleList.append(reasonerList); titleList.append("Average"); titleList.append("Min"); titleList.append("Max"); QDir outDir(outputDirectory); outDir.mkpath(mOutputFileName); QString outputFileString(outputDirectory+mOutputFileName+"error"); CReasonerEvaluationTableMultiFormatOutputWriter tableMultiFormatOutputWriter; tableMultiFormatOutputWriter.addColumnTitles(titleList); foreach (QString groupString, groubList) { if (selector->isGroupSelected(groupString)) { QSet* groupRequestList = getGroupRequests(groupString); foreach (QString requestString, *groupRequestList) { if (selector->isRequestSelected(groupString,requestString)) { bool allDataAvailable = true; foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); if (!evalData || evalData->hasDataNotAvailableFlag()) { allDataAvailable = false; } } if (allDataAvailable) { hasSelectedRequestFile = true; double min = DOUBLE_MAX; double max = DOUBLE_MIN; double mean = 0.; cint64 count = 0; tableMultiFormatOutputWriter.addNewTableRow(requestString); foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); CReasonerEvaluationDoubleDataValue* doubleDataValue = dynamic_cast(evalData); if (doubleDataValue) { double errorValue = doubleDataValue->getValue(); tableMultiFormatOutputWriter.addValuesToLastTableRow(QList()<()<isGNUPlottingActivated()) { reasonerCompGNUPlotFileList += tableMultiFormatOutputWriter.writeGNUPlotDataTable(outputFileString); reasonerCompGNUPlotFileList += tableMultiFormatOutputWriter.writeGNUPlotDataTablesSorted(outputFileString); foreach (QString plotFileString, reasonerCompGNUPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".dat"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getGNUPlotPlotter()->createReasonerComparisonPlot(plotFileString,context->getAdditionalTitleString()+title+"[error/timeout]",reasonerList,outputFile); } } } if (context->isHighchartPlottingActivated()) { foreach (QString plotFileString, reasonerCompHighchartPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createReasonerErrorPlot(plotFileString,context->getAdditionalTitleString()+title+"[error/timeout]",reasonerList,outputFile,selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } } } return true; } QString CReasonerEvaluationGroupRequestReasonerErrorAnalyser::getPrettyTitleFromOutputFile(const QString& outputFile) { QString title = outputFile; title.remove("table"); cint64 slashPos = title.lastIndexOf("/"); if (slashPos >= 0) { title = title.mid(slashPos+1); } title.replace("-"," "); title.replace("error","Reaoner Errors and Timeouts, "); title.replace("sorted","Sorted"); if (title.contains(" ascending")) { title.replace(" ascending",""); title.append(" in Ascending Order "); } if (title.contains(" descending")) { title.replace(" descending",""); title.append(" in Descending Order "); } return title; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDataValueGroup.cpp0000644000175000017500000000361512520551322030533 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationDataValueGroup.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationDataValueGroup::CReasonerEvaluationDataValueGroup() { } CReasonerEvaluationDataValueGroup::~CReasonerEvaluationDataValueGroup() { } CReasonerEvaluationDataValueGroup* CReasonerEvaluationDataValueGroup::setGroupName(const QString& string) { mGroupName = string; return this; } CReasonerEvaluationDataValueGroup* CReasonerEvaluationDataValueGroup::addRequestDataValue(const QString& requestString, CReasonerEvaluationDataValue* dataValue) { mRequestDataValueMap.insert(requestString,dataValue); return this; } QMap* CReasonerEvaluationDataValueGroup::getRequestDataValueMap() { return &mRequestDataValueMap; } QString CReasonerEvaluationDataValueGroup::getGroupName() { return mGroupName; } bool CReasonerEvaluationDataValueGroup::isEmpty() { return mRequestDataValueMap.isEmpty(); } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerExecutableEvaluationProvider.cpp0000644000175000017500000001205312520551340031440 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerExecutableEvaluationProvider.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerExecutableEvaluationProvider::CReasonerExecutableEvaluationProvider() { mProcess = nullptr; mKillTimeout = 1000; mReasonerPort = 8080; } CReasonerExecutableEvaluationProvider::~CReasonerExecutableEvaluationProvider() { } bool CReasonerExecutableEvaluationProvider::createReasoner(CConfiguration *config) { mReasonerName = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.Reasoner.Name"); mReasonerBinaryFile = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.Reasoner.Execution.Binary.File"); mReasonerBinaryArguments = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.Reasoner.Execution.Binary.Arguments"); mReasonerPort = CConfigDataReader::readConfigInteger(config,"Konclude.Evaluation.Reasoner.Address.Port"); mKillScriptString = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.TerminateAssistProgram"); QString argString = QString("%1").arg(mReasonerBinaryArguments); QString appString = QString("%1 %2").arg(mReasonerBinaryFile).arg(argString); mProcess = new QProcess(); connect(mProcess,SIGNAL(error(QProcess::ProcessError)),this,SLOT(processError(QProcess::ProcessError)),Qt::DirectConnection); connect(mProcess,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(processFinished(int,QProcess::ExitStatus)),Qt::DirectConnection); mProcessFinished = false; mProcessError = false; mProcess->start(appString); return true; } QString CReasonerExecutableEvaluationProvider::getReasonerAddressString() { return QString("127.0.0.1:%1").arg(mReasonerPort); } CReasonerEvaluationTerminationResult* CReasonerExecutableEvaluationProvider::destroyReasoner() { CReasonerEvaluationTerminationResult* result = new CReasonerEvaluationTerminationResult(); QByteArray standOutput = mProcess->readAllStandardOutput(); QByteArray standError = mProcess->readAllStandardError(); QString stdOutText(standOutput); QString stdErrText(standError); QString errorString = mProcess->errorString(); bool forcedTermination = false; bool finishedInTime = mProcessFinished; disconnect(mProcess,SIGNAL(error(QProcess::ProcessError)),this,SLOT(processError(QProcess::ProcessError))); disconnect(mProcess,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(processFinished(int,QProcess::ExitStatus))); disconnect(mProcess); disconnect(this); if (!mProcessFinished) { assistTermination(mProcess->pid()); mProcessFinished = true; forcedTermination = true; mProcess->terminate(); mProcess->waitForFinished(mKillTimeout); mProcess->kill(); mProcess->waitForFinished(mKillTimeout); mProcess->kill(); mProcess->waitForFinished(mKillTimeout); } mProcess->close(); delete mProcess; mProcess = nullptr; result->initResult(mProcessError,finishedInTime,forcedTermination,errorString,stdOutText,stdErrText); return result; } bool CReasonerExecutableEvaluationProvider::assistTermination(Q_PID processID) { if (!mKillScriptString.isEmpty()) { QProcess killProcess; QStringList argumentList; argumentList += QString::number((cint64)processID); LOG(INFO,"::Konclude::Test::ReasonerEvaluationProvider",logTr("Executing '%1' to assist termination of process with id '%2'.").arg(mKillScriptString).arg((cint64)processID),this); killProcess.start(mKillScriptString,argumentList); if (!killProcess.waitForStarted()) { return false; } if (!killProcess.waitForFinished()) { return false; } if (killProcess.exitCode() != 0) { return true; } } return false; } void CReasonerExecutableEvaluationProvider::processError(QProcess::ProcessError error) { if (!mProcessFinished) { mProcessError = true; } } void CReasonerExecutableEvaluationProvider::processFinished(int exitCode, QProcess::ExitStatus exitStatus) { if (!mProcessFinished) { mProcessFinished = true; if (exitStatus != QProcess::NormalExit) { mProcessError = true; } } } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationClassificationTimeExtractor.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationClassificationTimeExtractor0000644000175000017500000000772212520551320032536 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationClassificationTimeExtractor.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationClassificationTimeExtractor::CReasonerEvaluationClassificationTimeExtractor(double timelimit, double errorPunishmentTime, CReasonerEvaluationDataValueCacher* cacher) { mTimelimit = timelimit; mErrorPunishmentTime = errorPunishmentTime; mCacher = cacher; mExtractorType = CLASSIFICATIONTIMEEXTRACTOR; } CReasonerEvaluationClassificationTimeExtractor::~CReasonerEvaluationClassificationTimeExtractor() { } CReasonerEvaluationDataValue* CReasonerEvaluationClassificationTimeExtractor::extractEvaluationData(const QString& responseFileString) { CReasonerEvaluationDoubleDataValue* doubleEvalValue = nullptr; if (mCacher) { doubleEvalValue = dynamic_cast(mCacher->getCachedDataValue(responseFileString,(cint64)mExtractorType)); } if (!doubleEvalValue) { double doubleValue = 0; bool errorOccured = false; bool timeoutOccured = false; bool allRespTimeValid = true; QFile responseFile(responseFileString); if (responseFile.open(QIODevice::ReadOnly)) { QDomDocument document; document.setContent(&responseFile,false); QDomElement rootEl = document.documentElement(); responseFile.close(); QString timeoutString = rootEl.attribute("timeout"); if (timeoutString == "1") { timeoutOccured = true; } QDomElement childEl = rootEl.firstChildElement(); while (!childEl.isNull()) { timeoutString = rootEl.attribute("timeout"); if (timeoutString == "1") { timeoutOccured = true; } QString requestCommandString = childEl.attribute("request-command"); if (requestCommandString == "GetSubClassHierarchy" || requestCommandString == "Classify" || requestCommandString == "GetSubClasses" || requestCommandString == "GetSuperClasses" || requestCommandString == "GetEquivalentClasses") { bool validResponseTime = false; if (childEl.tagName() != "Error") { QString respTimeString = childEl.attribute("response-time","timeout"); double respTime = respTimeString.toDouble(&validResponseTime); if (validResponseTime) { doubleValue += respTime; } } else { validResponseTime = false; } allRespTimeValid &= validResponseTime; } childEl = childEl.nextSiblingElement(); } if (timeoutOccured) { doubleValue = mTimelimit; } if (mTimelimit >= 0) { doubleValue = qMin(mTimelimit,doubleValue); } if (errorOccured || !allRespTimeValid) { if (mTimelimit >= 0) { doubleValue = mTimelimit+mErrorPunishmentTime; } else { doubleValue = mErrorPunishmentTime; } } doubleEvalValue = new CReasonerEvaluationDoubleDataValue(doubleValue); if (mCacher) { mCacher->addDataValueToCache(responseFileString,(cint64)mExtractorType,doubleEvalValue); } } } return doubleEvalValue; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationStringValue.h0000644000175000017500000000425012520551340027554 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSTRINGVALUE_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSTRINGVALUE_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationDataValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationStringValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationStringValue : public CReasonerEvaluationDataValue { // public methods public: //! Constructor CReasonerEvaluationStringValue(const QString& value); //! Destructor virtual ~CReasonerEvaluationStringValue(); virtual CReasonerEvaluationDataValue* getCopy(); virtual QString generateString(); const QString& getValue(); CReasonerEvaluationStringValue* setValue(const QString& string); // protected methods protected: // protected variables protected: QString mValue; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONSTRINGVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationUpdater.cpp0000644000175000017500000000217312520551340027252 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationUpdater.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationUpdater::CReasonerEvaluationUpdater() { } CReasonerEvaluationUpdater::~CReasonerEvaluationUpdater() { } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDirectoryStructureSelectorFactory.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDirectoryStructureSelectorF0000644000175000017500000000506412520551322032563 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDIRECTORYSTRUCTURESELECTORFACTORY_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDIRECTORYSTRUCTURESELECTORFACTORY_H // Libraries includes #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGroupRequestSelector.h" #include "CReasonerEvaluationStringMatchGroupSelector.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationDirectoryStructureSelectorFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationDirectoryStructureSelectorFactory { // public methods public: //! Constructor CReasonerEvaluationDirectoryStructureSelectorFactory(const QString& groupDirString, const QString& dirString, const QString& baseEvalName, const QString& baseOutputDir); CReasonerEvaluationGroupRequestSelector* getSelectors(CReasonerEvaluationGroupRequestSelector* prevSelector); // protected methods protected: CReasonerEvaluationGroupRequestSelector* getSelectors(CReasonerEvaluationGroupRequestSelector* prevSelector, const QString& dirString, const QList& subDirAddList); // protected variables protected: QString mGroupDirString; QString mDirectoryString; QString mBaseEvalName; QString mBaseOutputDir; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONDIRECTORYSTRUCTURESELECTORFACTORY_H ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDataValueGroupCollectionReasonerComparison.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDataValueGroupCollectionRea0000644000175000017500000000374512520551322032422 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationDataValueGroupCollectionReasonerComparison::CReasonerEvaluationDataValueGroupCollectionReasonerComparison(QStringList reasonerList) { mReasonerList = reasonerList; } CReasonerEvaluationDataValueGroupCollectionReasonerComparison::~CReasonerEvaluationDataValueGroupCollectionReasonerComparison() { } CReasonerEvaluationDataValueGroupCollectionReasonerComparison* CReasonerEvaluationDataValueGroupCollectionReasonerComparison::addReasonerCollection(const QString& reasoner, CReasonerEvaluationDataValueGroupCollection* collection) { mReasonerCollectionMap.insert(reasoner,collection); return this; } QMap* CReasonerEvaluationDataValueGroupCollectionReasonerComparison::getReasonerCollectionMap() { return &mReasonerCollectionMap; } QStringList CReasonerEvaluationDataValueGroupCollectionReasonerComparison::getReasonerList() { return mReasonerList; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationConfigurationLoader.h0000644000175000017500000000527112520551320031251 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONCONFIGURATIONLOADER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONCONFIGURATIONLOADER_H // Libraries includes #include #include #include //#include // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Control/Interface/OWLlink/COWLlinkProcessor.h" #include "Control/Command/CConfigManagerReader.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; using namespace Control::Interface::OWLlink; using namespace Control::Command; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationConfigurationLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationConfigurationLoader : public COWLlinkProcessor { // public methods public: //! Constructor CReasonerEvaluationConfigurationLoader(); //! Destructor virtual ~CReasonerEvaluationConfigurationLoader(); virtual bool loadConfiguration(const QString& owllinkConfigFile, CConfiguration *config = 0); // protected methods protected: virtual COWLlinkProcessor* initializeOWLlinkContent(); virtual COWLlinkProcessor* concludeOWLlinkContent(); virtual CConfiguration* getConfiguration(); // protected variables protected: QString mReqFileString; bool mBlockUntilProcessed; QTime mResponseTime; QSemaphore mBlockingSem; CConfiguration* mLoaderConfig; bool mConfigSucessfullyLoaded; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONCONFIGURATIONLOADER_H ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestStatisticsCSVCo0000644000175000017500000001223212520551332032441 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTSTATISTICSCSVCOMPARISONANALYSER_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTSTATISTICSCSVCOMPARISONANALYSER_H // Libraries includes #include #include #include #include #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGNUPlotPlotter.h" #include "CReasonerEvaluationHighchartPlotter.h" #include "CReasonerEvaluationAnalyseContext.h" #include "CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" #include "CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h" #include "CReasonerEvaluationDoubleDataValue.h" #include "CReasonerEvaluationTableMultiFormatOutputWriter.h" #include "CReasonerEvaluationFiltering.h" #include "CReasonerEvaluationStringListValue.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { class CRequestStatisticsData { public: CRequestStatisticsData() { mInitialized = false; mCalculated = false; mMinValue = DOUBLE_MAX; mMaxValue = DOUBLE_MIN; mSumValue = 0.; mMeanValue = 0.; mValueCount = 0.; mStandardDerivationValue = 0.; mMedianValue = 0.; } CRequestStatisticsData* setDataName(const QString& dataName) { mDataName = dataName; return this; } CRequestStatisticsData* addData(double value, const QString& requestString) { mDataRequestStringMap.insertMulti(value,requestString); return this; } bool calculateStatistics() { if (!mCalculated) { mCalculated = true; for (QMap::const_iterator it = mDataRequestStringMap.constBegin(), itEnd = mDataRequestStringMap.constEnd(); it != itEnd; ++it) { double value(it.key()); mMinValue = qMin(mMinValue,value); mMaxValue = qMax(mMaxValue,value); mSumValue += value; mValueCount += 1; } if (mValueCount > 0) { mMeanValue = mSumValue/mValueCount; cint64 medianCounter = mValueCount/2.; for (QMap::const_iterator it = mDataRequestStringMap.constBegin(), itEnd = mDataRequestStringMap.constEnd(); it != itEnd; ++it) { double value(it.key()); mStandardDerivationValue += (value-mMeanValue)*(value-mMeanValue); if (medianCounter >= 0) { mMedianValue = value; medianCounter = medianCounter-1.; } } mStandardDerivationValue = qSqrt(mStandardDerivationValue/(mValueCount+1.0)); } } return mCalculated; } public: QMap mDataRequestStringMap; QString mDataName; bool mInitialized; bool mCalculated; double mMinValue; double mMaxValue; double mMeanValue; double mStandardDerivationValue; double mSumValue; double mMedianValue; double mValueCount; }; /*! * * \class CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser : public CReasonerEvaluationGroupRequestReasonerComparisonAnalyser { // public methods public: //! Constructor CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser(CReasonerEvaluationFiltering* filtering); //! Destructor virtual ~CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser(); QString getPrettyTitleFromOutputFile(const QString& outputFile); // protected methods protected: virtual bool analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector); // protected variables protected: CReasonerEvaluationFiltering* mFiltering; QString mOutputFileName; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONGROUPREQUESTSTATISTICSCSVCOMPARISONANALYSER_H ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerAccumul0000644000175000017500000001401412520551326032544 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser::CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser() { } CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser::~CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser() { } bool CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser::analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector) { mOutputFileName = QString("%1").arg(selector->getOutputString()); bool hasSelectedRequestFile = false; QDir outDir(outputDirectory); outDir.mkpath(mOutputFileName); QString outputFileString(outputDirectory+mOutputFileName+context->getAdditionalFileString()+"accumulated-time"); QVector accumTimeVec; foreach (QString reasonerString, reasonerList) { accumTimeVec.append(0.); } foreach (QString groupString, groubList) { if (selector->isGroupSelected(groupString)) { QSet* groupRequestList = getGroupRequests(groupString); foreach (QString requestString, *groupRequestList) { if (selector->isRequestSelected(groupString,requestString)) { bool allDataAvailable = true; foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); if (!evalData || evalData->hasDataNotAvailableFlag()) { allDataAvailable = false; } } if (allDataAvailable) { hasSelectedRequestFile = true; cint64 reasonerNumber = 0; foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); CReasonerEvaluationDoubleDataValue* doubleDataValue = dynamic_cast(evalData); if (doubleDataValue) { double tmpValue = doubleDataValue->getValue(); accumTimeVec[reasonerNumber] += tmpValue; reasonerNumber++; } } } } } } } if (hasSelectedRequestFile) { QStringList titleList; titleList.append("Reasoner"); titleList.append("Accumulated Time"); CReasonerEvaluationTableMultiFormatOutputWriter tableMultiFormatOutputWriter; tableMultiFormatOutputWriter.addColumnTitles(titleList); cint64 reasonerNumber = 0; foreach (QString reasonerString, reasonerList) { tableMultiFormatOutputWriter.addNewTableRow(reasonerString); double reasonerAccTime = accumTimeVec[reasonerNumber++]; tableMultiFormatOutputWriter.addValuesToLastTableRow(QList()<isGNUPlottingActivated()) { reasonerCompGNUPlotFileList += tableMultiFormatOutputWriter.writeGNUPlotDataTable(outputFileString); foreach (QString plotFileString, reasonerCompGNUPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".dat"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getGNUPlotPlotter()->createReasonerComparisonPlot(plotFileString,title+"[milliseconds]",QStringList()<<"Accumulated Time",outputFile); } } } if (context->isHighchartPlottingActivated()) { foreach (QString plotFileString, reasonerCompHighchartPlotFileList) { if (true /*plotFileString.contains("-by-Average-")*/) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createReasonerAccumulatedPlot(plotFileString,title+"[milliseconds]",QStringList()<<"Accumulated Time",outputFile,selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } } } return true; } QString CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser::getPrettyTitleFromOutputFile(const QString& outputFile) { QString title = outputFile; title.remove("table"); cint64 slashPos = title.lastIndexOf("/"); if (slashPos >= 0) { title = title.mid(slashPos+1); } title.replace("-"," "); title.replace("classification","Classification"); title.replace("loading","Loading"); title.replace("response","Response"); title.replace("accumulated ",""); title.insert(0,"Accumulated "); title.replace("time","Time"); return title; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExecutorThread.cpp0000644000175000017500000004122712520551324030601 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationExecutorThread.h" #include "CReasonerEvaluationConfigurationLoader.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationExecutorThread::CReasonerEvaluationExecutorThread(CConfiguration *config, CWatchDog *watchDog) : CThread("Reasoner-Evaluation-Executor-Thread",watchDog), CLogIdentifier("::Konclude::Test::ReasonerEvaluationExecutor",this) { mLoaderConfig = config; mCommanderManager = CConfigManagerReader::readCommanderManagerConfig(mLoaderConfig); mReasonerEvalFactory = new CConfigDependendReasonerEvaluationFactory(); mReasonerEvaluator = new CReasonerEvaluationEvaluator(); mReasonerClient = new CReasonerEvaluationRequestClientThread(); mReasonerProvider = nullptr; mNumberStringSize = 4; mNextTestRemainingExecutionCount = 0; mNextTestExecutionNumber = 0; mTestCount = 0; mErrorCommBreakCount = 2; mFirstTest = true; mCriticalProcessesTester = nullptr; startThread(); } CReasonerEvaluationExecutorThread::~CReasonerEvaluationExecutorThread() { delete mReasonerEvalFactory; delete mReasonerEvaluator; delete mReasonerProvider; delete mReasonerClient; delete mCriticalProcessesTester; } bool CReasonerEvaluationExecutorThread::executeEvaluation(CReasonerEvaluationTestsuite* evaluationTestsuite, CCallbackData* callbackData) { QCoreApplication::postEvent(this,new CReasonerEvaluationTestsuiteEvent(evaluationTestsuite,callbackData)); return true; } bool CReasonerEvaluationExecutorThread::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CThread::processCustomsEvents(type,event)) { return true; } else if (type == CReasonerEvaluationTestsuiteEvent::EVENTTYPE) { CReasonerEvaluationTestsuiteEvent* rete = (CReasonerEvaluationTestsuiteEvent*)event; mEvalTestsuite = rete->getEvaluationTestsuite(); mExecutedCallback = rete->getCallbackData(); mPlatformName = mEvalTestsuite->getPlatformString(); mExecutedTest = false; mFiltering = mEvalTestsuite->getEvaluationFiltering(); bool configsSuccessfullyLoaded = loadConfigurations(); if (!configsSuccessfullyLoaded) { failedEvaluationTests(); } else { if (mCommanderManager) { CGetSettingsCommand* getConfigCommand = new CGetSettingsCommand(); getConfigCommand->addProcessedCallback(new CCommandProcessedCallbackEvent(this,getConfigCommand)); mCommanderManager->realizeCommand(getConfigCommand); } } return true; } else if (type == CCommandProcessedCallbackEvent::EVENTTYPE) { CCommandProcessedCallbackEvent *commProCallbackEvent = (CCommandProcessedCallbackEvent*)event; CGetSettingsCommand* getConfigCommand = (CGetSettingsCommand*)commProCallbackEvent->getCommand(); CConfigurationBase* configurationBase = getConfigCommand->getConfiguration(); mConfiguration = configurationBase; if (!mConfiguration) { mConfiguration = mLoaderConfig; } initEvaluationTests(); if (prepareNextEvaluationTest()) { executeNextEvaluationTest(mReasonerInitFileString,mNextTestInputFile); } else { finishEvaluationTests(); } } else if (type == CReasonerEvaluationNextEvent::EVENTTYPE) { CReasonerEvaluationNextEvent* nextEvalEvent = (CReasonerEvaluationNextEvent*)event; CReasonerEvaluationRequestResult* requestResults = mReasonerClient->getReasonerEvaluationResult(); CReasonerEvaluationTerminationResult* terminationResults = mReasonerProvider->destroyReasoner(); QString outputFileString = getNextOutputFileString(); if (mFirstTest) { mFirstTest = false; executeNextEvaluationTest(mReasonerInitFileString,mNextTestInputFile); if (mWaitingTimeBetweenTests > 0) { LOG(INFO,getLogDomain(),logTr("Waiting %1 ms before continuation.").arg(mWaitingTimeBetweenTests),this); QThread::msleep(mWaitingTimeBetweenTests); } } else { bool succ = evaluateExecutedTest(terminationResults,requestResults,outputFileString); if (mWaitingTimeBetweenTests > 0) { LOG(INFO,getLogDomain(),logTr("Waiting %1 ms before continuation.").arg(mWaitingTimeBetweenTests),this); QThread::msleep(mWaitingTimeBetweenTests); } delete terminationResults; delete requestResults; if (succ) { if (--mNextTestRemainingExecutionCount > 0) { ++mNextTestExecutionNumber; executeNextEvaluationTest(mReasonerInitFileString,mNextTestInputFile); } else { if (prepareNextEvaluationTest()) { executeNextEvaluationTest(mReasonerInitFileString,mNextTestInputFile); } else { finishEvaluationTests(); } } } else { if (--mErrorCommBreakCount > 0) { executeNextEvaluationTest(mReasonerInitFileString,mNextTestInputFile); } else { failedEvaluationTests(); } } } } return false; } bool CReasonerEvaluationExecutorThread::loadConfigurations() { bool configsSuccessfullyLoaded = true; QString globalConfString = getCorrectedPathString(mEvalTestsuite->getGlobalConfigString()); if (!globalConfString.isEmpty()) { CReasonerEvaluationConfigurationLoader* globalConfLoader = new CReasonerEvaluationConfigurationLoader(); LOG(INFO,getLogDomain(),logTr("Loading global configuration '%1'.").arg(globalConfString),this); configsSuccessfullyLoaded &= globalConfLoader->loadConfiguration(globalConfString,mLoaderConfig); delete globalConfLoader; } else { configsSuccessfullyLoaded = false; } QString reasonerConfString = getCorrectedPathString(mEvalTestsuite->getReasonerConfigString()); if (!reasonerConfString.isEmpty()) { CReasonerEvaluationConfigurationLoader* reasonerConfLoader = new CReasonerEvaluationConfigurationLoader(); LOG(INFO,getLogDomain(),logTr("Loading reasoner configuration '%1'.").arg(reasonerConfString),this); configsSuccessfullyLoaded &= reasonerConfLoader->loadConfiguration(reasonerConfString,mLoaderConfig); delete reasonerConfLoader; } else { configsSuccessfullyLoaded = false; } return configsSuccessfullyLoaded; } bool CReasonerEvaluationExecutorThread::initEvaluationTests() { mInputDir = mEvalTestsuite->getTestsDirectoryString(); mOutputDir = mEvalTestsuite->getEvaluationDirectoryString(); if (!mInputDir.endsWith("/")) { mInputDir += "/"; } if (!mOutputDir.endsWith("/")) { mOutputDir += "/"; } mRemainingSubDirs.append("."); mReasonerInitFileString = getCorrectedPathString(CConfigDataReader::readConfigString(mConfiguration,"Konclude.Evaluation.Reasoner.InitializationFile")); mConfigName = CConfigDataReader::readConfigString(mConfiguration,"Konclude.Evaluation.Config.Name"); mReasonerName = CConfigDataReader::readConfigString(mConfiguration,"Konclude.Evaluation.Reasoner.Name"); mReasonerOutputDirectory = getCorrectedPathString(CConfigDataReader::readConfigString(mConfiguration,"Konclude.Evaluation.Reasoner.OutputDirectory")); mTestCount = CConfigDataReader::readConfigInteger(mConfiguration,"Konclude.Evaluation.TestingCount"); mErrorCommBreakCount = CConfigDataReader::readConfigInteger(mConfiguration,"Konclude.Evaluation.CancelReasonerErrorCount"); mTestTimeout = CConfigDataReader::readConfigInteger(mConfiguration,"Konclude.Evaluation.RequestTimeout"); mWaitingTimeBetweenTests = CConfigDataReader::readConfigInteger(mConfiguration,"Konclude.Evaluation.WaitingTimeBetweenTests"); mWaitingTimeAfterReasonerCreation = CConfigDataReader::readConfigInteger(mConfiguration,"Konclude.Evaluation.WaitingTimeAfterReasonerCreation"); mSystemReadyRetestTimeForTests = CConfigDataReader::readConfigInteger(mConfiguration,"Konclude.Evaluation.SystemReadyRetestTimeForTests"); mFirstTestWarmUp = CConfigDataReader::readConfigBoolean(mConfiguration,"Konclude.Evaluation.FirstTestsWarmingUp"); mAllTestsWarmUp = CConfigDataReader::readConfigBoolean(mConfiguration,"Konclude.Evaluation.AllTestsWarmingUp"); mCriticalProcessesTester = new CCriticalSystemProcessTester(mConfiguration); if (mFirstTestWarmUp) { mFirstTest = true; } LOG(INFO,getLogDomain(),logTr("Preparing reasoner '%1' evaluation with config file '%2' and test suite '%3'.").arg(mReasonerName).arg(mConfigName).arg(mInputDir),this); LOG(INFO,getLogDomain(),logTr("Using init file '%1' and output directory '%2'.").arg(mReasonerInitFileString).arg(mReasonerOutputDirectory),this); return true; } bool CReasonerEvaluationExecutorThread::finishEvaluationTests() { LOG(INFO,getLogDomain(),logTr("Finished reasoner '%1' evaluation with config file '%2' and test suite '%3'.").arg(mReasonerName).arg(mConfigName).arg(mInputDir),this); if (mExecutedCallback) { mExecutedCallback->setCallbackDataContext(new CReasonerEvaluationEvaluatedCallbackContextData(mExecutedTest,mReasonerName,mOutputDir+mConfigName+"/"+mReasonerOutputDirectory,mTestTimeout,mTestCount)); mExecutedCallback->doCallback(); } delete mEvalTestsuite; return true; } bool CReasonerEvaluationExecutorThread::failedEvaluationTests() { LOG(INFO,getLogDomain(),logTr("Failed evaluation for reasoner with config file '%2' and test suite '%3'.").arg(mEvalTestsuite->getReasonerConfigString()).arg(mEvalTestsuite->getTestsDirectoryString()),this); if (mExecutedCallback) { mExecutedCallback->setCallbackDataContext(new CReasonerEvaluationEvaluatedCallbackContextData(true)); mExecutedCallback->doCallback(); } delete mEvalTestsuite; return true; } bool CReasonerEvaluationExecutorThread::prepareNextEvaluationTest() { while (mNextTestRemainingExecutionCount <= 0) { QString testFile = nextEvaluationTestfile(); if (testFile.isEmpty()) { return false; } else { if (mAllTestsWarmUp) { mFirstTest = true; } QString reasonerString = mReasonerOutputDirectory; QString configString = mConfigName; QDir genPath(mOutputDir); if (genPath.mkpath(configString+"/"+reasonerString+testFile)) { QDir outputDir(mOutputDir+configString+"/"+reasonerString+testFile); QStringList responseList = outputDir.entryList(QDir::Files); mNextTestExecutionNumber = responseList.count(); mNextTestRemainingExecutionCount = mTestCount - mNextTestExecutionNumber; if (mNextTestRemainingExecutionCount > 0) { mNextTestInputFile = mInputDir+testFile; mNextTestOutputDir = mOutputDir+configString+"/"+reasonerString+testFile+"/"; return true; } } } } return false; } QString CReasonerEvaluationExecutorThread::getCorrectedPathString(const QString& string) { QString corrString = string; corrString = corrString.replace("$$_PLATFORM_$$",mPlatformName); corrString = CReasonerEvaluationPathConverter::getCorrectedPathString(corrString); return corrString; } bool CReasonerEvaluationExecutorThread::testExistFile(const QString& fileString) { QFile file(fileString); if (file.exists()) { return true; } return false; } QString CReasonerEvaluationExecutorThread::getNextOutputFileString() { QString outputFileString = QString("%2%1-response.xml").arg(getNumberString(mNextTestExecutionNumber)).arg(mNextTestOutputDir); while (testExistFile(outputFileString)) { ++mNextTestExecutionNumber; outputFileString = QString("%2%1-response.xml").arg(getNumberString(mNextTestExecutionNumber)).arg(mNextTestOutputDir); } return outputFileString; } QString CReasonerEvaluationExecutorThread::getNumberString(cint64 number) { QString numberString = QString::number(number); while (numberString.size() < mNumberStringSize) { numberString = QString("0%1").arg(numberString); } return numberString; } bool CReasonerEvaluationExecutorThread::evaluateExecutedTest(CReasonerEvaluationTerminationResult* terminationResults, CReasonerEvaluationRequestResult* requestResults, const QString& testcaseOutput) { if (requestResults->hasSucessfullReasonerCommunication()) { LOG(INFO,getLogDomain(),logTr("Evaluate executed test case to '%1'.").arg(testcaseOutput),this); mReasonerEvaluator->evaluateResults(requestResults,terminationResults,mNextTestInputFile,testcaseOutput,mConfiguration); mExecutedTest = true; return true; } else { LOG(ERROR,getLogDomain(),logTr("Communication with reasoner failed for test case '%1'.").arg(testcaseOutput),this); } return false; } bool CReasonerEvaluationExecutorThread::testSystemReadyForNextEvaluationTest() { if (mCriticalProcessesTester->hasCriticalSystemProcesses()) { LOG(WARNING,getLogDomain(),logTr("Critical processes are running on the test system."),this); return false; } return true; } void CReasonerEvaluationExecutorThread::delayNextEvaluationTestUntilSystemReady() { while (!testSystemReadyForNextEvaluationTest()) { LOG(WARNING,getLogDomain(),logTr("Test system not ready, retest after %1 ms.").arg(mSystemReadyRetestTimeForTests),this); QThread::msleep(mSystemReadyRetestTimeForTests); } } bool CReasonerEvaluationExecutorThread::executeNextEvaluationTest(const QString& testcaseInit, const QString& testcaseInput) { delayNextEvaluationTestUntilSystemReady(); if (!mReasonerProvider) { mReasonerProvider = mReasonerEvalFactory->createReasonerProvider(mConfiguration); } mReasonerProvider->createReasoner(mConfiguration); QString addressString = mReasonerProvider->getReasonerAddressString(); if (mFirstTest) { LOG(INFO,getLogDomain(),logTr("Warming up for reasoner '%1' with test case '%2'.").arg(mReasonerName).arg(testcaseInput),this); } else { LOG(INFO,getLogDomain(),logTr("Testing reasoner '%1' with test case '%2'.").arg(mReasonerName).arg(testcaseInput),this); } if (mWaitingTimeAfterReasonerCreation > 0) { LOG(INFO,getLogDomain(),logTr("Waiting %1 ms after created reasoner.").arg(mWaitingTimeAfterReasonerCreation),this); QThread::msleep(mWaitingTimeAfterReasonerCreation); } mReasonerClient->evaluateReasoner(testcaseInit,testcaseInput,addressString,mConfiguration,new CReasonerEvaluationNextEvent(this,0)); return true; } bool CReasonerEvaluationExecutorThread::testFileFiltered(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString) { if (!mFiltering) { return true; } else { QStringList statisticList = mFiltering->loadStatistics(testFileNameString,subDirPathString); return mFiltering->testSatisfiesFilter(testFileNameString,testFilePathString,subDirPathString,statisticList); } } QString CReasonerEvaluationExecutorThread::nextEvaluationTestfile() { if (mRemainingFiles.isEmpty()) { while (mRemainingFiles.isEmpty() && !mRemainingSubDirs.isEmpty()) { QString nextDir = mRemainingSubDirs.takeFirst(); QDir dir(mInputDir+nextDir); QStringList subDirList = dir.entryList(QDir::Dirs,QDir::Name|QDir::IgnoreCase); foreach (QString subDir, subDirList) { if (!subDir.startsWith("-") && subDir != "." && subDir != "..") { mRemainingSubDirs.prepend(QString("%1").arg(nextDir+"/"+subDir)); } } QStringList fileList = dir.entryList(QDir::Files,QDir::Name|QDir::IgnoreCase); foreach (QString fileString, fileList) { if (!fileString.startsWith("-")) { if (testFileFiltered(fileString,mInputDir,nextDir+"/")) { mRemainingFiles.append(nextDir+"/"+fileString); } else { LOG(INFO,getLogDomain(),logTr("File '%1' in directory '%2' filtered out.").arg(fileString).arg(nextDir),this); } } } } } QString nextTestfile; if (!mRemainingFiles.isEmpty()) { nextTestfile = mRemainingFiles.takeFirst(); } return nextTestfile; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationFilter.cpp0000644000175000017500000001010212520551324027064 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationFilter.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationFilter::CReasonerEvaluationFilter() { } bool CReasonerEvaluationFilter::loadFilterConditionFile(const QString& filterNameString) { QFile filterFile(filterNameString); if (filterFile.open(QIODevice::ReadOnly)) { while (!filterFile.atEnd()) { QByteArray filterLine(filterFile.readLine()); QStringList filterDataList = QString(filterLine).trimmed().split("\t"); if (filterDataList.count() >= 4) { CReasonerEvaluationFilterCondition* statExtCon = nullptr; QString filterTypeString = filterDataList.takeFirst().toUpper(); QString filterNameString = filterDataList.takeFirst(); QString filterComperatorString = filterDataList.takeFirst(); QString filterCompareValueString = filterDataList.takeFirst(); if (filterTypeString == "INTEGER") { statExtCon = new CReasonerEvaluationFilterIntegerCondition(filterNameString,filterComperatorString,filterCompareValueString); } else if (filterTypeString == "STRING") { statExtCon = new CReasonerEvaluationFilterStringCondition(filterNameString,filterComperatorString,filterCompareValueString); } if (statExtCon) { mCondList.append(statExtCon); } } } filterFile.close(); return true; } return false; } bool CReasonerEvaluationFilter::testSatisfiesFilterConditions(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString, const QStringList& statisticList) { QStringList extStatisticList; extStatisticList.append(QString("Path:\t")+testFilePathString+subDirPathString); extStatisticList.append(QString("RelativeTestPath:\t")+subDirPathString); extStatisticList.append(QString("BaseTestPath:\t")+testFilePathString); extStatisticList.append(QString("FileName:\t")+testFileNameString); extStatisticList.append(QString("PathFileName:\t")+testFilePathString+subDirPathString+testFileNameString); extStatisticList.append(statisticList); return testSatisfiesFilterConditions(extStatisticList); } bool CReasonerEvaluationFilter::testSatisfiesFilterConditions(const QString& testFileNameString, const QStringList& statisticList) { QStringList extStatisticList; QString fileNameString = testFileNameString; QString pathString; cint64 lastSlash = testFileNameString.lastIndexOf("/"); if (!lastSlash) { pathString = testFileNameString.mid(0,lastSlash); fileNameString = testFileNameString.mid(lastSlash+1); } extStatisticList.append(QString("Path:\t")+pathString); extStatisticList.append(QString("FileName:\t")+fileNameString); extStatisticList.append(QString("PathFileName:\t")+testFileNameString); extStatisticList.append(statisticList); return testSatisfiesFilterConditions(extStatisticList); } bool CReasonerEvaluationFilter::testSatisfiesFilterConditions(const QStringList& statisticList) { foreach (CReasonerEvaluationFilterCondition* extrCond, mCondList) { if (!extrCond->isStatisticConditionSatisfied(statisticList)) { return false; } } return true; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDirectoryStructureSelectorFactory.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDirectoryStructureSelectorF0000644000175000017500000000712312520551322032561 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationDirectoryStructureSelectorFactory.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationDirectoryStructureSelectorFactory::CReasonerEvaluationDirectoryStructureSelectorFactory(const QString& groupDirString, const QString& dirString, const QString& baseEvalName, const QString& baseOutputDir) { mDirectoryString = dirString; mBaseEvalName = baseEvalName; mBaseOutputDir = baseOutputDir; mGroupDirString = groupDirString; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationDirectoryStructureSelectorFactory::getSelectors(CReasonerEvaluationGroupRequestSelector* prevSelector) { if (!mDirectoryString.endsWith("/")) { mDirectoryString += QString("/"); } QList selList; CReasonerEvaluationGroupRequestSelector* selectors = getSelectors(nullptr,mDirectoryString,selList); if (selectors) { selectors = selectors->append(prevSelector); } else { selectors = prevSelector; } return selectors; } CReasonerEvaluationGroupRequestSelector* CReasonerEvaluationDirectoryStructureSelectorFactory::getSelectors(CReasonerEvaluationGroupRequestSelector* prevSelector, const QString& dirString, const QList& subDirAddList) { CReasonerEvaluationGroupRequestSelector* selectors = prevSelector; QDir directory(dirString); QStringList subDirStringList = directory.entryList(QDir::Dirs); QStringList fileStringList = directory.entryList(QDir::Files); QString dirGroupString = dirString; dirGroupString.replace(mGroupDirString,""); QList tmpSubDirAddList(subDirAddList); if (subDirStringList.count() > 3 || fileStringList.count() > 0) { CReasonerEvaluationStringMatchGroupSelector* tmpSelector = new CReasonerEvaluationStringMatchGroupSelector(); QString selectorName(mBaseEvalName+" :: "+dirGroupString); //if (selectorName.endsWith("/")) { // selectorName = selectorName.remove(selectorName.count()-1,1); //} //selectorName = selectorName.replace("/"," :: "); tmpSelector->setNameString(selectorName); tmpSelector->setOutputString(mBaseOutputDir+dirGroupString); selectors = tmpSelector->append(selectors); tmpSubDirAddList.append(tmpSelector); } foreach (CReasonerEvaluationStringMatchGroupSelector* selector, tmpSubDirAddList) { selector->addGroupString(dirGroupString); } foreach (QString subDir, subDirStringList) { if (subDir != ".." && subDir != ".") { selectors = getSelectors(selectors,dirString+subDir+"/",tmpSubDirAddList); } } return selectors; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerKoncludeEvaluationProvider.cpp0000644000175000017500000001517512520551340031133 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerKoncludeEvaluationProvider.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerKoncludeEvaluationProvider::CReasonerKoncludeEvaluationProvider() { mProcess = nullptr; mKillTimeout = 1000; mReasonerPort = 8080; } CReasonerKoncludeEvaluationProvider::~CReasonerKoncludeEvaluationProvider() { } bool CReasonerKoncludeEvaluationProvider::createReasoner(CConfiguration *config) { mReasonerName = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.Reasoner.Name"); mReasonerBinaryFile = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.Reasoner.Execution.Binary.File"); mReasonerBinaryArguments = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.Reasoner.Execution.Binary.Arguments"); mReasonerPort = CConfigDataReader::readConfigInteger(config,"Konclude.Evaluation.Reasoner.Address.Port"); mKillScriptString = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.TerminateAssistProgram"); QString argString = QString("%1").arg(mReasonerBinaryArguments); QString reasonerConfigString; QString reasonerString; CConfigData *confData = confData = config->getRelatedConfigChange("Konclude.Execution.CalculationManager"); if (confData && confData->supportsStringConvertion()) { reasonerConfigString += QString(" +=%1=%2 ").arg(confData->getConfigDescription()->getConfigName()).arg(confData->getString()); } confData = config->getRelatedConfigChange("Konclude.Calculation.WorkerCount"); if (confData && confData->supportsStringConvertion()) { reasonerConfigString += QString(" +=%1=%2 ").arg(confData->getConfigDescription()->getConfigName()).arg(confData->getString()); } confData = config->getRelatedConfigChange("Konclude.Calculation.ProcessorCount"); if (confData && confData->supportsStringConvertion()) { reasonerConfigString += QString(" +=%1=%2 ").arg(confData->getConfigDescription()->getConfigName()).arg(confData->getString()); } confData = config->getRelatedConfigChange("Konclude.Execution.DefaultReasonerManager"); if (confData) { reasonerString = confData->getString(); if (reasonerString == "ASExperimentalReasonerManager") { reasonerString = QString("ExperimentalReasonerLoader"); } else if (reasonerString == "ASAnalyseReasonerManager") { reasonerString = QString("AnalyseReasonerLoader"); } else { reasonerString = QString("DefaultReasonerLoader"); } } QStringList argumentList; argumentList += QString("-ConfigurableCoutLogObserverLoader"); argumentList += QString("-%1 %2").arg(reasonerString).arg(reasonerConfigString); argumentList += argString; QString appString = QString("%1").arg(mReasonerBinaryFile); mProcess = new QProcess(); connect(mProcess,SIGNAL(error(QProcess::ProcessError)),this,SLOT(processError(QProcess::ProcessError)),Qt::DirectConnection); connect(mProcess,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(processFinished(int,QProcess::ExitStatus)),Qt::DirectConnection); mProcessFinished = false; mProcessError = false; mProcess->start(appString,argumentList); return true; } QString CReasonerKoncludeEvaluationProvider::getReasonerAddressString() { return QString("127.0.0.1:%1").arg(mReasonerPort); } bool CReasonerKoncludeEvaluationProvider::assistTermination(Q_PID processID) { if (!mKillScriptString.isEmpty()) { QProcess killProcess; QStringList argumentList; argumentList += QString::number((cint64)processID); LOG(INFO,"::Konclude::Test::ReasonerEvaluationProvider",logTr("Executing '%1' to assist termination of process with id '%2'.").arg(mKillScriptString).arg((cint64)processID),this); killProcess.start(mKillScriptString,argumentList); if (!killProcess.waitForStarted()) { return false; } if (!killProcess.waitForFinished()) { return false; } if (killProcess.exitCode() != 0) { return true; } } return false; } CReasonerEvaluationTerminationResult* CReasonerKoncludeEvaluationProvider::destroyReasoner() { CReasonerEvaluationTerminationResult* result = new CReasonerEvaluationTerminationResult(); QByteArray standOutput = mProcess->readAllStandardOutput(); QByteArray standError = mProcess->readAllStandardError(); QString stdOutText(standOutput); QString stdErrText(standError); QString errorString = mProcess->errorString(); bool forcedTermination = false; bool finishedInTime = mProcessFinished; disconnect(mProcess,SIGNAL(error(QProcess::ProcessError)),this,SLOT(processError(QProcess::ProcessError))); disconnect(mProcess,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(processFinished(int,QProcess::ExitStatus))); disconnect(mProcess); disconnect(this); if (!mProcessFinished) { assistTermination(mProcess->pid()); mProcessFinished = true; forcedTermination = true; mProcess->terminate(); mProcess->waitForFinished(mKillTimeout); mProcess->kill(); mProcess->waitForFinished(mKillTimeout); mProcess->kill(); mProcess->waitForFinished(mKillTimeout); } mProcess->close(); delete mProcess; mProcess = nullptr; result->initResult(mProcessError,finishedInTime,forcedTermination,errorString,stdOutText,stdErrText); return result; } void CReasonerKoncludeEvaluationProvider::processError(QProcess::ProcessError error) { if (!mProcessFinished) { mProcessError = true; } } void CReasonerKoncludeEvaluationProvider::processFinished(int exitCode, QProcess::ExitStatus exitStatus) { if (!mProcessFinished) { mProcessFinished = true; if (exitStatus != QProcess::NormalExit) { mProcessError = true; } } } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationFactory.h0000644000175000017500000000367012520551324026727 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFACTORY_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFACTORY_H // Libraries includes // Namespace includes #include "CReasonerEvaluationProvider.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationFactory { // public methods public: //! Constructor CReasonerEvaluationFactory(); //! Destructor virtual ~CReasonerEvaluationFactory(); virtual CReasonerEvaluationProvider* createReasonerProvider(CConfiguration *config) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONFACTORY_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExtractor.cpp0000644000175000017500000000220512520551324027617 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationExtractor.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationExtractor::CReasonerEvaluationExtractor() { } CReasonerEvaluationExtractor::~CReasonerEvaluationExtractor() { } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExpressivitySelectorFactory.hKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationExpressivitySelectorFactory0000644000175000017500000000624612520551324032643 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXPRESSIVITYSELECTORFACTORY_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXPRESSIVITYSELECTORFACTORY_H // Libraries includes #include #include // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationGroupRequestSelector.h" #include "CReasonerEvaluationExpressivityRequestSelector.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationExpressivitySelectorFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationExpressivitySelectorFactory { // public methods public: //! Constructor CReasonerEvaluationExpressivitySelectorFactory(const QString& baseEvalName, const QString& baseOutputDir, const QString& expressivityDir); CReasonerEvaluationGroupRequestSelector* getSelectors(CReasonerEvaluationGroupRequestSelector* prevSelector); CReasonerEvaluationGroupRequestSelector* getSelectorsForELToELPlusPlus(CReasonerEvaluationGroupRequestSelector* prevSelector); CReasonerEvaluationGroupRequestSelector* getSelectorsForALToSHIQ(CReasonerEvaluationGroupRequestSelector* prevSelector); CReasonerEvaluationGroupRequestSelector* getSelectorsForALToSROIQ(CReasonerEvaluationGroupRequestSelector* prevSelector); CReasonerEvaluationGroupRequestSelector* getSelectorsForSHIQToSROIQ(CReasonerEvaluationGroupRequestSelector* prevSelector); CReasonerEvaluationGroupRequestSelector* getSelectorsForALEHIFTransivityToSROIQ(CReasonerEvaluationGroupRequestSelector* prevSelector); CReasonerEvaluationGroupRequestSelector* getSelectorsForALToALEHIFTransivity(CReasonerEvaluationGroupRequestSelector* prevSelector); CReasonerEvaluationGroupRequestSelector* getSelectorsForALToALERTransivity(CReasonerEvaluationGroupRequestSelector* prevSelector); // protected methods protected: // protected variables protected: QString mBaseEvalName; QString mBaseOutputDir; QString mExpressivityDir; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONEXPRESSIVITYSELECTORFACTORY_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationDoubleDataValue.cpp0000644000175000017500000000324412520551322030647 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationDoubleDataValue.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationDoubleDataValue::CReasonerEvaluationDoubleDataValue(double value) { mValue = value; } CReasonerEvaluationDoubleDataValue::~CReasonerEvaluationDoubleDataValue() { } CReasonerEvaluationDataValue* CReasonerEvaluationDoubleDataValue::getCopy() { return new CReasonerEvaluationDoubleDataValue(*this); } QString CReasonerEvaluationDoubleDataValue::generateString() { return QString::number(mValue); } double CReasonerEvaluationDoubleDataValue::getValue() { return mValue; } CReasonerEvaluationDoubleDataValue* CReasonerEvaluationDoubleDataValue::setValue(double value) { mValue = value; return this; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationResponseFileExtractor.cpp0000644000175000017500000000317312520551336032146 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationResponseFileExtractor.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationResponseFileExtractor::CReasonerEvaluationResponseFileExtractor() { } CReasonerEvaluationResponseFileExtractor::~CReasonerEvaluationResponseFileExtractor() { } CReasonerEvaluationDataValue* CReasonerEvaluationResponseFileExtractor::extractEvaluationData(const QString& responseFileString) { CReasonerEvaluationStringValue* respFileEvalValue = nullptr; QFile responseFile(responseFileString); if (responseFile.open(QIODevice::ReadOnly)) { responseFile.close(); respFileEvalValue = new CReasonerEvaluationStringValue(responseFileString); } return respFileEvalValue; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationHighchartPlotter.cpp0000644000175000017500000006627712520551332031141 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationHighchartPlotter.h" #include "CReasonerEvaluationAnalyseContext.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationHighchartPlotter::CReasonerEvaluationHighchartPlotter(CReasonerEvaluationAnalyseContext* context) { mContext = context; mReasCompTemplateStringHash.insert("-horizontal-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerComparison/horizontal-chart.html")); mReasCompTemplateStringHash.insert("-vertical-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerComparison/vertical-chart.html")); mReasFasterTemplateStringHash.insert("-horizontal-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerFasterRatio/horizontal-chart.html")); mReasFasterTemplateStringHash.insert("-vertical-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerFasterRatio/vertical-chart.html")); mReasDiffTemplateStringHash.insert("-horizontal-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerDifference/horizontal-chart.html")); mReasDiffTemplateStringHash.insert("-vertical-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerDifference/vertical-chart.html")); mReasErrorTemplateStringHash.insert("-horizontal-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerError/horizontal-chart.html")); mReasErrorTemplateStringHash.insert("-vertical-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerError/vertical-chart.html")); mReasAccumTemplateStringHash.insert("-horizontal-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerAccumulatedTimes/horizontal-chart.html")); mReasAccumTemplateStringHash.insert("-vertical-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerAccumulatedTimes/vertical-chart.html")); mReasAccumCountTemplateStringHash.insert("-horizontal-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerAccumulatedCount/horizontal-chart.html")); mReasAccumCountTemplateStringHash.insert("-vertical-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerAccumulatedCount/vertical-chart.html")); mRequestStatisticsTemplateStringHash.insert("-without-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/RequestStatistics/without-chart.html")); mReasOverviewTemplateStringHash.insert("-horizontal-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasoenrOverview/horizontal-chart.html")); mReasWinnerTemplateStringHash.insert("-stacked-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerWinnerCount/stacked-chart.html")); mReasWinnerTemplateStringHash.insert("-stacked-percent-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerWinnerCount/stacked-percent-chart.html")); mReasStackedBucketTemplateStringHash.insert("-stacked-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerBucket/stacked-chart.html")); mReasStackedBucketTemplateStringHash.insert("-stacked-percent-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerBucket/stacked-percent-chart.html")); mReasBucketTemplateStringHash.insert("-column-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerBucket/column-chart.html")); mReasCumulativeBucketTemplateStringHash.insert("-column-chart",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerBucket/cumulative-column-chart.html")); mReasCompSplitOverTemplateStringHash.insert("-table-horizontal-chart-split-merged",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerComparison/horizontal-chart-split-merged.html")); mReasCompSplitContentTemplateStringHash.insert("-table-horizontal-chart-split-merged",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerComparison/horizontal-chart-split-content.html")); mReasCompSplitOverTemplateStringHash.insert("-table-vertical-chart-split-merged",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerComparison/vertical-chart-split-merged.html")); mReasCompSplitContentTemplateStringHash.insert("-table-vertical-chart-split-merged",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerComparison/vertical-chart-split-content.html")); mReasFasterSplitOverTemplateStringHash.insert("-table-horizontal-chart-split-merged",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerFasterRatio/horizontal-chart-split-merged.html")); mReasFasterSplitContentTemplateStringHash.insert("-table-horizontal-chart-split-merged",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerFasterRatio/horizontal-chart-split-content.html")); mReasFasterSplitOverTemplateStringHash.insert("-table-vertical-chart-split-merged",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerFasterRatio/vertical-chart-split-merged.html")); mReasFasterSplitContentTemplateStringHash.insert("-table-vertical-chart-split-merged",loadTemplateFromFile("Evaluation/Templates/Highcharts/Charts/ReasonerFasterRatio/vertical-chart-split-content.html")); loadReasonerColorData("Evaluation/Templates/Highcharts/Charts/colors.txt",mReasColorHash); //mReasColorHash.insert("FaCT++","#E4FECA"); //mReasColorHash.insert("HermiT","#BBD2FF"); //mReasColorHash.insert("Pellet","#404040"); //mReasColorHash.insert("Konclude","#3784A0"); //mReasColorHash.insert("Average","#F7C298"); //mReasColorHash.insert("Min","#D5803D"); //mReasColorHash.insert("Max","#603326"); } CReasonerEvaluationHighchartPlotter::~CReasonerEvaluationHighchartPlotter() { } QString CReasonerEvaluationHighchartPlotter::loadTemplateFromFile(const QString& fileString) { QString dataString; QFile file(fileString); if (file.open(QIODevice::ReadOnly)) { dataString = file.readAll(); } return dataString; } QMap CReasonerEvaluationHighchartPlotter::loadReasonerStringIndexMap(const QString& dataFileString) { QFile dataFile(dataFileString); QMap reasonerStringIndexMap; if (dataFile.open(QIODevice::ReadOnly)) { QString titleLineString = dataFile.readLine(); cint64 nextIndex = 0; cint64 nextStartPos = 0; cint64 nextEndPos = 0; bool hasNextTitle = true; while (hasNextTitle) { nextEndPos = titleLineString.indexOf("\t",nextStartPos); if (nextEndPos <= -1) { nextEndPos = titleLineString.length(); hasNextTitle = false; } QString nextTitle = titleLineString.mid(nextStartPos,nextEndPos-nextStartPos); nextTitle.replace("\"",""); if (!nextTitle.isEmpty()) { reasonerStringIndexMap.insert(nextTitle,nextIndex++); } nextStartPos = nextEndPos+1; } dataFile.close(); } return reasonerStringIndexMap; } bool CReasonerEvaluationHighchartPlotter::hasValidColorsForAllReasoenrs(const QStringList& reasonerList) { bool validColorsForAllReasoners = true; QSet usedReasonerColorSet; foreach (QString reasonerString, reasonerList) { QString colorString = getColorString(reasonerString,&usedReasonerColorSet); if (colorString.isEmpty()) { validColorsForAllReasoners = false; } } return validColorsForAllReasoners; } bool CReasonerEvaluationHighchartPlotter::loadReasonerColorData(const QString& dataFileString, QHash& reasColorHash) { QFile dataFile(dataFileString); if (dataFile.open(QIODevice::ReadOnly)) { while (!dataFile.atEnd()) { QString dataString = dataFile.readLine(); if (!dataString.startsWith("#")) { QStringList dataStringList = dataString.split("\t"); if (dataStringList.count() >= 2) { QString nameMatchString = dataStringList.takeFirst(); QString colorString = dataStringList.takeFirst(); reasColorHash.insert(nameMatchString,colorString); } } } return true; } return false; } bool CReasonerEvaluationHighchartPlotter::loadReasonerComparisonData(const QString& dataFileString, QStringList& labelList, QMap& valueListMap) { QFile dataFile(dataFileString); if (dataFile.open(QIODevice::ReadOnly)) { QStringList titleList; QString titleLineString = dataFile.readLine(); cint64 nextIndex = 0; cint64 nextStartPos = 0; cint64 nextEndPos = 0; bool hasNextTitle = true; while (hasNextTitle) { nextEndPos = titleLineString.indexOf("\t",nextStartPos); if (nextEndPos <= -1) { nextEndPos = titleLineString.length(); hasNextTitle = false; } QString nextTitle = titleLineString.mid(nextStartPos,nextEndPos-nextStartPos); titleList.append(nextTitle.trimmed()); nextStartPos = nextEndPos+1; } QList< QStringList > dataList; while (!dataFile.atEnd()) { QString dataString = dataFile.readLine(); QStringList dataStringList = dataString.split("\t"); QList< QStringList >::iterator it = dataList.begin(), itEnd = dataList.end(); if (!dataStringList.isEmpty()) { QString valueString = dataStringList.takeFirst(); labelList.append(valueString.replace("-request.xml","")); } while (!dataStringList.isEmpty()) { QString valueString = dataStringList.takeFirst(); if (it == itEnd) { dataList.append(QStringList()<& reasTemplateOverStringHash, const QHash& reasTemplateContStringHash, const QString& selectionString) { QHash sortDataFileHash; QHash sortPlotTitleHash; for (QStringList::const_iterator it = dataFileStringList.constBegin(), itEnd = dataFileStringList.constEnd(), itT = plotTitleList.constBegin(), itTEnd = plotTitleList.constEnd(); it != itEnd && itT != itTEnd; ++it, ++itT) { const QString& dataFileString(*it); QString plotTitleString(*itT); QString sortString = dataFileString.mid(0,dataFileString.indexOf("-split")); sortDataFileHash[sortString].prepend(dataFileString); plotTitleString = plotTitleString.mid(0,plotTitleString.indexOf("split")); sortPlotTitleHash[sortString] = plotTitleString; } for (QHash::const_iterator it = sortDataFileHash.constBegin(), itEnd = sortDataFileHash.constEnd(); it != itEnd; ++it) { QString sortString(it.key()); QStringList sortDataFileString(it.value()); const QString plotTitleString = sortPlotTitleHash.value(sortString); qSort(sortDataFileString.begin(),sortDataFileString.end(),caseInsensitiveLessThan); createReasonerSplitPlot(sortDataFileString,plotTitleString,reasonerNameList,sortString,reasTemplateOverStringHash,reasTemplateContStringHash,selectionString); } return this; } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationHighchartPlotter::createReasonerSplitPlot(const QStringList& dataFileStringList, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QHash& reasTemplateOverStringHash, const QHash& reasTemplateContStringHash, const QString& selectionString) { for (QHash::const_iterator itTemplate = reasTemplateOverStringHash.constBegin(), itTemplateEnd = reasTemplateOverStringHash.constEnd(); itTemplate != itTemplateEnd; ++itTemplate) { QString plotName = itTemplate.key(); QString plotOverviewString = itTemplate.value(); QString outputFileString(outputFile+plotName+".html"); QString plotContentMergedString; cint64 partNumber = 1; foreach (const QString& dataFileString, dataFileStringList) { QMap reasonerStringIndexMap = loadReasonerStringIndexMap(dataFileString); QString plotContentString = reasTemplateContStringHash.value(plotName); plotContentString = plotContentString.replace("$$_PLOT_TITLE_$$",plotTitle); plotContentString = plotContentString.replace("$$_PLOT_SUB_TITLE_$$",QString("Part %1 of %2").arg(partNumber).arg(dataFileStringList.count())); plotContentString = plotContentString.replace("$$_PLOT_CONTAINER_ID_$$",QString::number(partNumber++)); QStringList reasonerAndAverageList(reasonerNameList); if (reasonerStringIndexMap.contains("Average")) { reasonerAndAverageList.append(QString("Average")); } bool validColorsForAllReasoners = hasValidColorsForAllReasoenrs(reasonerAndAverageList); QStringList labelList; QMap valueListMap; if (loadReasonerComparisonData(dataFileString,labelList,valueListMap)) { QString seriesDataString; QString labelString = QString("'%1'").arg(labelList.join("', '")); QString colorString; foreach (QString reasonerString, reasonerNameList) { QString plotReasonerString; QStringList valueList = valueListMap.value(reasonerString); plotReasonerString = QString("{type: 'column',name: '%1',data: [%2]},").arg(reasonerString).arg(valueList.join(", ")); seriesDataString += plotReasonerString; if (validColorsForAllReasoners) { colorString += QString("'%1',").arg(getColorString(reasonerString)); } } if (reasonerStringIndexMap.contains("Average")) { QString plotReasonerString; QStringList valueList = valueListMap.value("Average"); plotReasonerString = QString("{type: 'spline',name: '%1',data: [%2]}").arg("Average").arg(valueList.join(", ")); seriesDataString += plotReasonerString; if (validColorsForAllReasoners) { colorString += QString("'%1',").arg(getColorString("Average")); } } if (validColorsForAllReasoners) { colorString = QString("colors: [%1], ").arg(colorString); } plotContentString.replace("$$_PLOT_DATA_SERIES_$$",seriesDataString); plotContentString.replace("$$_PLOT_LABELS_$$",labelString); plotContentString.replace("$$_PLOT_COLORS_$$",colorString); plotContentString.replace("$$_PLOT_DATE_$$",QDateTime::currentDateTime().toString()); plotContentString.replace("$$_PLOT_DATA_DOWNLOAD_CSV_$$",getFileNameWithoutDirectory(dataFileString)); plotContentString.replace("$$_PLOT_DATA_DOWNLOAD_HTML_$$",getFileNameWithoutDirectory(outputFileString)); plotContentString.replace("$$_PLOT_DATA_SELECTION_$$",selectionString); cint64 dataCount50n60 = labelList.count()*60+50; plotContentString.replace("$$_PLOT_DATA_COUNT_50+n*60_$$",QString::number(dataCount50n60)); plotContentMergedString += plotContentString; } } if (!plotContentMergedString.isEmpty()) { plotOverviewString.replace("$$_DOCUMENT_TITLE_$$",plotTitle); plotOverviewString.replace("$$_DOCUMENT_CONTENT_$$",plotContentMergedString); plotOverviewString.replace("$$_PLOT_DATE_$$",QDateTime::currentDateTime().toString()); plotOverviewString.replace("$$_PLOT_DATA_DOWNLOAD_HTML_$$",getFileNameWithoutDirectory(outputFileString)); plotOverviewString.replace("$$_PLOT_DATA_SELECTION_$$",selectionString); QFile outputScriptFile(outputFileString); if (outputScriptFile.open(QIODevice::WriteOnly)) { outputScriptFile.write(plotOverviewString.toLocal8Bit()); outputScriptFile.close(); } } } return this; } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationHighchartPlotter::createReasonerFasterPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QString& selectionString) { return createReasonerPlot(dataFileString,plotTitle,reasonerNameList,outputFile,mReasFasterTemplateStringHash,selectionString); } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationHighchartPlotter::createReasonerComparisonPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QString& selectionString) { return createReasonerPlot(dataFileString,plotTitle,reasonerNameList,outputFile,mReasCompTemplateStringHash,selectionString); } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationHighchartPlotter::createReasonerDifferencePlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QString& selectionString) { return createReasonerPlot(dataFileString,plotTitle,reasonerNameList,outputFile,mReasDiffTemplateStringHash,selectionString); } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationHighchartPlotter::createReasonerErrorPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QString& selectionString) { return createReasonerPlot(dataFileString,plotTitle,reasonerNameList,outputFile,mReasErrorTemplateStringHash,selectionString); } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationHighchartPlotter::createReasonerAccumulatedPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QString& selectionString) { return createReasonerPlot(dataFileString,plotTitle,reasonerNameList,outputFile,mReasAccumTemplateStringHash,selectionString); } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationHighchartPlotter::createReasonerAccumulatedCountPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QString& selectionString) { return createReasonerPlot(dataFileString,plotTitle,reasonerNameList,outputFile,mReasAccumCountTemplateStringHash,selectionString); } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationHighchartPlotter::createRequestStatisticsPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QString& selectionString) { return createReasonerPlot(dataFileString,plotTitle,reasonerNameList,outputFile,mRequestStatisticsTemplateStringHash,selectionString); } QString CReasonerEvaluationHighchartPlotter::getFileNameWithoutDirectory(const QString& fileNameString) { QString fileNameWDString = fileNameString; cint64 lastSlash = fileNameWDString.lastIndexOf("/"); if (lastSlash != -1) { fileNameWDString = fileNameWDString.mid(lastSlash+1); } return fileNameWDString; } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationHighchartPlotter::createReasonerPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QHash& reasTemplateStringHash, const QString& selectionString, const QString& curveString) { QMap reasonerStringIndexMap = loadReasonerStringIndexMap(dataFileString); for (QHash::const_iterator itTemplate = reasTemplateStringHash.constBegin(), itTemplateEnd = reasTemplateStringHash.constEnd(); itTemplate != itTemplateEnd; ++itTemplate) { QString plotName = itTemplate.key(); QString plotContentString = itTemplate.value(); QString outputFileString(outputFile+plotName+".html"); plotContentString.replace("$$_PLOT_TITLE_$$",plotTitle); QStringList reasonerAndAverageList(reasonerNameList); if (reasonerStringIndexMap.contains("Average")) { reasonerAndAverageList.append(QString("Average")); } bool validColorsForAllReasoners = hasValidColorsForAllReasoenrs(reasonerAndAverageList); QStringList labelList; QMap valueListMap; if (loadReasonerComparisonData(dataFileString,labelList,valueListMap)) { QFile outputScriptFile(outputFileString); if (outputScriptFile.open(QIODevice::WriteOnly)) { QString seriesDataString; QString labelString = QString("'%1'").arg(labelList.join("', '")); QString colorString; foreach (QString reasonerString, reasonerNameList) { QString plotReasonerString; QStringList valueList = valueListMap.value(reasonerString); plotReasonerString = QString("{%1name: '%2',data: [%4]},").arg(curveString).arg(reasonerString).arg(valueList.join(", ")); seriesDataString += plotReasonerString; if (validColorsForAllReasoners) { colorString += QString("'%1',").arg(getColorString(reasonerString)); } } if (reasonerStringIndexMap.contains("Average")) { QString plotReasonerString; QStringList valueList = valueListMap.value("Average"); plotReasonerString = QString("{type: 'spline',name: '%1',data: [%2]}").arg("Average").arg(valueList.join(", ")); seriesDataString += plotReasonerString; if (validColorsForAllReasoners) { colorString += QString("'%1',").arg(getColorString("Average")); } } if (validColorsForAllReasoners) { colorString = QString("colors: [%1], ").arg(colorString); } plotContentString.replace("$$_PLOT_DATA_SERIES_$$",seriesDataString); plotContentString.replace("$$_PLOT_LABELS_$$",labelString); plotContentString.replace("$$_PLOT_COLORS_$$",colorString); plotContentString.replace("$$_PLOT_DATE_$$",QDateTime::currentDateTime().toString()); plotContentString.replace("$$_PLOT_DATA_DOWNLOAD_CSV_$$",getFileNameWithoutDirectory(dataFileString)); plotContentString.replace("$$_PLOT_DATA_DOWNLOAD_HTML_$$",getFileNameWithoutDirectory(outputFileString)); plotContentString.replace("$$_PLOT_DATA_SELECTION_$$",selectionString); cint64 dataCount50n60 = labelList.count()*60+50; plotContentString.replace("$$_PLOT_DATA_COUNT_50+n*60_$$",QString::number(dataCount50n60)); outputScriptFile.write(plotContentString.toLocal8Bit()); outputScriptFile.close(); } } } return this; } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationHighchartPlotter::createReasonerWinnerCountPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QString& selectionString) { return createReasonerPlot(dataFileString,plotTitle,reasonerNameList,outputFile,mReasWinnerTemplateStringHash,selectionString,""); } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationHighchartPlotter::createReasonerStackedBucketPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QString& selectionString) { return createReasonerPlot(dataFileString,plotTitle,reasonerNameList,outputFile,mReasStackedBucketTemplateStringHash,selectionString,""); } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationHighchartPlotter::createReasonerBucketPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QString& selectionString) { return createReasonerPlot(dataFileString,plotTitle,reasonerNameList,outputFile,mReasBucketTemplateStringHash,selectionString,""); } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationHighchartPlotter::createReasonerCumulativeBucketPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QString& selectionString) { return createReasonerPlot(dataFileString,plotTitle,reasonerNameList,outputFile,mReasCumulativeBucketTemplateStringHash,selectionString,""); } CReasonerEvaluationHighchartPlotter* CReasonerEvaluationHighchartPlotter::createReasonerOverviewPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile, const QString& selectionString) { return createReasonerPlot(dataFileString,plotTitle,reasonerNameList,outputFile,mReasOverviewTemplateStringHash,selectionString,"type: 'spline',"); } QString CReasonerEvaluationHighchartPlotter::getColorString(const QString& reasonerString, QSet* usedReasonerColorSet) { QString reasonerColorString(reasonerString); QString colorString; if (mReasColorHash.contains(reasonerColorString)) { colorString = mReasColorHash.value(reasonerColorString); } else { cint64 versionSplitSpacePos = reasonerColorString.indexOf(" "); if (versionSplitSpacePos >= 0) { reasonerColorString = reasonerColorString.mid(0,versionSplitSpacePos); if (mReasColorHash.contains(reasonerColorString)) { colorString = mReasColorHash.value(reasonerColorString); } } } if (usedReasonerColorSet && !colorString.isEmpty()) { if (usedReasonerColorSet->contains(reasonerColorString)) { colorString.clear(); } else { usedReasonerColorSet->insert(reasonerColorString); } } return colorString; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerOWLlinkEvaluationProvider.cpp0000644000175000017500000001446312520551342030707 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerOWLlinkEvaluationProvider.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerOWLlinkEvaluationProvider::CReasonerOWLlinkEvaluationProvider() { mAdapterProcess = nullptr; mSupportProcess = nullptr; mKillTimeout = 2000; mReasonerPort = 8080; mMemoryLimit = (cint64)1024*1024*1024*10; } CReasonerOWLlinkEvaluationProvider::~CReasonerOWLlinkEvaluationProvider() { } bool CReasonerOWLlinkEvaluationProvider::createReasoner(CConfiguration *config) { mReasonerName = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.Reasoner.Name"); mReasonerLibDirectory = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.Reasoner.Execution.OWLlinkOWLAPIServerAdapter.ClassPathLibraries"); mReasonerLibSeparator = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.Reasoner.Execution.OWLlinkOWLAPIServerAdapter.ClassPathLibrariesSeparator"); mReasonerClassCallName = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.Reasoner.Execution.OWLlinkOWLAPIServerAdapter.MainClass"); mReasonerPort = CConfigDataReader::readConfigInteger(config,"Konclude.Evaluation.Reasoner.Address.Port"); mMemoryLimit = CConfigDataReader::readConfigInteger(config,"Konclude.Evaluation.MemoryLimit"); mReasonerAdditionalParameters = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.Reasoner.Execution.OWLlinkOWLAPIServerAdapter.AdditionalParameters"); mSupportProcessString = CConfigDataReader::readConfigString(config,"Konclude.Evaluation.Reasoner.Execution.OWLlinkOWLAPIServerAdapter.AdditionalProcess"); if (!mSupportProcessString.isEmpty()) { mSupportProcess = new QProcess(); mSupportProcess->start(mSupportProcessString); } QStringList jarFilesStringList; addLibrariesRecursive(mReasonerLibDirectory,jarFilesStringList); QString argString = QString("-Xmx%1 -Djava.library.path=%2 -cp .%3\"%4\" %5 -port %6 %7").arg(mMemoryLimit).arg(mReasonerLibDirectory).arg(mReasonerLibSeparator).arg(jarFilesStringList.join(mReasonerLibSeparator)).arg(mReasonerClassCallName).arg(mReasonerPort).arg(mReasonerAdditionalParameters); QString appString = QString("java %1").arg(argString); mAdapterProcess = new QProcess(); connect(mAdapterProcess,SIGNAL(error(QProcess::ProcessError)),this,SLOT(processError(QProcess::ProcessError)),Qt::DirectConnection); connect(mAdapterProcess,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(processFinished(int,QProcess::ExitStatus)),Qt::DirectConnection); mProcessFinished = false; mProcessError = false; mAdapterProcess->start(appString); return true; } QString CReasonerOWLlinkEvaluationProvider::getReasonerAddressString() { return QString("127.0.0.1:%1").arg(mReasonerPort); } CReasonerEvaluationTerminationResult* CReasonerOWLlinkEvaluationProvider::destroyReasoner() { CReasonerEvaluationTerminationResult* result = new CReasonerEvaluationTerminationResult(); QByteArray standOutput = mAdapterProcess->readAllStandardOutput(); QByteArray standError = mAdapterProcess->readAllStandardError(); QString stdOutText(standOutput); QString stdErrText(standError); QString errorString = mAdapterProcess->errorString(); bool forcedTermination = false; bool finishedInTime = mProcessFinished; disconnect(mAdapterProcess,SIGNAL(error(QProcess::ProcessError)),this,SLOT(processError(QProcess::ProcessError))); disconnect(mAdapterProcess,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(processFinished(int,QProcess::ExitStatus))); disconnect(mAdapterProcess); disconnect(this); if (!mProcessFinished) { mProcessFinished = true; forcedTermination = true; mAdapterProcess->terminate(); mAdapterProcess->waitForFinished(mKillTimeout); mAdapterProcess->kill(); mAdapterProcess->waitForFinished(mKillTimeout); mAdapterProcess->kill(); mAdapterProcess->waitForFinished(mKillTimeout); } if (mSupportProcess) { mSupportProcess->terminate(); mSupportProcess->waitForFinished(mKillTimeout); mSupportProcess->kill(); mSupportProcess->waitForFinished(mKillTimeout); mSupportProcess->kill(); mSupportProcess->waitForFinished(mKillTimeout); } mAdapterProcess->close(); delete mAdapterProcess; mAdapterProcess = nullptr; result->initResult(mProcessError,finishedInTime,forcedTermination,errorString,stdOutText,stdErrText); return result; } void CReasonerOWLlinkEvaluationProvider::processError(QProcess::ProcessError error) { if (!mProcessFinished) { mProcessError = true; } } void CReasonerOWLlinkEvaluationProvider::processFinished(int exitCode, QProcess::ExitStatus exitStatus) { if (!mProcessFinished) { mProcessFinished = true; if (exitStatus != QProcess::NormalExit) { mProcessError = true; } } } void CReasonerOWLlinkEvaluationProvider::addLibrariesRecursive(const QString& dirString, QStringList& jarStringList) { QDir dir(dirString); QStringList filterList; filterList<. * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser::CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser(double bucketsStart, double bucketsEnd, double bucketsIncreaseFactor, double timeoutsEnd) { mTimeoutsEnd = timeoutsEnd; mBucketsStart = bucketsStart; mBucketsEnd = bucketsEnd; mBucketsIncreaseFactor = bucketsIncreaseFactor; } bool CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser::analyseGroupedEvaluationData(const QStringList& groubList, const QStringList& requestList, const QStringList& reasonerList, const QString& outputDirectory, CReasonerEvaluationAnalyseContext* context, CReasonerEvaluationGroupRequestSelector* selector) { QList bucketsEndList; cint64 bucketCount = 1; bucketsEndList.append(mBucketsStart); double nextBucketsEnd = mBucketsStart; do { nextBucketsEnd *= mBucketsIncreaseFactor; bucketsEndList.append((cint64)qMin(nextBucketsEnd+0.5,mBucketsEnd)); ++bucketCount; } while (nextBucketsEnd < mBucketsEnd); cint64 bucketTimeoutErrorCount = bucketCount+2; mOutputFileName = QString("%1").arg(selector->getOutputString()); cint64 reasonerCount = reasonerList.count(); bool hasSelectedRequestFile = false; QDir outDir(outputDirectory); outDir.mkpath(mOutputFileName); cint64** bucketTable = new cint64*[reasonerCount]; for (cint64 i = 0; i < reasonerCount; ++i) { cint64* tmpVec = new cint64[bucketTimeoutErrorCount]; bucketTable[i] = tmpVec; for (cint64 j = 0; j < bucketTimeoutErrorCount; ++j) { tmpVec[j] = 0; } } cint64** cummBucketTable = new cint64*[reasonerCount]; for (cint64 i = 0; i < reasonerCount; ++i) { cint64* tmpVec = new cint64[bucketTimeoutErrorCount]; cummBucketTable[i] = tmpVec; for (cint64 j = 0; j < bucketTimeoutErrorCount; ++j) { tmpVec[j] = 0; } } QHash reasonerBucketHash; QHash reasonerCummulativeBucketHash; cint64 index = 0; foreach (const QString& reasonerString, reasonerList) { reasonerBucketHash.insert(reasonerString,bucketTable[index]); reasonerCummulativeBucketHash.insert(reasonerString,cummBucketTable[index]); ++index; } cint64 requestCount = 0; foreach (QString groupString, groubList) { if (selector->isGroupSelected(groupString)) { QSet* groupRequestList = getGroupRequests(groupString); foreach (QString requestString, *groupRequestList) { if (selector->isRequestSelected(groupString,requestString)) { bool allDataAvailable = true; foreach (QString reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); if (!evalData || evalData->hasDataNotAvailableFlag()) { allDataAvailable = false; } } if (allDataAvailable) { hasSelectedRequestFile = true; requestCount++; QString requestReasonerTabList(requestString); foreach (const QString& reasonerString, reasonerList) { CReasonerEvaluationDataValue* evalData = getGroupRequestReasonerEvaluationData(groupString,requestString,reasonerString); CReasonerEvaluationDoubleDataValue* doubleEvalData = dynamic_cast(evalData); if (doubleEvalData) { double doubleValue = doubleEvalData->getValue(); cint64 bucketID = 0; if (doubleValue > mTimeoutsEnd) { bucketID = bucketTimeoutErrorCount-1; } else if (doubleValue > mBucketsEnd) { bucketID = bucketTimeoutErrorCount-2; } else { foreach (double bucketEnd, bucketsEndList) { if (doubleValue < bucketEnd) { break; } ++bucketID; } } cint64* bucketVec = reasonerBucketHash.value(reasonerString); ++bucketVec[bucketID]; cint64* cummBucketVec = reasonerCummulativeBucketHash.value(reasonerString); ++cummBucketVec[bucketID]; for (cint64 nextBucketId = bucketID+1; nextBucketId < bucketCount; ++nextBucketId) { ++cummBucketVec[nextBucketId]; } } } } } } } } if (hasSelectedRequestFile) { QStringList bucketList; QStringList cumulativeBucketList; CReasonerEvaluationTableMultiFormatOutputWriter bucketOutputWriter; for (cint64 i = 0; i < bucketTimeoutErrorCount; ++i) { QString title; QString cumulativeTitle; if (i < bucketCount) { double bucketStart = 0; if (i > 0) { bucketStart = bucketsEndList.at(i-1); } double bucketEnd = bucketsEndList.at(i); title = QString("%1-%2").arg(bucketStart).arg(bucketEnd); cumulativeTitle = QString("<%1").arg(bucketEnd); } else if (i == bucketCount) { title = "timeout"; cumulativeTitle = "timeout"; } else { title = "error"; cumulativeTitle = "error"; } bucketList.append(title); cumulativeBucketList.append(cumulativeTitle); } bucketOutputWriter.addColumnTitles(QStringList()<<"Reasoner"<()<isHighchartPlottingActivated()) { foreach (const QString& plotFileString, reasonerCompHighchartPlotFileList) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createReasonerStackedBucketPlot(plotFileString,context->getAdditionalTitleString()+" grouped by "+title+"",bucketList,outputFile,selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } // write in columns CReasonerEvaluationTableMultiFormatOutputWriter bucketOutputWriter2; bucketOutputWriter2.addColumnTitles(QStringList()<<"Reasoner"<()<isHighchartPlottingActivated()) { foreach (const QString& plotFileString, reasonerColumnCompHighchartPlotFileList) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createReasonerBucketPlot(plotFileString,context->getAdditionalTitleString()+" grouped by "+title+"",reasonerList,outputFile,selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } // write cumulative in columns CReasonerEvaluationTableMultiFormatOutputWriter bucketOutputWriter3; bucketOutputWriter3.addColumnTitles(QStringList()<<"Reasoner"<()<isHighchartPlottingActivated()) { foreach (const QString& plotFileString, reasonerCumulativeColumnCompHighchartPlotFileList) { QString outputFile = plotFileString; outputFile.remove(".csv"); QString title = getPrettyTitleFromOutputFile(outputFile); context->getHighchartPlotter()->createReasonerCumulativeBucketPlot(plotFileString,context->getAdditionalTitleString()+" grouped by "+title+"",reasonerList,outputFile,selector->getNameString()+" :: "+context->getAdditionalTitleString()); } } } for (cint64 i = 0; i < reasonerCount; ++i) { delete [] bucketTable[i]; } delete [] bucketTable; return true; } QString CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser::getPrettyTitleFromOutputFile(const QString& outputFile) { QString title = outputFile; title.remove("table"); cint64 slashPos = title.lastIndexOf("/"); if (slashPos >= 0) { title = title.mid(slashPos+1); } title.replace("-"," "); title.replace("stacked","Stacked"); title.replace("column","Column"); title.replace("buckets","Buckets"); title.replace("cumulative","Cumulative"); title.replace("grouped","Grouped"); return title; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationRequestResponse.h0000644000175000017500000000552012520551334030464 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTRESPONSE_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTRESPONSE_H // Libraries includes #include // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Utilities::Container; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationRequestResponse * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationRequestResponse : public CLinkerBase { // public methods public: //! Constructor CReasonerEvaluationRequestResponse(); CReasonerEvaluationRequestResponse* setTimedOut(bool timedOut); CReasonerEvaluationRequestResponse* setResponseError(bool responseError); CReasonerEvaluationRequestResponse* setResponseTime(cint64 responseTime); CReasonerEvaluationRequestResponse* setRequestNode(const QDomElement& reqNode); CReasonerEvaluationRequestResponse* setModifiedNode(const QDomElement& reqNode); CReasonerEvaluationRequestResponse* setResponseNode(const QDomElement& resNode); cint64 getResponseTime(); bool isTimedOut(); bool hasResponseError(); QDomElement getRequestNode(); QDomElement getResponseNode(); QDomElement getModifiedNode(); // protected methods protected: // protected variables protected: QDomElement mRequestNode; QDomElement mResponseNode; QDomElement mModifiedNode; cint64 mResponseTime; bool mTimedOut; bool mResponseError; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTRESPONSE_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationCollector.cpp0000644000175000017500000001123412520551320027570 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationCollector.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationCollector::CReasonerEvaluationCollector(CReasonerEvaluationExtractor* extractor, CReasonerEvaluationSummarizer* summarizer, CReasonerEvaluationFiltering* filtering) : CLogIdentifier("::Konclude::Test::Evaluation::Collector",this) { mExtractor = extractor; mSummarizer = summarizer; mFiltering = filtering; } CReasonerEvaluationCollector::~CReasonerEvaluationCollector() { } bool CReasonerEvaluationCollector::collectReasonerEvaluationDataValues(CReasonerEvaluationDataValueGroupCollectionReasonerComparison *reasonerComp, const QString& reasonerName, const QString& reasonerPath) { CReasonerEvaluationDataValueGroupCollection* valueGroupCollection = collectEvaluationDataValues(reasonerPath); reasonerComp->addReasonerCollection(reasonerName,valueGroupCollection); return true; } CReasonerEvaluationDataValueGroupCollection* CReasonerEvaluationCollector::collectEvaluationDataValues(const QString& baseDirectory) { CReasonerEvaluationDataValueGroupCollection* groupCollection = new CReasonerEvaluationDataValueGroupCollection(); collectEvaluationDatas(baseDirectory,"",baseDirectory,groupCollection); return groupCollection; } bool CReasonerEvaluationCollector::collectEvaluationDatas(const QString& directory, const QString& subDirectory, const QString& baseDirectory, CReasonerEvaluationDataValueGroupCollection* groupCollection) { QDir dir(directory); CReasonerEvaluationDataValueGroup* group = new CReasonerEvaluationDataValueGroup(); QStringList dirList = dir.entryList(QDir::Dirs,QDir::Name|QDir::IgnoreCase); foreach (QString dirString, dirList) { if (dirString != "." && dirString != "..") { QStringList statisticList; if (mFiltering) { statisticList = mFiltering->loadStatistics(dirString,subDirectory); } if (!mFiltering || mFiltering->testSatisfiesFilter(dirString,baseDirectory,subDirectory,statisticList)) { LOG(INFO,getLogDomain(),logTr("Extracting data for '%1'.").arg(dirString),this); collectGroupEvaluationDatas(directory+dirString+"/",dirString,group); } else { LOG(INFO,getLogDomain(),logTr("Data extracting for '%1' filtered out.").arg(dirString),this); } } } if (!group->isEmpty()) { QString groupName = directory; groupName.remove(0,baseDirectory.length()); group->setGroupName(groupName); groupCollection->addNameGroupEvaluationData(groupName,group); } else { delete group; } foreach (QString dirString, dirList) { if (dirString != "." && dirString != "..") { collectEvaluationDatas(directory+dirString+"/",subDirectory+dirString+"/",baseDirectory,groupCollection); } } return true; } bool CReasonerEvaluationCollector::collectGroupEvaluationDatas(const QString& directory, const QString& requestFileString, CReasonerEvaluationDataValueGroup* group) { QDir dir(directory); QStringList fileList = dir.entryList(QDir::Files,QDir::Name|QDir::IgnoreCase); CReasonerEvaluationDataValue* extractedEvalDataValue = nullptr; foreach (QString fileString, fileList) { QString totalFileString = directory+fileString; CReasonerEvaluationDataValue* tmpEvalDataValue = mExtractor->extractEvaluationData(totalFileString); if (tmpEvalDataValue) { extractedEvalDataValue = tmpEvalDataValue->append(extractedEvalDataValue); } } CReasonerEvaluationDataValue* evalDataValue = nullptr; if (extractedEvalDataValue) { evalDataValue = mSummarizer->summarizeEvaluationData(extractedEvalDataValue); } if (evalDataValue) { group->addRequestDataValue(requestFileString,evalDataValue); return true; } return false; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationTerminationResult.h0000644000175000017500000000461112520551340031002 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTERMINATIONRESULT_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTERMINATIONRESULT_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationTerminationResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationTerminationResult { // public methods public: //! Constructor CReasonerEvaluationTerminationResult(); CReasonerEvaluationTerminationResult* initResult(bool processError, bool inTimeTerminated, bool forcedTermination, const QString& errorText, const QString& stnOutText, const QString& errOutText); bool isInTimeTerminated(); bool isTerminationForced(); bool hasProcessError(); QString getStandardOutputText(); QString getErrorOutputText(); QString getErrorText(); // protected methods protected: // protected variables protected: bool mInTimeTerminated; bool mTerminationForced; bool mProcessError; QString mStandardOutputText; QString mErrorOutputText; QString mErrorText; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONTERMINATIONRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationGNUPlotPlotter.cpp0000644000175000017500000002607412520551326030522 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationGNUPlotPlotter.h" #include "CReasonerEvaluationAnalyseContext.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationGNUPlotPlotter::CReasonerEvaluationGNUPlotPlotter(CReasonerEvaluationAnalyseContext* context) { mContext = context; //mReasCompTemplateString = // "set terminal svg size 1280,800 dynamic enhanced fname 'arial' fsize 10 mousing name \"$$_PLOT_NAME_$$\" butt solid\r\n" // "set output '$$_PLOT_FILE_$$'\r\n" // "set style fill solid 1.00 border lt -1\r\n" // "set style histogram clustered gap 5 title offset character 0, 0, 0\r\n" // "set style data histograms\r\n" // "set xtics border in scale 0,00 nomirror rotate by -45 offset character 0, 0, 0 autojustify\r\n" // "set xtics norangelimit font \",8\"\r\n" // "set title \"$$_PLOT_TITLE_$$\"\r\n" // "set bmargin 12\r\n" // "set grid ytics lt 0 lw 0.2 lc rgb \"#000000\"\r\n" // "plot '$$_PLOT_DATA_$$' "; mReasCompTemplateString = "set terminal svg size 1280,800\r\n" "set output '$$_PLOT_FILE_$$'\r\n" "set style fill solid 1.00 border lt -1\r\n" "set style histogram clustered gap 5 title offset character 0, 0, 0\r\n" "set style data histograms\r\n" "set xtics border in scale 0,00 nomirror rotate by -45 offset character 0, 0, 0 autojustify\r\n" "set xtics norangelimit font \",8\"\r\n" "set title \"$$_PLOT_TITLE_$$\"\r\n" "set bmargin 10\r\n" "set grid ytics lt 0 lw 0.2 lc rgb \"#000000\"\r\n" "plot '$$_PLOT_DATA_$$' "; mReasOverTemplateString = "set terminal svg size 1280,800\r\n" "set output '$$_PLOT_FILE_$$'\r\n" "set title \"$$_PLOT_TITLE_$$\"\r\n" "set log y\r\n" "set grid ytics lt 0 lw 0.2 lc rgb \"#000000\"\r\n" "plot '$$_PLOT_DATA_$$' "; mReasColorHash.insert("FaCT++","#E4FECA"); mReasColorHash.insert("HermiT","#BBD2FF"); mReasColorHash.insert("Pellet","#404040"); mReasColorHash.insert("Konclude","#3784A0"); mReasColorHash.insert("Average","#F7C298"); mReasColorHash.insert("Min","#D5803D"); mReasColorHash.insert("Max","#603326"); } CReasonerEvaluationGNUPlotPlotter::~CReasonerEvaluationGNUPlotPlotter() { } CReasonerEvaluationGNUPlotPlotter* CReasonerEvaluationGNUPlotPlotter::createReasonerComparisonPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile) { QString outputScriptFileString(outputFile+".gpl"); QString outputFileString(outputFile+".svg"); QFile dataFile(dataFileString); QMap reasonerStringIndexMap; if (dataFile.open(QIODevice::ReadOnly)) { QString titleLineString = dataFile.readLine(); cint64 nextIndex = 0; cint64 nextStartPos = 0; cint64 nextEndPos = 0; bool hasNextTitle = true; while (hasNextTitle) { nextEndPos = titleLineString.indexOf("\t",nextStartPos); if (nextEndPos <= -1) { nextEndPos = titleLineString.length(); hasNextTitle = false; } QString nextTitle = titleLineString.mid(nextStartPos,nextEndPos-nextStartPos); nextTitle.replace("\"",""); if (!nextTitle.isEmpty()) { reasonerStringIndexMap.insert(nextTitle,nextIndex++); } nextStartPos = nextEndPos+1; } dataFile.close(); } QFile outputScriptFile(outputScriptFileString); if (outputScriptFile.open(QIODevice::WriteOnly)) { QString plotScriptString = mReasCompTemplateString; QString plotNameString = outputFile; cint64 lastSlashPos = plotNameString.lastIndexOf("/"); if (lastSlashPos >= 0) { plotNameString = plotNameString.mid(lastSlashPos+1); } plotNameString.replace(" ","_"); plotNameString.replace("-table",""); plotNameString.replace("-","_"); plotScriptString.replace("$$_PLOT_NAME_$$",plotNameString); plotScriptString.replace("$$_PLOT_FILE_$$",outputFileString); plotScriptString.replace("$$_PLOT_TITLE_$$",plotTitle); plotScriptString.replace("$$_PLOT_DATA_$$",dataFileString); bool validColorsForAllReasoners = true; QSet usedReasonerColorSet; foreach (QString reasonerString, reasonerNameList) { QString colorString = getColorString(reasonerString,&usedReasonerColorSet); if (colorString.isEmpty()) { validColorsForAllReasoners = false; } } QString colorString = getColorString("Average",&usedReasonerColorSet); if (colorString.isEmpty()) { validColorsForAllReasoners = false; } cint64 reasonerIndex = 0; foreach (QString reasonerString, reasonerNameList) { QString plotReasonerString; if (reasonerIndex++ == 0) { plotReasonerString = QString("using %1:xtic(%2) ti col ").arg(reasonerStringIndexMap.value(reasonerString)+1).arg(reasonerStringIndexMap.value("Requests")+1); } else { plotReasonerString = QString(", '' u %1 ti col ").arg(reasonerStringIndexMap.value(reasonerString)+1); } if (validColorsForAllReasoners) { plotReasonerString += QString("lc rgb \"%1\"").arg(getColorString(reasonerString)); } plotScriptString += plotReasonerString; } if (reasonerStringIndexMap.contains("Index") && reasonerStringIndexMap.contains("Average")) { QString plotAverageString = QString(", '' using %1:%2 with lines title \"Average\" ").arg(reasonerStringIndexMap.value("Index")+1).arg(reasonerStringIndexMap.value("Average")+1); if (validColorsForAllReasoners) { plotAverageString += QString("lc rgb \"%1\" ").arg(getColorString("Average")); } plotAverageString += QString("lw 4\r\n"); plotScriptString += plotAverageString; } outputScriptFile.write(plotScriptString.toLocal8Bit()); outputScriptFile.close(); plotScriptFile(outputScriptFileString); } return this; } CReasonerEvaluationGNUPlotPlotter* CReasonerEvaluationGNUPlotPlotter::createReasonerOverviewPlot(const QString& dataFileString, const QString& plotTitle, const QStringList& reasonerNameList, const QString& outputFile) { QString outputScriptFileString(outputFile+".gpl"); QString outputFileString(outputFile+".svg"); QFile dataFile(dataFileString); QMap reasonerStringIndexMap; if (dataFile.open(QIODevice::ReadOnly)) { QString titleLineString = dataFile.readLine(); cint64 nextIndex = 0; cint64 nextStartPos = 0; cint64 nextEndPos = 0; bool hasNextTitle = true; while (hasNextTitle) { nextEndPos = titleLineString.indexOf("\t",nextStartPos); if (nextEndPos <= -1) { nextEndPos = titleLineString.length(); hasNextTitle = false; } QString nextTitle = titleLineString.mid(nextStartPos,nextEndPos-nextStartPos); nextTitle.replace("\"",""); nextTitle = nextTitle.trimmed(); if (!nextTitle.isEmpty()) { reasonerStringIndexMap.insert(nextTitle,nextIndex++); } nextStartPos = nextEndPos+1; } dataFile.close(); } QFile outputScriptFile(outputScriptFileString); if (outputScriptFile.open(QIODevice::WriteOnly)) { QString plotScriptString = mReasOverTemplateString; QString plotNameString = outputFile; cint64 lastSlashPos = plotNameString.lastIndexOf("/"); if (lastSlashPos >= 0) { plotNameString = plotNameString.mid(lastSlashPos+1); } plotNameString.replace(" ","_"); plotNameString.replace("-table",""); plotNameString.replace("-","_"); plotScriptString.replace("$$_PLOT_NAME_$$",plotNameString); plotScriptString.replace("$$_PLOT_FILE_$$",outputFileString); plotScriptString.replace("$$_PLOT_TITLE_$$",plotTitle); plotScriptString.replace("$$_PLOT_DATA_$$",dataFileString); bool validColorsForAllReasoners = true; QSet usedReasonerColorSet; foreach (QString reasonerString, reasonerNameList) { QString colorString = getColorString(reasonerString,&usedReasonerColorSet); if (colorString.isEmpty()) { validColorsForAllReasoners = false; } } cint64 reasonerIndex = 0; foreach (QString reasonerString, reasonerNameList) { QString plotReasonerString; cint64 reasonerIndexValu = reasonerStringIndexMap.value(reasonerString); if (reasonerIndex++ == 0) { plotReasonerString = QString("using %1:%2 with lines ti col ").arg(reasonerStringIndexMap.value("Index")+1).arg(reasonerStringIndexMap.value(reasonerString)+1); } else { plotReasonerString = QString(", '' u %1 with lines ti col ").arg(reasonerStringIndexMap.value(reasonerString)+1); } if (validColorsForAllReasoners) { plotReasonerString += QString("lc rgb \"%1\"").arg(getColorString(reasonerString)); } plotReasonerString += " lw 3"; plotScriptString += plotReasonerString; } outputScriptFile.write(plotScriptString.toLocal8Bit()); outputScriptFile.close(); plotScriptFile(outputScriptFileString); } return this; } CReasonerEvaluationGNUPlotPlotter* CReasonerEvaluationGNUPlotPlotter::plotScriptFile(const QString& scriptFileString) { QProcess gnuPlotProcess; gnuPlotProcess.start(QString("gnuplot < \"%1\"").arg(scriptFileString)); gnuPlotProcess.waitForFinished(300000); gnuPlotProcess.terminate(); gnuPlotProcess.kill(); return this; } QString CReasonerEvaluationGNUPlotPlotter::getColorString(const QString& reasonerString, QSet* usedReasonerColorSet) { QString reasonerColorString(reasonerString); QString colorString; if (mReasColorHash.contains(reasonerColorString)) { colorString = mReasColorHash.value(reasonerColorString); } else { cint64 versionSplitSpacePos = reasonerColorString.indexOf(" "); if (versionSplitSpacePos >= 0) { reasonerColorString = reasonerColorString.mid(0,versionSplitSpacePos); if (mReasColorHash.contains(reasonerColorString)) { colorString = mReasColorHash.value(reasonerColorString); } } } if (usedReasonerColorSet && !colorString.isEmpty()) { if (usedReasonerColorSet->contains(reasonerColorString)) { colorString.clear(); } else { usedReasonerColorSet->insert(reasonerColorString); } } return colorString; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationManager.cpp0000644000175000017500000000217312520551332027221 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationManager.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationManager::CReasonerEvaluationManager() { } CReasonerEvaluationManager::~CReasonerEvaluationManager() { } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationHTMLNavigationOverviewSummarizer.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationHTMLNavigationOverviewSumma0000644000175000017500000002257612520551332032415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationHTMLNavigationOverviewSummarizer.h" namespace Konclude { namespace Test { namespace Evaluation { CReasonerEvaluationHTMLNavigationOverviewSummarizer::CReasonerEvaluationHTMLNavigationOverviewSummarizer() { mDirLinConString = loadTemplateFromFile("Evaluation/Templates/Navigation/HTMLNavigationOverview/DirectlyLinkedContent.html"); mDirLinOveString = loadTemplateFromFile("Evaluation/Templates/Navigation/HTMLNavigationOverview/DirectlyLinkedOverview.html"); mDirLinSubString = loadTemplateFromFile("Evaluation/Templates/Navigation/HTMLNavigationOverview/DirectlyLinkedSubsection.html"); mDirLinSecString = loadTemplateFromFile("Evaluation/Templates/Navigation/HTMLNavigationOverview/DirectlyLinkedSection.html"); loadConditionedFiltersFromFile("Evaluation/Templates/Navigation/HTMLNavigationOverview/filters-conditioned.txt",&mFilterConditionedHash); loadFiltersFromFile("Evaluation/Templates/Navigation/HTMLNavigationOverview/filters.txt",&mFilterSet); } CReasonerEvaluationHTMLNavigationOverviewSummarizer::~CReasonerEvaluationHTMLNavigationOverviewSummarizer() { } QString CReasonerEvaluationHTMLNavigationOverviewSummarizer::loadTemplateFromFile(const QString& fileString) { QString dataString; QFile file(fileString); if (file.open(QIODevice::ReadOnly)) { dataString = file.readAll(); } return dataString; } bool CReasonerEvaluationHTMLNavigationOverviewSummarizer::loadFiltersFromFile(const QString& fileString, QSet* filterSet) { QFile file(fileString); if (filterSet && file.open(QIODevice::ReadOnly)) { while (!file.atEnd()) { QString filterLine = file.readLine(); if (!filterLine.startsWith("#")) { filterLine = filterLine.trimmed(); if (!filterLine.isEmpty()) { filterSet->insert(filterLine); } } } return true; } return false; } bool CReasonerEvaluationHTMLNavigationOverviewSummarizer::loadConditionedFiltersFromFile(const QString& fileString, QHash* filterConditionedHash) { QFile file(fileString); if (filterConditionedHash && file.open(QIODevice::ReadOnly)) { while (!file.atEnd()) { QString filterLine = file.readLine(); if (!filterLine.startsWith("#")) { filterLine = filterLine.trimmed(); if (!filterLine.isEmpty()) { QStringList filterList = filterLine.split("\t"); if (filterList.count() >= 2) { QString conditionString = filterList.takeFirst(); filterConditionedHash->insertMulti(conditionString,filterList); } } } } return true; } return false; } bool CReasonerEvaluationHTMLNavigationOverviewSummarizer::isAcceptedByFilters(const QString& name) { bool accepted = true; if (!mFilterSet.isEmpty()) { bool oneAccepted = false; for (QSet::const_iterator it = mFilterSet.constBegin(), itEnd = mFilterSet.constEnd(); !oneAccepted && it != itEnd; ++it) { const QString& filterString(*it); if (name.contains(filterString)) { oneAccepted = true; } } accepted &= oneAccepted; } if (!mFilterConditionedHash.isEmpty()) { for (QHash::const_iterator it = mFilterConditionedHash.constBegin(), itEnd = mFilterConditionedHash.constEnd(); accepted && it != itEnd; ++it) { const QString& conditionString(it.key()); const QStringList& filterStringList(it.value()); bool oneAccepted = false; bool noMatch = true; if (name.contains(conditionString)) { noMatch = false; foreach (const QString& filterString, filterStringList) { if (name.contains(filterString)) { oneAccepted = true; } } } if (!noMatch) { accepted &= oneAccepted; } } } return accepted; } QString CReasonerEvaluationHTMLNavigationOverviewSummarizer::createHTMLForDirectory(const QString& directoryString, const QString& relativePathString, const QString& groupFilterString, cint64* addContentCounter) { QString sectionString = mDirLinSecString; QDir directory(directoryString); QStringList subDirStringList = directory.entryList(QDir::Dirs); QStringList fileStringList = directory.entryList(QDir::Files); QString sectionContentsString; cint64 addedContentCount = 0; foreach (const QString& fileString, fileStringList) { if (fileString.endsWith(".html") && isAcceptedByFilters(relativePathString+fileString)) { QString secConString = mDirLinConString; QString titleString = fileString; titleString.replace(".html",""); secConString.replace("$$_CONTENT_LINK_$$",relativePathString+fileString); secConString.replace("$$_CONTENT_TITLE_$$",titleString); sectionContentsString += secConString; ++addedContentCount; } } sectionString.replace("$$_SECTION_CONTENT_$$",sectionContentsString); QString subsectionsString; foreach (const QString& subDirString, subDirStringList) { if (subDirString != "." && subDirString != "..") { bool groupFiltered = false; if (subDirString.contains("Grouped")) { groupFiltered = true; if (subDirString.contains(groupFilterString)) { groupFiltered = false; } } if (!groupFiltered) { cint64 recursiveAddedContentCount = 0; QString subSecSectionString = createHTMLForDirectory(directoryString+subDirString+"/",relativePathString+subDirString+"/",groupFilterString,&recursiveAddedContentCount); if (recursiveAddedContentCount > 0) { addedContentCount += recursiveAddedContentCount; QString subSecString = mDirLinSubString; QString subSecTitleString = subDirString; subSecString.replace("$$_SECTION_TITLE_$$",subSecTitleString); subSecString.replace("$$_SECTIONS_$$",subSecSectionString); subsectionsString += subSecString; } } } } if (addContentCounter) { *addContentCounter = addedContentCount; } sectionString.replace("$$_SUBSECTIONS_$$",subsectionsString); return sectionString; } CReasonerEvaluationHTMLNavigationOverviewSummarizer* CReasonerEvaluationHTMLNavigationOverviewSummarizer::createHTMLNavigationOverview(const QString& directory, const QString& evaluationProgramName, const QStringList& reasonerNameList, const QStringList& filterNameList, cint64 testTimeout, cint64 testCount) { QString outputDir = directory; if (!outputDir.endsWith("/")) { outputDir.append("/"); } QStringList groupFilterList; groupFilterList.append(""); groupFilterList.append("Directory"); groupFilterList.append("Expressiveness"); groupFilterList.append("Profile"); foreach (const QString& groupString, groupFilterList) { QString outputFileString; if (!groupString.isEmpty()) { outputFileString = outputDir+QString("Only%1Grouped-DirectlyLinkedNavigationOverview.html").arg(groupString); } else { outputFileString = outputDir+QString("DirectlyLinkedNavigationOverview.html"); } QFile outputNavFile(outputFileString); if (outputNavFile.open(QIODevice::WriteOnly)) { outputNavFile.close(); } } foreach (const QString& groupString, groupFilterList) { QString outputFileString; if (!groupString.isEmpty()) { outputFileString = outputDir+QString("Only%1Grouped-DirectlyLinkedNavigationOverview.html").arg(groupString); } else { outputFileString = outputDir+QString("DirectlyLinkedNavigationOverview.html"); } QFile outputNavFile(outputFileString); if (outputNavFile.open(QIODevice::WriteOnly)) { QString overviewNavString = mDirLinOveString; overviewNavString.replace("$$_TEST_COUNT_$$",QString::number(testCount)); overviewNavString.replace("$$_TEST_TIMEOUT_$$",QString::number(testTimeout)); overviewNavString.replace("$$_EVALUATION_PROGRAM_$$",evaluationProgramName); overviewNavString.replace("$$_TEST_REASONERS_$$",reasonerNameList.join(", ")); overviewNavString.replace("$$_TEST_DATE_$$",QDateTime::currentDateTime().toString()); overviewNavString.replace("$$_TEST_VERSION_$$",CKoncludeInfo::getKoncludeVersionString()); overviewNavString.replace("$$_TEST_FILTERS_$$",filterNameList.join(", ")); QString sectionString = createHTMLForDirectory(outputDir,"",groupString); overviewNavString.replace("$$_SECTIONS_$$",sectionString); outputNavFile.write(overviewNavString.toLocal8Bit()); outputNavFile.close(); } } return this; } }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Evaluation/CReasonerEvaluationRequestResult.h0000644000175000017500000000526012520551334030145 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTRESULT_H #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTRESULT_H // Libraries includes // Namespace includes #include "EvaluationSettings.h" #include "CReasonerEvaluationRequestResponse.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Test { namespace Evaluation { /*! * * \class CReasonerEvaluationRequestResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationRequestResult { // public methods public: //! Constructor CReasonerEvaluationRequestResult(); ~CReasonerEvaluationRequestResult(); CReasonerEvaluationRequestResult* addResponse(CReasonerEvaluationRequestResponse* response, bool initRequestResponse); QList* getResponseList(); cint64 getResponseTime(); bool getResponsedInTime(); CReasonerEvaluationRequestResult* setResponseTime(cint64 responseTime); CReasonerEvaluationRequestResult* setResponsedInTime(bool responsedInTime); bool hasSucessfullReasonerCommunication(); CReasonerEvaluationRequestResult* setSucessfullReasonerCommunication(bool sucessfull); // protected methods protected: // protected variables protected: QList mInitResponseList; QList mResponseList; cint64 mResponseTime; bool mResponsedInTime; bool mResponseError; bool mSucessfullCommunication; // private methods private: // private variables private: }; }; // end namespace Evaluation }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestfileTester.h0000644000175000017500000000715412520551350024127 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CREASONERTESTFILETESTER_H #define KONCLUDE_TEST_CREASONERTESTFILETESTER_H // Libraries includes #include #include // Namespace includes #include "CReasonerTestfileEvaluator.h" // Other includes #include "Test/Events/CTestTestfileEvent.h" #include "Test/Events/CEvaluateTestfileTestEvent.h" #include "Concurrent/CIntervalThread.h" #include "Config/CConfiguration.h" #include "Control/Command/Instructions/CTestTestfileCommand.h" #include "Control/Command/CCommandRecordRouter.h" #include "Control/Command/Records/CStartProcessCommandRecord.h" #include "Control/Command/Records/CStopProcessCommandRecord.h" #include "Control/Command/Records/CFinishProcessCommandRecord.h" #include "Control/Command/Records/CUnspecifiedMessageInformationRecord.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Config; using namespace Concurrent; using namespace Control::Command; using namespace Control::Command::Records; using namespace Control::Command::Instructions; namespace Test { using namespace Test::Events; /*! * * \class CReasonerTestfileTester * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerTestfileTester : public CIntervalThread, public CLogIdentifier { Q_OBJECT // public methods public: //! Constructor CReasonerTestfileTester(CConfiguration *config, CWatchDog *watchDog = 0); //! Destructor virtual ~CReasonerTestfileTester(); virtual CReasonerTestfileTester *realizeTestCommand(CTestTestfileCommand *command, CReasonerTestfileEvaluator *testEvaluator); // protected methods protected: virtual bool processTimer(qint64 timerID); virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); // protected variables protected: QString testfile; QProcess *testProcess; CReasonerTestfileEvaluator *evaluator; CReasonerTestfileTest *testfileTest; CTestTestfileCommand *testCommand; CCommandRecordRouter *commandRecordRouter; QString reasonerString; QString reasonerConfigString; qint64 wCount; bool processCrashed; bool processTimedout; qint64 closeTimeout; qint64 killTimeout; qint64 runTimeout; const static qint64 TIMERCLOSEPROCESSID = 1; // private methods private: void startTestfileTest(); void evaluateTestfileTest(); virtual void sendEvaluateTestfileTestEvent(); virtual void sendStartTestfileTestEvent(); // private methods private slots: void processError(QProcess::ProcessError error); void processFinished(int exitCode, QProcess::ExitStatus exitStatus); // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_CREASONERTESTFILETESTER_H Konclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestfileTest.cpp0000644000175000017500000000523312520551350024127 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerTestfileTest.h" namespace Konclude { namespace Test { CReasonerTestfileTest::CReasonerTestfileTest() { testExeCount = 1; timeout = 0; testResult = new CReasonerTestfileTestResult(); } CReasonerTestfileTest::~CReasonerTestfileTest() { delete testResult; } QString CReasonerTestfileTest::getTestRequestFile() { return testRequestFile; } CReasonerTestfileTest *CReasonerTestfileTest::setTestRequestFile(const QString &requestFile) { testRequestFile = requestFile; return this; } bool CReasonerTestfileTest::hasTestRequestFile() { return !testRequestFile.isEmpty(); } QString CReasonerTestfileTest::getTestExpectedResponseFile() { return expectedResponseFile; } CReasonerTestfileTest *CReasonerTestfileTest::setTestExpectedResponseFile(const QString &responseFile) { expectedResponseFile = responseFile; return this; } bool CReasonerTestfileTest::hasTestExpectedResponseFile() { return !expectedResponseFile.isEmpty(); } qint64 CReasonerTestfileTest::getTestLoopCount() { return testExeCount; } CReasonerTestfileTest *CReasonerTestfileTest::setTestLoopCount(qint64 loopCount) { testExeCount = loopCount; return this; } CReasonerTestfileTestResult *CReasonerTestfileTest::getTestResults() { return testResult; } QString CReasonerTestfileTest::getWorkingDirectory() { return workDir; } CReasonerTestfileTest *CReasonerTestfileTest::setWorkingDirectory(const QString &workingDir) { workDir = workingDir; return this; } bool CReasonerTestfileTest::hasWorkingDirectory() { return !workDir.isEmpty(); } qint64 CReasonerTestfileTest::getTimeout() { return timeout; } CReasonerTestfileTest *CReasonerTestfileTest::setTimeout(qint64 testTimeout) { timeout = testTimeout; return this; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CHashModificationThread.h0000644000175000017500000000577712520551344024037 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CHASHMODIFICATIONTHREAD_H #define KONCLUDE_TEST_CHASHMODIFICATIONTHREAD_H // Libraries includes #include // Namespace includes // Other includes #include "Utilities/Container/CQtHash.h" #include "Utilities/Container/CQtManagedRestrictedModificationHash.h" #include "Utilities/Memory/CObjectAllocator.h" #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/UtilitiesSettings.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; using namespace Utilities; using namespace Utilities::Container; using namespace Utilities::Memory; namespace Test { /*! * * \class CHashModificationThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CHashModificationThread : public QThread { // public methods public: //! Constructor CHashModificationThread(CQtHash** qtOriginalHashes, cint64 hashesCount, cint64 modificationCountPerStep, bool extendBaseHashes); CHashModificationThread(CQtManagedRestrictedModificationHash** qtModifiedHashes, cint64 hashesCount, CMemoryPoolProvider* memoryPoolProvider, cint64 modificationCountPerStep, bool extendBaseHashes); //! Destructor virtual ~CHashModificationThread(); virtual void startModifications(); virtual void stopModifications(); cint64 getModificationStepsCount(); // protected methods protected: virtual void run(); // protected variables protected: cint64 mModificationSteps; CQtHash** mQtOriginalHashes; CQtManagedRestrictedModificationHash** mQtModifiedHashes; CMemoryPoolProvider* mMemoryPoolProvider; bool mUseModifiedHashes; cint64 mHashesCount; CMemoryPoolAllocationManager* mMemoryPoolAllocationMan; CContextBase* mContextBase; bool mCanceled; cint64 mHashModSize; cint64 mModificationCountPerStep; bool mExtendBaseHashes; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude using namespace Konclude::Test; #endif // KONCLUDE_TEST_CHASHMODIFICATIONTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkConsistencyRequestGenerator.h0000644000175000017500000000437312520551346027632 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLFILEOWLLINKCONSISTENCYREQUESTGENERATOR_H #define KONCLUDE_TEST_COWLFILEOWLLINKCONSISTENCYREQUESTGENERATOR_H // Libraries includes #include #include #include #include // Namespace includes // Other includes #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" using namespace std; namespace Konclude { using namespace Config; using namespace Concurrent; namespace Test { /*! * * \class COWLFileOWLlinkConsistencyRequestGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLFileOWLlinkConsistencyRequestGenerator : public CLogIdentifier { // public methods public: //! Constructor COWLFileOWLlinkConsistencyRequestGenerator(CConfiguration *config); //! Destructor virtual ~COWLFileOWLlinkConsistencyRequestGenerator(); bool generateOWLlinkConsistencyRequest(const QString& requestFileName, const QString& responseFileName); // protected methods protected: QDomDocument createRequestDocument(); // protected variables protected: CConfiguration* mConfig; QString mReasonerTestKBName; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLFILEOWLLINKCONSISTENCYREQUESTGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/COWLRecursionTestDataGenerator.h0000644000175000017500000000542412520551350025314 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLRECURSIONTESTDATAGENERATOR_H #define KONCLUDE_TEST_COWLRECURSIONTESTDATAGENERATOR_H // Libraries includes #include // Namespace includes #include "Utilities/UtilitiesSettings.h" // Other includes #include // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Logger; using namespace Utilities; namespace Test { /*! * * \class COWLRecursionTestDataGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLRecursionTestDataGenerator : public CLogIdentifier { // public methods public: //! Constructor COWLRecursionTestDataGenerator(); //! Destructor virtual ~COWLRecursionTestDataGenerator(); void generateData(cint64 size, double rate, const QString& filename); // protected methods protected: void createLargeJoinData(cint64 size, double rate); void createIndividualDeclarations(cint64 size); void createPropertyDeclarations(); void createPropertyAssertions(const QString& propertyName, cint64 count, cint64 maxNumber); void createPropertyCycleAssertions(const QString& propertyName, cint64 maxNumber); void writePropertyDeclaration(const QString& propertyName); void writeIndividualDeclaration(const QString& indiviualName); void writeIndividualPropertyAssertion(const QString& propertyName, const QString& indiviualName1, const QString& indiviualName2); QString getIndividualName(cint64 indiNumber); // protected variables protected: QString owllinkNS; QString owlNS; cint64 mIndividualsNumberSize; QString mIndividualBaseName; QString mPropertyBaseName; QXmlStreamWriter* mXMLWriter; QSet< QPair > mPropPairSet; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLRECURSIONTESTDATAGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkIncrementalAssertionRequestGenerator.cpp0000644000175000017500000002667012520551346032021 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLFileOWLlinkIncrementalAssertionRequestGenerator.h" namespace Konclude { namespace Test { COWLFileOWLlinkIncrementalAssertionRequestGenerator::COWLFileOWLlinkIncrementalAssertionRequestGenerator(CConfiguration *config) : CLogIdentifier("::Konclude::Test::OWLFileOWLlinkIncrementalAssertionRequestGenerator",this),mConfig(config) { mReasonerTestKBName = "http://www.konclude.com/evaluation-testsuite/test-ontology"; } COWLFileOWLlinkIncrementalAssertionRequestGenerator::~COWLFileOWLlinkIncrementalAssertionRequestGenerator() { } QDomDocument COWLFileOWLlinkIncrementalAssertionRequestGenerator::createRequestDocument() { QDomDocument document; QString owllinkNS = "http://www.owllink.org/owllink#"; QString owlNS = "http://www.w3.org/2002/07/owl#"; QDomElement rootNode; rootNode = document.createElementNS(owllinkNS,"RequestMessage"); //rootNode.setAttributeNS("xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttribute("xmlns:owl",owlNS); document.appendChild(rootNode); return document; } QList COWLFileOWLlinkIncrementalAssertionRequestGenerator::loadOntologyAssertions(const QString& requestFileName) { QList assertionList; QFile ontologyFile(requestFileName); QDomDocument ontologyDocument; if (ontologyDocument.setContent(&ontologyFile,true)) { QDomElement rootElement = ontologyDocument.documentElement(); QDomElement nextElement = rootElement.firstChildElement(); while (!nextElement.isNull()) { QString tagName = nextElement.tagName(); bool isAssertionNode = false; if (tagName == "ClassAssertion" || tagName == "ObjectPropertyAssertion" || tagName == "SameIndividual" || tagName == "DifferentIndividuals") { isAssertionNode = true; } else if (tagName == "DataPropertyAssertion" || tagName == "NegativeDataPropertyAssertion" || tagName == "NegativeObjectPropertyAssertion") { isAssertionNode = true; } if (isAssertionNode) { assertionList.append(nextElement); } nextElement = nextElement.nextSiblingElement(); } } return assertionList; } bool COWLFileOWLlinkIncrementalAssertionRequestGenerator::generateOWLlinkIncrementalAssertionRequests(const QString& requestFileName, const QString& responseFileName, double removeAssertionPercentage, double addAssertionPercentage, cint64 testCount) { bool generatedTestfiles = false; QList assertionList = loadOntologyAssertions(requestFileName); cint64 assertionCount = assertionList.count(); cint64 removeAssertionCount = assertionCount*removeAssertionPercentage; cint64 addAssertionCount = assertionCount*addAssertionPercentage; addAssertionCount = qMax((cint64)1,addAssertionCount); removeAssertionCount = qMax((cint64)1,removeAssertionCount); if (assertionList.count() > removeAssertionCount + addAssertionCount) { cint64 slashIndex = qMax(requestFileName.lastIndexOf("/"),requestFileName.lastIndexOf("\\")); QString fileNameString = requestFileName; if (slashIndex >= 0) { fileNameString = requestFileName.mid(slashIndex+1); } uint randInitNumber = 0; for (QString::const_iterator it = requestFileName.constBegin(), itEnd = requestFileName.constEnd(); it != itEnd; ++it) { QChar nameChar(*it); randInitNumber += nameChar.unicode(); } qsrand(randInitNumber); for (cint64 testNr = 0; testNr < testCount; ++testNr) { cint64 removalNrHashCode = 0; cint64 additionNrHashCode = 0; QList removalAssertionList; QList additionAssertionList; QSet assertionNrSet; for (cint64 remNr = 0; remNr < removeAssertionCount; ++remNr) { cint64 nextAssertionNr = (double)qrand() / (double)RAND_MAX * (double)(assertionCount-1); removalNrHashCode += nextAssertionNr; if (!assertionNrSet.contains(nextAssertionNr)) { assertionNrSet.insert(nextAssertionNr); QDomElement nextAssertionNode = assertionList.at(nextAssertionNr); removalAssertionList.append(nextAssertionNode); } } for (cint64 addNr = 0; addNr < addAssertionCount; ++addNr) { cint64 nextAssertionNr = (double)qrand() / (double)RAND_MAX * (double)(assertionCount-1); additionNrHashCode += nextAssertionNr; if (!assertionNrSet.contains(nextAssertionNr)) { assertionNrSet.insert(nextAssertionNr); QDomElement nextAssertionNode = assertionList.at(nextAssertionNr); additionAssertionList.append(nextAssertionNode); } } QString addRemTestFileAppendix = QString("%1~#%2-%3~#%4").arg(addAssertionCount).arg(additionNrHashCode).arg(removeAssertionCount).arg(removalNrHashCode); QString testResponseFileName = QString(responseFileName).arg(addRemTestFileAppendix); generatedTestfiles |= generateOWLlinkIncrementalAssertionConsistencyRequest(requestFileName,testResponseFileName,removalAssertionList,additionAssertionList); } } return generatedTestfiles; } bool COWLFileOWLlinkIncrementalAssertionRequestGenerator::generateOWLlinkIncrementalAssertionRequests(const QString& requestFileName, const QString& responseFileName, cint64 removeAssertionCount, cint64 addAssertionCount, cint64 testCount) { bool generatedTestfiles = false; QList assertionList = loadOntologyAssertions(requestFileName); cint64 assertionCount = assertionList.count(); if (assertionList.count() > removeAssertionCount + addAssertionCount) { for (cint64 testNr = 0; testNr < testCount; ++testNr) { cint64 removalNrHashCode = 0; cint64 additionNrHashCode = 0; QList removalAssertionList; QList additionAssertionList; QSet assertionNrSet; for (cint64 remNr = 0; remNr < removeAssertionCount; ++remNr) { cint64 nextAssertionNr = (double)qrand() / (double)RAND_MAX * (double)(assertionCount-1); removalNrHashCode += nextAssertionNr; if (!assertionNrSet.contains(nextAssertionNr)) { assertionNrSet.insert(nextAssertionNr); QDomElement nextAssertionNode = assertionList.at(nextAssertionNr); removalAssertionList.append(nextAssertionNode); } } for (cint64 addNr = 0; addNr < addAssertionCount; ++addNr) { cint64 nextAssertionNr = (double)qrand() / (double)RAND_MAX * (double)(assertionCount-1); additionNrHashCode += nextAssertionNr; if (!assertionNrSet.contains(nextAssertionNr)) { assertionNrSet.insert(nextAssertionNr); QDomElement nextAssertionNode = assertionList.at(nextAssertionNr); additionAssertionList.append(nextAssertionNode); } } QString addRemTestFileAppendix = QString("%1~#%2-%3~#%4").arg(addAssertionCount).arg(additionNrHashCode).arg(removeAssertionCount).arg(removalNrHashCode); QString testResponseFileName = QString(responseFileName).arg(addRemTestFileAppendix); generatedTestfiles |= generateOWLlinkIncrementalAssertionConsistencyRequest(requestFileName,testResponseFileName,removalAssertionList,additionAssertionList); } } return generatedTestfiles; } bool COWLFileOWLlinkIncrementalAssertionRequestGenerator::generateOWLlinkIncrementalAssertionConsistencyRequest(const QString& requestFileName, const QString& responseFileName, QList& removalAssertionList, QList& additionAssertionList) { QDomDocument requestDocument = createRequestDocument(); QDomElement rootElement = requestDocument.documentElement(); QDomElement cKBElement = requestDocument.createElement("CreateKB"); cKBElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(cKBElement); QDomElement loadElement = requestDocument.createElement("LoadOntologies"); loadElement.setAttribute("kb",mReasonerTestKBName); QDomElement ontoIRIElement = requestDocument.createElement("OntologyIRI"); ontoIRIElement.setAttribute("IRI",QString("file:%1").arg(requestFileName)); loadElement.appendChild(ontoIRIElement); rootElement.appendChild(loadElement); QDomElement retractAdditionsElement = requestDocument.createElement("Retract"); retractAdditionsElement.setAttribute("kb",mReasonerTestKBName); for (QList::const_iterator addIt = additionAssertionList.constBegin(), addItEnd = additionAssertionList.constEnd(); addIt != addItEnd; ++addIt) { QDomElement assertionElement(*addIt); QDomNode importedAssertionElement = requestDocument.importNode(assertionElement,true); retractAdditionsElement.appendChild(importedAssertionElement); } rootElement.appendChild(retractAdditionsElement); QDomElement reasonElement = getFirstReasoningRequestNode(requestDocument); rootElement.appendChild(reasonElement); QDomElement tellAdditionsElement = requestDocument.createElement("Tell"); tellAdditionsElement.setAttribute("kb",mReasonerTestKBName); for (QList::const_iterator addIt = additionAssertionList.constBegin(), addItEnd = additionAssertionList.constEnd(); addIt != addItEnd; ++addIt) { QDomElement assertionElement(*addIt); QDomNode importedAssertionElement = requestDocument.importNode(assertionElement,true); tellAdditionsElement.appendChild(importedAssertionElement); } rootElement.appendChild(tellAdditionsElement); QDomElement retractRemovalElement = requestDocument.createElement("Retract"); retractRemovalElement.setAttribute("kb",mReasonerTestKBName); for (QList::const_iterator remIt = removalAssertionList.constBegin(), remItEnd = removalAssertionList.constEnd(); remIt != remItEnd; ++remIt) { QDomElement assertionElement(*remIt); QDomNode importedAssertionElement = requestDocument.importNode(assertionElement,true); retractRemovalElement.appendChild(importedAssertionElement); } rootElement.appendChild(retractRemovalElement); QDomElement incReasonElement = getSecondReasoningRequestNode(requestDocument); rootElement.appendChild(incReasonElement); QDomElement releaseKBElement = requestDocument.createElement("ReleaseKB"); releaseKBElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(releaseKBElement); QFile outFile(responseFileName); if (outFile.open(QIODevice::WriteOnly)) { outFile.write(requestDocument.toByteArray()); outFile.close(); } LOG(INFO,getLogDomain(),logTr("Generated OWLlink incremental assertion %3 request '%1' for ontology '%2'.").arg(responseFileName).arg(requestFileName).arg(mRequestTypeName),this); return false; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/0000755000175000017500000000000012613407262020600 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDataDescription.cpp0000644000175000017500000000604012520551310025770 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseDataDescription.h" namespace Konclude { namespace Test { namespace Analyse { CAnalyseDataDescription::CAnalyseDataDescription() { } CAnalyseDataDescription::~CAnalyseDataDescription() { qDeleteAll(valueUpdateDesVec); } QString CAnalyseDataDescription::getDataName() { return dataName; } CAnalyseDataDescription *CAnalyseDataDescription::setDataName(const QString &name) { dataName = name; return this; } CAnalyseValueDescription *CAnalyseDataDescription::getValueDescription(const QString &valueName) { qint64 index = desNameIndexHash.value(valueName,-1); return getValueDescription(index); } CAnalyseValueDescription *CAnalyseDataDescription::getValueDescription(qint64 index) { if (index < 0 || index >= valueUpdateDesVec.count()) { return 0; } CAnalyseValueDescription *valueDes = 0; CAnalyseUpdateDescription *analyseUpdateDes = valueUpdateDesVec[index]; if (analyseUpdateDes) { valueDes = analyseUpdateDes->getValueDescription(); } return valueDes; } CAnalyseUpdateDescription *CAnalyseDataDescription::getUpdateDescription(qint64 index) { if (index < 0 || index >= valueUpdateDesVec.count()) { return 0; } CAnalyseUpdateDescription *analyseUpdateDes = valueUpdateDesVec[index]; return analyseUpdateDes; } CAnalyseUpdateDescription *CAnalyseDataDescription::installValueDescription(CAnalyseValueDescription *valueDescription, CAnalyseValueUpdateReader *updateReader) { qint64 nextIdx = valueUpdateDesVec.count(); QString name = valueDescription->getValueName(); desNameIndexHash.insert(name,nextIdx); CAnalyseUpdateDescription *updDes = new CAnalyseUpdateDescription(); updDes->setValueDescription(valueDescription); updDes->setValueIndex(nextIdx); updDes->setUpdateReader(updateReader); valueUpdateDesVec.append(updDes); return updDes; } qint64 CAnalyseDataDescription::getAnalyseValueCount() { return valueUpdateDesVec.count(); } CAnalyseData *CAnalyseDataDescription::createData() { CAnalyseData *data = new CAnalyseData(getAnalyseValueCount(),this); return data; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser.h0000644000175000017500000000425712520551314032241 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser_H #define KONCLUDE_TEST_ANALYSE_CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser_H // Libraries includes #include // Namespace includes #include "CMinMaxAvgLimitedCountValueAnalyser.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser : public CMinMaxAvgLimitedCountValueAnalyser { // public methods public: //! Constructor CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser(qint64 valueLimit, double minOffset = 0., double maxOffset = 0.1); //! Destructor virtual ~CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser(); virtual double getMaxValue(); virtual double getMinValue(); // protected methods protected: // protected variables protected: double minOff; double maxOff; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CDoubleAnalyseValue.h0000644000175000017500000000451012520551314024573 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CDOUBLEANALYSEVALUE_H #define KONCLUDE_TEST_ANALYSE_CDOUBLEANALYSEVALUE_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CConvertIntegerAnalyseValue.h" #include "CConvertDoubleAnalyseValue.h" #include "CConvertStringAnalyseValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CDoubleAnalyseValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDoubleAnalyseValue : virtual public CConvertDoubleAnalyseValue, virtual public CConvertIntegerAnalyseValue { // public methods public: //! Constructor CDoubleAnalyseValue(); CDoubleAnalyseValue(double doubleValue); //! Destructor virtual ~CDoubleAnalyseValue(); virtual QString getString(); virtual bool parseFromString(const QString &string); virtual qint64 getInteger(); virtual bool parseFromInteger(qint64 integer); virtual double getDouble(); virtual bool parseFromDouble(double doubleValue); virtual CAnalyseValue *createCopy(); // protected methods protected: // protected variables protected: double doubleVal; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CDOUBLEANALYSEVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CMinMaxFixedAvgCountValueAnalyser.h0000644000175000017500000000447312520551314027373 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CMINMAXFIXEDAVGCOUNTVALUEANALYSER_H #define KONCLUDE_TEST_ANALYSE_CMINMAXFIXEDAVGCOUNTVALUEANALYSER_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseValue.h" #include "CValueAnalyser.h" #include "CConvertDoubleAnalyseValue.h" #include "CIntegerAnalyseValue.h" #include "CDoubleAnalyseValue.h" #include "CMinMaxAvgCountValueAnalyser.h" #include "CMinMaxAvgLimitedCountValueAnalyser.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CMinMaxFixedAvgCountValueAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMinMaxFixedAvgCountValueAnalyser : public CMinMaxAvgLimitedCountValueAnalyser { // public methods public: //! Constructor CMinMaxFixedAvgCountValueAnalyser(double minValueLimit, double maxValueLimit, qint64 valueCountLimit); //! Destructor virtual ~CMinMaxFixedAvgCountValueAnalyser(); virtual double getMaxValue(); virtual double getMinValue(); // protected methods protected: // protected variables protected: double minLimit; double maxLimit; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CMINMAXFIXEDAVGCOUNTVALUEANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CMinMaxFixedAvgCountValueAnalyser.cpp0000644000175000017500000000300312520551314027712 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMinMaxFixedAvgCountValueAnalyser.h" namespace Konclude { namespace Test { namespace Analyse { CMinMaxFixedAvgCountValueAnalyser::CMinMaxFixedAvgCountValueAnalyser(double minValueLimit, double maxValueLimit, qint64 valueCountLimit) : CMinMaxAvgLimitedCountValueAnalyser(valueCountLimit) { minLimit = minValueLimit; maxLimit = maxValueLimit; } CMinMaxFixedAvgCountValueAnalyser::~CMinMaxFixedAvgCountValueAnalyser() { } double CMinMaxFixedAvgCountValueAnalyser::getMaxValue() { return maxLimit; } double CMinMaxFixedAvgCountValueAnalyser::getMinValue() { return minLimit; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDataUpdateItem.h0000644000175000017500000000452512520551312025223 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CANALYSEDATAUPDATEITEM_H #define KONCLUDE_TEST_ANALYSE_CANALYSEDATAUPDATEITEM_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseDataSeries.h" #include "CAnalyseDataObserver.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CAnalyseDataUpdateItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseDataUpdateItem { // public methods public: //! Constructor CAnalyseDataUpdateItem(CAnalyseDataSeries *analyseDataSeries, qint64 interval, qint64 timerID); //! Destructor virtual ~CAnalyseDataUpdateItem(); virtual CAnalyseDataSeries *getAnalyseDataSeries(); virtual qint64 getUpdateInterval(); virtual qint64 getTimerID(); virtual CAnalyseDataUpdateItem *addUpdateObserver(CAnalyseDataObserver *dataUpdateObserver); virtual CAnalyseDataUpdateItem *notifyObserversDataUpdate(); // protected methods protected: // protected variables protected: CAnalyseDataSeries *dataSeries; qint64 updateInterval; qint64 timerUpdateID; QLinkedList observerList; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CANALYSEDATAUPDATEITEM_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/AnalyseSettings.h0000644000175000017500000000315412520551310024060 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_ANALYSESETTINGS #define KONCLUDE_TEST_ANALYSE_ANALYSESETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Test { namespace Analyse { /*! * * \file AnalyseSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CAnalyseData; class CAnalyseDataDescription; class CAnalyseValue; class CAnalyseValueDescription; class CAnalyseDescription; class CAnalyseValueUpdateReader; class CAnalyseDataUpdateItem; class CAnalyseDataObserver; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // end KONCLUDE_TEST_ANALYSE_ANALYSESETTINGS Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseData.h0000644000175000017500000000451512520551310023236 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CANALYSEDATA_H #define KONCLUDE_TEST_ANALYSE_CANALYSEDATA_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseDataDescription.h" #include "CAnalyseValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CAnalyseData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseData { // public methods public: //! Constructor CAnalyseData(qint64 valueCount, CAnalyseDataDescription *dataDes); //! Destructor virtual ~CAnalyseData(); virtual CAnalyseDataDescription *getDataDescription(); virtual CAnalyseData *setDataDescription(CAnalyseDataDescription *dataDes); virtual CAnalyseData *setValue(qint64 index, CAnalyseValue *takeValue); virtual CAnalyseValue *getValue(qint64 index); virtual CAnalyseValue *createInstalledValue(CAnalyseUpdateDescription *valueDes); virtual CAnalyseValue *createInstalledValue(qint64 valueDesIndex); // protected methods protected: // protected variables protected: CAnalyseDataDescription *description; CAnalyseValue **values; qint64 valCount; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CANALYSEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDataSeries.cpp0000644000175000017500000000326112520551310024741 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseDataSeries.h" namespace Konclude { namespace Test { namespace Analyse { CAnalyseDataSeries::CAnalyseDataSeries() { dataLinker = 0; } CAnalyseDataSeries::~CAnalyseDataSeries() { } CAnalyseDataLinker *CAnalyseDataSeries::getAnalyseDataLinker() { return dataLinker; } CAnalyseDataSeries *CAnalyseDataSeries::addAnalyseData(CAnalyseDataLinker *analyseDataLinker) { dataLinker = (CAnalyseDataLinker *)analyseDataLinker->getLastListLink()->insertNext(dataLinker); return this; } CAnalyseDataSeries *CAnalyseDataSeries::setAnalyseDataDescription(CAnalyseDataDescription *dataDescription) { dataDes = dataDescription; return this; } CAnalyseDataDescription *CAnalyseDataSeries::getAnalyseDataDescription() { return dataDes; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseData.cpp0000644000175000017500000000544012520551310023567 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseData.h" namespace Konclude { namespace Test { namespace Analyse { CAnalyseData::CAnalyseData(qint64 valueCount, CAnalyseDataDescription *dataDes) { valCount = valueCount; values = new CAnalyseValue *[valueCount]; for (qint64 i = 0; i < valCount; ++i) { values[i] = 0; } description = dataDes; } CAnalyseData::~CAnalyseData() { for (qint64 i = 0; i < valCount; ++i) { if (values[i]) { delete values[i]; } } if (values) { delete values; } } CAnalyseData *CAnalyseData::setValue(qint64 index, CAnalyseValue *takeValue) { if (index < 0 || index >= valCount) { // can not set value } else { if (values[index]) { delete values[index]; } values[index] = takeValue; } return this; } CAnalyseDataDescription *CAnalyseData::getDataDescription() { return description; } CAnalyseData *CAnalyseData::setDataDescription(CAnalyseDataDescription *dataDes) { description = dataDes; return this; } CAnalyseValue *CAnalyseData::getValue(qint64 index) { if (index < 0 || index >= valCount) { return 0; } return values[index]; } CAnalyseValue *CAnalyseData::createInstalledValue(CAnalyseUpdateDescription *valueDes) { CAnalyseValue *value = 0; qint64 index = valueDes->getValueIndex(); value = getValue(index); if (!value) { value = valueDes->createValue(); setValue(index,value); } return value; } CAnalyseValue *CAnalyseData::createInstalledValue(qint64 valueDesIndex) { CAnalyseValue *value = 0; qint64 index = valueDesIndex; value = getValue(valueDesIndex); if (!value) { CAnalyseUpdateDescription *valueDes = description->getUpdateDescription(valueDesIndex); if (valueDes) { value = valueDes->createValue(); setValue(index,value); } } return value; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser.c0000644000175000017500000000322612520551314032227 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser.h" namespace Konclude { namespace Test { namespace Analyse { CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser::CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser(qint64 valueLimit, double minOffset, double maxOffset) : CMinMaxAvgLimitedCountValueAnalyser(valueLimit) { minOff = minOffset; maxOff = maxOffset; } CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser::~CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser() { } double CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser::getMaxValue() { double diff = maxVal-minVal; return maxVal+diff*maxOff; } double CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser::getMinValue() { double diff = maxVal-minVal; return minVal-diff*minOff; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseValue.cpp0000644000175000017500000000206212520551312023771 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseValue.h" namespace Konclude { namespace Test { namespace Analyse { CAnalyseValue::CAnalyseValue() { } CAnalyseValue::~CAnalyseValue() { } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CConvertIntegerAnalyseValue.cpp0000644000175000017500000000175112520551312026654 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConvertIntegerAnalyseValue.h" namespace Konclude { namespace Test { namespace Analyse { }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDataObserver.h0000644000175000017500000000356512520551310024752 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CANALYSEDATAOBSERVER_H #define KONCLUDE_TEST_ANALYSE_CANALYSEDATAOBSERVER_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseDataSeries.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CAnalyseDataObserver * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseDataObserver { // public methods public: //! Constructor CAnalyseDataObserver(); //! Destructor virtual ~CAnalyseDataObserver(); virtual CAnalyseDataObserver *notifyDataUpdate(CAnalyseDataSeries *data) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CANALYSEDATAOBSERVER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDataLinker.h0000644000175000017500000000361012520551310024376 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CANALYSEDATALINKER_H #define KONCLUDE_TEST_ANALYSE_CANALYSEDATALINKER_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" // Other includes #include "Utilities/CLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Utilities; namespace Test { namespace Analyse { /*! * * \class CAnalyseDataLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseDataLinker : public CLinker { // public methods public: //! Constructor CAnalyseDataLinker(); //! Destructor virtual ~CAnalyseDataLinker(); virtual CAnalyseDataLinker *getNextAnalyseData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CANALYSEDATALINKER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDataUpdater.cpp0000644000175000017500000000713112520551312025115 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseDataUpdater.h" namespace Konclude { namespace Test { namespace Analyse { CAnalyseDataUpdater::CAnalyseDataUpdater() : CIntervalThread("Analyse-Data-Updater") { nextTimerID = 1; startThread(); waitSynchronization(); } CAnalyseDataUpdater::~CAnalyseDataUpdater() { stopThread(); } CAnalyseDataUpdater *CAnalyseDataUpdater::installAnalyseDataUpdate(CAnalyseDataSeries *dataSeries, qint64 updateInterval) { timerMutex.lock(); qint64 timerID = nextTimerID++; CAnalyseDataUpdateItem *analyseDataUpdateItem = new CAnalyseDataUpdateItem(dataSeries,updateInterval,timerID); analyseUpdateHash.insert(dataSeries,analyseDataUpdateItem); timerIDUpdateHash.insert(timerID,analyseDataUpdateItem); timerMutex.unlock(); startTimerWithInterval(timerID,updateInterval); return this; } CAnalyseDataUpdater *CAnalyseDataUpdater::installAnalyseDataUpdateObserver(CAnalyseDataSeries *dataSeries, CAnalyseDataObserver *observer) { timerMutex.lock(); CAnalyseDataUpdateItem *updateItem = analyseUpdateHash.value(dataSeries,0); if (updateItem) { updateItem->addUpdateObserver(observer); } timerMutex.unlock(); return this; } bool CAnalyseDataUpdater::processTimer(qint64 timerID) { bool timerProcessed = false; timerMutex.lock(); if (timerIDUpdateHash.contains(timerID)) { CAnalyseDataUpdateItem *analyseDataUpdateItem = timerIDUpdateHash.value(timerID); if (analyseDataUpdateItem) { CAnalyseDataSeries *dataSeries = analyseDataUpdateItem->getAnalyseDataSeries(); if (dataSeries) { CAnalyseDataDescription *dataDes = dataSeries->getAnalyseDataDescription(); if (dataDes) { CAnalyseData *newAnalyseData = dataDes->createData(); qint64 valueCount = dataDes->getAnalyseValueCount(); for (int i = 0; i < valueCount; ++i) { CAnalyseValueDescription *valueDes = dataDes->getValueDescription(i); CAnalyseUpdateDescription *updateDes = dataDes->getUpdateDescription(i); if (valueDes && updateDes) { CAnalyseValueUpdateReader *updateReader = updateDes->getUpdateReader(); if (updateReader) { CAnalyseValue *analyseValue = updateReader->getAnalyseValueUpdate(valueDes); if (analyseValue) { newAnalyseData->setValue(i,analyseValue); } } } } CAnalyseDataLinker *dataLinker = new CAnalyseDataLinker(); dataSeries->addAnalyseData((CAnalyseDataLinker *)(dataLinker->init(newAnalyseData))); analyseDataUpdateItem->notifyObserversDataUpdate(); } } } timerProcessed = true; } timerMutex.unlock(); return timerProcessed; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDataDescription.h0000644000175000017500000000523112520551310025436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CANALYSEDATADESCRIPTION_H #define KONCLUDE_TEST_ANALYSE_CANALYSEDATADESCRIPTION_H // Libraries includes #include #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseDescription.h" #include "CAnalyseValueDescription.h" #include "CAnalyseUpdateDescription.h" #include "CAnalyseData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CAnalyseDataDescription * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseDataDescription : public CAnalyseDescription { // public methods public: //! Constructor CAnalyseDataDescription(); //! Destructor virtual ~CAnalyseDataDescription(); virtual QString getDataName(); virtual CAnalyseDataDescription *setDataName(const QString &name); virtual CAnalyseValueDescription *getValueDescription(qint64 index); virtual CAnalyseValueDescription *getValueDescription(const QString &valueName); virtual CAnalyseUpdateDescription *installValueDescription(CAnalyseValueDescription *valueDescription, CAnalyseValueUpdateReader *updateReader = 0); virtual CAnalyseUpdateDescription *getUpdateDescription(qint64 index); virtual CAnalyseData *createData(); virtual qint64 getAnalyseValueCount(); // protected methods protected: // protected variables protected: QString dataName; QVector valueUpdateDesVec; QHash desNameIndexHash; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CANALYSEDATADESCRIPTION_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseValueDescription.cpp0000644000175000017500000000355712520551312026207 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseValueDescription.h" namespace Konclude { namespace Test { namespace Analyse { CAnalyseValueDescription::CAnalyseValueDescription() { templateValue = 0; } CAnalyseValueDescription::~CAnalyseValueDescription() { if (templateValue) { delete templateValue; } } QString CAnalyseValueDescription::getValueName() { return valName; } CAnalyseValueDescription *CAnalyseValueDescription::setValueName(const QString &valueName) { valName = valueName; return this; } CAnalyseValue *CAnalyseValueDescription::getTemplateValue() { return templateValue; } CAnalyseValueDescription *CAnalyseValueDescription::setTemplateValue(CAnalyseValue *takeTemplateValue) { templateValue = takeTemplateValue; return this; } CAnalyseValue *CAnalyseValueDescription::createValue() { CAnalyseValue *genValue = 0; if (templateValue) { genValue = templateValue->createCopy(); } return genValue; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CConvertDoubleAnalyseValue.h0000644000175000017500000000362712520551312026142 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CCONVERTDOUBLEANALYSEVALUE_H #define KONCLUDE_TEST_ANALYSE_CCONVERTDOUBLEANALYSEVALUE_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseValue.h" #include "CConvertStringAnalyseValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CConvertDoubleAnalyseValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConvertDoubleAnalyseValue : virtual public CConvertStringAnalyseValue { // public methods public: //! Constructor virtual double getDouble() = 0; virtual bool parseFromDouble(double doubleValue) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CCONVERTDOUBLEANALYSEVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CMinMaxAvgLimitedCountValueAnalyser.h0000644000175000017500000000453312520551314027720 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CMINMAXAVGLIMITEDCOUNTVALUEANALYSER_H #define KONCLUDE_TEST_ANALYSE_CMINMAXAVGLIMITEDCOUNTVALUEANALYSER_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseValue.h" #include "CValueAnalyser.h" #include "CConvertDoubleAnalyseValue.h" #include "CIntegerAnalyseValue.h" #include "CDoubleAnalyseValue.h" #include "CMinMaxAvgCountValueAnalyser.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CMinMaxAvgLimitedCountValueAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMinMaxAvgLimitedCountValueAnalyser : public CMinMaxAvgCountValueAnalyser { // public methods public: //! Constructor CMinMaxAvgLimitedCountValueAnalyser(qint64 valueLimit); //! Destructor virtual ~CMinMaxAvgLimitedCountValueAnalyser(); virtual CValueAnalyser *analyseValue(double value); virtual CMinMaxAvgLimitedCountValueAnalyser *setValueLimit(qint64 valueLimit); virtual qint64 getValueLimit(); // protected methods protected: // protected variables protected: QLinkedList values; qint64 valLimit; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CMINMAXAVGLIMITEDCOUNTVALUEANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CConvertDoubleAnalyseValue.cpp0000644000175000017500000000175212520551312026472 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConvertDoubleAnalyseValue.h" namespace Konclude { namespace Test { namespace Analyse { }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDataUpdateItem.cpp0000644000175000017500000000364412520551312025557 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseDataUpdateItem.h" namespace Konclude { namespace Test { namespace Analyse { CAnalyseDataUpdateItem::CAnalyseDataUpdateItem(CAnalyseDataSeries *analyseDataSeries, qint64 interval, qint64 timerID) { dataSeries = analyseDataSeries; updateInterval = interval; timerUpdateID = timerID; } CAnalyseDataUpdateItem::~CAnalyseDataUpdateItem() { } CAnalyseDataSeries *CAnalyseDataUpdateItem::getAnalyseDataSeries() { return dataSeries; } qint64 CAnalyseDataUpdateItem::getUpdateInterval() { return updateInterval; } qint64 CAnalyseDataUpdateItem::getTimerID() { return timerUpdateID; } CAnalyseDataUpdateItem *CAnalyseDataUpdateItem::addUpdateObserver(CAnalyseDataObserver *dataUpdateObserver) { observerList.append(dataUpdateObserver); return this; } CAnalyseDataUpdateItem *CAnalyseDataUpdateItem::notifyObserversDataUpdate() { foreach (CAnalyseDataObserver *observer, observerList) { observer->notifyDataUpdate(dataSeries); } return this; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/0000755000175000017500000000000012613407262022002 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CTaskReserveQueueUpdateReader.h0000644000175000017500000000517612520551310030007 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_READER_CTASKRESERVEQUEUEUPDATEREADER_H #define KONCLUDE_TEST_ANALYSE_READER_CTASKRESERVEQUEUEUPDATEREADER_H // Libraries includes #include // Namespace includes // Other includes #include "Test/Analyse/AnalyseSettings.h" #include "Test/Analyse/CAnalyseValue.h" #include "Test/Analyse/CAnalyseValueUpdateReader.h" #include "Test/Analyse/CAnalyseValueDescription.h" #include "Test/Analyse/CIntegerAnalyseValue.h" #include "Test/Analyse/CConvertStringAnalyseValue.h" #include "Scheduler/CTaskReserveQueue.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Scheduler; namespace Test { namespace Analyse { namespace Reader { /*! * * \class CTaskReserveQueueUpdateReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskReserveQueueUpdateReader : public CAnalyseValueUpdateReader { // public methods public: //! Constructor CTaskReserveQueueUpdateReader(CTaskReserveQueue* taskQueue, const QString& queueName); //! Destructor virtual ~CTaskReserveQueueUpdateReader(); virtual CAnalyseValue* getAnalyseValueUpdate(CAnalyseValueDescription* valueDes); virtual CAnalyseValueDescription* getReserveScheduleTaskCountValueDescription(); // protected methods protected: // protected variables protected: CAnalyseValueDescription* mReserveScheduleTaskCountValueDescription; CTaskReserveQueue* mTaskQueue; QString mQueueName; // private methods private: // private variables private: }; }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_READER_CTASKRESERVEQUEUEUPDATEREADER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CClassificationProgressUpdateReader.h0000644000175000017500000000657012520551306031230 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_READER_CCLASSIFICATIONPROGRESSUPDATEREADER_H #define KONCLUDE_TEST_ANALYSE_READER_CCLASSIFICATIONPROGRESSUPDATEREADER_H // Libraries includes #include // Namespace includes // Other includes #include "Test/Analyse/AnalyseSettings.h" #include "Test/Analyse/CAnalyseValue.h" #include "Test/Analyse/CAnalyseValueUpdateReader.h" #include "Test/Analyse/CAnalyseValueDescription.h" #include "Test/Analyse/CIntegerAnalyseValue.h" #include "Test/Analyse/CConvertStringAnalyseValue.h" #include "Test/Analyse/CDoubleAnalyseValue.h" #include "Reasoner/Classifier/CClassificationManager.h" #include "Reasoner/Classifier/CClassifierStatistics.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Reasoner::Classifier; namespace Test { namespace Analyse { namespace Reader { /*! * * \class CClassificationProgressUpdateReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationProgressUpdateReader : public CAnalyseValueUpdateReader { // public methods public: //! Constructor CClassificationProgressUpdateReader(CClassificationManager *classificationManager); //! Destructor virtual ~CClassificationProgressUpdateReader(); virtual CAnalyseValue *getAnalyseValueUpdate(CAnalyseValueDescription *valueDes); virtual CAnalyseValueDescription *getTotalSubsumptionTestCountValueDescription(); virtual CAnalyseValueDescription *getTestedSubsumptionCountValueDescription(); virtual CAnalyseValueDescription *getTotalSatisfiableTestCountValueDescription(); virtual CAnalyseValueDescription *getTestedSatisfiableCountValueDescription(); virtual CAnalyseValueDescription *getActiveClassifierCountValueDescription(); // protected methods protected: // protected variables protected: CClassificationManager *classiMan; CAnalyseValueDescription *totalSubsumValueDescription; CAnalyseValueDescription *totalSatisValueDescription; CAnalyseValueDescription *testedSubsumValueDescription; CAnalyseValueDescription *testedSatisValueDescription; CAnalyseValueDescription *activeClassifierCountValueDescription; CClassifierStatistics *statistics; // private methods private: // private variables private: }; }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_READER_CCLASSIFICATIONPROGRESSUPDATEREADER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CTaskProcesserBlockingCountUpdateReader.h0000644000175000017500000000527612520551306032024 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_READER_CTASKPROCESSERBLOCKINGCOUNTUPDATEREADER_H #define KONCLUDE_TEST_ANALYSE_READER_CTASKPROCESSERBLOCKINGCOUNTUPDATEREADER_H // Libraries includes #include // Namespace includes // Other includes #include "Test/Analyse/AnalyseSettings.h" #include "Test/Analyse/CAnalyseValue.h" #include "Test/Analyse/CAnalyseValueUpdateReader.h" #include "Test/Analyse/CAnalyseValueDescription.h" #include "Test/Analyse/CIntegerAnalyseValue.h" #include "Test/Analyse/CConvertStringAnalyseValue.h" #include "Scheduler/CTaskProcessorThreadBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Scheduler; namespace Test { namespace Analyse { namespace Reader { /*! * * \class CTaskProcesserBlockingCountUpdateReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskProcesserBlockingCountUpdateReader : public CAnalyseValueUpdateReader { // public methods public: //! Constructor CTaskProcesserBlockingCountUpdateReader(QList* taskProcessorList); //! Destructor virtual ~CTaskProcesserBlockingCountUpdateReader(); virtual CAnalyseValue* getAnalyseValueUpdate(CAnalyseValueDescription* valueDes); virtual CAnalyseValueDescription* getBlockedProcessorCountValueDescription(); // protected methods protected: // protected variables protected: CAnalyseValueDescription* mBlockedProcessorCountValueDescription; QList mTaskProcessorList; // private methods private: // private variables private: }; }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_READER_CTASKPROCESSERBLOCKINGCOUNTUPDATEREADER_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CCalculationTableauCompletionAlgorithmUpdateReader.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CCalculationTableauCompletionAlgorithmUpda0000644000175000017500000001370712520551312032300 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationTableauCompletionAlgorithmUpdateReader.h" namespace Konclude { namespace Test { namespace Analyse { namespace Reader { CCalculationTableauCompletionAlgorithmUpdateReader::CCalculationTableauCompletionAlgorithmUpdateReader(CCalculationTableauCompletionTaskHandleAlgorithm *algorithm) { alg = algorithm; atmostRuleCountValueDescription = 0; atleastRuleCountValueDescription = 0; orRuleCountValueDescription = 0; andRuleCountValueDescription = 0; someRuleCountValueDescription = 0; allRuleCountValueDescription = 0; rulesCountValueDescription = 0; if (alg) { atmostRuleCountValueDescription = new CAnalyseValueDescription(); atmostRuleCountValueDescription->setValueName(QString("Algorithm::AtmostAppliedCount")); atmostRuleCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); atleastRuleCountValueDescription = new CAnalyseValueDescription(); atleastRuleCountValueDescription->setValueName(QString("Algorithm::AtleastAppliedCount")); atleastRuleCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); orRuleCountValueDescription = new CAnalyseValueDescription(); orRuleCountValueDescription->setValueName(QString("Algorithm::OrAppliedCount")); orRuleCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); andRuleCountValueDescription = new CAnalyseValueDescription(); andRuleCountValueDescription->setValueName(QString("Algorithm::AndAppliedCount")); andRuleCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); someRuleCountValueDescription = new CAnalyseValueDescription(); someRuleCountValueDescription->setValueName(QString("Algorithm::SomeAppliedCount")); someRuleCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); allRuleCountValueDescription = new CAnalyseValueDescription(); allRuleCountValueDescription->setValueName(QString("Algorithm::AllAppliedCount")); allRuleCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); rulesCountValueDescription = new CAnalyseValueDescription(); rulesCountValueDescription->setValueName(QString("Algorithm::TotalRulesAppliedCount")); rulesCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); } } CCalculationTableauCompletionAlgorithmUpdateReader::~CCalculationTableauCompletionAlgorithmUpdateReader() { if (alg) { delete atmostRuleCountValueDescription; delete atleastRuleCountValueDescription; delete orRuleCountValueDescription; delete andRuleCountValueDescription; delete someRuleCountValueDescription; delete allRuleCountValueDescription; delete rulesCountValueDescription; } } CAnalyseValueDescription *CCalculationTableauCompletionAlgorithmUpdateReader::getAtmostRuleCountValueDescription() { return atmostRuleCountValueDescription; } CAnalyseValueDescription *CCalculationTableauCompletionAlgorithmUpdateReader::getAtleastRuleCountValueDescription() { return atleastRuleCountValueDescription; } CAnalyseValueDescription *CCalculationTableauCompletionAlgorithmUpdateReader::getOrRuleCountValueDescription() { return orRuleCountValueDescription; } CAnalyseValueDescription *CCalculationTableauCompletionAlgorithmUpdateReader::getAndRuleCountValueDescription() { return andRuleCountValueDescription; } CAnalyseValueDescription *CCalculationTableauCompletionAlgorithmUpdateReader::getAllRuleCountValueDescription() { return allRuleCountValueDescription; } CAnalyseValueDescription *CCalculationTableauCompletionAlgorithmUpdateReader::getSomeRuleCountValueDescription() { return someRuleCountValueDescription; } CAnalyseValueDescription *CCalculationTableauCompletionAlgorithmUpdateReader::getRulesCountValueDescription() { return rulesCountValueDescription; } CAnalyseValue *CCalculationTableauCompletionAlgorithmUpdateReader::getAnalyseValueUpdate(CAnalyseValueDescription *valueDes) { CAnalyseValue *val = 0; if (valueDes == atmostRuleCountValueDescription && alg) { val = new CIntegerAnalyseValue(alg->getAppliedATMOSTRuleCount()); } else if (valueDes == atleastRuleCountValueDescription && alg) { val = new CIntegerAnalyseValue(alg->getAppliedATLEASTRuleCount()); } else if (valueDes == orRuleCountValueDescription && alg) { val = new CIntegerAnalyseValue(alg->getAppliedORRuleCount()); } else if (valueDes == andRuleCountValueDescription && alg) { val = new CIntegerAnalyseValue(alg->getAppliedANDRuleCount()); } else if (valueDes == someRuleCountValueDescription && alg) { val = new CIntegerAnalyseValue(alg->getAppliedSOMERuleCount()); } else if (valueDes == allRuleCountValueDescription && alg) { val = new CIntegerAnalyseValue(alg->getAppliedALLRuleCount()); } else if (valueDes == rulesCountValueDescription && alg) { val = new CIntegerAnalyseValue(alg->getAppliedTotalRuleCount()); } return val; } }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CClassificationStatusUpdateReader.h0000644000175000017500000000530112520551306030676 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_READER_CCLASSIFICATIONSTATUSUPDATEREADER_H #define KONCLUDE_TEST_ANALYSE_READER_CCLASSIFICATIONSTATUSUPDATEREADER_H // Libraries includes #include // Namespace includes // Other includes #include "Test/Analyse/AnalyseSettings.h" #include "Test/Analyse/CAnalyseValue.h" #include "Test/Analyse/CAnalyseValueUpdateReader.h" #include "Test/Analyse/CAnalyseValueDescription.h" #include "Test/Analyse/CConvertStringAnalyseValue.h" #include "Test/Analyse/CStringAnalyseValue.h" #include "Reasoner/Classifier/CClassificationManager.h" #include "Reasoner/Classifier/CClassifierStatistics.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Reasoner::Classifier; namespace Test { namespace Analyse { namespace Reader { /*! * * \class CClassificationStatusUpdateReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationStatusUpdateReader : public CAnalyseValueUpdateReader { // public methods public: //! Constructor CClassificationStatusUpdateReader(CSubsumptionClassifier *subsumptionClassifier); //! Destructor virtual ~CClassificationStatusUpdateReader(); virtual CAnalyseValue *getAnalyseValueUpdate(CAnalyseValueDescription *valueDes); virtual CAnalyseValueDescription *getSubsumptionClassifierStatusDescription(); // protected methods protected: // protected variables protected: CSubsumptionClassifier *subsumClassifier; CAnalyseValueDescription *statusValueDescription; // private methods private: // private variables private: }; }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_READER_CCLASSIFICATIONSTATUSUPDATEREADER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CThreadTimesUpdateReader.cpp0000644000175000017500000000643612520551310027310 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CThreadTimesUpdateReader.h" namespace Konclude { namespace Test { namespace Analyse { namespace Reader { CThreadTimesUpdateReader::CThreadTimesUpdateReader(CThread *thread) { observedThread = thread; waitTimeValueDescription = 0; blockTimeValueDescription = 0; runTimeValueDescription = 0; if (observedThread) { waitTimeValueDescription = new CAnalyseValueDescription(); waitTimeValueDescription->setValueName(observedThread->getThreadName()+QString("-WaitTime")); waitTimeValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); blockTimeValueDescription = new CAnalyseValueDescription(); blockTimeValueDescription->setValueName(observedThread->getThreadName()+QString("-BlockTime")); blockTimeValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); runTimeValueDescription = new CAnalyseValueDescription(); runTimeValueDescription->setValueName(observedThread->getThreadName()+QString("-RunTime")); runTimeValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); } } CThreadTimesUpdateReader::~CThreadTimesUpdateReader() { if (waitTimeValueDescription) { delete waitTimeValueDescription; } if (blockTimeValueDescription) { delete blockTimeValueDescription; } if (runTimeValueDescription) { delete runTimeValueDescription; } } CAnalyseValueDescription *CThreadTimesUpdateReader::getWaitTimeValueDescription() { return waitTimeValueDescription; } CAnalyseValueDescription *CThreadTimesUpdateReader::getBlockTimeValueDescription() { return blockTimeValueDescription; } CAnalyseValueDescription *CThreadTimesUpdateReader::getRunTimeValueDescription() { return runTimeValueDescription; } CAnalyseValue *CThreadTimesUpdateReader::getAnalyseValueUpdate(CAnalyseValueDescription *valueDes) { CAnalyseValue *val = 0; if (valueDes == waitTimeValueDescription && observedThread) { val = new CIntegerAnalyseValue(observedThread->getWaitTimeSecs()); } else if (valueDes == blockTimeValueDescription && observedThread) { val = new CIntegerAnalyseValue(observedThread->getBlockTimeSecs()); } else if (valueDes == runTimeValueDescription && observedThread) { val = new CIntegerAnalyseValue(observedThread->getRunTimeSecs()); } return val; } }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CReasonerWorkloadUpdateReader.cpp0000644000175000017500000000657012520551306030364 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerWorkloadUpdateReader.h" namespace Konclude { namespace Test { namespace Analyse { namespace Reader { CReasonerWorkloadUpdateReader::CReasonerWorkloadUpdateReader(CAnalyseReasonerManager *reasonerManager) { reasoner = reasonerManager; queryProgressDescription = 0; queryTotalWorkDescription = 0; queryClosedWorkDescription = 0; if (reasoner) { queryProgressDescription = new CAnalyseValueDescription(); queryProgressDescription->setValueName(QString("ReasonerManager::QueryProgress")); queryProgressDescription->setTemplateValue(new CDoubleAnalyseValue(0.)); queryTotalWorkDescription = new CAnalyseValueDescription(); queryTotalWorkDescription->setValueName(QString("ReasonerManager::QueryTotalWorkCount")); queryTotalWorkDescription->setTemplateValue(new CDoubleAnalyseValue(0.)); queryClosedWorkDescription = new CAnalyseValueDescription(); queryClosedWorkDescription->setValueName(QString("ReasonerManager::QueryCalculatedWorkCount")); queryClosedWorkDescription->setTemplateValue(new CDoubleAnalyseValue(0.)); } } CReasonerWorkloadUpdateReader::~CReasonerWorkloadUpdateReader() { if (queryProgressDescription) { delete queryProgressDescription; } if (queryTotalWorkDescription) { delete queryTotalWorkDescription; } if (queryClosedWorkDescription) { delete queryClosedWorkDescription; } } CAnalyseValueDescription *CReasonerWorkloadUpdateReader::getQueryTotalWorkCountValueDescription() { return queryTotalWorkDescription; } CAnalyseValueDescription *CReasonerWorkloadUpdateReader::getQueryCalcedWorkCountValueDescription() { return queryClosedWorkDescription; } CAnalyseValueDescription *CReasonerWorkloadUpdateReader::getQueryProgressValueDescription() { return queryProgressDescription; } CAnalyseValue *CReasonerWorkloadUpdateReader::getAnalyseValueUpdate(CAnalyseValueDescription *valueDes) { CAnalyseValue *val = 0; if (valueDes == queryProgressDescription && reasoner) { val = new CDoubleAnalyseValue(reasoner->getQueryProgress()); } else if (valueDes == queryTotalWorkDescription && reasoner) { val = new CDoubleAnalyseValue(reasoner->getQueryTotalWorkCount()); } else if (valueDes == queryClosedWorkDescription && reasoner) { val = new CDoubleAnalyseValue(reasoner->getQueryCalculatedWorkCount()); } return val; } }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CAnalyseValueMinMaxAvgExtendedUpdateReader.hKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CAnalyseValueMinMaxAvgExtendedUpdateReader0000644000175000017500000000577112520551306032146 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_READER_CANALYSEVALUEMINMAXAVGEXTENDEDUPDATEREADER_H #define KONCLUDE_TEST_ANALYSE_READER_CANALYSEVALUEMINMAXAVGEXTENDEDUPDATEREADER_H // Libraries includes #include // Namespace includes // Other includes #include "Test/Analyse/AnalyseSettings.h" #include "Test/Analyse/CAnalyseValue.h" #include "Test/Analyse/CAnalyseValueUpdateReader.h" #include "Test/Analyse/CAnalyseValueDescription.h" #include "Test/Analyse/CDoubleAnalyseValue.h" #include "Test/Analyse/CConvertStringAnalyseValue.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { namespace Reader { /*! * * \class CAnalyseValueMinMaxAvgExtendedUpdateReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseValueMinMaxAvgExtendedUpdateReader : public CAnalyseValueUpdateReader { // public methods public: //! Constructor CAnalyseValueMinMaxAvgExtendedUpdateReader(CAnalyseValueDescription *valueDes, CAnalyseValueUpdateReader *updateReader); //! Destructor virtual ~CAnalyseValueMinMaxAvgExtendedUpdateReader(); virtual CAnalyseValue *getAnalyseValueUpdate(CAnalyseValueDescription *valueDes) = 0; virtual CAnalyseValueDescription *getMinValueDescription(); virtual CAnalyseValueDescription *getMaxValueDescription(); virtual CAnalyseValueDescription *getAvgValueDescription(); // protected methods protected: // protected variables protected: CAnalyseValueDescription *valueDescription; CAnalyseValueDescription *minValueDescription; CAnalyseValueDescription *maxValueDescription; CAnalyseValueDescription *avgValueDescription; CAnalyseValueUpdateReader *reader; double minVal; double maxVal; double avgVal; qint64 valCount; bool hasMinMaxAvg; // private methods private: // private variables private: }; }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_READER_CANALYSEVALUEMINMAXAVGEXTENDEDUPDATEREADER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CReasonerWorkloadUpdateReader.h0000644000175000017500000000575512520551306030035 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_READER_CREASONERWORKLOADUPDATEREADER_H #define KONCLUDE_TEST_ANALYSE_READER_CREASONERWORKLOADUPDATEREADER_H // Libraries includes #include // Namespace includes // Other includes #include "Test/Analyse/AnalyseSettings.h" #include "Test/Analyse/CAnalyseValue.h" #include "Test/Analyse/CAnalyseValueUpdateReader.h" #include "Test/Analyse/CAnalyseValueDescription.h" #include "Test/Analyse/CIntegerAnalyseValue.h" #include "Test/Analyse/CConvertStringAnalyseValue.h" #include "Test/Analyse/CDoubleAnalyseValue.h" #include "Reasoner/Kernel/Manager/CAnalyseReasonerManager.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Scheduler; using namespace Reasoner::Kernel; using namespace Reasoner::Kernel::Manager; namespace Test { namespace Analyse { namespace Reader { /*! * * \class CReasonerWorkloadUpdateReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerWorkloadUpdateReader : public CAnalyseValueUpdateReader { // public methods public: //! Constructor CReasonerWorkloadUpdateReader(CAnalyseReasonerManager *reasonerManager); //! Destructor virtual ~CReasonerWorkloadUpdateReader(); virtual CAnalyseValue *getAnalyseValueUpdate(CAnalyseValueDescription *valueDes); virtual CAnalyseValueDescription *getQueryTotalWorkCountValueDescription(); virtual CAnalyseValueDescription *getQueryCalcedWorkCountValueDescription(); virtual CAnalyseValueDescription *getQueryProgressValueDescription(); // protected methods protected: // protected variables protected: CAnalyseReasonerManager *reasoner; CAnalyseValueDescription *queryProgressDescription; CAnalyseValueDescription *queryTotalWorkDescription; CAnalyseValueDescription *queryClosedWorkDescription; // private methods private: // private variables private: }; }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_READER_CREASONERWORKLOADUPDATEREADER_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CTaskProcesserBlockingCountUpdateReader.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CTaskProcesserBlockingCountUpdateReader.cp0000644000175000017500000000461012520551306032166 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskProcesserBlockingCountUpdateReader.h" namespace Konclude { namespace Test { namespace Analyse { namespace Reader { CTaskProcesserBlockingCountUpdateReader::CTaskProcesserBlockingCountUpdateReader(QList* taskProcessorList) { mTaskProcessorList = *taskProcessorList; mBlockedProcessorCountValueDescription = nullptr; if (!mTaskProcessorList.isEmpty()) { mBlockedProcessorCountValueDescription = new CAnalyseValueDescription(); mBlockedProcessorCountValueDescription->setValueName(QString("::BlockedThreadCount")); mBlockedProcessorCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); } } CTaskProcesserBlockingCountUpdateReader::~CTaskProcesserBlockingCountUpdateReader() { delete mBlockedProcessorCountValueDescription; } CAnalyseValueDescription* CTaskProcesserBlockingCountUpdateReader::getBlockedProcessorCountValueDescription() { return mBlockedProcessorCountValueDescription; } CAnalyseValue *CTaskProcesserBlockingCountUpdateReader::getAnalyseValueUpdate(CAnalyseValueDescription* valueDes) { CAnalyseValue *val = 0; if (valueDes == mBlockedProcessorCountValueDescription) { cint64 blockCount = 0; foreach (CTaskProcessorThreadBase* taskProcessor, mTaskProcessorList) { if (taskProcessor->isBlocked()) { ++blockCount; } } val = new CIntegerAnalyseValue(blockCount); } return val; } }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader.hKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CConcurrentOccurenceUnsatisfiableCacheTest0000644000175000017500000000575312520551306032305 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_READER_CCONCURRENTOCCURENCEUNSATISFIABLECACHETESTPERFORMANCEREADER_H #define KONCLUDE_TEST_ANALYSE_READER_CCONCURRENTOCCURENCEUNSATISFIABLECACHETESTPERFORMANCEREADER_H // Libraries includes #include // Namespace includes // Other includes #include "Test/Analyse/AnalyseSettings.h" #include "Test/Analyse/CAnalyseValue.h" #include "Test/Analyse/CAnalyseValueUpdateReader.h" #include "Test/Analyse/CAnalyseValueDescription.h" #include "Test/Analyse/CIntegerAnalyseValue.h" #include "Test/Analyse/CConvertStringAnalyseValue.h" #include "Test/Analyse/CDoubleAnalyseValue.h" #include "Test/CConcurrentOccurenceUnsatisfiableCacheTester.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { namespace Reader { /*! * * \class CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader : public CAnalyseValueUpdateReader { // public methods public: //! Constructor CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader(CConcurrentOccurenceUnsatisfiableCacheTester *unsatCacheTester); //! Destructor virtual ~CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader(); virtual CAnalyseValue *getAnalyseValueUpdate(CAnalyseValueDescription *valueDes); virtual CAnalyseValueDescription *getCacheWritesCountValueDescription(); virtual CAnalyseValueDescription *getCacheReadsCountValueDescription(); // protected methods protected: // protected variables protected: CConcurrentOccurenceUnsatisfiableCacheTester *cacheTester; CAnalyseValueDescription *cacheWritesDescription; CAnalyseValueDescription *cacheReadsDescription; // private methods private: // private variables private: }; }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_READER_CCONCURRENTOCCURENCEUNSATISFIABLECACHETESTPERFORMANCEREADER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CClassificationStatusUpdateReader.cpp0000644000175000017500000000417612520551306031242 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationStatusUpdateReader.h" namespace Konclude { namespace Test { namespace Analyse { namespace Reader { CClassificationStatusUpdateReader::CClassificationStatusUpdateReader(CSubsumptionClassifier *subsumptionClassifier) { subsumClassifier = subsumptionClassifier; statusValueDescription = 0; if (subsumClassifier) { statusValueDescription = new CAnalyseValueDescription(); statusValueDescription->setValueName(QString("SubsumptionClassifier::StatusText")); statusValueDescription->setTemplateValue(new CStringAnalyseValue(0)); } } CClassificationStatusUpdateReader::~CClassificationStatusUpdateReader() { if (statusValueDescription) { delete statusValueDescription; } } CAnalyseValueDescription *CClassificationStatusUpdateReader::getSubsumptionClassifierStatusDescription() { return statusValueDescription; } CAnalyseValue *CClassificationStatusUpdateReader::getAnalyseValueUpdate(CAnalyseValueDescription *valueDes) { CAnalyseValue *val = 0; if (valueDes == statusValueDescription && subsumClassifier) { val = new CStringAnalyseValue(subsumClassifier->getStatusString()); } return val; } }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CThreadTimesUpdateReader.h0000644000175000017500000000535512520551310026754 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_READER_CTHREADTIMESUPDATEREADER_H #define KONCLUDE_TEST_ANALYSE_READER_CTHREADTIMESUPDATEREADER_H // Libraries includes #include // Namespace includes // Other includes #include "Test/Analyse/AnalyseSettings.h" #include "Test/Analyse/CAnalyseValue.h" #include "Test/Analyse/CAnalyseValueUpdateReader.h" #include "Test/Analyse/CAnalyseValueDescription.h" #include "Test/Analyse/CIntegerAnalyseValue.h" #include "Test/Analyse/CConvertStringAnalyseValue.h" #include "Concurrent/CThread.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Concurrent; namespace Test { namespace Analyse { namespace Reader { /*! * * \class CThreadTimesUpdateReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CThreadTimesUpdateReader : public CAnalyseValueUpdateReader { // public methods public: //! Constructor CThreadTimesUpdateReader(CThread *thread); //! Destructor virtual ~CThreadTimesUpdateReader(); virtual CAnalyseValue *getAnalyseValueUpdate(CAnalyseValueDescription *valueDes); virtual CAnalyseValueDescription *getWaitTimeValueDescription(); virtual CAnalyseValueDescription *getBlockTimeValueDescription(); virtual CAnalyseValueDescription *getRunTimeValueDescription(); // protected methods protected: // protected variables protected: CThread *observedThread; CAnalyseValueDescription *waitTimeValueDescription; CAnalyseValueDescription *blockTimeValueDescription; CAnalyseValueDescription *runTimeValueDescription; // private methods private: // private variables private: }; }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_READER_CTHREADTIMESUPDATEREADER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CClassificationStatisticsUpdateReader.h0000644000175000017500000000740712520551306031556 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_READER_CCLASSIFICATIONSTATISTICSUPDATEREADER_H #define KONCLUDE_TEST_ANALYSE_READER_CCLASSIFICATIONSTATISTICSUPDATEREADER_H // Libraries includes #include // Namespace includes // Other includes #include "Test/Analyse/AnalyseSettings.h" #include "Test/Analyse/CAnalyseValue.h" #include "Test/Analyse/CAnalyseValueUpdateReader.h" #include "Test/Analyse/CAnalyseValueDescription.h" #include "Test/Analyse/CIntegerAnalyseValue.h" #include "Test/Analyse/CConvertStringAnalyseValue.h" #include "Test/Analyse/CDoubleAnalyseValue.h" #include "Reasoner/Classifier/CClassificationManager.h" #include "Reasoner/Classifier/CClassifierStatistics.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Reasoner::Classifier; namespace Test { namespace Analyse { namespace Reader { /*! * * \class CClassificationStatisticsUpdateReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationStatisticsUpdateReader : public CAnalyseValueUpdateReader { // public methods public: //! Constructor CClassificationStatisticsUpdateReader(CClassificationManager *classificationManager); //! Destructor virtual ~CClassificationStatisticsUpdateReader(); virtual CAnalyseValue *getAnalyseValueUpdate(CAnalyseValueDescription *valueDes); virtual CAnalyseValueDescription *getPseudoModelMergedTestedSubsumptionCountValueDescription(); virtual CAnalyseValueDescription *getSubclassTestedSubsumptionCountValueDescription(); virtual CAnalyseValueDescription *getSubclassIdentifierOccurTestedSubsumptionCountValueDescription(); virtual CAnalyseValueDescription *getDerivatedTestedSubsumptionCountValueDescription(); virtual CAnalyseValueDescription *getCalculatedTestedSubsumptionCountValueDescription(); virtual CAnalyseValueDescription *getPrunedTestedSubsumptionCountValueDescription(); virtual CAnalyseValueDescription *getToldSubsumptionCountValueDescription(); // protected methods protected: // protected variables protected: CClassificationManager *classiMan; CAnalyseValueDescription *pseudoModelMergedSubsumValueDescription; CAnalyseValueDescription *subclassSubsumValueDescription; CAnalyseValueDescription *subclassIdOccSubsumValueDescription; CAnalyseValueDescription *derivatedSubsumValueDescription; CAnalyseValueDescription *calculatedSubsumValueDescription; CAnalyseValueDescription *prunedSubsumValueDescription; CAnalyseValueDescription *toldSubsumValueDescription; CClassifierStatistics *statistics; // private methods private: // private variables private: }; }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_READER_CCLASSIFICATIONSTATISTICSUPDATEREADER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CTestTaskThroughputReader.cpp0000644000175000017500000000432012520551310027556 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTestTaskThroughputReader.h" namespace Konclude { namespace Test { namespace Analyse { namespace Reader { CTestTaskThroughputReader::CTestTaskThroughputReader(CThroughputTestTaskTester *throughputTaskTester) { mThroughputTaskTester = throughputTaskTester; mProcessedTaskCountValueDescription = 0; if (mThroughputTaskTester) { mProcessedTaskCountValueDescription = new CAnalyseValueDescription(); mProcessedTaskCountValueDescription->setValueName(QString("ThroughputTaskTester::TaskProcessedCount")); mProcessedTaskCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); } } CTestTaskThroughputReader::~CTestTaskThroughputReader() { if (mProcessedTaskCountValueDescription) { delete mProcessedTaskCountValueDescription; } } CAnalyseValueDescription *CTestTaskThroughputReader::getProcessedTaskCountValueDescription() { return mProcessedTaskCountValueDescription; } CAnalyseValue *CTestTaskThroughputReader::getAnalyseValueUpdate(CAnalyseValueDescription *valueDes) { CAnalyseValue *val = 0; if (valueDes == mProcessedTaskCountValueDescription && mThroughputTaskTester) { val = new CIntegerAnalyseValue(mThroughputTaskTester->getTaskProcessedCount()); } return val; } }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CClassificationProgressUpdateReader.cpp0000644000175000017500000001245112520551306031556 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationProgressUpdateReader.h" namespace Konclude { namespace Test { namespace Analyse { namespace Reader { CClassificationProgressUpdateReader::CClassificationProgressUpdateReader(CClassificationManager *classificationManager) { classiMan = classificationManager; totalSubsumValueDescription = 0; totalSatisValueDescription = 0; testedSubsumValueDescription = 0; testedSatisValueDescription = 0; activeClassifierCountValueDescription = 0; statistics = new CClassifierStatistics(); if (classiMan) { totalSubsumValueDescription = new CAnalyseValueDescription(); totalSubsumValueDescription->setValueName(QString("ClassificationManager::TotalSubsumptionTestCount")); totalSubsumValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); totalSatisValueDescription = new CAnalyseValueDescription(); totalSatisValueDescription->setValueName(QString("ClassificationManager::TotalSatisfiableTestCount")); totalSatisValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); testedSubsumValueDescription = new CAnalyseValueDescription(); testedSubsumValueDescription->setValueName(QString("ClassificationManager::TestedSubsumptionCount")); testedSubsumValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); testedSatisValueDescription = new CAnalyseValueDescription(); testedSatisValueDescription->setValueName(QString("ClassificationManager::TestedSatisfiableCount")); testedSatisValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); activeClassifierCountValueDescription = new CAnalyseValueDescription(); activeClassifierCountValueDescription->setValueName(QString("ClassificationManager::ActiveClassifierCount")); activeClassifierCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); } } CClassificationProgressUpdateReader::~CClassificationProgressUpdateReader() { if (totalSubsumValueDescription) { delete totalSubsumValueDescription; } if (totalSatisValueDescription) { delete totalSatisValueDescription; } if (testedSubsumValueDescription) { delete testedSubsumValueDescription; } if (testedSatisValueDescription) { delete testedSatisValueDescription; } if (activeClassifierCountValueDescription) { delete activeClassifierCountValueDescription; } if (statistics) { delete statistics; } } CAnalyseValueDescription *CClassificationProgressUpdateReader::getTotalSubsumptionTestCountValueDescription() { return totalSubsumValueDescription; } CAnalyseValueDescription *CClassificationProgressUpdateReader::getTestedSubsumptionCountValueDescription() { return testedSubsumValueDescription; } CAnalyseValueDescription *CClassificationProgressUpdateReader::getTotalSatisfiableTestCountValueDescription() { return totalSatisValueDescription; } CAnalyseValueDescription *CClassificationProgressUpdateReader::getTestedSatisfiableCountValueDescription() { return testedSatisValueDescription; } CAnalyseValueDescription *CClassificationProgressUpdateReader::getActiveClassifierCountValueDescription() { return activeClassifierCountValueDescription; } CAnalyseValue *CClassificationProgressUpdateReader::getAnalyseValueUpdate(CAnalyseValueDescription *valueDes) { CAnalyseValue *val = 0; statistics->resetValues(); if (valueDes == totalSubsumValueDescription && classiMan) { val = new CIntegerAnalyseValue(classiMan->collectClassificationStatistics(statistics)->getTotalSubsumptionTestCount()); } else if (valueDes == totalSatisValueDescription && classiMan) { val = new CIntegerAnalyseValue(classiMan->collectClassificationStatistics(statistics)->getTotalSatisfiableCount()); } else if (valueDes == testedSubsumValueDescription && classiMan) { val = new CIntegerAnalyseValue(classiMan->collectClassificationStatistics(statistics)->getTestedSubsumptionCount()); } else if (valueDes == testedSatisValueDescription && classiMan) { val = new CIntegerAnalyseValue(classiMan->collectClassificationStatistics(statistics)->getTestedSatisfiableCount()); } else if (valueDes == activeClassifierCountValueDescription && classiMan) { val = new CIntegerAnalyseValue(classiMan->getActiveClassifierCount()); } return val; } }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CTestTaskThroughputReader.h0000644000175000017500000000513412520551310027227 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_READER_CTESTTASKTHROUGHPUTREADER_H #define KONCLUDE_TEST_ANALYSE_READER_CTESTTASKTHROUGHPUTREADER_H // Libraries includes #include // Namespace includes // Other includes #include "Test/Analyse/AnalyseSettings.h" #include "Test/Analyse/CAnalyseValue.h" #include "Test/Analyse/CAnalyseValueUpdateReader.h" #include "Test/Analyse/CAnalyseValueDescription.h" #include "Test/Analyse/CIntegerAnalyseValue.h" #include "Test/Analyse/CConvertStringAnalyseValue.h" #include "Test/Analyse/CDoubleAnalyseValue.h" #include "Test/CThroughputTestTaskTester.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { namespace Reader { /*! * * \class CTestTaskThroughputReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTestTaskThroughputReader : public CAnalyseValueUpdateReader { // public methods public: //! Constructor CTestTaskThroughputReader(CThroughputTestTaskTester *throughputTaskTester); //! Destructor virtual ~CTestTaskThroughputReader(); virtual CAnalyseValue *getAnalyseValueUpdate(CAnalyseValueDescription *valueDes); virtual CAnalyseValueDescription *getProcessedTaskCountValueDescription(); // protected methods protected: // protected variables protected: CThroughputTestTaskTester* mThroughputTaskTester; CAnalyseValueDescription* mProcessedTaskCountValueDescription; // private methods private: // private variables private: }; }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_READER_CTESTTASKTHROUGHPUTREADER_H ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CConcurrentOccurenceUnsatisfiableCacheTest0000644000175000017500000000562412520551306032302 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader.h" namespace Konclude { namespace Test { namespace Analyse { namespace Reader { CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader::CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader(CConcurrentOccurenceUnsatisfiableCacheTester *unsatCacheTester) { cacheTester = unsatCacheTester; cacheWritesDescription = 0; cacheReadsDescription = 0; if (cacheTester) { cacheWritesDescription = new CAnalyseValueDescription(); cacheWritesDescription->setValueName(QString("Test::CacheWrites")); cacheWritesDescription->setTemplateValue(new CIntegerAnalyseValue(0.)); cacheReadsDescription = new CAnalyseValueDescription(); cacheReadsDescription->setValueName(QString("Test::CacheReads")); cacheReadsDescription->setTemplateValue(new CIntegerAnalyseValue(0.)); } } CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader::~CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader() { if (cacheWritesDescription) { delete cacheWritesDescription; } if (cacheReadsDescription) { delete cacheReadsDescription; } } CAnalyseValueDescription *CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader::getCacheWritesCountValueDescription() { return cacheWritesDescription; } CAnalyseValueDescription *CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader::getCacheReadsCountValueDescription() { return cacheReadsDescription; } CAnalyseValue *CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader::getAnalyseValueUpdate(CAnalyseValueDescription *valueDes) { CAnalyseValue *val = 0; if (valueDes == cacheWritesDescription && cacheTester) { val = new CDoubleAnalyseValue(cacheTester->getCacheWrites()); } else if (valueDes == cacheReadsDescription && cacheTester) { val = new CDoubleAnalyseValue(cacheTester->getCacheReads()); } return val; } }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CAnalyseValueMinMaxAvgExtendedUpdateReader.cppKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CAnalyseValueMinMaxAvgExtendedUpdateReader0000644000175000017500000001000312520551306032126 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseValueMinMaxAvgExtendedUpdateReader.h" namespace Konclude { namespace Test { namespace Analyse { namespace Reader { CAnalyseValueMinMaxAvgExtendedUpdateReader::CAnalyseValueMinMaxAvgExtendedUpdateReader(CAnalyseValueDescription *valueDes, CAnalyseValueUpdateReader *updateReader) { reader = updateReader; valueDescription = valueDes; hasMinMaxAvg = false; valCount = 0; minValueDescription = 0; maxValueDescription = 0; avgValueDescription = 0; if (valueDescription) { minValueDescription = new CAnalyseValueDescription(); minValueDescription->setValueName(valueDescription->getValueName()+QString("-Minimum")); minValueDescription->setTemplateValue(new CDoubleAnalyseValue(0.)); maxValueDescription = new CAnalyseValueDescription(); maxValueDescription->setValueName(valueDescription->getValueName()+QString("-Maximum")); maxValueDescription->setTemplateValue(new CDoubleAnalyseValue(0.)); avgValueDescription = new CAnalyseValueDescription(); avgValueDescription->setValueName(valueDescription->getValueName()+QString("-Average")); avgValueDescription->setTemplateValue(new CDoubleAnalyseValue(0.)); } } CAnalyseValueMinMaxAvgExtendedUpdateReader::~CAnalyseValueMinMaxAvgExtendedUpdateReader() { if (avgValueDescription) { delete avgValueDescription; } if (maxValueDescription) { delete maxValueDescription; } if (minValueDescription) { delete minValueDescription; } } CAnalyseValueDescription *CAnalyseValueMinMaxAvgExtendedUpdateReader::getMinValueDescription() { return minValueDescription; } CAnalyseValueDescription *CAnalyseValueMinMaxAvgExtendedUpdateReader::getMaxValueDescription() { return maxValueDescription; } CAnalyseValueDescription *CAnalyseValueMinMaxAvgExtendedUpdateReader::getAvgValueDescription() { return avgValueDescription; } CAnalyseValue *CAnalyseValueMinMaxAvgExtendedUpdateReader::getAnalyseValueUpdate(CAnalyseValueDescription *valueDes) { CAnalyseValue *val = 0; if (valueDes == valueDescription) { if (reader) { val = reader->getAnalyseValueUpdate(valueDes); } CConvertDoubleAnalyseValue *douVal = dynamic_cast(val); if (douVal) { double mDouVal = douVal->getDouble(); if (!hasMinMaxAvg) { avgVal = mDouVal; maxVal = mDouVal; minVal = mDouVal; valCount++; } else { maxVal = qMax(maxVal,mDouVal); minVal = qMin(minVal,mDouVal); avgVal = avgVal + 1./(valCount+1.) * (mDouVal - avgVal); valCount++; } } } else if (valueDes == minValueDescription) { if (hasMinMaxAvg) { val = new CDoubleAnalyseValue(minVal); } } else if (valueDes == maxValueDescription) { if (hasMinMaxAvg) { val = new CDoubleAnalyseValue(maxVal); } } else if (valueDes == avgValueDescription) { if (hasMinMaxAvg) { val = new CDoubleAnalyseValue(avgVal); } } return val; } }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CTaskReserveQueueUpdateReader.cpp0000644000175000017500000000427712520551310030343 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskReserveQueueUpdateReader.h" namespace Konclude { namespace Test { namespace Analyse { namespace Reader { CTaskReserveQueueUpdateReader::CTaskReserveQueueUpdateReader(CTaskReserveQueue* taskQueue, const QString& queueName) { mTaskQueue = taskQueue; mQueueName = queueName; mReserveScheduleTaskCountValueDescription = nullptr; if (mTaskQueue) { mReserveScheduleTaskCountValueDescription = new CAnalyseValueDescription(); mReserveScheduleTaskCountValueDescription->setValueName(QString("%1::ReserveScheduleTasks").arg(mQueueName)); mReserveScheduleTaskCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); } } CTaskReserveQueueUpdateReader::~CTaskReserveQueueUpdateReader() { delete mReserveScheduleTaskCountValueDescription; } CAnalyseValueDescription* CTaskReserveQueueUpdateReader::getReserveScheduleTaskCountValueDescription() { return mReserveScheduleTaskCountValueDescription; } CAnalyseValue *CTaskReserveQueueUpdateReader::getAnalyseValueUpdate(CAnalyseValueDescription* valueDes) { CAnalyseValue *val = 0; if (valueDes == mReserveScheduleTaskCountValueDescription) { val = new CIntegerAnalyseValue(mTaskQueue->getTaskCount()); } return val; } }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CTaskProcessingUpdateReader.cpp0000644000175000017500000000434412520551310030032 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskProcessingUpdateReader.h" namespace Konclude { namespace Test { namespace Analyse { namespace Reader { CTaskProcessingUpdateReader::CTaskProcessingUpdateReader(CTaskProcessorThreadBase* taskProcessor, const QString& threadName) { mTaskProcessor = taskProcessor; mThreadName = threadName; mReserveScheduleTaskCountValueDescription = nullptr; if (mTaskProcessor) { mReserveScheduleTaskCountValueDescription = new CAnalyseValueDescription(); mReserveScheduleTaskCountValueDescription->setValueName(QString("%1::ReserveScheduleTasks").arg(mThreadName)); mReserveScheduleTaskCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); } } CTaskProcessingUpdateReader::~CTaskProcessingUpdateReader() { delete mReserveScheduleTaskCountValueDescription; } CAnalyseValueDescription* CTaskProcessingUpdateReader::getReserveScheduleTaskCountValueDescription() { return mReserveScheduleTaskCountValueDescription; } CAnalyseValue *CTaskProcessingUpdateReader::getAnalyseValueUpdate(CAnalyseValueDescription* valueDes) { CAnalyseValue *val = 0; if (valueDes == mReserveScheduleTaskCountValueDescription) { val = new CIntegerAnalyseValue(mTaskProcessor->countScheduleableProcessingTasks()); } return val; } }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CCalculationTableauCompletionAlgorithmUpdateReader.hKonclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CCalculationTableauCompletionAlgorithmUpda0000644000175000017500000000723212520551312032274 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_READER_CCALCULATIONTABLEAUCOMPLETIONALGORITHMUPDATEREADER_H #define KONCLUDE_TEST_ANALYSE_READER_CCALCULATIONTABLEAUCOMPLETIONALGORITHMUPDATEREADER_H // Libraries includes #include // Namespace includes // Other includes #include "Test/Analyse/AnalyseSettings.h" #include "Test/Analyse/CAnalyseValue.h" #include "Test/Analyse/CAnalyseValueUpdateReader.h" #include "Test/Analyse/CAnalyseValueDescription.h" #include "Test/Analyse/CIntegerAnalyseValue.h" #include "Test/Analyse/CConvertStringAnalyseValue.h" #include "Reasoner/Kernel/Algorithm/CCalculationTableauCompletionTaskHandleAlgorithm.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Scheduler; using namespace Reasoner::Kernel::Algorithm; namespace Test { namespace Analyse { namespace Reader { /*! * * \class CCalculationTableauCompletionAlgorithmUpdateReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationTableauCompletionAlgorithmUpdateReader : public CAnalyseValueUpdateReader { // public methods public: //! Constructor CCalculationTableauCompletionAlgorithmUpdateReader(CCalculationTableauCompletionTaskHandleAlgorithm *algorithm); //! Destructor virtual ~CCalculationTableauCompletionAlgorithmUpdateReader(); virtual CAnalyseValue *getAnalyseValueUpdate(CAnalyseValueDescription *valueDes); virtual CAnalyseValueDescription *getAtmostRuleCountValueDescription(); virtual CAnalyseValueDescription *getAtleastRuleCountValueDescription(); virtual CAnalyseValueDescription *getOrRuleCountValueDescription(); virtual CAnalyseValueDescription *getAndRuleCountValueDescription(); virtual CAnalyseValueDescription *getAllRuleCountValueDescription(); virtual CAnalyseValueDescription *getSomeRuleCountValueDescription(); virtual CAnalyseValueDescription *getRulesCountValueDescription(); // protected methods protected: // protected variables protected: CCalculationTableauCompletionTaskHandleAlgorithm *alg; CAnalyseValueDescription *atmostRuleCountValueDescription; CAnalyseValueDescription *atleastRuleCountValueDescription; CAnalyseValueDescription *orRuleCountValueDescription; CAnalyseValueDescription *andRuleCountValueDescription; CAnalyseValueDescription *someRuleCountValueDescription; CAnalyseValueDescription *allRuleCountValueDescription; CAnalyseValueDescription *rulesCountValueDescription; // private methods private: // private variables private: }; }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_READER_CCALCULATIONTABLEAUCOMPLETIONALGORITHMUPDATEREADER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CTaskProcessingUpdateReader.h0000644000175000017500000000521712520551310027477 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_READER_CTASKPROCESSINGUPDATEREADER_H #define KONCLUDE_TEST_ANALYSE_READER_CTASKPROCESSINGUPDATEREADER_H // Libraries includes #include // Namespace includes // Other includes #include "Test/Analyse/AnalyseSettings.h" #include "Test/Analyse/CAnalyseValue.h" #include "Test/Analyse/CAnalyseValueUpdateReader.h" #include "Test/Analyse/CAnalyseValueDescription.h" #include "Test/Analyse/CIntegerAnalyseValue.h" #include "Test/Analyse/CConvertStringAnalyseValue.h" #include "Scheduler/CTaskProcessorThreadBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Scheduler; namespace Test { namespace Analyse { namespace Reader { /*! * * \class CTaskProcessingUpdateReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskProcessingUpdateReader : public CAnalyseValueUpdateReader { // public methods public: //! Constructor CTaskProcessingUpdateReader(CTaskProcessorThreadBase* taskProcessor, const QString& threadName); //! Destructor virtual ~CTaskProcessingUpdateReader(); virtual CAnalyseValue* getAnalyseValueUpdate(CAnalyseValueDescription* valueDes); virtual CAnalyseValueDescription* getReserveScheduleTaskCountValueDescription(); // protected methods protected: // protected variables protected: CAnalyseValueDescription* mReserveScheduleTaskCountValueDescription; CTaskProcessorThreadBase* mTaskProcessor; QString mThreadName; // private methods private: // private variables private: }; }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_READER_CTASKPROCESSINGUPDATEREADER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/Reader/CClassificationStatisticsUpdateReader.cpp0000644000175000017500000001604112520551306032103 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationStatisticsUpdateReader.h" namespace Konclude { namespace Test { namespace Analyse { namespace Reader { CClassificationStatisticsUpdateReader::CClassificationStatisticsUpdateReader(CClassificationManager *classificationManager) { classiMan = classificationManager; pseudoModelMergedSubsumValueDescription = 0; derivatedSubsumValueDescription = 0; calculatedSubsumValueDescription = 0; prunedSubsumValueDescription = 0; subclassSubsumValueDescription = 0; subclassIdOccSubsumValueDescription = 0; statistics = new CClassifierStatistics(); if (classiMan) { pseudoModelMergedSubsumValueDescription = new CAnalyseValueDescription(); pseudoModelMergedSubsumValueDescription->setValueName(QString("PseudoModelMergedTestedSubsumptionCount")); pseudoModelMergedSubsumValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); subclassSubsumValueDescription = new CAnalyseValueDescription(); subclassSubsumValueDescription->setValueName(QString("SubclassTestedSubsumptionCount")); subclassSubsumValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); subclassIdOccSubsumValueDescription = new CAnalyseValueDescription(); subclassIdOccSubsumValueDescription->setValueName(QString("SubclassIdentifierOccurTestedSubsumptionCount")); subclassIdOccSubsumValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); derivatedSubsumValueDescription = new CAnalyseValueDescription(); derivatedSubsumValueDescription->setValueName(QString("DerivatedTestedSubsumptionCount")); derivatedSubsumValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); calculatedSubsumValueDescription = new CAnalyseValueDescription(); calculatedSubsumValueDescription->setValueName(QString("CalculatedTestedSubsumptionCount")); calculatedSubsumValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); prunedSubsumValueDescription = new CAnalyseValueDescription(); prunedSubsumValueDescription->setValueName(QString("PrunedTestedSubsumptionCount")); prunedSubsumValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); toldSubsumValueDescription = new CAnalyseValueDescription(); toldSubsumValueDescription->setValueName(QString("ToldSubsumptionCount")); toldSubsumValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); } } CClassificationStatisticsUpdateReader::~CClassificationStatisticsUpdateReader() { if (pseudoModelMergedSubsumValueDescription) { delete pseudoModelMergedSubsumValueDescription; } if (derivatedSubsumValueDescription) { delete derivatedSubsumValueDescription; } if (calculatedSubsumValueDescription) { delete calculatedSubsumValueDescription; } if (prunedSubsumValueDescription) { delete prunedSubsumValueDescription; } if (subclassSubsumValueDescription) { delete subclassSubsumValueDescription; } if (subclassIdOccSubsumValueDescription) { delete subclassIdOccSubsumValueDescription; } if (toldSubsumValueDescription) { delete toldSubsumValueDescription; } if (statistics) { delete statistics; } } CAnalyseValueDescription *CClassificationStatisticsUpdateReader::getPseudoModelMergedTestedSubsumptionCountValueDescription() { return pseudoModelMergedSubsumValueDescription; } CAnalyseValueDescription *CClassificationStatisticsUpdateReader::getDerivatedTestedSubsumptionCountValueDescription() { return derivatedSubsumValueDescription; } CAnalyseValueDescription *CClassificationStatisticsUpdateReader::getCalculatedTestedSubsumptionCountValueDescription() { return calculatedSubsumValueDescription; } CAnalyseValueDescription *CClassificationStatisticsUpdateReader::getPrunedTestedSubsumptionCountValueDescription() { return prunedSubsumValueDescription; } CAnalyseValueDescription *CClassificationStatisticsUpdateReader::getSubclassTestedSubsumptionCountValueDescription() { return subclassSubsumValueDescription; } CAnalyseValueDescription *CClassificationStatisticsUpdateReader::getSubclassIdentifierOccurTestedSubsumptionCountValueDescription() { return subclassIdOccSubsumValueDescription; } CAnalyseValueDescription *CClassificationStatisticsUpdateReader::getToldSubsumptionCountValueDescription() { return toldSubsumValueDescription; } CAnalyseValue *CClassificationStatisticsUpdateReader::getAnalyseValueUpdate(CAnalyseValueDescription *valueDes) { CAnalyseValue *val = 0; statistics->resetValues(); if (valueDes == pseudoModelMergedSubsumValueDescription && classiMan) { val = new CIntegerAnalyseValue(classiMan->collectClassificationStatistics(statistics)->getPseudoModelMergedTestedSubsumptionCount()); } else if (valueDes == derivatedSubsumValueDescription && classiMan) { val = new CIntegerAnalyseValue(classiMan->collectClassificationStatistics(statistics)->getDerivatedTestedSubsumptionCount()); } else if (valueDes == calculatedSubsumValueDescription && classiMan) { val = new CIntegerAnalyseValue(classiMan->collectClassificationStatistics(statistics)->getCalculatedTestedSubsumptionCount()); } else if (valueDes == prunedSubsumValueDescription && classiMan) { val = new CIntegerAnalyseValue(classiMan->collectClassificationStatistics(statistics)->getPrunedTestedSubsumptionCount()); } else if (valueDes == subclassSubsumValueDescription && classiMan) { val = new CIntegerAnalyseValue(classiMan->collectClassificationStatistics(statistics)->getSubclassTestedSubsumptionCount()); } else if (valueDes == subclassIdOccSubsumValueDescription && classiMan) { val = new CIntegerAnalyseValue(classiMan->collectClassificationStatistics(statistics)->getSubclassIdentifierOccurTestedSubsumptionCount()); } else if (valueDes == toldSubsumValueDescription && classiMan) { val = new CIntegerAnalyseValue(classiMan->collectClassificationStatistics(statistics)->getToldSubsumptionCount()-statistics->getCalculatedTestedSubsumptionCount()); } return val; } }; // end namespace Reader }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseValue.h0000644000175000017500000000337712520551312023450 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CANALYSEVALUE_H #define KONCLUDE_TEST_ANALYSE_CANALYSEVALUE_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CAnalyseValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseValue { // public methods public: //! Constructor CAnalyseValue(); //! Destructor virtual ~CAnalyseValue(); virtual CAnalyseValue *createCopy() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CANALYSEVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDataLinker.cpp0000644000175000017500000000233012520551310024727 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseDataLinker.h" namespace Konclude { namespace Test { namespace Analyse { CAnalyseDataLinker::CAnalyseDataLinker() { } CAnalyseDataLinker::~CAnalyseDataLinker() { } CAnalyseDataLinker *CAnalyseDataLinker::getNextAnalyseData() { return (CAnalyseDataLinker *)CLinker::getNext(); } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CConvertIntegerAnalyseValue.h0000644000175000017500000000360512520551314026323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CCONVERTINTEGERANALYSEVALUE_H #define KONCLUDE_TEST_ANALYSE_CCONVERTINTEGERANALYSEVALUE_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseValue.h" #include "CConvertStringAnalyseValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CConvertIntegerAnalyseValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConvertIntegerAnalyseValue : virtual public CConvertStringAnalyseValue { // public methods public: virtual qint64 getInteger() = 0; virtual bool parseFromInteger(qint64 integer) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CCONVERTINTEGERANALYSEVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CMinMaxAvgCountValueAnalyser.cpp0000644000175000017500000000652512520551314026746 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMinMaxAvgCountValueAnalyser.h" namespace Konclude { namespace Test { namespace Analyse { CMinMaxAvgCountValueAnalyser::CMinMaxAvgCountValueAnalyser() { valCount = 0; minVal = 1.7976931348623158e+308; maxVal = -1.7976931348623158e+307; avgVal = 0; valCountAnaVal = 0; maxValAnaVal = 0; minValAnaVal = 0; avgValAnaVal = 0; } CMinMaxAvgCountValueAnalyser::~CMinMaxAvgCountValueAnalyser() { if (valCountAnaVal) { delete valCountAnaVal; delete maxValAnaVal; delete minValAnaVal; delete avgValAnaVal; } } double CMinMaxAvgCountValueAnalyser::getMaxValue() { return maxVal; } double CMinMaxAvgCountValueAnalyser::getAvgValue() { return avgVal; } double CMinMaxAvgCountValueAnalyser::getMinValue() { return minVal; } qint64 CMinMaxAvgCountValueAnalyser::getValueCount() { return valCount; } CValueAnalyser *CMinMaxAvgCountValueAnalyser::analyseValue(double douVal) { if (valCount > 0) { valCount++; maxVal = qMax(douVal,maxVal); minVal = qMin(douVal,minVal); avgVal = avgVal + (1./valCount) * (douVal - avgVal); } else { avgVal = douVal; minVal = douVal; maxVal = douVal; valCount++; } if (!valCountAnaVal) { valCountAnaVal = new CIntegerAnalyseValue(valCount); maxValAnaVal = new CDoubleAnalyseValue(maxVal); minValAnaVal = new CDoubleAnalyseValue(minVal); avgValAnaVal = new CDoubleAnalyseValue(avgVal); } else { valCountAnaVal->parseFromInteger(valCount); maxValAnaVal->parseFromDouble(maxVal); minValAnaVal->parseFromDouble(minVal); avgValAnaVal->parseFromDouble(avgVal); } return this; } CValueAnalyser *CMinMaxAvgCountValueAnalyser::analyseValue(CAnalyseValue *value) { if (value) { CConvertDoubleAnalyseValue *douAnData = dynamic_cast(value); if (douAnData) { double douVal = douAnData->getDouble(); analyseValue(douVal); } } return this; } CDoubleAnalyseValue *CMinMaxAvgCountValueAnalyser::getMaxAnalyseValue() { return maxValAnaVal; } CDoubleAnalyseValue *CMinMaxAvgCountValueAnalyser::getAvgAnalyseValue() { return avgValAnaVal; } CDoubleAnalyseValue *CMinMaxAvgCountValueAnalyser::getMinAnalyseValue() { return minValAnaVal; } CIntegerAnalyseValue *CMinMaxAvgCountValueAnalyser::getAnalyseValueCount() { return valCountAnaVal; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CIntegerAnalyseValue.cpp0000644000175000017500000000411612520551314025313 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIntegerAnalyseValue.h" namespace Konclude { namespace Test { namespace Analyse { CIntegerAnalyseValue::CIntegerAnalyseValue() : CConvertIntegerAnalyseValue() { } CIntegerAnalyseValue::CIntegerAnalyseValue(qint64 integer) : CConvertIntegerAnalyseValue() { integerValue = integer; } CIntegerAnalyseValue::~CIntegerAnalyseValue() { } QString CIntegerAnalyseValue::getString() { return QString::number(integerValue); } bool CIntegerAnalyseValue::parseFromString(const QString &string) { bool ok = true; qint64 number = string.toLongLong(&ok); if (ok) { integerValue = number; } return ok; } qint64 CIntegerAnalyseValue::getInteger() { return integerValue; } bool CIntegerAnalyseValue::parseFromInteger(qint64 integer) { integerValue = integer; return true; } double CIntegerAnalyseValue::getDouble() { return (double)integerValue; } bool CIntegerAnalyseValue::parseFromDouble(double doubleValue) { integerValue = doubleValue; return true; } CAnalyseValue *CIntegerAnalyseValue::createCopy() { CIntegerAnalyseValue *value = new CIntegerAnalyseValue(integerValue); return value; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CConvertStringAnalyseValue.h0000644000175000017500000000352112520551314026171 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CCONVERTSTRINGANALYSEVALUE_H #define KONCLUDE_TEST_ANALYSE_CCONVERTSTRINGANALYSEVALUE_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CConvertStringAnalyseValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConvertStringAnalyseValue : virtual public CAnalyseValue { // public methods public: virtual QString getString() = 0; virtual bool parseFromString(const QString &string) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CCONVERTSTRINGANALYSEVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CValueAnalyser.cpp0000644000175000017500000000207112520551316024157 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CValueAnalyser.h" namespace Konclude { namespace Test { namespace Analyse { CValueAnalyser::CValueAnalyser() { } CValueAnalyser::~CValueAnalyser() { } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CValueAnalyser.h0000644000175000017500000000347112520551316023631 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CVALUEANALYSER_H #define KONCLUDE_TEST_ANALYSE_CVALUEANALYSER_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CValueAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CValueAnalyser { // public methods public: //! Constructor CValueAnalyser(); //! Destructor virtual ~CValueAnalyser(); virtual CValueAnalyser *analyseValue(CAnalyseValue *value) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CVALUEANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseValueUpdateReader.h0000644000175000017500000000363312520551312025731 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CANALYSEVALUEUPDATEREADER_H #define KONCLUDE_TEST_ANALYSE_CANALYSEVALUEUPDATEREADER_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CAnalyseValueUpdateReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseValueUpdateReader { // public methods public: //! Constructor CAnalyseValueUpdateReader(); //! Destructor virtual ~CAnalyseValueUpdateReader(); virtual CAnalyseValue *getAnalyseValueUpdate(CAnalyseValueDescription *valueDes) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CANALYSEVALUEUPDATEREADER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CIntegerAnalyseValue.h0000644000175000017500000000451712520551314024765 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CINTEGERANALYSEVALUE_H #define KONCLUDE_TEST_ANALYSE_CINTEGERANALYSEVALUE_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CConvertIntegerAnalyseValue.h" #include "CConvertStringAnalyseValue.h" #include "CConvertDoubleAnalyseValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CIntegerAnalyseValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIntegerAnalyseValue : virtual public CConvertDoubleAnalyseValue, virtual public CConvertIntegerAnalyseValue { // public methods public: //! Constructor CIntegerAnalyseValue(); CIntegerAnalyseValue(qint64 integer); //! Destructor virtual ~CIntegerAnalyseValue(); virtual QString getString(); virtual bool parseFromString(const QString &string); virtual qint64 getInteger(); virtual bool parseFromInteger(qint64 integer); virtual double getDouble(); virtual bool parseFromDouble(double doubleValue); virtual CAnalyseValue *createCopy(); // protected methods protected: // protected variables protected: qint64 integerValue; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CINTEGERANALYSEVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDataObserver.cpp0000644000175000017500000000212512520551310025274 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseDataObserver.h" namespace Konclude { namespace Test { namespace Analyse { CAnalyseDataObserver::CAnalyseDataObserver() { } CAnalyseDataObserver::~CAnalyseDataObserver() { } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDataSeries.h0000644000175000017500000000426512520551312024415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CANALYSEDATASERIES_H #define KONCLUDE_TEST_ANALYSE_CANALYSEDATASERIES_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseData.h" #include "CAnalyseDataLinker.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CAnalyseDataSeries * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseDataSeries { // public methods public: //! Constructor CAnalyseDataSeries(); //! Destructor virtual ~CAnalyseDataSeries(); virtual CAnalyseDataLinker *getAnalyseDataLinker(); virtual CAnalyseDataSeries *addAnalyseData(CAnalyseDataLinker *analyseDataLinker); virtual CAnalyseDataSeries *setAnalyseDataDescription(CAnalyseDataDescription *dataDescription); virtual CAnalyseDataDescription *getAnalyseDataDescription(); // protected methods protected: // protected variables protected: CAnalyseDataLinker *dataLinker; CAnalyseDataDescription *dataDes; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CANALYSEDATASERIES_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CConvertStringAnalyseValue.cpp0000644000175000017500000000175112520551314026527 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConvertStringAnalyseValue.h" namespace Konclude { namespace Test { namespace Analyse { }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CDifferenceValueAnalyser.h0000644000175000017500000000451312520551314025600 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CDIFFERENCEVALUEANALYSER_H #define KONCLUDE_TEST_ANALYSE_CDIFFERENCEVALUEANALYSER_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseValue.h" #include "CValueAnalyser.h" #include "CConvertDoubleAnalyseValue.h" #include "CDoubleAnalyseValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CDifferenceValueAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDifferenceValueAnalyser : public CValueAnalyser { // public methods public: //! Constructor CDifferenceValueAnalyser(); //! Destructor virtual ~CDifferenceValueAnalyser(); virtual CValueAnalyser *analyseValue(CAnalyseValue *value); virtual CValueAnalyser *analyseValue(double value); virtual double getDifferenceValue(); virtual bool hasDiferenceValue(); virtual CDoubleAnalyseValue *getDifferenceAnalyseValue(); // protected methods protected: // protected variables protected: double difference; bool hasDifference; double lastValue; bool hasLastValue; CDoubleAnalyseValue *diffAnaVal; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CDIFFERENCEVALUEANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CStringAnalyseValue.h0000644000175000017500000000403012520551314024624 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CSTRINGANALYSEVALUE_H #define KONCLUDE_TEST_ANALYSE_CSTRINGANALYSEVALUE_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CConvertStringAnalyseValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CStringAnalyseValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CStringAnalyseValue : public CConvertStringAnalyseValue { // public methods public: //! Constructor CStringAnalyseValue(); CStringAnalyseValue(const QString &string); //! Destructor virtual ~CStringAnalyseValue(); virtual QString getString(); virtual bool parseFromString(const QString &string); virtual CAnalyseValue *createCopy(); // protected methods protected: // protected variables protected: QString stringValue; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CSTRINGANALYSEVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CMinMaxAvgLimitedCountValueAnalyser.cpp0000644000175000017500000000557312520551314030260 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMinMaxAvgLimitedCountValueAnalyser.h" namespace Konclude { namespace Test { namespace Analyse { CMinMaxAvgLimitedCountValueAnalyser::CMinMaxAvgLimitedCountValueAnalyser(qint64 valueLimit) { valLimit = valueLimit; } CMinMaxAvgLimitedCountValueAnalyser::~CMinMaxAvgLimitedCountValueAnalyser() { } CMinMaxAvgLimitedCountValueAnalyser *CMinMaxAvgLimitedCountValueAnalyser::setValueLimit(qint64 valueLimit) { valLimit = valueLimit; return this; } qint64 CMinMaxAvgLimitedCountValueAnalyser::getValueLimit() { return valLimit; } CValueAnalyser *CMinMaxAvgLimitedCountValueAnalyser::analyseValue(double douVal) { if (valCount > 0) { valCount++; maxVal = qMax(douVal,maxVal); minVal = qMin(douVal,minVal); avgVal = avgVal + (1./(valCount+1.)) * (douVal - avgVal); } else { avgVal = douVal; minVal = douVal; maxVal = douVal; valCount++; } values.prepend(douVal); if (valCount > valLimit) { double lastVal = values.takeLast(); avgVal = avgVal - (1./(valCount-1.)) * (lastVal - avgVal); valCount--; if (lastVal == minVal || lastVal == maxVal) { // search new min and max double newMin = 1.7976931348623158e+308; double newMax = -1.7976931348623158e+307; for (QLinkedList::const_iterator it = values.begin(); it != values.end(); ++it) { double val = (*it); newMax = qMax(val,newMax); newMin = qMin(val,newMin); } minVal = newMin; maxVal = newMax; } } if (!valCountAnaVal) { valCountAnaVal = new CIntegerAnalyseValue(valCount); maxValAnaVal = new CDoubleAnalyseValue(maxVal); minValAnaVal = new CDoubleAnalyseValue(minVal); avgValAnaVal = new CDoubleAnalyseValue(avgVal); } else { valCountAnaVal->parseFromInteger(valCount); maxValAnaVal->parseFromDouble(maxVal); minValAnaVal->parseFromDouble(minVal); avgValAnaVal->parseFromDouble(avgVal); } return this; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CDifferenceValueAnalyser.cpp0000644000175000017500000000437712520551314026143 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDifferenceValueAnalyser.h" namespace Konclude { namespace Test { namespace Analyse { CDifferenceValueAnalyser::CDifferenceValueAnalyser() { lastValue = 0; difference = 0; hasDifference = false; hasLastValue = false; diffAnaVal = 0; } CDifferenceValueAnalyser::~CDifferenceValueAnalyser() { if (diffAnaVal) { delete diffAnaVal; } } double CDifferenceValueAnalyser::getDifferenceValue() { return difference; } bool CDifferenceValueAnalyser::hasDiferenceValue() { return hasDifference; } CDoubleAnalyseValue *CDifferenceValueAnalyser::getDifferenceAnalyseValue() { return diffAnaVal; } CValueAnalyser *CDifferenceValueAnalyser::analyseValue(double douVal) { if (hasLastValue) { difference = douVal - lastValue; hasDifference = true; if (!diffAnaVal) { diffAnaVal = new CDoubleAnalyseValue(difference); } else { diffAnaVal->parseFromDouble(difference); } } lastValue = douVal; hasLastValue = true; return this; } CValueAnalyser *CDifferenceValueAnalyser::analyseValue(CAnalyseValue *value) { if (value) { CConvertDoubleAnalyseValue *douAnData = dynamic_cast(value); if (douAnData) { double douVal = douAnData->getDouble(); analyseValue(douVal); } } return this; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDescription.h0000644000175000017500000000337212520551312024652 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CANALYSEDESCRIPTION_H #define KONCLUDE_TEST_ANALYSE_CANALYSEDESCRIPTION_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CAnalyseDescription * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseDescription { // public methods public: //! Constructor CAnalyseDescription(); //! Destructor virtual ~CAnalyseDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CANALYSEDESCRIPTION_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDataCVSFileWriterObserver.h0000644000175000017500000000417212520551310027316 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CANALYSEDATACVSFILEWRITEROBSERVER_H #define KONCLUDE_TEST_ANALYSE_CANALYSEDATACVSFILEWRITEROBSERVER_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseDataSeries.h" #include "CAnalyseDataObserver.h" #include "CConvertStringAnalyseValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CAnalyseDataCVSFileWriterObserver * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseDataCVSFileWriterObserver : public CAnalyseDataObserver { // public methods public: //! Constructor CAnalyseDataCVSFileWriterObserver(const QString &outputFilename); //! Destructor virtual ~CAnalyseDataCVSFileWriterObserver(); virtual CAnalyseDataObserver *notifyDataUpdate(CAnalyseDataSeries *data); // protected methods protected: // protected variables protected: QString filename; QFile *file; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CANALYSEDATACVSFILEWRITEROBSERVER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CDoubleAnalyseValue.cpp0000644000175000017500000000375412520551314025137 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDoubleAnalyseValue.h" namespace Konclude { namespace Test { namespace Analyse { CDoubleAnalyseValue::CDoubleAnalyseValue() { } CDoubleAnalyseValue::CDoubleAnalyseValue(double doubleValue) { doubleVal = doubleValue; } CDoubleAnalyseValue::~CDoubleAnalyseValue() { } QString CDoubleAnalyseValue::getString() { return QString::number(doubleVal); } bool CDoubleAnalyseValue::parseFromString(const QString &string) { bool ok = true; double number = string.toDouble(&ok); if (ok) { doubleVal = number; } return ok; } qint64 CDoubleAnalyseValue::getInteger() { return (qint64)doubleVal; } bool CDoubleAnalyseValue::parseFromInteger(qint64 integer) { doubleVal = integer; return true; } double CDoubleAnalyseValue::getDouble() { return doubleVal; } bool CDoubleAnalyseValue::parseFromDouble(double doubleValue) { doubleVal = doubleValue; return true; } CAnalyseValue *CDoubleAnalyseValue::createCopy() { CDoubleAnalyseValue *value = new CDoubleAnalyseValue(doubleVal); return value; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CMinMaxAvgCountValueAnalyser.h0000644000175000017500000000532712520551314026412 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CMINMAXAVGCOUNTVALUEANALYSER_H #define KONCLUDE_TEST_ANALYSE_CMINMAXAVGCOUNTVALUEANALYSER_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseValue.h" #include "CValueAnalyser.h" #include "CConvertDoubleAnalyseValue.h" #include "CIntegerAnalyseValue.h" #include "CDoubleAnalyseValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CMinMaxAvgCountValueAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMinMaxAvgCountValueAnalyser : public CValueAnalyser { // public methods public: //! Constructor CMinMaxAvgCountValueAnalyser(); //! Destructor virtual ~CMinMaxAvgCountValueAnalyser(); virtual CValueAnalyser *analyseValue(CAnalyseValue *value); virtual CValueAnalyser *analyseValue(double value); virtual double getMaxValue(); virtual double getAvgValue(); virtual double getMinValue(); virtual qint64 getValueCount(); virtual CDoubleAnalyseValue *getMaxAnalyseValue(); virtual CDoubleAnalyseValue *getAvgAnalyseValue(); virtual CDoubleAnalyseValue *getMinAnalyseValue(); virtual CIntegerAnalyseValue *getAnalyseValueCount(); // protected methods protected: // protected variables protected: double maxVal; double minVal; double avgVal; qint64 valCount; CIntegerAnalyseValue *valCountAnaVal; CDoubleAnalyseValue *maxValAnaVal; CDoubleAnalyseValue *minValAnaVal; CDoubleAnalyseValue *avgValAnaVal; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CMINMAXAVGCOUNTVALUEANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDescription.cpp0000644000175000017500000000212012520551312025173 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseDescription.h" namespace Konclude { namespace Test { namespace Analyse { CAnalyseDescription::CAnalyseDescription() { } CAnalyseDescription::~CAnalyseDescription() { } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseUpdateDescription.cpp0000644000175000017500000000416412520551312026350 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseUpdateDescription.h" namespace Konclude { namespace Test { namespace Analyse { CAnalyseUpdateDescription::CAnalyseUpdateDescription() { valIdx = 0; valueDes = 0; updateReader = 0; } CAnalyseUpdateDescription::~CAnalyseUpdateDescription() { } CAnalyseValueUpdateReader *CAnalyseUpdateDescription::getUpdateReader() { return updateReader; } CAnalyseValueDescription *CAnalyseUpdateDescription::getValueDescription() { return valueDes; } CAnalyseUpdateDescription *CAnalyseUpdateDescription::setValueDescription(CAnalyseValueDescription *valDes) { valueDes = valDes; return this; } CAnalyseUpdateDescription *CAnalyseUpdateDescription::setUpdateReader(CAnalyseValueUpdateReader *analyseValueUpdateReader) { updateReader = analyseValueUpdateReader; return this; } qint64 CAnalyseUpdateDescription::getValueIndex() { return valIdx; } CAnalyseUpdateDescription *CAnalyseUpdateDescription::setValueIndex(qint64 index) { valIdx = index; return this; } CAnalyseValue *CAnalyseUpdateDescription::createValue() { CAnalyseValue *genValue = 0; if (valueDes) { genValue = valueDes->createValue(); } return genValue; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseValueUpdateReader.cpp0000644000175000017500000000216312520551312026261 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseValueUpdateReader.h" namespace Konclude { namespace Test { namespace Analyse { CAnalyseValueUpdateReader::CAnalyseValueUpdateReader() { } CAnalyseValueUpdateReader::~CAnalyseValueUpdateReader() { } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseUpdateDescription.h0000644000175000017500000000502512520551312026012 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CANALYSEUPDATEDESCRIPTION_H #define KONCLUDE_TEST_ANALYSE_CANALYSEUPDATEDESCRIPTION_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseDescription.h" #include "CAnalyseValue.h" #include "CAnalyseValueUpdateReader.h" #include "CAnalyseValueDescription.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CAnalyseUpdateDescription * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseUpdateDescription : public CAnalyseDescription { // public methods public: //! Constructor CAnalyseUpdateDescription(); //! Destructor virtual ~CAnalyseUpdateDescription(); virtual qint64 getValueIndex(); virtual CAnalyseUpdateDescription *setValueIndex(qint64 index); virtual CAnalyseValueDescription *getValueDescription(); virtual CAnalyseUpdateDescription *setValueDescription(CAnalyseValueDescription *valDes); virtual CAnalyseValue *createValue(); virtual CAnalyseValueUpdateReader *getUpdateReader(); virtual CAnalyseUpdateDescription *setUpdateReader(CAnalyseValueUpdateReader *analyseValueUpdateReader); // protected methods protected: // protected variables protected: qint64 valIdx; CAnalyseValueDescription *valueDes; CAnalyseValueUpdateReader *updateReader; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CANALYSEUPDATEDESCRIPTION_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDataUpdater.h0000644000175000017500000000460112520551312024561 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CANALYSEDATAUPDATER_H #define KONCLUDE_TEST_ANALYSE_CANALYSEDATAUPDATER_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseDataSeries.h" #include "CAnalyseDataUpdateItem.h" // Other includes #include "Concurrent/CIntervalThread.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Concurrent; namespace Test { namespace Analyse { /*! * * \class CAnalyseDataUpdater * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseDataUpdater : public CIntervalThread { // public methods public: //! Constructor CAnalyseDataUpdater(); //! Destructor virtual ~CAnalyseDataUpdater(); virtual CAnalyseDataUpdater *installAnalyseDataUpdate(CAnalyseDataSeries *dataSeries, qint64 updateInterval); virtual CAnalyseDataUpdater *installAnalyseDataUpdateObserver(CAnalyseDataSeries *dataSeries, CAnalyseDataObserver *observer); // protected methods protected: virtual bool processTimer(qint64 timerID); // protected variables protected: QHash analyseUpdateHash; QHash timerIDUpdateHash; qint64 nextTimerID; QMutex timerMutex; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CANALYSEDATAUPDATER_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseDataCVSFileWriterObserver.cpp0000644000175000017500000000536612520551310027657 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseDataCVSFileWriterObserver.h" namespace Konclude { namespace Test { namespace Analyse { CAnalyseDataCVSFileWriterObserver::CAnalyseDataCVSFileWriterObserver(const QString &outputFilename) { filename = outputFilename; file = 0; } CAnalyseDataCVSFileWriterObserver::~CAnalyseDataCVSFileWriterObserver() { if (file) { file->close(); delete file; file = 0; } } CAnalyseDataObserver *CAnalyseDataCVSFileWriterObserver::notifyDataUpdate(CAnalyseDataSeries *data) { if (!file) { file = new QFile(filename); if (file->open(QIODevice::Append)) { QString headerString; qint64 count = data->getAnalyseDataDescription()->getAnalyseValueCount(); for (qint64 i = 0; i < count; ++i) { QString valueName = data->getAnalyseDataDescription()->getValueDescription(i)->getValueName(); headerString.append(valueName+",\t"); } headerString.append("\n"); file->write(headerString.toLocal8Bit()); } else { delete file; file = 0; } } if (file) { QString valueString; qint64 count = data->getAnalyseDataDescription()->getAnalyseValueCount(); CAnalyseDataLinker *dataLinker = data->getAnalyseDataLinker(); CAnalyseData *analyseData = dataLinker->getData(); for (qint64 i = 0; i < count; ++i) { CAnalyseValue *analyseValue = analyseData->getValue(i); CConvertStringAnalyseValue *stringAnalyseValue = 0; if (analyseValue) { dynamic_cast(analyseValue); } if (stringAnalyseValue) { QString value = stringAnalyseValue->getString(); valueString.append(value+",\t"); } else { valueString.append(",\t"); } } valueString.append("\n"); file->write(valueString.toLocal8Bit()); } return this; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CAnalyseValueDescription.h0000644000175000017500000000441012520551312025641 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_ANALYSE_CANALYSEVALUEDESCRIPTION_H #define KONCLUDE_TEST_ANALYSE_CANALYSEVALUEDESCRIPTION_H // Libraries includes #include // Namespace includes #include "AnalyseSettings.h" #include "CAnalyseDescription.h" #include "CAnalyseValue.h" #include "CAnalyseValueUpdateReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Test { namespace Analyse { /*! * * \class CAnalyseValueDescription * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseValueDescription : public CAnalyseDescription { // public methods public: //! Constructor CAnalyseValueDescription(); //! Destructor virtual ~CAnalyseValueDescription(); virtual QString getValueName(); virtual CAnalyseValueDescription *setValueName(const QString &valueName); virtual CAnalyseValue *getTemplateValue(); virtual CAnalyseValueDescription *setTemplateValue(CAnalyseValue *takeTemplateValue); virtual CAnalyseValue *createValue(); // protected methods protected: // protected variables protected: QString valName; CAnalyseValue *templateValue; // private methods private: // private variables private: }; }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_ANALYSE_CANALYSEVALUEDESCRIPTION_H Konclude-v0.6.2-544-SourceCode/Source/Test/Analyse/CStringAnalyseValue.cpp0000644000175000017500000000311312520551314025160 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CStringAnalyseValue.h" namespace Konclude { namespace Test { namespace Analyse { CStringAnalyseValue::CStringAnalyseValue() : CConvertStringAnalyseValue() { } CStringAnalyseValue::CStringAnalyseValue(const QString &string) : CConvertStringAnalyseValue() { stringValue = string; } CStringAnalyseValue::~CStringAnalyseValue() { } QString CStringAnalyseValue::getString() { return stringValue; } bool CStringAnalyseValue::parseFromString(const QString &string) { stringValue = string; return true; } CAnalyseValue *CStringAnalyseValue::createCopy() { CStringAnalyseValue *value = new CStringAnalyseValue(stringValue); return value; } }; // end namespace Analyse }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkSatisfiabilityRequestGenerator.cpp0000644000175000017500000001647512520551346030652 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLFileOWLlinkSatisfiabilityRequestGenerator.h" namespace Konclude { namespace Test { COWLFileOWLlinkSatisfiabilityRequestGenerator::COWLFileOWLlinkSatisfiabilityRequestGenerator(CConfiguration *config) : CLogIdentifier("::Konclude::Test::OWLFileOWLlinkClassifyRequestGenerator",this),mConfig(config) { mReasonerTestKBName = "http://www.konclude.com/evaluation-testsuite/test-ontology"; } COWLFileOWLlinkSatisfiabilityRequestGenerator::~COWLFileOWLlinkSatisfiabilityRequestGenerator() { } QDomDocument COWLFileOWLlinkSatisfiabilityRequestGenerator::createRequestDocument() { QDomDocument document; QString owllinkNS = "http://www.owllink.org/owllink#"; QString owlNS = "http://www.w3.org/2002/07/owl#"; QDomElement rootNode; rootNode = document.createElementNS(owllinkNS,"RequestMessage"); //rootNode.setAttributeNS("xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttribute("xmlns:owl",owlNS); document.appendChild(rootNode); return document; } QSet COWLFileOWLlinkSatisfiabilityRequestGenerator::loadClassEntities(const QString& requestFileName) { CConcreteOntologyEntityCollectorBuilder entityGenBuilder; COWL2QtXMLOntologyStreamParser* owl2Parser = new COWL2QtXMLOntologyStreamParser(&entityGenBuilder); owl2Parser->parseOntology(requestFileName); delete owl2Parser; QSet classNameSet = *entityGenBuilder.getClassNameSet(); return classNameSet; } bool COWLFileOWLlinkSatisfiabilityRequestGenerator::generateOWLlinkSatisfiabilityRequests(const QString& requestFileName, const QString& responseFileName, cint64 testCount) { bool generatedTestfiles = false; QSet classNameTestingSet; QSet classNameSet = loadClassEntities(requestFileName); cint64 maxTestClassCount = qMin(testCount,(cint64)classNameSet.count()); cint64 slashIndex = qMax(requestFileName.lastIndexOf("/"),requestFileName.lastIndexOf("\\")); QString fileNameString = requestFileName; if (slashIndex >= 0) { fileNameString = requestFileName.mid(slashIndex+1); } uint randInitNumber = 0; for (QString::const_iterator it = requestFileName.constBegin(), itEnd = requestFileName.constEnd(); it != itEnd; ++it) { QChar nameChar(*it); randInitNumber += nameChar.unicode(); } qsrand(randInitNumber); for (cint64 testNr = 0; testNr < maxTestClassCount; ++testNr) { cint64 nextTextClassNr = qrand() % classNameSet.count(); QSet::iterator classNameIt = classNameSet.begin(); for (cint64 i = 0; i < nextTextClassNr; ++i) { ++classNameIt; } QString nextTestClassName = *classNameIt; cint64 nextClassSwitchCount = classNameSet.count(); while (classNameTestingSet.contains(nextTestClassName) && nextClassSwitchCount > 0) { ++classNameIt; ++nextTextClassNr; if (classNameIt == classNameSet.end()) { classNameIt == classNameSet.begin(); nextTextClassNr = 0; } nextTestClassName = *classNameIt; --nextClassSwitchCount; } if (classNameTestingSet.contains(nextTestClassName)) { break; } QString classNameTestFileAppendix = getClassNameRequestFileAppendix(nextTestClassName,nextTextClassNr); QString testResponseFileName = QString(responseFileName).arg(classNameTestFileAppendix); generatedTestfiles |= generateOWLlinkSatisfiabilityRequest(requestFileName,testResponseFileName,nextTestClassName); } return generatedTestfiles; } QString COWLFileOWLlinkSatisfiabilityRequestGenerator::getClassNameRequestFileAppendix(const QString& className, cint64 testNumber) { QString classNameFileAppendixString = className; cint64 lastSlash = classNameFileAppendixString.lastIndexOf("/"); if (lastSlash != -1) { classNameFileAppendixString = classNameFileAppendixString.mid(lastSlash+1); } cint64 lastGatt = classNameFileAppendixString.lastIndexOf("#"); if (lastGatt != -1) { classNameFileAppendixString = classNameFileAppendixString.mid(lastGatt+1); } QString nextClassNameFileAppendixString; cint64 maxClassChar = 15; for (QString::const_iterator charIt = classNameFileAppendixString.constBegin(), charItEnd = classNameFileAppendixString.constEnd(); charIt != charItEnd; ++charIt) { QChar character(*charIt); if (character.isLetterOrNumber()) { char asciiCharacter = character.toLatin1(); if (asciiCharacter != 0 && maxClassChar > 0) { --maxClassChar; nextClassNameFileAppendixString += asciiCharacter; } } } return QString("%1~%2").arg(testNumber).arg(nextClassNameFileAppendixString); } bool COWLFileOWLlinkSatisfiabilityRequestGenerator::generateOWLlinkSatisfiabilityRequest(const QString& requestFileName, const QString& responseFileName, const QString& className) { QDomDocument requestDocument = createRequestDocument(); QDomElement rootElement = requestDocument.documentElement(); QDomElement cKBElement = requestDocument.createElement("CreateKB"); cKBElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(cKBElement); QDomElement loadElement = requestDocument.createElement("LoadOntologies"); loadElement.setAttribute("kb",mReasonerTestKBName); QDomElement ontoIRIElement = requestDocument.createElement("OntologyIRI"); ontoIRIElement.setAttribute("IRI",QString("file:%1").arg(requestFileName)); loadElement.appendChild(ontoIRIElement); rootElement.appendChild(loadElement); QDomElement isSatClassElement = requestDocument.createElement("IsClassSatisfiable"); isSatClassElement.setAttribute("kb",mReasonerTestKBName); QDomElement classElement = requestDocument.createElement("owl:Class"); classElement.setAttribute("IRI",className); isSatClassElement.appendChild(classElement); rootElement.appendChild(isSatClassElement); QDomElement releaseKBElement = requestDocument.createElement("ReleaseKB"); releaseKBElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(releaseKBElement); QFile outFile(responseFileName); if (outFile.open(QIODevice::WriteOnly)) { outFile.write(requestDocument.toByteArray()); outFile.close(); } LOG(INFO,getLogDomain(),logTr("Generated OWLlink satisfiability request '%1' for ontology '%2'.").arg(responseFileName).arg(requestFileName),this); return false; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/COWLlinkAPIReasonerTestfileTester.cpp0000644000175000017500000002470412520551346026261 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLlinkAPIReasonerTestfileTester.h" namespace Konclude { namespace Test { COWLlinkAPIReasonerTestfileTester::COWLlinkAPIReasonerTestfileTester(CConfiguration *config) : CLogIdentifier("::Konclude::Test::OWLlinkAPIReasonerTestfileTester",this),mConfig(config) { // 2 weeks timeout mTransManager = new CQtHttpTransactionManager(1000*60*60*24*14); mAddressString = CConfigDataReader::readConfigString(mConfig,"Konclude.OWLlink.OWLlinkAPI.Address","http://127.0.0.1:8080"); mWriteResponseStdOut = CConfigDataReader::readConfigBoolean(mConfig,"Konclude.OWLlink.WriteResponseToStandardOutput",true); mModifyRequest = CConfigDataReader::readConfigBoolean(mConfig,"Konclude.OWLlink.OWLlinkAPI.RequestFileCompatibleModification",true); mModifyResponseTiming = CConfigDataReader::readConfigBoolean(mConfig,"Konclude.OWLlink.OWLlinkAPI.ResponseFileTimeExtension",true); mModifyRequestAbsolutePaths = CConfigDataReader::readConfigBoolean(mConfig,"Konclude.OWLlink.OWLlinkAPI.RequestFileAbsolutePathsModification",true); mExpectedResult = nullptr; } COWLlinkAPIReasonerTestfileTester::~COWLlinkAPIReasonerTestfileTester() { delete mTransManager; } void COWLlinkAPIReasonerTestfileTester::startTestfileTest(const QString& requestFileName, const QString& responseFileName) { QFile file(requestFileName); if (file.open(QIODevice::ReadOnly)) { QDomDocument document; document.setContent(&file,false); file.close(); QDomElement rootEl = document.documentElement(); if (mModifyRequest) { modifyRequestDomStructure(rootEl); } QByteArray transReqByteArray(document.toByteArray()); CHttpRequest* webRequest = mTransManager->createRequest(mAddressString,transReqByteArray); QTime timing; timing.start(); CHttpResponse* webResponse = mTransManager->getResponse(webRequest); LOG(INFO,getLogDomain(),logTr("Sending OWLlink request from file '%1' to '%2'.").arg(requestFileName).arg(mAddressString),this); QString* siteText = nullptr; siteText = mTransManager->getExtractedText(webResponse); cint64 elapsedTime = timing.elapsed(); if (siteText && !siteText->isEmpty()) { LOG(INFO,getLogDomain(),logTr("Recieved OWLlink response in '%1' ms.").arg(elapsedTime),this); document.setContent(*siteText,false); rootEl = document.documentElement(); if (mModifyResponseTiming) { modifyResponseDomStructure(rootEl,elapsedTime); } mTransManager->releaseResponse(webResponse); if (mWriteResponseStdOut) { QString respString(document.toByteArray()); cout<isResultEquivalentTo(respResult)) { LOG(WARNING,getLogDomain(),logTr("Result doesn't match expected result."),this); el.setAttribute("warning","Result doesn't match expected result."); } } } else { QDomElement child(el.firstChildElement()); while (!child.isNull()) { modifyResponseDomStructure(child,respTime); child = child.nextSiblingElement(); } } } bool COWLlinkAPIReasonerTestfileTester::modifyRequestDomStructure(QDomElement& el) { if (el.tagName() == "ExpectedResult") { QDomElement classHirNode = el.firstChildElement("ClassHierarchy"); if (!classHirNode.isNull()) { mExpectedResult = parseClassHierarchyResult(&classHirNode); } return true; } else if (mModifyRequestAbsolutePaths && el.tagName() == "OntologyIRI") { QString ontoIRI = el.attribute("IRI"); if (ontoIRI.startsWith("file:") && !ontoIRI.startsWith("file://")) { QString relFileString = ontoIRI; relFileString = relFileString.remove(0,5); QDir currFilePath(QDir::currentPath()); QString absFileString = currFilePath.absoluteFilePath(relFileString); absFileString = QUrl::fromLocalFile(absFileString).toString(); el.setAttribute("IRI",absFileString); LOG(INFO,getLogDomain(),logTr("Changed relative filepath '%1' to absolute filepath '%2'.").arg(ontoIRI).arg(absFileString),this); } } QDomElement child(el.firstChildElement()); while (!child.isNull()) { if (modifyRequestDomStructure(child)) { el.removeChild(child); } child = child.nextSiblingElement(); } return false; } CClassHierarchyResult* COWLlinkAPIReasonerTestfileTester::parseClassHierarchyResultRelocatedTOP(QDomElement *node) { // rename BOTTOM QDomElement bottomClassNode = node->firstChildElement("ClassSynset"); renameAbbreviatedClassSynset(&bottomClassNode,"owl:Nothing","http://www.w3.org/2002/07/owl#Nothing"); // relocate and rename TOP QDomElement subClassNode = node->firstChildElement("ClassSubClassesPair"); while (!subClassNode.isNull()) { QDomElement classSynsetElm(subClassNode.firstChildElement("ClassSynset")); if (hasClassSynsetTOP(&classSynsetElm)) { renameAbbreviatedClassSynset(&classSynsetElm,"owl:Thing","http://www.w3.org/2002/07/owl#Thing"); node->removeChild(subClassNode); node->insertAfter(subClassNode,bottomClassNode); break; } subClassNode = subClassNode.nextSiblingElement("ClassSubClassesPair"); } return parseClassHierarchyResult(node); } bool COWLlinkAPIReasonerTestfileTester::hasClassSynsetTOP(QDomElement *node) { QDomElement classNode = node->firstChildElement("owl:Class"); while (!classNode.isNull()) { QString className = classNode.attribute("abbreviatedIRI"); if (!className.isEmpty() && className == "owl:Thing") { return true; } classNode = classNode.nextSiblingElement("owl:Class"); } return false; } bool COWLlinkAPIReasonerTestfileTester::renameAbbreviatedClassSynset(QDomElement *node, const QString& abbIRI, const QString& replaceIRI) { QDomElement classNode = node->firstChildElement("owl:Class"); while (!classNode.isNull()) { QString className = classNode.attribute("abbreviatedIRI"); if (!className.isEmpty() && className == abbIRI) { classNode.removeAttribute("abbreviatedIRI"); classNode.setAttribute("IRI",replaceIRI); return true; } classNode = classNode.nextSiblingElement("owl:Class"); } return false; } CClassHierarchyResult* COWLlinkAPIReasonerTestfileTester::parseClassHierarchyResult(QDomElement *node) { CClassHierarchyResult *classHierResult = 0; QDomElement bottomClassNode = node->firstChildElement("ClassSynset"); CClassSynsetResult *bottomClassSynset = parseClassSynsetResult(&bottomClassNode); CClassSynsetResult *topClassSynset = 0; QDomElement subClassNode = node->firstChildElement("ClassSubClassesPair"); while (!subClassNode.isNull()) { CClassSynsetResult *superClass = 0; if (!classHierResult) { QDomElement classSynsetElm(subClassNode.firstChildElement("ClassSynset")); topClassSynset = parseClassSynsetResult(&classSynsetElm); classHierResult = new CClassHierarchyResult(bottomClassSynset,topClassSynset); superClass = topClassSynset; } else { QDomElement classSynsetElm(subClassNode.firstChildElement("ClassSynset")); QStringList classNames = parseClassNames(&classSynsetElm); superClass = classHierResult->getClassSynset(classNames); } QDomElement subClassSynsetNode = subClassNode.firstChildElement("SubClassSynsets"); while (!subClassSynsetNode.isNull()) { QDomElement classSynsetNode = subClassSynsetNode.firstChildElement("ClassSynset"); while (!classSynsetNode.isNull()) { QStringList classNames = parseClassNames(&classSynsetNode); CClassSynsetResult *subClass = classHierResult->getClassSynset(classNames); classHierResult->addSubClassRelation(superClass,subClass); classSynsetNode = classSynsetNode.nextSiblingElement("ClassSynset"); } subClassSynsetNode = subClassSynsetNode.nextSiblingElement("SubClassSynsets"); } subClassNode = subClassNode.nextSiblingElement("ClassSubClassesPair"); } return classHierResult; } CClassSynsetResult *COWLlinkAPIReasonerTestfileTester::parseClassSynsetResult(QDomElement *node) { QStringList classNameList = parseClassNames(node); CClassSynsetResult *classSynset = new CClassSynsetResult(classNameList); return classSynset; } QStringList COWLlinkAPIReasonerTestfileTester::parseClassNames(QDomElement *node) { QStringList classNameList; bool err = node->isNull(); QString tagName = node->tagName(); QDomElement classNode = node->firstChildElement("owl:Class"); while (!classNode.isNull()) { QString className = classNode.attribute("IRI"); classNameList.append(className); classNode = classNode.nextSiblingElement("owl:Class"); } return classNameList; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/COWLFileAxiomRemover.cpp0000644000175000017500000001350712520551344023616 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLFileAxiomRemover.h" namespace Konclude { namespace Test { COWLFileAxiomRemover::COWLFileAxiomRemover(CConfiguration *config) : CLogIdentifier("::Konclude::Test::OWLFileAxiomRemover",this),mConfig(config) { mConfReplaceDatatypeExpressions = false; QList removeTagList; if (mConfReplaceDatatypeExpressions) { removeTagList.append("DataProperty"); removeTagList.append("SubDataPropertyOf"); removeTagList.append("EquivalentDataProperties"); removeTagList.append("DisjointDataProperties"); removeTagList.append("DataPropertyDomain"); removeTagList.append("DataPropertyRange"); removeTagList.append("FunctionalDataProperty"); removeTagList.append("DataAllValuesFrom"); removeTagList.append("DataMaxCardinality"); removeTagList.append("DataPropertyAssertion"); removeTagList.append("DatatypeDefinition"); removeTagList.append("DatatypeRestriction"); removeTagList.append("Datatype"); removeTagList.append("HasKey"); removeTagList.append("DataSomeValuesFrom"); removeTagList.append("DataMinCardinality"); removeTagList.append("DataExactCardinality"); removeTagList.append("DataHasValue"); removeTagList.append("NegativeDataPropertyAssertion"); } foreach (QString removeTagString, removeTagList) { mRemoveTagNameSet.insert(removeTagString); mRemoveTagNameSet.insert(QString("owl:")+removeTagString); } QList alwRemoveTagList; alwRemoveTagList.append("AnnotationAssertion"); alwRemoveTagList.append("SubAnnotationPropertyOf"); alwRemoveTagList.append("AnnotationPropertyDomain"); alwRemoveTagList.append("AnnotationPropertyRange"); alwRemoveTagList.append("Annotation"); alwRemoveTagList.append("AnnotationProperty"); alwRemoveTagList.append("Import"); foreach (QString removeTagString, alwRemoveTagList) { mRemoveTagNameSet.insert(removeTagString); mRemoveTagNameSet.insert(QString("owl:")+removeTagString); mAlwaysRemoveTagNameSet.insert(removeTagString); mAlwaysRemoveTagNameSet.insert(QString("owl:")+removeTagString); } QList removeAttributeList; removeAttributeList.append("versionIRI"); foreach (QString removeAttributeString, removeAttributeList) { mRemoveAttributeNameSet.insert(removeAttributeString); } } COWLFileAxiomRemover::~COWLFileAxiomRemover() { } bool COWLFileAxiomRemover::loadRemoveAxiomsAndSave(const QString& requestFileName, const QString& responseFileName) { mStatRemovedAxioms = 0; mStatReplacedExpressions = 0; QFile file(requestFileName); if (file.open(QIODevice::ReadOnly)) { QDomDocument document; document.setContent(&file,false); file.close(); QDomElement rootEl = document.documentElement(); removeElements(rootEl,true,document); removeAttributes(rootEl,document); QFile wFile(responseFileName); if (wFile.open(QIODevice::WriteOnly)) { wFile.write(document.toByteArray()); wFile.close(); } LOG(INFO,getLogDomain(),logTr("Removed %1 axioms and replaced %2 expressions with TOP in '%3'.").arg(mStatRemovedAxioms).arg(mStatReplacedExpressions).arg(requestFileName),this); return true; } else { LOG(INFO,getLogDomain(),logTr("File '%1' does not exist or is not readable.").arg(requestFileName),this); } return false; } void COWLFileAxiomRemover::removeAttributes(QDomElement& domElement, QDomDocument& document) { foreach (QString attString, mRemoveAttributeNameSet) { domElement.removeAttribute(attString); } QDomElement nextEl = domElement.firstChildElement(); while (!nextEl.isNull()) { removeAttributes(nextEl,document); nextEl = nextEl.nextSiblingElement(); } } bool COWLFileAxiomRemover::removeElements(QDomElement& domElement, bool axiomLevel, QDomDocument& document) { bool modified = false; QDomElement nextEl = domElement.firstChildElement(); while (!nextEl.isNull()) { QDomElement tmpElNode = nextEl; nextEl = nextEl.nextSiblingElement(); QString nodeName = tmpElNode.nodeName(); if (mRemoveTagNameSet.contains(nodeName)) { if (axiomLevel) { domElement.removeChild(tmpElNode); ++mStatRemovedAxioms; } else if (mAlwaysRemoveTagNameSet.contains(nodeName)) { domElement.removeChild(tmpElNode); ++mStatRemovedAxioms; } else { // replace with top element QDomElement topElement = document.createElement("Class"); topElement.setAttribute("IRI","http://www.w3.org/2002/07/owl#Thing"); domElement.removeChild(tmpElNode); domElement.appendChild(topElement); ++mStatReplacedExpressions; } modified = true; } else { if (nodeName == "Declaration" || nodeName == "owl:Declaration") { removeElements(tmpElNode,true,document); if (tmpElNode.childNodes().isEmpty()) { // remove this node too domElement.removeChild(tmpElNode); ++mStatRemovedAxioms; } } modified |= removeElements(tmpElNode,false,document); } } return modified; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CThroughputTestTask.h0000644000175000017500000000465712520551352023325 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CTHROUGHPUTTESTTASK_H #define KONCLUDE_TEST_CTHROUGHPUTTESTTASK_H // Libraries includes // Namespace includes // Other includes #include "Scheduler/CTask.h" #include "Scheduler/CBooleanTaskResult.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; namespace Test { /*! * * \class CThroughputTestTask * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CThroughputTestTask : public CTask { // public methods public: //! Constructor CThroughputTestTask(CMemoryPool* memoryPool = nullptr); //! Destructor virtual ~CThroughputTestTask(); virtual CTask* makeTaskReference(CTask* dependedTask, CTaskHandleContext* handlerContext); virtual CTask* initTask(CTask* parentTask, CTaskHandleContext* context); CTask* initTestTask(cint64 maxBranchDepth, cint64 branchingFactor); cint64 getBranchingFactor(); cint64 getCurrentBranchingDepth(); cint64 getMaximumBranchingDepth(); bool hasReachedMaxBranchingDepth(); // protected methods protected: virtual CTaskResult* createTaskResult(CTaskHandleContext* handlerContext); virtual CTaskStatus* createTaskStatus(CTaskHandleContext* handlerContext); // protected variables protected: cint64 mMaxBranchDepth; cint64 mCurBranchDepth; cint64 mBranchingFactor; CBooleanTaskResult mBoolTaskResult; CTaskStatus mDefaultTaskResult; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_CThroughputTestTask_H Konclude-v0.6.2-544-SourceCode/Source/Test/Events/0000755000175000017500000000000012613407262020450 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Test/Events/CTestTestfileEvent.h0000644000175000017500000000343312520551342024344 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVENTS_CTESTTESTFILEEVENT_H #define KONCLUDE_TEST_EVENTS_CTESTTESTFILEEVENT_H // Libraries includes // Namespace includes #include "../TestSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Test { namespace Events { /*! * \class CTestTestfileEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CTestTestfileEvent : public CCustomEvent { // public methods public: //! Constructor CTestTestfileEvent(); //! Destructor virtual ~CTestTestfileEvent(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVENTS_CTESTTESTFILEEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Test/Events/CTestTestfileEvent.cpp0000644000175000017500000000215512520551342024677 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTestTestfileEvent.h" namespace Konclude { namespace Test { namespace Events { CTestTestfileEvent::CTestTestfileEvent() : CCustomEvent(EVENTTESTFILE) { } CTestTestfileEvent::~CTestTestfileEvent() { } }; // end namespace Events }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Events/CEvaluateTestfileTestEvent.cpp0000644000175000017500000000223512520551342026365 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEvaluateTestfileTestEvent.h" namespace Konclude { namespace Test { namespace Events { CEvaluateTestfileTestEvent::CEvaluateTestfileTestEvent() : CCustomEvent(EVENTEVALUATETESTFILE) { } CEvaluateTestfileTestEvent::~CEvaluateTestfileTestEvent() { } }; // end namespace Events }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/Events/CEvaluateTestfileTestEvent.h0000644000175000017500000000352312520551342026033 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_EVENTS_CEVALUATETESTFILETESTEVENT_H #define KONCLUDE_TEST_EVENTS_CEVALUATETESTFILETESTEVENT_H // Libraries includes // Namespace includes #include "../TestSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Test { namespace Events { /*! * \class CEvaluateTestfileTestEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CEvaluateTestfileTestEvent : public CCustomEvent { // public methods public: //! Constructor CEvaluateTestfileTestEvent(); //! Destructor virtual ~CEvaluateTestfileTestEvent(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_EVENTS_CEVALUATETESTFILETESTEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkRealizeRequestGenerator.cpp0000644000175000017500000001014312573742000027244 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLFileOWLlinkRealizeRequestGenerator.h" namespace Konclude { namespace Test { COWLFileOWLlinkRealizeRequestGenerator::COWLFileOWLlinkRealizeRequestGenerator(CConfiguration *config) : CLogIdentifier("::Konclude::Test::OWLFileOWLlinkIndividualifyRequestGenerator",this),mConfig(config) { mReasonerTestKBName = "http://www.konclude.com/evaluation-testsuite/test-ontology"; } COWLFileOWLlinkRealizeRequestGenerator::~COWLFileOWLlinkRealizeRequestGenerator() { } QDomDocument COWLFileOWLlinkRealizeRequestGenerator::createRequestDocument() { QDomDocument document; QString owllinkNS = "http://www.owllink.org/owllink#"; QString owlNS = "http://www.w3.org/2002/07/owl#"; QDomElement rootNode; rootNode = document.createElementNS(owllinkNS,"RequestMessage"); rootNode.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttribute("xmlns:owl",owlNS); document.appendChild(rootNode); return document; } QSet COWLFileOWLlinkRealizeRequestGenerator::loadIndividualEntities(const QString& requestFileName) { CConcreteOntologyEntityCollectorBuilder entityGenBuilder; COWL2QtXMLOntologyStreamParser* owl2Parser = new COWL2QtXMLOntologyStreamParser(&entityGenBuilder); owl2Parser->parseOntology(requestFileName); delete owl2Parser; QSet individualNameSet = *entityGenBuilder.getIndividualNameSet(); return individualNameSet; } bool COWLFileOWLlinkRealizeRequestGenerator::generateOWLlinkRealizeRequest(const QString& requestFileName, const QString& responseFileName) { bool generatedTestfiles = false; QSet individualNameTestingSet; QSet individualNameSet = loadIndividualEntities(requestFileName); if (!individualNameSet.isEmpty()) { QDomDocument requestDocument = createRequestDocument(); QDomElement rootElement = requestDocument.documentElement(); QDomElement cKBElement = requestDocument.createElement("CreateKB"); cKBElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(cKBElement); QDomElement loadElement = requestDocument.createElement("LoadOntologies"); loadElement.setAttribute("kb",mReasonerTestKBName); QDomElement ontoIRIElement = requestDocument.createElement("OntologyIRI"); ontoIRIElement.setAttribute("IRI",QString("file:%1").arg(requestFileName)); loadElement.appendChild(ontoIRIElement); rootElement.appendChild(loadElement); QDomElement realizeKBElement = requestDocument.createElement("Realize"); realizeKBElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(realizeKBElement); QDomElement releaseKBElement = requestDocument.createElement("ReleaseKB"); releaseKBElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(releaseKBElement); QFile outFile(responseFileName); if (outFile.open(QIODevice::WriteOnly)) { outFile.write(requestDocument.toByteArray()); outFile.close(); } LOG(INFO,getLogDomain(),logTr("Generated OWLlink realize request '%1' for ontology '%2'.").arg(responseFileName).arg(requestFileName),this); generatedTestfiles = true; } return generatedTestfiles; } }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator.hKonclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkIncrementalAssertionClassificationRequestG0000644000175000017500000000417512520551346032350 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator_H #define KONCLUDE_TEST_COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator_H // Libraries includes // Namespace includes #include "COWLFileOWLlinkIncrementalAssertionRequestGenerator.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { namespace Test { /*! * * \class COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator : public COWLFileOWLlinkIncrementalAssertionRequestGenerator { // public methods public: //! Constructor COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator(CConfiguration *config); // protected methods protected: virtual QDomElement getFirstReasoningRequestNode(QDomDocument& document); virtual QDomElement getSecondReasoningRequestNode(QDomDocument& document); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator_H Konclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestsuiteTester.cpp0000644000175000017500000000570512520551352024676 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerTestsuiteTester.h" namespace Konclude { namespace Test { CReasonerTestsuiteTester::CReasonerTestsuiteTester(CConfiguration *config) : CLogIdentifier("::Konclude::Test::ReasonerTestsuiteTester",this) { configuration = config; testFileTester = new CReasonerTestfileTester(config); testErrorEvaluator = new CReasonerTestfileErrorEvaluator(); } CReasonerTestsuiteTester::~CReasonerTestsuiteTester() { delete testFileTester; delete testErrorEvaluator; } CReasonerTestsuiteTester *CReasonerTestsuiteTester::realizeTestCommand(CTestTestsuiteCommand *command) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); QTime totalTestTimer; totalTestTimer.start(); CReasonerTestsuiteTest *testsuiteTest = command->getTestsuiteTest(); CLinker *subCommandIt = command->getSubCommandLinker(); while (subCommandIt) { CCommand *subCommand = subCommandIt->getData(); CTestTestfileCommand *testTestfileCommand = dynamic_cast(subCommand); if (testTestfileCommand) { QTime testTimer; testTimer.start(); QString testfile = testTestfileCommand->getReasonerTestfileTest()->getTestRequestFile(); LOG(INFO,getLogDomain(),logTr("Starting tests for testfile '%1'.").arg(testfile),this); testFileTester->realizeTestCommand(testTestfileCommand,testErrorEvaluator); CCommandExecutedBlocker::waitExecutedCommand(testTestfileCommand); // go sure that thread doesn't operate on command any more testFileTester->waitSynchronization(); qint64 testTimeElapsed = testTimer.elapsed(); LOG(INFO,getLogDomain(),logTr("Testing testfile '%1' takes %2 ms.").arg(testfile).arg(testTimeElapsed),this); } subCommandIt = subCommandIt->getNext(); } qint64 totalTestTimeElapsed = totalTestTimer.elapsed(); testsuiteTest->getTestsuiteResult()->setTotalTestingTime(totalTestTimeElapsed); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); return this; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CQHashVsQMapTester.h0000644000175000017500000000375612520551350022751 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CQHASHVSQMAPTESTER_H #define KONCLUDE_TEST_CQHASHVSQMAPTESTER_H // Libraries includes #include // Namespace includes #include "CHashModificationThread.h" // Other includes #include "Utilities/Container/CList.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; using namespace Utilities::Memory; namespace Test { /*! * * \class CQHashVsQMapTester * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQHashVsQMapTester { // public methods public: //! Constructor CQHashVsQMapTester(); //! Destructor virtual ~CQHashVsQMapTester(); void startModificationTest(cint64 modificationCount); // protected methods protected: // protected variables protected: QMap mTestMap; QHash mTestHash; QTime mMeasurementTimer; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude using namespace Konclude::Test; #endif // KONCLUDE_TEST_CQHASHVSQMAPTESTER_H Konclude-v0.6.2-544-SourceCode/Source/Test/COWLPigeonholePrincipleGenerator.cpp0000644000175000017500000001530012520551350026175 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLPigeonholePrincipleGenerator.h" namespace Konclude { namespace Test { COWLPigeonholePrincipleGenerator::COWLPigeonholePrincipleGenerator() : CLogIdentifier("::Konclude::Test::OWLPigeonholePrincipleGenerator",this) { owllinkNS = "http://www.owllink.org/owllink#"; owlNS = "http://www.w3.org/2002/07/owl#"; } COWLPigeonholePrincipleGenerator::~COWLPigeonholePrincipleGenerator() { } void COWLPigeonholePrincipleGenerator::generatePigeonholePrinciple(cint64 size, const QString& filename) { QFile file(filename); if (file.open(QIODevice::WriteOnly)) { rootNode = document.createElementNS(owllinkNS,"RequestMessage"); rootNode.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttribute("xmlns:owl",owlNS); document.appendChild(rootNode); QDomElement createOntologyNode = document.createElement("CreateKB"); createOntologyNode.setAttribute(QString("kb"),QString("http://www.owllink.org/testsuite/PigeonholePrinciple-%1").arg(size)); rootNode.appendChild(createOntologyNode); QDomElement tellOntologyNode = document.createElement("Tell"); tellOntologyNode.setAttribute(QString("kb"),QString("http://www.owllink.org/testsuite/PigeonholePrinciple-%1").arg(size)); rootNode.appendChild(tellOntologyNode); cint64 pigeonSize = std::log((double)(size+1))/std::log((double)10)+1; QStringList pigeonStringList; for (cint64 i = 0; i <= size; ++i) { QString pigeonString = QString::number(i); while (pigeonString.count() < pigeonSize) { pigeonString.prepend("0"); } pigeonString = QString("P%1").arg(pigeonString); pigeonStringList.append(pigeonString); } QStringList holeStringList; for (cint64 i = 0; i < size; ++i) { QString holeString = QString::number(i); while (holeString.count() < pigeonSize) { holeString.prepend("0"); } holeString = QString("H%1").arg(holeString); holeStringList.append(holeString); } QString satTestClass = QString("CSAT"); tellOntologyNode.appendChild(getOWLClassDeclaration(satTestClass)); QList clauselList; // generate step 1 foreach (const QString& pigeonString, pigeonStringList) { QList atLeastOneHoleList; foreach (const QString& holeString, holeStringList) { QString ph = pigeonString+holeString; tellOntologyNode.appendChild(getOWLClassDeclaration(ph)); atLeastOneHoleList.append(getOWLClass(ph)); } clauselList.append(getOWLUnion(atLeastOneHoleList)); } // generate step 2 foreach (const QString& holeString, holeStringList) { for (QStringList::const_iterator it = pigeonStringList.constBegin(), itEnd = pigeonStringList.constEnd(); it != itEnd; ++it) { QStringList::const_iterator it2 = it; for (++it2; it2 != itEnd; ++it2) { QString ph1 = *it+holeString; QString ph2 = *it2+holeString; clauselList.append(getOWLUnion(getOWLComplementClass(ph1),getOWLComplementClass(ph2))); } } } tellOntologyNode.appendChild(getOWLEquivalentClass(getOWLClass("CSAT"),getOWLIntersection(clauselList))); QDomElement queryOntologyNode = document.createElement("IsClassSatisfiable"); queryOntologyNode.setAttribute(QString("kb"),QString("http://www.owllink.org/testsuite/PigeonholePrinciple-%1").arg(size)); queryOntologyNode.setAttribute(QString("timing"),QString("simple")); queryOntologyNode.appendChild(getOWLClass("CSAT")); QDomElement expectedResultNode = document.createElement("ExpectedResult"); QDomElement boolResultNode = document.createElement("BooleanResponse"); boolResultNode.setAttribute("result","false"); expectedResultNode.appendChild(boolResultNode); queryOntologyNode.appendChild(expectedResultNode); rootNode.appendChild(queryOntologyNode); file.write(document.toByteArray()); file.close(); } } QDomElement COWLPigeonholePrincipleGenerator::getOWLUnion(const QList& list) { QDomElement dmDl = document.createElement("owl:ObjectUnionOf"); foreach (QDomElement dmEl, list) { dmDl.appendChild(dmEl); } return dmDl; } QDomElement COWLPigeonholePrincipleGenerator::getOWLUnion(const QDomElement& u1, const QDomElement& u2) { QDomElement dmDl = document.createElement("owl:ObjectUnionOf"); dmDl.appendChild(u1); dmDl.appendChild(u2); return dmDl; } QDomElement COWLPigeonholePrincipleGenerator::getOWLIntersection(const QList& list) { QDomElement dmDl = document.createElement("owl:ObjectIntersectionOf"); foreach (QDomElement dmEl, list) { dmDl.appendChild(dmEl); } return dmDl; } QDomElement COWLPigeonholePrincipleGenerator::getOWLClass(const QString& className, bool negated) { if (negated) { return getOWLComplementClass(className); } else { return getOWLClass(className); } } QDomElement COWLPigeonholePrincipleGenerator::getOWLComplementClass(const QString& className) { QDomElement dmDl = document.createElement("owl:ObjectComplementOf"); dmDl.appendChild(getOWLClass(className)); return dmDl; } QDomElement COWLPigeonholePrincipleGenerator::getOWLClassDeclaration(const QString& className) { QDomElement dmDl = document.createElement("owl:Declaration"); dmDl.appendChild(getOWLClass(className)); return dmDl; } QDomElement COWLPigeonholePrincipleGenerator::getOWLClass(const QString& className) { QDomElement dmEl = document.createElement("owl:Class"); dmEl.setAttribute("IRI",className); return dmEl; } QDomElement COWLPigeonholePrincipleGenerator::getOWLEquivalentClass(const QDomElement& eq1, const QDomElement& eq2) { QDomElement dmEl = document.createElement("owl:EquivalentClasses"); dmEl.appendChild(eq1); dmEl.appendChild(eq2); return dmEl; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CThroughputTestTaskHandleAlgorithm.cpp0000644000175000017500000000530012520551352026625 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CThroughputTestTaskHandleAlgorithm.h" namespace Konclude { namespace Test { CThroughputTestTaskHandleAlgorithm::CThroughputTestTaskHandleAlgorithm() { } CThroughputTestTaskHandleAlgorithm::~CThroughputTestTaskHandleAlgorithm() { } bool CThroughputTestTaskHandleAlgorithm::handleTask(CTaskProcessorContext *processorContext, CTask* task) { CTaskHandleMemoryAllocationManager* processorMemoryManager = processorContext->getTaskHandleMemoryAllocationManager(); CTaskProcessorCommunicator* processorCommunicator = processorContext->getTaskProcessorCommunicator(); CThroughputTestTask* testTask = dynamic_cast(task); if (testTask) { bool complete = false; try { if (!testTask->hasReachedMaxBranchingDepth()) { CMemoryAllocationManager* taskMemMan = testTask->getTaskContext(processorContext)->getMemoryAllocationManager(); cint64 branchingFactor = testTask->getBranchingFactor(); cint64 allocCount = 0; for (int i = 0; i < allocCount; ++i) { cint64* testArray = CObjectAllocator::allocateAndConstructArray(taskMemMan,branchingFactor); for (int j = 0; j < branchingFactor; ++j) { testArray[j] = 0; } } CTask* lastNewTestTask = nullptr; for (cint64 branchIdx = 0; branchIdx < branchingFactor; ++branchIdx) { CThroughputTestTask* newTestTask = CTaskAllocator::allocateAndConstructTask(processorMemoryManager); newTestTask->initTask(testTask,processorContext); lastNewTestTask = newTestTask->setNext(lastNewTestTask); } processorCommunicator->communicateTaskCreation(lastNewTestTask); } throw 0; } catch (const int& x) { if (x == 0) { complete = true; } } processorCommunicator->communicateTaskComplete(testTask); } return false; } }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator.cppKonclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkIncrementalAssertionConsistencyRequestGene0000644000175000017500000000347612520551346032411 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator.h" namespace Konclude { namespace Test { COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator::COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator(CConfiguration *config) : COWLFileOWLlinkIncrementalAssertionRequestGenerator(config) { mRequestTypeName = "Consistency"; } QDomElement COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator::getFirstReasoningRequestNode(QDomDocument& document) { QDomElement isKBConsElement = document.createElement("IsKBSatisfiable"); isKBConsElement.setAttribute("kb",mReasonerTestKBName); return isKBConsElement; } QDomElement COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator::getSecondReasoningRequestNode(QDomDocument& document) { QDomElement isKBConsElement = document.createElement("IsKBSatisfiable"); isKBConsElement.setAttribute("kb",mReasonerTestKBName); return isKBConsElement; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CCacheTestReader.h0000644000175000017500000000373412520551342022451 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CCACHETESTREADER_H #define KONCLUDE_TEST_CCACHETESTREADER_H // Libraries includes #include // Namespace includes // Other includes #include "Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Reasoner::Kernel::Cache; namespace Test { /*! * * \class CCacheTestReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCacheTestReader : public QThread { // public methods public: //! Constructor CCacheTestReader(COccurrenceUnsatisfiableCacheReader *occUnsatCacheReader); //! Destructor virtual ~CCacheTestReader(); virtual void startReader(); qint64 getCacheReads(); // protected methods protected: virtual void run(); // protected variables protected: COccurrenceUnsatisfiableCacheReader *reader; qint64 testCount; qint64 unsatCount; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude using namespace Konclude::Test; #endif // KONCLUDE_TEST_CCACHETESTREADER_H Konclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkClassifyRequestGenerator.h0000644000175000017500000000434312520551344027101 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLFILEOWLLINKCLASSIFYREQUESTGENERATOR_H #define KONCLUDE_TEST_COWLFILEOWLLINKCLASSIFYREQUESTGENERATOR_H // Libraries includes #include #include #include #include // Namespace includes // Other includes #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" using namespace std; namespace Konclude { using namespace Config; using namespace Concurrent; namespace Test { /*! * * \class COWLFileOWLlinkClassifyRequestGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLFileOWLlinkClassifyRequestGenerator : public CLogIdentifier { // public methods public: //! Constructor COWLFileOWLlinkClassifyRequestGenerator(CConfiguration *config); //! Destructor virtual ~COWLFileOWLlinkClassifyRequestGenerator(); bool generateOWLlinkClassifyRequest(const QString& requestFileName, const QString& responseFileName); // protected methods protected: QDomDocument createRequestDocument(); // protected variables protected: CConfiguration* mConfig; QString mReasonerTestKBName; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLFILEOWLLINKCLASSIFYREQUESTGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/CCacheTestWriter.cpp0000644000175000017500000000416212520551342023052 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCacheTestWriter.h" namespace Konclude { namespace Test { CCacheTestWriter::CCacheTestWriter(COccurrenceUnsatisfiableCacheWriter *takeOccUnsatCacheWriter) { writer = takeOccUnsatCacheWriter; writeCount = 0; } CCacheTestWriter::~CCacheTestWriter() { quit(); wait(); if (writer) { delete writer; } } void CCacheTestWriter::startWriter() { start(); moveToThread(this); } qint64 CCacheTestWriter::getCacheWrites() { return writeCount; } void CCacheTestWriter::run() { if (writer) { qint64 count = 100; qint64 maxOntTag = 1; qint64 maxConTag = 100; qint64 maxCount = 5; while (true/*--count > 0*/) { qint64 randOntTagNumber = rand() % maxOntTag; qint64 randCount = (rand() % maxCount) + 2; QVector conTags(randCount,0); for (qint64 i = 0; i < randCount; ++i) { qint64 randConTagNumber = rand() % maxConTag; conTags[i] = randConTagNumber; } qSort(conTags); QList values; for (qint64 i = 0; i < randCount; ++i) { values.append(CCacheValue(conTags[i],randOntTagNumber,CCacheValue::CACHEVALCONCEPTONTOLOGYTAG)); } writeCount++; writer->setUnsatisfiable(values); QThread::msleep(10); } } } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CConcurrentMemoryAccessTester.cpp0000644000175000017500000000556212520551344025645 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcurrentMemoryAccessTester.h" namespace Konclude { namespace Test { CConcurrentMemoryAccessTester::CConcurrentMemoryAccessTester() { } CConcurrentMemoryAccessTester::~CConcurrentMemoryAccessTester() { } void CConcurrentMemoryAccessTester::generateTestingStructure(cint64 arraySize, cint64 readWriteRatio, bool atomicOperations, cint64 threadCount) { mArraySize = arraySize; mReadWriteRatio = readWriteRatio; mThreadCount = threadCount; mAtomicOperations = atomicOperations; mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(1024*10-20 /*~ 10 KByte*/); mMemoryArray = new int[mArraySize]; mSharedWrite = false; cint64 threadSize = arraySize / mThreadCount; cint64 nextStart = 0; if (mSharedWrite) { threadSize = mThreadCount; } for (qint64 i = 0; i < mThreadCount; ++i) { CMemoryAccessThread *modThread = 0; modThread = new CMemoryAccessThread(mReadWriteRatio,mMemoryArray,mArraySize,mAtomicOperations,nextStart,nextStart+threadSize,mMemoryPoolProvider); if (!mSharedWrite) { nextStart += threadSize; } mModThreadList.append(modThread); } } void CConcurrentMemoryAccessTester::startHashModificationTest() { cForeach (CMemoryAccessThread* modThread, mModThreadList) { modThread->startModifications(); } } void CConcurrentMemoryAccessTester::stopHashModificationTest() { cForeach (CMemoryAccessThread* modThread, mModThreadList) { modThread->stopModifications(); } cForeach (CMemoryAccessThread* modThread, mModThreadList) { modThread->quit(); } } void CConcurrentMemoryAccessTester::destroyTestingStructure() { cDeleteAll(mModThreadList); delete mMemoryPoolProvider; delete [] mMemoryArray; mModThreadList.clear(); } cint64 CConcurrentMemoryAccessTester::getModificationStepsCount() { cint64 totalModStepsCount = 0; cForeach (CMemoryAccessThread* modThread, mModThreadList) { totalModStepsCount += modThread->getModificationStepsCount(); } return totalModStepsCount; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/COWLTransitiveConnectedELClassesTestDataGenerator.cpp0000644000175000017500000001475712520551350031421 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLTransitiveConnectedELClassesTestDataGenerator.h" namespace Konclude { namespace Test { COWLTransitiveConnectedELClassesTestDataGenerator::COWLTransitiveConnectedELClassesTestDataGenerator() : CLogIdentifier("::Konclude::Test::OWLRecursionTestDataGenerator",this) { owllinkNS = "http://www.owllink.org/owllink#"; owlNS = "http://www.w3.org/2002/07/owl#"; mClassBaseName = "http://ex.text/Class/"; mPropertyBaseName = "http://ex.text/Prop/"; } COWLTransitiveConnectedELClassesTestDataGenerator::~COWLTransitiveConnectedELClassesTestDataGenerator() { } QString COWLTransitiveConnectedELClassesTestDataGenerator::getClassName(cint64 classNumber) { QString numberString(QString::number(classNumber)); while (numberString.count() < mClassesNumberSize) { numberString.insert(0,"0"); } return mClassBaseName+numberString; } void COWLTransitiveConnectedELClassesTestDataGenerator::generateData(cint64 size, const QString& filename) { QFile file(filename); if (file.open(QIODevice::WriteOnly)) { QString mSizeNumber(QString::number(size-1)); mClassesNumberSize = mSizeNumber.count(); mXMLWriter = new QXmlStreamWriter(&file); mXMLWriter->setAutoFormatting(true); mXMLWriter->writeStartDocument("1.0"); mXMLWriter->writeStartElement("Ontology"); mXMLWriter->writeDefaultNamespace("http://www.w3.org/2002/07/owl#"); createTransistiveConnectedELClassesData(size); mXMLWriter->writeEndElement(); mXMLWriter->writeEndDocument(); delete mXMLWriter; file.close(); } } void COWLTransitiveConnectedELClassesTestDataGenerator::createTransistiveConnectedELClassesData(cint64 size) { createPropertyDeclarations(); createClassesDeclarations(size); createClassCycleDefinitions(mPropertyBaseName+"r",size); createPropertyChains(); } void COWLTransitiveConnectedELClassesTestDataGenerator::createPropertyDeclarations() { writePropertyDeclaration(mPropertyBaseName+"r"); } void COWLTransitiveConnectedELClassesTestDataGenerator::createPropertyChains() { mXMLWriter->writeStartElement("SubClassOf"); mXMLWriter->writeStartElement("ObjectSomeValuesFrom"); mXMLWriter->writeStartElement("ObjectProperty"); mXMLWriter->writeAttribute("IRI",mPropertyBaseName+"r"); mXMLWriter->writeEndElement(); mXMLWriter->writeStartElement("Class"); mXMLWriter->writeAttribute("IRI",mClassBaseName+"A"); mXMLWriter->writeEndElement(); mXMLWriter->writeEndElement(); mXMLWriter->writeStartElement("Class"); mXMLWriter->writeAttribute("IRI",mClassBaseName+"A"); mXMLWriter->writeEndElement(); mXMLWriter->writeEndElement(); mXMLWriter->writeStartElement("SubObjectPropertyOf"); mXMLWriter->writeStartElement("ObjectPropertyChain"); mXMLWriter->writeStartElement("ObjectProperty"); mXMLWriter->writeAttribute("IRI",mPropertyBaseName+"r"); mXMLWriter->writeEndElement(); mXMLWriter->writeStartElement("ObjectProperty"); mXMLWriter->writeAttribute("IRI",mPropertyBaseName+"r"); mXMLWriter->writeEndElement(); mXMLWriter->writeEndElement(); mXMLWriter->writeStartElement("ObjectProperty"); mXMLWriter->writeAttribute("IRI",mPropertyBaseName+"r"); mXMLWriter->writeEndElement(); mXMLWriter->writeEndElement(); } void COWLTransitiveConnectedELClassesTestDataGenerator::createClassesDeclarations(cint64 size) { writeClassDeclaration(mClassBaseName+"A"); for (cint64 classID = 0; classID < size; ++classID) { QString className = getClassName(classID); writeClassDeclaration(className); } } void COWLTransitiveConnectedELClassesTestDataGenerator::createClassCycleDefinitions(const QString& propertyName, cint64 maxNumber) { for (cint64 classID = 0; classID < maxNumber-1; ++classID) { cint64 classID1 = classID; cint64 classID2 = classID+1; QString class1String = getClassName(classID1); QString class2String = getClassName(classID2); writeClassSubsetExistentialDefinition(propertyName,class1String,class2String); } QString class1String = getClassName(maxNumber-1); QString class2String = getClassName(0); writeClassSubsetExistentialDefinition(propertyName,class1String,class2String); writeClassSubsetExistentialDefinition(propertyName,class1String,mClassBaseName+"A"); } void COWLTransitiveConnectedELClassesTestDataGenerator::writeClassSubsetExistentialDefinition(const QString& propertyName, const QString& className1, const QString& className2) { mXMLWriter->writeStartElement("SubClassOf"); mXMLWriter->writeStartElement("Class"); mXMLWriter->writeAttribute("IRI",className1); mXMLWriter->writeEndElement(); mXMLWriter->writeStartElement("ObjectSomeValuesFrom"); mXMLWriter->writeStartElement("ObjectProperty"); mXMLWriter->writeAttribute("IRI",propertyName); mXMLWriter->writeEndElement(); mXMLWriter->writeStartElement("Class"); mXMLWriter->writeAttribute("IRI",className2); mXMLWriter->writeEndElement(); mXMLWriter->writeEndElement(); mXMLWriter->writeEndElement(); } void COWLTransitiveConnectedELClassesTestDataGenerator::writeClassDeclaration(const QString& classviualName) { mXMLWriter->writeStartElement("Declaration"); mXMLWriter->writeStartElement("Class"); mXMLWriter->writeAttribute("IRI",classviualName); mXMLWriter->writeEndElement(); mXMLWriter->writeEndElement(); } void COWLTransitiveConnectedELClassesTestDataGenerator::writePropertyDeclaration(const QString& propertyName) { mXMLWriter->writeStartElement("Declaration"); mXMLWriter->writeStartElement("ObjectProperty"); mXMLWriter->writeAttribute("IRI",propertyName); mXMLWriter->writeEndElement(); mXMLWriter->writeEndElement(); } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestsuiteTestResult.h0000644000175000017500000000343712520551352025213 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CREASONERTESTSUITETESTRESULT_H #define KONCLUDE_TEST_CREASONERTESTSUITETESTRESULT_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Test { /*! * * \class CReasonerTestsuiteTestResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerTestsuiteTestResult { // public methods public: //! Constructor CReasonerTestsuiteTestResult(); //! Destructor virtual ~CReasonerTestsuiteTestResult(); virtual double getTotalTestingTime(); virtual CReasonerTestsuiteTestResult *setTotalTestingTime(double testTime); // protected methods protected: // protected variables protected: double totTestTime; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_CREASONERTESTSUITETESTRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Test/CConcurrentThroughputTestTaskTester.h0000644000175000017500000000605012520551344026545 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CCONCURRENTTHROUGHPUTTESTTASKTESTER_H #define KONCLUDE_TEST_CCONCURRENTTHROUGHPUTTESTTASKTESTER_H // Libraries includes #include #include #include // Namespace includes #include "CThroughputTestTask.h" #include "CThroughputTestTaskHandleAlgorithm.h" // Other includes #include "Concurrent/Callback/CCallbackData.h" #include "Scheduler/CSingleThreadTaskProcessorUnit.h" #include "Scheduler/CTaskEventCommunicator.h" #include "Scheduler/CTaskProcessorSchedulerThread.h" #include "Scheduler/CTaskProcessorCompletorThread.h" #include "Scheduler/CTaskProcessorThread.h" #include "Utilities/Memory/CObjectMemoryPoolAllocator.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; using namespace Utilities::Memory; using namespace Concurrent::Callback; namespace Test { /*! * * \class CConcurrentThroughputTestTaskTester * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcurrentThroughputTestTaskTester : public CCallbackData { // public methods public: //! Constructor CConcurrentThroughputTestTaskTester(); //! Destructor virtual ~CConcurrentThroughputTestTaskTester(); void generateTestingStructure(cint64 maxBranchDepth, cint64 branchingFactor); void startTesting(); void stopTesting(); cint64 getTaskProcessedCount(); void destroyTestingStructure(); virtual void doCallback(); // protected methods protected: // protected variables protected: CSingleThreadTaskProcessorUnit* mProcessUnit; CTaskProcessorSchedulerThread* mSchedulerUnit; CTaskProcessorCompletorThread* mCompletorUnit; CThroughputTestTaskHandleAlgorithm* mHandleAlg; QList mProcessorUnitList; cint64 mMaxBranchDepth; cint64 mBranchingFactor; cint64 mTotalTestTasks; cint64 mThreadTestCount; cint64 mThreadMaxTestCount; cint64 mScaleReferenceTime; QTime mMeasurementTimer; cint64 mLastEventProcessed; cint64 mLastTaskProcessed; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_CCONCURRENTTHROUGHPUTTESTTASKTESTER_H Konclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestfileTestResult.h0000644000175000017500000000453712520551352025003 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CREASONERTESTFILETESTRESULT_H #define KONCLUDE_TEST_CREASONERTESTFILETESTRESULT_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Test { /*! * * \class CReasonerTestfileTestResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerTestfileTestResult { // public methods public: //! Constructor CReasonerTestfileTestResult(); //! Destructor virtual ~CReasonerTestfileTestResult(); virtual double getAverageCorrectResponseTime(); virtual qint64 getCorrectResponseCount(); virtual qint64 getCrashCount(); virtual qint64 getErrorCount(); virtual qint64 getTotalTestCount(); virtual qint64 getTimeoutCount(); virtual qint64 getWrongResponseCount(); virtual qint64 getFailedCount(); virtual CReasonerTestfileTestResult *addTestResult(bool crashed, bool timeout, bool error, bool correctResponse, double responseTime); virtual CReasonerTestfileTestResult *addFailedResult(); // protected methods protected: // protected variables protected: double avgResponseTime; qint64 corrRespCount; qint64 totTestCount; qint64 crashCount; qint64 errorCount; qint64 timeoutCount; qint64 wrongRespCount; qint64 failedCount; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_CREASONERTESTFILETESTRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestsuiteTest.cpp0000644000175000017500000000471412520551352024346 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerTestsuiteTest.h" namespace Konclude { namespace Test { CReasonerTestsuiteTest::CReasonerTestsuiteTest() { testExeCount = 1; timeout = 0; } CReasonerTestsuiteTest::~CReasonerTestsuiteTest() { qDeleteAll(testList); } CReasonerTestsuiteTestResult *CReasonerTestsuiteTest::getTestsuiteResult() { return &testsuiteResult; } qint64 CReasonerTestsuiteTest::getDefaultTestLoopCount() { return testExeCount; } CReasonerTestsuiteTest *CReasonerTestsuiteTest::setDefaultTestLoopCount(qint64 loopCount) { testExeCount = loopCount; return this; } QString CReasonerTestsuiteTest::getDefaultWorkingDirectory() { return workDir; } CReasonerTestsuiteTest *CReasonerTestsuiteTest::setDefaultWorkingDirectory(const QString &workingDir) { workDir = workingDir; return this; } bool CReasonerTestsuiteTest::hasDefaultWorkingDirectory() { return !workDir.isEmpty(); } CReasonerTestfileTest *CReasonerTestsuiteTest::createTestfileTest() { CReasonerTestfileTest *test = new CReasonerTestfileTest(); testList.append(test); if (hasDefaultWorkingDirectory()) { test->setWorkingDirectory(getDefaultWorkingDirectory()); } test->setTestLoopCount(getDefaultTestLoopCount()); test->setTimeout(timeout); return test; } QLinkedList CReasonerTestsuiteTest::getTestfileTestList() { return testList; } qint64 CReasonerTestsuiteTest::getDefaultTimeout() { return timeout; } CReasonerTestsuiteTest *CReasonerTestsuiteTest::setDefaultTimeout(qint64 defTimeout) { timeout = defTimeout; return this; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CThroughputTestTaskTester.cpp0000644000175000017500000000422512520551352025036 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CThroughputTestTaskTester.h" namespace Konclude { namespace Test { CThroughputTestTaskTester::CThroughputTestTaskTester() { handleAlg = new CThroughputTestTaskHandleAlgorithm(); } CThroughputTestTaskTester::~CThroughputTestTaskTester() { } void CThroughputTestTaskTester::generateTestingStructure(cint64 maxBranchDepth, cint64 branchingFactor) { mMaxBranchDepth = maxBranchDepth; mBranchingFactor = branchingFactor; mProcessUnit = new CSingleThreadTaskProcessorUnit(handleAlg); mProcessUnit->startProcessing(); } void CThroughputTestTaskTester::startTesting() { CThroughputTestTask* rootTask = CObjectMemoryPoolAllocator::allocateAndConstructWithMemroyPool(); rootTask->initTestTask(mMaxBranchDepth,mBranchingFactor); CTaskEventCommunicator::postSendTaskProcessEvent(mProcessUnit->getEventHandler(),rootTask,false,nullptr); } void CThroughputTestTaskTester::stopTesting() { } void CThroughputTestTaskTester::destroyTestingStructure() { mProcessUnit->stopProcessing(); mProcessUnit->stopThread(); delete mProcessUnit; } cint64 CThroughputTestTaskTester::getTaskProcessedCount() { cint64 totalProcessedCount = mProcessUnit->getTaskProcessingStatistics()->getStatisticTasksProcessedCount(); return totalProcessedCount; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CConcurrentOccurenceUnsatisfiableCacheTester.h0000644000175000017500000000457512520551344030267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CCONCURRENTOCCURENCEUNSATISFIABLECACHETESTER_H #define KONCLUDE_TEST_CCONCURRENTOCCURENCEUNSATISFIABLECACHETESTER_H // Libraries includes // Namespace includes #include "CCacheTestReader.h" #include "CCacheTestWriter.h" // Other includes #include "Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCache.h" #include "Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheReader.h" #include "Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheWriter.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Reasoner::Kernel::Cache; namespace Test { /*! * * \class CConcurrentOccurenceUnsatisfiableCacheTester * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcurrentOccurenceUnsatisfiableCacheTester { // public methods public: //! Constructor CConcurrentOccurenceUnsatisfiableCacheTester(); //! Destructor virtual ~CConcurrentOccurenceUnsatisfiableCacheTester(); void generateCacheStructure(qint64 cacheReaderCount); void runCacheTest(); qint64 getCacheWrites(); qint64 getCacheReads(); // protected methods protected: // protected variables protected: COccurrenceUnsatisfiableCache *occUnsatCache; qint64 readerCount; CCacheTestWriter *writer; QLinkedList readerList; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude using namespace Konclude::Test; #endif // KONCLUDE_TEST_CCONCURRENTOCCURENCEUNSATISFIABLECACHETESTER_H Konclude-v0.6.2-544-SourceCode/Source/Test/CMemoryAccessThread.cpp0000644000175000017500000000563512520551344023544 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMemoryAccessThread.h" namespace Konclude { namespace Test { CMemoryAccessThread::CMemoryAccessThread(cint64 readWriteRatio, int* accessArray, cint64 arraySize, bool atomicOperations, cint64 minWriteIndex, cint64 maxWriteIndex, CMemoryPoolProvider* memoryPoolProvider) { mModificationSteps = 0; mContextBase = 0; mMemoryPoolAllocationMan = 0; mCanceled = false; mMemoryAccessArray = accessArray; mReadWriteRatio = readWriteRatio; mArraySize = arraySize; mMemoryPoolProvider = memoryPoolProvider; mMemoryPoolAllocationMan = new CMemoryPoolAllocationManager(mMemoryPoolProvider); mContextBase = new CContextBase(mMemoryPoolAllocationMan); mAtomicIncrements = atomicOperations; mLocalWriteStep = 3; mLocalWrite = true; mMinWriteIndex = minWriteIndex; mMaxWriteIndex = maxWriteIndex; mLocalWriteIndex = mMinWriteIndex; } CMemoryAccessThread::~CMemoryAccessThread() { quit(); wait(); delete mContextBase; delete mMemoryPoolAllocationMan; } void CMemoryAccessThread::startModifications() { start(); moveToThread(this); } void CMemoryAccessThread::stopModifications() { mCanceled = true; } cint64 CMemoryAccessThread::getModificationStepsCount() { return mModificationSteps; } void CMemoryAccessThread::run() { while (!mCanceled) { int newValue = 0; for (cint64 i = 0; i < mReadWriteRatio; ++i) { qint64 arrayIndex = qrand() % mArraySize; int arrayValue = mMemoryAccessArray[arrayIndex]; newValue += arrayValue; } qint64 arrayIndex = 0; if (!mLocalWrite) { arrayIndex = qrand() % (mArraySize-100); } else { mLocalWriteIndex += mLocalWriteStep; if (mLocalWriteIndex >= mMaxWriteIndex) { mLocalWriteIndex = mMinWriteIndex; } arrayIndex = mLocalWriteIndex; } if (mAtomicIncrements) { QAtomicInt* atomicInt = (QAtomicInt*)&(mMemoryAccessArray[arrayIndex]); atomicInt->fetchAndAddOrdered(newValue); } else { mMemoryAccessArray[arrayIndex] += newValue; } ++mModificationSteps; } } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/COWLTransitiveConnectedELClassesTestDataGenerator.h0000644000175000017500000000541212520551350031052 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLTRANSITIVECONNECTEDELCLASSESTESTDATAGENERATOR_H #define KONCLUDE_TEST_COWLTRANSITIVECONNECTEDELCLASSESTESTDATAGENERATOR_H // Libraries includes #include // Namespace includes #include "Utilities/UtilitiesSettings.h" // Other includes #include // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Logger; using namespace Utilities; namespace Test { /*! * * \class COWLTransitiveConnectedELClassesTestDataGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLTransitiveConnectedELClassesTestDataGenerator : public CLogIdentifier { // public methods public: //! Constructor COWLTransitiveConnectedELClassesTestDataGenerator(); //! Destructor virtual ~COWLTransitiveConnectedELClassesTestDataGenerator(); void generateData(cint64 size, const QString& filename); // protected methods protected: void createTransistiveConnectedELClassesData(cint64 size); void createClassesDeclarations(cint64 size); void createPropertyDeclarations(); void createClassCycleDefinitions(const QString& propertyName, cint64 maxNumber); void createPropertyChains(); void writePropertyDeclaration(const QString& propertyName); void writeClassDeclaration(const QString& indiviualName); void writeClassSubsetExistentialDefinition(const QString& propertyName, const QString& className1, const QString& className2); QString getClassName(cint64 classNumber); // protected variables protected: QString owllinkNS; QString owlNS; cint64 mClassesNumberSize; QString mClassBaseName; QString mPropertyBaseName; QXmlStreamWriter* mXMLWriter; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLTRANSITIVECONNECTEDELCLASSESTESTDATAGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/CMemoryAccessThread.h0000644000175000017500000000544512520551344023210 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CMEMORYACCESSTHREAD_H #define KONCLUDE_TEST_CMEMORYACCESSTHREAD_H // Libraries includes #include // Namespace includes // Other includes #include "Utilities/Container/CQtHash.h" #include "Utilities/Container/CQtManagedRestrictedModificationHash.h" #include "Utilities/Memory/CObjectAllocator.h" #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/UtilitiesSettings.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; using namespace Utilities; using namespace Utilities::Container; using namespace Utilities::Memory; namespace Test { /*! * * \class CMemoryAccessThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMemoryAccessThread : public QThread { // public methods public: //! Constructor CMemoryAccessThread(cint64 readWriteRatio, int* accessArray, cint64 arraySize, bool atomicOperations, cint64 minWriteIndex, cint64 maxWriteIndex, CMemoryPoolProvider* memoryPoolProvider); //! Destructor virtual ~CMemoryAccessThread(); virtual void startModifications(); virtual void stopModifications(); cint64 getModificationStepsCount(); // protected methods protected: virtual void run(); // protected variables protected: int* mMemoryAccessArray; cint64 mArraySize; CMemoryPoolProvider* mMemoryPoolProvider; CMemoryPoolAllocationManager* mMemoryPoolAllocationMan; CContextBase* mContextBase; bool mCanceled; cint64 mReadWriteRatio; cint64 mModificationSteps; bool mAtomicIncrements; bool mLocalWrite; cint64 mLocalWriteStep; cint64 mLocalWriteIndex; cint64 mMinWriteIndex; cint64 mMaxWriteIndex; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude using namespace Konclude::Test; #endif // KONCLUDE_TEST_CMEMORYACCESSTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Test/COWLFileAxiomRemover.h0000644000175000017500000000471112520551344023260 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLFILEAXIOMREMOVER_H #define KONCLUDE_TEST_COWLFILEAXIOMREMOVER_H // Libraries includes #include #include #include #include // Namespace includes // Other includes #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" using namespace std; namespace Konclude { using namespace Config; using namespace Concurrent; namespace Test { /*! * * \class COWLFileAxiomRemover * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLFileAxiomRemover : public CLogIdentifier { // public methods public: //! Constructor COWLFileAxiomRemover(CConfiguration *config); //! Destructor virtual ~COWLFileAxiomRemover(); bool loadRemoveAxiomsAndSave(const QString& requestFileName, const QString& responseFileName); // protected methods protected: bool removeElements(QDomElement& domElement, bool axiomLevel, QDomDocument& document); void removeAttributes(QDomElement& domElement, QDomDocument& document); // protected variables protected: QSet mRemoveTagNameSet; QSet mAlwaysRemoveTagNameSet; QSet mRemoveAttributeNameSet; CConfiguration* mConfig; cint64 mStatRemovedAxioms; cint64 mStatReplacedExpressions; bool mConfReplaceDatatypeExpressions; // private methods private: // private methods private slots: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLFILEAXIOMREMOVER_H Konclude-v0.6.2-544-SourceCode/Source/Test/COWLRecursionTestDataGenerator.cpp0000644000175000017500000001343212520551350025645 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLRecursionTestDataGenerator.h" namespace Konclude { namespace Test { COWLRecursionTestDataGenerator::COWLRecursionTestDataGenerator() : CLogIdentifier("::Konclude::Test::OWLRecursionTestDataGenerator",this) { owllinkNS = "http://www.owllink.org/owllink#"; owlNS = "http://www.w3.org/2002/07/owl#"; mIndividualBaseName = "http://ex.text/Indi/"; mPropertyBaseName = "http://ex.text/Prop/"; } COWLRecursionTestDataGenerator::~COWLRecursionTestDataGenerator() { } QString COWLRecursionTestDataGenerator::getIndividualName(cint64 indiNumber) { QString numberString(QString::number(indiNumber)); while (numberString.count() < mIndividualsNumberSize) { numberString.insert(0,"0"); } return mIndividualBaseName+numberString; } void COWLRecursionTestDataGenerator::generateData(cint64 size, double rate, const QString& filename) { QFile file(filename); if (file.open(QIODevice::WriteOnly)) { QString mSizeNumber(QString::number(size-1)); mIndividualsNumberSize = mSizeNumber.count(); mXMLWriter = new QXmlStreamWriter(&file); mXMLWriter->setAutoFormatting(true); mXMLWriter->writeStartDocument("1.0"); mXMLWriter->writeStartElement("Ontology"); mXMLWriter->writeDefaultNamespace("http://www.w3.org/2002/07/owl#"); createLargeJoinData(size,rate); mXMLWriter->writeEndElement(); mXMLWriter->writeEndDocument(); delete mXMLWriter; file.close(); } } void COWLRecursionTestDataGenerator::createLargeJoinData(cint64 size, double rate) { createPropertyDeclarations(); createIndividualDeclarations(size); cint64 propertyCount = size*rate; createPropertyCycleAssertions(mPropertyBaseName+"par",size); createPropertyAssertions(mPropertyBaseName+"par",propertyCount,size); } void COWLRecursionTestDataGenerator::createPropertyDeclarations() { writePropertyDeclaration(mPropertyBaseName+"par"); } void COWLRecursionTestDataGenerator::createIndividualDeclarations(cint64 size) { for (cint64 indiID = 0; indiID < size; ++indiID) { QString indiName = getIndividualName(indiID); writeIndividualDeclaration(indiName); } } void COWLRecursionTestDataGenerator::createPropertyAssertions(const QString& propertyName, cint64 count, cint64 maxNumber) { for (cint64 nr = 0; nr < count; ++nr) { cint64 indiID1 = qrand() % maxNumber; cint64 indiID2 = qrand() % maxNumber; if (!mPropPairSet.contains( QPair(indiID1,indiID2) )) { mPropPairSet.insert( QPair(indiID1,indiID2) ); QString indi1String = getIndividualName(indiID1); QString indi2String = getIndividualName(indiID2); writeIndividualPropertyAssertion(propertyName,indi1String,indi2String); } else { --nr; } } } void COWLRecursionTestDataGenerator::createPropertyCycleAssertions(const QString& propertyName, cint64 maxNumber) { for (cint64 indiID = 0; indiID < maxNumber-1; ++indiID) { cint64 indiID1 = indiID; cint64 indiID2 = indiID+1; if (!mPropPairSet.contains( QPair(indiID1,indiID2) )) { mPropPairSet.insert( QPair(indiID1,indiID2) ); QString indi1String = getIndividualName(indiID1); QString indi2String = getIndividualName(indiID2); writeIndividualPropertyAssertion(propertyName,indi1String,indi2String); } } if (!mPropPairSet.contains( QPair(maxNumber-1,0) )) { mPropPairSet.insert( QPair(maxNumber-1,0) ); QString indi1String = getIndividualName(maxNumber-1); QString indi2String = getIndividualName(0); writeIndividualPropertyAssertion(propertyName,indi1String,indi2String); } } void COWLRecursionTestDataGenerator::writeIndividualPropertyAssertion(const QString& propertyName, const QString& indiviualName1, const QString& indiviualName2) { mXMLWriter->writeStartElement("ObjectPropertyAssertion"); mXMLWriter->writeStartElement("ObjectProperty"); mXMLWriter->writeAttribute("IRI",propertyName); mXMLWriter->writeEndElement(); mXMLWriter->writeStartElement("NamedIndividual"); mXMLWriter->writeAttribute("IRI",indiviualName1); mXMLWriter->writeEndElement(); mXMLWriter->writeStartElement("NamedIndividual"); mXMLWriter->writeAttribute("IRI",indiviualName2); mXMLWriter->writeEndElement(); mXMLWriter->writeEndElement(); } void COWLRecursionTestDataGenerator::writeIndividualDeclaration(const QString& indiviualName) { mXMLWriter->writeStartElement("Declaration"); mXMLWriter->writeStartElement("NamedIndividual"); mXMLWriter->writeAttribute("IRI",indiviualName); mXMLWriter->writeEndElement(); mXMLWriter->writeEndElement(); } void COWLRecursionTestDataGenerator::writePropertyDeclaration(const QString& propertyName) { mXMLWriter->writeStartElement("Declaration"); mXMLWriter->writeStartElement("ObjectProperty"); mXMLWriter->writeAttribute("IRI",propertyName); mXMLWriter->writeEndElement(); mXMLWriter->writeEndElement(); } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CQHashVsQMapTester.cpp0000644000175000017500000000344012520551350023272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQHashVsQMapTester.h" namespace Konclude { namespace Test { CQHashVsQMapTester::CQHashVsQMapTester() { } CQHashVsQMapTester::~CQHashVsQMapTester() { } void CQHashVsQMapTester::startModificationTest(cint64 modificationCount) { cint64 maxValue = 1000000; mMeasurementTimer.start(); for (cint64 i = 0; i < modificationCount; ++i) { qint64 modHashKey = qrand() % maxValue; mTestMap.insert(modHashKey,i); } cint64 elapsedTimeMap = mMeasurementTimer.elapsed(); cout<<"map modification time: "<. * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerTestfileTester.h" namespace Konclude { namespace Test { CReasonerTestfileTester::CReasonerTestfileTester(CConfiguration *config, CWatchDog *watchDog) : CIntervalThread("Testfile-Tester-Thread",watchDog), CLogIdentifier("::Konclude::Test::ReasonerTestfileTester",this) { wCount = 1; testProcess = 0; processCrashed = false; processTimedout = false; testCommand = 0; testfileTest = 0; evaluator = 0; commandRecordRouter = 0; reasonerString = QString("ExperimentalReasonerLoader"); closeTimeout = 1000; killTimeout = 1000; runTimeout = 60000; CConfigData *confData = config->getRelatedConfigChange("Konclude.Calculation.WorkerCount"); if (confData) { QString workerCountString = confData->getString(); bool ok = true; wCount = qMax(workerCountString.toInt(&ok),0); if (!ok) { wCount = CThread::idealThreadCount(); } } confData = config->getRelatedConfigChange("Konclude.Execution.CalculationManager"); if (confData && confData->supportsStringConvertion()) { reasonerConfigString += QString(" +=%1=%2 ").arg(confData->getConfigDescription()->getConfigName()).arg(confData->getString()); } confData = config->getRelatedConfigChange("Konclude.Calculation.WorkerCount"); if (confData && confData->supportsStringConvertion()) { reasonerConfigString += QString(" +=%1=%2 ").arg(confData->getConfigDescription()->getConfigName()).arg(confData->getString()); } confData = config->getRelatedConfigChange("Konclude.Calculation.ProcessorCount"); if (confData && confData->supportsStringConvertion()) { reasonerConfigString += QString(" +=%1=%2 ").arg(confData->getConfigDescription()->getConfigName()).arg(confData->getString()); } confData = config->getRelatedConfigChange("Konclude.OWLlink.Test.RunTimeout"); if (confData) { runTimeout = confData->getInteger(); } confData = config->getRelatedConfigChange("Konclude.OWLlink.Test.CloseTimeout"); if (confData) { closeTimeout = confData->getInteger(); } confData = config->getRelatedConfigChange("Konclude.OWLlink.Test.KillTimeout"); if (confData) { killTimeout = confData->getInteger(); } confData = config->getRelatedConfigChange("Konclude.Execution.DefaultReasonerManager"); if (confData) { reasonerString = confData->getString(); if (reasonerString == "ASExperimentalReasonerManager") { reasonerString = QString("ExperimentalReasonerLoader"); } else if (reasonerString == "ASAnalyseReasonerManager") { reasonerString = QString("AnalyseReasonerLoader"); } else { reasonerString = QString("DefaultReasonerLoader"); } } CConfigurationGroup* configGroup = config->getConfigurationGroup(); QList configDesList(configGroup->getConfigDescriptonList()); FOREACHIT (CConfigDescription* configDes, configDesList) { QString configName = configDes->getConfigName(); bool propagateConfig = false; if (configName.startsWith("Konclude.Calculation.")) { propagateConfig = true; } else if (configName.startsWith("Konclude.Execution.")) { if (!configName.startsWith("Konclude.Execution.CommandLine")) { propagateConfig = true; } } if (propagateConfig) { confData = config->getRelatedConfigChange(configName); if (confData && confData->supportsStringConvertion()) { reasonerConfigString += QString(" +=%1=%2 ").arg(configName).arg(confData->getString()); } } } //runTimeout = 120000; startThread(); } CReasonerTestfileTester::~CReasonerTestfileTester() { } CReasonerTestfileTester *CReasonerTestfileTester::realizeTestCommand(CTestTestfileCommand *command, CReasonerTestfileEvaluator *testEvaluator) { if (commandRecordRouter) { delete commandRecordRouter; commandRecordRouter = 0; } commandRecordRouter = new CCommandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(commandRecordRouter); testCommand = command; testfileTest = testCommand->getReasonerTestfileTest(); testfile = testfileTest->getTestRequestFile(); evaluator = testEvaluator; sendStartTestfileTestEvent(); return this; } bool CReasonerTestfileTester::processTimer(qint64 timerID) { if (timerID == TIMERCLOSEPROCESSID) { CUnspecifiedMessageInformationRecord::makeRecord(QString("Test %1 for testfile '%2' timed out.").arg(testfileTest->getTestResults()->getTotalTestCount()).arg(testfile),commandRecordRouter); LOG(WARNING,getLogDomain(),logTr("Test %1 for '%2' timed out.").arg(testfileTest->getTestResults()->getTotalTestCount()+1).arg(testfile),this); processTimedout = true; sendEvaluateTestfileTestEvent(); return true; } return false; } bool CReasonerTestfileTester::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CIntervalThread::processCustomsEvents(type,event)) { return true; } else if (type == EVENTTESTFILE) { CTestTestfileEvent *tte = (CTestTestfileEvent *)event; startTestfileTest(); } else if (type == EVENTEVALUATETESTFILE) { CEvaluateTestfileTestEvent *ette = (CEvaluateTestfileTestEvent *)event; evaluateTestfileTest(); } return false; } void CReasonerTestfileTester::sendEvaluateTestfileTestEvent() { QCoreApplication::postEvent(this,new CEvaluateTestfileTestEvent()); } void CReasonerTestfileTester::sendStartTestfileTestEvent() { QCoreApplication::postEvent(this,new CTestTestfileEvent()); } void CReasonerTestfileTester::startTestfileTest() { if (!testProcess) { qint64 testTimeout = testfileTest->getTimeout(); if (testTimeout <= 0) { testTimeout = runTimeout; } startTimerWithInterval(TIMERCLOSEPROCESSID,testTimeout); processCrashed = false; processTimedout = false; testProcess = new QProcess(); QString workDir = QDir::currentPath(); if (testfileTest->hasWorkingDirectory()) { workDir = testfileTest->getWorkingDirectory(); } testProcess->setWorkingDirectory(workDir); QString appString = QCoreApplication::applicationFilePath(); QStringList argumentList; argumentList += QString("-ConfigurableCoutLogObserverLoader"); argumentList += QString("-%1 %2").arg(reasonerString).arg(reasonerConfigString); argumentList += QString("-OWLlinkBatchFileLoader +=Konclude.OWLlink.RequestFile=%1").arg(testfile); argumentList += QString("+=Konclude.OWLlink.WriteResponseToStandardError=true +=Konclude.OWLlink.CloseAfterProcessedRequest=true"); connect(testProcess,SIGNAL(error(QProcess::ProcessError)),this,SLOT(processError(QProcess::ProcessError)),Qt::DirectConnection); connect(testProcess,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(processFinished(int,QProcess::ExitStatus)),Qt::DirectConnection); LOG(INFO,getLogDomain(),logTr("Starting %1. test for '%2'.").arg(testfileTest->getTestResults()->getTotalTestCount()+1).arg(testfile),this); testProcess->start(appString,argumentList); if (!testProcess->waitForStarted(10000)) { testfileTest->getTestResults()->addFailedResult(); sendEvaluateTestfileTestEvent(); } //testProcess->start("echo",QStringList()<<"hallo"); } } void CReasonerTestfileTester::evaluateTestfileTest() { if (testProcess) { stopTimer(TIMERCLOSEPROCESSID); QString errorString = testProcess->errorString(); QByteArray standOutput = testProcess->readAllStandardOutput(); QString outputString(standOutput); QByteArray standError = testProcess->readAllStandardError(); testProcess->close(); if (!testProcess->waitForFinished(closeTimeout)) { testProcess->kill(); testProcess->waitForFinished(killTimeout); } if (processCrashed) { testfileTest->getTestResults()->addTestResult(true,processTimedout,false,false,0.); if (!processTimedout) { LOG(WARNING,getLogDomain(),logTr("Test %1 for '%2' has CRASHED.").arg(testfileTest->getTestResults()->getTotalTestCount()).arg(testfile),this); } } else if (processTimedout) { testfileTest->getTestResults()->addTestResult(false,true,false,false,0.); } else { evaluator->evaluateTestfile(testfileTest,standError); } disconnect(testProcess); delete testProcess; testProcess = 0; CUnspecifiedMessageInformationRecord::makeRecord(QString("Test %1 for testfile '%2' concluded.").arg(testfileTest->getTestResults()->getTotalTestCount()).arg(testfile),commandRecordRouter); //LOG(INFO,getLogDomain(),logTr("Test %1 for testfile '%2' concluded.").arg(testfileTest->getTestResults()->getTotalTestCount()).arg(testfile),this); if (testfileTest->getTestResults()->getTotalTestCount() < testfileTest->getTestLoopCount()) { sendStartTestfileTestEvent(); } else { CStopProcessCommandRecord::makeRecord(commandRecordRouter); CFinishProcessCommandRecord::makeRecord(commandRecordRouter); } } } void CReasonerTestfileTester::processError(QProcess::ProcessError error) { processCrashed = true; sendEvaluateTestfileTestEvent(); } void CReasonerTestfileTester::processFinished(int exitCode, QProcess::ExitStatus exitStatus) { if (exitStatus != QProcess::NormalExit) { processCrashed = true; } sendEvaluateTestfileTestEvent(); } }; // end namespace Test }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator.cppKonclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkIncrementalAssertionClassificationRequestG0000644000175000017500000000351612520551346032346 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator.h" namespace Konclude { namespace Test { COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator::COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator(CConfiguration *config) : COWLFileOWLlinkIncrementalAssertionRequestGenerator(config) { mRequestTypeName = "Classification"; } QDomElement COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator::getFirstReasoningRequestNode(QDomDocument& document) { QDomElement kbClassifyElement = document.createElement("Classify"); kbClassifyElement.setAttribute("kb",mReasonerTestKBName); return kbClassifyElement; } QDomElement COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator::getSecondReasoningRequestNode(QDomDocument& document) { QDomElement kbClassifyElement = document.createElement("Classify"); kbClassifyElement.setAttribute("kb",mReasonerTestKBName); return kbClassifyElement; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CConcurrentHashModificationTester.h0000644000175000017500000000533212520551342026122 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CCONCURRENTHASHMODIFICATIONTESTER_H #define KONCLUDE_TEST_CCONCURRENTHASHMODIFICATIONTESTER_H // Libraries includes // Namespace includes #include "CHashModificationThread.h" // Other includes #include "Utilities/Container/CList.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; using namespace Utilities::Memory; namespace Test { /*! * * \class CConcurrentHashModificationTester * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcurrentHashModificationTester { // public methods public: //! Constructor CConcurrentHashModificationTester(); //! Destructor virtual ~CConcurrentHashModificationTester(); void generateTestingStructure(cint64 modificationThreadsCount, cint64 modificationCountPerStep, bool useModifiedHashes, bool extendBaseHashes); void startHashModificationTest(); void stopHashModificationTest(); cint64 getModificationStepsCount(); void destroyTestingStructure(); // protected methods protected: // protected variables protected: CList mModThreadList; CList*> mHashContainer1; CList*> mHashContainer2; CQtHash** mQtOriginalHashes; CQtManagedRestrictedModificationHash** mQtModifiedHashes; CMemoryPoolProvider* mMemoryPoolProvider; bool mUseModifiedHashes; cint64 mHashesCount; cint64 mModificationThreadsCount; cint64 mModificationCountPerStep; bool mExtendBaseHashes; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude using namespace Konclude::Test; #endif // KONCLUDE_TEST_CCONCURRENTHASHMODIFICATIONTESTER_H Konclude-v0.6.2-544-SourceCode/Source/Test/COWLlinkAPIReasonerTestfileTester.h0000644000175000017500000000640012520551346025717 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLLINKAPIREASONERTESTFILETESTER_H #define KONCLUDE_TEST_COWLLINKAPIREASONERTESTFILETESTER_H // Libraries includes #include #include #include #include // Namespace includes #include "CReasonerTestfileEvaluator.h" // Other includes #include "Test/Events/CTestTestfileEvent.h" #include "Test/Events/CEvaluateTestfileTestEvent.h" #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" #include "Network/HTTP/CQtHttpTransactionManager.h" #include "Reasoner/Query/CClassHierarchyResult.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" using namespace std; namespace Konclude { using namespace Config; using namespace Concurrent; using namespace Network::HTTP; using namespace Reasoner::Query; namespace Test { using namespace Test::Events; /*! * * \class COWLlinkAPIReasonerTestfileTester * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLlinkAPIReasonerTestfileTester : public CLogIdentifier { // public methods public: //! Constructor COWLlinkAPIReasonerTestfileTester(CConfiguration *config); //! Destructor virtual ~COWLlinkAPIReasonerTestfileTester(); void startTestfileTest(const QString& requestFileName, const QString& responseFileName); // protected methods protected: bool modifyRequestDomStructure(QDomElement& el); void modifyResponseDomStructure(QDomElement& el, cint64 respTime); CClassHierarchyResult* parseClassHierarchyResult(QDomElement *node); CClassHierarchyResult* parseClassHierarchyResultRelocatedTOP(QDomElement *node); CClassSynsetResult* parseClassSynsetResult(QDomElement *node); bool hasClassSynsetTOP(QDomElement *node); QStringList parseClassNames(QDomElement *node); bool renameAbbreviatedClassSynset(QDomElement *node, const QString& abbIRI, const QString& replaceIRI); // protected variables protected: CQtHttpTransactionManager* mTransManager; QString mAddressString; bool mWriteResponseStdOut; bool mModifyRequest; bool mModifyRequestAbsolutePaths; bool mModifyResponseTiming; CConfiguration* mConfig; CClassHierarchyResult* mExpectedResult; // private methods private: // private methods private slots: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLLINKAPIREASONERTESTFILETESTER_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator.cppKonclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkIncrementalAssertionRealizationRequestGene0000644000175000017500000000346412520551346032366 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator.h" namespace Konclude { namespace Test { COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator::COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator(CConfiguration *config) : COWLFileOWLlinkIncrementalAssertionRequestGenerator(config) { mRequestTypeName = "Realization"; } QDomElement COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator::getFirstReasoningRequestNode(QDomDocument& document) { QDomElement kbRealizeElement = document.createElement("Realize"); kbRealizeElement.setAttribute("kb",mReasonerTestKBName); return kbRealizeElement; } QDomElement COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator::getSecondReasoningRequestNode(QDomDocument& document) { QDomElement kbRealizeElement = document.createElement("Realize"); kbRealizeElement.setAttribute("kb",mReasonerTestKBName); return kbRealizeElement; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CCacheTestWriter.h0000644000175000017500000000371212520551342022517 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CCACHETESTWRITER_H #define KONCLUDE_TEST_CCACHETESTWRITER_H // Libraries includes #include // Namespace includes // Other includes #include "Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheWriter.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Reasoner::Kernel::Cache; namespace Test { /*! * * \class CCacheTestWriter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCacheTestWriter : public QThread { // public methods public: //! Constructor CCacheTestWriter(COccurrenceUnsatisfiableCacheWriter *takeOccUnsatCacheWriter); //! Destructor virtual ~CCacheTestWriter(); virtual void startWriter(); qint64 getCacheWrites(); // protected methods protected: virtual void run(); // protected variables protected: COccurrenceUnsatisfiableCacheWriter *writer; qint64 writeCount; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude using namespace Konclude::Test; #endif // KONCLUDE_TEST_CCACHETESTWRITER_H Konclude-v0.6.2-544-SourceCode/Source/Test/CConcurrentHashModificationTester.cpp0000644000175000017500000001005612520551342026454 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcurrentHashModificationTester.h" namespace Konclude { namespace Test { CConcurrentHashModificationTester::CConcurrentHashModificationTester() { } CConcurrentHashModificationTester::~CConcurrentHashModificationTester() { } void CConcurrentHashModificationTester::generateTestingStructure(cint64 modificationThreadsCount, cint64 modificationCountPerStep, bool useModifiedHashes, bool extendBaseHashes) { mModificationThreadsCount = modificationThreadsCount; mModificationCountPerStep = modificationCountPerStep; mExtendBaseHashes = extendBaseHashes; cint64 initialFillCountMax = 100; cint64 initialFillCountMin = 50; cint64 maxCacheValue = 100; mHashesCount = 50; mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(1024*10-20 /*~ 10 KByte*/); mQtOriginalHashes = new CQtHash*[mHashesCount]; mQtModifiedHashes = new CQtManagedRestrictedModificationHash*[mHashesCount]; for (cint64 i = 0; i < mHashesCount; ++i) { CQtHash* newQtOriginalHash = new CQtHash(); mQtOriginalHashes[i] = newQtOriginalHash; mHashContainer1.append(newQtOriginalHash); CQtManagedRestrictedModificationHash* newQtManagedMutHash = new CQtManagedRestrictedModificationHash(); mQtModifiedHashes[i] = newQtManagedMutHash; mHashContainer2.append(newQtManagedMutHash); cint64 fillCount = (qrand() % (initialFillCountMax-initialFillCountMin))+initialFillCountMin; for (cint64 i = 0; i < fillCount; ++i) { qint64 modHashKey = qrand() % maxCacheValue; newQtOriginalHash->insert(modHashKey,i); newQtManagedMutHash->insert(modHashKey,i); } } for (qint64 i = 0; i < mModificationThreadsCount; ++i) { CHashModificationThread *modThread = 0; if (useModifiedHashes) { modThread = new CHashModificationThread(mQtModifiedHashes,mHashesCount,mMemoryPoolProvider,mModificationCountPerStep,mExtendBaseHashes); } else { modThread = new CHashModificationThread(mQtOriginalHashes,mHashesCount,mModificationCountPerStep,mExtendBaseHashes); } mModThreadList.append(modThread); } } void CConcurrentHashModificationTester::startHashModificationTest() { cForeach (CHashModificationThread* modThread, mModThreadList) { modThread->startModifications(); } } void CConcurrentHashModificationTester::stopHashModificationTest() { cForeach (CHashModificationThread* modThread, mModThreadList) { modThread->stopModifications(); } cForeach (CHashModificationThread* modThread, mModThreadList) { modThread->quit(); } } void CConcurrentHashModificationTester::destroyTestingStructure() { cDeleteAll(mModThreadList); delete mMemoryPoolProvider; delete mQtOriginalHashes; delete mQtModifiedHashes; cDeleteAll(mHashContainer2); cDeleteAll(mHashContainer1); mHashContainer1.clear(); mHashContainer2.clear(); mModThreadList.clear(); } cint64 CConcurrentHashModificationTester::getModificationStepsCount() { cint64 totalModStepsCount = 0; cForeach (CHashModificationThread* modThread, mModThreadList) { totalModStepsCount += modThread->getModificationStepsCount(); } return totalModStepsCount; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkIncrementalAssertionRequestGenerator.h0000644000175000017500000000637512520551346031466 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLFILEOWLLINKINCREMENTALASSERTIONREQUESTGENERATOR_H #define KONCLUDE_TEST_COWLFILEOWLLINKINCREMENTALASSERTIONREQUESTGENERATOR_H // Libraries includes #include #include #include #include // Namespace includes // Other includes #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" #include "Reasoner/Generator/CConcreteOntologyEntityCollectorBuilder.h" #include "Parser/COWL2QtXMLOntologyStreamParser.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" using namespace std; namespace Konclude { using namespace Config; using namespace Concurrent; using namespace Reasoner::Generator; using namespace Parser; namespace Test { /*! * * \class COWLFileOWLlinkIncrementalAssertionRequestGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLFileOWLlinkIncrementalAssertionRequestGenerator : public CLogIdentifier { // public methods public: //! Constructor COWLFileOWLlinkIncrementalAssertionRequestGenerator(CConfiguration *config); //! Destructor virtual ~COWLFileOWLlinkIncrementalAssertionRequestGenerator(); bool generateOWLlinkIncrementalAssertionRequests(const QString& requestFileName, const QString& responseFileName, double removeAssertionPercentage, double addAssertionPercentage, cint64 testCount); bool generateOWLlinkIncrementalAssertionRequests(const QString& requestFileName, const QString& responseFileName, cint64 removeAssertionCount, cint64 addAssertionCount, cint64 testCount); bool generateOWLlinkIncrementalAssertionConsistencyRequest(const QString& requestFileName, const QString& responseFileName, QList& removalAssertionList, QList& additionAssertionList); // protected methods protected: QDomDocument createRequestDocument(); QList loadOntologyAssertions(const QString& requestFileName); virtual QDomElement getFirstReasoningRequestNode(QDomDocument& document) = 0; virtual QDomElement getSecondReasoningRequestNode(QDomDocument& document) = 0; // protected variables protected: CConfiguration* mConfig; QString mReasonerTestKBName; QString mRequestTypeName; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLFILEOWLLINKINCREMENTALASSERTIONREQUESTGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/COWLLargeJoinTestDataGenerator.h0000644000175000017500000000521612520551346025221 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLLARGEJOINTESTDATAGENERATOR_H #define KONCLUDE_TEST_COWLLARGEJOINTESTDATAGENERATOR_H // Libraries includes #include // Namespace includes #include "Utilities/UtilitiesSettings.h" // Other includes #include // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Logger; using namespace Utilities; namespace Test { /*! * * \class COWLLargeJoinTestDataGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLLargeJoinTestDataGenerator : public CLogIdentifier { // public methods public: //! Constructor COWLLargeJoinTestDataGenerator(); //! Destructor virtual ~COWLLargeJoinTestDataGenerator(); void generateData(cint64 size, double rate, const QString& filename); // protected methods protected: void createLargeJoinData(cint64 size, double rate); void createPropertyDeclarations(); void createIndividualDeclarations(cint64 size); void createPropertyAssertions(const QString& propertyName, cint64 count, cint64 maxNumber); void writePropertyDeclaration(const QString& propertyName); void writeIndividualDeclaration(const QString& indiviualName); void writeIndividualPropertyAssertion(const QString& propertyName, const QString& indiviualName1, const QString& indiviualName2); QString getIndividualName(cint64 indiNumber); // protected variables protected: QString owllinkNS; QString owlNS; cint64 mIndividualsNumberSize; QString mIndividualBaseName; QString mPropertyBaseName; QXmlStreamWriter* mXMLWriter; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLLARGEJOINTESTDATAGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/CThroughputTestTaskHandleAlgorithm.h0000644000175000017500000000363312520551352026301 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CTHROUGHPUTTESTTASKHANDLEALGORITHM_H #define KONCLUDE_TEST_CTHROUGHPUTTESTTASKHANDLEALGORITHM_H // Libraries includes // Namespace includes #include "CThroughputTestTask.h" // Other includes #include "Scheduler/CTaskHandleAlgorithm.h" #include "Scheduler/CTaskAllocator.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Test { /*! * * \class CThroughputTestTaskHandleAlgorithm * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CThroughputTestTaskHandleAlgorithm : public CTaskHandleAlgorithm { // public methods public: //! Constructor CThroughputTestTaskHandleAlgorithm(); //! Destructor virtual ~CThroughputTestTaskHandleAlgorithm(); virtual bool handleTask(CTaskProcessorContext *processorContext, CTask* task); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_CTHROUGHPUTTESTTASKHANDLEALGORITHM_H Konclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkConsistencyRequestGenerator.cpp0000644000175000017500000000707512520551344030165 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLFileOWLlinkConsistencyRequestGenerator.h" namespace Konclude { namespace Test { COWLFileOWLlinkConsistencyRequestGenerator::COWLFileOWLlinkConsistencyRequestGenerator(CConfiguration *config) : CLogIdentifier("::Konclude::Test::OWLFileOWLlinkClassifyRequestGenerator",this),mConfig(config) { mReasonerTestKBName = "http://www.konclude.com/evaluation-testsuite/test-ontology"; } COWLFileOWLlinkConsistencyRequestGenerator::~COWLFileOWLlinkConsistencyRequestGenerator() { } QDomDocument COWLFileOWLlinkConsistencyRequestGenerator::createRequestDocument() { QDomDocument document; QString owllinkNS = "http://www.owllink.org/owllink#"; QString owlNS = "http://www.w3.org/2002/07/owl#"; QDomElement rootNode; rootNode = document.createElementNS(owllinkNS,"RequestMessage"); //rootNode.setAttributeNS("xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttribute("xmlns:owl",owlNS); document.appendChild(rootNode); return document; } bool COWLFileOWLlinkConsistencyRequestGenerator::generateOWLlinkConsistencyRequest(const QString& requestFileName, const QString& responseFileName) { QDomDocument requestDocument = createRequestDocument(); QDomElement rootElement = requestDocument.documentElement(); QDomElement cKBElement = requestDocument.createElement("CreateKB"); cKBElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(cKBElement); QDomElement loadElement = requestDocument.createElement("LoadOntologies"); loadElement.setAttribute("kb",mReasonerTestKBName); QDomElement ontoIRIElement = requestDocument.createElement("OntologyIRI"); ontoIRIElement.setAttribute("IRI",QString("file:%1").arg(requestFileName)); loadElement.appendChild(ontoIRIElement); rootElement.appendChild(loadElement); QDomElement getSubClassHirElement = requestDocument.createElement("IsKBSatisfiable"); getSubClassHirElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(getSubClassHirElement); QDomElement releaseKBElement = requestDocument.createElement("ReleaseKB"); releaseKBElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(releaseKBElement); QFile outFile(responseFileName); if (outFile.open(QIODevice::WriteOnly)) { outFile.write(requestDocument.toByteArray()); outFile.close(); } LOG(INFO,getLogDomain(),logTr("Generated OWLlink consistency request '%1' for ontology '%2'.").arg(responseFileName).arg(requestFileName),this); return false; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkTypesRequestGenerator.cpp0000644000175000017500000001712612520551346026770 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLFileOWLlinkTypesRequestGenerator.h" namespace Konclude { namespace Test { COWLFileOWLlinkTypesRequestGenerator::COWLFileOWLlinkTypesRequestGenerator(CConfiguration *config) : CLogIdentifier("::Konclude::Test::OWLFileOWLlinkIndividualifyRequestGenerator",this),mConfig(config) { mReasonerTestKBName = "http://www.konclude.com/evaluation-testsuite/test-ontology"; } COWLFileOWLlinkTypesRequestGenerator::~COWLFileOWLlinkTypesRequestGenerator() { } QDomDocument COWLFileOWLlinkTypesRequestGenerator::createRequestDocument() { QDomDocument document; QString owllinkNS = "http://www.owllink.org/owllink#"; QString owlNS = "http://www.w3.org/2002/07/owl#"; QDomElement rootNode; rootNode = document.createElementNS(owllinkNS,"RequestMessage"); rootNode.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttribute("xmlns:owl",owlNS); document.appendChild(rootNode); return document; } QSet COWLFileOWLlinkTypesRequestGenerator::loadIndividualEntities(const QString& requestFileName) { CConcreteOntologyEntityCollectorBuilder entityGenBuilder; COWL2QtXMLOntologyStreamParser* owl2Parser = new COWL2QtXMLOntologyStreamParser(&entityGenBuilder); owl2Parser->parseOntology(requestFileName); delete owl2Parser; QSet individualNameSet = *entityGenBuilder.getIndividualNameSet(); return individualNameSet; } bool COWLFileOWLlinkTypesRequestGenerator::generateOWLlinkTypesRequests(const QString& requestFileName, const QString& responseFileName, cint64 testCount) { bool generatedTestfiles = false; QSet individualNameTestingSet; QSet individualNameSet = loadIndividualEntities(requestFileName); cint64 maxTestIndividualCount = qMin(testCount,(cint64)individualNameSet.count()); cint64 slashIndex = qMax(requestFileName.lastIndexOf("/"),requestFileName.lastIndexOf("\\")); QString fileNameString = requestFileName; if (slashIndex >= 0) { fileNameString = requestFileName.mid(slashIndex+1); } uint randInitNumber = 0; for (QString::const_iterator it = requestFileName.constBegin(), itEnd = requestFileName.constEnd(); it != itEnd; ++it) { QChar nameChar(*it); randInitNumber += nameChar.unicode(); } qsrand(randInitNumber); for (cint64 testNr = 0; testNr < maxTestIndividualCount; ++testNr) { cint64 nextTextIndividualNr = qrand() % individualNameSet.count(); QSet::iterator individualNameIt = individualNameSet.begin(); for (cint64 i = 0; i < nextTextIndividualNr; ++i) { ++individualNameIt; } QString nextTestIndividualName = *individualNameIt; cint64 nextIndividualSwitchCount = individualNameSet.count(); while (individualNameTestingSet.contains(nextTestIndividualName) && nextIndividualSwitchCount > 0) { ++individualNameIt; ++nextTextIndividualNr; if (individualNameIt == individualNameSet.end()) { individualNameIt == individualNameSet.begin(); nextTextIndividualNr = 0; } nextTestIndividualName = *individualNameIt; --nextIndividualSwitchCount; } if (individualNameTestingSet.contains(nextTestIndividualName)) { break; } QString individualNameTestFileAppendix = getIndividualNameRequestFileAppendix(nextTestIndividualName,nextTextIndividualNr); QString testResponseFileName = QString(responseFileName).arg(individualNameTestFileAppendix); generatedTestfiles |= generateOWLlinkTypesRequest(requestFileName,testResponseFileName,nextTestIndividualName); } return generatedTestfiles; } QString COWLFileOWLlinkTypesRequestGenerator::getIndividualNameRequestFileAppendix(const QString& individualName, cint64 testNumber) { QString individualNameFileAppendixString = individualName; cint64 lastSlash = individualNameFileAppendixString.lastIndexOf("/"); if (lastSlash != -1) { individualNameFileAppendixString = individualNameFileAppendixString.mid(lastSlash+1); } cint64 lastGatt = individualNameFileAppendixString.lastIndexOf("#"); if (lastGatt != -1) { individualNameFileAppendixString = individualNameFileAppendixString.mid(lastGatt+1); } QString nextIndividualNameFileAppendixString; cint64 maxIndividualChar = 15; for (QString::const_iterator charIt = individualNameFileAppendixString.constBegin(), charItEnd = individualNameFileAppendixString.constEnd(); charIt != charItEnd; ++charIt) { QChar character(*charIt); if (character.isLetterOrNumber()) { char asciiCharacter = character.toLatin1(); if (asciiCharacter != 0 && maxIndividualChar > 0) { --maxIndividualChar; nextIndividualNameFileAppendixString += asciiCharacter; } } } return QString("%1~%2").arg(testNumber).arg(nextIndividualNameFileAppendixString); } bool COWLFileOWLlinkTypesRequestGenerator::generateOWLlinkTypesRequest(const QString& requestFileName, const QString& responseFileName, const QString& individualName) { QDomDocument requestDocument = createRequestDocument(); QDomElement rootElement = requestDocument.documentElement(); QDomElement cKBElement = requestDocument.createElement("CreateKB"); cKBElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(cKBElement); QDomElement loadElement = requestDocument.createElement("LoadOntologies"); loadElement.setAttribute("kb",mReasonerTestKBName); QDomElement ontoIRIElement = requestDocument.createElement("OntologyIRI"); ontoIRIElement.setAttribute("IRI",QString("file:%1").arg(requestFileName)); loadElement.appendChild(ontoIRIElement); rootElement.appendChild(loadElement); QDomElement realizeKBElement = requestDocument.createElement("Realize"); realizeKBElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(realizeKBElement); QDomElement typesIndividualElement = requestDocument.createElement("GetFlattenedTypes"); typesIndividualElement.setAttribute("kb",mReasonerTestKBName); QDomElement individualElement = requestDocument.createElement("owl:NamedIndividual"); individualElement.setAttribute("IRI",individualName); typesIndividualElement.appendChild(individualElement); rootElement.appendChild(typesIndividualElement); QDomElement releaseKBElement = requestDocument.createElement("ReleaseKB"); releaseKBElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(releaseKBElement); QFile outFile(responseFileName); if (outFile.open(QIODevice::WriteOnly)) { outFile.write(requestDocument.toByteArray()); outFile.close(); } LOG(INFO,getLogDomain(),logTr("Generated OWLlink types request '%1' for ontology '%2'.").arg(responseFileName).arg(requestFileName),this); return false; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkSatisfiabilityRequestGenerator.h0000644000175000017500000000541212520551346030304 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLFILEOWLLINKSATISFIABILITYREQUESTGENERATOR_H #define KONCLUDE_TEST_COWLFILEOWLLINKSATISFIABILITYREQUESTGENERATOR_H // Libraries includes #include #include #include #include // Namespace includes // Other includes #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" #include "Reasoner/Generator/CConcreteOntologyEntityCollectorBuilder.h" #include "Parser/COWL2QtXMLOntologyStreamParser.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" using namespace std; namespace Konclude { using namespace Config; using namespace Concurrent; using namespace Reasoner::Generator; using namespace Parser; namespace Test { /*! * * \class COWLFileOWLlinkSatisfiabilityRequestGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLFileOWLlinkSatisfiabilityRequestGenerator : public CLogIdentifier { // public methods public: //! Constructor COWLFileOWLlinkSatisfiabilityRequestGenerator(CConfiguration *config); //! Destructor virtual ~COWLFileOWLlinkSatisfiabilityRequestGenerator(); bool generateOWLlinkSatisfiabilityRequests(const QString& requestFileName, const QString& responseFileName, cint64 testCount); bool generateOWLlinkSatisfiabilityRequest(const QString& requestFileName, const QString& responseFileName, const QString& className); // protected methods protected: QDomDocument createRequestDocument(); QString getClassNameRequestFileAppendix(const QString& className, cint64 testNumber); QSet loadClassEntities(const QString& requestFileName); // protected variables protected: CConfiguration* mConfig; QString mReasonerTestKBName; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLFILEOWLLINKSATISFIABILITYREQUESTGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/CConcurrentOccurenceUnsatisfiableCacheTester.cpp0000644000175000017500000000477112520551344030620 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcurrentOccurenceUnsatisfiableCacheTester.h" namespace Konclude { namespace Test { CConcurrentOccurenceUnsatisfiableCacheTester::CConcurrentOccurenceUnsatisfiableCacheTester() { occUnsatCache = 0; writer = 0; } CConcurrentOccurenceUnsatisfiableCacheTester::~CConcurrentOccurenceUnsatisfiableCacheTester() { qDeleteAll(readerList); if (writer) { delete writer; } if (occUnsatCache) { delete occUnsatCache; } } void CConcurrentOccurenceUnsatisfiableCacheTester::generateCacheStructure(qint64 cacheReaderCount) { readerCount = cacheReaderCount; if (occUnsatCache) { delete occUnsatCache; } if (writer) { delete writer; } qDeleteAll(readerList); readerList.clear(); occUnsatCache = new COccurrenceUnsatisfiableCache(readerCount+2); writer = new CCacheTestWriter(new COccurrenceUnsatisfiableCacheWriter(occUnsatCache)); for (qint64 i = 0; i < cacheReaderCount; ++i) { CCacheTestReader *reader = new CCacheTestReader(occUnsatCache->getCacheReader()); readerList.append(reader); } } void CConcurrentOccurenceUnsatisfiableCacheTester::runCacheTest() { foreach (CCacheTestReader *reader, readerList) { reader->startReader(); } if (writer) { writer->startWriter(); } } qint64 CConcurrentOccurenceUnsatisfiableCacheTester::getCacheWrites() { if (writer) { return writer->getCacheWrites(); } else { return 0; } } qint64 CConcurrentOccurenceUnsatisfiableCacheTester::getCacheReads() { qint64 cacheReads = 0; foreach (CCacheTestReader *reader, readerList) { cacheReads = reader->getCacheReads(); } return cacheReads; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkRealizeRequestGenerator.h0000644000175000017500000000474012573740600026723 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLFILEOWLLINKREALIZEREQUESTGENERATOR_H #define KONCLUDE_TEST_COWLFILEOWLLINKREALIZEREQUESTGENERATOR_H // Libraries includes #include #include #include #include // Namespace includes // Other includes #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" #include "Reasoner/Generator/CConcreteOntologyEntityCollectorBuilder.h" #include "Parser/COWL2QtXMLOntologyStreamParser.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" using namespace std; namespace Konclude { using namespace Config; using namespace Concurrent; using namespace Reasoner::Generator; using namespace Parser; namespace Test { /*! * * \class COWLFileOWLlinkRealizeRequestGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLFileOWLlinkRealizeRequestGenerator : public CLogIdentifier { // public methods public: //! Constructor COWLFileOWLlinkRealizeRequestGenerator(CConfiguration *config); //! Destructor virtual ~COWLFileOWLlinkRealizeRequestGenerator(); bool generateOWLlinkRealizeRequest(const QString& requestFileName, const QString& responseFileName); // protected methods protected: QDomDocument createRequestDocument(); QSet loadIndividualEntities(const QString& requestFileName); // protected variables protected: CConfiguration* mConfig; QString mReasonerTestKBName; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLFILEOWLLINKREALIZEREQUESTGENERATOR_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator.hKonclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkIncrementalAssertionConsistencyRequestGene0000644000175000017500000000415312520551346032402 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLFILEOWLLINKINCREMENTALASSERTIONCONSISTENCYREQUESTGENERATOR_H #define KONCLUDE_TEST_COWLFILEOWLLINKINCREMENTALASSERTIONCONSISTENCYREQUESTGENERATOR_H // Libraries includes // Namespace includes #include "COWLFileOWLlinkIncrementalAssertionRequestGenerator.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { namespace Test { /*! * * \class COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator : public COWLFileOWLlinkIncrementalAssertionRequestGenerator { // public methods public: //! Constructor COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator(CConfiguration *config); // protected methods protected: virtual QDomElement getFirstReasoningRequestNode(QDomDocument& document); virtual QDomElement getSecondReasoningRequestNode(QDomDocument& document); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLFILEOWLLINKINCREMENTALASSERTIONCONSISTENCYREQUESTGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestsuiteTest.h0000644000175000017500000000471012520551352024007 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CREASONERTESTSUITETEST_H #define KONCLUDE_TEST_CREASONERTESTSUITETEST_H // Libraries includes // Namespace includes #include "CReasonerTestfileTest.h" #include "CReasonerTestsuiteTestResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Test { /*! * * \class CReasonerTestsuiteTest * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerTestsuiteTest { // public methods public: //! Constructor CReasonerTestsuiteTest(); //! Destructor virtual ~CReasonerTestsuiteTest(); virtual qint64 getDefaultTestLoopCount(); virtual CReasonerTestsuiteTest *setDefaultTestLoopCount(qint64 loopCount); virtual QString getDefaultWorkingDirectory(); virtual CReasonerTestsuiteTest *setDefaultWorkingDirectory(const QString &workingDir); virtual bool hasDefaultWorkingDirectory(); virtual CReasonerTestfileTest *createTestfileTest(); virtual QLinkedList getTestfileTestList(); virtual qint64 getDefaultTimeout(); virtual CReasonerTestsuiteTest *setDefaultTimeout(qint64 defTimeout); virtual CReasonerTestsuiteTestResult *getTestsuiteResult(); // protected methods protected: // protected variables protected: qint64 testExeCount; QString workDir; qint64 timeout; QLinkedList testList; CReasonerTestsuiteTestResult testsuiteResult; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_CREASONERTESTSUITETEST_H Konclude-v0.6.2-544-SourceCode/Source/Test/CHashModificationThread.cpp0000644000175000017500000001012012520551344024344 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CHashModificationThread.h" namespace Konclude { namespace Test { CHashModificationThread::CHashModificationThread(CQtHash** qtOriginalHashes, cint64 hashesCount, cint64 modificationCountPerStep, bool extendBaseHashes) { mModificationSteps = 0; mQtOriginalHashes = qtOriginalHashes; mQtModifiedHashes = 0; mMemoryPoolProvider = 0; mUseModifiedHashes = false; mHashesCount = hashesCount; mContextBase = 0; mMemoryPoolAllocationMan = 0; mCanceled = false; mModificationCountPerStep = modificationCountPerStep; mExtendBaseHashes = extendBaseHashes; } CHashModificationThread::CHashModificationThread(CQtManagedRestrictedModificationHash** qtModifiedHashes, cint64 hashesCount, CMemoryPoolProvider* memoryPoolProvider, cint64 modificationCountPerStep, bool extendBaseHashes) { mModificationSteps = 0; mQtOriginalHashes = 0; mQtModifiedHashes = qtModifiedHashes; mMemoryPoolProvider = memoryPoolProvider; mUseModifiedHashes = true; mMemoryPoolAllocationMan = new CMemoryPoolAllocationManager(mMemoryPoolProvider); mContextBase = new CContextBase(mMemoryPoolAllocationMan); mHashesCount = hashesCount; mCanceled = false; mModificationCountPerStep = modificationCountPerStep; mExtendBaseHashes = extendBaseHashes; } CHashModificationThread::~CHashModificationThread() { quit(); wait(); delete mMemoryPoolAllocationMan; delete mContextBase; } void CHashModificationThread::startModifications() { start(); moveToThread(this); } void CHashModificationThread::stopModifications() { mCanceled = true; } cint64 CHashModificationThread::getModificationStepsCount() { return mModificationSteps; } void CHashModificationThread::run() { qint64 modCountPerStep = mModificationCountPerStep; qint64 maxCacheValue = 100; while (!mCanceled) { qint64 modHashIndex = qrand() % mHashesCount; if (!mUseModifiedHashes) { CQtHash *baseHash = mQtOriginalHashes[modHashIndex]; CQtHash *modHash = 0; if (mExtendBaseHashes) { modHash = new CQtHash(*baseHash); } else { modHash = new CQtHash(); } for (cint64 i = 0; i < modCountPerStep; ++i) { qint64 modHashKey = qrand() % maxCacheValue; cint64 modHashValue = modHash->value(modHashKey,0); modHash->insert(modHashKey,++modHashValue); } delete modHash; ++mModificationSteps; } else { CQtManagedRestrictedModificationHash *baseHash = mQtModifiedHashes[modHashIndex]; CQtManagedRestrictedModificationHash *modHash = CObjectAllocator >::allocateAndConstruct(mMemoryPoolAllocationMan); if (mExtendBaseHashes) { modHash->init(baseHash,mContextBase); } else { modHash->init(mContextBase); } for (cint64 i = 0; i < modCountPerStep; ++i) { qint64 modHashKey = qrand() % maxCacheValue; cint64 modHashValue = modHash->value(modHashKey,0); modHash->insert(modHashKey,++modHashValue); modHashValue = modHash->value(modHashKey,0); } mMemoryPoolAllocationMan->releaseAllMemory(); ++mModificationSteps; } } } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CConcurrentMemoryAccessTester.h0000644000175000017500000000462012520551344025304 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CConcurrentMemoryAccessTester_H #define KONCLUDE_TEST_CConcurrentMemoryAccessTester_H // Libraries includes // Namespace includes #include "CMemoryAccessThread.h" // Other includes #include "Utilities/Container/CList.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; using namespace Utilities::Memory; namespace Test { /*! * * \class CConcurrentMemoryAccessTester * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcurrentMemoryAccessTester { // public methods public: //! Constructor CConcurrentMemoryAccessTester(); //! Destructor virtual ~CConcurrentMemoryAccessTester(); void generateTestingStructure(cint64 arraySize, cint64 readWriteRatio, bool atomicOperations, cint64 threadCount); void startHashModificationTest(); void stopHashModificationTest(); cint64 getModificationStepsCount(); void destroyTestingStructure(); // protected methods protected: // protected variables protected: CList mModThreadList; int* mMemoryArray; cint64 mArraySize; cint64 mReadWriteRatio; bool mAtomicOperations; cint64 mThreadCount; bool mSharedWrite; CMemoryPoolProvider* mMemoryPoolProvider; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude using namespace Konclude::Test; #endif // KONCLUDE_TEST_CConcurrentMemoryAccessTester_H Konclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestfileEvaluator.h0000644000175000017500000000356412520551350024624 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CREASONERTESTFILEEVALUATOR_H #define KONCLUDE_TEST_CREASONERTESTFILEEVALUATOR_H // Libraries includes #include #include // Namespace includes #include "CReasonerTestfileTest.h" #include "CReasonerTestfileTestResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Test { /*! * * \class CReasonerTestfileEvaluator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerTestfileEvaluator { // public methods public: //! Constructor CReasonerTestfileEvaluator(); //! Destructor virtual ~CReasonerTestfileEvaluator(); virtual CReasonerTestfileEvaluator *evaluateTestfile(CReasonerTestfileTest *test, const QByteArray &resultingByteArray) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_CREASONERTESTFILEEVALUATOR_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator.hKonclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkIncrementalAssertionRealizationRequestGene0000644000175000017500000000415312520551346032362 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLFILEOWLLINKINCREMENTALASSERTIONREALIZATIONREQUESTGENERATOR_H #define KONCLUDE_TEST_COWLFILEOWLLINKINCREMENTALASSERTIONREALIZATIONREQUESTGENERATOR_H // Libraries includes // Namespace includes #include "COWLFileOWLlinkIncrementalAssertionRequestGenerator.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { namespace Test { /*! * * \class COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator : public COWLFileOWLlinkIncrementalAssertionRequestGenerator { // public methods public: //! Constructor COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator(CConfiguration *config); // protected methods protected: virtual QDomElement getFirstReasoningRequestNode(QDomDocument& document); virtual QDomElement getSecondReasoningRequestNode(QDomDocument& document); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLFILEOWLLINKINCREMENTALASSERTIONREALIZATIONREQUESTGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkTypesRequestGenerator.h0000644000175000017500000000531512520551346026432 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_COWLFILEOWLLINKTYPESREQUESTGENERATOR_H #define KONCLUDE_TEST_COWLFILEOWLLINKTYPESREQUESTGENERATOR_H // Libraries includes #include #include #include #include // Namespace includes // Other includes #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" #include "Reasoner/Generator/CConcreteOntologyEntityCollectorBuilder.h" #include "Parser/COWL2QtXMLOntologyStreamParser.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" using namespace std; namespace Konclude { using namespace Config; using namespace Concurrent; using namespace Reasoner::Generator; using namespace Parser; namespace Test { /*! * * \class COWLFileOWLlinkTypesRequestGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLFileOWLlinkTypesRequestGenerator : public CLogIdentifier { // public methods public: //! Constructor COWLFileOWLlinkTypesRequestGenerator(CConfiguration *config); //! Destructor virtual ~COWLFileOWLlinkTypesRequestGenerator(); bool generateOWLlinkTypesRequests(const QString& requestFileName, const QString& responseFileName, cint64 testCount); bool generateOWLlinkTypesRequest(const QString& requestFileName, const QString& responseFileName, const QString& individualName); // protected methods protected: QDomDocument createRequestDocument(); QString getIndividualNameRequestFileAppendix(const QString& individualName, cint64 testNumber); QSet loadIndividualEntities(const QString& requestFileName); // protected variables protected: CConfiguration* mConfig; QString mReasonerTestKBName; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_COWLFILEOWLLINKTYPESREQUESTGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/CCacheTestReader.cpp0000644000175000017500000000420412520551342022775 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCacheTestReader.h" namespace Konclude { namespace Test { CCacheTestReader::CCacheTestReader(COccurrenceUnsatisfiableCacheReader *occUnsatCacheReader) { reader = occUnsatCacheReader; testCount = 0; unsatCount = 0; } CCacheTestReader::~CCacheTestReader() { quit(); wait(); } void CCacheTestReader::startReader() { start(); moveToThread(this); } qint64 CCacheTestReader::getCacheReads() { return testCount; } void CCacheTestReader::run() { if (reader) { qint64 maxOntTag = 1; qint64 maxConTag = 100; qint64 maxCount = 20; while (true) { qint64 randOntTagNumber = rand() % maxOntTag; qint64 randCount = rand() % maxCount; QVector conTags(randCount,0); for (qint64 i = 0; i < randCount; ++i) { qint64 randConTagNumber = rand() % maxConTag; conTags[i] = randConTagNumber; } qSort(conTags); QVector values; for (qint64 i = 0; i < randCount; ++i) { values.append(CCacheValue(conTags[i],randOntTagNumber,CCacheValue::CACHEVALCONCEPTONTOLOGYTAG)); } values.append(CCacheValue(0,0,CCacheValue::CACHEVALUETERMINATOR)); testCount++; if (reader->isUnsatisfiable(values,values.count())) { unsatCount++; } } } } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestfileErrorEvaluator.h0000644000175000017500000000425112520551350025630 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CREASONERTESTFILEERROREVALUATOR_H #define KONCLUDE_TEST_CREASONERTESTFILEERROREVALUATOR_H // Libraries includes #include // Namespace includes #include "CReasonerTestfileTest.h" #include "CReasonerTestfileTestResult.h" #include "CReasonerTestfileEvaluator.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Logger; namespace Test { /*! * * \class CReasonerTestfileErrorEvaluator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerTestfileErrorEvaluator : public CReasonerTestfileEvaluator, public CLogIdentifier { // public methods public: //! Constructor CReasonerTestfileErrorEvaluator(); //! Destructor virtual ~CReasonerTestfileErrorEvaluator(); virtual CReasonerTestfileEvaluator *evaluateTestfile(CReasonerTestfileTest *test, const QByteArray &resultingByteArray); // protected methods protected: virtual CReasonerTestfileErrorEvaluator *checkTestResponseErrors(CReasonerTestfileTestResult *testResult, QDomElement *node); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_CREASONERTESTFILEERROREVALUATOR_H Konclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestfileEvaluator.cpp0000644000175000017500000000207212520551350025150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerTestfileEvaluator.h" namespace Konclude { namespace Test { CReasonerTestfileEvaluator::CReasonerTestfileEvaluator() { } CReasonerTestfileEvaluator::~CReasonerTestfileEvaluator() { } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestfileTest.h0000644000175000017500000000511712520551350023575 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CREASONERTESTFILETEST_H #define KONCLUDE_TEST_CREASONERTESTFILETEST_H // Libraries includes // Namespace includes #include "CReasonerTestfileTestResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Test { /*! * * \class CReasonerTestfileTest * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerTestfileTest { // public methods public: //! Constructor CReasonerTestfileTest(); //! Destructor virtual ~CReasonerTestfileTest(); virtual QString getTestRequestFile(); virtual CReasonerTestfileTest *setTestRequestFile(const QString &requestFile); virtual bool hasTestRequestFile(); virtual QString getTestExpectedResponseFile(); virtual CReasonerTestfileTest *setTestExpectedResponseFile(const QString &responseFile); virtual bool hasTestExpectedResponseFile(); virtual qint64 getTestLoopCount(); virtual CReasonerTestfileTest *setTestLoopCount(qint64 loopCount); virtual CReasonerTestfileTestResult *getTestResults(); virtual QString getWorkingDirectory(); virtual CReasonerTestfileTest *setWorkingDirectory(const QString &workingDir); virtual bool hasWorkingDirectory(); virtual qint64 getTimeout(); virtual CReasonerTestfileTest *setTimeout(qint64 testTimeout); // protected methods protected: // protected variables protected: QString testRequestFile; QString expectedResponseFile; qint64 testExeCount; QString workDir; qint64 timeout; CReasonerTestfileTestResult *testResult; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_CREASONERTESTFILETEST_H Konclude-v0.6.2-544-SourceCode/Source/Test/CConcurrentThroughputTestTaskTester.cpp0000644000175000017500000001260512520551344027103 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcurrentThroughputTestTaskTester.h" namespace Konclude { namespace Test { CConcurrentThroughputTestTaskTester::CConcurrentThroughputTestTaskTester() { mHandleAlg = new CThroughputTestTaskHandleAlgorithm(); } CConcurrentThroughputTestTaskTester::~CConcurrentThroughputTestTaskTester() { } void CConcurrentThroughputTestTaskTester::generateTestingStructure(cint64 maxBranchDepth, cint64 branchingFactor) { mMaxBranchDepth = maxBranchDepth; mBranchingFactor = branchingFactor; mThreadTestCount = 1; mThreadMaxTestCount = 8; mScaleReferenceTime = 0; mLastEventProcessed = 0; mLastTaskProcessed = 0; mTotalTestTasks = qPow(mBranchingFactor,mMaxBranchDepth+1); mProcessUnit = new CSingleThreadTaskProcessorUnit(mHandleAlg); mProcessUnit->startProcessing(); mCompletorUnit = new CTaskProcessorCompletorThread(mHandleAlg); mSchedulerUnit = new CTaskProcessorSchedulerThread(mHandleAlg,mCompletorUnit); mCompletorUnit->installScheduler(mSchedulerUnit); mSchedulerUnit->installScheduler(mSchedulerUnit); mCompletorUnit->startProcessing(); mSchedulerUnit->startProcessing(); } void CConcurrentThroughputTestTaskTester::startTesting() { CThroughputTestTask* rootTask = CObjectMemoryPoolAllocator::allocateAndConstructWithMemroyPool(); rootTask->initTestTask(mMaxBranchDepth,mBranchingFactor); rootTask->addCallbackLinker(this); mMeasurementTimer.start(); CTaskEventCommunicator::postSendTaskScheduleEvent(mProcessUnit->getEventHandler(),rootTask,nullptr); } void CConcurrentThroughputTestTaskTester::stopTesting() { } void CConcurrentThroughputTestTaskTester::destroyTestingStructure() { mProcessUnit->stopProcessing(); mProcessUnit->stopThread(); delete mProcessUnit; } cint64 CConcurrentThroughputTestTaskTester::getTaskProcessedCount() { cint64 totalProcessedCount = mProcessUnit->getTaskProcessingStatistics()->getStatisticTasksProcessedCount(); return totalProcessedCount; } void CConcurrentThroughputTestTaskTester::doCallback() { cint64 elapsedTime = mMeasurementTimer.elapsed(); if (mThreadTestCount == 1) { mScaleReferenceTime = elapsedTime; } if (mScaleReferenceTime == 0) { mScaleReferenceTime = 1; } cint64 eventProcessedCount = 0; cint64 taskProcessedCount = 0; if (mThreadTestCount == 1) { eventProcessedCount += mProcessUnit->getTaskProcessingStatistics()->getStatisticEventsProcessedCount(); taskProcessedCount += mProcessUnit->getTaskProcessingStatistics()->getStatisticTasksProcessedCount(); } else { eventProcessedCount += mSchedulerUnit->getTaskProcessingStatistics()->getStatisticEventsProcessedCount(); eventProcessedCount += mCompletorUnit->getTaskProcessingStatistics()->getStatisticEventsProcessedCount(); taskProcessedCount += mSchedulerUnit->getTaskProcessingStatistics()->getStatisticTasksProcessedCount(); taskProcessedCount += mCompletorUnit->getTaskProcessingStatistics()->getStatisticTasksProcessedCount(); foreach (CTaskProcessorThread* taskProcUnit, mProcessorUnitList) { eventProcessedCount += taskProcUnit->getTaskProcessingStatistics()->getStatisticEventsProcessedCount(); taskProcessedCount += taskProcUnit->getTaskProcessingStatistics()->getStatisticTasksProcessedCount(); } cint64 tmpEventProcessedCount = eventProcessedCount; eventProcessedCount = tmpEventProcessedCount - mLastEventProcessed; mLastEventProcessed = tmpEventProcessedCount; cint64 tmpTaskProcessedCount = taskProcessedCount; taskProcessedCount = tmpTaskProcessedCount - mLastTaskProcessed; mLastTaskProcessed = tmpTaskProcessedCount; } cout<installScheduler(mSchedulerUnit); taskProcessor->startProcessing(); } CThroughputTestTask* rootTask = CObjectMemoryPoolAllocator::allocateAndConstructWithMemroyPool(); rootTask->initTestTask(mMaxBranchDepth,mBranchingFactor); rootTask->addCallbackLinker(this); CTaskEventCommunicator::postSendTaskScheduleEvent(mSchedulerUnit->getEventHandler(),rootTask,nullptr); } } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CThroughputTestTask.cpp0000644000175000017500000000503512520551352023647 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CThroughputTestTask.h" namespace Konclude { namespace Test { CThroughputTestTask::CThroughputTestTask(CMemoryPool* memoryPool) : CTask(memoryPool) { mMaxBranchDepth = 0; mCurBranchDepth = 0; mBranchingFactor = 0; } CThroughputTestTask::~CThroughputTestTask() { } cint64 CThroughputTestTask::getBranchingFactor() { return mBranchingFactor; } cint64 CThroughputTestTask::getCurrentBranchingDepth() { return mCurBranchDepth; } cint64 CThroughputTestTask::getMaximumBranchingDepth() { return mMaxBranchDepth; } CTask* CThroughputTestTask::makeTaskReference(CTask* dependedTask, CTaskHandleContext* handlerContext) { CTask::makeTaskReference(dependedTask,handlerContext); CThroughputTestTask* testDepTask = (CThroughputTestTask*)dependedTask; testDepTask->mMaxBranchDepth = mMaxBranchDepth; testDepTask->mBranchingFactor = mBranchingFactor; testDepTask->mCurBranchDepth = mCurBranchDepth+1; return this; } CTask* CThroughputTestTask::initTask(CTask* parentTask, CTaskHandleContext* context) { CTask::initTask(parentTask,context); return this; } CTask* CThroughputTestTask::initTestTask(cint64 maxBranchDepth, cint64 branchingFactor) { CTask::initTask(nullptr,nullptr); mBranchingFactor = branchingFactor; mMaxBranchDepth = maxBranchDepth; return this; } bool CThroughputTestTask::hasReachedMaxBranchingDepth() { return mCurBranchDepth >= mMaxBranchDepth; } CTaskResult* CThroughputTestTask::createTaskResult(CTaskHandleContext* handlerContext) { return &mBoolTaskResult; } CTaskStatus* CThroughputTestTask::createTaskStatus(CTaskHandleContext* handlerContext) { return &mDefaultTaskResult; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/COWLLargeJoinTestDataGenerator.cpp0000644000175000017500000001255312520551346025556 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLLargeJoinTestDataGenerator.h" namespace Konclude { namespace Test { COWLLargeJoinTestDataGenerator::COWLLargeJoinTestDataGenerator() : CLogIdentifier("::Konclude::Test::OWLLargeJoinTestDataGenerator",this) { owllinkNS = "http://www.owllink.org/owllink#"; owlNS = "http://www.w3.org/2002/07/owl#"; mIndividualBaseName = "http://ex.text/Indi/"; mPropertyBaseName = "http://ex.text/Prop/"; } COWLLargeJoinTestDataGenerator::~COWLLargeJoinTestDataGenerator() { } QString COWLLargeJoinTestDataGenerator::getIndividualName(cint64 indiNumber) { QString numberString(QString::number(indiNumber)); while (numberString.count() < mIndividualsNumberSize) { numberString.insert(0,"0"); } return mIndividualBaseName+numberString; } void COWLLargeJoinTestDataGenerator::generateData(cint64 size, double rate, const QString& filename) { QFile file(filename); if (file.open(QIODevice::WriteOnly)) { QString mSizeNumber(QString::number(size-1)); mIndividualsNumberSize = mSizeNumber.count(); mXMLWriter = new QXmlStreamWriter(&file); mXMLWriter->setAutoFormatting(true); mXMLWriter->writeStartDocument("1.0"); mXMLWriter->writeStartElement("Ontology"); mXMLWriter->writeDefaultNamespace("http://www.w3.org/2002/07/owl#"); createLargeJoinData(size,rate); mXMLWriter->writeEndElement(); mXMLWriter->writeEndDocument(); delete mXMLWriter; file.close(); } } void COWLLargeJoinTestDataGenerator::createLargeJoinData(cint64 size, double rate) { createPropertyDeclarations(); createIndividualDeclarations(size); cint64 propertyCount = size*rate; createPropertyAssertions(mPropertyBaseName+"c2",propertyCount,size); createPropertyAssertions(mPropertyBaseName+"c3",propertyCount,size); createPropertyAssertions(mPropertyBaseName+"c4",propertyCount,size); createPropertyAssertions(mPropertyBaseName+"d1",propertyCount,size); createPropertyAssertions(mPropertyBaseName+"d2",propertyCount,size); } void COWLLargeJoinTestDataGenerator::createPropertyDeclarations() { writePropertyDeclaration(mPropertyBaseName+"c2"); writePropertyDeclaration(mPropertyBaseName+"c3"); writePropertyDeclaration(mPropertyBaseName+"c4"); writePropertyDeclaration(mPropertyBaseName+"d1"); writePropertyDeclaration(mPropertyBaseName+"d2"); } void COWLLargeJoinTestDataGenerator::createIndividualDeclarations(cint64 size) { for (cint64 indiID = 0; indiID < size; ++indiID) { QString indiName = getIndividualName(indiID); writeIndividualDeclaration(indiName); } } void COWLLargeJoinTestDataGenerator::createPropertyAssertions(const QString& propertyName, cint64 count, cint64 maxNumber) { QSet< QPair > propPairSet; for (cint64 nr = 0; nr < count; ++nr) { cint64 indiID1 = qrand() % maxNumber; cint64 indiID2 = qrand() % maxNumber; if (!propPairSet.contains( QPair(indiID1,indiID2) )) { propPairSet.insert( QPair(indiID1,indiID2) ); QString indi1String = getIndividualName(indiID1); QString indi2String = getIndividualName(indiID2); writeIndividualPropertyAssertion(propertyName,indi1String,indi2String); } else { --nr; } } } void COWLLargeJoinTestDataGenerator::writeIndividualPropertyAssertion(const QString& propertyName, const QString& indiviualName1, const QString& indiviualName2) { mXMLWriter->writeStartElement("ObjectPropertyAssertion"); mXMLWriter->writeStartElement("ObjectProperty"); mXMLWriter->writeAttribute("IRI",propertyName); mXMLWriter->writeEndElement(); mXMLWriter->writeStartElement("NamedIndividual"); mXMLWriter->writeAttribute("IRI",indiviualName1); mXMLWriter->writeEndElement(); mXMLWriter->writeStartElement("NamedIndividual"); mXMLWriter->writeAttribute("IRI",indiviualName2); mXMLWriter->writeEndElement(); mXMLWriter->writeEndElement(); } void COWLLargeJoinTestDataGenerator::writeIndividualDeclaration(const QString& indiviualName) { mXMLWriter->writeStartElement("Declaration"); mXMLWriter->writeStartElement("NamedIndividual"); mXMLWriter->writeAttribute("IRI",indiviualName); mXMLWriter->writeEndElement(); mXMLWriter->writeEndElement(); } void COWLLargeJoinTestDataGenerator::writePropertyDeclaration(const QString& propertyName) { mXMLWriter->writeStartElement("Declaration"); mXMLWriter->writeStartElement("ObjectProperty"); mXMLWriter->writeAttribute("IRI",propertyName); mXMLWriter->writeEndElement(); mXMLWriter->writeEndElement(); } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestfileErrorEvaluator.cpp0000644000175000017500000001015312520551350026161 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerTestfileErrorEvaluator.h" namespace Konclude { namespace Test { CReasonerTestfileErrorEvaluator::CReasonerTestfileErrorEvaluator() : CLogIdentifier("::Konclude::Test::ReasonerTestfileErrorEvaluator",this) { } CReasonerTestfileErrorEvaluator::~CReasonerTestfileErrorEvaluator() { } CReasonerTestfileEvaluator *CReasonerTestfileErrorEvaluator::evaluateTestfile(CReasonerTestfileTest *test, const QByteArray &resultingByteArray) { QDomDocument document; if (document.setContent(resultingByteArray,true)) { QDomElement documentEl(document.documentElement()); checkTestResponseErrors(test->getTestResults(),&documentEl); } else { test->getTestResults()->addTestResult(false,false,false,false,0); } return this; } CReasonerTestfileErrorEvaluator *CReasonerTestfileErrorEvaluator::checkTestResponseErrors(CReasonerTestfileTestResult *testResult, QDomElement *node) { QDomElement documentElement(*node); QString docElemName = documentElement.tagName(); if (docElemName == "ox:ResponseMessage" || docElemName == "ResponseMessage") { QDomElement responseElement = documentElement.firstChildElement(); double totalResponseTime = 0; bool responseError = false; bool wrongResult = false; while (!responseElement.isNull()) { bool unknownElement = false; bool errorElement = false; bool hasResponseTime = false; qint64 responseTime = 0; QString respElemName = responseElement.tagName(); if (respElemName == "ox:KB" || respElemName == "KB") { } else if (respElemName == "ox:OK" || respElemName == "OK") { } else if (respElemName == "ox:Error" || respElemName == "Error") { QDomElement errResult = responseElement.firstChildElement("BooleanResponse"); if (errResult.isNull()) { errResult = responseElement.firstChildElement("ox:BooleanResponse"); } if (errResult.isNull()) { errorElement = true; } else { wrongResult = true; QString boolRespString = errResult.attribute("result"); LOG(WARNING,getLogDomain(),logTr("WRONG result of tested reasoner is '%1'.").arg(boolRespString),this); } } else if (respElemName == "ox:BooleanResponse" || respElemName == "BooleanResponse") { QString respTimeString = responseElement.attribute("response-time",""); if (!respTimeString.isEmpty()) { bool convertResponseTimeSuccess = false; responseTime = respTimeString.toLongLong(&convertResponseTimeSuccess); if (convertResponseTimeSuccess) { hasResponseTime = true; } } QString boolRespString = responseElement.attribute("result"); LOG(INFO,getLogDomain(),logTr("Reasoner calculated correct result: '%1'.").arg(boolRespString),this); } else if (respElemName == "#text") { // ignoring text nodes } else if (respElemName == "#comment") { // ignoring comment nodes } else { unknownElement = true; } if (unknownElement || errorElement) { responseError = true; } if (hasResponseTime) { totalResponseTime += responseTime; } responseElement = responseElement.nextSiblingElement(); } testResult->addTestResult(false,false,responseError,!wrongResult,totalResponseTime); } return this; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/COWLFileOWLlinkClassifyRequestGenerator.cpp0000644000175000017500000000734512520551344027441 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLFileOWLlinkClassifyRequestGenerator.h" namespace Konclude { namespace Test { COWLFileOWLlinkClassifyRequestGenerator::COWLFileOWLlinkClassifyRequestGenerator(CConfiguration *config) : CLogIdentifier("::Konclude::Test::OWLFileOWLlinkClassifyRequestGenerator",this),mConfig(config) { mReasonerTestKBName = "http://www.konclude.com/evaluation-testsuite/test-ontology"; } COWLFileOWLlinkClassifyRequestGenerator::~COWLFileOWLlinkClassifyRequestGenerator() { } QDomDocument COWLFileOWLlinkClassifyRequestGenerator::createRequestDocument() { QDomDocument document; QString owllinkNS = "http://www.owllink.org/owllink#"; QString owlNS = "http://www.w3.org/2002/07/owl#"; QDomElement rootNode; rootNode = document.createElementNS(owllinkNS,"RequestMessage"); //rootNode.setAttributeNS("xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttribute("xmlns:owl",owlNS); document.appendChild(rootNode); return document; } bool COWLFileOWLlinkClassifyRequestGenerator::generateOWLlinkClassifyRequest(const QString& requestFileName, const QString& responseFileName) { QDomDocument requestDocument = createRequestDocument(); QDomElement rootElement = requestDocument.documentElement(); QDomElement cKBElement = requestDocument.createElement("CreateKB"); cKBElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(cKBElement); QDomElement loadElement = requestDocument.createElement("LoadOntologies"); loadElement.setAttribute("kb",mReasonerTestKBName); QDomElement ontoIRIElement = requestDocument.createElement("OntologyIRI"); ontoIRIElement.setAttribute("IRI",QString("file:%1").arg(requestFileName)); loadElement.appendChild(ontoIRIElement); rootElement.appendChild(loadElement); QDomElement getClassifyElement = requestDocument.createElement("Classify"); getClassifyElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(getClassifyElement); QDomElement getSubClassHirElement = requestDocument.createElement("GetSubClassHierarchy"); getSubClassHirElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(getSubClassHirElement); QDomElement releaseKBElement = requestDocument.createElement("ReleaseKB"); releaseKBElement.setAttribute("kb",mReasonerTestKBName); rootElement.appendChild(releaseKBElement); QFile outFile(responseFileName); if (outFile.open(QIODevice::WriteOnly)) { outFile.write(requestDocument.toByteArray()); outFile.close(); } LOG(INFO,getLogDomain(),logTr("Generated OWLlink classify request '%1' for ontology '%2'.").arg(responseFileName).arg(requestFileName),this); return false; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/TestSettings.h0000644000175000017500000000266212520551352022020 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_TESTSETTINGS #define KONCLUDE_TEST_TESTSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Test { /*! * * \file TestSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations // Custom Events >= 2000 const QEvent::Type EVENTTESTFILE = (QEvent::Type)3000; const QEvent::Type EVENTEVALUATETESTFILE = (QEvent::Type)3001; }; // end namespace Test }; // end namespace Konclude #endif // end KONCLUDE_TEST_TESTSETTINGS Konclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestsuiteTestResult.cpp0000644000175000017500000000250512520551352025541 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerTestsuiteTestResult.h" namespace Konclude { namespace Test { CReasonerTestsuiteTestResult::CReasonerTestsuiteTestResult() { totTestTime = 0; } CReasonerTestsuiteTestResult::~CReasonerTestsuiteTestResult() { } double CReasonerTestsuiteTestResult::getTotalTestingTime() { return totTestTime; } CReasonerTestsuiteTestResult *CReasonerTestsuiteTestResult::setTotalTestingTime(double testTime) { totTestTime = testTime; return this; } }; // end namespace Test }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Test/CReasonerTestsuiteTester.h0000644000175000017500000000540212520551352024335 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CREASONERTESTSUITETESTER_H #define KONCLUDE_TEST_CREASONERTESTSUITETESTER_H // Libraries includes #include #include // Namespace includes #include "CReasonerTestfileTest.h" #include "CReasonerTestfileTestResult.h" #include "CReasonerTestfileTester.h" #include "CReasonerTestfileEvaluator.h" #include "CReasonerTestfileErrorEvaluator.h" // Other includes #include "Control/Command/CCommandRecordRouter.h" #include "Control/Command/CCommandExecutedBlocker.h" #include "Control/Command/Instructions/CTestTestsuiteCommand.h" #include "Control/Command/Instructions/CTestTestfileCommand.h" #include "Control/Command/Records/CStartProcessCommandRecord.h" #include "Control/Command/Records/CStopProcessCommandRecord.h" #include "Control/Command/Records/CFinishProcessCommandRecord.h" #include "Control/Command/Records/CUnspecifiedMessageInformationRecord.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Control::Command; using namespace Control::Command::Records; using namespace Control::Command::Instructions; namespace Test { /*! * * \class CReasonerTestsuiteTester * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerTestsuiteTester : public CLogIdentifier { // public methods public: //! Constructor CReasonerTestsuiteTester(CConfiguration *config); //! Destructor virtual ~CReasonerTestsuiteTester(); virtual CReasonerTestsuiteTester *realizeTestCommand(CTestTestsuiteCommand *command); // protected methods protected: // protected variables protected: CConfiguration *configuration; CReasonerTestfileTester *testFileTester; CReasonerTestfileErrorEvaluator *testErrorEvaluator; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_CREASONERTESTSUITETESTER_H Konclude-v0.6.2-544-SourceCode/Source/Test/CThroughputTestTaskTester.h0000644000175000017500000000442412520551352024504 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_TEST_CTHROUGHPUTTESTTASKTESTER_H #define KONCLUDE_TEST_CTHROUGHPUTTESTTASKTESTER_H // Libraries includes // Namespace includes #include "CThroughputTestTask.h" #include "CThroughputTestTaskHandleAlgorithm.h" // Other includes #include "Scheduler/CSingleThreadTaskProcessorUnit.h" #include "Scheduler/CTaskEventCommunicator.h" #include "Utilities/Memory/CObjectMemoryPoolAllocator.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; using namespace Utilities::Memory; namespace Test { /*! * * \class CThroughputTestTaskTester * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CThroughputTestTaskTester { // public methods public: //! Constructor CThroughputTestTaskTester(); //! Destructor virtual ~CThroughputTestTaskTester(); void generateTestingStructure(cint64 maxBranchDepth, cint64 branchingFactor); void startTesting(); void stopTesting(); cint64 getTaskProcessedCount(); void destroyTestingStructure(); // protected methods protected: // protected variables protected: CSingleThreadTaskProcessorUnit* mProcessUnit; CThroughputTestTaskHandleAlgorithm* handleAlg; cint64 mMaxBranchDepth; cint64 mBranchingFactor; // private methods private: // private variables private: }; }; // end namespace Test }; // end namespace Konclude #endif // KONCLUDE_TEST_CTHROUGHPUTTESTTASKTESTER_H Konclude-v0.6.2-544-SourceCode/Source/Context/0000755000175000017500000000000012613407250017706 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Context/CContextBase.cpp0000644000175000017500000000226212520756332022743 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CContextBase.h" namespace Konclude { namespace Context { CContextBase::CContextBase(CMemoryAllocationManager* memAllocManager) { mMemAllocManager = memAllocManager; } CContextBase::~CContextBase() { } CMemoryAllocationManager* CContextBase::getMemoryAllocationManager() { return mMemAllocManager; } }; // end namespace Context }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Context/CContext.cpp0000644000175000017500000000231612520756332022150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CContext.h" namespace Konclude { namespace Context { CContext::CContext() { } CContext::~CContext() { } CMemoryAllocationManager* CContext::getMemoryAllocationManager(CContext* context) { CMemoryAllocationManager* memAllMan = 0; if (context) { memAllMan = context->getMemoryAllocationManager(); } return memAllMan; } }; // end namespace Context }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Context/ContextSettings.h0000644000175000017500000000244612520756332023237 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTEXT_CONTEXTSETTINGS #define KONCLUDE_CONTEXT_CONTEXTSETTINGS // Libraries includes // Namespace includes // Other includes #include "KoncludeSettings.h" // Logger includes namespace Konclude { namespace Context { /*! * * \file ContextSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations }; // end namespace Context }; // end namespace Konclude #endif // end KONCLUDE_CONTEXT_CONTEXTSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Context/CContextBase.h0000644000175000017500000000341012520756332022404 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTEXT_CCONTEXTBASE_H #define KONCLUDE_CONTEXT_CCONTEXTBASE_H // Library includes // Namespace includes #include "ContextSettings.h" #include "CContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Context { /*! * * \class CContextBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CContextBase : public CContext { // public methods public: //! Constructor CContextBase(CMemoryAllocationManager* memAllocManager); //! Destructor virtual ~CContextBase(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); // protected methods protected: // protected variables protected: CMemoryAllocationManager* mMemAllocManager; // private methods private: // private variables private: }; }; // end namespace Context }; // end namespace Konclude #endif // KONCLUDE_CONTEXT_CCONTEXTBASE_H Konclude-v0.6.2-544-SourceCode/Source/Context/CContext.h0000644000175000017500000000344012520756332021614 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTEXT_CCONTEXT_H #define KONCLUDE_CONTEXT_CCONTEXT_H // Library includes // Namespace includes #include "ContextSettings.h" // Other includes #include "Utilities/Memory/CMemoryAllocationManager.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Context { /*! * * \class CContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CContext { // public methods public: //! Constructor CContext(); //! Destructor virtual ~CContext(); virtual CMemoryAllocationManager* getMemoryAllocationManager() = 0; static CMemoryAllocationManager* getMemoryAllocationManager(CContext* context); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Context }; // end namespace Konclude #endif // KONCLUDE_CONTEXT_CCONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/KoncludeSettings.h0000644000175000017500000000411212613406704021721 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_KONCLUDESETTINGS #define KONCLUDE_KONCLUDESETTINGS // Libraries includes #include // Namespace includes // Other includes // Logger includes namespace Konclude { /*! * * \file KoncludeSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ #define KONCLUDE_VERSION_MAJOR 0 #define KONCLUDE_VERSION_MINOR 6 #define KONCLUDE_VERSION_BUILD 2 #define KONCLUDE_VERSION_REVISION 544 #define KONCLUDE_VERSION_STRING "0.6.2-544" #define KONCLUDE_NAME "Konclude" #define KONCLUDE_NAME_EXTENSION "Uni Ulm Parallel Reasoner" #define KONCLUDE_DESCRIPTION "Reasoner for the SROIQV(D) Description Logic" #define KONCLUDE_DEFAULTREASONERMANAGER "ReasonerManager" #define KONCLUDE_DEFAULTCALCULATIONMANAGER "Konclude.Calculation.Calculator.ConcurrentTaskCalculationManager" #define KONCLUDE_OWLLINK_VERSION_MAJOR 1 #define KONCLUDE_OWLLINK_VERSION_MINOR 0 // Konclude code configs //#define KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED //#define KONCLUDE_FORCE_STATISTIC_DEACTIVATED #define KONCLUDE_ASSERT(expression) Q_ASSERT(expression) #define KONCLUDE_ASSERT_X(expression,source,reason) Q_ASSERT_X(expression,source,reason) }; // end namespace Konclude #endif // end KONCLUDE_KONCLUDESETTINGS Konclude-v0.6.2-544-SourceCode/Source/mainLoader.cpp0000644000175000017500000000533712520555232021052 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include #include "CKoncludeInfo.h" #include "Utilities/UtilitiesSettings.h" #include "Logger/CLogger.h" #include "Logger/CConsolePrintLogObserver.h" #include "Logger/CQtDebugPrintLogObserver.h" #include "Control/Loader/CCommandLineLoader.h" #include "Control/Loader/CDefaultLoaderFactory.h" #include "Control/Interface/CommandLine/CCommandLinePreparationTranslatorSelector.h" using namespace Konclude; using namespace Konclude::Logger; using namespace Konclude::Utilities; using namespace Konclude::Control::Loader; using namespace Konclude::Control::Interface::CommandLine; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); CLogger *logger = CLogger::getInstance(); try { QString koncludeString(QString("%1 - %2").arg(CKoncludeInfo::getKoncludeName()).arg(CKoncludeInfo::getKoncludeNameExtension())); LOG(INFO,"::Konclude::Main","Starting Konclude ... ",0); LOG(INFO,"::Konclude::Main",koncludeString,0); LOG(INFO,"::Konclude::Main",QString("%1, %2, Version %3 (%4)\r\n").arg(CKoncludeInfo::getKoncludeDescription()).arg(CKoncludeInfo::getKoncludeBitPlatformString()).arg(CKoncludeInfo::getKoncludeVersionString()).arg(CKoncludeInfo::getKoncludeCompilationDateString()),0); CLoaderFactory *loaderFactory = new CDefaultLoaderFactory(); QStringList arguments = CCommandLineLoader::getEncodedArguments(argc,argv); CCommandLinePreparationTranslatorSelector transSelector(loaderFactory); arguments = transSelector.translateArguments(arguments); CCommandLineLoader *cmdLineLoader = new CCommandLineLoader(arguments,false); cmdLineLoader->init(loaderFactory); cmdLineLoader->load(); a.exec(); cmdLineLoader->exit(); delete cmdLineLoader; delete loaderFactory; LOG(INFO,"::Konclude::Main",logTr("Stopping Konclude ... ."),0); } catch (...) { LOG(CATASTROPHIC,"::Konclude::Main",logTr("Stop because of an unknown catastrophic error."),0); } logger->shutdownLogger(); return 0; } Konclude-v0.6.2-544-SourceCode/Source/Renderer/0000755000175000017500000000000012613407260020031 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Renderer/CRenderedQtXMLItemLinker.h0000644000175000017500000000374612520551266024724 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_RENDERER_CRENDEREDQTXMLITEMLINKER_H #define KONCLUDE_RENDERER_CRENDEREDQTXMLITEMLINKER_H // Libraries includes #include // Namespace includes #include "RendererSettings.h" #include "CRenderedItemLinker.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Renderer { /*! * * \class CRenderedQtXMLItemLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRenderedQtXMLItemLinker : public CRenderedItemLinker { // public methods public: //! Constructor CRenderedQtXMLItemLinker(); QDomElement getDomElement(); QDomElement takeDomElement(); CRenderedQtXMLItemLinker* setDomElement(const QDomElement& domElement); CRenderedQtXMLItemLinker* clearDomElement(); CRenderedQtXMLItemLinker* getNextItemLinker(); // protected methods protected: // protected variables protected: QDomElement mDomElement; // private methods private: // private variables private: }; }; // end namespace Renderer }; // end namespace Konclude #endif // KONCLUDE_RENDERER_CRENDEREDQTXMLITEMLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Renderer/COntologyRenderVisitor.h0000644000175000017500000000341212520551266024642 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_RENDERER_CONTOLOGYRENDERVISITOR_H #define KONCLUDE_RENDERER_CONTOLOGYRENDERVISITOR_H // Libraries includes // Namespace includes #include "RendererSettings.h" #include "CRenderedItemLinker.h" #include "COntologyRenderer.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Ontology; namespace Renderer { /*! * * \class COntologyRenderVisitor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyRenderVisitor { // public methods public: //! Constructor COntologyRenderVisitor(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Renderer }; // end namespace Konclude #endif // KONCLUDE_RENDERER_CONTOLOGYRENDERVISITOR_H Konclude-v0.6.2-544-SourceCode/Source/Renderer/COntologyEmptyDefaultRenderer.cpp0000644000175000017500000000665012520551266026477 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyEmptyDefaultRenderer.h" namespace Konclude { namespace Renderer { COntologyEmptyDefaultRenderer::COntologyEmptyDefaultRenderer() { } bool COntologyEmptyDefaultRenderer::beginRender() { return true; } bool COntologyEmptyDefaultRenderer::endRender(CRenderedItemLinker* renderedItemLinker) { return true; } bool COntologyEmptyDefaultRenderer::beginRenderSubClassOfAxiom() { return true; } CRenderedItemLinker* COntologyEmptyDefaultRenderer::endRenderSubClassOfAxiom(CRenderedItemLinker* renderedItemLinker) { return nullptr; } bool COntologyEmptyDefaultRenderer::beginRenderDeclarationAxiom() { return true; } CRenderedItemLinker* COntologyEmptyDefaultRenderer::endRenderDeclarationAxiom(CRenderedItemLinker* renderedItemLinker) { return nullptr; } bool COntologyEmptyDefaultRenderer::beginRenderObjectComplementOfExpression() { return true; } CRenderedItemLinker* COntologyEmptyDefaultRenderer::endRenderObjectComplementOfExpression(CRenderedItemLinker* renderedItemLinker) { return nullptr; } bool COntologyEmptyDefaultRenderer::beginRenderObjectIntersectionOfExpression() { return true; } CRenderedItemLinker* COntologyEmptyDefaultRenderer::endRenderObjectIntersectionOfExpression(CRenderedItemLinker* renderedItemLinker) { return nullptr; } bool COntologyEmptyDefaultRenderer::beginRenderObjectUnionOfExpression() { return true; } CRenderedItemLinker* COntologyEmptyDefaultRenderer::endRenderObjectUnionOfExpression(CRenderedItemLinker* renderedItemLinker) { return nullptr; } bool COntologyEmptyDefaultRenderer::beginRenderObjectSomeValuesFromExpression() { return true; } CRenderedItemLinker* COntologyEmptyDefaultRenderer::endRenderObjectSomeValuesFromExpression(CRenderedItemLinker* renderedItemLinker) { return nullptr; } bool COntologyEmptyDefaultRenderer::beginRenderObjectAllValuesFromExpression() { return true; } CRenderedItemLinker* COntologyEmptyDefaultRenderer::endRenderObjectAllValuesFromExpression(CRenderedItemLinker* renderedItemLinker) { return nullptr; } bool COntologyEmptyDefaultRenderer::beginRenderClassExpression(const QString& name) { return true; } CRenderedItemLinker* COntologyEmptyDefaultRenderer::endRenderClassExpression(const QString& name) { return nullptr; } bool COntologyEmptyDefaultRenderer::beginRenderObjectPropertyExpression(const QString& name) { return true; } CRenderedItemLinker* COntologyEmptyDefaultRenderer::endRenderObjectPropertyExpression(const QString& name) { return nullptr; } }; // end namespace Renderer }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Renderer/COntologyRenderer.cpp0000644000175000017500000000174212520551266024150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyRenderer.h" namespace Konclude { namespace Renderer { COntologyRenderer::COntologyRenderer() { } }; // end namespace Renderer }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Renderer/COntologyRenderer.h0000644000175000017500000000636712520551266023625 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_RENDERER_CONTOLOGYRENDERER_H #define KONCLUDE_RENDERER_CONTOLOGYRENDERER_H // Libraries includes // Namespace includes #include "RendererSettings.h" #include "CRenderedItemLinker.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Renderer { /*! * * \class COntologyRenderer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyRenderer { // public methods public: //! Constructor COntologyRenderer(); virtual bool beginRender() = 0; virtual bool endRender(CRenderedItemLinker* renderedItemLinker) = 0; virtual bool beginRenderSubClassOfAxiom() = 0; virtual CRenderedItemLinker* endRenderSubClassOfAxiom(CRenderedItemLinker* renderedItemLinker) = 0; virtual bool beginRenderDeclarationAxiom() = 0; virtual CRenderedItemLinker* endRenderDeclarationAxiom(CRenderedItemLinker* renderedItemLinker) = 0; virtual bool beginRenderObjectComplementOfExpression() = 0; virtual CRenderedItemLinker* endRenderObjectComplementOfExpression(CRenderedItemLinker* renderedItemLinker) = 0; virtual bool beginRenderObjectIntersectionOfExpression() = 0; virtual CRenderedItemLinker* endRenderObjectIntersectionOfExpression(CRenderedItemLinker* renderedItemLinker) = 0; virtual bool beginRenderObjectUnionOfExpression() = 0; virtual CRenderedItemLinker* endRenderObjectUnionOfExpression(CRenderedItemLinker* renderedItemLinker) = 0; virtual bool beginRenderObjectSomeValuesFromExpression() = 0; virtual CRenderedItemLinker* endRenderObjectSomeValuesFromExpression(CRenderedItemLinker* renderedItemLinker) = 0; virtual bool beginRenderObjectAllValuesFromExpression() = 0; virtual CRenderedItemLinker* endRenderObjectAllValuesFromExpression(CRenderedItemLinker* renderedItemLinker) = 0; virtual bool beginRenderClassExpression(const QString& name) = 0; virtual CRenderedItemLinker* endRenderClassExpression(const QString& name) = 0; virtual bool beginRenderObjectPropertyExpression(const QString& name) = 0; virtual CRenderedItemLinker* endRenderObjectPropertyExpression(const QString& name) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Renderer }; // end namespace Konclude #endif // KONCLUDE_RENDERER_CONTOLOGYRENDERER_H Konclude-v0.6.2-544-SourceCode/Source/Renderer/CRenderWriteManager.h0000644000175000017500000000443612520551270024037 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_RENDERER_CRENDERWRITEMANAGER_H #define KONCLUDE_RENDERER_CRENDERWRITEMANAGER_H // Libraries includes #include // Namespace includes #include "RendererSettings.h" // Other includes #include "Control/Command/CCommand.h" #include "Control/Command/CCommandRecordRouter.h" #include "Control/Command/Instructions/CWriteOWL2XMLOntologyCommand.h" #include "Control/Command/Instructions/CWriteOWLlinkOWL2XMLSatisfiableTestCommand.h" #include "Control/Command/Records/CStartProcessCommandRecord.h" #include "Control/Command/Records/CStopProcessCommandRecord.h" #include "Control/Command/Records/CFinishProcessCommandRecord.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" using namespace Konclude::Logger; namespace Konclude { using namespace Control; using namespace Command; using namespace Records; using namespace Instructions; namespace Renderer { /*! * * \class CRenderWriteManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRenderWriteManager : public CLogIdentifier { // public methods public: //! Constructor CRenderWriteManager(); virtual bool realizeCommand(CCommand* command); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Renderer }; // end namespace Konclude #endif // KONCLUDE_RENDERER_CRENDERWRITEMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Renderer/RendererSettings.h0000644000175000017500000000267212520551270023476 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_RENDERER_RENDERERSETTINGS #define KONCLUDE_RENDERER_RENDERERSETTINGS // Libraries includes // Namespace includes // Other includes #include "KoncludeSettings.h" #include "Utilities/Container/CQtList.h" // Logger includes namespace Konclude { using namespace Utilities; using namespace Utilities::Container; namespace Renderer { /*! * * \file RendererSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations #define CRENDEREDLIST CQtList }; // end namespace Renderer }; // end namespace Konclude #endif // end KONCLUDE_RENDERER_RENDERERSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Renderer/COntologyExtractionManager.cpp0000644000175000017500000000403512520551266026013 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyExtractionManager.h" namespace Konclude { namespace Renderer { COntologyExtractionManager::COntologyExtractionManager() : CLogIdentifier("::Konclude::Renderer::OntologyExtractionManager",this) { } bool COntologyExtractionManager::realizeCommand(CCommand* command) { if (dynamic_cast(command)) { if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CExtractToldExpressionsOntologyCommand* extToldExpOntC = (CExtractToldExpressionsOntologyCommand*)command; COntologyRevision* ontoRev = extToldExpOntC->getOntologyRevision(); COntologyRenderer* renderer = extToldExpOntC->getRenderer(); QStringList extEntityList = extToldExpOntC->getExtractionEntityList(); COntologyParsedBuildExpressionRenderVisitor extractor; extractor.visitAndRender(extEntityList,ontoRev->getOntology(),renderer); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); return true; } } return false; } }; // end namespace Renderer }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Renderer/CRenderedItemLinker.h0000644000175000017500000000336212520551266024030 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_RENDERER_CRENDEREDITEMLINKER_H #define KONCLUDE_RENDERER_CRENDEREDITEMLINKER_H // Libraries includes // Namespace includes #include "RendererSettings.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Utilities::Container; namespace Renderer { /*! * * \class CRenderedItemLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRenderedItemLinker : public CLinkerBase { // public methods public: //! Constructor CRenderedItemLinker(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Renderer }; // end namespace Konclude #endif // KONCLUDE_RENDERER_CRENDEREDITEMLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Renderer/COntologyEmptyDefaultRenderer.h0000644000175000017500000000645112520551266026143 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_RENDERER_CONTOLOGYEMPTYDEFAULTRENDERER_H #define KONCLUDE_RENDERER_CONTOLOGYEMPTYDEFAULTRENDERER_H // Libraries includes // Namespace includes #include "RendererSettings.h" #include "CRenderedItemLinker.h" #include "COntologyRenderer.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Renderer { /*! * * \class COntologyEmptyDefaultRenderer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyEmptyDefaultRenderer : public COntologyRenderer { // public methods public: //! Constructor COntologyEmptyDefaultRenderer(); virtual bool beginRender(); virtual bool endRender(CRenderedItemLinker* renderedItemLinker); virtual bool beginRenderSubClassOfAxiom(); virtual CRenderedItemLinker* endRenderSubClassOfAxiom(CRenderedItemLinker* renderedItemLinker); virtual bool beginRenderDeclarationAxiom(); virtual CRenderedItemLinker* endRenderDeclarationAxiom(CRenderedItemLinker* renderedItemLinker); virtual bool beginRenderObjectComplementOfExpression(); virtual CRenderedItemLinker* endRenderObjectComplementOfExpression(CRenderedItemLinker* renderedItemLinker); virtual bool beginRenderObjectIntersectionOfExpression(); virtual CRenderedItemLinker* endRenderObjectIntersectionOfExpression(CRenderedItemLinker* renderedItemLinker); virtual bool beginRenderObjectUnionOfExpression(); virtual CRenderedItemLinker* endRenderObjectUnionOfExpression(CRenderedItemLinker* renderedItemLinker); virtual bool beginRenderObjectSomeValuesFromExpression(); virtual CRenderedItemLinker* endRenderObjectSomeValuesFromExpression(CRenderedItemLinker* renderedItemLinker); virtual bool beginRenderObjectAllValuesFromExpression(); virtual CRenderedItemLinker* endRenderObjectAllValuesFromExpression(CRenderedItemLinker* renderedItemLinker); virtual bool beginRenderClassExpression(const QString& name); virtual CRenderedItemLinker* endRenderClassExpression(const QString& name); virtual bool beginRenderObjectPropertyExpression(const QString& name); virtual CRenderedItemLinker* endRenderObjectPropertyExpression(const QString& name); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Renderer }; // end namespace Konclude #endif // KONCLUDE_RENDERER_CONTOLOGYEMPTYDEFAULTRENDERER_H Konclude-v0.6.2-544-SourceCode/Source/Renderer/CRenderWriteManager.cpp0000644000175000017500000001163512520551270024371 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRenderWriteManager.h" namespace Konclude { namespace Renderer { CRenderWriteManager::CRenderWriteManager() : CLogIdentifier("::Konclude::Renderer::RenderWriteManager",this) { } bool CRenderWriteManager::realizeCommand(CCommand* command) { if (dynamic_cast(command)) { if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CWriteOWL2XMLOntologyCommand* writeOWL2XMLOntC = (CWriteOWL2XMLOntologyCommand*)command; COntologyOWL2QtXMLRenderer* renderer = writeOWL2XMLOntC->getOWL2XMLRenderer(); QString writeFileName = writeOWL2XMLOntC->getWriteFileName(); QFile file(writeFileName); if (file.open(QIODevice::WriteOnly)) { QString owlNS = "http://www.w3.org/2002/07/owl#"; QDomDocument document; QDomElement rootNode = document.createElementNS(owlNS,"Ontology"); rootNode.setAttribute("xmlns:owl",owlNS); renderer->addRenderedAxiomsToDomElement(rootNode); document.appendChild(rootNode); file.write(document.toByteArray()); file.close(); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); return true; } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CWriteOWLlinkOWL2XMLSatisfiableTestCommand* writeOWL2XMLOntC = (CWriteOWLlinkOWL2XMLSatisfiableTestCommand*)command; COntologyOWL2QtXMLRenderer* renderer = writeOWL2XMLOntC->getOWL2XMLRenderer(); QString writeFileName = writeOWL2XMLOntC->getWriteFileName(); QString destKBName = writeOWL2XMLOntC->getTestKBName(); QStringList testClassNames = writeOWL2XMLOntC->getSatisfiableTestClassesList(); QFile file(writeFileName); if (file.open(QIODevice::WriteOnly)) { QString owlNS = "http://www.w3.org/2002/07/owl#"; QString owllinkNS = "http://www.owllink.org/owllink#"; QDomDocument document; QDomProcessingInstruction header = document.createProcessingInstruction("xml","version=\"1.0\""); document.appendChild(header); QDomElement rootNode = document.createElementNS(owllinkNS,"RequestMessage"); rootNode.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttribute("xmlns:owl",owlNS); document.appendChild(rootNode); QDomElement createOntologyNode = document.createElement("CreateKB"); createOntologyNode.setAttribute(QString("kb"),QString(destKBName)); rootNode.appendChild(createOntologyNode); QDomElement tellOntologyNode = document.createElement("Tell"); tellOntologyNode.setAttribute(QString("kb"),QString(destKBName)); renderer->addRenderedAxiomsToDomElement(tellOntologyNode); rootNode.appendChild(tellOntologyNode); foreach (QString testClass, testClassNames) { QDomElement queryOntologyNode = document.createElement("IsClassSatisfiable"); queryOntologyNode.setAttribute(QString("kb"),QString(destKBName)); queryOntologyNode.setAttribute(QString("timing"),QString("simple")); QDomElement classEl = document.createElement("owl:Class"); classEl.setAttribute("IRI",testClass); queryOntologyNode.appendChild(classEl); rootNode.appendChild(queryOntologyNode); } QDomElement releaseOntologyNode = document.createElement("ReleaseKB"); releaseOntologyNode.setAttribute(QString("kb"),QString(destKBName)); rootNode.appendChild(releaseOntologyNode); document.appendChild(rootNode); file.write(document.toByteArray()); file.close(); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); return true; } } return false; } }; // end namespace Renderer }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Renderer/COntologyParsedBuildExpressionRenderVisitor.cpp0000644000175000017500000003572312520551266031406 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyParsedBuildExpressionRenderVisitor.h" namespace Konclude { namespace Renderer { COntologyParsedBuildExpressionRenderVisitor::COntologyParsedBuildExpressionRenderVisitor() { } bool COntologyParsedBuildExpressionRenderVisitor::visitAndRender(const QStringList& entityStringList, CConcreteOntology* ontology, COntologyRenderer* renderer) { mOntology = ontology; mRenderer = renderer; COntologyBuildData* buildDataBox = ontology->getBuildData(); mConceptClassTermMapHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getConceptClassTermMappingHash(); mClassTermExpClassAxiomHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getClassTermExpressionClassAxiomExpressionHash(); CBUILDHASH* classEntityHash = buildDataBox->getClassEntityBuildHash(); CQtList entityList; foreach (QString entityName, entityStringList) { CClassExpression* classExp = classEntityHash->value(entityName); if (classExp) { entityList.append(classExp); } } visitAndRender(entityList); return true; } bool COntologyParsedBuildExpressionRenderVisitor::visitAndRender(const CQtList& conceptList, CConcreteOntology* ontology, COntologyRenderer* renderer) { mOntology = ontology; mRenderer = renderer; COntologyBuildData* buildDataBox = ontology->getBuildData(); mConceptClassTermMapHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getConceptClassTermMappingHash(); mClassTermExpClassAxiomHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getClassTermExpressionClassAxiomExpressionHash(); CQtList entityList; foreach (CConcept* concept, conceptList) { CClassTermExpression* classTermExp = mConceptClassTermMapHash->value(concept); if (classTermExp) { CClassExpression* classExp = dynamic_cast(classTermExp); if (classExp) { entityList.append(classExp); } } } visitAndRender(entityList); return true; } bool COntologyParsedBuildExpressionRenderVisitor::visitAndRender(const CQtList& entityList) { CRenderedItemLinker* renderedLinker = nullptr; CRenderedItemLinker* lastRenderedLinker = nullptr; if (mRenderer->beginRender()) { foreach (CExpressionEntity* entityExp, entityList) { addRemainingVisitingAndRenderEntity(entityExp); } while (!mRemainingEntityList.isEmpty() || !mRemainingAxiomList.isEmpty()) { while (!mRemainingEntityList.isEmpty()) { CExpressionEntity* entity = mRemainingEntityList.takeFirst(); mRenderer->beginRenderDeclarationAxiom(); CRenderedItemLinker* tmpRenderedLinker = getRenderedEntityExpression(entity); tmpRenderedLinker = mRenderer->endRenderDeclarationAxiom(tmpRenderedLinker); if (tmpRenderedLinker) { if (lastRenderedLinker) { lastRenderedLinker = lastRenderedLinker->append(tmpRenderedLinker); } else { renderedLinker = tmpRenderedLinker; } lastRenderedLinker = tmpRenderedLinker; } } while (!mRemainingAxiomList.isEmpty()) { CAxiomExpression* axiomExp = mRemainingAxiomList.takeFirst(); CRenderedItemLinker* tmpRenderedLinker = getRenderedAxiomExpression(axiomExp); if (tmpRenderedLinker) { if (lastRenderedLinker) { lastRenderedLinker = lastRenderedLinker->append(tmpRenderedLinker); } else { renderedLinker = tmpRenderedLinker; } lastRenderedLinker = tmpRenderedLinker; } } } mRenderer->endRender(renderedLinker); return true; } return false; } CRenderedItemLinker* COntologyParsedBuildExpressionRenderVisitor::getRenderedAxiomExpression(CAxiomExpression* axiomExp) { CRenderedItemLinker* renderedLinker = nullptr; CBuildExpression::ExpressionType type = axiomExp->getType(); if (type == CBuildExpression::BETESUBCLASSOF) { renderedLinker = getRenderedSubClassOfAxiom(axiomExp); } return renderedLinker; } CRenderedItemLinker* COntologyParsedBuildExpressionRenderVisitor::getRenderedSubClassOfAxiom(CAxiomExpression* axiomExp) { CRenderedItemLinker* renderedLinker = nullptr; if (mRenderer->beginRenderSubClassOfAxiom()) { CSubClassOfExpression* subClassOfExp = (CSubClassOfExpression*)axiomExp; CClassTermExpression* subClassTermExp = subClassOfExp->getSubClassTermExpression(); renderedLinker = getRenderedClassTermExpression(subClassTermExp); CClassTermExpression* superClassTermExp = subClassOfExp->getSuperClassTermExpression(); CRenderedItemLinker* tmpRenderedLinker = getRenderedClassTermExpression(superClassTermExp); if (renderedLinker) { renderedLinker->append(tmpRenderedLinker); } else { renderedLinker = tmpRenderedLinker; } renderedLinker = mRenderer->endRenderSubClassOfAxiom(renderedLinker); } return renderedLinker; } CRenderedItemLinker* COntologyParsedBuildExpressionRenderVisitor::getRenderedClassTermExpression(CClassTermExpression* classTermExp) { CRenderedItemLinker* renderedLinker = nullptr; CBuildExpression::ExpressionType type = classTermExp->getType(); if (type == CBuildExpression::BETCLASS) { renderedLinker = getRenderedClassExpression(classTermExp); } else if (type == CBuildExpression::BETOBJECTINTERSECTION) { renderedLinker = getRenderedObjectIntersectionOfExpression(classTermExp); } else if (type == CBuildExpression::BETOBJECTUNION) { renderedLinker = getRenderedObjectUnionOfExpression(classTermExp); } else if (type == CBuildExpression::BETOBJECTCOMPLEMENTOF) { renderedLinker = getRenderedObjectComplementOfExpression(classTermExp); } else if (type == CBuildExpression::BETOBJECTSOMEVALUEFROM) { renderedLinker = getRenderedObjectSomeValuesFromExpression(classTermExp); } else if (type == CBuildExpression::BETOBJECTALLVALUEFROM) { renderedLinker = getRenderedObjectAllValuesFromExpression(classTermExp); } return renderedLinker; } CRenderedItemLinker* COntologyParsedBuildExpressionRenderVisitor::getRenderedObjectPropertyTermExpression(CObjectPropertyTermExpression* objPropTermExp) { CRenderedItemLinker* renderedLinker = nullptr; CBuildExpression::ExpressionType type = objPropTermExp->getType(); if (type == CBuildExpression::BETOBJECTPROPERTY) { renderedLinker = getRenderedObjectPropertyExpression(objPropTermExp); } return renderedLinker; } CRenderedItemLinker* COntologyParsedBuildExpressionRenderVisitor::getRenderedObjectPropertyExpression(CObjectPropertyTermExpression* objPropTermExp) { CRenderedItemLinker* renderedLinker = nullptr; CObjectPropertyExpression* objPropExpression = (CObjectPropertyExpression*)objPropTermExp; const QString& name = getNameFromEntityExpression(objPropExpression); if (mRenderer->beginRenderObjectPropertyExpression(name)) { addRemainingVisitingAndRenderEntity(objPropExpression); renderedLinker = mRenderer->endRenderObjectPropertyExpression(name); } return renderedLinker; } CRenderedItemLinker* COntologyParsedBuildExpressionRenderVisitor::getRenderedClassExpression(CClassTermExpression* classTermExp) { CRenderedItemLinker* renderedLinker = nullptr; CClassExpression* classExpression = (CClassExpression*)classTermExp; const QString& name = getNameFromEntityExpression(classExpression); if (mRenderer->beginRenderClassExpression(name)) { addRemainingVisitingAndRenderEntity(classExpression); renderedLinker = mRenderer->endRenderClassExpression(name); } return renderedLinker; } CRenderedItemLinker* COntologyParsedBuildExpressionRenderVisitor::getRenderedObjectSomeValuesFromExpression(CClassTermExpression* classTermExp) { CRenderedItemLinker* renderedLinker = nullptr; if (mRenderer->beginRenderObjectSomeValuesFromExpression()) { serachRemainingVisitingAndRenderAxiom(classTermExp); CObjectSomeValuesFromExpression* someValuesFromExp = (CObjectSomeValuesFromExpression*)classTermExp; renderedLinker = getRenderedObjectPropertyTermExpression(someValuesFromExp->getObjectPropertyTermExpression()); CRenderedItemLinker* tmpRenderedLinker = getRenderedClassTermExpression(someValuesFromExp->getClassTermExpression()); if (renderedLinker) { renderedLinker->append(tmpRenderedLinker); } else { renderedLinker = tmpRenderedLinker; } renderedLinker = mRenderer->endRenderObjectSomeValuesFromExpression(renderedLinker); } return renderedLinker; } CRenderedItemLinker* COntologyParsedBuildExpressionRenderVisitor::getRenderedObjectAllValuesFromExpression(CClassTermExpression* classTermExp) { CRenderedItemLinker* renderedLinker = nullptr; if (mRenderer->beginRenderObjectAllValuesFromExpression()) { serachRemainingVisitingAndRenderAxiom(classTermExp); CObjectAllValuesFromExpression* allValuesFromExp = (CObjectAllValuesFromExpression*)classTermExp; renderedLinker = getRenderedObjectPropertyTermExpression(allValuesFromExp->getObjectPropertyTermExpression()); CRenderedItemLinker* tmpRenderedLinker = getRenderedClassTermExpression(allValuesFromExp->getClassTermExpression()); if (renderedLinker) { renderedLinker->append(tmpRenderedLinker); } else { renderedLinker = tmpRenderedLinker; } renderedLinker = mRenderer->endRenderObjectAllValuesFromExpression(renderedLinker); } return renderedLinker; } CRenderedItemLinker* COntologyParsedBuildExpressionRenderVisitor::getRenderedObjectIntersectionOfExpression(CClassTermExpression* classTermExp) { CRenderedItemLinker* renderedLinker = nullptr; CRenderedItemLinker* lastRenderedLinker = nullptr; if (mRenderer->beginRenderObjectIntersectionOfExpression()) { serachRemainingVisitingAndRenderAxiom(classTermExp); CObjectIntersectionOfExpression* intersectionOfExp = (CObjectIntersectionOfExpression*)classTermExp; foreach (CClassTermExpression* nextClassTermExp, *intersectionOfExp->getClassTermExpressionList()) { CRenderedItemLinker* tmpRenderedLinker = getRenderedClassTermExpression(nextClassTermExp); if (tmpRenderedLinker) { if (lastRenderedLinker) { lastRenderedLinker = lastRenderedLinker->append(tmpRenderedLinker); } else { renderedLinker = tmpRenderedLinker; } lastRenderedLinker = tmpRenderedLinker; } } renderedLinker = mRenderer->endRenderObjectIntersectionOfExpression(renderedLinker); } return renderedLinker; } CRenderedItemLinker* COntologyParsedBuildExpressionRenderVisitor::getRenderedObjectUnionOfExpression(CClassTermExpression* classTermExp) { CRenderedItemLinker* renderedLinker = nullptr; CRenderedItemLinker* lastRenderedLinker = nullptr; if (mRenderer->beginRenderObjectUnionOfExpression()) { serachRemainingVisitingAndRenderAxiom(classTermExp); CObjectUnionOfExpression* unionOfExp = (CObjectUnionOfExpression*)classTermExp; foreach (CClassTermExpression* nextClassTermExp, *unionOfExp->getClassTermExpressionList()) { CRenderedItemLinker* tmpRenderedLinker = getRenderedClassTermExpression(nextClassTermExp); if (tmpRenderedLinker) { if (lastRenderedLinker) { lastRenderedLinker = lastRenderedLinker->append(tmpRenderedLinker); } else { renderedLinker = tmpRenderedLinker; } lastRenderedLinker = tmpRenderedLinker; } } renderedLinker = mRenderer->endRenderObjectUnionOfExpression(renderedLinker); } return renderedLinker; } CRenderedItemLinker* COntologyParsedBuildExpressionRenderVisitor::getRenderedObjectComplementOfExpression(CClassTermExpression* classTermExp) { CRenderedItemLinker* renderedLinker = nullptr; if (mRenderer->beginRenderObjectComplementOfExpression()) { serachRemainingVisitingAndRenderAxiom(classTermExp); CObjectComplementOfExpression* unionOfExp = (CObjectComplementOfExpression*)classTermExp; renderedLinker = getRenderedClassTermExpression(unionOfExp->getComplementExpression()); renderedLinker = mRenderer->endRenderObjectComplementOfExpression(renderedLinker); } return renderedLinker; } QString COntologyParsedBuildExpressionRenderVisitor::getNameFromEntityExpression(CExpressionEntity* entity) { return entity->getName(); } CRenderedItemLinker* COntologyParsedBuildExpressionRenderVisitor::getRenderedEntityExpression(CExpressionEntity* entity) { CRenderedItemLinker* renderedLinker = nullptr; const QString& name = getNameFromEntityExpression(entity); CClassExpression* classExpression = dynamic_cast(entity); if (classExpression) { if (mRenderer->beginRenderClassExpression(name)) { renderedLinker = mRenderer->endRenderClassExpression(name); serachRemainingVisitingAndRenderAxiom(classExpression); } } else { CObjectPropertyExpression* propertyExpression = dynamic_cast(entity); if (propertyExpression) { if (mRenderer->beginRenderObjectPropertyExpression(name)) { renderedLinker = mRenderer->endRenderObjectPropertyExpression(name); serachRemainingVisitingAndRenderAxiom(propertyExpression); } } } return renderedLinker; } bool COntologyParsedBuildExpressionRenderVisitor::serachRemainingVisitingAndRenderAxiom(CClassTermExpression* expression) { bool foundAxiom = false; if (!mTestedAxiomSet.contains(expression)) { mTestedAxiomSet.insert(expression); foreach (CClassAxiomExpression* axiomExpression, mClassTermExpClassAxiomHash->values(expression)) { if (!mVisitedAxiomSet.contains(axiomExpression)) { mVisitedAxiomSet.insert(axiomExpression); mRemainingAxiomList.append(axiomExpression); foundAxiom = true; } } } return foundAxiom; } bool COntologyParsedBuildExpressionRenderVisitor::serachRemainingVisitingAndRenderAxiom(CObjectPropertyTermExpression* expression) { bool foundAxiom = false; if (!mTestedAxiomSet.contains(expression)) { mTestedAxiomSet.insert(expression); } return foundAxiom; } bool COntologyParsedBuildExpressionRenderVisitor::addRemainingVisitingAndRenderEntity(CExpressionEntity* entity) { if (!mVisitedEntitySet.contains(entity)) { mVisitedEntitySet.insert(entity); mRemainingEntityList.append(entity); return true; } return false; } }; // end namespace Renderer }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Renderer/COntologyExtractionManager.h0000644000175000017500000000450712520551266025464 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_RENDERER_CONTOLOGYEXTRACTIONMANAGER_H #define KONCLUDE_RENDERER_CONTOLOGYEXTRACTIONMANAGER_H // Libraries includes // Namespace includes #include "RendererSettings.h" #include "CRenderedItemLinker.h" #include "COntologyParsedBuildExpressionRenderVisitor.h" // Other includes #include "Control/Command/CCommand.h" #include "Control/Command/CCommandRecordRouter.h" #include "Control/Command/Instructions/CExtractToldExpressionsOntologyCommand.h" #include "Control/Command/Records/CStartProcessCommandRecord.h" #include "Control/Command/Records/CStopProcessCommandRecord.h" #include "Control/Command/Records/CFinishProcessCommandRecord.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" using namespace Konclude::Logger; namespace Konclude { using namespace Control; using namespace Command; using namespace Records; using namespace Instructions; namespace Renderer { /*! * * \class COntologyExtractionManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyExtractionManager : public CLogIdentifier { // public methods public: //! Constructor COntologyExtractionManager(); virtual bool realizeCommand(CCommand* command); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Renderer }; // end namespace Konclude #endif // KONCLUDE_RENDERER_CONTOLOGYEXTRACTIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Renderer/COntologyOWL2QtXMLRenderer.cpp0000644000175000017500000001515612520551266025506 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyOWL2QtXMLRenderer.h" namespace Konclude { namespace Renderer { COntologyOWL2QtXMLRenderer::COntologyOWL2QtXMLRenderer() { mAxiomRenderedItemLinker = nullptr; mTmpRenderedItemLinker = nullptr; } COntologyOWL2QtXMLRenderer::~COntologyOWL2QtXMLRenderer() { qDeleteAll(mRenderedItemContainer); } bool COntologyOWL2QtXMLRenderer::addRenderedAxiomsToDomElement(QDomElement& domElement) { bool added = false; for (CRenderedQtXMLItemLinker* linkerIt = mAxiomRenderedItemLinker; linkerIt; linkerIt = linkerIt->getNextItemLinker()) { domElement.appendChild(linkerIt->getDomElement()); added = true; } return added; } bool COntologyOWL2QtXMLRenderer::beginRender() { return true; } bool COntologyOWL2QtXMLRenderer::endRender(CRenderedItemLinker* renderedItemLinker) { mAxiomRenderedItemLinker = (CRenderedQtXMLItemLinker*)renderedItemLinker; return true; } CRenderedItemLinker* COntologyOWL2QtXMLRenderer::endRenderSubClassOfAxiom(CRenderedItemLinker* renderedItemLinker) { QDomElement node = mDocument.createElement("owl:SubClassOf"); for (CRenderedQtXMLItemLinker* linkerIt = (CRenderedQtXMLItemLinker*)renderedItemLinker; linkerIt; linkerIt = linkerIt->getNextItemLinker()) { node.appendChild(linkerIt->getDomElement()); } releaseRenderedItemLinkers(renderedItemLinker); return createRenderedItemLinker()->setDomElement(node); } CRenderedItemLinker* COntologyOWL2QtXMLRenderer::endRenderDeclarationAxiom(CRenderedItemLinker* renderedItemLinker) { QDomElement node = mDocument.createElement("owl:Declaration"); for (CRenderedQtXMLItemLinker* linkerIt = (CRenderedQtXMLItemLinker*)renderedItemLinker; linkerIt; linkerIt = linkerIt->getNextItemLinker()) { node.appendChild(linkerIt->getDomElement()); } releaseRenderedItemLinkers(renderedItemLinker); return createRenderedItemLinker()->setDomElement(node); } CRenderedItemLinker* COntologyOWL2QtXMLRenderer::endRenderObjectComplementOfExpression(CRenderedItemLinker* renderedItemLinker) { QDomElement node = mDocument.createElement("owl:ObjectComplementOf"); for (CRenderedQtXMLItemLinker* linkerIt = (CRenderedQtXMLItemLinker*)renderedItemLinker; linkerIt; linkerIt = linkerIt->getNextItemLinker()) { node.appendChild(linkerIt->getDomElement()); } releaseRenderedItemLinkers(renderedItemLinker); return createRenderedItemLinker()->setDomElement(node); } CRenderedItemLinker* COntologyOWL2QtXMLRenderer::endRenderObjectIntersectionOfExpression(CRenderedItemLinker* renderedItemLinker) { QDomElement node = mDocument.createElement("owl:ObjectIntersectionOf"); for (CRenderedQtXMLItemLinker* linkerIt = (CRenderedQtXMLItemLinker*)renderedItemLinker; linkerIt; linkerIt = linkerIt->getNextItemLinker()) { node.appendChild(linkerIt->getDomElement()); } releaseRenderedItemLinkers(renderedItemLinker); return createRenderedItemLinker()->setDomElement(node); } CRenderedItemLinker* COntologyOWL2QtXMLRenderer::endRenderObjectUnionOfExpression(CRenderedItemLinker* renderedItemLinker) { QDomElement node = mDocument.createElement("owl:ObjectUnionOf"); for (CRenderedQtXMLItemLinker* linkerIt = (CRenderedQtXMLItemLinker*)renderedItemLinker; linkerIt; linkerIt = linkerIt->getNextItemLinker()) { node.appendChild(linkerIt->getDomElement()); } releaseRenderedItemLinkers(renderedItemLinker); return createRenderedItemLinker()->setDomElement(node); } CRenderedItemLinker* COntologyOWL2QtXMLRenderer::endRenderObjectSomeValuesFromExpression(CRenderedItemLinker* renderedItemLinker) { QDomElement node = mDocument.createElement("owl:ObjectSomeValuesFrom"); for (CRenderedQtXMLItemLinker* linkerIt = (CRenderedQtXMLItemLinker*)renderedItemLinker; linkerIt; linkerIt = linkerIt->getNextItemLinker()) { node.appendChild(linkerIt->getDomElement()); } releaseRenderedItemLinkers(renderedItemLinker); return createRenderedItemLinker()->setDomElement(node); } CRenderedItemLinker* COntologyOWL2QtXMLRenderer::endRenderObjectAllValuesFromExpression(CRenderedItemLinker* renderedItemLinker) { QDomElement node = mDocument.createElement("owl:ObjectAllValuesFrom"); for (CRenderedQtXMLItemLinker* linkerIt = (CRenderedQtXMLItemLinker*)renderedItemLinker; linkerIt; linkerIt = linkerIt->getNextItemLinker()) { node.appendChild(linkerIt->getDomElement()); } releaseRenderedItemLinkers(renderedItemLinker); return createRenderedItemLinker()->setDomElement(node); } CRenderedItemLinker* COntologyOWL2QtXMLRenderer::endRenderClassExpression(const QString& name) { QDomElement node = mDocument.createElement("owl:Class"); node.setAttribute("IRI",name); return createRenderedItemLinker()->setDomElement(node); } CRenderedItemLinker* COntologyOWL2QtXMLRenderer::endRenderObjectPropertyExpression(const QString& name) { QDomElement node = mDocument.createElement("owl:ObjectProperty"); node.setAttribute("IRI",name); return createRenderedItemLinker()->setDomElement(node); } CRenderedQtXMLItemLinker* COntologyOWL2QtXMLRenderer::createRenderedItemLinker() { CRenderedQtXMLItemLinker* linker = mTmpRenderedItemLinker; if (linker) { mTmpRenderedItemLinker = mTmpRenderedItemLinker->getNextItemLinker(); linker->clearNext(); } else { linker = new CRenderedQtXMLItemLinker(); mRenderedItemContainer.append(linker); } return linker; } COntologyOWL2QtXMLRenderer* COntologyOWL2QtXMLRenderer::releaseRenderedItemLinkers(CRenderedItemLinker* linkers) { if (linkers) { for (CRenderedQtXMLItemLinker* linkerIt = (CRenderedQtXMLItemLinker*)linkers; linkerIt; linkerIt = linkerIt->getNextItemLinker()) { linkerIt->clearDomElement(); } mTmpRenderedItemLinker = (CRenderedQtXMLItemLinker*)linkers->append(mTmpRenderedItemLinker); } return this; } }; // end namespace Renderer }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Renderer/COntologyRenderVisitor.cpp0000644000175000017500000000176012520551266025201 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyRenderVisitor.h" namespace Konclude { namespace Renderer { COntologyRenderVisitor::COntologyRenderVisitor() { } }; // end namespace Renderer }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Renderer/COntologyOWL2QtXMLRenderer.h0000644000175000017500000000642712520551266025154 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_RENDERER_CONTOLOGYOWL2QTXMLRENDERER_H #define KONCLUDE_RENDERER_CONTOLOGYOWL2QTXMLRENDERER_H // Libraries includes // Namespace includes #include "RendererSettings.h" #include "COntologyRenderer.h" #include "COntologyEmptyDefaultRenderer.h" #include "CRenderedQtXMLItemLinker.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Renderer { /*! * * \class COntologyOWL2QtXMLRenderer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyOWL2QtXMLRenderer : public COntologyEmptyDefaultRenderer { // public methods public: //! Constructor COntologyOWL2QtXMLRenderer(); //! Destructor virtual ~COntologyOWL2QtXMLRenderer(); virtual bool beginRender(); virtual bool endRender(CRenderedItemLinker* renderedItemLinker); virtual CRenderedItemLinker* endRenderSubClassOfAxiom(CRenderedItemLinker* renderedItemLinker); virtual CRenderedItemLinker* endRenderDeclarationAxiom(CRenderedItemLinker* renderedItemLinker); virtual CRenderedItemLinker* endRenderObjectComplementOfExpression(CRenderedItemLinker* renderedItemLinker); virtual CRenderedItemLinker* endRenderObjectIntersectionOfExpression(CRenderedItemLinker* renderedItemLinker); virtual CRenderedItemLinker* endRenderObjectUnionOfExpression(CRenderedItemLinker* renderedItemLinker); virtual CRenderedItemLinker* endRenderObjectSomeValuesFromExpression(CRenderedItemLinker* renderedItemLinker); virtual CRenderedItemLinker* endRenderObjectAllValuesFromExpression(CRenderedItemLinker* renderedItemLinker); virtual CRenderedItemLinker* endRenderClassExpression(const QString& name); virtual CRenderedItemLinker* endRenderObjectPropertyExpression(const QString& name); CRenderedQtXMLItemLinker* createRenderedItemLinker(); COntologyOWL2QtXMLRenderer* releaseRenderedItemLinkers(CRenderedItemLinker* linkers); bool addRenderedAxiomsToDomElement(QDomElement& domElement); // protected methods protected: // protected variables protected: QList mRenderedItemContainer; CRenderedQtXMLItemLinker* mTmpRenderedItemLinker; QDomDocument mDocument; CRenderedQtXMLItemLinker* mAxiomRenderedItemLinker; // private methods private: // private variables private: }; }; // end namespace Renderer }; // end namespace Konclude #endif // KONCLUDE_RENDERER_CONTOLOGYOWL2QTXMLRENDERER_H Konclude-v0.6.2-544-SourceCode/Source/Renderer/COntologyParsedBuildExpressionRenderVisitor.h0000644000175000017500000001147412520551266031050 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_RENDERER_CONTOLOGYPARSEDBUILDEXPRESSIONRENDERVISITOR_H #define KONCLUDE_RENDERER_CONTOLOGYPARSEDBUILDEXPRESSIONRENDERVISITOR_H // Libraries includes // Namespace includes #include "RendererSettings.h" #include "CRenderedItemLinker.h" #include "COntologyRenderer.h" #include "COntologyRenderVisitor.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Parser/Expressions/CSubClassOfExpression.h" #include "Parser/Expressions/CClassTermExpression.h" #include "Parser/Expressions/CClassExpression.h" #include "Parser/Expressions/CObjectPropertyExpression.h" #include "Parser/Expressions/CObjectIntersectionOfExpression.h" #include "Parser/Expressions/CObjectUnionOfExpression.h" #include "Parser/Expressions/CObjectComplementOfExpression.h" #include "Parser/Expressions/CObjectSomeValuesFromExpression.h" #include "Parser/Expressions/CObjectAllValuesFromExpression.h" #include "Reasoner/Generator/CStringRefStringHasher.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Ontology; using namespace Reasoner::Generator; using namespace Parser::Expression; namespace Renderer { /*! * * \class COntologyParsedBuildExpressionRenderVisitor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyParsedBuildExpressionRenderVisitor : public COntologyRenderVisitor { // public methods public: //! Constructor COntologyParsedBuildExpressionRenderVisitor(); bool visitAndRender(const CQtList& conceptList, CConcreteOntology* ontology, COntologyRenderer* renderer); bool visitAndRender(const QStringList& entityStringList, CConcreteOntology* ontology, COntologyRenderer* renderer); // protected methods protected: bool visitAndRender(const CQtList& entityList); bool addRemainingVisitingAndRenderEntity(CExpressionEntity* entity); CRenderedItemLinker* getRenderedEntityExpression(CExpressionEntity* entity); QString getNameFromEntityExpression(CExpressionEntity* entity); bool serachRemainingVisitingAndRenderAxiom(CClassTermExpression* expression); bool serachRemainingVisitingAndRenderAxiom(CObjectPropertyTermExpression* expression); CRenderedItemLinker* getRenderedAxiomExpression(CAxiomExpression* axiomExp); CRenderedItemLinker* getRenderedSubClassOfAxiom(CAxiomExpression* axiomExp); CRenderedItemLinker* getRenderedClassTermExpression(CClassTermExpression* classTermExp); CRenderedItemLinker* getRenderedClassExpression(CClassTermExpression* classTermExp); CRenderedItemLinker* getRenderedObjectIntersectionOfExpression(CClassTermExpression* classTermExp); CRenderedItemLinker* getRenderedObjectUnionOfExpression(CClassTermExpression* classTermExp); CRenderedItemLinker* getRenderedObjectComplementOfExpression(CClassTermExpression* classTermExp); CRenderedItemLinker* getRenderedObjectSomeValuesFromExpression(CClassTermExpression* classTermExp); CRenderedItemLinker* getRenderedObjectAllValuesFromExpression(CClassTermExpression* classTermExp); CRenderedItemLinker* getRenderedObjectPropertyTermExpression(CObjectPropertyTermExpression* objPropTermExp); CRenderedItemLinker* getRenderedObjectPropertyExpression(CObjectPropertyTermExpression* objPropTermExp); // protected variables protected: CBUILDHASH* mConceptClassTermMapHash; CBUILDHASH* mClassTermExpClassAxiomHash; COntologyRenderer* mRenderer; CConcreteOntology* mOntology; QSet mVisitedEntitySet; QList mRemainingEntityList; QSet mTestedAxiomSet; QSet mVisitedAxiomSet; QList mRemainingAxiomList; // private methods private: // private variables private: }; }; // end namespace Renderer }; // end namespace Konclude #endif // KONCLUDE_RENDERER_CONTOLOGYPARSEDBUILDEXPRESSIONRENDERVISITOR_H Konclude-v0.6.2-544-SourceCode/Source/Renderer/CRenderedQtXMLItemLinker.cpp0000644000175000017500000000317212520551266025250 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRenderedQtXMLItemLinker.h" namespace Konclude { namespace Renderer { CRenderedQtXMLItemLinker::CRenderedQtXMLItemLinker() { } QDomElement CRenderedQtXMLItemLinker::getDomElement() { return mDomElement; } QDomElement CRenderedQtXMLItemLinker::takeDomElement() { QDomElement tmpDomElement(mDomElement); mDomElement.clear(); return tmpDomElement; } CRenderedQtXMLItemLinker* CRenderedQtXMLItemLinker::setDomElement(const QDomElement& domElement) { mDomElement = domElement; return this; } CRenderedQtXMLItemLinker* CRenderedQtXMLItemLinker::clearDomElement() { mDomElement.clear(); return this; } CRenderedQtXMLItemLinker* CRenderedQtXMLItemLinker::getNextItemLinker() { return (CRenderedQtXMLItemLinker*)(getNext()); } }; // end namespace Renderer }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Renderer/CRenderedItemLinker.cpp0000644000175000017500000000204612520551266024361 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRenderedItemLinker.h" namespace Konclude { namespace Renderer { CRenderedItemLinker::CRenderedItemLinker() : CLinkerBase(this) { } }; // end namespace Renderer }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/0000755000175000017500000000000012613407260020201 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskContext.cpp0000644000175000017500000000177512520551274023273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskContext.h" namespace Konclude { namespace Scheduler { CTaskContext::CTaskContext() { } CTaskContext::~CTaskContext() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CConcreteTaskScheduleItem.h0000644000175000017500000000444712520551272025347 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CCONCRETETASKSCHEDULEITEM_H #define KONCLUDE_SCHEDULER_CCONCRETETASKSCHEDULEITEM_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskScheduleItem.h" #include "CConcreteTaskSchedulerCommunicator.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Scheduler { /*! * * \class CConcreteTaskScheduleItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteTaskScheduleItem : public CTaskScheduleItem, public CLinkerBase { // public methods public: //! Constructor CConcreteTaskScheduleItem(); //! Destructor virtual ~CConcreteTaskScheduleItem(); CConcreteTaskScheduleItem* initTaskScheduleItem(CConcreteTaskSchedulerCommunicator* communicator, CConcreteTaskScheduleItem* nextSchedulerItem = nullptr); CConcreteTaskSchedulerCommunicator* getCommunicator(); CConcreteTaskScheduleItem* setCommunicator(CConcreteTaskSchedulerCommunicator* communicator); // protected methods protected: // protected variables protected: CConcreteTaskSchedulerCommunicator* mCommunicator; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CCONCRETETASKSCHEDULEITEM_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskEventHandlerBasedCompletor.cpp0000644000175000017500000000213412520551276027042 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskEventHandlerBasedCompletor.h" namespace Konclude { namespace Scheduler { CTaskEventHandlerBasedCompletor::CTaskEventHandlerBasedCompletor() { } CTaskEventHandlerBasedCompletor::~CTaskEventHandlerBasedCompletor() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskHandleAlgorithm.cpp0000644000175000017500000000204512520551276024702 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskHandleAlgorithm.h" namespace Konclude { namespace Scheduler { CTaskHandleAlgorithm::CTaskHandleAlgorithm() { } CTaskHandleAlgorithm::~CTaskHandleAlgorithm() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskDistributionCompletorCommunicator.h0000644000175000017500000000635112520551276030236 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKDISTRIBUTIONCOMPLETORCOMMUNICATOR_H #define KONCLUDE_SCHEDULER_CTASKDISTRIBUTIONCOMPLETORCOMMUNICATOR_H // Library includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskEventHandlerBasedDistributionCompletor.h" #include "CTaskEventHandlerBasedProcessor.h" #include "CTaskEventCommunicator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskDistributionCompletorCommunicator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskDistributionCompletorCommunicator { // public methods public: //! Constructor CTaskDistributionCompletorCommunicator(CTaskEventHandlerBasedDistributionCompletor* taskDistributionCompletor, CTaskEventHandlerBasedProcessor* taskProcessor); //! Destructor virtual ~CTaskDistributionCompletorCommunicator(); // to completer CTaskDistributionCompletorCommunicator* communicateTaskComplete(CTask* task, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskDistributionCompletorCommunicator* communicateAdditionalAllocationTask(CTask* task, CMemoryPool* memoryPools, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskDistributionCompletorCommunicator* communicateDistributeMemoryPools(CMemoryPool* memoryPools, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskDistributionCompletorCommunicator* communicateDistributeMemoryPools(CMemoryPool* memoryPools); // to processor CTaskDistributionCompletorCommunicator* communicateAlignedUpdateTaskStatus(CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskDistributionCompletorCommunicator* communicateTaskStatusUpdated(CTask* parentTask, CTask* updatedTask, bool success, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); // protected methods protected: // protected variables protected: CTaskEventCommunicator mDistributionCompletorTaskEventCommunicator; CTaskEventCommunicator mProcessorTaskEventCommunicator; CTaskEventHandlerBasedDistributionCompletor* mTaskDistributionCompletor; CTaskEventHandlerBasedProcessor* mTaskProcessor; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKDISTRIBUTIONCOMPLETORCOMMUNICATOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveMultiArrayQueueConsumer.h0000644000175000017500000000437312520551304027451 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKRESERVEMULTIARRAYQUEUECONSUMER_H #define KONCLUDE_SCHEDULER_CTASKRESERVEMULTIARRAYQUEUECONSUMER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskReserveQueueConsumer.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Scheduler { /*! * * \class CTaskReserveMultiArrayQueueConsumer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskReserveMultiArrayQueueConsumer : public CTaskReserveQueueConsumer, public CLinkerBase { // public methods public: //! Constructor CTaskReserveMultiArrayQueueConsumer(CTaskReserveMultiArrayQueue* arrayQueue); CTask* getTask(); cint64 getTakenTask(); cint64 getRequestedTask(); // protected methods protected: // protected variables protected: CTaskReserveMultiArrayQueue* mArrayQueue; CXLinker* mLastQueueLinker; CXLinker* mQueueConsumerLinker; cint64 mTakenTask; cint64 mRequestedTask; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKRESERVEMULTIARRAYQUEUECONSUMER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskCompletor.cpp0000644000175000017500000000200712520551274023600 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskCompletor.h" namespace Konclude { namespace Scheduler { CTaskCompletor::CTaskCompletor() { } CTaskCompletor::~CTaskCompletor() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveQueueAdder.cpp0000644000175000017500000000257012520551304025213 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskReserveQueueAdder.h" namespace Konclude { namespace Scheduler { CTaskReserveQueueAdder::CTaskReserveQueueAdder(CTaskReserveQueue* queue, CTaskReserveQueueAdderController* controller) : mQueue(queue),mController(controller) { } bool CTaskReserveQueueAdder::tryAddTasks(CTask*& tasks) { if (mQueue && mQueue->tryAddTasks(tasks)) { return true; } return false; } bool CTaskReserveQueueAdder::requiresTaskAddedNotification() { return mController->requiresTaskAddedNotification(); } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskOwner.cpp0000644000175000017500000000176312520551300022724 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskOwner.h" namespace Konclude { namespace Scheduler { CTaskOwner::CTaskOwner() { } CTaskOwner::~CTaskOwner() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/0000755000175000017500000000000012613407260021445 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CTaskStatusUpdatedEvent.h0000644000175000017500000000443012520551272026341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_EVENTS_CTASKSTATUSUPDATEDEVENT_H #define KONCLUDE_SCHEDULER_EVENTS_CTASKSTATUSUPDATEDEVENT_H // Libraries includes // Namespace includes #include "../SchedulerSettings.h" #include "../CTask.h" // Other includes #include "Concurrent/CEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Scheduler { namespace Events { /*! * \class CTaskStatusUpdatedEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CTaskStatusUpdatedEvent : public CEvent { // public methods public: //! Constructor CTaskStatusUpdatedEvent(CMemoryPool* memoryPool); //! Destructor virtual ~CTaskStatusUpdatedEvent(); static const cint64 EVENTTYPEID = CTASKSTATUSUPDATEDEVENTTYPEID; CTaskStatusUpdatedEvent* setParentTask(CTask* task); CTask* getParentTask(); CTaskStatusUpdatedEvent* setUpdatedTask(CTask* task); CTask* getUpdatedTask(); CTaskStatusUpdatedEvent* setUpdateSuccess(bool updateSuccess); bool getUpdateSuccess(); // protected methods protected: // protected variables protected: CTask* mUpdatedTask; CTask* mParentTask; bool mUpdateSuccess; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_EVENTS_CTASKSTATUSUPDATEDEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CRequestScheduleTaskEvent.cpp0000644000175000017500000000345112520551270027207 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRequestScheduleTaskEvent.h" namespace Konclude { namespace Scheduler { namespace Events { CRequestScheduleTaskEvent::CRequestScheduleTaskEvent(CMemoryPool* memoryPool) : CEvent(EVENTTYPEID,memoryPool) { mScheduleItem = nullptr; mCommunicator = nullptr; } CRequestScheduleTaskEvent::~CRequestScheduleTaskEvent() { } CTaskScheduleItem* CRequestScheduleTaskEvent::getTaskScheduleItem() { return mScheduleItem; } CRequestScheduleTaskEvent* CRequestScheduleTaskEvent::setTaskScheduleItem(CTaskScheduleItem* taskScheduleItem) { mScheduleItem = taskScheduleItem; return this; } CTaskSchedulerCommunicator* CRequestScheduleTaskEvent::getCommunicator() { return mCommunicator; } CRequestScheduleTaskEvent* CRequestScheduleTaskEvent::setCommunicator(CTaskSchedulerCommunicator* communicator) { mCommunicator = communicator; return this; } }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CTaskStatusUpdatedEvent.cpp0000644000175000017500000000363012520551272026675 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskStatusUpdatedEvent.h" namespace Konclude { namespace Scheduler { namespace Events { CTaskStatusUpdatedEvent::CTaskStatusUpdatedEvent(CMemoryPool* memoryPool) : CEvent(EVENTTYPEID,memoryPool) { mParentTask = nullptr; mUpdatedTask = nullptr; mUpdateSuccess = false; } CTaskStatusUpdatedEvent::~CTaskStatusUpdatedEvent() { } CTaskStatusUpdatedEvent* CTaskStatusUpdatedEvent::setParentTask(CTask* task) { mParentTask = task; return this; } CTask* CTaskStatusUpdatedEvent::getParentTask() { return mParentTask; } CTaskStatusUpdatedEvent* CTaskStatusUpdatedEvent::setUpdatedTask(CTask* task) { mUpdatedTask = task; return this; } CTask* CTaskStatusUpdatedEvent::getUpdatedTask() { return mUpdatedTask; } CTaskStatusUpdatedEvent* CTaskStatusUpdatedEvent::setUpdateSuccess(bool updateSuccess) { mUpdateSuccess = updateSuccess; return this; } bool CTaskStatusUpdatedEvent::getUpdateSuccess() { return mUpdateSuccess; } }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CTaskDispenseNotificationEvent.cpp0000644000175000017500000000303212520551272030220 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskDispenseNotificationEvent.h" namespace Konclude { namespace Scheduler { namespace Events { CTaskDispenseNotificationEvent::CTaskDispenseNotificationEvent(CMemoryPool* memoryPool) : CEvent(EVENTTYPEID,memoryPool) { mCommunicator = nullptr; } CTaskDispenseNotificationEvent::~CTaskDispenseNotificationEvent() { } CTaskSchedulerCommunicator* CTaskDispenseNotificationEvent::getCommunicator() { return mCommunicator; } CTaskDispenseNotificationEvent* CTaskDispenseNotificationEvent::setCommunicator(CTaskSchedulerCommunicator* communicator) { mCommunicator = communicator; return this; } }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CAlignedUpdateTaskStatusEvent.cpp0000644000175000017500000000271412520551270030015 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAlignedUpdateTaskStatusEvent.h" namespace Konclude { namespace Scheduler { namespace Events { CAlignedUpdateTaskStatusEvent::CAlignedUpdateTaskStatusEvent(CMemoryPool* memoryPool) : CEvent(EVENTTYPEID,memoryPool) { mUpdateTask = nullptr; } CAlignedUpdateTaskStatusEvent::~CAlignedUpdateTaskStatusEvent() { } CAlignedUpdateTaskStatusEvent* CAlignedUpdateTaskStatusEvent::setUpdateTask(CTask* task) { mUpdateTask = task; return this; } CTask* CAlignedUpdateTaskStatusEvent::getUpdateTask() { return mUpdateTask; } }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CRequestProcessTaskEvent.h0000644000175000017500000000416112520551270026535 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_EVENTS_CREQUESTPROCESSTASKEVENT_H #define KONCLUDE_SCHEDULER_EVENTS_CREQUESTPROCESSTASKEVENT_H // Libraries includes // Namespace includes #include "../SchedulerSettings.h" // Other includes #include "Concurrent/CEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Scheduler { namespace Events { /*! * \class CRequestProcessTaskEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CRequestProcessTaskEvent : public CEvent { // public methods public: //! Constructor CRequestProcessTaskEvent(CMemoryPool* memoryPool = nullptr); //! Destructor virtual ~CRequestProcessTaskEvent(); static const cint64 EVENTTYPEID = CREQUESTPROCESSTASKEVENTTYPEID; CTaskSchedulerCommunicator* getCommunicator(); CRequestProcessTaskEvent* setCommunicator(CTaskSchedulerCommunicator* communicator); // protected methods protected: // protected variables protected: CTaskSchedulerCommunicator* mCommunicator; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_EVENTS_CREQUESTPROCESSTASKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CUpdateTaskStatusEvent.h0000644000175000017500000000421612520551272026177 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_EVENTS_CUPDATETASKSTATUSEVENT_H #define KONCLUDE_SCHEDULER_EVENTS_CUPDATETASKSTATUSEVENT_H // Libraries includes // Namespace includes #include "../SchedulerSettings.h" #include "../CTask.h" // Other includes #include "Concurrent/CEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Scheduler { namespace Events { /*! * \class CUpdateTaskStatusEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CUpdateTaskStatusEvent : public CEvent { // public methods public: //! Constructor CUpdateTaskStatusEvent(CMemoryPool* memoryPool); //! Destructor virtual ~CUpdateTaskStatusEvent(); static const cint64 EVENTTYPEID = CUPDATETASKSTATUSEVENTTYPEID; CUpdateTaskStatusEvent* setParentTask(CTask* task); CTask* getParentTask(); CUpdateTaskStatusEvent* setUpdateTask(CTask* task); CTask* getUpdateTask(); // protected methods protected: // protected variables protected: CTask* mUpdateTask; CTask* mParentTask; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_EVENTS_CUPDATETASKSTATUSEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CSendTaskProcessEvent.cpp0000644000175000017500000000316012520551270026327 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSendTaskProcessEvent.h" namespace Konclude { namespace Scheduler { namespace Events { CSendTaskProcessEvent::CSendTaskProcessEvent(CMemoryPool* memoryPool) : CEvent(EVENTTYPEID,memoryPool) { mTask = nullptr; mSchedulingTask = false; } CSendTaskProcessEvent::~CSendTaskProcessEvent() { } CSendTaskProcessEvent* CSendTaskProcessEvent::setTask(CTask* task) { mTask = task; return this; } CTask* CSendTaskProcessEvent::getTask() { return mTask; } CSendTaskProcessEvent* CSendTaskProcessEvent::setSchedulingTask(bool schedulable) { mSchedulingTask = schedulable; return this; } bool CSendTaskProcessEvent::isSchedulingTask() { return mSchedulingTask; } }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CRequestScheduleTaskEvent.h0000644000175000017500000000451412520551270026655 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_EVENTS_CREQUESTSCHEDULETASKEVENT_H #define KONCLUDE_SCHEDULER_EVENTS_CREQUESTSCHEDULETASKEVENT_H // Libraries includes // Namespace includes #include "../SchedulerSettings.h" #include "../CTaskScheduleItem.h" // Other includes #include "Concurrent/CEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Scheduler { namespace Events { /*! * \class CRequestScheduleTaskEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CRequestScheduleTaskEvent : public CEvent { // public methods public: //! Constructor CRequestScheduleTaskEvent(CMemoryPool* memoryPool = nullptr); //! Destructor virtual ~CRequestScheduleTaskEvent(); static const cint64 EVENTTYPEID = CREQUESTSCHEDULETASKEVENTTYPEID; CTaskScheduleItem* getTaskScheduleItem(); CRequestScheduleTaskEvent* setTaskScheduleItem(CTaskScheduleItem* taskScheduleItem); CTaskSchedulerCommunicator* getCommunicator(); CRequestScheduleTaskEvent* setCommunicator(CTaskSchedulerCommunicator* communicator); // protected methods protected: // protected variables protected: CTaskScheduleItem* mScheduleItem; CTaskSchedulerCommunicator* mCommunicator; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_EVENTS_CREQUESTSCHEDULETASKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CTaskDispenseNotificationEvent.h0000644000175000017500000000424712520551272027676 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_EVENTS_CTASKDISPENSENOTIFICATIONEVENT_H #define KONCLUDE_SCHEDULER_EVENTS_CTASKDISPENSENOTIFICATIONEVENT_H // Libraries includes // Namespace includes #include "../SchedulerSettings.h" // Other includes #include "Concurrent/CEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Scheduler { namespace Events { /*! * \class CTaskDispenseNotificationEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CTaskDispenseNotificationEvent : public CEvent { // public methods public: //! Constructor CTaskDispenseNotificationEvent(CMemoryPool* memoryPool = nullptr); //! Destructor virtual ~CTaskDispenseNotificationEvent(); static const cint64 EVENTTYPEID = CTASKDISPENSENOTIFICATIONEVENTTYPEID; CTaskSchedulerCommunicator* getCommunicator(); CTaskDispenseNotificationEvent* setCommunicator(CTaskSchedulerCommunicator* communicator); // protected methods protected: // protected variables protected: CTaskSchedulerCommunicator* mCommunicator; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_EVENTS_CTASKDISPENSENOTIFICATIONEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CSendTaskScheduleEvent.h0000644000175000017500000000402712520551272026117 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_EVENTS_CSENDTASKSCHEDULEEVENT_H #define KONCLUDE_SCHEDULER_EVENTS_CSENDTASKSCHEDULEEVENT_H // Libraries includes // Namespace includes #include "../SchedulerSettings.h" #include "../CTask.h" // Other includes #include "Concurrent/CEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Scheduler { namespace Events { /*! * \class CSendTaskScheduleEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CSendTaskScheduleEvent : public CEvent { // public methods public: //! Constructor CSendTaskScheduleEvent(CMemoryPool* memoryPool = nullptr); //! Destructor virtual ~CSendTaskScheduleEvent(); static const cint64 EVENTTYPEID = CSENDTASKSCHEDULEEVENTTYPEID; CSendTaskScheduleEvent* setTask(CTask* task); CTask* getTask(); // protected methods protected: // protected variables protected: CTask* mTask; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_EVENTS_CSENDTASKSCHEDULEEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CDistributeMemoryPoolEvent.h0000644000175000017500000000424112520551270027063 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_EVENTS_CDISTRIBUTEMEMORYPOOLEVENT_H #define KONCLUDE_SCHEDULER_EVENTS_CDISTRIBUTEMEMORYPOOLEVENT_H // Libraries includes // Namespace includes #include "../SchedulerSettings.h" // Other includes #include "Concurrent/CEvent.h" #include "Utilities/Memory/CMemoryPool.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; using namespace Utilities::Memory; namespace Scheduler { namespace Events { /*! * \class CDistributeMemoryPoolEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CDistributeMemoryPoolEvent : public CEvent { // public methods public: //! Constructor CDistributeMemoryPoolEvent(CMemoryPool* memoryPool = nullptr); //! Destructor virtual ~CDistributeMemoryPoolEvent(); static const cint64 EVENTTYPEID = CDISTRIBUTEMEMORYPOOLEVENTTYPEID; CMemoryPool* getMemoryPools(); CDistributeMemoryPoolEvent* setMemoryPools(CMemoryPool* memoryPools); // protected methods protected: // protected variables protected: CMemoryPool* mMemoryPools; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_EVENTS_CDISTRIBUTEMEMORYPOOLEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CAlignedUpdateTaskStatusEvent.h0000644000175000017500000000413512520551270027461 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_EVENTS_CALIGNEDUPDATETASKSTATUSEVENT_H #define KONCLUDE_SCHEDULER_EVENTS_CALIGNEDUPDATETASKSTATUSEVENT_H // Libraries includes // Namespace includes #include "../SchedulerSettings.h" #include "../CTask.h" // Other includes #include "Concurrent/CEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Scheduler { namespace Events { /*! * \class CAlignedUpdateTaskStatusEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CAlignedUpdateTaskStatusEvent : public CEvent { // public methods public: //! Constructor CAlignedUpdateTaskStatusEvent(CMemoryPool* memoryPool); //! Destructor virtual ~CAlignedUpdateTaskStatusEvent(); static const cint64 EVENTTYPEID = CALIGNEDUPDATETASKSTATUSEVENTTYPEID; CAlignedUpdateTaskStatusEvent* setUpdateTask(CTask* task); CTask* getUpdateTask(); // protected methods protected: // protected variables protected: CTask* mUpdateTask; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_EVENTS_CALIGNEDUPDATETASKSTATUSEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CTaskAdditionalAllocationEvent.cpp0000644000175000017500000000342212520551272030160 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskAdditionalAllocationEvent.h" namespace Konclude { namespace Scheduler { namespace Events { CTaskAdditionalAllocationEvent::CTaskAdditionalAllocationEvent(CMemoryPool* memoryPool) : CEvent(EVENTTYPEID,memoryPool) { mAddMemoryPools = nullptr; mTask = nullptr; } CTaskAdditionalAllocationEvent::~CTaskAdditionalAllocationEvent() { } CTaskAdditionalAllocationEvent* CTaskAdditionalAllocationEvent::setTask(CTask* task) { mTask = task; return this; } CTask* CTaskAdditionalAllocationEvent::getTask() { return mTask; } CMemoryPool* CTaskAdditionalAllocationEvent::getAdditionalAllocatedMemoryPools() { return mAddMemoryPools; } CTaskAdditionalAllocationEvent* CTaskAdditionalAllocationEvent::setAdditionalAllocatedMemoryPools(CMemoryPool* addMemoryPools) { mAddMemoryPools = addMemoryPools; return this; } }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CSendTaskScheduleEvent.cpp0000644000175000017500000000256412520551270026454 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSendTaskScheduleEvent.h" namespace Konclude { namespace Scheduler { namespace Events { CSendTaskScheduleEvent::CSendTaskScheduleEvent(CMemoryPool* memoryPool) : CEvent(EVENTTYPEID,memoryPool) { mTask = nullptr; } CSendTaskScheduleEvent::~CSendTaskScheduleEvent() { } CSendTaskScheduleEvent* CSendTaskScheduleEvent::setTask(CTask* task) { mTask = task; return this; } CTask* CSendTaskScheduleEvent::getTask() { return mTask; } }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CRequestProcessTaskEvent.cpp0000644000175000017500000000275212520551270027074 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRequestProcessTaskEvent.h" namespace Konclude { namespace Scheduler { namespace Events { CRequestProcessTaskEvent::CRequestProcessTaskEvent(CMemoryPool* memoryPool) : CEvent(EVENTTYPEID,memoryPool) { mCommunicator = nullptr; } CRequestProcessTaskEvent::~CRequestProcessTaskEvent() { } CTaskSchedulerCommunicator* CRequestProcessTaskEvent::getCommunicator() { return mCommunicator; } CRequestProcessTaskEvent* CRequestProcessTaskEvent::setCommunicator(CTaskSchedulerCommunicator* communicator) { mCommunicator = communicator; return this; } }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CSendTaskCompleteEvent.h0000644000175000017500000000402712520551270026131 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_EVENTS_CSENDTASKCOMPLETEEVENT_H #define KONCLUDE_SCHEDULER_EVENTS_CSENDTASKCOMPLETEEVENT_H // Libraries includes // Namespace includes #include "../SchedulerSettings.h" #include "../CTask.h" // Other includes #include "Concurrent/CEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Scheduler { namespace Events { /*! * \class CSendTaskCompleteEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CSendTaskCompleteEvent : public CEvent { // public methods public: //! Constructor CSendTaskCompleteEvent(CMemoryPool* memoryPool = nullptr); //! Destructor virtual ~CSendTaskCompleteEvent(); static const cint64 EVENTTYPEID = CSENDTASKCOMPLETEEVENTTYPEID; CSendTaskCompleteEvent* setTask(CTask* task); CTask* getTask(); // protected methods protected: // protected variables protected: CTask* mTask; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_EVENTS_CSENDTASKCOMPLETEEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CUpdateTaskStatusEvent.cpp0000644000175000017500000000317712520551272026537 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CUpdateTaskStatusEvent.h" namespace Konclude { namespace Scheduler { namespace Events { CUpdateTaskStatusEvent::CUpdateTaskStatusEvent(CMemoryPool* memoryPool) : CEvent(EVENTTYPEID,memoryPool) { mParentTask = nullptr; mUpdateTask = nullptr; } CUpdateTaskStatusEvent::~CUpdateTaskStatusEvent() { } CUpdateTaskStatusEvent* CUpdateTaskStatusEvent::setParentTask(CTask* task) { mParentTask = task; return this; } CTask* CUpdateTaskStatusEvent::getParentTask() { return mParentTask; } CUpdateTaskStatusEvent* CUpdateTaskStatusEvent::setUpdateTask(CTask* task) { mUpdateTask = task; return this; } CTask* CUpdateTaskStatusEvent::getUpdateTask() { return mUpdateTask; } }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CResponseScheduleTaskEvent.cpp0000644000175000017500000000443712520551270027362 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CResponseScheduleTaskEvent.h" namespace Konclude { namespace Scheduler { namespace Events { CResponseScheduleTaskEvent::CResponseScheduleTaskEvent(CMemoryPool* memoryPool) : CEvent(EVENTTYPEID,memoryPool) { mTask = nullptr; mScheduleItem = nullptr; mCommunicator = nullptr; mSchedulingTask = false; } CResponseScheduleTaskEvent::~CResponseScheduleTaskEvent() { } CResponseScheduleTaskEvent* CResponseScheduleTaskEvent::setTask(CTask* task) { mTask = task; return this; } CTask* CResponseScheduleTaskEvent::getTask() { return mTask; } CTaskScheduleItem* CResponseScheduleTaskEvent::getTaskScheduleItem() { return mScheduleItem; } CResponseScheduleTaskEvent* CResponseScheduleTaskEvent::setTaskScheduleItem(CTaskScheduleItem* taskScheduleItem) { mScheduleItem = taskScheduleItem; return this; } CTaskSchedulerCommunicator* CResponseScheduleTaskEvent::getCommunicator() { return mCommunicator; } CResponseScheduleTaskEvent* CResponseScheduleTaskEvent::setCommunicator(CTaskSchedulerCommunicator* communicator) { mCommunicator = communicator; return this; } CResponseScheduleTaskEvent* CResponseScheduleTaskEvent::setSchedulingTask(bool schedulable) { mSchedulingTask = schedulable; return this; } bool CResponseScheduleTaskEvent::isSchedulingTask() { return mSchedulingTask; } }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CCriticalScheduleTaskEvent.cpp0000644000175000017500000000277212520551270027316 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCriticalScheduleTaskEvent.h" namespace Konclude { namespace Scheduler { namespace Events { CCriticalScheduleTaskEvent::CCriticalScheduleTaskEvent(CMemoryPool* memoryPool) : CEvent(EVENTTYPEID,memoryPool) { mCommunicator = nullptr; } CCriticalScheduleTaskEvent::~CCriticalScheduleTaskEvent() { } CTaskSchedulerCommunicator* CCriticalScheduleTaskEvent::getCommunicator() { return mCommunicator; } CCriticalScheduleTaskEvent* CCriticalScheduleTaskEvent::setCommunicator(CTaskSchedulerCommunicator* communicator) { mCommunicator = communicator; return this; } }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CTaskAdditionalAllocationEvent.h0000644000175000017500000000443612520551272027633 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_EVENTS_CTASKADDITIONALALLOCATIONEVENT_H #define KONCLUDE_SCHEDULER_EVENTS_CTASKADDITIONALALLOCATIONEVENT_H // Libraries includes // Namespace includes #include "../SchedulerSettings.h" #include "../CTask.h" // Other includes #include "Concurrent/CEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Scheduler { namespace Events { /*! * \class CTaskAdditionalAllocationEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CTaskAdditionalAllocationEvent : public CEvent { // public methods public: //! Constructor CTaskAdditionalAllocationEvent(CMemoryPool* memoryPool = nullptr); //! Destructor virtual ~CTaskAdditionalAllocationEvent(); static const cint64 EVENTTYPEID = CTASKADDITIONALALLOCATIONEVENTTYPEID; CTaskAdditionalAllocationEvent* setTask(CTask* task); CTask* getTask(); CMemoryPool* getAdditionalAllocatedMemoryPools(); CTaskAdditionalAllocationEvent* setAdditionalAllocatedMemoryPools(CMemoryPool* addMemoryPools); // protected methods protected: // protected variables protected: CMemoryPool* mAddMemoryPools; CTask* mTask; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_EVENTS_CTASKADDITIONALALLOCATIONEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CResponseScheduleTaskEvent.h0000644000175000017500000000512412520551270027021 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_EVENTS_CRESPONSESCHEDULETASKEVENT_H #define KONCLUDE_SCHEDULER_EVENTS_CRESPONSESCHEDULETASKEVENT_H // Libraries includes // Namespace includes #include "../SchedulerSettings.h" #include "../CTaskScheduleItem.h" #include "../CTask.h" // Other includes #include "Concurrent/CEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Scheduler { namespace Events { /*! * \class CResponseScheduleTaskEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CResponseScheduleTaskEvent : public CEvent { // public methods public: //! Constructor CResponseScheduleTaskEvent(CMemoryPool* memoryPool = nullptr); //! Destructor virtual ~CResponseScheduleTaskEvent(); static const cint64 EVENTTYPEID = CRESPONSESCHEDULETASKEVENTTYPEID; CResponseScheduleTaskEvent* setTask(CTask* task); CTask* getTask(); CTaskScheduleItem* getTaskScheduleItem(); CResponseScheduleTaskEvent* setTaskScheduleItem(CTaskScheduleItem* taskScheduleItem); CTaskSchedulerCommunicator* getCommunicator(); CResponseScheduleTaskEvent* setCommunicator(CTaskSchedulerCommunicator* communicator); CResponseScheduleTaskEvent* setSchedulingTask(bool schedulable); bool isSchedulingTask(); // protected methods protected: // protected variables protected: CTask* mTask; CTaskScheduleItem* mScheduleItem; CTaskSchedulerCommunicator* mCommunicator; bool mSchedulingTask; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_EVENTS_CRESPONSESCHEDULETASKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CSendTaskProcessEvent.h0000644000175000017500000000421012520551270025771 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_EVENTS_CSENDTASKPROCESSEVENT_H #define KONCLUDE_SCHEDULER_EVENTS_CSENDTASKPROCESSEVENT_H // Libraries includes // Namespace includes #include "../SchedulerSettings.h" #include "../CTask.h" // Other includes #include "Concurrent/CEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Scheduler { namespace Events { /*! * \class CSendTaskProcessEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CSendTaskProcessEvent : public CEvent { // public methods public: //! Constructor CSendTaskProcessEvent(CMemoryPool* memoryPool = nullptr); //! Destructor virtual ~CSendTaskProcessEvent(); static const cint64 EVENTTYPEID = CSENDTASKPROCESSEVENTTYPEID; CSendTaskProcessEvent* setTask(CTask* task); CTask* getTask(); CSendTaskProcessEvent* setSchedulingTask(bool schedulable); bool isSchedulingTask(); // protected methods protected: // protected variables protected: CTask* mTask; bool mSchedulingTask; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_EVENTS_CSENDTASKPROCESSEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CCriticalScheduleTaskEvent.h0000644000175000017500000000420312520551270026752 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_EVENTS_CCRITICALSCHEDULETASKEVENT_H #define KONCLUDE_SCHEDULER_EVENTS_CCRITICALSCHEDULETASKEVENT_H // Libraries includes // Namespace includes #include "../SchedulerSettings.h" // Other includes #include "Concurrent/CEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Scheduler { namespace Events { /*! * \class CCriticalScheduleTaskEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CCriticalScheduleTaskEvent : public CEvent { // public methods public: //! Constructor CCriticalScheduleTaskEvent(CMemoryPool* memoryPool = nullptr); //! Destructor virtual ~CCriticalScheduleTaskEvent(); static const cint64 EVENTTYPEID = CCRITICALSCHEDULETASKEVENTTYPEID; CTaskSchedulerCommunicator* getCommunicator(); CCriticalScheduleTaskEvent* setCommunicator(CTaskSchedulerCommunicator* communicator); // protected methods protected: // protected variables protected: CTaskSchedulerCommunicator* mCommunicator; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_EVENTS_CCRITICALSCHEDULETASKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CDistributeMemoryPoolEvent.cpp0000644000175000017500000000273012520551270027417 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDistributeMemoryPoolEvent.h" namespace Konclude { namespace Scheduler { namespace Events { CDistributeMemoryPoolEvent::CDistributeMemoryPoolEvent(CMemoryPool* memoryPool) : CEvent(EVENTTYPEID,memoryPool) { mMemoryPools = nullptr; } CDistributeMemoryPoolEvent::~CDistributeMemoryPoolEvent() { } CMemoryPool* CDistributeMemoryPoolEvent::getMemoryPools() { return mMemoryPools; } CDistributeMemoryPoolEvent* CDistributeMemoryPoolEvent::setMemoryPools(CMemoryPool* memoryPools) { mMemoryPools = memoryPools; return this; } }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/Events/CSendTaskCompleteEvent.cpp0000644000175000017500000000256412520551270026470 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSendTaskCompleteEvent.h" namespace Konclude { namespace Scheduler { namespace Events { CSendTaskCompleteEvent::CSendTaskCompleteEvent(CMemoryPool* memoryPool) : CEvent(EVENTTYPEID,memoryPool) { mTask = nullptr; } CSendTaskCompleteEvent::~CSendTaskCompleteEvent() { } CSendTaskCompleteEvent* CSendTaskCompleteEvent::setTask(CTask* task) { mTask = task; return this; } CTask* CSendTaskCompleteEvent::getTask() { return mTask; } }; // end namespace Events }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CBooleanTaskResult.h0000644000175000017500000000376512520551272024071 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CBOOLEANTASKRESULT_H #define KONCLUDE_SCHEDULER_CBOOLEANTASKRESULT_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CBooleanTaskResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBooleanTaskResult : public CTaskResult { // public methods public: //! Constructor CBooleanTaskResult(); //! Destructor virtual ~CBooleanTaskResult(); virtual bool hasResult(); bool getResultValue(); bool hasResultValue(bool testValue = true); CBooleanTaskResult* setResultValue(bool resultValue); CBooleanTaskResult* setValidResult(bool validResult); CBooleanTaskResult* installResult(bool resultValue); // protected methods protected: // protected variables protected: bool mValidResult; bool mResultValue; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CBOOLEANTASKRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CSingleThreadTaskProcessorUnit.cpp0000644000175000017500000005016612520551274026756 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSingleThreadTaskProcessorUnit.h" namespace Konclude { namespace Scheduler { CSingleThreadTaskProcessorUnit::CSingleThreadTaskProcessorUnit(CTaskHandleAlgorithm* taskHandleAlgo, CConsiderateMemoryPoolProvider* memoryPoolProvider) : CThread("TaskProcessingUnitThread") { mTaskProcessingQueue = nullptr; mTaskCompletionQueue = nullptr; mTaskStatusPropagator = nullptr; mCallbackExecuter = nullptr; mMemoryPoolProvider = memoryPoolProvider; if (!mMemoryPoolProvider) { mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); } mMemoryAllocator = new CTaskHandleLimitedReserveMemoryPoolAllocationManager(mMemoryPoolProvider,600,60); mTaskProcessorContext = new CTaskProcessorContextBase(this,mMemoryAllocator); mTaskHandleAlgo = taskHandleAlgo; mProcessingBlocked = true; mEventHandler = new CQueuedLinkedEventHandler(this,this); CXLinker* eventHandlerLinker = new CXLinker(mEventHandler,nullptr); mEventHandlerLinker = eventHandlerLinker; mProcessingStopped = false; mStatComputionTime = 0; mStatBlockingTime = 0; mLastProcessingStartedTag = 0; mLastProcessingStartRequestTag = 0; mTaskProcessingCount = 0; mTaskSchedulingCount = 0; mStatRecievedScheduleTasks = 0; mStatRemovedTasks = 0; mEventSignalized = false; mThreadBlocked = false; mDebugLastProcessedTask = nullptr; mDebugLastCompletedTask = nullptr; mTaskSchedulingQueue = nullptr; } CSingleThreadTaskProcessorUnit::~CSingleThreadTaskProcessorUnit() { } cint64 CSingleThreadTaskProcessorUnit::countProcessingTasksMemoryPools() { cint64 memoryPoolCount = 0; CTask* taskProcessingQueueIt = mTaskProcessingQueue; while (taskProcessingQueueIt) { CMemoryPool* memoryPoolIt = taskProcessingQueueIt->getMemoryPools(); memoryPoolCount += memoryPoolIt->getCount(); taskProcessingQueueIt = taskProcessingQueueIt->getNext(); } return memoryPoolCount; } cint64 CSingleThreadTaskProcessorUnit::countProcessedOpenTasksMemoryPools() { cint64 memoryPoolCount = 0; QSet taskSet; QList taskList; CTask* taskProcessingQueueIt = mTaskProcessingQueue; while (taskProcessingQueueIt) { if (taskProcessingQueueIt->getParentTask()) { if (!taskSet.contains(taskProcessingQueueIt->getParentTask())) { taskSet.insert(taskProcessingQueueIt->getParentTask()); taskList.append(taskProcessingQueueIt->getParentTask()); } } taskProcessingQueueIt = taskProcessingQueueIt->getNext(); } while (!taskList.isEmpty()) { CTask* task = taskList.takeFirst(); if (task->getParentTask()) { if (!taskSet.contains(task->getParentTask())) { taskSet.insert(task->getParentTask()); taskList.append(task->getParentTask()); } } CMemoryPool* memoryPoolIt = task->getMemoryPools(); memoryPoolCount += memoryPoolIt->getCount(); } return memoryPoolCount; } cint64 CSingleThreadTaskProcessorUnit::closeOpenTasksMemoryPools() { cint64 closedMemoryPoolCount = 0; QSet taskSet; QList taskList; CTask* taskProcessingQueueIt = mTaskProcessingQueue; while (taskProcessingQueueIt) { if (!taskSet.contains(taskProcessingQueueIt)) { taskSet.insert(taskProcessingQueueIt); taskList.append(taskProcessingQueueIt); } taskProcessingQueueIt = taskProcessingQueueIt->getNext(); } while (!taskList.isEmpty()) { CTask* task = taskList.takeFirst(); CBooleanTaskResult* satResult = (CBooleanTaskResult*)task->getTaskResult(); if (satResult) { satResult->installResult(false); } CCallbackData* callbackLinkerIt = task->getCallbackLinker(); while (callbackLinkerIt) { CCallbackData* callback = callbackLinkerIt; callbackLinkerIt = callbackLinkerIt->getNext(); if (mCallbackExecuter) { mCallbackExecuter->executeCallback(task,callback); INCTASKPROCESSINGSTAT(mStats.incStatisticCallbacksExecutedCount(1)); } else { callback->doCallback(); } } if (task->getParentTask()) { if (!taskSet.contains(task->getParentTask())) { taskSet.insert(task->getParentTask()); taskList.append(task->getParentTask()); } } CMemoryPool* memoryPoolIt = task->getMemoryPools(); closedMemoryPoolCount += memoryPoolIt->getCount(); mMemoryAllocator->releaseMemoryPoolContainer(task); } mTaskProcessingQueue = 0; mTaskCompletionQueue = 0; return closedMemoryPoolCount; } CTaskHandleAlgorithm* CSingleThreadTaskProcessorUnit::getTaskHandleAlgorithm() { return mTaskHandleAlgo; } CSingleThreadTaskProcessorUnit* CSingleThreadTaskProcessorUnit::installCallbackExecuter(CTaskCallbackExecuter* callbackExecuter) { mCallbackExecuter = callbackExecuter; return this; } CSingleThreadTaskProcessorUnit* CSingleThreadTaskProcessorUnit::installStatusPropagator(CTaskStatusPropagator* statusPropagator) { mTaskStatusPropagator = statusPropagator; return this; } cint64 CSingleThreadTaskProcessorUnit::getTaskProcessingCount() { return mTaskProcessingCount + mTaskSchedulingCount; } bool CSingleThreadTaskProcessorUnit::canDispenseProcessingTasks() { return false; } bool CSingleThreadTaskProcessorUnit::requiresProcessingTasks() { return false; } bool CSingleThreadTaskProcessorUnit::requiresSchedulingTasks() { return false; } cint64 CSingleThreadTaskProcessorUnit::countDispensableProcessingTasks() { return 0; } cint64 CSingleThreadTaskProcessorUnit::getRecievedTasks() { return 0; } cint64 CSingleThreadTaskProcessorUnit::countScheduleableProcessingTasks() { return 0; } bool CSingleThreadTaskProcessorUnit::requiresTaskDispenseNotification(cint64 &updateDispenseNotificationTag) { return false; } CTaskProcessingStatistics* CSingleThreadTaskProcessorUnit::getTaskProcessingStatistics() { return &mStats; } cint64 CSingleThreadTaskProcessorUnit::getStatisticBlockingTime() { cint64 blockTime = mStatBlockingTime; #ifdef KONCLUDE_SCHEDULER_TASK_THREADS_TIME_STATISTICS if (mThreadBlocked) { blockTime += mBlockingTimer.elapsed(); } #endif return blockTime; } cint64 CSingleThreadTaskProcessorUnit::getStatisticComputionTime() { cint64 compTime = mStatComputionTime; #ifdef KONCLUDE_SCHEDULER_TASK_THREADS_TIME_STATISTICS if (!mThreadBlocked) { compTime += mComputionTimer.elapsed(); } #endif return compTime; } CEventHandler* CSingleThreadTaskProcessorUnit::getEventHandler() { return mEventHandler; } CTaskEventHandlerBasedProcessor* CSingleThreadTaskProcessorUnit::installScheduler(CTaskEventHandlerBasedScheduler* scheduler) { return this; } CTaskSchedulerCommunicator* CSingleThreadTaskProcessorUnit::createSchedulerProcessorCommunication(CTaskEventHandlerBasedProcessor* taskProcessor) { return nullptr; } CTaskReserveQueueConsumer* CSingleThreadTaskProcessorUnit::createTaskReserveQueueConsumer(CTaskEventHandlerBasedProcessor* taskProcessor) { return nullptr; } CSingleThreadTaskProcessorUnit* CSingleThreadTaskProcessorUnit::startProcessing() { if (!isRunning()) { startThread(); postEvent(new Concurrent::Events::CHandleEventsEvent()); } return this; } CSingleThreadTaskProcessorUnit* CSingleThreadTaskProcessorUnit::stopProcessing() { mProcessingStopped = true; return this; } CThreadActivator* CSingleThreadTaskProcessorUnit::signalizeEvent() { mEventSignalized = true; if (mProcessingBlocked) { // reactivate processing if (mLastProcessingStartedTag == mLastProcessingStartRequestTag) { ++mLastProcessingStartRequestTag; mProcessingWakeUpSemaphore.release(); } } return this; } bool CSingleThreadTaskProcessorUnit::processControlEvents(QEvent::Type type, CControlEvent *event) { if (CThread::processControlEvents(type,event)) { return true; } else { if (type == Concurrent::Events::CHandleEventsEvent::EVENTTYPE) { #ifdef KONCLUDE_SCHEDULER_TASK_THREADS_TIME_STATISTICS mComputionTimer.start(); #endif processingLoop(); return true; } } return false; } bool CSingleThreadTaskProcessorUnit::processingLoop() { bool eventSafeguardProcessed = false; while (!mProcessingStopped) { if (!mTaskProcessingQueue && mProcessingBlocked) { // block until new events or task are available #ifdef KONCLUDE_SCHEDULER_TASK_THREADS_TIME_STATISTICS mStatComputionTime += mComputionTimer.elapsed(); mBlockingTimer.start(); #endif INCTASKPROCESSINGSTAT(mStats.incStatisticThreadsBlockedCount(1)); mThreadBlocked = true; mProcessingWakeUpSemaphore.acquire(1); mThreadBlocked = false; #ifdef KONCLUDE_SCHEDULER_TASK_THREADS_TIME_STATISTICS mStatBlockingTime += mBlockingTimer.elapsed(); mComputionTimer.start(); #endif mLastProcessingStartedTag = mLastProcessingStartRequestTag; } mProcessingBlocked = false; eventSafeguardProcessed = false; while (mEventSignalized) { bool eventsProcessed = handleEvents(); } if (mTaskProcessingQueue) { CTask* processingTask = mTaskProcessingQueue; mTaskProcessingQueue = mTaskProcessingQueue->getNext(); cint64 taskDepth = processingTask->getTaskDepth(); //cint64 memoryPoolCount1 = countProcessingTasksMemoryPools(); //cint64 memoryPoolCount2 = countProcessedOpenTasksMemoryPools(); bool continueProcessing = processTask(processingTask); if (continueProcessing) { processingTask->getTaskStatus()->setTaskQUEUEDState(); if (mTaskProcessingQueue) { mTaskProcessingQueue = mTaskProcessingQueue->insertNextSorted(processingTask); } else { mTaskProcessingQueue = processingTask; } } else { INCTASKPROCESSINGSTAT(mStats.incStatisticTasksProcessedDepthCount(taskDepth,1)); INCTASKPROCESSINGSTAT(mStats.incStatisticTasksProcessedCount(1)); --mTaskProcessingCount; ++mStatRemovedTasks; } //if (mStatRemovedTasks > 100000) { // closeOpenTasksMemoryPools(); //} } if (!mTaskProcessingQueue && mTaskSchedulingQueue) { CTask* nextTask = mTaskSchedulingQueue; mTaskSchedulingQueue = mTaskSchedulingQueue->getNext(); nextTask->clearNext(); --mTaskSchedulingCount; addProcessingTask(nextTask); } if (!mTaskProcessingQueue) { while (mEventSignalized || !eventSafeguardProcessed) { bool eventsProcessed = handleEvents(); if (eventsProcessed) { eventSafeguardProcessed = false; mProcessingBlocked = false; } else if (!mProcessingBlocked) { mProcessingBlocked = true; } else if (!eventSafeguardProcessed) { eventSafeguardProcessed = true; } } } } return true; } bool CSingleThreadTaskProcessorUnit::processEvent(CEvent *event, CContext* handlerContext) { cint64 eventID = event->getEventTypeID(); if (eventID == CSendTaskProcessEvent::EVENTTYPEID) { CTask* task = ((CSendTaskProcessEvent*)event)->getTask(); addProcessingTask(task); mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else if (eventID == CSendTaskScheduleEvent::EVENTTYPEID) { ++mStatRecievedScheduleTasks; CTask* task = ((CSendTaskScheduleEvent*)event)->getTask(); if (!mTaskProcessingQueue) { addProcessingTask(task); } else { ++mTaskSchedulingCount; if (mTaskSchedulingQueue) { mTaskSchedulingQueue = mTaskSchedulingQueue->append(task); } else { mTaskSchedulingQueue = task; } } mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else if (eventID == CRequestProcessTaskEvent::EVENTTYPEID) { // not supported mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else if (eventID == CResponseScheduleTaskEvent::EVENTTYPEID) { // not supported mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else if (eventID == CSendTaskCompleteEvent::EVENTTYPEID) { CTask* task = ((CSendTaskCompleteEvent*)event)->getTask(); completeTask(task); mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else if (eventID == CTaskAdditionalAllocationEvent::EVENTTYPEID) { CTaskAdditionalAllocationEvent* taskAddAllocEvent = (CTaskAdditionalAllocationEvent*)event; CTask* task = taskAddAllocEvent->getTask(); CMemoryPool* addMemoryPools = taskAddAllocEvent->getAdditionalAllocatedMemoryPools(); task->appendMemoryPool(addMemoryPools); mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else if (eventID == CRequestScheduleTaskEvent::EVENTTYPEID) { // this unit is also the scheduler mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else { mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } return false; } CTaskProcessorCommunicator* CSingleThreadTaskProcessorUnit::communicateTaskComplete(CTask* task) { task->getTaskStatus()->setTaskFINISHEDState(); completeTask(task); return this; } CTaskProcessorCommunicator* CSingleThreadTaskProcessorUnit::communicateTaskError(CTask* task) { task->getTaskStatus()->setTaskFINISHEDState(); completeTask(task); return this; } bool CSingleThreadTaskProcessorUnit::addProcessingTask(CTask* task) { CTask* newTask = task; CTask* newTaskIt = newTask; cint64 taskCount = 0; while (newTaskIt) { newTaskIt->getTaskStatus()->setTaskQUEUEDState(); newTaskIt = newTaskIt->getNext(); INCTASKPROCESSINGSTAT(mStats.incStatisticTasksAddedCount(1)); ++taskCount; } mTaskProcessingCount += taskCount; if (!mTaskProcessingQueue) { mTaskProcessingQueue = newTask; newTask = newTask->getNext(); mTaskProcessingQueue->clearNext(); } if (newTask) { mTaskProcessingQueue = mTaskProcessingQueue->insertNextSorted(newTask); } return task != nullptr; } CTaskProcessorCommunicator* CSingleThreadTaskProcessorUnit::communicateTaskCreation(CTask* newTask) { INCTASKPROCESSINGSTAT(mStats.incStatisticTasksCreatedCount(newTask->getCount())); INCTASKPROCESSINGSTAT(mStats.incStatisticTasksCreatedDepthCount(newTask->getTaskDepth(),newTask->getCount())); addProcessingTask(newTask); return this; } CTaskProcessorCommunicator* CSingleThreadTaskProcessorUnit::communicateTaskAdditionalAllocation(CTask* task, CMemoryPool* additionalAllocatedMemoryPool) { task->appendMemoryPool(additionalAllocatedMemoryPool); return this; } bool CSingleThreadTaskProcessorUnit::verifyContinueTaskProcessing(CTask* task) { if (mEventSignalized) { return false; } if (!task->getTaskStatus()->isProcessable()) { return false; } if (mTaskProcessingQueue && mTaskProcessingQueue->getTaskPriority() > task->getTaskPriority()) { return false; } return true; } bool CSingleThreadTaskProcessorUnit::handleEvents() { bool handleNextRound = true; bool roundEventProcessed = false; bool eventProcessed = false; while (handleNextRound && !mProcessingStopped) { roundEventProcessed = false; CXLinker* eventHandlerLinkerIt = mEventHandlerLinker; if (eventHandlerLinkerIt) { CEventHandler* eventHandler = eventHandlerLinkerIt->getData(); if (eventHandler->needEventProcessing()) { cint64 handledEventCount = eventHandler->handleEvents(mTaskProcessorContext); INCTASKPROCESSINGSTAT(mStats.incStatisticEventsProcessedCount(handledEventCount)); roundEventProcessed = handledEventCount > 0; } // round robin eventHandlerLinkerIt = eventHandlerLinkerIt->getNext(); if (!eventHandlerLinkerIt) { if (mEventSignalized || roundEventProcessed) { handleNextRound = true; mEventSignalized = false; } else { handleNextRound = false; } eventHandlerLinkerIt = mEventHandlerLinker; } eventProcessed |= roundEventProcessed; } else { handleNextRound = false; } } return eventProcessed; } cint64 CSingleThreadTaskProcessorUnit::completeTask(CTask* task) { cint64 completedCount = 0; mTaskCompletionQueue = task->getLastListLink()->setNext(mTaskCompletionQueue); while (mTaskCompletionQueue) { CTask* completionTask = mTaskCompletionQueue; mTaskCompletionQueue = mTaskCompletionQueue->getNext(); if (completionTask && !completionTask->hasActiveReferencedTask()) { mDebugLastCompletedTask = completionTask; CTask* parentTask = completionTask->getParentTask(); bool upPropagation = false; if (mTaskStatusPropagator && mTaskStatusPropagator->completeTaskStatus(completionTask,upPropagation)) { if (parentTask && upPropagation) { updateTaskStatus(parentTask); } } completionTask->completeTask(); completionTask->getTaskStatus()->setTaskCOMPLETEDState(); bool memoryReleaseable = completionTask->getTaskStatus()->isMemoryReleaseable(); if (parentTask) { parentTask->decActiveReferenceCount(); if (!parentTask->hasActiveReferencedTask()) { mTaskCompletionQueue = parentTask->setNext(mTaskCompletionQueue); } } if (completionTask) { // callbacks CCallbackData* callbackLinkerIt = completionTask->getCallbackLinker(); while (callbackLinkerIt) { CCallbackData* callback = callbackLinkerIt; callbackLinkerIt = callbackLinkerIt->getNext(); if (mCallbackExecuter) { mCallbackExecuter->executeCallback(completionTask,callback); INCTASKPROCESSINGSTAT(mStats.incStatisticCallbacksExecutedCount(1)); } else { callback->doCallback(); } } } if (memoryReleaseable) { mMemoryAllocator->releaseMemoryPoolContainer(completionTask); } completedCount++; } } INCTASKPROCESSINGSTAT(mStats.incStatisticTasksCompletedCount(completedCount)); return completedCount; } bool CSingleThreadTaskProcessorUnit::processTask(CTask* task) { mDebugLastProcessedTask = task; task->clearNext(); task->getTaskStatus()->setTaskPROCESSINGState(); return mTaskHandleAlgo->handleTask(mTaskProcessorContext,task); } CTaskProcessorCommunicator* CSingleThreadTaskProcessorUnit::communicateTaskRelevant(CTask* task) { // nothing to do for single processor unit return this; } CTaskProcessorCommunicator* CSingleThreadTaskProcessorUnit::communicateTaskStatusUpdate(CTask* task) { updateTaskStatus(task); return this; } bool CSingleThreadTaskProcessorUnit::updateTaskStatus(CTask* task) { CTask* updateTask = task; bool downProp = false; bool upProp = false; while (updateTask) { if (mTaskStatusPropagator && mTaskStatusPropagator->updateTaskStatus(updateTask,downProp,upProp)) { INCTASKPROCESSINGSTAT(mStats.incStatisticTasksUpdatedCount(1)); if (downProp) { CXNegLinker* refTaskIt = updateTask->getReferencedTaskLinker(); while (refTaskIt) { if (refTaskIt->isNegated()) { // task still exists, update task status // TODO: check better not recursive? CTask* refTask = refTaskIt->getData(); updateTaskStatus(refTask); } refTaskIt = refTaskIt->getNext(); } } if (upProp) { // all parent task are owned by the completer //CTask* parentTask = updateTask->getParentTask(); //if (parentTask) { // updateTaskStatus(parentTask); //} updateTask = updateTask->getParentTask(); } } else { updateTask = nullptr; } } return true; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveArrayQueueItem.cpp0000644000175000017500000000274212520551302026070 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskReserveArrayQueueItem.h" namespace Konclude { namespace Scheduler { CTaskReserveArrayQueueItem::CTaskReserveArrayQueueItem() : CLinkerBase(this) { } CTask* CTaskReserveArrayQueueItem::tryGetTask() { CTask* task = mTaskPointer.fetchAndStoreRelaxed(nullptr); return task; } bool CTaskReserveArrayQueueItem::trySetTask(CTask* task) { bool taskSet = false; taskSet = mTaskPointer.testAndSetRelaxed(nullptr,task); return taskSet; } bool CTaskReserveArrayQueueItem::setTask(CTask* task) { mTaskPointer = task; return true; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskCallbackExecuter.h0000644000175000017500000000336712520551274024514 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKCALLBACKEXECUTER_H #define KONCLUDE_SCHEDULER_CTASKCALLBACKEXECUTER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTask.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskCallbackExecuter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskCallbackExecuter { // public methods public: //! Constructor CTaskCallbackExecuter(); //! Destructor virtual ~CTaskCallbackExecuter(); virtual bool executeCallback(CTask* task, CCallbackData* callbackData) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKCALLBACKEXECUTER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessingStatistics.h0000644000175000017500000000763512520551300025472 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKPROCESSINGSTATISTICS_H #define KONCLUDE_SCHEDULER_CTASKPROCESSINGSTATISTICS_H // Libraries includes #include // Namespace includes #include "SchedulerSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { #ifdef KONCLUDE_SCHEDULER_TASK_PROCESSING_STATISTICS #define INCTASKPROCESSINGSTAT(a) a #else #define INCTASKPROCESSINGSTAT(a) #endif /*! * * \class CTaskProcessingStatistics * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskProcessingStatistics { // public methods public: //! Constructor CTaskProcessingStatistics(); //! Destructor virtual ~CTaskProcessingStatistics(); CTaskProcessingStatistics* clear(); CTaskProcessingStatistics* incStatisticTasksProcessedCount(cint64 incCount = 1); CTaskProcessingStatistics* incStatisticTasksAddedCount(cint64 incCount = 1); CTaskProcessingStatistics* incStatisticTasksCreatedCount(cint64 incCount = 1); CTaskProcessingStatistics* incStatisticTasksCompletedCount(cint64 incCount = 1); CTaskProcessingStatistics* incStatisticTasksUpdatedCount(cint64 incCount = 1); CTaskProcessingStatistics* incStatisticEventsProcessedCount(cint64 incCount = 1); CTaskProcessingStatistics* incStatisticTasksRequestedCount(cint64 incCount = 1); CTaskProcessingStatistics* incStatisticThreadsBlockedCount(cint64 incCount = 1); CTaskProcessingStatistics* incStatisticCallbacksExecutedCount(cint64 incCount = 1); cint64 getStatisticTasksProcessedCount(); cint64 getStatisticTasksAddedCount(); cint64 getStatisticTasksCreatedCount(); cint64 getStatisticTasksCompletedCount(); cint64 getStatisticTasksUpdatedCount(); cint64 getStatisticEventsProcessedCount(); cint64 getStatisticTasksRequestedCount(); cint64 getStatisticThreadsBlockedCount(); cint64 getStatisticCallbacksExecutedCount(); CTaskProcessingStatistics* incStatisticTasksCreatedDepthCount(cint64 taskDepth, cint64 incCount = 1); CTaskProcessingStatistics* incStatisticTasksProcessedDepthCount(cint64 taskDepth, cint64 incCount = 1); cint64 getStatisticTasksCreatedDepthCount(cint64 taskDepth); cint64 getStatisticTasksProcessedDepthCount(cint64 taskDepth); QVector* getStatisticTasksCreatedDepthCountVector(); QVector* getStatisticTasksProcessedDepthCountVector(); const static cint64 VECCOUNTERSIZE = 10000; // protected methods protected: // protected variables protected: cint64 mStatTasksProcessed; cint64 mStatTasksAdded; cint64 mStatTasksCreated; cint64 mStatTasksCompleted; cint64 mStatTasksUpdated; cint64 mStatEventsProcessed; cint64 mStatTasksRequested; cint64 mStatThreadBlocked; cint64 mStatCallbacksExecuted; QVector mTaskCreatedDepthCountVec; QVector mTaskProcessedDepthCountVec; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKPROCESSINGSTATISTICS_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessor.cpp0000644000175000017500000000200712520551300023601 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskProcessor.h" namespace Konclude { namespace Scheduler { CTaskProcessor::CTaskProcessor() { } CTaskProcessor::~CTaskProcessor() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTask.cpp0000644000175000017500000001716012520551274021721 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTask.h" namespace Konclude { namespace Scheduler { CTask::CTask(CMemoryPool* memoryPool) : CSortedLinkerBase(this,nullptr), CMemoryPoolContainer(memoryPool) { } CTask::~CTask() { } CTask* CTask::setTaskID(cint64 id) { mTaskID = id; return this; } cint64 CTask::getTaskID() const { return mTaskID; } CTask* CTask::setTaskDepth(cint64 taskDepth) { mTaskDepth = taskDepth; return this; } cint64 CTask::getTaskDepth() const { return mTaskDepth; } CTask* CTask::setTaskType(cint64 taskType) { mTaskType = taskType; return this; } cint64 CTask::getTaskType() const { return mTaskType; } double CTask::getTaskPriority() const { return mTaskPriority; } CTask* CTask::setTaskPriority(double taskPriority) { mTaskPriority = taskPriority; return this; } CTask* CTask::getParentTask() const { return mParentTask; } CTask* CTask::getRootTask() const { return mRootTask; } CTask* CTask::setParentTask(CTask* parentTask) { mParentTask = parentTask; return this; } CTask* CTask::setRootTask(CTask* rootTask) { mRootTask = rootTask; return this; } CTaskResult* CTask::getTaskResult() { return mTaskResult; } CTaskStatus* CTask::getTaskStatus() { return mTaskStatus; } CTaskContext* CTask::getTaskContext(CTaskHandleContext* context) { if (!mTaskContext) { void* memManAdd = CTaskMemoryPoolAllocationManager::allocateMemoryToContainer(sizeof(CTaskContextBase),this,context->getTaskHandleMemoryAllocationManager()); mTaskContext = new (memManAdd) CTaskContextBase(this,context); } else { mTaskContext->updateContext(context); } return mTaskContext; } CTask* CTask::decActiveReferenceCount(cint64 decCount) { mActiveTaskReferenceCount -= decCount; return this; } CTask* CTask::incActiveReferenceCount(cint64 incCount) { mActiveTaskReferenceCount += incCount; return this; } cint64 CTask::getActiveReferenceCount() const { return mActiveTaskReferenceCount; } bool CTask::hasActiveReferencedTask() const { return mActiveTaskReferenceCount > 0; } CTask* CTask::decDependedStatusUpdatesCount(cint64 decCount) { mDependedStatusUpdatesCount -= decCount; return this; } CTask* CTask::incDependedStatusUpdatesCount(cint64 incCount) { mDependedStatusUpdatesCount += incCount; return this; } cint64 CTask::getDependedStatusUpdatesCount() const { return mDependedStatusUpdatesCount; } bool CTask::hasDependedStatusUpdates() const { return mDependedStatusUpdatesCount > 0; } bool CTask::hasDependedStatusUpdatesOrActiveReferencedTasks() const { return hasDependedStatusUpdates() || hasActiveReferencedTask(); } CTask* CTask::makeTaskReference(CTask* dependedTask, CTaskHandleContext* handlerContext) { dependedTask->setParentTask(this); dependedTask->setRootTask(mRootTask); dependedTask->setTaskDepth(mTaskDepth+1); mActiveTaskReferenceCount++; CTaskContext* taskContext = getTaskContext(handlerContext); CXNegLinker* childNegLinker = CObjectAllocator >::allocateAndConstruct(taskContext->getMemoryAllocationManager()); mReferencedTaskLinker = childNegLinker->initNegLinker(dependedTask,true,mReferencedTaskLinker); dependedTask->setCompletionNegatorConnector(childNegLinker); return this; } CTask* CTask::initTask(CTask* parentTask, CTaskHandleContext* handlerContext) { initLinker(this,nullptr); mTaskStatus = nullptr; mTaskResult = nullptr; mRootTask = this; mParentTask = nullptr; mTaskContext = nullptr; mCompletionNegator = nullptr; mReferencedTaskLinker = nullptr; mCallbackLinker = nullptr; mTaskOwner = nullptr; mTaskID = 0; mTaskPriority = 0.; mActiveTaskReferenceCount = 0; mDependedStatusUpdatesCount = 0; mTaskDepth = 0; mCompletionRequested = false; mTaskRelevant = false; mTaskDispensMarked = false; mTaskType = 0; mTaskStatus = createTaskStatus(handlerContext); mTaskResult = createTaskResult(handlerContext); if (parentTask) { parentTask->makeTaskReference(this,handlerContext); mRootTask = parentTask->getRootTask(); } return this; } CXNegLinker* CTask::getReferencedTaskLinker() { return mReferencedTaskLinker; } CTask* CTask::setReferencedTaskLinker(CXNegLinker* referencedTaskLinker) { mReferencedTaskLinker = referencedTaskLinker; return this; } CTask* CTask::appendReferencedTaskLinker(CXNegLinker* referencedTaskLinker) { mReferencedTaskLinker = referencedTaskLinker->getLastListLink()->setNext(mReferencedTaskLinker); return this; } CTask* CTask::setCompletionNegatorConnector(CNegator* negator) { mCompletionNegator = negator; return this; } CTask* CTask::completeTask() { if (mCompletionNegator) { mCompletionNegator->setNegation(false); } return this; } CCallbackData* CTask::getCallbackLinker() { return mCallbackLinker; } CTask* CTask::setCallbackLinker(CCallbackData* callback) { mCallbackLinker = callback; return this; } CTask* CTask::addCallbackLinker(CCallbackData* callback) { mCallbackLinker = callback->getLastListLink()->setNext(mCallbackLinker); return this; } CTaskOwner* CTask::getTaskOwner() { return mTaskOwner; } CTask* CTask::setTaskOwner(CTaskOwner* taskOwner) { mTaskOwner = taskOwner; return this; } CTask* CTask::clearTaskOwner() { mTaskOwner = nullptr; return this; } bool CTask::hasTaskOwner(CTaskOwner* taskOwner) { return mTaskOwner == taskOwner; } bool CTask::hasTaskOwner() { return mTaskOwner; } bool CTask::hasNoTaskOwnerAndNoParentTask() { return mTaskOwner == nullptr && mParentTask == nullptr; } CTask* CTask::setCompletionRequested(bool requested) { mCompletionRequested = requested; return this; } bool CTask::getCompletionRequested() { return mCompletionRequested; } bool CTask::isCompletionRequested() { return mCompletionRequested; } bool CTask::isTaskRelevant() { return mTaskRelevant; } CTask* CTask::setTaskRelevant(bool relevant) { mTaskRelevant = relevant; return this; } bool CTask::isTaskDispenseMarked() { return mTaskDispensMarked; } CTask* CTask::setTaskDispenseMarked(bool dispenseable) { mTaskDispensMarked = dispenseable; return this; } bool CTask::clearUninitializedReferenceTasks() { bool clearedRefTasks = false; CXNegLinker* refTaskIt = mReferencedTaskLinker; while (refTaskIt) { if (refTaskIt->isNegated() && refTaskIt->getData()->getTaskStatus()->isTaskStateUNINITIALIZED()) { refTaskIt->setNegation(false); --mActiveTaskReferenceCount; clearedRefTasks = true; } refTaskIt = refTaskIt->getNext(); } return clearedRefTasks; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CDirectDistributionMemoryPoolReleaser.h0000644000175000017500000000422712520551272030002 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CDirectDistributionMemoryPoolReleaser_H #define KONCLUDE_SCHEDULER_CDirectDistributionMemoryPoolReleaser_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CDistributionMemoryPoolReleaser.h" #include "CConcreteMemoryPoolDistributor.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Scheduler { /*! * * \class CDirectDistributionMemoryPoolReleaser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDirectDistributionMemoryPoolReleaser : public CDistributionMemoryPoolReleaser { // public methods public: //! Constructor CDirectDistributionMemoryPoolReleaser(CConcreteMemoryPoolDistributor* memoryDistributor); //! Destructor virtual ~CDirectDistributionMemoryPoolReleaser(); virtual CDirectDistributionMemoryPoolReleaser* distributeMemoryPools(CMemoryPool* memoryPools); // protected methods protected: // protected variables protected: CConcreteMemoryPoolDistributor* mMemoryDistributor; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CDirectDistributionMemoryPoolReleaser_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CBooleanTaskResult.cpp0000644000175000017500000000334012520551272024411 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBooleanTaskResult.h" namespace Konclude { namespace Scheduler { CBooleanTaskResult::CBooleanTaskResult() { mValidResult = false; mResultValue = false; } CBooleanTaskResult::~CBooleanTaskResult() { } bool CBooleanTaskResult::hasResult() { return mValidResult; } bool CBooleanTaskResult::getResultValue() { return mResultValue; } bool CBooleanTaskResult::hasResultValue(bool testValue) { return mResultValue == testValue; } CBooleanTaskResult* CBooleanTaskResult::setResultValue(bool resultValue) { mResultValue = resultValue; return this; } CBooleanTaskResult* CBooleanTaskResult::setValidResult(bool validResult) { mValidResult = validResult; return this; } CBooleanTaskResult* CBooleanTaskResult::installResult(bool resultValue) { mResultValue = resultValue; mValidResult = true; return this; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskScheduleItem.h0000644000175000017500000000316612520551304023655 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKSCHEDULEITEM_H #define KONCLUDE_SCHEDULER_CTASKSCHEDULEITEM_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskScheduleItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskScheduleItem { // public methods public: //! Constructor CTaskScheduleItem(); //! Destructor virtual ~CTaskScheduleItem(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKSCHEDULEITEM_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CDistributionMemoryPoolProvider.h0000644000175000017500000000734412520551274026704 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CDISTRIBUTIONMEMORYPOOLPROVIDER_H #define KONCLUDE_SCHEDULER_CDISTRIBUTIONMEMORYPOOLPROVIDER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CDistributionMemoryPoolReleaser.h" // Other includes #include "Utilities/Memory/CMemoryPoolProvider.h" #include "Utilities/Container/CSortedLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Memory; using namespace Utilities::Container; namespace Scheduler { /*! * * \class CDistributionMemoryPoolProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDistributionMemoryPoolProvider : public CSortedLinkerBase, public CMemoryPoolProvider { // public methods public: //! Constructor CDistributionMemoryPoolProvider(CMemoryPoolProvider* alternateMemoryPoolProvider, CDistributionMemoryPoolReleaser* distributionMemoryReleaser); //! Destructor virtual ~CDistributionMemoryPoolProvider(); virtual CMemoryPool* acquireMemoryPool(cint64 minPoolSize); virtual CDistributionMemoryPoolProvider* releaseMemoryPool(CMemoryPool* memoryPool); virtual CDistributionMemoryPoolProvider* appendDistributedMemoryPools(CMemoryPool* memoryPools); virtual bool checkAppendableDistributedMemoryPools(CMemoryPool* memoryPools); virtual double getMissingMemoryPoolRatio(); virtual cint64 getMissingMemoryPoolCount(); virtual cint64 getMemoryPoolSupplyCount(); virtual CDistributionMemoryPoolProvider* updateMissingMemoryPoolRatio(); virtual CDistributionMemoryPoolProvider* updatedRoundAcquiredMemoryPoolCounts(); static inline bool sortedLinkerDataCompare(CDistributionMemoryPoolProvider* const & beforeData1, CDistributionMemoryPoolProvider* const & data2) { return beforeData1->getMissingMemoryPoolRatio() < data2->getMissingMemoryPoolRatio(); } cint64 getAllocatedReleaseDifferencePoolCount(); cint64 getAllocatedReleaseDifferencePoolSize(); // protected methods protected: bool pickDistributedMemoryPools(); // protected variables protected: CMemoryPoolProvider* mAlternateMemoryPoolProvider; CDistributionMemoryPoolReleaser* mDistributionMemoryReleaser; CMemoryPool* mAvailablePoolLinker; CMemoryPool* mDistributedPoolLinker; CMemoryPool* mLastPickedDistributedPoolLinker; cint64 mDistributedPoolCount; cint64 mPickedPoolCount; cint64 mAvailablePoolCount; cint64 mAquiredPoolCount; cint64 mLastAcquiredPoolCount; cint64 mLastAcquiredPoolDiff; double mLastSavedMissRatio; double mLastNewDiffRatio; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CDISTRIBUTIONMEMORYPOOLPROVIDER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CConcreteTaskSchedulerCommunicator.h0000644000175000017500000000463512520551272027272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CCONCRETETASKSCHEDULERCOMMUNICATOR_H #define KONCLUDE_SCHEDULER_CCONCRETETASKSCHEDULERCOMMUNICATOR_H // Library includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskSchedulerCommunicator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CConcreteTaskSchedulerCommunicator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteTaskSchedulerCommunicator : public CTaskSchedulerCommunicator { // public methods public: //! Constructor CConcreteTaskSchedulerCommunicator(CTaskEventHandlerBasedScheduler* taskScheduler, CTaskEventHandlerBasedProcessor* taskProcessor); //! Destructor virtual ~CConcreteTaskSchedulerCommunicator(); CConcreteTaskSchedulerCommunicator* incRequestProcessingTask(cint64 incCount = 1); CConcreteTaskSchedulerCommunicator* decRequestProcessingTask(cint64 decCount = 1); cint64 getRequestUpdatedDispensableProcessingAndSchedulingTasksCount(); cint64 getRequestUpdatedDispensableSchedulingTasksCount(); cint64 getRequestUpdatedRemainingSchedulingTasksCount(); CConcreteTaskSchedulerCommunicator* incSendedTasks(cint64 incCount = 1); // protected methods protected: // protected variables protected: cint64 mRequestCount; cint64 mSendedSchedulingTaskCount; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CCONCRETETASKSCHEDULERCOMMUNICATOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CConcreteTaskScheduleItem.cpp0000644000175000017500000000333612520551272025676 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteTaskScheduleItem.h" namespace Konclude { namespace Scheduler { CConcreteTaskScheduleItem::CConcreteTaskScheduleItem() : CLinkerBase(this,nullptr) { mCommunicator = nullptr; } CConcreteTaskScheduleItem::~CConcreteTaskScheduleItem() { } CConcreteTaskScheduleItem* CConcreteTaskScheduleItem::initTaskScheduleItem(CConcreteTaskSchedulerCommunicator* communicator, CConcreteTaskScheduleItem* nextSchedulerItem) { initLinker(this,nextSchedulerItem); mCommunicator = communicator; return this; } CConcreteTaskSchedulerCommunicator* CConcreteTaskScheduleItem::getCommunicator() { return mCommunicator; } CConcreteTaskScheduleItem* CConcreteTaskScheduleItem::setCommunicator(CConcreteTaskSchedulerCommunicator* communicator) { mCommunicator = communicator; return this; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CEventHandlerVendor.h0000644000175000017500000000337112520551274024220 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CEVENTHANDLERVENDOR_H #define KONCLUDE_SCHEDULER_CEVENTHANDLERVENDOR_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" // Other includes #include "Concurrent/CEventHandler.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Scheduler { /*! * * \class CEventHandlerVendor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEventHandlerVendor { // public methods public: //! Constructor CEventHandlerVendor(); //! Destructor virtual ~CEventHandlerVendor(); virtual CEventHandler* getEventHandler() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CEVENTHANDLERVENDOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveQueueAdderController.cpp0000644000175000017500000000202312520551304027250 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskReserveQueueAdderController.h" namespace Konclude { namespace Scheduler { CTaskReserveQueueAdderController::CTaskReserveQueueAdderController() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CBooleanTrueResultCancelTaskStatusPropagator.h0000644000175000017500000000413112520551272031266 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CBOOLEANTRUERESULTCANCELTASKSTATUSPROPAGATOR_H #define KONCLUDE_SCHEDULER_CBOOLEANTRUERESULTCANCELTASKSTATUSPROPAGATOR_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTask.h" #include "CTaskStatusPropagator.h" #include "CBooleanTaskResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CBooleanTrueResultCancelTaskStatusPropagator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBooleanTrueResultCancelTaskStatusPropagator : public CTaskStatusPropagator { // public methods public: //! Constructor CBooleanTrueResultCancelTaskStatusPropagator(); //! Destructor virtual ~CBooleanTrueResultCancelTaskStatusPropagator(); virtual bool updateTaskStatus(CTask* task, bool& moreDownPropagation, bool& moreUpPropagation); virtual bool completeTaskStatus(CTask* task, bool& moreUpPropagation); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CBOOLEANTRUERESULTCANCELTASKSTATUSPROPAGATOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessorThreadBase.h0000644000175000017500000001603212520551302025176 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKPROCESSORTHREADBASE_H #define KONCLUDE_SCHEDULER_CTASKPROCESSORTHREADBASE_H // Libraries includes #include // Namespace includes #include "SchedulerSettings.h" #include "CTaskEventHandlerBasedProcessor.h" #include "CTaskHandleContext.h" #include "CTaskHandleMemoryAllocationManager.h" #include "CTaskHandleAlgorithm.h" #include "CTaskProcessorContextBase.h" #include "CTaskStatusPropagator.h" #include "CTaskCallbackExecuter.h" #include "CTaskProcessingStatistics.h" #include "CTaskReserveQueueConsumer.h" #include "CTask.h" // Other includes #include "Scheduler/Events/CSendTaskProcessEvent.h" #include "Scheduler/Events/CSendTaskCompleteEvent.h" #include "Scheduler/Events/CRequestScheduleTaskEvent.h" #include "Scheduler/Events/CResponseScheduleTaskEvent.h" #include "Scheduler/Events/CTaskAdditionalAllocationEvent.h" #include "Scheduler/Events/CUpdateTaskStatusEvent.h" #include "Concurrent/Events/CHandleEventsEvent.h" #include "Concurrent/CQueuedLinkedEventHandler.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; using namespace Utilities::Memory; namespace Scheduler { using namespace Events; //#define KONCLUDE_SCHEDULER_DEBUG_TASK_MEMORY_RELEASE /*! * * \class CTaskProcessorThreadBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskProcessorThreadBase : public CTaskEventHandlerBasedProcessor, public CThread, public CThreadActivator, public CTaskProcessorCommunicator, public CEventProcessor { // public methods public: //! Constructor CTaskProcessorThreadBase(CTaskHandleAlgorithm* taskHandleAlgo, const QString &threadStringName = "TaskProcesserThread"); //! Destructor virtual ~CTaskProcessorThreadBase(); CTaskProcessingStatistics* getTaskProcessingStatistics(); virtual CThreadActivator* signalizeEvent(); virtual CEventHandler* getEventHandler(); virtual CTaskProcessorThreadBase* startProcessing(); virtual CTaskProcessorThreadBase* stopProcessing(); cint64 getStatisticTaskProcessed(); cint64 getStatisticTaskCompleted(); cint64 getStatisticEventProcessed(); cint64 getStatisticComputionTime(); cint64 getStatisticBlockingTime(); cint64 getTaskProcessingCount(); virtual bool canDispenseProcessingTasks(); virtual bool requiresProcessingTasks(); virtual bool requiresSchedulingTasks(); virtual cint64 countDispensableProcessingTasks(); virtual cint64 countScheduleableProcessingTasks(); virtual cint64 getRecievedTasks(); CTaskProcessorThreadBase* installCallbackExecuter(CTaskCallbackExecuter* callbackExecuter); CTaskProcessorThreadBase* installStatusPropagator(CTaskStatusPropagator* statusPropagator); virtual CTaskHandleAlgorithm* getTaskHandleAlgorithm(); bool isProcessing(); bool isBlocked(); // protected methods protected: virtual bool processControlEvents(QEvent::Type type, CControlEvent *event); virtual bool processEvent(CEvent *event, CContext* handlerContext); virtual bool processingLoop(); void organizeDispenseTasks(bool forceUpdate); virtual CTaskProcessorCommunicator* communicateTaskComplete(CTask* task); virtual CTaskProcessorCommunicator* communicateTaskError(CTask* task); virtual CTaskProcessorCommunicator* communicateTaskCreation(CTask* newTask); virtual CTaskProcessorCommunicator* communicateTaskAdditionalAllocation(CTask* task, CMemoryPool* additionalAllocatedMemoryPool); virtual CTaskProcessorCommunicator* communicateTaskStatusUpdate(CTask* task); virtual CTaskProcessorCommunicator* communicateTaskRelevant(CTask* task); virtual bool verifyContinueTaskProcessing(CTask* task); bool processTask(CTask* task); bool addProcessingTask(CTask* task); bool handleEvents(); virtual bool processDispenseNotification() = 0; virtual bool processRequestProcessTask() = 0; virtual bool processCriticalScheduleTask() = 0; virtual bool processCompleteTask(CTask* task) = 0; virtual bool processAdditionalTaskAllocation(CTask* task, CMemoryPool* memoryPool) = 0; virtual bool processResponseScheduleTask(CTask* task, CTaskScheduleItem* taskScheduleItem, bool schedulingTask) = 0; virtual bool processUpdateTaskStatus(CTask* task) = 0; virtual bool processUpdateTaskStatus(CTask* parentTask, CTask* updateTask) = 0; // protected variables protected: CTask* mTaskSchedulingQueue; CTask* mTaskProcessingQueue; CTask* mTaskCompletionQueue; CTaskProcessorContext *mTaskProcessorContext; CTaskHandleMemoryAllocationManager *mMemoryAllocator; CTaskHandleAlgorithm* mTaskHandleAlgo; CTaskStatusPropagator* mTaskStatusPropagator; CTaskCallbackExecuter* mCallbackExecuter; CQueuedLinkedEventHandler* mEventHandler; QSemaphore mProcessingWakeUpSemaphore; CXLinker* mEventHandlerLinker; CTaskReserveQueueConsumer* mTaskReserveQueueConsumer; bool mProcessingStopped; bool mThreadBlocked; bool mEventSignalized; bool mProcessingBlocked; cint64 mLastProcessingStartRequestTag; cint64 mLastProcessingStartedTag; cint64 mTaskProcessingCount; cint64 mTaskParentRelevantCount; cint64 mTaskSchedulingCount; cint64 mTaskReserveQueueCount; cint64 mCriticalSchedulingCount; cint64 mCriticalSchedulingThresholdCount; cint64 mRecievedTasks; bool mCriticalSchedulingNotified; bool mProcessTaskRequesting; bool mMinimalPriorityTaskInvalidated; double mMinTaskPriority; CTask* mMinPriorityTask; bool mConfScheduleTasksDistribution; bool mConfProcessingTasksDistribution; bool mConfUseReserveTasksQueue; bool mConfProcessReserveTasks; bool mConfProcessSchedulingTasks; CTaskProcessingStatistics mStats; cint64 mStatComputionTime; cint64 mStatBlockingTime; #ifdef KONCLUDE_SCHEDULER_TASK_THREADS_TIME_STATISTICS QTime mComputionTimer; QTime mBlockingTimer; #endif // for debugging only CTask* mLastProcessedTask; CTask* mLastDispendedTask; CEvent* mLastProcessedEvent; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKPROCESSORTHREADBASE_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessorThread.cpp0000644000175000017500000002066712520551302024747 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskProcessorThread.h" namespace Konclude { namespace Scheduler { CTaskProcessorThread::CTaskProcessorThread(CTaskHandleAlgorithm* taskHandleAlgo, CTaskEventHandlerBasedDistributionCompletor* distributorCompletor, CConsiderateMemoryPoolProvider* memoryPoolProvider) : CTaskProcessorThreadBase(taskHandleAlgo,"TaskProcesserSchedulerThread") { mDistributorCompletorCommunicator = new CTaskDistributionCompletorCommunicator(distributorCompletor,this); mMemoryPoolReleaser = new CEventDistributionMemoryPoolReleaser(mDistributorCompletorCommunicator); mMemoryPoolProvider = memoryPoolProvider; if (!mMemoryPoolProvider) { //mMemoryPoolProvider = distributorCompletor->createDistributionMemoryPoolProvider(mMemoryPoolReleaser); mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); } mMemoryAllocator = new CTaskHandleLimitedReserveMemoryPoolAllocationManager(mMemoryPoolProvider,300,30); mTaskProcessorContext = new CTaskProcessorContextBase(this,mMemoryAllocator); mDispenseNotificationTag = 0; mSchedulerCommunicator = nullptr; } CTaskProcessorThread::~CTaskProcessorThread() { } CTaskEventHandlerBasedProcessor* CTaskProcessorThread::installScheduler(CTaskEventHandlerBasedScheduler* scheduler) { mTaskReserveQueueConsumer = scheduler->createTaskReserveQueueConsumer(this); CTaskSchedulerCommunicator* schedulerCommunicator = scheduler->createSchedulerProcessorCommunication(this); installSchedulerCommunicator(schedulerCommunicator); return this; } CTaskProcessorThread* CTaskProcessorThread::installSchedulerCommunicator(CTaskSchedulerCommunicator* schedulerCommunicator) { mSchedulerCommunicator = schedulerCommunicator; mSchedulerCommunicator->communicateRequestProcessTask(mMemoryAllocator); return this; } bool CTaskProcessorThread::processEvent(CEvent *event, CContext* handlerContext) { cint64 eventID = event->getEventTypeID(); if (CTaskProcessorThreadBase::processEvent(event,handlerContext)) { return true; } else { // not supported } return false; } bool CTaskProcessorThread::processDispenseNotification() { bool schedulerReqDis = mSchedulerCommunicator->requiresTaskDispenseNotification(mDispenseNotificationTag); organizeDispenseTasks(schedulerReqDis); if (canDispenseProcessingTasks() && schedulerReqDis) { mSchedulerCommunicator->communicateTaskDispenseNotification(mMemoryAllocator); } return true; } bool CTaskProcessorThread::processRequestProcessTask() { mSchedulerCommunicator->communicateRequestProcessTask(mMemoryAllocator); return true; } bool CTaskProcessorThread::processCriticalScheduleTask() { mSchedulerCommunicator->communicateCriticalScheduleTask(mMemoryAllocator); return true; } bool CTaskProcessorThread::processCompleteTask(CTask* task) { // try locale to complete task cint64 completedCount = 0; mTaskCompletionQueue = task->getLastListLink()->setNext(mTaskCompletionQueue); while (mTaskCompletionQueue) { CTask* completionTask = mTaskCompletionQueue; mTaskCompletionQueue = mTaskCompletionQueue->getNext(); if (completionTask && !completionTask->hasActiveReferencedTask()) { CTask* parentTask = completionTask->getParentTask(); if (!parentTask || parentTask->hasNoTaskOwnerAndNoParentTask() || parentTask->hasTaskOwner(this)) { // locale task completion bool upPropagation = false; if (mTaskStatusPropagator && mTaskStatusPropagator->completeTaskStatus(completionTask,upPropagation)) { if (parentTask && upPropagation) { processUpdateTaskStatus(parentTask); } } completionTask->completeTask(); completionTask->getTaskStatus()->setTaskCOMPLETEDState(); bool memoryReleaseable = completionTask->getTaskStatus()->isMemoryReleaseable(); if (parentTask) { parentTask->decActiveReferenceCount(); if (!parentTask->hasActiveReferencedTask()) { mTaskCompletionQueue = parentTask->setNext(mTaskCompletionQueue); } } if (completionTask) { // callbacks CCallbackData* callbackLinkerIt = completionTask->getCallbackLinker(); while (callbackLinkerIt) { CCallbackData* callback = callbackLinkerIt; callbackLinkerIt = callbackLinkerIt->getNext(); if (mCallbackExecuter) { mCallbackExecuter->executeCallback(completionTask,callback); } else { callback->doCallback(); } } } #ifndef KONCLUDE_SCHEDULER_DEBUG_TASK_MEMORY_RELEASE if (memoryReleaseable) { mMemoryAllocator->releaseMemoryPoolContainer(completionTask); } #endif completedCount++; } else { // task completion by completer mDistributorCompletorCommunicator->communicateTaskComplete(completionTask,mMemoryAllocator); } } } INCTASKPROCESSINGSTAT(mStats.incStatisticTasksCompletedCount(completedCount)); return true; } bool CTaskProcessorThread::processAdditionalTaskAllocation(CTask* task, CMemoryPool* memoryPool) { CTask* parentTask = task->getParentTask(); if (!parentTask || parentTask->hasNoTaskOwnerAndNoParentTask() || parentTask->hasTaskOwner(this)) { task->appendMemoryPool(memoryPool); } else { mDistributorCompletorCommunicator->communicateAdditionalAllocationTask(task,memoryPool,mMemoryAllocator); } return true; } bool CTaskProcessorThread::processResponseScheduleTask(CTask* task, CTaskScheduleItem* taskScheduleItem, bool schedulingTask) { mSchedulerCommunicator->communicateResponseScheduleTask(taskScheduleItem,task,schedulingTask,mMemoryAllocator); return true; } bool CTaskProcessorThread::processUpdateTaskStatus(CTask* updateTask) { CTask* parentTask = updateTask->getParentTask(); if (!parentTask || parentTask->hasNoTaskOwnerAndNoParentTask() || parentTask->hasTaskOwner(this)) { // update status local bool downProp = false; bool upProp = false; if (mTaskStatusPropagator && mTaskStatusPropagator->updateTaskStatus(updateTask,downProp,upProp)) { if (downProp) { // update task status local CXNegLinker* refTaskIt = updateTask->getReferencedTaskLinker(); while (refTaskIt) { if (refTaskIt->isNegated()) { // task still exists, update task status // TODO: check better not recursive? CTask* refTask = refTaskIt->getData(); processUpdateTaskStatus(refTask); } refTaskIt = refTaskIt->getNext(); } } if (upProp && parentTask) { processUpdateTaskStatus(parentTask); } } } else { mDistributorCompletorCommunicator->communicateAlignedUpdateTaskStatus(updateTask,mMemoryAllocator); } return true; } bool CTaskProcessorThread::processUpdateTaskStatus(CTask* parentTask, CTask* updateTask) { if (parentTask->hasNoTaskOwnerAndNoParentTask() || parentTask->hasTaskOwner(this)) { // local task status update // check whether task is completed bool taskCompleted = false; CXNegLinker* refTaskLinkerIt = parentTask->getReferencedTaskLinker(); while (refTaskLinkerIt) { CTask* refTask = refTaskLinkerIt->getData(); if (refTask == updateTask) { if (!refTaskLinkerIt->isNegated()) { taskCompleted = true; } break; } refTaskLinkerIt = refTaskLinkerIt->getNext(); } if (!taskCompleted) { processUpdateTaskStatus(updateTask); } mDistributorCompletorCommunicator->communicateTaskStatusUpdated(parentTask,updateTask,true,mMemoryAllocator); } else { mDistributorCompletorCommunicator->communicateTaskStatusUpdated(parentTask,updateTask,false,mMemoryAllocator); } return true; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskEventHandlerBasedScheduler.h0000644000175000017500000000433512520551276026466 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKEVENTHANDLERBASEDSCHEDULER_H #define KONCLUDE_SCHEDULER_CTASKEVENTHANDLERBASEDSCHEDULER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskScheduler.h" #include "CEventHandlerVendor.h" #include "CTaskReserveQueueConsumer.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskEventHandlerBasedScheduler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskEventHandlerBasedScheduler : virtual public CTaskScheduler, virtual public CEventHandlerVendor { // public methods public: //! Constructor CTaskEventHandlerBasedScheduler(); //! Destructor virtual ~CTaskEventHandlerBasedScheduler(); virtual bool requiresTaskDispenseNotification(cint64 &updateDispenseNotificationTag) = 0; virtual CTaskSchedulerCommunicator* createSchedulerProcessorCommunication(CTaskEventHandlerBasedProcessor* taskProcessor) = 0; virtual CTaskReserveQueueConsumer* createTaskReserveQueueConsumer(CTaskEventHandlerBasedProcessor* taskProcessor) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKEVENTHANDLERBASEDSCHEDULER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessorCommunicator.h0000644000175000017500000000446112520551300025635 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKPROCESSORCOMMUNICATOR_H #define KONCLUDE_SCHEDULER_CTASKPROCESSORCOMMUNICATOR_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTask.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskProcessorCommunicator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskProcessorCommunicator { // public methods public: //! Constructor CTaskProcessorCommunicator(); //! Destructor virtual ~CTaskProcessorCommunicator(); virtual CTaskProcessorCommunicator* communicateTaskComplete(CTask* task) = 0; virtual CTaskProcessorCommunicator* communicateTaskError(CTask* task) = 0; virtual CTaskProcessorCommunicator* communicateTaskCreation(CTask* newTask) = 0; virtual CTaskProcessorCommunicator* communicateTaskAdditionalAllocation(CTask* task, CMemoryPool* additionalAllocatedMemoryPool) = 0; virtual CTaskProcessorCommunicator* communicateTaskStatusUpdate(CTask* task) = 0; virtual CTaskProcessorCommunicator* communicateTaskRelevant(CTask* task) = 0; virtual bool verifyContinueTaskProcessing(CTask* task) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKPROCESSORCOMMUNICATOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskSchedulerCommunicator.cpp0000644000175000017500000001152112520551304026126 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskSchedulerCommunicator.h" namespace Konclude { namespace Scheduler { CTaskSchedulerCommunicator::CTaskSchedulerCommunicator(CTaskEventHandlerBasedScheduler* taskScheduler, CTaskEventHandlerBasedProcessor* taskProcessor) : mSchedulerTaskEventCommunicator(taskScheduler->getEventHandler()), mProcessorTaskEventCommunicator(taskProcessor->getEventHandler()) { mTaskScheduler = taskScheduler; mTaskProcessor = taskProcessor; } CTaskSchedulerCommunicator::~CTaskSchedulerCommunicator() { } CTaskSchedulerCommunicator* CTaskSchedulerCommunicator::communicateRequestScheduleTask(CTaskScheduleItem* taskScheduleItem, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { mProcessorTaskEventCommunicator.postRequestScheduleTaskEvent(this,taskScheduleItem,memoryTmpAllocatorManager); return this; } CTaskSchedulerCommunicator* CTaskSchedulerCommunicator::communicateResponseScheduleTask(CTaskScheduleItem* taskScheduleItem, CTask* task, bool schedulingTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { mSchedulerTaskEventCommunicator.postResponseScheduleTaskEvent(this,taskScheduleItem,task,schedulingTask,memoryTmpAllocatorManager); return this; } CTaskSchedulerCommunicator* CTaskSchedulerCommunicator::communicateCriticalScheduleTask(CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { mSchedulerTaskEventCommunicator.postCriticalScheduleTaskEvent(this,memoryTmpAllocatorManager); return this; } CTaskSchedulerCommunicator* CTaskSchedulerCommunicator::communicateRequestProcessTask(CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { mSchedulerTaskEventCommunicator.postRequestProcessTaskEvent(this,memoryTmpAllocatorManager); return this; } CTaskSchedulerCommunicator* CTaskSchedulerCommunicator::communicateTaskDispenseNotification(CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { mSchedulerTaskEventCommunicator.postTaskDispenseNotificationEvent(this,memoryTmpAllocatorManager); return this; } CTaskSchedulerCommunicator* CTaskSchedulerCommunicator::communicateProcessTask(CTask* task, bool schedulingTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { mProcessorTaskEventCommunicator.postSendTaskProcessEvent(task,schedulingTask,memoryTmpAllocatorManager); return this; } bool CTaskSchedulerCommunicator::requiresTaskDispenseNotification(cint64 &dispenseNotificationTag) { return mTaskScheduler->requiresTaskDispenseNotification(dispenseNotificationTag); } bool CTaskSchedulerCommunicator::canDispenseProcessingTasks() { return mTaskProcessor->canDispenseProcessingTasks(); } bool CTaskSchedulerCommunicator::requiresProcessingTasks() { return mTaskProcessor->requiresProcessingTasks(); } bool CTaskSchedulerCommunicator::requiresSchedulingTasks() { return mTaskProcessor->requiresSchedulingTasks(); } cint64 CTaskSchedulerCommunicator::countDispensableProcessingTasks() { return mTaskProcessor->countDispensableProcessingTasks(); } cint64 CTaskSchedulerCommunicator::countScheduleableProcessingTasks() { return mTaskProcessor->countScheduleableProcessingTasks(); } CTaskSchedulerCommunicator* CTaskSchedulerCommunicator::communicateScheduleUpdateTaskStatus(CTask* parentTask, CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { mSchedulerTaskEventCommunicator.postUpdateTaskStatusEvent(parentTask,updateTask,memoryTmpAllocatorManager); return this; } CTaskSchedulerCommunicator* CTaskSchedulerCommunicator::communicateUpdateTaskStatus(CTask* parentTask, CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { mProcessorTaskEventCommunicator.postUpdateTaskStatusEvent(parentTask,updateTask,memoryTmpAllocatorManager); return this; } bool CTaskSchedulerCommunicator::hasTaskOwner(CTaskOwner* taskOwner) { return taskOwner == mTaskProcessor; } cint64 CTaskSchedulerCommunicator::getRecievedTasks() { return mTaskProcessor->getRecievedTasks(); } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskHandleMemoryAllocationManager.cpp0000644000175000017500000000215312520551300027511 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskHandleMemoryAllocationManager.h" namespace Konclude { namespace Scheduler { CTaskHandleMemoryAllocationManager::CTaskHandleMemoryAllocationManager() { } CTaskHandleMemoryAllocationManager::~CTaskHandleMemoryAllocationManager() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskStatus.h0000644000175000017500000000537312520551306022571 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKSTATUS_H #define KONCLUDE_SCHEDULER_CTASKSTATUS_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskStatus * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskStatus { // public methods public: //! Constructor CTaskStatus(); //! Destructor virtual ~CTaskStatus(); enum TASKSTATE { TSUNINITIALIZED, TSQUEUED, TSPROCESSING, TSSCHEDULING, TSFINISHED, TSCOMPLETED }; TASKSTATE getTaskState(); CTaskStatus* setTaskState(TASKSTATE taskState); CTaskStatus* setCanceled(bool canceled); CTaskStatus* setFinished(bool finished); CTaskStatus* setError(bool error, cint64 errorCode); CTaskStatus* setMemoryReleaseable(bool releaseable); bool isFinished(); bool isCanceled(); bool isProcessable(); bool isError(); bool isTaskState(TASKSTATE taskState); bool hasOneTaskState(TASKSTATE taskStateCompination); cint64 getErrorCode(); CTaskStatus* setTaskQUEUEDState(); CTaskStatus* setTaskPROCESSINGState(); CTaskStatus* setTaskSCHEDULINGState(); CTaskStatus* setTaskFINISHEDState(); CTaskStatus* setTaskCOMPLETEDState(); bool isTaskStateQUEUED(); bool isTaskStatePROCESSING(); bool isTaskStateFINISHED(); bool isTaskStateSCHEDULING(); bool isTaskStateCOMPLETED(); bool isTaskStateUNINITIALIZED(); bool isMemoryReleaseable(); // protected methods protected: // protected variables protected: TASKSTATE mTaskState; bool mCanceledFlag; bool mFinishedFlag; bool mReleaseable; bool mErrorFlag; cint64 mErrorCode; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKSTATUS_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CBooleanTrueResultCancelTaskStatusPropagator.cpp0000644000175000017500000000754712520551272031637 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBooleanTrueResultCancelTaskStatusPropagator.h" namespace Konclude { namespace Scheduler { CBooleanTrueResultCancelTaskStatusPropagator::CBooleanTrueResultCancelTaskStatusPropagator() { } CBooleanTrueResultCancelTaskStatusPropagator::~CBooleanTrueResultCancelTaskStatusPropagator() { } bool CBooleanTrueResultCancelTaskStatusPropagator::updateTaskStatus(CTask* task, bool& moreDownPropagation, bool& moreUpPropagation) { CTaskStatus* taskStatus = task->getTaskStatus(); CTaskResult* taskResult = task->getTaskResult(); CBooleanTaskResult* booleanTaskResult = dynamic_cast(taskResult); bool statusUpdated = false; bool validChildTasks = false; CXNegLinker* taskRefLinkerIt = task->getReferencedTaskLinker(); while (taskRefLinkerIt) { if (taskRefLinkerIt->isNegated()) { validChildTasks = true; break; } taskRefLinkerIt = taskRefLinkerIt->getNext(); } if (taskStatus->isCanceled() && validChildTasks) { statusUpdated = true; moreDownPropagation = true; } if (booleanTaskResult) { if (booleanTaskResult->hasResult() && validChildTasks) { statusUpdated = true; moreDownPropagation = true; } if (booleanTaskResult->hasResultValue(true)) { if (!taskStatus->isCanceled()) { taskStatus->setCanceled(true); } CTask* parentTask = task->getParentTask(); CTaskResult* parentTaskResult = parentTask->getTaskResult(); CTaskStatus* parentTaskStatus = parentTask->getTaskStatus(); if (parentTask && !parentTaskStatus->isCanceled()) { parentTaskStatus->setCanceled(true); CBooleanTaskResult* parentBooleanTaskResult = dynamic_cast(parentTaskResult); parentBooleanTaskResult->installResult(true); statusUpdated = true; moreUpPropagation = true; } } } return statusUpdated; } bool CBooleanTrueResultCancelTaskStatusPropagator::completeTaskStatus(CTask* task, bool& moreUpPropagation) { CTaskStatus* taskStatus = task->getTaskStatus(); CTaskResult* taskResult = task->getTaskResult(); CBooleanTaskResult* booleanTaskResult = dynamic_cast(taskResult); bool statusUpdated = false; if (booleanTaskResult) { if (!booleanTaskResult->hasResult()) { booleanTaskResult->installResult(false); statusUpdated = true; } if (booleanTaskResult->hasResultValue(true)) { if (!taskStatus->isCanceled()) { taskStatus->setCanceled(true); } CTask* parentTask = task->getParentTask(); CTaskResult* parentTaskResult = parentTask->getTaskResult(); CTaskStatus* parentTaskStatus = parentTask->getTaskStatus(); if (parentTask && !parentTaskStatus->isCanceled()) { parentTaskStatus->setCanceled(true); CBooleanTaskResult* parentBooleanTaskResult = dynamic_cast(parentTaskResult); parentBooleanTaskResult->installResult(true); statusUpdated = true; moreUpPropagation = true; } } } return statusUpdated; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessorThread.h0000644000175000017500000000730212520551302024403 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKPROCESSORTHREAD_H #define KONCLUDE_SCHEDULER_CTASKPROCESSORTHREAD_H // Libraries includes #include // Namespace includes #include "SchedulerSettings.h" #include "CTaskProcessorThreadBase.h" #include "CTaskHandleContext.h" #include "CTaskHandleMemoryAllocationManager.h" #include "CTaskHandleMemoryPoolAllocationManager.h" #include "CTaskHandleLimitedReserveMemoryPoolAllocationManager.h" #include "CTaskHandleAlgorithm.h" #include "CTaskProcessorContextBase.h" #include "CTaskDistributionCompletorCommunicator.h" #include "CConcreteTaskScheduleItem.h" #include "CEventDistributionMemoryPoolReleaser.h" #include "CTaskReserveQueueConsumer.h" // Other includes #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" #include "Utilities/Memory/CConsiderateMemoryPoolProvider.h" #include "Scheduler/Events/CTaskDispenseNotificationEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Scheduler { using namespace Events; /*! * * \class CTaskProcessorThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskProcessorThread : public CTaskProcessorThreadBase { // public methods public: //! Constructor CTaskProcessorThread(CTaskHandleAlgorithm* taskHandleAlgo, CTaskEventHandlerBasedDistributionCompletor* distributorCompletor, CConsiderateMemoryPoolProvider* memoryPoolProvider = nullptr); //! Destructor virtual ~CTaskProcessorThread(); virtual CTaskEventHandlerBasedProcessor* installScheduler(CTaskEventHandlerBasedScheduler* scheduler); // protected methods protected: virtual CTaskProcessorThread* installSchedulerCommunicator(CTaskSchedulerCommunicator* schedulerCommunicator); virtual bool processEvent(CEvent *event, CContext* handlerContext); virtual bool processDispenseNotification(); virtual bool processRequestProcessTask(); virtual bool processCriticalScheduleTask(); virtual bool processCompleteTask(CTask* task); virtual bool processAdditionalTaskAllocation(CTask* task, CMemoryPool* memoryPool); virtual bool processResponseScheduleTask(CTask* task, CTaskScheduleItem* taskScheduleItem, bool schedulingTask); virtual bool processUpdateTaskStatus(CTask* task); virtual bool processUpdateTaskStatus(CTask* parentTask, CTask* updateTask); // protected variables protected: CConsiderateMemoryPoolProvider* mMemoryPoolProvider; CDistributionMemoryPoolReleaser* mMemoryPoolReleaser; // processor variables cint64 mDispenseNotificationTag; CTaskSchedulerCommunicator* mSchedulerCommunicator; CTaskDistributionCompletorCommunicator* mDistributorCompletorCommunicator; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKPROCESSORTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveQueueAdder.h0000644000175000017500000000366512520551304024666 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKRESERVEQUEUEADDER_H #define KONCLUDE_SCHEDULER_CTASKRESERVEQUEUEADDER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskReserveQueue.h" #include "CTaskReserveQueueAdderController.h" #include "CTask.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskReserveQueueAdder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskReserveQueueAdder { // public methods public: //! Constructor CTaskReserveQueueAdder(CTaskReserveQueue* queue, CTaskReserveQueueAdderController* controller); virtual bool tryAddTasks(CTask*& tasks); virtual bool requiresTaskAddedNotification(); // protected methods protected: // protected variables protected: CTaskReserveQueueAdderController* mController; CTaskReserveQueue* mQueue; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKRESERVEQUEUEADDER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveArrayQueue.h0000644000175000017500000000434012520551302024712 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKRESERVEARRAYQUEUE_H #define KONCLUDE_SCHEDULER_CTASKRESERVEARRAYQUEUE_H // Libraries includes #include #include // Namespace includes #include "SchedulerSettings.h" #include "CTaskReserveQueue.h" #include "CTaskReserveArrayQueueItem.h" #include "CTaskReserveArrayQueueConsumer.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskReserveArrayQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskReserveArrayQueue : public CTaskReserveQueue { // public methods public: //! Constructor CTaskReserveArrayQueue(cint64 vectorSize); bool tryAddTasks(CTask*& tasks); bool tryGetTask(CTask*& task); cint64 getTaskCount(); CTaskReserveQueueConsumer* createTaskReserveQueueConsumer(); // protected methods protected: inline cint64 getIndex(cint64 i) { return i % mVectorSize; } // protected variables protected: cint64 mNextItem; QVector mTaskVector; cint64 mVectorSize; cint64 mLastItem; CTaskReserveArrayQueueConsumer* mConsumerLinker; QMutex mAddConsumerMutex; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKRESERVEARRAYQUEUE_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskStatusPropagator.cpp0000644000175000017500000000205212520551306025152 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskStatusPropagator.h" namespace Konclude { namespace Scheduler { CTaskStatusPropagator::CTaskStatusPropagator() { } CTaskStatusPropagator::~CTaskStatusPropagator() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveMultiArrayQueue.h0000644000175000017500000000500112520551302025720 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKRESERVEMULTIARRAYQUEUE_H #define KONCLUDE_SCHEDULER_CTASKRESERVEMULTIARRAYQUEUE_H // Libraries includes #include #include // Namespace includes #include "SchedulerSettings.h" #include "CTaskReserveQueue.h" #include "CTaskReserveArrayQueue.h" #include "CTaskReserveMultiArrayQueueConsumer.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Scheduler { /*! * * \class CTaskReserveMultiArrayQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskReserveMultiArrayQueue : public CTaskReserveQueue { // public methods public: //! Constructor CTaskReserveMultiArrayQueue(CTaskReserveArrayQueue* mainQueue); bool tryAddTasks(CTask*& tasks); bool tryGetTask(CTask*& task); cint64 getTaskCount(); CTaskReserveQueueConsumer* createTaskReserveQueueConsumer(); CTaskReserveMultiArrayQueue* addTaskReserveArrayQueue(CTaskReserveArrayQueue* queue); CXLinker* getTaskReserveArrayQueueLinker(); cint64 getTaskReserveArrayQueueCount(); // protected methods protected: // protected variables protected: CTaskReserveArrayQueue* mMainQueue; CXLinker* mQueueLinker; QMutex mAddQueueMutex; cint64 mQueuesCount; CTaskReserveMultiArrayQueueConsumer* mConsumerLinker; QMutex mAddConsumerMutex; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKRESERVEMULTIARRAYQUEUE_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskHandleLimitedReserveMemoryPoolAllocationManager.cppKonclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskHandleLimitedReserveMemoryPoolAllocationManager0000644000175000017500000001016712520551300032432 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskHandleLimitedReserveMemoryPoolAllocationManager.h" namespace Konclude { namespace Scheduler { CTaskHandleLimitedReserveMemoryPoolAllocationManager::CTaskHandleLimitedReserveMemoryPoolAllocationManager(CConsiderateMemoryPoolProvider* memoryPoolProvider, cint64 freeReserveLimit, cint64 freeReleaseBlockSize) : CLimitedReserveMemoryPoolAllocationManager(memoryPoolProvider,freeReserveLimit,freeReleaseBlockSize) { mConsideratedMemPoolProvider = memoryPoolProvider; } CTaskHandleLimitedReserveMemoryPoolAllocationManager::~CTaskHandleLimitedReserveMemoryPoolAllocationManager() { } void* CTaskHandleLimitedReserveMemoryPoolAllocationManager::allocate(size_t size) { return CLimitedReserveMemoryPoolAllocationManager::allocate(size); } CMemoryAllocationManager* CTaskHandleLimitedReserveMemoryPoolAllocationManager::release(void* address) { return CLimitedReserveMemoryPoolAllocationManager::release(address); } void* CTaskHandleLimitedReserveMemoryPoolAllocationManager::allocateAligned(size_t size, int alignment) { return CLimitedReserveMemoryPoolAllocationManager::allocateAligned(size,alignment); } CMemoryTemporaryAllocationManager* CTaskHandleLimitedReserveMemoryPoolAllocationManager::releaseAllMemory() { return CLimitedReserveMemoryPoolAllocationManager::releaseAllMemory(); } CMemoryPool* CTaskHandleLimitedReserveMemoryPoolAllocationManager::acqireTemporaryMemoryPool(size_t size) { return CLimitedReserveMemoryPoolAllocationManager::acqireTemporaryMemoryPool(size); } CMemoryTemporaryAllocationManager* CTaskHandleLimitedReserveMemoryPoolAllocationManager::releaseTemporaryMemoryPool(CMemoryPool* memoryPool) { return CLimitedReserveMemoryPoolAllocationManager::releaseTemporaryMemoryPool(memoryPool); } cint64 CTaskHandleLimitedReserveMemoryPoolAllocationManager::getOptimizedMoreAllocationSize(cint64 size) { return CLimitedReserveMemoryPoolAllocationManager::getOptimizedMoreAllocationSize(size); } CMemoryTemporaryAllocationManager* CTaskHandleLimitedReserveMemoryPoolAllocationManager::releaseMemoryPoolContainer(CMemoryPoolContainer* memoryPoolContainer) { return CLimitedReserveMemoryPoolAllocationManager::releaseMemoryPoolContainer(memoryPoolContainer); } CMemoryPoolProvider* CTaskHandleLimitedReserveMemoryPoolAllocationManager::releaseMemoryPool(CMemoryPool* memoryPool) { return CLimitedReserveMemoryPoolAllocationManager::releaseMemoryPool(memoryPool); } CMemoryPool* CTaskHandleLimitedReserveMemoryPoolAllocationManager::acquireMemoryPool(cint64 minPoolSize) { return CLimitedReserveMemoryPoolAllocationManager::acquireMemoryPool(minPoolSize); } CMemoryPool* CTaskHandleLimitedReserveMemoryPoolAllocationManager::acquireMemoryPoolConsiderated(cint64 minPoolSize) { CMemoryPool* tmpMemoryPool = nullptr; if (mFreeMemoryPoolList) { if (mFreeMemoryPoolList->getMemoryBlockSize() >= minPoolSize) { tmpMemoryPool = mFreeMemoryPoolList; mFreeMemoryPoolList = mFreeMemoryPoolList->getNextMemoryPool(); --mFreeMemoryPoolCount; } } if (!tmpMemoryPool) { tmpMemoryPool = mConsideratedMemPoolProvider->acquireMemoryPoolConsiderated(minPoolSize); } if (tmpMemoryPool) { ++mStatMemToUsingCount; tmpMemoryPool->clearNext(); } return tmpMemoryPool; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskStatus.cpp0000644000175000017500000000671712520551304023125 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskStatus.h" namespace Konclude { namespace Scheduler { CTaskStatus::CTaskStatus() { mTaskState = TSUNINITIALIZED; mCanceledFlag = false; mFinishedFlag = false; mReleaseable = true; mErrorFlag = false; mErrorCode = 0; } CTaskStatus::~CTaskStatus() { } CTaskStatus::TASKSTATE CTaskStatus::getTaskState() { return mTaskState; } CTaskStatus* CTaskStatus::setTaskState(TASKSTATE taskState) { mTaskState = taskState; return this; } CTaskStatus* CTaskStatus::setCanceled(bool canceled) { mCanceledFlag = canceled; return this; } CTaskStatus* CTaskStatus::setFinished(bool finished) { mFinishedFlag = finished; return this; } CTaskStatus* CTaskStatus::setError(bool error, cint64 errorCode) { mErrorFlag = error; mErrorCode = errorCode; return this; } CTaskStatus* CTaskStatus::setMemoryReleaseable(bool releaseable) { mReleaseable = releaseable; return this; } bool CTaskStatus::isFinished() { return mFinishedFlag; } bool CTaskStatus::isCanceled() { return mCanceledFlag; } bool CTaskStatus::isError() { return mErrorFlag; } bool CTaskStatus::isProcessable() { return !mCanceledFlag && !mFinishedFlag && !mErrorFlag; } cint64 CTaskStatus::getErrorCode() { return mErrorCode; } bool CTaskStatus::isTaskState(TASKSTATE taskState) { return mTaskState = taskState; } bool CTaskStatus::hasOneTaskState(TASKSTATE taskStateCompination) { return (mTaskState & taskStateCompination) != 0; } CTaskStatus* CTaskStatus::setTaskQUEUEDState() { mTaskState = TSQUEUED; return this; } CTaskStatus* CTaskStatus::setTaskPROCESSINGState() { mTaskState = TSPROCESSING; return this; } CTaskStatus* CTaskStatus::setTaskSCHEDULINGState() { mTaskState = TSSCHEDULING; return this; } CTaskStatus* CTaskStatus::setTaskCOMPLETEDState() { mTaskState = TSCOMPLETED; return this; } CTaskStatus* CTaskStatus::setTaskFINISHEDState() { mTaskState = TSFINISHED; return this; } bool CTaskStatus::isTaskStateQUEUED() { return mTaskState == TSQUEUED; } bool CTaskStatus::isTaskStatePROCESSING() { return mTaskState == TSPROCESSING; } bool CTaskStatus::isTaskStateSCHEDULING() { return mTaskState == TSSCHEDULING; } bool CTaskStatus::isTaskStateFINISHED() { return mTaskState == TSFINISHED; } bool CTaskStatus::isTaskStateCOMPLETED() { return mTaskState == TSCOMPLETED; } bool CTaskStatus::isTaskStateUNINITIALIZED() { return mTaskState == TSUNINITIALIZED; } bool CTaskStatus::isMemoryReleaseable() { return mReleaseable; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveQueue.cpp0000644000175000017500000000174612520551304024257 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskReserveQueue.h" namespace Konclude { namespace Scheduler { CTaskReserveQueue::CTaskReserveQueue() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessorSchedulerThread.cpp0000644000175000017500000004756712520551302026616 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskProcessorSchedulerThread.h" namespace Konclude { namespace Scheduler { CTaskProcessorSchedulerThread::CTaskProcessorSchedulerThread(CTaskHandleAlgorithm* taskHandleAlgo, CTaskEventHandlerBasedDistributionCompletor* distributorCompletor, CConsiderateMemoryPoolProvider* memoryPoolProvider) : CTaskProcessorThreadBase(taskHandleAlgo,"TaskProcesserSchedulerThread") { mDistributorCompletorCommunicator = new CTaskDistributionCompletorCommunicator(distributorCompletor,this); mMemoryPoolReleaser = new CEventDistributionMemoryPoolReleaser(mDistributorCompletorCommunicator); mMemoryPoolProvider = memoryPoolProvider; if (!mMemoryPoolProvider) { //mMemoryPoolProvider = distributorCompletor->createDistributionMemoryPoolProvider(mMemoryPoolReleaser); mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); } mMemoryAllocator = new CTaskHandleLimitedReserveMemoryPoolAllocationManager(mMemoryPoolProvider,300,30); mTaskProcessorContext = new CTaskProcessorContextBase(this,mMemoryAllocator); mFreeSchedulerItemLinker = nullptr; mWaitingSchedulerItemLinker = nullptr; mSchedulerCommunicatorLinker = nullptr; mRequestingTaskCount = 0; mDeliveringWaitingCount = 0; mRequiresTaskDispenseNotification = false; mSchedulerDispenseNotificationTag = 0; mDispenseNotificationTag = 0; mProcessorWithCriticalScheduleTask = false; mSchedulerCommunicator = nullptr; mLastScheduledTask = nullptr; mTaskReserveQueue = new CTaskReserveArrayQueue(10000); mTaskReserveQueueController = nullptr; //mTaskReserveQueue = new CTaskReserveMultiArrayQueue(10000); //mTaskReserveQueueController = new CTaskReserveMultiArrayQueueAdderController(mTaskReserveQueue); } CTaskProcessorSchedulerThread::~CTaskProcessorSchedulerThread() { } bool CTaskProcessorSchedulerThread::requiresSchedulingTasks() { return false; } CTaskReserveQueue* CTaskProcessorSchedulerThread::getTaskReserveQueue() { return mTaskReserveQueue; } CTaskReserveQueueAdder* CTaskProcessorSchedulerThread::createTaskReserveQueueAdder() { if (mTaskReserveQueueController) { return mTaskReserveQueueController->createTaskReserveQueueAdder(); } else { return nullptr; } } bool CTaskProcessorSchedulerThread::requiresTaskDispenseNotification(cint64 &updateDispenseNotificationTag) { bool requiresNotification = updateDispenseNotificationTag != mSchedulerDispenseNotificationTag; updateDispenseNotificationTag = mSchedulerDispenseNotificationTag; return requiresNotification; } CTaskSchedulerCommunicator* CTaskProcessorSchedulerThread::createSchedulerProcessorCommunication(CTaskEventHandlerBasedProcessor* taskProcessor) { CConcreteTaskSchedulerCommunicator* taskSchedulerCommunicator = new CConcreteTaskSchedulerCommunicator(this,taskProcessor); mCreateCommunicatorSyncMutex.lock(); mSchedulerCommunicatorLinker = new CXLinker(taskSchedulerCommunicator,mSchedulerCommunicatorLinker); mCreateCommunicatorSyncMutex.unlock(); return taskSchedulerCommunicator; } CTaskReserveQueueConsumer* CTaskProcessorSchedulerThread::createTaskReserveQueueConsumer(CTaskEventHandlerBasedProcessor* taskProcessor) { CTaskReserveQueueConsumer* consumer = nullptr; if (mConfUseReserveTasksQueue && mTaskReserveQueue) { consumer = mTaskReserveQueue->createTaskReserveQueueConsumer(); } return consumer; } CTaskEventHandlerBasedProcessor* CTaskProcessorSchedulerThread::installScheduler(CTaskEventHandlerBasedScheduler* scheduler) { mTaskReserveQueueConsumer = scheduler->createTaskReserveQueueConsumer(this); CTaskSchedulerCommunicator* schedulerCommunicator = scheduler->createSchedulerProcessorCommunication(this); installSchedulerCommunicator(schedulerCommunicator); return this; } CTaskProcessorSchedulerThread* CTaskProcessorSchedulerThread::installSchedulerCommunicator(CTaskSchedulerCommunicator* schedulerCommunicator) { mSchedulerCommunicator = schedulerCommunicator; processSchedulerRequestProcessTask(mSchedulerCommunicator); return this; } bool CTaskProcessorSchedulerThread::processEvent(CEvent *event, CContext* handlerContext) { mLastProcessedEvent = event; cint64 eventID = event->getEventTypeID(); if (eventID == CSendTaskScheduleEvent::EVENTTYPEID) { CTask* taskIt = ((CSendTaskScheduleEvent*)event)->getTask(); while (taskIt) { CTask* task = taskIt; taskIt = taskIt->getNext(); task->clearNext(); processSchedulerScheduleTask(task,true); } mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else if (eventID == CRequestProcessTaskEvent::EVENTTYPEID) { CRequestProcessTaskEvent* reqEvent = (CRequestProcessTaskEvent*)event; processSchedulerRequestProcessTask(reqEvent->getCommunicator()); mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else if (eventID == CTaskDispenseNotificationEvent::EVENTTYPEID) { CTaskDispenseNotificationEvent* disNotEvent = (CTaskDispenseNotificationEvent*)event; processSchedulerDispenseNotification(disNotEvent->getCommunicator()); mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else if (eventID == CCriticalScheduleTaskEvent::EVENTTYPEID) { CCriticalScheduleTaskEvent* criticalScheduleTasksEvent = (CCriticalScheduleTaskEvent*)event; processSchedulingScheduleTasks(); mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else if (eventID == CResponseScheduleTaskEvent::EVENTTYPEID) { CResponseScheduleTaskEvent* resEvent = (CResponseScheduleTaskEvent*)event; processSchedulerResponseScheduleTask(resEvent->getTask(),resEvent->getCommunicator(),resEvent->getTaskScheduleItem(),resEvent->isSchedulingTask()); mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else if (CTaskProcessorThreadBase::processEvent(event,handlerContext)) { return true; } else { // not supported } return false; } bool CTaskProcessorSchedulerThread::processUpdateTaskStatus(CTask* updateTask) { CTask* parentTask = updateTask->getParentTask(); if (!parentTask || parentTask->hasNoTaskOwnerAndNoParentTask() || parentTask->hasTaskOwner(this)) { // update status local bool downProp = false; bool upProp = false; if (mTaskStatusPropagator && mTaskStatusPropagator->updateTaskStatus(updateTask,downProp,upProp)) { if (downProp) { // update task status local CXNegLinker* refTaskIt = updateTask->getReferencedTaskLinker(); while (refTaskIt) { if (refTaskIt->isNegated()) { // task still exists, update task status // TODO: check better not recursive? CTask* refTask = refTaskIt->getData(); processUpdateTaskStatus(refTask); } refTaskIt = refTaskIt->getNext(); } } if (upProp && parentTask) { processUpdateTaskStatus(parentTask); } } } else { mDistributorCompletorCommunicator->communicateAlignedUpdateTaskStatus(updateTask,mMemoryAllocator); } return true; } bool CTaskProcessorSchedulerThread::processUpdateTaskStatus(CTask* parentTask, CTask* updateTask) { if (parentTask->hasNoTaskOwnerAndNoParentTask() || parentTask->hasTaskOwner(this)) { // local task status update // check whether task is completed bool taskCompleted = false; CXNegLinker* refTaskLinkerIt = parentTask->getReferencedTaskLinker(); while (refTaskLinkerIt) { CTask* refTask = refTaskLinkerIt->getData(); if (refTask == updateTask) { if (!refTaskLinkerIt->isNegated()) { taskCompleted = true; } break; } refTaskLinkerIt = refTaskLinkerIt->getNext(); } if (!taskCompleted) { processUpdateTaskStatus(updateTask); } mDistributorCompletorCommunicator->communicateTaskStatusUpdated(parentTask,updateTask,true,mMemoryAllocator); } else { // delegate task update to processor unit CTaskOwner* taskOwner = parentTask->getTaskOwner(); bool scheduled = false; CXLinker* commLinkIt = mSchedulerCommunicatorLinker; while (commLinkIt) { CConcreteTaskSchedulerCommunicator* communicator = commLinkIt->getData(); if (communicator->hasTaskOwner(taskOwner)) { communicator->communicateUpdateTaskStatus(parentTask,updateTask,mMemoryAllocator); scheduled = true; break; } commLinkIt = commLinkIt->getNext(); } if (!scheduled) { mDistributorCompletorCommunicator->communicateTaskStatusUpdated(parentTask,updateTask,false,mMemoryAllocator); } } return true; } bool CTaskProcessorSchedulerThread::processSchedulerRequestProcessTask(CTaskSchedulerCommunicator* communicator) { if (!mFreeSchedulerItemLinker) { mFreeSchedulerItemLinker = new CConcreteTaskScheduleItem(); } CConcreteTaskScheduleItem* tmpTaskScheduleItem = mFreeSchedulerItemLinker; mFreeSchedulerItemLinker = mFreeSchedulerItemLinker->getNext(); tmpTaskScheduleItem->initTaskScheduleItem((CConcreteTaskSchedulerCommunicator*)communicator,mWaitingSchedulerItemLinker); mWaitingSchedulerItemLinker = tmpTaskScheduleItem; mDeliveringWaitingCount++; processTaskScheduling(); return true; } bool CTaskProcessorSchedulerThread::processSchedulerCriticalScheduleTask(CTaskSchedulerCommunicator* communicator) { mProcessorWithCriticalScheduleTask = true; processTaskScheduling(); return true; } bool CTaskProcessorSchedulerThread::processSchedulerResponseScheduleTask(CTask* task, CTaskSchedulerCommunicator* communicator, CTaskScheduleItem* taskScheduleItem, bool schedulingTask) { CConcreteTaskSchedulerCommunicator* concreteCommunicator = (CConcreteTaskSchedulerCommunicator*)communicator; concreteCommunicator->decRequestProcessingTask(); --mRequestingTaskCount; processSchedulerScheduleTask(task,schedulingTask); return true; } bool CTaskProcessorSchedulerThread::processTaskScheduling() { bool requestingTasks = false; bool canContinueRequestProcessTask = true; bool canContinueRequestScheduleTask = true; if (mConfUseReserveTasksQueue && mTaskReserveQueueConsumer && mWaitingSchedulerItemLinker) { CTask* task = nullptr; do { task = mTaskReserveQueueConsumer->getTask(); processSchedulerScheduleTask(task,true); } while (task && mWaitingSchedulerItemLinker); } while (canContinueRequestScheduleTask && mDeliveringWaitingCount > mRequestingTaskCount) { canContinueRequestScheduleTask = false; cint64 maxSchedTasks = 0; CConcreteTaskSchedulerCommunicator* maxSchedComm = nullptr; CXLinker* schedulerCommunicatorLinkerIt = mSchedulerCommunicatorLinker; while (schedulerCommunicatorLinkerIt && mDeliveringWaitingCount > mRequestingTaskCount) { CConcreteTaskSchedulerCommunicator* communicator = schedulerCommunicatorLinkerIt->getData(); cint64 schedTasks = communicator->getRequestUpdatedDispensableSchedulingTasksCount(); if (schedTasks > 0) { if (!maxSchedComm || schedTasks > maxSchedTasks) { maxSchedComm = communicator; maxSchedTasks = schedTasks; } } schedulerCommunicatorLinkerIt = schedulerCommunicatorLinkerIt->getNext(); } if (maxSchedComm) { maxSchedComm->communicateRequestScheduleTask(nullptr,mMemoryAllocator); maxSchedComm->incRequestProcessingTask(); canContinueRequestScheduleTask = true; ++mRequestingTaskCount; requestingTasks = true; } } while (canContinueRequestProcessTask && mDeliveringWaitingCount > mRequestingTaskCount) { canContinueRequestProcessTask = false; CXLinker* schedulerCommunicatorLinkerIt = mSchedulerCommunicatorLinker; while (schedulerCommunicatorLinkerIt && mDeliveringWaitingCount > mRequestingTaskCount) { CConcreteTaskSchedulerCommunicator* communicator = schedulerCommunicatorLinkerIt->getData(); if (mConfProcessingTasksDistribution && communicator->getRequestUpdatedDispensableProcessingAndSchedulingTasksCount() > 1) { communicator->communicateRequestScheduleTask(nullptr,mMemoryAllocator); communicator->incRequestProcessingTask(); canContinueRequestProcessTask = true; ++mRequestingTaskCount; requestingTasks = true; } schedulerCommunicatorLinkerIt = schedulerCommunicatorLinkerIt->getNext(); } } if (mDeliveringWaitingCount > mRequestingTaskCount) { ++mSchedulerDispenseNotificationTag; mRequiresTaskDispenseNotification = true; } else { mRequiresTaskDispenseNotification = false; } return requestingTasks; } bool CTaskProcessorSchedulerThread::processSchedulingScheduleTasks() { bool requiringSchedulingTask = true; if (mConfScheduleTasksDistribution) { while (requiringSchedulingTask && mTaskSchedulingCount > mCriticalSchedulingThresholdCount && mTaskSchedulingQueue) { requiringSchedulingTask = false; cint64 minSchedTasks = 1; CConcreteTaskSchedulerCommunicator* minSchedulerComm = nullptr; for (CXLinker* schedulerCommunicatorLinkerIt = mSchedulerCommunicatorLinker; schedulerCommunicatorLinkerIt && minSchedTasks > 0; schedulerCommunicatorLinkerIt = schedulerCommunicatorLinkerIt->getNext()) { CConcreteTaskSchedulerCommunicator* schedulerComm = schedulerCommunicatorLinkerIt->getData(); if (schedulerComm->requiresSchedulingTasks()) { requiringSchedulingTask = true; cint64 schedTasks = schedulerComm->getRequestUpdatedRemainingSchedulingTasksCount(); if (schedTasks <= mCriticalSchedulingThresholdCount) { if (!minSchedulerComm || schedTasks < minSchedTasks) { minSchedTasks = schedTasks; minSchedulerComm = schedulerComm; } } } } if (minSchedulerComm) { requiringSchedulingTask = true; CTask* task = mTaskSchedulingQueue; mTaskSchedulingQueue = mTaskSchedulingQueue->getNext(); --mTaskSchedulingCount; task->clearNext(); minSchedulerComm->communicateProcessTask(task,true,mMemoryAllocator); minSchedulerComm->incSendedTasks(); } } } return true; } bool CTaskProcessorSchedulerThread::processSchedulerScheduleTask(CTask* task, bool schedulingTask) { if (task) { if (mWaitingSchedulerItemLinker) { CConcreteTaskScheduleItem* concreteTaskScheduleItem = mWaitingSchedulerItemLinker; mWaitingSchedulerItemLinker = mWaitingSchedulerItemLinker->getNext(); CConcreteTaskSchedulerCommunicator* communicator = concreteTaskScheduleItem->getCommunicator(); communicator->communicateProcessTask(task,schedulingTask,mMemoryAllocator); communicator->incSendedTasks(); mLastScheduledTask = task; --mDeliveringWaitingCount; mFreeSchedulerItemLinker = concreteTaskScheduleItem->setNext(mFreeSchedulerItemLinker); } else { if (!schedulingTask) { addProcessingTask(task); } else { if (mConfUseReserveTasksQueue) { mTaskReserveQueue->tryAddTasks(task); ++mTaskReserveQueueCount; } if (task) { if (!mTaskProcessingQueue && !mTaskSchedulingQueue) { addProcessingTask(task); } else { mTaskSchedulingCount += task->getCount(); if (mTaskSchedulingQueue) { mTaskSchedulingQueue = task->append(mTaskSchedulingQueue); } else { mTaskSchedulingQueue = task; } if (mTaskSchedulingCount >= mCriticalSchedulingThresholdCount) { processSchedulingScheduleTasks(); } } } } } } return true; } bool CTaskProcessorSchedulerThread::processSchedulerDispenseNotification(CTaskSchedulerCommunicator* communicator) { processTaskScheduling(); return true; } bool CTaskProcessorSchedulerThread::processDispenseNotification() { if (canDispenseProcessingTasks() && requiresTaskDispenseNotification(mDispenseNotificationTag)) { processSchedulerDispenseNotification(mSchedulerCommunicator); } return true; } bool CTaskProcessorSchedulerThread::processRequestProcessTask() { processSchedulerRequestProcessTask(mSchedulerCommunicator); return true; } bool CTaskProcessorSchedulerThread::processCriticalScheduleTask() { return true; } bool CTaskProcessorSchedulerThread::processCompleteTask(CTask* task) { // try locale to complete task cint64 completedCount = 0; mTaskCompletionQueue = task->getLastListLink()->setNext(mTaskCompletionQueue); while (mTaskCompletionQueue) { CTask* completionTask = mTaskCompletionQueue; mTaskCompletionQueue = mTaskCompletionQueue->getNext(); if (completionTask && !completionTask->hasActiveReferencedTask()) { CTask* parentTask = completionTask->getParentTask(); if (!parentTask || parentTask->hasNoTaskOwnerAndNoParentTask() || parentTask->hasTaskOwner(this)) { // locale task completion bool upPropagation = false; if (mTaskStatusPropagator && mTaskStatusPropagator->completeTaskStatus(completionTask,upPropagation)) { if (parentTask && upPropagation) { processUpdateTaskStatus(parentTask); } } completionTask->completeTask(); completionTask->getTaskStatus()->setTaskCOMPLETEDState(); bool memoryReleaseable = completionTask->getTaskStatus()->isMemoryReleaseable(); if (parentTask) { parentTask->decActiveReferenceCount(); if (!parentTask->hasActiveReferencedTask()) { mTaskCompletionQueue = parentTask->setNext(mTaskCompletionQueue); } } if (completionTask) { // callbacks CCallbackData* callbackLinkerIt = completionTask->getCallbackLinker(); while (callbackLinkerIt) { CCallbackData* callback = callbackLinkerIt; callbackLinkerIt = callbackLinkerIt->getNext(); if (mCallbackExecuter) { mCallbackExecuter->executeCallback(completionTask,callback); INCTASKPROCESSINGSTAT(mStats.incStatisticCallbacksExecutedCount(1)); } else { callback->doCallback(); } } } #ifndef KONCLUDE_SCHEDULER_DEBUG_TASK_MEMORY_RELEASE if (memoryReleaseable) { mMemoryAllocator->releaseMemoryPoolContainer(completionTask); } #endif completedCount++; } else { // task completion by completer mDistributorCompletorCommunicator->communicateTaskComplete(completionTask,mMemoryAllocator); } } } INCTASKPROCESSINGSTAT(mStats.incStatisticTasksCompletedCount(completedCount)); return true; } bool CTaskProcessorSchedulerThread::processAdditionalTaskAllocation(CTask* task, CMemoryPool* memoryPool) { CTask* parentTask = task->getParentTask(); if (!parentTask || parentTask->hasNoTaskOwnerAndNoParentTask() || parentTask->hasTaskOwner(this)) { task->appendMemoryPool(memoryPool); } else { mDistributorCompletorCommunicator->communicateAdditionalAllocationTask(task,memoryPool,mMemoryAllocator); } return true; } bool CTaskProcessorSchedulerThread::processResponseScheduleTask(CTask* task, CTaskScheduleItem* taskScheduleItem, bool schedulingTask) { processSchedulerResponseScheduleTask(task,mSchedulerCommunicator,taskScheduleItem,schedulingTask); return true; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessorCompletorThread.h0000644000175000017500000001010412520551302026262 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKPROCESSORCOMPLETORTHREAD_H #define KONCLUDE_SCHEDULER_CTASKPROCESSORCOMPLETORTHREAD_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskProcessorThreadBase.h" #include "CTaskEventHandlerBasedDistributionCompletor.h" #include "CTaskHandleContext.h" #include "CTaskHandleMemoryAllocationManager.h" #include "CTaskHandleMemoryPoolAllocationManager.h" #include "CTaskHandleLimitedReserveMemoryPoolAllocationManager.h" #include "CTaskHandleAlgorithm.h" #include "CTaskProcessorContextBase.h" #include "CConcreteMemoryPoolDistributor.h" #include "CTaskSchedulerCommunicator.h" #include "CDirectDistributionMemoryPoolReleaser.h" // Other includes #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" #include "Utilities/Memory/CConsiderateMemoryPoolProvider.h" #include "Scheduler/Events/CTaskStatusUpdatedEvent.h" #include "Scheduler/Events/CAlignedUpdateTaskStatusEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Scheduler { using namespace Events; /*! * * \class CTaskProcessorCompletorThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskProcessorCompletorThread : public CTaskProcessorThreadBase, public CConcreteMemoryPoolDistributor, virtual public CTaskEventHandlerBasedDistributionCompletor { // public methods public: //! Constructor CTaskProcessorCompletorThread(CTaskHandleAlgorithm* taskHandleAlgo, CConsiderateMemoryPoolProvider* memoryPoolProvider = nullptr); //! Destructor virtual ~CTaskProcessorCompletorThread(); virtual CTaskEventHandlerBasedProcessor* installScheduler(CTaskEventHandlerBasedScheduler* scheduler); virtual CDistributionMemoryPoolProvider* createDistributionMemoryPoolProvider(CDistributionMemoryPoolReleaser* distributionMemoryReleaser); virtual CConcreteMemoryPoolDistributor* distributeMemoryPools(CMemoryPool* memoryPools); // protected methods protected: virtual CTaskProcessorCompletorThread* installSchedulerCommunicator(CTaskSchedulerCommunicator* schedulerCommunicator); virtual bool processEvent(CEvent *event, CContext* handlerContext); virtual bool processDispenseNotification(); virtual bool processRequestProcessTask(); virtual bool processCriticalScheduleTask(); virtual bool processCompleteTask(CTask* task); virtual bool processAdditionalTaskAllocation(CTask* task, CMemoryPool* memoryPool); virtual bool processResponseScheduleTask(CTask* task, CTaskScheduleItem* taskScheduleItem, bool schedulingTask); virtual bool processUpdateTaskStatus(CTask* task); virtual bool processUpdateTaskStatus(CTask* parentTask, CTask* updateTask); virtual bool processTaskStatusUpdated(CTask* parentTask, CTask* updatedTask, bool updateSuccess); // protected variables protected: CConsiderateMemoryPoolProvider* mMemoryPoolProvider; CDistributionMemoryPoolReleaser* mMemoryPoolReleaser; CTaskSchedulerCommunicator* mSchedulerCommunicator; cint64 mDispenseNotificationTag; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKPROCESSORCOMPLETORTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveMultiArrayQueue.cpp0000644000175000017500000000600712520551302026262 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskReserveMultiArrayQueue.h" namespace Konclude { namespace Scheduler { CTaskReserveMultiArrayQueue::CTaskReserveMultiArrayQueue(CTaskReserveArrayQueue* mainQueue) { mMainQueue = nullptr; mQueueLinker = nullptr; mConsumerLinker = nullptr; mQueuesCount = 0; if (!mainQueue) { mainQueue = new CTaskReserveArrayQueue(10000); } addTaskReserveArrayQueue(mainQueue); } CTaskReserveMultiArrayQueue* CTaskReserveMultiArrayQueue::addTaskReserveArrayQueue(CTaskReserveArrayQueue* queue) { CXLinker* queueLinker = new CXLinker(); queueLinker->initLinker(queue); mAddConsumerMutex.lock(); mQueueLinker = queueLinker->append(mQueueLinker); ++mQueuesCount; mAddConsumerMutex.unlock(); return this; } bool CTaskReserveMultiArrayQueue::tryAddTasks(CTask*& tasks) { bool taskAdded = mMainQueue->tryAddTasks(tasks); return taskAdded; } cint64 CTaskReserveMultiArrayQueue::getTaskCount() { cint64 taskCount = 0; for (CXLinker* queueLinkerIt = mQueueLinker; queueLinkerIt; queueLinkerIt = queueLinkerIt->getNext()) { CTaskReserveArrayQueue* queue = queueLinkerIt->getData(); taskCount += queue->getTaskCount(); } return taskCount; } bool CTaskReserveMultiArrayQueue::tryGetTask(CTask*& task) { for (CXLinker* queueLinkerIt = mQueueLinker; queueLinkerIt; queueLinkerIt = queueLinkerIt->getNext()) { CTaskReserveArrayQueue* queue = queueLinkerIt->getData(); if (queue->tryGetTask(task)) { return true; } } return false; } CTaskReserveQueueConsumer* CTaskReserveMultiArrayQueue::createTaskReserveQueueConsumer() { CTaskReserveMultiArrayQueueConsumer* consumer = new CTaskReserveMultiArrayQueueConsumer(this); mAddConsumerMutex.lock(); mConsumerLinker = consumer->append(mConsumerLinker); mAddConsumerMutex.unlock(); return consumer; } CXLinker* CTaskReserveMultiArrayQueue::getTaskReserveArrayQueueLinker() { return mQueueLinker; } cint64 CTaskReserveMultiArrayQueue::getTaskReserveArrayQueueCount() { return mQueuesCount; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveQueueConsumer.h0000644000175000017500000000324712520551304025436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKRESERVEQUEUECONSUMER_H #define KONCLUDE_SCHEDULER_CTASKRESERVEQUEUECONSUMER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTask.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskReserveQueueConsumer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskReserveQueueConsumer { // public methods public: //! Constructor CTaskReserveQueueConsumer(); virtual CTask* getTask() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKRESERVEQUEUECONSUMER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskEventHandlerBasedCompletor.h0000644000175000017500000000353112520551276026511 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKEVENTHANDLERBASEDCOMPLETOR_H #define KONCLUDE_SCHEDULER_CTASKEVENTHANDLERBASEDCOMPLETOR_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskCompletor.h" #include "CEventHandlerVendor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskEventHandlerBasedCompletor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskEventHandlerBasedCompletor : virtual public CTaskCompletor, virtual public CEventHandlerVendor { // public methods public: //! Constructor CTaskEventHandlerBasedCompletor(); //! Destructor virtual ~CTaskEventHandlerBasedCompletor(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKEVENTHANDLERBASEDCOMPLETOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskEventCommunicator.h0000644000175000017500000001610612520551276024752 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKEVENTCOMMUNICATOR_H #define KONCLUDE_SCHEDULER_CTASKEVENTCOMMUNICATOR_H // Library includes // Namespace includes #include "SchedulerSettings.h" // Other includes #include "Concurrent/CEventCommunicator.h" #include "Concurrent/CEventAllocator.h" #include "Scheduler/Events/CSendTaskProcessEvent.h" #include "Scheduler/Events/CSendTaskCompleteEvent.h" #include "Scheduler/Events/CSendTaskScheduleEvent.h" #include "Scheduler/Events/CRequestScheduleTaskEvent.h" #include "Scheduler/Events/CResponseScheduleTaskEvent.h" #include "Scheduler/Events/CRequestProcessTaskEvent.h" #include "Scheduler/Events/CTaskAdditionalAllocationEvent.h" #include "Scheduler/Events/CDistributeMemoryPoolEvent.h" #include "Scheduler/Events/CTaskDispenseNotificationEvent.h" #include "Scheduler/Events/CUpdateTaskStatusEvent.h" #include "Scheduler/Events/CTaskStatusUpdatedEvent.h" #include "Scheduler/Events/CAlignedUpdateTaskStatusEvent.h" #include "Scheduler/Events/CCriticalScheduleTaskEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Scheduler { using namespace Scheduler::Events; /*! * * \class CTaskEventCommunicator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskEventCommunicator : public CEventCommunicator { // public methods public: //! Constructor CTaskEventCommunicator(CEventHandler* eventHandler); //! Destructor virtual ~CTaskEventCommunicator(); CTaskEventCommunicator* postSendTaskProcessEvent(CTask* task, bool schedulerTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskEventCommunicator* postSendTaskCompleteEvent(CTask* task, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskEventCommunicator* postSendTaskScheduleEvent(CTask* task, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskEventCommunicator* postRequestScheduleTaskEvent(CTaskSchedulerCommunicator* communicator, CTaskScheduleItem* taskScheduleItem, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskEventCommunicator* postResponseScheduleTaskEvent(CTaskSchedulerCommunicator* communicator, CTaskScheduleItem* taskScheduleItem, CTask* task, bool schedulerTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskEventCommunicator* postRequestProcessTaskEvent(CTaskSchedulerCommunicator* communicator, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskEventCommunicator* postCriticalScheduleTaskEvent(CTaskSchedulerCommunicator* communicator, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskEventCommunicator* postAdditionalAllocationTaskEvent(CTask* task, CMemoryPool* memoryPools, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskEventCommunicator* postDistributeMemoryPoolsEvent(CMemoryPool* memoryPools, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskEventCommunicator* postDistributeMemoryPoolsEvent(CMemoryPool* memoryPools); CTaskEventCommunicator* postTaskDispenseNotificationEvent(CTaskSchedulerCommunicator* communicator, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskEventCommunicator* postUpdateTaskStatusEvent(CTask* parentTask, CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskEventCommunicator* postAlignedUpdateTaskStatusEvent(CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskEventCommunicator* postTaskStatusUpdatedEvent(CTask* parentTask, CTask* updatedTask, bool updateSuccess, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); static bool postSendTaskProcessEvent(CEventHandler* eventHandler, CTask* task, bool schedulerTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); static bool postSendTaskCompleteEvent(CEventHandler* eventHandler, CTask* task, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); static bool postSendTaskScheduleEvent(CEventHandler* eventHandler, CTask* task, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); static bool postRequestScheduleTaskEvent(CEventHandler* eventHandler, CTaskSchedulerCommunicator* communicator, CTaskScheduleItem* taskScheduleItem, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); static bool postResponseScheduleTaskEvent(CEventHandler* eventHandler, CTaskSchedulerCommunicator* communicator, CTaskScheduleItem* taskScheduleItem, CTask* task, bool schedulerTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); static bool postRequestProcessTaskEvent(CEventHandler* eventHandler, CTaskSchedulerCommunicator* communicator, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); static bool postCriticalScheduleTaskEvent(CEventHandler* eventHandler, CTaskSchedulerCommunicator* communicator, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); static bool postAdditionalAllocationTaskEvent(CEventHandler* eventHandler, CTask* task, CMemoryPool* memoryPools, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); static bool postDistributeMemoryPoolsEvent(CEventHandler* eventHandler, CMemoryPool* memoryPools, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); static bool postTaskDispenseNotificationEvent(CEventHandler* eventHandler, CTaskSchedulerCommunicator* communicator, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); static bool postUpdateTaskStatusEvent(CEventHandler* eventHandler, CTask* parentTask, CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); static bool postAlignedUpdateTaskStatusEvent(CEventHandler* eventHandler, CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); static bool postTaskStatusUpdatedEvent(CEventHandler* eventHandler, CTask* parentTask, CTask* updatedTask, bool updateSuccess, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); // protected methods protected: // protected variables protected: CMemoryPool* mTmpStoredMemoryPool; cint64 mPostedEventCount; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKEVENTCOMMUNICATOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskEventHandlerBasedDistributionCompletor.cpp0000644000175000017500000000223012520551276031437 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskEventHandlerBasedDistributionCompletor.h" namespace Konclude { namespace Scheduler { CTaskEventHandlerBasedDistributionCompletor::CTaskEventHandlerBasedDistributionCompletor() { } CTaskEventHandlerBasedDistributionCompletor::~CTaskEventHandlerBasedDistributionCompletor() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessorCommunicator.cpp0000644000175000017500000000210312520551300026157 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskProcessorCommunicator.h" namespace Konclude { namespace Scheduler { CTaskProcessorCommunicator::CTaskProcessorCommunicator() { } CTaskProcessorCommunicator::~CTaskProcessorCommunicator() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskEventCommunicator.cpp0000644000175000017500000005543712520551276025317 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskEventCommunicator.h" namespace Konclude { namespace Scheduler { CTaskEventCommunicator::CTaskEventCommunicator(CEventHandler* eventHandler) : CEventCommunicator(eventHandler) { mPostedEventCount = 0; mTmpStoredMemoryPool = nullptr; } CTaskEventCommunicator::~CTaskEventCommunicator() { } CTaskEventCommunicator* CTaskEventCommunicator::postSendTaskProcessEvent(CTask* task, bool schedulerTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CSendTaskProcessEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(sendEvent)) { CSendTaskProcessEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setSchedulingTask(schedulerTask); sendEvent->setTask(task); ++mPostedEventCount; CEventCommunicator::postEvent(sendEvent); return this; } CTaskEventCommunicator* CTaskEventCommunicator::postSendTaskCompleteEvent(CTask* task, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CSendTaskCompleteEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(sendEvent)) { CSendTaskCompleteEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setTask(task); ++mPostedEventCount; CEventCommunicator::postEvent(sendEvent); return this; } CTaskEventCommunicator* CTaskEventCommunicator::postSendTaskScheduleEvent(CTask* task, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CSendTaskScheduleEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(sendEvent)) { CSendTaskScheduleEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setTask(task); ++mPostedEventCount; CEventCommunicator::postEvent(sendEvent); return this; } CTaskEventCommunicator* CTaskEventCommunicator::postRequestScheduleTaskEvent(CTaskSchedulerCommunicator* communicator, CTaskScheduleItem* taskScheduleItem, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CRequestScheduleTaskEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(sendEvent)) { CRequestScheduleTaskEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setTaskScheduleItem(taskScheduleItem); sendEvent->setCommunicator(communicator); ++mPostedEventCount; CEventCommunicator::postEvent(sendEvent); return this; } CTaskEventCommunicator* CTaskEventCommunicator::postResponseScheduleTaskEvent(CTaskSchedulerCommunicator* communicator, CTaskScheduleItem* taskScheduleItem, CTask* task, bool schedulerTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CResponseScheduleTaskEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(sendEvent)) { CResponseScheduleTaskEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setTask(task); sendEvent->setTaskScheduleItem(taskScheduleItem); sendEvent->setCommunicator(communicator); sendEvent->setSchedulingTask(schedulerTask); ++mPostedEventCount; CEventCommunicator::postEvent(sendEvent); return this; } CTaskEventCommunicator* CTaskEventCommunicator::postRequestProcessTaskEvent(CTaskSchedulerCommunicator* communicator, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CRequestProcessTaskEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(sendEvent)) { CRequestProcessTaskEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setCommunicator(communicator); ++mPostedEventCount; CEventCommunicator::postEvent(sendEvent); return this; } CTaskEventCommunicator* CTaskEventCommunicator::postCriticalScheduleTaskEvent(CTaskSchedulerCommunicator* communicator, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CCriticalScheduleTaskEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(sendEvent)) { CCriticalScheduleTaskEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setCommunicator(communicator); ++mPostedEventCount; CEventCommunicator::postEvent(sendEvent); return this; } CTaskEventCommunicator* CTaskEventCommunicator::postAdditionalAllocationTaskEvent(CTask* task, CMemoryPool* memoryPools, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CTaskAdditionalAllocationEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(sendEvent)) { CTaskAdditionalAllocationEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setTask(task); sendEvent->setAdditionalAllocatedMemoryPools(memoryPools); ++mPostedEventCount; CEventCommunicator::postEvent(sendEvent); return this; } CTaskEventCommunicator* CTaskEventCommunicator::postDistributeMemoryPoolsEvent(CMemoryPool* memoryPools, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CDistributeMemoryPoolEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(sendEvent)) { CDistributeMemoryPoolEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setMemoryPools(memoryPools); ++mPostedEventCount; CEventCommunicator::postEvent(sendEvent); return this; } CTaskEventCommunicator* CTaskEventCommunicator::postDistributeMemoryPoolsEvent(CMemoryPool* memoryPools) { if (memoryPools) { CMemoryPool* memoryPool = memoryPools; memoryPools = memoryPools->getNextMemoryPool(); memoryPool->resetMemoryBlockPointer(); bool eventPostable = true; CDistributeMemoryPoolEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryPool); if (!CEventCommunicator::checkPostEvent(sendEvent)) { if (memoryPools) { CMemoryPool* newMemoryPool = memoryPools; newMemoryPool->resetMemoryBlockPointer(); memoryPools = memoryPools->getNextMemoryPool(); CDistributeMemoryPoolEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(newMemoryPool); memoryPools = memoryPool->setNext(memoryPools); sendEvent = newSendEvent; } else { mTmpStoredMemoryPool = memoryPool; eventPostable = false; } } if (eventPostable) { if (mTmpStoredMemoryPool) { memoryPools = mTmpStoredMemoryPool->setNextMemoryPool(memoryPools); } sendEvent->setMemoryPools(memoryPools); ++mPostedEventCount; CEventCommunicator::postEvent(sendEvent); } } return this; } CTaskEventCommunicator* CTaskEventCommunicator::postTaskDispenseNotificationEvent(CTaskSchedulerCommunicator* communicator, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CTaskDispenseNotificationEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(sendEvent)) { CTaskDispenseNotificationEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setCommunicator(communicator); ++mPostedEventCount; CEventCommunicator::postEvent(sendEvent); return this; } CTaskEventCommunicator* CTaskEventCommunicator::postUpdateTaskStatusEvent(CTask* parentTask, CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CUpdateTaskStatusEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(sendEvent)) { CUpdateTaskStatusEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setParentTask(parentTask); sendEvent->setUpdateTask(updateTask); ++mPostedEventCount; CEventCommunicator::postEvent(sendEvent); return this; } CTaskEventCommunicator* CTaskEventCommunicator::postAlignedUpdateTaskStatusEvent(CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CAlignedUpdateTaskStatusEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(sendEvent)) { CAlignedUpdateTaskStatusEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setUpdateTask(updateTask); ++mPostedEventCount; CEventCommunicator::postEvent(sendEvent); return this; } CTaskEventCommunicator* CTaskEventCommunicator::postTaskStatusUpdatedEvent(CTask* parentTask, CTask* updatedTask, bool updateSuccess, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CTaskStatusUpdatedEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(sendEvent)) { CTaskStatusUpdatedEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setParentTask(parentTask); sendEvent->setUpdatedTask(updatedTask); sendEvent->setUpdateSuccess(updateSuccess); ++mPostedEventCount; CEventCommunicator::postEvent(sendEvent); return this; } bool CTaskEventCommunicator::postSendTaskProcessEvent(CEventHandler* eventHandler, CTask* task, bool schedulerTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CSendTaskProcessEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(eventHandler,sendEvent)) { CSendTaskProcessEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setTask(task); sendEvent->setSchedulingTask(schedulerTask); CEventCommunicator::postEvent(eventHandler,sendEvent); return true; } bool CTaskEventCommunicator::postSendTaskCompleteEvent(CEventHandler* eventHandler, CTask* task, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CSendTaskCompleteEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(eventHandler,sendEvent)) { CSendTaskCompleteEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setTask(task); CEventCommunicator::postEvent(eventHandler,sendEvent); return true; } bool CTaskEventCommunicator::postSendTaskScheduleEvent(CEventHandler* eventHandler, CTask* task, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CSendTaskScheduleEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(eventHandler,sendEvent)) { CSendTaskScheduleEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setTask(task); CEventCommunicator::postEvent(eventHandler,sendEvent); return true; } bool CTaskEventCommunicator::postRequestScheduleTaskEvent(CEventHandler* eventHandler, CTaskSchedulerCommunicator* communicator, CTaskScheduleItem* taskScheduleItem, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CRequestScheduleTaskEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(eventHandler,sendEvent)) { CRequestScheduleTaskEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setTaskScheduleItem(taskScheduleItem); sendEvent->setCommunicator(communicator); CEventCommunicator::postEvent(eventHandler,sendEvent); return true; } bool CTaskEventCommunicator::postResponseScheduleTaskEvent(CEventHandler* eventHandler, CTaskSchedulerCommunicator* communicator, CTaskScheduleItem* taskScheduleItem, CTask* task, bool schedulerTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CResponseScheduleTaskEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(eventHandler,sendEvent)) { CResponseScheduleTaskEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setTask(task); sendEvent->setTaskScheduleItem(taskScheduleItem); sendEvent->setCommunicator(communicator); sendEvent->setSchedulingTask(schedulerTask); CEventCommunicator::postEvent(eventHandler,sendEvent); return true; } bool CTaskEventCommunicator::postRequestProcessTaskEvent(CEventHandler* eventHandler, CTaskSchedulerCommunicator* communicator, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CRequestProcessTaskEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(eventHandler,sendEvent)) { CRequestProcessTaskEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setCommunicator(communicator); CEventCommunicator::postEvent(eventHandler,sendEvent); return true; } bool CTaskEventCommunicator::postCriticalScheduleTaskEvent(CEventHandler* eventHandler, CTaskSchedulerCommunicator* communicator, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CCriticalScheduleTaskEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(eventHandler,sendEvent)) { CCriticalScheduleTaskEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setCommunicator(communicator); CEventCommunicator::postEvent(eventHandler,sendEvent); return true; } bool CTaskEventCommunicator::postAdditionalAllocationTaskEvent(CEventHandler* eventHandler, CTask* task, CMemoryPool* memoryPools, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CTaskAdditionalAllocationEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(eventHandler,sendEvent)) { CTaskAdditionalAllocationEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setTask(task); sendEvent->setAdditionalAllocatedMemoryPools(memoryPools); CEventCommunicator::postEvent(eventHandler,sendEvent); return true; } bool CTaskEventCommunicator::postDistributeMemoryPoolsEvent(CEventHandler* eventHandler, CMemoryPool* memoryPools, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CDistributeMemoryPoolEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(eventHandler,sendEvent)) { CDistributeMemoryPoolEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setMemoryPools(memoryPools); CEventCommunicator::postEvent(eventHandler,sendEvent); return true; } bool CTaskEventCommunicator::postTaskDispenseNotificationEvent(CEventHandler* eventHandler, CTaskSchedulerCommunicator* communicator, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CTaskDispenseNotificationEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(eventHandler,sendEvent)) { CTaskDispenseNotificationEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setCommunicator(communicator); CEventCommunicator::postEvent(eventHandler,sendEvent); return true; } bool CTaskEventCommunicator::postUpdateTaskStatusEvent(CEventHandler* eventHandler, CTask* parentTask, CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CUpdateTaskStatusEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(eventHandler,sendEvent)) { CUpdateTaskStatusEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setParentTask(parentTask); sendEvent->setUpdateTask(updateTask); CEventCommunicator::postEvent(eventHandler,sendEvent); return true; } bool CTaskEventCommunicator::postAlignedUpdateTaskStatusEvent(CEventHandler* eventHandler, CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CAlignedUpdateTaskStatusEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(eventHandler,sendEvent)) { CAlignedUpdateTaskStatusEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setUpdateTask(updateTask); CEventCommunicator::postEvent(eventHandler,sendEvent); return true; } bool CTaskEventCommunicator::postTaskStatusUpdatedEvent(CEventHandler* eventHandler, CTask* parentTask, CTask* updatedTask, bool updateSuccess, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { CTaskStatusUpdatedEvent* sendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); if (!CEventCommunicator::checkPostEvent(eventHandler,sendEvent)) { CTaskStatusUpdatedEvent* newSendEvent = CEventAllocator::allocateAndConstructEvent(memoryTmpAllocatorManager); memoryTmpAllocatorManager->releaseMemoryPoolContainer(sendEvent); sendEvent = newSendEvent; } sendEvent->setParentTask(parentTask); sendEvent->setUpdatedTask(updatedTask); sendEvent->setUpdateSuccess(updateSuccess); CEventCommunicator::postEvent(eventHandler,sendEvent); return true; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CConcreteMemoryPoolDistributor.h0000644000175000017500000000523612520551272026503 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CCONCRETEMEMORYPOOLDISTRIBUTOR_H #define KONCLUDE_SCHEDULER_CCONCRETEMEMORYPOOLDISTRIBUTOR_H // Libraries includes #include // Namespace includes #include "SchedulerSettings.h" #include "CDistributionMemoryPoolProvider.h" #include "CDistributionMemoryPoolReleaser.h" #include "CMemoryPoolDistributor.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Scheduler { /*! * * \class CConcreteMemoryPoolDistributor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteMemoryPoolDistributor : public CMemoryPoolDistributor { // public methods public: //! Constructor CConcreteMemoryPoolDistributor(CMemoryPoolProvider* alternateMemoryPoolProvider); //! Destructor virtual ~CConcreteMemoryPoolDistributor(); virtual CDistributionMemoryPoolProvider* createDistributionMemoryPoolProvider(CDistributionMemoryPoolReleaser* distributionMemoryReleaser); virtual CConcreteMemoryPoolDistributor* distributeMemoryPools(CMemoryPool* memoryPools); // protected methods protected: // protected variables protected: QMutex mCreateProviderSyncLock; CMemoryPoolProvider* mAlternateMemoryPoolProvider; CMemoryPoolProvider* mDeleteAlternateMemoryPoolProvider; CDistributionMemoryPoolProvider* mAddedProviderLinker; CDistributionMemoryPoolProvider* mLastAddedProviderLinker; CDistributionMemoryPoolProvider* mProviderLinker; CMemoryPool* mTmpStoredMemoryPools; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CCONCRETEMEMORYPOOLDISTRIBUTOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskEventHandlerBasedProcessor.cpp0000644000175000017500000000213412520551276027055 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskEventHandlerBasedProcessor.h" namespace Konclude { namespace Scheduler { CTaskEventHandlerBasedProcessor::CTaskEventHandlerBasedProcessor() { } CTaskEventHandlerBasedProcessor::~CTaskEventHandlerBasedProcessor() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CMemoryPoolDistributor.cpp0000644000175000017500000000206012520551274025345 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMemoryPoolDistributor.h" namespace Konclude { namespace Scheduler { CMemoryPoolDistributor::CMemoryPoolDistributor() { } CMemoryPoolDistributor::~CMemoryPoolDistributor() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskMemoryPoolAllocationManager.cpp0000644000175000017500000001477412520551300027243 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskMemoryPoolAllocationManager.h" namespace Konclude { namespace Scheduler { CTaskMemoryPoolAllocationManager::CTaskMemoryPoolAllocationManager(CMemoryPoolContainer* memoryPoolContainer, CConsiderateMemoryPoolProvider* memoryPoolProvider) { mMemoryPoolContainer = memoryPoolContainer; mMemoryPoolProvider = memoryPoolProvider; mStatPoolAllocCount = 0; mStatAllocPoolSize = 0; } CTaskMemoryPoolAllocationManager::CTaskMemoryPoolAllocationManager() { mMemoryPoolContainer = nullptr; mMemoryPoolProvider = nullptr; mStatPoolAllocCount = 0; mStatAllocPoolSize = 0; } CTaskMemoryPoolAllocationManager::~CTaskMemoryPoolAllocationManager() { } CTaskMemoryPoolAllocationManager* CTaskMemoryPoolAllocationManager::initTaskMemoryPoolAllocationManager(CMemoryPoolContainer* memoryPoolContainer, CConsiderateMemoryPoolProvider* memoryPoolProvider) { mMemoryPoolContainer = memoryPoolContainer; mMemoryPoolProvider = memoryPoolProvider; mStatPoolAllocCount = 0; mStatAllocPoolSize = 0; return this; } CTaskMemoryAllocationManager* CTaskMemoryPoolAllocationManager::updateMemoryProvider(CConsiderateMemoryPoolProvider* memoryPoolProvider) { mMemoryPoolProvider = memoryPoolProvider; return this; } void* CTaskMemoryPoolAllocationManager::allocate(size_t size) { void* memPtr = 0; char* memBlock = 0; if (size >= 8) { memBlock = getMemoryBlock(size*sizeof(char),8); } else if (size >= 4) { memBlock = getMemoryBlock(size*sizeof(char),4); } else if (size >= 2) { memBlock = getMemoryBlock(size*sizeof(char),2); } else { memBlock = getMemoryBlock(size*sizeof(char)); } memPtr = memBlock; return memPtr; } CMemoryAllocationManager* CTaskMemoryPoolAllocationManager::release(void* address) { // not supported by this pool memory manager, stored all memory in memory pool container return this; } void* CTaskMemoryPoolAllocationManager::allocateAligned(size_t size, int alignment) { void* memPtr = 0; char* memBlock = getMemoryBlock(size*sizeof(char),alignment); memPtr = memBlock; return memPtr; } char* CTaskMemoryPoolAllocationManager::getMemoryBlock(cint64 memoryBlockSize) { char* memBlock = 0; bool allocated = false; CMemoryPool* memoryPool = mMemoryPoolContainer->getMemoryPools(); while (!allocated) { if (!memoryPool) { memoryPool = mMemoryPoolProvider->acquireMemoryPoolConsiderated(memoryBlockSize); ++mStatPoolAllocCount; if (memoryPool) { mStatAllocPoolSize += memoryPool->getMemoryBlockSize(); mMemoryPoolContainer->appendMemoryPool(memoryPool); } } if (memoryPool) { char* memBlockEnd = memoryPool->getMemoryBlockEnd(); char* memBlockPointer = memoryPool->getMemoryBlockPointer(); if (memBlockPointer+memoryBlockSize <= memBlockEnd) { memBlock = memBlockPointer; memoryPool->setMemoryBlockPointer(memBlockPointer+memoryBlockSize); allocated = true; } else { memoryPool = nullptr; } } } return memBlock; } cint64 CTaskMemoryPoolAllocationManager::getOptimizedMoreAllocationSize(cint64 size) { CMemoryPool* memoryPool = mMemoryPoolContainer->getMemoryPools(); if (memoryPool) { cint64 availableSizeThisPool = memoryPool->getMemoryBlockEnd() - memoryPool->getMemoryBlockData(); if (availableSizeThisPool >= size) { return qMax(availableSizeThisPool,size<<2); } else if (memoryPool->getMemoryBlockSize() >= size) { return qMax(memoryPool->getMemoryBlockSize(),size<<2); } } return size; } char* CTaskMemoryPoolAllocationManager::getMemoryBlock(cint64 memoryBlockSize, cint64 alignment) { char* memBlock = 0; bool allocated = false; CMemoryPool* memoryPool = mMemoryPoolContainer->getMemoryPools(); while (!allocated) { if (!memoryPool) { memoryPool = mMemoryPoolProvider->acquireMemoryPoolConsiderated(memoryBlockSize+alignment); ++mStatPoolAllocCount; if (memoryPool) { mStatAllocPoolSize += memoryPool->getMemoryBlockSize(); mMemoryPoolContainer->appendMemoryPool(memoryPool); } } if (memoryPool) { char* memBlockEnd = memoryPool->getMemoryBlockEnd(); char* memBlockPointer = memoryPool->getMemoryBlockPointer(); cint64 maxBlockAlloc = (cint64)(memBlockPointer)+(cint64)(memoryBlockSize+alignment); if (maxBlockAlloc <= (cint64)memBlockEnd) { // alignment is 2^N cint64 alignmentMask = alignment-1; memBlock = memBlockPointer; if (alignmentMask & cint64(memBlock)) { memBlock = (char*)((cint64(memBlock) & ~alignmentMask) + alignment); } memoryPool->setMemoryBlockPointer(memBlock+memoryBlockSize); allocated = true; } else { memoryPool = nullptr; } } } return memBlock; } void* CTaskMemoryPoolAllocationManager::allocateMemoryToContainer(size_t size, CMemoryPoolContainer* memoryPoolContainer, CMemoryPoolProvider* memoryPoolProvider) { cint64 memoryBlockSize = size; char* memBlock = 0; bool allocated = false; CMemoryPool* memoryPool = memoryPoolContainer->getMemoryPools(); while (!allocated) { if (!memoryPool) { memoryPool = memoryPoolProvider->acquireMemoryPool(memoryBlockSize); memoryPoolContainer->appendMemoryPool(memoryPool); } if (memoryPool) { char* memBlockEnd = memoryPool->getMemoryBlockEnd(); char* memBlockPointer = memoryPool->getMemoryBlockPointer(); if (memBlockPointer+memoryBlockSize <= memBlockEnd) { memBlock = memBlockPointer; memoryPool->setMemoryBlockPointer(memBlockPointer+memoryBlockSize); allocated = true; } else { memoryPool = nullptr; } } } return memBlock; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskMemoryPoolAllocationManager.h0000644000175000017500000000612112520551300026673 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKMEMORYPOOLALLOCATIONMANAGER_H #define KONCLUDE_SCHEDULER_CTASKMEMORYPOOLALLOCATIONMANAGER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskMemoryAllocationManager.h" // Other includes #include "Utilities/Memory/CMemoryPoolContainer.h" #include "Utilities/Memory/CMemoryPoolProvider.h" #include "Utilities/Memory/CConsiderateMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Memory; namespace Scheduler { /*! * * \class CTaskMemoryPoolAllocationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskMemoryPoolAllocationManager : public CTaskMemoryAllocationManager { // public methods public: //! Constructor CTaskMemoryPoolAllocationManager(CMemoryPoolContainer* memoryPoolContainer, CConsiderateMemoryPoolProvider* memoryPoolProvider); CTaskMemoryPoolAllocationManager(); //! Destructor virtual ~CTaskMemoryPoolAllocationManager(); CTaskMemoryPoolAllocationManager* initTaskMemoryPoolAllocationManager(CMemoryPoolContainer* memoryPoolContainer, CConsiderateMemoryPoolProvider* memoryPoolProvider); virtual CTaskMemoryAllocationManager* updateMemoryProvider(CConsiderateMemoryPoolProvider* memoryPoolProvider); virtual CMemoryAllocationManager* release(void* address); virtual void* allocate(size_t size); virtual void* allocateAligned(size_t size, int alignment); virtual cint64 getOptimizedMoreAllocationSize(cint64 size); static void* allocateMemoryToContainer(size_t size, CMemoryPoolContainer* memoryPoolContainer, CMemoryPoolProvider* memoryPoolProvider); // protected methods protected: char* getMemoryBlock(cint64 memoryBlockSize); char* getMemoryBlock(cint64 memoryBlockSize, cint64 alignment); // protected variables protected: CConsiderateMemoryPoolProvider* mMemoryPoolProvider; CMemoryPoolContainer* mMemoryPoolContainer; cint64 mStatPoolAllocCount; cint64 mStatAllocPoolSize; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKMEMORYPOOLALLOCATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskSchedulerCommunicator.h0000644000175000017500000000735012520551304025600 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKSCHEDULERCOMMUNICATOR_H #define KONCLUDE_SCHEDULER_CTASKSCHEDULERCOMMUNICATOR_H // Library includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskEventHandlerBasedScheduler.h" #include "CTaskEventHandlerBasedProcessor.h" #include "CTaskEventCommunicator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskSchedulerCommunicator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskSchedulerCommunicator { // public methods public: //! Constructor CTaskSchedulerCommunicator(CTaskEventHandlerBasedScheduler* taskScheduler, CTaskEventHandlerBasedProcessor* taskProcessor); //! Destructor virtual ~CTaskSchedulerCommunicator(); // calls to task scheduler CTaskSchedulerCommunicator* communicateResponseScheduleTask(CTaskScheduleItem* taskScheduleItem, CTask* task, bool schedulingTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskSchedulerCommunicator* communicateRequestProcessTask(CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskSchedulerCommunicator* communicateCriticalScheduleTask(CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskSchedulerCommunicator* communicateTaskDispenseNotification(CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskSchedulerCommunicator* communicateScheduleUpdateTaskStatus(CTask* parentTask, CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); bool requiresTaskDispenseNotification(cint64 &dispenseNotificationTag); // calls to task processor CTaskSchedulerCommunicator* communicateProcessTask(CTask* task, bool schedulingTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskSchedulerCommunicator* communicateRequestScheduleTask(CTaskScheduleItem* taskScheduleItem, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); CTaskSchedulerCommunicator* communicateUpdateTaskStatus(CTask* parentTask, CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager); bool canDispenseProcessingTasks(); bool requiresProcessingTasks(); cint64 countDispensableProcessingTasks(); cint64 countScheduleableProcessingTasks(); bool requiresSchedulingTasks(); bool hasTaskOwner(CTaskOwner* taskOwner); cint64 getRecievedTasks(); // protected methods protected: // protected variables protected: CTaskEventCommunicator mSchedulerTaskEventCommunicator; CTaskEventCommunicator mProcessorTaskEventCommunicator; CTaskEventHandlerBasedScheduler* mTaskScheduler; CTaskEventHandlerBasedProcessor* mTaskProcessor; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKSCHEDULERCOMMUNICATOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskCallbackExecuter.cpp0000644000175000017500000000205212520551274025035 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskCallbackExecuter.h" namespace Konclude { namespace Scheduler { CTaskCallbackExecuter::CTaskCallbackExecuter() { } CTaskCallbackExecuter::~CTaskCallbackExecuter() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveArrayQueue.cpp0000644000175000017500000000531312520551302025246 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskReserveArrayQueue.h" namespace Konclude { namespace Scheduler { CTaskReserveArrayQueue::CTaskReserveArrayQueue(cint64 vectorSize) : mTaskVector(vectorSize) { mVectorSize = vectorSize; for (cint64 i = 0; i < mVectorSize; ++i) { cint64 ind1 = getIndex(i); cint64 ind2 = getIndex(i+1); CTaskReserveArrayQueueItem* item1 = &mTaskVector[ind1]; CTaskReserveArrayQueueItem* item2 = &mTaskVector[ind2]; item1->setNext(item2); } mNextItem = 0; mLastItem = 0; mConsumerLinker = nullptr; } bool CTaskReserveArrayQueue::tryAddTasks(CTask*& tasks) { bool taskAdded = false; bool canAddMoreTasks = true; while (tasks && canAddMoreTasks) { if (mLastItem - mNextItem < mVectorSize) { CTask* tmpTask = tasks; tasks = tasks->getNext(); tmpTask->clearNext(); CTaskReserveArrayQueueItem* item = &mTaskVector[getIndex(mLastItem)]; if (!item->trySetTask(tmpTask)) { tasks = tmpTask->append(tasks); } else { taskAdded = true; } ++mLastItem; } else { canAddMoreTasks = false; } } return taskAdded; } cint64 CTaskReserveArrayQueue::getTaskCount() { return mLastItem - mNextItem; } bool CTaskReserveArrayQueue::tryGetTask(CTask*& task) { task = nullptr; cint64 nextItem = mNextItem; if (nextItem == mLastItem) { return false; } cint64 index = getIndex(nextItem++); CTaskReserveArrayQueueItem* item = &mTaskVector[index]; task = item->tryGetTask(); mNextItem = nextItem; return task != nullptr; } CTaskReserveQueueConsumer* CTaskReserveArrayQueue::createTaskReserveQueueConsumer() { CTaskReserveArrayQueueConsumer* consumer = new CTaskReserveArrayQueueConsumer(this); mAddConsumerMutex.lock(); mConsumerLinker = consumer->append(mConsumerLinker); mAddConsumerMutex.unlock(); return consumer; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CConcreteTaskSchedulerCommunicator.cpp0000644000175000017500000000462012520551272027617 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteTaskSchedulerCommunicator.h" namespace Konclude { namespace Scheduler { CConcreteTaskSchedulerCommunicator::CConcreteTaskSchedulerCommunicator(CTaskEventHandlerBasedScheduler* taskScheduler, CTaskEventHandlerBasedProcessor* taskProcessor) : CTaskSchedulerCommunicator(taskScheduler,taskProcessor) { mRequestCount = 0; mSendedSchedulingTaskCount = 0; } CConcreteTaskSchedulerCommunicator::~CConcreteTaskSchedulerCommunicator() { } CConcreteTaskSchedulerCommunicator* CConcreteTaskSchedulerCommunicator::incRequestProcessingTask(cint64 incCount) { mRequestCount += incCount; return this; } CConcreteTaskSchedulerCommunicator* CConcreteTaskSchedulerCommunicator::decRequestProcessingTask(cint64 decCount) { mRequestCount -= decCount; return this; } cint64 CConcreteTaskSchedulerCommunicator::getRequestUpdatedDispensableProcessingAndSchedulingTasksCount() { return countDispensableProcessingTasks()-mRequestCount; } cint64 CConcreteTaskSchedulerCommunicator::getRequestUpdatedDispensableSchedulingTasksCount() { return countScheduleableProcessingTasks()-mRequestCount; } cint64 CConcreteTaskSchedulerCommunicator::getRequestUpdatedRemainingSchedulingTasksCount() { cint64 transitTasksCount = mSendedSchedulingTaskCount - getRecievedTasks(); return countScheduleableProcessingTasks()-mRequestCount+transitTasksCount; } CConcreteTaskSchedulerCommunicator* CConcreteTaskSchedulerCommunicator::incSendedTasks(cint64 incCount) { mSendedSchedulingTaskCount += incCount; return this; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskOwner.h0000644000175000017500000000310512520551300022361 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKOWNER_H #define KONCLUDE_SCHEDULER_CTASKOWNER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskOwner * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskOwner { // public methods public: //! Constructor CTaskOwner(); //! Destructor virtual ~CTaskOwner(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKOWNER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessorSchedulerThread.h0000644000175000017500000001316712520551302026250 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKPROCESSORSCHEDULERTHREAD_H #define KONCLUDE_SCHEDULER_CTASKPROCESSORSCHEDULERTHREAD_H // Libraries includes #include // Namespace includes #include "SchedulerSettings.h" #include "CTaskProcessorThreadBase.h" #include "CTaskEventHandlerBasedScheduler.h" #include "CTaskHandleContext.h" #include "CTaskHandleMemoryAllocationManager.h" #include "CTaskHandleMemoryPoolAllocationManager.h" #include "CTaskHandleLimitedReserveMemoryPoolAllocationManager.h" #include "CTaskHandleAlgorithm.h" #include "CTaskProcessorContextBase.h" #include "CTaskDistributionCompletorCommunicator.h" #include "CConcreteTaskScheduleItem.h" #include "CEventDistributionMemoryPoolReleaser.h" #include "CTaskReserveArrayQueue.h" #include "CTaskReserveMultiArrayQueueAdderController.h" // Other includes #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" #include "Utilities/Memory/CMemoryPoolProvider.h" #include "Scheduler/Events/CTaskDispenseNotificationEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Scheduler { using namespace Events; /*! * * \class CTaskProcessorSchedulerThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskProcessorSchedulerThread : public CTaskProcessorThreadBase, public CTaskEventHandlerBasedScheduler { // public methods public: //! Constructor CTaskProcessorSchedulerThread(CTaskHandleAlgorithm* taskHandleAlgo, CTaskEventHandlerBasedDistributionCompletor* distributorCompletor, CConsiderateMemoryPoolProvider* memoryPoolProvider = nullptr); //! Destructor virtual ~CTaskProcessorSchedulerThread(); virtual CTaskReserveQueueConsumer* createTaskReserveQueueConsumer(CTaskEventHandlerBasedProcessor* taskProcessor); virtual CTaskSchedulerCommunicator* createSchedulerProcessorCommunication(CTaskEventHandlerBasedProcessor* taskProcessor); virtual CTaskEventHandlerBasedProcessor* installScheduler(CTaskEventHandlerBasedScheduler* scheduler); virtual bool requiresTaskDispenseNotification(cint64 &updateDispenseNotificationTag); CTaskReserveQueue* getTaskReserveQueue(); CTaskReserveQueueAdder* createTaskReserveQueueAdder(); // protected methods protected: virtual CTaskProcessorSchedulerThread* installSchedulerCommunicator(CTaskSchedulerCommunicator* schedulerCommunicator); virtual bool processEvent(CEvent *event, CContext* handlerContext); virtual bool processDispenseNotification(); virtual bool processRequestProcessTask(); virtual bool processCriticalScheduleTask(); virtual bool processCompleteTask(CTask* task); virtual bool processAdditionalTaskAllocation(CTask* task, CMemoryPool* memoryPool); virtual bool processResponseScheduleTask(CTask* task, CTaskScheduleItem* taskScheduleItem, bool schedulingTask); virtual bool processUpdateTaskStatus(CTask* task); virtual bool processUpdateTaskStatus(CTask* parentTask, CTask* updateTask); virtual bool processSchedulerRequestProcessTask(CTaskSchedulerCommunicator* communicator); virtual bool processSchedulerCriticalScheduleTask(CTaskSchedulerCommunicator* communicator); virtual bool processSchedulerResponseScheduleTask(CTask* task, CTaskSchedulerCommunicator* communicator, CTaskScheduleItem* taskScheduleItem, bool schedulingTask); virtual bool processSchedulerScheduleTask(CTask* task, bool schedulingTask); virtual bool processTaskScheduling(); virtual bool processSchedulingScheduleTasks(); virtual bool processSchedulerDispenseNotification(CTaskSchedulerCommunicator* communicator); virtual bool requiresSchedulingTasks(); // protected variables protected: CConsiderateMemoryPoolProvider* mMemoryPoolProvider; CDistributionMemoryPoolReleaser* mMemoryPoolReleaser; CTaskDistributionCompletorCommunicator* mDistributorCompletorCommunicator; // scheduler variables CConcreteTaskScheduleItem* mFreeSchedulerItemLinker; CConcreteTaskScheduleItem* mWaitingSchedulerItemLinker; CXLinker* mSchedulerCommunicatorLinker; cint64 mRequestingTaskCount; cint64 mDeliveringWaitingCount; bool mRequiresTaskDispenseNotification; cint64 mSchedulerDispenseNotificationTag; bool mProcessorWithCriticalScheduleTask; QMutex mCreateCommunicatorSyncMutex; CTaskSchedulerCommunicator* mSchedulerCommunicator; CTaskReserveArrayQueue* mTaskReserveQueue; CTaskReserveMultiArrayQueueAdderController* mTaskReserveQueueController; // processor variables cint64 mDispenseNotificationTag; // for debugging only CTask* mLastScheduledTask; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKPROCESSORSCHEDULERTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskScheduler.h0000644000175000017500000000314112520551304023211 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKSCHEDULER_H #define KONCLUDE_SCHEDULER_CTASKSCHEDULER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskScheduler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskScheduler { // public methods public: //! Constructor CTaskScheduler(); //! Destructor virtual ~CTaskScheduler(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKSCHEDULER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessorContextBase.cpp0000644000175000017500000000327012520551302025746 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskProcessorContextBase.h" namespace Konclude { namespace Scheduler { CTaskProcessorContextBase::CTaskProcessorContextBase(CTaskProcessorCommunicator* taskProcessorCommunicator, CTaskHandleMemoryAllocationManager* taskHandleMemoryManager) { mTaskProcessorCommunicator = taskProcessorCommunicator; mTaskHandleMemoryManager = taskHandleMemoryManager; } CTaskProcessorContextBase::~CTaskProcessorContextBase() { } CTaskProcessorCommunicator* CTaskProcessorContextBase::getTaskProcessorCommunicator() { return mTaskProcessorCommunicator; } CTaskHandleMemoryAllocationManager* CTaskProcessorContextBase::getTaskHandleMemoryAllocationManager() { return mTaskHandleMemoryManager; } CMemoryAllocationManager* CTaskProcessorContextBase::getMemoryAllocationManager() { return mTaskHandleMemoryManager; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CDistributionMemoryPoolReleaser.h0000644000175000017500000000361012520551274026644 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CDISTRIBUTIONMEMORYPOOLRELEASER_H #define KONCLUDE_SCHEDULER_CDISTRIBUTIONMEMORYPOOLRELEASER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Scheduler { /*! * * \class CDistributionMemoryPoolReleaser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDistributionMemoryPoolReleaser { // public methods public: //! Constructor CDistributionMemoryPoolReleaser(); //! Destructor virtual ~CDistributionMemoryPoolReleaser(); virtual CDistributionMemoryPoolReleaser* distributeMemoryPools(CMemoryPool* memoryPools) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CDISTRIBUTIONMEMORYPOOLRELEASER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskEventHandlerBasedDistributionCompletor.h0000644000175000017500000000372512520551276031116 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTaskEventHandlerBasedDistributionCompletor_H #define KONCLUDE_SCHEDULER_CTaskEventHandlerBasedDistributionCompletor_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskEventHandlerBasedCompletor.h" #include "CMemoryPoolDistributor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskEventHandlerBasedDistributionCompletor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskEventHandlerBasedDistributionCompletor : virtual public CTaskEventHandlerBasedCompletor, virtual public CMemoryPoolDistributor { // public methods public: //! Constructor CTaskEventHandlerBasedDistributionCompletor(); //! Destructor virtual ~CTaskEventHandlerBasedDistributionCompletor(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTaskEventHandlerBasedDistributionCompletor_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTask.h0000644000175000017500000001257112520551274021367 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASK_H #define KONCLUDE_SCHEDULER_CTASK_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskStatus.h" #include "CTaskResult.h" #include "CBooleanTaskResult.h" #include "CTaskHandleContext.h" #include "CTaskContext.h" #include "CTaskContextBase.h" #include "CTaskOwner.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Utilities/Container/CSortedLinker.h" #include "Utilities/Container/CNegLinker.h" #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Memory/CMemoryPoolContainer.h" #include "Utilities/Memory/CObjectAllocator.h" #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Container; using namespace Utilities::Memory; using namespace Concurrent::Callback; namespace Scheduler { /*! * * \class CTask * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTask : public CSortedLinkerBase, public CMemoryPoolContainer { // public methods public: //! Constructor CTask(CMemoryPool* memoryPool = nullptr); //! Destructor virtual ~CTask(); CTask* setTaskID(cint64 id); cint64 getTaskID() const; CTask* setTaskDepth(cint64 taskDepth); cint64 getTaskDepth() const; CTask* setTaskType(cint64 taskType); cint64 getTaskType() const; double getTaskPriority() const; CTask* setTaskPriority(double taskPriority); CTask* getParentTask() const; CTask* getRootTask() const; CTask* setParentTask(CTask* parentTask); CTask* setRootTask(CTask* rootTask); CTaskResult* getTaskResult(); CTaskStatus* getTaskStatus(); virtual CTaskContext* getTaskContext(CTaskHandleContext* context); virtual CTask* makeTaskReference(CTask* dependedTask, CTaskHandleContext* handlerContext); virtual CTask* initTask(CTask* parentTask, CTaskHandleContext* context); virtual CTask* completeTask(); CTask* incActiveReferenceCount(cint64 incCount = 1); CTask* decActiveReferenceCount(cint64 decCount = 1); cint64 getActiveReferenceCount() const; bool hasActiveReferencedTask() const; CTask* incDependedStatusUpdatesCount(cint64 incCount = 1); CTask* decDependedStatusUpdatesCount(cint64 decCount = 1); cint64 getDependedStatusUpdatesCount() const; bool hasDependedStatusUpdates() const; bool hasDependedStatusUpdatesOrActiveReferencedTasks() const; CXNegLinker* getReferencedTaskLinker(); CTask* setReferencedTaskLinker(CXNegLinker* referencedTaskLinker); CTask* appendReferencedTaskLinker(CXNegLinker* referencedTaskLinker); CCallbackData* getCallbackLinker(); CTask* setCallbackLinker(CCallbackData* callback); CTask* addCallbackLinker(CCallbackData* callback); CTaskOwner* getTaskOwner(); CTask* setTaskOwner(CTaskOwner* taskOwner); CTask* clearTaskOwner(); bool hasTaskOwner(CTaskOwner* taskOwner); bool hasTaskOwner(); bool hasNoTaskOwnerAndNoParentTask(); bool clearUninitializedReferenceTasks(); static inline bool sortedLinkerDataCompare(CTask* const & beforeData1, CTask* const & data2) { return beforeData1->getTaskPriority() >= data2->getTaskPriority(); } CTask* setCompletionRequested(bool requested); bool getCompletionRequested(); bool isCompletionRequested(); bool isTaskRelevant(); CTask* setTaskRelevant(bool relevant); bool isTaskDispenseMarked(); CTask* setTaskDispenseMarked(bool dispenseable); // protected methods protected: CTask* setCompletionNegatorConnector(CNegator* negator); virtual CTaskStatus* createTaskStatus(CTaskHandleContext* handlerContext) = 0; virtual CTaskResult* createTaskResult(CTaskHandleContext* handlerContext) = 0; // protected variables protected: cint64 mTaskID; cint64 mTaskType; double mTaskPriority; bool mTaskRelevant; bool mTaskDispensMarked; CTaskStatus* mTaskStatus; CTaskResult* mTaskResult; CTaskContext* mTaskContext; CTaskOwner* mTaskOwner; CTask* mParentTask; CTask* mRootTask; cint64 mActiveTaskReferenceCount; cint64 mDependedStatusUpdatesCount; cint64 mTaskDepth; CXNegLinker* mReferencedTaskLinker; CNegator* mCompletionNegator; CCallbackData* mCallbackLinker; bool mCompletionRequested; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASK_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessorContextBase.h0000644000175000017500000000437612520551302025423 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKPROCESSORCONTEXTBASE_H #define KONCLUDE_SCHEDULER_CTASKPROCESSORCONTEXTBASE_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskProcessorContext.h" // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Scheduler { /*! * * \class CTaskProcessorContextBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskProcessorContextBase : public CTaskProcessorContext { // public methods public: //! Constructor CTaskProcessorContextBase(CTaskProcessorCommunicator* taskProcessorCommunicator, CTaskHandleMemoryAllocationManager* taskHandleMemoryManager); //! Destructor virtual ~CTaskProcessorContextBase(); virtual CTaskProcessorCommunicator* getTaskProcessorCommunicator(); virtual CTaskHandleMemoryAllocationManager* getTaskHandleMemoryAllocationManager(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); // protected methods protected: // protected variables protected: CTaskProcessorCommunicator* mTaskProcessorCommunicator; CTaskHandleMemoryAllocationManager* mTaskHandleMemoryManager; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKPROCESSORCONTEXTBASE_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessorThreadBase.cpp0000644000175000017500000004445312520551302025541 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskProcessorThreadBase.h" namespace Konclude { namespace Scheduler { CTaskProcessorThreadBase::CTaskProcessorThreadBase(CTaskHandleAlgorithm* taskHandleAlgo, const QString &threadStringName) : CThread(threadStringName) { mTaskProcessingQueue = nullptr; mTaskSchedulingQueue = nullptr; mTaskCompletionQueue = nullptr; mMemoryAllocator = nullptr; mTaskProcessorContext = nullptr; mTaskStatusPropagator = nullptr; mCallbackExecuter = nullptr; mTaskHandleAlgo = taskHandleAlgo; mProcessingBlocked = true; mEventHandler = new CQueuedLinkedEventHandler(this,this); CXLinker* eventHandlerLinker = new CXLinker(mEventHandler,nullptr); mEventHandlerLinker = eventHandlerLinker; mTaskReserveQueueConsumer = nullptr; mProcessingStopped = false; mThreadBlocked = false; mStatComputionTime = 0; mStatBlockingTime = 0; mLastProcessingStartedTag = 0; mLastProcessingStartRequestTag = 0; mTaskProcessingCount = 0; mEventSignalized = false; mProcessTaskRequesting = true; mTaskSchedulingCount = 0; mCriticalSchedulingCount = 3; mCriticalSchedulingThresholdCount = 5; mCriticalSchedulingNotified = true; mRecievedTasks = 0; mTaskReserveQueueCount = 0; mTaskParentRelevantCount = 0; mConfScheduleTasksDistribution = false; mConfProcessingTasksDistribution = false; mConfUseReserveTasksQueue = true; mMinimalPriorityTaskInvalidated = false; mMinTaskPriority = 0.; mMinPriorityTask = nullptr; mConfProcessSchedulingTasks = true; mConfProcessReserveTasks = true; // for debugging only mLastProcessedTask = nullptr; mLastDispendedTask = nullptr; mLastProcessedEvent = nullptr; } CTaskProcessorThreadBase::~CTaskProcessorThreadBase() { } CTaskHandleAlgorithm* CTaskProcessorThreadBase::getTaskHandleAlgorithm() { return mTaskHandleAlgo; } bool CTaskProcessorThreadBase::isProcessing() { return !mProcessingBlocked; } bool CTaskProcessorThreadBase::isBlocked() { return mProcessingBlocked; } CTaskProcessorThreadBase* CTaskProcessorThreadBase::installCallbackExecuter(CTaskCallbackExecuter* callbackExecuter) { mCallbackExecuter = callbackExecuter; return this; } CTaskProcessorThreadBase* CTaskProcessorThreadBase::installStatusPropagator(CTaskStatusPropagator* statusPropagator) { mTaskStatusPropagator = statusPropagator; return this; } CTaskProcessingStatistics* CTaskProcessorThreadBase::getTaskProcessingStatistics() { return &mStats; } cint64 CTaskProcessorThreadBase::getStatisticBlockingTime() { cint64 blockTime = mStatBlockingTime; #ifdef KONCLUDE_SCHEDULER_TASK_THREADS_TIME_STATISTICS if (mThreadBlocked) { blockTime += mBlockingTimer.elapsed(); } #endif return blockTime; } cint64 CTaskProcessorThreadBase::getStatisticComputionTime() { cint64 compTime = mStatComputionTime; #ifdef KONCLUDE_SCHEDULER_TASK_THREADS_TIME_STATISTICS if (!mThreadBlocked) { compTime += mComputionTimer.elapsed(); } #endif return compTime; } CEventHandler* CTaskProcessorThreadBase::getEventHandler() { return mEventHandler; } bool CTaskProcessorThreadBase::canDispenseProcessingTasks() { return mTaskProcessingCount+mTaskSchedulingCount >= 2; } bool CTaskProcessorThreadBase::requiresProcessingTasks() { return mTaskProcessingCount+mTaskSchedulingCount <= 0; } bool CTaskProcessorThreadBase::requiresSchedulingTasks() { return mCriticalSchedulingNotified; } cint64 CTaskProcessorThreadBase::countDispensableProcessingTasks() { return mTaskProcessingCount+mTaskSchedulingCount; } cint64 CTaskProcessorThreadBase::countScheduleableProcessingTasks() { return mTaskSchedulingCount; } cint64 CTaskProcessorThreadBase::getRecievedTasks() { return mRecievedTasks; } CTaskProcessorThreadBase* CTaskProcessorThreadBase::startProcessing() { if (!isRunning()) { startThread(QThread::HighPriority); postEvent(new Concurrent::Events::CHandleEventsEvent()); } return this; } CTaskProcessorThreadBase* CTaskProcessorThreadBase::stopProcessing() { mProcessingStopped = true; return this; } CThreadActivator* CTaskProcessorThreadBase::signalizeEvent() { mEventSignalized = true; if (mProcessingBlocked) { // reactivate processing if (mLastProcessingStartedTag == mLastProcessingStartRequestTag) { ++mLastProcessingStartRequestTag; mProcessingWakeUpSemaphore.release(); } } return this; } bool CTaskProcessorThreadBase::processControlEvents(QEvent::Type type, CControlEvent *event) { if (CThread::processControlEvents(type,event)) { return true; } else { if (type == Concurrent::Events::CHandleEventsEvent::EVENTTYPE) { #ifdef KONCLUDE_SCHEDULER_TASK_THREADS_TIME_STATISTICS mComputionTimer.start(); #endif processingLoop(); return true; } } return false; } bool CTaskProcessorThreadBase::processingLoop() { bool eventSafeguardProcessed = false; while (!mProcessingStopped) { if (!mTaskProcessingQueue && mProcessingBlocked) { // block until new events or task are available #ifdef KONCLUDE_SCHEDULER_TASK_THREADS_TIME_STATISTICS mStatComputionTime += mComputionTimer.elapsed(); mBlockingTimer.start(); #endif INCTASKPROCESSINGSTAT(mStats.incStatisticThreadsBlockedCount(1)); mThreadBlocked = true; mProcessingWakeUpSemaphore.tryAcquire(1,100); mThreadBlocked = false; #ifdef KONCLUDE_SCHEDULER_TASK_THREADS_TIME_STATISTICS mStatBlockingTime += mBlockingTimer.elapsed(); mComputionTimer.start(); #endif mLastProcessingStartedTag = mLastProcessingStartRequestTag; } mProcessingBlocked = false; eventSafeguardProcessed = false; while (mEventSignalized) { bool eventsProcessed = handleEvents(); } if (mTaskProcessingQueue) { CTask* processingTask = mTaskProcessingQueue; mTaskProcessingQueue = mTaskProcessingQueue->getNext(); --mTaskProcessingCount; cint64 taskDepth = processingTask->getTaskDepth(); bool continueProcessing = processTask(processingTask); if (continueProcessing) { addProcessingTask(processingTask); } else { INCTASKPROCESSINGSTAT(mStats.incStatisticTasksProcessedDepthCount(taskDepth,1)); INCTASKPROCESSINGSTAT(mStats.incStatisticTasksProcessedCount(1)); } } if (!mTaskProcessingQueue && mTaskSchedulingQueue && mConfProcessSchedulingTasks) { CTask* nextTask = mTaskSchedulingQueue; mTaskSchedulingQueue = mTaskSchedulingQueue->getNext(); nextTask->clearNext(); --mTaskSchedulingCount; addProcessingTask(nextTask); if (!mCriticalSchedulingNotified && mTaskSchedulingCount <= mCriticalSchedulingCount) { mCriticalSchedulingNotified = true; processCriticalScheduleTask(); } } if (!mTaskProcessingQueue && mConfProcessReserveTasks) { if (mConfUseReserveTasksQueue && mTaskReserveQueueConsumer) { CTask* task = mTaskReserveQueueConsumer->getTask(); if (task) { ++mTaskReserveQueueCount; addProcessingTask(task); } } } processDispenseNotification(); if (!mTaskProcessingQueue) { while (mEventSignalized || !eventSafeguardProcessed) { bool eventsProcessed = handleEvents(); if (eventsProcessed) { eventSafeguardProcessed = false; mProcessingBlocked = false; } else if (!mProcessingBlocked) { mProcessingBlocked = true; } else if (!eventSafeguardProcessed) { eventSafeguardProcessed = true; } } if (!mTaskProcessingQueue && !mProcessTaskRequesting) { mProcessTaskRequesting = true; processRequestProcessTask(); } } } return true; } bool CTaskProcessorThreadBase::addProcessingTask(CTask* task) { if (task) { CTask* taskIt = task; cint64 taskCount = 0; double minPriority = 0.; CTask* minPriorityTask = nullptr; while (taskIt) { taskIt->getTaskStatus()->setTaskQUEUEDState(); if (!minPriorityTask || taskIt->getTaskPriority() < minPriority) { minPriority = taskIt->getTaskPriority(); minPriorityTask = taskIt; } ++taskCount; taskIt = taskIt->getNext(); } if (minPriorityTask) { if (minPriority < mMinTaskPriority) { mMinimalPriorityTaskInvalidated = true; } } mTaskProcessingCount += taskCount; INCTASKPROCESSINGSTAT(mStats.incStatisticTasksAddedCount(1)); if (!mTaskProcessingQueue) { mTaskProcessingQueue = task; task = task->getNext(); mTaskProcessingQueue->clearNext(); } if (task) { mTaskProcessingQueue = mTaskProcessingQueue->insertNextSorted(task); } mProcessTaskRequesting = false; return true; } return false; } bool CTaskProcessorThreadBase::processEvent(CEvent *event, CContext* handlerContext) { mLastProcessedEvent = event; cint64 eventID = event->getEventTypeID(); if (eventID == CSendTaskProcessEvent::EVENTTYPEID) { CSendTaskProcessEvent* sendTaskProcessEvent = (CSendTaskProcessEvent*)event; CTask* task = sendTaskProcessEvent->getTask(); bool schedulable = sendTaskProcessEvent->isSchedulingTask(); ++mRecievedTasks; if (!mTaskProcessingQueue || !schedulable) { addProcessingTask(task); } else { ++mTaskSchedulingCount; if (mTaskSchedulingQueue) { mTaskSchedulingQueue = mTaskSchedulingQueue->append(task); } else { mTaskSchedulingQueue = task; } if (mTaskSchedulingCount >= mCriticalSchedulingThresholdCount) { mCriticalSchedulingNotified = false; } } mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else if (eventID == CSendTaskCompleteEvent::EVENTTYPEID) { CTask* task = ((CSendTaskCompleteEvent*)event)->getTask(); processCompleteTask(task); mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else if (eventID == CTaskAdditionalAllocationEvent::EVENTTYPEID) { CTaskAdditionalAllocationEvent* taskAddAllocEvent = (CTaskAdditionalAllocationEvent*)event; CTask* task = taskAddAllocEvent->getTask(); CMemoryPool* addMemoryPools = taskAddAllocEvent->getAdditionalAllocatedMemoryPools(); processAdditionalTaskAllocation(task,addMemoryPools); mMemoryAllocator->releaseMemoryPoolContainer(event); return true; } else if (eventID == CRequestScheduleTaskEvent::EVENTTYPEID) { CTaskScheduleItem* taskScheduleItem = ((CRequestScheduleTaskEvent*)event)->getTaskScheduleItem(); mMemoryAllocator->releaseMemoryPoolContainer(event); CTask* responseTask = mTaskSchedulingQueue; bool schedulingTask = false; if (responseTask) { --mTaskSchedulingCount; schedulingTask = true; mTaskSchedulingQueue = mTaskSchedulingQueue->getNext(); if (!mCriticalSchedulingNotified && mTaskSchedulingCount <= mCriticalSchedulingCount) { mCriticalSchedulingNotified = true; processCriticalScheduleTask(); } } else { if (mConfProcessingTasksDistribution) { CTask* lastTask = nullptr; CTask* taskIt = mTaskProcessingQueue; // response least priority task while (taskIt && taskIt->hasNext()) { lastTask = taskIt; taskIt = taskIt->getNext(); } if (lastTask) { responseTask = lastTask->getNext(); lastTask->clearNext(); --mTaskProcessingCount; } } else if (mConfProcessingTasksDistribution) { CTask* lastBeforeRelevantTask = nullptr; CTask* lastTask = nullptr; CTask* taskIt = mTaskProcessingQueue; // response least priority task which is relevant while (taskIt && taskIt->hasNext()) { lastTask = taskIt; CTask* parentTask = taskIt->getParentTask(); if (!parentTask || parentTask->isTaskRelevant()) { lastBeforeRelevantTask = lastTask; } taskIt = taskIt->getNext(); } if (lastBeforeRelevantTask) { responseTask = lastBeforeRelevantTask->getNext(); lastBeforeRelevantTask->setNext(responseTask->getNext()); responseTask->clearNext(); --mTaskProcessingCount; --mTaskParentRelevantCount; } } if (responseTask) { INCTASKPROCESSINGSTAT(mStats.incStatisticTasksRequestedCount(1)); responseTask->clearTaskOwner(); CTask* parentTask = responseTask->getParentTask(); while (parentTask) { if (parentTask->hasTaskOwner()) { parentTask->clearTaskOwner(); parentTask = parentTask->getParentTask(); } else { parentTask = nullptr; } } mLastDispendedTask = responseTask; responseTask->getTaskStatus()->setTaskSCHEDULINGState(); } } if (responseTask) { responseTask->clearNext(); } processResponseScheduleTask(responseTask,taskScheduleItem,schedulingTask); return true; } else if (eventID == CUpdateTaskStatusEvent::EVENTTYPEID) { CUpdateTaskStatusEvent* utse = (CUpdateTaskStatusEvent*)event; processUpdateTaskStatus(utse->getParentTask(),utse->getUpdateTask()); return true; } else { // not supported } return false; } void CTaskProcessorThreadBase::organizeDispenseTasks(bool forceUpdate) { if (!mMinimalPriorityTaskInvalidated || forceUpdate) { // count dispense task and find minimal priority CTask* taskIt = mTaskProcessingQueue; double minPriority = 0.; CTask* minPriorityTask = nullptr; cint64 dispenseTaskCount = 0; while (taskIt) { CTask* task = taskIt; if (task->isTaskDispenseMarked()) { ++dispenseTaskCount; double priorty = task->getTaskPriority(); if (!minPriorityTask || minPriority < priorty) { minPriority = priorty; minPriorityTask = task; } } taskIt = taskIt->getNext(); } mMinTaskPriority = minPriority; mMinPriorityTask = minPriorityTask; mMinimalPriorityTaskInvalidated = false; } } CTaskProcessorCommunicator* CTaskProcessorThreadBase::communicateTaskComplete(CTask* task) { task->getTaskStatus()->setTaskFINISHEDState(); processCompleteTask(task); return this; } CTaskProcessorCommunicator* CTaskProcessorThreadBase::communicateTaskError(CTask* task) { task->getTaskStatus()->setTaskFINISHEDState(); processCompleteTask(task); return this; } CTaskProcessorCommunicator* CTaskProcessorThreadBase::communicateTaskCreation(CTask* newTask) { CTask* taskIt = newTask; while (taskIt) { if (!taskIt->hasTaskOwner()) { taskIt->setTaskOwner(this); } INCTASKPROCESSINGSTAT(mStats.incStatisticTasksCreatedCount(1)); INCTASKPROCESSINGSTAT(mStats.incStatisticTasksCreatedDepthCount(taskIt->getTaskDepth(),1)); taskIt = taskIt->getNext(); } addProcessingTask(newTask); return this; } CTaskProcessorCommunicator* CTaskProcessorThreadBase::communicateTaskStatusUpdate(CTask* task) { processUpdateTaskStatus(task); return this; } CTaskProcessorCommunicator* CTaskProcessorThreadBase::communicateTaskRelevant(CTask* task) { // TODO: mark task as relevant and prepare for distribution if (!task->isTaskRelevant()) { if (task->hasNoTaskOwnerAndNoParentTask() || task->hasTaskOwner(this)) { task->setTaskRelevant(true); CXNegLinker* refTaskLinker = task->getReferencedTaskLinker(); while (refTaskLinker) { bool refTaskCompleted = !refTaskLinker->isNegated(); if (!refTaskCompleted) { CTask* refTask = refTaskLinker->getData(); if (refTask->getTaskStatus()->isTaskStateQUEUED()) { ++mTaskParentRelevantCount; } } refTaskLinker = refTaskLinker->getNext(); } } } return this; } CTaskProcessorCommunicator* CTaskProcessorThreadBase::communicateTaskAdditionalAllocation(CTask* task, CMemoryPool* additionalAllocatedMemoryPool) { processAdditionalTaskAllocation(task,additionalAllocatedMemoryPool); return this; } bool CTaskProcessorThreadBase::verifyContinueTaskProcessing(CTask* task) { if (mEventSignalized) { return false; } if (!task->getTaskStatus()->isProcessable()) { return false; } if (mTaskProcessingQueue && mTaskProcessingQueue->getTaskPriority() > task->getTaskPriority()) { return false; } return true; } bool CTaskProcessorThreadBase::handleEvents() { bool handleNextRound = true; bool roundEventProcessed = false; bool eventProcessed = false; while (handleNextRound && !mProcessingStopped) { roundEventProcessed = false; CXLinker* eventHandlerLinkerIt = mEventHandlerLinker; if (eventHandlerLinkerIt) { CEventHandler* eventHandler = eventHandlerLinkerIt->getData(); if (eventHandler->needEventProcessing()) { cint64 handledEventCount = eventHandler->handleEvents(mTaskProcessorContext); INCTASKPROCESSINGSTAT(mStats.incStatisticEventsProcessedCount(handledEventCount)); roundEventProcessed = handledEventCount > 0; } // round robin eventHandlerLinkerIt = eventHandlerLinkerIt->getNext(); if (!eventHandlerLinkerIt) { if (mEventSignalized || roundEventProcessed) { handleNextRound = true; mEventSignalized = false; } else { handleNextRound = false; } eventHandlerLinkerIt = mEventHandlerLinker; } eventProcessed |= roundEventProcessed; } else { handleNextRound = false; } } return eventProcessed; } bool CTaskProcessorThreadBase::processTask(CTask* task) { mLastProcessedTask = task; task->clearNext(); task->getTaskStatus()->setTaskPROCESSINGState(); bool handleComp = mTaskHandleAlgo->handleTask(mTaskProcessorContext,task); return handleComp; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CConcreteMemoryPoolDistributor.cpp0000644000175000017500000001064312520551272027034 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteMemoryPoolDistributor.h" namespace Konclude { namespace Scheduler { CConcreteMemoryPoolDistributor::CConcreteMemoryPoolDistributor(CMemoryPoolProvider* alternateMemoryPoolProvider) { mAlternateMemoryPoolProvider = alternateMemoryPoolProvider; mDeleteAlternateMemoryPoolProvider = nullptr; if (!mAlternateMemoryPoolProvider) { mDeleteAlternateMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); mAlternateMemoryPoolProvider = mDeleteAlternateMemoryPoolProvider; } mProviderLinker = nullptr; mAddedProviderLinker = nullptr; mLastAddedProviderLinker = nullptr; mTmpStoredMemoryPools = nullptr; } CConcreteMemoryPoolDistributor::~CConcreteMemoryPoolDistributor() { delete mDeleteAlternateMemoryPoolProvider; } CDistributionMemoryPoolProvider* CConcreteMemoryPoolDistributor::createDistributionMemoryPoolProvider(CDistributionMemoryPoolReleaser* distributionMemoryReleaser) { CDistributionMemoryPoolProvider* provider = nullptr; mCreateProviderSyncLock.lock(); provider = new CDistributionMemoryPoolProvider(mAlternateMemoryPoolProvider,distributionMemoryReleaser); mAddedProviderLinker = provider->setNext(mAddedProviderLinker); mCreateProviderSyncLock.unlock(); return provider; } CConcreteMemoryPoolDistributor* CConcreteMemoryPoolDistributor::distributeMemoryPools(CMemoryPool* memoryPools) { CDistributionMemoryPoolProvider* tmpProvLinker = mAddedProviderLinker; CDistributionMemoryPoolProvider* nextLastAddedProvLinker = tmpProvLinker; while (tmpProvLinker && tmpProvLinker != mLastAddedProviderLinker) { CDistributionMemoryPoolProvider* tmpTakeProvLinker = tmpProvLinker; tmpProvLinker = tmpProvLinker->getNext(); mProviderLinker = tmpTakeProvLinker->setNext(mProviderLinker); } mLastAddedProviderLinker = nextLastAddedProvLinker; tmpProvLinker = mProviderLinker; while (tmpProvLinker) { tmpProvLinker->updatedRoundAcquiredMemoryPoolCounts(); tmpProvLinker = tmpProvLinker->getNext(); } CDistributionMemoryPoolProvider* sortedProviderLinker = nullptr; tmpProvLinker = mProviderLinker; while (tmpProvLinker) { CDistributionMemoryPoolProvider* tmpSortProvLinker = tmpProvLinker; tmpProvLinker = tmpProvLinker->getNext(); tmpSortProvLinker->clearNext(); if (sortedProviderLinker) { sortedProviderLinker = sortedProviderLinker->insertNextSorted(tmpSortProvLinker); } else { sortedProviderLinker = tmpSortProvLinker; } } if (mTmpStoredMemoryPools) { memoryPools = mTmpStoredMemoryPools->getLastListLink()->setNextMemoryPool(memoryPools); mTmpStoredMemoryPools = nullptr; } while (memoryPools) { CMemoryPool* tmpMemoryPool = memoryPools; memoryPools = memoryPools->getNext(); tmpMemoryPool->clearNext(); if (sortedProviderLinker->checkAppendableDistributedMemoryPools(tmpMemoryPool)) { sortedProviderLinker->appendDistributedMemoryPools(tmpMemoryPool); sortedProviderLinker->updateMissingMemoryPoolRatio(); // update sorted list CDistributionMemoryPoolProvider* nextSortedProviderLinker = sortedProviderLinker->getNext(); if (nextSortedProviderLinker && sortedProviderLinker->getMissingMemoryPoolRatio() > nextSortedProviderLinker->getMissingMemoryPoolRatio()) { sortedProviderLinker->clearNext(); sortedProviderLinker = nextSortedProviderLinker->insertNextSorted(sortedProviderLinker); } } else { mTmpStoredMemoryPools = tmpMemoryPool->setNextMemoryPool(mTmpStoredMemoryPools); } } mProviderLinker = sortedProviderLinker; return this; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CSingleThreadTaskProcessorUnit.h0000644000175000017500000001555312520551274026424 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CSINGLETHREADTASKPROCESSORUNIT_H #define KONCLUDE_SCHEDULER_CSINGLETHREADTASKPROCESSORUNIT_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskEventHandlerBasedProcessor.h" #include "CTaskEventHandlerBasedCompletor.h" #include "CTaskEventHandlerBasedScheduler.h" #include "CTaskHandleContext.h" #include "CTaskHandleMemoryAllocationManager.h" #include "CTaskHandleMemoryPoolAllocationManager.h" #include "CTaskHandleLimitedReserveMemoryPoolAllocationManager.h" #include "CTaskHandleAlgorithm.h" #include "CTaskProcessorContextBase.h" #include "CTaskStatusPropagator.h" #include "CTaskCallbackExecuter.h" #include "CTaskProcessingStatistics.h" #include "CTask.h" // Other includes #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" #include "Utilities/Memory/CConsiderateMemoryPoolProvider.h" #include "Scheduler/Events/CSendTaskProcessEvent.h" #include "Scheduler/Events/CSendTaskCompleteEvent.h" #include "Scheduler/Events/CSendTaskScheduleEvent.h" #include "Scheduler/Events/CRequestScheduleTaskEvent.h" #include "Scheduler/Events/CResponseScheduleTaskEvent.h" #include "Scheduler/Events/CTaskAdditionalAllocationEvent.h" #include "Scheduler/Events/CRequestProcessTaskEvent.h" #include "Concurrent/Events/CHandleEventsEvent.h" #include "Concurrent/CQueuedLinkedEventHandler.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; using namespace Utilities::Memory; namespace Scheduler { using namespace Events; /*! * * \class CSingleThreadTaskProcessorUnit * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSingleThreadTaskProcessorUnit : virtual public CTaskEventHandlerBasedProcessor, virtual public CTaskEventHandlerBasedCompletor, virtual public CTaskEventHandlerBasedScheduler, public CThread, public CThreadActivator, public CTaskProcessorCommunicator, public CEventProcessor { // public methods public: //! Constructor CSingleThreadTaskProcessorUnit(CTaskHandleAlgorithm* taskHandleAlgo, CConsiderateMemoryPoolProvider* memoryPoolProvider = nullptr); //! Destructor virtual ~CSingleThreadTaskProcessorUnit(); virtual CTaskEventHandlerBasedProcessor* installScheduler(CTaskEventHandlerBasedScheduler* scheduler); virtual CTaskSchedulerCommunicator* createSchedulerProcessorCommunication(CTaskEventHandlerBasedProcessor* taskProcessor); virtual CTaskReserveQueueConsumer* createTaskReserveQueueConsumer(CTaskEventHandlerBasedProcessor* taskProcessor); virtual CThreadActivator* signalizeEvent(); virtual CEventHandler* getEventHandler(); virtual CSingleThreadTaskProcessorUnit* startProcessing(); virtual CSingleThreadTaskProcessorUnit* stopProcessing(); virtual bool processEvent(CEvent *event, CContext* handlerContext); CTaskProcessingStatistics* getTaskProcessingStatistics(); cint64 getStatisticComputionTime(); cint64 getStatisticBlockingTime(); cint64 getTaskProcessingCount(); virtual cint64 getRecievedTasks(); virtual bool canDispenseProcessingTasks(); virtual bool requiresProcessingTasks(); virtual bool requiresSchedulingTasks(); virtual cint64 countDispensableProcessingTasks(); virtual bool requiresTaskDispenseNotification(cint64 &updateDispenseNotificationTag); virtual cint64 countScheduleableProcessingTasks(); CSingleThreadTaskProcessorUnit* installCallbackExecuter(CTaskCallbackExecuter* callbackExecuter); CSingleThreadTaskProcessorUnit* installStatusPropagator(CTaskStatusPropagator* statusPropagator); virtual CTaskHandleAlgorithm* getTaskHandleAlgorithm(); // protected methods protected: virtual bool processControlEvents(QEvent::Type type, CControlEvent *event); bool addProcessingTask(CTask* task); virtual bool processingLoop(); virtual CTaskProcessorCommunicator* communicateTaskComplete(CTask* task); virtual CTaskProcessorCommunicator* communicateTaskError(CTask* task); virtual CTaskProcessorCommunicator* communicateTaskCreation(CTask* newTask); virtual CTaskProcessorCommunicator* communicateTaskAdditionalAllocation(CTask* task, CMemoryPool* additionalAllocatedMemoryPool); virtual CTaskProcessorCommunicator* communicateTaskStatusUpdate(CTask* task); virtual CTaskProcessorCommunicator* communicateTaskRelevant(CTask* task); virtual bool verifyContinueTaskProcessing(CTask* task); virtual cint64 completeTask(CTask* task); virtual bool updateTaskStatus(CTask* task); virtual bool processTask(CTask* task); virtual bool handleEvents(); cint64 countProcessingTasksMemoryPools(); cint64 countProcessedOpenTasksMemoryPools(); cint64 closeOpenTasksMemoryPools(); // protected variables protected: CTask* mTaskSchedulingQueue; CTask* mTaskProcessingQueue; CTask* mTaskCompletionQueue; CTaskProcessorContext *mTaskProcessorContext; CTaskHandleMemoryAllocationManager *mMemoryAllocator; CTaskHandleAlgorithm* mTaskHandleAlgo; CQueuedLinkedEventHandler* mEventHandler; CTaskStatusPropagator* mTaskStatusPropagator; CTaskCallbackExecuter* mCallbackExecuter; CConsiderateMemoryPoolProvider* mMemoryPoolProvider; QSemaphore mProcessingWakeUpSemaphore; CXLinker* mEventHandlerLinker; bool mProcessingStopped; bool mThreadBlocked; bool mEventSignalized; bool mProcessingBlocked; cint64 mLastProcessingStartRequestTag; cint64 mLastProcessingStartedTag; cint64 mTaskProcessingCount; cint64 mTaskSchedulingCount; CTaskProcessingStatistics mStats; cint64 mStatComputionTime; cint64 mStatBlockingTime; cint64 mStatRecievedScheduleTasks; cint64 mStatRemovedTasks; #ifdef KONCLUDE_SCHEDULER_TASK_THREADS_TIME_STATISTICS QTime mComputionTimer; QTime mBlockingTimer; #endif CTask* mDebugLastCompletedTask; CTask* mDebugLastProcessedTask; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CSINGLETHREADTASKPROCESSORUNIT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskMemoryAllocationManager.h0000644000175000017500000000400012520551300026033 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKMEMORYALLOCATIONMANAGER_H #define KONCLUDE_SCHEDULER_CTASKMEMORYALLOCATIONMANAGER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" // Other includes #include "Utilities/Memory/CMemoryAllocationManager.h" #include "Utilities/Memory/CConsiderateMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Scheduler { /*! * * \class CTaskMemoryAllocationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskMemoryAllocationManager : virtual public CMemoryAllocationManager { // public methods public: //! Constructor CTaskMemoryAllocationManager(); //! Destructor virtual ~CTaskMemoryAllocationManager(); virtual CTaskMemoryAllocationManager* updateMemoryProvider(CConsiderateMemoryPoolProvider* memoryPoolProvider) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKMEMORYALLOCATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskScheduler.cpp0000644000175000017500000000200712520551304023544 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskScheduler.h" namespace Konclude { namespace Scheduler { CTaskScheduler::CTaskScheduler() { } CTaskScheduler::~CTaskScheduler() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskHandleContext.h0000644000175000017500000000352512520551276024051 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKHANDLECONTEXT_H #define KONCLUDE_SCHEDULER_CTASKHANDLECONTEXT_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskHandleMemoryAllocationManager.h" // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Scheduler { /*! * * \class CTaskHandleContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskHandleContext : public CContext { // public methods public: //! Constructor CTaskHandleContext(); //! Destructor virtual ~CTaskHandleContext(); virtual CTaskHandleMemoryAllocationManager* getTaskHandleMemoryAllocationManager() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKHANDLECONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessingStatistics.cpp0000644000175000017500000001240112520551300026010 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskProcessingStatistics.h" namespace Konclude { namespace Scheduler { CTaskProcessingStatistics::CTaskProcessingStatistics() { mTaskCreatedDepthCountVec.resize(VECCOUNTERSIZE); mTaskProcessedDepthCountVec.resize(VECCOUNTERSIZE); clear(); } CTaskProcessingStatistics::~CTaskProcessingStatistics() { } CTaskProcessingStatistics* CTaskProcessingStatistics::clear() { mStatTasksProcessed = 0; mStatTasksAdded = 0; mStatTasksCreated = 0; mStatTasksCompleted = 0; mStatTasksUpdated = 0; mStatEventsProcessed = 0; mStatTasksRequested = 0; mStatThreadBlocked = 0; mStatCallbacksExecuted = 0; for (cint64 i = 0; i < VECCOUNTERSIZE; ++i) { mTaskCreatedDepthCountVec[i] = 0; mTaskProcessedDepthCountVec[i] = 0; } return this; } CTaskProcessingStatistics* CTaskProcessingStatistics::incStatisticTasksProcessedCount(cint64 incCount) { mStatTasksProcessed += incCount; return this; } CTaskProcessingStatistics* CTaskProcessingStatistics::incStatisticTasksAddedCount(cint64 incCount) { mStatTasksAdded += incCount; return this; } CTaskProcessingStatistics* CTaskProcessingStatistics::incStatisticTasksCreatedCount(cint64 incCount) { mStatTasksCreated += incCount; return this; } CTaskProcessingStatistics* CTaskProcessingStatistics::incStatisticTasksCompletedCount(cint64 incCount) { mStatTasksCompleted += incCount; return this; } CTaskProcessingStatistics* CTaskProcessingStatistics::incStatisticTasksUpdatedCount(cint64 incCount) { mStatTasksUpdated += incCount; return this; } CTaskProcessingStatistics* CTaskProcessingStatistics::incStatisticEventsProcessedCount(cint64 incCount) { mStatEventsProcessed += incCount; return this; } CTaskProcessingStatistics* CTaskProcessingStatistics::incStatisticTasksRequestedCount(cint64 incCount) { mStatTasksRequested += incCount; return this; } CTaskProcessingStatistics* CTaskProcessingStatistics::incStatisticThreadsBlockedCount(cint64 incCount) { mStatThreadBlocked += incCount; return this; } CTaskProcessingStatistics* CTaskProcessingStatistics::incStatisticCallbacksExecutedCount(cint64 incCount) { mStatCallbacksExecuted += incCount; return this; } cint64 CTaskProcessingStatistics::getStatisticTasksProcessedCount() { return mStatTasksProcessed; } cint64 CTaskProcessingStatistics::getStatisticTasksAddedCount() { return mStatTasksAdded; } cint64 CTaskProcessingStatistics::getStatisticTasksCreatedCount() { return mStatTasksCreated; } cint64 CTaskProcessingStatistics::getStatisticTasksCompletedCount() { return mStatTasksCompleted; } cint64 CTaskProcessingStatistics::getStatisticTasksUpdatedCount() { return mStatTasksUpdated; } cint64 CTaskProcessingStatistics::getStatisticEventsProcessedCount() { return mStatEventsProcessed; } cint64 CTaskProcessingStatistics::getStatisticTasksRequestedCount() { return mStatTasksRequested; } cint64 CTaskProcessingStatistics::getStatisticThreadsBlockedCount() { return mStatThreadBlocked; } cint64 CTaskProcessingStatistics::getStatisticCallbacksExecutedCount() { return mStatCallbacksExecuted; } CTaskProcessingStatistics* CTaskProcessingStatistics::incStatisticTasksCreatedDepthCount(cint64 taskDepth, cint64 incCount) { if (taskDepth >= 0 && taskDepth < VECCOUNTERSIZE) { mTaskCreatedDepthCountVec[taskDepth] += incCount; } return this; } CTaskProcessingStatistics* CTaskProcessingStatistics::incStatisticTasksProcessedDepthCount(cint64 taskDepth, cint64 incCount) { if (taskDepth >= 0 && taskDepth < VECCOUNTERSIZE) { mTaskProcessedDepthCountVec[taskDepth] += incCount; } return this; } cint64 CTaskProcessingStatistics::getStatisticTasksCreatedDepthCount(cint64 taskDepth) { if (taskDepth >= 0 && taskDepth < VECCOUNTERSIZE) { return mTaskCreatedDepthCountVec[taskDepth]; } else { return 0; } } cint64 CTaskProcessingStatistics::getStatisticTasksProcessedDepthCount(cint64 taskDepth) { if (taskDepth >= 0 && taskDepth < VECCOUNTERSIZE) { return mTaskProcessedDepthCountVec[taskDepth]; } else { return 0; } } QVector* CTaskProcessingStatistics::getStatisticTasksCreatedDepthCountVector() { return &mTaskCreatedDepthCountVec; } QVector* CTaskProcessingStatistics::getStatisticTasksProcessedDepthCountVector() { return &mTaskProcessedDepthCountVec; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveQueueAdderController.h0000644000175000017500000000332112520551304026717 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKRESERVEQUEUEADDERCONTROLLER_H #define KONCLUDE_SCHEDULER_CTASKRESERVEQUEUEADDERCONTROLLER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskReserveQueueAdderController * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskReserveQueueAdderController { // public methods public: //! Constructor CTaskReserveQueueAdderController(); virtual bool requiresTaskAddedNotification() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKRESERVEQUEUEADDERCONTROLLER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskEventHandlerBasedScheduler.cpp0000644000175000017500000000213412520551276027014 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskEventHandlerBasedScheduler.h" namespace Konclude { namespace Scheduler { CTaskEventHandlerBasedScheduler::CTaskEventHandlerBasedScheduler() { } CTaskEventHandlerBasedScheduler::~CTaskEventHandlerBasedScheduler() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessorCompletorThread.cpp0000644000175000017500000002463512520551300026631 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskProcessorCompletorThread.h" namespace Konclude { namespace Scheduler { CTaskProcessorCompletorThread::CTaskProcessorCompletorThread(CTaskHandleAlgorithm* taskHandleAlgo, CConsiderateMemoryPoolProvider* memoryPoolProvider) : CTaskProcessorThreadBase(taskHandleAlgo,"TaskProcesserCompletorThread"),CConcreteMemoryPoolDistributor(nullptr) { mMemoryPoolReleaser = new CDirectDistributionMemoryPoolReleaser(this); mMemoryPoolProvider = memoryPoolProvider; if (!mMemoryPoolProvider) { //mMemoryPoolProvider = CConcreteMemoryPoolDistributor::createDistributionMemoryPoolProvider(mMemoryPoolReleaser); mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); } mMemoryAllocator = new CTaskHandleLimitedReserveMemoryPoolAllocationManager(mMemoryPoolProvider,300,30); mTaskProcessorContext = new CTaskProcessorContextBase(this,mMemoryAllocator); mSchedulerCommunicator = nullptr; mDispenseNotificationTag = 0; } CTaskProcessorCompletorThread::~CTaskProcessorCompletorThread() { } CTaskEventHandlerBasedProcessor* CTaskProcessorCompletorThread::installScheduler(CTaskEventHandlerBasedScheduler* scheduler) { mTaskReserveQueueConsumer = scheduler->createTaskReserveQueueConsumer(this); CTaskSchedulerCommunicator* schedulerCommunicator = scheduler->createSchedulerProcessorCommunication(this); installSchedulerCommunicator(schedulerCommunicator); return this; } CTaskProcessorCompletorThread* CTaskProcessorCompletorThread::installSchedulerCommunicator(CTaskSchedulerCommunicator* schedulerCommunicator) { mSchedulerCommunicator = schedulerCommunicator; mSchedulerCommunicator->communicateRequestProcessTask(mMemoryAllocator); return this; } CDistributionMemoryPoolProvider* CTaskProcessorCompletorThread::createDistributionMemoryPoolProvider(CDistributionMemoryPoolReleaser* distributionMemoryReleaser) { return CConcreteMemoryPoolDistributor::createDistributionMemoryPoolProvider(distributionMemoryReleaser); } CConcreteMemoryPoolDistributor* CTaskProcessorCompletorThread::distributeMemoryPools(CMemoryPool* memoryPools) { return CConcreteMemoryPoolDistributor::distributeMemoryPools(memoryPools); } bool CTaskProcessorCompletorThread::processEvent(CEvent *event, CContext* handlerContext) { mLastProcessedEvent = event; cint64 eventID = event->getEventTypeID(); if (eventID == CTaskStatusUpdatedEvent::EVENTTYPEID) { CTaskStatusUpdatedEvent* tsue = (CTaskStatusUpdatedEvent*)event; CTask* parentTask = tsue->getParentTask(); CTask* updatedTask = tsue->getUpdatedTask(); bool updateSuccess = tsue->getUpdateSuccess(); processTaskStatusUpdated(parentTask,updatedTask,updateSuccess); return true; } else if (eventID == CAlignedUpdateTaskStatusEvent::EVENTTYPEID) { CAlignedUpdateTaskStatusEvent* autse = (CAlignedUpdateTaskStatusEvent*)event; CTask* updateTask = autse->getUpdateTask(); processUpdateTaskStatus(updateTask); return true; } else if (CTaskProcessorThreadBase::processEvent(event,handlerContext)) { return true; } else { // not supported event } return false; } bool CTaskProcessorCompletorThread::processDispenseNotification() { if (canDispenseProcessingTasks() && mSchedulerCommunicator->requiresTaskDispenseNotification(mDispenseNotificationTag)) { mSchedulerCommunicator->communicateTaskDispenseNotification(mMemoryAllocator); } return true; } bool CTaskProcessorCompletorThread::processRequestProcessTask() { mSchedulerCommunicator->communicateRequestProcessTask(mMemoryAllocator); return true; } bool CTaskProcessorCompletorThread::processCriticalScheduleTask() { mSchedulerCommunicator->communicateCriticalScheduleTask(mMemoryAllocator); return true; } bool CTaskProcessorCompletorThread::processCompleteTask(CTask* task) { cint64 completedCount = 0; mTaskCompletionQueue = task->getLastListLink()->setNext(mTaskCompletionQueue); while (mTaskCompletionQueue) { CTask* completionTask = mTaskCompletionQueue; mTaskCompletionQueue = mTaskCompletionQueue->getNext(); if (completionTask) { if (completionTask->hasDependedStatusUpdates()) { completionTask->setCompletionRequested(true); } else if (!completionTask->hasActiveReferencedTask()) { CTask* parentTask = completionTask->getParentTask(); bool upPropagation = false; if (mTaskStatusPropagator && mTaskStatusPropagator->completeTaskStatus(completionTask,upPropagation)) { if (parentTask && upPropagation) { processUpdateTaskStatus(parentTask); } } completionTask->completeTask(); completionTask->getTaskStatus()->setTaskCOMPLETEDState(); bool memoryReleaseable = completionTask->getTaskStatus()->isMemoryReleaseable(); if (parentTask) { parentTask->decActiveReferenceCount(); if (!parentTask->hasActiveReferencedTask()) { mTaskCompletionQueue = parentTask->setNext(mTaskCompletionQueue); } } if (completionTask) { // callbacks CCallbackData* callbackLinkerIt = completionTask->getCallbackLinker(); while (callbackLinkerIt) { CCallbackData* callback = callbackLinkerIt; callbackLinkerIt = callbackLinkerIt->getNext(); if (mCallbackExecuter) { mCallbackExecuter->executeCallback(completionTask,callback); INCTASKPROCESSINGSTAT(mStats.incStatisticCallbacksExecutedCount(1)); } else { callback->doCallback(); } } } #ifndef KONCLUDE_SCHEDULER_DEBUG_TASK_MEMORY_RELEASE if (memoryReleaseable) { mMemoryAllocator->releaseMemoryPoolContainer(completionTask); } #endif completedCount++; } } } INCTASKPROCESSINGSTAT(mStats.incStatisticTasksCompletedCount(completedCount)); return true; } bool CTaskProcessorCompletorThread::processAdditionalTaskAllocation(CTask* task, CMemoryPool* memoryPool) { task->appendMemoryPool(memoryPool); return true; } bool CTaskProcessorCompletorThread::processResponseScheduleTask(CTask* task, CTaskScheduleItem* taskScheduleItem, bool schedulingTask) { mSchedulerCommunicator->communicateResponseScheduleTask(taskScheduleItem,task,schedulingTask,mMemoryAllocator); return true; } bool CTaskProcessorCompletorThread::processTaskStatusUpdated(CTask* parentTask, CTask* updatedTask, bool updateSuccess) { bool needsMayTaskCompletion = false; if (updateSuccess) { parentTask->decDependedStatusUpdatesCount(); needsMayTaskCompletion = true; } else { // task is already completed or is now owned by completer // check whether task is completed bool taskCompleted = false; CXNegLinker* refTaskLinkerIt = parentTask->getReferencedTaskLinker(); while (refTaskLinkerIt) { CTask* refTask = refTaskLinkerIt->getData(); if (refTask == updatedTask) { if (!refTaskLinkerIt->isNegated()) { taskCompleted = true; } break; } refTaskLinkerIt = refTaskLinkerIt->getNext(); } if (taskCompleted) { parentTask->decDependedStatusUpdatesCount(); needsMayTaskCompletion = true; } else { if (parentTask->hasTaskOwner(this) || !parentTask->hasTaskOwner()) { processUpdateTaskStatus(parentTask,updatedTask); needsMayTaskCompletion = true; } else { mSchedulerCommunicator->communicateScheduleUpdateTaskStatus(parentTask,updatedTask,mMemoryAllocator); } } } if (needsMayTaskCompletion) { if (parentTask->isCompletionRequested()) { if (!parentTask->hasDependedStatusUpdates()) { processCompleteTask(parentTask); } } } return true; } bool CTaskProcessorCompletorThread::processUpdateTaskStatus(CTask* parentTask, CTask* updateTask) { if (!parentTask || parentTask->hasTaskOwner(this) || !parentTask->hasTaskOwner()) { // local task status update processUpdateTaskStatus(updateTask); processTaskStatusUpdated(parentTask,updateTask,true); } else { processTaskStatusUpdated(parentTask,updateTask,false); } return true; } bool CTaskProcessorCompletorThread::processUpdateTaskStatus(CTask* task) { CTask* updateTask = task; bool downProp = false; bool upProp = false; CTaskOwner* taskOwner = updateTask->getTaskOwner(); if (mTaskStatusPropagator && mTaskStatusPropagator->updateTaskStatus(updateTask,downProp,upProp)) { if (downProp) { if (taskOwner == nullptr || taskOwner == this) { // update task status direct CXNegLinker* refTaskIt = updateTask->getReferencedTaskLinker(); while (refTaskIt) { if (refTaskIt->isNegated()) { // task still exists, update task status // TODO: check better not recursive? CTask* refTask = refTaskIt->getData(); processUpdateTaskStatus(refTask); } refTaskIt = refTaskIt->getNext(); } } else { // signalize task status update per event to other processing units CXNegLinker* refTaskIt = updateTask->getReferencedTaskLinker(); while (refTaskIt) { if (refTaskIt->isNegated()) { // task still exists, update task status with event to corresponding processor unit CTask* refTask = refTaskIt->getData(); updateTask->incDependedStatusUpdatesCount(); mSchedulerCommunicator->communicateScheduleUpdateTaskStatus(updateTask,refTask,mMemoryAllocator); } refTaskIt = refTaskIt->getNext(); } } } if (upProp) { // all parent task are owned by the completer CTask* parentTask = updateTask->getParentTask(); if (parentTask) { processUpdateTaskStatus(parentTask); } } } return true; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CEventDistributionMemoryPoolReleaser.cpp0000644000175000017500000000276512520551274030213 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEventDistributionMemoryPoolReleaser.h" namespace Konclude { namespace Scheduler { CEventDistributionMemoryPoolReleaser::CEventDistributionMemoryPoolReleaser(CTaskDistributionCompletorCommunicator* distributionCompletorCommunicator) { mDistributionCompletorCommunicator = distributionCompletorCommunicator; } CEventDistributionMemoryPoolReleaser::~CEventDistributionMemoryPoolReleaser() { } CEventDistributionMemoryPoolReleaser* CEventDistributionMemoryPoolReleaser::distributeMemoryPools(CMemoryPool* memoryPools) { mDistributionCompletorCommunicator->communicateDistributeMemoryPools(memoryPools); return this; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CEventHandlerVendor.cpp0000644000175000017500000000204012520551274024543 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEventHandlerVendor.h" namespace Konclude { namespace Scheduler { CEventHandlerVendor::CEventHandlerVendor() { } CEventHandlerVendor::~CEventHandlerVendor() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskHandleMemoryPoolAllocationManager.h0000644000175000017500000000602512520551300030012 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKHANDLEMEMORYPOOLALLOCATIONMANAGER_H #define KONCLUDE_SCHEDULER_CTASKHANDLEMEMORYPOOLALLOCATIONMANAGER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskHandleMemoryAllocationManager.h" // Other includes #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/Memory/CMemoryPoolProvider.h" #include "Utilities/Memory/CConsiderateMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Memory; namespace Scheduler { /*! * * \class CTaskHandleMemoryPoolAllocationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskHandleMemoryPoolAllocationManager : public CMemoryPoolAllocationManager, virtual public CTaskHandleMemoryAllocationManager { // public methods public: //! Constructor CTaskHandleMemoryPoolAllocationManager(CConsiderateMemoryPoolProvider* memoryPoolProvider); //! Destructor virtual ~CTaskHandleMemoryPoolAllocationManager(); virtual void* allocate(size_t size); virtual CMemoryAllocationManager* release(void* address); virtual void* allocateAligned(size_t size, int alignment); virtual CMemoryTemporaryAllocationManager* releaseAllMemory(); virtual CMemoryPool* acqireTemporaryMemoryPool(size_t size); virtual CMemoryTemporaryAllocationManager* releaseTemporaryMemoryPool(CMemoryPool* memoryPool); virtual cint64 getOptimizedMoreAllocationSize(cint64 size); virtual CMemoryTemporaryAllocationManager* releaseMemoryPoolContainer(CMemoryPoolContainer* memoryPoolContainer); virtual CMemoryPoolProvider* releaseMemoryPool(CMemoryPool* memoryPool); virtual CMemoryPool* acquireMemoryPool(cint64 minPoolSize); virtual CMemoryPool* acquireMemoryPoolConsiderated(cint64 minPoolSize); // protected methods protected: // protected variables protected: CConsiderateMemoryPoolProvider* mConsideratedMemPoolProvider; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKHANDLEMEMORYPOOLALLOCATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CMemoryPoolDistributor.h0000644000175000017500000000365412520551274025024 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CMEMORYPOOLDISTRIBUTOR_H #define KONCLUDE_SCHEDULER_CMEMORYPOOLDISTRIBUTOR_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CDistributionMemoryPoolProvider.h" #include "CDistributionMemoryPoolReleaser.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Scheduler { /*! * * \class CMemoryPoolDistributor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMemoryPoolDistributor { // public methods public: //! Constructor CMemoryPoolDistributor(); //! Destructor virtual ~CMemoryPoolDistributor(); virtual CDistributionMemoryPoolProvider* createDistributionMemoryPoolProvider(CDistributionMemoryPoolReleaser* distributionMemoryReleaser) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CMEMORYPOOLDISTRIBUTOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskResult.h0000644000175000017500000000316212520551304022554 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKRESULT_H #define KONCLUDE_SCHEDULER_CTASKRESULT_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskResult { // public methods public: //! Constructor CTaskResult(); //! Destructor virtual ~CTaskResult(); virtual bool hasResult() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskResult.cpp0000644000175000017500000000177012520551304023112 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskResult.h" namespace Konclude { namespace Scheduler { CTaskResult::CTaskResult() { } CTaskResult::~CTaskResult() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveQueueConsumer.cpp0000644000175000017500000000177612520551304025776 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskReserveQueueConsumer.h" namespace Konclude { namespace Scheduler { CTaskReserveQueueConsumer::CTaskReserveQueueConsumer() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CDistributionMemoryPoolReleaser.cpp0000644000175000017500000000213412520551274027177 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDistributionMemoryPoolReleaser.h" namespace Konclude { namespace Scheduler { CDistributionMemoryPoolReleaser::CDistributionMemoryPoolReleaser() { } CDistributionMemoryPoolReleaser::~CDistributionMemoryPoolReleaser() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveMultiArrayQueueAdderController.h0000644000175000017500000000445312520551304030740 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKRESERVEMULTIARRAYQUEUEADDERCONTROLLER_H #define KONCLUDE_SCHEDULER_CTASKRESERVEMULTIARRAYQUEUEADDERCONTROLLER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskReserveQueueAdder.h" #include "CTaskReserveQueueAdderController.h" #include "CTaskReserveArrayQueue.h" #include "CTaskReserveMultiArrayQueue.h" #include "CTask.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskReserveMultiArrayQueueAdderController * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskReserveMultiArrayQueueAdderController : public CTaskReserveQueueAdderController { // public methods public: //! Constructor CTaskReserveMultiArrayQueueAdderController(CTaskReserveMultiArrayQueue* queue); virtual bool requiresTaskAddedNotification(); bool hasRequiresTaskAddedNotificationFlag(); CTaskReserveMultiArrayQueueAdderController* setRequiresTaskAddedNotificationFlag(bool flag); CTaskReserveQueueAdder* createTaskReserveQueueAdder(); // protected methods protected: // protected variables protected: CTaskReserveMultiArrayQueue* mQueue; bool mRequireTaskAddedNotificationFlag; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKRESERVEMULTIARRAYQUEUEADDERCONTROLLER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskHandleMemoryAllocationManager.h0000644000175000017500000000376312520551300027166 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKHANDLEMEMORYALLOCATIONMANAGER_H #define KONCLUDE_SCHEDULER_CTASKHANDLEMEMORYALLOCATIONMANAGER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" // Other includes #include "Utilities/Memory/CMemoryTemporaryAllocationManager.h" #include "Utilities/Memory/CConsiderateMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Scheduler { /*! * * \class CTaskHandleMemoryAllocationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskHandleMemoryAllocationManager : public virtual CMemoryTemporaryAllocationManager, virtual public CConsiderateMemoryPoolProvider { // public methods public: //! Constructor CTaskHandleMemoryAllocationManager(); //! Destructor virtual ~CTaskHandleMemoryAllocationManager(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKHANDLEMEMORYALLOCATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskDistributionCompletorCommunicator.cpp0000644000175000017500000000670412520551276030573 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskDistributionCompletorCommunicator.h" namespace Konclude { namespace Scheduler { CTaskDistributionCompletorCommunicator::CTaskDistributionCompletorCommunicator(CTaskEventHandlerBasedDistributionCompletor* taskDistributionCompletor, CTaskEventHandlerBasedProcessor* taskProcessor) : mDistributionCompletorTaskEventCommunicator(taskDistributionCompletor->getEventHandler()), mProcessorTaskEventCommunicator(taskProcessor->getEventHandler()) { mTaskDistributionCompletor = taskDistributionCompletor; mTaskProcessor = taskProcessor; } CTaskDistributionCompletorCommunicator::~CTaskDistributionCompletorCommunicator() { } CTaskDistributionCompletorCommunicator* CTaskDistributionCompletorCommunicator::communicateTaskComplete(CTask* task, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { mDistributionCompletorTaskEventCommunicator.postSendTaskCompleteEvent(task,memoryTmpAllocatorManager); return this; } CTaskDistributionCompletorCommunicator* CTaskDistributionCompletorCommunicator::communicateAdditionalAllocationTask(CTask* task, CMemoryPool* memoryPools, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { mDistributionCompletorTaskEventCommunicator.postAdditionalAllocationTaskEvent(task,memoryPools,memoryTmpAllocatorManager); return this; } CTaskDistributionCompletorCommunicator* CTaskDistributionCompletorCommunicator::communicateDistributeMemoryPools(CMemoryPool* memoryPools, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { mDistributionCompletorTaskEventCommunicator.postDistributeMemoryPoolsEvent(memoryPools,memoryTmpAllocatorManager); return this; } CTaskDistributionCompletorCommunicator* CTaskDistributionCompletorCommunicator::communicateDistributeMemoryPools(CMemoryPool* memoryPools) { mDistributionCompletorTaskEventCommunicator.postDistributeMemoryPoolsEvent(memoryPools); return this; } CTaskDistributionCompletorCommunicator* CTaskDistributionCompletorCommunicator::communicateAlignedUpdateTaskStatus(CTask* updateTask, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { mDistributionCompletorTaskEventCommunicator.postAlignedUpdateTaskStatusEvent(updateTask,memoryTmpAllocatorManager); return this; } CTaskDistributionCompletorCommunicator* CTaskDistributionCompletorCommunicator::communicateTaskStatusUpdated(CTask* parentTask, CTask* updatedTask, bool success, CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { mDistributionCompletorTaskEventCommunicator.postTaskStatusUpdatedEvent(parentTask,updatedTask,success,memoryTmpAllocatorManager); return this; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/SchedulerSettings.h0000644000175000017500000000563512520551306024020 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_SCHEDULERSETTINGS #define KONCLUDE_SCHEDULER_SCHEDULERSETTINGS // Libraries includes #include #include // Namespace includes // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes namespace Konclude { using namespace Utilities; namespace Scheduler { /*! * * \file SchedulerSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CTaskReserveArrayQueue; class CTaskReserveArrayQueueConsumer; class CTaskReserveMultiArrayQueue; class CTaskReserveMultiArrayQueueConsumer; class CTaskSchedulerCommunicator; class CTaskEventHandlerBasedProcessor; class CTaskEventHandlerBasedScheduler; class CTaskEventHandlerBasedDistributionCompletor; template class CProcessingQueueExtensionIterator; template class CProcessingQueueIterator; template class CProcessingQueue; template class CProcessingQueueExtension; // Custom Events >= 2000 static const cint64 CREQUESTPROCESSTASKEVENTTYPEID = 5001; static const cint64 CREQUESTSCHEDULETASKEVENTTYPEID = 5002; static const cint64 CRESPONSESCHEDULETASKEVENTTYPEID = 5003; static const cint64 CSENDTASKCOMPLETEEVENTTYPEID = 5004; static const cint64 CSENDTASKPROCESSEVENTTYPEID = 5005; static const cint64 CSENDTASKSCHEDULEEVENTTYPEID = 5006; static const cint64 CTASKADDITIONALALLOCATIONEVENTTYPEID = 5007; static const cint64 CDISTRIBUTEMEMORYPOOLEVENTTYPEID = 5008; static const cint64 CTASKDISPENSENOTIFICATIONEVENTTYPEID = 5009; static const cint64 CUPDATETASKSTATUSEVENTTYPEID = 5010; static const cint64 CTASKSTATUSUPDATEDEVENTTYPEID = 5011; static const cint64 CALIGNEDUPDATETASKSTATUSEVENTTYPEID = 5012; static const cint64 CCRITICALSCHEDULETASKEVENTTYPEID = 5013; #ifndef KONCLUDE_FORCE_STATISTIC_DEACTIVATED #define KONCLUDE_SCHEDULER_TASK_THREADS_TIME_STATISTICS #define KONCLUDE_SCHEDULER_TASK_PROCESSING_STATISTICS #endif }; // end namespace Scheduler }; // end namespace Konclude #endif // end KONCLUDE_SCHEDULER_SCHEDULERSETTINGS Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveMultiArrayQueueConsumer.cpp0000644000175000017500000000503112520551304027774 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskReserveMultiArrayQueueConsumer.h" #include "CTaskReserveMultiArrayQueue.h" namespace Konclude { namespace Scheduler { CTaskReserveMultiArrayQueueConsumer::CTaskReserveMultiArrayQueueConsumer(CTaskReserveMultiArrayQueue* arrayQueue) : CLinkerBase(this), mArrayQueue(arrayQueue) { mTakenTask = 0; mRequestedTask = 0; mLastQueueLinker = nullptr; mQueueConsumerLinker = nullptr; } CTask* CTaskReserveMultiArrayQueueConsumer::getTask() { CXLinker* currentQueueLinker = mArrayQueue->getTaskReserveArrayQueueLinker(); while (currentQueueLinker != mLastQueueLinker) { CXLinker* newConsumerLinker = new CXLinker(); CTaskReserveArrayQueue* queue = currentQueueLinker->getData(); CTaskReserveArrayQueueConsumer* queueConsumer = dynamic_cast(queue->createTaskReserveQueueConsumer()); newConsumerLinker->initLinker(queueConsumer); mQueueConsumerLinker = newConsumerLinker->append(mQueueConsumerLinker); } CTask* task = nullptr; for (CXLinker* queueConsumerLinkerIt = mQueueConsumerLinker; !task && queueConsumerLinkerIt; queueConsumerLinkerIt = queueConsumerLinkerIt->getNext()) { CTaskReserveArrayQueueConsumer* queueConsumer = queueConsumerLinkerIt->getData(); task = queueConsumer->getTask(); } return task; } cint64 CTaskReserveMultiArrayQueueConsumer::getTakenTask() { return mTakenTask; } cint64 CTaskReserveMultiArrayQueueConsumer::getRequestedTask() { return mRequestedTask; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CDirectDistributionMemoryPoolReleaser.cpp0000644000175000017500000000265112520551272030334 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDirectDistributionMemoryPoolReleaser.h" namespace Konclude { namespace Scheduler { CDirectDistributionMemoryPoolReleaser::CDirectDistributionMemoryPoolReleaser(CConcreteMemoryPoolDistributor* memoryDistributor) { mMemoryDistributor = memoryDistributor; } CDirectDistributionMemoryPoolReleaser::~CDirectDistributionMemoryPoolReleaser() { } CDirectDistributionMemoryPoolReleaser* CDirectDistributionMemoryPoolReleaser::distributeMemoryPools(CMemoryPool* memoryPools) { mMemoryDistributor->distributeMemoryPools(memoryPools); return this; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveArrayQueueConsumer.h0000644000175000017500000000411312520551302026424 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKRESERVEARRAYQUEUECONSUMER_H #define KONCLUDE_SCHEDULER_CTASKRESERVEARRAYQUEUECONSUMER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskReserveQueueConsumer.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Scheduler { /*! * * \class CTaskReserveArrayQueueConsumer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskReserveArrayQueueConsumer : public CTaskReserveQueueConsumer, public CLinkerBase { // public methods public: //! Constructor CTaskReserveArrayQueueConsumer(CTaskReserveArrayQueue* arrayQueue); CTask* getTask(); cint64 getTakenTask(); cint64 getRequestedTask(); // protected methods protected: // protected variables protected: CTaskReserveArrayQueue* mArrayQueue; cint64 mTakenTask; cint64 mRequestedTask; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKRESERVEARRAYQUEUECONSUMER_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskHandleLimitedReserveMemoryPoolAllocationManager.hKonclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskHandleLimitedReserveMemoryPoolAllocationManager0000644000175000017500000000624012520551300032427 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKHANDLELIMITEDRESERVEMEMORYPOOLALLOCATIONMANAGER_H #define KONCLUDE_SCHEDULER_CTASKHANDLELIMITEDRESERVEMEMORYPOOLALLOCATIONMANAGER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskHandleMemoryAllocationManager.h" // Other includes #include "Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.h" #include "Utilities/Memory/CConsiderateMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Memory; namespace Scheduler { /*! * * \class CTaskHandleLimitedReserveMemoryPoolAllocationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskHandleLimitedReserveMemoryPoolAllocationManager : public CLimitedReserveMemoryPoolAllocationManager, virtual public CTaskHandleMemoryAllocationManager { // public methods public: //! Constructor CTaskHandleLimitedReserveMemoryPoolAllocationManager(CConsiderateMemoryPoolProvider* memoryPoolProvider, cint64 freeReserveLimit = 20, cint64 freeReleaseBlockSize = 5); //! Destructor virtual ~CTaskHandleLimitedReserveMemoryPoolAllocationManager(); virtual void* allocate(size_t size); virtual CMemoryAllocationManager* release(void* address); virtual void* allocateAligned(size_t size, int alignment); virtual CMemoryTemporaryAllocationManager* releaseAllMemory(); virtual CMemoryPool* acqireTemporaryMemoryPool(size_t size); virtual CMemoryTemporaryAllocationManager* releaseTemporaryMemoryPool(CMemoryPool* memoryPool); virtual cint64 getOptimizedMoreAllocationSize(cint64 size); virtual CMemoryTemporaryAllocationManager* releaseMemoryPoolContainer(CMemoryPoolContainer* memoryPoolContainer); virtual CMemoryPoolProvider* releaseMemoryPool(CMemoryPool* memoryPool); virtual CMemoryPool* acquireMemoryPool(cint64 minPoolSize); virtual CMemoryPool* acquireMemoryPoolConsiderated(cint64 minPoolSize); // protected methods protected: CConsiderateMemoryPoolProvider* mConsideratedMemPoolProvider; // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKHANDLELIMITEDRESERVEMEMORYPOOLALLOCATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskContextBase.cpp0000644000175000017500000000332612520551276024062 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskContextBase.h" namespace Konclude { namespace Scheduler { CTaskContextBase::CTaskContextBase(CMemoryPoolContainer* memoryPoolContainer, CTaskHandleContext* handleContext) { void* memManAdd = CTaskMemoryPoolAllocationManager::allocateMemoryToContainer(sizeof(CTaskMemoryPoolAllocationManager),memoryPoolContainer,handleContext->getTaskHandleMemoryAllocationManager()); mMemMan = new (memManAdd) CTaskMemoryPoolAllocationManager(memoryPoolContainer,handleContext->getTaskHandleMemoryAllocationManager()); } CTaskContextBase::~CTaskContextBase() { } CTaskContext* CTaskContextBase::updateContext(CTaskHandleContext* handleContext) { mMemMan->updateMemoryProvider(handleContext->getTaskHandleMemoryAllocationManager()); return this; } CMemoryAllocationManager* CTaskContextBase::getMemoryAllocationManager() { return mMemMan; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveQueue.h0000644000175000017500000000344012520551304023715 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKRESERVEQUEUE_H #define KONCLUDE_SCHEDULER_CTASKRESERVEQUEUE_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskReserveQueueConsumer.h" #include "CTask.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskReserveQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskReserveQueue { // public methods public: //! Constructor CTaskReserveQueue(); virtual bool tryAddTasks(CTask*& tasks) = 0; virtual CTaskReserveQueueConsumer* createTaskReserveQueueConsumer() = 0; virtual cint64 getTaskCount() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKRESERVEQUEUE_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessorContext.cpp0000644000175000017500000000205312520551302025151 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskProcessorContext.h" namespace Konclude { namespace Scheduler { CTaskProcessorContext::CTaskProcessorContext() { } CTaskProcessorContext::~CTaskProcessorContext() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CDistributionMemoryPoolProvider.cpp0000644000175000017500000001317512520551272027234 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDistributionMemoryPoolProvider.h" namespace Konclude { namespace Scheduler { CDistributionMemoryPoolProvider::CDistributionMemoryPoolProvider(CMemoryPoolProvider* alternateMemoryPoolProvider, CDistributionMemoryPoolReleaser* distributionMemoryReleaser) : CSortedLinkerBase(this,nullptr) { mLastPickedDistributedPoolLinker = nullptr; mDistributedPoolLinker = nullptr; mAvailablePoolLinker = nullptr; mAlternateMemoryPoolProvider = alternateMemoryPoolProvider; mDistributionMemoryReleaser = distributionMemoryReleaser; mDistributedPoolCount = 0; mPickedPoolCount = 0; mAvailablePoolCount = 0; mAquiredPoolCount = 0; mLastAcquiredPoolCount = 0; mLastAcquiredPoolDiff = 0; mLastSavedMissRatio = 0.; mLastNewDiffRatio = 0.6; } CDistributionMemoryPoolProvider::~CDistributionMemoryPoolProvider() { } CDistributionMemoryPoolProvider* CDistributionMemoryPoolProvider::updateMissingMemoryPoolRatio() { mLastSavedMissRatio = (double)getMemoryPoolSupplyCount()/(double)mLastAcquiredPoolCount; return this; } double CDistributionMemoryPoolProvider::getMissingMemoryPoolRatio() { return mLastSavedMissRatio; } cint64 CDistributionMemoryPoolProvider::getMissingMemoryPoolCount() { return mLastAcquiredPoolDiff - getMemoryPoolSupplyCount(); } cint64 CDistributionMemoryPoolProvider::getMemoryPoolSupplyCount() { return mDistributedPoolCount-mPickedPoolCount+mAvailablePoolCount; } CDistributionMemoryPoolProvider* CDistributionMemoryPoolProvider::updatedRoundAcquiredMemoryPoolCounts() { cint64 roundAcquiredPoolDiff = mAquiredPoolCount - mLastAcquiredPoolCount; mLastAcquiredPoolCount = mAquiredPoolCount; mLastAcquiredPoolDiff = roundAcquiredPoolDiff * (1. - mLastNewDiffRatio) + mLastAcquiredPoolDiff * mLastNewDiffRatio; updateMissingMemoryPoolRatio(); return this; } CDistributionMemoryPoolProvider* CDistributionMemoryPoolProvider::appendDistributedMemoryPools(CMemoryPool* memoryPools) { while (memoryPools) { CMemoryPool* tmpMemoryPool = memoryPools; memoryPools = memoryPools->getNext(); if (mDistributedPoolLinker != tmpMemoryPool) { mDistributedPoolLinker = tmpMemoryPool->setNext(mDistributedPoolLinker); } else { // write access to mLastPickedDistributedPoolLinker is safe only in this case mDistributedPoolLinker = tmpMemoryPool->clearNext(); mLastPickedDistributedPoolLinker = nullptr; } ++mDistributedPoolCount; } return this; } bool CDistributionMemoryPoolProvider::checkAppendableDistributedMemoryPools(CMemoryPool* memoryPools) { CMemoryPool* memoryPoolIt = memoryPools; while (memoryPoolIt) { if (memoryPoolIt == mLastPickedDistributedPoolLinker) { return false; } memoryPoolIt = memoryPoolIt->getNextMemoryPool(); } return true; } bool CDistributionMemoryPoolProvider::pickDistributedMemoryPools() { CMemoryPool* tmpMemoryPoolLinker = mDistributedPoolLinker; if (tmpMemoryPoolLinker && mLastPickedDistributedPoolLinker != tmpMemoryPoolLinker) { CMemoryPool* nextTmpMemoryPoolLinker = tmpMemoryPoolLinker; while (nextTmpMemoryPoolLinker && mLastPickedDistributedPoolLinker != nextTmpMemoryPoolLinker) { CMemoryPool* addTmpMemoryPoolLinker = nextTmpMemoryPoolLinker; nextTmpMemoryPoolLinker = nextTmpMemoryPoolLinker->getNext(); mAvailablePoolLinker = addTmpMemoryPoolLinker->setNext(mAvailablePoolLinker); ++mPickedPoolCount; ++mAvailablePoolCount; } mLastPickedDistributedPoolLinker = tmpMemoryPoolLinker; return true; } return false; } CMemoryPool* CDistributionMemoryPoolProvider::acquireMemoryPool(cint64 minPoolSize) { CMemoryPool* tmpMemoryPool = nullptr; ++mAquiredPoolCount; pickDistributedMemoryPools(); if (mAvailablePoolLinker) { if (mAvailablePoolLinker->getMemoryBlockSize() > minPoolSize) { tmpMemoryPool = mAvailablePoolLinker; mAvailablePoolLinker = mAvailablePoolLinker->getNext(); --mAvailablePoolCount; } } if (!tmpMemoryPool) { tmpMemoryPool = mAlternateMemoryPoolProvider->acquireMemoryPool(minPoolSize); } if (tmpMemoryPool) { tmpMemoryPool->clearNext(); } return tmpMemoryPool; } CDistributionMemoryPoolProvider* CDistributionMemoryPoolProvider::releaseMemoryPool(CMemoryPool* memoryPool) { if (mDistributionMemoryReleaser) { mDistributionMemoryReleaser->distributeMemoryPools(memoryPool); } else { mAlternateMemoryPoolProvider->releaseMemoryPool(memoryPool); } return this; } cint64 CDistributionMemoryPoolProvider::getAllocatedReleaseDifferencePoolCount() { return 0; } cint64 CDistributionMemoryPoolProvider::getAllocatedReleaseDifferencePoolSize() { return 0; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskContext.h0000644000175000017500000000342112520551276022730 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKCONTEXT_H #define KONCLUDE_SCHEDULER_CTASKCONTEXT_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskHandleContext.h" // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Scheduler { /*! * * \class CTaskContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskContext : public CContext { // public methods public: //! Constructor CTaskContext(); //! Destructor virtual ~CTaskContext(); virtual CTaskContext* updateContext(CTaskHandleContext* handleContext) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKCONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskEventHandlerBasedProcessor.h0000644000175000017500000000461612520551276026531 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKEVENTHANDLERBASEDPROCESSOR_H #define KONCLUDE_SCHEDULER_CTASKEVENTHANDLERBASEDPROCESSOR_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskProcessor.h" #include "CEventHandlerVendor.h" #include "CTaskEventHandlerBasedScheduler.h" #include "CTaskHandleAlgorithm.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskEventHandlerBasedProcessor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskEventHandlerBasedProcessor : virtual public CTaskProcessor, virtual public CEventHandlerVendor { // public methods public: //! Constructor CTaskEventHandlerBasedProcessor(); //! Destructor virtual ~CTaskEventHandlerBasedProcessor(); virtual bool canDispenseProcessingTasks() = 0; virtual bool requiresProcessingTasks() = 0; virtual bool requiresSchedulingTasks() = 0; virtual cint64 countDispensableProcessingTasks() = 0; virtual cint64 countScheduleableProcessingTasks() = 0; virtual cint64 getRecievedTasks() = 0; virtual CTaskHandleAlgorithm* getTaskHandleAlgorithm() = 0; virtual CTaskEventHandlerBasedProcessor* installScheduler(CTaskEventHandlerBasedScheduler* scheduler) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKEVENTHANDLERBASEDPROCESSOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveMultiArrayQueueAdderController.cpp0000644000175000017500000000367412520551302031275 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskReserveMultiArrayQueueAdderController.h" namespace Konclude { namespace Scheduler { CTaskReserveMultiArrayQueueAdderController::CTaskReserveMultiArrayQueueAdderController(CTaskReserveMultiArrayQueue* queue) { mQueue = queue; mRequireTaskAddedNotificationFlag = true; } bool CTaskReserveMultiArrayQueueAdderController::requiresTaskAddedNotification() { return mRequireTaskAddedNotificationFlag; } bool CTaskReserveMultiArrayQueueAdderController::hasRequiresTaskAddedNotificationFlag() { return mRequireTaskAddedNotificationFlag; } CTaskReserveMultiArrayQueueAdderController* CTaskReserveMultiArrayQueueAdderController::setRequiresTaskAddedNotificationFlag(bool flag) { mRequireTaskAddedNotificationFlag = flag; return this; } CTaskReserveQueueAdder* CTaskReserveMultiArrayQueueAdderController::createTaskReserveQueueAdder() { CTaskReserveArrayQueue* addedQueue = new CTaskReserveArrayQueue(10000); mQueue->addTaskReserveArrayQueue(addedQueue); CTaskReserveQueueAdder* adder = new CTaskReserveQueueAdder(addedQueue,this); return adder; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CEventDistributionMemoryPoolReleaser.h0000644000175000017500000000442312520551274027651 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CEVENTDISTRIBUTIONMEMORYPOOLRELEASER_H #define KONCLUDE_SCHEDULER_CEVENTDISTRIBUTIONMEMORYPOOLRELEASER_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CDistributionMemoryPoolReleaser.h" #include "CTaskDistributionCompletorCommunicator.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Concurrent/CEventHandler.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Concurrent; namespace Scheduler { /*! * * \class CEventDistributionMemoryPoolReleaser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEventDistributionMemoryPoolReleaser : public CDistributionMemoryPoolReleaser { // public methods public: //! Constructor CEventDistributionMemoryPoolReleaser(CTaskDistributionCompletorCommunicator* distributionCompletorCommunicator); //! Destructor virtual ~CEventDistributionMemoryPoolReleaser(); virtual CEventDistributionMemoryPoolReleaser* distributeMemoryPools(CMemoryPool* memoryPools); // protected methods protected: // protected variables protected: CTaskDistributionCompletorCommunicator* mDistributionCompletorCommunicator; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CEVENTDISTRIBUTIONMEMORYPOOLRELEASER_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessor.h0000644000175000017500000000322512520551300023251 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKPROCESSOR_H #define KONCLUDE_SCHEDULER_CTASKPROCESSOR_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskOwner.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskProcessor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskProcessor : virtual public CTaskOwner { // public methods public: //! Constructor CTaskProcessor(); //! Destructor virtual ~CTaskProcessor(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKPROCESSOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskScheduleItem.cpp0000644000175000017500000000202612520551304024202 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskScheduleItem.h" namespace Konclude { namespace Scheduler { CTaskScheduleItem::CTaskScheduleItem() { } CTaskScheduleItem::~CTaskScheduleItem() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskContextBase.h0000644000175000017500000000411212520551276023521 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKCONTEXTBASE_H #define KONCLUDE_SCHEDULER_CTASKCONTEXTBASE_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskContext.h" #include "CTaskMemoryPoolAllocationManager.h" // Other includes #include "Utilities/Memory/CMemoryPoolContainer.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; using namespace Utilities::Memory; namespace Scheduler { /*! * * \class CTaskContextBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskContextBase : public CTaskContext { // public methods public: //! Constructor CTaskContextBase(CMemoryPoolContainer* memoryPoolContainer, CTaskHandleContext* handleContext); //! Destructor virtual ~CTaskContextBase(); virtual CTaskContext* updateContext(CTaskHandleContext* handleContext); virtual CMemoryAllocationManager* getMemoryAllocationManager(); // protected methods protected: // protected variables protected: CTaskMemoryPoolAllocationManager* mMemMan; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKCONTEXTBASE_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveArrayQueueItem.h0000644000175000017500000000370412520551302025534 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKRESERVEARRAYQUEUEITEM_H #define KONCLUDE_SCHEDULER_CTASKRESERVEARRAYQUEUEITEM_H // Libraries includes #include // Namespace includes #include "SchedulerSettings.h" #include "CTask.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Scheduler { /*! * * \class CTaskReserveArrayQueueItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskReserveArrayQueueItem : public CLinkerBase { // public methods public: //! Constructor CTaskReserveArrayQueueItem(); CTask* tryGetTask(); bool trySetTask(CTask* task); bool setTask(CTask* task); // protected methods protected: // protected variables protected: QAtomicPointer mTaskPointer; // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKRESERVEARRAYQUEUEITEM_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskMemoryAllocationManager.cpp0000644000175000017500000000211512520551300026373 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskMemoryAllocationManager.h" namespace Konclude { namespace Scheduler { CTaskMemoryAllocationManager::CTaskMemoryAllocationManager() { } CTaskMemoryAllocationManager::~CTaskMemoryAllocationManager() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskCompletor.h0000644000175000017500000000314112520551274023245 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKCOMPLETOR_H #define KONCLUDE_SCHEDULER_CTASKCOMPLETOR_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskCompletor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskCompletor { // public methods public: //! Constructor CTaskCompletor(); //! Destructor virtual ~CTaskCompletor(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKCOMPLETOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskStatusPropagator.h0000644000175000017500000000353612520551306024627 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKSTATUSPROPAGATOR_H #define KONCLUDE_SCHEDULER_CTASKSTATUSPROPAGATOR_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTask.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskStatusPropagator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskStatusPropagator { // public methods public: //! Constructor CTaskStatusPropagator(); //! Destructor virtual ~CTaskStatusPropagator(); virtual bool updateTaskStatus(CTask* task, bool& moreDownPropagation, bool& moreUpPropagation) = 0; virtual bool completeTaskStatus(CTask* task, bool& moreUpPropagation) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKSTATUSPROPAGATOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskHandleAlgorithm.h0000644000175000017500000000343112520551276024347 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKHANDLEALGORITHM_H #define KONCLUDE_SCHEDULER_CTASKHANDLEALGORITHM_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTask.h" #include "CTaskProcessorContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Scheduler { /*! * * \class CTaskHandleAlgorithm * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskHandleAlgorithm { // public methods public: //! Constructor CTaskHandleAlgorithm(); //! Destructor virtual ~CTaskHandleAlgorithm(); virtual bool handleTask(CTaskProcessorContext *processorContext, CTask* task) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKHANDLEALGORITHM_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskHandleContext.cpp0000644000175000017500000000203412520551276024376 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskHandleContext.h" namespace Konclude { namespace Scheduler { CTaskHandleContext::CTaskHandleContext() { } CTaskHandleContext::~CTaskHandleContext() { } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskAllocator.cpp0000644000175000017500000000230212520551274023552 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKALLOCATOR_CPP #define KONCLUDE_SCHEDULER_CTASKALLOCATOR_CPP #include "CTaskAllocator.h" namespace Konclude { namespace Scheduler { template CTaskAllocator::CTaskAllocator() { } template CTaskAllocator::~CTaskAllocator() { } }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKALLOCATOR_CPP Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskHandleMemoryPoolAllocationManager.cpp0000644000175000017500000000724112520551300030346 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskHandleMemoryPoolAllocationManager.h" namespace Konclude { namespace Scheduler { CTaskHandleMemoryPoolAllocationManager::CTaskHandleMemoryPoolAllocationManager(CConsiderateMemoryPoolProvider* memoryPoolProvider) : CMemoryPoolAllocationManager(memoryPoolProvider) { mConsideratedMemPoolProvider = memoryPoolProvider; } CTaskHandleMemoryPoolAllocationManager::~CTaskHandleMemoryPoolAllocationManager() { } void* CTaskHandleMemoryPoolAllocationManager::allocate(size_t size) { return CMemoryPoolAllocationManager::allocate(size); } CMemoryAllocationManager* CTaskHandleMemoryPoolAllocationManager::release(void* address) { return CMemoryPoolAllocationManager::release(address); } void* CTaskHandleMemoryPoolAllocationManager::allocateAligned(size_t size, int alignment) { return CMemoryPoolAllocationManager::allocateAligned(size,alignment); } CMemoryTemporaryAllocationManager* CTaskHandleMemoryPoolAllocationManager::releaseAllMemory() { return CMemoryPoolAllocationManager::releaseAllMemory(); } CMemoryPool* CTaskHandleMemoryPoolAllocationManager::acqireTemporaryMemoryPool(size_t size) { return CMemoryPoolAllocationManager::acqireTemporaryMemoryPool(size); } CMemoryTemporaryAllocationManager* CTaskHandleMemoryPoolAllocationManager::releaseTemporaryMemoryPool(CMemoryPool* memoryPool) { return CMemoryPoolAllocationManager::releaseTemporaryMemoryPool(memoryPool); } cint64 CTaskHandleMemoryPoolAllocationManager::getOptimizedMoreAllocationSize(cint64 size) { return CMemoryPoolAllocationManager::getOptimizedMoreAllocationSize(size); } CMemoryTemporaryAllocationManager* CTaskHandleMemoryPoolAllocationManager::releaseMemoryPoolContainer(CMemoryPoolContainer* memoryPoolContainer) { return CMemoryPoolAllocationManager::releaseMemoryPoolContainer(memoryPoolContainer); } CMemoryPoolProvider* CTaskHandleMemoryPoolAllocationManager::releaseMemoryPool(CMemoryPool* memoryPool) { return CMemoryPoolAllocationManager::releaseMemoryPool(memoryPool); } CMemoryPool* CTaskHandleMemoryPoolAllocationManager::acquireMemoryPool(cint64 minPoolSize) { return CMemoryPoolAllocationManager::acquireMemoryPool(minPoolSize); } CMemoryPool* CTaskHandleMemoryPoolAllocationManager::acquireMemoryPoolConsiderated(cint64 minPoolSize) { CMemoryPool* tmpMemoryPool = nullptr; if (mFreeMemoryPoolList) { if (mFreeMemoryPoolList->getMemoryBlockSize() >= minPoolSize) { tmpMemoryPool = mFreeMemoryPoolList; mFreeMemoryPoolList = mFreeMemoryPoolList->getNextMemoryPool(); --mFreeMemoryPoolCount; } } if (!tmpMemoryPool) { tmpMemoryPool = mConsideratedMemPoolProvider->acquireMemoryPoolConsiderated(minPoolSize); } if (tmpMemoryPool) { ++mStatMemToUsingCount; tmpMemoryPool->clearNext(); } return tmpMemoryPool; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskReserveArrayQueueConsumer.cpp0000644000175000017500000000334412520551302026764 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskReserveArrayQueueConsumer.h" #include "CTaskReserveArrayQueue.h" namespace Konclude { namespace Scheduler { CTaskReserveArrayQueueConsumer::CTaskReserveArrayQueueConsumer(CTaskReserveArrayQueue* arrayQueue) : CLinkerBase(this), mArrayQueue(arrayQueue) { mTakenTask = 0; mRequestedTask = 0; } CTask* CTaskReserveArrayQueueConsumer::getTask() { CTask* task = nullptr; bool moreTasksAvailable = true; task = nullptr; while (moreTasksAvailable && !task) { ++mRequestedTask; moreTasksAvailable = mArrayQueue->tryGetTask(task); } if (task != nullptr) { ++mTakenTask; } return task; } cint64 CTaskReserveArrayQueueConsumer::getTakenTask() { return mTakenTask; } cint64 CTaskReserveArrayQueueConsumer::getRequestedTask() { return mRequestedTask; } }; // end namespace Scheduler }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskAllocator.h0000644000175000017500000000414112520551274023222 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKALLOCATOR_H #define KONCLUDE_SCHEDULER_CTASKALLOCATOR_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" // Other includes #include "Utilities/Memory/CObjectMemoryPoolAllocator.h" #include "Utilities/Memory/CMemoryTemporaryAllocationManager.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Scheduler { /*! * * \class CTaskAllocator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CTaskAllocator : public CObjectMemoryPoolAllocator { // public methods public: //! Constructor CTaskAllocator(); //! Destructor virtual ~CTaskAllocator(); static inline T* allocateAndConstructTask(CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { T* object = 0; object = CObjectMemoryPoolAllocator::allocateAndConstructWithMemroyPool(memoryTmpAllocatorManager); return object; } // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #include "CTaskAllocator.cpp" #endif // KONCLUDE_SCHEDULER_CTASKALLOCATOR_H Konclude-v0.6.2-544-SourceCode/Source/Scheduler/CTaskProcessorContext.h0000644000175000017500000000357412520551302024627 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_SCHEDULER_CTASKPROCESSORCONTEXT_H #define KONCLUDE_SCHEDULER_CTASKPROCESSORCONTEXT_H // Libraries includes // Namespace includes #include "SchedulerSettings.h" #include "CTaskHandleContext.h" #include "CTaskProcessorCommunicator.h" // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Scheduler { /*! * * \class CTaskProcessorContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskProcessorContext : public CTaskHandleContext { // public methods public: //! Constructor CTaskProcessorContext(); //! Destructor virtual ~CTaskProcessorContext(); virtual CTaskProcessorCommunicator* getTaskProcessorCommunicator() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Scheduler }; // end namespace Konclude #endif // KONCLUDE_SCHEDULER_CTASKPROCESSORCONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Logger/0000755000175000017500000000000012613407250017501 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Logger/CLogDomain.h0000644000175000017500000000317312520756364021644 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef LOGGER_CLOGDOMAIN_H #define LOGGER_CLOGDOMAIN_H #include #include #include "CLogObserverData.h" #include "CLogMessage.h" namespace Konclude { namespace Logger { /*! \class CLogDomain * \version 0.3 * \author Andreas Steigmiller * \brief The abstract base Class for each Log-Entry for the CLogger */ class CLogDomain { public: CLogDomain(QString domainName); virtual ~CLogDomain(); void addLogObserver(CLogObserverData *observer); void removeLogObserver(CLogObserverData *observer); void postLogMessage(CLogMessage *message); void setDomain(QString domainName); QString getDomain(); private: QLinkedList obsList; QString domain; }; }; // end namespace Logger }; // end namespace Konclude #endif // LOGGER_CLOGDOMAIN_H Konclude-v0.6.2-544-SourceCode/Source/Logger/CLogObserverData.h0000644000175000017500000000375412520550672023015 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef LOGGER_CLogObserverData_H #define LOGGER_CLogObserverData_H #include #include #include "CLogMessage.h" #include "CAbstractLogObserver.h" namespace Konclude { namespace Logger { /*! \class CLogObserverData * \version 0.3 * \author Andreas Steigmiller * \brief The abstract base Class for each Log-Entry for the CLogger */ class CLogObserverData { public: CLogObserverData(CAbstractLogObserver *logObserver, double logLevel = 0, QStringList observeDomains = QStringList()); virtual ~CLogObserverData(); virtual void postLogMessage(CLogMessage *message); virtual void postLogMessageOnce(CLogMessage *message); virtual void postLogMessageMulti(CLogMessage *message); QStringList getLogDomains(); void setLogDomains(QStringList observeDomains); void addLogDomain(QString domain); void removeLogDomain(QString domain); double getLogLevel(); void setLogLevel(double logLevel); private: CAbstractLogObserver *observer; QSet sendedLogSet; bool postOnce; QStringList domains; double level; }; }; // end namespace Logger }; // end namespace Konclude #endif // LOGGER_CLogObserverData_H Konclude-v0.6.2-544-SourceCode/Source/Logger/Events/0000755000175000017500000000000012613407250020745 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Logger/Events/CReleaseLogMessagesEvent.cpp0000644000175000017500000000313112520756362026276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReleaseLogMessagesEvent.h" namespace Konclude { namespace Logger { namespace Events { CReleaseLogMessagesEvent::CReleaseLogMessagesEvent(QLinkedList &logMessages) : CCustomEvent(EVENTRELEASELOGMESSAGES) { messages = logMessages; } CReleaseLogMessagesEvent::CReleaseLogMessagesEvent() : CCustomEvent(EVENTRELEASELOGMESSAGES) { messages = QLinkedList(); } CReleaseLogMessagesEvent::~CReleaseLogMessagesEvent() { } void CReleaseLogMessagesEvent::setLogMessages(QLinkedList &logMessages) { messages = logMessages; } QLinkedList CReleaseLogMessagesEvent::getLogMessages() { return messages; } }; // end namespace Events }; // end namespace Logger }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Logger/Events/CConfigureLoggerEvent.h0000644000175000017500000000356412520756362025324 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef LOGGER_EVENTS_CCONFIGURELOGGEREVENT_H #define LOGGER_EVENTS_CCONFIGURELOGGEREVENT_H #include #include #include #include "Concurrent/Events/CCustomEvent.h" #include "../LoggerSettings.h" #include "../CLogMessage.h" namespace Konclude { using namespace Concurrent; using namespace Events; namespace Logger { namespace Events { /*! * \class CConfigureLoggerEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CConfigureLoggerEvent : public CCustomEvent { // public methods public: //! Constructor CConfigureLoggerEvent(qint64 maxLogMessages, double minLogLevel); //! Destructor virtual ~CConfigureLoggerEvent(); qint64 getMaxLogMessageCount(); double getMinLoggingLevel(); // protected methods protected: // private members private: qint64 mMaxLogMessageCount; double mMinLogLevel; }; }; // end namespace Events }; // end namespace Logger }; // end namespace Konclude #endif // LOGGER_EVENTS_CCONFIGURELOGGEREVENT_H Konclude-v0.6.2-544-SourceCode/Source/Logger/Events/CReleaseLogMessagesEvent.h0000644000175000017500000000374512520756362025756 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_LOGGER_EVENTS_CRELEASELOGMESSAGESEVENT_H #define KONCLUDE_LOGGER_EVENTS_CRELEASELOGMESSAGESEVENT_H #include #include #include #include "Concurrent/Events/CCustomEvent.h" #include "../LoggerSettings.h" #include "../CLogMessage.h" namespace Konclude { using namespace Concurrent; using namespace Events; namespace Logger { namespace Events { /*! * \class CReleaseLogMessagesEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CReleaseLogMessagesEvent : public CCustomEvent { // public methods public: //! Constructor CReleaseLogMessagesEvent(QLinkedList &logMessages); CReleaseLogMessagesEvent(); //! Destructor virtual ~CReleaseLogMessagesEvent(); void setLogMessages(QLinkedList &logMessages); QLinkedList getLogMessages(); // protected methods protected: // private members private: QLinkedList messages; }; }; // end namespace Events }; // end namespace Logger }; // end namespace Konclude #endif // KONCLUDE_LOGGER_EVENTS_CRELEASELOGMESSAGESEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Logger/Events/CLoggingEvent.h0000644000175000017500000000335212520756362023624 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef LOGGER_EVENTS_CLOGGINGEVENT_H #define LOGGER_EVENTS_CLOGGINGEVENT_H #include #include "Concurrent/Events/CCustomEvent.h" #include "../LoggerSettings.h" #include "../CLogMessage.h" namespace Konclude { using namespace Concurrent; using namespace Events; namespace Logger { namespace Events { /*! * \class CLoggingEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CLoggingEvent : public CCustomEvent { // public methods public: //! Constructor CLoggingEvent(CLogMessage *logMessage); //! Destructor virtual ~CLoggingEvent(); CLogMessage *getLogMessage(); void setLogMessage(CLogMessage *logMessage); // protected methods protected: // private members private: CLogMessage *message; }; }; // end namespace Events }; // end namespace Logger }; // end namespace Konclude #endif // LOGGER_EVENTS_CLOGGINGEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Logger/Events/CRequestLogMessagesEvent.cpp0000644000175000017500000000545512520756362026361 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRequestLogMessagesEvent.h" namespace Konclude { namespace Logger { namespace Events { CRequestLogMessagesEvent::CRequestLogMessagesEvent(CCallbackData *callback, qint64 beginID, qint64 endID, double beginLevel, double endLevel, QStringList domainList, QLinkedList objectList) : CCustomCallbackEvent(EVENTREQUESTLOGMESSAGES,callback) { messageIDBegin = beginID; messageIDEnd = endID; levelBegin = beginLevel; levelEnd = endLevel; domains = domainList; objects = objectList; } CRequestLogMessagesEvent::~CRequestLogMessagesEvent() { } CRequestLogMessagesEvent *CRequestLogMessagesEvent::setMessageBeginID(qint64 beginID) { messageIDBegin = beginID; return this; } qint64 CRequestLogMessagesEvent::getMessageBeginID() { return messageIDBegin; } CRequestLogMessagesEvent *CRequestLogMessagesEvent::setMessageEndID(qint64 endID) { messageIDEnd = endID; return this; } qint64 CRequestLogMessagesEvent::getMessageEndID() { return messageIDEnd; } CRequestLogMessagesEvent *CRequestLogMessagesEvent::setLevelBegin(double beginLevel) { levelBegin = beginLevel; return this; } double CRequestLogMessagesEvent::getBeginLevel() { return levelBegin; } CRequestLogMessagesEvent *CRequestLogMessagesEvent::setLevelEnd(double endLevel) { levelEnd = endLevel; return this; } double CRequestLogMessagesEvent::getEndLevel() { return levelEnd; } CRequestLogMessagesEvent *CRequestLogMessagesEvent::setDomains(QStringList domainList) { domains = domainList; return this; } QStringList CRequestLogMessagesEvent::getDomains() { return domains; } CRequestLogMessagesEvent *CRequestLogMessagesEvent::setObjects(QLinkedList objectList) { objects = objectList; return this; } QLinkedList CRequestLogMessagesEvent::getObjects() { return objects; } }; // end namespace Events }; // end namespace Logger }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Logger/Events/CRequestLogMessagesEvent.h0000644000175000017500000000517412520756362026024 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef LOGGER_EVENTS_CREQUESTLOGMESSAGESEVENT_H #define LOGGER_EVENTS_CREQUESTLOGMESSAGESEVENT_H #include #include #include #include "Concurrent/Events/CCustomCallbackEvent.h" #include "../LoggerSettings.h" #include "../CLogMessage.h" namespace Konclude { using namespace Concurrent; using namespace Events; namespace Logger { namespace Events { /*! * \class CRequestLogMessagesEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CRequestLogMessagesEvent : public CCustomCallbackEvent { // public methods public: //! Constructor CRequestLogMessagesEvent(CCallbackData *callback, qint64 beginID, qint64 endID, double beginLevel, double endLevel, QStringList domainList, QLinkedList objectList); //! Destructor virtual ~CRequestLogMessagesEvent(); CRequestLogMessagesEvent *setMessageBeginID(qint64 beginID); qint64 getMessageBeginID(); CRequestLogMessagesEvent *setMessageEndID(qint64 endID); qint64 getMessageEndID(); CRequestLogMessagesEvent *setLevelBegin(double beginLevel); double getBeginLevel(); CRequestLogMessagesEvent *setLevelEnd(double endLevel); double getEndLevel(); CRequestLogMessagesEvent *setDomains(QStringList domainList); QStringList getDomains(); CRequestLogMessagesEvent *setObjects(QLinkedList objectList); QLinkedList getObjects(); // protected methods protected: // private members private: qint64 messageIDBegin; qint64 messageIDEnd; double levelBegin; double levelEnd; QStringList domains; QLinkedList objects; }; }; // end namespace Events }; // end namespace Logger }; // end namespace Konclude #endif // LOGGER_EVENTS_CREQUESTLOGMESSAGESEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Logger/Events/CLoggingEvent.cpp0000644000175000017500000000246112520756362024157 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLoggingEvent.h" namespace Konclude { namespace Logger { namespace Events { CLoggingEvent::CLoggingEvent(CLogMessage *logMessage) : CCustomEvent(EVENTLOGMESSAGE) { message = logMessage; } CLoggingEvent::~CLoggingEvent() { } CLogMessage *CLoggingEvent::getLogMessage() { return message; } void CLoggingEvent::setLogMessage(CLogMessage *logMessage) { message = logMessage; } }; // end namespace Events }; // end namespace Logger }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Logger/Events/CConfigureLoggerEvent.cpp0000644000175000017500000000265612520756362025660 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfigureLoggerEvent.h" namespace Konclude { namespace Logger { namespace Events { CConfigureLoggerEvent::CConfigureLoggerEvent(qint64 maxLogMessages, double minLogLevel) : CCustomEvent(EVENTCONFIGURELOGGER) { mMaxLogMessageCount = maxLogMessages; mMinLogLevel = minLogLevel; } CConfigureLoggerEvent::~CConfigureLoggerEvent() { } qint64 CConfigureLoggerEvent::getMaxLogMessageCount() { return mMaxLogMessageCount; } double CConfigureLoggerEvent::getMinLoggingLevel() { return mMinLogLevel; } }; // end namespace Events }; // end namespace Logger }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Logger/COREFilePrintLogObserver.h0000644000175000017500000000361012520550672024375 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_LOGGER_COREFILEPRINTLOGOBSERVER_H #define KONCLUDE_LOGGER_COREFILEPRINTLOGOBSERVER_H // Libraries includes #include #include #include #include // Namespace includes #include "CAbstractLogObserver.h" #include "CLogger.h" // Other includes #include // Logger includes namespace Konclude { namespace Logger { /*! * * \class COREFilePrintLogObserver * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COREFilePrintLogObserver : public CAbstractLogObserver { public: COREFilePrintLogObserver(const QString& outputFileString); virtual ~COREFilePrintLogObserver(); virtual void postLogMessage(CLogMessage *message); void flushLogging(); void closeOutputFile(); void forcedPathCreated(const QString& filePath); private: QString mOutputFileString; QFile mOutputFile; bool mOutputFileOpened; double mMinLogLevel; double mMaxLogLevel; }; }; // end namespace Logger }; // end namespace Konclude #endif // KONCLUDE_LOGGER_COREFILEPRINTLOGOBSERVER_H Konclude-v0.6.2-544-SourceCode/Source/Logger/CLogDomain.cpp0000644000175000017500000000301312520756364022170 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLogDomain.h" namespace Konclude { namespace Logger { CLogDomain::CLogDomain(QString domainName) { domain = domainName; } CLogDomain::~CLogDomain() { } void CLogDomain::addLogObserver(CLogObserverData *observer) { obsList.append(observer); } void CLogDomain::removeLogObserver(CLogObserverData *observer) { obsList.removeAll(observer); } void CLogDomain::postLogMessage(CLogMessage *message) { foreach (CLogObserverData *observer, obsList) { observer->postLogMessage(message); } } void CLogDomain::setDomain(QString domainName) { domain = domainName; } QString CLogDomain::getDomain() { return domain; } }; // end namespace Logger }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Logger/COREConsolePrintLogObserver.h0000644000175000017500000000337212520550672025125 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_LOGGER_CORECONSOLEPRINTLOGOBSERVER_H #define KONCLUDE_LOGGER_CORECONSOLEPRINTLOGOBSERVER_H // Libraries includes #include #include // Namespace includes #include "CAbstractLogObserver.h" #include "CLogger.h" // Other includes #include // Logger includes namespace Konclude { namespace Logger { /*! * * \class COREConsolePrintLogObserver * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COREConsolePrintLogObserver : public CAbstractLogObserver { public: COREConsolePrintLogObserver(const QStringList& domainInfoList); virtual ~COREConsolePrintLogObserver(); virtual void postLogMessage(CLogMessage *message); void flushLogging(); private: QSet domainInfoSet; double mMinLogLevel; double mMaxLogLevel; }; }; // end namespace Logger }; // end namespace Konclude #endif // KONCLUDE_LOGGER_CORECONSOLEPRINTLOGOBSERVER_H Konclude-v0.6.2-544-SourceCode/Source/Logger/CCallbackRequestLogMessagesContext.h0000644000175000017500000000346612520756364026544 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_LOGGER_CCALLBACKREQUESTLOGMESSAGESCONTEXT_H #define KONCLUDE_LOGGER_CCALLBACKREQUESTLOGMESSAGESCONTEXT_H #include #include "CLogMessage.h" #include "Concurrent/Callback/CCallbackDataContext.h" namespace Konclude { using namespace Concurrent; using namespace Callback; namespace Logger { /*! * * \class CCallbackRequestLogMessagesContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCallbackRequestLogMessagesContext : public CCallbackDataContext { public: CCallbackRequestLogMessagesContext(); virtual ~CCallbackRequestLogMessagesContext(); void setLogMessages(QLinkedList logMessages); void addLogMessage(CLogMessage *logMessages); QLinkedList getLogMessages(); void releaseMessages(); private: QLinkedList messages; }; }; // end namespace Logger }; // end namespace Konclude #endif // KONCLUDE_LOGGER_CCALLBACKREQUESTLOGMESSAGESCONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Logger/LoggerSettings.h0000644000175000017500000000322112520550674022616 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_LOGGER_SETTINGS_H #define KONCLUDE_LOGGER_SETTINGS_H #include namespace Konclude { namespace Logger { //#define LOGGER_DEBUG /*! \file * \version 0.1 * \author Andreas Steigmiller * \brief Settings for Logger */ const QEvent::Type EVENTLOG = (QEvent::Type)1200; const QEvent::Type EVENTLOGMESSAGESREQUEST = (QEvent::Type)1201; const QEvent::Type EVENTSAVELOG = (QEvent::Type)1202; enum LogMessageTyp { LMINFORMATION = 0, LMWARNING = 1, LMERROR = 2 }; const QEvent::Type EVENTLOGMESSAGE = (QEvent::Type)3000; const QEvent::Type EVENTREQUESTLOGMESSAGES = (QEvent::Type)3001; const QEvent::Type EVENTRELEASELOGMESSAGES = (QEvent::Type)3002; const QEvent::Type EVENTCONFIGURELOGGER = (QEvent::Type)3003; }; // end namespace Logger }; // end namespace Konclude #endif // KONCLUDE_LOGGER_SETTINGS_HKonclude-v0.6.2-544-SourceCode/Source/Logger/CQtDebugPrintLogObserver.cpp0000644000175000017500000000252612520550674025045 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQtDebugPrintLogObserver.h" namespace Konclude { namespace Logger { CQtDebugPrintLogObserver::CQtDebugPrintLogObserver() { } CQtDebugPrintLogObserver::~CQtDebugPrintLogObserver() { } void CQtDebugPrintLogObserver::postLogMessage(CLogMessage *message) { qDebug( QString(message->getDateTimeMSecString() + "[" + message->getDomain() + "]>> " + message->getMessage()) .replace("\r\n","\n") .replace("\n","\t\r\n") .toLocal8Bit().data() ); } }; // end namespace Logger }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Logger/CConsolePrintLogObserver.cpp0000644000175000017500000000323412520756364025115 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConsolePrintLogObserver.h" namespace Konclude { namespace Logger { CConsolePrintLogObserver::CConsolePrintLogObserver() { CLogger* logger = CLogger::getInstance(); CCallbackRequestLogMessagesContext* logMessagesContext = logger->getLogMessages(0,-1,0,100,QStringList(),QLinkedList()); foreach (CLogMessage* message, logMessagesContext->getLogMessages()) { postLogMessage(message); } logMessagesContext->releaseMessages(); } CConsolePrintLogObserver::~CConsolePrintLogObserver() { } void CConsolePrintLogObserver::postLogMessage(CLogMessage *message) { std::cout << message->getDateTimeMSecString().toLocal8Bit().data() << "[" << message->getDomain().toLocal8Bit().data() << "]>> " << message->getMessage().toLocal8Bit().data() << "\r\n"<. * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef LOGGER_CLOGIDENTIFIER_H #define LOGGER_CLOGIDENTIFIER_H #include #include namespace Konclude { namespace Logger { /*! * * \class CLogIdentifier * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLogIdentifier { public: CLogIdentifier(const QString &domainName, void *logObject); virtual ~CLogIdentifier(); virtual QString getLogDomain(); virtual void *getLogObject(); private: QString domain; void *object; }; }; // end namespace Logger }; // end namespace Konclude #endif // LOGGER_CLOGIDENTIFIER_H Konclude-v0.6.2-544-SourceCode/Source/Logger/CConsolePrintConfigurableLogObserver.h0000644000175000017500000000373212520756364027106 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_LOGGER_CCONSOLEPRINTCONFIGURABLELOGOBSERVER_H #define KONCLUDE_LOGGER_CCONSOLEPRINTCONFIGURABLELOGOBSERVER_H // Libraries includes #include #include // Namespace includes #include "CAbstractLogObserver.h" #include "CLogger.h" // Other includes #include // Logger includes namespace Konclude { namespace Logger { /*! * * \class CConsolePrintConfigurableLogObserver * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConsolePrintConfigurableLogObserver : public CAbstractLogObserver { public: CConsolePrintConfigurableLogObserver(QStringList domainInfoList, double domainFilterLevel = 60., bool printTime = true, bool printDomain = true, bool printMessage = true, bool printError = true); virtual ~CConsolePrintConfigurableLogObserver(); virtual void postLogMessage(CLogMessage *message); private: QSet domainInfoSet; bool confTime; bool confDomain; bool confMessage; bool confError; double mDomainFilterLevel; }; }; // end namespace Logger }; // end namespace Konclude #endif // KONCLUDE_LOGGER_CCONSOLEPRINTCONFIGURABLELOGOBSERVER_H Konclude-v0.6.2-544-SourceCode/Source/Logger/CConsolePrintConfigurableLogObserver.cpp0000644000175000017500000000667312520756364027450 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConsolePrintConfigurableLogObserver.h" namespace Konclude { namespace Logger { CConsolePrintConfigurableLogObserver::CConsolePrintConfigurableLogObserver(QStringList domainInfoList, double domainFilterLevel, bool printTime, bool printDomain, bool printMessage, bool printError) { confTime = printTime; confDomain = printDomain; confMessage = printMessage; confError = printError; mDomainFilterLevel = domainFilterLevel; foreach (QString domainString, domainInfoList) { domainInfoSet.insert(domainString); } CLogger* logger = CLogger::getInstance(); CCallbackRequestLogMessagesContext* logMessagesContext = logger->getLogMessages(0,-1,30,100,QStringList(),QLinkedList()); foreach (CLogMessage* message, logMessagesContext->getLogMessages()) { postLogMessage(message); } logMessagesContext->releaseMessages(); } CConsolePrintConfigurableLogObserver::~CConsolePrintConfigurableLogObserver() { } void CConsolePrintConfigurableLogObserver::postLogMessage(CLogMessage *message) { bool printMessage = true; double logLevel = message->getLogLevel(); QString logLevelString; QString domainString = message->getDomain(); if (logLevel >= 90) { logLevelString = "catastrophic error"; } else if (logLevel >= 80) { logLevelString = "exceptional error"; } else if (logLevel >= 70) { logLevelString = "error"; } else if (logLevel >= 60) { logLevelString = "warning"; } else if (logLevel >= 30) { logLevelString = "info"; } else { printMessage = false; logLevelString = "notice"; } bool filterMessage = false; if (logLevel < mDomainFilterLevel) { filterMessage = true; } if (filterMessage && logLevel >= 30) { printMessage = domainInfoSet.contains(domainString); } if (printMessage) { QString messageString; if (confError) { if (!messageString.isEmpty()) { messageString += QString(" "); } messageString += QString("{%1}").arg(logLevelString); } if (confTime) { if (!messageString.isEmpty()) { messageString += QString(" "); } messageString += QString(message->getTimeMSecString()); } if (confDomain) { if (!messageString.isEmpty()) { messageString += QString(" "); } messageString += QString("[%1]").arg(domainString); } if (confMessage) { if (!messageString.isEmpty()) { messageString += QString(" >> "); } messageString += QString("%1").arg(message->getMessage()); } std::cout << messageString.toLocal8Bit().data() << "\r\n"<. * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLogMessage.h" namespace Konclude { namespace Logger { CLogMessage::CLogMessage(QString logDomain, QString logMessage, double logLevel, void *logObject) { message = logMessage; level = logLevel; domain = logDomain; datetime = QDateTime::currentDateTime(); object = logObject; lockCount = 0; } CLogMessage::~CLogMessage() { } void CLogMessage::setLockCount(qint64 count) { lockCount = count; } void CLogMessage::incLockCount() { lockCount++; } void CLogMessage::decLockCount() { lockCount--; if (lockCount < 0) { lockCount = 0; } } qint64 CLogMessage::getLockCount() { return lockCount; } QString CLogMessage::getMessage() { return message; } void CLogMessage::setMessage(QString logMessage) { message = logMessage; } QDateTime CLogMessage::getDateTime() { return datetime; } QString CLogMessage::getDateTimeString() { return datetime.toString(Qt::SystemLocaleDate); } QString CLogMessage::getDateTimeMSecString() { int msec = datetime.time().msec(); QString msecString(QString("%1").arg(msec)); while (msecString.length() < 3) { msecString = msecString.insert(0,'0'); } return QString("%1.%2").arg(datetime.toString(Qt::SystemLocaleDate)).arg(msecString); } QString CLogMessage::getTimeMSecString() { return QString("%1").arg(datetime.toString("hh:mm:ss:zzz")); } double CLogMessage::getLogLevel() { return level; } void CLogMessage::setLogLevel(double logLevel) { level = logLevel; } QString CLogMessage::getDomain() { return domain; } void CLogMessage::setDomain(QString logDomain) { domain = logDomain; } void CLogMessage::setLogObject(void *logObject) { object = logObject; } void *CLogMessage::getLogObject() { return object; } void CLogMessage::setLogID(qint64 id) { logID = id; } qint64 CLogMessage::getLogID() { return logID; } }; // end namespace Logger }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Logger/CConsolePrintLogObserver.h0000644000175000017500000000272512520756364024566 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_LOGGER_CCONSOLEPRINTLOGOBSERVER_H #define KONCLUDE_LOGGER_CCONSOLEPRINTLOGOBSERVER_H #include #include "CAbstractLogObserver.h" #include "CLogger.h" namespace Konclude { namespace Logger { /*! * \class CConsolePrintLogObserver * \version 0.3 * \author Andreas Steigmiller * \brief TODO */ class CConsolePrintLogObserver : public CAbstractLogObserver { public: CConsolePrintLogObserver(); virtual ~CConsolePrintLogObserver(); virtual void postLogMessage(CLogMessage *message); private: }; }; // end namespace Logger }; // end namespace Konclude #endif // KONCLUDE_LOGGER_CCONSOLEPRINTLOGOBSERVER_H Konclude-v0.6.2-544-SourceCode/Source/Logger/CLogObserverData.cpp0000644000175000017500000000442112520550672023340 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLogObserverData.h" namespace Konclude { namespace Logger { CLogObserverData::CLogObserverData(CAbstractLogObserver *logObserver, double logLevel, QStringList observeDomains) { observer = logObserver; postOnce = true; } CLogObserverData::~CLogObserverData() { } QStringList CLogObserverData::getLogDomains() { return domains; } void CLogObserverData::setLogDomains(QStringList observeDomains) { domains = observeDomains; } void CLogObserverData::addLogDomain(QString domain) { domains.append(domain); } double CLogObserverData::getLogLevel() { return level; } void CLogObserverData::setLogLevel(double logLevel) { level = logLevel; } void CLogObserverData::postLogMessage(CLogMessage *message) { if (postOnce) { postLogMessageOnce(message); } else { postLogMessageMulti(message); } } void CLogObserverData::postLogMessageOnce(CLogMessage *message) { qint64 messageID = message->getLogID(); if (!sendedLogSet.contains(messageID)) { sendedLogSet.insert(messageID); if (observer) { observer->postLogMessage(message); } } } void CLogObserverData::removeLogDomain(QString domain) { domains.removeAll(domain); } void CLogObserverData::postLogMessageMulti(CLogMessage *message) { qint64 messageID = message->getLogID(); sendedLogSet.insert(messageID); if (observer) { observer->postLogMessage(message); } } }; // end namespace Logger }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Logger/CLogger.h0000644000175000017500000002765212520550672021214 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_LOGGER_CLOGGER_H #define KONCLUDE_LOGGER_CLOGGER_H #include #include #include #include #include #include #include #include #include #include #include #include #include "Concurrent/CIntervalThread.h" #include "Concurrent/Callback/CCallbackData.h" #include "Concurrent/Callback/CBlockingCallbackData.h" #include "CLogMessage.h" #include "CLogDomain.h" #include "CAbstractLogObserver.h" #include "CCallbackRequestLogMessagesContext.h" #include "LoggerSettings.h" #include "Events/CLoggingEvent.h" #include "Events/CRequestLogMessagesEvent.h" #include "Events/CReleaseLogMessagesEvent.h" #include "Events/CConfigureLoggerEvent.h" using namespace std; // define which messages are in fact logged #ifdef LOGGER_DEBUG #define LOGNOTICELEVEL(domain,message,object) if (Konclude::Logger::CLogger::getInstance()->hasMinLoggingLevel(20)) Konclude::Logger::CLogger::getInstance()->addLogMessage(message,20,domain,object); #define LOGINFOLEVEL(domain,message,object) if (Konclude::Logger::CLogger::getInstance()->hasMinLoggingLevel(30)) Konclude::Logger::CLogger::getInstance()->addLogMessage(message,30,domain,object); #define LOGWARNINGLEVEL(domain,message,object) if (Konclude::Logger::CLogger::getInstance()->hasMinLoggingLevel(60)) Konclude::Logger::CLogger::getInstance()->addLogMessage(message,60,domain,object); #define LOGERRORLEVEL(domain,message,object) if (Konclude::Logger::CLogger::getInstance()->hasMinLoggingLevel(70)) Konclude::Logger::CLogger::getInstance()->addLogMessage(message,70,domain,object); #define LOGEXCEPTIONLEVEL(domain,message,object) if (Konclude::Logger::CLogger::getInstance()->hasMinLoggingLevel(80)) Konclude::Logger::CLogger::getInstance()->addLogMessage(message,80,domain,object); #define LOGCATASTROPHICLEVEL(domain,message,object) if (Konclude::Logger::CLogger::getInstance()->hasMinLoggingLevel(90)) Konclude::Logger::CLogger::getInstance()->addLogMessage(message,90,domain,object); #else #define LOGNOTICELEVEL(domain,message,object) #define LOGINFOLEVEL(domain,message,object) if (Konclude::Logger::CLogger::getInstance()->hasMinLoggingLevel(30)) Konclude::Logger::CLogger::getInstance()->addLogMessage(message,30,domain,object); #define LOGWARNINGLEVEL(domain,message,object) if (Konclude::Logger::CLogger::getInstance()->hasMinLoggingLevel(60)) Konclude::Logger::CLogger::getInstance()->addLogMessage(message,60,domain,object); #define LOGERRORLEVEL(domain,message,object) if (Konclude::Logger::CLogger::getInstance()->hasMinLoggingLevel(70)) Konclude::Logger::CLogger::getInstance()->addLogMessage(message,70,domain,object); #define LOGEXCEPTIONLEVEL(domain,message,object) if (Konclude::Logger::CLogger::getInstance()->hasMinLoggingLevel(80)) Konclude::Logger::CLogger::getInstance()->addLogMessage(message,80,domain,object); #define LOGCATASTROPHICLEVEL(domain,message,object) if (Konclude::Logger::CLogger::getInstance()->hasMinLoggingLevel(90)) Konclude::Logger::CLogger::getInstance()->addLogMessage(message,90,domain,object); #endif #define LOGCUSTOMLEVEL(level,domain,message,object) if (Konclude::Logger::CLogger::getInstance()->hasMinLoggingLevel(level)) Konclude::Logger::CLogger::getInstance()->addLogMessage(message,level,domain,object); // simplifications (only name mapping to previous defined) #define LOGINFO(domain,message,object) LOGINFOLEVEL(domain,message,object) #define LOGINFORMATION(domain,message,object) LOGINFOLEVEL(domain,message,object) #define LOGNOTICE(domain,message,object) LOGNOTICELEVEL(domain,message,object) #define LOGNOTE(domain,message,object) LOGNOTICELEVEL(domain,message,object) #define LOGWARNING(domain,message,object) LOGWARNINGLEVEL(domain,message,object) #define LOGWARN(domain,message,object) LOGWARNINGLEVEL(domain,message,object) #define LOGERROR(domain,message,object) LOGERRORLEVEL(domain,message,object) #define LOGERR(domain,message,object) LOGERRORLEVEL(domain,message,object) #define LOGEXCEPTION(domain,message,object) LOGEXCEPTIONLEVEL(domain,message,object) #define LOGEXC(domain,message,object) LOGEXCEPTIONLEVEL(domain,message,object) #define LOGCATASTROPHIC(domain,message,object) LOGCATASTROPHICLEVEL(domain,message,object) #define LOGCAT(domain,message,object) LOGCATASTROPHICLEVEL(domain,message,object) // more simplifications (only name mapping to previous defined) #define LOGLOGNOTICELEVEL(domain,message,object) LOGNOTICELEVEL(domain,message,object) #define LOGLOGINFOLEVEL(domain,message,object) LOGINFOLEVEL(domain,message,object) #define LOGLOGWARNINGLEVEL(domain,message,object) LOGWARNINGLEVEL(domain,message,object) #define LOGLOGERRORLEVEL(domain,message,object) LOGERRORLEVEL(domain,message,object) #define LOGLOGEXCEPTIONLEVEL(domain,message,object) LOGEXCEPTIONLEVEL(domain,message,object) #define LOGLOGCATASTROPHICLEVEL(domain,message,object) LOGCATASTROPHICLEVEL(domain,message,object) #define LOGLOGINFO(domain,message,object) LOGINFOLEVEL(domain,message,object) #define LOGLOGINFORMATION(domain,message,object) LOGINFOLEVEL(domain,message,object) #define LOGLOGNOTICE(domain,message,object) LOGNOTICELEVEL(domain,message,object) #define LOGLOGNOTE(domain,message,object) LOGNOTICELEVEL(domain,message,object) #define LOGLOGWARNING(domain,message,object) LOGWARNINGLEVEL(domain,message,object) #define LOGLOGWARN(domain,message,object) LOGWARNINGLEVEL(domain,message,object) #define LOGLOGERROR(domain,message,object) LOGERRORLEVEL(domain,message,object) #define LOGLOGERR(domain,message,object) LOGERRORLEVEL(domain,message,object) #define LOGLOGEXCEPTION(domain,message,object) LOGEXCEPTIONLEVEL(domain,message,object) #define LOGLOGEXC(domain,message,object) LOGEXCEPTIONLEVEL(domain,message,object) #define LOGLOGCATASTROPHIC(domain,message,object) LOGCATASTROPHICLEVEL(domain,message,object) #define LOGLOGCAT(domain,message,object) LOGCATASTROPHICLEVEL(domain,message,object) // more simplifications (only name mapping to previous defined) #define LOG10(domain,message,object) LOGCUSTOMLEVEL(10,domain,message,object) #define LOG20(domain,message,object) LOGINFOLEVEL(domain,message,object) #define LOG30(domain,message,object) LOGNOTICELEVEL(domain,message,object) #define LOG40(domain,message,object) LOGCUSTOMLEVEL(40,domain,message,object) #define LOG50(domain,message,object) LOGCUSTOMLEVEL(50,domain,message,object) #define LOG60(domain,message,object) LOGWARNINGLEVEL(domain,message,object) #define LOG70(domain,message,object) LOGERRORLEVEL(domain,message,object) #define LOG80(domain,message,object) LOGEXCEPTIONLEVEL(domain,message,object) #define LOG90(domain,message,object) LOGCATASTROPHICLEVEL(domain,message,object) /*! Logs a message \param LOGTYPE Identifies the logging level. With the LoggingSettings you are able to compile the program without Logs from specifics levels. - Use NOTICE to writing information logging messages which are probably ignored if compiling not under Debug. NOTE: This can be controlled in the LoggerSettings. - Use INFO to log informations which should be always logged. E.g. program outputs. - Use WARNING to log warning messages, what should mean that the program is still able to continue the execution, but something is not how it should. - Use ERROR to log error messages, what should mean that the program can not continue the current operation. - Use EXCEPTION to log exception messages, which is may also called from an exception constructor. - Use CATASTROPHIC to log catastrophic messages, which should mean the program isn't able to continue the execution and a crash is probably unavoidable. \param domain Identifies the log domain, the most global domain is '::'. Separate each domain with another '::'. \param message The literal message which should be logged. \param object Identifies the object where the log message is occurred. This may helps to tracking/monitor a faulty object. */ #define LOG(LOGTYPE,domain,message,object) LOG##LOGTYPE(domain,message,object) //! Log a message with a custom logging level #define LOGC(level,domain,message,object) LOGCUSTOMLEVEL(level,domain,message,object) QString logTr(const char *sourceText, const char *comment = 0, int n = -1); namespace Konclude { using namespace Concurrent; using namespace Callback; namespace Logger { using namespace Events; /*! * \class CLogger * \version 0.3 * \author Andreas Steigmiller * \brief Logs messages and posts them to connected Log Observers. The Logger is running in an own Thread. Use LOG(...) to add log messages. */ class CLogger : public CIntervalThread { public: //! returns the Instance of this Singleton-Class static CLogger *getInstance(); void addLogObserver(CAbstractLogObserver *observer, double level = 0, QStringList domain = QStringList()); void removeObserverFromAllDomains(CAbstractLogObserver *observer); void removeObserverFromDomains(CAbstractLogObserver *observer, QStringList domains); void addLogMessage(QString message, double level = 0, QString domain = "::", void *object = 0); void getLogMessages(CCallbackData *callback, qint64 messageIDBegin = 0, qint64 messageIDEnd = -1, double levelBegin = 0, double levelEnd = 0, QStringList domains = QStringList(), QLinkedList objects = QLinkedList()); CCallbackRequestLogMessagesContext *getLogMessages(qint64 messageIDBegin = 0, qint64 messageIDEnd = -1, double levelBegin = 0, double levelEnd = 0, QStringList domains = QStringList(), QLinkedList objects = QLinkedList()); void releaseLogMessages(QLinkedList &logMessages); static void shutdownLogger(); void configureLogger(qint64 maxLogMessages, double minLoggingLevel); double getMinLoggingLevel(); bool hasMinLoggingLevel(double level); protected: virtual void threadStarted(); virtual void threadStopped(); virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); virtual bool processTimer(qint64 timerID); bool deleteOldLogMessages(); private: CLogger(); virtual ~CLogger(); void propagateLogMessageToDomain(QString domain, CLogMessage *message); void addObserverToDomains(CLogObserverData *obsData, QStringList domains); private: //! Singleton-Instance static CLogger* mInstance; QMutex observerSyncMutex; QHash observerHash; QHash observerDomainHash; QHash idMessageHash; //! Log-Entry-List QLinkedList loglist; QHash domainHash; //! Filename for saving QString saveFileName; //! Necessary to not always save the complete list QLinkedList::const_iterator listSaveIt; qint64 mCurrentLogMessageCount; qint64 mMaxLogMessageCount; qint64 mMinLoggingLevel; qint64 unsavedMessagesCount; qint64 savedMessageCount; qint64 totalMessageCount; qint64 lastInMemoryMessage; qint64 nextMessageID; static QMutex* mInstanceCreationMutex; static const qint64 SAVETOFILETIMERID = 1; }; }; // end namespace Logger }; // end namespace Konclude #endif // KONCLUDE_LOGGER_CLOGGER_H Konclude-v0.6.2-544-SourceCode/Source/Logger/Record/0000755000175000017500000000000012613407250020717 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Logger/Record/CContextRecorder.h0000644000175000017500000000345012520756364024321 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef LOGGER_RECORD_CCONTEXTRECORDER_H #define LOGGER_RECORD_CCONTEXTRECORDER_H // Libraries includes #include // Namespace includes #include "CContextRecordData.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Logger { namespace Record { /*! * * \class CContextRecorder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CContextRecorder { // public methods public: //! Constructor CContextRecorder(); //! Destructor virtual ~CContextRecorder(); virtual CContextRecorder *recordData(CContextRecordData *recData) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Record }; // end namespace Logger }; // end namespace Konclude #endif // LOGGER_RECORD_CCONTEXTRECORDER_H Konclude-v0.6.2-544-SourceCode/Source/Logger/Record/CContextRecorder.cpp0000644000175000017500000000210412520756364024647 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CContextRecorder.h" namespace Konclude { namespace Logger { namespace Record { CContextRecorder::CContextRecorder() { } CContextRecorder::~CContextRecorder() { } }; // end namespace Record }; // end namespace Logger }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Logger/Record/CContextRecordData.cpp0000644000175000017500000000374212520756362025121 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CContextRecordData.h" namespace Konclude { namespace Logger { namespace Record { CContextRecordData::CContextRecordData(double recordErrorLevel, CContextRecordData *nextRecordData) { prevRecordData = 0; prevRecordLevel = 0; setNextRecordData(nextRecordData); recordLevel = recordErrorLevel; } CContextRecordData::~CContextRecordData() { } CContextRecordData *CContextRecordData::getNextRecordData() { return prevRecordData; } CContextRecordData *CContextRecordData::setNextRecordData(CContextRecordData *recordData) { prevRecordData = recordData; if (prevRecordData) { prevRecordLevel = prevRecordData->getReflexiveTransetiveMaximumRecordErrorLevel(); } return this; } double CContextRecordData::getReflexiveTransetiveMaximumRecordErrorLevel() { return qMax(recordLevel,prevRecordLevel); } double CContextRecordData::getRecordErrorLevel() { return recordLevel; } CContextRecordData *CContextRecordData::setRecordErrorLevel(double recordErrorLevel) { recordLevel = recordErrorLevel; return this; } }; // end namespace Record }; // end namespace Logger }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Logger/Record/RecordSettings.h0000644000175000017500000000306312405707540024035 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef UUPR_LOGGER_SETTINGS_H #define UUPR_LOGGER_SETTINGS_H #include namespace UUPR { namespace Logger { #define LOGGER_DEBUG /*! \file * \version 0.1 * \author Andreas Steigmiller * \brief Settings for Logger */ const QEvent::Type EVENTLOG = (QEvent::Type)1200; const QEvent::Type EVENTLOGMESSAGESREQUEST = (QEvent::Type)1201; const QEvent::Type EVENTSAVELOG = (QEvent::Type)1202; enum LogMessageTyp { LMINFORMATION = 0, LMWARNING = 1, LMERROR = 2 }; const QEvent::Type EVENTLOGMESSAGE = (QEvent::Type)3000; const QEvent::Type EVENTREQUESTLOGMESSAGES = (QEvent::Type)3001; const QEvent::Type EVENTRELEASELOGMESSAGES = (QEvent::Type)3002; }; // end namespace Logger }; // end namespace UUPR #endif // UUPR_LOGGER_SETTINGS_HKonclude-v0.6.2-544-SourceCode/Source/Logger/Record/CContextRecordData.h0000644000175000017500000000427512520756362024570 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef LOGGER_RECORD_CCONTEXTRECORDDATA_H #define LOGGER_RECORD_CCONTEXTRECORDDATA_H // Libraries includes #include // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Logger { namespace Record { /*! * * \class CContextRecordData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CContextRecordData { // public methods public: //! Constructor CContextRecordData(double recordErrorLevel = 0., CContextRecordData *nextRecordData = 0); //! Destructor virtual ~CContextRecordData(); virtual CContextRecordData *getNextRecordData(); virtual CContextRecordData *setNextRecordData(CContextRecordData *recordData); virtual double getReflexiveTransetiveMaximumRecordErrorLevel(); virtual double getRecordErrorLevel(); virtual CContextRecordData *setRecordErrorLevel(double recordErrorLevel); // protected methods protected: // protected variables protected: CContextRecordData *prevRecordData; double recordLevel; double prevRecordLevel; // private methods private: // private variables private: }; }; // end namespace Record }; // end namespace Logger }; // end namespace Konclude #endif // LOGGER_RECORD_CCONTEXTRECORDDATA_H Konclude-v0.6.2-544-SourceCode/Source/Logger/CAbstractLogObserver.h0000644000175000017500000000257612520756364023716 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef LOGGER_CABSTRACTLOGOBSERVER_H #define LOGGER_CABSTRACTLOGOBSERVER_H #include "CLogMessage.h" namespace Konclude { namespace Logger { /*! \class CAbstractLogObserver * \version 0.3 * \author Andreas Steigmiller * \brief The abstract base Class for each Log-Entry for the CLogger */ class CAbstractLogObserver { public: CAbstractLogObserver(); virtual ~CAbstractLogObserver(); virtual void postLogMessage(CLogMessage *message) = 0; private: }; }; // end namespace Logger }; // end namespace Konclude #endif // LOGGER_CABSTRACTLOGOBSERVER_H Konclude-v0.6.2-544-SourceCode/Source/Logger/CLogIdentifier.cpp0000644000175000017500000000233412520550672023042 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLogIdentifier.h" namespace Konclude { namespace Logger { CLogIdentifier::CLogIdentifier(const QString &domainName, void *logObject) { domain = domainName; object = logObject; } CLogIdentifier::~CLogIdentifier() { } QString CLogIdentifier::getLogDomain() { return domain; } void *CLogIdentifier::getLogObject() { return object; } }; // end namespace Logger }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Logger/COREFilePrintLogObserver.cpp0000644000175000017500000000665612520550672024745 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COREFilePrintLogObserver.h" namespace Konclude { namespace Logger { COREFilePrintLogObserver::COREFilePrintLogObserver(const QString& outputFileString) : mOutputFile(outputFileString) { mOutputFileString = outputFileString; mOutputFileOpened = false; mMinLogLevel = 30; mMaxLogLevel = 100; CLogger* logger = CLogger::getInstance(); CCallbackRequestLogMessagesContext* logMessagesContext = logger->getLogMessages(0,-1,30,100,QStringList(),QLinkedList()); foreach (CLogMessage* message, logMessagesContext->getLogMessages()) { postLogMessage(message); } logMessagesContext->releaseMessages(); } COREFilePrintLogObserver::~COREFilePrintLogObserver() { if (mOutputFileOpened) { mOutputFile.close(); mOutputFileOpened = false; } } void COREFilePrintLogObserver::closeOutputFile() { if (mOutputFileOpened) { mOutputFile.close(); mOutputFileOpened = false; } } void COREFilePrintLogObserver::flushLogging() { closeOutputFile(); } void COREFilePrintLogObserver::forcedPathCreated(const QString& filePath) { QString path = filePath; if (path.contains("/") || path.contains("\\")) { int lastSlash = path.lastIndexOf("/"); int lastBackSlash = path.lastIndexOf("\\"); int lastSeparator = qMax(lastBackSlash,lastSlash); path = path.mid(0,lastSeparator); if (!path.isEmpty()) { QDir dir; dir.mkpath(path); } } } void COREFilePrintLogObserver::postLogMessage(CLogMessage *message) { bool printMessage = false; double logLevel = message->getLogLevel(); QString domainString = message->getDomain(); if (logLevel > mMinLogLevel && logLevel <= mMaxLogLevel) { printMessage = true; } if (printMessage) { if (!mOutputFileOpened) { forcedPathCreated(mOutputFileString); mOutputFileOpened = true; mOutputFile.open(QIODevice::Append); } QString messageString; QString logLevelString; if (logLevel >= 90) { logLevelString = "catastrophic error"; } else if (logLevel >= 80) { logLevelString = "exceptional error"; } else if (logLevel >= 70) { logLevelString = "error"; } else if (logLevel >= 60) { logLevelString = "warning"; } else if (logLevel >= 30) { logLevelString = "info"; } else { printMessage = false; logLevelString = "notice"; } messageString += QString("{%1} %2 [%3] >> %4\r\n").arg(logLevelString).arg(message->getTimeMSecString()).arg(domainString).arg(message->getMessage()); mOutputFile.write( messageString.toUtf8().data() ); closeOutputFile(); } } }; // end namespace Logger }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Logger/CCallbackRequestLogMessagesContext.cpp0000644000175000017500000000320212520756364027063 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCallbackRequestLogMessagesContext.h" #include "CLogger.h" namespace Konclude { namespace Logger { CCallbackRequestLogMessagesContext::CCallbackRequestLogMessagesContext() { } CCallbackRequestLogMessagesContext::~CCallbackRequestLogMessagesContext() { } void CCallbackRequestLogMessagesContext::releaseMessages() { CLogger *logger = CLogger::getInstance(); logger->releaseLogMessages(messages); } void CCallbackRequestLogMessagesContext::setLogMessages(QLinkedList logMessages) { messages = logMessages; } void CCallbackRequestLogMessagesContext::addLogMessage(CLogMessage *logMessages) { messages.append(logMessages); } QLinkedList CCallbackRequestLogMessagesContext::getLogMessages() { return messages; } }; // end namespace Logger }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Logger/CLogMessage.h0000644000175000017500000000412212520550672022006 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef LOGGER_CLOGMESSAGE_H #define LOGGER_CLOGMESSAGE_H #include #include #include #include "LoggerSettings.h" namespace Konclude { namespace Logger { /*! \class CLogMessage * \version 0.3 * \author Andreas Steigmiller * \brief The abstract base Class for each Log-Entry for the CLogger */ class CLogMessage { public: CLogMessage(QString logDomain, QString logMessage, double logLevel, void *logObject); ~CLogMessage(); QString getMessage(); void setMessage(QString logMessage); QDateTime getDateTime(); QString getDateTimeString(); QString getDateTimeMSecString(); QString getTimeMSecString(); double getLogLevel(); void setLogLevel(double logLevel); QString getDomain(); void setDomain(QString logDomain); void setLogObject(void *logObject); void *getLogObject(); void setLogID(qint64 id); qint64 getLogID(); void setLockCount(qint64 count); void incLockCount(); void decLockCount(); qint64 getLockCount(); private: QString message; QString domain; QDateTime datetime; double level; qint64 logID; void *object; qint64 lockCount; }; }; // end namespace Logger }; // end namespace Konclude #endif // LOGGER_CLOGMESSAGE_H Konclude-v0.6.2-544-SourceCode/Source/Logger/CQtDebugPrintLogObserver.h0000644000175000017500000000270012520550674024504 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_LOGGER_CQTDEBUGPRINTLOGOBSERVER_H #define KONCLUDE_LOGGER_CQTDEBUGPRINTLOGOBSERVER_H #include #include "CAbstractLogObserver.h" namespace Konclude { namespace Logger { /*! * \class CQtDebugPrintLogObserver * \version 0.3 * \author Andreas Steigmiller * \brief TODO */ class CQtDebugPrintLogObserver : public CAbstractLogObserver { public: CQtDebugPrintLogObserver(); virtual ~CQtDebugPrintLogObserver(); virtual void postLogMessage(CLogMessage *message); private: }; }; // end namespace Logger }; // end namespace Konclude #endif // KONCLUDE_LOGGER_CQTDEBUGPRINTLOGOBSERVER_H Konclude-v0.6.2-544-SourceCode/Source/Logger/CLogger.cpp0000644000175000017500000002533312520756364021547 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLogger.h" QString logTr(const char *sourceText, const char *comment, int n) { return QObject::tr(sourceText,comment,n); } namespace Konclude { namespace Logger { CLogger *CLogger::mInstance=0; QMutex *CLogger::mInstanceCreationMutex = new QMutex(); CLogger::CLogger() : CIntervalThread("Logger") { unsavedMessagesCount = 0; savedMessageCount = 0; totalMessageCount = 0; lastInMemoryMessage = 0; nextMessageID = 0; mMaxLogMessageCount = -1; mMinLoggingLevel = 0; mCurrentLogMessageCount = 0; startThread(); } CLogger::~CLogger() { stopThread(); } void CLogger::shutdownLogger() { mInstanceCreationMutex->lock(); mInstance->stopThread(); // wait until the thread is stopped mInstance->wait(); delete mInstance; mInstance = 0; mInstanceCreationMutex->unlock(); } CCallbackRequestLogMessagesContext *CLogger::getLogMessages(qint64 messageIDBegin, qint64 messageIDEnd, double levelBegin, double levelEnd, QStringList domains, QLinkedList objects) { CBlockingCallbackData *blockingCallback = new CBlockingCallbackData(); getLogMessages(blockingCallback,messageIDBegin,messageIDEnd,levelBegin,levelEnd,domains,objects); blockingCallback->waitForCallback(); CCallbackRequestLogMessagesContext *context = (CCallbackRequestLogMessagesContext *)blockingCallback->takeCallbackDataContext(); delete blockingCallback; return context; } void CLogger::getLogMessages(CCallbackData *callback, qint64 messageIDBegin, qint64 messageIDEnd, double levelBegin, double levelEnd, QStringList domains, QLinkedList objects) { postEvent(new CRequestLogMessagesEvent(callback,messageIDBegin,messageIDEnd,levelBegin,levelEnd,domains,objects)); } void CLogger::releaseLogMessages(QLinkedList &logMessages) { postEvent(new CReleaseLogMessagesEvent(logMessages)); } double CLogger::getMinLoggingLevel() { return mMinLoggingLevel; } bool CLogger::hasMinLoggingLevel(double level) { return level >= mMinLoggingLevel; } void CLogger::configureLogger(qint64 maxLogMessages, double minLoggingLevel) { postEvent(new CConfigureLoggerEvent(maxLogMessages,minLoggingLevel)); } void CLogger::addLogMessage(QString message, double level, QString domain, void *object) { postEvent(new CLoggingEvent(new CLogMessage(domain,message,level,object))); } void CLogger::addLogObserver(CAbstractLogObserver *observer, double level, QStringList domains) { if (domains.count() <= 0) { domains<<"::"; } observerSyncMutex.lock(); CLogObserverData *obsData = new CLogObserverData(observer,level,domains); addObserverToDomains(obsData,domains); observerHash.insertMulti((qint64)observer,obsData); observerSyncMutex.unlock(); CThread::waitSynchronization(); } void CLogger::removeObserverFromAllDomains(CAbstractLogObserver *observer) { observerSyncMutex.lock(); if (observerHash.contains((qint64)observer)) { QList obsDataList(observerHash.values((qint64)observer)); foreach (CLogObserverData *obsData, obsDataList) { if (observerDomainHash.contains((qint64)obsData)) { QList domainList(observerDomainHash.values((qint64)obsData)); foreach (CLogDomain *domain, domainList) { domain->removeLogObserver(obsData); } } delete obsData; } observerHash.remove((qint64)observer); } observerSyncMutex.unlock(); } void CLogger::removeObserverFromDomains(CAbstractLogObserver *observer, QStringList remDomains) { observerSyncMutex.lock(); QSet removeDomainsSet; if (observerHash.contains((qint64)observer)) { QList obsDataList(observerHash.values((qint64)observer)); foreach (QString domain,remDomains) { removeDomainsSet.insert(domain); } foreach (CLogObserverData *obsData, obsDataList) { QStringList domainList(obsData->getLogDomains()); foreach (QString domain, domainList) { if (removeDomainsSet.contains(domain)) { if (domainHash.contains(domain)) { CLogDomain *logDomain = domainHash.value(domain); logDomain->removeLogObserver(obsData); } obsData->removeLogDomain(domain); } } } } observerSyncMutex.unlock(); } void CLogger::addObserverToDomains(CLogObserverData *obsData, QStringList domains) { foreach (QString domainString, domains) { CLogDomain *domain = 0; if (domainHash.contains(domainString)) { domain = domainHash.value(domainString); } else { domain = new CLogDomain(domainString); domainHash.insert(domainString,domain); } if (domain) { obsData->addLogDomain(domainString); domain->addLogObserver(obsData); observerDomainHash.insert((qint64)obsData,domain); } } } void CLogger::threadStarted() { CIntervalThread::threadStarted(); startTimerWithInterval(SAVETOFILETIMERID,1000); } void CLogger::threadStopped() { CIntervalThread::threadStopped(); qDeleteAll(loglist); } bool CLogger::deleteOldLogMessages() { bool messagesDeleted = false; if (mCurrentLogMessageCount > mMaxLogMessageCount && mMaxLogMessageCount >= 0) { while (mCurrentLogMessageCount > mMaxLogMessageCount && !loglist.isEmpty()) { CLogMessage* deleteLM = loglist.takeLast(); idMessageHash.remove(deleteLM->getLogID()); delete deleteLM; messagesDeleted = true; --mCurrentLogMessageCount; } } return messagesDeleted; } bool CLogger::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CIntervalThread::processCustomsEvents(type,event)) { return true; } else if (type == Konclude::Logger::EVENTLOGMESSAGE) { SETTASKDESCRIPTION("Process Log Message"); CLoggingEvent *le = (CLoggingEvent *)event; CLogMessage *lm = le->getLogMessage(); QString domain = lm->getDomain(); QStringList domainList(domain.split("::",QString::SkipEmptyParts)); loglist.append(lm); unsavedMessagesCount++; totalMessageCount++; observerSyncMutex.lock(); lm->setLogID(nextMessageID); idMessageHash.insert(nextMessageID,lm); ++nextMessageID; ++mCurrentLogMessageCount; propagateLogMessageToDomain("::",lm); QString accDomain; foreach (QString endDomain, domainList) { accDomain.append("::"); accDomain.append(endDomain); propagateLogMessageToDomain(accDomain,lm); propagateLogMessageToDomain(endDomain,lm); } observerSyncMutex.unlock(); deleteOldLogMessages(); return true; } else if (type == Konclude::Logger::EVENTCONFIGURELOGGER) { SETTASKDESCRIPTION("Configure Logger"); CConfigureLoggerEvent* cle = (CConfigureLoggerEvent *)event; mMaxLogMessageCount = cle->getMaxLogMessageCount(); mMinLoggingLevel = cle->getMinLoggingLevel(); deleteOldLogMessages(); return true; } else if (type == Konclude::Logger::EVENTRELEASELOGMESSAGES) { SETTASKDESCRIPTION("Release Log Message"); CReleaseLogMessagesEvent *rlm = (CReleaseLogMessagesEvent *)event; QLinkedList releaseLogMessageList(rlm->getLogMessages()); foreach (CLogMessage *logMessage, releaseLogMessageList) { logMessage->decLockCount(); } return true; } else if (type == Konclude::Logger::EVENTREQUESTLOGMESSAGES) { SETTASKDESCRIPTION("Create Log Message Collection Response"); CRequestLogMessagesEvent *rlm = (CRequestLogMessagesEvent *)event; CCallbackRequestLogMessagesContext *logMessageContext = new CCallbackRequestLogMessagesContext(); double beginLevel = rlm->getBeginLevel(); double endLevel = rlm->getEndLevel(); qint64 beginID = rlm->getMessageBeginID(); qint64 endID = rlm->getMessageEndID(); if (endID == -1) { endID = nextMessageID; } endID = qMax(endID,beginID); QStringList domainGetList = rlm->getDomains(); CCallbackData *callback = rlm->getCallback(); QSet domainGetSet; foreach (QString domain, domainGetList) { domainGetSet.insert(domain); } QLinkedList objectList = rlm->getObjects(); for (qint64 startID = qMax(beginID,lastInMemoryMessage); startID != endID; ++startID) { if (idMessageHash.contains(startID)) { CLogMessage *message = idMessageHash.value(startID); double logLevel = message->getLogLevel(); if (logLevel >= beginLevel && logLevel <= endLevel) { bool messageRequested = false; if (domainGetList.isEmpty()) { messageRequested = true; } else { if (domainGetSet.contains("::")) { messageRequested = true; } else { QStringList domainList(message->getDomain().split("::",QString::SkipEmptyParts)); QString accDomain; foreach (const QString& endDomain, domainList) { accDomain.append("::"); accDomain.append(endDomain); if (domainGetSet.contains(accDomain) || domainGetSet.contains(endDomain)) { messageRequested = true; break; } } } } if (messageRequested) { logMessageContext->addLogMessage(message); message->incLockCount(); } } } } callback->setCallbackDataContext(logMessageContext); callback->doCallback(); return true; } return false; } void CLogger::propagateLogMessageToDomain(QString domain, CLogMessage *message) { CLogDomain *logDomain = domainHash.value(domain); if (logDomain) { logDomain->postLogMessage(message); } } bool CLogger::processTimer(qint64 timerID) { if (timerID == SAVETOFILETIMERID) { return true; } return false; } // returns the Instance of the CLogger and creates it when necessary CLogger *CLogger::getInstance() { if (mInstance == nullptr) { mInstanceCreationMutex->lock(); if (mInstance == 0) { mInstance = new CLogger(); } mInstanceCreationMutex->unlock(); } return mInstance; } }; // end namespace Logger }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Logger/COREConsolePrintLogObserver.cpp0000644000175000017500000000415012520550672025453 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COREConsolePrintLogObserver.h" namespace Konclude { namespace Logger { COREConsolePrintLogObserver::COREConsolePrintLogObserver(const QStringList& domainInfoList) { mMinLogLevel = 0; mMaxLogLevel = 30; foreach (QString domainString, domainInfoList) { domainInfoSet.insert(domainString); } CLogger* logger = CLogger::getInstance(); CCallbackRequestLogMessagesContext* logMessagesContext = logger->getLogMessages(0,-1,30,100,domainInfoList,QLinkedList()); foreach (CLogMessage* message, logMessagesContext->getLogMessages()) { postLogMessage(message); } logMessagesContext->releaseMessages(); } COREConsolePrintLogObserver::~COREConsolePrintLogObserver() { } void COREConsolePrintLogObserver::postLogMessage(CLogMessage *message) { bool printMessage = false; double logLevel = message->getLogLevel(); if (logLevel > mMinLogLevel && logLevel <= mMaxLogLevel) { QString domainString = message->getDomain(); printMessage = domainInfoSet.contains(domainString); } if (printMessage) { QString messageString = QString("%1").arg(message->getMessage()); std::cout << messageString.toUtf8().data() << "\r\n"<. * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAbstractLogObserver.h" namespace Konclude { namespace Logger { CAbstractLogObserver::CAbstractLogObserver() { } CAbstractLogObserver::~CAbstractLogObserver() { } }; // end namespace Logger }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/CKoncludeInfo.h0000644000175000017500000000360712520756430021130 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_INFO_H #define KONCLUDE_INFO_H // Libraries includes #include #include // Namespace includes #include "KoncludeSettings.h" // Other includes // Logger includes namespace Konclude { /*! * * \class CKoncludeInfo * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CKoncludeInfo { // public methods public: //! Constructor CKoncludeInfo(); static QString getKoncludeName(); static QString getKoncludeNameExtension(); static QString getKoncludeDescription(); static QString getKoncludeVersionString(); static QString getKoncludeCompilationDateString(); static QString getKoncludeBitPlatformString(); static int getKoncludeMajorVersionNumber(); static int getKoncludeMinorVersionNumber(); static int getKoncludeBuildVersionNumber(); static int getKoncludeRevisionVersionNumber(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Konclude #endif // KONCLUDE_INFO_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/0000755000175000017500000000000012613407260020041 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/0000755000175000017500000000000012613407260021146 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryCalculationStatisticsCollection.h0000644000175000017500000000470612520551240030777 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CQUERYCALCULATIONSTATISTICSCOLLECTION_H #define KONCLUDE_REASONER_QUERY_CQUERYCALCULATIONSTATISTICSCOLLECTION_H // Libraries includes // Namespace includes #include "QuerySettings.h" // Other includes #include "Reasoner/Kernel/Task/CCalculationStatisticsCollector.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Kernel::Task; namespace Query { /*! * * \class CQueryCalculationStatisticsCollection * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQueryCalculationStatisticsCollection : public CLinkerBase, public CCalculationStatisticsCollector { // public methods public: //! Constructor CQueryCalculationStatisticsCollection(); //! Destructor virtual ~CQueryCalculationStatisticsCollection(); virtual bool addProcessingStatistics(const QString& statName, cint64 statValue); CQueryCalculationStatisticsCollection* appendStatisticsStringNames(QSet* statNamesSet); cint64 getStatisticIntegerValue(const QString& statName); // protected methods protected: // protected variables protected: QHash mStatNameStringsValueHash; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CQUERYCALCULATIONSTATISTICSCOLLECTION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CRealizationPremisingQuery.cpp0000644000175000017500000000427412520551242027146 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizationPremisingQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CRealizationPremisingQuery::CRealizationPremisingQuery(CConcreteOntology* ontology, CConfigurationBase* configuration) { mOntology = ontology; mConfig = configuration; mQueryStats = nullptr; mRequiresSameIndividualRealisation = false; mRequiresConceptRealisation = false; mRequiresRoleRealisation = false; } CRealizationPremisingQuery::~CRealizationPremisingQuery() { delete mQueryStats; } CConcreteOntology* CRealizationPremisingQuery::getOntology() { return mOntology; } CConfigurationBase* CRealizationPremisingQuery::getConfiguration() { return mConfig; } CRealizationPremisingQuery* CRealizationPremisingQuery::setQueryStatistics(CQueryStatistics* stats) { mQueryStats = stats; return this; } CQueryStatistics* CRealizationPremisingQuery::getQueryStatistics() { return mQueryStats; } bool CRealizationPremisingQuery::isConceptRealisationRequired() { return mRequiresConceptRealisation; } bool CRealizationPremisingQuery::isRoleRealisationRequired() { return mRequiresRoleRealisation; } bool CRealizationPremisingQuery::isSameIndividualRealisationRequired() { return mRequiresSameIndividualRealisation; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIsConsistentQuery.cpp0000644000175000017500000000477612520551236025446 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIsConsistentQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CIsConsistentQuery::CIsConsistentQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QString& consistentQueryName) : CConsistencePremisingQuery(ontology,configuration) { queryName = consistentQueryName; queryString = QString("Is ontology consistent?"); mResult = nullptr; } CIsConsistentQuery::~CIsConsistentQuery() { if (mResult) { delete mResult; } } CQueryResult* CIsConsistentQuery::getQueryResult() { return mResult; } CQueryResult *CIsConsistentQuery::constructResult(CConsistence* consistence) { return constructConsistenceResult(consistence); } CBooleanQueryResult* CIsConsistentQuery::constructConsistenceResult(CConsistence* consistence) { if (consistence) { mResult = new CBooleanQueryResult(consistence->isOntologyConsistent()); } return mResult; } QString CIsConsistentQuery::getQueryName() { return queryName; } QString CIsConsistentQuery::getQueryString() { return queryString; } bool CIsConsistentQuery::hasAnswer() { return mResult != 0; } CQuery* CIsConsistentQuery::addQueryError(CQueryError* queryError) { if (CQueryInconsitentOntologyError::hasInconsistentOntologyError(queryError)) { mResult = new CBooleanQueryResult(false); } return CQuery::addQueryError(queryError); } QString CIsConsistentQuery::getAnswerString() { if (!mResult) { return QString("Consistency Unknown"); } else { return mResult->getQueryResultString(); } } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIsConsistentQuery.h0000644000175000017500000000506312520551236025101 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CISCONSISTENTQUERY_H #define KONCLUDE_REASONER_QUERY_CISCONSISTENTQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CBooleanQueryResult.h" #include "CConsistencePremisingQuery.h" #include "CQueryInconsitentOntologyError.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CIsConsistentQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIsConsistentQuery : public CConsistencePremisingQuery { // public methods public: //! Constructor CIsConsistentQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QString& consistentQueryName = QString("UnnamedConsistencyQuery")); //! Destructor virtual ~CIsConsistentQuery(); virtual CQueryResult* constructResult(CConsistence* consistence); virtual CBooleanQueryResult* constructConsistenceResult(CConsistence* consistence); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual CQuery* addQueryError(CQueryError* queryError); // protected methods protected: // protected variables protected: QString queryName; QString queryString; CBooleanQueryResult* mResult; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CISCONSISTENTQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIndividualsResultVisitorGenerator.h0000644000175000017500000000514612520551234030327 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CINDIVIDUALSRESULTVISITORGENERATOR_H #define KONCLUDE_REASONER_QUERY_CINDIVIDUALSRESULTVISITORGENERATOR_H // Libraries includes // Namespace includes #include "CIndividualsResult.h" // Other includes #include "Reasoner/Realization/CRealization.h" #include "Reasoner/Realization/CConceptRealizationInstanceToIndividualVisitor.h" #include "Reasoner/Realization/CRoleRealizationInstanceToIndividualVisitor.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CAbbreviatedIRIName.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CIndividualsResultVisitorGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualsResultVisitorGenerator : public CConceptRealizationInstanceToIndividualVisitor, public CRoleRealizationInstanceToIndividualVisitor, public CSameRealizationIndividualVisitor { // public methods public: //! Constructor CIndividualsResultVisitorGenerator(CIndividualsResult* individualsResult, bool abbreviatedIRIs); virtual bool visitIndividual(CIndividual* individual, CConceptRealization* conRealization); virtual bool visitIndividual(CIndividual* individual, CRoleRealization* roleRealization); virtual bool visitIndividual(CIndividual* individual, CSameRealization* conRealization); // protected methods protected: // protected variables protected: CIndividualsResult* mIndividualsResult; bool mAbbreviatedIRIs; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CINDIVIDUALSRESULTVISITORGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassSynsetsResultVisitorGenerator.h0000644000175000017500000000476012520551232030511 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CClassSynsetsResultVisitorGenerator_H #define KONCLUDE_REASONER_QUERY_CClassSynsetsResultVisitorGenerator_H // Libraries includes // Namespace includes #include "CClassSynsetsResult.h" // Other includes #include "Reasoner/Realization/CRealization.h" #include "Reasoner/Realization/CConceptRealizationInstantiatedVisitor.h" #include "Reasoner/Realization/CConceptRealizationConceptVisitor.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CAbbreviatedIRIName.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CClassSynsetsResultVisitorGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassSynsetsResultVisitorGenerator : public CConceptRealizationInstantiatedVisitor, public CConceptRealizationConceptVisitor { // public methods public: //! Constructor CClassSynsetsResultVisitorGenerator(CClassSynsetsResult* classSynsetsResult, bool abbreviatedIRIs); virtual bool visitType(CConceptInstantiatedItem* item, CConceptRealization* conRealization); virtual bool visitConcept(CConcept* concept, CConceptRealization* conRealization); // protected methods protected: // protected variables protected: CClassSynsetsResult* mClassSynsetsResult; bool mAbbreviatedIRIs; CClassSynsetResult* mTmpClassSynsetResult; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CClassSynsetsResultVisitorGenerator_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassSetResult.h0000644000175000017500000000363512520551232024345 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CCLASSSETRESULT_H #define KONCLUDE_REASONER_QUERY_CCLASSSETRESULT_H // Libraries includes #include // Namespace includes #include "CQueryResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CClassSetResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassSetResult : public CQueryResult { // public methods public: //! Constructor CClassSetResult(); virtual QString getQueryResultString(); virtual bool isResultEquivalentTo(CQueryResult *otherQueryResult); CClassSetResult* addClass(const QString &className); QSet* getClassesSet(); // protected methods protected: // protected variables protected: QSet mClassSet; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CCLASSSETRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassSynsetsResult.cpp0000644000175000017500000000732012520551232025610 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassSynsetsResult.h" namespace Konclude { namespace Reasoner { namespace Query { CClassSynsetsResult::CClassSynsetsResult() { } CClassSynsetsResult::~CClassSynsetsResult() { qDeleteAll(mClassSynsetContainer); } CClassSynsetResult *CClassSynsetsResult::getClassSynset(const QString &className, bool create) { CClassSynsetResult *classSynset = mClassClassSynsetHash.value(className,0); if (!classSynset && create) { classSynset = new CClassSynsetResult(className); mClassClassSynsetHash.insert(className,classSynset); mClassSynsetContainer.append(classSynset); } return classSynset; } CClassSynsetResult *CClassSynsetsResult::getClassSynset(const QStringList &classNames, bool create) { CClassSynsetResult *classSynset = 0; if (!classNames.isEmpty()) { classSynset = mClassClassSynsetHash.value(classNames.first(),0); if (!classSynset && create) { classSynset = new CClassSynsetResult(classNames); foreach (QString className, classNames) { mClassClassSynsetHash.insert(className,classSynset); } mClassSynsetContainer.append(classSynset); } } return classSynset; } CClassSynsetResult *CClassSynsetsResult::addClassSynset(CClassSynsetResult *takeClassSynset) { foreach (QString className, takeClassSynset->getEquivalentClassNameList()) { mClassClassSynsetHash.insert(className,takeClassSynset); } mClassSynsetContainer.append(takeClassSynset); return takeClassSynset; } QList* CClassSynsetsResult::getClassSynsetList() { return &mClassSynsetContainer; } QString CClassSynsetsResult::getQueryResultString() { QString string; return string; } bool CClassSynsetsResult::isResultEquivalentTo(CQueryResult *otherQueryResult) { if (!otherQueryResult) { return false; } CClassSynsetsResult *otherClassSynsets = dynamic_cast(otherQueryResult); if (!otherClassSynsets) { return false; } if (mClassClassSynsetHash.count() != otherClassSynsets->mClassClassSynsetHash.count()) { return false; } for (QList::const_iterator it = mClassSynsetContainer.constBegin(), itEnd = mClassSynsetContainer.constEnd(); it != itEnd; ++it) { CClassSynsetResult* classSynRes(*it); CClassSynsetResult* otherClassSynRes = nullptr; QStringList classNameList(classSynRes->getEquivalentClassNameList()); if (!classNameList.isEmpty()) { const QString& className = classNameList.first(); otherClassSynRes = otherClassSynsets->mClassClassSynsetHash.value(className); } if (!otherClassSynRes && !classNameList.isEmpty()) { return false; } if (!classSynRes->isResultEquivalentTo(otherClassSynRes)) { return false; } } return true; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSuperClassesQuery.cpp0000644000175000017500000001046312520551242025420 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSuperClassesQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CSuperClassesQuery::CSuperClassesQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CConcept* concept, bool direct, const QString& className, const QString& queryName) : CTaxonomyPremisingQuery(ontology,configuration) { mClassName = className; mConcept = concept; mQueryName = queryName; if (mClassName.isEmpty()) { mQueryString = QString("Get Super Classes"); } else { mQueryString = QString("Get Super Classes for concept '%1'").arg(mClassName); } mResult = nullptr; mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.OWLlink.AbbreviatedIRIs",false); mTaxonomyCalcError = false; mQueryConstructError = false; mDirect = direct; mCalcConfig = configuration; } CSuperClassesQuery::~CSuperClassesQuery() { if (mResult) { delete mResult; } delete mCalcConfig; } CQueryResult* CSuperClassesQuery::getQueryResult() { return mResult; } CQueryResult *CSuperClassesQuery::constructResult(CTaxonomy *taxonomy) { return constructClassSynsetsResult(taxonomy); } CClassSynsetsResult *CSuperClassesQuery::constructClassSynsetsResult(CTaxonomy *taxonomy) { if (mResult) { delete mResult; mResult = 0; } if (taxonomy) { CHierarchyNode* node = taxonomy->getHierarchyNode(mConcept); if (node) { mResult = new CClassSynsetsResult(); QSet* visitedHierNodeSet = nullptr; if (!mDirect) { visitedHierNodeSet = new QSet(); } QList visitHierNodetList; QSet* parentNodeSet = node->getParentNodeSet(); for (QSet::const_iterator it = parentNodeSet->constBegin(), itEnd = parentNodeSet->constEnd(); it != itEnd; ++it) { CHierarchyNode* parentNode(*it); visitHierNodetList.append(parentNode); } while (!visitHierNodetList.isEmpty()) { CHierarchyNode* nextNode = visitHierNodetList.takeFirst(); CClassSynsetResult* nextSubClassSynset = new CClassSynsetResult(nextNode->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); mResult->addClassSynset(nextSubClassSynset); if (!mDirect) { QSet* tmpParentNodeSet = nextNode->getParentNodeSet(); for (QSet::const_iterator it = tmpParentNodeSet->constBegin(), itEnd = tmpParentNodeSet->constEnd(); it != itEnd; ++it) { CHierarchyNode* nextParentNode(*it); if (!visitedHierNodeSet->contains(nextParentNode)) { visitedHierNodeSet->insert(nextParentNode); visitHierNodetList.append(nextParentNode); } } } } delete visitedHierNodeSet; } } return mResult; } QString CSuperClassesQuery::getQueryName() { return mQueryName; } QString CSuperClassesQuery::getQueryString() { return mQueryString; } bool CSuperClassesQuery::hasAnswer() { return mResult != 0; } QString CSuperClassesQuery::getAnswerString() { if (!mResult) { return QString("Unknown Classes"); } else { return mResult->getQueryResultString(); } } bool CSuperClassesQuery::hasError() { return mTaxonomyCalcError || mQueryConstructError || CQuery::hasError(); } bool CSuperClassesQuery::isDirect() { return mDirect; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CAreClassesDisjointQuery.cpp0000644000175000017500000000412612520551230026531 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAreClassesDisjointQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CAreClassesDisjointQuery::CAreClassesDisjointQuery(QStringList classNames, const QString& queryName) { QString classNamesString; bool hasClassName = false; while (!classNames.isEmpty()) { QString nextClassName = classNames.takeFirst(); if (hasClassName) { if (classNames.isEmpty()) { classNamesString += QString(" and "); } else { classNamesString += QString(", "); } } classNamesString += nextClassName; hasClassName = true; } CSatisfiableCalculationJobsQuery::setQueryName(queryName); QString queryString = QString("Are classes '%1' disjoint?").arg(classNamesString); CSatisfiableCalculationJobsQuery::setQueryString(queryString); QString answerStringYes = QString("Yes"); QString answerStringNo = QString("No"); QString answerStringUnknown = QString("Unknown"); CSatisfiableCalculationJobsQuery::setAnswerString(answerStringYes,answerStringNo,answerStringUnknown); } bool CAreClassesDisjointQuery::areClassesDisjoint() { return getResult(); } CAreClassesDisjointQuery::~CAreClassesDisjointQuery() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CNondeterministicClassAssertionQuery.cpp0000644000175000017500000000263412520551240031177 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNondeterministicClassAssertionQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CNondeterministicClassAssertionQuery::CNondeterministicClassAssertionQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QSet& individualSet, const QString& queryName) : CClassAssertionQuery(ontology,configuration,individualSet,queryName) { mNondeterministicAssertions = true; } CNondeterministicClassAssertionQuery::~CNondeterministicClassAssertionQuery() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryWatcher.cpp0000644000175000017500000000207112520551240024373 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryWatcher.h" namespace Konclude { namespace Reasoner { namespace Query { CQueryWatcher::CQueryWatcher() { } CQueryWatcher::~CQueryWatcher() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassSynsetsResultVisitorGenerator.cpp0000644000175000017500000000410112520551232031031 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassSynsetsResultVisitorGenerator.h" namespace Konclude { namespace Reasoner { namespace Query { CClassSynsetsResultVisitorGenerator::CClassSynsetsResultVisitorGenerator(CClassSynsetsResult* classSynsetsResult, bool abbreviatedIRIs) { mClassSynsetsResult = classSynsetsResult; mAbbreviatedIRIs = abbreviatedIRIs; } bool CClassSynsetsResultVisitorGenerator::visitType(CConceptInstantiatedItem* item, CConceptRealization* conRealization) { mTmpClassSynsetResult = new CClassSynsetResult(); conRealization->visitConcepts(item,this); mClassSynsetsResult->addClassSynset(mTmpClassSynsetResult); return true; } bool CClassSynsetsResultVisitorGenerator::visitConcept(CConcept* concept, CConceptRealization* conRealization) { QString conceptString; if (mAbbreviatedIRIs) { conceptString = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(concept->getClassNameLinker()); } if (conceptString.isEmpty()) { conceptString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); } if (!conceptString.isEmpty()) { mTmpClassSynsetResult->addEquivalentClassName(conceptString); } return true; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQuery.h0000644000175000017500000000447712520551240022536 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CQUERY_H #define KONCLUDE_REASONER_QUERY_CQUERY_H // Libraries includes // Namespace includes #include "QuerySettings.h" #include "CQueryResult.h" #include "CQuerySupport.h" #include "CQueryStatistics.h" #include "CQueryError.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQuery { // public methods public: //! Constructor CQuery(); //! Destructor virtual ~CQuery(); virtual QString getQueryName() = 0; virtual QString getQueryString() = 0; virtual QString getAnswerString() = 0; virtual bool hasAnswer() = 0; virtual bool hasError(); virtual CQueryResult* getQueryResult() = 0; virtual CQuerySupport* getQuerySupport(); virtual CQueryStatistics* getQueryStatistics(); virtual QStringList getErrorStringList(); virtual CQuery* addErrorString(const QString& errorString); virtual CQuery* addQueryError(CQueryError* queryError); virtual CQueryError* getQueryErrorLinker(); // protected methods protected: // protected variables protected: CQueryError* mErrorLinker; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CNondeterministicIndividualsQuery.h0000644000175000017500000000421012520551240030152 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CNONDETERMINISTICINDIVIDUALSQUERY_H #define KONCLUDE_REASONER_QUERY_CNONDETERMINISTICINDIVIDUALSQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CDeterministicNondeterministicIndividualsQuery.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CNondeterministicIndividualsQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNondeterministicIndividualsQuery : public CDeterministicNondeterministicIndividualsQuery { // public methods public: //! Constructor CNondeterministicIndividualsQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QSet& individualSet, const QString& queryName = QString("UnnamedNondeterministicIndividualsQuery")); //! Destructor virtual ~CNondeterministicIndividualsQuery(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CNONDETERMINISTICINDIVIDUALSQUERY_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CWriteFunctionalClassSubsumptionsHierarchyQuery.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CWriteFunctionalClassSubsumptionsHierarchyQuery0000644000175000017500000001020212520551244032612 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CWRITEFUNCTIONALCLASSSUBSUMPTIONSHIERARCHYQUERY_H #define KONCLUDE_REASONER_QUERY_CWRITEFUNCTIONALCLASSSUBSUMPTIONSHIERARCHYQUERY_H // Libraries includes #include #include #include // Namespace includes #include "CQuery.h" #include "CTaxonomyPremisingQuery.h" #include "CQueryUnspecifiedStringError.h" #include "CQueryInconsitentOntologyError.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CWriteFunctionalClassSubsumptionsHierarchyQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteFunctionalClassSubsumptionsHierarchyQuery : public CTaxonomyPremisingQuery { // public methods public: //! Constructor CWriteFunctionalClassSubsumptionsHierarchyQuery(CConcreteOntology *premisingTaxonomyOntology, CConfigurationBase *configuration, const QString& outputFileString, const QString &superClassName = QString(""), const QString &subClassHierarchyQueryName = QString("UnnamedWriteClassHierarchyQuery")); virtual CQueryResult *constructResult(CTaxonomy *taxonomy); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult *getQueryResult(); virtual bool hasError(); virtual CQuery* addQueryError(CQueryError* queryError); // protected methods protected: void forcedPathCreated(const QString& filePath); bool writeInconsistentHierarchyResult(); bool writeSubClassHierarchyResult(CTaxonomy *taxonomy); void writeDeclarations(CHierarchyNode* node, QFile* outputFile); void writeEquivalences(CHierarchyNode* node, QFile* outputFile); void writeBottomEquivalences(CHierarchyNode* node, QFile* outputFile); void writeTopEquivalences(CHierarchyNode* node, QFile* outputFile); void writeDeclaration(const QString& className, QFile* outputFile); void writeSubClassRelations(CHierarchyNode* superNode, CHierarchyNode* subNode, QFile* outputFile); void writeSubClassRelation(const QString& subClassName, const QString& superClassName, QFile* outputFile); void writeEquivalenceRelations(CHierarchyNode* node, QFile* outputFile); void writeEquivalenceRelations(const QStringList& classNameList, QFile* outputFile); void writeOntologyStart(QFile* outputFile); void writeOntologyEnd(QFile* outputFile); // protected variables protected: QString mClassName; QString mQueryName; QString mQueryString; QString mOutputFileNameString; QString mBottomClassNameString; QString mTopClassNameString; bool mUseAbbreviatedIRIs; bool mWriteDeclarations; bool mWriteDirectEquivalences; bool mWriteSimpleBottomImplications; bool mWriteSimpleTopImplications; bool mWriteSimpleInconsistency; bool mQueryAnswered; bool mQueryConstructError; bool mTaxCalcError; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CWRITEFUNCTIONALCLASSSUBSUMPTIONSHIERARCHYQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassesResultVisitorGenerator.cpp0000644000175000017500000000331412520551232027775 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassesResultVisitorGenerator.h" namespace Konclude { namespace Reasoner { namespace Query { CClassesResultVisitorGenerator::CClassesResultVisitorGenerator(CClassesResult* classesResult, bool abbreviatedIRIs) { mClassesResult = classesResult; mAbbreviatedIRIs = abbreviatedIRIs; } bool CClassesResultVisitorGenerator::visitConcept(CConcept* concept, CConceptRealization* conRealization) { QString conceptString; if (mAbbreviatedIRIs) { conceptString = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(concept->getClassNameLinker()); } if (conceptString.isEmpty()) { conceptString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); } if (!conceptString.isEmpty()) { mClassesResult->addClass(conceptString); } return true; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSatisfiableCalculationJobsQuery.h0000644000175000017500000000774512520551242027705 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONJOBSQUERY_H #define KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONJOBSQUERY_H // Libraries includes #include // Namespace includes #include "QuerySettings.h" #include "CJobProvidedQuery.h" #include "CSatisfiableCalculationJob.h" #include "CBooleanQueryResult.h" #include "CSatisfiableCalculationJobQueryData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CSatisfiableCalculationJobsQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCalculationJobsQuery : public CJobProvidedQuery { // public methods public: //! Constructor CSatisfiableCalculationJobsQuery(); //! Destructor virtual ~CSatisfiableCalculationJobsQuery(); virtual QString getQueryName(); virtual QString getQueryString(); virtual QString getAnswerString(); virtual bool hasAnswer(); virtual bool hasError(); virtual bool canCancelRemainingJobs(); virtual CQueryResult* getQueryResult(); virtual CQUERYLIST getJobList(); virtual CQUERYLIST getSatisfiableCalculationJobList(); CSatisfiableCalculationJobsQuery* setCalculationConfiguration(CCalculationConfigurationExtension* calculationConfiguration); CCalculationConfigurationExtension* getCalculationConfiguration(); CSatisfiableCalculationJobsQuery* setQueryName(const QString& queryName); CSatisfiableCalculationJobsQuery* setQueryString(const QString& text); CSatisfiableCalculationJobsQuery* setAnswerString(const QString& positiveText, const QString& negativeText, const QString& noAnswerText); CSatisfiableCalculationJobsQuery* addTestSatisfiableCalculationJob(CSatisfiableCalculationJob* satCalculationJob, bool mustBeSatisfiableForPositive = true); virtual bool interpreteJobSatisfiableCalculation(CSatisfiableCalculationJob* satCalculationJob, bool satisfiable, bool calculationError = false, QString* newAnserString = nullptr); CSatisfiableCalculationJobsQuery* setQueryStatistics(CQueryStatistics* stats); virtual CQueryStatistics* getQueryStatistics(); virtual CQuery* addErrorString(const QString& errorString); bool getResult(bool queryPositive = true); // protected methods protected: // protected variables protected: CQUERYLIST mJobDataList; cint64 mJobTotalCount; cint64 mJobCalcedCount; bool mJobCalcedNegative; bool mJobCalculationError; bool mQueryError; QString mQueryString; QString mQueryName; QString mPositiveAnswerString; QString mNegativeAnswerString; QString mNoAnswerString; QString mErrorString; CBooleanQueryResult* mQueryResult; CQueryStatistics* mQueryStats; CCalculationConfigurationExtension* mConfig; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONJOBSQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSatisfiableCalculationConceptConstruct.h0000644000175000017500000000457512520551242031260 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONCONCEPTCONSTRUCT_H #define KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONCONCEPTCONSTRUCT_H // Libraries includes // Namespace includes #include "QuerySettings.h" #include "CSatisfiableCalculationConstruct.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CIndividual.h" #include "Utilities/Container/CSortedNegLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Query { /*! * * \class CSatisfiableCalculationConceptConstruct * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCalculationConceptConstruct : public CSatisfiableCalculationConstruct { // public methods public: //! Constructor CSatisfiableCalculationConceptConstruct(); //! Destructor virtual ~CSatisfiableCalculationConceptConstruct(); CXSortedNegLinker* getConstructConceptLinker(); CSatisfiableCalculationConceptConstruct* addConstructConceptLinker(CXSortedNegLinker* takeConceptNegLiner); // protected methods protected: // protected variables protected: CXSortedNegLinker* mConstructConceptLinker; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONCONCEPTCONSTRUCT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CApproximatedSaturationCalculationJob.h0000644000175000017500000001147512520551230030745 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CAPPROXIMATEDSATURATIONCALCULATIONJOB_H #define KONCLUDE_REASONER_QUERY_CAPPROXIMATEDSATURATIONCALCULATIONJOB_H // Libraries includes // Namespace includes #include "QuerySettings.h" #include "CCalculationJob.h" #include "CApproximatedSaturationCalculationConstructionConstruct.h" #include "CApproximatedSaturationCalculationProcessingConstruct.h" // Other includes #include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h" #include "Reasoner/Kernel/Task/CCalculationStatisticsCollector.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationJobInstantiation.h" #include "Reasoner/Kernel/Task/CSaturationIndividualsAnalysingAdapter.h" #include "Reasoner/Kernel/Task/CTaskPreyingAdapter.h" #include "Reasoner/Consistence/CSaturationData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; using namespace Consistence; namespace Query { /*! * * \class CApproximatedSaturationCalculationJob * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CApproximatedSaturationCalculationJob : public CCalculationJob { // public methods public: //! Constructor CApproximatedSaturationCalculationJob(); //! Destructor virtual ~CApproximatedSaturationCalculationJob(); virtual CCalculationJobQueryData* getQueryData(); CApproximatedSaturationCalculationJob* setQueryData(CCalculationJobQueryData* takeQueryData); CApproximatedSaturationCalculationJob* addSatisfiableCalculationConstructionConstruct(CApproximatedSaturationCalculationConstructionConstruct* takeSatCalcConstruct); CApproximatedSaturationCalculationConstructionConstruct* getSatisfiableCalculationConstructionConstructs(); CApproximatedSaturationCalculationJob* addSatisfiableCalculationProcessingConstruct(CApproximatedSaturationCalculationProcessingConstruct* takeSatCalcConstruct); CApproximatedSaturationCalculationProcessingConstruct* getSatisfiableCalculationProcessingConstructs(); CApproximatedSaturationCalculationJob* setCalculationConfiguration(CCalculationConfigurationExtension* calculationConfiguration); CCalculationConfigurationExtension* getCalculationConfiguration(); CApproximatedSaturationCalculationJob* setCalclulationStatisticsCollector(CCalculationStatisticsCollector* calclulationStatisticsCollector); CCalculationStatisticsCollector* getCalclulationStatisticsCollector(); CApproximatedSaturationCalculationJob* setSaturationTaskPreyingAdapter(CTaskPreyingAdapter* preyingAdapter); CTaskPreyingAdapter* getSaturationTaskPreyingAdapter(); CSaturationData* getContinueSaturationData(); CApproximatedSaturationCalculationJob* setContinueSaturationData(CSaturationData* saturationData); bool isSeparateSaturation(); CApproximatedSaturationCalculationJob* setSeparateSaturation(bool separateSaturation); CApproximatedSaturationCalculationJob* setSaturationIndividualsAnalysationObserver(CSaturationIndividualsAnalysingAdapter* indiAnalAdapter); CSaturationIndividualsAnalysingAdapter* getSaturationIndividualsAnalysationObserver(); // protected methods protected: // protected variables protected: CCalculationJobQueryData* mQueryData; CApproximatedSaturationCalculationConstructionConstruct* mSatCalcConstructionConstructLinker; CApproximatedSaturationCalculationProcessingConstruct* mSatCalcProcessingConstructLinker; CCalculationConfigurationExtension* mCalculationConfiguration; CCalculationStatisticsCollector* mCalclulationStatisticsCollector; CTaskPreyingAdapter* mPreyingAdapter; CSaturationData* mContinueSaturationData; bool mSeparateSaturation; CSaturationIndividualsAnalysingAdapter* mIndiAnalAdapter; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CAPPROXIMATEDSATURATIONCALCULATIONJOB_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CCalculationJobQueryData.cpp0000644000175000017500000000216012520551232026461 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationJobQueryData.h" namespace Konclude { namespace Reasoner { namespace Query { CCalculationJobQueryData::CCalculationJobQueryData() { } CCalculationJobQueryData::~CCalculationJobQueryData() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSubClassesQuery.h0000644000175000017500000000532012520551242024514 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CSUBCLASSESQUERY_H #define KONCLUDE_REASONER_QUERY_CSUBCLASSESQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CClassSynsetsResult.h" #include "CTaxonomyPremisingQuery.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CSubClassesQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSubClassesQuery : public CTaxonomyPremisingQuery { // public methods public: //! Constructor CSubClassesQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CConcept* concept, bool direct, const QString& className, const QString& queryName = QString("UnnamedQuery")); //! Destructor virtual ~CSubClassesQuery(); virtual CQueryResult* constructResult(CTaxonomy *taxonomy); virtual CClassSynsetsResult* constructClassSynsetsResult(CTaxonomy *taxonomy); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual bool hasError(); bool isDirect(); // protected methods protected: // protected variables protected: QString mClassName; CConcept* mConcept; QString mQueryName; QString mQueryString; bool mDirect; CClassSynsetsResult* mResult; bool mUseAbbreviatedIRIs; bool mQueryConstructError; bool mTaxonomyCalcError; CConfigurationBase* mCalcConfig; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CSUBCLASSESQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSatisfiableCalculationJobQueryData.h0000644000175000017500000000510612520551242030301 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONJOBQUERYDATA_H #define KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONJOBQUERYDATA_H // Libraries includes // Namespace includes #include "QuerySettings.h" #include "CCalculationJobQueryData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CSatisfiableCalculationJobQueryData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCalculationJobQueryData : public CCalculationJobQueryData { // public methods public: //! Constructor CSatisfiableCalculationJobQueryData(CQuery* query = nullptr, bool ustBeSatisfiableForPositive = true); //! Destructor virtual ~CSatisfiableCalculationJobQueryData(); virtual CQuery* getQuery(); bool needsJobSatisfiabilityForPositiveQueryAnswer(); bool isJobCalculationSatisfiable(); bool isJobCalculationError(); bool isJobCalculated(); CSatisfiableCalculationJobQueryData* setJobCalculated(bool jobCalculated); CSatisfiableCalculationJobQueryData* setJobCalculationError(bool jobCalculationError); CSatisfiableCalculationJobQueryData* setJobCalculationSatisfiable(bool jobCalculationSatisfiable); // protected methods protected: // protected variables protected: CQuery* mQuery; bool mMustBeSatisfiableForPositive; bool mJobCalculated; bool mJobCalculationError; bool mJobCalculationSatisfiable; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONJOBQUERYDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSameIndividualsQuery.cpp0000644000175000017500000000636012520551242026066 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSameIndividualsQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CSameIndividualsQuery::CSameIndividualsQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CIndividual* individual, const QString& indiName, const QString& sameIndisQueryName) : CRealizationPremisingQuery(ontology,configuration) { mIndividualName = indiName; mIndividual = individual; queryName = sameIndisQueryName; if (mIndividualName.isEmpty()) { queryString = QString("Get Same Individuals"); } else { queryString = QString("Get Same Individuals for '%1'").arg(mIndividualName); } mResult = nullptr; mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.OWLlink.AbbreviatedIRIs",false); mRealizationCalcError = false; mQueryConstructError = false; mRequiresSameIndividualRealisation = true; mCalcConfig = configuration; } CSameIndividualsQuery::~CSameIndividualsQuery() { if (mResult) { delete mResult; } delete mCalcConfig; } CQueryResult* CSameIndividualsQuery::getQueryResult() { return mResult; } CQueryResult *CSameIndividualsQuery::constructResult(CRealization* realization) { return constructIndividualsResult(realization); } CIndividualSynonymsResult *CSameIndividualsQuery::constructIndividualsResult(CRealization* realization) { if (mResult) { delete mResult; mResult = 0; } if (realization) { CSameRealization* sameRealization = realization->getSameRealization(); if (sameRealization) { mResult = new CIndividualSynonymsResult(); CIndividualsResultVisitorGenerator resultGenerator(mResult,mUseAbbreviatedIRIs); sameRealization->visitSameIndividuals(mIndividual,&resultGenerator); } } return mResult; } QString CSameIndividualsQuery::getQueryName() { return queryName; } QString CSameIndividualsQuery::getQueryString() { return queryString; } bool CSameIndividualsQuery::hasAnswer() { return mResult != 0; } QString CSameIndividualsQuery::getAnswerString() { if (!mResult) { return QString("Unknown Individuals"); } else { return mResult->getQueryResultString(); } } bool CSameIndividualsQuery::hasError() { return mRealizationCalcError || mQueryConstructError || CQuery::hasError(); } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryStatisticsCollectionStrings.h0000644000175000017500000000537512520551240030175 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CQUERYSTATISTICSCOLLECTIONSTRINGS_H #define KONCLUDE_REASONER_QUERY_CQUERYSTATISTICSCOLLECTIONSTRINGS_H // Libraries includes // Namespace includes #include "QuerySettings.h" #include "CQueryStatistics.h" #include "CQueryCalculationStatisticsCollection.h" // Other includes #include "Reasoner/Kernel/Task/CCalculationStatisticsCollector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; namespace Query { /*! * * \class CQueryStatisticsCollectionStrings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQueryStatisticsCollectionStrings : public CQueryStatistics { // public methods public: //! Constructor CQueryStatisticsCollectionStrings(); //! Destructor virtual ~CQueryStatisticsCollectionStrings(); virtual bool addProcessingStatistics(COntologyProcessingStatistics* ontProcStats); virtual bool addProcessingStatistics(const QString& statName, cint64 statValue); virtual bool incProcessingStatistics(const QString& statName, cint64 incStatValue = 1); CQueryCalculationStatisticsCollection* getCalculationStatisticsCollectorLinker(); CQueryCalculationStatisticsCollection* createCalculationStatisticsCollection(); virtual QList getStatisticsNameStringList(); virtual cint64 getStatisticIntegerValue(const QString& statName); // protected methods protected: // protected variables protected: CQueryCalculationStatisticsCollection* mCalcStatCollLinker; bool mStatStringsCollected; QHash mStatNameStringsValueHash; QSet mStatNameStrings; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CQUERYSTATISTICSCOLLECTIONSTRINGS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CWriteOWLXMLIndividualFlattenedTypesQuery.h0000644000175000017500000001056312520551244031376 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CWRITEOWLXMLINDIVIDUALFLATTENEDTYPESQUERY_H #define KONCLUDE_REASONER_QUERY_CWRITEOWLXMLINDIVIDUALFLATTENEDTYPESQUERY_H // Libraries includes #include #include #include #include // Namespace includes #include "CQuery.h" #include "CRealizationPremisingQuery.h" #include "CQueryUnspecifiedStringError.h" #include "CQueryInconsitentOntologyError.h" #include "Reasoner/Realization/CConceptRealizationInstantiatedToConceptVisitor.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Realization; namespace Query { /*! * * \class CWriteOWLXMLIndividualFlattenedTypesQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteOWLXMLIndividualFlattenedTypesQuery : public CRealizationPremisingQuery, public CConceptRealizationInstantiatedToConceptVisitor { // public methods public: //! Constructor CWriteOWLXMLIndividualFlattenedTypesQuery(CConcreteOntology* ontology, CConfigurationBase *configuration, const QString& outputFileString, const QString& individualNameString = QString(""), const QString &subClassHierarchyQueryName = QString("UnnamedWriteIndividualTypesQuery")); virtual CQueryResult* constructResult(CRealization* realization); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult *getQueryResult(); virtual bool hasError(); virtual CQuery* addQueryError(CQueryError* queryError); // protected methods protected: void forcedPathCreated(const QString& filePath); bool writeInconsistentIndividualTypes(); bool writeIndividualTypesResult(CRealization* realization); void writeIndividualDeclaration(const QString& individualName, QXmlStreamWriter* outputStreamWriter); void writeClassDeclaration(const QString& className, QXmlStreamWriter* outputStreamWriter); void writeIndividualType(const QString& individualName, const QString& className, QXmlStreamWriter* outputStreamWriter); void writeSubClassRelation(const QString& subClassName, const QString& superClassName, QXmlStreamWriter* outputStreamWriter); void writeOntologyStart(QXmlStreamWriter* outputStreamWriter); void writeOntologyEnd(QXmlStreamWriter* outputStreamWriter); void writeOntologyPrefix(QXmlStreamWriter* outputStreamWriter, const QString& prefixName, const QString& prefixIRI); virtual bool visitConcept(CConcept* concept, CConceptRealization* conRealization); // protected variables protected: QString mClassName; QString mQueryName; QString mQueryString; QString mIndividualNameString; QString mOutputFileNameString; QString mBottomClassNameString; QString mTopClassNameString; QSet mDeclaratedConceptSet; QString mCurrentIndividualName; QXmlStreamWriter* mCurrentOutputStreamWriter; bool mUseAbbreviatedIRIs; bool mWriteDeclarations; bool mWriteOnlyDirectTypes; bool mWriteSubClassOfInconsistency; bool mQueryAnswered; bool mQueryConstructError; bool mRealizationCalcError; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CWRITEOWLXMLINDIVIDUALFLATTENEDTYPESQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSatisfiableCalculationConceptConstruct.cpp0000644000175000017500000000375712520551242031614 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCalculationConceptConstruct.h" namespace Konclude { namespace Reasoner { namespace Query { CSatisfiableCalculationConceptConstruct::CSatisfiableCalculationConceptConstruct() { mConstructConceptLinker = nullptr; } CSatisfiableCalculationConceptConstruct::~CSatisfiableCalculationConceptConstruct() { CXSortedNegLinker* constructConceptLinkerIt = mConstructConceptLinker; while (constructConceptLinkerIt) { CXSortedNegLinker* tmpConstructConceptLinker = constructConceptLinkerIt; constructConceptLinkerIt = constructConceptLinkerIt->getNext(); delete tmpConstructConceptLinker; } } CXSortedNegLinker* CSatisfiableCalculationConceptConstruct::getConstructConceptLinker() { return mConstructConceptLinker; } CSatisfiableCalculationConceptConstruct* CSatisfiableCalculationConceptConstruct::addConstructConceptLinker(CXSortedNegLinker* takeConceptNegLiner) { if (takeConceptNegLiner) { mConstructConceptLinker = takeConceptNegLiner->append(mConstructConceptLinker); } return this; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIndividualSynonymsResult.cpp0000644000175000017500000000210512520551234027020 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualSynonymsResult.h" namespace Konclude { namespace Reasoner { namespace Query { CIndividualSynonymsResult::CIndividualSynonymsResult() : CIndividualsResult() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CTypesQuery.h0000644000175000017500000000542412520551244023560 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CTYPESQUERY_H #define KONCLUDE_REASONER_QUERY_CTYPESQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CClassSynsetsResult.h" #include "CRealizationPremisingQuery.h" #include "CClassSynsetsResultVisitorGenerator.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CTypesQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTypesQuery : public CRealizationPremisingQuery { // public methods public: //! Constructor CTypesQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CIndividual* indi, bool direct, const QString& individualName, const QString& flatternedTypeQueryName = QString("UnnamedTypesQuery")); //! Destructor virtual ~CTypesQuery(); virtual CQueryResult* constructResult(CRealization* realization); virtual CClassSynsetsResult* constructClassSynsetsResult(CRealization* realization); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual bool hasError(); bool isDirect(); // protected methods protected: // protected variables protected: QString mIndividualName; CIndividual* mIndividual; QString queryName; QString queryString; bool mDirect; CClassSynsetsResult* mResult; bool mUseAbbreviatedIRIs; bool mQueryConstructError; bool mRealizationCalcError; CConfigurationBase* mCalcConfig; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CTYPESQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CCalculationJobQueryData.h0000644000175000017500000000346312520551232026135 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CCALCULATIONJOBQUERYDATA_H #define KONCLUDE_REASONER_QUERY_CCALCULATIONJOBQUERYDATA_H // Libraries includes // Namespace includes #include "QuerySettings.h" #include "CQuery.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CCalculationJobQueryData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationJobQueryData { // public methods public: //! Constructor CCalculationJobQueryData(); //! Destructor virtual ~CCalculationJobQueryData(); virtual CQuery* getQuery() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CCALCULATIONJOBQUERYDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSatisfiableCalculationConstruct.cpp0000644000175000017500000000422012520551242030262 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCalculationConstruct.h" namespace Konclude { namespace Reasoner { namespace Query { CSatisfiableCalculationConstruct::CSatisfiableCalculationConstruct() : CLinkerBase(this) { mIndividual = nullptr; mIndiID = -1; mRelNodeID = 0; } CSatisfiableCalculationConstruct::~CSatisfiableCalculationConstruct() { } CSatisfiableCalculationConstruct* CSatisfiableCalculationConstruct::getNextConstruct() { return getNext(); } CSatisfiableCalculationConstruct* CSatisfiableCalculationConstruct::setIndividual(CIndividual* individual) { mIndividual = individual; return this; } CIndividual* CSatisfiableCalculationConstruct::getIndividual() { return mIndividual; } CSatisfiableCalculationConstruct* CSatisfiableCalculationConstruct::setIndividualID(cint64 individualID) { mIndiID = individualID; return this; } cint64 CSatisfiableCalculationConstruct::getIndividualID() { return mIndiID; } CSatisfiableCalculationConstruct* CSatisfiableCalculationConstruct::setRelativeNewNodeID(cint64 nodeID) { return this; } cint64 CSatisfiableCalculationConstruct::getRelativeNewNodeID() { return mRelNodeID; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/QuerySettings.h0000644000175000017500000000315512520551244024150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_QUERYSETTINGS #define KONCLUDE_REASONER_QUERY_QUERYSETTINGS // Libraries includes #include #include #include // Namespace includes // Other includes #include "Utilities/Memory/CObjectAllocator.h" #include "Utilities/Container/CLinker.h" // Logger includes namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Query { /*! * * \file ProcessSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations // mappings #define CQUERYLIST QList #define CQUERYHASH QHash }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_QUERY_QUERYSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CConsistencePremisingQuery.h0000644000175000017500000000456712520551234026615 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CCONSISTENCEPREMISINGQUERY_H #define KONCLUDE_REASONER_QUERY_CCONSISTENCEPREMISINGQUERY_H // Libraries includes // Namespace includes #include "CQuery.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Ontology; namespace Query { /*! * * \class CConsitencyPremisingQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConsistencePremisingQuery : public CQuery { // public methods public: //! Constructor CConsistencePremisingQuery(CConcreteOntology *ontology, CConfigurationBase *configuration); //! Destructor virtual ~CConsistencePremisingQuery(); virtual CConcreteOntology *getOntology(); virtual CQueryResult *constructResult(CConsistence* consistence) = 0; virtual CConfigurationBase *getConfiguration(); CConsistencePremisingQuery* setQueryStatistics(CQueryStatistics* stats); virtual CQueryStatistics* getQueryStatistics(); // protected methods protected: // protected variables protected: CConcreteOntology *ontology; CConfigurationBase *config; CQueryStatistics* mQueryStats; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CCONSISTENCEPREMISINGQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIsInstanceOfQuery.h0000644000175000017500000000366212520551236025004 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CISINSTANCEOFQUERY_H #define KONCLUDE_REASONER_QUERY_CISINSTANCEOFQUERY_H // Libraries includes #include // Namespace includes #include "CSatisfiableCalculationJobsQuery.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CIsInstanceOfQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIsInstanceOfQuery : public CSatisfiableCalculationJobsQuery { // public methods public: //! Constructor CIsInstanceOfQuery(const QString& individualName, const QString& className, const QString& queryName = QString("UnnamedIsInstanceOfQuery")); //! Destructor virtual ~CIsInstanceOfQuery(); bool isInstance(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CIsInstanceOfQuery_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CDeterministicNondeterministicIndividualsQuery.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CDeterministicNondeterministicIndividualsQuery.0000644000175000017500000002522112520551234032536 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDeterministicNondeterministicIndividualsQuery.h" #include "Reasoner/Kernel/Task/CConsistenceTaskData.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; namespace Query { CDeterministicNondeterministicIndividualsQuery::CDeterministicNondeterministicIndividualsQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QSet& individualSet, const QString& queryName) : CRealizationPremisingQuery(ontology,configuration) { mQueryName = queryName; mResult = nullptr; mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.OWLlink.AbbreviatedIRIs",false); mConsistencyCalcError = false; mQueryConstructError = false; mCalcConfig = configuration; mIndividualSet = individualSet; mDeterministicIndividuals = false; mRequiresConceptRealisation = true; mRequiresSameIndividualRealisation = true; } CDeterministicNondeterministicIndividualsQuery::~CDeterministicNondeterministicIndividualsQuery() { if (mResult) { delete mResult; } delete mCalcConfig; } CQueryResult* CDeterministicNondeterministicIndividualsQuery::getQueryResult() { return mResult; } CQueryResult *CDeterministicNondeterministicIndividualsQuery::constructResult(CRealization* realization) { return constructIndividualsResult(realization); } bool CDeterministicNondeterministicIndividualsQuery::addIndividualResultData(CIndividual* indi, CIndividualProcessNodeVector* indiNodeVec, QSet >* possAssSet) { cint64 indiID = indi->getIndividualID(); CBOXSET* eqNonCanSet = mOntology->getTBox()->getEquivalentConceptNonCandidateSet(false); CIndividualProcessNode* baseIndiNode = indiNodeVec->getData(indiID); CIndividualProcessNode* indiNode = baseIndiNode; if (indiNode && indiNode->getNominalIndividual()) { cint64 mergedIndiID = indiID; bool nonDeterministicMerged = false; while (mergedIndiID != indiNode->getMergedIntoIndividualNodeID()) { mergedIndiID = indiNode->getMergedIntoIndividualNodeID(); CDependencyTrackPoint* mergedDepTrackPoint = indiNode->getMergedDependencyTrackPoint(); if (!mergedDepTrackPoint || mergedDepTrackPoint->getBranchingTag() > 0) { nonDeterministicMerged = true; } indiNode = indiNodeVec->getData(mergedIndiID); } CReapplyConceptLabelSet* conLabelSet = indiNode->getReapplyConceptLabelSet(false); if (conLabelSet) { for (CConceptDescriptor* conDesIt = conLabelSet->getAddingSortedConceptDescriptionLinker(); conDesIt; conDesIt = conDesIt->getNext()) { CDependencyTrackPoint* depTrackPoint = conDesIt->getDependencyTrackPoint(); CConcept* concept = conDesIt->getConcept(); bool conNegation = conDesIt->isNegated(); if (nonDeterministicMerged || !depTrackPoint || depTrackPoint->getBranchingTag() > 0) { if (!conNegation && concept && concept->hasClassName()) { possAssSet->insert( QPair(indi,concept) ); } } if (concept->getOperatorCode() == CCEQCAND) { CConcept* eqConcept = concept->getOperandList()->getData(); bool negation = false; if (!conLabelSet->containsConcept(eqConcept,negation)) { possAssSet->insert( QPair(indi,eqConcept) ); } } } if (eqNonCanSet) { for (CBOXSET::const_iterator it = eqNonCanSet->constBegin(), itEnd = eqNonCanSet->constEnd(); it != itEnd; ++it) { CConcept* eqConcept(*it); bool negation = false; if (!conLabelSet->containsConcept(eqConcept,negation)) { possAssSet->insert( QPair(indi,eqConcept) ); } } } } return true; } return false; } CIndividualsResult *CDeterministicNondeterministicIndividualsQuery::constructIndividualsResult(CRealization* realization) { if (mResult) { delete mResult; mResult = 0; } CConsistence* consistence = mOntology->getConsistence(); if (consistence && realization) { mResult = new CIndividualsResult(); CConceptRealization* conRealisation = realization->getConceptRealization(); CPossibleAssertionsCollectionSet* possAssCollSet = conRealisation->getPossibleAssertionCollectionSet(); QSet< QPair > possAssSet; QSet< QPair > knownAssSet; CIndividualVector* indiVec = mOntology->getABox()->getIndividualVector(); cint64 indiCount = indiVec->getItemCount(); CConsistenceTaskData* consTaskData = (CConsistenceTaskData*)consistence->getConsistenceModelData(); if (consTaskData) { CSatisfiableCalculationTask* detTask = consTaskData->getDeterministicSatisfiableTask(); CSatisfiableCalculationTask* nonDetTask = consTaskData->getCompletionGraphCachedSatisfiableTask(); if (detTask != nonDetTask) { CProcessingDataBox* dataBox = nonDetTask->getProcessingDataBox(); if (dataBox) { CIndividualProcessNodeVector* indiNodeVec = dataBox->getIndividualProcessNodeVector(); cint64 indiNodeCount = indiNodeVec->getItemCount(); if (mIndividualSet.isEmpty()) { if (possAssCollSet) { for (CPossibleAssertionsCollectionSet::const_iterator it = possAssCollSet->constBegin(), itEnd = possAssCollSet->constEnd(); it != itEnd; ++it) { const QPair& possAssPair(*it); possAssSet.insert( QPair(possAssPair.first,possAssPair.second) ); } } for (cint64 indiID = 0; indiID < indiCount; ++indiID) { CIndividual* individual = indiVec->getData(indiID); if (individual) { addIndividualResultData(individual,indiNodeVec,&possAssSet); CIndividualConceptAssertionSetCollector indiConAssColl(individual,&knownAssSet); conRealisation->visitTypes(individual,&indiConAssColl); } } } else { if (possAssCollSet) { for (CPossibleAssertionsCollectionSet::const_iterator it = possAssCollSet->constBegin(), itEnd = possAssCollSet->constEnd(); it != itEnd; ++it) { const QPair& possAssPair(*it); CIndividual* individual(possAssPair.first); if (mIndividualSet.contains(individual)) { possAssSet.insert( QPair(possAssPair.first,possAssPair.second) ); } } } for (QSet::const_iterator it = mIndividualSet.constBegin(), itEnd = mIndividualSet.constEnd(); it != itEnd; ++it) { CIndividual* individual(*it); addIndividualResultData(individual,indiNodeVec,&possAssSet); CIndividualConceptAssertionSetCollector indiConAssColl(individual,&knownAssSet); conRealisation->visitTypes(individual,&indiConAssColl); } } } } } QSet nonDetIndiSet; for (QSet< QPair >::const_iterator it = possAssSet.constBegin(), itEnd = possAssSet.constEnd(); it != itEnd; ++it) { const QPair& indiConPair(*it); if (!knownAssSet.contains(indiConPair)) { CIndividual* indi = indiConPair.first; nonDetIndiSet.insert(indi); } } if (mIndividualSet.isEmpty()) { for (cint64 indiID = 0; indiID < indiCount; ++indiID) { CIndividual* individual = indiVec->getData(indiID); if (individual) { bool addIndiToResult = false; if (mDeterministicIndividuals && !nonDetIndiSet.contains(individual)) { addIndiToResult = true; } else if (!mDeterministicIndividuals && nonDetIndiSet.contains(individual)) { addIndiToResult = true; } if (addIndiToResult) { QString indiName; if (mUseAbbreviatedIRIs) { indiName = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(individual->getIndividualNameLinker()); } else { indiName = CIRIName::getRecentIRIName(individual->getIndividualNameLinker()); } mResult->addIndividual(indiName); } } } } else { for (QSet::const_iterator it = mIndividualSet.constBegin(), itEnd = mIndividualSet.constEnd(); it != itEnd; ++it) { CIndividual* individual(*it); bool addIndiToResult = false; if (mDeterministicIndividuals && !nonDetIndiSet.contains(individual)) { addIndiToResult = true; } else if (!mDeterministicIndividuals && nonDetIndiSet.contains(individual)) { addIndiToResult = true; } if (addIndiToResult) { QString indiName; if (mUseAbbreviatedIRIs) { indiName = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(individual->getIndividualNameLinker()); } else { indiName = CIRIName::getRecentIRIName(individual->getIndividualNameLinker()); } mResult->addIndividual(indiName); } } } } return mResult; } QString CDeterministicNondeterministicIndividualsQuery::getQueryName() { return mQueryName; } QString CDeterministicNondeterministicIndividualsQuery::getQueryString() { return mQueryString; } bool CDeterministicNondeterministicIndividualsQuery::hasAnswer() { return mResult != 0; } QString CDeterministicNondeterministicIndividualsQuery::getAnswerString() { if (!mResult) { return QString("Unknown Individuals"); } else { return mResult->getQueryResultString(); } } bool CDeterministicNondeterministicIndividualsQuery::hasError() { return mConsistencyCalcError || mQueryConstructError || CQuery::hasError(); } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CObjectPropertyTargetsQuery.h0000644000175000017500000000573112520551240026756 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_COBJECTPROPERTYTARGETSQUERY_H #define KONCLUDE_REASONER_QUERY_COBJECTPROPERTYTARGETSQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CIndividualSynsetsResult.h" #include "CRealizationPremisingQuery.h" #include "CIndividualSynsetsResultVisitorGenerator.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CObjectPropertyTargetsQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CObjectPropertyTargetsQuery : public CRealizationPremisingQuery { // public methods public: //! Constructor CObjectPropertyTargetsQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CIndividual* individual, CRole* role, const QString& objectPropertyTargetQueryName = QString("UnnamedObjectPropertyTargetsQuery")); //! Destructor virtual ~CObjectPropertyTargetsQuery(); virtual CQueryResult* constructResult(CRealization* realization); virtual CIndividualSynsetsResult* constructIndividualSynsetsResult(CRealization* realization); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual bool hasError(); CIndividual* getIndividual(); CRole* getRole(); // protected methods protected: // protected variables protected: QString mIndividualName; QString mRoleName; CIndividual* mIndividual; CRole* mRole; QString queryName; QString queryString; CIndividualSynsetsResult* mResult; bool mUseAbbreviatedIRIs; bool mQueryConstructError; bool mRealizationCalcError; CConfigurationBase* mCalcConfig; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_COBJECTPROPERTYTARGETSQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIndividualsResultVisitorGenerator.cpp0000644000175000017500000000565512520551234030667 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualsResultVisitorGenerator.h" namespace Konclude { namespace Reasoner { namespace Query { CIndividualsResultVisitorGenerator::CIndividualsResultVisitorGenerator(CIndividualsResult* individualsResult, bool abbreviatedIRIs) { mIndividualsResult = individualsResult; mAbbreviatedIRIs = abbreviatedIRIs; } bool CIndividualsResultVisitorGenerator::visitIndividual(CIndividual* individual, CConceptRealization* conRealization) { QString individualString; if (mAbbreviatedIRIs) { individualString = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(individual->getIndividualNameLinker()); } if (individualString.isEmpty()) { individualString = CIRIName::getRecentIRIName(individual->getIndividualNameLinker()); } if (!individualString.isEmpty()) { mIndividualsResult->addIndividual(individualString); } return true; } bool CIndividualsResultVisitorGenerator::visitIndividual(CIndividual* individual, CRoleRealization* roleRealization) { QString individualString; if (mAbbreviatedIRIs) { individualString = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(individual->getIndividualNameLinker()); } if (individualString.isEmpty()) { individualString = CIRIName::getRecentIRIName(individual->getIndividualNameLinker()); } if (!individualString.isEmpty()) { mIndividualsResult->addIndividual(individualString); } return true; } bool CIndividualsResultVisitorGenerator::visitIndividual(CIndividual* individual, CSameRealization* sameRealization) { QString individualString; if (mAbbreviatedIRIs) { individualString = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(individual->getIndividualNameLinker()); } if (individualString.isEmpty()) { individualString = CIRIName::getRecentIRIName(individual->getIndividualNameLinker()); } if (!individualString.isEmpty()) { mIndividualsResult->addIndividual(individualString); } return true; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CJobProvidedQuery.h0000644000175000017500000000345412520551236024665 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CJOBPROVIDEDQUERY_H #define KONCLUDE_REASONER_QUERY_CJOBPROVIDEDQUERY_H // Libraries includes // Namespace includes #include "CQuery.h" #include "CCalculationJob.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CJobProvidedQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CJobProvidedQuery : public CQuery { // public methods public: //! Constructor CJobProvidedQuery(); //! Destructor virtual ~CJobProvidedQuery(); virtual CQUERYLIST getJobList() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CJOBPROVIDEDQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CDeterministicClassAssertionQuery.h0000644000175000017500000000404012520551234030125 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CDETERMINISTICCLASSASSERTIONQUERY_H #define KONCLUDE_REASONER_QUERY_CDETERMINISTICCLASSASSERTIONQUERY_H // Libraries includes #include // Namespace includes #include "CClassAssertionQuery.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CDeterministicClassAssertionQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDeterministicClassAssertionQuery : public CClassAssertionQuery { // public methods public: //! Constructor CDeterministicClassAssertionQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QSet& individualSet, const QString& queryName = QString("UnnamedKnownConceptAssertionsQuery")); //! Destructor virtual ~CDeterministicClassAssertionQuery(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CDETERMINISTICCLASSASSERTIONQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CFlattenedObjectPropertyTargetsQuery.cpp0000644000175000017500000000734512520551234031146 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CFlattenedObjectPropertyTargetsQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CFlattenedObjectPropertyTargetsQuery::CFlattenedObjectPropertyTargetsQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CIndividual* individual, CRole* role, const QString& objectPropertyTargetQueryName) : CRealizationPremisingQuery(ontology,configuration) { mIndividual = individual; mRole = role; mIndividualName = CIRIName::getRecentIRIName(individual->getIndividualNameLinker()); mRoleName = CIRIName::getRecentIRIName(role->getPropertyNameLinker()); queryName = objectPropertyTargetQueryName; if (queryName.isEmpty()) { if (!mIndividualName.isEmpty() && !mRoleName.isEmpty()) { queryString = QString("Get Flattened Object Property Targets"); } else { queryString = QString("Get Flattened Object Property Targets for Individual '%1'").arg(mIndividualName); } } mResult = nullptr; mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.OWLlink.AbbreviatedIRIs",false); mRealizationCalcError = false; mQueryConstructError = false; mRequiresRoleRealisation = true; mRequiresSameIndividualRealisation = true; mCalcConfig = configuration; } CFlattenedObjectPropertyTargetsQuery::~CFlattenedObjectPropertyTargetsQuery() { if (mResult) { delete mResult; } delete mCalcConfig; } CQueryResult* CFlattenedObjectPropertyTargetsQuery::getQueryResult() { return mResult; } CQueryResult *CFlattenedObjectPropertyTargetsQuery::constructResult(CRealization* realization) { return constructIndividualsResult(realization); } CIndividualsResult *CFlattenedObjectPropertyTargetsQuery::constructIndividualsResult(CRealization* realization) { if (mResult) { delete mResult; mResult = 0; } if (realization) { CRoleRealization* roleRealization = realization->getRoleRealization(); if (roleRealization) { mResult = new CIndividualsResult(); CIndividualsResultVisitorGenerator resultGenerator(mResult,mUseAbbreviatedIRIs); roleRealization->visitTargetIndividuals(mIndividual,mRole,&resultGenerator); } } return mResult; } QString CFlattenedObjectPropertyTargetsQuery::getQueryName() { return queryName; } QString CFlattenedObjectPropertyTargetsQuery::getQueryString() { return queryString; } bool CFlattenedObjectPropertyTargetsQuery::hasAnswer() { return mResult != 0; } QString CFlattenedObjectPropertyTargetsQuery::getAnswerString() { if (!mResult) { return QString("Unknown Individuals"); } else { return mResult->getQueryResultString(); } } bool CFlattenedObjectPropertyTargetsQuery::hasError() { return mRealizationCalcError || mQueryConstructError || CQuery::hasError(); } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CAreClassesDisjointQuery.h0000644000175000017500000000371212520551230026176 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CARECLASSESDISJOINTQUERY_H #define KONCLUDE_REASONER_QUERY_CARECLASSESDISJOINTQUERY_H // Libraries includes #include // Namespace includes #include "CSatisfiableCalculationJobsQuery.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CAreClassesDisjointQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAreClassesDisjointQuery : public CSatisfiableCalculationJobsQuery { // public methods public: //! Constructor CAreClassesDisjointQuery(QStringList classNames, const QString& queryName = QString("UnnamedAreClassesDisjointQuery")); //! Destructor virtual ~CAreClassesDisjointQuery(); bool areClassesDisjoint(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CARECLASSESDISJOINTQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CInstancesQuery.h0000644000175000017500000000550112520551236024400 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CINSTANCESQUERY_H #define KONCLUDE_REASONER_QUERY_CINSTANCESQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CIndividualSynsetsResult.h" #include "CRealizationPremisingQuery.h" #include "CIndividualSynsetsResultVisitorGenerator.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CInstancesQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CInstancesQuery : public CRealizationPremisingQuery { // public methods public: //! Constructor CInstancesQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CConcept* concept, bool direct, const QString& conceptName, const QString& flatternedTypeQueryName = QString("UnnamedInstancesQuery")); //! Destructor virtual ~CInstancesQuery(); virtual CQueryResult* constructResult(CRealization* realization); virtual CIndividualSynsetsResult* constructIndividualSynsetsResult(CRealization* realization); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual bool hasError(); bool isDirect(); // protected methods protected: // protected variables protected: QString mConceptName; CConcept* mConcept; QString queryName; QString queryString; bool mDirect; CIndividualSynsetsResult* mResult; bool mUseAbbreviatedIRIs; bool mQueryConstructError; bool mRealizationCalcError; CConfigurationBase* mCalcConfig; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CINSTANCESQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSubClassHierarchyQuery.h0000644000175000017500000000572712520551242026036 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CSUBCLASSHIERARCHYQUERY_H #define KONCLUDE_REASONER_QUERY_CSUBCLASSHIERARCHYQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CClassHierarchyResult.h" #include "CTaxonomyPremisingQuery.h" #include "CResultInterceptionData.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CSubClassHierarchyQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSubClassHierarchyQuery : public CTaxonomyPremisingQuery { // public methods public: //! Constructor CSubClassHierarchyQuery(CConcreteOntology *premisingTaxonomyOntology, CTaxonomyPremisingQuerySupport *taxonomyQuerySupport, CConfigurationBase *configuration, const QString &superClassName = QString(""), const QString &subClassHierarchyQueryName = QString("UnnamedSubClassQuery")); //! Destructor virtual ~CSubClassHierarchyQuery(); virtual CQueryResult *constructResult(CTaxonomy *taxonomy); virtual CClassHierarchyResult *constructSubClassHierarchyResult(CTaxonomy *taxonomy); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult *getQueryResult(); virtual CResultInterceptionData *getPossibleResultInterception(); virtual CTaxonomyPremisingQuerySupport *getTaxonomyQuerySupport(); virtual bool hasError(); // protected methods protected: // protected variables protected: QString className; QString queryName; QString queryString; CClassHierarchyResult *result; CTaxonomyPremisingQuerySupport *taxQuerySupport; bool useAbbreviatedIRIs; bool mQueryConstructError; bool mTaxCalcError; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CSUBCLASSHIERARCHYQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassHierarchyResult.h0000644000175000017500000000757312520551232025535 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CCLASSHIERARCHYRESULT_H #define KONCLUDE_REASONER_QUERY_CCLASSHIERARCHYRESULT_H // Libraries includes #include // Namespace includes #include "CClassSubClassesRelationResult.h" #include "CQueryResult.h" #include "CClassSynsetResult.h" // Other includes #include "Reasoner/Taxonomy/CTaxonomy.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Taxonomy; using namespace Ontology; namespace Query { /*! * * \class CClassHierarchyResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassHierarchyResult : public CQueryResult { // public methods public: //! Constructor CClassHierarchyResult(); CClassHierarchyResult(const QString &bottomHierarchyClass, const QString &topHierarchyClass); CClassHierarchyResult(const QStringList &bottomHierarchyClasses, const QStringList &topHierarchyClasses); CClassHierarchyResult(CClassSynsetResult *takeBottomClassSynset, CClassSynsetResult *takeTopClassSynset); CClassHierarchyResult(CClassSynsetResult *takeBottomClassSynset); //! Destructor virtual ~CClassHierarchyResult(); virtual QString getQueryResultString(); virtual bool isResultEquivalentTo(CQueryResult *otherQueryResult); CClassSynsetResult *getClassSynset(const QString &className, bool create = true); CClassSynsetResult *getClassSynset(const QStringList &classNames, bool create = true); CClassSynsetResult *addClassSynset(CClassSynsetResult *takeClassSynset); CClassSynsetResult *setTopClassSynset(CClassSynsetResult *classSynset); CClassSynsetResult *getBottomClassSynset(); CClassSynsetResult *getTopClassSynset(); CClassSubClassesRelationResult *addSubClassRelation(CClassSynsetResult *superClassSynset, CClassSynsetResult *anySubClassSynset); CClassSubClassesRelationResult *getSubClassRelation(CClassSynsetResult *superClassSynset, bool create = true); virtual CTaxonomy *fillTaxonomy(CConcreteOntology *ontology, Reasoner::Taxonomy::CTaxonomy *taxonomy); // protected methods protected: void collectSubsumerClassSynsets(CClassHierarchyResult *otherClassHierarchy, QHash* subsumHash, QSet< QPair >* subsumSet = nullptr); void compareSubsumersCount(QHash* subsumHash1, QHash* subsumHash2); // protected variables protected: CClassSynsetResult *bottomClass; CClassSynsetResult *topClass; QList subClassRelationContainer; QList classSynsetContainer; QHash classClassSynsetHash; QHash classSynsetSubClassHash; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CCLASSHIERARCHYRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CBooleanQueryResult.cpp0000644000175000017500000000403612520551230025556 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBooleanQueryResult.h" namespace Konclude { namespace Reasoner { namespace Query { CBooleanQueryResult::CBooleanQueryResult(bool booleanResult) { result = booleanResult; } CBooleanQueryResult::~CBooleanQueryResult() { } CBooleanQueryResult *CBooleanQueryResult::setResult(bool booleanResult) { result = booleanResult; return this; } bool CBooleanQueryResult::getResult() { return result; } QString CBooleanQueryResult::getQueryResultString() { if (result) { return QString("true"); } else { return QString("false"); } } bool CBooleanQueryResult::isResultEquivalentTo(CQueryResult *otherQueryResult) { if (otherQueryResult) { CBooleanQueryResult *otherBoolQueryResult = dynamic_cast(otherQueryResult); if (otherBoolQueryResult) { return isResultEquivalentTo(otherBoolQueryResult); } } return false; } bool CBooleanQueryResult::isResultEquivalentTo(CBooleanQueryResult *otherQueryResult) { if (otherQueryResult) { return otherQueryResult->getResult() == result; } else { return false; } } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CAreAxiomsEntailedQuery.h0000644000175000017500000000370112520551230026001 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CAREAXIOMSENTAILEDQUERY_H #define KONCLUDE_REASONER_QUERY_CAREAXIOMSENTAILEDQUERY_H // Libraries includes #include // Namespace includes #include "CSatisfiableCalculationJobsQuery.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CAreAxiomsEntailedQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAreAxiomsEntailedQuery : public CSatisfiableCalculationJobsQuery { // public methods public: //! Constructor CAreAxiomsEntailedQuery(QStringList axiomTypeNames, const QString& queryName = QString("UnnamedEntailmentQuery")); //! Destructor virtual ~CAreAxiomsEntailedQuery(); bool areClassesEquivalent(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CAREAXIOMSENTAILEDQUERY_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CWriteFunctionalClassSubsumptionsHierarchyQuery.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CWriteFunctionalClassSubsumptionsHierarchyQuery0000644000175000017500000003651212520551244032626 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteFunctionalClassSubsumptionsHierarchyQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CWriteFunctionalClassSubsumptionsHierarchyQuery::CWriteFunctionalClassSubsumptionsHierarchyQuery(CConcreteOntology *premisingTaxonomyOntology, CConfigurationBase *configuration, const QString& outputFileString, const QString &superClassName, const QString &subClassHierarchyQueryName) : CTaxonomyPremisingQuery(premisingTaxonomyOntology,configuration) { mClassName = superClassName; mQueryName = subClassHierarchyQueryName; if (mClassName.isEmpty()) { mQueryString = QString("Get Subclass Hierarchy"); } else { mQueryString = QString("Get Subclass Hierarchy of class '%1'").arg(mClassName); } mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.ORE.ClassHierarchyResult.AbbreviatedIRIs",false); mWriteDeclarations = CConfigDataReader::readConfigBoolean(configuration,"Konclude.ORE.ClassHierarchyResult.WriteDeclarations",false); mWriteDirectEquivalences = CConfigDataReader::readConfigBoolean(configuration,"Konclude.ORE.ClassHierarchyResult.WriteDirectEquivalences",false); mWriteSimpleTopImplications = CConfigDataReader::readConfigBoolean(configuration,"Konclude.ORE.ClassHierarchyResult.WriteReducedTopSubclasses",false); mWriteSimpleBottomImplications = CConfigDataReader::readConfigBoolean(configuration,"Konclude.ORE.ClassHierarchyResult.WriteReducedBottomSubclasses",true); mWriteSimpleInconsistency = CConfigDataReader::readConfigBoolean(configuration,"Konclude.ORE.ClassHierarchyResult.WriteReducedInconsistency",true); mTaxCalcError = false; mQueryConstructError = false; mBottomClassNameString = QString("http://www.w3.org/2002/07/owl#Nothing"); mTopClassNameString = QString("http://www.w3.org/2002/07/owl#Thing"); mOutputFileNameString = outputFileString; mQueryAnswered = false; } CQueryResult *CWriteFunctionalClassSubsumptionsHierarchyQuery::getQueryResult() { return nullptr; } CQuery* CWriteFunctionalClassSubsumptionsHierarchyQuery::addQueryError(CQueryError* queryError) { if (CQueryInconsitentOntologyError::hasInconsistentOntologyError(queryError)) { // write inconsistency if (!writeInconsistentHierarchyResult()) { addQueryError(new CQueryUnspecifiedStringError(QString("Could not write class hierarchy to file '%1'.").arg(mOutputFileNameString))); } } CQuery::addQueryError(queryError); return this; } void CWriteFunctionalClassSubsumptionsHierarchyQuery::forcedPathCreated(const QString& filePath) { QString path = filePath; if (path.contains("/") || path.contains("\\")) { int lastSlash = path.lastIndexOf("/"); int lastBackSlash = path.lastIndexOf("\\"); int lastSeparator = qMax(lastBackSlash,lastSlash); path = path.mid(0,lastSeparator); if (!path.isEmpty()) { QDir dir; dir.mkpath(path); } } } bool CWriteFunctionalClassSubsumptionsHierarchyQuery::writeInconsistentHierarchyResult() { forcedPathCreated(mOutputFileNameString); QFile outputFile(mOutputFileNameString); if (outputFile.open(QIODevice::WriteOnly)) { writeOntologyStart(&outputFile); CConcept* mTopConcept = ontology->getTBox()->getTopConcept(); CConcept* mBottomConcept = ontology->getTBox()->getTopConcept(); CBOXSET* activeClassConceptSet = ontology->getTBox()->getActiveClassConceptSet(); if (mWriteSimpleInconsistency) { writeSubClassRelation(mTopClassNameString,mBottomClassNameString,&outputFile); } else { if (mWriteDeclarations) { for (CBOXSET::const_iterator it = activeClassConceptSet->constBegin(), itEnd = activeClassConceptSet->constEnd(); it != itEnd; ++it) { CConcept* concept(*it); QString className = CIRIName::getRecentIRIName(concept->getClassNameLinker()); if (mUseAbbreviatedIRIs) { className = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(concept->getClassNameLinker()); } writeDeclaration(className,&outputFile); } } if (mWriteDirectEquivalences) { QStringList incClassNameList; for (CBOXSET::const_iterator it = activeClassConceptSet->constBegin(), itEnd = activeClassConceptSet->constEnd(); it != itEnd; ++it) { CConcept* concept(*it); QString className = CIRIName::getRecentIRIName(concept->getClassNameLinker()); if (mUseAbbreviatedIRIs) { className = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(concept->getClassNameLinker()); } incClassNameList.append(className); } writeEquivalenceRelations(incClassNameList,&outputFile); } else { for (CBOXSET::const_iterator it1 = activeClassConceptSet->constBegin(), it1End = activeClassConceptSet->constEnd(); it1 != it1End; ++it1) { CConcept* concept1(*it1); if (concept1 != mBottomConcept) { for (CBOXSET::const_iterator it2 = activeClassConceptSet->constBegin(), it2End = activeClassConceptSet->constEnd(); it2 != it1End; ++it2) { CConcept* concept2(*it2); if (concept1 != concept2 && concept2 != mTopConcept) { QString className1 = CIRIName::getRecentIRIName(concept1->getClassNameLinker()); QString className2 = CIRIName::getRecentIRIName(concept2->getClassNameLinker()); if (mUseAbbreviatedIRIs) { className1 = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(concept1->getClassNameLinker()); className2 = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(concept2->getClassNameLinker()); } writeSubClassRelation(className1,className2,&outputFile); } } } } } } writeOntologyEnd(&outputFile); outputFile.close(); return true; } return false; } CQueryResult *CWriteFunctionalClassSubsumptionsHierarchyQuery::constructResult(CTaxonomy *taxonomy) { mQueryAnswered = true; if (!writeSubClassHierarchyResult(taxonomy)) { addQueryError(new CQueryUnspecifiedStringError(QString("Could not write class hierarchy to file '%1'.").arg(mOutputFileNameString))); } return nullptr; } bool CWriteFunctionalClassSubsumptionsHierarchyQuery::writeSubClassHierarchyResult(CTaxonomy *taxonomy) { forcedPathCreated(mOutputFileNameString); QFile outputFile(mOutputFileNameString); if (outputFile.open(QIODevice::WriteOnly)) { writeOntologyStart(&outputFile); CHierarchyNode* topNode = taxonomy->getTopHierarchyNode(); CHierarchyNode* bottomNode = taxonomy->getBottomHierarchyNode(); CHierarchyNode* basicNode = topNode; if (!mClassName.isEmpty()) { basicNode = taxonomy->getHierarchyNode(ontology->getConcept(mClassName)); } writeDeclarations(bottomNode,&outputFile); writeBottomEquivalences(bottomNode,&outputFile); QSet processNodeSet; processNodeSet.insert(bottomNode); if (basicNode) { QList processNodeList; writeDeclarations(basicNode,&outputFile); writeTopEquivalences(basicNode,&outputFile); processNodeSet.insert(basicNode); processNodeList.append(basicNode); while (!processNodeList.isEmpty()) { CHierarchyNode *procNode = processNodeList.takeFirst(); QSet* childNodeSet(procNode->getChildNodeSet()); foreach (CHierarchyNode *childNode, *childNodeSet) { if (childNode != bottomNode) { if (!processNodeSet.contains(childNode)) { writeEquivalences(childNode,&outputFile); writeDeclarations(childNode,&outputFile); processNodeSet.insert(childNode); processNodeList.append(childNode); } writeSubClassRelations(procNode,childNode,&outputFile); } } } } writeOntologyEnd(&outputFile); outputFile.close(); return true; } return false; } void CWriteFunctionalClassSubsumptionsHierarchyQuery::writeBottomEquivalences(CHierarchyNode* node, QFile* outputFile) { if (node->getEquivalentConceptCount() > 1) { if (mWriteDirectEquivalences) { writeEquivalenceRelations(node,outputFile); } else { if (mWriteSimpleBottomImplications) { const QStringList& classNameList(node->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); foreach (const QString& className1, classNameList) { if (className1 != mBottomClassNameString) { writeSubClassRelation(className1,mBottomClassNameString,outputFile); } } } else { const QStringList& classNameList(node->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); foreach (const QString& className1, classNameList) { foreach (const QString& className2, classNameList) { if (className1 != className2 && className1 != mBottomClassNameString) { writeSubClassRelation(className1,className2,outputFile); } } } } } } } void CWriteFunctionalClassSubsumptionsHierarchyQuery::writeTopEquivalences(CHierarchyNode* node, QFile* outputFile) { if (node->getEquivalentConceptCount() > 1) { if (mWriteDirectEquivalences) { writeEquivalenceRelations(node,outputFile); } else { if (mWriteSimpleTopImplications) { const QStringList& classNameList(node->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); foreach (const QString& className1, classNameList) { if (className1 != mTopClassNameString) { writeSubClassRelation(mTopClassNameString,className1,outputFile); } } } else { const QStringList& classNameList(node->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); foreach (const QString& className1, classNameList) { foreach (const QString& className2, classNameList) { if (className1 != className2 && className2 != mTopClassNameString) { writeSubClassRelation(className1,className2,outputFile); } } } } } } } void CWriteFunctionalClassSubsumptionsHierarchyQuery::writeEquivalenceRelations(const QStringList& classNameList, QFile* outputFile) { QString outputClassNameList; foreach (const QString& className, classNameList) { if (!outputClassNameList.isEmpty()) { outputClassNameList += QString(" "); } outputClassNameList += QString("<%1>").arg(className); } QString writeString = QString("EquivalentClasses(%1)\n").arg(outputClassNameList); outputFile->write(writeString.toUtf8()); } void CWriteFunctionalClassSubsumptionsHierarchyQuery::writeEquivalenceRelations(CHierarchyNode* node, QFile* outputFile) { const QStringList& classNameList(node->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); writeEquivalenceRelations(classNameList,outputFile); } void CWriteFunctionalClassSubsumptionsHierarchyQuery::writeEquivalences(CHierarchyNode* node, QFile* outputFile) { if (node->getEquivalentConceptCount() > 1) { if (mWriteDirectEquivalences) { writeEquivalenceRelations(node,outputFile); } else { const QStringList& classNameList(node->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); foreach (const QString& className1, classNameList) { foreach (const QString& className2, classNameList) { if (className1 != className2) { writeSubClassRelation(className1,className2,outputFile); } } } } } } void CWriteFunctionalClassSubsumptionsHierarchyQuery::writeDeclarations(CHierarchyNode* node, QFile* outputFile) { if (mWriteDeclarations) { const QStringList& classNameList(node->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); foreach (const QString& className, classNameList) { writeDeclaration(className,outputFile); } } } void CWriteFunctionalClassSubsumptionsHierarchyQuery::writeDeclaration(const QString& className, QFile* outputFile) { QString writeString = QString("Declaration(Class(<%1>))\n").arg(className); outputFile->write(writeString.toUtf8()); } void CWriteFunctionalClassSubsumptionsHierarchyQuery::writeOntologyStart(QFile* outputFile) { outputFile->write(QString("Prefix(:=)\n").toUtf8()); outputFile->write(QString("Prefix(owl:=)\n").toUtf8()); outputFile->write(QString("Prefix(rdf:=)\n").toUtf8()); outputFile->write(QString("Prefix(xml:=)\n").toUtf8()); outputFile->write(QString("Prefix(xsd:=)\n").toUtf8()); outputFile->write(QString("Prefix(rdfs:=)\n").toUtf8()); outputFile->write(QString("\nOntology(\n").toUtf8()); } void CWriteFunctionalClassSubsumptionsHierarchyQuery::writeOntologyEnd(QFile* outputFile) { outputFile->write(QString(")").toUtf8()); } void CWriteFunctionalClassSubsumptionsHierarchyQuery::writeSubClassRelations(CHierarchyNode* superNode, CHierarchyNode* subNode, QFile* outputFile) { const QStringList& superClassNameList(superNode->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); const QStringList& subClassNameList(subNode->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); foreach (const QString& subClassName, subClassNameList) { foreach (const QString& superClassName, superClassNameList) { writeSubClassRelation(subClassName,superClassName,outputFile); } } } void CWriteFunctionalClassSubsumptionsHierarchyQuery::writeSubClassRelation(const QString& subClassName, const QString& superClassName, QFile* outputFile) { QString writeString = QString("SubClassOf(<%1> <%2>)\n").arg(subClassName,superClassName); outputFile->write(writeString.toUtf8()); } QString CWriteFunctionalClassSubsumptionsHierarchyQuery::getQueryName() { return mQueryName; } QString CWriteFunctionalClassSubsumptionsHierarchyQuery::getQueryString() { return mQueryString; } bool CWriteFunctionalClassSubsumptionsHierarchyQuery::hasAnswer() { return mQueryAnswered; } QString CWriteFunctionalClassSubsumptionsHierarchyQuery::getAnswerString() { return QString("Subclass Hierarchy written to file '%1'").arg(mOutputFileNameString); } bool CWriteFunctionalClassSubsumptionsHierarchyQuery::hasError() { return mTaxCalcError || mQueryConstructError || CQuery::hasError(); } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CCalculationJob.cpp0000644000175000017500000000244412520551232024646 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationJob.h" namespace Konclude { namespace Reasoner { namespace Query { CCalculationJob::CCalculationJob() { mOnto = nullptr; } CCalculationJob::~CCalculationJob() { } CConcreteOntology* CCalculationJob::getOntology() { return mOnto; } CCalculationJob* CCalculationJob::setOntology(CConcreteOntology* ontology) { mOnto = ontology; return this; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CFlattenedObjectPropertyTargetsQuery.h0000644000175000017500000000577212520551234030615 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CFLATTENEDOBJECTPROPERTYTARGETSQUERY_H #define KONCLUDE_REASONER_QUERY_CFLATTENEDOBJECTPROPERTYTARGETSQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CIndividualsResult.h" #include "CRealizationPremisingQuery.h" #include "CIndividualsResultVisitorGenerator.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CFlattenedObjectPropertyTargetsQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CFlattenedObjectPropertyTargetsQuery : public CRealizationPremisingQuery { // public methods public: //! Constructor CFlattenedObjectPropertyTargetsQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CIndividual* individual, CRole* role, const QString& objectPropertyTargetQueryName = QString("UnnamedObjectPropertyTargetsQuery")); //! Destructor virtual ~CFlattenedObjectPropertyTargetsQuery(); virtual CQueryResult* constructResult(CRealization* realization); virtual CIndividualsResult* constructIndividualsResult(CRealization* realization); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual bool hasError(); CIndividual* getIndividual(); CRole* getRole(); // protected methods protected: // protected variables protected: QString mIndividualName; QString mRoleName; CIndividual* mIndividual; CRole* mRole; QString queryName; QString queryString; CIndividualsResult* mResult; bool mUseAbbreviatedIRIs; bool mQueryConstructError; bool mRealizationCalcError; CConfigurationBase* mCalcConfig; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CFLATTENEDOBJECTPROPERTYTARGETSQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CTypesQuery.cpp0000644000175000017500000000634612520551244024117 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTypesQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CTypesQuery::CTypesQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CIndividual* indi, bool direct, const QString& individualName, const QString& flatternedTypeQueryName) : CRealizationPremisingQuery(ontology,configuration) { mIndividualName = individualName; mIndividual = indi; queryName = flatternedTypeQueryName; if (mIndividualName.isEmpty()) { queryString = QString("Get Types"); } else { queryString = QString("Get Types for individual '%1'").arg(mIndividualName); } mResult = nullptr; mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.OWLlink.AbbreviatedIRIs",false); mRealizationCalcError = false; mQueryConstructError = false; mDirect = direct; mRequiresConceptRealisation = true; mRequiresSameIndividualRealisation = true; mCalcConfig = configuration; } CTypesQuery::~CTypesQuery() { if (mResult) { delete mResult; } delete mCalcConfig; } CQueryResult* CTypesQuery::getQueryResult() { return mResult; } CQueryResult *CTypesQuery::constructResult(CRealization* realization) { return constructClassSynsetsResult(realization); } CClassSynsetsResult *CTypesQuery::constructClassSynsetsResult(CRealization* realization) { if (mResult) { delete mResult; mResult = 0; } if (realization) { CConceptRealization* conRealization = realization->getConceptRealization(); if (conRealization) { mResult = new CClassSynsetsResult(); CClassSynsetsResultVisitorGenerator resultGenerator(mResult,mUseAbbreviatedIRIs); conRealization->visitTypes(mIndividual,mDirect,&resultGenerator); } } return mResult; } QString CTypesQuery::getQueryName() { return queryName; } QString CTypesQuery::getQueryString() { return queryString; } bool CTypesQuery::hasAnswer() { return mResult != 0; } QString CTypesQuery::getAnswerString() { if (!mResult) { return QString("Unknown Types"); } else { return mResult->getQueryResultString(); } } bool CTypesQuery::hasError() { return mRealizationCalcError || mQueryConstructError || CQuery::hasError(); } bool CTypesQuery::isDirect() { return mDirect; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassifyQuery.cpp0000644000175000017500000000432112520551232024554 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassifyQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CClassifyQuery::CClassifyQuery(CConcreteOntology *premisingTaxonomyOntology, CConfigurationBase *configuration, const QString &subClassHierarchyQueryName) : CTaxonomyPremisingQuery(premisingTaxonomyOntology,configuration) { queryName = subClassHierarchyQueryName; queryString = QString("Classify Knowledgebase"); mTaxCalcError = false; mQueryConstructError = false; mResult = nullptr; } CClassifyQuery::~CClassifyQuery() { delete mResult; } CQueryResult *CClassifyQuery::getQueryResult() { return mResult; } CQueryResult *CClassifyQuery::constructResult(CTaxonomy *taxonomy) { if (taxonomy) { mResult = new CSucceedQueryResult(); } return mResult; } QString CClassifyQuery::getQueryName() { return queryName; } QString CClassifyQuery::getQueryString() { return queryString; } bool CClassifyQuery::hasAnswer() { return mResult != nullptr; } QString CClassifyQuery::getAnswerString() { if (mResult) { return QString("Knowledgebase classified"); } else { return QString("Knowledgebase not classified"); } } bool CClassifyQuery::hasError() { return mTaxCalcError || mQueryConstructError || CQuery::hasError(); } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryInconsitentOntologyError.h0000644000175000017500000000434212520551240027510 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CQUERYINCONSITENTONTOLOGYERROR_H #define KONCLUDE_REASONER_QUERY_CQUERYINCONSITENTONTOLOGYERROR_H // Libraries includes // Namespace includes #include "QuerySettings.h" #include "CQueryError.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Query { /*! * * \class CQueryInconsitentOntologyError * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQueryInconsitentOntologyError : public CQueryError { // public methods public: //! Constructor CQueryInconsitentOntologyError(CConcreteOntology* onto); virtual QString getErrorString(); static bool hasInconsistentOntologyError(CQueryError* queryErrorLinker); static CQueryInconsitentOntologyError* getInconsistentOntologyError(CQueryError* queryErrorLinker); // protected methods protected: // protected variables protected: CConcreteOntology* mOnto; QString mOntologyString; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CQUERYINCONSITENTONTOLOGYERROR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CCalculationJob.h0000644000175000017500000000411012520551232024303 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CCALCULATIONJOB_H #define KONCLUDE_REASONER_QUERY_CCALCULATIONJOB_H // Libraries includes // Namespace includes #include "QuerySettings.h" #include "CCalculationJobQueryData.h" // Other includes #include "Concurrent/Callback/CCallbackData.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; namespace Query { /*! * * \class CCalculationJob * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationJob { // public methods public: //! Constructor CCalculationJob(); //! Destructor virtual ~CCalculationJob(); virtual CCalculationJobQueryData* getQueryData() = 0; CConcreteOntology* getOntology(); CCalculationJob* setOntology(CConcreteOntology* ontology); // protected methods protected: // protected variables protected: CConcreteOntology* mOnto; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CCALCULATIONJOB_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSaturationCalculationConstruct.cpp0000644000175000017500000000466612520551242030203 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationCalculationConstruct.h" namespace Konclude { namespace Reasoner { namespace Query { CSaturationCalculationConstruct::CSaturationCalculationConstruct() : CLinkerBase(this) { mIndividual = nullptr; mConstructConcept = nullptr; mIndiID = -1; mConstructConceptNegation = false; } CSaturationCalculationConstruct* CSaturationCalculationConstruct::getNextConstruct() { return getNext(); } CConcept* CSaturationCalculationConstruct::getConstructConcept() { return mConstructConcept; } CSaturationCalculationConstruct* CSaturationCalculationConstruct::setConstructConcept(CConcept* concept) { mConstructConcept = concept; return this; } bool CSaturationCalculationConstruct::getConstructConceptNegation() { return mConstructConceptNegation; } CSaturationCalculationConstruct* CSaturationCalculationConstruct::setConstructConceptNegation(bool negation) { mConstructConceptNegation = negation; return this; } CSaturationCalculationConstruct* CSaturationCalculationConstruct::setIndividual(CIndividual* individual) { mIndividual = individual; return this; } CIndividual* CSaturationCalculationConstruct::getIndividual() { return mIndividual; } CSaturationCalculationConstruct* CSaturationCalculationConstruct::setIndividualID(cint64 individualID) { mIndiID = individualID; return this; } cint64 CSaturationCalculationConstruct::getIndividualID() { return mIndiID; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassAssertionQuery.h0000644000175000017500000000610212520551232025400 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CCLASSASSERTIONQUERY_H #define KONCLUDE_REASONER_QUERY_CCLASSASSERTIONQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CIndividualClassAssertionsResult.h" #include "CConsistencePremisingQuery.h" // Other includes #include "Config/CConfigDataReader.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/CIndividualProcessNodeVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Kernel::Process; namespace Query { /*! * * \class CClassAssertionQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassAssertionQuery : public CConsistencePremisingQuery { // public methods public: //! Constructor CClassAssertionQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QSet& individualSet, const QString& queryName = QString("UnnamedConceptAssertionsQuery")); //! Destructor virtual ~CClassAssertionQuery(); virtual CQueryResult *constructResult(CConsistence* consistence); virtual CIndividualClassAssertionsResult* constructAssertionResult(CConsistence* consistence); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual bool hasError(); // protected methods protected: virtual bool addIndividualResultData(cint64 indiID, CIndividualProcessNodeVector* indiNodeVec); // protected variables protected: QString mQueryName; QString mQueryString; CIndividualClassAssertionsResult* mResult; bool mUseAbbreviatedIRIs; bool mQueryConstructError; bool mConsistencyCalcError; CConfigurationBase* mCalcConfig; bool mDeterministicAssertions; bool mNondeterministicAssertions; QSet mIndividualSet; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CCLASSASSERTIONQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CDeterministicIndividualsQuery.h0000644000175000017500000000412712520551234027451 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CDETERMINISTICINDIVIDUALSQUERY_H #define KONCLUDE_REASONER_QUERY_CDETERMINISTICINDIVIDUALSQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CDeterministicNondeterministicIndividualsQuery.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CDeterministicIndividualsQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDeterministicIndividualsQuery : public CDeterministicNondeterministicIndividualsQuery { // public methods public: //! Constructor CDeterministicIndividualsQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QSet& individualSet, const QString& queryName = QString("UnnamedDeterministicIndividualsQuery")); //! Destructor virtual ~CDeterministicIndividualsQuery(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CDETERMINISTICINDIVIDUALSQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CRealizeQuery.cpp0000644000175000017500000000527412520551242024403 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizeQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CRealizeQuery::CRealizeQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QString& queryName) : CRealizationPremisingQuery(ontology,configuration) { mQueryName = queryName; queryString = QString("Realize Knowledgebase"); mRealizationCalcError = false; mQueryConstructError = false; mRequiresConceptRealisation = CConfigDataReader::readConfigBoolean(configuration,"Konclude.Calculation.Realization.RealizePrecomputation.ConceptInstances",true); mRequiresSameIndividualRealisation = CConfigDataReader::readConfigBoolean(configuration,"Konclude.Calculation.Realization.RealizePrecomputation.SameIndividuals",true); mRequiresRoleRealisation = CConfigDataReader::readConfigBoolean(configuration,"Konclude.Calculation.Realization.RealizePrecomputation.RoleInstances",false); mResult = nullptr; } CRealizeQuery::~CRealizeQuery() { delete mResult; } CQueryResult* CRealizeQuery::getQueryResult() { return mResult; } CQueryResult *CRealizeQuery::constructResult(CRealization* realization) { if (realization) { mResult = new CSucceedQueryResult(); } else { mQueryConstructError = true; } return mResult; } QString CRealizeQuery::getQueryName() { return mQueryName; } QString CRealizeQuery::getQueryString() { return queryString; } bool CRealizeQuery::hasAnswer() { return mResult != nullptr; } QString CRealizeQuery::getAnswerString() { if (mResult) { return QString("Knowledgebase realized"); } else { return QString("Knowledgebase not realized"); } } bool CRealizeQuery::hasError() { return mRealizationCalcError || mQueryConstructError || CQuery::hasError(); } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryStatistics.cpp0000644000175000017500000000211012520551240025122 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryStatistics.h" namespace Konclude { namespace Reasoner { namespace Query { CQueryStatistics::CQueryStatistics() { } CQueryStatistics::~CQueryStatistics() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CWriteOWLXMLClassSubsumptionsHierarchyQuery.h0000644000175000017500000001046712520551244031775 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CWriteOWLXMLClassSubsumptionsHierarchyQuery_H #define KONCLUDE_REASONER_QUERY_CWriteOWLXMLClassSubsumptionsHierarchyQuery_H // Libraries includes #include #include #include #include // Namespace includes #include "CQuery.h" #include "CTaxonomyPremisingQuery.h" #include "CQueryUnspecifiedStringError.h" #include "CQueryInconsitentOntologyError.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CWriteOWLXMLClassSubsumptionsHierarchyQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteOWLXMLClassSubsumptionsHierarchyQuery : public CTaxonomyPremisingQuery { // public methods public: //! Constructor CWriteOWLXMLClassSubsumptionsHierarchyQuery(CConcreteOntology *premisingTaxonomyOntology, CConfigurationBase *configuration, const QString& outputFileString, const QString &superClassName = QString(""), const QString &subClassHierarchyQueryName = QString("UnnamedWriteClassHierarchyQuery")); virtual CQueryResult *constructResult(CTaxonomy *taxonomy); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult *getQueryResult(); virtual bool hasError(); virtual CQuery* addQueryError(CQueryError* queryError); // protected methods protected: void forcedPathCreated(const QString& filePath); bool writeInconsistentHierarchyResult(); bool writeSubClassHierarchyResult(CTaxonomy *taxonomy); void writeDeclarations(CHierarchyNode* node, QXmlStreamWriter* outputStreamWriter); void writeEquivalences(CHierarchyNode* node, QXmlStreamWriter* outputStreamWriter); void writeBottomEquivalences(CHierarchyNode* node, QXmlStreamWriter* outputStreamWriter); void writeTopEquivalences(CHierarchyNode* node, QXmlStreamWriter* outputStreamWriter); void writeDeclaration(const QString& className, QXmlStreamWriter* outputStreamWriter); void writeSubClassRelations(CHierarchyNode* superNode, CHierarchyNode* subNode, QXmlStreamWriter* outputStreamWriter); void writeSubClassRelation(const QString& subClassName, const QString& superClassName, QXmlStreamWriter* outputStreamWriter); void writeEquivalenceRelations(CHierarchyNode* node, QXmlStreamWriter* outputStreamWriter); void writeEquivalenceRelations(const QStringList& classNameList, QXmlStreamWriter* outputStreamWriter); void writeOntologyStart(QXmlStreamWriter* outputStreamWriter); void writeOntologyEnd(QXmlStreamWriter* outputStreamWriter); void writeOntologyPrefix(QXmlStreamWriter* outputStreamWriter, const QString& prefixName, const QString& prefixIRI); // protected variables protected: QString mClassName; QString mQueryName; QString mQueryString; QString mOutputFileNameString; QString mBottomClassNameString; QString mTopClassNameString; bool mUseAbbreviatedIRIs; bool mWriteDeclarations; bool mQueryAnswered; bool mQueryConstructError; bool mTaxCalcError; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CWriteOWLXMLClassSubsumptionsHierarchyQuery_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassSynsetResult.cpp0000644000175000017500000001036612520551232025431 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassSynsetResult.h" namespace Konclude { namespace Reasoner { namespace Query { CClassSynsetResult::CClassSynsetResult() { } CClassSynsetResult::CClassSynsetResult(const QString &className) { addEquivalentClassName(className); } CClassSynsetResult::CClassSynsetResult(const QStringList &classNameList) { addEquivalentClassNames(classNameList); } CClassSynsetResult::~CClassSynsetResult() { } QStringList CClassSynsetResult::getEquivalentClassNameList() { return eqClassNameList; } CClassSynsetResult *CClassSynsetResult::addEquivalentClassName(const QString &className) { eqClassNameList.append(className); return this; } CClassSynsetResult *CClassSynsetResult::addEquivalentClassNames(const QStringList &classNameList) { eqClassNameList += classNameList; return this; } qint64 CClassSynsetResult::getClassCount() { return eqClassNameList.count(); } bool CClassSynsetResult::hasClassName(const QString &className) { return eqClassNameList.contains(className); } bool CClassSynsetResult::hasClassNames(const QStringList &classNameList) { if (eqClassNameList.size() <= 1) { return eqClassNameList.first() == classNameList.first(); } else if (eqClassNameList.size() <= 20) { QStringList remEqClassNameList(eqClassNameList); foreach (const QString& className, classNameList) { bool contained = false; for (qint64 cnt = remEqClassNameList.count(); cnt > 0; --cnt) { contained |= remEqClassNameList.first() == className; if (contained) { remEqClassNameList.takeFirst(); break; } else { remEqClassNameList.append(remEqClassNameList.takeFirst()); } } if (!contained) { return false; } } } else { QHash classNameCountHash; foreach (const QString& className, classNameList) { if (classNameCountHash.contains(className)) { ++classNameCountHash[className]; } else { classNameCountHash[className] = 1; } } foreach (const QString& className, eqClassNameList) { if (!classNameCountHash.contains(className)) { return false; } else { --classNameCountHash[className]; } } for (QHash::const_iterator it = classNameCountHash.constBegin(), itEnd = classNameCountHash.constEnd(); it != itEnd; ++it) { cint64 diff(it.value()); if (diff != 0) { return false; } } } return true; } QString CClassSynsetResult::getQueryResultString() { QString classNames = eqClassNameList.join(", "); if (eqClassNameList.count() > 1) { return QString("Equivalent Class Set '%1'").arg(classNames); } else if (eqClassNameList.count() > 0) { return QString("Class '%1'").arg(classNames); } else { return QString("Empty Class Set"); } } bool CClassSynsetResult::isResultEquivalentTo(CQueryResult *otherQueryResult) { if (!otherQueryResult) { return false; } CClassSynsetResult *otherClassSynset = dynamic_cast(otherQueryResult); if (!otherClassSynset) { return false; } if (getClassCount() != otherClassSynset->getClassCount()) { return false; } if (!hasClassNames(otherClassSynset->getEquivalentClassNameList())) { return false; } return true; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSatisfiableCalculationJob.h0000644000175000017500000001363512520551242026467 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONJOB_H #define KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONJOB_H // Libraries includes // Namespace includes #include "QuerySettings.h" #include "CCalculationJob.h" #include "CSatisfiableCalculationConstruct.h" // Other includes #include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h" #include "Reasoner/Kernel/Task/CCalculationStatisticsCollector.h" #include "Reasoner/Kernel/Task/CTaskPreyingAdapter.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationJobInstantiation.h" #include "Reasoner/Kernel/Task/CSatisfiableTaskClassificationMessageAdapter.h" #include "Reasoner/Kernel/Task/CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter.h" #include "Reasoner/Kernel/Task/CSatisfiableTaskIncrementalConsistencyTestingAdapter.h" #include "Reasoner/Kernel/Task/CSatisfiableTaskIndividualDependenceTrackingAdapter.h" #include "Reasoner/Kernel/Task/CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; namespace Query { /*! * * \class CSatisfiableCalculationJob * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCalculationJob : public CCalculationJob { // public methods public: //! Constructor CSatisfiableCalculationJob(); //! Destructor virtual ~CSatisfiableCalculationJob(); virtual CCalculationJobQueryData* getQueryData(); CSatisfiableCalculationJob* setQueryData(CCalculationJobQueryData* takeQueryData); CSatisfiableCalculationJob* addSatisfiableCalculationConstruct(CSatisfiableCalculationConstruct* takeSatCalcConstruct); CSatisfiableCalculationConstruct* getSatisfiableCalculationConstructs(); virtual CConfigurationBase* getConfiguration(); CSatisfiableCalculationJob* setCalculationConfiguration(CCalculationConfigurationExtension* calculationConfiguration); CCalculationConfigurationExtension* getCalculationConfiguration(); CSatisfiableCalculationJob* setCalclulationStatisticsCollector(CCalculationStatisticsCollector* calclulationStatisticsCollector); CCalculationStatisticsCollector* getCalclulationStatisticsCollector(); CSatisfiableCalculationJob* setSatisfiableTaskPreyingAdapter(CTaskPreyingAdapter* preyingAdapter); CTaskPreyingAdapter* getSatisfiableTaskPreyingAdapter(); CSatisfiableCalculationJob* setSatisfiableClassificationMessageAdapter(CSatisfiableTaskClassificationMessageAdapter* classMessObserver); CSatisfiableTaskClassificationMessageAdapter* getSatisfiableClassificationMessageAdapter(); CSatisfiableCalculationJobInstantiation* getConsecutivelyCalculationJobInstantiation(); CSatisfiableCalculationJob* setConsecutivelyCalculationJobInstantiation(CSatisfiableCalculationJobInstantiation* jobInstantiation); CSatisfiableCalculationJob* setSatisfiableTaskIncrementalConsistencyTestingAdapter(CSatisfiableTaskIncrementalConsistencyTestingAdapter* incConsTestAdaptor); CSatisfiableTaskIncrementalConsistencyTestingAdapter* getSatisfiableTaskIncrementalConsistencyTestingAdapter(); CSatisfiableCalculationJob* setRealizationMarkedCandidatesMessageAdapter(CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter* realMessObserver); CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter* getRealizationMarkedCandidatesMessageAdapter(); CSatisfiableCalculationJob* setSatisfiableTaskIndividualDependenceTrackingAdapter(CSatisfiableTaskIndividualDependenceTrackingAdapter* indDepTrackAdaptor); CSatisfiableTaskIndividualDependenceTrackingAdapter* getSatisfiableTaskIndividualDependenceTrackingAdapter(); CSatisfiableCalculationJob* setPossibleAssertionCollectionAdapter(CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter* possAssCollAdapter); CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter* getPossibleAssertionCollectionAdapter(); cint64 getNextRelativeNodeID(bool moveNext = true); // protected methods protected: // protected variables protected: CCalculationJobQueryData* mQueryData; cint64 mNextRelativeNodeID; CSatisfiableCalculationConstruct* mSatCalcConstructLinker; CCalculationConfigurationExtension* mCalculationConfiguration; CCalculationStatisticsCollector* mCalclulationStatisticsCollector; CTaskPreyingAdapter* mPreyingAdapter; CSatisfiableCalculationJobInstantiation* mJobInstantiation; CSatisfiableTaskClassificationMessageAdapter* mSatClassMessAdapter; CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter* mRealMarkCandMessAdapter; CSatisfiableTaskIncrementalConsistencyTestingAdapter* mSatIncConsTestingAdapter; CSatisfiableTaskIndividualDependenceTrackingAdapter* mSatIndDepTrackAdapter; CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter* mPossAssCollAdapter; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONJOB_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CObjectPropertyTargetsQuery.cpp0000644000175000017500000000717212520551240027312 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectPropertyTargetsQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CObjectPropertyTargetsQuery::CObjectPropertyTargetsQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CIndividual* individual, CRole* role, const QString& objectPropertyTargetQueryName) : CRealizationPremisingQuery(ontology,configuration) { mIndividual = individual; mRole = role; mIndividualName = CIRIName::getRecentIRIName(individual->getIndividualNameLinker()); mRoleName = CIRIName::getRecentIRIName(role->getPropertyNameLinker()); queryName = objectPropertyTargetQueryName; if (queryName.isEmpty()) { if (!mIndividualName.isEmpty() && !mRoleName.isEmpty()) { queryString = QString("Get Object Property Targets"); } else { queryString = QString("Get Object Property Targets for Individual '%1'").arg(mIndividualName); } } mResult = nullptr; mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.OWLlink.AbbreviatedIRIs",false); mRealizationCalcError = false; mQueryConstructError = false; mRequiresRoleRealisation = true; mRequiresSameIndividualRealisation = true; mCalcConfig = configuration; } CObjectPropertyTargetsQuery::~CObjectPropertyTargetsQuery() { if (mResult) { delete mResult; } delete mCalcConfig; } CQueryResult* CObjectPropertyTargetsQuery::getQueryResult() { return mResult; } CQueryResult *CObjectPropertyTargetsQuery::constructResult(CRealization* realization) { return constructIndividualSynsetsResult(realization); } CIndividualSynsetsResult *CObjectPropertyTargetsQuery::constructIndividualSynsetsResult(CRealization* realization) { if (mResult) { delete mResult; mResult = 0; } if (realization) { CRoleRealization* roleRealization = realization->getRoleRealization(); if (roleRealization) { mResult = new CIndividualSynsetsResult(); CIndividualSynsetsResultVisitorGenerator resultGenerator(mResult,mUseAbbreviatedIRIs); roleRealization->visitTargetIndividuals(mIndividual,mRole,&resultGenerator); } } return mResult; } QString CObjectPropertyTargetsQuery::getQueryName() { return queryName; } QString CObjectPropertyTargetsQuery::getQueryString() { return queryString; } bool CObjectPropertyTargetsQuery::hasAnswer() { return mResult != 0; } QString CObjectPropertyTargetsQuery::getAnswerString() { if (!mResult) { return QString("Unknown Individuals"); } else { return mResult->getQueryResultString(); } } bool CObjectPropertyTargetsQuery::hasError() { return mRealizationCalcError || mQueryConstructError || CQuery::hasError(); } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassSynsetResult.h0000644000175000017500000000453212520551232025074 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CCLASSSYNSETRESULT_H #define KONCLUDE_REASONER_QUERY_CCLASSSYNSETRESULT_H // Libraries includes #include // Namespace includes #include "CQueryResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CClassSynsetResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassSynsetResult : public CQueryResult { // public methods public: //! Constructor CClassSynsetResult(); CClassSynsetResult(const QString &className); CClassSynsetResult(const QStringList &classNameList); //! Destructor virtual ~CClassSynsetResult(); QStringList getEquivalentClassNameList(); CClassSynsetResult *addEquivalentClassName(const QString &className); CClassSynsetResult *addEquivalentClassNames(const QStringList &classNameList); bool hasClassName(const QString &className); bool hasClassNames(const QStringList &classNameList); qint64 getClassCount(); virtual QString getQueryResultString(); virtual bool isResultEquivalentTo(CQueryResult *otherQueryResult); // protected methods protected: // protected variables protected: QStringList eqClassNameList; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CCLASSSYNSETRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryCalculationStatisticsCollection.cpp0000644000175000017500000000400112520551240031316 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryCalculationStatisticsCollection.h" namespace Konclude { namespace Reasoner { namespace Query { CQueryCalculationStatisticsCollection::CQueryCalculationStatisticsCollection() : CLinkerBase(this) { } CQueryCalculationStatisticsCollection::~CQueryCalculationStatisticsCollection() { } bool CQueryCalculationStatisticsCollection::addProcessingStatistics(const QString& statName, cint64 statValue) { cint64 prevValue = mStatNameStringsValueHash.value(statName,0); mStatNameStringsValueHash.insert(statName,statValue+prevValue); return true; } CQueryCalculationStatisticsCollection* CQueryCalculationStatisticsCollection::appendStatisticsStringNames(QSet* statNamesSet) { if (statNamesSet) { foreach (const QString& statName, mStatNameStringsValueHash.keys()) { statNamesSet->insert(statName); } } return this; } cint64 CQueryCalculationStatisticsCollection::getStatisticIntegerValue(const QString& statName) { return mStatNameStringsValueHash.value(statName,0); } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassSubClassesRelationResult.cpp0000644000175000017500000001040612520551232027704 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassSubClassesRelationResult.h" namespace Konclude { namespace Reasoner { namespace Query { CClassSubClassesRelationResult::CClassSubClassesRelationResult() { superClass = 0; } CClassSubClassesRelationResult::CClassSubClassesRelationResult(CClassSynsetResult *superClassSynset) { superClass = superClassSynset; } CClassSubClassesRelationResult::~CClassSubClassesRelationResult() { } CClassSynsetResult *CClassSubClassesRelationResult::getSuperClassSynset() { return superClass; } CClassSubClassesRelationResult *CClassSubClassesRelationResult::setSuperClassSynset(CClassSynsetResult *superClassSynset) { superClass = superClassSynset; return this; } QSet* CClassSubClassesRelationResult::getSubClassesSynsetSet() { return &subClassSynsetSet; } QList CClassSubClassesRelationResult::getSubClassesSynsetList() { return subClassSynsetSet.toList(); } CClassSubClassesRelationResult *CClassSubClassesRelationResult::addSubClassesSynset(CClassSynsetResult *subClassSynset) { subClassSynsetSet.insert(subClassSynset); return this; } CClassSubClassesRelationResult *CClassSubClassesRelationResult::addSubClassesSynsets(const QList &subClassesSynsets) { foreach (CClassSynsetResult* classSynRes, subClassesSynsets) { subClassSynsetSet.insert(classSynRes); } return this; } qint64 CClassSubClassesRelationResult::getSubClassesSynsetCount() { return subClassSynsetSet.count(); } bool CClassSubClassesRelationResult::hasSubClassesSynset(CClassSynsetResult *subClassSynset) { return subClassSynsetSet.contains(subClassSynset); } QString CClassSubClassesRelationResult::getQueryResultString() { QString string; if (superClass && getSubClassesSynsetCount() > 0) { string += superClass->getQueryResultString(); } if (!string.isEmpty()) { QString subClassString; foreach (CClassSynsetResult *subClassSynset, subClassSynsetSet) { if (subClassString.isEmpty()) { subClassString += QString(" has Sub-Class-Relation to %1").arg(subClassSynset->getQueryResultString()); } else { subClassString += QString(" and to %1").arg(subClassSynset->getQueryResultString()); } } string += subClassString; } return string; } bool CClassSubClassesRelationResult::isResultEquivalentTo(CQueryResult *otherQueryResult) { if (!otherQueryResult) { return false; } CClassSubClassesRelationResult *otherSubClassRelation = dynamic_cast(otherQueryResult); if (!otherSubClassRelation) { return false; } if (!superClass->isResultEquivalentTo(otherSubClassRelation->getSuperClassSynset())) { return false; } QList otherSubClassList(otherSubClassRelation->getSubClassesSynsetList()); foreach (CClassSynsetResult *classSynset, otherSubClassList) { bool contained = false; for (qint64 cnt = otherSubClassList.count(); cnt > 0; --cnt) { contained |= otherSubClassList.first()->isResultEquivalentTo(classSynset); if (contained) { otherSubClassList.takeFirst(); break; } else { otherSubClassList.append(otherSubClassList.takeFirst()); } } if (!contained) { return false; } } return true; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CApproximatedSaturationCalculationProcessingConstruct.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CApproximatedSaturationCalculationProcessingCon0000644000175000017500000000455212520551230032557 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CApproximatedSaturationCalculationProcessingConstruct.h" namespace Konclude { namespace Reasoner { namespace Query { CApproximatedSaturationCalculationProcessingConstruct::CApproximatedSaturationCalculationProcessingConstruct() : CLinkerBase(this) { mSatConRefLinking = nullptr; mSatIndiRefLinking = nullptr; } CApproximatedSaturationCalculationProcessingConstruct* CApproximatedSaturationCalculationProcessingConstruct::getNextConstruct() { return getNext(); } CSaturationConceptReferenceLinking* CApproximatedSaturationCalculationProcessingConstruct::getSaturationConceptReferenceLinking() { return mSatConRefLinking; } CApproximatedSaturationCalculationProcessingConstruct* CApproximatedSaturationCalculationProcessingConstruct::setSaturationConceptReferenceLinking(CSaturationConceptReferenceLinking* satConRefLinking) { mSatConRefLinking = satConRefLinking; return this; } CSaturationIndividualReferenceLinking* CApproximatedSaturationCalculationProcessingConstruct::getSaturationIndividualReferenceLinking() { return mSatIndiRefLinking; } CApproximatedSaturationCalculationProcessingConstruct* CApproximatedSaturationCalculationProcessingConstruct::setSaturationConceptReferenceLinking(CSaturationIndividualReferenceLinking* satIndiRefLinking) { mSatIndiRefLinking = satIndiRefLinking; return this; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIndividualSynsetsResult.h0000644000175000017500000000470112520551236026304 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CINDIVIDUALSYNSETSRESULT_H #define KONCLUDE_REASONER_QUERY_CINDIVIDUALSYNSETSRESULT_H // Libraries includes #include // Namespace includes #include "CQueryResult.h" #include "CIndividualSynsetResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CIndividualSynsetsResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualSynsetsResult : public CQueryResult { // public methods public: //! Constructor CIndividualSynsetsResult(); //! Destructor virtual ~CIndividualSynsetsResult(); virtual QString getQueryResultString(); virtual bool isResultEquivalentTo(CQueryResult *otherQueryResult); CIndividualSynsetResult* getIndividualSynset(const QString& individualName, bool create = true); CIndividualSynsetResult* getIndividualSynset(const QStringList& individualNames, bool create = true); CIndividualSynsetResult* addIndividualSynset(CIndividualSynsetResult* takeIndividualSynset); QList* getIndividualSynsetList(); // protected methods protected: // protected variables protected: QList mIndividualSynsetContainer; QHash mIndividualIndividualSynsetHash; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CINDIVIDUALSYNSETSRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CInstancesQuery.cpp0000644000175000017500000000646212520551236024742 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CInstancesQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CInstancesQuery::CInstancesQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CConcept* concept, bool direct, const QString& conceptName, const QString& flatternedTypeQueryName) : CRealizationPremisingQuery(ontology,configuration) { mConceptName = conceptName; mConcept = concept; queryName = flatternedTypeQueryName; if (mConceptName.isEmpty()) { queryString = QString("Get Instances"); } else { queryString = QString("Get Instances for Type '%1'").arg(mConceptName); } mResult = nullptr; mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.OWLlink.AbbreviatedIRIs",false); mRealizationCalcError = false; mQueryConstructError = false; mDirect = direct; mCalcConfig = configuration; mRequiresConceptRealisation = true; mRequiresSameIndividualRealisation = true; } CInstancesQuery::~CInstancesQuery() { if (mResult) { delete mResult; } delete mCalcConfig; } CQueryResult* CInstancesQuery::getQueryResult() { return mResult; } CQueryResult *CInstancesQuery::constructResult(CRealization* realization) { return constructIndividualSynsetsResult(realization); } CIndividualSynsetsResult *CInstancesQuery::constructIndividualSynsetsResult(CRealization* realization) { if (mResult) { delete mResult; mResult = 0; } if (realization) { CConceptRealization* conRealization = realization->getConceptRealization(); if (conRealization) { mResult = new CIndividualSynsetsResult(); CIndividualSynsetsResultVisitorGenerator resultGenerator(mResult,mUseAbbreviatedIRIs); conRealization->visitInstances(mConcept,mDirect,&resultGenerator); } } return mResult; } QString CInstancesQuery::getQueryName() { return queryName; } QString CInstancesQuery::getQueryString() { return queryString; } bool CInstancesQuery::hasAnswer() { return mResult != 0; } QString CInstancesQuery::getAnswerString() { if (!mResult) { return QString("Unknown Individuals"); } else { return mResult->getQueryResultString(); } } bool CInstancesQuery::hasError() { return mRealizationCalcError || mQueryConstructError || CQuery::hasError(); } bool CInstancesQuery::isDirect() { return mDirect; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CFlattenedInstancesQuery.h0000644000175000017500000000555412520551234026235 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CFLATTENEDINSTANCESQUERY_H #define KONCLUDE_REASONER_QUERY_CFLATTENEDINSTANCESQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CIndividualsResult.h" #include "CRealizationPremisingQuery.h" #include "CIndividualsResultVisitorGenerator.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CFlattenedInstancesQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CFlattenedInstancesQuery : public CRealizationPremisingQuery { // public methods public: //! Constructor CFlattenedInstancesQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CConcept* concept, bool direct, const QString& conceptName, const QString& flatternedTypeQueryName = QString("UnnamedFlattenedInstancesQuery")); //! Destructor virtual ~CFlattenedInstancesQuery(); virtual CQueryResult* constructResult(CRealization* realization); virtual CIndividualsResult* constructIndividualsResult(CRealization* realization); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual bool hasError(); bool isDirect(); // protected methods protected: // protected variables protected: QString mConceptName; CConcept* mConcept; QString queryName; QString queryString; bool mDirect; CIndividualsResult* mResult; bool mUseAbbreviatedIRIs; bool mQueryConstructError; bool mRealizationCalcError; CConfigurationBase* mCalcConfig; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CFLATTENEDINSTANCESQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassesResultVisitorGenerator.h0000644000175000017500000000431212520551232027441 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CCLASSESRESULTVISITORGENERATOR_H #define KONCLUDE_REASONER_QUERY_CCLASSESRESULTVISITORGENERATOR_H // Libraries includes // Namespace includes #include "CClassesResult.h" // Other includes #include "Reasoner/Realization/CRealization.h" #include "Reasoner/Realization/CConceptRealizationInstantiatedToConceptVisitor.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CAbbreviatedIRIName.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CClassesResultVisitorGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassesResultVisitorGenerator : public CConceptRealizationInstantiatedToConceptVisitor { // public methods public: //! Constructor CClassesResultVisitorGenerator(CClassesResult* classesResult, bool abbreviatedIRIs); virtual bool visitConcept(CConcept* concept, CConceptRealization* conRealization); // protected methods protected: // protected variables protected: CClassesResult* mClassesResult; bool mAbbreviatedIRIs; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CCLASSESRESULTVISITORGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CNondeterministicClassAssertionQuery.h0000644000175000017500000000406512520551240030644 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CNONDETERMINISTICCLASSASSERTIONQUERY_H #define KONCLUDE_REASONER_QUERY_CNONDETERMINISTICCLASSASSERTIONQUERY_H // Libraries includes #include // Namespace includes #include "CClassAssertionQuery.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CNondeterministicClassAssertionQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNondeterministicClassAssertionQuery : public CClassAssertionQuery { // public methods public: //! Constructor CNondeterministicClassAssertionQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QSet& individualSet, const QString& queryName = QString("UnnamedKnownConceptAssertionsQuery")); //! Destructor virtual ~CNondeterministicClassAssertionQuery(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CNONDETERMINISTICCLASSASSERTIONQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CTaxonomyPremisingQuerySupport.h0000644000175000017500000000441012520551244027537 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CTAXONOMYPREMISINGQUERYSUPPORT_H #define KONCLUDE_REASONER_QUERY_CTAXONOMYPREMISINGQUERYSUPPORT_H // Libraries includes // Namespace includes #include "CQuerySupport.h" // Other includes #include "Reasoner/Classifier/CClassificationCalculationSupport.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Classifier; namespace Query { /*! * * \class CTaxonomyPremisingQuerySupport * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaxonomyPremisingQuerySupport : public CQuerySupport { // public methods public: //! Constructor CTaxonomyPremisingQuerySupport(CClassificationCalculationSupport *classificationCalculationSupport = 0); //! Destructor virtual ~CTaxonomyPremisingQuerySupport(); virtual CTaxonomyPremisingQuerySupport *setClassificationCalculationSupport(CClassificationCalculationSupport *classificationCalculationSupport); virtual CClassificationCalculationSupport *getClassificationCalculationSupport(); // protected methods protected: // protected variables protected: CClassificationCalculationSupport *classCalcSupp; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CTAXONOMYPREMISINGQUERYSUPPORT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CJobSatisfiableResult.cpp0000644000175000017500000000213712520551236026040 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CJobSatisfiableResult.h" namespace Konclude { namespace Reasoner { namespace Query { CJobSatisfiableResult::CJobSatisfiableResult() { } CJobSatisfiableResult::~CJobSatisfiableResult() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CJobSatisfiableCallbackContextData.cpp0000644000175000017500000000406312520551236030415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CJobSatisfiableCallbackContextData.h" namespace Konclude { namespace Reasoner { namespace Query { CJobSatisfiableCallbackContextData::CJobSatisfiableCallbackContextData(CSatisfiableCalculationJob *satCalcJob) { mSatCalcJob = satCalcJob; mSatisfiable = false; mCalcError = false; mErrorCode = 0; } CJobSatisfiableCallbackContextData::~CJobSatisfiableCallbackContextData() { } CSatisfiableCalculationJob *CJobSatisfiableCallbackContextData::getSatisfiableCalculationJob() { return mSatCalcJob; } bool CJobSatisfiableCallbackContextData::isSatisfiable() { return mSatisfiable; } CJobSatisfiableCallbackContextData *CJobSatisfiableCallbackContextData::setSatisfiable(bool satis) { mSatisfiable = satis; return this; } bool CJobSatisfiableCallbackContextData::hasCalculationError() { return mCalcError; } CJobSatisfiableCallbackContextData* CJobSatisfiableCallbackContextData::setCalculationError(bool error, cint64 errorCode) { mCalcError = error; mErrorCode = errorCode; return this; } cint64 CJobSatisfiableCallbackContextData::getCalculationErrorCode() { return mErrorCode; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CTaxonomyPremisingQuerySupport.cpp0000644000175000017500000000332012520551244030071 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaxonomyPremisingQuerySupport.h" namespace Konclude { namespace Reasoner { namespace Query { CTaxonomyPremisingQuerySupport::CTaxonomyPremisingQuerySupport(CClassificationCalculationSupport *classificationCalculationSupport) { classCalcSupp = classificationCalculationSupport; } CTaxonomyPremisingQuerySupport::~CTaxonomyPremisingQuerySupport() { if (classCalcSupp) { delete classCalcSupp; } } CTaxonomyPremisingQuerySupport *CTaxonomyPremisingQuerySupport::setClassificationCalculationSupport(CClassificationCalculationSupport *classificationCalculationSupport) { classCalcSupp = classificationCalculationSupport; return this; } CClassificationCalculationSupport *CTaxonomyPremisingQuerySupport::getClassificationCalculationSupport() { return classCalcSupp; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSucceedQueryResult.cpp0000644000175000017500000000313212520551242025551 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSucceedQueryResult.h" namespace Konclude { namespace Reasoner { namespace Query { CSucceedQueryResult::CSucceedQueryResult() { } CSucceedQueryResult::~CSucceedQueryResult() { } QString CSucceedQueryResult::getQueryResultString() { return QString("succeed"); } bool CSucceedQueryResult::isResultEquivalentTo(CQueryResult *otherQueryResult) { if (otherQueryResult) { CSucceedQueryResult *otherBoolQueryResult = dynamic_cast(otherQueryResult); if (otherBoolQueryResult) { return true; } } return false; } bool CSucceedQueryResult::isResultEquivalentTo(CSucceedQueryResult *otherQueryResult) { return true; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSameIndividualsQuery.h0000644000175000017500000000547112520551242025535 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CSAMEINDIVIDUALSQUERY_H #define KONCLUDE_REASONER_QUERY_CSAMEINDIVIDUALSQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CIndividualSynonymsResult.h" #include "CRealizationPremisingQuery.h" #include "CIndividualsResultVisitorGenerator.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CSameIndividualsQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSameIndividualsQuery : public CRealizationPremisingQuery { // public methods public: //! Constructor CSameIndividualsQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CIndividual* individual, const QString& indiName, const QString& sameIndisQueryName = QString("UnnamedSameIndividualsQuery")); //! Destructor virtual ~CSameIndividualsQuery(); virtual CQueryResult* constructResult(CRealization* realization); virtual CIndividualSynonymsResult* constructIndividualsResult(CRealization* realization); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual bool hasError(); // protected methods protected: // protected variables protected: QString mIndividualName; CIndividual* mIndividual; QString queryName; QString queryString; CIndividualSynonymsResult* mResult; bool mUseAbbreviatedIRIs; bool mQueryConstructError; bool mRealizationCalcError; CConfigurationBase* mCalcConfig; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CSAMEINDIVIDUALSQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryWatcher.h0000644000175000017500000000322112520551242024040 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CQUERYWATCHER_H #define KONCLUDE_REASONER_QUERY_CQUERYWATCHER_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CQueryWatcher * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQueryWatcher { // public methods public: //! Constructor CQueryWatcher(); //! Destructor virtual ~CQueryWatcher(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CQUERYWATCHER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CEquivalentClassesQuery.cpp0000644000175000017500000000614112520551234026436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEquivalentClassesQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CEquivalentClassesQuery::CEquivalentClassesQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CConcept* concept, const QString& className, const QString& queryName) : CTaxonomyPremisingQuery(ontology,configuration) { mClassName = className; mConcept = concept; mQueryName = queryName; if (mClassName.isEmpty()) { mQueryString = QString("Get Equivalent Classes"); } else { mQueryString = QString("Get Equivalent Classes for concept '%1'").arg(mClassName); } mResult = nullptr; mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.OWLlink.AbbreviatedIRIs",false); mTaxonomyCalcError = false; mQueryConstructError = false; mCalcConfig = configuration; } CEquivalentClassesQuery::~CEquivalentClassesQuery() { if (mResult) { delete mResult; } delete mCalcConfig; } CQueryResult* CEquivalentClassesQuery::getQueryResult() { return mResult; } CQueryResult *CEquivalentClassesQuery::constructResult(CTaxonomy *taxonomy) { return constructClassesResult(taxonomy); } CClassSetResult *CEquivalentClassesQuery::constructClassesResult(CTaxonomy *taxonomy) { if (mResult) { delete mResult; mResult = 0; } if (taxonomy) { CHierarchyNode* node = taxonomy->getHierarchyNode(mConcept); if (node) { mResult = new CClassSetResult(); foreach (const QString& className, node->getEquivalentConceptStringList(mUseAbbreviatedIRIs)) { mResult->addClass(className); } } } return mResult; } QString CEquivalentClassesQuery::getQueryName() { return mQueryName; } QString CEquivalentClassesQuery::getQueryString() { return mQueryString; } bool CEquivalentClassesQuery::hasAnswer() { return mResult != 0; } QString CEquivalentClassesQuery::getAnswerString() { if (!mResult) { return QString("Unknown Classes"); } else { return mResult->getQueryResultString(); } } bool CEquivalentClassesQuery::hasError() { return mTaxonomyCalcError || mQueryConstructError || CQuery::hasError(); } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryError.h0000644000175000017500000000343112520551240023535 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CQUERYERROR_H #define KONCLUDE_REASONER_QUERY_CQUERYERROR_H // Libraries includes // Namespace includes #include "QuerySettings.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Query { /*! * * \class CQueryError * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQueryError : public CLinkerBase { // public methods public: //! Constructor CQueryError(); virtual QString getErrorString() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CQUERYERROR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQuery.cpp0000644000175000017500000000442612520551240023063 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQuery.h" #include "CQueryUnspecifiedStringError.h" namespace Konclude { namespace Reasoner { namespace Query { CQuery::CQuery() { mErrorLinker = nullptr; } CQuery::~CQuery() { CQueryError* errorLinkerIt = mErrorLinker; while (errorLinkerIt) { CQueryError* tmpErrorLinker = errorLinkerIt; errorLinkerIt = errorLinkerIt->getNext(); tmpErrorLinker->clearNext(); delete tmpErrorLinker; } } bool CQuery::hasError() { return mErrorLinker != nullptr; } CQuerySupport* CQuery::getQuerySupport() { return nullptr; } CQueryStatistics* CQuery::getQueryStatistics() { return nullptr; } QStringList CQuery::getErrorStringList() { QStringList errorStringList; for (CQueryError* errorLinkerIt = mErrorLinker; errorLinkerIt; errorLinkerIt = errorLinkerIt->getNext()) { errorStringList.append(errorLinkerIt->getErrorString()); } return errorStringList; } CQuery* CQuery::addErrorString(const QString& errorString) { CQueryError* qError = new CQueryUnspecifiedStringError(errorString); mErrorLinker = qError->append(mErrorLinker); return this; } CQuery* CQuery::addQueryError(CQueryError* queryError) { if (queryError) { mErrorLinker = queryError->append(mErrorLinker); } return this; } CQueryError* CQuery::getQueryErrorLinker() { return mErrorLinker; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CConsistencePremisingQuery.cpp0000644000175000017500000000335012520551234027135 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConsistencePremisingQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CConsistencePremisingQuery::CConsistencePremisingQuery(CConcreteOntology* consPremOntology, CConfigurationBase *configuration) { ontology = consPremOntology; config = configuration; mQueryStats = nullptr; } CConsistencePremisingQuery::~CConsistencePremisingQuery() { delete mQueryStats; } CConcreteOntology *CConsistencePremisingQuery::getOntology() { return ontology; } CConfigurationBase *CConsistencePremisingQuery::getConfiguration() { return config; } CConsistencePremisingQuery* CConsistencePremisingQuery::setQueryStatistics(CQueryStatistics* stats) { mQueryStats = stats; return this; } CQueryStatistics* CConsistencePremisingQuery::getQueryStatistics() { return mQueryStats; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSatisfiableCalculationJob.cpp0000644000175000017500000001460212520551242027015 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCalculationJob.h" namespace Konclude { namespace Reasoner { namespace Query { CSatisfiableCalculationJob::CSatisfiableCalculationJob() { mQueryData = nullptr; mSatCalcConstructLinker = nullptr; mCalculationConfiguration = nullptr; mCalclulationStatisticsCollector = nullptr; mPreyingAdapter = nullptr; mSatClassMessAdapter = nullptr; mJobInstantiation = nullptr; mRealMarkCandMessAdapter = nullptr; mSatIncConsTestingAdapter = nullptr; mSatIndDepTrackAdapter = nullptr; mPossAssCollAdapter = nullptr; mNextRelativeNodeID = 0; } CSatisfiableCalculationJob::~CSatisfiableCalculationJob() { delete mQueryData; CSatisfiableCalculationConstruct* satCalcConstructLinkerIt = mSatCalcConstructLinker; while (satCalcConstructLinkerIt) { CSatisfiableCalculationConstruct* tmpLinker = satCalcConstructLinkerIt; satCalcConstructLinkerIt = satCalcConstructLinkerIt->getNext(); delete tmpLinker; } } CCalculationJobQueryData* CSatisfiableCalculationJob::getQueryData() { return mQueryData; } CSatisfiableCalculationJob* CSatisfiableCalculationJob::setQueryData(CCalculationJobQueryData* takeQueryData) { delete mQueryData; mQueryData = takeQueryData; return this; } CSatisfiableCalculationJob* CSatisfiableCalculationJob::addSatisfiableCalculationConstruct(CSatisfiableCalculationConstruct* takeSatCalcConstruct) { if (takeSatCalcConstruct) { mSatCalcConstructLinker = takeSatCalcConstruct->append(mSatCalcConstructLinker); } return this; } CSatisfiableCalculationConstruct* CSatisfiableCalculationJob::getSatisfiableCalculationConstructs() { return mSatCalcConstructLinker; } CSatisfiableCalculationJob* CSatisfiableCalculationJob::setCalculationConfiguration(CCalculationConfigurationExtension *calculationConfiguration) { mCalculationConfiguration = calculationConfiguration; return this; } CCalculationConfigurationExtension* CSatisfiableCalculationJob::getCalculationConfiguration() { return mCalculationConfiguration; } CConfigurationBase* CSatisfiableCalculationJob::getConfiguration() { return mCalculationConfiguration; } CSatisfiableCalculationJob* CSatisfiableCalculationJob::setCalclulationStatisticsCollector(CCalculationStatisticsCollector* calclulationStatisticsCollector) { mCalclulationStatisticsCollector = calclulationStatisticsCollector; return this; } CCalculationStatisticsCollector* CSatisfiableCalculationJob::getCalclulationStatisticsCollector() { return mCalclulationStatisticsCollector; } CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiableTaskPreyingAdapter(CTaskPreyingAdapter* preyingAdapter) { mPreyingAdapter = preyingAdapter; return this; } CTaskPreyingAdapter* CSatisfiableCalculationJob::getSatisfiableTaskPreyingAdapter() { return mPreyingAdapter; } CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiableClassificationMessageAdapter(CSatisfiableTaskClassificationMessageAdapter* classMessObserver) { mSatClassMessAdapter = classMessObserver; return this; } CSatisfiableTaskClassificationMessageAdapter* CSatisfiableCalculationJob::getSatisfiableClassificationMessageAdapter() { return mSatClassMessAdapter; } CSatisfiableCalculationJobInstantiation* CSatisfiableCalculationJob::getConsecutivelyCalculationJobInstantiation() { return mJobInstantiation; } CSatisfiableCalculationJob* CSatisfiableCalculationJob::setConsecutivelyCalculationJobInstantiation(CSatisfiableCalculationJobInstantiation* jobInstantiation) { mJobInstantiation = jobInstantiation; return this; } cint64 CSatisfiableCalculationJob::getNextRelativeNodeID(bool moveNext) { return mNextRelativeNodeID; } CSatisfiableCalculationJob* CSatisfiableCalculationJob::setRealizationMarkedCandidatesMessageAdapter(CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter* realMessObserver) { mRealMarkCandMessAdapter = realMessObserver; return this; } CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter* CSatisfiableCalculationJob::getRealizationMarkedCandidatesMessageAdapter() { return mRealMarkCandMessAdapter; } CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiableTaskIncrementalConsistencyTestingAdapter(CSatisfiableTaskIncrementalConsistencyTestingAdapter* incConsTestAdaptor) { mSatIncConsTestingAdapter = incConsTestAdaptor; return this; } CSatisfiableTaskIncrementalConsistencyTestingAdapter* CSatisfiableCalculationJob::getSatisfiableTaskIncrementalConsistencyTestingAdapter() { return mSatIncConsTestingAdapter; } CSatisfiableCalculationJob* CSatisfiableCalculationJob::setSatisfiableTaskIndividualDependenceTrackingAdapter(CSatisfiableTaskIndividualDependenceTrackingAdapter* indDepTrackAdaptor) { mSatIndDepTrackAdapter = indDepTrackAdaptor; return this; } CSatisfiableTaskIndividualDependenceTrackingAdapter* CSatisfiableCalculationJob::getSatisfiableTaskIndividualDependenceTrackingAdapter() { return mSatIndDepTrackAdapter; } CSatisfiableCalculationJob* CSatisfiableCalculationJob::setPossibleAssertionCollectionAdapter(CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter* possAssCollAdapter) { mPossAssCollAdapter = possAssCollAdapter; return this; } CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter* CSatisfiableCalculationJob::getPossibleAssertionCollectionAdapter() { return mPossAssCollAdapter; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CTaxonomyPremisingQuery.cpp0000644000175000017500000000366212520551244026505 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaxonomyPremisingQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CTaxonomyPremisingQuery::CTaxonomyPremisingQuery(CConcreteOntology *premisingTaxonomyOntology, CConfigurationBase *configuration) { ontology = premisingTaxonomyOntology; config = configuration; mQueryStats = nullptr; } CTaxonomyPremisingQuery::~CTaxonomyPremisingQuery() { delete mQueryStats; } CConcreteOntology *CTaxonomyPremisingQuery::getOntology() { return ontology; } CConfigurationBase *CTaxonomyPremisingQuery::getConfiguration() { return config; } CQuerySupport *CTaxonomyPremisingQuery::getQuerySupport() { return getTaxonomyQuerySupport(); } CTaxonomyPremisingQuerySupport *CTaxonomyPremisingQuery::getTaxonomyQuerySupport() { return 0; } CTaxonomyPremisingQuery* CTaxonomyPremisingQuery::setQueryStatistics(CQueryStatistics* stats) { mQueryStats = stats; return this; } CQueryStatistics* CTaxonomyPremisingQuery::getQueryStatistics() { return mQueryStats; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIsTriviallyConsistentQuery.h0000644000175000017500000000575612520551236027012 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CISTRIVIALLYCONSISTENTQUERY_H #define KONCLUDE_REASONER_QUERY_CISTRIVIALLYCONSISTENTQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CBooleanQueryResult.h" #include "CQueryInconsitentOntologyError.h" #include "Config/CConfigDataReader.h" #include "Config/CConfigurationBase.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CIsTriviallyConsistentQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIsTriviallyConsistentQuery : public CQuery { // public methods public: //! Constructor CIsTriviallyConsistentQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QString& consistentQueryName = QString("UnnamedConsistencyQuery")); //! Destructor virtual ~CIsTriviallyConsistentQuery(); virtual CQueryResult* constructResult(COntologyBuildData* buildData); virtual CBooleanQueryResult* constructConsistenceResult(COntologyBuildData* buildData); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual CQuery* addQueryError(CQueryError* queryError); virtual CConcreteOntology *getOntology(); virtual CConfigurationBase *getConfiguration(); CIsTriviallyConsistentQuery* setQueryStatistics(CQueryStatistics* stats); virtual CQueryStatistics* getQueryStatistics(); // protected methods protected: // protected variables protected: QString queryName; QString queryString; CBooleanQueryResult* mResult; CConcreteOntology* mOntology; CConfigurationBase* mConfig; CQueryStatistics* mQueryStats; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CISTRIVIALLYCONSISTENTQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CDeterministicClassAssertionQuery.cpp0000644000175000017500000000261212520551234030463 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDeterministicClassAssertionQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CDeterministicClassAssertionQuery::CDeterministicClassAssertionQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QSet& individualSet, const QString& queryName) : CClassAssertionQuery(ontology,configuration,individualSet,queryName) { mDeterministicAssertions = true; } CDeterministicClassAssertionQuery::~CDeterministicClassAssertionQuery() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CWriteOWLXMLClassSubsumptionsHierarchyQuery.cpp0000644000175000017500000003177112520551244032331 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteOWLXMLClassSubsumptionsHierarchyQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CWriteOWLXMLClassSubsumptionsHierarchyQuery::CWriteOWLXMLClassSubsumptionsHierarchyQuery(CConcreteOntology *premisingTaxonomyOntology, CConfigurationBase *configuration, const QString& outputFileString, const QString &superClassName, const QString &subClassHierarchyQueryName) : CTaxonomyPremisingQuery(premisingTaxonomyOntology,configuration) { mClassName = superClassName; mQueryName = subClassHierarchyQueryName; if (mClassName.isEmpty()) { mQueryString = QString("Get Subclass Hierarchy"); } else { mQueryString = QString("Get Subclass Hierarchy of class '%1'").arg(mClassName); } mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.CLI.Output.AbbreviatedIRIs",false); mWriteDeclarations = CConfigDataReader::readConfigBoolean(configuration,"Konclude.CLI.Output.WriteDeclarations",false); mTaxCalcError = false; mQueryConstructError = false; mBottomClassNameString = QString("http://www.w3.org/2002/07/owl#Nothing"); mTopClassNameString = QString("http://www.w3.org/2002/07/owl#Thing"); mOutputFileNameString = outputFileString; mQueryAnswered = false; } CQueryResult *CWriteOWLXMLClassSubsumptionsHierarchyQuery::getQueryResult() { return nullptr; } CQuery* CWriteOWLXMLClassSubsumptionsHierarchyQuery::addQueryError(CQueryError* queryError) { if (CQueryInconsitentOntologyError::hasInconsistentOntologyError(queryError)) { // write inconsistency if (!writeInconsistentHierarchyResult()) { addQueryError(new CQueryUnspecifiedStringError(QString("Could not write class hierarchy to file '%1'.").arg(mOutputFileNameString))); } } CQuery::addQueryError(queryError); return this; } void CWriteOWLXMLClassSubsumptionsHierarchyQuery::forcedPathCreated(const QString& filePath) { QString path = filePath; if (path.contains("/") || path.contains("\\")) { int lastSlash = path.lastIndexOf("/"); int lastBackSlash = path.lastIndexOf("\\"); int lastSeparator = qMax(lastBackSlash,lastSlash); path = path.mid(0,lastSeparator); if (!path.isEmpty()) { QDir dir; dir.mkpath(path); } } } bool CWriteOWLXMLClassSubsumptionsHierarchyQuery::writeInconsistentHierarchyResult() { forcedPathCreated(mOutputFileNameString); QFile outputFile(mOutputFileNameString); if (outputFile.open(QIODevice::WriteOnly)) { QXmlStreamWriter outputStreamWriter(&outputFile); outputStreamWriter.setAutoFormatting(true); outputStreamWriter.writeStartDocument(); writeOntologyStart(&outputStreamWriter); CConcept* mTopConcept = ontology->getTBox()->getTopConcept(); CConcept* mBottomConcept = ontology->getTBox()->getTopConcept(); CBOXSET* activeClassConceptSet = ontology->getTBox()->getActiveClassConceptSet(); if (mWriteDeclarations) { for (CBOXSET::const_iterator it = activeClassConceptSet->constBegin(), itEnd = activeClassConceptSet->constEnd(); it != itEnd; ++it) { CConcept* concept(*it); QString className = CIRIName::getRecentIRIName(concept->getClassNameLinker()); if (mUseAbbreviatedIRIs) { className = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(concept->getClassNameLinker()); } writeDeclaration(className,&outputStreamWriter); } } QStringList incClassNameList; for (CBOXSET::const_iterator it = activeClassConceptSet->constBegin(), itEnd = activeClassConceptSet->constEnd(); it != itEnd; ++it) { CConcept* concept(*it); QString className = CIRIName::getRecentIRIName(concept->getClassNameLinker()); if (mUseAbbreviatedIRIs) { className = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(concept->getClassNameLinker()); } incClassNameList.append(className); } writeEquivalenceRelations(incClassNameList,&outputStreamWriter); writeOntologyEnd(&outputStreamWriter); outputStreamWriter.writeEndDocument(); outputFile.close(); return true; } return false; } CQueryResult *CWriteOWLXMLClassSubsumptionsHierarchyQuery::constructResult(CTaxonomy *taxonomy) { mQueryAnswered = true; if (!writeSubClassHierarchyResult(taxonomy)) { addQueryError(new CQueryUnspecifiedStringError(QString("Could not write class hierarchy to file '%1'.").arg(mOutputFileNameString))); } return nullptr; } bool CWriteOWLXMLClassSubsumptionsHierarchyQuery::writeSubClassHierarchyResult(CTaxonomy *taxonomy) { forcedPathCreated(mOutputFileNameString); QFile outputFile(mOutputFileNameString); if (outputFile.open(QIODevice::WriteOnly)) { QXmlStreamWriter outputStreamWriter(&outputFile); outputStreamWriter.setAutoFormatting(true); outputStreamWriter.writeStartDocument(); writeOntologyStart(&outputStreamWriter); CHierarchyNode* topNode = taxonomy->getTopHierarchyNode(); CHierarchyNode* bottomNode = taxonomy->getBottomHierarchyNode(); CHierarchyNode* basicNode = topNode; if (!mClassName.isEmpty()) { basicNode = taxonomy->getHierarchyNode(ontology->getConcept(mClassName)); } writeDeclarations(bottomNode,&outputStreamWriter); writeBottomEquivalences(bottomNode,&outputStreamWriter); QSet processNodeSet; processNodeSet.insert(bottomNode); if (basicNode) { QList processNodeList; writeDeclarations(basicNode,&outputStreamWriter); writeTopEquivalences(basicNode,&outputStreamWriter); processNodeSet.insert(basicNode); processNodeList.append(basicNode); while (!processNodeList.isEmpty()) { CHierarchyNode *procNode = processNodeList.takeFirst(); QSet* childNodeSet(procNode->getChildNodeSet()); foreach (CHierarchyNode *childNode, *childNodeSet) { if (!processNodeSet.contains(childNode)) { writeEquivalences(childNode,&outputStreamWriter); writeDeclarations(childNode,&outputStreamWriter); processNodeSet.insert(childNode); processNodeList.append(childNode); } if (childNode != bottomNode) { writeSubClassRelations(procNode,childNode,&outputStreamWriter); } } } } writeOntologyEnd(&outputStreamWriter); outputStreamWriter.writeEndDocument(); outputFile.close(); return true; } return false; } void CWriteOWLXMLClassSubsumptionsHierarchyQuery::writeBottomEquivalences(CHierarchyNode* node, QXmlStreamWriter* outputStreamWriter) { if (node->getEquivalentConceptCount() > 1) { writeEquivalenceRelations(node,outputStreamWriter); } } void CWriteOWLXMLClassSubsumptionsHierarchyQuery::writeTopEquivalences(CHierarchyNode* node, QXmlStreamWriter* outputStreamWriter) { if (node->getEquivalentConceptCount() > 1) { writeEquivalenceRelations(node,outputStreamWriter); } } void CWriteOWLXMLClassSubsumptionsHierarchyQuery::writeEquivalenceRelations(const QStringList& classNameList, QXmlStreamWriter* outputStreamWriter) { outputStreamWriter->writeStartElement("EquivalentClasses"); foreach (const QString& className, classNameList) { outputStreamWriter->writeStartElement("Class"); outputStreamWriter->writeAttribute("IRI",className); outputStreamWriter->writeEndElement(); } outputStreamWriter->writeEndElement(); } void CWriteOWLXMLClassSubsumptionsHierarchyQuery::writeEquivalenceRelations(CHierarchyNode* node, QXmlStreamWriter* outputStreamWriter) { const QStringList& classNameList(node->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); writeEquivalenceRelations(classNameList,outputStreamWriter); } void CWriteOWLXMLClassSubsumptionsHierarchyQuery::writeEquivalences(CHierarchyNode* node, QXmlStreamWriter* outputStreamWriter) { if (node->getEquivalentConceptCount() > 1) { writeEquivalenceRelations(node,outputStreamWriter); } } void CWriteOWLXMLClassSubsumptionsHierarchyQuery::writeDeclarations(CHierarchyNode* node, QXmlStreamWriter* outputStreamWriter) { if (mWriteDeclarations) { const QStringList& classNameList(node->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); foreach (const QString& className, classNameList) { writeDeclaration(className,outputStreamWriter); } } } void CWriteOWLXMLClassSubsumptionsHierarchyQuery::writeDeclaration(const QString& className, QXmlStreamWriter* outputStreamWriter) { outputStreamWriter->writeStartElement("Declaration"); outputStreamWriter->writeStartElement("Class"); outputStreamWriter->writeAttribute("IRI",className); outputStreamWriter->writeEndElement(); outputStreamWriter->writeEndElement(); } void CWriteOWLXMLClassSubsumptionsHierarchyQuery::writeOntologyPrefix(QXmlStreamWriter* outputStreamWriter, const QString& prefixName, const QString& prefixIRI) { outputStreamWriter->writeStartElement("Prefix"); outputStreamWriter->writeAttribute("name",prefixName); outputStreamWriter->writeAttribute("IRI",prefixIRI); outputStreamWriter->writeEndElement(); } void CWriteOWLXMLClassSubsumptionsHierarchyQuery::writeOntologyStart(QXmlStreamWriter* outputStreamWriter) { outputStreamWriter->writeStartElement("Ontology"); outputStreamWriter->writeAttribute("xmlns:rdfs","http://www.w3.org/2000/01/rdf-schema#"); outputStreamWriter->writeAttribute("xmlns:rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"); outputStreamWriter->writeAttribute("xmlns","http://www.w3.org/2002/07/owl#"); outputStreamWriter->writeAttribute("xmlns:xml","http://www.w3.org/XML/1998/namespace"); outputStreamWriter->writeAttribute("xmlns:xsd","http://www.w3.org/2001/XMLSchema#"); writeOntologyPrefix(outputStreamWriter,"","http://www.w3.org/2002/07/owl#"); writeOntologyPrefix(outputStreamWriter,"owl","http://www.w3.org/2002/07/owl#"); writeOntologyPrefix(outputStreamWriter,"rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"); writeOntologyPrefix(outputStreamWriter,"xml","http://www.w3.org/XML/1998/namespace"); writeOntologyPrefix(outputStreamWriter,"xsd","http://www.w3.org/2001/XMLSchema#"); writeOntologyPrefix(outputStreamWriter,"rdfs","http://www.w3.org/2000/01/rdf-schema#"); } void CWriteOWLXMLClassSubsumptionsHierarchyQuery::writeOntologyEnd(QXmlStreamWriter* outputStreamWriter) { outputStreamWriter->writeEndElement(); } void CWriteOWLXMLClassSubsumptionsHierarchyQuery::writeSubClassRelations(CHierarchyNode* superNode, CHierarchyNode* subNode, QXmlStreamWriter* outputStreamWriter) { const QStringList& superClassNameList(superNode->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); const QStringList& subClassNameList(subNode->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); writeSubClassRelation(subClassNameList.first(),superClassNameList.first(),outputStreamWriter); } void CWriteOWLXMLClassSubsumptionsHierarchyQuery::writeSubClassRelation(const QString& subClassName, const QString& superClassName, QXmlStreamWriter* outputStreamWriter) { outputStreamWriter->writeStartElement("SubClassOf"); outputStreamWriter->writeStartElement("Class"); outputStreamWriter->writeAttribute("IRI",subClassName); outputStreamWriter->writeEndElement(); outputStreamWriter->writeStartElement("Class"); outputStreamWriter->writeAttribute("IRI",superClassName); outputStreamWriter->writeEndElement(); outputStreamWriter->writeEndElement(); } QString CWriteOWLXMLClassSubsumptionsHierarchyQuery::getQueryName() { return mQueryName; } QString CWriteOWLXMLClassSubsumptionsHierarchyQuery::getQueryString() { return mQueryString; } bool CWriteOWLXMLClassSubsumptionsHierarchyQuery::hasAnswer() { return mQueryAnswered; } QString CWriteOWLXMLClassSubsumptionsHierarchyQuery::getAnswerString() { return QString("Subclass Hierarchy written to file '%1'").arg(mOutputFileNameString); } bool CWriteOWLXMLClassSubsumptionsHierarchyQuery::hasError() { return mTaxCalcError || mQueryConstructError || CQuery::hasError(); } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIsClassSatisfiableQuery.cpp0000644000175000017500000000350012520551236026511 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIsClassSatisfiableQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CIsClassSatisfiableQuery::CIsClassSatisfiableQuery(const QString& className, const QString& queryName) { mClassConceptName = className; CSatisfiableCalculationJobsQuery::setQueryName(queryName); QString queryString = QString("Is class '%1' satisfiable?").arg(className); CSatisfiableCalculationJobsQuery::setQueryString(queryString); QString answerStringYes = QString("Yes"); QString answerStringNo = QString("No"); QString answerStringUnknown = QString("Unknown"); CSatisfiableCalculationJobsQuery::setAnswerString(answerStringYes,answerStringNo,answerStringUnknown); } bool CIsClassSatisfiableQuery::isSatisfiable() { return getResult(); } QString CIsClassSatisfiableQuery::getClassStringName() { return mClassConceptName; } CIsClassSatisfiableQuery::~CIsClassSatisfiableQuery() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryStatistics.h0000644000175000017500000000441112520551240024575 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CQUERYSTATISTICS_H #define KONCLUDE_REASONER_QUERY_CQUERYSTATISTICS_H // Libraries includes #include #include // Namespace includes #include "Reasoner/Ontology/COntologyProcessingStatistics.h" // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Query { /*! * * \class CQueryStatistics * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQueryStatistics { // public methods public: //! Constructor CQueryStatistics(); //! Destructor virtual ~CQueryStatistics(); virtual QList getStatisticsNameStringList() = 0; virtual cint64 getStatisticIntegerValue(const QString& statName) = 0; virtual bool addProcessingStatistics(const QString& statName, cint64 statValue) = 0; virtual bool incProcessingStatistics(const QString& statName, cint64 incStatValue = 1) = 0; virtual bool addProcessingStatistics(COntologyProcessingStatistics* ontProcStats) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CQUERYSTATISTICS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryUnspecifiedStringError.h0000644000175000017500000000365712520551240027115 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CQUERYUNSPECIFIEDSTRINGERROR_H #define KONCLUDE_REASONER_QUERY_CQUERYUNSPECIFIEDSTRINGERROR_H // Libraries includes // Namespace includes #include "QuerySettings.h" #include "CQueryError.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Query { /*! * * \class CQueryUnspecifiedStringError * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQueryUnspecifiedStringError : public CQueryError { // public methods public: //! Constructor CQueryUnspecifiedStringError(const QString& errorString); virtual QString getErrorString(); // protected methods protected: // protected variables protected: QString mErrorString; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CQUERYUNSPECIFIEDSTRINGERROR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CAreAxiomsEntailedQuery.cpp0000644000175000017500000000446712520551230026346 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAreAxiomsEntailedQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CAreAxiomsEntailedQuery::CAreAxiomsEntailedQuery(QStringList axiomTypeNames, const QString& queryName) { cint64 axiomsCount = axiomTypeNames.count(); QString axiomTypeNamesString; bool hasClassName = false; while (!axiomTypeNames.isEmpty()) { QString nextClassName = axiomTypeNames.takeFirst(); if (hasClassName) { if (axiomTypeNames.isEmpty()) { axiomTypeNamesString += QString(" and "); } else { axiomTypeNamesString += QString(", "); } } axiomTypeNamesString += nextClassName; hasClassName = true; } CSatisfiableCalculationJobsQuery::setQueryName(queryName); QString queryString; if (axiomsCount > 1) { queryString = QString("Are '%1'-axioms entailed?").arg(axiomTypeNamesString); } else { queryString = QString("Is '%1'-axiom entailed?").arg(axiomTypeNamesString); } CSatisfiableCalculationJobsQuery::setQueryString(queryString); QString answerStringYes = QString("Yes"); QString answerStringNo = QString("No"); QString answerStringUnknown = QString("Unknown"); CSatisfiableCalculationJobsQuery::setAnswerString(answerStringYes,answerStringNo,answerStringUnknown); } bool CAreAxiomsEntailedQuery::areClassesEquivalent() { return getResult(); } CAreAxiomsEntailedQuery::~CAreAxiomsEntailedQuery() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryInconsitentOntologyError.cpp0000644000175000017500000000413712520551240030045 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryInconsitentOntologyError.h" namespace Konclude { namespace Reasoner { namespace Query { CQueryInconsitentOntologyError::CQueryInconsitentOntologyError(CConcreteOntology* onto) { mOnto = onto; mOntologyString = mOnto->getOntologyName(); } QString CQueryInconsitentOntologyError::getErrorString() { return QString("Ontology '%1' is inconsistent.").arg(mOntologyString); } bool CQueryInconsitentOntologyError::hasInconsistentOntologyError(CQueryError* queryErrorLinker) { for (CQueryError* queryErrorLinkerIt = queryErrorLinker; queryErrorLinkerIt; queryErrorLinkerIt = queryErrorLinkerIt->getNext()) { if (dynamic_cast(queryErrorLinkerIt)) { return true; } } return false; } CQueryInconsitentOntologyError* CQueryInconsitentOntologyError::getInconsistentOntologyError(CQueryError* queryErrorLinker) { for (CQueryError* queryErrorLinkerIt = queryErrorLinker; queryErrorLinkerIt; queryErrorLinkerIt = queryErrorLinkerIt->getNext()) { CQueryInconsitentOntologyError* inOnEr = dynamic_cast(queryErrorLinkerIt); if (inOnEr) { return inOnEr; } } return false; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSatisfiableCalculationJobsQuery.cpp0000644000175000017500000001336412520551242030232 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCalculationJobsQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CSatisfiableCalculationJobsQuery::CSatisfiableCalculationJobsQuery() { mJobCalculationError = false; mQueryError = false; mJobCalcedNegative = false; mJobCalcedCount = 0; mJobTotalCount = 0; mQueryResult = nullptr; mQueryStats = nullptr; mConfig = nullptr; } CSatisfiableCalculationJobsQuery::~CSatisfiableCalculationJobsQuery() { qDeleteAll(mJobDataList); delete mQueryResult; delete mQueryStats; delete mConfig; } CSatisfiableCalculationJobsQuery* CSatisfiableCalculationJobsQuery::setCalculationConfiguration(CCalculationConfigurationExtension *calculationConfiguration) { mConfig = calculationConfiguration; return this; } CCalculationConfigurationExtension* CSatisfiableCalculationJobsQuery::getCalculationConfiguration() { return mConfig; } CQUERYLIST CSatisfiableCalculationJobsQuery::getJobList() { return *((CQUERYLIST*)&mJobDataList); } CQUERYLIST CSatisfiableCalculationJobsQuery::getSatisfiableCalculationJobList() { return mJobDataList; } QString CSatisfiableCalculationJobsQuery::getQueryName() { return mQueryName; } CSatisfiableCalculationJobsQuery* CSatisfiableCalculationJobsQuery::setQueryName(const QString& queryName) { mQueryName = queryName; return this; } QString CSatisfiableCalculationJobsQuery::getQueryString() { return mQueryString; } bool CSatisfiableCalculationJobsQuery::hasAnswer() { return mJobCalcedNegative || mJobCalcedCount >= mJobTotalCount; } bool CSatisfiableCalculationJobsQuery::hasError() { return mQueryError || CQuery::hasError(); } bool CSatisfiableCalculationJobsQuery::getResult(bool queryPositive) { if (queryPositive) { return mJobCalcedNegative ? false : mJobCalcedCount>= mJobTotalCount; } else { return mJobCalcedNegative; } } CQueryResult* CSatisfiableCalculationJobsQuery::getQueryResult() { if (!mQueryResult) { if (hasAnswer()) { mQueryResult = new CBooleanQueryResult(getResult()); } } return mQueryResult; } QString CSatisfiableCalculationJobsQuery::getAnswerString() { if (hasAnswer()) { if (getResult() == true) { return mPositiveAnswerString; } else { return mNegativeAnswerString; } } return mNoAnswerString; } CQuery* CSatisfiableCalculationJobsQuery::addErrorString(const QString& errorString) { CQuery::addErrorString(errorString); mQueryError = true; return this; } CSatisfiableCalculationJobsQuery* CSatisfiableCalculationJobsQuery::setQueryString(const QString& text) { mQueryString = text; return this; } CSatisfiableCalculationJobsQuery* CSatisfiableCalculationJobsQuery::setAnswerString(const QString& positiveText, const QString& negativeText, const QString& noAnswerText) { mPositiveAnswerString = positiveText; mNegativeAnswerString = negativeText; mNoAnswerString = noAnswerText; return this; } bool CSatisfiableCalculationJobsQuery::canCancelRemainingJobs() { return mJobCalcedNegative; } CSatisfiableCalculationJobsQuery* CSatisfiableCalculationJobsQuery::addTestSatisfiableCalculationJob(CSatisfiableCalculationJob* satCalculationJob, bool mustBeSatisfiableForPositive) { mJobDataList.append(satCalculationJob); mJobTotalCount++; CSatisfiableCalculationJobQueryData* queryData = new CSatisfiableCalculationJobQueryData(this,mustBeSatisfiableForPositive); satCalculationJob->setQueryData(queryData); return this; } bool CSatisfiableCalculationJobsQuery::interpreteJobSatisfiableCalculation(CSatisfiableCalculationJob* satCalculationJob, bool satisfiable, bool calculationError, QString* newAnserString) { bool queryFinished = false; CSatisfiableCalculationJobQueryData* queryData = (CSatisfiableCalculationJobQueryData*)satCalculationJob->getQueryData(); if (calculationError) { mQueryError = true; queryData->setJobCalculationError(true); } else { if (!queryData->isJobCalculated()) { mJobCalcedCount++; } queryData->setJobCalculated(true); queryData->setJobCalculationSatisfiable(satisfiable); if (queryData->needsJobSatisfiabilityForPositiveQueryAnswer() != satisfiable) { mJobCalcedNegative = true; } } if (hasAnswer() || hasError()) { queryFinished = true; if (newAnserString) { *newAnserString = getAnswerString(); } } return queryFinished; } CSatisfiableCalculationJobsQuery* CSatisfiableCalculationJobsQuery::setQueryStatistics(CQueryStatistics* stats) { mQueryStats = stats; return this; } CQueryStatistics* CSatisfiableCalculationJobsQuery::getQueryStatistics() { return mQueryStats; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CFlattenedInstancesQuery.cpp0000644000175000017500000000664512520551234026572 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CFlattenedInstancesQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CFlattenedInstancesQuery::CFlattenedInstancesQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CConcept* concept, bool direct, const QString& conceptName, const QString& flatternedTypeQueryName) : CRealizationPremisingQuery(ontology,configuration) { mConceptName = conceptName; mConcept = concept; queryName = flatternedTypeQueryName; if (mConceptName.isEmpty()) { queryString = QString("Get Flattened Instances"); } else { queryString = QString("Get Flattened Instances for Type '%1'").arg(mConceptName); } mResult = nullptr; mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.OWLlink.AbbreviatedIRIs",false); mRealizationCalcError = false; mQueryConstructError = false; mDirect = direct; mRequiresSameIndividualRealisation = true; mRequiresConceptRealisation = true; mCalcConfig = configuration; } CFlattenedInstancesQuery::~CFlattenedInstancesQuery() { if (mResult) { delete mResult; } delete mCalcConfig; } CQueryResult* CFlattenedInstancesQuery::getQueryResult() { return mResult; } CQueryResult *CFlattenedInstancesQuery::constructResult(CRealization* realization) { return constructIndividualsResult(realization); } CIndividualsResult *CFlattenedInstancesQuery::constructIndividualsResult(CRealization* realization) { if (mResult) { delete mResult; mResult = 0; } if (realization) { CConceptRealization* conRealization = realization->getConceptRealization(); if (conRealization) { mResult = new CIndividualsResult(); CIndividualsResultVisitorGenerator resultGenerator(mResult,mUseAbbreviatedIRIs); conRealization->visitInstances(mConcept,mDirect,&resultGenerator); } } return mResult; } QString CFlattenedInstancesQuery::getQueryName() { return queryName; } QString CFlattenedInstancesQuery::getQueryString() { return queryString; } bool CFlattenedInstancesQuery::hasAnswer() { return mResult != 0; } QString CFlattenedInstancesQuery::getAnswerString() { if (!mResult) { return QString("Unknown Individuals"); } else { return mResult->getQueryResultString(); } } bool CFlattenedInstancesQuery::hasError() { return mRealizationCalcError || mQueryConstructError || CQuery::hasError(); } bool CFlattenedInstancesQuery::isDirect() { return mDirect; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassSubClassesRelationResult.h0000644000175000017500000000526712520551232027362 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CCLASSSUBCLASSESRELATIONRESULT_H #define KONCLUDE_REASONER_QUERY_CCLASSSUBCLASSESRELATIONRESULT_H // Libraries includes // Namespace includes #include "CClassSynsetResult.h" #include "CQueryResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CClassSubClassesRelationResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassSubClassesRelationResult : public CQueryResult { // public methods public: //! Constructor CClassSubClassesRelationResult(); CClassSubClassesRelationResult(CClassSynsetResult *superClassSynset); //! Destructor virtual ~CClassSubClassesRelationResult(); CClassSynsetResult *getSuperClassSynset(); CClassSubClassesRelationResult *setSuperClassSynset(CClassSynsetResult *superClassSynset); QSet* getSubClassesSynsetSet(); QList getSubClassesSynsetList(); CClassSubClassesRelationResult *addSubClassesSynset(CClassSynsetResult *subClassSynset); CClassSubClassesRelationResult *addSubClassesSynsets(const QList &subClassesSynsets); bool hasSubClassesSynset(CClassSynsetResult *subClassSynset); virtual QString getQueryResultString(); virtual bool isResultEquivalentTo(CQueryResult *otherQueryResult); qint64 getSubClassesSynsetCount(); // protected methods protected: // protected variables protected: CClassSynsetResult *superClass; QSet subClassSynsetSet; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CCLASSSUBCLASSESRELATIONRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIndividualSynsetsResultVisitorGenerator.cpp0000644000175000017500000000616412520551236032073 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualSynsetsResultVisitorGenerator.h" namespace Konclude { namespace Reasoner { namespace Query { CIndividualSynsetsResultVisitorGenerator::CIndividualSynsetsResultVisitorGenerator(CIndividualSynsetsResult* classSynsetsResult, bool abbreviatedIRIs) { mIndividualSynsetsResult = classSynsetsResult; mAbbreviatedIRIs = abbreviatedIRIs; } bool CIndividualSynsetsResultVisitorGenerator::visitRoleInstance(CRoleInstanceItem* item, CRoleRealization* roleRealization) { mTmpIndividualSynsetResult = new CIndividualSynsetResult(); roleRealization->visitIndividuals(item,this); mIndividualSynsetsResult->addIndividualSynset(mTmpIndividualSynsetResult); return true; } bool CIndividualSynsetsResultVisitorGenerator::visitInstance(CConceptInstanceItem* item, CConceptRealization* conRealization) { mTmpIndividualSynsetResult = new CIndividualSynsetResult(); conRealization->visitIndividuals(item,this); mIndividualSynsetsResult->addIndividualSynset(mTmpIndividualSynsetResult); return true; } bool CIndividualSynsetsResultVisitorGenerator::visitIndividual(CIndividual* individual, CConceptRealization* conRealization) { QString individualString; if (mAbbreviatedIRIs) { individualString = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(individual->getIndividualNameLinker()); } if (individualString.isEmpty()) { individualString = CIRIName::getRecentIRIName(individual->getIndividualNameLinker()); } if (!individualString.isEmpty()) { mTmpIndividualSynsetResult->addEquivalentIndividualName(individualString); } return true; } bool CIndividualSynsetsResultVisitorGenerator::visitIndividual(CIndividual* individual, CRoleRealization* roleRealization) { QString individualString; if (mAbbreviatedIRIs) { individualString = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(individual->getIndividualNameLinker()); } if (individualString.isEmpty()) { individualString = CIRIName::getRecentIRIName(individual->getIndividualNameLinker()); } if (!individualString.isEmpty()) { mTmpIndividualSynsetResult->addEquivalentIndividualName(individualString); } return true; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CTaxonomyPremisingQuery.h0000644000175000017500000000501712520551244026146 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CTAXONOMYPREMISINGQUERY_H #define KONCLUDE_REASONER_QUERY_CTAXONOMYPREMISINGQUERY_H // Libraries includes // Namespace includes #include "CQuery.h" #include "CTaxonomyPremisingQuerySupport.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Ontology; namespace Query { /*! * * \class CTaxonomyPremisingQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaxonomyPremisingQuery : public CQuery { // public methods public: //! Constructor CTaxonomyPremisingQuery(CConcreteOntology *premisingTaxonomyOntology, CConfigurationBase *configuration); //! Destructor virtual ~CTaxonomyPremisingQuery(); virtual CConcreteOntology *getOntology(); virtual CQueryResult *constructResult(CTaxonomy *taxonomy) = 0; virtual CConfigurationBase *getConfiguration(); virtual CQuerySupport *getQuerySupport(); virtual CTaxonomyPremisingQuerySupport *getTaxonomyQuerySupport(); CTaxonomyPremisingQuery* setQueryStatistics(CQueryStatistics* stats); virtual CQueryStatistics* getQueryStatistics(); // protected methods protected: // protected variables protected: CConcreteOntology *ontology; CConfigurationBase *config; CQueryStatistics* mQueryStats; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CTAXONOMYPREMISINGQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQuerySupport.cpp0000644000175000017500000000207112520551240024452 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQuerySupport.h" namespace Konclude { namespace Reasoner { namespace Query { CQuerySupport::CQuerySupport() { } CQuerySupport::~CQuerySupport() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryUnspecifiedStringError.cpp0000644000175000017500000000231312520551240027434 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryUnspecifiedStringError.h" namespace Konclude { namespace Reasoner { namespace Query { CQueryUnspecifiedStringError::CQueryUnspecifiedStringError(const QString& errorString) { mErrorString = errorString; } QString CQueryUnspecifiedStringError::getErrorString() { return mErrorString; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIsClassSatisfiableQuery.h0000644000175000017500000000404012520551236026156 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CISCLASSSATISFIABLEQUERY_H #define KONCLUDE_REASONER_QUERY_CISCLASSSATISFIABLEQUERY_H // Libraries includes #include // Namespace includes #include "QuerySettings.h" #include "CSatisfiableCalculationJobsQuery.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CIsClassSatisfiableQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIsClassSatisfiableQuery : public CSatisfiableCalculationJobsQuery { // public methods public: //! Constructor CIsClassSatisfiableQuery(const QString& className, const QString& queryName = QString("UnnamedSatisfiabilityQuery")); //! Destructor virtual ~CIsClassSatisfiableQuery(); bool isSatisfiable(); QString getClassStringName(); // protected methods protected: // protected variables protected: QString mClassConceptName; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CISCLASSSATISFIABLEQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryResult.h0000644000175000017500000000366612520551240023734 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CQUERYRESULT_H #define KONCLUDE_REASONER_QUERY_CQUERYRESULT_H // Libraries includes // Namespace includes #include "Concurrent/Callback/CSynchronizedCallbackListExecuter.h" // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Concurrent::Callback; namespace Reasoner { namespace Query { /*! * * \class CQueryResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQueryResult { // public methods public: //! Constructor CQueryResult(); //! Destructor virtual ~CQueryResult(); virtual QString getQueryResultString() = 0; virtual bool isResultEquivalentTo(CQueryResult *otherQueryResult) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CQUERYRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIndividualsResult.cpp0000644000175000017500000000374312520551234025434 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualsResult.h" namespace Konclude { namespace Reasoner { namespace Query { CIndividualsResult::CIndividualsResult() { } QString CIndividualsResult::getQueryResultString() { return QString(); } bool CIndividualsResult::isResultEquivalentTo(CQueryResult *otherQueryResult) { CIndividualsResult* individualsResult = dynamic_cast(otherQueryResult); if (individualsResult) { if (mIndividualSet.count() == individualsResult->mIndividualSet.count()) { for (QSet::const_iterator it = mIndividualSet.constBegin(), itEnd = mIndividualSet.constEnd(); it != itEnd; ++it) { const QString& individualString(*it); if (!individualsResult->mIndividualSet.contains(individualString)) { return false; } } return true; } } return false; } CIndividualsResult* CIndividualsResult::addIndividual(const QString &individualName) { mIndividualSet.insert(individualName); return this; } QSet* CIndividualsResult::getIndividualsSet() { return &mIndividualSet; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIndividualSynonymsResult.h0000644000175000017500000000333712520551234026475 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CINDIVIDUALSYNONYMSRESULT_H #define KONCLUDE_REASONER_QUERY_CINDIVIDUALSYNONYMSRESULT_H // Libraries includes // Namespace includes #include "CIndividualsResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CIndividualSynonymsResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualSynonymsResult : public CIndividualsResult { // public methods public: //! Constructor CIndividualSynonymsResult(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CINDIVIDUALSYNONYMSRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CNondeterministicIndividualsQuery.cpp0000644000175000017500000000305212520551240030510 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNondeterministicIndividualsQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CNondeterministicIndividualsQuery::CNondeterministicIndividualsQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QSet& individualSet, const QString& queryName) : CDeterministicNondeterministicIndividualsQuery(ontology,configuration,individualSet,queryName) { mQueryName = queryName; if (mQueryName.isEmpty()) { mQueryName = QString("Get Nondeterministic Individuals"); } mDeterministicIndividuals = false; } CNondeterministicIndividualsQuery::~CNondeterministicIndividualsQuery() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassSetResult.cpp0000644000175000017500000000356512520551232024702 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassSetResult.h" namespace Konclude { namespace Reasoner { namespace Query { CClassSetResult::CClassSetResult() { } QString CClassSetResult::getQueryResultString() { return QString(); } bool CClassSetResult::isResultEquivalentTo(CQueryResult *otherQueryResult) { CClassSetResult* classesResult = dynamic_cast(otherQueryResult); if (classesResult) { if (mClassSet.count() == classesResult->mClassSet.count()) { for (QSet::const_iterator it = mClassSet.constBegin(), itEnd = mClassSet.constEnd(); it != itEnd; ++it) { const QString& classString(*it); if (!classesResult->mClassSet.contains(classString)) { return false; } } return true; } } return false; } CClassSetResult* CClassSetResult::addClass(const QString &className) { mClassSet.insert(className); return this; } QSet* CClassSetResult::getClassesSet() { return &mClassSet; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassAssertionQuery.cpp0000644000175000017500000002003112520551232025730 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassAssertionQuery.h" #include "Reasoner/Kernel/Task/CConsistenceTaskData.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; namespace Query { CClassAssertionQuery::CClassAssertionQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QSet& individualSet, const QString& queryName) : CConsistencePremisingQuery(ontology,configuration) { mQueryName = queryName; if (mQueryName.isEmpty()) { mQueryName = QString("Get Concept Assertions"); } mResult = nullptr; mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.OWLlink.AbbreviatedIRIs",false); mConsistencyCalcError = false; mQueryConstructError = false; mDeterministicAssertions = false; mNondeterministicAssertions = false; mIndividualSet = individualSet; mCalcConfig = configuration; } CClassAssertionQuery::~CClassAssertionQuery() { if (mResult) { delete mResult; } delete mCalcConfig; } CQueryResult* CClassAssertionQuery::getQueryResult() { return mResult; } CQueryResult *CClassAssertionQuery::constructResult(CConsistence* consistence) { return constructAssertionResult(consistence); } bool CClassAssertionQuery::addIndividualResultData(cint64 indiID, CIndividualProcessNodeVector* indiNodeVec) { CBOXSET* eqNonCanSet = ontology->getTBox()->getEquivalentConceptNonCandidateSet(false); bool indiConAssertionAdded = false; CIndividualProcessNode* baseIndiNode = indiNodeVec->getData(indiID); CIndividualProcessNode* indiNode = baseIndiNode; if (indiNode && indiNode->getNominalIndividual()) { cint64 mergedIndiID = indiID; bool nonDeterministicMerged = false; while (mergedIndiID != indiNode->getMergedIntoIndividualNodeID()) { mergedIndiID = indiNode->getMergedIntoIndividualNodeID(); CDependencyTrackPoint* mergedDepTrackPoint = indiNode->getMergedDependencyTrackPoint(); if (!mergedDepTrackPoint || mergedDepTrackPoint->getBranchingTag() > 0) { nonDeterministicMerged = true; } indiNode = indiNodeVec->getData(mergedIndiID); } CReapplyConceptLabelSet* conLabelSet = indiNode->getReapplyConceptLabelSet(false); if (conLabelSet) { bool allNonDeterministic = nonDeterministicMerged; QString indiName; if (mUseAbbreviatedIRIs) { indiName = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(baseIndiNode->getNominalIndividual()->getIndividualNameLinker()); } else { indiName = CIRIName::getRecentIRIName(baseIndiNode->getNominalIndividual()->getIndividualNameLinker()); } for (CConceptDescriptor* conDesIt = conLabelSet->getAddingSortedConceptDescriptionLinker(); conDesIt; conDesIt = conDesIt->getNext()) { CDependencyTrackPoint* depTrackPoint = conDesIt->getDependencyTrackPoint(); bool conNegation = conDesIt->isNegated(); CConcept* concept = conDesIt->getConcept(); if (mDeterministicAssertions && depTrackPoint && depTrackPoint->getBranchingTag() <= 0 && !allNonDeterministic || mNondeterministicAssertions && (allNonDeterministic || !depTrackPoint || depTrackPoint->getBranchingTag() > 0)) { if (!conNegation && concept && concept->hasClassName()) { QString conceptName; if (mUseAbbreviatedIRIs) { conceptName = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(concept->getClassNameLinker()); } else { conceptName = CIRIName::getRecentIRIName(concept->getClassNameLinker()); } mResult->addIndividualConceptAssertion(indiName,conceptName); indiConAssertionAdded = true; } } if (mNondeterministicAssertions && concept->getOperatorCode() == CCEQCAND) { CConcept* eqConcept = concept->getOperandList()->getData(); bool negation = false; if (!conLabelSet->containsConcept(eqConcept,&negation)) { QString conceptName; if (mUseAbbreviatedIRIs) { conceptName = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(eqConcept->getClassNameLinker()); } else { conceptName = CIRIName::getRecentIRIName(eqConcept->getClassNameLinker()); } mResult->addIndividualConceptAssertion(indiName,conceptName); indiConAssertionAdded = true; } } } if (eqNonCanSet) { for (CBOXSET::const_iterator it = eqNonCanSet->constBegin(), itEnd = eqNonCanSet->constEnd(); it != itEnd; ++it) { CConcept* eqConcept(*it); bool negation = false; if (!conLabelSet->containsConcept(eqConcept,&negation)) { QString conceptName; if (mUseAbbreviatedIRIs) { conceptName = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(eqConcept->getClassNameLinker()); } else { conceptName = CIRIName::getRecentIRIName(eqConcept->getClassNameLinker()); } mResult->addIndividualConceptAssertion(indiName,conceptName); indiConAssertionAdded = true; } } } } } return indiConAssertionAdded; } CIndividualClassAssertionsResult *CClassAssertionQuery::constructAssertionResult(CConsistence* consistence) { if (mResult) { delete mResult; mResult = 0; } if (consistence) { mResult = new CIndividualClassAssertionsResult(); CConsistenceTaskData* consTaskData = (CConsistenceTaskData*)consistence->getConsistenceModelData(); if (consTaskData) { CSatisfiableCalculationTask* detTask = consTaskData->getDeterministicSatisfiableTask(); CSatisfiableCalculationTask* nonDetTask = consTaskData->getCompletionGraphCachedSatisfiableTask(); if (detTask != nonDetTask) { CProcessingDataBox* dataBox = nonDetTask->getProcessingDataBox(); if (dataBox) { CIndividualProcessNodeVector* indiNodeVec = dataBox->getIndividualProcessNodeVector(); cint64 indiNodeCount = indiNodeVec->getItemCount(); if (mIndividualSet.isEmpty()) { for (cint64 indiID = 0; indiID < indiNodeCount; ++indiID) { addIndividualResultData(indiID,indiNodeVec); } } else { for (QSet::const_iterator it = mIndividualSet.constBegin(), itEnd = mIndividualSet.constEnd(); it != itEnd; ++it) { CIndividual* individual(*it); cint64 indiID = individual->getIndividualID(); addIndividualResultData(indiID,indiNodeVec); } } } } } } return mResult; } QString CClassAssertionQuery::getQueryName() { return mQueryName; } QString CClassAssertionQuery::getQueryString() { return mQueryString; } bool CClassAssertionQuery::hasAnswer() { return mResult != 0; } QString CClassAssertionQuery::getAnswerString() { if (!mResult) { return QString("Unknown Concept Assertions"); } else { return mResult->getQueryResultString(); } } bool CClassAssertionQuery::hasError() { return mConsistencyCalcError || mQueryConstructError || CQuery::hasError(); } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CRealizeQuery.h0000644000175000017500000000473612520551242024052 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CRealizeQuery_H #define KONCLUDE_REASONER_QUERY_CRealizeQuery_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CSucceedQueryResult.h" #include "CRealizationPremisingQuery.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CRealizeQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealizeQuery : public CRealizationPremisingQuery { // public methods public: //! Constructor CRealizeQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QString& queryName = QString("UnnamedRealizeQuery")); //! Destructor virtual ~CRealizeQuery(); virtual CQueryResult* constructResult(CRealization* realization); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual bool hasError(); // protected methods protected: // protected variables protected: QString mIndividualName; CIndividual* mIndividual; QString mQueryName; QString queryString; CSucceedQueryResult* mResult; bool mQueryConstructError; bool mRealizationCalcError; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CRealizeQuery_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CAreClassesEquivalentQuery.cpp0000644000175000017500000000414612520551230027065 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAreClassesEquivalentQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CAreClassesEquivalentQuery::CAreClassesEquivalentQuery(QStringList classNames, const QString& queryName) { QString classNamesString; bool hasClassName = false; while (!classNames.isEmpty()) { QString nextClassName = classNames.takeFirst(); if (hasClassName) { if (classNames.isEmpty()) { classNamesString += QString(" and "); } else { classNamesString += QString(", "); } } classNamesString += nextClassName; hasClassName = true; } CSatisfiableCalculationJobsQuery::setQueryName(queryName); QString queryString = QString("Are classes '%1' equivalent?").arg(classNamesString); CSatisfiableCalculationJobsQuery::setQueryString(queryString); QString answerStringYes = QString("Yes"); QString answerStringNo = QString("No"); QString answerStringUnknown = QString("Unknown"); CSatisfiableCalculationJobsQuery::setAnswerString(answerStringYes,answerStringNo,answerStringUnknown); } bool CAreClassesEquivalentQuery::areClassesEquivalent() { return getResult(); } CAreClassesEquivalentQuery::~CAreClassesEquivalentQuery() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassesResult.h0000644000175000017500000000362612520551232024221 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CCLASSESRESULT_H #define KONCLUDE_REASONER_QUERY_CCLASSESRESULT_H // Libraries includes #include // Namespace includes #include "CQueryResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CClassesResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassesResult : public CQueryResult { // public methods public: //! Constructor CClassesResult(); virtual QString getQueryResultString(); virtual bool isResultEquivalentTo(CQueryResult *otherQueryResult); CClassesResult* addClass(const QString &className); QSet* getClassesSet(); // protected methods protected: // protected variables protected: QSet mClassSet; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CCLASSESRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIndividualSynsetsResult.cpp0000644000175000017500000001031612520551236026636 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualSynsetsResult.h" namespace Konclude { namespace Reasoner { namespace Query { CIndividualSynsetsResult::CIndividualSynsetsResult() { } CIndividualSynsetsResult::~CIndividualSynsetsResult() { qDeleteAll(mIndividualSynsetContainer); } CIndividualSynsetResult *CIndividualSynsetsResult::getIndividualSynset(const QString &individualName, bool create) { CIndividualSynsetResult *individualSynset = mIndividualIndividualSynsetHash.value(individualName,0); if (!individualSynset && create) { individualSynset = new CIndividualSynsetResult(individualName); mIndividualIndividualSynsetHash.insert(individualName,individualSynset); mIndividualSynsetContainer.append(individualSynset); } return individualSynset; } CIndividualSynsetResult *CIndividualSynsetsResult::getIndividualSynset(const QStringList &individualNames, bool create) { CIndividualSynsetResult *individualSynset = 0; if (!individualNames.isEmpty()) { individualSynset = mIndividualIndividualSynsetHash.value(individualNames.first(),0); if (!individualSynset && create) { individualSynset = new CIndividualSynsetResult(individualNames); foreach (QString individualName, individualNames) { mIndividualIndividualSynsetHash.insert(individualName,individualSynset); } mIndividualSynsetContainer.append(individualSynset); } } return individualSynset; } CIndividualSynsetResult *CIndividualSynsetsResult::addIndividualSynset(CIndividualSynsetResult *takeIndividualSynset) { foreach (QString individualName, takeIndividualSynset->getEquivalentIndividualNameList()) { mIndividualIndividualSynsetHash.insert(individualName,takeIndividualSynset); } mIndividualSynsetContainer.append(takeIndividualSynset); return takeIndividualSynset; } QList* CIndividualSynsetsResult::getIndividualSynsetList() { return &mIndividualSynsetContainer; } QString CIndividualSynsetsResult::getQueryResultString() { QString string; return string; } bool CIndividualSynsetsResult::isResultEquivalentTo(CQueryResult *otherQueryResult) { if (!otherQueryResult) { return false; } CIndividualSynsetsResult *otherIndividualSynsets = dynamic_cast(otherQueryResult); if (!otherIndividualSynsets) { return false; } if (mIndividualIndividualSynsetHash.count() != otherIndividualSynsets->mIndividualIndividualSynsetHash.count()) { return false; } for (QList::const_iterator it = mIndividualSynsetContainer.constBegin(), itEnd = mIndividualSynsetContainer.constEnd(); it != itEnd; ++it) { CIndividualSynsetResult* individualSynRes(*it); CIndividualSynsetResult* otherIndividualSynRes = nullptr; QStringList individualNameList(individualSynRes->getEquivalentIndividualNameList()); if (!individualNameList.isEmpty()) { const QString& individualName = individualNameList.first(); otherIndividualSynRes = otherIndividualSynsets->mIndividualIndividualSynsetHash.value(individualName); } if (!otherIndividualSynRes && !individualNameList.isEmpty()) { return false; } if (!individualSynRes->isResultEquivalentTo(otherIndividualSynRes)) { return false; } } return true; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CApproximatedSaturationCalculationConstructionConstruct.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CApproximatedSaturationCalculationConstructionC0000644000175000017500000001002312520551230032566 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CAPPROXIMATEDSATURATIONCALCULATIONCONSTRUCTIONCONSTRUCT_H #define KONCLUDE_REASONER_QUERY_CAPPROXIMATEDSATURATIONCALCULATIONCONSTRUCTIONCONSTRUCT_H // Libraries includes // Namespace includes #include "QuerySettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CIndividual.h" #include "Utilities/Container/CSortedNegLinker.h" #include "Reasoner/Consistiser/CSaturationConceptReferenceLinking.h" #include "Reasoner/Consistiser/CSaturationIndividualReferenceLinking.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; using namespace Consistiser; namespace Query { /*! * * \class CApproximatedSaturationCalculationConstructionConstruct * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CApproximatedSaturationCalculationConstructionConstruct : public CLinkerBase { // public methods public: //! Constructor CApproximatedSaturationCalculationConstructionConstruct(); CApproximatedSaturationCalculationConstructionConstruct* getNextConstruct(); CConcept* getConstructConcept(); CApproximatedSaturationCalculationConstructionConstruct* setConstructConcept(CConcept* concept); CRole* getConstructRole(); CApproximatedSaturationCalculationConstructionConstruct* setConstructRole(CRole* role); bool getConstructConceptNegation(); CApproximatedSaturationCalculationConstructionConstruct* setConstructConceptNegation(bool negation); CApproximatedSaturationCalculationConstructionConstruct* setIndividual(CIndividual* individual); CIndividual* getIndividual(); CApproximatedSaturationCalculationConstructionConstruct* setIndividualID(cint64 individualID); cint64 getIndividualID(); bool getQueueProcessing(); CApproximatedSaturationCalculationConstructionConstruct* setQueueProcessing(bool queueProcessing); CSaturationConceptReferenceLinking* getSaturationConceptReferenceLinking(); CApproximatedSaturationCalculationConstructionConstruct* setSaturationConceptReferenceLinking(CSaturationConceptReferenceLinking* satConRefLinking); CSaturationIndividualReferenceLinking* getSaturationIndividualReferenceLinking(); CApproximatedSaturationCalculationConstructionConstruct* setSaturationIndividualReferenceLinking(CSaturationIndividualReferenceLinking* satIndiRefLinking); // protected methods protected: // protected variables protected: CSaturationConceptReferenceLinking* mSatConRefLinking; CSaturationIndividualReferenceLinking* mSatIndiRefLinking; CConcept* mConstructConcept; bool mConstructConceptNegation; CIndividual* mIndividual; CRole* mConstructRole; cint64 mIndiID; bool mQueueProcessing; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CAPPROXIMATEDSATURATIONCALCULATIONCONSTRUCTIONCONSTRUCT_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CDeterministicNondeterministicIndividualsQuery.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CDeterministicNondeterministicIndividualsQuery.0000644000175000017500000000650412520551234032541 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CDETERMINISTICNONDETERMINISTICINDIVIDUALSQUERY_H #define KONCLUDE_REASONER_QUERY_CDETERMINISTICNONDETERMINISTICINDIVIDUALSQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CIndividualsResult.h" #include "CRealizationPremisingQuery.h" #include "Config/CConfigDataReader.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/CIndividualProcessNodeVector.h" #include "Reasoner/Realization/CIndividualConceptAssertionSetCollector.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Kernel::Process; using namespace Realization; namespace Query { /*! * * \class CDeterministicNondeterministicIndividualsQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDeterministicNondeterministicIndividualsQuery : public CRealizationPremisingQuery { // public methods public: //! Constructor CDeterministicNondeterministicIndividualsQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QSet& individualSet, const QString& queryName = QString("UnnamedIndividualsQuery")); //! Destructor virtual ~CDeterministicNondeterministicIndividualsQuery(); virtual CQueryResult* constructResult(CRealization* realization); virtual CIndividualsResult* constructIndividualsResult(CRealization* realization); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual bool hasError(); // protected methods protected: virtual bool addIndividualResultData(CIndividual* indi, CIndividualProcessNodeVector* indiNodeVec, QSet< QPair >* possAssSet); // protected variables protected: QString mQueryName; QString mQueryString; CIndividualsResult* mResult; bool mUseAbbreviatedIRIs; bool mQueryConstructError; bool mConsistencyCalcError; CConfigurationBase* mCalcConfig; QSet mIndividualSet; bool mDeterministicIndividuals; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CDETERMINISTICNONDETERMINISTICINDIVIDUALSQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CBooleanQueryResult.h0000644000175000017500000000407312520551232025226 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CBOOLEANQUERYRESULT_H #define KONCLUDE_REASONER_QUERY_CBOOLEANQUERYRESULT_H // Libraries includes #include "CQueryResult.h" // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CBooleanQueryResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBooleanQueryResult : public CQueryResult { // public methods public: //! Constructor CBooleanQueryResult(bool booleanResult = false); //! Destructor virtual ~CBooleanQueryResult(); virtual CBooleanQueryResult *setResult(bool booleanResult); virtual bool getResult(); virtual QString getQueryResultString(); virtual bool isResultEquivalentTo(CBooleanQueryResult *otherQueryResult); virtual bool isResultEquivalentTo(CQueryResult *otherQueryResult); // protected methods protected: // protected variables protected: bool result; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CBOOLEANQUERYRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CWriteOWLXMLIndividualFlattenedTypesQuery.cpp0000644000175000017500000003303712520551244031732 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteOWLXMLIndividualFlattenedTypesQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CWriteOWLXMLIndividualFlattenedTypesQuery::CWriteOWLXMLIndividualFlattenedTypesQuery(CConcreteOntology* ontology, CConfigurationBase *configuration, const QString& outputFileString, const QString& individualNameString, const QString &subClassHierarchyQueryName) : CRealizationPremisingQuery(ontology,configuration) { mQueryName = subClassHierarchyQueryName; mIndividualNameString = individualNameString; if (mIndividualNameString.isEmpty()) { mQueryString = QString("Write Individual Types"); } else { mQueryString = QString("Write Individual Types for '%1'").arg(mIndividualNameString); } mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.CLI.Output.AbbreviatedIRIs",false); mWriteDeclarations = CConfigDataReader::readConfigBoolean(configuration,"Konclude.CLI.Output.WriteDeclarations",false); mWriteOnlyDirectTypes = CConfigDataReader::readConfigBoolean(configuration,"Konclude.CLI.Output.WriteOnlyDirectTypes",false); mWriteSubClassOfInconsistency = CConfigDataReader::readConfigBoolean(configuration,"Konclude.CLI.Output.WriteReducedInconsistency",false); mRealizationCalcError = false; mQueryConstructError = false; mBottomClassNameString = QString("http://www.w3.org/2002/07/owl#Nothing"); mTopClassNameString = QString("http://www.w3.org/2002/07/owl#Thing"); mOutputFileNameString = outputFileString; mQueryAnswered = false; mRequiresSameIndividualRealisation = true; mRequiresConceptRealisation = true; } CQueryResult *CWriteOWLXMLIndividualFlattenedTypesQuery::getQueryResult() { return nullptr; } CQuery* CWriteOWLXMLIndividualFlattenedTypesQuery::addQueryError(CQueryError* queryError) { if (CQueryInconsitentOntologyError::hasInconsistentOntologyError(queryError)) { // write inconsistency if (!writeInconsistentIndividualTypes()) { addQueryError(new CQueryUnspecifiedStringError(QString("Could not write individual types to file '%1'.").arg(mOutputFileNameString))); } } CQuery::addQueryError(queryError); return this; } void CWriteOWLXMLIndividualFlattenedTypesQuery::forcedPathCreated(const QString& filePath) { QString path = filePath; if (path.contains("/") || path.contains("\\")) { int lastSlash = path.lastIndexOf("/"); int lastBackSlash = path.lastIndexOf("\\"); int lastSeparator = qMax(lastBackSlash,lastSlash); path = path.mid(0,lastSeparator); if (!path.isEmpty()) { QDir dir; dir.mkpath(path); } } } bool CWriteOWLXMLIndividualFlattenedTypesQuery::writeInconsistentIndividualTypes() { forcedPathCreated(mOutputFileNameString); QFile outputFile(mOutputFileNameString); if (outputFile.open(QIODevice::WriteOnly)) { QXmlStreamWriter outputStreamWriter(&outputFile); outputStreamWriter.setAutoFormatting(true); outputStreamWriter.writeStartDocument(); writeOntologyStart(&outputStreamWriter); CConcept* bottomConcept = mOntology->getTBox()->getBottomConcept(); CBOXSET* activeIndividualSet = mOntology->getABox()->getActiveIndividualSet(); QString bottomClassName = CIRIName::getRecentIRIName(bottomConcept->getClassNameLinker()); if (mUseAbbreviatedIRIs) { bottomClassName = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(bottomConcept->getClassNameLinker()); } if (mWriteDeclarations) { writeClassDeclaration(bottomClassName,&outputStreamWriter); } if (mWriteSubClassOfInconsistency) { CConcept* topConcept = mOntology->getTBox()->getTopConcept(); QString topClassName = CIRIName::getRecentIRIName(topConcept->getClassNameLinker()); if (mUseAbbreviatedIRIs) { topClassName = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(topConcept->getClassNameLinker()); } if (mWriteDeclarations) { writeClassDeclaration(topClassName,&outputStreamWriter); } writeSubClassRelation(topClassName,bottomClassName,&outputStreamWriter); } else { if (mIndividualNameString.isEmpty()) { QStringList incClassNameList; for (CBOXSET::const_iterator it = activeIndividualSet->constBegin(), itEnd = activeIndividualSet->constEnd(); it != itEnd; ++it) { CIndividual* individual(*it); QString individualName = CIRIName::getRecentIRIName(individual->getIndividualNameLinker()); if (mUseAbbreviatedIRIs) { individualName = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(individual->getIndividualNameLinker()); } if (mWriteDeclarations) { writeIndividualDeclaration(individualName,&outputStreamWriter); } writeIndividualType(individualName,bottomClassName,&outputStreamWriter); } } else { if (mWriteDeclarations) { writeIndividualDeclaration(mIndividualNameString,&outputStreamWriter); } writeIndividualType(mIndividualNameString,bottomClassName,&outputStreamWriter); } } writeOntologyEnd(&outputStreamWriter); outputStreamWriter.writeEndDocument(); outputFile.close(); return true; } return false; } bool CWriteOWLXMLIndividualFlattenedTypesQuery::visitConcept(CConcept* concept, CConceptRealization* conRealization) { QString conceptString; if (mUseAbbreviatedIRIs) { conceptString = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(concept->getClassNameLinker()); } if (conceptString.isEmpty()) { conceptString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); } if (!conceptString.isEmpty()) { if (mWriteDeclarations && !mDeclaratedConceptSet.contains(concept)) { mDeclaratedConceptSet.insert(concept); writeClassDeclaration(conceptString,mCurrentOutputStreamWriter); } writeIndividualType(mCurrentIndividualName,conceptString,mCurrentOutputStreamWriter); } return true; } CQueryResult *CWriteOWLXMLIndividualFlattenedTypesQuery::constructResult(CRealization* realization) { mQueryAnswered = true; if (!writeIndividualTypesResult(realization)) { addQueryError(new CQueryUnspecifiedStringError(QString("Could not write individual types to file '%1'.").arg(mOutputFileNameString))); } return nullptr; } bool CWriteOWLXMLIndividualFlattenedTypesQuery::writeIndividualTypesResult(CRealization* realization) { forcedPathCreated(mOutputFileNameString); QFile outputFile(mOutputFileNameString); if (outputFile.open(QIODevice::WriteOnly)) { QXmlStreamWriter outputStreamWriter(&outputFile); outputStreamWriter.setAutoFormatting(true); outputStreamWriter.writeStartDocument(); mCurrentOutputStreamWriter = &outputStreamWriter; CConceptRealization* conRealization = realization->getConceptRealization(); writeOntologyStart(&outputStreamWriter); CBOXSET* activeIndividualSet = mOntology->getABox()->getActiveIndividualSet(); QStringList incClassNameList; for (CBOXSET::const_iterator it = activeIndividualSet->constBegin(), itEnd = activeIndividualSet->constEnd(); it != itEnd; ++it) { CIndividual* individual(*it); QString individualName = CIRIName::getRecentIRIName(individual->getIndividualNameLinker()); QString abbreviatedIndividualName = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(individual->getIndividualNameLinker()); if (mIndividualNameString.isEmpty() || individualName == mIndividualNameString || individualName == abbreviatedIndividualName) { if (mUseAbbreviatedIRIs) { mCurrentIndividualName = abbreviatedIndividualName; } else { mCurrentIndividualName = individualName; } if (mWriteDeclarations) { writeIndividualDeclaration(mCurrentIndividualName,&outputStreamWriter); } conRealization->visitTypes(individual,mWriteOnlyDirectTypes,this); } } writeOntologyEnd(&outputStreamWriter); outputStreamWriter.writeEndDocument(); outputFile.close(); return true; } return false; } void CWriteOWLXMLIndividualFlattenedTypesQuery::writeSubClassRelation(const QString& subClassName, const QString& superClassName, QXmlStreamWriter* outputStreamWriter) { outputStreamWriter->writeStartElement("SubClassOf"); outputStreamWriter->writeStartElement("Class"); outputStreamWriter->writeAttribute("IRI",subClassName); outputStreamWriter->writeEndElement(); outputStreamWriter->writeStartElement("Class"); outputStreamWriter->writeAttribute("IRI",superClassName); outputStreamWriter->writeEndElement(); outputStreamWriter->writeEndElement(); } void CWriteOWLXMLIndividualFlattenedTypesQuery::writeIndividualDeclaration(const QString& className, QXmlStreamWriter* outputStreamWriter) { outputStreamWriter->writeStartElement("Declaration"); outputStreamWriter->writeStartElement("NamedIndividual"); outputStreamWriter->writeAttribute("IRI",className); outputStreamWriter->writeEndElement(); outputStreamWriter->writeEndElement(); } void CWriteOWLXMLIndividualFlattenedTypesQuery::writeClassDeclaration(const QString& className, QXmlStreamWriter* outputStreamWriter) { outputStreamWriter->writeStartElement("Declaration"); outputStreamWriter->writeStartElement("Class"); outputStreamWriter->writeAttribute("IRI",className); outputStreamWriter->writeEndElement(); outputStreamWriter->writeEndElement(); } void CWriteOWLXMLIndividualFlattenedTypesQuery::writeOntologyPrefix(QXmlStreamWriter* outputStreamWriter, const QString& prefixName, const QString& prefixIRI) { outputStreamWriter->writeStartElement("Prefix"); outputStreamWriter->writeAttribute("name",prefixName); outputStreamWriter->writeAttribute("IRI",prefixIRI); outputStreamWriter->writeEndElement(); } void CWriteOWLXMLIndividualFlattenedTypesQuery::writeOntologyStart(QXmlStreamWriter* outputStreamWriter) { outputStreamWriter->writeStartElement("Ontology"); outputStreamWriter->writeAttribute("xmlns:rdfs","http://www.w3.org/2000/01/rdf-schema#"); outputStreamWriter->writeAttribute("xmlns:rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"); outputStreamWriter->writeAttribute("xmlns","http://www.w3.org/2002/07/owl#"); outputStreamWriter->writeAttribute("xmlns:xml","http://www.w3.org/XML/1998/namespace"); outputStreamWriter->writeAttribute("xmlns:xsd","http://www.w3.org/2001/XMLSchema#"); writeOntologyPrefix(outputStreamWriter,"","http://www.w3.org/2002/07/owl#"); writeOntologyPrefix(outputStreamWriter,"owl","http://www.w3.org/2002/07/owl#"); writeOntologyPrefix(outputStreamWriter,"rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"); writeOntologyPrefix(outputStreamWriter,"xml","http://www.w3.org/XML/1998/namespace"); writeOntologyPrefix(outputStreamWriter,"xsd","http://www.w3.org/2001/XMLSchema#"); writeOntologyPrefix(outputStreamWriter,"rdfs","http://www.w3.org/2000/01/rdf-schema#"); } void CWriteOWLXMLIndividualFlattenedTypesQuery::writeOntologyEnd(QXmlStreamWriter* outputStreamWriter) { outputStreamWriter->writeEndElement(); } void CWriteOWLXMLIndividualFlattenedTypesQuery::writeIndividualType(const QString& individualName, const QString& className, QXmlStreamWriter* outputStreamWriter) { outputStreamWriter->writeStartElement("ClassAssertion"); outputStreamWriter->writeStartElement("Class"); outputStreamWriter->writeAttribute("IRI",className); outputStreamWriter->writeEndElement(); outputStreamWriter->writeStartElement("NamedIndividual"); outputStreamWriter->writeAttribute("IRI",individualName); outputStreamWriter->writeEndElement(); outputStreamWriter->writeEndElement(); } QString CWriteOWLXMLIndividualFlattenedTypesQuery::getQueryName() { return mQueryName; } QString CWriteOWLXMLIndividualFlattenedTypesQuery::getQueryString() { return mQueryString; } bool CWriteOWLXMLIndividualFlattenedTypesQuery::hasAnswer() { return mQueryAnswered; } QString CWriteOWLXMLIndividualFlattenedTypesQuery::getAnswerString() { if (mIndividualNameString.isEmpty()) { return QString("Individual Types written to file '%1'").arg(mOutputFileNameString); mQueryString = QString("Write Individual Types"); } else { return QString("Individual Types for '%1' written to file '%2'").arg(mIndividualNameString).arg(mOutputFileNameString); } } bool CWriteOWLXMLIndividualFlattenedTypesQuery::hasError() { return mRealizationCalcError || mQueryConstructError || CQuery::hasError(); } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIsTriviallyConsistentQuery.cpp0000644000175000017500000000654212520551236027337 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIsTriviallyConsistentQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CIsTriviallyConsistentQuery::CIsTriviallyConsistentQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QString& consistentQueryName) { mConfig = configuration; mOntology = ontology; queryName = consistentQueryName; queryString = QString("Is ontology trivially consistent?"); mResult = nullptr; } CIsTriviallyConsistentQuery::~CIsTriviallyConsistentQuery() { if (mResult) { delete mResult; } if (mQueryStats) { delete mQueryStats; } } CQueryResult* CIsTriviallyConsistentQuery::getQueryResult() { return mResult; } CQueryResult *CIsTriviallyConsistentQuery::constructResult(COntologyBuildData* buildData) { return constructConsistenceResult(buildData); } CBooleanQueryResult* CIsTriviallyConsistentQuery::constructConsistenceResult(COntologyBuildData* buildData) { if (buildData) { COntologyBuildExpressionCounter* buildExpCounter = buildData->getBuildExpressionCounter(); bool trivialConsistent = false; if (buildExpCounter) { trivialConsistent = !buildExpCounter->hasConsistencyProblematicExpressions(); } mResult = new CBooleanQueryResult(trivialConsistent); } return mResult; } QString CIsTriviallyConsistentQuery::getQueryName() { return queryName; } QString CIsTriviallyConsistentQuery::getQueryString() { return queryString; } bool CIsTriviallyConsistentQuery::hasAnswer() { return mResult != 0; } CQuery* CIsTriviallyConsistentQuery::addQueryError(CQueryError* queryError) { if (CQueryInconsitentOntologyError::hasInconsistentOntologyError(queryError)) { mResult = new CBooleanQueryResult(false); } return CQuery::addQueryError(queryError); } QString CIsTriviallyConsistentQuery::getAnswerString() { if (!mResult) { return QString("Consistency Unknown"); } else { return mResult->getQueryResultString(); } } CConcreteOntology *CIsTriviallyConsistentQuery::getOntology() { return mOntology; } CConfigurationBase *CIsTriviallyConsistentQuery::getConfiguration() { return mConfig; } CIsTriviallyConsistentQuery* CIsTriviallyConsistentQuery::setQueryStatistics(CQueryStatistics* stats) { mQueryStats = stats; return this; } CQueryStatistics* CIsTriviallyConsistentQuery::getQueryStatistics() { return mQueryStats; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CApproximatedSaturationCalculationProcessingConstruct.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CApproximatedSaturationCalculationProcessingCon0000644000175000017500000000555112520551230032557 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CAPPROXIMATEDSATURATIONCALCULATIONPROCESSINGCONSTRUCT_H #define KONCLUDE_REASONER_QUERY_CAPPROXIMATEDSATURATIONCALCULATIONPROCESSINGCONSTRUCT_H // Libraries includes // Namespace includes #include "QuerySettings.h" // Other includes #include "Reasoner/Consistiser/CSaturationConceptReferenceLinking.h" #include "Reasoner/Consistiser/CSaturationIndividualReferenceLinking.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Consistiser; namespace Query { /*! * * \class CApproximatedSaturationCalculationProcessingConstruct * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CApproximatedSaturationCalculationProcessingConstruct : public CLinkerBase { // public methods public: //! Constructor CApproximatedSaturationCalculationProcessingConstruct(); CApproximatedSaturationCalculationProcessingConstruct* getNextConstruct(); CSaturationConceptReferenceLinking* getSaturationConceptReferenceLinking(); CApproximatedSaturationCalculationProcessingConstruct* setSaturationConceptReferenceLinking(CSaturationConceptReferenceLinking* satConRefLinking); CSaturationIndividualReferenceLinking* getSaturationIndividualReferenceLinking(); CApproximatedSaturationCalculationProcessingConstruct* setSaturationConceptReferenceLinking(CSaturationIndividualReferenceLinking* satIndiRefLinking); // protected methods protected: // protected variables protected: CSaturationConceptReferenceLinking* mSatConRefLinking; CSaturationIndividualReferenceLinking* mSatIndiRefLinking; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CAPPROXIMATEDSATURATIONCALCULATIONPROCESSINGCONSTRUCT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CFlattenedTypesQuery.cpp0000644000175000017500000000646212520551234025744 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CFlattenedTypesQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CFlattenedTypesQuery::CFlattenedTypesQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CIndividual* indi, bool direct, const QString& individualName, const QString& flatternedTypeQueryName) : CRealizationPremisingQuery(ontology,configuration) { mIndividualName = individualName; mIndividual = indi; queryName = flatternedTypeQueryName; if (mIndividualName.isEmpty()) { queryString = QString("Get Flattened Types"); } else { queryString = QString("Get Flattened Types for individual '%1'").arg(mIndividualName); } mResult = nullptr; mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.OWLlink.AbbreviatedIRIs",false); mRealizationCalcError = false; mQueryConstructError = false; mDirect = direct; mCalcConfig = configuration; mRequiresConceptRealisation = true; } CFlattenedTypesQuery::~CFlattenedTypesQuery() { if (mResult) { delete mResult; } delete mCalcConfig; } CQueryResult* CFlattenedTypesQuery::getQueryResult() { return mResult; } CQueryResult *CFlattenedTypesQuery::constructResult(CRealization* realization) { return constructClassesResult(realization); } CClassesResult *CFlattenedTypesQuery::constructClassesResult(CRealization* realization) { if (mResult) { delete mResult; mResult = 0; } if (realization) { CConceptRealization* conRealization = realization->getConceptRealization(); if (conRealization) { mResult = new CClassesResult(); CClassesResultVisitorGenerator resultGenerator(mResult,mUseAbbreviatedIRIs); conRealization->visitTypes(mIndividual,mDirect,&resultGenerator); } } return mResult; } QString CFlattenedTypesQuery::getQueryName() { return queryName; } QString CFlattenedTypesQuery::getQueryString() { return queryString; } bool CFlattenedTypesQuery::hasAnswer() { return mResult != 0; } QString CFlattenedTypesQuery::getAnswerString() { if (!mResult) { return QString("Unknown Classes"); } else { return mResult->getQueryResultString(); } } bool CFlattenedTypesQuery::hasError() { return mRealizationCalcError || mQueryConstructError || CQuery::hasError(); } bool CFlattenedTypesQuery::isDirect() { return mDirect; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CWriteFunctionalIndividualFlattenedTypesQuery.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CWriteFunctionalIndividualFlattenedTypesQuery.c0000644000175000017500000002675212520551244032460 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteFunctionalIndividualFlattenedTypesQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CWriteFunctionalIndividualFlattenedTypesQuery::CWriteFunctionalIndividualFlattenedTypesQuery(CConcreteOntology* ontology, CConfigurationBase *configuration, const QString& outputFileString, const QString& individualNameString, const QString &subClassHierarchyQueryName) : CRealizationPremisingQuery(ontology,configuration) { mQueryName = subClassHierarchyQueryName; mIndividualNameString = individualNameString; if (mIndividualNameString.isEmpty()) { mQueryString = QString("Write Individual Types"); } else { mQueryString = QString("Write Individual Types for '%1'").arg(mIndividualNameString); } mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.ORE.RealizationResult.AbbreviatedIRIs",false); mWriteDeclarations = CConfigDataReader::readConfigBoolean(configuration,"Konclude.ORE.RealizationResult.WriteDeclarations",false); mWriteOnlyDirectTypes = CConfigDataReader::readConfigBoolean(configuration,"Konclude.ORE.RealizationResult.WriteOnlyDirectTypes",false); mWriteSubClassOfInconsistency = CConfigDataReader::readConfigBoolean(configuration,"Konclude.ORE.RealizationResult.WriteReducedInconsistency",false); mRealizationCalcError = false; mQueryConstructError = false; mBottomClassNameString = QString("http://www.w3.org/2002/07/owl#Nothing"); mTopClassNameString = QString("http://www.w3.org/2002/07/owl#Thing"); mOutputFileNameString = outputFileString; mQueryAnswered = false; mRequiresSameIndividualRealisation = true; mRequiresConceptRealisation = true; } CQueryResult *CWriteFunctionalIndividualFlattenedTypesQuery::getQueryResult() { return nullptr; } CQuery* CWriteFunctionalIndividualFlattenedTypesQuery::addQueryError(CQueryError* queryError) { if (CQueryInconsitentOntologyError::hasInconsistentOntologyError(queryError)) { // write inconsistency if (!writeInconsistentIndividualTypes()) { addQueryError(new CQueryUnspecifiedStringError(QString("Could not write individual types to file '%1'.").arg(mOutputFileNameString))); } } CQuery::addQueryError(queryError); return this; } void CWriteFunctionalIndividualFlattenedTypesQuery::forcedPathCreated(const QString& filePath) { QString path = filePath; if (path.contains("/") || path.contains("\\")) { int lastSlash = path.lastIndexOf("/"); int lastBackSlash = path.lastIndexOf("\\"); int lastSeparator = qMax(lastBackSlash,lastSlash); path = path.mid(0,lastSeparator); if (!path.isEmpty()) { QDir dir; dir.mkpath(path); } } } bool CWriteFunctionalIndividualFlattenedTypesQuery::writeInconsistentIndividualTypes() { forcedPathCreated(mOutputFileNameString); QFile outputFile(mOutputFileNameString); if (outputFile.open(QIODevice::WriteOnly)) { writeOntologyStart(&outputFile); CConcept* bottomConcept = mOntology->getTBox()->getBottomConcept(); CBOXSET* activeIndividualSet = mOntology->getABox()->getActiveIndividualSet(); QString bottomClassName = CIRIName::getRecentIRIName(bottomConcept->getClassNameLinker()); if (mUseAbbreviatedIRIs) { bottomClassName = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(bottomConcept->getClassNameLinker()); } if (mWriteDeclarations) { writeClassDeclaration(bottomClassName,&outputFile); } if (mWriteSubClassOfInconsistency) { CConcept* topConcept = mOntology->getTBox()->getTopConcept(); QString topClassName = CIRIName::getRecentIRIName(topConcept->getClassNameLinker()); if (mUseAbbreviatedIRIs) { topClassName = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(topConcept->getClassNameLinker()); } if (mWriteDeclarations) { writeClassDeclaration(topClassName,&outputFile); } writeSubClassRelation(topClassName,bottomClassName,&outputFile); } else { if (mIndividualNameString.isEmpty()) { QStringList incClassNameList; for (CBOXSET::const_iterator it = activeIndividualSet->constBegin(), itEnd = activeIndividualSet->constEnd(); it != itEnd; ++it) { CIndividual* individual(*it); QString individualName = CIRIName::getRecentIRIName(individual->getIndividualNameLinker()); if (mUseAbbreviatedIRIs) { individualName = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(individual->getIndividualNameLinker()); } if (mWriteDeclarations) { writeIndividualDeclaration(individualName,&outputFile); } writeIndividualType(individualName,bottomClassName,&outputFile); } } else { if (mWriteDeclarations) { writeIndividualDeclaration(mIndividualNameString,&outputFile); } writeIndividualType(mIndividualNameString,bottomClassName,&outputFile); } } writeOntologyEnd(&outputFile); outputFile.close(); return true; } return false; } bool CWriteFunctionalIndividualFlattenedTypesQuery::visitConcept(CConcept* concept, CConceptRealization* conRealization) { QString conceptString; if (mUseAbbreviatedIRIs) { conceptString = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(concept->getClassNameLinker()); } if (conceptString.isEmpty()) { conceptString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); } if (!conceptString.isEmpty()) { if (mWriteDeclarations && !mDeclaratedConceptSet.contains(concept)) { mDeclaratedConceptSet.insert(concept); writeClassDeclaration(conceptString,mCurrentOutputFile); } writeIndividualType(mCurrentIndividualName,conceptString,mCurrentOutputFile); } return true; } CQueryResult *CWriteFunctionalIndividualFlattenedTypesQuery::constructResult(CRealization* realization) { mQueryAnswered = true; if (!writeIndividualTypesResult(realization)) { addQueryError(new CQueryUnspecifiedStringError(QString("Could not write individual types to file '%1'.").arg(mOutputFileNameString))); } return nullptr; } bool CWriteFunctionalIndividualFlattenedTypesQuery::writeIndividualTypesResult(CRealization* realization) { forcedPathCreated(mOutputFileNameString); QFile outputFile(mOutputFileNameString); if (outputFile.open(QIODevice::WriteOnly)) { mCurrentOutputFile = &outputFile; CConceptRealization* conRealization = realization->getConceptRealization(); writeOntologyStart(&outputFile); CBOXSET* activeIndividualSet = mOntology->getABox()->getActiveIndividualSet(); QStringList incClassNameList; for (CBOXSET::const_iterator it = activeIndividualSet->constBegin(), itEnd = activeIndividualSet->constEnd(); it != itEnd; ++it) { CIndividual* individual(*it); QString individualName = CIRIName::getRecentIRIName(individual->getIndividualNameLinker()); QString abbreviatedIndividualName = CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(individual->getIndividualNameLinker()); if (mIndividualNameString.isEmpty() || individualName == mIndividualNameString || individualName == abbreviatedIndividualName) { if (mUseAbbreviatedIRIs) { mCurrentIndividualName = abbreviatedIndividualName; } else { mCurrentIndividualName = individualName; } if (mWriteDeclarations) { writeIndividualDeclaration(mCurrentIndividualName,&outputFile); } conRealization->visitTypes(individual,mWriteOnlyDirectTypes,this); } } writeOntologyEnd(&outputFile); outputFile.close(); return true; } return false; } void CWriteFunctionalIndividualFlattenedTypesQuery::writeIndividualDeclaration(const QString& className, QFile* outputFile) { QString writeString = QString("Declaration(NamedIndividual(<%1>))\n").arg(className); outputFile->write(writeString.toUtf8()); } void CWriteFunctionalIndividualFlattenedTypesQuery::writeClassDeclaration(const QString& className, QFile* outputFile) { QString writeString = QString("Declaration(Class(<%1>))\n").arg(className); outputFile->write(writeString.toUtf8()); } void CWriteFunctionalIndividualFlattenedTypesQuery::writeOntologyStart(QFile* outputFile) { outputFile->write(QString("Prefix(:=)\n").toUtf8()); outputFile->write(QString("Prefix(owl:=)\n").toUtf8()); outputFile->write(QString("Prefix(rdf:=)\n").toUtf8()); outputFile->write(QString("Prefix(xml:=)\n").toUtf8()); outputFile->write(QString("Prefix(xsd:=)\n").toUtf8()); outputFile->write(QString("Prefix(rdfs:=)\n").toUtf8()); outputFile->write(QString("\nOntology(\n").toUtf8()); } void CWriteFunctionalIndividualFlattenedTypesQuery::writeOntologyEnd(QFile* outputFile) { outputFile->write(QString(")").toUtf8()); } void CWriteFunctionalIndividualFlattenedTypesQuery::writeSubClassRelation(const QString& subClassName, const QString& superClassName, QFile* outputFile) { QString writeString = QString("SubClassOf(<%1> <%2>)\n").arg(subClassName,superClassName); outputFile->write(writeString.toUtf8()); } void CWriteFunctionalIndividualFlattenedTypesQuery::writeIndividualType(const QString& individualName, const QString& className, QFile* outputFile) { QString writeString = QString("ClassAssertion(<%1> <%2>)\n").arg(className,individualName); outputFile->write(writeString.toUtf8()); } QString CWriteFunctionalIndividualFlattenedTypesQuery::getQueryName() { return mQueryName; } QString CWriteFunctionalIndividualFlattenedTypesQuery::getQueryString() { return mQueryString; } bool CWriteFunctionalIndividualFlattenedTypesQuery::hasAnswer() { return mQueryAnswered; } QString CWriteFunctionalIndividualFlattenedTypesQuery::getAnswerString() { if (mIndividualNameString.isEmpty()) { return QString("Individual Types written to file '%1'").arg(mOutputFileNameString); mQueryString = QString("Write Individual Types"); } else { return QString("Individual Types for '%1' written to file '%2'").arg(mIndividualNameString).arg(mOutputFileNameString); } } bool CWriteFunctionalIndividualFlattenedTypesQuery::hasError() { return mRealizationCalcError || mQueryConstructError || CQuery::hasError(); } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIndividualClassAssertionsResult.h0000644000175000017500000000422312520551234027751 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CINDIVIDUALCLASSASSERTIONSRESULT_H #define KONCLUDE_REASONER_QUERY_CINDIVIDUALCLASSASSERTIONSRESULT_H // Libraries includes #include // Namespace includes #include "CQueryResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CIndividualClassAssertionsResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualClassAssertionsResult : public CQueryResult { // public methods public: //! Constructor CIndividualClassAssertionsResult(); virtual QString getQueryResultString(); virtual bool isResultEquivalentTo(CQueryResult *otherQueryResult); CIndividualClassAssertionsResult* addIndividualConceptAssertion(const QString& individualName, const QString& conceptName); QSet< QPair >* getIndividualConceptAssertionSet(); // protected methods protected: // protected variables protected: QSet< QPair > mIndividualConceptAssertionSet; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CINDIVIDUALCLASSASSERTIONSRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIsClassSubsumedByQuery.cpp0000644000175000017500000000400612520551236026347 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIsClassSubsumedByQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CIsClassSubsumedByQuery::CIsClassSubsumedByQuery(const QString& subsumedClassName, const QString& subsumerClassName, const QString& queryName) { subsumedName = subsumedClassName; subsumerName = subsumerClassName; CSatisfiableCalculationJobsQuery::setQueryName(queryName); QString queryString = QString("Is class '%1' subsumed by '%2'?").arg(subsumerClassName).arg(subsumedClassName); CSatisfiableCalculationJobsQuery::setQueryString(queryString); QString answerStringYes = QString("Yes"); QString answerStringNo = QString("No"); QString answerStringUnknown = QString("Unknown"); CSatisfiableCalculationJobsQuery::setAnswerString(answerStringYes,answerStringNo,answerStringUnknown); } bool CIsClassSubsumedByQuery::isSubsumed() { return getResult(); } CIsClassSubsumedByQuery::~CIsClassSubsumedByQuery() { } QString CIsClassSubsumedByQuery::getSubsumerClassName() { return subsumerName; } QString CIsClassSubsumedByQuery::getSubsumedClassName() { return subsumedName; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CWriteFunctionalIndividualFlattenedTypesQuery.h0000644000175000017500000001016012520551244032447 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CWRITEFUNCTIONALINDIVIDUALFLATTENEDTYPESQUERY_H #define KONCLUDE_REASONER_QUERY_CWRITEFUNCTIONALINDIVIDUALFLATTENEDTYPESQUERY_H // Libraries includes #include #include #include // Namespace includes #include "CQuery.h" #include "CRealizationPremisingQuery.h" #include "CQueryUnspecifiedStringError.h" #include "CQueryInconsitentOntologyError.h" #include "Reasoner/Realization/CConceptRealizationInstantiatedToConceptVisitor.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Realization; namespace Query { /*! * * \class CWriteFunctionalIndividualFlattenedTypesQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteFunctionalIndividualFlattenedTypesQuery : public CRealizationPremisingQuery, public CConceptRealizationInstantiatedToConceptVisitor { // public methods public: //! Constructor CWriteFunctionalIndividualFlattenedTypesQuery(CConcreteOntology* ontology, CConfigurationBase *configuration, const QString& outputFileString, const QString& individualNameString = QString(""), const QString &subClassHierarchyQueryName = QString("UnnamedWriteIndividualTypesQuery")); virtual CQueryResult* constructResult(CRealization* realization); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult *getQueryResult(); virtual bool hasError(); virtual CQuery* addQueryError(CQueryError* queryError); // protected methods protected: void forcedPathCreated(const QString& filePath); bool writeInconsistentIndividualTypes(); bool writeIndividualTypesResult(CRealization* realization); void writeIndividualDeclaration(const QString& individualName, QFile* outputFile); void writeClassDeclaration(const QString& className, QFile* outputFile); void writeIndividualType(const QString& individualName, const QString& className, QFile* outputFile); void writeSubClassRelation(const QString& subClassName, const QString& superClassName, QFile* outputFile); void writeOntologyStart(QFile* outputFile); void writeOntologyEnd(QFile* outputFile); virtual bool visitConcept(CConcept* concept, CConceptRealization* conRealization); // protected variables protected: QString mClassName; QString mQueryName; QString mQueryString; QString mIndividualNameString; QString mOutputFileNameString; QString mBottomClassNameString; QString mTopClassNameString; QSet mDeclaratedConceptSet; QString mCurrentIndividualName; QFile* mCurrentOutputFile; bool mUseAbbreviatedIRIs; bool mWriteDeclarations; bool mWriteOnlyDirectTypes; bool mWriteSubClassOfInconsistency; bool mQueryAnswered; bool mQueryConstructError; bool mRealizationCalcError; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CWRITEFUNCTIONALINDIVIDUALFLATTENEDTYPESQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIsClassSubsumedByQuery.h0000644000175000017500000000414112520551236026014 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CISCLASSSUBSUMEDBYQUERY_H #define KONCLUDE_REASONER_QUERY_CISCLASSSUBSUMEDBYQUERY_H // Libraries includes #include // Namespace includes #include "CSatisfiableCalculationJobsQuery.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CIsClassSubsumedByQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIsClassSubsumedByQuery : public CSatisfiableCalculationJobsQuery { // public methods public: //! Constructor CIsClassSubsumedByQuery(const QString& subsumedClassName, const QString& subsumerClassName, const QString& queryName = QString("UnnamedIsSubsumedByQuery")); //! Destructor virtual ~CIsClassSubsumedByQuery(); bool isSubsumed(); QString getSubsumerClassName(); QString getSubsumedClassName(); // protected methods protected: // protected variables protected: QString subsumedName; QString subsumerName; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CISCLASSSUBSUMEDBYQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSatisfiableCalculationJobQueryData.cpp0000644000175000017500000000502612520551242030635 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCalculationJobQueryData.h" namespace Konclude { namespace Reasoner { namespace Query { CSatisfiableCalculationJobQueryData::CSatisfiableCalculationJobQueryData(CQuery* query, bool mustBeSatisfiableForPositive) { mQuery = query; mMustBeSatisfiableForPositive = mustBeSatisfiableForPositive; mJobCalculated = false; mJobCalculationError = false; mJobCalculationSatisfiable = false; } CSatisfiableCalculationJobQueryData::~CSatisfiableCalculationJobQueryData() { } CQuery* CSatisfiableCalculationJobQueryData::getQuery() { return mQuery; } bool CSatisfiableCalculationJobQueryData::needsJobSatisfiabilityForPositiveQueryAnswer() { return mMustBeSatisfiableForPositive; } bool CSatisfiableCalculationJobQueryData::isJobCalculated() { return mJobCalculated; } bool CSatisfiableCalculationJobQueryData::isJobCalculationError() { return mJobCalculationError; } bool CSatisfiableCalculationJobQueryData::isJobCalculationSatisfiable() { return mJobCalculationSatisfiable; } CSatisfiableCalculationJobQueryData* CSatisfiableCalculationJobQueryData::setJobCalculated(bool jobCalculated) { mJobCalculated = jobCalculated; return this; } CSatisfiableCalculationJobQueryData* CSatisfiableCalculationJobQueryData::setJobCalculationError(bool jobCalculationError) { mJobCalculationError = jobCalculationError; return this; } CSatisfiableCalculationJobQueryData* CSatisfiableCalculationJobQueryData::setJobCalculationSatisfiable(bool jobCalculationSatisfiable) { mJobCalculationSatisfiable = jobCalculationSatisfiable; return this; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CResultInterceptionData.cpp0000644000175000017500000000215012520551242026404 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CResultInterceptionData.h" namespace Konclude { namespace Reasoner { namespace Query { CResultInterceptionData::CResultInterceptionData() { } CResultInterceptionData::~CResultInterceptionData() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIsInstanceOfQuery.cpp0000644000175000017500000000333312520551236025332 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIsInstanceOfQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CIsInstanceOfQuery::CIsInstanceOfQuery(const QString& individualName, const QString& className, const QString& queryName) { CSatisfiableCalculationJobsQuery::setQueryName(queryName); QString queryString = QString("Is individual '%1' instance of class '%2'?").arg(individualName).arg(className); CSatisfiableCalculationJobsQuery::setQueryString(queryString); QString answerStringYes = QString("Yes."); QString answerStringNo = QString("No."); QString answerStringUnknown = QString("Unknown."); CSatisfiableCalculationJobsQuery::setAnswerString(answerStringYes,answerStringNo,answerStringUnknown); } bool CIsInstanceOfQuery::isInstance() { return getResult(); } CIsInstanceOfQuery::~CIsInstanceOfQuery() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSatisfiableCalculationConstruct.h0000644000175000017500000000505612520551242027737 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONCONSTRUCT_H #define KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONCONSTRUCT_H // Libraries includes // Namespace includes #include "QuerySettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CIndividual.h" #include "Utilities/Container/CSortedNegLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Query { /*! * * \class CSatisfiableCalculationConstruct * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCalculationConstruct : public CLinkerBase { // public methods public: //! Constructor CSatisfiableCalculationConstruct(); //! Destructor virtual ~CSatisfiableCalculationConstruct(); CSatisfiableCalculationConstruct* getNextConstruct(); CSatisfiableCalculationConstruct* setIndividual(CIndividual* individual); CIndividual* getIndividual(); CSatisfiableCalculationConstruct* setIndividualID(cint64 individualID); cint64 getIndividualID(); CSatisfiableCalculationConstruct* setRelativeNewNodeID(cint64 nodeID); cint64 getRelativeNewNodeID(); // protected methods protected: // protected variables protected: CIndividual* mIndividual; cint64 mIndiID; cint64 mRelNodeID; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CSATISFIABLECALCULATIONCONSTRUCT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CResultInterceptionData.h0000644000175000017500000000332712520551242026060 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CRESULTINTERCEPTIONDATA_H #define KONCLUDE_REASONER_QUERY_CRESULTINTERCEPTIONDATA_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CResultInterceptionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CResultInterceptionData { // public methods public: //! Constructor CResultInterceptionData(); //! Destructor virtual ~CResultInterceptionData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CRESULTINTERCEPTIONDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQuerySupport.h0000644000175000017500000000322112520551240024115 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CQUERYSUPPORT_H #define KONCLUDE_REASONER_QUERY_CQUERYSUPPORT_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CQuerySupport * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQuerySupport { // public methods public: //! Constructor CQuerySupport(); //! Destructor virtual ~CQuerySupport(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CQUERYSUPPORT_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CApproximatedSaturationCalculationConstructionConstruct.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CApproximatedSaturationCalculationConstructionC0000644000175000017500000001104712520551230032575 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CApproximatedSaturationCalculationConstructionConstruct.h" namespace Konclude { namespace Reasoner { namespace Query { CApproximatedSaturationCalculationConstructionConstruct::CApproximatedSaturationCalculationConstructionConstruct() : CLinkerBase(this) { mIndividual = nullptr; mConstructRole = nullptr; mConstructConcept = nullptr; mIndiID = -1; mConstructConceptNegation = false; mQueueProcessing = false; mSatConRefLinking = nullptr; mSatIndiRefLinking = nullptr; } CApproximatedSaturationCalculationConstructionConstruct* CApproximatedSaturationCalculationConstructionConstruct::getNextConstruct() { return getNext(); } CConcept* CApproximatedSaturationCalculationConstructionConstruct::getConstructConcept() { return mConstructConcept; } CApproximatedSaturationCalculationConstructionConstruct* CApproximatedSaturationCalculationConstructionConstruct::setConstructConcept(CConcept* concept) { mConstructConcept = concept; return this; } CRole* CApproximatedSaturationCalculationConstructionConstruct::getConstructRole() { return mConstructRole; } CApproximatedSaturationCalculationConstructionConstruct* CApproximatedSaturationCalculationConstructionConstruct::setConstructRole(CRole* role) { mConstructRole = role; return this; } bool CApproximatedSaturationCalculationConstructionConstruct::getConstructConceptNegation() { return mConstructConceptNegation; } CApproximatedSaturationCalculationConstructionConstruct* CApproximatedSaturationCalculationConstructionConstruct::setConstructConceptNegation(bool negation) { mConstructConceptNegation = negation; return this; } CApproximatedSaturationCalculationConstructionConstruct* CApproximatedSaturationCalculationConstructionConstruct::setIndividual(CIndividual* individual) { mIndividual = individual; return this; } CIndividual* CApproximatedSaturationCalculationConstructionConstruct::getIndividual() { return mIndividual; } CApproximatedSaturationCalculationConstructionConstruct* CApproximatedSaturationCalculationConstructionConstruct::setIndividualID(cint64 individualID) { mIndiID = individualID; return this; } cint64 CApproximatedSaturationCalculationConstructionConstruct::getIndividualID() { return mIndiID; } bool CApproximatedSaturationCalculationConstructionConstruct::getQueueProcessing() { return mQueueProcessing; } CApproximatedSaturationCalculationConstructionConstruct* CApproximatedSaturationCalculationConstructionConstruct::setQueueProcessing(bool queueProcessing) { mQueueProcessing = queueProcessing; return this; } CSaturationConceptReferenceLinking* CApproximatedSaturationCalculationConstructionConstruct::getSaturationConceptReferenceLinking() { return mSatConRefLinking; } CApproximatedSaturationCalculationConstructionConstruct* CApproximatedSaturationCalculationConstructionConstruct::setSaturationConceptReferenceLinking(CSaturationConceptReferenceLinking* satConRefLinking) { mSatConRefLinking = satConRefLinking; return this; } CSaturationIndividualReferenceLinking* CApproximatedSaturationCalculationConstructionConstruct::getSaturationIndividualReferenceLinking() { return mSatIndiRefLinking; } CApproximatedSaturationCalculationConstructionConstruct* CApproximatedSaturationCalculationConstructionConstruct::setSaturationIndividualReferenceLinking(CSaturationIndividualReferenceLinking* satIndiRefLinking) { mSatIndiRefLinking = satIndiRefLinking; return this; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CApproximatedSaturationCalculationJob.cpp0000644000175000017500000001370212520551230031273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CApproximatedSaturationCalculationJob.h" namespace Konclude { namespace Reasoner { namespace Query { CApproximatedSaturationCalculationJob::CApproximatedSaturationCalculationJob() { mQueryData = nullptr; mSatCalcConstructionConstructLinker = nullptr; mSatCalcProcessingConstructLinker = nullptr; mCalculationConfiguration = nullptr; mCalclulationStatisticsCollector = nullptr; mPreyingAdapter = nullptr; mContinueSaturationData = nullptr; mSeparateSaturation = false; mIndiAnalAdapter = nullptr; } CApproximatedSaturationCalculationJob::~CApproximatedSaturationCalculationJob() { delete mQueryData; CApproximatedSaturationCalculationConstructionConstruct* satCalcConstConstructLinkerIt = mSatCalcConstructionConstructLinker; while (satCalcConstConstructLinkerIt) { CApproximatedSaturationCalculationConstructionConstruct* tmpLinker = satCalcConstConstructLinkerIt; satCalcConstConstructLinkerIt = satCalcConstConstructLinkerIt->getNext(); delete tmpLinker; } CApproximatedSaturationCalculationProcessingConstruct* satCalcProcConstructLinkerIt = mSatCalcProcessingConstructLinker; while (satCalcProcConstructLinkerIt) { CApproximatedSaturationCalculationProcessingConstruct* tmpLinker = satCalcProcConstructLinkerIt; satCalcProcConstructLinkerIt = satCalcProcConstructLinkerIt->getNext(); delete tmpLinker; } } CCalculationJobQueryData* CApproximatedSaturationCalculationJob::getQueryData() { return mQueryData; } CApproximatedSaturationCalculationJob* CApproximatedSaturationCalculationJob::setQueryData(CCalculationJobQueryData* takeQueryData) { delete mQueryData; mQueryData = takeQueryData; return this; } CApproximatedSaturationCalculationJob* CApproximatedSaturationCalculationJob::addSatisfiableCalculationConstructionConstruct(CApproximatedSaturationCalculationConstructionConstruct* takeSatCalcConstruct) { if (takeSatCalcConstruct) { mSatCalcConstructionConstructLinker = takeSatCalcConstruct->append(mSatCalcConstructionConstructLinker); } return this; } CApproximatedSaturationCalculationConstructionConstruct* CApproximatedSaturationCalculationJob::getSatisfiableCalculationConstructionConstructs() { return mSatCalcConstructionConstructLinker; } CApproximatedSaturationCalculationJob* CApproximatedSaturationCalculationJob::addSatisfiableCalculationProcessingConstruct(CApproximatedSaturationCalculationProcessingConstruct* takeSatCalcConstruct) { if (takeSatCalcConstruct) { mSatCalcProcessingConstructLinker = takeSatCalcConstruct->append(mSatCalcProcessingConstructLinker); } return this; } CApproximatedSaturationCalculationProcessingConstruct* CApproximatedSaturationCalculationJob::getSatisfiableCalculationProcessingConstructs() { return mSatCalcProcessingConstructLinker; } CApproximatedSaturationCalculationJob* CApproximatedSaturationCalculationJob::setCalculationConfiguration(CCalculationConfigurationExtension *calculationConfiguration) { mCalculationConfiguration = calculationConfiguration; return this; } CCalculationConfigurationExtension* CApproximatedSaturationCalculationJob::getCalculationConfiguration() { return mCalculationConfiguration; } CApproximatedSaturationCalculationJob* CApproximatedSaturationCalculationJob::setCalclulationStatisticsCollector(CCalculationStatisticsCollector* calclulationStatisticsCollector) { mCalclulationStatisticsCollector = calclulationStatisticsCollector; return this; } CCalculationStatisticsCollector* CApproximatedSaturationCalculationJob::getCalclulationStatisticsCollector() { return mCalclulationStatisticsCollector; } CApproximatedSaturationCalculationJob* CApproximatedSaturationCalculationJob::setSaturationTaskPreyingAdapter(CTaskPreyingAdapter* preyingAdapter) { mPreyingAdapter = preyingAdapter; return this; } CTaskPreyingAdapter* CApproximatedSaturationCalculationJob::getSaturationTaskPreyingAdapter() { return mPreyingAdapter; } CSaturationData* CApproximatedSaturationCalculationJob::getContinueSaturationData() { return mContinueSaturationData; } CApproximatedSaturationCalculationJob* CApproximatedSaturationCalculationJob::setContinueSaturationData(CSaturationData* saturationData) { mContinueSaturationData = saturationData; return this; } bool CApproximatedSaturationCalculationJob::isSeparateSaturation() { return mSeparateSaturation; } CApproximatedSaturationCalculationJob* CApproximatedSaturationCalculationJob::setSeparateSaturation(bool separateSaturation) { mSeparateSaturation = separateSaturation; return this; } CApproximatedSaturationCalculationJob* CApproximatedSaturationCalculationJob::setSaturationIndividualsAnalysationObserver(CSaturationIndividualsAnalysingAdapter* indiAnalAdapter) { mIndiAnalAdapter = indiAnalAdapter; return this; } CSaturationIndividualsAnalysingAdapter* CApproximatedSaturationCalculationJob::getSaturationIndividualsAnalysationObserver() { return mIndiAnalAdapter; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassHierarchyResult.cpp0000644000175000017500000004674112520551232026070 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassHierarchyResult.h" namespace Konclude { namespace Reasoner { namespace Query { CClassHierarchyResult::CClassHierarchyResult() { bottomClass = 0; topClass = 0; } CClassHierarchyResult::CClassHierarchyResult(const QString &bottomHierarchyClass, const QString &topHierarchyClass) { topClass = getClassSynset(topHierarchyClass); bottomClass = getClassSynset(bottomHierarchyClass); } CClassHierarchyResult::CClassHierarchyResult(const QStringList &bottomHierarchyClasses, const QStringList &topHierarchyClasses) { topClass = getClassSynset(topHierarchyClasses); bottomClass = getClassSynset(bottomHierarchyClasses); } CClassHierarchyResult::CClassHierarchyResult(CClassSynsetResult *takeBottomClassSynset, CClassSynsetResult *takeTopClassSynset) { topClass = takeTopClassSynset; bottomClass = takeBottomClassSynset; foreach (QString className, topClass->getEquivalentClassNameList()) { classClassSynsetHash.insert(className,topClass); } classSynsetContainer.append(topClass); foreach (QString className, bottomClass->getEquivalentClassNameList()) { classClassSynsetHash.insert(className,bottomClass); } classSynsetContainer.append(bottomClass); } CClassHierarchyResult::CClassHierarchyResult(CClassSynsetResult *takeBottomClassSynset) { topClass = nullptr; bottomClass = takeBottomClassSynset; foreach (QString className, bottomClass->getEquivalentClassNameList()) { classClassSynsetHash.insert(className,bottomClass); } classSynsetContainer.append(bottomClass); } CClassHierarchyResult::~CClassHierarchyResult() { qDeleteAll(classSynsetContainer); qDeleteAll(subClassRelationContainer); } CClassSynsetResult *CClassHierarchyResult::getBottomClassSynset() { return bottomClass; } CClassSynsetResult *CClassHierarchyResult::getTopClassSynset() { return topClass; } CClassSynsetResult *CClassHierarchyResult::getClassSynset(const QString &className, bool create) { CClassSynsetResult *classSynset = classClassSynsetHash.value(className,0); if (!classSynset && create) { classSynset = new CClassSynsetResult(className); classClassSynsetHash.insert(className,classSynset); classSynsetContainer.append(classSynset); } return classSynset; } CClassSynsetResult *CClassHierarchyResult::getClassSynset(const QStringList &classNames, bool create) { CClassSynsetResult *classSynset = 0; if (!classNames.isEmpty()) { classSynset = classClassSynsetHash.value(classNames.first(),0); if (!classSynset && create) { classSynset = new CClassSynsetResult(classNames); foreach (QString className, classNames) { classClassSynsetHash.insert(className,classSynset); } classSynsetContainer.append(classSynset); } } return classSynset; } CClassSynsetResult *CClassHierarchyResult::setTopClassSynset(CClassSynsetResult *classSynset) { topClass = classSynset; return classSynset; } CClassSynsetResult *CClassHierarchyResult::addClassSynset(CClassSynsetResult *takeClassSynset) { foreach (QString className, takeClassSynset->getEquivalentClassNameList()) { classClassSynsetHash.insert(className,takeClassSynset); } classSynsetContainer.append(takeClassSynset); return takeClassSynset; } CClassSubClassesRelationResult *CClassHierarchyResult::addSubClassRelation(CClassSynsetResult *superClassSynset, CClassSynsetResult *anySubClassSynset) { CClassSubClassesRelationResult *subClassRelation = classSynsetSubClassHash.value(superClassSynset,0); if (!subClassRelation) { subClassRelation = new CClassSubClassesRelationResult(superClassSynset); subClassRelationContainer.append(subClassRelation); classSynsetSubClassHash.insert(superClassSynset,subClassRelation); } if (!subClassRelation->hasSubClassesSynset(anySubClassSynset)) { subClassRelation->addSubClassesSynset(anySubClassSynset); } return subClassRelation; } CClassSubClassesRelationResult *CClassHierarchyResult::getSubClassRelation(CClassSynsetResult *superClassSynset, bool create) { CClassSubClassesRelationResult *subClassRelation = classSynsetSubClassHash.value(superClassSynset,0); if (!subClassRelation && create) { subClassRelation = new CClassSubClassesRelationResult(superClassSynset); subClassRelationContainer.append(subClassRelation); classSynsetSubClassHash.insert(superClassSynset,subClassRelation); } return subClassRelation; } QString CClassHierarchyResult::getQueryResultString() { QString string; return string; } CTaxonomy *CClassHierarchyResult::fillTaxonomy(CConcreteOntology *ontology, CTaxonomy *taxonomy) { bool completeMapping = true; CMAPPINGHASH *classConceptHash = ontology->getStringMapping()->getClassNameConceptMappingHash(false); if (classConceptHash) { QStringList bottomClassList(bottomClass->getEquivalentClassNameList()); foreach (QString bottomClassString, bottomClassList) { CConcept *unsatCon = classConceptHash->value(bottomClassString,0); if (unsatCon) { if (!taxonomy->isSatisfiable(unsatCon) && !taxonomy->isNotSatisfiable(unsatCon)) { taxonomy->setConceptSatisfiable(unsatCon,false); } } else { completeMapping = false; } } QList updateClassSynList; QSet updateClassSynSet; updateClassSynList.append(topClass); while (!updateClassSynList.isEmpty()) { CClassSynsetResult *classSynset = updateClassSynList.takeFirst(); QStringList classNameList(classSynset->getEquivalentClassNameList()); CConcept *firstSatCon = 0; foreach (QString className, classNameList) { CConcept *satConcept = classConceptHash->value(className,0); if (satConcept) { if (!taxonomy->isSatisfiable(satConcept) && !taxonomy->isNotSatisfiable(satConcept)) { taxonomy->setConceptSatisfiable(satConcept,true); } if (firstSatCon) { if (!taxonomy->isSubsumption(firstSatCon,satConcept) && !taxonomy->isNotSubsumption(firstSatCon,satConcept)) { taxonomy->setConceptSubsumption(firstSatCon,satConcept); } if (!taxonomy->isSubsumption(satConcept,firstSatCon) && !taxonomy->isNotSubsumption(satConcept,firstSatCon)) { taxonomy->setConceptSubsumption(satConcept,firstSatCon); } } if (!firstSatCon) { firstSatCon = satConcept; } } else { completeMapping = false; } } CClassSubClassesRelationResult *subClassRelation = classSynsetSubClassHash.value(classSynset); if (subClassRelation) { QSet* subClassSet(subClassRelation->getSubClassesSynsetSet()); foreach (CClassSynsetResult *subClassSynset, *subClassSet) { CConcept *con = 0; foreach (QString subclassName, subClassSynset->getEquivalentClassNameList()) { con = classConceptHash->value(subclassName,0); if (con) { if (!taxonomy->isSatisfiable(con) && !taxonomy->isNotSatisfiable(con)) { taxonomy->setConceptSatisfiable(con,true); } break; } } if (con) { if (!taxonomy->isSubsumption(con,firstSatCon) && !taxonomy->isNotSubsumption(con,firstSatCon)) { taxonomy->setConceptSubsumption(con,firstSatCon); } if (!updateClassSynSet.contains(subClassSynset)) { updateClassSynSet.insert(subClassSynset); updateClassSynList.append(subClassSynset); } } else { completeMapping = false; } } } } } return taxonomy; } void CClassHierarchyResult::compareSubsumersCount(QHash* subsumHash1, QHash* subsumHash2) { cint64 totalClassDiffCount = 0; cint64 totalClassAddCount = 0; cint64 totalClassMissCount = 0; cint64 totalAddCount = 0; cint64 totalMissCount = 0; foreach (const QString& className, subsumHash1->uniqueKeys()) { QList classSuperSynSets1(subsumHash1->values(className)); QList classSuperSynSets2(subsumHash2->values(className)); cint64 missingCount = 0; cint64 additionalCount = 0; foreach (const QString& supsumerClassName, classSuperSynSets1) { if (!classSuperSynSets2.contains(supsumerClassName)) { ++missingCount; } } cint64 diffCount = classSuperSynSets2.count() - classSuperSynSets1.count(); if (diffCount != 0 || missingCount > 0) { foreach (const QString& supsumerClassName, classSuperSynSets2) { if (!classSuperSynSets1.contains(supsumerClassName)) { ++additionalCount; } } } if (additionalCount > 0) { ++totalClassAddCount; totalAddCount += additionalCount; } if (missingCount > 0) { ++totalClassMissCount; totalMissCount += missingCount; } if (additionalCount > 0 || missingCount > 0) { ++totalClassDiffCount; LOG(ERROR,"::Konclude::Reasoner::Query::ClassHierarchyResult",logTr("Class '%1' has %2 additional and %3 missing subsumers.").arg(className).arg(additionalCount).arg(missingCount),this); } } if (totalClassDiffCount != 0) { LOG(ERROR,"::Konclude::Reasoner::Query::ClassHierarchyResult",logTr("%1 classes with additional subsumers, %2 classes with missing subsumers, overall %3 classes different.").arg(totalClassAddCount).arg(totalClassMissCount).arg(totalClassDiffCount),this); LOG(ERROR,"::Konclude::Reasoner::Query::ClassHierarchyResult",logTr("Overall %1 additional subsumers, %2 missing subsumers.").arg(totalAddCount).arg(totalMissCount),this); } } void CClassHierarchyResult::collectSubsumerClassSynsets(CClassHierarchyResult *classHierarchy, QHash* subsumHash, QSet< QPair >* subsumSet) { QSet< QPair >* delSubsumSet = nullptr; if (!subsumSet) { delSubsumSet = new QSet< QPair >(); subsumSet = delSubsumSet; } QList allClassList; QSet allClassSet; QSet currClassSet; CClassSynsetResult* topClassSynset = classHierarchy->getTopClassSynset(); allClassList.append(topClassSynset); allClassSet.insert(topClassSynset); currClassSet.insert(topClassSynset); while (!allClassList.isEmpty()) { CClassSynsetResult* classSynset = allClassList.takeFirst(); CClassSubClassesRelationResult* subClassSynsetRel = classHierarchy->getSubClassRelation(classSynset,false); QList superClassList; foreach (const QString& className1, classSynset->getEquivalentClassNameList()) { foreach (const QString& className2, classSynset->getEquivalentClassNameList()) { QPair selfSubSumPair(className1,className2); if (!subsumSet->contains(selfSubSumPair)) { subsumSet->insert(selfSubSumPair); subsumHash->insertMulti(className1,className2); } QList tmpSuperClassList(subsumHash->values(className2)); foreach (const QString& className3, tmpSuperClassList) { QPair subSumPair(className1,className3); if (!subsumSet->contains(subSumPair)) { subsumSet->insert(subSumPair); subsumHash->insertMulti(className1,className3); } } } if (superClassList.isEmpty()) { superClassList.append(subsumHash->values(className1)); } } if (subClassSynsetRel) { foreach (CClassSynsetResult* subClassSynset, *subClassSynsetRel->getSubClassesSynsetSet()) { QList subClassList(subClassSynset->getEquivalentClassNameList()); allClassList.append(subClassSynset); foreach (const QString& className1, subClassList) { foreach (const QString& className2, subClassList) { QPair selfSubSumPair(className1,className2); if (!subsumSet->contains(selfSubSumPair)) { subsumSet->insert(selfSubSumPair); subsumHash->insertMulti(className1,className2); } } } foreach (const QString& className1, subClassList) { foreach (const QString& className2, superClassList) { QPair subSumPair(className1,className2); if (!subsumSet->contains(subSumPair)) { subsumSet->insert(subSumPair); subsumHash->insertMulti(className1,className2); } } } } } } delete delSubsumSet; } bool CClassHierarchyResult::isResultEquivalentTo(CQueryResult *otherQueryResult) { if (!otherQueryResult) { return false; } CClassHierarchyResult *otherClassHierarchy = dynamic_cast(otherQueryResult); if (!otherClassHierarchy) { return false; } bool wrongResult = false; if (!bottomClass->isResultEquivalentTo(otherClassHierarchy->getBottomClassSynset())) { LOG(ERROR,"::Konclude::Reasoner::Query::ClassHierarchyResult",logTr("Bottom class synset doesn't match."),this); wrongResult = true; } if (topClass && !otherClassHierarchy->getTopClassSynset() || !topClass && otherClassHierarchy->getTopClassSynset()) { LOG(ERROR,"::Konclude::Reasoner::Query::ClassHierarchyResult",logTr("Top class synset doesn't match."),this); return false; } if (!topClass) { return !wrongResult; } if (!topClass->isResultEquivalentTo(otherClassHierarchy->getTopClassSynset())) { LOG(ERROR,"::Konclude::Reasoner::Query::ClassHierarchyResult",logTr("Top class synset doesn't match."),this); return false; } #ifndef KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED //QHash subsumHash1; //QHash subsumHash2; //QSet< QPair > subsumSet1; //QSet< QPair > subsumSet2; //collectSubsumerClassSynsets(this,&subsumHash1,&subsumSet1); //collectSubsumerClassSynsets(otherClassHierarchy,&subsumHash2,&subsumSet2); //compareSubsumersCount(&subsumHash1,&subsumHash2); #endif CClassSynsetResult* topClassSynset = otherClassHierarchy->getTopClassSynset(); QList testClassList; QList otherClassList; QSet testClassSet; testClassList.append(topClass); otherClassList.append(topClassSynset); testClassSet.insert(topClass); while (!testClassList.isEmpty()) { CClassSynsetResult *classSynset = testClassList.takeFirst(); CClassSynsetResult *otherClassSynset = otherClassList.takeFirst(); CClassSubClassesRelationResult *subClassRelation = getSubClassRelation(classSynset,false); CClassSubClassesRelationResult *otherSubClassRelation = otherClassHierarchy->getSubClassRelation(otherClassSynset,false); if (!subClassRelation && otherSubClassRelation || subClassRelation && !otherSubClassRelation) { LOG(ERROR,"::Konclude::Reasoner::Query::ClassHierarchyResult",logTr("SubClass relations of '%1' doesn't match.").arg(classSynset->getEquivalentClassNameList().join(", ")),this); return false; } if (subClassRelation) { if (subClassRelation->getSubClassesSynsetCount() != otherSubClassRelation->getSubClassesSynsetCount()) { wrongResult = true; LOG(ERROR,"::Konclude::Reasoner::Query::ClassHierarchyResult",logTr("SubClass relations of '%1' doesn't match.").arg(classSynset->getEquivalentClassNameList().join(", ")),this); } if (subClassRelation->getSubClassesSynsetCount() < 20) { QList otherSubClassList(otherSubClassRelation->getSubClassesSynsetList()); foreach (CClassSynsetResult *classSynset, subClassRelation->getSubClassesSynsetList()) { bool contained = false; CClassSynsetResult *accSubClassSynset = classSynset; for (qint64 cnt = otherSubClassList.count(); cnt > 0; --cnt) { CClassSynsetResult *accOtherSubClassSynset = otherSubClassList.first(); if (!accOtherSubClassSynset) { wrongResult = true; break; } else { contained |= accOtherSubClassSynset->isResultEquivalentTo(classSynset); if (contained) { otherSubClassList.takeFirst(); if (!testClassSet.contains(accSubClassSynset)) { testClassSet.insert(accSubClassSynset); testClassList.append(accSubClassSynset); otherClassList.append(accOtherSubClassSynset); } break; } else { otherSubClassList.append(otherSubClassList.takeFirst()); } } } if (!contained) { wrongResult = true; LOG(ERROR,"::Konclude::Reasoner::Query::ClassHierarchyResult",logTr("Couldn't find corresponding synset '%1' of super class synset '%2'.").arg(classSynset->getEquivalentClassNameList().join(", ")).arg(otherClassSynset->getEquivalentClassNameList().join(", ")),this); } } } else { QList otherSubClassList(otherSubClassRelation->getSubClassesSynsetList()); QHash otherSubClassHash; foreach (CClassSynsetResult* otherClassSynset, otherSubClassList) { foreach (const QString& className ,otherClassSynset->getEquivalentClassNameList()) { otherSubClassHash.insert(className,otherClassSynset); } } foreach (CClassSynsetResult *classSynset, subClassRelation->getSubClassesSynsetList()) { bool contained = false; CClassSynsetResult *accSubClassSynset = classSynset; CClassSynsetResult *accOtherSubClassSynset = otherSubClassHash.value(accSubClassSynset->getEquivalentClassNameList().first()); if (!accOtherSubClassSynset || !accOtherSubClassSynset->isResultEquivalentTo(classSynset)) { wrongResult = true; LOG(ERROR,"::Konclude::Reasoner::Query::ClassHierarchyResult",logTr("Couldn't find corresponding synset '%1' of super class synset '%2'.").arg(classSynset->getEquivalentClassNameList().join(", ")).arg(otherClassSynset->getEquivalentClassNameList().join(", ")),this); } else if (accOtherSubClassSynset) { foreach (const QString& className ,accOtherSubClassSynset->getEquivalentClassNameList()) { otherSubClassHash.insert(className,nullptr); } contained = true; } if (contained) { if (!testClassSet.contains(accSubClassSynset)) { testClassSet.insert(accSubClassSynset); testClassList.append(accSubClassSynset); otherClassList.append(accOtherSubClassSynset); } } } } } } return !wrongResult; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassifyQuery.h0000644000175000017500000000466512520551232024234 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CCLASSIFYQUERY_H #define KONCLUDE_REASONER_QUERY_CCLASSIFYQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CSucceedQueryResult.h" #include "CTaxonomyPremisingQuery.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CClassifyQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassifyQuery : public CTaxonomyPremisingQuery { // public methods public: //! Constructor CClassifyQuery(CConcreteOntology *premisingTaxonomyOntology, CConfigurationBase *configuration, const QString &subClassHierarchyQueryName = QString("UnnamedClassifyQuery")); //! Destructor virtual ~CClassifyQuery(); virtual CQueryResult *constructResult(CTaxonomy *taxonomy); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult *getQueryResult(); virtual bool hasError(); // protected methods protected: // protected variables protected: QString queryName; QString queryString; CSucceedQueryResult* mResult; bool mQueryConstructError; bool mTaxCalcError; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CCLASSIFYQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryStatisticsCollectionStrings.cpp0000644000175000017500000000766712520551240030536 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryStatisticsCollectionStrings.h" namespace Konclude { namespace Reasoner { namespace Query { CQueryStatisticsCollectionStrings::CQueryStatisticsCollectionStrings() { mCalcStatCollLinker = nullptr; mStatStringsCollected = false; } CQueryStatisticsCollectionStrings::~CQueryStatisticsCollectionStrings() { CQueryCalculationStatisticsCollection* mCalcStatCollLinkerIt = mCalcStatCollLinker; while (mCalcStatCollLinkerIt) { CQueryCalculationStatisticsCollection* tmpCalcStatCollLinker = mCalcStatCollLinkerIt; mCalcStatCollLinkerIt = mCalcStatCollLinkerIt->getNext(); delete tmpCalcStatCollLinker; } } CQueryCalculationStatisticsCollection* CQueryStatisticsCollectionStrings::getCalculationStatisticsCollectorLinker() { return mCalcStatCollLinker; } CQueryCalculationStatisticsCollection* CQueryStatisticsCollectionStrings::createCalculationStatisticsCollection() { CQueryCalculationStatisticsCollection* tmpCalcStatCollLinker = new CQueryCalculationStatisticsCollection(); mCalcStatCollLinker = tmpCalcStatCollLinker->append(mCalcStatCollLinker); return mCalcStatCollLinker; } bool CQueryStatisticsCollectionStrings::addProcessingStatistics(COntologyProcessingStatistics* ontProcStats) { QHash* statsValueHash = ontProcStats->getProcessingCountStatisticsHash(); for (QHash::const_iterator it = statsValueHash->constBegin(), itEnd = statsValueHash->constEnd(); it != itEnd; ++it) { const QString& statString(it.key()); cint64 statValue = it.value(); incProcessingStatistics(statString,statValue); } return true; } bool CQueryStatisticsCollectionStrings::addProcessingStatistics(const QString& statName, cint64 statValue) { mStatNameStringsValueHash[statName] = statValue; return true; } bool CQueryStatisticsCollectionStrings::incProcessingStatistics(const QString& statName, cint64 incStatValue) { mStatNameStringsValueHash[statName] += incStatValue; return true; } QList CQueryStatisticsCollectionStrings::getStatisticsNameStringList() { if (!mStatStringsCollected) { CQueryCalculationStatisticsCollection* mCalcStatCollLinkerIt = mCalcStatCollLinker; while (mCalcStatCollLinkerIt) { mCalcStatCollLinkerIt->appendStatisticsStringNames(&mStatNameStrings); mCalcStatCollLinkerIt = mCalcStatCollLinkerIt->getNext(); } foreach (QString statName, mStatNameStringsValueHash.keys()) { mStatNameStrings.insert(statName); } mStatStringsCollected = true; } return mStatNameStrings.toList(); } cint64 CQueryStatisticsCollectionStrings::getStatisticIntegerValue(const QString& statName) { cint64 statValue = mStatNameStringsValueHash.value(statName,0); CQueryCalculationStatisticsCollection* mCalcStatCollLinkerIt = mCalcStatCollLinker; while (mCalcStatCollLinkerIt) { statValue += mCalcStatCollLinkerIt->getStatisticIntegerValue(statName); mCalcStatCollLinkerIt = mCalcStatCollLinkerIt->getNext(); } return statValue; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CFlattenedTypesQuery.h0000644000175000017500000000550512520551234025406 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CFLATTENEDTYPESQUERY_H #define KONCLUDE_REASONER_QUERY_CFLATTENEDTYPESQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CClassesResult.h" #include "CRealizationPremisingQuery.h" #include "CClassesResultVisitorGenerator.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CFlattenedTypesQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CFlattenedTypesQuery : public CRealizationPremisingQuery { // public methods public: //! Constructor CFlattenedTypesQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CIndividual* indi, bool direct, const QString& individualName, const QString& flatternedTypeQueryName = QString("UnnamedFlattenedTypesQuery")); //! Destructor virtual ~CFlattenedTypesQuery(); virtual CQueryResult* constructResult(CRealization* realization); virtual CClassesResult* constructClassesResult(CRealization* realization); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual bool hasError(); bool isDirect(); // protected methods protected: // protected variables protected: QString mIndividualName; CIndividual* mIndividual; QString queryName; QString queryString; bool mDirect; CClassesResult* mResult; bool mUseAbbreviatedIRIs; bool mQueryConstructError; bool mRealizationCalcError; CConfigurationBase* mCalcConfig; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CFLATTENEDTYPESQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIndividualSynsetResult.cpp0000644000175000017500000000733512520551234026460 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualSynsetResult.h" namespace Konclude { namespace Reasoner { namespace Query { CIndividualSynsetResult::CIndividualSynsetResult() { } CIndividualSynsetResult::CIndividualSynsetResult(const QString &individualName) { addEquivalentIndividualName(individualName); } CIndividualSynsetResult::CIndividualSynsetResult(const QStringList &individualNameList) { addEquivalentIndividualNames(individualNameList); } CIndividualSynsetResult::~CIndividualSynsetResult() { } QStringList CIndividualSynsetResult::getEquivalentIndividualNameList() { return eqIndividualNameList; } CIndividualSynsetResult *CIndividualSynsetResult::addEquivalentIndividualName(const QString &individualName) { eqIndividualNameList.append(individualName); return this; } CIndividualSynsetResult *CIndividualSynsetResult::addEquivalentIndividualNames(const QStringList &individualNameList) { eqIndividualNameList += individualNameList; return this; } qint64 CIndividualSynsetResult::getIndividualCount() { return eqIndividualNameList.count(); } bool CIndividualSynsetResult::hasIndividualName(const QString &individualName) { return eqIndividualNameList.contains(individualName); } bool CIndividualSynsetResult::hasIndividualNames(const QStringList &individualNameList) { QStringList remEqIndividualNameList(eqIndividualNameList); foreach (QString individualName, individualNameList) { bool contained = false; for (qint64 cnt = remEqIndividualNameList.count(); cnt > 0; --cnt) { contained |= remEqIndividualNameList.first() == individualName; if (contained) { remEqIndividualNameList.takeFirst(); break; } else { remEqIndividualNameList.append(remEqIndividualNameList.takeFirst()); } } if (!contained) { return false; } } return true; } QString CIndividualSynsetResult::getQueryResultString() { QString individualNames = eqIndividualNameList.join(", "); if (eqIndividualNameList.count() > 1) { return QString("Equivalent Individual Set '%1'").arg(individualNames); } else if (eqIndividualNameList.count() > 0) { return QString("Individual '%1'").arg(individualNames); } else { return QString("Empty Individual Set"); } } bool CIndividualSynsetResult::isResultEquivalentTo(CQueryResult *otherQueryResult) { if (!otherQueryResult) { return false; } CIndividualSynsetResult *otherIndividualSynset = dynamic_cast(otherQueryResult); if (!otherIndividualSynset) { return false; } if (getIndividualCount() != otherIndividualSynset->getIndividualCount()) { return false; } if (!hasIndividualNames(otherIndividualSynset->getEquivalentIndividualNameList())) { return false; } return true; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassSynsetsResult.h0000644000175000017500000000450412520551232025256 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CCLASSSYNSETSRESULT_H #define KONCLUDE_REASONER_QUERY_CCLASSSYNSETSRESULT_H // Libraries includes #include // Namespace includes #include "CQueryResult.h" #include "CClassSynsetResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CClassSynsetsResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassSynsetsResult : public CQueryResult { // public methods public: //! Constructor CClassSynsetsResult(); //! Destructor virtual ~CClassSynsetsResult(); virtual QString getQueryResultString(); virtual bool isResultEquivalentTo(CQueryResult *otherQueryResult); CClassSynsetResult* getClassSynset(const QString& className, bool create = true); CClassSynsetResult* getClassSynset(const QStringList& classNames, bool create = true); CClassSynsetResult* addClassSynset(CClassSynsetResult* takeClassSynset); QList* getClassSynsetList(); // protected methods protected: // protected variables protected: QList mClassSynsetContainer; QHash mClassClassSynsetHash; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CCLASSSYNSETSRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CJobProvidedQuery.cpp0000644000175000017500000000211312520551236025207 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CJobProvidedQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CJobProvidedQuery::CJobProvidedQuery() { } CJobProvidedQuery::~CJobProvidedQuery() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CDeterministicIndividualsQuery.cpp0000644000175000017500000000303112520551234027775 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDeterministicIndividualsQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CDeterministicIndividualsQuery::CDeterministicIndividualsQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, const QSet& individualSet, const QString& queryName) : CDeterministicNondeterministicIndividualsQuery(ontology,configuration,individualSet,queryName) { mQueryName = queryName; if (mQueryName.isEmpty()) { mQueryName = QString("Get Deterministic Individuals"); } mDeterministicIndividuals = true; } CDeterministicIndividualsQuery::~CDeterministicIndividualsQuery() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIndividualSynsetResult.h0000644000175000017500000000472312520551236026125 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CINDIVIDUALSYNSETRESULT_H #define KONCLUDE_REASONER_QUERY_CINDIVIDUALSYNSETRESULT_H // Libraries includes #include // Namespace includes #include "CQueryResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CIndividualSynsetResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualSynsetResult : public CQueryResult { // public methods public: //! Constructor CIndividualSynsetResult(); CIndividualSynsetResult(const QString &individualName); CIndividualSynsetResult(const QStringList &individualNameList); //! Destructor virtual ~CIndividualSynsetResult(); QStringList getEquivalentIndividualNameList(); CIndividualSynsetResult *addEquivalentIndividualName(const QString &individualName); CIndividualSynsetResult *addEquivalentIndividualNames(const QStringList &individualNameList); bool hasIndividualName(const QString &individualName); bool hasIndividualNames(const QStringList &individualNameList); qint64 getIndividualCount(); virtual QString getQueryResultString(); virtual bool isResultEquivalentTo(CQueryResult *otherQueryResult); // protected methods protected: // protected variables protected: QStringList eqIndividualNameList; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CINDIVIDUALSYNSETRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSucceedQueryResult.h0000644000175000017500000000365712520551242025232 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CSUCCEEDQUERYRESULT_H #define KONCLUDE_REASONER_QUERY_CSUCCEEDQUERYRESULT_H // Libraries includes #include "CQueryResult.h" // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CSucceedQueryResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSucceedQueryResult : public CQueryResult { // public methods public: //! Constructor CSucceedQueryResult(); //! Destructor virtual ~CSucceedQueryResult(); virtual QString getQueryResultString(); virtual bool isResultEquivalentTo(CSucceedQueryResult *otherQueryResult); virtual bool isResultEquivalentTo(CQueryResult *otherQueryResult); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CSUCCEEDQUERYRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIndividualsResult.h0000644000175000017500000000370512520551234025077 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CINDIVIDUALSRESULT_H #define KONCLUDE_REASONER_QUERY_CINDIVIDUALSRESULT_H // Libraries includes #include // Namespace includes #include "CQueryResult.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CIndividualsResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualsResult : public CQueryResult { // public methods public: //! Constructor CIndividualsResult(); virtual QString getQueryResultString(); virtual bool isResultEquivalentTo(CQueryResult *otherQueryResult); CIndividualsResult* addIndividual(const QString &individualName); QSet* getIndividualsSet(); // protected methods protected: // protected variables protected: QSet mIndividualSet; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CINDIVIDUALSRESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSaturationCalculationConstruct.h0000644000175000017500000000521112520551242027633 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CSATURATIONCALCULATIONCONSTRUCT_H #define KONCLUDE_REASONER_QUERY_CSATURATIONCALCULATIONCONSTRUCT_H // Libraries includes // Namespace includes #include "QuerySettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CIndividual.h" #include "Utilities/Container/CSortedNegLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Query { /*! * * \class CSaturationCalculationConstruct * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationCalculationConstruct : public CLinkerBase { // public methods public: //! Constructor CSaturationCalculationConstruct(); CSaturationCalculationConstruct* getNextConstruct(); CConcept* getConstructConcept(); CSaturationCalculationConstruct* setConstructConcept(CConcept* concept); bool getConstructConceptNegation(); CSaturationCalculationConstruct* setConstructConceptNegation(bool negation); CSaturationCalculationConstruct* setIndividual(CIndividual* individual); CIndividual* getIndividual(); CSaturationCalculationConstruct* setIndividualID(cint64 individualID); cint64 getIndividualID(); // protected methods protected: // protected variables protected: CConcept* mConstructConcept; bool mConstructConceptNegation; CIndividual* mIndividual; cint64 mIndiID; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CSATURATIONCALCULATIONCONSTRUCT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CJobSatisfiableResult.h0000644000175000017500000000363512520551236025511 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CJOBSATISFIABLERESULT_H #define KONCLUDE_REASONER_QUERY_CJOBSATISFIABLERESULT_H // Libraries includes // Namespace includes #include "CSatisfiableCalculationJob.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CJobSatisfiableResult * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CJobSatisfiableResult { // public methods public: //! Constructor CJobSatisfiableResult(); //! Destructor virtual ~CJobSatisfiableResult(); virtual CSatisfiableCalculationJob *getSatisfiableCalculationJob() = 0; virtual bool isSatisfiable() = 0; virtual bool hasCalculationError() = 0; virtual cint64 getCalculationErrorCode() = 0; // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CJOBSATISFIABLERESULT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryError.cpp0000644000175000017500000000206512520551240024072 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryError.h" namespace Konclude { namespace Reasoner { namespace Query { CQueryError::CQueryError() : CLinkerBase(this) { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSubClassesQuery.cpp0000644000175000017500000001040512520551242025047 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSubClassesQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CSubClassesQuery::CSubClassesQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CConcept* concept, bool direct, const QString& className, const QString& queryName) : CTaxonomyPremisingQuery(ontology,configuration) { mClassName = className; mConcept = concept; mQueryName = queryName; if (mClassName.isEmpty()) { mQueryString = QString("Get Sub Classes"); } else { mQueryString = QString("Get Sub Classes for concept '%1'").arg(mClassName); } mResult = nullptr; mUseAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.OWLlink.AbbreviatedIRIs",false); mTaxonomyCalcError = false; mQueryConstructError = false; mDirect = direct; mCalcConfig = configuration; } CSubClassesQuery::~CSubClassesQuery() { if (mResult) { delete mResult; } delete mCalcConfig; } CQueryResult* CSubClassesQuery::getQueryResult() { return mResult; } CQueryResult *CSubClassesQuery::constructResult(CTaxonomy *taxonomy) { return constructClassSynsetsResult(taxonomy); } CClassSynsetsResult *CSubClassesQuery::constructClassSynsetsResult(CTaxonomy *taxonomy) { if (mResult) { delete mResult; mResult = 0; } if (taxonomy) { CHierarchyNode* node = taxonomy->getHierarchyNode(mConcept); if (node) { mResult = new CClassSynsetsResult(); QSet* visitedHierNodeSet = nullptr; if (!mDirect) { visitedHierNodeSet = new QSet(); } QList visitHierNodetList; QSet* childNodeSet = node->getChildNodeSet(); for (QSet::const_iterator it = childNodeSet->constBegin(), itEnd = childNodeSet->constEnd(); it != itEnd; ++it) { CHierarchyNode* childNode(*it); visitHierNodetList.append(childNode); } while (!visitHierNodetList.isEmpty()) { CHierarchyNode* nextNode = visitHierNodetList.takeFirst(); CClassSynsetResult* nextSubClassSynset = new CClassSynsetResult(nextNode->getEquivalentConceptStringList(mUseAbbreviatedIRIs)); mResult->addClassSynset(nextSubClassSynset); if (!mDirect) { QSet* tmpChildNodeSet = nextNode->getChildNodeSet(); for (QSet::const_iterator it = tmpChildNodeSet->constBegin(), itEnd = tmpChildNodeSet->constEnd(); it != itEnd; ++it) { CHierarchyNode* nextChildNode(*it); if (!visitedHierNodeSet->contains(nextChildNode)) { visitedHierNodeSet->insert(nextChildNode); visitHierNodetList.append(nextChildNode); } } } } delete visitedHierNodeSet; } } return mResult; } QString CSubClassesQuery::getQueryName() { return mQueryName; } QString CSubClassesQuery::getQueryString() { return mQueryString; } bool CSubClassesQuery::hasAnswer() { return mResult != 0; } QString CSubClassesQuery::getAnswerString() { if (!mResult) { return QString("Unknown Classes"); } else { return mResult->getQueryResultString(); } } bool CSubClassesQuery::hasError() { return mTaxonomyCalcError || mQueryConstructError || CQuery::hasError(); } bool CSubClassesQuery::isDirect() { return mDirect; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSuperClassesQuery.h0000644000175000017500000000535212520551244025070 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CSUPERCLASSESQUERY_H #define KONCLUDE_REASONER_QUERY_CSUPERCLASSESQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CClassSynsetsResult.h" #include "CTaxonomyPremisingQuery.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CSuperClassesQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSuperClassesQuery : public CTaxonomyPremisingQuery { // public methods public: //! Constructor CSuperClassesQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CConcept* concept, bool direct, const QString& className, const QString& queryName = QString("UnnamedSuperClassesQuery")); //! Destructor virtual ~CSuperClassesQuery(); virtual CQueryResult* constructResult(CTaxonomy *taxonomy); virtual CClassSynsetsResult* constructClassSynsetsResult(CTaxonomy *taxonomy); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual bool hasError(); bool isDirect(); // protected methods protected: // protected variables protected: QString mClassName; CConcept* mConcept; QString mQueryName; QString mQueryString; bool mDirect; CClassSynsetsResult* mResult; bool mUseAbbreviatedIRIs; bool mQueryConstructError; bool mTaxonomyCalcError; CConfigurationBase* mCalcConfig; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CSUPERCLASSESQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CQueryResult.cpp0000644000175000017500000000206112520551240024253 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryResult.h" namespace Konclude { namespace Reasoner { namespace Query { CQueryResult::CQueryResult() { } CQueryResult::~CQueryResult() { } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CClassesResult.cpp0000644000175000017500000000355312520551232024553 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassesResult.h" namespace Konclude { namespace Reasoner { namespace Query { CClassesResult::CClassesResult() { } QString CClassesResult::getQueryResultString() { return QString(); } bool CClassesResult::isResultEquivalentTo(CQueryResult *otherQueryResult) { CClassesResult* classesResult = dynamic_cast(otherQueryResult); if (classesResult) { if (mClassSet.count() == classesResult->mClassSet.count()) { for (QSet::const_iterator it = mClassSet.constBegin(), itEnd = mClassSet.constEnd(); it != itEnd; ++it) { const QString& classString(*it); if (!classesResult->mClassSet.contains(classString)) { return false; } } return true; } } return false; } CClassesResult* CClassesResult::addClass(const QString &className) { mClassSet.insert(className); return this; } QSet* CClassesResult::getClassesSet() { return &mClassSet; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIndividualSynsetsResultVisitorGenerator.h0000644000175000017500000000550512520551236031536 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CINDIVIDUALSYNSETSRESULTVISITORGENERATOR_H #define KONCLUDE_REASONER_QUERY_CINDIVIDUALSYNSETSRESULTVISITORGENERATOR_H // Libraries includes // Namespace includes #include "CIndividualSynsetsResult.h" // Other includes #include "Reasoner/Realization/CRealization.h" #include "Reasoner/Realization/CConceptRealizationInstanceVisitor.h" #include "Reasoner/Realization/CConceptRealizationIndividualVisitor.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CAbbreviatedIRIName.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CIndividualSynsetsResultVisitorGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualSynsetsResultVisitorGenerator : public CConceptRealizationInstanceVisitor, public CConceptRealizationIndividualVisitor, public CRoleRealizationInstanceVisitor, public CRoleRealizationIndividualVisitor { // public methods public: //! Constructor CIndividualSynsetsResultVisitorGenerator(CIndividualSynsetsResult* classSynsetsResult, bool abbreviatedIRIs); virtual bool visitInstance(CConceptInstanceItem* item, CConceptRealization* conRealization); virtual bool visitRoleInstance(CRoleInstanceItem* item, CRoleRealization* roleRealization); virtual bool visitIndividual(CIndividual* individual, CConceptRealization* conRealization); virtual bool visitIndividual(CIndividual* individual, CRoleRealization* roleRealization); // protected methods protected: // protected variables protected: CIndividualSynsetsResult* mIndividualSynsetsResult; bool mAbbreviatedIRIs; CIndividualSynsetResult* mTmpIndividualSynsetResult; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CINDIVIDUALSYNSETSRESULTVISITORGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CSubClassHierarchyQuery.cpp0000644000175000017500000001054312520551242026361 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSubClassHierarchyQuery.h" namespace Konclude { namespace Reasoner { namespace Query { CSubClassHierarchyQuery::CSubClassHierarchyQuery(CConcreteOntology *premisingTaxonomyOntology, CTaxonomyPremisingQuerySupport *taxonomyQuerySupport, CConfigurationBase *configuration, const QString &superClassName, const QString &subClassHierarchyQueryName) : CTaxonomyPremisingQuery(premisingTaxonomyOntology,configuration) { className = superClassName; queryName = subClassHierarchyQueryName; if (className.isEmpty()) { queryString = QString("Get Subclass Hierarchy"); } else { queryString = QString("Get Subclass Hierarchy of class '%1'").arg(className); } result = 0; taxQuerySupport = taxonomyQuerySupport; useAbbreviatedIRIs = CConfigDataReader::readConfigBoolean(configuration,"Konclude.OWLlink.AbbreviatedIRIs",false); mTaxCalcError = false; mQueryConstructError = false; } CSubClassHierarchyQuery::~CSubClassHierarchyQuery() { if (result) { delete result; } if (taxQuerySupport) { delete taxQuerySupport; } } CQueryResult *CSubClassHierarchyQuery::getQueryResult() { return result; } CQueryResult *CSubClassHierarchyQuery::constructResult(CTaxonomy *taxonomy) { return constructSubClassHierarchyResult(taxonomy); } CClassHierarchyResult *CSubClassHierarchyQuery::constructSubClassHierarchyResult(CTaxonomy *taxonomy) { if (result) { delete result; result = 0; } CHierarchyNode *topNode = taxonomy->getTopHierarchyNode(); if (!className.isEmpty()) { topNode = taxonomy->getHierarchyNode(ontology->getConcept(className)); } CHierarchyNode *bottomNode = taxonomy->getBottomHierarchyNode(); if (topNode) { result = new CClassHierarchyResult(bottomNode->getEquivalentConceptStringList(useAbbreviatedIRIs),topNode->getEquivalentConceptStringList(useAbbreviatedIRIs)); QList processNodeList; QSet processNodeSet; processNodeList.append(topNode); while (!processNodeList.isEmpty()) { CHierarchyNode *procNode = processNodeList.takeFirst(); QSet* childNodeSet(procNode->getChildNodeSet()); foreach (CHierarchyNode *childNode, *childNodeSet) { if (childNode != bottomNode) { result->addSubClassRelation(result->getClassSynset(procNode->getEquivalentConceptStringList(useAbbreviatedIRIs)),result->getClassSynset(childNode->getEquivalentConceptStringList(useAbbreviatedIRIs))); if (!processNodeSet.contains(childNode)) { processNodeSet.insert(childNode); processNodeList.append(childNode); } } } } } return result; } QString CSubClassHierarchyQuery::getQueryName() { return queryName; } QString CSubClassHierarchyQuery::getQueryString() { return queryString; } bool CSubClassHierarchyQuery::hasAnswer() { return result != 0; } QString CSubClassHierarchyQuery::getAnswerString() { if (!result) { return QString("Unknown Subclass Hierarchy"); } else { return result->getQueryResultString(); } } CResultInterceptionData *CSubClassHierarchyQuery::getPossibleResultInterception() { return 0; } CTaxonomyPremisingQuerySupport *CSubClassHierarchyQuery::getTaxonomyQuerySupport() { return taxQuerySupport; } bool CSubClassHierarchyQuery::hasError() { return mTaxCalcError || mQueryConstructError || CQuery::hasError(); } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CIndividualClassAssertionsResult.cpp0000644000175000017500000000472712520551234030315 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualClassAssertionsResult.h" namespace Konclude { namespace Reasoner { namespace Query { CIndividualClassAssertionsResult::CIndividualClassAssertionsResult() { } QString CIndividualClassAssertionsResult::getQueryResultString() { return QString(); } bool CIndividualClassAssertionsResult::isResultEquivalentTo(CQueryResult *otherQueryResult) { CIndividualClassAssertionsResult* individualConceptAssertionsResult = dynamic_cast(otherQueryResult); if (individualConceptAssertionsResult) { if (mIndividualConceptAssertionSet.count() == individualConceptAssertionsResult->mIndividualConceptAssertionSet.count()) { for (QSet< QPair >::const_iterator it = mIndividualConceptAssertionSet.constBegin(), itEnd = mIndividualConceptAssertionSet.constEnd(); it != itEnd; ++it) { const QPair& individualConceptAssertionPairString(*it); if (!individualConceptAssertionsResult->mIndividualConceptAssertionSet.contains(individualConceptAssertionPairString)) { return false; } } return true; } } return false; } CIndividualClassAssertionsResult* CIndividualClassAssertionsResult::addIndividualConceptAssertion(const QString& individualName, const QString& conceptName) { mIndividualConceptAssertionSet.insert(QPair(individualName,conceptName)); return this; } QSet< QPair >* CIndividualClassAssertionsResult::getIndividualConceptAssertionSet() { return &mIndividualConceptAssertionSet; } }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CAreClassesEquivalentQuery.h0000644000175000017500000000373412520551230026534 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CARECLASSESEQUIVALENTQUERY_H #define KONCLUDE_REASONER_QUERY_CARECLASSESEQUIVALENTQUERY_H // Libraries includes #include // Namespace includes #include "CSatisfiableCalculationJobsQuery.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Query { /*! * * \class CAreClassesEquivalentQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAreClassesEquivalentQuery : public CSatisfiableCalculationJobsQuery { // public methods public: //! Constructor CAreClassesEquivalentQuery(QStringList classNames, const QString& queryName = QString("UnnamedAreClassesEquivalentQuery")); //! Destructor virtual ~CAreClassesEquivalentQuery(); bool areClassesEquivalent(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CARECLASSESEQUIVALENTQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CJobSatisfiableCallbackContextData.h0000644000175000017500000000503212520551236030057 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CJOBSATISFIABLECALLBACKCONTEXTDATA_H #define KONCLUDE_REASONER_QUERY_CJOBSATISFIABLECALLBACKCONTEXTDATA_H // Libraries includes // Namespace includes #include "CSatisfiableCalculationJob.h" #include "CJobSatisfiableResult.h" // Other includes #include "Concurrent/Callback/CCallbackDataContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; namespace Reasoner { namespace Query { /*! * * \class CJobSatisfiableCallbackContextData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CJobSatisfiableCallbackContextData : public CJobSatisfiableResult, public CCallbackDataContext { // public methods public: //! Constructor CJobSatisfiableCallbackContextData(CSatisfiableCalculationJob *satCalcJob); //! Destructor virtual ~CJobSatisfiableCallbackContextData(); virtual CSatisfiableCalculationJob *getSatisfiableCalculationJob(); virtual bool isSatisfiable(); virtual CJobSatisfiableCallbackContextData *setSatisfiable(bool satis); virtual bool hasCalculationError(); virtual CJobSatisfiableCallbackContextData* setCalculationError(bool error, cint64 errorCode); virtual cint64 getCalculationErrorCode(); // protected methods protected: // protected variables protected: CSatisfiableCalculationJob* mSatCalcJob; bool mSatisfiable; bool mCalcError; cint64 mErrorCode; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CJOBSATISFIABLECALLBACKCONTEXTDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CRealizationPremisingQuery.h0000644000175000017500000000530512520551242026607 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CREALIZATIONPREMISINGQUERY_H #define KONCLUDE_REASONER_QUERY_CREALIZATIONPREMISINGQUERY_H // Libraries includes // Namespace includes #include "CQuery.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Realization/CRealization.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Ontology; using namespace Realization; namespace Query { /*! * * \class CRealizationPremisingQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealizationPremisingQuery : public CQuery { // public methods public: //! Constructor CRealizationPremisingQuery(CConcreteOntology* ontology, CConfigurationBase* configuration); //! Destructor virtual ~CRealizationPremisingQuery(); virtual CConcreteOntology* getOntology(); virtual CQueryResult* constructResult(CRealization* realization) = 0; virtual CConfigurationBase* getConfiguration(); CRealizationPremisingQuery* setQueryStatistics(CQueryStatistics* stats); virtual CQueryStatistics* getQueryStatistics(); bool isConceptRealisationRequired(); bool isRoleRealisationRequired(); bool isSameIndividualRealisationRequired(); // protected methods protected: // protected variables protected: CConcreteOntology* mOntology; CConfigurationBase* mConfig; CQueryStatistics* mQueryStats; bool mRequiresConceptRealisation; bool mRequiresRoleRealisation; bool mRequiresSameIndividualRealisation; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CREALIZATIONPREMISINGQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Query/CEquivalentClassesQuery.h0000644000175000017500000000531212520551234026102 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_QUERY_CEQUIVALENTCLASSESQUERY_H #define KONCLUDE_REASONER_QUERY_CEQUIVALENTCLASSESQUERY_H // Libraries includes #include // Namespace includes #include "CQuery.h" #include "CClassSetResult.h" #include "CTaxonomyPremisingQuery.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Query { /*! * * \class CEquivalentClassesQuery * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEquivalentClassesQuery : public CTaxonomyPremisingQuery { // public methods public: //! Constructor CEquivalentClassesQuery(CConcreteOntology* ontology, CConfigurationBase* configuration, CConcept* concept, const QString& className, const QString& queryName = QString("UnnamedEquivalentClassesQuery")); //! Destructor virtual ~CEquivalentClassesQuery(); virtual CQueryResult* constructResult(CTaxonomy *taxonomy); virtual CClassSetResult* constructClassesResult(CTaxonomy *taxonomy); virtual QString getQueryName(); virtual QString getQueryString(); virtual bool hasAnswer(); virtual QString getAnswerString(); virtual CQueryResult* getQueryResult(); virtual bool hasError(); // protected methods protected: // protected variables protected: QString mClassName; CConcept* mConcept; QString mQueryName; QString mQueryString; CClassSetResult* mResult; bool mUseAbbreviatedIRIs; bool mQueryConstructError; bool mTaxonomyCalcError; CConfigurationBase* mCalcConfig; // private methods private: // private variables private: }; }; // end namespace Query }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_QUERY_CEQUIVALENTCLASSESQUERY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/0000755000175000017500000000000012613407252021770 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyInverseRoleBuilder.h0000644000175000017500000000566112520550776031245 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYINVERSEROLEBUILDER_H #define KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYINVERSEROLEBUILDER_H // Libraries includes #include // Namespace includes // Other includes #include "Reasoner/Ontology/CBoxContext.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CRoleDependence.h" #include "Reasoner/Ontology/CMBox.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Preprocess/CConceptRoleIndividualLocator.h" #include "Utilities/CDynamicExpandingMemoryManager.hpp" #include "Utilities/CSortedNegLinker.hpp" #include "Parser/Expressions/CInverseObjectPropertyOfExpression.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Parser::Expression; namespace Reasoner { using namespace Preprocess; namespace Generator { /*! * * \class CConcreteOntologyInverseRoleBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteOntologyInverseRoleBuilder { // public methods public: //! Constructor CConcreteOntologyInverseRoleBuilder(); //! Destructor virtual ~CConcreteOntologyInverseRoleBuilder(); static CRole* createInverseRoleDelayed(CRole* role, QHash* roleInverseRoleCreateHash, CConcreteOntology* onto); static bool createDelayedInverseRoles(QHash* roleInverseRoleCreateHash, CConcreteOntology* onto); static CRole* createInverseRole(CRole* role, CConcreteOntology* onto); static CRole* getLocalizedRole(CRole* role, CConcreteOntology* onto); static CRole* getLocalizedRole(cint64 roleTag, CConcreteOntology* onto); static bool hasInverseRole(CRole* role, bool searchInverseEquivalent = true); static CRole* getInverseRole(CRole* role, bool searchInverseEquivalent = true); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYINVERSEROLEBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyQueryExtendedBuilder.cpp0000644000175000017500000005260012520550776032124 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteOntologyQueryExtendedBuilder.h" namespace Konclude { namespace Reasoner { namespace Generator { CConcreteOntologyQueryExtendedBuilder::CConcreteOntologyQueryExtendedBuilder(CConcreteOntology* ontology, CConfigurationBase *configuration, COntologyBuilder* ontologyBuilder) : CConcreteOntologyQueryBasicBuilder(ontology,configuration) { mOntologyBuilder = ontologyBuilder; } CConcreteOntologyQueryExtendedBuilder::~CConcreteOntologyQueryExtendedBuilder() { } CQueryIsEntailedExpression* CConcreteOntologyQueryExtendedBuilder::getIsEntailedQuery(const CEXPRESSIONLIST& testAxiomExpressions, const QString& queryName) { CQueryIsEntailedExpression *classEqExp = new CQueryIsEntailedExpression(queryName,testAxiomExpressions); for (CEXPRESSIONLIST::const_iterator axiomIt = testAxiomExpressions.constBegin(), axiomEndIt = testAxiomExpressions.constEnd(); axiomIt != axiomEndIt; ++axiomIt) { CAxiomExpression* axiom = *axiomIt; bool queryForAxiomCreated = false; CSubClassOfExpression* subClassAxiom = dynamic_cast(axiom); if (subClassAxiom) { CEntailmentAxiomExpressionAssociation* entAxiomExpAss = new CEntailmentAxiomExpressionAssociation(axiom); CClassTermExpression* subClassExp = subClassAxiom->getSubClassTermExpression(); CClassTermExpression* superClassExp = subClassAxiom->getSuperClassTermExpression(); CClassTermExpression* negSuperClassExp = mOntologyBuilder->getObjectComplementOf(superClassExp); CClassTermExpression* buildExp = mOntologyBuilder->getObjectIntersectionOf(CEXPRESSIONLIST()<addConstructedTestClass(buildExp); classEqExp->addConstructedTestAxiomExpressions(entAxiomExpAss); queryForAxiomCreated = true; } CEquivalentClassesExpression* equivClassAxiom = dynamic_cast(axiom); if (equivClassAxiom) { CEXPRESSIONLIST* equivClassesList = equivClassAxiom->getClassTermExpressionList(); CEXPRESSIONLIST::const_iterator clItFirst = equivClassesList->constBegin(); CEXPRESSIONLIST::const_iterator clItNext = clItFirst; CEXPRESSIONLIST::const_iterator clItLast = clItNext; ++clItNext; for (CEXPRESSIONLIST::const_iterator clItEnd = equivClassesList->constEnd(); clItNext != clItEnd; ++clItNext) { clItLast = clItNext; CEntailmentAxiomExpressionAssociation* entAxiomExpAss = new CEntailmentAxiomExpressionAssociation(axiom); CClassTermExpression* classExp1 = *clItLast; CClassTermExpression* classExp2 = *clItNext; CClassTermExpression* negSuperClassExp = mOntologyBuilder->getObjectComplementOf(classExp2); CClassTermExpression* buildExp = mOntologyBuilder->getObjectIntersectionOf(CEXPRESSIONLIST()<addConstructedTestClass(buildExp); classEqExp->addConstructedTestAxiomExpressions(entAxiomExpAss); } CEntailmentAxiomExpressionAssociation* entAxiomExpAss = new CEntailmentAxiomExpressionAssociation(axiom); CClassTermExpression* classExp1 = *clItLast; CClassTermExpression* classExp2 = *clItFirst; CClassTermExpression* negSuperClassExp = mOntologyBuilder->getObjectComplementOf(classExp2); CClassTermExpression* buildExp = mOntologyBuilder->getObjectIntersectionOf(CEXPRESSIONLIST()<addConstructedTestClass(buildExp); classEqExp->addConstructedTestAxiomExpressions(entAxiomExpAss); queryForAxiomCreated = true; } CObjectPropertyDomainExpression* objPropDomainAxiom = dynamic_cast(axiom); if (objPropDomainAxiom) { CEntailmentAxiomExpressionAssociation* entAxiomExpAss = new CEntailmentAxiomExpressionAssociation(axiom); CClassTermExpression* domainClassExp = objPropDomainAxiom->getClassTermExpression(); CObjectPropertyTermExpression* objPropExp = objPropDomainAxiom->getObjectPropertyTermExpression(); CClassTermExpression* negDomainClassExp = mOntologyBuilder->getObjectComplementOf(domainClassExp); CClassTermExpression* topClassExp = mOntologyBuilder->getTopClass(); CClassTermExpression* someObjPropExp = mOntologyBuilder->getObjectSomeValuesFrom(objPropExp,topClassExp); CClassTermExpression* buildExp = mOntologyBuilder->getObjectIntersectionOf(CEXPRESSIONLIST()<addConstructedTestClass(buildExp); classEqExp->addConstructedTestAxiomExpressions(entAxiomExpAss); queryForAxiomCreated = true; } CObjectPropertyRangeExpression* objPropRangeAxiom = dynamic_cast(axiom); if (objPropRangeAxiom) { CEntailmentAxiomExpressionAssociation* entAxiomExpAss = new CEntailmentAxiomExpressionAssociation(axiom); CClassTermExpression* rangeClassExp = objPropRangeAxiom->getClassTermExpression(); CObjectPropertyTermExpression* objPropExp = objPropRangeAxiom->getObjectPropertyTermExpression(); CClassTermExpression* negRangeClassExp = mOntologyBuilder->getObjectComplementOf(rangeClassExp); CClassTermExpression* buildExp = mOntologyBuilder->getObjectSomeValuesFrom(objPropExp,negRangeClassExp); entAxiomExpAss->addConstructedTestClass(buildExp); classEqExp->addConstructedTestAxiomExpressions(entAxiomExpAss); queryForAxiomCreated = true; } CClassAssertionExpression* classAssAxiom = dynamic_cast(axiom); if (classAssAxiom) { CEntailmentAxiomExpressionAssociation* entAxiomExpAss = new CEntailmentAxiomExpressionAssociation(axiom,CEntailmentAxiomExpressionAssociation::EAECTAXIOMSPESIFIC); classEqExp->addConstructedTestAxiomExpressions(entAxiomExpAss); queryForAxiomCreated = true; } if (!queryForAxiomCreated) { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Ignoring not supported axiom type for IsEntailed-Query '%1'.").arg(queryName),this); } } container.append(classEqExp); isEntailedExpList.append(classEqExp); return classEqExp; } CQueryAreClassesEquivalentExpression *CConcreteOntologyQueryExtendedBuilder::getAreClassesEquivalenceQuery(const CEXPRESSIONLIST &testClassExpressions, const QString& queryName) { CQueryAreClassesEquivalentExpression *classEqExp = new CQueryAreClassesEquivalentExpression(queryName,testClassExpressions); for (CEXPRESSIONLIST::const_iterator it0 = testClassExpressions.constBegin(); it0 != testClassExpressions.constEnd(); ++it0) { CEXPRESSIONLIST::const_iterator it1 = it0; if (++it1 == testClassExpressions.constEnd()) { it1 = testClassExpressions.constBegin(); } CClassTermExpression *buildExp1 = *it0; CClassTermExpression *buildExp2 = *it1; CClassTermExpression *compBuildExp1 = mOntologyBuilder->getObjectComplementOf(buildExp1); CEXPRESSIONLIST intersectExpressionsList; intersectExpressionsList.append(compBuildExp1); intersectExpressionsList.append(buildExp2); CClassTermExpression *intersectionCompBuildExp1AndBuildExp2 = mOntologyBuilder->getObjectIntersectionOf(intersectExpressionsList); classEqExp->addConstructedTestClass(intersectionCompBuildExp1AndBuildExp2); } container.append(classEqExp); classEqExpList.append(classEqExp); return classEqExp; } CQueryAreClassesDisjointExpression *CConcreteOntologyQueryExtendedBuilder::getAreClassesDisjointQuery(const CEXPRESSIONLIST &testClassExpressions, const QString& queryName) { CQueryAreClassesDisjointExpression *classEqExp = new CQueryAreClassesDisjointExpression(queryName,testClassExpressions); for (CEXPRESSIONLIST::const_iterator it0 = testClassExpressions.constBegin(); it0 != testClassExpressions.constEnd(); ++it0) { for (CEXPRESSIONLIST::const_iterator it1 = it0; it1 != testClassExpressions.constEnd(); ++it1) { CClassTermExpression *buildExp1 = *it0; CClassTermExpression *buildExp2 = *it1; CEXPRESSIONLIST intersectExpressionsList; intersectExpressionsList.append(buildExp1); intersectExpressionsList.append(buildExp2); CClassTermExpression *intersectionBuildExp1AndBuildExp2 = mOntologyBuilder->getObjectIntersectionOf(intersectExpressionsList); classEqExp->addConstructedTestClass(intersectionBuildExp1AndBuildExp2); } } container.append(classEqExp); classDisjointExpList.append(classEqExp); return classEqExp; } CQueryIsClassSubsumedByExpression *CConcreteOntologyQueryExtendedBuilder::getIsClassSubsumedByQuery(CClassTermExpression* subsumerClassExpression, CClassTermExpression* subsumedClassExpression, const QString& queryName) { CQueryIsClassSubsumedByExpression* classEqExp = new CQueryIsClassSubsumedByExpression(queryName,subsumerClassExpression,subsumedClassExpression); CClassTermExpression *compBuildExp2 = mOntologyBuilder->getObjectComplementOf(subsumedClassExpression); CEXPRESSIONLIST intersectExpressionsList; intersectExpressionsList.append(compBuildExp2); intersectExpressionsList.append(subsumerClassExpression); CClassTermExpression *intersectionBuildExp1AndCompBuildExp2 = mOntologyBuilder->getObjectIntersectionOf(intersectExpressionsList); classEqExp->setConstructedTestClassExpression(intersectionBuildExp1AndCompBuildExp2); container.append(classEqExp); classSubsumedExpList.append(classEqExp); return classEqExp; } QList CConcreteOntologyQueryExtendedBuilder::generateQuerys() { QList queryList; CSatisfiableCalculationJobGenerator* satCalcJobGenerator = new CSatisfiableCalculationJobGenerator(mOntology); bool confBuildQueryStats = CConfigDataReader::readConfigBoolean(config,"Konclude.Query.Statistics.CollectStatistics",false); foreach (CQueryAreClassesEquivalentExpression *classEqExp, classEqExpList) { QString queryName = classEqExp->getName(); QStringList conceptNamesStrings; foreach (CClassTermExpression *buildExp, *classEqExp->getClassTermExpressionList()) { CConcept *concept = getConceptFromBuildExpression(buildExp); if (concept) { QString className = getStringFromConcept(concept); conceptNamesStrings.append(className); } } CAreClassesEquivalentQuery *query = new CAreClassesEquivalentQuery(conceptNamesStrings,queryName); CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } foreach (CClassTermExpression *buildExp, *classEqExp->getConstructedTestClasses()) { CConcept *concept = getConceptFromBuildExpression(buildExp); if (concept) { CSatisfiableCalculationJob* satCalcJob = satCalcJobGenerator->getSatisfiableCalculationJob(concept,concept->hasMappingNegation()); if (confBuildQueryStats) { satCalcJob->setCalclulationStatisticsCollector(queryStats->createCalculationStatisticsCollection()); } satCalcJob->setCalculationConfiguration(calcConfig); query->addTestSatisfiableCalculationJob(satCalcJob,false); } } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated AreClassesEquivalent-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); delete classEqExp; } foreach (CQueryAreClassesDisjointExpression *classDisjExp, classDisjointExpList) { QString queryName = classDisjExp->getName(); QStringList conceptNamesStrings; foreach (CClassTermExpression *buildExp, *classDisjExp->getClassTermExpressionList()) { CConcept *concept = getConceptFromBuildExpression(buildExp); if (concept) { QString className = getStringFromConcept(concept); conceptNamesStrings.append(className); } } CAreClassesDisjointQuery *query = new CAreClassesDisjointQuery(conceptNamesStrings,queryName); CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } foreach (CClassTermExpression *buildExp, *classDisjExp->getConstructedTestClasses()) { CConcept *concept = getConceptFromBuildExpression(buildExp); if (concept) { CSatisfiableCalculationJob* satCalcJob = satCalcJobGenerator->getSatisfiableCalculationJob(concept,concept->hasMappingNegation()); if (confBuildQueryStats) { satCalcJob->setCalclulationStatisticsCollector(queryStats->createCalculationStatisticsCollection()); } satCalcJob->setCalculationConfiguration(calcConfig); query->addTestSatisfiableCalculationJob(satCalcJob,false); } } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated AreClassesDisjoint-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); delete classDisjExp; } foreach (CQueryIsClassSubsumedByExpression *classSubsumedExp, classSubsumedExpList) { QString queryName = classSubsumedExp->getName(); QString subsumedClassName; QString subsummerClassName; CConcept *subsumedConcept = 0; CConcept *subsumerConcept = 0; subsumedConcept = getConceptFromBuildExpression(classSubsumedExp->getSubsumedClassExpression()); subsumerConcept = getConceptFromBuildExpression(classSubsumedExp->getSubsumerClassExpression()); subsumedClassName = getStringFromConcept(subsumedConcept); subsummerClassName = getStringFromConcept(subsumerConcept); CConcept *concept = getConceptFromBuildExpression(classSubsumedExp->getConstructedTestClassExpression()); CIsClassSubsumedByQuery *query = new CIsClassSubsumedByQuery(subsumedClassName,subsummerClassName,queryName); CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CSatisfiableCalculationJob* satCalcJob = satCalcJobGenerator->getSatisfiableCalculationJob(concept,concept->hasMappingNegation()); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); satCalcJob->setCalclulationStatisticsCollector(queryStats->createCalculationStatisticsCollection()); } query->setQueryStatistics(queryStats); satCalcJob->setCalculationConfiguration(calcConfig); query->addTestSatisfiableCalculationJob(satCalcJob,false); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated IsClassSubsemedBy-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); delete classSubsumedExp; } foreach (CQueryIsEntailedExpression *isEntailedExp, isEntailedExpList) { QString queryName = isEntailedExp->getName(); QStringList axiomTypeNameStrings; QSet axiomTypeNameStringSet; CEXPRESSIONLIST* entAxExpAssList = isEntailedExp->getConstructedTestAxiomExpressions(); foreach (CEntailmentAxiomExpressionAssociation* entAxiExpAss, *entAxExpAssList) { CAxiomExpression* axiomExpression = entAxiExpAss->getAxiomExpression(); CSubClassOfExpression* subClassAxiom = dynamic_cast(axiomExpression); if (subClassAxiom) { if (!axiomTypeNameStringSet.contains("SubClassOf")) { axiomTypeNameStringSet.insert("SubClassOf"); axiomTypeNameStrings += QString("SubClassOf"); } } CEquivalentClassesExpression* equivClassAxiom = dynamic_cast(axiomExpression); if (equivClassAxiom) { if (!axiomTypeNameStringSet.contains("EquivalentClasses")) { axiomTypeNameStringSet.insert("EquivalentClasses"); axiomTypeNameStrings += QString("EquivalentClasses"); } } CObjectPropertyDomainExpression* objPropDomainAxiom = dynamic_cast(axiomExpression); if (objPropDomainAxiom) { if (!axiomTypeNameStringSet.contains("ObjectPropertyDomain")) { axiomTypeNameStringSet.insert("ObjectPropertyDomain"); axiomTypeNameStrings += QString("ObjectPropertyDomain"); } } CObjectPropertyRangeExpression* objPropRangeAxiom = dynamic_cast(axiomExpression); if (objPropRangeAxiom) { if (!axiomTypeNameStringSet.contains("ObjectPropertyRange")) { axiomTypeNameStringSet.insert("ObjectPropertyRange"); axiomTypeNameStrings += QString("ObjectPropertyRange"); } } CClassAssertionExpression* classAssAxiom = dynamic_cast(axiomExpression); if (classAssAxiom) { if (!axiomTypeNameStringSet.contains("ClassAssertion")) { axiomTypeNameStringSet.insert("ClassAssertion"); axiomTypeNameStrings += QString("ClassAssertion"); } } } CAreAxiomsEntailedQuery *query = new CAreAxiomsEntailedQuery(axiomTypeNameStrings,queryName); CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } foreach (CEntailmentAxiomExpressionAssociation* entAxiExpAss, *entAxExpAssList) { CAxiomExpression* axiomExpression = entAxiExpAss->getAxiomExpression(); CEntailmentAxiomExpressionAssociation::ENTAILMENTAXIOMEXPRESSIONCONSTRUCTIONTYPE constructionType = entAxiExpAss->getConstructionType(); if (constructionType == CEntailmentAxiomExpressionAssociation::EAECTCONCEPTSATISFIABILITY) { CConcept* concept = getConceptFromBuildExpression(entAxiExpAss->takeNextConstructedTestClass()); if (concept) { CSatisfiableCalculationJob* satCalcJob = satCalcJobGenerator->getSatisfiableCalculationJob(concept,concept->hasMappingNegation()); if (confBuildQueryStats) { satCalcJob->setCalclulationStatisticsCollector(queryStats->createCalculationStatisticsCollection()); } satCalcJob->setCalculationConfiguration(calcConfig); query->addTestSatisfiableCalculationJob(satCalcJob,false); } } else if (constructionType == CEntailmentAxiomExpressionAssociation::EAECTAXIOMSPESIFIC) { CClassAssertionExpression* classAssAxiom = dynamic_cast(axiomExpression); if (classAssAxiom) { CIndividual* individual = getIndividualFromBuildExpression(classAssAxiom->getIndividualTermExpression()); CConcept* concept = getConceptFromBuildExpression(classAssAxiom->getClassTermExpression()); if (concept && individual) { CSatisfiableCalculationJob* satCalcJob = satCalcJobGenerator->getSatisfiableCalculationJob(concept,!concept->hasMappingNegation(),individual); if (confBuildQueryStats) { satCalcJob->setCalclulationStatisticsCollector(queryStats->createCalculationStatisticsCollection()); } satCalcJob->setCalculationConfiguration(calcConfig); query->addTestSatisfiableCalculationJob(satCalcJob,false); } } } } query->setQueryStatistics(queryStats); if (!query->getJobList().isEmpty()) { queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated AreEntailed-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Failed to generate AreEntailed-Query '%1'.").arg(query->getQueryName()),this); delete isEntailedExp; } delete satCalcJobGenerator; queryList.append(CConcreteOntologyQueryBasicBuilder::generateQuerys()); return queryList; } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyBuildDataUpdater.h0000644000175000017500000007367612520550774030670 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYBUILDDATAUPDATER_H #define KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYBUILDDATAUPDATER_H // Libraries includes #include #include #include #include // Namespace includes #include "CExpressionSplitter.h" #include "CExpressionHasher.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CTBox.h" #include "Reasoner/Ontology/CABox.h" #include "Reasoner/Ontology/CRBox.h" #include "Reasoner/Ontology/CAbbreviatedIRIName.h" #include "Reasoner/Ontology/CIRIName.h" #include "Utilities/CTrible.hpp" #include "Utilities/CNegLinker.hpp" #include "Utilities/CHashableIntConvertedNTuble.hpp" #include "Utilities/CMemoryManager.hpp" #include "Utilities/CDynamicExpandingMemoryManager.hpp" #include "Utilities/Memory/CObjectAllocator.h" #include "Parser/COntologyBuilder.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Memory; using namespace Parser; namespace Reasoner { using namespace Ontology; namespace Generator { /*! * * \class CConcreteOntologyBuildDataUpdater * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteOntologyBuildDataUpdater : public COntologyBuilder { // public methods public: CConcreteOntologyBuildDataUpdater(CConcreteOntology* updateConcreteOntology); virtual bool initializeBuilding(); virtual bool completeBuilding(); virtual cint64 getAxiomNumber(); virtual bool addNameAbbreviation(const QString &name, const QString &abbreviatedName); virtual QString resolveAbbreviationName(const QString& name); virtual QString resolveAbbreviationName(const QStringRef& name); virtual QString getOntologyName(); virtual CDeclarationAxiomExpression* getDeclaration(const CEXPRESSIONLIST& expressions); virtual CDeclarationAxiomExpression* getDeclaration(CBuildExpression* buildExpression); virtual CDeclarationAxiomExpression* getDeclaration(CExpressionEntity* entity); virtual bool addOntologyImport(const QStringRef& name); virtual bool addOntologyImport(const QString& name); // virtual methods from CTBoxAxiomBuilder virtual CClassExpression* getClass(const QString& className); virtual CClassExpression* getClass(const QStringRef& className); virtual CClassTermExpression* getTopClass(); virtual CClassTermExpression* getBottomClass(); virtual CObjectIndividualVariableExpression* getIndividualVariable(const QString &individualVariableName, cint64 axiomNumber); virtual CObjectIndividualVariableExpression* getIndividualVariable(const QStringRef &individualVariableName, cint64 axiomNumber); virtual CDataLiteralExpression* getDataLiteral(CDataLexicalValueExpression* dataLexicalValue, CDatatypeExpression* datatype); virtual CDatatypeExpression* getDatatype(const QString& datatypeName); virtual CDatatypeExpression* getDatatype(const QStringRef& datatypeName); virtual CDataLexicalValueExpression* getDataLexicalValue(const QString& dataLexicalValue); virtual CDataLexicalValueExpression* getDataLexicalValue(const QStringRef& dataLexicalValue); virtual CDataPropertyExpression* getDataProberty(const QString& dataPropertyName); virtual CDataPropertyExpression* getDataProberty(const QStringRef& dataPropertyName); virtual CDataFacetExpression* getDataFacet(const QString& dataFacetIRI); virtual CDataFacetExpression* getDataFacet(const QStringRef& dataFacetIRI); virtual CDataFacetRestrictionExpression* getDataFacetRestriction(const CEXPRESSIONLIST& expressions); virtual CDataFacetRestrictionExpression* getDataFacetRestriction(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataFacetRestrictionExpression* getDataFacetRestriction(CDataLiteralExpression* dataLiteralExpression, CDataFacetExpression* dataFacet); virtual CDataHasValueExpression* getDataHasValue(const CEXPRESSIONLIST& expressions); virtual CDataHasValueExpression* getDataHasValue(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataSomeValuesFromExpression* getDataSomeValuesFrom(const CEXPRESSIONLIST& expressions); virtual CDataSomeValuesFromExpression* getDataSomeValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataAllValuesFromExpression* getDataAllValuesFrom(const CEXPRESSIONLIST& expressions); virtual CDataAllValuesFromExpression* getDataAllValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataIntersectionOfExpression* getDataIntersectionOf(const CEXPRESSIONLIST& expressions); virtual CDataIntersectionOfExpression* getDataIntersectionOf(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataOneOfExpression* getDataOneOf(const CEXPRESSIONLIST& expressions); virtual CDataOneOfExpression* getDataOneOf(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataUnionOfExpression* getDataUnionOf(const CEXPRESSIONLIST& expressions); virtual CDataUnionOfExpression* getDataUnionOf(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataComplementOfExpression* getDataComplementOf(const CEXPRESSIONLIST& expressions); virtual CDataComplementOfExpression* getDataComplementOf(CBuildExpression* expression); virtual CDatatypeRestrictionExpression* getDatatypeRestriction(const CEXPRESSIONLIST& expressions); virtual CDatatypeRestrictionExpression* getDatatypeRestriction(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataMaxCardinalityExpression* getDataMaxCardinality(const CEXPRESSIONLIST& expressions, int cardinality); virtual CDataMaxCardinalityExpression* getDataMaxCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality); virtual CDataMinCardinalityExpression* getDataMinCardinality(const CEXPRESSIONLIST& expressions, int cardinality); virtual CDataMinCardinalityExpression* getDataMinCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality); virtual CDataExactCardinalityExpression* getDataExactCardinality(const CEXPRESSIONLIST& expressions, int cardinality); virtual CDataExactCardinalityExpression* getDataExactCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality); virtual CDataPropertyAssertionExpression* getDataPropertyAssertion(const CEXPRESSIONLIST& expressions); virtual CDataPropertyAssertionExpression* getDataPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3); virtual CNegativeDataPropertyAssertionExpression* getNegativeDataPropertyAssertion(const CEXPRESSIONLIST& expressions); virtual CNegativeDataPropertyAssertionExpression* getNegativeDataPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3); virtual CEquivalentClassesExpression* getEquivalentClasses(const CEXPRESSIONLIST& expressions); virtual CEquivalentClassesExpression* getEquivalentClasses(CBuildExpression* expression1, CBuildExpression* expression2); virtual CSubClassOfExpression* getSubClassOf(const CEXPRESSIONLIST& expressions); virtual CSubClassOfExpression* getSubClassOf(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDisjointClassesExpression* getDisjointClasses(const CEXPRESSIONLIST& expressions); virtual CDisjointUnionExpression *getDisjointUnion(const CEXPRESSIONLIST &expressions); virtual CObjectComplementOfExpression* getObjectComplementOf(CBuildExpression* expression); virtual CObjectComplementOfExpression* getObjectComplementOf(const CEXPRESSIONLIST& expressions); virtual CObjectIntersectionOfExpression* getObjectIntersectionOf(const CEXPRESSIONLIST& expressions); virtual CObjectUnionOfExpression* getObjectUnionOf(const CEXPRESSIONLIST& expressions); virtual CObjectMaxCardinalityExpression* getObjectMaxCardinality(const CEXPRESSIONLIST& expressions, int cardinality); virtual CObjectMaxCardinalityExpression* getObjectMaxCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality); virtual CObjectMinCardinalityExpression* getObjectMinCardinality(const CEXPRESSIONLIST& expressions, int cardinality); virtual CObjectMinCardinalityExpression* getObjectMinCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality); virtual CObjectExactlyCardinalityExpression* getObjectExactlyCardinality(const CEXPRESSIONLIST& expressions, int cardinality); virtual CObjectExactlyCardinalityExpression* getObjectExactlyCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality); virtual CObjectAllValuesFromExpression* getObjectAllValuesFrom(const CEXPRESSIONLIST& expressions); virtual CObjectAllValuesFromExpression* getObjectAllValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2); virtual CObjectSomeValuesFromExpression* getObjectSomeValuesFrom(const CEXPRESSIONLIST& expressions); virtual CObjectSomeValuesFromExpression* getObjectSomeValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2); virtual CObjectOneOfExpression *getObjectOneOf(const CEXPRESSIONLIST &expressions); virtual CObjectOneOfExpression *getObjectOneOf(CBuildExpression *expression); virtual CObjectHasValueExpression *getObjectHasValue(const CEXPRESSIONLIST &expressions); virtual CObjectHasValueExpression *getObjectHasValue(CBuildExpression *expression1, CBuildExpression *expression2); virtual CObjectHasSelfExpression *getObjectHasSelf(const CEXPRESSIONLIST &expressions); virtual CObjectHasSelfExpression *getObjectHasSelf(CBuildExpression *expression); virtual CEquivalentClassesExpression* getEquivalentClasses(const CEXPRESSIONLIST& expressions); virtual CSubClassOfExpression* getSubClassOf(CClassTermExpression* expression1, CClassTermExpression* expression2); virtual CDisjointClassesExpression* getDisjointClasses(const CEXPRESSIONLIST& expressions); virtual CDisjointUnionExpression *getDisjointUnion(CClassExpression* classExpression, const CEXPRESSIONLIST& expressions); virtual CObjectComplementOfExpression* getObjectComplementOf(CClassTermExpression* expression); virtual CObjectIntersectionOfExpression* getObjectIntersectionOf(const CEXPRESSIONLIST& expressions); virtual CObjectUnionOfExpression* getObjectUnionOf(const CEXPRESSIONLIST& expressions); virtual CObjectMaxCardinalityExpression* getObjectMaxCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality); virtual CObjectMinCardinalityExpression* getObjectMinCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality); virtual CObjectExactlyCardinalityExpression* getObjectExactlyCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality); virtual CObjectAllValuesFromExpression* getObjectAllValuesFrom(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2); virtual CObjectSomeValuesFromExpression* getObjectSomeValuesFrom(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2); virtual CObjectOneOfExpression *getObjectOneOf(const CEXPRESSIONLIST &expressions); virtual CObjectOneOfExpression *getObjectOneOf(CIndividualTermExpression* expression); virtual CObjectHasValueExpression *getObjectHasValue(CObjectPropertyTermExpression *expression1, CIndividualTermExpression *expression2); virtual CObjectHasSelfExpression *getObjectHasSelf(CObjectPropertyTermExpression *expression); virtual CDataHasValueExpression* getDataHasValue(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2); virtual CDataSomeValuesFromExpression* getDataSomeValuesFrom(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2); virtual CDataAllValuesFromExpression* getDataAllValuesFrom(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2); virtual CDataIntersectionOfExpression* getDataIntersectionOf(const CEXPRESSIONLIST& expressions); virtual CDataOneOfExpression* getDataOneOf(const CEXPRESSIONLIST& expressions); virtual CDataUnionOfExpression* getDataUnionOf(const CEXPRESSIONLIST& expressions); virtual CDataComplementOfExpression* getDataComplementOf(CDataRangeTermExpression* expressions); virtual CDatatypeRestrictionExpression* getDatatypeRestriction(CDatatypeExpression* datatypeExpression, const CEXPRESSIONLIST& expressions); virtual CDataMaxCardinalityExpression* getDataMaxCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality); virtual CDataMinCardinalityExpression* getDataMinCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality); virtual CDataExactCardinalityExpression* getDataExactCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality); virtual CDataRangeTermExpression* getTopDataRange(); virtual CDataRangeTermExpression* getBottomDataRange(); // virtual methods from CRBoxAxiomBuilder virtual CObjectPropertyExpression* getObjectProberty(const QString& probertyName); virtual CObjectPropertyExpression* getObjectProberty(const QStringRef& probertyName); virtual CObjectPropertyTermExpression* getTopObjectProberty(); virtual CSubObjectPropertyOfExpression* getSubObjectPropertyOf(const CEXPRESSIONLIST& expressions); virtual CSubObjectPropertyOfExpression* getSubObjectPropertyOf(CBuildExpression* expression1, CBuildExpression* expression2); virtual CObjectPropertyDomainExpression* getObjectPropertyDomainExpression(CBuildExpression* expression1, CBuildExpression* expression2); virtual CObjectPropertyDomainExpression* getObjectPropertyDomainExpression(const CEXPRESSIONLIST& expressions); virtual CObjectPropertyRangeExpression* getObjectPropertyRangeExpression(CBuildExpression* expression1, CBuildExpression* expression2); virtual CObjectPropertyRangeExpression* getObjectPropertyRangeExpression(const CEXPRESSIONLIST& expressions); virtual CInverseObjectPropertiesExpression* getInverseObjectProperties(const CEXPRESSIONLIST& expressions); virtual CInverseObjectPropertiesExpression* getInverseObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2); virtual CTransetiveObjectPropertyExpression* getTransetiveObjectProperty(const CEXPRESSIONLIST& expressions); virtual CTransetiveObjectPropertyExpression* getTransetiveObjectProperty(CBuildExpression* expression); virtual CFunctionalObjectPropertyExpression* getFunctionalObjectProperty(const CEXPRESSIONLIST& expressions); virtual CFunctionalObjectPropertyExpression* getFunctionalObjectProperty(CBuildExpression* expression); virtual CInverseFunctionalObjectPropertyExpression* getInverseFunctionalObjectProperty(const CEXPRESSIONLIST& expressions); virtual CInverseFunctionalObjectPropertyExpression* getInverseFunctionalObjectProperty(CBuildExpression* expression); virtual CInverseObjectPropertyOfExpression* getInverseObjectPropertyOf(const CEXPRESSIONLIST& expressions); virtual CInverseObjectPropertyOfExpression* getInverseObjectPropertyOf(CBuildExpression* expression); virtual CObjectPropertyChainExpression* getObjectPropertyChain(const CEXPRESSIONLIST& expressions); virtual CObjectPropertyChainExpression* getObjectPropertyChain(CBuildExpression* expression1, CBuildExpression* expression2); virtual CEquivalentObjectPropertiesExpression* getEquivalentObjectProperties(const CEXPRESSIONLIST& expressions); virtual CEquivalentObjectPropertiesExpression* getEquivalentObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDisjointObjectPropertiesExpression* getDisjointObjectProperties(const CEXPRESSIONLIST& expressions); virtual CDisjointObjectPropertiesExpression* getDisjointObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2); virtual CSymmetricObjectPropertyExpression* getSymmetricObjectProperty(const CEXPRESSIONLIST& expressions); virtual CSymmetricObjectPropertyExpression* getSymmetricObjectProperty(CBuildExpression* expression); virtual CAsymmetricObjectPropertyExpression* getAsymmetricObjectProperty(const CEXPRESSIONLIST& expressions); virtual CAsymmetricObjectPropertyExpression* getAsymmetricObjectProperty(CBuildExpression* expression); virtual CReflexiveObjectPropertyExpression* getReflexiveObjectProperty(const CEXPRESSIONLIST& expressions); virtual CReflexiveObjectPropertyExpression* getReflexiveObjectProperty(CBuildExpression* expression); virtual CIrreflexiveObjectPropertyExpression* getIrreflexiveObjectProperty(const CEXPRESSIONLIST& expressions); virtual CIrreflexiveObjectPropertyExpression* getIrreflexiveObjectProperty(CBuildExpression* expression); virtual CSubObjectPropertyOfExpression* getSubObjectPropertyOf(const CEXPRESSIONLIST& expressions, CObjectPropertyTermExpression* expression); virtual CObjectPropertyDomainExpression* getObjectPropertyDomainExpression(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2); virtual CObjectPropertyRangeExpression* getObjectPropertyRangeExpression(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2); virtual CInverseObjectPropertiesExpression* getInverseObjectProperties(CObjectPropertyTermExpression* expression1, CObjectPropertyTermExpression* expression2); virtual CTransetiveObjectPropertyExpression* getTransetiveObjectProperty(CObjectPropertyTermExpression* expression); virtual CFunctionalObjectPropertyExpression* getFunctionalObjectProperty(CObjectPropertyTermExpression* expression); virtual CInverseFunctionalObjectPropertyExpression* getInverseFunctionalObjectProperty(CObjectPropertyTermExpression* expression); virtual CInverseObjectPropertyOfExpression* getInverseObjectPropertyOf(CObjectPropertyTermExpression* expression); virtual CSubObjectPropertyOfExpression* getSubObjectPropertyOf(CObjectPropertyChainExpression* expressions, CObjectPropertyTermExpression* expression); virtual CObjectPropertyChainExpression* getObjectPropertyChain(const CEXPRESSIONLIST& expressions); virtual CEquivalentObjectPropertiesExpression* getEquivalentObjectProperties(const CEXPRESSIONLIST& expressions); virtual CDisjointObjectPropertiesExpression* getDisjointObjectProperties(const CEXPRESSIONLIST& expressions); virtual CSymmetricObjectPropertyExpression* getSymmetricObjectProperty(CObjectPropertyTermExpression* expression); virtual CAsymmetricObjectPropertyExpression* getAsymmetricObjectProperty(CObjectPropertyTermExpression* expression); virtual CReflexiveObjectPropertyExpression* getReflexiveObjectProperty(CObjectPropertyTermExpression* expression); virtual CIrreflexiveObjectPropertyExpression* getIrreflexiveObjectProperty(CObjectPropertyTermExpression* expression); CObjectPropertyTermExpression* getCorrectedInverseObjectPropertyOf(CObjectPropertyTermExpression* expression); virtual CSubDataPropertyOfExpression* getSubDataPropertyOf(const CEXPRESSIONLIST& expressions); virtual CSubDataPropertyOfExpression* getSubDataPropertyOf(CBuildExpression* expression1, CBuildExpression* expression2); virtual CEquivalentDataPropertiesExpression* getEquivalentDataProperties(const CEXPRESSIONLIST& expressions); virtual CEquivalentDataPropertiesExpression* getEquivalentDataProperties(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDisjointDataPropertiesExpression* getDisjointDataProperties(const CEXPRESSIONLIST& expressions); virtual CDisjointDataPropertiesExpression* getDisjointDataProperties(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataPropertyDomainExpression* getDataPropertyDomainExpression(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataPropertyDomainExpression* getDataPropertyDomainExpression(const CEXPRESSIONLIST& expressions); virtual CDataPropertyRangeExpression* getDataPropertyRangeExpression(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataPropertyRangeExpression* getDataPropertyRangeExpression(const CEXPRESSIONLIST& expressions); virtual CFunctionalDataPropertyExpression* getFunctionalDataProperty(const CEXPRESSIONLIST& expressions); virtual CFunctionalDataPropertyExpression* getFunctionalDataProperty(CBuildExpression* expression); virtual CSubDataPropertyOfExpression* getSubDataPropertyOf(CDataPropertyTermExpression* expression1, CDataPropertyTermExpression* expression2); virtual CEquivalentDataPropertiesExpression* getEquivalentDataProperties(const CEXPRESSIONLIST& expressions); virtual CDisjointDataPropertiesExpression* getDisjointDataProperties(const CEXPRESSIONLIST& expressions); virtual CDataPropertyDomainExpression* getDataPropertyDomainExpression(CDataPropertyTermExpression* expression1, CClassTermExpression* expression2); virtual CDataPropertyRangeExpression* getDataPropertyRangeExpression(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2); virtual CFunctionalDataPropertyExpression* getFunctionalDataProperty(CDataPropertyTermExpression* expression); // virtual methods from CABoxAxiomBuilder virtual CNamedIndividualExpression* getNamedIndividual(const QString& individualName); virtual CNamedIndividualExpression* getNamedIndividual(const QStringRef& individualName); virtual CAnonymousIndividualExpression* getAnonymousIndividual(const QString& ontologyName, const QString& individualName); virtual CAnonymousIndividualExpression* getAnonymousIndividual(const QStringRef& ontologyName, const QStringRef& individualName); virtual CClassAssertionExpression* getClassAssertion(const CEXPRESSIONLIST& expressions); virtual CClassAssertionExpression* getClassAssertion(CBuildExpression* expression1, CBuildExpression* expression2); virtual CObjectPropertyAssertionExpression* getObjectPropertyAssertion(const CEXPRESSIONLIST& expressions); virtual CObjectPropertyAssertionExpression* getObjectPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3); virtual CNegativeObjectPropertyAssertionExpression* getNegativeObjectPropertyAssertion(const CEXPRESSIONLIST& expressions); virtual CNegativeObjectPropertyAssertionExpression* getNegativeObjectPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3); virtual CSameIndividualExpression* getSameIndividual(const CEXPRESSIONLIST& expressions); virtual CDifferentIndividualsExpression* getDifferentIndividuals(const CEXPRESSIONLIST& expressions); virtual CClassAssertionExpression* getClassAssertion(CIndividualTermExpression* expression1, CClassTermExpression* expression2); virtual CObjectPropertyAssertionExpression* getObjectPropertyAssertion(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2, CObjectPropertyTermExpression* expression3); virtual CNegativeObjectPropertyAssertionExpression* getNegativeObjectPropertyAssertion(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2, CObjectPropertyTermExpression* expression3); virtual CSameIndividualExpression* getSameIndividual(const CEXPRESSIONLIST& expressions); virtual CDifferentIndividualsExpression* getDifferentIndividuals(const CEXPRESSIONLIST& expressions); virtual CDataPropertyAssertionExpression* getDataPropertyAssertion(CIndividualTermExpression* expression1, CDataLiteralExpression* expression2, CDataPropertyTermExpression* expression3); virtual CNegativeDataPropertyAssertionExpression* getNegativeDataPropertyAssertion(CIndividualTermExpression* expression1, CDataLiteralExpression* expression2, CDataPropertyTermExpression* expression3); // protected functions protected: // protected variables protected: CConcreteOntology* mOnto; COntologyStringMapping* mOntoStrings; COntologyBuildData* mOntoBuild; CMemoryAllocationManager* mMemManager; CBUILDSET* mDeclarationAxiomSet; cint64 mNextAxiomNumber; cint64 mNextEntityNumber; cint64 mNextMaxAxiomNumberOffset; CClassTermExpression* mTopClassExpression; CClassTermExpression* mBottomClassExpression; CObjectPropertyTermExpression* mTopObjPropExpression; CObjectPropertyTermExpression* mBottomObjPropExpression; CDataPropertyTermExpression* mTopDataPropExpression; CDataPropertyTermExpression* mBottomDataPropExpression; CDataRangeTermExpression* mTopDataRangeExpression; CDataRangeTermExpression* mBottomDataRangeExpression; CBUILDLIST* mExpressionBuildContainerList; CBUILDHASH* mIndividualVariableIDHash; CBUILDHASH* mInverseObjectPropertyHash; CBUILDLIST< QPair >* mInverseObjectPropertyList; CBUILDHASH* mExpressionBuildHash; CBUILDHASH* mClassBuildHash; CBUILDHASH,CObjectIndividualVariableExpression*>* mIndividualVariableBuildHash; CBUILDHASH* mObjectPropertyBuildHash; CBUILDHASH* mIndividualBuildHash; CBUILDHASH,CAnonymousIndividualExpression*>* mAnoIndividualBuildHash; CBUILDHASH* mDatatypeBuildHash; CBUILDHASH* mDataLexicalValueBuildHash; CBUILDHASH* mDataPropertyBuildHash; CBUILDHASH* mDataFacetBuildHash; CMAPPINGHASH* mAbbreviatedNamePrefixMapHash; CMAPPINGHASH* mNamePrefixMapHash; CMAPPINGLIST* mPrefixList; CBUILDSET* mBuildConceptSet; CBUILDSET* mBuildObjectRoleSet; CBUILDSET* mBuildIndividualSet; CBUILDSET* mBuildDataRangeSet; CBUILDSET* mBuildDataRoleSet; CBUILDSET* mBuildDatatypeSet; CBUILDLIST* mBuildIndividualList; CBUILDLIST* mBuildObjectRoleList; CBUILDLIST* mBuildConceptList; CBUILDLIST* mBuildDataRangeList; CBUILDLIST* mBuildDataRoleList; CBUILDLIST* mBuildDatatypeList; CBUILDHASH* mImportDataHash; COntologyBuildExpressionCounter* mBuildExpCounter; CObjectOneOfExpression* mTmpObjectOneOfExpression; }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYBUILDDATAUPDATER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyQuerySimpleBuilder.h0000644000175000017500000000674612520550776031274 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYQUERYSIMPLEBUILDER_H #define KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYQUERYSIMPLEBUILDER_H // Libraries includes // Namespace includes #include "CConcreteOntologyQueryBasicBuilder.h" #include "CConcreteOntologyUpdateBuilder.h" #include "CSatisfiableCalculationJobGenerator.h" // Other includes #include "Reasoner/Query/CIsClassSatisfiableQuery.h" #include "Reasoner/Query/CAreClassesEquivalentQuery.h" #include "Reasoner/Query/CIsClassSubsumedByQuery.h" #include "Reasoner/Query/CAreClassesDisjointQuery.h" #include "Reasoner/Query/CIsClassSubsumedByQuery.h" #include "Reasoner/Query/CIsInstanceOfQuery.h" #include "Reasoner/Query/CQueryStatisticsCollectionStrings.h" #include "Reasoner/Query/CFlattenedTypesQuery.h" #include "Reasoner/Query/CFlattenedInstancesQuery.h" #include "Reasoner/Ontology/CConceptTextFormater.h" #include "Reasoner/Ontology/CIRIName.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Parser; using namespace Config; namespace Reasoner { using namespace Query; using namespace Ontology; namespace Generator { /*! * * \class CConcreteOntologyQuerySimpleBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteOntologyQuerySimpleBuilder : public CConcreteOntologyQueryBasicBuilder { // public methods public: //! Constructor CConcreteOntologyQuerySimpleBuilder(CConcreteOntology* ontology, CConfigurationBase *configuration); //! Destructor virtual ~CConcreteOntologyQuerySimpleBuilder(); virtual QList generateQuerys(); virtual CQueryAreClassesEquivalentExpression* getAreClassesEquivalenceQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName); virtual CQueryAreClassesDisjointExpression* getAreClassesDisjointQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName); virtual CQueryIsClassSubsumedByExpression* getIsClassSubsumedByQuery(CClassTermExpression* subsumerClassExpression, CClassTermExpression* subsumedClassExpression, const QString& queryName); virtual CQueryIsEntailedExpression* getIsEntailedQuery(const CEXPRESSIONLIST& axiomExpressions, const QString& queryName); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYQUERYSIMPLEBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyQuerySimpleBuilder.cpp0000644000175000017500000002246412520550776031622 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteOntologyQuerySimpleBuilder.h" namespace Konclude { namespace Reasoner { namespace Generator { CConcreteOntologyQuerySimpleBuilder::CConcreteOntologyQuerySimpleBuilder(CConcreteOntology* ontology, CConfigurationBase *configuration) : CConcreteOntologyQueryBasicBuilder(ontology,configuration) { } CConcreteOntologyQuerySimpleBuilder::~CConcreteOntologyQuerySimpleBuilder() { } CQueryAreClassesEquivalentExpression *CConcreteOntologyQuerySimpleBuilder::getAreClassesEquivalenceQuery(const CEXPRESSIONLIST &testClassExpressions, const QString& queryName) { CQueryAreClassesEquivalentExpression *classEqExp = new CQueryAreClassesEquivalentExpression(queryName,testClassExpressions); container.append(classEqExp); classEqExpList.append(classEqExp); return classEqExp; } CQueryAreClassesDisjointExpression *CConcreteOntologyQuerySimpleBuilder::getAreClassesDisjointQuery(const CEXPRESSIONLIST &testClassExpressions, const QString& queryName) { CQueryAreClassesDisjointExpression *classEqExp = new CQueryAreClassesDisjointExpression(queryName,testClassExpressions); container.append(classEqExp); classDisjointExpList.append(classEqExp); return classEqExp; } CQueryIsClassSubsumedByExpression *CConcreteOntologyQuerySimpleBuilder::getIsClassSubsumedByQuery(CClassTermExpression* subsumerClassExpression, CClassTermExpression* subsumedClassExpression, const QString& queryName) { CQueryIsClassSubsumedByExpression* classEqExp = new CQueryIsClassSubsumedByExpression(queryName,subsumerClassExpression,subsumedClassExpression); container.append(classEqExp); classSubsumedExpList.append(classEqExp); return classEqExp; } CQueryIsEntailedExpression* CConcreteOntologyQuerySimpleBuilder::getIsEntailedQuery(const CEXPRESSIONLIST& axiomExpressions, const QString& queryName) { return nullptr; } QList CConcreteOntologyQuerySimpleBuilder::generateQuerys() { QList queryList; CSatisfiableCalculationJobGenerator* satCalcJobGenerator = new CSatisfiableCalculationJobGenerator(mOntology); bool confBuildQueryStats = true; foreach (CQueryAreClassesEquivalentExpression *classEqExp, classEqExpList) { QString queryName = classEqExp->getName(); QStringList conceptNamesStrings; foreach (CClassTermExpression *buildExp, *classEqExp->getClassTermExpressionList()) { CConcept *concept = getConceptFromBuildExpression(buildExp); if (concept) { QString className = getStringFromConcept(concept); conceptNamesStrings.append(className); } } CAreClassesEquivalentQuery *query = new CAreClassesEquivalentQuery(conceptNamesStrings,queryName); CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } CEXPRESSIONLIST* testClassExpressions = classEqExp->getClassTermExpressionList(); for (CEXPRESSIONLIST::const_iterator it0 = testClassExpressions->constBegin(); it0 != testClassExpressions->constEnd(); ++it0) { CEXPRESSIONLIST::const_iterator it1 = it0; if (++it1 == testClassExpressions->constEnd()) { it1 = testClassExpressions->constBegin(); } CClassTermExpression *buildExp1 = *it0; CClassTermExpression *buildExp2 = *it1; CConcept *concept1 = getConceptFromBuildExpression(buildExp1); CConcept *concept2 = getConceptFromBuildExpression(buildExp2); CSatisfiableCalculationJob* satCalcJob = satCalcJobGenerator->getSatisfiableCalculationJob(concept1,false,concept2,true); if (confBuildQueryStats) { satCalcJob->setCalclulationStatisticsCollector(queryStats->createCalculationStatisticsCollection()); } satCalcJob->setCalculationConfiguration(calcConfig); query->addTestSatisfiableCalculationJob(satCalcJob,false); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated AreClassesEquivalent-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); delete classEqExp; } foreach (CQueryAreClassesDisjointExpression *classDisjExp, classDisjointExpList) { QString queryName = classDisjExp->getName(); QStringList conceptNamesStrings; foreach (CClassTermExpression *buildExp, *classDisjExp->getClassTermExpressionList()) { CConcept *concept = getConceptFromBuildExpression(buildExp); if (concept) { QString className = getStringFromConcept(concept); conceptNamesStrings.append(className); } } CAreClassesDisjointQuery *query = new CAreClassesDisjointQuery(conceptNamesStrings,queryName); CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } CEXPRESSIONLIST* testClassExpressions = classDisjExp->getClassTermExpressionList(); for (CEXPRESSIONLIST::const_iterator it0 = testClassExpressions->constBegin(); it0 != testClassExpressions->constEnd(); ++it0) { for (CEXPRESSIONLIST::const_iterator it1 = it0; it1 != testClassExpressions->constEnd(); ++it1) { CClassTermExpression *buildExp1 = *it0; CClassTermExpression *buildExp2 = *it1; CConcept *concept1 = getConceptFromBuildExpression(buildExp1); CConcept *concept2 = getConceptFromBuildExpression(buildExp2); CSatisfiableCalculationJob* satCalcJob = satCalcJobGenerator->getSatisfiableCalculationJob(concept1,false,concept2,false); if (confBuildQueryStats) { satCalcJob->setCalclulationStatisticsCollector(queryStats->createCalculationStatisticsCollection()); } satCalcJob->setCalculationConfiguration(calcConfig); query->addTestSatisfiableCalculationJob(satCalcJob,false); } } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated AreClassesDisjoint-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); delete classDisjExp; } foreach (CQueryIsClassSubsumedByExpression *classSubsumedExp, classSubsumedExpList) { QString queryName = classSubsumedExp->getName(); QStringList conceptNamesStrings; QString subsumedClassName; QString subsummerClassName; qint64 loopStep = 0; CConcept *subsumedConcept = 0; CConcept *subsumerConcept = 0; subsumedConcept = getConceptFromBuildExpression(classSubsumedExp->getSubsumedClassExpression()); subsumerConcept = getConceptFromBuildExpression(classSubsumedExp->getSubsumerClassExpression()); subsumedClassName = getStringFromConcept(subsumedConcept); subsummerClassName = getStringFromConcept(subsumerConcept); CIsClassSubsumedByQuery *query = new CIsClassSubsumedByQuery(subsumedClassName,subsummerClassName,queryName); CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CSatisfiableCalculationJob* satCalcJob = satCalcJobGenerator->getSatisfiableCalculationJob(subsumerConcept,false,subsumedConcept,true); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); satCalcJob->setCalclulationStatisticsCollector(queryStats->createCalculationStatisticsCollection()); } query->setQueryStatistics(queryStats); satCalcJob->setCalculationConfiguration(calcConfig); query->addTestSatisfiableCalculationJob(satCalcJob,false); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated IsClassSubsemedBy-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); delete classSubsumedExp; } delete satCalcJobGenerator; queryList.append(CConcreteOntologyQueryBasicBuilder::generateQuerys()); return queryList; } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CExpressionSplitter.h0000644000175000017500000001427712520551000026131 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CEXPRESSIONSPLITTER_H #define KONCLUDE_REASONER_GENERATOR_CEXPRESSIONSPLITTER_H // Libraries includes #include // Namespace includes // Other includes #include "Utilities/CNegLinker.hpp" #include "Parser/Expressions/CClassTermExpression.h" #include "Parser/Expressions/CObjectPropertyTermExpression.h" #include "Parser/Expressions/CIndividualTermExpression.h" #include "Parser/Expressions/CDataPropertyTermExpression.h" #include "Parser/Expressions/CDataRangeTermExpression.h" #include "Parser/Expressions/CDataLiteralExpression.h" #include "Parser/Expressions/CDatatypeExpression.h" #include "Parser/Expressions/CDataFacetRestrictionExpression.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Parser::Expression; namespace Reasoner { namespace Generator { /*! * * \class CExpressionSplitter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExpressionSplitter { // public methods public: //! Constructor CExpressionSplitter(const CEXPRESSIONLIST& expressions); CExpressionSplitter(CBuildExpression* expression1 = nullptr, CBuildExpression* expression2 = nullptr, CBuildExpression* expression3 = nullptr); bool testForExpressionComposition(cint64 requiredClassExpressions, cint64 requiredObjectPropertyExpressions = 0, cint64 requiredIndividualExpressions = 0, cint64 dataRangeExpressions = 0, cint64 dataPropertyExpressions = 0, cint64 dataLiteralExpressions = 0, cint64 datatypeExpressions = 0, cint64 dataFacetRestrictionExpressions = 0, cint64 dataFacetExpressions = 0); bool testForClassExpressions(cint64 requiredClassExpressions); bool testForObjectPropertyExpressions(cint64 requiredObjectPropertyExpressions); bool testForIndividualExpressions(cint64 requiredIndividualExpressions); bool testForDataPropertyExpressions(cint64 dataPropertyExpressions); bool testForDataRangeExpressions(cint64 dataRangeExpressions); bool testForDataLiteralExpressions(cint64 literalExpressions); bool testForDatatypeExpressions(cint64 datatypeExpressions); bool testForDataFacetRestrictionExpressions(cint64 dataFacetRestrictionExpressions); bool testForDataFacetExpressions(cint64 dataFacetExpressions); CEXPRESSIONLIST* getClassTermExpressionList(); CEXPRESSIONLIST* getObjectPropertyTermExpressionList(); CEXPRESSIONLIST* getDataPropertyTermExpressionList(); CEXPRESSIONLIST* getDataRangeTermExpressionList(); CEXPRESSIONLIST* getIndividualTermExpressionList(); CEXPRESSIONLIST* getDataLiteralExpressionList(); CEXPRESSIONLIST* getDatatypeExpressionList(); CEXPRESSIONLIST* getDataFacetRestrictionList(); CEXPRESSIONLIST* getDataFacetList(); CClassTermExpression* getFirstClassTermExpression(); CClassTermExpression* getFirstOptionalClassTermExpression(); CClassTermExpression* getSecondClassTermExpression(); CObjectPropertyTermExpression* getFirstObjectPropertyTermExpression(); CObjectPropertyTermExpression* getSecondObjectPropertyTermExpression(); CDataPropertyTermExpression* getFirstDataPropertyTermExpression(); CDataPropertyTermExpression* getSecondDataPropertyTermExpression(); CDataRangeTermExpression* getFirstDataRangeTermExpression(); CDataRangeTermExpression* getFirstOptionalDataRangeTermExpression(); CDataRangeTermExpression* getSecondDataRangeTermExpression(); CDataLiteralExpression* getFirstDataLiteralExpression(); CDataLiteralExpression* getSecondDataLiteralExpression(); CDatatypeExpression* getFirstDatatypeExpression(); CDatatypeExpression* getSecondDatatypeExpression(); CDataFacetRestrictionExpression* getFirstDataFacetRestrictionExpression(); CDataFacetRestrictionExpression* getSecondDataFacetRestrictionExpression(); CDataFacetExpression* getFirstDataFacetExpression(); CDataFacetExpression* getSecondDataFacetExpression(); CIndividualTermExpression* getFirstIndividualTermExpression(); CIndividualTermExpression* getSecondIndividualTermExpression(); // protected methods protected: bool splitExpressions(const CEXPRESSIONLIST& expressions); bool addSplittedExpression(CBuildExpression* expression); // protected variables protected: CEXPRESSIONLIST mClassList; CEXPRESSIONLIST mObjectPropertyList; CEXPRESSIONLIST mIndiList; CEXPRESSIONLIST mDataPropertyList; CEXPRESSIONLIST mDataRangeList; CEXPRESSIONLIST mDataLiteralList; CEXPRESSIONLIST mDatatypeList; CEXPRESSIONLIST mDataFacetRestrictionList; CEXPRESSIONLIST mDataFacetList; // private methods private: // private variables private: }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_GENERATOR_CEXPRESSIONSPLITTER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CExpressionHasher.cpp0000644000175000017500000000300212520551000026050 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExpressionHasher.h" namespace Konclude { namespace Reasoner { namespace Generator { CExpressionHasher::CExpressionHasher(CBuildExpression* expression) : mExpression(expression) { mHashValue = mExpression->getStructuralHashValue(); } cint64 CExpressionHasher::getExpressionHashValue() const { return mHashValue; } bool CExpressionHasher::operator==(const CExpressionHasher& expressionHasher) const { if (mHashValue != expressionHasher.getExpressionHashValue()) { return false; } else { return mExpression->compareStructuralEquivalence(expressionHasher.mExpression); } } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyBasementBuilder.h0000644000175000017500000001431112520550774030534 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYBASEMENTBUILDER_H #define KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYBASEMENTBUILDER_H // Libraries includes #include #include #include #include // Namespace includes #include "CExpressionSplitter.h" #include "CExpressionHasher.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CTBox.h" #include "Reasoner/Ontology/CABox.h" #include "Reasoner/Ontology/CRBox.h" #include "Reasoner/Ontology/CAbbreviatedIRIName.h" #include "Reasoner/Ontology/CIRIName.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Memory; using namespace Parser; namespace Reasoner { using namespace Ontology; namespace Generator { /*! * * \class CConcreteOntologyBasementBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteOntologyBasementBuilder { public: CConcreteOntologyBasementBuilder(CConcreteOntology* basementBuildConcreteOntology); virtual ~CConcreteOntologyBasementBuilder(); virtual bool initializeBuilding(); virtual bool completeBuilding(); virtual bool buildOntologyBasement(); bool addNameAbbreviation(const QString &name, const QString &abbreviatedName); // protected functions protected: bool updateName(CNamedItem* item, const QString& name); bool createDatatype(const QString& datatypeIRI); // protected variables protected: CConcreteOntology* mOnto; COntologyStringMapping* mOntoStrings; COntologyDataBoxes* mOntoData; COntologyBuildData* mOntoBuild; CTBox* tBox; CABox* aBox; CRBox* rBox; CMemoryAllocationManager* mMemManager; CActiveEntityCountVector* mActiveEntityCountVector; // contains also previous ontology data CONTOLOGYAXIOMSET* mTellAxiomSet; CONTOLOGYAXIOMSET* mRetractAxiomSet; // contains only updated data CONTOLOGYAXIOMSET* mTellUpdatedAxiomSet; CONTOLOGYAXIOMSET* mRetractUpdatedAxiomSet; CBUILDHASH* mUpdateClassAxiomHash; CBUILDHASH* mUpdateObjectPropertyAxiomHash; // contains also previous ontology data CBUILDSET< QPair >* mClassTermClassAxiomSet; CBUILDHASH* mClassTermClassAxiomHash; CBUILDSET< QPair >* mObjPropTermObjPropAxiomSet; CBUILDHASH* mObjPropTermObjPropAxiomHash; CBUILDSET* mTopRebuildClassTermExpressionsSet; CBUILDSET* mTopRebuildObjectPropertyTermExpressionsSet; CBUILDHASH* mDatatypeBuildHash; CClassTermExpression* mTopClassExpression; CClassTermExpression* mBottomClassExpression; CObjectPropertyTermExpression* mTopObjPropExpression; CObjectPropertyTermExpression* mBottomObjPropExpression; CDataPropertyTermExpression* mTopDataPropExpression; CDataPropertyTermExpression* mBottomDataPropExpression; CBUILDLIST* mExpressionBuildContainerList; CBUILDHASH* mClassTermConceptHash; CBUILDHASH* mConceptClassTermHash; CBUILDHASH* mObjPropTermRoleHash; CBUILDHASH* mRoleObjPropTermHash; CBUILDHASH* mDataPropTermRoleHash; CBUILDHASH* mRoleDataPropTermHash; CBUILDHASH* mDatatypeExpDatatypeHash; CBUILDHASH* mDatatypeDatatypeExpHash; CBUILDHASH* mObjPropTermRoleChainHash; CBUILDHASH* mRoleChainObjPropTermHash; CBUILDHASH* mIndividulTermIndiHash; CBUILDHASH* mIndiIndividulTermHash; CBUILDHASH* mInverseObjectPropertyHash; // contains also previous ontology data, // exact build expression identification CBUILDHASH* mExpressionBuildHash; CBUILDHASH* mClassBuildHash; CBUILDHASH* mObjectPropertyBuildHash; CBUILDHASH* mIndividualBuildHash; CBUILDHASH* mDataPropertyBuildHash; // contains also previous ontology data, // name prefixes CMAPPINGHASH* mAbbreviatedNamePrefixMapHash; CMAPPINGHASH* mNamePrefixMapHash; }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYBASEMENTBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyQueryExtendedBuilder.h0000644000175000017500000001057212520550776031573 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYQUERYEXTENDEDBUILDER_H #define KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYQUERYEXTENDEDBUILDER_H // Libraries includes // Namespace includes #include "CQueryBuilderGenerator.h" #include "CConcreteOntologyQueryBasicBuilder.h" #include "CSatisfiableCalculationJobGenerator.h" #include "CExpressionSplitter.h" // Other includes #include "Reasoner/Query/CIsClassSatisfiableQuery.h" #include "Reasoner/Query/CAreClassesEquivalentQuery.h" #include "Reasoner/Query/CIsClassSubsumedByQuery.h" #include "Reasoner/Query/CAreClassesDisjointQuery.h" #include "Reasoner/Query/CIsClassSubsumedByQuery.h" #include "Reasoner/Query/CIsInstanceOfQuery.h" #include "Reasoner/Query/CQueryStatisticsCollectionStrings.h" #include "Reasoner/Query/CFlattenedTypesQuery.h" #include "Reasoner/Query/CFlattenedInstancesQuery.h" #include "Reasoner/Query/CAreAxiomsEntailedQuery.h" #include "Reasoner/Ontology/CConceptTextFormater.h" #include "Reasoner/Ontology/CIRIName.h" #include "Parser/COntologyBuilder.h" #include "Config/CConfigurationBase.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Parser; using namespace Config; namespace Reasoner { using namespace Query; using namespace Ontology; namespace Generator { /*! * * \class CConcreteOntologyQueryExtendedBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteOntologyQueryExtendedBuilder : public CConcreteOntologyQueryBasicBuilder { // public methods public: //! Constructor CConcreteOntologyQueryExtendedBuilder(CConcreteOntology* ontology, CConfigurationBase *configuration, COntologyBuilder* ontologyBuilder); //! Destructor virtual ~CConcreteOntologyQueryExtendedBuilder(); virtual QList generateQuerys(); virtual CQueryIsEntailedExpression* getIsEntailedQuery(const CEXPRESSIONLIST& axiomExpressions, const QString& queryName); virtual CQueryAreClassesEquivalentExpression* getAreClassesEquivalenceQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName); virtual CQueryAreClassesDisjointExpression* getAreClassesDisjointQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName); virtual CQueryIsClassSubsumedByExpression* getIsClassSubsumedByQuery(CClassTermExpression* subsumerClassExpression, CClassTermExpression* subsumedClassExpression, const QString& queryName); // protected methods protected: // protected variables protected: COntologyBuilder* mOntologyBuilder; CEXPRESSIONLIST container; CEXPRESSIONLIST classSatExpList; CEXPRESSIONLIST classEqExpList; CEXPRESSIONLIST classSubsumedExpList; CEXPRESSIONLIST classDisjointExpList; CEXPRESSIONLIST instanceExpList; CEXPRESSIONLIST flattenedTypesExpList; CEXPRESSIONLIST flattenedInstancesExpList; CEXPRESSIONLIST isEntailedExpList; // private methods private: // private variables private: }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYQUERYEXTENDEDBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyEntityCollectorBuilder.cpp0000644000175000017500000011405412520550776032463 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteOntologyEntityCollectorBuilder.h" namespace Konclude { namespace Reasoner { namespace Generator { CConcreteOntologyEntityCollectorBuilder::CConcreteOntologyEntityCollectorBuilder() { } QSet* CConcreteOntologyEntityCollectorBuilder::getClassNameSet() { return &mClassNameSet; } QSet* CConcreteOntologyEntityCollectorBuilder::getObjectPropertyNameSet() { return &mObjectPropertyNameSet; } QSet* CConcreteOntologyEntityCollectorBuilder::getDataPropertyNameSet() { return &mDataPropertyNameSet; } QSet* CConcreteOntologyEntityCollectorBuilder::getIndividualNameSet() { return &mIndividualNameSet; } QSet* CConcreteOntologyEntityCollectorBuilder::getVariableNameSet() { return &mVariableNameSet; } cint64 CConcreteOntologyEntityCollectorBuilder::getAxiomNumber() { return 0; } bool CConcreteOntologyEntityCollectorBuilder::addNameAbbreviation(const QString &name, const QString &abbreviatedName) { mAbbreviationsResolveHash.insert(abbreviatedName,name); return true; } QString CConcreteOntologyEntityCollectorBuilder::resolveAbbreviationName(const QString& name) { QStringList nameList = name.split(":"); QString resolvedName(name); if (nameList.count() >= 2) { if (mAbbreviationsResolveHash.contains(nameList.first())) { resolvedName = mAbbreviationsResolveHash.value(nameList.takeFirst()); QString remName = nameList.first(); if (nameList.count() > 1) { remName = nameList.join(":"); } resolvedName += remName; } } return resolvedName; } QString CConcreteOntologyEntityCollectorBuilder::resolveAbbreviationName(const QStringRef& name) { return resolveAbbreviationName(name.toString()); } QString CConcreteOntologyEntityCollectorBuilder::getOntologyName() { return QString(); } bool CConcreteOntologyEntityCollectorBuilder::addOntologyImport(const QStringRef& name) { return false; } bool CConcreteOntologyEntityCollectorBuilder::addOntologyImport(const QString& name) { return false; } CDeclarationAxiomExpression* CConcreteOntologyEntityCollectorBuilder::getDeclaration(const CEXPRESSIONLIST& expressions) { return nullptr; } CDeclarationAxiomExpression* CConcreteOntologyEntityCollectorBuilder::getDeclaration(CBuildExpression* buildExpression) { return nullptr; } CDeclarationAxiomExpression* CConcreteOntologyEntityCollectorBuilder::getDeclaration(CExpressionEntity* entity) { return nullptr; } CClassExpression* CConcreteOntologyEntityCollectorBuilder::getClass(const QString& className) { mClassNameSet.insert(className); return nullptr; } CClassExpression* CConcreteOntologyEntityCollectorBuilder::getClass(const QStringRef& className) { return getClass(className.toString()); } CClassTermExpression* CConcreteOntologyEntityCollectorBuilder::getTopClass() { return nullptr; } CClassTermExpression* CConcreteOntologyEntityCollectorBuilder::getBottomClass() { return nullptr; } CObjectIndividualVariableExpression* CConcreteOntologyEntityCollectorBuilder::getIndividualVariable(const QString &individualVariableName, cint64 axiomNumber) { mVariableNameSet.insert(individualVariableName); return nullptr; } CObjectIndividualVariableExpression* CConcreteOntologyEntityCollectorBuilder::getIndividualVariable(const QStringRef &individualVariableName, cint64 axiomNumber) { return getIndividualVariable(individualVariableName.toString(),axiomNumber); } CDataLiteralExpression* CConcreteOntologyEntityCollectorBuilder::getDataLiteral(CDataLexicalValueExpression* dataLexicalValue, CDatatypeExpression* datatype) { return nullptr; } CDatatypeExpression* CConcreteOntologyEntityCollectorBuilder::getDatatype(const QString& datatypeName) { return nullptr; } CDatatypeExpression* CConcreteOntologyEntityCollectorBuilder::getDatatype(const QStringRef& datatypeName) { return nullptr; } CDataLexicalValueExpression* CConcreteOntologyEntityCollectorBuilder::getDataLexicalValue(const QString& dataLexicalValue) { return nullptr; } CDataLexicalValueExpression* CConcreteOntologyEntityCollectorBuilder::getDataLexicalValue(const QStringRef& dataLexicalValue) { return nullptr; } CDataHasValueExpression* CConcreteOntologyEntityCollectorBuilder::getDataHasValue(const CEXPRESSIONLIST& expressions) { return nullptr; } CDataHasValueExpression* CConcreteOntologyEntityCollectorBuilder::getDataHasValue(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CDataSomeValuesFromExpression* CConcreteOntologyEntityCollectorBuilder::getDataSomeValuesFrom(const CEXPRESSIONLIST& expressions) { return nullptr; } CDataSomeValuesFromExpression* CConcreteOntologyEntityCollectorBuilder::getDataSomeValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CDataAllValuesFromExpression* CConcreteOntologyEntityCollectorBuilder::getDataAllValuesFrom(const CEXPRESSIONLIST& expressions) { return nullptr; } CDataAllValuesFromExpression* CConcreteOntologyEntityCollectorBuilder::getDataAllValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CDataIntersectionOfExpression* CConcreteOntologyEntityCollectorBuilder::getDataIntersectionOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CDataIntersectionOfExpression* CConcreteOntologyEntityCollectorBuilder::getDataIntersectionOf(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CDataOneOfExpression* CConcreteOntologyEntityCollectorBuilder::getDataOneOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CDataOneOfExpression* CConcreteOntologyEntityCollectorBuilder::getDataOneOf(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CDataUnionOfExpression* CConcreteOntologyEntityCollectorBuilder::getDataUnionOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CDataUnionOfExpression* CConcreteOntologyEntityCollectorBuilder::getDataUnionOf(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CDataComplementOfExpression* CConcreteOntologyEntityCollectorBuilder::getDataComplementOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CDataComplementOfExpression* CConcreteOntologyEntityCollectorBuilder::getDataComplementOf(CBuildExpression* expression) { return nullptr; } CDatatypeRestrictionExpression* CConcreteOntologyEntityCollectorBuilder::getDatatypeRestriction(const CEXPRESSIONLIST& expressions) { return nullptr; } CDatatypeRestrictionExpression* CConcreteOntologyEntityCollectorBuilder::getDatatypeRestriction(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CDataFacetExpression* CConcreteOntologyEntityCollectorBuilder::getDataFacet(const QString& dataFacetIRI) { return nullptr; } CDataFacetExpression* CConcreteOntologyEntityCollectorBuilder::getDataFacet(const QStringRef& dataFacetIRI) { return nullptr; } CDataFacetRestrictionExpression* CConcreteOntologyEntityCollectorBuilder::getDataFacetRestriction(CDataLiteralExpression* dataLiteralExpression, CDataFacetExpression* dataFacet) { return nullptr; } CDataFacetRestrictionExpression* CConcreteOntologyEntityCollectorBuilder::getDataFacetRestriction(const CEXPRESSIONLIST& expressions) { return nullptr; } CDataFacetRestrictionExpression* CConcreteOntologyEntityCollectorBuilder::getDataFacetRestriction(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CDataMaxCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getDataMaxCardinality(const CEXPRESSIONLIST& expressions, int cardinality) { return nullptr; } CDataMaxCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getDataMaxCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { return nullptr; } CDataMinCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getDataMinCardinality(const CEXPRESSIONLIST& expressions, int cardinality) { return nullptr; } CDataMinCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getDataMinCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { return nullptr; } CDataExactCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getDataExactCardinality(const CEXPRESSIONLIST& expressions, int cardinality) { return nullptr; } CDataExactCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getDataExactCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { return nullptr; } CDataHasValueExpression* CConcreteOntologyEntityCollectorBuilder::getDataHasValue(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) { return nullptr; } CDataSomeValuesFromExpression* CConcreteOntologyEntityCollectorBuilder::getDataSomeValuesFrom(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) { return nullptr; } CDataAllValuesFromExpression* CConcreteOntologyEntityCollectorBuilder::getDataAllValuesFrom(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) { return nullptr; } CDataIntersectionOfExpression* CConcreteOntologyEntityCollectorBuilder::getDataIntersectionOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CDataOneOfExpression* CConcreteOntologyEntityCollectorBuilder::getDataOneOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CDataUnionOfExpression* CConcreteOntologyEntityCollectorBuilder::getDataUnionOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CDataComplementOfExpression* CConcreteOntologyEntityCollectorBuilder::getDataComplementOf(CDataRangeTermExpression* expressions) { return nullptr; } CDatatypeRestrictionExpression* CConcreteOntologyEntityCollectorBuilder::getDatatypeRestriction(CDatatypeExpression* datatypeExpression, const CEXPRESSIONLIST& expressions) { return nullptr; } CDataMaxCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getDataMaxCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality) { return nullptr; } CDataMinCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getDataMinCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality) { return nullptr; } CDataExactCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getDataExactCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality) { return nullptr; } CDataRangeTermExpression* CConcreteOntologyEntityCollectorBuilder::getTopDataRange() { return nullptr; } CDataRangeTermExpression* CConcreteOntologyEntityCollectorBuilder::getBottomDataRange() { return nullptr; } CDataPropertyAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getDataPropertyAssertion(const CEXPRESSIONLIST& expressions) { return nullptr; } CDataPropertyAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getDataPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) { return nullptr; } CNegativeDataPropertyAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getNegativeDataPropertyAssertion(const CEXPRESSIONLIST& expressions) { return nullptr; } CNegativeDataPropertyAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getNegativeDataPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) { return nullptr; } CDataPropertyAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getDataPropertyAssertion(CIndividualTermExpression* expression1, CDataLiteralExpression* expression2, CDataPropertyTermExpression* expression3) { return nullptr; } CNegativeDataPropertyAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getNegativeDataPropertyAssertion(CIndividualTermExpression* expression1, CDataLiteralExpression* expression2, CDataPropertyTermExpression* expression3) { return nullptr; } CEquivalentClassesExpression* CConcreteOntologyEntityCollectorBuilder::getEquivalentClasses(const CEXPRESSIONLIST& expressions) { return nullptr; } CEquivalentClassesExpression* CConcreteOntologyEntityCollectorBuilder::getEquivalentClasses(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CSubClassOfExpression* CConcreteOntologyEntityCollectorBuilder::getSubClassOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CSubClassOfExpression* CConcreteOntologyEntityCollectorBuilder::getSubClassOf(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CDisjointClassesExpression* CConcreteOntologyEntityCollectorBuilder::getDisjointClasses(const CEXPRESSIONLIST& expressions) { return nullptr; } CDisjointUnionExpression *CConcreteOntologyEntityCollectorBuilder::getDisjointUnion(const CEXPRESSIONLIST &expressions) { return nullptr; } CObjectComplementOfExpression* CConcreteOntologyEntityCollectorBuilder::getObjectComplementOf(CBuildExpression* expression) { return nullptr; } CObjectComplementOfExpression* CConcreteOntologyEntityCollectorBuilder::getObjectComplementOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CObjectIntersectionOfExpression* CConcreteOntologyEntityCollectorBuilder::getObjectIntersectionOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CObjectUnionOfExpression* CConcreteOntologyEntityCollectorBuilder::getObjectUnionOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CObjectMaxCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getObjectMaxCardinality(const CEXPRESSIONLIST& expressions, int cardinality) { return nullptr; } CObjectMaxCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getObjectMaxCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { return nullptr; } CObjectMinCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getObjectMinCardinality(const CEXPRESSIONLIST& expressions, int cardinality) { return nullptr; } CObjectMinCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getObjectMinCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { return nullptr; } CObjectExactlyCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getObjectExactlyCardinality(const CEXPRESSIONLIST& expressions, int cardinality) { return nullptr; } CObjectExactlyCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getObjectExactlyCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { return nullptr; } CObjectAllValuesFromExpression* CConcreteOntologyEntityCollectorBuilder::getObjectAllValuesFrom(const CEXPRESSIONLIST& expressions) { return nullptr; } CObjectAllValuesFromExpression* CConcreteOntologyEntityCollectorBuilder::getObjectAllValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CObjectSomeValuesFromExpression* CConcreteOntologyEntityCollectorBuilder::getObjectSomeValuesFrom(const CEXPRESSIONLIST& expressions) { return nullptr; } CObjectSomeValuesFromExpression* CConcreteOntologyEntityCollectorBuilder::getObjectSomeValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CObjectOneOfExpression *CConcreteOntologyEntityCollectorBuilder::getObjectOneOf(const CEXPRESSIONLIST &expressions) { return nullptr; } CObjectOneOfExpression *CConcreteOntologyEntityCollectorBuilder::getObjectOneOf(CBuildExpression *expression) { return nullptr; } CObjectHasValueExpression *CConcreteOntologyEntityCollectorBuilder::getObjectHasValue(const CEXPRESSIONLIST &expressions) { return nullptr; } CObjectHasValueExpression *CConcreteOntologyEntityCollectorBuilder::getObjectHasValue(CBuildExpression *expression1, CBuildExpression *expression2) { return nullptr; } CObjectHasSelfExpression *CConcreteOntologyEntityCollectorBuilder::getObjectHasSelf(const CEXPRESSIONLIST &expressions) { return nullptr; } CObjectHasSelfExpression *CConcreteOntologyEntityCollectorBuilder::getObjectHasSelf(CBuildExpression *expression) { return nullptr; } CEquivalentClassesExpression* CConcreteOntologyEntityCollectorBuilder::getEquivalentClasses(const CEXPRESSIONLIST& expressions) { return nullptr; } CSubClassOfExpression* CConcreteOntologyEntityCollectorBuilder::getSubClassOf(CClassTermExpression* expression1, CClassTermExpression* expression2) { return nullptr; } CDisjointClassesExpression* CConcreteOntologyEntityCollectorBuilder::getDisjointClasses(const CEXPRESSIONLIST& expressions) { return nullptr; } CDisjointUnionExpression *CConcreteOntologyEntityCollectorBuilder::getDisjointUnion(CClassExpression* classExpression, const CEXPRESSIONLIST& expressions) { return nullptr; } CObjectComplementOfExpression* CConcreteOntologyEntityCollectorBuilder::getObjectComplementOf(CClassTermExpression* expression) { return nullptr; } CObjectIntersectionOfExpression* CConcreteOntologyEntityCollectorBuilder::getObjectIntersectionOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CObjectUnionOfExpression* CConcreteOntologyEntityCollectorBuilder::getObjectUnionOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CObjectMaxCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getObjectMaxCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality) { return nullptr; } CObjectMinCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getObjectMinCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality) { return nullptr; } CObjectExactlyCardinalityExpression* CConcreteOntologyEntityCollectorBuilder::getObjectExactlyCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality) { return nullptr; } CObjectAllValuesFromExpression* CConcreteOntologyEntityCollectorBuilder::getObjectAllValuesFrom(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) { return nullptr; } CObjectSomeValuesFromExpression* CConcreteOntologyEntityCollectorBuilder::getObjectSomeValuesFrom(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) { return nullptr; } CObjectOneOfExpression *CConcreteOntologyEntityCollectorBuilder::getObjectOneOf(const CEXPRESSIONLIST &expressions) { return nullptr; } CObjectOneOfExpression *CConcreteOntologyEntityCollectorBuilder::getObjectOneOf(CIndividualTermExpression* expression) { return nullptr; } CObjectHasValueExpression *CConcreteOntologyEntityCollectorBuilder::getObjectHasValue(CObjectPropertyTermExpression *expression1, CIndividualTermExpression *expression2) { return nullptr; } CObjectHasSelfExpression *CConcreteOntologyEntityCollectorBuilder::getObjectHasSelf(CObjectPropertyTermExpression *expression) { return nullptr; } CDataPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getDataProberty(const QString& dataPropertyName) { mDataPropertyNameSet.insert(dataPropertyName); return nullptr; } CDataPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getDataProberty(const QStringRef& dataPropertyName) { return getDataProberty(dataPropertyName.toString()); } CObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getObjectProberty(const QString& probertyName) { mObjectPropertyNameSet.insert(probertyName); return nullptr; } CObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getObjectProberty(const QStringRef& probertyName) { return getObjectProberty(probertyName.toString()); } CObjectPropertyTermExpression* CConcreteOntologyEntityCollectorBuilder::getTopObjectProberty() { return nullptr; } CSubObjectPropertyOfExpression* CConcreteOntologyEntityCollectorBuilder::getSubObjectPropertyOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CSubObjectPropertyOfExpression* CConcreteOntologyEntityCollectorBuilder::getSubObjectPropertyOf(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CObjectPropertyDomainExpression* CConcreteOntologyEntityCollectorBuilder::getObjectPropertyDomainExpression(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CObjectPropertyDomainExpression* CConcreteOntologyEntityCollectorBuilder::getObjectPropertyDomainExpression(const CEXPRESSIONLIST& expressions) { return nullptr; } CObjectPropertyRangeExpression* CConcreteOntologyEntityCollectorBuilder::getObjectPropertyRangeExpression(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CObjectPropertyRangeExpression* CConcreteOntologyEntityCollectorBuilder::getObjectPropertyRangeExpression(const CEXPRESSIONLIST& expressions) { return nullptr; } CSubDataPropertyOfExpression* CConcreteOntologyEntityCollectorBuilder::getSubDataPropertyOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CSubDataPropertyOfExpression* CConcreteOntologyEntityCollectorBuilder::getSubDataPropertyOf(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CEquivalentDataPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getEquivalentDataProperties(const CEXPRESSIONLIST& expressions) { return nullptr; } CEquivalentDataPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getEquivalentDataProperties(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CDisjointDataPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getDisjointDataProperties(const CEXPRESSIONLIST& expressions) { return nullptr; } CDisjointDataPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getDisjointDataProperties(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CDataPropertyDomainExpression* CConcreteOntologyEntityCollectorBuilder::getDataPropertyDomainExpression(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CDataPropertyDomainExpression* CConcreteOntologyEntityCollectorBuilder::getDataPropertyDomainExpression(const CEXPRESSIONLIST& expressions) { return nullptr; } CDataPropertyRangeExpression* CConcreteOntologyEntityCollectorBuilder::getDataPropertyRangeExpression(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CDataPropertyRangeExpression* CConcreteOntologyEntityCollectorBuilder::getDataPropertyRangeExpression(const CEXPRESSIONLIST& expressions) { return nullptr; } CFunctionalDataPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getFunctionalDataProperty(const CEXPRESSIONLIST& expressions) { return nullptr; } CFunctionalDataPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getFunctionalDataProperty(CBuildExpression* expression) { return nullptr; } CSubDataPropertyOfExpression* CConcreteOntologyEntityCollectorBuilder::getSubDataPropertyOf(CDataPropertyTermExpression* expression1, CDataPropertyTermExpression* expression2) { return nullptr; } CEquivalentDataPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getEquivalentDataProperties(const CEXPRESSIONLIST& expressions) { return nullptr; } CDisjointDataPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getDisjointDataProperties(const CEXPRESSIONLIST& expressions) { return nullptr; } CDataPropertyDomainExpression* CConcreteOntologyEntityCollectorBuilder::getDataPropertyDomainExpression(CDataPropertyTermExpression* expression1, CClassTermExpression* expression2) { return nullptr; } CDataPropertyRangeExpression* CConcreteOntologyEntityCollectorBuilder::getDataPropertyRangeExpression(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) { return nullptr; } CFunctionalDataPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getFunctionalDataProperty(CDataPropertyTermExpression* expression) { return nullptr; } CInverseObjectPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getInverseObjectProperties(const CEXPRESSIONLIST& expressions) { return nullptr; } CInverseObjectPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getInverseObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CTransetiveObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getTransetiveObjectProperty(const CEXPRESSIONLIST& expressions) { return nullptr; } CTransetiveObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getTransetiveObjectProperty(CBuildExpression* expression) { return nullptr; } CFunctionalObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getFunctionalObjectProperty(const CEXPRESSIONLIST& expressions) { return nullptr; } CFunctionalObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getFunctionalObjectProperty(CBuildExpression* expression) { return nullptr; } CInverseFunctionalObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getInverseFunctionalObjectProperty(const CEXPRESSIONLIST& expressions) { return nullptr; } CInverseFunctionalObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getInverseFunctionalObjectProperty(CBuildExpression* expression) { return nullptr; } CInverseObjectPropertyOfExpression* CConcreteOntologyEntityCollectorBuilder::getInverseObjectPropertyOf(const CEXPRESSIONLIST& expressions) { return nullptr; } CInverseObjectPropertyOfExpression* CConcreteOntologyEntityCollectorBuilder::getInverseObjectPropertyOf(CBuildExpression* expression) { return nullptr; } CObjectPropertyChainExpression* CConcreteOntologyEntityCollectorBuilder::getObjectPropertyChain(const CEXPRESSIONLIST& expressions) { return nullptr; } CObjectPropertyChainExpression* CConcreteOntologyEntityCollectorBuilder::getObjectPropertyChain(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CEquivalentObjectPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getEquivalentObjectProperties(const CEXPRESSIONLIST& expressions) { return nullptr; } CEquivalentObjectPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getEquivalentObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CDisjointObjectPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getDisjointObjectProperties(const CEXPRESSIONLIST& expressions) { return nullptr; } CDisjointObjectPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getDisjointObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CSymmetricObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getSymmetricObjectProperty(const CEXPRESSIONLIST& expressions) { return nullptr; } CSymmetricObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getSymmetricObjectProperty(CBuildExpression* expression) { return nullptr; } CAsymmetricObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getAsymmetricObjectProperty(const CEXPRESSIONLIST& expressions) { return nullptr; } CAsymmetricObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getAsymmetricObjectProperty(CBuildExpression* expression) { return nullptr; } CReflexiveObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getReflexiveObjectProperty(const CEXPRESSIONLIST& expressions) { return nullptr; } CReflexiveObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getReflexiveObjectProperty(CBuildExpression* expression) { return nullptr; } CIrreflexiveObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getIrreflexiveObjectProperty(const CEXPRESSIONLIST& expressions) { return nullptr; } CIrreflexiveObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getIrreflexiveObjectProperty(CBuildExpression* expression) { return nullptr; } CSubObjectPropertyOfExpression* CConcreteOntologyEntityCollectorBuilder::getSubObjectPropertyOf(const CEXPRESSIONLIST& expressions, CObjectPropertyTermExpression* expression) { return nullptr; } CObjectPropertyDomainExpression* CConcreteOntologyEntityCollectorBuilder::getObjectPropertyDomainExpression(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) { return nullptr; } CObjectPropertyRangeExpression* CConcreteOntologyEntityCollectorBuilder::getObjectPropertyRangeExpression(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) { return nullptr; } CInverseObjectPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getInverseObjectProperties(CObjectPropertyTermExpression* expression1, CObjectPropertyTermExpression* expression2) { return nullptr; } CTransetiveObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getTransetiveObjectProperty(CObjectPropertyTermExpression* expression) { return nullptr; } CFunctionalObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getFunctionalObjectProperty(CObjectPropertyTermExpression* expression) { return nullptr; } CInverseFunctionalObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getInverseFunctionalObjectProperty(CObjectPropertyTermExpression* expression) { return nullptr; } CInverseObjectPropertyOfExpression* CConcreteOntologyEntityCollectorBuilder::getInverseObjectPropertyOf(CObjectPropertyTermExpression* expression) { return nullptr; } CSubObjectPropertyOfExpression* CConcreteOntologyEntityCollectorBuilder::getSubObjectPropertyOf(CObjectPropertyChainExpression* expressions, CObjectPropertyTermExpression* expression) { return nullptr; } CObjectPropertyChainExpression* CConcreteOntologyEntityCollectorBuilder::getObjectPropertyChain(const CEXPRESSIONLIST& expressions) { return nullptr; } CEquivalentObjectPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getEquivalentObjectProperties(const CEXPRESSIONLIST& expressions) { return nullptr; } CDisjointObjectPropertiesExpression* CConcreteOntologyEntityCollectorBuilder::getDisjointObjectProperties(const CEXPRESSIONLIST& expressions) { return nullptr; } CSymmetricObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getSymmetricObjectProperty(CObjectPropertyTermExpression* expression) { return nullptr; } CAsymmetricObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getAsymmetricObjectProperty(CObjectPropertyTermExpression* expression) { return nullptr; } CReflexiveObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getReflexiveObjectProperty(CObjectPropertyTermExpression* expression) { return nullptr; } CIrreflexiveObjectPropertyExpression* CConcreteOntologyEntityCollectorBuilder::getIrreflexiveObjectProperty(CObjectPropertyTermExpression* expression) { return nullptr; } CObjectPropertyTermExpression* CConcreteOntologyEntityCollectorBuilder::getCorrectedInverseObjectPropertyOf(CObjectPropertyTermExpression* expression) { return nullptr; } CNamedIndividualExpression* CConcreteOntologyEntityCollectorBuilder::getNamedIndividual(const QString& individualName) { mIndividualNameSet.insert(individualName); return nullptr; } CNamedIndividualExpression* CConcreteOntologyEntityCollectorBuilder::getNamedIndividual(const QStringRef& individualName) { return getNamedIndividual(individualName.toString()); } CAnonymousIndividualExpression* CConcreteOntologyEntityCollectorBuilder::getAnonymousIndividual(const QString& ontologyName, const QString& individualName) { mAnonymousIndividualNameSet.insert(individualName); return nullptr; } CAnonymousIndividualExpression* CConcreteOntologyEntityCollectorBuilder::getAnonymousIndividual(const QStringRef& ontologyName, const QStringRef& individualName) { return getAnonymousIndividual(ontologyName.toString(),individualName.toString()); } CClassAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getClassAssertion(const CEXPRESSIONLIST& expressions) { return nullptr; } CClassAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getClassAssertion(CBuildExpression* expression1, CBuildExpression* expression2) { return nullptr; } CObjectPropertyAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getObjectPropertyAssertion(const CEXPRESSIONLIST& expressions) { return nullptr; } CObjectPropertyAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getObjectPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) { return nullptr; } CNegativeObjectPropertyAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getNegativeObjectPropertyAssertion(const CEXPRESSIONLIST& expressions) { return nullptr; } CNegativeObjectPropertyAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getNegativeObjectPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) { return nullptr; } CSameIndividualExpression* CConcreteOntologyEntityCollectorBuilder::getSameIndividual(const CEXPRESSIONLIST& expressions) { return nullptr; } CDifferentIndividualsExpression* CConcreteOntologyEntityCollectorBuilder::getDifferentIndividuals(const CEXPRESSIONLIST& expressions) { return nullptr; } CClassAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getClassAssertion(CIndividualTermExpression* expression1, CClassTermExpression* expression2) { return nullptr; } CObjectPropertyAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getObjectPropertyAssertion(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2, CObjectPropertyTermExpression* expression3) { return nullptr; } CNegativeObjectPropertyAssertionExpression* CConcreteOntologyEntityCollectorBuilder::getNegativeObjectPropertyAssertion(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2, CObjectPropertyTermExpression* expression3) { return nullptr; } CSameIndividualExpression* CConcreteOntologyEntityCollectorBuilder::getSameIndividual(const CEXPRESSIONLIST& expressions) { return nullptr; } CDifferentIndividualsExpression* CConcreteOntologyEntityCollectorBuilder::getDifferentIndividuals(const CEXPRESSIONLIST& expressions) { return nullptr; } bool CConcreteOntologyEntityCollectorBuilder::tellOntologyAxiom(CAxiomExpression* axiom) { return false; } bool CConcreteOntologyEntityCollectorBuilder::retractOntologyAxiom(CAxiomExpression* axiom) { return false; } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CSatisfiableCalculationTaskFromCalculationJobGenerator.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CSatisfiableCalculationTaskFromCalculationJ0000644000175000017500000001015612520551000032352 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CSATISFIABLECALCULATIONTASKFROMCALCULATIONJOBGENERATOR_H #define KONCLUDE_REASONER_GENERATOR_CSATISFIABLECALCULATIONTASKFROMCALCULATIONJOBGENERATOR_H // Libraries includes // Namespace includes #include "CGeneratorTaskHandleContextBase.h" // Other includes #include "Reasoner/Query/CCalculationJob.h" #include "Reasoner/Query/CSatisfiableCalculationJob.h" #include "Reasoner/Query/CSatisfiableCalculationConstruct.h" #include "Reasoner/Query/CApproximatedSaturationCalculationJob.h" #include "Reasoner/Query/CSatisfiableCalculationConceptConstruct.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" #include "Reasoner/Kernel/Task/CConsistenceTaskData.h" #include "Reasoner/Kernel/Task/CSaturationTaskData.h" #include "Reasoner/Kernel/Process/CProcessContext.h" #include "Reasoner/Kernel/Process/CIndividualProcessNodeDescriptor.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Utilities/Memory/CObjectMemoryPoolAllocator.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { using namespace Query; using namespace Ontology; using namespace Kernel::Task; using namespace Kernel::Process; namespace Generator { /*! * * \class CSatisfiableCalculationTaskFromCalculationJobGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCalculationTaskFromCalculationJobGenerator { // public methods public: //! Constructor CSatisfiableCalculationTaskFromCalculationJobGenerator(CGeneratorTaskHandleContextBase* genTaskHandleContext); CSatisfiableCalculationTask* createSatisfiableCalculationTask(CCalculationJob* calculationJob, CCallbackData* additionalCalculatedCallback = nullptr); CSatisfiableCalculationTask* createSatisfiableCalculationTask(CConcreteOntology *ontology, CCalculationJob* calculationJob, CCallbackData* additionalCalculatedCallback = nullptr); CSatisfiableCalculationTask* createSatisfiableCalculationTaskExtension(CCalculationJob* calculationJob, CSatisfiableCalculationTask* baseTask, bool lastConDesReapplication, bool clearIndiProcessingQueue, CCallbackData* additionalCalculatedCallback = nullptr); CSatisfiableCalculationTask* createSatisfiableCalculationTaskExtension(CConcreteOntology *ontology, CCalculationJob* calculationJob, CSatisfiableCalculationTask* baseTask, bool lastConDesReapplication, bool clearIndiProcessingQueue, CCallbackData* additionalCalculatedCallback = nullptr); CSatisfiableCalculationTask* createApproximatedSaturationCalculationTask(CConcreteOntology *ontology, CApproximatedSaturationCalculationJob* approxSaturCalcJob, CCallbackData* additionalCalculatedCallback); // protected methods protected: // protected variables protected: CGeneratorTaskHandleContextBase* mGenTaskHandleContext; // private methods private: // private variables private: }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_GENERATOR_CSATISFIABLECALCULATIONTASKFROMCALCULATIONJOBGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CQueryBuilderGenerator.h0000644000175000017500000000374312520551000026522 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CQUERYBUILDERGENERATOR_H #define KONCLUDE_REASONER_GENERATOR_CQUERYBUILDERGENERATOR_H // Libraries includes // Namespace includes #include "CQueryGenerator.h" // Other includes #include "Reasoner/Query/CQuery.h" #include "Parser/CQueryBuilder.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Parser; namespace Reasoner { using namespace Query; namespace Generator { /*! * * \class CQueryBuilderGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQueryBuilderGenerator : public CQueryBuilder, public CQueryGenerator { // public methods public: //! Constructor CQueryBuilderGenerator(); //! Destructor virtual ~CQueryBuilderGenerator(); virtual QList generateQuerys() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_GENERATOR_CQUERYBUILDERGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CQueryGenerator.h0000644000175000017500000000354712520551000025215 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CQUERYGENERATOR_H #define KONCLUDE_REASONER_GENERATOR_CQUERYGENERATOR_H // Libraries includes // Namespace includes // Other includes #include "Reasoner/Query/CQuery.h" #include "Parser/CQueryBuilder.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Parser; namespace Reasoner { using namespace Query; namespace Generator { /*! * * \class CQueryGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQueryGenerator { // public methods public: //! Constructor CQueryGenerator(); //! Destructor virtual ~CQueryGenerator(); virtual QList generateQuerys() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_GENERATOR_CQUERYGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyUpdateCollectorBuilder.h0000644000175000017500000000733312520551000032054 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYUPDATECOLLECTORBUILDER_H #define KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYUPDATECOLLECTORBUILDER_H // Libraries includes #include #include #include #include // Namespace includes #include "CConcreteOntologyBuildDataUpdater.h" #include "CExpressionSplitter.h" #include "CExpressionHasher.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CTBox.h" #include "Reasoner/Ontology/CABox.h" #include "Reasoner/Ontology/CRBox.h" #include "Reasoner/Ontology/CAbbreviatedIRIName.h" #include "Reasoner/Ontology/CIRIName.h" #include "Utilities/CTrible.hpp" #include "Utilities/CNegLinker.hpp" #include "Utilities/CHashableIntConvertedNTuble.hpp" #include "Utilities/CMemoryManager.hpp" #include "Utilities/CDynamicExpandingMemoryManager.hpp" #include "Utilities/Memory/CObjectAllocator.h" #include "Parser/COntologyBuilder.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Memory; using namespace Parser; namespace Reasoner { using namespace Ontology; namespace Generator { /*! * * \class CConcreteOntologyUpdateCollectorBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteOntologyUpdateCollectorBuilder : public CConcreteOntologyBuildDataUpdater { // public methods public: CConcreteOntologyUpdateCollectorBuilder(CConcreteOntology* updateConcreteOntology); virtual ~CConcreteOntologyUpdateCollectorBuilder(); virtual bool initializeBuilding(); virtual bool completeBuilding(); virtual bool tellOntologyAxiom(CAxiomExpression* axiom); virtual bool retractOntologyAxiom(CAxiomExpression* axiom); virtual bool addOntologyImport(const QStringRef& name); virtual bool addOntologyImport(const QString& name); QList takeAddedImportOntologyList(); // protected functions protected: // protected variables protected: // contains also previous ontology data CONTOLOGYAXIOMSET* mTellAxiomSet; CONTOLOGYAXIOMSET* mRetractAxiomSet; CONTOLOGYAXIOMLIST< QPair >* mChangeAxiomList; // contains only updated data CONTOLOGYAXIOMSET* mTellUpdatedAxiomSet; CONTOLOGYAXIOMSET* mRetractUpdatedAxiomSet; CONTOLOGYAXIOMLIST< QPair >* mChangeUpdatedAxiomList; QSet mLocTellUpdatedAxiomSet; QSet mLocRetractUpdatedAxiomSet; QList mLocAddedImportOntologies; }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYUPDATECOLLECTORBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyMergingBuilder.cpp0000644000175000017500000013642312520550776030734 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteOntologyMergingBuilder.h" namespace Konclude { namespace Reasoner { namespace Generator { CConcreteOntologyMergingBuilder::CConcreteOntologyMergingBuilder(CConcreteOntology* baseConcreteOntology, CConcreteOntology* mergingConcreteOntology, CConcreteOntology* prevConcreteOntology) : CConcreteOntologyBuildDataUpdater(mergingConcreteOntology) { LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcretOntologyMergingBuilder",logTr("ConcretOntologyMergingBuilder initialized."),this); mMergingConcreteOntology = mergingConcreteOntology; mBaseConcreteOntology = baseConcreteOntology; mPrevConcreteOntology = prevConcreteOntology; initJumpingHash(); } CConcreteOntologyMergingBuilder::~CConcreteOntologyMergingBuilder() { } bool CConcreteOntologyMergingBuilder::initializeBuilding() { CConcreteOntologyBuildDataUpdater::initializeBuilding(); mTellAxiomSet = mOntoBuild->getTellAxiomSet(); mRetractAxiomSet = mOntoBuild->getRetractAxiomSet(); mTellUpdatedAxiomSet = mOntoBuild->getUpdatedTellAxiomSet(); mRetractUpdatedAxiomSet = mOntoBuild->getUpdatedRetractAxiomSet(); mChangeAxiomList = mOntoBuild->getChangeAxiomList(); mChangeUpdatedAxiomList = mOntoBuild->getUpdatedChangeAxiomList(); cint64 nextNewAxiom = mPrevConcreteOntology->getBuildData()->getChangeAxiomList()->count(); while (nextNewAxiom < mChangeUpdatedAxiomList->count()) { QPair changedAxiomPair((*mChangeUpdatedAxiomList)[nextNewAxiom++]); mMergeChangeAxiomList.append( QPair(changedAxiomPair) ); } cint64 nextNewPrefix = mPrevConcreteOntology->getStringMapping()->getPrefixList()->count(); while (nextNewPrefix < mPrefixList->count()) { CNamePrefix* namePrefix = (*mPrefixList)[nextNewPrefix++]; mMergePrefixList.append( namePrefix ); } COntologyStringMapping* baseOntoStrings = mBaseConcreteOntology->getStringMapping(); COntologyBuildData* baseOntoBuild = mBaseConcreteOntology->getBuildData(); mTopClassExpression = baseOntoBuild->getTopClassExpression(); mBottomClassExpression = baseOntoBuild->getBottomClassExpression(); mTopObjPropExpression = baseOntoBuild->getTopObjectPropertyExpression(); mBottomObjPropExpression = baseOntoBuild->getBottomObjectPropertyExpression(); *mDeclarationAxiomSet = *baseOntoBuild->getDeclarationAxiomSet(); *mBuildConceptSet = *baseOntoBuild->getBuildConceptSet(); *mBuildObjectRoleSet = *baseOntoBuild->getBuildObjectRoleSet(); *mBuildIndividualSet = *baseOntoBuild->getBuildIndividualSet(); *mBuildConceptList = *baseOntoBuild->getBuildConceptList(); *mBuildObjectRoleList = *baseOntoBuild->getBuildObjectRoleList(); *mBuildIndividualList = *baseOntoBuild->getBuildIndividualList(); *mInverseObjectPropertyHash = *baseOntoBuild->getInverseObjectPropertyHash(); *mInverseObjectPropertyList = *baseOntoBuild->getInverseObjectPropertyList(); *mExpressionBuildHash = *baseOntoBuild->getStructuralExpressionBuildHash(); *mClassBuildHash = *baseOntoBuild->getClassEntityBuildHash(); *mObjectPropertyBuildHash = *baseOntoBuild->getObjectPropertyEntityBuildHash(); *mIndividualBuildHash = *baseOntoBuild->getIndividualEntityBuildHash(); *mAnoIndividualBuildHash = *baseOntoBuild->getAnonymousIndividualBuildHash(); *mIndividualVariableBuildHash = *baseOntoBuild->getIndividualVariableBuildHash(); *mAbbreviatedNamePrefixMapHash = *baseOntoStrings->getAbbreviatedNamePrefixHash(); *mNamePrefixMapHash = *baseOntoStrings->getNamePrefixHash(); *mPrefixList = *baseOntoStrings->getPrefixList(); *mIndividualVariableIDHash = *baseOntoBuild->getIndividualVariableIDHash(); *mTellAxiomSet = *baseOntoBuild->getTellAxiomSet(); *mRetractAxiomSet = *baseOntoBuild->getRetractAxiomSet(); *mTellUpdatedAxiomSet = *baseOntoBuild->getUpdatedTellAxiomSet(); *mRetractUpdatedAxiomSet = *baseOntoBuild->getUpdatedRetractAxiomSet(); *mChangeAxiomList = *baseOntoBuild->getChangeAxiomList(); *mChangeUpdatedAxiomList = *baseOntoBuild->getUpdatedChangeAxiomList(); return true; } CMergeExpressionStackObject* CConcreteOntologyMergingBuilder::createMergeExpressionStackObject(CBuildExpression* expression) { CMergeExpressionStackObject* mergeExpStackObj = new CMergeExpressionStackObject(expression); mMergeExpContainer.append(mergeExpStackObj); const CMergeExpressionFunctionPair& mergeExpFuncPair(mMergeExpFunctionJumpHash.value((cint64)expression->getType())); mergeExpStackObj->mEndFunction = mergeExpFuncPair.mEndFunction; mergeExpStackObj->mStartFunction = mergeExpFuncPair.mStartFunction; if (mergeExpStackObj->mStartFunction) { FStartMergeExpressionFunction startFunction = mergeExpStackObj->mStartFunction; (this->*startFunction)(mergeExpStackObj); } return mergeExpStackObj; } CBuildExpression* CConcreteOntologyMergingBuilder::handleMergeEpxressionStack(CBuildExpression* expression) { CMergeExpressionStackObject* newMergeExpStackObj = nullptr; CMergeExpressionStackObject* nextMergeExpStackObj = createMergeExpressionStackObject(expression); mMergeExpStack.push(nextMergeExpStackObj); while (!mMergeExpStack.isEmpty()) { nextMergeExpStackObj = mMergeExpStack.top(); if (nextMergeExpStackObj->hasProcessingExpressions()) { CBuildExpression* nextExpression = nextMergeExpStackObj->mProcessingExpList.takeFirst(); mMergeExpStack.push(createMergeExpressionStackObject(nextExpression)); } else { nextMergeExpStackObj = mMergeExpStack.pop(); if (nextMergeExpStackObj->mEndFunction) { FEndMergeExpressionFunction endFunction = nextMergeExpStackObj->mEndFunction; (this->*endFunction)(nextMergeExpStackObj); } CBuildExpression* replacedExpression = nextMergeExpStackObj->mReplaceExpression; if (!mMergeExpStack.isEmpty()) { nextMergeExpStackObj = mMergeExpStack.top(); nextMergeExpStackObj->addReplacedBuildExpression(replacedExpression); } else { newMergeExpStackObj->mReplaceExpression = replacedExpression; } } } return newMergeExpStackObj->mReplaceExpression; } bool CConcreteOntologyMergingBuilder::mergingBuilding() { for (CMAPPINGLIST::const_iterator it = mMergePrefixList.constBegin(), itEnd = mMergePrefixList.constEnd(); it != itEnd; ++it) { CNamePrefix* namePrefix(*it); mAbbreviatedNamePrefixMapHash->insert(namePrefix->getAbbreviatedPrefixString(),namePrefix); mNamePrefixMapHash->insert(namePrefix->getPrefixString(),namePrefix); } for (CONTOLOGYAXIOMLIST< QPair >::const_iterator it = mMergeChangeAxiomList.constBegin(), itEnd = mMergeChangeAxiomList.constEnd(); it != itEnd; ++it) { QPair changeAxiomPair(*it); CAxiomExpression* axiomExp(changeAxiomPair.first); bool axiomAdded(changeAxiomPair.second); CAxiomExpression* newAxiomExp = (CAxiomExpression*)handleMergeEpxressionStack(axiomExp); if (axiomAdded) { tellOntologyAxiom(newAxiomExp); } else { retractOntologyAxiom(newAxiomExp); } mNextAxiomNumber++; } return true; } bool CConcreteOntologyMergingBuilder::completeBuilding() { FOREACHIT (CAxiomExpression* axiomExp, *mRetractUpdatedAxiomSet) { mChangeUpdatedAxiomList->append( QPair(axiomExp,false) ); mChangeAxiomList->append( QPair(axiomExp,false) ); } FOREACHIT (CAxiomExpression* axiomExp, *mTellUpdatedAxiomSet) { mChangeUpdatedAxiomList->append( QPair(axiomExp,true) ); mChangeAxiomList->append( QPair(axiomExp,true) ); } mOntoBuild->setNextAxiomNumber(mNextAxiomNumber+mNextMaxAxiomNumberOffset); return true; } bool CConcreteOntologyMergingBuilder::tellOntologyAxiom(CAxiomExpression* axiom) { if (!mTellAxiomSet->contains(axiom)) { mRetractAxiomSet->remove(axiom); mTellAxiomSet->insert(axiom); if (mRetractUpdatedAxiomSet->contains(axiom)) { mRetractUpdatedAxiomSet->remove(axiom); } else { mTellUpdatedAxiomSet->insert(axiom); } } return true; } bool CConcreteOntologyMergingBuilder::retractOntologyAxiom(CAxiomExpression* axiom) { if (mTellAxiomSet->contains(axiom)) { mTellAxiomSet->remove(axiom); mRetractAxiomSet->insert(axiom); if (mTellUpdatedAxiomSet->contains(axiom)) { mTellUpdatedAxiomSet->remove(axiom); } else { mRetractUpdatedAxiomSet->insert(axiom); } } return true; } CConcreteOntologyMergingBuilder* CConcreteOntologyMergingBuilder::initJumpingHash() { mMergeExpFunctionJumpHash.insert((cint64)CClassExpression::BETCLASS,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseClassStart,&CConcreteOntologyMergingBuilder::parseClassEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectIndividualVariableExpression::BETINDIVIDUALVARIABLE,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseIndividualVariableStart,&CConcreteOntologyMergingBuilder::parseIndividualVariableEnd)); mMergeExpFunctionJumpHash.insert((cint64)CEquivalentClassesExpression::BETEQUIVALENTCLASSES,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseEquivalentClassesStart,&CConcreteOntologyMergingBuilder::parseEquivalentClassesEnd)); mMergeExpFunctionJumpHash.insert((cint64)CSubClassOfExpression::BETESUBCLASSOF,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseSubClassOfStart,&CConcreteOntologyMergingBuilder::parseSubClassOfEnd)); mMergeExpFunctionJumpHash.insert((cint64)CDisjointClassesExpression::BETDISJOINTCLASSES,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseDisjointClassesStart,&CConcreteOntologyMergingBuilder::parseDisjointClassesEnd)); mMergeExpFunctionJumpHash.insert((cint64)CDisjointUnionExpression::BETDISJOINTUNION,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseDisjointUnionStart,&CConcreteOntologyMergingBuilder::parseDisjointUnionEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectComplementOfExpression::BETOBJECTCOMPLEMENTOF,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectComplementOfStart,&CConcreteOntologyMergingBuilder::parseObjectComplementOfEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectIntersectionOfExpression::BETOBJECTINTERSECTION,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectIntersectionOfStart,&CConcreteOntologyMergingBuilder::parseObjectIntersectionOfEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectUnionOfExpression::BETOBJECTUNION,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectUnionOfStart,&CConcreteOntologyMergingBuilder::parseObjectUnionOfEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectMaxCardinalityExpression::BETOBJECTMAXCARDINALITY,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectMaxCardinalityStart,&CConcreteOntologyMergingBuilder::parseObjectMaxCardinalityEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectMinCardinalityExpression::BETOBJECTMINCARDINALITY,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectMinCardinalityStart,&CConcreteOntologyMergingBuilder::parseObjectMinCardinalityEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectExactlyCardinalityExpression::BETOBJECTEXACTLYCARDINALITY,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectExactlyCardinalityStart,&CConcreteOntologyMergingBuilder::parseObjectExactlyCardinalityEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectAllValuesFromExpression::BETOBJECTALLVALUEFROM,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectAllValuesFromStart,&CConcreteOntologyMergingBuilder::parseObjectAllValuesFromEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectSomeValuesFromExpression::BETOBJECTSOMEVALUEFROM,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectSomeValuesFromStart,&CConcreteOntologyMergingBuilder::parseObjectSomeValuesFromEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectOneOfExpression::BETOBJECTONEOF,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectOneOfStart,&CConcreteOntologyMergingBuilder::parseObjectOneOfEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectHasValueExpression::BETOBJECTHASVALUE,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectHasValueStart,&CConcreteOntologyMergingBuilder::parseObjectHasValueEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectHasSelfExpression::BETOBJECTHASSELF,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectHasSelfStart,&CConcreteOntologyMergingBuilder::parseObjectHasSelfEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectPropertyExpression::BETOBJECTPROPERTY,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectProbertyStart,&CConcreteOntologyMergingBuilder::parseObjectProbertyEnd)); mMergeExpFunctionJumpHash.insert((cint64)CSubObjectPropertyOfExpression::BETSUBOBJECTPROPERTYOF,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseSubObjectPropertyOfStart,&CConcreteOntologyMergingBuilder::parseSubObjectPropertyOfEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectPropertyDomainExpression::BETOBJECTPROPERTYDOMAIN,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectPropertyDomainStart,&CConcreteOntologyMergingBuilder::parseObjectPropertyDomainEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectPropertyRangeExpression::BETOBJECTPROPERTYRANGE,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectPropertyRangeStart,&CConcreteOntologyMergingBuilder::parseObjectPropertyRangeEnd)); mMergeExpFunctionJumpHash.insert((cint64)CInverseObjectPropertiesExpression::BETINVERSEOBJECTPROPERTIES,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseInverseObjectPropertiesStart,&CConcreteOntologyMergingBuilder::parseInverseObjectPropertiesEnd)); mMergeExpFunctionJumpHash.insert((cint64)CTransetiveObjectPropertyExpression::BETTRANSITIVEOBJECTPROPERTY,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseTransetiveObjectPropertyStart,&CConcreteOntologyMergingBuilder::parseTransetiveObjectPropertyEnd)); mMergeExpFunctionJumpHash.insert((cint64)CFunctionalObjectPropertyExpression::BETFUNCTIONALOBJECTPROPERTY,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseFunctionalObjectPropertyStart,&CConcreteOntologyMergingBuilder::parseFunctionalObjectPropertyEnd)); mMergeExpFunctionJumpHash.insert((cint64)CInverseFunctionalObjectPropertyExpression::BETINVERSEFUNCTIONALPROPERTY,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseInverseFunctionalObjectPropertyStart,&CConcreteOntologyMergingBuilder::parseInverseFunctionalObjectPropertyEnd)); mMergeExpFunctionJumpHash.insert((cint64)CInverseObjectPropertyOfExpression::BETINVERSEOBJECTPROPERTYOF,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseInverseObjectPropertyOfStart,&CConcreteOntologyMergingBuilder::parseInverseObjectPropertyOfEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectPropertyChainExpression::BETOBJECTPROPERTYCHAIN,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectPropertyChainStart,&CConcreteOntologyMergingBuilder::parseObjectPropertyChainEnd)); mMergeExpFunctionJumpHash.insert((cint64)CEquivalentObjectPropertiesExpression::BETEQUIVALENTOBJECTPROPERTIES,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseEquivalentObjectPropertiesStart,&CConcreteOntologyMergingBuilder::parseEquivalentObjectPropertiesEnd)); mMergeExpFunctionJumpHash.insert((cint64)CDisjointObjectPropertiesExpression::BETDISJOINTOBJECTPROPERTIES,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseDisjointObjectPropertiesStart,&CConcreteOntologyMergingBuilder::parseDisjointObjectPropertiesEnd)); mMergeExpFunctionJumpHash.insert((cint64)CSymmetricObjectPropertyExpression::BETSYMMETRICPROPERTY,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseSymmetricObjectPropertyStart,&CConcreteOntologyMergingBuilder::parseSymmetricObjectPropertyEnd)); mMergeExpFunctionJumpHash.insert((cint64)CAsymmetricObjectPropertyExpression::BETASYMMETRICPROPERTY,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseAsymmetricObjectPropertyStart,&CConcreteOntologyMergingBuilder::parseAsymmetricObjectPropertyEnd)); mMergeExpFunctionJumpHash.insert((cint64)CReflexiveObjectPropertyExpression::BETREFLEXIVEPROPERTY,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseReflexiveObjectPropertyStart,&CConcreteOntologyMergingBuilder::parseReflexiveObjectPropertyEnd)); mMergeExpFunctionJumpHash.insert((cint64)CIrreflexiveObjectPropertyExpression::BETIRREFLEXIVEPROPERTY,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseIrreflexiveObjectPropertyStart,&CConcreteOntologyMergingBuilder::parseIrreflexiveObjectPropertyEnd)); mMergeExpFunctionJumpHash.insert((cint64)CNamedIndividualExpression::BETNAMEDINDIVIDUAL,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseNamedIndividualStart,&CConcreteOntologyMergingBuilder::parseNamedIndividualEnd)); mMergeExpFunctionJumpHash.insert((cint64)CAnonymousIndividualExpression::BETANONYMOUSINDIVIDUAL,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseAnonymousIndividualStart,&CConcreteOntologyMergingBuilder::parseAnonymousIndividualEnd)); mMergeExpFunctionJumpHash.insert((cint64)CClassAssertionExpression::BETCLASSASSERTION,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseClassAssertionStart,&CConcreteOntologyMergingBuilder::parseClassAssertionEnd)); mMergeExpFunctionJumpHash.insert((cint64)CObjectPropertyAssertionExpression::BETOBJECTPROPERTYASSERTION,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseObjectPropertyAssertionStart,&CConcreteOntologyMergingBuilder::parseObjectPropertyAssertionEnd)); mMergeExpFunctionJumpHash.insert((cint64)CNegativeObjectPropertyAssertionExpression::BETNEGATIVEOBJECTPROPERTYASSERTION,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseNegativeObjectPropertyAssertionStart,&CConcreteOntologyMergingBuilder::parseNegativeObjectPropertyAssertionEnd)); mMergeExpFunctionJumpHash.insert((cint64)CSameIndividualExpression::BETSAMEINDIVIDUAL,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseSameIndividualStart,&CConcreteOntologyMergingBuilder::parseSameIndividualEnd)); mMergeExpFunctionJumpHash.insert((cint64)CDifferentIndividualsExpression::BETDIFFERENTINDIVIDUAL,CMergeExpressionFunctionPair(&CConcreteOntologyMergingBuilder::parseDifferentIndividualsStart,&CConcreteOntologyMergingBuilder::parseDifferentIndividualsEnd)); return this; } void CConcreteOntologyMergingBuilder::addExpressions(CMergeExpressionStackObject* mergeStackObj, CEXPRESSIONLIST* expressionList) { for (CEXPRESSIONLIST::const_iterator it = expressionList->constBegin(), itEnd = expressionList->constEnd(); it != itEnd; ++it) { mergeStackObj->addProcessingBuildExpression(*it); } } void CConcreteOntologyMergingBuilder::addExpressions(CMergeExpressionStackObject* mergeStackObj, CEXPRESSIONLIST* expressionList) { for (CEXPRESSIONLIST::const_iterator it = expressionList->constBegin(), itEnd = expressionList->constEnd(); it != itEnd; ++it) { mergeStackObj->addProcessingBuildExpression(*it); } } void CConcreteOntologyMergingBuilder::addExpressions(CMergeExpressionStackObject* mergeStackObj, CEXPRESSIONLIST* expressionList) { for (CEXPRESSIONLIST::const_iterator it = expressionList->constBegin(), itEnd = expressionList->constEnd(); it != itEnd; ++it) { mergeStackObj->addProcessingBuildExpression(*it); } } void CConcreteOntologyMergingBuilder::addExpressions(CMergeExpressionStackObject* mergeStackObj, CEXPRESSIONLIST* expressionList) { for (CEXPRESSIONLIST::const_iterator it = expressionList->constBegin(), itEnd = expressionList->constEnd(); it != itEnd; ++it) { mergeStackObj->addProcessingBuildExpression(*it); } } void CConcreteOntologyMergingBuilder::addExpressions(CMergeExpressionStackObject* mergeStackObj, CBuildExpression* expression) { mergeStackObj->addProcessingBuildExpression(expression); } void CConcreteOntologyMergingBuilder::parseClassStart(CMergeExpressionStackObject* mergeStackObj) { } void CConcreteOntologyMergingBuilder::parseIndividualVariableStart(CMergeExpressionStackObject* mergeStackObj) { } void CConcreteOntologyMergingBuilder::parseEquivalentClassesStart(CMergeExpressionStackObject* mergeStackObj) { CEquivalentClassesExpression* expression = (CEquivalentClassesExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getClassTermExpressionList()); } void CConcreteOntologyMergingBuilder::parseSubClassOfStart(CMergeExpressionStackObject* mergeStackObj) { CSubClassOfExpression* expression = (CSubClassOfExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getSubClassTermExpression()); addExpressions(mergeStackObj,expression->getSuperClassTermExpression()); } void CConcreteOntologyMergingBuilder::parseDisjointClassesStart(CMergeExpressionStackObject* mergeStackObj) { CDisjointClassesExpression* expression = (CDisjointClassesExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getClassTermExpressionList()); } void CConcreteOntologyMergingBuilder::parseDisjointUnionStart(CMergeExpressionStackObject* mergeStackObj) { CDisjointUnionExpression* expression = (CDisjointUnionExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getClassExpression()); addExpressions(mergeStackObj,expression->getClassTermExpressionList()); } void CConcreteOntologyMergingBuilder::parseObjectComplementOfStart(CMergeExpressionStackObject* mergeStackObj) { CObjectComplementOfExpression* expression = (CObjectComplementOfExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getClassTermExpression()); } void CConcreteOntologyMergingBuilder::parseObjectIntersectionOfStart(CMergeExpressionStackObject* mergeStackObj) { CObjectIntersectionOfExpression* expression = (CObjectIntersectionOfExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getClassTermExpressionList()); } void CConcreteOntologyMergingBuilder::parseObjectUnionOfStart(CMergeExpressionStackObject* mergeStackObj) { CObjectUnionOfExpression* expression = (CObjectUnionOfExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getClassTermExpressionList()); } void CConcreteOntologyMergingBuilder::parseObjectMaxCardinalityStart(CMergeExpressionStackObject* mergeStackObj) { CObjectMaxCardinalityExpression* expression = (CObjectMaxCardinalityExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getClassTermExpression()); addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseObjectMinCardinalityStart(CMergeExpressionStackObject* mergeStackObj) { CObjectMinCardinalityExpression* expression = (CObjectMinCardinalityExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getClassTermExpression()); addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseObjectExactlyCardinalityStart(CMergeExpressionStackObject* mergeStackObj) { CObjectExactlyCardinalityExpression* expression = (CObjectExactlyCardinalityExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getClassTermExpression()); addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseObjectAllValuesFromStart(CMergeExpressionStackObject* mergeStackObj) { CObjectAllValuesFromExpression* expression = (CObjectAllValuesFromExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getClassTermExpression()); addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseObjectSomeValuesFromStart(CMergeExpressionStackObject* mergeStackObj) { CObjectSomeValuesFromExpression* expression = (CObjectSomeValuesFromExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getClassTermExpression()); addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseObjectOneOfStart(CMergeExpressionStackObject* mergeStackObj) { CObjectOneOfExpression* expression = (CObjectOneOfExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getIndividualTermExpressionList()); } void CConcreteOntologyMergingBuilder::parseObjectHasValueStart(CMergeExpressionStackObject* mergeStackObj) { CObjectHasValueExpression* expression = (CObjectHasValueExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); addExpressions(mergeStackObj,expression->getIndividualTermExpression()); } void CConcreteOntologyMergingBuilder::parseObjectHasSelfStart(CMergeExpressionStackObject* mergeStackObj) { CObjectHasSelfExpression* expression = (CObjectHasSelfExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseObjectProbertyStart(CMergeExpressionStackObject* mergeStackObj) { } void CConcreteOntologyMergingBuilder::parseSubObjectPropertyOfStart(CMergeExpressionStackObject* mergeStackObj) { CSubObjectPropertyOfExpression* expression = (CSubObjectPropertyOfExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getSubObjectPropertyTermExpressionList()); addExpressions(mergeStackObj,expression->getSuperObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseObjectPropertyDomainStart(CMergeExpressionStackObject* mergeStackObj) { CObjectPropertyDomainExpression* expression = (CObjectPropertyDomainExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); addExpressions(mergeStackObj,expression->getClassTermExpression()); } void CConcreteOntologyMergingBuilder::parseObjectPropertyRangeStart(CMergeExpressionStackObject* mergeStackObj) { CObjectPropertyRangeExpression* expression = (CObjectPropertyRangeExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); addExpressions(mergeStackObj,expression->getClassTermExpression()); } void CConcreteOntologyMergingBuilder::parseInverseObjectPropertiesStart(CMergeExpressionStackObject* mergeStackObj) { CInverseObjectPropertiesExpression* expression = (CInverseObjectPropertiesExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getFirstObjectPropertyTermExpression()); addExpressions(mergeStackObj,expression->getSecondObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseTransetiveObjectPropertyStart(CMergeExpressionStackObject* mergeStackObj) { CTransetiveObjectPropertyExpression* expression = (CTransetiveObjectPropertyExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseFunctionalObjectPropertyStart(CMergeExpressionStackObject* mergeStackObj) { CFunctionalObjectPropertyExpression* expression = (CFunctionalObjectPropertyExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseInverseFunctionalObjectPropertyStart(CMergeExpressionStackObject* mergeStackObj) { CInverseFunctionalObjectPropertyExpression* expression = (CInverseFunctionalObjectPropertyExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseInverseObjectPropertyOfStart(CMergeExpressionStackObject* mergeStackObj) { CInverseObjectPropertyOfExpression* expression = (CInverseObjectPropertyOfExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseObjectPropertyChainStart(CMergeExpressionStackObject* mergeStackObj) { CObjectPropertyChainExpression* expression = (CObjectPropertyChainExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getChainObjectPropertyTermExpressionList()); } void CConcreteOntologyMergingBuilder::parseEquivalentObjectPropertiesStart(CMergeExpressionStackObject* mergeStackObj) { CEquivalentObjectPropertiesExpression* expression = (CEquivalentObjectPropertiesExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getObjectPropertyTermExpressionList()); } void CConcreteOntologyMergingBuilder::parseDisjointObjectPropertiesStart(CMergeExpressionStackObject* mergeStackObj) { CDisjointObjectPropertiesExpression* expression = (CDisjointObjectPropertiesExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getObjectPropertyTermExpressionList()); } void CConcreteOntologyMergingBuilder::parseSymmetricObjectPropertyStart(CMergeExpressionStackObject* mergeStackObj) { CSymmetricObjectPropertyExpression* expression = (CSymmetricObjectPropertyExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseAsymmetricObjectPropertyStart(CMergeExpressionStackObject* mergeStackObj) { CAsymmetricObjectPropertyExpression* expression = (CAsymmetricObjectPropertyExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseReflexiveObjectPropertyStart(CMergeExpressionStackObject* mergeStackObj) { CReflexiveObjectPropertyExpression* expression = (CReflexiveObjectPropertyExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseIrreflexiveObjectPropertyStart(CMergeExpressionStackObject* mergeStackObj) { CIrreflexiveObjectPropertyExpression* expression = (CIrreflexiveObjectPropertyExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseNamedIndividualStart(CMergeExpressionStackObject* mergeStackObj) { } void CConcreteOntologyMergingBuilder::parseAnonymousIndividualStart(CMergeExpressionStackObject* mergeStackObj) { } void CConcreteOntologyMergingBuilder::parseClassAssertionStart(CMergeExpressionStackObject* mergeStackObj) { CClassAssertionExpression* expression = (CClassAssertionExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getIndividualTermExpression()); addExpressions(mergeStackObj,expression->getClassTermExpression()); } void CConcreteOntologyMergingBuilder::parseObjectPropertyAssertionStart(CMergeExpressionStackObject* mergeStackObj) { CObjectPropertyAssertionExpression* expression = (CObjectPropertyAssertionExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getFirstIndividualTermExpression()); addExpressions(mergeStackObj,expression->getSecondIndividualTermExpression()); addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseNegativeObjectPropertyAssertionStart(CMergeExpressionStackObject* mergeStackObj) { CNegativeObjectPropertyAssertionExpression* expression = (CNegativeObjectPropertyAssertionExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getFirstIndividualTermExpression()); addExpressions(mergeStackObj,expression->getSecondIndividualTermExpression()); addExpressions(mergeStackObj,expression->getObjectPropertyTermExpression()); } void CConcreteOntologyMergingBuilder::parseSameIndividualStart(CMergeExpressionStackObject* mergeStackObj) { CSameIndividualExpression* expression = (CSameIndividualExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getIndividualTermExpressionList()); } void CConcreteOntologyMergingBuilder::parseDifferentIndividualsStart(CMergeExpressionStackObject* mergeStackObj) { CDifferentIndividualsExpression* expression = (CDifferentIndividualsExpression*)mergeStackObj->mExpression; addExpressions(mergeStackObj,expression->getIndividualTermExpressionList()); } void CConcreteOntologyMergingBuilder::parseClassEnd(CMergeExpressionStackObject* mergeStackObj) { CClassExpression* expression = (CClassExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getClass(expression->getName()); } void CConcreteOntologyMergingBuilder::parseIndividualVariableEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectIndividualVariableExpression* expression = (CObjectIndividualVariableExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getIndividualVariable(expression->getName(),mNextAxiomNumber); } void CConcreteOntologyMergingBuilder::parseEquivalentClassesEnd(CMergeExpressionStackObject* mergeStackObj) { CEquivalentClassesExpression* expression = (CEquivalentClassesExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getEquivalentClasses(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseSubClassOfEnd(CMergeExpressionStackObject* mergeStackObj) { CEquivalentClassesExpression* expression = (CEquivalentClassesExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getSubClassOf(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseDisjointClassesEnd(CMergeExpressionStackObject* mergeStackObj) { CDisjointClassesExpression* expression = (CDisjointClassesExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getDisjointClasses(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseDisjointUnionEnd(CMergeExpressionStackObject* mergeStackObj) { CDisjointUnionExpression* expression = (CDisjointUnionExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getDisjointUnion(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseObjectComplementOfEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectComplementOfExpression* expression = (CObjectComplementOfExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectComplementOf(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseObjectIntersectionOfEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectIntersectionOfExpression* expression = (CObjectIntersectionOfExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectIntersectionOf(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseObjectUnionOfEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectUnionOfExpression* expression = (CObjectUnionOfExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectUnionOf(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseObjectMaxCardinalityEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectMaxCardinalityExpression* expression = (CObjectMaxCardinalityExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectMaxCardinality(*mergeStackObj->getReplacedExpressions(),expression->getCardinality()); } void CConcreteOntologyMergingBuilder::parseObjectMinCardinalityEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectMinCardinalityExpression* expression = (CObjectMinCardinalityExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectMinCardinality(*mergeStackObj->getReplacedExpressions(),expression->getCardinality()); } void CConcreteOntologyMergingBuilder::parseObjectExactlyCardinalityEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectExactlyCardinalityExpression* expression = (CObjectExactlyCardinalityExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectExactlyCardinality(*mergeStackObj->getReplacedExpressions(),expression->getCardinality()); } void CConcreteOntologyMergingBuilder::parseObjectAllValuesFromEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectAllValuesFromExpression* expression = (CObjectAllValuesFromExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectAllValuesFrom(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseObjectSomeValuesFromEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectSomeValuesFromExpression* expression = (CObjectSomeValuesFromExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectSomeValuesFrom(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseObjectOneOfEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectOneOfExpression* expression = (CObjectOneOfExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectOneOf(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseObjectHasValueEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectHasValueExpression* expression = (CObjectHasValueExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectHasValue(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseObjectHasSelfEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectHasSelfExpression* expression = (CObjectHasSelfExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectHasSelf(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseObjectProbertyEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectPropertyExpression* expression = (CObjectPropertyExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectProberty(expression->getName()); } void CConcreteOntologyMergingBuilder::parseSubObjectPropertyOfEnd(CMergeExpressionStackObject* mergeStackObj) { CSubObjectPropertyOfExpression* expression = (CSubObjectPropertyOfExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getSubObjectPropertyOf(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseObjectPropertyDomainEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectPropertyDomainExpression* expression = (CObjectPropertyDomainExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectPropertyDomainExpression(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseObjectPropertyRangeEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectPropertyRangeExpression* expression = (CObjectPropertyRangeExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectPropertyRangeExpression(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseInverseObjectPropertiesEnd(CMergeExpressionStackObject* mergeStackObj) { CInverseObjectPropertiesExpression* expression = (CInverseObjectPropertiesExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getInverseObjectProperties(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseTransetiveObjectPropertyEnd(CMergeExpressionStackObject* mergeStackObj) { CTransetiveObjectPropertyExpression* expression = (CTransetiveObjectPropertyExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getTransetiveObjectProperty(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseFunctionalObjectPropertyEnd(CMergeExpressionStackObject* mergeStackObj) { CFunctionalObjectPropertyExpression* expression = (CFunctionalObjectPropertyExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getFunctionalObjectProperty(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseInverseFunctionalObjectPropertyEnd(CMergeExpressionStackObject* mergeStackObj) { CInverseFunctionalObjectPropertyExpression* expression = (CInverseFunctionalObjectPropertyExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getInverseFunctionalObjectProperty(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseInverseObjectPropertyOfEnd(CMergeExpressionStackObject* mergeStackObj) { CInverseObjectPropertyOfExpression* expression = (CInverseObjectPropertyOfExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getInverseObjectPropertyOf(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseObjectPropertyChainEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectPropertyChainExpression* expression = (CObjectPropertyChainExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectPropertyChain(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseEquivalentObjectPropertiesEnd(CMergeExpressionStackObject* mergeStackObj) { CEquivalentObjectPropertiesExpression* expression = (CEquivalentObjectPropertiesExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getEquivalentObjectProperties(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseDisjointObjectPropertiesEnd(CMergeExpressionStackObject* mergeStackObj) { CDisjointObjectPropertiesExpression* expression = (CDisjointObjectPropertiesExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getDisjointObjectProperties(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseSymmetricObjectPropertyEnd(CMergeExpressionStackObject* mergeStackObj) { CSymmetricObjectPropertyExpression* expression = (CSymmetricObjectPropertyExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getSymmetricObjectProperty(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseAsymmetricObjectPropertyEnd(CMergeExpressionStackObject* mergeStackObj) { CAsymmetricObjectPropertyExpression* expression = (CAsymmetricObjectPropertyExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getAsymmetricObjectProperty(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseReflexiveObjectPropertyEnd(CMergeExpressionStackObject* mergeStackObj) { CReflexiveObjectPropertyExpression* expression = (CReflexiveObjectPropertyExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getReflexiveObjectProperty(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseIrreflexiveObjectPropertyEnd(CMergeExpressionStackObject* mergeStackObj) { CIrreflexiveObjectPropertyExpression* expression = (CIrreflexiveObjectPropertyExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getIrreflexiveObjectProperty(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseNamedIndividualEnd(CMergeExpressionStackObject* mergeStackObj) { CNamedIndividualExpression* expression = (CNamedIndividualExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getNamedIndividual(expression->getName()); } void CConcreteOntologyMergingBuilder::parseAnonymousIndividualEnd(CMergeExpressionStackObject* mergeStackObj) { CAnonymousIndividualExpression* expression = (CAnonymousIndividualExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getAnonymousIndividual(expression->getOntologyName(),expression->getNodeName()); } void CConcreteOntologyMergingBuilder::parseClassAssertionEnd(CMergeExpressionStackObject* mergeStackObj) { CClassAssertionExpression* expression = (CClassAssertionExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getClassAssertion(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseObjectPropertyAssertionEnd(CMergeExpressionStackObject* mergeStackObj) { CObjectPropertyAssertionExpression* expression = (CObjectPropertyAssertionExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getObjectPropertyAssertion(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseNegativeObjectPropertyAssertionEnd(CMergeExpressionStackObject* mergeStackObj) { CNegativeObjectPropertyAssertionExpression* expression = (CNegativeObjectPropertyAssertionExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getNegativeObjectPropertyAssertion(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseSameIndividualEnd(CMergeExpressionStackObject* mergeStackObj) { CSameIndividualExpression* expression = (CSameIndividualExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getSameIndividual(*mergeStackObj->getReplacedExpressions()); } void CConcreteOntologyMergingBuilder::parseDifferentIndividualsEnd(CMergeExpressionStackObject* mergeStackObj) { CDifferentIndividualsExpression* expression = (CDifferentIndividualsExpression*)mergeStackObj->mExpression; mergeStackObj->mReplaceExpression = getDifferentIndividuals(*mergeStackObj->getReplacedExpressions()); } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyUpdateBuilder.h0000644000175000017500000003357712520551000030216 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYUPDATEBUILDER_H #define KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYUPDATEBUILDER_H // Libraries includes #include #include #include #include // Namespace includes #include "CConcreteOntologyBuildDataUpdater.h" #include "CExpressionSplitter.h" #include "CExpressionHasher.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CTBox.h" #include "Reasoner/Ontology/CABox.h" #include "Reasoner/Ontology/CRBox.h" #include "Reasoner/Ontology/CAbbreviatedIRIName.h" #include "Reasoner/Ontology/CIRIName.h" #include "Utilities/CTrible.hpp" #include "Utilities/CNegLinker.hpp" #include "Utilities/CHashableIntConvertedNTuble.hpp" #include "Utilities/CMemoryManager.hpp" #include "Utilities/CDynamicExpandingMemoryManager.hpp" #include "Utilities/Memory/CObjectAllocator.h" #include "Parser/COntologyBuilder.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Memory; using namespace Parser; namespace Reasoner { using namespace Ontology; namespace Generator { /*! * * \class CConcreteOntologyUpdateBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteOntologyUpdateBuilder : public CConcreteOntologyBuildDataUpdater { // public methods public: CConcreteOntologyUpdateBuilder(CConcreteOntology* updateConcreteOntology); virtual ~CConcreteOntologyUpdateBuilder(); virtual bool initializeBuilding(); virtual bool completeBuilding(); virtual bool tellOntologyAxiom(CAxiomExpression* axiom); virtual bool retractOntologyAxiom(CAxiomExpression* axiom); // protected functions protected: bool setConceptOperands(CConcept* concept, CConcept* operandConcept, bool negate = false); bool setConceptOperandsFromClassTerms(CConcept* concept, CEXPRESSIONLIST* classTermList, bool negate = false); bool setConceptOperandsFromClassTerms(CConcept* concept, CClassTermExpression* classTermExp, bool negate = false); bool setConceptOperandsFromDataRangeTerms(CConcept* concept, CDataRangeTermExpression* dataRangeTermExp, bool negate = false); bool setConceptOperandsFromDataRangeTerms(CConcept* concept, CEXPRESSIONLIST* dataRangeTermExpList, bool negate = false); bool setConceptRoleFromObjectPropertyTerm(CConcept* concept, CObjectPropertyTermExpression* objectPropertyTermExp); bool setConceptRoleFromDataPropertyTerm(CConcept* concept, CDataPropertyTermExpression* dataPropertyTermExp); bool setConceptIndividualFromIndividualTerm(CConcept* concept, CIndividualTermExpression* indiTermExp); bool setConceptNominalIndividualFromIndividualTerm(CConcept* concept, CIndividualTermExpression* indiTermExp); bool setIndividualAssertionConceptFromClassTerm(CIndividual* individual, CClassTermExpression* classTermExp, bool negate = false); bool setIndividualAssertionNominalFromClassTerm(CIndividual* individual, CClassTermExpression* classTermExp, bool negate = false); bool setIndividualAssertionRoleFromObjectPropertyTerm(CIndividual* individual, CObjectPropertyTermExpression* objPropTermExp, CIndividualTermExpression* destIndiTermExp); bool buildClassConcept(CClassTermExpression* classTermExp); bool buildConceptSubClassInclusion(CClassTermExpression* subClassExp, CClassTermExpression* inclusionClassExp, bool negate = false); bool buildConceptEquivalentClass(CClassTermExpression* classExp1, CClassTermExpression* classExp2); bool buildPermutableConceptEquivalentClass(CClassTermExpression* classExp1, CClassTermExpression* classExp2); bool buildPermutableConceptEquivalentClass(CClassTermExpression* eqCallClassExp, const CEXPRESSIONLIST& eqClassExpList); bool buildPermutableConceptDisjointClass(CClassTermExpression* disCallClassExp, const CEXPRESSIONLIST& disClassExpList); bool buildDisjointUnionConceptClass(CClassTermExpression* disCallClassExp, const CEXPRESSIONLIST& disClassExpList); bool buildGeneralConceptInclusionClassExpression(CClassTermExpression* gciClassTermExp); bool buildObjectPropertyRole(CObjectPropertyTermExpression* objPropTermExp); bool buildDataPropertyRole(CDataPropertyTermExpression* dataPropTermExp); bool buildDatatype(CDatatypeExpression* datatypeExp); bool buildIndividualIndi(CIndividualTermExpression* indiTermExp); CRoleChain* buildRoleChainForSubObjectPropertyOfExpression(CSubObjectPropertyOfExpression* subObPropExp); CRoleChain* buildRoleChainForTransetiveObjectPropertyExpression(CTransetiveObjectPropertyExpression* objPropAxiomExp); CConcept* getConceptForClassTerm(CClassTermExpression* classTermExp, bool forceLocalisation = false); CRole* getRoleForObjectPropertyTerm(CObjectPropertyTermExpression* objPropTermExp, bool forceLocalisation = false); CRole* getRoleForDataPropertyTerm(CDataPropertyTermExpression* dataPropTermExp, bool forceLocalisation = false); CIndividual* getIndividualForIndividualTerm(CIndividualTermExpression* indiTermExp, bool forceLocalisation = false); CConcept* getConceptForDataRangeTerm(CDataRangeTermExpression* dataRangeExp, bool forceLocalisation = false); CDatatype* getDatatypeForDatatypeExpression(CDatatypeExpression* datatypeExp, bool forceLocalisation = false); CDataLiteral* getDataLiteralForLiteralExpression(CDataLiteralExpression* dataLiteralExp, bool forceLocalisation = false); bool updateName(CNamedItem* item, const QString& name); bool resortAndInstallConceptsAndRolesAndIndividuals(); CSortedNegLinker* resortConceptLinkersByTagging(CSortedNegLinker* conceptLinkers, cint64 linkerCount = -1); CSortedNegLinker* resortRoleLinkersByTagging(CSortedNegLinker* roleLinkers); bool buildConceptTags(); bool buildRoleTags(); bool buildRoleChainTags(); bool buildIndividualIDs(); cint64 getIndividualVariableID(CConcept* concept, CObjectIndividualVariableExpression* objectIndVarExp); // protected variables protected: COntologyDataBoxes* mOntoData; COntologyBuildConstructFlags* mConstructFlags; CTBox* tBox; CABox* aBox; CRBox* rBox; bool mInitialBuild; // contains also previous ontology data CONTOLOGYAXIOMSET* mTellAxiomSet; CONTOLOGYAXIOMSET* mRetractAxiomSet; CONTOLOGYAXIOMLIST< QPair >* mChangeAxiomList; // contains only updated data CONTOLOGYAXIOMSET* mTellUpdatedAxiomSet; CONTOLOGYAXIOMSET* mRetractUpdatedAxiomSet; CONTOLOGYAXIOMLIST< QPair >* mChangeUpdatedAxiomList; CBUILDHASH* mUpdateClassAxiomHash; CBUILDHASH* mUpdateObjectPropertyAxiomHash; CBUILDHASH* mUpdateDataPropertyAxiomHash; CBUILDHASH* mUpdateAssertionAxiomHash; // contains also previous ontology data CBUILDSET< QPair >* mClassTermClassAxiomSet; CBUILDHASH* mClassTermClassAxiomHash; CBUILDHASH* mDatatypeExpDatatypeHash; CBUILDHASH* mDatatypeDatatypeExpHash; CBUILDSET< QPair >* mObjPropTermObjPropAxiomSet; CBUILDHASH* mObjPropTermObjPropAxiomHash; CBUILDSET< QPair >* mDataPropTermDataPropAxiomSet; CBUILDHASH* mDataPropTermDataPropAxiomHash; CBUILDSET* mTopRebuildClassTermExpressionsSet; CBUILDSET* mTopRebuildObjectPropertyTermExpressionsSet; CBUILDSET< QPair >* mIndiTermAssertionAxiomSet; CBUILDHASH* mIndiTermAssertionAxiomHash; CBUILDHASH* mClassTermConceptHash; CBUILDHASH* mConceptClassTermHash; CBUILDHASH* mDataRangeTermConceptHash; CBUILDHASH* mConceptDataRangeTermHash; CBUILDHASH* mObjPropTermRoleHash; CBUILDHASH* mRoleObjPropTermHash; CBUILDHASH* mDataPropTermRoleHash; CBUILDHASH* mRoleDataPropTermHash; CBUILDHASH* mObjPropTermRoleChainHash; CBUILDHASH* mRoleChainObjPropTermHash; CBUILDHASH* mIndividulTermIndiHash; CBUILDHASH* mIndiIndividulTermHash; cint64 mLastProcessedChangedAxiom; cint64 mLastProcessedBuildIndividual; cint64 mLastProcessedBuildConcept; cint64 mLastProcessedBuildObjectRole; cint64 mLastProcessedBuildDataRole; cint64 mLastProcessedBuildDataRange; cint64 mLastProcessedBuildDatatype; cint64 mLastProcessedInverseProperty; cint64 mLastProcessedExpression; cint64 mLastBuildedIndividual; cint64 mLastBuildedConcept; cint64 mLastBuildedObjectRole; cint64 mLastBuildedDataRole; cint64 mLastBuildedDataRange; cint64 mLastBuildedDatatype; CBUILDHASH* mLocInverseObjectPropertyHash; CBUILDHASH* mLocExpressionBuildHash; CBUILDLIST* mLocExpressionBuildContainerList; CBUILDSET* mInitialBuildConceptSet; CBUILDSET* mLocBuildConceptSet; CBUILDSET* mLocBuildObjectRoleSet; CBUILDSET* mLocBuildDataRoleSet; CBUILDSET* mLocBuildDataRangeSet; CBUILDSET* mLocBuildDatatypeSet; CBUILDSET* mLocBuildIndividualSet; CBUILDLIST* mLocBuildIndividualList; CBUILDLIST* mLocBuildObjectRoleList; CBUILDLIST* mLocBuildDataRoleList; CBUILDLIST* mLocBuildDataRangeList; CBUILDLIST* mLocBuildDatatypeList; CBUILDLIST* mLocBuildConceptList; // only local builder data CBUILDSET mClassGCIExpressionSet; bool mRebuildTopConcept; CBUILDSET mLocalisationSet; CBUILDSET mBuildingConceptSet; CBUILDSET mBuildingObjectRoleSet; CBUILDSET mBuildingDataRoleSet; CBUILDSET mBuildingDataRangeSet; CBUILDSET mBuildingDatatypeSet; CBUILDSET mBuildingIndividualSet; CBUILDSET mNewBuildedConceptSet; CBUILDSET mNewBuildedObjectRoleSet; CBUILDSET mNewBuildedDataRoleSet; CBUILDSET mNewBuildedDataRangeSet; CBUILDSET mNewBuildedDatatypeSet; CBUILDSET mNewBuildedIndividualSet; CBUILDLIST mTaggingConceptList; CBUILDLIST mInstallConceptList; CBUILDSET mTaggingRoleSet; CBUILDLIST mInstallRoleList; CBUILDLIST mTaggingIndividualSet; CBUILDLIST mInstallIndividualList; CBUILDSET mTaggingRoleChainSet; CBUILDLIST mInstallRoleChainList; CBUILDSET mNewBuildConceptSet; CBUILDSET mNewBuildObjectRoleSet; CBUILDSET mNewBuildDataRoleSet; CBUILDSET mNewBuildDataRangeSet; CBUILDSET mNewBuildDatatypeSet; CBUILDSET mNewBuildIndividualSet; CBUILDSET mELExceptionExpressionSet; QList mLateIndiNominalConceptCreationList; bool mNominalConceptCreationRequired; }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYUPDATEBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyQueryBasicBuilder.cpp0000644000175000017500000012725212520550776031413 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteOntologyQueryBasicBuilder.h" namespace Konclude { namespace Reasoner { namespace Generator { CConcreteOntologyQueryBasicBuilder::CConcreteOntologyQueryBasicBuilder(CConcreteOntology* ontology, CConfigurationBase *configuration) { config = configuration; mOntology = ontology; } CConcreteOntologyQueryBasicBuilder::~CConcreteOntologyQueryBasicBuilder() { } CQueryIsClassSatisfiableExpression* CConcreteOntologyQueryBasicBuilder::getIsClassSatisfiableQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) { CQueryIsClassSatisfiableExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(1)) { expression = getIsClassSatisfiableQuery(expSplitter.getFirstClassTermExpression(),queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'IsClassSatisfiableQuery'-Expression."),this); } return expression; } CQueryAreClassesEquivalentExpression* CConcreteOntologyQueryBasicBuilder::getAreClassesEquivalenceQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) { CQueryAreClassesEquivalentExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(2)) { expression = getAreClassesEquivalenceQuery(*expSplitter.getClassTermExpressionList(),queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'AreClassesEquivalentQuery'-Expression."),this); } return expression; } CQueryAreClassesDisjointExpression* CConcreteOntologyQueryBasicBuilder::getAreClassesDisjointQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) { CQueryAreClassesDisjointExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(2)) { expression = getAreClassesDisjointQuery(*expSplitter.getClassTermExpressionList(),queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'AreClassesDisjointQuery'-Expression."),this); } return expression; } CQueryIsClassSubsumedByExpression* CConcreteOntologyQueryBasicBuilder::getIsClassSubsumedByQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) { CQueryIsClassSubsumedByExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(2)) { expression = getIsClassSubsumedByQuery(expSplitter.getFirstClassTermExpression(),expSplitter.getSecondClassTermExpression(),queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'IsClassSubsumedByQuery'-Expression."),this); } return expression; } CQueryIsInstanceOfExpression* CConcreteOntologyQueryBasicBuilder::getIsInstanceOfQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) { CQueryIsInstanceOfExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(1,0,1)) { expression = getIsInstanceOfQuery(expSplitter.getFirstIndividualTermExpression(),expSplitter.getFirstClassTermExpression(),queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'IsInstanceOfQuery'-Expression."),this); } return expression; } CQueryGetFlattenedTypesExpression* CConcreteOntologyQueryBasicBuilder::getGetFlattenedTypesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName) { CQueryGetFlattenedTypesExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(0,0,1)) { expression = getGetFlattenedTypesQuery(expSplitter.getFirstIndividualTermExpression(),direct,queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'GetFlattenedTypesQuery'-Expression."),this); } return expression; } CQueryGetFlattenedInstancesExpression* CConcreteOntologyQueryBasicBuilder::getGetFlattenedInstancesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName) { CQueryGetFlattenedInstancesExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(1,0,0)) { expression = getGetFlattenedInstancesQuery(expSplitter.getFirstClassTermExpression(),direct,queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'GetFlattenedInstancesQuery'-Expression."),this); } return expression; } CQueryGetTypesExpression* CConcreteOntologyQueryBasicBuilder::getGetTypesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName) { CQueryGetTypesExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(0,0,1)) { expression = getGetTypesQuery(expSplitter.getFirstIndividualTermExpression(),direct,queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'GetTypesQuery'-Expression."),this); } return expression; } CQueryGetSameIndividualsExpression* CConcreteOntologyQueryBasicBuilder::getGetSameIndividualsQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) { CQueryGetSameIndividualsExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(0,0,1)) { expression = getGetSameIndividualsQuery(expSplitter.getFirstIndividualTermExpression(),queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'GetSameIndividualsQuery'-Expression."),this); } return expression; } CQueryGetInstancesExpression* CConcreteOntologyQueryBasicBuilder::getGetInstancesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName) { CQueryGetInstancesExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(1,0,0)) { expression = getGetInstancesQuery(expSplitter.getFirstClassTermExpression(),direct,queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'GetInstancesQuery'-Expression."),this); } return expression; } CQueryGetObjectPropertyTargetsExpression* CConcreteOntologyQueryBasicBuilder::getGetObjectPropertyTargetsQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) { CQueryGetObjectPropertyTargetsExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(0,1,1)) { expression = getGetObjectPropertyTargetsQuery(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstIndividualTermExpression(),queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'GetObjectPropertyTargets'-Expression."),this); } return expression; } CQueryGetFlattenedObjectPropertyTargetsExpression* CConcreteOntologyQueryBasicBuilder::getGetFlattenedObjectPropertyTargetsQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) { CQueryGetFlattenedObjectPropertyTargetsExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(0,1,1)) { expression = getGetFlattenedObjectPropertyTargetsQuery(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstIndividualTermExpression(),queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'GetFlattenedObjectPropertyTargets'-Expression."),this); } return expression; } CQueryGetSubClassesExpression* CConcreteOntologyQueryBasicBuilder::getGetSubClassesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName) { CQueryGetSubClassesExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(1,0,0)) { expression = getGetSubClassesQuery(expSplitter.getFirstClassTermExpression(),direct,queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'GetSubClassesQuery'-Expression."),this); } return expression; } CQueryGetSuperClassesExpression* CConcreteOntologyQueryBasicBuilder::getGetSuperClassesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName) { CQueryGetSuperClassesExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(1,0,0)) { expression = getGetSuperClassesQuery(expSplitter.getFirstClassTermExpression(),direct,queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'GetSuperClassesQuery'-Expression."),this); } return expression; } CQueryGetEquivalentClassesExpression* CConcreteOntologyQueryBasicBuilder::getGetEquivalentClassesQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) { CQueryGetEquivalentClassesExpression* expression = nullptr; CExpressionSplitter expSplitter(testClassExpressions); if (expSplitter.testForExpressionComposition(1,0,0)) { expression = getGetEquivalentClassesQuery(expSplitter.getFirstClassTermExpression(),queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'GetEquivalentClassesQuery'-Expression."),this); } return expression; } CQueryGetDeterministicIndividualsExpression* CConcreteOntologyQueryBasicBuilder::getGetDeterministicIndividualsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName) { CQueryGetDeterministicIndividualsExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); expression = getGetDeterministicIndividualsQuery(*expSplitter.getIndividualTermExpressionList(),queryName); return expression; } CQueryGetNondeterministicIndividualsExpression* CConcreteOntologyQueryBasicBuilder::getGetNondeterministicIndividualsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName) { CQueryGetNondeterministicIndividualsExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); expression = getGetNondeterministicIndividualsQuery(*expSplitter.getIndividualTermExpressionList(),queryName); return expression; } CQueryGetDeterministicClassAssertionsExpression* CConcreteOntologyQueryBasicBuilder::getGetDeterministicClassAssertionsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName) { CQueryGetDeterministicClassAssertionsExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); expression = getGetDeterministicClassAssertionsQuery(*expSplitter.getIndividualTermExpressionList(),queryName); return expression; } CQueryGetNondeterministicClassAssertionsExpression* CConcreteOntologyQueryBasicBuilder::getGetNondeterministicClassAssertionsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName) { CQueryGetNondeterministicClassAssertionsExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); expression = getGetNondeterministicClassAssertionsQuery(*expSplitter.getIndividualTermExpressionList(),queryName); return expression; } CQueryIsEntailedExpression* CConcreteOntologyQueryBasicBuilder::getIsEntailedQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) { CQueryIsEntailedExpression* expression = nullptr; CEXPRESSIONLIST axiomExpressionList; for (CEXPRESSIONLIST::const_iterator it = testClassExpressions.constBegin(), itEnd = testClassExpressions.constEnd(); it != itEnd; ++it) { CAxiomExpression* axiomExpression = dynamic_cast(*it); if (axiomExpression) { axiomExpressionList.append(axiomExpression); } } if (!axiomExpressionList.isEmpty()) { expression = getIsEntailedQuery(axiomExpressionList,queryName); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Couldn't match parameters for 'IsEntailedQuery'-Expression."),this); } return expression; } CQueryIsClassSatisfiableExpression *CConcreteOntologyQueryBasicBuilder::getIsClassSatisfiableQuery(CClassTermExpression* testClassExpressions, const QString& queryName) { CQueryIsClassSatisfiableExpression *classSatExp = new CQueryIsClassSatisfiableExpression(queryName,testClassExpressions); container.append(classSatExp); classSatExpList.append(classSatExp); return classSatExp; } CQueryIsInstanceOfExpression *CConcreteOntologyQueryBasicBuilder::getIsInstanceOfQuery(CIndividualTermExpression* individualTermExpression, CClassTermExpression* classExpression, const QString& queryName) { CQueryIsInstanceOfExpression *instanceQExp = 0; instanceQExp = new CQueryIsInstanceOfExpression(queryName,individualTermExpression,classExpression); instanceExpList.append(instanceQExp); container.append(instanceQExp); return instanceQExp; } CQueryGetFlattenedTypesExpression* CConcreteOntologyQueryBasicBuilder::getGetFlattenedTypesQuery(CIndividualTermExpression* individualTermExpression, bool direct, const QString& queryName) { CQueryGetFlattenedTypesExpression* flattenedTypes = 0; flattenedTypes = new CQueryGetFlattenedTypesExpression(queryName,direct,individualTermExpression); flattenedTypesExpList.append(flattenedTypes); container.append(flattenedTypes); return flattenedTypes; } CQueryGetFlattenedInstancesExpression* CConcreteOntologyQueryBasicBuilder::getGetFlattenedInstancesQuery(CClassTermExpression* classTermExpression, bool direct, const QString& queryName) { CQueryGetFlattenedInstancesExpression* flattenedInstances = 0; flattenedInstances = new CQueryGetFlattenedInstancesExpression(queryName,direct,classTermExpression); flattenedInstancesExpList.append(flattenedInstances); container.append(flattenedInstances); return flattenedInstances; } CQueryGetTypesExpression* CConcreteOntologyQueryBasicBuilder::getGetTypesQuery(CIndividualTermExpression* individualTermExpression, bool direct, const QString& queryName) { CQueryGetTypesExpression* types = 0; types = new CQueryGetTypesExpression(queryName,direct,individualTermExpression); typesExpList.append(types); container.append(types); return types; } CQueryGetSameIndividualsExpression* CConcreteOntologyQueryBasicBuilder::getGetSameIndividualsQuery(CIndividualTermExpression* individualTermExpression, const QString& queryName) { CQueryGetSameIndividualsExpression* types = 0; types = new CQueryGetSameIndividualsExpression(queryName,individualTermExpression); sameIndiExpList.append(types); container.append(types); return types; } CQueryGetInstancesExpression* CConcreteOntologyQueryBasicBuilder::getGetInstancesQuery(CClassTermExpression* classTermExpression, bool direct, const QString& queryName) { CQueryGetInstancesExpression* instances = 0; instances = new CQueryGetInstancesExpression(queryName,direct,classTermExpression); instancesExpList.append(instances); container.append(instances); return instances; } CQueryGetObjectPropertyTargetsExpression* CConcreteOntologyQueryBasicBuilder::getGetObjectPropertyTargetsQuery(CObjectPropertyTermExpression* objectPropertyExpression, CIndividualTermExpression* individualExpression, const QString& queryName) { CQueryGetObjectPropertyTargetsExpression* instances = 0; instances = new CQueryGetObjectPropertyTargetsExpression(queryName,objectPropertyExpression,individualExpression); mObjectPropTargetsExpList.append(instances); container.append(instances); return instances; } CQueryGetFlattenedObjectPropertyTargetsExpression* CConcreteOntologyQueryBasicBuilder::getGetFlattenedObjectPropertyTargetsQuery(CObjectPropertyTermExpression* objectPropertyExpression, CIndividualTermExpression* individualExpression, const QString& queryName) { CQueryGetFlattenedObjectPropertyTargetsExpression* instances = 0; instances = new CQueryGetFlattenedObjectPropertyTargetsExpression(queryName,objectPropertyExpression,individualExpression); mObjectFlattenedPropTargetsExpList.append(instances); container.append(instances); return instances; } CQueryGetSubClassesExpression* CConcreteOntologyQueryBasicBuilder::getGetSubClassesQuery(CClassTermExpression* classTermExpression, bool direct, const QString& queryName) { CQueryGetSubClassesExpression* instances = 0; instances = new CQueryGetSubClassesExpression(queryName,direct,classTermExpression); mSubClassesExpList.append(instances); container.append(instances); return instances; } CQueryGetSuperClassesExpression* CConcreteOntologyQueryBasicBuilder::getGetSuperClassesQuery(CClassTermExpression* classTermExpression, bool direct, const QString& queryName) { CQueryGetSuperClassesExpression* instances = 0; instances = new CQueryGetSuperClassesExpression(queryName,direct,classTermExpression); mSuperClassesExpList.append(instances); container.append(instances); return instances; } CQueryGetEquivalentClassesExpression* CConcreteOntologyQueryBasicBuilder::getGetEquivalentClassesQuery(CClassTermExpression* classTermExpression, const QString& queryName) { CQueryGetEquivalentClassesExpression* instances = 0; instances = new CQueryGetEquivalentClassesExpression(queryName,classTermExpression); mEquivClassesExpList.append(instances); container.append(instances); return instances; } CQueryGetDeterministicIndividualsExpression* CConcreteOntologyQueryBasicBuilder::getGetDeterministicIndividualsQuery(const CEXPRESSIONLIST& indiExpressions, const QString& queryName) { CQueryGetDeterministicIndividualsExpression* queryExpression = nullptr; queryExpression = new CQueryGetDeterministicIndividualsExpression(queryName,indiExpressions); mDetIndisExpList.append(queryExpression); container.append(queryExpression); return queryExpression; } CQueryGetNondeterministicIndividualsExpression* CConcreteOntologyQueryBasicBuilder::getGetNondeterministicIndividualsQuery(const CEXPRESSIONLIST& indiExpressions, const QString& queryName) { CQueryGetNondeterministicIndividualsExpression* queryExpression = nullptr; queryExpression = new CQueryGetNondeterministicIndividualsExpression(queryName,indiExpressions); mNdetIndisExpList.append(queryExpression); container.append(queryExpression); return queryExpression; } CQueryGetDeterministicClassAssertionsExpression* CConcreteOntologyQueryBasicBuilder::getGetDeterministicClassAssertionsQuery(const CEXPRESSIONLIST& indiExpressions, const QString& queryName) { CQueryGetDeterministicClassAssertionsExpression* queryExpression = nullptr; queryExpression = new CQueryGetDeterministicClassAssertionsExpression(queryName,indiExpressions); mDetClassAssExpList.append(queryExpression); container.append(queryExpression); return queryExpression; } CQueryGetNondeterministicClassAssertionsExpression* CConcreteOntologyQueryBasicBuilder::getGetNondeterministicClassAssertionsQuery(const CEXPRESSIONLIST& indiExpressions, const QString& queryName) { CQueryGetNondeterministicClassAssertionsExpression* queryExpression = nullptr; queryExpression = new CQueryGetNondeterministicClassAssertionsExpression(queryName,indiExpressions); mNdetClassAssExpList.append(queryExpression); container.append(queryExpression); return queryExpression; } QString CConcreteOntologyQueryBasicBuilder::getStringFromConcept(CConcept *concept) { QString className; if (concept) { if (concept->hasClassName()) { QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); className = iriClassNameString; } else { className = CConceptTextFormater::getConceptString(concept,false); } } return className; } CConcept *CConcreteOntologyQueryBasicBuilder::getConceptFromBuildExpression(CClassTermExpression *buildExp) { CConcept *concept = mOntology->getDataBoxes()->getExpressionDataBoxMapping()->getClassTermConceptMappingHash()->value(buildExp,nullptr); return concept; } CRole *CConcreteOntologyQueryBasicBuilder::getRoleFromBuildExpression(CObjectPropertyTermExpression *buildExp) { CRole* role = mOntology->getDataBoxes()->getExpressionDataBoxMapping()->getObjectPropertyTermRoleMappingHash()->value(buildExp,nullptr); return role; } CIndividual *CConcreteOntologyQueryBasicBuilder::getIndividualFromBuildExpression(CIndividualTermExpression *buildExp) { CIndividual *indi = mOntology->getDataBoxes()->getExpressionDataBoxMapping()->getIndividulTermIndiMappingHash()->value(buildExp,nullptr); return indi; } QList CConcreteOntologyQueryBasicBuilder::generateQuerys() { QList queryList; CSatisfiableCalculationJobGenerator* satCalcJobGenerator = new CSatisfiableCalculationJobGenerator(mOntology); bool confBuildQueryStats = CConfigDataReader::readConfigBoolean(config,"Konclude.Query.Statistics.CollectStatistics",false); foreach (CQueryIsClassSatisfiableExpression *classSatExp, classSatExpList) { QString queryName = classSatExp->getName(); CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CClassTermExpression *satBuildExp = classSatExp->getClassTermExpression(); CConcept *concept = getConceptFromBuildExpression(satBuildExp); if (concept) { QString className = getStringFromConcept(concept); CIsClassSatisfiableQuery *query = new CIsClassSatisfiableQuery(className,queryName); CSatisfiableCalculationJob* satCalcJob = satCalcJobGenerator->getSatisfiableCalculationJob(concept); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); satCalcJob->setCalclulationStatisticsCollector(queryStats->createCalculationStatisticsCollection()); } query->setCalculationConfiguration(calcConfig); satCalcJob->setCalculationConfiguration(calcConfig); query->addTestSatisfiableCalculationJob(satCalcJob,true); query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated IsClassSatisfiable-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } delete classSatExp; } foreach (CQueryIsInstanceOfExpression *instanceExp, instanceExpList) { QString queryName = instanceExp->getName(); CIndividualTermExpression *indiExp = instanceExp->getIndividualTermExpression(); CClassTermExpression *classExp = instanceExp->getClassTermExpression(); if (indiExp && classExp) { CIndividual *indi = getIndividualFromBuildExpression(indiExp); CConcept *concept = getConceptFromBuildExpression(classExp); QString iriClassNameString = CIRIName::getRecentIRIName(indi->getIndividualNameLinker()); QString indiString = iriClassNameString; QString conceptString = getStringFromConcept(concept); CIsInstanceOfQuery *query = new CIsInstanceOfQuery(indiString,conceptString,queryName); CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CSatisfiableCalculationJob* satCalcJob = satCalcJobGenerator->getSatisfiableCalculationJob(concept,true,indi); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); satCalcJob->setCalclulationStatisticsCollector(queryStats->createCalculationStatisticsCollection()); } query->setQueryStatistics(queryStats); query->setCalculationConfiguration(calcConfig); satCalcJob->setCalculationConfiguration(calcConfig); query->addTestSatisfiableCalculationJob(satCalcJob,false); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated IsIstanceOf-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } delete instanceExp; } foreach (CQueryGetFlattenedTypesExpression* flattenedTypes, flattenedTypesExpList) { QString queryName = flattenedTypes->getName(); CIndividualTermExpression *indiExp = flattenedTypes->getIndividualTermExpression(); if (indiExp) { CIndividual *indi = getIndividualFromBuildExpression(indiExp); QString iriIndiNameString = CIRIName::getRecentIRIName(indi->getIndividualNameLinker()); QString indiString = iriIndiNameString; CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CFlattenedTypesQuery *query = new CFlattenedTypesQuery(mOntology,calcConfig,indi,flattenedTypes->isDirect(),indiString,queryName); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated FlattenedTypes-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } delete flattenedTypes; } foreach (CQueryGetFlattenedInstancesExpression* flattenedInstances, flattenedInstancesExpList) { QString queryName = flattenedInstances->getName(); CClassTermExpression* classExp = flattenedInstances->getClassTermExpression(); if (classExp) { CConcept* concept = getConceptFromBuildExpression(classExp); QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); QString classString = iriClassNameString; CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CFlattenedInstancesQuery *query = new CFlattenedInstancesQuery(mOntology,calcConfig,concept,flattenedInstances->isDirect(),classString,queryName); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated FlattenedInstances-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } delete flattenedInstances; } foreach (CQueryGetTypesExpression* typesExp, typesExpList) { QString queryName = typesExp->getName(); CIndividualTermExpression *indiExp = typesExp->getIndividualTermExpression(); if (indiExp) { CIndividual *indi = getIndividualFromBuildExpression(indiExp); QString iriIndiNameString = CIRIName::getRecentIRIName(indi->getIndividualNameLinker()); QString indiString = iriIndiNameString; CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CTypesQuery *query = new CTypesQuery(mOntology,calcConfig,indi,typesExp->isDirect(),indiString,queryName); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated Types-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } delete typesExp; } foreach (CQueryGetSameIndividualsExpression* sameIndExp, sameIndiExpList) { QString queryName = sameIndExp->getName(); CIndividualTermExpression *indiExp = sameIndExp->getIndividualTermExpression(); if (indiExp) { CIndividual *indi = getIndividualFromBuildExpression(indiExp); QString iriIndiNameString = CIRIName::getRecentIRIName(indi->getIndividualNameLinker()); QString indiString = iriIndiNameString; CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CSameIndividualsQuery *query = new CSameIndividualsQuery(mOntology,calcConfig,indi,indiString,queryName); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated Same-Individuals-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } delete sameIndExp; } foreach (CQueryGetInstancesExpression* instancesExp, instancesExpList) { QString queryName = instancesExp->getName(); CClassTermExpression* classExp = instancesExp->getClassTermExpression(); if (classExp) { CConcept* concept = getConceptFromBuildExpression(classExp); QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); QString classString = iriClassNameString; CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CInstancesQuery *query = new CInstancesQuery(mOntology,calcConfig,concept,instancesExp->isDirect(),classString,queryName); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated Instances-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } } foreach (CQueryGetSubClassesExpression* subClassesExp, mSubClassesExpList) { QString queryName = subClassesExp->getName(); CClassTermExpression* classExp = subClassesExp->getClassTermExpression(); if (classExp) { CConcept* concept = getConceptFromBuildExpression(classExp); QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); QString classString = iriClassNameString; CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CSubClassesQuery *query = new CSubClassesQuery(mOntology,calcConfig,concept,subClassesExp->isDirect(),classString,queryName); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated GetSubClasses-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } delete subClassesExp; } foreach (CQueryGetSuperClassesExpression* superClassesExp, mSuperClassesExpList) { QString queryName = superClassesExp->getName(); CClassTermExpression* classExp = superClassesExp->getClassTermExpression(); if (classExp) { CConcept* concept = getConceptFromBuildExpression(classExp); QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); QString classString = iriClassNameString; CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CSuperClassesQuery *query = new CSuperClassesQuery(mOntology,calcConfig,concept,superClassesExp->isDirect(),classString,queryName); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated GetSuperClasses-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } delete superClassesExp; } foreach (CQueryGetEquivalentClassesExpression* equivClassesExp, mEquivClassesExpList) { QString queryName = equivClassesExp->getName(); CClassTermExpression* classExp = equivClassesExp->getClassTermExpression(); if (classExp) { CConcept* concept = getConceptFromBuildExpression(classExp); QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); QString classString = iriClassNameString; CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CEquivalentClassesQuery *query = new CEquivalentClassesQuery(mOntology,calcConfig,concept,classString,queryName); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated GetEquivalentClasses-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } delete equivClassesExp; } foreach (CQueryGetObjectPropertyTargetsExpression* objPropTargetsExp, mObjectPropTargetsExpList) { QString queryName = objPropTargetsExp->getName(); CObjectPropertyTermExpression* objPropTermExp = objPropTargetsExp->getObjectPropertyTermExpression(); CIndividualTermExpression* indiTermExp = objPropTargetsExp->getIndividualTermExpression(); if (objPropTermExp && indiTermExp) { CRole* role = getRoleFromBuildExpression(objPropTermExp); CIndividual* individual = getIndividualFromBuildExpression(indiTermExp); CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CObjectPropertyTargetsQuery *query = new CObjectPropertyTargetsQuery(mOntology,calcConfig,individual,role,queryName); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated ObjectPropertyTargets-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } } foreach (CQueryGetFlattenedObjectPropertyTargetsExpression* objPropTargetsExp, mObjectFlattenedPropTargetsExpList) { QString queryName = objPropTargetsExp->getName(); CObjectPropertyTermExpression* objPropTermExp = objPropTargetsExp->getObjectPropertyTermExpression(); CIndividualTermExpression* indiTermExp = objPropTargetsExp->getIndividualTermExpression(); if (objPropTermExp && indiTermExp) { CRole* role = getRoleFromBuildExpression(objPropTermExp); CIndividual* individual = getIndividualFromBuildExpression(indiTermExp); CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CFlattenedObjectPropertyTargetsQuery *query = new CFlattenedObjectPropertyTargetsQuery(mOntology,calcConfig,individual,role,queryName); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated FlattenedObjectPropertyTargets-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } } foreach (CQueryGetDeterministicIndividualsExpression* indiQueryExp, mDetIndisExpList) { QString queryName = indiQueryExp->getName(); CEXPRESSIONLIST* indiExpList = indiQueryExp->getIndividualTermExpressionList(); if (indiExpList) { QSet individualSet; for (CEXPRESSIONLIST::const_iterator it = indiExpList->constBegin(), itEnd = indiExpList->constEnd(); it != itEnd; ++it) { CIndividualTermExpression* indiTermExp(*it); CIndividual* individual = getIndividualFromBuildExpression(indiTermExp); individualSet.insert(individual); } CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CDeterministicIndividualsQuery *query = new CDeterministicIndividualsQuery(mOntology,calcConfig,individualSet,queryName); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated DeterministicIndividuals-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } } foreach (CQueryGetNondeterministicIndividualsExpression* indiQueryExp, mNdetIndisExpList) { QString queryName = indiQueryExp->getName(); CEXPRESSIONLIST* indiExpList = indiQueryExp->getIndividualTermExpressionList(); if (indiExpList) { QSet individualSet; for (CEXPRESSIONLIST::const_iterator it = indiExpList->constBegin(), itEnd = indiExpList->constEnd(); it != itEnd; ++it) { CIndividualTermExpression* indiTermExp(*it); CIndividual* individual = getIndividualFromBuildExpression(indiTermExp); individualSet.insert(individual); } CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CNondeterministicIndividualsQuery *query = new CNondeterministicIndividualsQuery(mOntology,calcConfig,individualSet,queryName); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated NondeterministicIndividuals-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } } foreach (CQueryGetDeterministicClassAssertionsExpression* indiQueryExp, mDetClassAssExpList) { QString queryName = indiQueryExp->getName(); CEXPRESSIONLIST* indiExpList = indiQueryExp->getIndividualTermExpressionList(); if (indiExpList) { QSet individualSet; for (CEXPRESSIONLIST::const_iterator it = indiExpList->constBegin(), itEnd = indiExpList->constEnd(); it != itEnd; ++it) { CIndividualTermExpression* indiTermExp(*it); CIndividual* individual = getIndividualFromBuildExpression(indiTermExp); individualSet.insert(individual); } CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CDeterministicClassAssertionQuery *query = new CDeterministicClassAssertionQuery(mOntology,calcConfig,individualSet,queryName); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated DeterministicClassAssertions-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } } foreach (CQueryGetNondeterministicClassAssertionsExpression* indiQueryExp, mNdetClassAssExpList) { QString queryName = indiQueryExp->getName(); CEXPRESSIONLIST* indiExpList = indiQueryExp->getIndividualTermExpressionList(); if (indiExpList) { QSet individualSet; for (CEXPRESSIONLIST::const_iterator it = indiExpList->constBegin(), itEnd = indiExpList->constEnd(); it != itEnd; ++it) { CIndividualTermExpression* indiTermExp(*it); CIndividual* individual = getIndividualFromBuildExpression(indiTermExp); individualSet.insert(individual); } CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(config,0); CNondeterministicClassAssertionQuery *query = new CNondeterministicClassAssertionQuery(mOntology,calcConfig,individualSet,queryName); CQueryStatisticsCollectionStrings* queryStats = nullptr; if (confBuildQueryStats) { queryStats = new CQueryStatisticsCollectionStrings(); } query->setQueryStatistics(queryStats); queryList.append(query); LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyQueryBuilder",logTr("Generated NondeterministicClassAssertions-Query '%1' with question '%2'.").arg(query->getQueryName()).arg(query->getQueryString()),this); } } delete satCalcJobGenerator; return queryList; } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyBasementBuilder.cpp0000644000175000017500000004517412520550774031102 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteOntologyBasementBuilder.h" namespace Konclude { namespace Reasoner { namespace Generator { CConcreteOntologyBasementBuilder::CConcreteOntologyBasementBuilder(CConcreteOntology* basementBuildConcreteOntology) { LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcreteOntologyBasementBuilder",logTr("ConcreteOntologyBasementBuilder initialized."),this); mOnto = basementBuildConcreteOntology; } CConcreteOntologyBasementBuilder::~CConcreteOntologyBasementBuilder() { } bool CConcreteOntologyBasementBuilder::initializeBuilding() { mOntoStrings = mOnto->getStringMapping(); mOntoStrings = mOnto->getStringMapping(); mOntoData = mOnto->getDataBoxes(); mOntoBuild = mOnto->getBuildData(); tBox = mOntoData->getTBox(); rBox = mOntoData->getRBox(); aBox = mOntoData->getABox(); mOntoData->setBasicBuild(true); mMemManager = CContext::getMemoryAllocationManager(mOnto->getOntologyContext()); mTellAxiomSet = mOntoBuild->getTellAxiomSet(); mRetractAxiomSet = mOntoBuild->getRetractAxiomSet(); mTellUpdatedAxiomSet = mOntoBuild->getUpdatedTellAxiomSet(); mRetractUpdatedAxiomSet = mOntoBuild->getUpdatedRetractAxiomSet(); mUpdateClassAxiomHash = mOntoData->getExpressionDataBoxMapping()->getUpdatedClassAxiomTellOrRetractHash(); mUpdateObjectPropertyAxiomHash = mOntoData->getExpressionDataBoxMapping()->getUpdateObjectPropertyAxiomHash(); mClassTermClassAxiomSet = mOntoData->getExpressionDataBoxMapping()->getClassTermExpressionClassAxiomExpressionSet(); mClassTermClassAxiomHash = mOntoData->getExpressionDataBoxMapping()->getClassTermExpressionClassAxiomExpressionHash(); mObjPropTermObjPropAxiomSet = mOntoData->getExpressionDataBoxMapping()->getObjectPropertyTermObjectPropertyAxiomSet(); mObjPropTermObjPropAxiomHash = mOntoData->getExpressionDataBoxMapping()->getObjectPropertyTermObjectPropertyAxiomHash(); mTopRebuildClassTermExpressionsSet = mOntoData->getExpressionDataBoxMapping()->getTopRebuildClassTermExpressionsSet(); mTopRebuildObjectPropertyTermExpressionsSet = mOntoData->getExpressionDataBoxMapping()->getTopRebuildObjectPropertyTermExpressionsSet(); mActiveEntityCountVector = mOntoData->getExpressionDataBoxMapping()->getActiveEntityVector(); mTopClassExpression = mOntoBuild->getTopClassExpression(); mBottomClassExpression = mOntoBuild->getBottomClassExpression(); mTopObjPropExpression = mOntoBuild->getTopObjectPropertyExpression(); mBottomObjPropExpression = mOntoBuild->getBottomObjectPropertyExpression(); mTopDataPropExpression = mOntoBuild->getTopDataPropertyExpression(); mBottomDataPropExpression = mOntoBuild->getBottomDataPropertyExpression(); mClassTermConceptHash = mOntoData->getExpressionDataBoxMapping()->getClassTermConceptMappingHash(); mConceptClassTermHash = mOntoData->getExpressionDataBoxMapping()->getConceptClassTermMappingHash(); mObjPropTermRoleHash = mOntoData->getExpressionDataBoxMapping()->getObjectPropertyTermRoleMappingHash(); mRoleObjPropTermHash = mOntoData->getExpressionDataBoxMapping()->getRoleObjectPropertyTermMappingHash(); mDataPropTermRoleHash = mOntoData->getExpressionDataBoxMapping()->getDataPropertyTermRoleMappingHash(); mRoleDataPropTermHash = mOntoData->getExpressionDataBoxMapping()->getRoleDataPropertyTermMappingHash(); mDataPropTermRoleHash = mOntoData->getExpressionDataBoxMapping()->getDataPropertyTermRoleMappingHash(); mRoleDataPropTermHash = mOntoData->getExpressionDataBoxMapping()->getRoleDataPropertyTermMappingHash(); mIndividulTermIndiHash = mOntoData->getExpressionDataBoxMapping()->getIndividulTermIndiMappingHash(); mIndiIndividulTermHash = mOntoData->getExpressionDataBoxMapping()->getIndiIndividulTermMappingHash(); mExpressionBuildContainerList = mOntoBuild->getExpressionBuildListContainer(); mInverseObjectPropertyHash = mOntoBuild->getInverseObjectPropertyHash(); mExpressionBuildHash = mOntoBuild->getStructuralExpressionBuildHash(); mClassBuildHash = mOntoBuild->getClassEntityBuildHash(); mObjectPropertyBuildHash = mOntoBuild->getObjectPropertyEntityBuildHash(); mIndividualBuildHash = mOntoBuild->getIndividualEntityBuildHash(); mDataPropertyBuildHash = mOntoBuild->getDataPropertyEntityBuildHash(); mAbbreviatedNamePrefixMapHash = mOntoStrings->getAbbreviatedNamePrefixHash(); mNamePrefixMapHash = mOntoStrings->getNamePrefixHash(); mDatatypeExpDatatypeHash = mOntoData->getExpressionDataBoxMapping()->getDatatypeExpressionDatatypeHash(); mDatatypeDatatypeExpHash = mOntoData->getExpressionDataBoxMapping()->getDatatypeDatatypeExpessionHash(); mDatatypeBuildHash = mOntoBuild->getDatatypeIRIBuildHash(); return true; } bool CConcreteOntologyBasementBuilder::updateName(CNamedItem* item, const QString& name) { bool nameAdded = false; if (!CIRIName::hasIRIName(item->getNameLinker(),name)) { cint64 lastNameID = CName::getLastNameVersionID(item->getNameLinker()); if (lastNameID < 0) { lastNameID = 0; } FOREACHHASHIT (QString prefix, CNamePrefix* namePrefix, *mNamePrefixMapHash) { if (name.startsWith(prefix)) { CAbbreviatedIRIName* newName = CObjectAllocator::allocateAndConstruct(mMemManager); QString abbString = name.mid(prefix.length()); newName->init(namePrefix,abbString); newName->setNameVersionID(lastNameID); CLinker* newNameLinker = CObjectAllocator< CLinker >::allocateAndConstruct(mMemManager); newNameLinker->init(newName); item->addNameLinker(newNameLinker); nameAdded = true; } } if (!nameAdded) { CIRIName* newName = CObjectAllocator::allocateAndConstruct(mMemManager); newName->init(name); newName->setNameVersionID(lastNameID); CLinker* newNameLinker = CObjectAllocator< CLinker >::allocateAndConstruct(mMemManager); newNameLinker->init(newName); item->addNameLinker(newNameLinker); } } return nameAdded; } bool CConcreteOntologyBasementBuilder::createDatatype(const QString& datatypeIRI) { if (!mDatatypeBuildHash->contains(datatypeIRI)) { CDatatypeExpression* datatypeExpression = new CDatatypeExpression(datatypeIRI); datatypeExpression->setEntityID(mOntoBuild->getNextEntityNumber(true)); mDatatypeBuildHash->insert(datatypeIRI,datatypeExpression); CDatatype* datatype = new CDatatype(); datatype->initDatatype(datatypeIRI); mDatatypeExpDatatypeHash->insert(datatypeExpression,datatype); mDatatypeDatatypeExpHash->insert(datatype,datatypeExpression); CDatatypeVector* datatypeVector = tBox->getDatatypeVector(true); datatype->setDatatypeTag(datatypeVector->getItemCount()); datatypeVector->setData(datatype->getDatatypeTag(),datatype); } return true; } bool CConcreteOntologyBasementBuilder::buildOntologyBasement() { // generate top and bottom class and concept addNameAbbreviation(PREFIX_OWL,"owl"); addNameAbbreviation(PREFIX_RDF,"rdf"); addNameAbbreviation(PREFIX_XML,"xml"); addNameAbbreviation(PREFIX_XSD,"xsd"); addNameAbbreviation(PREFIX_RDFS,"rdfs"); QString topConceptString = PREFIX_OWL_THING; QString bottomConceptString = PREFIX_OWL_NOTHING; QString topObjectRoleString = PREFIX_OWL_TOPOBJECTPROPERTY; QString bottomObjectRoleString = PREFIX_OWL_BOTTOMOBJECTPROPERTY; QString topDataRoleString = PREFIX_OWL_TOPDATAPROPERTY; QString bottomDataRoleString = PREFIX_OWL_BOTTOMDATAPROPERTY; mActiveEntityCountVector->increaseVectorSize(mOntoBuild->getNextEntityNumber(false)+6+35); if (!mTopClassExpression) { CClassExpression* topClassExpression = new CClassExpression(topConceptString); topClassExpression->setEntityID(mOntoBuild->getNextEntityNumber(true)); mActiveEntityCountVector->incActiveEntityCount(topClassExpression); mExpressionBuildContainerList->append(topClassExpression); mClassBuildHash->insert(topConceptString,topClassExpression); mTopClassExpression = topClassExpression; mOntoBuild->setTopClassExpression(mTopClassExpression); } if (!mBottomClassExpression) { CClassExpression* bottomClassExpression = new CClassExpression(bottomConceptString); bottomClassExpression->setEntityID(mOntoBuild->getNextEntityNumber(true)); mActiveEntityCountVector->incActiveEntityCount(bottomClassExpression); mExpressionBuildContainerList->append(bottomClassExpression); mClassBuildHash->insert(bottomConceptString,bottomClassExpression); mBottomClassExpression = bottomClassExpression; mOntoBuild->setBottomClassExpression(mBottomClassExpression); } if (!mTopObjPropExpression) { CObjectPropertyExpression* topObjPropExpression = new CObjectPropertyExpression(topObjectRoleString); topObjPropExpression->setEntityID(mOntoBuild->getNextEntityNumber(true)); mActiveEntityCountVector->incActiveEntityCount(topObjPropExpression); mExpressionBuildContainerList->append(topObjPropExpression); mObjectPropertyBuildHash->insert(topObjectRoleString,topObjPropExpression); mTopObjPropExpression = topObjPropExpression; mOntoBuild->setTopObjectPropertyExpression(mTopObjPropExpression); } if (!mBottomObjPropExpression) { CObjectPropertyExpression* bottomObjPropExpression = new CObjectPropertyExpression(bottomObjectRoleString); bottomObjPropExpression->setEntityID(mOntoBuild->getNextEntityNumber(true)); mActiveEntityCountVector->incActiveEntityCount(bottomObjPropExpression); mExpressionBuildContainerList->append(bottomObjPropExpression); mObjectPropertyBuildHash->insert(bottomObjectRoleString,bottomObjPropExpression); mBottomObjPropExpression = bottomObjPropExpression; mOntoBuild->setBottomObjectPropertyExpression(mBottomObjPropExpression); } if (!mTopDataPropExpression) { CDataPropertyExpression* topDataPropExpression = new CDataPropertyExpression(topDataRoleString); topDataPropExpression->setEntityID(mOntoBuild->getNextEntityNumber(true)); mActiveEntityCountVector->incActiveEntityCount(topDataPropExpression); mExpressionBuildContainerList->append(topDataPropExpression); mDataPropertyBuildHash->insert(topDataRoleString,topDataPropExpression); mTopDataPropExpression = topDataPropExpression; mOntoBuild->setTopDataPropertyExpression(mTopDataPropExpression); } if (!mBottomDataPropExpression) { CDataPropertyExpression* bottomDataPropExpression = new CDataPropertyExpression(bottomDataRoleString); bottomDataPropExpression->setEntityID(mOntoBuild->getNextEntityNumber(true)); mActiveEntityCountVector->incActiveEntityCount(bottomDataPropExpression); mExpressionBuildContainerList->append(bottomDataPropExpression); mDataPropertyBuildHash->insert(bottomDataRoleString,bottomDataPropExpression); mBottomDataPropExpression = bottomDataPropExpression; mOntoBuild->setBottomDataPropertyExpression(mBottomDataPropExpression); } CMemoryAllocationManager* tBoxMemMan = CContext::getMemoryAllocationManager(tBox->getBoxContext()); CConcept* topConcept = tBox->getTopConcept(); if (!topConcept) { topConcept = CObjectAllocator::allocateAndConstruct(tBoxMemMan); topConcept->initConcept(); topConcept->setConceptTag(tBox->getTopConceptIndex()); topConcept->setOperatorCode(CCTOP); updateName(topConcept,topConceptString); mClassTermConceptHash->insert(mTopClassExpression,topConcept); mConceptClassTermHash->insert(topConcept,mTopClassExpression); tBox->setTopConcept(topConcept); } CConcept* bottomConcept = tBox->getBottomConcept(); if (!bottomConcept) { bottomConcept = CObjectAllocator::allocateAndConstruct(tBoxMemMan); bottomConcept->initConcept(); bottomConcept->setConceptTag(tBox->getBottomConceptIndex()); bottomConcept->setOperatorCode(CCBOTTOM); updateName(bottomConcept,bottomConceptString); mClassTermConceptHash->insert(mBottomClassExpression,bottomConcept); mConceptClassTermHash->insert(bottomConcept,mBottomClassExpression); tBox->setBottomConcept(bottomConcept); } CConcept* indiTriggerConcept = tBox->getIndividualTriggerConcept(); if (!indiTriggerConcept) { indiTriggerConcept = CObjectAllocator::allocateAndConstruct(tBoxMemMan); indiTriggerConcept->initConcept(); indiTriggerConcept->setConceptTag(tBox->getIndividualTriggerConceptIndex()); indiTriggerConcept->setOperatorCode(CCIMPLTRIG); tBox->setIndividualTriggerConcept(indiTriggerConcept); } CConcept* topDataRangeConcept = tBox->getTopDataRangeConcept(); if (!topDataRangeConcept) { topDataRangeConcept = CObjectAllocator::allocateAndConstruct(tBoxMemMan); topDataRangeConcept->initConcept(); topDataRangeConcept->setConceptTag(tBox->getTopDataRangeConceptIndex()); topDataRangeConcept->setOperatorCode(CCIMPLTRIG); tBox->setTopDataRangeConcept(topDataRangeConcept); } CMemoryAllocationManager* rBoxMemMan = CContext::getMemoryAllocationManager(rBox->getBoxContext()); CRole* topObjectRole = rBox->getTopObjectRole(); if (!topObjectRole) { topObjectRole = CObjectAllocator::allocateAndConstruct(tBoxMemMan); topObjectRole->initRole(); topObjectRole->setRoleTag(rBox->getTopObjectRoleIndex()); updateName(topObjectRole,topObjectRoleString); mObjPropTermRoleHash->insert(mTopObjPropExpression,topObjectRole); mRoleObjPropTermHash->insert(topObjectRole,mTopObjPropExpression); rBox->setTopObjectRole(topObjectRole); } CRole* bottomObjectRole = rBox->getBottomObjectRole(); if (!bottomObjectRole) { bottomObjectRole = CObjectAllocator::allocateAndConstruct(tBoxMemMan); bottomObjectRole->initRole(); bottomObjectRole->setRoleTag(rBox->getBottomObjectRoleIndex()); updateName(bottomObjectRole,bottomObjectRoleString); mObjPropTermRoleHash->insert(mBottomObjPropExpression,bottomObjectRole); mRoleObjPropTermHash->insert(bottomObjectRole,mBottomObjPropExpression); rBox->setBottomObjectRole(bottomObjectRole); } CRole* topDataRole = rBox->getTopDataRole(); if (!topDataRole) { topDataRole = CObjectAllocator::allocateAndConstruct(tBoxMemMan); topDataRole->initRole(); topDataRole->setDataRole(true); topDataRole->setRoleTag(rBox->getTopDataRoleIndex()); updateName(topDataRole,topDataRoleString); mDataPropTermRoleHash->insert(mTopDataPropExpression,topDataRole); mRoleDataPropTermHash->insert(topDataRole,mTopDataPropExpression); rBox->setTopDataRole(topDataRole); } CRole* bottomDataRole = rBox->getBottomDataRole(); if (!bottomDataRole) { bottomDataRole = CObjectAllocator::allocateAndConstruct(tBoxMemMan); bottomDataRole->initRole(); bottomDataRole->setDataRole(true); bottomDataRole->setRoleTag(rBox->getBottomDataRoleIndex()); updateName(bottomDataRole,bottomDataRoleString); mDataPropTermRoleHash->insert(mBottomDataPropExpression,bottomDataRole); mRoleDataPropTermHash->insert(bottomDataRole,mBottomDataPropExpression); rBox->setBottomDataRole(bottomDataRole); } createDatatype(PREFIX_OWL_TOP_DATATYPE); createDatatype(PREFIX_OWL_BOTTOM_DATATYPE); createDatatype(PREFIX_OWL_REAL_DATATYPE); createDatatype(PREFIX_OWL_RATIONAL_DATATYPE); createDatatype(PREFIX_XML_DECIMAL_DATATYPE); createDatatype(PREFIX_XML_INTEGER_DATATYPE); createDatatype(PREFIX_XML_NONNEGATIVEINTEGER_DATATYPE); createDatatype(PREFIX_XML_POSITIVEINTEGER_DATATYPE); createDatatype(PREFIX_XML_NONPOSITIVEINTEGER_DATATYPE); createDatatype(PREFIX_XML_NEGATIVEINTEGER_DATATYPE); createDatatype(PREFIX_XML_LONG_DATATYPE); createDatatype(PREFIX_XML_INT_DATATYPE); createDatatype(PREFIX_XML_SHORT_DATATYPE); createDatatype(PREFIX_XML_BYTE_DATATYPE); createDatatype(PREFIX_XML_UNSIGNEDLONG_DATATYPE); createDatatype(PREFIX_XML_UNSIGNEDINT_DATATYPE); createDatatype(PREFIX_XML_UNSIGNEDSHORT_DATATYPE); createDatatype(PREFIX_XML_UNSIGNEDBYTE_DATATYPE); createDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); createDatatype(PREFIX_XML_STRING_DATATYPE); createDatatype(PREFIX_XML_NORMALIZEDSTRING_DATATYPE); createDatatype(PREFIX_XML_TOKEN_DATATYPE); createDatatype(PREFIX_XML_NAME_DATATYPE); createDatatype(PREFIX_XML_NCNAME_DATATYPE); createDatatype(PREFIX_XML_NMTOKEN_DATATYPE); createDatatype(PREFIX_XML_LANGUAGE_DATATYPE); createDatatype(PREFIX_XML_BOOLEAN_DATATYPE); createDatatype(PREFIX_XML_DOUBLE_DATATYPE); createDatatype(PREFIX_XML_FLOAT_DATATYPE); createDatatype(PREFIX_XML_BINARYHEX_DATATYPE); createDatatype(PREFIX_XML_BINARYBASE64_DATATYPE); createDatatype(PREFIX_XML_IRI_DATATYPE); createDatatype(PREFIX_XML_DATETIME_DATATYPE); createDatatype(PREFIX_XML_DATETIMESTAMP_DATATYPE); createDatatype(PREFIX_XML_XML_DATATYPE); CDatatypeExpression* topDatatypeExpression = mDatatypeBuildHash->value(CStringRefStringHasher(PREFIX_OWL_TOP_DATATYPE)); mOntoBuild->setTopDataRangeExpression(topDatatypeExpression); CDatatypeExpression* bottomDatatypeExpression = mDatatypeBuildHash->value(CStringRefStringHasher(PREFIX_OWL_BOTTOM_DATATYPE)); mOntoBuild->setBottomDataRangeExpression(bottomDatatypeExpression); return true; } bool CConcreteOntologyBasementBuilder::completeBuilding() { return true; } bool CConcreteOntologyBasementBuilder::addNameAbbreviation(const QString &name, const QString &abbreviatedName) { if (!mAbbreviatedNamePrefixMapHash->contains(abbreviatedName)) { CNamePrefix* namePrefix = new CNamePrefix(abbreviatedName,name); mAbbreviatedNamePrefixMapHash->insert(abbreviatedName,namePrefix); mNamePrefixMapHash->insert(name,namePrefix); return true; } else { return false; } } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyInverseRoleBuilder.cpp0000644000175000017500000004055412520550776031600 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteOntologyInverseRoleBuilder.h" namespace Konclude { namespace Reasoner { namespace Generator { CConcreteOntologyInverseRoleBuilder::CConcreteOntologyInverseRoleBuilder() { } CConcreteOntologyInverseRoleBuilder::~CConcreteOntologyInverseRoleBuilder() { } CRole* CConcreteOntologyInverseRoleBuilder::createInverseRoleDelayed(CRole* role, QHash* roleInverseRoleCreateHash, CConcreteOntology* onto) { CRoleVector* roleVec = onto->getRBox()->getRoleVector(true); cint64 roleCount = roleVec->getItemCount(); role = getLocalizedRole(role,onto); CRole*& inverseRole = (*roleInverseRoleCreateHash)[role]; if (!inverseRole) { CMemoryAllocationManager* memMan = onto->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); inverseRole = CObjectAllocator< CRole >::allocateAndConstruct(memMan); inverseRole->initRole(); inverseRole->setInverseRole(role); cint64 inverseRoleTag = roleVec->getItemCount(); inverseRole->setRoleTag(inverseRoleTag); inverseRole->setRoleComplexity(role->getRoleComplexity()); roleVec->setData(inverseRole->getRoleTag(),inverseRole); } return inverseRole; } bool CConcreteOntologyInverseRoleBuilder::createDelayedInverseRoles(QHash* roleInverseRoleCreateHash, CConcreteOntology* onto) { bool rolesCreated = false; if (!roleInverseRoleCreateHash->isEmpty()) { CRoleVector* roleVec = onto->getRBox()->getRoleVector(true); cint64 roleCount = roleVec->getItemCount(); CMemoryAllocationManager* memMan = onto->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); CBUILDHASH* roleObjPropTermHash = onto->getDataBoxes()->getExpressionDataBoxMapping()->getRoleObjectPropertyTermMappingHash(); CBUILDHASH* objPropTermRoleHash = onto->getDataBoxes()->getExpressionDataBoxMapping()->getObjectPropertyTermRoleMappingHash(); CBUILDLIST* expressionBuildContainerList = onto->getDataBoxes()->getExpressionDataBoxMapping()->getExpressionBuildListContainer(); CBUILDHASH* expressionBuildHash = onto->getDataBoxes()->getExpressionDataBoxMapping()->getStructuralExpressionBuildHash(); // collect direct and indirect sub roles QHash > roleTagIndirectSubRoleTagNegationHash; QHash > roleTagSubRoleTagNegationHash; for (qint64 i = 0; i < roleCount; ++i) { CRole *role = roleVec->getData(i); if (role) { cint64 roleTag = role->getRoleTag(); CSortedNegLinker* inSuperRoleLinkerIt = role->getIndirectSuperRoleList(); while (inSuperRoleLinkerIt) { CRole* superRole = inSuperRoleLinkerIt->getData(); cint64 superRoleTag = superRole->getRoleTag(); bool superRoleNeg = inSuperRoleLinkerIt->isNegated(); roleTagIndirectSubRoleTagNegationHash.insertMulti(superRoleTag,QPair(roleTag,superRoleNeg)); inSuperRoleLinkerIt = inSuperRoleLinkerIt->getNext(); } CSortedNegLinker* superRoleLinkerIt = role->getSuperRoleList(); while (superRoleLinkerIt) { CRole* superRole = superRoleLinkerIt->getData(); cint64 superRoleTag = superRole->getRoleTag(); bool superRoleNeg = superRoleLinkerIt->isNegated(); roleTagSubRoleTagNegationHash.insertMulti(superRoleTag,QPair(roleTag,superRoleNeg)); superRoleLinkerIt = superRoleLinkerIt->getNext(); } } } for (QHash::const_iterator crRoIt = roleInverseRoleCreateHash->constBegin(), crRoItEnd = roleInverseRoleCreateHash->constEnd(); crRoIt != crRoItEnd; ++crRoIt) { CRole* role = crRoIt.key(); CRole* inverseRole = crRoIt.value(); cint64 inverseRoleTag = inverseRole->getRoleTag(); CSortedNegLinker* invRoleLinker1 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); invRoleLinker1->init(role,true); inverseRole->addSuperRoleLinker(invRoleLinker1); CSortedNegLinker* invRoleLinker2 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); invRoleLinker2->init(inverseRole,true); role->addSuperRoleLinker(invRoleLinker2); role->setInverseRole(inverseRole); CObjectPropertyTermExpression* buildExpression = roleObjPropTermHash->value(role); CInverseObjectPropertyOfExpression* expression = nullptr; expression = new CInverseObjectPropertyOfExpression(buildExpression); expressionBuildHash->insert(CExpressionHasher(expression),expression); expressionBuildContainerList->append(expression); roleObjPropTermHash->insert(role,expression); objPropTermRoleHash->insert(expression,role); QList< QPair > subRoleTagList(roleTagSubRoleTagNegationHash.values(role->getRoleTag())); for (QList< QPair >::const_iterator it = subRoleTagList.constBegin(), itEnd = subRoleTagList.constEnd(); it != itEnd; ++it) { cint64 subRoleTag = it->first; CRole* subRole = getLocalizedRole(subRoleTag,onto); // add new inverse super role CSortedNegLinker* superRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); superRoleLinker->init(inverseRole,!it->second); subRole->addSuperRoleLinker(superRoleLinker); } QList< QPair > indSubRoleTagList(roleTagIndirectSubRoleTagNegationHash.values(role->getRoleTag())); for (QList< QPair >::const_iterator it = indSubRoleTagList.constBegin(), itEnd = indSubRoleTagList.constEnd(); it != itEnd; ++it) { cint64 subRoleTag = it->first; CRole* subRole = getLocalizedRole(subRoleTag,onto); // add new inverse super role CSortedNegLinker* superRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); superRoleLinker->init(inverseRole,!it->second); subRole->addIndirectSuperRoleLinker(superRoleLinker); } // copy indirect super role linker to new inverse role CSortedNegLinker* inSuperRoleLinkerIt = role->getIndirectSuperRoleList(); while (inSuperRoleLinkerIt) { CRole* superRole = inSuperRoleLinkerIt->getData(); cint64 superRoleTag = superRole->getRoleTag(); bool superRoleNeg = inSuperRoleLinkerIt->isNegated(); CSortedNegLinker* invSuperRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); invSuperRoleLinker->init(superRole,!superRoleNeg); inverseRole->addIndirectSuperRoleLinker(invSuperRoleLinker); roleTagIndirectSubRoleTagNegationHash.insertMulti(superRoleTag,QPair(inverseRoleTag,!superRoleNeg)); inSuperRoleLinkerIt = inSuperRoleLinkerIt->getNext(); } // copy super role linker to new inverse role CSortedNegLinker* superRoleLinkerIt = role->getSuperRoleList(); while (superRoleLinkerIt) { CRole* superRole = superRoleLinkerIt->getData(); cint64 superRoleTag = superRole->getRoleTag(); bool superRoleNeg = superRoleLinkerIt->isNegated(); CSortedNegLinker* invSuperRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); invSuperRoleLinker->init(superRole,!superRoleNeg); inverseRole->addSuperRoleLinker(invSuperRoleLinker); roleTagSubRoleTagNegationHash.insertMulti(superRoleTag,QPair(inverseRoleTag,!superRoleNeg)); superRoleLinkerIt = superRoleLinkerIt->getNext(); } rolesCreated = true; } } return rolesCreated; } CRole* CConcreteOntologyInverseRoleBuilder::createInverseRole(CRole* role, CConcreteOntology* onto) { CRoleVector* roleVec = onto->getRBox()->getRoleVector(true); cint64 roleCount = roleVec->getItemCount(); CMemoryAllocationManager* memMan = onto->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); CBUILDHASH* roleObjPropTermHash = onto->getDataBoxes()->getExpressionDataBoxMapping()->getRoleObjectPropertyTermMappingHash(); CBUILDHASH* objPropTermRoleHash = onto->getDataBoxes()->getExpressionDataBoxMapping()->getObjectPropertyTermRoleMappingHash(); CBUILDLIST* expressionBuildContainerList = onto->getDataBoxes()->getExpressionDataBoxMapping()->getExpressionBuildListContainer(); CBUILDHASH* expressionBuildHash = onto->getDataBoxes()->getExpressionDataBoxMapping()->getStructuralExpressionBuildHash(); // collect direct and indirect sub roles QHash > roleTagIndirectSubRoleTagNegationHash; QHash > roleTagSubRoleTagNegationHash; for (qint64 i = 0; i < roleCount; ++i) { CRole *role = roleVec->getData(i); if (role) { cint64 roleTag = role->getRoleTag(); CSortedNegLinker* inSuperRoleLinkerIt = role->getIndirectSuperRoleList(); while (inSuperRoleLinkerIt) { CRole* superRole = inSuperRoleLinkerIt->getData(); cint64 superRoleTag = superRole->getRoleTag(); bool superRoleNeg = inSuperRoleLinkerIt->isNegated(); roleTagIndirectSubRoleTagNegationHash.insertMulti(superRoleTag,QPair(roleTag,superRoleNeg)); inSuperRoleLinkerIt = inSuperRoleLinkerIt->getNext(); } CSortedNegLinker* superRoleLinkerIt = role->getSuperRoleList(); while (superRoleLinkerIt) { CRole* superRole = superRoleLinkerIt->getData(); cint64 superRoleTag = superRole->getRoleTag(); bool superRoleNeg = superRoleLinkerIt->isNegated(); roleTagSubRoleTagNegationHash.insertMulti(superRoleTag,QPair(roleTag,superRoleNeg)); superRoleLinkerIt = superRoleLinkerIt->getNext(); } } } // build additional inverse role role = getLocalizedRole(role,onto); CRole* inverseRole = CObjectAllocator< CRole >::allocateAndConstruct(memMan); inverseRole->initRole(); inverseRole->setInverseRole(role); cint64 inverseRoleTag = roleVec->getItemCount(); inverseRole->setRoleTag(inverseRoleTag); inverseRole->setRoleComplexity(role->getRoleComplexity()); roleVec->setData(inverseRole->getRoleTag(),inverseRole); CSortedNegLinker* invRoleLinker1 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); invRoleLinker1->init(role,true); inverseRole->addSuperRoleLinker(invRoleLinker1); CSortedNegLinker* invRoleLinker2 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); invRoleLinker2->init(inverseRole,true); role->addSuperRoleLinker(invRoleLinker2); role->setInverseRole(inverseRole); CObjectPropertyTermExpression* buildExpression = roleObjPropTermHash->value(role); CInverseObjectPropertyOfExpression* expression = nullptr; expression = new CInverseObjectPropertyOfExpression(buildExpression); expressionBuildHash->insert(CExpressionHasher(expression),expression); expressionBuildContainerList->append(expression); roleObjPropTermHash->insert(role,expression); objPropTermRoleHash->insert(expression,role); QList< QPair > subRoleTagList(roleTagSubRoleTagNegationHash.values(role->getRoleTag())); for (QList< QPair >::const_iterator it = subRoleTagList.constBegin(), itEnd = subRoleTagList.constEnd(); it != itEnd; ++it) { cint64 subRoleTag = it->first; CRole* subRole = getLocalizedRole(subRoleTag,onto); // add new inverse super role CSortedNegLinker* superRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); superRoleLinker->init(inverseRole,!it->second); subRole->addSuperRoleLinker(superRoleLinker); } QList< QPair > indSubRoleTagList(roleTagIndirectSubRoleTagNegationHash.values(role->getRoleTag())); for (QList< QPair >::const_iterator it = indSubRoleTagList.constBegin(), itEnd = indSubRoleTagList.constEnd(); it != itEnd; ++it) { cint64 subRoleTag = it->first; CRole* subRole = getLocalizedRole(subRoleTag,onto); // add new inverse super role CSortedNegLinker* superRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); superRoleLinker->init(inverseRole,!it->second); subRole->addIndirectSuperRoleLinker(superRoleLinker); } // copy indirect super role linker to new inverse role CSortedNegLinker* inSuperRoleLinkerIt = role->getIndirectSuperRoleList(); while (inSuperRoleLinkerIt) { CRole* superRole = inSuperRoleLinkerIt->getData(); cint64 superRoleTag = superRole->getRoleTag(); bool superRoleNeg = inSuperRoleLinkerIt->isNegated(); CSortedNegLinker* invSuperRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); invSuperRoleLinker->init(superRole,!superRoleNeg); inverseRole->addIndirectSuperRoleLinker(invSuperRoleLinker); roleTagIndirectSubRoleTagNegationHash.insertMulti(superRoleTag,QPair(inverseRoleTag,!superRoleNeg)); inSuperRoleLinkerIt = inSuperRoleLinkerIt->getNext(); } // copy super role linker to new inverse role CSortedNegLinker* superRoleLinkerIt = role->getSuperRoleList(); while (superRoleLinkerIt) { CRole* superRole = superRoleLinkerIt->getData(); cint64 superRoleTag = superRole->getRoleTag(); bool superRoleNeg = superRoleLinkerIt->isNegated(); CSortedNegLinker* invSuperRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); invSuperRoleLinker->init(superRole,!superRoleNeg); inverseRole->addSuperRoleLinker(invSuperRoleLinker); roleTagSubRoleTagNegationHash.insertMulti(superRoleTag,QPair(inverseRoleTag,!superRoleNeg)); superRoleLinkerIt = superRoleLinkerIt->getNext(); } return inverseRole; } bool CConcreteOntologyInverseRoleBuilder::hasInverseRole(CRole* role, bool searchInverseEquivalent) { return getInverseRole(role,searchInverseEquivalent) != nullptr; } CRole* CConcreteOntologyInverseRoleBuilder::getInverseRole(CRole* role, bool searchInverseEquivalent) { CSortedNegLinker< CRole* >* suberRoleLinkerIt = role->getSuperRoleList(); while (suberRoleLinkerIt) { CRole* superRole = suberRoleLinkerIt->getData(); bool superRoleNeg = suberRoleLinkerIt->isNegated(); if (superRoleNeg) { if (!searchInverseEquivalent) { return superRole; } else { CSortedNegLinker< CRole* >* invSuberRoleLinkerIt = superRole->getSuperRoleList(); while (invSuberRoleLinkerIt) { if (invSuberRoleLinkerIt->getData()->getRoleTag() == role->getRoleTag()) { return superRole; } invSuberRoleLinkerIt = invSuberRoleLinkerIt->getNext(); } } } suberRoleLinkerIt = suberRoleLinkerIt->getNext(); } return nullptr; } CRole* CConcreteOntologyInverseRoleBuilder::getLocalizedRole(CRole* role, CConcreteOntology* onto) { return getLocalizedRole(role->getRoleTag(),onto); } CRole* CConcreteOntologyInverseRoleBuilder::getLocalizedRole(cint64 roleTag, CConcreteOntology* onto) { CRoleVector* roleVec = onto->getRBox()->getRoleVector(true); CRole* role = roleVec->getData(roleTag); if (!roleVec->hasLocalData(roleTag)) { role = CConceptRoleIndividualLocator::getLocatedRole(role,onto); } return role; } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CQueryBuilderGenerator.cpp0000644000175000017500000000215312520551000027047 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryBuilderGenerator.h" namespace Konclude { namespace Reasoner { namespace Generator { CQueryBuilderGenerator::CQueryBuilderGenerator() { } CQueryBuilderGenerator::~CQueryBuilderGenerator() { } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CActiveEntitySubExpressionVisitorUpdater.h0000644000175000017500000000507112520550774032323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CACTIVEENTITYSUBEXPRESSIONVISITORUPDATER_H #define KONCLUDE_REASONER_GENERATOR_CACTIVEENTITYSUBEXPRESSIONVISITORUPDATER_H // Libraries includes #include // Namespace includes // Other includes #include "Reasoner/Ontology/CActiveEntityCountVector.h" #include "Parser/Expressions/CBuildExpression.h" #include "Parser/Expressions/CSubExpressionVisitor.h" #include "Parser/Expressions/CExpressionEntity.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Parser::Expression; namespace Reasoner { using namespace Ontology; namespace Generator { /*! * * \class CActiveEntitySubExpressionVisitorUpdater * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CActiveEntitySubExpressionVisitorUpdater : public CSubExpressionVisitor { // public methods public: //! Constructor CActiveEntitySubExpressionVisitorUpdater(CActiveEntityCountVector* countVector); bool updateEntitiesForAxioms(CBuildExpression* expression, bool added); virtual bool visitSubExpression(CBuildExpression* expression, CBuildExpression* subExpression, CSubExpressionVisitor* visitor); virtual bool visitEntity(CBuildExpression* expression, CExpressionEntity* entity, CSubExpressionVisitor* visitor); // protected methods protected: // protected variables protected: bool mVisitingAxiomAdded; CActiveEntityCountVector* mCountVector; // private methods private: // private variables private: }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_GENERATOR_CACTIVEENTITYSUBEXPRESSIONVISITORUPDATER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CSatisfiableCalculationJobGenerator.cpp0000644000175000017500000001071712520551000031500 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCalculationJobGenerator.h" namespace Konclude { namespace Reasoner { namespace Generator { CSatisfiableCalculationJobGenerator::CSatisfiableCalculationJobGenerator(CConcreteOntology *ontology) { mOntology = ontology; } CSatisfiableCalculationJobGenerator::~CSatisfiableCalculationJobGenerator() { } CSatisfiableCalculationJob* CSatisfiableCalculationJobGenerator::getSatisfiableCalculationJob(CConcept* concept, bool negation, CIndividual* individual, CSatisfiableCalculationJob* satCalcJob) { return getSatisfiableCalculationJob(QList< QPair >()<(concept,negation),individual,satCalcJob); } CSatisfiableCalculationJob* CSatisfiableCalculationJobGenerator::getSatisfiableCalculationJob(CConcept* concept1, bool negation1, CConcept* concept2, bool negation2, CIndividual* individual, CSatisfiableCalculationJob* satCalcJob) { return getSatisfiableCalculationJob(QList< QPair >()<(concept1,negation1)<(concept2,negation2),individual,satCalcJob); } CSatisfiableCalculationJob* CSatisfiableCalculationJobGenerator::getSatisfiableCalculationJob(const QList& conceptList, CIndividual* individual, CSatisfiableCalculationJob* satCalcJob) { QList< QPair > conNegList; FOREACHIT (CConcept* concept, conceptList) { conNegList.append(QPair(concept,false)); } return getSatisfiableCalculationJob(conNegList,individual,satCalcJob); } CSatisfiableCalculationJob* CSatisfiableCalculationJobGenerator::getSatisfiableCalculationJob(const QList< QPair >& conceptNegationList, CIndividual* individual, CSatisfiableCalculationJob* satCalcJob) { if (!satCalcJob) { satCalcJob = new CSatisfiableCalculationJob(); } satCalcJob->setOntology(mOntology); CSatisfiableCalculationConceptConstruct* satCalcConstruct = new CSatisfiableCalculationConceptConstruct(); for (QList< QPair >::const_iterator it = conceptNegationList.constBegin(), itEnd = conceptNegationList.constEnd(); it != itEnd; ++it) { CConcept* concept = it->first; bool negation = it->second; CXSortedNegLinker* conNegLinker = new CXSortedNegLinker(concept,negation); satCalcConstruct->addConstructConceptLinker(conNegLinker); } if (individual) { satCalcConstruct->setIndividual(individual); } else { satCalcConstruct->setRelativeNewNodeID(satCalcJob->getNextRelativeNodeID()); } satCalcJob->addSatisfiableCalculationConstruct(satCalcConstruct); return satCalcJob; } CSatisfiableCalculationJob* CSatisfiableCalculationJobGenerator::getSatisfiableCalculationJob(const QList< CIndividual* >& indiList, CSatisfiableCalculationJob* satCalcJob) { if (!satCalcJob) { satCalcJob = new CSatisfiableCalculationJob(); } satCalcJob->setOntology(mOntology); for (QList< CIndividual* >::const_iterator it = indiList.constBegin(), itEnd = indiList.constEnd(); it != itEnd; ++it) { CIndividual* individual = (*it); CSatisfiableCalculationConceptConstruct* satCalcConstruct = new CSatisfiableCalculationConceptConstruct(); if (individual) { satCalcConstruct->setIndividual(individual); } else { satCalcConstruct->setRelativeNewNodeID(satCalcJob->getNextRelativeNodeID()); } satCalcJob->addSatisfiableCalculationConstruct(satCalcConstruct); } return satCalcJob; } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CApproximatedSaturationCalculationJobGenerator.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CApproximatedSaturationCalculationJobGenera0000644000175000017500000000604112520550774032467 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CAPPROXIMATEDSATURATIONCALCULATIONJOBGENERATOR_H #define KONCLUDE_REASONER_GENERATOR_CAPPROXIMATEDSATURATIONCALCULATIONJOBGENERATOR_H // Libraries includes // Namespace includes // Other includes #include "Reasoner/Query/CApproximatedSaturationCalculationJob.h" #include "Reasoner/Consistiser/CSaturationConceptReferenceLinking.h" #include "Reasoner/Consistence/CSaturationData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Query; using namespace Consistiser; using namespace Consistence; namespace Generator { /*! * * \class CApproximatedSaturationCalculationJobGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CApproximatedSaturationCalculationJobGenerator { // public methods public: //! Constructor CApproximatedSaturationCalculationJobGenerator(CConcreteOntology *ontology); CApproximatedSaturationCalculationJob* getApproximatedSaturationCalculationJob(cint64 approximationSaturationMode, CSaturationData* saturationData = nullptr); CApproximatedSaturationCalculationJob* extendApproximatedSaturationCalculationJobConstruction(CRole* role, CConcept* concept, bool conceptNegation, bool processing, CSaturationConceptReferenceLinking* satConRefLinking, CApproximatedSaturationCalculationJob* calculationJob = nullptr); CApproximatedSaturationCalculationJob* extendApproximatedSaturationCalculationJobProcessing(CSaturationConceptReferenceLinking* satConRefLinking, CApproximatedSaturationCalculationJob* calculationJob = nullptr); CApproximatedSaturationCalculationJob* extendApproximatedSaturationCalculationJobProcessing(CIndividual* individual, CSaturationIndividualReferenceLinking* satIndiRefLinking, CApproximatedSaturationCalculationJob* calculationJob = nullptr); // protected methods protected: // protected variables protected: CConcreteOntology *mOntology; // private methods private: // private variables private: }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_GENERATOR_CAPPROXIMATEDSATURATIONCALCULATIONJOBGENERATOR_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CSatisfiableCalculationTaskFromCalculationJobGenerator.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CSatisfiableCalculationTaskFromCalculationJ0000644000175000017500000005325012520551000032354 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCalculationTaskFromCalculationJobGenerator.h" namespace Konclude { namespace Reasoner { namespace Generator { CSatisfiableCalculationTaskFromCalculationJobGenerator::CSatisfiableCalculationTaskFromCalculationJobGenerator(CGeneratorTaskHandleContextBase* genTaskHandleContext) { mGenTaskHandleContext = genTaskHandleContext; } CSatisfiableCalculationTask* CSatisfiableCalculationTaskFromCalculationJobGenerator::createSatisfiableCalculationTask(CCalculationJob* calculationJob, CCallbackData* additionalCalculatedCallback) { return createSatisfiableCalculationTask(calculationJob->getOntology(),calculationJob,additionalCalculatedCallback); } CSatisfiableCalculationTask* CSatisfiableCalculationTaskFromCalculationJobGenerator::createApproximatedSaturationCalculationTask(CConcreteOntology *ontology, CApproximatedSaturationCalculationJob* approxSaturCalcJob, CCallbackData* additionalCalculatedCallback) { CSatisfiableCalculationTask* baseTask = nullptr; CSaturationData* saturData = approxSaturCalcJob->getContinueSaturationData(); if (saturData) { CSaturationTaskData* taskSaturData = dynamic_cast(saturData); if (taskSaturData) { baseTask = taskSaturData->getSaturationTask(); } } CSatisfiableCalculationTask* satCalcTask = CObjectMemoryPoolAllocator::allocateAndConstructWithMemroyPool(mGenTaskHandleContext->getTaskHandleMemoryAllocationManager()); if (baseTask) { satCalcTask->initUndependedSatisfiableCalculationTask(baseTask,approxSaturCalcJob->getCalculationConfiguration(),approxSaturCalcJob->getCalclulationStatisticsCollector(),mGenTaskHandleContext); } else { satCalcTask->initSatisfiableCalculationTask(ontology,approxSaturCalcJob->getCalculationConfiguration(),approxSaturCalcJob->getCalclulationStatisticsCollector(),mGenTaskHandleContext); } CProcessContext* procContext = satCalcTask->getProcessContext(mGenTaskHandleContext); CProcessingDataBox* dataBox = satCalcTask->getProcessingDataBox(); CIndividualSaturationProcessNodeVector* indiNodeVec = dataBox->getIndividualSaturationProcessNodeVector(); CMemoryAllocationManager* memMan = procContext->getUsedMemoryAllocationManager(); cint64 nextIndiID = qMax(ontology->getABox()->getIndividualCount()+1,indiNodeVec->getItemCount()); bool separateSaturation = approxSaturCalcJob->isSeparateSaturation(); CApproximatedSaturationCalculationConstructionConstruct* satCalcConsConstruct = approxSaturCalcJob->getSatisfiableCalculationConstructionConstructs(); while (satCalcConsConstruct) { CSaturationConceptReferenceLinking* satConRefLink = satCalcConsConstruct->getSaturationConceptReferenceLinking(); CSaturationIndividualReferenceLinking* satIndiRefLink = satCalcConsConstruct->getSaturationIndividualReferenceLinking(); CIndividual* nominalIndi = satCalcConsConstruct->getIndividual(); cint64 individualID = 0; if (nominalIndi) { individualID = nominalIndi->getIndividualID(); } else { individualID = nextIndiID++; } CIndividualSaturationProcessNode* indi = CObjectParameterizingAllocator< CIndividualSaturationProcessNode,CProcessContext* >::allocateAndConstructAndParameterize(memMan,procContext); indi->initIndividualSaturationProcessNode(individualID,satConRefLink,satIndiRefLink); if (nominalIndi) { indi->setNominalIndividual(nominalIndi); } indi->setSeparated(separateSaturation); if (satConRefLink) { satConRefLink->setIndividualProcessNodeForConcept(indi); } if (satIndiRefLink) { satIndiRefLink->setIndividualProcessNodeForIndividual(indi); } indiNodeVec->setLocalData(individualID,indi); bool processing = satCalcConsConstruct->getQueueProcessing(); CIndividualSaturationProcessNodeLinker* indiProcNodeLinker = CObjectAllocator< CIndividualSaturationProcessNodeLinker >::allocateAndConstruct(memMan); indiProcNodeLinker->initProcessNodeLinker(indi,processing); indi->setIndividualSaturationProcessNodeLinker(indiProcNodeLinker); if (processing) { dataBox->addIndividualSaturationProcessNodeLinker(indiProcNodeLinker); } satCalcConsConstruct = satCalcConsConstruct->getNextConstruct(); } CApproximatedSaturationCalculationProcessingConstruct* satCalcProcConstruct = approxSaturCalcJob->getSatisfiableCalculationProcessingConstructs(); while (satCalcProcConstruct) { CSaturationConceptReferenceLinking* satConRefLink = satCalcProcConstruct->getSaturationConceptReferenceLinking(); if (satConRefLink) { CIndividualSaturationProcessNode* indiNode = (CIndividualSaturationProcessNode*)satConRefLink->getIndividualProcessNodeForConcept(); if (!indiNode->isInitialized()) { CIndividualSaturationProcessNodeLinker* indiProcNodeLinker = indiNode->getIndividualSaturationProcessNodeLinker(); indiProcNodeLinker->setNegation(true); dataBox->addIndividualSaturationProcessNodeLinker(indiProcNodeLinker); } } CSaturationIndividualReferenceLinking* satIndiRefLink = satCalcProcConstruct->getSaturationIndividualReferenceLinking(); if (satIndiRefLink) { CIndividualSaturationProcessNode* indiNode = (CIndividualSaturationProcessNode*)satIndiRefLink->getIndividualProcessNodeForConcept(); if (!indiNode->isInitialized()) { CIndividualSaturationProcessNodeLinker* indiProcNodeLinker = indiNode->getIndividualSaturationProcessNodeLinker(); indiProcNodeLinker->setNegation(true); dataBox->addIndividualSaturationProcessNodeLinker(indiProcNodeLinker); } } satCalcProcConstruct = satCalcProcConstruct->getNextConstruct(); } if (additionalCalculatedCallback) { satCalcTask->addCallbackLinker(additionalCalculatedCallback); } satCalcTask->setSaturationIndividualsAnalysationObserver(approxSaturCalcJob->getSaturationIndividualsAnalysationObserver()); satCalcTask->setConsistenceAdapter(approxSaturCalcJob->getSaturationTaskPreyingAdapter()); satCalcTask->setCalculationTaskType(CSatisfiableCalculationTask::CALCULATIONTABLEAUAPPROXIMATEDSATURATIONTASK); return satCalcTask; } CSatisfiableCalculationTask* CSatisfiableCalculationTaskFromCalculationJobGenerator::createSatisfiableCalculationTask(CConcreteOntology *ontology, CCalculationJob* calculationJob, CCallbackData* additionalCalculatedCallback) { CSatisfiableCalculationJob* satCalcJob = dynamic_cast(calculationJob); if (satCalcJob) { CSatisfiableCalculationTask* baseTask = nullptr; bool lastConDesReapplication = false; bool clearIndiProcessingQueue = false; if (satCalcJob->getConsecutivelyCalculationJobInstantiation()) { baseTask = dynamic_cast(satCalcJob->getConsecutivelyCalculationJobInstantiation()); lastConDesReapplication = false; } if (!baseTask) { CConsistence* consistence = ontology->getConsistence(); CConsistenceTaskData* consTaskData = nullptr; if (consistence) { CConsistenceData* consData = consistence->getConsistenceModelData(); if (consData) { consTaskData = dynamic_cast(consData); } } if (consTaskData) { baseTask = consTaskData->getDeterministicSatisfiableTask(); lastConDesReapplication = consTaskData->getDeterministicSatisfiableTask() != consTaskData->getCompletionGraphCachedSatisfiableTask(); clearIndiProcessingQueue = true; } } return createSatisfiableCalculationTaskExtension(ontology,calculationJob,baseTask,lastConDesReapplication,clearIndiProcessingQueue,additionalCalculatedCallback); } CApproximatedSaturationCalculationJob* approxSaturCalcJob = dynamic_cast(calculationJob); if (approxSaturCalcJob) { CCalculationConfigurationExtension* calcConfig = approxSaturCalcJob->getCalculationConfiguration(); CSatisfiableCalculationTask* satCalcTask = nullptr; satCalcTask = createApproximatedSaturationCalculationTask(ontology,approxSaturCalcJob,additionalCalculatedCallback); return satCalcTask; } return nullptr; } CSatisfiableCalculationTask* CSatisfiableCalculationTaskFromCalculationJobGenerator::createSatisfiableCalculationTaskExtension(CCalculationJob* calculationJob, CSatisfiableCalculationTask* baseTask, bool lastConDesReapplication, bool clearIndiProcessingQueue, CCallbackData* additionalCalculatedCallback) { return createSatisfiableCalculationTaskExtension(calculationJob->getOntology(),calculationJob,baseTask,lastConDesReapplication,clearIndiProcessingQueue,additionalCalculatedCallback); } CSatisfiableCalculationTask* CSatisfiableCalculationTaskFromCalculationJobGenerator::createSatisfiableCalculationTaskExtension(CConcreteOntology *ontology, CCalculationJob* calculationJob, CSatisfiableCalculationTask* baseTask, bool lastConDesReapplication, bool clearIndiProcessingQueue, CCallbackData* additionalCalculatedCallback) { CSatisfiableCalculationJob* satCalcJob = dynamic_cast(calculationJob); if (satCalcJob) { cint64 firstPossibleNewIndividualID = ontology->getABox()->getIndividualCount(); bool requiresTaskCalc = false; CIndividualVector* baseIndiVec = nullptr; if (baseTask) { baseIndiVec = baseTask->getProcessingDataBox()->getOntology()->getABox()->getIndividualVector(false); } CSatisfiableCalculationTask* satCalcTask = CObjectMemoryPoolAllocator::allocateAndConstructWithMemroyPool(mGenTaskHandleContext->getTaskHandleMemoryAllocationManager()); bool recreateNodesForIndividuals = false; if (clearIndiProcessingQueue) { bool avoidIndividualReprocessing = satCalcJob->getCalculationConfiguration()->isAvoidRepeatedIndividualProcessingActivated(); if (!avoidIndividualReprocessing) { clearIndiProcessingQueue = false; if (satCalcJob->getCalculationConfiguration()->isForceNodesRecreationForRepeatedIndividualProcessingActivated()) { baseTask = nullptr; if (!recreateNodesForIndividuals) { for (CSatisfiableCalculationConstruct* satCalcConstructIt = satCalcJob->getSatisfiableCalculationConstructs(); satCalcConstructIt && !clearIndiProcessingQueue; satCalcConstructIt = satCalcConstructIt->getNextConstruct()) { CIndividual* individual = satCalcConstructIt->getIndividual(); if (individual) { recreateNodesForIndividuals = true; } } } if (!recreateNodesForIndividuals) { if (calculationJob->getOntology()->getStructureSummary()->hasNominalOccurrence() || calculationJob->getOntology()->getTBox()->getUniversalConnectionNominalValueConcept()) { recreateNodesForIndividuals = true; } } } } else { bool confCompletionGraphCaching = satCalcJob->getCalculationConfiguration()->isCompletionGraphCachingActivated(); if (!confCompletionGraphCaching) { if (clearIndiProcessingQueue) { for (CSatisfiableCalculationConstruct* satCalcConstructIt = satCalcJob->getSatisfiableCalculationConstructs(); satCalcConstructIt && !clearIndiProcessingQueue; satCalcConstructIt = satCalcConstructIt->getNextConstruct()) { CIndividual* individual = satCalcConstructIt->getIndividual(); if (individual) { clearIndiProcessingQueue = false; } } } if (clearIndiProcessingQueue) { if (calculationJob->getOntology()->getStructureSummary()->hasNominalOccurrence() || calculationJob->getOntology()->getTBox()->getUniversalConnectionNominalValueConcept()) { clearIndiProcessingQueue = false; } } } } } if (baseTask) { satCalcTask->initUndependedSatisfiableCalculationTask(baseTask,satCalcJob->getCalculationConfiguration(),satCalcJob->getCalclulationStatisticsCollector(),mGenTaskHandleContext); } else { satCalcTask->initSatisfiableCalculationTask(ontology,satCalcJob->getCalculationConfiguration(),satCalcJob->getCalclulationStatisticsCollector(),mGenTaskHandleContext); } CProcessContext* procContext = satCalcTask->getProcessContext(mGenTaskHandleContext); if (baseTask) { CProcessTagger* processTagger = procContext->getUsedProcessTagger(); processTagger->incLocalizationTag(); } satCalcTask->setConsistenceAdapter(satCalcJob->getSatisfiableTaskPreyingAdapter()); satCalcTask->setClassificationMessageAdapter(satCalcJob->getSatisfiableClassificationMessageAdapter()); satCalcTask->setRealizationMarkedCandidatesMessageAdapter(satCalcJob->getRealizationMarkedCandidatesMessageAdapter()); satCalcTask->setSatisfiableTaskIncrementalConsistencyTestingAdapter(satCalcJob->getSatisfiableTaskIncrementalConsistencyTestingAdapter()); satCalcTask->setSatisfiableTaskIndividualDependenceTrackingAdapter(satCalcJob->getSatisfiableTaskIndividualDependenceTrackingAdapter()); satCalcTask->setPossibleAssertionCollectionAdapter(satCalcJob->getPossibleAssertionCollectionAdapter()); CProcessingDataBox* dataBox = satCalcTask->getProcessingDataBox(); dataBox->setConstructedIndividualNode(nullptr); dataBox->setReapplicationLastConceptDesciptorOnLastIndividualNodeRequired(lastConDesReapplication); if (satCalcTask->getSatisfiableTaskIncrementalConsistencyTestingAdapter()) { CConcreteOntology* prevOntology = satCalcTask->getSatisfiableTaskIncrementalConsistencyTestingAdapter()->getPreviousConsistentOntology(); CSatisfiableCalculationTask* prevDetConsTask = nullptr; CSatisfiableCalculationTask* prevNondetConsTask = nullptr; CConsistence* prevConsistence = prevOntology->getConsistence(); CConsistenceTaskData* prevConsTaskData = nullptr; if (prevConsistence) { CConsistenceData* prevConsData = prevConsistence->getConsistenceModelData(); if (prevConsData) { prevConsTaskData = dynamic_cast(prevConsData); } } if (prevConsTaskData) { prevDetConsTask = prevConsTaskData->getDeterministicSatisfiableTask(); prevNondetConsTask = prevConsTaskData->getCompletionGraphCachedSatisfiableTask(); } if (prevDetConsTask) { CProcessTagger* prevProcessTagger = prevDetConsTask->getProcessingDataBox()->getProcessContext()->getUsedProcessTagger(); CProcessTagger* processTagger = procContext->getUsedProcessTagger(); processTagger->initProcessTagger(prevProcessTagger); processTagger->incLocalizationTag(); } if (prevNondetConsTask) { firstPossibleNewIndividualID = prevNondetConsTask->getProcessingDataBox()->getNextIndividualNodeID(false); } prevDetConsTask->getProcessingDataBox()->setIncrementalExpansionID(satCalcTask->getSatisfiableTaskIncrementalConsistencyTestingAdapter()->getIncrementalRevisionID()); } if (satCalcTask->getSatisfiableTaskIndividualDependenceTrackingAdapter()) { dataBox->setIndividualDependenceTrackingRequired(true); } CIndividualProcessNodeVector* indiNodeVec = dataBox->getIndividualProcessNodeVector(); if (clearIndiProcessingQueue) { dataBox->clearIndividualProcessingQueues(); } CIndividualUnsortedProcessingQueue* indiNodeQueue = dataBox->getIndividualImmediatelyProcessingQueue(true); CDependencyTrackPoint* independentBaseDepTrackPoint = dataBox->getBranchingTree(true)->getBaseDependencyNode(true)->getContinueDependencyTrackPoint(); CMemoryAllocationManager* memMan = procContext->getUsedMemoryAllocationManager(); firstPossibleNewIndividualID = qMax(firstPossibleNewIndividualID,indiNodeVec->getItemCount()); cint64 baseIndiID = firstPossibleNewIndividualID; cint64 constructionIndiCount = 0; CSatisfiableCalculationConstruct* satCalcConstruct = satCalcJob->getSatisfiableCalculationConstructs(); while (satCalcConstruct) { ++constructionIndiCount; CIndividual* individual = satCalcConstruct->getIndividual(); cint64 individualID = baseIndiID+satCalcConstruct->getRelativeNewNodeID(); if (individual) { individualID = individual->getIndividualID(); } else { cint64 fixedIndiID = satCalcConstruct->getIndividualID(); if (fixedIndiID >= 0) { individualID = fixedIndiID; } } firstPossibleNewIndividualID = qMax(firstPossibleNewIndividualID,individualID+1); CXSortedNegLinker* satConJobLinker = nullptr; CSatisfiableCalculationConceptConstruct* satConCalcConstuct = dynamic_cast(satCalcConstruct); if (satConCalcConstuct) { satConJobLinker = satConCalcConstuct->getConstructConceptLinker(); } CIndividualProcessNode* refIndi = indiNodeVec->getData(individualID); // check whether individual is already processed if (satConJobLinker || !refIndi || !baseIndiVec || baseIndiVec->getData(individualID) != individual) { requiresTaskCalc = true; CIndividualProcessNode* indi = indiNodeVec->getLocalData(individualID); CIndividualProcessNode* localIndi = indi; if (!localIndi) { localIndi = CObjectParameterizingAllocator< CIndividualProcessNode,CProcessContext* >::allocateAndConstructAndParameterize(memMan,procContext); localIndi->initDependencyTracker(independentBaseDepTrackPoint); if (refIndi) { while (refIndi->hasMergedIntoIndividualNodeID()) { cint64 corrIndiID = refIndi->getMergedIntoIndividualNodeID(); refIndi = indiNodeVec->getData(corrIndiID); individualID = corrIndiID; } localIndi->initIndividualProcessNode(refIndi); localIndi->clearProcessingQueued(); localIndi->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFCACHEDCOMPUTEDTYPESADDED); } else if (individual) { localIndi->setAssertionConceptLinker(individual->getAssertionConceptLinker()); localIndi->setAssertionRoleLinker(individual->getAssertionRoleLinker()); localIndi->setReverseAssertionRoleLinker(individual->getReverseAssertionRoleLinker()); } localIndi->setIndividualID(individualID); if (individual) { localIndi->setNominalIndividual(individual); localIndi->setIndividualType(CIndividualProcessNode::NOMINALINDIVIDUALTYPE); } if (!individual || baseTask) { localIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDBLOCKINGORCACHING); } localIndi->setInitializingConceptLinker(nullptr); indiNodeVec->setLocalData(individualID,localIndi); indiNodeQueue->insertIndiviudalProcessNode(localIndi); if (dataBox->getConstructedIndividualNode() == nullptr) { dataBox->setConstructedIndividualNode(localIndi); } } CXSortedNegLinker* initConLinker = nullptr; while (satConJobLinker) { CXSortedNegLinker* tmpConLinker = CObjectAllocator< CXSortedNegLinker >::allocateAndConstruct(memMan); initConLinker = tmpConLinker->initNegLinker(satConJobLinker->getData(),satConJobLinker->getNegation(),initConLinker); satConJobLinker = satConJobLinker->getNext(); } localIndi->addInitializingConceptLinker(initConLinker); } satCalcConstruct = satCalcConstruct->getNextConstruct(); } if (recreateNodesForIndividuals) { CIndividualVector* indiVec = ontology->getABox()->getIndividualVector(false); if (indiVec) { cint64 indiCount = indiVec->getItemCount(); for (cint64 i = 0; i < indiCount; ++i) { CIndividual* indi = indiVec->getData(i); if (indi) { CIndividualProcessNode* indiNode = indiNodeVec->getData(i); if (!indiNode) { indiNode = CObjectParameterizingAllocator< CIndividualProcessNode,CProcessContext* >::allocateAndConstructAndParameterize(memMan,procContext); indiNode->initDependencyTracker(independentBaseDepTrackPoint); indiNode->setAssertionConceptLinker(indi->getAssertionConceptLinker()); indiNode->setAssertionRoleLinker(indi->getAssertionRoleLinker()); indiNode->setReverseAssertionRoleLinker(indi->getReverseAssertionRoleLinker()); indiNode->setIndividualID(i); indiNode->setNominalIndividual(indi); indiNode->setIndividualType(CIndividualProcessNode::NOMINALINDIVIDUALTYPE); indiNodeVec->setLocalData(i,indiNode); indiNodeQueue->insertIndiviudalProcessNode(indiNode); } } } } } dataBox->setFirstPossibleIndividualNodeID(firstPossibleNewIndividualID); dataBox->setMultipleConstructionIndividualNodes(constructionIndiCount > 1); if (additionalCalculatedCallback) { satCalcTask->addCallbackLinker(additionalCalculatedCallback); } return satCalcTask; } return nullptr; } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CGeneratorTaskHandleContextBase.h0000644000175000017500000000446712520551000030270 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CGENERATORTASKHANDLECONTEXTBASE_H #define KONCLUDE_REASONER_GENERATOR_CGENERATORTASKHANDLECONTEXTBASE_H // Libraries includes // Namespace includes // Other includes #include "Scheduler/CTaskHandleContext.h" #include "Scheduler/CTaskHandleMemoryPoolAllocationManager.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; using namespace Utilities::Memory; namespace Reasoner { namespace Generator { /*! * * \class CGeneratorTaskHandleContextBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGeneratorTaskHandleContextBase : public CTaskHandleContext { // public methods public: //! Constructor CGeneratorTaskHandleContextBase(); //! Destructor virtual ~CGeneratorTaskHandleContextBase(); virtual CTaskHandleMemoryAllocationManager* getTaskHandleMemoryAllocationManager(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); // protected methods protected: // protected variables protected: CTaskHandleMemoryPoolAllocationManager* mMemMan; CNewAllocationMemoryPoolProvider* mMemPoolProv; // private methods private: // private variables private: }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_GENERATOR_CGENERATORTASKHANDLECONTEXTBASE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyQueryBasicBuilder.h0000644000175000017500000003044112520550776031051 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYQUERYBASICBUILDER_H #define KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYQUERYBASICBUILDER_H // Libraries includes // Namespace includes #include "CQueryBuilderGenerator.h" #include "CSatisfiableCalculationJobGenerator.h" #include "CExpressionSplitter.h" // Other includes #include "Reasoner/Query/CIsClassSatisfiableQuery.h" #include "Reasoner/Query/CAreClassesEquivalentQuery.h" #include "Reasoner/Query/CIsClassSubsumedByQuery.h" #include "Reasoner/Query/CAreClassesDisjointQuery.h" #include "Reasoner/Query/CIsClassSubsumedByQuery.h" #include "Reasoner/Query/CIsInstanceOfQuery.h" #include "Reasoner/Query/CQueryStatisticsCollectionStrings.h" #include "Reasoner/Query/CFlattenedTypesQuery.h" #include "Reasoner/Query/CFlattenedInstancesQuery.h" #include "Reasoner/Query/CTypesQuery.h" #include "Reasoner/Query/CInstancesQuery.h" #include "Reasoner/Query/CSubClassesQuery.h" #include "Reasoner/Query/CSuperClassesQuery.h" #include "Reasoner/Query/CEquivalentClassesQuery.h" #include "Reasoner/Query/CAreAxiomsEntailedQuery.h" #include "Reasoner/Query/CObjectPropertyTargetsQuery.h" #include "Reasoner/Query/CFlattenedObjectPropertyTargetsQuery.h" #include "Reasoner/Query/CSameIndividualsQuery.h" #include "Reasoner/Query/CNondeterministicIndividualsQuery.h" #include "Reasoner/Query/CDeterministicIndividualsQuery.h" #include "Reasoner/Query/CDeterministicClassAssertionQuery.h" #include "Reasoner/Query/CNondeterministicClassAssertionQuery.h" #include "Reasoner/Ontology/CConceptTextFormater.h" #include "Reasoner/Ontology/CIRIName.h" #include "Parser/COntologyBuilder.h" #include "Config/CConfigurationBase.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Parser; using namespace Config; namespace Reasoner { using namespace Query; using namespace Ontology; namespace Generator { /*! * * \class CConcreteOntologyQueryBasicBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteOntologyQueryBasicBuilder : public CQueryBuilderGenerator { // public methods public: //! Constructor CConcreteOntologyQueryBasicBuilder(CConcreteOntology* ontology, CConfigurationBase *configuration); //! Destructor virtual ~CConcreteOntologyQueryBasicBuilder(); virtual QList generateQuerys(); virtual CQueryIsClassSatisfiableExpression* getIsClassSatisfiableQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName); virtual CQueryAreClassesEquivalentExpression* getAreClassesEquivalenceQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName); virtual CQueryAreClassesDisjointExpression* getAreClassesDisjointQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName); virtual CQueryIsClassSubsumedByExpression* getIsClassSubsumedByQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName); virtual CQueryIsInstanceOfExpression* getIsInstanceOfQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName); virtual CQueryGetFlattenedTypesExpression* getGetFlattenedTypesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName); virtual CQueryGetFlattenedInstancesExpression* getGetFlattenedInstancesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName); virtual CQueryGetTypesExpression* getGetTypesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName); virtual CQueryGetSameIndividualsExpression* getGetSameIndividualsQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName); virtual CQueryGetInstancesExpression* getGetInstancesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName); virtual CQueryGetSubClassesExpression* getGetSubClassesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName); virtual CQueryGetSuperClassesExpression* getGetSuperClassesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName); virtual CQueryGetEquivalentClassesExpression* getGetEquivalentClassesQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName); virtual CQueryIsEntailedExpression* getIsEntailedQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName); virtual CQueryGetObjectPropertyTargetsExpression* getGetObjectPropertyTargetsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName); virtual CQueryGetFlattenedObjectPropertyTargetsExpression* getGetFlattenedObjectPropertyTargetsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName); virtual CQueryGetDeterministicIndividualsExpression* getGetDeterministicIndividualsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName); virtual CQueryGetNondeterministicIndividualsExpression* getGetNondeterministicIndividualsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName); virtual CQueryGetDeterministicClassAssertionsExpression* getGetDeterministicClassAssertionsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName); virtual CQueryGetNondeterministicClassAssertionsExpression* getGetNondeterministicClassAssertionsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName); virtual CQueryIsClassSatisfiableExpression* getIsClassSatisfiableQuery(CClassTermExpression* testClassExpressions, const QString& queryName); virtual CQueryIsInstanceOfExpression* getIsInstanceOfQuery(CIndividualTermExpression* individualTermExpression, CClassTermExpression* classExpression, const QString& queryName); virtual CQueryGetFlattenedTypesExpression* getGetFlattenedTypesQuery(CIndividualTermExpression* individualTermExpression, bool direct, const QString& queryName); virtual CQueryGetFlattenedInstancesExpression* getGetFlattenedInstancesQuery(CClassTermExpression* classTermExpression, bool direct, const QString& queryName); virtual CQueryGetTypesExpression* getGetTypesQuery(CIndividualTermExpression* individualTermExpression, bool direct, const QString& queryName); virtual CQueryGetSameIndividualsExpression* getGetSameIndividualsQuery(CIndividualTermExpression* individualTermExpression, const QString& queryName); virtual CQueryGetInstancesExpression* getGetInstancesQuery(CClassTermExpression* classTermExpression, bool direct, const QString& queryName); virtual CQueryGetSubClassesExpression* getGetSubClassesQuery(CClassTermExpression* classTermExpression, bool direct, const QString& queryName); virtual CQueryGetSuperClassesExpression* getGetSuperClassesQuery(CClassTermExpression* classTermExpression, bool direct, const QString& queryName); virtual CQueryGetEquivalentClassesExpression* getGetEquivalentClassesQuery(CClassTermExpression* classTermExpression, const QString& queryName); virtual CQueryGetObjectPropertyTargetsExpression* getGetObjectPropertyTargetsQuery(CObjectPropertyTermExpression* objectPropertyExpression, CIndividualTermExpression* individualExpression, const QString& queryName); virtual CQueryGetFlattenedObjectPropertyTargetsExpression* getGetFlattenedObjectPropertyTargetsQuery(CObjectPropertyTermExpression* objectPropertyExpression, CIndividualTermExpression* individualExpression, const QString& queryName); virtual CQueryGetDeterministicIndividualsExpression* getGetDeterministicIndividualsQuery(const CEXPRESSIONLIST& indiExpressions, const QString& queryName); virtual CQueryGetNondeterministicIndividualsExpression* getGetNondeterministicIndividualsQuery(const CEXPRESSIONLIST& indiExpressions, const QString& queryName); virtual CQueryGetDeterministicClassAssertionsExpression* getGetDeterministicClassAssertionsQuery(const CEXPRESSIONLIST& indiExpressions, const QString& queryName); virtual CQueryGetNondeterministicClassAssertionsExpression* getGetNondeterministicClassAssertionsQuery(const CEXPRESSIONLIST& indiExpressions, const QString& queryName); virtual CQueryAreClassesEquivalentExpression* getAreClassesEquivalenceQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) = 0; virtual CQueryAreClassesDisjointExpression* getAreClassesDisjointQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) = 0; virtual CQueryIsClassSubsumedByExpression* getIsClassSubsumedByQuery(CClassTermExpression* subsumerClassExpression, CClassTermExpression* subsumedClassExpression, const QString& queryName) = 0; virtual CQueryIsEntailedExpression* getIsEntailedQuery(const CEXPRESSIONLIST& axiomExpressions, const QString& queryName) = 0; // protected methods protected: virtual QString getStringFromConcept(CConcept *concept); virtual CConcept *getConceptFromBuildExpression(CClassTermExpression *buildExp); virtual CRole *getRoleFromBuildExpression(CObjectPropertyTermExpression *buildExp); virtual CIndividual *getIndividualFromBuildExpression(CIndividualTermExpression *buildExp); // protected variables protected: CConcreteOntology* mOntology; CConfigurationBase* config; CEXPRESSIONLIST container; CEXPRESSIONLIST classSatExpList; CEXPRESSIONLIST classEqExpList; CEXPRESSIONLIST classSubsumedExpList; CEXPRESSIONLIST classDisjointExpList; CEXPRESSIONLIST instanceExpList; CEXPRESSIONLIST flattenedTypesExpList; CEXPRESSIONLIST flattenedInstancesExpList; CEXPRESSIONLIST typesExpList; CEXPRESSIONLIST sameIndiExpList; CEXPRESSIONLIST instancesExpList; CEXPRESSIONLIST mSubClassesExpList; CEXPRESSIONLIST mSuperClassesExpList; CEXPRESSIONLIST mEquivClassesExpList; CEXPRESSIONLIST mObjectPropTargetsExpList; CEXPRESSIONLIST mObjectFlattenedPropTargetsExpList; CEXPRESSIONLIST mDetIndisExpList; CEXPRESSIONLIST mNdetIndisExpList; CEXPRESSIONLIST mDetClassAssExpList; CEXPRESSIONLIST mNdetClassAssExpList; // private methods private: // private variables private: }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYQUERYBASICBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CGeneratorTaskHandleContextBase.cpp0000644000175000017500000000311212520551000030605 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGeneratorTaskHandleContextBase.h" namespace Konclude { namespace Reasoner { namespace Generator { CGeneratorTaskHandleContextBase::CGeneratorTaskHandleContextBase() { mMemPoolProv = new CNewAllocationMemoryPoolProvider(); mMemMan = new CTaskHandleMemoryPoolAllocationManager(mMemPoolProv); } CGeneratorTaskHandleContextBase::~CGeneratorTaskHandleContextBase() { delete mMemPoolProv; delete mMemMan; } CTaskHandleMemoryAllocationManager* CGeneratorTaskHandleContextBase::getTaskHandleMemoryAllocationManager() { return mMemMan; } CMemoryAllocationManager* CGeneratorTaskHandleContextBase::getMemoryAllocationManager() { return mMemMan; } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyUpdateBuilder.cpp0000644000175000017500000044025712577014366030573 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteOntologyUpdateBuilder.h" namespace Konclude { namespace Reasoner { namespace Generator { CConcreteOntologyUpdateBuilder::CConcreteOntologyUpdateBuilder(CConcreteOntology* updateConcreteOntology) : CConcreteOntologyBuildDataUpdater(updateConcreteOntology) { LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("ConcretOntologyUpdateBuilder initialized."),this); } CConcreteOntologyUpdateBuilder::~CConcreteOntologyUpdateBuilder() { } bool CConcreteOntologyUpdateBuilder::initializeBuilding() { CConcreteOntologyBuildDataUpdater::initializeBuilding(); mNominalConceptCreationRequired = false; mLateIndiNominalConceptCreationList.clear(); mTellAxiomSet = mOntoBuild->getTellAxiomSet(); mRetractAxiomSet = mOntoBuild->getRetractAxiomSet(); mTellUpdatedAxiomSet = mOntoBuild->getUpdatedTellAxiomSet(); mRetractUpdatedAxiomSet = mOntoBuild->getUpdatedRetractAxiomSet(); mChangeAxiomList = mOntoBuild->getChangeAxiomList(); mChangeUpdatedAxiomList = mOntoBuild->getUpdatedChangeAxiomList(); mOntoData = mOnto->getDataBoxes(); tBox = mOntoData->getTBox(); rBox = mOntoData->getRBox(); aBox = mOntoData->getABox(); mInitialBuild = mOntoData->isInitialBuild(); mConstructFlags = mOntoData->getExpressionDataBoxMapping()->getBuildConstructFlags(); mUpdateClassAxiomHash = mOntoData->getExpressionDataBoxMapping()->getUpdatedClassAxiomTellOrRetractHash(); mUpdateObjectPropertyAxiomHash = mOntoData->getExpressionDataBoxMapping()->getUpdateObjectPropertyAxiomHash(); mUpdateDataPropertyAxiomHash = mOntoData->getExpressionDataBoxMapping()->getUpdateDataPropertyAxiomHash(); mUpdateAssertionAxiomHash = mOntoData->getExpressionDataBoxMapping()->getUpdateAssertionAxiomHash(); mClassTermClassAxiomSet = mOntoData->getExpressionDataBoxMapping()->getClassTermExpressionClassAxiomExpressionSet(); mClassTermClassAxiomHash = mOntoData->getExpressionDataBoxMapping()->getClassTermExpressionClassAxiomExpressionHash(); mDatatypeExpDatatypeHash = mOntoData->getExpressionDataBoxMapping()->getDatatypeExpressionDatatypeHash(); mDatatypeDatatypeExpHash = mOntoData->getExpressionDataBoxMapping()->getDatatypeDatatypeExpessionHash(); mObjPropTermObjPropAxiomSet = mOntoData->getExpressionDataBoxMapping()->getObjectPropertyTermObjectPropertyAxiomSet(); mObjPropTermObjPropAxiomHash = mOntoData->getExpressionDataBoxMapping()->getObjectPropertyTermObjectPropertyAxiomHash(); mDataPropTermDataPropAxiomSet = mOntoData->getExpressionDataBoxMapping()->getDataPropertyTermDataPropertyAxiomSet(); mDataPropTermDataPropAxiomHash = mOntoData->getExpressionDataBoxMapping()->getDataPropertyTermDataPropertyAxiomHash(); mIndiTermAssertionAxiomSet = mOntoData->getExpressionDataBoxMapping()->getIndividualTermAssertionAxiomSet(); mIndiTermAssertionAxiomHash = mOntoData->getExpressionDataBoxMapping()->getIndividualTermAssertionAxiomHash(); mTopRebuildClassTermExpressionsSet = mOntoData->getExpressionDataBoxMapping()->getTopRebuildClassTermExpressionsSet(); mTopRebuildObjectPropertyTermExpressionsSet = mOntoData->getExpressionDataBoxMapping()->getTopRebuildObjectPropertyTermExpressionsSet(); mClassTermConceptHash = mOntoData->getExpressionDataBoxMapping()->getClassTermConceptMappingHash(); mConceptClassTermHash = mOntoData->getExpressionDataBoxMapping()->getConceptClassTermMappingHash(); mDataRangeTermConceptHash = mOntoData->getExpressionDataBoxMapping()->getDataRangeTermConceptMappingHash(); mConceptDataRangeTermHash = mOntoData->getExpressionDataBoxMapping()->getConceptDataRangeTermMappingHash(); mObjPropTermRoleHash = mOntoData->getExpressionDataBoxMapping()->getObjectPropertyTermRoleMappingHash(); mRoleObjPropTermHash = mOntoData->getExpressionDataBoxMapping()->getRoleObjectPropertyTermMappingHash(); mDataPropTermRoleHash = mOntoData->getExpressionDataBoxMapping()->getDataPropertyTermRoleMappingHash(); mRoleDataPropTermHash = mOntoData->getExpressionDataBoxMapping()->getRoleDataPropertyTermMappingHash(); mIndividulTermIndiHash = mOntoData->getExpressionDataBoxMapping()->getIndividulTermIndiMappingHash(); mIndiIndividulTermHash = mOntoData->getExpressionDataBoxMapping()->getIndiIndividulTermMappingHash(); mRoleChainObjPropTermHash = mOntoData->getExpressionDataBoxMapping()->getRoleChainObjectPropertyTermHash(); mObjPropTermRoleChainHash = mOntoData->getExpressionDataBoxMapping()->getObjectPropertyTermRoleChainHash(); mLastProcessedChangedAxiom = mOntoData->getExpressionDataBoxMapping()->getLastProcessedChangedAxiom(); mLastProcessedBuildIndividual = mOntoData->getExpressionDataBoxMapping()->getLastProcessedBuildIndividual(); mLastProcessedBuildConcept = mOntoData->getExpressionDataBoxMapping()->getLastProcessedBuildConcept(); mLastProcessedBuildObjectRole = mOntoData->getExpressionDataBoxMapping()->getLastProcessedBuildObjectRole(); mLastProcessedBuildDataRole = mOntoData->getExpressionDataBoxMapping()->getLastProcessedBuildDataRole(); mLastProcessedBuildDataRange = mOntoData->getExpressionDataBoxMapping()->getLastProcessedBuildDataRange(); mLastProcessedBuildDatatype = mOntoData->getExpressionDataBoxMapping()->getLastProcessedBuildDatatype(); mLastProcessedExpression = mOntoData->getExpressionDataBoxMapping()->getLastProcessedExpression(); mLastProcessedInverseProperty = mOntoData->getExpressionDataBoxMapping()->getLastProcessedInverseProperty(); mLastBuildedIndividual = mOntoData->getExpressionDataBoxMapping()->getLastBuildedIndividual(); mLastBuildedConcept = mOntoData->getExpressionDataBoxMapping()->getLastBuildedConcept(); mLastBuildedObjectRole = mOntoData->getExpressionDataBoxMapping()->getLastBuildedObjectRole(); mLastBuildedDataRole = mOntoData->getExpressionDataBoxMapping()->getLastBuildedDataRole(); mLastBuildedDataRange = mOntoData->getExpressionDataBoxMapping()->getLastBuildedDataRange(); mLastBuildedDatatype = mOntoData->getExpressionDataBoxMapping()->getLastBuildedDatatype(); mLocExpressionBuildHash = mOntoData->getExpressionDataBoxMapping()->getStructuralExpressionBuildHash(); mLocExpressionBuildContainerList = mOntoData->getExpressionDataBoxMapping()->getExpressionBuildListContainer(); mLocInverseObjectPropertyHash = mOntoData->getExpressionDataBoxMapping()->getInverseObjectPropertyHash(); mLocBuildConceptSet = mOntoData->getExpressionDataBoxMapping()->getBuildedConceptSet(); mLocBuildObjectRoleSet = mOntoData->getExpressionDataBoxMapping()->getBuildedObjectRoleSet(); mLocBuildDataRoleSet = mOntoData->getExpressionDataBoxMapping()->getBuildedDataRoleSet(); mLocBuildDataRangeSet = mOntoData->getExpressionDataBoxMapping()->getBuildedDataRangeSet(); mLocBuildDatatypeSet = mOntoData->getExpressionDataBoxMapping()->getBuildedDatatypeSet(); mLocBuildIndividualSet = mOntoData->getExpressionDataBoxMapping()->getBuildedIndividualSet(); mLocBuildConceptList = mOntoData->getExpressionDataBoxMapping()->getBuildedConceptList(); mLocBuildObjectRoleList = mOntoData->getExpressionDataBoxMapping()->getBuildedObjectRoleList(); mLocBuildDataRoleList = mOntoData->getExpressionDataBoxMapping()->getBuildedDataRoleList(); mLocBuildDataRangeList = mOntoData->getExpressionDataBoxMapping()->getBuildedDataRangeList(); mLocBuildDatatypeList = mOntoData->getExpressionDataBoxMapping()->getBuildedDatatypeList(); mLocBuildIndividualList = mOntoData->getExpressionDataBoxMapping()->getBuildedIndividualList(); mRebuildTopConcept = false; mClassGCIExpressionSet.clear(); mLocalisationSet.clear(); mBuildingConceptSet.clear(); mNewBuildedConceptSet.clear(); mNewBuildedObjectRoleSet.clear(); mNewBuildedDataRoleSet.clear(); mBuildingObjectRoleSet.clear(); mBuildingDataRangeSet.clear(); mBuildingDatatypeSet.clear(); mBuildingDataRoleSet.clear(); mNewBuildedIndividualSet.clear(); mBuildingIndividualSet.clear(); mTaggingConceptList.clear(); mInstallConceptList.clear(); mTaggingRoleSet.clear(); mInstallRoleList.clear(); mTaggingRoleChainSet.clear(); mInstallRoleChainList.clear(); mTaggingIndividualSet.clear(); mInstallIndividualList.clear(); mNewBuildConceptSet.clear(); mNewBuildObjectRoleSet.clear(); mNewBuildDataRoleSet.clear(); mNewBuildDataRangeSet.clear(); mNewBuildDatatypeSet.clear(); mNewBuildIndividualSet.clear(); return true; } bool CConcreteOntologyUpdateBuilder::completeBuilding() { mOntoBuild->setNextAxiomNumber(mNextAxiomNumber+mNextMaxAxiomNumberOffset); CONTOLOGYAXIOMSET newTellUpdatedAxiomSet; CONTOLOGYAXIOMSET newRetractUpdatedAxiomSet; if (!mRetractUpdatedAxiomSet->isEmpty()) { mConstructFlags->setRetractionUsed(); } //FOREACHIT (CAxiomExpression* axiomExp, *mRetractUpdatedAxiomSet) { // mConstructFlags->setRetractionUsed(); // mChangeUpdatedAxiomList->append( QPair(axiomExp,false) ); // mChangeAxiomList->append( QPair(axiomExp,false) ); //} //FOREACHIT (CAxiomExpression* axiomExp, *mTellUpdatedAxiomSet) { // mChangeUpdatedAxiomList->append( QPair(axiomExp,true) ); // mChangeAxiomList->append( QPair(axiomExp,true) ); //} if (mLastProcessedChangedAxiom <= 0) { mLastProcessedChangedAxiom = mChangeAxiomList->size(); newTellUpdatedAxiomSet = *mTellAxiomSet; } else { CONTOLOGYAXIOMLIST< QPair > newChangeUpdatedAxiomList; cint64 changeAxiomCount = mChangeAxiomList->size(); while (mLastProcessedChangedAxiom < changeAxiomCount) { newChangeUpdatedAxiomList.append((*mChangeAxiomList)[mLastProcessedChangedAxiom++]); } for (CONTOLOGYAXIOMLIST< QPair >::const_iterator it = newChangeUpdatedAxiomList.constBegin(), itEnd = newChangeUpdatedAxiomList.constEnd(); it != itEnd; ++it) { QPair axiomAdditionPair(*it); CAxiomExpression* axiomExp = axiomAdditionPair.first; bool axiomAdded = axiomAdditionPair.second; if (axiomAdded) { if (mTellAxiomSet->contains(axiomExp)) { newTellUpdatedAxiomSet.insert(axiomExp); } } else { if (!mTellAxiomSet->contains(axiomExp)) { newRetractUpdatedAxiomSet.insert(axiomExp); } } } } if (mLastProcessedInverseProperty <= 0) { *mLocInverseObjectPropertyHash = *mInverseObjectPropertyHash; mLastProcessedInverseProperty = mInverseObjectPropertyList->count(); } else { while (mLastProcessedInverseProperty < mInverseObjectPropertyList->count()) { const QPair obPropPair((*mInverseObjectPropertyList)[mLastProcessedInverseProperty++]); mLocInverseObjectPropertyHash->insert(obPropPair.first,obPropPair.second); mLocInverseObjectPropertyHash->insert(obPropPair.second,obPropPair.first); } } mInverseObjectPropertyHash = mLocInverseObjectPropertyHash; if (mLastProcessedExpression <= 0) { *mLocExpressionBuildHash = *mExpressionBuildHash; mLastProcessedExpression = mExpressionBuildContainerList->count(); } else { while (mLastProcessedExpression < mExpressionBuildContainerList->count()) { CBuildExpression* buildExp((*mExpressionBuildContainerList)[mLastProcessedExpression++]); mLocExpressionBuildHash->insert(CExpressionHasher(buildExp),buildExp); } } mLocExpressionBuildHash = mExpressionBuildHash; mExpressionBuildContainerList = mLocExpressionBuildContainerList; if (mLastProcessedBuildIndividual <= 0) { *mLocBuildIndividualSet = *mBuildIndividualSet; *mLocBuildIndividualList = *mBuildIndividualList; mLastProcessedBuildIndividual = mLocBuildIndividualList->count(); } else { while (mLastProcessedBuildIndividual < mBuildIndividualList->count()) { CIndividualTermExpression* buildExp((*mBuildIndividualList)[mLastProcessedBuildIndividual++]); mLocBuildIndividualList->append(buildExp); mLocBuildIndividualSet->insert(buildExp); } } mBuildIndividualSet = mLocBuildIndividualSet; mBuildIndividualList = mLocBuildIndividualList; if (mLastProcessedBuildConcept <= 0) { *mLocBuildConceptSet = *mBuildConceptSet; *mLocBuildConceptList = *mBuildConceptList; mLastProcessedBuildConcept = mLocBuildConceptList->count(); } else { while (mLastProcessedBuildConcept < mBuildConceptList->count()) { CClassTermExpression* buildExp((*mBuildConceptList)[mLastProcessedBuildConcept++]); mLocBuildConceptList->append(buildExp); mLocBuildConceptSet->insert(buildExp); } } mInitialBuildConceptSet = mBuildConceptSet; mBuildConceptSet = mLocBuildConceptSet; mBuildConceptList = mLocBuildConceptList; if (mLastProcessedBuildObjectRole <= 0) { *mLocBuildObjectRoleSet = *mBuildObjectRoleSet; *mLocBuildObjectRoleList = *mBuildObjectRoleList; mLastProcessedBuildObjectRole = mLocBuildObjectRoleList->count(); } else { while (mLastProcessedBuildObjectRole < mBuildObjectRoleList->count()) { CObjectPropertyTermExpression* buildExp((*mBuildObjectRoleList)[mLastProcessedBuildObjectRole++]); mLocBuildObjectRoleList->append(buildExp); mLocBuildObjectRoleSet->insert(buildExp); } } mBuildObjectRoleSet = mLocBuildObjectRoleSet; mBuildObjectRoleList = mLocBuildObjectRoleList; if (mLastProcessedBuildDataRole <= 0) { *mLocBuildDataRoleSet = *mBuildDataRoleSet; *mLocBuildDataRoleList = *mBuildDataRoleList; mLastProcessedBuildDataRole = mLocBuildDataRoleList->count(); } else { while (mLastProcessedBuildDataRole < mBuildDataRoleList->count()) { CDataPropertyTermExpression* buildExp((*mBuildDataRoleList)[mLastProcessedBuildDataRole++]); mLocBuildDataRoleList->append(buildExp); mLocBuildDataRoleSet->insert(buildExp); } } mBuildDataRoleSet = mLocBuildDataRoleSet; mBuildDataRoleList = mLocBuildDataRoleList; if (mLastProcessedBuildDataRange <= 0) { *mLocBuildDataRangeSet = *mBuildDataRangeSet; *mLocBuildDataRangeList = *mBuildDataRangeList; mLastProcessedBuildDataRange = mLocBuildDataRangeList->count(); } else { while (mLastProcessedBuildDataRange < mBuildDataRangeList->count()) { CDataRangeTermExpression* buildExp((*mBuildDataRangeList)[mLastProcessedBuildDataRange++]); mLocBuildDataRangeList->append(buildExp); mLocBuildDataRangeSet->insert(buildExp); } } mBuildDataRangeSet = mLocBuildDataRangeSet; mBuildDataRangeList = mLocBuildDataRangeList; if (mLastProcessedBuildDatatype <= 0) { *mLocBuildDatatypeSet = *mBuildDatatypeSet; *mLocBuildDatatypeList = *mBuildDatatypeList; mLastProcessedBuildDatatype = mLocBuildDatatypeList->count(); } else { while (mLastProcessedBuildDatatype < mBuildDatatypeList->count()) { CDatatypeExpression* buildExp((*mBuildDatatypeList)[mLastProcessedBuildDatatype++]); mLocBuildDatatypeList->append(buildExp); mLocBuildDatatypeSet->insert(buildExp); } } mBuildDatatypeSet = mLocBuildDatatypeSet; mBuildDatatypeList = mLocBuildDatatypeList; //mUpdateClassAxiomHash->reserve(mTellAxiomSet->size()); //mUpdateObjectPropertyAxiomHash->reserve(mTellAxiomSet->size()); //mUpdateDataPropertyAxiomHash->reserve(mTellAxiomSet->size()); //mDeclarationAxiomSet->reserve(mTellAxiomSet->size()); //mUpdateAssertionAxiomHash->reserve(mTellAxiomSet->size()); FOREACHIT (CAxiomExpression* axiomExp, newTellUpdatedAxiomSet) { CClassAxiomExpression* classAxiomExp = dynamic_cast(axiomExp); if (classAxiomExp) { mUpdateClassAxiomHash->insert(classAxiomExp,true); } CObjectPropertyAxiomExpression* objPropAxiomExp = dynamic_cast(axiomExp); if (objPropAxiomExp) { mUpdateObjectPropertyAxiomHash->insert(objPropAxiomExp,true); } CDataPropertyAxiomExpression* dataPropAxiomExp = dynamic_cast(axiomExp); if (dataPropAxiomExp) { mUpdateDataPropertyAxiomHash->insert(dataPropAxiomExp,true); } CDeclarationAxiomExpression* declAxiomExp = dynamic_cast(axiomExp); if (declAxiomExp) { mDeclarationAxiomSet->insert(declAxiomExp); } CAssertionAxiomExpression* assAxiomExp = dynamic_cast(axiomExp); if (assAxiomExp) { mUpdateAssertionAxiomHash->insert(assAxiomExp,true); } } FOREACHIT (CAxiomExpression* axiomExp, newRetractUpdatedAxiomSet) { CClassAxiomExpression* classAxiomExp = dynamic_cast(axiomExp); if (classAxiomExp) { mUpdateClassAxiomHash->insert(classAxiomExp,false); } CObjectPropertyAxiomExpression* objPropAxiomExp = dynamic_cast(axiomExp); if (objPropAxiomExp) { mUpdateObjectPropertyAxiomHash->insert(objPropAxiomExp,false); } CDataPropertyAxiomExpression* dataPropAxiomExp = dynamic_cast(axiomExp); if (dataPropAxiomExp) { mUpdateDataPropertyAxiomHash->insert(dataPropAxiomExp,false); } CDeclarationAxiomExpression* declAxiomExp = dynamic_cast(axiomExp); if (declAxiomExp) { mDeclarationAxiomSet->remove(declAxiomExp); } CAssertionAxiomExpression* assAxiomExp = dynamic_cast(axiomExp); if (assAxiomExp) { mUpdateAssertionAxiomHash->insert(assAxiomExp,false); } } //mIndiTermAssertionAxiomSet->reserve(mUpdateAssertionAxiomHash->size()); //mNewBuildIndividualSet.reserve(mUpdateAssertionAxiomHash->size()); //mIndiTermAssertionAxiomHash->reserve(mUpdateAssertionAxiomHash->size()); FOREACHHASHIT (CAssertionAxiomExpression* assAxiomExp, bool tellAxiom, *mUpdateAssertionAxiomHash) { CBuildExpression::ExpressionType expType = assAxiomExp->getType(); if (expType == CBuildExpression::BETCLASSASSERTION) { CClassAssertionExpression* classAssExp = (CClassAssertionExpression*)assAxiomExp; CIndividualTermExpression* indiTermExp = classAssExp->getIndividualTermExpression(); mNewBuildIndividualSet.insert(indiTermExp); if (!mIndiTermAssertionAxiomSet->contains(QPair(indiTermExp,assAxiomExp))) { mIndiTermAssertionAxiomSet->insert(QPair(indiTermExp,assAxiomExp)); if (tellAxiom) { mIndiTermAssertionAxiomHash->insertMulti(indiTermExp,assAxiomExp); } } } else if (expType == CBuildExpression::BETOBJECTPROPERTYASSERTION) { CObjectPropertyAssertionExpression* propAssExp = (CObjectPropertyAssertionExpression*)assAxiomExp; CIndividualTermExpression* indiTermExp = propAssExp->getFirstIndividualTermExpression(); mNewBuildIndividualSet.insert(indiTermExp); if (!mIndiTermAssertionAxiomSet->contains(QPair(indiTermExp,assAxiomExp))) { mIndiTermAssertionAxiomSet->insert(QPair(indiTermExp,assAxiomExp)); if (tellAxiom) { mIndiTermAssertionAxiomHash->insertMulti(indiTermExp,assAxiomExp); } } } else if (expType == CBuildExpression::BETNEGATIVEOBJECTPROPERTYASSERTION) { mConstructFlags->setNonELConstructUsed(); CNegativeObjectPropertyAssertionExpression* propAssExp = (CNegativeObjectPropertyAssertionExpression*)assAxiomExp; CIndividualTermExpression* indiTermExp = propAssExp->getFirstIndividualTermExpression(); mNewBuildIndividualSet.insert(indiTermExp); if (!mIndiTermAssertionAxiomSet->contains(QPair(indiTermExp,assAxiomExp))) { mIndiTermAssertionAxiomSet->insert(QPair(indiTermExp,assAxiomExp)); if (tellAxiom) { mIndiTermAssertionAxiomHash->insertMulti(indiTermExp,assAxiomExp); } } } else if (expType == CBuildExpression::BETDATAPROPERTYASSERTION) { CDataPropertyAssertionExpression* propAssExp = (CDataPropertyAssertionExpression*)assAxiomExp; CIndividualTermExpression* indiTermExp = propAssExp->getIndividualTermExpression(); mNewBuildIndividualSet.insert(indiTermExp); if (!mIndiTermAssertionAxiomSet->contains(QPair(indiTermExp,assAxiomExp))) { mIndiTermAssertionAxiomSet->insert(QPair(indiTermExp,assAxiomExp)); if (tellAxiom) { mIndiTermAssertionAxiomHash->insertMulti(indiTermExp,assAxiomExp); } } } else if (expType == CBuildExpression::BETNEGATIVEDATAPROPERTYASSERTION) { mConstructFlags->setNonELConstructUsed(); CNegativeDataPropertyAssertionExpression* propAssExp = (CNegativeDataPropertyAssertionExpression*)assAxiomExp; CIndividualTermExpression* indiTermExp = propAssExp->getIndividualTermExpression(); mNewBuildIndividualSet.insert(indiTermExp); if (!mIndiTermAssertionAxiomSet->contains(QPair(indiTermExp,assAxiomExp))) { mIndiTermAssertionAxiomSet->insert(QPair(indiTermExp,assAxiomExp)); if (tellAxiom) { mIndiTermAssertionAxiomHash->insertMulti(indiTermExp,assAxiomExp); } } } else if (expType == CBuildExpression::BETSAMEINDIVIDUAL) { mConstructFlags->setNonELConstructUsed(); CSameIndividualExpression* sameIndiAssExp = (CSameIndividualExpression*)assAxiomExp; FOREACHIT (CIndividualTermExpression* indiTermExp, *sameIndiAssExp->getIndividualTermExpressionList()) { mNewBuildIndividualSet.insert(indiTermExp); if (!mIndiTermAssertionAxiomSet->contains(QPair(indiTermExp,assAxiomExp))) { mIndiTermAssertionAxiomSet->insert(QPair(indiTermExp,assAxiomExp)); if (tellAxiom) { mIndiTermAssertionAxiomHash->insertMulti(indiTermExp,assAxiomExp); } } } } else if (expType == CBuildExpression::BETDIFFERENTINDIVIDUAL) { mConstructFlags->setNonELConstructUsed(); CDifferentIndividualsExpression* diffIndiAssExp = (CDifferentIndividualsExpression*)assAxiomExp; FOREACHIT (CIndividualTermExpression* indiTermExp, *diffIndiAssExp->getIndividualTermExpressionList()) { mNewBuildIndividualSet.insert(indiTermExp); if (!mIndiTermAssertionAxiomSet->contains(QPair(indiTermExp,assAxiomExp))) { mIndiTermAssertionAxiomSet->insert(QPair(indiTermExp,assAxiomExp)); if (tellAxiom) { mIndiTermAssertionAxiomHash->insertMulti(indiTermExp,assAxiomExp); } } } } } FOREACHHASHIT (CClassAxiomExpression* classAxiomExp, bool tellAxiom, *mUpdateClassAxiomHash) { CBuildExpression::ExpressionType expType = classAxiomExp->getType(); if (expType == CBuildExpression::BETEQUIVALENTCLASSES) { // all associated classes has to be updated CEquivalentClassesExpression* eqClassExp = (CEquivalentClassesExpression*)classAxiomExp; FOREACHIT (CClassTermExpression* classTermExp, *eqClassExp->getClassTermExpressionList()) { mNewBuildConceptSet.insert(classTermExp); if (!mClassTermClassAxiomSet->contains(QPair(classTermExp,classAxiomExp))) { mClassTermClassAxiomSet->insert(QPair(classTermExp,classAxiomExp)); if (tellAxiom) { mClassTermClassAxiomHash->insertMulti(classTermExp,classAxiomExp); } } } } else if (expType == CBuildExpression::BETESUBCLASSOF) { // only sub class expression has to be rebuild CSubClassOfExpression* subClassOfExp = (CSubClassOfExpression*)classAxiomExp; CClassTermExpression* classTermExp = subClassOfExp->getFirstClassTermExpression(); mNewBuildConceptSet.insert(classTermExp); if (!mClassTermClassAxiomSet->contains(QPair(classTermExp,classAxiomExp))) { mClassTermClassAxiomSet->insert(QPair(classTermExp,classAxiomExp)); if (tellAxiom) { mClassTermClassAxiomHash->insertMulti(classTermExp,classAxiomExp); } } } else if (expType == CBuildExpression::BETDISJOINTCLASSES) { // all associated classes has to be updated CDisjointClassesExpression* disClassExp = (CDisjointClassesExpression*)classAxiomExp; FOREACHIT (CClassTermExpression* classTermExp, *disClassExp->getClassTermExpressionList()) { if (classTermExp->getType() != CBuildExpression::BETCLASS) { mConstructFlags->setNonELConstructUsed(); } mNewBuildConceptSet.insert(classTermExp); if (!mClassTermClassAxiomSet->contains(QPair(classTermExp,classAxiomExp))) { mClassTermClassAxiomSet->insert(QPair(classTermExp,classAxiomExp)); if (tellAxiom) { mClassTermClassAxiomHash->insertMulti(classTermExp,classAxiomExp); } } } } else if (expType == CBuildExpression::BETDISJOINTUNION) { mConstructFlags->setNonELConstructUsed(); // all associated classes has to be updated CDisjointUnionExpression* disClassExp = (CDisjointUnionExpression*)classAxiomExp; FOREACHIT (CClassTermExpression* classTermExp, *disClassExp->getClassTermExpressionList()) { mNewBuildConceptSet.insert(classTermExp); if (!mClassTermClassAxiomSet->contains(QPair(classTermExp,classAxiomExp))) { mClassTermClassAxiomSet->insert(QPair(classTermExp,classAxiomExp)); if (tellAxiom) { mClassTermClassAxiomHash->insertMulti(classTermExp,classAxiomExp); } } } CClassTermExpression* classTermExp = disClassExp->getClassExpression(); mNewBuildConceptSet.insert(classTermExp); if (!mClassTermClassAxiomSet->contains(QPair(classTermExp,classAxiomExp))) { mClassTermClassAxiomSet->insert(QPair(classTermExp,classAxiomExp)); if (tellAxiom) { mClassTermClassAxiomHash->insertMulti(classTermExp,classAxiomExp); } } } } FOREACHHASHIT (CObjectPropertyAxiomExpression* objPropAxiomExp, bool tellAxiom, *mUpdateObjectPropertyAxiomHash) { CBuildExpression::ExpressionType expType = objPropAxiomExp->getType(); if (expType == CBuildExpression::BETEQUIVALENTOBJECTPROPERTIES) { // all associated properties has to be updated CEquivalentObjectPropertiesExpression* eqObjPropExp = (CEquivalentObjectPropertiesExpression*)objPropAxiomExp; FOREACHIT (CObjectPropertyTermExpression* objPropTermExp, *eqObjPropExp->getObjectPropertyTermExpressionList()) { mNewBuildObjectRoleSet.insert(objPropTermExp); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp,objPropAxiomExp); } } } } else if (expType == CBuildExpression::BETDISJOINTOBJECTPROPERTIES) { mConstructFlags->setNonELConstructUsed(); // all associated properties has to be updated CDisjointObjectPropertiesExpression* eqObjPropExp = (CDisjointObjectPropertiesExpression*)objPropAxiomExp; FOREACHIT (CObjectPropertyTermExpression* objPropTermExp, *eqObjPropExp->getObjectPropertyTermExpressionList()) { mNewBuildObjectRoleSet.insert(objPropTermExp); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp,objPropAxiomExp); } } } } else if (expType == CBuildExpression::BETSUBOBJECTPROPERTYOF) { CSubObjectPropertyOfExpression* subObjPropExp = (CSubObjectPropertyOfExpression*)objPropAxiomExp; FOREACHIT (CObjectPropertyTermExpression* objPropTermExp, *subObjPropExp->getSubObjectPropertyTermExpressionList()) { mNewBuildObjectRoleSet.insert(objPropTermExp); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp,objPropAxiomExp); } } } if (subObjPropExp->getSubObjectPropertyTermExpressionList()->count() >= 2) { mConstructFlags->setComplexRoleUsed(); CObjectPropertyTermExpression* objPropTermExp = subObjPropExp->getSuperObjectPropertyTermExpression(); mNewBuildObjectRoleSet.insert(objPropTermExp); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp,objPropAxiomExp); } } } } else if (expType == CBuildExpression::BETINVERSEOBJECTPROPERTIES) { mConstructFlags->setNonELConstructUsed(); // all associated properties has to be updated CInverseObjectPropertiesExpression* invObjPropExp = (CInverseObjectPropertiesExpression*)objPropAxiomExp; CObjectPropertyTermExpression* objPropTermExp1 = invObjPropExp->getFirstObjectPropertyTermExpression(); CObjectPropertyTermExpression* objPropTermExp2 = invObjPropExp->getSecondObjectPropertyTermExpression(); mNewBuildObjectRoleSet.insert(objPropTermExp1); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp1,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp1,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp1,objPropAxiomExp); } } mNewBuildObjectRoleSet.insert(objPropTermExp2); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp2,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp2,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp2,objPropAxiomExp); } } } else if (expType == CBuildExpression::BETFUNCTIONALOBJECTPROPERTY) { mConstructFlags->setNonELConstructUsed(); CFunctionalObjectPropertyExpression* funcObjPropExp = (CFunctionalObjectPropertyExpression*)objPropAxiomExp; CObjectPropertyTermExpression* objPropTermExp = funcObjPropExp->getFunctionalObjectPropertyExpression(); mNewBuildObjectRoleSet.insert(objPropTermExp); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp,objPropAxiomExp); } } } else if (expType == CBuildExpression::BETINVERSEFUNCTIONALPROPERTY) { mConstructFlags->setNonELConstructUsed(); CInverseFunctionalObjectPropertyExpression* funcObjPropExp = (CInverseFunctionalObjectPropertyExpression*)objPropAxiomExp; CObjectPropertyTermExpression* objPropTermExp = funcObjPropExp->getInverseFunctionalObjectPropertyExpression(); mNewBuildObjectRoleSet.insert(objPropTermExp); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp,objPropAxiomExp); } } } else if (expType == CBuildExpression::BETSYMMETRICPROPERTY) { mConstructFlags->setNonELConstructUsed(); CSymmetricObjectPropertyExpression* objPropExpAxiom = (CSymmetricObjectPropertyExpression*)objPropAxiomExp; CObjectPropertyTermExpression* objPropTermExp = objPropExpAxiom->getObjectPropertyTermExpression(); mNewBuildObjectRoleSet.insert(objPropTermExp); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp,objPropAxiomExp); } } } else if (expType == CBuildExpression::BETASYMMETRICPROPERTY) { mConstructFlags->setNonELConstructUsed(); CAsymmetricObjectPropertyExpression* objPropExpAxiom = (CAsymmetricObjectPropertyExpression*)objPropAxiomExp; CObjectPropertyTermExpression* objPropTermExp = objPropExpAxiom->getObjectPropertyTermExpression(); mNewBuildObjectRoleSet.insert(objPropTermExp); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp,objPropAxiomExp); } } } else if (expType == CBuildExpression::BETREFLEXIVEPROPERTY) { CReflexiveObjectPropertyExpression* objPropExpAxiom = (CReflexiveObjectPropertyExpression*)objPropAxiomExp; CObjectPropertyTermExpression* objPropTermExp = objPropExpAxiom->getObjectPropertyTermExpression(); mNewBuildObjectRoleSet.insert(objPropTermExp); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp,objPropAxiomExp); } } } else if (expType == CBuildExpression::BETIRREFLEXIVEPROPERTY) { mConstructFlags->setNonELConstructUsed(); CIrreflexiveObjectPropertyExpression* objPropExpAxiom = (CIrreflexiveObjectPropertyExpression*)objPropAxiomExp; CObjectPropertyTermExpression* objPropTermExp = objPropExpAxiom->getObjectPropertyTermExpression(); mNewBuildObjectRoleSet.insert(objPropTermExp); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp,objPropAxiomExp); } } } else if (expType == CBuildExpression::BETTRANSITIVEOBJECTPROPERTY) { mConstructFlags->setComplexRoleUsed(); CTransetiveObjectPropertyExpression* objPropExpAxiom = (CTransetiveObjectPropertyExpression*)objPropAxiomExp; CObjectPropertyTermExpression* objPropTermExp = objPropExpAxiom->getTransetivePropertyExpression(); mNewBuildObjectRoleSet.insert(objPropTermExp); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp,objPropAxiomExp); } } } else if (expType == CBuildExpression::BETOBJECTPROPERTYDOMAIN) { CObjectPropertyDomainExpression* objPropExpAxiom = (CObjectPropertyDomainExpression*)objPropAxiomExp; CObjectPropertyTermExpression* objPropTermExp = objPropExpAxiom->getObjectPropertyTermExpression(); mNewBuildObjectRoleSet.insert(objPropTermExp); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp,objPropAxiomExp); } } } else if (expType == CBuildExpression::BETOBJECTPROPERTYRANGE) { CObjectPropertyRangeExpression* objPropExpAxiom = (CObjectPropertyRangeExpression*)objPropAxiomExp; CObjectPropertyTermExpression* objPropTermExp = objPropExpAxiom->getObjectPropertyTermExpression(); mNewBuildObjectRoleSet.insert(objPropTermExp); if (!mObjPropTermObjPropAxiomSet->contains(QPair(objPropTermExp,objPropAxiomExp))) { mObjPropTermObjPropAxiomSet->insert(QPair(objPropTermExp,objPropAxiomExp)); if (tellAxiom) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp,objPropAxiomExp); } } } } FOREACHHASHIT (CDataPropertyAxiomExpression* dataPropAxiomExp, bool tellAxiom, *mUpdateDataPropertyAxiomHash) { CBuildExpression::ExpressionType expType = dataPropAxiomExp->getType(); if (expType == CBuildExpression::BETEQUIVALENTDATAPROPERTIES) { // all associated properties has to be updated CEquivalentDataPropertiesExpression* eqDataPropExp = (CEquivalentDataPropertiesExpression*)dataPropAxiomExp; FOREACHIT (CDataPropertyTermExpression* dataPropTermExp, *eqDataPropExp->getDataPropertyTermExpressionList()) { mNewBuildDataRoleSet.insert(dataPropTermExp); if (!mDataPropTermDataPropAxiomSet->contains(QPair(dataPropTermExp,dataPropAxiomExp))) { mDataPropTermDataPropAxiomSet->insert(QPair(dataPropTermExp,dataPropAxiomExp)); if (tellAxiom) { mDataPropTermDataPropAxiomHash->insertMulti(dataPropTermExp,dataPropAxiomExp); } } } } else if (expType == CBuildExpression::BETDISJOINTDATAPROPERTIES) { mConstructFlags->setNonELConstructUsed(); // all associated properties has to be updated CDisjointDataPropertiesExpression* eqDisjPropExp = (CDisjointDataPropertiesExpression*)dataPropAxiomExp; FOREACHIT (CDataPropertyTermExpression* dataPropTermExp, *eqDisjPropExp->getDataPropertyTermExpressionList()) { mNewBuildDataRoleSet.insert(dataPropTermExp); if (!mDataPropTermDataPropAxiomSet->contains(QPair(dataPropTermExp,dataPropAxiomExp))) { mDataPropTermDataPropAxiomSet->insert(QPair(dataPropTermExp,dataPropAxiomExp)); if (tellAxiom) { mDataPropTermDataPropAxiomHash->insertMulti(dataPropTermExp,dataPropAxiomExp); } } } } else if (expType == CBuildExpression::BETSUBDATAPROPERTYOF) { CSubDataPropertyOfExpression* subDataPropExp = (CSubDataPropertyOfExpression*)dataPropAxiomExp; CDataPropertyTermExpression* dataPropTermExp = subDataPropExp->getSubDataPropertyTermExpression(); mNewBuildDataRoleSet.insert(dataPropTermExp); if (!mDataPropTermDataPropAxiomSet->contains(QPair(dataPropTermExp,dataPropAxiomExp))) { mDataPropTermDataPropAxiomSet->insert(QPair(dataPropTermExp,dataPropAxiomExp)); if (tellAxiom) { mDataPropTermDataPropAxiomHash->insertMulti(dataPropTermExp,dataPropAxiomExp); } } } else if (expType == CBuildExpression::BETFUNCTIONALDATAPROPERTY) { mConstructFlags->setNonELConstructUsed(); CFunctionalDataPropertyExpression* funcDataPropExp = (CFunctionalDataPropertyExpression*)dataPropAxiomExp; CDataPropertyTermExpression* dataPropTermExp = funcDataPropExp->getFunctionalDataPropertyExpression(); mNewBuildDataRoleSet.insert(dataPropTermExp); if (!mDataPropTermDataPropAxiomSet->contains(QPair(dataPropTermExp,dataPropAxiomExp))) { mDataPropTermDataPropAxiomSet->insert(QPair(dataPropTermExp,dataPropAxiomExp)); if (tellAxiom) { mDataPropTermDataPropAxiomHash->insertMulti(dataPropTermExp,dataPropAxiomExp); } } } else if (expType == CBuildExpression::BETDATAPROPERTYDOMAIN) { CDataPropertyDomainExpression* dataPropExpAxiom = (CDataPropertyDomainExpression*)dataPropAxiomExp; CDataPropertyTermExpression* dataPropTermExp = dataPropExpAxiom->getDataPropertyTermExpression(); mNewBuildDataRoleSet.insert(dataPropTermExp); if (!mDataPropTermDataPropAxiomSet->contains(QPair(dataPropTermExp,dataPropAxiomExp))) { mDataPropTermDataPropAxiomSet->insert(QPair(dataPropTermExp,dataPropAxiomExp)); if (tellAxiom) { mDataPropTermDataPropAxiomHash->insertMulti(dataPropTermExp,dataPropAxiomExp); } } } else if (expType == CBuildExpression::BETDATAPROPERTYRANGE) { CDataPropertyRangeExpression* dataPropExpAxiom = (CDataPropertyRangeExpression*)dataPropAxiomExp; CDataPropertyTermExpression* dataPropTermExp = dataPropExpAxiom->getDataPropertyTermExpression(); mNewBuildDataRoleSet.insert(dataPropTermExp); if (!mDataPropTermDataPropAxiomSet->contains(QPair(dataPropTermExp,dataPropAxiomExp))) { mDataPropTermDataPropAxiomSet->insert(QPair(dataPropTermExp,dataPropAxiomExp)); if (tellAxiom) { mDataPropTermDataPropAxiomHash->insertMulti(dataPropTermExp,dataPropAxiomExp); } } } } while (mLastBuildedConcept < mBuildConceptList->size() || mLastBuildedObjectRole < mBuildObjectRoleList->size() || mLastBuildedDataRole < mBuildDataRoleList->size() || mLastBuildedIndividual < mBuildIndividualList->size() || mLastBuildedDatatype < mBuildDatatypeList->size() || mLastBuildedDataRange < mBuildDataRangeList->size() || !mNewBuildConceptSet.isEmpty() || !mNewBuildObjectRoleSet.isEmpty() || !mNewBuildDataRoleSet.isEmpty() || !mNewBuildIndividualSet.isEmpty() || !mNewBuildDataRangeSet.isEmpty() || !mNewBuildDatatypeSet.isEmpty()) { while (mLastBuildedConcept < mBuildConceptList->size()) { mNewBuildConceptSet.insert((*mBuildConceptList)[mLastBuildedConcept++]); } while (mLastBuildedObjectRole < mBuildObjectRoleList->size()) { mNewBuildObjectRoleSet.insert((*mBuildObjectRoleList)[mLastBuildedObjectRole++]); } while (mLastBuildedDataRole < mBuildDataRoleList->size()) { mNewBuildDataRoleSet.insert((*mBuildDataRoleList)[mLastBuildedDataRole++]); } while (mLastBuildedIndividual < mBuildIndividualList->size()) { mNewBuildIndividualSet.insert((*mBuildIndividualList)[mLastBuildedIndividual++]); } while (mLastBuildedDatatype < mBuildDatatypeList->size()) { mNewBuildDatatypeSet.insert((*mBuildDatatypeList)[mLastBuildedDatatype++]); } while (mLastBuildedDataRange < mBuildDataRangeList->size()) { mNewBuildDataRangeSet.insert((*mBuildDataRangeList)[mLastBuildedDataRange++]); } // construct concepts, roles, individuals // build all class expressions while (!mNewBuildObjectRoleSet.isEmpty()) { mBuildingObjectRoleSet = mNewBuildObjectRoleSet; mNewBuildObjectRoleSet.clear(); FOREACHIT (CObjectPropertyTermExpression* objTermExp, mBuildingObjectRoleSet) { if (!mNewBuildedObjectRoleSet.contains(objTermExp)) { mNewBuildedObjectRoleSet.insert(objTermExp); // build role for object property axioms buildObjectPropertyRole(objTermExp); } } } while (!mNewBuildDataRoleSet.isEmpty()) { mBuildingDataRoleSet = mNewBuildDataRoleSet; mNewBuildDataRoleSet.clear(); FOREACHIT (CDataPropertyTermExpression* dataTermExp, mBuildingDataRoleSet) { if (!mNewBuildedDataRoleSet.contains(dataTermExp)) { mNewBuildedDataRoleSet.insert(dataTermExp); // build role for data property axioms buildDataPropertyRole(dataTermExp); } } } while (!mNewBuildIndividualSet.isEmpty()) { mBuildingIndividualSet = mNewBuildIndividualSet; mNewBuildIndividualSet.clear(); FOREACHIT (CIndividualTermExpression* indiTermExp, mBuildingIndividualSet) { if (!mNewBuildedIndividualSet.contains(indiTermExp)) { mNewBuildedIndividualSet.insert(indiTermExp); buildIndividualIndi(indiTermExp); } } } while (!mNewBuildDatatypeSet.isEmpty()) { mBuildingDatatypeSet = mNewBuildDatatypeSet; mNewBuildDatatypeSet.clear(); FOREACHIT (CDatatypeExpression* datatypeExp, mBuildingDatatypeSet) { if (!mNewBuildedDatatypeSet.contains(datatypeExp)) { mNewBuildedDatatypeSet.insert(datatypeExp); // build datatype buildDatatype(datatypeExp); } } } while (!mNewBuildDataRangeSet.isEmpty()) { mBuildingDataRangeSet = mNewBuildDataRangeSet; mNewBuildDataRangeSet.clear(); FOREACHIT (CDataRangeTermExpression* dataRangeExp, mBuildingDataRangeSet) { if (!mNewBuildedDataRangeSet.contains(dataRangeExp)) { mNewBuildedDataRangeSet.insert(dataRangeExp); CBuildExpression::ExpressionType expType = dataRangeExp->getType(); CConcept* concept = getConceptForDataRangeTerm(dataRangeExp,true); if (expType == CBuildExpression::BETDATATYPE) { mConstructFlags->setNonELConstructUsed(); CDatatypeExpression* datatypeExp = (CDatatypeExpression*)dataRangeExp; CDatatype* datatype = getDatatypeForDatatypeExpression(datatypeExp); concept->setOperatorCode(CCDATATYPE); concept->setDatatype(datatype); } else if (expType == CBuildExpression::BETDATALITERAL) { mConstructFlags->setNonELConstructUsed(); CDataLiteralExpression* litExp = (CDataLiteralExpression*)dataRangeExp; CDataLiteral* dataLiteral = getDataLiteralForLiteralExpression(litExp); concept->setOperatorCode(CCDATALITERAL); concept->setDataLiteral(dataLiteral); } else if (expType == CBuildExpression::BETDATACOMPLEMENTOF) { CDataComplementOfExpression* dataExp = (CDataComplementOfExpression*)dataRangeExp; mConstructFlags->setNonELConstructUsed(); CDataRangeTermExpression* opDataRangeTermExp = dataExp->getDataRangeTermExpression(); setConceptOperandsFromDataRangeTerms(concept,opDataRangeTermExp); concept->setOperatorCode(CCNOT); } else if (expType == CBuildExpression::BETDATAUNIONOF) { CDataUnionOfExpression* dataExp = (CDataUnionOfExpression*)dataRangeExp; mConstructFlags->setNonELConstructUsed(); CEXPRESSIONLIST* opDataRangeTermExpList = dataExp->getDataRangeTermExpressionList(); setConceptOperandsFromDataRangeTerms(concept,opDataRangeTermExpList); concept->setOperatorCode(CCOR); } else if (expType == CBuildExpression::BETDATAONEOF) { CDataOneOfExpression* dataExp = (CDataOneOfExpression*)dataRangeExp; mConstructFlags->setNonELConstructUsed(); CEXPRESSIONLIST* opDataRangeTermExpList = dataExp->getDataRangeTermExpressionList(); setConceptOperandsFromDataRangeTerms(concept,opDataRangeTermExpList); concept->setOperatorCode(CCOR); } else if (expType == CBuildExpression::BETDATAINTERSECTIONOF) { CDataIntersectionOfExpression* dataExp = (CDataIntersectionOfExpression*)dataRangeExp; CEXPRESSIONLIST* opDataRangeTermExpList = dataExp->getDataRangeTermExpressionList(); setConceptOperandsFromDataRangeTerms(concept,opDataRangeTermExpList); concept->setOperatorCode(CCAND); } else if (expType == CBuildExpression::BETDATATYPERESTRICTION) { mConstructFlags->setNonELConstructUsed(); CDatatypeRestrictionExpression* dataExp = (CDatatypeRestrictionExpression*)dataRangeExp; CEXPRESSIONLIST* facetExpList = dataExp->getDataFacetRestrictionExpressionList(); CDatatypeExpression* datatypeExpression = dataExp->getDatatypeExpression(); if (facetExpList->count() == 1) { CDataFacetRestrictionExpression* facetRestrictionExp = facetExpList->first(); CDataLiteralExpression* litExp = facetRestrictionExp->getDataLiteralExpression(); CDataFacetExpression* facetExp = facetRestrictionExp->getDataFacetExpression(); CDataLiteral* dataLiteral = getDataLiteralForLiteralExpression(litExp); CDatatype* datatype = getDatatypeForDatatypeExpression(datatypeExpression); cint64 facetDataCode = 0; const QString& facetIRI = facetExp->getName(); if (facetIRI == PREFIX_MIN_INCLUSIVE_FACET) { facetDataCode = CDFC_MIN_INCLUSIVE; } else if (facetIRI == PREFIX_MIN_EXCLUSIVE_FACET) { facetDataCode = CDFC_MIN_EXCLUSIVE; } else if (facetIRI == PREFIX_MAX_INCLUSIVE_FACET) { facetDataCode = CDFC_MAX_INCLUSIVE; } else if (facetIRI == PREFIX_MAX_EXCLUSIVE_FACET) { facetDataCode = CDFC_MAX_EXCLUSIVE; } else if (facetIRI == PREFIX_MAX_LENGTH_FACET) { facetDataCode = CDFC_MAX_LENGTH_INCLUSIVE; } else if (facetIRI == PREFIX_MIN_LENGTH_FACET) { facetDataCode = CDFC_MIN_LENGTH_INCLUSIVE; } else if (facetIRI == PREFIX_LENGTH_FACET) { facetDataCode = CDFC_LENGTH; } else if (facetIRI == PREFIX_PATTERN_FACET) { facetDataCode = CDFC_PATTERN; } else if (facetIRI == PREFIX_LANGUAGE_RANGE_FACET) { facetDataCode = CDFC_LANGUAGE_RANGE; } concept->setParameter(facetDataCode); concept->setDatatype(datatype); concept->setDataLiteral(dataLiteral); concept->setOperatorCode(CCDATARESTRICTION); } else { FOREACHIT (CDataFacetRestrictionExpression* facetExp, *facetExpList) { CDatatypeRestrictionExpression* separatedDataExp = getDatatypeRestriction(datatypeExpression,CEXPRESSIONLIST()<setOperatorCode(CCAND); } } } } } // construct concepts, roles, individuals // build all class expressions while (!mNewBuildConceptSet.isEmpty()) { mBuildingConceptSet = mNewBuildConceptSet; mNewBuildConceptSet.clear(); FOREACHIT (CClassTermExpression* classTermExp, mBuildingConceptSet) { if (!mNewBuildedConceptSet.contains(classTermExp)) { mNewBuildedConceptSet.insert(classTermExp); CBuildExpression::ExpressionType expType = classTermExp->getType(); CConcept* concept = getConceptForClassTerm(classTermExp,true); if (expType == CBuildExpression::BETOBJECTALLVALUEFROM) { mConstructFlags->setNonELConstructUsed(); CObjectAllValuesFromExpression* objExp = (CObjectAllValuesFromExpression*)classTermExp; CObjectPropertyTermExpression* opObjPropExp = objExp->getObjectPropertyTermExpression(); setConceptRoleFromObjectPropertyTerm(concept,opObjPropExp); CClassTermExpression* opClassExp = objExp->getClassTermExpression(); setConceptOperandsFromClassTerms(concept,opClassExp); concept->setOperatorCode(CCALL); } else if (expType == CBuildExpression::BETOBJECTSOMEVALUEFROM) { CObjectSomeValuesFromExpression* objExp = (CObjectSomeValuesFromExpression*)classTermExp; CObjectPropertyTermExpression* opObjPropExp = objExp->getObjectPropertyTermExpression(); setConceptRoleFromObjectPropertyTerm(concept,opObjPropExp); CClassTermExpression* opClassExp = objExp->getClassTermExpression(); if (opClassExp == nullptr) { opClassExp = mTopClassExpression; } setConceptOperandsFromClassTerms(concept,opClassExp); concept->setOperatorCode(CCSOME); } else if (expType == CBuildExpression::BETDATASOMEVALUEFROM) { CDataSomeValuesFromExpression* dataSomeValueExp = (CDataSomeValuesFromExpression*)classTermExp; CDataPropertyTermExpression* dataPropPropExp = dataSomeValueExp->getDataPropertyTermExpression(); setConceptRoleFromDataPropertyTerm(concept,dataPropPropExp); CDataRangeTermExpression* dataRangeTermExp = dataSomeValueExp->getDataRangeTermExpression(); if (dataRangeTermExp == nullptr) { dataRangeTermExp = mTopDataRangeExpression; } setConceptOperandsFromDataRangeTerms(concept,dataRangeTermExp); concept->setOperatorCode(CCSOME); } else if (expType == CBuildExpression::BETDATAALLVALUEFROM) { CDataAllValuesFromExpression* dataAllValueExp = (CDataAllValuesFromExpression*)classTermExp; CDataPropertyTermExpression* dataPropPropExp = dataAllValueExp->getDataPropertyTermExpression(); setConceptRoleFromDataPropertyTerm(concept,dataPropPropExp); CDataRangeTermExpression* dataRangeTermExp = dataAllValueExp->getDataRangeTermExpression(); setConceptOperandsFromDataRangeTerms(concept,dataRangeTermExp); concept->setOperatorCode(CCALL); } else if (expType == CBuildExpression::BETDATAMINCARDINALITY) { CDataMinCardinalityExpression* dataExp = (CDataMinCardinalityExpression*)classTermExp; CDataPropertyTermExpression* opDataPropExp = dataExp->getDataPropertyTermExpression(); setConceptRoleFromDataPropertyTerm(concept,opDataPropExp); cint64 cardinality = dataExp->getCardinality(); CDataRangeTermExpression* opDataRangeTermExp = dataExp->getDataRangeTermExpression(); if (cardinality == 1) { if (opDataRangeTermExp == nullptr) { opDataRangeTermExp = mTopDataRangeExpression; } setConceptOperandsFromDataRangeTerms(concept,opDataRangeTermExp); concept->setOperatorCode(CCSOME); } else { if (opDataRangeTermExp != mTopDataRangeExpression) { setConceptOperandsFromDataRangeTerms(concept,opDataRangeTermExp); } mConstructFlags->setNonELConstructUsed(); concept->setParameter(cardinality); concept->setOperatorCode(CCATLEAST); } } else if (expType == CBuildExpression::BETDATAMAXCARDINALITY) { mConstructFlags->setNonELConstructUsed(); CDataMaxCardinalityExpression* dataExp = (CDataMaxCardinalityExpression*)classTermExp; CDataPropertyTermExpression* opDataPropExp = dataExp->getDataPropertyTermExpression(); setConceptRoleFromDataPropertyTerm(concept,opDataPropExp); CDataRangeTermExpression* opDataRangeTermExp = dataExp->getDataRangeTermExpression(); cint64 cardinality = dataExp->getCardinality(); if (cardinality == 0) { if (opDataRangeTermExp == nullptr) { opDataRangeTermExp = mTopDataRangeExpression; } CDataComplementOfExpression* compExp = getDataComplementOf(opDataRangeTermExp); setConceptOperandsFromDataRangeTerms(concept,compExp); concept->setOperatorCode(CCALL); } else { if (opDataRangeTermExp != mTopDataRangeExpression) { setConceptOperandsFromDataRangeTerms(concept,opDataRangeTermExp); } concept->setParameter(cardinality); concept->setOperatorCode(CCATMOST); } } else if (expType == CBuildExpression::BETDATAEXACTCARDINALITY) { mConstructFlags->setNonELConstructUsed(); CDataExactCardinalityExpression* dataExp = (CDataExactCardinalityExpression*)classTermExp; CDataPropertyTermExpression* opDataPropExp = dataExp->getDataPropertyTermExpression(); CDataRangeTermExpression* opDataRangeTermExp = dataExp->getDataRangeTermExpression(); cint64 cardinality = dataExp->getCardinality(); CDataMaxCardinalityExpression* maxCardExp = getDataMaxCardinality(opDataPropExp,opDataRangeTermExp,cardinality); CDataMinCardinalityExpression* minCardExp = getDataMinCardinality(opDataPropExp,opDataRangeTermExp,cardinality); CObjectIntersectionOfExpression* maxMinIntersect = getObjectIntersectionOf(CEXPRESSIONLIST()<setParameter(cardinality); concept->setOperatorCode(CCAND); } else if (expType == CBuildExpression::BETDATAHASVALUE) { mConstructFlags->setNonELConstructUsed(); CDataHasValueExpression* dataExp = (CDataHasValueExpression*)classTermExp; CDataPropertyTermExpression* opDataPropExp = dataExp->getDataPropertyTermExpression(); CDataRangeTermExpression* dataRangeExp = dataExp->getDataRangeTermExpression(); setConceptRoleFromDataPropertyTerm(concept,opDataPropExp); setConceptOperandsFromDataRangeTerms(concept,dataRangeExp); concept->setOperatorCode(CCSOME); } else if (expType == CBuildExpression::BETOBJECTMINCARDINALITY) { CObjectMinCardinalityExpression* objExp = (CObjectMinCardinalityExpression*)classTermExp; CObjectPropertyTermExpression* opObjPropExp = objExp->getObjectPropertyTermExpression(); setConceptRoleFromObjectPropertyTerm(concept,opObjPropExp); cint64 cardinality = objExp->getCardinality(); CClassTermExpression* opClassExp = objExp->getClassTermExpression(); if (cardinality == 1) { if (opClassExp == nullptr) { opClassExp = mTopClassExpression; } setConceptOperandsFromClassTerms(concept,opClassExp); concept->setOperatorCode(CCSOME); } else { if (opClassExp != mTopClassExpression) { setConceptOperandsFromClassTerms(concept,opClassExp); } mConstructFlags->setNonELConstructUsed(); concept->setParameter(cardinality); concept->setOperatorCode(CCATLEAST); } } else if (expType == CBuildExpression::BETOBJECTMAXCARDINALITY) { mConstructFlags->setNonELConstructUsed(); CObjectMaxCardinalityExpression* objExp = (CObjectMaxCardinalityExpression*)classTermExp; CObjectPropertyTermExpression* opObjPropExp = objExp->getObjectPropertyTermExpression(); setConceptRoleFromObjectPropertyTerm(concept,opObjPropExp); CClassTermExpression* opClassExp = objExp->getClassTermExpression(); cint64 cardinality = objExp->getCardinality(); if (cardinality == 0) { if (opClassExp == nullptr) { opClassExp = mTopClassExpression; } CObjectComplementOfExpression* compExp = getObjectComplementOf(opClassExp); setConceptOperandsFromClassTerms(concept,compExp); concept->setOperatorCode(CCALL); } else { if (opClassExp != mTopClassExpression) { setConceptOperandsFromClassTerms(concept,opClassExp); } concept->setParameter(cardinality); concept->setOperatorCode(CCATMOST); } } else if (expType == CBuildExpression::BETOBJECTEXACTLYCARDINALITY) { mConstructFlags->setNonELConstructUsed(); CObjectExactlyCardinalityExpression* objExp = (CObjectExactlyCardinalityExpression*)classTermExp; CObjectPropertyTermExpression* opObjPropExp = objExp->getObjectPropertyTermExpression(); CClassTermExpression* opClassExp = objExp->getClassTermExpression(); cint64 cardinality = objExp->getCardinality(); CObjectMaxCardinalityExpression* maxCardExp = getObjectMaxCardinality(opObjPropExp,opClassExp,cardinality); CObjectMinCardinalityExpression* minCardExp = getObjectMinCardinality(opObjPropExp,opClassExp,cardinality); CObjectIntersectionOfExpression* maxMinIntersect = getObjectIntersectionOf(CEXPRESSIONLIST()<setParameter(cardinality); concept->setOperatorCode(CCAND); } else if (expType == CBuildExpression::BETOBJECTCOMPLEMENTOF) { CObjectComplementOfExpression* objExp = (CObjectComplementOfExpression*)classTermExp; if (!mConstructFlags->isNonELConstructUsed()) { if (!mELExceptionExpressionSet.contains(objExp)) { mConstructFlags->setNonELConstructUsed(); } } CClassTermExpression* opClassExp = objExp->getClassTermExpression(); setConceptOperandsFromClassTerms(concept,opClassExp); concept->setOperatorCode(CCNOT); } else if (expType == CBuildExpression::BETOBJECTUNION) { CObjectUnionOfExpression* objExp = (CObjectUnionOfExpression*)classTermExp; if (!mConstructFlags->isNonELConstructUsed()) { if (!mELExceptionExpressionSet.contains(objExp)) { mConstructFlags->setNonELConstructUsed(); } } CEXPRESSIONLIST* opClassExpList = objExp->getClassTermExpressionList(); setConceptOperandsFromClassTerms(concept,opClassExpList); concept->setOperatorCode(CCOR); } else if (expType == CBuildExpression::BETOBJECTINTERSECTION) { CObjectIntersectionOfExpression* objExp = (CObjectIntersectionOfExpression*)classTermExp; CEXPRESSIONLIST* opClassExpList = objExp->getClassTermExpressionList(); setConceptOperandsFromClassTerms(concept,opClassExpList); concept->setOperatorCode(CCAND); } else if (expType == CBuildExpression::BETOBJECTHASVALUE) { mConstructFlags->setNonELConstructUsed(); CObjectHasValueExpression* objExp = (CObjectHasValueExpression*)classTermExp; CObjectPropertyTermExpression* opObjPropExp = objExp->getObjectPropertyTermExpression(); CIndividualTermExpression* indiExp = objExp->getIndividualTermExpression(); setConceptRoleFromObjectPropertyTerm(concept,opObjPropExp); setConceptIndividualFromIndividualTerm(concept,indiExp); concept->setOperatorCode(CCVALUE); } else if (expType == CBuildExpression::BETOBJECTHASSELF) { mConstructFlags->setNonELConstructUsed(); CObjectHasSelfExpression* objExp = (CObjectHasSelfExpression*)classTermExp; CObjectPropertyTermExpression* opObjPropExp = objExp->getObjectPropertyTermExpression(); setConceptRoleFromObjectPropertyTerm(concept,opObjPropExp); concept->setOperatorCode(CCSELF); } else if (expType == CBuildExpression::BETINDIVIDUALVARIABLE) { mConstructFlags->setNonELConstructUsed(); mConstructFlags->setNominalSchemaUsed(); mNominalConceptCreationRequired = true; CObjectIndividualVariableExpression* objExp = (CObjectIndividualVariableExpression*)classTermExp; cint64 indiVarID = getIndividualVariableID(concept,objExp); concept->setParameter(indiVarID); concept->setOperatorCode(CCNOMVAR); } else if (expType == CBuildExpression::BETOBJECTONEOF) { mConstructFlags->setNonELConstructUsed(); CObjectOneOfExpression* objExp = (CObjectOneOfExpression*)classTermExp; CEXPRESSIONLIST* indiExpList = objExp->getIndividualTermExpressionList(); if (indiExpList->count() == 1) { CIndividualTermExpression* indiTermExp = indiExpList->first(); concept->setOperatorCode(CCNOMINAL); setConceptNominalIndividualFromIndividualTerm(concept,indiTermExp); } else { CEXPRESSIONLIST nominalClassTermList; FOREACHIT (CIndividualTermExpression* indiTermExp, *indiExpList) { nominalClassTermList.append(getObjectOneOf(CEXPRESSIONLIST()<setOperatorCode(CCAND); } } // build class buildClassConcept(classTermExp); } } if (mNominalConceptCreationRequired && !mLateIndiNominalConceptCreationList.isEmpty()) { for (QList::const_iterator it = mLateIndiNominalConceptCreationList.constBegin(), itEnd = mLateIndiNominalConceptCreationList.constEnd(); it != itEnd; ++it) { CIndividualTermExpression* indiTermExp(*it); CIndividual* individual = getIndividualForIndividualTerm(indiTermExp,true); CClassTermExpression* nominalAssClassTermExp = getObjectOneOf(indiTermExp); setIndividualAssertionNominalFromClassTerm(individual,nominalAssClassTermExp,false); } mLateIndiNominalConceptCreationList.clear(); } if (mRebuildTopConcept) { CConcept* topConcept = getConceptForClassTerm(mTopClassExpression,true); mRebuildTopConcept = false; FOREACHIT (CClassTermExpression* gciClassTermExp, mClassGCIExpressionSet) { buildConceptSubClassInclusion(mTopClassExpression,gciClassTermExp); } mClassGCIExpressionSet.clear(); FOREACHIT (CClassTermExpression* rebuildClassTermExp, *mTopRebuildClassTermExpressionsSet) { if (!mNewBuildedConceptSet.contains(rebuildClassTermExp) && !mBuildingConceptSet.contains(rebuildClassTermExp)) { mNewBuildConceptSet.insert(rebuildClassTermExp); } } FOREACHIT (CObjectPropertyTermExpression* rebuildObjectPropertyTermExp, *mTopRebuildObjectPropertyTermExpressionsSet) { if (!mNewBuildedObjectRoleSet.contains(rebuildObjectPropertyTermExp) && !mBuildingObjectRoleSet.contains(rebuildObjectPropertyTermExp)) { mNewBuildObjectRoleSet.insert(rebuildObjectPropertyTermExp); } } } } } buildIndividualIDs(); buildRoleTags(); buildConceptTags(); buildRoleChainTags(); resortAndInstallConceptsAndRolesAndIndividuals(); mOntoData->getExpressionDataBoxMapping()->setLastProcessedChangedAxiom(mLastProcessedChangedAxiom); mOntoData->getExpressionDataBoxMapping()->setLastProcessedBuildIndividual(mLastProcessedBuildIndividual); mOntoData->getExpressionDataBoxMapping()->setLastProcessedBuildConcept(mLastProcessedBuildConcept); mOntoData->getExpressionDataBoxMapping()->setLastProcessedBuildObjectRole(mLastProcessedBuildObjectRole); mOntoData->getExpressionDataBoxMapping()->setLastProcessedBuildDataRole(mLastProcessedBuildDataRole); mOntoData->getExpressionDataBoxMapping()->setLastProcessedBuildDataRange(mLastProcessedBuildDataRange); mOntoData->getExpressionDataBoxMapping()->setLastProcessedBuildDatatype(mLastProcessedBuildDatatype); mOntoData->getExpressionDataBoxMapping()->setLastProcessedInverseProperty(mLastProcessedInverseProperty); mOntoData->getExpressionDataBoxMapping()->setLastProcessedExpression(mLastProcessedExpression); mOntoData->getExpressionDataBoxMapping()->setLastBuildedIndividual(mLastBuildedIndividual); mOntoData->getExpressionDataBoxMapping()->setLastBuildedConcept(mLastBuildedConcept); mOntoData->getExpressionDataBoxMapping()->setLastBuildedObjectRole(mLastBuildedObjectRole); mOntoData->getExpressionDataBoxMapping()->setLastBuildedDataRole(mLastBuildedDataRole); mOntoData->getExpressionDataBoxMapping()->setLastBuildedDataRange(mLastBuildedDataRange); mOntoData->getExpressionDataBoxMapping()->setLastBuildedDatatype(mLastBuildedDatatype); return true; } bool CConcreteOntologyUpdateBuilder::buildClassConcept(CClassTermExpression* classTermExp) { if (classTermExp == mTopClassExpression) { mRebuildTopConcept = true; } else if (mTopRebuildClassTermExpressionsSet->contains(classTermExp)) { if (!mNewBuildedConceptSet.contains(mTopClassExpression) && !mBuildingConceptSet.contains(mTopClassExpression)) { mNewBuildConceptSet.insert(mTopClassExpression); } } if (mClassTermClassAxiomHash->contains(classTermExp)) { CBUILDLIST classAccAxiomList(mClassTermClassAxiomHash->values(classTermExp)); if (!classAccAxiomList.isEmpty()) { mClassTermClassAxiomHash->remove(classTermExp); FOREACHIT (CClassAxiomExpression* classAxiom, classAccAxiomList) { if (!mRetractUpdatedAxiomSet->contains(classAxiom)) { mClassTermClassAxiomHash->insertMulti(classTermExp,classAxiom); CBuildExpression::ExpressionType expType = classAxiom->getType(); if (expType == CBuildExpression::BETESUBCLASSOF) { CSubClassOfExpression* axiomExp = (CSubClassOfExpression*)classAxiom; buildConceptSubClassInclusion(classTermExp,axiomExp->getSecondClassTermExpression()); } else if (expType == CBuildExpression::BETEQUIVALENTCLASSES) { CEquivalentClassesExpression* axiomExp = (CEquivalentClassesExpression*)classAxiom; buildPermutableConceptEquivalentClass(classTermExp,*axiomExp->getClassTermExpressionList()); } else if (expType == CBuildExpression::BETDISJOINTCLASSES) { CDisjointClassesExpression* axiomExp = (CDisjointClassesExpression*)classAxiom; buildPermutableConceptDisjointClass(classTermExp,*axiomExp->getClassTermExpressionList()); } else if (expType == CBuildExpression::BETDISJOINTUNION) { CDisjointUnionExpression* axiomExp = (CDisjointUnionExpression*)classAxiom; CClassTermExpression* unionClassExp = axiomExp->getClassExpression(); if (classTermExp == unionClassExp) { buildDisjointUnionConceptClass(classTermExp,*axiomExp->getClassTermExpressionList()); } else { buildPermutableConceptDisjointClass(classTermExp,*axiomExp->getClassTermExpressionList()); } } } else { mClassTermClassAxiomSet->remove(QPair(classTermExp,classAxiom)); } } } } return true; } bool CConcreteOntologyUpdateBuilder::buildIndividualIndi(CIndividualTermExpression* indiTermExp) { //CClassTermExpression* nominalAssClassTermExp = nullptr; bool nominalAssClass = false; CIndividual* individual = getIndividualForIndividualTerm(indiTermExp,true); if (mIndiTermAssertionAxiomHash->contains(indiTermExp)) { CBUILDLIST indiAssAxiomList(mIndiTermAssertionAxiomHash->values(indiTermExp)); mIndiTermAssertionAxiomHash->remove(indiTermExp); FOREACHIT (CAssertionAxiomExpression* assAxiom, indiAssAxiomList) { CBuildExpression::ExpressionType expType = assAxiom->getType(); if (!mRetractUpdatedAxiomSet->contains(assAxiom)) { mIndiTermAssertionAxiomHash->insertMulti(indiTermExp,assAxiom); if (expType == CBuildExpression::BETCLASSASSERTION) { CClassAssertionExpression* classAssExp = (CClassAssertionExpression*)assAxiom; CClassTermExpression* classTermExp = classAssExp->getClassTermExpression(); setIndividualAssertionConceptFromClassTerm(individual,classTermExp,false); if (classTermExp->getType() == CBuildExpression::BETOBJECTONEOF) { CObjectOneOfExpression* objectOneOfExp = (CObjectOneOfExpression*)classTermExp; CEXPRESSIONLIST* indiTermExpList = objectOneOfExp->getIndividualTermExpressionList(); if (indiTermExpList->count() == 1) { CIndividualTermExpression* indiTerm = indiTermExpList->first(); if (indiTerm == indiTermExp) { nominalAssClass = true; } } } } else if (expType == CBuildExpression::BETOBJECTPROPERTYASSERTION) { CObjectPropertyAssertionExpression* propAssExp = (CObjectPropertyAssertionExpression*)assAxiom; CObjectPropertyTermExpression* objPropTermExp = propAssExp->getObjectPropertyTermExpression(); CIndividualTermExpression* destIndiTermExp = propAssExp->getSecondIndividualTermExpression(); setIndividualAssertionRoleFromObjectPropertyTerm(individual,objPropTermExp,destIndiTermExp); //CClassTermExpression* classTermExp = getObjectHasValue(objPropTermExp,destIndiTermExp); //setIndividualAssertionConceptFromClassTerm(individual,classTermExp,false); } else if (expType == CBuildExpression::BETDATAPROPERTYASSERTION) { CDataPropertyAssertionExpression* dataAssExp = (CDataPropertyAssertionExpression*)assAxiom; CDataPropertyTermExpression* dataPropTermExp = dataAssExp->getDataPropertyTermExpression(); CDataLiteralExpression* dataLiteralExp = dataAssExp->getDataLiteralExpression(); CClassTermExpression* classTermExp = getDataHasValue(dataPropTermExp,dataLiteralExp); setIndividualAssertionConceptFromClassTerm(individual,classTermExp,false); } else if (expType == CBuildExpression::BETNEGATIVEDATAPROPERTYASSERTION) { CNegativeDataPropertyAssertionExpression* dataAssExp = (CNegativeDataPropertyAssertionExpression*)assAxiom; CDataPropertyTermExpression* dataPropTermExp = dataAssExp->getDataPropertyTermExpression(); CDataLiteralExpression* dataLiteralExp = dataAssExp->getDataLiteralExpression(); CClassTermExpression* classTermExp = getDataHasValue(dataPropTermExp,dataLiteralExp); setIndividualAssertionConceptFromClassTerm(individual,classTermExp,true); } else if (expType == CBuildExpression::BETNEGATIVEOBJECTPROPERTYASSERTION) { CNegativeObjectPropertyAssertionExpression* propAssExp = (CNegativeObjectPropertyAssertionExpression*)assAxiom; CObjectPropertyTermExpression* objPropTermExp = propAssExp->getObjectPropertyTermExpression(); CIndividualTermExpression* destIndiTermExp = propAssExp->getSecondIndividualTermExpression(); CClassTermExpression* classTermExp = getObjectHasValue(objPropTermExp,destIndiTermExp); setIndividualAssertionConceptFromClassTerm(individual,classTermExp,true); } else if (expType == CBuildExpression::BETSAMEINDIVIDUAL) { CSameIndividualExpression* sameIndiAssExp = (CSameIndividualExpression*)assAxiom; FOREACHIT (CIndividualTermExpression* indiTermExp2, *sameIndiAssExp->getIndividualTermExpressionList()) { if (indiTermExp != indiTermExp2) { CClassTermExpression* classTermExp = getObjectOneOf(indiTermExp2); setIndividualAssertionConceptFromClassTerm(individual,classTermExp,false); } } } else if (expType == CBuildExpression::BETDIFFERENTINDIVIDUAL) { CDifferentIndividualsExpression* diffIndiAssExp = (CDifferentIndividualsExpression*)assAxiom; FOREACHIT (CIndividualTermExpression* indiTermExp2, *diffIndiAssExp->getIndividualTermExpressionList()) { if (indiTermExp != indiTermExp2) { CClassTermExpression* classTermExp = getObjectOneOf(indiTermExp2); setIndividualAssertionConceptFromClassTerm(individual,classTermExp,true); } } } } } } if (!nominalAssClass) { if (mConstructFlags->isNominalSchemaUsed()) { CClassTermExpression* nominalAssClassTermExp = getObjectOneOf(indiTermExp); setIndividualAssertionNominalFromClassTerm(individual,nominalAssClassTermExp,false); } else { mLateIndiNominalConceptCreationList.append(indiTermExp); } } //if (!nominalAssClass && mConstructFlags->isNominalSchemaUsed()) { // CClassTermExpression* nominalAssClassTermExp = getObjectOneOf(indiTermExp); // setIndividualAssertionNominalFromClassTerm(individual,nominalAssClassTermExp,false); //} if (!individual->isAnonymousIndividual()) { CConceptAssertionLinker* opConLinker = CObjectAllocator< CConceptAssertionLinker >::allocateAndConstruct(mMemManager); opConLinker->initNegLinker(tBox->getIndividualTriggerConcept(),false); individual->addAssertionConceptLinker(opConLinker); } return true; } bool CConcreteOntologyUpdateBuilder::buildDatatype(CDatatypeExpression* datatypeExp) { return true; } bool CConcreteOntologyUpdateBuilder::buildDataPropertyRole(CDataPropertyTermExpression* dataPropTermExp) { CBUILDLIST dataPropAccAxiomList(mDataPropTermDataPropAxiomHash->values(dataPropTermExp)); mDataPropTermDataPropAxiomHash->remove(dataPropTermExp); CRole* role = getRoleForDataPropertyTerm(dataPropTermExp,true); FOREACHIT (CDataPropertyAxiomExpression* dataPropAxiom, dataPropAccAxiomList) { if (!mRetractUpdatedAxiomSet->contains(dataPropAxiom)) { mDataPropTermDataPropAxiomHash->insertMulti(dataPropTermExp,dataPropAxiom); CBuildExpression::ExpressionType expType = dataPropAxiom->getType(); if (expType == CBuildExpression::BETSUBDATAPROPERTYOF) { CSubDataPropertyOfExpression* dataPropAxiomExp = (CSubDataPropertyOfExpression*)dataPropAxiom; CDataPropertyTermExpression* superDataPropertyExpression = dataPropAxiomExp->getSuperDataPropertyTermExpression(); if (superDataPropertyExpression != mTopDataPropExpression) { CRole* superRole = getRoleForDataPropertyTerm(superDataPropertyExpression); if (!role->hasSuperRole(superRole)) { CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); roleLinker->init(superRole,false); role->addSuperRoleLinker(roleLinker); } } } else if (expType == CBuildExpression::BETEQUIVALENTDATAPROPERTIES) { CEquivalentDataPropertiesExpression* dataPropAxiomExp = (CEquivalentDataPropertiesExpression*)dataPropAxiom; CEXPRESSIONLIST* eqDataPropertyExpressionList = dataPropAxiomExp->getDataPropertyTermExpressionList(); FOREACHIT (CDataPropertyTermExpression* eqDataPropTermExp, *eqDataPropertyExpressionList) { if (dataPropTermExp != eqDataPropTermExp) { CRole* eqRole = getRoleForDataPropertyTerm(eqDataPropTermExp); if (!role->hasEquivalentRole(eqRole)) { CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); roleLinker->init(eqRole,false); role->addEquivalentRoleLinker(roleLinker); } } } } else if (expType == CBuildExpression::BETDISJOINTDATAPROPERTIES) { CDisjointDataPropertiesExpression* dataPropAxiomExp = (CDisjointDataPropertiesExpression*)dataPropAxiom; CEXPRESSIONLIST* disDataPropertyExpressionList = dataPropAxiomExp->getDataPropertyTermExpressionList(); FOREACHIT (CDataPropertyTermExpression* disDataPropTermExp, *disDataPropertyExpressionList) { if (dataPropTermExp != disDataPropTermExp) { CRole* disRole = getRoleForDataPropertyTerm(disDataPropTermExp); if (!role->hasDisjointRole(disRole)) { CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); roleLinker->init(disRole,false); role->addDisjointRoleLinker(roleLinker); } } } } else if (expType == CBuildExpression::BETDATAPROPERTYDOMAIN) { CDataPropertyDomainExpression* dataPropAxiomExp = (CDataPropertyDomainExpression*)dataPropAxiom; CClassTermExpression* domainExp = dataPropAxiomExp->getClassTermExpression(); CConcept* domainCon = getConceptForClassTerm(domainExp); CSortedNegLinker* conceptLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); conceptLinker->init(domainCon,false); role->addDomainConceptLinker(conceptLinker); } else if (expType == CBuildExpression::BETDATAPROPERTYRANGE) { CDataPropertyRangeExpression* dataPropAxiomExp = (CDataPropertyRangeExpression*)dataPropAxiom; CDataRangeTermExpression* rangeExp = dataPropAxiomExp->getDataRangeTermExpression(); CConcept* rangeCon = getConceptForDataRangeTerm(rangeExp); CSortedNegLinker* conceptLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); conceptLinker->init(rangeCon,false); role->addRangeConceptLinker(conceptLinker); } else if (expType == CBuildExpression::BETFUNCTIONALDATAPROPERTY) { CFunctionalDataPropertyExpression* dataPropAxiomExp = (CFunctionalDataPropertyExpression*)dataPropAxiom; CDataMaxCardinalityExpression* funcCardExp = getDataMaxCardinality(dataPropTermExp,mTopDataPropExpression,1); CConcept* domainCon = getConceptForClassTerm(funcCardExp); CSortedNegLinker* conceptLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); conceptLinker->init(domainCon,false); role->addDomainConceptLinker(conceptLinker); role->setFunctional(true); } } else { mDataPropTermDataPropAxiomSet->remove(QPair(dataPropTermExp,dataPropAxiom)); } } return true; } bool CConcreteOntologyUpdateBuilder::buildObjectPropertyRole(CObjectPropertyTermExpression* objPropTermExp) { if (mTopRebuildObjectPropertyTermExpressionsSet->contains(objPropTermExp)) { if (!mNewBuildedObjectRoleSet.contains(mTopObjPropExpression) && !mBuildingObjectRoleSet.contains(mTopObjPropExpression)) { mNewBuildObjectRoleSet.insert(mTopObjPropExpression); } } CBUILDLIST objPropAccAxiomList(mObjPropTermObjPropAxiomHash->values(objPropTermExp)); mObjPropTermObjPropAxiomHash->remove(objPropTermExp); CObjectPropertyTermExpression* inverseObjPropTermExp = mInverseObjectPropertyHash->value(objPropTermExp,nullptr); CRole* role = getRoleForObjectPropertyTerm(objPropTermExp,true); if (inverseObjPropTermExp) { CRole* invRole = getRoleForObjectPropertyTerm(inverseObjPropTermExp); if (!role->hasInverseRole(invRole)) { if (!role->getInverseRole()) { role->setInverseRole(invRole); } CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); roleLinker->init(invRole,true); role->addInverseRoleLinker(roleLinker); } if (!invRole->hasInverseRole(role)) { if (!invRole->getInverseRole()) { invRole->setInverseRole(role); } CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); roleLinker->init(role,true); invRole->addInverseRoleLinker(roleLinker); } } FOREACHIT (CObjectPropertyAxiomExpression* objPropAxiom, objPropAccAxiomList) { if (!mRetractUpdatedAxiomSet->contains(objPropAxiom)) { mObjPropTermObjPropAxiomHash->insertMulti(objPropTermExp,objPropAxiom); CBuildExpression::ExpressionType expType = objPropAxiom->getType(); if (expType == CBuildExpression::BETSUBOBJECTPROPERTYOF) { if (objPropTermExp != mBottomObjPropExpression) { CSubObjectPropertyOfExpression* objPropAxiomExp = (CSubObjectPropertyOfExpression*)objPropAxiom; CEXPRESSIONLIST* subObjectPropertyExpressionList = objPropAxiomExp->getSubObjectPropertyTermExpressionList(); // build only once CObjectPropertyTermExpression* superObjectPropertyExpression = objPropAxiomExp->getSuperObjectPropertyTermExpression(); if (subObjectPropertyExpressionList->count() <= 1) { // build simple sub role relation if (superObjectPropertyExpression != mTopObjPropExpression) { CRole* superRole = getRoleForObjectPropertyTerm(superObjectPropertyExpression); if (!role->hasSuperRole(superRole)) { CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); roleLinker->init(superRole,false); role->addSuperRoleLinker(roleLinker); } } } else { // build role chain CRoleChain* roleChain = buildRoleChainForSubObjectPropertyOfExpression(objPropAxiomExp); CXLinker* roleChainLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(mMemManager); roleChainLinker->initLinker(roleChain); if (objPropTermExp == superObjectPropertyExpression) { // role is super role role->addRoleChainSuperSharingLinker(roleChainLinker); } else { role->addRoleChainSubSharingLinker(roleChainLinker); } } } } else if (expType == CBuildExpression::BETEQUIVALENTOBJECTPROPERTIES) { CEquivalentObjectPropertiesExpression* objPropAxiomExp = (CEquivalentObjectPropertiesExpression*)objPropAxiom; CEXPRESSIONLIST* eqObjectPropertyExpressionList = objPropAxiomExp->getObjectPropertyTermExpressionList(); FOREACHIT (CObjectPropertyTermExpression* eqObjPropTermExp, *eqObjectPropertyExpressionList) { if (objPropTermExp != eqObjPropTermExp) { CRole* eqRole = getRoleForObjectPropertyTerm(eqObjPropTermExp); if (!role->hasEquivalentRole(eqRole)) { CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); roleLinker->init(eqRole,false); role->addEquivalentRoleLinker(roleLinker); } } } } else if (expType == CBuildExpression::BETDISJOINTOBJECTPROPERTIES) { CDisjointObjectPropertiesExpression* objPropAxiomExp = (CDisjointObjectPropertiesExpression*)objPropAxiom; CEXPRESSIONLIST* disObjectPropertyExpressionList = objPropAxiomExp->getObjectPropertyTermExpressionList(); FOREACHIT (CObjectPropertyTermExpression* disObjPropTermExp, *disObjectPropertyExpressionList) { if (objPropTermExp != disObjPropTermExp) { CRole* disRole = getRoleForObjectPropertyTerm(disObjPropTermExp); if (!role->hasDisjointRole(disRole)) { CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); roleLinker->init(disRole,false); role->addDisjointRoleLinker(roleLinker); } } } } else if (expType == CBuildExpression::BETINVERSEOBJECTPROPERTIES) { CInverseObjectPropertiesExpression* objPropAxiomExp = (CInverseObjectPropertiesExpression*)objPropAxiom; CObjectPropertyTermExpression* invObjPropTermExp = nullptr; if (objPropTermExp == objPropAxiomExp->getFirstObjectPropertyTermExpression()) { invObjPropTermExp = objPropAxiomExp->getSecondObjectPropertyTermExpression(); } else { invObjPropTermExp = objPropAxiomExp->getFirstObjectPropertyTermExpression(); } CRole* invRole = getRoleForObjectPropertyTerm(invObjPropTermExp); if (!role->hasInverseRole(invRole)) { CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); roleLinker->init(invRole,true); role->addInverseRoleLinker(roleLinker); } } else if (expType == CBuildExpression::BETOBJECTPROPERTYDOMAIN) { CObjectPropertyDomainExpression* objPropAxiomExp = (CObjectPropertyDomainExpression*)objPropAxiom; CClassTermExpression* domainExp = objPropAxiomExp->getClassTermExpression(); CConcept* domainCon = getConceptForClassTerm(domainExp); CSortedNegLinker* conceptLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); conceptLinker->init(domainCon,false); role->addDomainConceptLinker(conceptLinker); } else if (expType == CBuildExpression::BETOBJECTPROPERTYRANGE) { CObjectPropertyRangeExpression* objPropAxiomExp = (CObjectPropertyRangeExpression*)objPropAxiom; CClassTermExpression* rangeExp = objPropAxiomExp->getClassTermExpression(); CConcept* rangeCon = getConceptForClassTerm(rangeExp); CSortedNegLinker* conceptLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); conceptLinker->init(rangeCon,false); role->addRangeConceptLinker(conceptLinker); } else if (expType == CBuildExpression::BETFUNCTIONALOBJECTPROPERTY) { CFunctionalObjectPropertyExpression* objPropAxiomExp = (CFunctionalObjectPropertyExpression*)objPropAxiom; CObjectMaxCardinalityExpression* funcCardExp = getObjectMaxCardinality(objPropTermExp,mTopClassExpression,1); CConcept* domainCon = getConceptForClassTerm(funcCardExp); CSortedNegLinker* conceptLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); conceptLinker->init(domainCon,false); role->addDomainConceptLinker(conceptLinker); role->setFunctional(true); } else if (expType == CBuildExpression::BETINVERSEFUNCTIONALPROPERTY) { CInverseFunctionalObjectPropertyExpression* objPropAxiomExp = (CInverseFunctionalObjectPropertyExpression*)objPropAxiom; CObjectMaxCardinalityExpression* funcCardExp = getObjectMaxCardinality(getCorrectedInverseObjectPropertyOf(objPropTermExp),mTopClassExpression,1); CConcept* rangeCon = getConceptForClassTerm(funcCardExp); CSortedNegLinker* conceptLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); conceptLinker->init(rangeCon,false); role->addRangeConceptLinker(conceptLinker); role->setInverseFunctional(true); } else if (expType == CBuildExpression::BETREFLEXIVEPROPERTY) { CReflexiveObjectPropertyExpression* objPropAxiomExp = (CReflexiveObjectPropertyExpression*)objPropAxiom; CObjectHasSelfExpression* gciSelfExp = getObjectHasSelf(objPropTermExp); buildGeneralConceptInclusionClassExpression(gciSelfExp); role->setReflexive(true); } else if (expType == CBuildExpression::BETIRREFLEXIVEPROPERTY) { CIrreflexiveObjectPropertyExpression* objPropAxiomExp = (CIrreflexiveObjectPropertyExpression*)objPropAxiom; CObjectHasSelfExpression* selfExp = getObjectHasSelf(objPropTermExp); CObjectComplementOfExpression* gciNotSelfExp = getObjectComplementOf(selfExp); buildGeneralConceptInclusionClassExpression(gciNotSelfExp); role->setIrreflexive(true); } else if (expType == CBuildExpression::BETSYMMETRICPROPERTY) { // has it self as inverse CSymmetricObjectPropertyExpression* objPropAxiomExp = (CSymmetricObjectPropertyExpression*)objPropAxiom; CRole* invRole = role; if (!role->hasInverseRole(invRole)) { CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); roleLinker->init(invRole,true); role->addInverseRoleLinker(roleLinker); role->setInverseRole(role); } role->setSymmetric(true); } else if (expType == CBuildExpression::BETASYMMETRICPROPERTY) { // disjoint to the inverse CAsymmetricObjectPropertyExpression* objPropAxiomExp = (CAsymmetricObjectPropertyExpression*)objPropAxiom; CObjectPropertyTermExpression* invObjPropTermExp = getCorrectedInverseObjectPropertyOf(objPropTermExp); CRole* invRole = getRoleForObjectPropertyTerm(invObjPropTermExp); if (!role->hasDisjointRole(invRole)) { CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); roleLinker->init(invRole,false); role->addDisjointRoleLinker(roleLinker); } if (!invRole->hasDisjointRole(role)) { CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); roleLinker->init(role,false); invRole->addDisjointRoleLinker(roleLinker); } role->setAsymmetric(true); } else if (expType == CBuildExpression::BETTRANSITIVEOBJECTPROPERTY) { // TODO: build RR [= R ?? CTransetiveObjectPropertyExpression* objPropAxiomExp = (CTransetiveObjectPropertyExpression*)objPropAxiom; CRoleChain* roleChain = buildRoleChainForTransetiveObjectPropertyExpression(objPropAxiomExp); CXLinker* superRoleChainLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(mMemManager); superRoleChainLinker->initLinker(roleChain); role->addRoleChainSuperSharingLinker(superRoleChainLinker); CXLinker* subRoleChainLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(mMemManager); subRoleChainLinker->initLinker(roleChain); role->addRoleChainSubSharingLinker(subRoleChainLinker); role->setTransitive(true); } } else { mObjPropTermObjPropAxiomSet->remove(QPair(objPropTermExp,objPropAxiom)); } } return true; } CRoleChain* CConcreteOntologyUpdateBuilder::buildRoleChainForTransetiveObjectPropertyExpression(CTransetiveObjectPropertyExpression* objPropAxiomExp) { CRoleChain* roleChain = nullptr; roleChain = mObjPropTermRoleChainHash->value(objPropAxiomExp,nullptr); if (!roleChain) { roleChain = CObjectAllocator< CRoleChain >::allocateAndConstruct(mMemManager); roleChain->initRoleChain(); mObjPropTermRoleChainHash->insert(objPropAxiomExp,roleChain); mRoleChainObjPropTermHash->insert(roleChain,objPropAxiomExp); CObjectPropertyTermExpression* transObjectProperty = objPropAxiomExp->getTransetivePropertyExpression(); CRole* transRole = getRoleForObjectPropertyTerm(transObjectProperty); CXLinker* chainedRoleLinker1 = CObjectAllocator< CXLinker >::allocateAndConstruct(mMemManager); chainedRoleLinker1->initLinker(transRole); roleChain->appendRoleChainLinker(chainedRoleLinker1); CXLinker* chainedRoleLinker2 = CObjectAllocator< CXLinker >::allocateAndConstruct(mMemManager); chainedRoleLinker2->initLinker(transRole); roleChain->appendRoleChainLinker(chainedRoleLinker2); mTaggingRoleChainSet.insert(roleChain); } return roleChain; } CRoleChain* CConcreteOntologyUpdateBuilder::buildRoleChainForSubObjectPropertyOfExpression(CSubObjectPropertyOfExpression* subObPropExp) { CRoleChain* roleChain = nullptr; roleChain = mObjPropTermRoleChainHash->value(subObPropExp,nullptr); if (!roleChain) { roleChain = CObjectAllocator< CRoleChain >::allocateAndConstruct(mMemManager); roleChain->initRoleChain(); mObjPropTermRoleChainHash->insert(subObPropExp,roleChain); mRoleChainObjPropTermHash->insert(roleChain,subObPropExp); CEXPRESSIONLIST* subObjPropList = subObPropExp->getSubObjectPropertyTermExpressionList(); FOREACHIT (CObjectPropertyTermExpression* subObjProp, *subObjPropList) { CRole* subRole = getRoleForObjectPropertyTerm(subObjProp); CXLinker* chainedRoleLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(mMemManager); chainedRoleLinker->initLinker(subRole); roleChain->appendRoleChainLinker(chainedRoleLinker); } mTaggingRoleChainSet.insert(roleChain); } return roleChain; } bool CConcreteOntologyUpdateBuilder::buildDisjointUnionConceptClass(CClassTermExpression* disCallClassExp, const CEXPRESSIONLIST& disClassExpList) { cint64 disjCount = disClassExpList.count(); if (disjCount > 0) { if (disjCount == 1) { CClassTermExpression* disjClassExp = disClassExpList.first(); buildConceptSubClassInclusion(disCallClassExp,disjClassExp); buildConceptSubClassInclusion(disjClassExp,disCallClassExp); } else { CClassTermExpression* orDisjExp = getObjectUnionOf(disClassExpList); buildConceptSubClassInclusion(disCallClassExp,orDisjExp); buildConceptSubClassInclusion(orDisjExp,disCallClassExp); } } return true; } bool CConcreteOntologyUpdateBuilder::buildPermutableConceptEquivalentClass(CClassTermExpression* eqCallClassExp, const CEXPRESSIONLIST& eqClassExpList) { if (eqClassExpList.count() == 2) { CClassTermExpression* firstEqClassExp = eqClassExpList.first(); CClassTermExpression* secondEqClassExp = eqClassExpList.last(); buildPermutableConceptEquivalentClass(firstEqClassExp,secondEqClassExp); } else { FOREACHIT (CClassTermExpression* eqClassExp2, eqClassExpList) { if (eqClassExp2 != eqCallClassExp) { buildConceptSubClassInclusion(eqCallClassExp,eqClassExp2); } } } return true; } bool CConcreteOntologyUpdateBuilder::buildPermutableConceptDisjointClass(CClassTermExpression* disCallClassExp, const CEXPRESSIONLIST& disClassExpList) { FOREACHIT (CClassTermExpression* disClassExp2, disClassExpList) { if (disCallClassExp != disClassExp2) { buildConceptSubClassInclusion(disCallClassExp,disClassExp2,true); } } return true; } bool CConcreteOntologyUpdateBuilder::buildPermutableConceptEquivalentClass(CClassTermExpression* classExp1, CClassTermExpression* classExp2) { CConcept* concept1 = getConceptForClassTerm(classExp1); CConcept* concept2 = getConceptForClassTerm(classExp2); CClassTermExpression* defEqClassExp = nullptr; CConcept* defEqConcept = nullptr; CClassTermExpression* eqClassExp = nullptr; CConcept* eqConcept = nullptr; if (concept1->getOperatorCode() == CCEQ && concept1->getOperandCount() == 1 && concept1->hasOperandConcept(concept2,false) || concept2->getOperatorCode() == CCEQ && concept2->getOperandCount() == 1 && concept2->hasOperandConcept(concept1,false)) { // equivalent class is already build return true; } else { if (classExp1->getType() == CBuildExpression::BETCLASS && concept1->getOperatorCode() == CCNONE) { defEqClassExp = classExp1; defEqConcept = concept1; eqClassExp = classExp2; eqConcept = concept2; } else { defEqClassExp = classExp2; defEqConcept = concept2; eqClassExp = classExp1; eqConcept = concept1; } return buildConceptEquivalentClass(defEqClassExp,eqClassExp); } } bool CConcreteOntologyUpdateBuilder::buildConceptEquivalentClass(CClassTermExpression* classExp1, CClassTermExpression* classExp2) { CConcept* concept1 = getConceptForClassTerm(classExp1); CConcept* concept2 = getConceptForClassTerm(classExp2); CClassTermExpression* defEqClassExp = nullptr; CConcept* defEqConcept = nullptr; CClassTermExpression* eqClassExp = nullptr; CConcept* eqConcept = nullptr; defEqClassExp = classExp1; defEqConcept = concept1; eqClassExp = classExp2; eqConcept = concept2; if (defEqClassExp->getType() == CBuildExpression::BETCLASS && defEqConcept->getOperatorCode() == CCNONE) { // can build completely defined equivalent concept defEqConcept->setOperatorCode(CCEQ); setConceptOperandsFromClassTerms(defEqConcept,eqClassExp); } else { // build each other inclusion with SubClassOf expressions buildConceptSubClassInclusion(defEqClassExp,eqClassExp); buildConceptSubClassInclusion(eqClassExp,defEqClassExp); } return true; } bool CConcreteOntologyUpdateBuilder::buildConceptSubClassInclusion(CClassTermExpression* subClassExp, CClassTermExpression* inclusionClassExp, bool negate) { if (subClassExp != mBottomClassExpression) { CConcept* concept = getConceptForClassTerm(subClassExp); qint64 opCode = concept->getOperatorCode(); if (opCode == CCEQ) { CSortedNegLinker* opConLinker = concept->getOperandList(); concept->setOperatorCode(CCSUB); opCode = CCSUB; // there is only one equivalent concept and is not negated by the linker CConcept* eqConcept = opConLinker->getData(); CClassTermExpression* eqClassExp = mConceptClassTermHash->value(eqConcept); if (eqConcept == CCATOM) { concept->setOperandCount(0); concept->setOperandList(nullptr); // order rebuild equivalent class if (mNewBuildedConceptSet.contains(eqClassExp)) { mNewBuildedConceptSet.remove(eqClassExp); } mNewBuildConceptSet.insert(eqClassExp); } else { buildConceptSubClassInclusion(eqClassExp,subClassExp); } } if (opCode == CCSUB || opCode == CCTOP) { // build simple subclass inclusion setConceptOperandsFromClassTerms(concept,inclusionClassExp,negate); } else if (opCode == CCNONE && subClassExp->getType() == CBuildExpression::BETCLASS) { // build simple subclass inclusion setConceptOperandsFromClassTerms(concept,inclusionClassExp,negate); concept->setOperatorCode(CCSUB); } else { // build GCI CClassTermExpression* compSubClassExp = getObjectComplementOf(subClassExp); if (!mConstructFlags->isNonELConstructUsed() && !mInitialBuildConceptSet->contains(compSubClassExp)) { mELExceptionExpressionSet.insert(compSubClassExp); } CClassTermExpression* neIinclusionClassExp = inclusionClassExp; if (negate) { neIinclusionClassExp = getObjectComplementOf(inclusionClassExp); mELExceptionExpressionSet.insert(neIinclusionClassExp); } CClassTermExpression* gciIncusionExp = getObjectUnionOf(CEXPRESSIONLIST()<isNonELConstructUsed() && !mInitialBuildConceptSet->contains(gciIncusionExp)) { mELExceptionExpressionSet.insert(gciIncusionExp); } buildGeneralConceptInclusionClassExpression(gciIncusionExp); } } return true; } bool CConcreteOntologyUpdateBuilder::buildGeneralConceptInclusionClassExpression(CClassTermExpression* gciClassTermExp) { mClassGCIExpressionSet.insert(gciClassTermExp); mRebuildTopConcept = true; return true; } bool CConcreteOntologyUpdateBuilder::updateName(CNamedItem* item, const QString& name) { bool nameAdded = false; if (!CIRIName::hasIRIName(item->getNameLinker(),name)) { cint64 lastNameID = CName::getLastNameVersionID(item->getNameLinker()); if (lastNameID < 0) { lastNameID = 0; } FOREACHHASHIT (QString prefix, CNamePrefix* namePrefix, *mNamePrefixMapHash) { if (name.startsWith(prefix)) { CAbbreviatedIRIName* newName = CObjectAllocator::allocateAndConstruct(mMemManager); QString abbString = name.mid(prefix.length()); newName->init(namePrefix,abbString); newName->setNameVersionID(lastNameID); CLinker* newNameLinker = CObjectAllocator< CLinker >::allocateAndConstruct(mMemManager); newNameLinker->init(newName); item->addNameLinker(newNameLinker); nameAdded = true; } } if (!nameAdded) { CIRIName* newName = CObjectAllocator::allocateAndConstruct(mMemManager); newName->init(name); newName->setNameVersionID(lastNameID); CLinker* newNameLinker = CObjectAllocator< CLinker >::allocateAndConstruct(mMemManager); newNameLinker->init(newName); item->addNameLinker(newNameLinker); } } return nameAdded; } CConcept* CConcreteOntologyUpdateBuilder::getConceptForClassTerm(CClassTermExpression* classTermExp, bool forceLocalisation) { CConcept* concept = nullptr; bool forceCreation = false; if (mInitialBuild && (classTermExp == mTopClassExpression || classTermExp == mBottomClassExpression)) { forceLocalisation = true; } concept = mClassTermConceptHash->value(classTermExp); if (concept && concept->getTag() == -1) { forceLocalisation = false; } if (concept && forceLocalisation) { if (!mLocalisationSet.contains(classTermExp)) { forceCreation = true; } } if (!concept || forceCreation) { CConcept* prevConcept = concept; if (forceLocalisation) { mLocalisationSet.insert(classTermExp); } concept = CObjectAllocator::allocateAndConstruct(mMemManager); concept->initConcept(); if (prevConcept) { cint64 prevConceptTag = prevConcept->getConceptTag(); concept->initTag(prevConceptTag); cint64 prevConceptOpCode = prevConcept->getOperatorCode(); if (prevConceptOpCode == CCTOP || prevConceptOpCode == CCBOTTOM) { concept->setOperatorCode(prevConceptOpCode); } mInstallConceptList.append(concept); } else { concept->setTag(-1); mTaggingConceptList.append(concept); } mClassTermConceptHash->insert(classTermExp,concept); mConceptClassTermHash->insert(concept,classTermExp); if (classTermExp->getType() == CBuildExpression::BETCLASS) { // update name CClassExpression* classExp = (CClassExpression*)classTermExp; QString className = classExp->getName(); updateName(concept,className); } } return concept; } CDataLiteral* CConcreteOntologyUpdateBuilder::getDataLiteralForLiteralExpression(CDataLiteralExpression* dataLiteralExp, bool forceLocalisation) { CDatatypeExpression* datatypeExp = dataLiteralExp->getDatatypeExpression(); CDataLexicalValueExpression* lexDatValueExp = dataLiteralExp->getDataLexicalValueExpression(); CDatatype* datatype = getDatatypeForDatatypeExpression(datatypeExp); CDataLiteral* dataLiteral = CObjectAllocator::allocateAndConstruct(mMemManager); dataLiteral->initDataLiteral(lexDatValueExp->getName(),datatype); return dataLiteral; } CDatatype* CConcreteOntologyUpdateBuilder::getDatatypeForDatatypeExpression(CDatatypeExpression* datatypeExp, bool forceLocalisation) { CDatatype* datatype = nullptr; datatype = mDatatypeExpDatatypeHash->value(datatypeExp); bool forceCreation = false; if (datatype && forceLocalisation) { if (!mLocalisationSet.contains(datatypeExp)) { forceCreation = true; } } if (!datatype || forceCreation) { if (forceLocalisation) { mLocalisationSet.insert(datatypeExp); } datatype = CObjectAllocator::allocateAndConstruct(mMemManager); datatype->initDatatype(datatypeExp->getName()); CDatatypeVector* datatypeVec = tBox->getDatatypeVector(); cint64 nextDatatypeTag = datatypeVec->getItemCount(); datatype->setDatatypeTag(nextDatatypeTag); datatypeVec->setData(nextDatatypeTag,datatype); mDatatypeExpDatatypeHash->insert(datatypeExp,datatype); mDatatypeDatatypeExpHash->insert(datatype,datatypeExp); } return datatype; } CConcept* CConcreteOntologyUpdateBuilder::getConceptForDataRangeTerm(CDataRangeTermExpression* dataRangeExp, bool forceLocalisation) { CConcept* concept = nullptr; concept = mDataRangeTermConceptHash->value(dataRangeExp); bool forceCreation = false; if (concept && concept->getTag() == -1) { forceLocalisation = false; } if (concept && forceLocalisation) { if (!mLocalisationSet.contains(dataRangeExp)) { forceCreation = true; } } if (!concept || forceCreation) { CConcept* prevConcept = concept; if (forceLocalisation) { mLocalisationSet.insert(dataRangeExp); } concept = CObjectAllocator::allocateAndConstruct(mMemManager); concept->initConcept(); if (prevConcept) { cint64 prevConceptTag = prevConcept->getConceptTag(); concept->initTag(prevConceptTag); cint64 prevConceptOpCode = prevConcept->getOperatorCode(); mInstallConceptList.append(concept); } else { mTaggingConceptList.append(concept); concept->setTag(-1); } mDataRangeTermConceptHash->insert(dataRangeExp,concept); mConceptDataRangeTermHash->insert(concept,dataRangeExp); } return concept; } CIndividual* CConcreteOntologyUpdateBuilder::getIndividualForIndividualTerm(CIndividualTermExpression* indiTermExp, bool forceLocalisation) { CIndividual* indi = nullptr; indi = mIndividulTermIndiHash->value(indiTermExp); bool forceCreation = false; if (indi && indi->getTag() == -1) { forceLocalisation = false; } if (indi && forceLocalisation) { if (!mLocalisationSet.contains(indiTermExp)) { forceCreation = true; } } if (!indi || forceCreation) { CIndividual* prevIndi = indi; if (forceLocalisation) { mLocalisationSet.insert(indiTermExp); } indi = CObjectAllocator::allocateAndConstruct(mMemManager); indi->initIndividual(); if (prevIndi) { indi->initTag(prevIndi->getIndividualID()); mInstallIndividualList.append(indi); } else { mTaggingIndividualSet.append(indi); indi->setTag(-1); } mIndividulTermIndiHash->insert(indiTermExp,indi); mIndiIndividulTermHash->insert(indi,indiTermExp); if (indiTermExp->getType() == CBuildExpression::BETNAMEDINDIVIDUAL) { // update name CNamedIndividualExpression* namedIndiExp = (CNamedIndividualExpression*)indiTermExp; QString indiName = namedIndiExp->getName(); updateName(indi,indiName); } else if (indiTermExp->getType() == CBuildExpression::BETANONYMOUSINDIVIDUAL) { CAnonymousIndividualExpression* anonymousIndiExp = (CAnonymousIndividualExpression*)indiTermExp; QString indiName = anonymousIndiExp->getName(); updateName(indi,indiName); indi->setAnonymousIndividual(true); } } return indi; } CRole* CConcreteOntologyUpdateBuilder::getRoleForDataPropertyTerm(CDataPropertyTermExpression* dataPropTermExp, bool forceLocalisation) { CRole* role = nullptr; role = mDataPropTermRoleHash->value(dataPropTermExp); bool forceCreation = false; if (mInitialBuild && dataPropTermExp == mTopDataPropExpression) { mConstructFlags->setTopDataRoleUsed(); forceLocalisation = true; } else if (mInitialBuild && dataPropTermExp == mBottomDataPropExpression) { mConstructFlags->setBottomDataRoleUsed(); forceLocalisation = true; } if (role && role->getTag() == -1) { forceLocalisation = false; } if (role && forceLocalisation) { if (!mLocalisationSet.contains(dataPropTermExp)) { forceCreation = true; } } if (!role || forceCreation) { CRole* prevRole = role; if (forceLocalisation) { mLocalisationSet.insert(dataPropTermExp); } role = CObjectAllocator::allocateAndConstruct(mMemManager); role->initRole(); if (prevRole) { role->initTag(prevRole->getRoleTag()); mInstallRoleList.append(role); } else { mTaggingRoleSet.insert(role); role->setTag(-1); } role->setDataRole(true); mDataPropTermRoleHash->insert(dataPropTermExp,role); mRoleDataPropTermHash->insert(role,dataPropTermExp); if (dataPropTermExp->getType() == CBuildExpression::BETDATAPROPERTY) { // update name CDataPropertyExpression* dataPropExp = (CDataPropertyExpression*)dataPropTermExp; QString propName = dataPropExp->getName(); updateName(role,propName); } } return role; } CRole* CConcreteOntologyUpdateBuilder::getRoleForObjectPropertyTerm(CObjectPropertyTermExpression* objPropTermExp, bool forceLocalisation) { CRole* role = nullptr; role = mObjPropTermRoleHash->value(objPropTermExp); bool forceCreation = false; if (mInitialBuild && objPropTermExp == mTopObjPropExpression) { mConstructFlags->setTopObjectRoleUsed(); forceLocalisation = true; } else if (mInitialBuild && objPropTermExp == mBottomObjPropExpression) { mConstructFlags->setBottomObjectRoleUsed(); forceLocalisation = true; } if (role && role->getTag() == -1) { forceLocalisation = false; } if (role && forceLocalisation) { if (!mLocalisationSet.contains(objPropTermExp)) { forceCreation = true; } } if (!role || forceCreation) { CRole* prevRole = role; if (forceLocalisation) { mLocalisationSet.insert(objPropTermExp); } role = CObjectAllocator::allocateAndConstruct(mMemManager); role->initRole(); if (prevRole) { role->initTag(prevRole->getRoleTag()); mInstallRoleList.append(role); } else { mTaggingRoleSet.insert(role); role->setTag(-1); } mObjPropTermRoleHash->insert(objPropTermExp,role); mRoleObjPropTermHash->insert(role,objPropTermExp); if (objPropTermExp->getType() == CBuildExpression::BETOBJECTPROPERTY) { // update name CObjectPropertyExpression* objPropExp = (CObjectPropertyExpression*)objPropTermExp; QString propName = objPropExp->getName(); updateName(role,propName); } } return role; } bool CConcreteOntologyUpdateBuilder::setConceptNominalIndividualFromIndividualTerm(CConcept* concept, CIndividualTermExpression* indiTermExp) { CIndividual* opIndi = getIndividualForIndividualTerm(indiTermExp,false); concept->setNominalIndividual(opIndi); if (!opIndi->getIndividualNominalConcept()) { opIndi->setIndividualNominalConcept(concept); } return true; } bool CConcreteOntologyUpdateBuilder::setConceptIndividualFromIndividualTerm(CConcept* concept, CIndividualTermExpression* indiTermExp) { CIndividual* opIndi = getIndividualForIndividualTerm(indiTermExp,false); concept->setNominalIndividual(opIndi); return true; } bool CConcreteOntologyUpdateBuilder::setConceptRoleFromObjectPropertyTerm(CConcept* concept, CObjectPropertyTermExpression* objectPropertyTermExp) { CRole* opRole = getRoleForObjectPropertyTerm(objectPropertyTermExp); concept->setRole(opRole); return true; } bool CConcreteOntologyUpdateBuilder::setConceptRoleFromDataPropertyTerm(CConcept* concept, CDataPropertyTermExpression* dataPropertyTermExp) { CRole* opRole = getRoleForDataPropertyTerm(dataPropertyTermExp); concept->setRole(opRole); return true; } cint64 CConcreteOntologyUpdateBuilder::getIndividualVariableID(CConcept* concept, CObjectIndividualVariableExpression* objectIndVarExp) { cint64 indVarID = mIndividualVariableIDHash->value(objectIndVarExp,0); if (indVarID <= 0) { indVarID = mIndividualVariableIDHash->count()+1; mIndividualVariableIDHash->insert(objectIndVarExp,indVarID); } return indVarID; } bool CConcreteOntologyUpdateBuilder::setConceptOperandsFromClassTerms(CConcept* concept, CEXPRESSIONLIST* classTermList, bool negate) { FOREACHIT (CClassTermExpression* classTermExp, *classTermList) { CConcept* opConcept = getConceptForClassTerm(classTermExp); //if (!concept->hasOperandConcept(opConcept,negate)) { CSortedNegLinker* opConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); opConLinker->init(opConcept,negate); concept->addOperandLinker(opConLinker); concept->incOperandCount(); //} } return true; } bool CConcreteOntologyUpdateBuilder::setIndividualAssertionRoleFromObjectPropertyTerm(CIndividual* individual, CObjectPropertyTermExpression* objPropTermExp, CIndividualTermExpression* destIndiTermExp) { CIndividual* desIndividual = getIndividualForIndividualTerm(destIndiTermExp); CRole* role = getRoleForObjectPropertyTerm(objPropTermExp); CRoleAssertionLinker* roleAssLinker = CObjectAllocator< CRoleAssertionLinker >::allocateAndConstruct(mMemManager); roleAssLinker->initRoleAssertionLinker(role,desIndividual); individual->addAssertionRoleLinker(roleAssLinker); return true; } bool CConcreteOntologyUpdateBuilder::setIndividualAssertionConceptFromClassTerm(CIndividual* individual, CClassTermExpression* classTermExp, bool negate) { CConcept* opConcept = getConceptForClassTerm((CClassTermExpression*)classTermExp); CConceptAssertionLinker* opConLinker = CObjectAllocator< CConceptAssertionLinker >::allocateAndConstruct(mMemManager); opConLinker->initNegLinker(opConcept,negate); individual->addAssertionConceptLinker(opConLinker); return true; } bool CConcreteOntologyUpdateBuilder::setIndividualAssertionNominalFromClassTerm(CIndividual* individual, CClassTermExpression* classTermExp, bool negate) { CConcept* opConcept = getConceptForClassTerm((CClassTermExpression*)classTermExp); individual->setIndividualNominalConcept(opConcept); CConceptAssertionLinker* opConLinker = CObjectAllocator< CConceptAssertionLinker >::allocateAndConstruct(mMemManager); opConLinker->initNegLinker(opConcept,negate); individual->addAssertionConceptLinker(opConLinker); return true; } bool CConcreteOntologyUpdateBuilder::setConceptOperandsFromClassTerms(CConcept* concept, CClassTermExpression* classTermExp, bool negate) { if (classTermExp) { CConcept* opConcept = getConceptForClassTerm((CClassTermExpression*)classTermExp); //if (!concept->hasOperandConcept(opConcept,negate)) { CSortedNegLinker* opConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); opConLinker->init(opConcept,negate); concept->addOperandLinker(opConLinker); concept->incOperandCount(); //} return true; } return false; } bool CConcreteOntologyUpdateBuilder::setConceptOperandsFromDataRangeTerms(CConcept* concept, CDataRangeTermExpression* dataRangeTermExp, bool negate) { if (dataRangeTermExp) { CConcept* opConcept = getConceptForDataRangeTerm(dataRangeTermExp); //if (!concept->hasOperandConcept(opConcept,negate)) { CSortedNegLinker* opConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); opConLinker->init(opConcept,negate); concept->addOperandLinker(opConLinker); concept->incOperandCount(); //} return true; } return false; } bool CConcreteOntologyUpdateBuilder::setConceptOperandsFromDataRangeTerms(CConcept* concept, CEXPRESSIONLIST* dataRangeTermExpList, bool negate) { FOREACHIT (CDataRangeTermExpression* dataRangeTermExp, *dataRangeTermExpList) { CConcept* opConcept = getConceptForDataRangeTerm(dataRangeTermExp); //if (!concept->hasOperandConcept(opConcept,negate)) { CSortedNegLinker* opConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); opConLinker->init(opConcept,negate); concept->addOperandLinker(opConLinker); concept->incOperandCount(); //} } return true; } bool CConcreteOntologyUpdateBuilder::setConceptOperands(CConcept* concept, CConcept* operandConcept, bool negate) { //if (!concept->hasOperandConcept(operandConcept,negate)) { CSortedNegLinker* opConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemManager); opConLinker->init(operandConcept,negate); concept->addOperandLinker(opConLinker); concept->incOperandCount(); //} return true; } bool CConcreteOntologyUpdateBuilder::tellOntologyAxiom(CAxiomExpression* axiom) { if (!mTellAxiomSet->contains(axiom)) { mRetractAxiomSet->remove(axiom); mTellAxiomSet->insert(axiom); if (mRetractUpdatedAxiomSet->contains(axiom)) { mRetractUpdatedAxiomSet->remove(axiom); } else { mTellUpdatedAxiomSet->insert(axiom); } } return true; } bool CConcreteOntologyUpdateBuilder::retractOntologyAxiom(CAxiomExpression* axiom) { if (mTellAxiomSet->contains(axiom)) { mTellAxiomSet->remove(axiom); mRetractAxiomSet->insert(axiom); if (mTellUpdatedAxiomSet->contains(axiom)) { mTellUpdatedAxiomSet->remove(axiom); } else { mRetractUpdatedAxiomSet->insert(axiom); } } return true; } bool CConcreteOntologyUpdateBuilder::buildRoleTags() { cint64 nextRoleTag = rBox->getRoleCount(); FOREACHIT (CRole* role, mTaggingRoleSet) { role->setRoleTag(nextRoleTag++); mInstallRoleList.append(role); } return true; } bool CConcreteOntologyUpdateBuilder::buildIndividualIDs() { cint64 nextIndiID = aBox->getIndividualCount(); class CIndividualTaggingDependingItem : public CIndividualData { public: CIndividualTaggingDependingItem() { mDependent = false; } public: bool mDependent; }; cint64 taggingCount = mTaggingIndividualSet.count(); CIndividualTaggingDependingItem* taggingItemVec = new CIndividualTaggingDependingItem[taggingCount]; cint64 itemIdx = 0; for (CBUILDLIST::const_iterator it1 = mTaggingIndividualSet.constBegin(), it1End = mTaggingIndividualSet.constEnd(); it1 != it1End; ++it1) { CIndividual* individual = *it1; if (!individual->hasIndividualData()) { CIndividualTaggingDependingItem* taggingItem = &taggingItemVec[itemIdx++]; individual->setIndividualData(taggingItem); } } CBUILDLIST dependedIndividualList; CBUILDLIST directIndividualList; CBUILDLIST currentIndividualList; for (CBUILDLIST::const_iterator it1 = mTaggingIndividualSet.constBegin(), it1End = mTaggingIndividualSet.constEnd(); it1 != it1End; ++it1) { CIndividual* individual = *it1; for (CRoleAssertionLinker* roleAssLinkIt = individual->getAssertionRoleLinker(); roleAssLinkIt; roleAssLinkIt = roleAssLinkIt->getNext()) { CIndividual* otIndi = roleAssLinkIt->getIndividual(); if (otIndi->getIndividualID() <= 0) { CIndividualTaggingDependingItem* taggingItem = (CIndividualTaggingDependingItem*)otIndi->getIndividualData(); if (taggingItem && !taggingItem->mDependent) { taggingItem->mDependent = true; dependedIndividualList.append(otIndi); } } } } for (CBUILDLIST::const_iterator it1 = mTaggingIndividualSet.constBegin(), it1End = mTaggingIndividualSet.constEnd(); it1 != it1End; ++it1) { CIndividual* individual = *it1; CIndividualTaggingDependingItem* taggingItem = (CIndividualTaggingDependingItem*)individual->getIndividualData(); if (!taggingItem->mDependent) { directIndividualList.append(individual); } } CBUILDLIST taggingIndividualList; while (!directIndividualList.isEmpty() || !dependedIndividualList.isEmpty()) { CIndividual* individual = nullptr; if (currentIndividualList.isEmpty() && !directIndividualList.isEmpty()) { individual = directIndividualList.takeFirst(); currentIndividualList.append(individual); } if (currentIndividualList.isEmpty() && !dependedIndividualList.isEmpty()) { CIndividual* individual = dependedIndividualList.takeFirst(); CIndividualTaggingDependingItem* taggingItem = (CIndividualTaggingDependingItem*)individual->getIndividualData(); if (taggingItem && taggingItem->mDependent) { taggingItem->mDependent = false; currentIndividualList.append(individual); } } CBUILDLIST nextTaggingConceptList; while (!currentIndividualList.isEmpty()) { individual = currentIndividualList.takeFirst(); nextTaggingConceptList.append(individual); for (CRoleAssertionLinker* roleAssLinkIt = individual->getAssertionRoleLinker(); roleAssLinkIt; roleAssLinkIt = roleAssLinkIt->getNext()) { CIndividual* otIndi = roleAssLinkIt->getIndividual(); if (otIndi->getIndividualID() <= 0) { CIndividualTaggingDependingItem* taggingItem = (CIndividualTaggingDependingItem*)otIndi->getIndividualData(); if (taggingItem && taggingItem->mDependent) { taggingItem->mDependent = false; currentIndividualList.append(otIndi); } } } } for (CBUILDLIST::const_iterator it1 = nextTaggingConceptList.constBegin(), it1End = nextTaggingConceptList.constEnd(); it1 != it1End; ++it1) { taggingIndividualList.append(*it1); } } for (CBUILDLIST::const_iterator it1 = taggingIndividualList.constBegin(), it1End = taggingIndividualList.constEnd(); it1 != it1End; ++it1) { CIndividual* taggingIndividual = *it1; taggingIndividual->setIndividualID(nextIndiID++); mInstallIndividualList.append(taggingIndividual); } for (CBUILDLIST::const_iterator it1 = mTaggingIndividualSet.constBegin(), it1End = mTaggingIndividualSet.constEnd(); it1 != it1End; ++it1) { CIndividual* individual = *it1; individual->setIndividualData(nullptr); } delete [] taggingItemVec; //FOREACHIT (CIndividual* indi, mTaggingIndividualSet) { // QString indiName = CIRIName::getRecentIRIName(indi->getIndividualNameLinker()); // indiName = indiName.replace("file:/C:/temp/s",""); // cint64 indiNameID = indiName.toLongLong(); // indi->setIndividualID(indiNameID); // //indi->setIndividualID(nextIndiID++); // mInstallIndividualList.append(indi); //} return true; } bool CConcreteOntologyUpdateBuilder::buildRoleChainTags() { cint64 nextRoleChainTag = rBox->getRoleChainCount(); FOREACHIT (CRoleChain* roleChain, mTaggingRoleChainSet) { roleChain->setRoleChainTag(nextRoleChainTag++); mInstallRoleChainList.append(roleChain); } return true; } bool CConcreteOntologyUpdateBuilder::buildConceptTags() { cint64 lastFreeConceptTag = tBox->getConceptCount(); class CConceptTaggingDependingItem : public CConceptData { public: CConceptTaggingDependingItem() { mDependent = false; } public: bool mDependent; }; cint64 taggingCount = mTaggingConceptList.count(); CConceptTaggingDependingItem* taggingItemVec = new CConceptTaggingDependingItem[taggingCount]; cint64 itemIdx = 0; for (CBUILDLIST::const_iterator it1 = mTaggingConceptList.constBegin(), it1End = mTaggingConceptList.constEnd(); it1 != it1End; ++it1) { CConcept* concept = *it1; if (!concept->hasConceptData()) { CConceptTaggingDependingItem* taggingItem = &taggingItemVec[itemIdx++]; concept->setConceptData(taggingItem); } } CBUILDLIST dependedConceptList; CBUILDLIST directConceptList; CBUILDLIST currentConceptList; for (CBUILDLIST::const_iterator it1 = mTaggingConceptList.constBegin(), it1End = mTaggingConceptList.constEnd(); it1 != it1End; ++it1) { CConcept* concept = *it1; CSortedNegLinker* opConLinker = concept->getOperandList(); while (opConLinker) { CConcept* opConcept = opConLinker->getData(); if (opConcept) { CConceptTaggingDependingItem* taggingItem = (CConceptTaggingDependingItem*)opConcept->getConceptData(); if (taggingItem && !taggingItem->mDependent) { taggingItem->mDependent = true; dependedConceptList.append(opConcept); } } opConLinker = opConLinker->getNext(); } } for (CBUILDLIST::const_iterator it1 = mTaggingConceptList.constBegin(), it1End = mTaggingConceptList.constEnd(); it1 != it1End; ++it1) { CConcept* concept = *it1; CConceptTaggingDependingItem* taggingItem = (CConceptTaggingDependingItem*)concept->getConceptData(); if (!taggingItem->mDependent) { directConceptList.append(concept); } } CBUILDLIST taggingConceptList; while (!directConceptList.isEmpty() || !dependedConceptList.isEmpty()) { CConcept* concept = nullptr; if (currentConceptList.isEmpty() && !directConceptList.isEmpty()) { concept = directConceptList.takeFirst(); currentConceptList.append(concept); } if (currentConceptList.isEmpty() && !dependedConceptList.isEmpty()) { CConcept* concept = dependedConceptList.takeFirst(); CConceptTaggingDependingItem* taggingItem = (CConceptTaggingDependingItem*)concept->getConceptData(); if (taggingItem && taggingItem->mDependent) { taggingItem->mDependent = false; currentConceptList.append(concept); } } CBUILDLIST nextTaggingConceptList; while (!currentConceptList.isEmpty()) { concept = currentConceptList.takeFirst(); nextTaggingConceptList.prepend(concept); CSortedNegLinker* opConLinker = concept->getOperandList(); while (opConLinker) { CConcept* opConcept = opConLinker->getData(); if (opConcept) { CConceptTaggingDependingItem* taggingItem = (CConceptTaggingDependingItem*)opConcept->getConceptData(); if (taggingItem && taggingItem->mDependent) { taggingItem->mDependent = false; currentConceptList.append(opConcept); } } opConLinker = opConLinker->getNext(); } } for (CBUILDLIST::const_iterator it1 = nextTaggingConceptList.constBegin(), it1End = nextTaggingConceptList.constEnd(); it1 != it1End; ++it1) { taggingConceptList.append(*it1); } } for (CBUILDLIST::const_iterator it1 = taggingConceptList.constBegin(), it1End = taggingConceptList.constEnd(); it1 != it1End; ++it1) { CConcept* taggingConcept = *it1; taggingConcept->setConceptTag(lastFreeConceptTag++); mInstallConceptList.append(taggingConcept); } for (CBUILDLIST::const_iterator it1 = mTaggingConceptList.constBegin(), it1End = mTaggingConceptList.constEnd(); it1 != it1End; ++it1) { CConcept* concept = *it1; concept->setConceptData(nullptr); } delete [] taggingItemVec; //CBUILDSET dependedConceptSet; //CBUILDSET taggedConceptSet; //CBUILDLIST directConceptList; //CBUILDLIST currentConceptList; //for (CBUILDSET::const_iterator it1 = mTaggingConceptSet.constBegin(), it1End = mTaggingConceptSet.constEnd(); it1 != it1End; ++it1) { // CConcept* concept = *it1; // CSortedNegLinker* opConLinker = concept->getOperandList(); // while (opConLinker) { // CConcept* opConcept = opConLinker->getData(); // if (opConcept && mTaggingConceptSet.contains(opConcept)) { // dependedConceptSet.insert(opConcept); // } // opConLinker = opConLinker->getNext(); // } //} //for (CBUILDSET::const_iterator it1 = mTaggingConceptSet.constBegin(), it1End = mTaggingConceptSet.constEnd(); it1 != it1End; ++it1) { // CConcept* concept = *it1; // if (!dependedConceptSet.contains(concept)) { // directConceptList.append(concept); // } //} //CBUILDLIST taggingConceptList; //while (!directConceptList.isEmpty() || !dependedConceptSet.isEmpty()) { // CConcept* concept = nullptr; // if (currentConceptList.isEmpty() && !directConceptList.isEmpty()) { // concept = directConceptList.takeFirst(); // currentConceptList.append(concept); // } // if (currentConceptList.isEmpty() && !dependedConceptSet.isEmpty()) { // CBUILDSET::iterator firstDepConIt = dependedConceptSet.begin(); // concept = *firstDepConIt; // currentConceptList.append(concept); // dependedConceptSet.erase(firstDepConIt); // } // CBUILDLIST nextTaggingConceptList; // while (!currentConceptList.isEmpty()) { // concept = currentConceptList.takeFirst(); // nextTaggingConceptList.prepend(concept); // CSortedNegLinker* opConLinker = concept->getOperandList(); // while (opConLinker) { // CConcept* opConcept = opConLinker->getData(); // if (opConcept && dependedConceptSet.contains(opConcept)) { // dependedConceptSet.remove(opConcept); // currentConceptList.prepend(opConcept); // } // opConLinker = opConLinker->getNext(); // } // } // for (CBUILDLIST::const_iterator it1 = nextTaggingConceptList.constBegin(), it1End = nextTaggingConceptList.constEnd(); it1 != it1End; ++it1) { // taggingConceptList.append(*it1); // } //} //for (CBUILDLIST::const_iterator it1 = taggingConceptList.constBegin(), it1End = taggingConceptList.constEnd(); it1 != it1End; ++it1) { // CConcept* taggingConcept = *it1; // taggingConcept->setConceptTag(lastFreeConceptTag++); // mInstallConceptList.append(taggingConcept); //} //cint64 nextUsedConceptTag = lastFreeConceptTag+mTaggingConceptSet.count()-1; //CBUILDSET directConceptSet; //CBUILDHASH succConceptHash; //CBUILDHASH prevConceptCountHash; //FOREACHIT (CConcept* concept, mTaggingConceptSet) { // if (prevConceptCountHash.value(concept,0) <= 0) { // directConceptSet.insert(concept); // } // CSortedNegLinker* opConLinker = concept->getOperandList(); // while (opConLinker) { // CConcept* opConcept = opConLinker->getData(); // if (opConcept && mTaggingConceptSet.contains(opConcept)) { // succConceptHash.insertMulti(concept,opConcept); // cint64 prevCount = prevConceptCountHash.value(opConcept,0); // if (prevCount <= 0) { // directConceptSet.remove(opConcept); // } // ++prevCount; // prevConceptCountHash.insert(opConcept,prevCount); // } // opConLinker = opConLinker->getNext(); // } //} //CBUILDLIST nextConceptTaggingList; //FOREACHIT (CConcept* concept, directConceptSet) { // nextConceptTaggingList.append(concept); //} //if (nextConceptTaggingList.isEmpty() && nextUsedConceptTag >= lastFreeConceptTag) { // // search next concept for tagging with minimal dependency // cint64 minPrevCount = 0; // CConcept* minPrevConcept = nullptr; // FOREACHHASHIT (CConcept* concept, cint64 prevCount, prevConceptCountHash) { // if (!minPrevConcept || prevCount < minPrevCount && prevCount > 0) { // minPrevCount = prevCount; // minPrevConcept = concept; // } // } // nextConceptTaggingList.append(minPrevConcept); //} //while (!nextConceptTaggingList.isEmpty()) { // CConcept* taggingConcept = nextConceptTaggingList.takeLast(); // taggingConcept->setConceptTag(nextUsedConceptTag--); // mInstallConceptList.append(taggingConcept); // prevConceptCountHash.insert(taggingConcept,0); // FOREACHIT (CConcept* succConcept, succConceptHash.values(taggingConcept)) { // cint64 prevCount = prevConceptCountHash.value(succConcept)-1; // if (prevCount == 0) { // nextConceptTaggingList.append(succConcept); // } // prevConceptCountHash.insert(succConcept,prevCount); // } // if (nextConceptTaggingList.isEmpty() && nextUsedConceptTag >= lastFreeConceptTag) { // // search next concept for tagging with minimal dependency // cint64 minPrevCount = 0; // CConcept* minPrevConcept = nullptr; // FOREACHHASHIT (CConcept* concept, cint64 prevCount, prevConceptCountHash) { // if ((!minPrevConcept || prevCount < minPrevCount) && prevCount > 0) { // minPrevCount = prevCount; // minPrevConcept = concept; // } // } // nextConceptTaggingList.append(minPrevConcept); // } //} return true; } bool CConcreteOntologyUpdateBuilder::resortAndInstallConceptsAndRolesAndIndividuals() { CConceptVector* conVec = tBox->getConceptVector(); FOREACHIT (CConcept* concept, mInstallConceptList) { CSortedNegLinker* opConceptLinkerIt = concept->getOperandList(); opConceptLinkerIt = resortConceptLinkersByTagging(opConceptLinkerIt,concept->getOperandCount()); concept->setOperandList(opConceptLinkerIt); conVec->setData(concept->getConceptTag(),concept); } CRoleVector* roleVec = rBox->getRoleVector(); FOREACHIT (CRole* role, mInstallRoleList) { CSortedNegLinker* roleLinkerIt = nullptr; roleLinkerIt = role->getSuperRoleList(); roleLinkerIt = resortRoleLinkersByTagging(roleLinkerIt); role->setSuperRoleList(roleLinkerIt); roleLinkerIt = role->getDisjointRoleList(); roleLinkerIt = resortRoleLinkersByTagging(roleLinkerIt); role->setDisjointRoleList(roleLinkerIt); roleLinkerIt = role->getInverseEquivalentRoleList(); roleLinkerIt = resortRoleLinkersByTagging(roleLinkerIt); role->setInverseEquivalentRoleList(roleLinkerIt); CSortedNegLinker* conceptLinkerIt = nullptr; conceptLinkerIt = role->getDomainConceptList(); conceptLinkerIt = resortConceptLinkersByTagging(conceptLinkerIt); role->setDomainConceptList(conceptLinkerIt); conceptLinkerIt = role->getRangeConceptList(); conceptLinkerIt = resortConceptLinkersByTagging(conceptLinkerIt); role->setRangeConceptList(conceptLinkerIt); roleVec->setData(role->getRoleTag(),role); } CRoleChainVector* roleChainVec = rBox->getRoleChainVector(); FOREACHIT (CRoleChain* roleChain, mInstallRoleChainList) { roleChainVec->setData(roleChain->getRoleChainTag(),roleChain); } CIndividualVector* indiVec = aBox->getIndividualVector(); FOREACHIT (CIndividual* indi, mInstallIndividualList) { indiVec->setData(indi->getIndividualID(),indi); } return false; } CSortedNegLinker* CConcreteOntologyUpdateBuilder::resortConceptLinkersByTagging(CSortedNegLinker* conceptLinkers, cint64 linkerCount) { if (linkerCount > 100) { QMap*> linkerSortMap; CSortedNegLinker* conceptLinkerIt = conceptLinkers; while (conceptLinkerIt) { CSortedNegLinker* tmpConceptLinker = conceptLinkerIt; conceptLinkerIt = conceptLinkerIt->getNext(); tmpConceptLinker->setNext(nullptr); linkerSortMap.insertMulti(tmpConceptLinker->getData()->getConceptTag(),tmpConceptLinker); } CSortedNegLinker* newConceptLinkers = nullptr; CSortedNegLinker* lastNewConceptLinkers = nullptr; for (QMap*>::const_iterator it = linkerSortMap.constBegin(), itEnd = linkerSortMap.constEnd(); it != itEnd; ++it) { CSortedNegLinker* tmpConceptLinker = *it; if (!newConceptLinkers) { lastNewConceptLinkers = newConceptLinkers = tmpConceptLinker; } else { lastNewConceptLinkers->setNext(tmpConceptLinker); lastNewConceptLinkers = tmpConceptLinker; } } return newConceptLinkers; } else { CSortedNegLinker* newConceptLinkers = nullptr; while (conceptLinkers) { CSortedNegLinker* tmpConceptLinker = conceptLinkers; conceptLinkers = conceptLinkers->getNext(); tmpConceptLinker->setNext(nullptr); if (!newConceptLinkers) { newConceptLinkers = tmpConceptLinker; } else { newConceptLinkers = newConceptLinkers->insertSortedNextSorted(tmpConceptLinker); } } return newConceptLinkers; } } CSortedNegLinker* CConcreteOntologyUpdateBuilder::resortRoleLinkersByTagging(CSortedNegLinker* roleLinkers) { CSortedNegLinker* newRoleLinkers = nullptr; while (roleLinkers) { CSortedNegLinker* tmpRoleLinker = roleLinkers; roleLinkers = roleLinkers->getNext(); tmpRoleLinker->setNext(nullptr); if (!newRoleLinkers) { newRoleLinkers = tmpRoleLinker; } else { newRoleLinkers = newRoleLinkers->insertSortedNextSorted(tmpRoleLinker); } } return newRoleLinkers; } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CExpressionSplitter.cpp0000644000175000017500000003147612520551000026464 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExpressionSplitter.h" namespace Konclude { namespace Reasoner { namespace Generator { CExpressionSplitter::CExpressionSplitter(const CEXPRESSIONLIST& expressions) { splitExpressions(expressions); } CExpressionSplitter::CExpressionSplitter(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) { if (expression1) { addSplittedExpression(expression1); } if (expression2) { addSplittedExpression(expression2); } if (expression3) { addSplittedExpression(expression3); } } bool CExpressionSplitter::splitExpressions(const CEXPRESSIONLIST& expressions) { bool allSplitted = true; for (CEXPRESSIONLIST::const_iterator it = expressions.constBegin(), itEnd = expressions.constEnd(); it != itEnd; ++it) { CBuildExpression* expression(*it); allSplitted &= addSplittedExpression(expression); } return allSplitted; } bool CExpressionSplitter::addSplittedExpression(CBuildExpression* expression) { CClassTermExpression* classExpression = dynamic_cast(expression); if (classExpression) { mClassList.append(classExpression); return true; } else { CObjectPropertyTermExpression* objectPropertyExpression = dynamic_cast(expression); if (objectPropertyExpression) { mObjectPropertyList.append(objectPropertyExpression); return true; } else { CIndividualTermExpression* individualExpression = dynamic_cast(expression); if (individualExpression) { mIndiList.append(individualExpression); return true; } else { CDataPropertyTermExpression* dataPropertyExpression = dynamic_cast(expression); if (dataPropertyExpression) { mDataPropertyList.append(dataPropertyExpression); return true; } else { CDataRangeTermExpression* dataRangeExpression = dynamic_cast(expression); if (dataRangeExpression) { mDataRangeList.append(dataRangeExpression); CDataLiteralExpression* dataLiteralExpression = dynamic_cast(expression); if (dataLiteralExpression) { mDataLiteralList.append(dataLiteralExpression); } else { CDatatypeExpression* datatypeExpression = dynamic_cast(expression); if (datatypeExpression) { mDatatypeList.append(datatypeExpression); } } return true; } else { CDataFacetRestrictionExpression* dataFacetRestExpression = dynamic_cast(expression); if (dataFacetRestExpression) { mDataFacetRestrictionList.append(dataFacetRestExpression); return true; } else { CDataFacetExpression* dataFacetExpression = dynamic_cast(expression); if (dataFacetExpression) { mDataFacetList.append(dataFacetExpression); return true; } } } } } } } return false; } bool CExpressionSplitter::testForClassExpressions(cint64 requiredClassExpressions) { if (mClassList.count() < requiredClassExpressions) { return false; } return true; } bool CExpressionSplitter::testForObjectPropertyExpressions(cint64 requiredObjectPropertyExpressions) { if (mObjectPropertyList.count() < requiredObjectPropertyExpressions) { return false; } return true; } bool CExpressionSplitter::testForIndividualExpressions(cint64 requiredIndividualExpressions) { if (mIndiList.count() < requiredIndividualExpressions) { return false; } return true; } bool CExpressionSplitter::testForDataPropertyExpressions(cint64 dataPropertyExpressions) { if (mDataPropertyList.count() < dataPropertyExpressions) { return false; } return true; } bool CExpressionSplitter::testForDataRangeExpressions(cint64 dataRangeExpressions) { if (mDataRangeList.count() < dataRangeExpressions) { return false; } return true; } bool CExpressionSplitter::testForDataLiteralExpressions(cint64 literalExpressions) { if (mDataLiteralList.count() < literalExpressions) { return false; } return true; } bool CExpressionSplitter::testForDataFacetRestrictionExpressions(cint64 dataFacetRestrictionExpressions) { if (mDataFacetRestrictionList.count() < dataFacetRestrictionExpressions) { return false; } return true; } bool CExpressionSplitter::testForDataFacetExpressions(cint64 dataFacetExpressions) { if (mDataFacetList.count() < dataFacetExpressions) { return false; } return true; } bool CExpressionSplitter::testForExpressionComposition(cint64 requiredClassExpressions, cint64 requiredObjectPropertyExpressions, cint64 requiredIndividualExpressions, cint64 dataRangeExpressions, cint64 dataPropertyExpressions, cint64 dataLiteralExpressions, cint64 datatypeExpressions, cint64 dataFacetRestrictionExpressions, cint64 dataFacetExpressions) { if (mClassList.count() < requiredClassExpressions) { LOG(ERROR,"::Konclude::Reasoner::Generator::ExpressionSplitter",logTr("Couldn't extract minimal required %1 Class-Expressions, extracted Class-Expressions %2.").arg(requiredClassExpressions).arg(mClassList.count()),this); return false; } if (mObjectPropertyList.count() < requiredObjectPropertyExpressions) { LOG(ERROR,"::Konclude::Reasoner::Generator::ExpressionSplitter",logTr("Couldn't extract minimal required %1 ObjectProperty-Expressions, extracted ObjectProperty-Expressions %2.").arg(requiredObjectPropertyExpressions).arg(mObjectPropertyList.count()),this); return false; } if (mIndiList.count() < requiredIndividualExpressions) { LOG(ERROR,"::Konclude::Reasoner::Generator::ExpressionSplitter",logTr("Couldn't extract minimal required %1 Individual-Expressions, extracted Individual-Expressions %2.").arg(requiredIndividualExpressions).arg(mIndiList.count()),this); return false; } if (mDataRangeList.count() < dataRangeExpressions) { LOG(ERROR,"::Konclude::Reasoner::Generator::ExpressionSplitter",logTr("Couldn't extract minimal required %1 DataRange-Expressions, extracted DataRange-Expressions %2.").arg(dataRangeExpressions).arg(mDataRangeList.count()),this); return false; } if (mDataPropertyList.count() < dataPropertyExpressions) { LOG(ERROR,"::Konclude::Reasoner::Generator::ExpressionSplitter",logTr("Couldn't extract minimal required %1 DataProperty-Expressions, extracted DataProperty-Expressions %2.").arg(dataPropertyExpressions).arg(mDataPropertyList.count()),this); return false; } if (mDataLiteralList.count() < dataLiteralExpressions) { LOG(ERROR,"::Konclude::Reasoner::Generator::ExpressionSplitter",logTr("Couldn't extract minimal required %1 DataLiteral-Expressions, extracted DataLiteral-Expressions %2.").arg(dataLiteralExpressions).arg(mDataLiteralList.count()),this); return false; } if (mDatatypeList.count() < datatypeExpressions) { LOG(ERROR,"::Konclude::Reasoner::Generator::ExpressionSplitter",logTr("Couldn't extract minimal required %1 Datatype-Expressions, extracted Datatype-Expressions %2.").arg(datatypeExpressions).arg(mDatatypeList.count()),this); return false; } if (mDataFacetRestrictionList.count() < dataFacetRestrictionExpressions) { LOG(ERROR,"::Konclude::Reasoner::Generator::ExpressionSplitter",logTr("Couldn't extract minimal required %1 DataFacetRestriction-Expressions, extracted DataFacetRestriction-Expressions %2.").arg(dataFacetRestrictionExpressions).arg(mDataFacetRestrictionList.count()),this); return false; } if (mDataFacetList.count() < dataFacetExpressions) { LOG(ERROR,"::Konclude::Reasoner::Generator::ExpressionSplitter",logTr("Couldn't extract minimal required %1 DataFacet-Expressions, extracted DataFacet-Expressions %2.").arg(dataFacetExpressions).arg(mDataFacetList.count()),this); return false; } return true; } CEXPRESSIONLIST* CExpressionSplitter::getClassTermExpressionList() { return &mClassList; } CEXPRESSIONLIST* CExpressionSplitter::getObjectPropertyTermExpressionList() { return &mObjectPropertyList; } CEXPRESSIONLIST* CExpressionSplitter::getIndividualTermExpressionList() { return &mIndiList; } CEXPRESSIONLIST* CExpressionSplitter::getDataRangeTermExpressionList() { return &mDataRangeList; } CEXPRESSIONLIST* CExpressionSplitter::getDataLiteralExpressionList() { return &mDataLiteralList; } CEXPRESSIONLIST* CExpressionSplitter::getDatatypeExpressionList() { return &mDatatypeList; } CEXPRESSIONLIST* CExpressionSplitter::getDataPropertyTermExpressionList() { return &mDataPropertyList; } CEXPRESSIONLIST* CExpressionSplitter::getDataFacetRestrictionList() { return &mDataFacetRestrictionList; } CEXPRESSIONLIST* CExpressionSplitter::getDataFacetList() { return &mDataFacetList; } CClassTermExpression* CExpressionSplitter::getFirstClassTermExpression() { return mClassList.first(); } CClassTermExpression* CExpressionSplitter::getFirstOptionalClassTermExpression() { if (mClassList.isEmpty()) { return nullptr; } return mClassList.first(); } CDataRangeTermExpression* CExpressionSplitter::getFirstOptionalDataRangeTermExpression() { if (mDataRangeList.isEmpty()) { return nullptr; } return mDataRangeList.first(); } CClassTermExpression* CExpressionSplitter::getSecondClassTermExpression() { return mClassList.at(1); } CObjectPropertyTermExpression* CExpressionSplitter::getFirstObjectPropertyTermExpression() { return mObjectPropertyList.first(); } CObjectPropertyTermExpression* CExpressionSplitter::getSecondObjectPropertyTermExpression() { return mObjectPropertyList.at(1); } CIndividualTermExpression* CExpressionSplitter::getFirstIndividualTermExpression() { return mIndiList.first(); } CIndividualTermExpression* CExpressionSplitter::getSecondIndividualTermExpression() { return mIndiList.at(1); } CDataPropertyTermExpression* CExpressionSplitter::getFirstDataPropertyTermExpression() { return mDataPropertyList.first(); } CDataPropertyTermExpression* CExpressionSplitter::getSecondDataPropertyTermExpression() { return mDataPropertyList.at(1); } CDataRangeTermExpression* CExpressionSplitter::getFirstDataRangeTermExpression() { return mDataRangeList.first(); } CDataRangeTermExpression* CExpressionSplitter::getSecondDataRangeTermExpression() { return mDataRangeList.at(1); } CDataLiteralExpression* CExpressionSplitter::getFirstDataLiteralExpression() { return mDataLiteralList.first(); } CDataLiteralExpression* CExpressionSplitter::getSecondDataLiteralExpression() { return mDataLiteralList.at(1); } CDatatypeExpression* CExpressionSplitter::getFirstDatatypeExpression() { return mDatatypeList.first(); } CDatatypeExpression* CExpressionSplitter::getSecondDatatypeExpression() { return mDatatypeList.at(1); } CDataFacetRestrictionExpression* CExpressionSplitter::getFirstDataFacetRestrictionExpression() { return mDataFacetRestrictionList.first(); } CDataFacetRestrictionExpression* CExpressionSplitter::getSecondDataFacetRestrictionExpression() { return mDataFacetRestrictionList.at(1); } CDataFacetExpression* CExpressionSplitter::getFirstDataFacetExpression() { return mDataFacetList.first(); } CDataFacetExpression* CExpressionSplitter::getSecondDataFacetExpression() { return mDataFacetList.at(1); } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CApproximatedSaturationCalculationJobGenerator.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CApproximatedSaturationCalculationJobGenera0000644000175000017500000000733212520550774032473 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CApproximatedSaturationCalculationJobGenerator.h" namespace Konclude { namespace Reasoner { namespace Generator { CApproximatedSaturationCalculationJobGenerator::CApproximatedSaturationCalculationJobGenerator(CConcreteOntology *ontology) { mOntology = ontology; } CApproximatedSaturationCalculationJob* CApproximatedSaturationCalculationJobGenerator::getApproximatedSaturationCalculationJob(cint64 approximationSaturationMode, CSaturationData* saturationData) { CApproximatedSaturationCalculationJob* satCalcJob = new CApproximatedSaturationCalculationJob(); satCalcJob->setContinueSaturationData(saturationData); satCalcJob->setOntology(mOntology); return satCalcJob; } CApproximatedSaturationCalculationJob* CApproximatedSaturationCalculationJobGenerator::extendApproximatedSaturationCalculationJobConstruction(CRole* role, CConcept* concept, bool conceptNegation, bool processing, CSaturationConceptReferenceLinking* satConRefLinking, CApproximatedSaturationCalculationJob* satCalcJob) { CApproximatedSaturationCalculationConstructionConstruct* satCalcConstruct = new CApproximatedSaturationCalculationConstructionConstruct(); satCalcConstruct->setConstructRole(role); satCalcConstruct->setConstructConcept(concept); satCalcConstruct->setConstructConceptNegation(conceptNegation); satCalcConstruct->setSaturationConceptReferenceLinking(satConRefLinking); satCalcConstruct->setQueueProcessing(processing); satCalcJob->addSatisfiableCalculationConstructionConstruct(satCalcConstruct); return satCalcJob; } CApproximatedSaturationCalculationJob* CApproximatedSaturationCalculationJobGenerator::extendApproximatedSaturationCalculationJobProcessing(CSaturationConceptReferenceLinking* satConRefLinking, CApproximatedSaturationCalculationJob* satCalcJob) { CApproximatedSaturationCalculationProcessingConstruct* satCalcProcConstruct = new CApproximatedSaturationCalculationProcessingConstruct(); satCalcProcConstruct->setSaturationConceptReferenceLinking(satConRefLinking); satCalcJob->addSatisfiableCalculationProcessingConstruct(satCalcProcConstruct); return satCalcJob; } CApproximatedSaturationCalculationJob* CApproximatedSaturationCalculationJobGenerator::extendApproximatedSaturationCalculationJobProcessing(CIndividual* individual, CSaturationIndividualReferenceLinking* satIndiRefLinking, CApproximatedSaturationCalculationJob* satCalcJob) { CApproximatedSaturationCalculationConstructionConstruct* satCalcConstruct = new CApproximatedSaturationCalculationConstructionConstruct(); satCalcConstruct->setIndividual(individual); satCalcConstruct->setQueueProcessing(true); satCalcConstruct->setSaturationIndividualReferenceLinking(satIndiRefLinking); satCalcJob->addSatisfiableCalculationConstructionConstruct(satCalcConstruct); return satCalcJob; } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CActiveEntitySubExpressionVisitorUpdater.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CActiveEntitySubExpressionVisitorUpdater.cp0000644000175000017500000000430412520550774032474 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CActiveEntitySubExpressionVisitorUpdater.h" namespace Konclude { namespace Reasoner { namespace Generator { CActiveEntitySubExpressionVisitorUpdater::CActiveEntitySubExpressionVisitorUpdater(CActiveEntityCountVector* countVector) { mCountVector = countVector; } bool CActiveEntitySubExpressionVisitorUpdater::updateEntitiesForAxioms(CBuildExpression* expression, bool added) { mVisitingAxiomAdded = added; return expression->visitSubExpressions(this); } bool CActiveEntitySubExpressionVisitorUpdater::visitSubExpression(CBuildExpression* expression, CBuildExpression* subExpression, CSubExpressionVisitor* visitor) { if (mCountVector) { subExpression->visitSubExpressions(this); } return true; } bool CActiveEntitySubExpressionVisitorUpdater::visitEntity(CBuildExpression* expression, CExpressionEntity* entity, CSubExpressionVisitor* visitor) { if (mCountVector) { CExpressionEntity* entityExp = entity; if (entityExp) { cint64 itemID = entityExp->getEntityID(); if (mVisitingAxiomAdded) { // increment entity occurrence mCountVector->incActiveEntityCount(entityExp); } else { // decrement entity occurrence mCountVector->decActiveEntityCount(entityExp); } } } return true; } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyUpdateCollectorBuilder.cpp0000644000175000017500000001071312520551000032403 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteOntologyUpdateCollectorBuilder.h" namespace Konclude { namespace Reasoner { namespace Generator { CConcreteOntologyUpdateCollectorBuilder::CConcreteOntologyUpdateCollectorBuilder(CConcreteOntology* updateConcreteOntology) : CConcreteOntologyBuildDataUpdater(updateConcreteOntology) { LOG(NOTICE,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("ConcretOntologyUpdateBuilder initialized."),this); } CConcreteOntologyUpdateCollectorBuilder::~CConcreteOntologyUpdateCollectorBuilder() { } bool CConcreteOntologyUpdateCollectorBuilder::initializeBuilding() { CConcreteOntologyBuildDataUpdater::initializeBuilding(); mTellAxiomSet = mOntoBuild->getTellAxiomSet(); mRetractAxiomSet = mOntoBuild->getRetractAxiomSet(); mTellUpdatedAxiomSet = mOntoBuild->getUpdatedTellAxiomSet(); mRetractUpdatedAxiomSet = mOntoBuild->getUpdatedRetractAxiomSet(); mChangeAxiomList = mOntoBuild->getChangeAxiomList(); mChangeUpdatedAxiomList = mOntoBuild->getUpdatedChangeAxiomList(); mLocTellUpdatedAxiomSet.clear(); mLocRetractUpdatedAxiomSet.clear(); mLocAddedImportOntologies.clear(); return true; } bool CConcreteOntologyUpdateCollectorBuilder::completeBuilding() { mOntoBuild->setNextAxiomNumber(mNextAxiomNumber+mNextMaxAxiomNumberOffset); mOntoBuild->setNextEntityNumber(mNextEntityNumber); FOREACHIT (CAxiomExpression* axiomExp, mLocRetractUpdatedAxiomSet) { mChangeUpdatedAxiomList->append( QPair(axiomExp,false) ); mChangeAxiomList->append( QPair(axiomExp,false) ); } FOREACHIT (CAxiomExpression* axiomExp, mLocTellUpdatedAxiomSet) { mChangeUpdatedAxiomList->append( QPair(axiomExp,true) ); mChangeAxiomList->append( QPair(axiomExp,true) ); } return true; } bool CConcreteOntologyUpdateCollectorBuilder::tellOntologyAxiom(CAxiomExpression* axiom) { if (!mTellAxiomSet->contains(axiom)) { mRetractAxiomSet->remove(axiom); mTellAxiomSet->insert(axiom); if (mLocRetractUpdatedAxiomSet.contains(axiom)) { mRetractUpdatedAxiomSet->remove(axiom); mLocRetractUpdatedAxiomSet.remove(axiom); } else { mTellUpdatedAxiomSet->insert(axiom); mLocTellUpdatedAxiomSet.insert(axiom); } } return true; } bool CConcreteOntologyUpdateCollectorBuilder::retractOntologyAxiom(CAxiomExpression* axiom) { if (mTellAxiomSet->contains(axiom)) { mTellAxiomSet->remove(axiom); mRetractAxiomSet->insert(axiom); if (mLocTellUpdatedAxiomSet.contains(axiom)) { mTellUpdatedAxiomSet->remove(axiom); mLocTellUpdatedAxiomSet.remove(axiom); } else { mRetractUpdatedAxiomSet->insert(axiom); mLocRetractUpdatedAxiomSet.insert(axiom); } } return true; } bool CConcreteOntologyUpdateCollectorBuilder::addOntologyImport(const QStringRef& name) { if (CConcreteOntologyBuildDataUpdater::addOntologyImport(name)) { mLocAddedImportOntologies.append(name.toString()); return true; } return false; } bool CConcreteOntologyUpdateCollectorBuilder::addOntologyImport(const QString& name) { if (CConcreteOntologyBuildDataUpdater::addOntologyImport(name)) { mLocAddedImportOntologies.append(name); return true; } return false; } QList CConcreteOntologyUpdateCollectorBuilder::takeAddedImportOntologyList() { QList tmpList(mLocAddedImportOntologies); mLocAddedImportOntologies.clear(); return tmpList; } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CExpressionHasher.h0000644000175000017500000000502712520551000025526 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CEXPRESSIONHASHER_H #define KONCLUDE_REASONER_GENERATOR_CEXPRESSIONHASHER_H // Libraries includes #include // Namespace includes // Other includes #include "Parser/Expressions/CClassTermExpression.h" #include "Parser/Expressions/CObjectPropertyTermExpression.h" #include "Parser/Expressions/CIndividualTermExpression.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Parser::Expression; namespace Reasoner { namespace Generator { /*! * * \class CExpressionHasher * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExpressionHasher { // public methods public: //! Constructor CExpressionHasher(CBuildExpression* expression); cint64 getExpressionHashValue() const; bool operator==(const CExpressionHasher& expressionHasher) const; // protected methods protected: // protected variables protected: CBuildExpression* mExpression; cint64 mHashValue; // private methods private: // private variables private: }; //inline bool operator==(const CExpressionHasher& expressionHasher1, const CExpressionHasher& expressionHasher2) { // return expressionHasher1.operator==(expressionHasher2); //} inline uint qHash(const CExpressionHasher& expressionHasher) { qint64 key = (qint64)expressionHasher.getExpressionHashValue(); if (sizeof(quint64) > sizeof(uint)) { return uint((key >> (8 * sizeof(uint) - 1)) ^ key); } else { return uint(key); } } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_GENERATOR_CEXPRESSIONHASHER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyEntityCollectorBuilder.h0000644000175000017500000006650612520550776032140 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CConcreteOntologyEntityCollectorBuilder_H #define KONCLUDE_REASONER_GENERATOR_CConcreteOntologyEntityCollectorBuilder_H // Libraries includes #include #include #include #include // Namespace includes #include "CConcreteOntologyBuildDataUpdater.h" #include "CExpressionSplitter.h" #include "CExpressionHasher.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CTBox.h" #include "Reasoner/Ontology/CABox.h" #include "Reasoner/Ontology/CRBox.h" #include "Reasoner/Ontology/CAbbreviatedIRIName.h" #include "Reasoner/Ontology/CIRIName.h" #include "Utilities/CTrible.hpp" #include "Utilities/CNegLinker.hpp" #include "Utilities/CHashableIntConvertedNTuble.hpp" #include "Utilities/CMemoryManager.hpp" #include "Utilities/CDynamicExpandingMemoryManager.hpp" #include "Utilities/Memory/CObjectAllocator.h" #include "Parser/COntologyBuilder.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Memory; using namespace Parser; namespace Reasoner { using namespace Ontology; namespace Generator { /*! * * \class CConcreteOntologyEntityCollectorBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteOntologyEntityCollectorBuilder : public COntologyBuilder { // public methods public: CConcreteOntologyEntityCollectorBuilder(); virtual cint64 getAxiomNumber(); virtual bool addNameAbbreviation(const QString &name, const QString &abbreviatedName); virtual QString resolveAbbreviationName(const QString& name); virtual QString resolveAbbreviationName(const QStringRef& name); virtual QString getOntologyName(); virtual CDeclarationAxiomExpression* getDeclaration(const CEXPRESSIONLIST& expressions); virtual CDeclarationAxiomExpression* getDeclaration(CBuildExpression* buildExpression); virtual CDeclarationAxiomExpression* getDeclaration(CExpressionEntity* entity); virtual bool addOntologyImport(const QStringRef& name); virtual bool addOntologyImport(const QString& name); // virtual methods from CTBoxAxiomBuilder virtual CClassExpression* getClass(const QString& className); virtual CClassExpression* getClass(const QStringRef& className); virtual CClassTermExpression* getTopClass(); virtual CClassTermExpression* getBottomClass(); virtual CDataLiteralExpression* getDataLiteral(CDataLexicalValueExpression* dataLexicalValue, CDatatypeExpression* datatype); virtual CDatatypeExpression* getDatatype(const QString& datatypeName); virtual CDatatypeExpression* getDatatype(const QStringRef& datatypeName); virtual CDataLexicalValueExpression* getDataLexicalValue(const QString& dataLexicalValue); virtual CDataLexicalValueExpression* getDataLexicalValue(const QStringRef& dataLexicalValue); virtual CDataHasValueExpression* getDataHasValue(const CEXPRESSIONLIST& expressions); virtual CDataHasValueExpression* getDataHasValue(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataSomeValuesFromExpression* getDataSomeValuesFrom(const CEXPRESSIONLIST& expressions); virtual CDataSomeValuesFromExpression* getDataSomeValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataAllValuesFromExpression* getDataAllValuesFrom(const CEXPRESSIONLIST& expressions); virtual CDataAllValuesFromExpression* getDataAllValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataIntersectionOfExpression* getDataIntersectionOf(const CEXPRESSIONLIST& expressions); virtual CDataIntersectionOfExpression* getDataIntersectionOf(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataOneOfExpression* getDataOneOf(const CEXPRESSIONLIST& expressions); virtual CDataOneOfExpression* getDataOneOf(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataUnionOfExpression* getDataUnionOf(const CEXPRESSIONLIST& expressions); virtual CDataUnionOfExpression* getDataUnionOf(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataComplementOfExpression* getDataComplementOf(const CEXPRESSIONLIST& expressions); virtual CDataComplementOfExpression* getDataComplementOf(CBuildExpression* expression); virtual CDatatypeRestrictionExpression* getDatatypeRestriction(const CEXPRESSIONLIST& expressions); virtual CDatatypeRestrictionExpression* getDatatypeRestriction(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataMaxCardinalityExpression* getDataMaxCardinality(const CEXPRESSIONLIST& expressions, int cardinality); virtual CDataMaxCardinalityExpression* getDataMaxCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality); virtual CDataMinCardinalityExpression* getDataMinCardinality(const CEXPRESSIONLIST& expressions, int cardinality); virtual CDataMinCardinalityExpression* getDataMinCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality); virtual CDataExactCardinalityExpression* getDataExactCardinality(const CEXPRESSIONLIST& expressions, int cardinality); virtual CDataExactCardinalityExpression* getDataExactCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality); virtual CDataHasValueExpression* getDataHasValue(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2); virtual CDataSomeValuesFromExpression* getDataSomeValuesFrom(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2); virtual CDataAllValuesFromExpression* getDataAllValuesFrom(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2); virtual CDataIntersectionOfExpression* getDataIntersectionOf(const CEXPRESSIONLIST& expressions); virtual CDataOneOfExpression* getDataOneOf(const CEXPRESSIONLIST& expressions); virtual CDataUnionOfExpression* getDataUnionOf(const CEXPRESSIONLIST& expressions); virtual CDataComplementOfExpression* getDataComplementOf(CDataRangeTermExpression* expressions); virtual CDatatypeRestrictionExpression* getDatatypeRestriction(CDatatypeExpression* datatypeExpression, const CEXPRESSIONLIST& expressions); virtual CDataMaxCardinalityExpression* getDataMaxCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality); virtual CDataMinCardinalityExpression* getDataMinCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality); virtual CDataExactCardinalityExpression* getDataExactCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality); virtual CDataRangeTermExpression* getTopDataRange(); virtual CDataRangeTermExpression* getBottomDataRange(); virtual CDataFacetExpression* getDataFacet(const QString& dataFacetIRI); virtual CDataFacetExpression* getDataFacet(const QStringRef& dataFacetIRI); virtual CDataFacetRestrictionExpression* getDataFacetRestriction(CDataLiteralExpression* dataLiteralExpression, CDataFacetExpression* dataFacet); virtual CDataFacetRestrictionExpression* getDataFacetRestriction(const CEXPRESSIONLIST& expressions); virtual CDataFacetRestrictionExpression* getDataFacetRestriction(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataPropertyAssertionExpression* getDataPropertyAssertion(const CEXPRESSIONLIST& expressions); virtual CDataPropertyAssertionExpression* getDataPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3); virtual CNegativeDataPropertyAssertionExpression* getNegativeDataPropertyAssertion(const CEXPRESSIONLIST& expressions); virtual CNegativeDataPropertyAssertionExpression* getNegativeDataPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3); virtual CDataPropertyAssertionExpression* getDataPropertyAssertion(CIndividualTermExpression* expression1, CDataLiteralExpression* expression2, CDataPropertyTermExpression* expression3); virtual CNegativeDataPropertyAssertionExpression* getNegativeDataPropertyAssertion(CIndividualTermExpression* expression1, CDataLiteralExpression* expression2, CDataPropertyTermExpression* expression3); virtual CDataPropertyExpression* getDataProberty(const QString& dataPropertyName); virtual CDataPropertyExpression* getDataProberty(const QStringRef& dataPropertyName); virtual CObjectIndividualVariableExpression* getIndividualVariable(const QString &individualVariableName, cint64 axiomNumber); virtual CObjectIndividualVariableExpression* getIndividualVariable(const QStringRef &individualVariableName, cint64 axiomNumber); virtual CEquivalentClassesExpression* getEquivalentClasses(const CEXPRESSIONLIST& expressions); virtual CEquivalentClassesExpression* getEquivalentClasses(CBuildExpression* expression1, CBuildExpression* expression2); virtual CSubClassOfExpression* getSubClassOf(const CEXPRESSIONLIST& expressions); virtual CSubClassOfExpression* getSubClassOf(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDisjointClassesExpression* getDisjointClasses(const CEXPRESSIONLIST& expressions); virtual CDisjointUnionExpression *getDisjointUnion(const CEXPRESSIONLIST &expressions); virtual CObjectComplementOfExpression* getObjectComplementOf(CBuildExpression* expression); virtual CObjectComplementOfExpression* getObjectComplementOf(const CEXPRESSIONLIST& expressions); virtual CObjectIntersectionOfExpression* getObjectIntersectionOf(const CEXPRESSIONLIST& expressions); virtual CObjectUnionOfExpression* getObjectUnionOf(const CEXPRESSIONLIST& expressions); virtual CObjectMaxCardinalityExpression* getObjectMaxCardinality(const CEXPRESSIONLIST& expressions, int cardinality); virtual CObjectMaxCardinalityExpression* getObjectMaxCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality); virtual CObjectMinCardinalityExpression* getObjectMinCardinality(const CEXPRESSIONLIST& expressions, int cardinality); virtual CObjectMinCardinalityExpression* getObjectMinCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality); virtual CObjectExactlyCardinalityExpression* getObjectExactlyCardinality(const CEXPRESSIONLIST& expressions, int cardinality); virtual CObjectExactlyCardinalityExpression* getObjectExactlyCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality); virtual CObjectAllValuesFromExpression* getObjectAllValuesFrom(const CEXPRESSIONLIST& expressions); virtual CObjectAllValuesFromExpression* getObjectAllValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2); virtual CObjectSomeValuesFromExpression* getObjectSomeValuesFrom(const CEXPRESSIONLIST& expressions); virtual CObjectSomeValuesFromExpression* getObjectSomeValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2); virtual CObjectOneOfExpression *getObjectOneOf(const CEXPRESSIONLIST &expressions); virtual CObjectOneOfExpression *getObjectOneOf(CBuildExpression *expression); virtual CObjectHasValueExpression *getObjectHasValue(const CEXPRESSIONLIST &expressions); virtual CObjectHasValueExpression *getObjectHasValue(CBuildExpression *expression1, CBuildExpression *expression2); virtual CObjectHasSelfExpression *getObjectHasSelf(const CEXPRESSIONLIST &expressions); virtual CObjectHasSelfExpression *getObjectHasSelf(CBuildExpression *expression); virtual CEquivalentClassesExpression* getEquivalentClasses(const CEXPRESSIONLIST& expressions); virtual CSubClassOfExpression* getSubClassOf(CClassTermExpression* expression1, CClassTermExpression* expression2); virtual CDisjointClassesExpression* getDisjointClasses(const CEXPRESSIONLIST& expressions); virtual CDisjointUnionExpression *getDisjointUnion(CClassExpression* classExpression, const CEXPRESSIONLIST& expressions); virtual CObjectComplementOfExpression* getObjectComplementOf(CClassTermExpression* expression); virtual CObjectIntersectionOfExpression* getObjectIntersectionOf(const CEXPRESSIONLIST& expressions); virtual CObjectUnionOfExpression* getObjectUnionOf(const CEXPRESSIONLIST& expressions); virtual CObjectMaxCardinalityExpression* getObjectMaxCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality); virtual CObjectMinCardinalityExpression* getObjectMinCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality); virtual CObjectExactlyCardinalityExpression* getObjectExactlyCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality); virtual CObjectAllValuesFromExpression* getObjectAllValuesFrom(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2); virtual CObjectSomeValuesFromExpression* getObjectSomeValuesFrom(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2); virtual CObjectOneOfExpression *getObjectOneOf(const CEXPRESSIONLIST &expressions); virtual CObjectOneOfExpression *getObjectOneOf(CIndividualTermExpression* expression); virtual CObjectHasValueExpression *getObjectHasValue(CObjectPropertyTermExpression *expression1, CIndividualTermExpression *expression2); virtual CObjectHasSelfExpression *getObjectHasSelf(CObjectPropertyTermExpression *expression); // virtual methods from CRBoxAxiomBuilder virtual CObjectPropertyExpression* getObjectProberty(const QString& probertyName); virtual CObjectPropertyExpression* getObjectProberty(const QStringRef& probertyName); virtual CObjectPropertyTermExpression* getTopObjectProberty(); virtual CSubObjectPropertyOfExpression* getSubObjectPropertyOf(const CEXPRESSIONLIST& expressions); virtual CSubObjectPropertyOfExpression* getSubObjectPropertyOf(CBuildExpression* expression1, CBuildExpression* expression2); virtual CObjectPropertyDomainExpression* getObjectPropertyDomainExpression(CBuildExpression* expression1, CBuildExpression* expression2); virtual CObjectPropertyDomainExpression* getObjectPropertyDomainExpression(const CEXPRESSIONLIST& expressions); virtual CObjectPropertyRangeExpression* getObjectPropertyRangeExpression(CBuildExpression* expression1, CBuildExpression* expression2); virtual CObjectPropertyRangeExpression* getObjectPropertyRangeExpression(const CEXPRESSIONLIST& expressions); virtual CInverseObjectPropertiesExpression* getInverseObjectProperties(const CEXPRESSIONLIST& expressions); virtual CInverseObjectPropertiesExpression* getInverseObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2); virtual CTransetiveObjectPropertyExpression* getTransetiveObjectProperty(const CEXPRESSIONLIST& expressions); virtual CTransetiveObjectPropertyExpression* getTransetiveObjectProperty(CBuildExpression* expression); virtual CFunctionalObjectPropertyExpression* getFunctionalObjectProperty(const CEXPRESSIONLIST& expressions); virtual CFunctionalObjectPropertyExpression* getFunctionalObjectProperty(CBuildExpression* expression); virtual CInverseFunctionalObjectPropertyExpression* getInverseFunctionalObjectProperty(const CEXPRESSIONLIST& expressions); virtual CInverseFunctionalObjectPropertyExpression* getInverseFunctionalObjectProperty(CBuildExpression* expression); virtual CInverseObjectPropertyOfExpression* getInverseObjectPropertyOf(const CEXPRESSIONLIST& expressions); virtual CInverseObjectPropertyOfExpression* getInverseObjectPropertyOf(CBuildExpression* expression); virtual CObjectPropertyChainExpression* getObjectPropertyChain(const CEXPRESSIONLIST& expressions); virtual CObjectPropertyChainExpression* getObjectPropertyChain(CBuildExpression* expression1, CBuildExpression* expression2); virtual CEquivalentObjectPropertiesExpression* getEquivalentObjectProperties(const CEXPRESSIONLIST& expressions); virtual CEquivalentObjectPropertiesExpression* getEquivalentObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDisjointObjectPropertiesExpression* getDisjointObjectProperties(const CEXPRESSIONLIST& expressions); virtual CDisjointObjectPropertiesExpression* getDisjointObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2); virtual CSymmetricObjectPropertyExpression* getSymmetricObjectProperty(const CEXPRESSIONLIST& expressions); virtual CSymmetricObjectPropertyExpression* getSymmetricObjectProperty(CBuildExpression* expression); virtual CAsymmetricObjectPropertyExpression* getAsymmetricObjectProperty(const CEXPRESSIONLIST& expressions); virtual CAsymmetricObjectPropertyExpression* getAsymmetricObjectProperty(CBuildExpression* expression); virtual CReflexiveObjectPropertyExpression* getReflexiveObjectProperty(const CEXPRESSIONLIST& expressions); virtual CReflexiveObjectPropertyExpression* getReflexiveObjectProperty(CBuildExpression* expression); virtual CIrreflexiveObjectPropertyExpression* getIrreflexiveObjectProperty(const CEXPRESSIONLIST& expressions); virtual CIrreflexiveObjectPropertyExpression* getIrreflexiveObjectProperty(CBuildExpression* expression); virtual CSubObjectPropertyOfExpression* getSubObjectPropertyOf(const CEXPRESSIONLIST& expressions, CObjectPropertyTermExpression* expression); virtual CObjectPropertyDomainExpression* getObjectPropertyDomainExpression(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2); virtual CObjectPropertyRangeExpression* getObjectPropertyRangeExpression(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2); virtual CInverseObjectPropertiesExpression* getInverseObjectProperties(CObjectPropertyTermExpression* expression1, CObjectPropertyTermExpression* expression2); virtual CTransetiveObjectPropertyExpression* getTransetiveObjectProperty(CObjectPropertyTermExpression* expression); virtual CFunctionalObjectPropertyExpression* getFunctionalObjectProperty(CObjectPropertyTermExpression* expression); virtual CInverseFunctionalObjectPropertyExpression* getInverseFunctionalObjectProperty(CObjectPropertyTermExpression* expression); virtual CInverseObjectPropertyOfExpression* getInverseObjectPropertyOf(CObjectPropertyTermExpression* expression); virtual CSubObjectPropertyOfExpression* getSubObjectPropertyOf(CObjectPropertyChainExpression* expressions, CObjectPropertyTermExpression* expression); virtual CObjectPropertyChainExpression* getObjectPropertyChain(const CEXPRESSIONLIST& expressions); virtual CEquivalentObjectPropertiesExpression* getEquivalentObjectProperties(const CEXPRESSIONLIST& expressions); virtual CDisjointObjectPropertiesExpression* getDisjointObjectProperties(const CEXPRESSIONLIST& expressions); virtual CSymmetricObjectPropertyExpression* getSymmetricObjectProperty(CObjectPropertyTermExpression* expression); virtual CAsymmetricObjectPropertyExpression* getAsymmetricObjectProperty(CObjectPropertyTermExpression* expression); virtual CReflexiveObjectPropertyExpression* getReflexiveObjectProperty(CObjectPropertyTermExpression* expression); virtual CIrreflexiveObjectPropertyExpression* getIrreflexiveObjectProperty(CObjectPropertyTermExpression* expression); CObjectPropertyTermExpression* getCorrectedInverseObjectPropertyOf(CObjectPropertyTermExpression* expression); virtual CSubDataPropertyOfExpression* getSubDataPropertyOf(const CEXPRESSIONLIST& expressions); virtual CSubDataPropertyOfExpression* getSubDataPropertyOf(CBuildExpression* expression1, CBuildExpression* expression2); virtual CEquivalentDataPropertiesExpression* getEquivalentDataProperties(const CEXPRESSIONLIST& expressions); virtual CEquivalentDataPropertiesExpression* getEquivalentDataProperties(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDisjointDataPropertiesExpression* getDisjointDataProperties(const CEXPRESSIONLIST& expressions); virtual CDisjointDataPropertiesExpression* getDisjointDataProperties(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataPropertyDomainExpression* getDataPropertyDomainExpression(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataPropertyDomainExpression* getDataPropertyDomainExpression(const CEXPRESSIONLIST& expressions); virtual CDataPropertyRangeExpression* getDataPropertyRangeExpression(CBuildExpression* expression1, CBuildExpression* expression2); virtual CDataPropertyRangeExpression* getDataPropertyRangeExpression(const CEXPRESSIONLIST& expressions); virtual CFunctionalDataPropertyExpression* getFunctionalDataProperty(const CEXPRESSIONLIST& expressions); virtual CFunctionalDataPropertyExpression* getFunctionalDataProperty(CBuildExpression* expression); virtual CSubDataPropertyOfExpression* getSubDataPropertyOf(CDataPropertyTermExpression* expression1, CDataPropertyTermExpression* expression2); virtual CEquivalentDataPropertiesExpression* getEquivalentDataProperties(const CEXPRESSIONLIST& expressions); virtual CDisjointDataPropertiesExpression* getDisjointDataProperties(const CEXPRESSIONLIST& expressions); virtual CDataPropertyDomainExpression* getDataPropertyDomainExpression(CDataPropertyTermExpression* expression1, CClassTermExpression* expression2); virtual CDataPropertyRangeExpression* getDataPropertyRangeExpression(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2); virtual CFunctionalDataPropertyExpression* getFunctionalDataProperty(CDataPropertyTermExpression* expression); // virtual methods from CABoxAxiomBuilder virtual CNamedIndividualExpression* getNamedIndividual(const QString& individualName); virtual CNamedIndividualExpression* getNamedIndividual(const QStringRef& individualName); virtual CAnonymousIndividualExpression* getAnonymousIndividual(const QString& ontologyName, const QString& individualName); virtual CAnonymousIndividualExpression* getAnonymousIndividual(const QStringRef& ontologyName, const QStringRef& individualName); virtual CClassAssertionExpression* getClassAssertion(const CEXPRESSIONLIST& expressions); virtual CClassAssertionExpression* getClassAssertion(CBuildExpression* expression1, CBuildExpression* expression2); virtual CObjectPropertyAssertionExpression* getObjectPropertyAssertion(const CEXPRESSIONLIST& expressions); virtual CObjectPropertyAssertionExpression* getObjectPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3); virtual CNegativeObjectPropertyAssertionExpression* getNegativeObjectPropertyAssertion(const CEXPRESSIONLIST& expressions); virtual CNegativeObjectPropertyAssertionExpression* getNegativeObjectPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3); virtual CSameIndividualExpression* getSameIndividual(const CEXPRESSIONLIST& expressions); virtual CDifferentIndividualsExpression* getDifferentIndividuals(const CEXPRESSIONLIST& expressions); virtual CClassAssertionExpression* getClassAssertion(CIndividualTermExpression* expression1, CClassTermExpression* expression2); virtual CObjectPropertyAssertionExpression* getObjectPropertyAssertion(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2, CObjectPropertyTermExpression* expression3); virtual CNegativeObjectPropertyAssertionExpression* getNegativeObjectPropertyAssertion(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2, CObjectPropertyTermExpression* expression3); virtual CSameIndividualExpression* getSameIndividual(const CEXPRESSIONLIST& expressions); virtual CDifferentIndividualsExpression* getDifferentIndividuals(const CEXPRESSIONLIST& expressions); virtual bool tellOntologyAxiom(CAxiomExpression* axiom); virtual bool retractOntologyAxiom(CAxiomExpression* axiom); QSet* getClassNameSet(); QSet* getObjectPropertyNameSet(); QSet* getDataPropertyNameSet(); QSet* getIndividualNameSet(); QSet* getVariableNameSet(); // protected functions protected: // protected variables protected: QSet mClassNameSet; QSet mObjectPropertyNameSet; QSet mDataPropertyNameSet; QSet mIndividualNameSet; QSet mAnonymousIndividualNameSet; QSet mVariableNameSet; QHash mAbbreviationsResolveHash; }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_GENERATOR_CConcreteOntologyEntityCollectorBuilder_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CQueryGenerator.cpp0000644000175000017500000000211012520551000025531 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGenerator.h" namespace Konclude { namespace Reasoner { namespace Generator { CQueryGenerator::CQueryGenerator() { } CQueryGenerator::~CQueryGenerator() { } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/GeneratorSettings.h0000644000175000017500000000263012520551002025577 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_GENERATORSETTINGS #define KONCLUDE_REASONER_GENERATOR_GENERATORSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Reasoner { namespace Generator { /*! * * \file GeneratorSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_GENERATOR_GENERATORSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CStringRefStringHasher.cpp0000644000175000017500000000467512520551002027026 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CStringRefStringHasher.h" namespace Konclude { namespace Reasoner { namespace Generator { CStringRefStringHasher::CStringRefStringHasher() { mReferenceOnly = false; } CStringRefStringHasher::CStringRefStringHasher(const QString& string) { mReferenceOnly = false; mString = string; } CStringRefStringHasher::CStringRefStringHasher(const QStringRef& stringRef) { mReferenceOnly = true; mStringRef = stringRef; } bool CStringRefStringHasher::isReferenceOnly() const { return mReferenceOnly; } bool CStringRefStringHasher::isEmpty() const { if (mReferenceOnly) { return mStringRef.isEmpty(); } else { return mString.isEmpty(); } } const QString& CStringRefStringHasher::getString() const { return mString; } const QStringRef& CStringRefStringHasher::getStringRef() const { return mStringRef; } QStringRef CStringRefStringHasher::toStringRefernce() const { if (mReferenceOnly) { return mStringRef; } else { return mString.leftRef(-1); } } bool CStringRefStringHasher::operator==(const CStringRefStringHasher& other) const { if (mReferenceOnly && other.mReferenceOnly) { return mStringRef == other.mStringRef; } else if (mReferenceOnly && !other.mReferenceOnly) { return mStringRef == other.mString; } else if (!mReferenceOnly && other.mReferenceOnly) { return other.mStringRef == mString; } else if (!mReferenceOnly && !other.mReferenceOnly) { return mString == other.mString; } return false; } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyMergingBuilder.h0000644000175000017500000003377412520550776030406 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CConcreteOntologyMergingBuilder_H #define KONCLUDE_REASONER_GENERATOR_CConcreteOntologyMergingBuilder_H // Libraries includes #include #include #include #include #include // Namespace includes #include "CConcreteOntologyBuildDataUpdater.h" #include "CExpressionSplitter.h" #include "CExpressionHasher.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CTBox.h" #include "Reasoner/Ontology/CABox.h" #include "Reasoner/Ontology/CRBox.h" #include "Reasoner/Ontology/CAbbreviatedIRIName.h" #include "Reasoner/Ontology/CIRIName.h" #include "Utilities/CTrible.hpp" #include "Utilities/CNegLinker.hpp" #include "Utilities/CHashableIntConvertedNTuble.hpp" #include "Utilities/CMemoryManager.hpp" #include "Utilities/CDynamicExpandingMemoryManager.hpp" #include "Utilities/Memory/CObjectAllocator.h" #include "Parser/COntologyBuilder.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Memory; using namespace Parser; namespace Reasoner { using namespace Ontology; namespace Generator { class CConcreteOntologyMergingBuilder; class CMergeExpressionStackObject; typedef void (CConcreteOntologyMergingBuilder::*FStartMergeExpressionFunction) (CMergeExpressionStackObject* mergeStackObj); typedef void (CConcreteOntologyMergingBuilder::*FEndMergeExpressionFunction) (CMergeExpressionStackObject* mergeStackObj); class CMergeExpressionStackObject { public: inline CMergeExpressionStackObject(CBuildExpression* expression) : mExpression(expression) { } inline CMergeExpressionStackObject* addProcessingBuildExpression(CBuildExpression* buildExpression) { mProcessingExpList.append(buildExpression); return this; } inline CMergeExpressionStackObject* addProcessingBuildExpressions(CQtList* expressions) { if (mProcessingExpList.isEmpty()) { mProcessingExpList = *expressions; } else { mProcessingExpList.append(*expressions); } return this; } inline CMergeExpressionStackObject* addReplacedBuildExpression(CBuildExpression* buildExpression) { mReplacedExpList.append(buildExpression); return this; } inline CMergeExpressionStackObject* addReplacedBuildExpressions(CQtList* expressions) { if (mReplacedExpList.isEmpty()) { mReplacedExpList = *expressions; } else { mReplacedExpList.append(*expressions); } return this; } inline bool hasProcessingExpressions() { return !mProcessingExpList.isEmpty(); } inline bool hasReplacedExpressions() { return !mReplacedExpList.isEmpty(); } inline CQtList* getProcessingExpressions() { return &mProcessingExpList; } inline CQtList* getReplacedExpressions() { return &mReplacedExpList; } FStartMergeExpressionFunction mStartFunction; FEndMergeExpressionFunction mEndFunction; CBuildExpression* mExpression; CBuildExpression* mReplaceExpression; CQtList mProcessingExpList; CQtList mReplacedExpList; }; /*! * * \class CConcreteOntologyMergingBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteOntologyMergingBuilder : public CConcreteOntologyBuildDataUpdater { // public methods public: CConcreteOntologyMergingBuilder(CConcreteOntology* baseConcreteOntology, CConcreteOntology* mergingConcreteOntology, CConcreteOntology* prevConcreteOntology); virtual ~CConcreteOntologyMergingBuilder(); virtual bool initializeBuilding(); virtual bool completeBuilding(); virtual bool mergingBuilding(); virtual bool tellOntologyAxiom(CAxiomExpression* axiom); virtual bool retractOntologyAxiom(CAxiomExpression* axiom); void addExpressions(CMergeExpressionStackObject* mergeStackObj, CEXPRESSIONLIST* expressionList); void addExpressions(CMergeExpressionStackObject* mergeStackObj, CEXPRESSIONLIST* expressionList); void addExpressions(CMergeExpressionStackObject* mergeStackObj, CEXPRESSIONLIST* expressionList); void addExpressions(CMergeExpressionStackObject* mergeStackObj, CEXPRESSIONLIST* expressionList); void addExpressions(CMergeExpressionStackObject* mergeStackObj, CBuildExpression* expression); void parseClassStart(CMergeExpressionStackObject* mergeStackObj); void parseIndividualVariableStart(CMergeExpressionStackObject* mergeStackObj); void parseEquivalentClassesStart(CMergeExpressionStackObject* mergeStackObj); void parseSubClassOfStart(CMergeExpressionStackObject* mergeStackObj); void parseDisjointClassesStart(CMergeExpressionStackObject* mergeStackObj); void parseDisjointUnionStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectComplementOfStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectIntersectionOfStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectUnionOfStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectMaxCardinalityStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectMinCardinalityStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectExactlyCardinalityStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectAllValuesFromStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectSomeValuesFromStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectOneOfStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectHasValueStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectHasSelfStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectProbertyStart(CMergeExpressionStackObject* mergeStackObj); void parseSubObjectPropertyOfStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectPropertyDomainStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectPropertyRangeStart(CMergeExpressionStackObject* mergeStackObj); void parseInverseObjectPropertiesStart(CMergeExpressionStackObject* mergeStackObj); void parseTransetiveObjectPropertyStart(CMergeExpressionStackObject* mergeStackObj); void parseFunctionalObjectPropertyStart(CMergeExpressionStackObject* mergeStackObj); void parseInverseFunctionalObjectPropertyStart(CMergeExpressionStackObject* mergeStackObj); void parseInverseObjectPropertyOfStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectPropertyChainStart(CMergeExpressionStackObject* mergeStackObj); void parseEquivalentObjectPropertiesStart(CMergeExpressionStackObject* mergeStackObj); void parseDisjointObjectPropertiesStart(CMergeExpressionStackObject* mergeStackObj); void parseSymmetricObjectPropertyStart(CMergeExpressionStackObject* mergeStackObj); void parseAsymmetricObjectPropertyStart(CMergeExpressionStackObject* mergeStackObj); void parseReflexiveObjectPropertyStart(CMergeExpressionStackObject* mergeStackObj); void parseIrreflexiveObjectPropertyStart(CMergeExpressionStackObject* mergeStackObj); void parseNamedIndividualStart(CMergeExpressionStackObject* mergeStackObj); void parseAnonymousIndividualStart(CMergeExpressionStackObject* mergeStackObj); void parseClassAssertionStart(CMergeExpressionStackObject* mergeStackObj); void parseObjectPropertyAssertionStart(CMergeExpressionStackObject* mergeStackObj); void parseNegativeObjectPropertyAssertionStart(CMergeExpressionStackObject* mergeStackObj); void parseSameIndividualStart(CMergeExpressionStackObject* mergeStackObj); void parseDifferentIndividualsStart(CMergeExpressionStackObject* mergeStackObj); void parseClassEnd(CMergeExpressionStackObject* mergeStackObj); void parseIndividualVariableEnd(CMergeExpressionStackObject* mergeStackObj); void parseEquivalentClassesEnd(CMergeExpressionStackObject* mergeStackObj); void parseSubClassOfEnd(CMergeExpressionStackObject* mergeStackObj); void parseDisjointClassesEnd(CMergeExpressionStackObject* mergeStackObj); void parseDisjointUnionEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectComplementOfEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectIntersectionOfEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectUnionOfEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectMaxCardinalityEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectMinCardinalityEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectExactlyCardinalityEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectAllValuesFromEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectSomeValuesFromEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectOneOfEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectHasValueEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectHasSelfEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectProbertyEnd(CMergeExpressionStackObject* mergeStackObj); void parseSubObjectPropertyOfEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectPropertyDomainEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectPropertyRangeEnd(CMergeExpressionStackObject* mergeStackObj); void parseInverseObjectPropertiesEnd(CMergeExpressionStackObject* mergeStackObj); void parseTransetiveObjectPropertyEnd(CMergeExpressionStackObject* mergeStackObj); void parseFunctionalObjectPropertyEnd(CMergeExpressionStackObject* mergeStackObj); void parseInverseFunctionalObjectPropertyEnd(CMergeExpressionStackObject* mergeStackObj); void parseInverseObjectPropertyOfEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectPropertyChainEnd(CMergeExpressionStackObject* mergeStackObj); void parseEquivalentObjectPropertiesEnd(CMergeExpressionStackObject* mergeStackObj); void parseDisjointObjectPropertiesEnd(CMergeExpressionStackObject* mergeStackObj); void parseSymmetricObjectPropertyEnd(CMergeExpressionStackObject* mergeStackObj); void parseAsymmetricObjectPropertyEnd(CMergeExpressionStackObject* mergeStackObj); void parseReflexiveObjectPropertyEnd(CMergeExpressionStackObject* mergeStackObj); void parseIrreflexiveObjectPropertyEnd(CMergeExpressionStackObject* mergeStackObj); void parseNamedIndividualEnd(CMergeExpressionStackObject* mergeStackObj); void parseAnonymousIndividualEnd(CMergeExpressionStackObject* mergeStackObj); void parseClassAssertionEnd(CMergeExpressionStackObject* mergeStackObj); void parseObjectPropertyAssertionEnd(CMergeExpressionStackObject* mergeStackObj); void parseNegativeObjectPropertyAssertionEnd(CMergeExpressionStackObject* mergeStackObj); void parseSameIndividualEnd(CMergeExpressionStackObject* mergeStackObj); void parseDifferentIndividualsEnd(CMergeExpressionStackObject* mergeStackObj); // protected functions protected: virtual CMergeExpressionStackObject* createMergeExpressionStackObject(CBuildExpression* expression); virtual CBuildExpression* handleMergeEpxressionStack(CBuildExpression* expression); virtual CConcreteOntologyMergingBuilder* initJumpingHash(); // protected variables protected: QStack mMergeExpStack; QList mMergeExpList; QList mMergeExpContainer; class CMergeExpressionFunctionPair { public: CMergeExpressionFunctionPair() { mStartFunction = nullptr; mEndFunction = nullptr; } CMergeExpressionFunctionPair(FStartMergeExpressionFunction startFunction, FEndMergeExpressionFunction endFunction) { mStartFunction = startFunction; mEndFunction = endFunction; } FStartMergeExpressionFunction mStartFunction; FEndMergeExpressionFunction mEndFunction; }; CQtHash mMergeExpFunctionJumpHash; CConcreteOntology* mBaseConcreteOntology; CConcreteOntology* mMergingConcreteOntology; CConcreteOntology* mPrevConcreteOntology; CONTOLOGYAXIOMLIST< QPair > mMergeChangeAxiomList; CMAPPINGLIST mMergePrefixList; // contains also previous ontology data CONTOLOGYAXIOMSET* mTellAxiomSet; CONTOLOGYAXIOMSET* mRetractAxiomSet; CONTOLOGYAXIOMLIST< QPair >* mChangeAxiomList; // contains only updated data CONTOLOGYAXIOMSET* mTellUpdatedAxiomSet; CONTOLOGYAXIOMSET* mRetractUpdatedAxiomSet; CONTOLOGYAXIOMLIST< QPair >* mChangeUpdatedAxiomList; }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_GENERATOR_CConcreteOntologyMergingBuilder_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CSatisfiableCalculationJobGenerator.h0000644000175000017500000000572212520551000031145 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CSATISFIABLECALCULATIONJOBGENERATOR_H #define KONCLUDE_REASONER_GENERATOR_CSATISFIABLECALCULATIONJOBGENERATOR_H // Libraries includes // Namespace includes // Other includes #include "Reasoner/Query/CSatisfiableCalculationJob.h" #include "Reasoner/Query/CSatisfiableCalculationConceptConstruct.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Query; namespace Generator { /*! * * \class CSatisfiableCalculationJobGenerator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCalculationJobGenerator { // public methods public: //! Constructor CSatisfiableCalculationJobGenerator(CConcreteOntology *ontology); //! Destructor virtual ~CSatisfiableCalculationJobGenerator(); CSatisfiableCalculationJob* getSatisfiableCalculationJob(CConcept* concept, bool negation = false, CIndividual* individual = nullptr, CSatisfiableCalculationJob* satCalcJob = nullptr); CSatisfiableCalculationJob* getSatisfiableCalculationJob(CConcept* concept1, bool negation1, CConcept* concept2, bool negation2, CIndividual* individual = nullptr, CSatisfiableCalculationJob* satCalcJob = nullptr); CSatisfiableCalculationJob* getSatisfiableCalculationJob(const QList& conceptList, CIndividual* individual = nullptr, CSatisfiableCalculationJob* satCalcJob = nullptr); CSatisfiableCalculationJob* getSatisfiableCalculationJob(const QList< QPair >& conceptNegationList, CIndividual* individual = nullptr, CSatisfiableCalculationJob* satCalcJob = nullptr); CSatisfiableCalculationJob* getSatisfiableCalculationJob(const QList< CIndividual* >& indiList, CSatisfiableCalculationJob* satCalcJob = nullptr); // protected methods protected: // protected variables protected: CConcreteOntology *mOntology; // private methods private: // private variables private: }; }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_GENERATOR_CSATISFIABLECALCULATIONJOBGENERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CStringRefStringHasher.h0000644000175000017500000000462012520551002026461 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_HASHER_CSTRINGREFSTRINGHASHER_H #define KONCLUDE_UTILITIES_HASHER_CSTRINGREFSTRINGHASHER_H // Libraries includes #include #include // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Generator { /*! * * \class CStringRefStringHasher * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CStringRefStringHasher { // public methods public: //! Constructor CStringRefStringHasher(); CStringRefStringHasher(const QString& string); CStringRefStringHasher(const QStringRef& stringRef); bool isReferenceOnly() const; bool isEmpty() const; const QString& getString() const; const QStringRef& getStringRef() const; QStringRef toStringRefernce() const; bool operator==(const CStringRefStringHasher& other) const; // protected methods protected: // protected variables protected: bool mReferenceOnly; QString mString; QStringRef mStringRef; // private methods private: // private variables private: }; inline uint qHash(const CStringRefStringHasher& stringRefStringHasher) { if (stringRefStringHasher.isReferenceOnly()) { return qHash(stringRefStringHasher.getStringRef()); } else { return qHash(stringRefStringHasher.getString()); } } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_HASHER_CSTRINGREFSTRINGHASHER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Generator/CConcreteOntologyBuildDataUpdater.cpp0000644000175000017500000043202612520550774031207 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteOntologyBuildDataUpdater.h" namespace Konclude { namespace Reasoner { namespace Generator { CConcreteOntologyBuildDataUpdater::CConcreteOntologyBuildDataUpdater(CConcreteOntology* updateConcreteOntology) { mOnto = updateConcreteOntology; } CDeclarationAxiomExpression* CConcreteOntologyBuildDataUpdater::getDeclaration(const CEXPRESSIONLIST& expressions) { FOREACHIT (CBuildExpression* buildExpression, expressions) { CClassExpression* classExpr = dynamic_cast(buildExpression); if (classExpr) { return getDeclaration((CExpressionEntity*)classExpr); } CObjectPropertyExpression* propertyExp = dynamic_cast(buildExpression); if (propertyExp) { return getDeclaration((CExpressionEntity*)propertyExp); } CNamedIndividualExpression* indiExp = dynamic_cast(buildExpression); if (indiExp) { return getDeclaration((CExpressionEntity*)indiExp); } CDataPropertyExpression* dataPropExp = dynamic_cast(buildExpression); if (dataPropExp) { return getDeclaration((CExpressionEntity*)dataPropExp); } CDatatypeExpression* datatypeExp = dynamic_cast(buildExpression); if (datatypeExp) { return getDeclaration((CExpressionEntity*)datatypeExp); } } LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'Declaration'-Expression."),this); return nullptr; } CDeclarationAxiomExpression* CConcreteOntologyBuildDataUpdater::getDeclaration(CBuildExpression* buildExpression) { if (buildExpression) { CClassExpression* classExpr = dynamic_cast(buildExpression); if (classExpr) { return getDeclaration((CExpressionEntity*)classExpr); } CObjectPropertyExpression* propertyExp = dynamic_cast(buildExpression); if (propertyExp) { return getDeclaration((CExpressionEntity*)propertyExp); } CNamedIndividualExpression* indiExp = dynamic_cast(buildExpression); if (indiExp) { return getDeclaration((CExpressionEntity*)indiExp); } CDataPropertyExpression* dataPropExp = dynamic_cast(buildExpression); if (dataPropExp) { return getDeclaration((CExpressionEntity*)dataPropExp); } CDatatypeExpression* datatypeExp = dynamic_cast(buildExpression); if (datatypeExp) { return getDeclaration((CExpressionEntity*)datatypeExp); } } LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'Declaration'-Expression."),this); return nullptr; } CEquivalentClassesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentClasses(const CEXPRESSIONLIST& expressions) { CEquivalentClassesExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(2)) { expression = getEquivalentClasses(*expSplitter.getClassTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'EquivalentClasses'-Expression."),this); } return expression; } CEquivalentClassesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentClasses(CBuildExpression* expression1, CBuildExpression* expression2) { CEquivalentClassesExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(2)) { expression = getEquivalentClasses(*expSplitter.getClassTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'EquivalentClasses'-Expression."),this); } return expression; } CSubClassOfExpression* CConcreteOntologyBuildDataUpdater::getSubClassOf(const CEXPRESSIONLIST& expressions) { CSubClassOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(2)) { expression = getSubClassOf(expSplitter.getFirstClassTermExpression(),expSplitter.getSecondClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SubClassOf'-Expression."),this); } return expression; } CSubClassOfExpression* CConcreteOntologyBuildDataUpdater::getSubClassOf(CBuildExpression* expression1, CBuildExpression* expression2) { CSubClassOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(2)) { expression = getSubClassOf(expSplitter.getFirstClassTermExpression(),expSplitter.getSecondClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SubClassOf'-Expression."),this); } return expression; } CDisjointClassesExpression* CConcreteOntologyBuildDataUpdater::getDisjointClasses(const CEXPRESSIONLIST& expressions) { CDisjointClassesExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(2)) { expression = getDisjointClasses(*expSplitter.getClassTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DisjointClasses'-Expression."),this); } return expression; } CDisjointUnionExpression* CConcreteOntologyBuildDataUpdater::getDisjointUnion(const CEXPRESSIONLIST& expressions) { CDisjointUnionExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(2)) { CEXPRESSIONLIST* classTermExpressionList = expSplitter.getClassTermExpressionList(); CClassExpression* classExpression = nullptr; cint64 pos = -1; FOREACHIT (CClassTermExpression* classTermExp, *classTermExpressionList) { ++pos; if (dynamic_cast(classTermExp)) { classExpression = (CClassExpression*)classTermExp; break; } } if (classExpression) { classTermExpressionList->removeAt(pos); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't resolve ClassExpression for 'DisjointUnion'-Expression."),this); } expression = getDisjointUnion(classExpression,*classTermExpressionList); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DisjointUnion'-Expression."),this); } return expression; } CObjectComplementOfExpression* CConcreteOntologyBuildDataUpdater::getObjectComplementOf(CBuildExpression* compExpression) { CObjectComplementOfExpression* expression = nullptr; CExpressionSplitter expSplitter(compExpression); if (expSplitter.testForExpressionComposition(1)) { expression = getObjectComplementOf(expSplitter.getFirstClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectComplementOf'-Expression."),this); } return expression; } CObjectComplementOfExpression* CConcreteOntologyBuildDataUpdater::getObjectComplementOf(const CEXPRESSIONLIST& expressions) { CObjectComplementOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(1)) { expression = getObjectComplementOf(expSplitter.getFirstClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectComplementOf'-Expression."),this); } return expression; } CObjectIntersectionOfExpression* CConcreteOntologyBuildDataUpdater::getObjectIntersectionOf(const CEXPRESSIONLIST& expressions) { CObjectIntersectionOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0)) { expression = getObjectIntersectionOf(*expSplitter.getClassTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectIntersectionOf'-Expression."),this); } return expression; } CObjectUnionOfExpression* CConcreteOntologyBuildDataUpdater::getObjectUnionOf(const CEXPRESSIONLIST& expressions) { CObjectUnionOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0)) { expression = getObjectUnionOf(*expSplitter.getClassTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectUnionOf'-Expression."),this); } return expression; } CObjectMaxCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectMaxCardinality(const CEXPRESSIONLIST& expressions, int cardinality) { CObjectMaxCardinalityExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getObjectMaxCardinality(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression(),cardinality); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectMaxCardinality'-Expression."),this); } return expression; } CObjectMaxCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectMaxCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { CObjectMaxCardinalityExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,1)) { expression = getObjectMaxCardinality(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression(),cardinality); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectMaxCardinality'-Expression."),this); } return expression; } CObjectMinCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectMinCardinality(const CEXPRESSIONLIST& expressions, int cardinality) { CObjectMinCardinalityExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getObjectMinCardinality(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression(),cardinality); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectMinCardinality'-Expression."),this); } return expression; } CObjectMinCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectMinCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { CObjectMinCardinalityExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,1)) { expression = getObjectMinCardinality(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression(),cardinality); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectMinCardinality'-Expression."),this); } return expression; } CObjectExactlyCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectExactlyCardinality(const CEXPRESSIONLIST& expressions, int cardinality) { CObjectExactlyCardinalityExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getObjectExactlyCardinality(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression(),cardinality); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectExactCardinality'-Expression."),this); } return expression; } CObjectExactlyCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectExactlyCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { CObjectExactlyCardinalityExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,1)) { expression = getObjectExactlyCardinality(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression(),cardinality); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectExactCardinality'-Expression."),this); } return expression; } CObjectAllValuesFromExpression* CConcreteOntologyBuildDataUpdater::getObjectAllValuesFrom(const CEXPRESSIONLIST& expressions) { CObjectAllValuesFromExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getObjectAllValuesFrom(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectAllValuesFrom'-Expression."),this); } return expression; } CObjectAllValuesFromExpression* CConcreteOntologyBuildDataUpdater::getObjectAllValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2) { CObjectAllValuesFromExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,1)) { expression = getObjectAllValuesFrom(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectAllValuesFrom'-Expression."),this); } return expression; } CObjectSomeValuesFromExpression* CConcreteOntologyBuildDataUpdater::getObjectSomeValuesFrom(const CEXPRESSIONLIST& expressions) { CObjectSomeValuesFromExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getObjectSomeValuesFrom(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectSomeValuesFrom'-Expression."),this); } return expression; } CObjectSomeValuesFromExpression* CConcreteOntologyBuildDataUpdater::getObjectSomeValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2) { CObjectSomeValuesFromExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,1)) { expression = getObjectSomeValuesFrom(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectSomeValuesFrom'-Expression."),this); } return expression; } CDataFacetRestrictionExpression* CConcreteOntologyBuildDataUpdater::getDataFacetRestriction(const CEXPRESSIONLIST& expressions) { CDataFacetRestrictionExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,0,0,1,0,0,1)) { expression = getDataFacetRestriction(expSplitter.getFirstDataLiteralExpression(),expSplitter.getFirstDataFacetExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'FacetRestriction'-Expression."),this); } return expression; } CDataFacetRestrictionExpression* CConcreteOntologyBuildDataUpdater::getDataFacetRestriction(CBuildExpression* expression1, CBuildExpression* expression2) { CDataFacetRestrictionExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,0,0,1,0,0,1)) { expression = getDataFacetRestriction(expSplitter.getFirstDataLiteralExpression(),expSplitter.getFirstDataFacetExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'FacetRestriction'-Expression."),this); } return expression; } CDataSomeValuesFromExpression* CConcreteOntologyBuildDataUpdater::getDataSomeValuesFrom(const CEXPRESSIONLIST& expressions) { CDataSomeValuesFromExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { expression = getDataSomeValuesFrom(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataSomeValuesFrom'-Expression."),this); } return expression; } CDataSomeValuesFromExpression* CConcreteOntologyBuildDataUpdater::getDataSomeValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2) { CDataSomeValuesFromExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { expression = getDataSomeValuesFrom(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataSomeValuesFrom'-Expression."),this); } return expression; } CDataHasValueExpression* CConcreteOntologyBuildDataUpdater::getDataHasValue(const CEXPRESSIONLIST& expressions) { CDataHasValueExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { expression = getDataHasValue(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataHasValue'-Expression."),this); } return expression; } CDataHasValueExpression* CConcreteOntologyBuildDataUpdater::getDataHasValue(CBuildExpression* expression1, CBuildExpression* expression2) { CDataHasValueExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { expression = getDataHasValue(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataHasValue'-Expression."),this); } return expression; } CDataAllValuesFromExpression* CConcreteOntologyBuildDataUpdater::getDataAllValuesFrom(const CEXPRESSIONLIST& expressions) { CDataAllValuesFromExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,1,1)) { expression = getDataAllValuesFrom(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataAllValuesFrom'-Expression."),this); } return expression; } CDataAllValuesFromExpression* CConcreteOntologyBuildDataUpdater::getDataAllValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2) { CDataAllValuesFromExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,1,1)) { expression = getDataAllValuesFrom(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataAllValuesFrom'-Expression."),this); } return expression; } CDataIntersectionOfExpression* CConcreteOntologyBuildDataUpdater::getDataIntersectionOf(const CEXPRESSIONLIST& expressions) { CDataIntersectionOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,1)) { expression = getDataIntersectionOf(*expSplitter.getDataRangeTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataIntersectionOf'-Expression."),this); } return expression; } CDataIntersectionOfExpression* CConcreteOntologyBuildDataUpdater::getDataIntersectionOf(CBuildExpression* expression1, CBuildExpression* expression2) { CDataIntersectionOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,1)) { expression = getDataIntersectionOf(*expSplitter.getDataRangeTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataIntersectionOf'-Expression."),this); } return expression; } CDataOneOfExpression* CConcreteOntologyBuildDataUpdater::getDataOneOf(const CEXPRESSIONLIST& expressions) { CDataOneOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,1)) { expression = getDataOneOf(*expSplitter.getDataRangeTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataOneOf'-Expression."),this); } return expression; } CDataOneOfExpression* CConcreteOntologyBuildDataUpdater::getDataOneOf(CBuildExpression* expression1, CBuildExpression* expression2) { CDataOneOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,1)) { expression = getDataOneOf(*expSplitter.getDataRangeTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataOneOf'-Expression."),this); } return expression; } CDataUnionOfExpression* CConcreteOntologyBuildDataUpdater::getDataUnionOf(const CEXPRESSIONLIST& expressions) { CDataUnionOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,1)) { expression = getDataUnionOf(*expSplitter.getDataRangeTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataUnionOf'-Expression."),this); } return expression; } CDataUnionOfExpression* CConcreteOntologyBuildDataUpdater::getDataUnionOf(CBuildExpression* expression1, CBuildExpression* expression2) { CDataUnionOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,1)) { expression = getDataUnionOf(*expSplitter.getDataRangeTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataUnionOf'-Expression."),this); } return expression; } CDataComplementOfExpression* CConcreteOntologyBuildDataUpdater::getDataComplementOf(const CEXPRESSIONLIST& expressions) { CDataComplementOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,1)) { expression = getDataComplementOf(expSplitter.getFirstDataRangeTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataComplementOf'-Expression."),this); } return expression; } CDataComplementOfExpression* CConcreteOntologyBuildDataUpdater::getDataComplementOf(CBuildExpression* expression1) { CDataComplementOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1); if (expSplitter.testForExpressionComposition(0,0,0,1)) { expression = getDataComplementOf(expSplitter.getFirstDataRangeTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataComplementOf'-Expression."),this); } return expression; } CDatatypeRestrictionExpression* CConcreteOntologyBuildDataUpdater::getDatatypeRestriction(const CEXPRESSIONLIST& expressions) { CDatatypeRestrictionExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,0,0,0,1,1)) { expression = getDatatypeRestriction(expSplitter.getFirstDatatypeExpression(),*expSplitter.getDataFacetRestrictionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DatatypeRestriction'-Expression."),this); } return expression; } CDatatypeRestrictionExpression* CConcreteOntologyBuildDataUpdater::getDatatypeRestriction(CBuildExpression* expression1, CBuildExpression* expression2) { CDatatypeRestrictionExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,0,0,0,1,1)) { expression = getDatatypeRestriction(expSplitter.getFirstDatatypeExpression(),*expSplitter.getDataFacetRestrictionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DatatypeRestriction'-Expression."),this); } return expression; } CDataMaxCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataMaxCardinality(const CEXPRESSIONLIST& expressions, int cardinality) { CDataMaxCardinalityExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { expression = getDataMaxCardinality(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression(),cardinality); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataMaxCardinality'-Expression."),this); } return expression; } CDataMaxCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataMaxCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { CDataMaxCardinalityExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { expression = getDataMaxCardinality(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression(),cardinality); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataMaxCardinality'-Expression."),this); } return expression; } CDataMinCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataMinCardinality(const CEXPRESSIONLIST& expressions, int cardinality) { CDataMinCardinalityExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { expression = getDataMinCardinality(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression(),cardinality); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataMinCardinality'-Expression."),this); } return expression; } CDataMinCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataMinCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { CDataMinCardinalityExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { expression = getDataMinCardinality(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression(),cardinality); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataMinCardinality'-Expression."),this); } return expression; } CDataExactCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataExactCardinality(const CEXPRESSIONLIST& expressions, int cardinality) { CDataExactCardinalityExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { expression = getDataExactCardinality(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression(),cardinality); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataExactCardinality'-Expression."),this); } return expression; } CDataExactCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataExactCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { CDataExactCardinalityExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { expression = getDataExactCardinality(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression(),cardinality); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataExactCardinality'-Expression."),this); } return expression; } CObjectOneOfExpression* CConcreteOntologyBuildDataUpdater::getObjectOneOf(const CEXPRESSIONLIST& expressions) { CObjectOneOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0)) { expression = getObjectOneOf(*expSplitter.getIndividualTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectOneOf'-Expression."),this); } return expression; } CObjectOneOfExpression* CConcreteOntologyBuildDataUpdater::getObjectOneOf(CBuildExpression* indiExpression) { CObjectOneOfExpression* expression = nullptr; CExpressionSplitter expSplitter(indiExpression); if (expSplitter.testForExpressionComposition(0,0,0)) { expression = getObjectOneOf(*expSplitter.getIndividualTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectOneOf'-Expression."),this); } return expression; } CObjectHasValueExpression* CConcreteOntologyBuildDataUpdater::getObjectHasValue(const CEXPRESSIONLIST& expressions) { CObjectHasValueExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1,1)) { expression = getObjectHasValue(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstIndividualTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectHasValue'-Expression."),this); } return expression; } CObjectHasValueExpression* CConcreteOntologyBuildDataUpdater::getObjectHasValue(CBuildExpression* expression1, CBuildExpression* expression2) { CObjectHasValueExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,1,1)) { expression = getObjectHasValue(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstIndividualTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectHasValue'-Expression."),this); } return expression; } CObjectHasSelfExpression* CConcreteOntologyBuildDataUpdater::getObjectHasSelf(const CEXPRESSIONLIST& expressions) { CObjectHasSelfExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getObjectHasSelf(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectHasSelf'-Expression."),this); } return expression; } CObjectHasSelfExpression* CConcreteOntologyBuildDataUpdater::getObjectHasSelf(CBuildExpression* selfExpression) { CObjectHasSelfExpression* expression = nullptr; CExpressionSplitter expSplitter(selfExpression); if (expSplitter.testForExpressionComposition(0,1)) { expression = getObjectHasSelf(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectHasSelf'-Expression."),this); } return expression; } CSubObjectPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getSubObjectPropertyOf(const CEXPRESSIONLIST& expressions) { CSubObjectPropertyOfExpression* expression = nullptr; if (expressions.count() == 2) { CObjectPropertyChainExpression* propertyChain = dynamic_cast(expressions.first()); CObjectPropertyTermExpression* superObjectPropTerm = dynamic_cast(expressions.last()); if (propertyChain && superObjectPropTerm) { expression = getSubObjectPropertyOf(propertyChain,superObjectPropTerm); } } if (!expression) { CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,2)) { CEXPRESSIONLIST* objectPropertyExpressionList = expSplitter.getObjectPropertyTermExpressionList(); CObjectPropertyTermExpression* superObjectPropertyExpression = objectPropertyExpressionList->takeLast(); expression = getSubObjectPropertyOf(*objectPropertyExpressionList,superObjectPropertyExpression); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SubObjectPropertyOf'-Expression."),this); } } return expression; } CSubObjectPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getSubObjectPropertyOf(CBuildExpression* expression1, CBuildExpression* expression2) { CSubObjectPropertyOfExpression* expression = nullptr; CObjectPropertyChainExpression* propertyChain = dynamic_cast(expression1); CObjectPropertyTermExpression* superObjectPropTerm = dynamic_cast(expression2); if (propertyChain && superObjectPropTerm) { expression = getSubObjectPropertyOf(propertyChain,superObjectPropTerm); } if (!expression) { CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,2)) { CEXPRESSIONLIST* objectPropertyExpressionList = expSplitter.getObjectPropertyTermExpressionList(); CObjectPropertyTermExpression* superObjectPropertyExpression = objectPropertyExpressionList->takeLast(); expression = getSubObjectPropertyOf(*objectPropertyExpressionList,superObjectPropertyExpression); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SubObjectPropertyOf'-Expression."),this); } } return expression; } CObjectPropertyChainExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyChain(const CEXPRESSIONLIST& expressions) { CObjectPropertyChainExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getObjectPropertyChain(*expSplitter.getObjectPropertyTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyChain'-Expression."),this); } return expression; } CObjectPropertyChainExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyChain(CBuildExpression* expression1, CBuildExpression* expression2) { CObjectPropertyChainExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,1)) { expression = getObjectPropertyChain(*expSplitter.getObjectPropertyTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyChain'-Expression."),this); } return expression; } CEquivalentObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentObjectProperties(const CEXPRESSIONLIST& expressions) { CEquivalentObjectPropertiesExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,2)) { expression = getEquivalentObjectProperties(*expSplitter.getObjectPropertyTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'EquivalentObjectProperties'-Expression."),this); } return expression; } CEquivalentObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2) { CEquivalentObjectPropertiesExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,2)) { expression = getEquivalentObjectProperties(*expSplitter.getObjectPropertyTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'EquivalentObjectProperties'-Expression."),this); } return expression; } CDisjointObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getDisjointObjectProperties(const CEXPRESSIONLIST& expressions) { CDisjointObjectPropertiesExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,2)) { expression = getDisjointObjectProperties(*expSplitter.getObjectPropertyTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DisjointObjectProperties'-Expression."),this); } return expression; } CDisjointObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getDisjointObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2) { CDisjointObjectPropertiesExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,2)) { expression = getDisjointObjectProperties(*expSplitter.getObjectPropertyTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DisjointObjectProperties'-Expression."),this); } return expression; } CObjectPropertyDomainExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyDomainExpression(CBuildExpression* expression1, CBuildExpression* expression2) { CObjectPropertyDomainExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(1,1)) { expression = getObjectPropertyDomainExpression(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyDomain'-Expression."),this); } return expression; } CObjectPropertyDomainExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyDomainExpression(const CEXPRESSIONLIST& expressions) { CObjectPropertyDomainExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(1,1)) { expression = getObjectPropertyDomainExpression(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyDomain'-Expression."),this); } return expression; } CObjectPropertyRangeExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyRangeExpression(CBuildExpression* expression1, CBuildExpression* expression2) { CObjectPropertyRangeExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(1,1)) { expression = getObjectPropertyRangeExpression(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyRange'-Expression."),this); } return expression; } CObjectPropertyRangeExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyRangeExpression(const CEXPRESSIONLIST& expressions) { CObjectPropertyRangeExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(1,1)) { expression = getObjectPropertyRangeExpression(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyRange'-Expression."),this); } return expression; } CSubDataPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getSubDataPropertyOf(const CEXPRESSIONLIST& expressions) { CSubDataPropertyOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,0,2)) { expression = getSubDataPropertyOf(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getSecondDataPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SubDataPropertyOf'-Expression."),this); } return expression; } CSubDataPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getSubDataPropertyOf(CBuildExpression* expression1, CBuildExpression* expression2) { CSubDataPropertyOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,0,2)) { expression = getSubDataPropertyOf(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getSecondDataPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SubDataPropertyOf'-Expression."),this); } return expression; } CEquivalentDataPropertiesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentDataProperties(const CEXPRESSIONLIST& expressions) { CEquivalentDataPropertiesExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,0,2)) { expression = getEquivalentDataProperties(*expSplitter.getDataPropertyTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'EquivalentDataProperties'-Expression."),this); } return expression; } CEquivalentDataPropertiesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentDataProperties(CBuildExpression* expression1, CBuildExpression* expression2) { CEquivalentDataPropertiesExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,0,2)) { expression = getEquivalentDataProperties(*expSplitter.getDataPropertyTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'EquivalentDataProperties'-Expression."),this); } return expression; } CDisjointDataPropertiesExpression* CConcreteOntologyBuildDataUpdater::getDisjointDataProperties(const CEXPRESSIONLIST& expressions) { CDisjointDataPropertiesExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,0,2)) { expression = getDisjointDataProperties(*expSplitter.getDataPropertyTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DisjointDataProperties'-Expression."),this); } return expression; } CDisjointDataPropertiesExpression* CConcreteOntologyBuildDataUpdater::getDisjointDataProperties(CBuildExpression* expression1, CBuildExpression* expression2) { CDisjointDataPropertiesExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,0,2)) { expression = getDisjointDataProperties(*expSplitter.getDataPropertyTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DisjointDataProperties'-Expression."),this); } return expression; } CDataPropertyDomainExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyDomainExpression(CBuildExpression* expression1, CBuildExpression* expression2) { CDataPropertyDomainExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(1,0,0,0,1)) { expression = getDataPropertyDomainExpression(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataPropertyDomain'-Expression."),this); } return expression; } CDataPropertyDomainExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyDomainExpression(const CEXPRESSIONLIST& expressions) { CDataPropertyDomainExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(1,0,0,0,1)) { expression = getDataPropertyDomainExpression(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataPropertyDomain'-Expression."),this); } return expression; } CDataPropertyRangeExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyRangeExpression(CBuildExpression* expression1, CBuildExpression* expression2) { CDataPropertyRangeExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,0,0,1,1)) { expression = getDataPropertyRangeExpression(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstDataRangeTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataPropertyRange'-Expression."),this); } return expression; } CDataPropertyRangeExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyRangeExpression(const CEXPRESSIONLIST& expressions) { CDataPropertyRangeExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,1,1)) { expression = getDataPropertyRangeExpression(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstDataRangeTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataPropertyRange'-Expression."),this); } return expression; } CFunctionalDataPropertyExpression* CConcreteOntologyBuildDataUpdater::getFunctionalDataProperty(const CEXPRESSIONLIST& expressions) { CFunctionalDataPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { expression = getFunctionalDataProperty(expSplitter.getFirstDataPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'FunctionalDataProperty'-Expression."),this); } return expression; } CFunctionalDataPropertyExpression* CConcreteOntologyBuildDataUpdater::getFunctionalDataProperty(CBuildExpression* funcExpression) { CFunctionalDataPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(funcExpression); if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { expression = getFunctionalDataProperty(expSplitter.getFirstDataPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'FunctionalDataProperty'-Expression."),this); } return expression; } CInverseObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getInverseObjectProperties(const CEXPRESSIONLIST& expressions) { CInverseObjectPropertiesExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,2)) { expression = getInverseObjectProperties(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getSecondObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'InverseObjectProperties'-Expression."),this); } return expression; } CInverseObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getInverseObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2) { CInverseObjectPropertiesExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(0,2)) { expression = getInverseObjectProperties(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getSecondObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'InverseObjectProperties'-Expression."),this); } return expression; } CTransetiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getTransetiveObjectProperty(const CEXPRESSIONLIST& expressions) { CTransetiveObjectPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getTransetiveObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'TransetiveObjectProperty'-Expression."),this); } return expression; } CTransetiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getTransetiveObjectProperty(CBuildExpression* transExpression) { CTransetiveObjectPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(transExpression); if (expSplitter.testForExpressionComposition(0,1)) { expression = getTransetiveObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'TransetiveObjectProperty'-Expression."),this); } return expression; } CFunctionalObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getFunctionalObjectProperty(const CEXPRESSIONLIST& expressions) { CFunctionalObjectPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getFunctionalObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'FunctionalObjectProperty'-Expression."),this); } return expression; } CFunctionalObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getFunctionalObjectProperty(CBuildExpression* funcExpression) { CFunctionalObjectPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(funcExpression); if (expSplitter.testForExpressionComposition(0,1)) { expression = getFunctionalObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'FunctionalObjectProperty'-Expression."),this); } return expression; } CInverseFunctionalObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getInverseFunctionalObjectProperty(const CEXPRESSIONLIST& expressions) { CInverseFunctionalObjectPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getInverseFunctionalObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'InverseFunctionalObjectProperty'-Expression."),this); } return expression; } CInverseFunctionalObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getInverseFunctionalObjectProperty(CBuildExpression* funcExpression) { CInverseFunctionalObjectPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(funcExpression); if (expSplitter.testForExpressionComposition(0,1)) { expression = getInverseFunctionalObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'InverseFunctionalObjectProperty'-Expression."),this); } return expression; } CSymmetricObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getSymmetricObjectProperty(const CEXPRESSIONLIST& expressions) { CSymmetricObjectPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getSymmetricObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SymmetricObjectProperty'-Expression."),this); } return expression; } CSymmetricObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getSymmetricObjectProperty(CBuildExpression* funcExpression) { CSymmetricObjectPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(funcExpression); if (expSplitter.testForExpressionComposition(0,1)) { expression = getSymmetricObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SymmetricObjectProperty'-Expression."),this); } return expression; } CAsymmetricObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getAsymmetricObjectProperty(const CEXPRESSIONLIST& expressions) { CAsymmetricObjectPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getAsymmetricObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'AsymmetricObjectProperty'-Expression."),this); } return expression; } CAsymmetricObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getAsymmetricObjectProperty(CBuildExpression* funcExpression) { CAsymmetricObjectPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(funcExpression); if (expSplitter.testForExpressionComposition(0,1)) { expression = getAsymmetricObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'AsymmetricObjectProperty'-Expression."),this); } return expression; } CReflexiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getReflexiveObjectProperty(const CEXPRESSIONLIST& expressions) { CReflexiveObjectPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getReflexiveObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ReflexiveObjectProperty'-Expression."),this); } return expression; } CReflexiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getReflexiveObjectProperty(CBuildExpression* funcExpression) { CReflexiveObjectPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(funcExpression); if (expSplitter.testForExpressionComposition(0,1)) { expression = getReflexiveObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ReflexiveObjectProperty'-Expression."),this); } return expression; } CIrreflexiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getIrreflexiveObjectProperty(const CEXPRESSIONLIST& expressions) { CIrreflexiveObjectPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getIrreflexiveObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'IrreflexiveObjectProperty'-Expression."),this); } return expression; } CIrreflexiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getIrreflexiveObjectProperty(CBuildExpression* funcExpression) { CIrreflexiveObjectPropertyExpression* expression = nullptr; CExpressionSplitter expSplitter(funcExpression); if (expSplitter.testForExpressionComposition(0,1)) { expression = getIrreflexiveObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'IrreflexiveObjectProperty'-Expression."),this); } return expression; } CInverseObjectPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getInverseObjectPropertyOf(const CEXPRESSIONLIST& expressions) { CInverseObjectPropertyOfExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1)) { expression = getInverseObjectPropertyOf(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'InverseObjectPropertyOf'-Expression."),this); } return expression; } CInverseObjectPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getInverseObjectPropertyOf(CBuildExpression* invExpression) { CInverseObjectPropertyOfExpression* expression = nullptr; CExpressionSplitter expSplitter(invExpression); if (expSplitter.testForExpressionComposition(0,1)) { expression = getInverseObjectPropertyOf(expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'InverseObjectPropertyOf'-Expression."),this); } return expression; } CClassAssertionExpression* CConcreteOntologyBuildDataUpdater::getClassAssertion(const CEXPRESSIONLIST& expressions) { CClassAssertionExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(1,0,1)) { expression = getClassAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getFirstClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ClassAssertion'-Expression."),this); } return expression; } CClassAssertionExpression* CConcreteOntologyBuildDataUpdater::getClassAssertion(CBuildExpression* expression1, CBuildExpression* expression2) { CClassAssertionExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2); if (expSplitter.testForExpressionComposition(1,0,1)) { expression = getClassAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getFirstClassTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ClassAssertion'-Expression."),this); } return expression; } CObjectPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyAssertion(const CEXPRESSIONLIST& expressions) { CObjectPropertyAssertionExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1,2)) { expression = getObjectPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getSecondIndividualTermExpression(),expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyAssertion'-Expression."),this); } return expression; } CObjectPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) { CObjectPropertyAssertionExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2,expression3); if (expSplitter.testForExpressionComposition(0,1,2)) { expression = getObjectPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getSecondIndividualTermExpression(),expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyAssertion'-Expression."),this); } return expression; } CNegativeObjectPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getNegativeObjectPropertyAssertion(const CEXPRESSIONLIST& expressions) { CNegativeObjectPropertyAssertionExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,1,2)) { expression = getNegativeObjectPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getSecondIndividualTermExpression(),expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'NegativeObjectPropertyAssertion'-Expression."),this); } return expression; } CNegativeObjectPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getNegativeObjectPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) { CNegativeObjectPropertyAssertionExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2,expression3); if (expSplitter.testForExpressionComposition(0,1,2)) { expression = getNegativeObjectPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getSecondIndividualTermExpression(),expSplitter.getFirstObjectPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'NegativeObjectPropertyAssertion'-Expression."),this); } return expression; } CDataPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyAssertion(const CEXPRESSIONLIST& expressions) { CDataPropertyAssertionExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,1,0,1,1)) { expression = getDataPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getFirstDataLiteralExpression(),expSplitter.getFirstDataPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataPropertyAssertion'-Expression."),this); } return expression; } CDataPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) { CDataPropertyAssertionExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2,expression3); if (expSplitter.testForExpressionComposition(0,0,1,0,1,1)) { expression = getDataPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getFirstDataLiteralExpression(),expSplitter.getFirstDataPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataPropertyAssertion'-Expression."),this); } return expression; } CNegativeDataPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getNegativeDataPropertyAssertion(const CEXPRESSIONLIST& expressions) { CNegativeDataPropertyAssertionExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,1,0,1,1)) { expression = getNegativeDataPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getFirstDataLiteralExpression(),expSplitter.getFirstDataPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'NegativeDataPropertyAssertion'-Expression."),this); } return expression; } CNegativeDataPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getNegativeDataPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) { CNegativeDataPropertyAssertionExpression* expression = nullptr; CExpressionSplitter expSplitter(expression1,expression2,expression3); if (expSplitter.testForExpressionComposition(0,0,1,0,1,1)) { expression = getNegativeDataPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getFirstDataLiteralExpression(),expSplitter.getFirstDataPropertyTermExpression()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'NegativeDataPropertyAssertion'-Expression."),this); } return expression; } CSameIndividualExpression* CConcreteOntologyBuildDataUpdater::getSameIndividual(const CEXPRESSIONLIST& expressions) { CSameIndividualExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,2)) { expression = getSameIndividual(*expSplitter.getIndividualTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SameIndividual'-Expression."),this); } return expression; } CDifferentIndividualsExpression* CConcreteOntologyBuildDataUpdater::getDifferentIndividuals(const CEXPRESSIONLIST& expressions) { CDifferentIndividualsExpression* expression = nullptr; CExpressionSplitter expSplitter(expressions); if (expSplitter.testForExpressionComposition(0,0,2)) { expression = getDifferentIndividuals(*expSplitter.getIndividualTermExpressionList()); } else { LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DifferentIndividual'-Expression."),this); } return expression; } CDeclarationAxiomExpression* CConcreteOntologyBuildDataUpdater::getDeclaration(CExpressionEntity* entity) { CDeclarationAxiomExpression* expression = nullptr; CDeclarationAxiomExpression tmpExpression(entity); expression = (CDeclarationAxiomExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDeclarationAxiomExpression(entity); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDECLARATION); } return expression; } CEquivalentClassesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentClasses(const CEXPRESSIONLIST& expressions) { CEquivalentClassesExpression* expression = nullptr; CEquivalentClassesExpression tmpExpression(expressions); expression = (CEquivalentClassesExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CEquivalentClassesExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETEQUIVALENTCLASSES); } return expression; } CSubClassOfExpression* CConcreteOntologyBuildDataUpdater::getSubClassOf(CClassTermExpression* expression1, CClassTermExpression* expression2) { CSubClassOfExpression* expression = nullptr; CSubClassOfExpression tmpExpression(expression1,expression2); expression = (CSubClassOfExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CSubClassOfExpression(expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETESUBCLASSOF); } return expression; } CDisjointClassesExpression* CConcreteOntologyBuildDataUpdater::getDisjointClasses(const CEXPRESSIONLIST& expressions) { CDisjointClassesExpression* expression = nullptr; CDisjointClassesExpression tmpExpression(expressions); expression = (CDisjointClassesExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDisjointClassesExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDISJOINTCLASSES); } return expression; } CDisjointUnionExpression* CConcreteOntologyBuildDataUpdater::getDisjointUnion(CClassExpression* classExpression, const CEXPRESSIONLIST& expressions) { CDisjointUnionExpression* expression = nullptr; CDisjointUnionExpression tmpExpression(classExpression,expressions); expression = (CDisjointUnionExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDisjointUnionExpression(classExpression,expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDISJOINTUNION); } return expression; } CObjectComplementOfExpression* CConcreteOntologyBuildDataUpdater::getObjectComplementOf(CClassTermExpression* compExpression) { CObjectComplementOfExpression* expression = nullptr; CObjectComplementOfExpression tmpExpression(compExpression); expression = (CObjectComplementOfExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectComplementOfExpression(compExpression); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTCOMPLEMENTOF); } return expression; } CObjectIntersectionOfExpression* CConcreteOntologyBuildDataUpdater::getObjectIntersectionOf(const CEXPRESSIONLIST& expressions) { CObjectIntersectionOfExpression* expression = nullptr; CObjectIntersectionOfExpression tmpExpression(expressions); expression = (CObjectIntersectionOfExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectIntersectionOfExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTINTERSECTION); } return expression; } CObjectUnionOfExpression* CConcreteOntologyBuildDataUpdater::getObjectUnionOf(const CEXPRESSIONLIST& expressions) { CObjectUnionOfExpression* expression = nullptr; CObjectUnionOfExpression tmpExpression(expressions); expression = (CObjectUnionOfExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectUnionOfExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTUNION); } return expression; } CObjectMaxCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectMaxCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality) { CObjectMaxCardinalityExpression* expression = nullptr; if (expression2 == nullptr) { expression2 = mTopClassExpression; } CObjectMaxCardinalityExpression tmpExpression(expression1,expression2,cardinality); expression = (CObjectMaxCardinalityExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectMaxCardinalityExpression(expression1,expression2,cardinality); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTMAXCARDINALITY); mBuildExpCounter->setMaxObjectCardinalityMinimumMaximumCandidate(cardinality); } return expression; } CObjectMinCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectMinCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality) { CObjectMinCardinalityExpression* expression = nullptr; if (expression2 == nullptr) { expression2 = mTopClassExpression; } CObjectMinCardinalityExpression tmpExpression(expression1,expression2,cardinality); expression = (CObjectMinCardinalityExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectMinCardinalityExpression(expression1,expression2,cardinality); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTMINCARDINALITY); mBuildExpCounter->setMinObjectCardinalityMinimumMaximumCandidate(cardinality); } return expression; } CObjectExactlyCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectExactlyCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality) { CObjectExactlyCardinalityExpression* expression = nullptr; if (expression2 == nullptr) { expression2 = mTopClassExpression; } CObjectExactlyCardinalityExpression tmpExpression(expression1,expression2,cardinality); expression = (CObjectExactlyCardinalityExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectExactlyCardinalityExpression(expression1,expression2,cardinality); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTEXACTLYCARDINALITY); mBuildExpCounter->setMaxObjectCardinalityMinimumMaximumCandidate(cardinality); mBuildExpCounter->setMinObjectCardinalityMinimumMaximumCandidate(cardinality); } return expression; } CObjectAllValuesFromExpression* CConcreteOntologyBuildDataUpdater::getObjectAllValuesFrom(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) { CObjectAllValuesFromExpression* expression = nullptr; CObjectAllValuesFromExpression tmpExpression(expression1,expression2); expression = (CObjectAllValuesFromExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectAllValuesFromExpression(expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTALLVALUEFROM); } return expression; } CObjectOneOfExpression* CConcreteOntologyBuildDataUpdater::getObjectOneOf(const CEXPRESSIONLIST &expressions) { CObjectOneOfExpression* expression = nullptr; CObjectOneOfExpression tmpExpression(expressions); expression = (CObjectOneOfExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectOneOfExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTONEOF); } return expression; } CObjectOneOfExpression* CConcreteOntologyBuildDataUpdater::getObjectOneOf(CIndividualTermExpression* indiExpression) { if (!mTmpObjectOneOfExpression) { mTmpObjectOneOfExpression = new CObjectOneOfExpression(indiExpression); } else { mTmpObjectOneOfExpression->initObjectOneOfExpression(indiExpression); } CBuildExpression*& expression = (*mExpressionBuildHash)[CExpressionHasher(mTmpObjectOneOfExpression)]; if (!expression) { mExpressionBuildContainerList->append(mTmpObjectOneOfExpression); mBuildConceptSet->insert(mTmpObjectOneOfExpression); mBuildConceptList->append(mTmpObjectOneOfExpression); expression = mTmpObjectOneOfExpression; mTmpObjectOneOfExpression = nullptr; mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTONEOF); } return (CObjectOneOfExpression*)expression; } CDataLiteralExpression* CConcreteOntologyBuildDataUpdater::getDataLiteral(CDataLexicalValueExpression* dataLexicalValue, CDatatypeExpression* datatype) { CDataLiteralExpression* expression = nullptr; CDataLiteralExpression tmpExpression(dataLexicalValue,datatype); expression = (CDataLiteralExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataLiteralExpression(dataLexicalValue,datatype); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildDataRangeSet->insert(expression); mBuildDataRangeList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATALITERAL); } return expression; } CDataSomeValuesFromExpression* CConcreteOntologyBuildDataUpdater::getDataSomeValuesFrom(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) { CDataSomeValuesFromExpression* expression = nullptr; CDataSomeValuesFromExpression tmpExpression(expression1,expression2); expression = (CDataSomeValuesFromExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataSomeValuesFromExpression(expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATASOMEVALUEFROM); } return expression; } CDataHasValueExpression* CConcreteOntologyBuildDataUpdater::getDataHasValue(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) { CDataHasValueExpression* expression = nullptr; CDataHasValueExpression tmpExpression(expression1,expression2); expression = (CDataHasValueExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataHasValueExpression(expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAHASVALUE); } return expression; } CDataAllValuesFromExpression* CConcreteOntologyBuildDataUpdater::getDataAllValuesFrom(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) { CDataAllValuesFromExpression* expression = nullptr; CDataAllValuesFromExpression tmpExpression(expression1,expression2); expression = (CDataAllValuesFromExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataAllValuesFromExpression(expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAALLVALUEFROM); } return expression; } CDataMaxCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataMaxCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality) { CDataMaxCardinalityExpression* expression = nullptr; if (expression2 == nullptr) { expression2 = mTopDataRangeExpression; } CDataMaxCardinalityExpression tmpExpression(expression1,expression2,cardinality); expression = (CDataMaxCardinalityExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataMaxCardinalityExpression(expression1,expression2,cardinality); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAMAXCARDINALITY); mBuildExpCounter->setMaxDataCardinalityMinimumMaximumCandidate(cardinality); } return expression; } CDataMinCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataMinCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality) { CDataMinCardinalityExpression* expression = nullptr; if (expression2 == nullptr) { expression2 = mTopDataRangeExpression; } CDataMinCardinalityExpression tmpExpression(expression1,expression2,cardinality); expression = (CDataMinCardinalityExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataMinCardinalityExpression(expression1,expression2,cardinality); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAMINCARDINALITY); mBuildExpCounter->setMinDataCardinalityMinimumMaximumCandidate(cardinality); } return expression; } CDataExactCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataExactCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality) { CDataExactCardinalityExpression* expression = nullptr; if (expression2 == nullptr) { expression2 = mTopDataRangeExpression; } CDataExactCardinalityExpression tmpExpression(expression1,expression2,cardinality); expression = (CDataExactCardinalityExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataExactCardinalityExpression(expression1,expression2,cardinality); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAEXACTCARDINALITY); mBuildExpCounter->setMaxDataCardinalityMinimumMaximumCandidate(cardinality); mBuildExpCounter->setMinDataCardinalityMinimumMaximumCandidate(cardinality); } return expression; } CDataFacetRestrictionExpression* CConcreteOntologyBuildDataUpdater::getDataFacetRestriction(CDataLiteralExpression* dataLiteralExpression, CDataFacetExpression* dataFacet) { CDataFacetRestrictionExpression* expression = nullptr; CDataFacetRestrictionExpression tmpExpression(dataLiteralExpression,dataFacet); expression = (CDataFacetRestrictionExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataFacetRestrictionExpression(dataLiteralExpression,dataFacet); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATATYPERESTRICTION); } return expression; } CDataIntersectionOfExpression* CConcreteOntologyBuildDataUpdater::getDataIntersectionOf(const CEXPRESSIONLIST& expressions) { CDataIntersectionOfExpression* expression = nullptr; CDataIntersectionOfExpression tmpExpression(expressions); expression = (CDataIntersectionOfExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataIntersectionOfExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildDataRangeSet->insert(expression); mBuildDataRangeList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAINTERSECTIONOF); } return expression; } CDataOneOfExpression* CConcreteOntologyBuildDataUpdater::getDataOneOf(const CEXPRESSIONLIST& expressions) { CDataOneOfExpression* expression = nullptr; CDataOneOfExpression tmpExpression(expressions); expression = (CDataOneOfExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataOneOfExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildDataRangeSet->insert(expression); mBuildDataRangeList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAONEOF); } return expression; } CDataUnionOfExpression* CConcreteOntologyBuildDataUpdater::getDataUnionOf(const CEXPRESSIONLIST& expressions) { CDataUnionOfExpression* expression = nullptr; CDataUnionOfExpression tmpExpression(expressions); expression = (CDataUnionOfExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataUnionOfExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildDataRangeSet->insert(expression); mBuildDataRangeList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAUNIONOF); } return expression; } CDataComplementOfExpression* CConcreteOntologyBuildDataUpdater::getDataComplementOf(CDataRangeTermExpression* expression1) { CDataComplementOfExpression* expression = nullptr; CDataComplementOfExpression tmpExpression(expression1); expression = (CDataComplementOfExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataComplementOfExpression(expression1); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildDataRangeSet->insert(expression); mBuildDataRangeList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATACOMPLEMENTOF); } return expression; } CDatatypeRestrictionExpression* CConcreteOntologyBuildDataUpdater::getDatatypeRestriction(CDatatypeExpression* datatypeExpression, const CEXPRESSIONLIST& expressions) { CDatatypeRestrictionExpression* expression = nullptr; CDatatypeRestrictionExpression tmpExpression(datatypeExpression,expressions); expression = (CDatatypeRestrictionExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDatatypeRestrictionExpression(datatypeExpression,expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildDataRangeSet->insert(expression); mBuildDataRangeList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAFACETRESTRICION); } return expression; } CObjectSomeValuesFromExpression* CConcreteOntologyBuildDataUpdater::getObjectSomeValuesFrom(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) { CObjectSomeValuesFromExpression* expression = nullptr; CObjectSomeValuesFromExpression tmpExpression(expression1,expression2); expression = (CObjectSomeValuesFromExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectSomeValuesFromExpression(expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTSOMEVALUEFROM); } return expression; } CObjectHasValueExpression* CConcreteOntologyBuildDataUpdater::getObjectHasValue(CObjectPropertyTermExpression* expression1, CIndividualTermExpression* expression2) { CObjectHasValueExpression* expression = nullptr; CObjectHasValueExpression tmpExpression(expression1,expression2); expression = (CObjectHasValueExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectHasValueExpression(expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTHASVALUE); } return expression; } CObjectHasSelfExpression* CConcreteOntologyBuildDataUpdater::getObjectHasSelf(CObjectPropertyTermExpression* obPrExpression) { CObjectHasSelfExpression* expression = nullptr; CObjectHasSelfExpression tmpExpression(obPrExpression); expression = (CObjectHasSelfExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectHasSelfExpression(obPrExpression); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTHASSELF); } return expression; } CSubObjectPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getSubObjectPropertyOf(const CEXPRESSIONLIST& subExpressions, CObjectPropertyTermExpression* superExpression) { CSubObjectPropertyOfExpression* expression = nullptr; CSubObjectPropertyOfExpression tmpExpression(subExpressions,superExpression); expression = (CSubObjectPropertyOfExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CSubObjectPropertyOfExpression(subExpressions,superExpression); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETSUBOBJECTPROPERTYOF); } return expression; } CSubObjectPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getSubObjectPropertyOf(CObjectPropertyChainExpression* expressions, CObjectPropertyTermExpression* superExpression) { CSubObjectPropertyOfExpression* expression = nullptr; expression = getSubObjectPropertyOf(*expressions->getChainObjectPropertyTermExpressionList(),superExpression); return expression; } CObjectPropertyChainExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyChain(const CEXPRESSIONLIST& expressions) { CObjectPropertyChainExpression* expression = nullptr; CObjectPropertyChainExpression tmpExpression(expressions); expression = (CObjectPropertyChainExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectPropertyChainExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTYCHAIN); } return expression; } CEquivalentObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentObjectProperties(const CEXPRESSIONLIST& expressions) { CEquivalentObjectPropertiesExpression* expression = nullptr; CEquivalentObjectPropertiesExpression tmpExpression(expressions); expression = (CEquivalentObjectPropertiesExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CEquivalentObjectPropertiesExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETEQUIVALENTOBJECTPROPERTIES); } return expression; } CDisjointObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getDisjointObjectProperties(const CEXPRESSIONLIST& expressions) { CDisjointObjectPropertiesExpression* expression = nullptr; CDisjointObjectPropertiesExpression tmpExpression(expressions); expression = (CDisjointObjectPropertiesExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDisjointObjectPropertiesExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDISJOINTOBJECTPROPERTIES); } return expression; } CObjectPropertyDomainExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyDomainExpression(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) { CObjectPropertyDomainExpression* expression = nullptr; CObjectPropertyDomainExpression tmpExpression(expression1,expression2); expression = (CObjectPropertyDomainExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectPropertyDomainExpression(expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTYDOMAIN); } return expression; } CObjectPropertyRangeExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyRangeExpression(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) { CObjectPropertyRangeExpression* expression = nullptr; CObjectPropertyRangeExpression tmpExpression(expression1,expression2); expression = (CObjectPropertyRangeExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectPropertyRangeExpression(expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTYRANGE); } return expression; } CSubDataPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getSubDataPropertyOf(CDataPropertyTermExpression* subExpression, CDataPropertyTermExpression* superExpression) { CSubDataPropertyOfExpression* expression = nullptr; CSubDataPropertyOfExpression tmpExpression(subExpression,superExpression); expression = (CSubDataPropertyOfExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CSubDataPropertyOfExpression(subExpression,superExpression); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETSUBDATAPROPERTYOF); } return expression; } CEquivalentDataPropertiesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentDataProperties(const CEXPRESSIONLIST& expressions) { CEquivalentDataPropertiesExpression* expression = nullptr; CEquivalentDataPropertiesExpression tmpExpression(expressions); expression = (CEquivalentDataPropertiesExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CEquivalentDataPropertiesExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETEQUIVALENTDATAPROPERTIES); } return expression; } CDisjointDataPropertiesExpression* CConcreteOntologyBuildDataUpdater::getDisjointDataProperties(const CEXPRESSIONLIST& expressions) { CDisjointDataPropertiesExpression* expression = nullptr; CDisjointDataPropertiesExpression tmpExpression(expressions); expression = (CDisjointDataPropertiesExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDisjointDataPropertiesExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDISJOINTDATAPROPERTIES); } return expression; } CDataPropertyDomainExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyDomainExpression(CDataPropertyTermExpression* expression1, CClassTermExpression* expression2) { CDataPropertyDomainExpression* expression = nullptr; CDataPropertyDomainExpression tmpExpression(expression1,expression2); expression = (CDataPropertyDomainExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataPropertyDomainExpression(expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAPROPERTYDOMAIN); } return expression; } CDataPropertyRangeExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyRangeExpression(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) { CDataPropertyRangeExpression* expression = nullptr; CDataPropertyRangeExpression tmpExpression(expression1,expression2); expression = (CDataPropertyRangeExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataPropertyRangeExpression(expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAPROPERTYRANGE); } return expression; } CFunctionalDataPropertyExpression* CConcreteOntologyBuildDataUpdater::getFunctionalDataProperty(CDataPropertyTermExpression* buildExpression) { CFunctionalDataPropertyExpression* expression = nullptr; CFunctionalDataPropertyExpression tmpExpression(buildExpression); expression = (CFunctionalDataPropertyExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CFunctionalDataPropertyExpression(buildExpression); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETFUNCTIONALPROPERTYOF); } return expression; } CInverseObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getInverseObjectProperties(CObjectPropertyTermExpression* expression1, CObjectPropertyTermExpression* expression2) { CInverseObjectPropertiesExpression* expression = nullptr; CInverseObjectPropertiesExpression tmpExpression(expression1,expression2); expression = (CInverseObjectPropertiesExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CInverseObjectPropertiesExpression(expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETINVERSEOBJECTPROPERTIES); } return expression; } CTransetiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getTransetiveObjectProperty(CObjectPropertyTermExpression* buildExpression) { CTransetiveObjectPropertyExpression* expression = nullptr; CTransetiveObjectPropertyExpression tmpExpression(buildExpression); expression = (CTransetiveObjectPropertyExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CTransetiveObjectPropertyExpression(buildExpression); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETTRANSETIVEPROPERTYOF); } return expression; } CFunctionalObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getFunctionalObjectProperty(CObjectPropertyTermExpression* buildExpression) { CFunctionalObjectPropertyExpression* expression = nullptr; CFunctionalObjectPropertyExpression tmpExpression(buildExpression); expression = (CFunctionalObjectPropertyExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CFunctionalObjectPropertyExpression(buildExpression); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETFUNCTIONALOBJECTPROPERTY); } return expression; } CInverseFunctionalObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getInverseFunctionalObjectProperty(CObjectPropertyTermExpression* buildExpression) { CInverseFunctionalObjectPropertyExpression* expression = nullptr; CInverseFunctionalObjectPropertyExpression tmpExpression(buildExpression); expression = (CInverseFunctionalObjectPropertyExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CInverseFunctionalObjectPropertyExpression(buildExpression); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETINVERSEFUNCTIONALPROPERTY); } return expression; } CSymmetricObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getSymmetricObjectProperty(CObjectPropertyTermExpression* buildExpression) { CSymmetricObjectPropertyExpression* expression = nullptr; CSymmetricObjectPropertyExpression tmpExpression(buildExpression); expression = (CSymmetricObjectPropertyExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CSymmetricObjectPropertyExpression(buildExpression); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETSYMMETRICPROPERTY); } return expression; } CAsymmetricObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getAsymmetricObjectProperty(CObjectPropertyTermExpression* buildExpression) { CAsymmetricObjectPropertyExpression* expression = nullptr; CAsymmetricObjectPropertyExpression tmpExpression(buildExpression); expression = (CAsymmetricObjectPropertyExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CAsymmetricObjectPropertyExpression(buildExpression); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETASYMMETRICPROPERTY); } return expression; } CReflexiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getReflexiveObjectProperty(CObjectPropertyTermExpression* buildExpression) { CReflexiveObjectPropertyExpression* expression = nullptr; CReflexiveObjectPropertyExpression tmpExpression(buildExpression); expression = (CReflexiveObjectPropertyExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CReflexiveObjectPropertyExpression(buildExpression); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETREFLEXIVEPROPERTY); } return expression; } CIrreflexiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getIrreflexiveObjectProperty(CObjectPropertyTermExpression* buildExpression) { CIrreflexiveObjectPropertyExpression* expression = nullptr; CIrreflexiveObjectPropertyExpression tmpExpression(buildExpression); expression = (CIrreflexiveObjectPropertyExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CIrreflexiveObjectPropertyExpression(buildExpression); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETIRREFLEXIVEPROPERTY); } return expression; } CInverseObjectPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getInverseObjectPropertyOf(CObjectPropertyTermExpression* buildExpression) { CInverseObjectPropertyOfExpression* expression = nullptr; CInverseObjectPropertyOfExpression tmpExpression(buildExpression); expression = (CInverseObjectPropertyOfExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CInverseObjectPropertyOfExpression(buildExpression); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mBuildObjectRoleSet->insert(expression); mBuildObjectRoleList->append(expression); mInverseObjectPropertyHash->insert(buildExpression,expression); mInverseObjectPropertyHash->insert(expression,buildExpression); mInverseObjectPropertyList->append( QPair(expression,buildExpression) ); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETINVERSEOBJECTPROPERTYOF); } return expression; } CObjectPropertyTermExpression* CConcreteOntologyBuildDataUpdater::getCorrectedInverseObjectPropertyOf(CObjectPropertyTermExpression* invExpression) { CInverseObjectPropertyOfExpression* invCastExpression = dynamic_cast(invExpression); if (invCastExpression) { return invCastExpression->getInverseOfExpression(); } CInverseObjectPropertyOfExpression* expression = nullptr; expression = getInverseObjectPropertyOf(invExpression); return expression; } CClassAssertionExpression* CConcreteOntologyBuildDataUpdater::getClassAssertion(CIndividualTermExpression* expression1, CClassTermExpression* expression2) { CClassAssertionExpression* expression = nullptr; CClassAssertionExpression tmpExpression(expression1,expression2); expression = (CClassAssertionExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CClassAssertionExpression(expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETCLASSASSERTION); } return expression; } CObjectPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyAssertion(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2, CObjectPropertyTermExpression* expression3) { CObjectPropertyAssertionExpression* expression = nullptr; CObjectPropertyAssertionExpression tmpExpression(expression3,expression1,expression2); expression = (CObjectPropertyAssertionExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CObjectPropertyAssertionExpression(expression3,expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTYASSERTION); } return expression; } CNegativeObjectPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getNegativeObjectPropertyAssertion(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2, CObjectPropertyTermExpression* expression3) { CNegativeObjectPropertyAssertionExpression* expression = nullptr; CNegativeObjectPropertyAssertionExpression tmpExpression(expression3,expression1,expression2); expression = (CNegativeObjectPropertyAssertionExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CNegativeObjectPropertyAssertionExpression(expression3,expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETNEGATIVEOBJECTPROPERTYASSERTION); } return expression; } CSameIndividualExpression* CConcreteOntologyBuildDataUpdater::getSameIndividual(const CEXPRESSIONLIST& expressions) { CSameIndividualExpression* expression = nullptr; CSameIndividualExpression tmpExpression(expressions); expression = (CSameIndividualExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CSameIndividualExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETSAMEINDIVIDUAL); } return expression; } CDifferentIndividualsExpression* CConcreteOntologyBuildDataUpdater::getDifferentIndividuals(const CEXPRESSIONLIST& expressions) { CDifferentIndividualsExpression* expression = nullptr; CDifferentIndividualsExpression tmpExpression(expressions); expression = (CDifferentIndividualsExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDifferentIndividualsExpression(expressions); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDIFFERENTINDIVIDUAL); } return expression; } CDataPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyAssertion(CIndividualTermExpression* expression1, CDataLiteralExpression* expression2, CDataPropertyTermExpression* expression3) { CDataPropertyAssertionExpression* expression = nullptr; CDataPropertyAssertionExpression tmpExpression(expression3,expression1,expression2); expression = (CDataPropertyAssertionExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CDataPropertyAssertionExpression(expression3,expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAPROPERTYASSERTION); } return expression; } CNegativeDataPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getNegativeDataPropertyAssertion(CIndividualTermExpression* expression1, CDataLiteralExpression* expression2, CDataPropertyTermExpression* expression3) { CNegativeDataPropertyAssertionExpression* expression = nullptr; CNegativeDataPropertyAssertionExpression tmpExpression(expression3,expression1,expression2); expression = (CNegativeDataPropertyAssertionExpression*)mExpressionBuildHash->value(CExpressionHasher(&tmpExpression),nullptr); if (!expression) { expression = new CNegativeDataPropertyAssertionExpression(expression3,expression1,expression2); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mExpressionBuildContainerList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETNEGATIVEDATAPROPERTYASSERTION); } return expression; } bool CConcreteOntologyBuildDataUpdater::initializeBuilding() { mTmpObjectOneOfExpression = nullptr; mMemManager = CContext::getMemoryAllocationManager(mOnto->getOntologyContext()); mOntoStrings = mOnto->getStringMapping(); mOntoBuild = mOnto->getBuildData(); mBuildExpCounter = mOntoBuild->getBuildExpressionCounter(); mDeclarationAxiomSet = mOntoBuild->getDeclarationAxiomSet(); mTopClassExpression = mOntoBuild->getTopClassExpression(); mBottomClassExpression = mOntoBuild->getBottomClassExpression(); mTopObjPropExpression = mOntoBuild->getTopObjectPropertyExpression(); mBottomObjPropExpression = mOntoBuild->getBottomObjectPropertyExpression(); mTopDataRangeExpression = mOntoBuild->getTopDataRangeExpression(); mBottomDataRangeExpression = mOntoBuild->getBottomDataRangeExpression(); mTopDataPropExpression = mOntoBuild->getTopDataPropertyExpression(); mBottomDataPropExpression = mOntoBuild->getBottomDataPropertyExpression(); mBuildConceptSet = mOntoBuild->getBuildConceptSet(); mBuildObjectRoleSet = mOntoBuild->getBuildObjectRoleSet(); mBuildIndividualSet = mOntoBuild->getBuildIndividualSet(); mBuildDataRoleSet = mOntoBuild->getBuildDataRoleSet(); mBuildDatatypeSet = mOntoBuild->getBuildDatatypeSet(); mBuildDataRangeSet = mOntoBuild->getBuildDataRangeSet(); mBuildConceptList = mOntoBuild->getBuildConceptList(); mBuildObjectRoleList = mOntoBuild->getBuildObjectRoleList(); mBuildIndividualList = mOntoBuild->getBuildIndividualList(); mBuildDataRoleList = mOntoBuild->getBuildDataRoleList(); mBuildDataRangeList = mOntoBuild->getBuildDataRangeList(); mBuildDatatypeList = mOntoBuild->getBuildDatatypeList(); mExpressionBuildContainerList = mOntoBuild->getExpressionBuildListContainer(); mInverseObjectPropertyHash = mOntoBuild->getInverseObjectPropertyHash(); mInverseObjectPropertyList = mOntoBuild->getInverseObjectPropertyList(); mExpressionBuildHash = mOntoBuild->getStructuralExpressionBuildHash(); mClassBuildHash = mOntoBuild->getClassEntityBuildHash(); mObjectPropertyBuildHash = mOntoBuild->getObjectPropertyEntityBuildHash(); mIndividualBuildHash = mOntoBuild->getIndividualEntityBuildHash(); mAnoIndividualBuildHash = mOntoBuild->getAnonymousIndividualBuildHash(); mIndividualVariableBuildHash = mOntoBuild->getIndividualVariableBuildHash(); mDataPropertyBuildHash = mOntoBuild->getDataPropertyEntityBuildHash(); mDataLexicalValueBuildHash = mOntoBuild->getDataLexicalValueBuildHash(); mNextAxiomNumber = mOntoBuild->getNextAxiomNumber(); mNextEntityNumber = mOntoBuild->getNextEntityNumber(); mNextMaxAxiomNumberOffset = 0; mAbbreviatedNamePrefixMapHash = mOntoStrings->getAbbreviatedNamePrefixHash(); mNamePrefixMapHash = mOntoStrings->getNamePrefixHash(); mPrefixList = mOntoStrings->getPrefixList(); mIndividualVariableIDHash = mOntoBuild->getIndividualVariableIDHash(); mDatatypeBuildHash = mOntoBuild->getDatatypeIRIBuildHash(); mDataFacetBuildHash = mOntoBuild->getFacetIRIBuildHash(); mImportDataHash = mOntoBuild->getImportDataHash(); return true; } bool CConcreteOntologyBuildDataUpdater::completeBuilding() { delete mTmpObjectOneOfExpression; mTmpObjectOneOfExpression = nullptr; return true; } cint64 CConcreteOntologyBuildDataUpdater::getAxiomNumber() { return mNextAxiomNumber; } CDataRangeTermExpression* CConcreteOntologyBuildDataUpdater::getTopDataRange() { return mTopDataRangeExpression; } CDataRangeTermExpression* CConcreteOntologyBuildDataUpdater::getBottomDataRange() { return mBottomDataRangeExpression; } CObjectPropertyTermExpression* CConcreteOntologyBuildDataUpdater::getTopObjectProberty() { return mTopObjPropExpression; } CClassTermExpression* CConcreteOntologyBuildDataUpdater::getTopClass() { CClassTermExpression* expression = mTopClassExpression; return expression; } CClassTermExpression* CConcreteOntologyBuildDataUpdater::getBottomClass() { CClassTermExpression* expression = mBottomClassExpression; return expression; } bool CConcreteOntologyBuildDataUpdater::addOntologyImport(const QStringRef& name) { if (!mImportDataHash->contains(CStringRefStringHasher(name))) { QString importIRIString = name.toString(); COntologyImportData*& importData = (*mImportDataHash)[CStringRefStringHasher(importIRIString)]; importData = new COntologyImportData(); importData->initOntologyImportData(importIRIString); return true; } return false; } bool CConcreteOntologyBuildDataUpdater::addOntologyImport(const QString& name) { COntologyImportData*& importData = (*mImportDataHash)[CStringRefStringHasher(name)]; if (!importData) { importData = new COntologyImportData(); importData->initOntologyImportData(name); return true; } return false; } bool CConcreteOntologyBuildDataUpdater::addNameAbbreviation(const QString &name, const QString &abbreviatedName) { CNamePrefix* previousNamePrefix = mAbbreviatedNamePrefixMapHash->value(abbreviatedName); if (!previousNamePrefix || previousNamePrefix->getPrefixString() != name) { CNamePrefix* namePrefix = new CNamePrefix(abbreviatedName,name); mAbbreviatedNamePrefixMapHash->insert(abbreviatedName,namePrefix); mNamePrefixMapHash->insert(name,namePrefix); mPrefixList->append(namePrefix); return true; } else { return false; } } QString CConcreteOntologyBuildDataUpdater::getOntologyName() { return mOnto->getOntologyName(); } QString CConcreteOntologyBuildDataUpdater::resolveAbbreviationName(const QString& name) { QString resolvedString(name); cint64 colonPos = name.indexOf(":"); if (colonPos >= 0 && colonPos < name.length()) { QString abbName = name.mid(0,colonPos); QString idName = name.mid(colonPos+1); CNamePrefix* namePrefix = mAbbreviatedNamePrefixMapHash->value(abbName,nullptr); if (namePrefix) { resolvedString = namePrefix->getPrefixString()+idName; } } return resolvedString; } QString CConcreteOntologyBuildDataUpdater::resolveAbbreviationName(const QStringRef& name) { QString resolvedString(name.toString()); cint64 colonPos = resolvedString.indexOf(":"); if (colonPos >= 0 && colonPos < resolvedString.length()) { QString abbName = resolvedString.mid(0,colonPos); QString idName = resolvedString.mid(colonPos+1); CNamePrefix* namePrefix = mAbbreviatedNamePrefixMapHash->value(abbName,nullptr); if (namePrefix) { resolvedString = namePrefix->getPrefixString()+idName; } } return resolvedString; } CClassExpression* CConcreteOntologyBuildDataUpdater::getClass(const QString& className) { CClassExpression* expression = nullptr; expression = mClassBuildHash->value(className); if (!expression) { expression = new CClassExpression(className); expression->setEntityID(mNextEntityNumber++); mClassBuildHash->insert(className,expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETCLASS); } else { if (expression == mBottomClassExpression) { mBuildExpCounter->incRefferedBottomClassCount(); } } return expression; } CClassExpression* CConcreteOntologyBuildDataUpdater::getClass(const QStringRef& className) { CClassExpression* expression = nullptr; expression = mClassBuildHash->value(className); if (!expression) { QString classNameString(className.toString()); expression = new CClassExpression(classNameString); expression->setEntityID(mNextEntityNumber++); mClassBuildHash->insert(classNameString,expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETCLASS); } else { if (expression == mBottomClassExpression) { mBuildExpCounter->incRefferedBottomClassCount(); } } return expression; } CDatatypeExpression* CConcreteOntologyBuildDataUpdater::getDatatype(const QString& datatypeName) { CDatatypeExpression* expression = nullptr; expression = mDatatypeBuildHash->value(datatypeName); if (!expression) { expression = new CDatatypeExpression(datatypeName); expression->setEntityID(mNextEntityNumber++); mDatatypeBuildHash->insert(datatypeName,expression); mBuildDatatypeSet->insert(expression); mBuildDatatypeList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATATYPE); } return expression; } CDatatypeExpression* CConcreteOntologyBuildDataUpdater::getDatatype(const QStringRef& datatypeName) { CDatatypeExpression* expression = nullptr; expression = mDatatypeBuildHash->value(datatypeName); if (!expression) { QString datatypeNameString(datatypeName.toString()); expression = new CDatatypeExpression(datatypeNameString); expression->setEntityID(mNextEntityNumber++); mDatatypeBuildHash->insert(datatypeNameString,expression); mBuildDatatypeSet->insert(expression); mBuildDatatypeList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATATYPE); } return expression; } CDataFacetExpression* CConcreteOntologyBuildDataUpdater::getDataFacet(const QString& dataFacetIRI) { CDataFacetExpression* expression = nullptr; expression = mDataFacetBuildHash->value(dataFacetIRI); if (!expression) { expression = new CDataFacetExpression(dataFacetIRI); expression->setEntityID(mNextEntityNumber++); mDataFacetBuildHash->insert(dataFacetIRI,expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAFACETIRI); } return expression; } CDataFacetExpression* CConcreteOntologyBuildDataUpdater::getDataFacet(const QStringRef& dataFacetIRI) { CDataFacetExpression* expression = nullptr; expression = mDataFacetBuildHash->value(dataFacetIRI); if (!expression) { QString datatypeNameString(dataFacetIRI.toString()); expression = new CDataFacetExpression(datatypeNameString); expression->setEntityID(mNextEntityNumber++); mDataFacetBuildHash->insert(dataFacetIRI,expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAFACETIRI); } return expression; } CDataLexicalValueExpression* CConcreteOntologyBuildDataUpdater::getDataLexicalValue(const QString& dataLexicalValue) { CDataLexicalValueExpression* expression = nullptr; expression = mDataLexicalValueBuildHash->value(dataLexicalValue); if (!expression) { expression = new CDataLexicalValueExpression(dataLexicalValue); expression->setEntityID(mNextEntityNumber++); mDataLexicalValueBuildHash->insert(dataLexicalValue,expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATALEXICALVALUE); } return expression; } CDataLexicalValueExpression* CConcreteOntologyBuildDataUpdater::getDataLexicalValue(const QStringRef& dataLexicalValue) { CDataLexicalValueExpression* expression = nullptr; expression = mDataLexicalValueBuildHash->value(dataLexicalValue); if (!expression) { QString dataLexicalValueString(dataLexicalValue.toString()); expression = new CDataLexicalValueExpression(dataLexicalValueString); expression->setEntityID(mNextEntityNumber++); mDataLexicalValueBuildHash->insert(dataLexicalValueString,expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATALEXICALVALUE); } return expression; } CDataPropertyExpression* CConcreteOntologyBuildDataUpdater::getDataProberty(const QString& dataPropertyName) { CDataPropertyExpression* expression = nullptr; expression = mDataPropertyBuildHash->value(dataPropertyName); if (!expression) { expression = new CDataPropertyExpression(dataPropertyName); expression->setEntityID(mNextEntityNumber++); mDataPropertyBuildHash->insert(dataPropertyName,expression); mBuildDataRoleSet->insert(expression); mBuildDataRoleList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAPROPERTY); } else { if (expression == mBottomDataPropExpression) { mBuildExpCounter->incRefferedBottomDataPropertyCount(); } } return expression; } CDataPropertyExpression* CConcreteOntologyBuildDataUpdater::getDataProberty(const QStringRef& dataPropertyName) { CDataPropertyExpression* expression = nullptr; expression = mDataPropertyBuildHash->value(dataPropertyName); if (!expression) { QString dataPropertyNameString(dataPropertyName.toString()); expression = new CDataPropertyExpression(dataPropertyNameString); expression->setEntityID(mNextEntityNumber++); mDataPropertyBuildHash->insert(dataPropertyNameString,expression); mBuildDataRoleSet->insert(expression); mBuildDataRoleList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAPROPERTY); } else { if (expression == mBottomDataPropExpression) { mBuildExpCounter->incRefferedBottomDataPropertyCount(); } } return expression; } CObjectIndividualVariableExpression* CConcreteOntologyBuildDataUpdater::getIndividualVariable(const QString &individualVariableName, cint64 axiomNumber) { CObjectIndividualVariableExpression* expression = nullptr; expression = mIndividualVariableBuildHash->value(QPair(individualVariableName,axiomNumber)); if (!expression) { expression = new CObjectIndividualVariableExpression(individualVariableName,axiomNumber); expression->setEntityID(mNextEntityNumber++); mNextMaxAxiomNumberOffset = qMax(axiomNumber,mNextMaxAxiomNumberOffset); mIndividualVariableBuildHash->insert(QPair(individualVariableName,axiomNumber),expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETINDIVIDUALVARIABLE); } return expression; } CObjectIndividualVariableExpression* CConcreteOntologyBuildDataUpdater::getIndividualVariable(const QStringRef &individualVariableName, cint64 axiomNumber) { CObjectIndividualVariableExpression* expression = nullptr; expression = mIndividualVariableBuildHash->value(QPair(individualVariableName,axiomNumber)); if (!expression) { QString individualVariableNameString(individualVariableName.toString()); mNextMaxAxiomNumberOffset = qMax(axiomNumber,mNextMaxAxiomNumberOffset); expression = new CObjectIndividualVariableExpression(individualVariableNameString,axiomNumber); expression->setEntityID(mNextEntityNumber++); mIndividualVariableBuildHash->insert(QPair(individualVariableNameString,axiomNumber),expression); mBuildConceptSet->insert(expression); mBuildConceptList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETINDIVIDUALVARIABLE); } return expression; } CObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getObjectProberty(const QString& probertyName) { CObjectPropertyExpression* expression = nullptr; expression = mObjectPropertyBuildHash->value(probertyName); if (!expression) { expression = new CObjectPropertyExpression(probertyName); expression->setEntityID(mNextEntityNumber++); mObjectPropertyBuildHash->insert(probertyName,expression); mBuildObjectRoleSet->insert(expression); mBuildObjectRoleList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTY); } else { if (expression == mBottomObjPropExpression) { mBuildExpCounter->incRefferedBottomObjectPropertyCount(); } } return expression; } CObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getObjectProberty(const QStringRef& probertyName) { CObjectPropertyExpression* expression = nullptr; expression = mObjectPropertyBuildHash->value(probertyName); if (!expression) { QString propertyNameString(probertyName.toString()); expression = new CObjectPropertyExpression(propertyNameString); expression->setEntityID(mNextEntityNumber++); mObjectPropertyBuildHash->insert(propertyNameString,expression); mBuildObjectRoleSet->insert(expression); mBuildObjectRoleList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTY); } else { if (expression == mBottomObjPropExpression) { mBuildExpCounter->incRefferedBottomObjectPropertyCount(); } } return expression; } CNamedIndividualExpression* CConcreteOntologyBuildDataUpdater::getNamedIndividual(const QString& individualName) { CNamedIndividualExpression* expression = nullptr; expression = mIndividualBuildHash->value(individualName); if (!expression) { expression = new CNamedIndividualExpression(individualName); expression->setEntityID(mNextEntityNumber++); mIndividualBuildHash->insert(individualName,expression); mBuildIndividualSet->insert(expression); mBuildIndividualList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETNAMEDINDIVIDUAL); } return expression; } CNamedIndividualExpression* CConcreteOntologyBuildDataUpdater::getNamedIndividual(const QStringRef& individualName) { CNamedIndividualExpression* expression = nullptr; expression = mIndividualBuildHash->value(individualName); if (!expression) { QString individualNameString(individualName.toString()); expression = new CNamedIndividualExpression(individualNameString); expression->setEntityID(mNextEntityNumber++); mIndividualBuildHash->insert(individualNameString,expression); mBuildIndividualSet->insert(expression); mBuildIndividualList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETNAMEDINDIVIDUAL); } return expression; } CAnonymousIndividualExpression* CConcreteOntologyBuildDataUpdater::getAnonymousIndividual(const QString& ontologyName, const QString& individualName) { CAnonymousIndividualExpression* expression = nullptr; QPair namePair(ontologyName,individualName); expression = mAnoIndividualBuildHash->value(namePair); if (!expression) { expression = new CAnonymousIndividualExpression(ontologyName,individualName); expression->setEntityID(mNextEntityNumber++); mAnoIndividualBuildHash->insert(namePair,expression); mBuildIndividualSet->insert(expression); mBuildIndividualList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETANONYMOUSINDIVIDUAL); } return expression; } CAnonymousIndividualExpression* CConcreteOntologyBuildDataUpdater::getAnonymousIndividual(const QStringRef& ontologyName, const QStringRef& individualName) { CAnonymousIndividualExpression* expression = nullptr; QPair namePair(ontologyName,individualName); expression = mAnoIndividualBuildHash->value(namePair); if (!expression) { QString ontologyNameString(ontologyName.toString()); QString individualNameString(individualName.toString()); expression = new CAnonymousIndividualExpression(ontologyNameString,individualNameString); expression->setEntityID(mNextEntityNumber++); mAnoIndividualBuildHash->insert(QPair(ontologyNameString,individualNameString),expression); mBuildIndividualSet->insert(expression); mBuildIndividualList->append(expression); mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETANONYMOUSINDIVIDUAL); } return expression; } }; // end namespace Generator }; // end namespace Reasoner }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/0000755000175000017500000000000012613407260022322 5ustar jonasjonas././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationInstantiatedToConceptVisitor.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationInstantiatedToConceptV0000644000175000017500000000435312520551246032470 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINSTANTIATEDTOCONCEPTVISITOR_H #define KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINSTANTIATEDTOCONCEPTVISITOR_H // Libraries includes // Namespace includes #include "RealizationSettings.h" #include "CConceptRealizationConceptVisitor.h" #include "CConceptRealizationInstantiatedVisitor.h" #include "CConceptRealization.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Realization { /*! * * \class CConceptRealizationInstantiatedToConceptVisitor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptRealizationInstantiatedToConceptVisitor : public CConceptRealizationConceptVisitor, public CConceptRealizationInstantiatedVisitor { // public methods public: //! Constructor CConceptRealizationInstantiatedToConceptVisitor(); virtual bool visitType(CConceptInstantiatedItem* item, CConceptRealization* conRealization); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINSTANTIATEDTOCONCEPTVISITOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CSameInstanceItem.cpp0000644000175000017500000000212512520551250026316 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSameInstanceItem.h" namespace Konclude { namespace Reasoner { namespace Realization { CSameInstanceItem::CSameInstanceItem() { } CSameInstanceItem::~CSameInstanceItem() { } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptInstanceItem.cpp0000644000175000017500000000214412520551244027030 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptInstanceItem.h" namespace Konclude { namespace Reasoner { namespace Realization { CConceptInstanceItem::CConceptInstanceItem() { } CConceptInstanceItem::~CConceptInstanceItem() { } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealization.cpp0000644000175000017500000000642712520551244026736 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptRealization.h" namespace Konclude { namespace Reasoner { namespace Realization { CConceptRealization::CConceptRealization() { } bool CConceptRealization::visitDirectInstances(CConcept* concept, CConceptRealizationInstanceVisitor* visitor) { CConceptInstantiatedItem* conceptItem = getInstantiatedItem(concept); return visitDirectInstances(conceptItem,visitor); } bool CConceptRealization::visitInstances(CConcept* concept, CConceptRealizationInstanceVisitor* visitor) { CConceptInstantiatedItem* conceptItem = getInstantiatedItem(concept); return visitInstances(conceptItem,visitor); } bool CConceptRealization::visitInstances(CConcept* concept, bool direct, CConceptRealizationInstanceVisitor* visitor) { CConceptInstantiatedItem* conceptItem = getInstantiatedItem(concept); return visitInstances(conceptItem,direct,visitor); } bool CConceptRealization::visitDirectTypes(CIndividual* individual, CConceptRealizationInstantiatedVisitor* visitor) { CConceptInstanceItem* individualItem = getInstanceItem(individual); return visitDirectTypes(individualItem,visitor); } bool CConceptRealization::visitTypes(CIndividual* individual, CConceptRealizationInstantiatedVisitor* visitor) { CConceptInstanceItem* individualItem = getInstanceItem(individual); return visitTypes(individualItem,visitor); } bool CConceptRealization::visitTypes(CIndividual* individual, bool direct, CConceptRealizationInstantiatedVisitor* visitor) { CConceptInstanceItem* individualItem = getInstanceItem(individual); return visitTypes(individualItem,direct,visitor);; } bool CConceptRealization::visitSameIndividuals(CIndividual* individual, CConceptRealizationIndividualVisitor* visitor) { CConceptInstanceItem* individualItem = getInstanceItem(individual); return visitIndividuals(individualItem,visitor); } bool CConceptRealization::visitTypes(CConceptInstanceItem* item, bool direct, CConceptRealizationInstantiatedVisitor* visitor) { if (direct) { return visitDirectTypes(item,visitor); } else { return visitTypes(item,visitor); } } bool CConceptRealization::visitInstances(CConceptInstantiatedItem* item, bool direct, CConceptRealizationInstanceVisitor* visitor) { if (direct) { return visitDirectInstances(item,visitor); } else { return visitInstances(item,visitor); } } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptInstanceItem.h0000644000175000017500000000336412520551244026502 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CCONCEPTINSTANCESITEM_H #define KONCLUDE_REASONER_REALIZATION_CCONCEPTINSTANCESITEM_H // Libraries includes // Namespace includes #include "RealizationSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \class CConceptInstancesItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptInstanceItem { // public methods public: //! Constructor CConceptInstanceItem(); virtual ~CConceptInstanceItem(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CCONCEPTINSTANCESITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRealization.h0000644000175000017500000000464612520551246025072 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CREALIZATION_H #define KONCLUDE_REASONER_REALIZATION_CREALIZATION_H // Libraries includes // Namespace includes #include "RealizationSettings.h" #include "CConceptRealization.h" #include "CRoleRealization.h" #include "CSameRealization.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \class CRealization * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealization { // public methods public: //! Constructor CRealization(); bool hasConceptRealization(); CConceptRealization* getConceptRealization(); CRealization* setConceptRealization(CConceptRealization* conRealization); bool hasSameRealization(); CSameRealization* getSameRealization(); CRealization* setSameRealization(CSameRealization* sameRealization); bool hasRoleRealization(); CRoleRealization* getRoleRealization(); CRealization* setRoleRealization(CRoleRealization* roleRealization); bool isRealized(); CRealization* setRealized(bool realized); // protected methods protected: // protected variables protected: bool mRealized; CConceptRealization* mConceptRealization; CRoleRealization* mRoleRealization; CSameRealization* mSameRealization; // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CREALIZATION_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationInstantiatedToConceptVisitor.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationInstantiatedToConceptV0000644000175000017500000000250012520551246032460 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptRealizationInstantiatedToConceptVisitor.h" namespace Konclude { namespace Reasoner { namespace Realization { CConceptRealizationInstantiatedToConceptVisitor::CConceptRealizationInstantiatedToConceptVisitor() { } bool CConceptRealizationInstantiatedToConceptVisitor::visitType(CConceptInstantiatedItem* item, CConceptRealization* conRealization) { return conRealization->visitConcepts(item,this); } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRoleRealization.cpp0000644000175000017500000000255712520551250026241 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleRealization.h" namespace Konclude { namespace Reasoner { namespace Realization { CRoleRealization::CRoleRealization() { } bool CRoleRealization::visitTargetIndividuals(CIndividual* individual, CRole* role, CRoleRealizationInstanceVisitor* visitor) { CRoleInstantiatedItem* roleItem = getRoleInstantiatedItem(role); CRoleInstanceItem* indiItem = getRoleInstanceItem(individual); return visitTargetIndividuals(indiItem,roleItem,visitor); } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRoleRealization.h0000644000175000017500000000445712520551250025707 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CROLEREALIZATION_H #define KONCLUDE_REASONER_REALIZATION_CROLEREALIZATION_H // Libraries includes // Namespace includes #include "RealizationSettings.h" #include "CRoleRealizationIndividualVisitor.h" #include "CRoleRealizationInstanceVisitor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \class CRoleRealization * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleRealization { // public methods public: //! Constructor CRoleRealization(); virtual bool visitTargetIndividuals(CIndividual* individual, CRole* role, CRoleRealizationInstanceVisitor* visitor); virtual bool visitTargetIndividuals(CRoleInstanceItem* individualItem, CRoleInstantiatedItem* roleItem, CRoleRealizationInstanceVisitor* visitor) = 0; virtual bool visitIndividuals(CRoleInstanceItem* item, CRoleRealizationIndividualVisitor* visitor) = 0; virtual CRoleInstantiatedItem* getRoleInstantiatedItem(CRole* role) = 0; virtual CRoleInstanceItem* getRoleInstanceItem(CIndividual* individual) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CROLEREALIZATION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRoleRealizationIndividualVisitor.cpp0000644000175000017500000000217112520551250031622 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleRealizationIndividualVisitor.h" namespace Konclude { namespace Reasoner { namespace Realization { CRoleRealizationIndividualVisitor::CRoleRealizationIndividualVisitor() { } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRoleRealizationInstanceToIndividualVisitor.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRoleRealizationInstanceToIndividualVisit0000644000175000017500000000416212520551250032472 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CROLEREALIZATIONINSTANCETOINDIVIDUALVISITOR_H #define KONCLUDE_REASONER_REALIZATION_CROLEREALIZATIONINSTANCETOINDIVIDUALVISITOR_H // Libraries includes // Namespace includes #include "RealizationSettings.h" #include "CRoleRealizationInstanceVisitor.h" #include "CRoleRealizationIndividualVisitor.h" #include "CRoleRealization.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \class CRoleRealizationInstancesVisitor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleRealizationInstanceToIndividualVisitor : public CRoleRealizationInstanceVisitor, public CRoleRealizationIndividualVisitor { // public methods public: //! Constructor CRoleRealizationInstanceToIndividualVisitor(); virtual bool visitRoleInstance(CRoleInstanceItem* item, CRoleRealization* roleRealization); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CROLEREALIZATIONINSTANCETOINDIVIDUALVISITOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationIndividualVisitor.cpp0000644000175000017500000000213312520551246032317 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptRealizationIndividualVisitor.h" namespace Konclude { namespace Reasoner { namespace Realization { CConceptRealizationIndividualVisitor::CConceptRealizationIndividualVisitor() { } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationInstanceVisitor.cpp0000644000175000017500000000212512520551246031774 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptRealizationInstanceVisitor.h" namespace Konclude { namespace Reasoner { namespace Realization { CConceptRealizationInstanceVisitor::CConceptRealizationInstanceVisitor() { } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CSameRealization.h0000644000175000017500000000401712520551250025663 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CSameRealization_H #define KONCLUDE_REASONER_REALIZATION_CSameRealization_H // Libraries includes // Namespace includes #include "RealizationSettings.h" #include "CSameRealizationIndividualVisitor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \class CSameRealization * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSameRealization { // public methods public: //! Constructor CSameRealization(); virtual bool visitSameIndividuals(CIndividual* individual, CSameRealizationIndividualVisitor* visitor); virtual bool visitSameIndividuals(CSameInstanceItem* item, CSameRealizationIndividualVisitor* visitor) = 0; virtual CSameInstanceItem* getSameInstanceItem(CIndividual* individual) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CSameRealization_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CSameRealization.cpp0000644000175000017500000000244012520551250026214 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSameRealization.h" namespace Konclude { namespace Reasoner { namespace Realization { CSameRealization::CSameRealization() { } bool CSameRealization::visitSameIndividuals(CIndividual* individual, CSameRealizationIndividualVisitor* visitor) { CSameInstanceItem* individualItem = getSameInstanceItem(individual); return visitSameIndividuals(individualItem,visitor); } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRoleRealizationIndividualVisitor.h0000644000175000017500000000367512520551250031301 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CROLEREALIZATIONINDIVIDUALVISITOR_H #define KONCLUDE_REASONER_REALIZATION_CROLEREALIZATIONINDIVIDUALVISITOR_H // Libraries includes // Namespace includes #include "RealizationSettings.h" // Other includes #include "Reasoner/Ontology/CIndividual.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Realization { /*! * * \class CRoleRealizationIndividualVisitor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleRealizationIndividualVisitor { // public methods public: //! Constructor CRoleRealizationIndividualVisitor(); virtual bool visitIndividual(CIndividual* individual, CRoleRealization* roleRealization) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CROLEREALIZATIONINDIVIDUALVISITOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CSameRealizationIndividualVisitor.h0000644000175000017500000000367512520551250031265 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CSAMEREALIZATIONINDIVIDUALVISITOR_H #define KONCLUDE_REASONER_REALIZATION_CSAMEREALIZATIONINDIVIDUALVISITOR_H // Libraries includes // Namespace includes #include "RealizationSettings.h" // Other includes #include "Reasoner/Ontology/CIndividual.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Realization { /*! * * \class CSameRealizationIndividualVisitor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSameRealizationIndividualVisitor { // public methods public: //! Constructor CSameRealizationIndividualVisitor(); virtual bool visitIndividual(CIndividual* individual, CSameRealization* sameRealization) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CSAMEREALIZATIONINDIVIDUALVISITOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CPossibleAssertionsCollectionSet.h0000644000175000017500000000441112520551246031122 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CPOSSIBLEASSERTIONSCOLLECTIONSET_H #define KONCLUDE_REASONER_REALIZER_CPOSSIBLEASSERTIONSCOLLECTIONSET_H // Libraries includes #include #include #include // Namespace includes #include "RealizationSettings.h" // Other includes #include "Reasoner/Ontology/CIndividual.h" #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Realization { /*! * * \class CPossibleAssertionsCollectionSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPossibleAssertionsCollectionSet : public QSet< QPair > { // public methods public: //! Constructor CPossibleAssertionsCollectionSet(); CPossibleAssertionsCollectionSet* addPossibleAssertion(CIndividual* indi, CConcept* concept); bool hasPossibleAssertion(CIndividual* indi, CConcept* concept); bool acquireSynchronisationLock(); CPossibleAssertionsCollectionSet* releaseSynchronisationLock(); // protected methods protected: // protected variables protected: QMutex mSyncMutex; // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CPOSSIBLEASSERTIONSCOLLECTIONSET_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRoleRealizationInstanceVisitor.h0000644000175000017500000000356012520551250030746 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CROLEREALIZATIONINSTANCEVISITOR_H #define KONCLUDE_REASONER_REALIZATION_CROLEREALIZATIONINSTANCEVISITOR_H // Libraries includes // Namespace includes #include "RealizationSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \class CConceptRealizationInstancesVisitor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleRealizationInstanceVisitor { // public methods public: //! Constructor CRoleRealizationInstanceVisitor(); virtual bool visitRoleInstance(CRoleInstanceItem* item, CRoleRealization* roleRealization) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CROLEREALIZATIONINSTANCEVISITOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CSameInstanceItem.h0000644000175000017500000000333312520551250025765 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CSAMEINSTANCEITEM_H #define KONCLUDE_REASONER_REALIZATION_CSAMEINSTANCEITEM_H // Libraries includes // Namespace includes #include "RealizationSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \class CSameInstanceItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSameInstanceItem { // public methods public: //! Constructor CSameInstanceItem(); virtual ~CSameInstanceItem(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CSAMEINSTANCEITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRoleInstanceItem.h0000644000175000017500000000333312520551246026006 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CROLEINSTANCEITEM_H #define KONCLUDE_REASONER_REALIZATION_CROLEINSTANCEITEM_H // Libraries includes // Namespace includes #include "RealizationSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \class CRoleInstanceItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleInstanceItem { // public methods public: //! Constructor CRoleInstanceItem(); virtual ~CRoleInstanceItem(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CROLEINSTANCEITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRealization.cpp0000644000175000017500000000447612520551246025426 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealization.h" namespace Konclude { namespace Reasoner { namespace Realization { CRealization::CRealization() { mRealized = false; mConceptRealization = nullptr; mSameRealization = nullptr; mRoleRealization = nullptr; } bool CRealization::isRealized() { return mRealized; } CRealization* CRealization::setRealized(bool realized) { mRealized = realized; return this; } CConceptRealization* CRealization::getConceptRealization() { return mConceptRealization; } bool CRealization::hasConceptRealization() { return mConceptRealization != nullptr; } CRealization* CRealization::setConceptRealization(CConceptRealization* conRealization) { mConceptRealization = conRealization; return this; } CSameRealization* CRealization::getSameRealization() { return mSameRealization; } bool CRealization::hasSameRealization() { return mSameRealization != nullptr; } CRealization* CRealization::setSameRealization(CSameRealization* sameRealization) { mSameRealization = sameRealization; return this; } bool CRealization::hasRoleRealization() { return mRoleRealization != nullptr; } CRoleRealization* CRealization::getRoleRealization() { return mRoleRealization; } CRealization* CRealization::setRoleRealization(CRoleRealization* roleRealization) { mRoleRealization = roleRealization; return this; } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CSameRealizationInstanceVisitor.cpp0000644000175000017500000000210612515521332031262 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSameRealizationInstanceVisitor.h" namespace Konclude { namespace Reasoner { namespace Realization { CSameRealizationInstanceVisitor::CSameRealizationInstanceVisitor() { } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationConceptVisitor.cpp0000644000175000017500000000212212520551244031616 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptRealizationConceptVisitor.h" namespace Konclude { namespace Reasoner { namespace Realization { CConceptRealizationConceptVisitor::CConceptRealizationConceptVisitor() { } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CPossibleAssertionsCollectionSet.cpp0000644000175000017500000000346112520551246031461 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPossibleAssertionsCollectionSet.h" namespace Konclude { namespace Reasoner { namespace Realization { CPossibleAssertionsCollectionSet::CPossibleAssertionsCollectionSet() { } CPossibleAssertionsCollectionSet* CPossibleAssertionsCollectionSet::addPossibleAssertion(CIndividual* indi, CConcept* concept) { QSet< QPair >::insert( QPair(indi,concept) ); return this; } bool CPossibleAssertionsCollectionSet::hasPossibleAssertion(CIndividual* indi, CConcept* concept) { return QSet< QPair >::contains( QPair(indi,concept) ); } bool CPossibleAssertionsCollectionSet::acquireSynchronisationLock() { mSyncMutex.lock(); return true; } CPossibleAssertionsCollectionSet* CPossibleAssertionsCollectionSet::releaseSynchronisationLock() { mSyncMutex.unlock(); return this; } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRoleRealizationInstanceVisitor.cpp0000644000175000017500000000211412520551250031273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleRealizationInstanceVisitor.h" namespace Konclude { namespace Reasoner { namespace Realization { CRoleRealizationInstanceVisitor::CRoleRealizationInstanceVisitor() { } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationInstantiatedVisitor.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationInstantiatedVisitor.cp0000644000175000017500000000214112520551246032475 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptRealizationInstantiatedVisitor.h" namespace Konclude { namespace Reasoner { namespace Realization { CConceptRealizationInstantiatedVisitor::CConceptRealizationInstantiatedVisitor() { } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationIndividualVisitor.h0000644000175000017500000000372112520551246031770 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINDIVIDUALVISITOR_H #define KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINDIVIDUALVISITOR_H // Libraries includes // Namespace includes #include "RealizationSettings.h" // Other includes #include "Reasoner/Ontology/CIndividual.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Realization { /*! * * \class CConceptRealizationIndividualVisitor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptRealizationIndividualVisitor { // public methods public: //! Constructor CConceptRealizationIndividualVisitor(); virtual bool visitIndividual(CIndividual* individual, CConceptRealization* conRealization) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINDIVIDUALVISITOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/RealizationSettings.h0000644000175000017500000000354612520551250026501 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_REALIZATIONSETTINGS #define KONCLUDE_REASONER_REALIZATION_REALIZATIONSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \file RealizationSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CConceptRealization; class CConceptInstanceItem; class CConceptInstantiatedItem; class CConceptRealizationInstanceVisitor; class CRoleRealization; class CRoleInstanceItem; class CRoleInstantiatedItem; class CRoleRealizationInstanceVisitor; class CRoleRealizationIndividualVisitor; class CSameRealization; class CSameInstanceItem; class CSameRealizationIndividualVisitor; // Custom Events >= 2000 }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_REALIZATION_REALIZATIONSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRoleInstantiatedItem.h0000644000175000017500000000336612520551246026677 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CROLEINSTANTIATEDITEM_H #define KONCLUDE_REASONER_REALIZATION_CROLEINSTANTIATEDITEM_H // Libraries includes // Namespace includes #include "RealizationSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \class CRoleInstantiatedItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleInstantiatedItem { // public methods public: //! Constructor CRoleInstantiatedItem(); virtual ~CRoleInstantiatedItem(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CROLEINSTANTIATEDITEM_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationInstanceToIndividualVisitor.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationInstanceToIndividualVi0000644000175000017500000000247712520551246032460 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptRealizationInstanceToIndividualVisitor.h" namespace Konclude { namespace Reasoner { namespace Realization { CConceptRealizationInstanceToIndividualVisitor::CConceptRealizationInstanceToIndividualVisitor() { } bool CConceptRealizationInstanceToIndividualVisitor::visitInstance(CConceptInstanceItem* item, CConceptRealization* conRealization) { return conRealization->visitIndividuals(item,this); } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CSameRealizationIndividualVisitor.cpp0000644000175000017500000000212212520551250031602 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSameRealizationIndividualVisitor.h" namespace Konclude { namespace Reasoner { namespace Realization { CSameRealizationIndividualVisitor::CSameRealizationIndividualVisitor() { } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationInstantiatedVisitor.h0000644000175000017500000000362712520551246032334 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINSTANTIATEDVISITOR_H #define KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINSTANTIATEDVISITOR_H // Libraries includes // Namespace includes #include "RealizationSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \class CConceptRealizationInstantiatedVisitor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptRealizationInstantiatedVisitor { // public methods public: //! Constructor CConceptRealizationInstantiatedVisitor(); virtual bool visitType(CConceptInstantiatedItem* item, CConceptRealization* conRealization) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINSTANTIATEDVISITOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CIndividualConceptAssertionSetCollector.h0000644000175000017500000000471412520551246032424 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CINDIVIDUALCONCEPTASSERTIONSETCOLLECTOR_H #define KONCLUDE_REASONER_REALIZATION_CINDIVIDUALCONCEPTASSERTIONSETCOLLECTOR_H // Libraries includes // Namespace includes #include "RealizationSettings.h" #include "CConceptRealizationConceptVisitor.h" #include "CConceptRealizationInstantiatedVisitor.h" #include "CConceptRealization.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CIndividual.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Realization { /*! * * \class CIndividualConceptAssertionSetCollector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualConceptAssertionSetCollector : public CConceptRealizationConceptVisitor, public CConceptRealizationInstantiatedVisitor { // public methods public: //! Constructor CIndividualConceptAssertionSetCollector(CIndividual* indi, QSet< QPair >* assSet); virtual bool visitType(CConceptInstantiatedItem* item, CConceptRealization* conRealization); virtual bool visitConcept(CConcept* concept, CConceptRealization* conRealization); // protected methods protected: // protected variables protected: CIndividual* mIndi; QSet< QPair >* mAssSet; // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CINDIVIDUALCONCEPTASSERTIONSETCOLLECTOR_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationInstanceToIndividualVisitor.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationInstanceToIndividualVi0000644000175000017500000000422412520551246032450 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINSTANCETOINDIVIDUALVISITOR_H #define KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINSTANCETOINDIVIDUALVISITOR_H // Libraries includes // Namespace includes #include "RealizationSettings.h" #include "CConceptRealizationInstanceVisitor.h" #include "CConceptRealizationIndividualVisitor.h" #include "CConceptRealization.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \class CConceptRealizationInstancesVisitor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptRealizationInstanceToIndividualVisitor : public CConceptRealizationInstanceVisitor, public CConceptRealizationIndividualVisitor { // public methods public: //! Constructor CConceptRealizationInstanceToIndividualVisitor(); virtual bool visitInstance(CConceptInstanceItem* item, CConceptRealization* conRealization); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINSTANCETOINDIVIDUALVISITOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationConceptVisitor.h0000644000175000017500000000366312520551244031276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONCONCEPTVISITOR_H #define KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONCONCEPTVISITOR_H // Libraries includes // Namespace includes #include "RealizationSettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Realization { /*! * * \class CConceptRealizationConceptVisitor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptRealizationConceptVisitor { // public methods public: //! Constructor CConceptRealizationConceptVisitor(); virtual bool visitConcept(CConcept* concept, CConceptRealization* conRealization) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONCONCEPTVISITOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptInstantiatedItem.h0000644000175000017500000000341312520551244027360 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CCONCEPTINSTANTIATEDITEM_H #define KONCLUDE_REASONER_REALIZATION_CCONCEPTINSTANTIATEDITEM_H // Libraries includes // Namespace includes #include "RealizationSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \class CConceptInstantiatedItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptInstantiatedItem { // public methods public: //! Constructor CConceptInstantiatedItem(); virtual ~CConceptInstantiatedItem(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CCONCEPTINSTANTIATEDITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptInstantiatedItem.cpp0000644000175000017500000000217012520551244027712 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptInstantiatedItem.h" namespace Konclude { namespace Reasoner { namespace Realization { CConceptInstantiatedItem::CConceptInstantiatedItem() { } CConceptInstantiatedItem::~CConceptInstantiatedItem() { } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CIndividualConceptAssertionSetCollector.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CIndividualConceptAssertionSetCollector.c0000644000175000017500000000313212520551246032410 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualConceptAssertionSetCollector.h" namespace Konclude { namespace Reasoner { namespace Realization { CIndividualConceptAssertionSetCollector::CIndividualConceptAssertionSetCollector(CIndividual* indi, QSet< QPair >* assSet) { mIndi = indi; mAssSet = assSet; } bool CIndividualConceptAssertionSetCollector::visitType(CConceptInstantiatedItem* item, CConceptRealization* conRealization) { return conRealization->visitConcepts(item,this); } bool CIndividualConceptAssertionSetCollector::visitConcept(CConcept* concept, CConceptRealization* conRealization) { mAssSet->insert(QPair(mIndi,concept)); return true; } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRoleInstanceItem.cpp0000644000175000017500000000212512520551246026337 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleInstanceItem.h" namespace Konclude { namespace Reasoner { namespace Realization { CRoleInstanceItem::CRoleInstanceItem() { } CRoleInstanceItem::~CRoleInstanceItem() { } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealizationInstanceVisitor.h0000644000175000017500000000360312520551246031443 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINSTANCESVISITOR_H #define KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINSTANCESVISITOR_H // Libraries includes // Namespace includes #include "RealizationSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \class CConceptRealizationInstancesVisitor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptRealizationInstanceVisitor { // public methods public: //! Constructor CConceptRealizationInstanceVisitor(); virtual bool visitInstance(CConceptInstanceItem* item, CConceptRealization* conRealization) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATIONINSTANCESVISITOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CConceptRealization.h0000644000175000017500000000752012520551244026376 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATION_H #define KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATION_H // Libraries includes // Namespace includes #include "RealizationSettings.h" #include "CConceptRealizationInstanceVisitor.h" #include "CConceptRealizationInstantiatedVisitor.h" #include "CConceptRealizationConceptVisitor.h" #include "CConceptRealizationIndividualVisitor.h" #include "CPossibleAssertionsCollectionSet.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realization { /*! * * \class CConceptRealization * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptRealization { // public methods public: //! Constructor CConceptRealization(); virtual bool visitDirectInstances(CConcept* concept, CConceptRealizationInstanceVisitor* visitor); virtual bool visitInstances(CConcept* concept, CConceptRealizationInstanceVisitor* visitor); virtual bool visitInstances(CConcept* concept, bool direct, CConceptRealizationInstanceVisitor* visitor); virtual bool visitSameIndividuals(CIndividual* individual, CConceptRealizationIndividualVisitor* visitor); virtual bool visitDirectTypes(CIndividual* individual, CConceptRealizationInstantiatedVisitor* visitor); virtual bool visitTypes(CIndividual* individual, CConceptRealizationInstantiatedVisitor* visitor); virtual bool visitTypes(CIndividual* individual, bool direct, CConceptRealizationInstantiatedVisitor* visitor); virtual bool visitDirectInstances(CConceptInstantiatedItem* item, CConceptRealizationInstanceVisitor* visitor) = 0; virtual bool visitInstances(CConceptInstantiatedItem* item, CConceptRealizationInstanceVisitor* visitor) = 0; virtual bool visitInstances(CConceptInstantiatedItem* item, bool direct, CConceptRealizationInstanceVisitor* visitor); virtual bool visitDirectTypes(CConceptInstanceItem* item, CConceptRealizationInstantiatedVisitor* visitor) = 0; virtual bool visitTypes(CConceptInstanceItem* item, CConceptRealizationInstantiatedVisitor* visitor) = 0; virtual bool visitTypes(CConceptInstanceItem* item, bool direct, CConceptRealizationInstantiatedVisitor* visitor); virtual bool visitIndividuals(CConceptInstanceItem* item, CConceptRealizationIndividualVisitor* visitor) = 0; virtual bool visitConcepts(CConceptInstantiatedItem* item, CConceptRealizationConceptVisitor* visitor) = 0; virtual CConceptInstantiatedItem* getInstantiatedItem(CConcept* concept) = 0; virtual CConceptInstanceItem* getInstanceItem(CIndividual* individual) = 0; virtual CPossibleAssertionsCollectionSet* getPossibleAssertionCollectionSet() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZATION_CCONCEPTREALIZATION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRoleInstantiatedItem.cpp0000644000175000017500000000215112520551246027221 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleInstantiatedItem.h" namespace Konclude { namespace Reasoner { namespace Realization { CRoleInstantiatedItem::CRoleInstantiatedItem() { } CRoleInstantiatedItem::~CRoleInstantiatedItem() { } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRoleRealizationInstanceToIndividualVisitor.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realization/CRoleRealizationInstanceToIndividualVisit0000644000175000017500000000246312520551250032474 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleRealizationInstanceToIndividualVisitor.h" namespace Konclude { namespace Reasoner { namespace Realization { CRoleRealizationInstanceToIndividualVisitor::CRoleRealizationInstanceToIndividualVisitor() { } bool CRoleRealizationInstanceToIndividualVisitor::visitRoleInstance(CRoleInstanceItem* item, CRoleRealization* roleRealization) { return roleRealization->visitIndividuals(item,this); } }; // end namespace Realization }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/0000755000175000017500000000000012613407256021266 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/0000755000175000017500000000000012613407254022636 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CPreprocessingManager.h0000644000175000017500000000503012520551050027215 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_CPREPROCESSINGMANAGER_H #define KONCLUDE_REASONER_KERNEL_MANAGER_CPREPROCESSINGMANAGER_H // Libraries includes #include #include // Namespace includes #include "ManagerSettings.h" // Other includes #include "Reasoner/Preprocess/CPreprocessor.h" #include "Reasoner/Preprocess/CRequirementConfigPreprocessingThread.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Config/CConfigurationProvider.h" #include "Control/Command/CConfigManagerReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Control::Command; namespace Reasoner { using namespace Preprocess; using namespace Ontology; namespace Kernel { namespace Manager { /*! * * \class CPreprocessingManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPreprocessingManager { // public methods public: //! Constructor CPreprocessingManager(CReasonerManager* reasonerManager); //! Destructor virtual ~CPreprocessingManager(); virtual CPreprocessor* getPreprocessor(CConcreteOntology *ontology, CConfigurationBase *config); // protected methods protected: // protected variables protected: CReasonerManager* mReasonerManager; QReadWriteLock mReadWriteLock; QHash mOntoPreprocessHash; // private methods private: // private variables private: }; }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_CPREPROCESSINGMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CPrecomputationManager.cpp0000644000175000017500000000472612520551050027751 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecomputationManager.h" #include "CReasonerManager.h" #include "Reasoner/Consistiser/CTotallyPrecomputationThread.h" #include "Reasoner/Consistiser/CIncrementalPrecomputationThread.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { CPrecomputationManager::CPrecomputationManager(CReasonerManager* reasonerManager) { mReasonerManager = reasonerManager; } CPrecomputationManager::~CPrecomputationManager() { } CPrecomputator* CPrecomputationManager::getPrecomputator(CConcreteOntology *ontology, CConfigurationBase *config) { CPrecomputator* precomputator = nullptr; mReadWriteLock.lockForRead(); precomputator = mOntoPrecomputatorHash.value(ontology); mReadWriteLock.unlock(); bool onlyChangedABoxAxioms = ontology->getIncrementalRevisionData()->getAxiomChangeData()->hasOnlyChangedABoxAxioms(); bool previousConsistentOntologyVersion = ontology->getIncrementalRevisionData()->getPreviousConsistentOntology() != nullptr; if (!precomputator) { mReadWriteLock.lockForWrite(); precomputator = mOntoPrecomputatorHash.value(ontology); if (!precomputator) { if (onlyChangedABoxAxioms && previousConsistentOntologyVersion) { precomputator = new CIncrementalPrecomputationThread(mReasonerManager); } else { precomputator = new CTotallyPrecomputationThread(mReasonerManager); } mOntoPrecomputatorHash.insert(ontology,precomputator); } mReadWriteLock.unlock(); } return precomputator; } }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/0000755000175000017500000000000012613407254024102 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CCalcedQueryEvent.cpp0000644000175000017500000000411712520551046030113 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalcedQueryEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { namespace Events { CCalcedQueryEvent::CCalcedQueryEvent(CThread *receiverThread, CQuery *query) : CCustomEvent(EVENTTYPE) { this->query = query; recThread = receiverThread; queryString = query->getQueryString(); queryName = query->getQueryName(); } CCalcedQueryEvent::~CCalcedQueryEvent() { } void CCalcedQueryEvent::doCallback() { answerString = query->getAnswerString(); if (recThread) { recThread->postEvent(this); } } void CCalcedQueryEvent::sendEventWithAnswer(const QString& newAnswerString) { answerString = newAnswerString; if (recThread) { recThread->postEvent(this); } } QString CCalcedQueryEvent::getAnswerString() { return answerString; } QString CCalcedQueryEvent::getQueryString() { return queryString; } QString CCalcedQueryEvent::getQueryName() { return queryName; } CQuery *CCalcedQueryEvent::getQuery() { return query; } }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CPrepareOntologyEvent.h0000644000175000017500000000520212520551046030504 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CPREPAREONTOLOGYEVENT_H #define KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CPREPAREONTOLOGYEVENT_H // Libraries includes // Namespace includes #include "../ManagerSettings.h" // Other includes #include "Reasoner/Query/CQuery.h" #include "Concurrent/Events/CCustomEvent.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Reasoner { using namespace Query; using namespace Ontology; namespace Kernel { namespace Manager { namespace Events { /*! * \class CPrepareOntologyEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CPrepareOntologyEvent : public CCustomEvent { // public methods public: //! Constructor CPrepareOntologyEvent(CConcreteOntology* ontology, const QList& reqList, CCallbackData *callback); //! Destructor virtual ~CPrepareOntologyEvent(); QList* getOntologyProcessingRequirementList(); CCallbackData* getCallbackData(); CConcreteOntology* getOntology(); static const QEvent::Type EVENTTYPE = EVENTPREPAREONTOLOGY; // protected methods protected: // protected variables protected: QList mReqList; CConcreteOntology* mOntology; CCallbackData* callbackData; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CPREPAREONTOLOGYEVENT_H ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CQueryJobCalculatedSatisfiableCallbackEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CQueryJobCalculatedSatisfiableC0000644000175000017500000000346012520551046032123 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryJobCalculatedSatisfiableCallbackEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { namespace Events { CQueryJobCalculatedSatisfiableCallbackEvent::CQueryJobCalculatedSatisfiableCallbackEvent(CThread *receiverThread, CSatisfiableCalculationJobsQuery* query, CJobSatisfiableCallbackContextData *context) : CCustomEvent(EVENTTYPE), CCallbackData(context) { recThread = receiverThread; mQuery = query; } CQueryJobCalculatedSatisfiableCallbackEvent::~CQueryJobCalculatedSatisfiableCallbackEvent() { } void CQueryJobCalculatedSatisfiableCallbackEvent::doCallback() { recThread->postEvent(this); } CSatisfiableCalculationJobsQuery* CQueryJobCalculatedSatisfiableCallbackEvent::getSatisfiableCalclulationJobsQuery() { return mQuery; } }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CCalcQueryEvent.cpp0000644000175000017500000000274412520551046027606 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalcQueryEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { namespace Events { CCalcQueryEvent::CCalcQueryEvent(CQuery *query, CCallbackData *callback) : CCustomEvent(EVENTTYPE) { this->query = query; callbackData = callback; } CCalcQueryEvent::~CCalcQueryEvent() { } CQuery *CCalcQueryEvent::getQuery() { return query; } CCallbackData *CCalcQueryEvent::getCallbackData() { return callbackData; } }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CRequirementProcessedCallbackEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CRequirementProcessedCallbackEv0000644000175000017500000000531212520551046032205 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CREQUIREMENTPROCESSEDCALLBACKEVENT_H #define KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CREQUIREMENTPROCESSEDCALLBACKEVENT_H // Libraries includes #include // Namespace includes #include "../ManagerSettings.h" #include "../CRequirementPreparingData.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Manager { namespace Events { /*! * \class CRequirementProcessedCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CRequirementProcessedCallbackEvent : public CCustomEvent, public CCallbackData { // public methods public: //! Constructor CRequirementProcessedCallbackEvent(CThread* receiverThread, CConcreteOntology* ontology, CRequirementPreparingData* reqPrepData); //! Destructor virtual ~CRequirementProcessedCallbackEvent(); virtual void doCallback(); virtual CConcreteOntology* getOntology(); virtual CRequirementPreparingData* getRequirementPreparingData(); static const QEvent::Type EVENTTYPE = EVENTREQUIREMENTPROCESSEDCALLBACK; // protected methods protected: // protected variables protected: CConcreteOntology* mOntology; CRequirementPreparingData* mReqPrepData; CThread *recThread; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CREQUIREMENTPROCESSEDCALLBACKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CCalcedQueryEvent.h0000644000175000017500000000512212520551046027555 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CCALCEDQUERYEVENT_H #define KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CCALCEDQUERYEVENT_H // Libraries includes #include // Namespace includes #include "../ManagerSettings.h" // Other includes #include "Reasoner/Query/CQuery.h" #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Reasoner { using namespace Query; namespace Kernel { namespace Manager { namespace Events { /*! * \class CCalcedQueryEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CCalcedQueryEvent : public CCustomEvent, public CCallbackData { // public methods public: //! Constructor CCalcedQueryEvent(CThread *receiverThread, CQuery *query); //! Destructor virtual ~CCalcedQueryEvent(); virtual void sendEventWithAnswer(const QString& newAnswerString); virtual void doCallback(); virtual QString getAnswerString(); virtual QString getQueryString(); virtual QString getQueryName(); virtual CQuery *getQuery(); static const QEvent::Type EVENTTYPE = EVENTCALCEDQUERY; // protected methods protected: // protected variables protected: CQuery *query; CThread *recThread; QString answerString; QString queryString; QString queryName; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CCALCEDQUERYEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CPrepareOntologyEvent.cpp0000644000175000017500000000341512520551046031043 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrepareOntologyEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { namespace Events { CPrepareOntologyEvent::CPrepareOntologyEvent(CConcreteOntology* ontology, const QList& reqList, CCallbackData *callback) : CCustomEvent(EVENTTYPE) { mOntology = ontology; mReqList = reqList; callbackData = callback; } CPrepareOntologyEvent::~CPrepareOntologyEvent() { } QList* CPrepareOntologyEvent::getOntologyProcessingRequirementList() { return &mReqList; } CCallbackData *CPrepareOntologyEvent::getCallbackData() { return callbackData; } CConcreteOntology *CPrepareOntologyEvent::getOntology() { return mOntology; } }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CQueryJobCalculatedSatisfiableCallbackEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CQueryJobCalculatedSatisfiableC0000644000175000017500000000546412520551046032131 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CQUERYJOBCALCULATEDSATISFIABLECALLBACKEVENT_H #define KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CQUERYJOBCALCULATEDSATISFIABLECALLBACKEVENT_H // Libraries includes // Namespace includes #include "../ManagerSettings.h" // Other includes #include "Reasoner/Query/CJobSatisfiableCallbackContextData.h" #include "Reasoner/Query/CSatisfiableCalculationJobsQuery.h" #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Reasoner { using namespace Query; namespace Kernel { namespace Manager { namespace Events { /*! * \class CQueryJobCalculatedSatisfiableCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CQueryJobCalculatedSatisfiableCallbackEvent : public CCustomEvent, public CCallbackData { // public methods public: //! Constructor CQueryJobCalculatedSatisfiableCallbackEvent(CThread *receiverThread, CSatisfiableCalculationJobsQuery* query, CJobSatisfiableCallbackContextData *context); //! Destructor virtual ~CQueryJobCalculatedSatisfiableCallbackEvent(); virtual void doCallback(); static const QEvent::Type EVENTTYPE = EVENTQUERYJOBCALCULATEDSATISFIABLECALLBACK; CSatisfiableCalculationJobsQuery* getSatisfiableCalclulationJobsQuery(); // protected methods protected: // protected variables protected: CThread *recThread; CSatisfiableCalculationJobsQuery* mQuery; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CQUERYJOBCALCULATEDSATISFIABLECALLBACKEVENT_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CJobCalculatedSatisfiableCallbackEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CJobCalculatedSatisfiableCallba0000644000175000017500000000504412520551046032071 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CJOBCALCULATEDSATISFIABLECALLBACKEVENT_H #define KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CJOBCALCULATEDSATISFIABLECALLBACKEVENT_H // Libraries includes // Namespace includes #include "../ManagerSettings.h" // Other includes #include "Reasoner/Query/CJobSatisfiableCallbackContextData.h" #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Reasoner { using namespace Query; namespace Kernel { namespace Manager { namespace Events { /*! * \class CJobCalculatedSatisfiableCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CJobCalculatedSatisfiableCallbackEvent : public CCustomEvent, public CCallbackData { // public methods public: //! Constructor CJobCalculatedSatisfiableCallbackEvent(CThread *receiverThread, CJobSatisfiableCallbackContextData *context); //! Destructor virtual ~CJobCalculatedSatisfiableCallbackEvent(); virtual void doCallback(); static const QEvent::Type EVENTTYPE = EVENTJOBCALCULATEDSATISFIABLECALLBACK; // protected methods protected: // protected variables protected: CThread *recThread; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CJOBCALCULATEDSATISFIABLECALLBACKEVENT_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CRequirementProcessedCallbackEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CRequirementProcessedCallbackEv0000644000175000017500000000357212520551046032213 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRequirementProcessedCallbackEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { namespace Events { CRequirementProcessedCallbackEvent::CRequirementProcessedCallbackEvent(CThread* receiverThread, CConcreteOntology* ontology, CRequirementPreparingData* reqPrepData) : CCustomEvent(EVENTTYPE) { mOntology = ontology; recThread = receiverThread; mReqPrepData = reqPrepData; } CRequirementProcessedCallbackEvent::~CRequirementProcessedCallbackEvent() { } void CRequirementProcessedCallbackEvent::doCallback() { if (recThread) { recThread->postEvent(this); } } CConcreteOntology* CRequirementProcessedCallbackEvent::getOntology() { return mOntology; } CRequirementPreparingData* CRequirementProcessedCallbackEvent::getRequirementPreparingData() { return mReqPrepData; } }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CJobCalculatedSatisfiableCallbackEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CJobCalculatedSatisfiableCallba0000644000175000017500000000307312520551046032071 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CJobCalculatedSatisfiableCallbackEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { namespace Events { CJobCalculatedSatisfiableCallbackEvent::CJobCalculatedSatisfiableCallbackEvent(CThread *receiverThread, CJobSatisfiableCallbackContextData *context) : CCustomEvent(EVENTTYPE), CCallbackData(context) { recThread = receiverThread; } CJobCalculatedSatisfiableCallbackEvent::~CJobCalculatedSatisfiableCallbackEvent() { } void CJobCalculatedSatisfiableCallbackEvent::doCallback() { recThread->postEvent(this); } }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CReasoningSatisfiableCalculationJobEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CReasoningSatisfiableCalculatio0000644000175000017500000000333612520551046032226 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasoningSatisfiableCalculationJobEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { namespace Events { CReasoningSatisfiableCalculationJobEvent::CReasoningSatisfiableCalculationJobEvent(CSatisfiableCalculationJob *satCalcJob, CCallbackData *callback) : CCustomEvent(EVENTTYPE) { mSatCalcJob = satCalcJob; mCallbackData = callback; } CReasoningSatisfiableCalculationJobEvent::~CReasoningSatisfiableCalculationJobEvent() { } CSatisfiableCalculationJob *CReasoningSatisfiableCalculationJobEvent::getSatisfiableCalculationJob() { return mSatCalcJob; } CCallbackData *CReasoningSatisfiableCalculationJobEvent::getCallbackData() { return mCallbackData; } }; // end namespace Kernel }; // end namespace Manager }; // end namespace Events }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CQueriedTaxonomyComputedCallbackEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CQueriedTaxonomyComputedCallbac0000644000175000017500000000376112520551046032233 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueriedTaxonomyComputedCallbackEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { namespace Events { CQueriedTaxonomyComputedCallbackEvent::CQueriedTaxonomyComputedCallbackEvent(CThread *receiverThread, CTaxonomyPremisingQuery *query) : CCustomEvent(EVENTQUERIEDTAXCOMPUTEDCALLBACK) { this->query = query; queryString = query->getQueryString(); queryName = query->getQueryName(); recThread = receiverThread; } CQueriedTaxonomyComputedCallbackEvent::~CQueriedTaxonomyComputedCallbackEvent() { } void CQueriedTaxonomyComputedCallbackEvent::doCallback() { if (recThread) { recThread->postEvent(this); } } QString CQueriedTaxonomyComputedCallbackEvent::getQueryString() { return queryString; } QString CQueriedTaxonomyComputedCallbackEvent::getQueryName() { return queryName; } CTaxonomyPremisingQuery *CQueriedTaxonomyComputedCallbackEvent::getQuery() { return query; } }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CReasoningSatisfiableCalculationJobEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CReasoningSatisfiableCalculatio0000644000175000017500000000501712520551046032224 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CCALCBOXSATISFIABLEEVENT_H #define KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CCALCBOXSATISFIABLEEVENT_H // Libraries includes // Namespace includes #include "../ManagerSettings.h" // Other includes #include "Reasoner/Query/CSatisfiableCalculationJob.h" #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Reasoner { using namespace Query; namespace Kernel { namespace Manager { namespace Events { /*! * \class CReasoningSatisfiableCalculationJobEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CReasoningSatisfiableCalculationJobEvent : public CCustomEvent { // public methods public: //! Constructor CReasoningSatisfiableCalculationJobEvent(CSatisfiableCalculationJob *satCalcJob, CCallbackData *callback); //! Destructor virtual ~CReasoningSatisfiableCalculationJobEvent(); CSatisfiableCalculationJob *getSatisfiableCalculationJob(); CCallbackData *getCallbackData(); static const QEvent::Type EVENTTYPE = EVENTREASONINGSATISFIABLECALCULATIONJOB; // protected methods protected: // protected variables protected: CSatisfiableCalculationJob *mSatCalcJob; CCallbackData *mCallbackData; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CCALCBOXSATISFIABLEEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CCalcQueryEvent.h0000644000175000017500000000440712520551046027251 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CCALCQUERYEVENT_H #define KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CCALCQUERYEVENT_H // Libraries includes // Namespace includes #include "../ManagerSettings.h" // Other includes #include "Reasoner/Query/CQuery.h" #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Reasoner { using namespace Query; namespace Kernel { namespace Manager { namespace Events { /*! * \class CCalcQueryEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CCalcQueryEvent : public CCustomEvent { // public methods public: //! Constructor CCalcQueryEvent(CQuery *query, CCallbackData *callback); //! Destructor virtual ~CCalcQueryEvent(); CQuery *getQuery(); CCallbackData *getCallbackData(); static const QEvent::Type EVENTTYPE = EVENTCALCQUERY; // protected methods protected: // protected variables protected: CQuery *query; CCallbackData *callbackData; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CCALCQUERYEVENT_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CQueriedTaxonomyComputedCallbackEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/Events/CQueriedTaxonomyComputedCallbac0000644000175000017500000000530512520551046032227 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CQUERIEDTAXONOMYCOMPUTEDCALLBACKEVENT_H #define KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CQUERIEDTAXONOMYCOMPUTEDCALLBACKEVENT_H // Libraries includes #include // Namespace includes #include "../ManagerSettings.h" // Other includes #include "Reasoner/Query/CQuery.h" #include "Reasoner/Query/CTaxonomyPremisingQuery.h" #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Reasoner { using namespace Query; namespace Kernel { namespace Manager { namespace Events { /*! * \class CQueriedTaxonomyComputedCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CQueriedTaxonomyComputedCallbackEvent : public CCustomEvent, public CCallbackData { // public methods public: //! Constructor CQueriedTaxonomyComputedCallbackEvent(CThread *receiverThread, CTaxonomyPremisingQuery *query); //! Destructor virtual ~CQueriedTaxonomyComputedCallbackEvent(); virtual void doCallback(); virtual CTaxonomyPremisingQuery *getQuery(); virtual QString getQueryString(); virtual QString getQueryName(); static const QEvent::Type EVENTTYPE = EVENTQUERIEDTAXCOMPUTEDCALLBACK; // protected methods protected: // protected variables protected: CTaxonomyPremisingQuery *query; CThread *recThread; QString queryString; QString queryName; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_EVENTS_CQUERIEDTAXONOMYCOMPUTEDCALLBACKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CReasonerManager.h0000644000175000017500000000721412520551050026156 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_CREASONERMANAGER_H #define KONCLUDE_REASONER_KERNEL_MANAGER_CREASONERMANAGER_H // Libraries includes // Namespace includes #include "ManagerSettings.h" // Other includes #include "Reasoner/Kernel/Calculation/CCalculationManager.h" #include "Reasoner/Query/CQuery.h" #include "Reasoner/Query/CSatisfiableCalculationJob.h" #include "Reasoner/Query/CJobSatisfiableResult.h" #include "Reasoner/Kernel/Cache/CUnsatisfiableCache.h" #include "Reasoner/Kernel/Cache/CSatisfiableCache.h" #include "Reasoner/Kernel/Cache/CCompletionGraphCache.h" #include "Reasoner/Kernel/Cache/CBackendCache.h" #include "Reasoner/Kernel/Cache/CSaturationCache.h" #include "Config/CConfigurationProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Query; namespace Kernel { using namespace Cache; using namespace Task; using namespace Calculation; namespace Manager { /*! * * \class CReasonerManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerManager { // public methods public: //! Constructor CReasonerManager(); //! Destructor virtual ~CReasonerManager(); virtual CReasonerManager* reasoningSatisfiableCalcualtionJob(CSatisfiableCalculationJob* satCalcJob, CCallbackData* callback) = 0; virtual CJobSatisfiableResult* reasoningSatisfiableCalcualtionJob(CSatisfiableCalculationJob* satCalcJob) = 0; virtual CReasonerManager* reasoningQuery(CQuery *query, CCallbackData *callback) = 0; virtual CReasonerManager* reasoningQuery(CQuery *query) = 0; virtual CReasonerManager* prepareOntology(CConcreteOntology* ontology, const QList& reqList, CCallbackData *callback) = 0; virtual CReasonerManager* prepareOntology(CConcreteOntology* ontology, const QList& reqList) = 0; virtual CUnsatisfiableCache *getUnsatisfiableCache() = 0; virtual CCompletionGraphCache *getCompletionGraphCache() = 0; virtual CBackendCache* getBackendAssociationCache() = 0; virtual CSaturationCache* getSaturationAssociationExpansionCache() = 0; virtual CCalculationManager *getCalculationManager() = 0; virtual CPrecomputationManager* getPrecomputationManager() = 0; virtual CReasonerManager *initializeManager(CConfigurationProvider *configurationProvider) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_CREASONERMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CExperimentalReasonerManager.cpp0000644000175000017500000000521312520551050031064 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExperimentalReasonerManager.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { CExperimentalReasonerManager::CExperimentalReasonerManager(CWatchDog *threadWatchDog) : CAnalyseReasonerManager(threadWatchDog) { } CExperimentalReasonerManager::~CExperimentalReasonerManager() { } void CExperimentalReasonerManager::threadStarted() { CIntervalThread::threadStarted(); // generate worker framework LOG(WARNING,"::Konclude::Reasoner::Kernel::ExperimentalReasonerManager",logTr("Initializing EXPERIMENTAL Reasoner."),this); unsatCache = new COccurrenceUnsatisfiableCache(mWorkControllerCount+2); mSatExpCache = new CSignatureSatisfiableExpanderCache(configProvider->getCurrentConfiguration()); mReuseCompGraphCache = new CReuseCompletionGraphCache(); mSatNodeExpCache = new CSaturationNodeAssociatedExpansionCache(configProvider->getCurrentConfiguration()); mCompConsCache = new CComputedConsequencesCache(configProvider->getCurrentConfiguration()); mBackendAssCache = new CBackendRepresentativeMemoryCache(configProvider->getCurrentConfiguration()); CConfigDependedCalculationFactory* calcFactory = new CConfigDependedCalculationFactory(this); CCalculationManager* calculationManager = calcFactory->createCalculationManager(configProvider); calcFactory->initializeManager(calculationManager,configProvider); mCalculationManager = calculationManager; cint64 workExecuterPerControllerCount = 1; LOG(INFO,"::Konclude::Reasoner::Kernel::ExperimentalReasonerManager",logTr("Reasoner initialized with %1 processing unit(s).").arg(mWorkControllerCount),this); startTimerWithInterval(PROGRESSQUERYTIMER,10000); } }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CAnalyseReasonerManager.cpp0000644000175000017500000002731212520551046030034 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseReasonerManager.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { CAnalyseReasonerManager::CAnalyseReasonerManager(CWatchDog *threadWatchDog) : CReasonerManagerThread(threadWatchDog) { mWatchDog = threadWatchDog; } CAnalyseReasonerManager::~CAnalyseReasonerManager() { } void CAnalyseReasonerManager::logQueryProgressUpdates() { bool activeCalculation = false; CConcurrentTaskCalculationEnvironment* calcEnv = dynamic_cast(mCalculationManager->getCalculationContext()); if (calcEnv) { double approxRemainingTasksCount = calcEnv->getCalculationApproximatedRemainingTasksCount(); cint64 computedTasksCount = calcEnv->getCalculationStatisticTasksProcessedCount(); double computedTime = calcEnv->getCalculationComputionTime()/(double)mWorkControllerCount; if (approxRemainingTasksCount >= 1 && computedTasksCount >= 1 && computedTime >= 1) { LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Calculation progress:"),this); QHash* mCalcStatHash = mCalculationManager->getCalculationStatistics(); if (mCalcStatHash) { QString compTime = getLoggingCalculationStatisticsTimeSizeString(mCalcStatHash->value("calculation-computing-time")/(double)mWorkControllerCount); QString memCons = getLoggingCalculationStatisticsMemorySizeString(mCalcStatHash->value("calculation-memory-consumption")); QString statString = QString("Up to now calculation computing time: %1, calculation memory consumption: %2") .arg(compTime) .arg(memCons); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",statString,this); delete mCalcStatHash; } double timePerTask = (double)computedTime/(double)computedTasksCount; double approxRemainingTime = approxRemainingTasksCount*timePerTask; QString approxRemainingTimeString; if (approxRemainingTime > 0) { approxRemainingTimeString = getLoggingCalculationStatisticsTimeSizeString(approxRemainingTime); } else { approxRemainingTimeString = QString("very very long"); } double progress = computedTasksCount/(approxRemainingTasksCount+computedTasksCount)*100.; QString statString1 = QString("Processed tasks: %1, approximated remaining tasks: %2") .arg(computedTasksCount) .arg(approxRemainingTasksCount); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",statString1,this); QString statString2 = QString("Approximated remaining calculation time: %1, approximated calculation progress: %2 %\r\n") .arg(approxRemainingTimeString) .arg(progress); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",statString2,this); activeCalculation = true; } } if (classificationMan) { CClassificationProgress* classifProgress = classificationMan->getClassificationProgress(); if (classifProgress) { if (classifProgress->getTestedClasses() != classifProgress->getTotalClasses() || classifProgress->getTestedSubsumptions() != classifProgress->getTotalSubsumptions()) { LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Classification progress:"),this); QString remainingTimeString = getLoggingCalculationStatisticsTimeSizeString(classifProgress->getRemainingMilliSeconds()); QString statString1 = QString("Satisfiable tested classes: %1, approximated remaining classes to test: %2") .arg(classifProgress->getTestedClasses()) .arg(classifProgress->getTotalClasses()-classifProgress->getTestedClasses()); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",statString1,this); if (classifProgress->getTotalSubsumptions() >= 0) { QString statString2 = QString("Tested subsumptions: %1, approximated remaining subsumptions to test: %2") .arg(classifProgress->getTestedSubsumptions()) .arg(classifProgress->getTotalSubsumptions()-classifProgress->getTestedSubsumptions()); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",statString2,this); } QString statString3 = QString("Approximated remaining classification time: %1, approximated classification progress: %2 %\r\n") .arg(remainingTimeString) .arg(classifProgress->getProgessPercent()); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",statString3,this); activeCalculation = true; } } } if (mRealizationManager) { CRealizationProgress* realProgress = mRealizationManager->getRealizationProgress(); if (realProgress) { if (realProgress->getTestedClasses() != realProgress->getTotalClasses()) { LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Realization progress:"),this); QString remainingTimeString = getLoggingCalculationStatisticsTimeSizeString(realProgress->getRemainingMilliSeconds()); QString statString1 = QString("Tested instantiations: %1, approximated remaining instantiations to test: %2") .arg(realProgress->getTestedClasses()) .arg(realProgress->getTotalClasses()-realProgress->getTestedClasses()); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",statString1,this); QString statString3 = QString("Approximated remaining realization time: %1, approximated realization progress: %2 %\r\n") .arg(remainingTimeString) .arg(realProgress->getProgessPercent()); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",statString3,this); activeCalculation = true; } } } if (activeCalculation) { if (mSatExpCache) { CCacheStatistics* cacheStats = mSatExpCache->getCacheStatistics(); QString statString3 = QString("Satisfiable-Expander-Cache statistics: %1 cache entries, %2 memory consumption") .arg(cacheStats->getCacheEntriesCount()) .arg(getLoggingCalculationStatisticsMemorySizeString(cacheStats->getMemoryConsumption())); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",statString3,this); } if (unsatCache) { CCacheStatistics* cacheStats = unsatCache->getCacheStatistics(); QString statString3 = QString("Unsatisfiable-Cache statistics: %1 cache entries, %2 memory consumption\r\n") .arg(cacheStats->getCacheEntriesCount()) .arg(getLoggingCalculationStatisticsMemorySizeString(cacheStats->getMemoryConsumption())); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",statString3,this); } } } double CAnalyseReasonerManager::getQueryProgress() { double progressPercent = 100; //double allTotalWork = 0; //double allClosedWork = 0; //CConcurrentWorkCalculationEnvironment *conCalcContext = dynamic_cast(mCalculationManager->getCalculationContext()); //CWorkRegistry *registry = conCalcContext->getWorkRegistry(); //workSyncMutex.lock(); //QList queryList = mCalculatingQuerySet.values(); //workSyncMutex.unlock(); //foreach (CQuery *query, queryList) { // CWorkProvidedQuery *workQuery = dynamic_cast(query); // if (workQuery) { // double totWorkCount = 0; // double closWorkCount = 0; // QLinkedList workList = workQuery->getWorkList(); // foreach (CWork *work, workList) { // CWorkLock *workLock = registry->getWorkLock(work); // if (workLock) { // CCalcBoxProcessWork *calcWork = dynamic_cast(work); // if (calcWork) { // closWorkCount += calcWork->getApproximatedClosedWorkCount(); // totWorkCount += calcWork->getApproximatedTotalWorkCount(); // } // workLock->releaseLock(); // delete workLock; // } // } // allTotalWork += totWorkCount; // allClosedWork += closWorkCount; // } //} //if (allTotalWork > 0) { // progressPercent = allClosedWork / allTotalWork * 100.; //} return progressPercent; } double CAnalyseReasonerManager::getQueryTotalWorkCount() { double allTotalWork = 0; //double allClosedWork = 0; //CConcurrentWorkCalculationEnvironment *conCalcContext = dynamic_cast(mCalculationManager->getCalculationContext()); //CWorkRegistry *registry = conCalcContext->getWorkRegistry(); //workSyncMutex.lock(); //QList queryList = mCalculatingQuerySet.values(); //workSyncMutex.unlock(); //foreach (CQuery *query, queryList) { // CWorkProvidedQuery *workQuery = dynamic_cast(query); // if (workQuery) { // double totWorkCount = 0; // double closWorkCount = 0; // QLinkedList workList = workQuery->getWorkList(); // foreach (CWork *work, workList) { // CWorkLock *workLock = registry->getWorkLock(work); // if (workLock) { // CCalcBoxProcessWork *calcWork = dynamic_cast(work); // if (calcWork) { // closWorkCount += calcWork->getApproximatedClosedWorkCount(); // totWorkCount += calcWork->getApproximatedTotalWorkCount(); // } // workLock->releaseLock(); // delete workLock; // } // } // allTotalWork += totWorkCount; // allClosedWork += closWorkCount; // } //} return allTotalWork; } double CAnalyseReasonerManager::getQueryCalculatedWorkCount() { double allTotalWork = 0; double allClosedWork = 0; //CConcurrentWorkCalculationEnvironment *conCalcContext = dynamic_cast(mCalculationManager->getCalculationContext()); //CWorkRegistry *registry = conCalcContext->getWorkRegistry(); //workSyncMutex.lock(); //QList queryList = mCalculatingQuerySet.values(); //workSyncMutex.unlock(); //foreach (CQuery *query, queryList) { // CWorkProvidedQuery *workQuery = dynamic_cast(query); // if (workQuery) { // double totWorkCount = 0; // double closWorkCount = 0; // QLinkedList workList = workQuery->getWorkList(); // foreach (CWork *work, workList) { // CWorkLock *workLock = registry->getWorkLock(work); // if (workLock) { // CCalcBoxProcessWork *calcWork = dynamic_cast(work); // if (calcWork) { // closWorkCount += calcWork->getApproximatedClosedWorkCount(); // totWorkCount += calcWork->getApproximatedTotalWorkCount(); // } // workLock->releaseLock(); // delete workLock; // } // } // allTotalWork += totWorkCount; // allClosedWork += closWorkCount; // } //} return allClosedWork; } }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/ManagerSettings.h0000644000175000017500000000441212520551052026074 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_MANAGERSETTINGS #define KONCLUDE_REASONER_KERNEL_MANAGER_MANAGERSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { /*! * * \file KernelSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declaration class CPrecomputationManager; class CPreprocessingManager; class CReasonerManager; class CRequirementPreparingData; class CReasoningTaskData; // Custom Events >= 2000 const QEvent::Type EVENTJOBCALCULATEDSATISFIABLECALLBACK = (QEvent::Type)2000; const QEvent::Type EVENTREASONINGSATISFIABLECALCULATIONJOB = (QEvent::Type)2001; const QEvent::Type EVENTCALCQUERY = (QEvent::Type)2002; const QEvent::Type EVENTCALCEDQUERY = (QEvent::Type)2003; const QEvent::Type EVENTQUERIEDTAXCOMPUTEDCALLBACK = (QEvent::Type)2004; const QEvent::Type EVENTQUERYJOBCALCULATEDSATISFIABLECALLBACK = (QEvent::Type)2005; const QEvent::Type EVENTREQUIREMENTPROCESSEDCALLBACK = (QEvent::Type)2006; const QEvent::Type EVENTPREPAREONTOLOGY = (QEvent::Type)2007; }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_KERNEL_MANAGER_MANAGERSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/COntologyRequirementPreparingData.h0000644000175000017500000000622012520551050031576 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_CONTOLOGYREQUIREMENTPREPARINGDATA_H #define KONCLUDE_REASONER_KERNEL_MANAGER_CONTOLOGYREQUIREMENTPREPARINGDATA_H // Libraries includes #include #include // Namespace includes #include "ManagerSettings.h" #include "COntologyRequirementPreparingData.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Reasoner/Ontology/COntologyProcessingStepRequirement.h" #include "Reasoner/Ontology/COntologyProcessingConceptSaturationRequirement.h" #include "Reasoner/Query/CQuery.h" #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; namespace Reasoner { using namespace Query; using namespace Ontology; namespace Kernel { namespace Manager { /*! * * \class COntologyRequirementPreparingData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyRequirementPreparingData { // public methods public: //! Constructor COntologyRequirementPreparingData(CConcreteOntology* ontology); virtual ~COntologyRequirementPreparingData(); COntologyRequirementPreparingData* addOntologyRequirement(COntologyProcessingRequirement* requirement); bool mRequirementsProcessed; CConcreteOntology* mOntology; QList mPreprocessorReqList; QList mPrecomputorReqList; QList mClassifierReqList; QList mRealizerReqList; QList mCheckingReqList; QList mFailedReqList; QList mAllReqList; COntologyProcessingStep::PROCESSORTYPE mCheckingProcessorType; QTime mCheckingTimer; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_CONTOLOGYREQUIREMENTPREPARINGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/COntologyRequirementPreparingData.cpp0000644000175000017500000000553612520551050032142 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyRequirementPreparingData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { COntologyRequirementPreparingData::COntologyRequirementPreparingData(CConcreteOntology* ontology) { mOntology = ontology; mRequirementsProcessed = false; } COntologyRequirementPreparingData::~COntologyRequirementPreparingData() { foreach (COntologyProcessingRequirement* requirement, mAllReqList) { if (requirement->isDynamicRequirement()) { delete requirement; } } } COntologyRequirementPreparingData* COntologyRequirementPreparingData::addOntologyRequirement(COntologyProcessingRequirement* requirement) { mAllReqList.append(requirement); bool addedReq = false; COntologyProcessingStepRequirement* requirementStep = dynamic_cast(requirement); if (requirementStep) { COntologyProcessingStep::PROCESSORTYPE proType = requirementStep->getRequiredProcessingStep()->getProcessorType(); if (proType == COntologyProcessingStep::OPPREPROCESSOR) { mPreprocessorReqList.append(requirement); addedReq = true; } else if (proType == COntologyProcessingStep::OPPRECOMPUTER) { mPrecomputorReqList.append(requirement); addedReq = true; } else if (proType == COntologyProcessingStep::OPCLASSCLASSIFIER) { mClassifierReqList.append(requirement); addedReq = true; } else if (proType == COntologyProcessingStep::OPREALIZER) { mRealizerReqList.append(requirement); addedReq = true; } } COntologyProcessingConceptSaturationRequirement* conSatRequirement = dynamic_cast(requirement); if (conSatRequirement) { mPrecomputorReqList.append(requirement); addedReq = true; } if (!addedReq) { mFailedReqList.append(requirement); } return this; } }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CReasonerManagerThread.h0000644000175000017500000002516612520551050027314 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_CREASONERMANAGERTHREAD_H #define KONCLUDE_REASONER_KERNEL_MANAGER_CREASONERMANAGERTHREAD_H // Qt includes #include #include // Namespace includes #include "CReasonerManager.h" #include "CPrecomputationManager.h" #include "CPreprocessingManager.h" #include "COntologyRequirementPair.h" #include "CRequirementPreparingData.h" #include "CReasoningTaskData.h" #include "CRealizationManager.h" // Other includes #include "Reasoner/Kernel/Calculation/CCalculationManager.h" #include "Reasoner/Kernel/Calculation/CConfigDependedCalculationEnvironmentFactory.h" #include "Reasoner/Kernel/Calculation/CTaskHandleAlgorithmBuilder.h" #include "Reasoner/Kernel/Calculation/CConfigDependedCalculationFactory.h" #include "Reasoner/Kernel/Algorithm/CCalculationTableauCompletionTaskHandleAlgorithm.h" #include "Reasoner/Kernel/Algorithm/CCalculationTableauApproximationSaturationTaskHandleAlgorithm.h" #include "Reasoner/Kernel/Algorithm/CCalculationChooseTaskHandleAlgorithm.h" #include "Reasoner/Kernel/Algorithm/CUnsatisfiableCacheHandler.h" #include "Reasoner/Kernel/Algorithm/CSatisfiableExpanderCacheHandler.h" #include "Reasoner/Kernel/Algorithm/CReuseCompletionGraphCacheHandler.h" #include "Reasoner/Kernel/Algorithm/CSaturationNodeExpansionCacheHandler.h" #include "Reasoner/Kernel/Algorithm/CSaturationNodeBackendAssociationCacheHandler.h" #include "Reasoner/Kernel/Algorithm/CIndividualNodeBackendCacheHandler.h" #include "Reasoner/Ontology/COntologyProcessingRequirementExpander.h" #include "Reasoner/Ontology/COntologyProcessingStepRequirement.h" #include "Reasoner/Ontology/COntologyProcessingStepVector.h" #include "Reasoner/Ontology/COntologyProcessingConceptSaturationRequirement.h" #include "Reasoner/Query/CJobSatisfiableCallbackContextData.h" #include "Reasoner/Query/CJobProvidedQuery.h" #include "Reasoner/Query/CRealizationPremisingQuery.h" #include "Reasoner/Query/CTaxonomyPremisingQuery.h" #include "Reasoner/Query/CConsistencePremisingQuery.h" #include "Reasoner/Query/CQueryInconsitentOntologyError.h" #include "Reasoner/Query/CQueryUnspecifiedStringError.h" #include "Reasoner/Query/CIsTriviallyConsistentQuery.h" #include "Reasoner/Kernel/Manager/Events/CJobCalculatedSatisfiableCallbackEvent.h" #include "Reasoner/Kernel/Manager/Events/CReasoningSatisfiableCalculationJobEvent.h" #include "Reasoner/Kernel/Manager/Events/CCalcQueryEvent.h" #include "Reasoner/Kernel/Manager/Events/CCalcedQueryEvent.h" #include "Reasoner/Kernel/Manager/Events/CQueriedTaxonomyComputedCallbackEvent.h" #include "Reasoner/Kernel/Manager/Events/CQueryJobCalculatedSatisfiableCallbackEvent.h" #include "Reasoner/Kernel/Manager/Events/CRequirementProcessedCallbackEvent.h" #include "Reasoner/Kernel/Manager/Events/CPrepareOntologyEvent.h" #include "Concurrent/CIntervalThread.h" #include "Concurrent/Callback/CBlockingCallbackData.h" #include "Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCache.h" #include "Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheReader.h" #include "Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheWriter.h" #include "Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCache.h" #include "Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheWriter.h" #include "Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheReader.h" #include "Reasoner/Kernel/Cache/CReuseCompletionGraphCache.h" #include "Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCache.h" #include "Reasoner/Kernel/Cache/CComputedConsequencesCache.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCache.h" #include "Reasoner/Classifier/CClassificationManager.h" #include "Reasoner/Classifier/CClassifiedCallbackDataContext.h" #include "Config/CGlobalConfigurationProvider.h" #include "Config/CConfigDataReader.h" #include "Control/Command/CConfigManagerReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Concurrent; using namespace Callback; using namespace Scheduler; using namespace Control::Command; namespace Reasoner { using namespace Query; using namespace Classifier; using namespace Ontology; using namespace Preprocess; using namespace Consistiser; namespace Kernel { using namespace Cache; using namespace Task; using namespace Calculation; using namespace Algorithm; namespace Manager { using namespace Events; /*! * * \class CReasonerManagerThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerManagerThread : public CReasonerManager, public CIntervalThread, public CTaskHandleAlgorithmBuilder { // public methods public: //! Constructor CReasonerManagerThread(CWatchDog *threadWatchDog = 0); //! Destructor virtual ~CReasonerManagerThread(); virtual CReasonerManager* reasoningSatisfiableCalcualtionJob(CSatisfiableCalculationJob* satCalcJob, CCallbackData* callback); virtual CJobSatisfiableResult* reasoningSatisfiableCalcualtionJob(CSatisfiableCalculationJob* satCalcJob); virtual CReasonerManager* reasoningQuery(CQuery *query, CCallbackData *callback); virtual CReasonerManager* reasoningQuery(CQuery *query); virtual CReasonerManager* prepareOntology(CConcreteOntology* ontology, const QList& reqList, CCallbackData *callback); virtual CReasonerManager* prepareOntology(CConcreteOntology* ontology, const QList& reqList); virtual CUnsatisfiableCache *getUnsatisfiableCache(); virtual CCompletionGraphCache *getCompletionGraphCache(); virtual CBackendCache* getBackendAssociationCache(); virtual CSaturationCache* getSaturationAssociationExpansionCache(); virtual CReasonerManager *initializeManager(CConfigurationProvider *configurationProvider); virtual CTaskHandleAlgorithm *createTaskHandleAlgorithm(); virtual CCalculationManager *getCalculationManager(); virtual CPrecomputationManager* getPrecomputationManager(); virtual CPreprocessingManager* getPreprocessingManager(); virtual CRealizationManager* getRealizationManager(); // protected methods protected: virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); virtual void threadStarted(); virtual void threadStopped(); virtual void logQueryProgressUpdates(); virtual void readConfig(CConfigurationBase *config); virtual bool processTimer(qint64 timerID); virtual const QList getRequirementsForQuery(CQuery* query); virtual void prepareOntologyReasoning(CPrepareOntologyEvent* poe); virtual void prepareQueryReasoning(CCalcQueryEvent *cqe); virtual void initiateQueryReasoning(CQuery* query, CCallbackData* callbackData, CReasoningTaskData* reasoningData, const QList& failedRequirementList); virtual void continueRequirementProcessing(CRequirementPreparingData* reqData, CConcreteOntology* ontology); virtual void finishQueryReasoning(CCalcedQueryEvent *cqe); virtual void prepareSatisfiableBoxReasoning(CReasoningSatisfiableCalculationJobEvent *cbse); virtual void finishSatisfiableBoxReasoning(CJobCalculatedSatisfiableCallbackEvent *cbsce); virtual void finishQuerySatisfiableBoxReasoning(CQueryJobCalculatedSatisfiableCallbackEvent *cbsce); virtual void loggingCalculationStatistics(); virtual QString getLoggingCalculationStatisticsTimeSizeString(double milliseconds); virtual QString getLoggingCalculationStatisticsMemorySizeString(cint64 memSize); // protected variables protected: CWatchDog *mWatchDog; QHash mReasoningTaskDataHash; QHash mQueryCallbackHash; QHash mJobCallbackHash; QSet mProcessingRequirementsSet; QSet mCalculatingQuerySet; QSet mCalcJobSet; QSet< QPair > mProcessingStartMessageSet; QSet< QPair > mProcessingEndMessageSet; QHash mCalcQueryJobStartTimeHash; COccurrenceUnsatisfiableCache *unsatCache; CSignatureSatisfiableExpanderCache* mSatExpCache; CReuseCompletionGraphCache* mReuseCompGraphCache; CSaturationNodeAssociatedExpansionCache* mSatNodeExpCache; CComputedConsequencesCache* mCompConsCache; CBackendRepresentativeMemoryCache* mBackendAssCache; static const qint64 PROGRESSQUERYTIMER = 1; CConfigurationProvider* configProvider; CClassificationManager* classificationMan; CCalculationManager* mCalculationManager; CPrecomputationManager* mPrecomputationManager; CPreprocessingManager* mPreprocessingManager; CRealizationManager* mRealizationManager; COntologyProcessingRequirementExpander* mRequirementExpander; cint64 mWorkControllerCount; // private methods private: bool updateBeginingCalculationStatistics(CReasoningTaskData* reaTaskData, CConfiguration* config = nullptr); bool updateFinishingCalculationStatistics(CReasoningTaskData* reaTaskData, CQueryStatistics* queryStat, CConfiguration* config = nullptr); // private variables private: }; }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_CREASONERMANAGERTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/COntologyRequirementPair.cpp0000644000175000017500000000235412520551050030307 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyRequirementPair.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { COntologyRequirementPair::COntologyRequirementPair(CConcreteOntology* ontology, COntologyProcessingRequirement* requirement) { mOntology = ontology; mRequirement = requirement; } }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CRealizationManager.h0000644000175000017500000000510212520551050026653 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_CREALIZATIONMANAGER_H #define KONCLUDE_REASONER_KERNEL_MANAGER_CREALIZATIONMANAGER_H // Libraries includes #include #include // Namespace includes #include "ManagerSettings.h" // Other includes #include "Reasoner/Realizer/CRealizer.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Config/CConfigurationProvider.h" #include "Control/Command/CConfigManagerReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Control::Command; namespace Reasoner { using namespace Realizer; using namespace Ontology; namespace Kernel { namespace Manager { /*! * * \class CRealizationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealizationManager { // public methods public: //! Constructor CRealizationManager(CReasonerManager* reasonerManager); //! Destructor virtual ~CRealizationManager(); virtual CRealizer* getRealizer(CConcreteOntology *ontology, CConfigurationBase *config); virtual CRealizationProgress* getRealizationProgress(); // protected methods protected: // protected variables protected: CReasonerManager* mReasonerManager; QReadWriteLock mReadWriteLock; QHash mOntoRealizerHash; QSet mRealizerSet; CRealizationProgress mRealizationProgress; // private methods private: // private variables private: }; }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_CREALIZATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CReasonerManager.cpp0000644000175000017500000000220312520551050026502 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerManager.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { CReasonerManager::CReasonerManager() { } CReasonerManager::~CReasonerManager() { } }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CRequirementPreparingData.cpp0000644000175000017500000000357712520551052030414 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRequirementPreparingData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { CRequirementPreparingData::CRequirementPreparingData(CCallbackData* callback, CQuery* query, CReasoningTaskData* reasoningData) { mCallback = callback; mQuery = query; mDepCount = 0; mReasoningData = reasoningData; mRequirementFailed = false; } CRequirementPreparingData::~CRequirementPreparingData() { qDeleteAll(mOntoReqDataContainer); } COntologyRequirementPreparingData* CRequirementPreparingData::getOntologyRequirementPreparingData(CConcreteOntology* ontology) { COntologyRequirementPreparingData* onReqPrepData = mOntoReqDataHash.value(ontology); if (!onReqPrepData) { onReqPrepData = new COntologyRequirementPreparingData(ontology); mOntoReqDataHash.insert(ontology,onReqPrepData); mOntoReqDataContainer.append(onReqPrepData); } return onReqPrepData; } }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/COntologyRequirementPair.h0000644000175000017500000000412312520551050027750 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_CONTOLOGYREQUIREMENTPAIR_H #define KONCLUDE_REASONER_KERNEL_MANAGER_CONTOLOGYREQUIREMENTPAIR_H // Libraries includes // Namespace includes #include "ManagerSettings.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Manager { /*! * * \class COntologyRequirementPair * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyRequirementPair { // public methods public: //! Constructor COntologyRequirementPair(CConcreteOntology* ontology, COntologyProcessingRequirement* requirement); CConcreteOntology* mOntology; COntologyProcessingRequirement* mRequirement; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_CONTOLOGYREQUIREMENTPAIR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CExperimentalReasonerManager.h0000644000175000017500000000426412520551050030536 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_CEXPERIMENTALREASONERMANAGER_H #define KONCLUDE_REASONER_KERNEL_MANAGER_CEXPERIMENTALREASONERMANAGER_H // Libraries includes #include // Namespace includes #include "CReasonerManager.h" #include "CAnalyseReasonerManager.h" // Other includes #include "Concurrent/CThread.h" #include "Concurrent/Callback/CBlockingCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; using namespace Callback; namespace Reasoner { namespace Kernel { namespace Manager { /*! * * \class CExperimentalReasonerManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExperimentalReasonerManager : public CAnalyseReasonerManager { // public methods public: //! Constructor CExperimentalReasonerManager(CWatchDog *threadWatchDog = 0); //! Destructor virtual ~CExperimentalReasonerManager(); // protected methods protected: virtual void threadStarted(); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_CEXPERIMENTALREASONERMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CAnalyseReasonerManager.h0000644000175000017500000000437712520551050027502 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_CANALYSEREASONERMANAGER_H #define KONCLUDE_REASONER_KERNEL_MANAGER_CANALYSEREASONERMANAGER_H // Qt includes #include // Namespace includes #include "CReasonerManagerThread.h" // Other includes #include "Concurrent/CThread.h" #include "Concurrent/Callback/CBlockingCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; using namespace Callback; namespace Reasoner { namespace Kernel { namespace Manager { /*! * * \class CAnalyseReasonerManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseReasonerManager : public CReasonerManagerThread { // public methods public: //! Constructor CAnalyseReasonerManager(CWatchDog *threadWatchDog = 0); //! Destructor virtual ~CAnalyseReasonerManager(); virtual void logQueryProgressUpdates(); virtual double getQueryProgress(); virtual double getQueryTotalWorkCount(); virtual double getQueryCalculatedWorkCount(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_CANALYSEREASONERMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CRequirementPreparingData.h0000644000175000017500000000554312520551052030054 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_CREQUIREMENTPREPARINGDATA_H #define KONCLUDE_REASONER_KERNEL_MANAGER_CREQUIREMENTPREPARINGDATA_H // Libraries includes #include #include // Namespace includes #include "ManagerSettings.h" #include "COntologyRequirementPreparingData.h" #include "COntologyRequirementPair.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Reasoner/Query/CQuery.h" #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; namespace Reasoner { using namespace Query; using namespace Ontology; namespace Kernel { namespace Manager { /*! * * \class CRequirementPreparingData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRequirementPreparingData { // public methods public: //! Constructor CRequirementPreparingData(CCallbackData* callback, CQuery* query, CReasoningTaskData* reasoningData); //! Destructor ~CRequirementPreparingData(); COntologyRequirementPreparingData* getOntologyRequirementPreparingData(CConcreteOntology* ontology); CCallbackData* mCallback; CQuery* mQuery; CReasoningTaskData* mReasoningData; bool mRequirementFailed; cint64 mDepCount; QHash mOntoReqDataHash; QList mFailedReqList; QList mSatisfiedReqList; QList mOntoReqDataContainer; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_CREQUIREMENTPREPARINGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CPrecomputationManager.h0000644000175000017500000000474112520551050027413 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_CPRECOMPUTATIONMANAGER_H #define KONCLUDE_REASONER_KERNEL_MANAGER_CPRECOMPUTATIONMANAGER_H // Libraries includes #include #include // Namespace includes #include "ManagerSettings.h" // Other includes #include "Reasoner/Consistiser/CPrecomputator.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Config/CConfigurationProvider.h" #include "Control/Command/CConfigManagerReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Control::Command; namespace Reasoner { using namespace Consistiser; using namespace Ontology; namespace Kernel { namespace Manager { /*! * * \class CPrecomputationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPrecomputationManager { // public methods public: //! Constructor CPrecomputationManager(CReasonerManager* reasonerManager); //! Destructor virtual ~CPrecomputationManager(); virtual CPrecomputator* getPrecomputator(CConcreteOntology *ontology, CConfigurationBase *config); // protected methods protected: // protected variables protected: CReasonerManager* mReasonerManager; QReadWriteLock mReadWriteLock; QHash mOntoPrecomputatorHash; // private methods private: // private variables private: }; }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_CPRECOMPUTATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CPreprocessingManager.cpp0000644000175000017500000000370012520551050027552 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreprocessingManager.h" #include "CReasonerManager.h" #include "Reasoner/Preprocess/CPreprocessor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { CPreprocessingManager::CPreprocessingManager(CReasonerManager* reasonerManager) { mReasonerManager = reasonerManager; } CPreprocessingManager::~CPreprocessingManager() { } CPreprocessor* CPreprocessingManager::getPreprocessor(CConcreteOntology *ontology, CConfigurationBase *config) { CPreprocessor* preprocessor = nullptr; mReadWriteLock.lockForRead(); preprocessor = mOntoPreprocessHash.value(ontology); mReadWriteLock.unlock(); if (!preprocessor) { mReadWriteLock.lockForWrite(); preprocessor = mOntoPreprocessHash.value(ontology); if (!preprocessor) { preprocessor = new CRequirementConfigPreprocessingThread(mReasonerManager); mOntoPreprocessHash.insert(ontology,preprocessor); } mReadWriteLock.unlock(); } return preprocessor; } }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CRealizationManager.cpp0000644000175000017500000000721012520551050027210 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizationManager.h" #include "CReasonerManager.h" #include "Reasoner/Realizer/COptimizedKPSetOntologyConceptRealizingThread.h" #include "Reasoner/Realizer/CIncrementalKPSetOntologyConceptRealizingThread.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { CRealizationManager::CRealizationManager(CReasonerManager* reasonerManager) { mReasonerManager = reasonerManager; } CRealizationManager::~CRealizationManager() { } CRealizer* CRealizationManager::getRealizer(CConcreteOntology *ontology, CConfigurationBase *config) { CRealizer* realizer = nullptr; mReadWriteLock.lockForRead(); realizer = mOntoRealizerHash.value(ontology); mReadWriteLock.unlock(); if (!realizer) { bool onlyChangedABoxAxioms = ontology->getIncrementalRevisionData()->getAxiomChangeData()->hasOnlyChangedABoxAxioms(); bool previousRealizedOntologyVersion = ontology->getIncrementalRevisionData()->getPreviousClassTypesRealizedOntology() != nullptr; mReadWriteLock.lockForWrite(); realizer = mOntoRealizerHash.value(ontology); if (!realizer) { if (previousRealizedOntologyVersion && onlyChangedABoxAxioms) { realizer = new CIncrementalKPSetOntologyConceptRealizingThread(mReasonerManager); } else { realizer = new COptimizedKPSetOntologyConceptRealizingThread(mReasonerManager); } mOntoRealizerHash.insert(ontology,realizer); mRealizerSet.insert(realizer); } mReadWriteLock.unlock(); } return realizer; } CRealizationProgress* CRealizationManager::getRealizationProgress() { CRealizationProgress newRealProg; mReadWriteLock.lockForRead(); double percentAvg = 0; cint64 percentCount = 0; foreach (CRealizer* realizer, mRealizerSet) { CRealizationProgress* realizationProgress = realizer->getRealizationProgress(); if (realizationProgress) { newRealProg.setTotalClasses(newRealProg.getTotalClasses()+realizationProgress->getTotalClasses()); newRealProg.setRealizationCount(newRealProg.getRealizationCount()+realizationProgress->getRealizationCount()); newRealProg.setTestedClasses(newRealProg.getTestedClasses()+realizationProgress->getTestedClasses()); newRealProg.setRemainingMilliSeconds(qMax(newRealProg.getRemainingMilliSeconds(),realizationProgress->getRemainingMilliSeconds())); percentAvg += realizationProgress->getProgessPercent(); ++percentCount; } } mReadWriteLock.unlock(); if (percentCount != 0) { percentAvg /= (double)percentCount; } newRealProg.setProgessPercent(percentAvg); mRealizationProgress = newRealProg; return &mRealizationProgress; } }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CReasoningTaskData.h0000644000175000017500000000451312520551052026450 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_MANAGER_CREASONINGTASKDATA_H #define KONCLUDE_REASONER_KERNEL_MANAGER_CREASONINGTASKDATA_H // Libraries includes #include #include // Namespace includes #include "ManagerSettings.h" #include "COntologyRequirementPreparingData.h" #include "COntologyRequirementPair.h" // Other includes #include "Reasoner/Kernel/Manager/Events/CCalcedQueryEvent.h" #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; namespace Reasoner { namespace Kernel { namespace Manager { using namespace Events; /*! * * \class CReasoningTaskData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasoningTaskData { // public methods public: //! Constructor CReasoningTaskData(); //! Destructor ~CReasoningTaskData(); CCallbackData* mCallback; CCalcedQueryEvent* mFinQueryCallback; QTime mStartTime; cint64 mDepCount; bool mAnswered; QHash* mCalcStat; CRequirementPreparingData* mReqPrepData; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_MANAGER_CREASONINGTASKDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CReasonerManagerThread.cpp0000644000175000017500000014123012574540350027650 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerManagerThread.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { CReasonerManagerThread::CReasonerManagerThread(CWatchDog *threadWatchDog) : CIntervalThread("Reasoner-Manager",threadWatchDog) { mWatchDog = threadWatchDog; mCalculationManager = 0; mPrecomputationManager = 0; mPreprocessingManager = 0; mRealizationManager = 0; } CReasonerManager *CReasonerManagerThread::initializeManager(CConfigurationProvider *configurationProvider) { //stopThread(); configProvider = configurationProvider; classificationMan = CConfigManagerReader::readClassificationManagerConfig(configProvider); bool configErrorFlag = false; mWorkControllerCount = 1; QString workerCountString = CConfigDataReader::readConfigString(configProvider,"Konclude.Calculation.WorkerCount",QString(),&configErrorFlag); if (!configErrorFlag) { if (workerCountString == "AUTO") { mWorkControllerCount = CThread::idealThreadCount(); } else { qint64 convertedWorkerCount = workerCountString.toInt(&configErrorFlag); if (configErrorFlag) { mWorkControllerCount = convertedWorkerCount; } } } configErrorFlag = false; cint64 processorCount = 0; QString processorCountString = CConfigDataReader::readConfigString(configProvider,"Konclude.Calculation.ProcessorCount",QString(),&configErrorFlag); if (!configErrorFlag) { if (processorCountString == "AUTO") { processorCount = CThread::idealThreadCount(); } else { qint64 convertedWorkerCount = processorCountString.toInt(&configErrorFlag); if (configErrorFlag) { processorCount = convertedWorkerCount; } } } mWorkControllerCount = qMax(processorCount,mWorkControllerCount); //if (!isRunning()) { mWatchDog = 0; unsatCache = 0; mSatExpCache = 0; mReuseCompGraphCache = 0; mSatNodeExpCache = 0; //} mPrecomputationManager = new CPrecomputationManager(this); mPreprocessingManager = new CPreprocessingManager(this); mRealizationManager = new CRealizationManager(this); mRequirementExpander = new COntologyProcessingRequirementExpander(); startThread(); return this; } CReasonerManagerThread::~CReasonerManagerThread() { stopThread(); } CReasonerManager* CReasonerManagerThread::reasoningSatisfiableCalcualtionJob(CSatisfiableCalculationJob* satCalcJob, CCallbackData* callback) { postEvent(new CReasoningSatisfiableCalculationJobEvent(satCalcJob,callback)); return this; } CJobSatisfiableResult* CReasonerManagerThread::reasoningSatisfiableCalcualtionJob(CSatisfiableCalculationJob* satCalcJob) { CJobSatisfiableCallbackContextData* satCalcData = nullptr; CBlockingCallbackData callback; postEvent(new CReasoningSatisfiableCalculationJobEvent(satCalcJob,&callback)); callback.waitForCallback(); satCalcData = (CJobSatisfiableCallbackContextData*)callback.takeCallbackDataContext(); return satCalcData; } CReasonerManager *CReasonerManagerThread::reasoningQuery(CQuery *query, CCallbackData *callback) { postEvent(new CCalcQueryEvent(query,callback)); return this; } CReasonerManager *CReasonerManagerThread::reasoningQuery(CQuery *query) { CBlockingCallbackData callback; postEvent(new CCalcQueryEvent(query,&callback)); callback.waitForCallback(); return this; } CReasonerManager *CReasonerManagerThread::prepareOntology(CConcreteOntology* ontology, const QList& reqList, CCallbackData *callback) { postEvent(new CPrepareOntologyEvent(ontology,reqList,callback)); return this; } CReasonerManager *CReasonerManagerThread::prepareOntology(CConcreteOntology* ontology, const QList& reqList) { CBlockingCallbackData callback; postEvent(new CPrepareOntologyEvent(ontology,reqList,&callback)); callback.waitForCallback(); return this; } CUnsatisfiableCache *CReasonerManagerThread::getUnsatisfiableCache() { return unsatCache; } CCompletionGraphCache *CReasonerManagerThread::getCompletionGraphCache() { return mReuseCompGraphCache; } CSaturationCache* CReasonerManagerThread::getSaturationAssociationExpansionCache() { return mSatNodeExpCache; } CBackendCache* CReasonerManagerThread::getBackendAssociationCache() { return mBackendAssCache; } CCalculationManager *CReasonerManagerThread::getCalculationManager() { return mCalculationManager; } CPrecomputationManager* CReasonerManagerThread::getPrecomputationManager() { return mPrecomputationManager; } CPreprocessingManager* CReasonerManagerThread::getPreprocessingManager() { return mPreprocessingManager; } CRealizationManager* CReasonerManagerThread::getRealizationManager() { return mRealizationManager; } void CReasonerManagerThread::readConfig(CConfigurationBase *config) { } CTaskHandleAlgorithm *CReasonerManagerThread::createTaskHandleAlgorithm() { CUnsatisfiableCacheHandler* unsatCacheHandler = nullptr; CSatisfiableExpanderCacheHandler* satExpCacheHandler = nullptr; CReuseCompletionGraphCacheHandler* reuseCompGraphCacheHandler = nullptr; CSaturationNodeExpansionCacheHandler* satNodeCacheHandler = nullptr; CComputedConsequencesCacheHandler* compConsCachHandler = nullptr; CSaturationNodeBackendAssociationCacheHandler* backendAssCacheHandler = nullptr; CIndividualNodeBackendCacheHandler* backendCacheHandler = nullptr; if (unsatCache) { unsatCacheHandler = new CUnsatisfiableCacheHandler(unsatCache->getCacheReader(),unsatCache->getCacheWriter()); } if (mSatExpCache) { satExpCacheHandler = new CSatisfiableExpanderCacheHandler(mSatExpCache->createCacheReader(),mSatExpCache->createCacheWriter()); } if (mReuseCompGraphCache) { reuseCompGraphCacheHandler = new CReuseCompletionGraphCacheHandler(mReuseCompGraphCache->createCacheReader(),mReuseCompGraphCache->createCacheWriter()); } if (mSatNodeExpCache) { satNodeCacheHandler = new CSaturationNodeExpansionCacheHandler(mSatNodeExpCache->createCacheReader(),mSatNodeExpCache->createCacheWriter()); } if (mCompConsCache) { compConsCachHandler = new CComputedConsequencesCacheHandler(mCompConsCache->createCacheReader(),mCompConsCache->createCacheWriter()); } if (mBackendAssCache) { backendAssCacheHandler = new CSaturationNodeBackendAssociationCacheHandler(mBackendAssCache->createCacheReader(),mBackendAssCache->createCacheWriter()); backendCacheHandler = new CIndividualNodeBackendCacheHandler(mBackendAssCache->createCacheReader(),mBackendAssCache->createCacheWriter()); } CCalculationTableauApproximationSaturationTaskHandleAlgorithm* approxSatHandleAlg = new CCalculationTableauApproximationSaturationTaskHandleAlgorithm(backendAssCacheHandler); CCalculationTableauCompletionTaskHandleAlgorithm* compTaskHandleAlg = new CCalculationTableauCompletionTaskHandleAlgorithm(unsatCacheHandler,satExpCacheHandler,reuseCompGraphCacheHandler,satNodeCacheHandler,compConsCachHandler,backendCacheHandler); return new CCalculationChooseTaskHandleAlgorithm(compTaskHandleAlg,approxSatHandleAlg); } void CReasonerManagerThread::threadStarted() { CIntervalThread::threadStarted(); // generate worker framework LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Initializing reasoner. Creating calculation context."),this); unsatCache = new COccurrenceUnsatisfiableCache(mWorkControllerCount+2); mSatExpCache = new CSignatureSatisfiableExpanderCache(configProvider->getCurrentConfiguration()); mReuseCompGraphCache = new CReuseCompletionGraphCache(); mSatNodeExpCache = new CSaturationNodeAssociatedExpansionCache(configProvider->getCurrentConfiguration()); mCompConsCache = new CComputedConsequencesCache(configProvider->getCurrentConfiguration()); mBackendAssCache = new CBackendRepresentativeMemoryCache(configProvider->getCurrentConfiguration()); CConfigDependedCalculationFactory* calcFactory = new CConfigDependedCalculationFactory(this); CCalculationManager* calculationManager = calcFactory->createCalculationManager(configProvider); calcFactory->initializeManager(calculationManager,configProvider); mCalculationManager = calculationManager; LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Reasoner initialized with %1 processing unit(s).").arg(mWorkControllerCount),this); startTimerWithInterval(PROGRESSQUERYTIMER,10000); } void CReasonerManagerThread::threadStopped() { CIntervalThread::threadStopped(); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Closing Reasoner."),this); //QThread::msleep(50); delete mCalculationManager; delete mPrecomputationManager; delete mPreprocessingManager; delete mRealizationManager; if (unsatCache) { unsatCache->stopThread(true); delete unsatCache; } if (mSatExpCache) { mSatExpCache->stopThread(true); delete mSatExpCache; } if (mReuseCompGraphCache) { mReuseCompGraphCache->stopThread(true); delete mReuseCompGraphCache; } if (mSatNodeExpCache) { mSatNodeExpCache->stopThread(true); delete mSatNodeExpCache; } LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Reasoner closed."),this); } void CReasonerManagerThread::logQueryProgressUpdates() { } bool CReasonerManagerThread::processTimer(qint64 timerID) { if (timerID == PROGRESSQUERYTIMER) { logQueryProgressUpdates(); return true; } return false; } const QList CReasonerManagerThread::getRequirementsForQuery(CQuery* query) { QList ontReqList; CSatisfiableCalculationJobsQuery* jobQuery = dynamic_cast(query); if (jobQuery) { QList reqList; reqList.append(mRequirementExpander->getRequiredIndividualPrecomputationOntologyProcessingStepRequirement()); CQUERYLIST jobList(jobQuery->getJobList()); foreach (CCalculationJob* calcJob, jobList) { CConcreteOntology* ontology = calcJob->getOntology(); QList ontSpecReqList = mRequirementExpander->getUnsatisfiedRequirementsExpanded(reqList,ontology); foreach (COntologyProcessingRequirement* ontReq, ontSpecReqList) { ontReqList.append(COntologyRequirementPair(ontology,ontReq)); } CSatisfiableCalculationJob* satCalcJob = dynamic_cast(calcJob); if (satCalcJob) { for (CSatisfiableCalculationConstruct* satCalcConstIt = satCalcJob->getSatisfiableCalculationConstructs(); satCalcConstIt; satCalcConstIt = satCalcConstIt->getNextConstruct()) { CSatisfiableCalculationConceptConstruct* satCalcConConstruct = dynamic_cast(satCalcConstIt); if (satCalcConConstruct) { for (CXSortedNegLinker* conConstIt = satCalcConConstruct->getConstructConceptLinker(); conConstIt; conConstIt = conConstIt->getNext()) { CConcept* concept = conConstIt->getData(); bool conceptNegation = conConstIt->isNegated(); COntologyProcessingConceptSaturationRequirement* conSatReq = new COntologyProcessingConceptSaturationRequirement(concept,conceptNegation); ontReqList.append(COntologyRequirementPair(ontology,conSatReq)); } } } } } } CConsistencePremisingQuery* consQuery = dynamic_cast(query); if (consQuery) { CConcreteOntology* ontology = consQuery->getOntology(); QList reqList; reqList.append(mRequirementExpander->getCompletedDefaultOntologyProcessingStepRequirement(COntologyProcessingStep::OPSCONSISTENCY)); reqList = mRequirementExpander->getUnsatisfiedRequirementsExpanded(reqList,ontology); foreach (COntologyProcessingRequirement* ontReq, reqList) { ontReqList.append(COntologyRequirementPair(ontology,ontReq)); } } CTaxonomyPremisingQuery* taxQuery = dynamic_cast(query); if (taxQuery) { CConcreteOntology* ontology = taxQuery->getOntology(); QList reqList; reqList.append(mRequirementExpander->getCompletedDefaultOntologyProcessingStepRequirement(COntologyProcessingStep::OPSCLASSCLASSIFY)); reqList = mRequirementExpander->getUnsatisfiedRequirementsExpanded(reqList,ontology); foreach (COntologyProcessingRequirement* ontReq, reqList) { ontReqList.append(COntologyRequirementPair(ontology,ontReq)); } } CRealizationPremisingQuery* realQuery = dynamic_cast(query); if (realQuery) { CConcreteOntology* ontology = realQuery->getOntology(); QList reqList; if (realQuery->isSameIndividualRealisationRequired()) { reqList.append(mRequirementExpander->getCompletedDefaultOntologyProcessingStepRequirement(COntologyProcessingStep::OPSSAMEINDIVIDUALSREALIZE)); } if (realQuery->isConceptRealisationRequired()) { reqList.append(mRequirementExpander->getCompletedDefaultOntologyProcessingStepRequirement(COntologyProcessingStep::OPSCONCEPTREALIZE)); } if (realQuery->isRoleRealisationRequired()) { reqList.append(mRequirementExpander->getCompletedDefaultOntologyProcessingStepRequirement(COntologyProcessingStep::OPSROLEREALIZE)); } reqList = mRequirementExpander->getUnsatisfiedRequirementsExpanded(reqList,ontology); foreach (COntologyProcessingRequirement* ontReq, reqList) { ontReqList.append(COntologyRequirementPair(ontology,ontReq)); } } return ontReqList; } void CReasonerManagerThread::continueRequirementProcessing(CRequirementPreparingData* reqData, CConcreteOntology* ontology) { COntologyRequirementPreparingData* ontReqPrepData = reqData->getOntologyRequirementPreparingData(ontology); if (!ontReqPrepData->mCheckingReqList.isEmpty()) { cint64 checkingTime = ontReqPrepData->mCheckingTimer.elapsed(); if (ontReqPrepData->mCheckingProcessorType == COntologyProcessingStep::OPPREPROCESSOR) { if (!mProcessingEndMessageSet.contains(QPair(ontology,COntologyProcessingStep::OPPREPROCESSOR))) { mProcessingEndMessageSet.insert(QPair(ontology,COntologyProcessingStep::OPPREPROCESSOR)); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Finished preprocessing in %2 ms for ontology '%1'.").arg(ontology->getOntologyName()).arg(checkingTime),this); } } else if (ontReqPrepData->mCheckingProcessorType == COntologyProcessingStep::OPPRECOMPUTER) { if (!mProcessingEndMessageSet.contains(QPair(ontology,COntologyProcessingStep::OPPRECOMPUTER))) { mProcessingEndMessageSet.insert(QPair(ontology,COntologyProcessingStep::OPPRECOMPUTER)); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Finished precomputing in %2 ms for ontology '%1'.").arg(ontology->getOntologyName()).arg(checkingTime),this); } } else if (ontReqPrepData->mCheckingProcessorType == COntologyProcessingStep::OPCLASSCLASSIFIER) { if (!mProcessingEndMessageSet.contains(QPair(ontology,COntologyProcessingStep::OPCLASSCLASSIFIER))) { mProcessingEndMessageSet.insert(QPair(ontology,COntologyProcessingStep::OPCLASSCLASSIFIER)); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Finished classification in %2 ms for ontology '%1'.").arg(ontology->getOntologyName()).arg(checkingTime),this); } } else if (ontReqPrepData->mCheckingProcessorType == COntologyProcessingStep::OPREALIZER) { if (!mProcessingEndMessageSet.contains(QPair(ontology,COntologyProcessingStep::OPREALIZER))) { mProcessingEndMessageSet.insert(QPair(ontology,COntologyProcessingStep::OPREALIZER)); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Finished realization in %2 ms for ontology '%1'.").arg(ontology->getOntologyName()).arg(checkingTime),this); } } for (QList::const_iterator it = ontReqPrepData->mCheckingReqList.constBegin(), itEnd = ontReqPrepData->mCheckingReqList.constEnd(); it != itEnd; ++it) { COntologyProcessingRequirement* ontProReq(*it); if (!ontProReq->isRequirementSatisfied(ontology)) { ontReqPrepData->mFailedReqList.append(ontProReq); } else { reqData->mSatisfiedReqList.append(COntologyRequirementPair(ontology,ontProReq)); } } ontReqPrepData->mCheckingReqList.clear(); } if (!ontReqPrepData->mFailedReqList.isEmpty()) { for (QList::const_iterator it = ontReqPrepData->mFailedReqList.constBegin(), itEnd = ontReqPrepData->mFailedReqList.constEnd(); it != itEnd; ++it) { COntologyProcessingRequirement* failedReqData(*it); const QString& failureString = failedReqData->getRequirementFailureString(ontology); if (!failureString.isEmpty()) { LOG(ERROR,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("%1").arg(failureString),this); } reqData->mFailedReqList.append(COntologyRequirementPair(ontology,failedReqData)); } ontReqPrepData->mFailedReqList.clear(); ontReqPrepData->mRequirementsProcessed = true; reqData->mDepCount--; reqData->mRequirementFailed = true; LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Requirements for ontology '%1' not satisfied.").arg(ontology->getOntologyName()),this); } if (!reqData->mRequirementFailed) { if (!ontReqPrepData->mPreprocessorReqList.isEmpty()) { if (!mProcessingStartMessageSet.contains(QPair(ontology,COntologyProcessingStep::OPPREPROCESSOR))) { mProcessingStartMessageSet.insert(QPair(ontology,COntologyProcessingStep::OPPREPROCESSOR)); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Preprocessing ontology '%1'.").arg(ontology->getOntologyName()),this); } CConfigurationBase* config = ontology->getConfiguration(); CPreprocessor* preprocessor = mPreprocessingManager->getPreprocessor(ontology,config); CRequirementProcessedCallbackEvent* reqProcCallbackEvent = new CRequirementProcessedCallbackEvent(this,ontology,reqData); preprocessor->preprocess(ontology,config,ontReqPrepData->mPreprocessorReqList,reqProcCallbackEvent); ontReqPrepData->mCheckingReqList = ontReqPrepData->mPreprocessorReqList; ontReqPrepData->mPreprocessorReqList.clear(); ontReqPrepData->mCheckingProcessorType = COntologyProcessingStep::OPPREPROCESSOR; ontReqPrepData->mCheckingTimer.start(); } else if (!ontReqPrepData->mPrecomputorReqList.isEmpty()) { QString exprString = QString(", expressiveness '%2'").arg(ontology->getStructureSummary()->getExpressivenessString()); if (!mProcessingStartMessageSet.contains(QPair(ontology,COntologyProcessingStep::OPPRECOMPUTER))) { mProcessingStartMessageSet.insert(QPair(ontology,COntologyProcessingStep::OPPRECOMPUTER)); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Precomputing ontology '%1'%2.").arg(ontology->getOntologyName()).arg(exprString),this); } CConfigurationBase* config = ontology->getConfiguration(); CPrecomputator* precomputer = mPrecomputationManager->getPrecomputator(ontology,config); CRequirementProcessedCallbackEvent* reqProcCallbackEvent = new CRequirementProcessedCallbackEvent(this,ontology,reqData); precomputer->precompute(ontology,config,ontReqPrepData->mPrecomputorReqList,reqProcCallbackEvent); ontReqPrepData->mCheckingReqList = ontReqPrepData->mPrecomputorReqList; ontReqPrepData->mCheckingProcessorType = COntologyProcessingStep::OPPRECOMPUTER; ontReqPrepData->mCheckingTimer.start(); ontReqPrepData->mPrecomputorReqList.clear(); } else if (!ontReqPrepData->mClassifierReqList.isEmpty()) { QString exprString = QString(", expressiveness '%2'").arg(ontology->getStructureSummary()->getExpressivenessString()); if (!mProcessingStartMessageSet.contains(QPair(ontology,COntologyProcessingStep::OPCLASSCLASSIFIER))) { mProcessingStartMessageSet.insert(QPair(ontology,COntologyProcessingStep::OPCLASSCLASSIFIER)); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Classifying ontology '%1'%2.").arg(ontology->getOntologyName()).arg(exprString),this); } CConfigurationBase* config = ontology->getConfiguration(); CSubsumptionClassifier* classClassifier = classificationMan->getClassifier(ontology,config); CRequirementProcessedCallbackEvent* reqProcCallbackEvent = new CRequirementProcessedCallbackEvent(this,ontology,reqData); classClassifier->classify(ontology,config,ontReqPrepData->mClassifierReqList,reqProcCallbackEvent); ontReqPrepData->mCheckingReqList = ontReqPrepData->mClassifierReqList; ontReqPrepData->mCheckingProcessorType = COntologyProcessingStep::OPCLASSCLASSIFIER; ontReqPrepData->mCheckingTimer.start(); ontReqPrepData->mClassifierReqList.clear(); } else if (!ontReqPrepData->mRealizerReqList.isEmpty()) { QString exprString = QString(", expressiveness '%2'").arg(ontology->getStructureSummary()->getExpressivenessString()); if (!mProcessingStartMessageSet.contains(QPair(ontology,COntologyProcessingStep::OPREALIZER))) { mProcessingStartMessageSet.insert(QPair(ontology,COntologyProcessingStep::OPREALIZER)); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Realizing ontology '%1'%2.").arg(ontology->getOntologyName()).arg(exprString),this); } CConfigurationBase* config = ontology->getConfiguration(); CRealizer* realizer = mRealizationManager->getRealizer(ontology,config); CRequirementProcessedCallbackEvent* reqProcCallbackEvent = new CRequirementProcessedCallbackEvent(this,ontology,reqData); realizer->realize(ontology,config,ontReqPrepData->mRealizerReqList,reqProcCallbackEvent); ontReqPrepData->mCheckingReqList = ontReqPrepData->mRealizerReqList; ontReqPrepData->mCheckingProcessorType = COntologyProcessingStep::OPREALIZER; ontReqPrepData->mCheckingTimer.start(); ontReqPrepData->mRealizerReqList.clear(); } else { reqData->mDepCount--; } } if (reqData->mDepCount <= 0) { if (reqData->mQuery) { initiateQueryReasoning(reqData->mQuery,reqData->mCallback,reqData->mReasoningData,reqData->mFailedReqList); } else { CCallbackData* callback = reqData->mCallback; if (callback) { callback->doCallback(); } delete reqData; } } } void CReasonerManagerThread::prepareOntologyReasoning(CPrepareOntologyEvent* poe) { CConcreteOntology* ontology = poe->getOntology(); CCallbackData* callbackData = poe->getCallbackData(); if (ontology) { QList reqList(*poe->getOntologyProcessingRequirementList()); reqList = mRequirementExpander->getUnsatisfiedRequirementsExpanded(reqList,ontology); if (!reqList.isEmpty()) { // satisfy query requirements first CRequirementPreparingData* reqPrepData = new CRequirementPreparingData(callbackData,nullptr,nullptr); for (QList::const_iterator it = reqList.constBegin(), itEnd = reqList.constEnd(); it != itEnd; ++it) { COntologyProcessingRequirement* requirement = *it; COntologyRequirementPreparingData* ontReqPrepData = reqPrepData->getOntologyRequirementPreparingData(ontology); ontReqPrepData->addOntologyRequirement(requirement); } reqPrepData->mDepCount = reqPrepData->mOntoReqDataHash.count(); mProcessingRequirementsSet.insert(reqPrepData); continueRequirementProcessing(reqPrepData,ontology); } else { if (callbackData) { callbackData->doCallback(); } } } else { LOG(ERROR,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Ontology not specified for processing requirements."),this); if (callbackData) { callbackData->doCallback(); } } } void CReasonerManagerThread::prepareQueryReasoning(CCalcQueryEvent *cqe) { CQuery* query = cqe->getQuery(); CCallbackData* callbackData = cqe->getCallbackData(); CReasoningTaskData* reasoningData = new CReasoningTaskData(); QList reqList(getRequirementsForQuery(query)); if (reqList.isEmpty()) { initiateQueryReasoning(query,callbackData,reasoningData,QList()); } else { // satisfy query requirements first CRequirementPreparingData* reqPrepData = new CRequirementPreparingData(callbackData,query,reasoningData); reasoningData->mReqPrepData = reqPrepData; for (QList::const_iterator it = reqList.constBegin(), itEnd = reqList.constEnd(); it != itEnd; ++it) { COntologyRequirementPair ontReqPair(*it); CConcreteOntology* ontology = ontReqPair.mOntology; COntologyProcessingRequirement* requirement = ontReqPair.mRequirement; COntologyRequirementPreparingData* ontReqPrepData = reqPrepData->getOntologyRequirementPreparingData(ontology); ontReqPrepData->addOntologyRequirement(requirement); } reqPrepData->mDepCount = reqPrepData->mOntoReqDataHash.count(); mProcessingRequirementsSet.insert(reqPrepData); if (reqPrepData->mDepCount <= 0) { initiateQueryReasoning(query,callbackData,reasoningData,reqPrepData->mFailedReqList); } else { for (QHash::const_iterator it = reqPrepData->mOntoReqDataHash.constBegin(), itEnd = reqPrepData->mOntoReqDataHash.constEnd(); it != itEnd; ++it) { CConcreteOntology* ontology = it.key(); COntologyRequirementPreparingData* ontReqRepData = it.value(); continueRequirementProcessing(reqPrepData,ontology); } } } } void CReasonerManagerThread::initiateQueryReasoning(CQuery* query, CCallbackData* callbackData, CReasoningTaskData* reasoningData, const QList& failedRequirementList) { reasoningData->mStartTime.start(); updateBeginingCalculationStatistics(reasoningData); if (!failedRequirementList.isEmpty()) { CConcreteOntology* ontology = nullptr; for (QList::const_iterator it = failedRequirementList.constBegin(), itEnd = failedRequirementList.constEnd(); it != itEnd; ++it) { ontology = it->mOntology; COntologyProcessingRequirement* requirement(it->mRequirement); query->addErrorString(QString("Processing requirements for Ontology '%1' for Query '%2' failed.").arg(ontology->getOntologyName()).arg(query->getQueryName())); if (ontology) { CConsistence* cons = ontology->getConsistence(); if (cons) { if (!cons->isOntologyConsistent()) { LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Ontology '%1' for Query '%2' is inconsistent.").arg(ontology->getOntologyName()).arg(query->getQueryName()),this); query->addQueryError(new CQueryInconsitentOntologyError(ontology)); } } } } if (ontology) { updateFinishingCalculationStatistics(reasoningData,query->getQueryStatistics(),ontology->getConfiguration()); } else { updateFinishingCalculationStatistics(reasoningData,query->getQueryStatistics()); } CCallbackData* callback = callbackData; if (callback) { callback->doCallback(); } delete reasoningData; } else { CSatisfiableCalculationJobsQuery* jobQuery = dynamic_cast(query); if (jobQuery) { CQUERYLIST jobList(jobQuery->getJobList()); bool jobCalculated = false; cint64 depCount = 0; CConcreteOntology* ontology = nullptr; FOREACHIT (CCalculationJob* calcJob, jobList) { CSatisfiableCalculationJob* satCalcJob = dynamic_cast(calcJob); if (satCalcJob) { depCount++; CJobSatisfiableCallbackContextData* satCallbackData = new CJobSatisfiableCallbackContextData(satCalcJob); CQueryJobCalculatedSatisfiableCallbackEvent* callback = new CQueryJobCalculatedSatisfiableCallbackEvent(this,jobQuery,satCallbackData); mCalculationManager->calculateJob(satCalcJob,callback); mCalcJobSet.insert(satCalcJob); jobCalculated = true; ontology = satCalcJob->getOntology(); } } reasoningData->mCallback = callbackData; reasoningData->mDepCount = depCount; mReasoningTaskDataHash.insert((cint64)query,reasoningData); mCalculatingQuerySet.insert(query); reasoningData->mFinQueryCallback = new CCalcedQueryEvent(this,jobQuery); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Processing Query '%1'.").arg(query->getQueryName()),this); } CIsTriviallyConsistentQuery* trivConsQuery = dynamic_cast(query); if (trivConsQuery) { reasoningData->mCallback = callbackData; CConcreteOntology* ontology = trivConsQuery->getOntology(); trivConsQuery->constructResult(ontology->getBuildData()); qint64 mSecs = reasoningData->mStartTime.elapsed(); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Query '%1' processed in '%2' ms.").arg(trivConsQuery->getQueryName()).arg(mSecs),this); CCallbackData* callback = reasoningData->mCallback; if (callback) { callback->doCallback(); } delete reasoningData; } CConsistencePremisingQuery* consQuery = dynamic_cast(query); if (consQuery) { reasoningData->mCallback = callbackData; CQueryStatistics* queryStats = consQuery->getQueryStatistics(); CConcreteOntology* ontology = consQuery->getOntology(); if (queryStats) { CClassConceptClassification* classConClassif = ontology->getClassification()->getClassConceptClassification(); if (classConClassif) { CClassificationStatistics* classifStats = classConClassif->getClassificationStatistics(); if (classifStats) { foreach (QString statName, classifStats->getStatisticsNameStringList()) { cint64 statValue = classifStats->getStatisticIntegerValue(statName); queryStats->addProcessingStatistics(statName,statValue); } } } } updateFinishingCalculationStatistics(reasoningData,queryStats,ontology->getConfiguration()); consQuery->constructResult(ontology->getConsistence()); qint64 mSecs = reasoningData->mStartTime.elapsed(); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Query '%1' processed in '%2' ms.").arg(consQuery->getQueryName()).arg(mSecs),this); CCallbackData* callback = reasoningData->mCallback; if (callback) { callback->doCallback(); } delete reasoningData; } CTaxonomyPremisingQuery *taxQuery = dynamic_cast(query); if (taxQuery) { reasoningData->mCallback = callbackData; CQueryStatistics* queryStats = taxQuery->getQueryStatistics(); CConcreteOntology* ontology = taxQuery->getOntology(); if (queryStats) { CClassConceptClassification* classConClassif = ontology->getClassification()->getClassConceptClassification(); if (classConClassif) { CClassificationStatistics* classifStats = classConClassif->getClassificationStatistics(); if (classifStats) { foreach (QString statName, classifStats->getStatisticsNameStringList()) { cint64 statValue = classifStats->getStatisticIntegerValue(statName); queryStats->addProcessingStatistics(statName,statValue); } } } } updateFinishingCalculationStatistics(reasoningData,queryStats,ontology->getConfiguration()); taxQuery->constructResult(ontology->getClassification()->getClassConceptClassification()->getClassConceptTaxonomy()); qint64 mSecs = reasoningData->mStartTime.elapsed(); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Query '%1' processed in '%2' ms.").arg(taxQuery->getQueryName()).arg(mSecs),this); CCallbackData* callback = reasoningData->mCallback; if (callback) { callback->doCallback(); } delete reasoningData; } CRealizationPremisingQuery* realQuery = dynamic_cast(query); if (realQuery) { reasoningData->mCallback = callbackData; CQueryStatistics* queryStats = realQuery->getQueryStatistics(); CConcreteOntology* ontology = realQuery->getOntology(); updateFinishingCalculationStatistics(reasoningData,queryStats,ontology->getConfiguration()); realQuery->constructResult(ontology->getRealization()); qint64 mSecs = reasoningData->mStartTime.elapsed(); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Query '%1' processed in '%2' ms.").arg(realQuery->getQueryName()).arg(mSecs),this); CCallbackData* callback = reasoningData->mCallback; if (callback) { callback->doCallback(); } delete reasoningData; } } } void CReasonerManagerThread::prepareSatisfiableBoxReasoning(CReasoningSatisfiableCalculationJobEvent *cbse) { CSatisfiableCalculationJob* calcJob = cbse->getSatisfiableCalculationJob(); CCallbackData* callbackData = cbse->getCallbackData(); CJobSatisfiableCallbackContextData* satCallbackData = (CJobSatisfiableCallbackContextData*)callbackData->getCallbackDataContext(); if (!satCallbackData) { satCallbackData = new CJobSatisfiableCallbackContextData(calcJob); } CJobCalculatedSatisfiableCallbackEvent* callback = new CJobCalculatedSatisfiableCallbackEvent(this,satCallbackData); mCalculationManager->calculateJob(calcJob,callback); mCalcJobSet.insert(calcJob); CReasoningTaskData* reasoningData = new CReasoningTaskData(); reasoningData->mCallback = callbackData; mReasoningTaskDataHash.insert((cint64)calcJob,reasoningData); } bool CReasonerManagerThread::updateBeginingCalculationStatistics(CReasoningTaskData* reaTaskData, CConfiguration* config) { if (!config) { config = configProvider->getCurrentConfiguration(); } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Query.Statistics.CollectCalculationStatistics",false)) { QHash* mBeginStatHash = mCalculationManager->getCalculationStatistics(); reaTaskData->mCalcStat = mBeginStatHash; return true; } return false; } bool CReasonerManagerThread::updateFinishingCalculationStatistics(CReasoningTaskData* reaTaskData, CQueryStatistics* queryStat, CConfiguration* config) { if (queryStat) { if (!config) { config = configProvider->getCurrentConfiguration(); } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Query.Statistics.CollectCalculationStatistics",false)) { QHash* mBeginStatHash = reaTaskData->mCalcStat; if (mBeginStatHash) { QHash* mFinishStatHash = mCalculationManager->getCalculationStatistics(); for (QHash::const_iterator itF = mFinishStatHash->constBegin(), itFEnd = mFinishStatHash->constEnd(); itF != itFEnd; ++itF) { QString statName = itF.key(); cint64 finVal = itF.value(); cint64 begVal = 0;//mBeginStatHash->value(statName); queryStat->addProcessingStatistics(statName,finVal-begVal); } delete mFinishStatHash; } queryStat->addProcessingStatistics("calculation-reasoning-time",reaTaskData->mStartTime.elapsed()); } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Query.Statistics.CollectProcessingStepsStatistics",false) && reaTaskData->mReqPrepData) { QSet addedStatSet; for (QList::const_iterator it = reaTaskData->mReqPrepData->mSatisfiedReqList.constBegin(), itEnd = reaTaskData->mReqPrepData->mSatisfiedReqList.constEnd(); it != itEnd; ++it) { COntologyRequirementPair ontReqPair(*it); CConcreteOntology* ontology = ontReqPair.mOntology; COntologyProcessingRequirement* requirement = ontReqPair.mRequirement; COntologyProcessingStepRequirement* ontProcStepRequirement = dynamic_cast(requirement); if (ontProcStepRequirement) { COntologyProcessingStepData* procStepData = ontology->getProcessingSteps()->getOntologyProcessingStepDataVector()->getProcessingStepData(ontProcStepRequirement->getRequiredProcessingStep()->getOntologyProcessingType()); if (procStepData) { COntologyProcessingStatistics* procStepStatistics = procStepData->getProcessingStatistics(false); if (procStepStatistics && !addedStatSet.contains(procStepStatistics)) { addedStatSet.insert(procStepStatistics); queryStat->addProcessingStatistics(procStepStatistics); } } } } } return true; } return false; } void CReasonerManagerThread::finishSatisfiableBoxReasoning(CJobCalculatedSatisfiableCallbackEvent *cbsce) { CJobSatisfiableCallbackContextData *contextData = (CJobSatisfiableCallbackContextData *)cbsce->getCallbackDataContext(); CSatisfiableCalculationJob* satCalcJob = contextData->getSatisfiableCalculationJob(); bool satisfiable = contextData->isSatisfiable(); bool calcError = contextData->hasCalculationError(); if (calcError) { LOG(ERROR,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Error while calculating job."),this); QString errorString = mCalculationManager->getCalculationErrorString(contextData->getCalculationErrorCode()); if (!errorString.isEmpty()) { LOG(ERROR,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Calculation Error: '%1'.").arg(errorString),this); } } CReasoningTaskData* reasoningData = mReasoningTaskDataHash.value((cint64)satCalcJob,nullptr); reasoningData->mDepCount--; CCallbackData* callback = reasoningData->mCallback; if (callback) { callback->setCallbackDataContext(cbsce->takeCallbackDataContext()); callback->doCallback(); } mReasoningTaskDataHash.remove((cint64)satCalcJob); delete reasoningData; mCalcJobSet.remove(satCalcJob); } QString CReasonerManagerThread::getLoggingCalculationStatisticsMemorySizeString(cint64 memSize) { QString memString; if (memSize > 10*1024*1024) { memString = QString("%1 MByte").arg(memSize/(1024*1024)); } else if (memSize > 10*1024) { memString = QString("%1 KByte").arg(memSize/(1024)); } else { memString = QString("%1 Byte").arg(memSize); } return memString; } QString CReasonerManagerThread::getLoggingCalculationStatisticsTimeSizeString(double milliseconds) { QString compTimeString; if (milliseconds > 2*1000*60*60*24*356) { compTimeString = QString("%1 y").arg(milliseconds/(1000*60*60*24*356)); } else if (milliseconds > 2*1000*60*60*24) { compTimeString = QString("%1 d").arg(milliseconds/(1000*60*60*24)); } else if (milliseconds > 10*1000*60*60) { compTimeString = QString("%1 h").arg(milliseconds/(1000*60*60)); } else if (milliseconds > 10*1000*60) { compTimeString = QString("%1 m").arg(milliseconds/(1000*60)); } else if (milliseconds > 10*1000) { compTimeString = QString("%1 s").arg(milliseconds/(1000)); } else { compTimeString = QString("%1 ms").arg(milliseconds); } return compTimeString; } void CReasonerManagerThread::loggingCalculationStatistics() { QHash* mCalcStatHash = mCalculationManager->getCalculationStatistics(); if (mCalcStatHash) { QString compTime = getLoggingCalculationStatisticsTimeSizeString(mCalcStatHash->value("calculation-computing-time")); QString memCons = getLoggingCalculationStatisticsMemorySizeString(mCalcStatHash->value("calculation-memory-consumption")); QString memRes = getLoggingCalculationStatisticsMemorySizeString(mCalcStatHash->value("calculation-memory-reservation")); QString statString = QString("Up to now calculation computing time: %1, calculation memory consumption: %2.") .arg(compTime) .arg(memCons); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",statString,this); delete mCalcStatHash; } } void CReasonerManagerThread::finishQuerySatisfiableBoxReasoning(CQueryJobCalculatedSatisfiableCallbackEvent *cbsce) { CJobSatisfiableCallbackContextData *contextData = (CJobSatisfiableCallbackContextData *)cbsce->getCallbackDataContext(); CSatisfiableCalculationJobsQuery* jobQuery = cbsce->getSatisfiableCalclulationJobsQuery(); CSatisfiableCalculationJob* satCalcJob = contextData->getSatisfiableCalculationJob(); bool satisfiable = contextData->isSatisfiable(); bool calcError = contextData->hasCalculationError(); if (calcError) { LOG(ERROR,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Error while calculating job for query '%1'.").arg(jobQuery->getQueryName()),this); QString errorString = mCalculationManager->getCalculationErrorString(contextData->getCalculationErrorCode()); if (!errorString.isEmpty()) { LOG(ERROR,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Calculation Error: '%1'.").arg(errorString),this); jobQuery->addErrorString("Calculation error: "+errorString); } } CReasoningTaskData* reasoningQueryData = mReasoningTaskDataHash.value((cint64)jobQuery,nullptr); updateFinishingCalculationStatistics(reasoningQueryData,jobQuery->getQueryStatistics()); QString newAnswerString; bool queryFinished = false; if (!reasoningQueryData->mAnswered) { queryFinished = jobQuery->interpreteJobSatisfiableCalculation(satCalcJob,satisfiable,calcError,&newAnswerString); } CReasoningTaskData* reasoningJobData = mReasoningTaskDataHash.value((cint64)satCalcJob,nullptr); if (reasoningJobData) { reasoningJobData->mDepCount--; CCallbackData* callback = reasoningJobData->mCallback; if (callback) { callback->setCallbackDataContext(cbsce->takeCallbackDataContext()); callback->doCallback(); } mReasoningTaskDataHash.remove((cint64)satCalcJob); delete reasoningJobData; } mCalcJobSet.remove(satCalcJob); if (--(reasoningQueryData->mDepCount) <= 0) { reasoningQueryData->mAnswered |= queryFinished; reasoningQueryData->mFinQueryCallback->sendEventWithAnswer(newAnswerString); } } void CReasonerManagerThread::finishQueryReasoning(CCalcedQueryEvent *cqe) { CQuery *query = cqe->getQuery(); CReasoningTaskData* reasoningData = mReasoningTaskDataHash.value((cint64)query,nullptr); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Query '%1' processed. Question '%2' answered with '%3'.\r\n").arg(cqe->getQueryName()).arg(cqe->getQueryString()).arg(cqe->getAnswerString()),this); qint64 mSecs = reasoningData->mStartTime.elapsed(); LOG(INFO,"::Konclude::Reasoner::Kernel::ReasonerManager",logTr("Query '%1' processed in '%2' ms.").arg(cqe->getQueryName()).arg(mSecs),this); // print calculation statistics loggingCalculationStatistics(); CCallbackData* callback = reasoningData->mCallback; if (callback) { callback->doCallback(); } mCalculatingQuerySet.remove(query); mReasoningTaskDataHash.remove((cint64)query); delete reasoningData; } bool CReasonerManagerThread::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CIntervalThread::processCustomsEvents(type,event)) { return true; } else if (type == CReasoningSatisfiableCalculationJobEvent::EVENTTYPE) { CReasoningSatisfiableCalculationJobEvent *cbse = static_cast(event); prepareSatisfiableBoxReasoning(cbse); return true; } else if (type == CJobCalculatedSatisfiableCallbackEvent::EVENTTYPE) { CJobCalculatedSatisfiableCallbackEvent *cbsce = static_cast(event); finishSatisfiableBoxReasoning(cbsce); return true; } else if (type == CQueryJobCalculatedSatisfiableCallbackEvent::EVENTTYPE) { CQueryJobCalculatedSatisfiableCallbackEvent *cbsce = static_cast(event); finishQuerySatisfiableBoxReasoning(cbsce); return true; } else if (type == CCalcQueryEvent::EVENTTYPE) { CCalcQueryEvent *cqe = static_cast(event); prepareQueryReasoning(cqe); return true; } else if (type == CPrepareOntologyEvent::EVENTTYPE) { CPrepareOntologyEvent* poe = static_cast(event); prepareOntologyReasoning(poe); return true; } else if (type == CCalcedQueryEvent::EVENTTYPE) { CCalcedQueryEvent *cqe = static_cast(event); finishQueryReasoning(cqe); return true; } else if (type == CRequirementProcessedCallbackEvent::EVENTTYPE) { CRequirementProcessedCallbackEvent* rpce = static_cast(event); CConcreteOntology* ontology = rpce->getOntology(); CRequirementPreparingData* reqPrepData = rpce->getRequirementPreparingData(); continueRequirementProcessing(reqPrepData,ontology); return true; } return false; } }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Manager/CReasoningTaskData.cpp0000644000175000017500000000256012520551052027003 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasoningTaskData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Manager { CReasoningTaskData::CReasoningTaskData() { mCallback = nullptr; mDepCount = 1; mAnswered = false; mStartTime.start(); mCalcStat = 0; mReqPrepData = nullptr; mFinQueryCallback = nullptr; } CReasoningTaskData::~CReasoningTaskData() { delete mCalcStat; delete mReqPrepData; } }; // end namespace Manager }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/0000755000175000017500000000000012613407256023070 5ustar jonasjonas././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CGenerativeNonDeterministicUnsatisfia0000644000175000017500000000665312520551166032444 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_STRATEGY_CGENERATIVENONDETERMINISTICUNSATISFIABLECACHERETRIEVALSTRATEGY_H #define KONCLUDE_REASONER_KERNEL_STRATEGY_CGENERATIVENONDETERMINISTICUNSATISFIABLECACHERETRIEVALSTRATEGY_H // Libraries includes // Namespace includes #include "CUnsatisfiableCacheRetrievalStrategy.h" // Other includes #include "Reasoner/Kernel/Process/CConceptProcessDescriptor.h" #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Process; namespace Strategy { /*! * * \class CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy : public CUnsatisfiableCacheRetrievalStrategy { // public methods public: //! Constructor CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy(); //! Destructor virtual ~CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy(); virtual bool testUnsatisfiableCacheForProcessing(CConceptProcessDescriptor* conProDes, CIndividualProcessNode *indi); virtual bool testUnsatisfiableCacheForDisjunctionBranching(CConceptProcessDescriptor *conProDes, CIndividualProcessNode *indi, CPROCESSINGLIST< CSortedNegLinker* >* disjunctList); virtual bool testUnsatisfiableCacheForMergingInitialization(CConceptProcessDescriptor* conProDes, CIndividualProcessNode *indi); virtual bool testUnsatisfiableCacheForSuccessorGeneration(CConceptProcessDescriptor* conProDes, CIndividualProcessNode *indi); virtual bool testUnsatisfiableCacheForBranchedDisjuncts(CConceptProcessDescriptor *conProDes, CIndividualProcessNode *indi, CSortedNegLinker* orDisjunctConcept); virtual bool testUnsatisfiableCacheForMergedIndividualNodes(CConceptProcessDescriptor *conProDes, CIndividualProcessNode *indi, CIndividualProcessNode *mergedIndi); virtual bool testUnsatisfiableCacheForQualifiedIndividualNodes(CConceptProcessDescriptor *conProDes, CIndividualProcessNode *indi, CIndividualProcessNode *mergedIndi); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_STRATEGY_CGENERATIVENONDETERMINISTICUNSATISFIABLECACHERETRIEVALSTRATEGY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CConceptProcessingPriorityStrategy.h0000644000175000017500000000503712520551166032263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_STRATEGY_CCONCEPTPROCESSINGPRIORITYSTRATEGY_H #define KONCLUDE_REASONER_KERNEL_STRATEGY_CCONCEPTPROCESSINGPRIORITYSTRATEGY_H // Libraries includes // Namespace includes // Other includes #include "Reasoner/Kernel/Process/CConceptProcessPriority.h" #include "Reasoner/Kernel/Process/CConceptDescriptor.h" #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Process; namespace Strategy { /*! * * \class CConceptProcessingPriorityStrategy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptProcessingPriorityStrategy { // public methods public: //! Constructor CConceptProcessingPriorityStrategy(); //! Destructor virtual ~CConceptProcessingPriorityStrategy(); virtual CConceptProcessPriority getPriorityForConcept(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode *individual) = 0; virtual double getPriorityOffsetForDisjunctionDelayedConsidering(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode *individual) = 0; virtual double getPriorityOffsetForDisjunctionDelayedProcessing(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode *individual) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_STRATEGY_CCONCEPTPROCESSINGPRIORITYSTRATEGY_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CConcreteConceptProcessingOperatorPriorityStrategy.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CConcreteConceptProcessingOperatorPri0000644000175000017500000000527312520551166032424 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_STRATEGY_CCONCRETECONCEPTPROCESSINGOPERATORPRIORITYSTRATEGY_H #define KONCLUDE_REASONER_KERNEL_STRATEGY_CCONCRETECONCEPTPROCESSINGOPERATORPRIORITYSTRATEGY_H // Libraries includes #include // Namespace includes #include "CConceptProcessingPriorityStrategy.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Strategy { /*! * * \class CConcreteConceptProcessingOperatorPriorityStrategy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteConceptProcessingOperatorPriorityStrategy : public CConceptProcessingPriorityStrategy { // public methods public: //! Constructor CConcreteConceptProcessingOperatorPriorityStrategy(); //! Destructor virtual ~CConcreteConceptProcessingOperatorPriorityStrategy(); virtual CConceptProcessPriority getPriorityForConcept(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode *individual); virtual double getPriorityOffsetForDisjunctionDelayedConsidering(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode *individual); virtual double getPriorityOffsetForDisjunctionDelayedProcessing(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode *individual); // protected methods protected: // protected variables protected: // private methods private: // private variables private: int priCount; double *priorities; double *symAccessPri; double mDisjDelConsidPriOffset; double mDisjDelProcessPriOffset; }; }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_STRATEGY_CCONCRETECONCEPTPROCESSINGOPERATORPRIORITYSTRATEGY_H ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CGenerativeNonDeterministicUnsatisfia0000644000175000017500000000577112520551166032444 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Strategy { CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy::CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy() { } CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy::~CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy() { } bool CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy::testUnsatisfiableCacheForProcessing(CConceptProcessDescriptor* conProDes, CIndividualProcessNode *indi) { return false; } bool CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy::testUnsatisfiableCacheForDisjunctionBranching(CConceptProcessDescriptor *conProDes, CIndividualProcessNode *indi, CPROCESSINGLIST< CSortedNegLinker* >* disjunctList) { return true; } bool CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy::testUnsatisfiableCacheForMergingInitialization(CConceptProcessDescriptor* conProDes, CIndividualProcessNode *indi) { return true; } bool CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy::testUnsatisfiableCacheForSuccessorGeneration(CConceptProcessDescriptor* conProDes, CIndividualProcessNode *indi) { return true; } bool CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy::testUnsatisfiableCacheForBranchedDisjuncts(CConceptProcessDescriptor *conProDes, CIndividualProcessNode *indi, CSortedNegLinker* orDisjunctConcept) { return true; } bool CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy::testUnsatisfiableCacheForMergedIndividualNodes(CConceptProcessDescriptor *conProDes, CIndividualProcessNode *indi, CIndividualProcessNode *mergedIndi) { return true; } bool CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy::testUnsatisfiableCacheForQualifiedIndividualNodes(CConceptProcessDescriptor *conProDes, CIndividualProcessNode *indi, CIndividualProcessNode *mergedIndi) { return true; } }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CEqualDepthTaskProcessingPriorityStrategy.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CEqualDepthTaskProcessingPriorityStra0000644000175000017500000000635612520551166032435 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEqualDepthTaskProcessingPriorityStrategy.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Strategy { CEqualDepthTaskProcessingPriorityStrategy::CEqualDepthTaskProcessingPriorityStrategy() { } CEqualDepthTaskProcessingPriorityStrategy::~CEqualDepthTaskProcessingPriorityStrategy() { } double CEqualDepthTaskProcessingPriorityStrategy::getPriorityForTaskBranching(CSatisfiableCalculationTask* branchingTask, CSatisfiableCalculationTask* parentTask, CIndividualProcessNode* indiProcessNode, CConceptDescriptor* branchingConcept, CSortedNegLinker* branchedConcept, cint64 branchNumber) { double parentDepth = parentTask->getTaskDepth(); double priority = 0.; double maxBranchCount = branchingConcept->getConcept()->getOperandCount(); double parentPriority = parentTask->getTaskPriority(); //priority = parentDepth + 1. + (0.1 - branchNumber / ((1+parentDepth) * 10 * maxBranchCount)); priority = parentDepth + 1. + (0.1 - branchNumber / (10 * maxBranchCount)); return priority; } double CEqualDepthTaskProcessingPriorityStrategy::getPriorityForTaskQualifing(CSatisfiableCalculationTask* branchingTask, CSatisfiableCalculationTask* parentTask, bool qualifingNegated) { double parentDepth = parentTask->getTaskDepth(); double priority = 0.; double parentPriority = parentTask->getTaskPriority(); priority = parentDepth + 1.; if (qualifingNegated) { priority += 0.1; } return priority; } double CEqualDepthTaskProcessingPriorityStrategy::getPriorityForTaskMerging(CSatisfiableCalculationTask* branchingTask, CSatisfiableCalculationTask* parentTask) { double parentDepth = parentTask->getTaskDepth(); double priority = 0.; double parentPriority = parentTask->getTaskPriority(); priority = parentDepth + 1.; return priority; } double CEqualDepthTaskProcessingPriorityStrategy::getPriorityForTaskReusing(CSatisfiableCalculationTask* branchingTask, CSatisfiableCalculationTask* parentTask, bool reusingAlternative) { double parentDepth = parentTask->getTaskDepth(); double priority = 0.; double parentPriority = parentTask->getTaskPriority(); priority = parentDepth + 1.; if (reusingAlternative) { priority += 0.1; } return priority; } }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CConceptProcessingPriorityStrategy.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CConceptProcessingPriorityStrategy.cp0000644000175000017500000000233412520551166032433 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptProcessingPriorityStrategy.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Strategy { CConceptProcessingPriorityStrategy::CConceptProcessingPriorityStrategy() { } CConceptProcessingPriorityStrategy::~CConceptProcessingPriorityStrategy() { } }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CUnsatisfiableCacheRetrievalStrategy.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CUnsatisfiableCacheRetrievalStrategy.0000644000175000017500000000641212520551166032312 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_STRATEGY_CUNSATISFIABLECACHERETRIEVALSTRATEGY_H #define KONCLUDE_REASONER_KERNEL_STRATEGY_CUNSATISFIABLECACHERETRIEVALSTRATEGY_H // Libraries includes // Namespace includes // Other includes #include "Reasoner/Kernel/Algorithm/AlgorithmSettings.h" #include "Reasoner/Kernel/Process/CConceptProcessDescriptor.h" #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Process; using namespace Algorithm; namespace Strategy { /*! * * \class CUnsatisfiableCacheRetrievalStrategy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CUnsatisfiableCacheRetrievalStrategy { // public methods public: //! Constructor CUnsatisfiableCacheRetrievalStrategy(); //! Destructor virtual ~CUnsatisfiableCacheRetrievalStrategy(); virtual bool testUnsatisfiableCacheForProcessing(CConceptProcessDescriptor* conProDes, CIndividualProcessNode *indi) = 0; virtual bool testUnsatisfiableCacheForDisjunctionBranching(CConceptProcessDescriptor *conProDes, CIndividualProcessNode *indi, CPROCESSINGLIST< CSortedNegLinker* >* disjunctList) = 0; virtual bool testUnsatisfiableCacheForMergingInitialization(CConceptProcessDescriptor* conProDes, CIndividualProcessNode *indi) = 0; virtual bool testUnsatisfiableCacheForSuccessorGeneration(CConceptProcessDescriptor* conProDes, CIndividualProcessNode *indi) = 0; virtual bool testUnsatisfiableCacheForBranchedDisjuncts(CConceptProcessDescriptor *conProDes, CIndividualProcessNode *indi, CSortedNegLinker* orDisjunctConcept) = 0; virtual bool testUnsatisfiableCacheForMergedIndividualNodes(CConceptProcessDescriptor *conProDes, CIndividualProcessNode *indi, CIndividualProcessNode *mergedIndi) = 0; virtual bool testUnsatisfiableCacheForQualifiedIndividualNodes(CConceptProcessDescriptor *conProDes, CIndividualProcessNode *indi, CIndividualProcessNode *mergedIndi) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_STRATEGY_CUNSATISFIABLECACHERETRIEVALSTRATEGY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CTaskProcessingPriorityStrategy.h0000644000175000017500000000543112520551166031570 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_STRATEGY_CTASKPROCESSINGPRIORITYSTRATEGY_H #define KONCLUDE_REASONER_KERNEL_STRATEGY_CTASKPROCESSINGPRIORITYSTRATEGY_H // Libraries includes // Namespace includes // Other includes #include "Reasoner/Kernel/Process/CConceptDescriptor.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Process; using namespace Task; namespace Strategy { /*! * * \class CTaskProcessingPriorityStrategy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskProcessingPriorityStrategy { // public methods public: //! Constructor CTaskProcessingPriorityStrategy(); //! Destructor virtual ~CTaskProcessingPriorityStrategy(); virtual double getPriorityForTaskBranching(CSatisfiableCalculationTask* branchingTask, CSatisfiableCalculationTask* parentTask, CIndividualProcessNode* indiProcessNode, CConceptDescriptor* branchingConcept, CSortedNegLinker* branchedConcept, cint64 branchNumber) = 0; virtual double getPriorityForTaskQualifing(CSatisfiableCalculationTask* branchingTask, CSatisfiableCalculationTask* parentTask, bool qualifingNegated) = 0; virtual double getPriorityForTaskMerging(CSatisfiableCalculationTask* branchingTask, CSatisfiableCalculationTask* parentTask) = 0; virtual double getPriorityForTaskReusing(CSatisfiableCalculationTask* branchingTask, CSatisfiableCalculationTask* parentTask, bool reusingAlternative) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_STRATEGY_CTASKPROCESSINGPRIORITYSTRATEGY_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CUnsatisfiableCacheRetrievalStrategy.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CUnsatisfiableCacheRetrievalStrategy.0000644000175000017500000000235112520551166032310 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CUnsatisfiableCacheRetrievalStrategy.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Strategy { CUnsatisfiableCacheRetrievalStrategy::CUnsatisfiableCacheRetrievalStrategy() { } CUnsatisfiableCacheRetrievalStrategy::~CUnsatisfiableCacheRetrievalStrategy() { } }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CTaskProcessingPriorityStrategy.cpp0000644000175000017500000000231512520551166032121 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskProcessingPriorityStrategy.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Strategy { CTaskProcessingPriorityStrategy::CTaskProcessingPriorityStrategy() { } CTaskProcessingPriorityStrategy::~CTaskProcessingPriorityStrategy() { } }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CEqualDepthCacheOrientatedProcessingPriorityStrategy.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CEqualDepthCacheOrientatedProcessingP0000644000175000017500000000637112520551166032276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEqualDepthCacheOrientatedProcessingPriorityStrategy.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Strategy { CEqualDepthCacheOrientatedProcessingPriorityStrategy::CEqualDepthCacheOrientatedProcessingPriorityStrategy() { } CEqualDepthCacheOrientatedProcessingPriorityStrategy::~CEqualDepthCacheOrientatedProcessingPriorityStrategy() { } double CEqualDepthCacheOrientatedProcessingPriorityStrategy::getPriorityForTaskBranching(CSatisfiableCalculationTask* branchingTask, CSatisfiableCalculationTask* parentTask, CIndividualProcessNode* indiProcessNode, CConceptDescriptor* branchingConcept, CSortedNegLinker* branchedConcept, cint64 branchNumber) { double parentDepth = parentTask->getTaskDepth(); double priority = 0.; double maxBranchCount = branchingConcept->getConcept()->getOperandCount(); double parentPriority = parentTask->getTaskPriority(); bool disjunctCached = false; CConcreteOntology* ontology = branchingTask->getProcessingDataBox()->getOntology(); CConsistence* consistence = ontology->getConsistence(); if (consistence) { CConsistenceData* consData = consistence->getConsistenceModelData(); if (consData) { CConsistenceTaskData* consTaskData = dynamic_cast(consData); if (consTaskData) { CSatisfiableCalculationTask* compGraphCachedCalcTask = consTaskData->getCompletionGraphCachedSatisfiableTask(); if (compGraphCachedCalcTask) { CIndividualProcessNodeVector* compGraphCachedProcNodeVec = compGraphCachedCalcTask->getProcessingDataBox()->getIndividualProcessNodeVector(); if (indiProcessNode->getIndividualID() < compGraphCachedProcNodeVec->getItemCount()) { CIndividualProcessNode* compIndiProcNode = compGraphCachedProcNodeVec->getData(indiProcessNode->getIndividualID()); if (compIndiProcNode && compIndiProcNode->getReapplyConceptLabelSet(false)->containsConcept(branchedConcept->getData(),branchedConcept->isNegated())) { disjunctCached = true; } } } } } } double prioritySubOffset = 0.2; if (disjunctCached) { prioritySubOffset = 0.3; } priority = parentDepth + 1. + (prioritySubOffset - branchNumber / (10 * maxBranchCount)); return priority; } }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CEqualDepthCacheOrientatedProcessingPriorityStrategy.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CEqualDepthCacheOrientatedProcessingP0000644000175000017500000000500512520551166032267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_STRATEGY_CEQUALDEPTHCACHEORIENTATEDPROCESSINGPRIORITYSTRATEGY_H #define KONCLUDE_REASONER_KERNEL_STRATEGY_CEQUALDEPTHCACHEORIENTATEDPROCESSINGPRIORITYSTRATEGY_H // Libraries includes // Namespace includes #include "CEqualDepthTaskProcessingPriorityStrategy.h" // Other includes #include "Reasoner/Kernel/Task/CConsistenceTaskData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Process; using namespace Task; namespace Strategy { /*! * * \class CEqualDepthCacheOrientatedProcessingPriorityStrategy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEqualDepthCacheOrientatedProcessingPriorityStrategy : public CEqualDepthTaskProcessingPriorityStrategy { // public methods public: //! Constructor CEqualDepthCacheOrientatedProcessingPriorityStrategy(); //! Destructor virtual ~CEqualDepthCacheOrientatedProcessingPriorityStrategy(); virtual double getPriorityForTaskBranching(CSatisfiableCalculationTask* branchingTask, CSatisfiableCalculationTask* parentTask, CIndividualProcessNode* indiProcessNode, CConceptDescriptor* branchingConcept, CSortedNegLinker* branchedConcept, cint64 branchNumber); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_STRATEGY_CEQUALDEPTHCACHEORIENTATEDPROCESSINGPRIORITYSTRATEGY_H ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CConcreteConceptProcessingOperatorPriorityStrategy.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CConcreteConceptProcessingOperatorPri0000644000175000017500000001762312520551166032426 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteConceptProcessingOperatorPriorityStrategy.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Strategy { CConcreteConceptProcessingOperatorPriorityStrategy::CConcreteConceptProcessingOperatorPriorityStrategy() { priCount = 200; priorities = new double[priCount]; symAccessPri = priorities+priCount/2; for (int i = 0; i < priCount; ++i) { priorities[i] = 0; } // The following priorities are similar to the FaCT++ standard IAOEFLG options and have the same meaning. // FaCT++ register "IAOEFLG" option: // Option 'IAOEFLG' define the priorities of different operations in TODO list. Possible values are // 7-digit strings with only possible digit are 0-6. The digits on the places 1, 2, ..., 7 are for // priority of Id, And, Or, Exists, Forall, LE and GE operations respectively. The smaller number means // the higher priority. All other constructions (TOP, BOTTOM, etc) has priority 0. // The operations are ordered in a priority queue and are applied also from lower to highest priority. //symAccessPri[CCATOM] = 2; //symAccessPri[CCAND] = 3; //symAccessPri[CCOR] = 7; //symAccessPri[CCSOME] = 4; //symAccessPri[CCALL] = 1; //symAccessPri[CCATLEAST] = 1; //symAccessPri[CCATMOST] = 6; cint64 nextPriority = 14; symAccessPri[CCTOP] = nextPriority; symAccessPri[-CCBOTTOM] = nextPriority; symAccessPri[CCATOM] = nextPriority; symAccessPri[-CCATOM] = nextPriority; nextPriority = 13; symAccessPri[CCAND] = nextPriority; symAccessPri[-CCOR] = nextPriority; symAccessPri[CCSUB] = nextPriority; symAccessPri[CCEQ] = nextPriority; symAccessPri[CCIMPLTRIG] = nextPriority; symAccessPri[CCBRANCHTRIG] = nextPriority; symAccessPri[CCPBINDTRIG] = nextPriority; symAccessPri[CCPBINDAND] = nextPriority; symAccessPri[CCVARBINDTRIG] = nextPriority; symAccessPri[CCVARBINDAND] = nextPriority; symAccessPri[CCVARPBACKTRIG] = nextPriority; symAccessPri[CCBACKACTIVTRIG] = nextPriority; symAccessPri[CCOR] = nextPriority; symAccessPri[-CCAND] = nextPriority; symAccessPri[-CCEQ] = nextPriority; symAccessPri[CCDATATYPE] = nextPriority; symAccessPri[-CCDATATYPE] = nextPriority; symAccessPri[CCDATALITERAL] = nextPriority; symAccessPri[-CCDATALITERAL] = nextPriority; symAccessPri[CCDATARESTRICTION] = nextPriority; symAccessPri[-CCDATARESTRICTION]= nextPriority; mDisjDelConsidPriOffset = -11.0; mDisjDelProcessPriOffset = -11.5; nextPriority = 12; symAccessPri[CCALL] = nextPriority; symAccessPri[-CCSOME] = nextPriority; symAccessPri[CCAQALL] = nextPriority; symAccessPri[CCIMPLALL] = nextPriority; symAccessPri[CCBRANCHALL] = nextPriority; symAccessPri[CCIMPLAQALL] = nextPriority; symAccessPri[CCBRANCHAQALL] = nextPriority; symAccessPri[CCPBINDALL] = nextPriority; symAccessPri[CCVARBINDALL] = nextPriority; symAccessPri[CCVARBINDAQALL] = nextPriority; symAccessPri[CCVARPBACKAQALL] = nextPriority; symAccessPri[CCVARPBACKALL] = nextPriority; nextPriority = 11; symAccessPri[CCAQAND] = nextPriority; symAccessPri[CCIMPLAQAND] = nextPriority; symAccessPri[CCBRANCHAQAND] = nextPriority; symAccessPri[CCPBINDAQAND] = nextPriority; symAccessPri[CCVARBINDAQAND] = nextPriority; symAccessPri[CCVARPBACKAQAND] = nextPriority; nextPriority = 10; symAccessPri[CCAQCHOOCE] = nextPriority; symAccessPri[-CCAQCHOOCE] = nextPriority; nextPriority = 9; symAccessPri[CCIMPL] = nextPriority; symAccessPri[CCBRANCHIMPL] = nextPriority; symAccessPri[CCPBINDIMPL] = nextPriority; symAccessPri[CCPBINDVARIABLE] = nextPriority; symAccessPri[CCPBINDCYCLE] = nextPriority; symAccessPri[CCVARBINDJOIN] = nextPriority; symAccessPri[CCVARBINDVARIABLE] = nextPriority; symAccessPri[CCBACKACTIVIMPL] = nextPriority; symAccessPri[CCVARBINDIMPL] = nextPriority; nextPriority = 8; symAccessPri[CCSELF] = nextPriority; symAccessPri[-CCSELF] = nextPriority; symAccessPri[CCVALUE] = nextPriority; symAccessPri[-CCVALUE] = nextPriority; // intermediately processing limit nextPriority = 7; symAccessPri[CCNOMINAL] = nextPriority; symAccessPri[-CCNOMINAL] = nextPriority; nextPriority = 6; symAccessPri[CCPBINDGROUND] = nextPriority; symAccessPri[CCVARBINDGROUND] = nextPriority; symAccessPri[-CCPBINDGROUND] = nextPriority; symAccessPri[-CCVARBINDGROUND] = nextPriority; nextPriority = 5; symAccessPri[CCATLEAST] = nextPriority; symAccessPri[-CCATMOST] = nextPriority; nextPriority = 4; symAccessPri[CCSOME] = nextPriority; symAccessPri[-CCALL] = nextPriority; symAccessPri[CCAQSOME] = nextPriority; // deterministic processing limit nextPriority = 3; symAccessPri[CCATMOST] = nextPriority; symAccessPri[-CCATLEAST] = nextPriority; nextPriority = 2; // disjunctions + processing offsets } CConcreteConceptProcessingOperatorPriorityStrategy::~CConcreteConceptProcessingOperatorPriorityStrategy() { delete [] priorities; } double CConcreteConceptProcessingOperatorPriorityStrategy::getPriorityOffsetForDisjunctionDelayedConsidering(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode *individual) { return mDisjDelConsidPriOffset; } double CConcreteConceptProcessingOperatorPriorityStrategy::getPriorityOffsetForDisjunctionDelayedProcessing(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode *individual) { return mDisjDelProcessPriOffset; } CConceptProcessPriority CConcreteConceptProcessingOperatorPriorityStrategy::getPriorityForConcept(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode *individual) { qint64 cCode = conceptDescriptor->getData()->getOperatorCode(); bool negated = false; if (conceptDescriptor->isNegated()) { cCode *= -1; negated = true; } double priority = 0; priority = symAccessPri[cCode]; CSortedNegLinker *opConLinkerIt = conceptDescriptor->getData()->getOperandList(); if (cCode == CCATMOST) { qint64 param = conceptDescriptor->getData()->getParameter(); param = param - 1*negated; if (param <= 1 && !opConLinkerIt) { priority = 5.5; } else { double priorityOffset = (exp(-param / 1000.)) * 0.5; priority += priorityOffset; } } else if (cCode == CCATLEAST) { qint64 param = conceptDescriptor->getData()->getParameter(); param = param + 1*negated; if (param <= 2 && !opConLinkerIt) { priority = 5.0; } else { double priorityOffset = (1. - exp(-param / 1000.)) * 0.5; priority += priorityOffset; } } return CConceptProcessPriority(priority); } }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000020400000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CIndividualAncestorDepthMaximumConcep0000644000175000017500000000475512520551166032370 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Strategy { CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy::CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy() { mStrictIndiNodeProcessing = false; mAddIDIndiPriorization = false; } CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy::~CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy() { } void CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy::configureStrategy(bool strictIndiNodeProcessing, bool additionalIDIndiPriorization) { mStrictIndiNodeProcessing = strictIndiNodeProcessing; mAddIDIndiPriorization = additionalIDIndiPriorization; } CIndividualProcessNodePriority CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy::getPriorityForIndividual(CIndividualProcessNode* individual) { double conPriority = 0.; CConceptProcessingQueue* conProQueue = individual->getConceptProcessingQueue(false); if (conProQueue) { CConceptProcessPriority conProPriority; if (conProQueue->getNextConceptProcessPriority(&conProPriority)) { conPriority = conProPriority.getPriority(); } } double indiPriority = individual->getIndividualAncestorDepth(); if (mAddIDIndiPriorization) { indiPriority += - 1. / (10+individual->getIndividualID()) + 0.1; } return CIndividualProcessNodePriority(conPriority,indiPriority,mStrictIndiNodeProcessing); } }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CEqualDepthTaskProcessingPriorityStrategy.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CEqualDepthTaskProcessingPriorityStra0000644000175000017500000000545612520551166032435 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_STRATEGY_CEQUALDEPTHTASKPROCESSINGPRIORITYSTRATEGY_H #define KONCLUDE_REASONER_KERNEL_STRATEGY_CEQUALDEPTHTASKPROCESSINGPRIORITYSTRATEGY_H // Libraries includes // Namespace includes #include "CTaskProcessingPriorityStrategy.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Process; using namespace Task; namespace Strategy { /*! * * \class CEqualDepthTaskProcessingPriorityStrategy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEqualDepthTaskProcessingPriorityStrategy : public CTaskProcessingPriorityStrategy { // public methods public: //! Constructor CEqualDepthTaskProcessingPriorityStrategy(); //! Destructor virtual ~CEqualDepthTaskProcessingPriorityStrategy(); virtual double getPriorityForTaskBranching(CSatisfiableCalculationTask* branchingTask, CSatisfiableCalculationTask* parentTask, CIndividualProcessNode* indiProcessNode, CConceptDescriptor* branchingConcept, CSortedNegLinker* branchedConcept, cint64 branchNumber); virtual double getPriorityForTaskQualifing(CSatisfiableCalculationTask* branchingTask, CSatisfiableCalculationTask* parentTask, bool qualifingNegated); virtual double getPriorityForTaskMerging(CSatisfiableCalculationTask* branchingTask, CSatisfiableCalculationTask* parentTask); virtual double getPriorityForTaskReusing(CSatisfiableCalculationTask* branchingTask, CSatisfiableCalculationTask* parentTask, bool reusingAlternative); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_STRATEGY_CEQUALDEPTHTASKPROCESSINGPRIORITYSTRATEGY_H ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CIndividualAncestorDepthMaximumConcep0000644000175000017500000000474212520551166032364 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_STRATEGY_CINDIVIDUALANCESTORDEPTHMAXIMUMCONCEPTPROCESSINGPRIORITYSTRATEGY_H #define KONCLUDE_REASONER_KERNEL_STRATEGY_CINDIVIDUALANCESTORDEPTHMAXIMUMCONCEPTPROCESSINGPRIORITYSTRATEGY_H // Libraries includes // Namespace includes #include "CIndividualProcessingPriorityStrategy.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Strategy { /*! * * \class CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy : public CIndividualProcessingPriorityStrategy { // public methods public: //! Constructor CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy(); //! Destructor virtual ~CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy(); void configureStrategy(bool strictIndiNodeProcessing, bool additionalIDIndiPriorization); virtual CIndividualProcessNodePriority getPriorityForIndividual(CIndividualProcessNode* individual); // protected methods protected: // protected variables protected: bool mStrictIndiNodeProcessing; bool mAddIDIndiPriorization; // private methods private: // private variables private: }; }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_STRATEGY_CINDIVIDUALANCESTORDEPTHMAXIMUMCONCEPTPROCESSINGPRIORITYSTRATEGY_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CIndividualProcessingPriorityStrategy.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CIndividualProcessingPriorityStrategy0000644000175000017500000000235412520551166032531 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessingPriorityStrategy.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Strategy { CIndividualProcessingPriorityStrategy::CIndividualProcessingPriorityStrategy() { } CIndividualProcessingPriorityStrategy::~CIndividualProcessingPriorityStrategy() { } }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CIndividualProcessingPriorityStrategy.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Strategy/CIndividualProcessingPriorityStrategy0000644000175000017500000000427012520551166032530 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_STRATEGY_CINDIVIDUALPROCESSINGPRIORITYSTRATEGY_H #define KONCLUDE_REASONER_KERNEL_STRATEGY_CINDIVIDUALPROCESSINGPRIORITYSTRATEGY_H // Libraries includes // Namespace includes // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CIndividualProcessNodePriority.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Process; namespace Strategy { /*! * * \class CIndividualProcessingPriorityStrategy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessingPriorityStrategy { // public methods public: //! Constructor CIndividualProcessingPriorityStrategy(); //! Destructor virtual ~CIndividualProcessingPriorityStrategy(); virtual CIndividualProcessNodePriority getPriorityForIndividual(CIndividualProcessNode* individual) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Strategy }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_STRATEGY_CINDIVIDUALPROCESSINGPRIORITYSTRATEGY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/KernelSettings.h0000644000175000017500000000334212520551172024374 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_KERNELSETTINGS #define KONCLUDE_REASONER_KERNEL_KERNELSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Reasoner { namespace Kernel { /*! * * \file KernelSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // Custom Events >= 2000 const QEvent::Type EVENTCALCBOXSATISFIABLE = (QEvent::Type)2000; const QEvent::Type EVENTCALCEDBOXSATISFIABLECALLBACK = (QEvent::Type)2001; const QEvent::Type EVENTCALCQUERY = (QEvent::Type)2002; const QEvent::Type EVENTCALCEDQUERY = (QEvent::Type)2003; const QEvent::Type EVENTQUERIEDTAXCOMPUTEDCALLBACK = (QEvent::Type)2004; }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_KERNEL_KERNELSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/0000755000175000017500000000000012613407256022704 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingStatistics.cpp0000644000175000017500000013526212520551134027703 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessingStatistics.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CProcessingStatistics* CProcessingStatistics::mInstance = nullptr; cint64 CProcessingStatistics::statisticCount = 0; QMutex CProcessingStatistics::mInstanceMutex; CProcessingStatistics* registratorInstance = CProcessingStatistics::getProcessingStatistics(); const CProcessingStatisticDescription CProcessingStatistics::statINDIVIDUALNODESWITCHCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-node-switch-count"); const CProcessingStatisticDescription CProcessingStatistics::statTASKPROCESSCHANGECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"task-process-change-count"); const CProcessingStatisticDescription CProcessingStatistics::statTASKPROCESSPAUSECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"task-process-pause-count"); const CProcessingStatisticDescription CProcessingStatistics::statTASKCREATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"task-creation-count"); const CProcessingStatisticDescription CProcessingStatistics::statROOTTASKSATISFIABLECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"root-task-satisfiable-calculated-count"); const CProcessingStatisticDescription CProcessingStatistics::statROOTTASKUNSATISFIABLECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"root-task-unsatisfiable-calculated-count"); const CProcessingStatisticDescription CProcessingStatistics::statCOMPLETIONGRAPHREUSECACHERETRIEVALCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"completion-graph-reuse-cache-retrieval-count"); const CProcessingStatisticDescription CProcessingStatistics::statCOMPLETIONGRAPHREUSECACHERETRIEVALSUCCESSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"completion-graph-reuse-cache-retrieval-success-count"); const CProcessingStatisticDescription CProcessingStatistics::statCOMPLETIONGRAPHREUSECACHERETRIEVALFAILEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"completion-graph-reuse-cache-retrieval-failed-count"); const CProcessingStatisticDescription CProcessingStatistics::statCOMPLETIONGRAPHREUSECACHEREUSINGDETCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"completion-graph-reuse-cache-reusing-deterministic-count"); const CProcessingStatisticDescription CProcessingStatistics::statCOMPLETIONGRAPHREUSECACHEREUSINGNONDETCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"completion-graph-reuse-cache-reusing-nondeterministic-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHERETRIEVALCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-retrieval-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHERETRIEVALHASHCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-hash-retrieval-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHERETRIEVALHASHSUCCESSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-hash-retrieval-success-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHERETRIEVALHASHFAILEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-hash-retrieval-failed-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHERETRIEVALPRECHECKCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-pretest-retrieval-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHERETRIEVALPRECHECKSUCCESSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-pretest-retrieval-success-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHERETRIEVALPRECHECKDIRECTFAILEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-pretest-retrieval-direct-failed-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHERETRIEVALPRECHECKINSUFFICIENTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-pretest-retrieval-insufficient-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHEUSEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-used-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHEWRITINGREQUSTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-writing-request-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHEWRITINGREQUSTDIFFNODELEVELFAILEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-writing-request-different-individual-node-levels-failed-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHEWRITINGREQUSTDIFFNOMINALFAILEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-writing-request-different-nominal-nodes-failed-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHEWRITINGREQUSTATOMICCLASHFAILEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-writing-request-atomic-clash-failed-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHEWRITINGTRYINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-writing-trying-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHEWRITINGALREADYCACHEDTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-writing-already-cached-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHEWRITINGALREADYCACHEDTESTPRECHECKFAILEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-writing-already-cached-pretest-failed-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHEWRITINGALREADYCACHEDTESTHASHFAILEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-writing-already-cached-hash-test-failed-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHEWRITINGALREADYCACHEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-writing-already-cached-count"); const CProcessingStatisticDescription CProcessingStatistics::statUNSATCACHEWRITINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"unsatisfiable-cache-writing-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHERETRIEVALCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-retrieval-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHERETRIEVALSUCCESSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-successful-retrieval-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHERETRIEVALFOUNDEXPANSIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-found-expansion-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHERETRIEVALFOUNDSATISFIABLECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-found-satisfiable-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHERETRIEVALCOMPATIBILITYTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-compatibility-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHERETRIEVALCOMPATIBLESATCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-found-compatible-satisfiability-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHERETRIEVALINCOMPATIBLESATCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-found-only-incompatible-satisfiability-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHERETRIEVALEXPANDEDCONCEPTSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-expanded-concepts-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHEWRITINGREQUESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-writing-request-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHESATISFIABLEWRITINGREQUESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-writing-satisfiable-request-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHEEXPANSIONWRITINGREQUESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-writing-expansion-request-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHEWRITINGSIGNATUREALREADYCACHEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-writing-signature-already-cached-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHEWRITINGSIGNATUREALREADYCACHEDINCOMPATIBLECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-writing-signature-already-incompatible-cached-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHEWRITINGSIGNATUREALREADYCACHEDSATADDEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-writing-signature-already-cached-satisfiable-added-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHEWRITINGSIGNATURESATISFIABLECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-writing-signature-satisfiable-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHEWRITINGSIGNATUREEXPANSIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-writing-signature-expansion-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHEWRITINGSIGSATCRITICALBRANCHCONCEPTADDEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-writing-signature-satisfiable-critical-branch-concepts-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHEWRITINGEXPANSIONDELAYEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-writing-expansion-delayed-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATEXPCACHEWRITINGERRORCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-expander-cache-error-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATCACHEDABSORBEDDISJUNCTIONCONCEPTSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-cached-absorbed-disjunction-concepts-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATCACHEDABSORBEDMERGINGCONCEPTSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-cached-absorbed-merging-concepts-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATCACHEDABSORBEDGENERATINGCONCEPTSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"satisfiable-cached-absorbed-generating-concepts-count"); const CProcessingStatisticDescription CProcessingStatistics::statSIGNATURESAVINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"signature-blocking-saving-count"); const CProcessingStatisticDescription CProcessingStatistics::statSIGNATUREMIRRORINGBLOCKINGREFRESHCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"signature-mirroring-blocking-refresh-count"); const CProcessingStatisticDescription CProcessingStatistics::statSIGNATUREMIRRORINGBLOCKINGREFRESHLOSEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"signature-mirroring-blocking-refresh-lose-count"); const CProcessingStatisticDescription CProcessingStatistics::statSIGNATUREMIRRORINGBLOCKINGSEARCHCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"signature-mirroring-blocking-search-count"); const CProcessingStatisticDescription CProcessingStatistics::statSIGNATUREMIRRORINGBLOCKINGESTABLISHCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"signature-mirroring-blocking-establish-count"); const CProcessingStatisticDescription CProcessingStatistics::statSIGNATUREMIRRORINGBLOCKINGADDFOLLOWINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"signature-mirroring-blocking-add-following-count"); const CProcessingStatisticDescription CProcessingStatistics::statSIGNATUREMIRRORINGBLOCKINGREMOVEFOLLOWINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"signature-mirroring-blocking-remove-following-count"); const CProcessingStatisticDescription CProcessingStatistics::statSIGNATUREMIRRORINGBLOCKINGCONCEPTEXPANSIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"signature-mirroring-blocking-concept-expansion-count"); const CProcessingStatisticDescription CProcessingStatistics::statSIGNATUREMIRRORINGBLOCKINGCANDIDATEREGARDEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"signature-mirroring-blocking-candidate-regarded-count"); const CProcessingStatisticDescription CProcessingStatistics::statSIGNATUREMIRRORINGBLOCKINGCANDIDATEREGARDEDINVALIDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"signature-mirroring-blocking-candidate-regarded-invalid-count"); const CProcessingStatisticDescription CProcessingStatistics::statSIGNATUREMIRRORINGBLOCKINGCANDIDATEREGARDEDINCOMPATIBLECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"signature-mirroring-blocking-candidate-regarded-incompatible-count"); const CProcessingStatisticDescription CProcessingStatistics::statTASKBACKJUMPINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"task-backjumping-count"); const CProcessingStatisticDescription CProcessingStatistics::statTASKAWAYBACKJUMPINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"task-away-backjumping-count"); const CProcessingStatisticDescription CProcessingStatistics::statTASKROOTBACKJUMPINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"task-root-backjumping-count"); const CProcessingStatisticDescription CProcessingStatistics::statCLASHEDBACKTRACKINGSTARTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"clashed-backtracking-started-count"); const CProcessingStatisticDescription CProcessingStatistics::statCLASHEDBACKTRACKINGSTEPSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"clashed-backtracking-steps-count"); const CProcessingStatisticDescription CProcessingStatistics::statCLASHEDBACKTRACKINGPREVNODELEVELCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"clashed-backtracking-previous-individual-node-level-count"); const CProcessingStatisticDescription CProcessingStatistics::statCLASHEDBACKTRACKINGPREVNODELEVELBRANCHCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"clashed-backtracking-previous-individual-node-level-current-branch-count"); const CProcessingStatisticDescription CProcessingStatistics::statCLASHEDBACKTRACKINGCURRNODELEVELBRANCHCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"clashed-backtracking-current-individual-node-level-current-branch-count"); const CProcessingStatisticDescription CProcessingStatistics::statCLASHEDBACKTRACKINGINDEPENDENTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"clashed-backtracking-independent-reached-count"); const CProcessingStatisticDescription CProcessingStatistics::statCLASHEDBACKTRACKGNONDETERMINISTICCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"clashed-backtracking-non-deterministic-initialization-count"); const CProcessingStatisticDescription CProcessingStatistics::statCLASHEDBACKTRACKGNONDETALREADYCLASHFAILEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"clashed-backtracking-non-deterministic-already-clash-failed-count"); const CProcessingStatisticDescription CProcessingStatistics::statCLASHEDBACKTRACKGNONDETCLOSEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"clashed-backtracking-non-deterministic-closed-count"); const CProcessingStatisticDescription CProcessingStatistics::statCLASHEDBACKTRACKEDDESCRIPTORSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"backtracked-clashed-descriptors-count"); const CProcessingStatisticDescription CProcessingStatistics::statRULEAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statAUTOMATERULEAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-AUTOMATE-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statANDRULEAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-AND-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statSOMERULEAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-SOME-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statFUNCTIONALRULEAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-FUNCTIONAL-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statATMOSTRULEAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-ATMOST-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statORRULEAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-OR-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statSELFRULEAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-SELF-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statATLEASTRULEAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-ATLEAST-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statALLRULEAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-ALL-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statNOMINALRULEAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-NOMINAL-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statVALUERULEAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-VALUE-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statIMPLICATIONRULEAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-IMPLICATION-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODEMERGEINITCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-merging-initialization-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODEQUALIFYCHOOCECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-choose-qualify-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODEMERGECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-merging-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODEMERGENEWNOMINALINITCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-merging-new-nominals-initialization-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODESMERGEABLETESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-mergeable-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODESMERGEABLEDISJOINTROLETESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-mergeable-disjoint-role-links-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODESMERGEABLECONCEPTSETTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-mergeable-concept-sets-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODESMERGEABLEDISTINCTTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-mergeable-distinct-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODESMERGEABLETESTSUCCESSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-mergeable-test-success-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODEMERGECONCEPTSADDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-merging-concepts-added-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODEMERGELINKSADDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-merging-links-added-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODEMERGEDISTINCTADDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-merging-distinct-added-count"); const CProcessingStatisticDescription CProcessingStatistics::statIMPLICATIONTRIGGERINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"implication-triggering-count"); const CProcessingStatisticDescription CProcessingStatistics::statIMPLICATIONEXECUTINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"implication-executing-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODENOMINALMERGECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-nominal-merge-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODENOMINALDISTINCTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-nominal-distinct-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODENOMINALCORRECTIDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-nodes-nominal-correct-ID-count"); const CProcessingStatisticDescription CProcessingStatistics::statALLROLERESTRICTIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"executed-all-role-restriction-count"); const CProcessingStatisticDescription CProcessingStatistics::statAUTOMATETRANSACTIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"executed-automate-transaction-count"); const CProcessingStatisticDescription CProcessingStatistics::statAUTOMATESTATECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"executed-automate-state-count"); const CProcessingStatisticDescription CProcessingStatistics::statAUTOMATEINITCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"executed-automate-initialization-count"); const CProcessingStatisticDescription CProcessingStatistics::statSUCCESSORINDINODECREATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"created-successor-individual-node-count"); const CProcessingStatisticDescription CProcessingStatistics::statDISTINCTSUCCESSORINDINODECREATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"created-distinct-successor-individual-node-count"); const CProcessingStatisticDescription CProcessingStatistics::statSEPARATESUCCESSORINDINODECREATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"created-separate-successor-individual-node-count"); const CProcessingStatisticDescription CProcessingStatistics::statNOMINALSUCCESSORINDINODECREATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"created-nominal-successor-individual-node-count"); const CProcessingStatisticDescription CProcessingStatistics::statTASKDISTINCTMERGEBRANCHCREATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"task-creation-distinct-merge-branch-count"); const CProcessingStatisticDescription CProcessingStatistics::statTASKINDINODEMERGEBRANCHCREATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"task-creation-individual-node-merge-branch-count"); const CProcessingStatisticDescription CProcessingStatistics::statTASKQUALIFYCHOOSEBRANCHCREATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"task-creation-qualify-choose-branch-count"); const CProcessingStatisticDescription CProcessingStatistics::statTASKORBRANCHCREATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"task-creation-or-branch-count"); const CProcessingStatisticDescription CProcessingStatistics::statOREXECUTIONINITCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"or-processing-initialization-count"); const CProcessingStatisticDescription CProcessingStatistics::statOREXECUTIONCONTINUECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"or-processing-continuation-count"); const CProcessingStatisticDescription CProcessingStatistics::statORINSTANTCONTAINSEXECUTEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"or-processing-instant-contains-branch-executing-count"); const CProcessingStatisticDescription CProcessingStatistics::statORTRIGGEREDDELAYEDEXECUTEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"or-processing-trigger-delayed-executing-count"); const CProcessingStatisticDescription CProcessingStatistics::statORTRIGGERSEARCHCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"or-processing-trigger-search-count"); const CProcessingStatisticDescription CProcessingStatistics::statORQUEUEDDELAYEDEXECUTEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"or-processing-queued-delayed-executing-count"); const CProcessingStatisticDescription CProcessingStatistics::statOREXECUTIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"or-processing-executing-count"); const CProcessingStatisticDescription CProcessingStatistics::statORSINGLEBRANCHCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"or-processing-single-branching-count"); const CProcessingStatisticDescription CProcessingStatistics::statORMULTIPLEBRANCHCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"or-processing-multiple-branching-count"); const CProcessingStatisticDescription CProcessingStatistics::statORREPLACEMENTIMPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"or-replacement-implication-count"); const CProcessingStatisticDescription CProcessingStatistics::statCONCEPTTRIGGERINSTALLCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"install-concept-trigger-count"); const CProcessingStatisticDescription CProcessingStatistics::statROLETRIGGERINSTALLCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"install-role-link-trigger-count"); const CProcessingStatisticDescription CProcessingStatistics::statLABELCONCEPTSUBSETTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"concept-sub-set-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statLABELCONCEPTEQUALSETTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"concept-equal-set-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statLABELCONCEPTPAIRWISEEQUALSETTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"concept-pairwise-equal-set-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statOPTIMIZEDBLOCKINGB2AUTOMATETRANSACTIONTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"optimized-blocking-compatible-automate-transactions-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statOPTIMIZEDBLOCKINGTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"optimized-blocking-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statSUBSETBLOCKINGTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"sub-set-blocking-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statEQUALSETBLOCKINGTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"equal-set-blocking-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statPAIRWISEEQUALSETBLOCKINGTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"pairwise-equal-set-blocking-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODEBLOCKINGTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-node-blocking-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statDETECTINDINODEBLOCKINGSTATUSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"detect-individual-node-blocking-status-count"); const CProcessingStatisticDescription CProcessingStatistics::statDETECTANCINDINODEBLOCKINGSTATUSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"detect-ancestor-individual-node-blocking-status-count"); const CProcessingStatisticDescription CProcessingStatistics::statSUCCESSBLOCKINGSTATUSDETECTIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"blocking-status-detection-success-count"); const CProcessingStatisticDescription CProcessingStatistics::statFAILEDBLOCKINGSTATUSDETECTIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"blocking-status-detection-failed-count"); const CProcessingStatisticDescription CProcessingStatistics::statCONTINUEBLOCKINGTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"continue-blocking-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statANCESTORBLOCKINGSEARCHINDINODECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"ancestor-blocking-search-individual-node-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statANYWHEREBLOCKINGSEARCHINDINODECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"anywhere-blocking-search-individual-node-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statANYWHEREBLOCKINGCANDIDATEHASHSEARCHINDINODECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"anywhere-blocking-candidate-hash-search-individual-node-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statANYWHEREBLOCKINGCANDIDATEHASHUDATECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"anywhere-blocking-candidate-hash-update-count"); const CProcessingStatisticDescription CProcessingStatistics::statANYWHEREBLOCKINGCANDIDATEHASHUDATEADDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"anywhere-blocking-candidate-hash-update-individual-node-add-count"); const CProcessingStatisticDescription CProcessingStatistics::statANYWHEREBLOCKINGCANDIDATEHASHUDATEREMOVECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"anywhere-blocking-candidate-hash-update-individual-node-remove-count"); const CProcessingStatisticDescription CProcessingStatistics::statANYWHERECORECONCEPTBLOCKINGCANDIDATEHASHSEARCHINDINODECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"anywhere-core-concept-blocking-search-individual-node-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODEEXPANSIONBLOCKINGTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-node-expansion-blocking-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODEPROCESSINGBLOCKINGTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-node-processing-blocking-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statLINKSCREATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-node-role-links-creation-count"); const CProcessingStatisticDescription CProcessingStatistics::statDISTINCTCREATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-node-distinct-creation-count"); const CProcessingStatisticDescription CProcessingStatistics::statCONCEPTSADDEDINDINODELABELSETCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-node-concepts-added-set-count"); const CProcessingStatisticDescription CProcessingStatistics::statCONCEPTSADDEDINDINODEPROCESSINGQUEUECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-node-concepts-added-processing-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODESADDEDPROCESSINGQUEUECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-node-added-processing-count"); const CProcessingStatisticDescription CProcessingStatistics::statINSERTCONCEPTREAPPLICATIONSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-node-install-concept-reapplication-count"); const CProcessingStatisticDescription CProcessingStatistics::statREAPPLIEDCONCEPTSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-node-concept-reapplication-count"); const CProcessingStatisticDescription CProcessingStatistics::statCORECONCEPTSADDEDINDINODELABELSETCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-node-core-concepts-added-set-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODEUPDATELOADCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-node-update-load-count"); const CProcessingStatisticDescription CProcessingStatistics::statINDINODELOCALIZEDLOADCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"individual-node-localization-count"); const CProcessingStatisticDescription CProcessingStatistics::statPBINDVARIABLEBINDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"binding-candidate-propagation-binded-variable-count"); const CProcessingStatisticDescription CProcessingStatistics::statPBINDPROPAGATEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"binding-candidate-propagation-propagated-count"); const CProcessingStatisticDescription CProcessingStatistics::statPBINDPROPAGATEDFRESHCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"binding-candidate-propagation-fresh-propagated-count"); const CProcessingStatisticDescription CProcessingStatistics::statPBINDPROPAGATEDINITIALCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"binding-candidate-propagation-initial-propagated-count"); const CProcessingStatisticDescription CProcessingStatistics::statPBINDGROUNDINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"binding-candidate-propagation-grounding-count"); const CProcessingStatisticDescription CProcessingStatistics::statPBINDCYCLEPROPAGATECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"binding-candidate-propagation-cycle-propagation-count"); const CProcessingStatisticDescription CProcessingStatistics::statPBINDCYCLEREAPPLYINSTALLCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"binding-candidate-propagation-cycle-reapply-install-count"); const CProcessingStatisticDescription CProcessingStatistics::statPBINDRULEANDAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-binding-candidate-propagation-AND-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statPBINDRULEALLAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-binding-candidate-propagation-ALL-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statPBINDRULEGROUNDINGAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-binding-candidate-propagation-GROUNDING-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statPBINDRULECYCLEAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-binding-candidate-propagation-CYCLE-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statPBINDRULEIMPLICATIONAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-binding-candidate-propagation-IMPLICATION-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statPBINDRULEBINDNAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-binding-candidate-propagation-BINDING-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statPBINDREAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"binding-candidate-propagation-reapplication-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDVARIABLEBINDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"variable-binding-propagation-binded-variable-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDPROPAGATEDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"variable-binding-propagation-propagated-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDPROPAGATEDFRESHCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"variable-binding-propagation-fresh-propagated-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDPROPAGATEDINITIALCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"variable-binding-propagation-initial-propagated-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDRULEANDAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-variable-binding-propagation-AND-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDRULEALLAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-variable-binding-propagation-ALL-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDRULEBINDAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-variable-binding-propagation-BINDING-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDRULEGROUNDINGAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-variable-binding-propagation-GROUNDING-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDRULEIMPLICATIONAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-variable-binding-propagation-IMPLICATION-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDRULEJOINAPPLICATIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"rule-variable-binding-propagation-JOIN-application-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDJOINTRIGGERINSTALLCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"variable-binding-propagation-join-trigger-install-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDJOINTRIGGEREXECUTECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"variable-binding-propagation-join-trigger-execute-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDJOINCOMBINECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"variable-binding-propagation-join-combine-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDJOINCREATENEWCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"variable-binding-propagation-create-new-count"); const CProcessingStatisticDescription CProcessingStatistics::statVARBINDGROUNDINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"variable-binding-propagation-grounding-count"); const CProcessingStatisticDescription CProcessingStatistics::statTIMEBACKTRACING(registratorInstance,++CProcessingStatistics::statisticCount,"timing-clash-backtracking"); const CProcessingStatisticDescription CProcessingStatistics::statTIMEUNSATCACHERETRIVAL(registratorInstance,++CProcessingStatistics::statisticCount,"timing-unsatisfiable-cache-retrieval"); const CProcessingStatisticDescription CProcessingStatistics::statTIMECOMPLETIONGRAPHREUSERETRIVAL(registratorInstance,++CProcessingStatistics::statisticCount,"timing-completion-graph-reuse-cache-retrieval"); const CProcessingStatisticDescription CProcessingStatistics::statANALYSESUBSUMERCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"analyse-subsumer-count"); const CProcessingStatisticDescription CProcessingStatistics::statANALYSEPOSSIBLESUBSUMPTIONSCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"analyse-possible-subsumer-count"); const CProcessingStatisticDescription CProcessingStatistics::statANALYSEPSEUDOMODELCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"analyse-create-pseudo-model-count"); const CProcessingStatisticDescription CProcessingStatistics::statANALYSECANDIDATECONCEPTSATURATEDALTERNATIVETESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"analyse-candidate-concepts-saturated-alternatives-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statANALYSECANDIDATECONCEPTSATURATEDALTERNATIVEMERGINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"analyse-candidate-concepts-saturated-alternatives-merging-count"); const CProcessingStatisticDescription CProcessingStatistics::statANALYSECANDIDATECONCEPTSATURATEDCONCEPTSETMERGINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"analyse-candidate-concepts-saturated-concept-set-merging-count"); const CProcessingStatisticDescription CProcessingStatistics::statANALYSECANDIDATECONCEPTSATURATEDROLESUCCESSORMERGINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"analyse-candidate-concepts-saturated-role-successor-merging-count"); const CProcessingStatisticDescription CProcessingStatistics::statANALYSECANDIDATECONCEPTSATURATEDALTERNATIVEFOUNDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"analyse-candidate-concepts-saturated-alternatives-found-count"); const CProcessingStatisticDescription CProcessingStatistics::statANALYSECANDIDATECONCEPTSATURATEDROLESUCCESSOREXTENDEDMERGINGCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"analyse-candidate-concepts-saturated-role-successor-extended-merging-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATURATIONCACHEESTABLISHCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"saturation-caching-establish-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATURATIONCACHECONCEPTEXPANSIONCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"saturation-caching-concept-expansion-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATURATIONCACHELOSECOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"saturation-caching-lose-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATURATIONCRITICALTESTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"saturation-critical-concept-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATURATIONCRITICALALLCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"saturation-critical-ALL-concept-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATURATIONCRITICALORCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"saturation-critical-OR-concept-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATURATIONCRITICALATMOSTCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"saturation-critical-ATMOST-concept-test-count"); const CProcessingStatisticDescription CProcessingStatistics::statSATURATIONCRITICALADDCOUNT(registratorInstance,++CProcessingStatistics::statisticCount,"saturation-critical-add-count"); CProcessingStatistics::CProcessingStatistics() { } CProcessingStatistics::~CProcessingStatistics() { } CProcessingStatisticRegistrator* CProcessingStatistics::registerProcessingStatisticDescription(CProcessingStatisticDescription* statDesc) { mStatDescHash.insert(statDesc->getStatisticDescriptionString(),statDesc); mStatDescList.append(statDesc); return this; } QList* CProcessingStatistics::getProcessingStatisticDescriptionList() { return &mStatDescList; } CProcessingStatistics* CProcessingStatistics::getProcessingStatistics() { if (!mInstance) { mInstanceMutex.lock(); if (!mInstance) { mInstance = new CProcessingStatistics(); } mInstanceMutex.unlock(); } return mInstance; } cint64 CProcessingStatistics::getIndexFromProcessingStatisticDescriptionName(const QString& statDesName) { CProcessingStatistics* procStat = getProcessingStatistics(); CProcessingStatisticDescription* statDes = procStat->mStatDescHash.value(statDesName); if (statDes) { return statDes->getStatisticGatheringIndex(); } else { return -1; } } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableCacheRetrievalData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableCacheRetriev0000644000175000017500000000373112520551124032257 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATISFIABLECACHERETRIEVALDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATISFIABLECACHERETRIEVALDATA_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualNodeSatisfiableCacheRetrievalData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeSatisfiableCacheRetrievalData { // public methods public: //! Constructor CIndividualNodeSatisfiableCacheRetrievalData(); //! Destructor virtual ~CIndividualNodeSatisfiableCacheRetrievalData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATISFIABLECACHERETRIEVALDATA_H ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingAlternativeSignatureBlockingCandidateData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingAlternativeSignatureBlockingC0000644000175000017500000000617712520551072032323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGALTERNATIVESIGNATUREBLOCKINGCANDIDATEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGALTERNATIVESIGNATUREBLOCKINGCANDIDATEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CBlockingAlternativeData.h" #include "CIndividualProcessNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CBlockingAlternativeSignatureBlockingCandidateData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBlockingAlternativeSignatureBlockingCandidateData : public CBlockingAlternativeData { // public methods public: //! Constructor CBlockingAlternativeSignatureBlockingCandidateData(); CBlockingAlternativeSignatureBlockingCandidateData* initSignatureBlockingCandidateData(CIndividualProcessNode* blockIndiCand, cint64 violatedResCount, cint64 violatedNonDetResCount, cint64 diffConceptCount); CIndividualProcessNode* getSignatureBlockingCandidateNode(); CBlockingAlternativeSignatureBlockingCandidateData* setSignatureBlockingCandidateNode(CIndividualProcessNode* blockIndiCan); cint64 getConceptDifferenceCount(); cint64 getViolatedRestrictionCount(); cint64 getViolatedNonDeterministicRestrictionCount(); CBlockingAlternativeSignatureBlockingCandidateData* setConceptDifferenceCount(cint64 count); CBlockingAlternativeSignatureBlockingCandidateData* setViolatedRestrictionCount(cint64 count); CBlockingAlternativeSignatureBlockingCandidateData* setViolatedNonDeterministicRestrictionCount(cint64 count); virtual BLOCKINGALTERNATIVEDATA getBlockingAlternativeDataType(); // protected methods protected: // protected variables protected: CIndividualProcessNode* mBlockIndiCandi; cint64 mViolatedResCount; cint64 mViolatedNonDetResCount; cint64 mDiffConceptCount; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGALTERNATIVESIGNATUREBLOCKINGCANDIDATEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativePropagationMap.cpp0000644000175000017500000000305212520551144031346 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativePropagationMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativePropagationMap::CRepresentativePropagationMap(CProcessContext* processContext) : mProcessContext(processContext),CPROCESSMAP(processContext) { } CRepresentativePropagationMap* CRepresentativePropagationMap::initRepresentativePropagationMap(CRepresentativePropagationMap* prevMap) { if (prevMap) { *this = *prevMap; } else { CPROCESSMAP::clear(); } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleBackwardSaturationPropagationHashData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleBackwardSaturationPropagationHash0000644000175000017500000000466112520551152032353 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CROLEBACKWARDSATURATIONPROPAGATIONHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CROLEBACKWARDSATURATIONPROPAGATIONHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CBackwardSaturationPropagationLink.h" #include "CBackwardSaturationPropagationReapplyDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRoleBackwardSaturationPropagationHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleBackwardSaturationPropagationHashData { // public methods public: //! Constructor CRoleBackwardSaturationPropagationHashData(); CRoleBackwardSaturationPropagationHashData(const CRoleBackwardSaturationPropagationHashData& data); CBackwardSaturationPropagationLink* mLinkLinker; CBackwardSaturationPropagationReapplyDescriptor* mReapplyLinker; bool mSelfConnected; mutable bool mRoleALLConceptsProcessingQueued; mutable bool mRolePredecessorMergingQueuingRequired; mutable bool mRolePredecessorMergingProcessingQueued; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CROLEBACKWARDSATURATIONPROPAGATIONHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDisjointSuccessorRoleIterator.h0000644000175000017500000000454212520551120031161 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDISJOINTSUCCESSORROLEITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDISJOINTSUCCESSORROLEITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CNegationDisjointEdge.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDisjointSuccessorRoleIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDisjointSuccessorRoleIterator { // public methods public: //! Constructor CDisjointSuccessorRoleIterator(); CDisjointSuccessorRoleIterator(cint64 succIndi, const CPROCESSHASH::iterator& beginIt, const CPROCESSHASH::iterator& endIt); bool hasNext(); CNegationDisjointEdge* next(bool moveNext = true); // protected methods protected: // protected variables protected: cint64 mSuccIndi; CPROCESSHASH::iterator mBeginIt; CPROCESSHASH::iterator mEndIt; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDISJOINTSUCCESSORROLEITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningHash.h0000644000175000017500000000476612520551164031147 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHJOININGHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHJOININGHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CVariableBindingPathJoiningData.h" #include "CVariableBindingPathJoiningHashData.h" #include "CVariableBindingPathJoiningHasher.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CVariableBindingPathJoiningHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingPathJoiningHash : public CPROCESSHASH { // public methods public: //! Constructor CVariableBindingPathJoiningHash(CProcessContext* context); CVariableBindingPathJoiningData* getVariableBindingPathJoiningData(const CVariableBindingPathJoiningHasher& hasher, bool localize = true); CVariableBindingPathJoiningHash* insertVariableBindingPathJoiningData(const CVariableBindingPathJoiningHasher& hasher, CVariableBindingPathJoiningData* joinData); // protected methods protected: // protected variables protected: CProcessContext* mContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHJOININGHASH_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessMemoryPoolAllocationManager.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessMemoryPoolAllocationManager.cp0000644000175000017500000000261112520551136032267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessMemoryPoolAllocationManager.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CProcessMemoryPoolAllocationManager::CProcessMemoryPoolAllocationManager(CMemoryPoolContainer* memoryPoolContainer, CConsiderateMemoryPoolProvider* memoryPoolProvider) : CTaskMemoryPoolAllocationManager(memoryPoolContainer,memoryPoolProvider) { } CProcessMemoryPoolAllocationManager::~CProcessMemoryPoolAllocationManager() { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CMarkerIndividualNodeHash.h0000644000175000017500000000512112520551132030011 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CMARKERINDIVIDUALNODEHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CMARKERINDIVIDUALNODEHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CIndividualProcessNode.h" // Other includes #include "Utilities/Container/CNegLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CMarkerIndividualNodeHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMarkerIndividualNodeHash : public CPROCESSHASH< CConcept*,CXNegLinker* > { // public methods public: //! Constructor CMarkerIndividualNodeHash(CProcessContext* context = nullptr); CMarkerIndividualNodeHash* initMarkerIndividualNodeHash(CMarkerIndividualNodeHash* prevMarkerIndiNodeHash); CXNegLinker* getMarkerIndividualNodeLinker(CConcept* markerConcept); CMarkerIndividualNodeHash* addMarkerIndividualNodeLinker(CConcept* markerConcept, CXNegLinker* indiNodeLinker); CMarkerIndividualNodeHash* addMarkerIndividualNode(CConcept* markerConcept, CIndividualProcessNode* indiNode, bool nondeterministicallyAdded); // protected methods protected: // protected variables protected: CProcessContext* mContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CMARKERINDIVIDUALNODEHASH_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationRepresentativeTransitionExtension.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationRepresentativeTransitionEx0000644000175000017500000000731212520551140032476 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONREPRESENTATIVETRANSITIONEXTENSION_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONREPRESENTATIVETRANSITIONEXTENSION_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CPropagationBindingDescriptor.h" #include "CRepresentativePropagationDescriptor.h" #include "CRepresentativePropagationMap.h" // Other includes #include "Reasoner/Ontology/CVariable.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CPropagationRepresentativeTransitionExtension * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPropagationRepresentativeTransitionExtension { // public methods public: //! Constructor CPropagationRepresentativeTransitionExtension(CProcessContext* processContext); CPropagationRepresentativeTransitionExtension* initPropagationRepresentativeTransitionExtension(CPropagationRepresentativeTransitionExtension* propVarBindTransExtension); bool getLastAnalysedPropagateAllFlag(); CPropagationBindingDescriptor* getLastAnalysedPropagationBindingDescriptor(); CPropagationRepresentativeTransitionExtension* setLastAnalysedPropagationBindingDescriptor(CPropagationBindingDescriptor* lastAnalPropBindDes); CPropagationRepresentativeTransitionExtension* setLastAnalysedPropagateAllFlag(bool propagateAllFlag); CRepresentativePropagationDescriptor* getLeftLastRepresentativeJoiningDescriptor(); CRepresentativePropagationDescriptor* getRightLastRepresentativeJoiningDescriptor(); CPropagationRepresentativeTransitionExtension* setLeftLastRepresentativeJoiningDescriptor(CRepresentativePropagationDescriptor* varBindPathDes); CPropagationRepresentativeTransitionExtension* setRightLastRepresentativeJoiningDescriptor(CRepresentativePropagationDescriptor* varBindPathDes); CRepresentativePropagationMap* getLeftRepresentativePropagationMap(); CRepresentativePropagationMap* getRightRepresentativePropagationMap(); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; bool mLastAnalysedPropagateAllFlag; CPropagationBindingDescriptor* mLastAnalysedPropBindDes; CRepresentativePropagationDescriptor* mLeftLastRepPropDes; CRepresentativePropagationDescriptor* mRightLastRepPropDes; CRepresentativePropagationMap mLeftRepPropMap; CRepresentativePropagationMap mRightRepPropMap; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONREPRESENTATIVETRANSITIONEXTENSION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNegationDisjointEdge.cpp0000644000175000017500000000273312520551132027543 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNegationDisjointEdge.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CNegationDisjointEdge::CNegationDisjointEdge(CProcessContext* processContext) : CLinkEdge(processContext) { } CNegationDisjointEdge* CNegationDisjointEdge::initNegationDisjointEdge(CIndividualProcessNode* sourceIndividual, CIndividualProcessNode* destinationIndividual, CRole* role, CDependencyTrackPoint* depTrackPoint) { initLinkEdge(sourceIndividual,destinationIndividual,role,depTrackPoint); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeUnsatisfiableOccurenceC0000644000175000017500000000502712520551126032271 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData::CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData() { } CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData::~CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData() { } CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData* CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData::initUnsatisfiableOccurenceCacheRetrievalData(CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData* prevData) { if (prevData) { mLastRetCachingTag = prevData->mLastRetCachingTag; mLastRetConceptDes = prevData->mLastRetConceptDes; } else { mLastRetCachingTag = 0; mLastRetConceptDes = nullptr; } return this; } cint64 CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData::getLastRetrievalCachingTag() { return mLastRetCachingTag; } CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData* CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData::setLastRetrievalCachingTag(cint64 tag) { mLastRetCachingTag = tag; return this; } CConceptDescriptor* CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData::getLastRetrievalConceptDescriptor() { return mLastRetConceptDes; } CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData* CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData::setLastRetrievalConceptDescriptor(CConceptDescriptor* conDes) { mLastRetConceptDes = conDes; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessMemoryPoolAllocationManager.h0000644000175000017500000000422012520551136032112 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSMEMORYPOOLALLOCATIONMANAGER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSMEMORYPOOLALLOCATIONMANAGER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Scheduler/CTaskMemoryPoolAllocationManager.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CProcessMemoryPoolAllocationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessMemoryPoolAllocationManager : public CTaskMemoryPoolAllocationManager { // public methods public: //! Constructor CProcessMemoryPoolAllocationManager(CMemoryPoolContainer* memoryPoolContainer, CConsiderateMemoryPoolProvider* memoryPoolProvider); //! Destructor virtual ~CProcessMemoryPoolAllocationManager(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSMEMORYPOOLALLOCATIONMANAGER_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionResolveHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionReso0000644000175000017500000000231712520551154032425 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationIndividualNodeExtensionResolveHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationIndividualNodeExtensionResolveHashData::CSaturationIndividualNodeExtensionResolveHashData() { mResolveData = nullptr; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingStatisticDescription.cpp0000644000175000017500000000310512520551134031712 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessingStatisticDescription.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CProcessingStatisticDescription::CProcessingStatisticDescription(CProcessingStatisticRegistrator* registrator, const cint64 index, const QString& descriptionString) { mStatGatheringIndex = index; mStatDescriptionString = descriptionString; registrator->registerProcessingStatisticDescription(this); } CProcessingStatisticDescription::~CProcessingStatisticDescription() { } QString CProcessingStatisticDescription::getStatisticDescriptionString() const { return mStatDescriptionString; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualProcessNode.h0000644000175000017500000010272212520756406027422 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CIndividualProcessNodeReference.h" #include "CReapplyQueue.h" #include "CConceptLabelSet.h" #include "CRoleReapplyHash.h" #include "CConceptReapplyHash.h" #include "CRoleSuccessorHash.h" #include "CReapplyRoleSuccessorHash.h" #include "CReapplyConceptLabelSet.h" #include "CSuccessorRoleHash.h" #include "CConnectionSuccessorCorrectionHash.h" #include "CConnectionSuccessorSet.h" #include "CConceptProcessingQueue.h" #include "CLocalizationTag.h" #include "CBlockedTestTag.h" #include "CDistinctHash.h" #include "CDisjointSuccessorRoleHash.h" #include "CDependencyTracker.h" #include "CBlockingFollowSet.h" #include "CRoleBackwardPropagationHash.h" #include "CIndividualProcessNode.h" #include "CIndividualProcessNodeLinker.h" #include "CConceptProcessLinker.h" #include "CIndividualProcessNodePriority.h" #include "CIndividualNodeModelData.h" #include "CIndividualNodeBlockData.h" #include "CIndividualNodeSatisfiableCacheRetrievalData.h" #include "CIndividualNodeBackendCacheSynchronisationData.h" #include "CIndividualNodeSatisfiableCacheStoringData.h" #include "CIndividualNodeUnsatisfiableCacheRetrievalData.h" #include "CIndividualNodeAnalizedConceptExpansionData.h" #include "CSignatureBlockingIndividualNodeConceptExpansionData.h" #include "CReusingIndividualNodeConceptExpansionData.h" #include "CIndividualNodeSaturationBlockingData.h" #include "CNominalCachingLossReactivationData.h" #include "CSuccessorConnectedNominalSet.h" #include "CPropagationBindingSet.h" #include "CConceptPropagationBindingSetHash.h" #include "CConceptVariableBindingPathSetHash.h" #include "CConceptRepresentativePropagationSetHash.h" #include "CIndividualNodeIncrementalExpansionData.h" #include "CDatatypesValueSpaceData.h" #include "CAdditionalProcessRoleAssertionsLinker.h" #include "CIndividualMergingHash.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CRole.h" #include "Reasoner/Ontology/CIndividual.h" #include "Reasoner/Ontology/CIRIName.h" #include "Utilities/Memory/CObjectParameterizingAllocator.h" #include "Utilities/Container/CSortedNegLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CIndividualProcessNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNode : public CIndividualProcessNodeReference, public CLocalizationTag, public CBlockedTestTag, public CDependencyTracker { // public methods public: //! Constructor CIndividualProcessNode(CProcessContext* processContext = nullptr); CIndividualProcessNode* initIndividualProcessNode(CIndividualProcessNode* prevIndividual); CIndividualProcessNode* initIndividualProcessNodeCopy(CIndividualProcessNode* prevIndividual, bool adobtConceptLabels = true, bool adobtRoleSuccessors = false, bool adobtStatus = false); CIndividualProcessNode* setReapplyConceptLabelSet(CReapplyConceptLabelSet* reapplyConSet); CReapplyConceptLabelSet* getReapplyConceptLabelSet(bool create = true); CConceptProcessingQueue* getConceptProcessingQueue(bool create = true); CReapplyRoleSuccessorHash* getReapplyRoleSuccessorHash(bool create = true); CRoleSuccessorLinkIterator getRoleSuccessorLinkIterator(CRole* role); CRoleSuccessorLinkIterator getRoleSuccessorHistoryLinkIterator(CRole* role, CIndividualLinkEdge* lastLink); cint64 getRoleSuccessorCount(CRole* role); CRoleSuccessorIterator getRoleIterator(); CSuccessorRoleHash* getSuccessorRoleHash(bool create = true); CSuccessorRoleIterator getSuccessorRoleIterator(cint64 indiID); CSuccessorRoleIterator getSuccessorRoleIterator(CIndividualProcessNode* indiNode); bool hasSuccessorIndividualNode(cint64 indiID); bool hasSuccessorIndividualNode(CIndividualProcessNode* indiNode); bool hasDisjointRoleConnections(); CIndividualProcessNode* setDisjointRoleConnections(bool disjointRoleConnections); CDisjointSuccessorRoleHash* getDisjointSuccessorRoleHash(bool create = true); CDisjointSuccessorRoleIterator getDisjointSuccessorRoleIterator(cint64 succIndiId); CDisjointSuccessorRoleIterator getDisjointSuccessorRoleIterator(CIndividualProcessNode* indiNode); bool hasNegationDisjointToIndividual(CRole* role, cint64 destinationIndiID); bool hasNegationDisjointToIndividual(CRole* role, CIndividualProcessNode* desIndi); CIndividualProcessNode* installDisjointLink(CNegationDisjointEdge* link); CIndividualProcessNode* removeDisjointLinks(cint64 succIndiID); bool hasRoleSuccessorToIndividual(CRole* role, cint64 destinationIndiID, bool locateable); bool hasRoleSuccessorToIndividual(CRole* role, CIndividualProcessNode* desIndi, bool locateable); CIndividualLinkEdge* getRoleSuccessorToIndividualLink(CRole* role, cint64 destinationIndiID, bool locateable); CIndividualLinkEdge* getRoleSuccessorToIndividualLink(CRole* role, CIndividualProcessNode* desIndi, bool locateable); CSuccessorIterator getSuccessorIterator(); CConnectionSuccessorSet* getConnectionSuccessorSet(bool create = true); CConnectionSuccessorSetIterator getConnectionSuccessorIterator(); CReapplyQueue* getRoleReapplyQueue(CRole* role, bool create = true); CReapplyQueueIterator getRoleReapplyIterator(CRole* role, bool clearDynamicReapllyQueue = true); CCondensedReapplyQueue* getConceptReapplyQueue(CConcept* concept, bool conceptNegation, bool create = true); CCondensedReapplyQueueIterator getConceptReapplyIterator(CConcept* concept, bool conceptNegation, bool clearDynamicReapllyQueue = true); CDistinctHash* getDistinctHash(bool create = true); CIndividualLinkEdge* getLastAddedRoleLink(); CIndividualProcessNode* installIndividualLink(CIndividualLinkEdge* link, CReapplyQueueIterator* reapplyQueueIt = nullptr); CIndividualProcessNode* removeIndividualLink(CIndividualLinkEdge* link); CIndividualProcessNode* removeIndividualConnection(CIndividualProcessNode* indi); CIndividualLinkEdge* getAncestorLink(); CIndividualProcessNode* setAncestorLink(CIndividualLinkEdge* link); bool isIndividualAncestor(CIndividualProcessNode* individual); bool hasIndividualAncestor(); CIndividualProcessNode* addBlockedIndividualsLinker(CXLinker* linker); CXLinker* getBlockedIndividualsLinker(); CIndividualProcessNode* setBlockedIndividualsLinker(CXLinker* linker = nullptr); CIndividualProcessNode* clearBlockedIndividualsLinker(); bool hasBlockedIndividualsLinker(); CIndividualNodeModelData* getIndividualModelData(); CIndividualProcessNode* setIndividualModelData(CIndividualNodeModelData* individualModel); CIndividualNodeBlockData* getIndividualBlockData(bool localBlockData = false); CIndividualProcessNode* setIndividualBlockData(CIndividualNodeBlockData* individualBlock); CIndividualNodeSaturationBlockingData* getIndividualSaturationBlockingData(bool localBlockData = false); CIndividualProcessNode* setIndividualSaturationBlockingData(CIndividualNodeSaturationBlockingData* individualBlock); CIndividualNodeUnsatisfiableCacheRetrievalData* getIndividualUnsatisfiableCacheRetrievalData(bool localUnsatCacheRetData = false); CIndividualProcessNode* setIndividualUnsatisfiableCacheRetrievalData(CIndividualNodeUnsatisfiableCacheRetrievalData* individualUnsatCacheRetData); CIndividualNodeSatisfiableCacheRetrievalData* getIndividualSatisfiableCacheRetrievalData(bool localCacheData = false); CIndividualProcessNode* setIndividualSatisfiableCacheRetrievalData(CIndividualNodeSatisfiableCacheRetrievalData* satCacheRetrievalData); CIndividualNodeBackendCacheSynchronisationData* getIndividualBackendCacheSynchronisationData(bool localCacheData = false); CIndividualProcessNode* setIndividualBackendCacheSynchronisationData(CIndividualNodeBackendCacheSynchronisationData* backendSyncData); CIndividualNodeSatisfiableCacheStoringData* getIndividualSatisfiableCacheStoringData(bool localCacheData = false); CIndividualProcessNode* setIndividualSatisfiableCacheStoringData(CIndividualNodeSatisfiableCacheStoringData* satCacheStoringData); CIndividualNodeAnalizedConceptExpansionData* getAnalizedConceptExpansionData(bool createOrLocalize = true); CBlockingFollowSet* getBlockingFollowSet(bool createOrLocalize = true); bool hasBlockingFollower(); CSignatureBlockingIndividualNodeConceptExpansionData* getSignatureBlockingIndividualNodeConceptExpansionData(bool localBlockingData); CIndividualProcessNode* setSignatureBlockingIndividualNodeConceptExpansionData(CSignatureBlockingIndividualNodeConceptExpansionData* individualBlockingData); CReusingIndividualNodeConceptExpansionData* getReusingIndividualNodeConceptExpansionData(bool localBlockingData); CIndividualProcessNode* setReusingIndividualNodeConceptExpansionData(CReusingIndividualNodeConceptExpansionData* individualBlockingData); cint64 getIndividualAncestorDepth(); CIndividualProcessNode* setIndividualAncestorDepth(cint64 depth); cint64 getIndividualNominalLevel(); CIndividualProcessNode* setIndividualNominalLevel(cint64 level); cint64 getIndividualNominalLevelOrAncestorDepth(); cint64 getMergedIntoIndividualNodeID(); bool hasMergedIntoIndividualNodeID(); CIndividualProcessNode* setMergedIntoIndividualNodeID(cint64 indiNodeID); bool isBlockableIndividual(); bool isNominalIndividual(); CIndividual* getNominalIndividual(); CIndividualProcessNode* setNominalIndividual(CIndividual* indi); enum CIndividualType { BLOCKABLEINDIVIDUALTYPE, NOMINALINDIVIDUALTYPE }; CIndividualType getIndividualType(); CIndividualProcessNode* setIndividualType(CIndividualType indiType); cint64 getIndividualID(); CIndividualProcessNode* setIndividualID(cint64 indiID); bool hasInitializingConcepts(); CIndividualProcessNode* clearProcessInitializingConcepts(); CXSortedNegLinker* getInitializingConceptLinker(); CXSortedNegLinker* getProcessInitializingConceptLinker(); CIndividualProcessNode* setInitializingConceptLinker(CXSortedNegLinker* initializingConceptLinkerIt); CIndividualProcessNode* addInitializingConceptLinker(CXSortedNegLinker* initializingConceptLinkerIt); bool hasAssertionConcepts(); CIndividualProcessNode* clearAssertionConcepts(); CConceptAssertionLinker* getAssertionConceptLinker(); CIndividualProcessNode* setAssertionConceptLinker(CConceptAssertionLinker* assertionConceptLinkerIt); bool hasAssertionRoles(); CIndividualProcessNode* clearAssertionRoles(); CRoleAssertionLinker* getAssertionRoleLinker(); CIndividualProcessNode* setAssertionRoleLinker(CRoleAssertionLinker* assertionRoleLinkerIt); cint64 getRoleAssertionCreationID(); CIndividualProcessNode* setRoleAssertionCreationID(cint64 creationID); bool hasReverseAssertionRoles(); CIndividualProcessNode* clearReverseAssertionRoles(); CReverseRoleAssertionLinker* getReverseAssertionRoleLinker(); CIndividualProcessNode* setReverseAssertionRoleLinker(CReverseRoleAssertionLinker* reverseAssertionRoleLinkerIt); bool hasAdditionalRoleAssertionsLinker(); CIndividualProcessNode* clearAdditionalRoleAssertionsLinker(); CAdditionalProcessRoleAssertionsLinker* getAdditionalRoleAssertionsLinker(); CIndividualProcessNode* setAdditionalRoleAssertionsLinker(CAdditionalProcessRoleAssertionsLinker* reverseRoleAssertionsLinker); CIndividualProcessNode* addAdditionalRoleAssertionsLinker(CAdditionalProcessRoleAssertionsLinker* reverseRoleAssertionsLinker); bool hasRoleAssertionsInitialized(); CIndividualProcessNode* setRoleAssertionsInitialized(bool initialized); bool hasReverseRoleAssertionsInitialized(); CIndividualProcessNode* setReverseRoleAssertionsInitialized(bool initialized); CIndividualProcessNode* getProcessingBlockTestIndividual(); CIndividualProcessNode* clearProcessingBlockTestIndividual(); CIndividualProcessNode* setProcessingBlockTestIndividual(CIndividualProcessNode* ancestorBlockTestIndi); CIndividualProcessNode* addProcessingBlockedIndividualsLinker(CXLinker* linker); CXLinker* getProcessingBlockedIndividualsLinker(); CIndividualProcessNode* setIndirectBlockedIndividualsLinker(CXLinker* linker = nullptr); CIndividualProcessNode* clearSatisfiableCachedAbsorbedDisjunctionsLinker(); CReapplyConceptDescriptor* getSatisfiableCachedAbsorbedDisjunctionsLinker(); CIndividualProcessNode* addSatisfiableCachedAbsorbedDisjunctionsLinker(CReapplyConceptDescriptor* disjunctionReapplyConDes); CIndividualProcessNode* clearSatisfiableCachedAbsorbedGeneratingLinker(); CReapplyConceptDescriptor* getSatisfiableCachedAbsorbedGeneratingLinker(); CIndividualProcessNode* addSatisfiableCachedAbsorbedGeneratingLinker(CReapplyConceptDescriptor* successorGeneratingReapplyConDes); cint64 getProcessingRestrictionFlags(); bool addProcessingRestrictionFlags(cint64 flags); bool clearProcessingRestrictionFlags(cint64 flags); bool hasProcessingRestrictionFlags(cint64 testFlags); bool hasPartialProcessingRestrictionFlags(cint64 testFlags); CConceptDescriptor* getIndividualInitializationConcept(); CIndividualProcessNode* setIndividualInitializationConcept(CConceptDescriptor* initConDes); cint64 getLastConceptCountCachedBlockingCandidate(); CIndividualProcessNode* setLastConceptCountCachedBlockingCandidate(cint64 conCount); cint64 getLastConceptCountSearchBlockingCandidate(); CIndividualProcessNode* setLastConceptCountSearchBlockingCandidate(cint64 conCount); cint64 getBlockingCachingSavedCandidateCount(); CIndividualProcessNode* setBlockingCachingSavedCandidateCount(cint64 conCount); CIndividualProcessNode* incBlockingCachingSavedCandidateCount(cint64 incCount = 1); bool isInvalidSignatureBlocking(); CIndividualProcessNode* setInvalidSignatureBlocking(bool invalid); cint64 getLastSearchBlockerCandidateCount(); CIndividualProcessNode* setLastSearchBlockerCandidateCount(cint64 canCount); cint64 getLastSearchBlockerCandidateSignature(); CIndividualProcessNode* setLastSearchBlockerCandidateSignature(cint64 signature); CIndividualProcessNode* addSuccessorIndividualNodeBackwardDependencyLinker(CXLinker* linker); CXLinker* getSuccessorIndividualNodeBackwardDependencyLinker(); CIndividualProcessNode* setSuccessorIndividualNodeBackwardDependencyLinker(CXLinker* linker = nullptr); CIndividualProcessNode* clearSuccessorIndividualNodeBackwardDependencyLinker(); bool hasSuccessorIndividualNodeBackwardDependencyLinker(); bool hasBackwardDependencyToAncestorIndividualNode(); CIndividualProcessNode* setBackwardDependencyToAncestorIndividualNode(bool backwardDependency); bool hasBlockingRetestProcessingRestrictionFlags(); bool clearBlockingRetestProcessingRestrictionFlags(); bool hasBlockedProcessingRestrictionFlags(); bool hasDirectBlockedProcessingRestrictionFlags(); bool hasProcessingBlockedProcessingRestrictionFlags(); bool hasPurgedBlockedProcessingRestrictionFlags(); bool hasIndirectBlockedProcessingRestrictionFlags(); bool clearBlockedProcessingRestrictionFlags(); CRoleBackwardPropagationHash* getRoleBackwardPropagationHash(bool create = true); CIndividualProcessNodeLinker* getIndividualProcessNodeLinker(); CIndividualProcessNode* setIndividualProcessNodeLinker(CIndividualProcessNodeLinker* processNodeLinker); CConceptProcessLinker* getConceptProcessLinker(); CConceptProcessLinker* takeConceptProcessLinker(); CIndividualProcessNode* setConceptProcessLinker(CConceptProcessLinker* conProcessLinker); CIndividualProcessNode* addConceptProcessLinker(CConceptProcessLinker* conProcessLinker); CIndividualProcessNode* clearConceptProcessLinker(); bool getRequiredBackwardPropagation(); CIndividualProcessNode* setRequiredBackwardPropagation(bool requiredBackProp); bool hasSubstituteIndividualNode(); CIndividualProcessNode* getSubstituteIndividualNode(); CIndividualProcessNode* setSubstituteIndividualNode(CIndividualProcessNode* indiNode); bool isProcessingQueued(); bool isExtendedQueueProcessing(); bool isImmediatelyProcessingQueued(); bool isDeterministicExpandingProcessingQueued(); bool isRegularDepthProcessingQueued(); bool isBlockedReactivationProcessingQueued(); bool isBackendSynchronRetestProcessingQueued(); bool isIncrementalCompatibilityCheckingQueued(); bool isIncrementalExpansionQueued(); CIndividualProcessNode* setProcessingQueued(bool processingQueued); CIndividualProcessNode* setExtendedQueueProcessing(bool extendedQueueProcessing); CIndividualProcessNode* setImmediatelyProcessingQueued(bool immProQue); CIndividualProcessNode* setDeterministicExpandingProcessingQueued(bool detExpPro); CIndividualProcessNode* setRegularDepthProcessingQueued(bool depthPro); CIndividualProcessNode* setBlockedReactivationProcessingQueued(bool backendSyncRetest); CIndividualProcessNode* setBackendSynchronRetestProcessingQueued(bool backendSyncRetest); CIndividualProcessNode* setIncrementalCompatibilityCheckingQueued(bool incCompChecking); CIndividualProcessNode* setIncrementalExpansionQueued(bool incExpQueued); CIndividualProcessNode* clearProcessingQueued(); bool isDelayedNominalProcessingQueued(); bool hasNominalProcessingDelayingChecked(); CIndividualProcessNode* setDelayedNominalProcessingQueued(bool delayedProcessingQueued); CIndividualProcessNode* setNominalProcessingDelayingChecked(bool nominalProcessingDelayingChecked); CIndividualProcessNode* setAssertionInitialisationSignatureValue(cint64 sigValue); cint64 getAssertionInitialisationSignatureValue(); CIndividualProcessNode* setLastProcessingPriority(const CIndividualProcessNodePriority& priority); CIndividualProcessNodePriority getLastProcessingPriority(); CIndividualProcessNode* resetLastProcessingPriority(); bool isCachingLossNodeReactivationInstalled(); CIndividualProcessNode* setCachingLossNodeReactivationInstalled(bool reactivationInstalled); CNominalCachingLossReactivationData* getNominalCachingLossReactivationData(bool create = true); CSuccessorConnectedNominalSet* getSuccessorNominalConnectionSet(bool create = true); bool hasSuccessorConnectionToNominal(cint64 nominalID); bool addSuccessorConnectionToNominal(cint64 nominalID); CDatatypesValueSpaceData* getDatatypesValueSpaceData(bool create = true); CIndividualNodeIncrementalExpansionData* getIncrementalExpansionData(bool create = true); CIndividualProcessNode* setIncrementalExpansionID(cint64 incExpID); cint64 getIncrementalExpansionID(); CConceptPropagationBindingSetHash* getConceptPropagationBindingSetHash(bool create = true); CConceptVariableBindingPathSetHash* getConceptVariableBindingPathSetHash(bool create = true); CConceptRepresentativePropagationSetHash* getConceptRepresentativePropagationSetHash(bool create = true); CIndividualMergingHash* getIndividualMergingHash(bool create = true); CDependencyTrackPoint* getMergedDependencyTrackPoint(); CIndividualProcessNode* setMergedDependencyTrackPoint(CDependencyTrackPoint* depTrackPoint); CIndividualProcessNode* getLastMergedIntoIndividualNode(); CIndividualProcessNode* setLastMergedIntoIndividualNode(CIndividualProcessNode* indiNode); CIndividualProcessNode* setBlockerIndividualNode(CIndividualProcessNode* indiNode); CIndividualProcessNode* getBlockerIndividualNode(); CIndividualProcessNode* setFollowingIndividualNode(CIndividualProcessNode* indiNode); CIndividualProcessNode* getFollowingIndividualNode(); const static cint64 PRFDIRECTBLOCKED = Q_UINT64_C(0x1); const static cint64 PRFPROCESSINGBLOCKED = Q_UINT64_C(0x2); const static cint64 PRFINDIRECTBLOCKED = Q_UINT64_C(0x4); const static cint64 PRFPURGEDBLOCKED = Q_UINT64_C(0x8); const static cint64 PRFBLOCKINGRETESTDUEPROCESSINGCOMPLETED = Q_UINT64_C(0x10); const static cint64 PRFINVALIDBLOCKINGORCACHING = Q_UINT64_C(0x20); const static cint64 PRFBLOCKINGRETESTDUEANCESTORMODIFIED = Q_UINT64_C(0x100); const static cint64 PRFBLOCKINGRETESTDUEDIRECTMODIFIED = Q_UINT64_C(0x200); const static cint64 PRFBLOCKINGRETESTDUEBLOCKERMODIFIED = Q_UINT64_C(0x400); const static cint64 PRFBLOCKINGRETESTDUEINDIRECTBLOCKERLOSS = Q_UINT64_C(0x800); const static cint64 PRFPROCESSINGCOMPLETED = Q_UINT64_C(0x1000); const static cint64 PRFANCESTORALLPROCESSED = Q_UINT64_C(0x2000); const static cint64 PRFCONSNODEPREPARATIONINDINODE = Q_UINT64_C(0x10000); const static cint64 PRFCONCRETEDATAINDINODE = Q_UINT64_C(0x20000); const static cint64 PRFSATISFIABLECACHED = Q_UINT64_C(0x100000); const static cint64 PRFANCESTORSATISFIABLECACHED = Q_UINT64_C(0x200000); const static cint64 PRFRETESTSATISFIABLECACHEDDUEDIRECTMODIFIED = Q_UINT64_C(0x400000); const static cint64 PRFANCESTORSATISFIABLECACHEDABOLISHED = Q_UINT64_C(0x800000); const static cint64 PRFSIGNATUREBLOCKINGCACHED = Q_UINT64_C(0x1000000); const static cint64 PRFANCESTORSIGNATUREBLOCKINGCACHED = Q_UINT64_C(0x2000000); const static cint64 PRFRETESTSIGNATUREBLOCKINGCACHEDDUEDIRECTMODIFIED = Q_UINT64_C(0x4000000); const static cint64 PRFANCESTORSIGNATUREBLOCKINGCACHEDABOLISHED = Q_UINT64_C(0x8000000); const static cint64 PRFSATURATIONBLOCKINGCACHED = Q_UINT64_C(0x10000000); const static cint64 PRFANCESTORSATURATIONBLOCKINGCACHED = Q_UINT64_C(0x20000000); const static cint64 PRFRETESTSATURATIONBLOCKINGCACHEDDUEDIRECTMODIFIED = Q_UINT64_C(0x40000000); const static cint64 PRFANCESTORSATURATIONBLOCKINGCACHEDABOLISHED = Q_UINT64_C(0x80000000); const static cint64 PRFSATURATIONSUCCESSORCREATIONBLOCKINGCACHED = Q_UINT64_C(0x100000000); const static cint64 PRFSATURATIONBLOCKINGCACHEDINVALIDATED = Q_UINT64_C(0x200000000); const static cint64 PRFSATURATIONBLOCKINGCACHEDRETESTDUETOMODIFICATION = Q_UINT64_C(0x400000000); const static cint64 PRFCOMPLETIONGRAPHCACHED = Q_UINT64_C(0x1000000000); const static cint64 PRFCOMPLETIONGRAPHCACHINGINVALID = Q_UINT64_C(0x2000000000); const static cint64 PRFCOMPLETIONGRAPHCACHINGINVALIDATED = Q_UINT64_C(0x4000000000); const static cint64 PRFRETESTCOMPLETIONGRAPHCACHEDDUEDIRECTMODIFIED = Q_UINT64_C(0x8000000000); const static cint64 PRFCOMPLETIONGRAPHCACHEDNODELOCATED = Q_UINT64_C(0x10000000000); const static cint64 PRFCOMPLETIONGRAPHCACHEDNODEEXTENDED = Q_UINT64_C(0x20000000000); const static cint64 PRFSUCCESSORNOMINALCONNECTION = Q_UINT64_C(0x40000000000); const static cint64 PRFSUCCESSORNEWNOMINALCONNECTION = Q_UINT64_C(0x80000000000); const static cint64 PRFREUSINGINDIVIDUAL = Q_UINT64_C(0x100000000000); const static cint64 PRFANCESTORREUSINGINDIVIDUALBLOCKED = Q_UINT64_C(0x200000000000); const static cint64 PRFANCESTORREUSINGINDIVIDUALBLOCKEDABOLISHED = Q_UINT64_C(0x400000000000); const static cint64 PRFCACHEDCOMPUTEDTYPESADDED = Q_UINT64_C(0x1000000000000); const static cint64 PRFSYNCHRONIZEDBACKEND = Q_UINT64_C(0x10000000000000); const static cint64 PRFSYNCHRONIZEDBACKENDNEIGHBOUREXPANSIONBLOCKED = Q_UINT64_C(0x20000000000000); const static cint64 PRFSYNCHRONIZEDBACKENDSUCCESSOREXPANSIONBLOCKED = Q_UINT64_C(0x40000000000000); const static cint64 PRFRETESTBACKENDSYNCHRONIZATIONDUEDIRECTMODIFIED = Q_UINT64_C(0x80000000000000); const static cint64 PRFINCREMENTALEXPANDING = Q_UINT64_C(0x100000000000000); const static cint64 PRFINCREMENTALEXPANSIONRETESTDUEDIRECTMODIFIED = Q_UINT64_C(0x200000000000000); const static cint64 PRFBLOCKINGRELATEDFLAGCOMPINATION = PRFDIRECTBLOCKED | PRFINDIRECTBLOCKED | PRFPROCESSINGBLOCKED | PRFBLOCKINGRETESTDUEANCESTORMODIFIED | PRFBLOCKINGRETESTDUEDIRECTMODIFIED | PRFBLOCKINGRETESTDUEPROCESSINGCOMPLETED | PRFBLOCKINGRETESTDUEBLOCKERMODIFIED | PRFBLOCKINGRETESTDUEINDIRECTBLOCKERLOSS; const static cint64 PRFINVALIDATEBLOCKERFLAGSCOMPINATION = PRFDIRECTBLOCKED | PRFINDIRECTBLOCKED | PRFPROCESSINGBLOCKED | PRFPURGEDBLOCKED | PRFSATISFIABLECACHED | PRFANCESTORSATISFIABLECACHED | PRFSIGNATUREBLOCKINGCACHED | PRFANCESTORSIGNATUREBLOCKINGCACHED | PRFREUSINGINDIVIDUAL | PRFANCESTORREUSINGINDIVIDUALBLOCKED | PRFANCESTORSATURATIONBLOCKINGCACHED | PRFCONCRETEDATAINDINODE; CConceptDescriptor* mDebugBlockerLastConceptDes; // protected methods protected: // protected variables protected: cint64 mIndiID; CIndividualType mIndiType; CIndividual* mNomIndi; cint64 mProcessingRestrictionFlags; cint64 indiAncDepth; cint64 mNominalLevel; CIndividualLinkEdge* mAncestorLink; cint64 mMergeIntoID; CProcessContext* mProcessContext; CMemoryAllocationManager* mMemAllocMan; CIndividualProcessNode* mPrevIndividual; CConceptProcessingQueue* mConceptProcessingQueue; CConceptProcessingQueue* mUseConceptProcessingQueue; CConceptProcessingQueue* mPrevConceptProcessingQueue; CReapplyConceptLabelSet* mReapplyConLabelSet; CReapplyConceptLabelSet* mUseReapplyConLabelSet; CReapplyConceptLabelSet* mPrevReapplyConLabelSet; CReapplyRoleSuccessorHash* mReapplyRoleSuccHash; CReapplyRoleSuccessorHash* mUseReapplyRoleSuccHash; CReapplyRoleSuccessorHash* mPrevReapplyRoleSuccHash; CSuccessorRoleHash* mSuccRoleHash; CSuccessorRoleHash* mUseSuccRoleHash; CSuccessorRoleHash* mPrevSuccRoleHash; CIndividualLinkEdge* mLastAddedLink; CIndividualProcessNode* mBlockerIndiNode; CIndividualProcessNode* mFollowingIndiNode; CConnectionSuccessorSet* mConnSuccSet; CConnectionSuccessorSet* mUseConnSuccSet; CConnectionSuccessorSet* mPrevConnSuccSet; CDistinctHash* mDistinctHash; CDistinctHash* mUseDistinctHash; CDistinctHash* mPrevDistinctHash; bool mDisjointRoleConnections; CDisjointSuccessorRoleHash* mDisjointSuccRoleHash; CDisjointSuccessorRoleHash* mUseDisjointSuccRoleHash; CDisjointSuccessorRoleHash* mPrevDisjointSuccRoleHash; CIndividualNodeSaturationBlockingData* mIndiSatBlockData; CIndividualNodeSaturationBlockingData* mPrevIndiSatBlockData; CIndividualNodeBlockData* mIndiBlock; CIndividualNodeBlockData* mPrevIndiBlock; CIndividualNodeUnsatisfiableCacheRetrievalData* mIndiUnsatCacheRet; CIndividualNodeUnsatisfiableCacheRetrievalData* mPrevIndiUnsatCacheRet; CIndividualNodeAnalizedConceptExpansionData* mSigBlockIndExplData; CIndividualNodeAnalizedConceptExpansionData* mUseSigBlockIndExplData; CIndividualNodeAnalizedConceptExpansionData* mPrevSigBlockIndExplData; CSignatureBlockingIndividualNodeConceptExpansionData* mSigBlockConExpData; CSignatureBlockingIndividualNodeConceptExpansionData* mPrevSigBlockConExpData; CReusingIndividualNodeConceptExpansionData* mReusingConExpData; CReusingIndividualNodeConceptExpansionData* mPrevReusingConExpData; CBlockingFollowSet* mSigBlockFollowSet; CBlockingFollowSet* mUseSigBlockFollowSet; CBlockingFollowSet* mPrevSigBlockFollowSet; CConceptPropagationBindingSetHash* mConceptPropBindingSetHash; CConceptPropagationBindingSetHash* mUseConceptPropBindingSetHash; CConceptPropagationBindingSetHash* mPrevConceptPropBindingSetHash; CConceptVariableBindingPathSetHash* mConceptVarBindPathSetHash; CConceptVariableBindingPathSetHash* mUseConceptVarBindPathSetHash; CConceptVariableBindingPathSetHash* mPrevConceptVarBindPathSetHash; CConceptRepresentativePropagationSetHash* mConceptRepPropSetHash; CConceptRepresentativePropagationSetHash* mUseConceptRepPropSetHash; CConceptRepresentativePropagationSetHash* mPrevConceptRepPropSetHash; bool mInvalidSignatureBlocking; CConceptDescriptor* mInitConceptDescriptor; CXSortedNegLinker* mInitializingConceptLinkerIt; CXSortedNegLinker* mProcessInitializingConceptLinkerIt; CConceptAssertionLinker* mAssertionConceptLinkerIt; CRoleAssertionLinker* mAssertionRoleLinkerIt; CReverseRoleAssertionLinker* mReverseAssertionRoleLinkerIt; CAdditionalProcessRoleAssertionsLinker* mAdditionalRoleAssertionsLinker; bool mRoleAssertionsInitialized; bool mReverseRoleAssertionsInitialized; cint64 mRoleAssertionCreationID; cint64 mLastConceptCountCachedBlockerCandidate; cint64 mLastConceptCountSearchBlockerCandidate; cint64 mLastSearchBlockerCandidateCount; cint64 mLastSearchBlockerCandidateSignature; cint64 mBlockingCachingSavedCandidateCount; CXLinker* mBlockedIndividualsLinker; CXLinker* mSuccessorIndiNodeBackwardDependencyLinker; bool mBackwardDependencyToAncestorIndividualNode; CIndividualNodeModelData* indiModel; CIndividualNodeSatisfiableCacheRetrievalData* mSatCacheRetData; CIndividualNodeSatisfiableCacheRetrievalData* mPrevSatCacheRetData; CIndividualNodeSatisfiableCacheStoringData* mSatCacheStoringData; CIndividualNodeSatisfiableCacheStoringData* mPrevSatCacheStoringData; CIndividualNodeBackendCacheSynchronisationData* mBackendSyncData; CIndividualNodeBackendCacheSynchronisationData* mPrevBackendSyncData; CIndividualProcessNode* mProcessingBlockedIndi; CXLinker* mProcessingBlockedIndividualsLinker; CReapplyConceptDescriptor* mSatCachedAbsorbedDisjunctionsReapplyConDes; CReapplyConceptDescriptor* mSatCachedAbsorbedSuccessorReapplyConDes; CRoleBackwardPropagationHash* mRoleBackPropHash; CIndividualProcessNodeLinker* mIndiProcessLinker; CConceptProcessLinker* mConceptProcessLinker; bool mRequiredBackProp; CIndividualProcessNode* mSubstituteIndiNode; bool mExtendedQueueProcessing; bool mImmediatelyProcessingQueued; bool mDetExpProcessingQueued; bool mDepthProcessingQueued; bool mBlockedReactProcessingQueued; bool mBackendSynchronRetestProcessingQueued; bool mIncrementalCompatibilityCheckingQueued; bool mIncrementalExpansionQueued; bool mProcessingQueued; CIndividualProcessNodePriority mLastProcessingPriority; bool mDelayedNominalProcessingQueued; bool mNominalProcessingDelayingChecked; cint64 mAssertionInitialisationSignatureValue; bool mCachingLossNodeReactivationInstalled; CNominalCachingLossReactivationData* mUseReactivationData; CNominalCachingLossReactivationData* mLocReactivationData; CSuccessorConnectedNominalSet* mUseNominalConnectionSet; CSuccessorConnectedNominalSet* mLocNominalConnectionSet; CDatatypesValueSpaceData* mUseDatatypesValueSpaceData; CDatatypesValueSpaceData* mLocDatatypesValueSpaceData; CIndividualNodeIncrementalExpansionData* mUseIncExpData; CIndividualNodeIncrementalExpansionData* mLocIncExpData; cint64 mIncExpID; CIndividualMergingHash* mUseIndividualMergingHash; CIndividualMergingHash* mLocIndividualMergingHash; CDependencyTrackPoint* mMergedDepTrackPoint; CIndividualProcessNode* mLastMergedIntoIndividualNode; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyConceptLabelSet.cpp0000644000175000017500000004265712520551140030062 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReapplyConceptLabelSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CReapplyConceptLabelSet::CReapplyConceptLabelSet(CProcessContext* processContext) : mProcessContext(processContext),mConceptDesDepMap(processContext) { mConceptDesLinker = nullptr; mPrevConceptDesLinker = nullptr; mCoreConDesLinker = nullptr; mConceptCount = 0; } CReapplyConceptLabelSet::~CReapplyConceptLabelSet() { } CConceptSetSignature* CReapplyConceptLabelSet::getConceptSignature() { return &mConceptSignature; } CConceptSetStructure* CReapplyConceptLabelSet::getConceptStructure() { return &mConceptStructure; } cint64 CReapplyConceptLabelSet::getConceptSignatureValue() { return mConceptSignature.getSignatureValue(); } CReapplyConceptLabelSet* CReapplyConceptLabelSet::initConceptLabelSet(CReapplyConceptLabelSet* prevConceptLabelSet) { if (prevConceptLabelSet) { mConceptDesLinker = prevConceptLabelSet->mConceptDesLinker; mPrevConceptDesLinker = mConceptDesLinker; mConceptCount = prevConceptLabelSet->mConceptCount; mConceptDesDepMap = prevConceptLabelSet->mConceptDesDepMap; mConceptSignature = prevConceptLabelSet->mConceptSignature; mCoreConDesLinker = prevConceptLabelSet->mCoreConDesLinker; mConceptStructure = prevConceptLabelSet->mConceptStructure; } else { mConceptDesDepMap.clear(); mConceptDesLinker = nullptr; mPrevConceptDesLinker = nullptr; mCoreConDesLinker = nullptr; mConceptCount = 0; mConceptSignature.reset(); mConceptStructure.reset(); } return this; } CCoreConceptDescriptor* CReapplyConceptLabelSet::getCoreConceptDescriptorLinker() { return mCoreConDesLinker; } CReapplyConceptLabelSet* CReapplyConceptLabelSet::addCoreConceptDescriptor(CCoreConceptDescriptor* coreConDes) { mCoreConDesLinker = coreConDes->append(mCoreConDesLinker); return this; } bool CReapplyConceptLabelSet::hasConceptDescriptor(CConceptDescriptor* conceptDescriptor) { return hasConcept(conceptDescriptor->getConcept(),conceptDescriptor->getNegation()); } bool CReapplyConceptLabelSet::containsConceptDescriptor(CConceptDescriptor* conceptDescriptor) { return hasConceptDescriptor(conceptDescriptor); } bool CReapplyConceptLabelSet::hasConcept(CConcept* concept, bool negated) { cint64 conTag = concept->getConceptTag(); CConceptDescriptorDependencyReapplyData* conDesDepData = nullptr; bool isContained = mConceptDesDepMap.tryGetValuePointer(conTag,conDesDepData); return isContained && conDesDepData->mConceptDescriptor && conDesDepData->mConceptDescriptor->isNegated() == negated; } bool CReapplyConceptLabelSet::hasConcept(CConcept* concept, bool* containsNegated) { cint64 conTag = concept->getConceptTag(); CConceptDescriptorDependencyReapplyData* conDesDepData = nullptr; bool isContained = mConceptDesDepMap.tryGetValuePointer(conTag,conDesDepData); if (isContained && containsNegated) { *containsNegated = conDesDepData->mConceptDescriptor && conDesDepData->mConceptDescriptor->isNegated(); } return isContained && conDesDepData->mConceptDescriptor; } bool CReapplyConceptLabelSet::containsConcept(CConcept* concept, bool* containsNegated) { return hasConcept(concept,containsNegated); } bool CReapplyConceptLabelSet::containsConcept(CConcept* concept, bool negated) { return hasConcept(concept,negated); } bool CReapplyConceptLabelSet::getConceptDescriptor(CConcept* concept, CConceptDescriptor*& conDes, CDependencyTrackPoint*& depTrackPoint) { return getConceptDescriptor(concept->getConceptTag(),conDes,depTrackPoint); } bool CReapplyConceptLabelSet::getConceptDescriptor(cint64 conTag, CConceptDescriptor*& conDes, CDependencyTrackPoint*& depTrackPoint) { CConceptDescriptorDependencyReapplyData* conDesDepData = nullptr; bool contained = mConceptDesDepMap.tryGetValuePointer(conTag,conDesDepData); if (contained) { conDes = conDesDepData->mConceptDescriptor; if (conDes) { depTrackPoint = conDes->getDependencyTrackPoint(); } else { depTrackPoint = nullptr; } contained &= conDes != nullptr; } return contained; } bool CReapplyConceptLabelSet::insertConceptIgnoreClash(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CCondensedReapplyQueueIterator* reapplyQueueIt) { cint64 conTag = conceptDescriptor->getConceptTag(); CConceptDescriptorDependencyReapplyData& conDesDepData = mConceptDesDepMap[conTag]; conDesDepData.mConceptDescriptor = conceptDescriptor; ++mConceptCount; mConceptSignature.addConceptSignature(conceptDescriptor); mConceptStructure.addedConcept(conceptDescriptor); mConceptDesLinker = conceptDescriptor->append(mConceptDesLinker); if (reapplyQueueIt) { *reapplyQueueIt = conDesDepData.mPosNegReapplyQueue.getIterator(conceptDescriptor->isNegated(),true); } return true; } bool CReapplyConceptLabelSet::insertConceptGetClash(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CCondensedReapplyQueueIterator* reapplyQueueIt, CConceptDescriptor** clashedConDes, CDependencyTrackPoint** clashedDepTrackPoint) { cint64 conTag = conceptDescriptor->getConceptTag(); bool containsAlready = false; CConceptDescriptorDependencyReapplyData* containedConDesDepData = nullptr; mConceptDesDepMap.tryInsert(conTag,CConceptDescriptorDependencyReapplyData(conceptDescriptor),&containsAlready,&containedConDesDepData); if (containedConDesDepData->mConceptDescriptor == nullptr) { containedConDesDepData->mConceptDescriptor = conceptDescriptor; containsAlready = false; } if (containsAlready) { CConceptDescriptor* containsConDes = containedConDesDepData->mConceptDescriptor; if (containsConDes->isNegated() != conceptDescriptor->isNegated()) { if (clashedConDes) { *clashedConDes = containsConDes; } if (clashedDepTrackPoint) { *clashedDepTrackPoint = containsConDes->getDependencyTrackPoint(); } } return true; } else { ++mConceptCount; mConceptSignature.addConceptSignature(conceptDescriptor); mConceptStructure.addedConcept(conceptDescriptor); mConceptDesLinker = conceptDescriptor->append(mConceptDesLinker); if (reapplyQueueIt) { *reapplyQueueIt = containedConDesDepData->mPosNegReapplyQueue.getIterator(conceptDescriptor->isNegated(),true); //if (conceptDescriptor->isNegated()) { // *reapplyQueueIt = containedConDesDepData->mNegReapplyQueue.getIterator(true); //} else { // *reapplyQueueIt = containedConDesDepData->mPosReapplyQueue.getIterator(true); //} } return false; } } CClashedConceptDescriptor* CReapplyConceptLabelSet::insertConceptReturnClash(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint, bool* hasContained, CCondensedReapplyQueueIterator* reapplyQueueIt) { cint64 conTag = conceptDescriptor->getConceptTag(); bool containsAlready = false; CConceptDescriptorDependencyReapplyData* containedConDesDepData = nullptr; mConceptDesDepMap.tryInsert(conTag,CConceptDescriptorDependencyReapplyData(conceptDescriptor),&containsAlready,&containedConDesDepData); if (containedConDesDepData->mConceptDescriptor == nullptr) { containedConDesDepData->mConceptDescriptor = conceptDescriptor; containsAlready = false; } if (containsAlready) { if (hasContained) { *hasContained = true; } CConceptDescriptor* containsConDes = containedConDesDepData->mConceptDescriptor; if (containsConDes->isNegated() != conceptDescriptor->isNegated()) { CDependencyTrackPoint* containsDepTrackPoint = containsConDes->getDependencyTrackPoint(); // create clash CClashedConceptDescriptor* clashDes1 = CObjectAllocator::allocateAndConstruct(CContext::getMemoryAllocationManager(mProcessContext)); clashDes1->initClashedConceptDescriptor(conceptDescriptor,depTrackPoint,0); CClashedConceptDescriptor* clashDes2 = CObjectAllocator::allocateAndConstruct(CContext::getMemoryAllocationManager(mProcessContext)); clashDes2->initClashedConceptDescriptor(containsConDes,containsDepTrackPoint,0); clashDes1->append(clashDes2); return clashDes1; } } else { if (hasContained) { *hasContained = false; } ++mConceptCount; mConceptSignature.addConceptSignature(conceptDescriptor); mConceptStructure.addedConcept(conceptDescriptor); mConceptDesLinker = conceptDescriptor->append(mConceptDesLinker); if (reapplyQueueIt) { *reapplyQueueIt = containedConDesDepData->mPosNegReapplyQueue.getIterator(conceptDescriptor->isNegated(),true); //if (conceptDescriptor->isNegated()) { // *reapplyQueueIt = containedConDesDepData->mNegReapplyQueue.getIterator(true); //} else { // *reapplyQueueIt = containedConDesDepData->mPosReapplyQueue.getIterator(true); //} } } return nullptr; } bool CReapplyConceptLabelSet::insertConceptThrowClashReturnContained(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CCondensedReapplyQueueIterator* reapplyQueueIt) { bool contained = false; CClashedConceptDescriptor* clash = insertConceptReturnClash(conceptDescriptor,depTrackPoint,&contained,reapplyQueueIt); if (clash) { throw clash; } return contained; } cint64 CReapplyConceptLabelSet::getConceptCount() { return mConceptCount; } CReapplyConceptLabelSetIterator CReapplyConceptLabelSet::getConceptLabelSetIterator(bool getSorted, bool getDependencies, bool getAllStructure) { if (getSorted || getDependencies || getAllStructure) { return CReapplyConceptLabelSetIterator(mConceptCount,nullptr,mConceptDesDepMap.constBegin(),mConceptDesDepMap.constEnd(),!getAllStructure); } else { return CReapplyConceptLabelSetIterator(mConceptCount,mConceptDesLinker,CPROCESSMAP::const_iterator(),CPROCESSMAP::const_iterator()); } } bool CReapplyConceptLabelSet::getConceptDescriptorAndReapplyQueue(CConcept* concept, CConceptDescriptor*& conDes, CDependencyTrackPoint*& depTrackPoint, CCondensedReapplyQueue*& reapplyQueue) { cint64 conTag = concept->getConceptTag(); return getConceptDescriptorAndReapplyQueue(conTag,conDes,depTrackPoint,reapplyQueue); } bool CReapplyConceptLabelSet::getConceptDescriptorAndReapplyQueue(cint64 conTag, CConceptDescriptor*& conDes, CDependencyTrackPoint*& depTrackPoint, CCondensedReapplyQueue*& reapplyQueue) { CConceptDescriptorDependencyReapplyData* conDesDepData = nullptr; bool contained = mConceptDesDepMap.tryGetValuePointer(conTag,conDesDepData); if (contained) { conDes = conDesDepData->mConceptDescriptor; reapplyQueue = &conDesDepData->mPosNegReapplyQueue; if (conDes) { depTrackPoint = conDes->getDependencyTrackPoint(); } else { depTrackPoint = nullptr; } contained = conDes != nullptr; } return contained; } bool CReapplyConceptLabelSet::getConceptDescriptorOrReapplyQueue(CConcept* concept, CConceptDescriptor*& conDes, CDependencyTrackPoint*& depTrackPoint, CCondensedReapplyQueue*& reapplyQueue) { cint64 conTag = concept->getConceptTag(); return getConceptDescriptorOrReapplyQueue(conTag,conDes,depTrackPoint,reapplyQueue); } bool CReapplyConceptLabelSet::getConceptDescriptorOrReapplyQueue(cint64 conTag, CConceptDescriptor*& conDes, CDependencyTrackPoint*& depTrackPoint, CCondensedReapplyQueue*& reapplyQueue) { CConceptDescriptorDependencyReapplyData* conDesDepData = nullptr; bool contained = mConceptDesDepMap.tryGetValuePointer(conTag,conDesDepData); if (contained) { conDes = conDesDepData->mConceptDescriptor; reapplyQueue = &conDesDepData->mPosNegReapplyQueue; if (conDes) { depTrackPoint = conDes->getDependencyTrackPoint(); } else { depTrackPoint = nullptr; } contained = conDes != nullptr || reapplyQueue != nullptr; } return contained; } CCondensedReapplyQueue* CReapplyConceptLabelSet::getConceptDescriptorAndReapplyQueue(CConcept*& concept, CConceptDescriptor*& conDes, bool create) { cint64 conTag = concept->getConceptTag(); if (create) { bool containsAlready = false; CConceptDescriptorDependencyReapplyData* containedConDesDepData = nullptr; mConceptDesDepMap.tryInsert(conTag,CConceptDescriptorDependencyReapplyData(nullptr),&containsAlready,&containedConDesDepData); conDes = containedConDesDepData->mConceptDescriptor; return &containedConDesDepData->mPosNegReapplyQueue; } else { CConceptDescriptorDependencyReapplyData* containedConDesDepData = nullptr; if (mConceptDesDepMap.tryGetValuePointer(conTag,containedConDesDepData)) { conDes = containedConDesDepData->mConceptDescriptor; return &containedConDesDepData->mPosNegReapplyQueue; } } return nullptr; } CCondensedReapplyQueue* CReapplyConceptLabelSet::getConceptReapplyQueue(cint64 conTag, bool create) { if (create) { bool containsAlready = false; CConceptDescriptorDependencyReapplyData* containedConDesDepData = nullptr; mConceptDesDepMap.tryInsert(conTag,CConceptDescriptorDependencyReapplyData(nullptr),&containsAlready,&containedConDesDepData); return &containedConDesDepData->mPosNegReapplyQueue; //if (conceptNegation) { // return &containedConDesDepData->mNegReapplyQueue; //} else { // return &containedConDesDepData->mPosReapplyQueue; //} } else { CConceptDescriptorDependencyReapplyData* containedConDesDepData = nullptr; if (mConceptDesDepMap.tryGetValuePointer(conTag,containedConDesDepData)) { return &containedConDesDepData->mPosNegReapplyQueue; //if (conceptNegation) { // return &containedConDesDepData->mNegReapplyQueue; //} else { // return &containedConDesDepData->mPosReapplyQueue; //} } } return nullptr; } CCondensedReapplyQueue* CReapplyConceptLabelSet::getConceptReapplyQueue(CConcept *&concept, bool &conceptNegation, bool create) { cint64 conTag = concept->getConceptTag(); return getConceptReapplyQueue(conTag,create); } bool CReapplyConceptLabelSet::containsConceptReapplyQueue(CConcept *&concept, bool &conceptNegation) { cint64 conTag = concept->getConceptTag(); CConceptDescriptorDependencyReapplyData* containedConDesDepData = nullptr; if (mConceptDesDepMap.tryGetValuePointer(conTag,containedConDesDepData)) { return !containedConDesDepData->mPosNegReapplyQueue.isEmpty(); //if (conceptNegation) { // return !containedConDesDepData->mNegReapplyQueue.isEmpty(); //} else { // return !containedConDesDepData->mPosReapplyQueue.isEmpty(); //} } return false; } CCondensedReapplyQueueIterator CReapplyConceptLabelSet::getConceptReapplyIterator(CConcept* concept, bool conceptNegation, bool clearDynamicReapplyQueue) { cint64 conTag = concept->getConceptTag(); CConceptDescriptorDependencyReapplyData* containedConDesDepData = nullptr; if (mConceptDesDepMap.tryGetValuePointer(conTag,containedConDesDepData)) { return containedConDesDepData->mPosNegReapplyQueue.getIterator(conceptNegation,clearDynamicReapplyQueue); //if (conceptNegation) { // return containedConDesDepData->mNegReapplyQueue.getIterator(clearDynamicReapplyQueue); //} else { // return containedConDesDepData->mPosReapplyQueue.getIterator(clearDynamicReapplyQueue); //} } return CCondensedReapplyQueueIterator(nullptr,conceptNegation); } CCondensedReapplyQueueIterator CReapplyConceptLabelSet::getConceptReapplyIterator(CConceptDescriptor* conDes, bool clearDynamicReapplyQueue) { return getConceptReapplyIterator(conDes->getConcept(),conDes->isNegated(),clearDynamicReapplyQueue); } CConceptDescriptor* CReapplyConceptLabelSet::getAddingSortedConceptDescriptionLinker() { return mConceptDesLinker; } CConceptDescriptorDependencyReapplyData* CReapplyConceptLabelSet::getConceptDescriptorDependencyReapplyData(cint64 dataTag) { return &mConceptDesDepMap[dataTag]; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyConceptLabelSetIterator.h0000644000175000017500000000610512520551140031225 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTLABELSETITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTLABELSETITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptorDependencyReapplyData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CReapplyConceptLabelSetIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReapplyConceptLabelSetIterator { // public methods public: //! Constructor CReapplyConceptLabelSetIterator(cint64 conceptCount, CConceptDescriptor* conceptDesLinker, const CPROCESSMAP::const_iterator& beginIt, const CPROCESSMAP::const_iterator& endIt, bool skipEmptyConceptDescriptors = true); cint64 getRemainingConceptCount(); CConceptDescriptor* getConceptDescriptor(); cint64 getDataTag(); CDependencyTrackPoint* getDependencyTrackPoint(); const CCondensedReapplyQueue *getPosNegReapplyQueue(); CReapplyConceptLabelSetIterator& operator++(); CConceptDescriptor* operator*(); CReapplyConceptLabelSetIterator* moveNext(); bool hasValue(); bool hasNext(); CConceptDescriptor* next(bool moveToNext = true); bool operator!=(CReapplyConceptLabelSetIterator& iterator); bool operator==(CReapplyConceptLabelSetIterator& iterator); // protected methods protected: // protected variables protected: CPROCESSMAP::const_iterator mConDesDepBeginIt; CPROCESSMAP::const_iterator mConDesDepEndIt; CConceptDescriptor* mConceptDesLinkerIt; cint64 mConceptCount; bool mSkipEmptyConceptDescriptors; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTLABELSETITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeContainingMap.h0000644000175000017500000000445612520551142030630 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVECONTAININGMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVECONTAININGMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRepresentativeContainingMapData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRepresentativeContainingMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeContainingMap : public CPROCESSMAP { // public methods public: //! Constructor CRepresentativeContainingMap(CProcessContext* processContext); CRepresentativeContainingMap* initRepresentativeContainingMap(CRepresentativeContainingMap* prevMap); CRepresentativeContainingMap* insertContainedRepresentative(CRepresentativeVariableBindingPathSetData* repData, bool explicitelyContained); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVECONTAININGMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingCandidateIterator.h0000644000175000017500000000411512520551160032071 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGCANDIDATEITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGCANDIDATEITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSignatureBlockingCandidateIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureBlockingCandidateIterator { // public methods public: //! Constructor CSignatureBlockingCandidateIterator(cint64 signature, CXLinker* candidateIndiLinker); bool hasNext(); cint64 next(bool moveNext = true); // protected methods protected: // protected variables protected: cint64 mSignature; CXLinker* mCandidateIndiLinkerIt; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGCANDIDATEITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDistinctEdge.h0000644000175000017500000000374012520551120025515 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDISTINCTEDGE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDISTINCTEDGE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CNodeEdge.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CDistinctEdge * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDistinctEdge : public CNodeEdge { // public methods public: //! Constructor CDistinctEdge(CProcessContext* processContext = nullptr); CDistinctEdge* initDistinctEdge(CIndividualProcessNode* sourceIndividual, CIndividualProcessNode* destinationIndividual, CDependencyTrackPoint* depTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDISTINCTEDGE_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSaturationBlockingData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSaturationBlockingData.0000644000175000017500000000421312520551124032212 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeSaturationBlockingData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeSaturationBlockingData::CIndividualNodeSaturationBlockingData() { } CIndividualNodeSaturationBlockingData* CIndividualNodeSaturationBlockingData::initSaturationBlockingData(cint64 cachedConceptCount, CConceptDescriptor* lastConfConDes, CIndividualSaturationProcessNode* saturationNode) { mSaturationBlockedConceptCount = cachedConceptCount; mLastConfConDes = lastConfConDes; mSaturationNode = saturationNode; return this; } CIndividualNodeSaturationBlockingData* CIndividualNodeSaturationBlockingData::setSaturationBlockedConceptCount(cint64 cachedCount) { mSaturationBlockedConceptCount = cachedCount; return this; } cint64 CIndividualNodeSaturationBlockingData::getSaturationBlockedConceptCount() { return mSaturationBlockedConceptCount; } CConceptDescriptor* CIndividualNodeSaturationBlockingData::getLastConfirmedConceptDescriptior() { return mLastConfConDes; } CIndividualSaturationProcessNode* CIndividualNodeSaturationBlockingData::getSaturationIndividualNode() { return mSaturationNode; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningHashData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJ0000644000175000017500000000444112520551150032267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CRepresentativeVariableBindingPathSetJoiningData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathSetJoiningHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathSetJoiningHashData { // public methods public: //! Constructor CRepresentativeVariableBindingPathSetJoiningHashData(); CRepresentativeVariableBindingPathSetJoiningHashData(const CRepresentativeVariableBindingPathSetJoiningHashData& data); CRepresentativeVariableBindingPathSetJoiningData* mUseJoiningData; CRepresentativeVariableBindingPathSetJoiningData* mLocJoiningData; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureIterator.h0000644000175000017500000000437512520551162026635 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CSignatureBlockingCandidateData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSignatureIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureIterator { // public methods public: //! Constructor CSignatureIterator(CPROCESSHASH* sigHash); bool hasNext(); bool moveNext(); cint64 next(bool moveNext = true); cint64 getSignature(); CXLinker* getCandidateLinker(); // protected methods protected: // protected variables protected: CPROCESSHASH* mSigHash; CPROCESSHASH::const_iterator mItBegin; CPROCESSHASH::const_iterator mItEnd; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathMapData.h0000644000175000017500000000427612520551164030251 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHMAPDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHMAPDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CVariableBindingPathDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CVariableBindingPathMapData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingPathMapData { // public methods public: //! Constructor CVariableBindingPathMapData(CVariableBindingPathDescriptor* propBindDes = nullptr); CVariableBindingPathDescriptor* getVariableBindingPathDescriptor() const; bool hasVariableBindingPathDescriptor() const; CVariableBindingPathMapData* setVariableBindingPathDescriptor(CVariableBindingPathDescriptor* des); // protected methods protected: // protected variables protected: CVariableBindingPathDescriptor* mPropBindDes; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHMAPDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureIterator.cpp0000644000175000017500000000425312520551162027163 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSignatureIterator::CSignatureIterator(CPROCESSHASH* sigHash) : mSigHash(sigHash) { mItBegin = mSigHash->constBegin(); mItEnd = mSigHash->constEnd(); } bool CSignatureIterator::hasNext() { return mItBegin != mItEnd; } bool CSignatureIterator::moveNext() { if (mItBegin != mItEnd) { ++mItBegin; return true; } return false; } cint64 CSignatureIterator::next(bool moveNext) { cint64 signature = -1; if (mItBegin != mItEnd) { signature = mItBegin.key(); if (moveNext) { ++mItBegin; } } return signature; } cint64 CSignatureIterator::getSignature() { cint64 signature = -1; if (mItBegin != mItEnd) { signature = mItBegin.key(); } return signature; } CXLinker* CSignatureIterator::getCandidateLinker() { CXLinker* candidateLinker = nullptr; if (mItBegin != mItEnd) { CSignatureBlockingCandidateData data = mItBegin.value(); candidateLinker = data.getCandidateIndividualLinker(); } return candidateLinker; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationRepresentativeTransitionExtension.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationRepresentativeTransitionEx0000644000175000017500000001046512520551140032501 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPropagationRepresentativeTransitionExtension.h" #include "CIndividualProcessNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CPropagationRepresentativeTransitionExtension::CPropagationRepresentativeTransitionExtension(CProcessContext* processContext) : mLeftRepPropMap(processContext),mRightRepPropMap(processContext) { mProcessContext = processContext; } CPropagationRepresentativeTransitionExtension* CPropagationRepresentativeTransitionExtension::initPropagationRepresentativeTransitionExtension(CPropagationRepresentativeTransitionExtension* propVarBindTransExtension) { if (propVarBindTransExtension) { mLastAnalysedPropBindDes = propVarBindTransExtension->mLastAnalysedPropBindDes; mLastAnalysedPropagateAllFlag = propVarBindTransExtension->mLastAnalysedPropagateAllFlag; mLeftLastRepPropDes = propVarBindTransExtension->mLeftLastRepPropDes; mRightLastRepPropDes = propVarBindTransExtension->mRightLastRepPropDes; mLeftRepPropMap = propVarBindTransExtension->mLeftRepPropMap; mRightRepPropMap = propVarBindTransExtension->mRightRepPropMap; } else { mLastAnalysedPropBindDes = nullptr; mLastAnalysedPropagateAllFlag = false; mRightLastRepPropDes = nullptr; mLeftLastRepPropDes = nullptr; mLeftRepPropMap.clear(); mRightRepPropMap.clear(); } return this; } bool CPropagationRepresentativeTransitionExtension::getLastAnalysedPropagateAllFlag() { return mLastAnalysedPropagateAllFlag; } CPropagationRepresentativeTransitionExtension* CPropagationRepresentativeTransitionExtension::setLastAnalysedPropagateAllFlag(bool propagateAllFlag) { mLastAnalysedPropagateAllFlag = propagateAllFlag; return this; } CPropagationBindingDescriptor* CPropagationRepresentativeTransitionExtension::getLastAnalysedPropagationBindingDescriptor() { return mLastAnalysedPropBindDes; } CPropagationRepresentativeTransitionExtension* CPropagationRepresentativeTransitionExtension::setLastAnalysedPropagationBindingDescriptor(CPropagationBindingDescriptor* lastAnalPropBindDes) { mLastAnalysedPropBindDes = lastAnalPropBindDes; return this; } CRepresentativePropagationDescriptor* CPropagationRepresentativeTransitionExtension::getLeftLastRepresentativeJoiningDescriptor() { return mLeftLastRepPropDes; } CRepresentativePropagationDescriptor* CPropagationRepresentativeTransitionExtension::getRightLastRepresentativeJoiningDescriptor() { return mRightLastRepPropDes; } CPropagationRepresentativeTransitionExtension* CPropagationRepresentativeTransitionExtension::setLeftLastRepresentativeJoiningDescriptor(CRepresentativePropagationDescriptor* varBindPathDes) { mLeftLastRepPropDes = varBindPathDes; return this; } CPropagationRepresentativeTransitionExtension* CPropagationRepresentativeTransitionExtension::setRightLastRepresentativeJoiningDescriptor(CRepresentativePropagationDescriptor* varBindPathDes) { mRightLastRepPropDes = varBindPathDes; return this; } CRepresentativePropagationMap* CPropagationRepresentativeTransitionExtension::getLeftRepresentativePropagationMap() { return &mLeftRepPropMap; } CRepresentativePropagationMap* CPropagationRepresentativeTransitionExtension::getRightRepresentativePropagationMap() { return &mRightRepPropMap; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleBackwardPropagationHashData.h0000644000175000017500000000403412520551150031311 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CROLEBACKWARDPROPAGATIONHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CROLEBACKWARDPROPAGATIONHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CBackwardPropagationLink.h" #include "CBackwardPropagationReapplyDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRoleBackwardPropagationHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleBackwardPropagationHashData { // public methods public: //! Constructor CRoleBackwardPropagationHashData(); CBackwardPropagationLink* mLinkLinker; CBackwardPropagationReapplyDescriptor* mReapplyLinker; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CROLEBACKWARDPROPAGATIONHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceValuesCounter.h0000644000175000017500000000510512520551116031415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACEVALUESCOUNTER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACEVALUESCOUNTER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CDatatypeValueSpaceValuesCounter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceValuesCounter { // public methods public: enum VALUES_COUNTER_TYPE { VCT_VALUE_COUNTER, VCT_REAL_VALUE_COUNTER, VCT_STRING_VALUE_COUNTER }; //! Constructor CDatatypeValueSpaceValuesCounter(); CDatatypeValueSpaceValuesCounter* resetValueCounter(); CDatatypeValueSpaceValuesCounter* initValueCounter(cint64 valueCount = 0); CDatatypeValueSpaceValuesCounter* initValueCounter(CDatatypeValueSpaceValuesCounter* valueCounter); bool incValueCount(cint64 incCount = 1); bool incInfinite(); bool isInfinite(); cint64 getValueCount(); virtual bool combineWithValueCounter(CDatatypeValueSpaceValuesCounter* counter, cint64 additionalDiff = 0); virtual VALUES_COUNTER_TYPE getCounterType(); bool hasValueAchieved(cint64 value); // protected methods protected: // protected variables protected: cint64 mValueCount; bool mInfinite; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACEVALUESCOUNTER_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedIndividualDistinctDescriptor.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedIndividualDistinctDescriptor.c0000644000175000017500000000311112520551076032261 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClashedIndividualDistinctDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CClashedIndividualDistinctDescriptor::CClashedIndividualDistinctDescriptor() : CClashedDependencyDescriptor() { mLinkEdge = nullptr; } CClashedIndividualDistinctDescriptor* CClashedIndividualDistinctDescriptor::initClashedDistinctDescriptor(CDistinctEdge* linkEdge, CDependencyTrackPoint* depTrackPoint) { initClashedDependencyDescriptor(depTrackPoint); mLinkEdge = linkEdge; return this; } CDistinctEdge* CClashedIndividualDistinctDescriptor::getDistinctEdge() { return mLinkEdge; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessContext.h0000644000175000017500000000553212520551134026140 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSCONTEXT_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSCONTEXT_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessTagger.h" #include "CProcessMemoryPoolAllocationManager.h" #include "CProcessingStatisticGathering.h" // Other includes #include "Scheduler/CTaskContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CProcessContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessContext : public CTaskContext { // public methods public: //! Constructor CProcessContext(); //! Destructor virtual ~CProcessContext(); virtual CProcessTagger* getProcessTagger() = 0; virtual CProcessingStatisticGathering* getProcessingStatisticsGathering() = 0; inline CProcessTagger* getUsedProcessTagger(); inline CMemoryAllocationManager* getUsedMemoryAllocationManager(); inline CProcessingStatisticGathering* getUsedProcessingStatisticsGathering(); // protected methods protected: // protected variables protected: CProcessMemoryPoolAllocationManager* mUsedMemMan; CProcessTagger* mUsedProcessTagger; CProcessingStatisticGathering* mUsedProcessStatGath; // private methods private: // private variables private: }; CProcessTagger* CProcessContext::getUsedProcessTagger() { return mUsedProcessTagger; } CMemoryAllocationManager* CProcessContext::getUsedMemoryAllocationManager() { return mUsedMemMan; } CProcessingStatisticGathering* CProcessContext::getUsedProcessingStatisticsGathering() { return mUsedProcessStatGath; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSCONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCondensedReapplyQueue.h0000644000175000017500000000550312520551104027414 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONDENSEDREAPPLYQUEUE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONDENSEDREAPPLYQUEUE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CCondensedReapplyConceptDescriptor.h" #include "CCondensedReapplyQueueIterator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { //#define KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_CONDENSED_REAPPLY_QUEUE_COUNT /*! * * \class CCondensedReapplyQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCondensedReapplyQueue { // public methods public: //! Constructor CCondensedReapplyQueue(); #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_CONDENSED_REAPPLY_QUEUE_COUNT qint64 getReapplyCount(); #endif bool isEmpty() const; bool hasConceptDescriptor(CConceptDescriptor* conceptDescriptor); CCondensedReapplyQueue* initReapplyQueue(CCondensedReapplyQueue* prevReapplyQueue); CCondensedReapplyQueueIterator getIterator(bool positiveDescriptors, bool negativeDescriptors, bool clearDynamicReapplyQueue); CCondensedReapplyQueueIterator getIterator(bool onlyPositiveDescriptors, bool clearDynamicReapplyQueue = true); CCondensedReapplyQueue* addReapplyConceptDescriptor(CCondensedReapplyConceptDescriptor *conProDes); // protected methods protected: // protected variables protected: CCondensedReapplyConceptDescriptor* mDynamicPosNegReapplyDesLinker; #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_CONDENSED_REAPPLY_QUEUE_COUNT cint64 mDynamicPosNegCount; #endif // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONDENSEDREAPPLYQUEUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSuccessorRoleIterator.cpp0000644000175000017500000000341712520551162030016 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSuccessorRoleIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSuccessorRoleIterator::CSuccessorRoleIterator() { } CSuccessorRoleIterator::CSuccessorRoleIterator(cint64 indi, const CPROCESSHASH::iterator& beginIt, const CPROCESSHASH::iterator& endIt) : mIndi(indi),mBeginIt(beginIt),mEndIt(endIt) { } bool CSuccessorRoleIterator::hasNext() { return mBeginIt != mEndIt && mBeginIt.key() == mIndi && mBeginIt.value() != nullptr; } CIndividualLinkEdge* CSuccessorRoleIterator::next(bool moveNext) { CIndividualLinkEdge* link = nullptr; if (mBeginIt != mEndIt && mBeginIt.key() == mIndi) { link = mBeginIt.value(); if (moveNext) { ++mBeginIt; } } return link; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinkedCandidateData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinkedCandidate0000644000175000017500000000530212520551074032220 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODELINKEDCANDIDATEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODELINKEDCANDIDATEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CBlockingIndividualNodeLinker.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CBlockingIndividualNodeLinkedCandidateData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBlockingIndividualNodeLinkedCandidateData { // public methods public: //! Constructor CBlockingIndividualNodeLinkedCandidateData(CProcessContext* context = nullptr); //! Destructor virtual ~CBlockingIndividualNodeLinkedCandidateData(); CBlockingIndividualNodeLinkedCandidateData* initBlockingCandidateData(CBlockingIndividualNodeLinkedCandidateData* prevBlockCandData); CBlockingIndividualNodeLinkedCandidateData* addBlockingCandidateIndividualNode(CIndividualProcessNode* candidateIndi); CBlockingIndividualNodeLinker* getBlockingCandidatesIndividualNodeLinker(); cint64 getCandidateCount(); CBlockingIndividualNodeLinkedCandidateData* setCandidateCount(cint64 candCount); // protected methods protected: // protected variables protected: CProcessContext* mContext; CMemoryAllocationManager* mMemMan; CBlockingIndividualNodeLinker* mCandLinker; cint64 mCandidateCount; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODELINKEDCANDIDATEDATA_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyConceptSaturationLabelSetIterator.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyConceptSaturationLabelSetItera0000644000175000017500000001225612520551140032330 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReapplyConceptSaturationLabelSetIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CReapplyConceptSaturationLabelSetIterator::CReapplyConceptSaturationLabelSetIterator(const CPROCESSHASH::const_iterator& itBegin, const CPROCESSHASH::const_iterator& itEnd, const CPROCESSHASH::const_iterator& itAdditionalBegin, const CPROCESSHASH::const_iterator& itAdditionalEnd, bool iterateConSatDes, bool iterateReapplies) : mItBegin(itBegin), mItEnd(itEnd), mItAdditionalBegin(itAdditionalBegin), mItAdditionalEnd(itAdditionalEnd), mIterateConSatDes(iterateConSatDes), mIterateReapplies(iterateReapplies) { while (!isIteratorValid()) { ++mItBegin; } } bool CReapplyConceptSaturationLabelSetIterator::isIteratorValid() { return isIteratorValid(mIterateConSatDes,mIterateReapplies); } bool CReapplyConceptSaturationLabelSetIterator::isIteratorValid(bool allowConSatDes, bool allowReapplies) { if (mItBegin == mItEnd) { if (mItAdditionalBegin == mItAdditionalEnd) { return true; } } if (mItBegin != mItEnd) { const CConceptSaturationDescriptorReapplyData& data = mItBegin.value(); if (data.mConSatDes && allowConSatDes) { return true; } if (data.mImpReapplyConSatDes && allowReapplies) { return true; } } else { const CConceptSaturationDescriptorReapplyData& data = mItAdditionalBegin.value(); if (data.mConSatDes && allowConSatDes) { return true; } if (data.mImpReapplyConSatDes && allowReapplies) { return true; } } return false; } cint64 CReapplyConceptSaturationLabelSetIterator::getDataTag() { if (mItBegin != mItEnd) { cint64 dataTag = mItBegin.key(); return dataTag; } else { cint64 dataTag = mItAdditionalBegin.key(); return dataTag; } //CConceptSaturationDescriptor* conDes = mItBegin.value().mConSatDes; //if (conDes) { // return conDes->getConceptTag(); //} else { // return 0; //} } CConceptSaturationDescriptor* CReapplyConceptSaturationLabelSetIterator::getConceptSaturationDescriptor() { if (mItBegin != mItEnd) { return mItBegin.value().mConSatDes; } else { return mItAdditionalBegin.value().mConSatDes; } } CImplicationReapplyConceptSaturationDescriptor* CReapplyConceptSaturationLabelSetIterator::getImplicationReapplyConceptSaturationDescriptor() { if (mItBegin != mItEnd) { return mItBegin.value().mImpReapplyConSatDes; } else { return mItAdditionalBegin.value().mImpReapplyConSatDes; } } bool CReapplyConceptSaturationLabelSetIterator::hasNext() { if (mItBegin != mItEnd) { return true; } else { return mItAdditionalBegin != mItAdditionalEnd; } } cint64 CReapplyConceptSaturationLabelSetIterator::next(bool moveToNext) { cint64 tag = getDataTag(); if (moveToNext) { if (mItBegin != mItEnd) { ++mItBegin; } else { ++mItAdditionalBegin; } while (!isIteratorValid()) { if (mItBegin != mItEnd) { ++mItBegin; } else { ++mItAdditionalBegin; } } } return tag; } CReapplyConceptSaturationLabelSetIterator* CReapplyConceptSaturationLabelSetIterator::moveNext() { if (mItBegin != mItEnd) { ++mItBegin; } else { ++mItAdditionalBegin; } while (!isIteratorValid()) { if (mItBegin != mItEnd) { ++mItBegin; } else { ++mItAdditionalBegin; } } return this; } bool CReapplyConceptSaturationLabelSetIterator::operator!=(CReapplyConceptSaturationLabelSetIterator& const_iterator) { return mItBegin != const_iterator.mItBegin && mItAdditionalBegin != const_iterator.mItAdditionalBegin; } bool CReapplyConceptSaturationLabelSetIterator::operator==(CReapplyConceptSaturationLabelSetIterator& const_iterator) { return mItBegin == const_iterator.mItBegin && mItAdditionalBegin == const_iterator.mItAdditionalBegin; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceMapArranger.h0000644000175000017500000000444712520551114032212 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUESPACEMAPARRANGER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUESPACEMAPARRANGER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDataLiteralStringValue.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeStringValueSpaceMapArranger * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeStringValueSpaceMapArranger { // public methods public: //! Constructor CDatatypeStringValueSpaceMapArranger(CDataLiteralStringValue* value); bool operator<(const CDatatypeStringValueSpaceMapArranger& valueData) const; bool operator<=(const CDatatypeStringValueSpaceMapArranger& valueData) const; CDataLiteralStringValue* getValue() const; // protected methods protected: // protected variables protected: CDataLiteralStringValue* mValue; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUESPACEMAPARRANGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptPropagationBindingSetHash.cpp0000644000175000017500000000513712520551100032054 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptPropagationBindingSetHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptPropagationBindingSetHash::CConceptPropagationBindingSetHash(CProcessContext* processContext) : mProcessContext(processContext) { } CConceptPropagationBindingSetHash* CConceptPropagationBindingSetHash::initConceptPropagationBindingSetHash(CConceptPropagationBindingSetHash* prevHash) { if (prevHash) { *this = *prevHash; } else { CPROCESSHASH::clear(); } return this; } CPropagationBindingSet* CConceptPropagationBindingSetHash::getPropagationBindingSet(CConcept* concept, bool localize) { CPropagationBindingSet* propBindSet = nullptr; cint64 conTag = concept->getConceptTag(); if (localize) { CConceptPropagationBindingSetHashData& data = CPROCESSHASH::operator[](conTag); if (!data.mLocPropBindingSet) { CMemoryAllocationManager* taskMemMan = mProcessContext->getUsedMemoryAllocationManager(); propBindSet = CObjectParameterizingAllocator< CPropagationBindingSet,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,mProcessContext); propBindSet->initPropagationBindingSet(data.mUsePropBindingSet); data.mUsePropBindingSet = data.mLocPropBindingSet = propBindSet; } else { propBindSet = data.mUsePropBindingSet; } } else { CConceptPropagationBindingSetHashData data = CPROCESSHASH::value(conTag); propBindSet = data.mUsePropBindingSet; } return propBindSet; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingReviewSet.cpp0000644000175000017500000000444612520551162030764 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureBlockingReviewSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSignatureBlockingReviewSet::CSignatureBlockingReviewSet(CProcessContext* context) : mSubsetReviews(context),mNonSubsetReviews(context) { mContext = context; } CSignatureBlockingReviewSet* CSignatureBlockingReviewSet::initSignatureBlockingReviewSet(CSignatureBlockingReviewSet* sigBlockRevSet) { if (sigBlockRevSet) { mSubsetReviews.initSignatureBlockingReviewData(&sigBlockRevSet->mSubsetReviews); mNonSubsetReviews.initSignatureBlockingReviewData(&sigBlockRevSet->mNonSubsetReviews); } else { mSubsetReviews.initSignatureBlockingReviewData(nullptr); mNonSubsetReviews.initSignatureBlockingReviewData(nullptr); } return this; } CSignatureBlockingReviewData* CSignatureBlockingReviewSet::getSubsetReviewData() { return &mSubsetReviews; } CSignatureBlockingReviewData* CSignatureBlockingReviewSet::getReviewData(bool subset) { if (subset) { return &mSubsetReviews; } else { return &mNonSubsetReviews; } } CSignatureBlockingReviewData* CSignatureBlockingReviewSet::getNonSubsetReviewData() { return &mNonSubsetReviews; } bool CSignatureBlockingReviewSet::isEmpty() { return mSubsetReviews.isEmpty() && mNonSubsetReviews.isEmpty(); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBranchingTag.cpp0000644000175000017500000000600212520551074026033 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBranchingTag.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBranchingTag::CBranchingTag(cint64 branchingTag) : CProcessTag(branchingTag) { } cint64 CBranchingTag::getBranchingTag() { return CProcessTag::getProcessTag(); } CBranchingTag* CBranchingTag::setBranchingTag(cint64 branchingTag) { CProcessTag::setProcessTag(branchingTag); return this; } CBranchingTag* CBranchingTag::initBranchingTag(cint64 branchingTag) { CProcessTag::initProcessTag(branchingTag); return this; } bool CBranchingTag::isBranchingTagUpdated(cint64 branchingTag) { return CProcessTag::isProcessTagUpdated(branchingTag); } bool CBranchingTag::isBranchingTagUpToDate(cint64 branchingTag) { return CProcessTag::isProcessTagUpToDate(branchingTag); } bool CBranchingTag::updateBranchingTag(cint64 branchingTag) { return CProcessTag::updateProcessTag(branchingTag); } bool CBranchingTag::addMaximumBranchingTagCandidate(cint64 branchingTag) { if (branchingTag > mProcessTag || branchingTag < 0) { mProcessTag = branchingTag; return true; } return false; } CBranchingTag* CBranchingTag::incBranchingTag(cint64 incCount) { ++mProcessTag; return this; } CBranchingTag* CBranchingTag::setBranchingTag(CProcessTagger* processTagger) { return setBranchingTag(processTagger->getCurrentBranchingTag()); } CBranchingTag* CBranchingTag::initBranchingTag(CProcessTagger* processTagger) { return initBranchingTag(processTagger->getCurrentBranchingTag()); } bool CBranchingTag::isBranchingTagUpdated(CProcessTagger* processTagger) { return isProcessTagUpdated(processTagger->getCurrentBranchingTag()); } bool CBranchingTag::isBranchingTagUpToDate(CProcessTagger* processTagger) { return isProcessTagUpToDate(processTagger->getCurrentBranchingTag()); } bool CBranchingTag::updateBranchingTag(CProcessTagger* processTagger) { return updateBranchingTag(processTagger->getCurrentBranchingTag()); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/0000755000175000017500000000000012613407256024762 5ustar jonasjonas././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEGROUNDINGDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEGROUNDINGD0000644000175000017500000000350312520551070030711 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVARBINDPROPAGATEGROUNDINGDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CVARBINDPROPAGATEGROUNDINGDependencyNode::CVARBINDPROPAGATEGROUNDINGDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CVARBINDPROPAGATEGROUNDINGDependencyNode* CVARBINDPROPAGATEGROUNDINGDependencyNode::initVARBINDPROPAGATEGROUNDINGDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint, CDependency* prevOtherDependencies) { initDependencyNode(DNTVARBINDPROPAGATEGROUNDINGDEPENDENCY,conceptDescriptor); if (prevOtherDependencies) { addAfterDependency(prevOtherDependencies); } mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CATLEASTDependencyNode.cpp0000644000175000017500000000321212520551052031460 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CATLEASTDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CATLEASTDependencyNode::CATLEASTDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CATLEASTDependencyNode* CATLEASTDependencyNode::initATLEASTDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint) { initDependencyNode(DNTATLEASTDEPENDENCY,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CNOMINALDependencyNode.cpp0000644000175000017500000000351212520551060031462 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNOMINALDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CNOMINALDependencyNode::CNOMINALDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CNOMINALDependencyNode* CNOMINALDependencyNode::initNOMINALDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint) { initDependencyNode(DNTNOMINALDEPENDENCY,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; if (nominalDepTrackPoint) { addAfterDependency(&mAddNominalDep); mAddNominalDep.initDependency(nominalDepTrackPoint); } updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CNonDeterministicDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CNonDeterministicDependency0000644000175000017500000001674312520551060032266 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNonDeterministicDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CNonDeterministicDependencyNode::CNonDeterministicDependencyNode(CProcessContext* processContext) : CDependencyNode(processContext),mClashTrackPoint(this) { } CNonDeterministicDependencyNode* CNonDeterministicDependencyNode::initNonDeterministicDependencyNode(DEPENDENCNODEYTYPE depType, CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor) { initDependencyNode(depType,conceptDescriptor); mClashTrackPoint.setClashedOrIrelevantBranch(true); mBranchTrackPoints = &mClashTrackPoint; mDependencyClashes = nullptr; mBranchNode = branchNode; mBranchTag = 0; mClosedTrackPoint = nullptr; mClosingTrackPoint = nullptr; return this; } CNonDeterministicDependencyNode* CNonDeterministicDependencyNode::initNonDeterministicDependencyNode(DEPENDENCNODEYTYPE depType, CBranchTreeNode* branchNode, CIndividualProcessNode* individualNode, CConceptDescriptor* conceptDescriptor) { initDependencyNode(depType,individualNode,conceptDescriptor); mClashTrackPoint.setClashedOrIrelevantBranch(true); mBranchTrackPoints = &mClashTrackPoint; mDependencyClashes = nullptr; mBranchNode = branchNode; mBranchTag = 0; mClosedTrackPoint = nullptr; mClosingTrackPoint = nullptr; return this; } bool CNonDeterministicDependencyNode::isDeterministiDependencyNode() { return false; } CDependencyTrackPoint* CNonDeterministicDependencyNode::getContinueDependencyTrackPoint() { return &mClashTrackPoint; } CNonDeterministicDependencyTrackPoint* CNonDeterministicDependencyNode::getDependencyTrackPointBranch() { CNonDeterministicDependencyTrackPoint* nonDetTrackPoint = CObjectParameterizingAllocator< CNonDeterministicDependencyTrackPoint,CNonDeterministicDependencyNode* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),this); mBranchTrackPoints = nonDetTrackPoint->append(mBranchTrackPoints); updateDependencyTrackPointBranchingTag(nonDetTrackPoint,mBranchTag); return nonDetTrackPoint; } CNonDeterministicDependencyTrackPoint* CNonDeterministicDependencyNode::getBranchTrackPoints() { return mBranchTrackPoints; } CNonDeterministicDependencyTrackPoint* CNonDeterministicDependencyNode::getClashTrackPoint() { return &mClashTrackPoint; } CClashedDependencyDescriptor* CNonDeterministicDependencyNode::getDependencyClashes() { return mDependencyClashes; } bool CNonDeterministicDependencyNode::hasDependencyClashes() { return mDependencyClashes != nullptr; } CNonDeterministicDependencyNode* CNonDeterministicDependencyNode::setDependencyClash(CClashedDependencyDescriptor* clash) { mDependencyClashes = clash; return this; } CNonDeterministicDependencyTrackPoint* CNonDeterministicDependencyNode::addBranchClashes(CClashedDependencyDescriptor* clash) { mClashTrackPoint.addClashes(clash); return &mClashTrackPoint; } bool CNonDeterministicDependencyNode::updateBranchingTags() { mBranchTag = getDependedBranchingLevel(); bool changed = false; CNonDeterministicDependencyTrackPoint* branchTrackPointsIt = mBranchTrackPoints; while (branchTrackPointsIt) { changed |= updateDependencyTrackPointBranchingTag(branchTrackPointsIt,mBranchTag); branchTrackPointsIt = branchTrackPointsIt->getNext(); } return changed; } CNonDeterministicDependencyTrackPoint* CNonDeterministicDependencyNode::getClosingDependencyTrackPoint() { return mClosingTrackPoint; } CNonDeterministicDependencyTrackPoint* CNonDeterministicDependencyNode::getClosedDependencyTrackPoint() { return mClosedTrackPoint; } CNonDeterministicDependencyNode* CNonDeterministicDependencyNode::setClosingDependencyTrackPoint(CNonDeterministicDependencyTrackPoint* depTrackPoint) { mClosingTrackPoint = depTrackPoint; return this; } CNonDeterministicDependencyNode* CNonDeterministicDependencyNode::setClosedDependencyTrackPoint(CNonDeterministicDependencyTrackPoint* depTrackPoint) { mClosedTrackPoint = depTrackPoint; return this; } bool CNonDeterministicDependencyNode::hasClosingDependencyTrackPoint(CNonDeterministicDependencyTrackPoint* depTrackPoint) { return mClosingTrackPoint == depTrackPoint; } bool CNonDeterministicDependencyNode::hasClosedDependencyTrackPoint(CNonDeterministicDependencyTrackPoint* depTrackPoint) { return mClosedTrackPoint == depTrackPoint; } bool CNonDeterministicDependencyNode::hasClosingDependencyTrackPoint() { return mClosingTrackPoint != nullptr; } bool CNonDeterministicDependencyNode::hasClosedDependencyTrackPoint() { return mClosedTrackPoint != nullptr; } cint64 CNonDeterministicDependencyNode::getOpenedDependencyTrackingPointsCount() { cint64 opDepTrackPointCount = 0; CNonDeterministicDependencyTrackPoint* branchTrackPointsIt = mBranchTrackPoints; while (branchTrackPointsIt) { if (!branchTrackPointsIt->isClashedOrIrelevantBranch()) { ++opDepTrackPointCount; } branchTrackPointsIt = branchTrackPointsIt->getNext(); } return opDepTrackPointCount; } bool CNonDeterministicDependencyNode::hasMultipleOpenedDependencyTrackingPoints() { cint64 opDepTrackPointCount = 0; CNonDeterministicDependencyTrackPoint* branchTrackPointsIt = mBranchTrackPoints; while (branchTrackPointsIt) { if (!branchTrackPointsIt->isClashedOrIrelevantBranch()) { ++opDepTrackPointCount; if (opDepTrackPointCount >= 2) { return true; } } branchTrackPointsIt = branchTrackPointsIt->getNext(); } return false; } bool CNonDeterministicDependencyNode::hasOtherOpenedDependencyTrackingPoints(CNonDeterministicDependencyTrackPoint* depTrackPoint) { CNonDeterministicDependencyTrackPoint* branchTrackPointsIt = mBranchTrackPoints; while (branchTrackPointsIt) { if (branchTrackPointsIt != depTrackPoint && !branchTrackPointsIt->isClashedOrIrelevantBranch()) { return true; } branchTrackPointsIt = branchTrackPointsIt->getNext(); } return false; } CBranchTreeNode* CNonDeterministicDependencyNode::getBranchNode() { return mBranchNode; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CANDDependencyNode.cpp0000644000175000017500000000305212520551052030767 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CANDDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CANDDependencyNode::CANDDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CANDDependencyNode* CANDDependencyNode::initANDDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint) { initDependencyNode(DNTANDDEPENDENCY,conceptDescriptor); mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CCONNECTIONDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CCONNECTIONDependencyNode.c0000644000175000017500000000321012520551054031462 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCONNECTIONDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CCONNECTIONDependencyNode::CCONNECTIONDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CCONNECTIONDependencyNode* CCONNECTIONDependencyNode::initCONNECTIONDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint) { initDependency(this); initDependencyNode(DNTCONNECTIONDEPENDENCY,conceptDescriptor); CDependencyNode::mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEBINDINGSSUCCESSORDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEBINDINGSSUCCESSOR0000644000175000017500000000471112520551062030735 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEBINDINGSSUCCESSORDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEBINDINGSSUCCESSORDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CPROPAGATEBINDINGSSUCCESSORDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPROPAGATEBINDINGSSUCCESSORDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CPROPAGATEBINDINGSSUCCESSORDependencyNode(CProcessContext* processContext = nullptr); CPROPAGATEBINDINGSSUCCESSORDependencyNode* initPROPAGATEBINDINGSSUCCESSORDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint); // protected methods protected: // protected variables protected: CDependency mPrevLinkDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEBINDINGSSUCCESSORDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEGROUNDINGDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEGROUNDINGDep0000644000175000017500000000340512520551064031052 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CREPRESENTATIVEGROUNDINGDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CREPRESENTATIVEGROUNDINGDependencyNode::CREPRESENTATIVEGROUNDINGDependencyNode(CProcessContext* processContext) : CRepresentativeSelectDependencyNode(processContext) { } CREPRESENTATIVEGROUNDINGDependencyNode* CREPRESENTATIVEGROUNDINGDependencyNode::initREPRESENTATIVEGROUNDINGDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint, CVariableBindingPath* selectedVarBindPath) { initRepresentativeSelectDependencyNode(DNTREPRESENTATIVEGROUNDING,conceptDescriptor,selectedVarBindPath); mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVALUEDependencyNode.cpp0000644000175000017500000000347312520551066031255 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVALUEDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CVALUEDependencyNode::CVALUEDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CVALUEDependencyNode* CVALUEDependencyNode::initVALUEDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint) { initDependencyNode(DNTVALUEDEPENDENCY,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; if (nominalDepTrackPoint) { addAfterDependency(&mAddNominalDep); mAddNominalDep.initDependency(nominalDepTrackPoint); } updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDependencyNode.h0000644000175000017500000001460012520551056030116 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDependency.h" #include "CDependencyTrackPoint.h" #include "CDependencyIterator.h" // Other includes #include "Reasoner/Kernel/Process/Marker/CMarker.h" #include "Reasoner/Kernel/Process/CProcessingTag.h" #include "Reasoner/Kernel/Process/CConceptDescriptor.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { using namespace Marker; namespace Dependency { /*! * * \class CDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDependencyNode : public CProcessingTag { // public methods public: //! Constructor CDependencyNode(CProcessContext* processContext = nullptr); enum DEPENDENCNODEYTYPE { DNTUNDEFINED, DNTINDEPENDENTBASE, DNTANDDEPENDENCY, DNTAUTOMATCHOOSEDEPENDENCY, DNTORDEPENDENCY, DNTALLDEPENDENCY, DNTAUTOMATTRANSACTIONDEPENDENCY, DNTSOMEDEPENDENCY, DNTSELFDEPENDENCY, DNTVALUEDEPENDENCY, DNTNEGVALUEDEPENDENCY, DNTDISTINCTDEPENDENCY, DNTATLEASTDEPENDENCY, DNTMERGEDCONCEPT, DNTMERGEDLINK, DNTMERGEDINDIVIDUAL, DNTMERGEDEPENDENCY, DNTATMOSTDEPENDENCY, DNTQUALIFYDEPENDENCY, DNTFUNCTIONALDEPENDENCY, DNTNOMINALDEPENDENCY, DNTIMPLICATIONDEPENDENCY, DNTEXPANDEDDEPENDENCY, DNTCONNECTIONDEPENDENCY, DNTREUSEINDIVIDUALDEPENDENCY, DNTREUSECONCEPTSDEPENDENCY, DNTREUSECOMPLETIONGRAPHDEPENDENCY, DNTDATATYPETRIGGERDEPENDENCY, DNTDATATYPECONNECTIONDEPENDENCY, DNTROLEASSERTIONDEPENDENCY, DNTBINDVARIABLEDEPENDENCY, DNTPROPAGATEBINDINGDEPENDENCY, DNTBINDPROPAGATEAND, DNTBINDPROPAGATEIMPLICATION, DNTPROPAGATEBINDINGSUCCESSORDEPENDENCY, DNTBINDPROPAGATEALL, DNTBINDPROPAGATECYCLE, DNTPROPAGATECONNECTIONDEPENDENCY, DNTPROPAGATECONNECTIONAWAYDEPENDENCY, DNTBINDPROPAGATEGROUNDINGDEPENDENCY, DNTVARBINDPROPAGATEAND, DNTPROPAGATEVARIABLEBINDINGDEPENDENCY, DNTVARBINDPROPAGATEALL, DNTPROPAGATEVARIABLEBINDINGSUCCESSORDEPENDENCY, DNTVARBINDVARIABLEDEPENDENCY, DNTVARBINDPROPAGATEJOIN, DNTVARBINDPROPAGATEGROUNDINGDEPENDENCY, DNTPROPAGATEVARIABLECONNECTIONDEPENDENCY, DNTVARBINDPROPAGATEIMPLICATION, DNTRESOLVEREPRESENTATIVE, DNTREPRESENTATIVEAND, DNTREPRESENTATIVEALL, DNTREPRESENTATIVEIMPLICATION, DNTREPRESENTATIVEBINDVARIABLE, DNTREPRESENTATIVEJOIN, DNTREPRESENTATIVEGROUNDING }; CDependencyNode* initDependencyNode(DEPENDENCNODEYTYPE depType, CConceptDescriptor* conceptDescriptor = nullptr); CDependencyNode* initDependencyNode(DEPENDENCNODEYTYPE depType, CIndividualProcessNode* individualNode, CConceptDescriptor* conceptDescriptor = nullptr); CConceptDescriptor* getConceptDescriptor(); CDependencyNode* setConceptDescriptor(CConceptDescriptor* conceptDescriptor); CDependencyTrackPoint* getPreviousDependencyTrackPoint(); virtual CDependencyTrackPoint* getContinueDependencyTrackPoint() = 0; virtual bool isDeterministiDependencyNode() = 0; bool isNonDeterministiDependencyNode(); //CMarker* getMarker(); //CDependencyNode* setMarker(CMarker* depMarker); //CDependencyNode* addMarker(CMarker* depMarker); CDependencyIterator getAdditionalDependencyIterator(bool aheadDependencies = true, bool afterDependencies = true); //CDependency* getAdditionalAheadDependencies(); CDependency* getAdditionalAfterDependencies(); cint64 getAdditionalDependencyCount(); bool hasAdditionalDependencies(); //bool hasAdditionalAheadDependencies(); bool hasAdditionalAfterDependencies(); bool hasDependencies(); cint64 getDependencyCount(); cint64 getDependedBranchingTag(); cint64 getDependedBranchingLevel(); DEPENDENCNODEYTYPE getDependencyType(); bool isDependencyType(DEPENDENCNODEYTYPE depType); bool isIndependentBaseDependencyType(); bool isUndefinedDependencyType(); CIndividualProcessNode* getAppropriateIndividualNode(); bool hasAppropriateIndividualNode(); CDependencyNode* setAppropriateIndividualNode(CIndividualProcessNode* indiNode); virtual bool isRepresentativeResolveDependencyNode(); virtual bool isRepresentativeSelectDependencyNode(); // protected methods protected: //CDependencyNode* addAheadDependency(CDependency* conceptDependency); CDependencyNode* addAfterDependency(CDependency* linkDependency); bool updateDependencyTrackPointBranchingTag(CDependencyTrackPoint* depTrackPoint, cint64 branchinLevelTag); // protected variables protected: CProcessContext* mProcessContext; CConceptDescriptor* mConceptDescriptor; CIndividualProcessNode* mIndividualNode; DEPENDENCNODEYTYPE mDepNodeType; //CMarker* mMarker; CDependencyTrackPoint* mDepTrackPoint; //CDependency* mAdditionalAheadDepLinker; CDependency* mAdditionalAfterDepLinker; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVALUEDependencyNode.h0000644000175000017500000000443312520551066030717 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVALUEDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVALUEDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CVALUEDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVALUEDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CVALUEDependencyNode(CProcessContext* processContext = nullptr); CVALUEDependencyNode* initVALUEDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint); // protected methods protected: // protected variables protected: CDependency mAddNominalDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVALUEDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBranchingTree.h0000644000175000017500000000474312520551054027752 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBRANCHINGTREE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBRANCHINGTREE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CBranchTreeNode.h" #include "CIndependentBaseDependencyNode.h" #include "CDependencyNode.h" // Other includes #include "Reasoner/Kernel/Process/CProcessContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CBranchingTree * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBranchingTree { // public methods public: //! Constructor CBranchingTree(CProcessContext* processContext = nullptr); CBranchingTree* initBranchingTree(CBranchingTree* tree); CBranchTreeNode* getBranchTreeNode(Task::CSatisfiableCalculationTask* task, bool forceBranchCreation = false); CDependencyNode* getBaseDependencyNode(bool create = true); // protected methods protected: // protected variables protected: CProcessContext* mPocessContext; CBranchTreeNode* mRootNode; CBranchTreeNode* mCurrNode; CBranchTreeNode* mPrevCurrNode; CDependencyNode* mBaseDepNode; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBRANCHINGTREE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDependencyNode.cpp0000644000175000017500000001655212520551056030461 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CDependencyNode::CDependencyNode(CProcessContext* processContext) : CProcessingTag(processContext->getUsedProcessTagger()->getCurrentProcessingTagAndInc()) { mProcessContext = processContext; mDepNodeType = DNTUNDEFINED; //mAdditionalAheadDepLinker = nullptr; mAdditionalAfterDepLinker = nullptr; } CDependencyNode* CDependencyNode::initDependencyNode(DEPENDENCNODEYTYPE depType, CConceptDescriptor* conceptDescriptor) { mConceptDescriptor = conceptDescriptor; mDepNodeType = depType; //mMarker = nullptr; mIndividualNode = nullptr; return this; } CDependencyNode* CDependencyNode::initDependencyNode(DEPENDENCNODEYTYPE depType, CIndividualProcessNode* individualNode, CConceptDescriptor* conceptDescriptor) { initDependencyNode(depType,conceptDescriptor); mIndividualNode = individualNode; return this; } //CMarker* CDependencyNode::getMarker() { // return mMarker; //} //CDependencyNode* CDependencyNode::setMarker(CMarker* depMarker) { // mMarker = depMarker; // return this; //} // //CDependencyNode* CDependencyNode::addMarker(CMarker* depMarker) { // if (!mMarker) { // mMarker = depMarker; // } else { // mMarker = depMarker->append(mMarker); // } // return this; //} bool CDependencyNode::isNonDeterministiDependencyNode() { return !isDeterministiDependencyNode(); } CConceptDescriptor* CDependencyNode::getConceptDescriptor() { return mConceptDescriptor; } CDependencyNode* CDependencyNode::setConceptDescriptor(CConceptDescriptor* conceptDescriptor) { mConceptDescriptor = conceptDescriptor; return this; } CDependencyTrackPoint* CDependencyNode::getPreviousDependencyTrackPoint() { return mDepTrackPoint; } CDependencyIterator CDependencyNode::getAdditionalDependencyIterator(bool aheadDependencies, bool afterDependencies) { return CDependencyIterator(/*aheadDependencies?mAdditionalAheadDepLinker:*/nullptr, afterDependencies?mAdditionalAfterDepLinker:nullptr); } //CDependency* CDependencyNode::getAdditionalAheadDependencies() { // return mAdditionalAheadDepLinker; //} CDependency* CDependencyNode::getAdditionalAfterDependencies() { return mAdditionalAfterDepLinker; } cint64 CDependencyNode::getAdditionalDependencyCount() { cint64 depCount = 0; //if (mAdditionalAheadDepLinker) { // depCount += mAdditionalAheadDepLinker->getCount(); //} if (mAdditionalAfterDepLinker) { depCount += mAdditionalAfterDepLinker->getCount(); } return depCount; } bool CDependencyNode::hasAdditionalDependencies() { return /*mAdditionalAheadDepLinker || */mAdditionalAfterDepLinker; } //CDependencyNode* CDependencyNode::addAheadDependency(CDependency* conceptDependency) { // mAdditionalAheadDepLinker = conceptDependency->append(mAdditionalAheadDepLinker); // return this; //} CDependencyNode* CDependencyNode::addAfterDependency(CDependency* linkDependency) { mAdditionalAfterDepLinker = linkDependency->append(mAdditionalAfterDepLinker); return this; } cint64 CDependencyNode::getDependedBranchingTag() { cint64 branchLevelTag = 0; if (mDepTrackPoint) { branchLevelTag = qMax(branchLevelTag,mDepTrackPoint->getBranchingTag()); } //CDependency* conDepLinkerIt = mAdditionalAheadDepLinker; //while (conDepLinkerIt && branchLevelTag >= 0) { // CDependencyTrackPoint* trackPoint = conDepLinkerIt->getPreviousDependencyTrackPoint(); // if (trackPoint) { // branchLevelTag = qMax(branchLevelTag,trackPoint->getBranchingTag()); // } else { // branchLevelTag = -1; // } // conDepLinkerIt = conDepLinkerIt->getNext(); //} CDependency* linkDepLinkerIt = mAdditionalAfterDepLinker; while (linkDepLinkerIt && branchLevelTag >= 0) { CDependencyTrackPoint* trackPoint = linkDepLinkerIt->getPreviousDependencyTrackPoint(); if (trackPoint) { branchLevelTag = qMax(branchLevelTag,trackPoint->getBranchingTag()); } else { branchLevelTag = -1; } linkDepLinkerIt = linkDepLinkerIt->getNext(); } return branchLevelTag; } cint64 CDependencyNode::getDependedBranchingLevel() { return getDependedBranchingTag(); } //bool CDependencyNode::hasAdditionalAheadDependencies() { // return mAdditionalAheadDepLinker != nullptr; //} bool CDependencyNode::hasAdditionalAfterDependencies() { return mAdditionalAfterDepLinker != nullptr; } bool CDependencyNode::hasDependencies() { return /*mAdditionalAheadDepLinker || */mAdditionalAfterDepLinker || mDepTrackPoint; } cint64 CDependencyNode::getDependencyCount() { cint64 depCount = 0; if (mDepTrackPoint) { depCount += 1; } depCount += getAdditionalDependencyCount(); return depCount; } CDependencyNode::DEPENDENCNODEYTYPE CDependencyNode::getDependencyType() { return mDepNodeType; } bool CDependencyNode::isDependencyType(DEPENDENCNODEYTYPE depType) { return mDepNodeType == depType; } bool CDependencyNode::isIndependentBaseDependencyType() { return isDependencyType(DNTINDEPENDENTBASE); } bool CDependencyNode::isUndefinedDependencyType() { return isDependencyType(DNTUNDEFINED); } CIndividualProcessNode* CDependencyNode::getAppropriateIndividualNode() { return mIndividualNode; } bool CDependencyNode::hasAppropriateIndividualNode() { return mIndividualNode != nullptr; } CDependencyNode* CDependencyNode::setAppropriateIndividualNode(CIndividualProcessNode* indiNode) { mIndividualNode = indiNode; return this; } bool CDependencyNode::updateDependencyTrackPointBranchingTag(CDependencyTrackPoint* depTrackPoint, cint64 branchinLevelTag) { return depTrackPoint->addMaximumBranchingTagCandidate(branchinLevelTag); } bool CDependencyNode::isRepresentativeResolveDependencyNode() { return false; } bool CDependencyNode::isRepresentativeSelectDependencyNode() { return false; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CATMOSTDependencyNode.h0000644000175000017500000000444412520551052031047 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CATMOSTDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CATMOSTDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CNonDeterministicDependencyNode.h" // Other includes #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CATMOSTDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CATMOSTDependencyNode : public CNonDeterministicDependencyNode { // public methods public: //! Constructor CATMOSTDependencyNode(CProcessContext* processContext = nullptr); CATMOSTDependencyNode* initATMOSTDependencyNode(CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CATMOSTDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEALLDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEALLDependency0000644000175000017500000000353712520551054031320 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBINDPROPAGATEALLDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CBINDPROPAGATEALLDependencyNode::CBINDPROPAGATEALLDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { addAfterDependency(&mPrevLinkDep); } CBINDPROPAGATEALLDependencyNode* CBINDPROPAGATEALLDependencyNode::initBINDPROPAGATEALLDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint) { initDependencyNode(DNTBINDPROPAGATEALL,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; mPrevLinkDep.initDependency(prevLinkDependencyTrackPoint); updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h0000644000175000017500000000453712520551056031317 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDEPENDENCYTRACKPOINT_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDEPENDENCYTRACKPOINT_H // Libraries includes // Namespace includes #include "DependencySettings.h" // Other includes #include "Reasoner/Kernel/Process/CBranchingTag.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CDependencyTrackPoint * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDependencyTrackPoint : public CBranchingTag { // public methods public: //! Constructor CDependencyTrackPoint(CDependencyNode* depNode = nullptr); CDependencyNode *getDependencyNode(); cint64 getProcessingTag(); bool isPointingToDeterministicDependencyNode(); bool isPointingToIndependentDependencyNode(); bool isDependencyRelevant(); CDependencyTrackPoint* setDependencyRelevance(bool relevant); // protected methods protected: // protected variables protected: CDependencyNode* mDepNode; bool mRelevantFlag; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDEPENDENCYTRACKPOINT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.cpp0000644000175000017500000000377412520551056031654 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDependencyTrackPoint.h" #include "CDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CDependencyTrackPoint::CDependencyTrackPoint(CDependencyNode* depNode) : CBranchingTag(0) { mDepNode = depNode; mRelevantFlag = false; } CDependencyNode* CDependencyTrackPoint::getDependencyNode() { return mDepNode; } cint64 CDependencyTrackPoint::getProcessingTag() { return mDepNode->getProcessingTag(); } bool CDependencyTrackPoint::isPointingToDeterministicDependencyNode() { return mDepNode->isDeterministiDependencyNode(); } bool CDependencyTrackPoint::isPointingToIndependentDependencyNode() { return mDepNode->isIndependentBaseDependencyType(); } bool CDependencyTrackPoint::isDependencyRelevant() { return mRelevantFlag; } CDependencyTrackPoint* CDependencyTrackPoint::setDependencyRelevance(bool relevant) { mRelevantFlag = relevant; return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEJOINDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEJOINDependen0000644000175000017500000000346612520551064031276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CREPRESENTATIVEJOINDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CREPRESENTATIVEJOINDependencyNode::CREPRESENTATIVEJOINDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { addAfterDependency(&mPrevLinkDep); } CREPRESENTATIVEJOINDependencyNode* CREPRESENTATIVEJOINDependencyNode::initREPRESENTATIVEJOINDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint) { initDependencyNode(DNTREPRESENTATIVEJOIN,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; mPrevLinkDep.initDependency(prevLinkDependencyTrackPoint); updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBranchTreeNode.cpp0000644000175000017500000000717712520551054030421 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBranchTreeNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CBranchTreeNode::CBranchTreeNode(CProcessContext* processContext) { mProcessContext = processContext; mBranchedDepTrackPoint = nullptr; mSatCalcTask = nullptr; KONCLUCE_TASK_ALGORITHM_BRANCH_STRING_INSTRUCTION(mBranchString = nullptr); } CBranchTreeNode* CBranchTreeNode::initBranchingRootNode(Task::CSatisfiableCalculationTask* satCalcTask) { mParentNode = nullptr; mRootNode = this; initBranchingTag((cint64)0); mSatCalcTask = satCalcTask; return this; } CBranchTreeNode* CBranchTreeNode::initBranchingChildNode(CBranchTreeNode* parentBranchTreeNode, Task::CSatisfiableCalculationTask* satCalcTask) { mSatCalcTask = satCalcTask; mBranchedDepTrackPoint = nullptr; mParentNode = parentBranchTreeNode; mRootNode = nullptr; initBranchingTag((cint64)0); if (parentBranchTreeNode) { mRootNode = parentBranchTreeNode->mRootNode; setBranchingTag(parentBranchTreeNode->getBranchingLevel()); } return this; } CBranchTreeNode* CBranchTreeNode::branchingIncrement(CNonDeterministicDependencyTrackPoint* depTrackPoint) { incBranchingTag(); mBranchedDepTrackPoint = depTrackPoint; return this; } CNonDeterministicDependencyTrackPoint* CBranchTreeNode::getDependencyTrackPoint() { return mBranchedDepTrackPoint; } CBranchTreeNode* CBranchTreeNode::initBranchingCopyNode(CBranchTreeNode* copyBranchTreeNode, Task::CSatisfiableCalculationTask* satCalcTask) { mSatCalcTask = satCalcTask; mBranchedDepTrackPoint = copyBranchTreeNode->mBranchedDepTrackPoint; mParentNode = copyBranchTreeNode->mParentNode; mRootNode = copyBranchTreeNode->mRootNode; setBranchingTag(copyBranchTreeNode->getBranchingLevel()); if (copyBranchTreeNode->isRootNode()) { mRootNode = this; } return this; } CBranchTreeNode* CBranchTreeNode::getParentNode() { return mParentNode; } CBranchTreeNode* CBranchTreeNode::getRootNode() { return mRootNode; } bool CBranchTreeNode::isRootNode() { return mRootNode == this; } cint64 CBranchTreeNode::getBranchingLevel() { return getBranchingTag(); } Task::CSatisfiableCalculationTask* CBranchTreeNode::getSatisfiableCalculationTask() { return mSatCalcTask; } KONCLUCE_TASK_ALGORITHM_BRANCH_STRING_INSTRUCTION(CBranchTreeNode* CBranchTreeNode::setBranchString(QString* string) {\ mBranchString = string;\ return this;\ }) }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEALLDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEALLDependency0000644000175000017500000000457112520551054031317 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATEALLDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATEALLDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CBINDPROPAGATEALLDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBINDPROPAGATEALLDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CBINDPROPAGATEALLDependencyNode(CProcessContext* processContext = nullptr); CBINDPROPAGATEALLDependencyNode* initBINDPROPAGATEALLDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint); // protected methods protected: // protected variables protected: CDependency mPrevLinkDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATEALLDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEBINDINGDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEBINDINGDependency0000644000175000017500000000340412520551062031315 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPROPAGATEBINDINGDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CPROPAGATEBINDINGDependencyNode::CPROPAGATEBINDINGDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CPROPAGATEBINDINGDependencyNode* CPROPAGATEBINDINGDependencyNode::initPROPAGATEBINDINGDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint, CDependency* prevOtherDependencies) { initDependencyNode(DNTPROPAGATEBINDINGDEPENDENCY,conceptDescriptor); if (prevOtherDependencies) { addAfterDependency(prevOtherDependencies); } mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CNonDeterministicDependencyTrackPoint.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CNonDeterministicDependency0000644000175000017500000000546012520551062032262 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNonDeterministicDependencyTrackPoint.h" #include "CBranchTreeNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CNonDeterministicDependencyTrackPoint::CNonDeterministicDependencyTrackPoint(CDependencyNode* depNode) : CDependencyTrackPoint(depNode),CLinkerBase(this) { mBranchNode = nullptr; mClashes = nullptr; mClashedIrelevant = false; } CNonDeterministicDependencyTrackPoint* CNonDeterministicDependencyTrackPoint::initBranch(CBranchTreeNode* branchNode) { mBranchNode = branchNode; addMaximumBranchingTagCandidate(mBranchNode->getBranchingLevel()); return this; } CClashedDependencyDescriptor* CNonDeterministicDependencyTrackPoint::getClashes() { return mClashes; } CNonDeterministicDependencyTrackPoint* CNonDeterministicDependencyTrackPoint::addClashes(CClashedDependencyDescriptor* clashes, bool setClashed) { if (clashes) { mClashes = clashes->append(mClashes); mClashedIrelevant |= setClashed; } return this; } CNonDeterministicDependencyTrackPoint* CNonDeterministicDependencyTrackPoint::setClashes(CClashedDependencyDescriptor* clashes, bool setClashed) { mClashes = clashes; mClashedIrelevant |= setClashed; return this; } CBranchTreeNode* CNonDeterministicDependencyTrackPoint::getBranchNode() { return mBranchNode; } bool CNonDeterministicDependencyTrackPoint::isClashedOrIrelevantBranch() { return mClashedIrelevant; } CNonDeterministicDependencyTrackPoint* CNonDeterministicDependencyTrackPoint::setClashedOrIrelevantBranch(bool clashedOrIrelevant) { mClashedIrelevant = clashedOrIrelevant; return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDATATYPETRIGGERDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDATATYPETRIGGERDependencyN0000644000175000017500000000436012520551056031362 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDATATYPETRIGGERDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDATATYPETRIGGERDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CDATATYPETRIGGERDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDATATYPETRIGGERDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CDATATYPETRIGGERDependencyNode(CProcessContext* processContext = nullptr); CDATATYPETRIGGERDependencyNode* initDATATYPETRIGGERDependencyNode(CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependency* prevOtherDependencies); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDATATYPETRIGGERDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEBINDVARIABLEDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEBINDVARIABLE0000644000175000017500000000334212520551064030707 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CREPRESENTATIVEBINDVARIABLEDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CREPRESENTATIVEBINDVARIABLEDependencyNode::CREPRESENTATIVEBINDVARIABLEDependencyNode(CProcessContext* processContext) : CRepresentativeSelectDependencyNode(processContext) { } CREPRESENTATIVEBINDVARIABLEDependencyNode* CREPRESENTATIVEBINDVARIABLEDependencyNode::initREPRESENTATIVEBINDVARIABLEDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint) { initRepresentativeSelectDependencyNode(DNTREPRESENTATIVEBINDVARIABLE,conceptDescriptor,nullptr); mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEGROUNDINGDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEGROUNDINGDepe0000644000175000017500000000451012520551054031033 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATEGROUNDINGDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATEGROUNDINGDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CBINDPROPAGATEGROUNDINGDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBINDPROPAGATEGROUNDINGDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CBINDPROPAGATEGROUNDINGDependencyNode(CProcessContext* processContext = nullptr); CBINDPROPAGATEGROUNDINGDependencyNode* initBINDPROPAGATEGROUNDINGDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint, CDependency* prevOtherDependencies); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATEGROUNDINGDependencyNode_H ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEIMPLICATIONDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEIMPLICATIOND0000644000175000017500000000351112520551064030737 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CREPRESENTATIVEIMPLICATIONDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CREPRESENTATIVEIMPLICATIONDependencyNode::CREPRESENTATIVEIMPLICATIONDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CREPRESENTATIVEIMPLICATIONDependencyNode* CREPRESENTATIVEIMPLICATIONDependencyNode::initREPRESENTATIVEIMPLICATIONDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependency* prevOtherDependencies) { initDependencyNode(DNTREPRESENTATIVEIMPLICATION,conceptDescriptor); if (prevOtherDependencies) { addAfterDependency(prevOtherDependencies); } mDepTrackPoint = prevConceptDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CFUNCTIONALDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CFUNCTIONALDependencyNode.c0000644000175000017500000000374612520551060031500 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CFUNCTIONALDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CFUNCTIONALDependencyNode::CFUNCTIONALDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { addAfterDependency(&mPrevLink1Dep); addAfterDependency(&mPrevLink2Dep); } CFUNCTIONALDependencyNode* CFUNCTIONALDependencyNode::initFUNCTIONALDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLink1DependencyTrackPoint, CDependencyTrackPoint* prevLink2DependencyTrackPoint) { initDependencyNode(DNTFUNCTIONALDEPENDENCY,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; mPrevLink1Dep.initDependency(prevLink1DependencyTrackPoint); mPrevLink2Dep.initDependency(prevLink2DependencyTrackPoint); updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/DependencySettings.h0000644000175000017500000000346712405707546030750 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_DEPENDENCYSETTINGS #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_DEPENDENCYSETTINGS // Qt includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \file DependencySettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CDependencyTrackPoint; class CBranchTreeNode; class CDependency; class CDependencyNode; class CDependencyTrackPoint; class CNonDeterministicDependencyTrackPoint; class CNonDeterministicDependencyNode; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_DEPENDENCYSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CQUALIFYDependencyNode.cpp0000644000175000017500000000324212520551064031503 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQUALIFYDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CQUALIFYDependencyNode::CQUALIFYDependencyNode(CProcessContext* processContext) : CNonDeterministicDependencyNode(processContext) { } CQUALIFYDependencyNode* CQUALIFYDependencyNode::initQUALIFYDependencyNode(CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint) { initNonDeterministicDependencyNode(DNTQUALIFYDEPENDENCY,branchNode,individualNode,conceptDescriptor); mDepTrackPoint = depTrackPoint; updateBranchingTags(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATECYCLEDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATECYCLEDependen0000644000175000017500000000347212520551054031211 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBINDPROPAGATECYCLEDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CBINDPROPAGATECYCLEDependencyNode::CBINDPROPAGATECYCLEDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { addAfterDependency(&mPrevTriggDep); } CBINDPROPAGATECYCLEDependencyNode* CBINDPROPAGATECYCLEDependencyNode::initBINDPROPAGATECYCLEDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevTriggDependencyTrackPoint) { initDependencyNode(DNTBINDPROPAGATECYCLE,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; mPrevTriggDep.initDependency(prevTriggDependencyTrackPoint); updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDVARIABLEDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDVARIABLEDependencyNode0000644000175000017500000000432412520551054031433 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDVARIABLEDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDVARIABLEDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CBINDVARIABLEDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBINDVARIABLEDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CBINDVARIABLEDependencyNode(CProcessContext* processContext = nullptr); CBINDVARIABLEDependencyNode* initBINDVARIABLEDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDVARIABLEDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CATMOSTDependencyNode.cpp0000644000175000017500000000323312520551052031375 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CATMOSTDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CATMOSTDependencyNode::CATMOSTDependencyNode(CProcessContext* processContext) : CNonDeterministicDependencyNode(processContext) { } CATMOSTDependencyNode* CATMOSTDependencyNode::initATMOSTDependencyNode(CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint) { initNonDeterministicDependencyNode(DNTATMOSTDEPENDENCY,branchNode,individualNode,conceptDescriptor); mDepTrackPoint = depTrackPoint; updateBranchingTags(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATECONNECTIONAWAYDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATECONNECTIONAWAYDep0000644000175000017500000000454512520551062031025 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATECONNECTIONAWAYDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATECONNECTIONAWAYDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CPROPAGATECONNECTIONAWAYDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPROPAGATECONNECTIONAWAYDependencyNode : public CDeterministicDependencyNode, public CDependency { // public methods public: //! Constructor CPROPAGATECONNECTIONAWAYDependencyNode(CProcessContext* processContext = nullptr); CPROPAGATECONNECTIONAWAYDependencyNode* initPROPAGATECONNECTIONAWAYDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* processIndi, CDependencyTrackPoint* prevDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATECONNECTIONAWAYDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CEXPANDEDDependencyNode.cpp0000644000175000017500000000324312520551056031563 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEXPANDEDDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CEXPANDEDDependencyNode::CEXPANDEDDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CEXPANDEDDependencyNode* CEXPANDEDDependencyNode::initEXPANDEDDependencyNode(CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependency* prevOtherDependencies) { initDependencyNode(DNTEXPANDEDDEPENDENCY); if (prevOtherDependencies) { addAfterDependency(prevOtherDependencies); } mDepTrackPoint = prevConceptDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDVARIABLEDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDVARIABLEDependencyN0000644000175000017500000000435412520551070031315 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDVARIABLEDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDVARIABLEDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CVARBINDVARIABLEDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVARBINDVARIABLEDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CVARBINDVARIABLEDependencyNode(CProcessContext* processContext = nullptr); CVARBINDVARIABLEDependencyNode* initVARBINDVARIABLEDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDVARIABLEDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATECONNECTIONAWAYDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATECONNECTIONAWAYDep0000644000175000017500000000342412520551062031020 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPROPAGATECONNECTIONAWAYDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CPROPAGATECONNECTIONAWAYDependencyNode::CPROPAGATECONNECTIONAWAYDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CPROPAGATECONNECTIONAWAYDependencyNode* CPROPAGATECONNECTIONAWAYDependencyNode::initPROPAGATECONNECTIONAWAYDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* processIndi, CDependencyTrackPoint* prevDependencyTrackPoint) { initDependency(this); initDependencyNode(DNTPROPAGATECONNECTIONAWAYDEPENDENCY,processIndi,conceptDescriptor); CDependencyNode::mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CFUNCTIONALDependencyNode.h0000644000175000017500000000464312520551060031502 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CFUNCTIONALDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CFUNCTIONALDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CFUNCTIONALDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CFUNCTIONALDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CFUNCTIONALDependencyNode(CProcessContext* processContext = nullptr); CFUNCTIONALDependencyNode* initFUNCTIONALDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLink1DependencyTrackPoint, CDependencyTrackPoint* prevLink2DependencyTrackPoint); // protected methods protected: // protected variables protected: CDependency mPrevLink1Dep; CDependency mPrevLink2Dep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CFUNCTIONALDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREUSECOMPLETIONGRAPHDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREUSECOMPLETIONGRAPHDepend0000644000175000017500000000462412520551066031171 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREUSECOMPLETIONGRAPHDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREUSECOMPLETIONGRAPHDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CNonDeterministicDependencyNode.h" // Other includes #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CREUSECOMPLETIONGRAPHDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CREUSECOMPLETIONGRAPHDependencyNode : public CNonDeterministicDependencyNode { // public methods public: //! Constructor CREUSECOMPLETIONGRAPHDependencyNode(CProcessContext* processContext = nullptr); CREUSECOMPLETIONGRAPHDependencyNode* initREUSECOMPLETIONGRAPHDependencyNode(CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREUSECOMPLETIONGRAPHDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEJOINDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEJOINDependen0000644000175000017500000000454112520551064031271 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEJOINDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEJOINDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CREPRESENTATIVEJOINDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CREPRESENTATIVEJOINDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CREPRESENTATIVEJOINDependencyNode(CProcessContext* processContext = nullptr); CREPRESENTATIVEJOINDependencyNode* initREPRESENTATIVEJOINDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint); // protected methods protected: // protected variables protected: CDependency mPrevLinkDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEJOINDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CRESOLVEREPRESENTATIVEDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CRESOLVEREPRESENTATIVEDepen0000644000175000017500000000475712520551066031175 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CRESOLVEREPRESENTATIVEDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CRESOLVEREPRESENTATIVEDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CRepresentativeResolveDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CRESOLVEREPRESENTATIVEDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRESOLVEREPRESENTATIVEDependencyNode : public CRepresentativeResolveDependencyNode { // public methods public: //! Constructor CRESOLVEREPRESENTATIVEDependencyNode(CProcessContext* processContext = nullptr); CRESOLVEREPRESENTATIVEDependencyNode* initRESOLVEREPRESENTATIVEDependencyNode(CConceptDescriptor* conceptDescriptor, CRepresentativeVariableBindingPathMap* resolveVarBindPathMap, CRepresentativePropagationMap* resolveRepPropMap, CDependencyTrackPoint* prevDependencyTrackPoint, CDependencyTrackPoint* additionalDepTrackPoint); // protected methods protected: // protected variables protected: CDependency mAdditionalDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CRESOLVEREPRESENTATIVEDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEANDDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEANDDependency0000644000175000017500000000436412520551054031311 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATEANDDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATEANDDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CBINDPROPAGATEANDDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBINDPROPAGATEANDDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CBINDPROPAGATEANDDependencyNode(CProcessContext* processContext = nullptr); CBINDPROPAGATEANDDependencyNode* initBINDPROPAGATEANDDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATEANDDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEBINDVARIABLEDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEBINDVARIABLE0000644000175000017500000000452212520551064030710 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEBINDVARIABLEDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEBINDVARIABLEDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CRepresentativeSelectDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CREPRESENTATIVEBINDVARIABLEDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CREPRESENTATIVEBINDVARIABLEDependencyNode : public CRepresentativeSelectDependencyNode { // public methods public: //! Constructor CREPRESENTATIVEBINDVARIABLEDependencyNode(CProcessContext* processContext = nullptr); CREPRESENTATIVEBINDVARIABLEDependencyNode* initREPRESENTATIVEBINDVARIABLEDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEBINDVARIABLEDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDependencyIterator.cpp0000644000175000017500000000346412520551056031363 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDependencyIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CDependencyIterator::CDependencyIterator(CDependency* conDependency, CDependency* linkDependency) { mConDependency = conDependency; mLinkDependency = linkDependency; } bool CDependencyIterator::hasNext() { return mConDependency || mLinkDependency; } CDependency* CDependencyIterator::nextDependency(bool moveNext) { CDependency* dep = nullptr; if (mConDependency) { dep = mConDependency; if (moveNext) { mConDependency = mConDependency->getNext(); } } else if (mLinkDependency) { dep = mLinkDependency; if (moveNext) { mLinkDependency = mLinkDependency->getNext(); } } return dep; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEALLDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEALLDepende0000644000175000017500000000462112520551070031150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEALLDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEALLDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CVARBINDPROPAGATEALLDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVARBINDPROPAGATEALLDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CVARBINDPROPAGATEALLDependencyNode(CProcessContext* processContext = nullptr); CVARBINDPROPAGATEALLDependencyNode* initVARBINDPROPAGATEALLDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint); // protected methods protected: // protected variables protected: CDependency mPrevLinkDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEALLDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREUSECONCEPTSDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREUSECONCEPTSDependencyNod0000644000175000017500000000453412520551066031474 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREUSECONCEPTSDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREUSECONCEPTSDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CNonDeterministicDependencyNode.h" // Other includes #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CREUSECONCEPTSDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CREUSECONCEPTSDependencyNode : public CNonDeterministicDependencyNode { // public methods public: //! Constructor CREUSECONCEPTSDependencyNode(CProcessContext* processContext = nullptr); CREUSECONCEPTSDependencyNode* initREUSECONCEPTSDependencyNode(CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREUSECONCEPTSDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEANDDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEANDDependenc0000644000175000017500000000437412520551064031303 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEANDDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEANDDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CREPRESENTATIVEANDDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CREPRESENTATIVEANDDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CREPRESENTATIVEANDDependencyNode(CProcessContext* processContext = nullptr); CREPRESENTATIVEANDDependencyNode* initREPRESENTATIVEANDDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEANDDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CRESOLVEREPRESENTATIVEDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CRESOLVEREPRESENTATIVEDepen0000644000175000017500000000403012520551066031155 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRESOLVEREPRESENTATIVEDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CRESOLVEREPRESENTATIVEDependencyNode::CRESOLVEREPRESENTATIVEDependencyNode(CProcessContext* processContext) : CRepresentativeResolveDependencyNode(processContext) { } CRESOLVEREPRESENTATIVEDependencyNode* CRESOLVEREPRESENTATIVEDependencyNode::initRESOLVEREPRESENTATIVEDependencyNode(CConceptDescriptor* conceptDescriptor, CRepresentativeVariableBindingPathMap* resolveVarBindPathMap, CRepresentativePropagationMap* resolveRepPropMap, CDependencyTrackPoint* prevDependencyTrackPoint, CDependencyTrackPoint* additionalDepTrackPoint) { initRepresentativeResolveDependencyNode(DNTRESOLVEREPRESENTATIVE,conceptDescriptor,resolveVarBindPathMap,resolveRepPropMap); mDepTrackPoint = prevDependencyTrackPoint; if (additionalDepTrackPoint) { addAfterDependency(&mAdditionalDep); mAdditionalDep.initDependency(additionalDepTrackPoint); } updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDATATYPETRIGGERDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDATATYPETRIGGERDependencyN0000644000175000017500000000332412520551056031361 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDATATYPETRIGGERDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CDATATYPETRIGGERDependencyNode::CDATATYPETRIGGERDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CDATATYPETRIGGERDependencyNode* CDATATYPETRIGGERDependencyNode::initDATATYPETRIGGERDependencyNode(CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependency* prevOtherDependencies) { initDependencyNode(DNTDATATYPETRIGGERDEPENDENCY); if (prevOtherDependencies) { addAfterDependency(prevOtherDependencies); } mDepTrackPoint = prevConceptDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CNonDeterministicDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CNonDeterministicDependency0000644000175000017500000001104112520551062032252 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CNONDETERMINISTICDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CNONDETERMINISTICDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDependencyNode.h" #include "CNonDeterministicDependencyTrackPoint.h" // Other includes #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CNonDeterministicDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNonDeterministicDependencyNode : public CDependencyNode { // public methods public: //! Constructor CNonDeterministicDependencyNode(CProcessContext* processContext = nullptr); CNonDeterministicDependencyNode* initNonDeterministicDependencyNode(DEPENDENCNODEYTYPE depType, CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor = nullptr); CNonDeterministicDependencyNode* initNonDeterministicDependencyNode(DEPENDENCNODEYTYPE depType, CBranchTreeNode* branchNode, CIndividualProcessNode* individualNode, CConceptDescriptor* conceptDescriptor = nullptr); virtual CDependencyTrackPoint* getContinueDependencyTrackPoint(); virtual bool isDeterministiDependencyNode(); CNonDeterministicDependencyTrackPoint* getDependencyTrackPointBranch(); bool hasDependencyClashes(); CClashedDependencyDescriptor* getDependencyClashes(); CNonDeterministicDependencyNode* setDependencyClash(CClashedDependencyDescriptor* clash); CNonDeterministicDependencyTrackPoint* getBranchTrackPoints(); CNonDeterministicDependencyTrackPoint* getClashTrackPoint(); CNonDeterministicDependencyTrackPoint* addBranchClashes(CClashedDependencyDescriptor* clash); CNonDeterministicDependencyTrackPoint* getClosingDependencyTrackPoint(); CNonDeterministicDependencyTrackPoint* getClosedDependencyTrackPoint(); CNonDeterministicDependencyNode* setClosingDependencyTrackPoint(CNonDeterministicDependencyTrackPoint* depTrackPoint); CNonDeterministicDependencyNode* setClosedDependencyTrackPoint(CNonDeterministicDependencyTrackPoint* depTrackPoint); bool hasClosingDependencyTrackPoint(CNonDeterministicDependencyTrackPoint* depTrackPoint); bool hasClosedDependencyTrackPoint(CNonDeterministicDependencyTrackPoint* depTrackPoint); bool hasClosingDependencyTrackPoint(); bool hasClosedDependencyTrackPoint(); cint64 getOpenedDependencyTrackingPointsCount(); bool hasMultipleOpenedDependencyTrackingPoints(); bool hasOtherOpenedDependencyTrackingPoints(CNonDeterministicDependencyTrackPoint* depTrackPoint); CBranchTreeNode* getBranchNode(); // protected methods protected: bool updateBranchingTags(); // protected variables protected: CNonDeterministicDependencyTrackPoint* mBranchTrackPoints; CNonDeterministicDependencyTrackPoint mClashTrackPoint; CClashedDependencyDescriptor* mDependencyClashes; CBranchTreeNode* mBranchNode; cint64 mBranchTag; CNonDeterministicDependencyTrackPoint* mClosingTrackPoint; CNonDeterministicDependencyTrackPoint* mClosedTrackPoint; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CNONDETERMINISTICDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDISTINCTDependencyNode.h0000644000175000017500000000434312520551056031263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDISTINCTDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDISTINCTDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CDISTINCTDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDISTINCTDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CDISTINCTDependencyNode(CProcessContext* processContext = nullptr); CDISTINCTDependencyNode* initDISTINCTDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDISTINCTDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CATLEASTDependencyNode.h0000644000175000017500000000433312520551052031132 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CATLEASTDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CATLEASTDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CATLEASTDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CATLEASTDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CATLEASTDependencyNode(CProcessContext* processContext = nullptr); CATLEASTDependencyNode* initATLEASTDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CATLEASTDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDependency.cpp0000644000175000017500000000374212520551056027650 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDependency.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CDependency::CDependency() : CLinkerBase(this,nullptr) { mDepTrackPoint = nullptr; } CDependency* CDependency::initDependency(CDependencyTrackPoint* prevDependencyTrackPoint) { mDepTrackPoint = prevDependencyTrackPoint; return this; } CDependencyTrackPoint* CDependency::getPreviousDependencyTrackPoint() { return mDepTrackPoint; } CDependencyNode* CDependency::getPreviousTrackedDependency() { CDependencyNode* prevDependency = 0; if (mDepTrackPoint) { prevDependency = mDepTrackPoint->getDependencyNode(); } return prevDependency; } CDependency* CDependency::getNextAdditionalDependency() { return getNext(); } CDependency* CDependency::addAdditionalDependency(CDependency* addDependency) { insertNext(addDependency); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATECONNECTIONDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATECONNECTIONDepende0000644000175000017500000000450512520551062031173 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATECONNECTIONDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATECONNECTIONDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CPROPAGATECONNECTIONDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPROPAGATECONNECTIONDependencyNode : public CDeterministicDependencyNode, public CDependency { // public methods public: //! Constructor CPROPAGATECONNECTIONDependencyNode(CProcessContext* processContext = nullptr); CPROPAGATECONNECTIONDependencyNode* initPROPAGATECONNECTIONDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* processIndi, CDependencyTrackPoint* prevDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATECONNECTIONDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEGROUNDINGDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEGROUNDINGD0000644000175000017500000000454012520551070030713 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEGROUNDINGDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEGROUNDINGDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CVARBINDPROPAGATEGROUNDINGDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVARBINDPROPAGATEGROUNDINGDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CVARBINDPROPAGATEGROUNDINGDependencyNode(CProcessContext* processContext = nullptr); CVARBINDPROPAGATEGROUNDINGDependencyNode* initVARBINDPROPAGATEGROUNDINGDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint, CDependency* prevOtherDependencies); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEGROUNDINGDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CMERGEDependencyNode.h0000644000175000017500000000443412520551060030675 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CMERGEDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CMERGEDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CNonDeterministicDependencyNode.h" // Other includes #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CMERGEDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMERGEDependencyNode : public CNonDeterministicDependencyNode { // public methods public: //! Constructor CMERGEDependencyNode(CProcessContext* processContext = nullptr); CMERGEDependencyNode* initMERGEDependencyNode(CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CMERGEDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEALLDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEALLDependenc0000644000175000017500000000460112520551064031302 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEALLDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEALLDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CREPRESENTATIVEALLDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CREPRESENTATIVEALLDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CREPRESENTATIVEALLDependencyNode(CProcessContext* processContext = nullptr); CREPRESENTATIVEALLDependencyNode* initREPRESENTATIVEALLDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint); // protected methods protected: // protected variables protected: CDependency mPrevLinkDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEALLDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CRepresentativeResolveDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CRepresentativeResolveDepen0000644000175000017500000000561612520551064032326 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVERESOLVEDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVERESOLVEDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes #include "Reasoner/Kernel/Process/CRepresentativeVariableBindingPathMap.h" #include "Reasoner/Kernel/Process/CRepresentativePropagationMap.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CRepresentativeResolveDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeResolveDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CRepresentativeResolveDependencyNode(CProcessContext* processContext = nullptr); CRepresentativeResolveDependencyNode* initRepresentativeResolveDependencyNode(DEPENDENCNODEYTYPE depType, CConceptDescriptor* conceptDescriptor = nullptr, CRepresentativeVariableBindingPathMap* resolveVarBindPathMap = nullptr, CRepresentativePropagationMap* resolveRepPropMap = nullptr); virtual bool isRepresentativeResolveDependencyNode(); CRepresentativeVariableBindingPathMap* getResolveRepresentativeVariableBindingPathMap(); CRepresentativePropagationMap* getResolveRepresentativePropagationMap(); // protected methods protected: // protected variables protected: CRepresentativeVariableBindingPathMap* mResolveVarBindPathMap; CRepresentativePropagationMap* mResolveRepPropMap; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVERESOLVEDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLEBINDINGSS0000644000175000017500000000501112520551062030666 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEVARIABLEBINDINGSSUCCESSORDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEVARIABLEBINDINGSSUCCESSORDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode(CProcessContext* processContext = nullptr); CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode* initPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint); // protected methods protected: // protected variables protected: CDependency mPrevLinkDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEVARIABLEBINDINGSSUCCESSORDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDeterministicDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDeterministicDependencyNod0000644000175000017500000000432612520551056032253 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDeterministicDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CDeterministicDependencyNode::CDeterministicDependencyNode(CProcessContext* processContext) : CDependencyNode(processContext),CDependencyTrackPoint(this) { } CDeterministicDependencyNode* CDeterministicDependencyNode::initDeterministicDependencyNode(DEPENDENCNODEYTYPE depType, CConceptDescriptor* conceptDescriptor) { initDependencyNode(depType,conceptDescriptor); return this; } CDeterministicDependencyNode* CDeterministicDependencyNode::initDeterministicDependencyNode(DEPENDENCNODEYTYPE depType, CIndividualProcessNode* individualNode, CConceptDescriptor* conceptDescriptor) { initDependencyNode(depType,individualNode,conceptDescriptor); return this; } CDependencyTrackPoint* CDeterministicDependencyNode::getContinueDependencyTrackPoint() { return this; } bool CDeterministicDependencyNode::isDeterministiDependencyNode() { return true; } bool CDeterministicDependencyNode::updateBranchingTag() { cint64 branchTag = getDependedBranchingLevel(); return updateDependencyTrackPointBranchingTag(this,branchTag); } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEGROUNDINGDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEGROUNDINGDepe0000644000175000017500000000345612520551054031043 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBINDPROPAGATEGROUNDINGDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CBINDPROPAGATEGROUNDINGDependencyNode::CBINDPROPAGATEGROUNDINGDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CBINDPROPAGATEGROUNDINGDependencyNode* CBINDPROPAGATEGROUNDINGDependencyNode::initBINDPROPAGATEGROUNDINGDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint, CDependency* prevOtherDependencies) { initDependencyNode(DNTBINDPROPAGATEGROUNDINGDEPENDENCY,conceptDescriptor); if (prevOtherDependencies) { addAfterDependency(prevOtherDependencies); } mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CRepresentativeSelectDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CRepresentativeSelectDepend0000644000175000017500000000513612520551066032271 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVESELECTDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVESELECTDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes #include "Reasoner/Kernel/Process/CVariableBindingPath.h" #include "Reasoner/Kernel/Process/CConceptDescriptor.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CRepresentativeSelectDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeSelectDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CRepresentativeSelectDependencyNode(CProcessContext* processContext = nullptr); CRepresentativeSelectDependencyNode* initRepresentativeSelectDependencyNode(DEPENDENCNODEYTYPE depType, CConceptDescriptor* conceptDescriptor = nullptr, CVariableBindingPath* selectedVarBindPath = nullptr); virtual bool isRepresentativeSelectDependencyNode(); CVariableBindingPath* getSelectedVariableBindingPath(); // protected methods protected: // protected variables protected: CVariableBindingPath* mSelectedVarBindPath; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVESELECTDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREUSECOMPLETIONGRAPHDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREUSECOMPLETIONGRAPHDepend0000644000175000017500000000337512520551066031173 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CREUSECOMPLETIONGRAPHDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CREUSECOMPLETIONGRAPHDependencyNode::CREUSECOMPLETIONGRAPHDependencyNode(CProcessContext* processContext) : CNonDeterministicDependencyNode(processContext) { } CREUSECOMPLETIONGRAPHDependencyNode* CREUSECOMPLETIONGRAPHDependencyNode::initREUSECOMPLETIONGRAPHDependencyNode(CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint) { initNonDeterministicDependencyNode(DNTREUSECOMPLETIONGRAPHDEPENDENCY,branchNode,individualNode,conceptDescriptor); mDepTrackPoint = depTrackPoint; updateBranchingTags(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDVARIABLEDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDVARIABLEDependencyNode0000644000175000017500000000314712520551054031435 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBINDVARIABLEDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CBINDVARIABLEDependencyNode::CBINDVARIABLEDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CBINDVARIABLEDependencyNode* CBINDVARIABLEDependencyNode::initBINDVARIABLEDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint) { initDependencyNode(DNTBINDVARIABLEDEPENDENCY,conceptDescriptor); mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEIMPLICATIONDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEIMPLICATIONDe0000644000175000017500000000453712520551054030733 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATEIMPLICATIONDependencyNode_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATEIMPLICATIONDependencyNode_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CBINDPROPAGATEIMPLICATIONDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBINDPROPAGATEIMPLICATIONDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CBINDPROPAGATEIMPLICATIONDependencyNode(CProcessContext* processContext = nullptr); CBINDPROPAGATEIMPLICATIONDependencyNode* initBINDPROPAGATEIMPLICATIONDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependency* prevOtherDependencies); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATEIMPLICATIONDependencyNode_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDependencyIterator.h0000644000175000017500000000420412520551056031021 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDEPENDENCYITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDEPENDENCYITERATOR_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDependency.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CDependencyIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDependencyIterator { // public methods public: //! Constructor CDependencyIterator(CDependency* conDependency = nullptr, CDependency* linkDependency = nullptr); bool hasNext(); CDependency* nextDependency(bool moveNext = true); // protected methods protected: // protected variables protected: CDependency* mConDependency; CDependency* mLinkDependency; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDEPENDENCYITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CMERGEDLINKDependencyNode.h0000644000175000017500000000451512520551060031457 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CMERGEDLINKDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CMERGEDLINKDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CMERGEDLINKDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMERGEDLINKDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CMERGEDLINKDependencyNode(CProcessContext* processContext = nullptr); CMERGEDLINKDependencyNode* initMERGEDLINKDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevMergingStepDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint); // protected methods protected: // protected variables protected: CDependency mPrevLinkDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CMERGEDLINKDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEBINDINGSSUCCESSORDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEBINDINGSSUCCESSOR0000644000175000017500000000365612520551062030744 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPROPAGATEBINDINGSSUCCESSORDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CPROPAGATEBINDINGSSUCCESSORDependencyNode::CPROPAGATEBINDINGSSUCCESSORDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { addAfterDependency(&mPrevLinkDep); } CPROPAGATEBINDINGSSUCCESSORDependencyNode* CPROPAGATEBINDINGSSUCCESSORDependencyNode::initPROPAGATEBINDINGSSUCCESSORDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint) { initDependencyNode(DNTPROPAGATEBINDINGSUCCESSORDEPENDENCY,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; mPrevLinkDep.initDependency(prevLinkDependencyTrackPoint); updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CANDDependencyNode.h0000644000175000017500000000421412520551052030435 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CANDDependencyNode_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CANDDependencyNode_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CANDDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CANDDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CANDDependencyNode(CProcessContext* processContext = nullptr); CANDDependencyNode* initANDDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CANDDependencyNode_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CALLDependencyNode.h0000644000175000017500000000442112520551052030443 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CALLDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CALLDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CALLDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CALLDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CALLDependencyNode(CProcessContext* processContext = nullptr); CALLDependencyNode* initALLDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint); // protected methods protected: // protected variables protected: CDependency mPrevLinkDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CALLDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CAUTOMATTRANSACTIONDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CAUTOMATTRANSACTIONDependen0000644000175000017500000000461112520551052031264 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CAUTOMATTRANSACTIONDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CAUTOMATTRANSACTIONDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CAUTOMATTRANSACTIONDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAUTOMATTRANSACTIONDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CAUTOMATTRANSACTIONDependencyNode(CProcessContext* processContext = nullptr); CAUTOMATTRANSACTIONDependencyNode* initAUTOMATTRANSACTIONDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint); // protected methods protected: // protected variables protected: CDependency mPrevLinkDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CAUTOMATTRANSACTIONDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEBINDINGDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEBINDINGDependency0000644000175000017500000000443012520551062031315 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEBINDINGDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEBINDINGDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CPROPAGATEBINDINGDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPROPAGATEBINDINGDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CPROPAGATEBINDINGDependencyNode(CProcessContext* processContext = nullptr); CPROPAGATEBINDINGDependencyNode* initPROPAGATEBINDINGDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint, CDependency* prevOtherDependencies); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEBINDINGDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLEBINDINGSS0000644000175000017500000000374612520551062030703 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode::CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { addAfterDependency(&mPrevLinkDep); } CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode* CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode::initPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint) { initDependencyNode(DNTPROPAGATEVARIABLEBINDINGSUCCESSORDEPENDENCY,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; mPrevLinkDep.initDependency(prevLinkDependencyTrackPoint); updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDependency.h0000644000175000017500000000514312520551056027312 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDEPENDENCY_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDEPENDENCY_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDependencyTrackPoint.h" // Other includes #include "Reasoner/Kernel/Process/CConceptDescriptor.h" #include "Reasoner/Kernel/Process/CProcessContext.h" #include "Reasoner/Kernel/Process/Marker/CMarker.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { using namespace Marker; namespace Dependency { /*! * * \class CDependency * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDependency : public CLinkerBase { // public methods public: //! Constructor CDependency(); CDependency* initDependency(CDependencyTrackPoint* prevDependencyTrackPoint = nullptr); CDependencyTrackPoint* getPreviousDependencyTrackPoint(); CDependencyNode* getPreviousTrackedDependency(); CDependency* getNextAdditionalDependency(); CDependency* addAdditionalDependency(CDependency* addDependency); // protected methods protected: // protected variables protected: CDependencyTrackPoint *mDepTrackPoint; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDEPENDENCY_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREUSECONCEPTSDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREUSECONCEPTSDependencyNod0000644000175000017500000000331412520551066031467 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CREUSECONCEPTSDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CREUSECONCEPTSDependencyNode::CREUSECONCEPTSDependencyNode(CProcessContext* processContext) : CNonDeterministicDependencyNode(processContext) { } CREUSECONCEPTSDependencyNode* CREUSECONCEPTSDependencyNode::initREUSECONCEPTSDependencyNode(CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint) { initNonDeterministicDependencyNode(DNTREUSECONCEPTSDEPENDENCY,branchNode,individualNode,conceptDescriptor); mDepTrackPoint = depTrackPoint; updateBranchingTags(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CROLEASSERTIONDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CROLEASSERTIONDependencyNod0000644000175000017500000000347212520551066031503 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CROLEASSERTIONDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CROLEASSERTIONDependencyNode::CROLEASSERTIONDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CROLEASSERTIONDependencyNode* CROLEASSERTIONDependencyNode::initROLEASSERTIONDependencyNode(CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint) { initDependencyNode(DNTROLEASSERTIONDEPENDENCY,individualNode); mDepTrackPoint = prevConceptDependencyTrackPoint; if (nominalDepTrackPoint) { addAfterDependency(&mAddNominalDep); mAddNominalDep.initDependency(nominalDepTrackPoint); } updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CEXPANDEDDependencyNode.h0000644000175000017500000000427012520551056031231 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CEXPANDEDDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CEXPANDEDDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CEXPANDEDDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEXPANDEDDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CEXPANDEDDependencyNode(CProcessContext* processContext = nullptr); CEXPANDEDDependencyNode* initEXPANDEDDependencyNode(CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependency* prevOtherDependencies); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CEXPANDEDDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLEBINDINGDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLEBINDINGDe0000644000175000017500000000453012520551062030676 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEVARIABLEBINDINGDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEVARIABLEBINDINGDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CPROPAGATEVARIABLEBINDINGDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPROPAGATEVARIABLEBINDINGDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CPROPAGATEVARIABLEBINDINGDependencyNode(CProcessContext* processContext = nullptr); CPROPAGATEVARIABLEBINDINGDependencyNode* initPROPAGATEVARIABLEBINDINGDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint, CDependency* prevOtherDependencies); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEVARIABLEBINDINGDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CMERGEDIndividualDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CMERGEDIndividualDependency0000644000175000017500000000453412520551060031757 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CMERGEDINDIVIDUALDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CMERGEDINDIVIDUALDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CMERGEDIndividualDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMERGEDIndividualDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CMERGEDIndividualDependencyNode(CProcessContext* processContext = nullptr); CMERGEDIndividualDependencyNode* initMERGEDIndividualDependencyNode(CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevMergingStepDependencyTrackPoint, CDependencyTrackPoint* prevIndividualDependencyTrackPoint); // protected methods protected: // protected variables protected: CDependency mPrevIndiDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CMERGEDINDIVIDUALDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CROLEASSERTIONDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CROLEASSERTIONDependencyNod0000644000175000017500000000446412520551066031505 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CROLEASSERTIONDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CROLEASSERTIONDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CROLEASSERTIONDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CROLEASSERTIONDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CROLEASSERTIONDependencyNode(CProcessContext* processContext = nullptr); CROLEASSERTIONDependencyNode* initROLEASSERTIONDependencyNode(CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint); // protected methods protected: // protected variables protected: CDependency mAddNominalDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CROLEASSERTIONDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CRepresentativeResolveDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CRepresentativeResolveDepen0000644000175000017500000000432112520551064032316 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeResolveDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CRepresentativeResolveDependencyNode::CRepresentativeResolveDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CRepresentativeResolveDependencyNode* CRepresentativeResolveDependencyNode::initRepresentativeResolveDependencyNode(DEPENDENCNODEYTYPE depType, CConceptDescriptor* conceptDescriptor, CRepresentativeVariableBindingPathMap* resolveVarBindPathMap, CRepresentativePropagationMap* resolveRepPropMap) { initDeterministicDependencyNode(depType,conceptDescriptor); mResolveVarBindPathMap = resolveVarBindPathMap; mResolveRepPropMap = resolveRepPropMap; return this; } bool CRepresentativeResolveDependencyNode::isRepresentativeResolveDependencyNode() { return true; } CRepresentativeVariableBindingPathMap* CRepresentativeResolveDependencyNode::getResolveRepresentativeVariableBindingPathMap() { return mResolveVarBindPathMap; } CRepresentativePropagationMap* CRepresentativeResolveDependencyNode::getResolveRepresentativePropagationMap() { return mResolveRepPropMap; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEJOINDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEJOINDepend0000644000175000017500000000351012520551070031126 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVARBINDPROPAGATEJOINDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CVARBINDPROPAGATEJOINDependencyNode::CVARBINDPROPAGATEJOINDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { addAfterDependency(&mPrevOtherDep); } CVARBINDPROPAGATEJOINDependencyNode* CVARBINDPROPAGATEJOINDependencyNode::initVARBINDPROPAGATEJOINDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevOtherDependencyTrackPoint) { initDependencyNode(DNTVARBINDPROPAGATEJOIN,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; mPrevOtherDep.initDependency(prevOtherDependencyTrackPoint); updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CNEGVALUEDependencyNode.cpp0000644000175000017500000000352012520551060031572 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNEGVALUEDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CNEGVALUEDependencyNode::CNEGVALUEDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CNEGVALUEDependencyNode* CNEGVALUEDependencyNode::initNEGVALUEDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint) { initDependencyNode(DNTNEGVALUEDEPENDENCY,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; if (nominalDepTrackPoint) { addAfterDependency(&mAddNominalDep); mAddNominalDep.initDependency(nominalDepTrackPoint); } updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CMERGEDCONCEPTDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CMERGEDCONCEPTDependencyNod0000644000175000017500000000450012520551060031414 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CMERGEDCONCEPTDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CMERGEDCONCEPTDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CMERGEDCONCEPTDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMERGEDCONCEPTDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CMERGEDCONCEPTDependencyNode(CProcessContext* processContext = nullptr); CMERGEDCONCEPTDependencyNode* initMERGEDCONCEPTDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevMergingStepDependencyTrackPoint, CDependencyTrackPoint* prevConceptDependencyTrackPoint); // protected methods protected: // protected variables protected: CDependency mPrevLinkDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CMERGEDCONCEPTDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBranchingTree.cpp0000644000175000017500000000753712520551054030311 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBranchingTree.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CBranchingTree::CBranchingTree(CProcessContext* processContext) { mPocessContext = processContext; } CBranchingTree* CBranchingTree::initBranchingTree(CBranchingTree* tree) { mRootNode = nullptr; mCurrNode = nullptr; mPrevCurrNode = nullptr; mBaseDepNode = nullptr; if (tree) { mPrevCurrNode = tree->mPrevCurrNode; mRootNode = tree->mRootNode; mBaseDepNode = tree->mBaseDepNode; } return this; } CBranchTreeNode* CBranchingTree::getBranchTreeNode(Task::CSatisfiableCalculationTask* task, bool forceBranchCreation) { if (mCurrNode) { if (mCurrNode->getSatisfiableCalculationTask() != task) { CBranchTreeNode* branchNode = CObjectParameterizingAllocator< CBranchTreeNode,CProcessContext* >::allocateAndConstructAndParameterize(mPocessContext->getUsedMemoryAllocationManager(),mPocessContext); branchNode->initBranchingCopyNode(mCurrNode,task); mCurrNode = branchNode; mPrevCurrNode = mCurrNode; if (branchNode->isRootNode()) { mRootNode = branchNode; } } if (forceBranchCreation) { CBranchTreeNode* branchNode = CObjectParameterizingAllocator< CBranchTreeNode,CProcessContext* >::allocateAndConstructAndParameterize(mPocessContext->getUsedMemoryAllocationManager(),mPocessContext); branchNode->initBranchingChildNode(mCurrNode,task); mCurrNode = branchNode; mPrevCurrNode = mCurrNode; } } else if (!mCurrNode) { if (mPrevCurrNode) { CBranchTreeNode* branchNode = CObjectParameterizingAllocator< CBranchTreeNode,CProcessContext* >::allocateAndConstructAndParameterize(mPocessContext->getUsedMemoryAllocationManager(),mPocessContext); branchNode->initBranchingChildNode(mPrevCurrNode,task); mCurrNode = branchNode; mPrevCurrNode = mCurrNode; } else { CBranchTreeNode* branchNode = CObjectParameterizingAllocator< CBranchTreeNode,CProcessContext* >::allocateAndConstructAndParameterize(mPocessContext->getUsedMemoryAllocationManager(),mPocessContext); branchNode->initBranchingRootNode(task); mCurrNode = branchNode; mRootNode = branchNode; mPrevCurrNode = mCurrNode; } } return mCurrNode; } CDependencyNode* CBranchingTree::getBaseDependencyNode(bool create) { if (!mBaseDepNode && create) { CIndependentBaseDependencyNode* indBaseDepNode = CObjectParameterizingAllocator< CIndependentBaseDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(mPocessContext->getUsedMemoryAllocationManager(),mPocessContext); indBaseDepNode->initIndependentBaseDependencyNode(); mBaseDepNode = indBaseDepNode; } return mBaseDepNode; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CCONNECTIONDependencyNode.h0000644000175000017500000000433012520551056031475 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CCONNECTIONDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CCONNECTIONDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CCONNECTIONDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCONNECTIONDependencyNode : public CDeterministicDependencyNode, public CDependency { // public methods public: //! Constructor CCONNECTIONDependencyNode(CProcessContext* processContext = nullptr); CCONNECTIONDependencyNode* initCONNECTIONDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CCONNECTIONDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CMERGEDCONCEPTDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CMERGEDCONCEPTDependencyNod0000644000175000017500000000344112520551060031417 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMERGEDCONCEPTDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CMERGEDCONCEPTDependencyNode::CMERGEDCONCEPTDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { addAfterDependency(&mPrevLinkDep); } CMERGEDCONCEPTDependencyNode* CMERGEDCONCEPTDependencyNode::initMERGEDCONCEPTDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevMergingStepDependencyTrackPoint, CDependencyTrackPoint* prevConceptDependencyTrackPoint) { initDependencyNode(DNTMERGEDCONCEPT,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; mPrevLinkDep.initDependency(prevMergingStepDependencyTrackPoint); updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CORDependencyNode.h0000644000175000017500000000433412520551062030357 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CORDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CORDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CNonDeterministicDependencyNode.h" // Other includes #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CORDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CORDependencyNode : public CNonDeterministicDependencyNode { // public methods public: //! Constructor CORDependencyNode(CProcessContext* processContext = nullptr); CORDependencyNode* initORDependencyNode(CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CORDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEIMPLICATIONDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEIMPLICATIOND0000644000175000017500000000454712520551064030751 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEIMPLICATIONDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEIMPLICATIONDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CREPRESENTATIVEIMPLICATIONDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CREPRESENTATIVEIMPLICATIONDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CREPRESENTATIVEIMPLICATIONDependencyNode(CProcessContext* processContext = nullptr); CREPRESENTATIVEIMPLICATIONDependencyNode* initREPRESENTATIVEIMPLICATIONDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependency* prevOtherDependencies); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEIMPLICATIONDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CAUTOMATTRANSACTIONDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CAUTOMATTRANSACTIONDependen0000644000175000017500000000356712520551052031275 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAUTOMATTRANSACTIONDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CAUTOMATTRANSACTIONDependencyNode::CAUTOMATTRANSACTIONDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { addAfterDependency(&mPrevLinkDep); } CAUTOMATTRANSACTIONDependencyNode* CAUTOMATTRANSACTIONDependencyNode::initAUTOMATTRANSACTIONDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint) { initDependencyNode(DNTAUTOMATTRANSACTIONDEPENDENCY,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; mPrevLinkDep.initDependency(prevLinkDependencyTrackPoint); updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBranchTreeNode.h0000644000175000017500000000675212520551054030064 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBRANCHTREENODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBRANCHTREENODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Kernel/Process/CProcessContext.h" #include "Reasoner/Kernel/Process/CBranchingTag.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Task { // forward declaration class CSatisfiableCalculationTask; }; namespace Process { namespace Dependency { //#define KONCLUCE_TASK_ALGORITHM_BRANCH_STRING_INSTRUCTION(a) a #define KONCLUCE_TASK_ALGORITHM_BRANCH_STRING_INSTRUCTION(a) /*! * * \class CBranchTreeNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBranchTreeNode : public CBranchingTag { // public methods public: //! Constructor CBranchTreeNode(CProcessContext* processContext = nullptr); CBranchTreeNode* initBranchingRootNode(Task::CSatisfiableCalculationTask* satCalcTask); CBranchTreeNode* initBranchingChildNode(CBranchTreeNode* parentBranchTreeNode, Task::CSatisfiableCalculationTask* satCalcTask); CBranchTreeNode* initBranchingCopyNode(CBranchTreeNode* copyBranchTreeNode, Task::CSatisfiableCalculationTask* satCalcTask); CBranchTreeNode* getParentNode(); CBranchTreeNode* getRootNode(); bool isRootNode(); cint64 getBranchingLevel(); CBranchTreeNode* branchingIncrement(CNonDeterministicDependencyTrackPoint* depTrackPoint); CNonDeterministicDependencyTrackPoint* getDependencyTrackPoint(); Task::CSatisfiableCalculationTask* getSatisfiableCalculationTask(); KONCLUCE_TASK_ALGORITHM_BRANCH_STRING_INSTRUCTION(CBranchTreeNode* setBranchString(QString* string)); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CBranchTreeNode* mParentNode; CBranchTreeNode* mRootNode; CNonDeterministicDependencyTrackPoint* mBranchedDepTrackPoint; Task::CSatisfiableCalculationTask* mSatCalcTask; KONCLUCE_TASK_ALGORITHM_BRANCH_STRING_INSTRUCTION(QString* mBranchString); // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBRANCHTREENODE_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDATATYPECONNECTIONDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDATATYPECONNECTIONDependen0000644000175000017500000000436112520551056031245 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDATATYPECONNECTIONDependencyNode_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDATATYPECONNECTIONDependencyNode_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CDATATYPECONNECTIONDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDATATYPECONNECTIONDependencyNode : public CDeterministicDependencyNode, public CDependency { // public methods public: //! Constructor CDATATYPECONNECTIONDependencyNode(CProcessContext* processContext = nullptr); CDATATYPECONNECTIONDependencyNode* initDATATYPECONNECTIONDependencyNode(CDependencyTrackPoint* prevDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDATATYPECONNECTIONDependencyNode_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDISTINCTDependencyNode.cpp0000644000175000017500000000322112520551056031610 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDISTINCTDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CDISTINCTDependencyNode::CDISTINCTDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CDISTINCTDependencyNode* CDISTINCTDependencyNode::initDISTINCTDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint) { initDependencyNode(DNTDISTINCTDEPENDENCY,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CMERGEDependencyNode.cpp0000644000175000017500000000322412520551060031224 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMERGEDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CMERGEDependencyNode::CMERGEDependencyNode(CProcessContext* processContext) : CNonDeterministicDependencyNode(processContext) { } CMERGEDependencyNode* CMERGEDependencyNode::initMERGEDependencyNode(CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint) { initNonDeterministicDependencyNode(DNTMERGEDEPENDENCY,branchNode,individualNode,conceptDescriptor); mDepTrackPoint = depTrackPoint; updateBranchingTags(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEALLDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEALLDepende0000644000175000017500000000356412520551066031162 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVARBINDPROPAGATEALLDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CVARBINDPROPAGATEALLDependencyNode::CVARBINDPROPAGATEALLDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { addAfterDependency(&mPrevLinkDep); } CVARBINDPROPAGATEALLDependencyNode* CVARBINDPROPAGATEALLDependencyNode::initVARBINDPROPAGATEALLDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint) { initDependencyNode(DNTVARBINDPROPAGATEALL,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; mPrevLinkDep.initDependency(prevLinkDependencyTrackPoint); updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CIndependentBaseDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CIndependentBaseDependencyN0000644000175000017500000000271712520551060032152 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndependentBaseDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CIndependentBaseDependencyNode::CIndependentBaseDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CIndependentBaseDependencyNode* CIndependentBaseDependencyNode::initIndependentBaseDependencyNode() { initDependencyNode(DNTINDEPENDENTBASE,nullptr,nullptr); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CRepresentativeSelectDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CRepresentativeSelectDepend0000644000175000017500000000360212520551064032263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeSelectDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CRepresentativeSelectDependencyNode::CRepresentativeSelectDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CRepresentativeSelectDependencyNode* CRepresentativeSelectDependencyNode::initRepresentativeSelectDependencyNode(DEPENDENCNODEYTYPE depType, CConceptDescriptor* conceptDescriptor, CVariableBindingPath* selectedVarBindPath) { initDependencyNode(depType,conceptDescriptor); mSelectedVarBindPath = selectedVarBindPath; return this; } bool CRepresentativeSelectDependencyNode::isRepresentativeSelectDependencyNode() { return true; } CVariableBindingPath* CRepresentativeSelectDependencyNode::getSelectedVariableBindingPath() { return mSelectedVarBindPath; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREUSEINDIVIDUALDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREUSEINDIVIDUALDependencyN0000644000175000017500000000455412520551066031365 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREUSEINDIVIDUALDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREUSEINDIVIDUALDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CNonDeterministicDependencyNode.h" // Other includes #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CREUSEINDIVIDUALDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CREUSEINDIVIDUALDependencyNode : public CNonDeterministicDependencyNode { // public methods public: //! Constructor CREUSEINDIVIDUALDependencyNode(CProcessContext* processContext = nullptr); CREUSEINDIVIDUALDependencyNode* initREUSEINDIVIDUALDependencyNode(CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREUSEINDIVIDUALDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CSOMEDependencyNode.h0000644000175000017500000000430312520551066030602 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CSOMEDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CSOMEDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CSOMEDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSOMEDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CSOMEDependencyNode(CProcessContext* processContext = nullptr); CSOMEDependencyNode* initSOMEDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CSOMEDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CORDependencyNode.cpp0000644000175000017500000000311012520551062030701 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CORDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CORDependencyNode::CORDependencyNode(CProcessContext* processContext) : CNonDeterministicDependencyNode(processContext) { } CORDependencyNode* CORDependencyNode::initORDependencyNode(CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint) { initNonDeterministicDependencyNode(DNTORDEPENDENCY,branchNode,conceptDescriptor); mDepTrackPoint = depTrackPoint; updateBranchingTags(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDVARIABLEDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDVARIABLEDependencyN0000644000175000017500000000317412520551070031314 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVARBINDVARIABLEDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CVARBINDVARIABLEDependencyNode::CVARBINDVARIABLEDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CVARBINDVARIABLEDependencyNode* CVARBINDVARIABLEDependencyNode::initVARBINDVARIABLEDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint) { initDependencyNode(DNTVARBINDVARIABLEDEPENDENCY,conceptDescriptor); mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLEBINDINGDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLEBINDINGDe0000644000175000017500000000347412520551062030704 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPROPAGATEVARIABLEBINDINGDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CPROPAGATEVARIABLEBINDINGDependencyNode::CPROPAGATEVARIABLEBINDINGDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CPROPAGATEVARIABLEBINDINGDependencyNode* CPROPAGATEVARIABLEBINDINGDependencyNode::initPROPAGATEVARIABLEBINDINGDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint, CDependency* prevOtherDependencies) { initDependencyNode(DNTPROPAGATEVARIABLEBINDINGDEPENDENCY,conceptDescriptor); if (prevOtherDependencies) { addAfterDependency(prevOtherDependencies); } mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDATATYPECONNECTIONDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDATATYPECONNECTIONDependen0000644000175000017500000000320712520551056031243 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDATATYPECONNECTIONDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CDATATYPECONNECTIONDependencyNode::CDATATYPECONNECTIONDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CDATATYPECONNECTIONDependencyNode* CDATATYPECONNECTIONDependencyNode::initDATATYPECONNECTIONDependencyNode(CDependencyTrackPoint* prevDependencyTrackPoint) { initDependency(this); initDependencyNode(DNTDATATYPECONNECTIONDEPENDENCY); CDependencyNode::mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CNOMINALDependencyNode.h0000644000175000017500000000445312520551060031134 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CNOMINALDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CNOMINALDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CNOMINALDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNOMINALDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CNOMINALDependencyNode(CProcessContext* processContext = nullptr); CNOMINALDependencyNode* initNOMINALDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint); // protected methods protected: // protected variables protected: CDependency mAddNominalDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CNOMINALDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CNEGVALUEDependencyNode.h0000644000175000017500000000446312520551060031246 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CNEGVALUEDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CNEGVALUEDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CNEGVALUEDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNEGVALUEDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CNEGVALUEDependencyNode(CProcessContext* processContext = nullptr); CNEGVALUEDependencyNode* initNEGVALUEDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint); // protected methods protected: // protected variables protected: CDependency mAddNominalDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CNEGVALUEDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATECONNECTIONDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATECONNECTIONDepende0000644000175000017500000000337012520551062031172 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPROPAGATECONNECTIONDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CPROPAGATECONNECTIONDependencyNode::CPROPAGATECONNECTIONDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CPROPAGATECONNECTIONDependencyNode* CPROPAGATECONNECTIONDependencyNode::initPROPAGATECONNECTIONDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* processIndi, CDependencyTrackPoint* prevDependencyTrackPoint) { initDependency(this); initDependencyNode(DNTPROPAGATECONNECTIONDEPENDENCY,processIndi,conceptDescriptor); CDependencyNode::mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLECONNECTIONDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLECONNECTIO0000644000175000017500000000346012520551062030675 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPROPAGATEVARIABLECONNECTIONDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CPROPAGATEVARIABLECONNECTIONDependencyNode::CPROPAGATEVARIABLECONNECTIONDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CPROPAGATEVARIABLECONNECTIONDependencyNode* CPROPAGATEVARIABLECONNECTIONDependencyNode::initPROPAGATEVARIABLECONNECTIONDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* processIndi, CDependencyTrackPoint* prevDependencyTrackPoint) { initDependency(this); initDependencyNode(DNTPROPAGATEVARIABLECONNECTIONDEPENDENCY,processIndi,conceptDescriptor); CDependencyNode::mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDeterministicDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CDeterministicDependencyNod0000644000175000017500000000512312520551056032247 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDETERMINISTICDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDETERMINISTICDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDependencyNode.h" #include "CDependencyTrackPoint.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CDeterministicDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDeterministicDependencyNode : public CDependencyNode, public CDependencyTrackPoint { // public methods public: //! Constructor CDeterministicDependencyNode(CProcessContext* processContext = nullptr); CDeterministicDependencyNode* initDeterministicDependencyNode(DEPENDENCNODEYTYPE depType, CConceptDescriptor* conceptDescriptor = nullptr); CDeterministicDependencyNode* initDeterministicDependencyNode(DEPENDENCNODEYTYPE depType, CIndividualProcessNode* individualNode, CConceptDescriptor* conceptDescriptor = nullptr); virtual CDependencyTrackPoint* getContinueDependencyTrackPoint(); virtual bool isDeterministiDependencyNode(); // protected methods protected: bool updateBranchingTag(); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CDETERMINISTICDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEIMPLICATIONDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEIMPLICATIO0000644000175000017500000000456712520551070030716 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEIMPLICATIONDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEIMPLICATIONDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CVARBINDPROPAGATEIMPLICATIONDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVARBINDPROPAGATEIMPLICATIONDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CVARBINDPROPAGATEIMPLICATIONDependencyNode(CProcessContext* processContext = nullptr); CVARBINDPROPAGATEIMPLICATIONDependencyNode* initVARBINDPROPAGATEIMPLICATIONDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependency* prevOtherDependencies); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEIMPLICATIONDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLECONNECTIONDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLECONNECTIO0000644000175000017500000000460512520551064030701 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEVARIABLECONNECTIONDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEVARIABLECONNECTIONDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CPROPAGATEVARIABLECONNECTIONDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPROPAGATEVARIABLECONNECTIONDependencyNode : public CDeterministicDependencyNode, public CDependency { // public methods public: //! Constructor CPROPAGATEVARIABLECONNECTIONDependencyNode(CProcessContext* processContext = nullptr); CPROPAGATEVARIABLECONNECTIONDependencyNode* initPROPAGATEVARIABLECONNECTIONDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* processIndi, CDependencyTrackPoint* prevDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CPROPAGATEVARIABLECONNECTIONDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEGROUNDINGDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEGROUNDINGDep0000644000175000017500000000463612520551064031061 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEGROUNDINGDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEGROUNDINGDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CRepresentativeSelectDependencyNode.h" // Other includes #include "Reasoner/Kernel/Process/CVariableBindingPath.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CREPRESENTATIVEGROUNDINGDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CREPRESENTATIVEGROUNDINGDependencyNode : public CRepresentativeSelectDependencyNode { // public methods public: //! Constructor CREPRESENTATIVEGROUNDINGDependencyNode(CProcessContext* processContext = nullptr); CREPRESENTATIVEGROUNDINGDependencyNode* initREPRESENTATIVEGROUNDINGDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint, CVariableBindingPath* selectedVarBindPath); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CREPRESENTATIVEGROUNDINGDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CMERGEDLINKDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CMERGEDLINKDependencyNode.c0000644000175000017500000000347512520551060031456 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMERGEDLINKDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CMERGEDLINKDependencyNode::CMERGEDLINKDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { addAfterDependency(&mPrevLinkDep); } CMERGEDLINKDependencyNode* CMERGEDLINKDependencyNode::initMERGEDLINKDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevMergingStepDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint) { initDependencyNode(DNTMERGEDLINK,individualNode,conceptDescriptor); mDepTrackPoint = prevLinkDependencyTrackPoint; mPrevLinkDep.initDependency(prevMergingStepDependencyTrackPoint); updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEANDDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEANDDependency0000644000175000017500000000317112520551054031304 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBINDPROPAGATEANDDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CBINDPROPAGATEANDDependencyNode::CBINDPROPAGATEANDDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CBINDPROPAGATEANDDependencyNode* CBINDPROPAGATEANDDependencyNode::initBINDPROPAGATEANDDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint) { initDependencyNode(DNTBINDPROPAGATEAND,conceptDescriptor); mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CMERGEDIndividualDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CMERGEDIndividualDependency0000644000175000017500000000347212520551060031757 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMERGEDIndividualDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CMERGEDIndividualDependencyNode::CMERGEDIndividualDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { addAfterDependency(&mPrevIndiDep); } CMERGEDIndividualDependencyNode* CMERGEDIndividualDependencyNode::initMERGEDIndividualDependencyNode(CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevMergingStepDependencyTrackPoint, CDependencyTrackPoint* prevIndividualDependencyTrackPoint) { initDependencyNode(DNTMERGEDINDIVIDUAL,individualNode); mDepTrackPoint = prevIndividualDependencyTrackPoint; mPrevIndiDep.initDependency(prevMergingStepDependencyTrackPoint); updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREUSEINDIVIDUALDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREUSEINDIVIDUALDependencyN0000644000175000017500000000333212520551066031356 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CREUSEINDIVIDUALDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CREUSEINDIVIDUALDependencyNode::CREUSEINDIVIDUALDependencyNode(CProcessContext* processContext) : CNonDeterministicDependencyNode(processContext) { } CREUSEINDIVIDUALDependencyNode* CREUSEINDIVIDUALDependencyNode::initREUSEINDIVIDUALDependencyNode(CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint) { initNonDeterministicDependencyNode(DNTREUSEINDIVIDUALDEPENDENCY,branchNode,individualNode,conceptDescriptor); mDepTrackPoint = depTrackPoint; updateBranchingTags(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEIMPLICATIONDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEIMPLICATIO0000644000175000017500000000352712520551070030711 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVARBINDPROPAGATEIMPLICATIONDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CVARBINDPROPAGATEIMPLICATIONDependencyNode::CVARBINDPROPAGATEIMPLICATIONDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CVARBINDPROPAGATEIMPLICATIONDependencyNode* CVARBINDPROPAGATEIMPLICATIONDependencyNode::initVARBINDPROPAGATEIMPLICATIONDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependency* prevOtherDependencies) { initDependencyNode(DNTVARBINDPROPAGATEIMPLICATION,conceptDescriptor); if (prevOtherDependencies) { addAfterDependency(prevOtherDependencies); } mDepTrackPoint = prevConceptDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CALLDependencyNode.cpp0000644000175000017500000000341612520551052031001 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CALLDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CALLDependencyNode::CALLDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { addAfterDependency(&mPrevLinkDep); } CALLDependencyNode* CALLDependencyNode::initALLDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint) { initDependencyNode(DNTALLDEPENDENCY,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; mPrevLinkDep.initDependency(prevLinkDependencyTrackPoint); updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CIMPLICATIONDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CIMPLICATIONDependencyNode.0000644000175000017500000000336112520551060031434 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIMPLICATIONDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CIMPLICATIONDependencyNode::CIMPLICATIONDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CIMPLICATIONDependencyNode* CIMPLICATIONDependencyNode::initIMPLICATIONDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependency* prevOtherDependencies) { initDependencyNode(DNTIMPLICATIONDEPENDENCY,conceptDescriptor); if (prevOtherDependencies) { addAfterDependency(prevOtherDependencies); } mDepTrackPoint = prevConceptDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEJOINDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEJOINDepend0000644000175000017500000000456312520551070031137 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEJOINDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEJOINDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CVARBINDPROPAGATEJOINDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVARBINDPROPAGATEJOINDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CVARBINDPROPAGATEJOINDependencyNode(CProcessContext* processContext = nullptr); CVARBINDPROPAGATEJOINDependencyNode* initVARBINDPROPAGATEJOINDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevOtherDependencyTrackPoint); // protected methods protected: // protected variables protected: CDependency mPrevOtherDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEJOINDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CQUALIFYDependencyNode.h0000644000175000017500000000445412520551064031156 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CQUALIFYDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CQUALIFYDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CNonDeterministicDependencyNode.h" // Other includes #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CQUALIFYDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQUALIFYDependencyNode : public CNonDeterministicDependencyNode { // public methods public: //! Constructor CQUALIFYDependencyNode(CProcessContext* processContext = nullptr); CQUALIFYDependencyNode* initQUALIFYDependencyNode(CBranchTreeNode* branchNode, CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CQUALIFYDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEALLDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEALLDependenc0000644000175000017500000000354612520551064031311 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CREPRESENTATIVEALLDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CREPRESENTATIVEALLDependencyNode::CREPRESENTATIVEALLDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { addAfterDependency(&mPrevLinkDep); } CREPRESENTATIVEALLDependencyNode* CREPRESENTATIVEALLDependencyNode::initREPRESENTATIVEALLDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevLinkDependencyTrackPoint) { initDependencyNode(DNTREPRESENTATIVEALL,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; mPrevLinkDep.initDependency(prevLinkDependencyTrackPoint); updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEANDDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEANDDepende0000644000175000017500000000441412520551070031142 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEANDDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEANDDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CVARBINDPROPAGATEANDDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVARBINDPROPAGATEANDDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CVARBINDPROPAGATEANDDependencyNode(CProcessContext* processContext = nullptr); CVARBINDPROPAGATEANDDependencyNode* initVARBINDPROPAGATEANDDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CVARBINDPROPAGATEANDDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CIMPLICATIONDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CIMPLICATIONDependencyNode.0000644000175000017500000000436712520551060031443 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CIMPLICATIONDependencyNode_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CIMPLICATIONDependencyNode_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CIMPLICATIONDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIMPLICATIONDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CIMPLICATIONDependencyNode(CProcessContext* processContext = nullptr); CIMPLICATIONDependencyNode* initIMPLICATIONDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependency* prevOtherDependencies); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CIMPLICATIONDependencyNode_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CAUTOMATCHOOSEDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CAUTOMATCHOOSEDependencyNod0000644000175000017500000000316012520551052031452 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAUTOMATCHOOSEDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CAUTOMATCHOOSEDependencyNode::CAUTOMATCHOOSEDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CAUTOMATCHOOSEDependencyNode* CAUTOMATCHOOSEDependencyNode::initAUTOMATCHOOSEDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint) { initDependencyNode(DNTAUTOMATCHOOSEDEPENDENCY,conceptDescriptor); mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CSELFDependencyNode.h0000644000175000017500000000430312520551066030570 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CSELFDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CSELFDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CSELFDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSELFDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CSELFDependencyNode(CProcessContext* processContext = nullptr); CSELFDependencyNode* initSELFDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CSELFDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEANDDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEANDDependenc0000644000175000017500000000320212520551064031270 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CREPRESENTATIVEANDDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CREPRESENTATIVEANDDependencyNode::CREPRESENTATIVEANDDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CREPRESENTATIVEANDDependencyNode* CREPRESENTATIVEANDDependencyNode::initREPRESENTATIVEANDDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint) { initDependencyNode(DNTREPRESENTATIVEAND,conceptDescriptor); mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CSOMEDependencyNode.cpp0000644000175000017500000000316512520551066031142 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSOMEDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CSOMEDependencyNode::CSOMEDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CSOMEDependencyNode* CSOMEDependencyNode::initSOMEDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint) { initDependencyNode(DNTSOMEDEPENDENCY,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEANDDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEANDDepende0000644000175000017500000000321612520551070031141 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVARBINDPROPAGATEANDDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CVARBINDPROPAGATEANDDependencyNode::CVARBINDPROPAGATEANDDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CVARBINDPROPAGATEANDDependencyNode* CVARBINDPROPAGATEANDDependencyNode::initVARBINDPROPAGATEANDDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint) { initDependencyNode(DNTVARBINDPROPAGATEAND,conceptDescriptor); mDepTrackPoint = prevDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CIndependentBaseDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CIndependentBaseDependencyN0000644000175000017500000000422612520551060032147 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CINDEPENDENTBASEDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CINDEPENDENTBASEDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CIndependentBaseDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndependentBaseDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CIndependentBaseDependencyNode(CProcessContext* processContext = nullptr); CIndependentBaseDependencyNode* initIndependentBaseDependencyNode(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CINDEPENDENTBASEDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CNonDeterministicDependencyTrackPoint.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CNonDeterministicDependency0000644000175000017500000000600512520551062032256 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CNONDETERMINISTICDEPENDENCYTRACKPOINT_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CNONDETERMINISTICDEPENDENCYTRACKPOINT_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDependencyTrackPoint.h" // Other includes #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CNonDeterministicDependencyTrackPoint * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNonDeterministicDependencyTrackPoint : public CDependencyTrackPoint, public CLinkerBase { // public methods public: //! Constructor CNonDeterministicDependencyTrackPoint(CDependencyNode* depNode = nullptr); CNonDeterministicDependencyTrackPoint* initBranch(CBranchTreeNode* branchNode = nullptr); CClashedDependencyDescriptor* getClashes(); CNonDeterministicDependencyTrackPoint* addClashes(CClashedDependencyDescriptor* clashes, bool setClashed = true); CNonDeterministicDependencyTrackPoint* setClashes(CClashedDependencyDescriptor* clashes, bool setClashed = true); CNonDeterministicDependencyTrackPoint* setClashedOrIrelevantBranch(bool clashedOrIrelevant = true); CBranchTreeNode* getBranchNode(); bool isClashedOrIrelevantBranch(); // protected methods protected: // protected variables protected: CClashedDependencyDescriptor* mClashes; CBranchTreeNode* mBranchNode; bool mClashedIrelevant; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CNONDETERMINISTICDEPENDENCYTRACKPOINT_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CAUTOMATCHOOSEDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CAUTOMATCHOOSEDependencyNod0000644000175000017500000000433412520551052031456 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CAUTOMATCHOOSEDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CAUTOMATCHOOSEDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CAUTOMATCHOOSEDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAUTOMATCHOOSEDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CAUTOMATCHOOSEDependencyNode(CProcessContext* processContext = nullptr); CAUTOMATCHOOSEDependencyNode* initAUTOMATCHOOSEDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevDependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CAUTOMATCHOOSEDEPENDENCYNODE_H ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEIMPLICATIONDependencyNode.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEIMPLICATIONDe0000644000175000017500000000350212520551054030722 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBINDPROPAGATEIMPLICATIONDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CBINDPROPAGATEIMPLICATIONDependencyNode::CBINDPROPAGATEIMPLICATIONDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CBINDPROPAGATEIMPLICATIONDependencyNode* CBINDPROPAGATEIMPLICATIONDependencyNode::initBINDPROPAGATEIMPLICATIONDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependency* prevOtherDependencies) { initDependencyNode(DNTBINDPROPAGATEIMPLICATION,conceptDescriptor); if (prevOtherDependencies) { addAfterDependency(prevOtherDependencies); } mDepTrackPoint = prevConceptDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATECYCLEDependencyNode.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATECYCLEDependen0000644000175000017500000000454312520551054031211 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATECYCLEDEPENDENCYNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATECYCLEDEPENDENCYNODE_H // Libraries includes // Namespace includes #include "DependencySettings.h" #include "CDeterministicDependencyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { /*! * * \class CBINDPROPAGATECYCLEDependencyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBINDPROPAGATECYCLEDependencyNode : public CDeterministicDependencyNode { // public methods public: //! Constructor CBINDPROPAGATECYCLEDependencyNode(CProcessContext* processContext = nullptr); CBINDPROPAGATECYCLEDependencyNode* initBINDPROPAGATECYCLEDependencyNode(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* prevConceptDependencyTrackPoint, CDependencyTrackPoint* prevTriggDependencyTrackPoint); // protected methods protected: // protected variables protected: CDependency mPrevTriggDep; // private methods private: // private variables private: }; }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_DEPENDENCY_CBINDPROPAGATECYCLEDEPENDENCYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Dependency/CSELFDependencyNode.cpp0000644000175000017500000000316512520551066031130 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSELFDependencyNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Dependency { CSELFDependencyNode::CSELFDependencyNode(CProcessContext* processContext) : CDeterministicDependencyNode(processContext) { } CSELFDependencyNode* CSELFDependencyNode::initSELFDependencyNode(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode* individualNode, CDependencyTrackPoint* prevConceptDependencyTrackPoint) { initDependencyNode(DNTSELFDEPENDENCY,individualNode,conceptDescriptor); mDepTrackPoint = prevConceptDependencyTrackPoint; updateBranchingTag(); return this; } }; // end namespace Dependency }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeFUNCTIONALConceptsExtensionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeFUNCTIONALCon0000644000175000017500000003673512520551154031735 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationIndividualNodeFUNCTIONALConceptsExtensionData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::CSaturationIndividualNodeFUNCTIONALConceptsExtensionData(CProcessContext* processContext) : mLinkedSuccRoleFUNCTIONALConceptExtHash(processContext), mLinkedPredRoleFUNCTIONALConceptExtHash(processContext) { mProcessContext = processContext; } CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::initFUNCTIONALConceptsExtensionData(CIndividualSaturationProcessNode* indiProcessNode) { mLinkedSuccRoleFUNCTIONALConceptExtHash.initLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash(); mLinkedPredRoleFUNCTIONALConceptExtHash.initLinkedPredecessorRoleFUNCTIONALConceptsExtensionHash(); mIndiProcessNode = indiProcessNode; mLinkedSuccessorAddedRoleProcessLinker = nullptr; mLinkedPredecessorAddedRoleProcessLinker = nullptr; mQualFuncAtmostConProcessLinker = nullptr; mFunctionalityAddedRoleProcessLinker = nullptr; mCopyingInitializingRoleProcessLinker = nullptr; mSuccessorExtensionInitialized = false; mExtensionProcessingQueued = false; mSuccessorExtensionProcessLinker = nullptr; mPredecessorExtensionProcessLinker = nullptr; mForwardingPredMergedHash = nullptr; mQualifiedFunctionalAtmostConceptProcessSet = nullptr; return this; } CRoleSaturationProcessLinker* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::getLinkedSuccessorAddedRoleProcessLinker() { return mLinkedSuccessorAddedRoleProcessLinker; } CRoleSaturationProcessLinker* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::takeLinkedSuccessorAddedRoleProcessLinker() { CRoleSaturationProcessLinker* tmpRoleProcessLinker = mLinkedSuccessorAddedRoleProcessLinker; mLinkedSuccessorAddedRoleProcessLinker = nullptr; return tmpRoleProcessLinker; } bool CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::isSuccessorExtensionInitialized() { return mSuccessorExtensionInitialized; } CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::setSuccessorExtensionInitialized(bool initialized) { mSuccessorExtensionInitialized = initialized; return this; } CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::addLinkedSuccessorAddedRoleProcessLinker(CRoleSaturationProcessLinker* roleProcessLinker) { if (roleProcessLinker) { mLinkedSuccessorAddedRoleProcessLinker = roleProcessLinker->append(mLinkedSuccessorAddedRoleProcessLinker); } return this; } bool CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::hasLinkedSuccessorAddedProcessLinkerForRole(CRole* role) { cint64 maxTestCount = 10; for (CRoleSaturationProcessLinker* roleProcessLinkerIt = mLinkedSuccessorAddedRoleProcessLinker; roleProcessLinkerIt && --maxTestCount > 0; roleProcessLinkerIt = roleProcessLinkerIt->getNext()) { if (roleProcessLinkerIt->getRole() == role) { return true; } } return false; } CRoleSaturationProcessLinker* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::getFunctionalityAddedRoleProcessLinker() { return mFunctionalityAddedRoleProcessLinker; } CRoleSaturationProcessLinker* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::takeFunctionalityAddedRoleProcessLinker() { CRoleSaturationProcessLinker* tmpRoleProcessLinker = mFunctionalityAddedRoleProcessLinker; mFunctionalityAddedRoleProcessLinker = nullptr; return tmpRoleProcessLinker; } CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::addFunctionalityAddedRoleProcessLinker(CRoleSaturationProcessLinker* roleProcessLinker) { if (roleProcessLinker) { mFunctionalityAddedRoleProcessLinker = roleProcessLinker->append(mFunctionalityAddedRoleProcessLinker); } return this; } bool CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::hasFunctionalityAddedProcessLinkerForRole(CRole* role) { cint64 maxTestCount = 10; for (CRoleSaturationProcessLinker* roleProcessLinkerIt = mFunctionalityAddedRoleProcessLinker; roleProcessLinkerIt && --maxTestCount > 0; roleProcessLinkerIt = roleProcessLinkerIt->getNext()) { if (roleProcessLinkerIt->getRole() == role) { return true; } } return false; } CRoleSaturationProcessLinker* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::getCopyingInitializingRoleProcessLinker() { return mCopyingInitializingRoleProcessLinker; } CRoleSaturationProcessLinker* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::takeCopyingInitializingRoleProcessLinker() { CRoleSaturationProcessLinker* tmpRoleProcessLinker = mCopyingInitializingRoleProcessLinker; mCopyingInitializingRoleProcessLinker = nullptr; return tmpRoleProcessLinker; } CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::addCopyingInitializingRoleProcessLinker(CRoleSaturationProcessLinker* roleProcessLinker) { if (roleProcessLinker) { mCopyingInitializingRoleProcessLinker = roleProcessLinker->append(mCopyingInitializingRoleProcessLinker); } return this; } bool CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::hasCopyingInitializingProcessLinkerForRole(CRole* role) { cint64 maxTestCount = 10; for (CRoleSaturationProcessLinker* roleProcessLinkerIt = mCopyingInitializingRoleProcessLinker; roleProcessLinkerIt && --maxTestCount > 0; roleProcessLinkerIt = roleProcessLinkerIt->getNext()) { if (roleProcessLinkerIt->getRole() == role) { return true; } } return false; } bool CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::isExtensionProcessingQueued() { return mExtensionProcessingQueued; } CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::setExtensionProcessingQueued(bool queued) { mExtensionProcessingQueued = queued; return this; } CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::getLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash() { return &mLinkedSuccRoleFUNCTIONALConceptExtHash; } CSaturationSuccessorFUNCTIONALConceptExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::getSuccessorFUNCTIONALConceptsExtensionData(CRole* role, bool create) { return mLinkedSuccRoleFUNCTIONALConceptExtHash.getSuccessorFunctionalConceptsExtensionData(role); } bool CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::hasSuccessorExtensionProcessData() { return mSuccessorExtensionProcessLinker != nullptr; } CSaturationSuccessorFUNCTIONALConceptExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::takeNextSuccessorExtensionProcessData() { CSaturationSuccessorFUNCTIONALConceptExtensionData* tmpExtProcessLinker = mSuccessorExtensionProcessLinker; if (mSuccessorExtensionProcessLinker) { mSuccessorExtensionProcessLinker = mSuccessorExtensionProcessLinker->getNext(); tmpExtProcessLinker->clearNext(); } return tmpExtProcessLinker; } CSaturationSuccessorFUNCTIONALConceptExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::getSuccessorExtensionProcessDataLinker() { return mSuccessorExtensionProcessLinker; } CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::addSuccessorExtensionProcessData(CSaturationSuccessorFUNCTIONALConceptExtensionData* processData) { mSuccessorExtensionProcessLinker = processData->append(mSuccessorExtensionProcessLinker); return this; } CRoleSaturationProcessLinker* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::getLinkedPredecessorAddedRoleProcessLinker() { return mLinkedPredecessorAddedRoleProcessLinker; } CRoleSaturationProcessLinker* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::takeLinkedPredecessorAddedRoleProcessLinker() { CRoleSaturationProcessLinker* tmpRoleProcessLinker = mLinkedPredecessorAddedRoleProcessLinker; mLinkedPredecessorAddedRoleProcessLinker = nullptr; return tmpRoleProcessLinker; } CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::addLinkedPredecessorAddedRoleProcessLinker(CRoleSaturationProcessLinker* roleProcessLinker) { if (roleProcessLinker) { mLinkedPredecessorAddedRoleProcessLinker = roleProcessLinker->append(mLinkedPredecessorAddedRoleProcessLinker); } return this; } bool CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::hasLinkedPredecessorAddedProcessLinkerForRole(CRole* role) { cint64 maxTestCount = 10; for (CRoleSaturationProcessLinker* roleProcessLinkerIt = mLinkedPredecessorAddedRoleProcessLinker; roleProcessLinkerIt && --maxTestCount > 0; roleProcessLinkerIt = roleProcessLinkerIt->getNext()) { if (roleProcessLinkerIt->getRole() == role) { return true; } } return false; } CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::getPredecessorRoleFUNCTIONALConceptsExtensionHash() { return &mLinkedPredRoleFUNCTIONALConceptExtHash; } CSaturationPredecessorFUNCTIONALConceptExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::getPredecessorFUNCTIONALConceptsExtensionData(CRole* role, bool create) { return mLinkedPredRoleFUNCTIONALConceptExtHash.getPredecessorFunctionalConceptsExtensionData(role); } bool CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::hasPredecessorExtensionProcessData() { return mPredecessorExtensionProcessLinker != nullptr; } CSaturationPredecessorFUNCTIONALConceptExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::takeNextPredecessorExtensionProcessData() { CSaturationPredecessorFUNCTIONALConceptExtensionData* tmpExtProcessLinker = mPredecessorExtensionProcessLinker; if (mPredecessorExtensionProcessLinker) { mPredecessorExtensionProcessLinker = mPredecessorExtensionProcessLinker->getNext(); tmpExtProcessLinker->clearNext(); } return tmpExtProcessLinker; } CSaturationPredecessorFUNCTIONALConceptExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::getPredecessorExtensionProcessDataLinker() { return mPredecessorExtensionProcessLinker; } CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::addPredecessorExtensionProcessData(CSaturationPredecessorFUNCTIONALConceptExtensionData* processData) { mPredecessorExtensionProcessLinker = processData->append(mPredecessorExtensionProcessLinker); return this; } CPROCESSHASH* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::getForwardingPredecessorMergedHash(bool create) { if (create && !mForwardingPredMergedHash) { mForwardingPredMergedHash = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); } return mForwardingPredMergedHash; } bool CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::hasIndividualNodeForwardingPredecessorMerged(CIndividualSaturationProcessNode* indiNode) { if (mForwardingPredMergedHash) { return mForwardingPredMergedHash->contains(indiNode); } return false; } bool CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::hasIndividualNodeForwardingPredecessorMerged(CIndividualSaturationProcessNode* indiNode, CRole* role) { if (!mForwardingPredMergedHash) { return false; } for (CPROCESSHASH::const_iterator it = mForwardingPredMergedHash->constFind(indiNode), itEnd = mForwardingPredMergedHash->constEnd(); it != itEnd; ++it) { if (it.key() == indiNode) { if (it.value() == role) { return true; } } else { break; } } return false; } CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::setIndividualNodeForwardingPredecessorMerged(CIndividualSaturationProcessNode* indiNode, CRole* role) { if (!hasIndividualNodeForwardingPredecessorMerged(indiNode,role)) { getForwardingPredecessorMergedHash(true)->insertMulti(indiNode,role); } return this; } CConceptSaturationProcessLinker* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::getQualifiedFunctionalAtmostConceptProcessLinker() { return mQualFuncAtmostConProcessLinker; } CConceptSaturationProcessLinker* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::takeQualifiedFunctionalAtmostConceptProcessLinker() { CConceptSaturationProcessLinker* tmpConProcessLinker = mQualFuncAtmostConProcessLinker; mQualFuncAtmostConProcessLinker = nullptr; return tmpConProcessLinker; } CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::addQualifiedFunctionalAtmostConceptProcessLinker(CConceptSaturationProcessLinker* conceptProcessLinker) { if (conceptProcessLinker) { if (!mQualifiedFunctionalAtmostConceptProcessSet) { mQualifiedFunctionalAtmostConceptProcessSet = CObjectParameterizingAllocator< CPROCESSSET,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); } mQualifiedFunctionalAtmostConceptProcessSet->insert(conceptProcessLinker->getConceptSaturationDescriptor()); mQualFuncAtmostConProcessLinker = conceptProcessLinker->append(mQualFuncAtmostConProcessLinker); } return this; } bool CSaturationIndividualNodeFUNCTIONALConceptsExtensionData::hasQualifiedFunctionalAtmostConceptProcessLinkerForConcept(CConceptSaturationDescriptor* conDes) { if (mQualifiedFunctionalAtmostConceptProcessSet && mQualifiedFunctionalAtmostConceptProcessSet->contains(conDes)) { return true; } return false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptLabelSetModificationTag.h0000644000175000017500000000604112520551100031133 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTLABELSETMODIFICATIONTAG_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTLABELSETMODIFICATIONTAG_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessTag.h" #include "CProcessTagger.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConceptLabelSetModificationTag * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptLabelSetModificationTag : public CProcessTag { // public methods public: //! Constructor CConceptLabelSetModificationTag(cint64 conceptLabelSetModificationTag = 0); //! Destructor virtual ~CConceptLabelSetModificationTag(); cint64 getConceptLabelSetModificationTag(); CConceptLabelSetModificationTag* setConceptLabelSetModificationTag(cint64 conceptLabelSetModificationTag); CConceptLabelSetModificationTag* setConceptLabelSetModificationTag(CProcessTagger* processTagger); CConceptLabelSetModificationTag* initConceptLabelSetModificationTag(cint64 conceptLabelSetModificationTag); CConceptLabelSetModificationTag* initConceptLabelSetModificationTag(CProcessTagger* processTagger); bool updateConceptLabelSetModificationTag(cint64 conceptLabelSetModificationTag); bool updateConceptLabelSetModificationTag(CProcessTagger* processTagger); bool isConceptLabelSetModificationTagUpdated(cint64 conceptLabelSetModificationTag); bool isConceptLabelSetModificationTagUpToDate(cint64 conceptLabelSetModificationTag); bool isConceptLabelSetModificationTagUpdated(CProcessTagger* processTagger); bool isConceptLabelSetModificationTagUpToDate(CProcessTagger* processTagger); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTLABELSETMODIFICATIONTAG_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceMapArranger.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceMapArranger.0000644000175000017500000000446312520551110032154 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUESPACEMAPARRANGER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUESPACEMAPARRANGER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDataLiteralCompareValue.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeCompareValueSpaceMapArranger * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeCompareValueSpaceMapArranger { // public methods public: //! Constructor CDatatypeCompareValueSpaceMapArranger(CDataLiteralCompareValue* value); bool operator<(const CDatatypeCompareValueSpaceMapArranger& valueData) const; bool operator<=(const CDatatypeCompareValueSpaceMapArranger& valueData) const; CDataLiteralCompareValue* getValue() const; // protected methods protected: // protected variables protected: CDataLiteralCompareValue* mValue; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUESPACEMAPARRANGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningHashData.cpp0000644000175000017500000000252412520551144031423 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeJoiningHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeJoiningHashData::CRepresentativeJoiningHashData() { mVarBindPathJoiningData = nullptr; } CRepresentativeJoiningHashData::CRepresentativeJoiningHashData(const CRepresentativeJoiningHashData& data) { mVarBindPathJoiningData = data.mVarBindPathJoiningData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetDataSignature.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetD0000644000175000017500000000421112520551146032261 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathSetDataSignature.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathSetDataSignature::CRepresentativeVariableBindingPathSetDataSignature() { } CRepresentativeVariableBindingPathSetDataSignature* CRepresentativeVariableBindingPathSetDataSignature::initSignature(CRepresentativeVariableBindingPathSetDataSignature* prevSignature) { if (prevSignature) { mIncomingRepPropKey1 = prevSignature->mIncomingRepPropKey1; mIncomingRepPropKey2 = prevSignature->mIncomingRepPropKey2; mIncomingRepPropKey = prevSignature->mIncomingRepPropKey; } else { mIncomingRepPropKey1 = 13; mIncomingRepPropKey2 = 13; mIncomingRepPropKey = 0; } return this; } CRepresentativeVariableBindingPathSetDataSignature* CRepresentativeVariableBindingPathSetDataSignature::addKey(cint64 key) { mIncomingRepPropKey1 += key; mIncomingRepPropKey2 *= key; mIncomingRepPropKey = mIncomingRepPropKey1 + (mIncomingRepPropKey2*17); return this; } cint64 CRepresentativeVariableBindingPathSetDataSignature::getSignatureValue() { return mIncomingRepPropKey; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeDateTimeValueSpaceMap.h0000644000175000017500000000546612520551110030754 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDATETIMEVALUESPACEMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDATETIMEVALUESPACEMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeCompareValueSpaceMap.h" // Other includes #include "Reasoner/Ontology/CDataLiteralBinaryDataValue.h" #include "Reasoner/Ontology/CDatatypeValueSpaceDateTimeType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeDateTimeValueSpaceMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeDateTimeValueSpaceMap : public CDatatypeCompareValueSpaceMap { // public methods public: //! Constructor CDatatypeDateTimeValueSpaceMap(CProcessContext* processContext); CDatatypeDateTimeValueSpaceMap* initDatatypeDateTimeValueSpaceMap(CDatatypeValueSpaceDateTimeType* valueSpaceType); // protected methods protected: virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* value); virtual bool getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom); virtual bool getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast); virtual cuint64 getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDATETIMEVALUESPACEMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleBackwardPropagationHash.cpp0000644000175000017500000000436112520551150031055 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleBackwardPropagationHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRoleBackwardPropagationHash::CRoleBackwardPropagationHash(CProcessContext* context) : mContext(context),mRoleBackPropDataHash(context) { } CBackwardPropagationReapplyDescriptor* CRoleBackwardPropagationHash::addBackwardPropagationLink(CRole* role, CBackwardPropagationLink* link) { CRoleBackwardPropagationHashData& backPropData = mRoleBackPropDataHash[role]; if (backPropData.mLinkLinker) { if (backPropData.mLinkLinker->getSourceIndividual() == link->getSourceIndividual()) { return nullptr; } } backPropData.mLinkLinker = link->append(backPropData.mLinkLinker); return backPropData.mReapplyLinker; } CBackwardPropagationLink* CRoleBackwardPropagationHash::addBackwardPropagationConceptDescriptor(CRole* role, CBackwardPropagationReapplyDescriptor* reapplyConDes) { CRoleBackwardPropagationHashData& backPropData = mRoleBackPropDataHash[role]; backPropData.mReapplyLinker = reapplyConDes->append(backPropData.mReapplyLinker); return backPropData.mLinkLinker; } CPROCESSHASH* CRoleBackwardPropagationHash::getRoleBackwardPropagationDataHash() { return &mRoleBackPropDataHash; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPath.h0000644000175000017500000000460612520551162027014 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CVariableBindingDescriptor.h" // Other includes #include "Reasoner/Ontology/CVariable.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CVariableBindingPath * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingPath { // public methods public: //! Constructor CVariableBindingPath(); CVariableBindingPath* initVariableBindingPath(cint64 propID, CVariableBindingDescriptor* varBindDesLinker); cint64 getPropagationID() const; CVariableBindingPath* setPropagationID(cint64 propID); CVariableBindingDescriptor* getVariableBindingDescriptorLinker(); CVariableBindingPath* addVariableBindingDescriptorLinker(CVariableBindingDescriptor* varBindDesLinker); cint64 getVariableBindingCount() const; // protected methods protected: // protected variables protected: cint64 mPropID; CVariableBindingDescriptor* mVarBindDesLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATH_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeVector.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeVector0000644000175000017500000000253612520551130032416 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualSaturationProcessNodeVector.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualSaturationProcessNodeVector::CIndividualSaturationProcessNodeVector(CProcessContext* processContext) : CDefaultDynamicReferenceVectorBase(processContext) { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceMap.cpp0000644000175000017500000016320412520551114030475 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeRealValueSpaceMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeRealValueSpaceMap::CDatatypeRealValueSpaceMap(CProcessContext* processContext) : CPROCESSMAP(processContext),mProcessContext(processContext) { } CDatatypeRealValueSpaceMap* CDatatypeRealValueSpaceMap::initDatatypeRealValueSpaceMap(CDatatypeRealValueSpaceMap* map) { if (map) { *this = *map; mAbsoluteMinimumExclusionValue = map->mAbsoluteMinimumExclusionValue; mAbsoluteMaximumExclusionValue = map->mAbsoluteMaximumExclusionValue; } return this; } CDatatypeRealValueSpaceMap* CDatatypeRealValueSpaceMap::initDatatypeRealValueSpaceMap(CDatatypeValueSpaceRealType* valueSpaceType) { CPROCESSMAP::clear(); mAbsoluteMinimumExclusionValue = nullptr; mAbsoluteMaximumExclusionValue = nullptr; excludeMinimum(valueSpaceType->getMinimumDataLiteralRealValue(),false,nullptr); excludeMaximum(valueSpaceType->getMaximumDataLiteralRealValue(),false,nullptr); return this; } bool CDatatypeRealValueSpaceMap::getAbsoluteMinimumValue(CDataLiteralRealValue*& minValue, bool& minValueInclusive, CDependencyTrackPoint** depTrackPoint) { if (mAbsoluteMinimumExclusionValue) { minValue = mAbsoluteMinimumExclusionValue->getValue(); minValueInclusive = true; if (depTrackPoint) { *depTrackPoint = mAbsoluteMinimumExclusionValue->getLeftExclusionData()->getExcludedDependencyTrackPoint(); } if (mAbsoluteMinimumExclusionValue->getValueExclusionData()->isExcluded()) { if (mAbsoluteMinimumExclusionValue->getValueExclusionData()->getExcludedDependencyTrackPoint() == mAbsoluteMinimumExclusionValue->getLeftExclusionData()->getExcludedDependencyTrackPoint()) { minValueInclusive = false; } } return true; } return false; } bool CDatatypeRealValueSpaceMap::getAbsoluteMaximumValue(CDataLiteralRealValue*& maxValue, bool& maxValueInclusive, CDependencyTrackPoint** depTrackPoint) { if (mAbsoluteMaximumExclusionValue) { maxValue = mAbsoluteMaximumExclusionValue->getValue(); maxValueInclusive = true; if (depTrackPoint) { *depTrackPoint = mAbsoluteMaximumExclusionValue->getRightExclusionData()->getExcludedDependencyTrackPoint(); } if (mAbsoluteMaximumExclusionValue->getValueExclusionData()->isExcluded()) { if (mAbsoluteMaximumExclusionValue->getValueExclusionData()->getExcludedDependencyTrackPoint() == mAbsoluteMaximumExclusionValue->getRightExclusionData()->getExcludedDependencyTrackPoint()) { maxValueInclusive = false; } } return true; } return false; } bool CDatatypeRealValueSpaceMap::excludeMinimum(CDataLiteralRealValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint) { if (mAbsoluteMinimumExclusionValue) { if (mAbsoluteMinimumExclusionValue->getValue()->isGreaterThan(value)) { return nullptr; } } bool newValuesPotentiallyExcluded = false; CDatatypeRealValueData* valueData = getDatatypeRealValueData(value,true); newValuesPotentiallyExcluded |= excludeLeftDataInterval(valueData,depTrackPoint,nullptr,true); if (valueInclusively && !isDataValueExcluded(valueData,nullptr)) { newValuesPotentiallyExcluded |= excludeDataValue(valueData,depTrackPoint,nullptr,false); } mAbsoluteMinimumExclusionValue = valueData; // remove all lower values from map CDatatypeRealValueSpaceMap::iterator it = CDatatypeRealValueSpaceMap::begin(), itEnd = CDatatypeRealValueSpaceMap::end(); while (it != itEnd) { const CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* itValueData = mapData.mUseValue; if (itValueData == valueData) { break; } newValuesPotentiallyExcluded = true; it = CDatatypeRealValueSpaceMap::erase(it); } return newValuesPotentiallyExcluded; } bool CDatatypeRealValueSpaceMap::excludeMaximum(CDataLiteralRealValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint) { if (mAbsoluteMaximumExclusionValue) { if (mAbsoluteMaximumExclusionValue->getValue()->isLessThan(value)) { return false; } } bool newValuesPotentiallyExcluded = false; CDatatypeRealValueData* valueData = getDatatypeRealValueData(value,true); newValuesPotentiallyExcluded |= excludeRightDataInterval(valueData,depTrackPoint,nullptr,true); if (valueInclusively && !isDataValueExcluded(valueData,nullptr)) { newValuesPotentiallyExcluded |= excludeDataValue(valueData,depTrackPoint,nullptr,false); } mAbsoluteMaximumExclusionValue = valueData; // remove all higher values from map CDatatypeRealValueSpaceMapArranger mapValueArranger(value); CDatatypeRealValueSpaceMap::iterator itBegin = CDatatypeRealValueSpaceMap::begin(), itUB = CDatatypeRealValueSpaceMap::upperBound(mapValueArranger), itEnd = CDatatypeRealValueSpaceMap::end(); CDatatypeRealValueSpaceMap::iterator it = itUB; while (it != itEnd) { const CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* itValueData = mapData.mUseValue; it = CDatatypeRealValueSpaceMap::erase(it); newValuesPotentiallyExcluded = true; } return newValuesPotentiallyExcluded; } bool CDatatypeRealValueSpaceMap::excludeMinimum(CDataLiteralRealValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType) { bool newValuesPotentiallyExcluded = false; CDatatypeRealValueData* valueData = getDatatypeRealValueData(value,true); if (valueInclusively && !isDataValueExcluded(valueData,exclusionType)) { newValuesPotentiallyExcluded |= excludeDataValue(valueData,depTrackPoint,exclusionType,false); } CDatatypeRealValueSpaceMap::iterator itBegin = CDatatypeRealValueSpaceMap::begin(), itEnd = CDatatypeRealValueSpaceMap::end(); CDatatypeRealValueSpaceMap::iterator it = itBegin; while (it != itEnd) { CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* itValueData = mapData.mUseValue; if (it == itBegin) { if (!isLeftDataIntervalExcluded(itValueData,exclusionType)) { itValueData = getDatatypeRealValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(itValueData,depTrackPoint,exclusionType,false); } } if (itValueData != valueData) { if (!isDataValueExcluded(itValueData,exclusionType)) { itValueData = getDatatypeRealValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeDataValue(itValueData,depTrackPoint,exclusionType,false); } ++it; if (it != itEnd) { CDatatypeRealValueSpaceMapData& nextMapData = it.value(); CDatatypeRealValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData,exclusionType)) { itValueData = getDatatypeRealValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeRightDataInterval(itValueData,depTrackPoint,exclusionType,false); nextValueData = getDatatypeRealValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(nextValueData,depTrackPoint,exclusionType,false); } } } else { break; } } return newValuesPotentiallyExcluded; } bool CDatatypeRealValueSpaceMap::excludeMaximum(CDataLiteralRealValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType) { bool newValuesPotentiallyExcluded = false; CDatatypeRealValueData* valueData = getDatatypeRealValueData(value,true); if (valueInclusively && !isDataValueExcluded(valueData,nullptr)) { newValuesPotentiallyExcluded |= excludeDataValue(valueData,depTrackPoint,nullptr,false); } CDatatypeRealValueSpaceMapArranger mapValueArranger(value); CDatatypeRealValueSpaceMap::iterator itBegin = CDatatypeRealValueSpaceMap::begin(), itLB = CDatatypeRealValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeRealValueSpaceMap::end(); CDatatypeRealValueSpaceMap::iterator it = itLB; while (it != itEnd) { CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* itValueData = mapData.mUseValue; if (itValueData != valueData) { if (!isDataValueExcluded(itValueData,exclusionType)) { itValueData = getDatatypeRealValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeDataValue(itValueData,depTrackPoint,exclusionType,false); } } ++it; if (it != itEnd) { CDatatypeRealValueSpaceMapData& nextMapData = it.value(); CDatatypeRealValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData,exclusionType)) { itValueData = getDatatypeRealValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeRightDataInterval(itValueData,depTrackPoint,exclusionType,false); nextValueData = getDatatypeRealValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(nextValueData,depTrackPoint,exclusionType,false); } } else { if (!isRightDataIntervalExcluded(itValueData,exclusionType)) { itValueData = getDatatypeRealValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(itValueData,depTrackPoint,exclusionType,false); } } } return newValuesPotentiallyExcluded; } bool CDatatypeRealValueSpaceMap::excludeAll(CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType) { bool newValuesPotentiallyExcluded = false; CDatatypeRealValueSpaceMap::iterator itBegin = CDatatypeRealValueSpaceMap::begin(), itEnd = CDatatypeRealValueSpaceMap::end(); CDatatypeRealValueSpaceMap::iterator it = itBegin; while (it != itEnd) { CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* itValueData = mapData.mUseValue; if (it == itBegin) { if (!isLeftDataIntervalExcluded(itValueData,exclusionType)) { itValueData = getDatatypeRealValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(itValueData,depTrackPoint,exclusionType,false); } if (!isDataValueExcluded(itValueData,exclusionType)) { itValueData = getDatatypeRealValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeDataValue(itValueData,depTrackPoint,exclusionType,false); } } ++it; if (it != itEnd) { CDatatypeRealValueSpaceMapData& nextMapData = it.value(); CDatatypeRealValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData,exclusionType)) { itValueData = getDatatypeRealValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeRightDataInterval(itValueData,depTrackPoint,exclusionType,false); nextValueData = getDatatypeRealValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(nextValueData,depTrackPoint,exclusionType,false); } if (!isDataValueExcluded(nextValueData,exclusionType)) { nextValueData = getDatatypeRealValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeDataValue(nextValueData,depTrackPoint,exclusionType,false); } } else { if (!isRightDataIntervalExcluded(itValueData,exclusionType)) { itValueData = getDatatypeRealValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeRightDataInterval(itValueData,depTrackPoint,exclusionType,false); } } } return newValuesPotentiallyExcluded; } bool CDatatypeRealValueSpaceMap::excludeInterval(CDataLiteralRealValue* leftValue, bool leftValueInclusive, CDataLiteralRealValue* rightValue, bool rightValueInclusive, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType) { bool newValuesPotentiallyExcluded = false; CDatatypeRealValueData* leftValueData = getDatatypeRealValueData(leftValue,true); CDatatypeRealValueData* rightValueData = getDatatypeRealValueData(rightValue,true); if (leftValueInclusive && !isDataValueExcluded(leftValueData,exclusionType)) { newValuesPotentiallyExcluded |= excludeDataValue(leftValueData,depTrackPoint,exclusionType,false); } if (leftValueInclusive && !isDataValueExcluded(rightValueData,exclusionType)) { newValuesPotentiallyExcluded |= excludeDataValue(rightValueData,depTrackPoint,exclusionType,false); } CDatatypeRealValueSpaceMapArranger mapValueArranger(leftValue); CDatatypeRealValueSpaceMap::iterator itBegin = CDatatypeRealValueSpaceMap::begin(), itLB = CDatatypeRealValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeRealValueSpaceMap::end(); CDatatypeRealValueSpaceMap::iterator it = itLB; while (it != itEnd) { CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* itValueData = mapData.mUseValue; ++it; if (it != itEnd) { CDatatypeRealValueSpaceMapData& nextMapData = it.value(); CDatatypeRealValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData,exclusionType)) { itValueData = getDatatypeRealValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeRightDataInterval(itValueData,depTrackPoint,exclusionType,false); nextValueData = getDatatypeRealValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(nextValueData,depTrackPoint,exclusionType,false); } if (nextValueData == rightValueData) { break; } if (!isDataValueExcluded(nextValueData,exclusionType)) { nextValueData = getDatatypeRealValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeDataValue(nextValueData,depTrackPoint,exclusionType,false); } } } return newValuesPotentiallyExcluded; } bool CDatatypeRealValueSpaceMap::countDataIntervalValues(CDatatypeRealValueData* leftValueExcluded, CDatatypeRealValueData* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter) { return countDataIntervalValues(leftValueExcluded->getValue(),rightValueExcluded->getValue(),leftValueExcluded->getRightExclusionData(),counter); } bool CDatatypeRealValueSpaceMap::countDataIntervalValues(CDataLiteralRealValue* leftValueExcluded, CDatatypeRealValueData* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter) { return countDataIntervalValues(leftValueExcluded,rightValueExcluded->getValue(),rightValueExcluded->getLeftExclusionData(),counter); } bool CDatatypeRealValueSpaceMap::countDataIntervalValues(CDatatypeRealValueData* leftValueExcluded, CDataLiteralRealValue* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter) { return countDataIntervalValues(leftValueExcluded->getValue(),rightValueExcluded,leftValueExcluded->getRightExclusionData(),counter); } bool CDatatypeRealValueSpaceMap::countDataIntervalValues(CDataLiteralRealValue* leftValueExcluded, CDataLiteralRealValue* rightValueExcluded, CDatatypeRealValueDataExclusion* exlcusionData, CDatatypeValueSpaceValuesCounter* counter) { bool counted = false; if (!exlcusionData->isEverythingExcluded()) { if (leftValueExcluded->isInfiniteBigNumber() || rightValueExcluded->isInfiniteBigNumber()) { counted |= counter->incInfinite(); } else { if (exlcusionData->areOnlyIntegerValuesAllowed()) { if (rightValueExcluded->hasFlag(CDataLiteralRealValue::DLRV_INTEGER_FLAG)) { cint64 incCount = rightValueExcluded->getPosNegInteger() - leftValueExcluded->getPosNegInteger() - 1; counted |= counter->incValueCount(incCount); } else { cint64 incCount = rightValueExcluded->getPosNegInteger() - leftValueExcluded->getPosNegInteger(); counted |= counter->incValueCount(incCount); } } else { counted |= counter->incInfinite(); } } CDatatypeValueSpaceRealValuesCounter* realValuesCounter = dynamic_cast(counter); if (realValuesCounter) { if (!exlcusionData->areIntegerValuesExcluded()) { if (leftValueExcluded->isInfiniteBigNumber() || rightValueExcluded->isInfiniteBigNumber()) { counted |= realValuesCounter->incInfinite(CDatatypeValueSpaceRealValuesCounter::RVT_INTEGER_ALL_COUNT); } if (rightValueExcluded->hasFlag(CDataLiteralRealValue::DLRV_INTEGER_FLAG)) { cint64 incCount = rightValueExcluded->getPosNegInteger() - leftValueExcluded->getPosNegInteger() - 1; counted |= realValuesCounter->incValueCount(CDatatypeValueSpaceRealValuesCounter::RVT_INTEGER_ALL_COUNT,incCount); } else { cint64 incCount = rightValueExcluded->getPosNegInteger() - leftValueExcluded->getPosNegInteger(); counted |= realValuesCounter->incValueCount(CDatatypeValueSpaceRealValuesCounter::RVT_INTEGER_ALL_COUNT,incCount); } } if (!exlcusionData->areDecimalValuesExcluded()) { counted |= realValuesCounter->incInfinite(CDatatypeValueSpaceRealValuesCounter::RVT_DECIMAL_ALL_COUNT); } else if (!exlcusionData->areRationalValuesExcluded()) { counted |= realValuesCounter->incInfinite(CDatatypeValueSpaceRealValuesCounter::RVT_RATIONAL_ALL_COUNT); } if (!exlcusionData->areRealValuesExcluded()) { counted |= realValuesCounter->incInfinite(CDatatypeValueSpaceRealValuesCounter::RVT_NON_RATIONAL_ALL_COUNT); } else if (!exlcusionData->areRationalValuesExcluded()) { counted |= realValuesCounter->incInfinite(CDatatypeValueSpaceRealValuesCounter::RVT_NON_DECIMAL_ALL_COUNT); } else if (!exlcusionData->areDecimalValuesExcluded()) { counted |= realValuesCounter->incInfinite(CDatatypeValueSpaceRealValuesCounter::RVT_NON_INTEGER_ALL_COUNT); } } } return counted; } bool CDatatypeRealValueSpaceMap::countDataValue(CDatatypeRealValueData* dataValue, CDatatypeValueSpaceValuesCounter* counter) { return countDataValue(dataValue->getValue(),dataValue->getValueExclusionData(),counter); } bool CDatatypeRealValueSpaceMap::countDataValue(CDataLiteralRealValue* value, CDatatypeRealValueDataExclusion* exlcusionData, CDatatypeValueSpaceValuesCounter* counter) { bool counted = false; if (!exlcusionData->isEverythingExcluded()) { if (value->isInfinite()) { counted |= counter->incInfinite(); } else { counted |= counter->incValueCount(1); } CDatatypeValueSpaceRealValuesCounter* realValuesCounter = dynamic_cast(counter); if (realValuesCounter) { if (value->isInfinite()) { counted |= realValuesCounter->incInfinite(CDatatypeValueSpaceRealValuesCounter::RVT_INTEGER_ALL_COUNT); if (!exlcusionData->areDecimalValuesExcluded()) { counted |= realValuesCounter->incInfinite(CDatatypeValueSpaceRealValuesCounter::RVT_NON_INTEGER_ONLY_COUNT); } if (!exlcusionData->areRationalValuesExcluded()) { counted |= realValuesCounter->incInfinite(CDatatypeValueSpaceRealValuesCounter::RVT_NON_INTEGER_ONLY_COUNT); counted |= realValuesCounter->incInfinite(CDatatypeValueSpaceRealValuesCounter::RVT_NON_DECIMAL_ONLY_COUNT); } } else { if (value->hasFlag(CDataLiteralRealValue::DLRV_INTEGER_FLAG)) { counted |= realValuesCounter->incValueCount(CDatatypeValueSpaceRealValuesCounter::RVT_INTEGER_ONLY_COUNT,1); } else { counted |= realValuesCounter->incValueCount(CDatatypeValueSpaceRealValuesCounter::RVT_NON_INTEGER_ONLY_COUNT,1); } if (value->hasFlag(CDataLiteralRealValue::DLRV_DECIMAL_FLAG)) { counted |= realValuesCounter->incValueCount(CDatatypeValueSpaceRealValuesCounter::RVT_DECIMAL_ONLY_COUNT,1); } else { counted |= realValuesCounter->incValueCount(CDatatypeValueSpaceRealValuesCounter::RVT_NON_DECIMAL_ONLY_COUNT,1); } counted |= realValuesCounter->incValueCount(CDatatypeValueSpaceRealValuesCounter::RVT_RATIONAL_ONLY_COUNT,1); } } } return counted; } bool CDatatypeRealValueSpaceMap::countValueValues(CDataLiteralRealValue* value, CDatatypeValueSpaceValuesCounter* counter) { bool counted = false; if (mAbsoluteMinimumExclusionValue) { if (value->isLessThan(mAbsoluteMinimumExclusionValue->getValue())) { return false; } } if (mAbsoluteMaximumExclusionValue) { if (value->isGreaterThan(mAbsoluteMaximumExclusionValue->getValue())) { return false; } } CDatatypeRealValueSpaceMapArranger mapValueArranger(value); CDatatypeRealValueSpaceMap::iterator itBegin = CDatatypeRealValueSpaceMap::begin(), itLB = CDatatypeRealValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeRealValueSpaceMap::end(); CDatatypeRealValueSpaceMap::iterator it = itLB; if (it != itEnd) { CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* itValueData = mapData.mUseValue; if (value->isEqualTo(itValueData->getValue())) { if (!isDataValueExcluded(itValueData,nullptr)) { counted |= countDataValue(itValueData,counter); } } else { if (!isDataValueExcluded(value,nullptr)) { counted |= countDataValue(value,itValueData->getLeftExclusionData(),counter); } } } return counted; } bool CDatatypeRealValueSpaceMap::addIntervalExclusionDependencies(CDataLiteralRealValue* leftValue, bool leftValueInclusive, CDataLiteralRealValue* rightValue, bool rightValueInclusive, CDatatypeValueSpaceDependencyCollector* depCollector) { if (mAbsoluteMinimumExclusionValue) { if (leftValue->isLessThan(mAbsoluteMinimumExclusionValue->getValue())) { leftValue = mAbsoluteMinimumExclusionValue->getValue(); } } if (mAbsoluteMaximumExclusionValue) { if (rightValue->isGreaterThan(mAbsoluteMaximumExclusionValue->getValue())) { rightValue = mAbsoluteMaximumExclusionValue->getValue(); } } if (leftValue->isGreaterThan(rightValue)) { return false; } else if (leftValue->isEqualTo(rightValue)) { if (!leftValueInclusive && !rightValueInclusive) { return false; } } bool depAdded = false; CDatatypeRealValueSpaceMapArranger mapValueArranger(leftValue); CDatatypeRealValueSpaceMap::iterator itBegin = CDatatypeRealValueSpaceMap::begin(), itLB = CDatatypeRealValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeRealValueSpaceMap::end(); CDatatypeRealValueSpaceMap::iterator it = itLB; while (it != itEnd) { CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* itValueData = mapData.mUseValue; if (it == itLB) { if (leftValue->isEqualTo(itValueData->getValue())) { if (leftValueInclusive) { depAdded |= addDataValueExclusionDependencies(itValueData,depCollector); } } else { depAdded |= addExclusionDependencies(itValueData->getLeftExclusionData(),depCollector); } } ++it; if (it != itEnd) { CDatatypeRealValueSpaceMapData& nextMapData = it.value(); CDatatypeRealValueData* nextValueData = nextMapData.mUseValue; depAdded |= addDataIntervalExclusionDependencies(itValueData,nextValueData,depCollector); if (nextValueData->getValue()->isEqualTo(rightValue)) { if (rightValueInclusive) { depAdded |= addDataValueExclusionDependencies(nextValueData,depCollector); } break; } else if (nextValueData->getValue()->isGreaterThan(rightValue)) { depAdded |= addExclusionDependencies(itValueData->getRightExclusionData(),depCollector); break; } depAdded |= addDataValueExclusionDependencies(nextValueData,depCollector); } } return depAdded; } bool CDatatypeRealValueSpaceMap::addValueExclusionDependencies(CDataLiteralRealValue* value, CDatatypeValueSpaceDependencyCollector* depCollector) { if (mAbsoluteMinimumExclusionValue) { if (value->isLessThan(mAbsoluteMinimumExclusionValue->getValue())) { return false; } } if (mAbsoluteMaximumExclusionValue) { if (value->isGreaterThan(mAbsoluteMaximumExclusionValue->getValue())) { return false; } } bool depAdded = false; CDatatypeRealValueSpaceMapArranger mapValueArranger(value); CDatatypeRealValueSpaceMap::iterator itBegin = CDatatypeRealValueSpaceMap::begin(), itLB = CDatatypeRealValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeRealValueSpaceMap::end(); CDatatypeRealValueSpaceMap::iterator it = itLB; if (it != itEnd) { CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* itValueData = mapData.mUseValue; if (value->isEqualTo(itValueData->getValue())) { depAdded |= addDataValueExclusionDependencies(itValueData,depCollector); } else if (value->isGreaterThan(itValueData->getValue())) { depAdded |= addExclusionDependencies(itValueData->getRightExclusionData(),depCollector); } else { depAdded |= addExclusionDependencies(itValueData->getLeftExclusionData(),depCollector); } } return depAdded; } bool CDatatypeRealValueSpaceMap::countAllValues(CDatatypeValueSpaceValuesCounter* counter) { if (mAbsoluteMaximumExclusionValue && mAbsoluteMinimumExclusionValue) { return countIntervalValues(mAbsoluteMinimumExclusionValue->getValue(),true,mAbsoluteMaximumExclusionValue->getValue(),true,counter); } return false; } bool CDatatypeRealValueSpaceMap::countIntervalValues(CDataLiteralRealValue* leftValue, bool leftValueInclusive, CDataLiteralRealValue* rightValue, bool rightValueInclusive, CDatatypeValueSpaceValuesCounter* counter) { bool counted = false; if (mAbsoluteMinimumExclusionValue) { if (leftValue->isLessThan(mAbsoluteMinimumExclusionValue->getValue())) { leftValue = mAbsoluteMinimumExclusionValue->getValue(); } } if (mAbsoluteMaximumExclusionValue) { if (rightValue->isGreaterThan(mAbsoluteMaximumExclusionValue->getValue())) { rightValue = mAbsoluteMaximumExclusionValue->getValue(); } } if (leftValue->isGreaterThan(rightValue)) { return false; } else if (leftValue->isEqualTo(rightValue)) { if (!leftValueInclusive && !rightValueInclusive) { return false; } } CDatatypeRealValueSpaceMapArranger mapValueArranger(leftValue); CDatatypeRealValueSpaceMap::iterator itBegin = CDatatypeRealValueSpaceMap::begin(), itLB = CDatatypeRealValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeRealValueSpaceMap::end(); CDatatypeRealValueSpaceMap::iterator it = itLB; while (it != itEnd) { CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* itValueData = mapData.mUseValue; if (it == itLB) { if (leftValue->isEqualTo(itValueData->getValue())) { if (leftValueInclusive) { if (!isDataValueExcluded(itValueData,nullptr)) { counted |= countDataValue(itValueData,counter); } } } else { if (leftValueInclusive) { if (!isDataValueExcluded(leftValue,nullptr)) { counted |= countDataValue(leftValue,itValueData->getLeftExclusionData(),counter); } } if (!isDataIntervalExcluded(leftValue,itValueData,nullptr)) { counted |= countDataIntervalValues(leftValue,itValueData,counter); } } } ++it; if (it != itEnd) { CDatatypeRealValueSpaceMapData& nextMapData = it.value(); CDatatypeRealValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData,nullptr)) { counted |= countDataIntervalValues(itValueData,nextValueData,counter); } if (nextValueData->getValue()->isEqualTo(rightValue)) { if (rightValueInclusive) { if (!isDataValueExcluded(nextValueData,nullptr)) { counted |= countDataValue(nextValueData,counter); } } break; } else if (nextValueData->getValue()->isGreaterThan(rightValue)) { if (rightValueInclusive) { if (!isDataValueExcluded(rightValue,nullptr)) { counted |= countDataValue(rightValue,nextValueData->getLeftExclusionData(),counter); } } if (!isDataIntervalExcluded(nextValueData,rightValue,nullptr)) { counted |= countDataIntervalValues(nextValueData,rightValue,counter); } break; } if (!isDataValueExcluded(nextValueData,nullptr)) { counted |= countDataValue(nextValueData,counter); } } } return counted; } bool CDatatypeRealValueSpaceMap::excludeData(CDatatypeRealValueDataExclusion* exlcusionData, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType, bool force) { if (!exclusionType) { if (force || !exlcusionData->isExcluded()) { exlcusionData->setExcluded(true); exlcusionData->setExcludedDependencyTrackPoint(depTrackPoint); return true; } } else { if (force || !exlcusionData->isExcluded(exclusionType)) { exlcusionData->setExclusion(exclusionType,depTrackPoint); return true; } } return false; } bool CDatatypeRealValueSpaceMap::excludeDataValue(CDatatypeRealValueData* dataValue, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType, bool force) { return excludeData(dataValue->getValueExclusionData(),depTrackPoint,exclusionType,force); } bool CDatatypeRealValueSpaceMap::excludeLeftDataInterval(CDatatypeRealValueData* dataValue, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType, bool force) { return excludeData(dataValue->getLeftExclusionData(),depTrackPoint,exclusionType,force); } bool CDatatypeRealValueSpaceMap::excludeRightDataInterval(CDatatypeRealValueData* dataValue, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType, bool force) { return excludeData(dataValue->getRightExclusionData(),depTrackPoint,exclusionType,force); } bool CDatatypeRealValueSpaceMap::restrictToIntegerValues(CDependencyTrackPoint* depTrackPoint) { CDatatypeRealValueExclusionType exclusionType(CDatatypeRealValueExclusionType::RVET_INTEGER,true); return excludeAll(depTrackPoint,&exclusionType); } bool CDatatypeRealValueSpaceMap::restrictToNonIntegerValues(CDependencyTrackPoint* depTrackPoint) { CDatatypeRealValueExclusionType exclusionType(CDatatypeRealValueExclusionType::RVET_INTEGER,false); return excludeAll(depTrackPoint,&exclusionType); } bool CDatatypeRealValueSpaceMap::restrictToDecimalValues(CDependencyTrackPoint* depTrackPoint) { CDatatypeRealValueExclusionType exclusionType(CDatatypeRealValueExclusionType::RVET_DECIMAL,true); return excludeAll(depTrackPoint,&exclusionType); } bool CDatatypeRealValueSpaceMap::restrictToNonDecimalValues(CDependencyTrackPoint* depTrackPoint) { CDatatypeRealValueExclusionType exclusionType(CDatatypeRealValueExclusionType::RVET_DECIMAL,false); return excludeAll(depTrackPoint,&exclusionType); } bool CDatatypeRealValueSpaceMap::restrictToRationalValues(CDependencyTrackPoint* depTrackPoint) { CDatatypeRealValueExclusionType exclusionType(CDatatypeRealValueExclusionType::RVET_RATIONAL,true); return excludeAll(depTrackPoint,&exclusionType); } bool CDatatypeRealValueSpaceMap::restrictToNonRationalValues(CDependencyTrackPoint* depTrackPoint) { CDatatypeRealValueExclusionType exclusionType(CDatatypeRealValueExclusionType::RVET_RATIONAL,false); return excludeAll(depTrackPoint,&exclusionType); } bool CDatatypeRealValueSpaceMap::testValueSpaceReturnClashed() { CDatatypeRealValueSpaceMap::const_iterator itBegin = CDatatypeRealValueSpaceMap::constBegin(), itEnd = CDatatypeRealValueSpaceMap::constEnd(); CDatatypeRealValueSpaceMap::const_iterator it = itBegin; // test whether value space is empty CDatatypeRealValueData* firstValueData = nullptr; while (it != itEnd) { const CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* itValueData = mapData.mUseValue; if (!firstValueData) { firstValueData = itValueData; if (!isLeftDataIntervalExcluded(firstValueData,nullptr)) { return false; } } if (!isDataValueExcluded(itValueData,nullptr)) { return false; } ++it; if (it != itEnd) { const CDatatypeRealValueSpaceMapData& nextMapData = it.value(); CDatatypeRealValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData,nullptr)) { return false; } } else { if (!isRightDataIntervalExcluded(itValueData,nullptr)) { return false; } } } return true; } bool CDatatypeRealValueSpaceMap::addValueSpaceDependencies(CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeRealValueSpaceMap::const_iterator itBegin = CDatatypeRealValueSpaceMap::constBegin(), itEnd = CDatatypeRealValueSpaceMap::constEnd(); CDatatypeRealValueSpaceMap::const_iterator it = itBegin; it = itBegin; while (it != itEnd) { const CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* itValueData = mapData.mUseValue; addDataValueExclusionDependencies(itValueData,depCollector); if (it == itBegin) { addLeftIntervalExclusionDependencies(itValueData,depCollector); } ++it; if (it == itEnd) { addRightIntervalExclusionDependencies(itValueData,depCollector); } else { const CDatatypeRealValueSpaceMapData& nextMapData = it.value(); CDatatypeRealValueData* nextValueData = nextMapData.mUseValue; addDataIntervalExclusionDependencies(itValueData,nextValueData,depCollector); } } return true; } bool CDatatypeRealValueSpaceMap::restrictToValue(CDataLiteralRealValue* value, CDependencyTrackPoint* depTrackPoint) { bool newValuesPotentiallyExcluded = false; newValuesPotentiallyExcluded |= excludeMinimum(value,false,depTrackPoint); newValuesPotentiallyExcluded |= excludeMaximum(value,false,depTrackPoint); return newValuesPotentiallyExcluded; } bool CDatatypeRealValueSpaceMap::excludeValue(CDataLiteralRealValue* value, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType) { bool newValuesPotentiallyExcluded = false; if (mAbsoluteMinimumExclusionValue) { if (mAbsoluteMinimumExclusionValue->getValue()->isGreaterThan(value)) { return false; } if (mAbsoluteMinimumExclusionValue->getValue()->isEqualTo(value)) { if (isDataValueExcluded(mAbsoluteMinimumExclusionValue,exclusionType)) { return false; } } } if (mAbsoluteMaximumExclusionValue) { if (mAbsoluteMaximumExclusionValue->getValue()->isGreaterThan(value)) { return false; } if (mAbsoluteMaximumExclusionValue->getValue()->isEqualTo(value)) { if (isDataValueExcluded(mAbsoluteMaximumExclusionValue,exclusionType)) { return false; } } } CDatatypeRealValueData* valueData = getDatatypeRealValueData(value,true); if (!isDataValueExcluded(valueData,exclusionType)) { newValuesPotentiallyExcluded |= excludeDataValue(valueData,depTrackPoint,exclusionType,false); } return newValuesPotentiallyExcluded; } bool CDatatypeRealValueSpaceMap::addDataValueExclusionDependencies(CDatatypeRealValueData* dataValue, CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeRealValueDataExclusion* exclusionData = dataValue->getValueExclusionData(); return addExclusionDependencies(exclusionData,depCollector); } bool CDatatypeRealValueSpaceMap::addDataIntervalExclusionDependencies(CDatatypeRealValueData* leftValueExcluded, CDatatypeRealValueData* rightValueExcluded, CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeRealValueDataExclusion* exclusionData = leftValueExcluded->getRightExclusionData(); return addExclusionDependencies(exclusionData,depCollector); } bool CDatatypeRealValueSpaceMap::addLeftIntervalExclusionDependencies(CDatatypeRealValueData* valueData, CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeRealValueDataExclusion* exclusionData = valueData->getLeftExclusionData(); return addExclusionDependencies(exclusionData,depCollector); } bool CDatatypeRealValueSpaceMap::addRightIntervalExclusionDependencies(CDatatypeRealValueData* valueData, CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeRealValueDataExclusion* exclusionData = valueData->getRightExclusionData(); return addExclusionDependencies(exclusionData,depCollector); } bool CDatatypeRealValueSpaceMap::addExclusionDependencies(CDatatypeRealValueDataExclusion* exclusionData, CDatatypeValueSpaceDependencyCollector* depCollector) { bool dependenciesAdded = false; CDependencyTrackPoint* depTrackPoint = nullptr; if (depCollector) { if (exclusionData->isExcluded()) { depTrackPoint = exclusionData->getExcludedDependencyTrackPoint(); if (depTrackPoint) { dependenciesAdded |= depCollector->addDependency(depTrackPoint); } } else { depTrackPoint = exclusionData->getPositiveExclusionDependencyTrackPoint(); if (depTrackPoint) { dependenciesAdded |= depCollector->addDependency(depTrackPoint); } depTrackPoint = exclusionData->getNegativeExclusionDependencyTrackPoint(); if (depTrackPoint) { dependenciesAdded |= depCollector->addDependency(depTrackPoint); } } } return dependenciesAdded; } bool CDatatypeRealValueSpaceMap::isLeftDataIntervalExcluded(CDatatypeRealValueData* dataValue, CDatatypeRealValueExclusionType* exclusionType) { CDatatypeRealValueDataExclusion* exclusionData = dataValue->getLeftExclusionData(); if (exclusionData->isEverythingExcluded()) { return true; } if (exclusionType) { if (exclusionData->isExcluded(exclusionType)) { return true; } } return false; } bool CDatatypeRealValueSpaceMap::isRightDataIntervalExcluded(CDatatypeRealValueData* dataValue, CDatatypeRealValueExclusionType* exclusionType) { CDatatypeRealValueDataExclusion* exclusionData = dataValue->getRightExclusionData(); if (exclusionData->isEverythingExcluded()) { return true; } if (exclusionType) { if (exclusionData->isExcluded(exclusionType)) { return true; } } return false; } bool CDatatypeRealValueSpaceMap::isDataIntervalExcluded(CDataLiteralRealValue* leftValueExcluded, CDatatypeRealValueData* rightValueExcluded, CDatatypeRealValueExclusionType* exclusionType) { CDatatypeRealValueDataExclusion* exclusionData = rightValueExcluded->getLeftExclusionData(); if (exclusionData->isEverythingExcluded()) { return true; } if (exclusionData->areOnlyIntegerValuesAllowed()) { if (!containsIntervalIntegers(leftValueExcluded,rightValueExcluded->getValue())) { return true; } } if (exclusionType) { if (exclusionData->isExcluded(exclusionType)) { return true; } } return false; } bool CDatatypeRealValueSpaceMap::isDataIntervalExcluded(CDatatypeRealValueData* leftValueExcluded, CDataLiteralRealValue* rightValueExcluded, CDatatypeRealValueExclusionType* exclusionType) { CDatatypeRealValueDataExclusion* exclusionData = leftValueExcluded->getRightExclusionData(); if (exclusionData->isEverythingExcluded()) { return true; } if (exclusionData->areOnlyIntegerValuesAllowed()) { if (!containsIntervalIntegers(leftValueExcluded->getValue(),rightValueExcluded)) { return true; } } if (exclusionType) { if (exclusionData->isExcluded(exclusionType)) { return true; } } return false; } bool CDatatypeRealValueSpaceMap::isDataIntervalExcluded(CDatatypeRealValueData* leftValueExcluded, CDatatypeRealValueData* rightValueExcluded, CDatatypeRealValueExclusionType* exclusionType) { return isDataIntervalExcluded(leftValueExcluded,rightValueExcluded->getValue(),exclusionType); } bool CDatatypeRealValueSpaceMap::containsIntervalIntegers(CDataLiteralRealValue* leftValueExcluded, CDataLiteralRealValue* rightValueExcluded, cint64 requiredIntegerCount) { if (leftValueExcluded->isInfiniteBigNumber() || rightValueExcluded->isInfiniteBigNumber()) { return true; } else if (rightValueExcluded->hasFlag(CDataLiteralRealValue::DLRV_INTEGER_FLAG)) { return leftValueExcluded->getPosNegInteger()+requiredIntegerCount < rightValueExcluded->getPosNegInteger(); } else { return leftValueExcluded->getPosNegInteger()+requiredIntegerCount <= rightValueExcluded->getPosNegInteger(); } } bool CDatatypeRealValueSpaceMap::isDataValueExcluded(CDatatypeRealValueData* valueData, CDatatypeRealValueExclusionType* exclusionType) { CDatatypeRealValueDataExclusion* exclusionData = valueData->getValueExclusionData(); if (exclusionData->isEverythingExcluded()) { return true; } CDataLiteralRealValue* value = valueData->getValue(); if (value->hasFlag(CDataLiteralRealValue::DLRV_INTEGER_FLAG)) { if (exclusionData->areIntegerValuesExcluded()) { return true; } } else if (value->hasFlag(CDataLiteralRealValue::DLRV_DECIMAL_FLAG)) { if (exclusionData->areDecimalValuesExcluded()) { return true; } } else if (value->hasFlag(CDataLiteralRealValue::DLRV_RATIONAL_FLAG)) { if (exclusionData->areRationalValuesExcluded()) { return true; } } if (exclusionType) { if (exclusionData->isExcluded(exclusionType)) { return true; } } return false; } bool CDatatypeRealValueSpaceMap::isDataValueExcluded(CDataLiteralRealValue* value, CDatatypeRealValueExclusionType* exclusionType) { CDatatypeRealValueSpaceMapArranger mapValueArranger(value); CDatatypeRealValueSpaceMap::const_iterator itBegin = CDatatypeRealValueSpaceMap::constBegin(), itLB = CDatatypeRealValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeRealValueSpaceMap::constEnd(); if (itBegin == itEnd) { return false; } if (itLB == itEnd) { return true; } const CDatatypeRealValueSpaceMapData& mapData = itLB.value(); CDatatypeRealValueData* valueData = mapData.mUseValue; CDatatypeRealValueDataExclusion* exclusionData = nullptr; if (valueData->getValue()->isEqualTo(value)) { exclusionData = valueData->getValueExclusionData(); } else if (valueData->getValue()->isLessThan(value)) { exclusionData = valueData->getLeftExclusionData(); } else { exclusionData = valueData->getRightExclusionData(); } if (exclusionData) { CDatatypeRealValueDataExclusion* exclusionData = valueData->getValueExclusionData(); if (exclusionData->isEverythingExcluded()) { return true; } CDataLiteralRealValue* value = valueData->getValue(); if (value->hasFlag(CDataLiteralRealValue::DLRV_INTEGER_FLAG)) { if (exclusionData->areIntegerValuesExcluded()) { return true; } } else if (value->hasFlag(CDataLiteralRealValue::DLRV_DECIMAL_FLAG)) { if (exclusionData->areDecimalValuesExcluded()) { return true; } } else if (value->hasFlag(CDataLiteralRealValue::DLRV_RATIONAL_FLAG)) { if (exclusionData->areRationalValuesExcluded()) { return true; } } } if (exclusionType) { if (exclusionData->isExcluded(exclusionType)) { return true; } } return false; } bool CDatatypeRealValueSpaceMap::adaptNewRealValueDataToNeighbours(CDatatypeRealValueData* valueData) { CDatatypeRealValueSpaceMapArranger mapValueArranger(valueData->getValue()); CDatatypeRealValueSpaceMap::const_iterator itBegin = CDatatypeRealValueSpaceMap::constBegin(), itLB = CDatatypeRealValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeRealValueSpaceMap::constEnd(); CDatatypeRealValueSpaceMap::const_iterator itAdapt = itLB; bool rightNeighbour = true; ++itAdapt; if (itAdapt == itEnd) { itAdapt = itLB; --itAdapt; rightNeighbour = false; } if (itAdapt != itEnd) { const CDatatypeRealValueSpaceMapData& adaptMapData = itAdapt.value(); CDatatypeRealValueData* adaptValueData = adaptMapData.mUseValue; CDatatypeRealValueDataExclusion* exclusionData = nullptr; if (rightNeighbour) { exclusionData = adaptValueData->getLeftExclusionData(); } else { exclusionData = adaptValueData->getRightExclusionData(); } valueData->getValueExclusionData()->initDataExclusion(exclusionData); valueData->getLeftExclusionData()->initDataExclusion(exclusionData); valueData->getRightExclusionData()->initDataExclusion(exclusionData); return true; } return false; } CDatatypeRealValueData* CDatatypeRealValueSpaceMap::getDatatypeRealValueData(CDataLiteralRealValue* value, CDatatypeRealValueSpaceMapData& valueMapData, bool createOrLocalize, bool* newValueInsertion) { if (newValueInsertion) { *newValueInsertion = false; } CDatatypeRealValueData* realValueData = nullptr; if (!valueMapData.mLocValue) { bool newlyCreated = false; CMemoryAllocationManager* taskMemMan = mProcessContext->getUsedMemoryAllocationManager(); realValueData = CObjectParameterizingAllocator< CDatatypeRealValueData,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,mProcessContext); realValueData->initRealValueData(valueMapData.mUseValue,value); if (!valueMapData.mUseValue) { newlyCreated = true; } valueMapData.mUseValue = valueMapData.mLocValue = realValueData; if (newlyCreated) { adaptNewRealValueDataToNeighbours(realValueData); } if (newlyCreated && newValueInsertion) { *newValueInsertion = true; } } else { realValueData = valueMapData.mUseValue; } return realValueData; } CDatatypeRealValueData* CDatatypeRealValueSpaceMap::getDatatypeRealValueData(CDataLiteralRealValue* value, bool createOrLocalize, bool* newValueInsertion) { if (newValueInsertion) { *newValueInsertion = false; } CDatatypeRealValueData* realValueData = nullptr; CDatatypeRealValueSpaceMapArranger mapValueArranger(value); if (createOrLocalize) { CDatatypeRealValueSpaceMapData& data = CPROCESSMAP::operator[](mapValueArranger); realValueData = getDatatypeRealValueData(value,data,createOrLocalize,newValueInsertion); } else { CDatatypeRealValueSpaceMapData data = CPROCESSMAP::value(mapValueArranger); realValueData = data.mUseValue; } return realValueData; } bool CDatatypeRealValueSpaceMap::hasExcludedMinimum(CDataLiteralRealValue* value, bool valueInclusively, CDatatypeRealValueExclusionType* exclusionType) { if (mAbsoluteMinimumExclusionValue) { if (mAbsoluteMinimumExclusionValue->getValue()->isGreaterThan(value)) { return true; } if (mAbsoluteMinimumExclusionValue->getValue()->isEqualTo(value)) { if (isDataValueExcluded(mAbsoluteMinimumExclusionValue,exclusionType)) { return true; } if (!valueInclusively) { return true; } } } CDatatypeRealValueSpaceMapArranger mapValueArranger(value); CDatatypeRealValueSpaceMap::const_iterator itLB = CDatatypeRealValueSpaceMap::lowerBound(mapValueArranger), it = CDatatypeRealValueSpaceMap::constBegin(), itEnd = CDatatypeRealValueSpaceMap::constEnd(); if (it == itEnd) { // no restrictions in value map return false; } if (it == itLB) { const CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* realValueData = mapData.mUseValue; if (!valueInclusively) { // value is before first value --> excluded return isLeftDataIntervalExcluded(realValueData,exclusionType); } else { if (!isDataValueExcluded(realValueData,exclusionType)) { return false; } return true; } } if (itLB == itEnd) { // value is after last value --> not excluded assuming value space is not clashed return false; } while (it != itEnd && it != itLB) { // try to find valid values before tested minimum value limit const CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* realValueData = mapData.mUseValue; if (!isDataValueExcluded(realValueData,exclusionType)) { return false; } ++it; if (it != itEnd) { const CDatatypeRealValueSpaceMapData& nextMapData = it.value(); CDatatypeRealValueData* nextRealValueData = nextMapData.mUseValue; if (it != itLB) { if (!isDataIntervalExcluded(realValueData,nextRealValueData,exclusionType)) { return false; } } else { if (nextRealValueData->getValue()->isEqualTo(value)) { // value is in the value space map if (!isDataIntervalExcluded(realValueData,nextRealValueData,exclusionType)) { return false; } if (valueInclusively && !isDataValueExcluded(nextRealValueData,exclusionType)) { return false; } } else { // test only to the tested minimum value limit if (!isDataIntervalExcluded(realValueData,value,exclusionType)) { return false; } if (valueInclusively && !isDataValueExcluded(value,exclusionType)) { return false; } } } } } return true; } bool CDatatypeRealValueSpaceMap::hasExcludedMaximum(CDataLiteralRealValue* value, bool valueInclusively, CDatatypeRealValueExclusionType* exclusionType) { if (mAbsoluteMaximumExclusionValue) { if (mAbsoluteMaximumExclusionValue->getValue()->isLessThan(value)) { return true; } if (mAbsoluteMaximumExclusionValue->getValue()->isEqualTo(value)) { if (isDataValueExcluded(mAbsoluteMaximumExclusionValue,exclusionType)) { return true; } if (!valueInclusively) { return true; } } } CDatatypeRealValueSpaceMapArranger mapValueArranger(value); CDatatypeRealValueSpaceMap::const_iterator itLB = CDatatypeRealValueSpaceMap::lowerBound(mapValueArranger), it = CDatatypeRealValueSpaceMap::constBegin(), itEnd = CDatatypeRealValueSpaceMap::constEnd(); if (it == itEnd) { // no restrictions in value map return false; } if (itLB == itEnd) { // value is after last value --> excluded return true; } it = itLB; while (it != itEnd) { const CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* realValueData = mapData.mUseValue; if (it == itLB) { if (realValueData->getValue()->isEqualTo(value)) { if (valueInclusively && !isDataValueExcluded(realValueData,exclusionType)) { return false; } } else { if (!isDataIntervalExcluded(value,realValueData,exclusionType)) { return false; } if (!isDataValueExcluded(realValueData,exclusionType)) { return false; } if (valueInclusively && !isDataValueExcluded(value,exclusionType)) { return false; } } } ++it; if (it != itEnd) { const CDatatypeRealValueSpaceMapData& nextMapData = it.value(); CDatatypeRealValueData* nextRealValueData = nextMapData.mUseValue; if (!isDataValueExcluded(nextRealValueData,exclusionType)) { return false; } if (!isDataIntervalExcluded(realValueData,nextRealValueData,exclusionType)) { return false; } } else { if (!isRightDataIntervalExcluded(realValueData,exclusionType)) { return false; } } } return true; } bool CDatatypeRealValueSpaceMap::isValueExcluded(CDataLiteralRealValue* value, CDatatypeRealValueExclusionType* exclusionType) { if (isDataValueExcluded(value,exclusionType)) { return true; } return false; } bool CDatatypeRealValueSpaceMap::getNextPossibleDataValue(CDataLiteralRealValue* nextValue, CDataLiteralRealValue* lastValue) { if (!lastValue) { if (!mAbsoluteMinimumExclusionValue) { return false; } lastValue = mAbsoluteMinimumExclusionValue->getValue(); if (!isDataValueExcluded(mAbsoluteMinimumExclusionValue,nullptr)) { if (lastValue->hasFlag(CDataLiteralRealValue::DLRV_INTEGER_FLAG)) { if (lastValue->isInfinite()) { return false; } else { nextValue->initValue(lastValue); return true; } } } } CDatatypeRealValueSpaceMapArranger mapValueArranger(lastValue); CDatatypeRealValueSpaceMap::iterator itBegin = CDatatypeRealValueSpaceMap::begin(), itLB = CDatatypeRealValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeRealValueSpaceMap::end(); CDatatypeRealValueSpaceMap::iterator it = itLB; while (it != itEnd) { if (it == itLB) { CDatatypeRealValueData* itValueData = it.value().mUseValue; while (lastValue->isLessThan(itValueData->getValue())) { CDatatypeRealValueSpaceMap::iterator itLast = it; --itLast; if (itLast != itEnd) { --it; } else { if (!isLeftDataIntervalExcluded(itValueData,nullptr)) { if (!itValueData->getLeftExclusionData()->areOnlyIntegerValuesAllowed()) { return false; } nextValue->initRationalValueFromNextIntegerValue(lastValue); if (nextValue->isLessThan(itValueData->getValue())) { return true; } else if (nextValue->isEqualTo(itValueData->getValue())) { if (!isDataValueExcluded(itValueData,nullptr)) { return true; } } } break; } } } CDatatypeRealValueSpaceMapData& mapData = it.value(); CDatatypeRealValueData* itValueData = mapData.mUseValue; if (itValueData->getValue()->isGreaterThan(lastValue)) { lastValue = itValueData->getValue(); } ++it; if (it != itEnd) { CDatatypeRealValueSpaceMapData& nextMapData = it.value(); CDatatypeRealValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData,nullptr)) { if (!itValueData->getRightExclusionData()->areOnlyIntegerValuesAllowed()) { return false; } CDataLiteralRealValue* value = itValueData->getValue(); nextValue->initRationalValueFromNextIntegerValue(lastValue); if (nextValue->isLessThan(nextValueData->getValue())) { return true; } else if (nextValue->isEqualTo(nextValueData->getValue())) { if (!isDataValueExcluded(nextValueData,nullptr)) { return true; } } } else if (!isDataValueExcluded(nextValueData,nullptr)) { nextValue->initRationalValueFromNextIntegerValue(lastValue); if (nextValue->isEqualTo(nextValueData->getValue())) { return true; } } } else { if (!isRightDataIntervalExcluded(itValueData,nullptr) || !itValueData->getRightExclusionData()->areOnlyIntegerValuesAllowed()) { return false; } else { nextValue->initRationalValueFromNextIntegerValue(lastValue); return true; } } } return false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeSuccessorExtensionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeSuccessorExte0000644000175000017500000000722412520551154032421 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODESUCCESSOREXTENSIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODESUCCESSOREXTENSIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRoleSaturationProcessLinker.h" #include "CSaturationIndividualNodeExtensionResolveData.h" #include "CSaturationIndividualNodeALLConceptsExtensionData.h" #include "CSaturationIndividualNodeFUNCTIONALConceptsExtensionData.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationIndividualNodeSuccessorExtensionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationIndividualNodeSuccessorExtensionData { // public methods public: //! Constructor CSaturationIndividualNodeSuccessorExtensionData(CProcessContext* processContext); CSaturationIndividualNodeSuccessorExtensionData* initExtensionData(CIndividualSaturationProcessNode* indiProcessNode); CSaturationIndividualNodeExtensionResolveData* getAncestorSuccessorMergeResolveData(bool create = true); CSaturationIndividualNodeExtensionResolveData* getBaseExtensionResolveData(bool create = true); CSaturationIndividualNodeExtensionResolveData* getExtensionResolveData(); CSaturationIndividualNodeSuccessorExtensionData* setExtensionResolveData(CSaturationIndividualNodeExtensionResolveData* resolveData); bool isExtensionProcessingQueued(); CSaturationIndividualNodeSuccessorExtensionData* setExtensionProcessingQueued(bool queued); CSaturationIndividualNodeALLConceptsExtensionData* getALLConceptsExtensionData(bool create = true); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* getFUNCTIONALConceptsExtensionData(bool create = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; bool mExtensionProcessingQueued; CIndividualSaturationProcessNode* mIndiProcessNode; CSaturationIndividualNodeExtensionResolveData* mExtensionResolveData; CSaturationIndividualNodeExtensionResolveData* mAncSuccMergeResolveData; CSaturationIndividualNodeALLConceptsExtensionData* mALLConceptsExtensionData; CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* mFUNCTIONALConceptsExtensionData; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODESUCCESSOREXTENSIONDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingCandidateHash.cpp0000644000175000017500000001020012520551160031506 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureBlockingCandidateHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSignatureBlockingCandidateHash::CSignatureBlockingCandidateHash(CProcessContext* context) : mContext(context),mSigBlockCandidateHash(context) { mMemMan = mContext->getUsedMemoryAllocationManager(); } CSignatureBlockingCandidateHash* CSignatureBlockingCandidateHash::initSignatureBlockingCandidateHash(CSignatureBlockingCandidateHash* prevSigBlockCandHash) { if (prevSigBlockCandHash) { mSigBlockCandidateHash = prevSigBlockCandHash->mSigBlockCandidateHash; } else { mSigBlockCandidateHash.clear(); } return this; } CSignatureBlockingCandidateHash* CSignatureBlockingCandidateHash::insertSignatureBlockingCandidate(cint64 signature, CIndividualProcessNode* individualCandidate) { CSignatureBlockingCandidateData& data = mSigBlockCandidateHash[signature]; CXLinker* candLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(mMemMan); cint64 indiCandID = individualCandidate->getIndividualID(); candLinker->initLinker(indiCandID,data.mCandidateIndiLinker); data.mCandidateIndiLinker = candLinker; data.mCandidateCount++; return this; } CSignatureBlockingCandidateHash* CSignatureBlockingCandidateHash::insertSignatureBlockingCandidates(cint64 signature, CXLinker* candidateLinker) { CSignatureBlockingCandidateData& data = mSigBlockCandidateHash[signature]; data.mCandidateCount += candidateLinker->getCount(); if (data.mCandidateIndiLinker) { candidateLinker->append(data.mCandidateIndiLinker); } data.mCandidateIndiLinker = candidateLinker; return this; } CSignatureBlockingCandidateIterator CSignatureBlockingCandidateHash::getBlockingCandidatesIterator(cint64 signature) { CSignatureBlockingCandidateData* data = mSigBlockCandidateHash.valuePointer(signature); if (data) { return CSignatureBlockingCandidateIterator(signature,data->mCandidateIndiLinker); } else { return CSignatureBlockingCandidateIterator(signature,nullptr); } } cint64 CSignatureBlockingCandidateHash::getBlockingCandidatesCount(cint64 signature) { CSignatureBlockingCandidateData* data = mSigBlockCandidateHash.valuePointer(signature); if (data) { return data->mCandidateCount; } return 0; } cint64 CSignatureBlockingCandidateHash::getBlockingCandidatesCount(CConceptSetSignature* signature) { return getBlockingCandidatesCount(signature->getSignatureValue()); } CSignatureBlockingCandidateHash* CSignatureBlockingCandidateHash::insertSignatureBlockingCandidate(CConceptSetSignature* signature, CIndividualProcessNode* individualCandidate) { return insertSignatureBlockingCandidate(signature->getSignatureValue(),individualCandidate); } CSignatureBlockingCandidateIterator CSignatureBlockingCandidateHash::getBlockingCandidatesIterator(CConceptSetSignature* signature) { return getBlockingCandidatesIterator(signature->getSignatureValue()); } CSignatureIterator CSignatureBlockingCandidateHash::getSignatureIterator() { return CSignatureIterator(&mSigBlockCandidateHash); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDisjointSuccessorRoleHash.cpp0000644000175000017500000000743712520551120030614 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDisjointSuccessorRoleHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDisjointSuccessorRoleHash::CDisjointSuccessorRoleHash(CProcessContext* context) : mSuccNegDisEdgeHash(context),mContext(context) { } CDisjointSuccessorRoleHash::~CDisjointSuccessorRoleHash() { } CDisjointSuccessorRoleHash* CDisjointSuccessorRoleHash::initDisjointSuccessorRoleHash(CDisjointSuccessorRoleHash* prevDisjRoleHash) { if (prevDisjRoleHash) { mSuccNegDisEdgeHash = prevDisjRoleHash->mSuccNegDisEdgeHash; } else { mSuccNegDisEdgeHash.clear(); } return this; } CPROCESSHASH* CDisjointSuccessorRoleHash::getNegDisRoleHash(cint64 successor, bool located) { if (!located) { CDisjointSuccessorRoleData* data = nullptr; if (mSuccNegDisEdgeHash.tryGetValuePointer(successor,data)) { return data->mUseNegDisSet; } return nullptr; } else { CDisjointSuccessorRoleData& data = mSuccNegDisEdgeHash[successor]; if (!data.mLocNegDisSet) { CPROCESSHASH* newNegDisSet = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mContext),mContext); data.mLocNegDisSet = newNegDisSet; data.mUseNegDisSet = newNegDisSet; } return data.mUseNegDisSet; } } CDisjointSuccessorRoleHash* CDisjointSuccessorRoleHash::insertDisjointSuccessorRoleLink(cint64 succIndi, CNegationDisjointEdge* link) { getNegDisRoleHash(succIndi,true)->insert(link->getLinkRole(),link); return this; } bool CDisjointSuccessorRoleHash::hasDisjointSuccessorRoleLink(cint64 succIndi, CRole* role) { CPROCESSHASH* dataHash = getNegDisRoleHash(succIndi,false); if (dataHash) { return dataHash->contains(role); } return false; } CNegationDisjointEdge* CDisjointSuccessorRoleHash::getDisjointSuccessorRoleLink(cint64 succIndi, CRole* role) { CNegationDisjointEdge* link = nullptr; CPROCESSHASH* dataHash = getNegDisRoleHash(succIndi,false); if (dataHash) { link = dataHash->value(role,nullptr); } return link; } CDisjointSuccessorRoleHash* CDisjointSuccessorRoleHash::removeDisjointSuccessorRoleLinks(cint64 succIndi) { mSuccNegDisEdgeHash.remove(succIndi); return this; } CDisjointSuccessorRoleIterator CDisjointSuccessorRoleHash::getDisjointRoleIterator(cint64 succIndi) { CPROCESSHASH* dataHash = getNegDisRoleHash(succIndi,false); if (dataHash) { return CDisjointSuccessorRoleIterator(succIndi,dataHash->begin(),dataHash->end()); } return CDisjointSuccessorRoleIterator(); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleBackwardSaturationPropagationHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleBackwardSaturationPropagationHash0000644000175000017500000001136112520551150032344 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleBackwardSaturationPropagationHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRoleBackwardSaturationPropagationHash::CRoleBackwardSaturationPropagationHash(CProcessContext* context) : mContext(context),mRoleBackPropDataHash(context) { } CRoleBackwardSaturationPropagationHash* CRoleBackwardSaturationPropagationHash::initRoleBackwardSaturationPropagationHash() { mRoleBackPropDataHash.clear(); mSelfConnected = false; return this; } CRoleBackwardSaturationPropagationHash* CRoleBackwardSaturationPropagationHash::copyRoleBackwardSaturationPropagationHash(CRoleBackwardSaturationPropagationHash* copyRoleBackPilPropHash, CIndividualSaturationProcessNode* newIndiNode) { CMemoryAllocationManager* memMan = mContext->getUsedMemoryAllocationManager(); mRoleBackPropDataHash = copyRoleBackPilPropHash->mRoleBackPropDataHash; mRoleBackPropDataHash.detach(); mSelfConnected = copyRoleBackPilPropHash->mSelfConnected; if (mSelfConnected) { // create a connection to itself for all corresponding roles for (CPROCESSHASH::iterator it = mRoleBackPropDataHash.begin(), itEnd = mRoleBackPropDataHash.end(); it != itEnd; ++it) { CRole* role = it.key(); CRoleBackwardSaturationPropagationHashData& hashData(it.value()); if (hashData.mSelfConnected) { CBackwardSaturationPropagationLink* selfBackLink = CObjectAllocator::allocateAndConstruct(memMan); selfBackLink->initBackwardPropagationLink(newIndiNode,role); hashData.mLinkLinker = selfBackLink->append(hashData.mLinkLinker); } } } return this; } CBackwardSaturationPropagationReapplyDescriptor* CRoleBackwardSaturationPropagationHash::getBackwardPropagationBackwardPropagationConceptDescriptor(CRole* role) { const CRoleBackwardSaturationPropagationHashData backPropData = mRoleBackPropDataHash.value(role); return backPropData.mReapplyLinker; } CBackwardSaturationPropagationReapplyDescriptor* CRoleBackwardSaturationPropagationHash::addBackwardPropagationLink(CRole* role, CBackwardSaturationPropagationLink* link) { CRoleBackwardSaturationPropagationHashData& backPropData = mRoleBackPropDataHash[role]; if (backPropData.mLinkLinker) { if (backPropData.mLinkLinker->getSourceIndividual() == link->getSourceIndividual()) { return nullptr; } } backPropData.mLinkLinker = link->append(backPropData.mLinkLinker); return backPropData.mReapplyLinker; } CBackwardSaturationPropagationReapplyDescriptor* CRoleBackwardSaturationPropagationHash::addSelfConnectedBackwardPropagationLink(CRole* role, CBackwardSaturationPropagationLink* link) { mSelfConnected = true; CRoleBackwardSaturationPropagationHashData& backPropData = mRoleBackPropDataHash[role]; if (backPropData.mLinkLinker) { if (backPropData.mLinkLinker->getSourceIndividual() == link->getSourceIndividual()) { return nullptr; } } backPropData.mLinkLinker = link->append(backPropData.mLinkLinker); backPropData.mSelfConnected = true; return backPropData.mReapplyLinker; } CRoleBackwardSaturationPropagationHashData& CRoleBackwardSaturationPropagationHash::addBackwardPropagationConceptDescriptor(CRole* role, CBackwardSaturationPropagationReapplyDescriptor* reapplyConDes) { CRoleBackwardSaturationPropagationHashData& backPropData = mRoleBackPropDataHash[role]; backPropData.mReapplyLinker = reapplyConDes->append(backPropData.mReapplyLinker); return backPropData; } CPROCESSHASH* CRoleBackwardSaturationPropagationHash::getRoleBackwardPropagationDataHash() { return &mRoleBackPropDataHash; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorConceptExtensionMapData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorConceptExtensionMa0000644000175000017500000000404312520551156032441 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORCONCEPTEXTENSIONMAPDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORCONCEPTEXTENSIONMAPDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationSuccessorConceptExtensionMapData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationSuccessorConceptExtensionMapData { // public methods public: //! Constructor CSaturationSuccessorConceptExtensionMapData(); CConcept* mConcept; bool mPositive; bool mNegative; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORCONCEPTEXTENSIONMAPDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingFollowUpdateTag.h0000644000175000017500000000536012520551072027667 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGFOLLOWUPDATETAG_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGFOLLOWUPDATETAG_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessTag.h" #include "CProcessTagger.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CBlockingFollowUpdateTag * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBlockingFollowUpdateTag : public CProcessTag { // public methods public: //! Constructor CBlockingFollowUpdateTag(cint64 processTag = 0); //! Destructor virtual ~CBlockingFollowUpdateTag(); cint64 getBlockingFollowTag(); CBlockingFollowUpdateTag* setBlockingFollowTag(cint64 BlockingFollowTag); CBlockingFollowUpdateTag* setBlockingFollowTag(CProcessTagger* processTagger); CBlockingFollowUpdateTag* initBlockingFollowTag(cint64 BlockingFollowTag); CBlockingFollowUpdateTag* initBlockingFollowTag(CProcessTagger* processTagger); bool updateBlockingFollowTag(cint64 BlockingFollowTag); bool updateBlockingFollowTag(CProcessTagger* processTagger); bool isBlockingFollowTagUpdated(cint64 BlockingFollowTag); bool isBlockingFollowTagUpToDate(cint64 BlockingFollowTag); bool isBlockingFollowTagUpdated(CProcessTagger* processTagger); bool isBlockingFollowTagUpToDate(CProcessTagger* processTagger); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGFOLLOWUPDATETAG_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingStatisticDescription.h0000644000175000017500000000453112520551134031363 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGSTATISTICDESCRIPTION_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGSTATISTICDESCRIPTION_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessingStatisticRegistrator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CProcessingStatisticDescription * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessingStatisticDescription { // public methods public: //! Constructor CProcessingStatisticDescription(CProcessingStatisticRegistrator* registrator, const cint64 index, const QString& descriptionString); //! Destructor virtual ~CProcessingStatisticDescription(); inline cint64 getStatisticGatheringIndex() const; QString getStatisticDescriptionString() const; // protected methods protected: // protected variables protected: cint64 mStatGatheringIndex; QString mStatDescriptionString; // private methods private: // private variables private: }; cint64 CProcessingStatisticDescription::getStatisticGatheringIndex() const { return mStatGatheringIndex; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGSTATISTICDESCRIPTION_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeIncrementalExpansionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeIncrementalExpansionDat0000644000175000017500000002336012520551124032323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeIncrementalExpansionData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeIncrementalExpansionData::CIndividualNodeIncrementalExpansionData(CProcessContext* processContext) : mProcessContext(processContext) { } CIndividualNodeIncrementalExpansionData* CIndividualNodeIncrementalExpansionData::initIncrementalExpansionData(CIndividualNodeIncrementalExpansionData* prevData) { if (prevData) { mDirectlyChanged = prevData->mDirectlyChanged; mDirectlyChangedNeighbourConnNode = prevData->mDirectlyChangedNeighbourConnNode; mCompletionGraphCompatible = prevData->mCompletionGraphCompatible; mLastCompatibleCheckedConDes = prevData->mLastCompatibleCheckedConDes; mLastCompatibleCheckedLink = prevData->mLastCompatibleCheckedLink; mPrevCompGraphCorrIndiNode = prevData->mPrevCompGraphCorrIndiNode; mPrevCompGraphCorrIndiNodeLoaded = prevData->mPrevCompGraphCorrIndiNodeLoaded; mUseNeighbourPropagatedDirectlyChangedList = prevData->mUseNeighbourPropagatedDirectlyChangedList; mLocNeighbourPropagatedDirectlyChangedList = nullptr; mUseIncrementalExpansionList = prevData->mUseIncrementalExpansionList; mLocIncrementalExpansionList = nullptr; mIncremetnalExpansionListInitialized = prevData->mIncremetnalExpansionListInitialized; mExpansionPriority = prevData->mExpansionPriority; } else { mDirectlyChanged = false; mDirectlyChangedNeighbourConnNode = nullptr; mCompletionGraphCompatible = false; mPrevCompGraphCorrIndiNodeLoaded = false; mLastCompatibleCheckedConDes = nullptr; mLastCompatibleCheckedLink = nullptr; mPrevCompGraphCorrIndiNode = nullptr; mLocNeighbourPropagatedDirectlyChangedList = nullptr; mUseNeighbourPropagatedDirectlyChangedList = nullptr; mLocIncrementalExpansionList = nullptr; mUseIncrementalExpansionList = nullptr; mIncremetnalExpansionListInitialized = false; mExpansionPriority = 0.; } return this; } CIndividualProcessNode* CIndividualNodeIncrementalExpansionData::getDirectlyChangedNeighbourConnectionNode() { return mDirectlyChangedNeighbourConnNode; } CIndividualNodeIncrementalExpansionData* CIndividualNodeIncrementalExpansionData::setDirectlyChangedNeighbourConnectionNode(CIndividualProcessNode* node) { mDirectlyChangedNeighbourConnNode = node; return this; } bool CIndividualNodeIncrementalExpansionData::hasDirectlyChangedNeighbourConnection() { return mDirectlyChangedNeighbourConnNode != nullptr; } bool CIndividualNodeIncrementalExpansionData::isCompatibilityChanged() { return mDirectlyChanged && hasDirectlyChangedNeighbourConnection(); } bool CIndividualNodeIncrementalExpansionData::isDirectlyChanged() { return mDirectlyChanged; } CIndividualNodeIncrementalExpansionData* CIndividualNodeIncrementalExpansionData::setDirectlyChanged(bool directlyChanged) { mDirectlyChanged = directlyChanged; return this; } bool CIndividualNodeIncrementalExpansionData::isPreviousCompletionGraphCompatible() { return mCompletionGraphCompatible; } CIndividualNodeIncrementalExpansionData* CIndividualNodeIncrementalExpansionData::setPreviousCompletionGraphCompatible(bool compatible) { mCompletionGraphCompatible = compatible; return this; } CConceptDescriptor* CIndividualNodeIncrementalExpansionData::getLastCompatibleCheckedConceptDescriptor() { return mLastCompatibleCheckedConDes; } CLinkEdge* CIndividualNodeIncrementalExpansionData::getLastCompatibleCheckedLink() { return mLastCompatibleCheckedLink; } CIndividualNodeIncrementalExpansionData* CIndividualNodeIncrementalExpansionData::setLastCompatibleCheckedConceptDescriptor(CConceptDescriptor* conDes) { mLastCompatibleCheckedConDes = conDes; return this; } CIndividualNodeIncrementalExpansionData* CIndividualNodeIncrementalExpansionData::setLastCompatibleCheckedLink(CLinkEdge* link) { mLastCompatibleCheckedLink = link; return this; } CIndividualProcessNode* CIndividualNodeIncrementalExpansionData::getPreviousCompletionGraphCorrespondenceIndividualNode() { return mPrevCompGraphCorrIndiNode; } CIndividualNodeIncrementalExpansionData* CIndividualNodeIncrementalExpansionData::setPreviousCompletionGraphCorrespondenceIndividualNode(CIndividualProcessNode* node) { mPrevCompGraphCorrIndiNode = node; return this; } bool CIndividualNodeIncrementalExpansionData::isPreviousCompletionGraphCorrespondenceIndividualNodeLoaded() { return mPrevCompGraphCorrIndiNodeLoaded; } CIndividualNodeIncrementalExpansionData* CIndividualNodeIncrementalExpansionData::setPreviousCompletionGraphCorrespondenceIndividualNodeLoaded(bool loaded) { mPrevCompGraphCorrIndiNodeLoaded = loaded; return this; } CIndividualNodeIncrementalExpansionData* CIndividualNodeIncrementalExpansionData::addNeighbourPropagatedDirectlyChanged(CIndividualProcessNode* indiNode) { getNeighbourPropagatedDirectlyChangedList(true)->append(indiNode); return this; } CIndividualNodeIncrementalExpansionData* CIndividualNodeIncrementalExpansionData::clearNeighbourPropagatedDirectlyChangedList() { if (mUseNeighbourPropagatedDirectlyChangedList && !mUseNeighbourPropagatedDirectlyChangedList->isEmpty()) { getNeighbourPropagatedDirectlyChangedList(true)->clear(); } return this; } bool CIndividualNodeIncrementalExpansionData::hasNeighbourPropagatedDirectlyChanged() { if (mUseNeighbourPropagatedDirectlyChangedList && !mUseNeighbourPropagatedDirectlyChangedList->isEmpty()) { return true; } return false; } CPROCESSLIST* CIndividualNodeIncrementalExpansionData::getNeighbourPropagatedDirectlyChangedList(bool create) { if (!mLocNeighbourPropagatedDirectlyChangedList && create) { mLocNeighbourPropagatedDirectlyChangedList = CObjectParameterizingAllocator< CPROCESSLIST,CContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (mUseNeighbourPropagatedDirectlyChangedList) { *mLocNeighbourPropagatedDirectlyChangedList = *mUseNeighbourPropagatedDirectlyChangedList; } mUseNeighbourPropagatedDirectlyChangedList = mLocNeighbourPropagatedDirectlyChangedList; } return mUseNeighbourPropagatedDirectlyChangedList; } CPROCESSLIST* CIndividualNodeIncrementalExpansionData::getIncrementalExpansionList(bool create) { if (!mLocIncrementalExpansionList && create) { mLocIncrementalExpansionList = CObjectParameterizingAllocator< CPROCESSLIST,CContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (mUseIncrementalExpansionList) { *mLocIncrementalExpansionList = *mUseIncrementalExpansionList; } mUseIncrementalExpansionList = mLocIncrementalExpansionList; } return mUseIncrementalExpansionList; } bool CIndividualNodeIncrementalExpansionData::isIncremetnalExpansionListInitialized() { return mIncremetnalExpansionListInitialized; } CIndividualNodeIncrementalExpansionData* CIndividualNodeIncrementalExpansionData::setIncremetnalExpansionListInitialized(bool initialized) { mIncremetnalExpansionListInitialized = initialized; return this; } bool CIndividualNodeIncrementalExpansionData::requiresFurtherIncrementalExpansion() { if (mUseIncrementalExpansionList && !mUseIncrementalExpansionList->isEmpty()) { return true; } return false; } double CIndividualNodeIncrementalExpansionData::getExpansionPriority() { return mExpansionPriority; } CIndividualNodeIncrementalExpansionData* CIndividualNodeIncrementalExpansionData::setExpansionPriority(double priority) { mExpansionPriority = priority; return this; } CIndividualNodeIncrementalExpansionData* CIndividualNodeIncrementalExpansionData::setExpansionID(cint64 id) { mExpansionPriority = (cint64)id; return this; } double CIndividualNodeIncrementalExpansionData::getNextIncrementalExpansionPriority() { return mExpansionPriority + 1.0; } CIndividual* CIndividualNodeIncrementalExpansionData::takeNextIncrementalExpansionIndividual() { if (mUseIncrementalExpansionList && !mUseIncrementalExpansionList->isEmpty()) { return mUseIncrementalExpansionList->takeFirst(); } return nullptr; } CIndividual* CIndividualNodeIncrementalExpansionData::getNextIncrementalExpansionIndividual() { if (mUseIncrementalExpansionList && !mUseIncrementalExpansionList->isEmpty()) { return mUseIncrementalExpansionList->first(); } return nullptr; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CAnalizedConceptExpansionLinker.cpp0000644000175000017500000000476312520551070031611 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalizedConceptExpansionLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CAnalizedConceptExpansionLinker::CAnalizedConceptExpansionLinker() : CLinkerBase(this) { mDependendConDesLinker = nullptr; mConDes = nullptr; } CAnalizedConceptExpansionLinker* CAnalizedConceptExpansionLinker::initAnalizedConceptExpansion(CXLinker* dependendConDesLinker, CConceptDescriptor* conDes) { mDependendConDesLinker = dependendConDesLinker; mConDes = conDes; return this; } CAnalizedConceptExpansionLinker* CAnalizedConceptExpansionLinker::addDependendConceptDescriptorLinker(CXLinker* dependendConDesLinker) { if (mDependendConDesLinker) { mDependendConDesLinker = dependendConDesLinker->append(mDependendConDesLinker); } else { mDependendConDesLinker = dependendConDesLinker; } return this; } CAnalizedConceptExpansionLinker* CAnalizedConceptExpansionLinker::setConceptDescriptor(CConceptDescriptor* conDes) { mConDes = conDes; return this; } CConceptDescriptor* CAnalizedConceptExpansionLinker::getConceptDescriptor() { return mConDes; } CXLinker* CAnalizedConceptExpansionLinker::getDependendConceptDescriptorLinker() { return mDependendConDesLinker; } bool CAnalizedConceptExpansionLinker::hasMultipleDependencies() { return mDependendConDesLinker && mDependendConDesLinker->hasNext(); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPreviousIndividualIDSet.h0000644000175000017500000000471712520551134027677 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPREVIOUSINDIVIDUALIDSET_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPREVIOUSINDIVIDUALIDSET_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" #include "CProcessContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CPreviousIndividualIDSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPreviousIndividualIDSet : public CPROCESSSET { // public methods public: //! Constructor CPreviousIndividualIDSet(CProcessContext* context = nullptr); CPreviousIndividualIDSet(const CPreviousIndividualIDSet& disHash, CContext* context = nullptr); //! Destructor virtual ~CPreviousIndividualIDSet(); CPreviousIndividualIDSet* initPreviousIndividualIDSet(CPreviousIndividualIDSet* prevIDSet); bool hasPreviousIndividualID(CIndividualProcessNode* indi); bool hasPreviousIndividualID(cint64 indiID); CPreviousIndividualIDSet* insertPreviousIndividualID(cint64 indiID); CPreviousIndividualIDSet* insertPreviousIndividualID(CIndividualProcessNode* indi); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPREVIOUSINDIVIDUALIDSET_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CAdditionalProcessRoleAssertionsLinker.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CAdditionalProcessRoleAssertionsLinker0000644000175000017500000000400012520551070032364 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAdditionalProcessRoleAssertionsLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CAdditionalProcessRoleAssertionsLinker::CAdditionalProcessRoleAssertionsLinker() : CLinkerBase() { } CAdditionalProcessRoleAssertionsLinker* CAdditionalProcessRoleAssertionsLinker::initAdditionalProcessRoleAssertionsLinker(CIndividual* individual, CRoleAssertionLinker* roleAssertionLinker, CReverseRoleAssertionLinker* reverseRoleAssertionLinker) { setData(individual); mRoleAssertionLinker = roleAssertionLinker; mReverseRoleAssertionLinker = reverseRoleAssertionLinker; return this; } CIndividual* CAdditionalProcessRoleAssertionsLinker::getIndividual() { return getData(); } CRoleAssertionLinker* CAdditionalProcessRoleAssertionsLinker::getRoleAssertionLinker() { return mRoleAssertionLinker; } CReverseRoleAssertionLinker* CAdditionalProcessRoleAssertionsLinker::getReverseRoleAssertionLinker() { return mReverseRoleAssertionLinker; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalIndividualNodeConceptTestSet.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalIndividualNodeConceptTestSet.0000644000175000017500000000552012520551104032200 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCriticalIndividualNodeConceptTestSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CCriticalIndividualNodeConceptTestSet::CCriticalIndividualNodeConceptTestSet(CProcessContext* processContext) : mProcessContext(processContext),mIndiConceptTestedSet(processContext) { } CCriticalIndividualNodeConceptTestSet* CCriticalIndividualNodeConceptTestSet::initIndividualNodeConceptTestSet(CCriticalIndividualNodeConceptTestSet* processingQueue) { if (processingQueue) { mIndiConceptTestedSet = processingQueue->mIndiConceptTestedSet; } else { mIndiConceptTestedSet.clear(); } return this; } bool CCriticalIndividualNodeConceptTestSet::isConceptTestedForIndividual(CConcept* concept, CIndividualSaturationProcessNode* individual) { return mIndiConceptTestedSet.contains( QPair(individual,concept) ); } bool CCriticalIndividualNodeConceptTestSet::isConceptTestedForIndividual(CConceptSaturationDescriptor* criticalConDes, CIndividualSaturationProcessNode* individual) { return mIndiConceptTestedSet.contains( QPair(individual,criticalConDes->getConcept()) ); } CCriticalIndividualNodeConceptTestSet* CCriticalIndividualNodeConceptTestSet::insertConceptTestedForIndividual(CConcept* concept, CIndividualSaturationProcessNode* individual) { mIndiConceptTestedSet.insert( QPair(individual,concept) ); return this; } CCriticalIndividualNodeConceptTestSet* CCriticalIndividualNodeConceptTestSet::insertConceptTestedForIndividual(CConceptSaturationDescriptor* criticalConDes, CIndividualSaturationProcessNode* individual) { mIndiConceptTestedSet.insert( QPair(individual,criticalConDes->getConcept()) ); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningKeyMap.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJ0000644000175000017500000000565712520551150032301 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathSetJoiningKeyMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathSetJoiningKeyMap::CRepresentativeVariableBindingPathSetJoiningKeyMap(CProcessContext* processContext) : mProcessContext(processContext),CPROCESSMAP(processContext) { } CRepresentativeVariableBindingPathSetJoiningKeyMap* CRepresentativeVariableBindingPathSetJoiningKeyMap::initRepresentativeVariableBindingPathSetJoiningKeyMap(CRepresentativeVariableBindingPathSetJoiningKeyMap* prevMap) { if (prevMap) { *this = *prevMap; } else { CPROCESSMAP::clear(); } return this; } CRepresentativeVariableBindingPathSetJoiningKeyDataMap* CRepresentativeVariableBindingPathSetJoiningKeyMap::getJoiningKeyDataMap(cint64 joiningKey, bool create) { CRepresentativeVariableBindingPathSetJoiningKeyDataMap* dataMap = nullptr; if (create) { CRepresentativeVariableBindingPathSetJoiningKeyMapData& data = CPROCESSMAP::operator[](joiningKey); dataMap = data.getRepresentativeVariableBindingPathSetJoiningKeyDataMap(); if (!dataMap) { dataMap = CObjectParameterizingAllocator< CRepresentativeVariableBindingPathSetJoiningKeyDataMap,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); dataMap->initVariableBindingPathSetJoiningKeyDataMap(nullptr); data.setRepresentativeVariableBindingPathSetJoiningKeyDataMap(dataMap); } } else { const CRepresentativeVariableBindingPathSetJoiningKeyMapData& data = CPROCESSMAP::value(joiningKey); dataMap = data.getRepresentativeVariableBindingPathSetJoiningKeyDataMap(); } return dataMap; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CLinkProcessingRestrictionSpecification.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CLinkProcessingRestrictionSpecificatio0000644000175000017500000000274512520551130032431 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLinkProcessingRestrictionSpecification.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CLinkProcessingRestrictionSpecification::CLinkProcessingRestrictionSpecification() { mRestLink = nullptr; } CIndividualLinkEdge* CLinkProcessingRestrictionSpecification::getLinkRestriction() { return mRestLink; } CLinkProcessingRestrictionSpecification* CLinkProcessingRestrictionSpecification::initLinkRestriction(CIndividualLinkEdge* restLink) { mRestLink = restLink; return this; } }; // end namespace Kernel }; // end namespace Process }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptDescriptor.h0000644000175000017500000000501312520551076026606 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTDESCRIPTOR_H // Libraries includes #include // Namespace includes #include "ProcessSettings.h" #include "CDependencyTracker.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Utilities/Container/CNegLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CConceptDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptDescriptor : public CNegLinkerBase, public CDependencyTracker { // public methods public: //! Constructor CConceptDescriptor(); CConceptDescriptor* initConceptDescriptor(CConcept* concept, bool negated, CDependencyTrackPoint* depTrackPoint); bool isEqualsToBOTTOM(bool negated = false); bool isEqualsToTOP(bool negated = false); CConcept *getConcept(); qint64 getConceptTag(); qint64 getTerminologyTag(); QPair getTerminologyConceptTagPair(); bool isClashWith(CConceptDescriptor *conDesNegLinker); CConceptDescriptor *getNextConceptDesciptor(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceMapData.h0000644000175000017500000000412212520551110031424 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUESPACEMAPDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUESPACEMAPDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeCompareValueData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CDatatypeCompareValueSpaceMapData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeCompareValueSpaceMapData { // public methods public: //! Constructor CDatatypeCompareValueSpaceMapData(); CDatatypeCompareValueSpaceMapData(const CDatatypeCompareValueSpaceMapData& data); CDatatypeCompareValueData* mLocValue; CDatatypeCompareValueData* mUseValue; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUESPACEMAPDATA_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceMapArranger.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceMapArranger.c0000644000175000017500000000323012520551114032172 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeStringValueSpaceMapArranger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeStringValueSpaceMapArranger::CDatatypeStringValueSpaceMapArranger(CDataLiteralStringValue* value) { mValue = value; } CDataLiteralStringValue* CDatatypeStringValueSpaceMapArranger::getValue() const { return mValue; } bool CDatatypeStringValueSpaceMapArranger::operator<(const CDatatypeStringValueSpaceMapArranger& valueData) const { return mValue->isLessThan(valueData.mValue); } bool CDatatypeStringValueSpaceMapArranger::operator<=(const CDatatypeStringValueSpaceMapArranger& valueData) const { return mValue->isLessEqualThan(valueData.mValue); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBackwardSaturationPropagationReapplyDescriptor.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBackwardSaturationPropagationReapplyD0000644000175000017500000000364112520551072032364 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackwardSaturationPropagationReapplyDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBackwardSaturationPropagationReapplyDescriptor::CBackwardSaturationPropagationReapplyDescriptor() : CLinkerBase(nullptr) { } CBackwardSaturationPropagationReapplyDescriptor* CBackwardSaturationPropagationReapplyDescriptor::initBackwardPropagationReapplyDescriptor(CConceptSaturationDescriptor* conDes) { setData(conDes); return this; } CBackwardSaturationPropagationReapplyDescriptor* CBackwardSaturationPropagationReapplyDescriptor::initBackwardPropagationReapplyDescriptor(CBackwardSaturationPropagationReapplyDescriptor* reapplyDes) { setData(reapplyDes->getData()); return this; } CConceptSaturationDescriptor* CBackwardSaturationPropagationReapplyDescriptor::getReapplyConceptSaturationDescriptor() { return getData(); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeXMLValueSpaceData.h0000644000175000017500000000503712520551116030054 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEXMLVALUESPACEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEXMLVALUESPACEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeXMLValueSpaceMap.h" #include "CDatatypeCompareValueSpaceData.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceXMLType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeXMLValueSpaceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeXMLValueSpaceData : public CDatatypeCompareValueSpaceData { // public methods public: //! Constructor CDatatypeXMLValueSpaceData(CProcessContext* processContext); CDatatypeXMLValueSpaceData* copyXMLValueSpaceData(CDatatypeXMLValueSpaceData* spaceData); CDatatypeXMLValueSpaceData* initXMLValueSpaceData(CDatatypeValueSpaceXMLType* valueSpaceType); CDatatypeXMLValueSpaceMap* getXMLValueSpaceMap(bool create); // protected methods protected: virtual CDatatypeCompareValueSpaceMap* createValueSpaceMap(); // protected variables protected: CDatatypeXMLValueSpaceMap* mXMLValueSpaceMap; CDatatypeValueSpaceXMLType* mValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEXMLVALUESPACEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CLinkedRoleSaturationSuccessorData.h0000644000175000017500000000551012520551130031733 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CLINKEDROLESATURATIONSUCCESSORDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CLINKEDROLESATURATIONSUCCESSORDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CSaturationSuccessorData.h" #include "CSaturationSuccessorExtensionData.h" // Other includes #include "Reasoner/Ontology/CRole.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CLinkedRoleSaturationSuccessorData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLinkedRoleSaturationSuccessorData { // public methods public: //! Constructor CLinkedRoleSaturationSuccessorData(CProcessContext* context = nullptr); CPROCESSMAP* getSuccessorNodeDataMap(bool create = true); CSaturationSuccessorData* getLastSuccessorLinkData(); cint64 getSuccessorCount(); CSaturationSuccessorExtensionData* getSucessorExtensionData(); CPROCESSMAP mSuccNodeDataMap; CSaturationSuccessorData* mLastLink; cint64 mSuccCount; CSaturationSuccessorExtensionData* mExtensionData; bool mRoleALLConceptsProcessingQueued; bool mRoleFUNCTIONALConceptsProcessingQueued; bool mRoleFUNCTIONALConceptsQueuingRequired; bool mRoleALLConceptsQueuingRequired; // protected methods protected: // protected variables protected: CProcessContext* mContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CLINKEDROLESATURATIONSUCCESSORDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationInfluencedNominalSet.h0000644000175000017500000000424712520551154031301 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINFLUENCEDNOMINALSET_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINFLUENCEDNOMINALSET_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSaturationInfluencedNominalSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationInfluencedNominalSet : public CPROCESSSET { // public methods public: //! Constructor CSaturationInfluencedNominalSet(CProcessContext* processContext); CSaturationInfluencedNominalSet* initInfluencedNominalSet(CSaturationInfluencedNominalSet* nominalSet); bool setNominalInfluenced(cint64 nominalID); bool isNominalInfluenced(cint64 nominalID); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINFLUENCEDNOMINALSET_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSaturationBlockingData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSaturationBlockingData.0000644000175000017500000000477612520551124032230 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATURATIONBLOCKINGDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATURATIONBLOCKINGDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualNodeSaturationBlockingData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeSaturationBlockingData { // public methods public: //! Constructor CIndividualNodeSaturationBlockingData(); CIndividualNodeSaturationBlockingData* initSaturationBlockingData(cint64 cachedConceptCount, CConceptDescriptor* lastConfConDes, CIndividualSaturationProcessNode* saturationNode); CIndividualNodeSaturationBlockingData* setSaturationBlockedConceptCount(cint64 cachedCount); cint64 getSaturationBlockedConceptCount(); CConceptDescriptor* getLastConfirmedConceptDescriptior(); CIndividualSaturationProcessNode* getSaturationIndividualNode(); // protected methods protected: // protected variables protected: cint64 mSaturationBlockedConceptCount; CConceptDescriptor* mLastConfConDes; CIndividualSaturationProcessNode* mSaturationNode; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATURATIONBLOCKINGDATA_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationModifiedProcessUpdateLinker.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationModifiedProcessUpdateLinker0000644000175000017500000000443612520551156032376 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationModifiedProcessUpdateLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationModifiedProcessUpdateLinker::CSaturationModifiedProcessUpdateLinker() : CLinkerBase(nullptr) { } CSaturationModifiedProcessUpdateLinker* CSaturationModifiedProcessUpdateLinker::initProcessUpdateLinker(CIndividualSaturationProcessNode* individual, CSaturationModifiedProcessUpdateLinker::MODIFICATIONPROCESSUPDATETYPE updateType) { initLinker(individual); mUpdateType = updateType; return this; } CSaturationModifiedProcessUpdateLinker* CSaturationModifiedProcessUpdateLinker::setProcessingIndividual(CIndividualSaturationProcessNode* individual) { setData(individual); return this; } CIndividualSaturationProcessNode* CSaturationModifiedProcessUpdateLinker::getProcessingIndividual() { return getData(); } CSaturationModifiedProcessUpdateLinker::MODIFICATIONPROCESSUPDATETYPE CSaturationModifiedProcessUpdateLinker::getUpdateType() { return mUpdateType; } CSaturationModifiedProcessUpdateLinker* CSaturationModifiedProcessUpdateLinker::setUpdateType(CSaturationModifiedProcessUpdateLinker::MODIFICATIONPROCESSUPDATETYPE updateType) { mUpdateType = updateType; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceMapData.cpp0000644000175000017500000000255512520551114031653 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeStringValueSpaceMapData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeStringValueSpaceMapData::CDatatypeStringValueSpaceMapData() { mLocValue = nullptr; mUseValue = nullptr; } CDatatypeStringValueSpaceMapData::CDatatypeStringValueSpaceMapData(const CDatatypeStringValueSpaceMapData& data) { mUseValue = data.mUseValue; mLocValue = nullptr; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningHashData.h0000644000175000017500000000400412520551144031063 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CRepresentativeJoiningData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativeJoiningHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeJoiningHashData { // public methods public: //! Constructor CRepresentativeJoiningHashData(); CRepresentativeJoiningHashData(const CRepresentativeJoiningHashData& data); CRepresentativeJoiningData* mVarBindPathJoiningData; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingDescriptor.cpp0000644000175000017500000000402312520551162030562 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingDescriptor::CVariableBindingDescriptor() : CSortedLinkerBase(nullptr) { } CVariableBinding* CVariableBindingDescriptor::getVariableBinding() const { return data; } CVariableBindingDescriptor* CVariableBindingDescriptor::initVariableBindingDescriptor(CVariableBinding* propBinding) { setData(propBinding); return this; } bool CVariableBindingDescriptor::operator<=(const CVariableBindingDescriptor& beforeData) { return getVariableBinding()->getBindedVariable() <= beforeData.getVariableBinding()->getBindedVariable(); } bool CVariableBindingDescriptor::operator<=(const CVariableBinding& beforeData) { return getVariableBinding()->getBindedVariable() <= beforeData.getBindedVariable(); } bool CVariableBindingDescriptor::operator<=(const CVariableBinding*& beforeData) { return getVariableBinding()->getBindedVariable() <= beforeData->getBindedVariable(); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualProcessingQueue.cpp0000644000175000017500000001313312520551126030637 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessingQueue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualProcessingQueue::CIndividualProcessingQueue(CProcessContext* processContext) : mProcessContext(processContext),mPriorityIndiDesMap(processContext),mIndiDesPriorityHash(processContext) { mIndiProDesCount = 0; mHasMaxIndiPriority = false; mLastCheckIndi = nullptr; } CIndividualProcessingQueue::~CIndividualProcessingQueue() { } CIndividualProcessingQueue* CIndividualProcessingQueue::initProcessingQueue(CIndividualProcessingQueue* processingQueue) { if (processingQueue) { mPriorityIndiDesMap = processingQueue->mPriorityIndiDesMap; mIndiDesPriorityHash = processingQueue->mIndiDesPriorityHash; mIndiProDesCount = processingQueue->mIndiProDesCount; } else { mPriorityIndiDesMap.clear(); mIndiDesPriorityHash.clear(); mIndiProDesCount = 0; } return this; } CIndividualProcessingQueue *CIndividualProcessingQueue::insertIndiviudalProcessDescriptor(CIndividualProcessNodeDescriptor *indiProDes) { CIndividualProcessNode *individual = indiProDes->getIndividual(); CIndividualProcessNodePriority indiPriority = indiProDes->getProcessPriority(); if (individual == mLastCheckIndi) { mLastCheckIndiPriority = qMax(indiPriority,mLastCheckIndiPriority); } cint64 indiID = individual->getIndividualID(); if (mHasMaxIndiPriority) { mMaxIndiPriority = qMax(indiPriority,mMaxIndiPriority); } //cint64 prevCount = mPriorityIndiDesMap.count(); mIndiDesPriorityHash.insert(indiID,indiPriority); mPriorityIndiDesMap.insertMulti(indiPriority,indiProDes); ++mIndiProDesCount; //if (mPriorityIndiDesMap.count() != mIndiProDesCount) { // mPriorityIndiDesMap.insertMulti(indiPriority,indiProDes); // bool bug = true; //} return this; } bool CIndividualProcessingQueue::isIndividualQueued(CIndividualProcessNode *individual) { cint64 indiID = individual->getIndividualID(); mLastCheckIndiPriority = mIndiDesPriorityHash.value(indiID,CIndividualProcessNodePriority()); return !mLastCheckIndiPriority.isNullPriority(); } bool CIndividualProcessingQueue::needsIndiviudalInsertion(CIndividualProcessNode *individual, CIndividualProcessNodePriority priority) { if (mLastCheckIndi == individual) { if (!mLastCheckIndiPriority.isNullPriority() && priority >= mLastCheckIndiPriority) { return false; } else { return true; } } else { cint64 indiID = individual->getIndividualID(); mLastCheckIndi = individual; mLastCheckIndiPriority = mIndiDesPriorityHash.value(indiID,CIndividualProcessNodePriority()); if (!mLastCheckIndiPriority.isNullPriority() && priority >= mLastCheckIndiPriority) { return false; } return true; } } bool CIndividualProcessingQueue::hasHigherPriorityIndividual(CIndividualProcessNodePriority priority) { if (!mHasMaxIndiPriority) { CIndividualProcessNodeDescriptor* nextIndiDes = getNextProcessIndividualDescriptor(); if (nextIndiDes) { mMaxIndiPriority = nextIndiDes->getProcessPriority(); mHasMaxIndiPriority = true; } } if (mHasMaxIndiPriority) { return mMaxIndiPriority < priority; } return false; } CIndividualProcessNodeDescriptor* CIndividualProcessingQueue::takeNextProcessIndividualDescriptor() { CIndividualProcessNodeDescriptor* indiProDes = nullptr; if (mIndiProDesCount > 0) { --mIndiProDesCount; CPROCESSMAP::iterator it = mPriorityIndiDesMap.begin(); indiProDes = it.value(); mPriorityIndiDesMap.erase(it); cint64 indiID = indiProDes->getIndividual()->getIndividualID(); mIndiDesPriorityHash.insert(indiID,0.); mLastCheckIndi = nullptr; //if (mPriorityIndiDesMap.count() != mIndiProDesCount) { // bool bug = true; //} } mHasMaxIndiPriority = false; return indiProDes; } CIndividualProcessNodeDescriptor* CIndividualProcessingQueue::getNextProcessIndividualDescriptor() { CIndividualProcessNodeDescriptor* indiProDes = nullptr; if (mIndiProDesCount > 0) { CPROCESSMAP::iterator it = mPriorityIndiDesMap.begin(); indiProDes = it.value(); } return indiProDes; } bool CIndividualProcessingQueue::isEmpty() { return mIndiProDesCount <= 0; } bool CIndividualProcessingQueue::hasIndividualProcessDescriptor() { return mIndiProDesCount > 0; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorIndividualAL0000644000175000017500000000521712520551154032331 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash::CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash(CProcessContext* processContext) : mProcessContext(processContext),mLinkedSuccIndiALLConceptExtHash(processContext) { } CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash* CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash::initLinkedSuccessorIndividualALLConceptsExtensionHash() { mLinkedSuccIndiALLConceptExtHash.clear(); return this; } CPROCESSHASH* CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash::getLinkedSuccessorIndividualALLConceptsExtensionHash() { return &mLinkedSuccIndiALLConceptExtHash; } CSaturationLinkedSuccessorIndividualALLConceptsExtensionData* CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash::getALLConceptsExtensionData(CIndividualSaturationProcessNode* indiNode, bool create) { if (create) { CSaturationLinkedSuccessorIndividualALLConceptsExtensionData*& data = mLinkedSuccIndiALLConceptExtHash[indiNode]; if (!data) { data = CObjectParameterizingAllocator< CSaturationLinkedSuccessorIndividualALLConceptsExtensionData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); data->initLinkedSuccessorIndividualALLConceptsExtensionData(indiNode); } return data; } else { return mLinkedSuccIndiALLConceptExtHash.value(indiNode,nullptr); } } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptPropagationBindingSetHashData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptPropagationBindingSetHashData.0000644000175000017500000000417312520551102032144 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROPAGATIONBINDINGSETHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROPAGATIONBINDINGSETHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CPropagationBindingSet.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConceptPropagationBindingSetHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptPropagationBindingSetHashData { // public methods public: //! Constructor CConceptPropagationBindingSetHashData(); CConceptPropagationBindingSetHashData(const CConceptPropagationBindingSetHashData& data); CPropagationBindingSet* mLocPropBindingSet; CPropagationBindingSet* mUsePropBindingSet; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROPAGATIONBINDINGSETHASHDATA_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionResolveData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionReso0000644000175000017500000000562412520551154032431 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEEXTENSIONRESOLVEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEEXTENSIONRESOLVEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CSaturationIndividualNodeExtensionResolveHash.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationIndividualNodeExtensionResolveData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationIndividualNodeExtensionResolveData { // public methods public: //! Constructor CSaturationIndividualNodeExtensionResolveData(CProcessContext* processContext); CSaturationIndividualNodeExtensionResolveData* initExtensionResolveData(CIndividualSaturationProcessNode* indiProcessNode); CSaturationIndividualNodeExtensionResolveData* initExtensionResolveData(cint64 indiID); CSaturationIndividualNodeExtensionResolveHash* getIndividualNodeExtensionResolveHash(bool create = true); CSaturationIndividualNodeExtensionResolveData* setProcessingIndividualNode(CIndividualSaturationProcessNode* indiProcessNode); CIndividualSaturationProcessNode* getProcessingIndividualNode(); cint64 getProcessingIndividualNodeID(); bool hasProcessingIndividualNode(); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CSaturationIndividualNodeExtensionResolveHash* mExtensionResolveHash; CIndividualSaturationProcessNode* mIndiNode; cint64 mIndiID; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEEXTENSIONRESOLVEDATA_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualReactivationProcessingQueue.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualReactivationProcessingQueue0000644000175000017500000000606612520551126032436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALREACTIVATIONPROCESSINGQUEUE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALREACTIVATIONPROCESSINGQUEUE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" #include "CIndividualDepthPriority.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualReactivationProcessingQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualReactivationProcessingQueue { // public methods public: //! Constructor CIndividualReactivationProcessingQueue(CProcessContext* processContext); CIndividualReactivationProcessingQueue* initProcessingQueue(CIndividualReactivationProcessingQueue* processingQueue); bool takeNextReactivationIndividual(CIndividualProcessNode*& indiNode, bool& forceReactivation); bool getNextReactivationIndividual(CIndividualProcessNode*& indiNode, bool& forceReactivation); bool insertReactivationIndiviudal(CIndividualProcessNode* individual, bool forceReactivation); bool isEmpty(); cint64 getQueuedIndividualCount(); bool hasQueuedIndividuals(); bool hasQueuedIndividual(CIndividualProcessNode* individual); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; class CIndividualForceReactivationData { public: CIndividualForceReactivationData(CIndividualProcessNode* indiNode = nullptr, bool forceReactivation = false) { mForceReactivation = forceReactivation; mIndiNode = indiNode; } bool mForceReactivation; CIndividualProcessNode* mIndiNode; }; CPROCESSMAP mPriorityIndiReactivationMap; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALREACTIVATIONPROCESSINGQUEUE_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningAllDataExtension.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningAllDataExtension0000644000175000017500000000572212520551142032365 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGALLDATAEXTENSION_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGALLDATAEXTENSION_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CRepresentativeVariableBindingPathSetData.h" #include "CRepresentativeVariableBindingPathMap.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Utilities/CSortedLinker.hpp" #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRepresentativeJoiningAllDataExtension * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeJoiningAllDataExtension { // public methods public: //! Constructor CRepresentativeJoiningAllDataExtension(CProcessContext* processContext = nullptr); CRepresentativeVariableBindingPathSetData* getRepresentativeVariableBindingPathSetData(); CRepresentativeJoiningAllDataExtension* setRepresentativeVariableBindingPathSetData(CRepresentativeVariableBindingPathSetData* repVarBindPathSetData); CRepresentativeVariableBindingPathMap* getResolveVariableBindingPathMap(bool leftMap, bool create = true); CRepresentativeVariableBindingPathMap* getLeftResolveVariableBindingPathMap(bool create = true); CRepresentativeVariableBindingPathMap* getRightResolveVariableBindingPathMap(bool create = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CRepresentativeVariableBindingPathSetData* mRepVarBindPathSetData; CRepresentativeVariableBindingPathMap* mLeftResolveMap; CRepresentativeVariableBindingPathMap* mRightResolveMap; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGALLDATAEXTENSION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessTag.cpp0000644000175000017500000000345112520551136025562 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessTag.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CProcessTag::CProcessTag(cint64 processTag) : mProcessTag(processTag) { } cint64 CProcessTag::getProcessTag() { return mProcessTag; } CProcessTag* CProcessTag::initProcessTag(cint64 processTag) { mProcessTag = processTag; return this; } CProcessTag* CProcessTag::setProcessTag(cint64 processTag) { mProcessTag = processTag; return this; } bool CProcessTag::isProcessTagUpdated(cint64 processTag) { return processTag > mProcessTag; } bool CProcessTag::isProcessTagUpToDate(cint64 processTag) { return mProcessTag >= processTag; } bool CProcessTag::updateProcessTag(cint64 processTag) { bool updated = mProcessTag != processTag; mProcessTag = processTag; return updated; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorConceptExtensionMap.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorConceptExtensionMa0000644000175000017500000000421312520551156032440 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationSuccessorConceptExtensionMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationSuccessorConceptExtensionMap::CSaturationSuccessorConceptExtensionMap(CProcessContext* processContext) : mConceptExtensionMap(processContext) { } CSaturationSuccessorConceptExtensionMap* CSaturationSuccessorConceptExtensionMap::initSuccessorConceptExtensionMap() { mConceptExtensionMap.clear(); return this; } CPROCESSHASH* CSaturationSuccessorConceptExtensionMap::getSuccessorConceptExtensionMap() { return &mConceptExtensionMap; } bool CSaturationSuccessorConceptExtensionMap::addExtensionConcept(CConcept* concept, bool negation) { CSaturationSuccessorConceptExtensionMapData& conExtMapData = mConceptExtensionMap[concept->getConceptTag()]; conExtMapData.mConcept = concept; bool modified = false; if (negation) { if (!conExtMapData.mNegative) { modified = true; } conExtMapData.mNegative = true; } else { if (!conExtMapData.mPositive) { modified = true; } conExtMapData.mPositive = true; } return modified; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalPredecessorRoleCardinalityHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalPredecessorRoleCardinalityHas0000644000175000017500000000566712520551106032332 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCriticalPredecessorRoleCardinalityHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CCriticalPredecessorRoleCardinalityHash::CCriticalPredecessorRoleCardinalityHash(CProcessContext* context) : mContext(context),mCriticalPredecessorRoleDataHash(context) { } CCriticalPredecessorRoleCardinalityHash* CCriticalPredecessorRoleCardinalityHash::initCriticalPredecessorRoleCardinalityHash() { mCriticalPredecessorRoleDataHash.clear(); return this; } CCriticalPredecessorRoleCardinalityHash* CCriticalPredecessorRoleCardinalityHash::copyCriticalPredecessorRoleCardinalityHash(CCriticalPredecessorRoleCardinalityHash* copyRoleSuccHash) { mCriticalPredecessorRoleDataHash = copyRoleSuccHash->mCriticalPredecessorRoleDataHash; return this; } CCriticalPredecessorRoleCardinalityData* CCriticalPredecessorRoleCardinalityHash::getCriticalPredecessorRoleCardinalityData(CRole* role, bool forceCreation) { CCriticalPredecessorRoleCardinalityData*& criticalPredData = mCriticalPredecessorRoleDataHash[role]; if (!criticalPredData && forceCreation) { criticalPredData = CObjectAllocator::allocateAndConstruct(mContext->getUsedMemoryAllocationManager()); } return criticalPredData; } CCriticalPredecessorRoleCardinalityHash* CCriticalPredecessorRoleCardinalityHash::addCriticalPredecessorRoleCardinality(CRole* role, CConcept* unproblematicConcept, bool unproblematicNegation) { CCriticalPredecessorRoleCardinalityData* criticalPredData = getCriticalPredecessorRoleCardinalityData(role,true); CXNegLinker* unprobConNegLinker = CObjectAllocator< CXNegLinker >::allocateAndConstruct(mContext->getUsedMemoryAllocationManager()); unprobConNegLinker->initNegLinker(unproblematicConcept,unproblematicNegation); criticalPredData->mUnproblematicConceptLinker = unprobConNegLinker->append(criticalPredData->mUnproblematicConceptLinker); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017600000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualDepthConceptProcessDescriptorProcessingQueueData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualDepthConceptProcessDescript0000644000175000017500000000210712520551122032345 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualDepthConceptProcessDescriptorProcessingQueueData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingCandidateHash.h0000644000175000017500000000631512520551160031167 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGCANDIDATEHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGCANDIDATEHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" #include "CSignatureBlockingCandidateIterator.h" #include "CConceptSetSignature.h" #include "CSignatureIterator.h" #include "CSignatureBlockingCandidateData.h" #include "CProcessContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSignatureBlockingCandidateHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureBlockingCandidateHash { // public methods public: //! Constructor CSignatureBlockingCandidateHash(CProcessContext* context = nullptr); CSignatureBlockingCandidateHash* initSignatureBlockingCandidateHash(CSignatureBlockingCandidateHash* prevSigBlockCandHash); CSignatureBlockingCandidateHash* insertSignatureBlockingCandidate(cint64 signature, CIndividualProcessNode* individualCandidate); CSignatureBlockingCandidateHash* insertSignatureBlockingCandidate(CConceptSetSignature* signature, CIndividualProcessNode* individualCandidate); CSignatureBlockingCandidateHash* insertSignatureBlockingCandidates(cint64 signature, CXLinker* candidateLinker); CSignatureBlockingCandidateIterator getBlockingCandidatesIterator(cint64 signature); CSignatureBlockingCandidateIterator getBlockingCandidatesIterator(CConceptSetSignature* signature); cint64 getBlockingCandidatesCount(cint64 signature); cint64 getBlockingCandidatesCount(CConceptSetSignature* signature); CSignatureIterator getSignatureIterator(); // protected methods protected: // protected variables protected: CProcessContext* mContext; CMemoryAllocationManager* mMemMan; CPROCESSHASH mSigBlockCandidateHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGCANDIDATEHASH_H ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationPredecessorFUNCTIONALConceptExtensionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationPredecessorFUNCTIONALConcep0000644000175000017500000000503012520551156031767 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationPredecessorFUNCTIONALConceptExtensionData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationPredecessorFUNCTIONALConceptExtensionData::CSaturationPredecessorFUNCTIONALConceptExtensionData(CProcessContext* processContext) : CLinkerBase(false) { mProcessContext = processContext; } CSaturationPredecessorFUNCTIONALConceptExtensionData* CSaturationPredecessorFUNCTIONALConceptExtensionData::initPredecessorMergedConceptExtensionData(CRole* role) { setData(false); setNext(nullptr); mRole = role; mLastPredecessorMergedLinkedSucc = nullptr; return this; } bool CSaturationPredecessorFUNCTIONALConceptExtensionData::isExtensionProcessingQueued() { return getData(); } CSaturationPredecessorFUNCTIONALConceptExtensionData* CSaturationPredecessorFUNCTIONALConceptExtensionData::setExtensionProcessingQueued(bool queued) { setData(queued); return this; } CRole* CSaturationPredecessorFUNCTIONALConceptExtensionData::getRole() { return mRole; } CSaturationSuccessorData* CSaturationPredecessorFUNCTIONALConceptExtensionData::getLastPredecessorMergedLinkedSuccessorData() { return mLastPredecessorMergedLinkedSucc; } CSaturationPredecessorFUNCTIONALConceptExtensionData* CSaturationPredecessorFUNCTIONALConceptExtensionData::setLastPredecessorMergedLinkedSuccessorData(CSaturationSuccessorData* lastExaminedLinkedSucc) { mLastPredecessorMergedLinkedSucc = lastExaminedLinkedSucc; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationData.h0000644000175000017500000000544312520551132032032 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CNOMINALCACHINGLOSSREACTIVATIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CNOMINALCACHINGLOSSREACTIVATIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CNominalCachingLossReactivationData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNominalCachingLossReactivationData { // public methods public: //! Constructor CNominalCachingLossReactivationData(CProcessContext* processContext); CNominalCachingLossReactivationData* initNominalCachingLossReactivationData(cint64 nominalID, CNominalCachingLossReactivationData* data = nullptr); bool getNominalID(); bool hasReactivated(); CNominalCachingLossReactivationData* setReactivated(bool lostCached); CXLinker* getReactivationIndividualNodeLinker(); CXLinker* takeReactivationIndividualNodeLinker(); CNominalCachingLossReactivationData* addReactivationIndividualNodeLinker(CXLinker* indiProcNodeLinker); CNominalCachingLossReactivationData* addReactivationIndividualNode(CIndividualProcessNode* indiProcNode); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; cint64 mNominalID; bool mReactivated; CXLinker* mIndiReactivationLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CNOMINALCACHINGLOSSREACTIVATIONDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyQueue.cpp0000644000175000017500000000735412520551142026134 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReapplyQueue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CReapplyQueue::CReapplyQueue() { mStaticReapplyDesLinker = nullptr; mDynamicReapplyDesLinker = nullptr; #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_REAPPLY_QUEUE_COUNT mDesStaticCount = 0; mDesDynamicCount = 0; #endif } CReapplyQueue* CReapplyQueue::initReapplyQueue(CReapplyQueue* prevReapplyQueue) { if (prevReapplyQueue) { mStaticReapplyDesLinker = prevReapplyQueue->mStaticReapplyDesLinker; mDynamicReapplyDesLinker = prevReapplyQueue->mDynamicReapplyDesLinker; #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_REAPPLY_QUEUE_COUNT mDesDynamicCount = prevReapplyQueue->mDesDynamicCount; mDesStaticCount = prevReapplyQueue->mDesStaticCount; #endif } else { mStaticReapplyDesLinker = nullptr; mDynamicReapplyDesLinker = nullptr; #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_REAPPLY_QUEUE_COUNT mDesStaticCount = 0; mDesDynamicCount = 0; #endif } return this; } #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_REAPPLY_QUEUE_COUNT qint64 CReapplyQueue::getReapplyCount() { return mDesStaticCount + mDesDynamicCount; } #endif bool CReapplyQueue::isEmpty() { return !mDynamicReapplyDesLinker && !mStaticReapplyDesLinker; } bool CReapplyQueue::hasConceptDescriptor(CConceptDescriptor* conceptDescriptor) { CReapplyConceptDescriptor* desLinker = mStaticReapplyDesLinker; while (desLinker) { if (desLinker->hasConceptDescriptor(conceptDescriptor)) { return true; } desLinker = desLinker->getNext(); } desLinker = mDynamicReapplyDesLinker; while (desLinker) { if (desLinker->hasConceptDescriptor(conceptDescriptor)) { return true; } desLinker = desLinker->getNext(); } return false; } CReapplyQueue* CReapplyQueue::addReapplyConceptDescriptor(CReapplyConceptDescriptor *conProDes) { if (conProDes) { if (conProDes->isStaticDescriptor()) { mStaticReapplyDesLinker = conProDes->append(mStaticReapplyDesLinker); #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_REAPPLY_QUEUE_COUNT ++mDesStaticCount; #endif } else { mDynamicReapplyDesLinker = conProDes->append(mDynamicReapplyDesLinker); #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_REAPPLY_QUEUE_COUNT ++mDesDynamicCount; #endif } } return this; } CReapplyQueueIterator CReapplyQueue::getIterator(bool clearDynamicReapplyQueue) { CReapplyQueueIterator it(mStaticReapplyDesLinker,mDynamicReapplyDesLinker); if (clearDynamicReapplyQueue) { mDynamicReapplyDesLinker = nullptr; #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_REAPPLY_QUEUE_COUNT mDesDynamicCount = 0; #endif } return it; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceMapArranger.cpp0000644000175000017500000000320412520551114032150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeRealValueSpaceMapArranger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeRealValueSpaceMapArranger::CDatatypeRealValueSpaceMapArranger(CDataLiteralRealValue* value) { mValue = value; } CDataLiteralRealValue* CDatatypeRealValueSpaceMapArranger::getValue() const { return mValue; } bool CDatatypeRealValueSpaceMapArranger::operator<(const CDatatypeRealValueSpaceMapArranger& valueData) const { return mValue->isLessThan(valueData.mValue); } bool CDatatypeRealValueSpaceMapArranger::operator<=(const CDatatypeRealValueSpaceMapArranger& valueData) const { return mValue->isLessEqualThan(valueData.mValue); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNodeSwitchHistory.h0000644000175000017500000000747112520551132026610 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CNODESWITCHHISTORY_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CNODESWITCHHISTORY_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CIndividualProcessNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CNodeSwitchHistory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNodeSwitchHistory { // public methods public: //! Constructor CNodeSwitchHistory(CProcessContext* processContext = nullptr); //! Destructor virtual ~CNodeSwitchHistory(); CNodeSwitchHistory* initSwitchHistory(CNodeSwitchHistory* prevSwitchHistory); CNodeSwitchHistory* addIndividualProcessNodeSwitch(CIndividualProcessNode* individual, cint64 indiSwitchTag); CNodeSwitchHistory* addIndividualProcessNodeSwitch(cint64 indiAncDepth, cint64 indiID, cint64 indiSwitchTag); CNodeSwitchHistory* updateLastIndividualProcessNodeSwitch(cint64 indiAncDepth, cint64 indiID); cint64 getMinIndividualAncestorDepth(cint64 indiSwitchTag); cint64 getMinIndividualNodeID(cint64 indiSwitchTag); bool getMinIndividualAncestorDepthAndNodeID(cint64 indiSwitchTag, cint64& indiAncDepth, cint64& indiNodeID); // protected methods protected: // protected variables protected: class CNodeSwitchHistoryLinkData { public: inline CNodeSwitchHistoryLinkData() { mNextData = nullptr; mUpData = nullptr; mDownData = nullptr; mLevelCount = 0; mNodeSwitchTag = 0; mNodeAncestorDepth = 0; mNodeIndividualID = 0; } inline CNodeSwitchHistoryLinkData* initCopy(CNodeSwitchHistoryLinkData* prevData) { mNextData = prevData->mNextData; mUpData = nullptr; mDownData = prevData->mDownData; mLevelCount = prevData->mLevelCount; mNodeSwitchTag = prevData->mNodeSwitchTag; mNodeAncestorDepth = prevData->mNodeAncestorDepth; mNodeIndividualID = prevData->mNodeIndividualID; return this; } CNodeSwitchHistoryLinkData* mNextData; CNodeSwitchHistoryLinkData* mUpData; CNodeSwitchHistoryLinkData* mDownData; cint64 mLevelCount; cint64 mNodeSwitchTag; cint64 mNodeAncestorDepth; cint64 mNodeIndividualID; }; CProcessContext* mContext; CNodeSwitchHistoryLinkData* mDownData; cint64 mLevelingCount; // private methods private: CNodeSwitchHistory* updateUpperData(CNodeSwitchHistoryLinkData* data, cint64 indiSwitchTag); // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CNODESWITCHHISTORY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceMapData.cpp0000644000175000017500000000256312520551110031766 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeCompareValueSpaceMapData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeCompareValueSpaceMapData::CDatatypeCompareValueSpaceMapData() { mLocValue = nullptr; mUseValue = nullptr; } CDatatypeCompareValueSpaceMapData::CDatatypeCompareValueSpaceMapData(const CDatatypeCompareValueSpaceMapData& data) { mUseValue = data.mUseValue; mLocValue = nullptr; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptProcessDescriptor.h0000644000175000017500000000637212520551100030142 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSDESCRIPTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "CConceptProcessPriority.h" #include "CProcessingRestrictionSpecification.h" // Other includes #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Utilities/Container/CSortedLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CConceptProcessDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptProcessDescriptor : public CSortedLinkerBase { // public methods public: //! Constructor CConceptProcessDescriptor(CConceptDescriptor *conceptDescriptor, CConceptProcessPriority processPriority, bool conceptReapplied = false, CDependencyTrackPoint *dependencyTrackPoint = nullptr); CConceptProcessDescriptor(); CConceptProcessDescriptor *init(CConceptDescriptor *conceptDescriptor, CConceptProcessPriority processPriority, bool conceptReapplied = false, CDependencyTrackPoint *dependencyTrackPoint = nullptr, CProcessingRestrictionSpecification* procSpec = nullptr); CConceptProcessDescriptor *initCopy(CConceptProcessDescriptor* conceptProcessDes); CConceptDescriptor *getConceptDescriptor(); CConceptProcessPriority getProcessPriority(); CDependencyTrackPoint *getDependencyTrackPoint(); bool isConceptReapplied(); CProcessingRestrictionSpecification* getProcessingRestrictionSpecification(); bool operator<=(const CConceptProcessDescriptor &descriptor); // protected methods protected: // protected variables protected: CConceptDescriptor *conceptDes; CConceptProcessPriority priority; CDependencyTrackPoint *depTrackPoint; CProcessingRestrictionSpecification* mProcSpec; bool mReapplied; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativePropagationDescriptor.h0000644000175000017500000000501512520551144032415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEPROPAGATIONDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEPROPAGATIONDESCRIPTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CRepresentativeVariableBindingPathSetData.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativePropagationDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativePropagationDescriptor : public CLinkerBase, public CDependencyTracker { // public methods public: //! Constructor CRepresentativePropagationDescriptor(); CRepresentativePropagationDescriptor* initRepresentativeDescriptor(CRepresentativeVariableBindingPathSetData* repData, CDependencyTrackPoint* depTrackPoint); CRepresentativeVariableBindingPathSetData* getRepresentativeVariableBindingPathSetData(); CRepresentativePropagationDescriptor* setRepresentativeVariableBindingPathSetData(CRepresentativeVariableBindingPathSetData* repData); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEPROPAGATIONDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeIRIValueSpaceMap.h0000644000175000017500000000512712520551112027677 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEIRIVALUESPACEMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEIRIVALUESPACEMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeCompareValueSpaceMap.h" // Other includes #include "Reasoner/Ontology/CDataLiteralIRIValue.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeIRIValueSpaceMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeIRIValueSpaceMap : public CDatatypeCompareValueSpaceMap { // public methods public: //! Constructor CDatatypeIRIValueSpaceMap(CProcessContext* processContext); // protected methods protected: virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* value); virtual bool getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom); virtual bool getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast); virtual cuint64 getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEIRIVALUESPACEMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessContextBase.cpp0000644000175000017500000000547712520551134027276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessContextBase.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CProcessContextBase::CProcessContextBase(CMemoryPoolContainer* memoryPoolContainer, CTaskHandleContext* handleContext) { CTaskHandleMemoryAllocationManager* tempMemMan = handleContext->getTaskHandleMemoryAllocationManager(); void* memManAdd = CProcessMemoryPoolAllocationManager::allocateMemoryToContainer(sizeof(CProcessMemoryPoolAllocationManager),memoryPoolContainer,tempMemMan); mMemMan = new (memManAdd) CProcessMemoryPoolAllocationManager(memoryPoolContainer,tempMemMan); mUsedMemMan = mMemMan; mProcessTagger = CObjectAllocator::allocateAndConstruct(mMemMan); mUsedProcessTagger = mProcessTagger; #ifndef KONCLUDE_FORCE_STATISTIC_DEACTIVATED mProcStatGath = CObjectAllocator::allocateAndConstruct(mMemMan); mUsedProcessStatGath = mProcStatGath; #else mProcStatGath = nullptr; mUsedProcessStatGath = nullptr; #endif } CProcessContextBase::~CProcessContextBase() { } CProcessContextBase* CProcessContextBase::referenceProcessContext(CProcessContextBase* reference) { if (reference) { mProcessTagger->initProcessTagger(reference->mProcessTagger); } return this; } CProcessTagger* CProcessContextBase::getProcessTagger() { return mProcessTagger; } CProcessingStatisticGathering* CProcessContextBase::getProcessingStatisticsGathering() { return mProcStatGath; } CTaskContext* CProcessContextBase::updateContext(CTaskHandleContext* handleContext) { CTaskHandleMemoryAllocationManager* tempMemMan = handleContext->getTaskHandleMemoryAllocationManager(); mMemMan->updateMemoryProvider(tempMemMan); return this; } CMemoryAllocationManager* CProcessContextBase::getMemoryAllocationManager() { return mMemMan; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningKeyMap.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJ0000644000175000017500000000501012520551150032260 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGKEYMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGKEYMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRepresentativeVariableBindingPathSetJoiningKeyMapData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathSetJoiningKeyMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathSetJoiningKeyMap : public CPROCESSMAP { // public methods public: //! Constructor CRepresentativeVariableBindingPathSetJoiningKeyMap(CProcessContext* processContext); CRepresentativeVariableBindingPathSetJoiningKeyMap* initRepresentativeVariableBindingPathSetJoiningKeyMap(CRepresentativeVariableBindingPathSetJoiningKeyMap* prevMap); CRepresentativeVariableBindingPathSetJoiningKeyDataMap* getJoiningKeyDataMap(cint64 joiningKey, bool create = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGKEYMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptSetStructure.cpp0000644000175000017500000000460512520551102027473 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptSetStructure.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptSetStructure::CConceptSetStructure() { reset(); } CConceptSetStructure* CConceptSetStructure::reset() { mDynamicCreatedConcepts = false; mBindingPropagationConcepts = false; return this; } CConceptSetStructure* CConceptSetStructure::setBindingPropagationConcepts(bool bindingPropagationConcepts) { mBindingPropagationConcepts = bindingPropagationConcepts; return this; } bool CConceptSetStructure::hasBindingPropagationConcepts() { return mBindingPropagationConcepts; } CConceptSetStructure* CConceptSetStructure::addedConcept(CConceptDescriptor* conceptDescriptor) { CConcept* concept = conceptDescriptor->getConcept(); cint64 conCode = concept->getOperatorCode(); CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_PROPAGATION_TYPE)) { mBindingPropagationConcepts = true; } if (concept->getTerminology() == nullptr) { mDynamicCreatedConcepts = true; } return this; } CConceptSetStructure* CConceptSetStructure::setDynamicCreatedConcepts(bool dynamicCreatedConcepts) { mDynamicCreatedConcepts = dynamicCreatedConcepts; return this; } bool CConceptSetStructure::hasDynamicCreatedConcepts() { return mDynamicCreatedConcepts; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReusedIndividualNodeData.h0000644000175000017500000000431112520551150030005 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREUSEDINDIVIDUALNODEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREUSEDINDIVIDUALNODEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CReusedIndividualNodeData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReusedIndividualNodeData { // public methods public: //! Constructor CReusedIndividualNodeData(); CReusedIndividualNodeData* initReusedExpansionData(CReusedIndividualNodeData* prevData); cint64 getReusedTriedCount(); cint64 getReusedFailedCount(); CReusedIndividualNodeData* setReusedTriedCount(cint64 triedCount); CReusedIndividualNodeData* setReusedFailedCount(cint64 failedCount); // protected methods protected: // protected variables protected: cint64 mReusedTriedCount; cint64 mReusedFailedCount; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREUSEDINDIVIDUALNODEDATA_H ././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualDepthConceptProcessDescriptorProcessingQueueData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualDepthConceptProcessDescript0000644000175000017500000000445712520551122032357 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALDEPTHCONCEPTPROCESSDESCRIPTORPROCESSINGQUEUEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALDEPTHCONCEPTPROCESSDESCRIPTORPROCESSINGQUEUEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" #include "CConceptProcessDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualDepthConceptProcessDescriptorProcessingQueueData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualDepthConceptProcessDescriptorProcessingQueueData { // public methods public: //! Constructor inline CIndividualDepthConceptProcessDescriptorProcessingQueueData(CConceptProcessDescriptor* conProDes, CIndividualProcessNode* indiNode) { mConProDes = conProDes; mIndiNode = indiNode; } CConceptProcessDescriptor* mConProDes; CIndividualProcessNode* mIndiNode; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALDEPTHCONCEPTPROCESSDESCRIPTORPROCESSINGQUEUEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDistinctEdge.cpp0000644000175000017500000000263312520551120026050 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDistinctEdge.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDistinctEdge::CDistinctEdge(CProcessContext* processContext) : CNodeEdge(processContext) { } CDistinctEdge* CDistinctEdge::initDistinctEdge(CIndividualProcessNode* sourceIndividual, CIndividualProcessNode* destinationIndividual, CDependencyTrackPoint* depTrackPoint) { initNodeEdge(sourceIndividual,destinationIndividual,depTrackPoint); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDependencyTracker.h0000644000175000017500000000434712520551120026545 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDEPENDENCYTRACKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDEPENDENCYTRACKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CDependencyTracker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDependencyTracker { // public methods public: //! Constructor CDependencyTracker(CDependencyTrackPoint* dependencyTrackPoint = nullptr); CDependencyTrackPoint* getDependencyTrackPoint(); CDependencyTracker* setDependencyTrackPoint(CDependencyTrackPoint* dependencyTrackPoint); CDependencyTracker* initDependencyTracker(CDependencyTrackPoint* dependencyTrackPoint); // protected methods protected: // protected variables protected: CDependencyTrackPoint* mDependencyTrackPoint; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDEPENDENCYTRACKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingTriggerHash.cpp0000644000175000017500000000610712520551164030662 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingTriggerHash.h" #include "CIndividualProcessNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingTriggerHash::CVariableBindingTriggerHash(CProcessContext* context) : CPROCESSHASH(context) { mContext = context; } CVariableBindingTriggerHash* CVariableBindingTriggerHash::initVariableBindingTriggerHash(CVariableBindingTriggerHash* prevHash) { if (prevHash) { *this = *prevHash; } else { CPROCESSHASH::clear(); } return this; } CVariableBindingTriggerData& CVariableBindingTriggerHash::getTriggerData(CVariable* variable, CIndividualProcessNode* indiNode) { return CPROCESSHASH::operator[](TVariableIndividualPair(variable,indiNode->getIndividualID())); } CVariableBindingTriggerLinker* CVariableBindingTriggerHash::setTriggeredReturnTriggerLinker(CVariable* variable, CIndividualProcessNode* indiNode) { CVariableBindingTriggerData& triggerData = getTriggerData(variable,indiNode); CVariableBindingTriggerLinker* triggerLinker = triggerData.getVariableBindingTriggerLinker(); triggerData.setTriggered(true); triggerData.clearVariableBindingTriggerLinker(); return triggerLinker; } bool CVariableBindingTriggerHash::tryInsertVariableBindingTrigger(CVariable* variable, CIndividualProcessNode* indiNode, CVariableBindingPathDescriptor* varBindPathDes, CVariableBindingDescriptor* varBindDes, bool leftTriggered) { CVariableBindingTriggerData& triggerData = getTriggerData(variable,indiNode); if (triggerData.isTriggered()) { return false; } CMemoryAllocationManager* taskMemMan = mContext->getUsedMemoryAllocationManager(); CVariableBindingTriggerLinker* triggerLinker = CObjectAllocator< CVariableBindingTriggerLinker >::allocateAndConstruct(taskMemMan); triggerLinker->initTriggerLinker(varBindPathDes,varBindDes,leftTriggered); triggerData.addVariableBindingTriggerLinker(triggerLinker); return true; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualProcessNodePriority.cpp0000644000175000017500000001170212520551126031504 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodePriority.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualProcessNodePriority::CIndividualProcessNodePriority(double conPriority, double indiPriority, bool stirctOrder) { mPriorityCon = conPriority; mPriorityInd = indiPriority; mStrictOrder = stirctOrder; } bool CIndividualProcessNodePriority::isNullPriority() const { return mPriorityCon == 0. && mPriorityInd == 0.; } double CIndividualProcessNodePriority::getConceptPriority() const { return mPriorityCon; } double CIndividualProcessNodePriority::getIndividualPriority() const { return mPriorityInd; } CIndividualProcessNodePriority* CIndividualProcessNodePriority::setPriority(double conPriority, double indiPriority) { mPriorityCon = conPriority; mPriorityInd = indiPriority; return this; } CIndividualProcessNodePriority* CIndividualProcessNodePriority::setPriorityToNull() { mPriorityCon = 0.; mPriorityInd = 0.; mStrictOrder = true; return this; } bool CIndividualProcessNodePriority::operator==(const CIndividualProcessNodePriority& indiPriority) const { return mPriorityCon == indiPriority.mPriorityCon && mPriorityInd == indiPriority.mPriorityInd; } bool CIndividualProcessNodePriority::operator!=(const CIndividualProcessNodePriority& indiPriority) const { return mPriorityCon != indiPriority.mPriorityCon || mPriorityInd != indiPriority.mPriorityInd; } bool CIndividualProcessNodePriority::operator<=(const CIndividualProcessNodePriority& indiPriority) const { bool strictOrder = mStrictOrder || indiPriority.mStrictOrder; if (strictOrder) { if (mPriorityInd < indiPriority.mPriorityInd) { return true; } else if (mPriorityInd > indiPriority.mPriorityInd) { return false; } else { return mPriorityCon <= indiPriority.mPriorityCon; } } else { bool sameConceptPriority = mPriorityCon == indiPriority.mPriorityCon; return sameConceptPriority && (mPriorityInd <= indiPriority.mPriorityInd) || !sameConceptPriority && (mPriorityCon >= indiPriority.mPriorityCon); } } bool CIndividualProcessNodePriority::operator>=(const CIndividualProcessNodePriority& indiPriority) const { bool strictOrder = mStrictOrder || indiPriority.mStrictOrder; if (strictOrder) { if (mPriorityInd > indiPriority.mPriorityInd) { return true; } else if (mPriorityInd < indiPriority.mPriorityInd) { return false; } else { return mPriorityCon >= indiPriority.mPriorityCon; } } else { bool sameConceptPriority = mPriorityCon == indiPriority.mPriorityCon; return sameConceptPriority && (mPriorityInd >= indiPriority.mPriorityInd) || !sameConceptPriority && (mPriorityCon <= indiPriority.mPriorityCon); } } bool CIndividualProcessNodePriority::operator<(const CIndividualProcessNodePriority& indiPriority) const { bool strictOrder = mStrictOrder || indiPriority.mStrictOrder; if (strictOrder) { if (mPriorityInd < indiPriority.mPriorityInd) { return true; } else { return false; } } else { bool sameConceptPriority = mPriorityCon == indiPriority.mPriorityCon; return sameConceptPriority && (mPriorityInd < indiPriority.mPriorityInd) || !sameConceptPriority && (mPriorityCon > indiPriority.mPriorityCon); } } bool CIndividualProcessNodePriority::operator>(const CIndividualProcessNodePriority& indiPriority) const { bool strictOrder = mStrictOrder || indiPriority.mStrictOrder; if (strictOrder) { if (mPriorityInd > indiPriority.mPriorityInd) { return true; } else { return false; } } else { bool sameConceptPriority = mPriorityCon == indiPriority.mPriorityCon; return sameConceptPriority && (mPriorityInd > indiPriority.mPriorityInd) || !sameConceptPriority && (mPriorityCon < indiPriority.mPriorityCon); } } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorData.h0000644000175000017500000000447412520551156030002 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRoleSaturationProcessLinker.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Utilities/Container/CNegLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSaturationSuccessorData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationSuccessorData { // public methods public: //! Constructor CSaturationSuccessorData(); cint64 mSuccCount; cint64 mActiveCount; bool mExtension; bool mVALUENominalConnection; //bool mMergedCreation; cint64 mVALUENominalID; CIndividualSaturationProcessNode* mSuccIndiNode; CSaturationSuccessorData* mNextLink; CXNegLinker* mCreationRoleLinker; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypesValueSpaceData.cpp0000644000175000017500000004316212520551116030212 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypesValueSpaceData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypesValueSpaceData::CDatatypesValueSpaceData(CProcessContext* processContext) { mProcessContext = processContext; } CDatatypesValueSpaceData* CDatatypesValueSpaceData::initDatatypesValueSpaceData(CDatatypesValueSpaceData* data) { mLocRealValueSpace = nullptr; mUseRealValueSpace = nullptr; mLocStringValueSpace = nullptr; mUseStringValueSpace = nullptr; mLocIRIValueSpace = nullptr; mUseIRIValueSpace = nullptr; mLocXMLValueSpace = nullptr; mUseXMLValueSpace = nullptr; mUseBinaryBase64DataValueSpace = nullptr; mLocBinaryBase64DataValueSpace = nullptr; mUseDateTimeValueSpace = nullptr; mLocDateTimeValueSpace = nullptr; mUseBinaryHexDataValueSpace = nullptr; mLocBinaryHexDataValueSpace = nullptr; mLocBooleanValueSpace = nullptr; mUseBooleanValueSpace = nullptr; mLocDoubleValueSpace = nullptr; mUseDoubleValueSpace = nullptr; mLocFloatValueSpace = nullptr; mUseFloatValueSpace = nullptr; mLocUnknownValueSpace = nullptr; mUseUnknownValueSpace = nullptr; mValueSpaceTriggeringQueued = false; mLastTriggeredValueSpaceType = false; mValueSpaceTriggeringRequired = false; mValueSpaceCountingRequired = false; mValueSpaceClashCheckingRequired = false; mValueSpaceSatisfiabilityCheckingRequired = false; mValueSpaceSatisfiabilityCheckingQueued = false; mLastTriggeringDisjointCount = 0; mValuesCounter.resetValueCounter(); mValueSpaceCounted = false; if (data) { mUseRealValueSpace = data->mUseRealValueSpace; mUseStringValueSpace = data->mUseStringValueSpace; mUseIRIValueSpace = data->mUseIRIValueSpace; mUseXMLValueSpace = data->mUseXMLValueSpace; mUseBinaryBase64DataValueSpace = data->mUseBinaryBase64DataValueSpace; mUseDateTimeValueSpace = data->mUseDateTimeValueSpace; mUseBinaryHexDataValueSpace = data->mUseBinaryHexDataValueSpace; mUseBooleanValueSpace = data->mUseBooleanValueSpace; mUseDoubleValueSpace = data->mUseDoubleValueSpace; mUseFloatValueSpace = data->mUseFloatValueSpace; mUseUnknownValueSpace = data->mUseUnknownValueSpace; mValueSpaceTriggeringQueued = data->mValueSpaceTriggeringQueued; mLastTriggeredValueSpaceType = data->mLastTriggeredValueSpaceType; mValueSpaceTriggeringRequired = data->mValueSpaceTriggeringRequired; mValueSpaceCountingRequired = data->mValueSpaceCountingRequired; mValueSpaceClashCheckingRequired = data->mValueSpaceClashCheckingRequired; mValueSpaceSatisfiabilityCheckingRequired = data->mValueSpaceSatisfiabilityCheckingRequired; mValueSpaceSatisfiabilityCheckingQueued = data->mValueSpaceSatisfiabilityCheckingQueued; mLastTriggeringDisjointCount = data->mLastTriggeringDisjointCount; mValuesCounter.initValueCounter(&data->mValuesCounter); mValueSpaceCounted = data->mValueSpaceCounted; } return this; } CDatatypeValueSpaceData* CDatatypesValueSpaceData::getValueSpace(CDatatypeValueSpaceType* valueSpaceType, bool createOrLocalize) { CDatatypeValueSpaceData* valueSpace = nullptr; if (CDatatypeValueSpaceType::VALUESPACEREALTYPE == valueSpaceType->getValueSpaceType()) { valueSpace = getRealValueSpace((CDatatypeValueSpaceRealType*)valueSpaceType,createOrLocalize); } else if (CDatatypeValueSpaceType::VALUESPACEUNKNOWNTYPE == valueSpaceType->getValueSpaceType()) { valueSpace = getUnknownValueSpace((CDatatypeValueSpaceUnknownType*)valueSpaceType,createOrLocalize); } else if (CDatatypeValueSpaceType::VALUESPACESTRINGTYPE == valueSpaceType->getValueSpaceType()) { valueSpace = getStringValueSpace((CDatatypeValueSpaceStringType*)valueSpaceType,createOrLocalize); } else if (CDatatypeValueSpaceType::VALUESPACEIRITYPE == valueSpaceType->getValueSpaceType()) { valueSpace = getIRIValueSpace((CDatatypeValueSpaceIRIType*)valueSpaceType,createOrLocalize); } else if (CDatatypeValueSpaceType::VALUESPACEBOOLEANTYPE == valueSpaceType->getValueSpaceType()) { valueSpace = getBooleanValueSpace((CDatatypeValueSpaceBooleanType*)valueSpaceType,createOrLocalize); } else if (CDatatypeValueSpaceType::VALUESPACEDOUBLETYPE == valueSpaceType->getValueSpaceType()) { valueSpace = getDoubleValueSpace((CDatatypeValueSpaceDoubleType*)valueSpaceType,createOrLocalize); } else if (CDatatypeValueSpaceType::VALUESPACEFLOATTYPE == valueSpaceType->getValueSpaceType()) { valueSpace = getFloatValueSpace((CDatatypeValueSpaceFloatType*)valueSpaceType,createOrLocalize); } else if (CDatatypeValueSpaceType::VALUESPACEHEXDATATYPE == valueSpaceType->getValueSpaceType()) { valueSpace = getBinaryHexDataValueSpace((CDatatypeValueSpaceBinaryHexDataType*)valueSpaceType,createOrLocalize); } else if (CDatatypeValueSpaceType::VALUESPACEBASE64DATATYPE == valueSpaceType->getValueSpaceType()) { valueSpace = getBinaryBase64DataValueSpace((CDatatypeValueSpaceBinaryBase64DataType*)valueSpaceType,createOrLocalize); } else if (CDatatypeValueSpaceType::VALUESPACEXMLTYPE == valueSpaceType->getValueSpaceType()) { valueSpace = getXMLValueSpace((CDatatypeValueSpaceXMLType*)valueSpaceType,createOrLocalize); } else if (CDatatypeValueSpaceType::VALUESPACEDATETIMETYPE == valueSpaceType->getValueSpaceType()) { valueSpace = getDateTimeValueSpace((CDatatypeValueSpaceDateTimeType*)valueSpaceType,createOrLocalize); } return valueSpace; } CDatatypeRealValueSpaceData* CDatatypesValueSpaceData::getRealValueSpace(CDatatypeValueSpaceRealType* valueSpaceType, bool createOrLocalize) { if (!mLocRealValueSpace && createOrLocalize) { mLocRealValueSpace = CObjectParameterizingAllocator< CDatatypeRealValueSpaceData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (mUseRealValueSpace) { mLocRealValueSpace->copyRealValueSpaceData(mUseRealValueSpace); } else { mLocRealValueSpace->initRealValueSpaceData(valueSpaceType); } mUseRealValueSpace = mLocRealValueSpace; } return mUseRealValueSpace; } CDatatypeUnknownValueSpaceData* CDatatypesValueSpaceData::getUnknownValueSpace(CDatatypeValueSpaceUnknownType* valueSpaceType, bool createOrLocalize) { if (!mLocUnknownValueSpace && createOrLocalize) { mLocUnknownValueSpace = CObjectParameterizingAllocator< CDatatypeUnknownValueSpaceData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (mUseUnknownValueSpace) { mLocUnknownValueSpace->copyUnknownValueSpaceData(mUseUnknownValueSpace); } else { mLocUnknownValueSpace->initUnknownValueSpaceData(valueSpaceType); } mUseUnknownValueSpace = mLocUnknownValueSpace; } return mUseUnknownValueSpace; } CDatatypeStringValueSpaceData* CDatatypesValueSpaceData::getStringValueSpace(CDatatypeValueSpaceStringType* valueSpaceType, bool createOrLocalize) { if (!mLocStringValueSpace && createOrLocalize) { mLocStringValueSpace = CObjectParameterizingAllocator< CDatatypeStringValueSpaceData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (mUseStringValueSpace) { mLocStringValueSpace->copyStringValueSpaceData(mUseStringValueSpace); } else { mLocStringValueSpace->initStringValueSpaceData(valueSpaceType); } mUseStringValueSpace = mLocStringValueSpace; } return mUseStringValueSpace; } CDatatypeIRIValueSpaceData* CDatatypesValueSpaceData::getIRIValueSpace(CDatatypeValueSpaceIRIType* valueSpaceType, bool createOrLocalize) { if (!mLocIRIValueSpace && createOrLocalize) { mLocIRIValueSpace = CObjectParameterizingAllocator< CDatatypeIRIValueSpaceData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (mUseIRIValueSpace) { mLocIRIValueSpace->copyIRIValueSpaceData(mUseIRIValueSpace); } else { mLocIRIValueSpace->initIRIValueSpaceData(valueSpaceType); } mUseIRIValueSpace = mLocIRIValueSpace; } return mUseIRIValueSpace; } CDatatypeXMLValueSpaceData* CDatatypesValueSpaceData::getXMLValueSpace(CDatatypeValueSpaceXMLType* valueSpaceType, bool createOrLocalize) { if (!mLocXMLValueSpace && createOrLocalize) { mLocXMLValueSpace = CObjectParameterizingAllocator< CDatatypeXMLValueSpaceData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (mUseXMLValueSpace) { mLocXMLValueSpace->copyXMLValueSpaceData(mUseXMLValueSpace); } else { mLocXMLValueSpace->initXMLValueSpaceData(valueSpaceType); } mUseXMLValueSpace = mLocXMLValueSpace; } return mUseXMLValueSpace; } CDatatypeBinaryBase64DataValueSpaceData* CDatatypesValueSpaceData::getBinaryBase64DataValueSpace(CDatatypeValueSpaceBinaryBase64DataType* valueSpaceType, bool createOrLocalize) { if (!mLocBinaryBase64DataValueSpace && createOrLocalize) { mLocBinaryBase64DataValueSpace = CObjectParameterizingAllocator< CDatatypeBinaryBase64DataValueSpaceData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (mUseBinaryBase64DataValueSpace) { mLocBinaryBase64DataValueSpace->copyBinaryBase64DataValueSpaceData(mUseBinaryBase64DataValueSpace); } else { mLocBinaryBase64DataValueSpace->initBinaryBase64DataValueSpaceData(valueSpaceType); } mUseBinaryBase64DataValueSpace = mLocBinaryBase64DataValueSpace; } return mUseBinaryBase64DataValueSpace; } CDatatypeDateTimeValueSpaceData* CDatatypesValueSpaceData::getDateTimeValueSpace(CDatatypeValueSpaceDateTimeType* valueSpaceType, bool createOrLocalize) { if (!mLocDateTimeValueSpace && createOrLocalize) { mLocDateTimeValueSpace = CObjectParameterizingAllocator< CDatatypeDateTimeValueSpaceData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (mUseDateTimeValueSpace) { mLocDateTimeValueSpace->copyDateTimeValueSpaceData(mUseDateTimeValueSpace); } else { mLocDateTimeValueSpace->initDateTimeValueSpaceData(valueSpaceType); } mUseDateTimeValueSpace = mLocDateTimeValueSpace; } return mUseDateTimeValueSpace; } CDatatypeBinaryHexDataValueSpaceData* CDatatypesValueSpaceData::getBinaryHexDataValueSpace(CDatatypeValueSpaceBinaryHexDataType* valueSpaceType, bool createOrLocalize) { if (!mLocBinaryHexDataValueSpace && createOrLocalize) { mLocBinaryHexDataValueSpace = CObjectParameterizingAllocator< CDatatypeBinaryHexDataValueSpaceData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (mUseBinaryHexDataValueSpace) { mLocBinaryHexDataValueSpace->copyBinaryHexDataValueSpaceData(mUseBinaryHexDataValueSpace); } else { mLocBinaryHexDataValueSpace->initBinaryHexDataValueSpaceData(valueSpaceType); } mUseBinaryHexDataValueSpace = mLocBinaryHexDataValueSpace; } return mUseBinaryHexDataValueSpace; } CDatatypeBooleanValueSpaceData* CDatatypesValueSpaceData::getBooleanValueSpace(CDatatypeValueSpaceBooleanType* valueSpaceType, bool createOrLocalize) { if (!mLocBooleanValueSpace && createOrLocalize) { mLocBooleanValueSpace = CObjectParameterizingAllocator< CDatatypeBooleanValueSpaceData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (mUseBooleanValueSpace) { mLocBooleanValueSpace->copyBooleanValueSpaceData(mUseBooleanValueSpace); } else { mLocBooleanValueSpace->initBooleanValueSpaceData(valueSpaceType); } mUseBooleanValueSpace = mLocBooleanValueSpace; } return mUseBooleanValueSpace; } CDatatypeDoubleValueSpaceData* CDatatypesValueSpaceData::getDoubleValueSpace(CDatatypeValueSpaceDoubleType* valueSpaceType, bool createOrLocalize) { if (!mLocDoubleValueSpace && createOrLocalize) { mLocDoubleValueSpace = CObjectParameterizingAllocator< CDatatypeDoubleValueSpaceData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (mUseDoubleValueSpace) { mLocDoubleValueSpace->copyDoubleValueSpaceData(mUseDoubleValueSpace); } else { mLocDoubleValueSpace->initDoubleValueSpaceData(valueSpaceType); } mUseDoubleValueSpace = mLocDoubleValueSpace; } return mUseDoubleValueSpace; } CDatatypeFloatValueSpaceData* CDatatypesValueSpaceData::getFloatValueSpace(CDatatypeValueSpaceFloatType* valueSpaceType, bool createOrLocalize) { if (!mLocFloatValueSpace && createOrLocalize) { mLocFloatValueSpace = CObjectParameterizingAllocator< CDatatypeFloatValueSpaceData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (mUseFloatValueSpace) { mLocFloatValueSpace->copyFloatValueSpaceData(mUseFloatValueSpace); } else { mLocFloatValueSpace->initFloatValueSpaceData(valueSpaceType); } mUseFloatValueSpace = mLocFloatValueSpace; } return mUseFloatValueSpace; } bool CDatatypesValueSpaceData::isValueSpaceTriggeringQueued() { return mValueSpaceTriggeringQueued; } CDatatypesValueSpaceData* CDatatypesValueSpaceData::setValueSpaceTriggeringQueued(bool queued) { mValueSpaceTriggeringQueued = queued; return this; } CDatatypeValueSpaceType* CDatatypesValueSpaceData::getLastTriggeredValueSpaceType() { return mLastTriggeredValueSpaceType; } CDatatypesValueSpaceData* CDatatypesValueSpaceData::setLastTriggeredValueSpaceType(CDatatypeValueSpaceType* valueSpaceType) { mLastTriggeredValueSpaceType = valueSpaceType; return this; } CDatatypesValueSpaceData* CDatatypesValueSpaceData::setValueSapceModified(CDatatypeValueSpaceData* valueSpace) { valueSpace->setValueSpaceModification(); mValueSpaceTriggeringRequired = true; mValueSpaceCountingRequired = true; mValueSpaceClashCheckingRequired = true; mValueSpaceSatisfiabilityCheckingRequired = true; return this; } bool CDatatypesValueSpaceData::isValueSpaceTriggeringRequired() { return mValueSpaceTriggeringRequired; } CDatatypesValueSpaceData* CDatatypesValueSpaceData::setValueSpaceTriggeringRequired(bool required) { mValueSpaceTriggeringRequired = required; return this; } bool CDatatypesValueSpaceData::isValueSpaceCountingRequired() { return mValueSpaceCountingRequired; } CDatatypesValueSpaceData* CDatatypesValueSpaceData::setValueSpaceCountingRequired(bool required) { mValueSpaceCountingRequired = required; return this; } bool CDatatypesValueSpaceData::isValueSpaceClashCheckingRequired() { return mValueSpaceClashCheckingRequired; } CDatatypesValueSpaceData* CDatatypesValueSpaceData::setValueSpaceClashCheckingRequired(bool required) { mValueSpaceClashCheckingRequired = required; return this; } bool CDatatypesValueSpaceData::isValueSpaceSatisfiabilityCheckingQueued() { return mValueSpaceSatisfiabilityCheckingQueued; } CDatatypesValueSpaceData* CDatatypesValueSpaceData::setValueSpaceSatisfiabilityCheckingQueued(bool queued) { mValueSpaceSatisfiabilityCheckingQueued = queued; return this; } bool CDatatypesValueSpaceData::isValueSpaceSatisfiabilityCheckingRequired() { return mValueSpaceSatisfiabilityCheckingRequired; } CDatatypesValueSpaceData* CDatatypesValueSpaceData::setValueSpaceSatisfiabilityCheckingRequired(bool required) { mValueSpaceSatisfiabilityCheckingRequired = required; return this; } cint64 CDatatypesValueSpaceData::getLastTriggeringDisjointCount() { return mLastTriggeringDisjointCount; } CDatatypesValueSpaceData* CDatatypesValueSpaceData::setLastTriggeringDisjointCount(cint64 disjointCount) { mLastTriggeringDisjointCount = disjointCount; return this; } CDatatypeValueSpaceValuesCounter* CDatatypesValueSpaceData::getValuesCounter() { return &mValuesCounter; } bool CDatatypesValueSpaceData::isValueSpaceCounted() { return mValueSpaceCounted; } CDatatypesValueSpaceData* CDatatypesValueSpaceData::setValueSpaceCounted(bool counted) { mValueSpaceCounted = counted; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualMergingHash.h0000644000175000017500000000424512520551122027357 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALMERGINGHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALMERGINGHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" // Other includes #include "Reasoner/Ontology/CIndividual.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CIndividualMergingHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualMergingHash : public CPROCESSHASH { // public methods public: //! Constructor CIndividualMergingHash(CProcessContext* processContext); CIndividualMergingHash* initIndividualMergingHash(CIndividualMergingHash* indiMergingHash); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALMERGINGHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingStatisticGathering.h0000644000175000017500000000675612520551134031023 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGSTATISTICGATHERING_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGSTATISTICGATHERING_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessingStatistics.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { #define STATDATAINC(STATDESC,processingStatisticGatheringData) \ if (processingStatisticGatheringData) { \ processingStatisticGatheringData->incProcessingStatistic(CProcessingStatistics::stat##STATDESC.getStatisticGatheringIndex()); \ } #define STATDATAINCM(STATDESC,incCount,processingStatisticGatheringData) \ if (processingStatisticGatheringData) { \ processingStatisticGatheringData->incProcessingStatistic(CProcessingStatistics::stat##STATDESC.getStatisticGatheringIndex(),incCount); \ } /*! * * \class CProcessingStatisticGathering * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessingStatisticGathering { // public methods public: //! Constructor CProcessingStatisticGathering(); //! Destructor virtual ~CProcessingStatisticGathering(); inline CProcessingStatisticGathering* incProcessingStatistic(cint64 index); inline CProcessingStatisticGathering* incProcessingStatistic(cint64 index, cint64 incCount); CProcessingStatisticGathering* initProcessingStatisticsGathering(CProcessingStatisticGathering* refStat); CProcessingStatisticGathering* addGatheredProcessingStatisticsTo(CProcessingStatisticGathering* stat); cint64 getGatheredProcessingStatistic(cint64 index); cint64* getProcessingStatisticsVector(); // protected methods protected: // protected variables protected: cint64 mStatVec[CProcessingStatistics::statisticVectorSize]; // private methods private: // private variables private: }; CProcessingStatisticGathering* CProcessingStatisticGathering::incProcessingStatistic(cint64 index) { if (index >= 0 && index < CProcessingStatistics::statisticVectorSize) { ++mStatVec[index]; } return this; } CProcessingStatisticGathering* CProcessingStatisticGathering::incProcessingStatistic(cint64 index, cint64 incCount) { if (index >= 0 && index < CProcessingStatistics::statisticVectorSize) { mStatVec[index] += incCount; } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGSTATISTICGATHERING_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualProcessNodeDescriptor.cpp0000644000175000017500000000410412520551126031777 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualProcessNodeDescriptor::CIndividualProcessNodeDescriptor(CIndividualProcessNode *individual, CIndividualProcessNodePriority processPriority) { ind = individual; priority = processPriority; } CIndividualProcessNodeDescriptor::CIndividualProcessNodeDescriptor() { ind = 0; priority = 0; } CIndividualProcessNodeDescriptor::~CIndividualProcessNodeDescriptor() { } CIndividualProcessNodeDescriptor *CIndividualProcessNodeDescriptor::init(CIndividualProcessNode *individual, CIndividualProcessNodePriority processPriority) { ind = individual; priority = processPriority; return this; } CIndividualProcessNode *CIndividualProcessNodeDescriptor::getIndividual() { return ind; } CIndividualProcessNodePriority CIndividualProcessNodeDescriptor::getProcessPriority() { return priority; } bool CIndividualProcessNodeDescriptor::operator<=(CIndividualProcessNodeDescriptor &descriptor) { return descriptor.priority <= priority; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationHash.h0000644000175000017500000000521112520551132032035 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CNOMINALCACHINGLOSSREACTIVATIONHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CNOMINALCACHINGLOSSREACTIVATIONHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CNominalCachingLossReactivationData.h" #include "CNominalCachingLossReactivationHashData.h" #include "CIndividualProcessNode.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CNominalCachingLossReactivationHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNominalCachingLossReactivationHash { // public methods public: //! Constructor CNominalCachingLossReactivationHash(CProcessContext* processContext); CNominalCachingLossReactivationHash* initNominalDependentNodeHash(CNominalCachingLossReactivationHash* nominalDependentHash); CNominalCachingLossReactivationData* getNominalCachingLossReactivationData(cint64 nominalID, bool create = true); CNominalCachingLossReactivationData* getNominalCachingLossReactivationData(CIndividualProcessNode* nominalIndiNode, bool create = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CPROCESSHASH mNominalReactivationDataHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CNOMINALCACHINGLOSSREACTIVATIONHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeBlockData.cpp0000644000175000017500000000225312520551122030145 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeBlockData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeBlockData::CIndividualNodeBlockData() { } CIndividualNodeBlockData::~CIndividualNodeBlockData() { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptProcessingQueueIterator.cpp0000644000175000017500000000576112520551100031654 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptProcessingQueueIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptProcessingQueueIterator::CConceptProcessingQueueIterator() { mDataVec = nullptr; mDesCount = 0; mDefaultPriorityDescriptorLinker = nullptr; mSortedPriorityDescriptorLinker = nullptr; mDesIndex = 0; } CConceptProcessingQueueIterator::CConceptProcessingQueueIterator(CConceptProcessingPriorityQueueData* dataVec, cint64 desCount) { mDataVec = dataVec; mDesCount = desCount; mDefaultPriorityDescriptorLinker = nullptr; mSortedPriorityDescriptorLinker = nullptr; mDesIndex = 0; loadNextDescriptors(); } CConceptProcessingQueueIterator::~CConceptProcessingQueueIterator() { } void CConceptProcessingQueueIterator::loadNextDescriptors() { if (mDesCount > 0) { while (!mDefaultPriorityDescriptorLinker && !mSortedPriorityDescriptorLinker && mDesIndex < mMaxIndex) { CConceptProcessingPriorityQueueData& mData = mDataVec[mDesIndex]; mDefaultPriorityDescriptorLinker = mData.mDefaultPriorityDescriptorLinker; mSortedPriorityDescriptorLinker = mData.mSortedPriorityDescriptorLinker; ++mDesIndex; } } } CConceptProcessDescriptor* CConceptProcessingQueueIterator::next(bool moveNext) { if (!mDefaultPriorityDescriptorLinker && !mSortedPriorityDescriptorLinker) { loadNextDescriptors(); } CConceptProcessDescriptor* des = nullptr; if (mDefaultPriorityDescriptorLinker) { des = mDefaultPriorityDescriptorLinker; if (moveNext) { mDefaultPriorityDescriptorLinker = mDefaultPriorityDescriptorLinker->getNext(); } } else if (mSortedPriorityDescriptorLinker) { des = mSortedPriorityDescriptorLinker; if (moveNext) { mSortedPriorityDescriptorLinker = mSortedPriorityDescriptorLinker->getNext(); } } if (des && moveNext) { --mDesCount; } return des; } bool CConceptProcessingQueueIterator::hasNext() { return mDesCount > 0; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptProcessingQueueIterator.h0000644000175000017500000000501312520551100031307 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSINGQUEUEITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSINGQUEUEITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptProcessDescriptor.h" #include "CConceptProcessingPriorityQueueData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CConceptProcessingQueueIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptProcessingQueueIterator { // public methods public: //! Constructor CConceptProcessingQueueIterator(); CConceptProcessingQueueIterator(CConceptProcessingPriorityQueueData* dataVec, cint64 desCount); //! Destructor virtual ~CConceptProcessingQueueIterator(); CConceptProcessDescriptor* next(bool moveNext = true); bool hasNext(); // protected methods protected: void loadNextDescriptors(); // protected variables protected: CConceptProcessingPriorityQueueData* mDataVec; CConceptProcessDescriptor* mDefaultPriorityDescriptorLinker; CConceptProcessDescriptor* mSortedPriorityDescriptorLinker; cint64 mDesCount; cint64 mDesIndex; const static cint64 mMaxIndex = 15; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSINGQUEUEITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeIRIValueSpaceMap.cpp0000644000175000017500000000541412520551112030231 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeIRIValueSpaceMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeIRIValueSpaceMap::CDatatypeIRIValueSpaceMap(CProcessContext* processContext) : CDatatypeCompareValueSpaceMap(processContext) { } bool CDatatypeIRIValueSpaceMap::representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { return true; } bool CDatatypeIRIValueSpaceMap::representsInfinitelyManyValues(CDataLiteralCompareValue* value) { CDataLiteralIRIValue* iriValue = dynamic_cast(value); if (iriValue) { return iriValue->isInfiniteLength(); } return false; } bool CDatatypeIRIValueSpaceMap::getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom) { CDataLiteralIRIValue* iriValueCopyInto = dynamic_cast(valueCopyInto); CDataLiteralIRIValue* iriValueCopyFrom = dynamic_cast(valueCopyFrom); iriValueCopyInto->initValue(iriValueCopyFrom); return false; } bool CDatatypeIRIValueSpaceMap::getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast) { CDataLiteralIRIValue* iriValueNext = dynamic_cast(valueNext); CDataLiteralIRIValue* iriValueLast = dynamic_cast(valueLast); return false; } cuint64 CDatatypeIRIValueSpaceMap::getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { CDataLiteralIRIValue* iriLeftValue = dynamic_cast(leftValueExcluded); CDataLiteralIRIValue* iriRightValue = dynamic_cast(rightValueExcluded); cuint64 valueCount = 0; return valueCount; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConnectionSuccessorSetIterator.cpp0000644000175000017500000000372312520551104031664 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConnectionSuccessorSetIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConnectionSuccessorSetIterator::CConnectionSuccessorSetIterator(cint64 connID) { mConnID = connID; } CConnectionSuccessorSetIterator::CConnectionSuccessorSetIterator(const CPROCESSSET::iterator& beginIt, const CPROCESSSET::iterator& endIt) : mBeginIt(beginIt),mEndIt(endIt) { mConnID = 0; } bool CConnectionSuccessorSetIterator::hasNext() { return mConnID >= 0 || mBeginIt != mEndIt; } cint64 CConnectionSuccessorSetIterator::nextSuccessorConnectionID(bool moveNext) { cint64 indiID = 0; if (mConnID >= 0) { indiID = mConnID; if (moveNext) { mConnID = -1; } } if (mBeginIt != mEndIt) { indiID = *mBeginIt; if (moveNext) { ++mBeginIt; } } return indiID; } cint64 CConnectionSuccessorSetIterator::next(bool moveNext) { return nextSuccessorConnectionID(moveNext); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalPredecessorRoleCardinalityData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalPredecessorRoleCardinalityDat0000644000175000017500000000420412520551104032307 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALPREDECESSORROLECARDINALITYDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALPREDECESSORROLECARDINALITYDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Utilities/Container/CNegLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CCriticalPredecessorRoleCardinalityData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCriticalPredecessorRoleCardinalityData { // public methods public: //! Constructor CCriticalPredecessorRoleCardinalityData(); CXNegLinker* mUnproblematicConceptLinker; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALPREDECESSORROLECARDINALITYDATA_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorALLConceptExtensionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorALLConceptExtensio0000644000175000017500000001114112520551156032333 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationSuccessorALLConceptExtensionData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationSuccessorALLConceptExtensionData::CSaturationSuccessorALLConceptExtensionData(CProcessContext* processContext) : CLinkerBase(false),mConceptExtensionMap(processContext) { mProcessContext = processContext; } CSaturationSuccessorALLConceptExtensionData* CSaturationSuccessorALLConceptExtensionData::initSuccessorConceptExtensionData(CRole* role, CIndividualSaturationProcessNode* indiProcSatNode) { setData(false); setNext(nullptr); mRole = role; mIndiProcSatNode = indiProcSatNode; mLastResolvedIndiProcSatNode = nullptr; mRequiredSuccCount = 0; mLastConnectedSuccCount = 0; mSuccessorCardinalityUpdatedFlag = false; mConceptsUpdatedFlag = false; return this; } bool CSaturationSuccessorALLConceptExtensionData::isExtensionProcessingQueued() { return getData(); } CSaturationSuccessorALLConceptExtensionData* CSaturationSuccessorALLConceptExtensionData::setExtensionProcessingQueued(bool queued) { setData(queued); return this; } CSaturationSuccessorConceptExtensionMap* CSaturationSuccessorALLConceptExtensionData::getSuccessorConceptExtensionMap() { return &mConceptExtensionMap; } bool CSaturationSuccessorALLConceptExtensionData::addExtensionConcept(CConcept* concept, bool negation) { mConceptsUpdatedFlag |= mConceptExtensionMap.addExtensionConcept(concept,negation); return mConceptsUpdatedFlag; } CRole* CSaturationSuccessorALLConceptExtensionData::getRole() { return mRole; } CIndividualSaturationProcessNode* CSaturationSuccessorALLConceptExtensionData::getIndividualNode() { return mIndiProcSatNode; } CIndividualSaturationProcessNode* CSaturationSuccessorALLConceptExtensionData::getLastResolvedIndividualNode() { return mLastResolvedIndiProcSatNode; } CSaturationSuccessorALLConceptExtensionData* CSaturationSuccessorALLConceptExtensionData::setLastResolvedIndividualNode(CIndividualSaturationProcessNode* indiNode) { mLastResolvedIndiProcSatNode = indiNode; return this; } cint64 CSaturationSuccessorALLConceptExtensionData::getRequiredSuccessorCardinality() { return mRequiredSuccCount; } CSaturationSuccessorALLConceptExtensionData* CSaturationSuccessorALLConceptExtensionData::setRequiredSuccessorCardinality(cint64 succCard) { mRequiredSuccCount = succCard; return this; } cint64 CSaturationSuccessorALLConceptExtensionData::getLastConnectedSuccessorCardinality() { return mLastConnectedSuccCount; } CSaturationSuccessorALLConceptExtensionData* CSaturationSuccessorALLConceptExtensionData::setLastConnectedSuccessorCardinality(cint64 succCard) { mLastConnectedSuccCount = succCard; return this; } bool CSaturationSuccessorALLConceptExtensionData::addRequiredSuccessorCardinality(cint64 succCard) { if (mRequiredSuccCount < succCard) { mRequiredSuccCount = succCard; mSuccessorCardinalityUpdatedFlag = true; } return mSuccessorCardinalityUpdatedFlag; } bool CSaturationSuccessorALLConceptExtensionData::hasSuccessorCardinalityUpdatedFlag() { return mConceptsUpdatedFlag; } bool CSaturationSuccessorALLConceptExtensionData::hasConceptsUpdatedFlag() { return mSuccessorCardinalityUpdatedFlag; } CSaturationSuccessorALLConceptExtensionData* CSaturationSuccessorALLConceptExtensionData::clearUpdatedFlags() { mConceptsUpdatedFlag = false; mSuccessorCardinalityUpdatedFlag = false; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualDepthPriority.cpp0000644000175000017500000000470412520551122030324 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualDepthPriority.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualDepthPriority::CIndividualDepthPriority() { mIndiDepth = CINT64_MAX; mIndiID = CINT64_MIN; } CIndividualDepthPriority::CIndividualDepthPriority(cint64 indiDepth, cint64 indiID) { mIndiDepth = indiDepth; mIndiID = indiID; } cint64 CIndividualDepthPriority::getIndividualDepth() const { return mIndiDepth; } cint64 CIndividualDepthPriority::getIndividualID() const { return mIndiID; } CIndividualDepthPriority* CIndividualDepthPriority::setPriority(cint64 indiDepth, cint64 indiID) { mIndiDepth = indiDepth; mIndiID = indiID; return this; } bool CIndividualDepthPriority::operator==(const CIndividualDepthPriority& indiPriority) const { return mIndiID == indiPriority.mIndiID && mIndiDepth == indiPriority.mIndiDepth; } bool CIndividualDepthPriority::operator<=(const CIndividualDepthPriority& indiPriority) const { if (mIndiDepth < indiPriority.mIndiDepth) { return true; } else if (mIndiDepth == indiPriority.mIndiDepth) { return mIndiID <= indiPriority.mIndiID; } return false; } bool CIndividualDepthPriority::operator<(const CIndividualDepthPriority& indiPriority) const { if (mIndiDepth < indiPriority.mIndiDepth) { return true; } else if (mIndiDepth == indiPriority.mIndiDepth) { return mIndiID < indiPriority.mIndiID; } return false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReferredIndividualTrackingData.h0000644000175000017500000000403512520551142031175 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREFERREDINDIVIDUALTRACKINGDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREFERREDINDIVIDUALTRACKINGDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CReferredIndividualTrackingData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReferredIndividualTrackingData { // public methods public: //! Constructor CReferredIndividualTrackingData(); bool isReferred(); bool isExtended(); CReferredIndividualTrackingData* setReferred(); CReferredIndividualTrackingData* setExtended(); // protected methods protected: // protected variables protected: bool mReferred; bool mExtended; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREFERREDINDIVIDUALTRACKINGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeBooleanValueSpaceMap.h0000644000175000017500000000516312520551106030636 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBOOLEANVALUESPACEMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBOOLEANVALUESPACEMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeCompareValueSpaceMap.h" // Other includes #include "Reasoner/Ontology/CDataLiteralBooleanValue.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeBooleanValueSpaceMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeBooleanValueSpaceMap : public CDatatypeCompareValueSpaceMap { // public methods public: //! Constructor CDatatypeBooleanValueSpaceMap(CProcessContext* processContext); // protected methods protected: virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* value); virtual bool getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom); virtual bool getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast); virtual cuint64 getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBOOLEANVALUESPACEMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceData.cpp0000644000175000017500000000536512520551114031217 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeStringValueSpaceData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeStringValueSpaceData::CDatatypeStringValueSpaceData(CProcessContext* processContext) : CDatatypeValueSpaceData(processContext),mProcessContext(processContext) { mValueSpaceMap = nullptr; } CDatatypeStringValueSpaceData* CDatatypeStringValueSpaceData::initStringValueSpaceData(CDatatypeValueSpaceStringType* valueSpaceType) { CDatatypeValueSpaceData::initValueSpaceData(nullptr); mValueSpaceType = valueSpaceType; if (mValueSpaceMap) { mValueSpaceMap->initDatatypeStringValueSpaceMap(valueSpaceType); } return this; } CDatatypeStringValueSpaceData* CDatatypeStringValueSpaceData::copyStringValueSpaceData(CDatatypeStringValueSpaceData* spaceData) { CDatatypeValueSpaceData::initValueSpaceData(spaceData); mValueSpaceType = spaceData->mValueSpaceType; if (spaceData->mValueSpaceMap && !mValueSpaceMap) { getValueSpaceMap(true); mValueSpaceMap->initDatatypeStringValueSpaceMap(spaceData->mValueSpaceMap); } else if (mValueSpaceMap) { if (spaceData->mValueSpaceMap) { mValueSpaceMap->initDatatypeStringValueSpaceMap(spaceData->mValueSpaceMap); } else { mValueSpaceMap->initDatatypeStringValueSpaceMap(mValueSpaceType); } } return this; } CDatatypeStringValueSpaceMap* CDatatypeStringValueSpaceData::getValueSpaceMap(bool create) { if (create && !mValueSpaceMap) { mValueSpaceMap = CObjectParameterizingAllocator< CDatatypeStringValueSpaceMap,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mValueSpaceMap->initDatatypeStringValueSpaceMap(mValueSpaceType); } return mValueSpaceMap; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingAlternativeSignatureBlockingCandidateData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingAlternativeSignatureBlockingC0000644000175000017500000000640112520551072032311 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBlockingAlternativeSignatureBlockingCandidateData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBlockingAlternativeSignatureBlockingCandidateData::CBlockingAlternativeSignatureBlockingCandidateData() { } CBlockingAlternativeSignatureBlockingCandidateData* CBlockingAlternativeSignatureBlockingCandidateData::initSignatureBlockingCandidateData(CIndividualProcessNode* blockIndiCand, cint64 violatedResCount, cint64 violatedNonDetResCount, cint64 diffConceptCount) { mBlockIndiCandi = blockIndiCand; mViolatedResCount = violatedResCount; mViolatedNonDetResCount = violatedNonDetResCount; mDiffConceptCount = diffConceptCount; return this; } CBlockingAlternativeSignatureBlockingCandidateData* CBlockingAlternativeSignatureBlockingCandidateData::setSignatureBlockingCandidateNode(CIndividualProcessNode* blockIndiCan) { mBlockIndiCandi = blockIndiCan; return this; } CIndividualProcessNode* CBlockingAlternativeSignatureBlockingCandidateData::getSignatureBlockingCandidateNode() { return mBlockIndiCandi; } cint64 CBlockingAlternativeSignatureBlockingCandidateData::getConceptDifferenceCount() { return mDiffConceptCount; } cint64 CBlockingAlternativeSignatureBlockingCandidateData::getViolatedRestrictionCount() { return mViolatedResCount; } cint64 CBlockingAlternativeSignatureBlockingCandidateData::getViolatedNonDeterministicRestrictionCount() { return mViolatedNonDetResCount; } CBlockingAlternativeSignatureBlockingCandidateData* CBlockingAlternativeSignatureBlockingCandidateData::setConceptDifferenceCount(cint64 count) { mDiffConceptCount = count; return this; } CBlockingAlternativeSignatureBlockingCandidateData* CBlockingAlternativeSignatureBlockingCandidateData::setViolatedRestrictionCount(cint64 count) { mViolatedResCount = count; return this; } CBlockingAlternativeSignatureBlockingCandidateData* CBlockingAlternativeSignatureBlockingCandidateData::setViolatedNonDeterministicRestrictionCount(cint64 count) { mViolatedNonDetResCount = count; return this; } CBlockingAlternativeData::BLOCKINGALTERNATIVEDATA CBlockingAlternativeSignatureBlockingCandidateData::getBlockingAlternativeDataType() { return BADSIGNATUREBLOCKINGCANDIDATE; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockedTestTag.h0000644000175000017500000000505112520551072026011 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKEDTESTTAG_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKEDTESTTAG_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessTag.h" #include "CProcessTagger.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CBlockedTestTag * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBlockedTestTag : public CProcessTag { // public methods public: //! Constructor CBlockedTestTag(cint64 blockingAddTag = 0); cint64 getBlockedTestTag(); CBlockedTestTag* setBlockedTestTag(cint64 blockingAddTag); CBlockedTestTag* setBlockedTestTag(CProcessTagger* processTagger); CBlockedTestTag* initBlockedTestTag(cint64 blockingAddTag); CBlockedTestTag* initBlockedTestTag(CProcessTagger* processTagger); bool updateBlockedTestTag(cint64 blockingAddTag); bool updateBlockedTestTag(CProcessTagger* processTagger); bool isBlockedTestTagUpdated(cint64 blockingAddTag); bool isBlockedTestTagUpToDate(cint64 blockingAddTag); bool isBlockedTestTagUpdated(CProcessTagger* processTagger); bool isBlockedTestTagUpToDate(CProcessTagger* processTagger); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKEDTESTTAG_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceDependencyCollector.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceDependencyCollector0000644000175000017500000000222112520551116032311 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceDependencyCollector.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeValueSpaceDependencyCollector::CDatatypeValueSpaceDependencyCollector() { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptCountHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptCountH0000644000175000017500000000645512520551152032377 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationDisjunctCommonConceptCountHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationDisjunctCommonConceptCountHash::CSaturationDisjunctCommonConceptCountHash(CProcessContext* processContext) : mCommonConceptCountHash(processContext) { } CSaturationDisjunctCommonConceptCountHash* CSaturationDisjunctCommonConceptCountHash::initCommonConceptCountHash() { mCommonConceptCountHash.clear(); mDisjunctCount = 0; return this; } CPROCESSHASH* CSaturationDisjunctCommonConceptCountHash::getCommonConceptCountHash() { return &mCommonConceptCountHash; } CSaturationDisjunctCommonConceptCountHash* CSaturationDisjunctCommonConceptCountHash::setDisjunctCount(cint64 disjunctCount) { mDisjunctCount = disjunctCount; return this; } CSaturationDisjunctCommonConceptCountHashData& CSaturationDisjunctCommonConceptCountHash::getCommonConceptCountData(cint64 conceptTag) { return mCommonConceptCountHash[conceptTag]; } CSaturationDisjunctCommonConceptCountHashData& CSaturationDisjunctCommonConceptCountHash::getCommonConceptCountData(CConcept* concept) { return mCommonConceptCountHash[concept->getConceptTag()]; } CSaturationDisjunctCommonConceptCountHashData& CSaturationDisjunctCommonConceptCountHash::getCommonConceptCountData(CConceptSaturationDescriptor* conSatDes) { return mCommonConceptCountHash[conSatDes->getConceptTag()]; } CSaturationDisjunctCommonConceptCountHash* CSaturationDisjunctCommonConceptCountHash::removeCommonConceptData(CConceptSaturationDescriptor* conSatDes) { mCommonConceptCountHash.remove(conSatDes->getConceptTag()); return this; } bool CSaturationDisjunctCommonConceptCountHash::incCommonConceptCountReturnMaxReached(CConceptSaturationDescriptor* conSatDes) { bool maxReached = false; CSaturationDisjunctCommonConceptCountHashData& hashData = mCommonConceptCountHash[conSatDes->getConceptTag()]; if (!hashData.mConcept) { hashData.mConcept = conSatDes->getConcept(); hashData.mNegation = conSatDes->isNegated(); } if (hashData.mNegation != conSatDes->isNegated()) { return false; } hashData.mConceptCount++; if (hashData.mConceptCount >= mDisjunctCount) { return true; } return false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeBooleanValueSpaceData.h0000644000175000017500000000515312520551106030771 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBOOLEANVALUESPACEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBOOLEANVALUESPACEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeBooleanValueSpaceMap.h" #include "CDatatypeCompareValueSpaceData.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceBooleanType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeBooleanValueSpaceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeBooleanValueSpaceData : public CDatatypeCompareValueSpaceData { // public methods public: //! Constructor CDatatypeBooleanValueSpaceData(CProcessContext* processContext); CDatatypeBooleanValueSpaceData* copyBooleanValueSpaceData(CDatatypeBooleanValueSpaceData* spaceData); CDatatypeBooleanValueSpaceData* initBooleanValueSpaceData(CDatatypeValueSpaceBooleanType* valueSpaceType); CDatatypeBooleanValueSpaceMap* getBooleanValueSpaceMap(bool create); // protected methods protected: virtual CDatatypeCompareValueSpaceMap* createValueSpaceMap(); // protected variables protected: CDatatypeBooleanValueSpaceMap* mBooleanValueSpaceMap; CDatatypeValueSpaceBooleanType* mValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBOOLEANVALUESPACEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CLinkedRoleSaturationSuccessorHash.h0000644000175000017500000001071312520551130031746 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CLINKEDROLESATURATIONSUCCESSORHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CLINKEDROLESATURATIONSUCCESSORHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CLinkedRoleSaturationSuccessorData.h" #include "CSaturationSuccessorRoleAssertionLinker.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CLinkedRoleSaturationSuccessorHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLinkedRoleSaturationSuccessorHash { // public methods public: //! Constructor CLinkedRoleSaturationSuccessorHash(CProcessContext* context = nullptr); CLinkedRoleSaturationSuccessorHash* initRoleSuccessorHash(); CLinkedRoleSaturationSuccessorHash* copyRoleSuccessorHash(CLinkedRoleSaturationSuccessorHash* copyRoleSuccHash); bool hasActiveLinkedSuccessor(CRole* role, CIndividualSaturationProcessNode* linkedIndi, CRole* creationRole = nullptr, cint64 linkCount = 1); bool hasLinkedSuccessor(CRole* role, CIndividualSaturationProcessNode* linkedIndi, CRole* creationRole = nullptr, cint64 linkCount = 1); CLinkedRoleSaturationSuccessorHash* addLinkedSuccessor(CRole* role, CIndividualSaturationProcessNode* linkedIndi, CRole* creationRole, cint64 linkCount = 1, bool forceAddLink = false); CLinkedRoleSaturationSuccessorHash* addLinkedVALUESuccessor(CRole* role, cint64 nominalID, CRole* creationRole); CLinkedRoleSaturationSuccessorHash* deactivateLinkedSuccessor(CRole* role, CIndividualSaturationProcessNode* linkedIndi, CRole* creationRole); CLinkedRoleSaturationSuccessorHash* addExtensionSuccessor(CRole* role, CIndividualSaturationProcessNode* linkedIndi, CRole* creationRole, cint64 linkCount = 1); CLinkedRoleSaturationSuccessorHash* setSuccessorMergedCreation(CRole* role, CIndividualSaturationProcessNode* linkedIndi); CPROCESSHASH* getLinkedRoleSuccessorHash(); CLinkedRoleSaturationSuccessorData*& getLinkedRoleSuccessorData(CRole* role, bool create = true); bool hasLinkedRoleSuccessorData(CRole* role); CConceptSaturationDescriptor* getLastExaminedConceptDescriptor(); CLinkedRoleSaturationSuccessorHash* setLastExaminedConceptDescriptor(CConceptSaturationDescriptor* conDes); CSaturationSuccessorRoleAssertionLinker* getLastExaminedRoleAssertionLinker(); CLinkedRoleSaturationSuccessorHash* setLastExaminedRoleAssertionLinker(CSaturationSuccessorRoleAssertionLinker* roleAssLinker); // protected methods protected: CSaturationSuccessorData*& getLinkedRoleSuccessorData(CLinkedRoleSaturationSuccessorData*& roleSuccData, cint64 linkedIndiID, bool forceNewCreation = false); bool hasActiveCreationRole(CSaturationSuccessorData* succData, CRole* creationRole); // protected variables protected: CProcessContext* mContext; CPROCESSHASH mRoleSuccDataHash; CConceptSaturationDescriptor* mLastExaminedConDes; CSaturationSuccessorRoleAssertionLinker* mLastExaminedRoleAssLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CLINKEDROLESATURATIONSUCCESSORHASH_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualReactivationProcessingQueue.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualReactivationProcessingQueue0000644000175000017500000001023112520551126032423 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualReactivationProcessingQueue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualReactivationProcessingQueue::CIndividualReactivationProcessingQueue(CProcessContext* processContext) : mProcessContext(processContext),mPriorityIndiReactivationMap(processContext) { } CIndividualReactivationProcessingQueue* CIndividualReactivationProcessingQueue::initProcessingQueue(CIndividualReactivationProcessingQueue* processingQueue) { if (processingQueue) { mPriorityIndiReactivationMap = processingQueue->mPriorityIndiReactivationMap; } else { mPriorityIndiReactivationMap.clear(); } return this; } bool CIndividualReactivationProcessingQueue::takeNextReactivationIndividual(CIndividualProcessNode*& indiNode, bool& forceReactivation) { CIndividualProcessNode* nextNode = nullptr; if (!mPriorityIndiReactivationMap.isEmpty()) { CPROCESSMAP::iterator it = mPriorityIndiReactivationMap.begin(); CIndividualForceReactivationData& data = it.value(); forceReactivation = data.mForceReactivation; indiNode = data.mIndiNode; it = mPriorityIndiReactivationMap.erase(it); return true; } return false; } bool CIndividualReactivationProcessingQueue::getNextReactivationIndividual(CIndividualProcessNode*& indiNode, bool& forceReactivation) { CIndividualProcessNode* nextNode = nullptr; if (!mPriorityIndiReactivationMap.isEmpty()) { CPROCESSMAP::iterator it = mPriorityIndiReactivationMap.begin(); CIndividualForceReactivationData& data = it.value(); forceReactivation = data.mForceReactivation; indiNode = data.mIndiNode; return true; } return false; } bool CIndividualReactivationProcessingQueue::hasQueuedIndividual(CIndividualProcessNode* individual) { CIndividualProcessNode* nextNode = nullptr; if (!mPriorityIndiReactivationMap.isEmpty()) { CIndividualDepthPriority priority(individual->getIndividualNominalLevelOrAncestorDepth(),individual->getIndividualID()); return mPriorityIndiReactivationMap.contains(priority); } return false; } bool CIndividualReactivationProcessingQueue::insertReactivationIndiviudal(CIndividualProcessNode* individual, bool forceReactivation) { CIndividualDepthPriority priority(individual->getIndividualNominalLevelOrAncestorDepth(),individual->getIndividualID()); CIndividualForceReactivationData& inFoReDa = mPriorityIndiReactivationMap[priority]; bool newEntry = inFoReDa.mIndiNode == nullptr || !inFoReDa.mForceReactivation && forceReactivation; inFoReDa.mForceReactivation = forceReactivation; inFoReDa.mIndiNode = individual; return newEntry; } bool CIndividualReactivationProcessingQueue::isEmpty() { return mPriorityIndiReactivationMap.count() <= 0; } cint64 CIndividualReactivationProcessingQueue::getQueuedIndividualCount() { return mPriorityIndiReactivationMap.count(); } bool CIndividualReactivationProcessingQueue::hasQueuedIndividuals() { return mPriorityIndiReactivationMap.count() > 0; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CTriggeredImplicationProcessingRestrictionSpecification.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CTriggeredImplicationProcessingRestric0000644000175000017500000000572412520551162032431 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CTRIGGEREDIMPLICATIONPROCESSINGRESTRICTIONSPECIFICATION_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CTRIGGEREDIMPLICATIONPROCESSINGRESTRICTIONSPECIFICATION_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessingRestrictionSpecification.h" #include "CClashedConceptDescriptor.h" // Other includes #include "Reasoner/Ontology/CConceptRoleBranchingTrigger.h" #include "Reasoner/Kernel/Process/Dependency/CDependency.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CTriggeredImplicationProcessingRestrictionSpecification * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTriggeredImplicationProcessingRestrictionSpecification : public CProcessingRestrictionSpecification { // public methods public: //! Constructor CTriggeredImplicationProcessingRestrictionSpecification(); CTriggeredImplicationProcessingRestrictionSpecification* initImplicationTriggeringProcessingRestriction(CTriggeredImplicationProcessingRestrictionSpecification* prevRest = nullptr); bool hasConceptImplicationTrigger(); CSortedNegLinker* getConceptImplicationTrigger(); CTriggeredImplicationProcessingRestrictionSpecification* setConceptImplicationTrigger(CSortedNegLinker* implicationTrigger); CDependency* getImplicationDependency(); CTriggeredImplicationProcessingRestrictionSpecification* setImplicationDependency(CDependency* dependency); // protected methods protected: // protected variables protected: CSortedNegLinker* mNextImpTrigger; CDependency* mLastDependency; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CTRIGGEREDIMPLICATIONPROCESSINGRESTRICTIONSPECIFICATION_H ././@LongLink0000644000000000000000000000020300000000000011576 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeRepresentativeMemoryBac0000644000175000017500000001137712520551124032350 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEREPRESENTATIVEMEMORYBACKENDCACHESYNCHRONISATIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEREPRESENTATIVEMEMORYBACKENDCACHESYNCHRONISATIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualNodeBackendCacheSynchronisationData.h" #include "CConceptDescriptor.h" // Other includes #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheIndividualAssociationData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Cache; namespace Process { /*! * * \class CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData : public CIndividualNodeBackendCacheSynchronisationData { // public methods public: //! Constructor CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData(); //! Destructor virtual ~CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData(); CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* initSynchronisationData(CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* synchData); CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* initSynchronisationData(CBackendRepresentativeMemoryCacheIndividualAssociationData* associationData); CConceptDescriptor* getLastSynchronizationTestedConceptDescriptor(); CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* setLastSynchronizationTestedConceptDescriptor(CConceptDescriptor* conDes); CIndividualLinkEdge* getLastCriticalCardinalityLinkEdge(); CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* setLastCriticalCardinalityLinkEdge(CIndividualLinkEdge* linkEdge); CConceptDescriptor* getLastCriticalNeighbourExpansionTestedConceptDescriptor(); CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* setLastCriticalNeighbourExpansionTestedConceptDescriptor(CConceptDescriptor* conDes); CConceptDescriptor* getLastSynchedConceptDescriptor(); CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* setLastSynchedConceptDescriptor(CConceptDescriptor* conDes); CBackendRepresentativeMemoryCacheIndividualAssociationData* getAssocitaionData(); CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* setAssociationData(CBackendRepresentativeMemoryCacheIndividualAssociationData* associationData); bool isBackendCacheSynchron(); CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* setBackendCacheSynchron(bool synchron); bool isCriticalNeighbourExpansionBlocking(); CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* setCriticalNeighbourExpansionBlocking(bool critical); bool isCriticalCardinalityExpansionBlocking(); CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* setCriticalCardinalityExpansionBlocking(bool critical); // protected methods protected: // protected variables protected: CConceptDescriptor* mLastCriticalNeighbourTestedConDes; CIndividualLinkEdge* mLastCriticalNeighbourLinkEdge; CConceptDescriptor* mLastSynchronizationTestedConDes; CConceptDescriptor* mLastSynchedConDes; CBackendRepresentativeMemoryCacheIndividualAssociationData* mAssociationData; bool mSynchron; bool mCriticalNeighbour; bool mCriticalCardinality; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEREPRESENTATIVEMEMORYBACKENDCACHESYNCHRONISATIONDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCoreConceptDescriptor.h0000644000175000017500000000413012520551104027406 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCORECONCEPTDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCORECONCEPTDESCRIPTOR_H // Libraries includes #include // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CCoreConceptDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCoreConceptDescriptor : public CLinkerBase { // public methods public: //! Constructor CCoreConceptDescriptor(); CCoreConceptDescriptor* initCoreConceptDescriptor(CConceptDescriptor* conDes); CConceptDescriptor *getConceptDesciptor(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCORECONCEPTDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingDescriptor.h0000644000175000017500000000450612520551162030235 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGDESCRIPTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CVariableBinding.h" // Other includes #include "Utilities/Container/CSortedLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CVariableBindingDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingDescriptor : public CSortedLinkerBase { // public methods public: //! Constructor CVariableBindingDescriptor(); CVariableBindingDescriptor* initVariableBindingDescriptor(CVariableBinding* propBinding); CVariableBinding* getVariableBinding() const; bool operator<=(const CVariableBindingDescriptor& beforeData); bool operator<=(const CVariableBinding& beforeData); bool operator<=(const CVariableBinding*& beforeData); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGDESCRIPTOR_H ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCacheRetrievalData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCac0000644000175000017500000000452012520551124032234 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATISFIABLEEXPANDINGCACHERETRIEVALDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATISFIABLEEXPANDINGCACHERETRIEVALDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualNodeSatisfiableCacheRetrievalData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualNodeSatisfiableExpandingCacheRetrievalData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeSatisfiableExpandingCacheRetrievalData : public CIndividualNodeSatisfiableCacheRetrievalData { // public methods public: //! Constructor CIndividualNodeSatisfiableExpandingCacheRetrievalData(); //! Destructor virtual ~CIndividualNodeSatisfiableExpandingCacheRetrievalData(); CIndividualNodeSatisfiableExpandingCacheRetrievalData* initSatisfiableExpandingCacheRetrievalData(CIndividualNodeSatisfiableExpandingCacheRetrievalData* prevData); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATISFIABLEEXPANDINGCACHERETRIEVALDATA_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeBinaryBase64DataValueSpaceData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeBinaryBase64DataValueSpaceDat0000644000175000017500000000645712520551106032016 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeBinaryBase64DataValueSpaceData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeBinaryBase64DataValueSpaceData::CDatatypeBinaryBase64DataValueSpaceData(CProcessContext* processContext) : CDatatypeCompareValueSpaceData(processContext) { mBinaryBase64DataValueSpaceMap = nullptr; } CDatatypeBinaryBase64DataValueSpaceData* CDatatypeBinaryBase64DataValueSpaceData::initBinaryBase64DataValueSpaceData(CDatatypeValueSpaceBinaryBase64DataType* valueSpaceType) { CDatatypeCompareValueSpaceData::initValueSpaceData(nullptr); mValueSpaceType = valueSpaceType; if (mBinaryBase64DataValueSpaceMap) { mBinaryBase64DataValueSpaceMap->initDatatypeCompareValueSpaceMap(valueSpaceType); } return this; } CDatatypeBinaryBase64DataValueSpaceData* CDatatypeBinaryBase64DataValueSpaceData::copyBinaryBase64DataValueSpaceData(CDatatypeBinaryBase64DataValueSpaceData* spaceData) { CDatatypeCompareValueSpaceData::initValueSpaceData(spaceData); mValueSpaceType = spaceData->mValueSpaceType; if (spaceData->mBinaryBase64DataValueSpaceMap && !mBinaryBase64DataValueSpaceMap) { getBinaryBase64DataValueSpaceMap(true); mBinaryBase64DataValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mBinaryBase64DataValueSpaceMap); } else if (mBinaryBase64DataValueSpaceMap) { if (spaceData->mBinaryBase64DataValueSpaceMap) { mBinaryBase64DataValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mBinaryBase64DataValueSpaceMap); } else { mBinaryBase64DataValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } } return this; } CDatatypeBinaryDataValueSpaceMap* CDatatypeBinaryBase64DataValueSpaceData::getBinaryBase64DataValueSpaceMap(bool create) { if (create && !mBinaryBase64DataValueSpaceMap) { mBinaryBase64DataValueSpaceMap = CObjectParameterizingAllocator< CDatatypeBinaryDataValueSpaceMap,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mBinaryBase64DataValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } return mBinaryBase64DataValueSpaceMap; } CDatatypeCompareValueSpaceMap* CDatatypeBinaryBase64DataValueSpaceData::createValueSpaceMap() { return getBinaryBase64DataValueSpaceMap(true); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualProcessNode.cpp0000644000175000017500000021365012520551410027744 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualProcessNode::CIndividualProcessNode(CProcessContext* processContext) : mProcessContext(processContext) { mMemAllocMan = CContext::getMemoryAllocationManager(mProcessContext); mPrevIndividual = nullptr; mConceptProcessingQueue = nullptr; mUseConceptProcessingQueue = nullptr; mPrevConceptProcessingQueue = nullptr; mReapplyConLabelSet = nullptr; mUseReapplyConLabelSet = nullptr; mPrevReapplyConLabelSet = nullptr; mReapplyRoleSuccHash = nullptr; mUseReapplyRoleSuccHash = nullptr; mPrevReapplyRoleSuccHash = nullptr; mLastAddedLink = nullptr; mConceptPropBindingSetHash = nullptr; mUseConceptPropBindingSetHash = nullptr; mPrevConceptPropBindingSetHash = nullptr; mConceptVarBindPathSetHash = nullptr; mUseConceptVarBindPathSetHash = nullptr; mPrevConceptVarBindPathSetHash = nullptr; mConceptRepPropSetHash = nullptr; mUseConceptRepPropSetHash = nullptr; mPrevConceptRepPropSetHash = nullptr; mSuccRoleHash = nullptr; mUseSuccRoleHash = nullptr; mPrevSuccRoleHash = nullptr; mConnSuccSet = nullptr; mUseConnSuccSet = nullptr; mPrevConnSuccSet = nullptr; mDisjointSuccRoleHash = nullptr; mUseDisjointSuccRoleHash = nullptr; mPrevDisjointSuccRoleHash = nullptr; mDisjointRoleConnections = false; mDistinctHash = nullptr; mUseDistinctHash = nullptr; mPrevDistinctHash = nullptr; mBackendSyncData = nullptr; mPrevBackendSyncData = nullptr; indiModel = nullptr; mSatCacheRetData = nullptr; mPrevSatCacheRetData = nullptr; mSatCacheStoringData = nullptr; mPrevSatCacheStoringData = nullptr; mIndiBlock = nullptr; mPrevIndiBlock = nullptr; mAncestorLink = nullptr; mIndiSatBlockData = nullptr; mPrevIndiSatBlockData = nullptr; mIndiUnsatCacheRet = nullptr; mPrevIndiUnsatCacheRet = nullptr; mSigBlockConExpData = nullptr; mPrevSigBlockConExpData = nullptr; mReusingConExpData = nullptr; mPrevReusingConExpData = nullptr; mInitializingConceptLinkerIt = nullptr; mProcessInitializingConceptLinkerIt = nullptr; mAssertionConceptLinkerIt = nullptr; mAssertionRoleLinkerIt = nullptr; mBlockedIndividualsLinker = nullptr; mReverseAssertionRoleLinkerIt = nullptr; mAdditionalRoleAssertionsLinker = nullptr; mRoleAssertionsInitialized = false; mReverseRoleAssertionsInitialized = false; mInitConceptDescriptor = nullptr; mSatCachedAbsorbedDisjunctionsReapplyConDes = nullptr; mSatCachedAbsorbedSuccessorReapplyConDes = nullptr; mSigBlockIndExplData = nullptr; mPrevSigBlockIndExplData = nullptr; mUseSigBlockIndExplData = nullptr; mSigBlockFollowSet = nullptr; mUseSigBlockFollowSet = nullptr; mPrevSigBlockFollowSet = nullptr; mLastConceptCountCachedBlockerCandidate = 0; mLastConceptCountSearchBlockerCandidate = 0; mLastSearchBlockerCandidateCount = 0; mLastSearchBlockerCandidateSignature = 0; mBlockingCachingSavedCandidateCount = 0; indiAncDepth = 0; mNominalLevel = 0; mMergeIntoID = 0; mIndiID = 0; mNomIndi = nullptr; mMergedDepTrackPoint = nullptr; mInvalidSignatureBlocking = false; mProcessingQueued = false; mExtendedQueueProcessing = false; mImmediatelyProcessingQueued = false; mDetExpProcessingQueued = false; mDepthProcessingQueued = false; mBlockedReactProcessingQueued = false; mDelayedNominalProcessingQueued = false; mNominalProcessingDelayingChecked = false; mBackendSynchronRetestProcessingQueued = false; mIncrementalCompatibilityCheckingQueued = false; mIncrementalExpansionQueued = false; mAssertionInitialisationSignatureValue = 0; mProcessingBlockedIndi = nullptr; mProcessingBlockedIndividualsLinker = nullptr; mSuccessorIndiNodeBackwardDependencyLinker = nullptr; mBackwardDependencyToAncestorIndividualNode = false; mIndiType = BLOCKABLEINDIVIDUALTYPE; mProcessingRestrictionFlags = 0; mRoleBackPropHash = nullptr; mIndiProcessLinker = nullptr; mConceptProcessLinker = nullptr; mRequiredBackProp = false; mSubstituteIndiNode = nullptr; setLocalizationTag(mProcessContext->getUsedProcessTagger()); mDebugBlockerLastConceptDes = nullptr; mCachingLossNodeReactivationInstalled = false; mLocReactivationData = nullptr; mUseReactivationData = nullptr; mLocNominalConnectionSet = nullptr; mUseNominalConnectionSet = nullptr; mUseDatatypesValueSpaceData = nullptr; mUseIncExpData = nullptr; mIncExpID = 0; mBlockerIndiNode = nullptr; mFollowingIndiNode = nullptr; mLocDatatypesValueSpaceData = nullptr; mLocIncExpData = nullptr; mLocIndividualMergingHash = nullptr; mUseIndividualMergingHash = nullptr; mRoleAssertionCreationID = 0; mLastMergedIntoIndividualNode = nullptr; } CIndividualProcessNode* CIndividualProcessNode::initIndividualProcessNode(CIndividualProcessNode* prevIndividual) { mRoleBackPropHash = nullptr; mIndiProcessLinker = nullptr; mConceptProcessLinker = nullptr; mRequiredBackProp = false; mSubstituteIndiNode = nullptr; mLocReactivationData = nullptr; mLocNominalConnectionSet = nullptr; mLocDatatypesValueSpaceData = nullptr; mLocIncExpData = nullptr; mLocIndividualMergingHash = nullptr; mBackendSyncData = nullptr; setBlockedTestTag(prevIndividual->getBlockedTestTag()); mPrevIndividual = prevIndividual; mDebugBlockerLastConceptDes = prevIndividual->mDebugBlockerLastConceptDes; mPrevConceptProcessingQueue = prevIndividual->mUseConceptProcessingQueue; mUseConceptProcessingQueue = mPrevConceptProcessingQueue; mPrevReapplyConLabelSet = prevIndividual->mUseReapplyConLabelSet; mUseReapplyConLabelSet = mPrevReapplyConLabelSet; mPrevReapplyRoleSuccHash = prevIndividual->mUseReapplyRoleSuccHash; mUseReapplyRoleSuccHash = mPrevReapplyRoleSuccHash; mLastAddedLink = prevIndividual->mLastAddedLink; mPrevConceptPropBindingSetHash = prevIndividual->mUseConceptPropBindingSetHash; mUseConceptPropBindingSetHash = mPrevConceptPropBindingSetHash; mPrevConceptVarBindPathSetHash = prevIndividual->mUseConceptVarBindPathSetHash; mUseConceptVarBindPathSetHash = mPrevConceptVarBindPathSetHash; mPrevConceptRepPropSetHash = prevIndividual->mUseConceptRepPropSetHash; mUseConceptRepPropSetHash = mPrevConceptRepPropSetHash; mPrevSuccRoleHash = prevIndividual->mUseSuccRoleHash; mUseSuccRoleHash = mPrevSuccRoleHash; mPrevDisjointSuccRoleHash = prevIndividual->mUseDisjointSuccRoleHash; mUseDisjointSuccRoleHash = mPrevDisjointSuccRoleHash; mDisjointRoleConnections = prevIndividual->mDisjointRoleConnections; mPrevConnSuccSet = prevIndividual->mUseConnSuccSet; mUseConnSuccSet = mPrevConnSuccSet; mPrevDistinctHash = prevIndividual->mUseDistinctHash; mUseDistinctHash = mPrevDistinctHash; mInitializingConceptLinkerIt = prevIndividual->mInitializingConceptLinkerIt; mProcessInitializingConceptLinkerIt = prevIndividual->mProcessInitializingConceptLinkerIt; mAssertionRoleLinkerIt = prevIndividual->mAssertionRoleLinkerIt; mReverseAssertionRoleLinkerIt = prevIndividual->mReverseAssertionRoleLinkerIt; mAdditionalRoleAssertionsLinker = prevIndividual->mAdditionalRoleAssertionsLinker; mRoleAssertionsInitialized = prevIndividual->mRoleAssertionsInitialized; mReverseRoleAssertionsInitialized = prevIndividual->mReverseRoleAssertionsInitialized; mBlockedIndividualsLinker = prevIndividual->mBlockedIndividualsLinker; mSuccessorIndiNodeBackwardDependencyLinker = prevIndividual->mSuccessorIndiNodeBackwardDependencyLinker; mBackwardDependencyToAncestorIndividualNode = prevIndividual->mBackwardDependencyToAncestorIndividualNode; mAncestorLink = prevIndividual->mAncestorLink; indiModel = prevIndividual->indiModel; mPrevIndiBlock = prevIndividual->mPrevIndiBlock; mPrevIndiSatBlockData = prevIndividual->mPrevIndiSatBlockData; mPrevIndiUnsatCacheRet = prevIndividual->mPrevIndiUnsatCacheRet; mPrevSigBlockConExpData = prevIndividual->mPrevSigBlockConExpData; mPrevReusingConExpData = prevIndividual->mPrevReusingConExpData; mPrevSatCacheRetData = prevIndividual->mPrevSatCacheRetData; mPrevBackendSyncData = prevIndividual->mPrevBackendSyncData; mPrevSigBlockIndExplData = prevIndividual->mUseSigBlockIndExplData; mUseSigBlockIndExplData = mPrevSigBlockIndExplData; mPrevSigBlockFollowSet = prevIndividual->mUseSigBlockFollowSet; mUseSigBlockFollowSet = mPrevSigBlockFollowSet; mPrevSatCacheStoringData = prevIndividual->mPrevSatCacheStoringData; indiAncDepth = prevIndividual->indiAncDepth; mNominalLevel = prevIndividual->mNominalLevel; mMergeIntoID = prevIndividual->mMergeIntoID; mMergedDepTrackPoint = prevIndividual->mMergedDepTrackPoint; mIndiID = prevIndividual->mIndiID; mIndiType = prevIndividual->mIndiType; mProcessingBlockedIndi = prevIndividual->mProcessingBlockedIndi; mProcessingBlockedIndividualsLinker = prevIndividual->mProcessingBlockedIndividualsLinker; mInitConceptDescriptor = prevIndividual->mInitConceptDescriptor; mProcessingRestrictionFlags = prevIndividual->mProcessingRestrictionFlags; mNomIndi = prevIndividual->mNomIndi; mInvalidSignatureBlocking = prevIndividual->mInvalidSignatureBlocking; mProcessingQueued = prevIndividual->mProcessingQueued; mExtendedQueueProcessing = prevIndividual->mExtendedQueueProcessing; mImmediatelyProcessingQueued = prevIndividual->mImmediatelyProcessingQueued; mDetExpProcessingQueued = prevIndividual->mDetExpProcessingQueued; mDepthProcessingQueued = prevIndividual->mDepthProcessingQueued; mBlockedReactProcessingQueued = prevIndividual->mBlockedReactProcessingQueued; mBackendSynchronRetestProcessingQueued = prevIndividual->mBackendSynchronRetestProcessingQueued; mIncrementalCompatibilityCheckingQueued = prevIndividual->mIncrementalCompatibilityCheckingQueued; mIncrementalExpansionQueued = prevIndividual->mIncrementalExpansionQueued; mDelayedNominalProcessingQueued = prevIndividual->mDelayedNominalProcessingQueued; mNominalProcessingDelayingChecked = prevIndividual->mNominalProcessingDelayingChecked; mAssertionInitialisationSignatureValue = prevIndividual->mAssertionInitialisationSignatureValue; mLastProcessingPriority = prevIndividual->mLastProcessingPriority; mDependencyTrackPoint = prevIndividual->mDependencyTrackPoint; mSatCachedAbsorbedDisjunctionsReapplyConDes = prevIndividual->mSatCachedAbsorbedDisjunctionsReapplyConDes; mSatCachedAbsorbedSuccessorReapplyConDes = prevIndividual->mSatCachedAbsorbedSuccessorReapplyConDes; mLastConceptCountCachedBlockerCandidate = prevIndividual->mLastConceptCountCachedBlockerCandidate; mLastConceptCountSearchBlockerCandidate = prevIndividual->mLastConceptCountSearchBlockerCandidate; mBlockingCachingSavedCandidateCount = prevIndividual->mBlockingCachingSavedCandidateCount; mLastSearchBlockerCandidateCount = prevIndividual->mLastSearchBlockerCandidateCount; mLastSearchBlockerCandidateSignature = prevIndividual->mLastSearchBlockerCandidateSignature; mCachingLossNodeReactivationInstalled = prevIndividual->mCachingLossNodeReactivationInstalled; prevIndividual->setRelocalized(); mUseReactivationData = prevIndividual->mUseReactivationData; mUseNominalConnectionSet = prevIndividual->mUseNominalConnectionSet; mUseDatatypesValueSpaceData = prevIndividual->mUseDatatypesValueSpaceData; mUseIncExpData = prevIndividual->mUseIncExpData; mIncExpID = prevIndividual->mIncExpID; mRoleAssertionCreationID = prevIndividual->mRoleAssertionCreationID; mUseIndividualMergingHash = prevIndividual->mUseIndividualMergingHash; mBlockerIndiNode = prevIndividual->mBlockerIndiNode; mFollowingIndiNode = prevIndividual->mFollowingIndiNode; mLastMergedIntoIndividualNode = prevIndividual->mLastMergedIntoIndividualNode; return this; } CIndividualProcessNode* CIndividualProcessNode::initIndividualProcessNodeCopy(CIndividualProcessNode* prevIndividual, bool adobtConceptLabels, bool adobtRoleSuccessors, bool adobtStatus) { mRoleBackPropHash = nullptr; mIndiProcessLinker = nullptr; mConceptProcessLinker = nullptr; mRequiredBackProp = false; mSubstituteIndiNode = nullptr; mLocReactivationData = nullptr; mLocNominalConnectionSet = nullptr; mLocDatatypesValueSpaceData = nullptr; mLocIncExpData = nullptr; mLocIndividualMergingHash = nullptr; prevIndividual->setRelocalized(); if (adobtStatus) { setBlockedTestTag(prevIndividual->getBlockedTestTag()); } mBackendSyncData = nullptr; mPrevIndividual = prevIndividual; mPrevConceptProcessingQueue = prevIndividual->mUseConceptProcessingQueue; mUseConceptProcessingQueue = mPrevConceptProcessingQueue; mDependencyTrackPoint = prevIndividual->mDependencyTrackPoint; mDebugBlockerLastConceptDes = prevIndividual->mDebugBlockerLastConceptDes; mCachingLossNodeReactivationInstalled = prevIndividual->mCachingLossNodeReactivationInstalled; mLastMergedIntoIndividualNode = prevIndividual->mLastMergedIntoIndividualNode; if (adobtConceptLabels) { mPrevReapplyConLabelSet = prevIndividual->mUseReapplyConLabelSet; mUseReapplyConLabelSet = mPrevReapplyConLabelSet; } if (adobtRoleSuccessors) { mPrevReapplyRoleSuccHash = prevIndividual->mUseReapplyRoleSuccHash; mUseReapplyRoleSuccHash = mPrevReapplyRoleSuccHash; mLastAddedLink = prevIndividual->mLastAddedLink; mPrevConceptPropBindingSetHash = prevIndividual->mUseConceptPropBindingSetHash; mUseConceptPropBindingSetHash = mPrevConceptPropBindingSetHash; mPrevConceptVarBindPathSetHash = prevIndividual->mUseConceptVarBindPathSetHash; mUseConceptVarBindPathSetHash = mPrevConceptVarBindPathSetHash; mPrevConceptRepPropSetHash = prevIndividual->mUseConceptRepPropSetHash; mUseConceptRepPropSetHash = mPrevConceptRepPropSetHash; mPrevSuccRoleHash = prevIndividual->mUseSuccRoleHash; mUseSuccRoleHash = mPrevSuccRoleHash; mPrevDisjointSuccRoleHash = prevIndividual->mUseDisjointSuccRoleHash; mUseDisjointSuccRoleHash = mPrevDisjointSuccRoleHash; mDisjointRoleConnections = prevIndividual->mDisjointRoleConnections; mPrevConnSuccSet = prevIndividual->mUseConnSuccSet; mUseConnSuccSet = mPrevConnSuccSet; mPrevDistinctHash = prevIndividual->mUseDistinctHash; mUseDistinctHash = mPrevDistinctHash; mUseReactivationData = prevIndividual->mUseReactivationData; mUseNominalConnectionSet = prevIndividual->mUseNominalConnectionSet; mNominalProcessingDelayingChecked = prevIndividual->mNominalProcessingDelayingChecked; mUseDatatypesValueSpaceData = prevIndividual->mUseDatatypesValueSpaceData; mUseIndividualMergingHash = prevIndividual->mUseIndividualMergingHash; } if (adobtStatus) { mRoleAssertionCreationID = prevIndividual->mRoleAssertionCreationID; mIncExpID = prevIndividual->mIncExpID; mUseIncExpData = prevIndividual->mUseIncExpData; mFollowingIndiNode = prevIndividual->mFollowingIndiNode; mBlockerIndiNode = prevIndividual->mBlockerIndiNode; mInitializingConceptLinkerIt = prevIndividual->mInitializingConceptLinkerIt; mProcessInitializingConceptLinkerIt = prevIndividual->mProcessInitializingConceptLinkerIt; mAssertionRoleLinkerIt = prevIndividual->mAssertionRoleLinkerIt; mReverseAssertionRoleLinkerIt = prevIndividual->mReverseAssertionRoleLinkerIt; mAdditionalRoleAssertionsLinker = prevIndividual->mAdditionalRoleAssertionsLinker; mRoleAssertionsInitialized = prevIndividual->mRoleAssertionsInitialized; mReverseRoleAssertionsInitialized = prevIndividual->mReverseRoleAssertionsInitialized; mBlockedIndividualsLinker = prevIndividual->mBlockedIndividualsLinker; mSuccessorIndiNodeBackwardDependencyLinker = prevIndividual->mSuccessorIndiNodeBackwardDependencyLinker; mBackwardDependencyToAncestorIndividualNode = prevIndividual->mBackwardDependencyToAncestorIndividualNode; mAncestorLink = prevIndividual->mAncestorLink; indiModel = prevIndividual->indiModel; mPrevIndiBlock = prevIndividual->mPrevIndiBlock; mPrevIndiSatBlockData = prevIndividual->mPrevIndiSatBlockData; mPrevIndiUnsatCacheRet = prevIndividual->mPrevIndiUnsatCacheRet; mPrevSigBlockConExpData = prevIndividual->mPrevSigBlockConExpData; mPrevReusingConExpData = prevIndividual->mPrevReusingConExpData; mPrevSatCacheRetData = prevIndividual->mPrevSatCacheRetData; mPrevBackendSyncData = prevIndividual->mPrevBackendSyncData; mPrevSigBlockIndExplData = prevIndividual->mUseSigBlockIndExplData; mUseSigBlockIndExplData = mPrevSigBlockIndExplData; mPrevSigBlockFollowSet = prevIndividual->mUseSigBlockFollowSet; mUseSigBlockFollowSet = mPrevSigBlockFollowSet; mPrevSatCacheStoringData = prevIndividual->mPrevSatCacheStoringData; mProcessingBlockedIndi = prevIndividual->mProcessingBlockedIndi; mProcessingBlockedIndividualsLinker = prevIndividual->mProcessingBlockedIndividualsLinker; mInitConceptDescriptor = prevIndividual->mInitConceptDescriptor; mProcessingRestrictionFlags = prevIndividual->mProcessingRestrictionFlags; mIndiID = prevIndividual->mIndiID; mMergeIntoID = prevIndividual->mMergeIntoID; mMergedDepTrackPoint = prevIndividual->mMergedDepTrackPoint; mNomIndi = prevIndividual->mNomIndi; mSatCachedAbsorbedDisjunctionsReapplyConDes = prevIndividual->mSatCachedAbsorbedDisjunctionsReapplyConDes; mSatCachedAbsorbedSuccessorReapplyConDes = prevIndividual->mSatCachedAbsorbedSuccessorReapplyConDes; mLastConceptCountCachedBlockerCandidate = prevIndividual->mLastConceptCountCachedBlockerCandidate; mLastConceptCountSearchBlockerCandidate = prevIndividual->mLastConceptCountSearchBlockerCandidate; mBlockingCachingSavedCandidateCount = prevIndividual->mBlockingCachingSavedCandidateCount; mLastSearchBlockerCandidateCount = prevIndividual->mLastSearchBlockerCandidateCount; mLastSearchBlockerCandidateSignature = prevIndividual->mLastSearchBlockerCandidateSignature; mInvalidSignatureBlocking = prevIndividual->mInvalidSignatureBlocking; mProcessingQueued = prevIndividual->mProcessingQueued; mExtendedQueueProcessing = prevIndividual->mExtendedQueueProcessing; mLastProcessingPriority = prevIndividual->mLastProcessingPriority; mImmediatelyProcessingQueued = prevIndividual->mImmediatelyProcessingQueued; mDetExpProcessingQueued = prevIndividual->mDetExpProcessingQueued; mDepthProcessingQueued = prevIndividual->mDepthProcessingQueued; mBlockedReactProcessingQueued = prevIndividual->mBlockedReactProcessingQueued; mBackendSynchronRetestProcessingQueued = prevIndividual->mBackendSynchronRetestProcessingQueued; mIncrementalCompatibilityCheckingQueued = prevIndividual->mIncrementalCompatibilityCheckingQueued; mIncrementalExpansionQueued = prevIndividual->mIncrementalExpansionQueued; mDelayedNominalProcessingQueued = prevIndividual->mDelayedNominalProcessingQueued; mAssertionInitialisationSignatureValue = prevIndividual->mAssertionInitialisationSignatureValue; } indiAncDepth = prevIndividual->indiAncDepth; mNominalLevel = prevIndividual->mNominalLevel; mIndiType = prevIndividual->mIndiType; return this; } CIndividualProcessNode* CIndividualProcessNode::getProcessingBlockTestIndividual() { return mProcessingBlockedIndi; } CIndividualProcessNode* CIndividualProcessNode::clearProcessingBlockTestIndividual() { mProcessingBlockedIndi = nullptr; return this; } CIndividualProcessNode* CIndividualProcessNode::setProcessingBlockTestIndividual(CIndividualProcessNode* processingBlockTestIndi) { mProcessingBlockedIndi = processingBlockTestIndi; return this; } bool CIndividualProcessNode::hasInitializingConcepts() { return mInitializingConceptLinkerIt != nullptr; } CIndividualProcessNode* CIndividualProcessNode::clearProcessInitializingConcepts() { mProcessInitializingConceptLinkerIt = nullptr; return this; } CXSortedNegLinker* CIndividualProcessNode::getProcessInitializingConceptLinker() { return mProcessInitializingConceptLinkerIt; } CXSortedNegLinker* CIndividualProcessNode::getInitializingConceptLinker() { return mInitializingConceptLinkerIt; } CIndividualProcessNode* CIndividualProcessNode::setInitializingConceptLinker(CXSortedNegLinker* initializingConceptLinkerIt) { mInitializingConceptLinkerIt = initializingConceptLinkerIt; return this; } CIndividualProcessNode* CIndividualProcessNode::addInitializingConceptLinker(CXSortedNegLinker* initializingConceptLinkerIt) { if (initializingConceptLinkerIt) { mInitializingConceptLinkerIt = initializingConceptLinkerIt->append(mInitializingConceptLinkerIt); mProcessInitializingConceptLinkerIt = mInitializingConceptLinkerIt; } return this; } bool CIndividualProcessNode::hasAssertionConcepts() { return mAssertionConceptLinkerIt != nullptr; } CIndividualProcessNode* CIndividualProcessNode::clearAssertionConcepts() { mAssertionConceptLinkerIt = nullptr; return this; } CConceptAssertionLinker* CIndividualProcessNode::getAssertionConceptLinker() { return mAssertionConceptLinkerIt; } CIndividualProcessNode* CIndividualProcessNode::setAssertionConceptLinker(CConceptAssertionLinker* assertionConceptLinkerIt) { mAssertionConceptLinkerIt = assertionConceptLinkerIt; return this; } bool CIndividualProcessNode::hasAssertionRoles() { return mAssertionRoleLinkerIt != nullptr; } CIndividualProcessNode* CIndividualProcessNode::clearAssertionRoles() { mAssertionRoleLinkerIt = nullptr; return this; } CRoleAssertionLinker* CIndividualProcessNode::getAssertionRoleLinker() { return mAssertionRoleLinkerIt; } CIndividualProcessNode* CIndividualProcessNode::setAssertionRoleLinker(CRoleAssertionLinker* assertionRoleLinkerIt) { mAssertionRoleLinkerIt = assertionRoleLinkerIt; return this; } cint64 CIndividualProcessNode::getRoleAssertionCreationID() { return mRoleAssertionCreationID; } CIndividualProcessNode* CIndividualProcessNode::setRoleAssertionCreationID(cint64 creationID) { mRoleAssertionCreationID = creationID; return this; } bool CIndividualProcessNode::hasReverseAssertionRoles() { return mReverseAssertionRoleLinkerIt != nullptr; } CIndividualProcessNode* CIndividualProcessNode::clearReverseAssertionRoles() { mReverseAssertionRoleLinkerIt = nullptr; return this; } CReverseRoleAssertionLinker* CIndividualProcessNode::getReverseAssertionRoleLinker() { return mReverseAssertionRoleLinkerIt; } CIndividualProcessNode* CIndividualProcessNode::setReverseAssertionRoleLinker(CReverseRoleAssertionLinker* reverseAssertionRoleLinkerIt) { mReverseAssertionRoleLinkerIt = reverseAssertionRoleLinkerIt; return this; } bool CIndividualProcessNode::hasAdditionalRoleAssertionsLinker() { return mAdditionalRoleAssertionsLinker != nullptr; } CIndividualProcessNode* CIndividualProcessNode::clearAdditionalRoleAssertionsLinker() { mAdditionalRoleAssertionsLinker = nullptr; return this; } CAdditionalProcessRoleAssertionsLinker* CIndividualProcessNode::getAdditionalRoleAssertionsLinker() { return mAdditionalRoleAssertionsLinker; } CIndividualProcessNode* CIndividualProcessNode::setAdditionalRoleAssertionsLinker(CAdditionalProcessRoleAssertionsLinker* reverseRoleAssertionsLinker) { mAdditionalRoleAssertionsLinker = reverseRoleAssertionsLinker; return this; } CIndividualProcessNode* CIndividualProcessNode::addAdditionalRoleAssertionsLinker(CAdditionalProcessRoleAssertionsLinker* reverseRoleAssertionsLinker) { mAdditionalRoleAssertionsLinker = reverseRoleAssertionsLinker->append(mAdditionalRoleAssertionsLinker); return this; } bool CIndividualProcessNode::hasRoleAssertionsInitialized() { return mRoleAssertionsInitialized; } CIndividualProcessNode* CIndividualProcessNode::setRoleAssertionsInitialized(bool initialized) { mRoleAssertionsInitialized = initialized; return this; } bool CIndividualProcessNode::hasReverseRoleAssertionsInitialized() { return mReverseRoleAssertionsInitialized; } CIndividualProcessNode* CIndividualProcessNode::setReverseRoleAssertionsInitialized(bool initialized) { mReverseRoleAssertionsInitialized = initialized; return this; } cint64 CIndividualProcessNode::getIndividualID() { return mIndiID; } CIndividualProcessNode* CIndividualProcessNode::setIndividualID(cint64 indiID) { if (mMergeIntoID == mIndiID) { mMergeIntoID = indiID; } mIndiID = indiID; return this; } CIndividualProcessNode::CIndividualType CIndividualProcessNode::getIndividualType() { return mIndiType; } CIndividualProcessNode* CIndividualProcessNode::setIndividualType(CIndividualProcessNode::CIndividualType indiType) { mIndiType = indiType; return this; } CIndividualProcessNode* CIndividualProcessNode::setReapplyConceptLabelSet(CReapplyConceptLabelSet* reapplyConSet) { mUseReapplyConLabelSet = reapplyConSet; mReapplyConLabelSet = reapplyConSet; mPrevReapplyConLabelSet = reapplyConSet; return this; } CReapplyConceptLabelSet* CIndividualProcessNode::getReapplyConceptLabelSet(bool create) { if (create && !mReapplyConLabelSet) { mReapplyConLabelSet = CObjectParameterizingAllocator< CReapplyConceptLabelSet,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mReapplyConLabelSet->initConceptLabelSet(mPrevReapplyConLabelSet); mUseReapplyConLabelSet = mReapplyConLabelSet; } return mUseReapplyConLabelSet; } CConnectionSuccessorSet* CIndividualProcessNode::getConnectionSuccessorSet(bool create) { if (create && !mConnSuccSet) { mConnSuccSet = CObjectParameterizingAllocator< CConnectionSuccessorSet,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mConnSuccSet->initConnectionSuccessorSet(mPrevConnSuccSet); mUseConnSuccSet = mConnSuccSet; } return mUseConnSuccSet; } CReapplyRoleSuccessorHash* CIndividualProcessNode::getReapplyRoleSuccessorHash(bool create) { if (create && !mReapplyRoleSuccHash) { mReapplyRoleSuccHash = CObjectParameterizingAllocator< CReapplyRoleSuccessorHash,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mReapplyRoleSuccHash->initRoleSuccessorHash(mPrevReapplyRoleSuccHash); mUseReapplyRoleSuccHash = mReapplyRoleSuccHash; } return mUseReapplyRoleSuccHash; } CConceptPropagationBindingSetHash* CIndividualProcessNode::getConceptPropagationBindingSetHash(bool create) { if (create && !mConceptPropBindingSetHash) { mConceptPropBindingSetHash = CObjectParameterizingAllocator< CConceptPropagationBindingSetHash,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mConceptPropBindingSetHash->initConceptPropagationBindingSetHash(mPrevConceptPropBindingSetHash); mUseConceptPropBindingSetHash = mConceptPropBindingSetHash; } return mUseConceptPropBindingSetHash; } CConceptVariableBindingPathSetHash* CIndividualProcessNode::getConceptVariableBindingPathSetHash(bool create) { if (create && !mConceptVarBindPathSetHash) { mConceptVarBindPathSetHash = CObjectParameterizingAllocator< CConceptVariableBindingPathSetHash,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mConceptVarBindPathSetHash->initConceptVariableBindingPathSetHash(mPrevConceptVarBindPathSetHash); mUseConceptVarBindPathSetHash = mConceptVarBindPathSetHash; } return mUseConceptVarBindPathSetHash; } CConceptRepresentativePropagationSetHash* CIndividualProcessNode::getConceptRepresentativePropagationSetHash(bool create) { if (create && !mConceptRepPropSetHash) { mConceptRepPropSetHash = CObjectParameterizingAllocator< CConceptRepresentativePropagationSetHash,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mConceptRepPropSetHash->initConceptRepresentativePropagationSetHash(mPrevConceptRepPropSetHash); mUseConceptRepPropSetHash = mConceptRepPropSetHash; } return mUseConceptRepPropSetHash; } CRoleSuccessorLinkIterator CIndividualProcessNode::getRoleSuccessorLinkIterator(CRole* role) { if (mUseReapplyRoleSuccHash) { return mUseReapplyRoleSuccHash->getRoleSuccessorLinkIterator(role); } else { return CRoleSuccessorLinkIterator(); } } cint64 CIndividualProcessNode::getRoleSuccessorCount(CRole* role) { if (mUseReapplyRoleSuccHash) { return mUseReapplyRoleSuccHash->getRoleSuccessorCount(role); } else { return 0; } } CRoleSuccessorLinkIterator CIndividualProcessNode::getRoleSuccessorHistoryLinkIterator(CRole* role, CIndividualLinkEdge* lastLink) { if (mUseReapplyRoleSuccHash) { return mUseReapplyRoleSuccHash->getRoleSuccessorHistoryLinkIterator(role,lastLink); } else { return CRoleSuccessorLinkIterator(); } } bool CIndividualProcessNode::hasRoleSuccessorToIndividual(CRole* role, cint64 destinationIndiID, bool locateable) { if (mUseReapplyRoleSuccHash) { return mUseReapplyRoleSuccHash->hasRoleSuccessorToIndividual(role,getIndividualID(),destinationIndiID,locateable && mReapplyRoleSuccHash); } return false; } bool CIndividualProcessNode::hasRoleSuccessorToIndividual(CRole* role, CIndividualProcessNode* desIndi, bool locateable) { return hasRoleSuccessorToIndividual(role,desIndi->getIndividualID(),locateable); } CIndividualLinkEdge* CIndividualProcessNode::getRoleSuccessorToIndividualLink(CRole* role, cint64 destinationIndiID, bool locateable) { if (mUseReapplyRoleSuccHash) { return mUseReapplyRoleSuccHash->getRoleSuccessorToIndividualLink(role,getIndividualID(),destinationIndiID,locateable && mReapplyRoleSuccHash); } return false; } CIndividualLinkEdge* CIndividualProcessNode::getRoleSuccessorToIndividualLink(CRole* role, CIndividualProcessNode* desIndi, bool locateable) { return getRoleSuccessorToIndividualLink(role,desIndi->getIndividualID(),locateable); } bool CIndividualProcessNode::hasNegationDisjointToIndividual(CRole* role, cint64 destinationIndiID) { if (mUseDisjointSuccRoleHash) { return mUseDisjointSuccRoleHash->hasDisjointSuccessorRoleLink(destinationIndiID,role); } return false; } bool CIndividualProcessNode::hasNegationDisjointToIndividual(CRole* role, CIndividualProcessNode* desIndi) { return hasNegationDisjointToIndividual(role,desIndi->getIndividualID()); } bool CIndividualProcessNode::hasDisjointRoleConnections() { return mDisjointRoleConnections; } CIndividualProcessNode* CIndividualProcessNode::setDisjointRoleConnections(bool disjointRoleConnections) { mDisjointRoleConnections = disjointRoleConnections; return this; } CDisjointSuccessorRoleHash* CIndividualProcessNode::getDisjointSuccessorRoleHash(bool create) { if (create && !mDisjointSuccRoleHash) { mDisjointSuccRoleHash = CObjectParameterizingAllocator< CDisjointSuccessorRoleHash,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mDisjointSuccRoleHash->initDisjointSuccessorRoleHash(mPrevDisjointSuccRoleHash); mUseDisjointSuccRoleHash = mDisjointSuccRoleHash; } return mUseDisjointSuccRoleHash; } CIndividualProcessNode* CIndividualProcessNode::installDisjointLink(CNegationDisjointEdge* link) { if (!mDisjointSuccRoleHash) { getDisjointSuccessorRoleHash(true); } mUseDisjointSuccRoleHash->insertDisjointSuccessorRoleLink(link->getOppositeIndividualID(mIndiID),link); return this; } CIndividualProcessNode* CIndividualProcessNode::removeDisjointLinks(cint64 succIndiID) { if (mUseDisjointSuccRoleHash) { if (!mDisjointSuccRoleHash) { getDisjointSuccessorRoleHash(true); } mUseDisjointSuccRoleHash->removeDisjointSuccessorRoleLinks(succIndiID); } return this; } CDisjointSuccessorRoleIterator CIndividualProcessNode::getDisjointSuccessorRoleIterator(cint64 succIndiId) { if (mUseDisjointSuccRoleHash) { return mUseDisjointSuccRoleHash->getDisjointRoleIterator(succIndiId); } else { return CDisjointSuccessorRoleIterator(); } } CDisjointSuccessorRoleIterator CIndividualProcessNode::getDisjointSuccessorRoleIterator(CIndividualProcessNode* indiNode) { return getDisjointSuccessorRoleIterator(indiNode->getIndividualID()); } CRoleSuccessorIterator CIndividualProcessNode::getRoleIterator() { if (!mUseReapplyRoleSuccHash) { return CRoleSuccessorIterator(); } else { return mUseReapplyRoleSuccHash->getRoleIterator(); } } CSuccessorRoleHash* CIndividualProcessNode::getSuccessorRoleHash(bool create) { if (create && !mSuccRoleHash) { mSuccRoleHash = CObjectParameterizingAllocator< CSuccessorRoleHash,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mSuccRoleHash->initSuccessorRoleHash(mPrevSuccRoleHash); mUseSuccRoleHash = mSuccRoleHash; } return mUseSuccRoleHash; } CSuccessorRoleIterator CIndividualProcessNode::getSuccessorRoleIterator(CIndividualProcessNode* indiNode) { return getSuccessorRoleIterator(indiNode->getIndividualID()); } CSuccessorRoleIterator CIndividualProcessNode::getSuccessorRoleIterator(cint64 indiID) { if (!mUseSuccRoleHash) { return CSuccessorRoleIterator(); } else { return mUseSuccRoleHash->getSuccessorRoleIterator(indiID); } } bool CIndividualProcessNode::hasSuccessorIndividualNode(CIndividualProcessNode* indiNode) { return hasSuccessorIndividualNode(indiNode->getIndividualID()); } bool CIndividualProcessNode::hasSuccessorIndividualNode(cint64 indiID) { if (!mUseSuccRoleHash) { return false; } else { return mUseSuccRoleHash->hasSuccessorIndividualNode(indiID); } } CConceptProcessingQueue* CIndividualProcessNode::getConceptProcessingQueue(bool create) { if (create && !mConceptProcessingQueue) { mConceptProcessingQueue = CObjectParameterizingAllocator< CConceptProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mConceptProcessingQueue->initProcessingQueue(mPrevConceptProcessingQueue); mUseConceptProcessingQueue = mConceptProcessingQueue; } return mUseConceptProcessingQueue; } CReapplyQueue* CIndividualProcessNode::getRoleReapplyQueue(CRole* role, bool create) { CReapplyQueue* reapplyQueue = nullptr; if (create && !mReapplyRoleSuccHash) { getReapplyRoleSuccessorHash(true); } if (mUseReapplyRoleSuccHash) { reapplyQueue = mUseReapplyRoleSuccHash->getRoleReapplyQueue(role,create); } return reapplyQueue; } CReapplyQueueIterator CIndividualProcessNode::getRoleReapplyIterator(CRole* role, bool clearDynamicReapllyQueue) { if (clearDynamicReapllyQueue && !mReapplyRoleSuccHash) { getReapplyRoleSuccessorHash(true); } if (mUseReapplyRoleSuccHash) { return mUseReapplyRoleSuccHash->getRoleReapplyIterator(role,clearDynamicReapllyQueue); } else { return CReapplyQueueIterator(nullptr,nullptr); } } CCondensedReapplyQueue* CIndividualProcessNode::getConceptReapplyQueue(CConcept* concept, bool conceptNegation, bool create) { CCondensedReapplyQueue* reapplyQueue = 0; if (create && !mReapplyConLabelSet) { getReapplyConceptLabelSet(true); } if (mUseReapplyConLabelSet) { reapplyQueue = mUseReapplyConLabelSet->getConceptReapplyQueue(concept,conceptNegation,create); } return reapplyQueue; } CCondensedReapplyQueueIterator CIndividualProcessNode::getConceptReapplyIterator(CConcept* concept, bool conceptNegation, bool clearDynamicReapllyQueue) { if (clearDynamicReapllyQueue && !mReapplyConLabelSet) { getReapplyConceptLabelSet(true); } if (mUseReapplyConLabelSet) { return mUseReapplyConLabelSet->getConceptReapplyIterator(concept,conceptNegation,clearDynamicReapllyQueue); } else { return CCondensedReapplyQueueIterator(nullptr,conceptNegation); } } CDistinctHash* CIndividualProcessNode::getDistinctHash(bool create) { if (create && !mDistinctHash) { mDistinctHash = CObjectParameterizingAllocator< CDistinctHash,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mDistinctHash->initDistinctHash(mPrevDistinctHash); mUseDistinctHash = mDistinctHash; } return mUseDistinctHash; } CIndividualProcessNode* CIndividualProcessNode::addBlockedIndividualsLinker(CXLinker* linker) { if (linker) { mBlockedIndividualsLinker = linker->append(mBlockedIndividualsLinker); } return this; } CIndividualProcessNode* CIndividualProcessNode::setBlockedIndividualsLinker(CXLinker* linker) { mBlockedIndividualsLinker = linker; return this; } CXLinker* CIndividualProcessNode::getBlockedIndividualsLinker() { return mBlockedIndividualsLinker; } bool CIndividualProcessNode::hasBlockedIndividualsLinker() { return mBlockedIndividualsLinker; } CIndividualProcessNode* CIndividualProcessNode::clearBlockedIndividualsLinker() { mBlockedIndividualsLinker = nullptr; return this; } CIndividualLinkEdge* CIndividualProcessNode::getAncestorLink() { return mAncestorLink; } CIndividualProcessNode* CIndividualProcessNode::setAncestorLink(CIndividualLinkEdge* link) { mAncestorLink = link; return this; } bool CIndividualProcessNode::isIndividualAncestor(CIndividualProcessNode* individual) { if (mAncestorLink) { return mAncestorLink->isSourceIndividualID(individual); } return false; } bool CIndividualProcessNode::hasIndividualAncestor() { return mAncestorLink != nullptr; } bool CIndividualProcessNode::isBlockableIndividual() { return mIndiType == BLOCKABLEINDIVIDUALTYPE; } bool CIndividualProcessNode::isNominalIndividual() { return mIndiType == NOMINALINDIVIDUALTYPE; } CIndividual* CIndividualProcessNode::getNominalIndividual() { return mNomIndi; } CIndividualProcessNode* CIndividualProcessNode::setNominalIndividual(CIndividual* indi) { mNomIndi = indi; return this; } CIndividualLinkEdge* CIndividualProcessNode::getLastAddedRoleLink() { return mLastAddedLink; } CIndividualProcessNode* CIndividualProcessNode::installIndividualLink(CIndividualLinkEdge* link, CReapplyQueueIterator* reapplyQueueIt) { if (!mReapplyRoleSuccHash) { getReapplyRoleSuccessorHash(true); } if (!mSuccRoleHash) { getSuccessorRoleHash(true); } mUseReapplyRoleSuccHash->insertRoleSuccessorLink(link->getLinkRole(),link,reapplyQueueIt); cint64 oppIndiID = link->getOppositeIndividualID(mIndiID); mUseSuccRoleHash->insertSuccessorRoleLink(oppIndiID,link); mLastAddedLink = link; return this; } CIndividualProcessNode* CIndividualProcessNode::removeIndividualLink(CIndividualLinkEdge* link) { if (!mReapplyRoleSuccHash) { getReapplyRoleSuccessorHash(true); } mUseReapplyRoleSuccHash->removeRoleSuccessorLink(link->getLinkRole(),link); return this; } CIndividualProcessNode* CIndividualProcessNode::removeIndividualConnection(CIndividualProcessNode* indi) { if (!mSuccRoleHash) { getSuccessorRoleHash(true); } mSuccRoleHash->removeSuccessor(indi->getIndividualID()); if (mUseConnSuccSet) { if (!mConnSuccSet) { getConnectionSuccessorSet(true); } mConnSuccSet->removeConnection(indi->getIndividualID()); } return this; } CSuccessorIterator CIndividualProcessNode::getSuccessorIterator() { if (!mUseSuccRoleHash) { return CSuccessorIterator(); } return mUseSuccRoleHash->getSuccessorIterator(); } CConnectionSuccessorSetIterator CIndividualProcessNode::getConnectionSuccessorIterator() { if (mUseConnSuccSet) { return mUseConnSuccSet->getConnectionSuccessorIterator(); } else { return CConnectionSuccessorSetIterator(); } } CIndividualNodeModelData* CIndividualProcessNode::getIndividualModelData() { return indiModel; } CIndividualProcessNode* CIndividualProcessNode::setIndividualModelData(CIndividualNodeModelData* individualModel) { indiModel = individualModel; return this; } CIndividualNodeSatisfiableCacheRetrievalData* CIndividualProcessNode::getIndividualSatisfiableCacheRetrievalData(bool localCacheData) { if (localCacheData) { return mSatCacheRetData; } else { return mPrevSatCacheRetData; } } CIndividualProcessNode* CIndividualProcessNode::setIndividualSatisfiableCacheRetrievalData(CIndividualNodeSatisfiableCacheRetrievalData* satCacheRetrievalData) { mSatCacheRetData = satCacheRetrievalData; mPrevSatCacheRetData = mSatCacheRetData; return this; } CIndividualNodeBackendCacheSynchronisationData* CIndividualProcessNode::getIndividualBackendCacheSynchronisationData(bool localCacheData) { if (localCacheData) { return mBackendSyncData; } else { return mPrevBackendSyncData; } } CIndividualProcessNode* CIndividualProcessNode::setIndividualBackendCacheSynchronisationData(CIndividualNodeBackendCacheSynchronisationData* backendSyncData) { mBackendSyncData = backendSyncData; mPrevBackendSyncData = backendSyncData; return this; } CIndividualNodeSatisfiableCacheStoringData* CIndividualProcessNode::getIndividualSatisfiableCacheStoringData(bool localCacheData) { if (localCacheData) { return mSatCacheStoringData; } else { return mPrevSatCacheStoringData; } } CIndividualProcessNode* CIndividualProcessNode::setIndividualSatisfiableCacheStoringData(CIndividualNodeSatisfiableCacheStoringData* satCacheStoringData) { mSatCacheStoringData = satCacheStoringData; mPrevSatCacheStoringData = mSatCacheStoringData; return this; } CIndividualNodeUnsatisfiableCacheRetrievalData* CIndividualProcessNode::getIndividualUnsatisfiableCacheRetrievalData(bool localUnsatCacheRetData) { if (localUnsatCacheRetData) { return mIndiUnsatCacheRet; } else { return mPrevIndiUnsatCacheRet; } } CIndividualProcessNode* CIndividualProcessNode::setIndividualUnsatisfiableCacheRetrievalData(CIndividualNodeUnsatisfiableCacheRetrievalData* individualUnsatCacheRetData) { mIndiUnsatCacheRet = individualUnsatCacheRetData; mPrevIndiUnsatCacheRet = mIndiUnsatCacheRet; return this; } CSignatureBlockingIndividualNodeConceptExpansionData* CIndividualProcessNode::getSignatureBlockingIndividualNodeConceptExpansionData(bool localBlockingData) { if (localBlockingData) { return mSigBlockConExpData; } else { return mPrevSigBlockConExpData; } } CIndividualProcessNode* CIndividualProcessNode::setSignatureBlockingIndividualNodeConceptExpansionData(CSignatureBlockingIndividualNodeConceptExpansionData* individualBlockingData) { mSigBlockConExpData = individualBlockingData; mPrevSigBlockConExpData = mSigBlockConExpData; return this; } CReusingIndividualNodeConceptExpansionData* CIndividualProcessNode::getReusingIndividualNodeConceptExpansionData(bool localBlockingData) { if (localBlockingData) { return mReusingConExpData; } else { return mPrevReusingConExpData; } } CIndividualProcessNode* CIndividualProcessNode::setReusingIndividualNodeConceptExpansionData(CReusingIndividualNodeConceptExpansionData* individualBlockingData) { mReusingConExpData = individualBlockingData; mPrevReusingConExpData = mReusingConExpData; return this; } CIndividualNodeAnalizedConceptExpansionData* CIndividualProcessNode::getAnalizedConceptExpansionData(bool createOrLocalize) { if (!mSigBlockIndExplData && createOrLocalize) { mSigBlockIndExplData = CObjectAllocator::allocateAndConstruct(mMemAllocMan); mSigBlockIndExplData->initBlockingExplorationData(mPrevSigBlockIndExplData); mUseSigBlockIndExplData = mSigBlockIndExplData; } return mUseSigBlockIndExplData; } CBlockingFollowSet* CIndividualProcessNode::getBlockingFollowSet(bool createOrLocalize) { if (!mSigBlockFollowSet && createOrLocalize) { mSigBlockFollowSet = CObjectParameterizingAllocator< CBlockingFollowSet,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mSigBlockFollowSet->initBlockingFollowSet(mPrevSigBlockFollowSet); mUseSigBlockFollowSet = mSigBlockFollowSet; } return mUseSigBlockFollowSet; } bool CIndividualProcessNode::hasBlockingFollower() { if (!mUseSigBlockFollowSet) { return false; } else { return !mUseSigBlockFollowSet->empty(); } } CIndividualNodeSaturationBlockingData* CIndividualProcessNode::getIndividualSaturationBlockingData(bool localBlockData) { if (localBlockData) { return mIndiSatBlockData; } else { return mPrevIndiSatBlockData; } } CIndividualProcessNode* CIndividualProcessNode::setIndividualSaturationBlockingData(CIndividualNodeSaturationBlockingData* individualBlock) { mIndiSatBlockData = individualBlock; mPrevIndiSatBlockData = individualBlock; return this; } CIndividualNodeBlockData* CIndividualProcessNode::getIndividualBlockData(bool localBlockData) { if (localBlockData) { return mIndiBlock; } else { return mPrevIndiBlock; } } CIndividualProcessNode* CIndividualProcessNode::setIndividualBlockData(CIndividualNodeBlockData* individualBlock) { mIndiBlock = individualBlock; mPrevIndiBlock = mIndiBlock; return this; } cint64 CIndividualProcessNode::getIndividualAncestorDepth() { return indiAncDepth; } CIndividualProcessNode* CIndividualProcessNode::setIndividualAncestorDepth(cint64 depth) { indiAncDepth = depth; return this; } cint64 CIndividualProcessNode::getIndividualNominalLevel() { return mNominalLevel; } CIndividualProcessNode* CIndividualProcessNode::setIndividualNominalLevel(cint64 level) { mNominalLevel = level; return this; } cint64 CIndividualProcessNode::getIndividualNominalLevelOrAncestorDepth() { if (isNominalIndividual()) { return getIndividualNominalLevel(); } return getIndividualAncestorDepth(); } cint64 CIndividualProcessNode::getMergedIntoIndividualNodeID() { return mMergeIntoID; } bool CIndividualProcessNode::hasMergedIntoIndividualNodeID() { return mMergeIntoID != mIndiID; } CIndividualProcessNode* CIndividualProcessNode::setMergedIntoIndividualNodeID(cint64 indiNodeID) { mMergeIntoID = indiNodeID; return this; } CIndividualProcessNode* CIndividualProcessNode::addProcessingBlockedIndividualsLinker(CXLinker* linker) { if (linker) { mProcessingBlockedIndividualsLinker = linker->append(mProcessingBlockedIndividualsLinker); } return this; } CIndividualProcessNode* CIndividualProcessNode::setIndirectBlockedIndividualsLinker(CXLinker* linker) { mProcessingBlockedIndividualsLinker = linker; return this; } CXLinker* CIndividualProcessNode::getProcessingBlockedIndividualsLinker() { return mProcessingBlockedIndividualsLinker; } CReapplyConceptDescriptor* CIndividualProcessNode::getSatisfiableCachedAbsorbedDisjunctionsLinker() { return mSatCachedAbsorbedDisjunctionsReapplyConDes; } CIndividualProcessNode* CIndividualProcessNode::clearSatisfiableCachedAbsorbedDisjunctionsLinker() { mSatCachedAbsorbedDisjunctionsReapplyConDes = nullptr; return this; } CIndividualProcessNode* CIndividualProcessNode::addSatisfiableCachedAbsorbedDisjunctionsLinker(CReapplyConceptDescriptor* disjunctionReapplyConDes) { if (!mSatCachedAbsorbedDisjunctionsReapplyConDes) { mSatCachedAbsorbedDisjunctionsReapplyConDes = disjunctionReapplyConDes; } else { disjunctionReapplyConDes->setNext(mSatCachedAbsorbedDisjunctionsReapplyConDes); mSatCachedAbsorbedDisjunctionsReapplyConDes = disjunctionReapplyConDes; } return this; } CIndividualProcessNode* CIndividualProcessNode::clearSatisfiableCachedAbsorbedGeneratingLinker() { mSatCachedAbsorbedSuccessorReapplyConDes = nullptr; return this; } CReapplyConceptDescriptor* CIndividualProcessNode::getSatisfiableCachedAbsorbedGeneratingLinker() { return mSatCachedAbsorbedSuccessorReapplyConDes; } CIndividualProcessNode* CIndividualProcessNode::addSatisfiableCachedAbsorbedGeneratingLinker(CReapplyConceptDescriptor* successorGeneratingReapplyConDes) { if (!mSatCachedAbsorbedSuccessorReapplyConDes) { mSatCachedAbsorbedSuccessorReapplyConDes = successorGeneratingReapplyConDes; } else { successorGeneratingReapplyConDes->setNext(mSatCachedAbsorbedSuccessorReapplyConDes); mSatCachedAbsorbedSuccessorReapplyConDes = successorGeneratingReapplyConDes; } return this; } cint64 CIndividualProcessNode::getProcessingRestrictionFlags() { return mProcessingRestrictionFlags; } bool CIndividualProcessNode::addProcessingRestrictionFlags(cint64 flags) { cint64 flagsBackup = mProcessingRestrictionFlags; mProcessingRestrictionFlags |= flags; return mProcessingRestrictionFlags != flagsBackup; } bool CIndividualProcessNode::clearProcessingRestrictionFlags(cint64 flags) { cint64 flagsBackup = mProcessingRestrictionFlags; mProcessingRestrictionFlags &= ~flags; return mProcessingRestrictionFlags != flagsBackup; } bool CIndividualProcessNode::hasProcessingRestrictionFlags(cint64 testFlags) { return (mProcessingRestrictionFlags & testFlags) == testFlags; } bool CIndividualProcessNode::hasPartialProcessingRestrictionFlags(cint64 testFlags) { return (mProcessingRestrictionFlags & testFlags) != 0; } CConceptDescriptor* CIndividualProcessNode::getIndividualInitializationConcept() { return mInitConceptDescriptor; } CIndividualProcessNode* CIndividualProcessNode::setIndividualInitializationConcept(CConceptDescriptor* initConDes) { mInitConceptDescriptor = initConDes; return this; } bool CIndividualProcessNode::hasBlockingRetestProcessingRestrictionFlags() { return hasPartialProcessingRestrictionFlags(PRFBLOCKINGRETESTDUEANCESTORMODIFIED | PRFBLOCKINGRETESTDUEDIRECTMODIFIED | PRFBLOCKINGRETESTDUEBLOCKERMODIFIED | PRFBLOCKINGRETESTDUEINDIRECTBLOCKERLOSS | PRFBLOCKINGRETESTDUEPROCESSINGCOMPLETED); } bool CIndividualProcessNode::clearBlockingRetestProcessingRestrictionFlags() { return clearProcessingRestrictionFlags(PRFBLOCKINGRETESTDUEANCESTORMODIFIED | PRFBLOCKINGRETESTDUEDIRECTMODIFIED | PRFBLOCKINGRETESTDUEBLOCKERMODIFIED | PRFBLOCKINGRETESTDUEINDIRECTBLOCKERLOSS | PRFBLOCKINGRETESTDUEPROCESSINGCOMPLETED); } bool CIndividualProcessNode::hasBlockedProcessingRestrictionFlags() { return hasPartialProcessingRestrictionFlags(PRFDIRECTBLOCKED | PRFINDIRECTBLOCKED | PRFPROCESSINGBLOCKED); } bool CIndividualProcessNode::hasDirectBlockedProcessingRestrictionFlags() { return hasPartialProcessingRestrictionFlags(PRFDIRECTBLOCKED); } bool CIndividualProcessNode::hasProcessingBlockedProcessingRestrictionFlags() { return hasPartialProcessingRestrictionFlags(PRFPROCESSINGBLOCKED); } bool CIndividualProcessNode::hasPurgedBlockedProcessingRestrictionFlags() { return hasPartialProcessingRestrictionFlags(PRFPURGEDBLOCKED); } bool CIndividualProcessNode::hasIndirectBlockedProcessingRestrictionFlags() { return hasPartialProcessingRestrictionFlags(PRFINDIRECTBLOCKED); } bool CIndividualProcessNode::clearBlockedProcessingRestrictionFlags() { return clearProcessingRestrictionFlags(PRFDIRECTBLOCKED | PRFINDIRECTBLOCKED | PRFPROCESSINGBLOCKED); } CIndividualProcessNode* CIndividualProcessNode::setLastConceptCountCachedBlockingCandidate(cint64 conCount) { mLastConceptCountCachedBlockerCandidate = conCount; return this; } cint64 CIndividualProcessNode::getLastConceptCountCachedBlockingCandidate() { return mLastConceptCountCachedBlockerCandidate; } cint64 CIndividualProcessNode::getLastConceptCountSearchBlockingCandidate() { return mLastConceptCountSearchBlockerCandidate; } CIndividualProcessNode* CIndividualProcessNode::setLastConceptCountSearchBlockingCandidate(cint64 conCount) { mLastConceptCountSearchBlockerCandidate = conCount; return this; } cint64 CIndividualProcessNode::getBlockingCachingSavedCandidateCount() { return mBlockingCachingSavedCandidateCount; } CIndividualProcessNode* CIndividualProcessNode::setBlockingCachingSavedCandidateCount(cint64 conCount) { mBlockingCachingSavedCandidateCount = conCount; return this; } CIndividualProcessNode* CIndividualProcessNode::incBlockingCachingSavedCandidateCount(cint64 incCount) { mBlockingCachingSavedCandidateCount += incCount; return this; } cint64 CIndividualProcessNode::getLastSearchBlockerCandidateCount() { return mLastSearchBlockerCandidateCount; } CIndividualProcessNode* CIndividualProcessNode::setLastSearchBlockerCandidateCount(cint64 canCount) { mLastSearchBlockerCandidateCount = canCount; return this; } cint64 CIndividualProcessNode::getLastSearchBlockerCandidateSignature() { return mLastSearchBlockerCandidateSignature; } CIndividualProcessNode* CIndividualProcessNode::setLastSearchBlockerCandidateSignature(cint64 canCount) { mLastSearchBlockerCandidateSignature = canCount; return this; } bool CIndividualProcessNode::isInvalidSignatureBlocking() { return mInvalidSignatureBlocking; } CIndividualProcessNode* CIndividualProcessNode::setInvalidSignatureBlocking(bool invalid) { mInvalidSignatureBlocking = invalid; return this; } CIndividualProcessNode* CIndividualProcessNode::addSuccessorIndividualNodeBackwardDependencyLinker(CXLinker* linker) { if (linker) { mSuccessorIndiNodeBackwardDependencyLinker = linker->append(mSuccessorIndiNodeBackwardDependencyLinker); } return this; } CIndividualProcessNode* CIndividualProcessNode::setSuccessorIndividualNodeBackwardDependencyLinker(CXLinker* linker) { mSuccessorIndiNodeBackwardDependencyLinker = linker; return this; } CXLinker* CIndividualProcessNode::getSuccessorIndividualNodeBackwardDependencyLinker() { return mSuccessorIndiNodeBackwardDependencyLinker; } bool CIndividualProcessNode::hasSuccessorIndividualNodeBackwardDependencyLinker() { return mSuccessorIndiNodeBackwardDependencyLinker; } CIndividualProcessNode* CIndividualProcessNode::clearSuccessorIndividualNodeBackwardDependencyLinker() { mSuccessorIndiNodeBackwardDependencyLinker = nullptr; return this; } bool CIndividualProcessNode::hasBackwardDependencyToAncestorIndividualNode() { return mBackwardDependencyToAncestorIndividualNode; } CIndividualProcessNode* CIndividualProcessNode::setBackwardDependencyToAncestorIndividualNode(bool backwardDependency) { mBackwardDependencyToAncestorIndividualNode = backwardDependency; return this; } CRoleBackwardPropagationHash* CIndividualProcessNode::getRoleBackwardPropagationHash(bool create) { if (create && !mRoleBackPropHash) { mRoleBackPropHash = CObjectParameterizingAllocator< CRoleBackwardPropagationHash,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); } return mRoleBackPropHash; } CIndividualProcessNodeLinker* CIndividualProcessNode::getIndividualProcessNodeLinker() { return mIndiProcessLinker; } CIndividualProcessNode* CIndividualProcessNode::setIndividualProcessNodeLinker(CIndividualProcessNodeLinker* processNodeLinker) { mIndiProcessLinker = processNodeLinker; return this; } CConceptProcessLinker* CIndividualProcessNode::getConceptProcessLinker() { return mConceptProcessLinker; } CConceptProcessLinker* CIndividualProcessNode::takeConceptProcessLinker() { CConceptProcessLinker* conProcLinker = mConceptProcessLinker; if (mConceptProcessLinker) { mConceptProcessLinker = mConceptProcessLinker->getNext(); } return conProcLinker; } CIndividualProcessNode* CIndividualProcessNode::setConceptProcessLinker(CConceptProcessLinker* conProcessLinker) { mConceptProcessLinker = conProcessLinker; return this; } CIndividualProcessNode* CIndividualProcessNode::addConceptProcessLinker(CConceptProcessLinker* conProcessLinker) { mConceptProcessLinker = conProcessLinker->append(mConceptProcessLinker); return this; } CIndividualProcessNode* CIndividualProcessNode::clearConceptProcessLinker() { mConceptProcessLinker = nullptr; return this; } bool CIndividualProcessNode::getRequiredBackwardPropagation() { return mRequiredBackProp; } CIndividualProcessNode* CIndividualProcessNode::setRequiredBackwardPropagation(bool requiredBackProp) { mRequiredBackProp = requiredBackProp; return this; } bool CIndividualProcessNode::hasSubstituteIndividualNode() { return mSubstituteIndiNode != nullptr; } CIndividualProcessNode* CIndividualProcessNode::getSubstituteIndividualNode() { return mSubstituteIndiNode; } CIndividualProcessNode* CIndividualProcessNode::setSubstituteIndividualNode(CIndividualProcessNode* indiNode) { mSubstituteIndiNode = indiNode; return this; } bool CIndividualProcessNode::isProcessingQueued() { return mProcessingQueued; } bool CIndividualProcessNode::isExtendedQueueProcessing() { return mExtendedQueueProcessing; } bool CIndividualProcessNode::isImmediatelyProcessingQueued() { return mImmediatelyProcessingQueued; } bool CIndividualProcessNode::isDeterministicExpandingProcessingQueued() { return mDetExpProcessingQueued; } bool CIndividualProcessNode::isRegularDepthProcessingQueued() { return mDepthProcessingQueued; } bool CIndividualProcessNode::isBlockedReactivationProcessingQueued() { return mBlockedReactProcessingQueued; } CIndividualProcessNode* CIndividualProcessNode::setProcessingQueued(bool processingQueued) { mProcessingQueued = processingQueued; return this; } CIndividualProcessNode* CIndividualProcessNode::setExtendedQueueProcessing(bool extendedQueueProcessing) { mExtendedQueueProcessing = extendedQueueProcessing; return this; } CIndividualProcessNode* CIndividualProcessNode::setImmediatelyProcessingQueued(bool immProQue) { mImmediatelyProcessingQueued = immProQue; return this; } CIndividualProcessNode* CIndividualProcessNode::setDeterministicExpandingProcessingQueued(bool immProQue) { mDetExpProcessingQueued = immProQue; return this; } CIndividualProcessNode* CIndividualProcessNode::setRegularDepthProcessingQueued(bool depthPro) { mDepthProcessingQueued = depthPro; return this; } CIndividualProcessNode* CIndividualProcessNode::setBlockedReactivationProcessingQueued(bool depthPro) { mBlockedReactProcessingQueued = depthPro; return this; } CIndividualProcessNode* CIndividualProcessNode::setBackendSynchronRetestProcessingQueued(bool backendSyncRetest) { mBackendSynchronRetestProcessingQueued = backendSyncRetest; return this; } bool CIndividualProcessNode::isBackendSynchronRetestProcessingQueued() { return mBackendSynchronRetestProcessingQueued; } CIndividualProcessNode* CIndividualProcessNode::setIncrementalCompatibilityCheckingQueued(bool incCompChecking) { mIncrementalCompatibilityCheckingQueued = incCompChecking; return this; } bool CIndividualProcessNode::isIncrementalCompatibilityCheckingQueued() { return mIncrementalCompatibilityCheckingQueued; } CIndividualProcessNode* CIndividualProcessNode::setIncrementalExpansionQueued(bool incExpQueued) { mIncrementalExpansionQueued = incExpQueued; return this; } bool CIndividualProcessNode::isIncrementalExpansionQueued() { return mIncrementalExpansionQueued; } CIndividualProcessNode* CIndividualProcessNode::clearProcessingQueued() { mBlockedReactProcessingQueued = false; mProcessingQueued = false; mImmediatelyProcessingQueued = false; mDetExpProcessingQueued = false; mDepthProcessingQueued = false; mDelayedNominalProcessingQueued = false; mBackendSynchronRetestProcessingQueued = false; mIncrementalCompatibilityCheckingQueued = false; mIncrementalExpansionQueued = false; return this; } bool CIndividualProcessNode::isDelayedNominalProcessingQueued() { return mDelayedNominalProcessingQueued; } bool CIndividualProcessNode::hasNominalProcessingDelayingChecked() { return mNominalProcessingDelayingChecked; } CIndividualProcessNode* CIndividualProcessNode::setDelayedNominalProcessingQueued(bool delayedProcessingQueued) { mDelayedNominalProcessingQueued = delayedProcessingQueued; return this; } CIndividualProcessNode* CIndividualProcessNode::setNominalProcessingDelayingChecked(bool nominalProcessingDelayingChecked) { mNominalProcessingDelayingChecked = nominalProcessingDelayingChecked; return this; } CIndividualProcessNode* CIndividualProcessNode::setAssertionInitialisationSignatureValue(cint64 sigValue) { mAssertionInitialisationSignatureValue = sigValue; return this; } cint64 CIndividualProcessNode::getAssertionInitialisationSignatureValue() { return mAssertionInitialisationSignatureValue; } CIndividualProcessNode* CIndividualProcessNode::setLastProcessingPriority(const CIndividualProcessNodePriority& priority) { mLastProcessingPriority = priority; return this; } CIndividualProcessNode* CIndividualProcessNode::resetLastProcessingPriority() { mLastProcessingPriority.setPriorityToNull(); return this; } CIndividualProcessNodePriority CIndividualProcessNode::getLastProcessingPriority() { return mLastProcessingPriority; } bool CIndividualProcessNode::isCachingLossNodeReactivationInstalled() { return mCachingLossNodeReactivationInstalled; } CIndividualProcessNode* CIndividualProcessNode::setCachingLossNodeReactivationInstalled(bool reactivationInstalled) { mCachingLossNodeReactivationInstalled = reactivationInstalled; return this; } CNominalCachingLossReactivationData* CIndividualProcessNode::getNominalCachingLossReactivationData(bool create) { CNominalCachingLossReactivationData* nominalNodeReactData = nullptr; if (!mLocReactivationData && create) { CNominalCachingLossReactivationData* nominalNodeReactData = CObjectParameterizingAllocator< CNominalCachingLossReactivationData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); nominalNodeReactData->initNominalCachingLossReactivationData(getIndividualID(),mUseReactivationData); mLocReactivationData = nominalNodeReactData; mUseReactivationData = nominalNodeReactData; } return mUseReactivationData; } CSuccessorConnectedNominalSet* CIndividualProcessNode::getSuccessorNominalConnectionSet(bool create) { CSuccessorConnectedNominalSet* nomConnSet = nullptr; if (!mLocNominalConnectionSet && create) { CSuccessorConnectedNominalSet* nomConnSet = CObjectParameterizingAllocator< CSuccessorConnectedNominalSet,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); nomConnSet->initSuccessorConnectedNominalSet(mUseNominalConnectionSet); mLocNominalConnectionSet = nomConnSet; mUseNominalConnectionSet = nomConnSet; } return mUseNominalConnectionSet; } bool CIndividualProcessNode::hasSuccessorConnectionToNominal(cint64 nominalID) { CSuccessorConnectedNominalSet* nomConnSet = getSuccessorNominalConnectionSet(false); if (nomConnSet) { return nomConnSet->hasSuccessorConnectedNominal(nominalID); } return false; } bool CIndividualProcessNode::addSuccessorConnectionToNominal(cint64 nominalID) { CSuccessorConnectedNominalSet* nomConnSet = getSuccessorNominalConnectionSet(true); if (nomConnSet) { return nomConnSet->addSuccessorConnectedNominal(nominalID); } return false; } CDatatypesValueSpaceData* CIndividualProcessNode::getDatatypesValueSpaceData(bool create) { CDatatypesValueSpaceData* valueSpaceData = nullptr; if (!mLocDatatypesValueSpaceData && create) { CDatatypesValueSpaceData* valueSpaceData = CObjectParameterizingAllocator< CDatatypesValueSpaceData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); valueSpaceData->initDatatypesValueSpaceData(mUseDatatypesValueSpaceData); mLocDatatypesValueSpaceData = valueSpaceData; mUseDatatypesValueSpaceData = valueSpaceData; } return mUseDatatypesValueSpaceData; } CIndividualNodeIncrementalExpansionData* CIndividualProcessNode::getIncrementalExpansionData(bool create) { CIndividualNodeIncrementalExpansionData* incExpData = nullptr; if (!mLocIncExpData && create) { CIndividualNodeIncrementalExpansionData* incExpData = CObjectParameterizingAllocator< CIndividualNodeIncrementalExpansionData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); incExpData->initIncrementalExpansionData(mUseIncExpData); mLocIncExpData = incExpData; mUseIncExpData = incExpData; } return mUseIncExpData; } CIndividualMergingHash* CIndividualProcessNode::getIndividualMergingHash(bool create) { CIndividualMergingHash* indiMergHash = nullptr; if (!mLocIndividualMergingHash && create) { CIndividualMergingHash* indiMergHash = CObjectParameterizingAllocator< CIndividualMergingHash,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); indiMergHash->initIndividualMergingHash(mUseIndividualMergingHash); mLocIndividualMergingHash = indiMergHash; mUseIndividualMergingHash = indiMergHash; } return mUseIndividualMergingHash; } CIndividualProcessNode* CIndividualProcessNode::getLastMergedIntoIndividualNode() { return mLastMergedIntoIndividualNode; } CIndividualProcessNode* CIndividualProcessNode::setLastMergedIntoIndividualNode(CIndividualProcessNode* indiNode) { mLastMergedIntoIndividualNode = indiNode; return this; } CDependencyTrackPoint* CIndividualProcessNode::getMergedDependencyTrackPoint() { return mMergedDepTrackPoint; } CIndividualProcessNode* CIndividualProcessNode::setMergedDependencyTrackPoint(CDependencyTrackPoint* depTrackPoint) { mMergedDepTrackPoint = depTrackPoint; return this; } CIndividualProcessNode* CIndividualProcessNode::setBlockerIndividualNode(CIndividualProcessNode* indiNode) { mBlockerIndiNode = indiNode; return this; } CIndividualProcessNode* CIndividualProcessNode::getBlockerIndividualNode() { return mBlockerIndiNode; } CIndividualProcessNode* CIndividualProcessNode::setFollowingIndividualNode(CIndividualProcessNode* indiNode) { mFollowingIndiNode = indiNode; return this; } CIndividualProcessNode* CIndividualProcessNode::getFollowingIndividualNode() { return mFollowingIndiNode; } CIndividualProcessNode* CIndividualProcessNode::setIncrementalExpansionID(cint64 incExpID) { mIncExpID = incExpID; return this; } cint64 CIndividualProcessNode::getIncrementalExpansionID() { return mIncExpID; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorALLConceptExtensionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorALLConceptExtensio0000644000175000017500000000761612520551156032347 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORALLCONCEPTEXTENSIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORALLCONCEPTEXTENSIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CSaturationSuccessorConceptExtensionMap.h" #include "CConceptSaturationDescriptor.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSaturationSuccessorALLConceptExtensionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationSuccessorALLConceptExtensionData : public CLinkerBase { // public methods public: //! Constructor CSaturationSuccessorALLConceptExtensionData(CProcessContext* processContext); CSaturationSuccessorALLConceptExtensionData* initSuccessorConceptExtensionData(CRole* role, CIndividualSaturationProcessNode* indiProcSatNode); bool isExtensionProcessingQueued(); CSaturationSuccessorALLConceptExtensionData* setExtensionProcessingQueued(bool queued); CSaturationSuccessorConceptExtensionMap* getSuccessorConceptExtensionMap(); bool addExtensionConcept(CConcept* concept, bool negation); CRole* getRole(); CIndividualSaturationProcessNode* getIndividualNode(); CIndividualSaturationProcessNode* getLastResolvedIndividualNode(); CSaturationSuccessorALLConceptExtensionData* setLastResolvedIndividualNode(CIndividualSaturationProcessNode* indiNode); cint64 getRequiredSuccessorCardinality(); CSaturationSuccessorALLConceptExtensionData* setRequiredSuccessorCardinality(cint64 succCard); cint64 getLastConnectedSuccessorCardinality(); CSaturationSuccessorALLConceptExtensionData* setLastConnectedSuccessorCardinality(cint64 succCard); bool addRequiredSuccessorCardinality(cint64 succCard); bool hasSuccessorCardinalityUpdatedFlag(); bool hasConceptsUpdatedFlag(); CSaturationSuccessorALLConceptExtensionData* clearUpdatedFlags(); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CRole* mRole; bool mConceptsUpdatedFlag; bool mSuccessorCardinalityUpdatedFlag; cint64 mRequiredSuccCount; cint64 mLastConnectedSuccCount; CIndividualSaturationProcessNode* mIndiProcSatNode; CIndividualSaturationProcessNode* mLastResolvedIndiProcSatNode; CConceptSaturationDescriptor* mLastExaminedConDes; CSaturationSuccessorConceptExtensionMap mConceptExtensionMap; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORALLCONCEPTEXTENSIONDATA_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathMapData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathMapD0000644000175000017500000000644112520551146032252 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHMAPDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHMAPDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CVariableBindingPath.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathMapData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathMapData { // public methods public: //! Constructor CRepresentativeVariableBindingPathMapData(CVariableBindingPath* varBindPath = nullptr, CRepresentativeVariableBindingPathSetData* resRevRepVarBindPath = nullptr); CRepresentativeVariableBindingPathMapData(CVariableBindingPath* varBindPath, CVariableBindingPath* resolveVarBindPath, CRepresentativeVariableBindingPathSetData* resRevRepVarBindPath); CVariableBindingPath* getVariableBindingPath() const; bool hasVariableBindingPath() const; CRepresentativeVariableBindingPathMapData* setVariableBindingPath(CVariableBindingPath* varBindPath); CVariableBindingPath* getResolveVariableBindingPath() const; bool hasResolveVariableBindingPath() const; CRepresentativeVariableBindingPathMapData* setResolveVariableBindingPath(CVariableBindingPath* varBindPath); CRepresentativeVariableBindingPathSetData* getResolveRepresentativeVariableBindingPathSetData() const; bool hasResolveRepresentativeVariableBindingPathSetData() const; CRepresentativeVariableBindingPathMapData* setResolveRepresentativeVariableBindingPathSetData(CRepresentativeVariableBindingPathSetData* resRevRepVarBindPath); cint64 getResolveRepresentativeVariableBindingPathSetDataID() const; // protected methods protected: // protected variables protected: CVariableBindingPath* mVarBindPath; CVariableBindingPath* mResolveVarBindPath; CRepresentativeVariableBindingPathSetData* mResolveRepVarBindPathSetData; cint64 mResolveRepvarBindPathSetDataID; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHMAPDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptProcessLinker.h0000644000175000017500000000471412520551100027246 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSLINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSLINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "CConceptProcessPriority.h" #include "CProcessingRestrictionSpecification.h" // Other includes #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CConceptProcessLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptProcessLinker : public CLinkerBase { // public methods public: //! Constructor CConceptProcessLinker(); CConceptProcessLinker* initConceptProcessLinker(CConceptDescriptor *conceptDescriptor, CProcessingRestrictionSpecification* processingRestriction); CConceptDescriptor* getConceptDescriptor(); CProcessingRestrictionSpecification* getProcessingRestriction(); // protected methods protected: // protected variables protected: CProcessingRestrictionSpecification* mProcRest; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypesValueSpaceData.h0000644000175000017500000001723112520551116027655 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESVALUESPACEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESVALUESPACEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeRealValueSpaceData.h" #include "CDatatypeUnknownValueSpaceData.h" #include "CDatatypeStringValueSpaceData.h" #include "CDatatypeBooleanValueSpaceData.h" #include "CDatatypeDoubleValueSpaceData.h" #include "CDatatypeFloatValueSpaceData.h" #include "CDatatypeIRIValueSpaceData.h" #include "CDatatypeBinaryHexDataValueSpaceData.h" #include "CDatatypeBinaryBase64DataValueSpaceData.h" #include "CDatatypeDateTimeValueSpaceData.h" #include "CDatatypeXMLValueSpaceData.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceType.h" #include "Reasoner/Ontology/CDatatypeValueSpaceUnknownType.h" #include "Reasoner/Ontology/CDatatypeValueSpaceStringType.h" #include "Reasoner/Ontology/CDatatypeValueSpaceBooleanType.h" #include "Reasoner/Ontology/CDatatypeValueSpaceDoubleType.h" #include "Reasoner/Ontology/CDatatypeValueSpaceFloatType.h" #include "Reasoner/Ontology/CDatatypeValueSpaceIRIType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypesValueSpaceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypesValueSpaceData { // public methods public: //! Constructor CDatatypesValueSpaceData(CProcessContext* processContext); CDatatypesValueSpaceData* initDatatypesValueSpaceData(CDatatypesValueSpaceData* data = nullptr); CDatatypeValueSpaceData* getValueSpace(CDatatypeValueSpaceType* valueSpaceType, bool createOrLocalize = true); CDatatypeRealValueSpaceData* getRealValueSpace(CDatatypeValueSpaceRealType* valueSpaceType, bool createOrLocalize = true); CDatatypeUnknownValueSpaceData* getUnknownValueSpace(CDatatypeValueSpaceUnknownType* valueSpaceType, bool createOrLocalize = true); CDatatypeStringValueSpaceData* getStringValueSpace(CDatatypeValueSpaceStringType* valueSpaceType, bool createOrLocalize = true); CDatatypeBooleanValueSpaceData* getBooleanValueSpace(CDatatypeValueSpaceBooleanType* valueSpaceType, bool createOrLocalize = true); CDatatypeDoubleValueSpaceData* getDoubleValueSpace(CDatatypeValueSpaceDoubleType* valueSpaceType, bool createOrLocalize = true); CDatatypeFloatValueSpaceData* getFloatValueSpace(CDatatypeValueSpaceFloatType* valueSpaceType, bool createOrLocalize = true); CDatatypeIRIValueSpaceData* getIRIValueSpace(CDatatypeValueSpaceIRIType* valueSpaceType, bool createOrLocalize = true); CDatatypeBinaryBase64DataValueSpaceData* getBinaryBase64DataValueSpace(CDatatypeValueSpaceBinaryBase64DataType* valueSpaceType, bool createOrLocalize = true); CDatatypeBinaryHexDataValueSpaceData* getBinaryHexDataValueSpace(CDatatypeValueSpaceBinaryHexDataType* valueSpaceType, bool createOrLocalize = true); CDatatypeXMLValueSpaceData* getXMLValueSpace(CDatatypeValueSpaceXMLType* valueSpaceType, bool createOrLocalize = true); CDatatypeDateTimeValueSpaceData* getDateTimeValueSpace(CDatatypeValueSpaceDateTimeType* valueSpaceType, bool createOrLocalize = true); bool isValueSpaceTriggeringQueued(); CDatatypesValueSpaceData* setValueSpaceTriggeringQueued(bool queued); bool isValueSpaceTriggeringRequired(); CDatatypesValueSpaceData* setValueSpaceTriggeringRequired(bool required); bool isValueSpaceCountingRequired(); CDatatypesValueSpaceData* setValueSpaceCountingRequired(bool required); bool isValueSpaceClashCheckingRequired(); CDatatypesValueSpaceData* setValueSpaceClashCheckingRequired(bool required); bool isValueSpaceSatisfiabilityCheckingQueued(); CDatatypesValueSpaceData* setValueSpaceSatisfiabilityCheckingQueued(bool queued); bool isValueSpaceSatisfiabilityCheckingRequired(); CDatatypesValueSpaceData* setValueSpaceSatisfiabilityCheckingRequired(bool required); CDatatypeValueSpaceType* getLastTriggeredValueSpaceType(); CDatatypesValueSpaceData* setLastTriggeredValueSpaceType(CDatatypeValueSpaceType* valueSpaceType); CDatatypesValueSpaceData* setValueSapceModified(CDatatypeValueSpaceData* valueSpace); cint64 getLastTriggeringDisjointCount(); CDatatypesValueSpaceData* setLastTriggeringDisjointCount(cint64 disjointCount); CDatatypeValueSpaceValuesCounter* getValuesCounter(); bool isValueSpaceCounted(); CDatatypesValueSpaceData* setValueSpaceCounted(bool counted); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; cint64 mLastTriggeringDisjointCount; bool mValueSpaceTriggeringQueued; bool mValueSpaceTriggeringRequired; CDatatypeValueSpaceType* mLastTriggeredValueSpaceType; bool mValueSpaceCounted; bool mValueSpaceCountingRequired; CDatatypeValueSpaceValuesCounter mValuesCounter; bool mValueSpaceSatisfiabilityCheckingRequired; bool mValueSpaceSatisfiabilityCheckingQueued; bool mValueSpaceClashCheckingRequired; CDatatypeRealValueSpaceData* mUseRealValueSpace; CDatatypeRealValueSpaceData* mLocRealValueSpace; CDatatypeUnknownValueSpaceData* mUseUnknownValueSpace; CDatatypeUnknownValueSpaceData* mLocUnknownValueSpace; CDatatypeStringValueSpaceData* mUseStringValueSpace; CDatatypeStringValueSpaceData* mLocStringValueSpace; CDatatypeBooleanValueSpaceData* mUseBooleanValueSpace; CDatatypeBooleanValueSpaceData* mLocBooleanValueSpace; CDatatypeDoubleValueSpaceData* mUseDoubleValueSpace; CDatatypeDoubleValueSpaceData* mLocDoubleValueSpace; CDatatypeFloatValueSpaceData* mUseFloatValueSpace; CDatatypeFloatValueSpaceData* mLocFloatValueSpace; CDatatypeIRIValueSpaceData* mUseIRIValueSpace; CDatatypeIRIValueSpaceData* mLocIRIValueSpace; CDatatypeBinaryBase64DataValueSpaceData* mUseBinaryBase64DataValueSpace; CDatatypeBinaryBase64DataValueSpaceData* mLocBinaryBase64DataValueSpace; CDatatypeBinaryHexDataValueSpaceData* mUseBinaryHexDataValueSpace; CDatatypeBinaryHexDataValueSpaceData* mLocBinaryHexDataValueSpace; CDatatypeXMLValueSpaceData* mUseXMLValueSpace; CDatatypeXMLValueSpaceData* mLocXMLValueSpace; CDatatypeDateTimeValueSpaceData* mUseDateTimeValueSpace; CDatatypeDateTimeValueSpaceData* mLocDateTimeValueSpace; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESVALUESPACEDATA_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateIterator.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateIterat0000644000175000017500000000514512520551074032247 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODECANDIDATEITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODECANDIDATEITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CBlockingIndividualNodeCandidateIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBlockingIndividualNodeCandidateIterator { // public methods public: //! Constructor CBlockingIndividualNodeCandidateIterator(CPROCESSMAP* candidateSet, cint64 candidateIndividualID); bool hasNext(); bool hasIndividualCandidates(); bool hasIndividualCandidate(cint64 indiID); bool hasIndividualCandidate(CIndividualProcessNode* indi); cint64 next(bool moveNext = true); CIndividualProcessNode* nextIndividualCandidate(bool moveNext = true); bool removeLastIndividualCandidate(); // protected methods protected: // protected variables protected: CPROCESSMAP* mCandidateMap; CPROCESSMAP::iterator mItBegin; CPROCESSMAP::iterator mItEnd; CPROCESSMAP::iterator mItLast; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODECANDIDATEITERATOR_H ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCacheStoringData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCac0000644000175000017500000001106212520551124032233 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeSatisfiableExpandingCacheStoringData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeSatisfiableExpandingCacheStoringData::CIndividualNodeSatisfiableExpandingCacheStoringData() { } CIndividualNodeSatisfiableExpandingCacheStoringData::~CIndividualNodeSatisfiableExpandingCacheStoringData() { } CIndividualNodeSatisfiableExpandingCacheStoringData* CIndividualNodeSatisfiableExpandingCacheStoringData::initSatisfiableExpandingCacheRetrievalData(CIndividualNodeSatisfiableExpandingCacheStoringData* prevData) { if (prevData) { mNodeSuccBranched = prevData->mNodeSuccBranched; mPrevCached = prevData->mPrevCached; mCachingError = prevData->mCachingError; mLastCachedSignature = prevData->mLastCachedSignature; mMinNodeBranchingTag = prevData->mMinNodeBranchingTag; mLastCachedConDes = prevData->mLastCachedConDes; mPrevSatCached = prevData->mPrevSatCached; } else { mNodeSuccBranched = false; mPrevCached = false; mCachingError = false; mPrevSatCached = false; mLastCachedSignature = 0; mMinNodeBranchingTag = -1; mLastCachedConDes = nullptr; } return this; } bool CIndividualNodeSatisfiableExpandingCacheStoringData::hasIndividualNodeOrSuccessorBranchedConcept() { return mNodeSuccBranched; } CIndividualNodeSatisfiableExpandingCacheStoringData* CIndividualNodeSatisfiableExpandingCacheStoringData::setIndividualNodeOrSuccessorBranchedConcept(bool branched) { mNodeSuccBranched = branched; return this; } bool CIndividualNodeSatisfiableExpandingCacheStoringData::hasPreviousCached() { return mPrevCached; } CIndividualNodeSatisfiableExpandingCacheStoringData* CIndividualNodeSatisfiableExpandingCacheStoringData::setPreviousCached(bool cached) { mPrevCached = cached; return this; } cint64 CIndividualNodeSatisfiableExpandingCacheStoringData::getLastCachedSignature() { return mLastCachedSignature; } CIndividualNodeSatisfiableExpandingCacheStoringData* CIndividualNodeSatisfiableExpandingCacheStoringData::setLastCachedSignature(cint64 signature) { mLastCachedSignature = signature; return this; } CConceptDescriptor* CIndividualNodeSatisfiableExpandingCacheStoringData::getLastCachedConceptDescriptor() { return mLastCachedConDes; } CIndividualNodeSatisfiableExpandingCacheStoringData* CIndividualNodeSatisfiableExpandingCacheStoringData::setLastCachedConceptDescriptor(CConceptDescriptor* conDes) { mLastCachedConDes = conDes; return this; } cint64 CIndividualNodeSatisfiableExpandingCacheStoringData::getMinimalIndividualNodeBranchingTag() { return mMinNodeBranchingTag; } CIndividualNodeSatisfiableExpandingCacheStoringData* CIndividualNodeSatisfiableExpandingCacheStoringData::setMinimalIndividualNodeBranchingTag(cint64 branchingTag) { mMinNodeBranchingTag = branchingTag; return this; } bool CIndividualNodeSatisfiableExpandingCacheStoringData::hasCachingError() { return mCachingError; } CIndividualNodeSatisfiableExpandingCacheStoringData* CIndividualNodeSatisfiableExpandingCacheStoringData::setCachingError(bool error) { mCachingError = error; return this; } bool CIndividualNodeSatisfiableExpandingCacheStoringData::hasPreviousSatisfiableCached() { return mPrevSatCached; } CIndividualNodeSatisfiableExpandingCacheStoringData* CIndividualNodeSatisfiableExpandingCacheStoringData::setPreviousSatisfiableCached(bool cached) { mPrevSatCached = cached; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CAdditionalProcessRoleAssertionsLinker.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CAdditionalProcessRoleAssertionsLinker0000644000175000017500000000526512520551070032402 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CADDITIONALPROCESSROLEASSERTIONSLINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CADDITIONALPROCESSROLEASSERTIONSLINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Reasoner/Ontology/CIndividual.h" #include "Reasoner/Ontology/CRoleAssertionLinker.h" #include "Reasoner/Ontology/CReverseRoleAssertionLinker.h" // Logger includes #include "Logger/CLogger.h" #include "Utilities/Container/CLinker.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CAdditionalProcessRoleAssertionsLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAdditionalProcessRoleAssertionsLinker : public CLinkerBase { // public methods public: //! Constructor CAdditionalProcessRoleAssertionsLinker(); CAdditionalProcessRoleAssertionsLinker* initAdditionalProcessRoleAssertionsLinker(CIndividual* individual, CRoleAssertionLinker* roleAssertionLinker, CReverseRoleAssertionLinker* reverseRoleAssertionLinker); CIndividual* getIndividual(); CRoleAssertionLinker* getRoleAssertionLinker(); CReverseRoleAssertionLinker* getReverseRoleAssertionLinker(); // protected methods protected: // protected variables protected: CRoleAssertionLinker* mRoleAssertionLinker; CReverseRoleAssertionLinker* mReverseRoleAssertionLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CADDITIONALPROCESSROLEASSERTIONSLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingRestrictionSpecification.h0000644000175000017500000000456712520551134032227 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGRESTRICTIONSPECIFICATION_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGRESTRICTIONSPECIFICATION_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Utilities/Container/CSortedLinker.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CProcessingRestrictionSpecification * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessingRestrictionSpecification : public CLinkerBase { // public methods public: //! Constructor CProcessingRestrictionSpecification(); CProcessingRestrictionSpecification* initProcessingRestriction(CProcessingRestrictionSpecification* prevProcRestSpec); CProcessingRestrictionSpecification* getNextProcessingRestrictionSpecification(); double getPriorityOffset(); CProcessingRestrictionSpecification* setPriorityOffset(double priorityOffset); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGRESTRICTIONSPECIFICATION_H ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetMigrateData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetM0000644000175000017500000000403212520551150032266 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathSetMigrateData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathSetMigrateData::CRepresentativeVariableBindingPathSetMigrateData(CProcessContext* context) : mProcessContext(context),mVarBindPathMap(context),mRepContainingMap(context) { } CRepresentativeVariableBindingPathSetMigrateData* CRepresentativeVariableBindingPathSetMigrateData::initRepresentativeVariableBindingPathSetMigrateData(CRepresentativeVariableBindingPathSetMigrateData* data) { if (data) { mVarBindPathMap = data->mVarBindPathMap; mRepContainingMap = data->mRepContainingMap; } else { mVarBindPathMap.clear(); mRepContainingMap.clear(); } return this; } CRepresentativeVariableBindingPathMap* CRepresentativeVariableBindingPathSetMigrateData::getRepresentativeVariableBindingPathMap() { return &mVarBindPathMap; } CRepresentativeContainingMap* CRepresentativeVariableBindingPathSetMigrateData::getRepresentativeContainingMap() { return &mRepContainingMap; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDistinctIterator.cpp0000644000175000017500000000426312520551120026776 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDistinctIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDistinctIterator::CDistinctIterator() { } CDistinctIterator::CDistinctIterator(const CPROCESSHASH::iterator& beginIt, const CPROCESSHASH::iterator& endIt) : mBeginIt(beginIt),mEndIt(endIt) { } bool CDistinctIterator::hasNext() { return mBeginIt != mEndIt; } cint64 CDistinctIterator::nextDistinctIndividualID(bool moveNext) { cint64 indi = 0; if (mBeginIt != mEndIt) { indi = mBeginIt.key(); if (moveNext) { ++mBeginIt; } } return indi; } cint64 CDistinctIterator::nextDistinctIndividualID(CDependencyTrackPoint*& depTrackPoint, bool moveNext) { cint64 indi = 0; if (mBeginIt != mEndIt) { indi = mBeginIt.key(); depTrackPoint = mBeginIt.value()->getDependencyTrackPoint(); if (moveNext) { ++mBeginIt; } } return indi; } CDistinctEdge* CDistinctIterator::next(bool moveNext) { CDistinctEdge* disEdge = nullptr; if (mBeginIt != mEndIt) { disEdge = mBeginIt.value(); if (moveNext) { ++mBeginIt; } } return disEdge; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathSet.cpp0000644000175000017500000000735112520551164030025 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingPathSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingPathSet::CVariableBindingPathSet(CProcessContext* processContext) : mProcessContext(processContext),mVarBindPathMap(processContext) { } CVariableBindingPathSet* CVariableBindingPathSet::initVariableBindingPathSet(CVariableBindingPathSet* prevSet) { if (prevSet) { mVarBindPathMap.initVariableBindingPathMap(&prevSet->mVarBindPathMap); mConceptDescriptor = prevSet->mConceptDescriptor; mVarBindPathDesLinker = prevSet->mVarBindPathDesLinker; } else { mVarBindPathMap.initVariableBindingPathMap(nullptr); mConceptDescriptor = nullptr; mVarBindPathDesLinker = nullptr; } return this; } bool CVariableBindingPathSet::containsVariableBindingPath(CVariableBindingPath* variableBindingPath) { return mVarBindPathMap.contains(variableBindingPath->getPropagationID()); } bool CVariableBindingPathSet::containsVariableBindingPath(cint64 bindingID) { return mVarBindPathMap.contains(bindingID); } CVariableBindingPathDescriptor* CVariableBindingPathSet::getVariableBindingPathDescriptor(CVariableBindingPath* variableBindingPath) { return mVarBindPathMap.value(variableBindingPath->getPropagationID()).getVariableBindingPathDescriptor(); } CVariableBindingPathMap* CVariableBindingPathSet::getVariableBindingPathMap() { return &mVarBindPathMap; } CVariableBindingPathSet* CVariableBindingPathSet::addVariableBindingPath(CVariableBindingPathDescriptor* varBindPathDes) { CVariableBindingPathMapData& data = mVarBindPathMap[varBindPathDes->getVariableBindingPath()->getPropagationID()]; if (!data.hasVariableBindingPathDescriptor()) { data.setVariableBindingPathDescriptor(varBindPathDes); mVarBindPathDesLinker = varBindPathDes->append(mVarBindPathDesLinker); } return this; } CVariableBindingPathSet* CVariableBindingPathSet::copyVariableBindingPaths(CVariableBindingPathMap* varBindPathMap) { if (varBindPathMap) { mVarBindPathMap = *varBindPathMap; } return this; } CConceptDescriptor* CVariableBindingPathSet::getConceptDescriptor() { return mConceptDescriptor; } CVariableBindingPathSet* CVariableBindingPathSet::setConceptDescriptor(CConceptDescriptor* conDes) { mConceptDescriptor = conDes; return this; } CVariableBindingPathSet* CVariableBindingPathSet::addVariableBindingPathDescriptorLinker(CVariableBindingPathDescriptor* varBindPathDesLinker) { mVarBindPathDesLinker = varBindPathDesLinker->append(mVarBindPathDesLinker); return this; } CVariableBindingPathDescriptor* CVariableBindingPathSet::getVariableBindingPathDescriptorLinker() { return mVarBindPathDesLinker; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeRealValueExclusionType.h0000644000175000017500000000450512520551112031260 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUEEXCLUSIONTYPE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUEEXCLUSIONTYPE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CDatatypeRealValueExclusionType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeRealValueExclusionType { // public methods public: enum REAL_VALUE_EXCLUSION_TYPE { RVET_NOTHING = 0, RVET_INTEGER = 1, RVET_DECIMAL = 2, RVET_RATIONAL = 3, RVET_REAL = 4, RVET_ALL = 5 }; //! Constructor CDatatypeRealValueExclusionType(REAL_VALUE_EXCLUSION_TYPE exclusionType = RVET_NOTHING, bool negated = false); CDatatypeRealValueExclusionType* setExclusionType(REAL_VALUE_EXCLUSION_TYPE exclusionType, bool negated); REAL_VALUE_EXCLUSION_TYPE getExclusionType(); bool getExclusionNegation(); // protected methods protected: // protected variables protected: REAL_VALUE_EXCLUSION_TYPE mExclusionType; bool mExclusionNegation; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUEEXCLUSIONTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptNominalSchemaGroundingData.h0000644000175000017500000000517712520551100031654 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTNOMINALSCHEMAGROUNDINGDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTNOMINALSCHEMAGROUNDINGDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CConceptNominalSchemaGroundingData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptNominalSchemaGroundingData { // public methods public: //! Constructor CConceptNominalSchemaGroundingData(CContext* context); CConceptNominalSchemaGroundingData* setGroundingConcept(CConcept* concept); CConceptNominalSchemaGroundingData* setGroundedConcept(CConcept* concept); CConceptNominalSchemaGroundingData* addBindedNominalSchemaConcept(CConcept* nsConcept); CPROCESSLIST* getBindedNominalSchemaConceptList(); CConcept* getGroundedConcept(); CConcept* getGroundingConcept(); cint64 calculateHashValue(); bool isEquivalentTo(const CConceptNominalSchemaGroundingData& data) const; // protected methods protected: // protected variables protected: CContext* mContext; CConcept* mGroundedConcept; CConcept* mGroundingConcept; CPROCESSLIST mBindedNomSchConList; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTNOMINALSCHEMAGROUNDINGDATA_H ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetDataSignature.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetD0000644000175000017500000000445312520551146032271 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETDATASIGNATURE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETDATASIGNATURE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathSetDataSignature * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathSetDataSignature { // public methods public: //! Constructor CRepresentativeVariableBindingPathSetDataSignature(); CRepresentativeVariableBindingPathSetDataSignature* initSignature(CRepresentativeVariableBindingPathSetDataSignature* prevSignature); CRepresentativeVariableBindingPathSetDataSignature* addKey(cint64 key); cint64 getSignatureValue(); // protected methods protected: // protected variables protected: cint64 mIncomingRepPropKey1; cint64 mIncomingRepPropKey2; cint64 mIncomingRepPropKey; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETDATASIGNATURE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeContainingMap.cpp0000644000175000017500000000361512520551142031157 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeContainingMap.h" #include "CRepresentativeVariableBindingPathSetData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeContainingMap::CRepresentativeContainingMap(CProcessContext* processContext) : mProcessContext(processContext),CPROCESSMAP(processContext) { } CRepresentativeContainingMap* CRepresentativeContainingMap::initRepresentativeContainingMap(CRepresentativeContainingMap* prevMap) { if (prevMap) { *this = *prevMap; } else { CPROCESSMAP::clear(); } return this; } CRepresentativeContainingMap* CRepresentativeContainingMap::insertContainedRepresentative(CRepresentativeVariableBindingPathSetData* repData, bool explicitelyContained) { insert(repData->getRepresentativeID(),CRepresentativeContainingMapData(repData,explicitelyContained)); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBinding.cpp0000644000175000017500000000460212520551136027265 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPropagationBinding.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CPropagationBinding::CPropagationBinding() { } cint64 CPropagationBinding::getPropagationID() { return mPropID; } CPropagationBinding* CPropagationBinding::setPropagationID(cint64 propID) { mPropID = propID; return this; } CPropagationBinding* CPropagationBinding::initPropagationBinding(cint64 propID, CDependencyTrackPoint* dependencyTrackPoint, CIndividualProcessNode* indi, CConceptDescriptor* conDes, CVariable* variable) { initDependencyTracker(dependencyTrackPoint); mVariable = variable; mIndiNode = indi; mPropID = propID; mConDes = conDes; return this; } CVariable* CPropagationBinding::getBindedVariable() { return mVariable; } CPropagationBinding* CPropagationBinding::setBindedVariable(CVariable* variable) { mVariable = variable; return this; } CIndividualProcessNode* CPropagationBinding::getBindedIndividual() { return mIndiNode; } CPropagationBinding* CPropagationBinding::setBindedIndividual(CIndividualProcessNode* indi) { mIndiNode = indi; return this; } CConceptDescriptor* CPropagationBinding::getBindedConceptDescriptor() { return mConDes; } CPropagationBinding* CPropagationBinding::setBindedConceptDescriptor(CConceptDescriptor* conDes) { mConDes = conDes; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptHashD0000644000175000017500000000363212520551136032267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPropagationBindingReapplyConceptHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CPropagationBindingReapplyConceptHashData::CPropagationBindingReapplyConceptHashData(CPropagationBindingReapplyConceptDescriptor* propBindReapplyConDes) { mPropBindReapplyConDes = propBindReapplyConDes; } CPropagationBindingReapplyConceptDescriptor* CPropagationBindingReapplyConceptHashData::getPropagationBindingReapplyConceptDescriptor() const { return mPropBindReapplyConDes; } CPropagationBindingReapplyConceptHashData* CPropagationBindingReapplyConceptHashData::setPropagationBindingReapplyConceptDescriptor(CPropagationBindingReapplyConceptDescriptor* des) { mPropBindReapplyConDes = des; return this; } CPropagationBindingReapplyConceptHashData* CPropagationBindingReapplyConceptHashData::clearPropagationBindingReapplyConceptDescriptor() { mPropBindReapplyConDes = nullptr; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptHashData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptHashD0000644000175000017500000000470512520551136032271 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGREAPPLYCONCEPTHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGREAPPLYCONCEPTHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CPropagationBindingReapplyConceptDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CPropagationBindingReapplyConceptHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPropagationBindingReapplyConceptHashData { // public methods public: //! Constructor CPropagationBindingReapplyConceptHashData(CPropagationBindingReapplyConceptDescriptor* propBindReapplyConDes = nullptr); CPropagationBindingReapplyConceptDescriptor* getPropagationBindingReapplyConceptDescriptor() const; CPropagationBindingReapplyConceptHashData* setPropagationBindingReapplyConceptDescriptor(CPropagationBindingReapplyConceptDescriptor* des); CPropagationBindingReapplyConceptHashData* clearPropagationBindingReapplyConceptDescriptor(); // protected methods protected: // protected variables protected: CPropagationBindingReapplyConceptDescriptor* mPropBindReapplyConDes; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGREAPPLYCONCEPTHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSuccessorConnectedNominalSet.h0000644000175000017500000000446412520551162030747 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSUCCESSORCONNECTEDNOMINALSET_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSUCCESSORCONNECTEDNOMINALSET_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSuccessorConnectedNominalSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSuccessorConnectedNominalSet : public CPROCESSSET { // public methods public: //! Constructor CSuccessorConnectedNominalSet(CProcessContext* processContext); CSuccessorConnectedNominalSet* initSuccessorConnectedNominalSet(CSuccessorConnectedNominalSet* nominalSet = nullptr); CSuccessorConnectedNominalSet* copySuccessorConnectedNominalSet(CSuccessorConnectedNominalSet* nominalSet); bool addSuccessorConnectedNominal(cint64 nominalNodeID); bool hasSuccessorConnectedNominal(cint64 nominalNodeID); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSUCCESSORCONNECTEDNOMINALSET_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSuccessorConnectedNominalSet.cpp0000644000175000017500000000416112520551162031274 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSuccessorConnectedNominalSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSuccessorConnectedNominalSet::CSuccessorConnectedNominalSet(CProcessContext* processContext) : mProcessContext(processContext),CPROCESSSET(processContext) { } CSuccessorConnectedNominalSet* CSuccessorConnectedNominalSet::initSuccessorConnectedNominalSet(CSuccessorConnectedNominalSet* nominalSet) { if (nominalSet) { *this = *nominalSet; } else { CPROCESSSET::clear(); } return this; } CSuccessorConnectedNominalSet* CSuccessorConnectedNominalSet::copySuccessorConnectedNominalSet(CSuccessorConnectedNominalSet* nominalSet) { initSuccessorConnectedNominalSet(nominalSet); return this; } bool CSuccessorConnectedNominalSet::addSuccessorConnectedNominal(cint64 nominalNodeID) { if (!CPROCESSSET::contains(nominalNodeID)) { CPROCESSSET::insert(nominalNodeID); return true; } return false; } bool CSuccessorConnectedNominalSet::hasSuccessorConnectedNominal(cint64 nominalNodeID) { return CPROCESSSET::contains(nominalNodeID); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBackwardSaturationPropagationLink.cpp0000644000175000017500000000354712520551072032327 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackwardSaturationPropagationLink.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBackwardSaturationPropagationLink::CBackwardSaturationPropagationLink() : CLinkerBase(nullptr) { mSourceIndividual = nullptr; } CBackwardSaturationPropagationLink* CBackwardSaturationPropagationLink::initBackwardPropagationLink(CIndividualSaturationProcessNode* sourceIndividual, CRole* role) { setData(role); mSourceIndividual = sourceIndividual; return this; } CRole* CBackwardSaturationPropagationLink::getLinkRole() { return getData(); } CBackwardSaturationPropagationLink* CBackwardSaturationPropagationLink::setLinkRole(CRole* role) { setData(role); return this; } CIndividualSaturationProcessNode* CBackwardSaturationPropagationLink::getSourceIndividual() { return mSourceIndividual; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleReapplyHash.h0000644000175000017500000000440012520551152026210 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CROLEREAPPLYHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CROLEREAPPLYHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CReapplyQueue.h" #include "CProcessContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRoleReapplyHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleReapplyHash : public CPROCESSHASH { // public methods public: //! Constructor CRoleReapplyHash(CProcessContext* processContext = nullptr); //! Destructor virtual ~CRoleReapplyHash(); CRoleReapplyHash* initRoleReapplyHash(CRoleReapplyHash* prevRoleReapplyHash); CReapplyQueue* getRoleReapplyQueue(CRole* role, bool create = false); bool containsRoleReapplyQueue(CRole* role); CReapplyQueueIterator getRoleReapplyIterator(CRole* role, bool clearDynamicReapplyQueue = true); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CROLEREAPPLYHASH_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeIncrementalExpansionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeIncrementalExpansionDat0000644000175000017500000001231212520551124032316 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEINCREMENTALEXPANSIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEINCREMENTALEXPANSIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CConceptDescriptor.h" #include "CLinkEdge.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualNodeIncrementalExpansionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeIncrementalExpansionData { // public methods public: //! Constructor CIndividualNodeIncrementalExpansionData(CProcessContext* processContext = nullptr); CIndividualNodeIncrementalExpansionData* initIncrementalExpansionData(CIndividualNodeIncrementalExpansionData* prevData); CIndividualProcessNode* getDirectlyChangedNeighbourConnectionNode(); CIndividualNodeIncrementalExpansionData* setDirectlyChangedNeighbourConnectionNode(CIndividualProcessNode* node); bool hasDirectlyChangedNeighbourConnection(); bool isCompatibilityChanged(); bool isDirectlyChanged(); CIndividualNodeIncrementalExpansionData* setDirectlyChanged(bool directlyChanged); bool isPreviousCompletionGraphCompatible(); CIndividualNodeIncrementalExpansionData* setPreviousCompletionGraphCompatible(bool compatible); CConceptDescriptor* getLastCompatibleCheckedConceptDescriptor(); CLinkEdge* getLastCompatibleCheckedLink(); CIndividualNodeIncrementalExpansionData* setLastCompatibleCheckedConceptDescriptor(CConceptDescriptor* conDes); CIndividualNodeIncrementalExpansionData* setLastCompatibleCheckedLink(CLinkEdge* link); CIndividualProcessNode* getPreviousCompletionGraphCorrespondenceIndividualNode(); CIndividualNodeIncrementalExpansionData* setPreviousCompletionGraphCorrespondenceIndividualNode(CIndividualProcessNode* node); bool isPreviousCompletionGraphCorrespondenceIndividualNodeLoaded(); CIndividualNodeIncrementalExpansionData* setPreviousCompletionGraphCorrespondenceIndividualNodeLoaded(bool loaded); CPROCESSLIST* getNeighbourPropagatedDirectlyChangedList(bool create = true); CIndividualNodeIncrementalExpansionData* addNeighbourPropagatedDirectlyChanged(CIndividualProcessNode* indiNode); CIndividualNodeIncrementalExpansionData* clearNeighbourPropagatedDirectlyChangedList(); bool hasNeighbourPropagatedDirectlyChanged(); CPROCESSLIST* getIncrementalExpansionList(bool create = true); bool isIncremetnalExpansionListInitialized(); CIndividualNodeIncrementalExpansionData* setIncremetnalExpansionListInitialized(bool initialized); bool requiresFurtherIncrementalExpansion(); CIndividual* takeNextIncrementalExpansionIndividual(); CIndividual* getNextIncrementalExpansionIndividual(); double getExpansionPriority(); CIndividualNodeIncrementalExpansionData* setExpansionPriority(double priority); CIndividualNodeIncrementalExpansionData* setExpansionID(cint64 id); double getNextIncrementalExpansionPriority(); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; double mExpansionPriority; CPROCESSLIST* mUseIncrementalExpansionList; CPROCESSLIST* mLocIncrementalExpansionList; bool mIncremetnalExpansionListInitialized; CPROCESSLIST* mUseNeighbourPropagatedDirectlyChangedList; CPROCESSLIST* mLocNeighbourPropagatedDirectlyChangedList; bool mDirectlyChanged; CIndividualProcessNode* mDirectlyChangedNeighbourConnNode; CIndividualProcessNode* mPrevCompGraphCorrIndiNode; bool mPrevCompGraphCorrIndiNodeLoaded; bool mCompletionGraphCompatible; CConceptDescriptor* mLastCompatibleCheckedConDes; CLinkEdge* mLastCompatibleCheckedLink; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEINCREMENTALEXPANSIONDATA_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBackwardPropagationReapplyDescriptor.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBackwardPropagationReapplyDescriptor.0000644000175000017500000000300112520551072032311 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackwardPropagationReapplyDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBackwardPropagationReapplyDescriptor::CBackwardPropagationReapplyDescriptor() { mReapplyConDes = nullptr; } CBackwardPropagationReapplyDescriptor* CBackwardPropagationReapplyDescriptor::initBackwardPropagationReapplyDescriptor(CConceptDescriptor* conDes) { mReapplyConDes = conDes; return this; } CConceptDescriptor* CBackwardPropagationReapplyDescriptor::getReapllyConceptDescriptor() { return mReapplyConDes; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeExpressivityViolationFlags.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeExpressivityViolationFl0000644000175000017500000000540412520551122032426 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEEXPRESSIVITYVIOLATIONFLAGS_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEEXPRESSIVITYVIOLATIONFLAGS_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CIndividualNodeExpressivityViolationFlags * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeExpressivityViolationFlags { // public methods public: //! Constructor CIndividualNodeExpressivityViolationFlags(CProcessContext* context = nullptr); CIndividualNodeExpressivityViolationFlags* initViolationFlags(CIndividualNodeExpressivityViolationFlags* violationFlags = nullptr); bool setViolationFlags(cint64 flags); bool setViolationFlags(CIndividualNodeExpressivityViolationFlags* violationFlags); bool hasPartialViolationFlags(cint64 flags); bool hasViolationFlags(cint64 flags); bool hasViolations(); const static cint64 VFEXPRESSIVITYVIOLATED = 0x1; const static cint64 VFFUNCTIONALEXPRESSIVITYVIOLATED = 0x2; const static cint64 VFFUNCTIONALANCESTOREXPRESSIVITYVIOLATED = 0x3; const static cint64 VFINVERSEEXPRESSIVITYVIOLATED = 0x4; // protected methods protected: // protected variables protected: CProcessContext* mContext; cint64 mViolFlags; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEEXPRESSIVITYVIOLATIONFLAGS_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptRepresentativePropagationSetHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptRepresentativePropagationSetHa0000644000175000017500000000527612520551102032374 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptRepresentativePropagationSetHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptRepresentativePropagationSetHash::CConceptRepresentativePropagationSetHash(CProcessContext* processContext) : mProcessContext(processContext) { } CConceptRepresentativePropagationSetHash* CConceptRepresentativePropagationSetHash::initConceptRepresentativePropagationSetHash(CConceptRepresentativePropagationSetHash* prevHash) { if (prevHash) { *this = *prevHash; } else { CPROCESSHASH::clear(); } return this; } CRepresentativePropagationSet* CConceptRepresentativePropagationSetHash::getRepresentativePropagationSet(CConcept* concept, bool localize) { CRepresentativePropagationSet* repPropSet = nullptr; cint64 conTag = concept->getConceptTag(); if (localize) { CConceptRepresentativePropagationSetHashData& data = CPROCESSHASH::operator[](conTag); if (!data.mLocRepPropSet) { CMemoryAllocationManager* taskMemMan = mProcessContext->getUsedMemoryAllocationManager(); repPropSet = CObjectParameterizingAllocator< CRepresentativePropagationSet,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,mProcessContext); repPropSet->initRepresentativePropagationSet(data.mUseRepPropSet); data.mUseRepPropSet = data.mLocRepPropSet = repPropSet; } else { repPropSet = data.mUseRepPropSet; } } else { CConceptRepresentativePropagationSetHashData data = CPROCESSHASH::value(conTag); repPropSet = data.mUseRepPropSet; } return repPropSet; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCacheRetrievalData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCac0000644000175000017500000000314012520551124032231 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeSatisfiableExpandingCacheRetrievalData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeSatisfiableExpandingCacheRetrievalData::CIndividualNodeSatisfiableExpandingCacheRetrievalData() { } CIndividualNodeSatisfiableExpandingCacheRetrievalData::~CIndividualNodeSatisfiableExpandingCacheRetrievalData() { } CIndividualNodeSatisfiableExpandingCacheRetrievalData* CIndividualNodeSatisfiableExpandingCacheRetrievalData::initSatisfiableExpandingCacheRetrievalData(CIndividualNodeSatisfiableExpandingCacheRetrievalData* prevData) { if (prevData) { } else { } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeAnalizedConceptExpansionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeAnalizedConceptExpansio0000644000175000017500000000746112520551122032320 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEANALIZEDCONCEPTEXPANSIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEANALIZEDCONCEPTEXPANSIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "CProcessContext.h" #include "CAnalizedConceptExpansionLinker.h" // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualNodeAnalizedConceptExpansionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeAnalizedConceptExpansionData { // public methods public: //! Constructor CIndividualNodeAnalizedConceptExpansionData(); CIndividualNodeAnalizedConceptExpansionData* initBlockingExplorationData(CIndividualNodeAnalizedConceptExpansionData* prevData); CAnalizedConceptExpansionLinker* getReverseAnalizedConceptExpansionLinker(); CConceptDescriptor* getLastConceptDescriptor(); cint64 getLastConceptSignature(); cint64 getLastConceptCount(); cint64 getExpansionConceptCount(); cint64 getMinimalValidConceptCountLimit(); bool isInvalidBlocker(); CIndividualNodeAnalizedConceptExpansionData* setLastConceptDescriptor(CConceptDescriptor* conDes); CIndividualNodeAnalizedConceptExpansionData* setLastConceptSignature(cint64 signature); CIndividualNodeAnalizedConceptExpansionData* setLastConceptCount(cint64 conCount); CIndividualNodeAnalizedConceptExpansionData* setMinimalValidConceptCountLimit(cint64 conCount); CIndividualNodeAnalizedConceptExpansionData* setInvalidBlocker(bool invalid); CIndividualNodeAnalizedConceptExpansionData* addAnalizedConceptExpansionLinker(CAnalizedConceptExpansionLinker *linker); CXLinker* getAnalysedNonDeterministicConceptExpansionLinker(); CIndividualNodeAnalizedConceptExpansionData* setAnalysedNonDeterministicConceptExpansionLinker(CXLinker* linker); CIndividualNodeAnalizedConceptExpansionData* addAnalysedNonDeterministicConceptExpansionLinker(CXLinker* linker); // protected methods protected: // protected variables protected: CAnalizedConceptExpansionLinker* mRevAnaConExpLinker; CConceptDescriptor* mLastConDes; cint64 mLastConceptSignature; cint64 mLastConceptCount; cint64 mMinValidConceptCountLimit; cint64 mExpCount; bool mInvalidBlocker; CXLinker* mNonDetExpansionLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEANALIZEDCONCEPTEXPANSIONDATA_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptSaturationDescriptorReapplyData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptSaturationDescriptorReapplyDat0000644000175000017500000000267712520551102032423 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptSaturationDescriptorReapplyData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptSaturationDescriptorReapplyData::CConceptSaturationDescriptorReapplyData() { mImpReapplyConSatDes = nullptr; mConSatDes = nullptr; } CConceptSaturationDescriptorReapplyData::CConceptSaturationDescriptorReapplyData(const CConceptSaturationDescriptorReapplyData& data) { mConSatDes = data.mConSatDes; mImpReapplyConSatDes = data.mImpReapplyConSatDes; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationPredecessorRoleFUNCTIONALCo0000644000175000017500000000515412520551156031752 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash::CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash(CProcessContext* processContext) : mProcessContext(processContext),mLinkedPredecessorRoleFUNCTIONALConceptExtHash(processContext) { } CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash* CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash::initLinkedPredecessorRoleFUNCTIONALConceptsExtensionHash() { mLinkedPredecessorRoleFUNCTIONALConceptExtHash.clear(); return this; } CPROCESSHASH* CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash::getLinkedPredecessorIndividualFUNCTIONALConceptsExtensionHash() { return &mLinkedPredecessorRoleFUNCTIONALConceptExtHash; } CSaturationPredecessorFUNCTIONALConceptExtensionData* CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash::getPredecessorFunctionalConceptsExtensionData(CRole* role, bool create) { if (create) { CSaturationPredecessorFUNCTIONALConceptExtensionData*& data = mLinkedPredecessorRoleFUNCTIONALConceptExtHash[role]; if (!data) { data = CObjectParameterizingAllocator< CSaturationPredecessorFUNCTIONALConceptExtensionData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); data->initPredecessorMergedConceptExtensionData(role); } return data; } else { return mLinkedPredecessorRoleFUNCTIONALConceptExtHash.value(role,nullptr); } } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReusingReviewData.cpp0000644000175000017500000000535312520551150027077 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReusingReviewData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CReusingReviewData::CReusingReviewData(CProcessContext* context) : mIndividualSet(context),mDepthIndividualMap(context) { mContext = context; } CReusingReviewData* CReusingReviewData::initReviewData(CReusingReviewData* sigBlockRevData) { if (sigBlockRevData) { mIndividualSet = sigBlockRevData->mIndividualSet; mDepthIndividualMap = sigBlockRevData->mDepthIndividualMap; } else { mIndividualSet.clear(); mDepthIndividualMap.clear(); } return this; } CReusingReviewData* CReusingReviewData::insert(cint64 depth, cint64 indiID) { if (!mIndividualSet.contains(indiID)) { mIndividualSet.insert(indiID); mDepthIndividualMap.insertMulti(depth,indiID); } return this; } bool CReusingReviewData::contains(cint64 indiID) { return mIndividualSet.contains(indiID); } CReusingReviewData* CReusingReviewData::remove(cint64 indiID) { mIndividualSet.remove(indiID); return this; } bool CReusingReviewData::isEmpty() { return mIndividualSet.isEmpty(); } bool CReusingReviewData::hasNextIndividualID() { return mIndividualSet.isEmpty(); } cint64 CReusingReviewData::takeNextIndividualID() { cint64 indiID = 0; CPROCESSMAP::iterator depthIndividualMapIt = mDepthIndividualMap.begin(), depthIndividualMapItEnd = mDepthIndividualMap.end(); while (depthIndividualMapIt != depthIndividualMapItEnd) { indiID = depthIndividualMapIt.value(); depthIndividualMapIt = mDepthIndividualMap.erase(depthIndividualMapIt); if (mIndividualSet.contains(indiID)) { mIndividualSet.remove(indiID); break; } } return indiID; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeUnsatisfiableCacheRetrievalData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeUnsatisfiableCacheRetri0000644000175000017500000000243112520551124032263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeUnsatisfiableCacheRetrievalData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeUnsatisfiableCacheRetrievalData::CIndividualNodeUnsatisfiableCacheRetrievalData() { } CIndividualNodeUnsatisfiableCacheRetrievalData::~CIndividualNodeUnsatisfiableCacheRetrievalData() { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCoreConceptDescriptor.cpp0000644000175000017500000000254312520551104027747 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCoreConceptDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CCoreConceptDescriptor::CCoreConceptDescriptor() { } CCoreConceptDescriptor* CCoreConceptDescriptor::initCoreConceptDescriptor(CConceptDescriptor* conDes) { setData(conDes); return this; } CConceptDescriptor *CCoreConceptDescriptor::getConceptDesciptor() { return getData(); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningKeyMapData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJ0000644000175000017500000000521112520551150032263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGKEYMAPDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGKEYMAPDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CRepresentativeVariableBindingPathSetJoiningKeyDataMap.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathSetJoiningKeyMapData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathSetJoiningKeyMapData { // public methods public: //! Constructor CRepresentativeVariableBindingPathSetJoiningKeyMapData(CRepresentativeVariableBindingPathSetJoiningKeyDataMap* repVarBindPathSetJoiningKeyDataMap = nullptr); CRepresentativeVariableBindingPathSetJoiningKeyDataMap* getRepresentativeVariableBindingPathSetJoiningKeyDataMap() const; bool hasRepresentativeVariableBindingPathSetJoiningKeyDataMap() const; CRepresentativeVariableBindingPathSetJoiningKeyMapData* setRepresentativeVariableBindingPathSetJoiningKeyDataMap(CRepresentativeVariableBindingPathSetJoiningKeyDataMap* repVarBindPathSetJoiningKeyDataMap); // protected methods protected: // protected variables protected: CRepresentativeVariableBindingPathSetJoiningKeyDataMap* mRepVarBindPathSetJoiningKeyDataMap; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGKEYMAPDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCondensedReapplyQueue.cpp0000644000175000017500000000717112520551104027752 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCondensedReapplyQueue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CCondensedReapplyQueue::CCondensedReapplyQueue() { mDynamicPosNegReapplyDesLinker = nullptr; #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_CONDENSED_REAPPLY_QUEUE_COUNT mDynamicPosNegCount = 0; #endif } CCondensedReapplyQueue* CCondensedReapplyQueue::initReapplyQueue(CCondensedReapplyQueue* prevReapplyQueue) { if (prevReapplyQueue) { mDynamicPosNegReapplyDesLinker = prevReapplyQueue->mDynamicPosNegReapplyDesLinker; #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_CONDENSED_REAPPLY_QUEUE_COUNT mDynamicPosNegCount = prevReapplyQueue->mDynamicPosNegCount; #endif } else { mDynamicPosNegReapplyDesLinker = nullptr; #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_CONDENSED_REAPPLY_QUEUE_COUNT mDynamicPosNegCount = 0; #endif } return this; } #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_CONDENSED_REAPPLY_QUEUE_COUNT qint64 CCondensedReapplyQueue::getReapplyCount() { return mDynamicPosNegCount; } #endif bool CCondensedReapplyQueue::isEmpty() const { return !mDynamicPosNegReapplyDesLinker; } bool CCondensedReapplyQueue::hasConceptDescriptor(CConceptDescriptor* conceptDescriptor) { CCondensedReapplyConceptDescriptor* desLinker = mDynamicPosNegReapplyDesLinker; while (desLinker) { if (desLinker->hasConceptDescriptor(conceptDescriptor)) { return true; } desLinker = desLinker->getNext(); } return false; } CCondensedReapplyQueue* CCondensedReapplyQueue::addReapplyConceptDescriptor(CCondensedReapplyConceptDescriptor *conProDes) { if (conProDes) { mDynamicPosNegReapplyDesLinker = (CCondensedReapplyConceptDescriptor*)conProDes->append(mDynamicPosNegReapplyDesLinker); #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_CONDENSED_REAPPLY_QUEUE_COUNT ++mDynamicPosNegCount; #endif } return this; } CCondensedReapplyQueueIterator CCondensedReapplyQueue::getIterator(bool onlyPositiveDescriptors, bool clearDynamicReapplyQueue) { return getIterator(onlyPositiveDescriptors == true,onlyPositiveDescriptors == false,clearDynamicReapplyQueue); } CCondensedReapplyQueueIterator CCondensedReapplyQueue::getIterator(bool positiveDescriptors, bool negativeDescriptors, bool clearDynamicReapplyQueue) { CCondensedReapplyQueueIterator it(mDynamicPosNegReapplyDesLinker,positiveDescriptors,negativeDescriptors); if (clearDynamicReapplyQueue) { mDynamicPosNegReapplyDesLinker = nullptr; #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_CONDENSED_REAPPLY_QUEUE_COUNT mDynamicPosNegCount = 0; #endif } return it; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceStringValuesCounter.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceStringValuesCounter0000644000175000017500000001132012520551116032352 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceStringValuesCounter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeValueSpaceStringValuesCounter::CDatatypeValueSpaceStringValuesCounter() { initStringValueCounter(); } CDatatypeValueSpaceStringValuesCounter* CDatatypeValueSpaceStringValuesCounter::initStringValueCounter(cint64 valueCount) { initValueCounter(valueCount); mWithLanguageTagTypeCounter.initValueCounter(valueCount); mWithoutLanguageTagTypeCounter.initValueCounter(valueCount); return this; } bool CDatatypeValueSpaceStringValuesCounter::incValueCount(cint64 type, cint64 incCount) { bool counted = false; if ((type & SVT_WITH_LANGUAG_TAG_COUNT) != 0) { counted |= mWithLanguageTagTypeCounter.incValueCount(incCount); } if ((type & SVT_WITHOUT_LANGUAG_TAG_COUNT) != 0) { counted |= mWithoutLanguageTagTypeCounter.incValueCount(incCount); } return counted; } bool CDatatypeValueSpaceStringValuesCounter::incInfinite(cint64 type) { bool counted = false; if ((type & SVT_WITH_LANGUAG_TAG_COUNT) != 0) { counted |= mWithLanguageTagTypeCounter.incInfinite(); } if ((type & SVT_WITHOUT_LANGUAG_TAG_COUNT) != 0) { counted |= mWithoutLanguageTagTypeCounter.incInfinite(); } return counted; } bool CDatatypeValueSpaceStringValuesCounter::isInfinite(cint64 type) { bool infinite = true; if ((type & SVT_WITH_LANGUAG_TAG_COUNT) != 0) { infinite &= mWithLanguageTagTypeCounter.isInfinite(); } if ((type & SVT_WITHOUT_LANGUAG_TAG_COUNT) != 0) { infinite &= mWithoutLanguageTagTypeCounter.isInfinite(); } return infinite; } cint64 CDatatypeValueSpaceStringValuesCounter::getValueCount(cint64 type) { cint64 valueCount = true; if ((type & SVT_WITH_LANGUAG_TAG_COUNT) != 0) { valueCount += mWithLanguageTagTypeCounter.getValueCount(); } if ((type & SVT_WITHOUT_LANGUAG_TAG_COUNT) != 0) { valueCount += mWithoutLanguageTagTypeCounter.getValueCount(); } return valueCount; } bool CDatatypeValueSpaceStringValuesCounter::hasValueAchieved(cint64 value) { return CDatatypeValueSpaceValuesCounter::hasValueAchieved(value); } cint64 CDatatypeValueSpaceStringValuesCounter::getValueCount() { return CDatatypeValueSpaceValuesCounter::getValueCount(); } bool CDatatypeValueSpaceStringValuesCounter::isInfinite() { return CDatatypeValueSpaceValuesCounter::isInfinite(); } bool CDatatypeValueSpaceStringValuesCounter::hasValueAchieved(cint64 type, cint64 value) { bool achieved = true; if ((type & SVT_WITH_LANGUAG_TAG_COUNT) != 0) { achieved &= mWithLanguageTagTypeCounter.hasValueAchieved(value); } if ((type & SVT_WITHOUT_LANGUAG_TAG_COUNT) != 0) { achieved &= mWithoutLanguageTagTypeCounter.hasValueAchieved(value); } return achieved; } CDatatypeValueSpaceValuesCounter::VALUES_COUNTER_TYPE CDatatypeValueSpaceStringValuesCounter::getCounterType() { return VCT_STRING_VALUE_COUNTER; } bool CDatatypeValueSpaceStringValuesCounter::combineWithValueCounter(CDatatypeValueSpaceValuesCounter* counter, cint64 additionalDiff) { bool modified = false; modified |= CDatatypeValueSpaceValuesCounter::combineWithValueCounter(counter,additionalDiff); CDatatypeValueSpaceStringValuesCounter* realCounter = dynamic_cast(counter); if (realCounter) { modified |= mWithLanguageTagTypeCounter.combineWithValueCounter(&realCounter->mWithLanguageTagTypeCounter,additionalDiff); modified |= mWithoutLanguageTagTypeCounter.combineWithValueCounter(&realCounter->mWithoutLanguageTagTypeCounter,additionalDiff); } return modified; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptSaturationDescriptor.h0000644000175000017500000000444012520551102030651 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATURATIONDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATURATIONDESCRIPTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Utilities/Container/CNegLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CConceptSaturationDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptSaturationDescriptor : public CNegLinkerBase { // public methods public: //! Constructor CConceptSaturationDescriptor(); CConceptSaturationDescriptor* initConceptSaturationDescriptor(CConcept* concept, bool negated); CConcept* getConcept(); cint64 getConceptTag(); cint64 getTerminologyTag(); CConceptSaturationDescriptor* getNextConceptDesciptor(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATURATIONDESCRIPTOR_H ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoin0000644000175000017500000000273012520551146032325 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathJoiningKeyHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathJoiningKeyHashData::CRepresentativeVariableBindingPathJoiningKeyHashData() { mVarBindPathJoiningData = nullptr; } CRepresentativeVariableBindingPathJoiningKeyHashData::CRepresentativeVariableBindingPathJoiningKeyHashData(const CRepresentativeVariableBindingPathJoiningKeyHashData& data) { mVarBindPathJoiningData = data.mVarBindPathJoiningData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningHash.cpp0000644000175000017500000000530212520551144030626 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeJoiningHash.h" #include "CRepresentativeVariableBindingPathSetData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeJoiningHash::CRepresentativeJoiningHash(CProcessContext* context) : CPROCESSHASH(context) { mContext = context; } CRepresentativeJoiningHash* CRepresentativeJoiningHash::initRepresentativeJoiningHash(CRepresentativeJoiningHash* prevHash) { if (prevHash) { *this = *prevHash; } else { CPROCESSHASH::clear(); } return this; } CRepresentativeJoiningData* CRepresentativeJoiningHash::getRepresentativeJoiningData(CRepresentativeVariableBindingPathSetData* leftRepData, CRepresentativeVariableBindingPathSetData* rightRepData, bool create) { CRepresentativeJoiningData* repJoiningData = nullptr; cint64 leftID = leftRepData->getRepresentativeID(); cint64 rightID = rightRepData->getRepresentativeID(); if (create) { CRepresentativeJoiningHashData& data = CPROCESSHASH::operator[](TRepIDPair(leftID,rightID)); repJoiningData = data.mVarBindPathJoiningData; if (!data.mVarBindPathJoiningData) { repJoiningData = CObjectParameterizingAllocator< CRepresentativeJoiningData,CProcessContext* >::allocateAndConstructAndParameterize(mContext->getUsedMemoryAllocationManager(),mContext); data.mVarBindPathJoiningData = repJoiningData; } } else { const CRepresentativeJoiningHashData& data = CPROCESSHASH::value(TRepIDPair(leftID,rightID)); repJoiningData = data.mVarBindPathJoiningData; } return repJoiningData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptPropagationBindingSetHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptPropagationBindingSetHashData.0000644000175000017500000000266612520551100032147 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptPropagationBindingSetHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptPropagationBindingSetHashData::CConceptPropagationBindingSetHashData() { mLocPropBindingSet = nullptr; mUsePropBindingSet = nullptr; } CConceptPropagationBindingSetHashData::CConceptPropagationBindingSetHashData(const CConceptPropagationBindingSetHashData& data) { mLocPropBindingSet = nullptr; mUsePropBindingSet = data.mUsePropBindingSet; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeBlockData.h0000644000175000017500000000355112520551122027614 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEBLOCKDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEBLOCKDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualNodeBlockData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeBlockData { // public methods public: //! Constructor CIndividualNodeBlockData(); //! Destructor virtual ~CIndividualNodeBlockData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEBLOCKDATA_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CImplicationReapplyConceptSaturationDescriptor.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CImplicationReapplyConceptSaturationDe0000644000175000017500000000355112520551120032365 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CImplicationReapplyConceptSaturationDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CImplicationReapplyConceptSaturationDescriptor::CImplicationReapplyConceptSaturationDescriptor() : CLinkerBase(nullptr) { mNextTriggerConcept = nullptr; } CImplicationReapplyConceptSaturationDescriptor* CImplicationReapplyConceptSaturationDescriptor::initImplicationReapllyConceptSaturationDescriptor(CConcept* implConcept, CSortedNegLinker* nextTriggerConcept) { setData(implConcept); mNextTriggerConcept = nextTriggerConcept; return this; } CConcept* CImplicationReapplyConceptSaturationDescriptor::getImplicationConcept() { return getData(); } CSortedNegLinker* CImplicationReapplyConceptSaturationDescriptor::getNextTriggerConcept() { return mNextTriggerConcept; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeBlockingTestData.cpp0000644000175000017500000000701012520551122031477 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeBlockingTestData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeBlockingTestData::CIndividualNodeBlockingTestData() { mBlockingIndiNode = nullptr; //mFirstEntailedAncestorDepth = 0; //mConceptDes = 0; } CIndividualNodeBlockingTestData::~CIndividualNodeBlockingTestData() { } CIndividualNodeBlockingTestData* CIndividualNodeBlockingTestData::initBlockData(CIndividualNodeBlockingTestData* prevBlockData) { if (prevBlockData) { mBlockingIndiNode = prevBlockData->mBlockingIndiNode; mLastAddedCoreConDes = prevBlockData->mLastAddedCoreConDes; mLastCoreBlockCandConDes = prevBlockData->mLastCoreBlockCandConDes; mLastCoreBlockCandNodeDiff = prevBlockData->mLastCoreBlockCandNodeDiff; } else { mBlockingIndiNode = nullptr; mLastAddedCoreConDes = nullptr; mLastCoreBlockCandConDes = nullptr; mLastCoreBlockCandNodeDiff = nullptr; } return this; } CIndividualProcessNode* CIndividualNodeBlockingTestData::getBlockingIndividualNode() { return mBlockingIndiNode; } CIndividualNodeBlockingTestData* CIndividualNodeBlockingTestData::clearBlockingIndividualNode() { mBlockingIndiNode = nullptr; return this; } CIndividualNodeBlockingTestData* CIndividualNodeBlockingTestData::setBlockingIndividualNode(CIndividualProcessNode* blockingIndividualNode) { mBlockingIndiNode = blockingIndividualNode; return this; } CConceptDescriptor* CIndividualNodeBlockingTestData::getLastCoreBlockingCandidateConceptDescriptor() { return mLastCoreBlockCandConDes; } CIndividualNodeBlockingTestData* CIndividualNodeBlockingTestData::setLastCoreBlockingCandidateConceptDescriptor(CConceptDescriptor* lastCoreBlockCandConDes) { mLastCoreBlockCandConDes = lastCoreBlockCandConDes; return this; } cint64 CIndividualNodeBlockingTestData::getLastCoreBlockingCandidateConceptNodeDifference() { return mLastCoreBlockCandNodeDiff; } CIndividualNodeBlockingTestData* CIndividualNodeBlockingTestData::setLastCoreBlockingCandidateConceptNodeDifference(cint64 diffCount) { mLastCoreBlockCandNodeDiff = diffCount; return this; } CCoreConceptDescriptor* CIndividualNodeBlockingTestData::getLastAddedCoreConceptDescriptor() { return mLastAddedCoreConDes; } CIndividualNodeBlockingTestData* CIndividualNodeBlockingTestData::setLastAddedCoreConceptDescriptor(CCoreConceptDescriptor* lastCoreConDes) { mLastAddedCoreConDes = lastCoreConDes; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeFloatValueSpaceData.h0000644000175000017500000000510512520551112030451 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEFLOATVALUESPACEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEFLOATVALUESPACEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeFloatValueSpaceMap.h" #include "CDatatypeCompareValueSpaceData.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceFloatType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeFloatValueSpaceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeFloatValueSpaceData : public CDatatypeCompareValueSpaceData { // public methods public: //! Constructor CDatatypeFloatValueSpaceData(CProcessContext* processContext); CDatatypeFloatValueSpaceData* copyFloatValueSpaceData(CDatatypeFloatValueSpaceData* spaceData); CDatatypeFloatValueSpaceData* initFloatValueSpaceData(CDatatypeValueSpaceFloatType* valueSpaceType); CDatatypeFloatValueSpaceMap* getFloatValueSpaceMap(bool create); // protected methods protected: virtual CDatatypeCompareValueSpaceMap* createValueSpaceMap(); // protected variables protected: CDatatypeFloatValueSpaceMap* mFloatValueSpaceMap; CDatatypeValueSpaceFloatType* mValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEFLOATVALUESPACEDATA_H ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorExtensionIndividualNodeProcessingQueue.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorExtensionIndividua0000644000175000017500000000567612520551160032514 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSOREXTENSIONINDIVIDUALNODEPROCESSINGQUEUE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSOREXTENSIONINDIVIDUALNODEPROCESSINGQUEUE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSaturationSuccessorExtensionIndividualNodeProcessingQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationSuccessorExtensionIndividualNodeProcessingQueue { // public methods public: //! Constructor CSaturationSuccessorExtensionIndividualNodeProcessingQueue(CProcessContext* processContext); CSaturationSuccessorExtensionIndividualNodeProcessingQueue* initProcessingQueue(CSaturationSuccessorExtensionIndividualNodeProcessingQueue* processingQueue); CIndividualSaturationProcessNode* takeNextToCurrentProcessIndividual(); CSaturationSuccessorExtensionIndividualNodeProcessingQueue* insertProcessIndiviudal(CIndividualSaturationProcessNode* individual); CIndividualSaturationProcessNode* getCurrentProcessIndividual(); CSaturationSuccessorExtensionIndividualNodeProcessingQueue* clearCurrentProcessIndividual(); bool isEmpty(); cint64 getQueuedIndividualCount(); bool hasQueuedIndividuals(); bool isIndividualQueued(CIndividualSaturationProcessNode *individual); CPROCESSMAP mPriorityIndiDesMap; // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CIndividualSaturationProcessNode* mCurrentIndividual; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSOREXTENSIONINDIVIDUALNODEPROCESSINGQUEUE_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeProcessingQueue.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeProcessingQue0000644000175000017500000000520112520551154032402 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEPROCESSINGQUEUE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEPROCESSINGQUEUE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualSaturationProcessNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSaturationIndividualNodeProcessingQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationIndividualNodeProcessingQueue { // public methods public: //! Constructor CSaturationIndividualNodeProcessingQueue(CProcessContext* processContext); CSaturationIndividualNodeProcessingQueue* initProcessingQueue(CSaturationIndividualNodeProcessingQueue* processingQueue); CIndividualSaturationProcessNode* takeNextProcessIndividual(); CIndividualSaturationProcessNode* getNextProcessIndividual(); CSaturationIndividualNodeProcessingQueue* insertProcessIndiviudal(CIndividualSaturationProcessNode* individual); bool isEmpty(); cint64 getQueuedIndividualCount(); bool hasQueuedIndividuals(); bool isIndividualQueued(CIndividualSaturationProcessNode *individual); CPROCESSMAP mPriorityIndiDesMap; // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEPROCESSINGQUEUE_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationVariableBindingTransitionExtension.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationVariableBindingTransitionE0000644000175000017500000001123612520551140032326 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONVARIABLEBINDINGTRANSITIONEXTENSION_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONVARIABLEBINDINGTRANSITIONEXTENSION_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CPropagationBindingDescriptor.h" #include "CVariableBindingPathDescriptor.h" #include "CVariableBindingTriggerHash.h" #include "CVariableBindingPathJoiningHash.h" // Other includes #include "Reasoner/Ontology/CVariable.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CPropagationVariableBindingTransitionExtension * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPropagationVariableBindingTransitionExtension { // public methods public: //! Constructor CPropagationVariableBindingTransitionExtension(CProcessContext* processContext); CPropagationVariableBindingTransitionExtension* initPropagationVariableBindingTransitionExtension(CPropagationVariableBindingTransitionExtension* propVarBindTransExtension); bool getLastAnalysedPropagateAllFlag(); CPropagationBindingDescriptor* getLastAnalysedPropagationBindingDescriptor(); CPropagationVariableBindingTransitionExtension* setLastAnalysedPropagationBindingDescriptor(CPropagationBindingDescriptor* lastAnalPropBindDes); CPropagationVariableBindingTransitionExtension* setLastAnalysedPropagateAllFlag(bool propagateAllFlag); CVariableBindingTriggerHash* getVariableBindingTriggerHash(bool localize = true); bool addAnalysedPropagationBindingDescriptorReturnMatched(CPropagationBindingDescriptor* propBindDes, CVariableBindingTriggerLinker** reapplyTriggerLinker = nullptr); CVariableBindingPathJoiningHash* getVariableBindingPathJoiningHash(bool localize = true); CVariableBindingPathDescriptor* getLeftLastVariableBindingPathJoiningDescriptor(); CVariableBindingPathDescriptor* getRightLastVariableBindingPathJoiningDescriptor(); CPropagationVariableBindingTransitionExtension* setLeftLastVariableBindingPathJoiningDescriptor(CVariableBindingPathDescriptor* varBindPathDes); CPropagationVariableBindingTransitionExtension* setRightLastVariableBindingPathJoiningDescriptor(CVariableBindingPathDescriptor* varBindPathDes); CPropagationVariableBindingTransitionExtension* setTriggeredVariableIndividualPair(const TVariableIndividualPair& triggeredVarIndPair); CPropagationVariableBindingTransitionExtension* setTriggeredVariableIndividualPair(CVariable* variable, CIndividualProcessNode* indiNode); TVariableIndividualPair getTriggeredVariableIndividualPair(); bool isProcessingCompleted(); CPropagationVariableBindingTransitionExtension* setProcessingCompleted(bool completed); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CPropagationBindingDescriptor* mLastAnalysedPropBindDes; bool mLastAnalysedPropagateAllFlag; bool mProcessingCompleted; CVariableBindingTriggerHash* mLocVarBindTriggerHash; CVariableBindingTriggerHash* mUseVarBindTriggerHash; TVariableIndividualPair mTriggeredVarIndPair; CVariableBindingPathJoiningHash* mUseVarBindPathJoiningHash; CVariableBindingPathJoiningHash* mLocVarBindPathJoiningHash; CVariableBindingPathDescriptor* mLeftLastVarBindPathJoiningDes; CVariableBindingPathDescriptor* mRightLastVarBindPathJoiningDes; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONVARIABLEBINDINGTRANSITIONEXTENSION_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeSuccessorExtensionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeSuccessorExte0000644000175000017500000001127512520551154032422 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationIndividualNodeSuccessorExtensionData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationIndividualNodeSuccessorExtensionData::CSaturationIndividualNodeSuccessorExtensionData(CProcessContext* processContext) { mProcessContext = processContext; } CSaturationIndividualNodeSuccessorExtensionData* CSaturationIndividualNodeSuccessorExtensionData::initExtensionData(CIndividualSaturationProcessNode* indiProcessNode) { mExtensionResolveData = nullptr; mIndiProcessNode = indiProcessNode; mALLConceptsExtensionData = nullptr; mFUNCTIONALConceptsExtensionData = nullptr; mAncSuccMergeResolveData = nullptr; mExtensionProcessingQueued = false; return this; } CSaturationIndividualNodeExtensionResolveData* CSaturationIndividualNodeSuccessorExtensionData::getExtensionResolveData() { return mExtensionResolveData; } CSaturationIndividualNodeSuccessorExtensionData* CSaturationIndividualNodeSuccessorExtensionData::setExtensionResolveData(CSaturationIndividualNodeExtensionResolveData* resolveData) { mExtensionResolveData = resolveData; return this; } bool CSaturationIndividualNodeSuccessorExtensionData::isExtensionProcessingQueued() { return mExtensionProcessingQueued; } CSaturationIndividualNodeSuccessorExtensionData* CSaturationIndividualNodeSuccessorExtensionData::setExtensionProcessingQueued(bool queued) { mExtensionProcessingQueued = queued; return this; } CSaturationIndividualNodeExtensionResolveData* CSaturationIndividualNodeSuccessorExtensionData::getAncestorSuccessorMergeResolveData(bool create) { if (!mAncSuccMergeResolveData && create) { mAncSuccMergeResolveData = CObjectParameterizingAllocator< CSaturationIndividualNodeExtensionResolveData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mAncSuccMergeResolveData->initExtensionResolveData(mIndiProcessNode); } return mAncSuccMergeResolveData; } CSaturationIndividualNodeExtensionResolveData* CSaturationIndividualNodeSuccessorExtensionData::getBaseExtensionResolveData(bool create) { if (!mExtensionResolveData && create) { mExtensionResolveData = CObjectParameterizingAllocator< CSaturationIndividualNodeExtensionResolveData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mExtensionResolveData->initExtensionResolveData(mIndiProcessNode); } return mExtensionResolveData; } CSaturationIndividualNodeALLConceptsExtensionData* CSaturationIndividualNodeSuccessorExtensionData::getALLConceptsExtensionData(bool create) { if (!mALLConceptsExtensionData && create) { mALLConceptsExtensionData = CObjectParameterizingAllocator< CSaturationIndividualNodeALLConceptsExtensionData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mALLConceptsExtensionData->initALLConceptsExtensionData(mIndiProcessNode); } return mALLConceptsExtensionData; } CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* CSaturationIndividualNodeSuccessorExtensionData::getFUNCTIONALConceptsExtensionData(bool create) { if (!mFUNCTIONALConceptsExtensionData && create) { mFUNCTIONALConceptsExtensionData = CObjectParameterizingAllocator< CSaturationIndividualNodeFUNCTIONALConceptsExtensionData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mFUNCTIONALConceptsExtensionData->initFUNCTIONALConceptsExtensionData(mIndiProcessNode); } return mFUNCTIONALConceptsExtensionData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeCompareValueData.h0000644000175000017500000000564512520551106030032 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeCompareValueDataExclusion.h" // Other includes #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDataLiteralCompareValue.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CDatatypeCompareValueData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeCompareValueData { // public methods public: //! Constructor CDatatypeCompareValueData(CProcessContext* processContext); CDatatypeCompareValueData* initCompareValueData(CDatatypeCompareValueData* valueData, CDataLiteralCompareValue* value); CDatatypeCompareValueData* initCompareValueData(CDataLiteralCompareValue* value); CDatatypeCompareValueDataExclusion* getValueExclusionData(); CDatatypeCompareValueDataExclusion* getLeftExclusionData(); CDatatypeCompareValueDataExclusion* getRightExclusionData(); CDataLiteralCompareValue* getValue(); CDatatypeCompareValueData* setValue(CDataLiteralCompareValue* value); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CDataLiteralCompareValue* mValue; CDatatypeCompareValueDataExclusion mValueExclusionData; CDatatypeCompareValueDataExclusion mLeftExclusionData; CDatatypeCompareValueDataExclusion mRightExclusionData; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceData.cpp0000644000175000017500000000546012520551112030626 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeRealValueSpaceData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeRealValueSpaceData::CDatatypeRealValueSpaceData(CProcessContext* processContext) : CDatatypeValueSpaceData(processContext),mProcessContext(processContext) { mValueSpaceMap = nullptr; } CDatatypeRealValueSpaceData* CDatatypeRealValueSpaceData::initRealValueSpaceData(CDatatypeValueSpaceRealType* valueSpaceType) { CDatatypeValueSpaceData::initValueSpaceData(nullptr); mValueSpaceType = valueSpaceType; if (mValueSpaceMap) { mValueSpaceMap->initDatatypeRealValueSpaceMap(valueSpaceType); } return this; } CDatatypeRealValueSpaceData* CDatatypeRealValueSpaceData::copyRealValueSpaceData(CDatatypeRealValueSpaceData* spaceData) { CDatatypeValueSpaceData::initValueSpaceData(spaceData); mValueSpaceType = spaceData->mValueSpaceType; if (spaceData->mValueSpaceMap && !mValueSpaceMap) { getValueSpaceMap(true); mValueSpaceMap->initDatatypeRealValueSpaceMap(spaceData->mValueSpaceMap); } else if (mValueSpaceMap) { if (spaceData->mValueSpaceMap) { mValueSpaceMap->initDatatypeRealValueSpaceMap(spaceData->mValueSpaceMap); } else { mValueSpaceMap->initDatatypeRealValueSpaceMap(mValueSpaceType); } } return this; } bool CDatatypeRealValueSpaceData::hasValueSpaceMap() { return mValueSpaceMap; } CDatatypeRealValueSpaceMap* CDatatypeRealValueSpaceData::getValueSpaceMap(bool create) { if (create && !mValueSpaceMap) { mValueSpaceMap = CObjectParameterizingAllocator< CDatatypeRealValueSpaceMap,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mValueSpaceMap->initDatatypeRealValueSpaceMap(mValueSpaceType); } return mValueSpaceMap; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeData.h0000644000175000017500000000571112520551156032056 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONNOMINALDEPENDENTNODEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONNOMINALDEPENDENTNODEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CIndividualSaturationProcessNode.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationNominalDependentNodeData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNominalDependentNodeData : public CLinkerBase { // public methods public: //! Constructor CSaturationNominalDependentNodeData(CProcessContext* processContext); enum NOMINALCONNECTIONTYPE { NONECONNECTION, VALUECONNECTION, NOMINALCONNECTION }; CSaturationNominalDependentNodeData* initNominalDependentNodeData(CIndividualSaturationProcessNode* indiSatProcData, NOMINALCONNECTIONTYPE connectionType); NOMINALCONNECTIONTYPE getNominalConnectionType(); CSaturationNominalDependentNodeData* setNominalConnectionType(NOMINALCONNECTIONTYPE connectionType); CSaturationNominalDependentNodeData* getNextNominalConnectionTypeData(); CIndividualSaturationProcessNode* getDependentIndividualSaturationNode(); CSaturationNominalDependentNodeData* setDependentIndividualSaturationNode(CIndividualSaturationProcessNode* indiSatNode); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; NOMINALCONNECTIONTYPE mConnectionType; CIndividualSaturationProcessNode* mIndiSatProcData; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONNOMINALDEPENDENTNODEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBackwardPropagationLink.cpp0000644000175000017500000000331012520551070030237 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackwardPropagationLink.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBackwardPropagationLink::CBackwardPropagationLink() { mRole = nullptr; mSourceIndividual = nullptr; } CBackwardPropagationLink* CBackwardPropagationLink::initBackwardPropagationLink(CIndividualProcessNode* sourceIndividual, CRole* role) { mRole = role; mSourceIndividual = sourceIndividual; return this; } CRole* CBackwardPropagationLink::getLinkRole() { return mRole; } CBackwardPropagationLink* CBackwardPropagationLink::setLinkRole(CRole* role) { mRole = role; return this; } CIndividualProcessNode* CBackwardPropagationLink::getSourceIndividual() { return mSourceIndividual; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CLocalizationTag.cpp0000644000175000017500000000614712520551132026575 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLocalizationTag.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CLocalizationTag::CLocalizationTag(cint64 localizationTag) : CProcessTag(localizationTag) { mRelocalized = false; } cint64 CLocalizationTag::getLocalizationTag() { return CProcessTag::getProcessTag(); } CLocalizationTag* CLocalizationTag::setLocalizationTag(cint64 localizationTag) { CProcessTag::setProcessTag(localizationTag); return this; } CLocalizationTag* CLocalizationTag::setLocalizationTag(CProcessTagger* processTagger) { return setLocalizationTag(processTagger->getCurrentLocalizationTag()); } CLocalizationTag* CLocalizationTag::initLocalizationTag(cint64 localizationTag) { CProcessTag::initProcessTag(localizationTag); return this; } CLocalizationTag* CLocalizationTag::initLocalizationTag(CProcessTagger* processTagger) { return initLocalizationTag(processTagger->getCurrentLocalizationTag()); } bool CLocalizationTag::isLocalizationTagUpdated(cint64 localizationTag) { return CProcessTag::isProcessTagUpdated(localizationTag); } bool CLocalizationTag::isLocalizationTagUpToDate(cint64 localizationTag) { return CProcessTag::isProcessTagUpToDate(localizationTag); } bool CLocalizationTag::updateLocalizationTag(cint64 localizationTag) { return CProcessTag::updateProcessTag(localizationTag); } bool CLocalizationTag::updateLocalizationTag(CProcessTagger* processTagger) { return updateLocalizationTag(processTagger->getCurrentLocalizationTag()); } bool CLocalizationTag::isLocalizationTagUpdated(CProcessTagger* processTagger) { return isLocalizationTagUpdated(processTagger->getCurrentLocalizationTag()); } bool CLocalizationTag::isLocalizationTagUpToDate(CProcessTagger* processTagger) { return isLocalizationTagUpToDate(processTagger->getCurrentLocalizationTag()); } bool CLocalizationTag::isRelocalized() { return mRelocalized; } CLocalizationTag* CLocalizationTag::setRelocalized(bool relocalized) { if (mRelocalized != relocalized) { mRelocalized = relocalized; } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeDoubleValueSpaceMap.h0000644000175000017500000000521312520551112030462 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDOUBLEVALUESPACEMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDOUBLEVALUESPACEMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeCompareValueSpaceMap.h" // Other includes #include "Reasoner/Ontology/CDataLiteralDoubleValue.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeDoubleValueSpaceMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeDoubleValueSpaceMap : public CDatatypeCompareValueSpaceMap { // public methods public: //! Constructor CDatatypeDoubleValueSpaceMap(CProcessContext* processContext); // protected methods protected: virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* value); virtual bool getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom); virtual bool getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast); virtual cuint64 getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); bool isNaN(cint64 bits); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDOUBLEVALUESPACEMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyQueue.h0000644000175000017500000000511412520551142025571 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYQUEUE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYQUEUE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CReapplyConceptDescriptor.h" #include "CReapplyQueueIterator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { //#define KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_REAPPLY_QUEUE_COUNT /*! * * \class CReapplyQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReapplyQueue { // public methods public: //! Constructor CReapplyQueue(); #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_REAPPLY_QUEUE_COUNT qint64 getReapplyCount(); #endif bool isEmpty(); bool hasConceptDescriptor(CConceptDescriptor* conceptDescriptor); CReapplyQueue* initReapplyQueue(CReapplyQueue* prevReapplyQueue); CReapplyQueueIterator getIterator(bool clearDynamicReapplyQueue = true); CReapplyQueue* addReapplyConceptDescriptor(CReapplyConceptDescriptor *conProDes); // protected methods protected: // protected variables protected: CReapplyConceptDescriptor* mStaticReapplyDesLinker; CReapplyConceptDescriptor* mDynamicReapplyDesLinker; #ifdef KONCLUDE_EMPLOY_REASONER_KERNEL_PROCESS_REAPPLY_QUEUE_COUNT cint64 mDesStaticCount; cint64 mDesDynamicCount; #endif // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYQUEUE_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateHash.c0000644000175000017500000000722212520551072032117 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBlockingIndividualNodeCandidateHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBlockingIndividualNodeCandidateHash::CBlockingIndividualNodeCandidateHash(CProcessContext* context) : mContext(context) { mMemMan = mContext->getUsedMemoryAllocationManager(); mBlockCandidateHash = nullptr; mUseBlockCandidateHash = nullptr; mPrevBlockCandidateHash = nullptr; } CBlockingIndividualNodeCandidateHash::~CBlockingIndividualNodeCandidateHash() { } CBlockingIndividualNodeCandidateHash* CBlockingIndividualNodeCandidateHash::initBlockingIndividualNodeCandidateHash(CBlockingIndividualNodeCandidateHash* prevBlockCandHash) { mBlockCandidateHash = nullptr; if (prevBlockCandHash) { mPrevBlockCandidateHash = prevBlockCandHash->mUseBlockCandidateHash; mUseBlockCandidateHash = mPrevBlockCandidateHash; } else { mPrevBlockCandidateHash = nullptr; mUseBlockCandidateHash = nullptr; } return this; } CBlockingIndividualNodeCandidateData* CBlockingIndividualNodeCandidateHash::getBlockingIndividualCandidateData(CConcept* initializationConcept, bool conceptNegation, bool create) { if (!mUseBlockCandidateHash || !mBlockCandidateHash && create) { mBlockCandidateHash = CObjectParameterizingAllocator< CPROCESSHASH< QPair ,CBlockingCandidateHashData>,CContext* >::allocateAndConstructAndParameterize(mMemMan,mContext); if (mPrevBlockCandidateHash) { *mBlockCandidateHash = *mPrevBlockCandidateHash; } mUseBlockCandidateHash = mBlockCandidateHash; } if (create) { CBlockingCandidateHashData& data = (*mUseBlockCandidateHash)[QPair(initializationConcept,conceptNegation)]; if (!data.mCandidateIndiData) { data.mCandidateIndiData = CObjectParameterizingAllocator< CBlockingIndividualNodeCandidateData,CProcessContext* >::allocateAndConstructAndParameterize(mMemMan,mContext); data.mCandidateIndiData->initBlockingCandidateData(data.mPrevCandidateIndiData); data.mPrevCandidateIndiData = data.mCandidateIndiData; } return data.mPrevCandidateIndiData; } else { CBlockingCandidateHashData* data = nullptr; if (mUseBlockCandidateHash->tryGetValuePointer(QPair(initializationConcept,conceptNegation),data)) { return data->mPrevCandidateIndiData; } } return nullptr; } CBlockingIndividualNodeCandidateData* CBlockingIndividualNodeCandidateHash::getBlockingIndividualCandidateData(CConceptDescriptor* initializationConDes, bool create) { return getBlockingIndividualCandidateData(initializationConDes->getConcept(),initializationConDes->getNegation(),create); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalIndividualNodeProcessingQueue.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalIndividualNodeProcessingQueue0000644000175000017500000000300412520551104032327 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCriticalIndividualNodeProcessingQueue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CCriticalIndividualNodeProcessingQueue::CCriticalIndividualNodeProcessingQueue(CProcessContext* processContext) : CSaturationIndividualNodeProcessingQueue(processContext) { } CCriticalIndividualNodeProcessingQueue* CCriticalIndividualNodeProcessingQueue::initProcessingQueue(CCriticalIndividualNodeProcessingQueue* processingQueue) { CSaturationIndividualNodeProcessingQueue::initProcessingQueue(processingQueue); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeDoubleValueSpaceMap.cpp0000644000175000017500000001354312520551112031022 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeDoubleValueSpaceMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeDoubleValueSpaceMap::CDatatypeDoubleValueSpaceMap(CProcessContext* processContext) : CDatatypeCompareValueSpaceMap(processContext) { } bool CDatatypeDoubleValueSpaceMap::representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { return false; } bool CDatatypeDoubleValueSpaceMap::representsInfinitelyManyValues(CDataLiteralCompareValue* value) { return false; } bool CDatatypeDoubleValueSpaceMap::getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom) { CDataLiteralDoubleValue* doubleValueCopyInto = dynamic_cast(valueCopyInto); CDataLiteralDoubleValue* doubleValueCopyFrom = dynamic_cast(valueCopyFrom); doubleValueCopyInto->initValue(doubleValueCopyFrom); return true; } bool CDatatypeDoubleValueSpaceMap::isNaN(cint64 bits) { return ((bits & Q_UINT64_C(0x7ff0000000000000)) == Q_UINT64_C(0x7ff0000000000000)) && ((bits & Q_UINT64_C(0x000fffffffffffff)) != 0); } bool CDatatypeDoubleValueSpaceMap::getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast) { CDataLiteralDoubleValue* doubleValueNext = dynamic_cast(valueNext); CDataLiteralDoubleValue* doubleValueLast = dynamic_cast(valueLast); double nextDoubleValue = 0.; double lastDoubleValue = doubleValueLast->getDouble(); cint64 bits = *reinterpret_cast(&lastDoubleValue); cint64 magnitude = (bits & Q_UINT64_C(0x7fffffffffffffff)); bool positive = ((bits & Q_UINT64_C(0x8000000000000000))==0); // The successors of NaN and +INF are these numbers themselves. if (isNaN(bits) || (magnitude == Q_UINT64_C(0x7ff0000000000000) && positive)) { doubleValueNext->initValueFromDouble(lastDoubleValue); } else { bool newPositive; cint64 newMagnitude; if (positive) { newPositive = true; newMagnitude = magnitude+1; } else if (!positive && magnitude == 0) { // The successor of -0 is +0 newPositive = true; newMagnitude = 1; // skip +0 for now } else { // if (!positive && magnitude != 0) newPositive = false; newMagnitude = magnitude-1; } cint64 newBits = newMagnitude | (newPositive ? 0 : Q_UINT64_C(0x8000000000000000)); nextDoubleValue = *reinterpret_cast(&newBits); doubleValueNext->initValueFromDouble(nextDoubleValue); return true; } return false; } cuint64 CDatatypeDoubleValueSpaceMap::getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { CDataLiteralDoubleValue* doubleValueLeft = dynamic_cast(leftValueExcluded); CDataLiteralDoubleValue* doubleValueRight = dynamic_cast(rightValueExcluded); double leftDoubleValue = doubleValueLeft->getDouble(); double rightDoubleValue = doubleValueRight->getDouble(); cint64 bitsLowerBoundExclusive = *reinterpret_cast(&leftDoubleValue); cint64 bitsUpperBoundExclusive = *reinterpret_cast(&rightDoubleValue); if (isNaN(bitsLowerBoundExclusive) || isNaN(bitsUpperBoundExclusive)) return 0; cuint64 valueCount = 0; bool positiveLowerBoundExclusive = ((bitsLowerBoundExclusive & Q_UINT64_C(0x8000000000000000))==0); bool positiveUpperBoundExclusive = ((bitsUpperBoundExclusive & Q_UINT64_C(0x8000000000000000))==0); cint64 magnitudeLowerBoundExclusive = (bitsLowerBoundExclusive & Q_UINT64_C(0x7fffffffffffffff)); cint64 magnitudeUpperBoundExclusive = (bitsUpperBoundExclusive & Q_UINT64_C(0x7fffffffffffffff)); // Determine the number of elements. This works even if 'lowerBoundExclusive' or 'upperBoundExclusive' is +INF or -INF if (positiveLowerBoundExclusive && positiveUpperBoundExclusive) { // it must be that magnitudeLowerBoundExclusive < magnitudeUpperBoundExclusive valueCount = magnitudeUpperBoundExclusive-magnitudeLowerBoundExclusive-1; } else if (!positiveLowerBoundExclusive && !positiveUpperBoundExclusive) { // it must be that magnitudeUpperBoundExclusive < magnitudeLowerBoundExclusive valueCount = magnitudeLowerBoundExclusive-magnitudeUpperBoundExclusive-1; } else if (!positiveLowerBoundExclusive && positiveUpperBoundExclusive) { // the number of values from 'lowerBoundExclusive' to -0 cuint64 startToMinusZero = magnitudeLowerBoundExclusive; // the number of values from +0 to 'upperBoundExclusive' cint64 plusZeroToEnd = magnitudeUpperBoundExclusive; valueCount = startToMinusZero+plusZeroToEnd -1; // extra -1 to count +0/-0 only once for now } return valueCount; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateData.c0000644000175000017500000000565312520551072032113 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBlockingIndividualNodeCandidateData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBlockingIndividualNodeCandidateData::CBlockingIndividualNodeCandidateData(CProcessContext* context) : mContext(context),mCandidateIndiMap(context) { mMemMan = mContext->getUsedMemoryAllocationManager(); } CBlockingIndividualNodeCandidateData::~CBlockingIndividualNodeCandidateData() { } CBlockingIndividualNodeCandidateData* CBlockingIndividualNodeCandidateData::initBlockingCandidateData(CBlockingIndividualNodeCandidateData* prevBlockCandHash) { if (prevBlockCandHash) { mCandidateIndiMap = prevBlockCandHash->mCandidateIndiMap; mMaxValidIndividualID = prevBlockCandHash->mMaxValidIndividualID; } else { mMaxValidIndividualID = -1; mCandidateIndiMap.clear(); } return this; } CBlockingIndividualNodeCandidateData* CBlockingIndividualNodeCandidateData::insertBlockingCandidateIndividualNode(CIndividualProcessNode* candidateIndi) { cint64 candidateIndividualID = candidateIndi->getIndividualID(); mCandidateIndiMap.insert(-candidateIndividualID,candidateIndi); return this; } CBlockingIndividualNodeCandidateIterator CBlockingIndividualNodeCandidateData::getBlockingCandidatesIndividualNodeIterator(cint64 candidateIndividualID) { return CBlockingIndividualNodeCandidateIterator(&mCandidateIndiMap,candidateIndividualID); } CBlockingIndividualNodeCandidateIterator CBlockingIndividualNodeCandidateData::getBlockingCandidatesIndividualNodeIterator(CIndividualProcessNode* candidateIndi) { return getBlockingCandidatesIndividualNodeIterator(candidateIndi->getIndividualID()); } cint64 CBlockingIndividualNodeCandidateData::getMaxValidIndividualID() { return mMaxValidIndividualID; } CBlockingIndividualNodeCandidateData* CBlockingIndividualNodeCandidateData::setMaxValidIndividualID(cint64 indiID) { mMaxValidIndividualID = indiID; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceMap.cpp0000644000175000017500000012630412520551110031174 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeCompareValueSpaceMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeCompareValueSpaceMap::CDatatypeCompareValueSpaceMap(CProcessContext* processContext) : CPROCESSMAP(processContext),mProcessContext(processContext) { } CDatatypeCompareValueSpaceMap* CDatatypeCompareValueSpaceMap::initDatatypeCompareValueSpaceMap(CDatatypeCompareValueSpaceMap* map) { if (map) { *this = *map; mAbsoluteMinimumExclusionValue = map->mAbsoluteMinimumExclusionValue; mAbsoluteMaximumExclusionValue = map->mAbsoluteMaximumExclusionValue; } return this; } CDatatypeCompareValueSpaceMap* CDatatypeCompareValueSpaceMap::initDatatypeCompareValueSpaceMap(CDatatypeValueSpaceCompareType* valueSpaceType) { CPROCESSMAP::clear(); mAbsoluteMinimumExclusionValue = nullptr; mAbsoluteMaximumExclusionValue = nullptr; excludeMinimum(valueSpaceType->getMinimumDataLiteralCompareValue(),false,nullptr); excludeMaximum(valueSpaceType->getMaximumDataLiteralCompareValue(),false,nullptr); return this; } bool CDatatypeCompareValueSpaceMap::getAbsoluteMinimumValue(CDataLiteralCompareValue*& minValue, bool& minValueInclusive, CDependencyTrackPoint** depTrackPoint) { if (mAbsoluteMinimumExclusionValue) { minValue = mAbsoluteMinimumExclusionValue->getValue(); minValueInclusive = true; if (depTrackPoint) { *depTrackPoint = mAbsoluteMinimumExclusionValue->getLeftExclusionData()->getExcludedDependencyTrackPoint(); } if (mAbsoluteMinimumExclusionValue->getValueExclusionData()->isExcluded()) { if (mAbsoluteMinimumExclusionValue->getValueExclusionData()->getExcludedDependencyTrackPoint() == mAbsoluteMinimumExclusionValue->getLeftExclusionData()->getExcludedDependencyTrackPoint()) { minValueInclusive = false; } } return true; } return false; } bool CDatatypeCompareValueSpaceMap::getAbsoluteMaximumValue(CDataLiteralCompareValue*& maxValue, bool& maxValueInclusive, CDependencyTrackPoint** depTrackPoint) { if (mAbsoluteMaximumExclusionValue) { maxValue = mAbsoluteMaximumExclusionValue->getValue(); maxValueInclusive = true; if (depTrackPoint) { *depTrackPoint = mAbsoluteMaximumExclusionValue->getRightExclusionData()->getExcludedDependencyTrackPoint(); } if (mAbsoluteMaximumExclusionValue->getValueExclusionData()->isExcluded()) { if (mAbsoluteMaximumExclusionValue->getValueExclusionData()->getExcludedDependencyTrackPoint() == mAbsoluteMaximumExclusionValue->getRightExclusionData()->getExcludedDependencyTrackPoint()) { maxValueInclusive = false; } } return true; } return false; } bool CDatatypeCompareValueSpaceMap::excludeMinimum(CDataLiteralCompareValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint) { if (mAbsoluteMinimumExclusionValue) { if (mAbsoluteMinimumExclusionValue->getValue()->isGreaterThan(value)) { return nullptr; } } bool newValuesPotentiallyExcluded = false; CDatatypeCompareValueData* valueData = getDatatypeCompareValueData(value,true); newValuesPotentiallyExcluded |= excludeLeftDataInterval(valueData,depTrackPoint,true); if (valueInclusively && !isDataValueExcluded(valueData)) { newValuesPotentiallyExcluded |= excludeDataValue(valueData,depTrackPoint,false); } mAbsoluteMinimumExclusionValue = valueData; // remove all lower values from map CDatatypeCompareValueSpaceMap::iterator it = CDatatypeCompareValueSpaceMap::begin(), itEnd = CDatatypeCompareValueSpaceMap::end(); while (it != itEnd) { const CDatatypeCompareValueSpaceMapData& mapData = it.value(); CDatatypeCompareValueData* itValueData = mapData.mUseValue; if (itValueData == valueData) { break; } newValuesPotentiallyExcluded = true; it = CDatatypeCompareValueSpaceMap::erase(it); } return newValuesPotentiallyExcluded; } bool CDatatypeCompareValueSpaceMap::excludeMaximum(CDataLiteralCompareValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint) { if (mAbsoluteMaximumExclusionValue) { if (mAbsoluteMaximumExclusionValue->getValue()->isLessThan(value)) { return false; } } bool newValuesPotentiallyExcluded = false; CDatatypeCompareValueData* valueData = getDatatypeCompareValueData(value,true); newValuesPotentiallyExcluded |= excludeRightDataInterval(valueData,depTrackPoint,true); if (valueInclusively && !isDataValueExcluded(valueData)) { newValuesPotentiallyExcluded |= excludeDataValue(valueData,depTrackPoint,false); } mAbsoluteMaximumExclusionValue = valueData; // remove all higher values from map CDatatypeCompareValueSpaceMapArranger mapValueArranger(value); CDatatypeCompareValueSpaceMap::iterator itBegin = CDatatypeCompareValueSpaceMap::begin(), itUB = CDatatypeCompareValueSpaceMap::upperBound(mapValueArranger), itEnd = CDatatypeCompareValueSpaceMap::end(); CDatatypeCompareValueSpaceMap::iterator it = itUB; while (it != itEnd) { const CDatatypeCompareValueSpaceMapData& mapData = it.value(); CDatatypeCompareValueData* itValueData = mapData.mUseValue; newValuesPotentiallyExcluded = true; it = CDatatypeCompareValueSpaceMap::erase(it); } return newValuesPotentiallyExcluded; } bool CDatatypeCompareValueSpaceMap::excludeAll(CDependencyTrackPoint* depTrackPoint) { bool newValuesPotentiallyExcluded = false; CDatatypeCompareValueSpaceMap::iterator itBegin = CDatatypeCompareValueSpaceMap::begin(), itEnd = CDatatypeCompareValueSpaceMap::end(); CDatatypeCompareValueSpaceMap::iterator it = itBegin; while (it != itEnd) { CDatatypeCompareValueSpaceMapData& mapData = it.value(); CDatatypeCompareValueData* itValueData = mapData.mUseValue; if (it == itBegin) { if (!isLeftDataIntervalExcluded(itValueData)) { itValueData = getDatatypeCompareValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(itValueData,depTrackPoint,false); } if (!isDataValueExcluded(itValueData)) { itValueData = getDatatypeCompareValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeDataValue(itValueData,depTrackPoint,false); } } ++it; if (it != itEnd) { CDatatypeCompareValueSpaceMapData& nextMapData = it.value(); CDatatypeCompareValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData)) { itValueData = getDatatypeCompareValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeRightDataInterval(itValueData,depTrackPoint,false); nextValueData = getDatatypeCompareValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(nextValueData,depTrackPoint,false); } if (!isDataValueExcluded(nextValueData)) { nextValueData = getDatatypeCompareValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeDataValue(nextValueData,depTrackPoint,false); } } else { if (!isRightDataIntervalExcluded(itValueData)) { itValueData = getDatatypeCompareValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeRightDataInterval(itValueData,depTrackPoint,false); } } } return newValuesPotentiallyExcluded; } bool CDatatypeCompareValueSpaceMap::excludeInterval(CDataLiteralCompareValue* leftValue, bool leftValueInclusive, CDataLiteralCompareValue* rightValue, bool rightValueInclusive, CDependencyTrackPoint* depTrackPoint) { bool newValuesPotentiallyExcluded = false; CDatatypeCompareValueData* leftValueData = getDatatypeCompareValueData(leftValue,true); CDatatypeCompareValueData* rightValueData = getDatatypeCompareValueData(rightValue,true); if (leftValueInclusive && !isDataValueExcluded(leftValueData)) { newValuesPotentiallyExcluded |= excludeDataValue(leftValueData,depTrackPoint,false); } if (leftValueInclusive && !isDataValueExcluded(rightValueData)) { newValuesPotentiallyExcluded |= excludeDataValue(rightValueData,depTrackPoint,false); } CDatatypeCompareValueSpaceMapArranger mapValueArranger(leftValue); CDatatypeCompareValueSpaceMap::iterator itBegin = CDatatypeCompareValueSpaceMap::begin(), itLB = CDatatypeCompareValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeCompareValueSpaceMap::end(); CDatatypeCompareValueSpaceMap::iterator it = itLB; while (it != itEnd) { CDatatypeCompareValueSpaceMapData& mapData = it.value(); CDatatypeCompareValueData* itValueData = mapData.mUseValue; ++it; if (it != itEnd) { CDatatypeCompareValueSpaceMapData& nextMapData = it.value(); CDatatypeCompareValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData)) { itValueData = getDatatypeCompareValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeRightDataInterval(itValueData,depTrackPoint,false); nextValueData = getDatatypeCompareValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(nextValueData,depTrackPoint,false); } if (nextValueData == rightValueData) { break; } if (!isDataValueExcluded(nextValueData)) { nextValueData = getDatatypeCompareValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeDataValue(nextValueData,depTrackPoint,false); } } } return newValuesPotentiallyExcluded; } bool CDatatypeCompareValueSpaceMap::countDataIntervalValues(CDatatypeCompareValueData* leftValueExcluded, CDatatypeCompareValueData* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter) { return countDataIntervalValues(leftValueExcluded->getValue(),rightValueExcluded->getValue(),leftValueExcluded->getRightExclusionData(),counter); } bool CDatatypeCompareValueSpaceMap::countDataIntervalValues(CDataLiteralCompareValue* leftValueExcluded, CDatatypeCompareValueData* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter) { return countDataIntervalValues(leftValueExcluded,rightValueExcluded->getValue(),rightValueExcluded->getLeftExclusionData(),counter); } bool CDatatypeCompareValueSpaceMap::countDataIntervalValues(CDatatypeCompareValueData* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter) { return countDataIntervalValues(leftValueExcluded->getValue(),rightValueExcluded,leftValueExcluded->getRightExclusionData(),counter); } bool CDatatypeCompareValueSpaceMap::countDataIntervalValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded, CDatatypeCompareValueDataExclusion* exlcusionData, CDatatypeValueSpaceValuesCounter* counter) { bool counted = false; if (!exlcusionData->isExcluded()) { if (representsInfinitelyManyValues(leftValueExcluded) || representsInfinitelyManyValues(rightValueExcluded) || representsInfinitelyManyValues(leftValueExcluded,rightValueExcluded)) { counted |= counter->incInfinite(); } else { cuint64 valueCount = getIntervalValueCount(leftValueExcluded,rightValueExcluded); counted |= counter->incValueCount(valueCount); } } return counted; } bool CDatatypeCompareValueSpaceMap::countDataValue(CDatatypeCompareValueData* dataValue, CDatatypeValueSpaceValuesCounter* counter) { return countDataValue(dataValue->getValue(),dataValue->getValueExclusionData(),counter); } bool CDatatypeCompareValueSpaceMap::countDataValue(CDataLiteralCompareValue* value, CDatatypeCompareValueDataExclusion* exlcusionData, CDatatypeValueSpaceValuesCounter* counter) { bool counted = false; if (!exlcusionData->isExcluded()) { if (representsInfinitelyManyValues(value)) { counted |= counter->incInfinite(); } else { counted |= counter->incValueCount(1); } } return counted; } bool CDatatypeCompareValueSpaceMap::countValueValues(CDataLiteralCompareValue* value, CDatatypeValueSpaceValuesCounter* counter) { bool counted = false; if (mAbsoluteMinimumExclusionValue) { if (value->isLessThan(mAbsoluteMinimumExclusionValue->getValue())) { return false; } } if (mAbsoluteMaximumExclusionValue) { if (value->isGreaterThan(mAbsoluteMaximumExclusionValue->getValue())) { return false; } } CDatatypeCompareValueSpaceMapArranger mapValueArranger(value); CDatatypeCompareValueSpaceMap::iterator itBegin = CDatatypeCompareValueSpaceMap::begin(), itLB = CDatatypeCompareValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeCompareValueSpaceMap::end(); CDatatypeCompareValueSpaceMap::iterator it = itLB; if (it != itEnd) { CDatatypeCompareValueSpaceMapData& mapData = it.value(); CDatatypeCompareValueData* itValueData = mapData.mUseValue; if (value->isEqualTo(itValueData->getValue())) { if (!isDataValueExcluded(itValueData)) { counted |= countDataValue(itValueData,counter); } } else { if (!isDataValueExcluded(value)) { counted |= countDataValue(value,itValueData->getLeftExclusionData(),counter); } } } return counted; } bool CDatatypeCompareValueSpaceMap::addIntervalExclusionDependencies(CDataLiteralCompareValue* leftValue, bool leftValueInclusive, CDataLiteralCompareValue* rightValue, bool rightValueInclusive, CDatatypeValueSpaceDependencyCollector* depCollector) { if (mAbsoluteMinimumExclusionValue) { if (leftValue->isLessThan(mAbsoluteMinimumExclusionValue->getValue())) { leftValue = mAbsoluteMinimumExclusionValue->getValue(); } } if (mAbsoluteMaximumExclusionValue) { if (rightValue->isGreaterThan(mAbsoluteMaximumExclusionValue->getValue())) { rightValue = mAbsoluteMaximumExclusionValue->getValue(); } } if (leftValue->isGreaterThan(rightValue)) { return false; } else if (leftValue->isEqualTo(rightValue)) { if (!leftValueInclusive && !rightValueInclusive) { return false; } } bool depAdded = false; CDatatypeCompareValueSpaceMapArranger mapValueArranger(leftValue); CDatatypeCompareValueSpaceMap::iterator itBegin = CDatatypeCompareValueSpaceMap::begin(), itLB = CDatatypeCompareValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeCompareValueSpaceMap::end(); CDatatypeCompareValueSpaceMap::iterator it = itLB; while (it != itEnd) { CDatatypeCompareValueSpaceMapData& mapData = it.value(); CDatatypeCompareValueData* itValueData = mapData.mUseValue; if (it == itLB) { if (leftValue->isEqualTo(itValueData->getValue())) { if (leftValueInclusive) { depAdded |= addDataValueExclusionDependencies(itValueData,depCollector); } } else { depAdded |= addExclusionDependencies(itValueData->getLeftExclusionData(),depCollector); } } ++it; if (it != itEnd) { CDatatypeCompareValueSpaceMapData& nextMapData = it.value(); CDatatypeCompareValueData* nextValueData = nextMapData.mUseValue; depAdded |= addDataIntervalExclusionDependencies(itValueData,nextValueData,depCollector); if (nextValueData->getValue()->isEqualTo(rightValue)) { if (rightValueInclusive) { depAdded |= addDataValueExclusionDependencies(nextValueData,depCollector); } break; } else if (nextValueData->getValue()->isGreaterThan(rightValue)) { depAdded |= addExclusionDependencies(itValueData->getRightExclusionData(),depCollector); break; } depAdded |= addDataValueExclusionDependencies(nextValueData,depCollector); } } return depAdded; } bool CDatatypeCompareValueSpaceMap::addValueExclusionDependencies(CDataLiteralCompareValue* value, CDatatypeValueSpaceDependencyCollector* depCollector) { if (mAbsoluteMinimumExclusionValue) { if (value->isLessThan(mAbsoluteMinimumExclusionValue->getValue())) { return false; } } if (mAbsoluteMaximumExclusionValue) { if (value->isGreaterThan(mAbsoluteMaximumExclusionValue->getValue())) { return false; } } bool depAdded = false; CDatatypeCompareValueSpaceMapArranger mapValueArranger(value); CDatatypeCompareValueSpaceMap::iterator itBegin = CDatatypeCompareValueSpaceMap::begin(), itLB = CDatatypeCompareValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeCompareValueSpaceMap::end(); CDatatypeCompareValueSpaceMap::iterator it = itLB; if (it != itEnd) { CDatatypeCompareValueSpaceMapData& mapData = it.value(); CDatatypeCompareValueData* itValueData = mapData.mUseValue; if (value->isEqualTo(itValueData->getValue())) { depAdded |= addDataValueExclusionDependencies(itValueData,depCollector); } else if (value->isGreaterThan(itValueData->getValue())) { depAdded |= addExclusionDependencies(itValueData->getRightExclusionData(),depCollector); } else { depAdded |= addExclusionDependencies(itValueData->getLeftExclusionData(),depCollector); } } return depAdded; } bool CDatatypeCompareValueSpaceMap::countAllValues(CDatatypeValueSpaceValuesCounter* counter) { if (mAbsoluteMaximumExclusionValue && mAbsoluteMinimumExclusionValue) { return countIntervalValues(mAbsoluteMinimumExclusionValue->getValue(),true,mAbsoluteMaximumExclusionValue->getValue(),true,counter); } return false; } bool CDatatypeCompareValueSpaceMap::countIntervalValues(CDataLiteralCompareValue* leftValue, bool leftValueInclusive, CDataLiteralCompareValue* rightValue, bool rightValueInclusive, CDatatypeValueSpaceValuesCounter* counter) { bool counted = false; if (mAbsoluteMinimumExclusionValue) { if (leftValue->isLessThan(mAbsoluteMinimumExclusionValue->getValue())) { leftValue = mAbsoluteMinimumExclusionValue->getValue(); } } if (mAbsoluteMaximumExclusionValue) { if (rightValue->isGreaterThan(mAbsoluteMaximumExclusionValue->getValue())) { rightValue = mAbsoluteMaximumExclusionValue->getValue(); } } if (leftValue->isGreaterThan(rightValue)) { return false; } else if (leftValue->isEqualTo(rightValue)) { if (!leftValueInclusive && !rightValueInclusive) { return false; } } CDatatypeCompareValueSpaceMapArranger mapValueArranger(leftValue); CDatatypeCompareValueSpaceMap::iterator itBegin = CDatatypeCompareValueSpaceMap::begin(), itLB = CDatatypeCompareValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeCompareValueSpaceMap::end(); CDatatypeCompareValueSpaceMap::iterator it = itLB; while (it != itEnd && !counter->isInfinite()) { CDatatypeCompareValueSpaceMapData& mapData = it.value(); CDatatypeCompareValueData* itValueData = mapData.mUseValue; if (it == itLB) { if (leftValue->isEqualTo(itValueData->getValue())) { if (leftValueInclusive) { if (!isDataValueExcluded(itValueData)) { counted |= countDataValue(itValueData,counter); } } } else { if (leftValueInclusive) { if (!isDataValueExcluded(leftValue)) { counted |= countDataValue(leftValue,itValueData->getLeftExclusionData(),counter); } } if (!isDataIntervalExcluded(leftValue,itValueData)) { counted |= countDataIntervalValues(leftValue,itValueData,counter); } } } ++it; if (it != itEnd) { CDatatypeCompareValueSpaceMapData& nextMapData = it.value(); CDatatypeCompareValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData)) { counted |= countDataIntervalValues(itValueData,nextValueData,counter); } if (nextValueData->getValue()->isEqualTo(rightValue)) { if (rightValueInclusive) { if (!isDataValueExcluded(nextValueData)) { counted |= countDataValue(nextValueData,counter); } } break; } else if (nextValueData->getValue()->isGreaterThan(rightValue)) { if (rightValueInclusive) { if (!isDataValueExcluded(rightValue)) { counted |= countDataValue(rightValue,nextValueData->getLeftExclusionData(),counter); } } if (!isDataIntervalExcluded(nextValueData,rightValue)) { counted |= countDataIntervalValues(nextValueData,rightValue,counter); } break; } if (!isDataValueExcluded(nextValueData)) { counted |= countDataValue(nextValueData,counter); } } } return counted; } bool CDatatypeCompareValueSpaceMap::excludeData(CDatatypeCompareValueDataExclusion* exlcusionData, CDependencyTrackPoint* depTrackPoint, bool force) { if (force || !exlcusionData->isExcluded()) { exlcusionData->setExcluded(true); exlcusionData->setExcludedDependencyTrackPoint(depTrackPoint); return true; } return false; } bool CDatatypeCompareValueSpaceMap::excludeDataValue(CDatatypeCompareValueData* dataValue, CDependencyTrackPoint* depTrackPoint, bool force) { return excludeData(dataValue->getValueExclusionData(),depTrackPoint,force); } bool CDatatypeCompareValueSpaceMap::excludeLeftDataInterval(CDatatypeCompareValueData* dataValue, CDependencyTrackPoint* depTrackPoint, bool force) { return excludeData(dataValue->getLeftExclusionData(),depTrackPoint,force); } bool CDatatypeCompareValueSpaceMap::excludeRightDataInterval(CDatatypeCompareValueData* dataValue, CDependencyTrackPoint* depTrackPoint, bool force) { return excludeData(dataValue->getRightExclusionData(),depTrackPoint,force); } bool CDatatypeCompareValueSpaceMap::testValueSpaceReturnClashed() { CDatatypeCompareValueSpaceMap::const_iterator itBegin = CDatatypeCompareValueSpaceMap::constBegin(), itEnd = CDatatypeCompareValueSpaceMap::constEnd(); CDatatypeCompareValueSpaceMap::const_iterator it = itBegin; // test whether value space is empty CDatatypeCompareValueData* firstValueData = nullptr; while (it != itEnd) { const CDatatypeCompareValueSpaceMapData& mapData = it.value(); CDatatypeCompareValueData* itValueData = mapData.mUseValue; if (!firstValueData) { firstValueData = itValueData; if (!isLeftDataIntervalExcluded(firstValueData)) { return false; } } if (!isDataValueExcluded(itValueData)) { return false; } ++it; if (it != itEnd) { const CDatatypeCompareValueSpaceMapData& nextMapData = it.value(); CDatatypeCompareValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData)) { return false; } } else { if (!isRightDataIntervalExcluded(itValueData)) { return false; } } } return true; } bool CDatatypeCompareValueSpaceMap::addValueSpaceDependencies(CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeCompareValueSpaceMap::const_iterator itBegin = CDatatypeCompareValueSpaceMap::constBegin(), itEnd = CDatatypeCompareValueSpaceMap::constEnd(); CDatatypeCompareValueSpaceMap::const_iterator it = itBegin; it = itBegin; while (it != itEnd) { const CDatatypeCompareValueSpaceMapData& mapData = it.value(); CDatatypeCompareValueData* itValueData = mapData.mUseValue; addDataValueExclusionDependencies(itValueData,depCollector); if (it == itBegin) { addLeftIntervalExclusionDependencies(itValueData,depCollector); } ++it; if (it == itEnd) { addRightIntervalExclusionDependencies(itValueData,depCollector); } else { const CDatatypeCompareValueSpaceMapData& nextMapData = it.value(); CDatatypeCompareValueData* nextValueData = nextMapData.mUseValue; addDataIntervalExclusionDependencies(itValueData,nextValueData,depCollector); } } return true; } bool CDatatypeCompareValueSpaceMap::restrictToValue(CDataLiteralCompareValue* value, CDependencyTrackPoint* depTrackPoint) { bool newValuesPotentiallyExcluded = false; newValuesPotentiallyExcluded |= excludeMinimum(value,false,depTrackPoint); newValuesPotentiallyExcluded |= excludeMaximum(value,false,depTrackPoint); return newValuesPotentiallyExcluded; } bool CDatatypeCompareValueSpaceMap::excludeValue(CDataLiteralCompareValue* value, CDependencyTrackPoint* depTrackPoint) { bool newValuesPotentiallyExcluded = false; if (mAbsoluteMinimumExclusionValue) { if (mAbsoluteMinimumExclusionValue->getValue()->isGreaterThan(value)) { return false; } if (mAbsoluteMinimumExclusionValue->getValue()->isEqualTo(value)) { if (isDataValueExcluded(mAbsoluteMinimumExclusionValue)) { return false; } } } if (mAbsoluteMaximumExclusionValue) { if (mAbsoluteMaximumExclusionValue->getValue()->isGreaterThan(value)) { return false; } if (mAbsoluteMaximumExclusionValue->getValue()->isEqualTo(value)) { if (isDataValueExcluded(mAbsoluteMaximumExclusionValue)) { return false; } } } CDatatypeCompareValueData* valueData = getDatatypeCompareValueData(value,true); if (!isDataValueExcluded(valueData)) { newValuesPotentiallyExcluded |= excludeDataValue(valueData,depTrackPoint,false); } return newValuesPotentiallyExcluded; } bool CDatatypeCompareValueSpaceMap::addDataValueExclusionDependencies(CDatatypeCompareValueData* dataValue, CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeCompareValueDataExclusion* exclusionData = dataValue->getValueExclusionData(); return addExclusionDependencies(exclusionData,depCollector); } bool CDatatypeCompareValueSpaceMap::addDataIntervalExclusionDependencies(CDatatypeCompareValueData* leftValueExcluded, CDatatypeCompareValueData* rightValueExcluded, CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeCompareValueDataExclusion* exclusionData = leftValueExcluded->getRightExclusionData(); return addExclusionDependencies(exclusionData,depCollector); } bool CDatatypeCompareValueSpaceMap::addLeftIntervalExclusionDependencies(CDatatypeCompareValueData* valueData, CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeCompareValueDataExclusion* exclusionData = valueData->getLeftExclusionData(); return addExclusionDependencies(exclusionData,depCollector); } bool CDatatypeCompareValueSpaceMap::addRightIntervalExclusionDependencies(CDatatypeCompareValueData* valueData, CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeCompareValueDataExclusion* exclusionData = valueData->getRightExclusionData(); return addExclusionDependencies(exclusionData,depCollector); } bool CDatatypeCompareValueSpaceMap::addExclusionDependencies(CDatatypeCompareValueDataExclusion* exclusionData, CDatatypeValueSpaceDependencyCollector* depCollector) { bool dependenciesAdded = false; CDependencyTrackPoint* depTrackPoint = nullptr; if (depCollector) { if (exclusionData->isExcluded()) { depTrackPoint = exclusionData->getExcludedDependencyTrackPoint(); if (depTrackPoint) { dependenciesAdded |= depCollector->addDependency(depTrackPoint); } } } return dependenciesAdded; } bool CDatatypeCompareValueSpaceMap::isLeftDataIntervalExcluded(CDatatypeCompareValueData* dataValue) { CDatatypeCompareValueDataExclusion* exclusionData = dataValue->getLeftExclusionData(); if (exclusionData->isExcluded()) { return true; } return false; } bool CDatatypeCompareValueSpaceMap::isRightDataIntervalExcluded(CDatatypeCompareValueData* dataValue) { CDatatypeCompareValueDataExclusion* exclusionData = dataValue->getRightExclusionData(); if (exclusionData->isExcluded()) { return true; } return false; } bool CDatatypeCompareValueSpaceMap::isDataIntervalExcluded(CDataLiteralCompareValue* leftValueExcluded, CDatatypeCompareValueData* rightValueExcluded) { CDatatypeCompareValueDataExclusion* exclusionData = rightValueExcluded->getLeftExclusionData(); if (exclusionData->isExcluded()) { return true; } return false; } bool CDatatypeCompareValueSpaceMap::isDataIntervalExcluded(CDatatypeCompareValueData* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { CDatatypeCompareValueDataExclusion* exclusionData = leftValueExcluded->getRightExclusionData(); if (exclusionData->isExcluded()) { return true; } return false; } bool CDatatypeCompareValueSpaceMap::isDataIntervalExcluded(CDatatypeCompareValueData* leftValueExcluded, CDatatypeCompareValueData* rightValueExcluded) { return isDataIntervalExcluded(leftValueExcluded,rightValueExcluded->getValue()); } bool CDatatypeCompareValueSpaceMap::isDataValueExcluded(CDatatypeCompareValueData* valueData) { CDatatypeCompareValueDataExclusion* exclusionData = valueData->getValueExclusionData(); if (exclusionData->isExcluded()) { return true; } return false; } bool CDatatypeCompareValueSpaceMap::isDataValueExcluded(CDataLiteralCompareValue* value) { CDatatypeCompareValueSpaceMapArranger mapValueArranger(value); CDatatypeCompareValueSpaceMap::const_iterator itBegin = CDatatypeCompareValueSpaceMap::constBegin(), itLB = CDatatypeCompareValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeCompareValueSpaceMap::constEnd(); if (itBegin == itEnd) { return false; } if (itLB == itEnd) { return true; } const CDatatypeCompareValueSpaceMapData& mapData = itLB.value(); CDatatypeCompareValueData* valueData = mapData.mUseValue; CDatatypeCompareValueDataExclusion* exclusionData = nullptr; if (valueData->getValue()->isEqualTo(value)) { exclusionData = valueData->getValueExclusionData(); } else if (valueData->getValue()->isLessThan(value)) { exclusionData = valueData->getLeftExclusionData(); } else { exclusionData = valueData->getRightExclusionData(); } if (exclusionData) { CDatatypeCompareValueDataExclusion* exclusionData = valueData->getValueExclusionData(); if (exclusionData->isExcluded()) { return true; } } return false; } bool CDatatypeCompareValueSpaceMap::adaptNewCompareValueDataToNeighbours(CDatatypeCompareValueData* valueData) { CDatatypeCompareValueSpaceMapArranger mapValueArranger(valueData->getValue()); CDatatypeCompareValueSpaceMap::const_iterator itBegin = CDatatypeCompareValueSpaceMap::constBegin(), itLB = CDatatypeCompareValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeCompareValueSpaceMap::constEnd(); CDatatypeCompareValueSpaceMap::const_iterator itAdapt = itLB; bool rightNeighbour = true; ++itAdapt; if (itAdapt == itEnd) { itAdapt = itLB; --itAdapt; rightNeighbour = false; } if (itAdapt != itEnd) { const CDatatypeCompareValueSpaceMapData& adaptMapData = itAdapt.value(); CDatatypeCompareValueData* adaptValueData = adaptMapData.mUseValue; CDatatypeCompareValueDataExclusion* exclusionData = nullptr; if (rightNeighbour) { exclusionData = adaptValueData->getLeftExclusionData(); } else { exclusionData = adaptValueData->getRightExclusionData(); } valueData->getValueExclusionData()->initDataExclusion(exclusionData); valueData->getLeftExclusionData()->initDataExclusion(exclusionData); valueData->getRightExclusionData()->initDataExclusion(exclusionData); return true; } return false; } CDatatypeCompareValueData* CDatatypeCompareValueSpaceMap::getDatatypeCompareValueData(CDataLiteralCompareValue* value, CDatatypeCompareValueSpaceMapData& valueMapData, bool createOrLocalize, bool* newValueInsertion) { if (newValueInsertion) { *newValueInsertion = false; } CDatatypeCompareValueData* compareValueData = nullptr; if (!valueMapData.mLocValue) { bool newlyCreated = false; CMemoryAllocationManager* taskMemMan = mProcessContext->getUsedMemoryAllocationManager(); compareValueData = CObjectParameterizingAllocator< CDatatypeCompareValueData,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,mProcessContext); compareValueData->initCompareValueData(valueMapData.mUseValue,value); if (!valueMapData.mUseValue) { newlyCreated = true; } valueMapData.mUseValue = valueMapData.mLocValue = compareValueData; if (newlyCreated) { adaptNewCompareValueDataToNeighbours(compareValueData); } if (newlyCreated && newValueInsertion) { *newValueInsertion = true; } } else { compareValueData = valueMapData.mUseValue; } return compareValueData; } CDatatypeCompareValueData* CDatatypeCompareValueSpaceMap::getDatatypeCompareValueData(CDataLiteralCompareValue* value, bool createOrLocalize, bool* newValueInsertion) { if (newValueInsertion) { *newValueInsertion = false; } CDatatypeCompareValueData* compareValueData = nullptr; CDatatypeCompareValueSpaceMapArranger mapValueArranger(value); if (createOrLocalize) { CDatatypeCompareValueSpaceMapData& data = CPROCESSMAP::operator[](mapValueArranger); compareValueData = getDatatypeCompareValueData(value,data,createOrLocalize,newValueInsertion); } else { CDatatypeCompareValueSpaceMapData data = CPROCESSMAP::value(mapValueArranger); compareValueData = data.mUseValue; } return compareValueData; } bool CDatatypeCompareValueSpaceMap::hasExcludedMinimum(CDataLiteralCompareValue* value, bool valueInclusively) { if (mAbsoluteMinimumExclusionValue) { if (mAbsoluteMinimumExclusionValue->getValue()->isGreaterThan(value)) { return true; } if (mAbsoluteMinimumExclusionValue->getValue()->isEqualTo(value)) { if (isDataValueExcluded(mAbsoluteMinimumExclusionValue)) { return true; } if (!valueInclusively) { return true; } } } CDatatypeCompareValueSpaceMapArranger mapValueArranger(value); CDatatypeCompareValueSpaceMap::const_iterator itLB = CDatatypeCompareValueSpaceMap::lowerBound(mapValueArranger), it = CDatatypeCompareValueSpaceMap::constBegin(), itEnd = CDatatypeCompareValueSpaceMap::constEnd(); if (it == itEnd) { // no restrictions in value map return false; } if (it == itLB) { const CDatatypeCompareValueSpaceMapData& mapData = it.value(); CDatatypeCompareValueData* compareValueData = mapData.mUseValue; if (!valueInclusively) { // value is before first value --> excluded return isLeftDataIntervalExcluded(compareValueData); } else { if (!isDataValueExcluded(compareValueData)) { return false; } return true; } } if (itLB == itEnd) { // value is after last value --> not excluded assuming value space is not clashed return false; } while (it != itEnd && it != itLB) { // try to find valid values before tested minimum value limit const CDatatypeCompareValueSpaceMapData& mapData = it.value(); CDatatypeCompareValueData* compareValueData = mapData.mUseValue; if (!isDataValueExcluded(compareValueData)) { return false; } ++it; if (it != itEnd) { const CDatatypeCompareValueSpaceMapData& nextMapData = it.value(); CDatatypeCompareValueData* nextCompareValueData = nextMapData.mUseValue; if (it != itLB) { if (!isDataIntervalExcluded(compareValueData,nextCompareValueData)) { return false; } } else { if (nextCompareValueData->getValue()->isEqualTo(value)) { // value is in the value space map if (!isDataIntervalExcluded(compareValueData,nextCompareValueData)) { return false; } if (valueInclusively && !isDataValueExcluded(nextCompareValueData)) { return false; } } else { // test only to the tested minimum value limit if (!isDataIntervalExcluded(compareValueData,value)) { return false; } if (valueInclusively && !isDataValueExcluded(value)) { return false; } } } } } return true; } bool CDatatypeCompareValueSpaceMap::hasExcludedMaximum(CDataLiteralCompareValue* value, bool valueInclusively) { if (mAbsoluteMaximumExclusionValue) { if (mAbsoluteMaximumExclusionValue->getValue()->isLessThan(value)) { return true; } if (mAbsoluteMaximumExclusionValue->getValue()->isEqualTo(value)) { if (isDataValueExcluded(mAbsoluteMaximumExclusionValue)) { return true; } if (!valueInclusively) { return true; } } } CDatatypeCompareValueSpaceMapArranger mapValueArranger(value); CDatatypeCompareValueSpaceMap::const_iterator itLB = CDatatypeCompareValueSpaceMap::lowerBound(mapValueArranger), it = CDatatypeCompareValueSpaceMap::constBegin(), itEnd = CDatatypeCompareValueSpaceMap::constEnd(); if (it == itEnd) { // no restrictions in value map return false; } if (itLB == itEnd) { // value is after last value --> excluded return true; } it = itLB; while (it != itEnd) { const CDatatypeCompareValueSpaceMapData& mapData = it.value(); CDatatypeCompareValueData* compareValueData = mapData.mUseValue; if (it == itLB) { if (compareValueData->getValue()->isEqualTo(value)) { if (valueInclusively && !isDataValueExcluded(compareValueData)) { return false; } } else { if (!isDataIntervalExcluded(value,compareValueData)) { return false; } if (!isDataValueExcluded(compareValueData)) { return false; } if (valueInclusively && !isDataValueExcluded(value)) { return false; } } } ++it; if (it != itEnd) { const CDatatypeCompareValueSpaceMapData& nextMapData = it.value(); CDatatypeCompareValueData* nextCompareValueData = nextMapData.mUseValue; if (!isDataValueExcluded(nextCompareValueData)) { return false; } if (!isDataIntervalExcluded(compareValueData,nextCompareValueData)) { return false; } } else { if (!isRightDataIntervalExcluded(compareValueData)) { return false; } } } return true; } bool CDatatypeCompareValueSpaceMap::isValueExcluded(CDataLiteralCompareValue* value) { if (isDataValueExcluded(value)) { return true; } return false; } bool CDatatypeCompareValueSpaceMap::getNextPossibleDataValue(CDataLiteralCompareValue* nextValue, CDataLiteralCompareValue* lastValue) { if (!lastValue) { if (!mAbsoluteMinimumExclusionValue) { return false; } lastValue = mAbsoluteMinimumExclusionValue->getValue(); if (!isDataValueExcluded(mAbsoluteMinimumExclusionValue)) { if (representsInfinitelyManyValues(lastValue)) { return false; } else { getValueCopy(nextValue,lastValue); return true; } } } CDatatypeCompareValueSpaceMapArranger mapValueArranger(lastValue); CDatatypeCompareValueSpaceMap::iterator itBegin = CDatatypeCompareValueSpaceMap::begin(), itLB = CDatatypeCompareValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeCompareValueSpaceMap::end(); CDatatypeCompareValueSpaceMap::iterator it = itLB; while (it != itEnd) { if (it == itLB) { CDatatypeCompareValueData* itValueData = it.value().mUseValue; while (lastValue->isLessThan(itValueData->getValue())) { CDatatypeCompareValueSpaceMap::iterator itLast = it; --itLast; if (itLast != itEnd) { --it; } else { if (!isLeftDataIntervalExcluded(itValueData)) { getValueNext(nextValue,lastValue); if (nextValue->isLessThan(itValueData->getValue())) { return true; } else if (nextValue->isEqualTo(itValueData->getValue())) { if (!isDataValueExcluded(itValueData)) { return true; } } } break; } } } CDatatypeCompareValueSpaceMapData& mapData = it.value(); CDatatypeCompareValueData* itValueData = mapData.mUseValue; if (itValueData->getValue()->isGreaterThan(lastValue)) { lastValue = itValueData->getValue(); } ++it; if (it != itEnd) { CDatatypeCompareValueSpaceMapData& nextMapData = it.value(); CDatatypeCompareValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData)) { getValueNext(nextValue,lastValue); if (nextValue->isLessThan(nextValueData->getValue())) { return true; } else if (nextValue->isEqualTo(nextValueData->getValue())) { if (!isDataValueExcluded(nextValueData)) { return true; } } } else if (!isDataValueExcluded(nextValueData)) { getValueNext(nextValue,lastValue); if (nextValue->isEqualTo(nextValueData->getValue())) { return true; } } } else { if (!isRightDataIntervalExcluded(itValueData)) { return false; } else { getValueNext(nextValue,lastValue); return true; } } } return false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorConceptExtensionMap.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorConceptExtensionMa0000644000175000017500000000463212520551156032445 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORCONCEPTEXTENSIONMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORCONCEPTEXTENSIONMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CSaturationSuccessorConceptExtensionMapData.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationSuccessorConceptExtensionMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationSuccessorConceptExtensionMap { // public methods public: //! Constructor CSaturationSuccessorConceptExtensionMap(CProcessContext* processContext); CSaturationSuccessorConceptExtensionMap* initSuccessorConceptExtensionMap(); CPROCESSHASH* getSuccessorConceptExtensionMap(); bool addExtensionConcept(CConcept* concept, bool negation); // protected methods protected: // protected variables protected: CPROCESSHASH mConceptExtensionMap; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORCONCEPTEXTENSIONMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleSuccessorHash.cpp0000644000175000017500000001033012520551152027077 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleSuccessorHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRoleSuccessorHash::CRoleSuccessorHash(CProcessContext* context) : mContext(context),mRoleSuccessorDataHash(context) { } CRoleSuccessorHash::~CRoleSuccessorHash() { } CRoleSuccessorHash* CRoleSuccessorHash::initRoleSuccessorHash(CRoleSuccessorHash* prevRoleSuccHash) { if (prevRoleSuccHash) { mRoleSuccessorDataHash = prevRoleSuccHash->mRoleSuccessorDataHash; } else { mRoleSuccessorDataHash.clear(); } return this; } CRoleSuccessorHash* CRoleSuccessorHash::insertRoleSuccessorLink(CRole* role, CIndividualLinkEdge* link) { CRoleSuccessorData& roleSuccData = mRoleSuccessorDataHash[role]; if (roleSuccData.mLinkSet) { if (!roleSuccData.mLocatedLinkSet) { CPROCESSHASH* newLinkSet = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mContext),mContext); newLinkSet->init(roleSuccData.mLinkSet,mContext); roleSuccData.mLinkSet = newLinkSet; roleSuccData.mLocatedLinkSet = true; } roleSuccData.mLinkSet->insert(link->getCoupledIndividualID(),link); } else { roleSuccData.mLinkLinker = link->append(roleSuccData.mLinkLinker); } return this; } CRoleSuccessorHash* CRoleSuccessorHash::removeRoleSuccessorLink(CRole* role, CIndividualLinkEdge* link) { CRoleSuccessorData& roleSuccData = mRoleSuccessorDataHash[role]; if (roleSuccData.mLinkSet) { if (!roleSuccData.mLocatedLinkSet) { CPROCESSHASH* newLinkSet = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mContext),mContext); newLinkSet->init(roleSuccData.mLinkSet,mContext); roleSuccData.mLinkSet = newLinkSet; roleSuccData.mLocatedLinkSet = true; } roleSuccData.mLinkSet->remove(link->getCoupledIndividualID()); } else { if (roleSuccData.mLinkLinker) { // replace by set CPROCESSHASH* newLinkSet = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mContext),mContext); roleSuccData.mLinkSet = newLinkSet; roleSuccData.mLocatedLinkSet = true; CIndividualLinkEdge* linkIt = roleSuccData.mLinkLinker; while (linkIt) { if (linkIt != link) { newLinkSet->insert(linkIt->getCoupledIndividualID(),linkIt); } linkIt = linkIt->getNext(); } } } return this; } CRoleSuccessorLinkIterator CRoleSuccessorHash::getRoleSuccessorLinkIterator(CRole* role) { CRoleSuccessorData* roleSuccData = nullptr; if (mRoleSuccessorDataHash.tryGetValuePointer(role,roleSuccData)) { if (roleSuccData->mLinkSet) { return CRoleSuccessorLinkIterator((roleSuccData->mLinkSet)->begin(),(roleSuccData->mLinkSet)->end()); } else { return CRoleSuccessorLinkIterator(roleSuccData->mLinkLinker); } } return CRoleSuccessorLinkIterator(nullptr); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptVariableBindingPathSetHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptVariableBindingPathSetHashData0000644000175000017500000000274412520551102032147 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptVariableBindingPathSetHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptVariableBindingPathSetHashData::CConceptVariableBindingPathSetHashData() { mLocVariableBindingPathSet = nullptr; mUseVariableBindingPathSet = nullptr; } CConceptVariableBindingPathSetHashData::CConceptVariableBindingPathSetHashData(const CConceptVariableBindingPathSetHashData& data) { mLocVariableBindingPathSet = nullptr; mUseVariableBindingPathSet = data.mUseVariableBindingPathSet; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptIterator.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptItera0000644000175000017500000000460012520551140032333 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPropagationBindingReapplyConceptIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CPropagationBindingReapplyConceptIterator::CPropagationBindingReapplyConceptIterator(const CPROCESSHASH::iterator& itBegin, const CPROCESSHASH::iterator& itEnd) { mItBegin = itBegin; mItEnd = itEnd; } CPropagationBindingReapplyConceptDescriptor* CPropagationBindingReapplyConceptIterator::nextReapplyDescriptor(bool moveNext) { CPropagationBindingReapplyConceptDescriptor* reapplyConDes = nullptr; if (mItBegin != mItEnd) { CPropagationBindingReapplyConceptHashData& data = mItBegin.value(); reapplyConDes = data.getPropagationBindingReapplyConceptDescriptor(); if (moveNext) { if (mItBegin != mItEnd) { ++mItBegin; } } } return reapplyConDes; } CPropagationBindingReapplyConceptIterator* CPropagationBindingReapplyConceptIterator::clearReapplyDescriptor() { if (mItBegin != mItEnd) { CPropagationBindingReapplyConceptHashData& data = mItBegin.value(); data.clearPropagationBindingReapplyConceptDescriptor(); } return this; } bool CPropagationBindingReapplyConceptIterator::moveNext() { if (mItBegin != mItEnd) { ++mItBegin; return true; } return false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationHashDat0000644000175000017500000000271112520551132032242 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNominalCachingLossReactivationHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CNominalCachingLossReactivationHashData::CNominalCachingLossReactivationHashData() { mReactivationData = nullptr; mPrevReactivationData = nullptr; } CNominalCachingLossReactivationHashData::CNominalCachingLossReactivationHashData(const CNominalCachingLossReactivationHashData& data) { mReactivationData = nullptr; mPrevReactivationData = data.mPrevReactivationData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyConceptDescriptor.h0000644000175000017500000000604512520551140030141 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTDESCRIPTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "CConceptProcessDescriptor.h" // Other includes #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CReapplyConceptDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReapplyConceptDescriptor : public CLinkerBase { // public methods public: //! Constructor CReapplyConceptDescriptor(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint *depTrackPoint = 0, bool isStaticDes = true); CReapplyConceptDescriptor(); CReapplyConceptDescriptor *initReapllyDescriptor(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint *depTrackPoint = 0, bool isStaticDes = true); CReapplyConceptDescriptor *initReapllyDescriptor(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint *depTrackPoint, CProcessingRestrictionSpecification* procRest); CConceptDescriptor *getConceptDescriptor(); CDependencyTrackPoint *getDependencyTrackPoint(); CProcessingRestrictionSpecification *getReapplyProcessingRestriction(); bool isStaticDescriptor(); bool hasConceptDescriptor(CConceptDescriptor* conceptDescriptor); // protected methods protected: // protected variables protected: CConceptDescriptor* mConceptDes; CDependencyTrackPoint* mTrackPoint; bool mStatic; CProcessingRestrictionSpecification* mProcessingRestriction; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyRoleSuccessorHash.h0000644000175000017500000000776712520551142030124 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYROLESUCCESSORHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYROLESUCCESSORHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualLinkEdge.h" #include "CRoleSuccessorLinkIterator.h" #include "CReapplyQueue.h" #include "CProcessContext.h" #include "CReapplyRoleSuccessorData.h" #include "CRoleSuccessorIterator.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CReapplyRoleSuccessorHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReapplyRoleSuccessorHash { // public methods public: //! Constructor CReapplyRoleSuccessorHash(CProcessContext* context = nullptr); CReapplyRoleSuccessorHash* initRoleSuccessorHash(CReapplyRoleSuccessorHash* prevRoleSuccHash); CReapplyRoleSuccessorHash* insertRoleSuccessorLink(CRole* role, CIndividualLinkEdge* link, CReapplyQueueIterator* reapplyQueueIterator = nullptr); CReapplyRoleSuccessorHash* removeRoleSuccessorLink(CRole* role, CIndividualLinkEdge* link); CReapplyRoleSuccessorHash* removeRoleSuccessorLink(CRole* role, cint64 sourceIndiID, cint64 destinationIndiID); cint64 getRoleSuccessorCount(CRole* role); CRoleSuccessorLinkIterator getRoleSuccessorLinkIterator(CRole* role); CRoleSuccessorLinkIterator getRoleSuccessorLinkIterator(CRole* role, cint64* linkCount); CRoleSuccessorLinkIterator getRoleSuccessorLinkIterator(CRole* role, cint64* linkCount, CIndividualLinkEdge*& lastLink); CRoleSuccessorLinkIterator getRoleSuccessorHistoryLinkIterator(CRole* role, CIndividualLinkEdge* lastLink); CRoleSuccessorLinkIterator getRoleSuccessorHistoryLinkIterator(CRole* role, CIndividualLinkEdge* lastLink, cint64* linkCount); bool hasRoleSuccessor(CRole* role); bool hasRoleSuccessorToIndividual(CRole* role, cint64 sourceIndiID, cint64 destinationIndiID, bool locateable); CIndividualLinkEdge* getRoleSuccessorToIndividualLink(CRole* role, cint64 sourceIndiID, cint64 destinationIndiID, bool locateable); CReapplyQueue* getRoleReapplyQueue(CRole* role, bool create = false); bool containsRoleReapplyQueue(CRole* role); CReapplyQueueIterator getRoleReapplyIterator(CRole* role, bool clearDynamicReapplyQueue = true); CRoleSuccessorIterator getRoleIterator(); // protected methods protected: cint64 getCoupledIndividualID(CIndividualLinkEdge* link); cint64 getCoupledIndividualID(cint64 indi1ID, cint64 indi2ID); // protected variables protected: CProcessContext* mContext; CPROCESSHASH mRoleSuccessorDataHash; cint64 mLinkCount; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYROLESUCCESSORHASH_H ././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorIndividualALLConceptsExtensionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorIndividualAL0000644000175000017500000000733512520551154032334 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationLinkedSuccessorIndividualALLConceptsExtensionData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationLinkedSuccessorIndividualALLConceptsExtensionData::CSaturationLinkedSuccessorIndividualALLConceptsExtensionData(CProcessContext* processContext) : mProcessContext(processContext) { } CSaturationLinkedSuccessorIndividualALLConceptsExtensionData* CSaturationLinkedSuccessorIndividualALLConceptsExtensionData::initLinkedSuccessorIndividualALLConceptsExtensionData(CIndividualSaturationProcessNode* indiProcSatNode) { mIndiProcSatNode = indiProcSatNode; mRoleConceptExtensionHash = nullptr; mOnlyRole = nullptr; mOnlyAllConceptExtData = nullptr; return this; } CPROCESSHASH* CSaturationLinkedSuccessorIndividualALLConceptsExtensionData::getRoleConceptExtensionHash() { return mRoleConceptExtensionHash; } CSaturationSuccessorALLConceptExtensionData* CSaturationLinkedSuccessorIndividualALLConceptsExtensionData::getRoleSuccessorALLConceptExtensionData(CRole* role, bool create) { if (create) { if (mOnlyRole && mOnlyRole != role) { if (!mRoleConceptExtensionHash) { mRoleConceptExtensionHash = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); } CSaturationSuccessorALLConceptExtensionData*& data = (*mRoleConceptExtensionHash)[mOnlyRole]; data = mOnlyAllConceptExtData; mOnlyAllConceptExtData = nullptr; mOnlyRole = nullptr; } if (mRoleConceptExtensionHash) { CSaturationSuccessorALLConceptExtensionData*& data = (*mRoleConceptExtensionHash)[role]; if (!data) { data = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); data->initSuccessorConceptExtensionData(role,mIndiProcSatNode); } return data; } if (!mOnlyRole) { mOnlyRole = role; mOnlyAllConceptExtData = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mOnlyAllConceptExtData->initSuccessorConceptExtensionData(role,mIndiProcSatNode); } return mOnlyAllConceptExtData; } else { if (mRoleConceptExtensionHash) { return mRoleConceptExtensionHash->value(role,nullptr); } if (mOnlyRole == role) { return mOnlyAllConceptExtData; } return nullptr; } } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedDatatypeValueSpaceExclusionDescriptor.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedDatatypeValueSpaceExclusionDes0000644000175000017500000000414112520551074032263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClashedDatatypeValueSpaceExclusionDescriptor.h" #include "CIndividualProcessNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CClashedDatatypeValueSpaceExclusionDescriptor::CClashedDatatypeValueSpaceExclusionDescriptor() : CClashedDependencyDescriptor() { mIndividualNode = nullptr; } CClashedDatatypeValueSpaceExclusionDescriptor* CClashedDatatypeValueSpaceExclusionDescriptor::initClashedDatatypeValueSpaceExclusionDescriptor(CDependencyTrackPoint* depTrackPoint, CIndividualProcessNode* individual) { initClashedDependencyDescriptor(depTrackPoint); mIndividualNode = individual; return this; } cint64 CClashedDatatypeValueSpaceExclusionDescriptor::getAppropriatedIndividualID() { return mIndividualNode->getIndividualID(); } CClashedDatatypeValueSpaceExclusionDescriptor* CClashedDatatypeValueSpaceExclusionDescriptor::setAppropriatedIndividual(CIndividualProcessNode* individualNode) { mIndividualNode = individualNode; return this; } CIndividualProcessNode* CClashedDatatypeValueSpaceExclusionDescriptor::getAppropriatedIndividual() { return mIndividualNode; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Marker/0000755000175000017500000000000012613407256024125 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Marker/MarkerSettings.h0000644000175000017500000000402412405707546027244 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_MARKER_CMARKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_MARKER_CMARKER_H // Qt includes // Namespace includes // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { namespace Marker { /*! * * \class CMarker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMarker : CLinkerBase { // public methods public: //! Constructor CMarker(); //! Deconstructor virtual ~CMarker(); CMarker *setNextMarker(CMarker *marker); CMarker *getNextMarker(); CMarker *getLastMarker(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Marker }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_MARKER_CMARKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Marker/CMarker.cpp0000644000175000017500000000303212520551070026142 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMarker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { namespace Marker { CMarker::CMarker() : CLinkerBase(this) { } CMarker::~CMarker() { } CMarker *CMarker::setNextMarker(CMarker *marker) { CLinkerBase::setNext(marker); return this; } CMarker *CMarker::getNextMarker() { return CLinkerBase::getNext(); } CMarker *CMarker::getLastMarker() { return CLinkerBase::getLastListLink(); } }; // end namespace Marker }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/Marker/CMarker.h0000644000175000017500000000404512520551070025614 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_MARKER_CMARKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_MARKER_CMARKER_H // Libraries includes // Namespace includes // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { namespace Marker { /*! * * \class CMarker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMarker : public CLinkerBase { // public methods public: //! Constructor CMarker(); //! Destructor virtual ~CMarker(); CMarker *setNextMarker(CMarker *marker); CMarker *getNextMarker(); CMarker *getLastMarker(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Marker }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_MARKER_CMARKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalSaturationConceptTypeQueues.h0000644000175000017500000000557512520551106032335 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALSATURATIONCONCEPTTYPEQUEUES_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALSATURATIONCONCEPTTYPEQUEUES_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CCriticalSaturationConceptQueue.h" #include "CIndividualSaturationProcessNodeLinker.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CCriticalSaturationConceptTypeQueues * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCriticalSaturationConceptTypeQueues { // public methods public: //! Constructor CCriticalSaturationConceptTypeQueues(CProcessContext* context = nullptr); enum CRITICALSATURATIONCONCEPTQUEUETYPE { CCT_FORALL = 0, CCT_ATMOST = 1, CCT_DISJUNCTION = 2, CCT_EQCANDIDATE = 3, CCT_VALUE = 4, CCT_NOMINAL = 5 }; CCriticalSaturationConceptTypeQueues* initCriticalSaturationConceptQueues(CIndividualSaturationProcessNode* indiNode); bool hasCriticalSaturationConceptsQueued(); CCriticalSaturationConceptQueue* getCriticalSaturationConceptQueue(CRITICALSATURATIONCONCEPTQUEUETYPE type, bool create); bool isProcessNodeQueued(); CCriticalSaturationConceptTypeQueues* setProcessNodeQueued(bool queued); // protected methods protected: // protected variables protected: CProcessContext* mContext; CIndividualSaturationProcessNode* mIndiNode; CCriticalSaturationConceptQueue** mQueueVec; bool mQueued; const static cint64 mConceptTypeCount = 6; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALSATURATIONCONCEPTTYPEQUEUES_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingCandidateData.h0000644000175000017500000000455512520551160031161 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSignatureBlockingCandidateData_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSignatureBlockingCandidateData_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSignatureBlockingCandidateData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureBlockingCandidateData { // public methods public: //! Constructor inline CSignatureBlockingCandidateData() { mCandidateIndiLinker = nullptr; mCandidateCount = 0; } inline CSignatureBlockingCandidateData(const CSignatureBlockingCandidateData& data) { mCandidateIndiLinker = data.mCandidateIndiLinker; mCandidateCount = data.mCandidateCount; } CXLinker* getCandidateIndividualLinker(); cint64 getCandidateIndividualCount(); // public variables public: CXLinker* mCandidateIndiLinker; cint64 mCandidateCount; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSignatureBlockingCandidateData_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptHash.0000644000175000017500000000611412520551136032237 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGREAPPLYCONCEPTHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGREAPPLYCONCEPTHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CPropagationBindingReapplyConceptIterator.h" #include "CPropagationBindingReapplyConceptHashData.h" #include "CPropagationBindingReapplyConceptDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CPropagationBindingReapplyConceptHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPropagationBindingReapplyConceptHash : public CPROCESSHASH { // public methods public: //! Constructor CPropagationBindingReapplyConceptHash(CProcessContext* processContext); CPropagationBindingReapplyConceptHash* initPropagationBindingReapplyConceptHash(CPropagationBindingReapplyConceptHash* prevHash); CPropagationBindingReapplyConceptHash* addPropagationBindingReapplyConceptDescriptor(const TIndividualConceptPair& indiConPair, CPropagationBindingReapplyConceptDescriptor* reapplyConDes); CPropagationBindingReapplyConceptHash* addPropagationBindingReapplyConceptDescriptor(CIndividualProcessNode* indi, CConcept* concept, CPropagationBindingReapplyConceptDescriptor* reapplyConDes); CPropagationBindingReapplyConceptDescriptor* takePropagationBindingReapplyConceptDescriptor(const TIndividualConceptPair& indiConPair); bool hasPropagationBindingReapplyConceptDescriptor(const TIndividualConceptPair& indiConPair); CPropagationBindingReapplyConceptIterator getPropagationBindingReapplyConceptDescriptorIterator(); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGREAPPLYCONCEPTHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningCommonKeyMap.cpp0000644000175000017500000000312112520551142032275 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeJoiningCommonKeyMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeJoiningCommonKeyMap::CRepresentativeJoiningCommonKeyMap(CProcessContext* processContext) : mProcessContext(processContext),CPROCESSMAP(processContext) { } CRepresentativeJoiningCommonKeyMap* CRepresentativeJoiningCommonKeyMap::initRepresentativeJoiningCommonKeyMap(CRepresentativeJoiningCommonKeyMap* prevMap) { if (prevMap) { *this = *prevMap; } else { CPROCESSMAP::clear(); } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorExtensionData.cpp0000644000175000017500000000423712520551160032222 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationSuccessorExtensionData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationSuccessorExtensionData::CSaturationSuccessorExtensionData(CProcessContext* processContext) { mProcessContext = processContext; } CSaturationSuccessorExtensionData* CSaturationSuccessorExtensionData::initSuccessorExtensionData() { mLastExaminedALLConReaDes = nullptr; mLastExaminedLinkLinker = nullptr; return this; } CBackwardSaturationPropagationReapplyDescriptor* CSaturationSuccessorExtensionData::getLastExaminedALLConceptReapplyDescriptor() { return mLastExaminedALLConReaDes; } CSaturationSuccessorExtensionData* CSaturationSuccessorExtensionData::setLastExaminedALLConceptReapplyDescriptor(CBackwardSaturationPropagationReapplyDescriptor* reaDes) { mLastExaminedALLConReaDes = reaDes; return this; } CSaturationSuccessorData* CSaturationSuccessorExtensionData::getLastExaminedLinkLinker() { return mLastExaminedLinkLinker; } CSaturationSuccessorExtensionData* CSaturationSuccessorExtensionData::setLastExaminedLinkLinker(CSaturationSuccessorData* linkLinker) { mLastExaminedLinkLinker = linkLinker; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingRestrictionSpecification.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingRestrictionSpecification.cp0000644000175000017500000000364012520551134032371 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessingRestrictionSpecification.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CProcessingRestrictionSpecification::CProcessingRestrictionSpecification() : CLinkerBase(0.) { } CProcessingRestrictionSpecification* CProcessingRestrictionSpecification::getNextProcessingRestrictionSpecification() { return getNext(); } CProcessingRestrictionSpecification* CProcessingRestrictionSpecification::initProcessingRestriction(CProcessingRestrictionSpecification* prevProcRestSpec) { if (prevProcRestSpec) { setData(prevProcRestSpec->getData()); } else { setData(0); } return this; } double CProcessingRestrictionSpecification::getPriorityOffset() { return getData(); } CProcessingRestrictionSpecification* CProcessingRestrictionSpecification::setPriorityOffset(double priorityOffset) { setData(priorityOffset); return this; } }; // end namespace Kernel }; // end namespace Process }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptReapplyHash.h0000644000175000017500000000473212520551102026705 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTREAPPLYHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTREAPPLYHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CReapplyQueue.h" #include "CProcessContext.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CConceptReapplyHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptReapplyHash : public CPROCESSHASH,CReapplyQueue> { // public methods public: //! Constructor CConceptReapplyHash(CProcessContext* processContext = nullptr); //! Destructor virtual ~CConceptReapplyHash(); CConceptReapplyHash* initConceptReapplyHash(CConceptReapplyHash* prevConceptReapplyHash); CReapplyQueue* getConceptReapplyQueue(CConcept *&concept, bool &conceptNegation, bool create = false); bool containsConceptReapplyQueue(CConcept *&concept, bool &conceptNegation); CReapplyQueueIterator getConceptReapplyIterator(CConcept *&concept, bool &conceptNegation, bool clearDynamicReapplyQueue = true); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTREAPPLYHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceMap.cpp0000644000175000017500000014755612520551114031074 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeStringValueSpaceMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeStringValueSpaceMap::CDatatypeStringValueSpaceMap(CProcessContext* processContext) : CPROCESSMAP(processContext),mProcessContext(processContext) { } CDatatypeStringValueSpaceMap* CDatatypeStringValueSpaceMap::initDatatypeStringValueSpaceMap(CDatatypeStringValueSpaceMap* map) { if (map) { *this = *map; mAbsoluteMinimumExclusionValue = map->mAbsoluteMinimumExclusionValue; mAbsoluteMaximumExclusionValue = map->mAbsoluteMaximumExclusionValue; } return this; } CDatatypeStringValueSpaceMap* CDatatypeStringValueSpaceMap::initDatatypeStringValueSpaceMap(CDatatypeValueSpaceStringType* valueSpaceType) { CPROCESSMAP::clear(); mAbsoluteMinimumExclusionValue = nullptr; mAbsoluteMaximumExclusionValue = nullptr; excludeMinimum(valueSpaceType->getMinimumDataLiteralStringValue(),false,nullptr); excludeMaximum(valueSpaceType->getMaximumDataLiteralStringValue(),false,nullptr); return this; } bool CDatatypeStringValueSpaceMap::getAbsoluteMinimumValue(CDataLiteralStringValue*& minValue, bool& minValueInclusive, CDependencyTrackPoint** depTrackPoint) { if (mAbsoluteMinimumExclusionValue) { minValue = mAbsoluteMinimumExclusionValue->getValue(); minValueInclusive = true; if (depTrackPoint) { *depTrackPoint = mAbsoluteMinimumExclusionValue->getLeftExclusionData()->getExcludedDependencyTrackPoint(); } if (mAbsoluteMinimumExclusionValue->getValueExclusionData()->isExcluded()) { if (mAbsoluteMinimumExclusionValue->getValueExclusionData()->getExcludedDependencyTrackPoint() == mAbsoluteMinimumExclusionValue->getLeftExclusionData()->getExcludedDependencyTrackPoint()) { minValueInclusive = false; } } return true; } return false; } bool CDatatypeStringValueSpaceMap::getAbsoluteMaximumValue(CDataLiteralStringValue*& maxValue, bool& maxValueInclusive, CDependencyTrackPoint** depTrackPoint) { if (mAbsoluteMaximumExclusionValue) { maxValue = mAbsoluteMaximumExclusionValue->getValue(); maxValueInclusive = true; if (depTrackPoint) { *depTrackPoint = mAbsoluteMaximumExclusionValue->getRightExclusionData()->getExcludedDependencyTrackPoint(); } if (mAbsoluteMaximumExclusionValue->getValueExclusionData()->isExcluded()) { if (mAbsoluteMaximumExclusionValue->getValueExclusionData()->getExcludedDependencyTrackPoint() == mAbsoluteMaximumExclusionValue->getRightExclusionData()->getExcludedDependencyTrackPoint()) { maxValueInclusive = false; } } return true; } return false; } bool CDatatypeStringValueSpaceMap::excludeMinimum(CDataLiteralStringValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint) { if (mAbsoluteMinimumExclusionValue) { if (mAbsoluteMinimumExclusionValue->getValue()->isGreaterThan(value)) { return nullptr; } } bool newValuesPotentiallyExcluded = false; CDatatypeStringValueData* valueData = getDatatypeStringValueData(value,true); newValuesPotentiallyExcluded |= excludeLeftDataInterval(valueData,depTrackPoint,nullptr,true); if (valueInclusively && !isDataValueExcluded(valueData,nullptr)) { newValuesPotentiallyExcluded |= excludeDataValue(valueData,depTrackPoint,nullptr,false); } mAbsoluteMinimumExclusionValue = valueData; // remove all lower values from map CDatatypeStringValueSpaceMap::iterator it = CDatatypeStringValueSpaceMap::begin(), itEnd = CDatatypeStringValueSpaceMap::end(); while (it != itEnd) { const CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* itValueData = mapData.mUseValue; if (itValueData == valueData) { break; } newValuesPotentiallyExcluded = true; it = CDatatypeStringValueSpaceMap::erase(it); } return newValuesPotentiallyExcluded; } bool CDatatypeStringValueSpaceMap::excludeMaximum(CDataLiteralStringValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint) { if (mAbsoluteMaximumExclusionValue) { if (mAbsoluteMaximumExclusionValue->getValue()->isLessThan(value)) { return false; } } bool newValuesPotentiallyExcluded = false; CDatatypeStringValueData* valueData = getDatatypeStringValueData(value,true); newValuesPotentiallyExcluded |= excludeRightDataInterval(valueData,depTrackPoint,nullptr,true); if (valueInclusively && !isDataValueExcluded(valueData,nullptr)) { newValuesPotentiallyExcluded |= excludeDataValue(valueData,depTrackPoint,nullptr,false); } mAbsoluteMaximumExclusionValue = valueData; // remove all higher values from map CDatatypeStringValueSpaceMapArranger mapValueArranger(value); CDatatypeStringValueSpaceMap::iterator itBegin = CDatatypeStringValueSpaceMap::begin(), itUB = CDatatypeStringValueSpaceMap::upperBound(mapValueArranger), itEnd = CDatatypeStringValueSpaceMap::end(); CDatatypeStringValueSpaceMap::iterator it = itUB; while (it != itEnd) { const CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* itValueData = mapData.mUseValue; it = CDatatypeStringValueSpaceMap::erase(it); newValuesPotentiallyExcluded = true; } return newValuesPotentiallyExcluded; } bool CDatatypeStringValueSpaceMap::excludeMinimum(CDataLiteralStringValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType) { bool newValuesPotentiallyExcluded = false; CDatatypeStringValueData* valueData = getDatatypeStringValueData(value,true); if (valueInclusively && !isDataValueExcluded(valueData,exclusionType)) { newValuesPotentiallyExcluded |= excludeDataValue(valueData,depTrackPoint,exclusionType,false); } CDatatypeStringValueSpaceMap::iterator itBegin = CDatatypeStringValueSpaceMap::begin(), itEnd = CDatatypeStringValueSpaceMap::end(); CDatatypeStringValueSpaceMap::iterator it = itBegin; while (it != itEnd) { CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* itValueData = mapData.mUseValue; if (it == itBegin) { if (!isLeftDataIntervalExcluded(itValueData,exclusionType)) { itValueData = getDatatypeStringValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(itValueData,depTrackPoint,exclusionType,false); } } if (itValueData != valueData) { if (!isDataValueExcluded(itValueData,exclusionType)) { itValueData = getDatatypeStringValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeDataValue(itValueData,depTrackPoint,exclusionType,false); } ++it; if (it != itEnd) { CDatatypeStringValueSpaceMapData& nextMapData = it.value(); CDatatypeStringValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData,exclusionType)) { itValueData = getDatatypeStringValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeRightDataInterval(itValueData,depTrackPoint,exclusionType,false); nextValueData = getDatatypeStringValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(nextValueData,depTrackPoint,exclusionType,false); } } } else { break; } } return newValuesPotentiallyExcluded; } bool CDatatypeStringValueSpaceMap::excludeMaximum(CDataLiteralStringValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType) { bool newValuesPotentiallyExcluded = false; CDatatypeStringValueData* valueData = getDatatypeStringValueData(value,true); if (valueInclusively && !isDataValueExcluded(valueData,nullptr)) { newValuesPotentiallyExcluded |= excludeDataValue(valueData,depTrackPoint,nullptr,false); } CDatatypeStringValueSpaceMapArranger mapValueArranger(value); CDatatypeStringValueSpaceMap::iterator itBegin = CDatatypeStringValueSpaceMap::begin(), itLB = CDatatypeStringValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeStringValueSpaceMap::end(); CDatatypeStringValueSpaceMap::iterator it = itLB; while (it != itEnd) { CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* itValueData = mapData.mUseValue; if (itValueData != valueData) { if (!isDataValueExcluded(itValueData,exclusionType)) { itValueData = getDatatypeStringValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeDataValue(itValueData,depTrackPoint,exclusionType,false); } } ++it; if (it != itEnd) { CDatatypeStringValueSpaceMapData& nextMapData = it.value(); CDatatypeStringValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData,exclusionType)) { itValueData = getDatatypeStringValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeRightDataInterval(itValueData,depTrackPoint,exclusionType,false); nextValueData = getDatatypeStringValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(nextValueData,depTrackPoint,exclusionType,false); } } else { if (!isRightDataIntervalExcluded(itValueData,exclusionType)) { itValueData = getDatatypeStringValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(itValueData,depTrackPoint,exclusionType,false); } } } return newValuesPotentiallyExcluded; } bool CDatatypeStringValueSpaceMap::excludeAll(CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType) { bool newValuesPotentiallyExcluded = false; CDatatypeStringValueSpaceMap::iterator itBegin = CDatatypeStringValueSpaceMap::begin(), itEnd = CDatatypeStringValueSpaceMap::end(); CDatatypeStringValueSpaceMap::iterator it = itBegin; while (it != itEnd) { CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* itValueData = mapData.mUseValue; if (it == itBegin) { if (!isLeftDataIntervalExcluded(itValueData,exclusionType)) { itValueData = getDatatypeStringValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(itValueData,depTrackPoint,exclusionType,false); } if (!isDataValueExcluded(itValueData,exclusionType)) { itValueData = getDatatypeStringValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeDataValue(itValueData,depTrackPoint,exclusionType,false); } } ++it; if (it != itEnd) { CDatatypeStringValueSpaceMapData& nextMapData = it.value(); CDatatypeStringValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData,exclusionType)) { itValueData = getDatatypeStringValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeRightDataInterval(itValueData,depTrackPoint,exclusionType,false); nextValueData = getDatatypeStringValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(nextValueData,depTrackPoint,exclusionType,false); } if (!isDataValueExcluded(nextValueData,exclusionType)) { nextValueData = getDatatypeStringValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeDataValue(nextValueData,depTrackPoint,exclusionType,false); } } else { if (!isRightDataIntervalExcluded(itValueData,exclusionType)) { itValueData = getDatatypeStringValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeRightDataInterval(itValueData,depTrackPoint,exclusionType,false); } } } return newValuesPotentiallyExcluded; } bool CDatatypeStringValueSpaceMap::excludeInterval(CDataLiteralStringValue* leftValue, bool leftValueInclusive, CDataLiteralStringValue* rightValue, bool rightValueInclusive, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType) { bool newValuesPotentiallyExcluded = false; CDatatypeStringValueData* leftValueData = getDatatypeStringValueData(leftValue,true); CDatatypeStringValueData* rightValueData = getDatatypeStringValueData(rightValue,true); if (leftValueInclusive && !isDataValueExcluded(leftValueData,exclusionType)) { newValuesPotentiallyExcluded |= excludeDataValue(leftValueData,depTrackPoint,exclusionType,false); } if (leftValueInclusive && !isDataValueExcluded(rightValueData,exclusionType)) { newValuesPotentiallyExcluded |= excludeDataValue(rightValueData,depTrackPoint,exclusionType,false); } CDatatypeStringValueSpaceMapArranger mapValueArranger(leftValue); CDatatypeStringValueSpaceMap::iterator itBegin = CDatatypeStringValueSpaceMap::begin(), itLB = CDatatypeStringValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeStringValueSpaceMap::end(); CDatatypeStringValueSpaceMap::iterator it = itLB; while (it != itEnd) { CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* itValueData = mapData.mUseValue; ++it; if (it != itEnd) { CDatatypeStringValueSpaceMapData& nextMapData = it.value(); CDatatypeStringValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData,exclusionType)) { itValueData = getDatatypeStringValueData(itValueData->getValue(),mapData,true,nullptr); newValuesPotentiallyExcluded |= excludeRightDataInterval(itValueData,depTrackPoint,exclusionType,false); nextValueData = getDatatypeStringValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeLeftDataInterval(nextValueData,depTrackPoint,exclusionType,false); } if (nextValueData == rightValueData) { break; } if (!isDataValueExcluded(nextValueData,exclusionType)) { nextValueData = getDatatypeStringValueData(nextValueData->getValue(),nextMapData,true,nullptr); newValuesPotentiallyExcluded |= excludeDataValue(nextValueData,depTrackPoint,exclusionType,false); } } } return newValuesPotentiallyExcluded; } bool CDatatypeStringValueSpaceMap::countDataIntervalValues(CDatatypeStringValueData* leftValueExcluded, CDatatypeStringValueData* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter) { return countDataIntervalValues(leftValueExcluded->getValue(),rightValueExcluded->getValue(),leftValueExcluded->getRightExclusionData(),counter); } bool CDatatypeStringValueSpaceMap::countDataIntervalValues(CDataLiteralStringValue* leftValueExcluded, CDatatypeStringValueData* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter) { return countDataIntervalValues(leftValueExcluded,rightValueExcluded->getValue(),rightValueExcluded->getLeftExclusionData(),counter); } bool CDatatypeStringValueSpaceMap::countDataIntervalValues(CDatatypeStringValueData* leftValueExcluded, CDataLiteralStringValue* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter) { return countDataIntervalValues(leftValueExcluded->getValue(),rightValueExcluded,leftValueExcluded->getRightExclusionData(),counter); } bool CDatatypeStringValueSpaceMap::countDataIntervalValues(CDataLiteralStringValue* leftValueExcluded, CDataLiteralStringValue* rightValueExcluded, CDatatypeStringValueDataExclusion* exlcusionData, CDatatypeValueSpaceValuesCounter* counter) { bool counted = false; if (!exlcusionData->isEverythingExcluded()) { counted |= counter->incInfinite(); CDatatypeValueSpaceStringValuesCounter* stringValuesCounter = dynamic_cast(counter); if (stringValuesCounter) { if (!exlcusionData->areLanguageTagsExcluded()) { counted |= stringValuesCounter->incInfinite(CDatatypeValueSpaceStringValuesCounter::SVT_WITH_LANGUAG_TAG_COUNT); } if (!exlcusionData->areOnlyLanguageTagsAllowed()) { counted |= stringValuesCounter->incInfinite(CDatatypeValueSpaceStringValuesCounter::SVT_WITHOUT_LANGUAG_TAG_COUNT); } } } return counted; } bool CDatatypeStringValueSpaceMap::countDataValue(CDatatypeStringValueData* dataValue, CDatatypeValueSpaceValuesCounter* counter) { return countDataValue(dataValue->getValue(),dataValue->getValueExclusionData(),counter); } bool CDatatypeStringValueSpaceMap::countDataValue(CDataLiteralStringValue* value, CDatatypeStringValueDataExclusion* exlcusionData, CDatatypeValueSpaceValuesCounter* counter) { bool counted = false; if (!exlcusionData->isEverythingExcluded()) { if (value->isInfiniteLength()) { counted |= counter->incInfinite(); } else { counted |= counter->incValueCount(1); } CDatatypeValueSpaceStringValuesCounter* stringValuesCounter = dynamic_cast(counter); if (stringValuesCounter) { if (value->isInfiniteLength()) { if (!exlcusionData->areLanguageTagsExcluded()) { counted |= stringValuesCounter->incInfinite(CDatatypeValueSpaceStringValuesCounter::SVT_WITH_LANGUAG_TAG_COUNT); } if (!exlcusionData->areOnlyLanguageTagsAllowed()) { counted |= stringValuesCounter->incInfinite(CDatatypeValueSpaceStringValuesCounter::SVT_WITHOUT_LANGUAG_TAG_COUNT); } } else { if (value->hasLanguageTag()) { counted |= stringValuesCounter->incValueCount(CDatatypeValueSpaceStringValuesCounter::SVT_WITH_LANGUAG_TAG_COUNT,1); } else { counted |= stringValuesCounter->incValueCount(CDatatypeValueSpaceStringValuesCounter::SVT_WITHOUT_LANGUAG_TAG_COUNT,1); } } } } return counted; } bool CDatatypeStringValueSpaceMap::countValueValues(CDataLiteralStringValue* value, CDatatypeValueSpaceValuesCounter* counter) { bool counted = false; if (mAbsoluteMinimumExclusionValue) { if (value->isLessThan(mAbsoluteMinimumExclusionValue->getValue())) { return false; } } if (mAbsoluteMaximumExclusionValue) { if (value->isGreaterThan(mAbsoluteMaximumExclusionValue->getValue())) { return false; } } CDatatypeStringValueSpaceMapArranger mapValueArranger(value); CDatatypeStringValueSpaceMap::iterator itBegin = CDatatypeStringValueSpaceMap::begin(), itLB = CDatatypeStringValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeStringValueSpaceMap::end(); CDatatypeStringValueSpaceMap::iterator it = itLB; if (it != itEnd) { CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* itValueData = mapData.mUseValue; if (value->isEqualTo(itValueData->getValue())) { if (!isDataValueExcluded(itValueData,nullptr)) { counted |= countDataValue(itValueData,counter); } } else { if (!isDataValueExcluded(value,nullptr)) { counted |= countDataValue(value,itValueData->getLeftExclusionData(),counter); } } } return counted; } bool CDatatypeStringValueSpaceMap::addIntervalExclusionDependencies(CDataLiteralStringValue* leftValue, bool leftValueInclusive, CDataLiteralStringValue* rightValue, bool rightValueInclusive, CDatatypeValueSpaceDependencyCollector* depCollector) { if (mAbsoluteMinimumExclusionValue) { if (leftValue->isLessThan(mAbsoluteMinimumExclusionValue->getValue())) { leftValue = mAbsoluteMinimumExclusionValue->getValue(); } } if (mAbsoluteMaximumExclusionValue) { if (rightValue->isGreaterThan(mAbsoluteMaximumExclusionValue->getValue())) { rightValue = mAbsoluteMaximumExclusionValue->getValue(); } } if (leftValue->isGreaterThan(rightValue)) { return false; } else if (leftValue->isEqualTo(rightValue)) { if (!leftValueInclusive && !rightValueInclusive) { return false; } } bool depAdded = false; CDatatypeStringValueSpaceMapArranger mapValueArranger(leftValue); CDatatypeStringValueSpaceMap::iterator itBegin = CDatatypeStringValueSpaceMap::begin(), itLB = CDatatypeStringValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeStringValueSpaceMap::end(); CDatatypeStringValueSpaceMap::iterator it = itLB; while (it != itEnd) { CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* itValueData = mapData.mUseValue; if (it == itLB) { if (leftValue->isEqualTo(itValueData->getValue())) { if (leftValueInclusive) { depAdded |= addDataValueExclusionDependencies(itValueData,depCollector); } } else { depAdded |= addExclusionDependencies(itValueData->getLeftExclusionData(),depCollector); } } ++it; if (it != itEnd) { CDatatypeStringValueSpaceMapData& nextMapData = it.value(); CDatatypeStringValueData* nextValueData = nextMapData.mUseValue; depAdded |= addDataIntervalExclusionDependencies(itValueData,nextValueData,depCollector); if (nextValueData->getValue()->isEqualTo(rightValue)) { if (rightValueInclusive) { depAdded |= addDataValueExclusionDependencies(nextValueData,depCollector); } break; } else if (nextValueData->getValue()->isGreaterThan(rightValue)) { depAdded |= addExclusionDependencies(itValueData->getRightExclusionData(),depCollector); break; } depAdded |= addDataValueExclusionDependencies(nextValueData,depCollector); } } return depAdded; } bool CDatatypeStringValueSpaceMap::addValueExclusionDependencies(CDataLiteralStringValue* value, CDatatypeValueSpaceDependencyCollector* depCollector) { if (mAbsoluteMinimumExclusionValue) { if (value->isLessThan(mAbsoluteMinimumExclusionValue->getValue())) { return false; } } if (mAbsoluteMaximumExclusionValue) { if (value->isGreaterThan(mAbsoluteMaximumExclusionValue->getValue())) { return false; } } bool depAdded = false; CDatatypeStringValueSpaceMapArranger mapValueArranger(value); CDatatypeStringValueSpaceMap::iterator itBegin = CDatatypeStringValueSpaceMap::begin(), itLB = CDatatypeStringValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeStringValueSpaceMap::end(); CDatatypeStringValueSpaceMap::iterator it = itLB; if (it != itEnd) { CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* itValueData = mapData.mUseValue; if (value->isEqualTo(itValueData->getValue())) { depAdded |= addDataValueExclusionDependencies(itValueData,depCollector); } else if (value->isGreaterThan(itValueData->getValue())) { depAdded |= addExclusionDependencies(itValueData->getRightExclusionData(),depCollector); } else { depAdded |= addExclusionDependencies(itValueData->getLeftExclusionData(),depCollector); } } return depAdded; } bool CDatatypeStringValueSpaceMap::countAllValues(CDatatypeValueSpaceValuesCounter* counter) { if (mAbsoluteMaximumExclusionValue && mAbsoluteMinimumExclusionValue) { return countIntervalValues(mAbsoluteMinimumExclusionValue->getValue(),true,mAbsoluteMaximumExclusionValue->getValue(),true,counter); } return false; } bool CDatatypeStringValueSpaceMap::countIntervalValues(CDataLiteralStringValue* leftValue, bool leftValueInclusive, CDataLiteralStringValue* rightValue, bool rightValueInclusive, CDatatypeValueSpaceValuesCounter* counter) { bool counted = false; if (mAbsoluteMinimumExclusionValue) { if (leftValue->isLessThan(mAbsoluteMinimumExclusionValue->getValue())) { leftValue = mAbsoluteMinimumExclusionValue->getValue(); } } if (mAbsoluteMaximumExclusionValue) { if (rightValue->isGreaterThan(mAbsoluteMaximumExclusionValue->getValue())) { rightValue = mAbsoluteMaximumExclusionValue->getValue(); } } if (leftValue->isGreaterThan(rightValue)) { return false; } else if (leftValue->isEqualTo(rightValue)) { if (!leftValueInclusive && !rightValueInclusive) { return false; } } CDatatypeStringValueSpaceMapArranger mapValueArranger(leftValue); CDatatypeStringValueSpaceMap::iterator itBegin = CDatatypeStringValueSpaceMap::begin(), itLB = CDatatypeStringValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeStringValueSpaceMap::end(); CDatatypeStringValueSpaceMap::iterator it = itLB; while (it != itEnd) { CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* itValueData = mapData.mUseValue; if (it == itLB) { if (leftValue->isEqualTo(itValueData->getValue())) { if (leftValueInclusive) { if (!isDataValueExcluded(itValueData,nullptr)) { counted |= countDataValue(itValueData,counter); } } } else { if (leftValueInclusive) { if (!isDataValueExcluded(leftValue,nullptr)) { counted |= countDataValue(leftValue,itValueData->getLeftExclusionData(),counter); } } if (!isDataIntervalExcluded(leftValue,itValueData,nullptr)) { counted |= countDataIntervalValues(leftValue,itValueData,counter); } } } ++it; if (it != itEnd) { CDatatypeStringValueSpaceMapData& nextMapData = it.value(); CDatatypeStringValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData,nullptr)) { counted |= countDataIntervalValues(itValueData,nextValueData,counter); } if (nextValueData->getValue()->isEqualTo(rightValue)) { if (rightValueInclusive) { if (!isDataValueExcluded(nextValueData,nullptr)) { counted |= countDataValue(nextValueData,counter); } } break; } else if (nextValueData->getValue()->isGreaterThan(rightValue)) { if (rightValueInclusive) { if (!isDataValueExcluded(rightValue,nullptr)) { counted |= countDataValue(rightValue,nextValueData->getLeftExclusionData(),counter); } } if (!isDataIntervalExcluded(nextValueData,rightValue,nullptr)) { counted |= countDataIntervalValues(nextValueData,rightValue,counter); } break; } if (!isDataValueExcluded(nextValueData,nullptr)) { counted |= countDataValue(nextValueData,counter); } } } return counted; } bool CDatatypeStringValueSpaceMap::excludeData(CDatatypeStringValueDataExclusion* exlcusionData, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType, bool force) { if (!exclusionType) { if (force || !exlcusionData->isExcluded()) { exlcusionData->setExcluded(true); exlcusionData->setExcludedDependencyTrackPoint(depTrackPoint); return true; } } else { if (force || !exlcusionData->isExcluded(exclusionType)) { exlcusionData->setExclusion(exclusionType,depTrackPoint); return true; } } return false; } bool CDatatypeStringValueSpaceMap::excludeDataValue(CDatatypeStringValueData* dataValue, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType, bool force) { return excludeData(dataValue->getValueExclusionData(),depTrackPoint,exclusionType,force); } bool CDatatypeStringValueSpaceMap::excludeLeftDataInterval(CDatatypeStringValueData* dataValue, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType, bool force) { return excludeData(dataValue->getLeftExclusionData(),depTrackPoint,exclusionType,force); } bool CDatatypeStringValueSpaceMap::excludeRightDataInterval(CDatatypeStringValueData* dataValue, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType, bool force) { return excludeData(dataValue->getRightExclusionData(),depTrackPoint,exclusionType,force); } bool CDatatypeStringValueSpaceMap::restrictToWithLanguageTagsValues(CDependencyTrackPoint* depTrackPoint) { CDatatypeStringValueExclusionType exclusionType(CDatatypeStringValueExclusionType::SVET_LANGUAGE_TAGS_COMPLETELY,true); return excludeAll(depTrackPoint,&exclusionType); } bool CDatatypeStringValueSpaceMap::restrictToWithoutLanguageTagsValues(CDependencyTrackPoint* depTrackPoint) { CDatatypeStringValueExclusionType exclusionType(CDatatypeStringValueExclusionType::SVET_LANGUAGE_TAGS_COMPLETELY,false); return excludeAll(depTrackPoint,&exclusionType); } bool CDatatypeStringValueSpaceMap::testValueSpaceReturnClashed() { CDatatypeStringValueSpaceMap::const_iterator itBegin = CDatatypeStringValueSpaceMap::constBegin(), itEnd = CDatatypeStringValueSpaceMap::constEnd(); CDatatypeStringValueSpaceMap::const_iterator it = itBegin; // test whether value space is empty CDatatypeStringValueData* firstValueData = nullptr; while (it != itEnd) { const CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* itValueData = mapData.mUseValue; if (!firstValueData) { firstValueData = itValueData; if (!isLeftDataIntervalExcluded(firstValueData,nullptr)) { return false; } } if (!isDataValueExcluded(itValueData,nullptr)) { return false; } ++it; if (it != itEnd) { const CDatatypeStringValueSpaceMapData& nextMapData = it.value(); CDatatypeStringValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData,nullptr)) { return false; } } else { if (!isRightDataIntervalExcluded(itValueData,nullptr)) { return false; } } } return true; } bool CDatatypeStringValueSpaceMap::addValueSpaceDependencies(CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeStringValueSpaceMap::const_iterator itBegin = CDatatypeStringValueSpaceMap::constBegin(), itEnd = CDatatypeStringValueSpaceMap::constEnd(); CDatatypeStringValueSpaceMap::const_iterator it = itBegin; it = itBegin; while (it != itEnd) { const CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* itValueData = mapData.mUseValue; addDataValueExclusionDependencies(itValueData,depCollector); if (it == itBegin) { addLeftIntervalExclusionDependencies(itValueData,depCollector); } ++it; if (it == itEnd) { addRightIntervalExclusionDependencies(itValueData,depCollector); } else { const CDatatypeStringValueSpaceMapData& nextMapData = it.value(); CDatatypeStringValueData* nextValueData = nextMapData.mUseValue; addDataIntervalExclusionDependencies(itValueData,nextValueData,depCollector); } } return true; } bool CDatatypeStringValueSpaceMap::restrictToValue(CDataLiteralStringValue* value, CDependencyTrackPoint* depTrackPoint) { bool newValuesPotentiallyExcluded = false; newValuesPotentiallyExcluded |= excludeMinimum(value,false,depTrackPoint); newValuesPotentiallyExcluded |= excludeMaximum(value,false,depTrackPoint); return newValuesPotentiallyExcluded; } bool CDatatypeStringValueSpaceMap::excludeValue(CDataLiteralStringValue* value, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType) { bool newValuesPotentiallyExcluded = false; if (mAbsoluteMinimumExclusionValue) { if (mAbsoluteMinimumExclusionValue->getValue()->isGreaterThan(value)) { return false; } if (mAbsoluteMinimumExclusionValue->getValue()->isEqualTo(value)) { if (isDataValueExcluded(mAbsoluteMinimumExclusionValue,exclusionType)) { return false; } } } if (mAbsoluteMaximumExclusionValue) { if (mAbsoluteMaximumExclusionValue->getValue()->isGreaterThan(value)) { return false; } if (mAbsoluteMaximumExclusionValue->getValue()->isEqualTo(value)) { if (isDataValueExcluded(mAbsoluteMaximumExclusionValue,exclusionType)) { return false; } } } CDatatypeStringValueData* valueData = getDatatypeStringValueData(value,true); if (!isDataValueExcluded(valueData,exclusionType)) { newValuesPotentiallyExcluded |= excludeDataValue(valueData,depTrackPoint,exclusionType,false); } return newValuesPotentiallyExcluded; } bool CDatatypeStringValueSpaceMap::addDataValueExclusionDependencies(CDatatypeStringValueData* dataValue, CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeStringValueDataExclusion* exclusionData = dataValue->getValueExclusionData(); return addExclusionDependencies(exclusionData,depCollector); } bool CDatatypeStringValueSpaceMap::addDataIntervalExclusionDependencies(CDatatypeStringValueData* leftValueExcluded, CDatatypeStringValueData* rightValueExcluded, CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeStringValueDataExclusion* exclusionData = leftValueExcluded->getRightExclusionData(); return addExclusionDependencies(exclusionData,depCollector); } bool CDatatypeStringValueSpaceMap::addLeftIntervalExclusionDependencies(CDatatypeStringValueData* valueData, CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeStringValueDataExclusion* exclusionData = valueData->getLeftExclusionData(); return addExclusionDependencies(exclusionData,depCollector); } bool CDatatypeStringValueSpaceMap::addRightIntervalExclusionDependencies(CDatatypeStringValueData* valueData, CDatatypeValueSpaceDependencyCollector* depCollector) { CDatatypeStringValueDataExclusion* exclusionData = valueData->getRightExclusionData(); return addExclusionDependencies(exclusionData,depCollector); } bool CDatatypeStringValueSpaceMap::addExclusionDependencies(CDatatypeStringValueDataExclusion* exclusionData, CDatatypeValueSpaceDependencyCollector* depCollector) { bool dependenciesAdded = false; CDependencyTrackPoint* depTrackPoint = nullptr; if (depCollector) { if (exclusionData->isExcluded()) { depTrackPoint = exclusionData->getExcludedDependencyTrackPoint(); if (depTrackPoint) { dependenciesAdded |= depCollector->addDependency(depTrackPoint); } } else { depTrackPoint = exclusionData->getPositiveExclusionDependencyTrackPoint(); if (depTrackPoint) { dependenciesAdded |= depCollector->addDependency(depTrackPoint); } depTrackPoint = exclusionData->getNegativeExclusionDependencyTrackPoint(); if (depTrackPoint) { dependenciesAdded |= depCollector->addDependency(depTrackPoint); } } } return dependenciesAdded; } bool CDatatypeStringValueSpaceMap::isLeftDataIntervalExcluded(CDatatypeStringValueData* dataValue, CDatatypeStringValueExclusionType* exclusionType) { CDatatypeStringValueDataExclusion* exclusionData = dataValue->getLeftExclusionData(); if (exclusionData->isEverythingExcluded()) { return true; } if (exclusionType) { if (exclusionData->isExcluded(exclusionType)) { return true; } } return false; } bool CDatatypeStringValueSpaceMap::isRightDataIntervalExcluded(CDatatypeStringValueData* dataValue, CDatatypeStringValueExclusionType* exclusionType) { CDatatypeStringValueDataExclusion* exclusionData = dataValue->getRightExclusionData(); if (exclusionData->isEverythingExcluded()) { return true; } if (exclusionType) { if (exclusionData->isExcluded(exclusionType)) { return true; } } return false; } bool CDatatypeStringValueSpaceMap::isDataIntervalExcluded(CDataLiteralStringValue* leftValueExcluded, CDatatypeStringValueData* rightValueExcluded, CDatatypeStringValueExclusionType* exclusionType) { CDatatypeStringValueDataExclusion* exclusionData = rightValueExcluded->getLeftExclusionData(); if (exclusionData->isEverythingExcluded()) { return true; } if (exclusionType) { if (exclusionData->isExcluded(exclusionType)) { return true; } } return false; } bool CDatatypeStringValueSpaceMap::isDataIntervalExcluded(CDatatypeStringValueData* leftValueExcluded, CDataLiteralStringValue* rightValueExcluded, CDatatypeStringValueExclusionType* exclusionType) { CDatatypeStringValueDataExclusion* exclusionData = leftValueExcluded->getRightExclusionData(); if (exclusionData->isEverythingExcluded()) { return true; } if (exclusionType) { if (exclusionData->isExcluded(exclusionType)) { return true; } } return false; } bool CDatatypeStringValueSpaceMap::isDataIntervalExcluded(CDatatypeStringValueData* leftValueExcluded, CDatatypeStringValueData* rightValueExcluded, CDatatypeStringValueExclusionType* exclusionType) { return isDataIntervalExcluded(leftValueExcluded,rightValueExcluded->getValue(),exclusionType); } bool CDatatypeStringValueSpaceMap::isDataValueExcluded(CDatatypeStringValueData* valueData, CDatatypeStringValueExclusionType* exclusionType) { CDatatypeStringValueDataExclusion* exclusionData = valueData->getValueExclusionData(); if (exclusionData->isEverythingExcluded()) { return true; } CDataLiteralStringValue* value = valueData->getValue(); if (value->hasLanguageTag()) { if (exclusionData->areLanguageTagsExcluded()) { return true; } } else { if (exclusionData->areOnlyLanguageTagsAllowed()) { return true; } } if (exclusionType) { if (exclusionData->isExcluded(exclusionType)) { return true; } } return false; } bool CDatatypeStringValueSpaceMap::isDataValueExcluded(CDataLiteralStringValue* value, CDatatypeStringValueExclusionType* exclusionType) { CDatatypeStringValueSpaceMapArranger mapValueArranger(value); CDatatypeStringValueSpaceMap::const_iterator itBegin = CDatatypeStringValueSpaceMap::constBegin(), itLB = CDatatypeStringValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeStringValueSpaceMap::constEnd(); if (itBegin == itEnd) { return false; } if (itLB == itEnd) { return true; } const CDatatypeStringValueSpaceMapData& mapData = itLB.value(); CDatatypeStringValueData* valueData = mapData.mUseValue; CDatatypeStringValueDataExclusion* exclusionData = nullptr; if (valueData->getValue()->isEqualTo(value)) { exclusionData = valueData->getValueExclusionData(); } else if (valueData->getValue()->isLessThan(value)) { exclusionData = valueData->getLeftExclusionData(); } else { exclusionData = valueData->getRightExclusionData(); } if (exclusionData) { CDatatypeStringValueDataExclusion* exclusionData = valueData->getValueExclusionData(); if (exclusionData->isEverythingExcluded()) { return true; } CDataLiteralStringValue* value = valueData->getValue(); if (value->hasLanguageTag()) { if (exclusionData->areLanguageTagsExcluded()) { return true; } } else { if (exclusionData->areOnlyLanguageTagsAllowed()) { return true; } } } if (exclusionType) { if (exclusionData->isExcluded(exclusionType)) { return true; } } return false; } bool CDatatypeStringValueSpaceMap::adaptNewStringValueDataToNeighbours(CDatatypeStringValueData* valueData) { CDatatypeStringValueSpaceMapArranger mapValueArranger(valueData->getValue()); CDatatypeStringValueSpaceMap::const_iterator itBegin = CDatatypeStringValueSpaceMap::constBegin(), itLB = CDatatypeStringValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeStringValueSpaceMap::constEnd(); CDatatypeStringValueSpaceMap::const_iterator itAdapt = itLB; bool rightNeighbour = true; ++itAdapt; if (itAdapt == itEnd) { itAdapt = itLB; --itAdapt; rightNeighbour = false; } if (itAdapt != itEnd) { const CDatatypeStringValueSpaceMapData& adaptMapData = itAdapt.value(); CDatatypeStringValueData* adaptValueData = adaptMapData.mUseValue; CDatatypeStringValueDataExclusion* exclusionData = nullptr; if (rightNeighbour) { exclusionData = adaptValueData->getLeftExclusionData(); } else { exclusionData = adaptValueData->getRightExclusionData(); } valueData->getValueExclusionData()->initDataExclusion(exclusionData); valueData->getLeftExclusionData()->initDataExclusion(exclusionData); valueData->getRightExclusionData()->initDataExclusion(exclusionData); return true; } return false; } CDatatypeStringValueData* CDatatypeStringValueSpaceMap::getDatatypeStringValueData(CDataLiteralStringValue* value, CDatatypeStringValueSpaceMapData& valueMapData, bool createOrLocalize, bool* newValueInsertion) { if (newValueInsertion) { *newValueInsertion = false; } CDatatypeStringValueData* stringValueData = nullptr; if (!valueMapData.mLocValue) { bool newlyCreated = false; CMemoryAllocationManager* taskMemMan = mProcessContext->getUsedMemoryAllocationManager(); stringValueData = CObjectParameterizingAllocator< CDatatypeStringValueData,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,mProcessContext); stringValueData->initStringValueData(valueMapData.mUseValue,value); if (!valueMapData.mUseValue) { newlyCreated = true; } valueMapData.mUseValue = valueMapData.mLocValue = stringValueData; if (newlyCreated) { adaptNewStringValueDataToNeighbours(stringValueData); } if (newlyCreated && newValueInsertion) { *newValueInsertion = true; } } else { stringValueData = valueMapData.mUseValue; } return stringValueData; } CDatatypeStringValueData* CDatatypeStringValueSpaceMap::getDatatypeStringValueData(CDataLiteralStringValue* value, bool createOrLocalize, bool* newValueInsertion) { if (newValueInsertion) { *newValueInsertion = false; } CDatatypeStringValueData* stringValueData = nullptr; CDatatypeStringValueSpaceMapArranger mapValueArranger(value); if (createOrLocalize) { CDatatypeStringValueSpaceMapData& data = CPROCESSMAP::operator[](mapValueArranger); stringValueData = getDatatypeStringValueData(value,data,createOrLocalize,newValueInsertion); } else { CDatatypeStringValueSpaceMapData data = CPROCESSMAP::value(mapValueArranger); stringValueData = data.mUseValue; } return stringValueData; } bool CDatatypeStringValueSpaceMap::hasExcludedMinimum(CDataLiteralStringValue* value, bool valueInclusively, CDatatypeStringValueExclusionType* exclusionType) { if (mAbsoluteMinimumExclusionValue) { if (mAbsoluteMinimumExclusionValue->getValue()->isGreaterThan(value)) { return true; } if (mAbsoluteMinimumExclusionValue->getValue()->isEqualTo(value)) { if (isDataValueExcluded(mAbsoluteMinimumExclusionValue,exclusionType)) { return true; } if (!valueInclusively) { return true; } } } CDatatypeStringValueSpaceMapArranger mapValueArranger(value); CDatatypeStringValueSpaceMap::const_iterator itLB = CDatatypeStringValueSpaceMap::lowerBound(mapValueArranger), it = CDatatypeStringValueSpaceMap::constBegin(), itEnd = CDatatypeStringValueSpaceMap::constEnd(); if (it == itEnd) { // no restrictions in value map return false; } if (it == itLB) { const CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* stringValueData = mapData.mUseValue; if (!valueInclusively) { // value is before first value --> excluded return isLeftDataIntervalExcluded(stringValueData,exclusionType); } else { if (!isDataValueExcluded(stringValueData,exclusionType)) { return false; } return true; } } if (itLB == itEnd) { // value is after last value --> not excluded assuming value space is not clashed return false; } while (it != itEnd && it != itLB) { // try to find valid values before tested minimum value limit const CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* stringValueData = mapData.mUseValue; if (!isDataValueExcluded(stringValueData,exclusionType)) { return false; } ++it; if (it != itEnd) { const CDatatypeStringValueSpaceMapData& nextMapData = it.value(); CDatatypeStringValueData* nextStringValueData = nextMapData.mUseValue; if (it != itLB) { if (!isDataIntervalExcluded(stringValueData,nextStringValueData,exclusionType)) { return false; } } else { if (nextStringValueData->getValue()->isEqualTo(value)) { // value is in the value space map if (!isDataIntervalExcluded(stringValueData,nextStringValueData,exclusionType)) { return false; } if (valueInclusively && !isDataValueExcluded(nextStringValueData,exclusionType)) { return false; } } else { // test only to the tested minimum value limit if (!isDataIntervalExcluded(stringValueData,value,exclusionType)) { return false; } if (valueInclusively && !isDataValueExcluded(value,exclusionType)) { return false; } } } } } return true; } bool CDatatypeStringValueSpaceMap::hasExcludedMaximum(CDataLiteralStringValue* value, bool valueInclusively, CDatatypeStringValueExclusionType* exclusionType) { if (mAbsoluteMaximumExclusionValue) { if (mAbsoluteMaximumExclusionValue->getValue()->isLessThan(value)) { return true; } if (mAbsoluteMaximumExclusionValue->getValue()->isEqualTo(value)) { if (isDataValueExcluded(mAbsoluteMaximumExclusionValue,exclusionType)) { return true; } if (!valueInclusively) { return true; } } } CDatatypeStringValueSpaceMapArranger mapValueArranger(value); CDatatypeStringValueSpaceMap::const_iterator itLB = CDatatypeStringValueSpaceMap::lowerBound(mapValueArranger), it = CDatatypeStringValueSpaceMap::constBegin(), itEnd = CDatatypeStringValueSpaceMap::constEnd(); if (it == itEnd) { // no restrictions in value map return false; } if (itLB == itEnd) { // value is after last value --> excluded return true; } it = itLB; while (it != itEnd) { const CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* stringValueData = mapData.mUseValue; if (it == itLB) { if (stringValueData->getValue()->isEqualTo(value)) { if (valueInclusively && !isDataValueExcluded(stringValueData,exclusionType)) { return false; } } else { if (!isDataIntervalExcluded(value,stringValueData,exclusionType)) { return false; } if (!isDataValueExcluded(stringValueData,exclusionType)) { return false; } if (valueInclusively && !isDataValueExcluded(value,exclusionType)) { return false; } } } ++it; if (it != itEnd) { const CDatatypeStringValueSpaceMapData& nextMapData = it.value(); CDatatypeStringValueData* nextStringValueData = nextMapData.mUseValue; if (!isDataValueExcluded(nextStringValueData,exclusionType)) { return false; } if (!isDataIntervalExcluded(stringValueData,nextStringValueData,exclusionType)) { return false; } } else { if (!isRightDataIntervalExcluded(stringValueData,exclusionType)) { return false; } } } return true; } bool CDatatypeStringValueSpaceMap::isValueExcluded(CDataLiteralStringValue* value, CDatatypeStringValueExclusionType* exclusionType) { if (isDataValueExcluded(value,exclusionType)) { return true; } return false; } bool CDatatypeStringValueSpaceMap::getNextPossibleDataValue(CDataLiteralStringValue* nextValue, CDataLiteralStringValue* lastValue) { if (!lastValue) { if (!mAbsoluteMinimumExclusionValue) { return false; } lastValue = mAbsoluteMinimumExclusionValue->getValue(); if (!isDataValueExcluded(mAbsoluteMinimumExclusionValue,nullptr)) { nextValue->initValue(lastValue); return true; } } CDatatypeStringValueSpaceMapArranger mapValueArranger(lastValue); CDatatypeStringValueSpaceMap::iterator itBegin = CDatatypeStringValueSpaceMap::begin(), itLB = CDatatypeStringValueSpaceMap::lowerBound(mapValueArranger), itEnd = CDatatypeStringValueSpaceMap::end(); CDatatypeStringValueSpaceMap::iterator it = itLB; while (it != itEnd) { if (it == itLB) { CDatatypeStringValueData* itValueData = it.value().mUseValue; while (lastValue->isLessThan(itValueData->getValue())) { CDatatypeStringValueSpaceMap::iterator itLast = it; --itLast; if (itLast != itEnd) { --it; } else { if (!isLeftDataIntervalExcluded(itValueData,nullptr)) { return false; } break; } } } CDatatypeStringValueSpaceMapData& mapData = it.value(); CDatatypeStringValueData* itValueData = mapData.mUseValue; if (itValueData->getValue()->isGreaterThan(lastValue)) { lastValue = itValueData->getValue(); } ++it; if (it != itEnd) { CDatatypeStringValueSpaceMapData& nextMapData = it.value(); CDatatypeStringValueData* nextValueData = nextMapData.mUseValue; if (!isDataIntervalExcluded(itValueData,nextValueData,nullptr)) { return false; } else if (!isDataValueExcluded(nextValueData,nullptr)) { nextValue->initValue(nextValueData->getValue()); return true; } } else { return false; } } return false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeRealValueDataExclusion.cpp0000644000175000017500000001541212520551112031542 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeRealValueDataExclusion.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeRealValueDataExclusion::CDatatypeRealValueDataExclusion() { } CDatatypeRealValueDataExclusion* CDatatypeRealValueDataExclusion::initDataExclusion(CDatatypeRealValueDataExclusion* value) { if (value) { mPosExclusionType = value->mPosExclusionType; mNegExclusionType = value->mNegExclusionType; mPosExclusionDepTrackPoint = value->mPosExclusionDepTrackPoint; mNegExclusionDepTrackPoint = value->mNegExclusionDepTrackPoint; mExcluded = value->mExcluded; mExcludedDepTrackPoint = value->mExcludedDepTrackPoint; } else { mPosExclusionType = CDatatypeRealValueExclusionType::RVET_NOTHING; mNegExclusionType = CDatatypeRealValueExclusionType::RVET_ALL; mPosExclusionDepTrackPoint = nullptr; mNegExclusionDepTrackPoint = nullptr; mExcludedDepTrackPoint = nullptr; mExcluded = false; } return this; } bool CDatatypeRealValueDataExclusion::isExcluded() { return mExcluded; } CDependencyTrackPoint* CDatatypeRealValueDataExclusion::getExcludedDependencyTrackPoint() { return mExcludedDepTrackPoint; } CDatatypeRealValueDataExclusion* CDatatypeRealValueDataExclusion::setExcluded(bool excluded) { mExcluded = excluded; return this; } CDatatypeRealValueDataExclusion* CDatatypeRealValueDataExclusion::setExcludedDependencyTrackPoint(CDependencyTrackPoint* depTrackPoint) { mExcludedDepTrackPoint = depTrackPoint; return this; } bool CDatatypeRealValueDataExclusion::isSomethingExcluded() { if (isExcluded()) { return true; } if (mPosExclusionType != CDatatypeRealValueExclusionType::RVET_NOTHING || mNegExclusionType != CDatatypeRealValueExclusionType::RVET_ALL) { return true; } else { return false; } } bool CDatatypeRealValueDataExclusion::isEverythingExcluded() { if (isExcluded()) { return true; } if ((cint64)mNegExclusionType <= (cint64)mPosExclusionType) { return true; } if (mPosExclusionType == CDatatypeRealValueExclusionType::RVET_ALL || mNegExclusionType == CDatatypeRealValueExclusionType::RVET_NOTHING) { return true; } return false; } bool CDatatypeRealValueDataExclusion::areOnlyIntegerValuesAllowed() { if (isExcluded()) { return false; } if ((cint64)mPosExclusionType == (cint64)CDatatypeRealValueExclusionType::RVET_NOTHING && (cint64)mNegExclusionType == (cint64)CDatatypeRealValueExclusionType::RVET_INTEGER) { return true; } return false; } bool CDatatypeRealValueDataExclusion::areIntegerValuesExcluded() { if (isExcluded()) { return true; } if ((cint64)mPosExclusionType >= (cint64)CDatatypeRealValueExclusionType::RVET_INTEGER) { return true; } if ((cint64)mNegExclusionType < (cint64)CDatatypeRealValueExclusionType::RVET_INTEGER) { return true; } return false; } bool CDatatypeRealValueDataExclusion::areDecimalValuesExcluded() { if (isExcluded()) { return true; } if ((cint64)mPosExclusionType >= (cint64)CDatatypeRealValueExclusionType::RVET_DECIMAL) { return true; } if ((cint64)mNegExclusionType < (cint64)CDatatypeRealValueExclusionType::RVET_DECIMAL) { return true; } return false; } bool CDatatypeRealValueDataExclusion::areRationalValuesExcluded() { if (isExcluded()) { return true; } if ((cint64)mPosExclusionType >= (cint64)CDatatypeRealValueExclusionType::RVET_RATIONAL) { return true; } if ((cint64)mNegExclusionType < (cint64)CDatatypeRealValueExclusionType::RVET_RATIONAL) { return true; } return false; } bool CDatatypeRealValueDataExclusion::areRealValuesExcluded() { if (isExcluded()) { return true; } if ((cint64)mPosExclusionType >= (cint64)CDatatypeRealValueExclusionType::RVET_REAL) { return true; } if ((cint64)mNegExclusionType < (cint64)CDatatypeRealValueExclusionType::RVET_REAL) { return true; } return false; } bool CDatatypeRealValueDataExclusion::isExcluded(CDatatypeRealValueExclusionType* type) { if (isExcluded()) { return true; } if (type->getExclusionNegation()) { if ((cint64)type->getExclusionType() >= (cint64)mNegExclusionType) { return true; } } else { if ((cint64)type->getExclusionType() <= (cint64)mPosExclusionType) { return true; } } return false; } CDatatypeRealValueDataExclusion* CDatatypeRealValueDataExclusion::setExclusion(CDatatypeRealValueExclusionType* type, CDependencyTrackPoint* depTrackPoint) { if (!isExcluded(type)) { if (type->getExclusionNegation()) { mNegExclusionType = type->getExclusionType(); mNegExclusionDepTrackPoint = depTrackPoint; } else { mPosExclusionType = type->getExclusionType(); mPosExclusionDepTrackPoint = depTrackPoint; } } return this; } CDependencyTrackPoint* CDatatypeRealValueDataExclusion::getExclusionDependencyTrackPoint(CDatatypeRealValueExclusionType* type) { if (isExcluded()) { return getExcludedDependencyTrackPoint(); } if (!isExcluded(type)) { return nullptr; } else if (type->getExclusionNegation()) { return mNegExclusionDepTrackPoint; } else { return mPosExclusionDepTrackPoint; } return nullptr; } CDependencyTrackPoint* CDatatypeRealValueDataExclusion::getPositiveExclusionDependencyTrackPoint() { return mPosExclusionDepTrackPoint; } CDependencyTrackPoint* CDatatypeRealValueDataExclusion::getNegativeExclusionDependencyTrackPoint() { return mNegExclusionDepTrackPoint; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeAnalizedConceptExpansionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeAnalizedConceptExpansio0000644000175000017500000001206412520551122032313 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeAnalizedConceptExpansionData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeAnalizedConceptExpansionData::CIndividualNodeAnalizedConceptExpansionData() { } CIndividualNodeAnalizedConceptExpansionData* CIndividualNodeAnalizedConceptExpansionData::initBlockingExplorationData(CIndividualNodeAnalizedConceptExpansionData* prevData) { if (prevData) { mLastConceptCount = prevData->mLastConceptCount; mLastConDes = prevData->mLastConDes; mRevAnaConExpLinker = prevData->mRevAnaConExpLinker; mMinValidConceptCountLimit = prevData->mMinValidConceptCountLimit; mExpCount = prevData->mExpCount; mLastConceptSignature = prevData->mLastConceptSignature; mInvalidBlocker = prevData->mInvalidBlocker; mNonDetExpansionLinker = prevData->mNonDetExpansionLinker; } else { mLastConceptCount = nullptr; mLastConDes = nullptr; mRevAnaConExpLinker = nullptr; mExpCount = 0; mMinValidConceptCountLimit = 0; mLastConceptSignature = 0; mInvalidBlocker = false; mNonDetExpansionLinker = nullptr; } return this; } CIndividualNodeAnalizedConceptExpansionData* CIndividualNodeAnalizedConceptExpansionData::addAnalizedConceptExpansionLinker(CAnalizedConceptExpansionLinker *linker) { mExpCount += linker->getCount(); if (mRevAnaConExpLinker) { mRevAnaConExpLinker = linker->append(mRevAnaConExpLinker); } else { mRevAnaConExpLinker = linker; } return this; } CAnalizedConceptExpansionLinker* CIndividualNodeAnalizedConceptExpansionData::getReverseAnalizedConceptExpansionLinker() { return mRevAnaConExpLinker; } CConceptDescriptor* CIndividualNodeAnalizedConceptExpansionData::getLastConceptDescriptor() { return mLastConDes; } cint64 CIndividualNodeAnalizedConceptExpansionData::getLastConceptCount() { return mLastConceptCount; } cint64 CIndividualNodeAnalizedConceptExpansionData::getExpansionConceptCount() { return mExpCount; } cint64 CIndividualNodeAnalizedConceptExpansionData::getMinimalValidConceptCountLimit() { return mMinValidConceptCountLimit; } cint64 CIndividualNodeAnalizedConceptExpansionData::getLastConceptSignature() { return mLastConceptSignature; } bool CIndividualNodeAnalizedConceptExpansionData::isInvalidBlocker() { return mInvalidBlocker; } CIndividualNodeAnalizedConceptExpansionData* CIndividualNodeAnalizedConceptExpansionData::setLastConceptDescriptor(CConceptDescriptor* conDes) { mLastConDes = conDes; return this; } CIndividualNodeAnalizedConceptExpansionData* CIndividualNodeAnalizedConceptExpansionData::setLastConceptSignature(cint64 signature) { mLastConceptSignature = signature; return this; } CIndividualNodeAnalizedConceptExpansionData* CIndividualNodeAnalizedConceptExpansionData::setLastConceptCount(cint64 conCount) { mLastConceptCount = conCount; return this; } CIndividualNodeAnalizedConceptExpansionData* CIndividualNodeAnalizedConceptExpansionData::setMinimalValidConceptCountLimit(cint64 conCount) { mMinValidConceptCountLimit = conCount; return this; } CIndividualNodeAnalizedConceptExpansionData* CIndividualNodeAnalizedConceptExpansionData::setInvalidBlocker(bool invalid) { mInvalidBlocker = invalid; return this; } CXLinker* CIndividualNodeAnalizedConceptExpansionData::getAnalysedNonDeterministicConceptExpansionLinker() { return mNonDetExpansionLinker; } CIndividualNodeAnalizedConceptExpansionData* CIndividualNodeAnalizedConceptExpansionData::setAnalysedNonDeterministicConceptExpansionLinker(CXLinker* linker) { mNonDetExpansionLinker = linker; return this; } CIndividualNodeAnalizedConceptExpansionData* CIndividualNodeAnalizedConceptExpansionData::addAnalysedNonDeterministicConceptExpansionLinker(CXLinker* linker) { if (linker) { mNonDetExpansionLinker = linker->append(mNonDetExpansionLinker); } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeStatusFlags.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeStatus0000644000175000017500000001136312520551410032436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODESTATUSFLAGS_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODESTATUSFLAGS_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualSaturationProcessNodeStatusFlags * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualSaturationProcessNodeStatusFlags { // public methods public: //! Constructor CIndividualSaturationProcessNodeStatusFlags(); CIndividualSaturationProcessNodeStatusFlags* initStatusFlags(); bool hasClashedFlag(); CIndividualSaturationProcessNodeStatusFlags* setClashedFlag(bool value); bool hasInsufficientFlag(); CIndividualSaturationProcessNodeStatusFlags* setInsufficientFlag(bool value); bool hasCriticalFlag(); CIndividualSaturationProcessNodeStatusFlags* setCriticalFlag(bool value); bool hasNominalConnectionFlag(); CIndividualSaturationProcessNodeStatusFlags* setNominalConnectionFlag(bool value); bool hasEQCandidateProplematicFlag(); CIndividualSaturationProcessNodeStatusFlags* setEQCandidateProplematicFlag(bool value); bool hasCardinalityProplematicFlag(); CIndividualSaturationProcessNodeStatusFlags* setCardinalityProplematicFlag(bool value); bool hasCardinalityRestrictedFlag(); CIndividualSaturationProcessNodeStatusFlags* setCardinalityRestrictedFlag(bool value); bool hasInitializedFlag(); CIndividualSaturationProcessNodeStatusFlags* setInitializedFlag(bool value); bool hasCompletedFlag(); CIndividualSaturationProcessNodeStatusFlags* setCompletedFlag(bool value); bool hasMissedABoxConsistencyFlag(); CIndividualSaturationProcessNodeStatusFlags* setMissedABoxConsistencyFlag(bool value); bool hasSuccessorNodeExtensionsFlag(); CIndividualSaturationProcessNodeStatusFlags* setSuccessorNodeExtensionsFlag(bool value); bool hasUnprocessedFlag(); CIndividualSaturationProcessNodeStatusFlags* setUnprocessedFlag(bool value); bool hasFlags(cint64 flags, bool checkAllFlags); bool hasFlags(CIndividualSaturationProcessNodeStatusFlags* flags, bool checkAllFlags); CIndividualSaturationProcessNodeStatusFlags* setFlags(cint64 flags, bool value); CIndividualSaturationProcessNodeStatusFlags* addFlags(cint64 flags); CIndividualSaturationProcessNodeStatusFlags* addFlags(CIndividualSaturationProcessNodeStatusFlags* flags); CIndividualSaturationProcessNodeStatusFlags* clearFlags(cint64 flags); cint64 getFlags(); const static cint64 INDSATFLAGCLASHED = 0x0001; const static cint64 INDSATFLAGCRITICAL = 0x0002; const static cint64 INDSATFLAGINSUFFICIENT = 0x0004; const static cint64 INDSATFLAGNOMINALCONNECTION = 0x0008; const static cint64 INDSATFLAGEQCANDPROPLEMATIC = 0x0010; const static cint64 INDSATFLAGCARDINALITYRESTRICTED = 0x0020; const static cint64 INDSATFLAGCARDINALITYPROPLEMATIC = 0x0040; const static cint64 INDMISSEDABOXCONSISTENCYDATA = 0x0080; const static cint64 INDSUCCESSORNODEEXTENSIONS = 0x0100; const static cint64 INDSATFLAGINITIALIZED = 0x1000; const static cint64 INDSATFLAGCOMPLETED = 0x2000; const static cint64 INDSATFLAGUNPROCESSED = 0x4000; // protected methods protected: // protected variables protected: cint64 mStatusFlags; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODESTATUSFLAGS_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReusingIndividualNodeConceptExpansionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReusingIndividualNodeConceptExpansion0000644000175000017500000001005512520551150032355 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReusingIndividualNodeConceptExpansionData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CReusingIndividualNodeConceptExpansionData::CReusingIndividualNodeConceptExpansionData() { } CReusingIndividualNodeConceptExpansionData* CReusingIndividualNodeConceptExpansionData::initReusingExpansionData(CReusingIndividualNodeConceptExpansionData* prevData) { if (prevData) { initBlockingExpansionData(prevData); mReusingTriedCount = prevData->mReusingTriedCount; mReusingFailedCount = prevData->mReusingFailedCount; mReuseConceptsDependencyTrackPoint = prevData->mReuseConceptsDependencyTrackPoint; mLastNonDetExpansionLinker = prevData->mLastNonDetExpansionLinker; } else { initBlockingExpansionData(nullptr); mReusingTriedCount = 0; mReusingFailedCount = 0; mReuseConceptsDependencyTrackPoint = nullptr; mLastNonDetExpansionLinker = nullptr; } return this; } cint64 CReusingIndividualNodeConceptExpansionData::getReusingTriedCount() { return mReusingTriedCount; } cint64 CReusingIndividualNodeConceptExpansionData::getReusingFailedCount() { return mReusingFailedCount; } CReusingIndividualNodeConceptExpansionData* CReusingIndividualNodeConceptExpansionData::setReusingTriedCount(cint64 triedCount) { mReusingTriedCount = triedCount; return this; } CReusingIndividualNodeConceptExpansionData* CReusingIndividualNodeConceptExpansionData::setReusingFailedCount(cint64 failedCount) { mReusingFailedCount = failedCount; return this; } CReusingIndividualNodeConceptExpansionData* CReusingIndividualNodeConceptExpansionData::incReusingTriedCount(cint64 incCount) { mReusingTriedCount += incCount; return this; } CReusingIndividualNodeConceptExpansionData* CReusingIndividualNodeConceptExpansionData::incReusingFailedCount(cint64 incCount) { mReusingFailedCount += incCount; return this; } CReusingIndividualNodeConceptExpansionData* CReusingIndividualNodeConceptExpansionData::addReusingFailedSignatureAndIndividual(cint64 conSetSignature, cint64 individualID) { mReusedIndiviudals.insert(individualID); mReusedConceptSetSignatures.insert(conSetSignature); return this; } CNonDeterministicDependencyTrackPoint* CReusingIndividualNodeConceptExpansionData::getReuseConceptsDependencyTrackPoint() { return mReuseConceptsDependencyTrackPoint; } CReusingIndividualNodeConceptExpansionData* CReusingIndividualNodeConceptExpansionData::setReuseConceptsDependencyTrackPoint(CNonDeterministicDependencyTrackPoint* depTrackPoint) { mReuseConceptsDependencyTrackPoint = depTrackPoint; return this; } CXLinker* CReusingIndividualNodeConceptExpansionData::getLastNonDeterministicExpansionLinker() { return mLastNonDetExpansionLinker; } CReusingIndividualNodeConceptExpansionData* CReusingIndividualNodeConceptExpansionData::setLastNonDeterministicExpansionLinker(CXLinker* expLinker) { mLastNonDetExpansionLinker = expLinker; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptLabelSetIterator.cpp0000644000175000017500000000653512520551076030242 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptLabelSetIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptLabelSetIterator::CConceptLabelSetIterator(cint64 conceptCount, CConceptDescriptor* conceptDesLinker, const CPROCESSMAP::iterator& beginIt, const CPROCESSMAP::iterator& endIt) : mConceptCount(conceptCount),mConceptDesLinkerIt(conceptDesLinker),mConDesDepBeginIt(beginIt),mConDesDepEndIt(endIt) { } cint64 CConceptLabelSetIterator::getRemainingConceptCount() { return mConceptCount; } CConceptLabelSetIterator& CConceptLabelSetIterator::operator++() { return *moveNext(); } CConceptDescriptor* CConceptLabelSetIterator::operator*() { return getConceptDescriptor(); } CConceptLabelSetIterator* CConceptLabelSetIterator::moveNext() { if (mConceptDesLinkerIt) { mConceptDesLinkerIt = mConceptDesLinkerIt->getNext(); --mConceptCount; } else { if (mConDesDepBeginIt != mConDesDepEndIt) { ++mConDesDepBeginIt; --mConceptCount; } } return this; } CConceptDescriptor* CConceptLabelSetIterator::getConceptDescriptor() { if (mConceptDesLinkerIt) { return mConceptDesLinkerIt; } else { return mConDesDepBeginIt.value().first; } } CDependencyTrackPoint* CConceptLabelSetIterator::getDependencyTrackPoint() { if (mConceptDesLinkerIt) { return nullptr; } else { return mConDesDepBeginIt.value().second; } } CConceptDescriptor* CConceptLabelSetIterator::next(bool moveToNext) { CConceptDescriptor* conDes = getConceptDescriptor(); if (moveToNext) { moveNext(); } return conDes; } bool CConceptLabelSetIterator::hasValue() { return mConceptDesLinkerIt || mConDesDepBeginIt != mConDesDepEndIt; } bool CConceptLabelSetIterator::hasNext() { return mConceptDesLinkerIt || mConDesDepBeginIt != mConDesDepEndIt; } bool CConceptLabelSetIterator::operator!=(CConceptLabelSetIterator& iterator) { return mConceptDesLinkerIt != iterator.mConceptDesLinkerIt || mConDesDepBeginIt != iterator.mConDesDepBeginIt; } bool CConceptLabelSetIterator::operator==(CConceptLabelSetIterator& iterator) { return mConceptDesLinkerIt == iterator.mConceptDesLinkerIt && mConDesDepBeginIt == iterator.mConDesDepBeginIt; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptVariableBindingPathSetHash.h0000644000175000017500000000451112520551102031575 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTVARIABLEBINDINGPATHSETHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTVARIABLEBINDINGPATHSETHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CVariableBindingPathSet.h" #include "CConceptVariableBindingPathSetHashData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConceptVariableBindingPathSetHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptVariableBindingPathSetHash : public CPROCESSHASH { // public methods public: //! Constructor CConceptVariableBindingPathSetHash(CProcessContext* processContext); CConceptVariableBindingPathSetHash* initConceptVariableBindingPathSetHash(CConceptVariableBindingPathSetHash* prevHash); CVariableBindingPathSet* getVariableBindingPathSet(CConcept* concept, bool localize = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTVARIABLEBINDINGPATHSETHASH_H ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoin0000644000175000017500000001005512520551144032322 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathJoiningKeyData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathJoiningKeyData::CRepresentativeVariableBindingPathJoiningKeyData() { } CRepresentativeVariableBindingPathJoiningKeyData* CRepresentativeVariableBindingPathJoiningKeyData::initVariableBindingPathJoiningData(CRepresentativeVariableBindingPathJoiningKeyData* prevJoinData) { if (prevJoinData) { mKeyVarBindDesLinker = prevJoinData->mKeyVarBindDesLinker; mHashValueCalculated = prevJoinData->mHashValueCalculated; mCalculatedHashValue = prevJoinData->mCalculatedHashValue; mJoiningKey = prevJoinData->mJoiningKey; } else { mKeyVarBindDesLinker = nullptr; mHashValueCalculated = false; mCalculatedHashValue = 0; mJoiningKey = 0; } return this; } CRepresentativeVariableBindingPathJoiningKeyData* CRepresentativeVariableBindingPathJoiningKeyData::initVariableBindingPathJoiningData(CVariableBindingDescriptor* keyVarBindDesLinker, cint64 joiningKey) { mJoiningKey = joiningKey; mKeyVarBindDesLinker = keyVarBindDesLinker; mHashValueCalculated = false; mCalculatedHashValue = getCalculatedHashValue(); return this; } CVariableBindingDescriptor* CRepresentativeVariableBindingPathJoiningKeyData::getKeyVariableBindingDescriptorLinker() const { return mKeyVarBindDesLinker; } cint64 CRepresentativeVariableBindingPathJoiningKeyData::getJoiningKey() const { return mJoiningKey; } cint64 CRepresentativeVariableBindingPathJoiningKeyData::getCalculatedHashValue() const { if (!mHashValueCalculated) { mHashValueCalculated = true; mCalculatedHashValue = 0; cint64 multiplier = 13; for (CVariableBindingDescriptor* linkerIt = mKeyVarBindDesLinker; linkerIt; linkerIt = linkerIt->getNext()) { CVariableBinding* variableBinding = linkerIt->getVariableBinding(); mCalculatedHashValue += multiplier*(cint64)variableBinding; multiplier = multiplier*2+1; } } return mCalculatedHashValue; } bool CRepresentativeVariableBindingPathJoiningKeyData::isKeyEquivalentTo(const CRepresentativeVariableBindingPathJoiningKeyData& data) const { if (mJoiningKey != data.mJoiningKey) { return false; } return true; } bool CRepresentativeVariableBindingPathJoiningKeyData::isKeyEquivalentTo(CVariableBindingPath* varBindPath) const { CVariableBindingDescriptor* linkerIt1 = mKeyVarBindDesLinker; CVariableBindingDescriptor* linkerIt2 = varBindPath->getVariableBindingDescriptorLinker(); while (linkerIt2 && linkerIt1) { if (linkerIt2->getVariableBinding()->getBindedVariable() < linkerIt1->getVariableBinding()->getBindedVariable()) { linkerIt2 = linkerIt2->getNext(); } else { if (linkerIt1->getVariableBinding() != linkerIt2->getVariableBinding()) { return false; } linkerIt1 = linkerIt1->getNext(); linkerIt2 = linkerIt2->getNext(); } } if (linkerIt1) { return false; } return true; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptDescriptorDependencyReapplyData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptDescriptorDependencyReapplyDat0000644000175000017500000000470212520551076032351 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTDESCRIPTORDEPENDENCYREAPPLYDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTDESCRIPTORDEPENDENCYREAPPLYDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "CReapplyQueue.h" #include "CCondensedReapplyQueue.h" #include "Dependency/CDependencyTrackPoint.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CConceptDescriptorDependencyReapplyData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptDescriptorDependencyReapplyData { // public methods public: //! Constructor CConceptDescriptorDependencyReapplyData(); CConceptDescriptorDependencyReapplyData(CConceptDescriptor* conceptDescriptor); CConceptDescriptorDependencyReapplyData(const CConceptDescriptorDependencyReapplyData& data); // public variables public: CConceptDescriptor* mConceptDescriptor; CCondensedReapplyQueue mPosNegReapplyQueue; //CReapplyQueue mPosReapplyQueue; //CReapplyQueue mNegReapplyQueue; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTDESCRIPTORDEPENDENCYREAPPLYDATA_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathMap.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathMap.0000644000175000017500000000314312520551146032220 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathMap::CRepresentativeVariableBindingPathMap(CProcessContext* processContext) : mProcessContext(processContext),CPROCESSMAP(processContext) { } CRepresentativeVariableBindingPathMap* CRepresentativeVariableBindingPathMap::initVariableBindingPathMap(CRepresentativeVariableBindingPathMap* prevMap) { if (prevMap) { *this = *prevMap; } else { CPROCESSMAP::clear(); } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetD0000644000175000017500000001630212520551146032265 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathSetData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathSetData::CRepresentativeVariableBindingPathSetData(CProcessContext* processContext) : CLinkerBase(0),CLocalizationTag(processContext->getUsedProcessTagger()->getCurrentLocalizationTag()) { mProcessContext = processContext; } CRepresentativeVariableBindingPathSetData* CRepresentativeVariableBindingPathSetData::initRepresentativeVariableBindingPathData(CRepresentativeVariableBindingPathSetData* data) { if (data) { setData(data->getData()); mMigratable = data->mMigratable; mUseCount = data->mUseCount; mShareCount = data->mShareCount; mUseMigrateData = data->mUseMigrateData; mSigKey.initSignature(&data->mSigKey); mUseJoiningHash = data->mUseJoiningHash; mLocMigrateData = nullptr; mLocJoiningHash = nullptr; } else { setData(0); mMigratable = true; mUseMigrateData = nullptr; mLocMigrateData = nullptr; mUseJoiningHash = nullptr; mLocJoiningHash = nullptr; mSigKey.initSignature(nullptr); mUseCount = 0; mShareCount = 0; } return this; } cint64 CRepresentativeVariableBindingPathSetData::getRepresentativeKey() { return mSigKey.getSignatureValue(); } cint64 CRepresentativeVariableBindingPathSetData::getRepresentativeID() { return getData(); } CRepresentativeVariableBindingPathSetData* CRepresentativeVariableBindingPathSetData::setRepresentativeID(cint64 repID) { setData(repID); return this; } cint64 CRepresentativeVariableBindingPathSetData::getUseCount() { return mUseCount; } CRepresentativeVariableBindingPathSetData* CRepresentativeVariableBindingPathSetData::setUseCount(cint64 useCount) { mUseCount = useCount; return this; } CRepresentativeVariableBindingPathSetData* CRepresentativeVariableBindingPathSetData::incUseCount(cint64 incCount) { mUseCount += incCount; return this; } cint64 CRepresentativeVariableBindingPathSetData::getShareCount() { return mShareCount; } CRepresentativeVariableBindingPathSetData* CRepresentativeVariableBindingPathSetData::setShareCount(cint64 shareCount) { mShareCount = shareCount; return this; } CRepresentativeVariableBindingPathSetData* CRepresentativeVariableBindingPathSetData::incShareCount(cint64 incCount) { mShareCount += incCount; return this; } CRepresentativeVariableBindingPathSetData* CRepresentativeVariableBindingPathSetData::decShareCount(cint64 decCount) { mShareCount -= decCount; return this; } bool CRepresentativeVariableBindingPathSetData::isMigratable() { return mMigratable; } CRepresentativeVariableBindingPathSetData* CRepresentativeVariableBindingPathSetData::setMigratable(bool migratable) { mMigratable = migratable; return this; } bool CRepresentativeVariableBindingPathSetData::hasMigrateData() { return mUseMigrateData != nullptr; } CRepresentativeVariableBindingPathSetData* CRepresentativeVariableBindingPathSetData::addKeySignatureValue(cint64 keySignatureValue) { mSigKey.addKey(keySignatureValue); return this; } CRepresentativeVariableBindingPathSetDataSignature* CRepresentativeVariableBindingPathSetData::getKeySignature() { return &mSigKey; } CRepresentativeVariableBindingPathSetMigrateData* CRepresentativeVariableBindingPathSetData::getMigrateData(bool localizeOrCreate) { CRepresentativeVariableBindingPathSetMigrateData* data = nullptr; if (!mLocMigrateData && localizeOrCreate) { mLocMigrateData = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(mProcessContext->getMemoryAllocationManager(),mProcessContext); mLocMigrateData->initRepresentativeVariableBindingPathSetMigrateData(mUseMigrateData); mUseMigrateData = mLocMigrateData; } return mUseMigrateData; } CRepresentativeVariableBindingPathSetMigrateData* CRepresentativeVariableBindingPathSetData::takeMigrateDataFrom(CRepresentativeVariableBindingPathSetData* repData) { mLocMigrateData = repData->mUseMigrateData; mUseMigrateData = mLocMigrateData; mSigKey.initSignature(&repData->mSigKey); repData->mUseMigrateData = nullptr; repData->mLocMigrateData = nullptr; return mUseMigrateData; } CRepresentativeVariableBindingPathSetMigrateData* CRepresentativeVariableBindingPathSetData::copyMigrateDataFrom(CRepresentativeVariableBindingPathSetData* repData) { mLocMigrateData = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(mProcessContext->getMemoryAllocationManager(),mProcessContext); mLocMigrateData->initRepresentativeVariableBindingPathSetMigrateData(repData->mUseMigrateData); mSigKey.initSignature(&repData->mSigKey); mUseMigrateData = mLocMigrateData; return mUseMigrateData; } CRepresentativeVariableBindingPathSetJoiningHash* CRepresentativeVariableBindingPathSetData::getJoiningHash(bool create) { if (create && !mLocJoiningHash) { mLocJoiningHash = CObjectParameterizingAllocator< CRepresentativeVariableBindingPathSetJoiningHash,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mLocJoiningHash->initRepresentativeVariableBindingPathSetJoiningHash(mUseJoiningHash); mUseJoiningHash = mLocJoiningHash; } return mUseJoiningHash; } bool CRepresentativeVariableBindingPathSetData::hasJoiningData(CConcept* joinConcept) { if (!mUseJoiningHash) { return false; } const CRepresentativeVariableBindingPathSetJoiningHashData& joiningData = mUseJoiningHash->value(joinConcept); return joiningData.mUseJoiningData != nullptr; } cint64 CRepresentativeVariableBindingPathSetData::getRepresentatedVariableCount() { cint64 varCount = 0; if (mUseMigrateData) { varCount = mUseMigrateData->getRepresentativeVariableBindingPathMap()->count(); } return varCount; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptNominalSchemaGroundingHash.cpp0000644000175000017500000000317612520551100032216 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptNominalSchemaGroundingHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptNominalSchemaGroundingHash::CConceptNominalSchemaGroundingHash(CProcessContext* context) : CPROCESSHASH(context) { mContext = context; } CConceptNominalSchemaGroundingHash* CConceptNominalSchemaGroundingHash::initConceptNominalSchemaGroundingHash(CConceptNominalSchemaGroundingHash* prevHash) { if (prevHash) { *this = *prevHash; } else { CPROCESSHASH::clear(); } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeStatusFlags.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeStatus0000644000175000017500000001547512520551130032445 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualSaturationProcessNodeStatusFlags.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualSaturationProcessNodeStatusFlags::CIndividualSaturationProcessNodeStatusFlags() { initStatusFlags(); } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::initStatusFlags() { mStatusFlags = 0; return this; } bool CIndividualSaturationProcessNodeStatusFlags::hasClashedFlag() { return hasFlags(INDSATFLAGCLASHED,false); } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setClashedFlag(bool value) { setFlags(INDSATFLAGCLASHED,value); return this; } bool CIndividualSaturationProcessNodeStatusFlags::hasInsufficientFlag() { return hasFlags(INDSATFLAGINSUFFICIENT,false); } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setInsufficientFlag(bool value) { setFlags(INDSATFLAGINSUFFICIENT,value); return this; } bool CIndividualSaturationProcessNodeStatusFlags::hasCriticalFlag() { return hasFlags(INDSATFLAGCRITICAL,false); } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setCriticalFlag(bool value) { setFlags(INDSATFLAGCRITICAL,value); return this; } bool CIndividualSaturationProcessNodeStatusFlags::hasNominalConnectionFlag() { return hasFlags(INDSATFLAGNOMINALCONNECTION,false); } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setNominalConnectionFlag(bool value) { setFlags(INDSATFLAGNOMINALCONNECTION,value); return this; } bool CIndividualSaturationProcessNodeStatusFlags::hasEQCandidateProplematicFlag() { return hasFlags(INDSATFLAGEQCANDPROPLEMATIC,false); } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setEQCandidateProplematicFlag(bool value) { setFlags(INDSATFLAGEQCANDPROPLEMATIC,value); return this; } bool CIndividualSaturationProcessNodeStatusFlags::hasCardinalityProplematicFlag() { return hasFlags(INDSATFLAGCARDINALITYPROPLEMATIC,false); } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setCardinalityProplematicFlag(bool value) { setFlags(INDSATFLAGCARDINALITYPROPLEMATIC,value); return this; } bool CIndividualSaturationProcessNodeStatusFlags::hasCardinalityRestrictedFlag() { return hasFlags(INDSATFLAGCARDINALITYRESTRICTED,false); } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setCardinalityRestrictedFlag(bool value) { setFlags(INDSATFLAGCARDINALITYRESTRICTED,value); return this; } bool CIndividualSaturationProcessNodeStatusFlags::hasInitializedFlag() { return hasFlags(INDSATFLAGINITIALIZED,false); } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setInitializedFlag(bool value) { setFlags(INDSATFLAGINITIALIZED,value); return this; } bool CIndividualSaturationProcessNodeStatusFlags::hasCompletedFlag() { return hasFlags(INDSATFLAGCOMPLETED,false); } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setCompletedFlag(bool value) { setFlags(INDSATFLAGCOMPLETED,value); return this; } bool CIndividualSaturationProcessNodeStatusFlags::hasMissedABoxConsistencyFlag() { return hasFlags(INDMISSEDABOXCONSISTENCYDATA,false); } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setMissedABoxConsistencyFlag(bool value) { setFlags(INDMISSEDABOXCONSISTENCYDATA,value); return this; } bool CIndividualSaturationProcessNodeStatusFlags::hasSuccessorNodeExtensionsFlag() { return hasFlags(INDSUCCESSORNODEEXTENSIONS,false); } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setSuccessorNodeExtensionsFlag(bool value) { setFlags(INDSUCCESSORNODEEXTENSIONS,value); return this; } bool CIndividualSaturationProcessNodeStatusFlags::hasUnprocessedFlag() { return hasFlags(INDSATFLAGUNPROCESSED,false); } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setUnprocessedFlag(bool value) { setFlags(INDSATFLAGUNPROCESSED,value); return this; } bool CIndividualSaturationProcessNodeStatusFlags::hasFlags(cint64 flags, bool checkAllFlags) { if (flags == 0) { return true; } if (checkAllFlags) { return (~mStatusFlags & flags) == 0; } else { return (mStatusFlags & flags) != 0; } } bool CIndividualSaturationProcessNodeStatusFlags::hasFlags(CIndividualSaturationProcessNodeStatusFlags* flags, bool checkAllFlags) { return hasFlags(flags->getFlags(),checkAllFlags); } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::setFlags(cint64 flags, bool value) { if (value) { mStatusFlags |= flags; } else { mStatusFlags = (mStatusFlags & ~flags); } return this; } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::addFlags(CIndividualSaturationProcessNodeStatusFlags* flags) { addFlags(flags->getFlags()); return this; } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::addFlags(cint64 flags) { mStatusFlags |= flags; return this; } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNodeStatusFlags::clearFlags(cint64 flags) { mStatusFlags = (mStatusFlags & ~flags); return this; } cint64 CIndividualSaturationProcessNodeStatusFlags::getFlags() { return mStatusFlags; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationSuccessorLinkDataLinker.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationSuccessorLinkData0000644000175000017500000000435712520551130032373 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONSUCCESSORLINKDATALINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONSUCCESSORLINKDATALINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CSaturationSuccessorData.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Utilities/Container/CLinker.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualSaturationSuccessorLinkDataLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualSaturationSuccessorLinkDataLinker : public CLinkerBase { // public methods public: //! Constructor CIndividualSaturationSuccessorLinkDataLinker(); CIndividualSaturationSuccessorLinkDataLinker* initSuccessorLinkDataLinker(CSaturationSuccessorData* succLinkData); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONSUCCESSORLINKDATALINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeRealValueExclusionType.cpp0000644000175000017500000000345612520551112031617 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeRealValueExclusionType.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeRealValueExclusionType::CDatatypeRealValueExclusionType(CDatatypeRealValueExclusionType::REAL_VALUE_EXCLUSION_TYPE exclusionType, bool negated) { mExclusionType = exclusionType; mExclusionNegation = negated; } CDatatypeRealValueExclusionType* CDatatypeRealValueExclusionType::setExclusionType(CDatatypeRealValueExclusionType::REAL_VALUE_EXCLUSION_TYPE exclusionType, bool negated) { mExclusionType = exclusionType; mExclusionNegation = negated; return this; } CDatatypeRealValueExclusionType::REAL_VALUE_EXCLUSION_TYPE CDatatypeRealValueExclusionType::getExclusionType() { return mExclusionType; } bool CDatatypeRealValueExclusionType::getExclusionNegation() { return mExclusionNegation; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingTriggerLinker.h0000644000175000017500000000555712520551166030702 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGTRIGGERLINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGTRIGGERLINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CVariableBindingPath.h" #include "CVariableBindingPathDescriptor.h" #include "CVariableBindingDescriptor.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CVariableBindingTriggerLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingTriggerLinker : public CLinkerBase { // public methods public: //! Constructor CVariableBindingTriggerLinker(CVariableBindingPathDescriptor* varBindPath = nullptr); CVariableBindingTriggerLinker* initTriggerLinker(CVariableBindingPathDescriptor* varBindPathDes, CVariableBindingDescriptor* varBindDes, bool leftTriggered); CVariableBindingPathDescriptor* getVariableBindingPathDescriptor(); CVariableBindingTriggerLinker* setVariableBindingPathDescriptor(CVariableBindingPathDescriptor* varBindPathDes); CVariableBindingDescriptor* getNextTriggerVariableBindingDescriptor(); CVariableBindingTriggerLinker* setNextTriggerVariableBindingDescriptor(CVariableBindingDescriptor* varBindDes); bool isLeftTriggered(); CVariableBindingTriggerLinker* setLeftTriggered(bool leftTriggered); // protected methods protected: // protected variables protected: CVariableBindingDescriptor* mNextTriggerVariableBinding; bool mLeftTriggered; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGTRIGGERLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleReapplyHash.cpp0000644000175000017500000000427212520551152026552 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleReapplyHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRoleReapplyHash::CRoleReapplyHash(CProcessContext* processContext) : CPROCESSHASH(processContext) { } CRoleReapplyHash::~CRoleReapplyHash() { } CRoleReapplyHash* CRoleReapplyHash::initRoleReapplyHash(CRoleReapplyHash* prevRoleReapplyHash) { if (prevRoleReapplyHash) { *this = *prevRoleReapplyHash; } else { CPROCESSHASH::clear(); } return this; } CReapplyQueue* CRoleReapplyHash::getRoleReapplyQueue(CRole* role, bool create) { if (create) { return &this->operator[](role); } else { if (contains(role)) { return &this->operator[](role); } else { return nullptr; } } } bool CRoleReapplyHash::containsRoleReapplyQueue(CRole* role) { return contains(role); } CReapplyQueueIterator CRoleReapplyHash::getRoleReapplyIterator(CRole* role, bool clearDynamicReapplyQueue) { CReapplyQueue* reapplyQueue = nullptr; if (tryGetValuePointer(role,reapplyQueue)) { return reapplyQueue->getIterator(clearDynamicReapplyQueue); } return CReapplyQueueIterator(nullptr,nullptr); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBranchingMergingIndividualNodeCandidateLinker.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBranchingMergingIndividualNodeCandida0000644000175000017500000000641012520551074032215 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBRANCHINGMERGINGINDIVIDUALNODECANDIDATELINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBRANCHINGMERGINGINDIVIDUALNODECANDIDATELINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CIndividualProcessNode.h" // Other includes #include "Utilities/Container/CSortedLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CBranchingMergingIndividualNodeCandidateLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBranchingMergingIndividualNodeCandidateLinker : public CSortedLinkerBase { // public methods public: //! Constructor CBranchingMergingIndividualNodeCandidateLinker(CProcessContext* processContext = nullptr); //! Destructor virtual ~CBranchingMergingIndividualNodeCandidateLinker(); CBranchingMergingIndividualNodeCandidateLinker* initBranchingMergingIndividualNodeCandidate(CBranchingMergingIndividualNodeCandidateLinker* prevRest = nullptr); CBranchingMergingIndividualNodeCandidateLinker* initBranchingMergingIndividualNodeCandidate(CIndividualProcessNode* mergingIndiNodeCand, CIndividualLinkEdge* mergingLink); CIndividualProcessNode* getMergingIndividualNodeCandidate(); CBranchingMergingIndividualNodeCandidateLinker* setMergingIndividualNodeCandidate(CIndividualProcessNode* mergingIndiNodeCand); CIndividualLinkEdge* getMergingIndividualLink(); CBranchingMergingIndividualNodeCandidateLinker* setMergingIndividualLink(CIndividualLinkEdge* mergingLink); bool isCandidateBlockableAndCreator(); bool operator<=(const CBranchingMergingIndividualNodeCandidateLinker& otherIndiNodeCandLinker); // protected methods protected: // protected variables protected: CIndividualProcessNode* mMergingIndiNodeCandidate; CProcessContext* mProcessContext; CIndividualLinkEdge* mMergingLink; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBRANCHINGMERGINGINDIVIDUALNODECANDIDATELINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathDescriptor.h0000644000175000017500000000442512520551162031052 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHDESCRIPTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CDependencyTracker.h" #include "CVariableBindingPath.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CVariableBindingPathDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingPathDescriptor : public CLinkerBase, public CDependencyTracker { // public methods public: //! Constructor CVariableBindingPathDescriptor(); CVariableBindingPathDescriptor* initVariableBindingPathDescriptor(CVariableBindingPath* varBindPath, CDependencyTrackPoint* dependencyTrackPoint); CVariableBindingPath* getVariableBindingPath(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathSet.h0000644000175000017500000000612512520551164027470 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHSET_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHSET_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "CVariableBindingPathMap.h" #include "CVariableBindingPathMapData.h" #include "CVariableBindingPathDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CVariableBindingPathSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingPathSet { // public methods public: //! Constructor CVariableBindingPathSet(CProcessContext* processContext); CVariableBindingPathSet* initVariableBindingPathSet(CVariableBindingPathSet* prevSet); CVariableBindingPathMap* getVariableBindingPathMap(); bool containsVariableBindingPath(CVariableBindingPath* variableBindingPath); bool containsVariableBindingPath(cint64 bindingID); CVariableBindingPathDescriptor* getVariableBindingPathDescriptor(CVariableBindingPath* variableBindingPath); CVariableBindingPathSet* addVariableBindingPath(CVariableBindingPathDescriptor* varBindPathDes); CVariableBindingPathSet* copyVariableBindingPaths(CVariableBindingPathMap* varBindPathMap); CConceptDescriptor* getConceptDescriptor(); CVariableBindingPathSet* setConceptDescriptor(CConceptDescriptor* conDes); CVariableBindingPathSet* addVariableBindingPathDescriptorLinker(CVariableBindingPathDescriptor* varBindPathDesLinker); CVariableBindingPathDescriptor* getVariableBindingPathDescriptorLinker(); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CVariableBindingPathMap mVarBindPathMap; CConceptDescriptor* mConceptDescriptor; CVariableBindingPathDescriptor* mVarBindPathDesLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHSET_H ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningKeyDataMap.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJ0000644000175000017500000000326212520551150032267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathSetJoiningKeyDataMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathSetJoiningKeyDataMap::CRepresentativeVariableBindingPathSetJoiningKeyDataMap(CProcessContext* processContext) : mProcessContext(processContext),CPROCESSMAP(processContext) { } CRepresentativeVariableBindingPathSetJoiningKeyDataMap* CRepresentativeVariableBindingPathSetJoiningKeyDataMap::initVariableBindingPathSetJoiningKeyDataMap(CRepresentativeVariableBindingPathSetJoiningKeyDataMap* prevMap) { if (prevMap) { *this = *prevMap; } else { CPROCESSMAP::clear(); } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualProcessNodeDescriptor.h0000644000175000017500000000477312520551126031460 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODEDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODEDESCRIPTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" #include "CIndividualProcessNodePriority.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualProcessNodeDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeDescriptor { // public methods public: //! Constructor CIndividualProcessNodeDescriptor(CIndividualProcessNode *individual, CIndividualProcessNodePriority processPriority); CIndividualProcessNodeDescriptor(); //! Destructor virtual ~CIndividualProcessNodeDescriptor(); virtual CIndividualProcessNodeDescriptor *init(CIndividualProcessNode *individual, CIndividualProcessNodePriority processPriority); CIndividualProcessNode *getIndividual(); CIndividualProcessNodePriority getProcessPriority(); bool operator<=(CIndividualProcessNodeDescriptor &descriptor); // protected methods protected: // protected variables protected: CIndividualProcessNode *ind; CIndividualProcessNodePriority priority; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODEDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceMapData.cpp0000644000175000017500000000254112520551114031263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeRealValueSpaceMapData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeRealValueSpaceMapData::CDatatypeRealValueSpaceMapData() { mLocValue = nullptr; mUseValue = nullptr; } CDatatypeRealValueSpaceMapData::CDatatypeRealValueSpaceMapData(const CDatatypeRealValueSpaceMapData& data) { mUseValue = data.mUseValue; mLocValue = nullptr; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeHash.h0000644000175000017500000000551312520551156032070 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONNOMINALDEPENDENTNODEHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONNOMINALDEPENDENTNODEHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CSaturationNominalDependentNodeData.h" #include "CSaturationNominalDependentNodeHashData.h" #include "CIndividualSaturationProcessNode.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationNominalDependentNodeHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNominalDependentNodeHash { // public methods public: //! Constructor CSaturationNominalDependentNodeHash(CProcessContext* processContext); CSaturationNominalDependentNodeHash* initNominalDependentNodeHash(CSaturationNominalDependentNodeHash* nominalDependentHash); CSaturationNominalDependentNodeData* getNominalDependentNodeData(cint64 nominalID); CSaturationNominalDependentNodeHash* addNominalDependentNodeData(cint64 nominalID, CSaturationNominalDependentNodeData* dependentNodeData); CSaturationNominalDependentNodeHash* addNominalDependentNode(cint64 nominalID, CIndividualSaturationProcessNode* dependentNode, CSaturationNominalDependentNodeData::NOMINALCONNECTIONTYPE connectionType); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CPROCESSHASH mNominalDependentNodeDataHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONNOMINALDEPENDENTNODEHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualProcessNodeVector.cpp0000644000175000017500000000255512520551126031133 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeVector.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualProcessNodeVector::CIndividualProcessNodeVector(CProcessContext* processContext) : CDefaultDynamicReferenceVectorBase(processContext) { } CIndividualProcessNodeVector::~CIndividualProcessNodeVector() { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyConceptSaturationLabelSetIterator.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyConceptSaturationLabelSetItera0000644000175000017500000000703712520551140032331 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTSATURATIONLABELSETITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTSATURATIONLABELSETITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptorDependencyReapplyData.h" #include "CConceptSaturationDescriptorReapplyData.h" #include "CConceptSaturationDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CReapplyConceptSaturationLabelSetIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReapplyConceptSaturationLabelSetIterator { // public methods public: //! Constructor CReapplyConceptSaturationLabelSetIterator(const CPROCESSHASH::const_iterator& itBegin, const CPROCESSHASH::const_iterator& itEnd, const CPROCESSHASH::const_iterator& itAdditionalBegin, const CPROCESSHASH::const_iterator& itAdditionalEnd, bool iterateConSatDes = true, bool iterateReapplies = true); cint64 getDataTag(); CConceptSaturationDescriptor* getConceptSaturationDescriptor(); CImplicationReapplyConceptSaturationDescriptor* getImplicationReapplyConceptSaturationDescriptor(); bool hasNext(); cint64 next(bool moveToNext = true); CReapplyConceptSaturationLabelSetIterator* moveNext(); bool operator!=(CReapplyConceptSaturationLabelSetIterator& const_iterator); bool operator==(CReapplyConceptSaturationLabelSetIterator& const_iterator); // protected methods protected: bool isIteratorValid(); bool isIteratorValid(bool allowConSatDes, bool allowReapplies); // protected variables protected: CPROCESSHASH::const_iterator mItBegin; CPROCESSHASH::const_iterator mItEnd; CPROCESSHASH::const_iterator mItAdditionalBegin; CPROCESSHASH::const_iterator mItAdditionalEnd; bool mIterateConSatDes; bool mIterateReapplies; cint64 mMaxSaturationDepthIterate; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTSATURATIONLABELSETITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CLinkedRoleSaturationSuccessorData.cpp0000644000175000017500000000376312520551130032276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLinkedRoleSaturationSuccessorData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CLinkedRoleSaturationSuccessorData::CLinkedRoleSaturationSuccessorData(CProcessContext* context) : mContext(context),mSuccNodeDataMap(context) { mSuccCount = 0; mLastLink = nullptr; mRoleALLConceptsProcessingQueued = false; mRoleFUNCTIONALConceptsProcessingQueued = false; mExtensionData = nullptr; mRoleFUNCTIONALConceptsQueuingRequired = false; mRoleALLConceptsQueuingRequired = false; } CPROCESSMAP* CLinkedRoleSaturationSuccessorData::getSuccessorNodeDataMap(bool create) { return &mSuccNodeDataMap; } CSaturationSuccessorData* CLinkedRoleSaturationSuccessorData::getLastSuccessorLinkData() { return mLastLink; } cint64 CLinkedRoleSaturationSuccessorData::getSuccessorCount() { return mSuccCount; } CSaturationSuccessorExtensionData* CLinkedRoleSaturationSuccessorData::getSucessorExtensionData() { return mExtensionData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativePropagationMap.h0000644000175000017500000000424612520551144031021 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CRepresentativePropagationMap_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CRepresentativePropagationMap_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRepresentativePropagationMapData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRepresentativePropagationMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativePropagationMap : public CPROCESSMAP { // public methods public: //! Constructor CRepresentativePropagationMap(CProcessContext* processContext); CRepresentativePropagationMap* initRepresentativePropagationMap(CRepresentativePropagationMap* prevMap); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CRepresentativePropagationMap_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleSaturationProcessLinker.h0000644000175000017500000000415512520551152030634 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CROLESATURATIONPROCESSLINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CROLESATURATIONPROCESSLINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRoleSaturationProcessLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleSaturationProcessLinker : public CLinkerBase { // public methods public: //! Constructor CRoleSaturationProcessLinker(); CRoleSaturationProcessLinker* initRoleProcessLinker(CRole* role); CRole* getRole(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CROLESATURATIONPROCESSLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceData.h0000644000175000017500000000511112520551110030765 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUESPACEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUESPACEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeValueSpaceData.h" #include "CDatatypeCompareValueSpaceData.h" #include "CDatatypeCompareValueSpaceMap.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceCompareType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeCompareValueSpaceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeCompareValueSpaceData : public CDatatypeValueSpaceData { // public methods public: //! Constructor CDatatypeCompareValueSpaceData(CProcessContext* processContext); CDatatypeCompareValueSpaceData* copyCompareValueSpaceData(CDatatypeCompareValueSpaceData* spaceData); CDatatypeCompareValueSpaceData* initCompareValueSpaceData(CDatatypeValueSpaceCompareType* valueSpaceType); CDatatypeCompareValueSpaceMap* getValueSpaceMap(bool create); // protected methods protected: virtual CDatatypeCompareValueSpaceMap* createValueSpaceMap() = 0; // protected variables protected: CDatatypeCompareValueSpaceMap* mValueSpaceMap; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUESPACEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptDescriptor.cpp0000644000175000017500000000467512520551076027156 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptDescriptor::CConceptDescriptor() { } CConceptDescriptor* CConceptDescriptor::initConceptDescriptor(CConcept* concept, bool negated, CDependencyTrackPoint* depTrackPoint) { initNegLinker(concept,negated); initDependencyTracker(depTrackPoint); return this; } bool CConceptDescriptor::isEqualsToBOTTOM(bool negated) { return getData()->isEqualsToBOTTOM(isNegated()^negated); } bool CConceptDescriptor::isEqualsToTOP(bool negated) { return getData()->isEqualsToTOP(isNegated()^negated); } CConcept *CConceptDescriptor::getConcept() { return getData(); } qint64 CConceptDescriptor::getConceptTag() { return getData()->getConceptTag(); } qint64 CConceptDescriptor::getTerminologyTag() { return getData()->getTerminologyTag(); } QPair CConceptDescriptor::getTerminologyConceptTagPair() { return getData()->getTerminologyConceptTagPair(); } bool CConceptDescriptor::isClashWith(CConceptDescriptor *conDesNegLinker) { if (conDesNegLinker->isNegated() == isNegated()) { return false; } if (getConceptTag() == conDesNegLinker->getConceptTag()) { if (getTerminologyTag() == conDesNegLinker->getTerminologyTag()) { return true; } } return false; } CConceptDescriptor *CConceptDescriptor::getNextConceptDesciptor() { return getNext(); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBranchingTag.h0000644000175000017500000000516012520551074025504 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBRANCHINGTAG_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBRANCHINGTAG_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessTag.h" #include "CProcessTagger.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CBranchingTag * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBranchingTag : public CProcessTag { // public methods public: //! Constructor CBranchingTag(cint64 branchingTag = 0); cint64 getBranchingTag(); CBranchingTag* setBranchingTag(cint64 branchingTag); CBranchingTag* setBranchingTag(CProcessTagger* processTagger); CBranchingTag* initBranchingTag(cint64 branchingTag); CBranchingTag* initBranchingTag(CProcessTagger* processTagger); bool updateBranchingTag(cint64 branchingTag); bool updateBranchingTag(CProcessTagger* processTagger); bool addMaximumBranchingTagCandidate(cint64 branchingTag); CBranchingTag* incBranchingTag(cint64 incCount = 1); bool isBranchingTagUpdated(cint64 branchingTag); bool isBranchingTagUpToDate(cint64 branchingTag); bool isBranchingTagUpdated(CProcessTagger* processTagger); bool isBranchingTagUpToDate(CProcessTagger* processTagger); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBRANCHINGTAG_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingReviewData.cpp0000644000175000017500000000464012520551160031074 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureBlockingReviewData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSignatureBlockingReviewData::CSignatureBlockingReviewData(CProcessContext* context) : mIndividualSet(context),mDepthIndividualMap(context) { mContext = context; } CSignatureBlockingReviewData* CSignatureBlockingReviewData::initSignatureBlockingReviewData(CSignatureBlockingReviewData* sigBlockRevData) { if (sigBlockRevData) { mIndividualSet = sigBlockRevData->mIndividualSet; mDepthIndividualMap = sigBlockRevData->mDepthIndividualMap; } else { mIndividualSet.clear(); mDepthIndividualMap.clear(); } return this; } CSignatureBlockingReviewData* CSignatureBlockingReviewData::insert(cint64 depth, cint64 indiID) { if (!mIndividualSet.contains(indiID)) { mIndividualSet.insert(indiID); mDepthIndividualMap.insertMulti(depth,indiID); } return this; } bool CSignatureBlockingReviewData::contains(cint64 indiID) { return mIndividualSet.contains(indiID); } CSignatureBlockingReviewData* CSignatureBlockingReviewData::remove(cint64 indiID) { mIndividualSet.remove(indiID); return this; } bool CSignatureBlockingReviewData::isEmpty() { return mIndividualSet.isEmpty(); } CSignatureBlockingReviewDataIterator CSignatureBlockingReviewData::getIterator() { return CSignatureBlockingReviewDataIterator(&mIndividualSet,&mDepthIndividualMap); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptProcessingPriorityQueueData.h0000644000175000017500000000445012520551100032135 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSINGPRIORITYQUEUEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSINGPRIORITYQUEUEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptProcessDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CConceptProcessingPriorityQueueData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptProcessingPriorityQueueData { // public methods public: //! Constructor inline CConceptProcessingPriorityQueueData() { mDefaultPriorityDescriptorLinker = nullptr; mSortedPriorityDescriptorLinker = nullptr; mPrevSortedPriorityDescriptorLinker = nullptr; } CConceptProcessDescriptor* mDefaultPriorityDescriptorLinker; CConceptProcessDescriptor* mSortedPriorityDescriptorLinker; CConceptProcessDescriptor* mPrevSortedPriorityDescriptorLinker; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSINGPRIORITYQUEUEDATA_H ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorExtensionIndividualNodeProcessingQueue.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorExtensionIndividua0000644000175000017500000001023012520551160032472 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationSuccessorExtensionIndividualNodeProcessingQueue.h" #include "CIndividualSaturationProcessNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationSuccessorExtensionIndividualNodeProcessingQueue::CSaturationSuccessorExtensionIndividualNodeProcessingQueue(CProcessContext* processContext) : mProcessContext(processContext),mPriorityIndiDesMap(processContext) { mCurrentIndividual = nullptr; } CSaturationSuccessorExtensionIndividualNodeProcessingQueue* CSaturationSuccessorExtensionIndividualNodeProcessingQueue::initProcessingQueue(CSaturationSuccessorExtensionIndividualNodeProcessingQueue* processingQueue) { if (processingQueue) { mPriorityIndiDesMap = processingQueue->mPriorityIndiDesMap; mCurrentIndividual = processingQueue->mCurrentIndividual; } else { mPriorityIndiDesMap.clear(); mCurrentIndividual = nullptr; } return this; } CIndividualSaturationProcessNode* CSaturationSuccessorExtensionIndividualNodeProcessingQueue::takeNextToCurrentProcessIndividual() { if (!mCurrentIndividual) { CIndividualSaturationProcessNode* nextNode = nullptr; if (!mPriorityIndiDesMap.isEmpty()) { CPROCESSMAP::iterator it = mPriorityIndiDesMap.begin(); nextNode = it.value(); it = mPriorityIndiDesMap.erase(it); } mCurrentIndividual = nextNode; } return mCurrentIndividual; } CSaturationSuccessorExtensionIndividualNodeProcessingQueue* CSaturationSuccessorExtensionIndividualNodeProcessingQueue::insertProcessIndiviudal(CIndividualSaturationProcessNode* individual) { if (mCurrentIndividual) { if (mCurrentIndividual->getIndividualID() == individual->getIndividualID()) { return this; } } mPriorityIndiDesMap.insert(-individual->getIndividualID(),individual); return this; } bool CSaturationSuccessorExtensionIndividualNodeProcessingQueue::isEmpty() { return !mCurrentIndividual && mPriorityIndiDesMap.count() <= 0; } cint64 CSaturationSuccessorExtensionIndividualNodeProcessingQueue::getQueuedIndividualCount() { cint64 processingCount = mPriorityIndiDesMap.count(); if (mCurrentIndividual) { processingCount += 1; } return processingCount; } bool CSaturationSuccessorExtensionIndividualNodeProcessingQueue::hasQueuedIndividuals() { return mCurrentIndividual || mPriorityIndiDesMap.count() > 0; } bool CSaturationSuccessorExtensionIndividualNodeProcessingQueue::isIndividualQueued(CIndividualSaturationProcessNode *individual) { if (mCurrentIndividual) { if (mCurrentIndividual->getIndividualID() == individual->getIndividualID()) { return true; } } return mPriorityIndiDesMap.contains(-individual->getIndividualID()); } CIndividualSaturationProcessNode* CSaturationSuccessorExtensionIndividualNodeProcessingQueue::getCurrentProcessIndividual() { return mCurrentIndividual; } CSaturationSuccessorExtensionIndividualNodeProcessingQueue* CSaturationSuccessorExtensionIndividualNodeProcessingQueue::clearCurrentProcessIndividual() { mCurrentIndividual = nullptr; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualDepthProcessingQueue.cpp0000644000175000017500000001035212520551122031620 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualDepthProcessingQueue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualDepthProcessingQueue::CIndividualDepthProcessingQueue(CProcessContext* processContext) : mProcessContext(processContext),mPriorityIndiDesMap(processContext) { } CIndividualDepthProcessingQueue* CIndividualDepthProcessingQueue::initProcessingQueue(CIndividualDepthProcessingQueue* processingQueue) { if (processingQueue) { mPriorityIndiDesMap = processingQueue->mPriorityIndiDesMap; mHasMaxIndiPriority = processingQueue->mHasMaxIndiPriority; mMaxIndiPriority = processingQueue->mMaxIndiPriority; mLastCheckIndi = processingQueue->mLastCheckIndi; } else { mHasMaxIndiPriority = false; mPriorityIndiDesMap.clear(); mLastCheckIndi = nullptr; mMaxIndiPriority = CIndividualDepthPriority(); } return this; } CIndividualProcessNode* CIndividualDepthProcessingQueue::takeNextProcessIndividual() { CIndividualProcessNode* nextNode = nullptr; if (!mPriorityIndiDesMap.isEmpty()) { CPROCESSMAP::iterator it = mPriorityIndiDesMap.begin(); nextNode = it.value(); it = mPriorityIndiDesMap.erase(it); if (it != mPriorityIndiDesMap.end()) { mHasMaxIndiPriority = true; mMaxIndiPriority = it.key(); } else { mHasMaxIndiPriority = false; } } return nextNode; } CIndividualProcessNode* CIndividualDepthProcessingQueue::getNextProcessIndividual() { CIndividualProcessNode* nextNode = nullptr; if (!mPriorityIndiDesMap.isEmpty()) { CPROCESSMAP::iterator it = mPriorityIndiDesMap.begin(); nextNode = it.value(); } return nextNode; } CIndividualDepthProcessingQueue* CIndividualDepthProcessingQueue::insertProcessIndiviudal(CIndividualProcessNode* individual) { CIndividualDepthPriority priority(individual->getIndividualNominalLevelOrAncestorDepth(),individual->getIndividualID()); if (mHasMaxIndiPriority) { if (priority < mMaxIndiPriority) { mMaxIndiPriority = priority; } } else { mMaxIndiPriority = priority; mHasMaxIndiPriority = true; } mPriorityIndiDesMap.insert(priority,individual); return this; } bool CIndividualDepthProcessingQueue::isEmpty() { return mPriorityIndiDesMap.count() <= 0; } cint64 CIndividualDepthProcessingQueue::getQueuedIndividualCount() { return mPriorityIndiDesMap.count(); } bool CIndividualDepthProcessingQueue::hasQueuedIndividuals() { return mPriorityIndiDesMap.count() > 0; } bool CIndividualDepthProcessingQueue::isIndividualQueued(CIndividualProcessNode *individual) { CIndividualDepthPriority priority(individual->getIndividualNominalLevelOrAncestorDepth(),individual->getIndividualID()); return mPriorityIndiDesMap.contains(priority); } bool CIndividualDepthProcessingQueue::hasHigherPriorityIndividual(CIndividualProcessNode *individual) { if (mHasMaxIndiPriority) { CIndividualDepthPriority priority(individual->getIndividualNominalLevelOrAncestorDepth(),individual->getIndividualID()); return mMaxIndiPriority < priority; } return false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeConceptExpansionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeConcep0000644000175000017500000001053512520551160032306 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGINDIVIDUALNODECONCEPTEXPANSIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGINDIVIDUALNODECONCEPTEXPANSIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "CProcessContext.h" // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSignatureBlockingIndividualNodeConceptExpansionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureBlockingIndividualNodeConceptExpansionData { // public methods public: //! Constructor CSignatureBlockingIndividualNodeConceptExpansionData(); CSignatureBlockingIndividualNodeConceptExpansionData* initBlockingExpansionData(CSignatureBlockingIndividualNodeConceptExpansionData* prevData); CConceptDescriptor* getLastSubsetTestedConceptDescriptor(); cint64 setBlockingConceptSignature(); cint64 getBlockingConceptCount(); cint64 getContinuousExpandedContainedConceptCount(); cint64 getLastUpdatedConceptExpansionCount(); cint64 getLastUpdatedConceptCount(); CIndividualProcessNode* getBlockerIndividualNode(); bool isBlockingReviewMarked(); bool isBlockingSubsetReviewMarked(); bool isIdenticConceptSetRequired(); bool isConceptSetStillSubset(); CSignatureBlockingIndividualNodeConceptExpansionData* setLastSubsetTestedConceptDescriptor(CConceptDescriptor* conDes); CSignatureBlockingIndividualNodeConceptExpansionData* setBlockingConceptSignature(cint64 signature); CSignatureBlockingIndividualNodeConceptExpansionData* setBlockingConceptCount(cint64 conCount); CSignatureBlockingIndividualNodeConceptExpansionData* setContinuousExpandedContainedConceptCount(cint64 conCount); CSignatureBlockingIndividualNodeConceptExpansionData* setLastUpdatedConceptExpansionCount(cint64 conCount); CSignatureBlockingIndividualNodeConceptExpansionData* setLastUpdatedConceptCount(cint64 conCount); CSignatureBlockingIndividualNodeConceptExpansionData* setBlockerIndividualNode(CIndividualProcessNode* node); CSignatureBlockingIndividualNodeConceptExpansionData* setBlockingReviewMarked(bool marked); CSignatureBlockingIndividualNodeConceptExpansionData* setBlockingSubsetReviewMarked(bool marked); CSignatureBlockingIndividualNodeConceptExpansionData* setIdenticConceptSetRequired(bool identicConceptSetRequired); CSignatureBlockingIndividualNodeConceptExpansionData* setConceptSetStillSubset(bool stillSubset); // protected methods protected: // protected variables protected: CConceptDescriptor* mSubsetTestedConDes; CIndividualProcessNode* blockerIndiNode; cint64 mBlockingConceptSignature; cint64 mBlockingConceptCount; cint64 mExpandedContainedConceptCount; cint64 mLastUpdatedConExpCount; cint64 mLastUpdatedConCount; bool mReviewMarked; bool mReviewSubsetMarked; bool mIdenticConceptSetRequired; bool mStillConceptSetSubset; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGINDIVIDUALNODECONCEPTEXPANSIONDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceData.cpp0000644000175000017500000001410212520551116030017 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeValueSpaceData::CDatatypeValueSpaceData(CProcessContext* processContext) : mClashDepTrackPointCollection(processContext) { mProcessContext = processContext; } CDatatypeValueSpaceData* CDatatypeValueSpaceData::initValueSpaceData(CDatatypeValueSpaceData* spaceData) { if (spaceData) { mValueSpaceClashed = spaceData->mValueSpaceClashed; mValueSpaceTriggeringCompleted = spaceData->mValueSpaceTriggeringCompleted; mValueSpaceTriggeringRequired = spaceData->mValueSpaceTriggeringRequired; mValueSpaceInitialisationDepTrackPoint = spaceData->mValueSpaceInitialisationDepTrackPoint; mValueSpaceTriggeringStarted = spaceData->mValueSpaceTriggeringStarted; mValueSpaceCounted = spaceData->mValueSpaceCounted; mValueSpaceClashCheckingRequired = spaceData->mValueSpaceClashCheckingRequired; mValuesCounter.initValueCounter(&spaceData->mValuesCounter); mClashDepTrackPointCollection.initDependencyTrackPointCollection(&spaceData->mClashDepTrackPointCollection); } else { mValueSpaceClashed = false; mValueSpaceTriggeringCompleted = false; mValueSpaceTriggeringRequired = false; mValueSpaceTriggeringStarted = false; mValueSpaceCounted = false; mValueSpaceClashCheckingRequired = false; mValueSpaceInitialisationDepTrackPoint = nullptr; mValuesCounter.initValueCounter(); mClashDepTrackPointCollection.initDependencyTrackPointCollection(nullptr); } return this; } CDatatypeDependencyTrackPointCollection* CDatatypeValueSpaceData::getClashDependencyTrackPointCollection() { return &mClashDepTrackPointCollection; } CClashedDependencyDescriptor* CDatatypeValueSpaceData::getClashDependencyDescriptorLinker() { return mClashDepTrackPointCollection.getClashedDependencyDescriptors(); } bool CDatatypeValueSpaceData::isValueSpaceClashed() { return mValueSpaceClashed; } CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceClashed(bool clashed) { mValueSpaceClashed = clashed; return this; } bool CDatatypeValueSpaceData::isValueSpaceTriggeringCompleted() { return mValueSpaceTriggeringCompleted; } bool CDatatypeValueSpaceData::isValueSpaceTriggeringRequired() { return mValueSpaceTriggeringRequired; } CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceTriggeringCompleted(bool triggeringCompleted) { mValueSpaceTriggeringCompleted = triggeringCompleted; return this; } CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceTriggeringRequired(bool triggeringRequired) { mValueSpaceTriggeringRequired = triggeringRequired; return this; } bool CDatatypeValueSpaceData::isValueSpaceTriggeringStarted() { return mValueSpaceTriggeringStarted; } CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceTriggeringStarted(bool triggeringStarted) { mValueSpaceTriggeringStarted = triggeringStarted; return this; } bool CDatatypeValueSpaceData::isValueSpaceCountingRequired() { return mValueSpaceCountingRequired; } CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceCountingRequired(bool triggeringStarted) { mValueSpaceCountingRequired = triggeringStarted; return this; } bool CDatatypeValueSpaceData::isValueSpaceClashCheckingRequired() { return mValueSpaceClashCheckingRequired; } CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceClashCheckingRequired(bool clashCheckingRequired) { mValueSpaceClashCheckingRequired = clashCheckingRequired; return this; } bool CDatatypeValueSpaceData::isValueSpaceCounted() { return mValueSpaceCounted; } CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceCounted(bool counted) { mValueSpaceCounted = counted; return this; } CDependencyTrackPoint* CDatatypeValueSpaceData::getValueSpaceInitialisationDependencyTrackPoint() { return mValueSpaceInitialisationDepTrackPoint; } CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceInitialisationDependencyTrackPoint(CDependencyTrackPoint* depTrackPoint) { mValueSpaceInitialisationDepTrackPoint = depTrackPoint; return this; } bool CDatatypeValueSpaceData::setValueSpaceInitialisationDependencyTrackPointCandidate(CDependencyTrackPoint* depTrackPoint) { if (!mValueSpaceInitialisationDepTrackPoint) { mValueSpaceInitialisationDepTrackPoint = depTrackPoint; return true; } return false; } CDatatypeValueSpaceData* CDatatypeValueSpaceData::setValueSpaceModification() { if (mValueSpaceTriggeringStarted && !mValueSpaceTriggeringCompleted) { mValueSpaceTriggeringRequired = true; } mValueSpaceCounted = false; mValueSpaceCountingRequired = true; if (!mValueSpaceClashed) { mValueSpaceClashCheckingRequired = true; } return this; } CDatatypeValueSpaceValuesCounter* CDatatypeValueSpaceData::getValuesCounter() { return &mValuesCounter; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeLinker.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeLinker0000644000175000017500000000471112520551130032375 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODELINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODELINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Utilities/Container/CNegLinker.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualSaturationProcessNodeLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualSaturationProcessNodeLinker : public CNegLinkerBase { // public methods public: //! Constructor CIndividualSaturationProcessNodeLinker(); CIndividualSaturationProcessNodeLinker* initProcessNodeLinker(CIndividualSaturationProcessNode *individual, bool processingQueued); CIndividualSaturationProcessNode* getProcessingIndividual(); bool isProcessingQueued(); CIndividualSaturationProcessNodeLinker* clearProcessingQueued(); CIndividualSaturationProcessNodeLinker* setProcessingQueued(bool processingQueued = true); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODELINKER_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBranchingORProcessingRestrictionSpecification.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBranchingORProcessingRestrictionSpeci0000644000175000017500000000707512520551074032341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBRANCHINGORPROCESSINGRESTRICTIONSPECIFICATION_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBRANCHINGORPROCESSINGRESTRICTIONSPECIFICATION_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessingRestrictionSpecification.h" #include "CClashedConceptDescriptor.h" // Other includes #include "Reasoner/Ontology/CConceptRoleBranchingTrigger.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CBranchingORProcessingRestrictionSpecification * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBranchingORProcessingRestrictionSpecification : public CProcessingRestrictionSpecification { // public methods public: //! Constructor CBranchingORProcessingRestrictionSpecification(); CBranchingORProcessingRestrictionSpecification* initBranchingORProcessingRestriction(CBranchingORProcessingRestrictionSpecification* prevRest = nullptr); CBranchingORProcessingRestrictionSpecification* setConceptRoleBranchingTrigger(CConceptRoleBranchingTrigger* conRoleBranchTrigger); CConceptRoleBranchingTrigger* getConceptRoleBranchingTrigger(); CSortedNegLinker* getFirstNotPosAndNegContainedOperand(); CSortedNegLinker* getSecondNotPosAndNegContainedOperand(); CSortedNegLinker* getContainedOperand(); CBranchingORProcessingRestrictionSpecification* setFirstNotPosAndNegContainedOperand(CSortedNegLinker* firstOp); CBranchingORProcessingRestrictionSpecification* setSecondNotPosAndNegContainedOperand(CSortedNegLinker* secondOp); CBranchingORProcessingRestrictionSpecification* setContainedOperand(CSortedNegLinker* containedOp); CBranchingORProcessingRestrictionSpecification* addClashedConceptDescriptors(CClashedDependencyDescriptor* clashes); CClashedDependencyDescriptor* getClashedConceptDescriptors(); // protected methods protected: // protected variables protected: CConceptRoleBranchingTrigger* mConRoleBranchTrigg; CSortedNegLinker* mFirstNotPosAndNegContainedOperand; CSortedNegLinker* mSecondNotPosAndNegContainedOperand; CSortedNegLinker* mContainedOperand; CClashedDependencyDescriptor* mClashes; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBRANCHINGORPROCESSINGRESTRICTIONSPECIFICATION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueDataExclusion.h0000644000175000017500000000646012520551114031577 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUEDATAEXCLUSION_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUEDATAEXCLUSION_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CDatatypeStringValueExclusionType.h" // Other includes #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CDatatypeStringValueDataExclusion * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeStringValueDataExclusion { // public methods public: //! Constructor CDatatypeStringValueDataExclusion(); CDatatypeStringValueDataExclusion* initDataExclusion(CDatatypeStringValueDataExclusion* value); bool isExcluded(); CDependencyTrackPoint* getExcludedDependencyTrackPoint(); CDatatypeStringValueDataExclusion* setExcluded(bool excluded); CDatatypeStringValueDataExclusion* setExcludedDependencyTrackPoint(CDependencyTrackPoint* depTrackPoint); bool isSomethingExcluded(); bool isEverythingExcluded(); bool areLanguageTagsExcluded(); bool areOnlyLanguageTagsAllowed(); bool isExcluded(CDatatypeStringValueExclusionType* type); CDatatypeStringValueDataExclusion* setExclusion(CDatatypeStringValueExclusionType* type, CDependencyTrackPoint* depTrackPoint); CDependencyTrackPoint* getExclusionDependencyTrackPoint(CDatatypeStringValueExclusionType* type); CDependencyTrackPoint* getPositiveExclusionDependencyTrackPoint(); CDependencyTrackPoint* getNegativeExclusionDependencyTrackPoint(); // protected methods protected: // protected variables protected: CDatatypeStringValueExclusionType::STRING_VALUE_EXCLUSION_TYPE mPosExclusionType; CDatatypeStringValueExclusionType::STRING_VALUE_EXCLUSION_TYPE mNegExclusionType; CDependencyTrackPoint* mPosExclusionDepTrackPoint; CDependencyTrackPoint* mNegExclusionDepTrackPoint; bool mExcluded; CDependencyTrackPoint* mExcludedDepTrackPoint; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUEDATAEXCLUSION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningCommonKeyData.h0000644000175000017500000000514112520551142032102 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGCOMMONKEYDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGCOMMONKEYDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRepresentativeVariableBindingPathSetData.h" #include "CRepresentativeVariableBindingPathSetJoiningKeyDataMap.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRepresentativeJoiningCommonKeyData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeJoiningCommonKeyData { // public methods public: //! Constructor CRepresentativeJoiningCommonKeyData(CRepresentativeVariableBindingPathSetJoiningKeyDataMap* leftJoiningDataMap, CRepresentativeVariableBindingPathSetJoiningKeyDataMap* rightJoiningDataMap); cint64 getLeftCount() const; cint64 getRightCount() const; CRepresentativeVariableBindingPathSetJoiningKeyDataMap* getLeftJoiningDataMap() const; CRepresentativeVariableBindingPathSetJoiningKeyDataMap* getRightJoiningDataMap() const; // protected methods protected: // protected variables protected: CRepresentativeVariableBindingPathSetJoiningKeyDataMap* mLeftJoiningDataMap; CRepresentativeVariableBindingPathSetJoiningKeyDataMap* mRightJoiningDataMap; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGCOMMONKEYDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyConceptLabelSetIterator.cpp0000644000175000017500000001112412520551140031555 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReapplyConceptLabelSetIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CReapplyConceptLabelSetIterator::CReapplyConceptLabelSetIterator(cint64 conceptCount, CConceptDescriptor* conceptDesLinker, const CPROCESSMAP::const_iterator& beginIt, const CPROCESSMAP::const_iterator& endIt, bool skipEmptyConceptDescriptors) : mConceptCount(conceptCount),mConceptDesLinkerIt(conceptDesLinker),mConDesDepBeginIt(beginIt),mConDesDepEndIt(endIt),mSkipEmptyConceptDescriptors(skipEmptyConceptDescriptors) { if (mSkipEmptyConceptDescriptors) { while (mConDesDepBeginIt != mConDesDepEndIt && mConDesDepBeginIt.value().mConceptDescriptor == nullptr) { ++mConDesDepBeginIt; } } } cint64 CReapplyConceptLabelSetIterator::getRemainingConceptCount() { return mConceptCount; } CReapplyConceptLabelSetIterator& CReapplyConceptLabelSetIterator::operator++() { return *moveNext(); } CConceptDescriptor* CReapplyConceptLabelSetIterator::operator*() { return getConceptDescriptor(); } CReapplyConceptLabelSetIterator* CReapplyConceptLabelSetIterator::moveNext() { if (mConceptDesLinkerIt) { mConceptDesLinkerIt = mConceptDesLinkerIt->getNext(); --mConceptCount; } else { if (mConDesDepBeginIt != mConDesDepEndIt) { ++mConDesDepBeginIt; if (mSkipEmptyConceptDescriptors) { while (mConDesDepBeginIt != mConDesDepEndIt && mConDesDepBeginIt.value().mConceptDescriptor == nullptr) { ++mConDesDepBeginIt; } } --mConceptCount; } } return this; } cint64 CReapplyConceptLabelSetIterator::getDataTag() { if (mConceptDesLinkerIt) { return mConceptDesLinkerIt->getConceptTag(); } else { return mConDesDepBeginIt.key(); } } CConceptDescriptor* CReapplyConceptLabelSetIterator::getConceptDescriptor() { if (mConceptDesLinkerIt) { return mConceptDesLinkerIt; } else { return mConDesDepBeginIt.value().mConceptDescriptor; } } CDependencyTrackPoint* CReapplyConceptLabelSetIterator::getDependencyTrackPoint() { if (mConceptDesLinkerIt) { return mConceptDesLinkerIt->getDependencyTrackPoint(); } else { CConceptDescriptor* conDes = getConceptDescriptor(); if (conDes) { return conDes->getDependencyTrackPoint(); } else { return nullptr; } } } const CCondensedReapplyQueue *CReapplyConceptLabelSetIterator::getPosNegReapplyQueue() { if (mConceptDesLinkerIt) { return nullptr; } else { return &mConDesDepBeginIt.value().mPosNegReapplyQueue; } } CConceptDescriptor* CReapplyConceptLabelSetIterator::next(bool moveToNext) { CConceptDescriptor* conDes = getConceptDescriptor(); if (moveToNext) { moveNext(); } return conDes; } bool CReapplyConceptLabelSetIterator::hasValue() { return mConceptDesLinkerIt || mConDesDepBeginIt != mConDesDepEndIt; } bool CReapplyConceptLabelSetIterator::hasNext() { return mConceptDesLinkerIt || mConDesDepBeginIt != mConDesDepEndIt; } bool CReapplyConceptLabelSetIterator::operator!=(CReapplyConceptLabelSetIterator& iterator) { return mConceptDesLinkerIt != iterator.mConceptDesLinkerIt || mConDesDepBeginIt != iterator.mConDesDepBeginIt; } bool CReapplyConceptLabelSetIterator::operator==(CReapplyConceptLabelSetIterator& iterator) { return mConceptDesLinkerIt == iterator.mConceptDesLinkerIt && mConDesDepBeginIt == iterator.mConDesDepBeginIt; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeModelData.cpp0000644000175000017500000000225312520551124030155 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeModelData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeModelData::CIndividualNodeModelData() { } CIndividualNodeModelData::~CIndividualNodeModelData() { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualProcessNodeReference.cpp0000644000175000017500000000205512520551126031562 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeReference.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingTriggerLinker.cpp0000644000175000017500000000504112520551166031221 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingTriggerLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingTriggerLinker::CVariableBindingTriggerLinker(CVariableBindingPathDescriptor* varBindPathDes) : CLinkerBase(varBindPathDes) { } CVariableBindingTriggerLinker* CVariableBindingTriggerLinker::initTriggerLinker(CVariableBindingPathDescriptor* varBindPathDes, CVariableBindingDescriptor* varBindDes, bool leftTriggered) { initLinker(varBindPathDes); mNextTriggerVariableBinding = varBindDes; mLeftTriggered = leftTriggered; return this; } CVariableBindingPathDescriptor* CVariableBindingTriggerLinker::getVariableBindingPathDescriptor() { return getData(); } CVariableBindingTriggerLinker* CVariableBindingTriggerLinker::setVariableBindingPathDescriptor(CVariableBindingPathDescriptor* varBindPathDes) { setData(varBindPathDes); return this; } CVariableBindingDescriptor* CVariableBindingTriggerLinker::getNextTriggerVariableBindingDescriptor() { return mNextTriggerVariableBinding; } CVariableBindingTriggerLinker* CVariableBindingTriggerLinker::setNextTriggerVariableBindingDescriptor(CVariableBindingDescriptor* varBindDes) { mNextTriggerVariableBinding = varBindDes; return this; } bool CVariableBindingTriggerLinker::isLeftTriggered() { return mLeftTriggered; } CVariableBindingTriggerLinker* CVariableBindingTriggerLinker::setLeftTriggered(bool leftTriggered) { mLeftTriggered = leftTriggered; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueData.h0000644000175000017500000000561412520551114027705 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeStringValueDataExclusion.h" // Other includes #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDataLiteralStringValue.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CDatatypeStringValueData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeStringValueData { // public methods public: //! Constructor CDatatypeStringValueData(CProcessContext* processContext); CDatatypeStringValueData* initStringValueData(CDatatypeStringValueData* valueData, CDataLiteralStringValue* value); CDatatypeStringValueData* initStringValueData(CDataLiteralStringValue* value); CDatatypeStringValueDataExclusion* getValueExclusionData(); CDatatypeStringValueDataExclusion* getLeftExclusionData(); CDatatypeStringValueDataExclusion* getRightExclusionData(); CDataLiteralStringValue* getValue(); CDatatypeStringValueData* setValue(CDataLiteralStringValue* value); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CDataLiteralStringValue* mValue; CDatatypeStringValueDataExclusion mValueExclusionData; CDatatypeStringValueDataExclusion mLeftExclusionData; CDatatypeStringValueDataExclusion mRightExclusionData; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleSuccessorIterator.h0000644000175000017500000000443612520551152027464 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CROLESUCCESSORITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CROLESUCCESSORITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CReapplyRoleSuccessorData.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRoleSuccessorIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleSuccessorIterator { // public methods public: //! Constructor CRoleSuccessorIterator(); CRoleSuccessorIterator(const CPROCESSHASH::iterator& beginIt, const CPROCESSHASH::iterator& endIt); bool hasNext(); CRole* next(bool moveNext = true); // protected methods protected: // protected variables protected: CPROCESSHASH::iterator mBeginIt; CPROCESSHASH::iterator mEndIt; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CROLESUCCESSORITERATOR_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptCountHashData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptCountH0000644000175000017500000000407412520551152032372 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONDISJUNCTCOMMONCONCEPTCOUNTHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONDISJUNCTCOMMONCONCEPTCOUNTHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationDisjunctCommonConceptCountHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationDisjunctCommonConceptCountHashData { // public methods public: //! Constructor CSaturationDisjunctCommonConceptCountHashData(); cint64 mConceptCount; CConcept* mConcept; bool mNegation; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONDISJUNCTCOMMONCONCEPTCOUNTHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeXMLValueSpaceMap.cpp0000644000175000017500000000541412520551116030252 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeXMLValueSpaceMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeXMLValueSpaceMap::CDatatypeXMLValueSpaceMap(CProcessContext* processContext) : CDatatypeCompareValueSpaceMap(processContext) { } bool CDatatypeXMLValueSpaceMap::representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { return true; } bool CDatatypeXMLValueSpaceMap::representsInfinitelyManyValues(CDataLiteralCompareValue* value) { CDataLiteralXMLValue* xmlValue = dynamic_cast(value); if (xmlValue) { return xmlValue->isInfiniteLength(); } return false; } bool CDatatypeXMLValueSpaceMap::getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom) { CDataLiteralXMLValue* xmlValueCopyInto = dynamic_cast(valueCopyInto); CDataLiteralXMLValue* xmlValueCopyFrom = dynamic_cast(valueCopyFrom); xmlValueCopyInto->initValue(xmlValueCopyFrom); return false; } bool CDatatypeXMLValueSpaceMap::getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast) { CDataLiteralXMLValue* xmlValueNext = dynamic_cast(valueNext); CDataLiteralXMLValue* xmlValueLast = dynamic_cast(valueLast); return false; } cuint64 CDatatypeXMLValueSpaceMap::getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { CDataLiteralXMLValue* xmlLeftValue = dynamic_cast(leftValueExcluded); CDataLiteralXMLValue* xmlRightValue = dynamic_cast(rightValueExcluded); cuint64 valueCount = 0; return valueCount; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativePropagationDescriptor.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativePropagationDescriptor.c0000644000175000017500000000363712520551144032420 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativePropagationDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativePropagationDescriptor::CRepresentativePropagationDescriptor() : CLinkerBase(nullptr) { } CRepresentativePropagationDescriptor* CRepresentativePropagationDescriptor::initRepresentativeDescriptor(CRepresentativeVariableBindingPathSetData* repData, CDependencyTrackPoint* depTrackPoint) { setData(repData); setDependencyTrackPoint(depTrackPoint); return this; } CRepresentativeVariableBindingPathSetData* CRepresentativePropagationDescriptor::getRepresentativeVariableBindingPathSetData() { return getData(); } CRepresentativePropagationDescriptor* CRepresentativePropagationDescriptor::setRepresentativeVariableBindingPathSetData(CRepresentativeVariableBindingPathSetData* repData) { setData(repData); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSuccessorRoleHash.cpp0000644000175000017500000000461312520551162027107 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSuccessorRoleHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSuccessorRoleHash::CSuccessorRoleHash(CProcessContext* context) : CPROCESSHASH(context),mContext(context) { } CSuccessorRoleHash* CSuccessorRoleHash::initSuccessorRoleHash(CSuccessorRoleHash* prevRoleSuccHash) { if (prevRoleSuccHash) { *this = *prevRoleSuccHash; } else { CPROCESSHASH::clear(); } return this; } CSuccessorRoleHash* CSuccessorRoleHash::insertSuccessorRoleLink(cint64 indi, CIndividualLinkEdge* link) { CPROCESSHASH::insertMulti(indi,link); return this; } CSuccessorRoleIterator CSuccessorRoleHash::getSuccessorRoleIterator(cint64 indi) { return CSuccessorRoleIterator(indi,CPROCESSHASH::find(indi),CPROCESSHASH::end()); } bool CSuccessorRoleHash::hasSuccessorIndividualNode(cint64 indi) { return CPROCESSHASH::contains(indi); } CSuccessorRoleHash* CSuccessorRoleHash::removeSuccessor(cint64 indi) { CPROCESSHASH::remove(indi); return this; } CSuccessorIterator CSuccessorRoleHash::getSuccessorIterator() { return CSuccessorIterator(CPROCESSHASH::begin(),CPROCESSHASH::end()); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationSuccessorLinkDataLinker.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationSuccessorLinkData0000644000175000017500000000274512520551130032372 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualSaturationSuccessorLinkDataLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualSaturationSuccessorLinkDataLinker::CIndividualSaturationSuccessorLinkDataLinker() : CLinkerBase(nullptr,false) { } CIndividualSaturationSuccessorLinkDataLinker* CIndividualSaturationSuccessorLinkDataLinker::initSuccessorLinkDataLinker(CSaturationSuccessorData* succLinkData) { initLinker(succLinkData); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeBooleanValueSpaceData.cpp0000644000175000017500000000601112520551106031316 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeBooleanValueSpaceData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeBooleanValueSpaceData::CDatatypeBooleanValueSpaceData(CProcessContext* processContext) : CDatatypeCompareValueSpaceData(processContext) { mBooleanValueSpaceMap = nullptr; } CDatatypeBooleanValueSpaceData* CDatatypeBooleanValueSpaceData::initBooleanValueSpaceData(CDatatypeValueSpaceBooleanType* valueSpaceType) { CDatatypeCompareValueSpaceData::initValueSpaceData(nullptr); mValueSpaceType = valueSpaceType; if (mBooleanValueSpaceMap) { mBooleanValueSpaceMap->initDatatypeCompareValueSpaceMap(valueSpaceType); } return this; } CDatatypeBooleanValueSpaceData* CDatatypeBooleanValueSpaceData::copyBooleanValueSpaceData(CDatatypeBooleanValueSpaceData* spaceData) { CDatatypeCompareValueSpaceData::initValueSpaceData(spaceData); mValueSpaceType = spaceData->mValueSpaceType; if (spaceData->mBooleanValueSpaceMap && !mBooleanValueSpaceMap) { getBooleanValueSpaceMap(true); mBooleanValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mBooleanValueSpaceMap); } else if (mBooleanValueSpaceMap) { if (spaceData->mBooleanValueSpaceMap) { mBooleanValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mBooleanValueSpaceMap); } else { mBooleanValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } } return this; } CDatatypeBooleanValueSpaceMap* CDatatypeBooleanValueSpaceData::getBooleanValueSpaceMap(bool create) { if (create && !mBooleanValueSpaceMap) { mBooleanValueSpaceMap = CObjectParameterizingAllocator< CDatatypeBooleanValueSpaceMap,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mBooleanValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } return mBooleanValueSpaceMap; } CDatatypeCompareValueSpaceMap* CDatatypeBooleanValueSpaceData::createValueSpaceMap() { return getBooleanValueSpaceMap(true); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingReviewData.h0000644000175000017500000000470312520551160030541 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGREVIEWDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGREVIEWDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" #include "CProcessContext.h" #include "CSignatureBlockingReviewDataIterator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSignatureBlockingReviewData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureBlockingReviewData { // public methods public: //! Constructor CSignatureBlockingReviewData(CProcessContext* context = nullptr); CSignatureBlockingReviewData* initSignatureBlockingReviewData(CSignatureBlockingReviewData* sigBlockRevData); CSignatureBlockingReviewData* insert(cint64 depth, cint64 indiID); bool contains(cint64 indiID); CSignatureBlockingReviewData* remove(cint64 indiID); bool isEmpty(); CSignatureBlockingReviewDataIterator getIterator(); // protected methods protected: // protected variables protected: CPROCESSSET mIndividualSet; CPROCESSMAP mDepthIndividualMap; CProcessContext* mContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGREVIEWDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptProcessLinker.cpp0000644000175000017500000000322512520551100027575 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptProcessLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptProcessLinker::CConceptProcessLinker() : CLinkerBase(nullptr) { } CConceptProcessLinker *CConceptProcessLinker::initConceptProcessLinker(CConceptDescriptor *conceptDescriptor, CProcessingRestrictionSpecification* processingRestriction) { initLinker(conceptDescriptor); mProcRest = processingRestriction; return this; } CConceptDescriptor *CConceptProcessLinker::getConceptDescriptor() { return getData(); } CProcessingRestrictionSpecification* CConceptProcessLinker::getProcessingRestriction() { return mProcRest; } }; // end namespace Kernel }; // end namespace Process }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualDepthConceptProcessDescriptorProcessingQueue.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualDepthConceptProcessDescript0000644000175000017500000000635412520551122032355 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALDEPTHCONCEPTPROCESSDESCRIPTORPROCESSINGQUEUE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALDEPTHCONCEPTPROCESSDESCRIPTORPROCESSINGQUEUE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" #include "CIndividualDepthPriority.h" #include "CIndividualDepthConceptProcessDescriptorProcessingQueueData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualDepthConceptProcessDescriptorProcessingQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualDepthConceptProcessDescriptorProcessingQueue { // public methods public: //! Constructor CIndividualDepthConceptProcessDescriptorProcessingQueue(CProcessContext* processContext); CIndividualDepthConceptProcessDescriptorProcessingQueue* initProcessingQueue(CIndividualDepthConceptProcessDescriptorProcessingQueue* processingQueue); bool takeNextProcessIndiviudalConceptProcessDescriptor(CIndividualProcessNode*& nextNode, CConceptProcessDescriptor*& conProDes); CIndividualDepthConceptProcessDescriptorProcessingQueue* insertProcessIndiviudalConceptProcessDescriptor(CIndividualProcessNode* individual, CConceptProcessDescriptor* conProDes); CIndividualDepthConceptProcessDescriptorProcessingQueue* removeQueuedProcessIndiviudal(CIndividualProcessNode* individual); bool isEmpty(); cint64 getQueuedIndividualCount(); bool hasQueuedIndividuals(); bool isIndividualQueued(CIndividualProcessNode *individual); CPROCESSMAP* getIndividualDepthConceptProcessDescriptorProcessingQueue(); // protected methods protected: // protected variables protected: CPROCESSMAP mPriorityIndiDesMap; CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALDEPTHCONCEPTPROCESSDESCRIPTORPROCESSINGQUEUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeDateTimeValueSpaceData.h0000644000175000017500000000517612520551110031106 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDATETIMEVALUESPACEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDATETIMEVALUESPACEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeDateTimeValueSpaceMap.h" #include "CDatatypeCompareValueSpaceData.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceDateTimeType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeDateTimeValueSpaceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeDateTimeValueSpaceData : public CDatatypeCompareValueSpaceData { // public methods public: //! Constructor CDatatypeDateTimeValueSpaceData(CProcessContext* processContext); CDatatypeDateTimeValueSpaceData* copyDateTimeValueSpaceData(CDatatypeDateTimeValueSpaceData* spaceData); CDatatypeDateTimeValueSpaceData* initDateTimeValueSpaceData(CDatatypeValueSpaceDateTimeType* valueSpaceType); CDatatypeDateTimeValueSpaceMap* getDateTimeValueSpaceMap(bool create); // protected methods protected: virtual CDatatypeCompareValueSpaceMap* createValueSpaceMap(); // protected variables protected: CDatatypeDateTimeValueSpaceMap* mDateTimeValueSpaceMap; CDatatypeValueSpaceDateTimeType* mValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDATETIMEVALUESPACEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeFloatValueSpaceData.cpp0000644000175000017500000000570512520551112031012 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeFloatValueSpaceData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeFloatValueSpaceData::CDatatypeFloatValueSpaceData(CProcessContext* processContext) : CDatatypeCompareValueSpaceData(processContext) { mFloatValueSpaceMap = nullptr; } CDatatypeFloatValueSpaceData* CDatatypeFloatValueSpaceData::initFloatValueSpaceData(CDatatypeValueSpaceFloatType* valueSpaceType) { CDatatypeCompareValueSpaceData::initValueSpaceData(nullptr); mValueSpaceType = valueSpaceType; if (mFloatValueSpaceMap) { mFloatValueSpaceMap->initDatatypeCompareValueSpaceMap(valueSpaceType); } return this; } CDatatypeFloatValueSpaceData* CDatatypeFloatValueSpaceData::copyFloatValueSpaceData(CDatatypeFloatValueSpaceData* spaceData) { CDatatypeCompareValueSpaceData::initValueSpaceData(spaceData); mValueSpaceType = spaceData->mValueSpaceType; if (spaceData->mFloatValueSpaceMap && !mFloatValueSpaceMap) { getFloatValueSpaceMap(true); mFloatValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mFloatValueSpaceMap); } else if (mFloatValueSpaceMap) { if (spaceData->mFloatValueSpaceMap) { mFloatValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mFloatValueSpaceMap); } else { mFloatValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } } return this; } CDatatypeFloatValueSpaceMap* CDatatypeFloatValueSpaceData::getFloatValueSpaceMap(bool create) { if (create && !mFloatValueSpaceMap) { mFloatValueSpaceMap = CObjectParameterizingAllocator< CDatatypeFloatValueSpaceMap,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mFloatValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } return mFloatValueSpaceMap; } CDatatypeCompareValueSpaceMap* CDatatypeFloatValueSpaceData::createValueSpaceMap() { return getFloatValueSpaceMap(true); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualLinkEdge.cpp0000644000175000017500000000501312520551122027172 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualLinkEdge.h" #include "CIndividualProcessNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualLinkEdge::CIndividualLinkEdge(CProcessContext* processContext) : CLinkEdge(processContext), CLinkerBase(this) { mCreatorIndividual = nullptr; } CIndividualLinkEdge* CIndividualLinkEdge::initIndividualLinkEdge(CIndividualLinkEdge* link) { initLinkEdge(link); mCreatorIndividual = link->mCreatorIndividual; return this; } CIndividualLinkEdge* CIndividualLinkEdge::initIndividualLinkEdge(CIndividualProcessNode* creatorIndividual, CIndividualProcessNode* sourceIndividual, CIndividualProcessNode* destinationIndividual, CRole* role, CDependencyTrackPoint* depTrackPoint) { initLinkEdge(sourceIndividual,destinationIndividual,role,depTrackPoint); mCreatorIndividual = creatorIndividual; return this; } CIndividualProcessNode* CIndividualLinkEdge::getCreatorIndividual() { return mCreatorIndividual; } cint64 CIndividualLinkEdge::getCreatorIndividualID() { return mCreatorIndividual->getIndividualID(); } bool CIndividualLinkEdge::isCreatorIndividual(CIndividualProcessNode* indi) { return mCreatorIndividual == indi; } bool CIndividualLinkEdge::isCreatorIndividualID(CIndividualProcessNode* indi) { return mCreatorIndividual->getIndividualID() == indi->getIndividualID(); } bool CIndividualLinkEdge::isCreatorIndividualID(cint64 indiID) { return mCreatorIndividual->getIndividualID() == indiID; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptSaturationDescriptor.cpp0000644000175000017500000000334312520551102031205 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptSaturationDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptSaturationDescriptor::CConceptSaturationDescriptor() { } CConceptSaturationDescriptor* CConceptSaturationDescriptor::initConceptSaturationDescriptor(CConcept* concept, bool negated) { initNegLinker(concept,negated); return this; } CConcept* CConceptSaturationDescriptor::getConcept() { return getData(); } cint64 CConceptSaturationDescriptor::getConceptTag() { return getData()->getConceptTag(); } cint64 CConceptSaturationDescriptor::getTerminologyTag() { return getData()->getTerminologyTag(); } CConceptSaturationDescriptor* CConceptSaturationDescriptor::getNextConceptDesciptor() { return getNext(); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingCandidateData.cpp0000644000175000017500000000243312520551160031505 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureBlockingCandidateData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CXLinker* CSignatureBlockingCandidateData::getCandidateIndividualLinker() { return mCandidateIndiLinker; } cint64 CSignatureBlockingCandidateData::getCandidateIndividualCount() { return mCandidateCount; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CImplicationReapplyConceptSaturationDescriptor.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CImplicationReapplyConceptSaturationDe0000644000175000017500000000470412520551120032366 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CIMPLICATIONREAPPLYCONCEPTSATURATIONDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CIMPLICATIONREAPPLYCONCEPTSATURATIONDESCRIPTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptSaturationDescriptor.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CImplicationReapplyConceptSaturationDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CImplicationReapplyConceptSaturationDescriptor : public CLinkerBase { // public methods public: //! Constructor CImplicationReapplyConceptSaturationDescriptor(); CImplicationReapplyConceptSaturationDescriptor* initImplicationReapllyConceptSaturationDescriptor(CConcept* implConcept, CSortedNegLinker* nextTriggerConcept); CConcept* getImplicationConcept(); CSortedNegLinker* getNextTriggerConcept(); // protected methods protected: // protected variables protected: CSortedNegLinker* mNextTriggerConcept; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CIMPLICATIONREAPPLYCONCEPTSATURATIONDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceMapData.h0000644000175000017500000000410712520551116031315 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUESPACEMAPDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUESPACEMAPDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeStringValueData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CDatatypeStringValueSpaceMapData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeStringValueSpaceMapData { // public methods public: //! Constructor CDatatypeStringValueSpaceMapData(); CDatatypeStringValueSpaceMapData(const CDatatypeStringValueSpaceMapData& data); CDatatypeStringValueData* mLocValue; CDatatypeStringValueData* mUseValue; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUESPACEMAPDATA_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptCountHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptCountH0000644000175000017500000000235712520551152032374 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationDisjunctCommonConceptCountHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationDisjunctCommonConceptCountHashData::CSaturationDisjunctCommonConceptCountHashData() { mConceptCount = 0; mConcept = nullptr; mNegation = false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalIndividualNodeProcessingQueue.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalIndividualNodeProcessingQueue0000644000175000017500000000420012520551104032326 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALINDIVIDUALNODEPROCESSINGQUEUE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALINDIVIDUALNODEPROCESSINGQUEUE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CSaturationIndividualNodeProcessingQueue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CCriticalIndividualNodeProcessingQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCriticalIndividualNodeProcessingQueue : public CSaturationIndividualNodeProcessingQueue { // public methods public: //! Constructor CCriticalIndividualNodeProcessingQueue(CProcessContext* processContext); CCriticalIndividualNodeProcessingQueue* initProcessingQueue(CCriticalIndividualNodeProcessingQueue* processingQueue); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALINDIVIDUALNODEPROCESSINGQUEUE_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptExtractionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptExtrac0000644000175000017500000000517512520551152032423 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationDisjunctCommonConceptExtractionData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationDisjunctCommonConceptExtractionData::CSaturationDisjunctCommonConceptExtractionData(CProcessContext* processContext) : mCommonConceptCountHash(processContext) { } CSaturationDisjunctCommonConceptExtractionData* CSaturationDisjunctCommonConceptExtractionData::initExtractionData(CIndividualSaturationProcessNode* disjunctionIndiProcessNode) { mCommonConceptCountHash.initCommonConceptCountHash(); mExtConIndiProcessLinker.initProcessNodeLinker(disjunctionIndiProcessNode,false); mDisjunctExtractionLinker = nullptr; return this; } CSaturationDisjunctCommonConceptCountHash* CSaturationDisjunctCommonConceptExtractionData::getSaturationDisjunctCommonConceptCountHash() { return &mCommonConceptCountHash; } CSaturationDisjunctExtractionLinker* CSaturationDisjunctCommonConceptExtractionData::getDisjunctIndividualNodeExtractionLinker() { return mDisjunctExtractionLinker; } CSaturationDisjunctCommonConceptExtractionData* CSaturationDisjunctCommonConceptExtractionData::addDisjunctIndividualNodeExtractionLinker(CSaturationDisjunctExtractionLinker* disNodeExtLinker) { mDisjunctExtractionLinker = disNodeExtLinker->append(mDisjunctExtractionLinker); return this; } CIndividualSaturationProcessNodeLinker* CSaturationDisjunctCommonConceptExtractionData::getExtractionContinueProcessLinker() { return &mExtConIndiProcessLinker; } bool CSaturationDisjunctCommonConceptExtractionData::isExtractionContinueProcessingQueued() { return mExtConIndiProcessLinker.isProcessingQueued(); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptLabelSetModificationTag.cpp0000644000175000017500000000715712520551076031513 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptLabelSetModificationTag.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptLabelSetModificationTag::CConceptLabelSetModificationTag(cint64 conceptLabelSetModificationTag) : CProcessTag(conceptLabelSetModificationTag) { } CConceptLabelSetModificationTag::~CConceptLabelSetModificationTag() { } cint64 CConceptLabelSetModificationTag::getConceptLabelSetModificationTag() { return CProcessTag::getProcessTag(); } CConceptLabelSetModificationTag* CConceptLabelSetModificationTag::setConceptLabelSetModificationTag(cint64 conceptLabelSetModificationTag) { CProcessTag::setProcessTag(conceptLabelSetModificationTag); return this; } CConceptLabelSetModificationTag* CConceptLabelSetModificationTag::initConceptLabelSetModificationTag(cint64 conceptLabelSetModificationTag) { CProcessTag::initProcessTag(conceptLabelSetModificationTag); return this; } bool CConceptLabelSetModificationTag::isConceptLabelSetModificationTagUpdated(cint64 conceptLabelSetModificationTag) { return CProcessTag::isProcessTagUpdated(conceptLabelSetModificationTag); } bool CConceptLabelSetModificationTag::isConceptLabelSetModificationTagUpToDate(cint64 conceptLabelSetModificationTag) { return CProcessTag::isProcessTagUpToDate(conceptLabelSetModificationTag); } bool CConceptLabelSetModificationTag::updateConceptLabelSetModificationTag(cint64 conceptLabelSetModificationTag) { return CProcessTag::updateProcessTag(conceptLabelSetModificationTag); } CConceptLabelSetModificationTag* CConceptLabelSetModificationTag::setConceptLabelSetModificationTag(CProcessTagger* processTagger) { return setConceptLabelSetModificationTag(processTagger->getCurrentConceptLabelSetModificationTag()); } CConceptLabelSetModificationTag* CConceptLabelSetModificationTag::initConceptLabelSetModificationTag(CProcessTagger* processTagger) { return initConceptLabelSetModificationTag(processTagger->getCurrentConceptLabelSetModificationTag()); } bool CConceptLabelSetModificationTag::isConceptLabelSetModificationTagUpdated(CProcessTagger* processTagger) { return isProcessTagUpdated(processTagger->getCurrentConceptLabelSetModificationTag()); } bool CConceptLabelSetModificationTag::isConceptLabelSetModificationTagUpToDate(CProcessTagger* processTagger) { return isProcessTagUpToDate(processTagger->getCurrentConceptLabelSetModificationTag()); } bool CConceptLabelSetModificationTag::updateConceptLabelSetModificationTag(CProcessTagger* processTagger) { return updateConceptLabelSetModificationTag(processTagger->getCurrentConceptLabelSetModificationTag()); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyRoleSuccessorHash.cpp0000644000175000017500000003146512520551142030447 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReapplyRoleSuccessorHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CReapplyRoleSuccessorHash::CReapplyRoleSuccessorHash(CProcessContext* context) : mContext(context),mRoleSuccessorDataHash(context) { mLinkCount = 0; } CReapplyRoleSuccessorHash* CReapplyRoleSuccessorHash::initRoleSuccessorHash(CReapplyRoleSuccessorHash* prevRoleSuccHash) { if (prevRoleSuccHash) { mRoleSuccessorDataHash = prevRoleSuccHash->mRoleSuccessorDataHash; mLinkCount = prevRoleSuccHash->mLinkCount; } else { mRoleSuccessorDataHash.clear(); mLinkCount = 0; } return this; } CReapplyRoleSuccessorHash* CReapplyRoleSuccessorHash::insertRoleSuccessorLink(CRole* role, CIndividualLinkEdge* link, CReapplyQueueIterator* reapplyQueueIterator) { CReapplyRoleSuccessorData& roleSuccData = mRoleSuccessorDataHash[role]; if (roleSuccData.mLinkSet) { if (!roleSuccData.mLocatedLinkSet) { CPROCESSHASH* newLinkSet = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mContext),mContext); newLinkSet->init(roleSuccData.mLinkSet,mContext); roleSuccData.mLinkSet = newLinkSet; roleSuccData.mLocatedLinkSet = true; } roleSuccData.mLinkSet->insert(getCoupledIndividualID(link),link); } roleSuccData.mLinkLinker = link->append(roleSuccData.mLinkLinker); roleSuccData.mLinkCount++; ++mLinkCount; if (reapplyQueueIterator) { *reapplyQueueIterator = roleSuccData.mReapplyQueue.getIterator(true); } return this; } CReapplyRoleSuccessorHash* CReapplyRoleSuccessorHash::removeRoleSuccessorLink(CRole* role, CIndividualLinkEdge* link) { CReapplyRoleSuccessorData& roleSuccData = mRoleSuccessorDataHash[role]; if (roleSuccData.mLinkSet) { if (!roleSuccData.mLocatedLinkSet) { CPROCESSHASH* newLinkSet = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mContext),mContext); newLinkSet->init(roleSuccData.mLinkSet,mContext); roleSuccData.mLinkSet = newLinkSet; roleSuccData.mLocatedLinkSet = true; } roleSuccData.mLinkSet->remove(getCoupledIndividualID(link)); } else { if (roleSuccData.mLinkLinker) { // replace by set CPROCESSHASH* newLinkSet = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mContext),mContext); roleSuccData.mLinkSet = newLinkSet; roleSuccData.mLocatedLinkSet = true; CIndividualLinkEdge* linkIt = roleSuccData.mLinkLinker; while (linkIt) { if (linkIt != link) { newLinkSet->insert(getCoupledIndividualID(linkIt),linkIt); } linkIt = linkIt->getNext(); } } } --roleSuccData.mLinkCount; --mLinkCount; return this; } CReapplyRoleSuccessorHash* CReapplyRoleSuccessorHash::removeRoleSuccessorLink(CRole* role, cint64 sourceIndiID, cint64 destinationIndiID) { CReapplyRoleSuccessorData& roleSuccData = mRoleSuccessorDataHash[role]; if (roleSuccData.mLinkSet) { if (!roleSuccData.mLocatedLinkSet) { CPROCESSHASH* newLinkSet = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mContext),mContext); newLinkSet->init(roleSuccData.mLinkSet,mContext); roleSuccData.mLinkSet = newLinkSet; roleSuccData.mLocatedLinkSet = true; } cint64 searchedCoupledID = getCoupledIndividualID(sourceIndiID,destinationIndiID); roleSuccData.mLinkSet->remove(searchedCoupledID); } else { if (roleSuccData.mLinkLinker) { // replace by set CPROCESSHASH* newLinkSet = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mContext),mContext); roleSuccData.mLinkSet = newLinkSet; roleSuccData.mLocatedLinkSet = true; cint64 searchedCoupledID = getCoupledIndividualID(sourceIndiID,destinationIndiID); CIndividualLinkEdge* linkIt = roleSuccData.mLinkLinker; while (linkIt) { cint64 coupledID = getCoupledIndividualID(linkIt); if (coupledID != searchedCoupledID) { newLinkSet->insert(coupledID,linkIt); } linkIt = linkIt->getNext(); } } } --roleSuccData.mLinkCount; --mLinkCount; return this; } CIndividualLinkEdge* CReapplyRoleSuccessorHash::getRoleSuccessorToIndividualLink(CRole* role, cint64 sourceIndiID, cint64 destinationIndiID, bool locateable) { CReapplyRoleSuccessorData* roleSuccData = mRoleSuccessorDataHash.valuePointer(role); if (roleSuccData && roleSuccData->mLinkLinker) { if (locateable && !roleSuccData->mLinkSet && roleSuccData->mLinkCount >= 5) { CPROCESSHASH* newLinkSet = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mContext),mContext); roleSuccData->mLinkSet = newLinkSet; roleSuccData->mLocatedLinkSet = true; CIndividualLinkEdge* linkIt = roleSuccData->mLinkLinker; CIndividualLinkEdge* searchedLink = nullptr; cint64 searchedCoupledID = getCoupledIndividualID(sourceIndiID,destinationIndiID); while (linkIt) { cint64 coupledID = getCoupledIndividualID(linkIt); newLinkSet->insert(coupledID,linkIt); if (coupledID == searchedCoupledID) { searchedLink = linkIt; } linkIt = linkIt->getNext(); } return searchedLink; } else if (!roleSuccData->mLinkSet) { cint64 searchedCoupledID = getCoupledIndividualID(sourceIndiID,destinationIndiID); CIndividualLinkEdge* linkIt = roleSuccData->mLinkLinker; while (linkIt) { cint64 coupledID = getCoupledIndividualID(linkIt); if (coupledID == searchedCoupledID) { return linkIt; } linkIt = linkIt->getNext(); } } else { cint64 searchedCoupledID = getCoupledIndividualID(sourceIndiID,destinationIndiID); return roleSuccData->mLinkSet->value(searchedCoupledID,nullptr); } } return nullptr; } bool CReapplyRoleSuccessorHash::hasRoleSuccessorToIndividual(CRole* role, cint64 sourceIndiID, cint64 destinationIndiID, bool locateable) { CIndividualLinkEdge* searchedLink = getRoleSuccessorToIndividualLink(role,sourceIndiID,destinationIndiID,locateable); return searchedLink != nullptr; } bool CReapplyRoleSuccessorHash::hasRoleSuccessor(CRole* role) { CReapplyRoleSuccessorData* roleSuccData = nullptr; if (mRoleSuccessorDataHash.tryGetValuePointer(role,roleSuccData)) { if (roleSuccData->mLinkSet) { return !roleSuccData->mLinkSet->isEmpty(); } else { return roleSuccData->mLinkLinker != nullptr; } } return false; } CRoleSuccessorLinkIterator CReapplyRoleSuccessorHash::getRoleSuccessorLinkIterator(CRole* role) { CReapplyRoleSuccessorData* roleSuccData = nullptr; if (mRoleSuccessorDataHash.tryGetValuePointer(role,roleSuccData)) { if (roleSuccData->mLinkSet) { return CRoleSuccessorLinkIterator((roleSuccData->mLinkSet)->begin(),(roleSuccData->mLinkSet)->end()); } else { return CRoleSuccessorLinkIterator(roleSuccData->mLinkLinker); } } return CRoleSuccessorLinkIterator(nullptr); } CRoleSuccessorLinkIterator CReapplyRoleSuccessorHash::getRoleSuccessorLinkIterator(CRole* role, cint64* linkCount, CIndividualLinkEdge*& lastLink) { CReapplyRoleSuccessorData* roleSuccData = nullptr; if (mRoleSuccessorDataHash.tryGetValuePointer(role,roleSuccData)) { lastLink = roleSuccData->mLinkLinker; if (linkCount) { *linkCount = roleSuccData->mLinkCount; } if (roleSuccData->mLinkSet) { return CRoleSuccessorLinkIterator((roleSuccData->mLinkSet)->begin(),(roleSuccData->mLinkSet)->end()); } else { return CRoleSuccessorLinkIterator(roleSuccData->mLinkLinker); } } return CRoleSuccessorLinkIterator(nullptr); } CRoleSuccessorLinkIterator CReapplyRoleSuccessorHash::getRoleSuccessorLinkIterator(CRole* role, cint64* linkCount) { CReapplyRoleSuccessorData* roleSuccData = nullptr; if (mRoleSuccessorDataHash.tryGetValuePointer(role,roleSuccData)) { if (linkCount) { *linkCount = roleSuccData->mLinkCount; } if (roleSuccData->mLinkSet) { return CRoleSuccessorLinkIterator((roleSuccData->mLinkSet)->begin(),(roleSuccData->mLinkSet)->end()); } else { return CRoleSuccessorLinkIterator(roleSuccData->mLinkLinker); } } return CRoleSuccessorLinkIterator(nullptr); } cint64 CReapplyRoleSuccessorHash::getRoleSuccessorCount(CRole* role) { CReapplyRoleSuccessorData* roleSuccData = nullptr; if (mRoleSuccessorDataHash.tryGetValuePointer(role,roleSuccData)) { return roleSuccData->mLinkCount; } return 0; } CRoleSuccessorLinkIterator CReapplyRoleSuccessorHash::getRoleSuccessorHistoryLinkIterator(CRole* role, CIndividualLinkEdge* lastLink) { CReapplyRoleSuccessorData* roleSuccData = nullptr; if (mRoleSuccessorDataHash.tryGetValuePointer(role,roleSuccData)) { return CRoleSuccessorLinkIterator(roleSuccData->mLinkLinker,lastLink); } return CRoleSuccessorLinkIterator(nullptr); } CRoleSuccessorLinkIterator CReapplyRoleSuccessorHash::getRoleSuccessorHistoryLinkIterator(CRole* role, CIndividualLinkEdge* lastLink, cint64* linkCount) { CReapplyRoleSuccessorData* roleSuccData = nullptr; if (mRoleSuccessorDataHash.tryGetValuePointer(role,roleSuccData)) { if (linkCount) { *linkCount = roleSuccData->mLinkCount; } return CRoleSuccessorLinkIterator(roleSuccData->mLinkLinker,lastLink); } return CRoleSuccessorLinkIterator(nullptr); } CReapplyQueue* CReapplyRoleSuccessorHash::getRoleReapplyQueue(CRole* role, bool create) { if (create) { CReapplyRoleSuccessorData& roleSuccData = mRoleSuccessorDataHash[role]; return &roleSuccData.mReapplyQueue; } else { CReapplyRoleSuccessorData* roleSuccData = nullptr; if (mRoleSuccessorDataHash.tryGetValuePointer(role,roleSuccData)) { return &roleSuccData->mReapplyQueue; } } return nullptr; } bool CReapplyRoleSuccessorHash::containsRoleReapplyQueue(CRole* role) { CReapplyRoleSuccessorData* roleSuccData = nullptr; if (mRoleSuccessorDataHash.tryGetValuePointer(role,roleSuccData)) { return !roleSuccData->mReapplyQueue.isEmpty(); } return false; } CReapplyQueueIterator CReapplyRoleSuccessorHash::getRoleReapplyIterator(CRole* role, bool clearDynamicReapplyQueue) { CReapplyRoleSuccessorData* roleSuccData = nullptr; if (mRoleSuccessorDataHash.tryGetValuePointer(role,roleSuccData)) { return roleSuccData->mReapplyQueue.getIterator(clearDynamicReapplyQueue); } return CReapplyQueueIterator(nullptr,nullptr); } cint64 CReapplyRoleSuccessorHash::getCoupledIndividualID(CIndividualLinkEdge* link) { return link->getCoupledIndividualID(); } cint64 CReapplyRoleSuccessorHash::getCoupledIndividualID(cint64 indi1ID, cint64 indi2ID) { return indi1ID + indi2ID; } CRoleSuccessorIterator CReapplyRoleSuccessorHash::getRoleIterator() { return CRoleSuccessorIterator(mRoleSuccessorDataHash.begin(),mRoleSuccessorDataHash.end()); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptProcessingPriorityQueueData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptProcessingPriorityQueueData.cp0000644000175000017500000000206012520551100032303 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptProcessingPriorityQueueData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleBackwardSaturationPropagationHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleBackwardSaturationPropagationHash0000644000175000017500000000347112520551150032347 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleBackwardSaturationPropagationHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRoleBackwardSaturationPropagationHashData::CRoleBackwardSaturationPropagationHashData() { mLinkLinker = nullptr; mReapplyLinker = nullptr; mSelfConnected = false; mRoleALLConceptsProcessingQueued = false; mRolePredecessorMergingProcessingQueued = false; mRolePredecessorMergingQueuingRequired = false; } CRoleBackwardSaturationPropagationHashData::CRoleBackwardSaturationPropagationHashData(const CRoleBackwardSaturationPropagationHashData& data) { mLinkLinker = nullptr; mReapplyLinker = data.mReapplyLinker; mSelfConnected = data.mSelfConnected; mRoleALLConceptsProcessingQueued = false; mRolePredecessorMergingProcessingQueued = false; mRolePredecessorMergingQueuingRequired = false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeXMLValueSpaceData.cpp0000644000175000017500000000560112520551116030404 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeXMLValueSpaceData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeXMLValueSpaceData::CDatatypeXMLValueSpaceData(CProcessContext* processContext) : CDatatypeCompareValueSpaceData(processContext) { mXMLValueSpaceMap = nullptr; } CDatatypeXMLValueSpaceData* CDatatypeXMLValueSpaceData::initXMLValueSpaceData(CDatatypeValueSpaceXMLType* valueSpaceType) { CDatatypeCompareValueSpaceData::initValueSpaceData(nullptr); mValueSpaceType = valueSpaceType; if (mXMLValueSpaceMap) { mXMLValueSpaceMap->initDatatypeCompareValueSpaceMap(valueSpaceType); } return this; } CDatatypeXMLValueSpaceData* CDatatypeXMLValueSpaceData::copyXMLValueSpaceData(CDatatypeXMLValueSpaceData* spaceData) { CDatatypeCompareValueSpaceData::initValueSpaceData(spaceData); mValueSpaceType = spaceData->mValueSpaceType; if (spaceData->mXMLValueSpaceMap && !mXMLValueSpaceMap) { getXMLValueSpaceMap(true); mXMLValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mXMLValueSpaceMap); } else if (mXMLValueSpaceMap) { if (spaceData->mXMLValueSpaceMap) { mXMLValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mXMLValueSpaceMap); } else { mXMLValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } } return this; } CDatatypeXMLValueSpaceMap* CDatatypeXMLValueSpaceData::getXMLValueSpaceMap(bool create) { if (create && !mXMLValueSpaceMap) { mXMLValueSpaceMap = CObjectParameterizingAllocator< CDatatypeXMLValueSpaceMap,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mXMLValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } return mXMLValueSpaceMap; } CDatatypeCompareValueSpaceMap* CDatatypeXMLValueSpaceData::createValueSpaceMap() { return getXMLValueSpaceMap(true); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualLinkEdge.h0000644000175000017500000000517612520551122026651 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALLINKEDGE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALLINKEDGE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CLinkEdge.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualLinkEdge * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualLinkEdge : public CLinkEdge, public CLinkerBase { // public methods public: //! Constructor CIndividualLinkEdge(CProcessContext* processContext = nullptr); CIndividualLinkEdge* initIndividualLinkEdge(CIndividualLinkEdge* link); CIndividualLinkEdge* initIndividualLinkEdge(CIndividualProcessNode* creatorIndividual, CIndividualProcessNode* sourceIndividual, CIndividualProcessNode* destinationIndividual, CRole* role, CDependencyTrackPoint* depTrackPoint); CIndividualProcessNode* getCreatorIndividual(); cint64 getCreatorIndividualID(); bool isCreatorIndividual(CIndividualProcessNode* indi); bool isCreatorIndividualID(CIndividualProcessNode* indi); bool isCreatorIndividualID(cint64 indiID); // protected methods protected: // protected variables protected: CIndividualProcessNode* mCreatorIndividual; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALLINKEDGE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeFloatValueSpaceMap.h0000644000175000017500000000520112520551112030312 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEFLOATVALUESPACEMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEFLOATVALUESPACEMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeCompareValueSpaceMap.h" // Other includes #include "Reasoner/Ontology/CDataLiteralFloatValue.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeFloatValueSpaceMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeFloatValueSpaceMap : public CDatatypeCompareValueSpaceMap { // public methods public: //! Constructor CDatatypeFloatValueSpaceMap(CProcessContext* processContext); // protected methods protected: virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* value); virtual bool getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom); virtual bool getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast); virtual cuint64 getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); bool isNaN(int bits); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEFLOATVALUESPACEMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingMapData.h0000644000175000017500000000516212520551136030164 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGMAPDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGMAPDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CPropagationBindingDescriptor.h" #include "CPropagationBindingReapplyConceptDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CPropagationBindingMapData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPropagationBindingMapData { // public methods public: //! Constructor CPropagationBindingMapData(CPropagationBindingDescriptor* propBindDes = nullptr); CPropagationBindingDescriptor* getPropagationBindingDescriptor() const; bool hasPropagationBindingDescriptor() const; CPropagationBindingMapData* setPropagationBindingDescriptor(CPropagationBindingDescriptor* des); CPropagationBindingReapplyConceptDescriptor* getReapplyConceptDescriptor() const; bool hasReapplyConceptDescriptor() const; CPropagationBindingMapData* setReapplyConceptDescriptor(CPropagationBindingReapplyConceptDescriptor* reapplyConDes); CPropagationBindingMapData* clearReapplyConceptDescriptor(); // protected methods protected: // protected variables protected: CPropagationBindingReapplyConceptDescriptor* mReapplyConDes; CPropagationBindingDescriptor* mPropBindDes; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGMAPDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleSuccessorIterator.cpp0000644000175000017500000000352112520551152030011 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleSuccessorIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRoleSuccessorIterator::CRoleSuccessorIterator() { } CRoleSuccessorIterator::CRoleSuccessorIterator(const CPROCESSHASH::iterator& beginIt, const CPROCESSHASH::iterator& endIt) : mBeginIt(beginIt),mEndIt(endIt) { while (mBeginIt != mEndIt && mBeginIt.value().mLinkCount <= 0) { ++mBeginIt; } } bool CRoleSuccessorIterator::hasNext() { return mBeginIt != mEndIt; } CRole* CRoleSuccessorIterator::next(bool moveNext) { CRole* role = nullptr; if (mBeginIt != mEndIt) { role = mBeginIt.key(); if (moveNext) { ++mBeginIt; while (mBeginIt != mEndIt && mBeginIt.value().mLinkCount <= 0) { ++mBeginIt; } } } return role; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeExpressivityViolationFlags.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeExpressivityViolationFl0000644000175000017500000000446112520551122032430 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeExpressivityViolationFlags.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeExpressivityViolationFlags::CIndividualNodeExpressivityViolationFlags(CProcessContext* context) : mContext(context) { } CIndividualNodeExpressivityViolationFlags* CIndividualNodeExpressivityViolationFlags::initViolationFlags(CIndividualNodeExpressivityViolationFlags* violationFlags) { mViolFlags = 0; if (violationFlags) { mViolFlags = violationFlags->mViolFlags; } return this; } bool CIndividualNodeExpressivityViolationFlags::setViolationFlags(cint64 flags) { if (flags != 0) { flags |= VFEXPRESSIVITYVIOLATED; } bool diff = (mViolFlags & flags) != flags; mViolFlags |= flags; return diff; } bool CIndividualNodeExpressivityViolationFlags::setViolationFlags(CIndividualNodeExpressivityViolationFlags* violationFlags) { return setViolationFlags(violationFlags->mViolFlags); } bool CIndividualNodeExpressivityViolationFlags::hasPartialViolationFlags(cint64 flags) { return (mViolFlags & flags) != 0; } bool CIndividualNodeExpressivityViolationFlags::hasViolationFlags(cint64 flags) { return (mViolFlags & flags) == flags; } bool CIndividualNodeExpressivityViolationFlags::hasViolations() { return mViolFlags != 0; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJ0000644000175000017500000000465412520551146032302 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CRepresentativeVariableBindingPathSetJoiningKeyMap.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathSetJoiningData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathSetJoiningData { // public methods public: //! Constructor CRepresentativeVariableBindingPathSetJoiningData(CProcessContext* processContext); CRepresentativeVariableBindingPathSetJoiningData* initRepresentativeVariableBindingPathSetJoiningData(CRepresentativeVariableBindingPathSetJoiningData* data); CRepresentativeVariableBindingPathSetJoiningKeyMap* getJoiningKeyMap(); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CRepresentativeVariableBindingPathSetJoiningKeyMap mJoiningKeyMap; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeDoubleValueSpaceData.h0000644000175000017500000000513012520551110030612 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDOUBLEVALUESPACEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDOUBLEVALUESPACEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeDoubleValueSpaceMap.h" #include "CDatatypeCompareValueSpaceData.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceDoubleType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeDoubleValueSpaceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeDoubleValueSpaceData : public CDatatypeCompareValueSpaceData { // public methods public: //! Constructor CDatatypeDoubleValueSpaceData(CProcessContext* processContext); CDatatypeDoubleValueSpaceData* copyDoubleValueSpaceData(CDatatypeDoubleValueSpaceData* spaceData); CDatatypeDoubleValueSpaceData* initDoubleValueSpaceData(CDatatypeValueSpaceDoubleType* valueSpaceType); CDatatypeDoubleValueSpaceMap* getDoubleValueSpaceMap(bool create); // protected methods protected: virtual CDatatypeCompareValueSpaceMap* createValueSpaceMap(); // protected variables protected: CDatatypeDoubleValueSpaceMap* mDoubleValueSpaceMap; CDatatypeValueSpaceDoubleType* mValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDOUBLEVALUESPACEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedConceptDescriptor.cpp0000644000175000017500000000420212520551074030422 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClashedConceptDescriptor.h" #include "CIndividualProcessNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CClashedConceptDescriptor::CClashedConceptDescriptor() : CClashedDependencyDescriptor() { mConceptDescriptor = nullptr; mIndividualNode = nullptr; } CClashedConceptDescriptor* CClashedConceptDescriptor::initClashedConceptDescriptor(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CIndividualProcessNode* individual) { initClashedDependencyDescriptor(depTrackPoint); mConceptDescriptor = conceptDescriptor; mIndividualNode = individual; return this; } CConceptDescriptor* CClashedConceptDescriptor::getConceptDescriptor() { return mConceptDescriptor; } cint64 CClashedConceptDescriptor::getAppropriatedIndividualID() { return mIndividualNode->getIndividualID(); } CClashedConceptDescriptor* CClashedConceptDescriptor::setAppropriatedIndividual(CIndividualProcessNode* individualNode) { mIndividualNode = individualNode; return this; } CIndividualProcessNode* CClashedConceptDescriptor::getAppropriatedIndividual() { return mIndividualNode; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualProcessNodeReference.h0000644000175000017500000000357412520551126031236 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODEREFERENCE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODEREFERENCE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Reasoner/Ontology/CProcessReference.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CIndividualProcessNodeReference * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeReference : public CProcessReference { // public methods public: // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODEREFERENCE_H ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJ0000644000175000017500000000300112520551150032256 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathSetJoiningHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathSetJoiningHashData::CRepresentativeVariableBindingPathSetJoiningHashData() { mUseJoiningData = nullptr; mLocJoiningData = nullptr; } CRepresentativeVariableBindingPathSetJoiningHashData::CRepresentativeVariableBindingPathSetJoiningHashData(const CRepresentativeVariableBindingPathSetJoiningHashData& data) { mUseJoiningData = data.mUseJoiningData; mLocJoiningData = nullptr; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeIRIValueSpaceData.cpp0000644000175000017500000000560012520551112030362 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeIRIValueSpaceData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeIRIValueSpaceData::CDatatypeIRIValueSpaceData(CProcessContext* processContext) : CDatatypeCompareValueSpaceData(processContext) { mIRIValueSpaceMap = nullptr; } CDatatypeIRIValueSpaceData* CDatatypeIRIValueSpaceData::initIRIValueSpaceData(CDatatypeValueSpaceIRIType* valueSpaceType) { CDatatypeCompareValueSpaceData::initValueSpaceData(nullptr); mValueSpaceType = valueSpaceType; if (mIRIValueSpaceMap) { mIRIValueSpaceMap->initDatatypeCompareValueSpaceMap(valueSpaceType); } return this; } CDatatypeIRIValueSpaceData* CDatatypeIRIValueSpaceData::copyIRIValueSpaceData(CDatatypeIRIValueSpaceData* spaceData) { CDatatypeCompareValueSpaceData::initValueSpaceData(spaceData); mValueSpaceType = spaceData->mValueSpaceType; if (spaceData->mIRIValueSpaceMap && !mIRIValueSpaceMap) { getIRIValueSpaceMap(true); mIRIValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mIRIValueSpaceMap); } else if (mIRIValueSpaceMap) { if (spaceData->mIRIValueSpaceMap) { mIRIValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mIRIValueSpaceMap); } else { mIRIValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } } return this; } CDatatypeIRIValueSpaceMap* CDatatypeIRIValueSpaceData::getIRIValueSpaceMap(bool create) { if (create && !mIRIValueSpaceMap) { mIRIValueSpaceMap = CObjectParameterizingAllocator< CDatatypeIRIValueSpaceMap,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mIRIValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } return mIRIValueSpaceMap; } CDatatypeCompareValueSpaceMap* CDatatypeIRIValueSpaceData::createValueSpaceMap() { return getIRIValueSpaceMap(true); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptVariableBindingPathSetHash.cpp0000644000175000017500000000524112520551102032131 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptVariableBindingPathSetHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptVariableBindingPathSetHash::CConceptVariableBindingPathSetHash(CProcessContext* processContext) : mProcessContext(processContext) { } CConceptVariableBindingPathSetHash* CConceptVariableBindingPathSetHash::initConceptVariableBindingPathSetHash(CConceptVariableBindingPathSetHash* prevHash) { if (prevHash) { *this = *prevHash; } else { CPROCESSHASH::clear(); } return this; } CVariableBindingPathSet* CConceptVariableBindingPathSetHash::getVariableBindingPathSet(CConcept* concept, bool localize) { CVariableBindingPathSet* propBindSet = nullptr; cint64 conTag = concept->getConceptTag(); if (localize) { CConceptVariableBindingPathSetHashData& data = CPROCESSHASH::operator[](conTag); if (!data.mLocVariableBindingPathSet) { CMemoryAllocationManager* taskMemMan = mProcessContext->getUsedMemoryAllocationManager(); propBindSet = CObjectParameterizingAllocator< CVariableBindingPathSet,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,mProcessContext); propBindSet->initVariableBindingPathSet(data.mUseVariableBindingPathSet); data.mUseVariableBindingPathSet = data.mLocVariableBindingPathSet = propBindSet; } else { propBindSet = data.mUseVariableBindingPathSet; } } else { CConceptVariableBindingPathSetHashData data = CPROCESSHASH::value(conTag); propBindSet = data.mUseVariableBindingPathSet; } return propBindSet; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualCustomPriorityProcessingQueue.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualCustomPriorityProcessingQue0000644000175000017500000000501212520551120032450 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALCUSTOMPRIORITYPROCESSINGQUEUE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALCUSTOMPRIORITYPROCESSINGQUEUE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualCustomPriorityProcessingQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualCustomPriorityProcessingQueue { // public methods public: //! Constructor CIndividualCustomPriorityProcessingQueue(CProcessContext* processContext); CIndividualCustomPriorityProcessingQueue* initProcessingQueue(CIndividualCustomPriorityProcessingQueue* processingQueue); CIndividualProcessNode* takeNextProcessIndividual(); CIndividualProcessNode* getNextProcessIndividual(); CIndividualCustomPriorityProcessingQueue* insertIndiviudal(double priority, CIndividualProcessNode* individual); bool isEmpty(); cint64 getQueuedIndividualCount(); bool hasQueuedIndividuals(); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CPROCESSMAP mPriorityIndiMap; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALCUSTOMPRIORITYPROCESSINGQUEUE_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationModifiedProcessUpdateLinker.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationModifiedProcessUpdateLinker0000644000175000017500000000525212520551156032373 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONMODIFIEDPROCESSUPDATELINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONMODIFIEDPROCESSUPDATELINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Utilities/Container/CLinker.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSaturationModifiedProcessUpdateLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationModifiedProcessUpdateLinker : public CLinkerBase { // public methods public: //! Constructor CSaturationModifiedProcessUpdateLinker(); enum MODIFICATIONPROCESSUPDATETYPE { UPDATEPDISJUNCTCOMMONCONCEPTSEXTRACTION }; CSaturationModifiedProcessUpdateLinker* initProcessUpdateLinker(CIndividualSaturationProcessNode* individual, MODIFICATIONPROCESSUPDATETYPE updateType); CSaturationModifiedProcessUpdateLinker* setProcessingIndividual(CIndividualSaturationProcessNode* individual); CIndividualSaturationProcessNode* getProcessingIndividual(); MODIFICATIONPROCESSUPDATETYPE getUpdateType(); CSaturationModifiedProcessUpdateLinker* setUpdateType(MODIFICATIONPROCESSUPDATETYPE updateType); // protected methods protected: // protected variables protected: MODIFICATIONPROCESSUPDATETYPE mUpdateType; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONMODIFIEDPROCESSUPDATELINKER_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationData.cp0000644000175000017500000000630012520551132032176 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNominalCachingLossReactivationData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CNominalCachingLossReactivationData::CNominalCachingLossReactivationData(CProcessContext* processContext) { mProcessContext = processContext; } CNominalCachingLossReactivationData* CNominalCachingLossReactivationData::initNominalCachingLossReactivationData(cint64 nominalID, CNominalCachingLossReactivationData* data) { mReactivated = false; mNominalID = nominalID; mIndiReactivationLinker = nullptr; if (data) { mReactivated = data->mReactivated; mIndiReactivationLinker = data->mIndiReactivationLinker; } return this; } bool CNominalCachingLossReactivationData::getNominalID() { return mNominalID; } bool CNominalCachingLossReactivationData::hasReactivated() { return mReactivated; } CNominalCachingLossReactivationData* CNominalCachingLossReactivationData::setReactivated(bool lostCached) { mReactivated = lostCached; return this; } CXLinker* CNominalCachingLossReactivationData::getReactivationIndividualNodeLinker() { return mIndiReactivationLinker; } CXLinker* CNominalCachingLossReactivationData::takeReactivationIndividualNodeLinker() { CXLinker* tmpIndiProcNodeLinker = mIndiReactivationLinker; mIndiReactivationLinker = nullptr; return tmpIndiProcNodeLinker; } CNominalCachingLossReactivationData* CNominalCachingLossReactivationData::addReactivationIndividualNodeLinker(CXLinker* indiProcNodeLinker) { if (indiProcNodeLinker) { mIndiReactivationLinker = indiProcNodeLinker->append(mIndiReactivationLinker); } return this; } CNominalCachingLossReactivationData* CNominalCachingLossReactivationData::addReactivationIndividualNode(CIndividualProcessNode* indiProcNode) { CXLinker* indiProcNodeLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(mProcessContext->getUsedMemoryAllocationManager()); indiProcNodeLinker->initLinker(indiProcNode); addReactivationIndividualNodeLinker(indiProcNodeLinker); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessTagger.cpp0000644000175000017500000000744312520551136026265 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessTagger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CProcessTagger::CProcessTagger() { mLocalizationTag = 0; mProcessingTag = 0; mBranchingTag = 0; mBlockingAddTag = 0; mNodeSwitchTag = 0; mConceptLabelSetModificationTag = 0; mCurrentBlockingFollowTag = 0; } CProcessTagger::~CProcessTagger() { } CProcessTagger* CProcessTagger::initProcessTagger(CProcessTagger* processTagger) { if (processTagger) { mLocalizationTag = processTagger->mLocalizationTag; mProcessingTag = processTagger->mProcessingTag; mBranchingTag = processTagger->mBranchingTag; mBlockingAddTag = processTagger->mBlockingAddTag; mNodeSwitchTag = processTagger->mNodeSwitchTag; mConceptLabelSetModificationTag = processTagger->mConceptLabelSetModificationTag; mCurrentBlockingFollowTag = processTagger->mCurrentBlockingFollowTag; } else { mLocalizationTag = 0; mProcessingTag = 0; mBranchingTag = 0; mBlockingAddTag = 0; mNodeSwitchTag = 0; mConceptLabelSetModificationTag = 0; mCurrentBlockingFollowTag = 0; } return this; } CProcessTagger* CProcessTagger::setCurrentLocalizationTag(cint64 locTag) { mLocalizationTag = locTag; return this; } cint64 CProcessTagger::getCurrentLocalizationTag() { return mLocalizationTag; } cint64 CProcessTagger::getCurrentProcessingTag() { return mProcessingTag; } cint64 CProcessTagger::getCurrentProcessingTagAndInc() { return mProcessingTag++; } cint64 CProcessTagger::getCurrentBranchingTag() { return mBranchingTag; } cint64 CProcessTagger::getCurrentBlockingAddTag() { return mBlockingAddTag; } cint64 CProcessTagger::getCurrentNodeSwitchTag() { return mNodeSwitchTag; } cint64 CProcessTagger::getCurrentConceptLabelSetModificationTag() { return mConceptLabelSetModificationTag; } cint64 CProcessTagger::getCurrentBlockingFollowTag() { return mCurrentBlockingFollowTag; } CProcessTagger* CProcessTagger::incLocalizationTag() { ++mLocalizationTag; return this; } CProcessTagger* CProcessTagger::incProcessingTag() { ++mProcessingTag; return this; } CProcessTagger* CProcessTagger::incBranchingTag() { ++mBranchingTag; return this; } CProcessTagger* CProcessTagger::incBlockingAddTag() { ++mBlockingAddTag; return this; } CProcessTagger* CProcessTagger::incNodeSwitchTag() { ++mNodeSwitchTag; return this; } CProcessTagger* CProcessTagger::incConceptLabelSetModificationTag() { ++mConceptLabelSetModificationTag; return this; } CProcessTagger* CProcessTagger::incCurrentBlockingFollowTag() { ++mCurrentBlockingFollowTag; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeExtensionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeExtens0000644000175000017500000001035712520551130032422 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODEEXTENSIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODEEXTENSIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CSaturationDisjunctCommonConceptExtractionData.h" #include "CLinkedRoleSaturationSuccessorHash.h" #include "CCriticalSaturationConceptTypeQueues.h" #include "CSaturationIndividualNodeSuccessorExtensionData.h" #include "CSaturationIndividualNodeNominalHandlingData.h" #include "CCriticalPredecessorRoleCardinalityHash.h" #include "CSaturationIndividualNodeDatatypeData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualSaturationProcessNodeExtensionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualSaturationProcessNodeExtensionData { // public methods public: //! Constructor CIndividualSaturationProcessNodeExtensionData(CProcessContext* processContext = nullptr); CIndividualSaturationProcessNodeExtensionData* initIndividualExtensionData(CIndividualSaturationProcessNode* indiNode); CSaturationDisjunctCommonConceptExtractionData* getDisjunctCommonConceptExtractionData(bool create = true); CLinkedRoleSaturationSuccessorHash* getLinkedRoleSuccessorHash(bool create = true); CCriticalSaturationConceptTypeQueues* getCriticalConceptTypeQueues(bool create = true); CSaturationIndividualNodeSuccessorExtensionData* getSuccessorExtensionData(bool create = true); CSaturationIndividualNodeNominalHandlingData* getNominalHandlingData(bool create = true); CCriticalPredecessorRoleCardinalityHash* getCriticalPredecessorRoleCardinalityHash(bool create = true); CSaturationIndividualNodeDatatypeData* getAppliedDatatypeData(bool create = true); CSaturationSuccessorRoleAssertionLinker* getRoleAssertionLinker(); CIndividualSaturationProcessNodeExtensionData* addRoleAssertionLinker(CSaturationSuccessorRoleAssertionLinker* roleAssertionLinker); CIndividualSaturationProcessNodeExtensionData* addRoleAssertion(CIndividualSaturationProcessNode* destinationNode, CRole* role, bool roleNegation); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CMemoryAllocationManager* mMemAllocMan; CIndividualSaturationProcessNode* mIndiNode; CSaturationDisjunctCommonConceptExtractionData* mDisComConExtData; CLinkedRoleSaturationSuccessorHash* mLinkedRoleSuccHash; CCriticalSaturationConceptTypeQueues* mCriticalConceptTypeQueues; CSaturationIndividualNodeSuccessorExtensionData* mSuccessorExtensionData; CSaturationIndividualNodeNominalHandlingData* mNominalHandlingData; CCriticalPredecessorRoleCardinalityHash* mCriticalPredRoleCardHash; CSaturationSuccessorRoleAssertionLinker* mRoleAssertionLinker; CSaturationIndividualNodeDatatypeData* mAppliedDatatypeData; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODEEXTENSIONDATA_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeData.cp0000644000175000017500000000503212520551156032225 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNominalDependentNodeData.h" #include "CIndividualSaturationProcessNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationNominalDependentNodeData::CSaturationNominalDependentNodeData(CProcessContext* processContext) { mProcessContext = processContext; mIndiSatProcData = nullptr; mConnectionType = NONECONNECTION; } CSaturationNominalDependentNodeData* CSaturationNominalDependentNodeData::initNominalDependentNodeData(CIndividualSaturationProcessNode* indiSatProcData, NOMINALCONNECTIONTYPE connectionType) { mIndiSatProcData = indiSatProcData; mConnectionType = connectionType; return this; } CSaturationNominalDependentNodeData::NOMINALCONNECTIONTYPE CSaturationNominalDependentNodeData::getNominalConnectionType() { return mConnectionType; } CSaturationNominalDependentNodeData* CSaturationNominalDependentNodeData::setNominalConnectionType(CSaturationNominalDependentNodeData::NOMINALCONNECTIONTYPE connectionType) { mConnectionType = connectionType; return this; } CSaturationNominalDependentNodeData* CSaturationNominalDependentNodeData::getNextNominalConnectionTypeData() { return getNext(); } CIndividualSaturationProcessNode* CSaturationNominalDependentNodeData::getDependentIndividualSaturationNode() { return mIndiSatProcData; } CSaturationNominalDependentNodeData* CSaturationNominalDependentNodeData::setDependentIndividualSaturationNode(CIndividualSaturationProcessNode* indiSatNode) { mIndiSatProcData = indiSatNode; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeContainingMapData.h0000644000175000017500000000475612520551142031425 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVECONTAININGMAPDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVECONTAININGMAPDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CVariableBindingPath.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativeContainingMapData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeContainingMapData { // public methods public: //! Constructor CRepresentativeContainingMapData(CRepresentativeVariableBindingPathSetData* containedRep = nullptr, bool explContained = false); CRepresentativeVariableBindingPathSetData* getRepresentativeVariableBindingPathSetData() const; bool hasRepresentativeVariableBindingPathSetData() const; CRepresentativeContainingMapData* setRepresentativeVariableBindingPathSetData(CRepresentativeVariableBindingPathSetData* containedRep); bool isExplicitelyContained() const; CRepresentativeContainingMapData* setExplicitelyContained(bool explContained); // protected methods protected: // protected variables protected: CRepresentativeVariableBindingPathSetData* mContainedRep; bool mExplicitelyContained; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVECONTAININGMAPDATA_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinkedCandidateHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinkedCandidate0000644000175000017500000000705312520551074032225 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODELINKEDCANDIDATEHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODELINKEDCANDIDATEHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CIndividualProcessNode.h" #include "CBlockingIndividualNodeLinkedCandidateData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CBlockingIndividualNodeLinkedCandidateHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBlockingIndividualNodeLinkedCandidateHash { // public methods public: //! Constructor CBlockingIndividualNodeLinkedCandidateHash(CProcessContext* context = nullptr); //! Destructor virtual ~CBlockingIndividualNodeLinkedCandidateHash(); CBlockingIndividualNodeLinkedCandidateHash* initBlockingIndividualNodeCandidateHash(CBlockingIndividualNodeLinkedCandidateHash* prevBlockCandHash); CBlockingIndividualNodeLinkedCandidateData* getBlockingIndividualCandidateData(CConcept* initializationConcept, bool conceptNegation, bool create = true); CBlockingIndividualNodeLinkedCandidateData* getBlockingIndividualCandidateData(CConceptDescriptor* initializationConDes, bool create = true); // protected methods protected: // protected variables protected: class CBlockingLinkedCandidateHashData { public: inline CBlockingLinkedCandidateHashData() { mCandidateIndiData = nullptr; mPrevCandidateIndiData = nullptr; } inline CBlockingLinkedCandidateHashData(const CBlockingLinkedCandidateHashData& data) { mCandidateIndiData = nullptr; mPrevCandidateIndiData = data.mPrevCandidateIndiData; } CBlockingIndividualNodeLinkedCandidateData* mCandidateIndiData; CBlockingIndividualNodeLinkedCandidateData* mPrevCandidateIndiData; }; CProcessContext* mContext; CMemoryAllocationManager* mMemMan; CPROCESSHASH< QPair ,CBlockingLinkedCandidateHashData>* mBlockCandidateHash; CPROCESSHASH< QPair ,CBlockingLinkedCandidateHashData>* mUseBlockCandidateHash; CPROCESSHASH< QPair ,CBlockingLinkedCandidateHashData>* mPrevBlockCandidateHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODELINKEDCANDIDATEHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDistinctIterator.h0000644000175000017500000000445712520551120026450 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDISTINCTITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDISTINCTITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CDistinctEdge.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CDistinctIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDistinctIterator { // public methods public: //! Constructor CDistinctIterator(); CDistinctIterator(const CPROCESSHASH::iterator& beginIt, const CPROCESSHASH::iterator& endIt); bool hasNext(); cint64 nextDistinctIndividualID(bool moveNext = true); cint64 nextDistinctIndividualID(CDependencyTrackPoint*& depTrackPoint, bool moveNext = true); CDistinctEdge* next(bool moveNext = true); // protected methods protected: // protected variables protected: CPROCESSHASH::iterator mBeginIt; CPROCESSHASH::iterator mEndIt; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDISTINCTITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReusingReviewData.h0000644000175000017500000000445112520551150026542 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREUSINGREVIEWDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREUSINGREVIEWDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" #include "CProcessContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CReusingReviewData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReusingReviewData { // public methods public: //! Constructor CReusingReviewData(CProcessContext* context = nullptr); CReusingReviewData* initReviewData(CReusingReviewData* sigBlockRevData); CReusingReviewData* insert(cint64 depth, cint64 indiID); bool contains(cint64 indiID); CReusingReviewData* remove(cint64 indiID); bool isEmpty(); bool hasNextIndividualID(); cint64 takeNextIndividualID(); // protected methods protected: // protected variables protected: CPROCESSSET mIndividualSet; CPROCESSMAP mDepthIndividualMap; CProcessContext* mContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREUSINGREVIEWDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueData.cpp0000644000175000017500000000512612520551114030236 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeStringValueData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeStringValueData::CDatatypeStringValueData(CProcessContext* processContext) { mProcessContext = processContext; mValue = nullptr; } CDatatypeStringValueData* CDatatypeStringValueData::initStringValueData(CDatatypeStringValueData* valueData, CDataLiteralStringValue* value) { mValue = value; if (valueData) { mValueExclusionData.initDataExclusion(&valueData->mValueExclusionData); mLeftExclusionData.initDataExclusion(&valueData->mLeftExclusionData); mRightExclusionData.initDataExclusion(&valueData->mRightExclusionData); } else { mValueExclusionData.initDataExclusion(nullptr); mLeftExclusionData.initDataExclusion(nullptr); mRightExclusionData.initDataExclusion(nullptr); } return this; } CDatatypeStringValueData* CDatatypeStringValueData::initStringValueData(CDataLiteralStringValue* value) { mValue = value; return this; } CDataLiteralStringValue* CDatatypeStringValueData::getValue() { return mValue; } CDatatypeStringValueData* CDatatypeStringValueData::setValue(CDataLiteralStringValue* value) { mValue = value; return this; } CDatatypeStringValueDataExclusion* CDatatypeStringValueData::getValueExclusionData() { return &mValueExclusionData; } CDatatypeStringValueDataExclusion* CDatatypeStringValueData::getLeftExclusionData() { return &mLeftExclusionData; } CDatatypeStringValueDataExclusion* CDatatypeStringValueData::getRightExclusionData() { return &mRightExclusionData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueExclusionType.h0000644000175000017500000000447212520551114031650 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUEEXCLUSIONTYPE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUEEXCLUSIONTYPE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CDatatypeStringValueExclusionType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeStringValueExclusionType { // public methods public: enum STRING_VALUE_EXCLUSION_TYPE { SVET_NOTHING = 0, SVET_LANGUAGE_TAGS_COMPLETELY = 1, SVET_ALL = 2 }; //! Constructor CDatatypeStringValueExclusionType(STRING_VALUE_EXCLUSION_TYPE exclusionType = SVET_NOTHING, bool negated = false); CDatatypeStringValueExclusionType* setExclusionType(STRING_VALUE_EXCLUSION_TYPE exclusionType, bool negated); STRING_VALUE_EXCLUSION_TYPE getExclusionType(); bool getExclusionNegation(); // protected methods protected: // protected variables protected: STRING_VALUE_EXCLUSION_TYPE mExclusionType; bool mExclusionNegation; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDatatypeStringValueExclusionType_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDisjointSuccessorRoleHash.h0000644000175000017500000000646512520551120030261 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDISJOINTSUCCESSORROLEHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDISJOINTSUCCESSORROLEHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CNegationDisjointEdge.h" #include "CDisjointSuccessorRoleIterator.h" #include "CProcessContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CDisjointSuccessorRoleHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDisjointSuccessorRoleHash { // public methods public: //! Constructor CDisjointSuccessorRoleHash(CProcessContext* context = nullptr); //! Destructor virtual ~CDisjointSuccessorRoleHash(); CDisjointSuccessorRoleHash* initDisjointSuccessorRoleHash(CDisjointSuccessorRoleHash* prevDisjRoleHash); CDisjointSuccessorRoleHash* insertDisjointSuccessorRoleLink(cint64 succIndi, CNegationDisjointEdge* link); CDisjointSuccessorRoleHash* removeDisjointSuccessorRoleLinks(cint64 succIndi); CDisjointSuccessorRoleIterator getDisjointRoleIterator(cint64 succIndi); bool hasDisjointSuccessorRoleLink(cint64 succIndi, CRole* role); CNegationDisjointEdge* getDisjointSuccessorRoleLink(cint64 succIndi, CRole* role); // protected methods protected: CPROCESSHASH* getNegDisRoleHash(cint64 successor, bool located = true); // protected variables protected: class CDisjointSuccessorRoleData { public: inline CDisjointSuccessorRoleData() { mUseNegDisSet = nullptr; mLocNegDisSet = nullptr; } inline CDisjointSuccessorRoleData(const CDisjointSuccessorRoleData& disjointSuccRoleData) { mUseNegDisSet = disjointSuccRoleData.mUseNegDisSet; mLocNegDisSet = nullptr; } CPROCESSHASH *mLocNegDisSet; CPROCESSHASH *mUseNegDisSet; }; CPROCESSHASH mSuccNegDisEdgeHash; CProcessContext* mContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDISJOINTSUCCESSORROLEHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctExtractionLinker.h0000644000175000017500000000517512520551152032223 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONDISJUNCTEXTRACTIONLINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONDISJUNCTEXTRACTIONLINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptSaturationDescriptor.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationDisjunctExtractionLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationDisjunctExtractionLinker : public CLinkerBase { // public methods public: //! Constructor CSaturationDisjunctExtractionLinker(); CSaturationDisjunctExtractionLinker* initSaturationDisjunctExtractionLinker(CIndividualSaturationProcessNode* disjNode, CConceptSaturationDescriptor* lastExaminedConSatDes); CConceptSaturationDescriptor* getLastExaminedConceptSaturationDescriptor(); CIndividualSaturationProcessNode* getDisjunctIndividualSaturationProcessNode(); CSaturationDisjunctExtractionLinker* setLastExaminedConceptSaturationDescriptor(CConceptSaturationDescriptor* conSatDes); // protected methods protected: // protected variables protected: CConceptSaturationDescriptor* mLastExaminedConSatDes; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONDISJUNCTEXTRACTIONLINKER_H ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeStatusUpdateLinker.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeStatus0000644000175000017500000000301612520551130032431 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualSaturationProcessNodeStatusUpdateLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualSaturationProcessNodeStatusUpdateLinker::CIndividualSaturationProcessNodeStatusUpdateLinker() : CLinkerBase(nullptr,false) { } CIndividualSaturationProcessNodeStatusUpdateLinker* CIndividualSaturationProcessNodeStatusUpdateLinker::initUpdateNodeLinker(CIndividualSaturationProcessNode *individual) { initLinker(individual); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessContextBase.h0000644000175000017500000000474012520551134026733 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSCONTEXTBASE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSCONTEXTBASE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CProcessContextBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessContextBase : public CProcessContext { // public methods public: //! Constructor CProcessContextBase(CMemoryPoolContainer* memoryPoolContainer, CTaskHandleContext* handleContext); //! Destructor virtual ~CProcessContextBase(); CProcessContextBase* referenceProcessContext(CProcessContextBase* reference); virtual CProcessTagger* getProcessTagger(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); virtual CProcessingStatisticGathering* getProcessingStatisticsGathering(); virtual CTaskContext* updateContext(CTaskHandleContext* handleContext); // protected methods protected: // protected variables protected: CProcessMemoryPoolAllocationManager* mMemMan; CProcessTagger* mProcessTagger; CProcessingStatisticGathering* mProcStatGath; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSCONTEXTBASE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedIndividualDistinctDescriptor.h0000644000175000017500000000442112520551076032273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDINDIVIDUALDISTINCTDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDINDIVIDUALDISTINCTDESCRIPTOR_H // Libraries includes #include // Namespace includes #include "ProcessSettings.h" #include "CDistinctEdge.h" #include "CClashedDependencyDescriptor.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CClashedIndividualDistinctDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClashedIndividualDistinctDescriptor : public CClashedDependencyDescriptor { // public methods public: //! Constructor CClashedIndividualDistinctDescriptor(); CClashedIndividualDistinctDescriptor* initClashedDistinctDescriptor(CDistinctEdge* linkEdge, CDependencyTrackPoint* depTrackPointD); CDistinctEdge* getDistinctEdge(); // protected methods protected: // protected variables protected: CDistinctEdge* mLinkEdge; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDINDIVIDUALDISTINCTDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessTag.h0000644000175000017500000000411712520551136025227 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSTAG_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSTAG_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CProcessTag * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessTag { // public methods public: //! Constructor CProcessTag(cint64 processTag = 0); cint64 getProcessTag(); CProcessTag* setProcessTag(cint64 processTag); CProcessTag* initProcessTag(cint64 processTag); bool updateProcessTag(cint64 processTag); bool isProcessTagUpdated(cint64 processTag); bool isProcessTagUpToDate(cint64 processTag); // protected methods protected: // protected variables protected: cint64 mProcessTag; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSTAG_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CLocalizationTag.h0000644000175000017500000000526512520551132026242 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CLOCALIZATIONTAG_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CLOCALIZATIONTAG_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessTag.h" #include "CProcessTagger.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CLocalizationTag * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLocalizationTag : public CProcessTag { // public methods public: //! Constructor CLocalizationTag(cint64 processTag = 0); cint64 getLocalizationTag(); CLocalizationTag* setLocalizationTag(cint64 localizationTag); CLocalizationTag* setLocalizationTag(CProcessTagger* processTagger); CLocalizationTag* initLocalizationTag(cint64 localizationTag); CLocalizationTag* initLocalizationTag(CProcessTagger* processTagger); bool updateLocalizationTag(cint64 localizationTag); bool updateLocalizationTag(CProcessTagger* processTagger); bool isLocalizationTagUpdated(cint64 localizationTag); bool isLocalizationTagUpToDate(cint64 localizationTag); bool isLocalizationTagUpdated(CProcessTagger* processTagger); bool isLocalizationTagUpToDate(CProcessTagger* processTagger); bool isRelocalized(); CLocalizationTag* setRelocalized(bool relocalized = true); // protected methods protected: // protected variables protected: bool mRelocalized; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CLOCALIZATIONTAG_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingStatistics.h0000644000175000017500000003312512520551134027343 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGSTATISTICS_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGSTATISTICS_H // Libraries includes #include #include #include #include #include // Namespace includes #include "ProcessSettings.h" #include "CProcessingStatisticDescription.h" #include "CProcessingStatisticRegistrator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CProcessingStatistics * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessingStatistics : public CProcessingStatisticRegistrator { // public methods public: const static cint64 statisticVectorSize = 220; static cint64 statisticCount; const static CProcessingStatisticDescription statINDIVIDUALNODESWITCHCOUNT, statTASKPROCESSCHANGECOUNT, statTASKPROCESSPAUSECOUNT, statTASKCREATIONCOUNT, statROOTTASKSATISFIABLECOUNT, statROOTTASKUNSATISFIABLECOUNT, // statistics for completion graph reuse caching statCOMPLETIONGRAPHREUSECACHERETRIEVALCOUNT, statCOMPLETIONGRAPHREUSECACHERETRIEVALSUCCESSCOUNT, statCOMPLETIONGRAPHREUSECACHERETRIEVALFAILEDCOUNT, statCOMPLETIONGRAPHREUSECACHEREUSINGDETCOUNT, statCOMPLETIONGRAPHREUSECACHEREUSINGNONDETCOUNT, // statistics for unsatisfiable cache retrieval statUNSATCACHERETRIEVALCOUNT, statUNSATCACHERETRIEVALHASHCOUNT, statUNSATCACHERETRIEVALHASHSUCCESSCOUNT, statUNSATCACHERETRIEVALHASHFAILEDCOUNT, statUNSATCACHERETRIEVALPRECHECKCOUNT, statUNSATCACHERETRIEVALPRECHECKSUCCESSCOUNT, statUNSATCACHERETRIEVALPRECHECKDIRECTFAILEDCOUNT, statUNSATCACHERETRIEVALPRECHECKINSUFFICIENTCOUNT, statUNSATCACHEUSEDCOUNT, // statistics for unsatisfiable caching statUNSATCACHEWRITINGREQUSTCOUNT, statUNSATCACHEWRITINGREQUSTDIFFNODELEVELFAILEDCOUNT, statUNSATCACHEWRITINGREQUSTDIFFNOMINALFAILEDCOUNT, statUNSATCACHEWRITINGREQUSTATOMICCLASHFAILEDCOUNT, statUNSATCACHEWRITINGTRYINGCOUNT, statUNSATCACHEWRITINGALREADYCACHEDTESTCOUNT, statUNSATCACHEWRITINGALREADYCACHEDTESTPRECHECKFAILEDCOUNT, statUNSATCACHEWRITINGALREADYCACHEDTESTHASHFAILEDCOUNT, statUNSATCACHEWRITINGALREADYCACHEDCOUNT, statUNSATCACHEWRITINGCOUNT, // statistics for satisfiable/expansion caching retrieval statSATEXPCACHERETRIEVALCOUNT, statSATEXPCACHERETRIEVALSUCCESSCOUNT, statSATEXPCACHERETRIEVALFOUNDEXPANSIONCOUNT, statSATEXPCACHERETRIEVALFOUNDSATISFIABLECOUNT, statSATEXPCACHERETRIEVALCOMPATIBILITYTESTCOUNT, statSATEXPCACHERETRIEVALCOMPATIBLESATCOUNT, statSATEXPCACHERETRIEVALINCOMPATIBLESATCOUNT, statSATEXPCACHERETRIEVALEXPANDEDCONCEPTSCOUNT, // statistics for satisfiable caching statSATEXPCACHEWRITINGREQUESTCOUNT, statSATEXPCACHESATISFIABLEWRITINGREQUESTCOUNT, statSATEXPCACHEEXPANSIONWRITINGREQUESTCOUNT, statSATEXPCACHEWRITINGSIGNATUREALREADYCACHEDCOUNT, statSATEXPCACHEWRITINGSIGNATUREALREADYCACHEDINCOMPATIBLECOUNT, statSATEXPCACHEWRITINGSIGNATUREALREADYCACHEDSATADDEDCOUNT, statSATEXPCACHEWRITINGSIGNATURESATISFIABLECOUNT, statSATEXPCACHEWRITINGSIGNATUREEXPANSIONCOUNT, statSATEXPCACHEWRITINGSIGSATCRITICALBRANCHCONCEPTADDEDCOUNT, statSATEXPCACHEWRITINGEXPANSIONDELAYEDCOUNT, statSATEXPCACHEWRITINGERRORCOUNT, // statistics for satisfiable cached concept absorption statSATCACHEDABSORBEDDISJUNCTIONCONCEPTSCOUNT, statSATCACHEDABSORBEDMERGINGCONCEPTSCOUNT, statSATCACHEDABSORBEDGENERATINGCONCEPTSCOUNT, // statistics for signature mirroring blocking statSIGNATURESAVINGCOUNT, statSIGNATUREMIRRORINGBLOCKINGREFRESHCOUNT, statSIGNATUREMIRRORINGBLOCKINGREFRESHLOSEDCOUNT, statSIGNATUREMIRRORINGBLOCKINGSEARCHCOUNT, statSIGNATUREMIRRORINGBLOCKINGESTABLISHCOUNT, statSIGNATUREMIRRORINGBLOCKINGADDFOLLOWINGCOUNT, statSIGNATUREMIRRORINGBLOCKINGREMOVEFOLLOWINGCOUNT, statSIGNATUREMIRRORINGBLOCKINGCONCEPTEXPANSIONCOUNT, statSIGNATUREMIRRORINGBLOCKINGCANDIDATEREGARDEDCOUNT, statSIGNATUREMIRRORINGBLOCKINGCANDIDATEREGARDEDINVALIDCOUNT, statSIGNATUREMIRRORINGBLOCKINGCANDIDATEREGARDEDINCOMPATIBLECOUNT, // statistics for back jumping statTASKBACKJUMPINGCOUNT, statTASKAWAYBACKJUMPINGCOUNT, statTASKROOTBACKJUMPINGCOUNT, // statistics for backtracking statCLASHEDBACKTRACKINGSTARTCOUNT, statCLASHEDBACKTRACKINGSTEPSCOUNT, statCLASHEDBACKTRACKINGPREVNODELEVELCOUNT, statCLASHEDBACKTRACKINGPREVNODELEVELBRANCHCOUNT, statCLASHEDBACKTRACKINGCURRNODELEVELBRANCHCOUNT, statCLASHEDBACKTRACKINGINDEPENDENTCOUNT, statCLASHEDBACKTRACKGNONDETERMINISTICCOUNT, statCLASHEDBACKTRACKGNONDETALREADYCLASHFAILEDCOUNT, statCLASHEDBACKTRACKGNONDETCLOSEDCOUNT, statCLASHEDBACKTRACKEDDESCRIPTORSCOUNT, // statistics for counting rule applications statRULEAPPLICATIONCOUNT, statAUTOMATERULEAPPLICATIONCOUNT, statANDRULEAPPLICATIONCOUNT, statSOMERULEAPPLICATIONCOUNT, statFUNCTIONALRULEAPPLICATIONCOUNT, statATMOSTRULEAPPLICATIONCOUNT, statATLEASTRULEAPPLICATIONCOUNT, statORRULEAPPLICATIONCOUNT, statSELFRULEAPPLICATIONCOUNT, statALLRULEAPPLICATIONCOUNT, statNOMINALRULEAPPLICATIONCOUNT, statVALUERULEAPPLICATIONCOUNT, statIMPLICATIONRULEAPPLICATIONCOUNT, // statistics for merging and qualifying statINDINODEMERGEINITCOUNT, statINDINODEQUALIFYCHOOCECOUNT, statINDINODEMERGECOUNT, statINDINODEMERGENEWNOMINALINITCOUNT, statINDINODESMERGEABLETESTCOUNT, statINDINODESMERGEABLEDISJOINTROLETESTCOUNT, statINDINODESMERGEABLECONCEPTSETTESTCOUNT, statINDINODESMERGEABLEDISTINCTTESTCOUNT, statINDINODESMERGEABLETESTSUCCESSCOUNT, statINDINODEMERGECONCEPTSADDCOUNT, statINDINODEMERGELINKSADDCOUNT, statINDINODEMERGEDISTINCTADDCOUNT, // statistics for implication statIMPLICATIONTRIGGERINGCOUNT, statIMPLICATIONEXECUTINGCOUNT, // statistics for nominals statINDINODENOMINALMERGECOUNT, statINDINODENOMINALDISTINCTCOUNT, statINDINODENOMINALCORRECTIDCOUNT, // statistics for ALL and Automate rules statALLROLERESTRICTIONCOUNT, statAUTOMATETRANSACTIONCOUNT, statAUTOMATESTATECOUNT, statAUTOMATEINITCOUNT, // statistics for successor individual node creation statSUCCESSORINDINODECREATIONCOUNT, statDISTINCTSUCCESSORINDINODECREATIONCOUNT, statSEPARATESUCCESSORINDINODECREATIONCOUNT, statNOMINALSUCCESSORINDINODECREATIONCOUNT, // statistics for task creation statTASKDISTINCTMERGEBRANCHCREATIONCOUNT, statTASKINDINODEMERGEBRANCHCREATIONCOUNT, statTASKQUALIFYCHOOSEBRANCHCREATIONCOUNT, statTASKORBRANCHCREATIONCOUNT, // statistics for OR processing statOREXECUTIONINITCOUNT, statOREXECUTIONCONTINUECOUNT, statORINSTANTCONTAINSEXECUTEDCOUNT, statORTRIGGEREDDELAYEDEXECUTEDCOUNT, statORTRIGGERSEARCHCOUNT, statORQUEUEDDELAYEDEXECUTEDCOUNT, statOREXECUTIONCOUNT, statORSINGLEBRANCHCOUNT, statORMULTIPLEBRANCHCOUNT, statORREPLACEMENTIMPLICATIONCOUNT, // statistics for triggers statCONCEPTTRIGGERINSTALLCOUNT, statROLETRIGGERINSTALLCOUNT, // statistics for concept set tests statLABELCONCEPTSUBSETTESTCOUNT, statLABELCONCEPTEQUALSETTESTCOUNT, statLABELCONCEPTPAIRWISEEQUALSETTESTCOUNT, // statistics for blocking statOPTIMIZEDBLOCKINGB2AUTOMATETRANSACTIONTESTCOUNT, statOPTIMIZEDBLOCKINGTESTCOUNT, statSUBSETBLOCKINGTESTCOUNT, statEQUALSETBLOCKINGTESTCOUNT, statPAIRWISEEQUALSETBLOCKINGTESTCOUNT, statINDINODEBLOCKINGTESTCOUNT, statDETECTINDINODEBLOCKINGSTATUSCOUNT, statDETECTANCINDINODEBLOCKINGSTATUSCOUNT, statSUCCESSBLOCKINGSTATUSDETECTIONCOUNT, statFAILEDBLOCKINGSTATUSDETECTIONCOUNT, statCONTINUEBLOCKINGTESTCOUNT, statANCESTORBLOCKINGSEARCHINDINODECOUNT, statANYWHEREBLOCKINGSEARCHINDINODECOUNT, statANYWHEREBLOCKINGCANDIDATEHASHSEARCHINDINODECOUNT, statANYWHEREBLOCKINGCANDIDATEHASHUDATECOUNT, statANYWHEREBLOCKINGCANDIDATEHASHUDATEADDCOUNT, statANYWHEREBLOCKINGCANDIDATEHASHUDATEREMOVECOUNT, statANYWHERECORECONCEPTBLOCKINGCANDIDATEHASHSEARCHINDINODECOUNT, // statistics for blocking test calls statINDINODEEXPANSIONBLOCKINGTESTCOUNT, statINDINODEPROCESSINGBLOCKINGTESTCOUNT, // statistics for creation statLINKSCREATIONCOUNT, statDISTINCTCREATIONCOUNT, statCONCEPTSADDEDINDINODELABELSETCOUNT, statCONCEPTSADDEDINDINODEPROCESSINGQUEUECOUNT, statINDINODESADDEDPROCESSINGQUEUECOUNT, statINSERTCONCEPTREAPPLICATIONSCOUNT, statREAPPLIEDCONCEPTSCOUNT, statCORECONCEPTSADDEDINDINODELABELSETCOUNT, // statistics for creation statINDINODEUPDATELOADCOUNT, statINDINODELOCALIZEDLOADCOUNT, // statistics for binding candidate propagation statPBINDVARIABLEBINDCOUNT, statPBINDPROPAGATEDCOUNT, statPBINDPROPAGATEDFRESHCOUNT, statPBINDPROPAGATEDINITIALCOUNT, statPBINDGROUNDINGCOUNT, statPBINDCYCLEPROPAGATECOUNT, statPBINDCYCLEREAPPLYINSTALLCOUNT, statPBINDRULEANDAPPLICATIONCOUNT, statPBINDRULEALLAPPLICATIONCOUNT, statPBINDRULEGROUNDINGAPPLICATIONCOUNT, statPBINDRULECYCLEAPPLICATIONCOUNT, statPBINDRULEIMPLICATIONAPPLICATIONCOUNT, statPBINDRULEBINDNAPPLICATIONCOUNT, statPBINDREAPPLICATIONCOUNT, // statistics for variable binding propagation statVARBINDVARIABLEBINDCOUNT, statVARBINDPROPAGATEDCOUNT, statVARBINDPROPAGATEDFRESHCOUNT, statVARBINDPROPAGATEDINITIALCOUNT, statVARBINDRULEANDAPPLICATIONCOUNT, statVARBINDRULEALLAPPLICATIONCOUNT, statVARBINDRULEBINDAPPLICATIONCOUNT, statVARBINDRULEGROUNDINGAPPLICATIONCOUNT, statVARBINDRULEIMPLICATIONAPPLICATIONCOUNT, statVARBINDRULEJOINAPPLICATIONCOUNT, statVARBINDJOINTRIGGERINSTALLCOUNT, statVARBINDJOINTRIGGEREXECUTECOUNT, statVARBINDJOINCOMBINECOUNT, statVARBINDJOINCREATENEWCOUNT, statVARBINDGROUNDINGCOUNT, // statistics for timings statTIMEBACKTRACING, statTIMEUNSATCACHERETRIVAL, statTIMECOMPLETIONGRAPHREUSERETRIVAL, // statistics for analysing statANALYSESUBSUMERCOUNT, statANALYSEPOSSIBLESUBSUMPTIONSCOUNT, statANALYSEPSEUDOMODELCOUNT, statANALYSECANDIDATECONCEPTSATURATEDALTERNATIVETESTCOUNT, statANALYSECANDIDATECONCEPTSATURATEDALTERNATIVEMERGINGCOUNT, statANALYSECANDIDATECONCEPTSATURATEDCONCEPTSETMERGINGCOUNT, statANALYSECANDIDATECONCEPTSATURATEDROLESUCCESSORMERGINGCOUNT, statANALYSECANDIDATECONCEPTSATURATEDALTERNATIVEFOUNDCOUNT, statANALYSECANDIDATECONCEPTSATURATEDROLESUCCESSOREXTENDEDMERGINGCOUNT, // statistics for saturation caching statSATURATIONCACHECONCEPTEXPANSIONCOUNT, statSATURATIONCACHEESTABLISHCOUNT, statSATURATIONCACHELOSECOUNT, // statistics for saturation statSATURATIONCRITICALTESTCOUNT, statSATURATIONCRITICALALLCOUNT, statSATURATIONCRITICALORCOUNT, statSATURATIONCRITICALATMOSTCOUNT, statSATURATIONCRITICALADDCOUNT ; static CProcessingStatistics* getProcessingStatistics(); static cint64 getIndexFromProcessingStatisticDescriptionName(const QString& statDesName); QList* getProcessingStatisticDescriptionList(); virtual CProcessingStatisticRegistrator* registerProcessingStatisticDescription(CProcessingStatisticDescription* statDesc); // protected methods protected: //! Constructor CProcessingStatistics(); //! Destructor virtual ~CProcessingStatistics(); // protected variables protected: static CProcessingStatistics* mInstance; static QMutex mInstanceMutex; QVector mStatDescVec; QList mStatDescList; QHash mStatDescHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGSTATISTICS_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeCacheData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeCacheD0000644000175000017500000000362412520551126032267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODECACHEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODECACHEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualSaturationProcessNodeCacheData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualSaturationProcessNodeCacheData { // public methods public: //! Constructor CIndividualSaturationProcessNodeCacheData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODECACHEDATA_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBackwardSaturationPropagationReapplyDescriptor.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBackwardSaturationPropagationReapplyD0000644000175000017500000000500612520551072032361 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBACKWARDSATURATIONPROPAGATIONREAPPLYDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBACKWARDSATURATIONPROPAGATIONREAPPLYDESCRIPTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptSaturationDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Utilities/Container/CLinker.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CBackwardSaturationPropagationReapplyDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackwardSaturationPropagationReapplyDescriptor : public CLinkerBase { // public methods public: //! Constructor CBackwardSaturationPropagationReapplyDescriptor(); CBackwardSaturationPropagationReapplyDescriptor* initBackwardPropagationReapplyDescriptor(CConceptSaturationDescriptor* conDes); CBackwardSaturationPropagationReapplyDescriptor* initBackwardPropagationReapplyDescriptor(CBackwardSaturationPropagationReapplyDescriptor* reapplyDes); CConceptSaturationDescriptor* getReapplyConceptSaturationDescriptor(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBACKWARDSATURATIONPROPAGATIONREAPPLYDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleSaturationProcessLinker.cpp0000644000175000017500000000262512520551152031167 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleSaturationProcessLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRoleSaturationProcessLinker::CRoleSaturationProcessLinker() : CLinkerBase(nullptr) { } CRoleSaturationProcessLinker *CRoleSaturationProcessLinker::initRoleProcessLinker(CRole* role) { initLinker(role); return this; } CRole* CRoleSaturationProcessLinker::getRole() { return getData(); } }; // end namespace Kernel }; // end namespace Process }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingSet.cpp0000644000175000017500000002020412520551140027730 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPropagationBindingSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CPropagationBindingSet::CPropagationBindingSet(CProcessContext* processContext) : mProcessContext(processContext),mPropMap(processContext) { } CPropagationBindingSet* CPropagationBindingSet::initPropagationBindingSet(CPropagationBindingSet* prevSet) { if (prevSet) { mPropMap.initPropagationBindingMap(&prevSet->mPropMap); mConceptDescriptor = prevSet->mConceptDescriptor; mSpecialNewPropBindDes = prevSet->mSpecialNewPropBindDes; mPropBindDesLinker = prevSet->mPropBindDesLinker; mReapplyHash = nullptr; if (prevSet->mReapplyHash) { getPropagationBindingReapplyConceptHash(true)->initPropagationBindingReapplyConceptHash(prevSet->mReapplyHash); } mPropVarBindTransExtension = nullptr; mPropRepTransExtension = nullptr; if (prevSet->mPropVarBindTransExtension) { getPropagationVariableBindingTransitionExtension(true)->initPropagationVariableBindingTransitionExtension(prevSet->mPropVarBindTransExtension); } if (prevSet->mPropRepTransExtension) { getPropagationRepresentativeTransitionExtension(true)->initPropagationRepresentativeTransitionExtension(prevSet->mPropRepTransExtension); } mPropagateAllFlag = prevSet->mPropagateAllFlag; } else { mPropMap.initPropagationBindingMap(nullptr); mConceptDescriptor = nullptr; mSpecialNewPropBindDes = nullptr; mPropBindDesLinker = nullptr; mReapplyHash = nullptr; mPropVarBindTransExtension = nullptr; mPropRepTransExtension = nullptr; mPropagateAllFlag = false; } return this; } bool CPropagationBindingSet::containsPropagationBinding(CPropagationBinding* propagationBinding) { return mPropMap.contains(propagationBinding->getPropagationID()) && mPropMap.value(propagationBinding->getPropagationID()).hasPropagationBindingDescriptor(); } bool CPropagationBindingSet::containsPropagationBinding(cint64 bindingID) { return mPropMap.contains(bindingID) && mPropMap.value(bindingID).hasPropagationBindingDescriptor(); } CPropagationBindingDescriptor* CPropagationBindingSet::getPropagationBindingDescriptor(CPropagationBinding* propagationBinding) { return mPropMap.value(propagationBinding->getPropagationID()).getPropagationBindingDescriptor(); } CPropagationBindingMap* CPropagationBindingSet::getPropagationBindingMap() { return &mPropMap; } CPropagationBindingDescriptor* CPropagationBindingSet::getNewSepcialPropagationBindingDescriptor() { return mSpecialNewPropBindDes; } CPropagationBindingSet* CPropagationBindingSet::addPropagationBinding(CPropagationBindingDescriptor* propBindDes, bool newSpecial) { CPropagationBindingMapData& data = mPropMap[propBindDes->getPropagationBinding()->getPropagationID()]; data.setPropagationBindingDescriptor(propBindDes); mPropBindDesLinker = propBindDes->append(mPropBindDesLinker); if (newSpecial) { mSpecialNewPropBindDes = propBindDes; } return this; } CPropagationBindingReapplyConceptDescriptor* CPropagationBindingSet::addPropagationBindingReturnReapplyLinker(CPropagationBindingDescriptor* propBindDes, bool newSpecial) { CPropagationBindingMapData& data = mPropMap[propBindDes->getPropagationBinding()->getPropagationID()]; data.setPropagationBindingDescriptor(propBindDes); mPropBindDesLinker = propBindDes->append(mPropBindDesLinker); if (newSpecial) { mSpecialNewPropBindDes = propBindDes; } return data.getReapplyConceptDescriptor(); } CPropagationBindingSet* CPropagationBindingSet::copyPropagationBindings(CPropagationBindingMap* propBindMap) { if (propBindMap) { mPropMap = *propBindMap; } return this; } CConceptDescriptor* CPropagationBindingSet::getConceptDescriptor() { return mConceptDescriptor; } CPropagationBindingSet* CPropagationBindingSet::setConceptDescriptor(CConceptDescriptor* conDes) { mConceptDescriptor = conDes; return this; } CPropagationBindingSet* CPropagationBindingSet::addPropagationBindingDescriptorLinker(CPropagationBindingDescriptor* propBindDesLinker) { mPropBindDesLinker = propBindDesLinker->append(mPropBindDesLinker); return this; } CPropagationBindingDescriptor* CPropagationBindingSet::getPropagationBindingDescriptorLinker() { return mPropBindDesLinker; } CPropagationBindingReapplyConceptHash* CPropagationBindingSet::getPropagationBindingReapplyConceptHash(bool create) { if (create && !mReapplyHash) { mReapplyHash = CObjectParameterizingAllocator< CPropagationBindingReapplyConceptHash,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); } return mReapplyHash; } CPropagationBindingSet* CPropagationBindingSet::addPropagationBindingReapplyConceptDescriptor(CPropagationBindingReapplyConceptDescriptor* propBindReapplyConDesLinker) { getPropagationBindingReapplyConceptHash(true)->addPropagationBindingReapplyConceptDescriptor(propBindReapplyConDesLinker->getReapllyIndividualNode(),propBindReapplyConDesLinker->getConceptDescriptor()->getConcept(),propBindReapplyConDesLinker); CPropagationBindingMapData& data = mPropMap[propBindReapplyConDesLinker->getPropagationBinding()->getPropagationID()]; data.setReapplyConceptDescriptor(propBindReapplyConDesLinker->append(data.getReapplyConceptDescriptor())); return this; } CPropagationVariableBindingTransitionExtension* CPropagationBindingSet::getPropagationVariableBindingTransitionExtension(bool create) { if (!mPropVarBindTransExtension && create) { mPropVarBindTransExtension = CObjectParameterizingAllocator< CPropagationVariableBindingTransitionExtension,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mPropVarBindTransExtension->initPropagationVariableBindingTransitionExtension(nullptr); } return mPropVarBindTransExtension; } CPropagationRepresentativeTransitionExtension* CPropagationBindingSet::getPropagationRepresentativeTransitionExtension(bool create) { if (!mPropRepTransExtension && create) { mPropRepTransExtension = CObjectParameterizingAllocator< CPropagationRepresentativeTransitionExtension,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mPropRepTransExtension->initPropagationRepresentativeTransitionExtension(nullptr); } return mPropRepTransExtension; } bool CPropagationBindingSet::hasPropagateAllFlag() { return mPropagateAllFlag; } bool CPropagationBindingSet::getPropagateAllFlag() { return mPropagateAllFlag; } CPropagationBindingSet* CPropagationBindingSet::setPropagateAllFlag(bool propAllFlag) { mPropagateAllFlag = propAllFlag; return this; } bool CPropagationBindingSet::adoptPropagateAllFlag(CPropagationBindingSet* propBindSet) { if (propBindSet->mPropagateAllFlag && !mPropagateAllFlag) { mPropagateAllFlag = true; return true; } return false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeBinaryDataValueSpaceMap.h0000644000175000017500000000521012520551106031266 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBINARYDATAVALUESPACEMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBINARYDATAVALUESPACEMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeCompareValueSpaceMap.h" // Other includes #include "Reasoner/Ontology/CDataLiteralBinaryDataValue.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeBinaryDataValueSpaceMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeBinaryDataValueSpaceMap : public CDatatypeCompareValueSpaceMap { // public methods public: //! Constructor CDatatypeBinaryDataValueSpaceMap(CProcessContext* processContext); // protected methods protected: virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* value); virtual bool getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom); virtual bool getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast); virtual cuint64 getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBINARYDATAVALUESPACEMAP_H ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeUnsatisfiableOccurenceC0000644000175000017500000000544612520551126032276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEUNSATISFIABLEOCCURENCECACHERETRIEVALDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEUNSATISFIABLEOCCURENCECACHERETRIEVALDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualNodeUnsatisfiableCacheRetrievalData.h" #include "CConceptDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData : public CIndividualNodeUnsatisfiableCacheRetrievalData { // public methods public: //! Constructor CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData(); //! Destructor virtual ~CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData(); CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData* initUnsatisfiableOccurenceCacheRetrievalData(CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData* prevData); cint64 getLastRetrievalCachingTag(); CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData* setLastRetrievalCachingTag(cint64 tag); CConceptDescriptor* getLastRetrievalConceptDescriptor(); CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData* setLastRetrievalConceptDescriptor(CConceptDescriptor* conDes); // protected methods protected: // protected variables protected: cint64 mLastRetCachingTag; CConceptDescriptor* mLastRetConceptDes; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEUNSATISFIABLEOCCURENCECACHERETRIEVALDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeBinaryHexDataValueSpaceData.h0000644000175000017500000000532412520551106032075 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBINARYHEXDATAVALUESPACEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBINARYHEXDATAVALUESPACEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeBinaryDataValueSpaceMap.h" #include "CDatatypeCompareValueSpaceData.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceBinaryHexDataType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeBinaryHexDataValueSpaceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeBinaryHexDataValueSpaceData : public CDatatypeCompareValueSpaceData { // public methods public: //! Constructor CDatatypeBinaryHexDataValueSpaceData(CProcessContext* processContext); CDatatypeBinaryHexDataValueSpaceData* copyBinaryHexDataValueSpaceData(CDatatypeBinaryHexDataValueSpaceData* spaceData); CDatatypeBinaryHexDataValueSpaceData* initBinaryHexDataValueSpaceData(CDatatypeValueSpaceBinaryHexDataType* valueSpaceType); CDatatypeBinaryDataValueSpaceMap* getBinaryHexDataValueSpaceMap(bool create); // protected methods protected: virtual CDatatypeCompareValueSpaceMap* createValueSpaceMap(); // protected variables protected: CDatatypeBinaryDataValueSpaceMap* mBinaryHexDataValueSpaceMap; CDatatypeValueSpaceBinaryHexDataType* mValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBINARYHEXDATAVALUESPACEDATA_H ././@LongLink0000644000000000000000000000017600000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorRoleFUNCTION0000644000175000017500000000527212520551156032076 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONLINKEDSUCCESSORROLEFUNCTIONALCONCEPTSEXTENSIONHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONLINKEDSUCCESSORROLEFUNCTIONALCONCEPTSEXTENSIONHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CSaturationSuccessorFUNCTIONALConceptExtensionData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash { // public methods public: //! Constructor CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash(CProcessContext* processContext); CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash* initLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash(); CPROCESSHASH* getLinkedSuccessorIndividualFUNCTIONALConceptsExtensionHash(); CSaturationSuccessorFUNCTIONALConceptExtensionData* getSuccessorFunctionalConceptsExtensionData(CRole* role, bool create = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CPROCESSHASH mLinkedSuccRoleFUNCTIONALConceptExtHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONLINKEDSUCCESSORROLEFUNCTIONALCONCEPTSEXTENSIONHASH_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeBackendCacheSynchronisationData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeBackendCacheSynchronisa0000644000175000017500000000243112520551122032232 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeBackendCacheSynchronisationData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeBackendCacheSynchronisationData::CIndividualNodeBackendCacheSynchronisationData() { } CIndividualNodeBackendCacheSynchronisationData::~CIndividualNodeBackendCacheSynchronisationData() { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeHashDat0000644000175000017500000000227612520551156032276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNominalDependentNodeHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationNominalDependentNodeHashData::CSaturationNominalDependentNodeHashData() { mNominalDependentNodeData = nullptr; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConnectionSuccessorSet.h0000644000175000017500000000507512520551104027621 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONNECTIONSUCCESSORSET_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONNECTIONSUCCESSORSET_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CConnectionSuccessorSetIterator.h" // Other includes #include "Utilities/Memory/CObjectParameterizingAllocator.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConnectionSuccessorSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConnectionSuccessorSet { // public methods public: //! Constructor CConnectionSuccessorSet(CProcessContext* context = nullptr); //! Destructor virtual ~CConnectionSuccessorSet(); CConnectionSuccessorSet* initConnectionSuccessorSet(CConnectionSuccessorSet* connSuccSet); CConnectionSuccessorSet* insertConnectionSuccessor(cint64 indiID); bool hasConnectionSuccessor(cint64 indiID); CConnectionSuccessorSet* removeConnection(cint64 indiID); CConnectionSuccessorSetIterator getConnectionSuccessorIterator(); cint64 getConnectionSuccessorCount(); // protected methods protected: // protected variables protected: CProcessContext* mContext; CPROCESSSET* mConnSet; cint64 mAncConnID; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONNECTIONSUCCESSORSET_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeUnknownValueSpaceData.h0000644000175000017500000000465412520551116031057 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEUNKNOWNVALUESPACEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEUNKNOWNVALUESPACEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeValueSpaceData.h" #include "CDatatypeUnknownValueSpaceData.h" #include "CDatatypeRealValueSpaceMap.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceUnknownType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeUnknownValueSpaceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeUnknownValueSpaceData : public CDatatypeValueSpaceData { // public methods public: //! Constructor CDatatypeUnknownValueSpaceData(CProcessContext* processContext); CDatatypeUnknownValueSpaceData* copyUnknownValueSpaceData(CDatatypeUnknownValueSpaceData* spaceData); CDatatypeUnknownValueSpaceData* initUnknownValueSpaceData(CDatatypeValueSpaceUnknownType* valueSpaceType); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEUNKNOWNVALUESPACEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedDependencyDescriptor.h0000644000175000017500000000454312520551076030564 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDDEPENDENCYDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDDEPENDENCYDESCRIPTOR_H // Libraries includes #include // Namespace includes #include "ProcessSettings.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CClashedDependencyDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClashedDependencyDescriptor : public CLinkerBase { // public methods public: //! Constructor CClashedDependencyDescriptor(); virtual ~CClashedDependencyDescriptor(); CClashedDependencyDescriptor* initClashedDependencyDescriptor(CDependencyTrackPoint* depTrackPoint); CDependencyTrackPoint* getDependencyTrackPoint(); // protected methods protected: // protected variables protected: CDependencyTrackPoint* mDependencyTrackPoint; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDDEPENDENCYDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathMergingHash.h0000644000175000017500000000461412520551164031132 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHMERGINGHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHMERGINGHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CVariableBindingPath.h" #include "CVariableBindingPathMergingHashData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { typedef QPair TPathIDPair; /*! * * \class CVariableBindingPathMergingHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingPathMergingHash : public CPROCESSHASH { // public methods public: //! Constructor CVariableBindingPathMergingHash(CProcessContext* processContext); CVariableBindingPathMergingHash* initVariableBindingPathMergingHash(CVariableBindingPathMergingHash* prevHash); CVariableBindingPathMergingHashData* getMergedVariableBindingPathData(CVariableBindingPath* varBindPath1, CVariableBindingPath* varBindPath2); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHMERGINGHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyConceptSaturationLabelSet.h0000644000175000017500000001272412520551140031571 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTSATURATIONLABELSET_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTSATURATIONLABELSET_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CConceptSaturationDescriptorReapplyData.h" #include "CImplicationReapplyConceptSaturationDescriptor.h" #include "CReapplyConceptSaturationLabelSetIterator.h" #include "CSaturationModifiedProcessUpdateLinker.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CReapplyConceptSaturationLabelSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReapplyConceptSaturationLabelSet { // public methods public: //! Constructor CReapplyConceptSaturationLabelSet(CProcessContext* processContext = nullptr); CReapplyConceptSaturationLabelSet* initReapplyConceptSaturationLabelSet(); CReapplyConceptSaturationLabelSet* copyReapplyConceptSaturationLabelSet(CReapplyConceptSaturationLabelSet* copyConceptSaturationLabelSet, bool tryFlatLabelCopy); cint64 getConceptCount(); cint64 getTotalCount(); bool getConceptSaturationDescriptor(cint64 conTag, CConceptSaturationDescriptor*& conSatDes, CImplicationReapplyConceptSaturationDescriptor*& impReapplyConSatDes); bool getConceptSaturationDescriptor(CConcept* concept, CConceptSaturationDescriptor*& conSatDes, CImplicationReapplyConceptSaturationDescriptor*& impReapplyConSatDes); bool getConceptDescriptorAndReapplyQueue(CConcept* concept, CConceptSaturationDescriptor*& conSatDes, CImplicationReapplyConceptSaturationDescriptor*& impReapplyConSatDes); bool getConceptDescriptorAndReapplyQueue(cint64 conTag, CConceptSaturationDescriptor*& conSatDes, CImplicationReapplyConceptSaturationDescriptor*& impReapplyConSatDes); bool hasConceptSaturationDescriptor(CConceptSaturationDescriptor* conSatDes); bool hasConcept(CConcept* concept, bool negated); bool hasConcept(cint64 conTag, bool negated); bool hasConcept(CConcept* concept, bool* containsNegated = nullptr); bool hasConcept(cint64 conTag, bool* containsNegated = nullptr); bool containsConcept(CConcept* concept, bool* containsNegated = nullptr); bool containsConcept(CConcept* concept, bool negated); bool containsConceptOrReapllyQueue(cint64 conTag); bool containsConceptSaturationDescriptor(CConceptSaturationDescriptor* conSatDes); bool hasModifiedUpdateLinkers(); CSaturationModifiedProcessUpdateLinker* getModifiedUpdateLinker(); CReapplyConceptSaturationLabelSet* addModifiedUpdateLinker(CSaturationModifiedProcessUpdateLinker* modUpdateLinker); CReapplyConceptSaturationLabelSet* setModifiedUpdateLinker(CSaturationModifiedProcessUpdateLinker* modUpdateLinker); bool insertConceptReturnClashed(CConceptSaturationDescriptor* conSatDes, bool* newInsertion = nullptr, CImplicationReapplyConceptSaturationDescriptor*** impReapplyConSatDesPtr = nullptr); bool insertConceptReapplicationReturnTriggered(cint64 conTag, CImplicationReapplyConceptSaturationDescriptor* reapplyImpReapplyConSatDes, CConceptSaturationDescriptor** conSatDes); CConceptSaturationDescriptor* getConceptSaturationDescriptionLinker(); CReapplyConceptSaturationLabelSetIterator getIterator(bool iterateConSatDes = true, bool iterateReapplies = true); bool areAllConceptsInAdditionalHash(); CConceptSaturationDescriptor* getLastNominalIndependentConceptSaturationDescriptorLinker(); CReapplyConceptSaturationLabelSet* setLastNominalIndependentConceptSaturationDescriptorLinker(CConceptSaturationDescriptor* conSatDes); // protected methods protected: // protected variables protected: CPROCESSHASH* mConceptDesDepHash; CPROCESSHASH* mAdditionalConceptDesDepHash; CConceptSaturationDescriptor* mConceptSatDesLinker; CConceptSaturationDescriptor* mLastNominalIndepConSatDes; cint64 mConceptCount; cint64 mTotelCount; const static cint64 ADDITIONALCOPYSIZE = 300; CSaturationModifiedProcessUpdateLinker* mModifiedUpdateLinker; CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTSATURATIONLABELSET_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceRealValuesCounter.h0000644000175000017500000000764612520551116032235 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACEREALVALUESCOUNTER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACEREALVALUESCOUNTER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CDatatypeValueSpaceValuesCounter.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CDatatypeValueSpaceRealValuesCounter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceRealValuesCounter : public CDatatypeValueSpaceValuesCounter { // public methods public: //! Constructor CDatatypeValueSpaceRealValuesCounter(); const static cint64 RVT_INTEGER_ONLY_COUNT = 0x0001; const static cint64 RVT_DECIMAL_ONLY_COUNT = 0x0002; const static cint64 RVT_RATIONAL_ONLY_COUNT = 0x0004; const static cint64 RVT_INTEGER_ALL_COUNT = RVT_INTEGER_ONLY_COUNT | RVT_DECIMAL_ONLY_COUNT | RVT_RATIONAL_ONLY_COUNT; const static cint64 RVT_DECIMAL_ALL_COUNT = RVT_DECIMAL_ONLY_COUNT | RVT_RATIONAL_ONLY_COUNT; const static cint64 RVT_RATIONAL_ALL_COUNT = RVT_RATIONAL_ONLY_COUNT; const static cint64 RVT_NON_INTEGER_ONLY_COUNT = 0x0010; const static cint64 RVT_NON_DECIMAL_ONLY_COUNT = 0x0020; const static cint64 RVT_NON_RATIONAL_ONLY_COUNT = 0x0040; const static cint64 RVT_NON_RATIONAL_ALL_COUNT = RVT_NON_RATIONAL_ONLY_COUNT | RVT_NON_DECIMAL_ONLY_COUNT | RVT_NON_INTEGER_ONLY_COUNT; const static cint64 RVT_NON_DECIMAL_ALL_COUNT = RVT_NON_DECIMAL_ONLY_COUNT | RVT_NON_INTEGER_ONLY_COUNT; const static cint64 RVT_NON_INTEGER_ALL_COUNT = RVT_NON_INTEGER_ONLY_COUNT; CDatatypeValueSpaceRealValuesCounter* initRealValueCounter(cint64 valueCount = 0); virtual bool combineWithValueCounter(CDatatypeValueSpaceValuesCounter* counter, cint64 additionalDiff = 0); bool incValueCount(cint64 type, cint64 incCount = 1); bool incInfinite(cint64 type); bool isInfinite(cint64 type); bool isInfinite(); cint64 getValueCount(cint64 type); cint64 getValueCount(); bool hasValueAchieved(cint64 type, cint64 value); bool hasValueAchieved(cint64 value); virtual VALUES_COUNTER_TYPE getCounterType(); // protected methods protected: // protected variables protected: CDatatypeValueSpaceValuesCounter mIntegerTypeCounter; CDatatypeValueSpaceValuesCounter mDecimalTypeCounter; CDatatypeValueSpaceValuesCounter mRationalTypeCounter; CDatatypeValueSpaceValuesCounter mNonIntegerTypeCounter; CDatatypeValueSpaceValuesCounter mNonDecimalTypeCounter; CDatatypeValueSpaceValuesCounter mNonRationalTypeCounter; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACEREALVALUESCOUNTER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueDataExclusion.cpp0000644000175000017500000001336612520551114032135 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeStringValueDataExclusion.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeStringValueDataExclusion::CDatatypeStringValueDataExclusion() { } CDatatypeStringValueDataExclusion* CDatatypeStringValueDataExclusion::initDataExclusion(CDatatypeStringValueDataExclusion* value) { if (value) { mPosExclusionType = value->mPosExclusionType; mNegExclusionType = value->mNegExclusionType; mPosExclusionDepTrackPoint = value->mPosExclusionDepTrackPoint; mNegExclusionDepTrackPoint = value->mNegExclusionDepTrackPoint; mExcluded = value->mExcluded; mExcludedDepTrackPoint = value->mExcludedDepTrackPoint; } else { mPosExclusionType = CDatatypeStringValueExclusionType::SVET_NOTHING; mNegExclusionType = CDatatypeStringValueExclusionType::SVET_ALL; mPosExclusionDepTrackPoint = nullptr; mNegExclusionDepTrackPoint = nullptr; mExcludedDepTrackPoint = nullptr; mExcluded = false; } return this; } bool CDatatypeStringValueDataExclusion::isExcluded() { return mExcluded; } CDependencyTrackPoint* CDatatypeStringValueDataExclusion::getExcludedDependencyTrackPoint() { return mExcludedDepTrackPoint; } CDatatypeStringValueDataExclusion* CDatatypeStringValueDataExclusion::setExcluded(bool excluded) { mExcluded = excluded; return this; } CDatatypeStringValueDataExclusion* CDatatypeStringValueDataExclusion::setExcludedDependencyTrackPoint(CDependencyTrackPoint* depTrackPoint) { mExcludedDepTrackPoint = depTrackPoint; return this; } bool CDatatypeStringValueDataExclusion::isSomethingExcluded() { if (isExcluded()) { return true; } if (mPosExclusionType != CDatatypeStringValueExclusionType::SVET_NOTHING || mNegExclusionType != CDatatypeStringValueExclusionType::SVET_ALL) { return true; } else { return false; } } bool CDatatypeStringValueDataExclusion::isEverythingExcluded() { if (isExcluded()) { return true; } if ((cint64)mNegExclusionType <= (cint64)mPosExclusionType) { return true; } if (mPosExclusionType == CDatatypeStringValueExclusionType::SVET_ALL || mNegExclusionType == CDatatypeStringValueExclusionType::SVET_NOTHING) { return true; } return false; } bool CDatatypeStringValueDataExclusion::areOnlyLanguageTagsAllowed() { if (isExcluded()) { return false; } if ((cint64)mPosExclusionType == (cint64)CDatatypeStringValueExclusionType::SVET_NOTHING && (cint64)mNegExclusionType == (cint64)CDatatypeStringValueExclusionType::SVET_LANGUAGE_TAGS_COMPLETELY) { return true; } return false; } bool CDatatypeStringValueDataExclusion::areLanguageTagsExcluded() { if (isExcluded()) { return true; } if ((cint64)mPosExclusionType >= (cint64)CDatatypeStringValueExclusionType::SVET_LANGUAGE_TAGS_COMPLETELY) { return true; } if ((cint64)mNegExclusionType < (cint64)CDatatypeStringValueExclusionType::SVET_LANGUAGE_TAGS_COMPLETELY) { return true; } return false; } bool CDatatypeStringValueDataExclusion::isExcluded(CDatatypeStringValueExclusionType* type) { if (isExcluded()) { return true; } if (type->getExclusionNegation()) { if ((cint64)type->getExclusionType() >= (cint64)mNegExclusionType) { return true; } } else { if ((cint64)type->getExclusionType() <= (cint64)mPosExclusionType) { return true; } } return false; } CDatatypeStringValueDataExclusion* CDatatypeStringValueDataExclusion::setExclusion(CDatatypeStringValueExclusionType* type, CDependencyTrackPoint* depTrackPoint) { if (!isExcluded(type)) { if (type->getExclusionNegation()) { mNegExclusionType = type->getExclusionType(); mNegExclusionDepTrackPoint = depTrackPoint; } else { mPosExclusionType = type->getExclusionType(); mPosExclusionDepTrackPoint = depTrackPoint; } } return this; } CDependencyTrackPoint* CDatatypeStringValueDataExclusion::getExclusionDependencyTrackPoint(CDatatypeStringValueExclusionType* type) { if (isExcluded()) { return getExcludedDependencyTrackPoint(); } if (!isExcluded(type)) { return nullptr; } else if (type->getExclusionNegation()) { return mNegExclusionDepTrackPoint; } else { return mPosExclusionDepTrackPoint; } return nullptr; } CDependencyTrackPoint* CDatatypeStringValueDataExclusion::getPositiveExclusionDependencyTrackPoint() { return mPosExclusionDepTrackPoint; } CDependencyTrackPoint* CDatatypeStringValueDataExclusion::getNegativeExclusionDependencyTrackPoint() { return mNegExclusionDepTrackPoint; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockedTestTag.cpp0000644000175000017500000000542512520551072026351 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBlockedTestTag.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBlockedTestTag::CBlockedTestTag(cint64 blockingAddTag) : CProcessTag(blockingAddTag) { } cint64 CBlockedTestTag::getBlockedTestTag() { return CProcessTag::getProcessTag(); } CBlockedTestTag* CBlockedTestTag::setBlockedTestTag(cint64 blockingAddTag) { CProcessTag::setProcessTag(blockingAddTag); return this; } CBlockedTestTag* CBlockedTestTag::initBlockedTestTag(cint64 blockingAddTag) { CProcessTag::initProcessTag(blockingAddTag); return this; } bool CBlockedTestTag::isBlockedTestTagUpdated(cint64 blockingAddTag) { return CProcessTag::isProcessTagUpdated(blockingAddTag); } bool CBlockedTestTag::isBlockedTestTagUpToDate(cint64 blockingAddTag) { return CProcessTag::isProcessTagUpToDate(blockingAddTag); } bool CBlockedTestTag::updateBlockedTestTag(cint64 blockingAddTag) { return CProcessTag::updateProcessTag(blockingAddTag); } CBlockedTestTag* CBlockedTestTag::setBlockedTestTag(CProcessTagger* processTagger) { return setBlockedTestTag(processTagger->getCurrentBlockingAddTag()); } CBlockedTestTag* CBlockedTestTag::initBlockedTestTag(CProcessTagger* processTagger) { return initBlockedTestTag(processTagger->getCurrentBlockingAddTag()); } bool CBlockedTestTag::isBlockedTestTagUpdated(CProcessTagger* processTagger) { return isBlockedTestTagUpdated(processTagger->getCurrentBlockingAddTag()); } bool CBlockedTestTag::isBlockedTestTagUpToDate(CProcessTagger* processTagger) { return isBlockedTestTagUpToDate(processTagger->getCurrentBlockingAddTag()); } bool CBlockedTestTag::updateBlockedTestTag(CProcessTagger* processTagger) { return updateBlockedTestTag(processTagger->getCurrentBlockingAddTag()); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctExtractionLinker.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctExtractionLinker.cp0000644000175000017500000000415112520551152032367 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationDisjunctExtractionLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationDisjunctExtractionLinker::CSaturationDisjunctExtractionLinker() : CLinkerBase(nullptr) { mLastExaminedConSatDes = nullptr; } CSaturationDisjunctExtractionLinker* CSaturationDisjunctExtractionLinker::initSaturationDisjunctExtractionLinker(CIndividualSaturationProcessNode* disjNode, CConceptSaturationDescriptor* lastExaminedConSatDes) { mLastExaminedConSatDes = lastExaminedConSatDes; setData(disjNode); return this; } CConceptSaturationDescriptor* CSaturationDisjunctExtractionLinker::getLastExaminedConceptSaturationDescriptor() { return mLastExaminedConSatDes; } CIndividualSaturationProcessNode* CSaturationDisjunctExtractionLinker::getDisjunctIndividualSaturationProcessNode() { return getData(); } CSaturationDisjunctExtractionLinker* CSaturationDisjunctExtractionLinker::setLastExaminedConceptSaturationDescriptor(CConceptSaturationDescriptor* conSatDes) { mLastExaminedConSatDes = conSatDes; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativePropagationMapData.cpp0000644000175000017500000000332412520551144032142 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativePropagationMapData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativePropagationMapData::CRepresentativePropagationMapData(CRepresentativePropagationDescriptor* repPropDes) { mRepPropDes = repPropDes; } CRepresentativePropagationDescriptor* CRepresentativePropagationMapData::getRepresentativePropagationDescriptor() const { return mRepPropDes; } bool CRepresentativePropagationMapData::hasRepresentativePropagationDescriptor() const { return mRepPropDes != nullptr; } CRepresentativePropagationMapData* CRepresentativePropagationMapData::setRepresentativePropagationDescriptor(CRepresentativePropagationDescriptor* repPropDes) { mRepPropDes = repPropDes; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableCacheStoringData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableCacheStoring0000644000175000017500000000240512520551124032261 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeSatisfiableCacheStoringData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeSatisfiableCacheStoringData::CIndividualNodeSatisfiableCacheStoringData() { } CIndividualNodeSatisfiableCacheStoringData::~CIndividualNodeSatisfiableCacheStoringData() { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptHash.0000644000175000017500000000745612520551136032251 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPropagationBindingReapplyConceptHash.h" #include "CIndividualProcessNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CPropagationBindingReapplyConceptHash::CPropagationBindingReapplyConceptHash(CProcessContext* processContext) : mProcessContext(processContext) { } CPropagationBindingReapplyConceptHash* CPropagationBindingReapplyConceptHash::initPropagationBindingReapplyConceptHash(CPropagationBindingReapplyConceptHash* prevHash) { if (prevHash) { *this = *prevHash; } else { CPROCESSHASH::clear(); } return this; } CPropagationBindingReapplyConceptHash* CPropagationBindingReapplyConceptHash::addPropagationBindingReapplyConceptDescriptor(CIndividualProcessNode* indi, CConcept* concept, CPropagationBindingReapplyConceptDescriptor* reapplyConDes) { return addPropagationBindingReapplyConceptDescriptor(TIndividualConceptPair(indi->getIndividualID(),concept),reapplyConDes); } CPropagationBindingReapplyConceptHash* CPropagationBindingReapplyConceptHash::addPropagationBindingReapplyConceptDescriptor(const TIndividualConceptPair& indiConPair, CPropagationBindingReapplyConceptDescriptor* reapplyConDes) { CPropagationBindingReapplyConceptHashData& data = CPROCESSHASH::operator[](indiConPair); reapplyConDes->append(data.getPropagationBindingReapplyConceptDescriptor()); data.setPropagationBindingReapplyConceptDescriptor(reapplyConDes); return this; } CPropagationBindingReapplyConceptDescriptor* CPropagationBindingReapplyConceptHash::takePropagationBindingReapplyConceptDescriptor(const TIndividualConceptPair& indiConPair) { CPropagationBindingReapplyConceptHashData data = CPROCESSHASH::value(indiConPair); CPropagationBindingReapplyConceptDescriptor* reapplyConDes = data.getPropagationBindingReapplyConceptDescriptor(); data.clearPropagationBindingReapplyConceptDescriptor(); return reapplyConDes; } bool CPropagationBindingReapplyConceptHash::hasPropagationBindingReapplyConceptDescriptor(const TIndividualConceptPair& indiConPair) { CPropagationBindingReapplyConceptHashData data = CPROCESSHASH::value(indiConPair); return data.getPropagationBindingReapplyConceptDescriptor() != nullptr; } CPropagationBindingReapplyConceptIterator CPropagationBindingReapplyConceptHash::getPropagationBindingReapplyConceptDescriptorIterator() { return CPropagationBindingReapplyConceptIterator(CPROCESSHASH::begin(),CPROCESSHASH::end()); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetH0000644000175000017500000000604712520551146032276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRepresentativePropagationSet.h" #include "CRepresentativeVariableBindingPathSetData.h" #include "CRepresentativeVariableBindingPathSetHashData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathSetHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathSetHash : public CPROCESSHASH { // public methods public: //! Constructor CRepresentativeVariableBindingPathSetHash(CProcessContext* processContext); CRepresentativeVariableBindingPathSetHash* initRepresentativeVariableBindingPathSetHash(CRepresentativeVariableBindingPathSetHash* prevSet); CRepresentativeVariableBindingPathSetHash* insertRepresentativeVariableBindingPathSetData(CRepresentativeVariableBindingPathSetData* repSetData); CRepresentativeVariableBindingPathSetData* getRepresentativeVariableBindingPathSetData(CRepresentativePropagationSet* repPropSet, bool createOrLocalize = true); CRepresentativeVariableBindingPathSetData* getRepresentativeVariableBindingPathSetData(CRepresentativeVariableBindingPathSetData* repSetData, bool createOrLocalize = true); bool isRepresentativePropagationMapIdenticalToRepresentativeContainingMap(CRepresentativePropagationMap* repPropMap, CRepresentativeContainingMap* repContMap); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETHASH_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorConceptExtensionMapData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorConceptExtensionMa0000644000175000017500000000235112520551156032441 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationSuccessorConceptExtensionMapData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationSuccessorConceptExtensionMapData::CSaturationSuccessorConceptExtensionMapData() { mConcept = nullptr; mPositive = false; mNegative = false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationPredecessorRoleFUNCTIONALCo0000644000175000017500000000526312520551156031753 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONPREDECESSORROLEFUNCTIONALCONCEPTSEXTENSIONHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONPREDECESSORROLEFUNCTIONALCONCEPTSEXTENSIONHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CSaturationPredecessorFUNCTIONALConceptExtensionData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash { // public methods public: //! Constructor CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash(CProcessContext* processContext); CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash* initLinkedPredecessorRoleFUNCTIONALConceptsExtensionHash(); CPROCESSHASH* getLinkedPredecessorIndividualFUNCTIONALConceptsExtensionHash(); CSaturationPredecessorFUNCTIONALConceptExtensionData* getPredecessorFunctionalConceptsExtensionData(CRole* role, bool create = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CPROCESSHASH mLinkedPredecessorRoleFUNCTIONALConceptExtHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONPREDECESSORROLEFUNCTIONALCONCEPTSEXTENSIONHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingStatisticRegistrator.cpp0000644000175000017500000000232012520551134031732 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessingStatisticRegistrator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CProcessingStatisticRegistrator::CProcessingStatisticRegistrator() { } CProcessingStatisticRegistrator::~CProcessingStatisticRegistrator() { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandidateIterator.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandid0000644000175000017500000000474712520551160032271 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGINDIVIDUALNODECANDIDATEITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGINDIVIDUALNODECANDIDATEITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSignatureBlockingIndividualNodeCandidateIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureBlockingIndividualNodeCandidateIterator { // public methods public: //! Constructor CSignatureBlockingIndividualNodeCandidateIterator(CPROCESSSET* candidateSet); bool hasNext(); bool hasIndividualCandidates(); cint64 next(bool moveNext = true); CIndividualProcessNode* nextIndividualCandidate(bool moveNext = true); bool removeLastIndividualCandidate(); // protected methods protected: // protected variables protected: CPROCESSSET* mCandidateSet; CPROCESSSET::iterator mItBegin; CPROCESSSET::iterator mItEnd; CPROCESSSET::iterator mItLast; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGINDIVIDUALNODECANDIDATEITERATOR_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationHash.cp0000644000175000017500000000576112520551132032222 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNominalCachingLossReactivationHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CNominalCachingLossReactivationHash::CNominalCachingLossReactivationHash(CProcessContext* processContext) : mNominalReactivationDataHash(processContext),mProcessContext(processContext) { } CNominalCachingLossReactivationHash* CNominalCachingLossReactivationHash::initNominalDependentNodeHash(CNominalCachingLossReactivationHash* nominalDependentHash) { if (nominalDependentHash) { mNominalReactivationDataHash = nominalDependentHash->mNominalReactivationDataHash; } else { mNominalReactivationDataHash.clear(); } return this; } CNominalCachingLossReactivationData* CNominalCachingLossReactivationHash::getNominalCachingLossReactivationData(CIndividualProcessNode* nominalIndiNode, bool create) { return getNominalCachingLossReactivationData(nominalIndiNode->getIndividualID(),create); } CNominalCachingLossReactivationData* CNominalCachingLossReactivationHash::getNominalCachingLossReactivationData(cint64 nominalID, bool create) { CNominalCachingLossReactivationData* nominalNodeReactData = nullptr; if (!create) { const CNominalCachingLossReactivationHashData& hashData = mNominalReactivationDataHash.value(nominalID); nominalNodeReactData = hashData.mPrevReactivationData; } else { CNominalCachingLossReactivationHashData& hashData = mNominalReactivationDataHash[nominalID]; nominalNodeReactData = hashData.mReactivationData; if (!nominalNodeReactData) { nominalNodeReactData = CObjectParameterizingAllocator< CNominalCachingLossReactivationData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); nominalNodeReactData->initNominalCachingLossReactivationData(nominalID,hashData.mPrevReactivationData); hashData.mReactivationData = nominalNodeReactData; hashData.mPrevReactivationData = nominalNodeReactData; } } return nominalNodeReactData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathHash0000644000175000017500000000540712520551144032313 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathHash::CRepresentativeVariableBindingPathHash(CProcessContext* processContext) : mProcessContext(processContext),CPROCESSHASH(processContext) { } CRepresentativeVariableBindingPathHash* CRepresentativeVariableBindingPathHash::initRepresentativeVariableBindingPathHash(CRepresentativeVariableBindingPathHash* prevMap) { if (prevMap) { *this = *prevMap; } else { CPROCESSHASH::clear(); } return this; } CRepresentativeVariableBindingPathSetData* CRepresentativeVariableBindingPathHash::getRepresentativeVariableBindingPathSetData(CVariableBindingPath* varBindPath, bool createOrLocalize) { CRepresentativeVariableBindingPathSetData* repData = nullptr; if (createOrLocalize) { CRepresentativeVariableBindingPathSetHashData& data = CPROCESSHASH::operator[](varBindPath->getPropagationID()); repData = data.mUseDataLinker; if (!data.mLocDataLinker) { repData = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); repData->initRepresentativeVariableBindingPathData(nullptr); data.mLocDataLinker = repData; data.mUseDataLinker = repData; } } else { const CRepresentativeVariableBindingPathSetHashData& data = CPROCESSHASH::value(varBindPath->getPropagationID()); repData = data.mUseDataLinker; } return repData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDistinctHash.cpp0000644000175000017500000000466112520551120026072 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDistinctHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDistinctHash::CDistinctHash(CContext* context) : CPROCESSHASH(context) { } CDistinctHash::CDistinctHash(const CDistinctHash &disHash, CContext* context) : CPROCESSHASH(disHash,context) { } CDistinctHash::~CDistinctHash() { } CDistinctHash* CDistinctHash::initDistinctHash(CDistinctHash* prevHash) { if (prevHash) { *this = *prevHash; } else { clear(); } return this; } CDistinctEdge* CDistinctHash::getIndividualDistinctEdge(cint64 indiID) { return CPROCESSHASH::value(indiID,nullptr); } bool CDistinctHash::isIndividualDistinct(cint64 indiID) { return CPROCESSHASH::contains(indiID); } CDistinctHash *CDistinctHash::insertDistinctIndividual(cint64 indiID, CDistinctEdge* disEdge) { CPROCESSHASH::insert(indiID,disEdge); return this; } CDistinctHash* CDistinctHash::removeDistinctIndividual(cint64 indiID) { CPROCESSHASH::remove(indiID); return this; } cint64 CDistinctHash::getDistinctCount() { return CPROCESSHASH::count(); } CDistinctIterator CDistinctHash::getDistinctIterator() { return CDistinctIterator(CPROCESSHASH::begin(),CPROCESSHASH::end()); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningHashData.cp0000644000175000017500000000272112520551164032101 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingPathJoiningHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingPathJoiningHashData::CVariableBindingPathJoiningHashData() { mLocVarBindPathJoiningData = nullptr; mUseVarBindPathJoiningData = nullptr; } CVariableBindingPathJoiningHashData::CVariableBindingPathJoiningHashData(const CVariableBindingPathJoiningHashData& data) { mLocVarBindPathJoiningData = nullptr; mUseVarBindPathJoiningData = data.mUseVarBindPathJoiningData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBranchingORProcessingRestrictionSpecification.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBranchingORProcessingRestrictionSpeci0000644000175000017500000001002612520551074032327 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBranchingORProcessingRestrictionSpecification.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBranchingORProcessingRestrictionSpecification::CBranchingORProcessingRestrictionSpecification() { mContainedOperand = nullptr; mConRoleBranchTrigg = nullptr; mFirstNotPosAndNegContainedOperand = nullptr; mSecondNotPosAndNegContainedOperand = nullptr; mClashes = nullptr; } CBranchingORProcessingRestrictionSpecification* CBranchingORProcessingRestrictionSpecification::initBranchingORProcessingRestriction(CBranchingORProcessingRestrictionSpecification* prevRest) { CProcessingRestrictionSpecification::initProcessingRestriction(prevRest); if (prevRest) { mContainedOperand = prevRest->mContainedOperand; mConRoleBranchTrigg = prevRest->mConRoleBranchTrigg; mFirstNotPosAndNegContainedOperand = prevRest->mFirstNotPosAndNegContainedOperand; mSecondNotPosAndNegContainedOperand = prevRest->mSecondNotPosAndNegContainedOperand; mClashes = prevRest->mClashes; } return this; } CBranchingORProcessingRestrictionSpecification* CBranchingORProcessingRestrictionSpecification::setConceptRoleBranchingTrigger(CConceptRoleBranchingTrigger* conRoleBranchTrigger) { mConRoleBranchTrigg = conRoleBranchTrigger; return this; } CConceptRoleBranchingTrigger* CBranchingORProcessingRestrictionSpecification::getConceptRoleBranchingTrigger() { return mConRoleBranchTrigg; } CSortedNegLinker* CBranchingORProcessingRestrictionSpecification::getFirstNotPosAndNegContainedOperand() { return mFirstNotPosAndNegContainedOperand; } CSortedNegLinker* CBranchingORProcessingRestrictionSpecification::getSecondNotPosAndNegContainedOperand() { return mSecondNotPosAndNegContainedOperand; } CSortedNegLinker* CBranchingORProcessingRestrictionSpecification::getContainedOperand() { return mContainedOperand; } CBranchingORProcessingRestrictionSpecification* CBranchingORProcessingRestrictionSpecification::setFirstNotPosAndNegContainedOperand(CSortedNegLinker* firstOp) { mFirstNotPosAndNegContainedOperand = firstOp; return this; } CBranchingORProcessingRestrictionSpecification* CBranchingORProcessingRestrictionSpecification::setSecondNotPosAndNegContainedOperand(CSortedNegLinker* secondOp) { mSecondNotPosAndNegContainedOperand = secondOp; return this; } CBranchingORProcessingRestrictionSpecification* CBranchingORProcessingRestrictionSpecification::setContainedOperand(CSortedNegLinker* containedOp) { mContainedOperand = containedOp; return this; } CBranchingORProcessingRestrictionSpecification* CBranchingORProcessingRestrictionSpecification::addClashedConceptDescriptors(CClashedDependencyDescriptor* clashes) { if (clashes) { mClashes = clashes->append(mClashes); } return this; } CClashedDependencyDescriptor* CBranchingORProcessingRestrictionSpecification::getClashedConceptDescriptors() { return mClashes; } }; // end namespace Kernel }; // end namespace Process }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCondensedReapplyConceptDescriptor.h0000644000175000017500000000530212520551104031757 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCondensedReapplyConceptDescriptor_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCondensedReapplyConceptDescriptor_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CReapplyConceptDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CCondensedReapplyConceptDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCondensedReapplyConceptDescriptor : public CReapplyConceptDescriptor { // public methods public: //! Constructor CCondensedReapplyConceptDescriptor(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint *depTrackPoint = 0, bool isPositiveDes = true); CCondensedReapplyConceptDescriptor(); CCondensedReapplyConceptDescriptor* getNext(); CCondensedReapplyConceptDescriptor *initReapllyDescriptor(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint *depTrackPoint = 0, bool isPositiveDes = true); CCondensedReapplyConceptDescriptor *initReapllyDescriptor(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint *depTrackPoint, bool isPositiveDes, CProcessingRestrictionSpecification* procRest); bool isPositiveDescriptor(); bool hasConceptDescriptor(CConceptDescriptor* conceptDescriptor); // protected methods protected: // protected variables protected: bool mPositive; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCondensedReapplyConceptDescriptor_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyConceptDescriptor.cpp0000644000175000017500000000564012520551140030474 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReapplyConceptDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CReapplyConceptDescriptor::CReapplyConceptDescriptor(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint *depTrackPoint, bool isStaticDes) : CLinkerBase(this) { mConceptDes = conceptDescriptor; mTrackPoint = depTrackPoint; mStatic = isStaticDes; mProcessingRestriction = nullptr; } CReapplyConceptDescriptor::CReapplyConceptDescriptor() : CLinkerBase(this) { mConceptDes = 0; mTrackPoint = 0; mProcessingRestriction = nullptr; } CReapplyConceptDescriptor *CReapplyConceptDescriptor::initReapllyDescriptor(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint *depTrackPoint, bool isStaticDes) { mConceptDes = conceptDescriptor; mTrackPoint = depTrackPoint; mStatic = isStaticDes; mProcessingRestriction = nullptr; return this; } CReapplyConceptDescriptor *CReapplyConceptDescriptor::initReapllyDescriptor(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint *depTrackPoint, CProcessingRestrictionSpecification* procRest) { mConceptDes = conceptDescriptor; mTrackPoint = depTrackPoint; mStatic = false; mProcessingRestriction = procRest; return this; } CConceptDescriptor *CReapplyConceptDescriptor::getConceptDescriptor() { return mConceptDes; } CDependencyTrackPoint *CReapplyConceptDescriptor::getDependencyTrackPoint() { return mTrackPoint; } bool CReapplyConceptDescriptor::isStaticDescriptor() { return mStatic; } CProcessingRestrictionSpecification* CReapplyConceptDescriptor::getReapplyProcessingRestriction() { return mProcessingRestriction; } bool CReapplyConceptDescriptor::hasConceptDescriptor(CConceptDescriptor* conceptDescriptor) { return mConceptDes == conceptDescriptor; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNode.cpp0000644000175000017500000005436112574304112032024 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualSaturationProcessNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualSaturationProcessNode::CIndividualSaturationProcessNode(CProcessContext* processContext) : mProcessContext(processContext) { mMemAllocMan = mProcessContext->getMemoryAllocationManager(); } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::initIndividualSaturationProcessNode(cint64 individualID, CExtendedConceptReferenceLinkingData* conSatRefLinkData, CIndividualSaturationReferenceLinkingData* indSatRefLinkData) { mRoleBackPropHash = nullptr; mReapplyConSatLabelSet = nullptr; mIndiProcessLinker = nullptr; mConceptSaturationProcessLinker = nullptr; mSubstituteIndiNode = nullptr; mCopyIndiNode = nullptr; mRequiredBackProp = false; mDependingIndiNodeLinker = nullptr; mDepSaturationIndiNode = nullptr; mDirectSaturationIndiNode = nullptr; mNonInverseConnectedIndiNodeLinker = nullptr; mMultipleCardinalityAncestorNodesLinker = nullptr; mIndiID = individualID; mInitBackwardPropLinks = nullptr; mReferenceIndiNode = nullptr; mIndiExtensionData = nullptr; mClashedConSatDesLinker = nullptr; mIndiCompletionLinker = nullptr; mReferenceMode = 0; mConceptSaturationLinkRefData = conSatRefLinkData; mIndividualSaturationLinkRefData = indSatRefLinkData; mIntegratedNominalIndi = nullptr; mDataValueApplied = false; mCacheData = nullptr; mNominalIndi = nullptr; mSeparatedSaturation = false; return this; } CExtendedConceptReferenceLinkingData* CIndividualSaturationProcessNode::getSaturationConceptReferenceLinking() { return mConceptSaturationLinkRefData; } CIndividualSaturationReferenceLinkingData* CIndividualSaturationProcessNode::getSaturationIndividualReferenceLinking() { return mIndividualSaturationLinkRefData; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::initRootIndividualSaturationProcessNode() { return this; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::initCopingIndividualSaturationProcessNode(CIndividualSaturationProcessNode* indiNode, bool tryFlatLabelCopy) { if (indiNode->getRoleBackwardPropagationHash(false)) { getRoleBackwardPropagationHash(true)->copyRoleBackwardSaturationPropagationHash(indiNode->getRoleBackwardPropagationHash(false),this); } if (indiNode->getReapplyConceptSaturationLabelSet(false)) { getReapplyConceptSaturationLabelSet(true)->copyReapplyConceptSaturationLabelSet(indiNode->getReapplyConceptSaturationLabelSet(false),tryFlatLabelCopy); } if (indiNode->getSuccessorConnectedNominalSet(false)) { getSuccessorConnectedNominalSet(true)->copySuccessorConnectedNominalSet(indiNode->getSuccessorConnectedNominalSet(false)); } mIntegratedNominalIndi = indiNode->mIntegratedNominalIndi; if (indiNode->mNominalIndi) { mIntegratedNominalIndi = indiNode->mNominalIndi; } if (mNominalIndi) { mIntegratedNominalIndi = mNominalIndi; } mDataValueApplied = indiNode->mDataValueApplied; if (indiNode->getAppliedDatatypeData(false)) { getAppliedDatatypeData(true)->setAppliedDataLiteral(indiNode->getAppliedDatatypeData(false)->getAppliedDataLiteral()); getAppliedDatatypeData(true)->setAppliedDatatype(indiNode->getAppliedDatatypeData(false)->getAppliedDatatype()); } CXNegLinker* depCopyLinker = CObjectAllocator< CXNegLinker >::allocateAndConstruct(mMemAllocMan); depCopyLinker->initNegLinker(this,true); indiNode->addCopyDependingIndividualNodeLinker(depCopyLinker); return this; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::initSubstituitingIndividualSaturationProcessNode(CIndividualSaturationProcessNode* indiNode) { mDirectStatusFlags = indiNode->mDirectStatusFlags; mIndirectStatusFlags = indiNode->mIndirectStatusFlags; return this; } CReapplyConceptSaturationLabelSet* CIndividualSaturationProcessNode::getReapplyConceptSaturationLabelSet(bool create) { if (create && !mReapplyConSatLabelSet) { mReapplyConSatLabelSet = CObjectParameterizingAllocator< CReapplyConceptSaturationLabelSet,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mReapplyConSatLabelSet->initReapplyConceptSaturationLabelSet(); } return mReapplyConSatLabelSet; } CIndividualSaturationProcessNodeExtensionData* CIndividualSaturationProcessNode::getIndividualExtensionData(bool create) { if (create && !mIndiExtensionData) { mIndiExtensionData = CObjectParameterizingAllocator< CIndividualSaturationProcessNodeExtensionData,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mIndiExtensionData->initIndividualExtensionData(this); } return mIndiExtensionData; } CSaturationDisjunctCommonConceptExtractionData* CIndividualSaturationProcessNode::getDisjunctCommonConceptExtractionData(bool create) { if (create) { return getIndividualExtensionData(true)->getDisjunctCommonConceptExtractionData(true); } if (mIndiExtensionData) { return mIndiExtensionData->getDisjunctCommonConceptExtractionData(false); } return nullptr; } CRoleBackwardSaturationPropagationHash* CIndividualSaturationProcessNode::getRoleBackwardPropagationHash(bool create) { if (create && !mRoleBackPropHash) { mRoleBackPropHash = CObjectParameterizingAllocator< CRoleBackwardSaturationPropagationHash,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mRoleBackPropHash->initRoleBackwardSaturationPropagationHash(); } return mRoleBackPropHash; } CSuccessorConnectedNominalSet* CIndividualSaturationProcessNode::getSuccessorConnectedNominalSet(bool create) { CSuccessorConnectedNominalSet* succConnectedNominalSet = nullptr; CSaturationIndividualNodeNominalHandlingData* nominalHandlingData = getNominalHandlingData(create); if (nominalHandlingData) { succConnectedNominalSet = nominalHandlingData->getSuccessorConnectedNominalSet(create); } return succConnectedNominalSet; } CCriticalPredecessorRoleCardinalityHash* CIndividualSaturationProcessNode::getCriticalPredecessorRoleCardinalityHash(bool create) { if (create) { return getIndividualExtensionData(true)->getCriticalPredecessorRoleCardinalityHash(true); } if (mIndiExtensionData) { return mIndiExtensionData->getCriticalPredecessorRoleCardinalityHash(false); } return nullptr; } CLinkedRoleSaturationSuccessorHash* CIndividualSaturationProcessNode::getLinkedRoleSuccessorHash(bool create) { if (create) { return getIndividualExtensionData(true)->getLinkedRoleSuccessorHash(true); } if (mIndiExtensionData) { return mIndiExtensionData->getLinkedRoleSuccessorHash(false); } return nullptr; } CCriticalSaturationConceptTypeQueues* CIndividualSaturationProcessNode::getCriticalConceptTypeQueues(bool create) { if (create) { return getIndividualExtensionData(true)->getCriticalConceptTypeQueues(true); } if (mIndiExtensionData) { return mIndiExtensionData->getCriticalConceptTypeQueues(false); } return nullptr; } CSaturationIndividualNodeSuccessorExtensionData* CIndividualSaturationProcessNode::getSuccessorExtensionData(bool create) { if (create) { return getIndividualExtensionData(true)->getSuccessorExtensionData(true); } if (mIndiExtensionData) { return mIndiExtensionData->getSuccessorExtensionData(false); } return nullptr; } CSaturationIndividualNodeNominalHandlingData* CIndividualSaturationProcessNode::getNominalHandlingData(bool create) { if (create) { return getIndividualExtensionData(true)->getNominalHandlingData(true); } if (mIndiExtensionData) { return mIndiExtensionData->getNominalHandlingData(false); } return nullptr; } CSaturationIndividualNodeDatatypeData* CIndividualSaturationProcessNode::getAppliedDatatypeData(bool create) { if (create) { return getIndividualExtensionData(true)->getAppliedDatatypeData(true); } if (mIndiExtensionData) { return mIndiExtensionData->getAppliedDatatypeData(false); } return nullptr; } CIndividualSaturationProcessNodeLinker* CIndividualSaturationProcessNode::getIndividualSaturationProcessNodeLinker() { return mIndiProcessLinker; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setIndividualSaturationProcessNodeLinker(CIndividualSaturationProcessNodeLinker* processNodeLinker) { mIndiProcessLinker = processNodeLinker; return this; } CConceptSaturationProcessLinker* CIndividualSaturationProcessNode::getConceptSaturationProcessLinker() { return mConceptSaturationProcessLinker; } CConceptSaturationProcessLinker* CIndividualSaturationProcessNode::takeConceptSaturationProcessLinker() { CConceptSaturationProcessLinker* conProcLinker = mConceptSaturationProcessLinker; if (mConceptSaturationProcessLinker) { mConceptSaturationProcessLinker = mConceptSaturationProcessLinker->getNext(); } return conProcLinker; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setConceptSaturationProcessLinker(CConceptSaturationProcessLinker* conProcessLinker) { mConceptSaturationProcessLinker = conProcessLinker; return this; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::addConceptSaturationProcessLinker(CConceptSaturationProcessLinker* conProcessLinker) { mConceptSaturationProcessLinker = conProcessLinker->append(mConceptSaturationProcessLinker); return this; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::clearConceptSaturationProcessLinker() { mConceptSaturationProcessLinker = nullptr; return this; } CSaturationSuccessorRoleAssertionLinker* CIndividualSaturationProcessNode::getRoleAssertionLinker() { if (mIndiExtensionData) { return mIndiExtensionData->getRoleAssertionLinker(); } return nullptr; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::addRoleAssertionLinker(CSaturationSuccessorRoleAssertionLinker* roleAssertionLinker) { getIndividualExtensionData(true)->addRoleAssertionLinker(roleAssertionLinker); return this; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::addRoleAssertion(CIndividualSaturationProcessNode* destinationNode, CRole* role, bool roleNegation) { getIndividualExtensionData(true)->addRoleAssertion(destinationNode,role,roleNegation); return this; } bool CIndividualSaturationProcessNode::getRequiredBackwardPropagation() { return mRequiredBackProp; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setRequiredBackwardPropagation(bool requiredBackProp) { mRequiredBackProp = requiredBackProp; return this; } bool CIndividualSaturationProcessNode::hasSubstituteIndividualNode() { return mSubstituteIndiNode != nullptr; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::getSubstituteIndividualNode() { return mSubstituteIndiNode; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setSubstituteIndividualNode(CIndividualSaturationProcessNode* indiNode) { mSubstituteIndiNode = indiNode; return this; } bool CIndividualSaturationProcessNode::hasCopyIndividualNode() { return mCopyIndiNode != nullptr; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::getCopyIndividualNode() { return mCopyIndiNode; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setCopyIndividualNode(CIndividualSaturationProcessNode* indiNode) { mCopyIndiNode = indiNode; return this; } bool CIndividualSaturationProcessNode::hasCopyDependingIndividualNodeLinker() { return mDependingIndiNodeLinker != nullptr; } CXNegLinker* CIndividualSaturationProcessNode::getCopyDependingIndividualNodeLinker() { return mDependingIndiNodeLinker; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setCopyDependingIndividualNodeLinker(CXNegLinker* indiLinker) { mDependingIndiNodeLinker = indiLinker; return this; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::addCopyDependingIndividualNodeLinker(CXNegLinker* indiLinker) { if (indiLinker) { mDependingIndiNodeLinker = indiLinker->append(mDependingIndiNodeLinker); } return this; } bool CIndividualSaturationProcessNode::hasDependingSaturationIndividualNode() { return mDepSaturationIndiNode != nullptr; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::getDependingSaturationIndividualNode() { return mDepSaturationIndiNode; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setDependingSaturationIndividualNode(CIndividualSaturationProcessNode* indiNode) { mDepSaturationIndiNode = indiNode; return this; } bool CIndividualSaturationProcessNode::hasDirectSaturationIndividualNode() { return mDirectSaturationIndiNode != nullptr; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::getDirectSaturationIndividualNode() { return mDirectSaturationIndiNode; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setDirectSaturationIndividualNode(CIndividualSaturationProcessNode* indiNode) { mDirectSaturationIndiNode = indiNode; return this; } cint64 CIndividualSaturationProcessNode::getIndividualID() { return mIndiID; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setIndividualID(cint64 indiID) { mIndiID = indiID; return this; } bool CIndividualSaturationProcessNode::isInitialized() { return mDirectStatusFlags.hasInitializedFlag(); } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setInitialized(bool initialized) { mDirectStatusFlags.setInitializedFlag(initialized); mIndirectStatusFlags.setInitializedFlag(initialized); return this; } bool CIndividualSaturationProcessNode::isCompleted() { return mDirectStatusFlags.hasCompletedFlag(); } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setCompleted(bool completed) { mDirectStatusFlags.setCompletedFlag(completed); mIndirectStatusFlags.setCompletedFlag(completed); return this; } CBackwardSaturationPropagationLink* CIndividualSaturationProcessNode::getInitializingBackwardPropagationLinks() { return mInitBackwardPropLinks; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setInitializingBackwardPropagationLinks(CBackwardSaturationPropagationLink* backwardPropLinks) { mInitBackwardPropLinks = backwardPropLinks; return this; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::addInitializingBackwardPropagationLinks(CBackwardSaturationPropagationLink* backwardPropLinks) { if (backwardPropLinks) { mInitBackwardPropLinks = backwardPropLinks->append(mInitBackwardPropLinks); } return this; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::getReferenceIndividualSaturationProcessNode() { return mReferenceIndiNode; } cint64 CIndividualSaturationProcessNode::getReferenceMode() { return mReferenceMode; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setReferenceIndividualSaturationProcessNode(CIndividualSaturationProcessNode* refNode) { mReferenceIndiNode = refNode; return this; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setReferenceMode(cint64 refMode) { mReferenceMode = refMode; return this; } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNode::getDirectStatusFlags() { return &mDirectStatusFlags; } CIndividualSaturationProcessNodeStatusFlags* CIndividualSaturationProcessNode::getIndirectStatusFlags() { return &mIndirectStatusFlags; } bool CIndividualSaturationProcessNode::hasClashedConceptSaturationDescriptorLinker() { return mClashedConSatDesLinker != nullptr; } CConceptSaturationDescriptor* CIndividualSaturationProcessNode::getClashedConceptSaturationDescriptorLinker() { return mClashedConSatDesLinker; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::addClashedConceptSaturationDescriptorLinker(CConceptSaturationDescriptor* clashConSatDes) { mClashedConSatDesLinker = clashConSatDes->append(mClashedConSatDesLinker); return this; } bool CIndividualSaturationProcessNode::hasNonInverseConnectedIndividualNodeLinker() { return mNonInverseConnectedIndiNodeLinker != nullptr; } CXLinker* CIndividualSaturationProcessNode::getNonInverseConnectedIndividualNodeLinker() { return mNonInverseConnectedIndiNodeLinker; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setNonInverseConnectedIndividualNodeLinker(CXLinker* indiLinker) { mNonInverseConnectedIndiNodeLinker = indiLinker; return this; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::addNonInverseConnectedIndividualNodeLinker(CXLinker* indiLinker) { if (indiLinker) { mNonInverseConnectedIndiNodeLinker = indiLinker->append(mNonInverseConnectedIndiNodeLinker); } return this; } bool CIndividualSaturationProcessNode::hasNominalIntegrated() { return mIntegratedNominalIndi; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setIntegratedNominal(CIndividual* nominalIndi) { mIntegratedNominalIndi = nominalIndi; return this; } CIndividual* CIndividualSaturationProcessNode::getIntegratedNominalIndividual() { return mIntegratedNominalIndi; } bool CIndividualSaturationProcessNode::hasDataValueApplied() { return mDataValueApplied; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setDataValueApplied(bool dataApplied) { mDataValueApplied = dataApplied; return this; } bool CIndividualSaturationProcessNode::hasMultipleCardinalityAncestorNodesLinker() { return mMultipleCardinalityAncestorNodesLinker != nullptr; } CXLinker* CIndividualSaturationProcessNode::getMultipleCardinalityAncestorNodesLinker() { return mMultipleCardinalityAncestorNodesLinker; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setMultipleCardinalityAncestorNodesLinker(CXLinker* indiLinker) { mMultipleCardinalityAncestorNodesLinker = indiLinker; return this; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::addMultipleCardinalityAncestorNodesLinker(CXLinker* indiLinker) { if (indiLinker) { mMultipleCardinalityAncestorNodesLinker = indiLinker->append(mMultipleCardinalityAncestorNodesLinker); } return this; } CIndividual* CIndividualSaturationProcessNode::getNominalIndividual() { return mNominalIndi; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setNominalIndividual(CIndividual* nominalIndi) { mNominalIndi = nominalIndi; mIntegratedNominalIndi = mNominalIndi; return this; } bool CIndividualSaturationProcessNode::isIndividualSaturationCompletionNodeLinkerQueued() { if (mIndiCompletionLinker) { return mIndiCompletionLinker->isProcessingQueued(); } return false; } CIndividualSaturationProcessNodeLinker* CIndividualSaturationProcessNode::getIndividualSaturationCompletionNodeLinker(bool create) { if (!mIndiCompletionLinker && create) { mIndiCompletionLinker = CObjectAllocator< CIndividualSaturationProcessNodeLinker >::allocateAndConstruct(mMemAllocMan); mIndiCompletionLinker->initProcessNodeLinker(this,false); } return mIndiCompletionLinker; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setIndividualSaturationCompletionNodeLinker(CIndividualSaturationProcessNodeLinker* processNodeLinker) { mIndiCompletionLinker = processNodeLinker; return this; } CIndividualSaturationProcessNodeCacheData* CIndividualSaturationProcessNode::getCacheExpansionData() { return mCacheData; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setCacheExpansionData(CIndividualSaturationProcessNodeCacheData* cacheData) { mCacheData = cacheData; return this; } bool CIndividualSaturationProcessNode::isSeparated() { return mSeparatedSaturation; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNode::setSeparated(bool separated) { mSeparatedSaturation = separated; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyHasher.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoin0000644000175000017500000000622212520551146032325 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathJoiningKeyHasher.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathJoiningKeyHasher::CRepresentativeVariableBindingPathJoiningKeyHasher(CRepresentativeVariableBindingPathJoiningKeyData* data) { mVarBindPath = nullptr; mKeyVars = nullptr; mJoiningData = data; mHashValue = mJoiningData->getCalculatedHashValue(); } CRepresentativeVariableBindingPathJoiningKeyHasher::CRepresentativeVariableBindingPathJoiningKeyHasher(CVariableBindingPath* varBindPath, CSortedLinker* keyVars) { mJoiningData = nullptr; mVarBindPath = varBindPath; mKeyVars = keyVars; mHashValue = calculateHashValue(mVarBindPath,mKeyVars); } cint64 CRepresentativeVariableBindingPathJoiningKeyHasher::calculateHashValue(CVariableBindingPath* varBindPath, CSortedLinker* keyVars) { cint64 hashValue = 0; CSortedLinker* keyVarsIt = keyVars; cint64 multiplier = 13; for (CVariableBindingDescriptor* linkerIt = varBindPath->getVariableBindingDescriptorLinker(); keyVarsIt && linkerIt; linkerIt = linkerIt->getNext()) { CVariableBinding* variableBinding = linkerIt->getVariableBinding(); CVariable* variable = variableBinding->getBindedVariable(); CVariable* keyVariable = keyVarsIt->getData(); if (variable == keyVariable) { hashValue += multiplier*(cint64)variableBinding; multiplier = multiplier*2+1; keyVarsIt = keyVarsIt->getNext(); } } return hashValue; } cint64 CRepresentativeVariableBindingPathJoiningKeyHasher::getHashValue() const { return mHashValue; } bool CRepresentativeVariableBindingPathJoiningKeyHasher::operator==(const CRepresentativeVariableBindingPathJoiningKeyHasher& hasher) const { if (mJoiningData && hasher.mJoiningData) { return mJoiningData->isKeyEquivalentTo(*hasher.mJoiningData); } else if (mJoiningData && hasher.mVarBindPath) { return mJoiningData->isKeyEquivalentTo(hasher.mVarBindPath); } else if (mVarBindPath && hasher.mJoiningData) { return hasher.mJoiningData->isKeyEquivalentTo(mVarBindPath); } return false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReferredIndividualTrackingVector.h0000644000175000017500000000607012520551142031567 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREFERREDINDIVIDUALTRACKINGVECTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREFERREDINDIVIDUALTRACKINGVECTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CReferredIndividualTrackingData.h" // Other includes #include "Reasoner/Ontology/CIndividualDependenceTracking.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CReferredIndividualTrackingVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReferredIndividualTrackingVector : public CIndividualDependenceTracking { // public methods public: //! Constructor CReferredIndividualTrackingVector(); virtual ~CReferredIndividualTrackingVector(); CReferredIndividualTrackingVector* initReferredIndividualTrackingVector(cint64 indiCount); CReferredIndividualTrackingVector* initReferredIndividualTrackingVector(CReferredIndividualTrackingVector* indiTrackVec); CReferredIndividualTrackingData* getReferredIndividualTrackingData(cint64 indiID); virtual bool mergeGatheredTrackedIndividualDependences(CIndividualDependenceTracking* indiDepTracking); CReferredIndividualTrackingVector* setIndividualReferred(cint64 indiID); CReferredIndividualTrackingVector* setIndividualReferredAndExtended(cint64 indiID); virtual bool areIndividualsAffected(QSet* indirectlyChangedIndividualSet, QSet* changedCompatibleSet); virtual bool areIndividualsAffected(CConsistenceData* consData); virtual CIndividualDependenceTracking* getCopiedIndividualDependencyTracking(); virtual cint64 getDependenceSize(); // protected methods protected: // protected variables protected: CReferredIndividualTrackingData* mIndiTrackVector; cint64 mIndiTrackCount; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREFERREDINDIVIDUALTRACKINGVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBinding.h0000644000175000017500000000530012520551136026726 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDING_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDING_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CDependencyTracker.h" #include "CConceptDescriptor.h" // Other includes #include "Reasoner/Ontology/CVariable.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CPropagationBinding * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPropagationBinding : public CDependencyTracker { // public methods public: //! Constructor CPropagationBinding(); CPropagationBinding* initPropagationBinding(cint64 propID, CDependencyTrackPoint* dependencyTrackPoint, CIndividualProcessNode* indi, CConceptDescriptor* conDes, CVariable* variable); cint64 getPropagationID(); CPropagationBinding* setPropagationID(cint64 propID); CVariable* getBindedVariable(); CPropagationBinding* setBindedVariable(CVariable* variable); CIndividualProcessNode* getBindedIndividual(); CPropagationBinding* setBindedIndividual(CIndividualProcessNode* indi); CConceptDescriptor* getBindedConceptDescriptor(); CPropagationBinding* setBindedConceptDescriptor(CConceptDescriptor* conDes); // protected methods protected: // protected variables protected: cint64 mPropID; CVariable* mVariable; CIndividualProcessNode* mIndiNode; CConceptDescriptor* mConDes; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDING_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningCommonKeyMap.h0000644000175000017500000000432612520551144031754 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGCOMMONKEYMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGCOMMONKEYMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRepresentativeJoiningCommonKeyData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRepresentativeJoiningCommonKeyMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeJoiningCommonKeyMap : public CPROCESSMAP { // public methods public: //! Constructor CRepresentativeJoiningCommonKeyMap(CProcessContext* processContext); CRepresentativeJoiningCommonKeyMap* initRepresentativeJoiningCommonKeyMap(CRepresentativeJoiningCommonKeyMap* prevMap); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGCOMMONKEYMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBackwardSaturationPropagationLink.h0000644000175000017500000000463312520551072031771 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBACKWARDSATURATIONPROPAGATIONLINK_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBACKWARDSATURATIONPROPAGATIONLINK_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" #include "Utilities/Container/CLinker.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CBackwardSaturationPropagationLink * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackwardSaturationPropagationLink : public CLinkerBase { // public methods public: //! Constructor CBackwardSaturationPropagationLink(); CBackwardSaturationPropagationLink* initBackwardPropagationLink(CIndividualSaturationProcessNode* sourceIndividual, CRole* role); CRole* getLinkRole(); CBackwardSaturationPropagationLink* setLinkRole(CRole* role); CIndividualSaturationProcessNode* getSourceIndividual(); // protected methods protected: // protected variables protected: CIndividualSaturationProcessNode* mSourceIndividual; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBACKWARDSATURATIONPROPAGATIONLINK_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualUnsortedProcessingQueue.h0000644000175000017500000000503612520551130032026 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALUNSORTEDPROCESSINGQUEUE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALUNSORTEDPROCESSINGQUEUE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualUnsortedProcessingQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualUnsortedProcessingQueue { // public methods public: //! Constructor CIndividualUnsortedProcessingQueue(CProcessContext* processContext); CIndividualUnsortedProcessingQueue* initProcessingQueue(CIndividualUnsortedProcessingQueue* processingQueue); CXLinker* getProcessIndividualNodeLinker(); CIndividualProcessNode* takeNextProcessIndividualNode(); CIndividualProcessNode* getNextProcessIndividualNode(); CIndividualUnsortedProcessingQueue *insertIndiviudalProcessNode(CIndividualProcessNode* indiProNode); bool isEmpty(); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CMemoryAllocationManager* mMemMan; cint64 mIndiProDesCount; CXLinker* mProcessingIndiNodeLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALUNSORTEDPROCESSINGQUEUE_H ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorFUNCTIONALConceptExtensionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorFUNCTIONALConceptE0000644000175000017500000000616312520551160031756 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORFUNCTIONALCONCEPTEXTENSIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORFUNCTIONALCONCEPTEXTENSIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CConceptSaturationDescriptor.h" #include "CSaturationSuccessorData.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSaturationSuccessorFUNCTIONALConceptExtensionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationSuccessorFUNCTIONALConceptExtensionData : public CLinkerBase { // public methods public: //! Constructor CSaturationSuccessorFUNCTIONALConceptExtensionData(CProcessContext* processContext); CSaturationSuccessorFUNCTIONALConceptExtensionData* initSuccessorConceptExtensionData(CRole* role); bool isExtensionProcessingQueued(); CSaturationSuccessorFUNCTIONALConceptExtensionData* setExtensionProcessingQueued(bool queued); CRole* getRole(); CIndividualSaturationProcessNode* getLastResolvedIndividualNode(); CSaturationSuccessorFUNCTIONALConceptExtensionData* setLastResolvedIndividualNode(CIndividualSaturationProcessNode* indiNode); CSaturationSuccessorData* getLastExaminedLinkedSuccessorData(); CSaturationSuccessorFUNCTIONALConceptExtensionData* setLastExaminedLinkedSuccessorData(CSaturationSuccessorData* lastExaminedLinkedSucc); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CRole* mRole; CIndividualSaturationProcessNode* mLastResolvedIndiProcSatNode; CSaturationSuccessorData* mLastExaminedLinkedSucc; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORFUNCTIONALCONCEPTEXTENSIONDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceMap.h0000644000175000017500000002353112520551114030140 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUESPACEMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUESPACEMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeRealValueData.h" #include "CDatatypeRealValueSpaceMapData.h" #include "CDatatypeRealValueSpaceMapArranger.h" #include "CClashedDependencyDescriptor.h" #include "CDatatypeValueSpaceValuesCounter.h" #include "CDatatypeValueSpaceRealValuesCounter.h" #include "CDatatypeValueSpaceDependencyCollector.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceType.h" #include "Reasoner/Ontology/CDatatypeValueSpaceRealType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeRealValueSpaceMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeRealValueSpaceMap : public CPROCESSMAP { // public methods public: //! Constructor CDatatypeRealValueSpaceMap(CProcessContext* processContext); CDatatypeRealValueSpaceMap* initDatatypeRealValueSpaceMap(CDatatypeRealValueSpaceMap* map); CDatatypeRealValueSpaceMap* initDatatypeRealValueSpaceMap(CDatatypeValueSpaceRealType* valueSpaceType); bool hasExcludedMinimum(CDataLiteralRealValue* value, bool valueInclusively, CDatatypeRealValueExclusionType* exclusionType); bool hasExcludedMaximum(CDataLiteralRealValue* value, bool valueInclusively, CDatatypeRealValueExclusionType* exclusionType); bool isValueExcluded(CDataLiteralRealValue* value, CDatatypeRealValueExclusionType* exclusionType); bool restrictToValue(CDataLiteralRealValue* value, CDependencyTrackPoint* depTrackPoint); bool excludeMinimum(CDataLiteralRealValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint); bool excludeMaximum(CDataLiteralRealValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint); bool excludeMinimum(CDataLiteralRealValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType); bool excludeMaximum(CDataLiteralRealValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType); bool excludeValue(CDataLiteralRealValue* value, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType = nullptr); bool excludeInterval(CDataLiteralRealValue* leftValue, bool leftValueInclusive, CDataLiteralRealValue* rightValue, bool rightValueInclusive, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType = nullptr); bool excludeAll(CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType = nullptr); bool restrictToIntegerValues(CDependencyTrackPoint* depTrackPoint); bool restrictToNonIntegerValues(CDependencyTrackPoint* depTrackPoint); bool restrictToDecimalValues(CDependencyTrackPoint* depTrackPoint); bool restrictToNonDecimalValues(CDependencyTrackPoint* depTrackPoint); bool restrictToRationalValues(CDependencyTrackPoint* depTrackPoint); bool restrictToNonRationalValues(CDependencyTrackPoint* depTrackPoint); bool testValueSpaceReturnClashed(); bool addValueSpaceDependencies(CDatatypeValueSpaceDependencyCollector* depCollector); bool getAbsoluteMinimumValue(CDataLiteralRealValue*& minValue, bool& minValueInclusive, CDependencyTrackPoint** depTrackPoint = nullptr); bool getAbsoluteMaximumValue(CDataLiteralRealValue*& maxValue, bool& maxValueInclusive, CDependencyTrackPoint** depTrackPoint = nullptr); bool countAllValues(CDatatypeValueSpaceValuesCounter* counter); bool countIntervalValues(CDataLiteralRealValue* leftValue, bool leftValueInclusive, CDataLiteralRealValue* rightValue, bool rightValueInclusive, CDatatypeValueSpaceValuesCounter* counter); bool countValueValues(CDataLiteralRealValue* value, CDatatypeValueSpaceValuesCounter* counter); bool addIntervalExclusionDependencies(CDataLiteralRealValue* leftValue, bool leftValueInclusive, CDataLiteralRealValue* rightValue, bool rightValueInclusive, CDatatypeValueSpaceDependencyCollector* depCollector); bool addValueExclusionDependencies(CDataLiteralRealValue* value, CDatatypeValueSpaceDependencyCollector* depCollector); bool getNextPossibleDataValue(CDataLiteralRealValue* nextValue, CDataLiteralRealValue* lastValue); // protected methods protected: bool adaptNewRealValueDataToNeighbours(CDatatypeRealValueData* valueData); CDatatypeRealValueData* getDatatypeRealValueData(CDataLiteralRealValue* value, bool createOrLocalize = false, bool* newValueInsertion = nullptr); CDatatypeRealValueData* getDatatypeRealValueData(CDataLiteralRealValue* value, CDatatypeRealValueSpaceMapData& valueMapData, bool createOrLocalize, bool* newValueInsertion); bool isDataIntervalExcluded(CDatatypeRealValueData* leftValueExcluded, CDatatypeRealValueData* rightValueExcluded, CDatatypeRealValueExclusionType* exclusionType); bool isDataIntervalExcluded(CDataLiteralRealValue* leftValueExcluded, CDatatypeRealValueData* rightValueExcluded, CDatatypeRealValueExclusionType* exclusionType); bool isDataIntervalExcluded(CDatatypeRealValueData* leftValueExcluded, CDataLiteralRealValue* rightValueExcluded, CDatatypeRealValueExclusionType* exclusionType); bool containsIntervalIntegers(CDataLiteralRealValue* leftValueExcluded, CDataLiteralRealValue* rightValueExcluded, cint64 requiredIntegerCount = 1); bool isLeftDataIntervalExcluded(CDatatypeRealValueData* dataValue, CDatatypeRealValueExclusionType* exclusionType); bool isRightDataIntervalExcluded(CDatatypeRealValueData* dataValue, CDatatypeRealValueExclusionType* exclusionType); bool isDataValueExcluded(CDatatypeRealValueData* dataValue, CDatatypeRealValueExclusionType* exclusionType); bool isDataValueExcluded(CDataLiteralRealValue* dataValue, CDatatypeRealValueExclusionType* exclusionType); bool excludeData(CDatatypeRealValueDataExclusion* exlcusionData, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType, bool force); bool excludeDataValue(CDatatypeRealValueData* dataValue, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType, bool force); bool excludeLeftDataInterval(CDatatypeRealValueData* dataValue, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType, bool force); bool excludeRightDataInterval(CDatatypeRealValueData* dataValue, CDependencyTrackPoint* depTrackPoint, CDatatypeRealValueExclusionType* exclusionType, bool force); bool addDataValueExclusionDependencies(CDatatypeRealValueData* dataValue, CDatatypeValueSpaceDependencyCollector* depCollector); bool addDataIntervalExclusionDependencies(CDatatypeRealValueData* leftValueExcluded, CDatatypeRealValueData* rightValueExcluded, CDatatypeValueSpaceDependencyCollector* depCollector); bool addLeftIntervalExclusionDependencies(CDatatypeRealValueData* valueData, CDatatypeValueSpaceDependencyCollector* depCollector); bool addRightIntervalExclusionDependencies(CDatatypeRealValueData* valueData, CDatatypeValueSpaceDependencyCollector* depCollector); bool addExclusionDependencies(CDatatypeRealValueDataExclusion* exclusionData, CDatatypeValueSpaceDependencyCollector* depCollector); bool countDataIntervalValues(CDataLiteralRealValue* leftValueExcluded, CDataLiteralRealValue* rightValueExcluded, CDatatypeRealValueDataExclusion* exlcusionData, CDatatypeValueSpaceValuesCounter* counter); bool countDataIntervalValues(CDatatypeRealValueData* leftValueExcluded, CDatatypeRealValueData* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter); bool countDataIntervalValues(CDataLiteralRealValue* leftValueExcluded, CDatatypeRealValueData* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter); bool countDataIntervalValues(CDatatypeRealValueData* leftValueExcluded, CDataLiteralRealValue* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter); bool countDataValue(CDataLiteralRealValue* value, CDatatypeRealValueDataExclusion* exlcusionData, CDatatypeValueSpaceValuesCounter* counter); bool countDataValue(CDatatypeRealValueData* dataValue, CDatatypeValueSpaceValuesCounter* counter); // protected variables protected: CProcessContext* mProcessContext; CDatatypeRealValueData* mAbsoluteMinimumExclusionValue; CDatatypeRealValueData* mAbsoluteMaximumExclusionValue; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUESPACEMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingTag.h0000644000175000017500000000510512520551136025723 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGTAG_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGTAG_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessTag.h" #include "CProcessTagger.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CProcessingTag * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessingTag : public CProcessTag { // public methods public: //! Constructor CProcessingTag(cint64 processingTag = 0); //! Destructor virtual ~CProcessingTag(); cint64 getProcessingTag(); CProcessingTag* setProcessingTag(cint64 processingTag); CProcessingTag* setProcessingTag(CProcessTagger* processTagger); CProcessingTag* initProcessingTag(cint64 processingTag); CProcessingTag* initProcessingTag(CProcessTagger* processTagger); bool updateProcessingTag(cint64 processingTag); bool updateProcessingTag(CProcessTagger* processTagger); bool isProcessingTagUpdated(cint64 processingTag); bool isProcessingTagUpToDate(cint64 processingTag); bool isProcessingTagUpdated(CProcessTagger* processTagger); bool isProcessingTagUpToDate(CProcessTagger* processTagger); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGTAG_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativePropagationSet.h0000644000175000017500000001050412520551144031031 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEPROPAGATIONSET_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEPROPAGATIONSET_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "CRepresentativePropagationMap.h" #include "CRepresentativePropagationMapData.h" #include "CRepresentativePropagationDescriptor.h" #include "CRepresentativeVariableBindingPathSetData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativePropagationSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativePropagationSet { // public methods public: //! Constructor CRepresentativePropagationSet(CProcessContext* processContext); CRepresentativePropagationSet* initRepresentativePropagationSet(CRepresentativePropagationSet* prevSet); CRepresentativePropagationMap* getRepresentativePropagationMap(); bool containsRepresentativePropagation(CRepresentativeVariableBindingPathSetData* repRepPropSetData); bool containsRepresentativePropagation(cint64 repID); CRepresentativePropagationDescriptor* getRepresentativePropagationDescriptor(CRepresentativeVariableBindingPathSetData* repRepPropSetData); CRepresentativePropagationSet* addIncomingRepresentativePropagation(CRepresentativePropagationDescriptor* repPropDes); CRepresentativePropagationSet* copyRepresentativePropagations(CRepresentativePropagationMap* repPropMap); CConceptDescriptor* getConceptDescriptor(); CRepresentativePropagationSet* setConceptDescriptor(CConceptDescriptor* conDes); CRepresentativePropagationSet* addIncomingRepresentativePropagationDescriptorLinker(CRepresentativePropagationDescriptor* repPropDesLinker); CRepresentativePropagationDescriptor* getIncomingRepresentativePropagationDescriptorLinker(); CRepresentativePropagationSet* setOutgoingRepresentativePropagationDescriptorLinker(CRepresentativePropagationDescriptor* repPropDesLinker); CRepresentativePropagationSet* addOutgoingRepresentativePropagationDescriptorLinker(CRepresentativePropagationDescriptor* repPropDesLinker); CRepresentativePropagationDescriptor* getOutgoingRepresentativePropagationDescriptorLinker(); cint64 getIncomingRepresentativePropagationSignatureKey(); CRepresentativePropagationDescriptor* getLastProcessedIncomingRepresentativePropagationDescriptorLinker(); CRepresentativePropagationSet* setLastProcessedIncomingRepresentativePropagationDescriptorLinker(CRepresentativePropagationDescriptor* descriptor); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CRepresentativePropagationMap mRepPropMap; CConceptDescriptor* mConceptDescriptor; CRepresentativePropagationDescriptor* mIncomingRepPropDesLinker; CRepresentativePropagationDescriptor* mOutgoingRepPropDesLinker; CRepresentativeVariableBindingPathSetDataSignature mIncomingRepPropSignature; CRepresentativePropagationDescriptor* mLastProcessedIncomingRepPropDesLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEPROPAGATIONSET_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptLabelSet.h0000644000175000017500000000666012520551076026174 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTLABELSET_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTLABELSET_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptorDependencyPair.h" #include "CProcessContext.h" #include "CConceptLabelSetIterator.h" #include "CClashedConceptDescriptor.h" #include "CConceptSetSignature.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConceptLabelSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptLabelSet { // public methods public: //! Constructor CConceptLabelSet(CProcessContext* processContext = nullptr); //! Destructor virtual ~CConceptLabelSet(); CConceptLabelSet* initConceptLabelSet(CConceptLabelSet* prevConceptLabelSet); cint64 getConceptCount(); bool hasConceptDescriptor(CConceptDescriptor* conceptDescriptor); bool hasConcept(CConcept* concept, bool negated); bool hasConcept(CConcept* concept, bool* containsNegated = nullptr); bool containsConcept(CConcept* concept, bool* containsNegated = nullptr); bool containsConcept(CConcept* concept, bool negated); bool containsConceptDescriptor(CConceptDescriptor* conceptDescriptor); CClashedConceptDescriptor* insertConceptReturnClash(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint); CConceptLabelSet* insertConceptThrowClash(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint); CConceptLabelSet* updateConceptDependencyTrackPoint(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* updateDepTrackPoint); CConceptLabelSetIterator getConceptLabelSetIterator(bool getSorted = false, bool getDependencies = false); CConceptSetSignature* getConceptSignature(); cint64 getConceptSignatureValue(); // protected methods protected: // protected variables protected: CPROCESSMAP mConceptDesDepMap; CConceptDescriptor* mConceptDesLinker; CConceptDescriptor* mPrevConceptDesLinker; CConceptSetSignature mConceptSignature; cint64 mConceptCount; CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTLABELSET_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingDescriptor.cpp0000644000175000017500000000313212520551136031321 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPropagationBindingDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CPropagationBindingDescriptor::CPropagationBindingDescriptor() : CLinkerBase(this) { } CPropagationBinding* CPropagationBindingDescriptor::getPropagationBinding() { return mPropBinding; } CPropagationBindingDescriptor* CPropagationBindingDescriptor::initPropagationBindingDescriptor(CPropagationBinding* propBinding, CDependencyTrackPoint* dependencyTrackPoint) { initDependencyTracker(dependencyTrackPoint); mPropBinding = propBinding; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningData.h0000644000175000017500000000465512520551144030273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CRepresentativeJoiningCommonKeyMap.h" #include "CRepresentativeJoiningAllDataExtension.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Utilities/CSortedLinker.hpp" #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRepresentativeJoiningData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeJoiningData { // public methods public: //! Constructor CRepresentativeJoiningData(CProcessContext* processContext = nullptr); CRepresentativeJoiningCommonKeyMap* getRepresentativeJoiningCommonKeyMap(); CRepresentativeJoiningAllDataExtension* getJoiningAllExtension(bool create = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CRepresentativeJoiningCommonKeyMap mJoiningCommonKeyMap; CRepresentativeJoiningAllDataExtension* mJoiningAllExtension; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualMergingHash.cpp0000644000175000017500000000267712520551122027721 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualMergingHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualMergingHash::CIndividualMergingHash(CProcessContext* processContext) : CPROCESSHASH(processContext) { } CIndividualMergingHash* CIndividualMergingHash::initIndividualMergingHash(CIndividualMergingHash* indiMergingHash) { if (indiMergingHash) { *this = *indiMergingHash; } else { this->clear(); } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualConceptBatchProcessingQueue.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualConceptBatchProcessingQueue0000644000175000017500000001025112520551120032324 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALCONCEPTBATCHPROCESSINGQUEUE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALCONCEPTBATCHPROCESSINGQUEUE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualConceptBatchProcessingData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualConceptBatchProcessingQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualConceptBatchProcessingQueue { // public methods public: //! Constructor CIndividualConceptBatchProcessingQueue(CProcessContext* processContext); CIndividualConceptBatchProcessingQueue* initProcessingQueue(CIndividualConceptBatchProcessingQueue* processingQueue); bool takeNextConceptProcessIndividual(CConcept*& concept, CIndividualProcessNode*& indiNode, CConceptProcessDescriptor*& conProDes); CIndividualConceptBatchProcessingQueue* insertIndiviudalForConcept(CConcept* concept, CIndividualProcessNode* individual, CConceptProcessDescriptor* conProDes); CIndividualConceptBatchProcessingQueue* insertIndiviudalForBindingCount(CConcept* concept, cint64 bindCount, CIndividualProcessNode* individual, CConceptProcessDescriptor* conProDes); bool isEmpty(); CIndividualConceptBatchProcessingData* getBatchProcessingData(CConcept* concept, bool createAndLocalize = true); CIndividualConceptBatchProcessingData* getBatchProcessingData(CConcept* concept, cint64 bindCount, bool createAndLocalize = true); // protected methods protected: // protected variables protected: class CIndividualConceptBatchProcessingQueueData { public: inline CIndividualConceptBatchProcessingQueueData() { mUseProcData = nullptr; mLocProcData = nullptr; } inline CIndividualConceptBatchProcessingQueueData(const CIndividualConceptBatchProcessingQueueData& data) { mUseProcData = data.mUseProcData; mLocProcData = nullptr; } CIndividualConceptBatchProcessingData* mUseProcData; CIndividualConceptBatchProcessingData* mLocProcData; }; CProcessContext* mProcessContext; cint64 mCurrentProcessingTag; CIndividualConceptBatchProcessingData* mUseCurrentProcessingQueue; CIndividualConceptBatchProcessingData* mLocCurrentProcessingQueue; CPROCESSMAP mConceptIndiQueueMap; CPROCESSMAP mBindCountIndiQueueMap; class CIndividualConceptQueuedData { public: inline CIndividualConceptQueuedData(bool queued = false, cint64 prevTag = 0) { mPrevTag = prevTag; mQueued = queued; } cint64 mPrevTag; bool mQueued; }; cint64 mBindindBasedQueuedCount; CPROCESSHASH< QPair,CIndividualConceptQueuedData > mBindCountIndiQueuedHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALCONCEPTBATCHPROCESSINGQUEUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReferredIndividualTrackingVector.cpp0000644000175000017500000001575012520551142032127 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReferredIndividualTrackingVector.h" #include "Reasoner/Kernel/Task/CIncrementalConsistenceTaskData.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Task; namespace Process { CReferredIndividualTrackingVector::CReferredIndividualTrackingVector() { mIndiTrackCount = 0; mIndiTrackVector = nullptr; } CReferredIndividualTrackingVector::~CReferredIndividualTrackingVector() { delete [] mIndiTrackVector; } CReferredIndividualTrackingVector* CReferredIndividualTrackingVector::initReferredIndividualTrackingVector(cint64 indiCount) { mIndiTrackVector = new CReferredIndividualTrackingData[indiCount]; mIndiTrackCount = indiCount; return this; } CReferredIndividualTrackingVector* CReferredIndividualTrackingVector::initReferredIndividualTrackingVector(CReferredIndividualTrackingVector* indiTrackVec) { mIndiTrackCount = indiTrackVec->mIndiTrackCount; mIndiTrackVector = new CReferredIndividualTrackingData[mIndiTrackCount]; for (cint64 i = 0; i < mIndiTrackCount; ++i) { CReferredIndividualTrackingData* refIndiTrackData = &indiTrackVec->mIndiTrackVector[i]; CReferredIndividualTrackingData* indiTrackData = &mIndiTrackVector[i]; *indiTrackData = *refIndiTrackData; } return this; } CReferredIndividualTrackingData* CReferredIndividualTrackingVector::getReferredIndividualTrackingData(cint64 indiID) { if (indiID >= 0 && indiID < mIndiTrackCount) { return &mIndiTrackVector[indiID]; } return nullptr; } CReferredIndividualTrackingVector* CReferredIndividualTrackingVector::setIndividualReferred(cint64 indiID) { CReferredIndividualTrackingData* indTrackData = getReferredIndividualTrackingData(indiID); if (indTrackData && !indTrackData->isReferred()) { indTrackData->setReferred(); } return this; } CReferredIndividualTrackingVector* CReferredIndividualTrackingVector::setIndividualReferredAndExtended(cint64 indiID) { CReferredIndividualTrackingData* indTrackData = getReferredIndividualTrackingData(indiID); if (indTrackData && (!indTrackData->isExtended() || !indTrackData->isReferred())) { indTrackData->setReferred(); indTrackData->setExtended(); } return this; } bool CReferredIndividualTrackingVector::mergeGatheredTrackedIndividualDependences(CIndividualDependenceTracking* indiDepTracking) { CReferredIndividualTrackingVector* mergeRefIndiTrackVec = dynamic_cast(indiDepTracking); if (mergeRefIndiTrackVec) { if (mergeRefIndiTrackVec->mIndiTrackVector) { for (cint64 i = 0; i = mergeRefIndiTrackVec->mIndiTrackCount; ++i) { CReferredIndividualTrackingData* mergeIndiTrackData = &mergeRefIndiTrackVec->mIndiTrackVector[i]; CReferredIndividualTrackingData* indiTrackData = &mIndiTrackVector[i]; if (!indiTrackData->isExtended() && mergeIndiTrackData->isExtended()) { indiTrackData->setExtended(); } if (!indiTrackData->isReferred() && mergeIndiTrackData->isReferred()) { indiTrackData->setReferred(); } } } return true; } return false; } bool CReferredIndividualTrackingVector::areIndividualsAffected(QSet* indirectlyChangedIndividualSet, QSet* changedCompatibleSet) { for (QSet::const_iterator it = indirectlyChangedIndividualSet->constBegin(), itEnd = indirectlyChangedIndividualSet->constEnd(); it != itEnd; ++it) { cint64 indiID(*it); if (indiID < mIndiTrackCount) { CReferredIndividualTrackingData* indiTrackData = &mIndiTrackVector[indiID]; if (indiTrackData) { if (indiTrackData->isExtended()) { return true; } if (indiTrackData->isReferred() && !changedCompatibleSet->contains(indiID)) { return true; } } } } return false; } bool CReferredIndividualTrackingVector::areIndividualsAffected(CConsistenceData* consData) { CIncrementalConsistenceTaskData* incConsTaskData = dynamic_cast(consData); if (incConsTaskData) { //QSet* indirectlyChangedIndividualSet = incConsTaskData->getIndirectlyChangedNodeSet(); //QSet* changedCompatibleSet = incConsTaskData->getChangedCompatibleNodeSet(); //for (QSet::const_iterator it = indirectlyChangedIndividualSet->constBegin(), itEnd = indirectlyChangedIndividualSet->constEnd(); it != itEnd; ++it) { // cint64 indiID(*it); // if (indiID < mIndiTrackCount) { // CReferredIndividualTrackingData* indiTrackData = &mIndiTrackVector[indiID]; // if (indiTrackData) { // if (indiTrackData->isExtended()) { // CIndividualProcessNode* indiNode = incConsTaskData->getCompletionGraphCachedSatisfiableTask()->getProcessingDataBox()->getIndividualProcessNodeVector()->getData(indiID); // return true; // } // if (indiTrackData->isReferred() && !changedCompatibleSet->contains(indiID)) { // CIndividualProcessNode* indiNode = incConsTaskData->getCompletionGraphCachedSatisfiableTask()->getProcessingDataBox()->getIndividualProcessNodeVector()->getData(indiID); // return true; // } // } // } //} return areIndividualsAffected(incConsTaskData->getIndirectlyChangedNodeSet(),incConsTaskData->getChangedCompatibleNodeSet()); } return true; } CIndividualDependenceTracking* CReferredIndividualTrackingVector::getCopiedIndividualDependencyTracking() { CReferredIndividualTrackingVector* indTrackVecCopy = new CReferredIndividualTrackingVector(); indTrackVecCopy->initReferredIndividualTrackingVector(this); return indTrackVecCopy; } cint64 CReferredIndividualTrackingVector::getDependenceSize() { cint64 depCount = 0; for (cint64 i = 0; i < mIndiTrackCount; ++i) { CReferredIndividualTrackingData* indiTrackData = &mIndiTrackVector[i]; if (indiTrackData->isReferred()) { ++depCount; } } return depCount; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceRealValuesCounter.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceRealValuesCounter.c0000644000175000017500000001675712520551116032233 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceRealValuesCounter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeValueSpaceRealValuesCounter::CDatatypeValueSpaceRealValuesCounter() { initRealValueCounter(); } CDatatypeValueSpaceRealValuesCounter* CDatatypeValueSpaceRealValuesCounter::initRealValueCounter(cint64 valueCount) { initValueCounter(valueCount); mIntegerTypeCounter.initValueCounter(valueCount); mDecimalTypeCounter.initValueCounter(valueCount); mRationalTypeCounter.initValueCounter(valueCount); mNonIntegerTypeCounter.initValueCounter(valueCount); mNonDecimalTypeCounter.initValueCounter(valueCount); mNonRationalTypeCounter.initValueCounter(valueCount); return this; } bool CDatatypeValueSpaceRealValuesCounter::incValueCount(cint64 type, cint64 incCount) { bool counted = false; if ((type & RVT_INTEGER_ONLY_COUNT) != 0) { counted |= mIntegerTypeCounter.incValueCount(incCount); } if ((type & RVT_DECIMAL_ONLY_COUNT) != 0) { counted |= mDecimalTypeCounter.incValueCount(incCount); } if ((type & RVT_RATIONAL_ONLY_COUNT) != 0) { counted |= mRationalTypeCounter.incValueCount(incCount); } if ((type & RVT_NON_INTEGER_ONLY_COUNT) != 0) { counted |= mNonIntegerTypeCounter.incValueCount(incCount); } if ((type & RVT_NON_DECIMAL_ONLY_COUNT) != 0) { counted |= mNonDecimalTypeCounter.incValueCount(incCount); } if ((type & RVT_NON_RATIONAL_ONLY_COUNT) != 0) { counted |= mNonRationalTypeCounter.incValueCount(incCount); } return counted; } bool CDatatypeValueSpaceRealValuesCounter::incInfinite(cint64 type) { bool counted = false; if ((type & RVT_INTEGER_ONLY_COUNT) != 0) { counted |= mIntegerTypeCounter.incInfinite(); } if ((type & RVT_DECIMAL_ONLY_COUNT) != 0) { counted |= mDecimalTypeCounter.incInfinite(); } if ((type & RVT_RATIONAL_ONLY_COUNT) != 0) { counted |= mRationalTypeCounter.incInfinite(); } if ((type & RVT_NON_INTEGER_ONLY_COUNT) != 0) { counted |= mNonIntegerTypeCounter.incInfinite(); } if ((type & RVT_NON_DECIMAL_ONLY_COUNT) != 0) { counted |= mNonDecimalTypeCounter.incInfinite(); } if ((type & RVT_NON_RATIONAL_ONLY_COUNT) != 0) { counted |= mNonRationalTypeCounter.incInfinite(); } return counted; } bool CDatatypeValueSpaceRealValuesCounter::isInfinite(cint64 type) { bool infinite = true; if ((type & RVT_INTEGER_ONLY_COUNT) != 0) { infinite &= mIntegerTypeCounter.isInfinite(); } if ((type & RVT_DECIMAL_ONLY_COUNT) != 0) { infinite &= mDecimalTypeCounter.isInfinite(); } if ((type & RVT_RATIONAL_ONLY_COUNT) != 0) { infinite &= mRationalTypeCounter.isInfinite(); } if ((type & RVT_NON_INTEGER_ONLY_COUNT) != 0) { infinite &= mNonIntegerTypeCounter.isInfinite(); } if ((type & RVT_NON_DECIMAL_ONLY_COUNT) != 0) { infinite &= mNonDecimalTypeCounter.isInfinite(); } if ((type & RVT_NON_RATIONAL_ONLY_COUNT) != 0) { infinite &= mNonRationalTypeCounter.isInfinite(); } return infinite; } cint64 CDatatypeValueSpaceRealValuesCounter::getValueCount(cint64 type) { cint64 valueCount = true; if ((type & RVT_INTEGER_ONLY_COUNT) != 0) { valueCount += mIntegerTypeCounter.getValueCount(); } if ((type & RVT_DECIMAL_ONLY_COUNT) != 0) { valueCount += mDecimalTypeCounter.getValueCount(); } if ((type & RVT_RATIONAL_ONLY_COUNT) != 0) { valueCount += mRationalTypeCounter.getValueCount(); } if ((type & RVT_NON_INTEGER_ONLY_COUNT) != 0) { valueCount += mNonIntegerTypeCounter.getValueCount(); } if ((type & RVT_NON_DECIMAL_ONLY_COUNT) != 0) { valueCount += mNonDecimalTypeCounter.getValueCount(); } if ((type & RVT_NON_RATIONAL_ONLY_COUNT) != 0) { valueCount += mNonRationalTypeCounter.getValueCount(); } return valueCount; } bool CDatatypeValueSpaceRealValuesCounter::hasValueAchieved(cint64 value) { return CDatatypeValueSpaceValuesCounter::hasValueAchieved(value); } cint64 CDatatypeValueSpaceRealValuesCounter::getValueCount() { return CDatatypeValueSpaceValuesCounter::getValueCount(); } bool CDatatypeValueSpaceRealValuesCounter::isInfinite() { return CDatatypeValueSpaceValuesCounter::isInfinite(); } bool CDatatypeValueSpaceRealValuesCounter::hasValueAchieved(cint64 type, cint64 value) { bool achieved = true; if ((type & RVT_INTEGER_ONLY_COUNT) != 0) { achieved &= mIntegerTypeCounter.hasValueAchieved(value); } if ((type & RVT_DECIMAL_ONLY_COUNT) != 0) { achieved &= mDecimalTypeCounter.hasValueAchieved(value); } if ((type & RVT_RATIONAL_ONLY_COUNT) != 0) { achieved &= mRationalTypeCounter.hasValueAchieved(value); } if ((type & RVT_NON_INTEGER_ONLY_COUNT) != 0) { achieved &= mNonIntegerTypeCounter.hasValueAchieved(value); } if ((type & RVT_NON_DECIMAL_ONLY_COUNT) != 0) { achieved &= mNonDecimalTypeCounter.hasValueAchieved(value); } if ((type & RVT_NON_RATIONAL_ONLY_COUNT) != 0) { achieved &= mNonRationalTypeCounter.hasValueAchieved(value); } return achieved; } CDatatypeValueSpaceValuesCounter::VALUES_COUNTER_TYPE CDatatypeValueSpaceRealValuesCounter::getCounterType() { return VCT_REAL_VALUE_COUNTER; } bool CDatatypeValueSpaceRealValuesCounter::combineWithValueCounter(CDatatypeValueSpaceValuesCounter* counter, cint64 additionalDiff) { bool modified = false; modified |= CDatatypeValueSpaceValuesCounter::combineWithValueCounter(counter,additionalDiff); CDatatypeValueSpaceRealValuesCounter* realCounter = dynamic_cast(counter); if (realCounter) { modified |= mIntegerTypeCounter.combineWithValueCounter(&realCounter->mIntegerTypeCounter,additionalDiff); modified |= mDecimalTypeCounter.combineWithValueCounter(&realCounter->mDecimalTypeCounter,additionalDiff); modified |= mRationalTypeCounter.combineWithValueCounter(&realCounter->mRationalTypeCounter,additionalDiff); modified |= mNonIntegerTypeCounter.combineWithValueCounter(&realCounter->mNonIntegerTypeCounter,additionalDiff); modified |= mNonDecimalTypeCounter.combineWithValueCounter(&realCounter->mNonDecimalTypeCounter,additionalDiff); modified |= mNonRationalTypeCounter.combineWithValueCounter(&realCounter->mNonRationalTypeCounter,additionalDiff); } return modified; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetH0000644000175000017500000002554612520551146032303 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathSetHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathSetHash::CRepresentativeVariableBindingPathSetHash(CProcessContext* processContext) : mProcessContext(processContext),CPROCESSHASH(processContext) { } CRepresentativeVariableBindingPathSetHash* CRepresentativeVariableBindingPathSetHash::initRepresentativeVariableBindingPathSetHash(CRepresentativeVariableBindingPathSetHash* prevMap) { if (prevMap) { *this = *prevMap; } else { CPROCESSHASH::clear(); } return this; } CRepresentativeVariableBindingPathSetHash* CRepresentativeVariableBindingPathSetHash::insertRepresentativeVariableBindingPathSetData(CRepresentativeVariableBindingPathSetData* repSetData) { cint64 key = repSetData->getRepresentativeKey(); CRepresentativeVariableBindingPathSetHashData& data = CPROCESSHASH::operator[](key); data.mLocDataLinker = repSetData->append(data.mUseDataLinker); data.mUseDataLinker = data.mLocDataLinker; return this; } CRepresentativeVariableBindingPathSetData* CRepresentativeVariableBindingPathSetHash::getRepresentativeVariableBindingPathSetData(CRepresentativeVariableBindingPathSetData* repSetData, bool createOrLocalize) { CRepresentativeVariableBindingPathSetData* repData = nullptr; cint64 key = repSetData->getRepresentativeKey(); if (createOrLocalize) { CRepresentativeVariableBindingPathSetHashData& data = CPROCESSHASH::operator[](key); CRepresentativeVariableBindingPathSetData* foundDataLinker = nullptr; for (CRepresentativeVariableBindingPathSetData* dataLinkerIt = data.mUseDataLinker; dataLinkerIt && !foundDataLinker; dataLinkerIt = dataLinkerIt->getNext()) { if (dataLinkerIt->getRepresentativeID() == repSetData->getRepresentativeID()) { foundDataLinker = dataLinkerIt; } } CRepresentativeVariableBindingPathSetData* incLocDataLinker = nullptr; if (foundDataLinker) { incLocDataLinker = foundDataLinker; } if (incLocDataLinker) { CRepresentativeVariableBindingPathSetData* returnDataLinker = nullptr; CRepresentativeVariableBindingPathSetData* nextIncLocDataLinker = incLocDataLinker->getNext(); CRepresentativeVariableBindingPathSetData* newLocDataLinker = nullptr; CRepresentativeVariableBindingPathSetData* lastNewLocDataLinker = nullptr; for (CRepresentativeVariableBindingPathSetData* dataLinkerIt = data.mUseDataLinker; dataLinkerIt != nextIncLocDataLinker; dataLinkerIt = dataLinkerIt->getNext()) { CRepresentativeVariableBindingPathSetData* locLinker = dataLinkerIt; if (!dataLinkerIt->isLocalizationTagUpToDate(mProcessContext->getProcessTagger())) { locLinker = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); locLinker->initRepresentativeVariableBindingPathData(dataLinkerIt); } if (dataLinkerIt == incLocDataLinker) { returnDataLinker = locLinker; } if (lastNewLocDataLinker) { lastNewLocDataLinker->setNext(locLinker); lastNewLocDataLinker = locLinker; } else { lastNewLocDataLinker = locLinker; newLocDataLinker = locLinker; } } data.mLocDataLinker = newLocDataLinker; data.mUseDataLinker = newLocDataLinker; return returnDataLinker; } else { CRepresentativeVariableBindingPathSetData* locLinker = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); locLinker->initRepresentativeVariableBindingPathData(nullptr); locLinker->setNext(data.mUseDataLinker); data.mLocDataLinker = locLinker; data.mUseDataLinker = locLinker; return data.mLocDataLinker; } } else { const CRepresentativeVariableBindingPathSetHashData& data = CPROCESSHASH::value(key); for (CRepresentativeVariableBindingPathSetData* dataLinkerIt = data.mUseDataLinker; dataLinkerIt; dataLinkerIt = dataLinkerIt->getNext()) { if (dataLinkerIt->getRepresentativeID() == repSetData->getRepresentativeID()) { return dataLinkerIt; } } } return nullptr; } CRepresentativeVariableBindingPathSetData* CRepresentativeVariableBindingPathSetHash::getRepresentativeVariableBindingPathSetData(CRepresentativePropagationSet* repPropSet, bool createOrLocalize) { CRepresentativeVariableBindingPathSetData* repData = nullptr; cint64 key = repPropSet->getIncomingRepresentativePropagationSignatureKey(); if (createOrLocalize) { CRepresentativeVariableBindingPathSetHashData& data = CPROCESSHASH::operator[](key); CRepresentativeVariableBindingPathSetData* selectedDataLinker = nullptr; CRepresentativeVariableBindingPathSetData* foundDataLinker = nullptr; for (CRepresentativeVariableBindingPathSetData* dataLinkerIt = data.mUseDataLinker; dataLinkerIt && !foundDataLinker; dataLinkerIt = dataLinkerIt->getNext()) { if (!dataLinkerIt->hasMigrateData()) { if (!selectedDataLinker) { selectedDataLinker = dataLinkerIt; } } else { // test identical CRepresentativeVariableBindingPathSetMigrateData* migrateData = dataLinkerIt->getMigrateData(false); CRepresentativeContainingMap* repContMap = migrateData->getRepresentativeContainingMap(); CRepresentativePropagationMap* repPropMap = repPropSet->getRepresentativePropagationMap(); if (isRepresentativePropagationMapIdenticalToRepresentativeContainingMap(repPropMap,repContMap)) { foundDataLinker = dataLinkerIt; } } } CRepresentativeVariableBindingPathSetData* incLocDataLinker = nullptr; if (foundDataLinker) { incLocDataLinker = foundDataLinker; } else if (selectedDataLinker) { incLocDataLinker = selectedDataLinker; } if (incLocDataLinker) { CRepresentativeVariableBindingPathSetData* returnDataLinker = nullptr; CRepresentativeVariableBindingPathSetData* nextIncLocDataLinker = incLocDataLinker->getNext(); CRepresentativeVariableBindingPathSetData* newLocDataLinker = nullptr; CRepresentativeVariableBindingPathSetData* lastNewLocDataLinker = nullptr; for (CRepresentativeVariableBindingPathSetData* dataLinkerIt = data.mUseDataLinker; dataLinkerIt != nextIncLocDataLinker; dataLinkerIt = dataLinkerIt->getNext()) { CRepresentativeVariableBindingPathSetData* locLinker = dataLinkerIt; if (!dataLinkerIt->isLocalizationTagUpToDate(mProcessContext->getProcessTagger())) { locLinker = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); locLinker->initRepresentativeVariableBindingPathData(dataLinkerIt); } if (dataLinkerIt == incLocDataLinker) { returnDataLinker = locLinker; } if (lastNewLocDataLinker) { lastNewLocDataLinker->setNext(locLinker); lastNewLocDataLinker = locLinker; } else { lastNewLocDataLinker = locLinker; newLocDataLinker = locLinker; } } data.mLocDataLinker = newLocDataLinker; data.mUseDataLinker = newLocDataLinker; return returnDataLinker; } else { CRepresentativeVariableBindingPathSetData* locLinker = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); locLinker->initRepresentativeVariableBindingPathData(nullptr); locLinker->setNext(data.mUseDataLinker); data.mLocDataLinker = locLinker; data.mUseDataLinker = locLinker; return data.mLocDataLinker; } } else { const CRepresentativeVariableBindingPathSetHashData& data = CPROCESSHASH::value(key); for (CRepresentativeVariableBindingPathSetData* dataLinkerIt = data.mUseDataLinker; dataLinkerIt; dataLinkerIt = dataLinkerIt->getNext()) { if (dataLinkerIt->hasMigrateData()) { CRepresentativeVariableBindingPathSetMigrateData* migrateData = dataLinkerIt->getMigrateData(false); CRepresentativeContainingMap* repContMap = migrateData->getRepresentativeContainingMap(); CRepresentativePropagationMap* repPropMap = repPropSet->getRepresentativePropagationMap(); if (isRepresentativePropagationMapIdenticalToRepresentativeContainingMap(repPropMap,repContMap)) { return dataLinkerIt; } } } } return nullptr; } bool CRepresentativeVariableBindingPathSetHash::isRepresentativePropagationMapIdenticalToRepresentativeContainingMap(CRepresentativePropagationMap* repPropMap, CRepresentativeContainingMap* repContMap) { if (repPropMap->count() != repContMap->count()) { return false; } CRepresentativePropagationMap::const_iterator repPropIt = repPropMap->constBegin(), repPropItEnd = repPropMap->constEnd(); CRepresentativeContainingMap::const_iterator repContIt = repContMap->constBegin(), repContItEnd = repContMap->constEnd(); while (repPropIt != repPropItEnd) { if (repPropIt.key() != repContIt.key()) { return false; } ++repPropIt; ++repContIt; } return true; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleBackwardPropagationHash.h0000644000175000017500000000507712520551150030527 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CROLEBACKWARDPROPAGATIONHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CROLEBACKWARDPROPAGATIONHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CBackwardPropagationReapplyDescriptor.h" #include "CBackwardPropagationLink.h" #include "CRoleBackwardPropagationHashData.h" #include "CProcessContext.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRoleBackwardPropagationHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleBackwardPropagationHash { // public methods public: //! Constructor CRoleBackwardPropagationHash(CProcessContext* context = nullptr); CBackwardPropagationReapplyDescriptor* addBackwardPropagationLink(CRole* role, CBackwardPropagationLink* link); CBackwardPropagationLink* addBackwardPropagationConceptDescriptor(CRole* role, CBackwardPropagationReapplyDescriptor* reapplyConDes); CPROCESSHASH* getRoleBackwardPropagationDataHash(); // protected methods protected: // protected variables protected: CProcessContext* mContext; CPROCESSHASH mRoleBackPropDataHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CROLEBACKWARDPROPAGATIONHASH_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathMergingHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathMergingHashData.cp0000644000175000017500000000331212520551164032071 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingPathMergingHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingPathMergingHashData::CVariableBindingPathMergingHashData() { mVariableBindingPath = nullptr; } CVariableBindingPathMergingHashData::CVariableBindingPathMergingHashData(const CVariableBindingPathMergingHashData& data) { mVariableBindingPath = data.mVariableBindingPath; } CVariableBindingPath* CVariableBindingPathMergingHashData::getVariableBindingPath() { return mVariableBindingPath; } CVariableBindingPathMergingHashData* CVariableBindingPathMergingHashData::setVariableBindingPath(CVariableBindingPath* variableBindingPath) { mVariableBindingPath = variableBindingPath; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclued Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSuccessorIterator.h0000644000175000017500000000435112520551162026637 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSUCCESSORITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSUCCESSORITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualLinkEdge.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSuccessorIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSuccessorIterator { // public methods public: //! Constructor CSuccessorIterator(); CSuccessorIterator(const CPROCESSHASH::iterator& beginIt, const CPROCESSHASH::iterator& endIt); bool hasNext(); CIndividualLinkEdge* nextLink(bool moveNext = true); cint64 nextIndividualID(bool moveNext = true); // protected methods protected: // protected variables protected: cint64 mLastSucc; CPROCESSHASH::iterator mBeginIt; CPROCESSHASH::iterator mEndIt; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSUCCESSORITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNodeSwitchTag.cpp0000644000175000017500000000542212520551132026207 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNodeSwitchTag.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CNodeSwitchTag::CNodeSwitchTag(cint64 nodeSwitchTag) : CProcessTag(nodeSwitchTag) { } CNodeSwitchTag::~CNodeSwitchTag() { } cint64 CNodeSwitchTag::getNodeSwitchTag() { return CProcessTag::getProcessTag(); } CNodeSwitchTag* CNodeSwitchTag::setNodeSwitchTag(cint64 nodeSwitchTag) { CProcessTag::setProcessTag(nodeSwitchTag); return this; } CNodeSwitchTag* CNodeSwitchTag::initNodeSwitchTag(cint64 nodeSwitchTag) { CProcessTag::initProcessTag(nodeSwitchTag); return this; } bool CNodeSwitchTag::isNodeSwitchTagUpdated(cint64 nodeSwitchTag) { return CProcessTag::isProcessTagUpdated(nodeSwitchTag); } bool CNodeSwitchTag::isNodeSwitchTagUpToDate(cint64 nodeSwitchTag) { return CProcessTag::isProcessTagUpToDate(nodeSwitchTag); } bool CNodeSwitchTag::updateNodeSwitchTag(cint64 nodeSwitchTag) { return CProcessTag::updateProcessTag(nodeSwitchTag); } CNodeSwitchTag* CNodeSwitchTag::setNodeSwitchTag(CProcessTagger* processTagger) { return setNodeSwitchTag(processTagger->getCurrentNodeSwitchTag()); } CNodeSwitchTag* CNodeSwitchTag::initNodeSwitchTag(CProcessTagger* processTagger) { return initNodeSwitchTag(processTagger->getCurrentNodeSwitchTag()); } bool CNodeSwitchTag::isNodeSwitchTagUpdated(CProcessTagger* processTagger) { return isNodeSwitchTagUpdated(processTagger->getCurrentNodeSwitchTag()); } bool CNodeSwitchTag::isNodeSwitchTagUpToDate(CProcessTagger* processTagger) { return isNodeSwitchTagUpToDate(processTagger->getCurrentNodeSwitchTag()); } bool CNodeSwitchTag::updateNodeSwitchTag(CProcessTagger* processTagger) { return updateNodeSwitchTag(processTagger->getCurrentNodeSwitchTag()); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualProcessNodeLinker.cpp0000644000175000017500000000364112520551126031112 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualProcessNodeLinker::CIndividualProcessNodeLinker() : CNegLinkerBase(nullptr,false) { } CIndividualProcessNodeLinker* CIndividualProcessNodeLinker::initProcessNodeLinker(CIndividualProcessNode *individual, bool processingQueued) { initNegLinker(individual,processingQueued); return this; } CIndividualProcessNode* CIndividualProcessNodeLinker::getProcessingIndividual() { return getData(); } bool CIndividualProcessNodeLinker::isProcessingQueued() { return isNegated(); } CIndividualProcessNodeLinker* CIndividualProcessNodeLinker::clearProcessingQueued() { setNegation(false); return this; } CIndividualProcessNodeLinker* CIndividualProcessNodeLinker::setProcessingQueued(bool processingQueued) { setNegation(true); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandidateIterator.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandid0000644000175000017500000000476412520551160032270 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureBlockingIndividualNodeCandidateIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSignatureBlockingIndividualNodeCandidateIterator::CSignatureBlockingIndividualNodeCandidateIterator(CPROCESSSET* candidateSet) : mCandidateSet(candidateSet) { if (mCandidateSet) { mItBegin = mCandidateSet->begin(); mItEnd = mCandidateSet->end(); mItLast = mItBegin; } } bool CSignatureBlockingIndividualNodeCandidateIterator::hasNext() { return mCandidateSet && mItBegin != mItEnd; } bool CSignatureBlockingIndividualNodeCandidateIterator::hasIndividualCandidates() { return mCandidateSet && !mCandidateSet->isEmpty(); } cint64 CSignatureBlockingIndividualNodeCandidateIterator::next(bool moveNext) { CIndividualProcessNode* indi = nextIndividualCandidate(moveNext); if (indi) { return indi->getIndividualID(); } return 0; } CIndividualProcessNode* CSignatureBlockingIndividualNodeCandidateIterator::nextIndividualCandidate(bool moveNext) { CIndividualProcessNode* indi = nullptr; if (mCandidateSet && mItBegin != mItEnd) { indi = *mItBegin; mItLast = mItBegin; if (moveNext) { ++mItBegin; } } return indi; } bool CSignatureBlockingIndividualNodeCandidateIterator::removeLastIndividualCandidate() { if (mItLast != mItEnd) { mItBegin = mCandidateSet->erase(mItLast); mItLast = mItBegin; return true; } return false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingDescriptor.h0000644000175000017500000000447212520551136030776 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGDESCRIPTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CDependencyTracker.h" #include "CPropagationBinding.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CPropagationBindingDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPropagationBindingDescriptor : public CLinkerBase, public CDependencyTracker { // public methods public: //! Constructor CPropagationBindingDescriptor(); CPropagationBindingDescriptor* initPropagationBindingDescriptor(CPropagationBinding* propBinding, CDependencyTrackPoint* dependencyTrackPoint); CPropagationBinding* getPropagationBinding(); // protected methods protected: // protected variables protected: CPropagationBinding* mPropBinding; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGDESCRIPTOR_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeDependencyTrackPointCollection.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeDependencyTrackPointCollectio0000644000175000017500000000622412520551110032327 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeDependencyTrackPointCollection.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeDependencyTrackPointCollection::CDatatypeDependencyTrackPointCollection(CProcessContext* processContext) : mDepTrackPointSet(processContext) { mProcessContext = processContext; mClashDepLinker = nullptr; } CDatatypeDependencyTrackPointCollection* CDatatypeDependencyTrackPointCollection::initDependencyTrackPointCollection(CDatatypeDependencyTrackPointCollection* collection) { if (collection) { mClashDepLinker = collection->mClashDepLinker; mDepTrackPointSet = collection->mDepTrackPointSet; } else { mClashDepLinker = nullptr; mDepTrackPointSet.clear(); } return this; } CClashedDependencyDescriptor* CDatatypeDependencyTrackPointCollection::getClashedDependencyDescriptors() { return mClashDepLinker; } CClashedDependencyDescriptor* CDatatypeDependencyTrackPointCollection::createClashedDependencyDescriptor(CClashedDependencyDescriptor* appendDepDesLinker, CDependencyTrackPoint* depTrackPoint) { if (depTrackPoint) { CClashedDependencyDescriptor* clashDes = CObjectAllocator::allocateAndConstruct(mProcessContext->getUsedMemoryAllocationManager()); clashDes->initClashedDependencyDescriptor(depTrackPoint); clashDes->append(appendDepDesLinker); return clashDes; } else { return appendDepDesLinker; } } bool CDatatypeDependencyTrackPointCollection::addDependency(CDependencyTrackPoint* depTrackPoint) { if (!mDepTrackPointSet.contains(depTrackPoint)) { mDepTrackPointSet.insert(depTrackPoint); mClashDepLinker = createClashedDependencyDescriptor(mClashDepLinker,depTrackPoint); return true; } return false; } bool CDatatypeDependencyTrackPointCollection::addCollectionDependencies(CDatatypeValueSpaceDependencyCollector* depCollection) { bool depAdded = false; for (CClashedDependencyDescriptor* clashDesIt = mClashDepLinker; clashDesIt; clashDesIt = clashDesIt->getNext()) { depAdded |= depCollection->addDependency(clashDesIt->getDependencyTrackPoint()); } return depAdded; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualConceptBatchProcessingQueue.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualConceptBatchProcessingQueue0000644000175000017500000003111512520551120032326 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualConceptBatchProcessingQueue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualConceptBatchProcessingQueue::CIndividualConceptBatchProcessingQueue(CProcessContext* processContext) : mProcessContext(processContext),mConceptIndiQueueMap(processContext),mBindCountIndiQueueMap(processContext) { } CIndividualConceptBatchProcessingQueue* CIndividualConceptBatchProcessingQueue::initProcessingQueue(CIndividualConceptBatchProcessingQueue* processingQueue) { if (processingQueue) { mConceptIndiQueueMap = processingQueue->mConceptIndiQueueMap; mBindCountIndiQueueMap = processingQueue->mBindCountIndiQueueMap; mUseCurrentProcessingQueue = processingQueue->mUseCurrentProcessingQueue; mCurrentProcessingTag = processingQueue->mCurrentProcessingTag; mLocCurrentProcessingQueue = nullptr; mBindindBasedQueuedCount = processingQueue->mBindindBasedQueuedCount; } else { mConceptIndiQueueMap.clear(); mBindCountIndiQueueMap.clear(); mLocCurrentProcessingQueue = nullptr; mUseCurrentProcessingQueue = nullptr; mCurrentProcessingTag = -1; mBindindBasedQueuedCount = 0; } return this; } bool CIndividualConceptBatchProcessingQueue::isEmpty() { if (mBindindBasedQueuedCount > 0) { return false; } if (mUseCurrentProcessingQueue) { if (!mUseCurrentProcessingQueue->getIndividualQueue()->isEmpty()) { return false; } } for (CPROCESSMAP::const_iterator it = mConceptIndiQueueMap.constBegin(), itEnd = mConceptIndiQueueMap.constEnd(); it != itEnd; ++it) { const CIndividualConceptBatchProcessingQueueData& data = it.value(); if (data.mUseProcData) { if (!data.mUseProcData->getIndividualQueue()->isEmpty()) { return false; } } } return true; } bool CIndividualConceptBatchProcessingQueue::takeNextConceptProcessIndividual(CConcept*& concept, CIndividualProcessNode*& indiNode, CConceptProcessDescriptor*& conProDes) { if (!mUseCurrentProcessingQueue) { if (mBindindBasedQueuedCount > 0) { for (CPROCESSMAP::iterator it = mBindCountIndiQueueMap.begin(), itEnd = mBindCountIndiQueueMap.end(); it != itEnd; ++it) { CIndividualConceptBatchProcessingQueueData& data = it.value(); if (!data.mUseProcData->getIndividualQueue()->isEmpty()) { CIndividualConceptBatchProcessingData* procData = nullptr; if (!data.mLocProcData) { procData = CObjectParameterizingAllocator< CIndividualConceptBatchProcessingData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); procData->initConceptBatchProcessingData(data.mUseProcData); data.mLocProcData = procData; data.mUseProcData = procData; } else { procData = data.mUseProcData; } procData->getIndividualQueue()->takeNextProcessIndiviudalConceptProcessDescriptor(indiNode,conProDes); cint64 indiID = indiNode->getIndividualID(); cint64 conTag = conProDes->getConceptDescriptor()->getConceptTag(); CIndividualConceptQueuedData& indConQueData = mBindCountIndiQueuedHash[QPair(conTag,indiID)]; indConQueData.mQueued = false; --mBindindBasedQueuedCount; return true; } } // TODO: check bug?? mBindindBasedQueuedCount = 0; } //if (!mBindCountIndiQueueMap.isEmpty()) { // CPROCESSMAP::iterator it = mBindCountIndiQueueMap.begin(); // while (it != mBindCountIndiQueueMap.end() && (!mUseCurrentProcessingQueue || mUseCurrentProcessingQueue->getIndividualQueue()->isEmpty())) { // CIndividualConceptBatchProcessingQueueData& data = it.value(); // mCurrentProcessingTag = it.key(); // mUseCurrentProcessingQueue = data.mUseProcData; // mLocCurrentProcessingQueue = data.mLocProcData; // it = mBindCountIndiQueueMap.erase(it); // } //} if (!mConceptIndiQueueMap.isEmpty()) { CPROCESSMAP::iterator it = mConceptIndiQueueMap.begin(); while (it != mConceptIndiQueueMap.end() && (!mUseCurrentProcessingQueue || mUseCurrentProcessingQueue->getIndividualQueue()->isEmpty())) { CIndividualConceptBatchProcessingQueueData& data = it.value(); mCurrentProcessingTag = it.key(); mUseCurrentProcessingQueue = data.mUseProcData; mLocCurrentProcessingQueue = data.mLocProcData; it = mConceptIndiQueueMap.erase(it); } } } if (mUseCurrentProcessingQueue) { cint64 queuedIndiCount = mUseCurrentProcessingQueue->getIndividualQueue()->getQueuedIndividualCount(); if (queuedIndiCount > 1) { if (!mLocCurrentProcessingQueue) { CIndividualConceptBatchProcessingData* procData = CObjectParameterizingAllocator< CIndividualConceptBatchProcessingData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); procData->initConceptBatchProcessingData(mUseCurrentProcessingQueue); mLocCurrentProcessingQueue = procData; mUseCurrentProcessingQueue = procData; } mUseCurrentProcessingQueue->getIndividualQueue()->takeNextProcessIndiviudalConceptProcessDescriptor(indiNode,conProDes); //if (!mUseCurrentProcessingQueue->hasConcept()) { // cint64 indiID = indiNode->getIndividualID(); // cint64 conTag = conProDes->getConceptDescriptor()->getConceptTag(); // CIndividualConceptQueuedData& indConQueData = mBindCountIndiQueuedHash[QPair(conTag,indiID)]; // indConQueData.mQueued = false; //} } else if (queuedIndiCount == 1) { mUseCurrentProcessingQueue->getIndividualQueue()->takeNextProcessIndiviudalConceptProcessDescriptor(indiNode,conProDes); //if (!mUseCurrentProcessingQueue->hasConcept()) { // cint64 indiID = indiNode->getIndividualID(); // cint64 conTag = conProDes->getConceptDescriptor()->getConceptTag(); // CIndividualConceptQueuedData& indConQueData = mBindCountIndiQueuedHash[QPair(conTag,indiID)]; // indConQueData.mQueued = false; //} mUseCurrentProcessingQueue = nullptr; mLocCurrentProcessingQueue = nullptr; mCurrentProcessingTag = -1; } else { mUseCurrentProcessingQueue = nullptr; mLocCurrentProcessingQueue = nullptr; mCurrentProcessingTag = -1; } } return true; } CIndividualConceptBatchProcessingQueue* CIndividualConceptBatchProcessingQueue::insertIndiviudalForConcept(CConcept* concept, CIndividualProcessNode* individual, CConceptProcessDescriptor* conProDes) { CIndividualConceptBatchProcessingData* procData = getBatchProcessingData(concept,true); procData->getIndividualQueue()->insertProcessIndiviudalConceptProcessDescriptor(individual,conProDes); return this; } CIndividualConceptBatchProcessingQueue* CIndividualConceptBatchProcessingQueue::insertIndiviudalForBindingCount(CConcept* concept, cint64 bindCount, CIndividualProcessNode* individual, CConceptProcessDescriptor* conProDes) { cint64 conTag = conProDes->getConceptDescriptor()->getConceptTag(); cint64 indiID = individual->getIndividualID(); CIndividualConceptQueuedData& queuedData = mBindCountIndiQueuedHash[QPair(conTag,indiID)]; if (!queuedData.mQueued || bindCount > queuedData.mPrevTag) { if (queuedData.mQueued) { // remove previous CIndividualConceptBatchProcessingData* prevProcData = getBatchProcessingData(concept,queuedData.mPrevTag,true); prevProcData->getIndividualQueue()->removeQueuedProcessIndiviudal(individual); } else { ++mBindindBasedQueuedCount; } CIndividualConceptBatchProcessingData* procData = getBatchProcessingData(concept,bindCount,true); procData->getIndividualQueue()->insertProcessIndiviudalConceptProcessDescriptor(individual,conProDes); queuedData.mPrevTag = bindCount; queuedData.mQueued = true; } return this; } CIndividualConceptBatchProcessingData* CIndividualConceptBatchProcessingQueue::getBatchProcessingData(CConcept* concept, bool createAndLocalize) { CIndividualConceptBatchProcessingData* procData = nullptr; cint64 conTag = concept->getConceptTag(); if (createAndLocalize) { //if (mCurrentProcessingTag == conTag) { // if (!mLocCurrentProcessingQueue) { // procData = CObjectParameterizingAllocator< CIndividualConceptBatchProcessingData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); // procData->initConceptBatchProcessingData(mUseCurrentProcessingQueue); // mLocCurrentProcessingQueue = procData; // mUseCurrentProcessingQueue = procData; // } else { // procData = mUseCurrentProcessingQueue; // } //} else { CIndividualConceptBatchProcessingQueueData& data = mConceptIndiQueueMap[conTag]; if (!data.mLocProcData) { procData = CObjectParameterizingAllocator< CIndividualConceptBatchProcessingData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); procData->initConceptBatchProcessingData(data.mUseProcData); procData->setConcept(concept); data.mUseProcData = procData; data.mLocProcData = procData; } procData = data.mUseProcData; //} } else { //if (mCurrentProcessingTag == conTag) { // procData = mUseCurrentProcessingQueue; //} else { const CIndividualConceptBatchProcessingQueueData& data = mConceptIndiQueueMap.value(conTag); procData = data.mUseProcData; //} } return procData; } CIndividualConceptBatchProcessingData* CIndividualConceptBatchProcessingQueue::getBatchProcessingData(CConcept* concept, cint64 bindCount, bool createAndLocalize) { CIndividualConceptBatchProcessingData* procData = nullptr; cint64 processingTag = -bindCount; if (createAndLocalize) { if (mCurrentProcessingTag == processingTag) { if (!mLocCurrentProcessingQueue) { procData = CObjectParameterizingAllocator< CIndividualConceptBatchProcessingData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); procData->initConceptBatchProcessingData(mUseCurrentProcessingQueue); mLocCurrentProcessingQueue = procData; mUseCurrentProcessingQueue = procData; } else { procData = mUseCurrentProcessingQueue; } } else { CIndividualConceptBatchProcessingQueueData& data = mBindCountIndiQueueMap[processingTag]; if (!data.mLocProcData) { procData = CObjectParameterizingAllocator< CIndividualConceptBatchProcessingData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); procData->initConceptBatchProcessingData(data.mUseProcData); data.mUseProcData = procData; data.mLocProcData = procData; } procData = data.mUseProcData; } } else { if (mCurrentProcessingTag == processingTag) { procData = mUseCurrentProcessingQueue; } else { const CIndividualConceptBatchProcessingQueueData& data = mBindCountIndiQueueMap.value(processingTag); procData = data.mUseProcData; } } return procData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualDepthPriority.h0000644000175000017500000000446512520551122027775 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALDEPTHPRIORITY_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALDEPTHPRIORITY_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualDepthPriority * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualDepthPriority { // public methods public: //! Constructor CIndividualDepthPriority(); CIndividualDepthPriority(cint64 indiDepth, cint64 indiID); cint64 getIndividualDepth() const; cint64 getIndividualID() const; CIndividualDepthPriority* setPriority(cint64 indiDepth, cint64 indiID); bool operator==(const CIndividualDepthPriority& indiPriority) const; bool operator<=(const CIndividualDepthPriority& indiPriority) const; bool operator<(const CIndividualDepthPriority& indiPriority) const; // protected methods protected: // protected variables protected: cint64 mIndiDepth; cint64 mIndiID; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALDEPTHPRIORITY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptProcessPriority.h0000644000175000017500000000474012520551100027642 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSPRIORITY_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSPRIORITY_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConceptProcessPriority * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptProcessPriority { // public methods public: //! Constructor CConceptProcessPriority(double priority = 0.); double getPriority() const; CConceptProcessPriority* setPriority(double priority); CConceptProcessPriority* addPriorityOffset(double priorityOffset); bool operator==(const CConceptProcessPriority& conceptPriority) const; bool operator!=(const CConceptProcessPriority& conceptPriority) const; bool operator<=(const CConceptProcessPriority& conceptPriority) const; bool operator>=(const CConceptProcessPriority& conceptPriority) const; bool operator<(const CConceptProcessPriority& conceptPriority) const; bool operator>(const CConceptProcessPriority& conceptPriority) const; // protected methods protected: // protected variables protected: double mPriority; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSPRIORITY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNodeSwitchTag.h0000644000175000017500000000510512520551132025652 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CNODESWITCHTAG_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CNODESWITCHTAG_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessTag.h" #include "CProcessTagger.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CNodeSwitchTag * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNodeSwitchTag : public CProcessTag { // public methods public: //! Constructor CNodeSwitchTag(cint64 nodeSwitchTag = 0); //! Destructor virtual ~CNodeSwitchTag(); cint64 getNodeSwitchTag(); CNodeSwitchTag* setNodeSwitchTag(cint64 nodeSwitchTag); CNodeSwitchTag* setNodeSwitchTag(CProcessTagger* processTagger); CNodeSwitchTag* initNodeSwitchTag(cint64 nodeSwitchTag); CNodeSwitchTag* initNodeSwitchTag(CProcessTagger* processTagger); bool updateNodeSwitchTag(cint64 nodeSwitchTag); bool updateNodeSwitchTag(CProcessTagger* processTagger); bool isNodeSwitchTagUpdated(cint64 nodeSwitchTag); bool isNodeSwitchTagUpToDate(cint64 nodeSwitchTag); bool isNodeSwitchTagUpdated(CProcessTagger* processTagger); bool isNodeSwitchTagUpToDate(CProcessTagger* processTagger); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CNODESWITCHTAG_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceStringValuesCounter.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceStringValuesCounter0000644000175000017500000000547312520551116032366 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACESTRINGVALUESCOUNTER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACESTRINGVALUESCOUNTER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CDatatypeValueSpaceValuesCounter.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CDatatypeValueSpaceStringValuesCounter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceStringValuesCounter : public CDatatypeValueSpaceValuesCounter { // public methods public: //! Constructor CDatatypeValueSpaceStringValuesCounter(); const static cint64 SVT_WITH_LANGUAG_TAG_COUNT = 0x0001; const static cint64 SVT_WITHOUT_LANGUAG_TAG_COUNT = 0x0002; CDatatypeValueSpaceStringValuesCounter* initStringValueCounter(cint64 valueCount = 0); virtual bool combineWithValueCounter(CDatatypeValueSpaceValuesCounter* counter, cint64 additionalDiff = 0); bool incValueCount(cint64 type, cint64 incCount = 1); bool incInfinite(cint64 type); bool isInfinite(cint64 type); bool isInfinite(); cint64 getValueCount(cint64 type); cint64 getValueCount(); bool hasValueAchieved(cint64 type, cint64 value); bool hasValueAchieved(cint64 value); virtual VALUES_COUNTER_TYPE getCounterType(); // protected methods protected: // protected variables protected: CDatatypeValueSpaceValuesCounter mWithLanguageTagTypeCounter; CDatatypeValueSpaceValuesCounter mWithoutLanguageTagTypeCounter; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACESTRINGVALUESCOUNTER_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationHashData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationHashDat0000644000175000017500000000422712520551132032246 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CNOMINALCACHINGLOSSREACTIVATIONHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CNOMINALCACHINGLOSSREACTIVATIONHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CNominalCachingLossReactivationData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CNominalCachingLossReactivationHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNominalCachingLossReactivationHashData { // public methods public: //! Constructor CNominalCachingLossReactivationHashData(); CNominalCachingLossReactivationHashData(const CNominalCachingLossReactivationHashData& data); CNominalCachingLossReactivationData* mReactivationData; CNominalCachingLossReactivationData* mPrevReactivationData; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CNOMINALCACHINGLOSSREACTIVATIONHASHDATA_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandidateHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandid0000644000175000017500000000650112520551160032257 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureBlockingIndividualNodeCandidateHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSignatureBlockingIndividualNodeCandidateHash::CSignatureBlockingIndividualNodeCandidateHash(CProcessContext* context) : mContext(context) { mMemMan = mContext->getUsedMemoryAllocationManager(); mBlockCandidateHash = nullptr; mUseBlockCandidateHash = nullptr; mPrevBlockCandidateHash = nullptr; } CSignatureBlockingIndividualNodeCandidateHash::~CSignatureBlockingIndividualNodeCandidateHash() { } CSignatureBlockingIndividualNodeCandidateHash* CSignatureBlockingIndividualNodeCandidateHash::initBlockingIndividualNodeCandidateHash(CSignatureBlockingIndividualNodeCandidateHash* prevBlockCandHash) { mBlockCandidateHash = nullptr; if (prevBlockCandHash) { mPrevBlockCandidateHash = prevBlockCandHash->mUseBlockCandidateHash; mUseBlockCandidateHash = mPrevBlockCandidateHash; } else { mPrevBlockCandidateHash = nullptr; mUseBlockCandidateHash = nullptr; } return this; } CSignatureBlockingIndividualNodeCandidateData* CSignatureBlockingIndividualNodeCandidateHash::getBlockingIndividualCandidateData(cint64 signature, bool create) { if (!mUseBlockCandidateHash || !mBlockCandidateHash && create) { mBlockCandidateHash = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(mMemMan,mContext); if (mPrevBlockCandidateHash) { *mBlockCandidateHash = *mPrevBlockCandidateHash; } mUseBlockCandidateHash = mBlockCandidateHash; } if (create) { CSignatureBlockingCandidateHashData& data = (*mUseBlockCandidateHash)[signature]; if (!data.mCandidateIndiData) { data.mCandidateIndiData = CObjectParameterizingAllocator< CSignatureBlockingIndividualNodeCandidateData,CProcessContext* >::allocateAndConstructAndParameterize(mMemMan,mContext); data.mCandidateIndiData->initBlockingCandidateData(data.mPrevCandidateIndiData); data.mPrevCandidateIndiData = data.mCandidateIndiData; } return data.mPrevCandidateIndiData; } else { CSignatureBlockingCandidateHashData* data = nullptr; if (mUseBlockCandidateHash->tryGetValuePointer(signature,data)) { return data->mPrevCandidateIndiData; } } return nullptr; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalIndividualNodeConceptTestSet.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalIndividualNodeConceptTestSet.0000644000175000017500000000537712520551104032212 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALINDIVIDUALNODECONCEPTTESTSET_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALINDIVIDUALNODECONCEPTTESTSET_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualSaturationProcessNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CCriticalIndividualNodeConceptTestSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCriticalIndividualNodeConceptTestSet { // public methods public: //! Constructor CCriticalIndividualNodeConceptTestSet(CProcessContext* processContext); CCriticalIndividualNodeConceptTestSet* initIndividualNodeConceptTestSet(CCriticalIndividualNodeConceptTestSet* processingQueue); bool isConceptTestedForIndividual(CConcept* concept, CIndividualSaturationProcessNode* individual); bool isConceptTestedForIndividual(CConceptSaturationDescriptor* criticalConDes, CIndividualSaturationProcessNode* individual); CCriticalIndividualNodeConceptTestSet* insertConceptTestedForIndividual(CConcept* concept, CIndividualSaturationProcessNode* individual); CCriticalIndividualNodeConceptTestSet* insertConceptTestedForIndividual(CConceptSaturationDescriptor* criticalConDes, CIndividualSaturationProcessNode* individual); CPROCESSSET< QPair > mIndiConceptTestedSet; // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCriticalIndividualNodeConceptTestSet_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateData.h0000644000175000017500000000601012520551072032104 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODECANDIDATEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODECANDIDATEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" #include "CProcessContext.h" #include "CConceptLabelSetModificationTag.h" #include "CNodeSwitchTag.h" #include "CBlockingIndividualNodeCandidateIterator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CBlockingIndividualNodeCandidateData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBlockingIndividualNodeCandidateData : public CConceptLabelSetModificationTag, public CNodeSwitchTag { // public methods public: //! Constructor CBlockingIndividualNodeCandidateData(CProcessContext* context = nullptr); //! Destructor virtual ~CBlockingIndividualNodeCandidateData(); CBlockingIndividualNodeCandidateData* initBlockingCandidateData(CBlockingIndividualNodeCandidateData* prevBlockCandHash); CBlockingIndividualNodeCandidateData* insertBlockingCandidateIndividualNode(CIndividualProcessNode* candidateIndi); CBlockingIndividualNodeCandidateIterator getBlockingCandidatesIndividualNodeIterator(cint64 candidateIndividualID); CBlockingIndividualNodeCandidateIterator getBlockingCandidatesIndividualNodeIterator(CIndividualProcessNode* candidateIndi); cint64 getMaxValidIndividualID(); CBlockingIndividualNodeCandidateData* setMaxValidIndividualID(cint64 indiID); // protected methods protected: // protected variables protected: CPROCESSMAP mCandidateIndiMap; cint64 mMaxValidIndividualID; CProcessContext* mContext; CMemoryAllocationManager* mMemMan; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODECANDIDATEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathMap.h0000644000175000017500000000440012520551164027444 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CVariableBindingPathMapData.h" #include "CVariableBindingPathDescriptor.h" // Other includes #include "Reasoner/Ontology/CNominalSchemaTemplateVector.h" #include "Reasoner/Ontology/CNominalSchemaTemplate.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CVariableBindingPathMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingPathMap : public CPROCESSMAP { // public methods public: //! Constructor CVariableBindingPathMap(CProcessContext* processContext); CVariableBindingPathMap* initVariableBindingPathMap(CVariableBindingPathMap* prevMap); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHMAP_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeLinker.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeLinker0000644000175000017500000000410312520551130032370 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualSaturationProcessNodeLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualSaturationProcessNodeLinker::CIndividualSaturationProcessNodeLinker() : CNegLinkerBase(nullptr,false) { } CIndividualSaturationProcessNodeLinker* CIndividualSaturationProcessNodeLinker::initProcessNodeLinker(CIndividualSaturationProcessNode *individual, bool processingQueued) { initNegLinker(individual,processingQueued); return this; } CIndividualSaturationProcessNode* CIndividualSaturationProcessNodeLinker::getProcessingIndividual() { return getData(); } bool CIndividualSaturationProcessNodeLinker::isProcessingQueued() { return isNegated(); } CIndividualSaturationProcessNodeLinker* CIndividualSaturationProcessNodeLinker::clearProcessingQueued() { setNegation(false); return this; } CIndividualSaturationProcessNodeLinker* CIndividualSaturationProcessNodeLinker::setProcessingQueued(bool processingQueued) { setNegation(processingQueued); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptSaturationProcessLinker.h0000644000175000017500000000433112520551102031315 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATURATIONPROCESSLINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATURATIONPROCESSLINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptSaturationDescriptor.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConceptSaturationProcessLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptSaturationProcessLinker : public CLinkerBase { // public methods public: //! Constructor CConceptSaturationProcessLinker(); CConceptSaturationProcessLinker* initConceptSaturationProcessLinker(CConceptSaturationDescriptor *conPilDes); CConceptSaturationDescriptor* getConceptSaturationDescriptor(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATURATIONPROCESSLINKER_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalSaturationConceptTypeQueues.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalSaturationConceptTypeQueues.c0000644000175000017500000000553212520551106032321 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCriticalSaturationConceptTypeQueues.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CCriticalSaturationConceptTypeQueues::CCriticalSaturationConceptTypeQueues(CProcessContext* context) : mContext(context) { mQueueVec = nullptr; } CCriticalSaturationConceptTypeQueues* CCriticalSaturationConceptTypeQueues::initCriticalSaturationConceptQueues(CIndividualSaturationProcessNode* indiNode) { mIndiNode = indiNode; mQueued = false;; CMemoryAllocationManager* memMan = mContext->getUsedMemoryAllocationManager(); mQueueVec = CObjectAllocator< CCriticalSaturationConceptQueue* >::allocateAndConstructArray(memMan,mConceptTypeCount); for (cint64 i = 0; i < mConceptTypeCount; ++i) { mQueueVec[i] = nullptr; } return this; } bool CCriticalSaturationConceptTypeQueues::hasCriticalSaturationConceptsQueued() { for (cint64 i = 0; i < mConceptTypeCount; ++i) { CCriticalSaturationConceptQueue*& queue = mQueueVec[i]; if (queue && queue->hasCriticalConceptDescriptorLinker()) { return true; } } return false; } CCriticalSaturationConceptQueue* CCriticalSaturationConceptTypeQueues::getCriticalSaturationConceptQueue(CRITICALSATURATIONCONCEPTQUEUETYPE type, bool create) { CCriticalSaturationConceptQueue*& queue = mQueueVec[(cint64)type]; if (!queue && create) { CMemoryAllocationManager* memMan = mContext->getUsedMemoryAllocationManager(); queue = CObjectAllocator< CCriticalSaturationConceptQueue >::allocateAndConstruct(memMan); queue->initCriticalSaturationConceptQueue(mIndiNode); } return queue; } bool CCriticalSaturationConceptTypeQueues::isProcessNodeQueued() { return mQueued; } CCriticalSaturationConceptTypeQueues* CCriticalSaturationConceptTypeQueues::setProcessNodeQueued(bool queued) { mQueued = queued; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualDepthProcessingQueue.h0000644000175000017500000000537112520551122031272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALDEPTHPROCESSINGQUEUE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALDEPTHPROCESSINGQUEUE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" #include "CIndividualDepthPriority.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualDepthProcessingQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualDepthProcessingQueue { // public methods public: //! Constructor CIndividualDepthProcessingQueue(CProcessContext* processContext); CIndividualDepthProcessingQueue* initProcessingQueue(CIndividualDepthProcessingQueue* processingQueue); CIndividualProcessNode* takeNextProcessIndividual(); CIndividualProcessNode* getNextProcessIndividual(); CIndividualDepthProcessingQueue* insertProcessIndiviudal(CIndividualProcessNode* individual); bool isEmpty(); cint64 getQueuedIndividualCount(); bool hasQueuedIndividuals(); bool isIndividualQueued(CIndividualProcessNode *individual); bool hasHigherPriorityIndividual(CIndividualProcessNode *individual); CPROCESSMAP mPriorityIndiDesMap; // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; bool mHasMaxIndiPriority; CIndividualDepthPriority mMaxIndiPriority; CIndividualProcessNode* mLastCheckIndi; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALDEPTHPROCESSINGQUEUE_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReusingIndividualNodeConceptExpansionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReusingIndividualNodeConceptExpansion0000644000175000017500000000732312520551150032361 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREUSINGINDIVIDUALNODECONCEPTEXPANSIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREUSINGINDIVIDUALNODECONCEPTEXPANSIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "CProcessContext.h" #include "CSignatureBlockingIndividualNodeConceptExpansionData.h" // Other includes #include "Utilities/UtilitiesSettings.h" #include "Reasoner/Kernel/Process/Dependency/CNonDeterministicDependencyTrackPoint.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CReusingIndividualNodeConceptExpansionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReusingIndividualNodeConceptExpansionData : public CSignatureBlockingIndividualNodeConceptExpansionData { // public methods public: //! Constructor CReusingIndividualNodeConceptExpansionData(); CReusingIndividualNodeConceptExpansionData* initReusingExpansionData(CReusingIndividualNodeConceptExpansionData* prevData); cint64 getReusingTriedCount(); cint64 getReusingFailedCount(); CReusingIndividualNodeConceptExpansionData* setReusingTriedCount(cint64 triedCount); CReusingIndividualNodeConceptExpansionData* setReusingFailedCount(cint64 failedCount); CReusingIndividualNodeConceptExpansionData* incReusingTriedCount(cint64 incCount = 1); CReusingIndividualNodeConceptExpansionData* incReusingFailedCount(cint64 incCount = 1); CReusingIndividualNodeConceptExpansionData* addReusingFailedSignatureAndIndividual(cint64 conSetSignature, cint64 individualID); CNonDeterministicDependencyTrackPoint* getReuseConceptsDependencyTrackPoint(); CReusingIndividualNodeConceptExpansionData* setReuseConceptsDependencyTrackPoint(CNonDeterministicDependencyTrackPoint* depTrackPoint); CXLinker* getLastNonDeterministicExpansionLinker(); CReusingIndividualNodeConceptExpansionData* setLastNonDeterministicExpansionLinker(CXLinker* expLinker); // protected methods protected: // protected variables protected: cint64 mReusingTriedCount; cint64 mReusingFailedCount; CPROCESSSET mReusedIndiviudals; CPROCESSSET mReusedConceptSetSignatures; CNonDeterministicDependencyTrackPoint* mReuseConceptsDependencyTrackPoint; CXLinker* mLastNonDetExpansionLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREUSINGINDIVIDUALNODECONCEPTEXPANSIONDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathMergingHashData.h0000644000175000017500000000441512520551164031723 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHMERGINGHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHMERGINGHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CVariableBindingPath.h" #include "CVariableBindingPathMergingHashData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CVariableBindingPathMergingHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingPathMergingHashData { // public methods public: //! Constructor CVariableBindingPathMergingHashData(); CVariableBindingPathMergingHashData(const CVariableBindingPathMergingHashData& data); CVariableBindingPath* getVariableBindingPath(); CVariableBindingPathMergingHashData* setVariableBindingPath(CVariableBindingPath* variableBindingPath); // protected methods protected: // protected variables protected: CVariableBindingPath* mVariableBindingPath; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHMERGINGHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConnectionSuccessorSetIterator.h0000644000175000017500000000432212520551104031325 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONNECTIONSUCCESSORSETITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONNECTIONSUCCESSORSETITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConnectionSuccessorSetIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConnectionSuccessorSetIterator { // public methods public: //! Constructor CConnectionSuccessorSetIterator(cint64 connID = -1); CConnectionSuccessorSetIterator(const CPROCESSSET::iterator& beginIt, const CPROCESSSET::iterator& endIt); bool hasNext(); cint64 nextSuccessorConnectionID(bool moveNext = true); cint64 next(bool moveNext = true); // protected methods protected: // protected variables protected: CPROCESSSET::iterator mBeginIt; CPROCESSSET::iterator mEndIt; cint64 mConnID; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONNECTIONSUCCESSORSETITERATOR_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptVariableBindingPathSetHashData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptVariableBindingPathSetHashData0000644000175000017500000000422612520551102032144 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTVARIABLEBINDINGPATHSETHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTVARIABLEBINDINGPATHSETHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CVariableBindingPathSet.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConceptVariableBindingPathSetHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptVariableBindingPathSetHashData { // public methods public: //! Constructor CConceptVariableBindingPathSetHashData(); CConceptVariableBindingPathSetHashData(const CConceptVariableBindingPathSetHashData& data); CVariableBindingPathSet* mLocVariableBindingPathSet; CVariableBindingPathSet* mUseVariableBindingPathSet; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTVARIABLEBINDINGPATHSETHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyRoleSuccessorData.h0000644000175000017500000000474312520551142030101 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYROLESUCCESSORDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYROLESUCCESSORDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualLinkEdge.h" #include "CReapplyQueue.h" #include "CProcessContext.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CReapplyRoleSuccessorData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReapplyRoleSuccessorData { // public methods public: inline CReapplyRoleSuccessorData() { mLinkLinker = nullptr; mLocatedLinkSet = false; mLinkSet = nullptr; mLinkCount = 0; } inline CReapplyRoleSuccessorData(const CReapplyRoleSuccessorData& roleSuccData) : mReapplyQueue(roleSuccData.mReapplyQueue) { mLinkSet = roleSuccData.mLinkSet; mLocatedLinkSet = false; mLinkCount = roleSuccData.mLinkCount; mLinkLinker = roleSuccData.mLinkLinker; } CPROCESSHASH *mLinkSet; CIndividualLinkEdge* mLinkLinker; bool mLocatedLinkSet; cint64 mLinkCount; CReapplyQueue mReapplyQueue; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYROLESUCCESSORDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDisjointSuccessorRoleIterator.cpp0000644000175000017500000000343412520551120031513 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDisjointSuccessorRoleIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDisjointSuccessorRoleIterator::CDisjointSuccessorRoleIterator() { mSuccIndi = 0; } CDisjointSuccessorRoleIterator::CDisjointSuccessorRoleIterator(cint64 succIndi, const CPROCESSHASH::iterator& beginIt, const CPROCESSHASH::iterator& endIt) : mSuccIndi(succIndi),mBeginIt(beginIt),mEndIt(endIt) { } bool CDisjointSuccessorRoleIterator::hasNext() { return mBeginIt != mEndIt; } CNegationDisjointEdge* CDisjointSuccessorRoleIterator::next(bool moveNext) { CNegationDisjointEdge* link = nullptr; if (mBeginIt != mEndIt) { link = mBeginIt.value(); if (moveNext) { ++mBeginIt; } } return link; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorExtensionData.h0000644000175000017500000000523012520551160031661 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSOREXTENSIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSOREXTENSIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CBackwardSaturationPropagationReapplyDescriptor.h" #include "CSaturationSuccessorData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSaturationSuccessorExtensionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationSuccessorExtensionData { // public methods public: //! Constructor CSaturationSuccessorExtensionData(CProcessContext* processContext); CSaturationSuccessorExtensionData* initSuccessorExtensionData(); CBackwardSaturationPropagationReapplyDescriptor* getLastExaminedALLConceptReapplyDescriptor(); CSaturationSuccessorExtensionData* setLastExaminedALLConceptReapplyDescriptor(CBackwardSaturationPropagationReapplyDescriptor* reaDes); CSaturationSuccessorData* getLastExaminedLinkLinker(); CSaturationSuccessorExtensionData* setLastExaminedLinkLinker(CSaturationSuccessorData* linkLinker); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CSaturationSuccessorData* mLastExaminedLinkLinker; CBackwardSaturationPropagationReapplyDescriptor* mLastExaminedALLConReaDes; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSOREXTENSIONDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CAnalizedConceptExpansionLinker.h0000644000175000017500000000536312520551070031253 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CANALIZEDCONCEPTEXPANSIONLINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CANALIZEDCONCEPTEXPANSIONLINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "CProcessContext.h" // Other includes #include "Utilities/UtilitiesSettings.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CAnalizedConceptExpansionLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalizedConceptExpansionLinker : public CLinkerBase { // public methods public: //! Constructor CAnalizedConceptExpansionLinker(); CAnalizedConceptExpansionLinker* initAnalizedConceptExpansion(CXLinker* dependendConDesLinker, CConceptDescriptor* conDes); CAnalizedConceptExpansionLinker* addDependendConceptDescriptorLinker(CXLinker* dependendConDesLinker); CAnalizedConceptExpansionLinker* setConceptDescriptor(CConceptDescriptor* conDes); CXLinker* getDependendConceptDescriptorLinker(); CConceptDescriptor* getConceptDescriptor(); bool hasMultipleDependencies(); // protected methods protected: // protected variables protected: CXLinker* mDependendConDesLinker; CConceptDescriptor* mConDes; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CANALIZEDCONCEPTEXPANSIONLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingTriggerData.h0000644000175000017500000000467712520551164030327 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGTRIGGERDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGTRIGGERDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CVariableBindingTriggerLinker.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CVariableBindingTriggerData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingTriggerData { // public methods public: //! Constructor CVariableBindingTriggerData(); bool isTriggered(); CVariableBindingTriggerLinker* getVariableBindingTriggerLinker(); CVariableBindingTriggerData* setTriggered(bool triggered); CVariableBindingTriggerData* setVariableBindingTriggerLinker(CVariableBindingTriggerLinker* varBindTriggerLinker); CVariableBindingTriggerData* addVariableBindingTriggerLinker(CVariableBindingTriggerLinker* varBindTriggerLinker); CVariableBindingTriggerData* clearVariableBindingTriggerLinker(); // protected methods protected: // protected variables protected: bool mTriggered; CVariableBindingTriggerLinker* mVarBindTriggerLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGTRIGGERDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingFollowSet.cpp0000644000175000017500000000314112520551072027072 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBlockingFollowSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBlockingFollowSet::CBlockingFollowSet(CProcessContext* context) : CPROCESSSET(context),CBlockingFollowUpdateTag(0) { mContext = context; } CBlockingFollowSet* CBlockingFollowSet::initBlockingFollowSet(CBlockingFollowSet* sigBlockFollowSet) { if (sigBlockFollowSet) { *this = *sigBlockFollowSet; initBlockingFollowTag(sigBlockFollowSet->getBlockingFollowTag()); } else { CPROCESSSET::clear(); initBlockingFollowTag(mContext->getProcessTagger()->getCurrentBlockingFollowTag()); } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptNominalSchemaGroundingData.cpp0000644000175000017500000000651012520551100032177 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptNominalSchemaGroundingData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptNominalSchemaGroundingData::CConceptNominalSchemaGroundingData(CContext* context) : mContext(context),mBindedNomSchConList(context) { mGroundedConcept = nullptr; mGroundingConcept = nullptr; } CConceptNominalSchemaGroundingData* CConceptNominalSchemaGroundingData::setGroundingConcept(CConcept* concept) { mGroundingConcept = concept; return this; } CConceptNominalSchemaGroundingData* CConceptNominalSchemaGroundingData::setGroundedConcept(CConcept* concept) { mGroundedConcept = concept; return this; } CConceptNominalSchemaGroundingData* CConceptNominalSchemaGroundingData::addBindedNominalSchemaConcept(CConcept* nsConcept) { mBindedNomSchConList.append(nsConcept); return this; } CPROCESSLIST* CConceptNominalSchemaGroundingData::getBindedNominalSchemaConceptList() { return &mBindedNomSchConList; } CConcept* CConceptNominalSchemaGroundingData::getGroundedConcept() { return mGroundedConcept; } CConcept* CConceptNominalSchemaGroundingData::getGroundingConcept() { return mGroundingConcept; } cint64 CConceptNominalSchemaGroundingData::calculateHashValue() { cint64 hashValue = (cint64)mGroundingConcept; cint64 multiplier = 13; for (CPROCESSLIST::const_iterator it = mBindedNomSchConList.constBegin(), itEnd = mBindedNomSchConList.constEnd(); it != itEnd; ++it) { CConcept* concept = *it; hashValue += multiplier*(cint64)concept; multiplier = multiplier*2+1; } return hashValue; } bool CConceptNominalSchemaGroundingData::isEquivalentTo(const CConceptNominalSchemaGroundingData& data) const { if (mGroundingConcept != data.mGroundingConcept) { return false; } CPROCESSLIST::const_iterator it1 = mBindedNomSchConList.constBegin(), it1End = mBindedNomSchConList.constEnd(); CPROCESSLIST::const_iterator it2 = data.mBindedNomSchConList.constBegin(), it2End = data.mBindedNomSchConList.constEnd(); while (it1 != it1End) { if (it2 == it2End) { return false; } else { CConcept* con1 = *it1; CConcept* con2 = *it2; if (con1 != con2) { return false; } } ++it1; ++it2; } return true; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeRealValueData.h0000644000175000017500000000553212520551112027317 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeRealValueDataExclusion.h" // Other includes #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDataLiteralRealValue.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CDatatypeRealValueData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeRealValueData { // public methods public: //! Constructor CDatatypeRealValueData(CProcessContext* processContext); CDatatypeRealValueData* initRealValueData(CDatatypeRealValueData* valueData, CDataLiteralRealValue* value); CDatatypeRealValueData* initRealValueData(CDataLiteralRealValue* value); CDatatypeRealValueDataExclusion* getValueExclusionData(); CDatatypeRealValueDataExclusion* getLeftExclusionData(); CDatatypeRealValueDataExclusion* getRightExclusionData(); CDataLiteralRealValue* getValue(); CDatatypeRealValueData* setValue(CDataLiteralRealValue* value); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CDataLiteralRealValue* mValue; CDatatypeRealValueDataExclusion mValueExclusionData; CDatatypeRealValueDataExclusion mLeftExclusionData; CDatatypeRealValueDataExclusion mRightExclusionData; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CLinkEdge.h0000644000175000017500000000423712520551130024634 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CLINKEDGE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CLINKEDGE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CNodeEdge.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CLinkEdge * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLinkEdge : public CNodeEdge { // public methods public: //! Constructor CLinkEdge(CProcessContext* processContext = nullptr); CLinkEdge* initLinkEdge(CIndividualProcessNode* sourceIndividual, CIndividualProcessNode* destinationIndividual, CRole* role, CDependencyTrackPoint* depTrackPoint); CLinkEdge* initLinkEdge(CLinkEdge* linkEdge); CRole* getLinkRole(); CLinkEdge* setLinkRole(CRole* role); // protected methods protected: // protected variables protected: CRole* mRole; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CLINKEDGE_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorRoleAssertionLinker.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorRoleAssertionLinke0000644000175000017500000000473312520551160032450 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORROLEASSERTIONLINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORROLEASSERTIONLINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Reasoner/Ontology/CRole.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationSuccessorRoleAssertionLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationSuccessorRoleAssertionLinker : public CLinkerBase { // public methods public: //! Constructor CSaturationSuccessorRoleAssertionLinker(); CSaturationSuccessorRoleAssertionLinker* initSaturationSuccessorRoleAssertionLinker(CIndividualSaturationProcessNode* indiSatNode, CRole* role, bool roleNegation); CRole* getAssertionRole(); bool getAssertionRoleNegation(); CIndividualSaturationProcessNode* getAssertionDestinationNode(); // protected methods protected: // protected variables protected: CRole* mRole; bool mRoleNegation; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONSUCCESSORROLEASSERTIONLINKER_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedNegationDisjointLinkDescriptor.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedNegationDisjointLinkDescriptor0000644000175000017500000000454412520551076032347 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDNEGATIONDISJOINTLINKDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDNEGATIONDISJOINTLINKDESCRIPTOR_H // Libraries includes #include // Namespace includes #include "ProcessSettings.h" #include "CNegationDisjointEdge.h" #include "CClashedDependencyDescriptor.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CClashedNegationDisjointLinkDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClashedNegationDisjointLinkDescriptor : public CClashedDependencyDescriptor { // public methods public: //! Constructor CClashedNegationDisjointLinkDescriptor(); CClashedNegationDisjointLinkDescriptor* initClashedLinkDescriptor(CNegationDisjointEdge* linkEdge, CDependencyTrackPoint* depTrackPointD); CNegationDisjointEdge* getNegationDisjointLinkEdge(); // protected methods protected: // protected variables protected: CNegationDisjointEdge* mLinkEdge; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDNEGATIONDISJOINTLINKDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingStatisticRegistrator.h0000644000175000017500000000404112520551134031401 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGSTATISTICREGISTRATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGSTATISTICREGISTRATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CProcessingStatisticRegistrator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessingStatisticRegistrator { // public methods public: //! Constructor CProcessingStatisticRegistrator(); //! Destructor virtual ~CProcessingStatisticRegistrator(); virtual CProcessingStatisticRegistrator* registerProcessingStatisticDescription(CProcessingStatisticDescription* statDesc) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGSTATISTICREGISTRATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptSaturationProcessLinker.cpp0000644000175000017500000000303512520551102031650 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptSaturationProcessLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptSaturationProcessLinker::CConceptSaturationProcessLinker() : CLinkerBase(nullptr) { } CConceptSaturationProcessLinker *CConceptSaturationProcessLinker::initConceptSaturationProcessLinker(CConceptSaturationDescriptor *conPilDes) { initLinker(conPilDes); return this; } CConceptSaturationDescriptor *CConceptSaturationProcessLinker::getConceptSaturationDescriptor() { return getData(); } }; // end namespace Kernel }; // end namespace Process }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingStatisticGathering.cpp0000644000175000017500000000454112520551134031344 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessingStatisticGathering.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CProcessingStatisticGathering::CProcessingStatisticGathering() { initProcessingStatisticsGathering(nullptr); } CProcessingStatisticGathering::~CProcessingStatisticGathering() { } CProcessingStatisticGathering* CProcessingStatisticGathering::initProcessingStatisticsGathering(CProcessingStatisticGathering* refStat) { if (refStat) { for (cint64 inx = 0; inx < CProcessingStatistics::statisticVectorSize; ++inx) { mStatVec[inx] += refStat->mStatVec[inx]; } } else { for (cint64 inx = 0; inx < CProcessingStatistics::statisticVectorSize; ++inx) { mStatVec[inx] = 0; } } return this; } CProcessingStatisticGathering* CProcessingStatisticGathering::addGatheredProcessingStatisticsTo(CProcessingStatisticGathering* stat) { if (stat) { for (cint64 inx = 0; inx < CProcessingStatistics::statisticVectorSize; ++inx) { stat->mStatVec[inx] += mStatVec[inx]; } } return this; } cint64* CProcessingStatisticGathering::getProcessingStatisticsVector() { return mStatVec; } cint64 CProcessingStatisticGathering::getGatheredProcessingStatistic(cint64 index) { if (index >= 0 && index < CProcessingStatistics::statisticVectorSize) { return mStatVec[index]; } return 0; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyConceptLabelSet.h0000644000175000017500000001430412520551140027513 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTLABELSET_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTLABELSET_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CReapplyConceptLabelSetIterator.h" #include "CClashedConceptDescriptor.h" #include "CConceptSetSignature.h" #include "CConceptDescriptorDependencyReapplyData.h" #include "CConceptLabelSetModificationTag.h" #include "CCoreConceptDescriptor.h" #include "CConceptSetStructure.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CReapplyConceptLabelSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReapplyConceptLabelSet : public CConceptLabelSetModificationTag { // public methods public: //! Constructor CReapplyConceptLabelSet(CProcessContext* processContext = nullptr); //! Destructor virtual ~CReapplyConceptLabelSet(); CReapplyConceptLabelSet* initConceptLabelSet(CReapplyConceptLabelSet* prevConceptLabelSet); cint64 getConceptCount(); bool getConceptDescriptor(cint64 conTag, CConceptDescriptor*& conDes, CDependencyTrackPoint*& depTrackPoint); bool getConceptDescriptor(CConcept* concept, CConceptDescriptor*& conDes, CDependencyTrackPoint*& depTrackPoint); bool hasConceptDescriptor(CConceptDescriptor* conceptDescriptor); bool hasConcept(CConcept* concept, bool negated); bool hasConcept(CConcept* concept, bool* containsNegated = nullptr); bool containsConcept(CConcept* concept, bool* containsNegated = nullptr); bool containsConcept(CConcept* concept, bool negated); bool containsConceptDescriptor(CConceptDescriptor* conceptDescriptor); bool insertConceptIgnoreClash(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CCondensedReapplyQueueIterator* reapplyQueueIt = nullptr); bool insertConceptGetClash(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CCondensedReapplyQueueIterator* reapplyQueueIt = nullptr, CConceptDescriptor** clashedConDes = nullptr, CDependencyTrackPoint** clashedDepTrackPoint = nullptr); CClashedConceptDescriptor* insertConceptReturnClash(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint, bool* hasContained = nullptr, CCondensedReapplyQueueIterator* reapplyQueueIt = nullptr); bool insertConceptThrowClashReturnContained(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CCondensedReapplyQueueIterator* reapplyQueueIt = nullptr); CReapplyConceptLabelSetIterator getConceptLabelSetIterator(bool getSorted = false, bool getDependencies = false, bool getAllStructure = false); CConceptSetSignature* getConceptSignature(); CConceptSetStructure* getConceptStructure(); cint64 getConceptSignatureValue(); bool getConceptDescriptorAndReapplyQueue(cint64 conTag, CConceptDescriptor*& conDes, CDependencyTrackPoint*& depTrackPoint, CCondensedReapplyQueue*& reapplyQueue); bool getConceptDescriptorAndReapplyQueue(CConcept* concept, CConceptDescriptor*& conDes, CDependencyTrackPoint*& depTrackPoint, CCondensedReapplyQueue*& reapplyQueue); bool getConceptDescriptorOrReapplyQueue(cint64 conTag, CConceptDescriptor*& conDes, CDependencyTrackPoint*& depTrackPoint, CCondensedReapplyQueue*& reapplyQueue); bool getConceptDescriptorOrReapplyQueue(CConcept* concept, CConceptDescriptor*& conDes, CDependencyTrackPoint*& depTrackPoint, CCondensedReapplyQueue*& reapplyQueue); CCondensedReapplyQueue* getConceptDescriptorAndReapplyQueue(CConcept*& concept, CConceptDescriptor*& conDes, bool create = false); CCondensedReapplyQueue* getConceptReapplyQueue(CConcept*& concept, bool& conceptNegation, bool create = false); CCondensedReapplyQueue* getConceptReapplyQueue(cint64 conTag, bool create = false); bool containsConceptReapplyQueue(CConcept *&concept, bool &conceptNegation); CCondensedReapplyQueueIterator getConceptReapplyIterator(CConcept* concept, bool conceptNegation, bool clearDynamicReapplyQueue = true); CCondensedReapplyQueueIterator getConceptReapplyIterator(CConceptDescriptor* conDes, bool clearDynamicReapplyQueue = true); CConceptDescriptor* getAddingSortedConceptDescriptionLinker(); CConceptDescriptorDependencyReapplyData* getConceptDescriptorDependencyReapplyData(cint64 dataTag); CCoreConceptDescriptor* getCoreConceptDescriptorLinker(); CReapplyConceptLabelSet* addCoreConceptDescriptor(CCoreConceptDescriptor* coreConDes); // protected methods protected: // protected variables protected: CPROCESSMAP mConceptDesDepMap; CCoreConceptDescriptor* mCoreConDesLinker; CConceptDescriptor* mConceptDesLinker; CConceptDescriptor* mPrevConceptDesLinker; CConceptSetSignature mConceptSignature; CConceptSetStructure mConceptStructure; cint64 mConceptCount; CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYCONCEPTLABELSET_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathHash0000644000175000017500000000473412520551144032315 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRepresentativePropagationSet.h" #include "CRepresentativeVariableBindingPathSetHashData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathHash : public CPROCESSHASH { // public methods public: //! Constructor CRepresentativeVariableBindingPathHash(CProcessContext* processContext); CRepresentativeVariableBindingPathHash* initRepresentativeVariableBindingPathHash(CRepresentativeVariableBindingPathHash* prevSet); CRepresentativeVariableBindingPathSetData* getRepresentativeVariableBindingPathSetData(CVariableBindingPath* varBindPath, bool createOrLocalize = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinker.h0000644000175000017500000000515012520551074030670 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODELINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODELINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CBlockingIndividualNodeLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBlockingIndividualNodeLinker : public CLinkerBase { // public methods public: //! Constructor CBlockingIndividualNodeLinker(); CBlockingIndividualNodeLinker* initBlockingIndividualNodeLinker(CBlockingIndividualNodeLinker* blockIndNodeLinker); CBlockingIndividualNodeLinker* initBlockingIndividualNodeLinker(CIndividualProcessNode* indiNode); CConceptDescriptor* getLastFailedSubsetConceptDescriptor(); CBlockingIndividualNodeLinker* setLastFailedSubsetConceptDescriptor(CConceptDescriptor* conDes); CIndividualProcessNode* getCandidateIndividualNode(); CBlockingIndividualNodeLinker* setCandidateIndividualNode(CIndividualProcessNode* indiNode); // protected methods protected: // protected variables protected: CConceptDescriptor* mLastFailedSubsetConDes; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODELINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNode.h0000644000175000017500000003052112574302664031473 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CIndividualProcessNodeReference.h" #include "CRoleBackwardSaturationPropagationHash.h" #include "CLinkedRoleSaturationSuccessorHash.h" #include "CIndividualSaturationProcessNode.h" #include "CIndividualSaturationProcessNodeLinker.h" #include "CConceptSaturationProcessLinker.h" #include "CReapplyConceptSaturationLabelSet.h" #include "CIndividualSaturationProcessNodeStatusFlags.h" #include "CSaturationDisjunctCommonConceptExtractionData.h" #include "CIndividualSaturationProcessNodeExtensionData.h" #include "CSaturationIndividualNodeNominalHandlingData.h" #include "CIndividualSaturationProcessNodeCacheData.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CRole.h" #include "Reasoner/Ontology/CIndividual.h" #include "Reasoner/Ontology/CExtendedConceptReferenceLinkingData.h" #include "Reasoner/Ontology/CIndividualSaturationReferenceLinkingData.h" #include "Utilities/Memory/CObjectParameterizingAllocator.h" #include "Utilities/Container/CSortedNegLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CIndividualSaturationProcessNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualSaturationProcessNode : public CIndividualProcessNodeReference { // public methods public: //! Constructor CIndividualSaturationProcessNode(CProcessContext* processContext = nullptr); CIndividualSaturationProcessNode* initIndividualSaturationProcessNode(cint64 individualID, CExtendedConceptReferenceLinkingData* conSatRefLinkData, CIndividualSaturationReferenceLinkingData* indSatRefLinkData); CIndividualSaturationProcessNode* initRootIndividualSaturationProcessNode(); CIndividualSaturationProcessNode* initCopingIndividualSaturationProcessNode(CIndividualSaturationProcessNode* indiNode, bool tryFlatLabelCopy); CIndividualSaturationProcessNode* initSubstituitingIndividualSaturationProcessNode(CIndividualSaturationProcessNode* indiNode); CExtendedConceptReferenceLinkingData* getSaturationConceptReferenceLinking(); CIndividualSaturationReferenceLinkingData* getSaturationIndividualReferenceLinking(); CReapplyConceptSaturationLabelSet* getReapplyConceptSaturationLabelSet(bool create = true); CIndividualSaturationProcessNodeExtensionData* getIndividualExtensionData(bool create = true); CSaturationDisjunctCommonConceptExtractionData* getDisjunctCommonConceptExtractionData(bool create = true); CLinkedRoleSaturationSuccessorHash* getLinkedRoleSuccessorHash(bool create = true); CCriticalSaturationConceptTypeQueues* getCriticalConceptTypeQueues(bool create = true); CSaturationIndividualNodeSuccessorExtensionData* getSuccessorExtensionData(bool create = true); CSaturationIndividualNodeNominalHandlingData* getNominalHandlingData(bool create = true); CCriticalPredecessorRoleCardinalityHash* getCriticalPredecessorRoleCardinalityHash(bool create = true); CSaturationIndividualNodeDatatypeData* getAppliedDatatypeData(bool create = true); CRoleBackwardSaturationPropagationHash* getRoleBackwardPropagationHash(bool create = true); CIndividualSaturationProcessNodeLinker* getIndividualSaturationProcessNodeLinker(); CIndividualSaturationProcessNode* setIndividualSaturationProcessNodeLinker(CIndividualSaturationProcessNodeLinker* processNodeLinker); CConceptSaturationProcessLinker* getConceptSaturationProcessLinker(); CConceptSaturationProcessLinker* takeConceptSaturationProcessLinker(); CIndividualSaturationProcessNode* setConceptSaturationProcessLinker(CConceptSaturationProcessLinker* conProcessLinker); CIndividualSaturationProcessNode* addConceptSaturationProcessLinker(CConceptSaturationProcessLinker* conProcessLinker); CIndividualSaturationProcessNode* clearConceptSaturationProcessLinker(); CSaturationSuccessorRoleAssertionLinker* getRoleAssertionLinker(); CIndividualSaturationProcessNode* addRoleAssertionLinker(CSaturationSuccessorRoleAssertionLinker* roleAssertionLinker); CIndividualSaturationProcessNode* addRoleAssertion(CIndividualSaturationProcessNode* destinationNode, CRole* role, bool roleNegation); bool getRequiredBackwardPropagation(); CIndividualSaturationProcessNode* setRequiredBackwardPropagation(bool requiredBackProp); bool hasSubstituteIndividualNode(); CIndividualSaturationProcessNode* getSubstituteIndividualNode(); CIndividualSaturationProcessNode* setSubstituteIndividualNode(CIndividualSaturationProcessNode* indiNode); bool hasCopyIndividualNode(); CIndividualSaturationProcessNode* getCopyIndividualNode(); CIndividualSaturationProcessNode* setCopyIndividualNode(CIndividualSaturationProcessNode* indiNode); bool hasCopyDependingIndividualNodeLinker(); CXNegLinker* getCopyDependingIndividualNodeLinker(); CIndividualSaturationProcessNode* setCopyDependingIndividualNodeLinker(CXNegLinker* indiLinker); CIndividualSaturationProcessNode* addCopyDependingIndividualNodeLinker(CXNegLinker* indiLinker); bool hasDependingSaturationIndividualNode(); CIndividualSaturationProcessNode* getDependingSaturationIndividualNode(); CIndividualSaturationProcessNode* setDependingSaturationIndividualNode(CIndividualSaturationProcessNode* indiNode); bool hasDirectSaturationIndividualNode(); CIndividualSaturationProcessNode* getDirectSaturationIndividualNode(); CIndividualSaturationProcessNode* setDirectSaturationIndividualNode(CIndividualSaturationProcessNode* indiNode); cint64 getIndividualID(); CIndividualSaturationProcessNode* setIndividualID(cint64 indiID); bool isInitialized(); CIndividualSaturationProcessNode* setInitialized(bool initialized); bool isCompleted(); CIndividualSaturationProcessNode* setCompleted(bool completed); CIndividual* getNominalIndividual(); CIndividualSaturationProcessNode* setNominalIndividual(CIndividual* nominalIndi); CBackwardSaturationPropagationLink* getInitializingBackwardPropagationLinks(); CIndividualSaturationProcessNode* setInitializingBackwardPropagationLinks(CBackwardSaturationPropagationLink* backwardPropLinks); CIndividualSaturationProcessNode* addInitializingBackwardPropagationLinks(CBackwardSaturationPropagationLink* backwardPropLinks); CIndividualSaturationProcessNode* getReferenceIndividualSaturationProcessNode(); cint64 getReferenceMode(); CIndividualSaturationProcessNode* setReferenceIndividualSaturationProcessNode(CIndividualSaturationProcessNode* refNode); CIndividualSaturationProcessNode* setReferenceMode(cint64 refMode); CIndividualSaturationProcessNodeStatusFlags* getDirectStatusFlags(); CIndividualSaturationProcessNodeStatusFlags* getIndirectStatusFlags(); bool hasClashedConceptSaturationDescriptorLinker(); CConceptSaturationDescriptor* getClashedConceptSaturationDescriptorLinker(); CIndividualSaturationProcessNode* addClashedConceptSaturationDescriptorLinker(CConceptSaturationDescriptor* clashConSatDes); bool hasNonInverseConnectedIndividualNodeLinker(); CXLinker* getNonInverseConnectedIndividualNodeLinker(); CIndividualSaturationProcessNode* setNonInverseConnectedIndividualNodeLinker(CXLinker* indiLinker); CIndividualSaturationProcessNode* addNonInverseConnectedIndividualNodeLinker(CXLinker* indiLinker); CSuccessorConnectedNominalSet* getSuccessorConnectedNominalSet(bool create = true); bool hasNominalIntegrated(); CIndividualSaturationProcessNode* setIntegratedNominal(CIndividual* nominalIndi); CIndividual* getIntegratedNominalIndividual(); bool hasDataValueApplied(); CIndividualSaturationProcessNode* setDataValueApplied(bool dataApplied); bool hasMultipleCardinalityAncestorNodesLinker(); CXLinker* getMultipleCardinalityAncestorNodesLinker(); CIndividualSaturationProcessNode* setMultipleCardinalityAncestorNodesLinker(CXLinker* indiLinker); CIndividualSaturationProcessNode* addMultipleCardinalityAncestorNodesLinker(CXLinker* indiLinker); bool isIndividualSaturationCompletionNodeLinkerQueued(); CIndividualSaturationProcessNodeLinker* getIndividualSaturationCompletionNodeLinker(bool create = true); CIndividualSaturationProcessNode* setIndividualSaturationCompletionNodeLinker(CIndividualSaturationProcessNodeLinker* processNodeLinker); CIndividualSaturationProcessNodeCacheData* getCacheExpansionData(); CIndividualSaturationProcessNode* setCacheExpansionData(CIndividualSaturationProcessNodeCacheData* cacheData); bool isSeparated(); CIndividualSaturationProcessNode* setSeparated(bool separated); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CMemoryAllocationManager* mMemAllocMan; CExtendedConceptReferenceLinkingData* mConceptSaturationLinkRefData; CIndividualSaturationReferenceLinkingData* mIndividualSaturationLinkRefData; CRoleBackwardSaturationPropagationHash* mRoleBackPropHash; CReapplyConceptSaturationLabelSet* mReapplyConSatLabelSet; CIndividualSaturationProcessNodeExtensionData* mIndiExtensionData; CIndividualSaturationProcessNodeLinker* mIndiProcessLinker; CIndividualSaturationProcessNodeLinker* mIndiCompletionLinker; CConceptSaturationProcessLinker* mConceptSaturationProcessLinker; CIndividualSaturationProcessNode* mSubstituteIndiNode; CIndividualSaturationProcessNode* mCopyIndiNode; CIndividualSaturationProcessNodeStatusFlags mDirectStatusFlags; CIndividualSaturationProcessNodeStatusFlags mIndirectStatusFlags; bool mRequiredBackProp; bool mDataValueApplied; CConceptSaturationDescriptor* mClashedConSatDesLinker; CXNegLinker* mDependingIndiNodeLinker; CXLinker* mNonInverseConnectedIndiNodeLinker; CXLinker* mMultipleCardinalityAncestorNodesLinker; CIndividualSaturationProcessNode* mDepSaturationIndiNode; CIndividualSaturationProcessNode* mDirectSaturationIndiNode; cint64 mIndiID; CBackwardSaturationPropagationLink* mInitBackwardPropLinks; CIndividual* mNominalIndi; CIndividual* mIntegratedNominalIndi; CIndividualSaturationProcessNodeCacheData* mCacheData; CIndividualSaturationProcessNode* mReferenceIndiNode; cint64 mReferenceMode; bool mSeparatedSaturation; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDistinctHash.h0000644000175000017500000000465612520551120025543 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDISTINCTHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDISTINCTHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CDistinctIterator.h" #include "CDistinctEdge.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CDistinctHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDistinctHash : public CPROCESSHASH { // public methods public: //! Constructor CDistinctHash(CContext* context = nullptr); CDistinctHash(const CDistinctHash& disHash, CContext* context = nullptr); //! Destructor virtual ~CDistinctHash(); CDistinctHash* initDistinctHash(CDistinctHash* prevHash); bool isIndividualDistinct(cint64 indiID); CDistinctEdge* getIndividualDistinctEdge(cint64 indiID); CDistinctHash* insertDistinctIndividual(cint64 indiID, CDistinctEdge* disEdge = nullptr); CDistinctHash* removeDistinctIndividual(cint64 indiID); cint64 getDistinctCount(); CDistinctIterator getDistinctIterator(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDISTINCTHASH_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptRepresentativePropagationSetHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptRepresentativePropagationSetHa0000644000175000017500000000463512520551102032372 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTREPRESENTATIVEPROPAGATIONSETHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTREPRESENTATIVEPROPAGATIONSETHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRepresentativePropagationSet.h" #include "CConceptRepresentativePropagationSetHashData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConceptRepresentativePropagationSetHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptRepresentativePropagationSetHash : public CPROCESSHASH { // public methods public: //! Constructor CConceptRepresentativePropagationSetHash(CProcessContext* processContext); CConceptRepresentativePropagationSetHash* initConceptRepresentativePropagationSetHash(CConceptRepresentativePropagationSetHash* prevHash); CRepresentativePropagationSet* getRepresentativePropagationSet(CConcept* concept, bool localize = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTREPRESENTATIVEPROPAGATIONSETHASH_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeBinaryBase64DataValueSpaceData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeBinaryBase64DataValueSpaceDat0000644000175000017500000000540412520551106032005 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBINARYBASE64DATAVALUESPACEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBINARYBASE64DATAVALUESPACEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeBinaryDataValueSpaceMap.h" #include "CDatatypeCompareValueSpaceData.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceBinaryBase64DataType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeBinaryBase64DataValueSpaceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeBinaryBase64DataValueSpaceData : public CDatatypeCompareValueSpaceData { // public methods public: //! Constructor CDatatypeBinaryBase64DataValueSpaceData(CProcessContext* processContext); CDatatypeBinaryBase64DataValueSpaceData* copyBinaryBase64DataValueSpaceData(CDatatypeBinaryBase64DataValueSpaceData* spaceData); CDatatypeBinaryBase64DataValueSpaceData* initBinaryBase64DataValueSpaceData(CDatatypeValueSpaceBinaryBase64DataType* valueSpaceType); CDatatypeBinaryDataValueSpaceMap* getBinaryBase64DataValueSpaceMap(bool create); // protected methods protected: virtual CDatatypeCompareValueSpaceMap* createValueSpaceMap(); // protected variables protected: CDatatypeBinaryDataValueSpaceMap* mBinaryBase64DataValueSpaceMap; CDatatypeValueSpaceBinaryBase64DataType* mValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEBINARYBASE64DATAVALUESPACEDATA_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandidateHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandid0000644000175000017500000000657312520551160032270 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSignatureBlockingIndividualNodeCandidateHash_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSignatureBlockingIndividualNodeCandidateHash_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CIndividualProcessNode.h" #include "CSignatureBlockingIndividualNodeCandidateData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSignatureBlockingIndividualNodeCandidateHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureBlockingIndividualNodeCandidateHash { // public methods public: //! Constructor CSignatureBlockingIndividualNodeCandidateHash(CProcessContext* context = nullptr); //! Destructor virtual ~CSignatureBlockingIndividualNodeCandidateHash(); CSignatureBlockingIndividualNodeCandidateHash* initBlockingIndividualNodeCandidateHash(CSignatureBlockingIndividualNodeCandidateHash* prevBlockCandHash); CSignatureBlockingIndividualNodeCandidateData* getBlockingIndividualCandidateData(cint64 signature, bool create = true); // protected methods protected: // protected variables protected: class CSignatureBlockingCandidateHashData { public: inline CSignatureBlockingCandidateHashData() { mCandidateIndiData = nullptr; mPrevCandidateIndiData = nullptr; } inline CSignatureBlockingCandidateHashData(const CSignatureBlockingCandidateHashData& data) { mCandidateIndiData = nullptr; mPrevCandidateIndiData = data.mPrevCandidateIndiData; } CSignatureBlockingIndividualNodeCandidateData* mCandidateIndiData; CSignatureBlockingIndividualNodeCandidateData* mPrevCandidateIndiData; }; CProcessContext* mContext; CMemoryAllocationManager* mMemMan; CPROCESSHASH* mBlockCandidateHash; CPROCESSHASH* mUseBlockCandidateHash; CPROCESSHASH* mPrevBlockCandidateHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSignatureBlockingIndividualNodeCandidateHash_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalPredecessorRoleCardinalityHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalPredecessorRoleCardinalityHas0000644000175000017500000000537312520551106032324 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALPREDECESSORROLECARDINALITYHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALPREDECESSORROLECARDINALITYHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CCriticalPredecessorRoleCardinalityData.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CCriticalPredecessorRoleCardinalityHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCriticalPredecessorRoleCardinalityHash { // public methods public: //! Constructor CCriticalPredecessorRoleCardinalityHash(CProcessContext* context = nullptr); CCriticalPredecessorRoleCardinalityHash* initCriticalPredecessorRoleCardinalityHash(); CCriticalPredecessorRoleCardinalityHash* copyCriticalPredecessorRoleCardinalityHash(CCriticalPredecessorRoleCardinalityHash* copyRoleSuccHash); CCriticalPredecessorRoleCardinalityHash* addCriticalPredecessorRoleCardinality(CRole* role, CConcept* unproblematicConcept, bool unproblematicNegation); CCriticalPredecessorRoleCardinalityData* getCriticalPredecessorRoleCardinalityData(CRole* role, bool forceCreation = false); // protected methods protected: // protected variables protected: CProcessContext* mContext; CPROCESSHASH mCriticalPredecessorRoleDataHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALPREDECESSORROLECARDINALITYHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingFollowSet.h0000644000175000017500000000403712520551072026544 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGFOLLOWSET_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGFOLLOWSET_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CBlockingFollowUpdateTag.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CBlockingFollowSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBlockingFollowSet : public CPROCESSSET, public CBlockingFollowUpdateTag { // public methods public: //! Constructor CBlockingFollowSet(CProcessContext* context = nullptr); CBlockingFollowSet* initBlockingFollowSet(CBlockingFollowSet* sigBlockFollowSet); // protected methods protected: // protected variables protected: CProcessContext* mContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGFOLLOWSET_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualProcessNodePriority.h0000644000175000017500000000551012520551126031151 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODEPRIORITY_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODEPRIORITY_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualProcessNodePriority * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodePriority { // public methods public: //! Constructor CIndividualProcessNodePriority(double conPriority = 0., double indiPriority = 0., bool stirctOrder = true); bool isNullPriority() const; CIndividualProcessNodePriority* setPriorityToNull(); double getConceptPriority() const; double getIndividualPriority() const; CIndividualProcessNodePriority* setPriority(double conPriority, double indiPriority); bool operator==(const CIndividualProcessNodePriority& indiPriority) const; bool operator!=(const CIndividualProcessNodePriority& indiPriority) const; bool operator<=(const CIndividualProcessNodePriority& indiPriority) const; bool operator>=(const CIndividualProcessNodePriority& indiPriority) const; // is priority sorted before this? bool operator<(const CIndividualProcessNodePriority& indiPriority) const; // is priority sorted after this? bool operator>(const CIndividualProcessNodePriority& indiPriority) const; // protected methods protected: // protected variables protected: double mPriorityCon; double mPriorityInd; bool mStrictOrder; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODEPRIORITY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleSuccessorLinkIterator.h0000644000175000017500000000475012520551152030301 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CROLESUCCESSORLINKITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CROLESUCCESSORLINKITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualLinkEdge.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRoleSuccessorLinkIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleSuccessorLinkIterator { // public methods public: //! Constructor CRoleSuccessorLinkIterator(); CRoleSuccessorLinkIterator(const CPROCESSHASH::iterator& beginIt, const CPROCESSHASH::iterator& endIt); CRoleSuccessorLinkIterator(CIndividualLinkEdge* linkLinker, CIndividualLinkEdge* lastLink = nullptr); bool hasNext(); CIndividualLinkEdge* next(bool moveNext = true); // protected methods protected: // protected variables protected: CIndividualLinkEdge* mLinkLinker; CIndividualLinkEdge* mLastLink; CPROCESSHASH::iterator mBeginIt; CPROCESSHASH::iterator mEndIt; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CROLESUCCESSORLINKITERATOR_H ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationPredecessorFUNCTIONALConceptExtensionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationPredecessorFUNCTIONALConcep0000644000175000017500000000555612520551156032004 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONPREDECESSORFUNCTIONALCONCEPTEXTENSIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONPREDECESSORFUNCTIONALCONCEPTEXTENSIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CSaturationSuccessorData.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSaturationPredecessorFUNCTIONALConceptExtensionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationPredecessorFUNCTIONALConceptExtensionData : public CLinkerBase { // public methods public: //! Constructor CSaturationPredecessorFUNCTIONALConceptExtensionData(CProcessContext* processContext); CSaturationPredecessorFUNCTIONALConceptExtensionData* initPredecessorMergedConceptExtensionData(CRole* role); bool isExtensionProcessingQueued(); CSaturationPredecessorFUNCTIONALConceptExtensionData* setExtensionProcessingQueued(bool queued); CRole* getRole(); CSaturationSuccessorData* getLastPredecessorMergedLinkedSuccessorData(); CSaturationPredecessorFUNCTIONALConceptExtensionData* setLastPredecessorMergedLinkedSuccessorData(CSaturationSuccessorData* lastExaminedLinkedSucc); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CRole* mRole; CSaturationSuccessorData* mLastPredecessorMergedLinkedSucc; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONPREDECESSORFUNCTIONALCONCEPTEXTENSIONDATA_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateIterator.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateIterat0000644000175000017500000000550312520551074032245 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBlockingIndividualNodeCandidateIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBlockingIndividualNodeCandidateIterator::CBlockingIndividualNodeCandidateIterator(CPROCESSMAP* candidateMap, cint64 candidateIndividualID) : mCandidateMap(candidateMap) { if (mCandidateMap) { mItBegin = mCandidateMap->upperBound(-candidateIndividualID); mItEnd = mCandidateMap->end(); mItLast = mItBegin; } } bool CBlockingIndividualNodeCandidateIterator::hasNext() { return mCandidateMap && mItBegin != mItEnd; } bool CBlockingIndividualNodeCandidateIterator::hasIndividualCandidates() { return mCandidateMap && !mCandidateMap->isEmpty(); } cint64 CBlockingIndividualNodeCandidateIterator::next(bool moveNext) { CIndividualProcessNode* indi = nextIndividualCandidate(moveNext); if (indi) { return indi->getIndividualID(); } return 0; } CIndividualProcessNode* CBlockingIndividualNodeCandidateIterator::nextIndividualCandidate(bool moveNext) { CIndividualProcessNode* indi = nullptr; if (mCandidateMap && mItBegin != mItEnd) { indi = mItBegin.value(); mItLast = mItBegin; if (moveNext) { ++mItBegin; } } return indi; } bool CBlockingIndividualNodeCandidateIterator::removeLastIndividualCandidate() { if (mItLast != mItEnd) { mItBegin = mCandidateMap->erase(mItLast); mItLast = mItBegin; return true; } return false; } bool CBlockingIndividualNodeCandidateIterator::hasIndividualCandidate(cint64 indiID) { return mCandidateMap && mCandidateMap->contains(-indiID); } bool CBlockingIndividualNodeCandidateIterator::hasIndividualCandidate(CIndividualProcessNode* indi) { return hasIndividualCandidate(indi->getIndividualID()); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReusedIndividualNodeData.cpp0000644000175000017500000000374212520551150030347 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReusedIndividualNodeData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CReusedIndividualNodeData::CReusedIndividualNodeData() { } CReusedIndividualNodeData* CReusedIndividualNodeData::initReusedExpansionData(CReusedIndividualNodeData* prevData) { if (prevData) { mReusedTriedCount = prevData->mReusedTriedCount; mReusedFailedCount = prevData->mReusedFailedCount; } else { mReusedTriedCount = 0; mReusedFailedCount = 0; } return this; } cint64 CReusedIndividualNodeData::getReusedTriedCount() { return mReusedTriedCount; } cint64 CReusedIndividualNodeData::getReusedFailedCount() { return mReusedFailedCount; } CReusedIndividualNodeData* CReusedIndividualNodeData::setReusedTriedCount(cint64 triedCount) { mReusedTriedCount = triedCount; return this; } CReusedIndividualNodeData* CReusedIndividualNodeData::setReusedFailedCount(cint64 failedCount) { mReusedFailedCount = failedCount; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoin0000644000175000017500000000605612520551144032330 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHJOININGKEYHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHJOININGKEYHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CVariableBindingPathJoiningData.h" #include "CRepresentativeVariableBindingPathJoiningKeyHashData.h" #include "CRepresentativeVariableBindingPathJoiningKeyHasher.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathJoiningKeyHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathJoiningKeyHash : public CPROCESSHASH { // public methods public: //! Constructor CRepresentativeVariableBindingPathJoiningKeyHash(CProcessContext* context); CRepresentativeVariableBindingPathJoiningKeyHash* initRepresentativeVariableBindingPathJoiningKeyHash(CRepresentativeVariableBindingPathJoiningKeyHash* prevHash); CVariableBindingDescriptor* createVariableBindingHashKeyDescriptor(CVariableBindingPath* varBindPath, CSortedLinker* keyVars); CRepresentativeVariableBindingPathJoiningKeyData* getRepresentativeVariableBindingPathJoiningKeyData(CVariableBindingPath* varBindPath, CSortedLinker* keyVars, bool create = true); cint64 getRepresentativeVariableBindingPathJoiningKey(CVariableBindingPath* varBindPath, CSortedLinker* keyVars, bool create = true); // protected methods protected: // protected variables protected: CProcessContext* mContext; cint64 mNextRepVarBindPathJoiningKeyTag; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHJOININGKEYHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningData.h0000644000175000017500000001052612520551164031124 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHJOININGDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHJOININGDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CVariableBindingDescriptor.h" #include "CVariableBindingPathDescriptor.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Utilities/CSortedLinker.hpp" #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CVariableBindingPathJoiningData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingPathJoiningData { // public methods public: //! Constructor CVariableBindingPathJoiningData(); CVariableBindingPathJoiningData* initVariableBindingPathJoiningData(CVariableBindingPathJoiningData* prevJoinData); CVariableBindingPathJoiningData* initVariableBindingPathJoiningData(CVariableBindingDescriptor* keyVarBindDesLinker, CVariableBindingPathDescriptor* leftVarBindPathDesLinker, CVariableBindingPathDescriptor* rightVarBindPathDesLinker); CVariableBindingDescriptor* getKeyVariableBindingDescriptorLinker() const; CVariableBindingPathDescriptor* getLeftVariableBindingPathDescriptorLinker() const; CVariableBindingPathDescriptor* getRightVariableBindingPathDescriptorLinker() const; CVariableBindingDescriptor* getNextKeyTriggerLinker(bool moveNext = false); CVariableBindingPathJoiningData* setKeyVariableBindingDescriptorLinker(CVariableBindingDescriptor* keyVarBindDesLinker); CVariableBindingPathJoiningData* setLeftVariableBindingPathDescriptorLinker(CVariableBindingPathDescriptor* leftVarBindPathDesLinker); CVariableBindingPathJoiningData* setRightVariableBindingPathDescriptorLinker(CVariableBindingPathDescriptor* rightVarBindPathDesLinker); CVariableBindingPathJoiningData* setNextKeyTriggerLinker(CVariableBindingDescriptor* nextKeyTrigger); CVariableBindingPathJoiningData* addKeyVariableBindingDescriptorLinker(CVariableBindingDescriptor* keyVarBindDesLinker); CVariableBindingPathJoiningData* addLeftVariableBindingPathDescriptorLinker(CVariableBindingPathDescriptor* leftVarBindPathDesLinker); CVariableBindingPathJoiningData* addRightVariableBindingPathDescriptorLinker(CVariableBindingPathDescriptor* rightVarBindPathDesLinker); bool allKeyTriggersAvailable(); CVariableBindingPathJoiningData* setAllKeyTriggersAvailable(bool allAvailable); cint64 getCalculatedHashValue() const; bool isKeyEquivalentTo(const CVariableBindingPathJoiningData& data) const; bool isKeyEquivalentTo(CVariableBindingPath* varBindPath) const; // protected methods protected: // protected variables protected: mutable cint64 mCalculatedHashValue; mutable bool mHashValueCalculated; CVariableBindingDescriptor* mKeyVarBindDesLinker; CVariableBindingPathDescriptor* mLeftVarBindPathDesLinker; CVariableBindingPathDescriptor* mRightVarBindPathDesLinker; bool mAllKeyTriggersAvailable; CVariableBindingDescriptor* mNextKeyTriggerLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHJOININGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptNominalSchemaGroundingHasher.h0000644000175000017500000000470612520551100032212 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTNOMINALSCHEMAGROUNDINGHASHER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTNOMINALSCHEMAGROUNDINGHASHER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptNominalSchemaGroundingData.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConceptNominalSchemaGroundingHasher * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptNominalSchemaGroundingHasher { // public methods public: //! Constructor CConceptNominalSchemaGroundingHasher(CConceptNominalSchemaGroundingData* data); cint64 getHashValue() const; bool operator==(const CConceptNominalSchemaGroundingHasher& hasher) const; // protected methods protected: // protected variables protected: CConceptNominalSchemaGroundingData* mData; cint64 mHashValue; // private methods private: // private variables private: }; inline uint qHash(const CConceptNominalSchemaGroundingHasher& hasher) { qint64 key = (qint64)hasher.getHashValue(); if (sizeof(quint64) > sizeof(uint)) { return uint((key >> (8 * sizeof(uint) - 1)) ^ key); } else { return uint(key); } } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTNOMINALSCHEMAGROUNDINGHASHER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativePropagationSet.cpp0000644000175000017500000001451612520551144031373 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativePropagationSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativePropagationSet::CRepresentativePropagationSet(CProcessContext* processContext) : mProcessContext(processContext),mRepPropMap(processContext) { } CRepresentativePropagationSet* CRepresentativePropagationSet::initRepresentativePropagationSet(CRepresentativePropagationSet* prevSet) { if (prevSet) { mRepPropMap.initRepresentativePropagationMap(&prevSet->mRepPropMap); mIncomingRepPropSignature.initSignature(&prevSet->mIncomingRepPropSignature); mConceptDescriptor = prevSet->mConceptDescriptor; mIncomingRepPropDesLinker = prevSet->mIncomingRepPropDesLinker; mOutgoingRepPropDesLinker = prevSet->mOutgoingRepPropDesLinker; mLastProcessedIncomingRepPropDesLinker = prevSet->mLastProcessedIncomingRepPropDesLinker; } else { mRepPropMap.initRepresentativePropagationMap(nullptr); mIncomingRepPropSignature.initSignature(nullptr); mConceptDescriptor = nullptr; mIncomingRepPropDesLinker = nullptr; mOutgoingRepPropDesLinker = nullptr; mLastProcessedIncomingRepPropDesLinker = nullptr; } return this; } bool CRepresentativePropagationSet::containsRepresentativePropagation(CRepresentativeVariableBindingPathSetData* repVarBindPathSetData) { return mRepPropMap.contains(repVarBindPathSetData->getRepresentativeID()); } bool CRepresentativePropagationSet::containsRepresentativePropagation(cint64 repID) { return mRepPropMap.contains(repID); } CRepresentativePropagationDescriptor* CRepresentativePropagationSet::getRepresentativePropagationDescriptor(CRepresentativeVariableBindingPathSetData* repVarBindPathSetData) { return mRepPropMap.value(repVarBindPathSetData->getRepresentativeID()).getRepresentativePropagationDescriptor(); } CRepresentativePropagationMap* CRepresentativePropagationSet::getRepresentativePropagationMap() { return &mRepPropMap; } CRepresentativePropagationSet* CRepresentativePropagationSet::addIncomingRepresentativePropagation(CRepresentativePropagationDescriptor* repPropDes) { CRepresentativePropagationMapData& data = mRepPropMap[repPropDes->getRepresentativeVariableBindingPathSetData()->getRepresentativeID()]; if (!data.hasRepresentativePropagationDescriptor()) { data.setRepresentativePropagationDescriptor(repPropDes); if (mIncomingRepPropDesLinker) { mIncomingRepPropSignature.addKey(repPropDes->getRepresentativeVariableBindingPathSetData()->getRepresentativeKey()); } else { mIncomingRepPropSignature.initSignature(repPropDes->getRepresentativeVariableBindingPathSetData()->getKeySignature()); } mIncomingRepPropDesLinker = repPropDes->append(mIncomingRepPropDesLinker); } return this; } CRepresentativePropagationSet* CRepresentativePropagationSet::copyRepresentativePropagations(CRepresentativePropagationMap* repPropMap) { if (repPropMap) { mRepPropMap = *repPropMap; } return this; } CConceptDescriptor* CRepresentativePropagationSet::getConceptDescriptor() { return mConceptDescriptor; } CRepresentativePropagationSet* CRepresentativePropagationSet::setConceptDescriptor(CConceptDescriptor* conDes) { mConceptDescriptor = conDes; return this; } CRepresentativePropagationSet* CRepresentativePropagationSet::addIncomingRepresentativePropagationDescriptorLinker(CRepresentativePropagationDescriptor* repPropDesLinker) { for (CRepresentativePropagationDescriptor* repPropDesLinkerIt = repPropDesLinker; repPropDesLinkerIt; repPropDesLinkerIt = repPropDesLinkerIt->getNext()) { mIncomingRepPropSignature.addKey(repPropDesLinkerIt->getRepresentativeVariableBindingPathSetData()->getRepresentativeKey()); } mIncomingRepPropDesLinker = repPropDesLinker->append(mIncomingRepPropDesLinker); return this; } CRepresentativePropagationDescriptor* CRepresentativePropagationSet::getIncomingRepresentativePropagationDescriptorLinker() { return mIncomingRepPropDesLinker; } CRepresentativePropagationSet* CRepresentativePropagationSet::setOutgoingRepresentativePropagationDescriptorLinker(CRepresentativePropagationDescriptor* repPropDesLinker) { mOutgoingRepPropDesLinker = repPropDesLinker; return this; } CRepresentativePropagationSet* CRepresentativePropagationSet::addOutgoingRepresentativePropagationDescriptorLinker(CRepresentativePropagationDescriptor* repPropDesLinker) { mOutgoingRepPropDesLinker = repPropDesLinker->append(mOutgoingRepPropDesLinker); return this; } CRepresentativePropagationDescriptor* CRepresentativePropagationSet::getOutgoingRepresentativePropagationDescriptorLinker() { return mOutgoingRepPropDesLinker; } cint64 CRepresentativePropagationSet::getIncomingRepresentativePropagationSignatureKey() { return mIncomingRepPropSignature.getSignatureValue(); } CRepresentativePropagationDescriptor* CRepresentativePropagationSet::getLastProcessedIncomingRepresentativePropagationDescriptorLinker() { return mLastProcessedIncomingRepPropDesLinker; } CRepresentativePropagationSet* CRepresentativePropagationSet::setLastProcessedIncomingRepresentativePropagationDescriptorLinker(CRepresentativePropagationDescriptor* descriptor) { mLastProcessedIncomingRepPropDesLinker = descriptor; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningHasher.cpp0000644000175000017500000000575012520551164032023 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingPathJoiningHasher.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingPathJoiningHasher::CVariableBindingPathJoiningHasher(CVariableBindingPathJoiningData* data) { mVarBindPath = nullptr; mKeyVars = nullptr; mJoiningData = data; mHashValue = mJoiningData->getCalculatedHashValue(); } CVariableBindingPathJoiningHasher::CVariableBindingPathJoiningHasher(CVariableBindingPath* varBindPath, CSortedLinker* keyVars) { mJoiningData = nullptr; mVarBindPath = varBindPath; mKeyVars = keyVars; mHashValue = calculateHashValue(mVarBindPath,mKeyVars); } cint64 CVariableBindingPathJoiningHasher::calculateHashValue(CVariableBindingPath* varBindPath, CSortedLinker* keyVars) { cint64 hashValue = 0; CSortedLinker* keyVarsIt = keyVars; cint64 multiplier = 13; for (CVariableBindingDescriptor* linkerIt = varBindPath->getVariableBindingDescriptorLinker(); keyVarsIt && linkerIt; linkerIt = linkerIt->getNext()) { CVariableBinding* variableBinding = linkerIt->getVariableBinding(); CVariable* variable = variableBinding->getBindedVariable(); CVariable* keyVariable = keyVarsIt->getData(); if (variable == keyVariable) { hashValue += multiplier*(cint64)variableBinding; multiplier = multiplier*2+1; keyVarsIt = keyVarsIt->getNext(); } } return hashValue; } cint64 CVariableBindingPathJoiningHasher::getHashValue() const { return mHashValue; } bool CVariableBindingPathJoiningHasher::operator==(const CVariableBindingPathJoiningHasher& hasher) const { if (mJoiningData && hasher.mJoiningData) { return mJoiningData->isKeyEquivalentTo(*hasher.mJoiningData); } else if (mJoiningData && hasher.mVarBindPath) { return mJoiningData->isKeyEquivalentTo(hasher.mVarBindPath); } else if (mVarBindPath && hasher.mJoiningData) { return hasher.mJoiningData->isKeyEquivalentTo(mVarBindPath); } return false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeALLConceptsExtensionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeALLConceptsEx0000644000175000017500000000774112520551152032230 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEALLCONCEPTSEXTENSIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEALLCONCEPTSEXTENSIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRoleSaturationProcessLinker.h" #include "CSaturationSuccessorALLConceptExtensionData.h" #include "CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationIndividualNodeALLConceptsExtensionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationIndividualNodeALLConceptsExtensionData { // public methods public: //! Constructor CSaturationIndividualNodeALLConceptsExtensionData(CProcessContext* processContext); CSaturationIndividualNodeALLConceptsExtensionData* initALLConceptsExtensionData(CIndividualSaturationProcessNode* indiProcessNode); bool isSuccessorExtensionInitialized(); CSaturationIndividualNodeALLConceptsExtensionData* setSuccessorExtensionInitialized(bool initialized); CRoleSaturationProcessLinker* getRoleProcessLinker(); CRoleSaturationProcessLinker* takeRoleProcessLinker(); CSaturationIndividualNodeALLConceptsExtensionData* addRoleProcessLinker(CRoleSaturationProcessLinker* roleProcessLinker); bool hasProcessLinkerForRole(CRole* role); bool isExtensionProcessingQueued(); CSaturationIndividualNodeALLConceptsExtensionData* setExtensionProcessingQueued(bool queued); CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash* getLinkedSuccessorIndividualALLConceptsExtensionHash(); CSaturationLinkedSuccessorIndividualALLConceptsExtensionData* getALLConceptsExtensionData(CIndividualSaturationProcessNode* indiNode, bool create = true); bool hasExtensionProcessData(); CSaturationSuccessorALLConceptExtensionData* takeNextExtensionProcessData(); CSaturationSuccessorALLConceptExtensionData* getExtensionProcessDataLinker(); CSaturationIndividualNodeALLConceptsExtensionData* addExtensionProcessData(CSaturationSuccessorALLConceptExtensionData* processData); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; bool mSuccessorExtensionInitialized; bool mExtensionProcessingQueued; CRoleSaturationProcessLinker* mRoleProcessLinker; CIndividualSaturationProcessNode* mIndiProcessNode; CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash mLinkedSuccIdnALLConceptExtHash; CSaturationSuccessorALLConceptExtensionData* mExtensionProcessLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEALLCONCEPTSEXTENSIONDATA_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorRoleAssertionLinker.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorRoleAssertionLinke0000644000175000017500000000370612520551160032447 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationSuccessorRoleAssertionLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationSuccessorRoleAssertionLinker::CSaturationSuccessorRoleAssertionLinker() : CLinkerBase(nullptr) { mRole = nullptr; mRoleNegation = false; } CSaturationSuccessorRoleAssertionLinker* CSaturationSuccessorRoleAssertionLinker::initSaturationSuccessorRoleAssertionLinker(CIndividualSaturationProcessNode* indiSatNode, CRole* role, bool roleNegation) { initLinker(indiSatNode); mRole = role; mRoleNegation = roleNegation; return this; } CRole* CSaturationSuccessorRoleAssertionLinker::getAssertionRole() { return mRole; } bool CSaturationSuccessorRoleAssertionLinker::getAssertionRoleNegation() { return mRoleNegation; } CIndividualSaturationProcessNode* CSaturationSuccessorRoleAssertionLinker::getAssertionDestinationNode() { return getData(); } }; // end namespace Kernel }; // end namespace Process }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningData.cpp0000644000175000017500000000346712520551144030626 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeJoiningData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeJoiningData::CRepresentativeJoiningData(CProcessContext* processContext) : mProcessContext(processContext),mJoiningCommonKeyMap(processContext) { mJoiningAllExtension = nullptr; } CRepresentativeJoiningCommonKeyMap* CRepresentativeJoiningData::getRepresentativeJoiningCommonKeyMap() { return &mJoiningCommonKeyMap; } CRepresentativeJoiningAllDataExtension* CRepresentativeJoiningData::getJoiningAllExtension(bool create) { if (create && !mJoiningAllExtension) { mJoiningAllExtension = CObjectParameterizingAllocator< CRepresentativeJoiningAllDataExtension,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); } return mJoiningAllExtension; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCacheStoringData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCac0000644000175000017500000000713312520551124032237 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATISFIABLEEXPANDINGCACHESTORINGDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATISFIABLEEXPANDINGCACHESTORINGDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "CIndividualNodeSatisfiableCacheStoringData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualNodeSatisfiableExpandingCacheStoringData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeSatisfiableExpandingCacheStoringData : public CIndividualNodeSatisfiableCacheStoringData { // public methods public: //! Constructor CIndividualNodeSatisfiableExpandingCacheStoringData(); //! Destructor virtual ~CIndividualNodeSatisfiableExpandingCacheStoringData(); CIndividualNodeSatisfiableExpandingCacheStoringData* initSatisfiableExpandingCacheRetrievalData(CIndividualNodeSatisfiableExpandingCacheStoringData* prevData); bool hasIndividualNodeOrSuccessorBranchedConcept(); CIndividualNodeSatisfiableExpandingCacheStoringData* setIndividualNodeOrSuccessorBranchedConcept(bool branched); bool hasPreviousCached(); CIndividualNodeSatisfiableExpandingCacheStoringData* setPreviousCached(bool cached); cint64 getLastCachedSignature(); CIndividualNodeSatisfiableExpandingCacheStoringData* setLastCachedSignature(cint64 signature); CConceptDescriptor* getLastCachedConceptDescriptor(); CIndividualNodeSatisfiableExpandingCacheStoringData* setLastCachedConceptDescriptor(CConceptDescriptor* conDes); cint64 getMinimalIndividualNodeBranchingTag(); CIndividualNodeSatisfiableExpandingCacheStoringData* setMinimalIndividualNodeBranchingTag(cint64 branchingTag); bool hasCachingError(); CIndividualNodeSatisfiableExpandingCacheStoringData* setCachingError(bool error); bool hasPreviousSatisfiableCached(); CIndividualNodeSatisfiableExpandingCacheStoringData* setPreviousSatisfiableCached(bool cached); // protected methods protected: // protected variables protected: bool mNodeSuccBranched; bool mPrevCached; cint64 mLastCachedSignature; CConceptDescriptor* mLastCachedConDes; bool mCachingError; cint64 mMinNodeBranchingTag; bool mPrevSatCached; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATISFIABLEEXPANDINGCACHESTORINGDATA_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingReviewDataIterator.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingReviewDataIterator.c0000644000175000017500000000602612520551162032250 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureBlockingReviewDataIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSignatureBlockingReviewDataIterator::CSignatureBlockingReviewDataIterator(CPROCESSSET* individualSet, CPROCESSMAP* depthIndividualMap) : mIndividualSet(individualSet), mDepthIndividualMap(depthIndividualMap) { mDepthIndividualMapIt = mDepthIndividualMap->begin(); mDepthIndividualMapItEnd = mDepthIndividualMap->end(); while (mDepthIndividualMapIt != mDepthIndividualMapItEnd) { cint64 indiID = mDepthIndividualMapIt.value(); if (mIndividualSet->contains(indiID)) { break; } else { mDepthIndividualMapIt = mDepthIndividualMap->erase(mDepthIndividualMapIt); } } } bool CSignatureBlockingReviewDataIterator::hasNext() { return mDepthIndividualMapIt != mDepthIndividualMapItEnd; } bool CSignatureBlockingReviewDataIterator::removeAndMoveNext() { if (mDepthIndividualMapIt != mDepthIndividualMapItEnd) { cint64 indiID = mDepthIndividualMapIt.value(); mIndividualSet->remove(indiID); mDepthIndividualMapIt = mDepthIndividualMap->erase(mDepthIndividualMapIt); while (mDepthIndividualMapIt != mDepthIndividualMapItEnd) { cint64 indiID = mDepthIndividualMapIt.value(); if (mIndividualSet->contains(indiID)) { break; } else { mDepthIndividualMapIt = mDepthIndividualMap->erase(mDepthIndividualMapIt); } } return true; } return false; } cint64 CSignatureBlockingReviewDataIterator::next(bool moveNext) { cint64 indiID = -1; if (mDepthIndividualMapIt != mDepthIndividualMapItEnd) { indiID = mDepthIndividualMapIt.value(); if (moveNext) { while (mDepthIndividualMapIt != mDepthIndividualMapItEnd) { cint64 indiID = mDepthIndividualMapIt.value(); if (mIndividualSet->contains(indiID)) { break; } else { mDepthIndividualMapIt = mDepthIndividualMap->erase(mDepthIndividualMapIt); } } } } return indiID; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeCompareValueData.cpp0000644000175000017500000000515512520551106030361 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeCompareValueData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeCompareValueData::CDatatypeCompareValueData(CProcessContext* processContext) { mProcessContext = processContext; mValue = nullptr; } CDatatypeCompareValueData* CDatatypeCompareValueData::initCompareValueData(CDatatypeCompareValueData* valueData, CDataLiteralCompareValue* value) { mValue = value; if (valueData) { mValueExclusionData.initDataExclusion(&valueData->mValueExclusionData); mLeftExclusionData.initDataExclusion(&valueData->mLeftExclusionData); mRightExclusionData.initDataExclusion(&valueData->mRightExclusionData); } else { mValueExclusionData.initDataExclusion(nullptr); mLeftExclusionData.initDataExclusion(nullptr); mRightExclusionData.initDataExclusion(nullptr); } return this; } CDatatypeCompareValueData* CDatatypeCompareValueData::initCompareValueData(CDataLiteralCompareValue* value) { mValue = value; return this; } CDataLiteralCompareValue* CDatatypeCompareValueData::getValue() { return mValue; } CDatatypeCompareValueData* CDatatypeCompareValueData::setValue(CDataLiteralCompareValue* value) { mValue = value; return this; } CDatatypeCompareValueDataExclusion* CDatatypeCompareValueData::getValueExclusionData() { return &mValueExclusionData; } CDatatypeCompareValueDataExclusion* CDatatypeCompareValueData::getLeftExclusionData() { return &mLeftExclusionData; } CDatatypeCompareValueDataExclusion* CDatatypeCompareValueData::getRightExclusionData() { return &mRightExclusionData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReferredIndividualTrackingData.cpp0000644000175000017500000000315012520551142031525 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReferredIndividualTrackingData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CReferredIndividualTrackingData::CReferredIndividualTrackingData() { mReferred = false; mExtended = false; } bool CReferredIndividualTrackingData::isReferred() { return mReferred; } bool CReferredIndividualTrackingData::isExtended() { return mExtended; } CReferredIndividualTrackingData* CReferredIndividualTrackingData::setReferred() { mReferred = true; return this; } CReferredIndividualTrackingData* CReferredIndividualTrackingData::setExtended() { mExtended = true; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCondensedReapplyConceptDescriptor.cpp0000644000175000017500000000544612520551104032323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCondensedReapplyConceptDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CCondensedReapplyConceptDescriptor::CCondensedReapplyConceptDescriptor(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint *depTrackPoint, bool isPositiveDes) : CReapplyConceptDescriptor() { mConceptDes = conceptDescriptor; mTrackPoint = depTrackPoint; mStatic = false; mProcessingRestriction = nullptr; mPositive = isPositiveDes; } CCondensedReapplyConceptDescriptor::CCondensedReapplyConceptDescriptor() : CReapplyConceptDescriptor() { mPositive = true; } CCondensedReapplyConceptDescriptor *CCondensedReapplyConceptDescriptor::initReapllyDescriptor(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint *depTrackPoint, bool isPositiveDes) { mConceptDes = conceptDescriptor; mTrackPoint = depTrackPoint; mStatic = false; mPositive = isPositiveDes; mProcessingRestriction = nullptr; return this; } CCondensedReapplyConceptDescriptor* CCondensedReapplyConceptDescriptor::getNext() { return (CCondensedReapplyConceptDescriptor*)CReapplyConceptDescriptor::getNext(); } CCondensedReapplyConceptDescriptor *CCondensedReapplyConceptDescriptor::initReapllyDescriptor(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint *depTrackPoint, bool isPositiveDes, CProcessingRestrictionSpecification* procRest) { mConceptDes = conceptDescriptor; mTrackPoint = depTrackPoint; mStatic = false; mPositive = isPositiveDes; mProcessingRestriction = procRest; return this; } bool CCondensedReapplyConceptDescriptor::isPositiveDescriptor() { return mPositive; } bool CCondensedReapplyConceptDescriptor::hasConceptDescriptor(CConceptDescriptor* conceptDescriptor) { return mConceptDes == conceptDescriptor; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoin0000644000175000017500000001241312520551144032322 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathJoiningKeyHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathJoiningKeyHash::CRepresentativeVariableBindingPathJoiningKeyHash(CProcessContext* context) : CPROCESSHASH(context) { mContext = context; } CRepresentativeVariableBindingPathJoiningKeyHash* CRepresentativeVariableBindingPathJoiningKeyHash::initRepresentativeVariableBindingPathJoiningKeyHash(CRepresentativeVariableBindingPathJoiningKeyHash* prevHash) { if (prevHash) { *this = *prevHash; mNextRepVarBindPathJoiningKeyTag = prevHash->mNextRepVarBindPathJoiningKeyTag; } else { CPROCESSHASH::clear(); mNextRepVarBindPathJoiningKeyTag = 1; } return this; } CVariableBindingDescriptor* CRepresentativeVariableBindingPathJoiningKeyHash::createVariableBindingHashKeyDescriptor(CVariableBindingPath* varBindPath, CSortedLinker* keyVars) { CMemoryAllocationManager* taskMemMan = mContext->getUsedMemoryAllocationManager(); CVariableBindingDescriptor* keyVarBindDesLinker = nullptr; CVariableBindingDescriptor* lastKeyVarBindDesLinker = nullptr; CSortedLinker* varLinkerIt = keyVars; CVariableBindingDescriptor* varBindDesIt = varBindPath->getVariableBindingDescriptorLinker(); while (varLinkerIt) { CVariableBinding* varBind = varBindDesIt->getVariableBinding(); if (varBind->getBindedVariable() == varLinkerIt->getData()) { CVariableBindingDescriptor* nextKeyVarBindDesLinker = CObjectAllocator< CVariableBindingDescriptor >::allocateAndConstruct(taskMemMan); nextKeyVarBindDesLinker->initVariableBindingDescriptor(varBind); if (lastKeyVarBindDesLinker) { lastKeyVarBindDesLinker->setNext(nextKeyVarBindDesLinker); lastKeyVarBindDesLinker = nextKeyVarBindDesLinker; } else { keyVarBindDesLinker = lastKeyVarBindDesLinker = nextKeyVarBindDesLinker; } varLinkerIt = varLinkerIt->getNext(); varBindDesIt = varBindDesIt->getNext(); } else { varBindDesIt = varBindDesIt->getNext(); } } return keyVarBindDesLinker; } CRepresentativeVariableBindingPathJoiningKeyData* CRepresentativeVariableBindingPathJoiningKeyHash::getRepresentativeVariableBindingPathJoiningKeyData(CVariableBindingPath* varBindPath, CSortedLinker* keyVars, bool create) { CRepresentativeVariableBindingPathJoiningKeyData* varBindPathJoiningData = nullptr; CRepresentativeVariableBindingPathJoiningKeyHasher hasher(varBindPath,keyVars); const CRepresentativeVariableBindingPathJoiningKeyHashData& data = CPROCESSHASH::value(hasher); varBindPathJoiningData = data.mVarBindPathJoiningData; if (!varBindPathJoiningData && create) { varBindPathJoiningData = CObjectAllocator< CRepresentativeVariableBindingPathJoiningKeyData >::allocateAndConstruct(mContext->getUsedMemoryAllocationManager()); CVariableBindingDescriptor* keyVarBindDesLinker = createVariableBindingHashKeyDescriptor(varBindPath,keyVars); varBindPathJoiningData->initVariableBindingPathJoiningData(keyVarBindDesLinker,mNextRepVarBindPathJoiningKeyTag++); CRepresentativeVariableBindingPathJoiningKeyHashData& data = CPROCESSHASH::operator[](CRepresentativeVariableBindingPathJoiningKeyHasher(varBindPathJoiningData)); data.mVarBindPathJoiningData = varBindPathJoiningData; } return varBindPathJoiningData; } cint64 CRepresentativeVariableBindingPathJoiningKeyHash::getRepresentativeVariableBindingPathJoiningKey(CVariableBindingPath* varBindPath, CSortedLinker* keyVars, bool create) { CRepresentativeVariableBindingPathJoiningKeyData* varBindPathJoiningData = getRepresentativeVariableBindingPathJoiningKeyData(varBindPath,keyVars,create); if (varBindPathJoiningData) { return varBindPathJoiningData->getJoiningKey(); } else { return 0; } } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJ0000644000175000017500000000550212520551146032273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathSetJoiningHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathSetJoiningHash::CRepresentativeVariableBindingPathSetJoiningHash(CProcessContext* processContext) : mProcessContext(processContext),CPROCESSHASH(processContext) { } CRepresentativeVariableBindingPathSetJoiningHash* CRepresentativeVariableBindingPathSetJoiningHash::initRepresentativeVariableBindingPathSetJoiningHash(CRepresentativeVariableBindingPathSetJoiningHash* prevHash) { if (prevHash) { *this = *prevHash; } else { CPROCESSHASH::clear(); } return this; } CRepresentativeVariableBindingPathSetJoiningData* CRepresentativeVariableBindingPathSetJoiningHash::getRepresentativeVariableBindingPathSetJoiningData(CConcept* joinConcept, bool create) { CRepresentativeVariableBindingPathSetJoiningData* repData = nullptr; if (create) { CRepresentativeVariableBindingPathSetJoiningHashData& data = CPROCESSHASH::operator[](joinConcept); repData = data.mUseJoiningData; if (!repData) { repData = CObjectParameterizingAllocator< CRepresentativeVariableBindingPathSetJoiningData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); repData->initRepresentativeVariableBindingPathSetJoiningData(nullptr); data.mUseJoiningData = repData; } } else { const CRepresentativeVariableBindingPathSetJoiningHashData& data = CPROCESSHASH::value(joinConcept); repData = data.mUseJoiningData; } return repData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPreviousIndividualIDSet.cpp0000644000175000017500000000463012520551134030224 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreviousIndividualIDSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CPreviousIndividualIDSet::CPreviousIndividualIDSet(CProcessContext* context) : CPROCESSSET(context) { } CPreviousIndividualIDSet::CPreviousIndividualIDSet(const CPreviousIndividualIDSet &disHash, CContext* context) : CPROCESSSET(disHash,context) { } CPreviousIndividualIDSet::~CPreviousIndividualIDSet() { } CPreviousIndividualIDSet* CPreviousIndividualIDSet::initPreviousIndividualIDSet(CPreviousIndividualIDSet* prevIDSet) { if (prevIDSet) { *this = *prevIDSet; } else { clear(); } return this; } bool CPreviousIndividualIDSet::hasPreviousIndividualID(CIndividualProcessNode *indi) { if (indi) { qint64 indiID = indi->getIndividualID(); return CPROCESSSET::contains(indiID); } else { return false; } } bool CPreviousIndividualIDSet::hasPreviousIndividualID(cint64 indiID) { return CPROCESSSET::contains(indiID); } CPreviousIndividualIDSet *CPreviousIndividualIDSet::insertPreviousIndividualID(cint64 indiID) { CPROCESSSET::insert(indiID); return this; } CPreviousIndividualIDSet *CPreviousIndividualIDSet::insertPreviousIndividualID(CIndividualProcessNode *indi) { if (indi) { qint64 indiID = indi->getIndividualID(); CPROCESSSET::insert(indiID); } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionResolveData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionReso0000644000175000017500000000600412520551154032422 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationIndividualNodeExtensionResolveData.h" #include "CIndividualSaturationProcessNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationIndividualNodeExtensionResolveData::CSaturationIndividualNodeExtensionResolveData(CProcessContext* processContext) { mProcessContext = processContext; mExtensionResolveHash = nullptr; mIndiNode = nullptr; mIndiID = 0; } CSaturationIndividualNodeExtensionResolveData* CSaturationIndividualNodeExtensionResolveData::initExtensionResolveData(CIndividualSaturationProcessNode* indiProcessNode) { mIndiNode = indiProcessNode; mIndiID = indiProcessNode->getIndividualID(); mExtensionResolveHash = nullptr; return this; } CSaturationIndividualNodeExtensionResolveData* CSaturationIndividualNodeExtensionResolveData::initExtensionResolveData(cint64 indiID) { mIndiNode = nullptr; mIndiID = indiID; mExtensionResolveHash = nullptr; return this; } CSaturationIndividualNodeExtensionResolveHash* CSaturationIndividualNodeExtensionResolveData::getIndividualNodeExtensionResolveHash(bool create) { if (!mExtensionResolveHash && create) { mExtensionResolveHash = CObjectParameterizingAllocator< CSaturationIndividualNodeExtensionResolveHash,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); } return mExtensionResolveHash; } CSaturationIndividualNodeExtensionResolveData* CSaturationIndividualNodeExtensionResolveData::setProcessingIndividualNode(CIndividualSaturationProcessNode* indiProcessNode) { mIndiNode = indiProcessNode; return this; } CIndividualSaturationProcessNode* CSaturationIndividualNodeExtensionResolveData::getProcessingIndividualNode() { return mIndiNode; } cint64 CSaturationIndividualNodeExtensionResolveData::getProcessingIndividualNodeID() { return mIndiID; } bool CSaturationIndividualNodeExtensionResolveData::hasProcessingIndividualNode() { return mIndiNode != nullptr; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedConceptDescriptor.h0000644000175000017500000000505112520551074030072 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDCONCEPTDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDCONCEPTDESCRIPTOR_H // Libraries includes #include // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "CClashedDependencyDescriptor.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CClashedConceptDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClashedConceptDescriptor : public CClashedDependencyDescriptor { // public methods public: //! Constructor CClashedConceptDescriptor(); CClashedConceptDescriptor* initClashedConceptDescriptor(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CIndividualProcessNode* individual); CConceptDescriptor* getConceptDescriptor(); cint64 getAppropriatedIndividualID(); CClashedConceptDescriptor* setAppropriatedIndividual(CIndividualProcessNode* individualNode); CIndividualProcessNode* getAppropriatedIndividual(); // protected methods protected: // protected variables protected: CConceptDescriptor* mConceptDescriptor; CIndividualProcessNode* mIndividualNode; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDCONCEPTDESCRIPTOR_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandidateData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandid0000644000175000017500000000503312520551160032256 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGINDIVIDUALNODECANDIDATEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGINDIVIDUALNODECANDIDATEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" #include "CProcessContext.h" #include "CSignatureBlockingIndividualNodeCandidateIterator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSignatureBlockingIndividualNodeCandidateData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureBlockingIndividualNodeCandidateData { // public methods public: //! Constructor CSignatureBlockingIndividualNodeCandidateData(CProcessContext* context = nullptr); CSignatureBlockingIndividualNodeCandidateData* initBlockingCandidateData(CSignatureBlockingIndividualNodeCandidateData* prevBlockCandHash); CSignatureBlockingIndividualNodeCandidateData* insertBlockingCandidateIndividualNode(CIndividualProcessNode* candidateIndi); CSignatureBlockingIndividualNodeCandidateIterator getBlockingCandidatesIndividualNodeIterator(); // protected methods protected: // protected variables protected: CPROCESSSET mIndiSet; CProcessContext* mContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGINDIVIDUALNODECANDIDATEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeDoubleValueSpaceData.cpp0000644000175000017500000000574712520551110031163 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeDoubleValueSpaceData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeDoubleValueSpaceData::CDatatypeDoubleValueSpaceData(CProcessContext* processContext) : CDatatypeCompareValueSpaceData(processContext) { mDoubleValueSpaceMap = nullptr; } CDatatypeDoubleValueSpaceData* CDatatypeDoubleValueSpaceData::initDoubleValueSpaceData(CDatatypeValueSpaceDoubleType* valueSpaceType) { CDatatypeCompareValueSpaceData::initValueSpaceData(nullptr); mValueSpaceType = valueSpaceType; if (mDoubleValueSpaceMap) { mDoubleValueSpaceMap->initDatatypeCompareValueSpaceMap(valueSpaceType); } return this; } CDatatypeDoubleValueSpaceData* CDatatypeDoubleValueSpaceData::copyDoubleValueSpaceData(CDatatypeDoubleValueSpaceData* spaceData) { CDatatypeCompareValueSpaceData::initValueSpaceData(spaceData); mValueSpaceType = spaceData->mValueSpaceType; if (spaceData->mDoubleValueSpaceMap && !mDoubleValueSpaceMap) { getDoubleValueSpaceMap(true); mDoubleValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mDoubleValueSpaceMap); } else if (mDoubleValueSpaceMap) { if (spaceData->mDoubleValueSpaceMap) { mDoubleValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mDoubleValueSpaceMap); } else { mDoubleValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } } return this; } CDatatypeDoubleValueSpaceMap* CDatatypeDoubleValueSpaceData::getDoubleValueSpaceMap(bool create) { if (create && !mDoubleValueSpaceMap) { mDoubleValueSpaceMap = CObjectParameterizingAllocator< CDatatypeDoubleValueSpaceMap,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mDoubleValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } return mDoubleValueSpaceMap; } CDatatypeCompareValueSpaceMap* CDatatypeDoubleValueSpaceData::createValueSpaceMap() { return getDoubleValueSpaceMap(true); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeHash.cp0000644000175000017500000000633012520551156032241 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNominalDependentNodeHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationNominalDependentNodeHash::CSaturationNominalDependentNodeHash(CProcessContext* processContext) : mNominalDependentNodeDataHash(processContext),mProcessContext(processContext) { } CSaturationNominalDependentNodeHash* CSaturationNominalDependentNodeHash::initNominalDependentNodeHash(CSaturationNominalDependentNodeHash* nominalDependentHash) { if (nominalDependentHash) { mNominalDependentNodeDataHash = nominalDependentHash->mNominalDependentNodeDataHash; } else { mNominalDependentNodeDataHash.clear(); } return this; } CSaturationNominalDependentNodeData* CSaturationNominalDependentNodeHash::getNominalDependentNodeData(cint64 nominalID) { CSaturationNominalDependentNodeData* nominalDepNodeData = nullptr; const CSaturationNominalDependentNodeHashData& hashData = mNominalDependentNodeDataHash.value(nominalID); nominalDepNodeData = hashData.mNominalDependentNodeData; return nominalDepNodeData; } CSaturationNominalDependentNodeHash* CSaturationNominalDependentNodeHash::addNominalDependentNodeData(cint64 nominalID, CSaturationNominalDependentNodeData* dependentNodeData) { CSaturationNominalDependentNodeHashData& hashData = mNominalDependentNodeDataHash[nominalID]; hashData.mNominalDependentNodeData = dependentNodeData->append(hashData.mNominalDependentNodeData); return this; } CSaturationNominalDependentNodeHash* CSaturationNominalDependentNodeHash::addNominalDependentNode(cint64 nominalID, CIndividualSaturationProcessNode* dependentNode, CSaturationNominalDependentNodeData::NOMINALCONNECTIONTYPE connectionType) { CSaturationNominalDependentNodeHashData& hashData = mNominalDependentNodeDataHash[nominalID]; CSaturationNominalDependentNodeData* dependentNodeData = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); dependentNodeData->initNominalDependentNodeData(dependentNode,connectionType); hashData.mNominalDependentNodeData = dependentNodeData->append(hashData.mNominalDependentNodeData); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetH0000644000175000017500000000272212520551146032272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathSetHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathSetHashData::CRepresentativeVariableBindingPathSetHashData() { mUseDataLinker = nullptr; mLocDataLinker = nullptr; } CRepresentativeVariableBindingPathSetHashData::CRepresentativeVariableBindingPathSetHashData(const CRepresentativeVariableBindingPathSetHashData& data) { mUseDataLinker = data.mUseDataLinker; mLocDataLinker = nullptr; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingMap.h0000644000175000017500000000436412520551136027375 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CPropagationBindingMapData.h" #include "CPropagationBindingDescriptor.h" // Other includes #include "Reasoner/Ontology/CNominalSchemaTemplateVector.h" #include "Reasoner/Ontology/CNominalSchemaTemplate.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CPropagationBindingMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPropagationBindingMap : public CPROCESSMAP { // public methods public: //! Constructor CPropagationBindingMap(CProcessContext* processContext); CPropagationBindingMap* initPropagationBindingMap(CPropagationBindingMap* prevMap); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeFloatValueSpaceMap.cpp0000644000175000017500000001305212520551112030650 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeFloatValueSpaceMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeFloatValueSpaceMap::CDatatypeFloatValueSpaceMap(CProcessContext* processContext) : CDatatypeCompareValueSpaceMap(processContext) { } bool CDatatypeFloatValueSpaceMap::representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { return false; } bool CDatatypeFloatValueSpaceMap::representsInfinitelyManyValues(CDataLiteralCompareValue* value) { return false; } bool CDatatypeFloatValueSpaceMap::getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom) { CDataLiteralFloatValue* floatValueCopyInto = dynamic_cast(valueCopyInto); CDataLiteralFloatValue* floatValueCopyFrom = dynamic_cast(valueCopyFrom); floatValueCopyInto->initValue(floatValueCopyFrom); return true; } bool CDatatypeFloatValueSpaceMap::isNaN(int bits) { return ((bits & 0x7f800000) == 0x7f800000) && ((bits & 0x003fffff) != 0); } bool CDatatypeFloatValueSpaceMap::getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast) { CDataLiteralFloatValue* floatValueNext = dynamic_cast(valueNext); CDataLiteralFloatValue* floatValueLast = dynamic_cast(valueLast); float nextFloatValue = 0.; float lastFloatValue = floatValueLast->getFloat(); int bits = *reinterpret_cast(&lastFloatValue); int magnitude = (bits & 0x7fffffff); bool positive = ((bits & 0x80000000)==0); // The successors of NaN and +INF are these numbers themselves. if (isNaN(bits) || (magnitude == 0x7f800000 && positive)) { floatValueNext->initValueFromFloat(lastFloatValue); } else { bool newPositive; int newMagnitude; if (positive) { newPositive = true; newMagnitude = magnitude+1; } else if (!positive && magnitude == 0) { // The successor of -0 is +0 newPositive = true; newMagnitude = 1; // skip +0 for now } else { // if (!positive && magnitude != 0) newPositive = false; newMagnitude = magnitude-1; } int newBits = newMagnitude | (newPositive ? 0 : 0x80000000); nextFloatValue = *reinterpret_cast(&newBits); floatValueNext->initValueFromFloat(nextFloatValue); return true; } return false; } cuint64 CDatatypeFloatValueSpaceMap::getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { CDataLiteralFloatValue* floatValueLeft = dynamic_cast(leftValueExcluded); CDataLiteralFloatValue* floatValueRight = dynamic_cast(rightValueExcluded); float leftFloatValue = floatValueLeft->getFloat(); float rightFloatValue = floatValueRight->getFloat(); int bitsLowerBoundExclusive = *reinterpret_cast(&leftFloatValue); int bitsUpperBoundExclusive = *reinterpret_cast(&rightFloatValue); if (isNaN(bitsLowerBoundExclusive) || isNaN(bitsUpperBoundExclusive)) return 0; cuint64 valueCount = 0; bool positiveLowerBoundExclusive = ((bitsLowerBoundExclusive & 0x80000000)==0); bool positiveUpperBoundExclusive = ((bitsUpperBoundExclusive & 0x80000000)==0); int magnitudeLowerBoundExclusive = (bitsLowerBoundExclusive & 0x7fffffff); int magnitudeUpperBoundExclusive = (bitsUpperBoundExclusive & 0x7fffffff); // Determine the number of elements. This works even if 'lowerBoundExclusive' or 'upperBoundExclusive' is +INF or -INF if (positiveLowerBoundExclusive && positiveUpperBoundExclusive) { // it must be that magnitudeLowerBoundExclusive < magnitudeUpperBoundExclusive valueCount = magnitudeUpperBoundExclusive-magnitudeLowerBoundExclusive-1; } else if (!positiveLowerBoundExclusive && !positiveUpperBoundExclusive) { // it must be that magnitudeUpperBoundExclusive < magnitudeLowerBoundExclusive valueCount = magnitudeLowerBoundExclusive-magnitudeUpperBoundExclusive-1; } else if (!positiveLowerBoundExclusive && positiveUpperBoundExclusive) { // the number of values from 'lowerBoundExclusive' to -0 cuint64 startToMinusZero = magnitudeLowerBoundExclusive; // the number of values from +0 to 'upperBoundExclusive' int plusZeroToEnd = magnitudeUpperBoundExclusive; valueCount = startToMinusZero+plusZeroToEnd -1; // extra -1 to count +0/-0 only once for now } return valueCount; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateHash.h0000644000175000017500000000665512520551072032135 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODECANDIDATEHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODECANDIDATEHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CIndividualProcessNode.h" #include "CBlockingIndividualNodeCandidateData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CBlockingIndividualNodeCandidateHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBlockingIndividualNodeCandidateHash { // public methods public: //! Constructor CBlockingIndividualNodeCandidateHash(CProcessContext* context = nullptr); //! Destructor virtual ~CBlockingIndividualNodeCandidateHash(); CBlockingIndividualNodeCandidateHash* initBlockingIndividualNodeCandidateHash(CBlockingIndividualNodeCandidateHash* prevBlockCandHash); CBlockingIndividualNodeCandidateData* getBlockingIndividualCandidateData(CConcept* initializationConcept, bool conceptNegation, bool create = true); CBlockingIndividualNodeCandidateData* getBlockingIndividualCandidateData(CConceptDescriptor* initializationConDes, bool create = true); // protected methods protected: // protected variables protected: class CBlockingCandidateHashData { public: inline CBlockingCandidateHashData() { mCandidateIndiData = nullptr; mPrevCandidateIndiData = nullptr; } inline CBlockingCandidateHashData(const CBlockingCandidateHashData& data) { mCandidateIndiData = nullptr; mPrevCandidateIndiData = data.mPrevCandidateIndiData; } CBlockingIndividualNodeCandidateData* mCandidateIndiData; CBlockingIndividualNodeCandidateData* mPrevCandidateIndiData; }; CProcessContext* mContext; CMemoryAllocationManager* mMemMan; CPROCESSHASH< QPair ,CBlockingCandidateHashData>* mBlockCandidateHash; CPROCESSHASH< QPair ,CBlockingCandidateHashData>* mUseBlockCandidateHash; CPROCESSHASH< QPair ,CBlockingCandidateHashData>* mPrevBlockCandidateHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGINDIVIDUALNODECANDIDATEHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptNominalSchemaGroundingHash.h0000644000175000017500000000444412520551100031662 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTNOMINALSCHEMAGROUNDINGHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTNOMINALSCHEMAGROUNDINGHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CConceptNominalSchemaGroundingData.h" #include "CConceptNominalSchemaGroundingHasher.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConceptNominalSchemaGroundingHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptNominalSchemaGroundingHash : public CPROCESSHASH { // public methods public: //! Constructor CConceptNominalSchemaGroundingHash(CProcessContext* context); CConceptNominalSchemaGroundingHash* initConceptNominalSchemaGroundingHash(CConceptNominalSchemaGroundingHash* prevHash); // protected methods protected: // protected variables protected: CProcessContext* mContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTNOMINALSCHEMAGROUNDINGHASH_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceDependencyCollector.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceDependencyCollector0000644000175000017500000000405512520551116032320 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACEDEPENDENCYCOLLECTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACEDEPENDENCYCOLLECTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CDatatypeValueSpaceDependencyAdder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceDependencyCollector { // public methods public: //! Constructor CDatatypeValueSpaceDependencyCollector(); virtual bool addDependency(CDependencyTrackPoint* depTrackPoint) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACEDEPENDENCYCOLLECTOR_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningAllDataExtension.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningAllDataExtension0000644000175000017500000000603312520551142032361 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeJoiningAllDataExtension.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeJoiningAllDataExtension::CRepresentativeJoiningAllDataExtension(CProcessContext* processContext) : mProcessContext(processContext) { mRepVarBindPathSetData = nullptr; mRightResolveMap = nullptr; mLeftResolveMap = nullptr; } CRepresentativeVariableBindingPathSetData* CRepresentativeJoiningAllDataExtension::getRepresentativeVariableBindingPathSetData() { return mRepVarBindPathSetData; } CRepresentativeJoiningAllDataExtension* CRepresentativeJoiningAllDataExtension::setRepresentativeVariableBindingPathSetData(CRepresentativeVariableBindingPathSetData* repVarBindPathSetData) { mRepVarBindPathSetData = repVarBindPathSetData; return this; } CRepresentativeVariableBindingPathMap* CRepresentativeJoiningAllDataExtension::getResolveVariableBindingPathMap(bool leftMap, bool create) { if (leftMap) { return getLeftResolveVariableBindingPathMap(create); } else { return getRightResolveVariableBindingPathMap(create); } } CRepresentativeVariableBindingPathMap* CRepresentativeJoiningAllDataExtension::getLeftResolveVariableBindingPathMap(bool create) { if (create && !mLeftResolveMap) { mLeftResolveMap = CObjectParameterizingAllocator< CRepresentativeVariableBindingPathMap,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mLeftResolveMap->initVariableBindingPathMap(nullptr); } return mLeftResolveMap; } CRepresentativeVariableBindingPathMap* CRepresentativeJoiningAllDataExtension::getRightResolveVariableBindingPathMap(bool create) { if (create && !mRightResolveMap) { mRightResolveMap = CObjectParameterizingAllocator< CRepresentativeVariableBindingPathMap,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mRightResolveMap->initVariableBindingPathMap(nullptr); } return mRightResolveMap; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceMapArranger.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceMapArranger.0000644000175000017500000000324212520551110032146 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeCompareValueSpaceMapArranger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeCompareValueSpaceMapArranger::CDatatypeCompareValueSpaceMapArranger(CDataLiteralCompareValue* value) { mValue = value; } CDataLiteralCompareValue* CDatatypeCompareValueSpaceMapArranger::getValue() const { return mValue; } bool CDatatypeCompareValueSpaceMapArranger::operator<(const CDatatypeCompareValueSpaceMapArranger& valueData) const { return mValue->isLessThan(valueData.mValue); } bool CDatatypeCompareValueSpaceMapArranger::operator<=(const CDatatypeCompareValueSpaceMapArranger& valueData) const { return mValue->isLessEqualThan(valueData.mValue); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptDescriptor.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptDescr0000644000175000017500000000440312520551136032335 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPropagationBindingReapplyConceptDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CPropagationBindingReapplyConceptDescriptor::CPropagationBindingReapplyConceptDescriptor() : CLinkerBase(this) { mConceptDes = nullptr; } CPropagationBindingReapplyConceptDescriptor *CPropagationBindingReapplyConceptDescriptor::initReapllyDescriptor(CIndividualProcessNode* indiNode, CPropagationBinding* propBinding, CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint *depTrackPoint) { initDependencyTracker(depTrackPoint); mConceptDes = conceptDescriptor; mIndiNode = indiNode; mPropBinding = propBinding; return this; } CConceptDescriptor *CPropagationBindingReapplyConceptDescriptor::getConceptDescriptor() { return mConceptDes; } CIndividualProcessNode* CPropagationBindingReapplyConceptDescriptor::getReapllyIndividualNode() { return mIndiNode; } CPropagationBinding* CPropagationBindingReapplyConceptDescriptor::getPropagationBinding() { return mPropBinding; } bool CPropagationBindingReapplyConceptDescriptor::hasConceptDescriptor(CConceptDescriptor* conceptDescriptor) { return mConceptDes == conceptDescriptor; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceMap.h0000644000175000017500000002157112520551110030641 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUESPACEMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUESPACEMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeCompareValueData.h" #include "CDatatypeCompareValueSpaceMapData.h" #include "CDatatypeCompareValueSpaceMapArranger.h" #include "CClashedDependencyDescriptor.h" #include "CDatatypeValueSpaceValuesCounter.h" #include "CDatatypeValueSpaceDependencyCollector.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceType.h" #include "Reasoner/Ontology/CDatatypeValueSpaceCompareType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeCompareValueSpaceMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeCompareValueSpaceMap : public CPROCESSMAP { // public methods public: //! Constructor CDatatypeCompareValueSpaceMap(CProcessContext* processContext); CDatatypeCompareValueSpaceMap* initDatatypeCompareValueSpaceMap(CDatatypeCompareValueSpaceMap* map); CDatatypeCompareValueSpaceMap* initDatatypeCompareValueSpaceMap(CDatatypeValueSpaceCompareType* valueSpaceType); bool hasExcludedMinimum(CDataLiteralCompareValue* value, bool valueInclusively); bool hasExcludedMaximum(CDataLiteralCompareValue* value, bool valueInclusively); bool isValueExcluded(CDataLiteralCompareValue* value); bool restrictToValue(CDataLiteralCompareValue* value, CDependencyTrackPoint* depTrackPoint); bool excludeMinimum(CDataLiteralCompareValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint); bool excludeMaximum(CDataLiteralCompareValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint); bool excludeValue(CDataLiteralCompareValue* value, CDependencyTrackPoint* depTrackPoint); bool excludeInterval(CDataLiteralCompareValue* leftValue, bool leftValueInclusive, CDataLiteralCompareValue* rightValue, bool rightValueInclusive, CDependencyTrackPoint* depTrackPoint); bool excludeAll(CDependencyTrackPoint* depTrackPoint); bool testValueSpaceReturnClashed(); bool addValueSpaceDependencies(CDatatypeValueSpaceDependencyCollector* depCollector); bool getAbsoluteMinimumValue(CDataLiteralCompareValue*& minValue, bool& minValueInclusive, CDependencyTrackPoint** depTrackPoint = nullptr); bool getAbsoluteMaximumValue(CDataLiteralCompareValue*& maxValue, bool& maxValueInclusive, CDependencyTrackPoint** depTrackPoint = nullptr); bool countAllValues(CDatatypeValueSpaceValuesCounter* counter); bool countIntervalValues(CDataLiteralCompareValue* leftValue, bool leftValueInclusive, CDataLiteralCompareValue* rightValue, bool rightValueInclusive, CDatatypeValueSpaceValuesCounter* counter); bool countValueValues(CDataLiteralCompareValue* value, CDatatypeValueSpaceValuesCounter* counter); bool addIntervalExclusionDependencies(CDataLiteralCompareValue* leftValue, bool leftValueInclusive, CDataLiteralCompareValue* rightValue, bool rightValueInclusive, CDatatypeValueSpaceDependencyCollector* depCollector); bool addValueExclusionDependencies(CDataLiteralCompareValue* value, CDatatypeValueSpaceDependencyCollector* depCollector); bool getNextPossibleDataValue(CDataLiteralCompareValue* nextValue, CDataLiteralCompareValue* lastValue); // protected methods protected: bool adaptNewCompareValueDataToNeighbours(CDatatypeCompareValueData* valueData); CDatatypeCompareValueData* getDatatypeCompareValueData(CDataLiteralCompareValue* value, bool createOrLocalize = false, bool* newValueInsertion = nullptr); CDatatypeCompareValueData* getDatatypeCompareValueData(CDataLiteralCompareValue* value, CDatatypeCompareValueSpaceMapData& valueMapData, bool createOrLocalize, bool* newValueInsertion); bool isDataIntervalExcluded(CDatatypeCompareValueData* leftValueExcluded, CDatatypeCompareValueData* rightValueExcluded); bool isDataIntervalExcluded(CDataLiteralCompareValue* leftValueExcluded, CDatatypeCompareValueData* rightValueExcluded); bool isDataIntervalExcluded(CDatatypeCompareValueData* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); bool isLeftDataIntervalExcluded(CDatatypeCompareValueData* dataValue); bool isRightDataIntervalExcluded(CDatatypeCompareValueData* dataValue); bool isDataValueExcluded(CDatatypeCompareValueData* dataValue); bool isDataValueExcluded(CDataLiteralCompareValue* dataValue); bool excludeData(CDatatypeCompareValueDataExclusion* exlcusionData, CDependencyTrackPoint* depTrackPoint, bool force); bool excludeDataValue(CDatatypeCompareValueData* dataValue, CDependencyTrackPoint* depTrackPoint, bool force); bool excludeLeftDataInterval(CDatatypeCompareValueData* dataValue, CDependencyTrackPoint* depTrackPoint, bool force); bool excludeRightDataInterval(CDatatypeCompareValueData* dataValue, CDependencyTrackPoint* depTrackPoint, bool force); bool addDataValueExclusionDependencies(CDatatypeCompareValueData* dataValue, CDatatypeValueSpaceDependencyCollector* depCollector); bool addDataIntervalExclusionDependencies(CDatatypeCompareValueData* leftValueExcluded, CDatatypeCompareValueData* rightValueExcluded, CDatatypeValueSpaceDependencyCollector* depCollector); bool addLeftIntervalExclusionDependencies(CDatatypeCompareValueData* valueData, CDatatypeValueSpaceDependencyCollector* depCollector); bool addRightIntervalExclusionDependencies(CDatatypeCompareValueData* valueData, CDatatypeValueSpaceDependencyCollector* depCollector); bool addExclusionDependencies(CDatatypeCompareValueDataExclusion* exclusionData, CDatatypeValueSpaceDependencyCollector* depCollector); bool countDataIntervalValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded, CDatatypeCompareValueDataExclusion* exlcusionData, CDatatypeValueSpaceValuesCounter* counter); bool countDataIntervalValues(CDatatypeCompareValueData* leftValueExcluded, CDatatypeCompareValueData* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter); bool countDataIntervalValues(CDataLiteralCompareValue* leftValueExcluded, CDatatypeCompareValueData* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter); bool countDataIntervalValues(CDatatypeCompareValueData* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter); bool countDataValue(CDataLiteralCompareValue* value, CDatatypeCompareValueDataExclusion* exlcusionData, CDatatypeValueSpaceValuesCounter* counter); bool countDataValue(CDatatypeCompareValueData* dataValue, CDatatypeValueSpaceValuesCounter* counter); virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* value) = 0; virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) = 0; virtual bool getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom) = 0; virtual bool getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast) = 0; virtual cuint64 getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) = 0; // protected variables protected: CProcessContext* mProcessContext; CDatatypeCompareValueData* mAbsoluteMinimumExclusionValue; CDatatypeCompareValueData* mAbsoluteMaximumExclusionValue; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUESPACEMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyRoleSuccessorData.cpp0000644000175000017500000000204412520551142030424 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReapplyRoleSuccessorData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeCompareValueDataExclusion.h0000644000175000017500000000462012520551110031707 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUEDATAEXCLUSION_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUEDATAEXCLUSION_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CDatatypeCompareValueDataExclusion * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeCompareValueDataExclusion { // public methods public: //! Constructor CDatatypeCompareValueDataExclusion(); CDatatypeCompareValueDataExclusion* initDataExclusion(CDatatypeCompareValueDataExclusion* value); bool isExcluded(); CDependencyTrackPoint* getExcludedDependencyTrackPoint(); CDatatypeCompareValueDataExclusion* setExcluded(bool excluded); CDatatypeCompareValueDataExclusion* setExcludedDependencyTrackPoint(CDependencyTrackPoint* depTrackPoint); // protected methods protected: // protected variables protected: bool mExcluded; CDependencyTrackPoint* mExcludedDepTrackPoint; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPECOMPAREVALUEDATAEXCLUSION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleBackwardPropagationHashData.cpp0000644000175000017500000000227512520551150031651 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleBackwardPropagationHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRoleBackwardPropagationHashData::CRoleBackwardPropagationHashData() { mLinkLinker = nullptr; mReapplyLinker = nullptr; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSuccessorRoleHash.h0000644000175000017500000000471212520551162026554 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSUCCESSORROLEHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSUCCESSORROLEHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualLinkEdge.h" #include "CSuccessorRoleIterator.h" #include "CProcessContext.h" #include "CSuccessorIterator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSuccessorRoleHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSuccessorRoleHash : public CPROCESSHASH { // public methods public: //! Constructor CSuccessorRoleHash(CProcessContext* context = nullptr); CSuccessorRoleHash* initSuccessorRoleHash(CSuccessorRoleHash* prevRoleSuccHash); CSuccessorRoleHash* insertSuccessorRoleLink(cint64 indi, CIndividualLinkEdge* link); CSuccessorRoleHash* removeSuccessor(cint64 indi); CSuccessorRoleIterator getSuccessorRoleIterator(cint64 indi); bool hasSuccessorIndividualNode(cint64 indi); CSuccessorIterator getSuccessorIterator(); // protected methods protected: // protected variables protected: CProcessContext* mContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSUCCESSORROLEHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualProcessingQueue.h0000644000175000017500000000623012520551126030304 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSINGQUEUE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSINGQUEUE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNodeDescriptor.h" #include "CIndividualProcessNode.h" #include "CIndividualProcessNodePriority.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualProcessingQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessingQueue { // public methods public: //! Constructor CIndividualProcessingQueue(CProcessContext* processContext); //! Destructor virtual ~CIndividualProcessingQueue(); CIndividualProcessingQueue* initProcessingQueue(CIndividualProcessingQueue* processingQueue); CIndividualProcessNodeDescriptor *takeNextProcessIndividualDescriptor(); CIndividualProcessNodeDescriptor *getNextProcessIndividualDescriptor(); CIndividualProcessingQueue *insertIndiviudalProcessDescriptor(CIndividualProcessNodeDescriptor *indiProDes); bool hasHigherPriorityIndividual(CIndividualProcessNodePriority priority); bool needsIndiviudalInsertion(CIndividualProcessNode *individual, CIndividualProcessNodePriority priority); bool isEmpty(); bool hasIndividualProcessDescriptor(); bool isIndividualQueued(CIndividualProcessNode *individual); CPROCESSMAP mPriorityIndiDesMap; CPROCESSHASH mIndiDesPriorityHash; // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; cint64 mIndiProDesCount; bool mHasMaxIndiPriority; CIndividualProcessNodePriority mMaxIndiPriority; CIndividualProcessNode* mLastCheckIndi; CIndividualProcessNodePriority mLastCheckIndiPriority; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSINGQUEUE_H ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyHashData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoin0000644000175000017500000000434012520551146032324 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHJOININGKEYHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHJOININGKEYHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CRepresentativeVariableBindingPathJoiningKeyData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathJoiningKeyHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathJoiningKeyHashData { // public methods public: //! Constructor CRepresentativeVariableBindingPathJoiningKeyHashData(); CRepresentativeVariableBindingPathJoiningKeyHashData(const CRepresentativeVariableBindingPathJoiningKeyHashData& data); CRepresentativeVariableBindingPathJoiningKeyData* mVarBindPathJoiningData; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHJOININGKEYHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCondensedReapplyQueueIterator.h0000644000175000017500000000460612520551104031131 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONDENSEDREAPPLYQUEUEITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONDENSEDREAPPLYQUEUEITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CCondensedReapplyConceptDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CCondensedReapplyQueueIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCondensedReapplyQueueIterator { // public methods public: //! Constructor CCondensedReapplyQueueIterator(); CCondensedReapplyQueueIterator(CCondensedReapplyConceptDescriptor* dynamicReapplyDesLinker, bool positiveDescriptors, bool negativeDescriptors); CCondensedReapplyQueueIterator(CCondensedReapplyConceptDescriptor* dynamicReapplyDesLinker, bool onlyPositiveDescriptors); CCondensedReapplyConceptDescriptor* next(bool moveNext = true); bool hasNext(); // protected methods protected: // protected variables protected: CCondensedReapplyConceptDescriptor* mDynamicPosNegReapplyDesLinker; bool mPosDes; bool mNegDes; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONDENSEDREAPPLYQUEUEITERATOR_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualConceptBatchProcessingData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualConceptBatchProcessingData.0000644000175000017500000000477712520551120032207 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALCONCEPTBATCHPROCESSINGDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALCONCEPTBATCHPROCESSINGDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CIndividualDepthConceptProcessDescriptorProcessingQueue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualConceptBatchProcessingData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualConceptBatchProcessingData { // public methods public: //! Constructor CIndividualConceptBatchProcessingData(CProcessContext* processContext); CIndividualConceptBatchProcessingData* initConceptBatchProcessingData(CIndividualConceptBatchProcessingData* prevData); CIndividualDepthConceptProcessDescriptorProcessingQueue* getIndividualQueue(); CConcept* getConcept(); bool hasConcept(); CIndividualConceptBatchProcessingData* setConcept(CConcept* concept); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CIndividualDepthConceptProcessDescriptorProcessingQueue mIndividualQueue; CConcept* mConcept; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALCONCEPTBATCHPROCESSINGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathMap.cpp0000644000175000017500000000276312520551164030011 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingPathMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingPathMap::CVariableBindingPathMap(CProcessContext* processContext) : mProcessContext(processContext),CPROCESSMAP(processContext) { } CVariableBindingPathMap* CVariableBindingPathMap::initVariableBindingPathMap(CVariableBindingPathMap* prevMap) { if (prevMap) { *this = *prevMap; } else { CPROCESSMAP::clear(); } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptSetSignature.cpp0000644000175000017500000000477612520551102027445 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptSetSignature.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptSetSignature::CConceptSetSignature() { reset(); } CConceptSetSignature::~CConceptSetSignature() { } CConceptSetSignature* CConceptSetSignature::reset() { mSigValue = 0; mValue1 = 0; mValue2 = 1; mValue3 = 0; return this; } cint64 CConceptSetSignature::getSignatureValue() { return mSigValue; } CConceptSetSignature* CConceptSetSignature::addConceptSignature(CConcept* concept, bool negation) { cint64 conTag = concept->getConceptTag(); cint64 conSig = conTag; if (negation) { conSig = std::numeric_limits::max() - conTag; } mValue1 += conSig; mValue2 *= conSig; mValue3 += (cint64)concept; mSigValue = mValue1 ^ mValue2 ^ mValue3; return this; } CConceptSetSignature* CConceptSetSignature::addConceptSignature(CConceptDescriptor* conceptDescriptor) { CConcept* concept = conceptDescriptor->getConcept(); bool negation = conceptDescriptor->isNegated(); addConceptSignature(concept,negation); return this; } bool CConceptSetSignature::operator==(const CConceptSetSignature& conSig) { return mSigValue == conSig.mSigValue; } bool CConceptSetSignature::isSignatureEquivalent(const CConceptSetSignature& conSig) { return mSigValue == conSig.mSigValue; } bool CConceptSetSignature::isSignatureEquivalent(CConceptSetSignature* conSig) { return conSig && mSigValue == conSig->mSigValue; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptDescriptorDependencyReapplyData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptDescriptorDependencyReapplyDat0000644000175000017500000000326312520551076032352 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptDescriptorDependencyReapplyData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptDescriptorDependencyReapplyData::CConceptDescriptorDependencyReapplyData() { mConceptDescriptor = nullptr; } CConceptDescriptorDependencyReapplyData::CConceptDescriptorDependencyReapplyData(CConceptDescriptor* conceptDescriptor) { mConceptDescriptor = conceptDescriptor; } CConceptDescriptorDependencyReapplyData::CConceptDescriptorDependencyReapplyData(const CConceptDescriptorDependencyReapplyData& data) : mConceptDescriptor(data.mConceptDescriptor), mPosNegReapplyQueue(data.mPosNegReapplyQueue) /*mPosReapplyQueue(data.mPosReapplyQueue), mNegReapplyQueue(data.mNegReapplyQueue)*/ { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSuccessorRoleIterator.h0000644000175000017500000000432612520551162027463 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSUCCESSORROLEITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSUCCESSORROLEITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualLinkEdge.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSuccessorRoleIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSuccessorRoleIterator { // public methods public: //! Constructor CSuccessorRoleIterator(); CSuccessorRoleIterator(cint64 indi, const CPROCESSHASH::iterator& beginIt, const CPROCESSHASH::iterator& endIt); bool hasNext(); CIndividualLinkEdge* next(bool moveNext = true); // protected methods protected: // protected variables protected: cint64 mIndi; CPROCESSHASH::iterator mBeginIt; CPROCESSHASH::iterator mEndIt; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSUCCESSORROLEITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceData.cpp0000644000175000017500000000361112520551110031323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeCompareValueSpaceData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeCompareValueSpaceData::CDatatypeCompareValueSpaceData(CProcessContext* processContext) : CDatatypeValueSpaceData(processContext) { mValueSpaceMap = nullptr; } CDatatypeCompareValueSpaceData* CDatatypeCompareValueSpaceData::initCompareValueSpaceData(CDatatypeValueSpaceCompareType* valueSpaceType) { CDatatypeValueSpaceData::initValueSpaceData(nullptr); return this; } CDatatypeCompareValueSpaceData* CDatatypeCompareValueSpaceData::copyCompareValueSpaceData(CDatatypeCompareValueSpaceData* spaceData) { CDatatypeValueSpaceData::initValueSpaceData(spaceData); return this; } CDatatypeCompareValueSpaceMap* CDatatypeCompareValueSpaceData::getValueSpaceMap(bool create) { if (!mValueSpaceMap && create) { mValueSpaceMap = createValueSpaceMap(); } return mValueSpaceMap; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptExtractionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptExtrac0000644000175000017500000000605312520551152032417 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONDISJUNCTCOMMONCONCEPTEXTRACTIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONDISJUNCTCOMMONCONCEPTEXTRACTIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CConceptSaturationDescriptor.h" #include "CIndividualSaturationProcessNodeLinker.h" #include "CSaturationDisjunctCommonConceptCountHash.h" #include "CSaturationDisjunctExtractionLinker.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationDisjunctCommonConceptExtractionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationDisjunctCommonConceptExtractionData { // public methods public: //! Constructor CSaturationDisjunctCommonConceptExtractionData(CProcessContext* processContext); CSaturationDisjunctCommonConceptExtractionData* initExtractionData(CIndividualSaturationProcessNode* disjunctionIndiProcessNode); CSaturationDisjunctCommonConceptCountHash* getSaturationDisjunctCommonConceptCountHash(); CSaturationDisjunctExtractionLinker* getDisjunctIndividualNodeExtractionLinker(); CSaturationDisjunctCommonConceptExtractionData* addDisjunctIndividualNodeExtractionLinker(CSaturationDisjunctExtractionLinker* disNodeExtLinker); CIndividualSaturationProcessNodeLinker* getExtractionContinueProcessLinker(); bool isExtractionContinueProcessingQueued(); // protected methods protected: // protected variables protected: CSaturationDisjunctCommonConceptCountHash mCommonConceptCountHash; CSaturationDisjunctExtractionLinker* mDisjunctExtractionLinker; CIndividualSaturationProcessNodeLinker mExtConIndiProcessLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONDISJUNCTCOMMONCONCEPTEXTRACTIONDATA_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptRepresentativePropagationSetHashData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptRepresentativePropagationSetHa0000644000175000017500000000430012520551102032357 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTREPRESENTATIVEPROPAGATIONSETHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTREPRESENTATIVEPROPAGATIONSETHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRepresentativePropagationSet.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConceptRepresentativePropagationSetHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptRepresentativePropagationSetHashData { // public methods public: //! Constructor CConceptRepresentativePropagationSetHashData(); CConceptRepresentativePropagationSetHashData(const CConceptRepresentativePropagationSetHashData& data); CRepresentativePropagationSet* mLocRepPropSet; CRepresentativePropagationSet* mUseRepPropSet; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTREPRESENTATIVEPROPAGATIONSETHASHDATA_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeVector.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeVector0000644000175000017500000000443012520551130032411 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODEVECTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODEVECTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualSaturationProcessNode.h" #include "CProcessContext.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualSaturationProcessNodeVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualSaturationProcessNodeVector : public CDefaultDynamicReferenceVectorBase { // public methods public: //! Constructor CIndividualSaturationProcessNodeVector(CProcessContext* processContext = nullptr); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODEVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeRealValueData.cpp0000644000175000017500000000505012520551112027645 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeRealValueData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeRealValueData::CDatatypeRealValueData(CProcessContext* processContext) { mProcessContext = processContext; mValue = nullptr; } CDatatypeRealValueData* CDatatypeRealValueData::initRealValueData(CDatatypeRealValueData* valueData, CDataLiteralRealValue* value) { mValue = value; if (valueData) { mValueExclusionData.initDataExclusion(&valueData->mValueExclusionData); mLeftExclusionData.initDataExclusion(&valueData->mLeftExclusionData); mRightExclusionData.initDataExclusion(&valueData->mRightExclusionData); } else { mValueExclusionData.initDataExclusion(nullptr); mLeftExclusionData.initDataExclusion(nullptr); mRightExclusionData.initDataExclusion(nullptr); } return this; } CDatatypeRealValueData* CDatatypeRealValueData::initRealValueData(CDataLiteralRealValue* value) { mValue = value; return this; } CDataLiteralRealValue* CDatatypeRealValueData::getValue() { return mValue; } CDatatypeRealValueData* CDatatypeRealValueData::setValue(CDataLiteralRealValue* value) { mValue = value; return this; } CDatatypeRealValueDataExclusion* CDatatypeRealValueData::getValueExclusionData() { return &mValueExclusionData; } CDatatypeRealValueDataExclusion* CDatatypeRealValueData::getLeftExclusionData() { return &mLeftExclusionData; } CDatatypeRealValueDataExclusion* CDatatypeRealValueData::getRightExclusionData() { return &mRightExclusionData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoin0000644000175000017500000000572412520551144032331 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHJOININGKEYDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHJOININGKEYDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CVariableBindingDescriptor.h" #include "CVariableBindingPathDescriptor.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Utilities/CSortedLinker.hpp" #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathJoiningKeyData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathJoiningKeyData { // public methods public: //! Constructor CRepresentativeVariableBindingPathJoiningKeyData(); CRepresentativeVariableBindingPathJoiningKeyData* initVariableBindingPathJoiningData(CRepresentativeVariableBindingPathJoiningKeyData* prevJoinData); CRepresentativeVariableBindingPathJoiningKeyData* initVariableBindingPathJoiningData(CVariableBindingDescriptor* keyVarBindDesLinker, cint64 joiningKey); CVariableBindingDescriptor* getKeyVariableBindingDescriptorLinker() const; cint64 getJoiningKey() const; cint64 getCalculatedHashValue() const; bool isKeyEquivalentTo(const CRepresentativeVariableBindingPathJoiningKeyData& data) const; bool isKeyEquivalentTo(CVariableBindingPath* varBindPath) const; // protected methods protected: // protected variables protected: mutable cint64 mCalculatedHashValue; mutable bool mHashValueCalculated; CVariableBindingDescriptor* mKeyVarBindDesLinker; cint64 mJoiningKey; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHJOININGKEYDATA_H ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorFUNCTIONALConceptExtensionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorFUNCTIONALConceptE0000644000175000017500000000564012520551160031755 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationSuccessorFUNCTIONALConceptExtensionData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationSuccessorFUNCTIONALConceptExtensionData::CSaturationSuccessorFUNCTIONALConceptExtensionData(CProcessContext* processContext) : CLinkerBase(false) { mProcessContext = processContext; } CSaturationSuccessorFUNCTIONALConceptExtensionData* CSaturationSuccessorFUNCTIONALConceptExtensionData::initSuccessorConceptExtensionData(CRole* role) { setData(false); setNext(nullptr); mRole = role; mLastResolvedIndiProcSatNode = nullptr; mLastExaminedLinkedSucc = nullptr; return this; } bool CSaturationSuccessorFUNCTIONALConceptExtensionData::isExtensionProcessingQueued() { return getData(); } CSaturationSuccessorFUNCTIONALConceptExtensionData* CSaturationSuccessorFUNCTIONALConceptExtensionData::setExtensionProcessingQueued(bool queued) { setData(queued); return this; } CRole* CSaturationSuccessorFUNCTIONALConceptExtensionData::getRole() { return mRole; } CIndividualSaturationProcessNode* CSaturationSuccessorFUNCTIONALConceptExtensionData::getLastResolvedIndividualNode() { return mLastResolvedIndiProcSatNode; } CSaturationSuccessorFUNCTIONALConceptExtensionData* CSaturationSuccessorFUNCTIONALConceptExtensionData::setLastResolvedIndividualNode(CIndividualSaturationProcessNode* indiNode) { mLastResolvedIndiProcSatNode = indiNode; return this; } CSaturationSuccessorData* CSaturationSuccessorFUNCTIONALConceptExtensionData::getLastExaminedLinkedSuccessorData() { return mLastExaminedLinkedSucc; } CSaturationSuccessorFUNCTIONALConceptExtensionData* CSaturationSuccessorFUNCTIONALConceptExtensionData::setLastExaminedLinkedSuccessorData(CSaturationSuccessorData* lastExaminedLinkedSucc) { mLastExaminedLinkedSucc = lastExaminedLinkedSucc; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptLabelSet.cpp0000644000175000017500000001422512520551076026523 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptLabelSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptLabelSet::CConceptLabelSet(CProcessContext* processContext) : mProcessContext(processContext),mConceptDesDepMap(processContext) { mConceptDesLinker = nullptr; mPrevConceptDesLinker = nullptr; mConceptCount = 0; } CConceptLabelSet::~CConceptLabelSet() { } CConceptSetSignature* CConceptLabelSet::getConceptSignature() { return &mConceptSignature; } cint64 CConceptLabelSet::getConceptSignatureValue() { return mConceptSignature.getSignatureValue(); } CConceptLabelSet* CConceptLabelSet::initConceptLabelSet(CConceptLabelSet* prevConceptLabelSet) { if (prevConceptLabelSet) { mConceptDesLinker = prevConceptLabelSet->mConceptDesLinker; mPrevConceptDesLinker = mConceptDesLinker; mConceptCount = prevConceptLabelSet->mConceptCount; mConceptDesDepMap = prevConceptLabelSet->mConceptDesDepMap; } else { mConceptDesDepMap.clear(); mConceptDesLinker = nullptr; mPrevConceptDesLinker = nullptr; mConceptCount = 0; } return this; } bool CConceptLabelSet::hasConceptDescriptor(CConceptDescriptor* conceptDescriptor) { return hasConcept(conceptDescriptor->getConcept(),conceptDescriptor->getNegation()); } bool CConceptLabelSet::containsConceptDescriptor(CConceptDescriptor* conceptDescriptor) { return hasConceptDescriptor(conceptDescriptor); } bool CConceptLabelSet::hasConcept(CConcept* concept, bool negated) { cint64 conTag = concept->getConceptTag(); CConceptDescriptorDependencyPair* conDesDepPair = nullptr; bool isContained = mConceptDesDepMap.tryGetValuePointer(conTag,conDesDepPair); return isContained && conDesDepPair->first->isNegated() == negated; } bool CConceptLabelSet::hasConcept(CConcept* concept, bool* containsNegated) { cint64 conTag = concept->getConceptTag(); CConceptDescriptorDependencyPair* conDesDepPair = nullptr; bool isContained = mConceptDesDepMap.tryGetValuePointer(conTag,conDesDepPair); if (isContained && containsNegated) { *containsNegated = conDesDepPair->first->isNegated(); } return isContained; } bool CConceptLabelSet::containsConcept(CConcept* concept, bool* containsNegated) { return hasConcept(concept,containsNegated); } bool CConceptLabelSet::containsConcept(CConcept* concept, bool negated) { return hasConcept(concept,negated); } CClashedConceptDescriptor* CConceptLabelSet::insertConceptReturnClash(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint) { cint64 conTag = conceptDescriptor->getConceptTag(); bool alreadyContained = false; CPROCESSMAP::iterator it = mConceptDesDepMap.tryInsert(conTag,CConceptDescriptorDependencyPair(conceptDescriptor,depTrackPoint),&alreadyContained); if (alreadyContained) { cint64 containConceptTag(it.key()); CConceptDescriptorDependencyPair containsDesDepPair(it.value()); CConceptDescriptor* containsConDes = containsDesDepPair.first; if (containsConDes->isNegated() != conceptDescriptor->isNegated()) { CDependencyTrackPoint* containsDepTrackPoint = containsDesDepPair.second; // create clash CClashedConceptDescriptor* clashDes1 = CObjectAllocator::allocateAndConstruct(CContext::getMemoryAllocationManager(mProcessContext)); clashDes1->initClashedConceptDescriptor(conceptDescriptor,depTrackPoint,0); CClashedConceptDescriptor* clashDes2 = CObjectAllocator::allocateAndConstruct(CContext::getMemoryAllocationManager(mProcessContext)); clashDes2->initClashedConceptDescriptor(containsConDes,containsDesDepPair.second,0); clashDes1->append(clashDes2); return clashDes1; } } else { ++mConceptCount; mConceptSignature.addConceptSignature(conceptDescriptor); mConceptDesLinker = conceptDescriptor->append(mConceptDesLinker); } return nullptr; } CConceptLabelSet* CConceptLabelSet::insertConceptThrowClash(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint) { CClashedConceptDescriptor* clash = insertConceptReturnClash(conceptDescriptor,depTrackPoint); if (clash) { throw clash; } return this; } CConceptLabelSet* CConceptLabelSet::updateConceptDependencyTrackPoint(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* updateDepTrackPoint) { cint64 conTag = conceptDescriptor->getConceptTag(); mConceptDesDepMap.insert(conTag,CConceptDescriptorDependencyPair(conceptDescriptor,updateDepTrackPoint)); return this; } cint64 CConceptLabelSet::getConceptCount() { return mConceptCount; } CConceptLabelSetIterator CConceptLabelSet::getConceptLabelSetIterator(bool getSorted, bool getDependencies) { if (getSorted || getDependencies) { return CConceptLabelSetIterator(mConceptCount,nullptr,mConceptDesDepMap.begin(),mConceptDesDepMap.end()); } else { return CConceptLabelSetIterator(mConceptCount,mConceptDesLinker,mConceptDesDepMap.end(),mConceptDesDepMap.end()); } } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableCacheRetrievalData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableCacheRetriev0000644000175000017500000000241712520551124032257 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeSatisfiableCacheRetrievalData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeSatisfiableCacheRetrievalData::CIndividualNodeSatisfiableCacheRetrievalData() { } CIndividualNodeSatisfiableCacheRetrievalData::~CIndividualNodeSatisfiableCacheRetrievalData() { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CTriggeredImplicationProcessingRestrictionSpecification.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CTriggeredImplicationProcessingRestric0000644000175000017500000000521612520551162032425 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTriggeredImplicationProcessingRestrictionSpecification.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CTriggeredImplicationProcessingRestrictionSpecification::CTriggeredImplicationProcessingRestrictionSpecification() { mNextImpTrigger = nullptr; mLastDependency = nullptr; } CTriggeredImplicationProcessingRestrictionSpecification* CTriggeredImplicationProcessingRestrictionSpecification::initImplicationTriggeringProcessingRestriction(CTriggeredImplicationProcessingRestrictionSpecification* prevRest) { CProcessingRestrictionSpecification::initProcessingRestriction(prevRest); if (prevRest) { mNextImpTrigger = prevRest->mNextImpTrigger; mLastDependency = prevRest->mLastDependency; } return this; } CTriggeredImplicationProcessingRestrictionSpecification* CTriggeredImplicationProcessingRestrictionSpecification::setConceptImplicationTrigger(CSortedNegLinker* conRoleBranchTrigger) { mNextImpTrigger = conRoleBranchTrigger; return this; } bool CTriggeredImplicationProcessingRestrictionSpecification::hasConceptImplicationTrigger() { return mNextImpTrigger != nullptr; } CSortedNegLinker* CTriggeredImplicationProcessingRestrictionSpecification::getConceptImplicationTrigger() { return mNextImpTrigger; } CDependency* CTriggeredImplicationProcessingRestrictionSpecification::getImplicationDependency() { return mLastDependency; } CTriggeredImplicationProcessingRestrictionSpecification* CTriggeredImplicationProcessingRestrictionSpecification::setImplicationDependency(CDependency* dependency) { mLastDependency = dependency; return this; } }; // end namespace Kernel }; // end namespace Process }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedDatatypeValueSpaceExclusionDescriptor.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedDatatypeValueSpaceExclusionDes0000644000175000017500000000467012520551074032272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDDATATYPEVALUESPACEEXCLUSIONDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDDATATYPEVALUESPACEEXCLUSIONDESCRIPTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CClashedDependencyDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CClashedDatatypeValueSpaceExclusionDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClashedDatatypeValueSpaceExclusionDescriptor : public CClashedDependencyDescriptor { // public methods public: //! Constructor CClashedDatatypeValueSpaceExclusionDescriptor(); CClashedDatatypeValueSpaceExclusionDescriptor* initClashedDatatypeValueSpaceExclusionDescriptor(CDependencyTrackPoint* depTrackPoint, CIndividualProcessNode* individual); cint64 getAppropriatedIndividualID(); CClashedDatatypeValueSpaceExclusionDescriptor* setAppropriatedIndividual(CIndividualProcessNode* individualNode); CIndividualProcessNode* getAppropriatedIndividual(); // protected methods protected: // protected variables protected: CIndividualProcessNode* mIndividualNode; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDDATATYPEVALUESPACEEXCLUSIONDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceData.h0000644000175000017500000001007112520551116027465 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CClashedDependencyDescriptor.h" #include "CDatatypeValueSpaceValuesCounter.h" #include "CDatatypeDependencyTrackPointCollection.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CDatatypeValueSpaceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceData { // public methods public: //! Constructor CDatatypeValueSpaceData(CProcessContext* processContext); CDatatypeValueSpaceData* initValueSpaceData(CDatatypeValueSpaceData* spaceData); bool isValueSpaceClashCheckingRequired(); CDatatypeValueSpaceData* setValueSpaceClashCheckingRequired(bool clashCheckingRequired); CDatatypeDependencyTrackPointCollection* getClashDependencyTrackPointCollection(); CClashedDependencyDescriptor* getClashDependencyDescriptorLinker(); bool isValueSpaceClashed(); CDatatypeValueSpaceData* setValueSpaceClashed(bool clashed); CDependencyTrackPoint* getValueSpaceInitialisationDependencyTrackPoint(); CDatatypeValueSpaceData* setValueSpaceInitialisationDependencyTrackPoint(CDependencyTrackPoint* depTrackPoint); bool setValueSpaceInitialisationDependencyTrackPointCandidate(CDependencyTrackPoint* depTrackPoint); bool isValueSpaceTriggeringCompleted(); CDatatypeValueSpaceData* setValueSpaceTriggeringCompleted(bool triggeringCompleted); bool isValueSpaceTriggeringRequired(); CDatatypeValueSpaceData* setValueSpaceTriggeringRequired(bool triggeringRequired); bool isValueSpaceTriggeringStarted(); CDatatypeValueSpaceData* setValueSpaceTriggeringStarted(bool triggeringStarted); bool isValueSpaceCountingRequired(); CDatatypeValueSpaceData* setValueSpaceCountingRequired(bool recountingRequired); bool isValueSpaceCounted(); CDatatypeValueSpaceData* setValueSpaceCounted(bool counted); CDatatypeValueSpaceValuesCounter* getValuesCounter(); CDatatypeValueSpaceData* setValueSpaceModification(); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CDependencyTrackPoint* mValueSpaceInitialisationDepTrackPoint; bool mValueSpaceClashCheckingRequired; bool mValueSpaceClashed; CDatatypeDependencyTrackPointCollection mClashDepTrackPointCollection; bool mValueSpaceTriggeringCompleted; bool mValueSpaceTriggeringStarted; bool mValueSpaceTriggeringRequired; bool mValueSpaceCounted; bool mValueSpaceCountingRequired; CDatatypeValueSpaceValuesCounter mValuesCounter; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEVALUESPACEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDependencyTracker.cpp0000644000175000017500000000323712520551116027102 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDependencyTracker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDependencyTracker::CDependencyTracker(CDependencyTrackPoint* dependencyTrackPoint) : mDependencyTrackPoint(dependencyTrackPoint) { } CDependencyTrackPoint* CDependencyTracker::getDependencyTrackPoint() { return mDependencyTrackPoint; } CDependencyTracker* CDependencyTracker::setDependencyTrackPoint(CDependencyTrackPoint* dependencyTrackPoint) { mDependencyTrackPoint = dependencyTrackPoint; return this; } CDependencyTracker* CDependencyTracker::initDependencyTracker(CDependencyTrackPoint* dependencyTrackPoint) { mDependencyTrackPoint = dependencyTrackPoint; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeCompareValueDataExclusion.cpp0000644000175000017500000000412512520551110032242 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeCompareValueDataExclusion.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeCompareValueDataExclusion::CDatatypeCompareValueDataExclusion() { } CDatatypeCompareValueDataExclusion* CDatatypeCompareValueDataExclusion::initDataExclusion(CDatatypeCompareValueDataExclusion* value) { if (value) { mExcluded = value->mExcluded; mExcludedDepTrackPoint = value->mExcludedDepTrackPoint; } else { mExcludedDepTrackPoint = nullptr; mExcluded = false; } return this; } bool CDatatypeCompareValueDataExclusion::isExcluded() { return mExcluded; } CDependencyTrackPoint* CDatatypeCompareValueDataExclusion::getExcludedDependencyTrackPoint() { return mExcludedDepTrackPoint; } CDatatypeCompareValueDataExclusion* CDatatypeCompareValueDataExclusion::setExcluded(bool excluded) { mExcluded = excluded; return this; } CDatatypeCompareValueDataExclusion* CDatatypeCompareValueDataExclusion::setExcludedDependencyTrackPoint(CDependencyTrackPoint* depTrackPoint) { mExcludedDepTrackPoint = depTrackPoint; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptLabelSetIterator.h0000644000175000017500000000543512520551076027705 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTLABELSETITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTLABELSETITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptorDependencyPair.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConceptLabelSetIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptLabelSetIterator { // public methods public: //! Constructor CConceptLabelSetIterator(cint64 conceptCount, CConceptDescriptor* conceptDesLinker, const CPROCESSMAP::iterator& beginIt, const CPROCESSMAP::iterator& endIt); cint64 getRemainingConceptCount(); CConceptDescriptor* getConceptDescriptor(); CDependencyTrackPoint* getDependencyTrackPoint(); CConceptLabelSetIterator& operator++(); CConceptDescriptor* operator*(); CConceptLabelSetIterator* moveNext(); bool hasValue(); bool hasNext(); CConceptDescriptor* next(bool moveToNext = true); bool operator!=(CConceptLabelSetIterator& iterator); bool operator==(CConceptLabelSetIterator& iterator); // protected methods protected: // protected variables protected: CPROCESSMAP::iterator mConDesDepBeginIt; CPROCESSMAP::iterator mConDesDepEndIt; CConceptDescriptor* mConceptDesLinkerIt; cint64 mConceptCount; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTLABELSETITERATOR_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeALLConceptsExtensionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeALLConceptsEx0000644000175000017500000001224212520551152032220 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationIndividualNodeALLConceptsExtensionData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationIndividualNodeALLConceptsExtensionData::CSaturationIndividualNodeALLConceptsExtensionData(CProcessContext* processContext) : mLinkedSuccIdnALLConceptExtHash(processContext) { mProcessContext = processContext; } CSaturationIndividualNodeALLConceptsExtensionData* CSaturationIndividualNodeALLConceptsExtensionData::initALLConceptsExtensionData(CIndividualSaturationProcessNode* indiProcessNode) { mLinkedSuccIdnALLConceptExtHash.initLinkedSuccessorIndividualALLConceptsExtensionHash(); mIndiProcessNode = indiProcessNode; mRoleProcessLinker = nullptr; mSuccessorExtensionInitialized = false; mExtensionProcessingQueued = false; mExtensionProcessLinker = nullptr; return this; } CRoleSaturationProcessLinker* CSaturationIndividualNodeALLConceptsExtensionData::getRoleProcessLinker() { return mRoleProcessLinker; } CRoleSaturationProcessLinker* CSaturationIndividualNodeALLConceptsExtensionData::takeRoleProcessLinker() { CRoleSaturationProcessLinker* tmpRoleProcessLinker = mRoleProcessLinker; mRoleProcessLinker = nullptr; return tmpRoleProcessLinker; } bool CSaturationIndividualNodeALLConceptsExtensionData::isSuccessorExtensionInitialized() { return mSuccessorExtensionInitialized; } CSaturationIndividualNodeALLConceptsExtensionData* CSaturationIndividualNodeALLConceptsExtensionData::setSuccessorExtensionInitialized(bool initialized) { mSuccessorExtensionInitialized = initialized; return this; } CSaturationIndividualNodeALLConceptsExtensionData* CSaturationIndividualNodeALLConceptsExtensionData::addRoleProcessLinker(CRoleSaturationProcessLinker* roleProcessLinker) { if (roleProcessLinker) { mRoleProcessLinker = roleProcessLinker->append(mRoleProcessLinker); } return this; } bool CSaturationIndividualNodeALLConceptsExtensionData::hasProcessLinkerForRole(CRole* role) { cint64 maxTestCount = 10; for (CRoleSaturationProcessLinker* roleProcessLinkerIt = mRoleProcessLinker; roleProcessLinkerIt && --maxTestCount > 0; roleProcessLinkerIt = roleProcessLinkerIt->getNext()) { if (roleProcessLinkerIt->getRole() == role) { return true; } } return false; } bool CSaturationIndividualNodeALLConceptsExtensionData::isExtensionProcessingQueued() { return mExtensionProcessingQueued; } CSaturationIndividualNodeALLConceptsExtensionData* CSaturationIndividualNodeALLConceptsExtensionData::setExtensionProcessingQueued(bool queued) { mExtensionProcessingQueued = queued; return this; } CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash* CSaturationIndividualNodeALLConceptsExtensionData::getLinkedSuccessorIndividualALLConceptsExtensionHash() { return &mLinkedSuccIdnALLConceptExtHash; } CSaturationLinkedSuccessorIndividualALLConceptsExtensionData* CSaturationIndividualNodeALLConceptsExtensionData::getALLConceptsExtensionData(CIndividualSaturationProcessNode* indiNode, bool create) { return mLinkedSuccIdnALLConceptExtHash.getALLConceptsExtensionData(indiNode,create); } bool CSaturationIndividualNodeALLConceptsExtensionData::hasExtensionProcessData() { return mExtensionProcessLinker != nullptr; } CSaturationSuccessorALLConceptExtensionData* CSaturationIndividualNodeALLConceptsExtensionData::takeNextExtensionProcessData() { CSaturationSuccessorALLConceptExtensionData* tmpExtProcessLinker = mExtensionProcessLinker; if (mExtensionProcessLinker) { mExtensionProcessLinker = mExtensionProcessLinker->getNext(); tmpExtProcessLinker->clearNext(); } return tmpExtProcessLinker; } CSaturationSuccessorALLConceptExtensionData* CSaturationIndividualNodeALLConceptsExtensionData::getExtensionProcessDataLinker() { return mExtensionProcessLinker; } CSaturationIndividualNodeALLConceptsExtensionData* CSaturationIndividualNodeALLConceptsExtensionData::addExtensionProcessData(CSaturationSuccessorALLConceptExtensionData* processData) { mExtensionProcessLinker = processData->append(mExtensionProcessLinker); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningKeyMapData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJ0000644000175000017500000000422412520551150032266 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathSetJoiningKeyMapData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathSetJoiningKeyMapData::CRepresentativeVariableBindingPathSetJoiningKeyMapData(CRepresentativeVariableBindingPathSetJoiningKeyDataMap* repVarBindPathSetJoiningKeyDataMap) { mRepVarBindPathSetJoiningKeyDataMap = repVarBindPathSetJoiningKeyDataMap; } CRepresentativeVariableBindingPathSetJoiningKeyDataMap* CRepresentativeVariableBindingPathSetJoiningKeyMapData::getRepresentativeVariableBindingPathSetJoiningKeyDataMap() const { return mRepVarBindPathSetJoiningKeyDataMap; } bool CRepresentativeVariableBindingPathSetJoiningKeyMapData::hasRepresentativeVariableBindingPathSetJoiningKeyDataMap() const { return mRepVarBindPathSetJoiningKeyDataMap != nullptr; } CRepresentativeVariableBindingPathSetJoiningKeyMapData* CRepresentativeVariableBindingPathSetJoiningKeyMapData::setRepresentativeVariableBindingPathSetJoiningKeyDataMap(CRepresentativeVariableBindingPathSetJoiningKeyDataMap* repVarBindPathSetJoiningKeyDataMap) { mRepVarBindPathSetJoiningKeyDataMap = repVarBindPathSetJoiningKeyDataMap; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedNegationDisjointLinkDescriptor.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedNegationDisjointLinkDescriptor0000644000175000017500000000315512520551076032344 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClashedNegationDisjointLinkDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CClashedNegationDisjointLinkDescriptor::CClashedNegationDisjointLinkDescriptor() : CClashedDependencyDescriptor() { mLinkEdge = nullptr; } CClashedNegationDisjointLinkDescriptor* CClashedNegationDisjointLinkDescriptor::initClashedLinkDescriptor(CNegationDisjointEdge* linkEdge, CDependencyTrackPoint* depTrackPoint) { initClashedDependencyDescriptor(depTrackPoint); mLinkEdge = linkEdge; return this; } CNegationDisjointEdge* CClashedNegationDisjointLinkDescriptor::getNegationDisjointLinkEdge() { return mLinkEdge; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeModelData.h0000644000175000017500000000351512520551124027624 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEMODELDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEMODELDATA_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualNodeModelData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeModelData { // public methods public: //! Constructor CIndividualNodeModelData(); //! Destructor virtual ~CIndividualNodeModelData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEMODELDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptDescriptorDependencyPair.h0000644000175000017500000000417612520551076031432 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTDESCRIPTORDEPENDENCYPAIR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTDESCRIPTORDEPENDENCYPAIR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "Dependency/CDependencyTrackPoint.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CConceptDescriptorDependencyPair * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptDescriptorDependencyPair : public QPair { // public methods public: //! Constructor CConceptDescriptorDependencyPair(); CConceptDescriptorDependencyPair(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* dependencyTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTDESCRIPTORDEPENDENCYPAIR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeDateTimeValueSpaceData.cpp0000644000175000017500000000605212520551110031433 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeDateTimeValueSpaceData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeDateTimeValueSpaceData::CDatatypeDateTimeValueSpaceData(CProcessContext* processContext) : CDatatypeCompareValueSpaceData(processContext) { mDateTimeValueSpaceMap = nullptr; } CDatatypeDateTimeValueSpaceData* CDatatypeDateTimeValueSpaceData::initDateTimeValueSpaceData(CDatatypeValueSpaceDateTimeType* valueSpaceType) { CDatatypeCompareValueSpaceData::initValueSpaceData(nullptr); mValueSpaceType = valueSpaceType; if (mDateTimeValueSpaceMap) { mDateTimeValueSpaceMap->initDatatypeCompareValueSpaceMap(valueSpaceType); } return this; } CDatatypeDateTimeValueSpaceData* CDatatypeDateTimeValueSpaceData::copyDateTimeValueSpaceData(CDatatypeDateTimeValueSpaceData* spaceData) { CDatatypeCompareValueSpaceData::initValueSpaceData(spaceData); mValueSpaceType = spaceData->mValueSpaceType; if (spaceData->mDateTimeValueSpaceMap && !mDateTimeValueSpaceMap) { getDateTimeValueSpaceMap(true); mDateTimeValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mDateTimeValueSpaceMap); } else if (mDateTimeValueSpaceMap) { if (spaceData->mDateTimeValueSpaceMap) { mDateTimeValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mDateTimeValueSpaceMap); } else { mDateTimeValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } } return this; } CDatatypeDateTimeValueSpaceMap* CDatatypeDateTimeValueSpaceData::getDateTimeValueSpaceMap(bool create) { if (create && !mDateTimeValueSpaceMap) { mDateTimeValueSpaceMap = CObjectParameterizingAllocator< CDatatypeDateTimeValueSpaceMap,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mDateTimeValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } return mDateTimeValueSpaceMap; } CDatatypeCompareValueSpaceMap* CDatatypeDateTimeValueSpaceData::createValueSpaceMap() { return getDateTimeValueSpaceMap(true); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingSet.h0000644000175000017500000001073512520551140027405 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGSET_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGSET_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "CPropagationBindingMap.h" #include "CPropagationBindingDescriptor.h" #include "CPropagationBindingReapplyConceptDescriptor.h" #include "CPropagationBindingReapplyConceptHash.h" #include "CPropagationVariableBindingTransitionExtension.h" #include "CPropagationRepresentativeTransitionExtension.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CPropagationBindingSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPropagationBindingSet { // public methods public: //! Constructor CPropagationBindingSet(CProcessContext* processContext); CPropagationBindingSet* initPropagationBindingSet(CPropagationBindingSet* prevSet); CPropagationBindingMap* getPropagationBindingMap(); bool containsPropagationBinding(CPropagationBinding* propagationBinding); bool containsPropagationBinding(cint64 bindingID); CPropagationBindingDescriptor* getPropagationBindingDescriptor(CPropagationBinding* propagationBinding); CPropagationBindingDescriptor* getNewSepcialPropagationBindingDescriptor(); CPropagationBindingSet* addPropagationBinding(CPropagationBindingDescriptor* propBindDes, bool newSpecial); CPropagationBindingReapplyConceptDescriptor* addPropagationBindingReturnReapplyLinker(CPropagationBindingDescriptor* propBindDes, bool newSpecial); CPropagationBindingSet* copyPropagationBindings(CPropagationBindingMap* propBindMap); CConceptDescriptor* getConceptDescriptor(); CPropagationBindingSet* setConceptDescriptor(CConceptDescriptor* conDes); CPropagationBindingSet* addPropagationBindingDescriptorLinker(CPropagationBindingDescriptor* propBindDesLinker); CPropagationBindingDescriptor* getPropagationBindingDescriptorLinker(); CPropagationBindingReapplyConceptHash* getPropagationBindingReapplyConceptHash(bool create = true); CPropagationBindingSet* addPropagationBindingReapplyConceptDescriptor(CPropagationBindingReapplyConceptDescriptor* propBindReapplyConDesLinker); CPropagationVariableBindingTransitionExtension* getPropagationVariableBindingTransitionExtension(bool create = true); CPropagationRepresentativeTransitionExtension* getPropagationRepresentativeTransitionExtension(bool create = true); bool hasPropagateAllFlag(); bool getPropagateAllFlag(); CPropagationBindingSet* setPropagateAllFlag(bool propAllFlag); bool adoptPropagateAllFlag(CPropagationBindingSet* propBindSet); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CPropagationBindingMap mPropMap; bool mPropagateAllFlag; CConceptDescriptor* mConceptDescriptor; CPropagationBindingDescriptor* mPropBindDesLinker; CPropagationBindingDescriptor* mSpecialNewPropBindDes; CPropagationBindingReapplyConceptHash* mReapplyHash; CPropagationVariableBindingTransitionExtension* mPropVarBindTransExtension; CPropagationRepresentativeTransitionExtension* mPropRepTransExtension; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGSET_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingTriggerHash.h0000644000175000017500000000522012520551164030322 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGTRIGGERHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGTRIGGERHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CVariableBindingTriggerData.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { typedef QPair TVariableIndividualPair; /*! * * \class CVariableBindingTriggerHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingTriggerHash : public CPROCESSHASH { // public methods public: //! Constructor CVariableBindingTriggerHash(CProcessContext* context); CVariableBindingTriggerHash* initVariableBindingTriggerHash(CVariableBindingTriggerHash* prevHash); CVariableBindingTriggerData& getTriggerData(CVariable* variable, CIndividualProcessNode* indiNode); CVariableBindingTriggerLinker* setTriggeredReturnTriggerLinker(CVariable* variable, CIndividualProcessNode* indiNode); bool tryInsertVariableBindingTrigger(CVariable* variable, CIndividualProcessNode* indiNode, CVariableBindingPathDescriptor* varBindPathDes, CVariableBindingDescriptor* varBindDes, bool leftTriggered); // protected methods protected: // protected variables protected: CProcessContext* mContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGTRIGGERHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessContext.cpp0000644000175000017500000000227512520551134026474 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessContext.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CProcessContext::CProcessContext() { mUsedProcessTagger = nullptr; mUsedMemMan = nullptr; } CProcessContext::~CProcessContext() { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathDescriptor.cpp0000644000175000017500000000312612520551162031402 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingPathDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingPathDescriptor::CVariableBindingPathDescriptor() : CLinkerBase(nullptr) { } CVariableBindingPath* CVariableBindingPathDescriptor::getVariableBindingPath() { return getData(); } CVariableBindingPathDescriptor* CVariableBindingPathDescriptor::initVariableBindingPathDescriptor(CVariableBindingPath* varBindPath, CDependencyTrackPoint* dependencyTrackPoint) { initDependencyTracker(dependencyTrackPoint); setData(varBindPath); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000020500000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeRepresentativeMemoryBac0000644000175000017500000001512412520551124032342 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData() { } CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::~CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData() { } CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::initSynchronisationData(CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* synchData) { if (synchData) { mLastCriticalNeighbourTestedConDes = synchData->mLastCriticalNeighbourTestedConDes; mLastSynchronizationTestedConDes = synchData->mLastSynchronizationTestedConDes; mLastSynchedConDes = synchData->mLastSynchedConDes; mAssociationData = synchData->mAssociationData; mSynchron = synchData->mSynchron; mCriticalNeighbour = synchData->mCriticalNeighbour; mLastCriticalNeighbourLinkEdge = synchData->mLastCriticalNeighbourLinkEdge; mCriticalCardinality = synchData->mCriticalCardinality; } else { mLastSynchronizationTestedConDes = nullptr; mLastCriticalNeighbourTestedConDes = nullptr; mLastSynchedConDes = nullptr; mAssociationData = nullptr; mLastCriticalNeighbourLinkEdge = nullptr; mSynchron = false; mCriticalNeighbour = false; mCriticalCardinality = false; } return this; } CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::initSynchronisationData(CBackendRepresentativeMemoryCacheIndividualAssociationData* associationData) { mLastCriticalNeighbourTestedConDes = nullptr; mLastSynchronizationTestedConDes = nullptr; mLastSynchedConDes = nullptr; mLastCriticalNeighbourLinkEdge = nullptr; mAssociationData = associationData; mSynchron = true; mCriticalNeighbour = false; mCriticalCardinality = false; return this; } bool CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::isCriticalCardinalityExpansionBlocking() { return mCriticalCardinality; } CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::setCriticalCardinalityExpansionBlocking(bool critical) { mCriticalCardinality = critical; return this; } bool CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::isCriticalNeighbourExpansionBlocking() { return mCriticalNeighbour; } CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::setCriticalNeighbourExpansionBlocking(bool critical) { mCriticalNeighbour = critical; return this; } CConceptDescriptor* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::getLastSynchronizationTestedConceptDescriptor() { return mLastSynchronizationTestedConDes; } CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::setLastSynchronizationTestedConceptDescriptor(CConceptDescriptor* conDes) { mLastSynchronizationTestedConDes = conDes; return this; } CIndividualLinkEdge* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::getLastCriticalCardinalityLinkEdge() { return mLastCriticalNeighbourLinkEdge; } CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::setLastCriticalCardinalityLinkEdge(CIndividualLinkEdge* linkEdge) { mLastCriticalNeighbourLinkEdge = linkEdge; return this; } CConceptDescriptor* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::getLastCriticalNeighbourExpansionTestedConceptDescriptor() { return mLastCriticalNeighbourTestedConDes; } CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::setLastCriticalNeighbourExpansionTestedConceptDescriptor(CConceptDescriptor* conDes) { mLastCriticalNeighbourTestedConDes = conDes; return this; } CConceptDescriptor* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::getLastSynchedConceptDescriptor() { return mLastSynchedConDes; } CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::setLastSynchedConceptDescriptor(CConceptDescriptor* conDes) { mLastSynchedConDes = conDes; return this; } CBackendRepresentativeMemoryCacheIndividualAssociationData* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::getAssocitaionData() { return mAssociationData; } CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::setAssociationData(CBackendRepresentativeMemoryCacheIndividualAssociationData* associationData) { mAssociationData = associationData; return this; } bool CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::isBackendCacheSynchron() { return mSynchron; } CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData::setBackendCacheSynchron(bool synchron) { mSynchron = synchron; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorIndividualALLConceptsExtensionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorIndividualAL0000644000175000017500000000557212520551154032335 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONLINKEDSUCCESSORINDIVIDUALALLCONCEPTSEXTENSIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONLINKEDSUCCESSORINDIVIDUALALLCONCEPTSEXTENSIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CSaturationSuccessorALLConceptExtensionData.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationLinkedSuccessorIndividualALLConceptsExtensionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationLinkedSuccessorIndividualALLConceptsExtensionData { // public methods public: //! Constructor CSaturationLinkedSuccessorIndividualALLConceptsExtensionData(CProcessContext* processContext); CSaturationLinkedSuccessorIndividualALLConceptsExtensionData* initLinkedSuccessorIndividualALLConceptsExtensionData(CIndividualSaturationProcessNode* indiProcSatNode); CPROCESSHASH* getRoleConceptExtensionHash(); CSaturationSuccessorALLConceptExtensionData* getRoleSuccessorALLConceptExtensionData(CRole* role, bool create = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CIndividualSaturationProcessNode* mIndiProcSatNode; CPROCESSHASH* mRoleConceptExtensionHash; CRole* mOnlyRole; CSaturationSuccessorALLConceptExtensionData* mOnlyAllConceptExtData; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONLINKEDSUCCESSORINDIVIDUALALLCONCEPTSEXTENSIONDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeContainingMapData.cpp0000644000175000017500000000415412520551142031750 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeContainingMapData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeContainingMapData::CRepresentativeContainingMapData(CRepresentativeVariableBindingPathSetData* containedRep, bool explContained) { mExplicitelyContained = explContained; mContainedRep = containedRep; } CRepresentativeVariableBindingPathSetData* CRepresentativeContainingMapData::getRepresentativeVariableBindingPathSetData() const { return mContainedRep; } bool CRepresentativeContainingMapData::hasRepresentativeVariableBindingPathSetData() const { return mContainedRep != nullptr; } CRepresentativeContainingMapData* CRepresentativeContainingMapData::setRepresentativeVariableBindingPathSetData(CRepresentativeVariableBindingPathSetData* containedRep) { mContainedRep = containedRep; return this; } bool CRepresentativeContainingMapData::isExplicitelyContained() const { return mExplicitelyContained; } CRepresentativeContainingMapData* CRepresentativeContainingMapData::setExplicitelyContained(bool explContained) { mExplicitelyContained = explContained; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptNominalSchemaGroundingHasher.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptNominalSchemaGroundingHasher.c0000644000175000017500000000301112520551100032171 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptNominalSchemaGroundingHasher.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptNominalSchemaGroundingHasher::CConceptNominalSchemaGroundingHasher(CConceptNominalSchemaGroundingData* data) { mData = data; mHashValue = mData->calculateHashValue(); } cint64 CConceptNominalSchemaGroundingHasher::getHashValue() const { return mHashValue; } bool CConceptNominalSchemaGroundingHasher::operator==(const CConceptNominalSchemaGroundingHasher& hasher) const { return mData->isEquivalentTo(*hasher.mData); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleSuccessorLinkIterator.cpp0000644000175000017500000000422012520551152030624 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleSuccessorLinkIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRoleSuccessorLinkIterator::CRoleSuccessorLinkIterator() : mLinkLinker(nullptr),mLastLink(nullptr) { } CRoleSuccessorLinkIterator::CRoleSuccessorLinkIterator(const CPROCESSHASH::iterator& beginIt, const CPROCESSHASH::iterator& endIt) : mLinkLinker(nullptr),mBeginIt(beginIt),mEndIt(endIt),mLastLink(nullptr) { } CRoleSuccessorLinkIterator::CRoleSuccessorLinkIterator(CIndividualLinkEdge* linkLinker, CIndividualLinkEdge* lastLink) : mLinkLinker(linkLinker),mLastLink(lastLink) { } bool CRoleSuccessorLinkIterator::hasNext() { return (mLinkLinker && mLinkLinker != mLastLink) || mBeginIt != mEndIt; } CIndividualLinkEdge* CRoleSuccessorLinkIterator::next(bool moveNext) { CIndividualLinkEdge* link = nullptr; if (mLinkLinker) { link = mLinkLinker; if (moveNext) { mLinkLinker = mLinkLinker->getNext(); } } else { if (mBeginIt != mEndIt) { link = mBeginIt.value(); if (moveNext) { ++mBeginIt; } } } return link; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualProcessNodeVector.h0000644000175000017500000000437112520551126030576 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODEVECTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODEVECTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" #include "CProcessContext.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualProcessNodeVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeVector : public CDefaultDynamicReferenceVectorBase { // public methods public: //! Constructor CIndividualProcessNodeVector(CProcessContext* processContext = nullptr); //! Destructor virtual ~CIndividualProcessNodeVector(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODEVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualProcessNodeLinker.h0000644000175000017500000000450712520551126030561 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODELINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODELINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Utilities/Container/CNegLinker.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualProcessNodeLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeLinker : public CNegLinkerBase { // public methods public: //! Constructor CIndividualProcessNodeLinker(); CIndividualProcessNodeLinker* initProcessNodeLinker(CIndividualProcessNode *individual, bool processingQueued); CIndividualProcessNode* getProcessingIndividual(); bool isProcessingQueued(); CIndividualProcessNodeLinker* clearProcessingQueued(); CIndividualProcessNodeLinker* setProcessingQueued(bool processingQueued = true); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALPROCESSNODELINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptProcessingQueue.cpp0000644000175000017500000001707012520551100030136 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptProcessingQueue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptProcessingQueue::CConceptProcessingQueue(CProcessContext* processContext) : mProcessContext(processContext) { mMaxPriorityIndex = -1; mDesCount = 0; } CConceptProcessingQueue::~CConceptProcessingQueue() { } CConceptProcessingQueue* CConceptProcessingQueue::initProcessingQueue(CConceptProcessingQueue* processingQueue) { if (processingQueue) { mMaxPriorityIndex = processingQueue->mMaxPriorityIndex; mDesCount = processingQueue->mDesCount; for (cint64 i = 0; i < mMaxIndex; ++i) { mPriorityVec[i] = processingQueue->mPriorityVec[i]; mPriorityVec[i].mPrevSortedPriorityDescriptorLinker = processingQueue->mPriorityVec[i].mSortedPriorityDescriptorLinker; } } else { mMaxPriorityIndex = -1; mDesCount = 0; for (cint64 i = 0; i < mMaxIndex; ++i) { CConceptProcessingPriorityQueueData& queueData = mPriorityVec[i]; queueData.mDefaultPriorityDescriptorLinker = nullptr; queueData.mSortedPriorityDescriptorLinker = nullptr; queueData.mPrevSortedPriorityDescriptorLinker = nullptr; } } return this; } CConceptProcessingQueue* CConceptProcessingQueue::resetProcessingQueueModification() { for (cint64 i = 0; i < mMaxIndex; ++i) { CConceptProcessingPriorityQueueData& queueData = mPriorityVec[i]; queueData.mPrevSortedPriorityDescriptorLinker = nullptr; } return this; } qint64 CConceptProcessingQueue::getDescriptorCount() { return mDesCount; } bool CConceptProcessingQueue::hasProcessDescriptor() { return mDesCount > 0; } bool CConceptProcessingQueue::isEmpty() { return mDesCount <= 0; } CConceptProcessingQueue *CConceptProcessingQueue::reinsertConceptProcessDescriptor(CConceptProcessDescriptor *conProDes) { CConceptProcessPriority conPriority = conProDes->getProcessPriority(); double priority = conPriority.getPriority(); cint64 priorityIndex = priority; ++mDesCount; mMaxPriorityIndex = qMax(mMaxPriorityIndex,priorityIndex); CConceptProcessingPriorityQueueData& proPriQueData = mPriorityVec[priorityIndex]; if (priority == (double)priorityIndex) { proPriQueData.mDefaultPriorityDescriptorLinker = conProDes; } else { proPriQueData.mSortedPriorityDescriptorLinker = conProDes; if (proPriQueData.mPrevSortedPriorityDescriptorLinker && proPriQueData.mPrevSortedPriorityDescriptorLinker == conProDes->getNext()) { proPriQueData.mPrevSortedPriorityDescriptorLinker = conProDes; } } return this; } CConceptProcessingQueue* CConceptProcessingQueue::insertConceptProcessDescriptor(CConceptProcessDescriptor *conProDes) { CConceptProcessPriority conPriority = conProDes->getProcessPriority(); double priority = conPriority.getPriority(); cint64 priorityIndex = priority; ++mDesCount; mMaxPriorityIndex = qMax(mMaxPriorityIndex,priorityIndex); CConceptProcessingPriorityQueueData& proPriQueData = mPriorityVec[priorityIndex]; if (priority == (double)priorityIndex) { proPriQueData.mDefaultPriorityDescriptorLinker = conProDes->append(proPriQueData.mDefaultPriorityDescriptorLinker); } else { CConceptProcessDescriptor* sortedDesLinker = proPriQueData.mSortedPriorityDescriptorLinker; if (!sortedDesLinker || *conProDes <= *sortedDesLinker) { // insert to begin proPriQueData.mSortedPriorityDescriptorLinker = conProDes->append(proPriQueData.mSortedPriorityDescriptorLinker); } else { CConceptProcessDescriptor* lastSortedDesLinker = nullptr; while (sortedDesLinker && !(*conProDes <= *sortedDesLinker)) { if (sortedDesLinker == proPriQueData.mPrevSortedPriorityDescriptorLinker) { // make descriptor local CConceptProcessDescriptor* newLocalDescriptor = CObjectAllocator::allocateAndConstruct(CContext::getMemoryAllocationManager(mProcessContext)); newLocalDescriptor->initCopy(sortedDesLinker); proPriQueData.mPrevSortedPriorityDescriptorLinker = proPriQueData.mPrevSortedPriorityDescriptorLinker->getNext(); sortedDesLinker = sortedDesLinker->getNext(); if (lastSortedDesLinker) { lastSortedDesLinker->setNext(newLocalDescriptor); } else { proPriQueData.mSortedPriorityDescriptorLinker = newLocalDescriptor; } lastSortedDesLinker = newLocalDescriptor; } else { lastSortedDesLinker = sortedDesLinker; sortedDesLinker = sortedDesLinker->getNext(); } } if (lastSortedDesLinker) { conProDes->append(sortedDesLinker); lastSortedDesLinker->setNext(conProDes); } } } return this; } CConceptProcessDescriptor* CConceptProcessingQueue::takeNextConceptDescriptorProcess() { CConceptProcessDescriptor* conProDes = nullptr; while (mDesCount > 0 && !conProDes && mMaxPriorityIndex >= 0) { CConceptProcessingPriorityQueueData& proPriQueData = mPriorityVec[mMaxPriorityIndex]; conProDes = proPriQueData.mDefaultPriorityDescriptorLinker; if (conProDes) { proPriQueData.mDefaultPriorityDescriptorLinker = conProDes->getNext(); } else { conProDes = proPriQueData.mSortedPriorityDescriptorLinker; if (conProDes) { if (conProDes == proPriQueData.mPrevSortedPriorityDescriptorLinker) { proPriQueData.mPrevSortedPriorityDescriptorLinker = proPriQueData.mPrevSortedPriorityDescriptorLinker->getNext(); } proPriQueData.mSortedPriorityDescriptorLinker = conProDes->getNext(); } else { --mMaxPriorityIndex; } } } if (conProDes) { --mDesCount; } return conProDes; } bool CConceptProcessingQueue::getNextConceptProcessPriority(CConceptProcessPriority* priority) { CConceptProcessDescriptor* conProDes = nullptr; if (mDesCount <= 0) { return false; } while (!conProDes && mMaxPriorityIndex >= 0) { CConceptProcessingPriorityQueueData& proPriQueData = mPriorityVec[mMaxPriorityIndex]; conProDes = proPriQueData.mDefaultPriorityDescriptorLinker; if (!conProDes) { conProDes = proPriQueData.mSortedPriorityDescriptorLinker; if (!conProDes) { --mMaxPriorityIndex; } } } *priority = conProDes->getProcessPriority(); return true; } CConceptProcessingQueueIterator CConceptProcessingQueue::getConceptProcessingQueueIterator() { return CConceptProcessingQueueIterator(mPriorityVec,mDesCount); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathMapData.cpp0000644000175000017500000000320612520551164030574 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingPathMapData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingPathMapData::CVariableBindingPathMapData(CVariableBindingPathDescriptor* propBindDes) { mPropBindDes = propBindDes; } CVariableBindingPathDescriptor* CVariableBindingPathMapData::getVariableBindingPathDescriptor() const { return mPropBindDes; } bool CVariableBindingPathMapData::hasVariableBindingPathDescriptor() const { return mPropBindDes != nullptr; } CVariableBindingPathMapData* CVariableBindingPathMapData::setVariableBindingPathDescriptor(CVariableBindingPathDescriptor* des) { mPropBindDes = des; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyHasher.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoin0000644000175000017500000000564612520551146032336 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHJOININGKEYHASHER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHJOININGKEYHASHER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CRepresentativeVariableBindingPathJoiningKeyData.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathJoiningKeyHasher * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathJoiningKeyHasher { // public methods public: //! Constructor CRepresentativeVariableBindingPathJoiningKeyHasher(CRepresentativeVariableBindingPathJoiningKeyData* data); CRepresentativeVariableBindingPathJoiningKeyHasher(CVariableBindingPath* varBindPath, CSortedLinker* keyVars); cint64 getHashValue() const; bool operator==(const CRepresentativeVariableBindingPathJoiningKeyHasher& hasher) const; // protected methods protected: cint64 calculateHashValue(CVariableBindingPath* varBindPath, CSortedLinker* keyVars); // protected variables protected: CRepresentativeVariableBindingPathJoiningKeyData* mJoiningData; CVariableBindingPath* mVarBindPath; CSortedLinker* mKeyVars; cint64 mHashValue; // private methods private: // private variables private: }; inline uint qHash(const CRepresentativeVariableBindingPathJoiningKeyHasher& hasher) { qint64 key = (qint64)hasher.getHashValue(); if (sizeof(quint64) > sizeof(uint)) { return uint((key >> (8 * sizeof(uint) - 1)) ^ key); } else { return uint(key); } } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHJOININGKEYHASHER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConnectionSuccessorCorrectionHash.h0000644000175000017500000000472312520551104032000 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONNECTIONSUCCESSORCORRECTIONHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONNECTIONSUCCESSORCORRECTIONHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualLinkEdge.h" #include "CProcessContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CConnectionSuccessorCorrectionHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConnectionSuccessorCorrectionHash : public CPROCESSHASH { // public methods public: //! Constructor CConnectionSuccessorCorrectionHash(CProcessContext* context = nullptr); //! Destructor virtual ~CConnectionSuccessorCorrectionHash(); CConnectionSuccessorCorrectionHash* initConnectionSuccessorCorrectionHash(CConnectionSuccessorCorrectionHash* connSuccCorrHash); CConnectionSuccessorCorrectionHash* insertConnectionSuccessor(cint64 indiID); CConnectionSuccessorCorrectionHash* correctSuccessorConnection(cint64 indiID, cint64 correctedID); // protected methods protected: // protected variables protected: CProcessContext* mContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONNECTIONSUCCESSORCORRECTIONHASH_H ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJ0000644000175000017500000000343212520551146032273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathSetJoiningData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathSetJoiningData::CRepresentativeVariableBindingPathSetJoiningData(CProcessContext* processContext) : mJoiningKeyMap(processContext) { mProcessContext = processContext; } CRepresentativeVariableBindingPathSetJoiningData* CRepresentativeVariableBindingPathSetJoiningData::initRepresentativeVariableBindingPathSetJoiningData(CRepresentativeVariableBindingPathSetJoiningData* data) { if (data) { mJoiningKeyMap = data->mJoiningKeyMap; } else { mJoiningKeyMap.clear(); } return this; } CRepresentativeVariableBindingPathSetJoiningKeyMap* CRepresentativeVariableBindingPathSetJoiningData::getJoiningKeyMap() { return &mJoiningKeyMap; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeExtensionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeExtens0000644000175000017500000001424512520551126032427 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualSaturationProcessNodeExtensionData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualSaturationProcessNodeExtensionData::CIndividualSaturationProcessNodeExtensionData(CProcessContext* processContext) : mProcessContext(processContext) { mMemAllocMan = mProcessContext->getMemoryAllocationManager(); } CIndividualSaturationProcessNodeExtensionData* CIndividualSaturationProcessNodeExtensionData::initIndividualExtensionData(CIndividualSaturationProcessNode* indiNode) { mIndiNode = indiNode; mDisComConExtData = nullptr; mLinkedRoleSuccHash = nullptr; mCriticalConceptTypeQueues = nullptr; mSuccessorExtensionData = nullptr; mNominalHandlingData = nullptr; mCriticalPredRoleCardHash = nullptr; mRoleAssertionLinker = nullptr; mAppliedDatatypeData = nullptr; return this; } CSaturationDisjunctCommonConceptExtractionData* CIndividualSaturationProcessNodeExtensionData::getDisjunctCommonConceptExtractionData(bool create) { if (!mDisComConExtData && create) { mDisComConExtData = CObjectParameterizingAllocator< CSaturationDisjunctCommonConceptExtractionData,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mDisComConExtData->initExtractionData(mIndiNode); } return mDisComConExtData; } CLinkedRoleSaturationSuccessorHash* CIndividualSaturationProcessNodeExtensionData::getLinkedRoleSuccessorHash(bool create) { if (create && !mLinkedRoleSuccHash) { mLinkedRoleSuccHash = CObjectParameterizingAllocator< CLinkedRoleSaturationSuccessorHash,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mLinkedRoleSuccHash->initRoleSuccessorHash(); } return mLinkedRoleSuccHash; } CCriticalSaturationConceptTypeQueues* CIndividualSaturationProcessNodeExtensionData::getCriticalConceptTypeQueues(bool create) { if (!mCriticalConceptTypeQueues && create) { mCriticalConceptTypeQueues = CObjectParameterizingAllocator< CCriticalSaturationConceptTypeQueues,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mCriticalConceptTypeQueues->initCriticalSaturationConceptQueues(mIndiNode); } return mCriticalConceptTypeQueues; } CSaturationIndividualNodeSuccessorExtensionData* CIndividualSaturationProcessNodeExtensionData::getSuccessorExtensionData(bool create) { if (!mSuccessorExtensionData && create) { mSuccessorExtensionData = CObjectParameterizingAllocator< CSaturationIndividualNodeSuccessorExtensionData,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mSuccessorExtensionData->initExtensionData(mIndiNode); } return mSuccessorExtensionData; } CSaturationIndividualNodeNominalHandlingData* CIndividualSaturationProcessNodeExtensionData::getNominalHandlingData(bool create) { if (!mNominalHandlingData && create) { mNominalHandlingData = CObjectParameterizingAllocator< CSaturationIndividualNodeNominalHandlingData,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mNominalHandlingData->initNominalHandlingData(mIndiNode); } return mNominalHandlingData; } CCriticalPredecessorRoleCardinalityHash* CIndividualSaturationProcessNodeExtensionData::getCriticalPredecessorRoleCardinalityHash(bool create) { if (!mCriticalPredRoleCardHash && create) { mCriticalPredRoleCardHash = CObjectParameterizingAllocator< CCriticalPredecessorRoleCardinalityHash,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mCriticalPredRoleCardHash->initCriticalPredecessorRoleCardinalityHash(); } return mCriticalPredRoleCardHash; } CSaturationIndividualNodeDatatypeData* CIndividualSaturationProcessNodeExtensionData::getAppliedDatatypeData(bool create) { if (!mAppliedDatatypeData && create) { mAppliedDatatypeData = CObjectParameterizingAllocator< CSaturationIndividualNodeDatatypeData,CProcessContext* >::allocateAndConstructAndParameterize(mMemAllocMan,mProcessContext); mAppliedDatatypeData->initExtensionData(mIndiNode); } return mAppliedDatatypeData; } CSaturationSuccessorRoleAssertionLinker* CIndividualSaturationProcessNodeExtensionData::getRoleAssertionLinker() { return mRoleAssertionLinker; } CIndividualSaturationProcessNodeExtensionData* CIndividualSaturationProcessNodeExtensionData::addRoleAssertionLinker(CSaturationSuccessorRoleAssertionLinker* roleAssertionLinker) { if (roleAssertionLinker) { mRoleAssertionLinker = roleAssertionLinker->append(mRoleAssertionLinker); } return this; } CIndividualSaturationProcessNodeExtensionData* CIndividualSaturationProcessNodeExtensionData::addRoleAssertion(CIndividualSaturationProcessNode* destinationNode, CRole* role, bool roleNegation) { CSaturationSuccessorRoleAssertionLinker* roleAssertionLinker = CObjectAllocator::allocateAndConstruct(mMemAllocMan); roleAssertionLinker->initSaturationSuccessorRoleAssertionLinker(destinationNode,role,roleNegation); addRoleAssertionLinker(roleAssertionLinker); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeDependencyTrackPointCollection.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeDependencyTrackPointCollectio0000644000175000017500000000544712520551110032335 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDEPENDENCYTRACKPOINTCOLLECTION_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDEPENDENCYTRACKPOINTCOLLECTION_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CClashedDependencyDescriptor.h" #include "CDatatypeValueSpaceDependencyCollector.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CDatatypeDependencyTrackPointCollection * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeDependencyTrackPointCollection : public CDatatypeValueSpaceDependencyCollector { // public methods public: //! Constructor CDatatypeDependencyTrackPointCollection(CProcessContext* processContext); CDatatypeDependencyTrackPointCollection* initDependencyTrackPointCollection(CDatatypeDependencyTrackPointCollection* collection); virtual bool addDependency(CDependencyTrackPoint* depTrackPoint); CClashedDependencyDescriptor* getClashedDependencyDescriptors(); bool addCollectionDependencies(CDatatypeValueSpaceDependencyCollector* depCollection); // protected methods protected: CClashedDependencyDescriptor* createClashedDependencyDescriptor(CClashedDependencyDescriptor* appendDepDesLinker, CDependencyTrackPoint* depTrackPoint); // protected variables protected: CProcessContext* mProcessContext; CClashedDependencyDescriptor* mClashDepLinker; CPROCESSSET mDepTrackPointSet; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEDEPENDENCYTRACKPOINTCOLLECTION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBinding.cpp0000644000175000017500000000415312520551162026527 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBinding.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBinding::CVariableBinding() { } CVariableBinding* CVariableBinding::initVariableBinding(CDependencyTrackPoint* dependencyTrackPoint, CIndividualProcessNode* indi, CVariable* variable) { initDependencyTracker(dependencyTrackPoint); mVariable = variable; mIndiNode = indi; return this; } CVariable* CVariableBinding::getBindedVariable() const { return mVariable; } CVariableBinding* CVariableBinding::setBindedVariable(CVariable* variable) { mVariable = variable; return this; } CIndividualProcessNode* CVariableBinding::getBindedIndividual() { return mIndiNode; } CVariableBinding* CVariableBinding::setBindedIndividual(CIndividualProcessNode* indi) { mIndiNode = indi; return this; } bool CVariableBinding::operator<=(const CVariableBinding& beforeData) { return getBindedVariable() <= beforeData.getBindedVariable(); } bool CVariableBinding::operator<=(const CVariableBinding*& beforeData) { return getBindedVariable() <= beforeData->getBindedVariable(); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedIndividualLinkDescriptor.h0000644000175000017500000000445412520551076031415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDINDIVIDUALLINKDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDINDIVIDUALLINKDESCRIPTOR_H // Libraries includes #include // Namespace includes #include "ProcessSettings.h" #include "CIndividualLinkEdge.h" #include "CClashedDependencyDescriptor.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CClashedIndividualLinkDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClashedIndividualLinkDescriptor : public CClashedDependencyDescriptor { // public methods public: //! Constructor CClashedIndividualLinkDescriptor(); CClashedIndividualLinkDescriptor* initClashedLinkDescriptor(CIndividualLinkEdge* linkEdge, CDependencyTrackPoint* depTrackPointD); CIndividualLinkEdge* getIndividualLinkEdge(); // protected methods protected: // protected variables protected: CIndividualLinkEdge* mLinkEdge; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCLASHEDINDIVIDUALLINKDESCRIPTOR_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualConceptBatchProcessingData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualConceptBatchProcessingData.0000644000175000017500000000424412520551120032174 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualConceptBatchProcessingData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualConceptBatchProcessingData::CIndividualConceptBatchProcessingData(CProcessContext* processContext) : mProcessContext(processContext), mIndividualQueue(processContext) { } CIndividualConceptBatchProcessingData* CIndividualConceptBatchProcessingData::initConceptBatchProcessingData(CIndividualConceptBatchProcessingData* prevData) { if (prevData) { mIndividualQueue.initProcessingQueue(&(prevData->mIndividualQueue)); mConcept = prevData->mConcept; } else { mIndividualQueue.initProcessingQueue(nullptr); mConcept = nullptr; } return this; } CIndividualDepthConceptProcessDescriptorProcessingQueue* CIndividualConceptBatchProcessingData::getIndividualQueue() { return &mIndividualQueue; } CConcept* CIndividualConceptBatchProcessingData::getConcept() { return mConcept; } bool CIndividualConceptBatchProcessingData::hasConcept() { return mConcept != nullptr; } CIndividualConceptBatchProcessingData* CIndividualConceptBatchProcessingData::setConcept(CConcept* concept) { mConcept = concept; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptDescriptorDependencyPair.cpp0000644000175000017500000000260512520551076031760 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptDescriptorDependencyPair.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptDescriptorDependencyPair::CConceptDescriptorDependencyPair() { } CConceptDescriptorDependencyPair::CConceptDescriptorDependencyPair(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* dependencyTrackPoint) : QPair(conceptDescriptor,dependencyTrackPoint) { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeIRIValueSpaceData.h0000644000175000017500000000503712520551112030033 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEIRIVALUESPACEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEIRIVALUESPACEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeIRIValueSpaceMap.h" #include "CDatatypeCompareValueSpaceData.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceIRIType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeIRIValueSpaceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeIRIValueSpaceData : public CDatatypeCompareValueSpaceData { // public methods public: //! Constructor CDatatypeIRIValueSpaceData(CProcessContext* processContext); CDatatypeIRIValueSpaceData* copyIRIValueSpaceData(CDatatypeIRIValueSpaceData* spaceData); CDatatypeIRIValueSpaceData* initIRIValueSpaceData(CDatatypeValueSpaceIRIType* valueSpaceType); CDatatypeIRIValueSpaceMap* getIRIValueSpaceMap(bool create); // protected methods protected: virtual CDatatypeCompareValueSpaceMap* createValueSpaceMap(); // protected variables protected: CDatatypeIRIValueSpaceMap* mIRIValueSpaceMap; CDatatypeValueSpaceIRIType* mValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEIRIVALUESPACEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationInfluencedNominalSet.cpp0000644000175000017500000000352412520551154031631 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationInfluencedNominalSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationInfluencedNominalSet::CSaturationInfluencedNominalSet(CProcessContext* processContext) : mProcessContext(processContext) { } CSaturationInfluencedNominalSet* CSaturationInfluencedNominalSet::initInfluencedNominalSet(CSaturationInfluencedNominalSet* nominalSet) { if (nominalSet) { *this = *nominalSet; } else { CPROCESSSET::clear(); } return this; } bool CSaturationInfluencedNominalSet::setNominalInfluenced(cint64 nominalID) { if (!CPROCESSSET::contains(nominalID)) { CPROCESSSET::insert(nominalID); return true; } return false; } bool CSaturationInfluencedNominalSet::isNominalInfluenced(cint64 nominalID) { return CPROCESSSET::contains(nominalID); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningHash.h0000644000175000017500000000466212520551144030303 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRepresentativeJoiningHashData.h" #include "CRepresentativeVariableBindingPathSetData.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { typedef QPair TRepIDPair; /*! * * \class CRepresentativeJoiningHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeJoiningHash : public CPROCESSHASH { // public methods public: //! Constructor CRepresentativeJoiningHash(CProcessContext* context); CRepresentativeJoiningHash* initRepresentativeJoiningHash(CRepresentativeJoiningHash* prevHash); CRepresentativeJoiningData* getRepresentativeJoiningData(CRepresentativeVariableBindingPathSetData* leftRepData, CRepresentativeVariableBindingPathSetData* rightRepData, bool create = true); // protected methods protected: // protected variables protected: CProcessContext* mContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEJOININGHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceMap.h0000644000175000017500000002315312520551114030523 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUESPACEMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUESPACEMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeStringValueData.h" #include "CDatatypeStringValueSpaceMapData.h" #include "CDatatypeStringValueSpaceMapArranger.h" #include "CClashedDependencyDescriptor.h" #include "CDatatypeValueSpaceValuesCounter.h" #include "CDatatypeValueSpaceStringValuesCounter.h" #include "CDatatypeValueSpaceDependencyCollector.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceType.h" #include "Reasoner/Ontology/CDatatypeValueSpaceStringType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeStringValueSpaceMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeStringValueSpaceMap : public CPROCESSMAP { // public methods public: //! Constructor CDatatypeStringValueSpaceMap(CProcessContext* processContext); CDatatypeStringValueSpaceMap* initDatatypeStringValueSpaceMap(CDatatypeStringValueSpaceMap* map); CDatatypeStringValueSpaceMap* initDatatypeStringValueSpaceMap(CDatatypeValueSpaceStringType* valueSpaceType); bool hasExcludedMinimum(CDataLiteralStringValue* value, bool valueInclusively, CDatatypeStringValueExclusionType* exclusionType); bool hasExcludedMaximum(CDataLiteralStringValue* value, bool valueInclusively, CDatatypeStringValueExclusionType* exclusionType); bool isValueExcluded(CDataLiteralStringValue* value, CDatatypeStringValueExclusionType* exclusionType); bool restrictToValue(CDataLiteralStringValue* value, CDependencyTrackPoint* depTrackPoint); bool excludeMinimum(CDataLiteralStringValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint); bool excludeMaximum(CDataLiteralStringValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint); bool excludeMinimum(CDataLiteralStringValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType); bool excludeMaximum(CDataLiteralStringValue* value, bool valueInclusively, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType); bool excludeValue(CDataLiteralStringValue* value, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType = nullptr); bool excludeInterval(CDataLiteralStringValue* leftValue, bool leftValueInclusive, CDataLiteralStringValue* rightValue, bool rightValueInclusive, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType = nullptr); bool excludeAll(CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType = nullptr); bool restrictToWithLanguageTagsValues(CDependencyTrackPoint* depTrackPoint); bool restrictToWithoutLanguageTagsValues(CDependencyTrackPoint* depTrackPoint); bool testValueSpaceReturnClashed(); bool addValueSpaceDependencies(CDatatypeValueSpaceDependencyCollector* depCollector); bool getAbsoluteMinimumValue(CDataLiteralStringValue*& minValue, bool& minValueInclusive, CDependencyTrackPoint** depTrackPoint = nullptr); bool getAbsoluteMaximumValue(CDataLiteralStringValue*& maxValue, bool& maxValueInclusive, CDependencyTrackPoint** depTrackPoint = nullptr); bool countAllValues(CDatatypeValueSpaceValuesCounter* counter); bool countIntervalValues(CDataLiteralStringValue* leftValue, bool leftValueInclusive, CDataLiteralStringValue* rightValue, bool rightValueInclusive, CDatatypeValueSpaceValuesCounter* counter); bool countValueValues(CDataLiteralStringValue* value, CDatatypeValueSpaceValuesCounter* counter); bool addIntervalExclusionDependencies(CDataLiteralStringValue* leftValue, bool leftValueInclusive, CDataLiteralStringValue* rightValue, bool rightValueInclusive, CDatatypeValueSpaceDependencyCollector* depCollector); bool addValueExclusionDependencies(CDataLiteralStringValue* value, CDatatypeValueSpaceDependencyCollector* depCollector); bool getNextPossibleDataValue(CDataLiteralStringValue* nextValue, CDataLiteralStringValue* lastValue); // protected methods protected: bool adaptNewStringValueDataToNeighbours(CDatatypeStringValueData* valueData); CDatatypeStringValueData* getDatatypeStringValueData(CDataLiteralStringValue* value, bool createOrLocalize = false, bool* newValueInsertion = nullptr); CDatatypeStringValueData* getDatatypeStringValueData(CDataLiteralStringValue* value, CDatatypeStringValueSpaceMapData& valueMapData, bool createOrLocalize, bool* newValueInsertion); bool isDataIntervalExcluded(CDatatypeStringValueData* leftValueExcluded, CDatatypeStringValueData* rightValueExcluded, CDatatypeStringValueExclusionType* exclusionType); bool isDataIntervalExcluded(CDataLiteralStringValue* leftValueExcluded, CDatatypeStringValueData* rightValueExcluded, CDatatypeStringValueExclusionType* exclusionType); bool isDataIntervalExcluded(CDatatypeStringValueData* leftValueExcluded, CDataLiteralStringValue* rightValueExcluded, CDatatypeStringValueExclusionType* exclusionType); bool isLeftDataIntervalExcluded(CDatatypeStringValueData* dataValue, CDatatypeStringValueExclusionType* exclusionType); bool isRightDataIntervalExcluded(CDatatypeStringValueData* dataValue, CDatatypeStringValueExclusionType* exclusionType); bool isDataValueExcluded(CDatatypeStringValueData* dataValue, CDatatypeStringValueExclusionType* exclusionType); bool isDataValueExcluded(CDataLiteralStringValue* dataValue, CDatatypeStringValueExclusionType* exclusionType); bool excludeData(CDatatypeStringValueDataExclusion* exlcusionData, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType, bool force); bool excludeDataValue(CDatatypeStringValueData* dataValue, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType, bool force); bool excludeLeftDataInterval(CDatatypeStringValueData* dataValue, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType, bool force); bool excludeRightDataInterval(CDatatypeStringValueData* dataValue, CDependencyTrackPoint* depTrackPoint, CDatatypeStringValueExclusionType* exclusionType, bool force); bool addDataValueExclusionDependencies(CDatatypeStringValueData* dataValue, CDatatypeValueSpaceDependencyCollector* depCollector); bool addDataIntervalExclusionDependencies(CDatatypeStringValueData* leftValueExcluded, CDatatypeStringValueData* rightValueExcluded, CDatatypeValueSpaceDependencyCollector* depCollector); bool addLeftIntervalExclusionDependencies(CDatatypeStringValueData* valueData, CDatatypeValueSpaceDependencyCollector* depCollector); bool addRightIntervalExclusionDependencies(CDatatypeStringValueData* valueData, CDatatypeValueSpaceDependencyCollector* depCollector); bool addExclusionDependencies(CDatatypeStringValueDataExclusion* exclusionData, CDatatypeValueSpaceDependencyCollector* depCollector); bool countDataIntervalValues(CDataLiteralStringValue* leftValueExcluded, CDataLiteralStringValue* rightValueExcluded, CDatatypeStringValueDataExclusion* exlcusionData, CDatatypeValueSpaceValuesCounter* counter); bool countDataIntervalValues(CDatatypeStringValueData* leftValueExcluded, CDatatypeStringValueData* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter); bool countDataIntervalValues(CDataLiteralStringValue* leftValueExcluded, CDatatypeStringValueData* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter); bool countDataIntervalValues(CDatatypeStringValueData* leftValueExcluded, CDataLiteralStringValue* rightValueExcluded, CDatatypeValueSpaceValuesCounter* counter); bool countDataValue(CDataLiteralStringValue* value, CDatatypeStringValueDataExclusion* exlcusionData, CDatatypeValueSpaceValuesCounter* counter); bool countDataValue(CDatatypeStringValueData* dataValue, CDatatypeValueSpaceValuesCounter* counter); // protected variables protected: CProcessContext* mProcessContext; CDatatypeStringValueData* mAbsoluteMinimumExclusionValue; CDatatypeStringValueData* mAbsoluteMaximumExclusionValue; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUESPACEMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedIndividualLinkDescriptor.cpp0000644000175000017500000000307712520551076031750 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClashedIndividualLinkDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CClashedIndividualLinkDescriptor::CClashedIndividualLinkDescriptor() : CClashedDependencyDescriptor() { mLinkEdge = nullptr; } CClashedIndividualLinkDescriptor* CClashedIndividualLinkDescriptor::initClashedLinkDescriptor(CIndividualLinkEdge* linkEdge, CDependencyTrackPoint* depTrackPoint) { initClashedDependencyDescriptor(depTrackPoint); mLinkEdge = linkEdge; return this; } CIndividualLinkEdge* CClashedIndividualLinkDescriptor::getIndividualLinkEdge() { return mLinkEdge; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeRealValueDataExclusion.h0000644000175000017500000000660012520551112031206 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUEDATAEXCLUSION_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUEDATAEXCLUSION_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CDatatypeRealValueExclusionType.h" // Other includes #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CDatatypeRealValueDataExclusion * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeRealValueDataExclusion { // public methods public: //! Constructor CDatatypeRealValueDataExclusion(); CDatatypeRealValueDataExclusion* initDataExclusion(CDatatypeRealValueDataExclusion* value); bool isExcluded(); CDependencyTrackPoint* getExcludedDependencyTrackPoint(); CDatatypeRealValueDataExclusion* setExcluded(bool excluded); CDatatypeRealValueDataExclusion* setExcludedDependencyTrackPoint(CDependencyTrackPoint* depTrackPoint); bool isSomethingExcluded(); bool isEverythingExcluded(); bool areIntegerValuesExcluded(); bool areDecimalValuesExcluded(); bool areRationalValuesExcluded(); bool areRealValuesExcluded(); bool areOnlyIntegerValuesAllowed(); bool isExcluded(CDatatypeRealValueExclusionType* type); CDatatypeRealValueDataExclusion* setExclusion(CDatatypeRealValueExclusionType* type, CDependencyTrackPoint* depTrackPoint); CDependencyTrackPoint* getExclusionDependencyTrackPoint(CDatatypeRealValueExclusionType* type); CDependencyTrackPoint* getPositiveExclusionDependencyTrackPoint(); CDependencyTrackPoint* getNegativeExclusionDependencyTrackPoint(); // protected methods protected: // protected variables protected: CDatatypeRealValueExclusionType::REAL_VALUE_EXCLUSION_TYPE mPosExclusionType; CDatatypeRealValueExclusionType::REAL_VALUE_EXCLUSION_TYPE mNegExclusionType; CDependencyTrackPoint* mPosExclusionDepTrackPoint; CDependencyTrackPoint* mNegExclusionDepTrackPoint; bool mExcluded; CDependencyTrackPoint* mExcludedDepTrackPoint; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUEDATAEXCLUSION_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeUnsatisfiableCacheRetrievalData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeUnsatisfiableCacheRetri0000644000175000017500000000400312520551124032260 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEUNSATISFIABLECACHERETRIEVALDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEUNSATISFIABLECACHERETRIEVALDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualNodeUnsatisfiableCacheRetrievalData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeUnsatisfiableCacheRetrievalData { // public methods public: //! Constructor CIndividualNodeUnsatisfiableCacheRetrievalData(); //! Destructor virtual ~CIndividualNodeUnsatisfiableCacheRetrievalData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEUNSATISFIABLECACHERETRIEVALDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNodeEdge.h0000644000175000017500000000630512520551132024624 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CNODEEDGE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CNODEEDGE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CLocalizationTag.h" #include "CDependencyTracker.h" #include "CProcessContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CNodeEdge * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNodeEdge : public CLocalizationTag, public CDependencyTracker { // public methods public: //! Constructor CNodeEdge(CProcessContext* processContext = nullptr); CNodeEdge* initNodeEdge(CIndividualProcessNode* sourceIndividual, CIndividualProcessNode* destinationIndividual, CDependencyTrackPoint* depTrackPoint); CNodeEdge* initNodeEdge(CNodeEdge* nodeEdge); CIndividualProcessNode* getSourceIndividual(); CIndividualProcessNode* getDestinationIndividual(); cint64 getSourceIndividualID(); cint64 getDestinationIndividualID(); CNodeEdge* setSourceIndividual(CIndividualProcessNode* sourceIndi); CNodeEdge* setDestinationIndividual(CIndividualProcessNode* destinationIndi); CIndividualProcessNode* getOppositeIndividual(CIndividualProcessNode* indi); CIndividualProcessNode* getOppositeIndividual(cint64 indiID); cint64 getOppositeIndividualID(CIndividualProcessNode* indi); cint64 getOppositeIndividualID(cint64 indiID); bool isDestinationIndividual(CIndividualProcessNode* indi); bool isDestinationIndividualID(CIndividualProcessNode* indi); bool isDestinationIndividualID(cint64 indiID); bool isSourceIndividual(CIndividualProcessNode* indi); bool isSourceIndividualID(CIndividualProcessNode* indi); bool isSourceIndividualID(cint64 indiID); cint64 getCoupledIndividualID(); // protected methods protected: // protected variables protected: CIndividualProcessNode* mSourceIndividual; CIndividualProcessNode* mDestinationIndividual; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CNODEEDGE_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandidateData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandid0000644000175000017500000000403112520551160032253 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureBlockingIndividualNodeCandidateData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSignatureBlockingIndividualNodeCandidateData::CSignatureBlockingIndividualNodeCandidateData(CProcessContext* context) : mIndiSet(mContext) { mContext = context; } CSignatureBlockingIndividualNodeCandidateData* CSignatureBlockingIndividualNodeCandidateData::initBlockingCandidateData(CSignatureBlockingIndividualNodeCandidateData* prevBlockCandHash) { if (prevBlockCandHash) { mIndiSet = prevBlockCandHash->mIndiSet; } else { mIndiSet.clear(); } return this; } CSignatureBlockingIndividualNodeCandidateData* CSignatureBlockingIndividualNodeCandidateData::insertBlockingCandidateIndividualNode(CIndividualProcessNode* candidateIndi) { mIndiSet.insert(candidateIndi); return this; } CSignatureBlockingIndividualNodeCandidateIterator CSignatureBlockingIndividualNodeCandidateData::getBlockingCandidatesIndividualNodeIterator() { return CSignatureBlockingIndividualNodeCandidateIterator(&mIndiSet); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathMergingHash.cpp0000644000175000017500000000400412520551164031456 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingPathMergingHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingPathMergingHash::CVariableBindingPathMergingHash(CProcessContext* processContext) : mProcessContext(processContext) { } CVariableBindingPathMergingHash* CVariableBindingPathMergingHash::initVariableBindingPathMergingHash(CVariableBindingPathMergingHash* prevHash) { if (prevHash) { *this = *prevHash; } else { CPROCESSHASH::clear(); } return this; } CVariableBindingPathMergingHashData* CVariableBindingPathMergingHash::getMergedVariableBindingPathData(CVariableBindingPath* varBindPath1, CVariableBindingPath* varBindPath2) { TPathIDPair pathIDPair(qMin(varBindPath1->getPropagationID(),varBindPath2->getPropagationID()),qMax(varBindPath1->getPropagationID(),varBindPath2->getPropagationID())); CVariableBindingPathMergingHashData& data = CPROCESSHASH::operator[](pathIDPair); return &data; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeStatusUpdateLinker.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeStatus0000644000175000017500000000445612520551130032442 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODESTATUSUPDATELINKER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODESTATUSUPDATELINKER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualSaturationProcessNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Utilities/Container/CLinker.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualSaturationProcessNodeStatusUpdateLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualSaturationProcessNodeStatusUpdateLinker : public CLinkerBase { // public methods public: //! Constructor CIndividualSaturationProcessNodeStatusUpdateLinker(); CIndividualSaturationProcessNodeStatusUpdateLinker* initUpdateNodeLinker(CIndividualSaturationProcessNode *individual); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONPROCESSNODESTATUSUPDATELINKER_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeProcessingQueue.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeProcessingQue0000644000175000017500000000630312520551154032406 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationIndividualNodeProcessingQueue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationIndividualNodeProcessingQueue::CSaturationIndividualNodeProcessingQueue(CProcessContext* processContext) : mProcessContext(processContext),mPriorityIndiDesMap(processContext) { } CSaturationIndividualNodeProcessingQueue* CSaturationIndividualNodeProcessingQueue::initProcessingQueue(CSaturationIndividualNodeProcessingQueue* processingQueue) { if (processingQueue) { mPriorityIndiDesMap = processingQueue->mPriorityIndiDesMap; } else { mPriorityIndiDesMap.clear(); } return this; } CIndividualSaturationProcessNode* CSaturationIndividualNodeProcessingQueue::takeNextProcessIndividual() { CIndividualSaturationProcessNode* nextNode = nullptr; if (!mPriorityIndiDesMap.isEmpty()) { CPROCESSMAP::iterator it = mPriorityIndiDesMap.begin(); nextNode = it.value(); it = mPriorityIndiDesMap.erase(it); } return nextNode; } CIndividualSaturationProcessNode* CSaturationIndividualNodeProcessingQueue::getNextProcessIndividual() { CIndividualSaturationProcessNode* nextNode = nullptr; if (!mPriorityIndiDesMap.isEmpty()) { CPROCESSMAP::iterator it = mPriorityIndiDesMap.begin(); nextNode = it.value(); } return nextNode; } CSaturationIndividualNodeProcessingQueue* CSaturationIndividualNodeProcessingQueue::insertProcessIndiviudal(CIndividualSaturationProcessNode* individual) { mPriorityIndiDesMap.insert(-individual->getIndividualID(),individual); return this; } bool CSaturationIndividualNodeProcessingQueue::isEmpty() { return mPriorityIndiDesMap.count() <= 0; } cint64 CSaturationIndividualNodeProcessingQueue::getQueuedIndividualCount() { return mPriorityIndiDesMap.count(); } bool CSaturationIndividualNodeProcessingQueue::hasQueuedIndividuals() { return mPriorityIndiDesMap.count() > 0; } bool CSaturationIndividualNodeProcessingQueue::isIndividualQueued(CIndividualSaturationProcessNode *individual) { return mPriorityIndiDesMap.contains(-individual->getIndividualID()); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationVariableBindingTransitionExtension.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationVariableBindingTransitionE0000644000175000017500000001674512520551140032340 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPropagationVariableBindingTransitionExtension.h" #include "CIndividualProcessNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CPropagationVariableBindingTransitionExtension::CPropagationVariableBindingTransitionExtension(CProcessContext* processContext) { mProcessContext = processContext; } CPropagationVariableBindingTransitionExtension* CPropagationVariableBindingTransitionExtension::initPropagationVariableBindingTransitionExtension(CPropagationVariableBindingTransitionExtension* propVarBindTransExtension) { if (propVarBindTransExtension) { mLastAnalysedPropBindDes = propVarBindTransExtension->mLastAnalysedPropBindDes; mLocVarBindTriggerHash = nullptr; mUseVarBindTriggerHash = propVarBindTransExtension->mUseVarBindTriggerHash; mLocVarBindPathJoiningHash = nullptr; mUseVarBindPathJoiningHash = propVarBindTransExtension->mUseVarBindPathJoiningHash; mTriggeredVarIndPair = propVarBindTransExtension->mTriggeredVarIndPair; mLeftLastVarBindPathJoiningDes = propVarBindTransExtension->mLeftLastVarBindPathJoiningDes; mRightLastVarBindPathJoiningDes = propVarBindTransExtension->mRightLastVarBindPathJoiningDes; mLastAnalysedPropagateAllFlag = propVarBindTransExtension->mLastAnalysedPropagateAllFlag; mProcessingCompleted = propVarBindTransExtension->mProcessingCompleted; } else { mLastAnalysedPropBindDes = nullptr; mUseVarBindTriggerHash = nullptr; mLocVarBindTriggerHash = nullptr; mUseVarBindPathJoiningHash = nullptr; mLocVarBindPathJoiningHash = nullptr; mTriggeredVarIndPair = TVariableIndividualPair(nullptr,0); mLeftLastVarBindPathJoiningDes = nullptr; mRightLastVarBindPathJoiningDes = nullptr; mLastAnalysedPropagateAllFlag = false; mProcessingCompleted = false; } return this; } bool CPropagationVariableBindingTransitionExtension::getLastAnalysedPropagateAllFlag() { return mLastAnalysedPropagateAllFlag; } CPropagationVariableBindingTransitionExtension* CPropagationVariableBindingTransitionExtension::setLastAnalysedPropagateAllFlag(bool propagateAllFlag) { mLastAnalysedPropagateAllFlag = propagateAllFlag; return this; } CPropagationBindingDescriptor* CPropagationVariableBindingTransitionExtension::getLastAnalysedPropagationBindingDescriptor() { return mLastAnalysedPropBindDes; } CPropagationVariableBindingTransitionExtension* CPropagationVariableBindingTransitionExtension::setLastAnalysedPropagationBindingDescriptor(CPropagationBindingDescriptor* lastAnalPropBindDes) { mLastAnalysedPropBindDes = lastAnalPropBindDes; return this; } CVariableBindingTriggerHash* CPropagationVariableBindingTransitionExtension::getVariableBindingTriggerHash(bool localize) { if (localize && !mLocVarBindTriggerHash) { CMemoryAllocationManager* taskMemMan = mProcessContext->getUsedMemoryAllocationManager(); mUseVarBindTriggerHash = mLocVarBindTriggerHash = CObjectParameterizingAllocator< CVariableBindingTriggerHash,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,mProcessContext); } return mUseVarBindTriggerHash; } CVariableBindingPathJoiningHash* CPropagationVariableBindingTransitionExtension::getVariableBindingPathJoiningHash(bool localize) { if (localize && !mLocVarBindPathJoiningHash) { CMemoryAllocationManager* taskMemMan = mProcessContext->getUsedMemoryAllocationManager(); mUseVarBindPathJoiningHash = mLocVarBindPathJoiningHash = CObjectParameterizingAllocator< CVariableBindingPathJoiningHash,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,mProcessContext); } return mUseVarBindPathJoiningHash; } CVariableBindingPathDescriptor* CPropagationVariableBindingTransitionExtension::getLeftLastVariableBindingPathJoiningDescriptor() { return mLeftLastVarBindPathJoiningDes; } CVariableBindingPathDescriptor* CPropagationVariableBindingTransitionExtension::getRightLastVariableBindingPathJoiningDescriptor() { return mRightLastVarBindPathJoiningDes; } bool CPropagationVariableBindingTransitionExtension::addAnalysedPropagationBindingDescriptorReturnMatched(CPropagationBindingDescriptor* propBindDes, CVariableBindingTriggerLinker** reapplyTriggerLinker) { CVariable* variable = propBindDes->getPropagationBinding()->getBindedVariable(); CIndividualProcessNode* indiNode = propBindDes->getPropagationBinding()->getBindedIndividual(); TVariableIndividualPair varIndiPair(variable,indiNode->getIndividualID()); if (mTriggeredVarIndPair == varIndiPair) { return true; } if (mUseVarBindTriggerHash) { CVariableBindingTriggerLinker* triggerLinker = mUseVarBindTriggerHash->setTriggeredReturnTriggerLinker(variable,indiNode); if (triggerLinker) { if (reapplyTriggerLinker) { *reapplyTriggerLinker = triggerLinker; } return true; } } return false; } CPropagationVariableBindingTransitionExtension* CPropagationVariableBindingTransitionExtension::setLeftLastVariableBindingPathJoiningDescriptor(CVariableBindingPathDescriptor* varBindPathDes) { mLeftLastVarBindPathJoiningDes = varBindPathDes; return this; } CPropagationVariableBindingTransitionExtension* CPropagationVariableBindingTransitionExtension::setRightLastVariableBindingPathJoiningDescriptor(CVariableBindingPathDescriptor* varBindPathDes) { mRightLastVarBindPathJoiningDes = varBindPathDes; return this; } CPropagationVariableBindingTransitionExtension* CPropagationVariableBindingTransitionExtension::setTriggeredVariableIndividualPair(const TVariableIndividualPair& triggeredVarIndPair) { mTriggeredVarIndPair = triggeredVarIndPair; return this; } CPropagationVariableBindingTransitionExtension* CPropagationVariableBindingTransitionExtension::setTriggeredVariableIndividualPair(CVariable* variable, CIndividualProcessNode* indiNode) { mTriggeredVarIndPair = TVariableIndividualPair(variable,indiNode->getIndividualID()); return this; } TVariableIndividualPair CPropagationVariableBindingTransitionExtension::getTriggeredVariableIndividualPair() { return mTriggeredVarIndPair; } bool CPropagationVariableBindingTransitionExtension::isProcessingCompleted() { return mProcessingCompleted; } CPropagationVariableBindingTransitionExtension* CPropagationVariableBindingTransitionExtension::setProcessingCompleted(bool completed) { mProcessingCompleted = completed; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinkedCandidateData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinkedCandidate0000644000175000017500000000525412520551074032226 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBlockingIndividualNodeLinkedCandidateData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBlockingIndividualNodeLinkedCandidateData::CBlockingIndividualNodeLinkedCandidateData(CProcessContext* context) : mContext(context) { mMemMan = mContext->getUsedMemoryAllocationManager(); } CBlockingIndividualNodeLinkedCandidateData::~CBlockingIndividualNodeLinkedCandidateData() { } CBlockingIndividualNodeLinkedCandidateData* CBlockingIndividualNodeLinkedCandidateData::initBlockingCandidateData(CBlockingIndividualNodeLinkedCandidateData* prevBlockCandData) { if (prevBlockCandData) { mCandidateCount = prevBlockCandData->mCandidateCount; mCandLinker = prevBlockCandData->mCandLinker; } else { mCandidateCount = 0; mCandLinker = nullptr; } return this; } CBlockingIndividualNodeLinkedCandidateData* CBlockingIndividualNodeLinkedCandidateData::addBlockingCandidateIndividualNode(CIndividualProcessNode* candidateIndi) { CBlockingIndividualNodeLinker* linker = CObjectAllocator::allocateAndConstruct(mMemMan); linker->initBlockingIndividualNodeLinker(candidateIndi); mCandLinker = linker->append(mCandLinker); ++mCandidateCount; return this; } CBlockingIndividualNodeLinker* CBlockingIndividualNodeLinkedCandidateData::getBlockingCandidatesIndividualNodeLinker() { return mCandLinker; } cint64 CBlockingIndividualNodeLinkedCandidateData::getCandidateCount() { return mCandidateCount; } CBlockingIndividualNodeLinkedCandidateData* CBlockingIndividualNodeLinkedCandidateData::setCandidateCount(cint64 candCount) { mCandidateCount = candCount; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeConceptExpansionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeConcep0000644000175000017500000001501112520551160032300 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureBlockingIndividualNodeConceptExpansionData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSignatureBlockingIndividualNodeConceptExpansionData::CSignatureBlockingIndividualNodeConceptExpansionData() { } CSignatureBlockingIndividualNodeConceptExpansionData* CSignatureBlockingIndividualNodeConceptExpansionData::initBlockingExpansionData(CSignatureBlockingIndividualNodeConceptExpansionData* prevData) { if (prevData) { mSubsetTestedConDes = prevData->mSubsetTestedConDes; mBlockingConceptSignature = prevData->mBlockingConceptSignature; mBlockingConceptCount = prevData->mBlockingConceptCount; mExpandedContainedConceptCount = prevData->mExpandedContainedConceptCount; mLastUpdatedConExpCount = prevData->mLastUpdatedConExpCount; blockerIndiNode = prevData->blockerIndiNode; mLastUpdatedConCount = prevData->mLastUpdatedConCount; mReviewMarked = prevData->mReviewMarked; mReviewSubsetMarked = prevData->mReviewSubsetMarked; mIdenticConceptSetRequired = prevData->mIdenticConceptSetRequired; mStillConceptSetSubset = prevData->mStillConceptSetSubset; } else { mSubsetTestedConDes = nullptr; blockerIndiNode = nullptr; mBlockingConceptSignature = 0; mBlockingConceptCount = 0; mExpandedContainedConceptCount = 0; mLastUpdatedConExpCount = 0; mLastUpdatedConCount = 0; mReviewMarked = false; mReviewSubsetMarked = false; mIdenticConceptSetRequired = false; mStillConceptSetSubset = true; } return this; } CConceptDescriptor* CSignatureBlockingIndividualNodeConceptExpansionData::getLastSubsetTestedConceptDescriptor() { return mSubsetTestedConDes; } cint64 CSignatureBlockingIndividualNodeConceptExpansionData::setBlockingConceptSignature() { return mBlockingConceptSignature; } cint64 CSignatureBlockingIndividualNodeConceptExpansionData::getBlockingConceptCount() { return mBlockingConceptCount; } cint64 CSignatureBlockingIndividualNodeConceptExpansionData::getContinuousExpandedContainedConceptCount() { return mExpandedContainedConceptCount; } cint64 CSignatureBlockingIndividualNodeConceptExpansionData::getLastUpdatedConceptExpansionCount() { return mLastUpdatedConExpCount; } cint64 CSignatureBlockingIndividualNodeConceptExpansionData::getLastUpdatedConceptCount() { return mLastUpdatedConCount; } CIndividualProcessNode* CSignatureBlockingIndividualNodeConceptExpansionData::getBlockerIndividualNode() { return blockerIndiNode; } bool CSignatureBlockingIndividualNodeConceptExpansionData::isBlockingReviewMarked() { return mReviewMarked; } bool CSignatureBlockingIndividualNodeConceptExpansionData::isBlockingSubsetReviewMarked() { return mReviewSubsetMarked; } bool CSignatureBlockingIndividualNodeConceptExpansionData::isIdenticConceptSetRequired() { return mIdenticConceptSetRequired; } bool CSignatureBlockingIndividualNodeConceptExpansionData::isConceptSetStillSubset() { return mStillConceptSetSubset; } CSignatureBlockingIndividualNodeConceptExpansionData* CSignatureBlockingIndividualNodeConceptExpansionData::setLastSubsetTestedConceptDescriptor(CConceptDescriptor* conDes) { mSubsetTestedConDes = conDes; return this; } CSignatureBlockingIndividualNodeConceptExpansionData* CSignatureBlockingIndividualNodeConceptExpansionData::setBlockingConceptSignature(cint64 signature) { mBlockingConceptSignature = signature; return this; } CSignatureBlockingIndividualNodeConceptExpansionData* CSignatureBlockingIndividualNodeConceptExpansionData::setBlockingConceptCount(cint64 conCount) { mBlockingConceptCount = conCount; return this; } CSignatureBlockingIndividualNodeConceptExpansionData* CSignatureBlockingIndividualNodeConceptExpansionData::setContinuousExpandedContainedConceptCount(cint64 conCount) { mExpandedContainedConceptCount = conCount; return this; } CSignatureBlockingIndividualNodeConceptExpansionData* CSignatureBlockingIndividualNodeConceptExpansionData::setLastUpdatedConceptExpansionCount(cint64 conCount) { mLastUpdatedConExpCount = conCount; return this; } CSignatureBlockingIndividualNodeConceptExpansionData* CSignatureBlockingIndividualNodeConceptExpansionData::setLastUpdatedConceptCount(cint64 conCount) { mLastUpdatedConCount = conCount; return this; } CSignatureBlockingIndividualNodeConceptExpansionData* CSignatureBlockingIndividualNodeConceptExpansionData::setBlockerIndividualNode(CIndividualProcessNode* node) { blockerIndiNode = node; return this; } CSignatureBlockingIndividualNodeConceptExpansionData* CSignatureBlockingIndividualNodeConceptExpansionData::setBlockingReviewMarked(bool marked) { mReviewMarked = marked; return this; } CSignatureBlockingIndividualNodeConceptExpansionData* CSignatureBlockingIndividualNodeConceptExpansionData::setBlockingSubsetReviewMarked(bool marked) { mReviewSubsetMarked = marked; return this; } CSignatureBlockingIndividualNodeConceptExpansionData* CSignatureBlockingIndividualNodeConceptExpansionData::setIdenticConceptSetRequired(bool identicConceptSetRequired) { mIdenticConceptSetRequired = identicConceptSetRequired; return this; } CSignatureBlockingIndividualNodeConceptExpansionData* CSignatureBlockingIndividualNodeConceptExpansionData::setConceptSetStillSubset(bool stillSubset) { mStillConceptSetSubset = stillSubset; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorIndividualAL0000644000175000017500000000542112520551154032326 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONLINKEDSUCCESSORINDIVIDUALALLCONCEPTSEXTENSIONHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONLINKEDSUCCESSORINDIVIDUALALLCONCEPTSEXTENSIONHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CSaturationLinkedSuccessorIndividualALLConceptsExtensionData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash { // public methods public: //! Constructor CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash(CProcessContext* processContext); CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash* initLinkedSuccessorIndividualALLConceptsExtensionHash(); CPROCESSHASH* getLinkedSuccessorIndividualALLConceptsExtensionHash(); CSaturationLinkedSuccessorIndividualALLConceptsExtensionData* getALLConceptsExtensionData(CIndividualSaturationProcessNode* indiNode, bool create = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CPROCESSHASH mLinkedSuccIndiALLConceptExtHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONLINKEDSUCCESSORINDIVIDUALALLCONCEPTSEXTENSIONHASH_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CLinkProcessingRestrictionSpecification.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CLinkProcessingRestrictionSpecificatio0000644000175000017500000000427212520551132032430 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CLINKPROCESSINGRESTRICTIONSPECIFICATION_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CLINKPROCESSINGRESTRICTIONSPECIFICATION_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessingRestrictionSpecification.h" #include "CIndividualLinkEdge.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CLinkProcessingRestrictionSpecification * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLinkProcessingRestrictionSpecification : public CProcessingRestrictionSpecification { // public methods public: //! Constructor CLinkProcessingRestrictionSpecification(); CLinkProcessingRestrictionSpecification* initLinkRestriction(CIndividualLinkEdge* restLink); CIndividualLinkEdge* getLinkRestriction(); // protected methods protected: // protected variables protected: CIndividualLinkEdge* mRestLink; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CLINKPROCESSINGRESTRICTIONSPECIFICATION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningData.cpp0000644000175000017500000001674612520551164031471 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingPathJoiningData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingPathJoiningData::CVariableBindingPathJoiningData() { } CVariableBindingPathJoiningData* CVariableBindingPathJoiningData::initVariableBindingPathJoiningData(CVariableBindingPathJoiningData* prevJoinData) { if (prevJoinData) { mKeyVarBindDesLinker = prevJoinData->mKeyVarBindDesLinker; mLeftVarBindPathDesLinker = prevJoinData->mLeftVarBindPathDesLinker; mRightVarBindPathDesLinker = prevJoinData->mRightVarBindPathDesLinker; mHashValueCalculated = prevJoinData->mHashValueCalculated; mCalculatedHashValue = prevJoinData->mCalculatedHashValue; mAllKeyTriggersAvailable = prevJoinData->mAllKeyTriggersAvailable; mNextKeyTriggerLinker = prevJoinData->mNextKeyTriggerLinker; } else { mKeyVarBindDesLinker = nullptr; mLeftVarBindPathDesLinker = nullptr; mRightVarBindPathDesLinker = nullptr; mHashValueCalculated = false; mCalculatedHashValue = 0; mAllKeyTriggersAvailable = false; mNextKeyTriggerLinker = nullptr; } return this; } CVariableBindingPathJoiningData* CVariableBindingPathJoiningData::initVariableBindingPathJoiningData(CVariableBindingDescriptor* keyVarBindDesLinker, CVariableBindingPathDescriptor* leftVarBindPathDesLinker, CVariableBindingPathDescriptor* rightVarBindPathDesLinker) { mKeyVarBindDesLinker = keyVarBindDesLinker; mLeftVarBindPathDesLinker = leftVarBindPathDesLinker; mRightVarBindPathDesLinker = rightVarBindPathDesLinker; mHashValueCalculated = false; mCalculatedHashValue = 0; mAllKeyTriggersAvailable = false; mNextKeyTriggerLinker = nullptr; return this; } CVariableBindingDescriptor* CVariableBindingPathJoiningData::getKeyVariableBindingDescriptorLinker() const { return mKeyVarBindDesLinker; } CVariableBindingPathDescriptor* CVariableBindingPathJoiningData::getLeftVariableBindingPathDescriptorLinker() const { return mLeftVarBindPathDesLinker; } CVariableBindingPathDescriptor* CVariableBindingPathJoiningData::getRightVariableBindingPathDescriptorLinker() const { return mRightVarBindPathDesLinker; } CVariableBindingDescriptor* CVariableBindingPathJoiningData::getNextKeyTriggerLinker(bool moveNext) { CVariableBindingDescriptor* nextDesLinker = mNextKeyTriggerLinker; if (moveNext) { mNextKeyTriggerLinker = mNextKeyTriggerLinker->getNext(); } return nextDesLinker; } CVariableBindingPathJoiningData* CVariableBindingPathJoiningData::setKeyVariableBindingDescriptorLinker(CVariableBindingDescriptor* keyVarBindDesLinker) { mKeyVarBindDesLinker = keyVarBindDesLinker; return this; } CVariableBindingPathJoiningData* CVariableBindingPathJoiningData::setLeftVariableBindingPathDescriptorLinker(CVariableBindingPathDescriptor* leftVarBindPathDesLinker) { mLeftVarBindPathDesLinker = leftVarBindPathDesLinker; return this; } CVariableBindingPathJoiningData* CVariableBindingPathJoiningData::setRightVariableBindingPathDescriptorLinker(CVariableBindingPathDescriptor* rightVarBindPathDesLinker) { mRightVarBindPathDesLinker = rightVarBindPathDesLinker; return this; } CVariableBindingPathJoiningData* CVariableBindingPathJoiningData::setNextKeyTriggerLinker(CVariableBindingDescriptor* nextKeyTrigger) { mNextKeyTriggerLinker = nextKeyTrigger; return this; } CVariableBindingPathJoiningData* CVariableBindingPathJoiningData::addKeyVariableBindingDescriptorLinker(CVariableBindingDescriptor* keyVarBindDesLinker) { mKeyVarBindDesLinker = keyVarBindDesLinker->append(mKeyVarBindDesLinker); return this; } CVariableBindingPathJoiningData* CVariableBindingPathJoiningData::addLeftVariableBindingPathDescriptorLinker(CVariableBindingPathDescriptor* leftVarBindPathDesLinker) { mLeftVarBindPathDesLinker = leftVarBindPathDesLinker->append(mLeftVarBindPathDesLinker); return this; } CVariableBindingPathJoiningData* CVariableBindingPathJoiningData::addRightVariableBindingPathDescriptorLinker(CVariableBindingPathDescriptor* rightVarBindPathDesLinker) { mRightVarBindPathDesLinker = rightVarBindPathDesLinker->append(mRightVarBindPathDesLinker); return this; } bool CVariableBindingPathJoiningData::allKeyTriggersAvailable() { return mAllKeyTriggersAvailable; } CVariableBindingPathJoiningData* CVariableBindingPathJoiningData::setAllKeyTriggersAvailable(bool allAvailable) { mAllKeyTriggersAvailable = allAvailable; return this; } cint64 CVariableBindingPathJoiningData::getCalculatedHashValue() const { if (!mHashValueCalculated) { mHashValueCalculated = true; mCalculatedHashValue = 0; cint64 multiplier = 13; for (CVariableBindingDescriptor* linkerIt = mKeyVarBindDesLinker; linkerIt; linkerIt = linkerIt->getNext()) { CVariableBinding* variableBinding = linkerIt->getVariableBinding(); mCalculatedHashValue += multiplier*(cint64)variableBinding; multiplier = multiplier*2+1; } } return mCalculatedHashValue; } bool CVariableBindingPathJoiningData::isKeyEquivalentTo(const CVariableBindingPathJoiningData& data) const { if (getCalculatedHashValue() != data.getCalculatedHashValue()) { return false; } CVariableBindingDescriptor* linkerIt1 = mKeyVarBindDesLinker; CVariableBindingDescriptor* linkerIt2 = data.mKeyVarBindDesLinker; while (linkerIt1 && linkerIt2) { if (linkerIt1->getVariableBinding() != linkerIt2->getVariableBinding()) { return false; } linkerIt1 = linkerIt1->getNext(); linkerIt2 = linkerIt2->getNext(); } if (linkerIt1 || linkerIt2) { return false; } return true; } bool CVariableBindingPathJoiningData::isKeyEquivalentTo(CVariableBindingPath* varBindPath) const { CVariableBindingDescriptor* linkerIt1 = mKeyVarBindDesLinker; CVariableBindingDescriptor* linkerIt2 = varBindPath->getVariableBindingDescriptorLinker(); while (linkerIt2 && linkerIt1) { if (linkerIt2->getVariableBinding()->getBindedVariable() < linkerIt1->getVariableBinding()->getBindedVariable()) { linkerIt2 = linkerIt2->getNext(); } else { if (linkerIt1->getVariableBinding() != linkerIt2->getVariableBinding()) { return false; } linkerIt1 = linkerIt1->getNext(); linkerIt2 = linkerIt2->getNext(); } } if (linkerIt1) { return false; } return true; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyQueueIterator.h0000644000175000017500000000425512520551142027310 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYQUEUEITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYQUEUEITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CReapplyConceptDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CReapplyQueueIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReapplyQueueIterator { // public methods public: //! Constructor CReapplyQueueIterator(); CReapplyQueueIterator(CReapplyConceptDescriptor* staticReapplyDesLinker, CReapplyConceptDescriptor* dynamicReapplyDesLinker); CReapplyConceptDescriptor* next(bool moveNext = true); bool hasNext(); // protected methods protected: // protected variables protected: CReapplyConceptDescriptor* mStaticReapplyDesLinker; CReapplyConceptDescriptor* mDynamicReapplyDesLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREAPPLYQUEUEITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleSuccessorHash.h0000644000175000017500000000643412520551152026556 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CROLESUCCESSORHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CROLESUCCESSORHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualLinkEdge.h" #include "CRoleSuccessorLinkIterator.h" #include "CProcessContext.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRoleSuccessorHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleSuccessorHash { // public methods public: //! Constructor CRoleSuccessorHash(CProcessContext* context = nullptr); //! Destructor virtual ~CRoleSuccessorHash(); CRoleSuccessorHash* initRoleSuccessorHash(CRoleSuccessorHash* prevRoleSuccHash); CRoleSuccessorHash* insertRoleSuccessorLink(CRole* role, CIndividualLinkEdge* link); CRoleSuccessorHash* removeRoleSuccessorLink(CRole* role, CIndividualLinkEdge* link); CRoleSuccessorLinkIterator getRoleSuccessorLinkIterator(CRole* role); // protected methods protected: cint64 getCoupledIndividualID(CIndividualLinkEdge* link); cint64 getCoupledIndividualID(cint64 indi1ID, cint64 indi2ID); // protected variables protected: class CRoleSuccessorData { public: inline CRoleSuccessorData() { mLinkLinker = nullptr; mLocatedLinkSet = false; mLinkSet = nullptr; } inline CRoleSuccessorData(const CRoleSuccessorData& roleSuccData) { if (roleSuccData.mLinkSet) { mLinkLinker = nullptr; mLinkSet = roleSuccData.mLinkSet; } else { mLinkLinker = roleSuccData.mLinkLinker; mLinkSet = nullptr; } mLocatedLinkSet = false; } CPROCESSHASH *mLinkSet; CIndividualLinkEdge* mLinkLinker; bool mLocatedLinkSet; }; CProcessContext* mContext; CPROCESSHASH mRoleSuccessorDataHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CROLESUCCESSORHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalSaturationConceptQueue.h0000644000175000017500000000477412520551106031310 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALSATURATIONCONCEPTQUEUE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALSATURATIONCONCEPTQUEUE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CConceptSaturationProcessLinker.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CCriticalSaturationConceptQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCriticalSaturationConceptQueue { // public methods public: //! Constructor CCriticalSaturationConceptQueue(CProcessContext* context = nullptr); CCriticalSaturationConceptQueue* initCriticalSaturationConceptQueue(CIndividualSaturationProcessNode* indiNode); bool hasCriticalConceptDescriptorLinker(); CConceptSaturationProcessLinker* getCriticalConceptDescriptorLinker(); CConceptSaturationProcessLinker* takeNextCriticalConceptDescriptor(); CCriticalSaturationConceptQueue* addCriticalConceptDescriptorLinker(CConceptSaturationProcessLinker* conDesProcLinker); // protected methods protected: // protected variables protected: CProcessContext* mContext; CConceptSaturationProcessLinker* mCriticalConDesLinker; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCRITICALSATURATIONCONCEPTQUEUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptReapplyHash.cpp0000644000175000017500000000504612520551102027237 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptReapplyHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptReapplyHash::CConceptReapplyHash(CProcessContext* processContext) : CPROCESSHASH,CReapplyQueue>(processContext) { } CConceptReapplyHash::~CConceptReapplyHash() { } CConceptReapplyHash* CConceptReapplyHash::initConceptReapplyHash(CConceptReapplyHash* prevConceptReapplyHash) { if (prevConceptReapplyHash) { *this = *prevConceptReapplyHash; } else { CPROCESSHASH,CReapplyQueue>::clear(); } return this; } CReapplyQueue* CConceptReapplyHash::getConceptReapplyQueue(CConcept *&concept, bool &conceptNegation, bool create) { QPair conNegPair(concept,conceptNegation); if (create) { return &this->operator[](conNegPair); } else { if (contains(conNegPair)) { return &this->operator[](conNegPair); } else { return nullptr; } } } bool CConceptReapplyHash::containsConceptReapplyQueue(CConcept *&concept, bool &conceptNegation) { return contains(QPair(concept,conceptNegation)); } CReapplyQueueIterator CConceptReapplyHash::getConceptReapplyIterator(CConcept *&concept, bool &conceptNegation, bool clearDynamicReapplyQueue) { QPair conNegPair(concept,conceptNegation); CReapplyQueue* reapplyQueue = nullptr; if (tryGetValuePointer(conNegPair,reapplyQueue)) { return reapplyQueue->getIterator(clearDynamicReapplyQueue); } return CReapplyQueueIterator(nullptr,nullptr); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeDatatypeData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeDatatypeData.0000644000175000017500000000406512520551154032245 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationIndividualNodeDatatypeData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationIndividualNodeDatatypeData::CSaturationIndividualNodeDatatypeData(CProcessContext* processContext) { mProcessContext = processContext; } CSaturationIndividualNodeDatatypeData* CSaturationIndividualNodeDatatypeData::initExtensionData(CIndividualSaturationProcessNode* indiProcessNode) { mAppliedDatatype = nullptr; mAppliedDataLiteral = nullptr; return this; } CDataLiteral* CSaturationIndividualNodeDatatypeData::getAppliedDataLiteral() { return mAppliedDataLiteral; } CDatatype* CSaturationIndividualNodeDatatypeData::getAppliedDatatype() { return mAppliedDatatype; } CSaturationIndividualNodeDatatypeData* CSaturationIndividualNodeDatatypeData::setAppliedDataLiteral(CDataLiteral* dataLiteral) { mAppliedDataLiteral = dataLiteral; return this; } CSaturationIndividualNodeDatatypeData* CSaturationIndividualNodeDatatypeData::setAppliedDatatype(CDatatype* datatype) { mAppliedDatatype = datatype; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningCommonKeyData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeJoiningCommonKeyData.cp0000644000175000017500000000370712520551142032263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeJoiningCommonKeyData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeJoiningCommonKeyData::CRepresentativeJoiningCommonKeyData(CRepresentativeVariableBindingPathSetJoiningKeyDataMap* leftJoiningDataMap, CRepresentativeVariableBindingPathSetJoiningKeyDataMap* rightJoiningDataMap) { mLeftJoiningDataMap = leftJoiningDataMap; mRightJoiningDataMap = rightJoiningDataMap; } cint64 CRepresentativeJoiningCommonKeyData::getLeftCount() const { return mLeftJoiningDataMap->count(); } cint64 CRepresentativeJoiningCommonKeyData::getRightCount() const { return mRightJoiningDataMap->count(); } CRepresentativeVariableBindingPathSetJoiningKeyDataMap* CRepresentativeJoiningCommonKeyData::getLeftJoiningDataMap() const { return mLeftJoiningDataMap; } CRepresentativeVariableBindingPathSetJoiningKeyDataMap* CRepresentativeJoiningCommonKeyData::getRightJoiningDataMap() const { return mRightJoiningDataMap; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConnectionSuccessorSet.cpp0000644000175000017500000000630512520551104030151 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConnectionSuccessorSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConnectionSuccessorSet::CConnectionSuccessorSet(CProcessContext* context) : mContext(context) { mAncConnID = -1; mConnSet = nullptr; } CConnectionSuccessorSet::~CConnectionSuccessorSet() { } CConnectionSuccessorSet* CConnectionSuccessorSet::initConnectionSuccessorSet(CConnectionSuccessorSet* connSuccSet) { if (connSuccSet) { mAncConnID = connSuccSet->mAncConnID; if (connSuccSet->mConnSet) { if (!mConnSet) { mConnSet = CObjectParameterizingAllocator< CPROCESSSET,CContext* >::allocateAndConstructAndParameterize(mContext->getUsedMemoryAllocationManager(),mContext); } *mConnSet = *connSuccSet->mConnSet; } } else { mAncConnID = -1; if (mConnSet) { mConnSet->clear(); } } return this; } bool CConnectionSuccessorSet::hasConnectionSuccessor(cint64 indiID) { if (mConnSet) { return mConnSet->contains(indiID); } return mAncConnID == indiID; } CConnectionSuccessorSet* CConnectionSuccessorSet::insertConnectionSuccessor(cint64 indiID) { if (mAncConnID != indiID) { if (mAncConnID >= 0) { if (!mConnSet) { mConnSet = CObjectParameterizingAllocator< CPROCESSSET,CContext* >::allocateAndConstructAndParameterize(mContext->getUsedMemoryAllocationManager(),mContext); mConnSet->insert(mAncConnID); } mConnSet->insert(indiID); } mAncConnID = indiID; } return this; } CConnectionSuccessorSet* CConnectionSuccessorSet::removeConnection(cint64 indiID) { if (mConnSet) { mConnSet->remove(indiID); } else if (mAncConnID == indiID) { mAncConnID = -1; } return this; } CConnectionSuccessorSetIterator CConnectionSuccessorSet::getConnectionSuccessorIterator() { if (mConnSet) { return CConnectionSuccessorSetIterator(mConnSet->begin(),mConnSet->end()); } else { return CConnectionSuccessorSetIterator(mAncConnID); } } cint64 CConnectionSuccessorSet::getConnectionSuccessorCount() { if (!mConnSet) { return 1; } else { return mConnSet->count(); } } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CClashedDependencyDescriptor.cpp0000644000175000017500000000320212520551076031106 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClashedDependencyDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CClashedDependencyDescriptor::CClashedDependencyDescriptor() : CLinkerBase(this) { mDependencyTrackPoint = nullptr; } CClashedDependencyDescriptor::~CClashedDependencyDescriptor() { } CClashedDependencyDescriptor* CClashedDependencyDescriptor::initClashedDependencyDescriptor(CDependencyTrackPoint* depTrackPoint) { mDependencyTrackPoint = depTrackPoint; return this; } CDependencyTrackPoint* CClashedDependencyDescriptor::getDependencyTrackPoint() { return mDependencyTrackPoint; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNodeSwitchHistory.cpp0000644000175000017500000001504512520551132027137 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNodeSwitchHistory.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CNodeSwitchHistory::CNodeSwitchHistory(CProcessContext* processContext) : mContext(processContext) { mDownData = nullptr; mLevelingCount = 5; } CNodeSwitchHistory::~CNodeSwitchHistory() { } CNodeSwitchHistory* CNodeSwitchHistory::initSwitchHistory(CNodeSwitchHistory* prevSwitchHistory) { if (prevSwitchHistory) { CNodeSwitchHistoryLinkData* prevDownData = prevSwitchHistory->mDownData; mDownData = prevDownData; } else { mDownData = nullptr; } return this; } CNodeSwitchHistory* CNodeSwitchHistory::addIndividualProcessNodeSwitch(CIndividualProcessNode* individual, cint64 indiSwitchTag) { cint64 indiAncDepth = individual->getIndividualAncestorDepth(); return addIndividualProcessNodeSwitch(indiAncDepth,individual->getIndividualID(),indiSwitchTag); } CNodeSwitchHistory* CNodeSwitchHistory::updateLastIndividualProcessNodeSwitch(cint64 indiAncDepth, cint64 indiID) { CNodeSwitchHistoryLinkData* data = mDownData; while (data) { data->mNodeAncestorDepth = qMin(data->mNodeAncestorDepth,indiAncDepth); data->mNodeIndividualID = qMin(data->mNodeIndividualID,indiID); data = data->mUpData; } return this; } CNodeSwitchHistory* CNodeSwitchHistory::addIndividualProcessNodeSwitch(cint64 indiAncDepth, cint64 indiID, cint64 indiSwitchTag) { CNodeSwitchHistoryLinkData* newData = CObjectAllocator< CNodeSwitchHistoryLinkData >::allocateAndConstruct(mContext->getUsedMemoryAllocationManager()); newData->mNextData = mDownData; if (mDownData) { newData->mLevelCount = mDownData->mLevelCount; } newData->mNodeSwitchTag = indiSwitchTag; newData->mNodeAncestorDepth = indiAncDepth; newData->mNodeIndividualID = indiID; ++newData->mLevelCount; mDownData = newData; updateUpperData(newData,indiSwitchTag); return this; } CNodeSwitchHistory* CNodeSwitchHistory::updateUpperData(CNodeSwitchHistoryLinkData* data, cint64 indiSwitchTag) { if ((data->mLevelCount % mLevelingCount) == 0) { CNodeSwitchHistoryLinkData* upperData = nullptr; CNodeSwitchHistoryLinkData* tmpData = data; cint64 minAncDepth = std::numeric_limits::max(); cint64 minIndiID = std::numeric_limits::max(); for (cint64 i = 0; i < mLevelingCount; ++i, tmpData = tmpData->mNextData) { minAncDepth = qMin(minAncDepth,tmpData->mNodeAncestorDepth); minIndiID = qMin(minIndiID,tmpData->mNodeIndividualID); } if (tmpData && tmpData->mUpData) { upperData = tmpData->mUpData; } CNodeSwitchHistoryLinkData* newUpperData = CObjectAllocator< CNodeSwitchHistoryLinkData >::allocateAndConstruct(mContext->getUsedMemoryAllocationManager()); if (upperData) { newUpperData->mLevelCount = upperData->mLevelCount; } newUpperData->mNextData = upperData; newUpperData->mNodeSwitchTag = indiSwitchTag; newUpperData->mDownData = data; data->mUpData = newUpperData; ++newUpperData->mLevelCount; newUpperData->mNodeAncestorDepth = minAncDepth; newUpperData->mNodeIndividualID = minIndiID; updateUpperData(newUpperData,indiSwitchTag); } return this; } cint64 CNodeSwitchHistory::getMinIndividualAncestorDepth(cint64 indiSwitchTag) { cint64 minAncDepth,minIndiID; getMinIndividualAncestorDepthAndNodeID(indiSwitchTag,minAncDepth,minIndiID); return minAncDepth; } cint64 CNodeSwitchHistory::getMinIndividualNodeID(cint64 indiSwitchTag) { cint64 minAncDepth,minIndiID; getMinIndividualAncestorDepthAndNodeID(indiSwitchTag,minAncDepth,minIndiID); return minIndiID; } bool CNodeSwitchHistory::getMinIndividualAncestorDepthAndNodeID(cint64 indiSwitchTag, cint64& minAncDepth, cint64& minIndiID) { minAncDepth = std::numeric_limits::max(); minIndiID = std::numeric_limits::max(); CNodeSwitchHistoryLinkData* data = mDownData; // first walk bottom up while (data && data->mNextData) { if (data->mNodeSwitchTag == indiSwitchTag) { return true; } if (data->mNextData->mNodeSwitchTag == indiSwitchTag) { minIndiID = qMin(minIndiID,data->mNodeIndividualID); minAncDepth = qMin(minAncDepth,data->mNodeAncestorDepth); return true; } if (data->mNextData->mNodeSwitchTag < indiSwitchTag) { break; } if (data->mUpData) { data = data->mUpData; } else { minIndiID = qMin(minIndiID,data->mNodeIndividualID); minAncDepth = qMin(minAncDepth,data->mNodeAncestorDepth); data = data->mNextData; } } // second walk top down while (data) { while (data->mNextData && data->mNextData->mNodeSwitchTag > indiSwitchTag) { minIndiID = qMin(minIndiID,data->mNodeIndividualID); minAncDepth = qMin(minAncDepth,data->mNodeAncestorDepth); data = data->mNextData; } if (data->mNextData && data->mNextData->mNodeSwitchTag == indiSwitchTag) { minIndiID = qMin(minIndiID,data->mNodeIndividualID); minAncDepth = qMin(minAncDepth,data->mNodeAncestorDepth); return true; } else { if (data->mDownData) { // go down data = data->mDownData; } else { if (data->mNodeSwitchTag > indiSwitchTag) { minIndiID = qMin(minIndiID,data->mNodeIndividualID); minAncDepth = qMin(minAncDepth,data->mNodeAncestorDepth); } data = data->mNextData; } } } return true; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningHasher.h0000644000175000017500000000533212520551164031464 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHJOININGHASHER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHJOININGHASHER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CVariableBindingPathJoiningData.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CVariableBindingPathJoiningHasher * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingPathJoiningHasher { // public methods public: //! Constructor CVariableBindingPathJoiningHasher(CVariableBindingPathJoiningData* data); CVariableBindingPathJoiningHasher(CVariableBindingPath* varBindPath, CSortedLinker* keyVars); cint64 getHashValue() const; bool operator==(const CVariableBindingPathJoiningHasher& hasher) const; // protected methods protected: cint64 calculateHashValue(CVariableBindingPath* varBindPath, CSortedLinker* keyVars); // protected variables protected: CVariableBindingPathJoiningData* mJoiningData; CVariableBindingPath* mVarBindPath; CSortedLinker* mKeyVars; cint64 mHashValue; // private methods private: // private variables private: }; inline uint qHash(const CVariableBindingPathJoiningHasher& hasher) { qint64 key = (qint64)hasher.getHashValue(); if (sizeof(quint64) > sizeof(uint)) { return uint((key >> (8 * sizeof(uint) - 1)) ^ key); } else { return uint(key); } } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHJOININGHASHER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningHashData.h0000644000175000017500000000417412520551164031732 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHJOININGHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHJOININGHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CVariableBindingPathJoiningData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CVariableBindingPathJoiningHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBindingPathJoiningHashData { // public methods public: //! Constructor CVariableBindingPathJoiningHashData(); CVariableBindingPathJoiningHashData(const CVariableBindingPathJoiningHashData& data); CVariableBindingPathJoiningData* mLocVarBindPathJoiningData; CVariableBindingPathJoiningData* mUseVarBindPathJoiningData; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDINGPATHJOININGHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeXMLValueSpaceMap.h0000644000175000017500000000512712520551116027720 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEXMLVALUESPACEMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEXMLVALUESPACEMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeCompareValueSpaceMap.h" // Other includes #include "Reasoner/Ontology/CDataLiteralXMLValue.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeXMLValueSpaceMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeXMLValueSpaceMap : public CDatatypeCompareValueSpaceMap { // public methods public: //! Constructor CDatatypeXMLValueSpaceMap(CProcessContext* processContext); // protected methods protected: virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); virtual bool representsInfinitelyManyValues(CDataLiteralCompareValue* value); virtual bool getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom); virtual bool getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast); virtual cuint64 getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEXMLVALUESPACEMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeUnknownValueSpaceData.cpp0000644000175000017500000000332412520551116031403 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeUnknownValueSpaceData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeUnknownValueSpaceData::CDatatypeUnknownValueSpaceData(CProcessContext* processContext) : CDatatypeValueSpaceData(processContext),mProcessContext(processContext) { } CDatatypeUnknownValueSpaceData* CDatatypeUnknownValueSpaceData::initUnknownValueSpaceData(CDatatypeValueSpaceUnknownType* valueSpaceType) { CDatatypeValueSpaceData::initValueSpaceData(nullptr); mValueSpaceTriggeringStarted = true; return this; } CDatatypeUnknownValueSpaceData* CDatatypeUnknownValueSpaceData::copyUnknownValueSpaceData(CDatatypeUnknownValueSpaceData* spaceData) { CDatatypeValueSpaceData::initValueSpaceData(spaceData); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyQueueIterator.cpp0000644000175000017500000000407312520551142027641 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReapplyQueueIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CReapplyQueueIterator::CReapplyQueueIterator() { mStaticReapplyDesLinker = nullptr; mDynamicReapplyDesLinker = nullptr; } CReapplyQueueIterator::CReapplyQueueIterator(CReapplyConceptDescriptor* staticReapplyDesLinker, CReapplyConceptDescriptor* dynamicReapplyDesLinker) : mStaticReapplyDesLinker(staticReapplyDesLinker), mDynamicReapplyDesLinker(dynamicReapplyDesLinker) { } CReapplyConceptDescriptor* CReapplyQueueIterator::next(bool moveNext) { CReapplyConceptDescriptor* nextDes = nullptr; if (mDynamicReapplyDesLinker) { nextDes = mDynamicReapplyDesLinker; if (moveNext) { mDynamicReapplyDesLinker = mDynamicReapplyDesLinker->getNext(); } } else if (mStaticReapplyDesLinker) { nextDes = mStaticReapplyDesLinker; if (moveNext) { mStaticReapplyDesLinker = mStaticReapplyDesLinker->getNext(); } } return nextDes; } bool CReapplyQueueIterator::hasNext() { return mDynamicReapplyDesLinker || mStaticReapplyDesLinker; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptSaturationDescriptorReapplyData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptSaturationDescriptorReapplyDat0000644000175000017500000000436112520551102032413 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATURATIONDESCRIPTORREAPPLYDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATURATIONDESCRIPTORREAPPLYDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptSaturationDescriptor.h" #include "CImplicationReapplyConceptSaturationDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConceptSaturationDescriptorReapplyData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptSaturationDescriptorReapplyData { // public methods public: //! Constructor CConceptSaturationDescriptorReapplyData(); CConceptSaturationDescriptorReapplyData(const CConceptSaturationDescriptorReapplyData& data); // public variables public: CConceptSaturationDescriptor* mConSatDes; CImplicationReapplyConceptSaturationDescriptor* mImpReapplyConSatDes; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATURATIONDESCRIPTORREAPPLYDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessTagger.h0000644000175000017500000000552512520551136025731 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSTAGGER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSTAGGER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CProcessTagger * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessTagger { // public methods public: //! Constructor CProcessTagger(); //! Destructor virtual ~CProcessTagger(); CProcessTagger* initProcessTagger(CProcessTagger* processTagger); CProcessTagger* setCurrentLocalizationTag(cint64 locTag); cint64 getCurrentLocalizationTag(); cint64 getCurrentProcessingTag(); cint64 getCurrentProcessingTagAndInc(); cint64 getCurrentBranchingTag(); cint64 getCurrentBlockingAddTag(); cint64 getCurrentNodeSwitchTag(); cint64 getCurrentConceptLabelSetModificationTag(); cint64 getCurrentBlockingFollowTag(); CProcessTagger* incLocalizationTag(); CProcessTagger* incProcessingTag(); CProcessTagger* incBranchingTag(); CProcessTagger* incBlockingAddTag(); CProcessTagger* incNodeSwitchTag(); CProcessTagger* incConceptLabelSetModificationTag(); CProcessTagger* incCurrentBlockingFollowTag(); // protected methods protected: // protected variables protected: cint64 mLocalizationTag; cint64 mBranchingTag; cint64 mProcessingTag; cint64 mBlockingAddTag; cint64 mNodeSwitchTag; cint64 mConceptLabelSetModificationTag; cint64 mCurrentBlockingFollowTag; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSTAGGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptProcessDescriptor.cpp0000644000175000017500000000644212520551100030473 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptProcessDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptProcessDescriptor::CConceptProcessDescriptor(CConceptDescriptor *conceptDescriptor, CConceptProcessPriority processPriority, bool conceptReapplied, CDependencyTrackPoint *dependencyTrackPoint) : CSortedLinkerBase(this) { conceptDes = conceptDescriptor; priority = processPriority; depTrackPoint = dependencyTrackPoint; mReapplied = conceptReapplied; mProcSpec = nullptr; } CConceptProcessDescriptor::CConceptProcessDescriptor() : CSortedLinkerBase(this) { conceptDes = nullptr; depTrackPoint = nullptr; mProcSpec = nullptr; mReapplied = false; priority = 0.; } CConceptProcessDescriptor *CConceptProcessDescriptor::init(CConceptDescriptor *conceptDescriptor, CConceptProcessPriority processPriority, bool conceptReapplied, CDependencyTrackPoint *dependencyTrackPoint, CProcessingRestrictionSpecification* procSpec) { conceptDes = conceptDescriptor; priority = processPriority; depTrackPoint = dependencyTrackPoint; mReapplied = conceptReapplied; mProcSpec = procSpec; return this; } CConceptProcessDescriptor* CConceptProcessDescriptor::initCopy(CConceptProcessDescriptor* conceptProcessDes) { conceptDes = conceptProcessDes->conceptDes; priority = conceptProcessDes->priority; depTrackPoint = conceptProcessDes->depTrackPoint; mReapplied = conceptProcessDes->mReapplied; mProcSpec = conceptProcessDes->mProcSpec; return this; } CConceptDescriptor *CConceptProcessDescriptor::getConceptDescriptor() { return conceptDes; } CConceptProcessPriority CConceptProcessDescriptor::getProcessPriority() { return priority; } CDependencyTrackPoint *CConceptProcessDescriptor::getDependencyTrackPoint() { return depTrackPoint; } bool CConceptProcessDescriptor::isConceptReapplied() { return mReapplied; } CProcessingRestrictionSpecification *CConceptProcessDescriptor::getProcessingRestrictionSpecification() { return mProcSpec; } bool CConceptProcessDescriptor::operator<=(const CConceptProcessDescriptor &descriptor) { return descriptor.priority <= priority; } }; // end namespace Kernel }; // end namespace Process }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalPredecessorRoleCardinalityData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalPredecessorRoleCardinalityDat0000644000175000017500000000227112520551104032311 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCriticalPredecessorRoleCardinalityData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CCriticalPredecessorRoleCardinalityData::CCriticalPredecessorRoleCardinalityData() { mUnproblematicConceptLinker = 0; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingAlternativeData.h0000644000175000017500000000374512520551072027703 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGALTERNATIVEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGALTERNATIVEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CBlockingAlternativeData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBlockingAlternativeData { // public methods public: //! Constructor CBlockingAlternativeData(); enum BLOCKINGALTERNATIVEDATA { BADSIGNATUREBLOCKINGCANDIDATE }; virtual BLOCKINGALTERNATIVEDATA getBlockingAlternativeDataType() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBLOCKINGALTERNATIVEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCondensedReapplyQueueIterator.cpp0000644000175000017500000000616712520551104031470 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCondensedReapplyQueueIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CCondensedReapplyQueueIterator::CCondensedReapplyQueueIterator() { mDynamicPosNegReapplyDesLinker = nullptr; mPosDes = true; mNegDes = true; } CCondensedReapplyQueueIterator::CCondensedReapplyQueueIterator(CCondensedReapplyConceptDescriptor* dynamicReapplyDesLinker, bool positiveDescriptors, bool negativeDescriptors) : mDynamicPosNegReapplyDesLinker(dynamicReapplyDesLinker),mPosDes(positiveDescriptors),mNegDes(negativeDescriptors) { while (mDynamicPosNegReapplyDesLinker && (mDynamicPosNegReapplyDesLinker->isPositiveDescriptor() && mPosDes || !mDynamicPosNegReapplyDesLinker->isPositiveDescriptor() && mNegDes)) { mDynamicPosNegReapplyDesLinker = mDynamicPosNegReapplyDesLinker->getNext(); } } CCondensedReapplyQueueIterator::CCondensedReapplyQueueIterator(CCondensedReapplyConceptDescriptor* dynamicReapplyDesLinker, bool onlyPositiveDescriptors) : mDynamicPosNegReapplyDesLinker(dynamicReapplyDesLinker),mPosDes(onlyPositiveDescriptors == true),mNegDes(onlyPositiveDescriptors == false) { while (mDynamicPosNegReapplyDesLinker && (mDynamicPosNegReapplyDesLinker->isPositiveDescriptor() && mPosDes || !mDynamicPosNegReapplyDesLinker->isPositiveDescriptor() && mNegDes)) { mDynamicPosNegReapplyDesLinker = mDynamicPosNegReapplyDesLinker->getNext(); } } CCondensedReapplyConceptDescriptor* CCondensedReapplyQueueIterator::next(bool moveNext) { CCondensedReapplyConceptDescriptor* nextDes = nullptr; if (mDynamicPosNegReapplyDesLinker) { nextDes = mDynamicPosNegReapplyDesLinker; if (moveNext) { mDynamicPosNegReapplyDesLinker = mDynamicPosNegReapplyDesLinker->getNext(); while (mDynamicPosNegReapplyDesLinker && (mDynamicPosNegReapplyDesLinker->isPositiveDescriptor() && mPosDes || !mDynamicPosNegReapplyDesLinker->isPositiveDescriptor() && mNegDes)) { mDynamicPosNegReapplyDesLinker = mDynamicPosNegReapplyDesLinker->getNext(); } } } return nextDes; } bool CCondensedReapplyQueueIterator::hasNext() { return mDynamicPosNegReapplyDesLinker; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceData.h0000644000175000017500000000511112520551112030264 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUESPACEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUESPACEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeValueSpaceData.h" #include "CDatatypeRealValueSpaceData.h" #include "CDatatypeRealValueSpaceMap.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceRealType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeRealValueSpaceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeRealValueSpaceData : public CDatatypeValueSpaceData { // public methods public: //! Constructor CDatatypeRealValueSpaceData(CProcessContext* processContext); CDatatypeRealValueSpaceData* copyRealValueSpaceData(CDatatypeRealValueSpaceData* spaceData); CDatatypeRealValueSpaceData* initRealValueSpaceData(CDatatypeValueSpaceRealType* valueSpaceType); CDatatypeRealValueSpaceMap* getValueSpaceMap(bool create); bool hasValueSpaceMap(); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CDatatypeRealValueSpaceMap* mValueSpaceMap; CDatatypeValueSpaceRealType* mValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUESPACEDATA_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeHashData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeHashDat0000644000175000017500000000377012520551156032276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONNOMINALDEPENDENTNODEHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONNOMINALDEPENDENTNODEHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CSaturationNominalDependentNodeData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSaturationNominalDependentNodeHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNominalDependentNodeHashData { // public methods public: //! Constructor CSaturationNominalDependentNodeHashData(); CSaturationNominalDependentNodeData* mNominalDependentNodeData; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONNOMINALDEPENDENTNODEHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeBooleanValueSpaceMap.cpp0000644000175000017500000000514112520551106031165 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeBooleanValueSpaceMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeBooleanValueSpaceMap::CDatatypeBooleanValueSpaceMap(CProcessContext* processContext) : CDatatypeCompareValueSpaceMap(processContext) { } bool CDatatypeBooleanValueSpaceMap::representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { return false; } bool CDatatypeBooleanValueSpaceMap::representsInfinitelyManyValues(CDataLiteralCompareValue* value) { return false; } bool CDatatypeBooleanValueSpaceMap::getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom) { CDataLiteralBooleanValue* booleanValueCopyInto = dynamic_cast(valueCopyInto); CDataLiteralBooleanValue* booleanValueCopyFrom = dynamic_cast(valueCopyFrom); booleanValueCopyInto->initValue(booleanValueCopyFrom); return true; } bool CDatatypeBooleanValueSpaceMap::getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast) { CDataLiteralBooleanValue* booleanValueNext = dynamic_cast(valueNext); CDataLiteralBooleanValue* booleanValueLast = dynamic_cast(valueLast); if (booleanValueLast->getBoolean() == false) { booleanValueNext->initValueFromBoolean(true); return true; } return false; } cuint64 CDatatypeBooleanValueSpaceMap::getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { return 0; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeCacheData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeCacheD0000644000175000017500000000223212520551126032261 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualSaturationProcessNodeCacheData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualSaturationProcessNodeCacheData::CIndividualSaturationProcessNodeCacheData() { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeValueSpaceValuesCounter.cpp0000644000175000017500000000572512520551116031760 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceValuesCounter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeValueSpaceValuesCounter::CDatatypeValueSpaceValuesCounter() { initValueCounter((cint64)0); } CDatatypeValueSpaceValuesCounter* CDatatypeValueSpaceValuesCounter::initValueCounter(cint64 valueCount) { mValueCount = valueCount; mInfinite = false; return this; } CDatatypeValueSpaceValuesCounter* CDatatypeValueSpaceValuesCounter::resetValueCounter() { initValueCounter((cint64)0); return this; } CDatatypeValueSpaceValuesCounter* CDatatypeValueSpaceValuesCounter::initValueCounter(CDatatypeValueSpaceValuesCounter* valueCounter) { mValueCount = valueCounter->mValueCount; mInfinite = valueCounter->mInfinite; return this; } bool CDatatypeValueSpaceValuesCounter::incValueCount(cint64 incCount) { if (!mInfinite) { mValueCount += incCount; return true; } return false; } bool CDatatypeValueSpaceValuesCounter::incInfinite() { if (!mInfinite) { mInfinite = true; return true; } return false; } bool CDatatypeValueSpaceValuesCounter::isInfinite() { return mInfinite; } cint64 CDatatypeValueSpaceValuesCounter::getValueCount() { return mValueCount; } CDatatypeValueSpaceValuesCounter::VALUES_COUNTER_TYPE CDatatypeValueSpaceValuesCounter::getCounterType() { return VCT_VALUE_COUNTER; } bool CDatatypeValueSpaceValuesCounter::hasValueAchieved(cint64 value) { if (mInfinite) { return true; } return mValueCount >= value; } bool CDatatypeValueSpaceValuesCounter::combineWithValueCounter(CDatatypeValueSpaceValuesCounter* counter, cint64 additionalDiff) { if (counter->isInfinite()) { return incInfinite(); } else { cint64 otherValueCount = counter->getValueCount() - additionalDiff; if (otherValueCount > 0) { return incValueCount(otherValueCount); } return false; } } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeNominalHandlingData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeNominalHandli0000644000175000017500000000707212520756410032342 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODENOMINALHANDLINGDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODENOMINALHANDLINGDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CSuccessorConnectedNominalSet.h" #include "CConceptSaturationProcessLinker.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationIndividualNodeNominalHandlingData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationIndividualNodeNominalHandlingData { // public methods public: //! Constructor CSaturationIndividualNodeNominalHandlingData(CProcessContext* processContext); CSaturationIndividualNodeNominalHandlingData* initNominalHandlingData(CIndividualSaturationProcessNode* indiProcessNode); CConceptSaturationProcessLinker* getDelayedNominalConceptSaturationProcessLinker(); CConceptSaturationProcessLinker* takeDelayedNominalConceptSaturationProcessLinker(); CSaturationIndividualNodeNominalHandlingData* setDelayedNominalConceptSaturationProcessLinker(CConceptSaturationProcessLinker* conProcessLinker); CSaturationIndividualNodeNominalHandlingData* addDelayedNominalConceptSaturationProcessLinker(CConceptSaturationProcessLinker* conProcessLinker); CSaturationIndividualNodeNominalHandlingData* clearDelayedNominalConceptSaturationProcessLinker(); bool isDelayedNominalIndividualSaturationProcessNodeLinkerQueued(); CIndividualSaturationProcessNodeLinker* getDelayedNominalIndividualSaturationProcessNodeLinker(bool create = true); CSaturationIndividualNodeNominalHandlingData* setDelayedNominalIndividualSaturationProcessNodeLinker(CIndividualSaturationProcessNodeLinker* processNodeLinker); CSuccessorConnectedNominalSet* getSuccessorConnectedNominalSet(bool create = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CIndividualSaturationProcessNode* mIndiProcessNode; CConceptSaturationProcessLinker* mConceptSaturationProcessLinker; CIndividualSaturationProcessNodeLinker* mIndiProcessLinker; CSuccessorConnectedNominalSet* mSuccConnectedNominalSet; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODENOMINALHANDLINGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingDataBox.cpp0000644000175000017500000024506012520551134027071 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessingDataBox.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CProcessingDataBox::CProcessingDataBox(CProcessContext* processContext) : mProcessContext(processContext) { mIndiProcessVector = CObjectParameterizingAllocator< CIndividualProcessNodeVector,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mOntologyTopConcept = nullptr; mOntologyTopDataRangeConcept = nullptr; mSignatureBlockingCandidateHash = nullptr; mUseSignatureBlockingCandidateHash = nullptr; mPrevSignatureBlockingCandidateHash = nullptr; mSignatureNominalDelayingCandidateHash = nullptr; mUseSignatureNominalDelayingCandidateHash = nullptr; mPrevSignatureNominalDelayingCandidateHash = nullptr; mBlockingIndiNodeCandidateHash = nullptr; mUseBlockingIndiNodeCandidateHash = nullptr; mPrevBlockingIndiNodeCandidateHash = nullptr; mBlockingIndiNodeLinkedCandidateHash = nullptr; mUseBlockingIndiNodeLinkedCandidateHash = nullptr; mPrevBlockingIndiNodeLinkedCandidateHash = nullptr; mEarlyIndiReactProQueue = nullptr; mLateIndiReactProQueue = nullptr; mSignatureBlockingReviewSet = nullptr; mReusingReviewSet = nullptr; mUseSignatureBlockingReviewSet = nullptr; mUseEarlyIndiReactProQueue = nullptr; mUseLateIndiReactProQueue = nullptr; mUseReusingReviewSet = nullptr; mPrevSignatureBlockingReviewSet = nullptr; mPrevEarlyIndiReactProQueue = nullptr; mPrevReusingReviewSet = nullptr; mNodeSwitchHistory = nullptr; mUseNodeSwitchHistory = nullptr; mPrevNodeSwitchHistory = nullptr; mBranchingTree = nullptr; mUseBranchingTree = nullptr; mPrevBranchingTree = nullptr; mIndividualNodeCacheTestingLinker = nullptr; mSortedNominalNonDetProcessingNodeLinker = nullptr; mSortedNominalNonDetProcessingNodesSorted = false; mNominalNonDetProcessingCount = 0; mIndividualNodeResolveLinker = nullptr; mBlockableIndividualNodeUpdatedLinker = nullptr; mConstructedIndiNode = nullptr; mLastConDesIndiReapplication = false; mLastProcessingIndiNode = nullptr; mLastProcessingConDes = nullptr; mIndiProcessNodeLinker = nullptr; mIndiSaturationProcessNodeLinker = nullptr; mIndiSaturationCompletionNodeLinker = nullptr; mIndiSaturationAnalysingNodeLinker = nullptr; mNominalDelayedIndiSaturationProcessNodeLinker = nullptr; mDisjunctCommonConceptExtractProcessingLinker = nullptr; mRemConSatProcessLinker = nullptr; mRemSatUpdateLinker = nullptr; mRemSatIndiNodeLinker = nullptr; mRemSatIndiSuccLinkDataLinker = nullptr; mRemConSatDes = nullptr; mRemRoleSatProcessLinker = nullptr; mIndiSaturationProcessVector = nullptr; mSatCriticalIndiNodeProcQueue = nullptr; mSatSuccExtIndNodeProcQueue = nullptr; mSatCriticalIndiNodeConTestSet = nullptr; mSatNominalDependentNodeHash = nullptr; mSatInfluencedNominalSet = nullptr; mIndiDepthFirstProcessQueue = nullptr; mUseIndiDepthFirstProcessQueue = nullptr; mPrevIndiDepthFirstProcessQueue = nullptr; mIndiImmProcessQueue = nullptr; mUseIndiImmProcessQueue = nullptr; mPrevIndiImmProcessQueue = nullptr; mDelayNomProcessQueue = nullptr; mUseDelayNomProcessQueue = nullptr; mPrevDelayNomProcessQueue = nullptr; mCachingLossReactivationProcessQueue = nullptr; mUseCachingLossReactivationProcessQueue = nullptr; mPrevCachingLossReactivationProcessQueue = nullptr; mRoleAssertionProcessQueue = nullptr; mUseRoleAssertionProcessQueue = nullptr; mPrevRoleAssertionProcessQueue = nullptr; mBackendSyncRetestProcessQueue = nullptr; mUseBackendSyncRetestProcessQueue = nullptr; mPrevBackendSyncRetestProcessQueue = nullptr; mConstructedIndiNodeInitialized = false; mMultipleConstructionIndiNodes = false; mMaximumDeterministicBranchTag = 0; mNextIndividualNodeID = 0; mNextSatResSuccExtIndividualNodeID = -1; mNextPropagationID = 1; mNextVariableID = 1; mNextRepVariableID = 1; mLocExtendedConceptVector = nullptr; mUseExtendedConceptVector = nullptr; mUseGroundingHash = nullptr; mLocGroundingHash = nullptr; mLocVarBindingPathMergingHash = nullptr; mUseVarBindingPathMergingHash = nullptr; mLocRepVarBindPathSetHash = nullptr; mUseRepVarBindPathSetHash = nullptr; mLocRepVarBindPathHash = nullptr; mUseRepVarBindPathHash = nullptr; mLocRepVarBindPathJoiningKeyHash = nullptr; mUseRepVarBindPathJoiningKeyHash = nullptr; mLocRepJoiningHash = nullptr; mUseRepJoiningHash = nullptr; mUseIndiProcessQueue = nullptr; mLocIndiProcessQueue = nullptr; mUseNomCachingLossReactHash = nullptr; mLocNomCachingLossReactHash = nullptr; mUseMarkerIndiNodeHash = nullptr; mLocMarkerIndiNodeHash = nullptr; mIndiDepthProcessingQueue = nullptr; mUseIndiDepthProcessingQueue = nullptr; mPrevIndiDepthProcessingQueue = nullptr; mNominalProcessingQueue = nullptr; mUseNominalProcessingQueue = nullptr; mPrevNominalProcessingQueue = nullptr; mIncrementalExansionInitializingProcessingQueue = nullptr; mUseIncrementalExansionInitializingProcessingQueue = nullptr; mPrevIncrementalExansionInitializingProcessingQueue = nullptr; mIncrementalExansionProcessingQueue = nullptr; mUseIncrementalExansionProcessingQueue = nullptr; mPrevIncrementalExansionProcessingQueue = nullptr; mIncrementalCompatibilityCheckingQueue = nullptr; mUseIncrementalCompatibilityCheckingQueue = nullptr; mPrevIncrementalCompatibilityCheckingQueue = nullptr; mIndiDepthDetExpPreProcessingQueue = nullptr; mUseIndiDepthDetExpPreProcessingQueue = nullptr; mPrevIndiDepthDetExpPreProcessingQueue = nullptr; mIndiDepthFirstDetExpPreProcessingQueue = nullptr; mUseIndiDepthFirstDetExpPreProcessingQueue = nullptr; mPrevIndiDepthFirstDetExpPreProcessingQueue = nullptr; mIndiSignatureBlockingUpdateProcessingQueue = nullptr; mUseIndiSignatureBlockingUpdateProcessingQueue = nullptr; mPrevIndiSignatureBlockingUpdateProcessingQueue = nullptr; mIndiBlockedReactivationProcessingQueue = nullptr; mUseIndiBlockedReactivationProcessingQueue = nullptr; mPrevIndiBlockedReactivationProcessingQueue = nullptr; mVarBindConceptBatchProcessQueue = nullptr; mUseVarBindConceptBatchProcessQueue = nullptr; mPrevVarBindConceptBatchProcessQueue = nullptr; mInsufficientNodeOccured = false; mDelayedNominalProcessingOccured = false; mProblematicEQCandidateNodeOccured = false; mIncrementalExpansionInitialized = false; mIncrementalExpansionCompatibleMerged = false; mIncrementalExpansionCachingMerged = false; mClashedDescriptorLinker = nullptr; mValueSpaceTriggeringProcessingQueue = nullptr; mUseValueSpaceTriggeringProcessingQueue = nullptr; mPrevValueSpaceTriggeringProcessingQueue = nullptr; mDistinctValueSpaceSatisfiabilityCheckingQueue = nullptr; mUseDistinctValueSpaceSatisfiabilityCheckingQueue = nullptr; mPrevDistinctValueSpaceSatisfiabilityCheckingQueue = nullptr; mSeparatedSaturationConAssResolveNode = nullptr; mIncrementalExpID = 0; mMaxIncPrevCompGraphNodeID = 0; mNextIncrementalIndiExpID = 1; mNextRoleAssertionCreationID = 1; mReferredIndiTrackVec = nullptr; mIndiDepTrackingRequired = false; } CProcessingDataBox* CProcessingDataBox::initProcessingDataBox(CConcreteOntology* ontology) { mOntology = ontology; mOntologyTopConcept = mOntology->getTBox()->getTopConcept(); mOntologyTopDataRangeConcept = mOntology->getTBox()->getTopDataRangeConcept(); mUseExtendedConceptVector = mOntology->getTBox()->getConceptVector(false); return this; } CProcessingDataBox* CProcessingDataBox::initProcessingDataBox(CProcessingDataBox* processingDataBox) { CIndividualProcessNodeVector* prevIndiProcVec = nullptr; mUseIndiProcessQueue = nullptr; mLocIndiProcessQueue = nullptr; mOntology = nullptr; mIndividualNodeCacheTestingLinker = nullptr; mSortedNominalNonDetProcessingNodeLinker = nullptr; mSortedNominalNonDetProcessingNodesSorted = false; mNominalNonDetProcessingCount = 0; mIndividualNodeResolveLinker = nullptr; mBlockableIndividualNodeUpdatedLinker = nullptr; mLastConDesIndiReapplication = false; mIndiProcessNodeLinker = nullptr; mRemSatUpdateLinker = nullptr; mRemSatIndiNodeLinker = nullptr; mRemSatIndiSuccLinkDataLinker = nullptr; mRemConSatDes = nullptr; mRemRoleSatProcessLinker = nullptr; mIndiSaturationProcessNodeLinker = nullptr; mIndiSaturationCompletionNodeLinker = nullptr; mIndiSaturationAnalysingNodeLinker = nullptr; mNominalDelayedIndiSaturationProcessNodeLinker = nullptr; mDisjunctCommonConceptExtractProcessingLinker = nullptr; mRemConSatProcessLinker = nullptr; mIndiSaturationProcessVector = nullptr; mSatCriticalIndiNodeProcQueue = nullptr; mSatSuccExtIndNodeProcQueue = nullptr; mSatCriticalIndiNodeConTestSet = nullptr; mSatNominalDependentNodeHash = nullptr; mSatInfluencedNominalSet = nullptr; mConstructedIndiNodeInitialized = false; mMultipleConstructionIndiNodes = false; mLocExtendedConceptVector = nullptr; mUseExtendedConceptVector = nullptr; mUseGroundingHash = nullptr; mLocGroundingHash = nullptr; mLocVarBindingPathMergingHash = nullptr; mUseVarBindingPathMergingHash = nullptr; mLocRepVarBindPathSetHash = nullptr; mUseRepVarBindPathSetHash = nullptr; mLocRepVarBindPathHash = nullptr; mUseRepVarBindPathHash = nullptr; mLocRepVarBindPathJoiningKeyHash = nullptr; mUseRepVarBindPathJoiningKeyHash = nullptr; mLocRepJoiningHash = nullptr; mUseRepJoiningHash = nullptr; mLocNomCachingLossReactHash = nullptr; mUseNomCachingLossReactHash = nullptr; mUseMarkerIndiNodeHash = nullptr; mLocMarkerIndiNodeHash = nullptr; mNextIndividualNodeID = 0; mNextSatResSuccExtIndividualNodeID = -1; mNextPropagationID = 1; mNextVariableID = 1; mNextRepVariableID = 1; mInsufficientNodeOccured = false; mDelayedNominalProcessingOccured = false; mProblematicEQCandidateNodeOccured = false; mIncrementalExpansionInitialized = false; mIncrementalExpansionCompatibleMerged = false; mIncrementalExpansionCachingMerged = false; mSeparatedSaturationConAssResolveNode = nullptr; if (processingDataBox) { mUseIndiProcessQueue = processingDataBox->mUseIndiProcessQueue; prevIndiProcVec = processingDataBox->mIndiProcessVector; mOntology = processingDataBox->mOntology; mPrevIndiDepthProcessingQueue = processingDataBox->mUseIndiDepthProcessingQueue; mUseIndiDepthProcessingQueue = mPrevIndiDepthProcessingQueue; mPrevNominalProcessingQueue = processingDataBox->mUseNominalProcessingQueue; mUseNominalProcessingQueue = mPrevNominalProcessingQueue; mPrevIncrementalExansionInitializingProcessingQueue = processingDataBox->mUseIncrementalExansionInitializingProcessingQueue; mUseIncrementalExansionInitializingProcessingQueue = mPrevIncrementalExansionInitializingProcessingQueue; mPrevIncrementalCompatibilityCheckingQueue = processingDataBox->mUseIncrementalCompatibilityCheckingQueue; mUseIncrementalCompatibilityCheckingQueue = mPrevIncrementalCompatibilityCheckingQueue; mPrevIndiDepthDetExpPreProcessingQueue = processingDataBox->mUseIndiDepthDetExpPreProcessingQueue; mUseIndiDepthDetExpPreProcessingQueue = mPrevIndiDepthDetExpPreProcessingQueue; mPrevIndiDepthFirstDetExpPreProcessingQueue = processingDataBox->mUseIndiDepthFirstDetExpPreProcessingQueue; mUseIndiDepthFirstDetExpPreProcessingQueue = mPrevIndiDepthFirstDetExpPreProcessingQueue; mPrevIndiSignatureBlockingUpdateProcessingQueue = processingDataBox->mUseIndiBlockedReactivationProcessingQueue; mUseIndiBlockedReactivationProcessingQueue = mPrevIndiSignatureBlockingUpdateProcessingQueue; mPrevVarBindConceptBatchProcessQueue = processingDataBox->mUseVarBindConceptBatchProcessQueue; mUseVarBindConceptBatchProcessQueue = mPrevVarBindConceptBatchProcessQueue; mPrevIndiBlockedReactivationProcessingQueue = processingDataBox->mUseIndiSignatureBlockingUpdateProcessingQueue; mUseIndiSignatureBlockingUpdateProcessingQueue = mPrevIndiBlockedReactivationProcessingQueue; mPrevValueSpaceTriggeringProcessingQueue = processingDataBox->mUseValueSpaceTriggeringProcessingQueue; mUseValueSpaceTriggeringProcessingQueue = mPrevValueSpaceTriggeringProcessingQueue; mPrevDistinctValueSpaceSatisfiabilityCheckingQueue = processingDataBox->mUseDistinctValueSpaceSatisfiabilityCheckingQueue; mUseDistinctValueSpaceSatisfiabilityCheckingQueue = mPrevDistinctValueSpaceSatisfiabilityCheckingQueue; mPrevSignatureBlockingCandidateHash = processingDataBox->mUseSignatureBlockingCandidateHash; mUseSignatureBlockingCandidateHash = mPrevSignatureBlockingCandidateHash; mPrevSignatureNominalDelayingCandidateHash = processingDataBox->mUseSignatureNominalDelayingCandidateHash; mUseSignatureNominalDelayingCandidateHash = mPrevSignatureNominalDelayingCandidateHash; mPrevBlockingIndiNodeCandidateHash = processingDataBox->mUseBlockingIndiNodeCandidateHash; mUseBlockingIndiNodeCandidateHash = mPrevBlockingIndiNodeCandidateHash; mPrevBlockingIndiNodeLinkedCandidateHash = processingDataBox->mUseBlockingIndiNodeLinkedCandidateHash; mUseBlockingIndiNodeLinkedCandidateHash = mPrevBlockingIndiNodeLinkedCandidateHash; mPrevSignatureBlockingReviewSet = processingDataBox->mUseSignatureBlockingReviewSet; mUseSignatureBlockingReviewSet = mPrevSignatureBlockingReviewSet; mPrevEarlyIndiReactProQueue = processingDataBox->mUseEarlyIndiReactProQueue; mUseEarlyIndiReactProQueue = mPrevEarlyIndiReactProQueue; mPrevLateIndiReactProQueue = processingDataBox->mUseLateIndiReactProQueue; mUseLateIndiReactProQueue = mPrevLateIndiReactProQueue; mPrevReusingReviewSet = processingDataBox->mUseReusingReviewSet; mUseReusingReviewSet = mPrevReusingReviewSet; mPrevNodeSwitchHistory = processingDataBox->mUseNodeSwitchHistory; mUseNodeSwitchHistory = mPrevNodeSwitchHistory; mPrevIndiDepthFirstProcessQueue = processingDataBox->mUseIndiDepthFirstProcessQueue; mUseIndiDepthFirstProcessQueue = mPrevIndiDepthFirstProcessQueue; mPrevIndiImmProcessQueue = processingDataBox->mUseIndiImmProcessQueue; mUseIndiImmProcessQueue = mPrevIndiImmProcessQueue; mPrevDelayNomProcessQueue = processingDataBox->mUseDelayNomProcessQueue; mUseDelayNomProcessQueue = mPrevDelayNomProcessQueue; mPrevCachingLossReactivationProcessQueue = processingDataBox->mUseCachingLossReactivationProcessQueue; mUseCachingLossReactivationProcessQueue = mPrevCachingLossReactivationProcessQueue; mPrevRoleAssertionProcessQueue = processingDataBox->mUseRoleAssertionProcessQueue; mUseRoleAssertionProcessQueue = mPrevRoleAssertionProcessQueue; mPrevBackendSyncRetestProcessQueue = processingDataBox->mUseBackendSyncRetestProcessQueue; mUseBackendSyncRetestProcessQueue = mPrevBackendSyncRetestProcessQueue; mPrevBranchingTree = processingDataBox->mUseBranchingTree; mUseBranchingTree = mPrevBranchingTree; mOntologyTopConcept = processingDataBox->mOntologyTopConcept; mOntologyTopDataRangeConcept = processingDataBox->mOntologyTopDataRangeConcept; mIndividualNodeCacheTestingLinker = processingDataBox->mIndividualNodeCacheTestingLinker; mSortedNominalNonDetProcessingNodeLinker = processingDataBox->mSortedNominalNonDetProcessingNodeLinker; mSortedNominalNonDetProcessingNodesSorted = processingDataBox->mSortedNominalNonDetProcessingNodesSorted; mNominalNonDetProcessingCount = processingDataBox->mNominalNonDetProcessingCount; mIndividualNodeResolveLinker = processingDataBox->mIndividualNodeResolveLinker; mBlockableIndividualNodeUpdatedLinker = processingDataBox->mBlockableIndividualNodeUpdatedLinker; mConstructedIndiNode = processingDataBox->mConstructedIndiNode; mLastProcessingIndiNode = processingDataBox->mLastProcessingIndiNode; mLastProcessingConDes = processingDataBox->mLastProcessingConDes; mIndiProcessNodeLinker = processingDataBox->mIndiProcessNodeLinker; mMultipleConstructionIndiNodes = processingDataBox->mMultipleConstructionIndiNodes; mConstructedIndiNodeInitialized = processingDataBox->mConstructedIndiNodeInitialized; mMaximumDeterministicBranchTag = processingDataBox->mMaximumDeterministicBranchTag; mNextPropagationID = processingDataBox->mNextPropagationID; mNextIndividualNodeID = processingDataBox->mNextIndividualNodeID; mNextSatResSuccExtIndividualNodeID = processingDataBox->mNextSatResSuccExtIndividualNodeID; mNextVariableID = processingDataBox->mNextVariableID; mNextRepVariableID = processingDataBox->mNextRepVariableID; mUseExtendedConceptVector = processingDataBox->mUseExtendedConceptVector; mUseGroundingHash = processingDataBox->mUseGroundingHash; mUseVarBindingPathMergingHash = processingDataBox->mUseVarBindingPathMergingHash; mUseRepVarBindPathSetHash = processingDataBox->mUseRepVarBindPathSetHash; mUseRepVarBindPathHash = processingDataBox->mUseRepVarBindPathHash; mUseRepVarBindPathJoiningKeyHash = processingDataBox->mUseRepVarBindPathJoiningKeyHash; mUseRepJoiningHash = processingDataBox->mUseRepJoiningHash; mInsufficientNodeOccured = processingDataBox->mInsufficientNodeOccured; mDelayedNominalProcessingOccured = processingDataBox->mDelayedNominalProcessingOccured; mProblematicEQCandidateNodeOccured = processingDataBox->mProblematicEQCandidateNodeOccured; mUseNomCachingLossReactHash = processingDataBox->mUseNomCachingLossReactHash; mUseMarkerIndiNodeHash = processingDataBox->mUseMarkerIndiNodeHash; mIncrementalExpansionInitialized = processingDataBox->mIncrementalExpansionInitialized; mNextIncrementalIndiExpID = processingDataBox->mNextIncrementalIndiExpID; mNextRoleAssertionCreationID = processingDataBox->mNextRoleAssertionCreationID; mIncrementalExpID = processingDataBox->mIncrementalExpID; mMaxIncPrevCompGraphNodeID = processingDataBox->mMaxIncPrevCompGraphNodeID; mIncrementalExpansionCompatibleMerged = processingDataBox->mIncrementalExpansionCompatibleMerged; mIncrementalExpansionCachingMerged = processingDataBox->mIncrementalExpansionCachingMerged; mReferredIndiTrackVec = processingDataBox->mReferredIndiTrackVec; mIndiDepTrackingRequired = processingDataBox->mIndiDepTrackingRequired; mIndiSaturationProcessNodeLinker = processingDataBox->mIndiSaturationProcessNodeLinker; mIndiSaturationCompletionNodeLinker = processingDataBox->mIndiSaturationCompletionNodeLinker; mIndiSaturationAnalysingNodeLinker = processingDataBox->mIndiSaturationAnalysingNodeLinker; mDisjunctCommonConceptExtractProcessingLinker = processingDataBox->mDisjunctCommonConceptExtractProcessingLinker; mNominalDelayedIndiSaturationProcessNodeLinker = processingDataBox->mNominalDelayedIndiSaturationProcessNodeLinker; if (processingDataBox->mIndiSaturationProcessVector) { getIndividualSaturationProcessNodeVector(true)->referenceVector(processingDataBox->mIndiSaturationProcessVector); } if (processingDataBox->mSatInfluencedNominalSet) { getSaturationInfluencedNominalSet(true)->initInfluencedNominalSet(processingDataBox->mSatInfluencedNominalSet); } if (processingDataBox->mSatNominalDependentNodeHash) { getSaturationNominalDependentNodeHash(true)->initNominalDependentNodeHash(processingDataBox->mSatNominalDependentNodeHash); } if (processingDataBox->mSatCriticalIndiNodeConTestSet) { getSaturationCriticalIndividualNodeConceptTestSet(true)->initIndividualNodeConceptTestSet(processingDataBox->mSatCriticalIndiNodeConTestSet); } if (processingDataBox->mSatSuccExtIndNodeProcQueue) { getSaturationSucessorExtensionIndividualNodeProcessingQueue(true)->initProcessingQueue(processingDataBox->mSatSuccExtIndNodeProcQueue); } if (processingDataBox->mSatCriticalIndiNodeProcQueue) { getSaturationCriticalIndividualNodeProcessingQueue(true)->initProcessingQueue(processingDataBox->mSatCriticalIndiNodeProcQueue); } } mIndiProcessVector->referenceVector(prevIndiProcVec); return this; } bool CProcessingDataBox::hasClashedDescriptorLinker() { return mClashedDescriptorLinker != nullptr; } CClashedDependencyDescriptor* CProcessingDataBox::getClashedDescriptorLinker() { return mClashedDescriptorLinker; } CProcessingDataBox* CProcessingDataBox::setClashedDescriptorLinker(CClashedDependencyDescriptor* clashDesLinker) { mClashedDescriptorLinker = clashDesLinker; return this; } CProcessingDataBox* CProcessingDataBox::clearIndividualProcessingQueues() { clearRoleAssertionProcessingQueue(); clearDelayingNominalProcessingQueue(); clearIndividualDepthFirstProcessingQueue(); clearIndividualImmediatelyProcessingQueue(); clearVariableBindingConceptBatchProcessingQueue(); clearIndividualDepthProcessingQueue(); clearNominalProcessingQueue(); clearIndividualDepthDeterministicExpansionPreprocessingQueue(); clearIndividualDepthFirstDeterministicExpansionProcessingQueue(); clearBlockingUpdateReviewProcessingQueue(); clearBlockedReactivationProcessingQueue(); clearEarlyIndividualReactivationProcessingQueue(); clearReusingReviewData(); clearBlockedResolveIndividualNodes(); clearSortedNominalNonDeterministicProcessingNodeLinker(); clearValueSpaceTriggeringProcessingQueue(); clearDistinctValueSpaceSatisfiabilityCheckingQueue(); clearRoleAssertionProcessingQueue(); clearIncrementalExpansionInitializingProcessingQueue(); clearIncrementalCompatibilityCheckingQueue(); clearIncrementalExpansionIProcessingQueue(); clearBackendCacheSynchronizationProcessingQueue(); return this; } CConceptVector* CProcessingDataBox::getExtendedConceptVector(bool forceLocalisation) { if (forceLocalisation && !mLocExtendedConceptVector) { mLocExtendedConceptVector = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mProcessContext),mProcessContext); mLocExtendedConceptVector->referenceVector(mUseExtendedConceptVector); mUseExtendedConceptVector = mLocExtendedConceptVector; } return mUseExtendedConceptVector; } CConceptNominalSchemaGroundingHash* CProcessingDataBox::getConceptNominalSchemaGroundingHash(bool forceLocalisation) { if (forceLocalisation && !mLocGroundingHash) { mLocGroundingHash = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mProcessContext),mProcessContext); mLocGroundingHash->initConceptNominalSchemaGroundingHash(mUseGroundingHash); mUseGroundingHash = mLocGroundingHash; } return mUseGroundingHash; } CVariableBindingPathMergingHash* CProcessingDataBox::getVariableBindingPathMergingHash(bool forceLocalisation) { if (forceLocalisation && !mLocVarBindingPathMergingHash) { mLocVarBindingPathMergingHash = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mProcessContext),mProcessContext); mLocVarBindingPathMergingHash->initVariableBindingPathMergingHash(mUseVarBindingPathMergingHash); mUseVarBindingPathMergingHash = mLocVarBindingPathMergingHash; } return mUseVarBindingPathMergingHash; } CRepresentativeVariableBindingPathSetHash* CProcessingDataBox::getRepresentativeVariableBindingPathSetHash(bool forceLocalisation) { if (forceLocalisation && !mLocRepVarBindPathSetHash) { mLocRepVarBindPathSetHash = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mProcessContext),mProcessContext); mLocRepVarBindPathSetHash->initRepresentativeVariableBindingPathSetHash(mUseRepVarBindPathSetHash); mUseRepVarBindPathSetHash = mLocRepVarBindPathSetHash; } return mUseRepVarBindPathSetHash; } CRepresentativeVariableBindingPathHash* CProcessingDataBox::getRepresentativeVariableBindingPathHash(bool forceLocalisation) { if (forceLocalisation && !mLocRepVarBindPathHash) { mLocRepVarBindPathHash = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mProcessContext),mProcessContext); mLocRepVarBindPathHash->initRepresentativeVariableBindingPathHash(mUseRepVarBindPathHash); mUseRepVarBindPathHash = mLocRepVarBindPathHash; } return mUseRepVarBindPathHash; } CRepresentativeVariableBindingPathJoiningKeyHash* CProcessingDataBox::getRepresentativeVariableBindingPathJoiningKeyHash(bool forceLocalisation) { if (forceLocalisation && !mLocRepVarBindPathJoiningKeyHash) { mLocRepVarBindPathJoiningKeyHash = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mProcessContext),mProcessContext); mLocRepVarBindPathJoiningKeyHash->initRepresentativeVariableBindingPathJoiningKeyHash(mUseRepVarBindPathJoiningKeyHash); mUseRepVarBindPathJoiningKeyHash = mLocRepVarBindPathJoiningKeyHash; } return mUseRepVarBindPathJoiningKeyHash; } CRepresentativeJoiningHash* CProcessingDataBox::getRepresentativeJoiningHash(bool forceLocalisation) { if (forceLocalisation && !mLocRepJoiningHash) { mLocRepJoiningHash = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mProcessContext),mProcessContext); mLocRepJoiningHash->initRepresentativeJoiningHash(mUseRepJoiningHash); mUseRepJoiningHash = mLocRepJoiningHash; } return mUseRepJoiningHash; } CNominalCachingLossReactivationHash* CProcessingDataBox::getNominalCachingLossReactivationHash(bool createOrForceLocalisation) { if (createOrForceLocalisation && !mLocNomCachingLossReactHash) { mLocNomCachingLossReactHash = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mProcessContext),mProcessContext); mLocNomCachingLossReactHash->initNominalDependentNodeHash(mUseNomCachingLossReactHash); mUseNomCachingLossReactHash = mLocNomCachingLossReactHash; } return mUseNomCachingLossReactHash; } CMarkerIndividualNodeHash* CProcessingDataBox::getMarkerIndividualNodeHash(bool createOrForceLocalisation) { if (createOrForceLocalisation && !mLocMarkerIndiNodeHash) { mLocMarkerIndiNodeHash = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mProcessContext),mProcessContext); mLocMarkerIndiNodeHash->initMarkerIndividualNodeHash(mUseMarkerIndiNodeHash); mUseMarkerIndiNodeHash = mLocMarkerIndiNodeHash; } return mUseMarkerIndiNodeHash; } cint64 CProcessingDataBox::getNextSaturationResolvedSuccessorExtensionIndividualNodeID(bool incremetNextID) { if (mNextSatResSuccExtIndividualNodeID == -1) { mNextSatResSuccExtIndividualNodeID = mIndiSaturationProcessVector->getItemCount(); } cint64 nextPropID = mNextSatResSuccExtIndividualNodeID; if (incremetNextID) { ++mNextSatResSuccExtIndividualNodeID; } return nextPropID; } cint64 CProcessingDataBox::getNextIndividualNodeID(bool incremetNextID) { cint64 nextPropID = mNextIndividualNodeID; if (incremetNextID) { ++mNextIndividualNodeID; } return nextPropID; } CProcessingDataBox* CProcessingDataBox::setFirstPossibleIndividualNodeID(cint64 indiID) { mNextIndividualNodeID = indiID; return this; } cint64 CProcessingDataBox::getNextBindingPropagationID(bool incremetNextID) { cint64 nextPropID = mNextPropagationID; if (incremetNextID) { ++mNextPropagationID; } return nextPropID; } cint64 CProcessingDataBox::getNextVariableBindingPathID(bool incremetNextID) { cint64 nextPropID = mNextVariableID; if (incremetNextID) { ++mNextVariableID; } return nextPropID; } cint64 CProcessingDataBox::getNextRepresentativeVariableBindingPathID(bool incremetNextID) { cint64 nextPropID = mNextRepVariableID; if (incremetNextID) { ++mNextRepVariableID; } return nextPropID; } CIndividualProcessingQueue* CProcessingDataBox::getIndividualProcessingQueue(bool create) { if (!mLocIndiProcessQueue) { mLocIndiProcessQueue = CObjectParameterizingAllocator< CIndividualProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mLocIndiProcessQueue->initProcessingQueue(mUseIndiProcessQueue); mUseIndiProcessQueue = mLocIndiProcessQueue; } return mUseIndiProcessQueue; } CProcessingDataBox* CProcessingDataBox::clearIndividualProcessingQueue() { mUseIndiProcessQueue = nullptr; mLocIndiProcessQueue = nullptr; return this; } CIndividualProcessNodeVector* CProcessingDataBox::getIndividualProcessNodeVector() { return mIndiProcessVector; } CProcessingDataBox* CProcessingDataBox::setIndividualProcessNodeVector(CIndividualProcessNodeVector* indiNodeVec) { mIndiProcessVector = indiNodeVec; return this; } CConcept* CProcessingDataBox::getOntologyTopConcept() { return mOntologyTopConcept; } CConcept* CProcessingDataBox::getOntologyTopDataRangeConcept() { return mOntologyTopDataRangeConcept; } CConcreteOntology* CProcessingDataBox::getOntology() { return mOntology; } CIndividualUnsortedProcessingQueue* CProcessingDataBox::getIndividualDepthFirstProcessingQueue(bool create) { if (!mIndiDepthFirstProcessQueue && create) { mIndiDepthFirstProcessQueue = CObjectParameterizingAllocator< CIndividualUnsortedProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mIndiDepthFirstProcessQueue->initProcessingQueue(mPrevIndiDepthFirstProcessQueue); mUseIndiDepthFirstProcessQueue = mIndiDepthFirstProcessQueue; } return mUseIndiDepthFirstProcessQueue; } CProcessingDataBox* CProcessingDataBox::clearIndividualDepthFirstProcessingQueue() { mIndiDepthFirstProcessQueue = nullptr; mUseIndiDepthFirstProcessQueue = nullptr; mPrevIndiDepthFirstProcessQueue = nullptr; return this; } CIndividualUnsortedProcessingQueue* CProcessingDataBox::getIndividualImmediatelyProcessingQueue(bool create) { if (!mIndiImmProcessQueue && create) { mIndiImmProcessQueue = CObjectParameterizingAllocator< CIndividualUnsortedProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mIndiImmProcessQueue->initProcessingQueue(mPrevIndiImmProcessQueue); mUseIndiImmProcessQueue = mIndiImmProcessQueue; } return mUseIndiImmProcessQueue; } CProcessingDataBox* CProcessingDataBox::clearIndividualImmediatelyProcessingQueue() { mIndiImmProcessQueue = nullptr; mUseIndiImmProcessQueue = nullptr; mPrevIndiImmProcessQueue = nullptr; return this; } CIndividualUnsortedProcessingQueue* CProcessingDataBox::getRoleAssertionProcessingQueue(bool create) { if (!mRoleAssertionProcessQueue && create) { mRoleAssertionProcessQueue = CObjectParameterizingAllocator< CIndividualUnsortedProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mRoleAssertionProcessQueue->initProcessingQueue(mPrevRoleAssertionProcessQueue); mUseRoleAssertionProcessQueue = mRoleAssertionProcessQueue; } return mUseRoleAssertionProcessQueue; } CProcessingDataBox* CProcessingDataBox::clearRoleAssertionProcessingQueue() { mRoleAssertionProcessQueue = nullptr; mUseRoleAssertionProcessQueue = nullptr; mPrevRoleAssertionProcessQueue = nullptr; return this; } CIndividualUnsortedProcessingQueue* CProcessingDataBox::getBackendCacheSynchronizationProcessingQueue(bool create) { if (!mBackendSyncRetestProcessQueue && create) { mBackendSyncRetestProcessQueue = CObjectParameterizingAllocator< CIndividualUnsortedProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mBackendSyncRetestProcessQueue->initProcessingQueue(mPrevBackendSyncRetestProcessQueue); mUseBackendSyncRetestProcessQueue = mBackendSyncRetestProcessQueue; } return mUseBackendSyncRetestProcessQueue; } CProcessingDataBox* CProcessingDataBox::clearBackendCacheSynchronizationProcessingQueue() { mBackendSyncRetestProcessQueue = nullptr; mUseBackendSyncRetestProcessQueue = nullptr; mPrevBackendSyncRetestProcessQueue = nullptr; return this; } CIndividualUnsortedProcessingQueue* CProcessingDataBox::getDelayingNominalProcessingQueue(bool create) { if (!mDelayNomProcessQueue && create) { mDelayNomProcessQueue = CObjectParameterizingAllocator< CIndividualUnsortedProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mDelayNomProcessQueue->initProcessingQueue(mPrevDelayNomProcessQueue); mUseDelayNomProcessQueue = mDelayNomProcessQueue; } return mUseDelayNomProcessQueue; } CProcessingDataBox* CProcessingDataBox::clearDelayingNominalProcessingQueue() { mDelayNomProcessQueue = nullptr; mUseDelayNomProcessQueue = nullptr; mPrevDelayNomProcessQueue = nullptr; return this; } CIndividualUnsortedProcessingQueue* CProcessingDataBox::getNominalCachingLossReactivationProcessingQueue(bool create) { if (!mCachingLossReactivationProcessQueue && create) { mCachingLossReactivationProcessQueue = CObjectParameterizingAllocator< CIndividualUnsortedProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mCachingLossReactivationProcessQueue->initProcessingQueue(mPrevCachingLossReactivationProcessQueue); mUseCachingLossReactivationProcessQueue = mCachingLossReactivationProcessQueue; } return mUseCachingLossReactivationProcessQueue; } CProcessingDataBox* CProcessingDataBox::clearNominalCachingLossReactivationProcessingQueue() { mCachingLossReactivationProcessQueue = nullptr; mUseCachingLossReactivationProcessQueue = nullptr; mPrevCachingLossReactivationProcessQueue = nullptr; return this; } CIndividualConceptBatchProcessingQueue* CProcessingDataBox::getVariableBindingConceptBatchProcessingQueue(bool create) { if (!mVarBindConceptBatchProcessQueue && create) { mVarBindConceptBatchProcessQueue = CObjectParameterizingAllocator< CIndividualConceptBatchProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mVarBindConceptBatchProcessQueue->initProcessingQueue(mPrevVarBindConceptBatchProcessQueue); mUseVarBindConceptBatchProcessQueue = mVarBindConceptBatchProcessQueue; } return mUseVarBindConceptBatchProcessQueue; } CProcessingDataBox* CProcessingDataBox::clearVariableBindingConceptBatchProcessingQueue() { mVarBindConceptBatchProcessQueue = nullptr; mUseVarBindConceptBatchProcessQueue = nullptr; mPrevVarBindConceptBatchProcessQueue = nullptr; return this; } CIndividualDepthProcessingQueue* CProcessingDataBox::getIndividualDepthProcessingQueue(bool create) { if (!mIndiDepthProcessingQueue && create) { mIndiDepthProcessingQueue = CObjectParameterizingAllocator< CIndividualDepthProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mIndiDepthProcessingQueue->initProcessingQueue(mPrevIndiDepthProcessingQueue); mUseIndiDepthProcessingQueue = mIndiDepthProcessingQueue; } return mUseIndiDepthProcessingQueue; } CProcessingDataBox* CProcessingDataBox::clearIndividualDepthProcessingQueue() { mIndiDepthProcessingQueue = nullptr; mUseIndiDepthProcessingQueue = nullptr; mPrevIndiDepthProcessingQueue = nullptr; return this; } CIndividualDepthProcessingQueue* CProcessingDataBox::getNominalProcessingQueue(bool create) { if (!mNominalProcessingQueue && create) { mNominalProcessingQueue = CObjectParameterizingAllocator< CIndividualDepthProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mNominalProcessingQueue->initProcessingQueue(mPrevNominalProcessingQueue); mUseNominalProcessingQueue = mNominalProcessingQueue; } return mUseNominalProcessingQueue; } CProcessingDataBox* CProcessingDataBox::clearNominalProcessingQueue() { mNominalProcessingQueue = nullptr; mUseNominalProcessingQueue = nullptr; mPrevNominalProcessingQueue = nullptr; return this; } CIndividualDepthProcessingQueue* CProcessingDataBox::getIncrementalExpansionInitializingProcessingQueue(bool create) { if (!mIncrementalExansionInitializingProcessingQueue && create) { mIncrementalExansionInitializingProcessingQueue = CObjectParameterizingAllocator< CIndividualDepthProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mIncrementalExansionInitializingProcessingQueue->initProcessingQueue(mPrevIncrementalExansionInitializingProcessingQueue); mUseIncrementalExansionInitializingProcessingQueue = mIncrementalExansionInitializingProcessingQueue; } return mUseIncrementalExansionInitializingProcessingQueue; } CProcessingDataBox* CProcessingDataBox::clearIncrementalExpansionInitializingProcessingQueue() { mIncrementalExansionInitializingProcessingQueue = nullptr; mUseIncrementalExansionInitializingProcessingQueue = nullptr; mPrevIncrementalExansionInitializingProcessingQueue = nullptr; return this; } CIndividualCustomPriorityProcessingQueue* CProcessingDataBox::getIncrementalExpansionProcessingQueue(bool create) { if (!mIncrementalExansionProcessingQueue && create) { mIncrementalExansionProcessingQueue = CObjectParameterizingAllocator< CIndividualCustomPriorityProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mIncrementalExansionProcessingQueue->initProcessingQueue(mPrevIncrementalExansionProcessingQueue); mUseIncrementalExansionProcessingQueue = mIncrementalExansionProcessingQueue; } return mUseIncrementalExansionProcessingQueue; } CProcessingDataBox* CProcessingDataBox::clearIncrementalExpansionIProcessingQueue() { mIncrementalExansionProcessingQueue = nullptr; mUseIncrementalExansionProcessingQueue = nullptr; mPrevIncrementalExansionProcessingQueue = nullptr; return this; } CIndividualDepthProcessingQueue* CProcessingDataBox::getIncrementalCompatibilityCheckingQueue(bool create) { if (!mIncrementalCompatibilityCheckingQueue && create) { mIncrementalCompatibilityCheckingQueue = CObjectParameterizingAllocator< CIndividualDepthProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mIncrementalCompatibilityCheckingQueue->initProcessingQueue(mPrevIncrementalCompatibilityCheckingQueue); mUseIncrementalCompatibilityCheckingQueue = mIncrementalCompatibilityCheckingQueue; } return mUseIncrementalCompatibilityCheckingQueue; } CProcessingDataBox* CProcessingDataBox::clearIncrementalCompatibilityCheckingQueue() { mIncrementalCompatibilityCheckingQueue = nullptr; mUseIncrementalCompatibilityCheckingQueue = nullptr; mPrevIncrementalCompatibilityCheckingQueue = nullptr; return this; } CIndividualUnsortedProcessingQueue* CProcessingDataBox::getIndividualDepthFirstDeterministicExpansionProcessingQueue(bool create) { if (!mIndiDepthFirstDetExpPreProcessingQueue && create) { mIndiDepthFirstDetExpPreProcessingQueue = CObjectParameterizingAllocator< CIndividualUnsortedProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mIndiDepthFirstDetExpPreProcessingQueue->initProcessingQueue(mPrevIndiDepthFirstDetExpPreProcessingQueue); mUseIndiDepthFirstDetExpPreProcessingQueue = mIndiDepthFirstDetExpPreProcessingQueue; } return mUseIndiDepthFirstDetExpPreProcessingQueue; } CProcessingDataBox* CProcessingDataBox::clearIndividualDepthFirstDeterministicExpansionProcessingQueue() { mIndiDepthFirstDetExpPreProcessingQueue = nullptr; mUseIndiDepthFirstDetExpPreProcessingQueue = nullptr; mPrevIndiDepthFirstDetExpPreProcessingQueue = nullptr; return this; } CIndividualDepthProcessingQueue* CProcessingDataBox::getIndividualDepthDeterministicExpansionPreprocessingQueue(bool create) { if (!mIndiDepthDetExpPreProcessingQueue && create) { mIndiDepthDetExpPreProcessingQueue = CObjectParameterizingAllocator< CIndividualDepthProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mIndiDepthDetExpPreProcessingQueue->initProcessingQueue(mPrevIndiDepthDetExpPreProcessingQueue); mUseIndiDepthDetExpPreProcessingQueue = mIndiDepthDetExpPreProcessingQueue; } return mUseIndiDepthDetExpPreProcessingQueue; } CProcessingDataBox* CProcessingDataBox::clearIndividualDepthDeterministicExpansionPreprocessingQueue() { mIndiDepthDetExpPreProcessingQueue = nullptr; mUseIndiDepthDetExpPreProcessingQueue = nullptr; mPrevIndiDepthDetExpPreProcessingQueue = nullptr; return this; } CIndividualDepthProcessingQueue* CProcessingDataBox::getBlockingUpdateReviewProcessingQueue(bool create) { if (!mIndiSignatureBlockingUpdateProcessingQueue && create) { mIndiSignatureBlockingUpdateProcessingQueue = CObjectParameterizingAllocator< CIndividualDepthProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mIndiSignatureBlockingUpdateProcessingQueue->initProcessingQueue(mPrevIndiSignatureBlockingUpdateProcessingQueue); mUseIndiSignatureBlockingUpdateProcessingQueue = mIndiSignatureBlockingUpdateProcessingQueue; } return mUseIndiSignatureBlockingUpdateProcessingQueue; } CProcessingDataBox* CProcessingDataBox::clearBlockingUpdateReviewProcessingQueue() { mIndiSignatureBlockingUpdateProcessingQueue = nullptr; mUseIndiSignatureBlockingUpdateProcessingQueue = nullptr; mPrevIndiSignatureBlockingUpdateProcessingQueue = nullptr; return this; } CIndividualDepthProcessingQueue* CProcessingDataBox::getBlockedReactivationProcessingQueue(bool create) { if (!mIndiBlockedReactivationProcessingQueue && create) { mIndiBlockedReactivationProcessingQueue = CObjectParameterizingAllocator< CIndividualDepthProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mIndiBlockedReactivationProcessingQueue->initProcessingQueue(mPrevIndiBlockedReactivationProcessingQueue); mUseIndiBlockedReactivationProcessingQueue = mIndiBlockedReactivationProcessingQueue; } return mUseIndiBlockedReactivationProcessingQueue; } CProcessingDataBox* CProcessingDataBox::clearBlockedReactivationProcessingQueue() { mIndiBlockedReactivationProcessingQueue = nullptr; mUseIndiBlockedReactivationProcessingQueue = nullptr; mPrevIndiBlockedReactivationProcessingQueue = nullptr; return this; } CIndividualDepthProcessingQueue* CProcessingDataBox::getValueSpaceTriggeringProcessingQueue(bool create) { if (!mValueSpaceTriggeringProcessingQueue && create) { mValueSpaceTriggeringProcessingQueue = CObjectParameterizingAllocator< CIndividualDepthProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mValueSpaceTriggeringProcessingQueue->initProcessingQueue(mPrevValueSpaceTriggeringProcessingQueue); mUseValueSpaceTriggeringProcessingQueue = mValueSpaceTriggeringProcessingQueue; } return mUseValueSpaceTriggeringProcessingQueue; } CProcessingDataBox* CProcessingDataBox::clearValueSpaceTriggeringProcessingQueue() { mValueSpaceTriggeringProcessingQueue = nullptr; mUseValueSpaceTriggeringProcessingQueue = nullptr; mPrevValueSpaceTriggeringProcessingQueue = nullptr; return this; } CIndividualDepthProcessingQueue* CProcessingDataBox::getDistinctValueSpaceSatisfiabilityCheckingQueue(bool create) { if (!mDistinctValueSpaceSatisfiabilityCheckingQueue && create) { mDistinctValueSpaceSatisfiabilityCheckingQueue = CObjectParameterizingAllocator< CIndividualDepthProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mDistinctValueSpaceSatisfiabilityCheckingQueue->initProcessingQueue(mPrevDistinctValueSpaceSatisfiabilityCheckingQueue); mUseDistinctValueSpaceSatisfiabilityCheckingQueue = mDistinctValueSpaceSatisfiabilityCheckingQueue; } return mUseDistinctValueSpaceSatisfiabilityCheckingQueue; } CProcessingDataBox* CProcessingDataBox::clearDistinctValueSpaceSatisfiabilityCheckingQueue() { mDistinctValueSpaceSatisfiabilityCheckingQueue = nullptr; mUseDistinctValueSpaceSatisfiabilityCheckingQueue = nullptr; mPrevDistinctValueSpaceSatisfiabilityCheckingQueue = nullptr; return this; } CProcessingDataBox* CProcessingDataBox::setSignatureBlockingCandidateHash(CSignatureBlockingCandidateHash* signatureHash) { mSignatureBlockingCandidateHash = signatureHash; mUseSignatureBlockingCandidateHash = signatureHash; return this; } CSignatureBlockingCandidateHash* CProcessingDataBox::getSignatureBlockingCandidateHash(bool create) { if (!mSignatureBlockingCandidateHash && create) { mSignatureBlockingCandidateHash = CObjectParameterizingAllocator< CSignatureBlockingCandidateHash,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mSignatureBlockingCandidateHash->initSignatureBlockingCandidateHash(mPrevSignatureBlockingCandidateHash); mUseSignatureBlockingCandidateHash = mSignatureBlockingCandidateHash; } return mUseSignatureBlockingCandidateHash; } CSignatureBlockingCandidateHash* CProcessingDataBox::getSignatureNominalDelayingCandidateHash(bool create) { if (!mSignatureNominalDelayingCandidateHash && create) { mSignatureNominalDelayingCandidateHash = CObjectParameterizingAllocator< CSignatureBlockingCandidateHash,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mSignatureNominalDelayingCandidateHash->initSignatureBlockingCandidateHash(mPrevSignatureNominalDelayingCandidateHash); mUseSignatureNominalDelayingCandidateHash = mSignatureNominalDelayingCandidateHash; } return mUseSignatureNominalDelayingCandidateHash; } CBlockingIndividualNodeCandidateHash* CProcessingDataBox::getBlockingIndividualNodeCandidateHash(bool create) { if (!mBlockingIndiNodeCandidateHash && create) { mBlockingIndiNodeCandidateHash = CObjectParameterizingAllocator< CBlockingIndividualNodeCandidateHash,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mBlockingIndiNodeCandidateHash->initBlockingIndividualNodeCandidateHash(mPrevBlockingIndiNodeCandidateHash); mUseBlockingIndiNodeCandidateHash = mBlockingIndiNodeCandidateHash; } return mUseBlockingIndiNodeCandidateHash; } CBlockingIndividualNodeLinkedCandidateHash* CProcessingDataBox::getBlockingIndividualNodeLinkedCandidateHash(bool create) { if (!mBlockingIndiNodeLinkedCandidateHash && create) { mBlockingIndiNodeLinkedCandidateHash = CObjectParameterizingAllocator< CBlockingIndividualNodeLinkedCandidateHash,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mBlockingIndiNodeLinkedCandidateHash->initBlockingIndividualNodeCandidateHash(mPrevBlockingIndiNodeLinkedCandidateHash); mUseBlockingIndiNodeLinkedCandidateHash = mBlockingIndiNodeLinkedCandidateHash; } return mUseBlockingIndiNodeLinkedCandidateHash; } CSignatureBlockingReviewSet* CProcessingDataBox::getSignatureBlockingReviewSet(bool create) { if (!mSignatureBlockingReviewSet && create) { mSignatureBlockingReviewSet = CObjectParameterizingAllocator< CSignatureBlockingReviewSet,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mSignatureBlockingReviewSet->initSignatureBlockingReviewSet(mPrevSignatureBlockingReviewSet); mUseSignatureBlockingReviewSet = mSignatureBlockingReviewSet; } return mUseSignatureBlockingReviewSet; } CIndividualReactivationProcessingQueue* CProcessingDataBox::getEarlyIndividualReactivationProcessingQueue(bool create) { if (!mEarlyIndiReactProQueue && create) { mEarlyIndiReactProQueue = CObjectParameterizingAllocator< CIndividualReactivationProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mEarlyIndiReactProQueue->initProcessingQueue(mPrevEarlyIndiReactProQueue); mUseEarlyIndiReactProQueue = mEarlyIndiReactProQueue; } return mUseEarlyIndiReactProQueue; } CProcessingDataBox* CProcessingDataBox::clearEarlyIndividualReactivationProcessingQueue() { mEarlyIndiReactProQueue = nullptr; mUseEarlyIndiReactProQueue = nullptr; mPrevEarlyIndiReactProQueue = nullptr; return this; } CIndividualReactivationProcessingQueue* CProcessingDataBox::getLateIndividualReactivationProcessingQueue(bool create) { if (!mLateIndiReactProQueue && create) { mLateIndiReactProQueue = CObjectParameterizingAllocator< CIndividualReactivationProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mLateIndiReactProQueue->initProcessingQueue(mPrevLateIndiReactProQueue); mUseLateIndiReactProQueue = mLateIndiReactProQueue; } return mUseLateIndiReactProQueue; } CProcessingDataBox* CProcessingDataBox::clearLateIndividualReactivationProcessingQueue() { mLateIndiReactProQueue = nullptr; mUseLateIndiReactProQueue = nullptr; mPrevLateIndiReactProQueue = nullptr; return this; } CProcessingDataBox* CProcessingDataBox::clearSignatureBlockingReviewSet() { mUseSignatureBlockingReviewSet = nullptr; mSignatureBlockingReviewSet = nullptr; mPrevSignatureBlockingReviewSet = nullptr; return this; } CProcessingDataBox* CProcessingDataBox::clearReusingReviewData() { mReusingReviewSet = nullptr; mUseReusingReviewSet = nullptr; mPrevReusingReviewSet = nullptr; return this; } CReusingReviewData* CProcessingDataBox::getReusingReviewData(bool create) { if (!mReusingReviewSet && create) { mReusingReviewSet = CObjectParameterizingAllocator< CReusingReviewData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mReusingReviewSet->initReviewData(mPrevReusingReviewSet); mUseReusingReviewSet = mReusingReviewSet; } return mUseReusingReviewSet; } CNodeSwitchHistory* CProcessingDataBox::getNodeSwitchHistory(bool create) { if (!mNodeSwitchHistory && create) { mNodeSwitchHistory = CObjectParameterizingAllocator< CNodeSwitchHistory,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mNodeSwitchHistory->initSwitchHistory(mPrevNodeSwitchHistory); mUseNodeSwitchHistory = mNodeSwitchHistory; } return mUseNodeSwitchHistory; } CBranchingTree* CProcessingDataBox::getBranchingTree(bool create) { if (!mBranchingTree && create) { mBranchingTree = CObjectParameterizingAllocator< CBranchingTree,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mBranchingTree->initBranchingTree(mPrevBranchingTree); mUseBranchingTree = mBranchingTree; } return mUseBranchingTree; } bool CProcessingDataBox::hasCacheTestingIndividualNodes() { return mIndividualNodeCacheTestingLinker != nullptr; } CIndividualProcessNode* CProcessingDataBox::takeNextCacheTestingIndividualNode() { CXLinker* tmpIndividualNodeCacheTestingLinker = mIndividualNodeCacheTestingLinker; if (mIndividualNodeCacheTestingLinker) { mIndividualNodeCacheTestingLinker = mIndividualNodeCacheTestingLinker->getNext(); } return tmpIndividualNodeCacheTestingLinker->getData(); } CXLinker* CProcessingDataBox::takeIndividualNodeCacheTestingLinker() { CXLinker* tmpIndividualNodeCacheTestingLinker = mIndividualNodeCacheTestingLinker; mIndividualNodeCacheTestingLinker = nullptr; return tmpIndividualNodeCacheTestingLinker; } CProcessingDataBox* CProcessingDataBox::addIndividualNodeCacheTestingLinker(CXLinker* linker) { if (linker) { mIndividualNodeCacheTestingLinker = linker->append(mIndividualNodeCacheTestingLinker); } return this; } CXLinker* CProcessingDataBox::getSortedNominalNonDeterministicProcessingNodeLinker() { return mSortedNominalNonDetProcessingNodeLinker; } bool CProcessingDataBox::hasSortedNominalNonDeterministicProcessingNodes() { return mSortedNominalNonDetProcessingNodeLinker != nullptr; } CIndividualProcessNode* CProcessingDataBox::takeSortedNominalNonDeterministicProcessingNode() { CXLinker* tmpIndividualNodeCacheTestingLinker = mSortedNominalNonDetProcessingNodeLinker; if (mSortedNominalNonDetProcessingNodeLinker) { --mNominalNonDetProcessingCount; mSortedNominalNonDetProcessingNodeLinker = mSortedNominalNonDetProcessingNodeLinker->getNext(); } return tmpIndividualNodeCacheTestingLinker->getData(); } CXLinker* CProcessingDataBox::takeSortedNominalNonDeterministicProcessingNodeLinker() { CXLinker* tmpIndividualNodeCacheTestingLinker = mSortedNominalNonDetProcessingNodeLinker; mSortedNominalNonDetProcessingNodeLinker = nullptr; return tmpIndividualNodeCacheTestingLinker; } CProcessingDataBox* CProcessingDataBox::addSortedNominalNonDeterministicProcessingNodeLinker(CXLinker* linker) { if (linker) { mNominalNonDetProcessingCount += linker->getCount(); mSortedNominalNonDetProcessingNodeLinker = linker->append(mSortedNominalNonDetProcessingNodeLinker); } return this; } CProcessingDataBox* CProcessingDataBox::setSortedNominalNonDeterministicProcessingNodeLinker(CXLinker* linker) { mNominalNonDetProcessingCount = linker->getCount(); mSortedNominalNonDetProcessingNodeLinker = linker; return this; } CProcessingDataBox* CProcessingDataBox::clearSortedNominalNonDeterministicProcessingNodeLinker() { mSortedNominalNonDetProcessingNodeLinker = nullptr; mNominalNonDetProcessingCount = 0; return this; } bool CProcessingDataBox::hasNominalNonDeterministicProcessingNodesSorted() { return mSortedNominalNonDetProcessingNodesSorted; } CProcessingDataBox* CProcessingDataBox::setNominalNonDeterministicProcessingNodesSorted(bool sorted) { mSortedNominalNonDetProcessingNodesSorted = sorted; return this; } CXLinker* CProcessingDataBox::takeNextIndividualNodeBlockedResolveLinker() { CXLinker* tmpIndividualNodeBlockResolveLinker = mIndividualNodeResolveLinker; if (mIndividualNodeResolveLinker) { mIndividualNodeResolveLinker = mIndividualNodeResolveLinker->getNext(); } return tmpIndividualNodeBlockResolveLinker; } bool CProcessingDataBox::hasBlockedResolveIndividualNodes() { return mIndividualNodeResolveLinker != nullptr; } CProcessingDataBox* CProcessingDataBox::clearBlockedResolveIndividualNodes() { mIndividualNodeResolveLinker = nullptr; return this; } CProcessingDataBox* CProcessingDataBox::addIndividualNodeBlockedResolveLinker(CXLinker* linker) { if (linker) { mIndividualNodeResolveLinker = linker->append(mIndividualNodeResolveLinker); } return this; } CXLinker* CProcessingDataBox::getBlockableIndividualNodeUpdatedLinker() { CXLinker* tmpIndividualNodeBlockResolveLinker = mBlockableIndividualNodeUpdatedLinker; if (mBlockableIndividualNodeUpdatedLinker) { mBlockableIndividualNodeUpdatedLinker = mBlockableIndividualNodeUpdatedLinker->getNext(); } return tmpIndividualNodeBlockResolveLinker; } bool CProcessingDataBox::hasBlockableIndividualNodeUpdatedLinker() { return mBlockableIndividualNodeUpdatedLinker != nullptr; } CProcessingDataBox* CProcessingDataBox::clearBlockableIndividualNodeUpdatedLinker() { mBlockableIndividualNodeUpdatedLinker = nullptr; return this; } CProcessingDataBox* CProcessingDataBox::addBlockableIndividualNodeUpdatedLinker(CXLinker* linker) { if (linker) { mBlockableIndividualNodeUpdatedLinker = linker->append(mBlockableIndividualNodeUpdatedLinker); } return this; } CProcessingDataBox* CProcessingDataBox::setMultipleConstructionIndividualNodes(bool multiple) { mMultipleConstructionIndiNodes = multiple; return this; } bool CProcessingDataBox::hasMultipleConstructionIndividualNodes() { return mMultipleConstructionIndiNodes; } CIndividualProcessNode* CProcessingDataBox::getConstructedIndividualNode() { return mConstructedIndiNode; } CProcessingDataBox* CProcessingDataBox::setConstructedIndividualNode(CIndividualProcessNode* indiNode) { mConstructedIndiNode = indiNode; return this; } bool CProcessingDataBox::hasConstructedIndividualNodeInitialized() { return mConstructedIndiNodeInitialized; } CProcessingDataBox* CProcessingDataBox::setConstructedIndividualNodeInitialized(bool initialized) { mConstructedIndiNodeInitialized = initialized; return this; } CProcessContext* CProcessingDataBox::getProcessContext() { return mProcessContext; } CProcessingDataBox* CProcessingDataBox::setLastProcessingIndividualNodeAndConceptDescriptor(CIndividualProcessNode* indiNode, CConceptProcessDescriptor* conDes) { mLastProcessingIndiNode = indiNode; mLastProcessingConDes = conDes; return this; } bool CProcessingDataBox::getLastProcessingIndividualNodeAndConceptDescriptor(CIndividualProcessNode*& indiNode, CConceptProcessDescriptor*& conDes) { if (mLastProcessingIndiNode && mLastProcessingConDes) { indiNode = mLastProcessingIndiNode; conDes = mLastProcessingConDes; return true; } return false; } bool CProcessingDataBox::hasLastProcessingIndividualNodeAndConceptDescriptor() { return mLastProcessingConDes && mLastProcessingIndiNode; } bool CProcessingDataBox::isReapplicationLastConceptDesciptorOnLastIndividualNodeRequired() { return mLastConDesIndiReapplication; } CProcessingDataBox* CProcessingDataBox::setReapplicationLastConceptDesciptorOnLastIndividualNodeRequired(bool requiresReapplication) { mLastConDesIndiReapplication = requiresReapplication; return this; } CIndividualProcessNodeLinker* CProcessingDataBox::getIndividualProcessNodeLinker() { return mIndiProcessNodeLinker; } CIndividualProcessNodeLinker* CProcessingDataBox::takeIndividualProcessNodeLinker() { CIndividualProcessNodeLinker* indiProcNodeLinker = mIndiProcessNodeLinker; if (mIndiProcessNodeLinker) { mIndiProcessNodeLinker = mIndiProcessNodeLinker->getNext(); indiProcNodeLinker->clearNext(); } return indiProcNodeLinker; } CProcessingDataBox* CProcessingDataBox::setIndividualProcessNodeLinker(CIndividualProcessNodeLinker* indiProcessNodeLinker) { mIndiProcessNodeLinker = indiProcessNodeLinker; return this; } CProcessingDataBox* CProcessingDataBox::addIndividualProcessNodeLinker(CIndividualProcessNodeLinker* indiProcessNodeLinker) { mIndiProcessNodeLinker = indiProcessNodeLinker->append(mIndiProcessNodeLinker); return this; } CProcessingDataBox* CProcessingDataBox::setMaximumDeterministicBranchTag(cint64 branchTag) { mMaximumDeterministicBranchTag = branchTag; return this; } cint64 CProcessingDataBox::getMaximumDeterministicBranchTag() { return mMaximumDeterministicBranchTag; } CIndividualSaturationProcessNodeVector* CProcessingDataBox::getIndividualSaturationProcessNodeVector(bool create) { if (!mIndiSaturationProcessVector && create) { mIndiSaturationProcessVector = CObjectParameterizingAllocator< CIndividualSaturationProcessNodeVector,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); } return mIndiSaturationProcessVector; } bool CProcessingDataBox::hasIndividualSaturationProcessNodeLinker() { return mIndiSaturationProcessNodeLinker != nullptr; } CIndividualSaturationProcessNodeLinker* CProcessingDataBox::getIndividualSaturationProcessNodeLinker() { return mIndiSaturationProcessNodeLinker; } CIndividualSaturationProcessNodeLinker* CProcessingDataBox::takeIndividualSaturationProcessNodeLinker() { CIndividualSaturationProcessNodeLinker* indiProcNodeLinker = mIndiSaturationProcessNodeLinker; if (mIndiSaturationProcessNodeLinker) { mIndiSaturationProcessNodeLinker = mIndiSaturationProcessNodeLinker->getNext(); indiProcNodeLinker->clearNext(); } return indiProcNodeLinker; } CProcessingDataBox* CProcessingDataBox::setIndividualSaturationProcessNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker) { mIndiSaturationProcessNodeLinker = indiProcessNodeLinker; return this; } CProcessingDataBox* CProcessingDataBox::addIndividualSaturationProcessNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker) { mIndiSaturationProcessNodeLinker = indiProcessNodeLinker->append(mIndiSaturationProcessNodeLinker); return this; } bool CProcessingDataBox::hasIndividualDisjunctCommonConceptExtractProcessLinker() { return mDisjunctCommonConceptExtractProcessingLinker != nullptr; } CIndividualSaturationProcessNodeLinker* CProcessingDataBox::getIndividualDisjunctCommonConceptExtractProcessLinker() { return mDisjunctCommonConceptExtractProcessingLinker; } CIndividualSaturationProcessNodeLinker* CProcessingDataBox::takeIndividualDisjunctCommonConceptExtractProcessLinker() { CIndividualSaturationProcessNodeLinker* indiProcNodeLinker = mDisjunctCommonConceptExtractProcessingLinker; if (mDisjunctCommonConceptExtractProcessingLinker) { mDisjunctCommonConceptExtractProcessingLinker = mDisjunctCommonConceptExtractProcessingLinker->getNext(); indiProcNodeLinker->clearNext(); } return indiProcNodeLinker; } CProcessingDataBox* CProcessingDataBox::setIndividualDisjunctCommonConceptExtractProcessLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker) { mDisjunctCommonConceptExtractProcessingLinker = indiProcessNodeLinker; return this; } CProcessingDataBox* CProcessingDataBox::addIndividualDisjunctCommonConceptExtractProcessLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker) { mDisjunctCommonConceptExtractProcessingLinker = indiProcessNodeLinker->append(mDisjunctCommonConceptExtractProcessingLinker); return this; } CConceptSaturationProcessLinker* CProcessingDataBox::getRemainingConceptSaturationProcessLinker() { return mRemConSatProcessLinker; } CConceptSaturationProcessLinker* CProcessingDataBox::takeRemainingConceptSaturationProcessLinker() { CConceptSaturationProcessLinker* conSatProLinker = mRemConSatProcessLinker; if (mRemConSatProcessLinker) { mRemConSatProcessLinker = mRemConSatProcessLinker->getNext(); conSatProLinker->clearNext(); } return conSatProLinker; } CIndividualSaturationProcessNodeStatusUpdateLinker* CProcessingDataBox::getRemainingIndividualSaturationUpdateLinker() { return mRemSatUpdateLinker; } CIndividualSaturationProcessNodeStatusUpdateLinker* CProcessingDataBox::takeRemainingIndividualSaturationUpdateLinker() { CIndividualSaturationProcessNodeStatusUpdateLinker* conSatUpdLinker = mRemSatUpdateLinker; if (mRemSatUpdateLinker) { mRemSatUpdateLinker = mRemSatUpdateLinker->getNext(); conSatUpdLinker->clearNext(); } return conSatUpdLinker; } CProcessingDataBox* CProcessingDataBox::addRemainingIndividualSaturationUpdateLinker(CIndividualSaturationProcessNodeStatusUpdateLinker* indiSaturationUpdateLinker) { mRemSatUpdateLinker = indiSaturationUpdateLinker->append(mRemSatUpdateLinker); return this; } CProcessingDataBox* CProcessingDataBox::setRemainingIndividualSaturationUpdateLinker(CIndividualSaturationProcessNodeStatusUpdateLinker* indiSaturationUpdateLinker) { mRemSatUpdateLinker = indiSaturationUpdateLinker; return this; } CProcessingDataBox* CProcessingDataBox::setRemainingConceptSaturationProcessLinker(CConceptSaturationProcessLinker* conSatProcessLinker) { mRemConSatProcessLinker = conSatProcessLinker; return this; } CProcessingDataBox* CProcessingDataBox::addRemainingConceptSaturationProcessLinker(CConceptSaturationProcessLinker* conSatProcessLinker) { mRemConSatProcessLinker = conSatProcessLinker->append(mRemConSatProcessLinker); return this; } CConceptSaturationDescriptor* CProcessingDataBox::getRemainingConceptSaturationDescriptor() { return mRemConSatDes; } CConceptSaturationDescriptor* CProcessingDataBox::takeRemainingConceptSaturationDescriptor() { CConceptSaturationDescriptor* conSatDes = mRemConSatDes; if (mRemConSatDes) { mRemConSatDes = mRemConSatDes->getNext(); conSatDes->clearNext(); } return conSatDes; } CProcessingDataBox* CProcessingDataBox::setRemainingConceptSaturationDescriptor(CConceptSaturationDescriptor* conSatDes) { mRemConSatDes = conSatDes; return this; } CProcessingDataBox* CProcessingDataBox::addRemainingConceptSaturationDescriptor(CConceptSaturationDescriptor* conSatDes) { mRemConSatDes = conSatDes->append(mRemConSatDes); return this; } CRoleSaturationProcessLinker* CProcessingDataBox::getRemainingRoleSaturationProcessLinker() { return mRemRoleSatProcessLinker; } CRoleSaturationProcessLinker* CProcessingDataBox::takeRemainingRoleSaturationProcessLinker() { CRoleSaturationProcessLinker* roleProDes = mRemRoleSatProcessLinker; if (mRemRoleSatProcessLinker) { mRemRoleSatProcessLinker = mRemRoleSatProcessLinker->getNext(); roleProDes->clearNext(); } return roleProDes; } CProcessingDataBox* CProcessingDataBox::setRemainingRoleSaturationProcessLinker(CRoleSaturationProcessLinker* roleProcessLinker) { mRemRoleSatProcessLinker = roleProcessLinker; return this; } CProcessingDataBox* CProcessingDataBox::addRemainingRoleSaturationProcessLinker(CRoleSaturationProcessLinker* roleProcessLinker) { mRemRoleSatProcessLinker = roleProcessLinker->append(mRemRoleSatProcessLinker); return this; } CCriticalIndividualNodeConceptTestSet* CProcessingDataBox::getSaturationCriticalIndividualNodeConceptTestSet(bool create) { if (!mSatCriticalIndiNodeConTestSet && create) { mSatCriticalIndiNodeConTestSet = CObjectParameterizingAllocator< CCriticalIndividualNodeConceptTestSet,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mSatCriticalIndiNodeConTestSet->initIndividualNodeConceptTestSet(nullptr); } return mSatCriticalIndiNodeConTestSet; } CSaturationNominalDependentNodeHash* CProcessingDataBox::getSaturationNominalDependentNodeHash(bool create) { if (!mSatNominalDependentNodeHash && create) { mSatNominalDependentNodeHash = CObjectParameterizingAllocator< CSaturationNominalDependentNodeHash,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mSatNominalDependentNodeHash->initNominalDependentNodeHash(nullptr); } return mSatNominalDependentNodeHash; } CSaturationInfluencedNominalSet* CProcessingDataBox::getSaturationInfluencedNominalSet(bool create) { if (!mSatInfluencedNominalSet && create) { mSatInfluencedNominalSet = CObjectParameterizingAllocator< CSaturationInfluencedNominalSet,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mSatInfluencedNominalSet->initInfluencedNominalSet(nullptr); } return mSatInfluencedNominalSet; } CSaturationSuccessorExtensionIndividualNodeProcessingQueue* CProcessingDataBox::getSaturationSucessorExtensionIndividualNodeProcessingQueue(bool create) { if (!mSatSuccExtIndNodeProcQueue && create) { mSatSuccExtIndNodeProcQueue = CObjectParameterizingAllocator< CSaturationSuccessorExtensionIndividualNodeProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mSatSuccExtIndNodeProcQueue->initProcessingQueue(nullptr); } return mSatSuccExtIndNodeProcQueue; } CCriticalIndividualNodeProcessingQueue* CProcessingDataBox::getSaturationCriticalIndividualNodeProcessingQueue(bool create) { if (!mSatCriticalIndiNodeProcQueue && create) { mSatCriticalIndiNodeProcQueue = CObjectParameterizingAllocator< CCriticalIndividualNodeProcessingQueue,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mSatCriticalIndiNodeProcQueue->initProcessingQueue(nullptr); } return mSatCriticalIndiNodeProcQueue; } bool CProcessingDataBox::isInsufficientNodeOccured() { return mInsufficientNodeOccured; } CProcessingDataBox* CProcessingDataBox::setInsufficientNodeOccured(bool insufficientNodeOccured) { mInsufficientNodeOccured = insufficientNodeOccured; return this; } bool CProcessingDataBox::isProblematicEQCandidateOccured() { return mProblematicEQCandidateNodeOccured; } CProcessingDataBox* CProcessingDataBox::setProblematicEQCandidateOccured(bool problematicNodeOccured) { mProblematicEQCandidateNodeOccured = problematicNodeOccured; return this; } bool CProcessingDataBox::isDelayedNominalProcessingOccured() { return mDelayedNominalProcessingOccured; } CProcessingDataBox* CProcessingDataBox::setDelayedNominalProcessingOccured(bool delayedNominalProcessingOccured) { mDelayedNominalProcessingOccured = delayedNominalProcessingOccured; return this; } bool CProcessingDataBox::hasIndividualSaturationCompletionNodeLinker() { return mIndiSaturationCompletionNodeLinker != nullptr; } CIndividualSaturationProcessNodeLinker* CProcessingDataBox::getIndividualSaturationCompletionNodeLinker() { return mIndiSaturationCompletionNodeLinker; } CIndividualSaturationProcessNodeLinker* CProcessingDataBox::takeIndividualSaturationCompletionNodeLinker() { CIndividualSaturationProcessNodeLinker* indiProcNodeLinker = mIndiSaturationCompletionNodeLinker; if (mIndiSaturationCompletionNodeLinker) { mIndiSaturationCompletionNodeLinker = mIndiSaturationCompletionNodeLinker->getNext(); indiProcNodeLinker->clearNext(); } return indiProcNodeLinker; } CProcessingDataBox* CProcessingDataBox::setIndividualSaturationCompletionNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker) { mIndiSaturationCompletionNodeLinker = indiProcessNodeLinker; return this; } CProcessingDataBox* CProcessingDataBox::addIndividualSaturationCompletionNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker) { mIndiSaturationCompletionNodeLinker = indiProcessNodeLinker->append(mIndiSaturationCompletionNodeLinker); return this; } bool CProcessingDataBox::hasIndividualSaturationAnalysationNodeLinker() { return mIndiSaturationAnalysingNodeLinker != nullptr; } CIndividualSaturationProcessNodeLinker* CProcessingDataBox::getIndividualSaturationAnalysationNodeLinker() { return mIndiSaturationAnalysingNodeLinker; } CIndividualSaturationProcessNodeLinker* CProcessingDataBox::takeIndividualSaturationAnalysationNodeLinker() { CIndividualSaturationProcessNodeLinker* indiProcNodeLinker = mIndiSaturationAnalysingNodeLinker; if (mIndiSaturationAnalysingNodeLinker) { mIndiSaturationAnalysingNodeLinker = mIndiSaturationAnalysingNodeLinker->getNext(); indiProcNodeLinker->clearNext(); } return indiProcNodeLinker; } CProcessingDataBox* CProcessingDataBox::setIndividualSaturationAnalysationNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker) { mIndiSaturationAnalysingNodeLinker = indiProcessNodeLinker; return this; } CProcessingDataBox* CProcessingDataBox::addIndividualSaturationAnalysationNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker) { mIndiSaturationAnalysingNodeLinker = indiProcessNodeLinker->append(mIndiSaturationAnalysingNodeLinker); return this; } bool CProcessingDataBox::hasNominalDelayedIndividualSaturationProcessNodeLinker() { return mNominalDelayedIndiSaturationProcessNodeLinker != nullptr; } CIndividualSaturationProcessNodeLinker* CProcessingDataBox::getNominalDelayedIndividualSaturationProcessNodeLinker() { return mNominalDelayedIndiSaturationProcessNodeLinker; } CIndividualSaturationProcessNodeLinker* CProcessingDataBox::takeNominalDelayedIndividualSaturationProcessNodeLinker() { CIndividualSaturationProcessNodeLinker* indiProcNodeLinker = mNominalDelayedIndiSaturationProcessNodeLinker; if (mNominalDelayedIndiSaturationProcessNodeLinker) { mNominalDelayedIndiSaturationProcessNodeLinker = mNominalDelayedIndiSaturationProcessNodeLinker->getNext(); indiProcNodeLinker->clearNext(); } return indiProcNodeLinker; } CProcessingDataBox* CProcessingDataBox::setNominalDelayedIndividualSaturationProcessNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker) { mNominalDelayedIndiSaturationProcessNodeLinker = indiProcessNodeLinker; return this; } CProcessingDataBox* CProcessingDataBox::addNominalDelayedIndividualSaturationProcessNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker) { mNominalDelayedIndiSaturationProcessNodeLinker = indiProcessNodeLinker->append(mNominalDelayedIndiSaturationProcessNodeLinker); return this; } CIndividualSaturationProcessNode* CProcessingDataBox::getSeparatedSaturationConceptAssertionResolveNode() { return mSeparatedSaturationConAssResolveNode; } CProcessingDataBox* CProcessingDataBox::setSeparatedSaturationConceptAssertionResolveNode(CIndividualSaturationProcessNode* node) { mSeparatedSaturationConAssResolveNode = node; return this; } bool CProcessingDataBox::isIncrementalExpansionInitialised() { return mIncrementalExpansionInitialized; } CProcessingDataBox* CProcessingDataBox::setIncrementalExpansionInitialised(bool initialized) { mIncrementalExpansionInitialized = initialized; return this; } cint64 CProcessingDataBox::getIncrementalExpansionID() { return mIncrementalExpID; } CProcessingDataBox* CProcessingDataBox::setIncrementalExpansionID(cint64 incExpID) { mIncrementalExpID = incExpID; return this; } cint64 CProcessingDataBox::getMaxIncrementalPreviousCompletionGraphNodeID() { return mMaxIncPrevCompGraphNodeID; } CProcessingDataBox* CProcessingDataBox::setMaxIncrementalPreviousCompletionGraphNodeID(cint64 nodeID) { mMaxIncPrevCompGraphNodeID = nodeID; return this; } cint64 CProcessingDataBox::getNextIncrementalIndividualExpansionID(bool incrementNextID) { cint64 nextID = mNextIncrementalIndiExpID; if (incrementNextID) { ++mNextIncrementalIndiExpID; } return nextID; } cint64 CProcessingDataBox::getNextRoleAssertionCreationID(bool incrementNextID) { cint64 nextID = mNextRoleAssertionCreationID; if (incrementNextID) { ++mNextRoleAssertionCreationID; } return nextID; } bool CProcessingDataBox::isIncrementalExpansionCompatibleMerged() { return mIncrementalExpansionCompatibleMerged; } CProcessingDataBox* CProcessingDataBox::setIncrementalExpansionCompatibleMerged(bool compatibleMerged) { mIncrementalExpansionCompatibleMerged = compatibleMerged; return this; } bool CProcessingDataBox::isIncrementalExpansionCachingMerged() { return mIncrementalExpansionCachingMerged; } CProcessingDataBox* CProcessingDataBox::setIncrementalExpansionCachingMerged(bool cachingMerged) { mIncrementalExpansionCachingMerged = cachingMerged; return this; } CReferredIndividualTrackingVector* CProcessingDataBox::getReferredIndividualTrackingVector() { return mReferredIndiTrackVec; } CProcessingDataBox* CProcessingDataBox::setReferredIndividualTrackingVector(CReferredIndividualTrackingVector* refIndiTrackVec) { mReferredIndiTrackVec = refIndiTrackVec; return this; } bool CProcessingDataBox::isIndividualDependenceTrackingRequired() { return mIndiDepTrackingRequired; } CProcessingDataBox* CProcessingDataBox::setIndividualDependenceTrackingRequired(bool indiDepTrackingRequired) { mIndiDepTrackingRequired = indiDepTrackingRequired; return this; } CIndividualSaturationProcessNodeLinker* CProcessingDataBox::getRemainingIndividualSaturationNodeLinker() { return mRemSatIndiNodeLinker; } CIndividualSaturationProcessNodeLinker* CProcessingDataBox::takeRemainingIndividualSaturationNodeLinker() { CIndividualSaturationProcessNodeLinker* indiNodeSatLinker = mRemSatIndiNodeLinker; if (mRemSatIndiNodeLinker) { mRemSatIndiNodeLinker = mRemSatIndiNodeLinker->getNext(); indiNodeSatLinker->clearNext(); } return indiNodeSatLinker; } CProcessingDataBox* CProcessingDataBox::addRemainingIndividualSaturationNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker) { mRemSatIndiNodeLinker = indiProcessNodeLinker->append(mRemSatIndiNodeLinker); return this; } CProcessingDataBox* CProcessingDataBox::setRemainingIndividualSaturationProcessNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker) { mRemSatIndiNodeLinker = indiProcessNodeLinker; return this; } CIndividualSaturationSuccessorLinkDataLinker* CProcessingDataBox::getRemainingIndividualSuccessorLinkDataLinker() { return mRemSatIndiSuccLinkDataLinker; } CIndividualSaturationSuccessorLinkDataLinker* CProcessingDataBox::takeRemainingIndividualSuccessorLinkDataLinker() { CIndividualSaturationSuccessorLinkDataLinker* satSuccLinkDataLinker = mRemSatIndiSuccLinkDataLinker; if (mRemSatIndiSuccLinkDataLinker) { mRemSatIndiSuccLinkDataLinker = mRemSatIndiSuccLinkDataLinker->getNext(); satSuccLinkDataLinker->clearNext(); } return satSuccLinkDataLinker; } CProcessingDataBox* CProcessingDataBox::addRemainingIndividualSuccessorLinkDataLinker(CIndividualSaturationSuccessorLinkDataLinker* succLinkDataLinker) { mRemSatIndiSuccLinkDataLinker = succLinkDataLinker->append(mRemSatIndiSuccLinkDataLinker); return this; } CProcessingDataBox* CProcessingDataBox::setRemainingIndividualSuccessorLinkDataLinker(CIndividualSaturationSuccessorLinkDataLinker* succLinkDataLinker) { mRemSatIndiSuccLinkDataLinker = succLinkDataLinker; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptProcessingQueue.h0000644000175000017500000000600412520551100027576 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSINGQUEUE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSINGQUEUE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptProcessDescriptor.h" #include "CConceptDescriptor.h" #include "CProcessContext.h" #include "CConceptProcessPriority.h" #include "CConceptProcessingPriorityQueueData.h" #include "CConceptProcessingQueueIterator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CConceptProcessingQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptProcessingQueue { // public methods public: //! Constructor CConceptProcessingQueue(CProcessContext* processContext); //! Destructor virtual ~CConceptProcessingQueue(); CConceptProcessingQueue* initProcessingQueue(CConceptProcessingQueue* processingQueue); CConceptProcessingQueue* resetProcessingQueueModification(); qint64 getDescriptorCount(); bool isEmpty(); bool hasProcessDescriptor(); CConceptProcessingQueue *insertConceptProcessDescriptor(CConceptProcessDescriptor *conProDes); CConceptProcessingQueue *reinsertConceptProcessDescriptor(CConceptProcessDescriptor *conProDes); CConceptProcessDescriptor *takeNextConceptDescriptorProcess(); bool getNextConceptProcessPriority(CConceptProcessPriority* priority); CConceptProcessingQueueIterator getConceptProcessingQueueIterator(); // protected methods protected: // protected variables protected: cint64 mMaxPriorityIndex; const static cint64 mMaxIndex = 15; CProcessContext* mProcessContext; CConceptProcessingPriorityQueueData mPriorityVec[mMaxIndex]; cint64 mDesCount; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROCESSINGQUEUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBackwardPropagationLink.h0000644000175000017500000000451312520551070027712 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBACKWARDPROPAGATIONLINK_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBACKWARDPROPAGATIONLINK_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" #include "Utilities/Container/CLinker.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CBackwardPropagationLink * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackwardPropagationLink : public CLinkerBase { // public methods public: //! Constructor CBackwardPropagationLink(); CBackwardPropagationLink* initBackwardPropagationLink(CIndividualProcessNode* sourceIndividual, CRole* role); CRole* getLinkRole(); CBackwardPropagationLink* setLinkRole(CRole* role); CIndividualProcessNode* getSourceIndividual(); // protected methods protected: // protected variables protected: CRole* mRole; CIndividualProcessNode* mSourceIndividual; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBACKWARDPROPAGATIONLINK_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeBinaryHexDataValueSpaceData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeBinaryHexDataValueSpaceData.c0000644000175000017500000000631612520551106032072 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeBinaryHexDataValueSpaceData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeBinaryHexDataValueSpaceData::CDatatypeBinaryHexDataValueSpaceData(CProcessContext* processContext) : CDatatypeCompareValueSpaceData(processContext) { mBinaryHexDataValueSpaceMap = nullptr; } CDatatypeBinaryHexDataValueSpaceData* CDatatypeBinaryHexDataValueSpaceData::initBinaryHexDataValueSpaceData(CDatatypeValueSpaceBinaryHexDataType* valueSpaceType) { CDatatypeCompareValueSpaceData::initValueSpaceData(nullptr); mValueSpaceType = valueSpaceType; if (mBinaryHexDataValueSpaceMap) { mBinaryHexDataValueSpaceMap->initDatatypeCompareValueSpaceMap(valueSpaceType); } return this; } CDatatypeBinaryHexDataValueSpaceData* CDatatypeBinaryHexDataValueSpaceData::copyBinaryHexDataValueSpaceData(CDatatypeBinaryHexDataValueSpaceData* spaceData) { CDatatypeCompareValueSpaceData::initValueSpaceData(spaceData); mValueSpaceType = spaceData->mValueSpaceType; if (spaceData->mBinaryHexDataValueSpaceMap && !mBinaryHexDataValueSpaceMap) { getBinaryHexDataValueSpaceMap(true); mBinaryHexDataValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mBinaryHexDataValueSpaceMap); } else if (mBinaryHexDataValueSpaceMap) { if (spaceData->mBinaryHexDataValueSpaceMap) { mBinaryHexDataValueSpaceMap->initDatatypeCompareValueSpaceMap(spaceData->mBinaryHexDataValueSpaceMap); } else { mBinaryHexDataValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } } return this; } CDatatypeBinaryDataValueSpaceMap* CDatatypeBinaryHexDataValueSpaceData::getBinaryHexDataValueSpaceMap(bool create) { if (create && !mBinaryHexDataValueSpaceMap) { mBinaryHexDataValueSpaceMap = CObjectParameterizingAllocator< CDatatypeBinaryDataValueSpaceMap,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mBinaryHexDataValueSpaceMap->initDatatypeCompareValueSpaceMap(mValueSpaceType); } return mBinaryHexDataValueSpaceMap; } CDatatypeCompareValueSpaceMap* CDatatypeBinaryHexDataValueSpaceData::createValueSpaceMap() { return getBinaryHexDataValueSpaceMap(true); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptRepresentativePropagationSetHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptRepresentativePropagationSetHa0000644000175000017500000000271412520551102032366 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptRepresentativePropagationSetHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptRepresentativePropagationSetHashData::CConceptRepresentativePropagationSetHashData() { mLocRepPropSet = nullptr; mUseRepPropSet = nullptr; } CConceptRepresentativePropagationSetHashData::CConceptRepresentativePropagationSetHashData(const CConceptRepresentativePropagationSetHashData& data) { mLocRepPropSet = nullptr; mUseRepPropSet = data.mUseRepPropSet; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBackwardPropagationReapplyDescriptor.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBackwardPropagationReapplyDescriptor.0000644000175000017500000000444312520551072032324 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBACKWARDPROPAGATIONREAPPLYDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBACKWARDPROPAGATIONREAPPLYDESCRIPTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Utilities/Container/CLinker.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CBackwardPropagationReapplyDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackwardPropagationReapplyDescriptor : public CLinkerBase { // public methods public: //! Constructor CBackwardPropagationReapplyDescriptor(); CBackwardPropagationReapplyDescriptor* initBackwardPropagationReapplyDescriptor(CConceptDescriptor* conDes); CConceptDescriptor* getReapllyConceptDescriptor(); // protected methods protected: // protected variables protected: CConceptDescriptor* mReapplyConDes; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBACKWARDPROPAGATIONREAPPLYDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNegationDisjointEdge.h0000644000175000017500000000405512520551132027207 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CNEGATIONDISJOINTEDGE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CNEGATIONDISJOINTEDGE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CLinkEdge.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CNegationDisjointEdge * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNegationDisjointEdge : public CLinkEdge { // public methods public: //! Constructor CNegationDisjointEdge(CProcessContext* processContext = nullptr); CNegationDisjointEdge* initNegationDisjointEdge(CIndividualProcessNode* sourceIndividual, CIndividualProcessNode* destinationIndividual, CRole* role, CDependencyTrackPoint* depTrackPoint); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CNEGATIONDISJOINTEDGE_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionResolveHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionReso0000644000175000017500000000540312520551154032424 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationIndividualNodeExtensionResolveHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationIndividualNodeExtensionResolveHash::CSaturationIndividualNodeExtensionResolveHash(CProcessContext* processContext) : mIndiNodeExtensionResolveHash(processContext) { } CSaturationIndividualNodeExtensionResolveHash* CSaturationIndividualNodeExtensionResolveHash::initIndividualNodeExtensionResolveHash() { mIndiNodeExtensionResolveHash.clear(); return this; } CPROCESSHASH< QPair ,CSaturationIndividualNodeExtensionResolveHashData>* CSaturationIndividualNodeExtensionResolveHash::getIndividualNodeExtensionResolveHash() { return &mIndiNodeExtensionResolveHash; } CSaturationIndividualNodeExtensionResolveHashData& CSaturationIndividualNodeExtensionResolveHash::getResolvedIndividualNodeExtensionData(CConcept* concept, bool negation) { CSaturationIndividualNodeExtensionResolveHashData& indiNodeExtResolveHashData = mIndiNodeExtensionResolveHash[QPair(concept,negation)]; return indiNodeExtResolveHashData; } CSaturationIndividualNodeExtensionResolveHashData& CSaturationIndividualNodeExtensionResolveHash::getResolvedIndividualNodeExtensionData(CIndividualSaturationProcessNode* indiNode) { CSaturationIndividualNodeExtensionResolveHashData& indiNodeExtResolveHashData = mIndiNodeExtensionResolveHash[QPair(indiNode,false)]; return indiNodeExtResolveHashData; } CSaturationIndividualNodeExtensionResolveHashData& CSaturationIndividualNodeExtensionResolveHash::getResolvedIndividualNodeExtensionData(CRole* role) { CSaturationIndividualNodeExtensionResolveHashData& indiNodeExtResolveHashData = mIndiNodeExtensionResolveHash[QPair(role,false)]; return indiNodeExtResolveHashData; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceMapData.h0000644000175000017500000000406112520551114030727 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUESPACEMAPDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUESPACEMAPDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeRealValueData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CDatatypeRealValueSpaceMapData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeRealValueSpaceMapData { // public methods public: //! Constructor CDatatypeRealValueSpaceMapData(); CDatatypeRealValueSpaceMapData(const CDatatypeRealValueSpaceMapData& data); CDatatypeRealValueData* mLocValue; CDatatypeRealValueData* mUseValue; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUESPACEMAPDATA_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableCacheStoringData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableCacheStoring0000644000175000017500000000371312520551124032264 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATISFIABLECACHESTORINGDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATISFIABLECACHESTORINGDATA_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualNodeSatisfiableCacheStoringData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeSatisfiableCacheStoringData { // public methods public: //! Constructor CIndividualNodeSatisfiableCacheStoringData(); //! Destructor virtual ~CIndividualNodeSatisfiableCacheStoringData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODESATISFIABLECACHESTORINGDATA_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinkedCandidateHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinkedCandidate0000644000175000017500000000736212520551074032230 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBlockingIndividualNodeLinkedCandidateHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBlockingIndividualNodeLinkedCandidateHash::CBlockingIndividualNodeLinkedCandidateHash(CProcessContext* context) : mContext(context) { mMemMan = mContext->getUsedMemoryAllocationManager(); mBlockCandidateHash = nullptr; mUseBlockCandidateHash = nullptr; mPrevBlockCandidateHash = nullptr; } CBlockingIndividualNodeLinkedCandidateHash::~CBlockingIndividualNodeLinkedCandidateHash() { } CBlockingIndividualNodeLinkedCandidateHash* CBlockingIndividualNodeLinkedCandidateHash::initBlockingIndividualNodeCandidateHash(CBlockingIndividualNodeLinkedCandidateHash* prevBlockCandHash) { mBlockCandidateHash = nullptr; if (prevBlockCandHash) { mPrevBlockCandidateHash = prevBlockCandHash->mUseBlockCandidateHash; mUseBlockCandidateHash = mPrevBlockCandidateHash; } else { mPrevBlockCandidateHash = nullptr; mUseBlockCandidateHash = nullptr; } return this; } CBlockingIndividualNodeLinkedCandidateData* CBlockingIndividualNodeLinkedCandidateHash::getBlockingIndividualCandidateData(CConcept* initializationConcept, bool conceptNegation, bool create) { if (!mUseBlockCandidateHash || !mBlockCandidateHash && create) { mBlockCandidateHash = CObjectParameterizingAllocator< CPROCESSHASH< QPair ,CBlockingLinkedCandidateHashData>,CContext* >::allocateAndConstructAndParameterize(mMemMan,mContext); if (mPrevBlockCandidateHash) { *mBlockCandidateHash = *mPrevBlockCandidateHash; } mUseBlockCandidateHash = mBlockCandidateHash; } if (create) { CBlockingLinkedCandidateHashData& data = (*mUseBlockCandidateHash)[QPair(initializationConcept,conceptNegation)]; if (!data.mCandidateIndiData) { data.mCandidateIndiData = CObjectParameterizingAllocator< CBlockingIndividualNodeLinkedCandidateData,CProcessContext* >::allocateAndConstructAndParameterize(mMemMan,mContext); data.mCandidateIndiData->initBlockingCandidateData(data.mPrevCandidateIndiData); data.mPrevCandidateIndiData = data.mCandidateIndiData; } return data.mPrevCandidateIndiData; } else { CBlockingLinkedCandidateHashData* data = nullptr; if (mUseBlockCandidateHash->tryGetValuePointer(QPair(initializationConcept,conceptNegation),data)) { return data->mPrevCandidateIndiData; } } return nullptr; } CBlockingIndividualNodeLinkedCandidateData* CBlockingIndividualNodeLinkedCandidateHash::getBlockingIndividualCandidateData(CConceptDescriptor* initializationConDes, bool create) { return getBlockingIndividualCandidateData(initializationConDes->getConcept(),initializationConDes->getNegation(),create); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinker.cpp0000644000175000017500000000470712520551074031232 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBlockingIndividualNodeLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBlockingIndividualNodeLinker::CBlockingIndividualNodeLinker() : CLinkerBase(nullptr) { } CBlockingIndividualNodeLinker* CBlockingIndividualNodeLinker::initBlockingIndividualNodeLinker(CBlockingIndividualNodeLinker* blockIndNodeLinker) { if (blockIndNodeLinker) { mLastFailedSubsetConDes = blockIndNodeLinker->mLastFailedSubsetConDes; setData(blockIndNodeLinker->getData()); } else { mLastFailedSubsetConDes = nullptr; setData(nullptr); } return this; } CBlockingIndividualNodeLinker* CBlockingIndividualNodeLinker::initBlockingIndividualNodeLinker(CIndividualProcessNode* indiNode) { mLastFailedSubsetConDes = nullptr; setData(indiNode); return this; } CConceptDescriptor* CBlockingIndividualNodeLinker::getLastFailedSubsetConceptDescriptor() { return mLastFailedSubsetConDes; } CBlockingIndividualNodeLinker* CBlockingIndividualNodeLinker::setLastFailedSubsetConceptDescriptor(CConceptDescriptor* conDes) { mLastFailedSubsetConDes = conDes; return this; } CIndividualProcessNode* CBlockingIndividualNodeLinker::getCandidateIndividualNode() { return getData(); } CBlockingIndividualNodeLinker* CBlockingIndividualNodeLinker::setCandidateIndividualNode(CIndividualProcessNode* indiNode) { setData(indiNode); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathMapData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathMapD0000644000175000017500000000755312520551146032257 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRepresentativeVariableBindingPathMapData.h" #include "CRepresentativeVariableBindingPathSetData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CRepresentativeVariableBindingPathMapData::CRepresentativeVariableBindingPathMapData(CVariableBindingPath* varBindPath, CVariableBindingPath* resolveVarBindPath, CRepresentativeVariableBindingPathSetData* resRevRepVarBindPath) { mVarBindPath = varBindPath; mResolveVarBindPath = resolveVarBindPath; mResolveRepVarBindPathSetData = resRevRepVarBindPath; mResolveRepvarBindPathSetDataID = mResolveRepVarBindPathSetData->getRepresentativeID(); } CRepresentativeVariableBindingPathMapData::CRepresentativeVariableBindingPathMapData(CVariableBindingPath* varBindPath, CRepresentativeVariableBindingPathSetData* resRevRepVarBindPath) { mVarBindPath = varBindPath; mResolveVarBindPath = varBindPath; mResolveRepVarBindPathSetData = resRevRepVarBindPath; mResolveRepvarBindPathSetDataID = mResolveRepVarBindPathSetData->getRepresentativeID(); } CVariableBindingPath* CRepresentativeVariableBindingPathMapData::getVariableBindingPath() const { return mVarBindPath; } bool CRepresentativeVariableBindingPathMapData::hasVariableBindingPath() const { return mVarBindPath != nullptr; } CRepresentativeVariableBindingPathMapData* CRepresentativeVariableBindingPathMapData::setVariableBindingPath(CVariableBindingPath* varBindPath) { mVarBindPath = varBindPath; return this; } CRepresentativeVariableBindingPathSetData* CRepresentativeVariableBindingPathMapData::getResolveRepresentativeVariableBindingPathSetData() const { return mResolveRepVarBindPathSetData; } bool CRepresentativeVariableBindingPathMapData::hasResolveRepresentativeVariableBindingPathSetData() const { return mResolveRepVarBindPathSetData != nullptr; } CRepresentativeVariableBindingPathMapData* CRepresentativeVariableBindingPathMapData::setResolveRepresentativeVariableBindingPathSetData(CRepresentativeVariableBindingPathSetData* resRevRepVarBindPath) { mResolveRepVarBindPathSetData = resRevRepVarBindPath; mResolveRepvarBindPathSetDataID = mResolveRepVarBindPathSetData->getRepresentativeID(); return this; } cint64 CRepresentativeVariableBindingPathMapData::getResolveRepresentativeVariableBindingPathSetDataID() const { return mResolveRepvarBindPathSetDataID; } CVariableBindingPath* CRepresentativeVariableBindingPathMapData::getResolveVariableBindingPath() const { return mResolveVarBindPath; } bool CRepresentativeVariableBindingPathMapData::hasResolveVariableBindingPath() const { return mResolveVarBindPath != nullptr; } CRepresentativeVariableBindingPathMapData* CRepresentativeVariableBindingPathMapData::setResolveVariableBindingPath(CVariableBindingPath* varBindPath) { mResolveVarBindPath = varBindPath; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualCustomPriorityProcessingQueue.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualCustomPriorityProcessingQue0000644000175000017500000000561012520551120032454 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualCustomPriorityProcessingQueue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualCustomPriorityProcessingQueue::CIndividualCustomPriorityProcessingQueue(CProcessContext* processContext) : mProcessContext(processContext),mPriorityIndiMap(processContext) { } CIndividualCustomPriorityProcessingQueue* CIndividualCustomPriorityProcessingQueue::initProcessingQueue(CIndividualCustomPriorityProcessingQueue* processingQueue) { if (processingQueue) { mPriorityIndiMap = processingQueue->mPriorityIndiMap; } else { mPriorityIndiMap.clear(); } return this; } CIndividualProcessNode* CIndividualCustomPriorityProcessingQueue::takeNextProcessIndividual() { CIndividualProcessNode* nextNode = nullptr; if (!mPriorityIndiMap.isEmpty()) { CPROCESSMAP::iterator it = mPriorityIndiMap.begin(); nextNode = it.value(); it = mPriorityIndiMap.erase(it); } return nextNode; } CIndividualProcessNode* CIndividualCustomPriorityProcessingQueue::getNextProcessIndividual() { CIndividualProcessNode* nextNode = nullptr; if (!mPriorityIndiMap.isEmpty()) { CPROCESSMAP::iterator it = mPriorityIndiMap.begin(); nextNode = it.value(); } return nextNode; } CIndividualCustomPriorityProcessingQueue* CIndividualCustomPriorityProcessingQueue::insertIndiviudal(double priority, CIndividualProcessNode* individual) { mPriorityIndiMap.insertMulti(priority,individual); return this; } bool CIndividualCustomPriorityProcessingQueue::isEmpty() { return mPriorityIndiMap.count() <= 0; } cint64 CIndividualCustomPriorityProcessingQueue::getQueuedIndividualCount() { return mPriorityIndiMap.count(); } bool CIndividualCustomPriorityProcessingQueue::hasQueuedIndividuals() { return mPriorityIndiMap.count() > 0; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CMarkerIndividualNodeHash.cpp0000644000175000017500000000465112520551132030353 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMarkerIndividualNodeHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CMarkerIndividualNodeHash::CMarkerIndividualNodeHash(CProcessContext* context) : mContext(context) { } CMarkerIndividualNodeHash* CMarkerIndividualNodeHash::initMarkerIndividualNodeHash(CMarkerIndividualNodeHash* prevMarkerIndiNodeHash) { if (prevMarkerIndiNodeHash) { *this = *prevMarkerIndiNodeHash; } else { clear(); } return this; } CXNegLinker* CMarkerIndividualNodeHash::getMarkerIndividualNodeLinker(CConcept* markerConcept) { return value(markerConcept); } CMarkerIndividualNodeHash* CMarkerIndividualNodeHash::addMarkerIndividualNodeLinker(CConcept* markerConcept, CXNegLinker* indiNodeLinker) { CXNegLinker*& prevLinker = this->operator [](markerConcept); prevLinker = indiNodeLinker->append(prevLinker); return this; } CMarkerIndividualNodeHash* CMarkerIndividualNodeHash::addMarkerIndividualNode(CConcept* markerConcept, CIndividualProcessNode* indiNode, bool nondeterministicallyAdded) { CXNegLinker* indiNodeLinker = CObjectAllocator< CXNegLinker >::allocateAndConstruct(mContext->getMemoryAllocationManager()); indiNodeLinker->initNegLinker(indiNode,nondeterministicallyAdded); addMarkerIndividualNodeLinker(markerConcept,indiNodeLinker); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeDatatypeData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeDatatypeData.0000644000175000017500000000507712520551154032251 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEDATATYPEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEDATATYPEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CConceptSaturationDescriptor.h" // Other includes #include "Reasoner/Ontology/CDatatype.h" #include "Reasoner/Ontology/CDataLiteral.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationIndividualNodeDatatypeData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationIndividualNodeDatatypeData { // public methods public: //! Constructor CSaturationIndividualNodeDatatypeData(CProcessContext* processContext); CSaturationIndividualNodeDatatypeData* initExtensionData(CIndividualSaturationProcessNode* indiProcessNode); CDataLiteral* getAppliedDataLiteral(); CDatatype* getAppliedDatatype(); CSaturationIndividualNodeDatatypeData* setAppliedDataLiteral(CDataLiteral* dataLiteral); CSaturationIndividualNodeDatatypeData* setAppliedDatatype(CDatatype* datatype); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CDataLiteral* mAppliedDataLiteral; CDatatype* mAppliedDatatype; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEDATATYPEDATA_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetD0000644000175000017500000001051512520551146032265 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CLocalizationTag.h" #include "CRepresentativeVariableBindingPathSetMigrateData.h" #include "CRepresentativeVariableBindingPathSetDataSignature.h" #include "CRepresentativeVariableBindingPathSetJoiningHash.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathSetData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathSetData : public CLinkerBase, public CLocalizationTag { // public methods public: //! Constructor CRepresentativeVariableBindingPathSetData(CProcessContext* processContext); CRepresentativeVariableBindingPathSetData* initRepresentativeVariableBindingPathData(CRepresentativeVariableBindingPathSetData* data); cint64 getRepresentativeKey(); cint64 getRepresentativeID(); CRepresentativeVariableBindingPathSetData* setRepresentativeID(cint64 repID); cint64 getUseCount(); CRepresentativeVariableBindingPathSetData* setUseCount(cint64 useCount); CRepresentativeVariableBindingPathSetData* incUseCount(cint64 incCount = 1); cint64 getShareCount(); CRepresentativeVariableBindingPathSetData* setShareCount(cint64 shareCount); CRepresentativeVariableBindingPathSetData* incShareCount(cint64 incCount = 1); CRepresentativeVariableBindingPathSetData* decShareCount(cint64 decCount = 1); bool isMigratable(); CRepresentativeVariableBindingPathSetData* setMigratable(bool migratable); bool hasMigrateData(); CRepresentativeVariableBindingPathSetMigrateData* getMigrateData(bool localizeOrCreate = true); CRepresentativeVariableBindingPathSetMigrateData* takeMigrateDataFrom(CRepresentativeVariableBindingPathSetData* repData); CRepresentativeVariableBindingPathSetMigrateData* copyMigrateDataFrom(CRepresentativeVariableBindingPathSetData* repData); CRepresentativeVariableBindingPathSetData* addKeySignatureValue(cint64 keySignatureValue); CRepresentativeVariableBindingPathSetDataSignature* getKeySignature(); CRepresentativeVariableBindingPathSetJoiningHash* getJoiningHash(bool create); bool hasJoiningData(CConcept* joinConcept); cint64 getRepresentatedVariableCount(); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; bool mMigratable; cint64 mUseCount; cint64 mShareCount; CRepresentativeVariableBindingPathSetDataSignature mSigKey; CRepresentativeVariableBindingPathSetMigrateData* mLocMigrateData; CRepresentativeVariableBindingPathSetMigrateData* mUseMigrateData; CRepresentativeVariableBindingPathSetJoiningHash* mUseJoiningHash; CRepresentativeVariableBindingPathSetJoiningHash* mLocJoiningHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETDATA_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptIterator.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptItera0000644000175000017500000000513212520551140032334 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGREAPPLYCONCEPTITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGREAPPLYCONCEPTITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CPropagationBindingReapplyConceptDescriptor.h" #include "CPropagationBindingReapplyConceptHashData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { typedef QPair TIndividualConceptPair; /*! * * \class CPropagationBindingReapplyConceptIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPropagationBindingReapplyConceptIterator { // public methods public: //! Constructor CPropagationBindingReapplyConceptIterator(const CPROCESSHASH::iterator& itBegin, const CPROCESSHASH::iterator& itEnd); CPropagationBindingReapplyConceptDescriptor* nextReapplyDescriptor(bool moveNext = false); CPropagationBindingReapplyConceptIterator* clearReapplyDescriptor(); bool moveNext(); // protected methods protected: // protected variables protected: CPROCESSHASH::iterator mItBegin, mItEnd; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGREAPPLYCONCEPTITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualUnsortedProcessingQueue.cpp0000644000175000017500000000615512520551130032364 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualUnsortedProcessingQueue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualUnsortedProcessingQueue::CIndividualUnsortedProcessingQueue(CProcessContext* processContext) : mProcessContext(processContext) { mMemMan = mProcessContext->getMemoryAllocationManager(); mIndiProDesCount = 0; mProcessingIndiNodeLinker = nullptr; } CIndividualUnsortedProcessingQueue* CIndividualUnsortedProcessingQueue::initProcessingQueue(CIndividualUnsortedProcessingQueue* processingQueue) { if (processingQueue) { mIndiProDesCount = processingQueue->mIndiProDesCount; mProcessingIndiNodeLinker = processingQueue->mProcessingIndiNodeLinker; } else { mProcessingIndiNodeLinker = nullptr; mIndiProDesCount = 0; } return this; } CXLinker* CIndividualUnsortedProcessingQueue::getProcessIndividualNodeLinker() { return mProcessingIndiNodeLinker; } CIndividualProcessNode* CIndividualUnsortedProcessingQueue::takeNextProcessIndividualNode() { CIndividualProcessNode* nextIndiNode = nullptr; if (mProcessingIndiNodeLinker) { --mIndiProDesCount; nextIndiNode = mProcessingIndiNodeLinker->getData(); mProcessingIndiNodeLinker = mProcessingIndiNodeLinker->getNext(); } return nextIndiNode; } CIndividualProcessNode* CIndividualUnsortedProcessingQueue::getNextProcessIndividualNode() { CIndividualProcessNode* nextIndiNode = nullptr; if (mProcessingIndiNodeLinker) { nextIndiNode = mProcessingIndiNodeLinker->getData(); } return nextIndiNode; } CIndividualUnsortedProcessingQueue* CIndividualUnsortedProcessingQueue::insertIndiviudalProcessNode(CIndividualProcessNode* indiProNode) { CXLinker* newIndiNodeLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(mMemMan); mProcessingIndiNodeLinker = newIndiNodeLinker->initLinker(indiProNode,mProcessingIndiNodeLinker); ++mIndiProDesCount; return this; } bool CIndividualUnsortedProcessingQueue::isEmpty() { return mProcessingIndiNodeLinker == nullptr; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CLinkEdge.cpp0000644000175000017500000000335512520551130025167 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLinkEdge.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CLinkEdge::CLinkEdge(CProcessContext* processContext) : CNodeEdge(processContext) { mRole = nullptr; } CLinkEdge* CLinkEdge::initLinkEdge(CLinkEdge* linkEdge) { initNodeEdge(linkEdge); mRole = linkEdge->mRole; return this; } CLinkEdge* CLinkEdge::initLinkEdge(CIndividualProcessNode* sourceIndividual, CIndividualProcessNode* destinationIndividual, CRole* role, CDependencyTrackPoint* depTrackPoint) { mRole = role; initNodeEdge(sourceIndividual,destinationIndividual,depTrackPoint); return this; } CRole* CLinkEdge::getLinkRole() { return mRole; } CLinkEdge* CLinkEdge::setLinkRole(CRole* role) { mRole = role; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingTag.cpp0000644000175000017500000000542212520551134026256 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessingTag.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CProcessingTag::CProcessingTag(cint64 processingTag) : CProcessTag(processingTag) { } CProcessingTag::~CProcessingTag() { } cint64 CProcessingTag::getProcessingTag() { return CProcessTag::getProcessTag(); } CProcessingTag* CProcessingTag::setProcessingTag(cint64 processingTag) { CProcessTag::setProcessTag(processingTag); return this; } CProcessingTag* CProcessingTag::initProcessingTag(cint64 processingTag) { CProcessTag::initProcessTag(processingTag); return this; } bool CProcessingTag::isProcessingTagUpdated(cint64 processingTag) { return CProcessTag::isProcessTagUpdated(processingTag); } bool CProcessingTag::isProcessingTagUpToDate(cint64 processingTag) { return CProcessTag::isProcessTagUpToDate(processingTag); } bool CProcessingTag::updateProcessingTag(cint64 processingTag) { return CProcessTag::updateProcessTag(processingTag); } CProcessingTag* CProcessingTag::setProcessingTag(CProcessTagger* processTagger) { return setProcessingTag(processTagger->getCurrentProcessingTag()); } CProcessingTag* CProcessingTag::initProcessingTag(CProcessTagger* processTagger) { return initProcessingTag(processTagger->getCurrentProcessingTag()); } bool CProcessingTag::isProcessingTagUpdated(CProcessTagger* processTagger) { return isProcessingTagUpdated(processTagger->getCurrentProcessingTag()); } bool CProcessingTag::isProcessingTagUpToDate(CProcessTagger* processTagger) { return isProcessingTagUpToDate(processTagger->getCurrentProcessingTag()); } bool CProcessingTag::updateProcessingTag(CProcessTagger* processTagger) { return updateProcessingTag(processTagger->getCurrentProcessingTag()); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBinding.h0000644000175000017500000000466212520551162026201 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDING_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDING_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CDependencyTracker.h" // Other includes #include "Reasoner/Ontology/CVariable.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CVariableBinding * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariableBinding : public CDependencyTracker { // public methods public: //! Constructor CVariableBinding(); CVariableBinding* initVariableBinding(CDependencyTrackPoint* dependencyTrackPoint, CIndividualProcessNode* indi, CVariable* variable); CVariable* getBindedVariable() const; CVariableBinding* setBindedVariable(CVariable* variable); CIndividualProcessNode* getBindedIndividual(); CVariableBinding* setBindedIndividual(CIndividualProcessNode* indi); bool operator<=(const CVariableBinding& beforeData); bool operator<=(const CVariableBinding*& beforeData); // protected methods protected: // protected variables protected: CVariable* mVariable; CIndividualProcessNode* mIndiNode; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CVARIABLEBINDING_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/ProcessSettings.h0000644000175000017500000000605012520551166026212 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_PROCESSSETTINGS #define KONCLUDE_REASONER_KERNEL_PROCESS_PROCESSSETTINGS // Libraries includes #include #include // Namespace includes // Other includes #include "Utilities/Container/CQtManagedRestrictedModificationHash.h" #include "Utilities/Container/CQtManagedRestrictedModificationMap.h" #include "Utilities/Container/CQtManagedRestrictedModificationSet.h" // Logger includes namespace Konclude { using namespace Utilities; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \file ProcessSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CIndividualProcessNodeReference; class CConceptLabelSet; class CIndividualProcessNode; class CIndividualLinkEdge; class CProcessingStatisticDescription; class CImplicationReapplyConceptPilingDescriptor; class CConceptPilingDescriptor; class CIndividualPilingProcessNode; class CImplicationReapplyConceptSaturationDescriptor; class CConceptSaturationDescriptor; class CIndividualSaturationProcessNode; class CIndividualSaturationProcessNodeLinker; class CRepresentativeVariableBindingPathSetData; class CSaturationIndividualNodeExtensionResolveData; class CSaturationIndividualNodeExtensionResolveHash; class CSaturationIndividualNodeExtensionResolveHashData; #define CPROCESSHASH CQtManagedRestrictedModificationHash #define CPROCESSMAP CQtManagedRestrictedModificationMap #define CPROCESSSET CQtManagedRestrictedModificationSet #define CPROCESSLIST CQtManagedRestrictedModificationList #define KONCLUDE_REASONER_KERNEL_PROCESS_SATURATION_DEACTIVATED_PILING const cint64 DEFAULTVECTOR2POTSIZE = 9; const cint64 CINDIVIDUALPROCESSNODEVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; const cint64 CINDIVIDUALPILINGPROCESSNODEVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; const cint64 CINDIVIDUALSATURATIONPROCESSNODEVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_KERNEL_PROCESS_PROCESSSETTINGS././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleBackwardSaturationPropagationHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRoleBackwardSaturationPropagationHash0000644000175000017500000000646612520551150032356 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CROLEBACKWARDSATURATIONPROPAGATIONHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CROLEBACKWARDSATURATIONPROPAGATIONHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CBackwardSaturationPropagationReapplyDescriptor.h" #include "CBackwardSaturationPropagationLink.h" #include "CRoleBackwardSaturationPropagationHashData.h" #include "CProcessContext.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRoleBackwardSaturationPropagationHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleBackwardSaturationPropagationHash { // public methods public: //! Constructor CRoleBackwardSaturationPropagationHash(CProcessContext* context = nullptr); CRoleBackwardSaturationPropagationHash* initRoleBackwardSaturationPropagationHash(); CRoleBackwardSaturationPropagationHash* copyRoleBackwardSaturationPropagationHash(CRoleBackwardSaturationPropagationHash* copyRoleBackPilPropHash, CIndividualSaturationProcessNode* newIndiNode); CBackwardSaturationPropagationReapplyDescriptor* getBackwardPropagationBackwardPropagationConceptDescriptor(CRole* role); CBackwardSaturationPropagationReapplyDescriptor* addBackwardPropagationLink(CRole* role, CBackwardSaturationPropagationLink* link); CBackwardSaturationPropagationReapplyDescriptor* addSelfConnectedBackwardPropagationLink(CRole* role, CBackwardSaturationPropagationLink* link); CRoleBackwardSaturationPropagationHashData& addBackwardPropagationConceptDescriptor(CRole* role, CBackwardSaturationPropagationReapplyDescriptor* reapplyConDes); CPROCESSHASH* getRoleBackwardPropagationDataHash(); // protected methods protected: // protected variables protected: CProcessContext* mContext; CPROCESSHASH mRoleBackPropDataHash; bool mSelfConnected; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CROLEBACKWARDSATURATIONPROPAGATIONHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceMapArranger.h0000644000175000017500000000441712520551114031624 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUESPACEMAPARRANGER_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUESPACEMAPARRANGER_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDataLiteralRealValue.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeRealValueSpaceMapArranger * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeRealValueSpaceMapArranger { // public methods public: //! Constructor CDatatypeRealValueSpaceMapArranger(CDataLiteralRealValue* value); bool operator<(const CDatatypeRealValueSpaceMapArranger& valueData) const; bool operator<=(const CDatatypeRealValueSpaceMapArranger& valueData) const; CDataLiteralRealValue* getValue() const; // protected methods protected: // protected variables protected: CDataLiteralRealValue* mValue; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPEREALVALUESPACEMAPARRANGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPath.cpp0000644000175000017500000000424712520551162027350 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingPath.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingPath::CVariableBindingPath() { } cint64 CVariableBindingPath::getPropagationID() const { return mPropID; } CVariableBindingPath* CVariableBindingPath::setPropagationID(cint64 propID) { mPropID = propID; return this; } CVariableBindingPath* CVariableBindingPath::initVariableBindingPath(cint64 propID, CVariableBindingDescriptor* varBindDesLinker) { mPropID = propID; mVarBindDesLinker = varBindDesLinker; return this; } CVariableBindingDescriptor* CVariableBindingPath::getVariableBindingDescriptorLinker() { return mVarBindDesLinker; } cint64 CVariableBindingPath::getVariableBindingCount() const { if (!mVarBindDesLinker) { return 0; } else { return mVarBindDesLinker->getCount(); } } CVariableBindingPath* CVariableBindingPath::addVariableBindingDescriptorLinker(CVariableBindingDescriptor* varBindDesLinker) { if (mVarBindDesLinker) { mVarBindDesLinker = mVarBindDesLinker->insertSortedNextSorted(varBindDesLinker); } else { mVarBindDesLinker = varBindDesLinker; } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeNominalHandlingData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeNominalHandli0000644000175000017500000001074712520551154032343 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationIndividualNodeNominalHandlingData.h" #include "CIndividualSaturationProcessNodeLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationIndividualNodeNominalHandlingData::CSaturationIndividualNodeNominalHandlingData(CProcessContext* processContext) { mProcessContext = processContext; mConceptSaturationProcessLinker = nullptr; mIndiProcessLinker = nullptr; mSuccConnectedNominalSet = nullptr; } CSaturationIndividualNodeNominalHandlingData* CSaturationIndividualNodeNominalHandlingData::initNominalHandlingData(CIndividualSaturationProcessNode* indiProcessNode) { mIndiProcessNode = indiProcessNode; return this; } CConceptSaturationProcessLinker* CSaturationIndividualNodeNominalHandlingData::getDelayedNominalConceptSaturationProcessLinker() { return mConceptSaturationProcessLinker; } CConceptSaturationProcessLinker* CSaturationIndividualNodeNominalHandlingData::takeDelayedNominalConceptSaturationProcessLinker() { CConceptSaturationProcessLinker* conProcLinker = mConceptSaturationProcessLinker; if (mConceptSaturationProcessLinker) { mConceptSaturationProcessLinker = mConceptSaturationProcessLinker->getNext(); } return conProcLinker; } CSaturationIndividualNodeNominalHandlingData* CSaturationIndividualNodeNominalHandlingData::setDelayedNominalConceptSaturationProcessLinker(CConceptSaturationProcessLinker* conProcessLinker) { mConceptSaturationProcessLinker = conProcessLinker; return this; } CSaturationIndividualNodeNominalHandlingData* CSaturationIndividualNodeNominalHandlingData::addDelayedNominalConceptSaturationProcessLinker(CConceptSaturationProcessLinker* conProcessLinker) { mConceptSaturationProcessLinker = conProcessLinker->append(mConceptSaturationProcessLinker); return this; } CSaturationIndividualNodeNominalHandlingData* CSaturationIndividualNodeNominalHandlingData::clearDelayedNominalConceptSaturationProcessLinker() { mConceptSaturationProcessLinker = nullptr; return this; } bool CSaturationIndividualNodeNominalHandlingData::isDelayedNominalIndividualSaturationProcessNodeLinkerQueued() { if (mIndiProcessLinker) { return mIndiProcessLinker->isNegated(); } return false; } CIndividualSaturationProcessNodeLinker* CSaturationIndividualNodeNominalHandlingData::getDelayedNominalIndividualSaturationProcessNodeLinker(bool create) { if (!mIndiProcessLinker && create) { mIndiProcessLinker = CObjectAllocator< CIndividualSaturationProcessNodeLinker >::allocateAndConstruct(mProcessContext->getUsedMemoryAllocationManager()); mIndiProcessLinker->initProcessNodeLinker(mIndiProcessNode,false); } return mIndiProcessLinker; } CSaturationIndividualNodeNominalHandlingData* CSaturationIndividualNodeNominalHandlingData::setDelayedNominalIndividualSaturationProcessNodeLinker(CIndividualSaturationProcessNodeLinker* processNodeLinker) { mIndiProcessLinker = processNodeLinker; return this; } CSuccessorConnectedNominalSet* CSaturationIndividualNodeNominalHandlingData::getSuccessorConnectedNominalSet(bool create) { if (!mSuccConnectedNominalSet && create) { mSuccConnectedNominalSet = CObjectParameterizingAllocator< CSuccessorConnectedNominalSet,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mSuccConnectedNominalSet->initSuccessorConnectedNominalSet(); } return mSuccConnectedNominalSet; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConnectionSuccessorCorrectionHash.cpp0000644000175000017500000000403312520551104032325 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConnectionSuccessorCorrectionHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConnectionSuccessorCorrectionHash::CConnectionSuccessorCorrectionHash(CProcessContext* context) : CPROCESSHASH(context),mContext(context) { } CConnectionSuccessorCorrectionHash::~CConnectionSuccessorCorrectionHash() { } CConnectionSuccessorCorrectionHash* CConnectionSuccessorCorrectionHash::initConnectionSuccessorCorrectionHash(CConnectionSuccessorCorrectionHash* connSuccCorrHash) { if (connSuccCorrHash) { *this = *connSuccCorrHash; } else { CPROCESSHASH::clear(); } return this; } CConnectionSuccessorCorrectionHash* CConnectionSuccessorCorrectionHash::insertConnectionSuccessor(cint64 indiID) { CPROCESSHASH::insert(indiID,indiID); return this; } CConnectionSuccessorCorrectionHash* CConnectionSuccessorCorrectionHash::correctSuccessorConnection(cint64 indiID, cint64 correctedID) { CPROCESSHASH::insert(indiID,correctedID); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningKeyDataMap.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJ0000644000175000017500000000453712520551150032275 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGKEYDATAMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGKEYDATAMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CVariableBindingPath.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathSetJoiningKeyDataMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathSetJoiningKeyDataMap : public CPROCESSMAP { // public methods public: //! Constructor CRepresentativeVariableBindingPathSetJoiningKeyDataMap(CProcessContext* processContext); CRepresentativeVariableBindingPathSetJoiningKeyDataMap* initVariableBindingPathSetJoiningKeyDataMap(CRepresentativeVariableBindingPathSetJoiningKeyDataMap* prevMap); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGKEYDATAMAP_H ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBranchingMergingProcessingRestrictionSpecification.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBranchingMergingProcessingRestriction0000644000175000017500000004450012520551074032417 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBranchingMergingProcessingRestrictionSpecification.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBranchingMergingProcessingRestrictionSpecification::CBranchingMergingProcessingRestrictionSpecification(CProcessContext* processContext) { mProcessContext = processContext; mDistinctMergedNodesSet = nullptr; mMergingNodesLinker = nullptr; mNominalMergingNodesLinker = nullptr; mMergingInitNodesLinker = nullptr; mOnlyPosQualifyNodesLinker = nullptr; mOnlyNegQualifyNodesLinker = nullptr; mBothQualifyNodesLinker = nullptr; mLastDistinctMergedNodesSet = nullptr; mIndiLink = nullptr; mRemainingLinkerMergingCandidateIndiNodeCount = 0; mRemainingValidMergingCandidateIndiNodeCount = 0; mDistinctSetFixed = false; mHasMergingInitCandidates = false; mRemainingNominalCreationCount = 0; mAddedBlockablePredMergingNodeCandidate = false; mAddedBlockablePredDepTrackPoint = nullptr; mDependencyTrackPoint = nullptr; mMergingDependencyNode = nullptr; mInitMergingNodesClashes = nullptr; mMultipleInitMergingNodesClashes = nullptr; mDistinctSetNodeRelocated = false; //mList.clear(); //mList.append(QString("")); //mList.append(QString("")); //mList.append(QString("")); } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::initBranchingMergingProcessingRestriction(CBranchingMergingProcessingRestrictionSpecification* prevRest) { CProcessingRestrictionSpecification::initProcessingRestriction(prevRest); if (prevRest) { mDistinctMergedNodesSet = nullptr; mLastDistinctMergedNodesSet = nullptr; if (prevRest->mLastDistinctMergedNodesSet) { mLastDistinctMergedNodesSet = prevRest->mLastDistinctMergedNodesSet; } mNominalMergingNodesLinker = prevRest->mNominalMergingNodesLinker; mMergingNodesLinker = prevRest->mMergingNodesLinker; mMergingInitNodesLinker = prevRest->mMergingInitNodesLinker; mOnlyPosQualifyNodesLinker = prevRest->mOnlyPosQualifyNodesLinker; mOnlyNegQualifyNodesLinker = prevRest->mOnlyNegQualifyNodesLinker; mBothQualifyNodesLinker = prevRest->mBothQualifyNodesLinker; mIndiLink = prevRest->mIndiLink; mRemainingLinkerMergingCandidateIndiNodeCount = prevRest->mRemainingLinkerMergingCandidateIndiNodeCount; mRemainingValidMergingCandidateIndiNodeCount = prevRest->mRemainingValidMergingCandidateIndiNodeCount; mDistinctSetFixed = prevRest->mDistinctSetFixed; mHasMergingInitCandidates = prevRest->mHasMergingInitCandidates; mRemainingNominalCreationCount = prevRest->mRemainingNominalCreationCount; mAddedBlockablePredMergingNodeCandidate = prevRest->mAddedBlockablePredMergingNodeCandidate; mAddedBlockablePredDepTrackPoint = prevRest->mAddedBlockablePredDepTrackPoint; mDependencyTrackPoint = prevRest->mDependencyTrackPoint; mMergingDependencyNode = prevRest->mMergingDependencyNode; mInitMergingNodesClashes = prevRest->mInitMergingNodesClashes; mMultipleInitMergingNodesClashes = prevRest->mMultipleInitMergingNodesClashes; mDistinctSetNodeRelocated = prevRest->mDistinctSetNodeRelocated; //mList = prevRest->mList; } else { mDistinctSetNodeRelocated = false; mDistinctMergedNodesSet = nullptr; mMergingNodesLinker = nullptr; mNominalMergingNodesLinker = nullptr; mMergingInitNodesLinker = nullptr; mOnlyPosQualifyNodesLinker = nullptr; mOnlyNegQualifyNodesLinker = nullptr; mBothQualifyNodesLinker = nullptr; mIndiLink = nullptr; mRemainingLinkerMergingCandidateIndiNodeCount = 0; mRemainingValidMergingCandidateIndiNodeCount = 0; mDistinctSetFixed = false; mHasMergingInitCandidates = false; mRemainingNominalCreationCount = 0; mAddedBlockablePredMergingNodeCandidate = false; mAddedBlockablePredDepTrackPoint = nullptr; mDependencyTrackPoint = nullptr; mMergingDependencyNode = nullptr; mInitMergingNodesClashes = nullptr; mMultipleInitMergingNodesClashes = nullptr; } return this; } CPROCESSSET* CBranchingMergingProcessingRestrictionSpecification::getDistinctMergedNodesSet(bool create) { if (!mDistinctMergedNodesSet && create) { createLocalizedDistinctMergedNodeSet(); } return mLastDistinctMergedNodesSet; } CPROCESSSET* CBranchingMergingProcessingRestrictionSpecification::createLocalizedDistinctMergedNodeSet() { if (!mDistinctMergedNodesSet) { mDistinctMergedNodesSet = CObjectParameterizingAllocator< CPROCESSSET,CContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (mLastDistinctMergedNodesSet) { *mDistinctMergedNodesSet = *mLastDistinctMergedNodesSet; } mLastDistinctMergedNodesSet = mDistinctMergedNodesSet; } return mLastDistinctMergedNodesSet; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::addDistinctMergedNode(cint64 mergedIndiNode) { createLocalizedDistinctMergedNodeSet()->insert(mergedIndiNode); return this; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::removeDistinctMergedNode(cint64 mergedIndiNode) { createLocalizedDistinctMergedNodeSet()->remove(mergedIndiNode); return this; } CBranchingMergingIndividualNodeCandidateLinker* CBranchingMergingProcessingRestrictionSpecification::getMergingCandidateNodeLinker() { return mMergingNodesLinker; } CBranchingMergingIndividualNodeCandidateLinker* CBranchingMergingProcessingRestrictionSpecification::takeNextMergingCandidateNodeLinker() { CBranchingMergingIndividualNodeCandidateLinker* tmpMergingNodeLinker = nullptr; tmpMergingNodeLinker = takeNextMergingInitializationCandidateNodeLinker(); if (!tmpMergingNodeLinker) { tmpMergingNodeLinker = mNominalMergingNodesLinker; if (mNominalMergingNodesLinker) { --mRemainingLinkerMergingCandidateIndiNodeCount; --mRemainingValidMergingCandidateIndiNodeCount; mNominalMergingNodesLinker = mNominalMergingNodesLinker->getNext(); } if (!tmpMergingNodeLinker) { tmpMergingNodeLinker = mMergingNodesLinker; if (mMergingNodesLinker) { --mRemainingLinkerMergingCandidateIndiNodeCount; --mRemainingValidMergingCandidateIndiNodeCount; mMergingNodesLinker = mMergingNodesLinker->getNext(); } } } return tmpMergingNodeLinker; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::addMergingCandidateNodeLinker(CBranchingMergingIndividualNodeCandidateLinker* linker) { while (linker) { CBranchingMergingIndividualNodeCandidateLinker* linkerIt = linker; linker = linker->getNext(); linkerIt->clearNext(); if (!mAddedBlockablePredMergingNodeCandidate && linkerIt->isCandidateBlockableAndCreator()) { mAddedBlockablePredDepTrackPoint = linkerIt->getMergingIndividualLink()->getDependencyTrackPoint(); mAddedBlockablePredMergingNodeCandidate = true; } ++mRemainingLinkerMergingCandidateIndiNodeCount; ++mRemainingValidMergingCandidateIndiNodeCount; if (linkerIt->getMergingIndividualNodeCandidate()->isNominalIndividual()) { mNominalMergingNodesLinker = linkerIt->append(mNominalMergingNodesLinker); } else { mMergingNodesLinker = linkerIt->append(mMergingNodesLinker); } } return this; } CBranchingMergingIndividualNodeCandidateLinker* CBranchingMergingProcessingRestrictionSpecification::getMergingInitializationCandidateNodeLinker() { return mMergingInitNodesLinker; } CBranchingMergingIndividualNodeCandidateLinker* CBranchingMergingProcessingRestrictionSpecification::takeNextMergingInitializationCandidateNodeLinker() { CBranchingMergingIndividualNodeCandidateLinker* tmpMergingNodeLinker = nullptr; tmpMergingNodeLinker = mMergingInitNodesLinker; if (mMergingInitNodesLinker) { --mRemainingLinkerMergingCandidateIndiNodeCount; --mRemainingValidMergingCandidateIndiNodeCount; mMergingInitNodesLinker = mMergingInitNodesLinker->getNext(); } return tmpMergingNodeLinker; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::addMergingInitializationCandidateNodeLinker(CBranchingMergingIndividualNodeCandidateLinker* linker) { if (linker) { mHasMergingInitCandidates = true; CBranchingMergingIndividualNodeCandidateLinker* linkerIt = linker; while (linkerIt) { if (!mAddedBlockablePredMergingNodeCandidate && linkerIt->isCandidateBlockableAndCreator()) { mAddedBlockablePredDepTrackPoint = linkerIt->getMergingIndividualLink()->getDependencyTrackPoint(); mAddedBlockablePredMergingNodeCandidate = true; } ++mRemainingLinkerMergingCandidateIndiNodeCount; ++mRemainingValidMergingCandidateIndiNodeCount; linkerIt = linkerIt->getNext(); } mMergingInitNodesLinker = linker->append(mMergingInitNodesLinker); } return this; } CBranchingMergingIndividualNodeCandidateLinker* CBranchingMergingProcessingRestrictionSpecification::getOnlyPosQualifyCandidateNodeLinker() { return mOnlyPosQualifyNodesLinker; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::addOnlyPosQualifyCandidateNodeLinker(CBranchingMergingIndividualNodeCandidateLinker* linker) { if (linker) { mOnlyPosQualifyNodesLinker = linker->append(mOnlyPosQualifyNodesLinker); } return this; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::clearOnlyPosQualifyCandidateNodeLinker() { mOnlyPosQualifyNodesLinker = nullptr; return this; } CBranchingMergingIndividualNodeCandidateLinker* CBranchingMergingProcessingRestrictionSpecification::getOnlyNegQualifyCandidateNodeLinker() { return mOnlyNegQualifyNodesLinker; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::addOnlyNegQualifyCandidateNodeLinker(CBranchingMergingIndividualNodeCandidateLinker* linker) { if (linker) { mOnlyNegQualifyNodesLinker = linker->append(mOnlyNegQualifyNodesLinker); } return this; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::clearOnlyNegQualifyCandidateNodeLinker() { mOnlyNegQualifyNodesLinker = nullptr; return this; } CBranchingMergingIndividualNodeCandidateLinker* CBranchingMergingProcessingRestrictionSpecification::getBothQualifyCandidateNodeLinker() { return mBothQualifyNodesLinker; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::addBothQualifyCandidateNodeLinker(CBranchingMergingIndividualNodeCandidateLinker* linker) { if (linker) { mBothQualifyNodesLinker = linker->append(mBothQualifyNodesLinker); } return this; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::setBothQualifyCandidateNodeLinker(CBranchingMergingIndividualNodeCandidateLinker* linker) { mBothQualifyNodesLinker = linker; return this; } cint64 CBranchingMergingProcessingRestrictionSpecification::getRemainingLinkerMergingCandidateIndividualNodeCount() { return mRemainingLinkerMergingCandidateIndiNodeCount; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::setRemainingLinkerMergingCandidateIndividualNodeCount(cint64 remainingCanidateCount) { mRemainingLinkerMergingCandidateIndiNodeCount = remainingCanidateCount; return this; } CIndividualLinkEdge* CBranchingMergingProcessingRestrictionSpecification::getLastIndividualLink() { return mIndiLink; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::setLastIndividualLink(CIndividualLinkEdge* indiLink) { mIndiLink = indiLink; return this; } cint64 CBranchingMergingProcessingRestrictionSpecification::getRemainingValidMergingCandidateIndividualNodeCount() { return mRemainingValidMergingCandidateIndiNodeCount; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::setRemainingValidMergingCandidateIndividualNodeCount(cint64 remainingCanidateCount) { mRemainingValidMergingCandidateIndiNodeCount = remainingCanidateCount; return this; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::incRemainingValidMergingCandidateIndividualNodeCount() { ++mRemainingValidMergingCandidateIndiNodeCount; return this; } bool CBranchingMergingProcessingRestrictionSpecification::hasValidRemainingMergingCandidates() { return mRemainingValidMergingCandidateIndiNodeCount == mRemainingLinkerMergingCandidateIndiNodeCount; } bool CBranchingMergingProcessingRestrictionSpecification::hasRemainingMergingCandidates() { return mNominalMergingNodesLinker != nullptr || mMergingNodesLinker != nullptr || mMergingInitNodesLinker != nullptr; } bool CBranchingMergingProcessingRestrictionSpecification::hasMergingInitializationCandidates() { return mHasMergingInitCandidates; } bool CBranchingMergingProcessingRestrictionSpecification::hasRemainingMergingInitializationCandidates() { return mMergingInitNodesLinker != nullptr; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::setDistinctSetFixed(bool fixed) { mDistinctSetFixed = fixed; return this; } bool CBranchingMergingProcessingRestrictionSpecification::isDistinctSetFixed() { return mDistinctSetFixed; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::setRemainingNominalCreationCount(cint64 nomCount) { mRemainingNominalCreationCount = nomCount; return this; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::decRemainingNominalCreationCount(cint64 decCount) { mRemainingNominalCreationCount -= decCount; return this; } cint64 CBranchingMergingProcessingRestrictionSpecification::getRemainingNominalCreationCount() { return mRemainingNominalCreationCount; } bool CBranchingMergingProcessingRestrictionSpecification::hasAddedBlockablePredecessorMergingNodeCandidate() { return mAddedBlockablePredMergingNodeCandidate; } CDependencyTrackPoint* CBranchingMergingProcessingRestrictionSpecification::getAddedBlockablePredecessorDependencyTrackPoint() { return mAddedBlockablePredDepTrackPoint; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::initMergingDependencyNode(CNonDeterministicDependencyNode* depNode) { mMergingDependencyNode = depNode; return this; } CNonDeterministicDependencyNode* CBranchingMergingProcessingRestrictionSpecification::getMergingDependencyNode() { return mMergingDependencyNode; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::setMergingNodesInitializationClashesDescriptors(CClashedDependencyDescriptor* clashes) { mInitMergingNodesClashes = clashes; return this; } CClashedDependencyDescriptor* CBranchingMergingProcessingRestrictionSpecification::getMergingNodesInitializationClashesDescriptors() { return mInitMergingNodesClashes; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::setMultipleMergingNodesInitializationClashesDescriptors(CClashedDependencyDescriptor* clashes) { mMultipleInitMergingNodesClashes = clashes; return this; } CClashedDependencyDescriptor* CBranchingMergingProcessingRestrictionSpecification::getMultipleMergingNodesInitializationClashesDescriptors() { return mMultipleInitMergingNodesClashes; } bool CBranchingMergingProcessingRestrictionSpecification::isDistinctSetNodeRelocated() { return mDistinctSetNodeRelocated; } CBranchingMergingProcessingRestrictionSpecification* CBranchingMergingProcessingRestrictionSpecification::setDistinctSetNodeRelocated(bool distinctSetNodeRelocated) { mDistinctSetNodeRelocated = distinctSetNodeRelocated; return this; } //bool CBranchingMergingProcessingRestrictionSpecification::addIndividualToContainer(cint64 container, cint64 individual) { // QString insertString; // --container; // if (mList.size() > container) { // insertString = mList.value(container); // insertString += QString(" %1").arg(individual); // mList.replace(container,insertString); // } else { // insertString += QString("%1").arg(individual); // mList.insert(container,insertString); // } // return true; //} //void CBranchingMergingProcessingRestrictionSpecification::printIndividualContainer() { // cout<<"\n"<. * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash::CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash(CProcessContext* processContext) : mProcessContext(processContext),mLinkedSuccRoleFUNCTIONALConceptExtHash(processContext) { } CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash* CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash::initLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash() { mLinkedSuccRoleFUNCTIONALConceptExtHash.clear(); return this; } CPROCESSHASH* CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash::getLinkedSuccessorIndividualFUNCTIONALConceptsExtensionHash() { return &mLinkedSuccRoleFUNCTIONALConceptExtHash; } CSaturationSuccessorFUNCTIONALConceptExtensionData* CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash::getSuccessorFunctionalConceptsExtensionData(CRole* role, bool create) { if (create) { CSaturationSuccessorFUNCTIONALConceptExtensionData*& data = mLinkedSuccRoleFUNCTIONALConceptExtHash[role]; if (!data) { data = CObjectParameterizingAllocator< CSaturationSuccessorFUNCTIONALConceptExtensionData,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); data->initSuccessorConceptExtensionData(role); } return data; } else { return mLinkedSuccRoleFUNCTIONALConceptExtHash.value(role,nullptr); } } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeBackendCacheSynchronisationData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeBackendCacheSynchronisa0000644000175000017500000000374712520551122032245 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEBACKENDCACHESYNCHRONISATIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEBACKENDCACHESYNCHRONISATIONDATA_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualNodeBackendCacheSynchronisationData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeBackendCacheSynchronisationData { // public methods public: //! Constructor CIndividualNodeBackendCacheSynchronisationData(); //! Destructor virtual ~CIndividualNodeBackendCacheSynchronisationData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALNODEBACKENDCACHESYNCHRONISATIONDATA_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetMigrateData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetM0000644000175000017500000000507012520551150032271 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETMIGRATEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETMIGRATEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CRepresentativeVariableBindingPathMap.h" #include "CRepresentativeContainingMap.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathSetMigrateData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathSetMigrateData { // public methods public: //! Constructor CRepresentativeVariableBindingPathSetMigrateData(CProcessContext* context); CRepresentativeVariableBindingPathSetMigrateData* initRepresentativeVariableBindingPathSetMigrateData(CRepresentativeVariableBindingPathSetMigrateData* data); CRepresentativeVariableBindingPathMap* getRepresentativeVariableBindingPathMap(); CRepresentativeContainingMap* getRepresentativeContainingMap(); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CRepresentativeContainingMap mRepContainingMap; CRepresentativeVariableBindingPathMap mVarBindPathMap; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETMIGRATEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptPropagationBindingSetHash.h0000644000175000017500000000447312520551100031523 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROPAGATIONBINDINGSETHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROPAGATIONBINDINGSETHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CPropagationBindingSet.h" #include "CConceptPropagationBindingSetHashData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CConceptPropagationBindingSetHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptPropagationBindingSetHash : public CPROCESSHASH { // public methods public: //! Constructor CConceptPropagationBindingSetHash(CProcessContext* processContext); CConceptPropagationBindingSetHash* initConceptPropagationBindingSetHash(CConceptPropagationBindingSetHash* prevHash); CPropagationBindingSet* getPropagationBindingSet(CConcept* concept, bool localize = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTPROPAGATIONBINDINGSETHASH_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingCandidateIterator.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingCandidateIterator.cp0000644000175000017500000000326112520756410032252 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureBlockingCandidateIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSignatureBlockingCandidateIterator::CSignatureBlockingCandidateIterator(cint64 signature, CXLinker* candidateIndiLinker) : mSignature(signature), mCandidateIndiLinkerIt(candidateIndiLinker) { } bool CSignatureBlockingCandidateIterator::hasNext() { return mCandidateIndiLinkerIt != nullptr; } cint64 CSignatureBlockingCandidateIterator::next(bool moveNext) { cint64 indiID = -1; if (mCandidateIndiLinkerIt) { indiID = mCandidateIndiLinkerIt->getData(); if (moveNext) { mCandidateIndiLinkerIt = mCandidateIndiLinkerIt->getNext(); } } return indiID; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CLinkedRoleSaturationSuccessorHash.cpp0000644000175000017500000002744112520551130032307 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLinkedRoleSaturationSuccessorHash.h" #include "CIndividualSaturationProcessNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CLinkedRoleSaturationSuccessorHash::CLinkedRoleSaturationSuccessorHash(CProcessContext* context) : mContext(context),mRoleSuccDataHash(context) { } CLinkedRoleSaturationSuccessorHash* CLinkedRoleSaturationSuccessorHash::initRoleSuccessorHash() { mLastExaminedConDes = nullptr; mLastExaminedRoleAssLinker = nullptr; mRoleSuccDataHash.clear(); return this; } CLinkedRoleSaturationSuccessorHash* CLinkedRoleSaturationSuccessorHash::copyRoleSuccessorHash(CLinkedRoleSaturationSuccessorHash* copyRoleSuccHash) { mRoleSuccDataHash = copyRoleSuccHash->mRoleSuccDataHash; return this; } bool CLinkedRoleSaturationSuccessorHash::hasActiveLinkedSuccessor(CRole* role, CIndividualSaturationProcessNode* linkedIndi, CRole* creationRole, cint64 linkCount) { CLinkedRoleSaturationSuccessorData** roleSuccData = mRoleSuccDataHash.valuePointer(role); if (roleSuccData && *roleSuccData) { CSaturationSuccessorData** succData = nullptr; if ((*roleSuccData)->mSuccNodeDataMap.tryGetValuePointer(linkedIndi->getIndividualID(),succData)) { if (succData && (*succData)->mActiveCount >= 1 && (*succData)->mSuccCount >= linkCount) { if (!creationRole) { return true; } for (CXNegLinker* creationRoleIt = (*succData)->mCreationRoleLinker; creationRoleIt; creationRoleIt = creationRoleIt->getNext()) { if (!creationRoleIt->isNegated() && creationRole == creationRoleIt->getData()) { return true; } } } } } return false; } bool CLinkedRoleSaturationSuccessorHash::hasLinkedSuccessor(CRole* role, CIndividualSaturationProcessNode* linkedIndi, CRole* creationRole, cint64 linkCount) { CLinkedRoleSaturationSuccessorData** roleSuccData = mRoleSuccDataHash.valuePointer(role); if (roleSuccData && *roleSuccData) { CSaturationSuccessorData** succData = nullptr; if ((*roleSuccData)->mSuccNodeDataMap.tryGetValuePointer(linkedIndi->getIndividualID(),succData)) { if (succData && (*succData)->mSuccCount >= linkCount) { if (!creationRole) { return true; } for (CXNegLinker* creationRoleIt = (*succData)->mCreationRoleLinker; creationRoleIt; creationRoleIt = creationRoleIt->getNext()) { if (creationRole == creationRoleIt->getData()) { return true; } } } } } return false; } CSaturationSuccessorData*& CLinkedRoleSaturationSuccessorHash::getLinkedRoleSuccessorData(CLinkedRoleSaturationSuccessorData*& roleSuccData, cint64 linkedIndiID, bool forceNewCreation) { CSaturationSuccessorData*& succData = roleSuccData->mSuccNodeDataMap[linkedIndiID]; if (!succData || forceNewCreation) { CSaturationSuccessorData* prevSuccData = succData; succData = CObjectAllocator::allocateAndConstruct(mContext->getUsedMemoryAllocationManager()); if (prevSuccData) { succData->mSuccCount = prevSuccData->mSuccCount; succData->mActiveCount = prevSuccData->mActiveCount; succData->mExtension = prevSuccData->mExtension; succData->mSuccIndiNode = prevSuccData->mSuccIndiNode; succData->mCreationRoleLinker = prevSuccData->mCreationRoleLinker; succData->mVALUENominalID = prevSuccData->mVALUENominalID; succData->mVALUENominalConnection = prevSuccData->mVALUENominalConnection; prevSuccData->mActiveCount = 0; } succData->mNextLink = roleSuccData->mLastLink; roleSuccData->mLastLink = succData; } return succData; } bool CLinkedRoleSaturationSuccessorHash::hasActiveCreationRole(CSaturationSuccessorData* succData, CRole* creationRole) { for (CXNegLinker* creationRoleLinkerIt = succData->mCreationRoleLinker; creationRoleLinkerIt; creationRoleLinkerIt = creationRoleLinkerIt->getNext()) { if (!creationRoleLinkerIt->isNegated()) { if (creationRoleLinkerIt->getData() == creationRole) { return true; } } } return false; } CLinkedRoleSaturationSuccessorHash* CLinkedRoleSaturationSuccessorHash::addLinkedSuccessor(CRole* role, CIndividualSaturationProcessNode* linkedIndi, CRole* creationRole, cint64 linkCount, bool forceAddLink) { CLinkedRoleSaturationSuccessorData*& roleSuccData = getLinkedRoleSuccessorData(role,true); if (roleSuccData) { CSaturationSuccessorData*& succData = getLinkedRoleSuccessorData(roleSuccData,linkedIndi->getIndividualID(),true); bool creationRoleAlreadyExists = hasActiveCreationRole(succData,creationRole); if (!creationRoleAlreadyExists) { ++succData->mActiveCount; } succData->mExtension = false; succData->mSuccIndiNode = linkedIndi; if (!creationRoleAlreadyExists) { succData->mCreationRoleLinker = CObjectAllocator< CXNegLinker >::allocateAndConstruct(mContext->getUsedMemoryAllocationManager())->initNegLinker(creationRole,false)->append(succData->mCreationRoleLinker); } cint64 linkCountDiff = 0; if (forceAddLink) { linkCountDiff += linkCount; } else { if (succData->mSuccCount < linkCount) { linkCountDiff = linkCount-succData->mSuccCount; } } succData->mSuccCount += linkCountDiff; roleSuccData->mSuccCount += linkCountDiff; } return this; } CLinkedRoleSaturationSuccessorHash* CLinkedRoleSaturationSuccessorHash::addLinkedVALUESuccessor(CRole* role, cint64 nominalID, CRole* creationRole) { CLinkedRoleSaturationSuccessorData*& roleSuccData = getLinkedRoleSuccessorData(role,true); if (roleSuccData) { CSaturationSuccessorData*& succData = getLinkedRoleSuccessorData(roleSuccData,-nominalID,true); bool creationRoleAlreadyExists = hasActiveCreationRole(succData,creationRole); if (!creationRoleAlreadyExists) { ++succData->mActiveCount; } succData->mExtension = false; succData->mVALUENominalConnection = true; succData->mVALUENominalID = nominalID; if (!creationRoleAlreadyExists) { succData->mCreationRoleLinker = CObjectAllocator< CXNegLinker >::allocateAndConstruct(mContext->getUsedMemoryAllocationManager())->initNegLinker(creationRole,false)->append(succData->mCreationRoleLinker); } cint64 linkCountDiff = 0; if (succData->mSuccCount < 1) { linkCountDiff = 1; } succData->mSuccCount += linkCountDiff; roleSuccData->mSuccCount += linkCountDiff; } return this; } CLinkedRoleSaturationSuccessorHash* CLinkedRoleSaturationSuccessorHash::addExtensionSuccessor(CRole* role, CIndividualSaturationProcessNode* linkedIndi, CRole* creationRole, cint64 linkCount) { CLinkedRoleSaturationSuccessorData*& roleSuccData = getLinkedRoleSuccessorData(role,true); if (roleSuccData) { CSaturationSuccessorData*& succData = getLinkedRoleSuccessorData(roleSuccData,linkedIndi->getIndividualID(),true); bool creationRoleAlreadyExists = hasActiveCreationRole(succData,creationRole); if (!creationRoleAlreadyExists) { ++succData->mActiveCount; } succData->mExtension = true; succData->mSuccIndiNode = linkedIndi; if (!creationRoleAlreadyExists) { succData->mCreationRoleLinker = CObjectAllocator< CXNegLinker >::allocateAndConstruct(mContext->getUsedMemoryAllocationManager())->initNegLinker(creationRole,false)->append(succData->mCreationRoleLinker); } cint64 linkCountDiff = 0; if (succData->mSuccCount < linkCount) { linkCountDiff = linkCount-succData->mSuccCount; } succData->mSuccCount += linkCountDiff; roleSuccData->mSuccCount += linkCountDiff; } return this; } CLinkedRoleSaturationSuccessorHash* CLinkedRoleSaturationSuccessorHash::setSuccessorMergedCreation(CRole* role, CIndividualSaturationProcessNode* linkedIndi) { CLinkedRoleSaturationSuccessorData*& roleSuccData = getLinkedRoleSuccessorData(role,true); if (roleSuccData) { CSaturationSuccessorData*& succData = getLinkedRoleSuccessorData(roleSuccData,linkedIndi->getIndividualID()); //succData->mMergedCreation = true; } return this; } CLinkedRoleSaturationSuccessorHash* CLinkedRoleSaturationSuccessorHash::deactivateLinkedSuccessor(CRole* role, CIndividualSaturationProcessNode* linkedIndi, CRole* creationRole) { CLinkedRoleSaturationSuccessorData*& roleSuccData = getLinkedRoleSuccessorData(role,true); if (roleSuccData) { CSaturationSuccessorData*& succData = getLinkedRoleSuccessorData(roleSuccData,linkedIndi->getIndividualID()); if (succData->mActiveCount > 0) { --succData->mActiveCount; for (CXNegLinker* creationRoleIt = succData->mCreationRoleLinker; creationRoleIt; creationRoleIt = creationRoleIt->getNext()) { if (creationRoleIt->getData() == creationRole && !creationRoleIt->isNegated()) { creationRoleIt->setNegation(true); break; } } if (succData->mActiveCount <= 0) { roleSuccData->mSuccCount -= succData->mSuccCount; succData->mSuccCount = 0; } } } return this; } CPROCESSHASH* CLinkedRoleSaturationSuccessorHash::getLinkedRoleSuccessorHash() { return &mRoleSuccDataHash; } CLinkedRoleSaturationSuccessorData*& CLinkedRoleSaturationSuccessorHash::getLinkedRoleSuccessorData(CRole* role, bool create) { CLinkedRoleSaturationSuccessorData*& roleSuccData = mRoleSuccDataHash[role]; if (!roleSuccData) { roleSuccData = CObjectAllocator::allocateAndConstruct(mContext->getUsedMemoryAllocationManager()); } return roleSuccData; } bool CLinkedRoleSaturationSuccessorHash::hasLinkedRoleSuccessorData(CRole* role) { CLinkedRoleSaturationSuccessorData* roleSuccData = mRoleSuccDataHash.value(role); if (roleSuccData && roleSuccData->mSuccCount > 0) { return true; } return false; } CConceptSaturationDescriptor* CLinkedRoleSaturationSuccessorHash::getLastExaminedConceptDescriptor() { return mLastExaminedConDes; } CLinkedRoleSaturationSuccessorHash* CLinkedRoleSaturationSuccessorHash::setLastExaminedConceptDescriptor(CConceptSaturationDescriptor* conDes) { mLastExaminedConDes = conDes; return this; } CSaturationSuccessorRoleAssertionLinker* CLinkedRoleSaturationSuccessorHash::getLastExaminedRoleAssertionLinker() { return mLastExaminedRoleAssLinker; } CLinkedRoleSaturationSuccessorHash* CLinkedRoleSaturationSuccessorHash::setLastExaminedRoleAssertionLinker(CSaturationSuccessorRoleAssertionLinker* roleAssLinker) { mLastExaminedRoleAssLinker = roleAssLinker; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingReviewSet.h0000644000175000017500000000462212520551162030425 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGREVIEWSET_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGREVIEWSET_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" #include "CSignatureBlockingReviewData.h" #include "CProcessContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSignatureBlockingReviewSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureBlockingReviewSet { // public methods public: //! Constructor CSignatureBlockingReviewSet(CProcessContext* context = nullptr); CSignatureBlockingReviewSet* initSignatureBlockingReviewSet(CSignatureBlockingReviewSet* sigBlockRevSet); CSignatureBlockingReviewData* getSubsetReviewData(); CSignatureBlockingReviewData* getReviewData(bool subset); CSignatureBlockingReviewData* getNonSubsetReviewData(); bool isEmpty(); // protected methods protected: // protected variables protected: CSignatureBlockingReviewData mSubsetReviews; CSignatureBlockingReviewData mNonSubsetReviews; CProcessContext* mContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGREVIEWSET_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CNodeEdge.cpp0000644000175000017500000001104112520551132025150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNodeEdge.h" #include "CIndividualProcessNode.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CNodeEdge::CNodeEdge(CProcessContext* processContext) { mSourceIndividual = nullptr; mDestinationIndividual = nullptr; initLocalizationTag(processContext->getUsedProcessTagger()); } CNodeEdge* CNodeEdge::initNodeEdge(CNodeEdge* nodeEdge) { mSourceIndividual = nodeEdge->mSourceIndividual; mDestinationIndividual = nodeEdge->mDestinationIndividual; initDependencyTracker(nodeEdge->mDependencyTrackPoint); return this; } CNodeEdge* CNodeEdge::initNodeEdge(CIndividualProcessNode* sourceIndividual, CIndividualProcessNode* destinationIndividual, CDependencyTrackPoint* depTrackPoint) { mSourceIndividual = sourceIndividual; mDestinationIndividual = destinationIndividual; initDependencyTracker(depTrackPoint); return this; } CIndividualProcessNode* CNodeEdge::getSourceIndividual() { return mSourceIndividual; } CIndividualProcessNode* CNodeEdge::getDestinationIndividual() { return mDestinationIndividual; } cint64 CNodeEdge::getSourceIndividualID() { cint64 indiID = 0; if (mSourceIndividual) { indiID = mSourceIndividual->getIndividualID(); } return indiID; } cint64 CNodeEdge::getDestinationIndividualID() { cint64 indiID = 0; if (mDestinationIndividual) { indiID = mDestinationIndividual->getIndividualID(); } return indiID; } CNodeEdge* CNodeEdge::setSourceIndividual(CIndividualProcessNode* sourceIndi) { mSourceIndividual = sourceIndi; return this; } CNodeEdge* CNodeEdge::setDestinationIndividual(CIndividualProcessNode* destinationIndi) { mDestinationIndividual = destinationIndi; return this; } CIndividualProcessNode* CNodeEdge::getOppositeIndividual(CIndividualProcessNode* indi) { if (indi) { return getOppositeIndividual(indi->getIndividualID()); } return nullptr; } CIndividualProcessNode* CNodeEdge::getOppositeIndividual(cint64 indiID) { if (mSourceIndividual->getIndividualID() == indiID) { return mDestinationIndividual; } return mSourceIndividual; } cint64 CNodeEdge::getOppositeIndividualID(CIndividualProcessNode* indi) { if (indi) { return getOppositeIndividualID(indi->getIndividualID()); } return 0; } cint64 CNodeEdge::getOppositeIndividualID(cint64 indiID) { if (mSourceIndividual->getIndividualID() == indiID) { return mDestinationIndividual->getIndividualID(); } return mSourceIndividual->getIndividualID(); } bool CNodeEdge::isDestinationIndividual(CIndividualProcessNode* indi) { return mDestinationIndividual == indi; } bool CNodeEdge::isDestinationIndividualID(CIndividualProcessNode* indi) { return mDestinationIndividual->getIndividualID() == indi->getIndividualID(); } bool CNodeEdge::isDestinationIndividualID(cint64 indiID) { return mDestinationIndividual->getIndividualID() == indiID; } bool CNodeEdge::isSourceIndividual(CIndividualProcessNode* indi) { return mSourceIndividual == indi; } bool CNodeEdge::isSourceIndividualID(CIndividualProcessNode* indi) { return mSourceIndividual->getIndividualID() == indi->getIndividualID(); } bool CNodeEdge::isSourceIndividualID(cint64 indiID) { return mSourceIndividual->getIndividualID() == indiID; } cint64 CNodeEdge::getCoupledIndividualID() { return mSourceIndividual->getIndividualID() + mDestinationIndividual->getIndividualID(); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJ0000644000175000017500000000512212520551150032264 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRepresentativeVariableBindingPathSetJoiningData.h" #include "CRepresentativeVariableBindingPathSetJoiningHashData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathSetJoiningHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathSetJoiningHash : public CPROCESSHASH { // public methods public: //! Constructor CRepresentativeVariableBindingPathSetJoiningHash(CProcessContext* processContext); CRepresentativeVariableBindingPathSetJoiningHash* initRepresentativeVariableBindingPathSetJoiningHash(CRepresentativeVariableBindingPathSetJoiningHash* prevHash); CRepresentativeVariableBindingPathSetJoiningData* getRepresentativeVariableBindingPathSetJoiningData(CConcept* joinConcept, bool create = true); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETJOININGHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceData.h0000644000175000017500000000511612520551114030656 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUESPACEDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUESPACEDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CDatatypeValueSpaceData.h" #include "CDatatypeStringValueSpaceData.h" #include "CDatatypeStringValueSpaceMap.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CDatatypeValueSpaceStringType.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CDatatypeStringValueSpaceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeStringValueSpaceData : public CDatatypeValueSpaceData { // public methods public: //! Constructor CDatatypeStringValueSpaceData(CProcessContext* processContext); CDatatypeStringValueSpaceData* copyStringValueSpaceData(CDatatypeStringValueSpaceData* spaceData); CDatatypeStringValueSpaceData* initStringValueSpaceData(CDatatypeValueSpaceStringType* valueSpaceType); CDatatypeStringValueSpaceMap* getValueSpaceMap(bool create); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CDatatypeStringValueSpaceMap* mValueSpaceMap; CDatatypeValueSpaceStringType* mValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CDATATYPESTRINGVALUESPACEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeStringValueExclusionType.cpp0000644000175000017500000000351012520551114032173 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeStringValueExclusionType.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeStringValueExclusionType::CDatatypeStringValueExclusionType(CDatatypeStringValueExclusionType::STRING_VALUE_EXCLUSION_TYPE exclusionType, bool negated) { mExclusionType = exclusionType; mExclusionNegation = negated; } CDatatypeStringValueExclusionType* CDatatypeStringValueExclusionType::setExclusionType(CDatatypeStringValueExclusionType::STRING_VALUE_EXCLUSION_TYPE exclusionType, bool negated) { mExclusionType = exclusionType; mExclusionNegation = negated; return this; } CDatatypeStringValueExclusionType::STRING_VALUE_EXCLUSION_TYPE CDatatypeStringValueExclusionType::getExclusionType() { return mExclusionType; } bool CDatatypeStringValueExclusionType::getExclusionNegation() { return mExclusionNegation; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBranchingMergingProcessingRestrictionSpecification.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBranchingMergingProcessingRestriction0000644000175000017500000002042612520551074032420 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CBRANCHINGMERGINGPROCESSINGRESTRICTIONSPECIFICATION_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CBRANCHINGMERGINGPROCESSINGRESTRICTIONSPECIFICATION_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CProcessingRestrictionSpecification.h" #include "CBranchingMergingIndividualNodeCandidateLinker.h" #include "CIndividualProcessNode.h" #include "CDependencyTracker.h" // Other includes #include "Utilities/Memory/CObjectParameterizingAllocator.h" // Logger includes #include "Logger/CLogger.h" #include using namespace std; namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CBranchingMergingProcessingRestrictionSpecification * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBranchingMergingProcessingRestrictionSpecification : public CProcessingRestrictionSpecification, public CDependencyTracker { // public methods public: //! Constructor CBranchingMergingProcessingRestrictionSpecification(CProcessContext* processContext = nullptr); CBranchingMergingProcessingRestrictionSpecification* initBranchingMergingProcessingRestriction(CBranchingMergingProcessingRestrictionSpecification* prevRest = nullptr); CPROCESSSET* getDistinctMergedNodesSet(bool create = true); CBranchingMergingIndividualNodeCandidateLinker* getMergingCandidateNodeLinker(); CBranchingMergingIndividualNodeCandidateLinker* takeNextMergingCandidateNodeLinker(); CBranchingMergingProcessingRestrictionSpecification* addMergingCandidateNodeLinker(CBranchingMergingIndividualNodeCandidateLinker* linker); CBranchingMergingIndividualNodeCandidateLinker* getMergingInitializationCandidateNodeLinker(); CBranchingMergingIndividualNodeCandidateLinker* takeNextMergingInitializationCandidateNodeLinker(); CBranchingMergingProcessingRestrictionSpecification* addMergingInitializationCandidateNodeLinker(CBranchingMergingIndividualNodeCandidateLinker* linker); CBranchingMergingIndividualNodeCandidateLinker* getOnlyPosQualifyCandidateNodeLinker(); CBranchingMergingProcessingRestrictionSpecification* addOnlyPosQualifyCandidateNodeLinker(CBranchingMergingIndividualNodeCandidateLinker* linker); CBranchingMergingProcessingRestrictionSpecification* clearOnlyPosQualifyCandidateNodeLinker(); CBranchingMergingIndividualNodeCandidateLinker* getOnlyNegQualifyCandidateNodeLinker(); CBranchingMergingProcessingRestrictionSpecification* addOnlyNegQualifyCandidateNodeLinker(CBranchingMergingIndividualNodeCandidateLinker* linker); CBranchingMergingProcessingRestrictionSpecification* clearOnlyNegQualifyCandidateNodeLinker(); CBranchingMergingIndividualNodeCandidateLinker* getBothQualifyCandidateNodeLinker(); CBranchingMergingProcessingRestrictionSpecification* addBothQualifyCandidateNodeLinker(CBranchingMergingIndividualNodeCandidateLinker* linker); CBranchingMergingProcessingRestrictionSpecification* setBothQualifyCandidateNodeLinker(CBranchingMergingIndividualNodeCandidateLinker* linker); CBranchingMergingProcessingRestrictionSpecification* addDistinctMergedNode(cint64 mergedIndiNode); CBranchingMergingProcessingRestrictionSpecification* removeDistinctMergedNode(cint64 mergedIndiNode); cint64 getRemainingLinkerMergingCandidateIndividualNodeCount(); CBranchingMergingProcessingRestrictionSpecification* setRemainingLinkerMergingCandidateIndividualNodeCount(cint64 remainingCanidateCount); cint64 getRemainingValidMergingCandidateIndividualNodeCount(); CBranchingMergingProcessingRestrictionSpecification* setRemainingValidMergingCandidateIndividualNodeCount(cint64 remainingCanidateCount); CBranchingMergingProcessingRestrictionSpecification* incRemainingValidMergingCandidateIndividualNodeCount(); bool hasValidRemainingMergingCandidates(); CIndividualLinkEdge* getLastIndividualLink(); CBranchingMergingProcessingRestrictionSpecification* setLastIndividualLink(CIndividualLinkEdge* indiLink); bool hasRemainingMergingCandidates(); bool hasMergingInitializationCandidates(); bool hasRemainingMergingInitializationCandidates(); CBranchingMergingProcessingRestrictionSpecification* setDistinctSetFixed(bool fixed); bool isDistinctSetFixed(); CBranchingMergingProcessingRestrictionSpecification* setRemainingNominalCreationCount(cint64 nomCount); CBranchingMergingProcessingRestrictionSpecification* decRemainingNominalCreationCount(cint64 decCount = 1); cint64 getRemainingNominalCreationCount(); bool hasAddedBlockablePredecessorMergingNodeCandidate(); CDependencyTrackPoint* getAddedBlockablePredecessorDependencyTrackPoint(); CBranchingMergingProcessingRestrictionSpecification* initMergingDependencyNode(CNonDeterministicDependencyNode* depNode); CNonDeterministicDependencyNode* getMergingDependencyNode(); CBranchingMergingProcessingRestrictionSpecification* setMultipleMergingNodesInitializationClashesDescriptors(CClashedDependencyDescriptor* clashes); CClashedDependencyDescriptor* getMultipleMergingNodesInitializationClashesDescriptors(); CBranchingMergingProcessingRestrictionSpecification* setMergingNodesInitializationClashesDescriptors(CClashedDependencyDescriptor* clashes); CClashedDependencyDescriptor* getMergingNodesInitializationClashesDescriptors(); //bool addIndividualToContainer(cint64 container, cint64 individual); //void printIndividualContainer(); bool isDistinctSetNodeRelocated(); CBranchingMergingProcessingRestrictionSpecification* setDistinctSetNodeRelocated(bool distinctSetNodeRelocated); // protected methods protected: CPROCESSSET* createLocalizedDistinctMergedNodeSet(); // protected variables protected: //QStringList mList; cint64 mRemainingNominalCreationCount; CIndividualLinkEdge* mIndiLink; cint64 mRemainingLinkerMergingCandidateIndiNodeCount; cint64 mRemainingValidMergingCandidateIndiNodeCount; bool mDistinctSetFixed; bool mHasMergingInitCandidates; CPROCESSSET* mDistinctMergedNodesSet; CPROCESSSET* mLastDistinctMergedNodesSet; CBranchingMergingIndividualNodeCandidateLinker* mNominalMergingNodesLinker; CBranchingMergingIndividualNodeCandidateLinker* mMergingNodesLinker; CBranchingMergingIndividualNodeCandidateLinker* mMergingInitNodesLinker; CBranchingMergingIndividualNodeCandidateLinker* mOnlyPosQualifyNodesLinker; CBranchingMergingIndividualNodeCandidateLinker* mOnlyNegQualifyNodesLinker; CBranchingMergingIndividualNodeCandidateLinker* mBothQualifyNodesLinker; CNonDeterministicDependencyNode* mMergingDependencyNode; CClashedDependencyDescriptor* mInitMergingNodesClashes; CClashedDependencyDescriptor* mMultipleInitMergingNodesClashes; CProcessContext* mProcessContext; bool mAddedBlockablePredMergingNodeCandidate; CDependencyTrackPoint* mAddedBlockablePredDepTrackPoint; bool mDistinctSetNodeRelocated; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CBRANCHINGMERGINGPROCESSINGRESTRICTIONSPECIFICATION_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBranchingMergingIndividualNodeCandidateLinker.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBranchingMergingIndividualNodeCandida0000644000175000017500000000661412520551074032223 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBranchingMergingIndividualNodeCandidateLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBranchingMergingIndividualNodeCandidateLinker::CBranchingMergingIndividualNodeCandidateLinker(CProcessContext* processContext) { mProcessContext = processContext; mMergingIndiNodeCandidate = nullptr; mMergingLink = nullptr; } CBranchingMergingIndividualNodeCandidateLinker::~CBranchingMergingIndividualNodeCandidateLinker() { } CBranchingMergingIndividualNodeCandidateLinker* CBranchingMergingIndividualNodeCandidateLinker::initBranchingMergingIndividualNodeCandidate(CBranchingMergingIndividualNodeCandidateLinker* prevRest) { if (prevRest) { mMergingIndiNodeCandidate = prevRest->mMergingIndiNodeCandidate; mMergingLink = prevRest->mMergingLink; } else { mMergingIndiNodeCandidate = nullptr; mMergingLink = nullptr; } return this; } CBranchingMergingIndividualNodeCandidateLinker* CBranchingMergingIndividualNodeCandidateLinker::initBranchingMergingIndividualNodeCandidate(CIndividualProcessNode* mergingIndiNodeCand, CIndividualLinkEdge* mergingLink) { mMergingLink = mergingLink; mMergingIndiNodeCandidate = mergingIndiNodeCand; return this; } CIndividualProcessNode* CBranchingMergingIndividualNodeCandidateLinker::getMergingIndividualNodeCandidate() { return mMergingIndiNodeCandidate; } CBranchingMergingIndividualNodeCandidateLinker* CBranchingMergingIndividualNodeCandidateLinker::setMergingIndividualNodeCandidate(CIndividualProcessNode* mergingIndiNodeCand) { mMergingIndiNodeCandidate = mergingIndiNodeCand; return this; } CIndividualLinkEdge* CBranchingMergingIndividualNodeCandidateLinker::getMergingIndividualLink() { return mMergingLink; } CBranchingMergingIndividualNodeCandidateLinker* CBranchingMergingIndividualNodeCandidateLinker::setMergingIndividualLink(CIndividualLinkEdge* mergingLink) { mMergingLink = mergingLink; return this; } bool CBranchingMergingIndividualNodeCandidateLinker::isCandidateBlockableAndCreator() { return mMergingIndiNodeCandidate && mMergingLink && mMergingIndiNodeCandidate->isBlockableIndividual() && mMergingLink->isCreatorIndividualID(mMergingIndiNodeCandidate); } bool CBranchingMergingIndividualNodeCandidateLinker::operator<=(const CBranchingMergingIndividualNodeCandidateLinker& otherIndiNodeCandLinker) { return true; } }; // end namespace Kernel }; // end namespace Process }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingFollowUpdateTag.cpp0000644000175000017500000000613712520551072030225 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBlockingFollowUpdateTag.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBlockingFollowUpdateTag::CBlockingFollowUpdateTag(cint64 blockingFollowTag) : CProcessTag(blockingFollowTag) { } CBlockingFollowUpdateTag::~CBlockingFollowUpdateTag() { } cint64 CBlockingFollowUpdateTag::getBlockingFollowTag() { return CProcessTag::getProcessTag(); } CBlockingFollowUpdateTag* CBlockingFollowUpdateTag::setBlockingFollowTag(cint64 blockingFollowTag) { CProcessTag::setProcessTag(blockingFollowTag); return this; } CBlockingFollowUpdateTag* CBlockingFollowUpdateTag::setBlockingFollowTag(CProcessTagger* processTagger) { return setBlockingFollowTag(processTagger->getCurrentBlockingFollowTag()); } CBlockingFollowUpdateTag* CBlockingFollowUpdateTag::initBlockingFollowTag(cint64 blockingFollowTag) { CProcessTag::initProcessTag(blockingFollowTag); return this; } CBlockingFollowUpdateTag* CBlockingFollowUpdateTag::initBlockingFollowTag(CProcessTagger* processTagger) { return initBlockingFollowTag(processTagger->getCurrentBlockingFollowTag()); } bool CBlockingFollowUpdateTag::isBlockingFollowTagUpdated(cint64 blockingFollowTag) { return CProcessTag::isProcessTagUpdated(blockingFollowTag); } bool CBlockingFollowUpdateTag::isBlockingFollowTagUpToDate(cint64 blockingFollowTag) { return CProcessTag::isProcessTagUpToDate(blockingFollowTag); } bool CBlockingFollowUpdateTag::updateBlockingFollowTag(cint64 blockingFollowTag) { return CProcessTag::updateProcessTag(blockingFollowTag); } bool CBlockingFollowUpdateTag::updateBlockingFollowTag(CProcessTagger* processTagger) { return updateBlockingFollowTag(processTagger->getCurrentBlockingFollowTag()); } bool CBlockingFollowUpdateTag::isBlockingFollowTagUpdated(CProcessTagger* processTagger) { return isBlockingFollowTagUpdated(processTagger->getCurrentBlockingFollowTag()); } bool CBlockingFollowUpdateTag::isBlockingFollowTagUpToDate(CProcessTagger* processTagger) { return isBlockingFollowTagUpToDate(processTagger->getCurrentBlockingFollowTag()); } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptProcessPriority.cpp0000644000175000017500000000470712520551100030200 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptProcessPriority.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CConceptProcessPriority::CConceptProcessPriority(double priority) { mPriority = priority; } double CConceptProcessPriority::getPriority() const { return mPriority; } CConceptProcessPriority* CConceptProcessPriority::setPriority(double priority) { mPriority = priority; return this; } CConceptProcessPriority* CConceptProcessPriority::addPriorityOffset(double priorityOffset) { mPriority += priorityOffset; return this; } bool CConceptProcessPriority::operator==(const CConceptProcessPriority& conceptPriority) const { return mPriority == conceptPriority.mPriority; } bool CConceptProcessPriority::operator!=(const CConceptProcessPriority& conceptPriority) const { return mPriority != conceptPriority.mPriority; } bool CConceptProcessPriority::operator<=(const CConceptProcessPriority& conceptPriority) const { return mPriority <= conceptPriority.mPriority; } bool CConceptProcessPriority::operator>=(const CConceptProcessPriority& conceptPriority) const { return mPriority >= conceptPriority.mPriority; } bool CConceptProcessPriority::operator<(const CConceptProcessPriority& conceptPriority) const { return mPriority < conceptPriority.mPriority; } bool CConceptProcessPriority::operator>(const CConceptProcessPriority& conceptPriority) const { return mPriority > conceptPriority.mPriority; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeDateTimeValueSpaceMap.cpp0000644000175000017500000001106412520551110031276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeDateTimeValueSpaceMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeDateTimeValueSpaceMap::CDatatypeDateTimeValueSpaceMap(CProcessContext* processContext) : CDatatypeCompareValueSpaceMap(processContext) { } CDatatypeDateTimeValueSpaceMap* CDatatypeDateTimeValueSpaceMap::initDatatypeDateTimeValueSpaceMap(CDatatypeValueSpaceDateTimeType* valueSpaceType) { CPROCESSMAP::clear(); mAbsoluteMinimumExclusionValue = nullptr; mAbsoluteMaximumExclusionValue = nullptr; excludeMinimum(valueSpaceType->getMinimumDataLiteralDateTimeValue(),true,nullptr); excludeMaximum(valueSpaceType->getMaximumDataLiteralDateTimeValue(),true,nullptr); return this; } bool CDatatypeDateTimeValueSpaceMap::representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { CDataLiteralDateTimeValue* dateTimeLeftValue = dynamic_cast(leftValueExcluded); CDataLiteralDateTimeValue* dateTimeRightValue = dynamic_cast(rightValueExcluded); if (dateTimeLeftValue->isFirstDateTime()) { return true; } if (dateTimeRightValue->isLastDateTime()) { return true; } return false; } bool CDatatypeDateTimeValueSpaceMap::representsInfinitelyManyValues(CDataLiteralCompareValue* value) { return false; } bool CDatatypeDateTimeValueSpaceMap::getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom) { CDataLiteralDateTimeValue* dateTimeValueCopyInto = dynamic_cast(valueCopyInto); CDataLiteralDateTimeValue* dateTimeValueCopyFrom = dynamic_cast(valueCopyFrom); dateTimeValueCopyInto->initValue(dateTimeValueCopyFrom); return true; } bool CDatatypeDateTimeValueSpaceMap::getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast) { CDataLiteralDateTimeValue* dateTimeValueNext = dynamic_cast(valueNext); CDataLiteralDateTimeValue* dateTimeValueLast = dynamic_cast(valueLast); dateTimeValueNext->initValue(dateTimeValueLast); dateTimeValueNext->incrementDateTimeValue(); return true; } cuint64 CDatatypeDateTimeValueSpaceMap::getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { CDataLiteralDateTimeValue* dateTimeLeftValue = dynamic_cast(leftValueExcluded); CDataLiteralDateTimeValue* dateTimeRightValue = dynamic_cast(rightValueExcluded); cuint64 valueCount = 0; QDateTime leftValueDateTime = dateTimeLeftValue->getDateTimeValue(); QDateTime rightValueDateTime = dateTimeRightValue->getDateTimeValue(); cuint64 secondsBetween = leftValueDateTime.secsTo(rightValueDateTime)-1; if (secondsBetween < 0) { secondsBetween = 0; valueCount += dateTimeRightValue->getTimeZoneOffset()-dateTimeLeftValue->getTimeZoneOffset()-1; } else if (secondsBetween >= 0) { if (dateTimeLeftValue->getTimeZoneOffset() < 840) { valueCount += 840-dateTimeLeftValue->getTimeZoneOffset()-1; } if (dateTimeRightValue->getTimeZoneOffset() > -840) { valueCount += dateTimeRightValue->getTimeZoneOffset()+840-1; } if (secondsBetween > 0) { secondsBetween--; } } valueCount = secondsBetween*(840*2-1); return valueCount; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CDatatypeBinaryDataValueSpaceMap.cpp0000644000175000017500000000712212520551106031625 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeBinaryDataValueSpaceMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CDatatypeBinaryDataValueSpaceMap::CDatatypeBinaryDataValueSpaceMap(CProcessContext* processContext) : CDatatypeCompareValueSpaceMap(processContext) { } bool CDatatypeBinaryDataValueSpaceMap::representsInfinitelyManyValues(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { CDataLiteralBinaryDataValue* binaryDataLeftValue = dynamic_cast(leftValueExcluded); CDataLiteralBinaryDataValue* binaryDataRightValue = dynamic_cast(rightValueExcluded); if (binaryDataRightValue->getLength() >= 7) { return true; } return false; } bool CDatatypeBinaryDataValueSpaceMap::representsInfinitelyManyValues(CDataLiteralCompareValue* value) { CDataLiteralBinaryDataValue* binaryDataValue = dynamic_cast(value); if (binaryDataValue) { return binaryDataValue->isInfiniteLength(); } return false; } bool CDatatypeBinaryDataValueSpaceMap::getValueCopy(CDataLiteralCompareValue* valueCopyInto, CDataLiteralCompareValue* valueCopyFrom) { CDataLiteralBinaryDataValue* binaryDataValueCopyInto = dynamic_cast(valueCopyInto); CDataLiteralBinaryDataValue* binaryDataValueCopyFrom = dynamic_cast(valueCopyFrom); binaryDataValueCopyInto->initValue(binaryDataValueCopyFrom); return true; } bool CDatatypeBinaryDataValueSpaceMap::getValueNext(CDataLiteralCompareValue* valueNext, CDataLiteralCompareValue* valueLast) { CDataLiteralBinaryDataValue* binaryDataValueNext = dynamic_cast(valueNext); CDataLiteralBinaryDataValue* binaryDataValueLast = dynamic_cast(valueLast); binaryDataValueNext->initValue(binaryDataValueLast); binaryDataValueNext->incrementBinaryData(); return true; } cuint64 CDatatypeBinaryDataValueSpaceMap::getIntervalValueCount(CDataLiteralCompareValue* leftValueExcluded, CDataLiteralCompareValue* rightValueExcluded) { CDataLiteralBinaryDataValue* binaryDataLeftValue = dynamic_cast(leftValueExcluded); CDataLiteralBinaryDataValue* binaryDataRightValue = dynamic_cast(rightValueExcluded); cuint64 valueCount = 0; cuint64 leftValueID = binaryDataLeftValue->getBinaryDataID(); cuint64 rightValueID = binaryDataRightValue->getBinaryDataID(); valueCount = rightValueID - leftValueID; return valueCount; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingTriggerData.cpp0000644000175000017500000000425012520551164030645 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingTriggerData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingTriggerData::CVariableBindingTriggerData() { mVarBindTriggerLinker = nullptr; mTriggered = false; } bool CVariableBindingTriggerData::isTriggered() { return mTriggered; } CVariableBindingTriggerLinker* CVariableBindingTriggerData::getVariableBindingTriggerLinker() { return mVarBindTriggerLinker; } CVariableBindingTriggerData* CVariableBindingTriggerData::setTriggered(bool triggered) { mTriggered = triggered; return this; } CVariableBindingTriggerData* CVariableBindingTriggerData::setVariableBindingTriggerLinker(CVariableBindingTriggerLinker* varBindTriggerLinker) { mVarBindTriggerLinker = varBindTriggerLinker; return this; } CVariableBindingTriggerData* CVariableBindingTriggerData::addVariableBindingTriggerLinker(CVariableBindingTriggerLinker* varBindTriggerLinker) { mVarBindTriggerLinker = varBindTriggerLinker->append(mVarBindTriggerLinker); return this; } CVariableBindingTriggerData* CVariableBindingTriggerData::clearVariableBindingTriggerLinker() { mVarBindTriggerLinker = nullptr; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualNodeBlockingTestData.h0000644000175000017500000000657412520551122031162 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_BLOCKER_CINDIVIDUALNODEBLOCKINGTESTDATA_H #define KONCLUDE_REASONER_KERNEL_BLOCKER_CINDIVIDUALNODEBLOCKINGTESTDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualNodeBlockData.h" #include "CNodeSwitchTag.h" #include "CConceptDescriptor.h" #include "CIndividualProcessNode.h" #include "CConceptLabelSetModificationTag.h" #include "CCoreConceptDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CIndividualNodeBlockingTestData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeBlockingTestData : public CIndividualNodeBlockData, public CNodeSwitchTag, public CConceptLabelSetModificationTag { // public methods public: //! Constructor CIndividualNodeBlockingTestData(); //! Destructor virtual ~CIndividualNodeBlockingTestData(); CIndividualNodeBlockingTestData* initBlockData(CIndividualNodeBlockingTestData* prevBlockData); CIndividualProcessNode* getBlockingIndividualNode(); CIndividualNodeBlockingTestData* clearBlockingIndividualNode(); CIndividualNodeBlockingTestData* setBlockingIndividualNode(CIndividualProcessNode* blockingIndividualNode); CConceptDescriptor* getLastCoreBlockingCandidateConceptDescriptor(); CIndividualNodeBlockingTestData* setLastCoreBlockingCandidateConceptDescriptor(CConceptDescriptor* lastCoreBlockCandConDes); cint64 getLastCoreBlockingCandidateConceptNodeDifference(); CIndividualNodeBlockingTestData* setLastCoreBlockingCandidateConceptNodeDifference(cint64 diffCount); CCoreConceptDescriptor* getLastAddedCoreConceptDescriptor(); CIndividualNodeBlockingTestData* setLastAddedCoreConceptDescriptor(CCoreConceptDescriptor* lastCoreConDes); // protected methods protected: // protected variables protected: //CConceptDescriptor* mConceptDes; //cint64 mFirstEntailedAncestorDepth; CIndividualProcessNode* mBlockingIndiNode; CConceptDescriptor* mLastCoreBlockCandConDes; CCoreConceptDescriptor* mLastAddedCoreConDes; cint64 mLastCoreBlockCandNodeDiff; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_BLOCKER_CINDIVIDUALNODEBLOCKINGTESTDATA_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetHashData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetH0000644000175000017500000000432212520551146032270 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CRepresentativeVariableBindingPathSetData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathSetHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathSetHashData { // public methods public: //! Constructor CRepresentativeVariableBindingPathSetHashData(); CRepresentativeVariableBindingPathSetHashData(const CRepresentativeVariableBindingPathSetHashData& data); CRepresentativeVariableBindingPathSetData* mUseDataLinker; CRepresentativeVariableBindingPathSetData* mLocDataLinker; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHSETHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CCriticalSaturationConceptQueue.cpp0000644000175000017500000000441512520551106031633 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCriticalSaturationConceptQueue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CCriticalSaturationConceptQueue::CCriticalSaturationConceptQueue(CProcessContext* context) : mContext(context) { } CCriticalSaturationConceptQueue* CCriticalSaturationConceptQueue::initCriticalSaturationConceptQueue(CIndividualSaturationProcessNode* indiNode) { mCriticalConDesLinker = nullptr; return this; } CConceptSaturationProcessLinker* CCriticalSaturationConceptQueue::takeNextCriticalConceptDescriptor() { CConceptSaturationProcessLinker* tmpConDesLinker = mCriticalConDesLinker; if (mCriticalConDesLinker) { mCriticalConDesLinker = mCriticalConDesLinker->getNext(); tmpConDesLinker->clearNext(); } return tmpConDesLinker; } bool CCriticalSaturationConceptQueue::hasCriticalConceptDescriptorLinker() { return mCriticalConDesLinker != nullptr; } CConceptSaturationProcessLinker* CCriticalSaturationConceptQueue::getCriticalConceptDescriptorLinker() { return mCriticalConDesLinker; } CCriticalSaturationConceptQueue* CCriticalSaturationConceptQueue::addCriticalConceptDescriptorLinker(CConceptSaturationProcessLinker* conDesProcLinker) { mCriticalConDesLinker = conDesProcLinker->append(mCriticalConDesLinker); return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualDepthConceptProcessDescriptorProcessingQueue.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CIndividualDepthConceptProcessDescript0000644000175000017500000001011112520551120032335 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualDepthConceptProcessDescriptorProcessingQueue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CIndividualDepthConceptProcessDescriptorProcessingQueue::CIndividualDepthConceptProcessDescriptorProcessingQueue(CProcessContext* processContext) : mProcessContext(processContext),mPriorityIndiDesMap(processContext) { } CIndividualDepthConceptProcessDescriptorProcessingQueue* CIndividualDepthConceptProcessDescriptorProcessingQueue::initProcessingQueue(CIndividualDepthConceptProcessDescriptorProcessingQueue* processingQueue) { if (processingQueue) { mPriorityIndiDesMap = processingQueue->mPriorityIndiDesMap; } else { mPriorityIndiDesMap.clear(); } return this; } bool CIndividualDepthConceptProcessDescriptorProcessingQueue::takeNextProcessIndiviudalConceptProcessDescriptor(CIndividualProcessNode*& nextNode, CConceptProcessDescriptor*& conProDes) { if (!mPriorityIndiDesMap.isEmpty()) { CPROCESSMAP::iterator it = mPriorityIndiDesMap.begin(); nextNode = it.value().mIndiNode; conProDes = it.value().mConProDes; it = mPriorityIndiDesMap.erase(it); return true; } return false; } CIndividualDepthConceptProcessDescriptorProcessingQueue* CIndividualDepthConceptProcessDescriptorProcessingQueue::insertProcessIndiviudalConceptProcessDescriptor(CIndividualProcessNode* individual, CConceptProcessDescriptor* conProDes) { CIndividualDepthPriority priority(individual->getIndividualNominalLevelOrAncestorDepth(),individual->getIndividualID()); mPriorityIndiDesMap.insert(priority,CIndividualDepthConceptProcessDescriptorProcessingQueueData(conProDes,individual)); return this; } CIndividualDepthConceptProcessDescriptorProcessingQueue* CIndividualDepthConceptProcessDescriptorProcessingQueue::removeQueuedProcessIndiviudal(CIndividualProcessNode* individual) { CIndividualDepthPriority priority(individual->getIndividualNominalLevelOrAncestorDepth(),individual->getIndividualID()); mPriorityIndiDesMap.remove(priority); return this; } bool CIndividualDepthConceptProcessDescriptorProcessingQueue::isEmpty() { return mPriorityIndiDesMap.count() <= 0; } cint64 CIndividualDepthConceptProcessDescriptorProcessingQueue::getQueuedIndividualCount() { return mPriorityIndiDesMap.count(); } bool CIndividualDepthConceptProcessDescriptorProcessingQueue::hasQueuedIndividuals() { return mPriorityIndiDesMap.count() > 0; } bool CIndividualDepthConceptProcessDescriptorProcessingQueue::isIndividualQueued(CIndividualProcessNode *individual) { CIndividualDepthPriority priority(individual->getIndividualNominalLevelOrAncestorDepth(),individual->getIndividualID()); return mPriorityIndiDesMap.contains(priority); } CPROCESSMAP* CIndividualDepthConceptProcessDescriptorProcessingQueue::getIndividualDepthConceptProcessDescriptorProcessingQueue() { return &mPriorityIndiDesMap; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CProcessingDataBox.h0000644000175000017500000007725512520551134026547 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGDATABOX_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGDATABOX_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessingQueue.h" #include "CIndividualProcessNodeVector.h" #include "CSignatureBlockingCandidateHash.h" #include "CBlockingIndividualNodeCandidateHash.h" #include "CNodeSwitchHistory.h" #include "CSignatureBlockingReviewSet.h" #include "CIndividualUnsortedProcessingQueue.h" #include "CIndividualDepthProcessingQueue.h" #include "CReusingReviewData.h" #include "CBlockingIndividualNodeLinkedCandidateHash.h" #include "CConceptNominalSchemaGroundingHash.h" #include "CVariableBindingPathMergingHash.h" #include "CIndividualConceptBatchProcessingQueue.h" #include "CRepresentativeVariableBindingPathSetHash.h" #include "CRepresentativeVariableBindingPathHash.h" #include "CRepresentativeVariableBindingPathJoiningKeyHash.h" #include "CRepresentativeJoiningHash.h" #include "CIndividualReactivationProcessingQueue.h" #include "CIndividualSaturationProcessNodeLinker.h" #include "CIndividualSaturationProcessNodeVector.h" #include "CIndividualSaturationProcessNode.h" #include "CIndividualSaturationProcessNodeStatusUpdateLinker.h" #include "CCriticalIndividualNodeProcessingQueue.h" #include "CCriticalIndividualNodeConceptTestSet.h" #include "CSaturationSuccessorExtensionIndividualNodeProcessingQueue.h" #include "CSaturationNominalDependentNodeHash.h" #include "CSaturationInfluencedNominalSet.h" #include "CNominalCachingLossReactivationHash.h" #include "CMarkerIndividualNodeHash.h" #include "CIndividualCustomPriorityProcessingQueue.h" #include "CReferredIndividualTrackingVector.h" #include "CIndividualSaturationSuccessorLinkDataLinker.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Kernel/Process/Dependency/CBranchingTree.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { using namespace Dependency; /*! * * \class CProcessingDataBox * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessingDataBox { // public methods public: //! Constructor CProcessingDataBox(CProcessContext* processContext = nullptr); CProcessingDataBox* initProcessingDataBox(CConcreteOntology* ontology); CProcessingDataBox* initProcessingDataBox(CProcessingDataBox* processingDataBox); bool hasClashedDescriptorLinker(); CClashedDependencyDescriptor* getClashedDescriptorLinker(); CProcessingDataBox* setClashedDescriptorLinker(CClashedDependencyDescriptor* clashDesLinker); CIndividualProcessingQueue* getIndividualProcessingQueue(bool create = true); CProcessingDataBox* clearIndividualProcessingQueue(); CIndividualProcessNodeVector* getIndividualProcessNodeVector(); CProcessingDataBox* setIndividualProcessNodeVector(CIndividualProcessNodeVector* indiNodeVec); CProcessingDataBox* clearIndividualProcessingQueues(); CIndividualUnsortedProcessingQueue* getRoleAssertionProcessingQueue(bool create = true); CProcessingDataBox* clearRoleAssertionProcessingQueue(); CIndividualUnsortedProcessingQueue* getBackendCacheSynchronizationProcessingQueue(bool create = true); CProcessingDataBox* clearBackendCacheSynchronizationProcessingQueue(); CIndividualUnsortedProcessingQueue* getDelayingNominalProcessingQueue(bool create = true); CProcessingDataBox* clearDelayingNominalProcessingQueue(); CIndividualUnsortedProcessingQueue* getNominalCachingLossReactivationProcessingQueue(bool create = true); CProcessingDataBox* clearNominalCachingLossReactivationProcessingQueue(); CIndividualUnsortedProcessingQueue* getIndividualDepthFirstProcessingQueue(bool create = true); CProcessingDataBox* clearIndividualDepthFirstProcessingQueue(); CIndividualUnsortedProcessingQueue* getIndividualImmediatelyProcessingQueue(bool create = true); CProcessingDataBox* clearIndividualImmediatelyProcessingQueue(); CIndividualConceptBatchProcessingQueue* getVariableBindingConceptBatchProcessingQueue(bool create = true); CProcessingDataBox* clearVariableBindingConceptBatchProcessingQueue(); CIndividualDepthProcessingQueue* getIndividualDepthProcessingQueue(bool create = true); CProcessingDataBox* clearIndividualDepthProcessingQueue(); CIndividualDepthProcessingQueue* getNominalProcessingQueue(bool create = true); CProcessingDataBox* clearNominalProcessingQueue(); CIndividualUnsortedProcessingQueue* getIndividualDepthFirstDeterministicExpansionProcessingQueue(bool create = true); CProcessingDataBox* clearIndividualDepthFirstDeterministicExpansionProcessingQueue(); CIndividualDepthProcessingQueue* getIndividualDepthDeterministicExpansionPreprocessingQueue(bool create = true); CProcessingDataBox* clearIndividualDepthDeterministicExpansionPreprocessingQueue(); CIndividualDepthProcessingQueue* getBlockingUpdateReviewProcessingQueue(bool create = true); CProcessingDataBox* clearBlockingUpdateReviewProcessingQueue(); CIndividualDepthProcessingQueue* getBlockedReactivationProcessingQueue(bool create = true); CProcessingDataBox* clearBlockedReactivationProcessingQueue(); CIndividualDepthProcessingQueue* getValueSpaceTriggeringProcessingQueue(bool create = true); CProcessingDataBox* clearValueSpaceTriggeringProcessingQueue(); CIndividualDepthProcessingQueue* getDistinctValueSpaceSatisfiabilityCheckingQueue(bool create = true); CProcessingDataBox* clearDistinctValueSpaceSatisfiabilityCheckingQueue(); CIndividualDepthProcessingQueue* getIncrementalExpansionInitializingProcessingQueue(bool create = true); CProcessingDataBox* clearIncrementalExpansionInitializingProcessingQueue(); CIndividualCustomPriorityProcessingQueue* getIncrementalExpansionProcessingQueue(bool create = true); CProcessingDataBox* clearIncrementalExpansionIProcessingQueue(); CIndividualDepthProcessingQueue* getIncrementalCompatibilityCheckingQueue(bool create = true); CProcessingDataBox* clearIncrementalCompatibilityCheckingQueue(); CConcept* getOntologyTopConcept(); CConcept* getOntologyTopDataRangeConcept(); CConcreteOntology* getOntology(); CSignatureBlockingCandidateHash* getSignatureNominalDelayingCandidateHash(bool create = true); CProcessingDataBox* setSignatureBlockingCandidateHash(CSignatureBlockingCandidateHash* signatureHash); CSignatureBlockingCandidateHash* getSignatureBlockingCandidateHash(bool create = true); CBlockingIndividualNodeCandidateHash* getBlockingIndividualNodeCandidateHash(bool create = true); CBlockingIndividualNodeLinkedCandidateHash* getBlockingIndividualNodeLinkedCandidateHash(bool create = true); CSignatureBlockingReviewSet* getSignatureBlockingReviewSet(bool create = true); CProcessingDataBox* clearSignatureBlockingReviewSet(); CIndividualReactivationProcessingQueue* getEarlyIndividualReactivationProcessingQueue(bool create = true); CProcessingDataBox* clearEarlyIndividualReactivationProcessingQueue(); CIndividualReactivationProcessingQueue* getLateIndividualReactivationProcessingQueue(bool create = true); CProcessingDataBox* clearLateIndividualReactivationProcessingQueue(); CReusingReviewData* getReusingReviewData(bool create = true); CProcessingDataBox* clearReusingReviewData(); CNodeSwitchHistory* getNodeSwitchHistory(bool create = true); CBranchingTree* getBranchingTree(bool create = true); CIndividualProcessNode* takeNextCacheTestingIndividualNode(); bool hasCacheTestingIndividualNodes(); CXLinker* takeIndividualNodeCacheTestingLinker(); CProcessingDataBox* addIndividualNodeCacheTestingLinker(CXLinker* linker); CXLinker* getSortedNominalNonDeterministicProcessingNodeLinker(); CIndividualProcessNode* takeSortedNominalNonDeterministicProcessingNode(); bool hasSortedNominalNonDeterministicProcessingNodes(); CXLinker* takeSortedNominalNonDeterministicProcessingNodeLinker(); CProcessingDataBox* addSortedNominalNonDeterministicProcessingNodeLinker(CXLinker* linker); CProcessingDataBox* setSortedNominalNonDeterministicProcessingNodeLinker(CXLinker* linker); CProcessingDataBox* clearSortedNominalNonDeterministicProcessingNodeLinker(); bool hasNominalNonDeterministicProcessingNodesSorted(); CProcessingDataBox* setNominalNonDeterministicProcessingNodesSorted(bool sorted); CXLinker* takeNextIndividualNodeBlockedResolveLinker(); CProcessingDataBox* addIndividualNodeBlockedResolveLinker(CXLinker* linker); bool hasBlockedResolveIndividualNodes(); CProcessingDataBox* clearBlockedResolveIndividualNodes(); CXLinker* getBlockableIndividualNodeUpdatedLinker(); CProcessingDataBox* addBlockableIndividualNodeUpdatedLinker(CXLinker* linker); bool hasBlockableIndividualNodeUpdatedLinker(); CProcessingDataBox* clearBlockableIndividualNodeUpdatedLinker(); CProcessingDataBox* setMultipleConstructionIndividualNodes(bool multiple); bool hasMultipleConstructionIndividualNodes(); CIndividualProcessNode* getConstructedIndividualNode(); CProcessingDataBox* setConstructedIndividualNode(CIndividualProcessNode* indiNode); bool hasConstructedIndividualNodeInitialized(); CProcessingDataBox* setConstructedIndividualNodeInitialized(bool initialized); CProcessContext* getProcessContext(); CProcessingDataBox* setLastProcessingIndividualNodeAndConceptDescriptor(CIndividualProcessNode* indiNode, CConceptProcessDescriptor* conDes); bool getLastProcessingIndividualNodeAndConceptDescriptor(CIndividualProcessNode*& indiNode, CConceptProcessDescriptor*& conDes); bool hasLastProcessingIndividualNodeAndConceptDescriptor(); bool isReapplicationLastConceptDesciptorOnLastIndividualNodeRequired(); CProcessingDataBox* setReapplicationLastConceptDesciptorOnLastIndividualNodeRequired(bool requiresReapplication); CIndividualProcessNodeLinker* getIndividualProcessNodeLinker(); CIndividualProcessNodeLinker* takeIndividualProcessNodeLinker(); CProcessingDataBox* setIndividualProcessNodeLinker(CIndividualProcessNodeLinker* indiProcessNodeLinker); CProcessingDataBox* addIndividualProcessNodeLinker(CIndividualProcessNodeLinker* indiProcessNodeLinker); CIndividualSaturationProcessNodeVector* getIndividualSaturationProcessNodeVector(bool create = true); bool hasIndividualSaturationProcessNodeLinker(); CIndividualSaturationProcessNodeLinker* getIndividualSaturationProcessNodeLinker(); CIndividualSaturationProcessNodeLinker* takeIndividualSaturationProcessNodeLinker(); CProcessingDataBox* setIndividualSaturationProcessNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker); CProcessingDataBox* addIndividualSaturationProcessNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker); bool hasIndividualDisjunctCommonConceptExtractProcessLinker(); CIndividualSaturationProcessNodeLinker* getIndividualDisjunctCommonConceptExtractProcessLinker(); CIndividualSaturationProcessNodeLinker* takeIndividualDisjunctCommonConceptExtractProcessLinker(); CProcessingDataBox* setIndividualDisjunctCommonConceptExtractProcessLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker); CProcessingDataBox* addIndividualDisjunctCommonConceptExtractProcessLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker); CIndividualSaturationProcessNodeLinker* getRemainingIndividualSaturationNodeLinker(); CIndividualSaturationProcessNodeLinker* takeRemainingIndividualSaturationNodeLinker(); CProcessingDataBox* setRemainingIndividualSaturationProcessNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker); CProcessingDataBox* addRemainingIndividualSaturationNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker); CIndividualSaturationSuccessorLinkDataLinker* getRemainingIndividualSuccessorLinkDataLinker(); CIndividualSaturationSuccessorLinkDataLinker* takeRemainingIndividualSuccessorLinkDataLinker(); CProcessingDataBox* setRemainingIndividualSuccessorLinkDataLinker(CIndividualSaturationSuccessorLinkDataLinker* succLinkDataLinker); CProcessingDataBox* addRemainingIndividualSuccessorLinkDataLinker(CIndividualSaturationSuccessorLinkDataLinker* succLinkDataLinker); CConceptSaturationProcessLinker* getRemainingConceptSaturationProcessLinker(); CConceptSaturationProcessLinker* takeRemainingConceptSaturationProcessLinker(); CProcessingDataBox* setRemainingConceptSaturationProcessLinker(CConceptSaturationProcessLinker* conPilProcessLinker); CProcessingDataBox* addRemainingConceptSaturationProcessLinker(CConceptSaturationProcessLinker* conPilProcessLinker); CConceptSaturationDescriptor* getRemainingConceptSaturationDescriptor(); CConceptSaturationDescriptor* takeRemainingConceptSaturationDescriptor(); CProcessingDataBox* setRemainingConceptSaturationDescriptor(CConceptSaturationDescriptor* conPilDes); CProcessingDataBox* addRemainingConceptSaturationDescriptor(CConceptSaturationDescriptor* conPilDes); CRoleSaturationProcessLinker* getRemainingRoleSaturationProcessLinker(); CRoleSaturationProcessLinker* takeRemainingRoleSaturationProcessLinker(); CProcessingDataBox* setRemainingRoleSaturationProcessLinker(CRoleSaturationProcessLinker* roleProcessLinker); CProcessingDataBox* addRemainingRoleSaturationProcessLinker(CRoleSaturationProcessLinker* roleProcessLinker); CIndividualSaturationProcessNodeStatusUpdateLinker* getRemainingIndividualSaturationUpdateLinker(); CIndividualSaturationProcessNodeStatusUpdateLinker* takeRemainingIndividualSaturationUpdateLinker(); CProcessingDataBox* setRemainingIndividualSaturationUpdateLinker(CIndividualSaturationProcessNodeStatusUpdateLinker* indiSaturationUpdateLinker); CProcessingDataBox* addRemainingIndividualSaturationUpdateLinker(CIndividualSaturationProcessNodeStatusUpdateLinker* indiSaturationUpdateLinker); CSaturationSuccessorExtensionIndividualNodeProcessingQueue* getSaturationSucessorExtensionIndividualNodeProcessingQueue(bool create = true); CCriticalIndividualNodeProcessingQueue* getSaturationCriticalIndividualNodeProcessingQueue(bool create = true); CCriticalIndividualNodeConceptTestSet* getSaturationCriticalIndividualNodeConceptTestSet(bool create = true); CSaturationNominalDependentNodeHash* getSaturationNominalDependentNodeHash(bool create = true); CSaturationInfluencedNominalSet* getSaturationInfluencedNominalSet(bool create = true); bool hasIndividualSaturationCompletionNodeLinker(); CIndividualSaturationProcessNodeLinker* getIndividualSaturationCompletionNodeLinker(); CIndividualSaturationProcessNodeLinker* takeIndividualSaturationCompletionNodeLinker(); CProcessingDataBox* setIndividualSaturationCompletionNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker); CProcessingDataBox* addIndividualSaturationCompletionNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker); bool hasIndividualSaturationAnalysationNodeLinker(); CIndividualSaturationProcessNodeLinker* getIndividualSaturationAnalysationNodeLinker(); CIndividualSaturationProcessNodeLinker* takeIndividualSaturationAnalysationNodeLinker(); CProcessingDataBox* setIndividualSaturationAnalysationNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker); CProcessingDataBox* addIndividualSaturationAnalysationNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker); bool hasNominalDelayedIndividualSaturationProcessNodeLinker(); CIndividualSaturationProcessNodeLinker* getNominalDelayedIndividualSaturationProcessNodeLinker(); CIndividualSaturationProcessNodeLinker* takeNominalDelayedIndividualSaturationProcessNodeLinker(); CProcessingDataBox* setNominalDelayedIndividualSaturationProcessNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker); CProcessingDataBox* addNominalDelayedIndividualSaturationProcessNodeLinker(CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker); CIndividualSaturationProcessNode* getSeparatedSaturationConceptAssertionResolveNode(); CProcessingDataBox* setSeparatedSaturationConceptAssertionResolveNode(CIndividualSaturationProcessNode* node); bool isInsufficientNodeOccured(); CProcessingDataBox* setInsufficientNodeOccured(bool insufficientNodeOccured); bool isDelayedNominalProcessingOccured(); CProcessingDataBox* setDelayedNominalProcessingOccured(bool delayedNominalProcessingOccured); bool isProblematicEQCandidateOccured(); CProcessingDataBox* setProblematicEQCandidateOccured(bool problematicNodeOccured); CProcessingDataBox* setMaximumDeterministicBranchTag(cint64 branchTag); cint64 getMaximumDeterministicBranchTag(); cint64 getNextSaturationResolvedSuccessorExtensionIndividualNodeID(bool incremetNextID = true); cint64 getNextIndividualNodeID(bool incremetNextID = true); CProcessingDataBox* setFirstPossibleIndividualNodeID(cint64 indiID); cint64 getNextBindingPropagationID(bool incremetNextID = true); cint64 getNextVariableBindingPathID(bool incremetNextID = true); cint64 getNextRepresentativeVariableBindingPathID(bool incremetNextID = true); CConceptVector* getExtendedConceptVector(bool forceLocalisation = true); CConceptNominalSchemaGroundingHash* getConceptNominalSchemaGroundingHash(bool forceLocalisation = true); CVariableBindingPathMergingHash* getVariableBindingPathMergingHash(bool forceLocalisation = true); CRepresentativeVariableBindingPathSetHash* getRepresentativeVariableBindingPathSetHash(bool forceLocalisation = true); CRepresentativeVariableBindingPathHash* getRepresentativeVariableBindingPathHash(bool forceLocalisation = true); CRepresentativeVariableBindingPathJoiningKeyHash* getRepresentativeVariableBindingPathJoiningKeyHash(bool forceLocalisation = true); CRepresentativeJoiningHash* getRepresentativeJoiningHash(bool forceLocalisation = true); CNominalCachingLossReactivationHash* getNominalCachingLossReactivationHash(bool createOrForceLocalisation = true); CMarkerIndividualNodeHash* getMarkerIndividualNodeHash(bool createOrForceLocalisation = true); bool isIncrementalExpansionInitialised(); CProcessingDataBox* setIncrementalExpansionInitialised(bool initialized); cint64 getIncrementalExpansionID(); CProcessingDataBox* setIncrementalExpansionID(cint64 incExpID); cint64 getMaxIncrementalPreviousCompletionGraphNodeID(); CProcessingDataBox* setMaxIncrementalPreviousCompletionGraphNodeID(cint64 nodeID); cint64 getNextIncrementalIndividualExpansionID(bool incrementNextID = true); bool isIncrementalExpansionCompatibleMerged(); CProcessingDataBox* setIncrementalExpansionCompatibleMerged(bool compatibleMerged); bool isIncrementalExpansionCachingMerged(); CProcessingDataBox* setIncrementalExpansionCachingMerged(bool cachingMerged); cint64 getNextRoleAssertionCreationID(bool incrementNextID = true); CReferredIndividualTrackingVector* getReferredIndividualTrackingVector(); CProcessingDataBox* setReferredIndividualTrackingVector(CReferredIndividualTrackingVector* refIndiTrackVec); bool isIndividualDependenceTrackingRequired(); CProcessingDataBox* setIndividualDependenceTrackingRequired(bool indiDepTrackingRequired); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; CConcept* mOntologyTopConcept; CConcept* mOntologyTopDataRangeConcept; CConcreteOntology* mOntology; CClashedDependencyDescriptor* mClashedDescriptorLinker; CIndividualProcessingQueue* mUseIndiProcessQueue; CIndividualProcessingQueue* mLocIndiProcessQueue; CIndividualProcessNodeVector* mIndiProcessVector; CIndividualUnsortedProcessingQueue* mIndiImmProcessQueue; CIndividualUnsortedProcessingQueue* mUseIndiImmProcessQueue; CIndividualUnsortedProcessingQueue* mPrevIndiImmProcessQueue; CIndividualUnsortedProcessingQueue* mDelayNomProcessQueue; CIndividualUnsortedProcessingQueue* mUseDelayNomProcessQueue; CIndividualUnsortedProcessingQueue* mPrevDelayNomProcessQueue; CIndividualUnsortedProcessingQueue* mRoleAssertionProcessQueue; CIndividualUnsortedProcessingQueue* mUseRoleAssertionProcessQueue; CIndividualUnsortedProcessingQueue* mPrevRoleAssertionProcessQueue; CIndividualUnsortedProcessingQueue* mBackendSyncRetestProcessQueue; CIndividualUnsortedProcessingQueue* mUseBackendSyncRetestProcessQueue; CIndividualUnsortedProcessingQueue* mPrevBackendSyncRetestProcessQueue; CIndividualDepthProcessingQueue* mIndiDepthDetExpPreProcessingQueue; CIndividualDepthProcessingQueue* mUseIndiDepthDetExpPreProcessingQueue; CIndividualDepthProcessingQueue* mPrevIndiDepthDetExpPreProcessingQueue; CIndividualUnsortedProcessingQueue* mIndiDepthFirstDetExpPreProcessingQueue; CIndividualUnsortedProcessingQueue* mUseIndiDepthFirstDetExpPreProcessingQueue; CIndividualUnsortedProcessingQueue* mPrevIndiDepthFirstDetExpPreProcessingQueue; CIndividualConceptBatchProcessingQueue* mVarBindConceptBatchProcessQueue; CIndividualConceptBatchProcessingQueue* mUseVarBindConceptBatchProcessQueue; CIndividualConceptBatchProcessingQueue* mPrevVarBindConceptBatchProcessQueue; CIndividualDepthProcessingQueue* mIndiDepthProcessingQueue; CIndividualDepthProcessingQueue* mUseIndiDepthProcessingQueue; CIndividualDepthProcessingQueue* mPrevIndiDepthProcessingQueue; CIndividualDepthProcessingQueue* mNominalProcessingQueue; CIndividualDepthProcessingQueue* mUseNominalProcessingQueue; CIndividualDepthProcessingQueue* mPrevNominalProcessingQueue; CIndividualUnsortedProcessingQueue* mIndiDepthFirstProcessQueue; CIndividualUnsortedProcessingQueue* mUseIndiDepthFirstProcessQueue; CIndividualUnsortedProcessingQueue* mPrevIndiDepthFirstProcessQueue; CIndividualUnsortedProcessingQueue* mCachingLossReactivationProcessQueue; CIndividualUnsortedProcessingQueue* mUseCachingLossReactivationProcessQueue; CIndividualUnsortedProcessingQueue* mPrevCachingLossReactivationProcessQueue; CIndividualDepthProcessingQueue* mIndiSignatureBlockingUpdateProcessingQueue; CIndividualDepthProcessingQueue* mUseIndiSignatureBlockingUpdateProcessingQueue; CIndividualDepthProcessingQueue* mPrevIndiSignatureBlockingUpdateProcessingQueue; CIndividualDepthProcessingQueue* mIndiBlockedReactivationProcessingQueue; CIndividualDepthProcessingQueue* mUseIndiBlockedReactivationProcessingQueue; CIndividualDepthProcessingQueue* mPrevIndiBlockedReactivationProcessingQueue; CIndividualDepthProcessingQueue* mValueSpaceTriggeringProcessingQueue; CIndividualDepthProcessingQueue* mUseValueSpaceTriggeringProcessingQueue; CIndividualDepthProcessingQueue* mPrevValueSpaceTriggeringProcessingQueue; CIndividualDepthProcessingQueue* mDistinctValueSpaceSatisfiabilityCheckingQueue; CIndividualDepthProcessingQueue* mUseDistinctValueSpaceSatisfiabilityCheckingQueue; CIndividualDepthProcessingQueue* mPrevDistinctValueSpaceSatisfiabilityCheckingQueue; CIndividualDepthProcessingQueue* mIncrementalExansionInitializingProcessingQueue; CIndividualDepthProcessingQueue* mUseIncrementalExansionInitializingProcessingQueue; CIndividualDepthProcessingQueue* mPrevIncrementalExansionInitializingProcessingQueue; CIndividualCustomPriorityProcessingQueue* mIncrementalExansionProcessingQueue; CIndividualCustomPriorityProcessingQueue* mUseIncrementalExansionProcessingQueue; CIndividualCustomPriorityProcessingQueue* mPrevIncrementalExansionProcessingQueue; CIndividualDepthProcessingQueue* mIncrementalCompatibilityCheckingQueue; CIndividualDepthProcessingQueue* mUseIncrementalCompatibilityCheckingQueue; CIndividualDepthProcessingQueue* mPrevIncrementalCompatibilityCheckingQueue; CSignatureBlockingCandidateHash* mSignatureBlockingCandidateHash; CSignatureBlockingCandidateHash* mUseSignatureBlockingCandidateHash; CSignatureBlockingCandidateHash* mPrevSignatureBlockingCandidateHash; CSignatureBlockingReviewSet* mSignatureBlockingReviewSet; CSignatureBlockingReviewSet* mUseSignatureBlockingReviewSet; CSignatureBlockingReviewSet* mPrevSignatureBlockingReviewSet; CSignatureBlockingCandidateHash* mSignatureNominalDelayingCandidateHash; CSignatureBlockingCandidateHash* mUseSignatureNominalDelayingCandidateHash; CSignatureBlockingCandidateHash* mPrevSignatureNominalDelayingCandidateHash; CIndividualReactivationProcessingQueue* mEarlyIndiReactProQueue; CIndividualReactivationProcessingQueue* mUseEarlyIndiReactProQueue; CIndividualReactivationProcessingQueue* mPrevEarlyIndiReactProQueue; CIndividualReactivationProcessingQueue* mLateIndiReactProQueue; CIndividualReactivationProcessingQueue* mUseLateIndiReactProQueue; CIndividualReactivationProcessingQueue* mPrevLateIndiReactProQueue; CReusingReviewData* mReusingReviewSet; CReusingReviewData* mUseReusingReviewSet; CReusingReviewData* mPrevReusingReviewSet; CBlockingIndividualNodeCandidateHash* mBlockingIndiNodeCandidateHash; CBlockingIndividualNodeCandidateHash* mUseBlockingIndiNodeCandidateHash; CBlockingIndividualNodeCandidateHash* mPrevBlockingIndiNodeCandidateHash; CBlockingIndividualNodeLinkedCandidateHash* mBlockingIndiNodeLinkedCandidateHash; CBlockingIndividualNodeLinkedCandidateHash* mUseBlockingIndiNodeLinkedCandidateHash; CBlockingIndividualNodeLinkedCandidateHash* mPrevBlockingIndiNodeLinkedCandidateHash; CNodeSwitchHistory* mNodeSwitchHistory; CNodeSwitchHistory* mUseNodeSwitchHistory; CNodeSwitchHistory* mPrevNodeSwitchHistory; CBranchingTree* mBranchingTree; CBranchingTree* mUseBranchingTree; CBranchingTree* mPrevBranchingTree; CConceptVector* mLocExtendedConceptVector; CConceptVector* mUseExtendedConceptVector; CConceptNominalSchemaGroundingHash* mLocGroundingHash; CConceptNominalSchemaGroundingHash* mUseGroundingHash; bool mMultipleConstructionIndiNodes; CIndividualProcessNode* mConstructedIndiNode; bool mConstructedIndiNodeInitialized; cint64 mMaximumDeterministicBranchTag; CIndividualProcessNode* mLastProcessingIndiNode; CConceptProcessDescriptor* mLastProcessingConDes; bool mLastConDesIndiReapplication; CXLinker* mSortedNominalNonDetProcessingNodeLinker; bool mSortedNominalNonDetProcessingNodesSorted; cint64 mNominalNonDetProcessingCount; CXLinker* mIndividualNodeCacheTestingLinker; CIndividualProcessNodeLinker* mIndiProcessNodeLinker; CIndividualSaturationProcessNodeLinker* mDisjunctCommonConceptExtractProcessingLinker; CIndividualSaturationProcessNodeLinker* mIndiSaturationProcessNodeLinker; CIndividualSaturationProcessNodeLinker* mIndiSaturationCompletionNodeLinker; CIndividualSaturationProcessNodeLinker* mIndiSaturationAnalysingNodeLinker; CIndividualSaturationProcessNodeVector* mIndiSaturationProcessVector; CIndividualSaturationProcessNodeStatusUpdateLinker* mRemSatUpdateLinker; CIndividualSaturationProcessNodeLinker* mRemSatIndiNodeLinker; CIndividualSaturationSuccessorLinkDataLinker* mRemSatIndiSuccLinkDataLinker; CConceptSaturationProcessLinker* mRemConSatProcessLinker; CRoleSaturationProcessLinker* mRemRoleSatProcessLinker; CConceptSaturationDescriptor* mRemConSatDes; CCriticalIndividualNodeProcessingQueue* mSatCriticalIndiNodeProcQueue; CCriticalIndividualNodeConceptTestSet* mSatCriticalIndiNodeConTestSet; CSaturationNominalDependentNodeHash* mSatNominalDependentNodeHash; CSaturationInfluencedNominalSet* mSatInfluencedNominalSet; bool mInsufficientNodeOccured; bool mDelayedNominalProcessingOccured; bool mProblematicEQCandidateNodeOccured; CSaturationSuccessorExtensionIndividualNodeProcessingQueue* mSatSuccExtIndNodeProcQueue; CIndividualSaturationProcessNodeLinker* mNominalDelayedIndiSaturationProcessNodeLinker; CIndividualSaturationProcessNode* mSeparatedSaturationConAssResolveNode; CXLinker* mIndividualNodeResolveLinker; CXLinker* mBlockableIndividualNodeUpdatedLinker; cint64 mNextSatResSuccExtIndividualNodeID; cint64 mNextIndividualNodeID; cint64 mNextPropagationID; cint64 mNextVariableID; cint64 mNextRepVariableID; CVariableBindingPathMergingHash* mUseVarBindingPathMergingHash; CVariableBindingPathMergingHash* mLocVarBindingPathMergingHash; CRepresentativeVariableBindingPathSetHash* mUseRepVarBindPathSetHash; CRepresentativeVariableBindingPathSetHash* mLocRepVarBindPathSetHash; CRepresentativeVariableBindingPathJoiningKeyHash* mUseRepVarBindPathJoiningKeyHash; CRepresentativeVariableBindingPathJoiningKeyHash* mLocRepVarBindPathJoiningKeyHash; CRepresentativeJoiningHash* mUseRepJoiningHash; CRepresentativeJoiningHash* mLocRepJoiningHash; CRepresentativeVariableBindingPathHash* mUseRepVarBindPathHash; CRepresentativeVariableBindingPathHash* mLocRepVarBindPathHash; CNominalCachingLossReactivationHash* mUseNomCachingLossReactHash; CNominalCachingLossReactivationHash* mLocNomCachingLossReactHash; CMarkerIndividualNodeHash* mUseMarkerIndiNodeHash; CMarkerIndividualNodeHash* mLocMarkerIndiNodeHash; bool mIncrementalExpansionInitialized; cint64 mNextIncrementalIndiExpID; cint64 mIncrementalExpID; bool mIncrementalExpansionCompatibleMerged; bool mIncrementalExpansionCachingMerged; cint64 mMaxIncPrevCompGraphNodeID; cint64 mNextRoleAssertionCreationID; CReferredIndividualTrackingVector* mReferredIndiTrackVec; bool mIndiDepTrackingRequired; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROCESSINGDATABOX_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionResolveHashData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionReso0000644000175000017500000000400012520551154032414 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEEXTENSIONRESOLVEHASHDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEEXTENSIONRESOLVEHASHDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSaturationIndividualNodeExtensionResolveHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationIndividualNodeExtensionResolveHashData { // public methods public: //! Constructor CSaturationIndividualNodeExtensionResolveHashData(); CSaturationIndividualNodeExtensionResolveData* mResolveData; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEEXTENSIONRESOLVEHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CBlockingAlternativeData.cpp0000644000175000017500000000214512520551072030227 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBlockingAlternativeData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CBlockingAlternativeData::CBlockingAlternativeData() { } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptCountHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptCountH0000644000175000017500000000602212520551152032365 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONDISJUNCTCOMMONCONCEPTCOUNTHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONDISJUNCTCOMMONCONCEPTCOUNTHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CConceptSaturationDescriptor.h" #include "CSaturationDisjunctCommonConceptCountHashData.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationDisjunctCommonConceptCountHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationDisjunctCommonConceptCountHash { // public methods public: //! Constructor CSaturationDisjunctCommonConceptCountHash(CProcessContext* processContext); CSaturationDisjunctCommonConceptCountHash* initCommonConceptCountHash(); CSaturationDisjunctCommonConceptCountHash* setDisjunctCount(cint64 disjunctCount); CPROCESSHASH* getCommonConceptCountHash(); CSaturationDisjunctCommonConceptCountHashData& getCommonConceptCountData(cint64 conceptTag); CSaturationDisjunctCommonConceptCountHashData& getCommonConceptCountData(CConcept* concept); CSaturationDisjunctCommonConceptCountHashData& getCommonConceptCountData(CConceptSaturationDescriptor* conSatDes); bool incCommonConceptCountReturnMaxReached(CConceptSaturationDescriptor* conSatDes); CSaturationDisjunctCommonConceptCountHash* removeCommonConceptData(CConceptSaturationDescriptor* conSatDes); // protected methods protected: // protected variables protected: CPROCESSHASH mCommonConceptCountHash; cint64 mDisjunctCount; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONDISJUNCTCOMMONCONCEPTCOUNTHASH_H ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeFUNCTIONALConceptsExtensionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeFUNCTIONALCon0000644000175000017500000001750512520551154031727 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEFUNCTIONALCONCEPTSEXTENSIONDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEFUNCTIONALCONCEPTSEXTENSIONDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRoleSaturationProcessLinker.h" #include "CConceptSaturationProcessLinker.h" #include "CSaturationSuccessorFUNCTIONALConceptExtensionData.h" #include "CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash.h" #include "CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash.h" #include "CSaturationPredecessorFUNCTIONALConceptExtensionData.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationIndividualNodeFUNCTIONALConceptsExtensionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationIndividualNodeFUNCTIONALConceptsExtensionData { // public methods public: //! Constructor CSaturationIndividualNodeFUNCTIONALConceptsExtensionData(CProcessContext* processContext); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* initFUNCTIONALConceptsExtensionData(CIndividualSaturationProcessNode* indiProcessNode); bool isSuccessorExtensionInitialized(); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* setSuccessorExtensionInitialized(bool initialized); CRoleSaturationProcessLinker* getLinkedSuccessorAddedRoleProcessLinker(); CRoleSaturationProcessLinker* takeLinkedSuccessorAddedRoleProcessLinker(); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* addLinkedSuccessorAddedRoleProcessLinker(CRoleSaturationProcessLinker* roleProcessLinker); bool hasLinkedSuccessorAddedProcessLinkerForRole(CRole* role); CRoleSaturationProcessLinker* getFunctionalityAddedRoleProcessLinker(); CRoleSaturationProcessLinker* takeFunctionalityAddedRoleProcessLinker(); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* addFunctionalityAddedRoleProcessLinker(CRoleSaturationProcessLinker* roleProcessLinker); bool hasFunctionalityAddedProcessLinkerForRole(CRole* role); CRoleSaturationProcessLinker* getCopyingInitializingRoleProcessLinker(); CRoleSaturationProcessLinker* takeCopyingInitializingRoleProcessLinker(); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* addCopyingInitializingRoleProcessLinker(CRoleSaturationProcessLinker* roleProcessLinker); bool hasCopyingInitializingProcessLinkerForRole(CRole* role); bool isExtensionProcessingQueued(); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* setExtensionProcessingQueued(bool queued); CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash* getLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash(); CSaturationSuccessorFUNCTIONALConceptExtensionData* getSuccessorFUNCTIONALConceptsExtensionData(CRole* role, bool create = true); bool hasSuccessorExtensionProcessData(); CSaturationSuccessorFUNCTIONALConceptExtensionData* takeNextSuccessorExtensionProcessData(); CSaturationSuccessorFUNCTIONALConceptExtensionData* getSuccessorExtensionProcessDataLinker(); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* addSuccessorExtensionProcessData(CSaturationSuccessorFUNCTIONALConceptExtensionData* processData); CRoleSaturationProcessLinker* getLinkedPredecessorAddedRoleProcessLinker(); CRoleSaturationProcessLinker* takeLinkedPredecessorAddedRoleProcessLinker(); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* addLinkedPredecessorAddedRoleProcessLinker(CRoleSaturationProcessLinker* roleProcessLinker); bool hasLinkedPredecessorAddedProcessLinkerForRole(CRole* role); CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash* getPredecessorRoleFUNCTIONALConceptsExtensionHash(); CSaturationPredecessorFUNCTIONALConceptExtensionData* getPredecessorFUNCTIONALConceptsExtensionData(CRole* role, bool create = true); bool hasPredecessorExtensionProcessData(); CSaturationPredecessorFUNCTIONALConceptExtensionData* takeNextPredecessorExtensionProcessData(); CSaturationPredecessorFUNCTIONALConceptExtensionData* getPredecessorExtensionProcessDataLinker(); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* addPredecessorExtensionProcessData(CSaturationPredecessorFUNCTIONALConceptExtensionData* processData); CPROCESSHASH* getForwardingPredecessorMergedHash(bool create = true); bool hasIndividualNodeForwardingPredecessorMerged(CIndividualSaturationProcessNode* indiNode, CRole* role); bool hasIndividualNodeForwardingPredecessorMerged(CIndividualSaturationProcessNode* indiNode); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* setIndividualNodeForwardingPredecessorMerged(CIndividualSaturationProcessNode* indiNode, CRole* role); CConceptSaturationProcessLinker* getQualifiedFunctionalAtmostConceptProcessLinker(); CConceptSaturationProcessLinker* takeQualifiedFunctionalAtmostConceptProcessLinker(); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* addQualifiedFunctionalAtmostConceptProcessLinker(CConceptSaturationProcessLinker* conceptProcessLinker); bool hasQualifiedFunctionalAtmostConceptProcessLinkerForConcept(CConceptSaturationDescriptor* conDes); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; bool mSuccessorExtensionInitialized; bool mExtensionProcessingQueued; CRoleSaturationProcessLinker* mLinkedSuccessorAddedRoleProcessLinker; CRoleSaturationProcessLinker* mFunctionalityAddedRoleProcessLinker; CRoleSaturationProcessLinker* mCopyingInitializingRoleProcessLinker; CConceptSaturationProcessLinker* mQualFuncAtmostConProcessLinker; CIndividualSaturationProcessNode* mIndiProcessNode; CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash mLinkedSuccRoleFUNCTIONALConceptExtHash; CSaturationSuccessorFUNCTIONALConceptExtensionData* mSuccessorExtensionProcessLinker; CRoleSaturationProcessLinker* mLinkedPredecessorAddedRoleProcessLinker; CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash mLinkedPredRoleFUNCTIONALConceptExtHash; CSaturationPredecessorFUNCTIONALConceptExtensionData* mPredecessorExtensionProcessLinker; CPROCESSHASH* mForwardingPredMergedHash; CPROCESSSET* mQualifiedFunctionalAtmostConceptProcessSet; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEFUNCTIONALCONCEPTSEXTENSIONDATA_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptDescriptor.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptDescr0000644000175000017500000000543512520551136032343 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGREAPPLYCONCEPTDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGREAPPLYCONCEPTDESCRIPTOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" #include "CDependencyTracker.h" #include "CPropagationBinding.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CPropagationBindingReapplyConceptDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPropagationBindingReapplyConceptDescriptor : public CDependencyTracker, public CLinkerBase { // public methods public: //! Constructor CPropagationBindingReapplyConceptDescriptor(); CPropagationBindingReapplyConceptDescriptor *initReapllyDescriptor(CIndividualProcessNode* indiNode, CPropagationBinding* propBinding, CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint *depTrackPoint = nullptr); CConceptDescriptor* getConceptDescriptor(); CIndividualProcessNode* getReapllyIndividualNode(); CPropagationBinding* getPropagationBinding(); bool hasConceptDescriptor(CConceptDescriptor* conceptDescriptor); // protected methods protected: // protected variables protected: CConceptDescriptor* mConceptDes; CIndividualProcessNode* mIndiNode; CPropagationBinding* mPropBinding; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CPROPAGATIONBINDINGREAPPLYCONCEPTDESCRIPTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingMap.cpp0000644000175000017500000000275212520551136027727 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPropagationBindingMap.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CPropagationBindingMap::CPropagationBindingMap(CProcessContext* processContext) : mProcessContext(processContext),CPROCESSMAP(processContext) { } CPropagationBindingMap* CPropagationBindingMap::initPropagationBindingMap(CPropagationBindingMap* prevMap) { if (prevMap) { *this = *prevMap; } else { CPROCESSMAP::clear(); } return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CReapplyConceptSaturationLabelSet.cpp0000644000175000017500000003732112520551140032124 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReapplyConceptSaturationLabelSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CReapplyConceptSaturationLabelSet::CReapplyConceptSaturationLabelSet(CProcessContext* processContext) : mProcessContext(processContext) { } CReapplyConceptSaturationLabelSet* CReapplyConceptSaturationLabelSet::initReapplyConceptSaturationLabelSet() { mConceptDesDepHash = nullptr; mAdditionalConceptDesDepHash = nullptr; mConceptSatDesLinker = nullptr; mConceptDesDepHash = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); mConceptCount = 0; mTotelCount = 0; mModifiedUpdateLinker = nullptr; mLastNominalIndepConSatDes = nullptr; return this; } CReapplyConceptSaturationLabelSet* CReapplyConceptSaturationLabelSet::copyReapplyConceptSaturationLabelSet(CReapplyConceptSaturationLabelSet* copyConceptSaturationLabelSet, bool tryFlatLabelCopy) { mConceptCount = copyConceptSaturationLabelSet->mConceptCount; mTotelCount = copyConceptSaturationLabelSet->mTotelCount; mConceptDesDepHash = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (copyConceptSaturationLabelSet->mConceptDesDepHash->count() >= ADDITIONALCOPYSIZE || tryFlatLabelCopy && copyConceptSaturationLabelSet->mConceptDesDepHash->count() > 0) { CPROCESSHASH* tmpAdditionalConDesDepHash = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); if (copyConceptSaturationLabelSet->mAdditionalConceptDesDepHash) { if (copyConceptSaturationLabelSet->mAdditionalConceptDesDepHash->count() > copyConceptSaturationLabelSet->mConceptDesDepHash->count()) { *tmpAdditionalConDesDepHash = *copyConceptSaturationLabelSet->mAdditionalConceptDesDepHash; tmpAdditionalConDesDepHash->detach(); for (CPROCESSHASH::const_iterator it = copyConceptSaturationLabelSet->mConceptDesDepHash->constBegin(), itEnd = copyConceptSaturationLabelSet->mConceptDesDepHash->constEnd(); it != itEnd; ++it) { cint64 conTag = it.key(); const CConceptSaturationDescriptorReapplyData& conDesReapplyData(it.value()); CConceptSaturationDescriptorReapplyData& newConDesReapplyData = (*tmpAdditionalConDesDepHash)[conTag]; if (conDesReapplyData.mConSatDes) { newConDesReapplyData.mConSatDes = conDesReapplyData.mConSatDes; } if (conDesReapplyData.mImpReapplyConSatDes) { newConDesReapplyData.mImpReapplyConSatDes = conDesReapplyData.mImpReapplyConSatDes; } } } else { *tmpAdditionalConDesDepHash = *copyConceptSaturationLabelSet->mConceptDesDepHash; tmpAdditionalConDesDepHash->detach(); for (CPROCESSHASH::const_iterator it = copyConceptSaturationLabelSet->mAdditionalConceptDesDepHash->constBegin(), itEnd = copyConceptSaturationLabelSet->mAdditionalConceptDesDepHash->constEnd(); it != itEnd; ++it) { cint64 conTag = it.key(); const CConceptSaturationDescriptorReapplyData& conDesReapplyData(it.value()); CConceptSaturationDescriptorReapplyData& newConDesReapplyData = (*tmpAdditionalConDesDepHash)[conTag]; if (conDesReapplyData.mConSatDes) { newConDesReapplyData.mConSatDes = conDesReapplyData.mConSatDes; } if (conDesReapplyData.mImpReapplyConSatDes) { newConDesReapplyData.mImpReapplyConSatDes = conDesReapplyData.mImpReapplyConSatDes; } } } copyConceptSaturationLabelSet->mAdditionalConceptDesDepHash = tmpAdditionalConDesDepHash; } else { copyConceptSaturationLabelSet->mAdditionalConceptDesDepHash = copyConceptSaturationLabelSet->mConceptDesDepHash; } CPROCESSHASH* tmpNewConDesDepHash = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); copyConceptSaturationLabelSet->mConceptDesDepHash = tmpNewConDesDepHash; } *mConceptDesDepHash = *copyConceptSaturationLabelSet->mConceptDesDepHash; mConceptDesDepHash->detach(); mAdditionalConceptDesDepHash = copyConceptSaturationLabelSet->mAdditionalConceptDesDepHash; mConceptSatDesLinker = copyConceptSaturationLabelSet->mConceptSatDesLinker; mLastNominalIndepConSatDes = copyConceptSaturationLabelSet->mLastNominalIndepConSatDes; return this; } bool CReapplyConceptSaturationLabelSet::getConceptDescriptorAndReapplyQueue(CConcept* concept, CConceptSaturationDescriptor*& conSatDes, CImplicationReapplyConceptSaturationDescriptor*& impReapplyConSatDes) { return getConceptDescriptorAndReapplyQueue(concept->getConceptTag(),conSatDes,impReapplyConSatDes); } bool CReapplyConceptSaturationLabelSet::getConceptDescriptorAndReapplyQueue(cint64 conTag, CConceptSaturationDescriptor*& conSatDes, CImplicationReapplyConceptSaturationDescriptor*& impReapplyConSatDes) { CConceptSaturationDescriptorReapplyData* conDesDepData = nullptr; bool contained = mConceptDesDepHash->tryGetValuePointer(conTag,conDesDepData); if (!contained && mAdditionalConceptDesDepHash) { contained = mAdditionalConceptDesDepHash->tryGetValuePointer(conTag,conDesDepData); } if (contained) { conSatDes = conDesDepData->mConSatDes; impReapplyConSatDes = conDesDepData->mImpReapplyConSatDes; } return contained; } bool CReapplyConceptSaturationLabelSet::containsConceptOrReapllyQueue(cint64 conTag) { CConceptSaturationDescriptorReapplyData* conDesDepData = nullptr; bool contained = mConceptDesDepHash->tryGetValuePointer(conTag,conDesDepData); if (!contained && mAdditionalConceptDesDepHash) { contained = mAdditionalConceptDesDepHash->tryGetValuePointer(conTag,conDesDepData); } if (contained) { return conDesDepData->mConSatDes || conDesDepData->mImpReapplyConSatDes; } return false; } cint64 CReapplyConceptSaturationLabelSet::getConceptCount() { return mConceptCount; } cint64 CReapplyConceptSaturationLabelSet::getTotalCount() { return mTotelCount; } bool CReapplyConceptSaturationLabelSet::getConceptSaturationDescriptor(CConcept* concept, CConceptSaturationDescriptor*& conSatDes, CImplicationReapplyConceptSaturationDescriptor*& impReapplyConSatDes) { return getConceptSaturationDescriptor(concept->getConceptTag(),conSatDes,impReapplyConSatDes); } bool CReapplyConceptSaturationLabelSet::getConceptSaturationDescriptor(cint64 conTag, CConceptSaturationDescriptor*& conSatDes, CImplicationReapplyConceptSaturationDescriptor*& impReapplyConSatDes) { CConceptSaturationDescriptorReapplyData* conDesDepData = nullptr; bool contained = mConceptDesDepHash->tryGetValuePointer(conTag,conDesDepData); if (!contained && mAdditionalConceptDesDepHash) { contained = mAdditionalConceptDesDepHash->tryGetValuePointer(conTag,conDesDepData); } if (contained) { conSatDes = conDesDepData->mConSatDes; if (conSatDes) { impReapplyConSatDes = conDesDepData->mImpReapplyConSatDes; } else { impReapplyConSatDes = nullptr; } contained &= conSatDes != nullptr; } return contained; } bool CReapplyConceptSaturationLabelSet::hasConceptSaturationDescriptor(CConceptSaturationDescriptor* conSatDes) { return hasConcept(conSatDes->getConcept(),conSatDes->isNegated()); } bool CReapplyConceptSaturationLabelSet::hasConcept(CConcept* concept, bool negated) { cint64 conTag = concept->getConceptTag(); return hasConcept(conTag,negated); } bool CReapplyConceptSaturationLabelSet::hasConcept(cint64 conTag, bool negated) { CConceptSaturationDescriptorReapplyData* conDesDepData = nullptr; bool isContained = mConceptDesDepHash->tryGetValuePointer(conTag,conDesDepData); if (!isContained && mAdditionalConceptDesDepHash) { isContained = mAdditionalConceptDesDepHash->tryGetValuePointer(conTag,conDesDepData); } return isContained && conDesDepData->mConSatDes && conDesDepData->mConSatDes->isNegated() == negated; } bool CReapplyConceptSaturationLabelSet::hasConcept(CConcept* concept, bool* containsNegated) { cint64 conTag = concept->getConceptTag(); return hasConcept(conTag,containsNegated); } bool CReapplyConceptSaturationLabelSet::hasConcept(cint64 conTag, bool* containsNegated) { CConceptSaturationDescriptorReapplyData* conDesDepData = nullptr; bool isContained = mConceptDesDepHash->tryGetValuePointer(conTag,conDesDepData); if (!isContained && mAdditionalConceptDesDepHash) { isContained = mAdditionalConceptDesDepHash->tryGetValuePointer(conTag,conDesDepData); } if (isContained && containsNegated) { *containsNegated = conDesDepData->mConSatDes && conDesDepData->mConSatDes->isNegated(); } return isContained && conDesDepData->mConSatDes; } bool CReapplyConceptSaturationLabelSet::containsConcept(CConcept* concept, bool* containsNegated) { return hasConcept(concept,containsNegated); } bool CReapplyConceptSaturationLabelSet::containsConcept(CConcept* concept, bool negated) { return hasConcept(concept,negated); } bool CReapplyConceptSaturationLabelSet::containsConceptSaturationDescriptor(CConceptSaturationDescriptor* conSatDes) { return hasConceptSaturationDescriptor(conSatDes); } bool CReapplyConceptSaturationLabelSet::hasModifiedUpdateLinkers() { return mModifiedUpdateLinker != nullptr; } CSaturationModifiedProcessUpdateLinker* CReapplyConceptSaturationLabelSet::getModifiedUpdateLinker() { return mModifiedUpdateLinker; } CReapplyConceptSaturationLabelSet* CReapplyConceptSaturationLabelSet::addModifiedUpdateLinker(CSaturationModifiedProcessUpdateLinker* modUpdateLinker) { mModifiedUpdateLinker = modUpdateLinker->append(mModifiedUpdateLinker); return this; } CReapplyConceptSaturationLabelSet* CReapplyConceptSaturationLabelSet::setModifiedUpdateLinker(CSaturationModifiedProcessUpdateLinker* modUpdateLinker) { mModifiedUpdateLinker = modUpdateLinker; return this; } bool CReapplyConceptSaturationLabelSet::insertConceptReturnClashed(CConceptSaturationDescriptor* conSatDes, bool* newInsertion, CImplicationReapplyConceptSaturationDescriptor*** impReapplyConSatDesPtr) { cint64 conTag = conSatDes->getConceptTag(); CConceptSaturationDescriptorReapplyData& conDesDepData = (*mConceptDesDepHash)[conTag]; if (!conDesDepData.mConSatDes && !conDesDepData.mImpReapplyConSatDes && mAdditionalConceptDesDepHash) { CConceptSaturationDescriptorReapplyData* prevConDesDepData = nullptr; bool contained = mAdditionalConceptDesDepHash->tryGetValuePointer(conTag,prevConDesDepData); if (contained && prevConDesDepData) { if (prevConDesDepData->mConSatDes) { conDesDepData.mConSatDes = prevConDesDepData->mConSatDes; } if (prevConDesDepData->mImpReapplyConSatDes) { conDesDepData.mImpReapplyConSatDes = prevConDesDepData->mImpReapplyConSatDes; } } } bool inserted = false; if (!conDesDepData.mConSatDes) { conDesDepData.mConSatDes = conSatDes; inserted = true; if (newInsertion) { *newInsertion = true; } mConceptSatDesLinker = conSatDes->append(mConceptSatDesLinker); ++mConceptCount; ++mTotelCount; } else if (conDesDepData.mConSatDes->isNegated() != conSatDes->isNegated()) { return true; } if (impReapplyConSatDesPtr) { *impReapplyConSatDesPtr = &conDesDepData.mImpReapplyConSatDes; } return false; } bool CReapplyConceptSaturationLabelSet::insertConceptReapplicationReturnTriggered(cint64 conTag, CImplicationReapplyConceptSaturationDescriptor* reapplyImpReapplyConSatDes, CConceptSaturationDescriptor** conSatDes) { CConceptSaturationDescriptorReapplyData& conDesDepData = (*mConceptDesDepHash)[conTag]; if (!conDesDepData.mConSatDes && !conDesDepData.mImpReapplyConSatDes && mAdditionalConceptDesDepHash) { CConceptSaturationDescriptorReapplyData* prevConDesDepData = nullptr; bool contained = mAdditionalConceptDesDepHash->tryGetValuePointer(conTag,prevConDesDepData); if (contained && prevConDesDepData) { if (prevConDesDepData->mConSatDes) { conDesDepData.mConSatDes = prevConDesDepData->mConSatDes; } if (prevConDesDepData->mImpReapplyConSatDes) { conDesDepData.mImpReapplyConSatDes = prevConDesDepData->mImpReapplyConSatDes; } } } bool triggered = conDesDepData.mConSatDes && !conDesDepData.mConSatDes->isNegated(); if (!conDesDepData.mImpReapplyConSatDes) { ++mTotelCount; } if (triggered) { if (conSatDes) { *conSatDes = conDesDepData.mConSatDes; } } conDesDepData.mImpReapplyConSatDes = reapplyImpReapplyConSatDes->append(conDesDepData.mImpReapplyConSatDes); return triggered; } CConceptSaturationDescriptor* CReapplyConceptSaturationLabelSet::getConceptSaturationDescriptionLinker() { return mConceptSatDesLinker; } CReapplyConceptSaturationLabelSetIterator CReapplyConceptSaturationLabelSet::getIterator(bool iterateConSatDes, bool iterateReapplies) { if (mAdditionalConceptDesDepHash) { return CReapplyConceptSaturationLabelSetIterator(mConceptDesDepHash->begin(),mConceptDesDepHash->end(),mAdditionalConceptDesDepHash->begin(),mAdditionalConceptDesDepHash->end(),iterateConSatDes,iterateReapplies); } else { return CReapplyConceptSaturationLabelSetIterator(mConceptDesDepHash->begin(),mConceptDesDepHash->end(),mConceptDesDepHash->end(),mConceptDesDepHash->end(),iterateConSatDes,iterateReapplies); } } bool CReapplyConceptSaturationLabelSet::areAllConceptsInAdditionalHash() { return mConceptDesDepHash->isEmpty(); } CConceptSaturationDescriptor* CReapplyConceptSaturationLabelSet::getLastNominalIndependentConceptSaturationDescriptorLinker() { return mLastNominalIndepConSatDes; } CReapplyConceptSaturationLabelSet* CReapplyConceptSaturationLabelSet::setLastNominalIndependentConceptSaturationDescriptorLinker(CConceptSaturationDescriptor* conSatDes) { mLastNominalIndepConSatDes = conSatDes; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativePropagationMapData.h0000644000175000017500000000443512520551144031613 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEPROPAGATIONMAPDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEPROPAGATIONMAPDATA_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CRepresentativePropagationDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CRepresentativePropagationMapData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativePropagationMapData { // public methods public: //! Constructor CRepresentativePropagationMapData(CRepresentativePropagationDescriptor* repPropDes = nullptr); CRepresentativePropagationDescriptor* getRepresentativePropagationDescriptor() const; bool hasRepresentativePropagationDescriptor() const; CRepresentativePropagationMapData* setRepresentativePropagationDescriptor(CRepresentativePropagationDescriptor* repPropDes); // protected methods protected: // protected variables protected: CRepresentativePropagationDescriptor* mRepPropDes; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEPROPAGATIONMAPDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptSetSignature.h0000644000175000017500000000472412520551102027103 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSETSIGNATURE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSETSIGNATURE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" #include namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CConceptSetSignature * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptSetSignature { // public methods public: //! Constructor CConceptSetSignature(); //! Destructor virtual ~CConceptSetSignature(); cint64 getSignatureValue(); CConceptSetSignature* addConceptSignature(CConceptDescriptor* conceptDescriptor); CConceptSetSignature* addConceptSignature(CConcept* concept, bool negation); bool operator==(const CConceptSetSignature& conSig); bool isSignatureEquivalent(const CConceptSetSignature& conSig); bool isSignatureEquivalent(CConceptSetSignature* conSig); CConceptSetSignature* reset(); // protected methods protected: // protected variables protected: cint64 mValue1; cint64 mValue2; cint64 mValue3; cint64 mSigValue; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSETSIGNATURE_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathMap.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathMap.0000644000175000017500000000435712520551146032230 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHMAP_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHMAP_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CRepresentativeVariableBindingPathMapData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CRepresentativeVariableBindingPathMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRepresentativeVariableBindingPathMap : public CPROCESSMAP { // public methods public: //! Constructor CRepresentativeVariableBindingPathMap(CProcessContext* processContext); CRepresentativeVariableBindingPathMap* initVariableBindingPathMap(CRepresentativeVariableBindingPathMap* prevMap); // protected methods protected: // protected variables protected: CProcessContext* mProcessContext; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CREPRESENTATIVEVARIABLEBINDINGPATHMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSuccessorIterator.cpp0000644000175000017500000000450012520551162027166 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSuccessorIterator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSuccessorIterator::CSuccessorIterator() { mLastSucc = -1; } CSuccessorIterator::CSuccessorIterator(const CPROCESSHASH::iterator& beginIt, const CPROCESSHASH::iterator& endIt) : mBeginIt(beginIt),mEndIt(endIt) { mLastSucc = -1; while (mBeginIt != mEndIt && mBeginIt.value() == nullptr) { ++mBeginIt; } } bool CSuccessorIterator::hasNext() { return mBeginIt != mEndIt; } CIndividualLinkEdge* CSuccessorIterator::nextLink(bool moveNext) { CIndividualLinkEdge* link = nullptr; if (mBeginIt != mEndIt) { link = mBeginIt.value(); mLastSucc = mBeginIt.key(); if (moveNext) { ++mBeginIt; while (mBeginIt != mEndIt && (mBeginIt.value() == nullptr || mLastSucc == mBeginIt.key())) { ++mBeginIt; } } } return link; } cint64 CSuccessorIterator::nextIndividualID(bool moveNext) { cint64 indiID = 0; if (mBeginIt != mEndIt) { indiID = mBeginIt.key(); mLastSucc = mBeginIt.key(); if (moveNext) { ++mBeginIt; while (mBeginIt != mEndIt && (mBeginIt.value() == nullptr || mLastSucc == mBeginIt.key())) { ++mBeginIt; } } } return indiID; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningHash.cpp0000644000175000017500000000572212520551164031473 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariableBindingPathJoiningHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CVariableBindingPathJoiningHash::CVariableBindingPathJoiningHash(CProcessContext* context) : CPROCESSHASH(context) { mContext = context; } CVariableBindingPathJoiningData* CVariableBindingPathJoiningHash::getVariableBindingPathJoiningData(const CVariableBindingPathJoiningHasher& hasher, bool localize) { CVariableBindingPathJoiningData* varBindPathJoiningData = nullptr; CVariableBindingPathJoiningHashData data = CPROCESSHASH::value(hasher); varBindPathJoiningData = data.mUseVarBindPathJoiningData; if (CPROCESSHASH::contains(hasher)) { CVariableBindingPathJoiningHashData& data = CPROCESSHASH::operator[](hasher); if (!data.mLocVarBindPathJoiningData && data.mUseVarBindPathJoiningData) { data.mLocVarBindPathJoiningData = CObjectAllocator< CVariableBindingPathJoiningData >::allocateAndConstruct(mContext->getUsedMemoryAllocationManager()); data.mLocVarBindPathJoiningData->initVariableBindingPathJoiningData(data.mUseVarBindPathJoiningData); data.mUseVarBindPathJoiningData = data.mLocVarBindPathJoiningData; } varBindPathJoiningData = data.mUseVarBindPathJoiningData; } return varBindPathJoiningData; } CVariableBindingPathJoiningHash* CVariableBindingPathJoiningHash::insertVariableBindingPathJoiningData(const CVariableBindingPathJoiningHasher& hasher, CVariableBindingPathJoiningData* joinData) { CVariableBindingPathJoiningHashData& data = CPROCESSHASH::operator[](hasher); data.mUseVarBindPathJoiningData = data.mLocVarBindPathJoiningData = joinData; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSignatureBlockingReviewDataIterator.h0000644000175000017500000000445612520551162032262 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGREVIEWDATAITERATOR_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGREVIEWDATAITERATOR_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CIndividualProcessNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { /*! * * \class CSignatureBlockingReviewDataIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureBlockingReviewDataIterator { // public methods public: //! Constructor CSignatureBlockingReviewDataIterator(CPROCESSSET* individualSet, CPROCESSMAP* depthIndividualMap); bool hasNext(); bool removeAndMoveNext(); cint64 next(bool moveNext = true); // protected methods protected: // protected variables protected: CPROCESSSET* mIndividualSet; CPROCESSMAP* mDepthIndividualMap; CPROCESSMAP::iterator mDepthIndividualMapIt; CPROCESSMAP::iterator mDepthIndividualMapItEnd; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSIGNATUREBLOCKINGREVIEWDATAITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationSuccessorData.cpp0000644000175000017500000000255412520551156030332 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationSuccessorData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CSaturationSuccessorData::CSaturationSuccessorData() { mSuccCount = 0; mActiveCount = false; mExtension = false; mCreationRoleLinker = nullptr; mNextLink = nullptr; mSuccIndiNode = nullptr; mVALUENominalConnection = false; mVALUENominalID = 0; //mMergedCreation = false; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionResolveHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionReso0000644000175000017500000000554612520551154032434 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEEXTENSIONRESOLVEHASH_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEEXTENSIONRESOLVEHASH_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CProcessContext.h" #include "CSaturationIndividualNodeExtensionResolveHashData.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CSaturationIndividualNodeExtensionResolveHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationIndividualNodeExtensionResolveHash { // public methods public: //! Constructor CSaturationIndividualNodeExtensionResolveHash(CProcessContext* processContext); CSaturationIndividualNodeExtensionResolveHash* initIndividualNodeExtensionResolveHash(); CPROCESSHASH< QPair ,CSaturationIndividualNodeExtensionResolveHashData>* getIndividualNodeExtensionResolveHash(); CSaturationIndividualNodeExtensionResolveHashData& getResolvedIndividualNodeExtensionData(CConcept* concept, bool negation); CSaturationIndividualNodeExtensionResolveHashData& getResolvedIndividualNodeExtensionData(CIndividualSaturationProcessNode* indiNode); CSaturationIndividualNodeExtensionResolveHashData& getResolvedIndividualNodeExtensionData(CRole* role); // protected methods protected: // protected variables protected: CPROCESSHASH< QPair ,CSaturationIndividualNodeExtensionResolveHashData> mIndiNodeExtensionResolveHash; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CSATURATIONINDIVIDUALNODEEXTENSIONRESOLVEHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CPropagationBindingMapData.cpp0000644000175000017500000000445112520551136030517 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPropagationBindingMapData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Process { CPropagationBindingMapData::CPropagationBindingMapData(CPropagationBindingDescriptor* propBindDes) { mPropBindDes = propBindDes; mReapplyConDes = nullptr; } CPropagationBindingDescriptor* CPropagationBindingMapData::getPropagationBindingDescriptor() const { return mPropBindDes; } bool CPropagationBindingMapData::hasPropagationBindingDescriptor() const { return mPropBindDes != nullptr; } CPropagationBindingMapData* CPropagationBindingMapData::setPropagationBindingDescriptor(CPropagationBindingDescriptor* des) { mPropBindDes = des; return this; } CPropagationBindingReapplyConceptDescriptor* CPropagationBindingMapData::getReapplyConceptDescriptor() const { return mReapplyConDes; } bool CPropagationBindingMapData::hasReapplyConceptDescriptor() const { return mReapplyConDes != nullptr; } CPropagationBindingMapData* CPropagationBindingMapData::setReapplyConceptDescriptor(CPropagationBindingReapplyConceptDescriptor* reapplyConDes) { mReapplyConDes = reapplyConDes->append(mReapplyConDes); return this; } CPropagationBindingMapData* CPropagationBindingMapData::clearReapplyConceptDescriptor() { mReapplyConDes = nullptr; return this; } }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Process/CConceptSetStructure.h0000644000175000017500000000452112520551102027135 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSETSTRUCTURE_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSETSTRUCTURE_H // Libraries includes // Namespace includes #include "ProcessSettings.h" #include "CConceptDescriptor.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" #include namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Process { /*! * * \class CConceptSetStructure * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptSetStructure { // public methods public: //! Constructor CConceptSetStructure(); CConceptSetStructure* addedConcept(CConceptDescriptor* conceptDescriptor); CConceptSetStructure* reset(); CConceptSetStructure* setBindingPropagationConcepts(bool bindingPropagationConcepts); bool hasBindingPropagationConcepts(); CConceptSetStructure* setDynamicCreatedConcepts(bool dynamicCreatedConcepts); bool hasDynamicCreatedConcepts(); // protected methods protected: // protected variables protected: bool mBindingPropagationConcepts; bool mDynamicCreatedConcepts; // private methods private: // private variables private: }; }; // end namespace Process }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSETSTRUCTURE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/0000755000175000017500000000000012613407256022170 5ustar jonasjonas././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSaturationIndividualsAnalysingAdapter.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSaturationIndividualsAnalysingAdapter.cp0000644000175000017500000000321612520551170032305 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationIndividualsAnalysingAdapter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CSaturationIndividualsAnalysingAdapter::CSaturationIndividualsAnalysingAdapter(CSaturationIndividualAnalysationObserver* indisAnalObserver) { mIndisAnalObserver = indisAnalObserver; } CSaturationIndividualsAnalysingAdapter* CSaturationIndividualsAnalysingAdapter::setIndividualsAnalysationObserver(CSaturationIndividualAnalysationObserver* indiAnalObserver) { mIndisAnalObserver = indiAnalObserver; return this; } CSaturationIndividualAnalysationObserver* CSaturationIndividualsAnalysingAdapter::getIndividualsAnalysationObserver() { return mIndisAnalObserver; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CCalculationConfigurationExtension.h0000644000175000017500000003301012520551166031321 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CCALCULATIONCONFIGURATIONEXTENSION_H #define KONCLUDE_REASONER_KERNEL_TASK_CCALCULATIONCONFIGURATIONEXTENSION_H // Libraries includes // Namespace includes // Other includes #include "Config/CConfigurationBase.h" #include "Config/CLocalConfigurationExtension.h" #include "Config/CLocalConfigurationFixedExtension.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Kernel { namespace Task { /*! * * \class CCalculationConfigurationExtension * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationConfigurationExtension : public CLocalConfigurationFixedExtension { // public methods public: //! Constructor CCalculationConfigurationExtension(CConfigurationBase *fixedCollectingConfiguration, qint64 configID = 0); CCalculationConfigurationExtension(CCalculationConfigurationExtension *previousLocalCalcExtension, CConfigurationBase *fixedCollectingConfiguration, qint64 configID = 0); //! Destructor virtual ~CCalculationConfigurationExtension(); bool isDependencyTrackingActivated(); bool isBackjumpingActivated(); bool isUnsatisfiableCacheRetrievalActivated(); bool isSatisfiableCacheRetrievalActivated(); bool isSingleLevelUnsatisfiableCacheWritingActivated(); bool isTestedConceptUnsatisfiableCacheWritingActivated(); bool isSingleLevelSatisfiableCacheWritingActivated(); bool isProxyIndividualsActivated(); bool isMinimizeMergingBranchesActivated(); bool isPseudoModelRuleEssentialCheckingActivated(); bool isClassificationPseudoModelSubsumptionMergingActivated(); bool isSpecializedAutomateRuleActivated(); bool isSubSetBlockingActivated(); bool isOptimizedBlockingActivated(); bool isEqualSetBlockingActivated(); bool isPairwiseEqualSetBlockingActivated(); bool isAncestorBlockingSearchActivated(); bool isAnywhereBlockingSearchActivated(); bool isAnywhereBlockingCandidateHashSearchActivated(); bool isSemanticBranchingActivated(); bool isAtomicSemanticBranchingActivated(); bool isBranchTriggeringActivated(); bool isStrictIndiNodeProcessingActivated(); bool isIDIndiPriorizationActivated(); bool isPropagateNodeProcessedActivated(); bool isDirectRulePreprocessingActivated(); bool isLazyNewNominalCreationActivated(); bool isConsistenceRestrictedNonStictProcessingActivated(); bool isUniqueNameAssumptionActivated(); bool isSatisfiableExpansionCacheRetrievalActivated(); bool isSatisfiableExpansionCacheConceptExpansionActivated(); bool isSatisfiableExpansionCacheSatisfiableBlockingActivated(); bool isSatisfiableExpansionCacheWritingActivated(); bool isSignatureMirroringBlockingActivated(); bool isSignatureSavingActivated(); bool isSkipANDConceptsActivated(); bool isCompletionGraphCachingActivated(); bool isAvoidRepeatedIndividualProcessingActivated(); bool isDelayedCompletionGraphCachingReactivationActivated(); bool isForceNodesRecreationForRepeatedIndividualProcessingActivated(); bool isIndividualsBackendCacheLoadingActivated(); bool isUnsatisfiableCachingFullDependencyActivated(); bool isUnsatisfiableCachingFullSignatureActivated(); bool isPairwiseMergingActivated(); bool isSaturationPilingActivated(); bool isCompletionGraphReuseCachingRetrievalActivated(); bool isCompletionGraphDeterministicReuseActivated(); bool isCompletionGraphNonDeterministicReuseActivated(); bool isAnywhereBlockingCoreConceptCandidateHashSearchActivated(); bool isRepresentativePropagationActivated(); bool isDebuggingWriteDataActivated(); bool isSuccessorConceptSaturationExpansionActivated(); bool isSaturationCachingActivated(); bool isSaturationCriticalConceptTestingActivated(); bool isSaturationDirectCriticalToInsufficientActivated(); bool isSaturationCachingWithNominalsByReactivationActivated(); bool isSaturationSuccessorExtensionActivated(); bool isNominalSaturationActivated(); bool isSaturationExpansionSatisfiabilityCacheWritingActivated(); bool isSaturationUnsatisfiabilityCacheWritingActivated(); bool isEquivalentAlternativesSaturationMergingActivated(); bool isDatatypeReasoningActivated(); bool isComputedTypesCachingActivated(); bool isConstructionIndividualNodeMergingActivated(); cint64 getMaximumRecursiveProcessingConceptCount(); cint64 getSaturationReferredNodeManyConceptCount(); cint64 getSaturationManyConceptReferredNodeCountProcessLimit(); cint64 getSaturationReferredNodeConceptCountProcessLimit(); cint64 getSaturationReferredNodeUnprocessedCountProcessLimit(); cint64 getSaturationReferredNodeCheckingDepth(); bool isForceManyConceptSaturationActivated(); // protected methods protected: // protected variables protected: bool mConfDependencyTrackingActivated; bool mConfBackjumpingActivated; bool mConfUnsatCachingActivated; bool mConfSatCachingActivated; bool mConfUnsatCacheSingleLevelWritingActivated; bool mConfUnsatCacheTestedConceptWritingActivated; bool mConfSatCacheSingleLevelWritingActivated; bool mConfProxyIndividualsActivated; bool mConfMinimizeMergingBranchesActivated; bool mConfPseudoModelRuleEssentialCheckingActivated; bool mConfClassPseudoModelSubsumptionMergingActivated; bool mConfSpecializedAutomateRuleActivated; bool mConfSubSetBlockingActivated; bool mConfOptimizedBlockingActivated; bool mConfEqualSetBlockingActivated; bool mConfPairwiseEqualSetBlockingActivated; bool mConfAncestorBlockingSearchActivated; bool mConfAnywhereBlockingSearchActivated; bool mConfAnywhereBlockingCandidateHashSearchActivated; bool mConfSemanticBranchingActivated; bool mConfAtomicSemanticBranchingActivated; bool mConfBranchTriggeringActivated; bool mConfStrictIndiNodeProcessingActivated; bool mConfIDIndiPriorizationActivated; bool mConfPropagateNodeProcessedActivated; bool mConfDirectRulePreprocessingActivated; bool mConfLazyNewNominalCreationActivated; bool mConfConsistenceRestrictedNonStictProcessingActivated; bool mConfUniqueNameAssumptionActivated; bool mConfSatisfiableExpansionCacheRetrievalActivated; bool mConfSatisfiableExpansionCacheConceptExpansionActivated; bool mConfSatisfiableExpansionCacheSatisfiableBlockingActivated; bool mConfSatisfiableExpansionCacheWritingActivated; bool mConfSignatureMirroringBlockingActivated; bool mConfSignatureSavingActivated; bool mConfSkipANDConceptsActivated; bool mConfCompletionGraphCachingActivated; bool mConfAvoidRepeatedIndividualProcessingActivated; bool mConfDelayedCompletionGraphCachingReactivationActivated; bool mConfForceNodesRecreationForRepeatedIndividualProcessingActivated; bool mConfUnsatCachingUseFullNodeDependencyActivated; bool mConfUnsatCachingUseNodeSignatureSetActivated; bool mConfPairwiseMergingActivated; bool mConfSaturationPilingActivated; bool mConfCompGraphReuseCacheRetrievalActivated; bool mConfCompGraphDeterministicReuseActivated; bool mConfCompGraphNonDeterministicReuseActivated; bool mConfAnywhereBlockingCoreConceptCandidateHashSearchActivated; bool mConfRepresentativePropagationActivated; bool mConfDebuggingWriteDataActivated; bool mConfSuccessorConceptSaturationExpansionActivated; bool mConfSaturationCachingActivated; bool mConfSaturationCriticalConceptTestingActivated; bool mConfSaturationDirectCriticalToInsufficientActivated; bool mConfSaturationSuccessorExtensionActivated; bool mConfSaturationCachingWithNominalsByReactivationActivated; bool mConfNominalSaturationActivated; bool mConfSaturationExpansionSatisfiabilityCacheWritingActivated; bool mConfSaturationUnsatisfiabilityCacheWritingActivated; bool mConfIndividualsBackendCacheLoadingActivated; bool mEquivalentAlternativesSaturationMergingActivated; bool mDatatypeReasoningActivated; bool mComputedTypesCachingActivated; bool mConstructionIndividualNodeMergingActivated; cint64 mSaturationReferredNodeManyConceptCount; cint64 mSaturationManyConceptReferredNodeCountProcessLimit; cint64 mSaturationReferredNodeConceptCountProcessLimit; cint64 mSaturationReferredNodeUnprocessedCountProcessLimit; cint64 mSaturationReferredNodeCheckingDepth; bool mConfForceManyConceptSaturationActivated; cint64 mMaxRecProConceptCount; bool mConfDependencyTrackingChecked; bool mConfBackjumpingChecked; bool mConfUnsatCachingChecked; bool mConfSatCachingChecked; bool mConfUnsatCacheSingleLevelWritingChecked; bool mConfUnsatCacheTestedConceptWritingChecked; bool mConfSatCacheSingleLevelWritingChecked; bool mConfProxyIndividualsChecked; bool mConfMinimizeMergingBranchesChecked; bool mConfPseudoModelRuleEssentialCheckingChecked; bool mConfClassPseudoModelSubsumptionMergingChecked; bool mConfSpecializedAutomateRuleChecked; bool mConfSubSetBlockingChecked; bool mConfOptimizedBlockingChecked; bool mConfEqualSetBlockingChecked; bool mConfPairwiseEqualSetBlockingChecked; bool mConfAncestorBlockingSearchChecked; bool mConfAnywhereBlockingSearchChecked; bool mConfAnywhereBlockingCandidateHashSearchChecked; bool mConfSemanticBranchingChecked; bool mConfAtomicSemanticBranchingChecked; bool mConfBranchTriggeringChecked; bool mConfStrictIndiNodeProcessingChecked; bool mConfIDIndiPriorizationChecked; bool mConfPropagateNodeProcessedChecked; bool mConfDirectRulePreprocessingChecked; bool mConfLazyNewNominalCreationChecked; bool mConfConsistenceRestrictedNonStictProcessingChecked; bool mConfUniqueNameAssumptionChecked; bool mConfSatisfiableExpansionCacheRetrievalChecked; bool mConfSatisfiableExpansionCacheConceptExpansionChecked; bool mConfSatisfiableExpansionCacheSatisfiableBlockingChecked; bool mConfSatisfiableExpansionCacheWritingChecked; bool mConfSignatureMirroringBlockingChecked; bool mConfSignatureSavingChecked; bool mConfSkipANDConceptsChecked; bool mConfCompletionGraphCachingChecked; bool mConfAvoidRepeatedIndividualProcessingChecked; bool mConfDelayedCompletionGraphCachingReactivationChecked; bool mConfForceNodesRecreationForRepeatedIndividualProcessingChecked; bool mConfIndividualsBackendCacheLoadingChecked; bool mConfUnsatCachingUseFullNodeDependencyChecked; bool mConfUnsatCachingUseNodeSignatureSetChecked; bool mConfPairwiseMergingChecked; bool mConfSaturationPilingChecked; bool mConfCompGraphReuseCacheRetrievalChecked; bool mConfCompGraphDeterministicReuseChecked; bool mConfCompGraphNonDeterministicReuseChecked; bool mConfAnywhereBlockingCoreConceptCandidateHashSearchChecked; bool mConfRepresentativePropagationChecked; bool mConfDebuggingWriteDataChecked; bool mConfSuccessorConceptSaturationExpansionChecked; bool mConfSaturationCachingChecked; bool mConfSaturationCriticalConceptTestingChecked; bool mConfSaturationDirectCriticalToInsufficientChecked; bool mConfSaturationSuccessorExtensionChecked; bool mConfSaturationCachingWithNominalsByReactivationChecked; bool mConfNominalSaturationChecked; bool mConfSaturationExpansionSatisfiabilityCacheWritingChecked; bool mConfSaturationUnsatisfiabilityCacheWritingChecked; bool mEquivalentAlternativesSaturationMergingChecked; bool mDatatypeReasoningChecked; bool mComputedTypesCachingChecked; bool mConstructionIndividualNodeMergingChecked; bool mSaturationReferredNodeManyConceptCountChecked; bool mSaturationManyConceptReferredNodeCountProcessLimitChecked; bool mSaturationReferredNodeConceptCountProcessLimitChecked; bool mSaturationReferredNodeUnprocessedCountProcessLimitChecked; bool mSaturationReferredNodeCheckingDepthChecked; bool mConfForceManyConceptSaturationChecked; bool mMaxRecProConceptCountChecked; // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CCALCULATIONCONFIGURATIONEXTENSION_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskIncrementalConsistencyTestingAdapter.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskIncrementalConsistencyTes0000644000175000017500000000511412520551170032340 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKINCREMENTALCONSISTENCYTESTINGADAPTER_H #define KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKINCREMENTALCONSISTENCYTESTINGADAPTER_H // Libraries includes // Namespace includes // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Consistiser/CConsistenceObserver.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Consistiser; namespace Kernel { namespace Task { /*! * * \class CSatisfiableTaskIncrementalConsistencyTestingAdapter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableTaskIncrementalConsistencyTestingAdapter { // public methods public: //! Constructor CSatisfiableTaskIncrementalConsistencyTestingAdapter(CConcreteOntology* testingOntology = nullptr, CConcreteOntology* prevConsOntology = nullptr, cint64 incRevID = 0, CConsistenceObserver* observer = nullptr); CConcreteOntology* getTestingOntology(); CConcreteOntology* getPreviousConsistentOntology(); CConsistenceObserver* getConsistenceObserver(); cint64 getIncrementalRevisionID(); // protected methods protected: // protected variables protected: CConcreteOntology* mOntology; CConcreteOntology* mPrevConsOntology; CConsistenceObserver* mConsObserver; cint64 mIncrementalRevisionID; // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKINCREMENTALCONSISTENCYTESTINGADAPTER_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableCalculationTaskJobCallbackExecuter.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableCalculationTaskJobCallbackExe0000644000175000017500000000442012520551170032150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLECALCULATIONTASKJOBCALLBACKEXECUTER_H #define KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLECALCULATIONTASKJOBCALLBACKEXECUTER_H // Libraries includes // Namespace includes #include "CSatisfiableCalculationTask.h" // Other includes #include "Scheduler/CTaskCallbackExecuter.h" #include "Reasoner/Query/CJobSatisfiableCallbackContextData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; namespace Reasoner { using namespace Query; namespace Kernel { namespace Task { /*! * * \class CSatisfiableCalculationTaskJobCallbackExecuter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCalculationTaskJobCallbackExecuter : public CTaskCallbackExecuter { // public methods public: //! Constructor CSatisfiableCalculationTaskJobCallbackExecuter(); //! Destructor virtual ~CSatisfiableCalculationTaskJobCallbackExecuter(); virtual bool executeCallback(CTask* task, CCallbackData* callbackData); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLECALCULATIONTASKJOBCALLBACKEXECUTER_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskIncrementalConsistencyTestingAdapter.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskIncrementalConsistencyTes0000644000175000017500000000375512520551170032351 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableTaskIncrementalConsistencyTestingAdapter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CSatisfiableTaskIncrementalConsistencyTestingAdapter::CSatisfiableTaskIncrementalConsistencyTestingAdapter(CConcreteOntology* testingOntology, CConcreteOntology* prevConsOntology, cint64 incRevID, CConsistenceObserver* observer) { mOntology = testingOntology; mConsObserver = observer; mPrevConsOntology = prevConsOntology; mIncrementalRevisionID = incRevID; } CConcreteOntology *CSatisfiableTaskIncrementalConsistencyTestingAdapter::getTestingOntology() { return mOntology; } CConcreteOntology *CSatisfiableTaskIncrementalConsistencyTestingAdapter::getPreviousConsistentOntology() { return mPrevConsOntology; } CConsistenceObserver *CSatisfiableTaskIncrementalConsistencyTestingAdapter::getConsistenceObserver() { return mConsObserver; } cint64 CSatisfiableTaskIncrementalConsistencyTestingAdapter::getIncrementalRevisionID() { return mIncrementalRevisionID; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskClassificationMessageAdapter.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskClassificationMessageAdap0000644000175000017500000000755712520551170032244 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKCLASSIFICATIONMESSAGEADAPTER_H #define KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKCLASSIFICATIONMESSAGEADAPTER_H // Libraries includes // Namespace includes // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CConceptReferenceLinking.h" #include "Reasoner/Classifier/CClassificationMessageDataObserver.h" #include "Reasoner/Classifier/CClassificationSatisfiableCalculationConceptReferenceLinking.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Classifier; namespace Kernel { namespace Task { /*! * * \class CSatisfiableTaskClassificationMessageAdapter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableTaskClassificationMessageAdapter { // public methods public: //! Constructor CSatisfiableTaskClassificationMessageAdapter(CConcept* testingConcept = nullptr, CConcreteOntology* testingOntology = nullptr, CClassificationMessageDataObserver* observer = nullptr, QHash* conRefLinkDataHash = nullptr, cint64 extractionFlags = 0); CConcept* getTestingConcept(); CConcreteOntology* getTestingOntology(); CClassificationMessageDataObserver* getClassificationMessageDataObserver(); QHash* getConceptReferenceLinkingDataHash(); cint64 getExtractionFlags(); CSatisfiableTaskClassificationMessageAdapter* setExtractionFlags(cint64 flags); bool hasExtractionFlags(cint64 flags); const static cint64 EFEXTRACTSUBSUMERSROOTNODE = 1; const static cint64 EFEXTRACTSUBSUMERSOTHERNODES = 2; const static cint64 EFEXTRACTPOSSIBLESUBSUMERSROOTNODE = 4; const static cint64 EFEXTRACTPOSSIBLESUBSUMERSOTHERNODES = 8; const static cint64 EFEXTRACTIDENTIFIERPSEUDOMODEL = 16; const static cint64 EFEXTRACTOTHERNODESSINGLEDEPENDENCY = 32; const static cint64 EFEXTRACTOTHERNODESMULTIPLEDEPENDENCY = 64; const static cint64 EFEXTRACTALL = EFEXTRACTSUBSUMERSROOTNODE | EFEXTRACTSUBSUMERSOTHERNODES | EFEXTRACTPOSSIBLESUBSUMERSROOTNODE | EFEXTRACTPOSSIBLESUBSUMERSOTHERNODES | EFEXTRACTIDENTIFIERPSEUDOMODEL | EFEXTRACTOTHERNODESMULTIPLEDEPENDENCY; // protected methods protected: // protected variables protected: CConcept* mTestingCon; CConcreteOntology* mOntology; CClassificationMessageDataObserver* mMessageObserver; cint64 mExtractionFlags; QHash* mConRefLinkDataHash; // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKCLASSIFICATIONMESSAGEADAPTER_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableCalculationTaskStatusPropagator.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableCalculationTaskStatusPropagat0000644000175000017500000001114312520551170032340 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCalculationTaskStatusPropagator.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CSatisfiableCalculationTaskStatusPropagator::CSatisfiableCalculationTaskStatusPropagator() { } CSatisfiableCalculationTaskStatusPropagator::~CSatisfiableCalculationTaskStatusPropagator() { } bool CSatisfiableCalculationTaskStatusPropagator::updateTaskStatus(CTask* task, bool& moreDownPropagation, bool& moreUpPropagation) { CSatisfiableCalculationTask* satCalcTask = (CSatisfiableCalculationTask*)task; CTaskStatus* taskStatus = satCalcTask->getTaskStatus(); if (taskStatus->isProcessable() || taskStatus->isError()) { bool cancelTasks = false; CBooleanTaskResult* taskResult = satCalcTask->getSatisfiableCalculationTaskResult(); if (taskResult->hasResult() && !taskResult->getResultValue()) { cancelTasks = true; } CSatisfiableCalculationTask* parentTask = (CSatisfiableCalculationTask*)satCalcTask->getParentTask(); if (parentTask && !cancelTasks) { CBooleanTaskResult* parentTaskResult = parentTask->getSatisfiableCalculationTaskResult(); CTaskStatus* parentTaskStatus = parentTask->getTaskStatus(); if (parentTaskStatus->isError() || parentTaskStatus->isCanceled() || (parentTaskResult->hasResult() && parentTaskResult->getResultValue())) { cancelTasks = true; } } if (cancelTasks) { taskStatus->setCanceled(true); moreDownPropagation = true; return true; } else { if (taskStatus->isError()) { if (parentTask) { parentTask->getTaskStatus()->setError(true,taskStatus->getErrorCode()); } moreDownPropagation = true; return true; } else if (taskResult->hasResult() && taskResult->getResultValue()) { taskStatus->setFinished(true); if (parentTask) { CBooleanTaskResult* parentTaskResult = parentTask->getSatisfiableCalculationTaskResult(); if (!parentTaskResult->hasResult()) { parentTaskResult->installResult(true); moreUpPropagation = true; } } moreDownPropagation = true; return true; } } } return false; } bool CSatisfiableCalculationTaskStatusPropagator::completeTaskStatus(CTask* task, bool& moreUpPropagation) { CSatisfiableCalculationTask* satCalcTask = (CSatisfiableCalculationTask*)task; CBooleanTaskResult* taskResult = satCalcTask->getSatisfiableCalculationTaskResult(); CTaskStatus* taskStatus = satCalcTask->getTaskStatus(); if (taskStatus->isProcessable() || taskStatus->isError()) { if (taskStatus->isError()) { CTask* parentTask = satCalcTask->getParentTask(); if (parentTask && !parentTask->getTaskStatus()->isError()) { parentTask->getTaskStatus()->setError(true,taskStatus->getErrorCode()); moreUpPropagation = true; return true; } } else if (taskResult->hasResult()) { taskStatus->setFinished(true); if (taskResult->getResultValue()) { CSatisfiableCalculationTask* parentTask = (CSatisfiableCalculationTask*)satCalcTask->getParentTask(); if (parentTask) { CBooleanTaskResult* parentTaskResult = parentTask->getSatisfiableCalculationTaskResult(); if (!parentTaskResult->hasResult()) { parentTaskResult->installResult(true); moreUpPropagation = true; } } } } else { if (satCalcTask == satCalcTask->getRootTask()) { bool bug = true; } taskResult->installResult(false); taskStatus->setFinished(true); } return true; } return false; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskRealizationMarkedCandidat0000644000175000017500000000351012520551170032234 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter::CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter(CIndividual* testingIndividual, CConcreteOntology* testingOntology, CRealizationMessageObserver* observer) { mTestingCon = testingIndividual; mOntology = testingOntology; mMessageObserver = observer; } CIndividual *CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter::getTestingIndividual() { return mTestingCon; } CConcreteOntology *CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter::getTestingOntology() { return mOntology; } CRealizationMessageObserver *CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter::getRealizationMessageDataObserver() { return mMessageObserver; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/TaskSettings.h0000644000175000017500000000305612520551172024762 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_TASKSETTINGS #define KONCLUDE_REASONER_KERNEL_TASK_TASKSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { /*! * * \file TaskSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forword declarations class CSatisfiableCalculationTask; // Work Priorities const qint64 PWORKBACKTRACKINGWORK = 1000; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_KERNEL_TASK_TASKSETTINGS././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskRealizationPossibleAssert0000644000175000017500000000500612520551170032345 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKREALIZATIONPOSSIBLEASSERTIONCOLLECTINGADAPTER_H #define KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKREALIZATIONPOSSIBLEASSERTIONCOLLECTINGADAPTER_H // Libraries includes // Namespace includes // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CConceptReferenceLinking.h" #include "Reasoner/Realization/CPossibleAssertionsCollectionSet.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Realization; namespace Kernel { namespace Task { /*! * * \class CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter { // public methods public: //! Constructor CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter(CConcreteOntology* testingOntology = nullptr, CPossibleAssertionsCollectionSet* possAssCollSet = nullptr); CConcreteOntology* getTestingOntology(); CPossibleAssertionsCollectionSet* getPossibleAssertionsCollectionSet(); // protected methods protected: // protected variables protected: CConcreteOntology* mOntology; CPossibleAssertionsCollectionSet* mPossAssCollSet; // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKREALIZATIONPOSSIBLEASSERTIONCOLLECTINGADAPTER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CTaskPreyingAdapter.cpp0000644000175000017500000000467112520551172026542 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskPreyingAdapter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CTaskPreyingAdapter::CTaskPreyingAdapter() { mConsObs = nullptr; mPreyListner = nullptr; mSaturationObs = nullptr; } CTaskPreyingAdapter::CTaskPreyingAdapter(CConsistenceObserver* consObs) { mConsObs = consObs; mPreyListner = nullptr; mSaturationObs = nullptr; } CTaskPreyingAdapter::CTaskPreyingAdapter(CSaturationObserver* saturationObs) { mSaturationObs = saturationObs; mConsObs = nullptr; mPreyListner = nullptr; } CTaskPreyingAdapter::CTaskPreyingAdapter(CTaskPreyingListner* preyedListner) { mConsObs = nullptr; mPreyListner = preyedListner; } CConsistenceObserver* CTaskPreyingAdapter::getConsitenceObserver() { return mConsObs; } CTaskPreyingAdapter* CTaskPreyingAdapter::setConsitenceObserver(CConsistenceObserver* consObs) { mConsObs = consObs; return this; } CTaskPreyingListner* CTaskPreyingAdapter::getTaskPreyingListner() { return mPreyListner; } CTaskPreyingAdapter* CTaskPreyingAdapter::setTaskPreyingListner(CTaskPreyingListner* preyedListner) { mPreyListner = preyedListner; return this; } CSaturationObserver* CTaskPreyingAdapter::getSaturationObserver() { return mSaturationObs; } CTaskPreyingAdapter* CTaskPreyingAdapter::setSaturationObserver(CSaturationObserver* saturationObs) { mSaturationObs = saturationObs; return this; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableCalculationTaskJobCallbackExecuter.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableCalculationTaskJobCallbackExe0000644000175000017500000000421012520551170032145 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCalculationTaskJobCallbackExecuter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CSatisfiableCalculationTaskJobCallbackExecuter::CSatisfiableCalculationTaskJobCallbackExecuter() { } CSatisfiableCalculationTaskJobCallbackExecuter::~CSatisfiableCalculationTaskJobCallbackExecuter() { } bool CSatisfiableCalculationTaskJobCallbackExecuter::executeCallback(CTask* task, CCallbackData* callbackData) { CSatisfiableCalculationTask* satCalcTask = (CSatisfiableCalculationTask*)task; if (satCalcTask->isCalculationTableauCompletionTask()) { CJobSatisfiableCallbackContextData* satCallbackData = (CJobSatisfiableCallbackContextData*)callbackData->getCallbackDataContext(); CBooleanTaskResult* taskResult = satCalcTask->getSatisfiableCalculationTaskResult(); if (taskResult->hasResult()) { satCallbackData->setCalculationError(false,0); satCallbackData->setSatisfiable(taskResult->getResultValue()); } else { CTaskStatus* taskStatus = satCalcTask->getTaskStatus(); satCallbackData->setCalculationError(true,taskStatus->getErrorCode()); } } callbackData->doCallback(); return true; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CCalculationStatisticsCollector.h0000644000175000017500000000402512520551166030622 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CCALCULATIONSTATISTICSCOLLECTOR_H #define KONCLUDE_REASONER_KERNEL_TASK_CCALCULATIONSTATISTICSCOLLECTOR_H // Libraries includes // Namespace includes // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Task { /*! * * \class CCalculationStatisticsCollector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationStatisticsCollector { // public methods public: //! Constructor CCalculationStatisticsCollector(); //! Destructor virtual ~CCalculationStatisticsCollector(); virtual bool addProcessingStatistics(const QString& statName, cint64 statValue) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CCALCULATIONSTATISTICSCOLLECTOR_H ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskRealizationPossibleAssert0000644000175000017500000000324612520551170032351 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter::CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter(CConcreteOntology* testingOntology, CPossibleAssertionsCollectionSet* possAssCollSet) { mOntology = testingOntology; mPossAssCollSet = possAssCollSet; } CConcreteOntology* CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter::getTestingOntology() { return mOntology; } CPossibleAssertionsCollectionSet* CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter::getPossibleAssertionsCollectionSet() { return mPossAssCollSet; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSaturationIndividualsAnalysingAdapter.h0000644000175000017500000000446612520551170032142 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CSATURATIONINDIVIDUALSANALYSINGADAPTER_H #define KONCLUDE_REASONER_KERNEL_TASK_CSATURATIONINDIVIDUALSANALYSINGADAPTER_H // Libraries includes // Namespace includes #include "TaskSettings.h" // Other includes #include "Reasoner/Consistiser/CSaturationIndividualAnalysationObserver.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Consistiser; namespace Kernel { namespace Task { /*! * * \class CSaturationIndividualsAnalysingAdapter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationIndividualsAnalysingAdapter { // public methods public: //! Constructor CSaturationIndividualsAnalysingAdapter(CSaturationIndividualAnalysationObserver* indisAnalObserver); CSaturationIndividualsAnalysingAdapter* setIndividualsAnalysationObserver(CSaturationIndividualAnalysationObserver* indiAnalObserver); CSaturationIndividualAnalysationObserver* getIndividualsAnalysationObserver(); // protected methods protected: // protected variables protected: CSaturationIndividualAnalysationObserver* mIndisAnalObserver; // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CSATURATIONINDIVIDUALSANALYSINGADAPTER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSaturationTaskData.cpp0000644000175000017500000000333112520551170026535 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationTaskData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CSaturationTaskData::CSaturationTaskData(CSatisfiableCalculationTask* saturationTask) { mSaturationTask = saturationTask; } CSaturationTaskData::~CSaturationTaskData() { } CSatisfiableCalculationTask* CSaturationTaskData::getSaturationTask() { return mSaturationTask; } bool CSaturationTaskData::overtakeData() { if (mSaturationTask) { mSaturationTask->getTaskStatus()->setMemoryReleaseable(false); } CSatisfiableCalculationTask* taskIt = mSaturationTask; while (taskIt) { taskIt->getTaskStatus()->setMemoryReleaseable(false); taskIt = (CSatisfiableCalculationTask*)taskIt->getParentTask(); } return true; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskIndividualDependenceTrackingAdapter.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskIndividualDependenceTrack0000644000175000017500000000444712520551170032241 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableTaskIndividualDependenceTrackingAdapter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CSatisfiableTaskIndividualDependenceTrackingAdapter::CSatisfiableTaskIndividualDependenceTrackingAdapter(CIndividualDependenceTrackingObserver* indiDepTrackObserver, CIndividualDependenceTrackingMarker* indiDepTrackMarker) { mIndiDepTrackObserver = indiDepTrackObserver; mIndiDepTrackMarker = indiDepTrackMarker; } CSatisfiableTaskIndividualDependenceTrackingAdapter* CSatisfiableTaskIndividualDependenceTrackingAdapter::setIndividualDependenceTrackingObserver(CIndividualDependenceTrackingObserver* indiDepTrackObserver) { mIndiDepTrackObserver = indiDepTrackObserver; return this; } CIndividualDependenceTrackingObserver* CSatisfiableTaskIndividualDependenceTrackingAdapter::getIndividualDependenceTrackingObserver() { return mIndiDepTrackObserver; } CSatisfiableTaskIndividualDependenceTrackingAdapter* CSatisfiableTaskIndividualDependenceTrackingAdapter::setIndividualDependenceTrackingMarker(CIndividualDependenceTrackingMarker* indiDepTrackMarker) { mIndiDepTrackMarker = indiDepTrackMarker; return this; } CIndividualDependenceTrackingMarker* CSatisfiableTaskIndividualDependenceTrackingAdapter::getIndividualDependenceTrackingMarker() { return mIndiDepTrackMarker; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CCalculationConfigurationExtension.cpp0000644000175000017500000011003012520551166031652 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationConfigurationExtension.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CCalculationConfigurationExtension::CCalculationConfigurationExtension(CConfigurationBase *fixedCollectingConfiguration, qint64 configID) : CLocalConfigurationFixedExtension((fixedCollectingConfiguration)?fixedCollectingConfiguration->getConfigurationGroup():0,configID) { addCollectedConfigurations(fixedCollectingConfiguration); mConfDependencyTrackingChecked = false; mConfBackjumpingChecked = false; mConfSatCachingChecked = false; mConfUnsatCachingChecked = false; mConfProxyIndividualsChecked = false; mConfMinimizeMergingBranchesChecked = false; mConfSatCacheSingleLevelWritingChecked = false; mConfUnsatCacheSingleLevelWritingChecked = false; mConfUnsatCacheTestedConceptWritingChecked = false; mConfPseudoModelRuleEssentialCheckingChecked = false; mConfClassPseudoModelSubsumptionMergingChecked = false; mConfSpecializedAutomateRuleChecked = false; mConfSubSetBlockingChecked = false; mConfOptimizedBlockingChecked = false; mConfEqualSetBlockingChecked = false; mConfPairwiseEqualSetBlockingChecked = false; mConfAncestorBlockingSearchChecked = false; mConfAnywhereBlockingSearchChecked = false; mConfAnywhereBlockingCandidateHashSearchChecked = false; mConfSemanticBranchingChecked = false; mConfAtomicSemanticBranchingChecked = false; mConfBranchTriggeringChecked = false; mConfStrictIndiNodeProcessingChecked = false; mConfIDIndiPriorizationChecked = false; mConfPropagateNodeProcessedChecked = false; mConfDirectRulePreprocessingChecked = false; mConfLazyNewNominalCreationChecked = false; mConfConsistenceRestrictedNonStictProcessingChecked = false; mConfUniqueNameAssumptionChecked = false; mConfSatisfiableExpansionCacheRetrievalChecked = false; mConfSatisfiableExpansionCacheConceptExpansionChecked = false; mConfSatisfiableExpansionCacheSatisfiableBlockingChecked = false; mConfSatisfiableExpansionCacheWritingChecked = false; mConfSignatureMirroringBlockingChecked = false; mConfSignatureSavingChecked = false; mConfSkipANDConceptsChecked = false; mConfCompletionGraphCachingChecked = false; mConfDelayedCompletionGraphCachingReactivationChecked = false; mConfForceNodesRecreationForRepeatedIndividualProcessingChecked = false; mConfAvoidRepeatedIndividualProcessingChecked = false; mConfUnsatCachingUseNodeSignatureSetChecked = false; mConfUnsatCachingUseFullNodeDependencyChecked = false; mConfPairwiseMergingChecked = false; mConfSaturationPilingChecked = false; mConfCompGraphReuseCacheRetrievalChecked = false; mConfCompGraphDeterministicReuseChecked = false; mConfCompGraphNonDeterministicReuseChecked = false; mConfAnywhereBlockingCoreConceptCandidateHashSearchChecked = false; mConfRepresentativePropagationChecked = false; mConfDebuggingWriteDataChecked = false; mConfSuccessorConceptSaturationExpansionChecked = false; mConfSaturationCachingChecked = false; mConfSaturationCriticalConceptTestingChecked = false; mConfSaturationDirectCriticalToInsufficientChecked = false; mConfSaturationSuccessorExtensionChecked = false; mConfSaturationCachingWithNominalsByReactivationChecked = false; mConfNominalSaturationChecked = false; mEquivalentAlternativesSaturationMergingChecked = false; mConfSaturationExpansionSatisfiabilityCacheWritingChecked = false; mConfSaturationUnsatisfiabilityCacheWritingChecked = false; mDatatypeReasoningChecked = false; mComputedTypesCachingChecked = false; mConstructionIndividualNodeMergingChecked = false; mConfIndividualsBackendCacheLoadingChecked = false; mSaturationReferredNodeManyConceptCountChecked = false; mSaturationManyConceptReferredNodeCountProcessLimitChecked = false; mSaturationReferredNodeConceptCountProcessLimitChecked = false; mSaturationReferredNodeUnprocessedCountProcessLimitChecked = false; mSaturationReferredNodeCheckingDepthChecked = false; mConfForceManyConceptSaturationChecked = false; mMaxRecProConceptCountChecked = false; } CCalculationConfigurationExtension::CCalculationConfigurationExtension(CCalculationConfigurationExtension *previousLocalCalcExtension, CConfigurationBase *fixedCollectingConfiguration, qint64 configID) : CLocalConfigurationFixedExtension(previousLocalCalcExtension,configID) { addCollectedConfigurations(fixedCollectingConfiguration); } CCalculationConfigurationExtension::~CCalculationConfigurationExtension() { } bool CCalculationConfigurationExtension::isDependencyTrackingActivated() { if (!mConfDependencyTrackingChecked) { bool tmpConfig = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.DependencyTracking",true); tmpConfig |= isBackjumpingActivated() | isSingleLevelUnsatisfiableCacheWritingActivated(); mConfDependencyTrackingActivated = tmpConfig; mConfDependencyTrackingChecked = true; } return mConfDependencyTrackingActivated; } bool CCalculationConfigurationExtension::isBackjumpingActivated() { if (!mConfBackjumpingChecked) { mConfBackjumpingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.Backjumping",true); mConfBackjumpingChecked = true; } return mConfBackjumpingActivated; } bool CCalculationConfigurationExtension::isSatisfiableCacheRetrievalActivated() { if (!mConfSatCachingChecked) { mConfSatCachingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SatisfiableCacheRetrieval",true); mConfSatCachingChecked = true; } return mConfSatCachingActivated; } bool CCalculationConfigurationExtension::isUnsatisfiableCacheRetrievalActivated() { if (!mConfUnsatCachingChecked) { mConfUnsatCachingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.UnsatisfiableCacheRetrieval",true); mConfUnsatCachingChecked = true; } return mConfUnsatCachingActivated; } bool CCalculationConfigurationExtension::isProxyIndividualsActivated() { if (!mConfProxyIndividualsChecked) { mConfProxyIndividualsActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.ProxyIndividuals",true); mConfProxyIndividualsChecked = true; } return mConfProxyIndividualsActivated; } bool CCalculationConfigurationExtension::isMinimizeMergingBranchesActivated() { if (!mConfMinimizeMergingBranchesChecked) { mConfMinimizeMergingBranchesActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.MinimizedMergingBranches",true); mConfMinimizeMergingBranchesChecked = true; } return mConfMinimizeMergingBranchesActivated; } bool CCalculationConfigurationExtension::isSingleLevelUnsatisfiableCacheWritingActivated() { if (!mConfUnsatCacheSingleLevelWritingChecked) { mConfUnsatCacheSingleLevelWritingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.UnsatisfiableCacheSingleLevelWriting",true); mConfUnsatCacheSingleLevelWritingChecked = true; } return mConfUnsatCacheSingleLevelWritingActivated; } bool CCalculationConfigurationExtension::isTestedConceptUnsatisfiableCacheWritingActivated() { if (!mConfUnsatCacheTestedConceptWritingChecked) { mConfUnsatCacheTestedConceptWritingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.UnsatisfiableCacheTestingConceptWriting",true); mConfUnsatCacheTestedConceptWritingChecked = true; } return mConfUnsatCacheTestedConceptWritingActivated; } bool CCalculationConfigurationExtension::isSingleLevelSatisfiableCacheWritingActivated() { if (!mConfSatCacheSingleLevelWritingChecked) { mConfSatCacheSingleLevelWritingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SatisfiableCacheSingleLevelWriting",true); mConfSatCacheSingleLevelWritingChecked = true; } return mConfSatCacheSingleLevelWritingActivated; } bool CCalculationConfigurationExtension::isPseudoModelRuleEssentialCheckingActivated() { if (!mConfPseudoModelRuleEssentialCheckingChecked) { mConfPseudoModelRuleEssentialCheckingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.PseudoModelEssentialRuleChecking",true); mConfPseudoModelRuleEssentialCheckingChecked = true; } return mConfPseudoModelRuleEssentialCheckingActivated; } bool CCalculationConfigurationExtension::isClassificationPseudoModelSubsumptionMergingActivated() { if (!mConfClassPseudoModelSubsumptionMergingChecked) { mConfClassPseudoModelSubsumptionMergingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.PseudoModelSubsumptionMerging",true); mConfClassPseudoModelSubsumptionMergingChecked = true; } return mConfClassPseudoModelSubsumptionMergingActivated; } bool CCalculationConfigurationExtension::isSpecializedAutomateRuleActivated() { if (!mConfSpecializedAutomateRuleChecked) { mConfSpecializedAutomateRuleActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SpezializedAutomateRule",true); mConfSpecializedAutomateRuleChecked = true; } return mConfSpecializedAutomateRuleActivated; } bool CCalculationConfigurationExtension::isSubSetBlockingActivated() { if (!mConfSubSetBlockingChecked) { mConfSubSetBlockingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SubSetBlockingTest",false); mConfSubSetBlockingChecked = true; } return mConfSubSetBlockingActivated; } bool CCalculationConfigurationExtension::isOptimizedBlockingActivated() { if (!mConfOptimizedBlockingChecked) { mConfOptimizedBlockingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.OptimizedBlockingTest",true); if (!isSubSetBlockingActivated() && !isEqualSetBlockingActivated() && !isPairwiseEqualSetBlockingActivated()) { mConfOptimizedBlockingActivated = true; } mConfOptimizedBlockingChecked = true; } return mConfOptimizedBlockingActivated; } bool CCalculationConfigurationExtension::isEqualSetBlockingActivated() { if (!mConfEqualSetBlockingChecked) { mConfEqualSetBlockingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.EqualSetBlockingTest",false); mConfEqualSetBlockingChecked = true; } return mConfEqualSetBlockingActivated; } bool CCalculationConfigurationExtension::isPairwiseEqualSetBlockingActivated() { if (!mConfPairwiseEqualSetBlockingChecked) { mConfPairwiseEqualSetBlockingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.PairwiseEqualSetBlockingTest",false); mConfPairwiseEqualSetBlockingChecked = true; } return mConfPairwiseEqualSetBlockingActivated; } bool CCalculationConfigurationExtension::isAncestorBlockingSearchActivated() { if (!mConfAncestorBlockingSearchChecked) { mConfAncestorBlockingSearchActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.AncestorBlockingSearch",false); if (!isAnywhereBlockingSearchActivated() && !isAnywhereBlockingCandidateHashSearchActivated() && !isAnywhereBlockingCoreConceptCandidateHashSearchActivated()) { mConfAncestorBlockingSearchActivated = true; } mConfAncestorBlockingSearchChecked = true; } return mConfAncestorBlockingSearchActivated; } bool CCalculationConfigurationExtension::isAnywhereBlockingSearchActivated() { if (!mConfAnywhereBlockingSearchChecked) { mConfAnywhereBlockingSearchActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.AnywhereBlockingSearch",false); mConfAnywhereBlockingSearchChecked = true; } return mConfAnywhereBlockingSearchActivated; } bool CCalculationConfigurationExtension::isAnywhereBlockingCandidateHashSearchActivated() { if (!mConfAnywhereBlockingCandidateHashSearchChecked) { mConfAnywhereBlockingCandidateHashSearchActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.AnywhereCandidateHashBlockingSearch",true); mConfAnywhereBlockingCandidateHashSearchChecked = true; } return mConfAnywhereBlockingCandidateHashSearchActivated; } bool CCalculationConfigurationExtension::isSemanticBranchingActivated() { if (!mConfSemanticBranchingChecked) { mConfSemanticBranchingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SemanticBranching",false); mConfSemanticBranchingChecked = true; } return mConfSemanticBranchingActivated; } bool CCalculationConfigurationExtension::isAtomicSemanticBranchingActivated() { if (!mConfAtomicSemanticBranchingChecked) { mConfAtomicSemanticBranchingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.AtomicSemanticBranching",true); mConfAtomicSemanticBranchingChecked = true; } return mConfAtomicSemanticBranchingActivated; } bool CCalculationConfigurationExtension::isBranchTriggeringActivated() { if (!mConfBranchTriggeringChecked) { mConfBranchTriggeringActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.BranchTriggering",true); mConfBranchTriggeringChecked = true; } return mConfBranchTriggeringActivated; } bool CCalculationConfigurationExtension::isStrictIndiNodeProcessingActivated() { if (!mConfStrictIndiNodeProcessingChecked) { mConfStrictIndiNodeProcessingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.StrictIndividualNodeProcessingOrder",true); mConfStrictIndiNodeProcessingChecked = true; } return mConfStrictIndiNodeProcessingActivated; } bool CCalculationConfigurationExtension::isIDIndiPriorizationActivated() { if (!mConfIDIndiPriorizationChecked) { mConfIDIndiPriorizationActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.IndividualNodeIDPriorization",true); mConfIDIndiPriorizationChecked = true; } return mConfIDIndiPriorizationActivated; } bool CCalculationConfigurationExtension::isPropagateNodeProcessedActivated() { if (!mConfPropagateNodeProcessedChecked) { mConfPropagateNodeProcessedActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.ProcessedIndividualNodePropagation",false); if (!isStrictIndiNodeProcessingActivated()) { mConfPropagateNodeProcessedActivated = true; } mConfPropagateNodeProcessedChecked = true; } return mConfPropagateNodeProcessedActivated; } bool CCalculationConfigurationExtension::isDirectRulePreprocessingActivated() { if (!mConfDirectRulePreprocessingChecked) { mConfDirectRulePreprocessingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.DirectRulePreprocessing",true); mConfDirectRulePreprocessingChecked = true; } return mConfDirectRulePreprocessingActivated; } bool CCalculationConfigurationExtension::isLazyNewNominalCreationActivated() { if (!mConfLazyNewNominalCreationChecked) { mConfLazyNewNominalCreationActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.LazyNewMergingNominalCreation",true); mConfLazyNewNominalCreationChecked = true; } return mConfLazyNewNominalCreationActivated; } bool CCalculationConfigurationExtension::isConsistenceRestrictedNonStictProcessingActivated() { if (!mConfConsistenceRestrictedNonStictProcessingChecked) { mConfConsistenceRestrictedNonStictProcessingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.ConsistenceRestrictedNonStrictProcessing",true); mConfConsistenceRestrictedNonStictProcessingChecked = true; } return mConfConsistenceRestrictedNonStictProcessingActivated; } bool CCalculationConfigurationExtension::isUniqueNameAssumptionActivated() { if (!mConfUniqueNameAssumptionChecked) { mConfUniqueNameAssumptionActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.UniqueNameAssumption",false); mConfUniqueNameAssumptionChecked = true; } return mConfUniqueNameAssumptionActivated; } bool CCalculationConfigurationExtension::isSatisfiableExpansionCacheRetrievalActivated() { if (!mConfSatisfiableExpansionCacheRetrievalChecked) { mConfSatisfiableExpansionCacheRetrievalActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SatisfiableExpansionCacheRetrieval",true); mConfSatisfiableExpansionCacheRetrievalChecked = true; } return mConfSatisfiableExpansionCacheRetrievalActivated; } bool CCalculationConfigurationExtension::isSatisfiableExpansionCacheConceptExpansionActivated() { if (!mConfSatisfiableExpansionCacheConceptExpansionChecked) { mConfSatisfiableExpansionCacheConceptExpansionActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SatisfiableExpansionCacheConceptExpansion",true); mConfSatisfiableExpansionCacheConceptExpansionChecked = true; } return mConfSatisfiableExpansionCacheConceptExpansionActivated; } bool CCalculationConfigurationExtension::isSatisfiableExpansionCacheSatisfiableBlockingActivated() { if (!mConfSatisfiableExpansionCacheSatisfiableBlockingChecked) { mConfSatisfiableExpansionCacheSatisfiableBlockingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SatisfiableExpansionCacheSatisfiableBlocking",true); mConfSatisfiableExpansionCacheSatisfiableBlockingChecked = true; } return mConfSatisfiableExpansionCacheSatisfiableBlockingActivated; } bool CCalculationConfigurationExtension::isSatisfiableExpansionCacheWritingActivated() { if (!mConfSatisfiableExpansionCacheWritingChecked) { mConfSatisfiableExpansionCacheWritingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SatisfiableExpansionCacheWriting",true); mConfSatisfiableExpansionCacheWritingChecked = true; } return mConfSatisfiableExpansionCacheWritingActivated; } bool CCalculationConfigurationExtension::isSignatureMirroringBlockingActivated() { if (!mConfSignatureMirroringBlockingChecked) { mConfSignatureMirroringBlockingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SignatureMirroringBlocking",true); mConfSignatureMirroringBlockingChecked = true; } return mConfSignatureMirroringBlockingActivated; } bool CCalculationConfigurationExtension::isSignatureSavingActivated() { if (!mConfSignatureSavingChecked) { mConfSignatureSavingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SignatureSaving",true); mConfSignatureSavingChecked = true; } return mConfSignatureSavingActivated; } bool CCalculationConfigurationExtension::isSkipANDConceptsActivated() { if (!mConfSkipANDConceptsChecked) { mConfSkipANDConceptsActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.ANDConceptSkipping",false); mConfSkipANDConceptsChecked = true; } return mConfSkipANDConceptsActivated; } bool CCalculationConfigurationExtension::isCompletionGraphCachingActivated() { if (!mConfCompletionGraphCachingChecked) { mConfCompletionGraphCachingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.CompletionGraphCaching",true); mConfCompletionGraphCachingChecked = true; } return mConfCompletionGraphCachingActivated; } bool CCalculationConfigurationExtension::isDelayedCompletionGraphCachingReactivationActivated() { if (!mConfDelayedCompletionGraphCachingReactivationChecked) { mConfDelayedCompletionGraphCachingReactivationActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.DelayedCompletionGraphCachingReactivation",false); mConfDelayedCompletionGraphCachingReactivationChecked = true; } return mConfDelayedCompletionGraphCachingReactivationActivated; } bool CCalculationConfigurationExtension::isForceNodesRecreationForRepeatedIndividualProcessingActivated() { if (!mConfForceNodesRecreationForRepeatedIndividualProcessingChecked) { mConfForceNodesRecreationForRepeatedIndividualProcessingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.ForceNodesRecreationForRepeatedIndividualProcessing",true); mConfForceNodesRecreationForRepeatedIndividualProcessingChecked = true; } return mConfForceNodesRecreationForRepeatedIndividualProcessingActivated; } bool CCalculationConfigurationExtension::isAvoidRepeatedIndividualProcessingActivated() { if (!mConfAvoidRepeatedIndividualProcessingChecked) { mConfAvoidRepeatedIndividualProcessingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.AvoidRepeatedIndividualProcessing",true); mConfAvoidRepeatedIndividualProcessingChecked = true; } return mConfAvoidRepeatedIndividualProcessingActivated; } bool CCalculationConfigurationExtension::isIndividualsBackendCacheLoadingActivated() { if (!mConfIndividualsBackendCacheLoadingChecked) { mConfIndividualsBackendCacheLoadingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.IndividualsBackendCacheLoading",true); mConfIndividualsBackendCacheLoadingChecked = true; } return mConfIndividualsBackendCacheLoadingActivated; } bool CCalculationConfigurationExtension::isUnsatisfiableCachingFullDependencyActivated() { if (!mConfUnsatCachingUseFullNodeDependencyChecked) { mConfUnsatCachingUseFullNodeDependencyActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.UnsatisfiableCachingFullDependency",false); mConfUnsatCachingUseFullNodeDependencyChecked = true; } return mConfUnsatCachingUseFullNodeDependencyActivated; } bool CCalculationConfigurationExtension::isUnsatisfiableCachingFullSignatureActivated() { if (!mConfUnsatCachingUseNodeSignatureSetChecked) { mConfUnsatCachingUseNodeSignatureSetActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.UnsatisfiableCachingFullSignature",false); mConfUnsatCachingUseNodeSignatureSetChecked = true; } return mConfUnsatCachingUseNodeSignatureSetActivated; } bool CCalculationConfigurationExtension::isPairwiseMergingActivated() { if (!mConfPairwiseMergingChecked) { mConfPairwiseMergingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.PairwiseMerging",false); mConfPairwiseMergingChecked = true; } return mConfPairwiseMergingActivated; } bool CCalculationConfigurationExtension::isSaturationPilingActivated() { if (!mConfSaturationPilingChecked) { mConfSaturationPilingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SaturationPiling",false); mConfSaturationPilingChecked = true; } return mConfSaturationPilingActivated; } bool CCalculationConfigurationExtension::isCompletionGraphReuseCachingRetrievalActivated() { if (!mConfCompGraphReuseCacheRetrievalChecked) { mConfCompGraphReuseCacheRetrievalActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.CompletionGraphReuseCachingRetrieval",true); mConfCompGraphReuseCacheRetrievalChecked = true; } return mConfCompGraphReuseCacheRetrievalActivated; } bool CCalculationConfigurationExtension::isCompletionGraphDeterministicReuseActivated() { if (!mConfCompGraphDeterministicReuseChecked) { mConfCompGraphDeterministicReuseActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.CompletionGraphDeterministicReuse",true); mConfCompGraphDeterministicReuseChecked = true; } return mConfCompGraphDeterministicReuseActivated; } bool CCalculationConfigurationExtension::isCompletionGraphNonDeterministicReuseActivated() { if (!mConfCompGraphNonDeterministicReuseChecked) { mConfCompGraphNonDeterministicReuseActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.CompletionGraphNonDeterministicReuse",true); mConfCompGraphNonDeterministicReuseChecked = true; } return mConfCompGraphNonDeterministicReuseActivated; } bool CCalculationConfigurationExtension::isAnywhereBlockingCoreConceptCandidateHashSearchActivated() { if (!mConfAnywhereBlockingCoreConceptCandidateHashSearchChecked) { mConfAnywhereBlockingCoreConceptCandidateHashSearchActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.AnywhereCoreConceptCandidateHashBlockingSearch",true); mConfAnywhereBlockingCoreConceptCandidateHashSearchChecked = true; } return mConfAnywhereBlockingCoreConceptCandidateHashSearchActivated; } bool CCalculationConfigurationExtension::isRepresentativePropagationActivated() { if (!mConfRepresentativePropagationChecked) { mConfRepresentativePropagationActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.RepresentativePropagation",true); mConfRepresentativePropagationChecked = true; } return mConfRepresentativePropagationActivated; } bool CCalculationConfigurationExtension::isDebuggingWriteDataActivated() { if (!mConfDebuggingWriteDataChecked) { mConfDebuggingWriteDataActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Debugging.WriteDebuggingData",false); mConfDebuggingWriteDataChecked = true; } return mConfDebuggingWriteDataActivated; } bool CCalculationConfigurationExtension::isSuccessorConceptSaturationExpansionActivated() { if (!mConfSuccessorConceptSaturationExpansionChecked) { mConfSuccessorConceptSaturationExpansionActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SuccessorConceptSaturationExpansion",true); mConfSuccessorConceptSaturationExpansionChecked = true; } return mConfSuccessorConceptSaturationExpansionActivated; } bool CCalculationConfigurationExtension::isSaturationCachingActivated() { if (!mConfSaturationCachingChecked) { mConfSaturationCachingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SaturationCaching",true); mConfSaturationCachingChecked = true; } return mConfSaturationCachingActivated; } bool CCalculationConfigurationExtension::isSaturationCriticalConceptTestingActivated() { if (!mConfSaturationCriticalConceptTestingChecked) { mConfSaturationCriticalConceptTestingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SaturationCriticalConceptTesting",true); mConfSaturationCriticalConceptTestingChecked = true; } return mConfSaturationCriticalConceptTestingActivated; } bool CCalculationConfigurationExtension::isSaturationDirectCriticalToInsufficientActivated() { if (!mConfSaturationDirectCriticalToInsufficientChecked) { mConfSaturationDirectCriticalToInsufficientActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SaturationDirectCriticalToInsufficient",false); mConfSaturationDirectCriticalToInsufficientChecked = true; } return mConfSaturationDirectCriticalToInsufficientActivated; } bool CCalculationConfigurationExtension::isSaturationSuccessorExtensionActivated() { if (!mConfSaturationSuccessorExtensionChecked) { mConfSaturationSuccessorExtensionActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SaturationSuccessorExtension",false); mConfSaturationSuccessorExtensionChecked = true; } return mConfSaturationSuccessorExtensionActivated; } bool CCalculationConfigurationExtension::isSaturationCachingWithNominalsByReactivationActivated() { if (!mConfSaturationCachingWithNominalsByReactivationChecked) { mConfSaturationCachingWithNominalsByReactivationActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.NominalSaturationCachingByNodeReactivation",false); mConfSaturationCachingWithNominalsByReactivationChecked = true; } return mConfSaturationCachingWithNominalsByReactivationActivated; } bool CCalculationConfigurationExtension::isNominalSaturationActivated() { if (!mConfNominalSaturationChecked) { mConfNominalSaturationActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.NominalSaturation",true); mConfNominalSaturationChecked = true; } return mConfNominalSaturationActivated; } bool CCalculationConfigurationExtension::isEquivalentAlternativesSaturationMergingActivated() { if (!mEquivalentAlternativesSaturationMergingChecked) { mEquivalentAlternativesSaturationMergingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.EquivalentAlternativesSaturationMerging",true); mEquivalentAlternativesSaturationMergingChecked = true; } return mEquivalentAlternativesSaturationMergingActivated; } bool CCalculationConfigurationExtension::isSaturationExpansionSatisfiabilityCacheWritingActivated() { if (!mConfSaturationExpansionSatisfiabilityCacheWritingChecked) { mConfSaturationExpansionSatisfiabilityCacheWritingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SaturationExpansionSatisfiabilityCacheWriting",true); mConfSaturationExpansionSatisfiabilityCacheWritingChecked = true; } return mConfSaturationExpansionSatisfiabilityCacheWritingActivated; } bool CCalculationConfigurationExtension::isSaturationUnsatisfiabilityCacheWritingActivated() { if (!mConfSaturationUnsatisfiabilityCacheWritingChecked) { mConfSaturationUnsatisfiabilityCacheWritingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.SaturationExpansionSatisfiabilityCacheWriting",true); mConfSaturationUnsatisfiabilityCacheWritingChecked = true; } return mConfSaturationUnsatisfiabilityCacheWritingActivated; } bool CCalculationConfigurationExtension::isDatatypeReasoningActivated() { if (!mDatatypeReasoningChecked) { mDatatypeReasoningActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.ComputedTypesCaching",true); mDatatypeReasoningChecked = true; } return mDatatypeReasoningActivated; } bool CCalculationConfigurationExtension::isComputedTypesCachingActivated() { if (!mComputedTypesCachingChecked) { mComputedTypesCachingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.DatatypeReasoning",true); mComputedTypesCachingChecked = true; } return mComputedTypesCachingActivated; } bool CCalculationConfigurationExtension::isConstructionIndividualNodeMergingActivated() { if (!mConstructionIndividualNodeMergingChecked) { mConstructionIndividualNodeMergingActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.ConstructionIndividualNodeMerging",true); mConstructionIndividualNodeMergingChecked = true; } return mConstructionIndividualNodeMergingActivated; } cint64 CCalculationConfigurationExtension::getMaximumRecursiveProcessingConceptCount() { if (!mMaxRecProConceptCountChecked) { mMaxRecProConceptCount = CConfigDataReader::readConfigInteger(this,"Konclude.Calculation.MaximumRecursiveProcessingConceptCount",true); mMaxRecProConceptCountChecked = true; } return mMaxRecProConceptCount; } cint64 CCalculationConfigurationExtension::getSaturationReferredNodeManyConceptCount() { if (!mSaturationReferredNodeManyConceptCountChecked) { mSaturationReferredNodeManyConceptCount = CConfigDataReader::readConfigInteger(this,"Konclude.Calculation.Optimization.SaturationReferredNodeManyConceptCount",true); mSaturationReferredNodeManyConceptCountChecked = true; } return mSaturationReferredNodeManyConceptCount; } cint64 CCalculationConfigurationExtension::getSaturationManyConceptReferredNodeCountProcessLimit() { if (!mSaturationManyConceptReferredNodeCountProcessLimitChecked) { mSaturationManyConceptReferredNodeCountProcessLimit = CConfigDataReader::readConfigInteger(this,"Konclude.Calculation.Optimization.SaturationManyConceptReferredNodeCountProcessLimit",true); mSaturationManyConceptReferredNodeCountProcessLimitChecked = true; } return mSaturationManyConceptReferredNodeCountProcessLimit; } cint64 CCalculationConfigurationExtension::getSaturationReferredNodeConceptCountProcessLimit() { if (!mSaturationReferredNodeConceptCountProcessLimitChecked) { mSaturationReferredNodeConceptCountProcessLimit = CConfigDataReader::readConfigInteger(this,"Konclude.Calculation.Optimization.SaturationReferredNodeConceptCountProcessLimit",true); mSaturationReferredNodeConceptCountProcessLimitChecked = true; } return mSaturationReferredNodeConceptCountProcessLimit; } cint64 CCalculationConfigurationExtension::getSaturationReferredNodeUnprocessedCountProcessLimit() { if (!mSaturationReferredNodeUnprocessedCountProcessLimitChecked) { mSaturationReferredNodeUnprocessedCountProcessLimit = CConfigDataReader::readConfigInteger(this,"Konclude.Calculation.Optimization.SaturationReferredNodeUnprocessedCountProcessLimit",true); mSaturationReferredNodeUnprocessedCountProcessLimitChecked = true; } return mSaturationReferredNodeUnprocessedCountProcessLimit; } cint64 CCalculationConfigurationExtension::getSaturationReferredNodeCheckingDepth() { if (!mSaturationReferredNodeCheckingDepthChecked) { mSaturationReferredNodeCheckingDepth = CConfigDataReader::readConfigInteger(this,"Konclude.Calculation.Optimization.SaturationReferredNodeCheckingDepth",true); mSaturationReferredNodeCheckingDepthChecked = true; } return mSaturationReferredNodeCheckingDepth; } bool CCalculationConfigurationExtension::isForceManyConceptSaturationActivated() { if (!mConfForceManyConceptSaturationChecked) { mConfForceManyConceptSaturationActivated = CConfigDataReader::readConfigBoolean(this,"Konclude.Calculation.Optimization.ForceManyConceptNodeSaturation",true); mConfForceManyConceptSaturationChecked = true; } return mConfForceManyConceptSaturationActivated; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableCalculationJobInstantiation.h0000644000175000017500000000367212520551170032251 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLECALCULATIONJOBINSTANTIATION_H #define KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLECALCULATIONJOBINSTANTIATION_H // Libraries includes // Namespace includes #include "TaskSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { /*! * * \class CSatisfiableCalculationJobInstantiation * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCalculationJobInstantiation { // public methods public: //! Constructor CSatisfiableCalculationJobInstantiation(); virtual CSatisfiableCalculationJobInstantiation* getInstatiation(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLECALCULATIONJOBINSTANTIATION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CIncrementalConsistenceTaskData.cpp0000644000175000017500000000742612520551170031054 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIncrementalConsistenceTaskData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CIncrementalConsistenceTaskData::CIncrementalConsistenceTaskData(CSatisfiableCalculationTask* detSatTask, CSatisfiableCalculationTask* graphCachedSatTask, CConcreteOntology* prevOntology, CConsistenceTaskData* prevConsData) : CConsistenceTaskData(detSatTask,graphCachedSatTask) { mPrevOntology = prevOntology; mPrevConsData = prevConsData; mTotalNodeCount = 0; mAddedNodeCount = 0; mPreviousNodeCount = 0; } CIncrementalConsistenceTaskData::~CIncrementalConsistenceTaskData() { } QSet* CIncrementalConsistenceTaskData::getIndirectlyChangedNodeSet() { return &mIndirectlyChangedNodeSet; } QSet* CIncrementalConsistenceTaskData::getDeterministicallyChangedNodeSet() { return &mDeterministicallyChangedNodeSet; } QSet* CIncrementalConsistenceTaskData::getChangedCompatibleNodeSet() { return &mChangedCompatibleNodeSet; } CConcreteOntology* CIncrementalConsistenceTaskData::getPreviousOntology() { return mPrevOntology; } CConsistenceTaskData* CIncrementalConsistenceTaskData::getPreviousConsistenceData() { return mPrevConsData; } CIncrementalConsistenceTaskData* CIncrementalConsistenceTaskData::setPreviousOntology(CConcreteOntology* prevOntology) { mPrevOntology = prevOntology; return this; } CIncrementalConsistenceTaskData* CIncrementalConsistenceTaskData::setPreviousConsistenceData(CConsistenceTaskData* prevConsData) { mPrevConsData = prevConsData; return this; } cint64 CIncrementalConsistenceTaskData::getAddedNodeCount() { return mAddedNodeCount; } cint64 CIncrementalConsistenceTaskData::getTotalNodeCount() { return mTotalNodeCount; } cint64 CIncrementalConsistenceTaskData::getPreviousNodeCount() { return mPreviousNodeCount; } cint64 CIncrementalConsistenceTaskData::getChangedCompatibleNodeCount() { return mChangedCompatibleNodeSet.count(); } cint64 CIncrementalConsistenceTaskData::getDeterministicallyChangedNodeCount() { return mDeterministicallyChangedNodeSet.count(); } cint64 CIncrementalConsistenceTaskData::getIndirectlyChangedCount() { return mIndirectlyChangedNodeSet.count(); } CIncrementalConsistenceTaskData* CIncrementalConsistenceTaskData::setAddedNodeCount(cint64 addedNodeCount) { mAddedNodeCount = addedNodeCount; return this; } CIncrementalConsistenceTaskData* CIncrementalConsistenceTaskData::setTotalNodeCount(cint64 totalNodeCount) { mTotalNodeCount = totalNodeCount; return this; } CIncrementalConsistenceTaskData* CIncrementalConsistenceTaskData::setPreviousNodeCount(cint64 prevNodeCount) { mPreviousNodeCount = prevNodeCount; return this; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CTaskPreyingListner.cpp0000644000175000017500000000212312520551172026570 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskPreyingListner.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CTaskPreyingListner::CTaskPreyingListner() { } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableCalculationJobInstantiation.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableCalculationJobInstantiation.c0000644000175000017500000000241712520551170032240 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCalculationJobInstantiation.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CSatisfiableCalculationJobInstantiation::CSatisfiableCalculationJobInstantiation() { } CSatisfiableCalculationJobInstantiation* CSatisfiableCalculationJobInstantiation::getInstatiation() { return this; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableCalculationTask.cpp0000644000175000017500000002500312520551170030217 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCalculationTask.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CSatisfiableCalculationTask::CSatisfiableCalculationTask(CMemoryPool* memoryPool) : CTask(memoryPool) { } CSatisfiableCalculationTask::~CSatisfiableCalculationTask() { } CTaskResult* CSatisfiableCalculationTask::createTaskResult(CTaskHandleContext* handlerContext) { return &mBoolTaskResult; } CTaskStatus* CSatisfiableCalculationTask::createTaskStatus(CTaskHandleContext* handlerContext) { return &mDefaultTaskResult; } CTaskContext* CSatisfiableCalculationTask::getTaskContext(CTaskHandleContext* context) { return getProcessContext(context); } CProcessContext* CSatisfiableCalculationTask::getProcessContext(CTaskHandleContext* context) { if (!mProcessContext) { void* memManAdd = CTaskMemoryPoolAllocationManager::allocateMemoryToContainer(sizeof(CProcessContextBase),this,context->getTaskHandleMemoryAllocationManager()); mProcessContext = new (memManAdd) CProcessContextBase(this,context); mTaskContext = mProcessContext; } else { mProcessContext->updateContext(context); } return mProcessContext; } CProcessingDataBox* CSatisfiableCalculationTask::getProcessingDataBox() { return mProcessingDataBox; } CTask* CSatisfiableCalculationTask::makeTaskReference(CTask* dependedTask, CTaskHandleContext* handlerContext) { CTask::makeTaskReference(dependedTask,handlerContext); CSatisfiableCalculationTask* depSatCalcTask = (CSatisfiableCalculationTask*)dependedTask; depSatCalcTask->mProcessingDataBox->initProcessingDataBox(mProcessingDataBox); depSatCalcTask->mProcessContext->referenceProcessContext(mProcessContext); depSatCalcTask->mConsAdapter = mConsAdapter; depSatCalcTask->mClassMessAdapter = mClassMessAdapter; depSatCalcTask->mIndiAnalAdapter = mIndiAnalAdapter; depSatCalcTask->mRealMessAdapter = mRealMessAdapter; depSatCalcTask->mSatIncConsTestingAdapter = mSatIncConsTestingAdapter; depSatCalcTask->mSatIndDepTrackAdapter = mSatIndDepTrackAdapter; depSatCalcTask->mPossAssCollAdapter = mPossAssCollAdapter; return this; } CTask* CSatisfiableCalculationTask::initTask(CTask* parentTask, CTaskHandleContext* context) { mProcessContext = nullptr; mProcessingDataBox = nullptr; mConsAdapter = nullptr; mIndiAnalAdapter = nullptr; mClassMessAdapter = nullptr; mRealMessAdapter = nullptr; mPossAssCollAdapter = nullptr; mSatIncConsTestingAdapter = nullptr; getProcessContext(context); mProcessingDataBox = CObjectParameterizingAllocator< CProcessingDataBox,CProcessContext* >::allocateAndConstructAndParameterize(mProcessContext->getUsedMemoryAllocationManager(),mProcessContext); CTask::initTask(parentTask,context); return this; } CSatisfiableCalculationTask* CSatisfiableCalculationTask::initSatisfiableCalculationTask(CConcreteOntology* ontology, CCalculationConfigurationExtension* calculationConfig, CCalculationStatisticsCollector* calcStatCollector, CTaskHandleContext* context) { initTask(nullptr,context); mConsAdapter = nullptr; mIndiAnalAdapter = nullptr; mClassMessAdapter = nullptr; mRealMessAdapter = nullptr; mPossAssCollAdapter = nullptr; mSatIncConsTestingAdapter = nullptr; mSatIndDepTrackAdapter = nullptr; mCalcStatColl = calcStatCollector; mCalculationConfig = calculationConfig; mProcessingDataBox->initProcessingDataBox(ontology); return this; } CSatisfiableCalculationTask* CSatisfiableCalculationTask::initUndependedSatisfiableCalculationTask(CSatisfiableCalculationTask* baseTask, CCalculationConfigurationExtension* calculationConfig, CCalculationStatisticsCollector* calcStatCollector, CTaskHandleContext* context) { initTask(nullptr,context); mConsAdapter = nullptr; mIndiAnalAdapter = nullptr; mClassMessAdapter = nullptr; mRealMessAdapter = nullptr; mSatIncConsTestingAdapter = nullptr; mSatIndDepTrackAdapter = nullptr; mCalcStatColl = calcStatCollector; mCalculationConfig = calculationConfig; mProcessingDataBox->initProcessingDataBox(baseTask->mProcessingDataBox); mProcessContext->referenceProcessContext(baseTask->mProcessContext); mTaskType = baseTask->mTaskType; return this; } CSatisfiableCalculationTask* CSatisfiableCalculationTask::initBranchDependedSatisfiableCalculationTask(CSatisfiableCalculationTask* dependedTask, CTaskHandleContext* context) { initTask(dependedTask,context); mCalcStatColl = dependedTask->mCalcStatColl; mCalculationConfig = dependedTask->mCalculationConfig; mTaskType = dependedTask->mTaskType; return this; } CBooleanTaskResult* CSatisfiableCalculationTask::getSatisfiableCalculationTaskResult() { return &mBoolTaskResult; } CCalculationConfigurationExtension* CSatisfiableCalculationTask::getCalculationConfiguration() { return mCalculationConfig; } CTask* CSatisfiableCalculationTask::completeTask() { #ifndef KONCLUDE_FORCE_STATISTIC_DEACTIVATED if (mProcessContext && mProcessContext->getUsedProcessingStatisticsGathering()) { if (mParentTask) { // complete/flush statistics CSatisfiableCalculationTask* parentSatTask = (CSatisfiableCalculationTask*)mParentTask; if (parentSatTask->mProcessContext) { mProcessContext->getUsedProcessingStatisticsGathering()->addGatheredProcessingStatisticsTo(parentSatTask->mProcessContext->getUsedProcessingStatisticsGathering()); } } else if (mCalcStatColl) { CProcessingStatisticGathering* gatheredProcStat = mProcessContext->getUsedProcessingStatisticsGathering(); CProcessingStatistics* processingStatistics = CProcessingStatistics::getProcessingStatistics(); QList* statList = processingStatistics->getProcessingStatisticDescriptionList(); foreach (CProcessingStatisticDescription* statDesc, *statList) { mCalcStatColl->addProcessingStatistics(statDesc->getStatisticDescriptionString(),gatheredProcStat->getGatheredProcessingStatistic(statDesc->getStatisticGatheringIndex())); } } } #endif return CTask::completeTask(); } CSatisfiableCalculationTask* CSatisfiableCalculationTask::setConsistenceAdapter(CTaskPreyingAdapter* consistenceAdapter) { mConsAdapter = consistenceAdapter; return this; } CTaskPreyingAdapter* CSatisfiableCalculationTask::getConsistenceAdapter() { return mConsAdapter; } CSatisfiableCalculationTask* CSatisfiableCalculationTask::setSaturationIndividualsAnalysationObserver(CSaturationIndividualsAnalysingAdapter* indiAnalAdapter) { mIndiAnalAdapter = indiAnalAdapter; return this; } CSaturationIndividualsAnalysingAdapter* CSatisfiableCalculationTask::getSaturationIndividualsAnalysationObserver() { return mIndiAnalAdapter; } CSatisfiableCalculationTask* CSatisfiableCalculationTask::setClassificationMessageAdapter(CSatisfiableTaskClassificationMessageAdapter* classMessAdapter) { mClassMessAdapter = classMessAdapter; return this; } CSatisfiableTaskClassificationMessageAdapter* CSatisfiableCalculationTask::getClassificationMessageAdapter() { return mClassMessAdapter; } bool CSatisfiableCalculationTask::isCalculationTableauCompletionTask() { return getTaskType() == CALCULATIONTABLEAUCOMPLETIONTASK; } bool CSatisfiableCalculationTask::isCalculationTableauSaturationTask() { return getTaskType() == CALCULATIONTABLEAUAPPROXIMATEDSATURATIONTASK; } CSatisfiableCalculationTask* CSatisfiableCalculationTask::setCalculationTaskType(cint64 taskType) { mTaskType = taskType; return this; } cint64 CSatisfiableCalculationTask::getCalculationTaskType() { return getTaskType(); } CSatisfiableCalculationTask* CSatisfiableCalculationTask::setRealizationMarkedCandidatesMessageAdapter(CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter* realMessObserver) { mRealMessAdapter = realMessObserver; return this; } CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter* CSatisfiableCalculationTask::getRealizationMarkedCandidatesMessageAdapter() { return mRealMessAdapter; } CSatisfiableCalculationTask* CSatisfiableCalculationTask::setSatisfiableTaskIncrementalConsistencyTestingAdapter(CSatisfiableTaskIncrementalConsistencyTestingAdapter* incConsTestAdaptor) { mSatIncConsTestingAdapter = incConsTestAdaptor; return this; } CSatisfiableTaskIncrementalConsistencyTestingAdapter* CSatisfiableCalculationTask::getSatisfiableTaskIncrementalConsistencyTestingAdapter() { return mSatIncConsTestingAdapter; } CSatisfiableCalculationTask* CSatisfiableCalculationTask::setSatisfiableTaskIndividualDependenceTrackingAdapter(CSatisfiableTaskIndividualDependenceTrackingAdapter* indDepTrackAdaptor) { mSatIndDepTrackAdapter = indDepTrackAdaptor; return this; } CSatisfiableTaskIndividualDependenceTrackingAdapter* CSatisfiableCalculationTask::getSatisfiableTaskIndividualDependenceTrackingAdapter() { return mSatIndDepTrackAdapter; } CSatisfiableCalculationTask* CSatisfiableCalculationTask::setPossibleAssertionCollectionAdapter(CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter* possAssCollAdapter) { mPossAssCollAdapter = possAssCollAdapter; return this; } CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter* CSatisfiableCalculationTask::getPossibleAssertionCollectionAdapter() { return mPossAssCollAdapter; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CIncrementalConsistenceTaskData.h0000644000175000017500000000656512520551170030524 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CINCREMENTALCONSISTENCETASKDATA_H #define KONCLUDE_REASONER_KERNEL_TASK_CINCREMENTALCONSISTENCETASKDATA_H // Libraries includes // Namespace includes #include "CSatisfiableCalculationTask.h" #include "CConsistenceTaskData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { /*! * * \class CIncrementalConsistenceTaskData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIncrementalConsistenceTaskData : public CConsistenceTaskData { // public methods public: //! Constructor CIncrementalConsistenceTaskData(CSatisfiableCalculationTask* detSatTask, CSatisfiableCalculationTask* graphCachedSatTask, CConcreteOntology* prevOntology, CConsistenceTaskData* prevConsData); //! Destructor virtual ~CIncrementalConsistenceTaskData(); QSet* getIndirectlyChangedNodeSet(); QSet* getDeterministicallyChangedNodeSet(); QSet* getChangedCompatibleNodeSet(); CConcreteOntology* getPreviousOntology(); CConsistenceTaskData* getPreviousConsistenceData(); CIncrementalConsistenceTaskData* setPreviousOntology(CConcreteOntology* prevOntology); CIncrementalConsistenceTaskData* setPreviousConsistenceData(CConsistenceTaskData* prevConsData); cint64 getAddedNodeCount(); cint64 getTotalNodeCount(); cint64 getChangedCompatibleNodeCount(); cint64 getDeterministicallyChangedNodeCount(); cint64 getIndirectlyChangedCount(); cint64 getPreviousNodeCount(); CIncrementalConsistenceTaskData* setAddedNodeCount(cint64 addedNodeCount); CIncrementalConsistenceTaskData* setTotalNodeCount(cint64 totalNodeCount); CIncrementalConsistenceTaskData* setPreviousNodeCount(cint64 prevNodeCount); // protected methods protected: // protected variables protected: QSet mIndirectlyChangedNodeSet; QSet mDeterministicallyChangedNodeSet; QSet mChangedCompatibleNodeSet; CConcreteOntology* mPrevOntology; CConsistenceTaskData* mPrevConsData; cint64 mAddedNodeCount; cint64 mTotalNodeCount; cint64 mPreviousNodeCount; // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CINCREMENTALCONSISTENCETASKDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CTaskPreyingListner.h0000644000175000017500000000353512520551172026245 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CTASKPREYINGLISTNER_H #define KONCLUDE_REASONER_KERNEL_TASK_CTASKPREYINGLISTNER_H // Libraries includes // Namespace includes #include "TaskSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { /*! * * \class CTaskPreyingListner * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskPreyingListner { // public methods public: //! Constructor CTaskPreyingListner(); virtual CTaskPreyingListner* tellPreyedSatisfialbeTask(CSatisfiableCalculationTask* task) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CTASKPREYINGLISTNER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CTaskPreyingAdapter.h0000644000175000017500000000516312520551172026204 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CTASKPREYINGADAPTER_H #define KONCLUDE_REASONER_KERNEL_TASK_CTASKPREYINGADAPTER_H // Libraries includes // Namespace includes #include "TaskSettings.h" #include "CTaskPreyingListner.h" // Other includes #include "Reasoner/Consistiser/CConsistenceObserver.h" #include "Reasoner/Consistiser/CSaturationObserver.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Consistiser; namespace Kernel { namespace Task { /*! * * \class CTaskPreyingAdapter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskPreyingAdapter { // public methods public: //! Constructor CTaskPreyingAdapter(); CTaskPreyingAdapter(CConsistenceObserver* consObs); CTaskPreyingAdapter(CSaturationObserver* saturationObs); CTaskPreyingAdapter(CTaskPreyingListner* preyedListner); CConsistenceObserver* getConsitenceObserver(); CTaskPreyingAdapter* setConsitenceObserver(CConsistenceObserver* consObs); CTaskPreyingListner* getTaskPreyingListner(); CTaskPreyingAdapter* setTaskPreyingListner(CTaskPreyingListner* preyedListner); CSaturationObserver* getSaturationObserver(); CTaskPreyingAdapter* setSaturationObserver(CSaturationObserver* saturationObs); // protected methods protected: // protected variables protected: CConsistenceObserver* mConsObs; CSaturationObserver* mSaturationObs; CTaskPreyingListner* mPreyListner; // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CTASKPREYINGADAPTER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSaturationTaskData.h0000644000175000017500000000415112520551170026203 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CSATURATIONTASKDATA_H #define KONCLUDE_REASONER_KERNEL_TASK_CSATURATIONTASKDATA_H // Libraries includes // Namespace includes #include "CSatisfiableCalculationTask.h" // Other includes #include "Reasoner/Consistence/CSaturationData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Consistence; namespace Kernel { namespace Task { /*! * * \class CSaturationTaskData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationTaskData : public CSaturationData { // public methods public: //! Constructor CSaturationTaskData(CSatisfiableCalculationTask* saturationTask); //! Destructor virtual ~CSaturationTaskData(); CSatisfiableCalculationTask* getSaturationTask(); virtual bool overtakeData(); // protected methods protected: // protected variables protected: CSatisfiableCalculationTask* mSaturationTask; // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CSATURATIONTASKDATA_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskClassificationMessageAdapter.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskClassificationMessageAdap0000644000175000017500000000514012520551170032226 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableTaskClassificationMessageAdapter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CSatisfiableTaskClassificationMessageAdapter::CSatisfiableTaskClassificationMessageAdapter(CConcept* testingConcept, CConcreteOntology* testingOntology, CClassificationMessageDataObserver* observer, QHash* conRefLinkDataHash, cint64 extractionFlags) { mTestingCon = testingConcept; mOntology = testingOntology; mMessageObserver = observer; mConRefLinkDataHash = conRefLinkDataHash; mExtractionFlags = extractionFlags; } CConcept *CSatisfiableTaskClassificationMessageAdapter::getTestingConcept() { return mTestingCon; } CConcreteOntology *CSatisfiableTaskClassificationMessageAdapter::getTestingOntology() { return mOntology; } CClassificationMessageDataObserver *CSatisfiableTaskClassificationMessageAdapter::getClassificationMessageDataObserver() { return mMessageObserver; } QHash* CSatisfiableTaskClassificationMessageAdapter::getConceptReferenceLinkingDataHash() { return mConRefLinkDataHash; } cint64 CSatisfiableTaskClassificationMessageAdapter::getExtractionFlags() { return mExtractionFlags; } CSatisfiableTaskClassificationMessageAdapter* CSatisfiableTaskClassificationMessageAdapter::setExtractionFlags(cint64 flags) { mExtractionFlags = flags; return this; } bool CSatisfiableTaskClassificationMessageAdapter::hasExtractionFlags(cint64 flags) { return (mExtractionFlags & flags) != 0; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CConsistenceTaskData.cpp0000644000175000017500000000376012520551166026674 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConsistenceTaskData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CConsistenceTaskData::CConsistenceTaskData(CSatisfiableCalculationTask* detSatTask, CSatisfiableCalculationTask* graphCachedSatTask) { mDetSatTask = detSatTask; mGraphCachedSatTask = graphCachedSatTask; } CConsistenceTaskData::~CConsistenceTaskData() { } CSatisfiableCalculationTask* CConsistenceTaskData::getDeterministicSatisfiableTask() { return mDetSatTask; } CSatisfiableCalculationTask* CConsistenceTaskData::getCompletionGraphCachedSatisfiableTask() { return mGraphCachedSatTask; } bool CConsistenceTaskData::overtakeData() { if (mDetSatTask) { mDetSatTask->getTaskStatus()->setMemoryReleaseable(false); } if (mGraphCachedSatTask) { CSatisfiableCalculationTask* taskIt = mGraphCachedSatTask; while (taskIt) { taskIt->getTaskStatus()->setMemoryReleaseable(false); taskIt = (CSatisfiableCalculationTask*)taskIt->getParentTask(); } } return true; } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskRealizationMarkedCandidat0000644000175000017500000000510312520551170032234 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKREALIZATIONMARKEDCANDIDATESMESSAGEADAPTER_H #define KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKREALIZATIONMARKEDCANDIDATESMESSAGEADAPTER_H // Libraries includes // Namespace includes // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CConceptReferenceLinking.h" #include "Reasoner/Realizer/CRealizationMessageObserver.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Realizer; namespace Kernel { namespace Task { /*! * * \class CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter { // public methods public: //! Constructor CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter(CIndividual* testingIndividual = nullptr, CConcreteOntology* testingOntology = nullptr, CRealizationMessageObserver* observer = nullptr); CIndividual* getTestingIndividual(); CConcreteOntology* getTestingOntology(); CRealizationMessageObserver* getRealizationMessageDataObserver(); // protected methods protected: // protected variables protected: CIndividual* mTestingCon; CConcreteOntology* mOntology; CRealizationMessageObserver* mMessageObserver; // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKREALIZATIONMARKEDCANDIDATESMESSAGEADAPTER_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableCalculationTaskStatusPropagator.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableCalculationTaskStatusPropagat0000644000175000017500000000440712520551170032345 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CSatisfiableCalculationTaskStatusPropagator_H #define KONCLUDE_REASONER_KERNEL_TASK_CSatisfiableCalculationTaskStatusPropagator_H // Libraries includes // Namespace includes #include "CSatisfiableCalculationTask.h" // Other includes #include "Scheduler/CTaskStatusPropagator.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; namespace Reasoner { namespace Kernel { namespace Task { /*! * * \class CSatisfiableCalculationTaskStatusPropagator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCalculationTaskStatusPropagator : public CTaskStatusPropagator { // public methods public: //! Constructor CSatisfiableCalculationTaskStatusPropagator(); //! Destructor virtual ~CSatisfiableCalculationTaskStatusPropagator(); virtual bool updateTaskStatus(CTask* task, bool& moreDownPropagation, bool& moreUpPropagation); virtual bool completeTaskStatus(CTask* task, bool& moreUpPropagation); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CSatisfiableCalculationTaskStatusPropagator_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableCalculationTask.h0000644000175000017500000001550012520551170027665 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLECALCULATIONTASK_H #define KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLECALCULATIONTASK_H // Libraries includes // Namespace includes #include "CCalculationConfigurationExtension.h" #include "CCalculationStatisticsCollector.h" #include "CTaskPreyingAdapter.h" #include "CSatisfiableCalculationJobInstantiation.h" #include "CSatisfiableTaskClassificationMessageAdapter.h" #include "CSaturationIndividualsAnalysingAdapter.h" #include "CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter.h" #include "CSatisfiableTaskIncrementalConsistencyTestingAdapter.h" #include "CSatisfiableTaskIndividualDependenceTrackingAdapter.h" #include "CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter.h" // Other includes #include "Scheduler/CTask.h" #include "Reasoner/Kernel/Process/CProcessContextBase.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; namespace Reasoner { namespace Kernel { using namespace Process; namespace Task { /*! * * \class CSatisfiableCalculationTask * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCalculationTask : public CTask, public CSatisfiableCalculationJobInstantiation { // public methods public: //! Constructor CSatisfiableCalculationTask(CMemoryPool* memoryPool); //! Destructor virtual ~CSatisfiableCalculationTask(); virtual CTaskContext* getTaskContext(CTaskHandleContext* context); CProcessContext* getProcessContext(CTaskHandleContext* context); CProcessingDataBox* getProcessingDataBox(); virtual CTask* makeTaskReference(CTask* dependedTask, CTaskHandleContext* handlerContext); virtual CTask* initTask(CTask* parentTask, CTaskHandleContext* context); virtual CSatisfiableCalculationTask* initSatisfiableCalculationTask(CConcreteOntology* ontology, CCalculationConfigurationExtension* calculationConfig, CCalculationStatisticsCollector* calcStatCollector, CTaskHandleContext* context); virtual CSatisfiableCalculationTask* initBranchDependedSatisfiableCalculationTask(CSatisfiableCalculationTask* dependedTask, CTaskHandleContext* context); virtual CSatisfiableCalculationTask* initUndependedSatisfiableCalculationTask(CSatisfiableCalculationTask* baseTask, CCalculationConfigurationExtension* calculationConfig, CCalculationStatisticsCollector* calcStatCollector, CTaskHandleContext* context); CBooleanTaskResult* getSatisfiableCalculationTaskResult(); CCalculationConfigurationExtension* getCalculationConfiguration(); virtual CTask* completeTask(); CSatisfiableCalculationTask* setConsistenceAdapter(CTaskPreyingAdapter* consistenceAdapter); CTaskPreyingAdapter* getConsistenceAdapter(); CSatisfiableCalculationTask* setSaturationIndividualsAnalysationObserver(CSaturationIndividualsAnalysingAdapter* indiAnalAdapter); CSaturationIndividualsAnalysingAdapter* getSaturationIndividualsAnalysationObserver(); CSatisfiableCalculationTask* setClassificationMessageAdapter(CSatisfiableTaskClassificationMessageAdapter* classMessAdapter); CSatisfiableTaskClassificationMessageAdapter* getClassificationMessageAdapter(); CSatisfiableCalculationTask* setRealizationMarkedCandidatesMessageAdapter(CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter* realMessObserver); CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter* getRealizationMarkedCandidatesMessageAdapter(); CSatisfiableCalculationTask* setSatisfiableTaskIncrementalConsistencyTestingAdapter(CSatisfiableTaskIncrementalConsistencyTestingAdapter* incConsTestAdaptor); CSatisfiableTaskIncrementalConsistencyTestingAdapter* getSatisfiableTaskIncrementalConsistencyTestingAdapter(); CSatisfiableCalculationTask* setSatisfiableTaskIndividualDependenceTrackingAdapter(CSatisfiableTaskIndividualDependenceTrackingAdapter* indDepTrackAdaptor); CSatisfiableTaskIndividualDependenceTrackingAdapter* getSatisfiableTaskIndividualDependenceTrackingAdapter(); CSatisfiableCalculationTask* setPossibleAssertionCollectionAdapter(CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter* possAssCollAdapter); CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter* getPossibleAssertionCollectionAdapter(); bool isCalculationTableauCompletionTask(); bool isCalculationTableauSaturationTask(); CSatisfiableCalculationTask* setCalculationTaskType(cint64 taskType); cint64 getCalculationTaskType(); static const cint64 CALCULATIONTABLEAUCOMPLETIONTASK = 0; static const cint64 CALCULATIONTABLEAUAPPROXIMATEDSATURATIONTASK = 1; // protected methods protected: virtual CTaskResult* createTaskResult(CTaskHandleContext* handlerContext); virtual CTaskStatus* createTaskStatus(CTaskHandleContext* handlerContext); // protected variables protected: CBooleanTaskResult mBoolTaskResult; CTaskStatus mDefaultTaskResult; CProcessContextBase* mProcessContext; CProcessingDataBox* mProcessingDataBox; CCalculationConfigurationExtension* mCalculationConfig; CCalculationStatisticsCollector* mCalcStatColl; CTaskPreyingAdapter* mConsAdapter; CSaturationIndividualsAnalysingAdapter* mIndiAnalAdapter; CSatisfiableTaskClassificationMessageAdapter* mClassMessAdapter; CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter* mRealMessAdapter; CSatisfiableTaskIncrementalConsistencyTestingAdapter* mSatIncConsTestingAdapter; CSatisfiableTaskIndividualDependenceTrackingAdapter* mSatIndDepTrackAdapter; CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter* mPossAssCollAdapter; // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLECALCULATIONTASK_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CCalculationStatisticsCollector.cpp0000644000175000017500000000230712520551166031156 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationStatisticsCollector.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Task { CCalculationStatisticsCollector::CCalculationStatisticsCollector() { } CCalculationStatisticsCollector::~CCalculationStatisticsCollector() { } }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskIndividualDependenceTrackingAdapter.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CSatisfiableTaskIndividualDependenceTrack0000644000175000017500000000552112520551170032233 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKINDIVIDUALDEPENDENCETRACKINGADAPTER_H #define KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKINDIVIDUALDEPENDENCETRACKINGADAPTER_H // Libraries includes // Namespace includes #include "TaskSettings.h" // Other includes #include "Reasoner/Consistiser/CIndividualDependenceTrackingObserver.h" #include "Reasoner/Consistiser/CIndividualDependenceTrackingMarker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Consistiser; namespace Kernel { namespace Task { /*! * * \class CSatisfiableTaskIndividualDependenceTrackingAdapter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableTaskIndividualDependenceTrackingAdapter { // public methods public: //! Constructor CSatisfiableTaskIndividualDependenceTrackingAdapter(CIndividualDependenceTrackingObserver* indiDepTrackObserver, CIndividualDependenceTrackingMarker* indiDepTrackMarker = nullptr); CSatisfiableTaskIndividualDependenceTrackingAdapter* setIndividualDependenceTrackingObserver(CIndividualDependenceTrackingObserver* indiDepTrackObserver); CIndividualDependenceTrackingObserver* getIndividualDependenceTrackingObserver(); CSatisfiableTaskIndividualDependenceTrackingAdapter* setIndividualDependenceTrackingMarker(CIndividualDependenceTrackingMarker* indiDepTrackMarker); CIndividualDependenceTrackingMarker* getIndividualDependenceTrackingMarker(); // protected methods protected: // protected variables protected: CIndividualDependenceTrackingObserver* mIndiDepTrackObserver; CIndividualDependenceTrackingMarker* mIndiDepTrackMarker; // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CSATISFIABLETASKINDIVIDUALDEPENDENCETRACKINGADAPTER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Task/CConsistenceTaskData.h0000644000175000017500000000446112520551166026340 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_TASK_CConsistenceTaskData_H #define KONCLUDE_REASONER_KERNEL_TASK_CConsistenceTaskData_H // Libraries includes // Namespace includes #include "CSatisfiableCalculationTask.h" // Other includes #include "Reasoner/Consistence/CConsistenceData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Consistence; namespace Kernel { namespace Task { /*! * * \class CConsistenceTaskData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConsistenceTaskData : public CConsistenceData { // public methods public: //! Constructor CConsistenceTaskData(CSatisfiableCalculationTask* detSatTask, CSatisfiableCalculationTask* graphCachedSatTask); //! Destructor virtual ~CConsistenceTaskData(); CSatisfiableCalculationTask* getDeterministicSatisfiableTask(); CSatisfiableCalculationTask* getCompletionGraphCachedSatisfiableTask(); virtual bool overtakeData(); // protected methods protected: // protected variables protected: CSatisfiableCalculationTask* mDetSatTask; CSatisfiableCalculationTask* mGraphCachedSatTask; // private methods private: // private variables private: }; }; // end namespace Task }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_TASK_CConsistenceTaskData_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/0000755000175000017500000000000012613407252022265 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCache.cpp0000644000175000017500000003000212544355206030621 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COccurrenceUnsatisfiableCache.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { COccurrenceUnsatisfiableCache::COccurrenceUnsatisfiableCache(qint64 writeUpdateSlotCount, const QString &threadIdentifierName, CWatchDog *watchDogThread) : CThread(threadIdentifierName,watchDogThread),updatesSlotItemVector(writeUpdateSlotCount,0) { cacheWritingRequested = false; updateSlotCount = writeUpdateSlotCount; writeOperationsCount = 0; mCachingTag = 0; lastUpdateSlot = nullptr; startThread(); } COccurrenceUnsatisfiableCache::~COccurrenceUnsatisfiableCache() { qDeleteAll(cacheReaderList); qDeleteAll(cacheWriterList); } COccurrenceUnsatisfiableCacheReader *COccurrenceUnsatisfiableCache::getCacheReader() { cacheReaderSyncMutex.lock(); COccurrenceUnsatisfiableCacheReader *reader = new COccurrenceUnsatisfiableCacheReader(this); cacheReaderList.append(reader); cacheReaderSyncMutex.unlock(); return reader; } COccurrenceUnsatisfiableCacheWriter *COccurrenceUnsatisfiableCache::getCacheWriter() { cacheWriterSyncMutex.lock(); COccurrenceUnsatisfiableCacheWriter *writer = new COccurrenceUnsatisfiableCacheWriter(this); cacheWriterList.append(writer); cacheWriterSyncMutex.unlock(); return writer; } bool COccurrenceUnsatisfiableCache::isCacheWritePending() { return cacheWritingRequested; } cint64 COccurrenceUnsatisfiableCache::getCurrentCachingTag() { return mCachingTag; } CCacheStatistics* COccurrenceUnsatisfiableCache::getCacheStatistics() { return &mCachStat; } COccurrenceUnsatisfiableCacheEntry *COccurrenceUnsatisfiableCache::getPrimarCacheEntry() { if (!CThread::isThreadRunning()) { CThread::waitSynchronization(); } return primarCacheEntry; } void COccurrenceUnsatisfiableCache::addUnsatisfiableCacheEntry(QList &itemList) { // item list is and has to be copied in event constructor! CThread::postEvent(new CWriteUnsatisfiableCacheEntryEvent(itemList)); } void COccurrenceUnsatisfiableCache::threadStarted() { primarCacheEntry = new COccurrenceUnsatisfiableCacheEntry(CCacheValue(0,0,CCacheValue::CACHEVALCONCEPTONTOLOGYTAG),0,updateSlotCount,0); container.append(primarCacheEntry); for (qint64 idx = 0; idx < updateSlotCount; ++idx) { updatesSlotItemVector[idx] = new COccurrenceUnsatisfiableCacheUpdateSlotItem(idx); notusedUpdatesSlotsList.append(updatesSlotItemVector[idx]); } } void COccurrenceUnsatisfiableCache::threadStopped() { for (qint64 idx = 0; idx < updateSlotCount; ++idx) { delete updatesSlotItemVector[idx]; } primarCacheEntry = 0; qDeleteAll(container); container.clear(); } bool COccurrenceUnsatisfiableCache::waitCacheWritePrepared() { for (qint64 i = usedUpdatesSlotsList.count(); i > 0; --i) { COccurrenceUnsatisfiableCacheUpdateSlotItem *slotItem = usedUpdatesSlotsList.takeFirst(); if (!slotItem->hasCacheReaders()) { slotItem->cleanSlotUpdateItems(); notusedUpdatesSlotsList.append(slotItem); } else { usedUpdatesSlotsList.append(slotItem); } } while (notusedUpdatesSlotsList.isEmpty()) { // wait until one update slot is not longer used QThread::msleep(10); for (qint64 i = usedUpdatesSlotsList.count(); i > 0; --i) { COccurrenceUnsatisfiableCacheUpdateSlotItem *slotItem = usedUpdatesSlotsList.takeFirst(); if (!slotItem->hasCacheReaders()) { slotItem->cleanSlotUpdateItems(); notusedUpdatesSlotsList.append(slotItem); } else { usedUpdatesSlotsList.append(slotItem); } } } return true; } bool COccurrenceUnsatisfiableCache::activateCacheUpdate(COccurrenceUnsatisfiableCacheUpdateSlotItem *updateSlot) { qint64 slotIndex = updateSlot->getSlotIndex(); updateSlot->activateSlotUpdateItems(); usedUpdatesSlotsList.append(updateSlot); foreach (COccurrenceUnsatisfiableCacheEntry *entry, container) { COccurrenceUnsatisfiableCacheEntriesHash *prevDelHash = entry->updateSlotCacheHashGetPrevious(slotIndex); if (prevDelHash) { updateSlot->addCacheEntriesHash(prevDelHash); } } lastUpdateSlot = updateSlot; cacheReaderSyncMutex.lock(); foreach (COccurrenceUnsatisfiableCacheReader *reader, cacheReaderList) { reader->changeUpdateSlot(updateSlot); } cacheReaderSyncMutex.unlock(); return true; } bool COccurrenceUnsatisfiableCache::writeCacheTags(CCacheValue* cacheValue, cint64 cachingTag, cint64 cachedTag, cint64 cachingSize) { CCacheValue::CACHEVALUEIDENTIFIER valId = cacheValue->getCacheValueIdentifier(); bool hasConcept = false; bool conceptNeg = false; if (valId == CCacheValue::CACHEVALTAGANDCONCEPT) { hasConcept = true; conceptNeg = false; } else if (valId == CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT) { hasConcept = true; conceptNeg = true; } if (hasConcept) { cint64 identification = cacheValue->getIdentification(); CConcept* concept = (CConcept*)identification; if (concept) { CConceptProcessData* conProData = (CConceptProcessData*)concept->getConceptData(); if (conProData) { CUnsatisfiableCachingTags* unsatCachingTags = conProData->getUnsatisfiableCachingTags(conceptNeg); if (!unsatCachingTags) { unsatCachingTags = new CUnsatisfiableCachingTags(); conProData->setUnsatisfiableCachingTags(conceptNeg,unsatCachingTags); } unsatCachingTags->updateCachingTags(cachedTag,cachingTag,cachingSize); return true; } } } return false; } bool COccurrenceUnsatisfiableCache::writeCacheValues(COccurrenceUnsatisfiableCacheUpdateSlotItem *updateSlot, QList *cacheValueList) { qint64 slotIndex = updateSlot->getSlotIndex(); COccurrenceUnsatisfiableCacheEntry *cache = primarCacheEntry; cint64 cachingTag = mCachingTag+1; cint64 cachedTag = mCacheTaggingPool.takeNextTag(); cint64 cachingSize = cacheValueList->count(); foreach (CCacheValue cacheValue, *cacheValueList) { COccurrenceUnsatisfiableCacheEntriesHash *cacheHash = cache->getCacheEntriesHash(); if (!cacheHash || !cacheHash->contains(cacheValue)) { COccurrenceUnsatisfiableCacheEntriesHash *updatedCacheHash = 0; if (!updatedCacheHash) { if (cacheHash) { updatedCacheHash = new COccurrenceUnsatisfiableCacheEntriesHash(*cacheHash); } else { updatedCacheHash = new COccurrenceUnsatisfiableCacheEntriesHash(); } updateSlot->addCacheEntry(cache); } COccurrenceUnsatisfiableCacheEntry *nextCache = new COccurrenceUnsatisfiableCacheEntry(cacheValue,0,updateSlotCount,slotIndex); container.append(nextCache); qint64 tag = cacheValue.getTag(); updatedCacheHash->insert(cacheValue,nextCache); cache->setMinimumCandidate(tag); cache->setMaximumCandidate(tag); COccurrenceUnsatisfiableCacheEntriesHash *prevDelHash = cache->setCacheEntriesHashSlotGetPrevious(slotIndex,updatedCacheHash); if (prevDelHash) { updateSlot->addCacheEntriesHash(prevDelHash); } cache = nextCache; } else { cache = cacheHash->value(cacheValue); } writeCacheTags(&cacheValue,cachingTag,cachedTag,cachingSize); } if (cache) { cache->copyCacheTerminationValuesList(cacheValueList); } ++mCachingTag; return true; } bool COccurrenceUnsatisfiableCache::testAlreadyCached(COccurrenceUnsatisfiableCacheUpdateSlotItem *updateSlot, QList *cacheValueList) { qint64 slotIndex = updateSlot->getSlotIndex(); COccurrenceUnsatisfiableCacheEntry *cache = primarCacheEntry; foreach (CCacheValue cacheValue, *cacheValueList) { if (cache->isUnsatisfiableTermination()) { return true; } COccurrenceUnsatisfiableCacheEntriesHash *cacheHash = cache->getCacheEntriesHash(); if (!cacheHash) { return false; } cache = cacheHash->value(cacheValue); if (!cache) { return false; } } if (cache->isUnsatisfiableTermination()) { return true; } return false; } QString COccurrenceUnsatisfiableCache::getCachingConceptsDebugString(QList &itemList) { QString cachingConString; for (QList::const_iterator it = itemList.constBegin(), itEnd = itemList.constEnd(); it != itEnd; ++it) { CCacheValue cacheValue(*it); QString conceptString; if (cacheValue.getCacheValueIdentifier() == CCacheValue::CACHEVALTAGANDCONCEPT) { conceptString = CConceptTextFormater::getConceptString((CConcept*)cacheValue.getIdentification(),false); } else if (cacheValue.getCacheValueIdentifier() == CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT) { conceptString = CConceptTextFormater::getConceptString((CConcept*)cacheValue.getIdentification(),true); } if (!cachingConString.isEmpty()) { cachingConString += QString(", "); } cachingConString += conceptString; } return cachingConString; } bool COccurrenceUnsatisfiableCache::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CThread::processCustomsEvents(type,event)) { return true; } if (type == EVENTWRITEUNSATISFIABLECACHEENTRY) { CWriteUnsatisfiableCacheEntryEvent *wuc = (CWriteUnsatisfiableCacheEntryEvent *)event; QList *cEL = wuc->getCacheEntryList(); if (!lastUpdateSlot || !testAlreadyCached(lastUpdateSlot,cEL)) { cacheWritingRequested = true; if (waitCacheWritePrepared()) { COccurrenceUnsatisfiableCacheUpdateSlotItem *updateSlot = notusedUpdatesSlotsList.takeFirst(); writeOperationsCount++; writeCacheValues(updateSlot,cEL); mCachStat.incCacheEntriesCount(); activateCacheUpdate(updateSlot); for (qint64 i = usedUpdatesSlotsList.count(); i > 0; --i) { COccurrenceUnsatisfiableCacheUpdateSlotItem *slotItem = usedUpdatesSlotsList.takeFirst(); if (!slotItem->hasCacheReaders()) { slotItem->cleanSlotUpdateItems(); notusedUpdatesSlotsList.append(slotItem); } else { usedUpdatesSlotsList.append(slotItem); } } //KONCLUCE_OCCURUNSATCACHE_CACHING_STRING_INSTRUCTION(mCachingString = getCachingConceptsDebugString(*cEL)); //KONCLUCE_OCCURUNSATCACHE_CACHING_STRING_INSTRUCTION(mCachedStringList.append(mCachingString)); //KONCLUCE_OCCURUNSATCACHE_CACHING_STRING_INSTRUCTION(std::cout<<"\nUnsatisfiable cached concepts: "<. * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCache.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CCache::CCache() { } CCache::~CCache() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheContext.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheC0000644000175000017500000000671212520551036032171 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeAssociatedExpansionCacheContext.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationNodeAssociatedExpansionCacheContext::CSaturationNodeAssociatedExpansionCacheContext() { mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); mMemMan = new CLimitedReserveMemoryPoolAllocationManager(mMemoryPoolProvider); mAddRelMemory = 0; mConSatUpdateLinker = nullptr; } CSaturationNodeAssociatedExpansionCacheContext::~CSaturationNodeAssociatedExpansionCacheContext() { delete mMemMan; delete mMemoryPoolProvider; } CMemoryPoolAllocationManager* CSaturationNodeAssociatedExpansionCacheContext::getMemoryPoolAllocationManager() { return mMemMan; } CMemoryAllocationManager* CSaturationNodeAssociatedExpansionCacheContext::getMemoryAllocationManager() { return mMemMan; } CMemoryPoolProvider* CSaturationNodeAssociatedExpansionCacheContext::getMemoryPoolProvider() { return mMemoryPoolProvider; } cint64 CSaturationNodeAssociatedExpansionCacheContext::getMemoryConsumption() { return mAddRelMemory + mMemoryPoolProvider->getAllocatedReleaseDifferencePoolSize(); } CSaturationNodeAssociatedExpansionCacheContext* CSaturationNodeAssociatedExpansionCacheContext::releaseTemporaryMemoryPools(CMemoryPool* memoryPools) { CMemoryPool* memoryPoolIt = memoryPools; while (memoryPoolIt) { mAddRelMemory += memoryPoolIt->getMemoryBlockSize(); memoryPoolIt = memoryPoolIt->getNext(); } mMemMan->releaseTemporaryMemoryPools(memoryPools); return this; } CIndividualSaturationProcessNodeStatusUpdateLinker* CSaturationNodeAssociatedExpansionCacheContext::getIndividualSaturationUpdateLinker(bool create) { CIndividualSaturationProcessNodeStatusUpdateLinker* conSatUpdateLinker = mConSatUpdateLinker; if (!conSatUpdateLinker && create) { conSatUpdateLinker = CObjectAllocator::allocateAndConstruct(mMemMan); } conSatUpdateLinker->clearNext(); if (mConSatUpdateLinker) { mConSatUpdateLinker = mConSatUpdateLinker->getNext(); } return conSatUpdateLinker; } CSaturationNodeAssociatedExpansionCacheContext* CSaturationNodeAssociatedExpansionCacheContext::addIndividualSaturationUpdateLinker(CIndividualSaturationProcessNodeStatusUpdateLinker* linker) { if (linker) { linker->clearNext(); linker = linker->append(mConSatUpdateLinker); } return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeCacheUpdater.cpp0000644000175000017500000002203612520551040030277 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeCacheUpdater.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationNodeCacheUpdater::CSaturationNodeCacheUpdater(CSaturationNodeAssociatedExpansionCacheContext* context) { mIndirectUpdatedStatusIndiNodeCount = 0; mDirectUpdatedStatusIndiNodeCount = 0; mContext = context; } CSaturationNodeCacheUpdater* CSaturationNodeCacheUpdater::propagateUnsatisfibility(CIndividualSaturationProcessNode* node, CSaturationNodeAssociatedExpansionCacheContext* context) { CIndividualSaturationProcessNodeStatusFlags flags; flags.setClashedFlag(true); updateDirectAddingIndividualStatusFlags(node,&flags,context); return this; } CIndividualSaturationProcessNodeStatusUpdateLinker* CSaturationNodeCacheUpdater::createIndividualSaturationUpdateLinker(CSaturationNodeAssociatedExpansionCacheContext* context) { CIndividualSaturationProcessNodeStatusUpdateLinker* conSatUpdateLinker = context->getIndividualSaturationUpdateLinker(); return conSatUpdateLinker; } void CSaturationNodeCacheUpdater::releaseIndividualSaturationUpdateLinker(CIndividualSaturationProcessNodeStatusUpdateLinker* conSatUpdateLinker, CSaturationNodeAssociatedExpansionCacheContext* context) { context->addIndividualSaturationUpdateLinker(conSatUpdateLinker); } bool CSaturationNodeCacheUpdater::requiresDirectAddingIndividualStatusFlagsUpdate(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CSaturationNodeAssociatedExpansionCacheContext* context) { CIndividualSaturationProcessNodeStatusFlags* indiDirectFlags = indiNode->getDirectStatusFlags(); return !indiDirectFlags->hasFlags(addingFlags,true); } bool CSaturationNodeCacheUpdater::requiresIndirectAddingIndividualStatusFlagsUpdate(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CSaturationNodeAssociatedExpansionCacheContext* context) { CIndividualSaturationProcessNodeStatusFlags* indiIndirectFlags = indiNode->getIndirectStatusFlags(); return !indiIndirectFlags->hasFlags(addingFlags,true); } void CSaturationNodeCacheUpdater::updateDirectAddingIndividualStatusFlags(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CSaturationNodeAssociatedExpansionCacheContext* context) { if (requiresDirectAddingIndividualStatusFlagsUpdate(indiNode,addingFlags,context)) { CIndividualSaturationProcessNodeStatusUpdateLinker* directUpdateLinker = createIndividualSaturationUpdateLinker(context); directUpdateLinker->initUpdateNodeLinker(indiNode); CIndividualSaturationProcessNodeStatusFlags* directIndiFlags = indiNode->getDirectStatusFlags(); directIndiFlags->addFlags(addingFlags); ++mDirectUpdatedStatusIndiNodeCount; while (directUpdateLinker) { CIndividualSaturationProcessNodeStatusUpdateLinker* nextUpdateLinker = directUpdateLinker; directUpdateLinker = directUpdateLinker->getNext(); CIndividualSaturationProcessNode* updateIndiNode = nextUpdateLinker->getData(); nextUpdateLinker->clearNext(); releaseIndividualSaturationUpdateLinker(nextUpdateLinker,context); for (CXNegLinker* depdendingIndiLinkerIt = updateIndiNode->getCopyDependingIndividualNodeLinker(); depdendingIndiLinkerIt; depdendingIndiLinkerIt = depdendingIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* dependingIndi = depdendingIndiLinkerIt->getData(); if (requiresDirectAddingIndividualStatusFlagsUpdate(dependingIndi,addingFlags,context)) { CIndividualSaturationProcessNodeStatusFlags* directIndiFlags = dependingIndi->getDirectStatusFlags(); directIndiFlags->addFlags(addingFlags); ++mDirectUpdatedStatusIndiNodeCount; directUpdateLinker = createIndividualSaturationUpdateLinker(context)->initUpdateNodeLinker(dependingIndi)->append(directUpdateLinker); } } updateIndirectAddingIndividualStatusFlags(updateIndiNode,addingFlags,context); } } } void CSaturationNodeCacheUpdater::updateIndirectAddingIndividualStatusFlags(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CSaturationNodeAssociatedExpansionCacheContext* context) { if (requiresIndirectAddingIndividualStatusFlagsUpdate(indiNode,addingFlags,context)) { CIndividualSaturationProcessNodeStatusUpdateLinker* directUpdateLinker = createIndividualSaturationUpdateLinker(context); directUpdateLinker->initUpdateNodeLinker(indiNode); CIndividualSaturationProcessNodeStatusFlags* indirectIndiFlags = indiNode->getIndirectStatusFlags(); indirectIndiFlags->addFlags(addingFlags); ++mIndirectUpdatedStatusIndiNodeCount; while (directUpdateLinker) { CIndividualSaturationProcessNodeStatusUpdateLinker* nextUpdateLinker = directUpdateLinker; directUpdateLinker = directUpdateLinker->getNext(); CIndividualSaturationProcessNode* updateIndiNode = nextUpdateLinker->getData(); nextUpdateLinker->clearNext(); releaseIndividualSaturationUpdateLinker(nextUpdateLinker,context); for (CXNegLinker* depdendingIndiLinkerIt = updateIndiNode->getCopyDependingIndividualNodeLinker(); depdendingIndiLinkerIt; depdendingIndiLinkerIt = depdendingIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* dependingIndi = depdendingIndiLinkerIt->getData(); if (requiresIndirectAddingIndividualStatusFlagsUpdate(dependingIndi,addingFlags,context)) { CIndividualSaturationProcessNodeStatusFlags* indirectIndiFlags = dependingIndi->getIndirectStatusFlags(); indirectIndiFlags->addFlags(addingFlags); ++mIndirectUpdatedStatusIndiNodeCount; directUpdateLinker = createIndividualSaturationUpdateLinker(context)->initUpdateNodeLinker(dependingIndi)->append(directUpdateLinker); } } CRoleBackwardSaturationPropagationHash* backwardPropHash = updateIndiNode->getRoleBackwardPropagationHash(false); if (backwardPropHash) { CPROCESSHASH* backPropHash = backwardPropHash->getRoleBackwardPropagationDataHash(); for (CPROCESSHASH::const_iterator it = backPropHash->constBegin(), itEnd = backPropHash->constEnd(); it != itEnd; ++it) { CRole* backwardPropRole = it.key(); const CRoleBackwardSaturationPropagationHashData& backwardPropData = it.value(); for (CBackwardSaturationPropagationLink* linkIt = backwardPropData.mLinkLinker; linkIt; linkIt = linkIt->getNext()) { CIndividualSaturationProcessNode* sourceIndividual = linkIt->getSourceIndividual(); if (requiresIndirectAddingIndividualStatusFlagsUpdate(sourceIndividual,addingFlags,context)) { CIndividualSaturationProcessNodeStatusFlags* indirectIndiFlags = sourceIndividual->getIndirectStatusFlags(); indirectIndiFlags->addFlags(addingFlags); ++mIndirectUpdatedStatusIndiNodeCount; directUpdateLinker = createIndividualSaturationUpdateLinker(context)->initUpdateNodeLinker(sourceIndividual)->append(directUpdateLinker); } } } } for (CXLinker* nonInvConnIndiLinkerIt = updateIndiNode->getNonInverseConnectedIndividualNodeLinker(); nonInvConnIndiLinkerIt; nonInvConnIndiLinkerIt = nonInvConnIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* sourceIndividual = nonInvConnIndiLinkerIt->getData(); if (requiresIndirectAddingIndividualStatusFlagsUpdate(sourceIndividual,addingFlags,context)) { CIndividualSaturationProcessNodeStatusFlags* indirectIndiFlags = sourceIndividual->getIndirectStatusFlags(); indirectIndiFlags->addFlags(addingFlags); ++mIndirectUpdatedStatusIndiNodeCount; directUpdateLinker = createIndividualSaturationUpdateLinker(context)->initUpdateNodeLinker(sourceIndividual)->append(directUpdateLinker); } } } } } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCompletionGraphCache.h0000644000175000017500000000353012520551026026555 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCOMPLETIONGRAPHCACHE_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCOMPLETIONGRAPHCACHE_H // Libraries includes // Namespace includes #include "CCache.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CCompletionGraphCache * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCompletionGraphCache : public CCache { // public methods public: //! Constructor CCompletionGraphCache(); //! Destructor virtual ~CCompletionGraphCache(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCOMPLETIONGRAPHCACHE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCache.h0000644000175000017500000001563512520551040031266 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHE_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHE_H // Libraries includes #include #include #include // Namespace includes #include "CacheSettings.h" #include "CSatisfiableCache.h" #include "CSignatureSatisfiableExpanderCacheHasher.h" #include "CSignatureSatisfiableExpanderCacheSlotItem.h" #include "CSignatureSatisfiableExpanderCacheEntry.h" #include "CSignatureSatisfiableExpanderCacheContext.h" #include "CSignatureSatisfiableExpanderCacheReader.h" #include "CSignatureSatisfiableExpanderCacheEntryExpandWriteData.h" #include "CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData.h" #include "CCacheStatistics.h" // Other includes #include "Concurrent/CThread.h" #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" #include "Reasoner/Kernel/Cache/Events/CWriteCachedDataEvent.h" #include "Reasoner/Kernel/Cache/Events/CWriteExpandCachedEvent.h" #include "Reasoner/Kernel/Cache/Events/CWriteSatisfiableBranchCachedEvent.h" #include "Utilities/Memory/CObjectMemoryPoolAllocator.h" #include "Utilities/Memory/CObjectParameterizingAllocator.h" #include "Utilities/Memory/CMemoryPoolContainerAllocationManager.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" //#define KONCLUCE_SATISFIBALE_EXPANDER_CACHE_DIRECT_WRITING namespace Konclude { using namespace Config; using namespace Concurrent; using namespace Context; using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { using namespace Events; /*! * * \class CSignatureSatisfiableExpanderCache * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureSatisfiableExpanderCache : public CThread, public CSatisfiableCache { // public methods public: //! Constructor CSignatureSatisfiableExpanderCache(CConfiguration* config, QString threadIdentifierName = "Satisfiable-Expander-Cache", CWatchDog *watchDogThread = 0); //! Destructor virtual ~CSignatureSatisfiableExpanderCache(); CSignatureSatisfiableExpanderCacheReader* createCacheReader(); CSignatureSatisfiableExpanderCacheWriter* createCacheWriter(); CSignatureSatisfiableExpanderCache* writeCachedData(CSignatureSatisfiableExpanderCacheEntryWriteData* writeData, CMemoryPool* memoryPools); CSignatureSatisfiableExpanderCache* writeExpandCached(cint64 prevSignature, cint64 newSignature, CCACHINGLIST* cacheValueList, CCACHINGHASH* depHash, CMemoryPool* memoryPools); CSignatureSatisfiableExpanderCache* writeSatisfiableBranchCached(cint64 signature, CCACHINGLIST* cacheValueList, CCACHINGLIST* branchedList, CMemoryPool* memoryPools); CCacheStatistics* getCacheStatistics(); // protected methods protected: bool isCachingDataExpandable(CSignatureSatisfiableExpanderCacheContext* context, CSignatureSatisfiableExpanderCacheEntry* entry, cint64 signature, CCACHINGLIST* cacheValueList); void writeExpanderCachingData(CSignatureSatisfiableExpanderCacheContext* context, CSignatureSatisfiableExpanderCacheEntry* entry, bool extending, CCACHINGLIST* cacheValueList, CCACHINGHASH* depHash); bool writeExpanderCachingData(CSignatureSatisfiableExpanderCacheContext* context, cint64 prevSignature, cint64 newSignature, CCACHINGLIST* cacheValueList, CCACHINGHASH* depHash); void addExpanderCachingData(CSignatureSatisfiableExpanderCacheContext* context, const CCacheValue& cacheValue, CCACHINGHASH* newTagHash, CCACHINGHASH* depHash, CCACHINGHASH* tagCacheValueHash, CExpanderCacheValueLinker*& lastExpCacheValueLinker, CExpanderCacheValueLinker*& firstExpCacheValueLinker); bool writeSatisfiableBranchedCachingData(CSignatureSatisfiableExpanderCacheContext* context, cint64 signature, CCACHINGLIST* cacheValueList, CCACHINGLIST* branchedValueList); void createReaderSlotUpdate(CSignatureSatisfiableExpanderCacheContext* context); void cleanUnusedSlots(CSignatureSatisfiableExpanderCacheContext* context); virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); cint64 getRequiredSignatureReferCountForNextCacheEntryCreation(CSignatureSatisfiableExpanderCacheContext* context); cint64 canCreateCacheEntryForSignature(cint64 singature, CSignatureSatisfiableExpanderCacheContext* context); // protected variables protected: CCACHINGHASH* mSigItemHash; CCACHINGSET* mIncompatibleSigSet; CCACHINGSET* mAlreadyExpSigSet; // currently not used CCACHINGHASH* mHasherItemHash; CCACHINGHASH* mSignatureReferCountSet; cint64 mNextCacheEntryRequiredSignatureRefCount; cint64 mNextMemoryLevelRequiredSignatureRefCount; cint64 mNextCacheEntryRequiredSignatureReferenceCountIncrease; cint64 mNextMemoryLevelIncreaseForRequiredSignatureReferenceCount; cint64 mWriteDataCount; cint64 mStartWriteCollectCount; cint64 mNextWriteCollectCount; cint64 mCollectCount; CMemoryPool* mCollectMemoryPools; CSignatureSatisfiableExpanderCacheEntryWriteData* mCollectWriteData; CCacheStatistics mCacheStat; CSignatureSatisfiableExpanderCacheSlotItem* mSlotLinker; CSignatureSatisfiableExpanderCacheReader* mReaderLinker; QMutex mReaderSyncMutex; CSignatureSatisfiableExpanderCacheContext mContext; CConfiguration* mConfig; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheReader.h0000644000175000017500000001000512520551032031377 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEREADER_H #define KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEREADER_H // Libraries includes #include #include #include // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "COccurrenceUnsatisfiableCache.h" #include "COccurrenceUnsatisfiableCacheEntry.h" #include "COccurrenceUnsatisfiableCacheUpdateSlotItem.h" #include "CIncrementalUnsatisfiableCacheReader.h" // Other includes #include "Utilities/CMemoryManager.hpp" #include "Utilities/CDynamicExpandingMemoryManager.hpp" #include "Utilities/CDblLinker.hpp" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class COccurrenceUnsatisfiableCacheReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COccurrenceUnsatisfiableCacheReader : public CIncrementalUnsatisfiableCacheReader { // public methods public: //! Constructor COccurrenceUnsatisfiableCacheReader(COccurrenceUnsatisfiableCache *unsatisfiableCache); //! Destructor virtual ~COccurrenceUnsatisfiableCacheReader(); virtual bool isUnsatisfiable(QVector &itemVec, qint64 count); virtual CDblLinker *incrementalUnsatisfiableTest(CCacheValue *cacheValue, CDblLinker *cacheEntries, bool *unsatisfiable = 0, bool *continueTesting = 0); virtual QList getUnsatisfiableItems(QVector &itemVec, qint64 count); virtual bool incrementUnsatisfiableTest(CCacheValue *cacheValue, bool *continueTestingUseful = 0); virtual void incrementUnsatisfiableTestReset(); virtual bool isUnsatisfiable(QVector &itemVec, qint64 count, QList *unsatisfiableItemList); virtual COccurrenceUnsatisfiableCacheUpdateSlotItem *changeUpdateSlot(COccurrenceUnsatisfiableCacheUpdateSlotItem *nextUpdateSlot); virtual QList getLastTestedUnsatisfiableItems(); CXLinker* getUnsatisfiableItems(CXLinker* cacheValueTestLinker, CMemoryAllocationManager* memMan); cint64 getCurrentCachingTag(); // protected methods protected: // private methods private: bool moveToNextSlot(); // private variables private: COccurrenceUnsatisfiableCache *cache; COccurrenceUnsatisfiableCacheUpdateSlotItem *cacheSlotItem; QAtomicPointer mNextCacheSlotItemPointer; CDynamicExpandingMemoryManager > memManCacheEntryList; CDblLinker *incCacheEntriesLinker; QList lastUnsatItems; }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEREADER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CExpanderBranchedLinker.cpp0000644000175000017500000000326112520551030027427 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExpanderBranchedLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CExpanderBranchedLinker::CExpanderBranchedLinker(CSignatureSatisfiableExpanderCacheContext* context) : CLinkerBase(this),mContext(context),mNonDetCacheValues(context) { mValuesCount = 0; } CExpanderBranchedLinker* CExpanderBranchedLinker::appendCacheValue(const CCacheValue& cacheValue) { mNonDetCacheValues.append(cacheValue); ++mValuesCount; return this; } CCACHINGLIST* CExpanderBranchedLinker::getCacheValueList() { return &mNonDetCacheValues; } cint64 CExpanderBranchedLinker::getCacheValueCount() { return mValuesCount; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryWriteData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryW0000644000175000017500000000225312520551040032201 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureSatisfiableExpanderCacheEntryWriteData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSignatureSatisfiableExpanderCacheEntryWriteData::CSignatureSatisfiableExpanderCacheEntryWriteData() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheTaggingPool.h0000644000175000017500000000420612520551026025675 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCACHETAGGINGPOOL_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCACHETAGGINGPOOL_H // Libraries includes // Namespace includes // Other includes #include #include #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CCacheTaggingPool * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCacheTaggingPool { // public methods public: //! Constructor CCacheTaggingPool(cint64 poolSize = 1024); //! Destructor virtual ~CCacheTaggingPool(); cint64 takeNextTag(); // protected methods protected: bool hasMoreTags(); CCacheTaggingPool* createNextTaggingPool(); // protected variables protected: cint64 mPoolSize; cint64 mPoolSizeMask; cint64 mNextPoolStartTag; cint64* mTagPool; cint64 mPoolIndex; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCACHETAGGINGPOOL_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CExpanderBranchedLinker.h0000644000175000017500000000454512520551030027102 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CEXPANDERBRANCHEDLINKER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CEXPANDERBRANCHEDLINKER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "CSignatureSatisfiableExpanderCacheContext.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CExpanderBranchedLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExpanderBranchedLinker : public CLinkerBase { // public methods public: //! Constructor CExpanderBranchedLinker(CSignatureSatisfiableExpanderCacheContext* context); CExpanderBranchedLinker* appendCacheValue(const CCacheValue& cacheValue); CCACHINGLIST* getCacheValueList(); cint64 getCacheValueCount(); // protected methods protected: // protected variables protected: CSignatureSatisfiableExpanderCacheContext* mContext; CCACHINGLIST mNonDetCacheValues; cint64 mValuesCount; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CEXPANDERBRANCHEDLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheReader.h0000644000175000017500000001015112520551034030700 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEREADER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEREADER_H // Libraries includes #include #include // Namespace includes #include "CacheSettings.h" #include "CReuseCompletionGraphCacheSlotItem.h" #include "CReuseCompletionGraphCacheEntry.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Cache { typedef QPair TConceptNegPair; /*! * * \class CReuseCompletionGraphCacheReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReuseCompletionGraphCacheReader : public CLinkerBase { // public methods public: //! Constructor CReuseCompletionGraphCacheReader(); CReuseCompletionGraphCacheReader* updateSlot(CReuseCompletionGraphCacheSlotItem* updatedSlot); CReuseCompletionGraphCacheEntry* getCacheEntry(CConcept* concept, bool* minimalCompletionGraph, bool* deterministicConnection); // protected methods protected: bool hasUpdatedSlotItem(); bool switchToUpdatedSlotItem(); CXLinker* getConceptTestLinker(); CReuseCompletionGraphCacheReader* releaseConceptTestLinker(CXLinker* linker); bool addTestingConcepts(CSortedNegLinker* conLinker, bool negate, cint64 addingLevel, CCACHINGSET* testedConceptSet); bool addTestingConcept(CConcept* concept, bool negated, cint64 addingLevel, CCACHINGSET* testedConceptSet); // protected variables protected: static const cint64 mTestConceptLinkerVecSize = 4; CReuseCompletionGraphCacheContext mContext; CReuseCompletionGraphCacheSlotItem* mCurrentSlot; QAtomicPointer mUpdatedSlot; class CCacheEntryVotingItem { public: CCacheEntryVotingItem() { } CCacheEntryVotingItem* reset() { mIncompatibleCount = 0; mEntailedCount = 0; mMissingCount = 0; mTmpReferenced = false; mMinimalFound = false; mEntry = nullptr; mMinConnectionLevel = mTestConceptLinkerVecSize; return this; } cint64 mIncompatibleCount; cint64 mEntailedCount; cint64 mMissingCount; bool mTmpReferenced; bool mMinimalFound; cint64 mMinConnectionLevel; CReuseCompletionGraphCacheEntry* mEntry; }; CXLinker* mFreeLinker; QVector mEntryVotingVec; CXLinker* mTestConceptLinkerVec[mTestConceptLinkerVecSize]; cint64 mTestConceptLinkerCount; cint64 mTestConceptLinkerLevel; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEREADER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CUnsatisfiableCacheWriter.h0000644000175000017500000000402712520551042027450 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CUNSATISFIABLECACHEWRITER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CUNSATISFIABLECACHEWRITER_H // Libraries includes #include #include // Namespace includes #include "CCacheValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CUnsatisfiableCacheWriter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CUnsatisfiableCacheWriter { // public methods public: //! Constructor CUnsatisfiableCacheWriter(); //! Destructor virtual ~CUnsatisfiableCacheWriter(); virtual void setUnsatisfiable(QVector &itemVec, qint64 count, QVector &clashVec, qint64 clashCount) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CUNSATISFIABLECACHEWRITER_H ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryS0000644000175000017500000000413312520551040032174 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData::CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData() { } CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData* CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData::initSatisfiableBranchWriteData(cint64 signature, CCACHINGLIST* cacheValueList, CCACHINGLIST* branchedList) { mSignature = signature; mCacheValueList = cacheValueList; mBranchedValueList = branchedList; mType = SATBRANCHCACHEWRITEDATATYPE; return this; } cint64 CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData::getSignature() { return mSignature; } CCACHINGLIST* CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData::getCacheValueList() { return mCacheValueList; } CCACHINGLIST* CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData::getBranchedValueList() { return mBranchedValueList; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheU0000644000175000017500000000526612520551040032211 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEUNSATISFIABILITYWRITEDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEUNSATISFIABILITYWRITEDATA_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CSaturationNodeAssociatedExpansionCacheWriteData.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Container/CLinker.h" #include "Reasoner/Kernel/Process/CIndividualSaturationProcessNode.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { using namespace Process; namespace Cache { /*! * * \class CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData : public CSaturationNodeAssociatedExpansionCacheWriteData { // public methods public: //! Constructor CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData(); CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData* initUnsatisfiabilityWriteData(CIndividualSaturationProcessNode* unsatisfiableNode); CIndividualSaturationProcessNode* getUnsatisfiableSaturationIndividualNode(); // protected methods protected: // protected variables protected: CIndividualSaturationProcessNode* mUnsatisfiableNode; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEUNSATISFIABILITYWRITEDATA_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheHasher.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheHasher0000644000175000017500000000663112520551042032171 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEHASHER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEHASHER_H // Libraries includes #include // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "CSignatureSatisfiableExpanderCacheContext.h" #include "CExpanderCacheValueLinker.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSignatureSatisfiableExpanderCacheHasher * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureSatisfiableExpanderCacheHasher { // public methods public: //! Constructor CSignatureSatisfiableExpanderCacheHasher(CCACHINGSET* cacheValueSet); CSignatureSatisfiableExpanderCacheHasher(CExpanderCacheValueLinker* cacheValueLinker, cint64 count); CSignatureSatisfiableExpanderCacheHasher(const CSignatureSatisfiableExpanderCacheHasher& hasher); cint64 getHashValue() const; bool operator==(const CSignatureSatisfiableExpanderCacheHasher& hasher) const; // protected methods protected: void extendHashValue(CCacheValue* cacheValue); void calculateHashValue(CCACHINGSET* cacheValueSet); void calculateHashValue(CExpanderCacheValueLinker* cacheValueLinker, cint64 count); bool hasEqualCacheValues(CExpanderCacheValueLinker* cacheValueLinker, CExpanderCacheValueLinker* cacheValueLinker2, cint64 count) const; bool hasEqualCacheValues(CCACHINGSET* cacheValueSet, CCACHINGSET* cacheValueSet2) const; bool hasEqualCacheValues(CExpanderCacheValueLinker* cacheValueLinker, CCACHINGSET* cacheValueSet, cint64 count) const; // protected variables protected: cint64 mHashValue; cint64 mCacheValueCount; CExpanderCacheValueLinker* mCacheValueLinker; CCACHINGSET* mCacheValueSet; // private methods private: // private variables private: }; inline uint qHash(const CSignatureSatisfiableExpanderCacheHasher& hasher) { cint64 key = (cint64)hasher.getHashValue(); if (sizeof(cint64) > sizeof(uint)) { return uint((key >> (8 * sizeof(uint) - 1)) ^ key); } else { return uint(key); } } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEHASHER_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryWriteData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryWriteData0000644000175000017500000000420412520551034032160 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEENTRYWRITEDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEENTRYWRITEDATA_H // Libraries includes #include // Namespace includes #include "CacheSettings.h" #include "CCacheEntryWriteData.h" #include "CCacheValue.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CReuseCompletionGraphCacheEntryWriteData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReuseCompletionGraphCacheEntryWriteData : public CCacheEntryWriteData { // public methods public: //! Constructor CReuseCompletionGraphCacheEntryWriteData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEENTRYWRITEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/0000755000175000017500000000000012613407254023533 5ustar jonasjonas././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteSatisfiableCacheEntryEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteSatisfiableCacheEntryEvent.0000644000175000017500000000366712520551020032050 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteSatisfiableCacheEntryEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { CWriteSatisfiableCacheEntryEvent::CWriteSatisfiableCacheEntryEvent(const QList itemList, const QList outList) : CCustomEvent(EVENTWRITESATISFIABLECACHEENTRY) { cacheItemList = itemList; cacheOutcomeList = outList; } CWriteSatisfiableCacheEntryEvent::~CWriteSatisfiableCacheEntryEvent() { } QList *CWriteSatisfiableCacheEntryEvent::getCacheItemList() { return &cacheItemList; } void CWriteSatisfiableCacheEntryEvent::setCacheItemList(QList &list) { cacheItemList = list; } QList *CWriteSatisfiableCacheEntryEvent::getCacheOutcomeList() { return &cacheOutcomeList; } void CWriteSatisfiableCacheEntryEvent::setCacheOutcomeList(QList &list) { cacheOutcomeList = list; } }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteSaturationCacheDataEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteSaturationCacheDataEvent.cp0000644000175000017500000000311012520551020032025 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteSaturationCacheDataEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { CWriteSaturationCacheDataEvent::CWriteSaturationCacheDataEvent(CSaturationNodeAssociatedExpansionCacheWriteData* writeData, CMemoryPool* memoryPools) : CCustomEvent(EVENTTYPE),mWriteData(writeData),mMemoryPools(memoryPools) { } CSaturationNodeAssociatedExpansionCacheWriteData* CWriteSaturationCacheDataEvent::getWriteData() { return mWriteData; } CMemoryPool* CWriteSaturationCacheDataEvent::getMemoryPools() { return mMemoryPools; } }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteCachedDataEvent.cpp0000644000175000017500000000274312520551016030317 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteCachedDataEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { CWriteCachedDataEvent::CWriteCachedDataEvent(CCacheEntryWriteData* writeData, CMemoryPool* memoryPools) : CCustomEvent(EVENTTYPE),mWriteData(writeData),mMemoryPools(memoryPools) { } CCacheEntryWriteData* CWriteCachedDataEvent::getWriteData() { return mWriteData; } CMemoryPool* CWriteCachedDataEvent::getMemoryPools() { return mMemoryPools; } }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteComputedConcequencesCacheEntryEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteComputedConcequencesCacheEn0000644000175000017500000000510712520551016032113 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITECOMPUTEDCONCEQUENCESCACHEENTRYEVENT_H #define KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITECOMPUTEDCONCEQUENCESCACHEENTRYEVENT_H // Libraries includes #include #include // Namespace includes // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "../CacheSettings.h" #include "../CComputedConsequencesCacheWriteData.h" #include "Utilities/Memory/CMemoryPool.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { /*! * * \class CWriteComputedConcequencesCacheEntryEvent * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteComputedConcequencesCacheEntryEvent : public Concurrent::Events::CCustomEvent { // public methods public: //! Constructor CWriteComputedConcequencesCacheEntryEvent(CComputedConsequencesCacheWriteData* writeData, CMemoryPool* memoryPools); static const QEvent::Type EVENTTYPE = EVENTWRITECOMPUTEDCONSEQUENCESCACHEDATAENTRY; CComputedConsequencesCacheWriteData* getWriteData(); CMemoryPool* getMemoryPools(); // protected methods protected: // protected variables protected: CComputedConsequencesCacheWriteData* mWriteData; CMemoryPool* mMemoryPools; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITECOMPUTEDCONCEQUENCESCACHEENTRYEVENT_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteSatisfiableCacheEntryEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteSatisfiableCacheEntryEvent.0000644000175000017500000000451212520551020032036 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITESATISFIABLECACHEENTRYEVENT_H #define KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITESATISFIABLECACHEENTRYEVENT_H #include #include #include "Concurrent/Events/CCustomEvent.h" #include "../CacheSettings.h" #include "../CCacheValue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { /*! * \class CWriteSatisfiableCacheEntryEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CWriteSatisfiableCacheEntryEvent : public Concurrent::Events::CCustomEvent { // public methods public: //! Constructor CWriteSatisfiableCacheEntryEvent(const QList itemList = QList(), const QList outList = QList()); //! Destructor virtual ~CWriteSatisfiableCacheEntryEvent(); QList *getCacheItemList(); void setCacheItemList(QList &list); QList *getCacheOutcomeList(); void setCacheOutcomeList(QList &list); // protected methods protected: // private members private: QList cacheItemList; QList cacheOutcomeList; }; }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITESATISFIABLECACHEENTRYEVENT_H ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CRetrieveIncompletelyAssociationCachedEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CRetrieveIncompletelyAssociationC0000644000175000017500000000313612520551016032227 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRetrieveIncompletelyAssociationCachedEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { CRetrieveIncompletelyAssociationCachedEvent::CRetrieveIncompletelyAssociationCachedEvent(CCallbackData* callbackData, QSet* individualSet) : CCustomEvent(EVENTTYPE),mCallback(callbackData),mIndividualSet(individualSet) { } CCallbackData* CRetrieveIncompletelyAssociationCachedEvent::getCallback() { return mCallback; } QSet* CRetrieveIncompletelyAssociationCachedEvent::getIndividualSet() { return mIndividualSet; } }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CRetrieveIncompletelyAssociationCachedEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CRetrieveIncompletelyAssociationC0000644000175000017500000000511012520551016032221 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CRETRIEVEINCOMPLETELYASSOCIATIONCACHEDEVENT_H #define KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CRETRIEVEINCOMPLETELYASSOCIATIONCACHEDEVENT_H // Libraries includes #include #include // Namespace includes // Other includes #include "Reasoner/Ontology/CIndividual.h" #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" #include "../CacheSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Cache { namespace Events { /*! * * \class CRetrieveIncompletelyAssociationCachedEvent * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRetrieveIncompletelyAssociationCachedEvent : public Concurrent::Events::CCustomEvent { // public methods public: //! Constructor CRetrieveIncompletelyAssociationCachedEvent(CCallbackData* callbackData, QSet* individualSet); static const QEvent::Type EVENTTYPE = EVENTRETRIEVEINCOMPLETELYASSOCIATIONCACHED; CCallbackData* getCallback(); QSet* getIndividualSet(); // protected methods protected: // protected variables protected: CCallbackData* mCallback; QSet* mIndividualSet; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CRETRIEVEINCOMPLETELYASSOCIATIONCACHEDEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteExpandCachedEvent.h0000644000175000017500000000532212520551016030326 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITEEXPANDCACHEDEVENT_H #define KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITEEXPANDCACHEDEVENT_H // Libraries includes #include #include // Namespace includes // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "../CacheSettings.h" #include "../CCacheValue.h" #include "Utilities/Memory/CMemoryPool.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { /*! * * \class CWriteExpandCachedEvent * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteExpandCachedEvent : public Concurrent::Events::CCustomEvent { // public methods public: //! Constructor CWriteExpandCachedEvent(cint64 prevSignature, cint64 newSignature, CCACHINGLIST* cacheValueList, CCACHINGHASH* depHash, CMemoryPool* memoryPools); static const QEvent::Type EVENTTYPE = EVENTWRITEEXPANDCACHEDENTRY; cint64 getPrevSignature(); cint64 getNewSignature(); CCACHINGLIST* getCacheValueList(); CCACHINGHASH* getDepHash(); CMemoryPool* getMemoryPools(); // protected methods protected: // protected variables protected: cint64 mPrevSignature; cint64 mNewSignature; CCACHINGLIST* mCacheValueList; CCACHINGHASH* mDepHash; CMemoryPool* mMemoryPools; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITEEXPANDCACHEDEVENT_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteBackendAssociationCachedEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteBackendAssociationCachedEve0000644000175000017500000000312512520551016032042 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteBackendAssociationCachedEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { CWriteBackendAssociationCachedEvent::CWriteBackendAssociationCachedEvent(CBackendRepresentativeMemoryCacheWriteData* writeData, CMemoryPool* memoryPools) : CCustomEvent(EVENTTYPE),mWriteData(writeData),mMemoryPools(memoryPools) { } CBackendRepresentativeMemoryCacheWriteData* CWriteBackendAssociationCachedEvent::getWriteData() { return mWriteData; } CMemoryPool* CWriteBackendAssociationCachedEvent::getMemoryPools() { return mMemoryPools; } }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteComputedConcequencesCacheEntryEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteComputedConcequencesCacheEn0000644000175000017500000000314512520551016032113 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteComputedConcequencesCacheEntryEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { CWriteComputedConcequencesCacheEntryEvent::CWriteComputedConcequencesCacheEntryEvent(CComputedConsequencesCacheWriteData* writeData, CMemoryPool* memoryPools) : CCustomEvent(EVENTTYPE),mWriteData(writeData),mMemoryPools(memoryPools) { } CComputedConsequencesCacheWriteData* CWriteComputedConcequencesCacheEntryEvent::getWriteData() { return mWriteData; } CMemoryPool* CWriteComputedConcequencesCacheEntryEvent::getMemoryPools() { return mMemoryPools; } }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteCachedDataEvent.h0000644000175000017500000000460012520551016027756 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITECACHEDDATAEVENT_H #define KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITECACHEDDATAEVENT_H // Libraries includes #include #include // Namespace includes // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "../CacheSettings.h" #include "../CCacheEntryWriteData.h" #include "Utilities/Memory/CMemoryPool.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { /*! * * \class CWriteCachedDataEvent * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteCachedDataEvent : public Concurrent::Events::CCustomEvent { // public methods public: //! Constructor CWriteCachedDataEvent(CCacheEntryWriteData* writeData, CMemoryPool* memoryPools); static const QEvent::Type EVENTTYPE = EVENTWRITECACHEDDATAENTRY; CCacheEntryWriteData* getWriteData(); CMemoryPool* getMemoryPools(); // protected methods protected: // protected variables protected: CCacheEntryWriteData* mWriteData; CMemoryPool* mMemoryPools; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITECACHEDDATAEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteExpandCachedEvent.cpp0000644000175000017500000000372212520551016030663 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteExpandCachedEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { CWriteExpandCachedEvent::CWriteExpandCachedEvent(cint64 prevSignature, cint64 newSignature, CCACHINGLIST* cacheValueList, CCACHINGHASH* depHash, CMemoryPool* memoryPools) : CCustomEvent(EVENTTYPE),mPrevSignature(prevSignature),mNewSignature(newSignature),mCacheValueList(cacheValueList),mDepHash(depHash),mMemoryPools(memoryPools) { } cint64 CWriteExpandCachedEvent::getPrevSignature() { return mPrevSignature; } cint64 CWriteExpandCachedEvent::getNewSignature() { return mNewSignature; } CCACHINGLIST* CWriteExpandCachedEvent::getCacheValueList() { return mCacheValueList; } CCACHINGHASH* CWriteExpandCachedEvent::getDepHash() { return mDepHash; } CMemoryPool* CWriteExpandCachedEvent::getMemoryPools() { return mMemoryPools; } }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteSatisfiableBranchCachedEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteSatisfiableBranchCachedEven0000644000175000017500000000532312520551020032035 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITESATISFIABLEBRANCHCACHEDEVENT_H #define KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITESATISFIABLEBRANCHCACHEDEVENT_H // Libraries includes #include #include // Namespace includes // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "../CacheSettings.h" #include "../CCacheValue.h" #include "Utilities/Memory/CMemoryPool.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { /*! * * \class CWriteSatisfiableBranchCachedEvent * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteSatisfiableBranchCachedEvent : public Concurrent::Events::CCustomEvent { // public methods public: //! Constructor CWriteSatisfiableBranchCachedEvent(cint64 signature, CCACHINGLIST* cacheValueList, CCACHINGLIST* branchedList, CMemoryPool* memoryPools); static const QEvent::Type EVENTTYPE = EVENTWRITESATISFIABLEBRANCHCACHEDENTRY; cint64 getSignature(); CCACHINGLIST* getCacheValueList(); CCACHINGLIST* getBranchedValueList(); CMemoryPool* getMemoryPools(); // protected methods protected: // protected variables protected: cint64 mSignature; CCACHINGLIST* mCacheValueList; CCACHINGLIST* mBranchedValueList; CMemoryPool* mMemoryPools; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITESATISFIABLEBRANCHCACHEDEVENT_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteBackendAssociationCachedEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteBackendAssociationCachedEve0000644000175000017500000000506412520551016032046 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITEBACKENDASSOCIATIONCACHEDEVENT_H #define KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITEBACKENDASSOCIATIONCACHEDEVENT_H // Libraries includes #include #include // Namespace includes // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "../CacheSettings.h" #include "../CBackendRepresentativeMemoryCacheWriteData.h" #include "Utilities/Memory/CMemoryPool.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { /*! * * \class CWriteBackendAssociationCachedEvent * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteBackendAssociationCachedEvent : public Concurrent::Events::CCustomEvent { // public methods public: //! Constructor CWriteBackendAssociationCachedEvent(CBackendRepresentativeMemoryCacheWriteData* writeData, CMemoryPool* memoryPools); static const QEvent::Type EVENTTYPE = EVENTWRITEBACKENDASSOCIATIONENTRY; CBackendRepresentativeMemoryCacheWriteData* getWriteData(); CMemoryPool* getMemoryPools(); // protected methods protected: // protected variables protected: CBackendRepresentativeMemoryCacheWriteData* mWriteData; CMemoryPool* mMemoryPools; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITEBACKENDASSOCIATIONCACHEDEVENT_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteUnsatisfiableCacheEntryEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteUnsatisfiableCacheEntryEven0000644000175000017500000000427412520551020032144 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITEUNSATISFIABLECACHEENTRYEVENT_H #define KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITEUNSATISFIABLECACHEENTRYEVENT_H // Libraries includes #include #include // Namespace includes // Other includes #include "../CCacheValue.h" #include "../CacheSettings.h" #include "Concurrent/Events/CCustomEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { /*! * \class CWriteUnsatisfiableCacheEntryEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CWriteUnsatisfiableCacheEntryEvent : public Concurrent::Events::CCustomEvent { // public methods public: //! Constructor CWriteUnsatisfiableCacheEntryEvent(QList list = QList()); //! Destructor virtual ~CWriteUnsatisfiableCacheEntryEvent(); QList *getCacheEntryList(); void setCacheEntryList(QList list); // protected methods protected: // private members private: QList cacheEntry; }; }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITEUNSATISFIABLECACHEENTRYEVENT_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteSatisfiableBranchCachedEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteSatisfiableBranchCachedEven0000644000175000017500000000364112520551020032036 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteSatisfiableBranchCachedEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { CWriteSatisfiableBranchCachedEvent::CWriteSatisfiableBranchCachedEvent(cint64 signature, CCACHINGLIST* cacheValueList, CCACHINGLIST* branchedList, CMemoryPool* memoryPools) : CCustomEvent(EVENTTYPE),mSignature(signature),mCacheValueList(cacheValueList),mBranchedValueList(branchedList),mMemoryPools(memoryPools) { } cint64 CWriteSatisfiableBranchCachedEvent::getSignature() { return mSignature; } CCACHINGLIST* CWriteSatisfiableBranchCachedEvent::getCacheValueList() { return mCacheValueList; } CCACHINGLIST* CWriteSatisfiableBranchCachedEvent::getBranchedValueList() { return mBranchedValueList; } CMemoryPool* CWriteSatisfiableBranchCachedEvent::getMemoryPools() { return mMemoryPools; } }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteSaturationCacheDataEvent.h0000644000175000017500000000505712520551020031666 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITESATURATIONCACHEDATAEVENT_H #define KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITESATURATIONCACHEDATAEVENT_H // Libraries includes #include #include // Namespace includes // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "../CacheSettings.h" #include "../CSaturationNodeAssociatedExpansionCacheWriteData.h" #include "Utilities/Memory/CMemoryPool.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { /*! * * \class CWriteSaturationCacheDataEvent * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteSaturationCacheDataEvent : public Concurrent::Events::CCustomEvent { // public methods public: //! Constructor CWriteSaturationCacheDataEvent(CSaturationNodeAssociatedExpansionCacheWriteData* writeData, CMemoryPool* memoryPools); static const QEvent::Type EVENTTYPE = EVENTWRITESATURATIONCACHEDATAENTRY; CSaturationNodeAssociatedExpansionCacheWriteData* getWriteData(); CMemoryPool* getMemoryPools(); // protected methods protected: // protected variables protected: CSaturationNodeAssociatedExpansionCacheWriteData* mWriteData; CMemoryPool* mMemoryPools; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_EVENTS_CWRITESATURATIONCACHEDATAEVENT_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteUnsatisfiableCacheEntryEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/Events/CWriteUnsatisfiableCacheEntryEven0000644000175000017500000000316012520551020032135 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteUnsatisfiableCacheEntryEvent.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { namespace Events { CWriteUnsatisfiableCacheEntryEvent::CWriteUnsatisfiableCacheEntryEvent(QList list) : CCustomEvent(EVENTWRITEUNSATISFIABLECACHEENTRY) { cacheEntry = list; } CWriteUnsatisfiableCacheEntryEvent::~CWriteUnsatisfiableCacheEntryEvent() { } QList *CWriteUnsatisfiableCacheEntryEvent::getCacheEntryList() { return &cacheEntry; } void CWriteUnsatisfiableCacheEntryEvent::setCacheEntryList(QList list) { cacheEntry = list; } }; // end namespace Events }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntry.h0000644000175000017500000000655412520551032030611 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEENTRY_H #define KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEENTRY_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "CReuseCompletionGraphCacheContext.h" // Other includes #include "Reasoner/Kernel/Task/CSatisfiableCalculationJobInstantiation.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Task; namespace Cache { /*! * * \class CReuseCompletionGraphCacheEntry * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReuseCompletionGraphCacheEntry { // public methods public: //! Constructor CReuseCompletionGraphCacheEntry(CReuseCompletionGraphCacheContext* context); CCACHINGSET* getIncompatibleValues(); CCACHINGSET* getEntailedValues(); CCACHINGSET* getMinimalValues(); CSatisfiableCalculationJobInstantiation* getJobInstantiation(); CReuseCompletionGraphCacheEntry* setJobInstantiation(CSatisfiableCalculationJobInstantiation* jobInstantiation); CReuseCompletionGraphCacheEntry* setEntailedValues(CCACHINGSET* valueSet); CReuseCompletionGraphCacheEntry* addEntailedValue(const CCacheValue& cacheValue); CReuseCompletionGraphCacheEntry* setIncompatibleValues(CCACHINGSET* valueSet); CReuseCompletionGraphCacheEntry* addIncompatibleValue(const CCacheValue& cacheValue); CReuseCompletionGraphCacheEntry* setMinimalValues(CCACHINGSET* valueSet); CReuseCompletionGraphCacheEntry* addMinimalValue(const CCacheValue& cacheValue); bool hasMinimalValue(const CCacheValue& cacheValue); CReuseCompletionGraphCacheEntry* setEntryID(cint64 id); cint64 getEntryID(); // protected methods protected: // protected variables protected: CReuseCompletionGraphCacheContext* mContext; cint64 mEntryID; bool mMinimal; CCACHINGSET mIncompatibleValues; CCACHINGSET mEntailedValues; CCACHINGSET mMinimalValues; CSatisfiableCalculationJobInstantiation* mJobInstance; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEENTRY_H ././@LongLink0000644000000000000000000000020300000000000011576 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTempora0000644000175000017500000000643112520551024032226 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHETEMPORARYCARDINALITYWRITEDATALINKER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHETEMPORARYCARDINALITYWRITEDATALINKER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CBackendRepresentativeMemoryCardinalityValueLinker.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker : public CLinkerBase { // public methods public: //! Constructor CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker(); CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* initLabelWriteData(cint64 signature); cint64 getSignature(); CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* setSignature(cint64 signature); CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* appendCardinalityCacheValueLinker(CBackendRepresentativeMemoryCardinalityValueLinker* linker); CBackendRepresentativeMemoryCardinalityValueLinker* getCardinalityCacheValueLinker(); cint64 getCardinalityCacheValueCount(); void* getTemporaryData(); CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* setTemporaryData(void* tmpData); CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* clearTemporaryData(); // protected methods protected: // protected variables protected: cint64 mSignature; CBackendRepresentativeMemoryCardinalityValueLinker* mCardValueLinker; cint64 mCardValueCount; void* mTmpData; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHETEMPORARYCARDINALITYWRITEDATALINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheContext.cpp0000644000175000017500000000607612520551030031521 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CComputedConsequencesCacheContext.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CComputedConsequencesCacheContext::CComputedConsequencesCacheContext() { mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); mMemMan = new CLimitedReserveMemoryPoolAllocationManager(mMemoryPoolProvider); mAddRelMemory = 0; mConLinker = nullptr; } CComputedConsequencesCacheContext::~CComputedConsequencesCacheContext() { delete mMemMan; delete mMemoryPoolProvider; } CMemoryPoolAllocationManager* CComputedConsequencesCacheContext::getMemoryPoolAllocationManager() { return mMemMan; } CMemoryAllocationManager* CComputedConsequencesCacheContext::getMemoryAllocationManager() { return mMemMan; } CMemoryPoolProvider* CComputedConsequencesCacheContext::getMemoryPoolProvider() { return mMemoryPoolProvider; } cint64 CComputedConsequencesCacheContext::getMemoryConsumption() { return mAddRelMemory + mMemoryPoolProvider->getAllocatedReleaseDifferencePoolSize(); } CComputedConsequencesCacheContext* CComputedConsequencesCacheContext::releaseTemporaryMemoryPools(CMemoryPool* memoryPools) { CMemoryPool* memoryPoolIt = memoryPools; while (memoryPoolIt) { mAddRelMemory += memoryPoolIt->getMemoryBlockSize(); memoryPoolIt = memoryPoolIt->getNext(); } mMemMan->releaseTemporaryMemoryPools(memoryPools); return this; } CSortedNegLinker* CComputedConsequencesCacheContext::createConceptLinker(bool create) { CSortedNegLinker* conLinker = mConLinker; if (!conLinker && create) { conLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); } conLinker->setNext(nullptr); if (mConLinker) { mConLinker = mConLinker->getNext(); } return conLinker; } CComputedConsequencesCacheContext* CComputedConsequencesCacheContext::addConceptLinker(CSortedNegLinker* linker) { if (linker) { linker->setNext(nullptr); linker = linker->append(mConLinker); } return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheEntry.h0000644000175000017500000000753612520551032031315 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEENTRY_H #define KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEENTRY_H // Libraries includes #include #include // Namespace includes #include "CCacheEntry.h" #include "CCacheValue.h" #include "COccurrenceUnsatisfiableCacheEntriesHash.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class COccurrenceUnsatisfiableCacheEntry * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COccurrenceUnsatisfiableCacheEntry : public CCacheEntry { // public methods public: //! Constructor COccurrenceUnsatisfiableCacheEntry(const CCacheValue &cacheValue, COccurrenceUnsatisfiableCacheEntry *prevUnsatCacheEntry, qint64 writeUpdateSlotCount, qint64 currentActiveSlot, qint64 readCountVecSize = 1); //! Destructor virtual ~COccurrenceUnsatisfiableCacheEntry(); bool isUnsatisfiableTermination(); void setMinimumCandidate(qint64 value); void setMaximumCandidate(qint64 value); void setActiveSlot(qint64 slotIndex); COccurrenceUnsatisfiableCacheEntriesHash *setCacheEntriesHashSlotGetPrevious(qint64 slotIndex, COccurrenceUnsatisfiableCacheEntriesHash *entriesHash); void removeSlotCacheEntriesHash(qint64 slotIndex); qint64 getMaxTag(); qint64 getMinTag(); COccurrenceUnsatisfiableCacheEntriesHash *getCacheEntriesHash(); COccurrenceUnsatisfiableCacheEntriesHash *getSlotCacheEntriesHash(qint64 slotIndex); COccurrenceUnsatisfiableCacheEntriesHash *updateSlotCacheHashGetPrevious(qint64 slotIndex); CCacheValue getCacheValue(); qint64 getTotalReadCount(); void incReadCount(qint64 readCountIndex); COccurrenceUnsatisfiableCacheEntry *getPreviousUnsatisfiableCacheEntry(); bool isSerialized(); COccurrenceUnsatisfiableCacheEntry *setCacheTerminationValuesList(QList *cacheTerminationValuesList); COccurrenceUnsatisfiableCacheEntry *copyCacheTerminationValuesList(QList *cacheTerminationValuesList); QList *getCacheTerminationValuesList(); // protected methods protected: // private methods private: // private variables private: COccurrenceUnsatisfiableCacheEntry *prevEntry; qint64 updateSlotCount; qint64 activeSlot; COccurrenceUnsatisfiableCacheEntriesHash **cacheEntriesHashes; COccurrenceUnsatisfiableCacheEntriesHash *lastCacheEntriesHash; qint64 maxItemEntry; qint64 minItemEntry; bool unsatTerm; bool serialized; qint64 readCountCount; qint64 *readCountVec; CCacheValue cacheVal; QList *cacheTermValuesList; }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEENTRY_H ././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalityS0000644000175000017500000000545712520551024032270 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCARDINALITYSIGNATURERESOLVECACHEITEM_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCARDINALITYSIGNATURERESOLVECACHEITEM_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "CBackendRepresentativeMemoryCardinalityCacheItem.h" #include "CBackendRepresentativeMemoryCacheContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemorySignatureResolveCacheItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem { // public methods public: //! Constructor CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem(CBackendRepresentativeMemoryCacheContext* context); CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem* appendCardinalityCacheItem(CBackendRepresentativeMemoryCardinalityCacheItem* linker); CBackendRepresentativeMemoryCardinalityCacheItem* getCardinalityCacheItems(); cint64 getCardinalityCacheItemCount(); cint64 getSignature(); CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem* setSignature(cint64 signature); // protected methods protected: // protected variables protected: CBackendRepresentativeMemoryCacheContext* mContext; CBackendRepresentativeMemoryCardinalityCacheItem* mCardinalityCachetemLinker; cint64 mCardinalityItemCount; cint64 mSignature; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCARDINALITYSIGNATURERESOLVECACHEITEM_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryExpandWriteData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryExpandWri0000644000175000017500000000526512520551034032205 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEENTRYEXPANDWRITEDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEENTRYEXPANDWRITEDATA_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CReuseCompletionGraphCacheEntryWriteData.h" // Other includes #include "Reasoner/Kernel/Task/CSatisfiableCalculationJobInstantiation.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Task; namespace Cache { /*! * * \class CReuseCompletionGraphCacheEntryExpandWriteData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReuseCompletionGraphCacheEntryExpandWriteData : public CReuseCompletionGraphCacheEntryWriteData { // public methods public: //! Constructor CReuseCompletionGraphCacheEntryExpandWriteData(); CReuseCompletionGraphCacheEntryExpandWriteData* initExpandWriteData(CCACHINGLIST* cacheValueList, CCACHINGLIST* minimalCacheValueList, CSatisfiableCalculationJobInstantiation* jobInstantiation); CCACHINGLIST* getCacheValueList(); CCACHINGLIST* getMinimalCacheValueList(); CSatisfiableCalculationJobInstantiation* getJobInstantiation(); // protected methods protected: // protected variables protected: CSatisfiableCalculationJobInstantiation* mJobInstantiation; CCACHINGLIST* mCacheValueList; CCACHINGLIST* mMinimalValueList; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEENTRYEXPANDWRITEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheStatistics.cpp0000644000175000017500000000330512520551026026147 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCacheStatistics.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CCacheStatistics::CCacheStatistics() { reset(); } CCacheStatistics* CCacheStatistics::reset() { mMemoryConsumption = 0; mCacheEntriesCount = 0; return this; } CCacheStatistics* CCacheStatistics::incCacheEntriesCount(cint64 incCount) { mCacheEntriesCount += incCount; return this; } CCacheStatistics* CCacheStatistics::setMemoryConsumption(cint64 memoryConsumption) { mMemoryConsumption = memoryConsumption; return this; } cint64 CCacheStatistics::getCacheEntriesCount() { return mCacheEntriesCount; } cint64 CCacheStatistics::getMemoryConsumption() { return mMemoryConsumption; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalityValueLinker.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalityV0000644000175000017500000000472512520551024032270 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCARDINALITYVALUELINKER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCARDINALITYVALUELINKER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemoryCardinalityValueLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryCardinalityValueLinker : public CLinkerBase { // public methods public: //! Constructor CBackendRepresentativeMemoryCardinalityValueLinker(); CBackendRepresentativeMemoryCardinalityValueLinker* initCardinalityValueLinker(const CCacheValue& cacheValue, cint64 freeCardinality); CCacheValue& getCacheValue(); CBackendRepresentativeMemoryCardinalityValueLinker* setCacheValue(const CCacheValue& cacheValue); cint64 getFreeCardinality(); // protected methods protected: // protected variables protected: cint64 mFreeCardinality; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCARDINALITYVALUELINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCache.h0000644000175000017500000001243712520551022031125 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHE_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHE_H // Libraries includes #include #include #include // Namespace includes #include "CacheSettings.h" #include "CBackendCache.h" #include "CBackendRepresentativeMemoryCacheSlotItem.h" #include "CBackendRepresentativeMemoryCacheContext.h" #include "CBackendRepresentativeMemoryCacheReader.h" #include "CBackendRepresentativeMemoryCacheWriter.h" #include "CBackendRepresentativeMemoryCacheLabelAssociationWriteData.h" #include "CBackendRepresentativeMemoryCacheIndividualAssociationData.h" #include "CCacheStatistics.h" // Other includes #include "Concurrent/CThread.h" #include "Reasoner/Ontology/CIndividualProcessData.h" #include "Reasoner/Ontology/CIRIName.h" #include "Reasoner/Kernel/Cache/Events/CWriteCachedDataEvent.h" #include "Reasoner/Kernel/Cache/Events/CWriteBackendAssociationCachedEvent.h" #include "Reasoner/Kernel/Cache/Events/CRetrieveIncompletelyAssociationCachedEvent.h" #include "Utilities/Memory/CObjectMemoryPoolAllocator.h" #include "Utilities/Memory/CObjectParameterizingAllocator.h" #include "Utilities/Memory/CMemoryPoolContainerAllocationManager.h" #include "Context/CContextBase.h" #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; using namespace Context; using namespace Config; using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { using namespace Events; /*! * * \class CBackendRepresentativeMemoryCache * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryCache : public CThread, public CBackendCache { // public methods public: //! Constructor CBackendRepresentativeMemoryCache(CConfiguration* config = nullptr, QString threadIdentifierName = "Backend-Representative-Cache", CWatchDog *watchDogThread = nullptr); //! Destructor virtual ~CBackendRepresentativeMemoryCache(); CBackendRepresentativeMemoryCacheReader* createCacheReader(); CBackendRepresentativeMemoryCacheWriter* createCacheWriter(); CBackendRepresentativeMemoryCache* writeCachedData(CBackendRepresentativeMemoryCacheWriteData* writeData, CMemoryPool* memoryPools); CCacheStatistics* getCacheStatistics(); bool getIncompletlyAssociationCachedIndividuals(QSet* individualSet); // protected methods protected: void createReaderSlotUpdate(CBackendRepresentativeMemoryCacheContext* context); void cleanUnusedSlots(CBackendRepresentativeMemoryCacheContext* context); virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); void installTemporaryCardinalities(CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* tempCardWriteDataLinker, CBackendRepresentativeMemoryCacheContext* context); void installTemporaryLabels(CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* tempLabelWriteDataLinker, CBackendRepresentativeMemoryCacheContext* context); bool installAssociations(CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tempAssWriteDataLinker, CBackendRepresentativeMemoryCacheContext* context); // protected variables protected: CConfiguration* mConfig; CCACHINGHASH* mSigLabelItemHash; CCACHINGHASH* mSigCardItemHash; cint64 mNextEntryID; cint64 mWriteDataCount; cint64 mStartWriteCollectCount; cint64 mNextWriteCollectCount; cint64 mCollectCount; CMemoryPool* mCollectMemoryPools; CBackendRepresentativeMemoryCacheWriteData* mCollectWriteData; QSet mIncompletelyAssociatedIndividualSet; CCacheStatistics mCacheStat; CBackendRepresentativeMemoryCacheSlotItem* mSlotLinker; CBackendRepresentativeMemoryCacheReader* mReaderLinker; QMutex mReaderSyncMutex; CBackendRepresentativeMemoryCacheContext mContext; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSatisfiableCacheReader.cpp0000644000175000017500000000224412520551034027366 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCacheReader.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSatisfiableCacheReader::CSatisfiableCacheReader() { } CSatisfiableCacheReader::~CSatisfiableCacheReader() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheContextHandler.h0000644000175000017500000001413712405707542026421 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCACHEHANDLER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCACHEHANDLER_H // Qt includes // Namespace includes #include "CSatisfiableCacheReader.h" #include "CUnsatisfiableCacheReader.h" #include "CSatisfiableCacheWriter.h" #include "CUnsatisfiableCacheWriter.h" #include "CIncrementalUnsatisfiableCacheReader.h" #include "CIncrementalSatisfiableCacheReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CCacheHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCacheHandler : public CSatisfiableCacheReader, public CUnsatisfiableCacheReader, public CSatisfiableCacheWriter, public CUnsatisfiableCacheWriter { // public methods public: //! Constructor CCacheHandler(CSatisfiableCacheReader *satCacheReader, CUnsatisfiableCacheReader *unsatCacheReader, CSatisfiableCacheWriter *satCacheWriter, CUnsatisfiableCacheWriter *unsatCacheWriter); //! Deconstructor virtual ~CCacheHandler(); virtual bool isSatisfiable(QVector &itemVec, qint64 count); virtual bool getSatisfiableOutcome(QVector &itemVec, qint64 count, QList *outcomeList = 0); virtual bool isUnsatisfiable(QVector &itemVec, qint64 count); virtual QList getUnsatisfiableItems(QVector &itemVec, qint64 count); virtual void setSatisfiable(QVector &itemVec, qint64 itemCount, QVector &outcomeVec, qint64 outCount); virtual void setUnsatisfiable(QVector &itemVec, qint64 count, QVector &clashVec, qint64 clashCount); virtual bool isSatisfiable(CConceptSet *conceptSet); virtual bool getSatisfiableOutcome(CConceptSet *conceptSet, QList *outcomeList = 0); virtual bool isUnsatisfiable(CConceptSet *conceptSet); virtual bool isUnsatisfiable(QList &conDesNegLinkerList); virtual QList getUnsatisfiableItems(CConceptSet *conceptSet); virtual void setSatisfiable(CConceptSet *conceptSet); virtual void setUnsatisfiable(CConceptSet *conceptSet, CLinker *clashLinker); virtual void setUnsatisfiable(CConceptSet *conceptSet, QList &clashList); virtual void setUnsatisfiable(CConceptDescriptorLinker *conDesNegLinker, CLinker *clashLinker); virtual void setUnsatisfiable(QList &conDesNegLinkerList, CLinker *clashLinker); virtual void setUnsatisfiable(QList *conDesNegLinkerList, QList *clashConceptsList); virtual bool isSatisfiableIndividualPreferIncrementalTesting(CIndividualProcessBase *indi); virtual bool isSatisfiableIndividual(CIndividualProcessBase *indi); virtual bool isUnsatisfiableIndividualPreferIncrementalTesting(CIndividualProcessBase *indi, qint64 *maximalIndividualAncestorTestCount = 0); virtual QList getIndividualUnsatisfiableConceptDescriptionLinkers(CIndividualProcessBase *indi, qint64 maximalIndividualAncestorTestCount = -1, bool restartTesting = false); virtual bool isUnsatisfiableIndividualPreferIncrementalTesting(CIndividualProcessBase *indi, CConcept *additionalTestingConcept, bool additionalConceptNegation, qint64 *maximalIndividualAncestorTestCount = 0); virtual QList getIndividualUnsatisfiableConceptDescriptionLinkers(CIndividualProcessBase *indi, CConceptDescriptorLinker *addConDesLinker, qint64 maximalIndividualAncestorTestCount = -1, bool restartTesting = false); virtual bool isUnsatisfiableIndividualPreferIncrementalTesting(CIndividualProcessBase *indi, QList > *sortedAddConceptsList, qint64 *maximalIndividualAncestorTestCount = 0); virtual QList getIndividualUnsatisfiableConceptDescriptionLinkers(CIndividualProcessBase *indi, QList *sortedAddConceptsList, qint64 maximalIndividualAncestorTestCount = -1, bool restartTesting = false); virtual bool isIndividualMergingUnsatisfiable(CIndividualProcessBase *indi1, CIndividualProcessBase *indi2); virtual QList getIndividualMergingUnsatisfiableItems(CIndividualProcessBase *indi1, CIndividualProcessBase *indi2, bool restartTesting = false); // protected methods protected: // protected variables protected: CSatisfiableCacheReader *satReader; CUnsatisfiableCacheReader *unsatReader; CSatisfiableCacheWriter *satWriter; CUnsatisfiableCacheWriter *unsatWriter; CIncrementalUnsatisfiableCacheReader *incUnsatReader; CIncrementalSatisfiableCacheReader *incSatReader; QList lastMergingPrimClashList; bool lastMergingPrimClash; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCACHEHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CUnsatisfiableCache.cpp0000644000175000017500000000223212520551042026602 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CUnsatisfiableCache.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CUnsatisfiableCache::CUnsatisfiableCache() : CCache() { } CUnsatisfiableCache::~CUnsatisfiableCache() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheContext.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheContex0000644000175000017500000000540112520551040032207 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHECONTEXT_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHECONTEXT_H // Libraries includes // Namespace includes #include "CacheSettings.h" // Other includes #include "Context/CContext.h" #include "Utilities/Memory/CMemoryPoolProvider.h" #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" #include "Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSignatureSatisfiableExpanderCacheContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureSatisfiableExpanderCacheContext : public CContext { // public methods public: //! Constructor CSignatureSatisfiableExpanderCacheContext(); ~CSignatureSatisfiableExpanderCacheContext(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); virtual CMemoryPoolAllocationManager* getMemoryPoolAllocationManager(); virtual CMemoryPoolProvider* getMemoryPoolProvider(); cint64 getMemoryConsumption(); CSignatureSatisfiableExpanderCacheContext* releaseTemporaryMemoryPools(CMemoryPool* memoryPools); // protected methods protected: // protected variables protected: CMemoryPoolAllocationManager* mMemMan; CNewAllocationMemoryPoolProvider* mMemoryPoolProvider; cint64 mAddRelMemory; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHECONTEXT_H ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheLabelAssociationWriteData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheLabelAs0000644000175000017500000000646112520551022032123 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHELABELASSOCIATIONWRITEDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHELABELASSOCIATIONWRITEDATA_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CBackendRepresentativeMemoryCacheWriteData.h" #include "CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker.h" #include "CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker.h" #include "CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemoryCacheLabelAssociationWriteData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryCacheLabelAssociationWriteData : public CBackendRepresentativeMemoryCacheWriteData { // public methods public: //! Constructor CBackendRepresentativeMemoryCacheLabelAssociationWriteData(); CBackendRepresentativeMemoryCacheLabelAssociationWriteData* initWriteData(CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tempAssWriteDataLinker, CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* tempLabelWriteDataLinker, CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* tempCardWriteDataLinker); CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* getTemporaryAssociationWriteDataLinker(); CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* getTemporaryLabelWriteDataLinker(); CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* getTemporaryCardinaltyWriteDataLinker(); // protected methods protected: // protected variables protected: CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* mTempAssWriteDataLinker; CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* mTempLabelWriteDataLinker; CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* mTempCardWriteDataLinker; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHELABELASSOCIATIONWRITEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CacheSettings.h0000644000175000017500000001023212520551020025146 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CACHESETTINGS_H #define KONCLUDE_REASONER_KERNEL_CACHE_CACHESETTINGS_H // Libraries includes #include // Namespace includes // Other includes #include "Utilities/UtilitiesSettings.h" #include "Utilities/Container/CQtManagedRestrictedModificationHash.h" #include "Utilities/Container/CQtManagedRestrictedModificationList.h" #include "Utilities/Container/CQtManagedRestrictedModificationSet.h" // Logger includes namespace Konclude { using namespace Utilities; using namespace Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \file CacheSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class COccurrenceUnsatisfiableCacheReader; class COccurrenceUnsatisfiableCache; class COccurrenceUnsatisfiableCacheUpdateSlotItem; class COccurrenceUnsatisfiableCacheEntry; class COccurrenceUnsatisfiableCacheEntriesHash; class COccurrenceUnsatisfiableCacheWriter; class CSignatureSatisfiableExpanderCacheWriter; class CSignatureSatisfiableExpanderCacheReader; class CSignatureSatisfiableExpanderCache; class CSignatureSatisfiableExpanderCacheEntry; class CReuseCompletionGraphCacheEntry; class CReuseCompletionGraphCacheWriter; class CReuseCompletionGraphCacheReader; class CReuseCompletionGraphCache; class CReuseCompletionGraphCacheContext; class CSaturationNodeAssociatedExpansionCacheEntry; class CSaturationNodeAssociatedExpansionCacheWriter; class CSaturationNodeAssociatedExpansionCacheReader; class CSaturationNodeAssociatedExpansionCache; class CSaturationNodeCacheUpdater; class CComputedConsequencesCache; class CComputedConsequencesCacheEntry; class CComputedConsequencesCacheReader; class CComputedConsequencesCacheWriter; class CComputedConsequencesCacheContext; class CBackendRepresentativeMemoryCacheWriter; class CBackendRepresentativeMemoryCacheReader; class CBackendRepresentativeMemoryCache; class CBackendRepresentativeMemoryLabelSignatureResolveCacheItem; class CBackendRepresentativeMemoryLabelCacheItem; class CBackendRepresentativeMemoryCacheIndividualAssociationData; // events const QEvent::Type EVENTWRITEUNSATISFIABLECACHEENTRY = (QEvent::Type)2000; const QEvent::Type EVENTWRITESATISFIABLECACHEENTRY = (QEvent::Type)2001; const QEvent::Type EVENTWRITEEXPANDCACHEDENTRY = (QEvent::Type)2002; const QEvent::Type EVENTWRITESATISFIABLEBRANCHCACHEDENTRY = (QEvent::Type)2003; const QEvent::Type EVENTWRITECACHEDDATAENTRY = (QEvent::Type)2004; const QEvent::Type EVENTWRITESATURATIONCACHEDATAENTRY = (QEvent::Type)2005; const QEvent::Type EVENTWRITECOMPUTEDCONSEQUENCESCACHEDATAENTRY = (QEvent::Type)2006; const QEvent::Type EVENTWRITEBACKENDASSOCIATIONENTRY = (QEvent::Type)2007; const QEvent::Type EVENTRETRIEVEINCOMPLETELYASSOCIATIONCACHED = (QEvent::Type)2008; // defines #define CCACHINGHASH CQtManagedRestrictedModificationHash #define CCACHINGLIST CQtManagedRestrictedModificationList #define CCACHINGSET CQtManagedRestrictedModificationSet }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_KERNEL_CACHE_CACHESETTINGS_H././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedNondeterministicConceptExpansion.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedNondeterministi0000644000175000017500000000470712520551040032346 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSaturationNodeAssociatedNondeterministicConceptExpansion_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSaturationNodeAssociatedNondeterministicConceptExpansion_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CSaturationNodeAssociatedConceptExpansion.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSaturationNodeAssociatedNondeterministicConceptExpansion * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeAssociatedNondeterministicConceptExpansion : public CSaturationNodeAssociatedConceptExpansion, public CLinkerBase { // public methods public: //! Constructor CSaturationNodeAssociatedNondeterministicConceptExpansion(CSaturationNodeAssociatedExpansionCacheContext* context); CSaturationNodeAssociatedNondeterministicConceptExpansion* initNondeterministicConceptExpansion(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSaturationNodeAssociatedNondeterministicConceptExpansion_H ././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryS0000644000175000017500000000514612520551040032201 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEENTRYSATISFIABLEBRANCHWRITEDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEENTRYSATISFIABLEBRANCHWRITEDATA_H // Libraries includes // Namespace includes // Other includes #include "CacheSettings.h" #include "CSignatureSatisfiableExpanderCacheEntryWriteData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData : public CSignatureSatisfiableExpanderCacheEntryWriteData { // public methods public: //! Constructor CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData(); CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData* initSatisfiableBranchWriteData(cint64 signature, CCACHINGLIST* cacheValueList, CCACHINGLIST* branchedList); cint64 getSignature(); CCACHINGLIST* getCacheValueList(); CCACHINGLIST* getBranchedValueList(); // protected methods protected: // protected variables protected: cint64 mSignature; CCACHINGLIST* mCacheValueList; CCACHINGLIST* mBranchedValueList; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEENTRYSATISFIABLEBRANCHWRITEDATA_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheWriter.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheW0000644000175000017500000000277112520551040032211 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeAssociatedExpansionCacheWriter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationNodeAssociatedExpansionCacheWriter::CSaturationNodeAssociatedExpansionCacheWriter(CSaturationNodeAssociatedExpansionCache* cache) : mCache(cache) { } CSaturationNodeAssociatedExpansionCacheWriter* CSaturationNodeAssociatedExpansionCacheWriter::writeCacheData(CSaturationNodeAssociatedExpansionCacheWriteData* writeData, CMemoryPool* memoryPools) { mCache->writeCacheData(writeData,memoryPools); return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendCache.cpp0000644000175000017500000000217412520551020025341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendCache.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendCache::CBackendCache() : CCache() { } CBackendCache::~CBackendCache() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSatisfiableCacheWriter.cpp0000644000175000017500000000224312520551034027437 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCacheWriter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSatisfiableCacheWriter::CSatisfiableCacheWriter() { } CSatisfiableCacheWriter::~CSatisfiableCacheWriter() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCache.cpp0000644000175000017500000001273012520551026030153 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CComputedConsequencesCache.h" #include "CComputedConsequencesCacheWriter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CComputedConsequencesCache::CComputedConsequencesCache(CConfiguration* config, QString threadIdentifierName, CWatchDog *watchDogThread) : CThread(threadIdentifierName,watchDogThread) { mReaderLinker = nullptr; CMemoryAllocationManager* memMan = mContext.getMemoryAllocationManager(); mConfAllowedNonDetExpansionCount = 1; if (config) { mConfAllowedNonDetExpansionCount = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Optimization.SaturationExpansionSatisfiabilityCacheCount",1); } startThread(QThread::HighestPriority); } CComputedConsequencesCache::~CComputedConsequencesCache() { } CComputedConsequencesCache* CComputedConsequencesCache::writeCacheData(CComputedConsequencesCacheWriteData* writeData, CMemoryPool* memoryPools) { postEvent(new CWriteComputedConcequencesCacheEntryEvent(writeData,memoryPools)); return this; } CCacheStatistics* CComputedConsequencesCache::getCacheStatistics() { return &mCacheStat; } CComputedConsequencesCache* CComputedConsequencesCache::installWriteCacheData(CComputedConsequencesCacheWriteData* writeData, CComputedConsequencesCacheContext* context) { CComputedConsequencesCacheWriteData* writeDataLinker = writeData; while (writeDataLinker) { if (writeDataLinker->getWriteDataType() == CComputedConsequencesCacheWriteData::CCWT_TYPE) { CComputedConsequencesCacheWriteTypesData* cccwtd = (CComputedConsequencesCacheWriteTypesData*)writeDataLinker; addTypesExpansionData(cccwtd,context); } writeDataLinker = (CComputedConsequencesCacheWriteData*)writeDataLinker->getNext(); } return this; } CComputedConsequencesCache* CComputedConsequencesCache::addTypesExpansionData(CComputedConsequencesCacheWriteTypesData* cccwtd, CComputedConsequencesCacheContext* context) { CIndividual* individual = cccwtd->getIndividual(); CConcept* conceptType = cccwtd->getConcept(); bool conceptNegation = cccwtd->getNegation(); CComputedConsequencesTypesCacheEntry* cacheEntry = getComputedTypesCacheEntryForNode(individual,context,true); if (cacheEntry) { CSortedNegLinker* conceptLinker = context->createConceptLinker(); conceptLinker->init(conceptType,conceptNegation); cacheEntry->addConceptLinker(conceptLinker); } return this; } CComputedConsequencesTypesCacheEntry* CComputedConsequencesCache::getComputedTypesCacheEntryForNode(CIndividual* individual, CComputedConsequencesCacheContext* context, bool create) { CIndividualProcessData* indProData = (CIndividualProcessData*)individual->getIndividualData(); CComputedConsequencesTypesCacheEntry* cacheEntry = nullptr; if (indProData) { cacheEntry = (CComputedConsequencesTypesCacheEntry*)indProData->getComputedConsequencesCachingData(); } if (indProData && !cacheEntry && create) { cacheEntry = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(context->getMemoryAllocationManager(),context); cacheEntry->initCacheEntry(individual); indProData->setComputedConsequencesCachingData(cacheEntry); } return cacheEntry; } CComputedConsequencesCacheReader* CComputedConsequencesCache::createCacheReader() { CComputedConsequencesCacheReader* readerLinker = new CComputedConsequencesCacheReader(); mReaderSyncMutex.lock(); mReaderLinker = readerLinker->append(mReaderLinker); mReaderSyncMutex.unlock(); return readerLinker; } CComputedConsequencesCacheWriter* CComputedConsequencesCache::createCacheWriter() { return new CComputedConsequencesCacheWriter(this); } bool CComputedConsequencesCache::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CThread::processCustomsEvents(type,event)) { return true; } else if (type == EVENTWRITECOMPUTEDCONSEQUENCESCACHEDATAENTRY) { CWriteComputedConcequencesCacheEntryEvent* wscde = (CWriteComputedConcequencesCacheEntryEvent*)event; CMemoryPool* memoryPools = wscde->getMemoryPools(); CComputedConsequencesCacheWriteData* writeData = wscde->getWriteData(); installWriteCacheData(writeData,&mContext); mContext.getMemoryPoolAllocationManager()->releaseTemporaryMemoryPools(memoryPools); return true; } return false; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTempora0000644000175000017500000000705312520551024032227 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHETEMPORARYLABELWRITEDATALINKER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHETEMPORARYLABELWRITEDATALINKER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CBackendRepresentativeMemoryLabelValueLinker.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker : public CLinkerBase { // public methods public: //! Constructor CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker(); CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* initLabelWriteData(cint64 signature); cint64 getSignature(); CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* setSignature(cint64 signature); CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* appendDeterministicCacheValueLinker(CBackendRepresentativeMemoryLabelValueLinker* linker); CBackendRepresentativeMemoryLabelValueLinker* getDeterministicCacheValueLinker(); cint64 getDeterministicCacheValueCount(); bool isCompletelyHandled(); CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* setCompletelyHandled(bool completelyHandled); bool isCompletelySaturated(); CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* setCompletelySaturated(bool completelySaturated); void* getTemporaryData(); CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* setTemporaryData(void* tmpData); CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* clearTemporaryData(); // protected methods protected: // protected variables protected: cint64 mSignature; CBackendRepresentativeMemoryLabelValueLinker* mDetValueLinker; cint64 mDetValueCount; bool mCompletelyHandled; bool mCompletelySaturated; void* mTmpData; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHETEMPORARYLABELWRITEDATALINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSatisfiableCacheWriter.h0000644000175000017500000000402612520551034027105 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATISFIABLECACHEWRITER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATISFIABLECACHEWRITER_H // Libraries includes #include #include // Namespace includes #include "CCacheValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSatisfiableCacheWriter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCacheWriter { // public methods public: //! Constructor CSatisfiableCacheWriter(); //! Destructor virtual ~CSatisfiableCacheWriter(); virtual void setSatisfiable(QVector &itemVec, qint64 itemCount, QVector &outcomeVec, qint64 outCount) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATISFIABLECACHEWRITER_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryWriteData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryWriteData0000644000175000017500000000222312520551034032157 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReuseCompletionGraphCacheEntryWriteData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CReuseCompletionGraphCacheEntryWriteData::CReuseCompletionGraphCacheEntryWriteData() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheSlotItem.cpp0000644000175000017500000000501012520551034031567 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReuseCompletionGraphCacheSlotItem.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CReuseCompletionGraphCacheSlotItem::CReuseCompletionGraphCacheSlotItem(CMemoryPool* memoryPool) : CLinkerBase(this),CMemoryPoolContainer(memoryPool) { mReaderUsing = false; mEntryHash = nullptr; mEntyCount = 0; } bool CReuseCompletionGraphCacheSlotItem::incReader() { if (mReaderSharingCount.ref()) { mReaderUsing = true; } return true; } bool CReuseCompletionGraphCacheSlotItem::incReader(cint64 incCount) { for (cint64 i = 0; i < incCount; ++i) { incReader(); } return mReaderUsing; } bool CReuseCompletionGraphCacheSlotItem::decReader() { if (!mReaderSharingCount.deref()) { mReaderUsing = false; } return mReaderUsing; } bool CReuseCompletionGraphCacheSlotItem::hasCacheReaders() { return mReaderUsing; } CReuseCompletionGraphCacheSlotItem* CReuseCompletionGraphCacheSlotItem::setEntryHash(CReuseCompletionGraphCompatibilityEntryHash* hash) { mEntryHash = hash; return this; } CReuseCompletionGraphCompatibilityEntryHash* CReuseCompletionGraphCacheSlotItem::getEntryHash() { return mEntryHash; } cint64 CReuseCompletionGraphCacheSlotItem::getEntryCount() { return mEntyCount; } CReuseCompletionGraphCacheSlotItem* CReuseCompletionGraphCacheSlotItem::setEntryCount(cint64 entryCount) { mEntyCount = entryCount; return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheEntry.h0000644000175000017500000000327212520551026024566 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCACHEENTRY_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCACHEENTRY_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CCacheEntry * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCacheEntry { // public methods public: //! Constructor CCacheEntry(); //! Destructor virtual ~CCacheEntry(); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCACHEENTRY_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelCacheItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelCacheIt0000644000175000017500000001024612520551024032132 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryLabelCacheItem.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryLabelCacheItem::CBackendRepresentativeMemoryLabelCacheItem(CBackendRepresentativeMemoryCacheContext* context) : CLinkerBase(0,nullptr),mContext(context) { } CBackendRepresentativeMemoryLabelCacheItem* CBackendRepresentativeMemoryLabelCacheItem::initCacheEntry(cint64 signature, cint64 entryID) { setData(entryID); mSignature = signature; mDetValueLinker = nullptr; mDetTagValueHash = nullptr; mDetValueCount = 0; mCompletelyHandled = false; mCompletelySaturated = false; return this; } cint64 CBackendRepresentativeMemoryLabelCacheItem::getCacheEntryID() { return getData(); } CBackendRepresentativeMemoryLabelCacheItem* CBackendRepresentativeMemoryLabelCacheItem::setCacheEntryID(cint64 entryID) { setData(entryID); return this; } cint64 CBackendRepresentativeMemoryLabelCacheItem::getSignature() { return mSignature; } CBackendRepresentativeMemoryLabelCacheItem* CBackendRepresentativeMemoryLabelCacheItem::setSignature(cint64 signature) { mSignature = signature; return this; } CBackendRepresentativeMemoryLabelCacheItem* CBackendRepresentativeMemoryLabelCacheItem::addDeterministicCacheValueLinker(CBackendRepresentativeMemoryLabelValueLinker* linker) { mDetValueCount += linker->getCount(); mDetValueLinker = linker->append(mDetValueLinker); return this; } CBackendRepresentativeMemoryLabelValueLinker* CBackendRepresentativeMemoryLabelCacheItem::getDeterministicCacheValueLinker() { return mDetValueLinker; } CCACHINGHASH* CBackendRepresentativeMemoryLabelCacheItem::getDeterministicTagCacheValueHash(bool create) { if (!mDetTagValueHash && create) { mDetTagValueHash = CObjectParameterizingAllocator< CCACHINGHASH,CContext* >::allocateAndConstructAndParameterize(mContext->getMemoryAllocationManager(),mContext); } return mDetTagValueHash; } CBackendRepresentativeMemoryLabelCacheItem* CBackendRepresentativeMemoryLabelCacheItem::setDeterministicTagCacheValueHash(CCACHINGHASH* hash) { mDetTagValueHash = hash; return this; } cint64 CBackendRepresentativeMemoryLabelCacheItem::getDeterministicCacheValueCount() { return mDetValueCount; } bool CBackendRepresentativeMemoryLabelCacheItem::isCompletelyHandled() { return mCompletelyHandled; } CBackendRepresentativeMemoryLabelCacheItem* CBackendRepresentativeMemoryLabelCacheItem::setCompletelyHandled(bool completelyHandled) { mCompletelyHandled = completelyHandled; return this; } bool CBackendRepresentativeMemoryLabelCacheItem::isCompletelySaturated() { return mCompletelySaturated; } CBackendRepresentativeMemoryLabelCacheItem* CBackendRepresentativeMemoryLabelCacheItem::setCompletelySaturated(bool completelySaturated) { mCompletelySaturated = completelySaturated; return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryExpandWriteData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryE0000644000175000017500000000422612520551040032161 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureSatisfiableExpanderCacheEntryExpandWriteData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSignatureSatisfiableExpanderCacheEntryExpandWriteData::CSignatureSatisfiableExpanderCacheEntryExpandWriteData() { } CSignatureSatisfiableExpanderCacheEntryExpandWriteData* CSignatureSatisfiableExpanderCacheEntryExpandWriteData::initExpandWriteData(cint64 prevSignature, cint64 newSignature, CCACHINGLIST* cacheValueList, CCACHINGHASH* depHash) { mPrevSignature = prevSignature; mNewSignature = newSignature; mCacheValueList = cacheValueList; mDepHash = depHash; mType = SATEXPANDCACHEWRITEDATATYPE; return this; } cint64 CSignatureSatisfiableExpanderCacheEntryExpandWriteData::getPrevSignature() { return mPrevSignature; } cint64 CSignatureSatisfiableExpanderCacheEntryExpandWriteData::getNewSignature() { return mNewSignature; } CCACHINGLIST* CSignatureSatisfiableExpanderCacheEntryExpandWriteData::getCacheValueList() { return mCacheValueList; } CCACHINGHASH* CSignatureSatisfiableExpanderCacheEntryExpandWriteData::getDepHash() { return mDepHash; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CUnsatisfiableCacheReader.cpp0000644000175000017500000000225512520551042027732 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CUnsatisfiableCacheReader.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CUnsatisfiableCacheReader::CUnsatisfiableCacheReader() { } CUnsatisfiableCacheReader::~CUnsatisfiableCacheReader() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheContext.h0000644000175000017500000000502112520551032031120 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHECONTEXT_H #define KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHECONTEXT_H // Libraries includes // Namespace includes #include "CacheSettings.h" // Other includes #include "Context/CContext.h" #include "Utilities/Memory/CMemoryPoolProvider.h" #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" #include "Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CReuseCompletionGraphCacheContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReuseCompletionGraphCacheContext : public CContext { // public methods public: //! Constructor CReuseCompletionGraphCacheContext(); ~CReuseCompletionGraphCacheContext(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); virtual CMemoryPoolAllocationManager* getMemoryPoolAllocationManager(); virtual CMemoryPoolProvider* getMemoryPoolProvider(); // protected methods protected: // protected variables protected: CMemoryPoolAllocationManager* mMemMan; CMemoryPoolProvider* mMemoryPoolProvider; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHECONTEXT_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheWriter.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheWriter0000644000175000017500000000514012520551042032225 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEWRITER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEWRITER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "CSignatureSatisfiableExpanderCache.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSignatureSatisfiableExpanderCacheWriter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureSatisfiableExpanderCacheWriter { // public methods public: //! Constructor CSignatureSatisfiableExpanderCacheWriter(CSignatureSatisfiableExpanderCache* cache); CSignatureSatisfiableExpanderCacheWriter* writeCachedData(CSignatureSatisfiableExpanderCacheEntryWriteData* writeData, CMemoryPool* memoryPools); CSignatureSatisfiableExpanderCacheWriter* writeExpandCached(cint64 prevSignature, cint64 newSignature, CCACHINGLIST* cacheValueList, CCACHINGHASH* depHash, CMemoryPool* memoryPools); CSignatureSatisfiableExpanderCacheWriter* writeSatisfiableBranchCached(cint64 signature, CCACHINGLIST* cacheValueList, CCACHINGLIST* branchedList, CMemoryPool* memoryPools); // protected methods protected: // protected variables protected: CSignatureSatisfiableExpanderCache* mCache; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEWRITER_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheWriter.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheW0000644000175000017500000000441712520551040032210 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEWRITER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEWRITER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CSaturationNodeAssociatedExpansionCache.h" #include "CSaturationNodeAssociatedExpansionCacheWriteData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSaturationNodeAssociatedExpansionCacheWriter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeAssociatedExpansionCacheWriter { // public methods public: //! Constructor CSaturationNodeAssociatedExpansionCacheWriter(CSaturationNodeAssociatedExpansionCache* cache); CSaturationNodeAssociatedExpansionCacheWriter* writeCacheData(CSaturationNodeAssociatedExpansionCacheWriteData* writeData, CMemoryPool* memoryPools); // protected methods protected: // protected variables protected: CSaturationNodeAssociatedExpansionCache* mCache; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEWRITER_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCompatibilityEntryHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCompatibilityEntryH0000644000175000017500000000413512520551034032274 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCOMPATIBILITYENTRYHASH_H #define KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCOMPATIBILITYENTRYHASH_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CReuseCompletionGraphCompatibilityEntryHashData.h" #include "CReuseCompletionGraphCacheContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CReuseCompletionGraphCompatibilityEntryHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReuseCompletionGraphCompatibilityEntryHash : public CCACHINGHASH { // public methods public: //! Constructor CReuseCompletionGraphCompatibilityEntryHash(CContext* context); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCOMPATIBILITYENTRYHASH_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheWriteTypesData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheWriteTypesData0000644000175000017500000000504612520551030032221 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEWRITETYPESDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEWRITETYPESDATA_H // Libraries includes #include // Namespace includes #include "CacheSettings.h" #include "CComputedConsequencesCacheWriteData.h" #include "CCacheValue.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CIndividual.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Cache { /*! * * \class CComputedConsequencesCacheWriteTypesData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CComputedConsequencesCacheWriteTypesData : public CComputedConsequencesCacheWriteData { // public methods public: //! Constructor CComputedConsequencesCacheWriteTypesData(); CComputedConsequencesCacheWriteTypesData* initTypesCacheWriteData(CIndividual* individual, CConcept* concept, bool negation); CIndividual* getIndividual(); CConcept* getConcept(); bool getNegation(); // protected methods protected: // protected variables protected: CIndividual* mIndividual; CConcept* mConceptType; bool mConceptNegation; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEWRITETYPESDATA_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheReader.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheReader0000644000175000017500000000554112520551042032160 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEREADER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEREADER_H // Libraries includes #include // Namespace includes #include "CacheSettings.h" #include "CSignatureSatisfiableExpanderCacheRedirectionItem.h" #include "CSignatureSatisfiableExpanderCacheHasher.h" #include "CSignatureSatisfiableExpanderCacheSlotItem.h" #include "CSignatureSatisfiableExpanderCacheEntry.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSignatureSatisfiableExpanderCacheReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureSatisfiableExpanderCacheReader : public CLinkerBase { // public methods public: //! Constructor CSignatureSatisfiableExpanderCacheReader(); CSignatureSatisfiableExpanderCacheReader* updateSlot(CSignatureSatisfiableExpanderCacheSlotItem* updatedSlot); bool hasCacheEntry(cint64 signature); CSignatureSatisfiableExpanderCacheEntry* getCacheEntry(CCACHINGSET* cacheValueSet); CSignatureSatisfiableExpanderCacheEntry* getCacheEntry(cint64 signature); // protected methods protected: bool hasUpdatedSlotItem(); bool switchToUpdatedSlotItem(); // protected variables protected: CSignatureSatisfiableExpanderCacheSlotItem* mCurrentSlot; QAtomicPointer mUpdatedSlot; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEREADER_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedConceptExpansion.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedConceptExpansio0000644000175000017500000001122412520551036032272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeAssociatedConceptExpansion.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationNodeAssociatedConceptExpansion::CSaturationNodeAssociatedConceptExpansion(CSaturationNodeAssociatedExpansionCacheContext* context) : mContext(context),mConceptExpansionHash(context) { } CSaturationNodeAssociatedConceptExpansion* CSaturationNodeAssociatedConceptExpansion::initConceptExpansion() { mConceptExpansionLinker = nullptr; mHasTightCardinalityRestriction = false; mConceptExpansionCount = 0; mDependentNominalSet = nullptr; mConceptSetSignature = 0; mTotalConceptCount = 0; return this; } CCACHINGHASH* CSaturationNodeAssociatedConceptExpansion::getConceptExpansionHash() { return &mConceptExpansionHash; } CSaturationNodeAssociatedConceptExpansion* CSaturationNodeAssociatedConceptExpansion::addConceptExpansionLinker(CSaturationNodeAssociatedConceptLinker* conceptLinker) { if (conceptLinker) { mConceptExpansionCount += conceptLinker->getCount(); mConceptExpansionLinker = conceptLinker->append(mConceptExpansionLinker); mConceptExpansionHash.insert(CCacheValueHasher(conceptLinker->getCacheValue()),conceptLinker); } return this; } CSaturationNodeAssociatedConceptLinker* CSaturationNodeAssociatedConceptExpansion::getConceptExpansionLinker(CCacheValue* cacheValue) { CSaturationNodeAssociatedConceptLinker* linker = mConceptExpansionHash.value(CCacheValueHasher(cacheValue),nullptr); return linker; } bool CSaturationNodeAssociatedConceptExpansion::hasConceptExpansionLinker(CCacheValue* cacheValue) { return mConceptExpansionHash.contains(CCacheValueHasher(cacheValue)); } CSaturationNodeAssociatedConceptLinker* CSaturationNodeAssociatedConceptExpansion::getConceptExpansionLinker() { return mConceptExpansionLinker; } cint64 CSaturationNodeAssociatedConceptExpansion::getConceptExpansionCount() { return mConceptExpansionCount; } CSaturationNodeAssociatedConceptExpansion* CSaturationNodeAssociatedConceptExpansion::setConceptExpansionCount(cint64 count) { mConceptExpansionCount = count; return this; } CSaturationNodeAssociatedDependentNominalSet* CSaturationNodeAssociatedConceptExpansion::getDependentNominalSet(bool create) { if (!mDependentNominalSet && create) { mDependentNominalSet = CObjectParameterizingAllocator< CSaturationNodeAssociatedDependentNominalSet,CSaturationNodeAssociatedExpansionCacheContext* >::allocateAndConstructAndParameterize(mContext->getMemoryAllocationManager(),mContext); } return mDependentNominalSet; } bool CSaturationNodeAssociatedConceptExpansion::getHasTightAtMostRestriction() { return mHasTightCardinalityRestriction; } CSaturationNodeAssociatedConceptExpansion* CSaturationNodeAssociatedConceptExpansion::setHasTightCardinalityRestriction(bool tightAtMostRestrictions) { mHasTightCardinalityRestriction = tightAtMostRestrictions; return this; } cint64 CSaturationNodeAssociatedConceptExpansion::getConceptSetSignature() { return mConceptSetSignature; } CSaturationNodeAssociatedConceptExpansion* CSaturationNodeAssociatedConceptExpansion::setConceptSetSignature(cint64 signature) { mConceptSetSignature = signature; return this; } cint64 CSaturationNodeAssociatedConceptExpansion::getTotalConceptCount() { return mTotalConceptCount; } CSaturationNodeAssociatedConceptExpansion* CSaturationNodeAssociatedConceptExpansion::setTotalConceptCount(cint64 totalConceptCount) { mTotalConceptCount = totalConceptCount; return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheEntry.cpp0000644000175000017500000000214612520551026025120 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCacheEntry.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CCacheEntry::CCacheEntry() { } CCacheEntry::~CCacheEntry() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCompatibilityEntryHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCompatibilityEntryH0000644000175000017500000000463312520551034032277 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReuseCompletionGraphCompatibilityEntryHashData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CReuseCompletionGraphCompatibilityEntryHashData::CReuseCompletionGraphCompatibilityEntryHashData() { mEntailedEntryLinker = nullptr; mIncompatibleEntryLinker = nullptr; } CReuseCompletionGraphCompatibilityEntryHashData::CReuseCompletionGraphCompatibilityEntryHashData(const CReuseCompletionGraphCompatibilityEntryHashData& data) { mIncompatibleEntryLinker = data.mIncompatibleEntryLinker; mEntailedEntryLinker = data.mEntailedEntryLinker; } CXLinker* CReuseCompletionGraphCompatibilityEntryHashData::getEntailedEntryLinker() const { return mEntailedEntryLinker; } CReuseCompletionGraphCompatibilityEntryHashData* CReuseCompletionGraphCompatibilityEntryHashData::addEntailedEntyLinker(CXLinker* linker) { mEntailedEntryLinker = linker->append(mEntailedEntryLinker); return this; } CXLinker* CReuseCompletionGraphCompatibilityEntryHashData::getIncompatibleEntryLinker() const { return mIncompatibleEntryLinker; } CReuseCompletionGraphCompatibilityEntryHashData* CReuseCompletionGraphCompatibilityEntryHashData::addIncompatibleEntyLinker(CXLinker* linker) { mIncompatibleEntryLinker = linker->append(mIncompatibleEntryLinker); return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheEntry.cpp0000644000175000017500000001363612520551032031646 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COccurrenceUnsatisfiableCacheEntry.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { COccurrenceUnsatisfiableCacheEntry::COccurrenceUnsatisfiableCacheEntry(const CCacheValue &cacheValue, COccurrenceUnsatisfiableCacheEntry *prevUnsatCacheEntry, qint64 writeUpdateSlotCount, qint64 currentActiveSlot, qint64 readCountVecSize) { prevEntry = prevUnsatCacheEntry; cacheVal = cacheValue; updateSlotCount = writeUpdateSlotCount; activeSlot = currentActiveSlot; lastCacheEntriesHash = 0; unsatTerm = false; maxItemEntry = Q_INT64_C(0x8000000000000000); minItemEntry = Q_INT64_C(0x7FFFFFFFFFFFFFFF); cacheEntriesHashes = new COccurrenceUnsatisfiableCacheEntriesHash *[updateSlotCount]; for (qint64 idx = 0; idx < updateSlotCount; ++idx) { cacheEntriesHashes[idx] = 0; } readCountCount = readCountVecSize; if (readCountCount > 0) { readCountVec = new qint64[readCountCount]; } else { readCountVec = 0; } serialized = false; cacheTermValuesList = 0; } COccurrenceUnsatisfiableCacheEntry::~COccurrenceUnsatisfiableCacheEntry() { delete cacheEntriesHashes; if (readCountVec) { delete readCountVec; } if (cacheTermValuesList) { delete cacheTermValuesList; } } bool COccurrenceUnsatisfiableCacheEntry::isSerialized() { return serialized; } COccurrenceUnsatisfiableCacheEntry *COccurrenceUnsatisfiableCacheEntry::getPreviousUnsatisfiableCacheEntry() { return prevEntry; } COccurrenceUnsatisfiableCacheEntriesHash *COccurrenceUnsatisfiableCacheEntry::setCacheEntriesHashSlotGetPrevious(qint64 slotIndex, COccurrenceUnsatisfiableCacheEntriesHash *entriesHash) { COccurrenceUnsatisfiableCacheEntriesHash *tmpHash = cacheEntriesHashes[slotIndex]; cacheEntriesHashes[slotIndex] = entriesHash; lastCacheEntriesHash = entriesHash; return tmpHash; } COccurrenceUnsatisfiableCacheEntriesHash *COccurrenceUnsatisfiableCacheEntry::updateSlotCacheHashGetPrevious(qint64 slotIndex) { COccurrenceUnsatisfiableCacheEntriesHash *prevHash = 0; if (cacheEntriesHashes[slotIndex] != lastCacheEntriesHash) { prevHash = cacheEntriesHashes[slotIndex]; cacheEntriesHashes[slotIndex] = lastCacheEntriesHash; lastCacheEntriesHash->incReferenceCount(); } return prevHash; } void COccurrenceUnsatisfiableCacheEntry::removeSlotCacheEntriesHash(qint64 slotIndex) { cacheEntriesHashes[slotIndex] = 0; } void COccurrenceUnsatisfiableCacheEntry::setActiveSlot(qint64 slotIndex) { activeSlot = slotIndex; } void COccurrenceUnsatisfiableCacheEntry::setMinimumCandidate(qint64 value) { minItemEntry = qMin(minItemEntry,value); } void COccurrenceUnsatisfiableCacheEntry::setMaximumCandidate(qint64 value) { maxItemEntry = qMax(maxItemEntry,value); } qint64 COccurrenceUnsatisfiableCacheEntry::getMaxTag() { return maxItemEntry; } qint64 COccurrenceUnsatisfiableCacheEntry::getMinTag() { return minItemEntry; } COccurrenceUnsatisfiableCacheEntriesHash *COccurrenceUnsatisfiableCacheEntry::getCacheEntriesHash() { return lastCacheEntriesHash; } COccurrenceUnsatisfiableCacheEntriesHash *COccurrenceUnsatisfiableCacheEntry::getSlotCacheEntriesHash(qint64 slotIndex) { return cacheEntriesHashes[slotIndex]; } bool COccurrenceUnsatisfiableCacheEntry::isUnsatisfiableTermination() { return unsatTerm; } CCacheValue COccurrenceUnsatisfiableCacheEntry::getCacheValue() { return cacheVal; } qint64 COccurrenceUnsatisfiableCacheEntry::getTotalReadCount() { qint64 readCount = 0; for (qint64 i = 0; i < readCountCount; ++i) { readCount += readCountVec[i]; } return readCount; } void COccurrenceUnsatisfiableCacheEntry::incReadCount(qint64 readCountIndex) { if (readCountIndex >= 0 && readCountIndex < readCountCount) { readCountVec[readCountIndex] = readCountVec[readCountIndex]+1; } } COccurrenceUnsatisfiableCacheEntry *COccurrenceUnsatisfiableCacheEntry::setCacheTerminationValuesList(QList *cacheTerminationValuesList) { if (cacheTermValuesList) { delete cacheTermValuesList; } cacheTermValuesList = cacheTerminationValuesList; unsatTerm = cacheTermValuesList != 0; return this; } COccurrenceUnsatisfiableCacheEntry *COccurrenceUnsatisfiableCacheEntry::copyCacheTerminationValuesList(QList *cacheTerminationValuesList) { if (cacheTermValuesList) { delete cacheTermValuesList; } if (cacheTerminationValuesList) { cacheTermValuesList = new QList(*cacheTerminationValuesList); } else { cacheTermValuesList = 0; } unsatTerm = cacheTermValuesList != 0; return this; } QList *COccurrenceUnsatisfiableCacheEntry::getCacheTerminationValuesList() { return cacheTermValuesList; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheValueHasher.h0000644000175000017500000000427212520551026025675 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCACHEVALUEHASHER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCACHEVALUEHASHER_H // Libraries includes #include // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CCacheValueHasher * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCacheValueHasher { // public methods public: //! Constructor CCacheValueHasher(CCacheValue* cacheValue); cint64 getHashValue() const; bool operator==(const CCacheValueHasher& hasher) const; // protected methods protected: // protected variables protected: CCacheValue* mCacheValue; // private methods private: // private variables private: }; inline uint qHash(const CCacheValueHasher& hasher) { cint64 key = (cint64)hasher.getHashValue(); if (sizeof(cint64) > sizeof(uint)) { return uint((key >> (8 * sizeof(uint) - 1)) ^ key); } else { return uint(key); } } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCACHEVALUEHASHER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheContext.cpp0000644000175000017500000000344112520551032031457 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReuseCompletionGraphCacheContext.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CReuseCompletionGraphCacheContext::CReuseCompletionGraphCacheContext() { mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); mMemMan = new CLimitedReserveMemoryPoolAllocationManager(mMemoryPoolProvider); } CReuseCompletionGraphCacheContext::~CReuseCompletionGraphCacheContext() { delete mMemMan; delete mMemoryPoolProvider; } CMemoryPoolAllocationManager* CReuseCompletionGraphCacheContext::getMemoryPoolAllocationManager() { return mMemMan; } CMemoryAllocationManager* CReuseCompletionGraphCacheContext::getMemoryAllocationManager() { return mMemMan; } CMemoryPoolProvider* CReuseCompletionGraphCacheContext::getMemoryPoolProvider() { return mMemoryPoolProvider; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryExpandWriteData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryE0000644000175000017500000000513312520551040032157 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEENTRYEXPANDWRITEDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEENTRYEXPANDWRITEDATA_H // Libraries includes // Namespace includes // Other includes #include "CacheSettings.h" #include "CSignatureSatisfiableExpanderCacheEntryWriteData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSignatureSatisfiableExpanderCacheEntryExpandWriteData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureSatisfiableExpanderCacheEntryExpandWriteData : public CSignatureSatisfiableExpanderCacheEntryWriteData { // public methods public: //! Constructor CSignatureSatisfiableExpanderCacheEntryExpandWriteData(); CSignatureSatisfiableExpanderCacheEntryExpandWriteData* initExpandWriteData(cint64 prevSignature, cint64 newSignature, CCACHINGLIST* cacheValueList, CCACHINGHASH* depHash); cint64 getPrevSignature(); cint64 getNewSignature(); CCACHINGLIST* getCacheValueList(); CCACHINGHASH* getDepHash(); // protected methods protected: // protected variables protected: cint64 mPrevSignature; cint64 mNewSignature; CCACHINGLIST* mCacheValueList; CCACHINGHASH* mDepHash; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEENTRYEXPANDWRITEDATA_H ././@LongLink0000644000000000000000000000020100000000000011574 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalityS0000644000175000017500000000466112520551024032264 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem::CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem(CBackendRepresentativeMemoryCacheContext* context) : mContext(context) { mSignature = 0; mCardinalityItemCount = 0; mCardinalityCachetemLinker = nullptr; } CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem* CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem::appendCardinalityCacheItem(CBackendRepresentativeMemoryCardinalityCacheItem* linker) { mCardinalityItemCount += linker->getCount(); mCardinalityCachetemLinker = linker->append(mCardinalityCachetemLinker); return this; } CBackendRepresentativeMemoryCardinalityCacheItem* CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem::getCardinalityCacheItems() { return mCardinalityCachetemLinker; } cint64 CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem::getCardinalityCacheItemCount() { return mCardinalityItemCount; } cint64 CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem::getSignature() { return mSignature; } CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem* CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem::setSignature(cint64 signature) { mSignature = signature; return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendCacheWriteData.h0000644000175000017500000000403112520551020026605 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDCACHEWRITEDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDCACHEWRITEDATA_H // Libraries includes #include // Namespace includes #include "CacheSettings.h" #include "CCacheEntryWriteData.h" #include "CCacheValue.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendCacheWriteData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendCacheWriteData : public CCacheEntryWriteData { // public methods public: //! Constructor CBackendCacheWriteData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDCACHEWRITEDATA_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedDependentNominalSet.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedDependentNomina0000644000175000017500000000256512520551036032250 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeAssociatedDependentNominalSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationNodeAssociatedDependentNominalSet::CSaturationNodeAssociatedDependentNominalSet(CContext* context) : mContext(context),CCACHINGSET(context) { } CSaturationNodeAssociatedDependentNominalSet* CSaturationNodeAssociatedDependentNominalSet::initDependentNominalSet() { return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CIncrementalUnsatisfiableCacheReader.h0000644000175000017500000000453512520551032031563 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CINCREMENTALUNSATISFIABLECACHEREADER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CINCREMENTALUNSATISFIABLECACHEREADER_H // Libraries includes #include #include // Namespace includes #include "CCacheValue.h" #include "CUnsatisfiableCacheReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CIncrementalUnsatisfiableCacheReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIncrementalUnsatisfiableCacheReader : public CUnsatisfiableCacheReader { // public methods public: //! Constructor CIncrementalUnsatisfiableCacheReader(); //! Destructor virtual ~CIncrementalUnsatisfiableCacheReader(); virtual bool isUnsatisfiable(QVector &itemVec, qint64 count) ; virtual void incrementUnsatisfiableTestReset() = 0; virtual bool incrementUnsatisfiableTest(CCacheValue *cacheValue, bool *continueTestingUseful = 0) = 0; virtual QList getLastTestedUnsatisfiableItems() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CINCREMENTALATISFIABLECACHEREADER_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheEntry.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheE0000644000175000017500000000701212520551036032165 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeAssociatedExpansionCacheEntry.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationNodeAssociatedExpansionCacheEntry::CSaturationNodeAssociatedExpansionCacheEntry(CSaturationNodeAssociatedExpansionCacheContext* context) : mContext(context) { } CSaturationNodeAssociatedExpansionCacheEntry* CSaturationNodeAssociatedExpansionCacheEntry::initCacheEntry(CIndividualSaturationProcessNode* saturationNode, cint64 remainingAllowedNonDetExpansionCount) { mSaturationNode = saturationNode; mNondetExpansionLinker = nullptr; mDetExpansion = nullptr; mRemainingAllowedNonDetExpansionCount = remainingAllowedNonDetExpansionCount; return this; } CIndividualSaturationProcessNode* CSaturationNodeAssociatedExpansionCacheEntry::getSaturationIndividualNode() { return mSaturationNode; } CSaturationNodeAssociatedDeterministicConceptExpansion* CSaturationNodeAssociatedExpansionCacheEntry::getDeterministicConceptExpansion() { return mDetExpansion; } bool CSaturationNodeAssociatedExpansionCacheEntry::hasDeterministicConceptExpansion() { return mDetExpansion != nullptr; } CSaturationNodeAssociatedNondeterministicConceptExpansion* CSaturationNodeAssociatedExpansionCacheEntry::getNondeterministicConceptExpansionLinker() { return mNondetExpansionLinker; } CSaturationNodeAssociatedExpansionCacheEntry* CSaturationNodeAssociatedExpansionCacheEntry::setDeterministicConceptExpansion(CSaturationNodeAssociatedDeterministicConceptExpansion* detConceptExpansion) { mDetExpansion = detConceptExpansion; return this; } CSaturationNodeAssociatedExpansionCacheEntry* CSaturationNodeAssociatedExpansionCacheEntry::addNondeterministicConceptExpansion(CSaturationNodeAssociatedNondeterministicConceptExpansion* nondetConceptExpansion) { mNondetExpansionLinker = nondetConceptExpansion->append(mNondetExpansionLinker); return this; } cint64 CSaturationNodeAssociatedExpansionCacheEntry::getRemainingAllowedNondeterministicExpansionCount() { return mRemainingAllowedNonDetExpansionCount; } bool CSaturationNodeAssociatedExpansionCacheEntry::areMoreNondeterministicExpansionAllowed() { return mRemainingAllowedNonDetExpansionCount > 0; } CSaturationNodeAssociatedExpansionCacheEntry* CSaturationNodeAssociatedExpansionCacheEntry::decRemainingAllowedNondeterministicExpansionCount(cint64 decCount) { if (mRemainingAllowedNonDetExpansionCount > 0) { mRemainingAllowedNonDetExpansionCount -= decCount; } return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheWriteData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheW0000644000175000017500000000257712520551040032215 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeAssociatedExpansionCacheWriteData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationNodeAssociatedExpansionCacheWriteData::CSaturationNodeAssociatedExpansionCacheWriteData() { } CSaturationNodeAssociatedExpansionCacheWriteData::SATURATIONNODEASSOCIATEDEXPANSIONCACHEWRITEDATATYPE CSaturationNodeAssociatedExpansionCacheWriteData::getWriteDataType() { return mWriteDataType; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheReader.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheR0000644000175000017500000000461412520551040032202 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEREADER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEREADER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CSaturationNodeAssociatedExpansionCacheEntry.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Kernel/Process/ProcessSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSaturationNodeAssociatedExpansionCacheReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeAssociatedExpansionCacheReader : public CLinkerBase { // public methods public: //! Constructor CSaturationNodeAssociatedExpansionCacheReader(); CSaturationNodeAssociatedExpansionCacheEntry* getCacheEntry(CIndividualSaturationProcessNode* saturationNode); const CCacheValue getCacheValue(CConcept* concept, bool negation); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEREADER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheWriter.h0000644000175000017500000000416312520551030031011 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEWRITER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEWRITER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CComputedConsequencesCache.h" #include "CComputedConsequencesCacheWriteData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CComputedConsequencesCacheWriter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CComputedConsequencesCacheWriter { // public methods public: //! Constructor CComputedConsequencesCacheWriter(CComputedConsequencesCache* cache); CComputedConsequencesCacheWriter* writeCacheData(CComputedConsequencesCacheWriteData* writeData, CMemoryPool* memoryPools); // protected methods protected: // protected variables protected: CComputedConsequencesCache* mCache; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEWRITER_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheUpdateSlotItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheUpdateSlotI0000644000175000017500000000567712520551032032167 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEUPDATESLOTITEM_H #define KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEUPDATESLOTITEM_H // Libraries includes #include #include #include #include #include // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "COccurrenceUnsatisfiableCacheEntry.h" #include "COccurrenceUnsatisfiableCacheReader.h" // Other includes #include "Utilities/CMemoryManager.hpp" #include "Utilities/CDblLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class COccurrenceUnsatisfiableCacheUpdateSlotItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COccurrenceUnsatisfiableCacheUpdateSlotItem { // public methods public: //! Constructor COccurrenceUnsatisfiableCacheUpdateSlotItem(qint64 updateSlotIndex); //! Destructor virtual ~COccurrenceUnsatisfiableCacheUpdateSlotItem(); bool incReader(); bool incReader(cint64 incCount); bool decReader(); void addCacheEntry(COccurrenceUnsatisfiableCacheEntry *cacheEntry); void addCacheEntriesHash(COccurrenceUnsatisfiableCacheEntriesHash *cacheEntriesHash); void activateSlotUpdateItems(); void cleanSlotUpdateItems(); qint64 getSlotIndex(); bool hasCacheReaders(); // protected methods protected: // private methods private: // private variables private: QSet updatedEntrySet; QLinkedList updatedHashesList; QAtomicInt mReaderSharingCount; bool mReaderUsing; qint64 readerCount; QMutex readerSyncMutex; qint64 slotIndex; }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEUPDATESLOTITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheReader.cpp0000644000175000017500000002541112520551034031240 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReuseCompletionGraphCacheReader.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CReuseCompletionGraphCacheReader::CReuseCompletionGraphCacheReader() : CLinkerBase(this) { mCurrentSlot = nullptr; mFreeLinker = nullptr; } CReuseCompletionGraphCacheReader* CReuseCompletionGraphCacheReader::updateSlot(CReuseCompletionGraphCacheSlotItem* updatedSlot) { CReuseCompletionGraphCacheSlotItem* prevSlot = mUpdatedSlot.fetchAndStoreOrdered(updatedSlot); if (prevSlot != nullptr) { prevSlot->decReader(); } return this; } bool CReuseCompletionGraphCacheReader::hasUpdatedSlotItem() { return mUpdatedSlot.fetchAndAddRelaxed(0) != nullptr; } bool CReuseCompletionGraphCacheReader::switchToUpdatedSlotItem() { CReuseCompletionGraphCacheSlotItem* updatedSlot = mUpdatedSlot.fetchAndStoreOrdered(nullptr); if (updatedSlot) { CReuseCompletionGraphCacheSlotItem* prevSlot = mCurrentSlot; mCurrentSlot = updatedSlot; if (prevSlot != nullptr) { prevSlot->decReader(); } return true; } return false; } CXLinker* CReuseCompletionGraphCacheReader::getConceptTestLinker() { CXLinker* linker = nullptr; if (mFreeLinker) { linker = mFreeLinker; mFreeLinker = mFreeLinker->getNext(); } else { linker = CObjectAllocator< CXLinker >::allocateAndConstruct(mContext.getMemoryAllocationManager()); } linker->clearNext(); return linker; } CReuseCompletionGraphCacheReader* CReuseCompletionGraphCacheReader::releaseConceptTestLinker(CXLinker* linker) { mFreeLinker = linker->append(mFreeLinker); return this; } bool CReuseCompletionGraphCacheReader::addTestingConcepts(CSortedNegLinker* conLinker, bool negate, cint64 addingLevel, CCACHINGSET* testedConceptSet) { bool oneAdded = false; for (CSortedNegLinker* conLinkerIt = conLinker; conLinkerIt; conLinkerIt = conLinkerIt->getNext()) { CConcept* concept = conLinkerIt->getData(); bool negated = conLinkerIt->isNegated(); oneAdded |= addTestingConcept(concept,negated^negate,addingLevel,testedConceptSet); } return oneAdded; } bool CReuseCompletionGraphCacheReader::addTestingConcept(CConcept* concept, bool negated, cint64 addingLevel, CCACHINGSET* testedConceptSet) { if (!testedConceptSet->contains(concept)) { testedConceptSet->insert(concept); CXLinker* newLinker = getConceptTestLinker(); newLinker->initLinker(TConceptNegPair(concept,negated)); if (addingLevel < mTestConceptLinkerLevel) { addingLevel = mTestConceptLinkerLevel; } mTestConceptLinkerVec[addingLevel] = newLinker->append(mTestConceptLinkerVec[addingLevel]); ++mTestConceptLinkerCount; return true; } return false; } CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheReader::getCacheEntry(CConcept* concept, bool* minimalCompletionGraph, bool* deterministicConnection) { CReuseCompletionGraphCacheEntry* entry = nullptr; if (hasUpdatedSlotItem()) { switchToUpdatedSlotItem(); } if (mCurrentSlot) { CReuseCompletionGraphCompatibilityEntryHash* entryHash = mCurrentSlot->getEntryHash(); cint64 entryCount = mCurrentSlot->getEntryCount(); if (entryCount > 0) { if (mEntryVotingVec.size() < entryCount) { mEntryVotingVec.resize(entryCount); } for (cint64 i = 0; i < entryCount; ++i) { CCacheEntryVotingItem& item = mEntryVotingVec[i]; item.reset(); } CCACHINGSET testedConceptSet(&mContext); for (cint64 i = 0; i < mTestConceptLinkerVecSize; ++i) { mTestConceptLinkerVec[i] = nullptr; } mTestConceptLinkerCount = 1; mTestConceptLinkerLevel = 0; CXLinker* testConceptLinker = getConceptTestLinker(); testConceptLinker->initLinker(TConceptNegPair(concept,false)); mTestConceptLinkerVec[0] = testConceptLinker; testedConceptSet.insert(concept); while (mTestConceptLinkerCount > 0) { CXLinker* tmpTestConLinker = nullptr; for (; mTestConceptLinkerLevel < mTestConceptLinkerVecSize; ++mTestConceptLinkerLevel) { tmpTestConLinker = mTestConceptLinkerVec[mTestConceptLinkerLevel]; if (tmpTestConLinker) { mTestConceptLinkerVec[mTestConceptLinkerLevel] = tmpTestConLinker->getNext(); tmpTestConLinker->clearNext(); break; } } --mTestConceptLinkerCount; CConcept* testCon = tmpTestConLinker->getData().first; bool testConNeg = tmpTestConLinker->getData().second; bool searchOperandConcepts = true; if (!testConNeg && testCon->hasClassName()) { // test whether concept is available in cache CCacheValue cacheValue(testCon->getConceptTag(),(cint64)testCon,CCacheValue::CACHEVALTAGANDCONCEPT); const CReuseCompletionGraphCompatibilityEntryHashData& data = entryHash->value(cacheValue); CXLinker* entailedEntryLinker = data.getEntailedEntryLinker(); CXLinker* incompatibleEntryLinker = data.getIncompatibleEntryLinker(); if (entailedEntryLinker || incompatibleEntryLinker) { for (CXLinker* entailedEntryLinkerIt = entailedEntryLinker; entailedEntryLinkerIt; entailedEntryLinkerIt = entailedEntryLinkerIt->getNext()) { CReuseCompletionGraphCacheEntry* entry = entailedEntryLinkerIt->getData(); CCacheEntryVotingItem& item = mEntryVotingVec[entry->getEntryID()]; item.mEntry = entry; item.mEntailedCount++; item.mTmpReferenced = true; item.mMinConnectionLevel = qMin(item.mMinConnectionLevel,mTestConceptLinkerLevel); item.mMinimalFound |= entry->hasMinimalValue(cacheValue); } for (CXLinker* incompatibleEntryLinkerIt = incompatibleEntryLinker; incompatibleEntryLinkerIt; incompatibleEntryLinkerIt = incompatibleEntryLinkerIt->getNext()) { CReuseCompletionGraphCacheEntry* entry = incompatibleEntryLinkerIt->getData(); CCacheEntryVotingItem& item = mEntryVotingVec[entry->getEntryID()]; item.mEntry = entry; item.mIncompatibleCount++; item.mTmpReferenced = true; } for (cint64 i = 0; i < entryCount; ++i) { CCacheEntryVotingItem& item = mEntryVotingVec[i]; if (!item.mTmpReferenced) { item.mMissingCount++; } else { item.mTmpReferenced = false; } } searchOperandConcepts = false; } } if (searchOperandConcepts) { CRole* role = testCon->getRole(); if (role) { addTestingConcepts(role->getDomainConceptList(),false,0,&testedConceptSet); addTestingConcepts(role->getRangeConceptList(),false,2,&testedConceptSet); } cint64 opCode = testCon->getOperatorCode(); CSortedNegLinker* opLinker = testCon->getOperandList(); if (!testConNeg && (opCode == CCIMPLAQAND || opCode == CCBRANCHAQAND || opCode == CCAQAND || opCode == CCEQ || opCode == CCAND || opCode == CCSUB || opCode == CCIMPLTRIG) || testConNeg && (opCode == CCOR)) { addTestingConcepts(opLinker,testConNeg,0,&testedConceptSet); } else if (!testConNeg && (opCode == CCOR) || testConNeg && (opCode == CCEQ || opCode == CCAND)) { addTestingConcepts(opLinker,testConNeg,3,&testedConceptSet); } else if (!testConNeg && (opCode == CCSOME || opCode == CCAQSOME) || testConNeg && (opCode == CCALL)) { addTestingConcepts(opLinker,testConNeg,1,&testedConceptSet); } else if (!testConNeg && (opCode == CCATLEAST) || testConNeg && (opCode == CCATMOST)) { cint64 cardinality = testCon->getParameter() + 1*testConNeg; if (cardinality >= 1) { addTestingConcepts(opLinker,testConNeg,1,&testedConceptSet); } } else if (opCode == CCAQALL || opCode == CCIMPLALL || opCode == CCBRANCHALL) { addTestingConcepts(opLinker,false,2,&testedConceptSet); } else if (opCode == CCATMOST || opCode == CCATLEAST) { addTestingConcepts(opLinker,false,3,&testedConceptSet); } else if (opCode == CCIMPL) { addTestingConcept(opLinker->getData(),opLinker->isNegated(),0,&testedConceptSet); } else if (opCode == CCAQCHOOCE) { for (CSortedNegLinker* opLinkerIt = opLinker; opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { if (opLinkerIt->isNegated() == testConNeg) { addTestingConcept(opLinkerIt->getData(),false,0,&testedConceptSet); } } } } releaseConceptTestLinker(tmpTestConLinker); } cint64 minMissingCount = 0; CCacheEntryVotingItem* bestEntryItem = nullptr; for (cint64 i = 0; i < entryCount; ++i) { CCacheEntryVotingItem& item = mEntryVotingVec[i]; if (item.mEntailedCount >= 1 && item.mIncompatibleCount <= 0 && (bestEntryItem == nullptr || minMissingCount < item.mMissingCount)) { minMissingCount = item.mMissingCount; bestEntryItem = &item; } } if (bestEntryItem) { entry = bestEntryItem->mEntry; if (deterministicConnection) { *deterministicConnection = bestEntryItem->mMinConnectionLevel <= 1; } if (minimalCompletionGraph) { *minimalCompletionGraph = bestEntryItem->mMinimalFound; } } } } return entry; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheEntryWriteData.h0000644000175000017500000000441012520551026026366 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCACHEENTRYWRITEDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCACHEENTRYWRITEDATA_H // Libraries includes #include // Namespace includes // Other includes #include "CacheSettings.h" #include "CCacheValue.h" #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CCacheEntryWriteData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCacheEntryWriteData : public CLinkerBase { // public methods public: //! Constructor CCacheEntryWriteData(); enum CACHEWRITEDATATYPE { SATEXPANDCACHEWRITEDATATYPE, SATBRANCHCACHEWRITEDATATYPE, REUSECOMPLETIONGRAPHWRITEEXPANDDATATYPE, BACKENDASSOCIATIONWRITEDATATYPE }; CACHEWRITEDATATYPE getCacheWriteDataType(); // protected methods protected: // protected variables protected: CACHEWRITEDATATYPE mType; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCACHEENTRYWRITEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheReader.h0000644000175000017500000000426112520551030030736 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEREADER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEREADER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CComputedConsequencesCacheEntry.h" #include "CComputedConsequencesTypesCacheEntry.h" // Other includes #include "Reasoner/Ontology/CIndividualProcessData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Cache { /*! * * \class CComputedConsequencesCacheReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CComputedConsequencesCacheReader : public CLinkerBase { // public methods public: //! Constructor CComputedConsequencesCacheReader(); CComputedConsequencesTypesCacheEntry* getTypesCacheEntry(CIndividual* individual); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEREADER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheStatistics.h0000644000175000017500000000402112520551026025610 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCACHESTATISTICS_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCACHESTATISTICS_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CCacheStatistics * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCacheStatistics { // public methods public: CCacheStatistics(); CCacheStatistics* reset(); CCacheStatistics* incCacheEntriesCount(cint64 incCount = 1); CCacheStatistics* setMemoryConsumption(cint64 memoryConsumption); cint64 getCacheEntriesCount(); cint64 getMemoryConsumption(); // protected methods protected: // protected variables protected: cint64 mMemoryConsumption; cint64 mCacheEntriesCount; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCACHESTATISTICS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCache.cpp0000644000175000017500000001711112520551032030111 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReuseCompletionGraphCache.h" #include "CReuseCompletionGraphCacheWriter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CReuseCompletionGraphCache::CReuseCompletionGraphCache(QString threadIdentifierName, CWatchDog *watchDogThread) : CThread(threadIdentifierName,watchDogThread) { startThread(QThread::HighestPriority); mSlotLinker = nullptr; mReaderLinker = nullptr; CMemoryAllocationManager* memMan = mContext.getMemoryAllocationManager(); mEntyHash = CObjectParameterizingAllocator< CReuseCompletionGraphCompatibilityEntryHash,CContext* >::allocateAndConstructAndParameterize(memMan,&mContext); mEntyList = CObjectParameterizingAllocator< CCACHINGLIST,CContext* >::allocateAndConstructAndParameterize(memMan,&mContext); mEntryCount = 0; } CReuseCompletionGraphCache::~CReuseCompletionGraphCache() { } void CReuseCompletionGraphCache::createReaderSlotUpdate(CReuseCompletionGraphCacheContext* context) { CMemoryPoolProvider* memProv = context->getMemoryPoolAllocationManager(); CReuseCompletionGraphCacheSlotItem* slot = CObjectMemoryPoolAllocator::allocateAndConstructWithMemroyPool(memProv); CMemoryPoolContainerAllocationManager slotMemMan(slot,memProv); CMemoryAllocationManager* memMan = &slotMemMan; CContextBase tmpContext(memMan); CReuseCompletionGraphCompatibilityEntryHash* entyHash = CObjectParameterizingAllocator< CReuseCompletionGraphCompatibilityEntryHash,CContext* >::allocateAndConstructAndParameterize(memMan,&tmpContext); *entyHash = *mEntyHash; entyHash->detach(); slot->setEntryHash(entyHash); slot->setEntryCount(mEntryCount); if (mSlotLinker) { mSlotLinker->append(slot); } else { mSlotLinker = slot; } CReuseCompletionGraphCacheReader* readerLinkerIt = mReaderLinker; while (readerLinkerIt) { slot->incReader(); readerLinkerIt->updateSlot(slot); readerLinkerIt = readerLinkerIt->getNext(); } } void CReuseCompletionGraphCache::cleanUnusedSlots(CReuseCompletionGraphCacheContext* context) { CMemoryPoolAllocationManager* memMan = context->getMemoryPoolAllocationManager(); CReuseCompletionGraphCacheSlotItem* slotLinkerIt = mSlotLinker; CReuseCompletionGraphCacheSlotItem* lastSlotLinker = nullptr; while (slotLinkerIt) { CReuseCompletionGraphCacheSlotItem* tmpSlotLinker = nullptr; if (!slotLinkerIt->hasCacheReaders()) { tmpSlotLinker = slotLinkerIt; } CReuseCompletionGraphCacheSlotItem* nextSlotLinker = slotLinkerIt->getNext(); if (tmpSlotLinker) { if (!lastSlotLinker) { mSlotLinker = nextSlotLinker; } else { lastSlotLinker->setNext(nextSlotLinker); } CMemoryPool* memoryPools = tmpSlotLinker->getMemoryPools(); memMan->releaseTemporaryMemoryPools(memoryPools); } else { lastSlotLinker = slotLinkerIt; } slotLinkerIt = nextSlotLinker; } } CReuseCompletionGraphCacheReader* CReuseCompletionGraphCache::createCacheReader() { CReuseCompletionGraphCacheReader* reader = new CReuseCompletionGraphCacheReader(); mReaderSyncMutex.lock(); mReaderLinker = reader->append(mReaderLinker); mReaderSyncMutex.unlock(); return reader; } CReuseCompletionGraphCacheWriter* CReuseCompletionGraphCache::createCacheWriter() { CReuseCompletionGraphCacheWriter* writer = new CReuseCompletionGraphCacheWriter(this); return writer; } CReuseCompletionGraphCache* CReuseCompletionGraphCache::writeExpandCache(CReuseCompletionGraphCacheEntryWriteData* writeData, CMemoryPool* memoryPools) { postEvent(new CWriteCachedDataEvent(writeData,memoryPools)); return this; } void CReuseCompletionGraphCache::writeExpandCacheData(CReuseCompletionGraphCacheContext* context, CCACHINGLIST* cacheList, CCACHINGLIST* minimalCacheList, CSatisfiableCalculationJobInstantiation* jobInst) { CMemoryAllocationManager* memMan = context->getMemoryAllocationManager(); CReuseCompletionGraphCacheEntry* newEntry = CObjectParameterizingAllocator< CReuseCompletionGraphCacheEntry,CReuseCompletionGraphCacheContext* >::allocateAndConstructAndParameterize(memMan,context); newEntry->setJobInstantiation(jobInst); mEntyList->append(newEntry); newEntry->setEntryID(mEntryCount); for (CCACHINGLIST::const_iterator it = cacheList->constBegin(), itEnd = cacheList->constEnd(); it != itEnd; ++it) { const CCacheValue& cacheValue = *it; CReuseCompletionGraphCompatibilityEntryHashData& hashData = (*mEntyHash)[cacheValue]; CXLinker* linker = CObjectAllocator< CXLinker >::allocateAndConstruct(memMan); linker->initLinker(newEntry); hashData.addEntailedEntyLinker(linker); newEntry->addEntailedValue(cacheValue); } for (CCACHINGLIST::const_iterator it = minimalCacheList->constBegin(), itEnd = minimalCacheList->constEnd(); it != itEnd; ++it) { const CCacheValue& cacheValue = *it; newEntry->addMinimalValue(cacheValue); } ++mEntryCount; } bool CReuseCompletionGraphCache::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CThread::processCustomsEvents(type,event)) { return true; } if (type == CWriteCachedDataEvent::EVENTTYPE) { CWriteCachedDataEvent* wcde = (CWriteCachedDataEvent*)event; CMemoryPool* memoryPools = wcde->getMemoryPools(); CReuseCompletionGraphCacheEntryWriteData* dataLinkerIt = (CReuseCompletionGraphCacheEntryWriteData*)wcde->getWriteData(); while (dataLinkerIt) { if (dataLinkerIt->getCacheWriteDataType() == CReuseCompletionGraphCacheEntryWriteData::REUSECOMPLETIONGRAPHWRITEEXPANDDATATYPE) { CReuseCompletionGraphCacheEntryExpandWriteData* writeExpandData = (CReuseCompletionGraphCacheEntryExpandWriteData*)dataLinkerIt; CCACHINGLIST* cacheList = writeExpandData->getCacheValueList(); CCACHINGLIST* minimalCacheList = writeExpandData->getCacheValueList(); CSatisfiableCalculationJobInstantiation* jobInst = writeExpandData->getJobInstantiation(); writeExpandCacheData(&mContext,cacheList,minimalCacheList,jobInst); } dataLinkerIt = (CReuseCompletionGraphCacheEntryWriteData*)dataLinkerIt->getNext(); } createReaderSlotUpdate(&mContext); cleanUnusedSlots(&mContext); mContext.getMemoryPoolAllocationManager()->releaseTemporaryMemoryPools(memoryPools); } return false; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheContext.h0000644000175000017500000000576712520551030031174 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHECONTEXT_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHECONTEXT_H // Libraries includes // Namespace includes #include "CacheSettings.h" // Other includes #include "Context/CContext.h" #include "Utilities/Memory/CMemoryPoolProvider.h" #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" #include "Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.h" #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; using namespace Utilities::Memory; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Cache { /*! * * \class CComputedConsequencesCacheContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CComputedConsequencesCacheContext : public CContext { // public methods public: //! Constructor CComputedConsequencesCacheContext(); ~CComputedConsequencesCacheContext(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); virtual CMemoryPoolAllocationManager* getMemoryPoolAllocationManager(); virtual CMemoryPoolProvider* getMemoryPoolProvider(); cint64 getMemoryConsumption(); CComputedConsequencesCacheContext* releaseTemporaryMemoryPools(CMemoryPool* memoryPools); CSortedNegLinker* createConceptLinker(bool create = true); CComputedConsequencesCacheContext* addConceptLinker(CSortedNegLinker* linker); // protected methods protected: // protected variables protected: CMemoryPoolAllocationManager* mMemMan; CNewAllocationMemoryPoolProvider* mMemoryPoolProvider; CSortedNegLinker* mConLinker; cint64 mAddRelMemory; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHECONTEXT_H ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheExpansionWriteData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheE0000644000175000017500000001075212520551036032172 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeAssociatedExpansionCacheExpansionWriteData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationNodeAssociatedExpansionCacheExpansionWriteData::CSaturationNodeAssociatedExpansionCacheExpansionWriteData() { mWriteDataType = SNAECWT_EXPAND; } CSaturationNodeAssociatedExpansionCacheExpansionWriteData* CSaturationNodeAssociatedExpansionCacheExpansionWriteData::initExpansionWriteData(CIndividualSaturationProcessNode* saturationNode, CSaturationNodeAssociatedConceptLinker* conLinker) { mSaturationNode = saturationNode; mExpansionConceptLinker = conLinker; mDependentNominalSet = nullptr; mTightAtMostRestriction = false; mDeterministicExpansion = true; mRequiresNondeterministicExpansion = false; mConceptSetSignature = 0; mTotalConceptCount = 0; return this; } CIndividualSaturationProcessNode* CSaturationNodeAssociatedExpansionCacheExpansionWriteData::getSaturationIndividualNode() { return mSaturationNode; } CSaturationNodeAssociatedDependentNominalSet* CSaturationNodeAssociatedExpansionCacheExpansionWriteData::getDependentNominalSet() { return mDependentNominalSet; } CSaturationNodeAssociatedExpansionCacheExpansionWriteData* CSaturationNodeAssociatedExpansionCacheExpansionWriteData::setDependentNominalSet(CSaturationNodeAssociatedDependentNominalSet* depNomSet) { mDependentNominalSet = depNomSet; return this; } CSaturationNodeAssociatedConceptLinker* CSaturationNodeAssociatedExpansionCacheExpansionWriteData::getExpansionConceptLinker() { return mExpansionConceptLinker; } bool CSaturationNodeAssociatedExpansionCacheExpansionWriteData::hasTightAtMostRestriction() { return mTightAtMostRestriction; } CSaturationNodeAssociatedExpansionCacheExpansionWriteData* CSaturationNodeAssociatedExpansionCacheExpansionWriteData::setTightAtMostRestriction(bool tightAtMostRestriction) { mTightAtMostRestriction = tightAtMostRestriction; return this; } bool CSaturationNodeAssociatedExpansionCacheExpansionWriteData::isDeterministicExpansion() { return mDeterministicExpansion; } CSaturationNodeAssociatedExpansionCacheExpansionWriteData* CSaturationNodeAssociatedExpansionCacheExpansionWriteData::setDeterministicExpansion(bool detExpansion) { mDeterministicExpansion = detExpansion; return this; } bool CSaturationNodeAssociatedExpansionCacheExpansionWriteData::requiresNondeterministicExpansion() { return mRequiresNondeterministicExpansion; } CSaturationNodeAssociatedExpansionCacheExpansionWriteData* CSaturationNodeAssociatedExpansionCacheExpansionWriteData::setRequiresNondeterministicExpansion(bool requiresnondetExpansion) { mRequiresNondeterministicExpansion = requiresnondetExpansion; return this; } cint64 CSaturationNodeAssociatedExpansionCacheExpansionWriteData::getConceptSetSignature() { return mConceptSetSignature; } cint64 CSaturationNodeAssociatedExpansionCacheExpansionWriteData::getTotalConceptCount() { return mTotalConceptCount; } CSaturationNodeAssociatedExpansionCacheExpansionWriteData* CSaturationNodeAssociatedExpansionCacheExpansionWriteData::setConceptSetSignature(cint64 signature) { mConceptSetSignature = signature; return this; } CSaturationNodeAssociatedExpansionCacheExpansionWriteData* CSaturationNodeAssociatedExpansionCacheExpansionWriteData::setTotalConceptCount(cint64 conceptCount) { mTotalConceptCount = conceptCount; return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheRedirectionItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheRedire0000644000175000017500000000457612520551042032177 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEREDIRECTIONITEM_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEREDIRECTIONITEM_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CSignatureSatisfiableExpanderCacheEntry.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSignatureSatisfiableExpanderCacheRedirectionItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureSatisfiableExpanderCacheRedirectionItem { // public methods public: //! Constructor CSignatureSatisfiableExpanderCacheRedirectionItem(); CSignatureSatisfiableExpanderCacheRedirectionItem* initRedirectionItem(CSignatureSatisfiableExpanderCacheEntry* cacheEntry, cint64 signature, cint64 expanderCount); CSignatureSatisfiableExpanderCacheEntry* getCacheEntry(); cint64 getSignature(); cint64 getExpanderCount(); // protected methods protected: // protected variables protected: CSignatureSatisfiableExpanderCacheEntry* mCacheEntry; cint64 mSignature; cint64 mExpCount; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEREDIRECTIONITEM_H ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheExpansionWriteData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheE0000644000175000017500000001024312520551036032165 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEEXPANSIONWRITEDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEEXPANSIONWRITEDATA_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CSaturationNodeAssociatedExpansionCacheWriteData.h" #include "CSaturationNodeAssociatedConceptLinker.h" #include "CSaturationNodeAssociatedDependentNominalSet.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Container/CLinker.h" #include "Reasoner/Kernel/Process/CIndividualSaturationProcessNode.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { using namespace Process; namespace Cache { /*! * * \class CSaturationNodeAssociatedExpansionCacheExpansionWriteData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeAssociatedExpansionCacheExpansionWriteData : public CSaturationNodeAssociatedExpansionCacheWriteData { // public methods public: //! Constructor CSaturationNodeAssociatedExpansionCacheExpansionWriteData(); CSaturationNodeAssociatedExpansionCacheExpansionWriteData* initExpansionWriteData(CIndividualSaturationProcessNode* saturationNode, CSaturationNodeAssociatedConceptLinker* conLinker); CIndividualSaturationProcessNode* getSaturationIndividualNode(); CSaturationNodeAssociatedDependentNominalSet* getDependentNominalSet(); CSaturationNodeAssociatedExpansionCacheExpansionWriteData* setDependentNominalSet(CSaturationNodeAssociatedDependentNominalSet* depNomSet); CSaturationNodeAssociatedConceptLinker* getExpansionConceptLinker(); bool hasTightAtMostRestriction(); CSaturationNodeAssociatedExpansionCacheExpansionWriteData* setTightAtMostRestriction(bool tightAtMostRestriction); bool isDeterministicExpansion(); CSaturationNodeAssociatedExpansionCacheExpansionWriteData* setDeterministicExpansion(bool detExpansion); bool requiresNondeterministicExpansion(); CSaturationNodeAssociatedExpansionCacheExpansionWriteData* setRequiresNondeterministicExpansion(bool requiresnondetExpansion); cint64 getConceptSetSignature(); CSaturationNodeAssociatedExpansionCacheExpansionWriteData* setConceptSetSignature(cint64 signature); cint64 getTotalConceptCount(); CSaturationNodeAssociatedExpansionCacheExpansionWriteData* setTotalConceptCount(cint64 conceptCount); // protected methods protected: // protected variables protected: CIndividualSaturationProcessNode* mSaturationNode; bool mTightAtMostRestriction; bool mDeterministicExpansion; bool mRequiresNondeterministicExpansion; cint64 mConceptSetSignature; cint64 mTotalConceptCount; CSaturationNodeAssociatedDependentNominalSet* mDependentNominalSet; CSaturationNodeAssociatedConceptLinker* mExpansionConceptLinker; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEEXPANSIONWRITEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationCache.h0000644000175000017500000000351312520551036025615 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONCACHE_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONCACHE_H // Libraries includes // Namespace includes #include "CSatisfiableCache.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSaturationCache * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationCache : public CSatisfiableCache { // public methods public: //! Constructor CSaturationCache(); //! Destructor virtual ~CSaturationCache(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONCACHE_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalityCacheItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalityC0000644000175000017500000000677112520551024032250 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCARDINALITYCACHEITEM_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCARDINALITYCACHEITEM_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "CBackendRepresentativeMemoryCacheContext.h" #include "CBackendRepresentativeMemoryCardinalityValueLinker.h" // Other includes #include "Utilities/Memory/CObjectParameterizingAllocator.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemoryCardinalityCacheItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryCardinalityCacheItem : public CLinkerBase { // public methods public: //! Constructor CBackendRepresentativeMemoryCardinalityCacheItem(CBackendRepresentativeMemoryCacheContext* context); CBackendRepresentativeMemoryCardinalityCacheItem* initCacheEntry(cint64 signature, cint64 entryID); cint64 getCacheEntryID(); CBackendRepresentativeMemoryCardinalityCacheItem* setCacheEntryID(cint64 entryID); cint64 getSignature(); CBackendRepresentativeMemoryCardinalityCacheItem* setSignature(cint64 signature); CBackendRepresentativeMemoryCardinalityCacheItem* addCardinalityCacheValueLinker(CBackendRepresentativeMemoryCardinalityValueLinker* linker); CBackendRepresentativeMemoryCardinalityValueLinker* getCardinalityCacheValueLinker(); CCACHINGHASH* getTagCardinalityCacheValueHash(bool create = false); CBackendRepresentativeMemoryCardinalityCacheItem* setTagCardinalityCacheValueHash(CCACHINGHASH* hash); cint64 getCardinalityCacheValueCount(); // protected methods protected: // protected variables protected: CBackendRepresentativeMemoryCacheContext* mContext; cint64 mSignature; CCACHINGHASH* mTagCardValueHash; CBackendRepresentativeMemoryCardinalityValueLinker* mCardinalityValueLinker; cint64 mCardinalityValueCount; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCARDINALITYCACHEITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendCacheWriteData.cpp0000644000175000017500000000213512520551020027143 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendCacheWriteData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendCacheWriteData::CBackendCacheWriteData() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheWriter.h0000644000175000017500000000422612520551034030760 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEWRITER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEWRITER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "CReuseCompletionGraphCache.h" #include "CReuseCompletionGraphCacheEntryWriteData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CReuseCompletionGraphCacheWriter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReuseCompletionGraphCacheWriter { // public methods public: //! Constructor CReuseCompletionGraphCacheWriter(CReuseCompletionGraphCache* cache); CReuseCompletionGraphCacheWriter* writeExpandCache(CReuseCompletionGraphCacheEntryWriteData* writeData, CMemoryPool* memoryPools); // protected methods protected: // protected variables protected: CReuseCompletionGraphCache* mCache; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHEWRITER_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheSlotItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheSlotIte0000644000175000017500000000574612520551022032210 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryCacheSlotItem.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryCacheSlotItem::CBackendRepresentativeMemoryCacheSlotItem(CMemoryPool* memoryPool) : CLinkerBase(this),CMemoryPoolContainer(memoryPool) { mReaderUsing = false; mSigLabelItemHash = nullptr; mSigCardLabelItemHash = nullptr; } bool CBackendRepresentativeMemoryCacheSlotItem::incReader() { if (mReaderSharingCount.ref()) { mReaderUsing = true; } return true; } bool CBackendRepresentativeMemoryCacheSlotItem::incReader(cint64 incCount) { for (cint64 i = 0; i < incCount; ++i) { incReader(); } return mReaderUsing; } bool CBackendRepresentativeMemoryCacheSlotItem::decReader() { if (!mReaderSharingCount.deref()) { mReaderUsing = false; } return mReaderUsing; } CBackendRepresentativeMemoryCacheSlotItem* CBackendRepresentativeMemoryCacheSlotItem::setSignatureLabelItemHash(CCACHINGHASH* sigItemHash) { mSigLabelItemHash = sigItemHash; return this; } CBackendRepresentativeMemoryCacheSlotItem* CBackendRepresentativeMemoryCacheSlotItem::setSignatureCardinalityItemHash(CCACHINGHASH* sigItemHash) { mSigCardLabelItemHash = sigItemHash; return this; } bool CBackendRepresentativeMemoryCacheSlotItem::hasCacheReaders() { return mReaderUsing; } CCACHINGHASH* CBackendRepresentativeMemoryCacheSlotItem::getSignatureLabelItemHash() { return mSigLabelItemHash; } CCACHINGHASH* CBackendRepresentativeMemoryCacheSlotItem::getSignatureCardinalityItemHash() { return mSigCardLabelItemHash; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheWriteData.h0000644000175000017500000000445212520551030031422 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEWRITEDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEWRITEDATA_H // Libraries includes #include // Namespace includes #include "CacheSettings.h" #include "CCacheEntryWriteData.h" #include "CCacheValue.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CComputedConsequencesCacheWriteData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CComputedConsequencesCacheWriteData : public CCacheEntryWriteData { // public methods public: //! Constructor CComputedConsequencesCacheWriteData(); enum COMPUTEDCONSEQUENCESCACHEWRITEDATATYPE { CCWT_TYPE = 1 }; COMPUTEDCONSEQUENCESCACHEWRITEDATATYPE getWriteDataType(); // protected methods protected: // protected variables protected: COMPUTEDCONSEQUENCESCACHEWRITEDATATYPE mWriteDataType; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEWRITEDATA_H ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheLabelAssociationWriteData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheLabelAs0000644000175000017500000000475412520551022032126 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryCacheLabelAssociationWriteData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryCacheLabelAssociationWriteData::CBackendRepresentativeMemoryCacheLabelAssociationWriteData() { } CBackendRepresentativeMemoryCacheLabelAssociationWriteData* CBackendRepresentativeMemoryCacheLabelAssociationWriteData::initWriteData(CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tempAssWriteDataLinker, CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* tempLabelWriteDataLinker, CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* tempCardWriteDataLinker) { mTempAssWriteDataLinker = tempAssWriteDataLinker; mTempLabelWriteDataLinker = tempLabelWriteDataLinker; mTempCardWriteDataLinker = tempCardWriteDataLinker; mType = BACKENDASSOCIATIONWRITEDATATYPE; return this; } CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* CBackendRepresentativeMemoryCacheLabelAssociationWriteData::getTemporaryAssociationWriteDataLinker() { return mTempAssWriteDataLinker; } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* CBackendRepresentativeMemoryCacheLabelAssociationWriteData::getTemporaryLabelWriteDataLinker() { return mTempLabelWriteDataLinker; } CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* CBackendRepresentativeMemoryCacheLabelAssociationWriteData::getTemporaryCardinaltyWriteDataLinker() { return mTempCardWriteDataLinker; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedDeterministicConceptExpansion.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedDeterministicCo0000644000175000017500000000467712520551036032273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDDETERMINISTICCONCEPTEXPANSION_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDDETERMINISTICCONCEPTEXPANSION_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CSaturationNodeAssociatedConceptExpansion.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSaturationNodeAssociatedDeterministicConceptExpansion * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeAssociatedDeterministicConceptExpansion : public CSaturationNodeAssociatedConceptExpansion { // public methods public: //! Constructor CSaturationNodeAssociatedDeterministicConceptExpansion(CSaturationNodeAssociatedExpansionCacheContext* context); CSaturationNodeAssociatedDeterministicConceptExpansion* initDeterministicConceptExpansion(); bool requiresNonDeterministicExpansion(); CSaturationNodeAssociatedDeterministicConceptExpansion* setNonDeterministicExpansionRequired(bool nondeterministicExpansionRequired); // protected methods protected: // protected variables protected: bool mRequiresNonDeterministicExpansion; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDDETERMINISTICCONCEPTEXPANSION_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheWriter.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheWriter.0000644000175000017500000000271712520551024032154 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryCacheWriter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryCacheWriter::CBackendRepresentativeMemoryCacheWriter(CBackendRepresentativeMemoryCache* cache) : mCache(cache) { } CBackendRepresentativeMemoryCacheWriter* CBackendRepresentativeMemoryCacheWriter::writeCachedData(CBackendRepresentativeMemoryCacheWriteData* writeData, CMemoryPool* memoryPools) { mCache->writeCachedData(writeData,memoryPools); return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesTypesCacheEntry.h0000644000175000017500000000511112520551030031655 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CComputedConsequencesTypesCacheEntry_H #define KONCLUDE_REASONER_KERNEL_CACHE_CComputedConsequencesTypesCacheEntry_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CComputedConsequencesCacheContext.h" #include "CComputedConsequencesCacheEntry.h" // Other includes #include "Reasoner/Ontology/CIndividual.h" #include "Reasoner/Ontology/CComputedConsequencesCachingData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Cache { /*! * * \class CComputedConsequencesTypesCacheEntry * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CComputedConsequencesTypesCacheEntry : public CComputedConsequencesCacheEntry, public CComputedConsequencesCachingData { // public methods public: //! Constructor CComputedConsequencesTypesCacheEntry(CComputedConsequencesCacheContext* context); CComputedConsequencesTypesCacheEntry* initCacheEntry(CIndividual* individual); bool hasConcept(CConcept* concept, bool negation); CSortedNegLinker* getConceptLinker(); CComputedConsequencesTypesCacheEntry* addConceptLinker(CSortedNegLinker* conceptLinker); // protected methods protected: // protected variables protected: CIndividual* mIndividual; CSortedNegLinker* mConceptLinker; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CComputedConsequencesTypesCacheEntry_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheHasher.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheHasher0000644000175000017500000001327212520551042032170 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureSatisfiableExpanderCacheHasher.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSignatureSatisfiableExpanderCacheHasher::CSignatureSatisfiableExpanderCacheHasher(CCACHINGSET* cacheValueSet) { mCacheValueSet = cacheValueSet; mHashValue = 0; mCacheValueCount = cacheValueSet->count(); mCacheValueLinker = nullptr; calculateHashValue(mCacheValueSet); } CSignatureSatisfiableExpanderCacheHasher::CSignatureSatisfiableExpanderCacheHasher(CExpanderCacheValueLinker* cacheValueLinker, cint64 count) { mCacheValueSet = nullptr; mHashValue = 0; mCacheValueCount = count; mCacheValueLinker = cacheValueLinker; calculateHashValue(mCacheValueLinker,mCacheValueCount); } CSignatureSatisfiableExpanderCacheHasher::CSignatureSatisfiableExpanderCacheHasher(const CSignatureSatisfiableExpanderCacheHasher& hasher) { mHashValue = hasher.mHashValue; mCacheValueSet = hasher.mCacheValueSet; mCacheValueLinker = hasher.mCacheValueLinker; mCacheValueCount = hasher.mCacheValueCount; } cint64 CSignatureSatisfiableExpanderCacheHasher::getHashValue() const { return mHashValue; } bool CSignatureSatisfiableExpanderCacheHasher::operator==(const CSignatureSatisfiableExpanderCacheHasher& hasher) const { if (mHashValue != hasher.mHashValue) { return false; } if (mCacheValueCount != hasher.mCacheValueCount) { return false; } if (mCacheValueLinker && hasher.mCacheValueLinker) { if (!hasEqualCacheValues(mCacheValueLinker,hasher.mCacheValueLinker,mCacheValueCount)) { return false; } } else if (mCacheValueSet && hasher.mCacheValueSet) { if (!hasEqualCacheValues(mCacheValueSet,hasher.mCacheValueSet)) { return false; } } else if (mCacheValueLinker && hasher.mCacheValueSet) { if (!hasEqualCacheValues(mCacheValueLinker,hasher.mCacheValueSet,mCacheValueCount)) { return false; } } else { if (!hasEqualCacheValues(hasher.mCacheValueLinker,mCacheValueSet,mCacheValueCount)) { return false; } } return false; } void CSignatureSatisfiableExpanderCacheHasher::calculateHashValue(CCACHINGSET* cacheValueSet) { mHashValue = 0; for (CCACHINGSET::const_iterator it = cacheValueSet->constBegin(), itEnd = cacheValueSet->constEnd(); it != itEnd; ++it) { CCacheValue cacheValue(*it); extendHashValue(&cacheValue); } } void CSignatureSatisfiableExpanderCacheHasher::calculateHashValue(CExpanderCacheValueLinker* cacheValueLinker, cint64 count) { mHashValue = 0; CExpanderCacheValueLinker* cacheValueLinkerIt = cacheValueLinker; cint64 nr = 0; while (cacheValueLinkerIt && nr++ < count) { extendHashValue(cacheValueLinkerIt->getCacheValue()); cacheValueLinkerIt = cacheValueLinkerIt->getNext(); } } void CSignatureSatisfiableExpanderCacheHasher::extendHashValue(CCacheValue* cacheValue) { uint nextHashValue = qHash(*cacheValue); mHashValue += nextHashValue; } bool CSignatureSatisfiableExpanderCacheHasher::hasEqualCacheValues(CExpanderCacheValueLinker* cacheValueLinker, CExpanderCacheValueLinker* cacheValueLinker2, cint64 count) const { cint64 nr = 0; while (cacheValueLinker && cacheValueLinker2 && nr++ < count) { if (*cacheValueLinker->getCacheValue() != *cacheValueLinker2->getCacheValue()) { return false; } cacheValueLinker = cacheValueLinker->getNext(); cacheValueLinker2 = cacheValueLinker2->getNext(); } if (nr < count) { if (cacheValueLinker || cacheValueLinker2) { return false; } } return true; } bool CSignatureSatisfiableExpanderCacheHasher::hasEqualCacheValues(CCACHINGSET* cacheValueSet, CCACHINGSET* cacheValueSet2) const { CCACHINGSET::const_iterator it1 = cacheValueSet->constBegin(), it1End = cacheValueSet->constEnd(); CCACHINGSET::const_iterator it2 = cacheValueSet2->constBegin(), it2End = cacheValueSet2->constEnd(); while (it1 != it1End) { if (*it1 != *it2) { return false; } ++it1; ++it2; } return true; } bool CSignatureSatisfiableExpanderCacheHasher::hasEqualCacheValues(CExpanderCacheValueLinker* cacheValueLinker, CCACHINGSET* cacheValueSet, cint64 count) const { CExpanderCacheValueLinker* cacheValueLinkerIt = cacheValueLinker; cint64 nr = 0; while (cacheValueLinkerIt && nr++ < count) { if (!cacheValueSet->contains(*cacheValueLinkerIt->getCacheValue())) { return false; } cacheValueLinkerIt = cacheValueLinkerIt->getNext(); } return true; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedConceptLinker.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedConceptLinker.c0000644000175000017500000000330012520551036032145 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeAssociatedConceptLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationNodeAssociatedConceptLinker::CSaturationNodeAssociatedConceptLinker() : CLinkerBase(CCacheValue(),nullptr) { } CSaturationNodeAssociatedConceptLinker* CSaturationNodeAssociatedConceptLinker::initConceptLinker(const CCacheValue& cacheValue) { setData(cacheValue); return this; } CSaturationNodeAssociatedConceptLinker* CSaturationNodeAssociatedConceptLinker::setCacheValue(const CCacheValue& cacheValue) { setData(cacheValue); return this; } CCacheValue* CSaturationNodeAssociatedConceptLinker::getCacheValue() { return &getData(); } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheValue.cpp0000644000175000017500000000466412520551026025102 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCacheValue.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CCacheValue::CCacheValue() : CTrible(0,0,0) { } CCacheValue::CCacheValue(const qint64 &first, const qint64 &second, const qint64 &third) : CTrible(first,second,third) { } CCacheValue::CCacheValue(const qint64 &tag, const qint64 &identification, const CACHEVALUEIDENTIFIER &cacheValueIdentifier) : CTrible(tag,identification,(qint64)cacheValueIdentifier) { } bool CCacheValue::isCachedConcept() { return (CACHEVALUEIDENTIFIER)this->second == CACHEVALCONCEPTONTOLOGYTAG; } bool CCacheValue::isCachedRole() { return (CACHEVALUEIDENTIFIER)this->second == CACHEVALROLEONTOLOGYTAG; } bool CCacheValue::isCachedTerminator() { return (CACHEVALUEIDENTIFIER)this->second == CACHEVALUETERMINATOR; } bool CCacheValue::isCachedNothing() { return (CACHEVALUEIDENTIFIER)this->second == CACHEVALUENOTHING; } qint64 CCacheValue::getTag() const { return this->first.first; } qint64 CCacheValue::getIdentification() const { return this->first.second; } CCacheValue::CACHEVALUEIDENTIFIER CCacheValue::getCacheValueIdentifier() const { return (CACHEVALUEIDENTIFIER)this->second; } CCacheValue* CCacheValue::initCacheValue(const qint64 &tag, const qint64 &identification, const CACHEVALUEIDENTIFIER &cacheValueIdentifier) { set(tag,identification,(cint64)cacheValueIdentifier); return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendCache.h0000644000175000017500000000344012520551020025003 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDCACHE_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDCACHE_H // Libraries includes // Namespace includes #include "CCache.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendCache * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendCache : public CCache { // public methods public: //! Constructor CBackendCache(); //! Destructor virtual ~CBackendCache(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDCACHE_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheContext.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheContext0000644000175000017500000000467312520551022032247 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryCacheContext.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryCacheContext::CBackendRepresentativeMemoryCacheContext() { mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); mMemMan = new CLimitedReserveMemoryPoolAllocationManager(mMemoryPoolProvider); mAddRelMemory = 0; } CBackendRepresentativeMemoryCacheContext::~CBackendRepresentativeMemoryCacheContext() { delete mMemMan; delete mMemoryPoolProvider; } CMemoryPoolAllocationManager* CBackendRepresentativeMemoryCacheContext::getMemoryPoolAllocationManager() { return mMemMan; } CMemoryAllocationManager* CBackendRepresentativeMemoryCacheContext::getMemoryAllocationManager() { return mMemMan; } CMemoryPoolProvider* CBackendRepresentativeMemoryCacheContext::getMemoryPoolProvider() { return mMemoryPoolProvider; } cint64 CBackendRepresentativeMemoryCacheContext::getMemoryConsumption() { return mAddRelMemory + mMemoryPoolProvider->getAllocatedReleaseDifferencePoolSize(); } CBackendRepresentativeMemoryCacheContext* CBackendRepresentativeMemoryCacheContext::releaseTemporaryMemoryPools(CMemoryPool* memoryPools) { CMemoryPool* memoryPoolIt = memoryPools; while (memoryPoolIt) { mAddRelMemory += memoryPoolIt->getMemoryBlockSize(); memoryPoolIt = memoryPoolIt->getNext(); } mMemMan->releaseTemporaryMemoryPools(memoryPools); return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheValue.h0000644000175000017500000000523412520551026024541 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCACHEVALUE_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCACHEVALUE_H // Libraries includes #include // Namespace includes // Other includes #include "Utilities/CTrible.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CCacheValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCacheValue : public CTrible { // public methods public: enum CACHEVALUEIDENTIFIER { CACHEVALCONCEPTONTOLOGYTAG, CACHEVALNEGATEDCONCEPTONTOLOGYTAG, CACHEVALROLEONTOLOGYTAG, CACHEVALUETERMINATOR, CACHEVALUENOTHING, CACHEVALTAGANDCONCEPT, CACHEVALTAGANDNEGATEDCONCEPT, CACHEVALTAGANDROLE}; //! Constructor CCacheValue(); CCacheValue(const qint64 &first, const qint64 &second, const qint64 &third); CCacheValue(const qint64 &tag, const qint64 &identification, const CACHEVALUEIDENTIFIER &cacheValueIdentifier = CACHEVALCONCEPTONTOLOGYTAG); CCacheValue* initCacheValue(const qint64 &tag, const qint64 &identification, const CACHEVALUEIDENTIFIER &cacheValueIdentifier = CACHEVALCONCEPTONTOLOGYTAG); bool isCachedConcept(); bool isCachedRole(); bool isCachedTerminator(); bool isCachedNothing(); qint64 getTag() const; qint64 getIdentification() const; CACHEVALUEIDENTIFIER getCacheValueIdentifier() const; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCACHEVALUE_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheSlotItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheSlotIt0000644000175000017500000000655312520551042032200 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHESLOTITEM_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHESLOTITEM_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CSignatureSatisfiableExpanderCacheRedirectionItem.h" #include "CSignatureSatisfiableExpanderCacheHasher.h" #include "CSignatureSatisfiableExpanderCacheEntry.h" // Other includes #include "Utilities/Memory/CMemoryPoolContainer.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSignatureSatisfiableExpanderCacheSlotItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureSatisfiableExpanderCacheSlotItem : public CMemoryPoolContainer, public CLinkerBase { // public methods public: //! Constructor CSignatureSatisfiableExpanderCacheSlotItem(CMemoryPool* memoryPool = nullptr); bool incReader(); bool incReader(cint64 incCount); bool decReader(); CSignatureSatisfiableExpanderCacheSlotItem* setSignatureItemHash(CCACHINGHASH* sigItemHash); CSignatureSatisfiableExpanderCacheSlotItem* setHasherItemHash(CCACHINGHASH* hasherItemHash); bool hasCacheReaders(); CCACHINGHASH* getSignatureItemHash(); CCACHINGHASH* getHasherItemHash(); // protected methods protected: // protected variables protected: CCACHINGHASH* mSigItemHash; CCACHINGHASH* mHasherItemHash; QAtomicInt mReaderSharingCount; bool mReaderUsing; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHESLOTITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheEntryWriteData.cpp0000644000175000017500000000241612520551026026725 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCacheEntryWriteData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CCacheEntryWriteData::CCacheEntryWriteData() : CLinkerBase(this) { } CCacheEntryWriteData::CACHEWRITEDATATYPE CCacheEntryWriteData::getCacheWriteDataType() { return mType; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheTaggingPool.cpp0000644000175000017500000000433012520551026026226 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCacheTaggingPool.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CCacheTaggingPool::CCacheTaggingPool(cint64 poolSize) { mTagPool = nullptr; mPoolIndex = 0; mPoolSize = poolSize; mPoolSizeMask = mPoolSize-1; mNextPoolStartTag = 0; qsrand(QTime::currentTime().msec()); } CCacheTaggingPool::~CCacheTaggingPool() { delete mTagPool; } cint64 CCacheTaggingPool::takeNextTag() { cint64 nextTag = 0; if (!hasMoreTags()) { createNextTaggingPool(); } nextTag = mTagPool[mPoolIndex++]; return nextTag; } bool CCacheTaggingPool::hasMoreTags() { return mTagPool && mPoolIndex < mPoolSize; } CCacheTaggingPool* CCacheTaggingPool::createNextTaggingPool() { if (!mTagPool) { mTagPool = new cint64[mPoolSize]; } for (cint64 i = 0; i < mPoolSize; ++i) { mTagPool[i] = i+mNextPoolStartTag; } mNextPoolStartTag += mPoolSize; // build random permutation using Fisher-Yates algorithm for (cint64 i = mPoolSize-1; i > 0; --i) { cint64 randomIndex = qrand() % (i+1); cint64 tmpVal = mTagPool[randomIndex]; mTagPool[randomIndex] = mTagPool[i]; mTagPool[i] = tmpVal; } mPoolIndex = 0; return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheValueHasher.cpp0000644000175000017500000000263012520551026026224 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCacheValueHasher.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CCacheValueHasher::CCacheValueHasher(CCacheValue* cacheValue) { mCacheValue = cacheValue; } cint64 CCacheValueHasher::getHashValue() const { return qHash(*mCacheValue); } bool CCacheValueHasher::operator==(const CCacheValueHasher& hasher) const { if (*mCacheValue != *hasher.mCacheValue) { return false; } return true; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheEntriesHash.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheEntriesHash0000644000175000017500000000463012520551032032173 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEENTRIESHASH_H #define KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEENTRIESHASH_H // Libraries includes #include #include #include #include #include // Namespace includes #include "CacheSettings.h" #include "COccurrenceUnsatisfiableCacheEntry.h" #include "CCacheValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class COccurrenceUnsatisfiableCacheEntriesHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COccurrenceUnsatisfiableCacheEntriesHash : public QHash { // public methods public: //! Constructor COccurrenceUnsatisfiableCacheEntriesHash(); COccurrenceUnsatisfiableCacheEntriesHash(const COccurrenceUnsatisfiableCacheEntriesHash ©Hash); //! Destructor virtual ~COccurrenceUnsatisfiableCacheEntriesHash(); qint64 incReferenceCount(); bool decReferenceCountReturnHasToBeDeleted(); // protected methods protected: // protected variables protected: qint64 referenceCount; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEENTRIESHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheReader.cpp0000644000175000017500000000347212520551030031274 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CComputedConsequencesCacheReader.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CComputedConsequencesCacheReader::CComputedConsequencesCacheReader() : CLinkerBase(this) { } CComputedConsequencesTypesCacheEntry* CComputedConsequencesCacheReader::getTypesCacheEntry(CIndividual* individual) { CIndividualProcessData* indProData = (CIndividualProcessData*)individual->getIndividualData(); CComputedConsequencesCachingData* compConsCachingData = nullptr; if (indProData) { compConsCachingData = indProData->getComputedConsequencesCachingData(); } CComputedConsequencesTypesCacheEntry* cacheEntry = nullptr; if (compConsCachingData) { cacheEntry = (CComputedConsequencesTypesCacheEntry*)compConsCachingData; } return cacheEntry; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CIncrementalUnsatisfiableCacheReader.cpp0000644000175000017500000000317012520551032032110 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIncrementalUnsatisfiableCacheReader.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CIncrementalUnsatisfiableCacheReader::CIncrementalUnsatisfiableCacheReader() { } CIncrementalUnsatisfiableCacheReader::~CIncrementalUnsatisfiableCacheReader() { } bool CIncrementalUnsatisfiableCacheReader::isUnsatisfiable(QVector &itemVec, qint64 count) { incrementUnsatisfiableTestReset(); bool continueTesting = true; for (qint64 i = 0; i < count && continueTesting; ++i) { bool unsat = incrementUnsatisfiableTest(&itemVec[i],&continueTesting); if (unsat) { return true; } } return false; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheWriteData.cpp0000644000175000017500000000246112520551030031753 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CComputedConsequencesCacheWriteData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CComputedConsequencesCacheWriteData::CComputedConsequencesCacheWriteData() { } CComputedConsequencesCacheWriteData::COMPUTEDCONSEQUENCESCACHEWRITEDATATYPE CComputedConsequencesCacheWriteData::getWriteDataType() { return mWriteDataType; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheUpdateSlotItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheUpdateSlotI0000644000175000017500000000572512520551032032161 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COccurrenceUnsatisfiableCacheUpdateSlotItem.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { COccurrenceUnsatisfiableCacheUpdateSlotItem::COccurrenceUnsatisfiableCacheUpdateSlotItem(qint64 updateSlotIndex) { slotIndex = updateSlotIndex; mReaderUsing = false; } COccurrenceUnsatisfiableCacheUpdateSlotItem::~COccurrenceUnsatisfiableCacheUpdateSlotItem() { cleanSlotUpdateItems(); } bool COccurrenceUnsatisfiableCacheUpdateSlotItem::incReader() { if (mReaderSharingCount.ref()) { mReaderUsing = true; } return true; } bool COccurrenceUnsatisfiableCacheUpdateSlotItem::incReader(cint64 incCount) { for (cint64 i = 0; i < incCount; ++i) { incReader(); } return mReaderUsing; } bool COccurrenceUnsatisfiableCacheUpdateSlotItem::decReader() { if (!mReaderSharingCount.deref()) { mReaderUsing = false; } return mReaderUsing; } void COccurrenceUnsatisfiableCacheUpdateSlotItem::addCacheEntry(COccurrenceUnsatisfiableCacheEntry *cacheEntry) { updatedEntrySet.insert(cacheEntry); } void COccurrenceUnsatisfiableCacheUpdateSlotItem::addCacheEntriesHash(COccurrenceUnsatisfiableCacheEntriesHash *prevDelHash) { updatedHashesList.append(prevDelHash); } void COccurrenceUnsatisfiableCacheUpdateSlotItem::activateSlotUpdateItems() { foreach (COccurrenceUnsatisfiableCacheEntry *entry, updatedEntrySet) { entry->setActiveSlot(slotIndex); } } void COccurrenceUnsatisfiableCacheUpdateSlotItem::cleanSlotUpdateItems() { foreach (COccurrenceUnsatisfiableCacheEntriesHash *hash, updatedHashesList) { if (hash->decReferenceCountReturnHasToBeDeleted()) { delete hash; } } updatedHashesList.clear(); updatedEntrySet.clear(); } qint64 COccurrenceUnsatisfiableCacheUpdateSlotItem::getSlotIndex() { return slotIndex; } bool COccurrenceUnsatisfiableCacheUpdateSlotItem::hasCacheReaders() { return mReaderUsing; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelValueLinker.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelValueLi0000644000175000017500000000323112520551024032167 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryLabelValueLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryLabelValueLinker::CBackendRepresentativeMemoryLabelValueLinker() { } CCacheValue& CBackendRepresentativeMemoryLabelValueLinker::getCacheValue() { return getData(); } CBackendRepresentativeMemoryLabelValueLinker* CBackendRepresentativeMemoryLabelValueLinker::initLabelValueLinker(const CCacheValue& cacheValue) { setData(cacheValue); return this; } CBackendRepresentativeMemoryLabelValueLinker* CBackendRepresentativeMemoryLabelValueLinker::setCacheValue(const CCacheValue& cacheValue) { setData(cacheValue); return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTempora0000644000175000017500000000777112520551024032236 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker::CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker() { } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker::initLabelWriteData(cint64 signature) { mDetValueCount = 0; mSignature = signature; mDetValueLinker = nullptr; mCompletelyHandled = false; mCompletelySaturated = false; mTmpData = nullptr; return this; } cint64 CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker::getSignature() { return mSignature; } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker::setSignature(cint64 signature) { mSignature = signature; return this; } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker::appendDeterministicCacheValueLinker(CBackendRepresentativeMemoryLabelValueLinker* linker) { CBackendRepresentativeMemoryLabelValueLinker* linkerIt = linker; while (linkerIt) { ++mDetValueCount; linkerIt = linkerIt->getNext(); } mDetValueLinker = linker->append(mDetValueLinker); return this; } CBackendRepresentativeMemoryLabelValueLinker* CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker::getDeterministicCacheValueLinker() { return mDetValueLinker; } cint64 CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker::getDeterministicCacheValueCount() { return mDetValueCount; } bool CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker::isCompletelyHandled() { return mCompletelyHandled; } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker::setCompletelyHandled(bool completelyHandled) { mCompletelyHandled = completelyHandled; return this; } bool CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker::isCompletelySaturated() { return mCompletelySaturated; } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker::setCompletelySaturated(bool completelySaturated) { mCompletelySaturated = completelySaturated; return this; } void* CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker::getTemporaryData() { return mTmpData; } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker::setTemporaryData(void* tmpData) { mTmpData = tmpData; return this; } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker::clearTemporaryData() { mTmpData = nullptr; return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheWriter.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheWriter.0000644000175000017500000000434112520551024032147 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEWRITER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEWRITER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "CBackendRepresentativeMemoryCache.h" #include "CBackendRepresentativeMemoryCacheWriteData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemoryCacheWriter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryCacheWriter { // public methods public: //! Constructor CBackendRepresentativeMemoryCacheWriter(CBackendRepresentativeMemoryCache* cache); CBackendRepresentativeMemoryCacheWriter* writeCachedData(CBackendRepresentativeMemoryCacheWriteData* writeData, CMemoryPool* memoryPools); // protected methods protected: // protected variables protected: CBackendRepresentativeMemoryCache* mCache; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEWRITER_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryExpandWriteData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryExpandWri0000644000175000017500000000407512520551034032203 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReuseCompletionGraphCacheEntryExpandWriteData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CReuseCompletionGraphCacheEntryExpandWriteData::CReuseCompletionGraphCacheEntryExpandWriteData() { } CReuseCompletionGraphCacheEntryExpandWriteData* CReuseCompletionGraphCacheEntryExpandWriteData::initExpandWriteData(CCACHINGLIST* cacheValueList, CCACHINGLIST* minimalCacheValueList, CSatisfiableCalculationJobInstantiation* jobInstantiation) { mJobInstantiation = jobInstantiation; mCacheValueList = cacheValueList; mMinimalValueList = minimalCacheValueList; mType = REUSECOMPLETIONGRAPHWRITEEXPANDDATATYPE; return this; } CCACHINGLIST* CReuseCompletionGraphCacheEntryExpandWriteData::getCacheValueList() { return mCacheValueList; } CCACHINGLIST* CReuseCompletionGraphCacheEntryExpandWriteData::getMinimalCacheValueList() { return mMinimalValueList; } CSatisfiableCalculationJobInstantiation* CReuseCompletionGraphCacheEntryExpandWriteData::getJobInstantiation() { return mJobInstantiation; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSatisfiableCacheReader.h0000644000175000017500000000412612520551034027034 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATISFIABLECACHEREADER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATISFIABLECACHEREADER_H // Libraries includes #include #include // Namespace includes #include "CCacheValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSatisfiableCacheReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCacheReader { // public methods public: //! Constructor CSatisfiableCacheReader(); //! Destructor virtual ~CSatisfiableCacheReader(); virtual bool isSatisfiable(QVector &itemVec, qint64 count) = 0; virtual bool getSatisfiableOutcome(QVector &itemVec, qint64 itemCount, QList *outcomeList = 0) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATISFIABLECACHEREADER_H ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedDeterministicConceptExpansion.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedDeterministicCo0000644000175000017500000000403512520551036032257 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeAssociatedDeterministicConceptExpansion.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationNodeAssociatedDeterministicConceptExpansion::CSaturationNodeAssociatedDeterministicConceptExpansion(CSaturationNodeAssociatedExpansionCacheContext* context) : CSaturationNodeAssociatedConceptExpansion(context) { } CSaturationNodeAssociatedDeterministicConceptExpansion* CSaturationNodeAssociatedDeterministicConceptExpansion::initDeterministicConceptExpansion() { CSaturationNodeAssociatedConceptExpansion::initConceptExpansion(); mRequiresNonDeterministicExpansion = false; return this; } bool CSaturationNodeAssociatedDeterministicConceptExpansion::requiresNonDeterministicExpansion() { return mRequiresNonDeterministicExpansion; } CSaturationNodeAssociatedDeterministicConceptExpansion* CSaturationNodeAssociatedDeterministicConceptExpansion::setNonDeterministicExpansionRequired(bool nondeterministicExpansionRequired) { mRequiresNonDeterministicExpansion = nondeterministicExpansionRequired; return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCache.h0000644000175000017500000000322712520551026023544 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCACHE_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCACHE_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CCache * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCache { // public methods public: //! Constructor CCache(); //! Destructor virtual ~CCache(); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCACHE_H ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelSignatureResolveCacheItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelSignatu0000644000175000017500000000525512520551024032250 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYSIGNATURERESOLVECACHEITEM_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYSIGNATURERESOLVECACHEITEM_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "CBackendRepresentativeMemoryLabelCacheItem.h" #include "CBackendRepresentativeMemoryCacheContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemorySignatureResolveCacheItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryLabelSignatureResolveCacheItem { // public methods public: //! Constructor CBackendRepresentativeMemoryLabelSignatureResolveCacheItem(CBackendRepresentativeMemoryCacheContext* context); CBackendRepresentativeMemoryLabelSignatureResolveCacheItem* appendLabelItem(CBackendRepresentativeMemoryLabelCacheItem* linker); CBackendRepresentativeMemoryLabelCacheItem* getLabelItems(); cint64 getLabelItemCount(); cint64 getSignature(); CBackendRepresentativeMemoryLabelSignatureResolveCacheItem* setSignature(cint64 signature); // protected methods protected: // protected variables protected: CBackendRepresentativeMemoryCacheContext* mContext; CBackendRepresentativeMemoryLabelCacheItem* mLabelItemLinker; cint64 mLabelItemCount; cint64 mSignature; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYSIGNATURERESOLVECACHEITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CUnsatisfiableCacheWriter.cpp0000644000175000017500000000225412520551042030003 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CUnsatisfiableCacheWriter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CUnsatisfiableCacheWriter::CUnsatisfiableCacheWriter() { } CUnsatisfiableCacheWriter::~CUnsatisfiableCacheWriter() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheEntry.cpp0000644000175000017500000000226612520551030031173 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CComputedConsequencesCacheEntry.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CComputedConsequencesCacheEntry::CComputedConsequencesCacheEntry(CComputedConsequencesCacheContext* context) : mContext(context) { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCache.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCache.0000644000175000017500000001237312520551036032144 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHE_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHE_H // Libraries includes #include #include #include // Namespace includes #include "CacheSettings.h" #include "CSaturationCache.h" #include "CSaturationNodeAssociatedExpansionCacheEntry.h" #include "CSaturationNodeAssociatedExpansionCacheContext.h" #include "CSaturationNodeAssociatedExpansionCacheReader.h" #include "CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData.h" #include "CSaturationNodeAssociatedExpansionCacheExpansionWriteData.h" #include "CSaturationNodeCacheUpdater.h" #include "CCacheStatistics.h" // Other includes #include "Concurrent/CThread.h" #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" #include "Reasoner/Kernel/Cache/Events/CWriteSaturationCacheDataEvent.h" #include "Utilities/Memory/CObjectMemoryPoolAllocator.h" #include "Utilities/Memory/CObjectParameterizingAllocator.h" #include "Utilities/Memory/CMemoryPoolContainerAllocationManager.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" //#define KONCLUCE_SATISFIBALE_EXPANDER_CACHE_DIRECT_WRITING namespace Konclude { using namespace Config; using namespace Concurrent; using namespace Context; using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { using namespace Events; /*! * * \class CSaturationNodeAssociatedExpansionCache * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeAssociatedExpansionCache : public CThread, public CSaturationCache { // public methods public: //! Constructor CSaturationNodeAssociatedExpansionCache(CConfiguration* config = nullptr, QString threadIdentifierName = "Saturation-Node-Associated-Expansion-Cache", CWatchDog *watchDogThread = 0); //! Destructor virtual ~CSaturationNodeAssociatedExpansionCache(); CSaturationNodeAssociatedExpansionCacheReader* createCacheReader(); CSaturationNodeAssociatedExpansionCacheWriter* createCacheWriter(); CSaturationNodeAssociatedExpansionCache* writeCacheData(CSaturationNodeAssociatedExpansionCacheWriteData* writeData, CMemoryPool* memoryPools); CCacheStatistics* getCacheStatistics(); // protected methods protected: CSaturationNodeAssociatedExpansionCache* installWriteCacheData(CSaturationNodeAssociatedExpansionCacheWriteData* writeData, CSaturationNodeAssociatedExpansionCacheContext* context); CSaturationNodeAssociatedExpansionCache* propagateUnsatisfibility(CIndividualSaturationProcessNode* node, CSaturationNodeAssociatedExpansionCacheContext* context); CSaturationNodeAssociatedExpansionCache* addNodeExpansionData(CSaturationNodeAssociatedExpansionCacheExpansionWriteData* snaecewd, CSaturationNodeAssociatedExpansionCacheContext* context); CSaturationNodeAssociatedExpansionCacheEntry* getCacheEntryForNode(CIndividualSaturationProcessNode* node, CSaturationNodeAssociatedExpansionCacheContext* context, bool create = true); CSaturationNodeAssociatedExpansionCache* fillExpansionData(CSaturationNodeAssociatedConceptExpansion* conceptExpansion, CSaturationNodeAssociatedExpansionCacheExpansionWriteData* snaecewd, CSaturationNodeAssociatedExpansionCacheContext* context); CSaturationNodeAssociatedDeterministicConceptExpansion* extendDeterministicExpansionData(CSaturationNodeAssociatedConceptExpansion* conceptExpansion, CSaturationNodeAssociatedExpansionCacheExpansionWriteData* snaecewd, CSaturationNodeAssociatedExpansionCacheContext* context); virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); // protected variables protected: CSaturationNodeAssociatedExpansionCacheEntry* mEntryLinker; CSaturationNodeCacheUpdater* mSaturationNodeCacheUpdate; cint64 mConfAllowedNonDetExpansionCount; CSaturationNodeAssociatedExpansionCacheReader* mReaderLinker; QMutex mReaderSyncMutex; CCacheStatistics mCacheStat; CSaturationNodeAssociatedExpansionCacheContext mContext; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheWriter.h0000644000175000017500000000473312520551032031464 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEWRITER_H #define KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEWRITER_H // Libraries includes #include // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "COccurrenceUnsatisfiableCache.h" #include "COccurrenceUnsatisfiableCacheEntry.h" #include "CUnsatisfiableCacheWriter.h" // Other includes #include "Utilities/CMemoryManager.hpp" #include "Utilities/CDblLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class COccurrenceUnsatisfiableCacheWriter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COccurrenceUnsatisfiableCacheWriter : public CUnsatisfiableCacheWriter { // public methods public: //! Constructor COccurrenceUnsatisfiableCacheWriter(COccurrenceUnsatisfiableCache *unsatisfiableCache); //! Destructor virtual ~COccurrenceUnsatisfiableCacheWriter(); void setUnsatisfiable(QList &itemList); virtual void setUnsatisfiable(QVector &itemVec, qint64 count, QVector &clashVec, qint64 clashCount); // protected methods protected: // private methods private: // private variables private: COccurrenceUnsatisfiableCache *cache; }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHEWRITER_H ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedNondeterministicConceptExpansion.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedNondeterministi0000644000175000017500000000331112520551040032334 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeAssociatedNondeterministicConceptExpansion.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationNodeAssociatedNondeterministicConceptExpansion::CSaturationNodeAssociatedNondeterministicConceptExpansion(CSaturationNodeAssociatedExpansionCacheContext* context) : CSaturationNodeAssociatedConceptExpansion(context),CLinkerBase(this,nullptr) { } CSaturationNodeAssociatedNondeterministicConceptExpansion* CSaturationNodeAssociatedNondeterministicConceptExpansion::initNondeterministicConceptExpansion() { CSaturationNodeAssociatedConceptExpansion::initConceptExpansion(); return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheReader.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheReader0000644000175000017500000001004612520551042032154 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureSatisfiableExpanderCacheReader.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSignatureSatisfiableExpanderCacheReader::CSignatureSatisfiableExpanderCacheReader() : CLinkerBase(this) { mCurrentSlot = nullptr; } CSignatureSatisfiableExpanderCacheReader* CSignatureSatisfiableExpanderCacheReader::updateSlot(CSignatureSatisfiableExpanderCacheSlotItem* updatedSlot) { CSignatureSatisfiableExpanderCacheSlotItem* prevSlot = mUpdatedSlot.fetchAndStoreOrdered(updatedSlot); if (prevSlot != nullptr) { prevSlot->decReader(); } return this; } bool CSignatureSatisfiableExpanderCacheReader::hasUpdatedSlotItem() { return mUpdatedSlot.fetchAndAddRelaxed(0) != nullptr; } bool CSignatureSatisfiableExpanderCacheReader::switchToUpdatedSlotItem() { CSignatureSatisfiableExpanderCacheSlotItem* updatedSlot = mUpdatedSlot.fetchAndStoreOrdered(nullptr); if (updatedSlot) { CSignatureSatisfiableExpanderCacheSlotItem* prevSlot = mCurrentSlot; mCurrentSlot = updatedSlot; if (prevSlot != nullptr) { prevSlot->decReader(); } return true; } return false; } bool CSignatureSatisfiableExpanderCacheReader::hasCacheEntry(cint64 signature) { if (hasUpdatedSlotItem()) { switchToUpdatedSlotItem(); } if (mCurrentSlot) { CCACHINGHASH* sigItemHash = mCurrentSlot->getSignatureItemHash(); if (sigItemHash) { return sigItemHash->contains(signature); } } return false; } CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheReader::getCacheEntry(cint64 signature) { CSignatureSatisfiableExpanderCacheEntry* entry = nullptr; if (hasUpdatedSlotItem()) { switchToUpdatedSlotItem(); } if (mCurrentSlot) { CCACHINGHASH* sigItemHash = mCurrentSlot->getSignatureItemHash(); if (sigItemHash) { CSignatureSatisfiableExpanderCacheRedirectionItem* item = sigItemHash->value(signature,nullptr); if (item) { entry = item->getCacheEntry(); } } } return entry; } CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheReader::getCacheEntry(CCACHINGSET* cacheValueSet) { CSignatureSatisfiableExpanderCacheEntry* entry = nullptr; if (hasUpdatedSlotItem()) { switchToUpdatedSlotItem(); } if (mCurrentSlot) { CCACHINGHASH* hasherItemHash = mCurrentSlot->getHasherItemHash(); if (hasherItemHash) { CSignatureSatisfiableExpanderCacheHasher hashValue(cacheValueSet); CSignatureSatisfiableExpanderCacheRedirectionItem* item = hasherItemHash->value(hashValue,nullptr); if (item) { entry = item->getCacheEntry(); } } } return entry; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCache.h0000644000175000017500000000775112520551032027567 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHE_H #define KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHE_H // Libraries includes #include #include #include // Namespace includes #include "CacheSettings.h" #include "CCompletionGraphCache.h" #include "CReuseCompletionGraphCacheReader.h" #include "CReuseCompletionGraphCacheWriter.h" #include "CReuseCompletionGraphCacheContext.h" #include "CReuseCompletionGraphCacheSlotItem.h" #include "CReuseCompletionGraphCacheEntryWriteData.h" #include "CReuseCompletionGraphCacheEntryExpandWriteData.h" // Other includes #include "Concurrent/CThread.h" #include "Reasoner/Kernel/Cache/Events/CWriteCachedDataEvent.h" #include "Reasoner/Kernel/Cache/Events/CWriteExpandCachedEvent.h" #include "Reasoner/Kernel/Cache/Events/CWriteSatisfiableBranchCachedEvent.h" #include "Utilities/Memory/CObjectMemoryPoolAllocator.h" #include "Utilities/Memory/CObjectParameterizingAllocator.h" #include "Utilities/Memory/CMemoryPoolContainerAllocationManager.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; using namespace Context; using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { using namespace Events; /*! * * \class CReuseCompletionGraphCache * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReuseCompletionGraphCache : public CThread, public CCompletionGraphCache { // public methods public: //! Constructor CReuseCompletionGraphCache(QString threadIdentifierName = "Reuse-Completion-Graph-Cache", CWatchDog *watchDogThread = 0); //! Destructor virtual ~CReuseCompletionGraphCache(); CReuseCompletionGraphCacheReader* createCacheReader(); CReuseCompletionGraphCacheWriter* createCacheWriter(); CReuseCompletionGraphCache* writeExpandCache(CReuseCompletionGraphCacheEntryWriteData* writeData, CMemoryPool* memoryPools); // protected methods protected: void createReaderSlotUpdate(CReuseCompletionGraphCacheContext* context); void cleanUnusedSlots(CReuseCompletionGraphCacheContext* context); virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); void writeExpandCacheData(CReuseCompletionGraphCacheContext* context, CCACHINGLIST* cacheList, CCACHINGLIST* minimalCacheList, CSatisfiableCalculationJobInstantiation* jobInst); // protected variables protected: CReuseCompletionGraphCacheSlotItem* mSlotLinker; CReuseCompletionGraphCacheReader* mReaderLinker; QMutex mReaderSyncMutex; CReuseCompletionGraphCompatibilityEntryHash* mEntyHash; CCACHINGLIST* mEntyList; cint64 mEntryCount; CReuseCompletionGraphCacheContext mContext; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntry.cpp0000644000175000017500000000704512520551032031140 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReuseCompletionGraphCacheEntry.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CReuseCompletionGraphCacheEntry::CReuseCompletionGraphCacheEntry(CReuseCompletionGraphCacheContext* context) : mContext(context),mIncompatibleValues(context),mEntailedValues(context) { mJobInstance = nullptr; mEntryID = 0; } CCACHINGSET* CReuseCompletionGraphCacheEntry::getIncompatibleValues() { return &mIncompatibleValues; } CCACHINGSET* CReuseCompletionGraphCacheEntry::getEntailedValues() { return &mEntailedValues; } CCACHINGSET* CReuseCompletionGraphCacheEntry::getMinimalValues() { return &mMinimalValues; } CSatisfiableCalculationJobInstantiation* CReuseCompletionGraphCacheEntry::getJobInstantiation() { return mJobInstance; } CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::setJobInstantiation(CSatisfiableCalculationJobInstantiation* jobInstantiation) { mJobInstance = jobInstantiation; return this; } CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::setEntailedValues(CCACHINGSET* valueSet) { if (valueSet) { mEntailedValues += *valueSet; } return this; } CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::addEntailedValue(const CCacheValue& cacheValue) { mEntailedValues.insert(cacheValue); return this; } CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::setIncompatibleValues(CCACHINGSET* valueSet) { if (valueSet) { mIncompatibleValues += *valueSet; } return this; } CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::addIncompatibleValue(const CCacheValue& cacheValue) { mIncompatibleValues.insert(cacheValue); return this; } CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::setMinimalValues(CCACHINGSET* valueSet) { if (valueSet) { mMinimalValues += *valueSet; } return this; } CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::addMinimalValue(const CCacheValue& cacheValue) { mMinimalValues.insert(cacheValue); return this; } bool CReuseCompletionGraphCacheEntry::hasMinimalValue(const CCacheValue& cacheValue) { return mMinimalValues.contains(cacheValue); } CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheEntry::setEntryID(cint64 id) { mEntryID = id; return this; } cint64 CReuseCompletionGraphCacheEntry::getEntryID() { return mEntryID; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheSlotItem.h0000644000175000017500000000540012520551034031237 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHESLOTITEM_H #define KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHESLOTITEM_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CReuseCompletionGraphCompatibilityEntryHash.h" // Other includes #include "Utilities/Memory/CMemoryPoolContainer.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CReuseCompletionGraphCacheSlotItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReuseCompletionGraphCacheSlotItem : public CMemoryPoolContainer, public CLinkerBase { // public methods public: //! Constructor CReuseCompletionGraphCacheSlotItem(CMemoryPool* memoryPool = nullptr); bool incReader(); bool incReader(cint64 incCount); bool decReader(); bool hasCacheReaders(); CReuseCompletionGraphCacheSlotItem* setEntryHash(CReuseCompletionGraphCompatibilityEntryHash* hash); CReuseCompletionGraphCompatibilityEntryHash* getEntryHash(); cint64 getEntryCount(); CReuseCompletionGraphCacheSlotItem* setEntryCount(cint64 entryCount); // protected methods protected: // protected variables protected: CReuseCompletionGraphCompatibilityEntryHash* mEntryHash; QAtomicInt mReaderSharingCount; bool mReaderUsing; cint64 mEntyCount; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCACHESLOTITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedConceptLinker.h0000644000175000017500000000441012520551036032155 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDCONCEPTLINKER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDCONCEPTLINKER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSaturationNodeAssociatedConceptLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeAssociatedConceptLinker : public CLinkerBase { // public methods public: //! Constructor CSaturationNodeAssociatedConceptLinker(); CSaturationNodeAssociatedConceptLinker* initConceptLinker(const CCacheValue& cacheValue); CSaturationNodeAssociatedConceptLinker* setCacheValue(const CCacheValue& cacheValue); CCacheValue* getCacheValue(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDCONCEPTLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesTypesCacheEntry.cpp0000644000175000017500000000413112520551030032211 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CComputedConsequencesTypesCacheEntry.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CComputedConsequencesTypesCacheEntry::CComputedConsequencesTypesCacheEntry(CComputedConsequencesCacheContext* context) : CComputedConsequencesCacheEntry(context) { } CComputedConsequencesTypesCacheEntry* CComputedConsequencesTypesCacheEntry::initCacheEntry(CIndividual* individual) { mIndividual = individual; mConceptLinker = nullptr; return this; } bool CComputedConsequencesTypesCacheEntry::hasConcept(CConcept* concept, bool negation) { for (CSortedNegLinker* conIt = mConceptLinker; conIt; conIt = conIt->getNext()) { if (conIt->getData() == concept && conIt->isNegated() == negation) { return true; } } return false; } CSortedNegLinker* CComputedConsequencesTypesCacheEntry::getConceptLinker() { return mConceptLinker; } CComputedConsequencesTypesCacheEntry* CComputedConsequencesTypesCacheEntry::addConceptLinker(CSortedNegLinker* conceptLinker) { mConceptLinker = conceptLinker->append(mConceptLinker); return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheWriteTypesData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheWriteTypesData0000644000175000017500000000342512520551030032220 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CComputedConsequencesCacheWriteTypesData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CComputedConsequencesCacheWriteTypesData::CComputedConsequencesCacheWriteTypesData() { mWriteDataType = CCWT_TYPE; } CComputedConsequencesCacheWriteTypesData* CComputedConsequencesCacheWriteTypesData::initTypesCacheWriteData(CIndividual* individual, CConcept* concept, bool negation) { mIndividual = individual; mConceptNegation = negation; mConceptType = concept; return this; } CIndividual* CComputedConsequencesCacheWriteTypesData::getIndividual() { return mIndividual; } CConcept* CComputedConsequencesCacheWriteTypesData::getConcept() { return mConceptType; } bool CComputedConsequencesCacheWriteTypesData::getNegation() { return mConceptNegation; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000020100000000000011574 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheU0000644000175000017500000000340212520551040032177 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData::CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData() { mWriteDataType = SNAECWT_UNSAT; mUnsatisfiableNode = nullptr; } CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData* CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData::initUnsatisfiabilityWriteData(CIndividualSaturationProcessNode* unsatisfiableNode) { mUnsatisfiableNode = unsatisfiableNode; return this; } CIndividualSaturationProcessNode* CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData::getUnsatisfiableSaturationIndividualNode() { return mUnsatisfiableNode; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCompatibilityEntryHashData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCompatibilityEntryH0000644000175000017500000000533412520551034032276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCOMPATIBILITYENTRYHASHDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCOMPATIBILITYENTRYHASHDATA_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CReuseCompletionGraphCacheEntry.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CReuseCompletionGraphCompatibilityEntryHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReuseCompletionGraphCompatibilityEntryHashData { // public methods public: //! Constructor CReuseCompletionGraphCompatibilityEntryHashData(); CReuseCompletionGraphCompatibilityEntryHashData(const CReuseCompletionGraphCompatibilityEntryHashData& data); CXLinker* getEntailedEntryLinker() const; CReuseCompletionGraphCompatibilityEntryHashData* addEntailedEntyLinker(CXLinker* linker); CXLinker* getIncompatibleEntryLinker() const; CReuseCompletionGraphCompatibilityEntryHashData* addIncompatibleEntyLinker(CXLinker* linker); // protected methods protected: // protected variables protected: CXLinker* mEntailedEntryLinker; CXLinker* mIncompatibleEntryLinker; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CREUSECOMPLETIONGRAPHCOMPATIBILITYENTRYHASHDATA_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheReader.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheReader.0000644000175000017500000000741612520551022032101 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEREADER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEREADER_H // Libraries includes #include // Namespace includes #include "CacheSettings.h" #include "CBackendRepresentativeMemoryCacheSlotItem.h" #include "CBackendRepresentativeMemoryLabelSignatureResolveCacheItem.h" #include "CBackendRepresentativeMemoryCacheIndividualAssociationData.h" // Other includes #include "Utilities/Container/CLinker.h" #include "Reasoner/Kernel/Process/CConceptSaturationDescriptor.h" #include "Reasoner/Kernel/Process/CConceptDescriptor.h" #include "Reasoner/Ontology/CIndividualProcessData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { using namespace Process; namespace Cache { /*! * * \class CBackendRepresentativeMemoryCacheReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryCacheReader : public CLinkerBase { // public methods public: //! Constructor CBackendRepresentativeMemoryCacheReader(); CBackendRepresentativeMemoryCacheReader* updateSlot(CBackendRepresentativeMemoryCacheSlotItem* updatedSlot); bool hasCacheEntry(cint64 signature); CBackendRepresentativeMemoryLabelSignatureResolveCacheItem* getLabelCacheEntry(cint64 signature); CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem* getCardinalityCacheEntry(cint64 signature); CBackendRepresentativeMemoryLabelCacheItem* getLabelCacheEntry(cint64 signature, cint64 conCount, CConceptSaturationDescriptor* conDesLinker); CBackendRepresentativeMemoryLabelCacheItem* getLabelCacheEntry(cint64 signature, cint64 conCount, CConceptDescriptor* conDesLinker, CConcept* exceptionConcept); CBackendRepresentativeMemoryCacheIndividualAssociationData* getIndividualAssociation(CIndividual* individual); CBackendRepresentativeMemoryCardinalityCacheItem* getCardinalityCacheEntry(cint64 signature, CPROCESSHASH* roleFreeCardHash); const CCacheValue getCacheValue(CConcept* concept, bool negation); const CCacheValue getCacheValue(CRole* role); // protected methods protected: bool hasUpdatedSlotItem(); bool switchToUpdatedSlotItem(); // protected variables protected: CBackendRepresentativeMemoryCacheSlotItem* mCurrentSlot; QAtomicPointer mUpdatedSlot; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEREADER_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheEntry.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheE0000644000175000017500000000743612520551036032177 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEENTRY_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEENTRY_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheEntry.h" #include "CSaturationNodeAssociatedExpansionCacheContext.h" #include "CSaturationNodeAssociatedDeterministicConceptExpansion.h" #include "CSaturationNodeAssociatedNondeterministicConceptExpansion.h" // Other includes #include "Reasoner/Kernel/Process/ProcessSettings.h" #include "Reasoner/Kernel/Process/CIndividualSaturationProcessNodeCacheData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Process; namespace Cache { /*! * * \class CSaturationNodeAssociatedExpansionCacheEntry * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeAssociatedExpansionCacheEntry : public CIndividualSaturationProcessNodeCacheData, public CCacheEntry { // public methods public: //! Constructor CSaturationNodeAssociatedExpansionCacheEntry(CSaturationNodeAssociatedExpansionCacheContext* context); CSaturationNodeAssociatedExpansionCacheEntry* initCacheEntry(CIndividualSaturationProcessNode* saturationNode, cint64 remainingAllowedNonDetExpansionCount); CIndividualSaturationProcessNode* getSaturationIndividualNode(); CSaturationNodeAssociatedDeterministicConceptExpansion* getDeterministicConceptExpansion(); CSaturationNodeAssociatedNondeterministicConceptExpansion* getNondeterministicConceptExpansionLinker(); bool hasDeterministicConceptExpansion(); CSaturationNodeAssociatedExpansionCacheEntry* setDeterministicConceptExpansion(CSaturationNodeAssociatedDeterministicConceptExpansion* detConceptExpansion); CSaturationNodeAssociatedExpansionCacheEntry* addNondeterministicConceptExpansion(CSaturationNodeAssociatedNondeterministicConceptExpansion* nondetConceptExpansion); cint64 getRemainingAllowedNondeterministicExpansionCount(); bool areMoreNondeterministicExpansionAllowed(); CSaturationNodeAssociatedExpansionCacheEntry* decRemainingAllowedNondeterministicExpansionCount(cint64 decCount = 1); // protected methods protected: // protected variables protected: CSaturationNodeAssociatedExpansionCacheContext* mContext; CIndividualSaturationProcessNode* mSaturationNode; cint64 mRemainingAllowedNonDetExpansionCount; CSaturationNodeAssociatedDeterministicConceptExpansion* mDetExpansion; CSaturationNodeAssociatedNondeterministicConceptExpansion* mNondetExpansionLinker; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEENTRY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCache.cpp0000644000175000017500000006140512520551040031615 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureSatisfiableExpanderCache.h" #include "CSignatureSatisfiableExpanderCacheWriter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSignatureSatisfiableExpanderCache::CSignatureSatisfiableExpanderCache(CConfiguration* config, QString threadIdentifierName, CWatchDog *watchDogThread) : CThread(threadIdentifierName,watchDogThread) { mConfig = config; mWriteDataCount = 0; mNextWriteCollectCount = 0; mCollectCount = 0; mStartWriteCollectCount = 1000; mSlotLinker = nullptr; mReaderLinker = nullptr; mCollectMemoryPools = nullptr; mCollectWriteData = nullptr; CMemoryAllocationManager* memMan = mContext.getMemoryAllocationManager(); mSigItemHash = CObjectParameterizingAllocator< CCACHINGHASH,CContext* >::allocateAndConstructAndParameterize(memMan,&mContext); mIncompatibleSigSet = CObjectParameterizingAllocator< CCACHINGSET,CContext* >::allocateAndConstructAndParameterize(memMan,&mContext); mAlreadyExpSigSet = CObjectParameterizingAllocator< CCACHINGSET,CContext* >::allocateAndConstructAndParameterize(memMan,&mContext); mSignatureReferCountSet = CObjectParameterizingAllocator< CCACHINGHASH,CContext* >::allocateAndConstructAndParameterize(memMan,&mContext); mNextMemoryLevelRequiredSignatureRefCount = CConfigDataReader::readConfigInteger(config,"Konclude.Cache.SatisfiableExpander.InitialMemoryLevelForIncreaseRequiredSignatureReferenceCount",200*1024*1024); mNextMemoryLevelIncreaseForRequiredSignatureReferenceCount = CConfigDataReader::readConfigInteger(config,"Konclude.Cache.SatisfiableExpander.NextMemoryLevelIncreaseForIncreaseRequiredSignatureReferenceCount",100*1024*1024); mNextCacheEntryRequiredSignatureRefCount = CConfigDataReader::readConfigInteger(config,"Konclude.Cache.SatisfiableExpander.RequiredSignatureReferenceCountIncrease",1); mNextCacheEntryRequiredSignatureReferenceCountIncrease = CConfigDataReader::readConfigInteger(config,"Konclude.Cache.SatisfiableExpander.RequiredSignatureReferenceCountIncrease",1); startThread(QThread::HighestPriority); } CSignatureSatisfiableExpanderCache::~CSignatureSatisfiableExpanderCache() { } CCacheStatistics* CSignatureSatisfiableExpanderCache::getCacheStatistics() { return &mCacheStat; } bool CSignatureSatisfiableExpanderCache::writeExpanderCachingData(CSignatureSatisfiableExpanderCacheContext* context, cint64 prevSignature, cint64 newSignature, CCACHINGLIST* cacheValueList, CCACHINGHASH* depHash) { if (canCreateCacheEntryForSignature(newSignature,context)) { if (!mSigItemHash->contains(newSignature)) { CMemoryAllocationManager* memMan = context->getMemoryAllocationManager(); CSignatureSatisfiableExpanderCacheEntry* entry = nullptr; if (prevSignature != 0) { CSignatureSatisfiableExpanderCacheRedirectionItem* prevSigItem = mSigItemHash->value(prevSignature); if (prevSigItem) { entry = prevSigItem->getCacheEntry(); if (!isCachingDataExpandable(context,entry,prevSignature,cacheValueList)) { // not compatible, only identical signatures mIncompatibleSigSet->insert(prevSignature); return false; } if (mAlreadyExpSigSet->contains(prevSignature)) { entry->setMultipleExpanded(true); } } } if (!entry) { entry = CObjectParameterizingAllocator< CSignatureSatisfiableExpanderCacheEntry,CSignatureSatisfiableExpanderCacheContext* >::allocateAndConstructAndParameterize(memMan,context); } writeExpanderCachingData(context,entry,prevSignature != 0,cacheValueList,depHash); CSignatureSatisfiableExpanderCacheRedirectionItem* sigItem = CObjectAllocator< CSignatureSatisfiableExpanderCacheRedirectionItem >::allocateAndConstruct(memMan); sigItem->initRedirectionItem(entry,newSignature,entry->getExpanderCacheValueCount()); mSigItemHash->insert(newSignature,sigItem); mAlreadyExpSigSet->insert(prevSignature); //mHasherItemHash.insert(CSignatureSatisfiableExpanderCacheHasher(entry->getExpanderCacheValueLinker(),entry->getExpanderCacheValueCount()),sigItem); return true; } else { mIncompatibleSigSet->insert(newSignature); } } return false; } bool CSignatureSatisfiableExpanderCache::isCachingDataExpandable(CSignatureSatisfiableExpanderCacheContext* context, CSignatureSatisfiableExpanderCacheEntry* entry, cint64 signature, CCACHINGLIST* cacheValueList) { if (mIncompatibleSigSet->contains(signature) || entry->hasMultipleExpanded()) { CCACHINGHASH* tagHash = entry->getTagExpanderCacheValueHash(); cint64 prevCount = entry->getExpanderCacheValueCount(); while (prevCount-- > 0 && !cacheValueList->isEmpty()) { const CCacheValue& cacheValue = cacheValueList->takeFirst(); cint64 tag = cacheValue.getTag(); CExpanderCacheValueLinker* contCacheValue = tagHash->value(tag); if (!contCacheValue || *contCacheValue->getCacheValue() != cacheValue) { return false; } } } else { cint64 prevCount = entry->getExpanderCacheValueCount(); while (prevCount-- > 0 && !cacheValueList->isEmpty()) { const CCacheValue& cacheValue = cacheValueList->takeFirst(); } } return true; } void CSignatureSatisfiableExpanderCache::writeExpanderCachingData(CSignatureSatisfiableExpanderCacheContext* context, CSignatureSatisfiableExpanderCacheEntry* entry, bool extending, CCACHINGLIST* cacheValueList, CCACHINGHASH* depHash) { CMemoryAllocationManager* memMan = context->getMemoryAllocationManager(); CCACHINGHASH* tagHash = entry->getTagExpanderCacheValueHash(); CCACHINGHASH::const_iterator itDepEnd = depHash->constEnd(); CExpanderCacheValueLinker* lastExpCacheValueLinker = nullptr; CExpanderCacheValueLinker* firstExpCacheValueLinker = nullptr; CCACHINGHASH* newTagHash = CObjectParameterizingAllocator< CCACHINGHASH,CContext* >::allocateAndConstructAndParameterize(memMan,context); if (tagHash) { *newTagHash = *tagHash; } mCacheStat.incCacheEntriesCount(); CCACHINGHASH* tagCacheValueHash = nullptr; for (CCACHINGLIST::const_iterator it = cacheValueList->constBegin(), itEnd = cacheValueList->constEnd(); it != itEnd; ++it) { const CCacheValue& cacheValue = *it; cint64 tag = cacheValue.getTag(); if (!newTagHash->contains(tag)) { CExpanderCacheValueLinker* expCacheValue = CObjectParameterizingAllocator< CExpanderCacheValueLinker,CSignatureSatisfiableExpanderCacheContext* >::allocateAndConstructAndParameterize(memMan,context); expCacheValue->setCacheValue(cacheValue); //if (cacheValue.getIdentification() == 0 || tag == 0) { // bool bug = true; //} CCACHINGHASH::const_iterator itDep = depHash->constFind(tag); while (itDep != itDepEnd && itDep.key() == tag) { cint64 depTag = itDep.value(); CExpanderCacheValueLinker* depExpCacheValueLinker = newTagHash->value(depTag); if (!depExpCacheValueLinker) { if (!tagCacheValueHash) { tagCacheValueHash = CObjectParameterizingAllocator< CCACHINGHASH,CContext* >::allocateAndConstructAndParameterize(memMan,context); CCACHINGLIST::const_iterator it2 = it; for (++it2; it2 != itEnd; ++it2) { const CCacheValue& cv = *it2; cint64 cvTag = cv.getTag(); tagCacheValueHash->insert(cvTag,cv); } } const CCacheValue& depCacheValue = tagCacheValueHash->value(depTag); addExpanderCachingData(context,depCacheValue,newTagHash,depHash,tagCacheValueHash,lastExpCacheValueLinker,firstExpCacheValueLinker); depExpCacheValueLinker = newTagHash->value(depTag); } expCacheValue->addExpanderDependency(depExpCacheValueLinker); ++itDep; } newTagHash->insert(tag,expCacheValue); if (firstExpCacheValueLinker) { lastExpCacheValueLinker->append(expCacheValue); lastExpCacheValueLinker = expCacheValue; } else { firstExpCacheValueLinker = expCacheValue; lastExpCacheValueLinker = firstExpCacheValueLinker; } } } entry->setTagExpanderCacheValueHash(newTagHash); entry->appendExpanderCacheValueLinker(firstExpCacheValueLinker); } void CSignatureSatisfiableExpanderCache::addExpanderCachingData(CSignatureSatisfiableExpanderCacheContext* context, const CCacheValue& cacheValue, CCACHINGHASH* newTagHash, CCACHINGHASH* depHash, CCACHINGHASH* tagCacheValueHash, CExpanderCacheValueLinker*& lastExpCacheValueLinker, CExpanderCacheValueLinker*& firstExpCacheValueLinker) { CMemoryAllocationManager* memMan = context->getMemoryAllocationManager(); CCACHINGHASH::const_iterator itDepEnd = depHash->constEnd(); cint64 tag = cacheValue.getTag(); if (!newTagHash->contains(tag)) { CExpanderCacheValueLinker* expCacheValue = CObjectParameterizingAllocator< CExpanderCacheValueLinker,CSignatureSatisfiableExpanderCacheContext* >::allocateAndConstructAndParameterize(memMan,context); expCacheValue->setCacheValue(cacheValue); //if (cacheValue.getIdentification() == 0 || tag == 0) { // bool bug = true; //} CCACHINGHASH::const_iterator itDep = depHash->constFind(tag); while (itDep != itDepEnd && itDep.key() == tag) { cint64 depTag = itDep.value(); CExpanderCacheValueLinker* depExpCacheValueLinker = newTagHash->value(depTag); if (!depExpCacheValueLinker) { const CCacheValue& depCacheValue = tagCacheValueHash->value(depTag); addExpanderCachingData(context,depCacheValue,newTagHash,depHash,tagCacheValueHash,lastExpCacheValueLinker,firstExpCacheValueLinker); depExpCacheValueLinker = newTagHash->value(depTag); } expCacheValue->addExpanderDependency(depExpCacheValueLinker); ++itDep; } newTagHash->insert(tag,expCacheValue); if (firstExpCacheValueLinker) { lastExpCacheValueLinker->append(expCacheValue); lastExpCacheValueLinker = expCacheValue; } else { firstExpCacheValueLinker = expCacheValue; lastExpCacheValueLinker = firstExpCacheValueLinker; } } } bool CSignatureSatisfiableExpanderCache::writeSatisfiableBranchedCachingData(CSignatureSatisfiableExpanderCacheContext* context, cint64 signature, CCACHINGLIST* cacheValueList, CCACHINGLIST* branchedValueList) { CMemoryAllocationManager* memMan = context->getMemoryAllocationManager(); CSignatureSatisfiableExpanderCacheRedirectionItem* sSigItem = mSigItemHash->value(signature); if (sSigItem) { CSignatureSatisfiableExpanderCacheEntry* entry = sSigItem->getCacheEntry(); if (isCachingDataExpandable(context,entry,signature,cacheValueList)) { if (!branchedValueList || branchedValueList->isEmpty()) { entry->setSatisfiableWithoutBranchedConcepts(true); } else { CExpanderBranchedLinker* expBranch = CObjectParameterizingAllocator< CExpanderBranchedLinker,CSignatureSatisfiableExpanderCacheContext* >::allocateAndConstructAndParameterize(memMan,context); for (CCACHINGLIST::const_iterator it = branchedValueList->constBegin(), itEnd = branchedValueList->constEnd(); it != itEnd; ++it) { const CCacheValue& cacheValue = *it; expBranch->appendCacheValue(cacheValue); } entry->appendExpanderBranchedLinker(expBranch); } entry->setSatisfiable(true); return true; } } return false; } void CSignatureSatisfiableExpanderCache::createReaderSlotUpdate(CSignatureSatisfiableExpanderCacheContext* context) { CMemoryPoolProvider* memProv = context->getMemoryPoolAllocationManager(); CSignatureSatisfiableExpanderCacheSlotItem* slot = CObjectMemoryPoolAllocator::allocateAndConstructWithMemroyPool(memProv); CMemoryPoolContainerAllocationManager slotMemMan(slot,memProv); CMemoryAllocationManager* memMan = &slotMemMan; CContextBase tmpContext(memMan); CCACHINGHASH* slotSigItemHash = CObjectParameterizingAllocator< CCACHINGHASH,CContext* >::allocateAndConstructAndParameterize(memMan,&tmpContext); *slotSigItemHash = *mSigItemHash; slotSigItemHash->detach(); slot->setSignatureItemHash(slotSigItemHash); // currently not used //CCACHINGHASH* slotHasherItemHash = CObjectParameterizingAllocator< CCACHINGHASH,CContext* >::allocateAndConstructAndParameterize(memMan,&tmpContext); //*slotHasherItemHash = *mHasherItemHash; //slotHasherItemHash->detach(); //slot->setHasherItemHash(slotHasherItemHash); if (mSlotLinker) { mSlotLinker->append(slot); } else { mSlotLinker = slot; } CSignatureSatisfiableExpanderCacheReader* readerLinkerIt = mReaderLinker; while (readerLinkerIt) { slot->incReader(); readerLinkerIt->updateSlot(slot); readerLinkerIt = readerLinkerIt->getNext(); } } void CSignatureSatisfiableExpanderCache::cleanUnusedSlots(CSignatureSatisfiableExpanderCacheContext* context) { CMemoryPoolAllocationManager* memMan = context->getMemoryPoolAllocationManager(); CSignatureSatisfiableExpanderCacheSlotItem* slotLinkerIt = mSlotLinker; CSignatureSatisfiableExpanderCacheSlotItem* lastSlotLinker = nullptr; while (slotLinkerIt) { CSignatureSatisfiableExpanderCacheSlotItem* tmpSlotLinker = nullptr; if (!slotLinkerIt->hasCacheReaders()) { tmpSlotLinker = slotLinkerIt; } CSignatureSatisfiableExpanderCacheSlotItem* nextSlotLinker = slotLinkerIt->getNext(); if (tmpSlotLinker) { if (!lastSlotLinker) { mSlotLinker = nextSlotLinker; } else { lastSlotLinker->setNext(nextSlotLinker); } CMemoryPool* memoryPools = tmpSlotLinker->getMemoryPools(); memMan->releaseTemporaryMemoryPools(memoryPools); } else { lastSlotLinker = slotLinkerIt; } slotLinkerIt = nextSlotLinker; } } CSignatureSatisfiableExpanderCacheReader* CSignatureSatisfiableExpanderCache::createCacheReader() { CSignatureSatisfiableExpanderCacheReader* reader = new CSignatureSatisfiableExpanderCacheReader(); mReaderSyncMutex.lock(); mReaderLinker = reader->append(mReaderLinker); mReaderSyncMutex.unlock(); return reader; } CSignatureSatisfiableExpanderCacheWriter* CSignatureSatisfiableExpanderCache::createCacheWriter() { CSignatureSatisfiableExpanderCacheWriter* writer = new CSignatureSatisfiableExpanderCacheWriter(this); return writer; } CSignatureSatisfiableExpanderCache* CSignatureSatisfiableExpanderCache::writeCachedData(CSignatureSatisfiableExpanderCacheEntryWriteData* writeData, CMemoryPool* memoryPools) { #ifdef KONCLUCE_SATISFIBALE_EXPANDER_CACHE_DIRECT_WRITING CSignatureSatisfiableExpanderCacheEntryWriteData* dataLinkerIt = writeData; bool allCachingSuccess = true; bool oneCachingSuccess = false; bool oneCachingExpSuccess = false; while (dataLinkerIt) { if (dataLinkerIt->getCacheWriteDataType() == CSignatureSatisfiableExpanderCacheEntryWriteData::SATEXPANDCACHEWRITEDATATYPE) { CSignatureSatisfiableExpanderCacheEntryExpandWriteData* exWrDa = (CSignatureSatisfiableExpanderCacheEntryExpandWriteData*)dataLinkerIt; cint64 prevSignature = exWrDa->getPrevSignature(); cint64 newSignature = exWrDa->getNewSignature(); CCACHINGLIST* cacheValueList = exWrDa->getCacheValueList(); CCACHINGHASH* depHash = exWrDa->getDepHash(); bool cached = writeExpanderCachingData(&mContext,prevSignature,newSignature,cacheValueList,depHash); allCachingSuccess &= cached; oneCachingSuccess |= cached; oneCachingExpSuccess |= cached; } else { CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData* saBrWrDa = (CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData*)dataLinkerIt; cint64 signature = saBrWrDa->getSignature(); CCACHINGLIST* cacheValueList = saBrWrDa->getCacheValueList(); CCACHINGLIST* branchedValueList = saBrWrDa->getBranchedValueList(); bool cached = writeSatisfiableBranchedCachingData(&mContext,signature,cacheValueList,branchedValueList); allCachingSuccess &= cached; oneCachingSuccess |= cached; } dataLinkerIt = (CSignatureSatisfiableExpanderCacheEntryWriteData*)dataLinkerIt->getNext(); } if (oneCachingExpSuccess) { createReaderSlotUpdate(&mContext); cleanUnusedSlots(&mContext); } #else postEvent(new CWriteCachedDataEvent(writeData,memoryPools)); #endif return this; } CSignatureSatisfiableExpanderCache* CSignatureSatisfiableExpanderCache::writeExpandCached(cint64 prevSignature, cint64 newSignature, CCACHINGLIST* cacheValueList, CCACHINGHASH* depHash, CMemoryPool* memoryPools) { #ifdef KONCLUCE_SATISFIBALE_EXPANDER_CACHE_DIRECT_WRITING if (writeExpanderCachingData(&mContext,prevSignature,newSignature,cacheValueList,depHash)) { createReaderSlotUpdate(&mContext); cleanUnusedSlots(&mContext); } #else postEvent(new CWriteExpandCachedEvent(prevSignature,newSignature,cacheValueList,depHash,memoryPools)); #endif return this; } CSignatureSatisfiableExpanderCache* CSignatureSatisfiableExpanderCache::writeSatisfiableBranchCached(cint64 signature, CCACHINGLIST* cacheValueList, CCACHINGLIST* branchedList, CMemoryPool* memoryPools) { #ifdef KONCLUCE_SATISFIBALE_EXPANDER_CACHE_DIRECT_WRITING writeSatisfiableBranchedCachingData(&mContext,signature,cacheValueList,branchedList); #else postEvent(new CWriteSatisfiableBranchCachedEvent(signature,cacheValueList,branchedList,memoryPools)); #endif return this; } bool CSignatureSatisfiableExpanderCache::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CThread::processCustomsEvents(type,event)) { return true; } if (type == EVENTWRITEEXPANDCACHEDENTRY) { CWriteExpandCachedEvent* wece = (CWriteExpandCachedEvent*)event; cint64 prevSignature = wece->getPrevSignature(); cint64 newSignature = wece->getNewSignature(); CCACHINGLIST* cacheValueList = wece->getCacheValueList(); CCACHINGHASH* depHash = wece->getDepHash(); CMemoryPool* memoryPools = wece->getMemoryPools(); if (writeExpanderCachingData(&mContext,prevSignature,newSignature,cacheValueList,depHash)) { createReaderSlotUpdate(&mContext); cleanUnusedSlots(&mContext); } mContext.getMemoryPoolAllocationManager()->releaseTemporaryMemoryPools(memoryPools); return true; } else if (type == EVENTWRITESATISFIABLEBRANCHCACHEDENTRY) { CWriteSatisfiableBranchCachedEvent* wsbce = (CWriteSatisfiableBranchCachedEvent*)event; cint64 signature = wsbce->getSignature(); CCACHINGLIST* cacheValueList = wsbce->getCacheValueList(); CCACHINGLIST* branchedValueList = wsbce->getBranchedValueList(); CMemoryPool* memoryPools = wsbce->getMemoryPools(); writeSatisfiableBranchedCachingData(&mContext,signature,cacheValueList,branchedValueList); mContext.getMemoryPoolAllocationManager()->releaseTemporaryMemoryPools(memoryPools); return true; } else if (type == EVENTWRITECACHEDDATAENTRY) { CWriteCachedDataEvent* wcde = (CWriteCachedDataEvent*)event; CMemoryPool* memoryPools = wcde->getMemoryPools(); CSignatureSatisfiableExpanderCacheEntryWriteData* newWriteData = (CSignatureSatisfiableExpanderCacheEntryWriteData*)wcde->getWriteData(); cint64 dataWriteCount = newWriteData->getCount(); mCollectCount += dataWriteCount; mCollectMemoryPools = memoryPools->append(mCollectMemoryPools); mCollectWriteData = (CSignatureSatisfiableExpanderCacheEntryWriteData*)newWriteData->append(mCollectWriteData); if (mCollectCount >= mNextWriteCollectCount) { if (mWriteDataCount > mStartWriteCollectCount) { ++mNextWriteCollectCount; } CSignatureSatisfiableExpanderCacheEntryWriteData* dataLinkerIt = mCollectWriteData; bool allCachingSuccess = true; bool oneCachingSuccess = false; bool oneCachingExpSuccess = false; while (dataLinkerIt) { if (dataLinkerIt->getCacheWriteDataType() == CSignatureSatisfiableExpanderCacheEntryWriteData::SATEXPANDCACHEWRITEDATATYPE) { CSignatureSatisfiableExpanderCacheEntryExpandWriteData* exWrDa = (CSignatureSatisfiableExpanderCacheEntryExpandWriteData*)dataLinkerIt; cint64 prevSignature = exWrDa->getPrevSignature(); cint64 newSignature = exWrDa->getNewSignature(); CCACHINGLIST* cacheValueList = exWrDa->getCacheValueList(); CCACHINGHASH* depHash = exWrDa->getDepHash(); bool cached = writeExpanderCachingData(&mContext,prevSignature,newSignature,cacheValueList,depHash); allCachingSuccess &= cached; oneCachingSuccess |= cached; oneCachingExpSuccess |= cached; } else { CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData* saBrWrDa = (CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData*)dataLinkerIt; cint64 signature = saBrWrDa->getSignature(); CCACHINGLIST* cacheValueList = saBrWrDa->getCacheValueList(); CCACHINGLIST* branchedValueList = saBrWrDa->getBranchedValueList(); bool cached = writeSatisfiableBranchedCachingData(&mContext,signature,cacheValueList,branchedValueList); allCachingSuccess &= cached; oneCachingSuccess |= cached; } dataLinkerIt = (CSignatureSatisfiableExpanderCacheEntryWriteData*)dataLinkerIt->getNext(); } if (oneCachingExpSuccess) { createReaderSlotUpdate(&mContext); cleanUnusedSlots(&mContext); } mContext.releaseTemporaryMemoryPools(mCollectMemoryPools); mCacheStat.setMemoryConsumption(mContext.getMemoryConsumption()); mCollectWriteData = nullptr; mCollectMemoryPools = nullptr; mCollectCount = 0; } ++mWriteDataCount; return true; } return false; } cint64 CSignatureSatisfiableExpanderCache::getRequiredSignatureReferCountForNextCacheEntryCreation(CSignatureSatisfiableExpanderCacheContext* context) { if (context->getMemoryConsumption() >= mNextMemoryLevelRequiredSignatureRefCount) { mNextCacheEntryRequiredSignatureRefCount += mNextCacheEntryRequiredSignatureReferenceCountIncrease; mNextMemoryLevelRequiredSignatureRefCount += mNextMemoryLevelIncreaseForRequiredSignatureReferenceCount; } return mNextCacheEntryRequiredSignatureRefCount; } cint64 CSignatureSatisfiableExpanderCache::canCreateCacheEntryForSignature(cint64 singature, CSignatureSatisfiableExpanderCacheContext* context) { cint64& refCount = (*mSignatureReferCountSet)[singature]; ++refCount; if (refCount >= getRequiredSignatureReferCountForNextCacheEntryCreation(context)) { return true; } return false; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryWriteData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryW0000644000175000017500000000426412520551042032207 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEENTRYWRITEDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEENTRYWRITEDATA_H // Libraries includes #include // Namespace includes #include "CacheSettings.h" #include "CCacheEntryWriteData.h" #include "CCacheValue.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSignatureSatisfiableExpanderCacheEntryWriteData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureSatisfiableExpanderCacheEntryWriteData : public CCacheEntryWriteData { // public methods public: //! Constructor CSignatureSatisfiableExpanderCacheEntryWriteData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEENTRYWRITEDATA_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheWriter.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheWriter0000644000175000017500000000430412520551042032226 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureSatisfiableExpanderCacheWriter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSignatureSatisfiableExpanderCacheWriter::CSignatureSatisfiableExpanderCacheWriter(CSignatureSatisfiableExpanderCache* cache) : mCache(cache) { } CSignatureSatisfiableExpanderCacheWriter* CSignatureSatisfiableExpanderCacheWriter::writeCachedData(CSignatureSatisfiableExpanderCacheEntryWriteData* writeData, CMemoryPool* memoryPools) { mCache->writeCachedData(writeData,memoryPools); return this; } CSignatureSatisfiableExpanderCacheWriter* CSignatureSatisfiableExpanderCacheWriter::writeExpandCached(cint64 prevSignature, cint64 newSignature, CCACHINGLIST* cacheValueList, CCACHINGHASH* depHash, CMemoryPool* memoryPools) { mCache->writeExpandCached(prevSignature,newSignature,cacheValueList,depHash,memoryPools); return this; } CSignatureSatisfiableExpanderCacheWriter* CSignatureSatisfiableExpanderCacheWriter::writeSatisfiableBranchCached(cint64 signature, CCACHINGLIST* cacheValueList, CCACHINGLIST* branchedList, CMemoryPool* memoryPools) { mCache->writeSatisfiableBranchCached(signature,cacheValueList,branchedList,memoryPools); return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalityValueLinker.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalityV0000644000175000017500000000361412520551024032264 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryCardinalityValueLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryCardinalityValueLinker::CBackendRepresentativeMemoryCardinalityValueLinker() { } CCacheValue& CBackendRepresentativeMemoryCardinalityValueLinker::getCacheValue() { return getData(); } CBackendRepresentativeMemoryCardinalityValueLinker* CBackendRepresentativeMemoryCardinalityValueLinker::initCardinalityValueLinker(const CCacheValue& cacheValue, cint64 freeCardinality) { setData(cacheValue); mFreeCardinality = freeCardinality; return this; } CBackendRepresentativeMemoryCardinalityValueLinker* CBackendRepresentativeMemoryCardinalityValueLinker::setCacheValue(const CCacheValue& cacheValue) { setData(cacheValue); return this; } cint64 CBackendRepresentativeMemoryCardinalityValueLinker::getFreeCardinality() { return mFreeCardinality; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSatisfiableCache.h0000644000175000017500000000347412520551034025716 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATISFIABLECACHE_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATISFIABLECACHE_H // Libraries includes // Namespace includes #include "CCache.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSatisfiableCache * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCache : public CCache { // public methods public: //! Constructor CSatisfiableCache(); //! Destructor virtual ~CSatisfiableCache(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATISFIABLECACHE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheWriter.cpp0000644000175000017500000000263612520551030031347 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CComputedConsequencesCacheWriter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CComputedConsequencesCacheWriter::CComputedConsequencesCacheWriter(CComputedConsequencesCache* cache) : mCache(cache) { } CComputedConsequencesCacheWriter* CComputedConsequencesCacheWriter::writeCacheData(CComputedConsequencesCacheWriteData* writeData, CMemoryPool* memoryPools) { mCache->writeCacheData(writeData,memoryPools); return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CUnsatisfiableCacheReader.h0000644000175000017500000000410612520551042027374 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CUNSATISFIABLECACHEREADER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CUNSATISFIABLECACHEREADER_H // Libraries includes #include #include // Namespace includes #include "CCacheValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CUnsatisfiableCacheReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CUnsatisfiableCacheReader { // public methods public: //! Constructor CUnsatisfiableCacheReader(); //! Destructor virtual ~CUnsatisfiableCacheReader(); virtual bool isUnsatisfiable(QVector &itemVec, qint64 count) = 0; virtual QList getUnsatisfiableItems(QVector &itemVec, qint64 count) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CUNSATISFIABLECACHEREADER_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheSlotItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheSlotIte0000644000175000017500000000653012520551022032200 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHESLOTITEM_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHESLOTITEM_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CBackendRepresentativeMemoryLabelSignatureResolveCacheItem.h" #include "CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem.h" // Other includes #include "Utilities/Memory/CMemoryPoolContainer.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemoryCacheSlotItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryCacheSlotItem : public CMemoryPoolContainer, public CLinkerBase { // public methods public: //! Constructor CBackendRepresentativeMemoryCacheSlotItem(CMemoryPool* memoryPool = nullptr); bool incReader(); bool incReader(cint64 incCount); bool decReader(); CBackendRepresentativeMemoryCacheSlotItem* setSignatureLabelItemHash(CCACHINGHASH* sigItemHash); CBackendRepresentativeMemoryCacheSlotItem* setSignatureCardinalityItemHash(CCACHINGHASH* sigItemHash); CCACHINGHASH* getSignatureLabelItemHash(); CCACHINGHASH* getSignatureCardinalityItemHash(); bool hasCacheReaders(); // protected methods protected: // protected variables protected: CCACHINGHASH* mSigLabelItemHash; CCACHINGHASH* mSigCardLabelItemHash; QAtomicInt mReaderSharingCount; bool mReaderUsing; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHESLOTITEM_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheWriteData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheWriteDa0000644000175000017500000000223112520551024032150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryCacheWriteData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryCacheWriteData::CBackendRepresentativeMemoryCacheWriteData() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheContext.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheContex0000644000175000017500000000470612520551040032216 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureSatisfiableExpanderCacheContext.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSignatureSatisfiableExpanderCacheContext::CSignatureSatisfiableExpanderCacheContext() { mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); mMemMan = new CLimitedReserveMemoryPoolAllocationManager(mMemoryPoolProvider); mAddRelMemory = 0; } CSignatureSatisfiableExpanderCacheContext::~CSignatureSatisfiableExpanderCacheContext() { delete mMemMan; delete mMemoryPoolProvider; } CMemoryPoolAllocationManager* CSignatureSatisfiableExpanderCacheContext::getMemoryPoolAllocationManager() { return mMemMan; } CMemoryAllocationManager* CSignatureSatisfiableExpanderCacheContext::getMemoryAllocationManager() { return mMemMan; } CMemoryPoolProvider* CSignatureSatisfiableExpanderCacheContext::getMemoryPoolProvider() { return mMemoryPoolProvider; } cint64 CSignatureSatisfiableExpanderCacheContext::getMemoryConsumption() { return mAddRelMemory + mMemoryPoolProvider->getAllocatedReleaseDifferencePoolSize(); } CSignatureSatisfiableExpanderCacheContext* CSignatureSatisfiableExpanderCacheContext::releaseTemporaryMemoryPools(CMemoryPool* memoryPools) { CMemoryPool* memoryPoolIt = memoryPools; while (memoryPoolIt) { mAddRelMemory += memoryPoolIt->getMemoryBlockSize(); memoryPoolIt = memoryPoolIt->getNext(); } mMemMan->releaseTemporaryMemoryPools(memoryPools); return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheIndividualAssociationData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheIndivid0000644000175000017500000001020112520551022032171 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryCacheIndividualAssociationData.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryCacheIndividualAssociationData::CBackendRepresentativeMemoryCacheIndividualAssociationData() { } CBackendRepresentativeMemoryCacheIndividualAssociationData* CBackendRepresentativeMemoryCacheIndividualAssociationData::initAssociationData(CBackendRepresentativeMemoryCacheIndividualAssociationData* assData) { mIndividual = assData->mIndividual; mCompletelyHandled = assData->mCompletelyHandled; mCompletelySaturated = assData->mCompletelySaturated; mIncompletelyMarked = assData->mIncompletelyMarked; mCardinalityCacheEntry = assData->mCardinalityCacheEntry; mLabelCacheEntry = assData->mLabelCacheEntry; return this; } CBackendRepresentativeMemoryCacheIndividualAssociationData* CBackendRepresentativeMemoryCacheIndividualAssociationData::initAssociationData(CIndividual* individual) { mIndividual = individual; mCompletelyHandled = false; mCompletelySaturated = false; mIncompletelyMarked = false; mCardinalityCacheEntry = nullptr; mLabelCacheEntry = nullptr; return this; } CBackendRepresentativeMemoryLabelCacheItem* CBackendRepresentativeMemoryCacheIndividualAssociationData::getBackendLabelCacheEntry() { return mLabelCacheEntry; } CBackendRepresentativeMemoryCacheIndividualAssociationData* CBackendRepresentativeMemoryCacheIndividualAssociationData::setBackendLabelCacheEntry(CBackendRepresentativeMemoryLabelCacheItem* cacheEntry) { mLabelCacheEntry = cacheEntry; return this; } CBackendRepresentativeMemoryCardinalityCacheItem* CBackendRepresentativeMemoryCacheIndividualAssociationData::getBackendCardinalityCacheEntry() { return mCardinalityCacheEntry; } CBackendRepresentativeMemoryCacheIndividualAssociationData* CBackendRepresentativeMemoryCacheIndividualAssociationData::setBackendCardinalityCacheEntry(CBackendRepresentativeMemoryCardinalityCacheItem* cacheEntry) { mCardinalityCacheEntry = cacheEntry; return this; } bool CBackendRepresentativeMemoryCacheIndividualAssociationData::isCompletelyHandled() { return mCompletelyHandled; } CBackendRepresentativeMemoryCacheIndividualAssociationData* CBackendRepresentativeMemoryCacheIndividualAssociationData::setCompletelyHandled(bool completelyHandled) { mCompletelyHandled = completelyHandled; return this; } bool CBackendRepresentativeMemoryCacheIndividualAssociationData::isCompletelySaturated() { return mCompletelySaturated; } CBackendRepresentativeMemoryCacheIndividualAssociationData* CBackendRepresentativeMemoryCacheIndividualAssociationData::setCompletelySaturated(bool completelySaturated) { mCompletelySaturated = completelySaturated; return this; } bool CBackendRepresentativeMemoryCacheIndividualAssociationData::isIncompletelyMarked() { return mIncompletelyMarked; } CBackendRepresentativeMemoryCacheIndividualAssociationData* CBackendRepresentativeMemoryCacheIndividualAssociationData::setIncompletelyMarked(bool marked) { mIncompletelyMarked; return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCache.h0000644000175000017500000001013612520551030027611 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHE_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHE_H // Libraries includes #include #include #include // Namespace includes #include "CacheSettings.h" #include "CSatisfiableCache.h" #include "CComputedConsequencesCacheEntry.h" #include "CComputedConsequencesCacheContext.h" #include "CComputedConsequencesCacheReader.h" #include "CComputedConsequencesCacheWriteTypesData.h" #include "CSaturationNodeCacheUpdater.h" #include "CCacheStatistics.h" // Other includes #include "Concurrent/CThread.h" #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" #include "Reasoner/Kernel/Cache/Events/CWriteComputedConcequencesCacheEntryEvent.h" #include "Utilities/Memory/CObjectMemoryPoolAllocator.h" #include "Utilities/Memory/CObjectParameterizingAllocator.h" #include "Utilities/Memory/CMemoryPoolContainerAllocationManager.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" //#define KONCLUCE_SATISFIBALE_EXPANDER_CACHE_DIRECT_WRITING namespace Konclude { using namespace Config; using namespace Concurrent; using namespace Context; using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { using namespace Events; /*! * * \class CComputedConsequencesCache * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CComputedConsequencesCache : public CThread, public CSatisfiableCache { // public methods public: //! Constructor CComputedConsequencesCache(CConfiguration* config = nullptr, QString threadIdentifierName = "Saturation-Node-Associated-Expansion-Cache", CWatchDog *watchDogThread = 0); //! Destructor virtual ~CComputedConsequencesCache(); CComputedConsequencesCacheReader* createCacheReader(); CComputedConsequencesCacheWriter* createCacheWriter(); CComputedConsequencesCache* writeCacheData(CComputedConsequencesCacheWriteData* writeData, CMemoryPool* memoryPools); CCacheStatistics* getCacheStatistics(); // protected methods protected: CComputedConsequencesCache* installWriteCacheData(CComputedConsequencesCacheWriteData* writeData, CComputedConsequencesCacheContext* context); CComputedConsequencesCache* addTypesExpansionData(CComputedConsequencesCacheWriteTypesData* cccwtd, CComputedConsequencesCacheContext* context); CComputedConsequencesTypesCacheEntry* getComputedTypesCacheEntryForNode(CIndividual* individual, CComputedConsequencesCacheContext* context, bool create = true); virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); // protected variables protected: CComputedConsequencesCacheEntry* mEntryLinker; cint64 mConfAllowedNonDetExpansionCount; CComputedConsequencesCacheReader* mReaderLinker; QMutex mReaderSyncMutex; CCacheStatistics mCacheStat; CComputedConsequencesCacheContext mContext; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSatisfiableCache.cpp0000644000175000017500000000222012520551034026235 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCache.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSatisfiableCache::CSatisfiableCache() : CCache() { } CSatisfiableCache::~CSatisfiableCache() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheEntriesHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheEntriesHash0000644000175000017500000000340012520551032032165 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COccurrenceUnsatisfiableCacheEntriesHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { COccurrenceUnsatisfiableCacheEntriesHash::COccurrenceUnsatisfiableCacheEntriesHash() { referenceCount = 1; } COccurrenceUnsatisfiableCacheEntriesHash::COccurrenceUnsatisfiableCacheEntriesHash(const COccurrenceUnsatisfiableCacheEntriesHash ©Hash) : QHash(copyHash) { referenceCount = 1; } COccurrenceUnsatisfiableCacheEntriesHash::~COccurrenceUnsatisfiableCacheEntriesHash() { } qint64 COccurrenceUnsatisfiableCacheEntriesHash::incReferenceCount() { return ++referenceCount; } bool COccurrenceUnsatisfiableCacheEntriesHash::decReferenceCountReturnHasToBeDeleted() { return --referenceCount <= 0; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheContext.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheC0000644000175000017500000000652312520551036032171 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHECONTEXT_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHECONTEXT_H // Libraries includes // Namespace includes #include "CacheSettings.h" // Other includes #include "Context/CContext.h" #include "Utilities/Memory/CMemoryPoolProvider.h" #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" #include "Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.h" #include "Reasoner/Kernel/Process/CIndividualSaturationProcessNodeStatusUpdateLinker.h" #include "Reasoner/Kernel/Process/CIndividualSaturationProcessNode.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { using namespace Process; namespace Cache { /*! * * \class CSaturationNodeAssociatedExpansionCacheContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeAssociatedExpansionCacheContext : public CContext { // public methods public: //! Constructor CSaturationNodeAssociatedExpansionCacheContext(); ~CSaturationNodeAssociatedExpansionCacheContext(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); virtual CMemoryPoolAllocationManager* getMemoryPoolAllocationManager(); virtual CMemoryPoolProvider* getMemoryPoolProvider(); cint64 getMemoryConsumption(); CSaturationNodeAssociatedExpansionCacheContext* releaseTemporaryMemoryPools(CMemoryPool* memoryPools); CIndividualSaturationProcessNodeStatusUpdateLinker* getIndividualSaturationUpdateLinker(bool create = true); CSaturationNodeAssociatedExpansionCacheContext* addIndividualSaturationUpdateLinker(CIndividualSaturationProcessNodeStatusUpdateLinker* linker); // protected methods protected: // protected variables protected: CMemoryPoolAllocationManager* mMemMan; CNewAllocationMemoryPoolProvider* mMemoryPoolProvider; CIndividualSaturationProcessNodeStatusUpdateLinker* mConSatUpdateLinker; cint64 mAddRelMemory; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHECONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeCacheUpdater.h0000644000175000017500000000715312520551040027747 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODECACHEUPDATER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODECACHEUPDATER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CSaturationNodeAssociatedExpansionCacheContext.h" // Other includes #include "Concurrent/CThread.h" // Logger includes #include "Logger/CLogger.h" //#define KONCLUCE_SATISFIBALE_EXPANDER_CACHE_DIRECT_WRITING namespace Konclude { using namespace Concurrent; using namespace Context; using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { using namespace Events; /*! * * \class CSaturationNodeCacheUpdater * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeCacheUpdater { // public methods public: //! Constructor CSaturationNodeCacheUpdater(CSaturationNodeAssociatedExpansionCacheContext* context); CSaturationNodeCacheUpdater* propagateUnsatisfibility(CIndividualSaturationProcessNode* node, CSaturationNodeAssociatedExpansionCacheContext* context); // protected methods protected: CIndividualSaturationProcessNodeStatusUpdateLinker* createIndividualSaturationUpdateLinker(CSaturationNodeAssociatedExpansionCacheContext* context); void releaseIndividualSaturationUpdateLinker(CIndividualSaturationProcessNodeStatusUpdateLinker* conSatUpdateLinker, CSaturationNodeAssociatedExpansionCacheContext* context); bool requiresDirectAddingIndividualStatusFlagsUpdate(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CSaturationNodeAssociatedExpansionCacheContext* context); bool requiresIndirectAddingIndividualStatusFlagsUpdate(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CSaturationNodeAssociatedExpansionCacheContext* context); void updateDirectAddingIndividualStatusFlags(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CSaturationNodeAssociatedExpansionCacheContext* context); void updateIndirectAddingIndividualStatusFlags(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CSaturationNodeAssociatedExpansionCacheContext* context); // protected variables protected: CSaturationNodeAssociatedExpansionCacheContext* mContext; cint64 mIndirectUpdatedStatusIndiNodeCount; cint64 mDirectUpdatedStatusIndiNodeCount; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODECACHEUPDATER_H ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheIndividualAssociationData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheIndivid0000644000175000017500000000730412520551022032203 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEINDIVIDUALASSOCIATIONDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEINDIVIDUALASSOCIATIONDATA_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CBackendRepresentativeMemoryLabelCacheItem.h" #include "CBackendRepresentativeMemoryCardinalityCacheItem.h" // Other includes #include "Reasoner/Ontology/CIndividual.h" #include "Reasoner/Ontology/CIndividualBackendCachingData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemoryCacheIndividualAssociationData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryCacheIndividualAssociationData : public CIndividualBackendCachingData { // public methods public: //! Constructor CBackendRepresentativeMemoryCacheIndividualAssociationData(); CBackendRepresentativeMemoryCacheIndividualAssociationData* initAssociationData(CBackendRepresentativeMemoryCacheIndividualAssociationData* assData); CBackendRepresentativeMemoryCacheIndividualAssociationData* initAssociationData(CIndividual* individual); CBackendRepresentativeMemoryLabelCacheItem* getBackendLabelCacheEntry(); CBackendRepresentativeMemoryCacheIndividualAssociationData* setBackendLabelCacheEntry(CBackendRepresentativeMemoryLabelCacheItem* cacheEntry); CBackendRepresentativeMemoryCardinalityCacheItem* getBackendCardinalityCacheEntry(); CBackendRepresentativeMemoryCacheIndividualAssociationData* setBackendCardinalityCacheEntry(CBackendRepresentativeMemoryCardinalityCacheItem* cacheEntry); bool isCompletelyHandled(); CBackendRepresentativeMemoryCacheIndividualAssociationData* setCompletelyHandled(bool completelyHandled); bool isCompletelySaturated(); CBackendRepresentativeMemoryCacheIndividualAssociationData* setCompletelySaturated(bool completelySaturated); bool isIncompletelyMarked(); CBackendRepresentativeMemoryCacheIndividualAssociationData* setIncompletelyMarked(bool marked); // protected methods protected: // protected variables protected: CBackendRepresentativeMemoryLabelCacheItem* mLabelCacheEntry; CBackendRepresentativeMemoryCardinalityCacheItem* mCardinalityCacheEntry; CIndividual* mIndividual; bool mCompletelyHandled; bool mCompletelySaturated; bool mIncompletelyMarked; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEINDIVIDUALASSOCIATIONDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCache.cpp0000644000175000017500000005233512520551022031461 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryCache.h" #include "CBackendRepresentativeMemoryCacheWriter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryCache::CBackendRepresentativeMemoryCache(CConfiguration* config, QString threadIdentifierName, CWatchDog *watchDogThread) : CThread(threadIdentifierName,watchDogThread) { mWriteDataCount = 0; mNextWriteCollectCount = 0; mCollectCount = 0; mStartWriteCollectCount = 1000; mNextEntryID = 1; mConfig = config; mSlotLinker = nullptr; mReaderLinker = nullptr; mCollectMemoryPools = nullptr; mCollectWriteData = nullptr; CMemoryAllocationManager* memMan = mContext.getMemoryAllocationManager(); mSigLabelItemHash = CObjectParameterizingAllocator< CCACHINGHASH,CContext* >::allocateAndConstructAndParameterize(memMan,&mContext); mSigCardItemHash = CObjectParameterizingAllocator< CCACHINGHASH,CContext* >::allocateAndConstructAndParameterize(memMan,&mContext); startThread(QThread::HighestPriority); } CBackendRepresentativeMemoryCache::~CBackendRepresentativeMemoryCache() { } CCacheStatistics* CBackendRepresentativeMemoryCache::getCacheStatistics() { return &mCacheStat; } void CBackendRepresentativeMemoryCache::createReaderSlotUpdate(CBackendRepresentativeMemoryCacheContext* context) { CMemoryPoolProvider* memProv = context->getMemoryPoolAllocationManager(); CBackendRepresentativeMemoryCacheSlotItem* slot = CObjectMemoryPoolAllocator::allocateAndConstructWithMemroyPool(memProv); CMemoryPoolContainerAllocationManager slotMemMan(slot,memProv); CMemoryAllocationManager* memMan = &slotMemMan; CContextBase tmpContext(memMan); CCACHINGHASH* slotSigLabelItemHash = CObjectParameterizingAllocator< CCACHINGHASH,CContext* >::allocateAndConstructAndParameterize(memMan,&tmpContext); CCACHINGHASH* slotSigCardItemHash = CObjectParameterizingAllocator< CCACHINGHASH,CContext* >::allocateAndConstructAndParameterize(memMan,&tmpContext); *slotSigLabelItemHash = *mSigLabelItemHash; *slotSigCardItemHash = *mSigCardItemHash; slotSigLabelItemHash->detach(); slotSigCardItemHash->detach(); slot->setSignatureLabelItemHash(slotSigLabelItemHash); slot->setSignatureCardinalityItemHash(slotSigCardItemHash); if (mSlotLinker) { mSlotLinker->append(slot); } else { mSlotLinker = slot; } CBackendRepresentativeMemoryCacheReader* readerLinkerIt = mReaderLinker; while (readerLinkerIt) { slot->incReader(); readerLinkerIt->updateSlot(slot); readerLinkerIt = readerLinkerIt->getNext(); } } void CBackendRepresentativeMemoryCache::cleanUnusedSlots(CBackendRepresentativeMemoryCacheContext* context) { CMemoryPoolAllocationManager* memMan = context->getMemoryPoolAllocationManager(); CBackendRepresentativeMemoryCacheSlotItem* slotLinkerIt = mSlotLinker; CBackendRepresentativeMemoryCacheSlotItem* lastSlotLinker = nullptr; while (slotLinkerIt) { CBackendRepresentativeMemoryCacheSlotItem* tmpSlotLinker = nullptr; if (!slotLinkerIt->hasCacheReaders()) { tmpSlotLinker = slotLinkerIt; } CBackendRepresentativeMemoryCacheSlotItem* nextSlotLinker = slotLinkerIt->getNext(); if (tmpSlotLinker) { if (!lastSlotLinker) { mSlotLinker = nextSlotLinker; } else { lastSlotLinker->setNext(nextSlotLinker); } CMemoryPool* memoryPools = tmpSlotLinker->getMemoryPools(); memMan->releaseTemporaryMemoryPools(memoryPools); } else { lastSlotLinker = slotLinkerIt; } slotLinkerIt = nextSlotLinker; } } CBackendRepresentativeMemoryCacheReader* CBackendRepresentativeMemoryCache::createCacheReader() { CBackendRepresentativeMemoryCacheReader* reader = new CBackendRepresentativeMemoryCacheReader(); mReaderSyncMutex.lock(); mReaderLinker = reader->append(mReaderLinker); mReaderSyncMutex.unlock(); return reader; } CBackendRepresentativeMemoryCacheWriter* CBackendRepresentativeMemoryCache::createCacheWriter() { CBackendRepresentativeMemoryCacheWriter* writer = new CBackendRepresentativeMemoryCacheWriter(this); return writer; } CBackendRepresentativeMemoryCache* CBackendRepresentativeMemoryCache::writeCachedData(CBackendRepresentativeMemoryCacheWriteData* writeData, CMemoryPool* memoryPools) { postEvent(new CWriteBackendAssociationCachedEvent(writeData,memoryPools)); return this; } void CBackendRepresentativeMemoryCache::installTemporaryCardinalities(CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* tempCardWriteDataLinker, CBackendRepresentativeMemoryCacheContext* context) { for (CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* tempCardWriteDataLinkerIt = tempCardWriteDataLinker; tempCardWriteDataLinkerIt; tempCardWriteDataLinkerIt = tempCardWriteDataLinkerIt->getNext()) { cint64 signature = tempCardWriteDataLinkerIt->getSignature(); CBackendRepresentativeMemoryCardinalityValueLinker* cardValueLinker = tempCardWriteDataLinkerIt->getCardinalityCacheValueLinker(); cint64 cardValueCount = tempCardWriteDataLinkerIt->getCardinalityCacheValueCount(); CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem*& sigResolveItem = (*mSigCardItemHash)[signature]; if (!sigResolveItem) { sigResolveItem = CObjectParameterizingAllocator< CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem,CBackendRepresentativeMemoryCacheContext* >::allocateAndConstructAndParameterize(context->getMemoryAllocationManager(),context); } CBackendRepresentativeMemoryCardinalityCacheItem* refLabelItem = nullptr; for (CBackendRepresentativeMemoryCardinalityCacheItem* cardItemLinkerIt = sigResolveItem->getCardinalityCacheItems(); cardItemLinkerIt && !refLabelItem; cardItemLinkerIt = cardItemLinkerIt->getNext()) { if (cardItemLinkerIt->getCardinalityCacheValueCount() == cardValueCount) { CCACHINGHASH* cardValueHash = cardItemLinkerIt->getTagCardinalityCacheValueHash(false); bool identical = true; for (CBackendRepresentativeMemoryCardinalityValueLinker* cardValueLinkerIt = cardValueLinker; cardValueLinkerIt && identical; cardValueLinkerIt = cardValueLinkerIt->getNext()) { const CCacheValue& cacheValue = cardValueLinkerIt->getCacheValue(); cint64 valueTag = cacheValue.getTag(); CBackendRepresentativeMemoryCardinalityValueLinker* cardValue = cardValueHash->value(valueTag); if (!cardValue || cardValue->getCacheValue() != cacheValue || cardValue->getFreeCardinality() != cardValueLinkerIt->getFreeCardinality()) { identical = false; } } if (identical) { refLabelItem = cardItemLinkerIt; } } } if (!refLabelItem) { refLabelItem = CObjectParameterizingAllocator< CBackendRepresentativeMemoryCardinalityCacheItem,CBackendRepresentativeMemoryCacheContext* >::allocateAndConstructAndParameterize(context->getMemoryAllocationManager(),context); refLabelItem->initCacheEntry(signature,mNextEntryID++); CCACHINGHASH* cardValueHash = refLabelItem->getTagCardinalityCacheValueHash(true); for (CBackendRepresentativeMemoryCardinalityValueLinker* cardValueLinkerIt = cardValueLinker; cardValueLinkerIt; cardValueLinkerIt = cardValueLinkerIt->getNext()) { CBackendRepresentativeMemoryCardinalityValueLinker* newCardValueLinker = CObjectAllocator< CBackendRepresentativeMemoryCardinalityValueLinker >::allocateAndConstruct(context->getMemoryAllocationManager()); newCardValueLinker->initCardinalityValueLinker(cardValueLinkerIt->getCacheValue(),cardValueLinkerIt->getFreeCardinality()); cardValueHash->insert(cardValueLinkerIt->getCacheValue().getTag(),newCardValueLinker); refLabelItem->addCardinalityCacheValueLinker(newCardValueLinker); } sigResolveItem->appendCardinalityCacheItem(refLabelItem); } tempCardWriteDataLinkerIt->setTemporaryData(refLabelItem); } } void CBackendRepresentativeMemoryCache::installTemporaryLabels(CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* tempLabelWriteDataLinker, CBackendRepresentativeMemoryCacheContext* context) { for (CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* tempLabelWriteDataLinkerIt = tempLabelWriteDataLinker; tempLabelWriteDataLinkerIt; tempLabelWriteDataLinkerIt = tempLabelWriteDataLinkerIt->getNext()) { cint64 signature = tempLabelWriteDataLinkerIt->getSignature(); CBackendRepresentativeMemoryLabelValueLinker* labelValueLinker = tempLabelWriteDataLinkerIt->getDeterministicCacheValueLinker(); cint64 labelValueCount = tempLabelWriteDataLinkerIt->getDeterministicCacheValueCount(); CBackendRepresentativeMemoryLabelSignatureResolveCacheItem*& sigResolveItem = (*mSigLabelItemHash)[signature]; if (!sigResolveItem) { sigResolveItem = CObjectParameterizingAllocator< CBackendRepresentativeMemoryLabelSignatureResolveCacheItem,CBackendRepresentativeMemoryCacheContext* >::allocateAndConstructAndParameterize(context->getMemoryAllocationManager(),context); } CBackendRepresentativeMemoryLabelCacheItem* refLabelItem = nullptr; for (CBackendRepresentativeMemoryLabelCacheItem* labelItemLinkerIt = sigResolveItem->getLabelItems(); labelItemLinkerIt && !refLabelItem; labelItemLinkerIt = labelItemLinkerIt->getNext()) { if (labelItemLinkerIt->getDeterministicCacheValueCount() == labelValueCount) { CCACHINGHASH* labelValueHash = labelItemLinkerIt->getDeterministicTagCacheValueHash(false); bool identical = true; for (CBackendRepresentativeMemoryLabelValueLinker* labelValueLinkerIt = labelValueLinker; labelValueLinkerIt && identical; labelValueLinkerIt = labelValueLinkerIt->getNext()) { const CCacheValue& cacheValue = labelValueLinkerIt->getCacheValue(); cint64 valueTag = cacheValue.getTag(); CBackendRepresentativeMemoryLabelValueLinker* labelValue = labelValueHash->value(valueTag); if (!labelValue || labelValue->getCacheValue() != cacheValue) { identical = false; } } if (identical) { refLabelItem = labelItemLinkerIt; } } } if (!refLabelItem) { refLabelItem = CObjectParameterizingAllocator< CBackendRepresentativeMemoryLabelCacheItem,CBackendRepresentativeMemoryCacheContext* >::allocateAndConstructAndParameterize(context->getMemoryAllocationManager(),context); refLabelItem->initCacheEntry(signature,mNextEntryID++); CCACHINGHASH* labelValueHash = refLabelItem->getDeterministicTagCacheValueHash(true); for (CBackendRepresentativeMemoryLabelValueLinker* labelValueLinkerIt = labelValueLinker; labelValueLinkerIt; labelValueLinkerIt = labelValueLinkerIt->getNext()) { CBackendRepresentativeMemoryLabelValueLinker* newValueLinker = CObjectAllocator< CBackendRepresentativeMemoryLabelValueLinker >::allocateAndConstruct(context->getMemoryAllocationManager()); newValueLinker->initLabelValueLinker(labelValueLinkerIt->getCacheValue()); labelValueHash->insert(labelValueLinkerIt->getCacheValue().getTag(),newValueLinker); refLabelItem->addDeterministicCacheValueLinker(newValueLinker); } sigResolveItem->appendLabelItem(refLabelItem); } if (!refLabelItem->isCompletelyHandled() && tempLabelWriteDataLinkerIt->isCompletelyHandled()) { refLabelItem->setCompletelyHandled(true); } if (!refLabelItem->isCompletelySaturated() && tempLabelWriteDataLinkerIt->isCompletelySaturated()) { refLabelItem->setCompletelySaturated(true); } tempLabelWriteDataLinkerIt->setTemporaryData(refLabelItem); } } bool CBackendRepresentativeMemoryCache::installAssociations(CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tempAssWriteDataLinker, CBackendRepresentativeMemoryCacheContext* context) { bool associationsUpdated = false; for (CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tempAssWriteDataLinkerIt = tempAssWriteDataLinker; tempAssWriteDataLinkerIt; tempAssWriteDataLinkerIt = tempAssWriteDataLinkerIt->getNext()) { CIndividual* individual = tempAssWriteDataLinkerIt->getIndividual(); CBackendRepresentativeMemoryLabelCacheItem* referredLabelCacheItem = tempAssWriteDataLinkerIt->getReferredLabelData(); if (!referredLabelCacheItem) { CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* tmpRefferedLabelItem = tempAssWriteDataLinkerIt->getReferredTemporaryLabelData(); referredLabelCacheItem = (CBackendRepresentativeMemoryLabelCacheItem*)tmpRefferedLabelItem->getTemporaryData(); } CBackendRepresentativeMemoryCardinalityCacheItem* referredCardCacheItem = tempAssWriteDataLinkerIt->getReferredCardinalityData(); if (!referredCardCacheItem && tempAssWriteDataLinkerIt->getReferredTemporaryCardinalityData()) { CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* tmpRefferedCardItem = tempAssWriteDataLinkerIt->getReferredTemporaryCardinalityData(); referredCardCacheItem = (CBackendRepresentativeMemoryCardinalityCacheItem*)tmpRefferedCardItem->getTemporaryData(); } CIndividualProcessData* indiProcData = (CIndividualProcessData*)individual->getIndividualData(); CBackendRepresentativeMemoryCacheIndividualAssociationData* associationData = (CBackendRepresentativeMemoryCacheIndividualAssociationData*)indiProcData->getBackendCachingData(); if (!associationData || associationData->getBackendLabelCacheEntry() != referredLabelCacheItem || associationData->getBackendCardinalityCacheEntry() != referredCardCacheItem || associationData->isCompletelyHandled() != tempAssWriteDataLinkerIt->isCompletelyHandled() || associationData->isCompletelySaturated() != tempAssWriteDataLinkerIt->isCompletelySaturated()) { CBackendRepresentativeMemoryCacheIndividualAssociationData* locAssociationData = nullptr; locAssociationData = CObjectAllocator< CBackendRepresentativeMemoryCacheIndividualAssociationData >::allocateAndConstruct(context->getMemoryAllocationManager()); if (associationData) { locAssociationData->initAssociationData(associationData); } else { locAssociationData->initAssociationData(individual); } bool movedRepLabel = false; if (!associationData || locAssociationData->getBackendLabelCacheEntry() != referredLabelCacheItem || associationData->getBackendCardinalityCacheEntry() != referredCardCacheItem) { locAssociationData->setBackendLabelCacheEntry(referredLabelCacheItem); locAssociationData->setBackendCardinalityCacheEntry(referredCardCacheItem); movedRepLabel = true; locAssociationData->setCompletelyHandled(tempAssWriteDataLinkerIt->isCompletelyHandled()); locAssociationData->setCompletelySaturated(tempAssWriteDataLinkerIt->isCompletelySaturated()); associationsUpdated = true; } else { if (!locAssociationData->isCompletelyHandled() && tempAssWriteDataLinkerIt->isCompletelyHandled()) { locAssociationData->setCompletelyHandled(true); associationsUpdated = true; } if (!locAssociationData->isCompletelySaturated() && tempAssWriteDataLinkerIt->isCompletelySaturated()) { locAssociationData->setCompletelySaturated(true); associationsUpdated = true; } } if (locAssociationData->isCompletelyHandled()) { if (locAssociationData->isIncompletelyMarked()) { mIncompletelyAssociatedIndividualSet.remove(individual); locAssociationData->setIncompletelyMarked(false); } } else { if (!locAssociationData->isIncompletelyMarked()) { mIncompletelyAssociatedIndividualSet.insert(individual); locAssociationData->setIncompletelyMarked(true); } } indiProcData->setBackendCachingData(locAssociationData); } } return associationsUpdated; } bool CBackendRepresentativeMemoryCache::getIncompletlyAssociationCachedIndividuals(QSet* individualSet) { CBlockingCallbackData callbackData; postEvent(new CRetrieveIncompletelyAssociationCachedEvent(&callbackData,individualSet)); callbackData.waitForCallback(); return true; } bool CBackendRepresentativeMemoryCache::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CThread::processCustomsEvents(type,event)) { return true; } else if (type == EVENTRETRIEVEINCOMPLETELYASSOCIATIONCACHED) { CRetrieveIncompletelyAssociationCachedEvent* iace = (CRetrieveIncompletelyAssociationCachedEvent*)event; QSet* individualSet = iace->getIndividualSet(); if (individualSet) { *individualSet = mIncompletelyAssociatedIndividualSet; } CCallbackData* callbackData = iace->getCallback(); if (callbackData) { callbackData->doCallback(); } return true; } else if (type == EVENTWRITEBACKENDASSOCIATIONENTRY) { CWriteBackendAssociationCachedEvent* wcde = (CWriteBackendAssociationCachedEvent*)event; CMemoryPool* memoryPools = wcde->getMemoryPools(); CBackendRepresentativeMemoryCacheWriteData* newWriteData = (CBackendRepresentativeMemoryCacheWriteData*)wcde->getWriteData(); cint64 dataWriteCount = newWriteData->getCount(); mCollectCount += dataWriteCount; mCollectMemoryPools = memoryPools->append(mCollectMemoryPools); mCollectWriteData = (CBackendRepresentativeMemoryCacheWriteData*)newWriteData->append(mCollectWriteData); if (mCollectCount >= mNextWriteCollectCount) { if (mWriteDataCount > mStartWriteCollectCount) { ++mNextWriteCollectCount; } CBackendRepresentativeMemoryCacheWriteData* dataLinkerIt = mCollectWriteData; bool allCachingSuccess = true; bool oneCachingSuccess = false; bool oneCachingExpSuccess = false; while (dataLinkerIt) { if (dataLinkerIt->getCacheWriteDataType() == CBackendRepresentativeMemoryCacheWriteData::BACKENDASSOCIATIONWRITEDATATYPE) { CBackendRepresentativeMemoryCacheLabelAssociationWriteData* baAsWrDa = (CBackendRepresentativeMemoryCacheLabelAssociationWriteData*)dataLinkerIt; CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tempAssWriteDataLinker = baAsWrDa->getTemporaryAssociationWriteDataLinker(); CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* tempLabelWriteDataLinker = baAsWrDa->getTemporaryLabelWriteDataLinker(); CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* tempCardWriteDataLinker = baAsWrDa->getTemporaryCardinaltyWriteDataLinker(); installTemporaryLabels(tempLabelWriteDataLinker,&mContext); installTemporaryCardinalities(tempCardWriteDataLinker,&mContext); bool cached = installAssociations(tempAssWriteDataLinker,&mContext); allCachingSuccess &= cached; oneCachingSuccess |= cached; oneCachingExpSuccess |= cached; } dataLinkerIt = (CBackendRepresentativeMemoryCacheWriteData*)dataLinkerIt->getNext(); } if (oneCachingExpSuccess) { createReaderSlotUpdate(&mContext); cleanUnusedSlots(&mContext); } mContext.releaseTemporaryMemoryPools(mCollectMemoryPools); mCacheStat.setMemoryConsumption(mContext.getMemoryConsumption()); mCollectWriteData = nullptr; mCollectMemoryPools = nullptr; mCollectCount = 0; } ++mWriteDataCount; return true; } return false; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheSlotItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheSlotIt0000644000175000017500000000570712520551042032200 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureSatisfiableExpanderCacheSlotItem.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSignatureSatisfiableExpanderCacheSlotItem::CSignatureSatisfiableExpanderCacheSlotItem(CMemoryPool* memoryPool) : CLinkerBase(this),CMemoryPoolContainer(memoryPool) { mReaderUsing = false; mHasherItemHash = nullptr; mSigItemHash = nullptr; } bool CSignatureSatisfiableExpanderCacheSlotItem::incReader() { if (mReaderSharingCount.ref()) { mReaderUsing = true; } return true; } bool CSignatureSatisfiableExpanderCacheSlotItem::incReader(cint64 incCount) { for (cint64 i = 0; i < incCount; ++i) { incReader(); } return mReaderUsing; } bool CSignatureSatisfiableExpanderCacheSlotItem::decReader() { if (!mReaderSharingCount.deref()) { mReaderUsing = false; } return mReaderUsing; } CSignatureSatisfiableExpanderCacheSlotItem* CSignatureSatisfiableExpanderCacheSlotItem::setSignatureItemHash(CCACHINGHASH* sigItemHash) { mSigItemHash = sigItemHash; return this; } CSignatureSatisfiableExpanderCacheSlotItem* CSignatureSatisfiableExpanderCacheSlotItem::setHasherItemHash(CCACHINGHASH* hasherItemHash) { mHasherItemHash = hasherItemHash; return this; } bool CSignatureSatisfiableExpanderCacheSlotItem::hasCacheReaders() { return mReaderUsing; } CCACHINGHASH* CSignatureSatisfiableExpanderCacheSlotItem::getSignatureItemHash() { return mSigItemHash; } CCACHINGHASH* CSignatureSatisfiableExpanderCacheSlotItem::getHasherItemHash() { return mHasherItemHash; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheWriter.cpp0000644000175000017500000000347412520551032032020 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COccurrenceUnsatisfiableCacheWriter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { COccurrenceUnsatisfiableCacheWriter::COccurrenceUnsatisfiableCacheWriter(COccurrenceUnsatisfiableCache *unsatisfiableCache) { cache = unsatisfiableCache; } COccurrenceUnsatisfiableCacheWriter::~COccurrenceUnsatisfiableCacheWriter() { } void COccurrenceUnsatisfiableCacheWriter::setUnsatisfiable(QList &itemList) { cache->addUnsatisfiableCacheEntry(itemList); } void COccurrenceUnsatisfiableCacheWriter::setUnsatisfiable(QVector &itemVec, qint64 count, QVector &clashVec, qint64 clashCount) { if (clashCount > 0) { QList itemList; for (qint64 i = 0; i < clashCount; ++i) { itemList.append(clashVec[i]); } setUnsatisfiable(itemList); } } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CExpanderCacheValueLinker.h0000644000175000017500000000477212520551030027376 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CEXPANDERCACHEVALUELINKER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CEXPANDERCACHEVALUELINKER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "CSignatureSatisfiableExpanderCacheContext.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CExpanderCacheValueLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExpanderCacheValueLinker : public CLinkerBase { // public methods public: //! Constructor CExpanderCacheValueLinker(CSignatureSatisfiableExpanderCacheContext* context); CExpanderCacheValueLinker* addExpanderDependency(CExpanderCacheValueLinker* depExpCacheValue); CCACHINGLIST* getExpanderDependencyList(); CCacheValue* getCacheValue(); CExpanderCacheValueLinker* setCacheValue(const CCacheValue& cacheValue); // protected methods protected: // protected variables protected: CSignatureSatisfiableExpanderCacheContext* mContext; CCacheValue mCacheValue; CCACHINGLIST mDepList; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CEXPANDERCACHEVALUELINKER_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelValueLinker.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelValueLi0000644000175000017500000000447712520551026032206 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYLABELVALUELINKER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYLABELVALUELINKER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemoryLabelValueLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryLabelValueLinker : public CLinkerBase { // public methods public: //! Constructor CBackendRepresentativeMemoryLabelValueLinker(); CBackendRepresentativeMemoryLabelValueLinker* initLabelValueLinker(const CCacheValue& cacheValue); CCacheValue& getCacheValue(); CBackendRepresentativeMemoryLabelValueLinker* setCacheValue(const CCacheValue& cacheValue); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYLABELVALUELINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCompletionGraphCache.cpp0000644000175000017500000000224412520551026027111 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCompletionGraphCache.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CCompletionGraphCache::CCompletionGraphCache() : CCache() { } CCompletionGraphCache::~CCompletionGraphCache() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000020500000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTempora0000644000175000017500000000643712520551022032232 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker::CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker() { } CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker::initLabelWriteData(cint64 signature) { mCardValueCount = 0; mSignature = signature; mCardValueLinker = nullptr; mTmpData = nullptr; return this; } cint64 CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker::getSignature() { return mSignature; } CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker::setSignature(cint64 signature) { mSignature = signature; return this; } CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker::appendCardinalityCacheValueLinker(CBackendRepresentativeMemoryCardinalityValueLinker* linker) { CBackendRepresentativeMemoryCardinalityValueLinker* linkerIt = linker; while (linkerIt) { ++mCardValueCount; linkerIt = linkerIt->getNext(); } mCardValueLinker = linker->append(mCardValueLinker); return this; } CBackendRepresentativeMemoryCardinalityValueLinker* CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker::getCardinalityCacheValueLinker() { return mCardValueLinker; } cint64 CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker::getCardinalityCacheValueCount() { return mCardValueCount; } void* CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker::getTemporaryData() { return mTmpData; } CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker::setTemporaryData(void* tmpData) { mTmpData = tmpData; return this; } CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker::clearTemporaryData() { mTmpData = nullptr; return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheWriter.cpp0000644000175000017500000000265312520551034031315 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReuseCompletionGraphCacheWriter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CReuseCompletionGraphCacheWriter::CReuseCompletionGraphCacheWriter(CReuseCompletionGraphCache* cache) : mCache(cache) { } CReuseCompletionGraphCacheWriter* CReuseCompletionGraphCacheWriter::writeExpandCache(CReuseCompletionGraphCacheEntryWriteData* writeData, CMemoryPool* memoryPools) { mCache->writeExpandCache(writeData,memoryPools); return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelSignatureResolveCacheItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelSignatu0000644000175000017500000000441612520551024032246 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryLabelSignatureResolveCacheItem.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryLabelSignatureResolveCacheItem::CBackendRepresentativeMemoryLabelSignatureResolveCacheItem(CBackendRepresentativeMemoryCacheContext* context) : mContext(context) { mSignature = 0; mLabelItemCount = 0; mLabelItemLinker = nullptr; } CBackendRepresentativeMemoryLabelSignatureResolveCacheItem* CBackendRepresentativeMemoryLabelSignatureResolveCacheItem::appendLabelItem(CBackendRepresentativeMemoryLabelCacheItem* linker) { mLabelItemCount += linker->getCount(); mLabelItemLinker = linker->append(mLabelItemLinker); return this; } CBackendRepresentativeMemoryLabelCacheItem* CBackendRepresentativeMemoryLabelSignatureResolveCacheItem::getLabelItems() { return mLabelItemLinker; } cint64 CBackendRepresentativeMemoryLabelSignatureResolveCacheItem::getLabelItemCount() { return mLabelItemCount; } cint64 CBackendRepresentativeMemoryLabelSignatureResolveCacheItem::getSignature() { return mSignature; } CBackendRepresentativeMemoryLabelSignatureResolveCacheItem* CBackendRepresentativeMemoryLabelSignatureResolveCacheItem::setSignature(cint64 signature) { mSignature = signature; return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000020300000000000011576 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTempora0000644000175000017500000001131212520551022032216 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHETEMPORARYASSOCIATIONWRITEDATALINKER_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHETEMPORARYASSOCIATIONWRITEDATALINKER_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CBackendRepresentativeMemoryLabelCacheItem.h" #include "CBackendRepresentativeMemoryCardinalityCacheItem.h" #include "CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker.h" #include "CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker.h" // Other includes #include "Reasoner/Ontology/CIndividual.h" #include "Reasoner/Ontology/CIRIName.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker : public CLinkerBase { // public methods public: //! Constructor CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker(); CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* initAccociationWriteData(CIndividual* individual); CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* setReferredTemporaryLabelData(CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* referredTmpLabelData); CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* setReferredLabelData(CBackendRepresentativeMemoryLabelCacheItem* referredLabelData); CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* setReferredTemporaryCardinalityData(CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* referredTmpCardData); CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* setReferredCardinalityData(CBackendRepresentativeMemoryCardinalityCacheItem* referredCardData); CIndividual* getIndividual(); cint64 getIndividualID(); CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* getReferredTemporaryLabelData(); CBackendRepresentativeMemoryLabelCacheItem* getReferredLabelData(); CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* getReferredTemporaryCardinalityData(); CBackendRepresentativeMemoryCardinalityCacheItem* getReferredCardinalityData(); bool isCompletelyHandled(); CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* setCompletelyHandled(bool completelyHandled); bool isCompletelySaturated(); CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* setCompletelySaturated(bool completelySaturated); // protected methods protected: // protected variables protected: cint64 mIndividualID; CIndividual* mIndividual; CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* mReferredTmpLabelData; CBackendRepresentativeMemoryLabelCacheItem* mReferredLabelData; CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* mReferredTmpCardData; CBackendRepresentativeMemoryCardinalityCacheItem* mReferredCardData; bool mCompletelyHandled; bool mCompletelySaturated; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHETEMPORARYASSOCIATIONWRITEDATALINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CUnsatisfiableCache.h0000644000175000017500000000351312520551042026252 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CUNSATISFIABLECACHE_H #define KONCLUDE_REASONER_KERNEL_CACHE_CUNSATISFIABLECACHE_H // Libraries includes # // Namespace includes #include "CCache.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CUnsatisfiableCache * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CUnsatisfiableCache : public CCache { // public methods public: //! Constructor CUnsatisfiableCache(); //! Destructor virtual ~CUnsatisfiableCache(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CUNSATISFIABLECACHE_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedConceptExpansion.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedConceptExpansio0000644000175000017500000000737712520551036032310 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDCONCEPTEXPANSION_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDCONCEPTEXPANSION_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CSaturationNodeAssociatedExpansionCacheContext.h" #include "CSaturationNodeAssociatedConceptLinker.h" #include "CSaturationNodeAssociatedDependentNominalSet.h" #include "CCacheValueHasher.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSaturationNodeAssociatedConceptExpansion * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeAssociatedConceptExpansion { // public methods public: //! Constructor CSaturationNodeAssociatedConceptExpansion(CSaturationNodeAssociatedExpansionCacheContext* context); CSaturationNodeAssociatedConceptExpansion* initConceptExpansion(); CCACHINGHASH* getConceptExpansionHash(); CSaturationNodeAssociatedConceptExpansion* addConceptExpansionLinker(CSaturationNodeAssociatedConceptLinker* conceptLinker); bool hasConceptExpansionLinker(CCacheValue* cacheValue); CSaturationNodeAssociatedConceptLinker* getConceptExpansionLinker(CCacheValue* cacheValue); CSaturationNodeAssociatedConceptLinker* getConceptExpansionLinker(); cint64 getConceptExpansionCount(); CSaturationNodeAssociatedConceptExpansion* setConceptExpansionCount(cint64 count); CSaturationNodeAssociatedDependentNominalSet* getDependentNominalSet(bool create = true); bool getHasTightAtMostRestriction(); CSaturationNodeAssociatedConceptExpansion* setHasTightCardinalityRestriction(bool tightAtMostRestrictions); cint64 getConceptSetSignature(); CSaturationNodeAssociatedConceptExpansion* setConceptSetSignature(cint64 signature); cint64 getTotalConceptCount(); CSaturationNodeAssociatedConceptExpansion* setTotalConceptCount(cint64 totalConceptCount); // protected methods protected: // protected variables protected: CCACHINGHASH mConceptExpansionHash; CSaturationNodeAssociatedConceptLinker* mConceptExpansionLinker; cint64 mConceptExpansionCount; CSaturationNodeAssociatedDependentNominalSet* mDependentNominalSet; bool mHasTightCardinalityRestriction; cint64 mConceptSetSignature; cint64 mTotalConceptCount; CSaturationNodeAssociatedExpansionCacheContext* mContext; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDCONCEPTEXPANSION_H ././@LongLink0000644000000000000000000000020500000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTempora0000644000175000017500000001236612520551022032230 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker() { } CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::initAccociationWriteData(CIndividual* individual) { mIndividual = individual; mIndividualID = individual->getIndividualID(); mReferredLabelData = nullptr; mReferredTmpLabelData = nullptr; mReferredTmpCardData = nullptr; mReferredCardData = nullptr; mCompletelySaturated = true; mCompletelyHandled = true; return this; } CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::setReferredTemporaryLabelData(CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* referredTmpLabelData) { if (!referredTmpLabelData->isCompletelyHandled()) { mCompletelyHandled = false; } if (!referredTmpLabelData->isCompletelySaturated()) { mCompletelySaturated = false; } mReferredTmpLabelData = referredTmpLabelData; return this; } CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::setReferredLabelData(CBackendRepresentativeMemoryLabelCacheItem* referredLabelData) { if (!referredLabelData->isCompletelyHandled()) { mCompletelyHandled = false; } if (!referredLabelData->isCompletelySaturated()) { mCompletelySaturated = false; } mReferredLabelData = referredLabelData; return this; } CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::setReferredTemporaryCardinalityData(CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* referredTmpCardData) { mReferredTmpCardData = referredTmpCardData; return this; } CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::setReferredCardinalityData(CBackendRepresentativeMemoryCardinalityCacheItem* referredCardData) { mReferredCardData = referredCardData; return this; } CIndividual* CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::getIndividual() { return mIndividual; } cint64 CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::getIndividualID() { return mIndividualID; } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::getReferredTemporaryLabelData() { return mReferredTmpLabelData; } CBackendRepresentativeMemoryLabelCacheItem* CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::getReferredLabelData() { return mReferredLabelData; } bool CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::isCompletelyHandled() { return mCompletelyHandled; } CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::setCompletelyHandled(bool completelyHandled) { mCompletelyHandled = completelyHandled; return this; } bool CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::isCompletelySaturated() { return mCompletelySaturated; } CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::setCompletelySaturated(bool completelySaturated) { mCompletelySaturated = completelySaturated; return this; } CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::getReferredTemporaryCardinalityData() { return mReferredTmpCardData; } CBackendRepresentativeMemoryCardinalityCacheItem* CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker::getReferredCardinalityData() { return mReferredCardData; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheContext.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheContext0000644000175000017500000000537112520551022032243 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHECONTEXT_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHECONTEXT_H // Libraries includes // Namespace includes #include "CacheSettings.h" // Other includes #include "Context/CContext.h" #include "Utilities/Memory/CMemoryPoolProvider.h" #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" #include "Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemoryCacheContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryCacheContext : public CContext { // public methods public: //! Constructor CBackendRepresentativeMemoryCacheContext(); ~CBackendRepresentativeMemoryCacheContext(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); virtual CMemoryPoolAllocationManager* getMemoryPoolAllocationManager(); virtual CMemoryPoolProvider* getMemoryPoolProvider(); cint64 getMemoryConsumption(); CBackendRepresentativeMemoryCacheContext* releaseTemporaryMemoryPools(CMemoryPool* memoryPools); // protected methods protected: // protected variables protected: CMemoryPoolAllocationManager* mMemMan; CNewAllocationMemoryPoolProvider* mMemoryPoolProvider; cint64 mAddRelMemory; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHECONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationCache.cpp0000644000175000017500000000222612520551036026150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationCache.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationCache::CSaturationCache() : CSatisfiableCache() { } CSaturationCache::~CSaturationCache() { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheEntry.h0000644000175000017500000000372212520551030030636 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEENTRY_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEENTRY_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CComputedConsequencesCacheContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CComputedConsequencesCacheEntry * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CComputedConsequencesCacheEntry { // public methods public: //! Constructor CComputedConsequencesCacheEntry(CComputedConsequencesCacheContext* context); // protected methods protected: // protected variables protected: CComputedConsequencesCacheContext* mContext; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCOMPUTEDCONSEQUENCESCACHEENTRY_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheWriteData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheWriteDa0000644000175000017500000000422512520551024032155 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEWRITEDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEWRITEDATA_H // Libraries includes #include // Namespace includes #include "CacheSettings.h" #include "CBackendCacheWriteData.h" #include "CCacheValue.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemoryCacheWriteData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryCacheWriteData : public CBackendCacheWriteData { // public methods public: //! Constructor CBackendRepresentativeMemoryCacheWriteData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYCACHEWRITEDATA_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCache.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCache.0000644000175000017500000003045712520551036032147 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeAssociatedExpansionCache.h" #include "CSaturationNodeAssociatedExpansionCacheWriter.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationNodeAssociatedExpansionCache::CSaturationNodeAssociatedExpansionCache(CConfiguration* config, QString threadIdentifierName, CWatchDog *watchDogThread) : CThread(threadIdentifierName,watchDogThread) { mReaderLinker = nullptr; CMemoryAllocationManager* memMan = mContext.getMemoryAllocationManager(); mSaturationNodeCacheUpdate = new CSaturationNodeCacheUpdater(&mContext); mConfAllowedNonDetExpansionCount = 1; if (config) { mConfAllowedNonDetExpansionCount = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Optimization.SaturationExpansionSatisfiabilityCacheCount",1); } startThread(QThread::HighestPriority); } CSaturationNodeAssociatedExpansionCache::~CSaturationNodeAssociatedExpansionCache() { delete mSaturationNodeCacheUpdate; } CSaturationNodeAssociatedExpansionCache* CSaturationNodeAssociatedExpansionCache::writeCacheData(CSaturationNodeAssociatedExpansionCacheWriteData* writeData, CMemoryPool* memoryPools) { postEvent(new CWriteSaturationCacheDataEvent(writeData,memoryPools)); return this; } CCacheStatistics* CSaturationNodeAssociatedExpansionCache::getCacheStatistics() { return &mCacheStat; } CSaturationNodeAssociatedExpansionCache* CSaturationNodeAssociatedExpansionCache::installWriteCacheData(CSaturationNodeAssociatedExpansionCacheWriteData* writeData, CSaturationNodeAssociatedExpansionCacheContext* context) { CSaturationNodeAssociatedExpansionCacheWriteData* writeDataLinker = writeData; while (writeDataLinker) { if (writeDataLinker->getWriteDataType() == CSaturationNodeAssociatedExpansionCacheWriteData::SNAECWT_UNSAT) { CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData* snaecuwd = (CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData*)writeDataLinker; CIndividualSaturationProcessNode* node = snaecuwd->getUnsatisfiableSaturationIndividualNode(); propagateUnsatisfibility(node,context); } else if (writeDataLinker->getWriteDataType() == CSaturationNodeAssociatedExpansionCacheWriteData::SNAECWT_EXPAND) { CSaturationNodeAssociatedExpansionCacheExpansionWriteData* snaecewd = (CSaturationNodeAssociatedExpansionCacheExpansionWriteData*)writeDataLinker; addNodeExpansionData(snaecewd,context); } writeDataLinker = (CSaturationNodeAssociatedExpansionCacheWriteData*)writeDataLinker->getNext(); } return this; } CSaturationNodeAssociatedExpansionCache* CSaturationNodeAssociatedExpansionCache::addNodeExpansionData(CSaturationNodeAssociatedExpansionCacheExpansionWriteData* snaecewd, CSaturationNodeAssociatedExpansionCacheContext* context) { CIndividualSaturationProcessNode* node = snaecewd->getSaturationIndividualNode(); CSaturationNodeAssociatedExpansionCacheEntry* cacheEntry = getCacheEntryForNode(node,context,true); if (cacheEntry) { if (snaecewd->isDeterministicExpansion()) { if (!cacheEntry->hasDeterministicConceptExpansion()) { CSaturationNodeAssociatedDeterministicConceptExpansion* detExpansion = CObjectParameterizingAllocator< CSaturationNodeAssociatedDeterministicConceptExpansion,CSaturationNodeAssociatedExpansionCacheContext* >::allocateAndConstructAndParameterize(context->getMemoryAllocationManager(),context); detExpansion->initDeterministicConceptExpansion(); fillExpansionData(detExpansion,snaecewd,context); detExpansion->setNonDeterministicExpansionRequired(snaecewd->requiresNondeterministicExpansion()); cacheEntry->setDeterministicConceptExpansion(detExpansion); } else { CSaturationNodeAssociatedDeterministicConceptExpansion* detExpansion = extendDeterministicExpansionData(cacheEntry->getDeterministicConceptExpansion(),snaecewd,context); detExpansion->setNonDeterministicExpansionRequired(snaecewd->requiresNondeterministicExpansion()); cacheEntry->setDeterministicConceptExpansion(detExpansion); } } else { if (cacheEntry->areMoreNondeterministicExpansionAllowed()) { cacheEntry->decRemainingAllowedNondeterministicExpansionCount(); CSaturationNodeAssociatedNondeterministicConceptExpansion* nondetExpansion = CObjectParameterizingAllocator< CSaturationNodeAssociatedNondeterministicConceptExpansion,CSaturationNodeAssociatedExpansionCacheContext* >::allocateAndConstructAndParameterize(context->getMemoryAllocationManager(),context); nondetExpansion->initNondeterministicConceptExpansion(); fillExpansionData(nondetExpansion,snaecewd,context); cacheEntry->addNondeterministicConceptExpansion(nondetExpansion); } } } return this; } CSaturationNodeAssociatedDeterministicConceptExpansion* CSaturationNodeAssociatedExpansionCache::extendDeterministicExpansionData(CSaturationNodeAssociatedConceptExpansion* prevConceptExpansion, CSaturationNodeAssociatedExpansionCacheExpansionWriteData* snaecewd, CSaturationNodeAssociatedExpansionCacheContext* context) { CSaturationNodeAssociatedDeterministicConceptExpansion* newDetExpansion = nullptr; for (CSaturationNodeAssociatedConceptLinker* conceptExpansionLinkerIt = snaecewd->getExpansionConceptLinker(); conceptExpansionLinkerIt; conceptExpansionLinkerIt = conceptExpansionLinkerIt->getNext()) { CCacheValue* cacheValue = conceptExpansionLinkerIt->getCacheValue(); if (!prevConceptExpansion->hasConceptExpansionLinker(cacheValue)) { if (!newDetExpansion) { newDetExpansion = CObjectParameterizingAllocator< CSaturationNodeAssociatedDeterministicConceptExpansion,CSaturationNodeAssociatedExpansionCacheContext* >::allocateAndConstructAndParameterize(context->getMemoryAllocationManager(),context); newDetExpansion->initDeterministicConceptExpansion(); } CSaturationNodeAssociatedConceptLinker* conceptExpansionLinker = CObjectAllocator< CSaturationNodeAssociatedConceptLinker >::allocateAndConstruct(context->getMemoryAllocationManager()); conceptExpansionLinker->initConceptLinker(*cacheValue); newDetExpansion->addConceptExpansionLinker(conceptExpansionLinker); } } if (!newDetExpansion && !snaecewd->requiresNondeterministicExpansion()) { newDetExpansion = CObjectParameterizingAllocator< CSaturationNodeAssociatedDeterministicConceptExpansion,CSaturationNodeAssociatedExpansionCacheContext* >::allocateAndConstructAndParameterize(context->getMemoryAllocationManager(),context); newDetExpansion->initDeterministicConceptExpansion(); } if (newDetExpansion) { CSaturationNodeAssociatedDependentNominalSet* nominalDependentSet = snaecewd->getDependentNominalSet(); if (nominalDependentSet && !nominalDependentSet->isEmpty()) { for (CSaturationNodeAssociatedDependentNominalSet::const_iterator it = nominalDependentSet->constBegin(), itEnd = nominalDependentSet->constEnd(); it != itEnd; ++it) { cint64 nominalID = *it; newDetExpansion->getDependentNominalSet(true)->insert(nominalID); } } newDetExpansion->setHasTightCardinalityRestriction(snaecewd->hasTightAtMostRestriction()); newDetExpansion->setConceptSetSignature(snaecewd->getConceptSetSignature()); newDetExpansion->setTotalConceptCount(snaecewd->getTotalConceptCount()); } return newDetExpansion; } CSaturationNodeAssociatedExpansionCache* CSaturationNodeAssociatedExpansionCache::fillExpansionData(CSaturationNodeAssociatedConceptExpansion* conceptExpansion, CSaturationNodeAssociatedExpansionCacheExpansionWriteData* snaecewd, CSaturationNodeAssociatedExpansionCacheContext* context) { for (CSaturationNodeAssociatedConceptLinker* conceptExpansionLinkerIt = snaecewd->getExpansionConceptLinker(); conceptExpansionLinkerIt; conceptExpansionLinkerIt = conceptExpansionLinkerIt->getNext()) { CCacheValue* cacheValue = conceptExpansionLinkerIt->getCacheValue(); CSaturationNodeAssociatedConceptLinker* conceptExpansionLinker = CObjectAllocator< CSaturationNodeAssociatedConceptLinker >::allocateAndConstruct(context->getMemoryAllocationManager()); conceptExpansionLinker->initConceptLinker(*cacheValue); conceptExpansion->addConceptExpansionLinker(conceptExpansionLinker); } CSaturationNodeAssociatedDependentNominalSet* nominalDependentSet = snaecewd->getDependentNominalSet(); if (nominalDependentSet && !nominalDependentSet->isEmpty()) { for (CSaturationNodeAssociatedDependentNominalSet::const_iterator it = nominalDependentSet->constBegin(), itEnd = nominalDependentSet->constEnd(); it != itEnd; ++it) { cint64 nominalID = *it; conceptExpansion->getDependentNominalSet(true)->insert(nominalID); } } conceptExpansion->setHasTightCardinalityRestriction(snaecewd->hasTightAtMostRestriction()); conceptExpansion->setConceptSetSignature(snaecewd->getConceptSetSignature()); conceptExpansion->setTotalConceptCount(snaecewd->getTotalConceptCount()); return this; } CSaturationNodeAssociatedExpansionCacheEntry* CSaturationNodeAssociatedExpansionCache::getCacheEntryForNode(CIndividualSaturationProcessNode* node, CSaturationNodeAssociatedExpansionCacheContext* context, bool create) { CSaturationNodeAssociatedExpansionCacheEntry* cacheEntry = (CSaturationNodeAssociatedExpansionCacheEntry*)node->getCacheExpansionData(); if (!cacheEntry) { cacheEntry = CObjectParameterizingAllocator< CSaturationNodeAssociatedExpansionCacheEntry,CSaturationNodeAssociatedExpansionCacheContext* >::allocateAndConstructAndParameterize(context->getMemoryAllocationManager(),context); cacheEntry->initCacheEntry(node,mConfAllowedNonDetExpansionCount); node->setCacheExpansionData(cacheEntry); } return cacheEntry; } CSaturationNodeAssociatedExpansionCache* CSaturationNodeAssociatedExpansionCache::propagateUnsatisfibility(CIndividualSaturationProcessNode* node, CSaturationNodeAssociatedExpansionCacheContext* context) { mSaturationNodeCacheUpdate->propagateUnsatisfibility(node,context); return this; } CSaturationNodeAssociatedExpansionCacheReader* CSaturationNodeAssociatedExpansionCache::createCacheReader() { CSaturationNodeAssociatedExpansionCacheReader* readerLinker = new CSaturationNodeAssociatedExpansionCacheReader(); mReaderSyncMutex.lock(); mReaderLinker = readerLinker->append(mReaderLinker); mReaderSyncMutex.unlock(); return readerLinker; } CSaturationNodeAssociatedExpansionCacheWriter* CSaturationNodeAssociatedExpansionCache::createCacheWriter() { return new CSaturationNodeAssociatedExpansionCacheWriter(this); } bool CSaturationNodeAssociatedExpansionCache::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CThread::processCustomsEvents(type,event)) { return true; } else if (type == EVENTWRITESATURATIONCACHEDATAENTRY) { CWriteSaturationCacheDataEvent* wscde = (CWriteSaturationCacheDataEvent*)event; CMemoryPool* memoryPools = wscde->getMemoryPools(); CSaturationNodeAssociatedExpansionCacheWriteData* writeData = wscde->getWriteData(); installWriteCacheData(writeData,&mContext); mContext.getMemoryPoolAllocationManager()->releaseTemporaryMemoryPools(memoryPools); return true; } return false; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheReader.cpp0000644000175000017500000003636212520551032031750 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COccurrenceUnsatisfiableCacheReader.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { COccurrenceUnsatisfiableCacheReader::COccurrenceUnsatisfiableCacheReader(COccurrenceUnsatisfiableCache *unsatisfiableCache) { cache = unsatisfiableCache; cacheSlotItem = 0; incCacheEntriesLinker = 0; incrementUnsatisfiableTestReset(); } COccurrenceUnsatisfiableCacheReader::~COccurrenceUnsatisfiableCacheReader() { } COccurrenceUnsatisfiableCacheUpdateSlotItem *COccurrenceUnsatisfiableCacheReader::changeUpdateSlot(COccurrenceUnsatisfiableCacheUpdateSlotItem *nextUpdateSlot) { COccurrenceUnsatisfiableCacheUpdateSlotItem *tmpSlotItem = 0; nextUpdateSlot->incReader(); tmpSlotItem = mNextCacheSlotItemPointer.fetchAndStoreOrdered(nextUpdateSlot); if (tmpSlotItem) { tmpSlotItem->decReader(); } return tmpSlotItem; } bool COccurrenceUnsatisfiableCacheReader::moveToNextSlot() { if (mNextCacheSlotItemPointer.fetchAndAddRelaxed(0) != nullptr) { COccurrenceUnsatisfiableCacheUpdateSlotItem* nextSlotItem = mNextCacheSlotItemPointer.fetchAndStoreOrdered(nullptr); if (nextSlotItem) { if (cacheSlotItem) { cacheSlotItem->decReader(); } cacheSlotItem = nextSlotItem; return true; } } return false; } void COccurrenceUnsatisfiableCacheReader::incrementUnsatisfiableTestReset() { while (incCacheEntriesLinker) { CDblLinker *tmpCacheEntry = incCacheEntriesLinker; incCacheEntriesLinker = incCacheEntriesLinker->getNext(); memManCacheEntryList.release(tmpCacheEntry); } lastUnsatItems.clear(); } bool COccurrenceUnsatisfiableCacheReader::incrementUnsatisfiableTest(CCacheValue *cacheValue, bool *continueTestingUseful) { bool unsat = false; incCacheEntriesLinker = incrementalUnsatisfiableTest(cacheValue,incCacheEntriesLinker,&unsat,continueTestingUseful); return unsat; } CDblLinker *COccurrenceUnsatisfiableCacheReader::incrementalUnsatisfiableTest(CCacheValue *cacheValue, CDblLinker *cacheEntries, bool *unsatisfiable, bool *continueTesting) { if (!cacheEntries) { cacheEntries = memManCacheEntryList.allocate()->init(cache->getPrimarCacheEntry()); } qint64 updateSlot = 0; if (mNextCacheSlotItemPointer.fetchAndAddRelaxed(0) != nullptr) { moveToNextSlot(); } bool unsatisfiableFound = false; bool continueTestingUseful = false; if (cacheSlotItem) { updateSlot = cacheSlotItem->getSlotIndex(); CDblLinker *nextCacheEntries = 0; qint64 itemTag = cacheValue->getTag(); CDblLinker *linkIt = cacheEntries; while (linkIt) { if (mNextCacheSlotItemPointer.fetchAndAddRelaxed(0) != nullptr) { moveToNextSlot(); if (cacheSlotItem) { updateSlot = cacheSlotItem->getSlotIndex(); } } CDblLinker *linkNextIt = linkIt->getNext(); if (linkNextIt) { linkNextIt->removePrev(); } COccurrenceUnsatisfiableCacheEntry *cacheEntry = linkIt->getData(); qint64 cacheMax = cacheEntry->getMaxTag(); qint64 cacheMin = cacheEntry->getMinTag(); COccurrenceUnsatisfiableCacheEntriesHash *cacheHash = cacheEntry->getSlotCacheEntriesHash(updateSlot); // test min and max if (!cacheHash || itemTag > cacheMax) { // cache entry is no longer needed memManCacheEntryList.release(linkIt); } else { if (!cacheEntry->isSerialized()) { // cache entry is needed, next round nextCacheEntries = linkIt->insertNext(nextCacheEntries); } else { memManCacheEntryList.release(linkIt); } // test to add additional cache entries if (cacheHash->contains(*cacheValue)) { COccurrenceUnsatisfiableCacheEntry *nextAddingCacheEntry = cacheHash->value(*cacheValue); if (nextAddingCacheEntry->isUnsatisfiableTermination()) { unsatisfiableFound = true; linkIt = linkNextIt; if (nextAddingCacheEntry->getCacheTerminationValuesList()) { lastUnsatItems = *nextAddingCacheEntry->getCacheTerminationValuesList(); } break; } nextCacheEntries = memManCacheEntryList.allocate()->init(nextAddingCacheEntry,nextCacheEntries); } } linkIt = linkNextIt; } while (linkIt) { CDblLinker *tmpCacheEntry = linkIt; linkIt = linkIt->getNext(); memManCacheEntryList.release(tmpCacheEntry); } cacheEntries = nextCacheEntries; nextCacheEntries = 0; } else { while (cacheEntries) { CDblLinker *tmpCacheEntry = cacheEntries; cacheEntries = cacheEntries->getNext(); memManCacheEntryList.release(tmpCacheEntry); } cacheEntries = 0; } if (unsatisfiableFound) { while (cacheEntries) { CDblLinker *tmpCacheEntry = cacheEntries; cacheEntries = cacheEntries->getNext(); memManCacheEntryList.release(tmpCacheEntry); } cacheEntries = 0; } if (!unsatisfiableFound && cacheEntries) { continueTestingUseful = true; } if (continueTesting) { *continueTesting = continueTestingUseful; } if (unsatisfiable) { *unsatisfiable = unsatisfiableFound; } return cacheEntries; } bool COccurrenceUnsatisfiableCacheReader::isUnsatisfiable(QVector &itemVec, qint64 count) { return isUnsatisfiable(itemVec,count,0); } bool COccurrenceUnsatisfiableCacheReader::isUnsatisfiable(QVector &itemVec, qint64 count, QList *unsatisfiableItemList) { bool unsatisfiable = false; // list for cache entries // TODO: use min and max from cache entries to make list smaller CDblLinker *cacheEntries = memManCacheEntryList.allocate()->init(cache->getPrimarCacheEntry()); qint64 firstIndex = 0; qint64 lastIndex = count-1; // make assumption that list is sorted qint64 minItem = itemVec[0].getTag(); qint64 maxItem = itemVec[lastIndex].getTag(); qint64 updateSlot = 0; if (mNextCacheSlotItemPointer.fetchAndAddRelaxed(0) != nullptr) { moveToNextSlot(); } if (cacheSlotItem) { updateSlot = cacheSlotItem->getSlotIndex(); CDblLinker *nextCacheEntries = 0; // TODO: Skip items which are not in cache qint64 index = 0; while (index < count && !unsatisfiable && cacheEntries) { CCacheValue &item = itemVec[index++]; qint64 itemTag = item.getTag(); nextCacheEntries = 0; CDblLinker *linkIt = cacheEntries; while (linkIt) { if (mNextCacheSlotItemPointer.fetchAndAddRelaxed(0) != nullptr) { moveToNextSlot(); if (cacheSlotItem) { updateSlot = cacheSlotItem->getSlotIndex(); } } CDblLinker *linkNextIt = linkIt->getNext(); if (linkNextIt) { linkNextIt->removePrev(); } COccurrenceUnsatisfiableCacheEntry *cacheEntry = linkIt->getData(); qint64 cacheMax = cacheEntry->getMaxTag(); qint64 cacheMin = cacheEntry->getMinTag(); COccurrenceUnsatisfiableCacheEntriesHash *cacheHash = cacheEntry->getSlotCacheEntriesHash(updateSlot); // test min and max if (!cacheHash || cacheMin > maxItem || itemTag > cacheMax) { // cache entry is no longer needed memManCacheEntryList.release(linkIt); } else { // cache entry is needed, next round nextCacheEntries = linkIt->insertNext(nextCacheEntries); // test to add additional cache entries if (cacheHash->contains(item)) { COccurrenceUnsatisfiableCacheEntry *nextAddingCacheEntry = cacheHash->value(item); if (nextAddingCacheEntry->isUnsatisfiableTermination()) { unsatisfiable = true; if (nextAddingCacheEntry->getCacheTerminationValuesList()) { lastUnsatItems = *nextAddingCacheEntry->getCacheTerminationValuesList(); if (unsatisfiableItemList) { *unsatisfiableItemList = *nextAddingCacheEntry->getCacheTerminationValuesList(); } } linkIt = linkNextIt; break; } nextCacheEntries = memManCacheEntryList.allocate()->init(nextAddingCacheEntry,nextCacheEntries); } } linkIt = linkNextIt; } while (linkIt) { CDblLinker *tmpCacheEntry = linkIt; linkIt = linkIt->getNext(); memManCacheEntryList.release(tmpCacheEntry); } cacheEntries = nextCacheEntries; nextCacheEntries = 0; } while (cacheEntries) { CDblLinker *tmpCacheEntry = cacheEntries; cacheEntries = cacheEntries->getNext(); memManCacheEntryList.release(tmpCacheEntry); } } if (mNextCacheSlotItemPointer.fetchAndAddRelaxed(0) != nullptr) { moveToNextSlot(); if (cacheSlotItem) { updateSlot = cacheSlotItem->getSlotIndex(); } } return unsatisfiable; } QList COccurrenceUnsatisfiableCacheReader::getLastTestedUnsatisfiableItems() { return lastUnsatItems; } QList COccurrenceUnsatisfiableCacheReader::getUnsatisfiableItems(QVector &itemVec, qint64 count) { QList unsatList; isUnsatisfiable(itemVec,count,&unsatList); return unsatList; } CXLinker* COccurrenceUnsatisfiableCacheReader::getUnsatisfiableItems(CXLinker* cacheValueTestLinker, CMemoryAllocationManager* memMan) { CXLinker* unsatLinker = nullptr; bool unsatisfiable = false; // list for cache entries // TODO: use min and max from cache entries to make list smaller CXLinker* cacheEntries = CObjectAllocator< CXLinker >::allocateAndConstruct(memMan)->initLinker(cache->getPrimarCacheEntry()); //memManCacheEntryList.allocate()->init(cache->getPrimarCacheEntry()); CCacheValue* firstItem = cacheValueTestLinker->getData(); CCacheValue* lastItem = cacheValueTestLinker->getLastListLink()->getData(); CXLinker* testCacheItemIt = cacheValueTestLinker; // make assumption that list is sorted qint64 minItem = firstItem->getTag(); qint64 maxItem = lastItem->getTag(); qint64 updateSlot = 0; if (mNextCacheSlotItemPointer.fetchAndAddRelaxed(0) != nullptr) { moveToNextSlot(); } if (cacheSlotItem) { updateSlot = cacheSlotItem->getSlotIndex(); CXLinker *nextCacheEntries = nullptr; while (testCacheItemIt && cacheEntries) { CCacheValue* item = testCacheItemIt->getData(); qint64 itemTag = item->getTag(); nextCacheEntries = nullptr; CXLinker *cacheEntryIt = cacheEntries; while (cacheEntryIt) { CXLinker *cacheEntryLinker = cacheEntryIt; cacheEntryIt = cacheEntryIt->getNext(); cacheEntryLinker->clearNext(); COccurrenceUnsatisfiableCacheEntry *cacheEntry = cacheEntryLinker->getData(); qint64 cacheMax = cacheEntry->getMaxTag(); qint64 cacheMin = cacheEntry->getMinTag(); COccurrenceUnsatisfiableCacheEntriesHash *cacheHash = cacheEntry->getSlotCacheEntriesHash(updateSlot); // test min and max if (!cacheHash || cacheMin > maxItem || itemTag > cacheMax) { // cache entry is no longer needed } else { // cache entry is needed, next round nextCacheEntries = cacheEntryLinker->append(nextCacheEntries); COccurrenceUnsatisfiableCacheEntry *nextAddingCacheEntry = cacheHash->value(*item,nullptr); // test to add additional cache entries if (nextAddingCacheEntry) { if (nextAddingCacheEntry->isUnsatisfiableTermination()) { unsatisfiable = true; QList* unsatValList = nextAddingCacheEntry->getCacheTerminationValuesList(); if (unsatValList) { CXLinker* unsatCacheItemLinker = cacheValueTestLinker; CXLinker* lastUnsatCacheItemLinker = nullptr; CXLinker* firstUnsatCacheItemLinker = nullptr; for (QList::const_iterator unsatItemIt = unsatValList->constBegin(), unsatItemItEnd = unsatValList->constEnd(); unsatItemIt != unsatItemItEnd; ++unsatItemIt) { while (*unsatCacheItemLinker->getData() != *unsatItemIt) { unsatCacheItemLinker = unsatCacheItemLinker->getNext(); } if (!firstUnsatCacheItemLinker) { firstUnsatCacheItemLinker = unsatCacheItemLinker; } else { lastUnsatCacheItemLinker->setNext(unsatCacheItemLinker); } lastUnsatCacheItemLinker = unsatCacheItemLinker; } lastUnsatCacheItemLinker->clearNext(); return firstUnsatCacheItemLinker; } else { return cacheValueTestLinker; } } nextCacheEntries = CObjectAllocator< CXLinker >::allocateAndConstruct(memMan)->initLinker(nextAddingCacheEntry,nextCacheEntries); } } } cacheEntries = nextCacheEntries; nextCacheEntries = nullptr; testCacheItemIt = testCacheItemIt->getNext(); } } return nullptr; } cint64 COccurrenceUnsatisfiableCacheReader::getCurrentCachingTag() { return cache->getCurrentCachingTag(); } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntry.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntry.0000644000175000017500000000772312520551040032137 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureSatisfiableExpanderCacheEntry.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSignatureSatisfiableExpanderCacheEntry::CSignatureSatisfiableExpanderCacheEntry(CSignatureSatisfiableExpanderCacheContext* context) : mContext(context) { mDetExpandValueLinker = nullptr; mExpandBranchedLinker = nullptr; mTagExpanderCacheValueHash = nullptr; mDetExpandCount = 0; mSatisfiable = false; mSatisfiableWithoutBranchedConcept = false; mMultipleExpanded = false; } CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheEntry::appendExpanderCacheValueLinker(CExpanderCacheValueLinker* linker) { CExpanderCacheValueLinker* linkerIt = linker; while (linkerIt) { ++mDetExpandCount; linkerIt = linkerIt->getNext(); } if (!mDetExpandValueLinker) { mDetExpandValueLinker = linker; } else { mDetExpandValueLinker->append(linker); } return this; } CExpanderCacheValueLinker* CSignatureSatisfiableExpanderCacheEntry::getExpanderCacheValueLinker() { return mDetExpandValueLinker; } CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheEntry::appendExpanderBranchedLinker(CExpanderBranchedLinker* linker) { if (mExpandBranchedLinker) { mExpandBranchedLinker = linker->append(mExpandBranchedLinker); } else { mExpandBranchedLinker = linker; } return this; } CExpanderBranchedLinker* CSignatureSatisfiableExpanderCacheEntry::getExpanderBranchedLinker() { return mExpandBranchedLinker; } CCACHINGHASH* CSignatureSatisfiableExpanderCacheEntry::getTagExpanderCacheValueHash() { return mTagExpanderCacheValueHash; } CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheEntry::setTagExpanderCacheValueHash(CCACHINGHASH* hash) { mTagExpanderCacheValueHash = hash; return this; } cint64 CSignatureSatisfiableExpanderCacheEntry::getExpanderCacheValueCount() { return mDetExpandCount; } bool CSignatureSatisfiableExpanderCacheEntry::isSatisfiable() { return mSatisfiable; } CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheEntry::setSatisfiable(bool satisfiable) { mSatisfiable = satisfiable; return this; } bool CSignatureSatisfiableExpanderCacheEntry::isSatisfiableWithoutBranchedConcepts() { return mSatisfiableWithoutBranchedConcept; } CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheEntry::setSatisfiableWithoutBranchedConcepts(bool sat) { mSatisfiableWithoutBranchedConcept = sat; return this; } bool CSignatureSatisfiableExpanderCacheEntry::hasMultipleExpanded() { return mMultipleExpanded; } CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheEntry::setMultipleExpanded(bool expanded) { mMultipleExpanded = expanded; return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheReader.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheReader.0000644000175000017500000002316212520551022032075 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryCacheReader.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryCacheReader::CBackendRepresentativeMemoryCacheReader() : CLinkerBase(this) { mCurrentSlot = nullptr; } CBackendRepresentativeMemoryCacheReader* CBackendRepresentativeMemoryCacheReader::updateSlot(CBackendRepresentativeMemoryCacheSlotItem* updatedSlot) { CBackendRepresentativeMemoryCacheSlotItem* prevSlot = mUpdatedSlot.fetchAndStoreOrdered(updatedSlot); if (prevSlot != nullptr) { prevSlot->decReader(); } return this; } bool CBackendRepresentativeMemoryCacheReader::hasUpdatedSlotItem() { return mUpdatedSlot.fetchAndAddRelaxed(0) != nullptr; } bool CBackendRepresentativeMemoryCacheReader::switchToUpdatedSlotItem() { CBackendRepresentativeMemoryCacheSlotItem* updatedSlot = mUpdatedSlot.fetchAndStoreOrdered(nullptr); if (updatedSlot) { CBackendRepresentativeMemoryCacheSlotItem* prevSlot = mCurrentSlot; mCurrentSlot = updatedSlot; if (prevSlot != nullptr) { prevSlot->decReader(); } return true; } return false; } bool CBackendRepresentativeMemoryCacheReader::hasCacheEntry(cint64 signature) { if (hasUpdatedSlotItem()) { switchToUpdatedSlotItem(); } if (mCurrentSlot) { CCACHINGHASH* sigItemHash = mCurrentSlot->getSignatureLabelItemHash(); if (sigItemHash) { return sigItemHash->contains(signature); } } return false; } CBackendRepresentativeMemoryLabelSignatureResolveCacheItem* CBackendRepresentativeMemoryCacheReader::getLabelCacheEntry(cint64 signature) { CBackendRepresentativeMemoryLabelSignatureResolveCacheItem* entry = nullptr; if (hasUpdatedSlotItem()) { switchToUpdatedSlotItem(); } if (mCurrentSlot) { CCACHINGHASH* sigItemHash = mCurrentSlot->getSignatureLabelItemHash(); if (sigItemHash) { entry = sigItemHash->value(signature,nullptr); } } return entry; } CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem* CBackendRepresentativeMemoryCacheReader::getCardinalityCacheEntry(cint64 signature) { CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem* entry = nullptr; if (hasUpdatedSlotItem()) { switchToUpdatedSlotItem(); } if (mCurrentSlot) { CCACHINGHASH* sigItemHash = mCurrentSlot->getSignatureCardinalityItemHash(); if (sigItemHash) { entry = sigItemHash->value(signature,nullptr); } } return entry; } CBackendRepresentativeMemoryCacheIndividualAssociationData* CBackendRepresentativeMemoryCacheReader::getIndividualAssociation(CIndividual* individual) { CBackendRepresentativeMemoryCacheIndividualAssociationData* assData = nullptr; CIndividualProcessData* indiProData = (CIndividualProcessData*)individual->getIndividualData(); if (indiProData) { assData = (CBackendRepresentativeMemoryCacheIndividualAssociationData*)indiProData->getBackendCachingData(); } return assData; } const CCacheValue CBackendRepresentativeMemoryCacheReader::getCacheValue(CConcept* concept, bool negation) { cint64 conTag = concept->getConceptTag(); CCacheValue::CACHEVALUEIDENTIFIER cacheValueIdentifier = CCacheValue::CACHEVALTAGANDCONCEPT; if (negation) { cacheValueIdentifier = CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; } CCacheValue cacheValue; cacheValue.initCacheValue(conTag,(cint64)concept,cacheValueIdentifier); return cacheValue; } const CCacheValue CBackendRepresentativeMemoryCacheReader::getCacheValue(CRole* role) { cint64 roleTag = role->getRoleTag(); CCacheValue::CACHEVALUEIDENTIFIER cacheValueIdentifier = CCacheValue::CACHEVALTAGANDROLE; CCacheValue cacheValue; cacheValue.initCacheValue(roleTag,(cint64)role,cacheValueIdentifier); return cacheValue; } CBackendRepresentativeMemoryLabelCacheItem* CBackendRepresentativeMemoryCacheReader::getLabelCacheEntry(cint64 signature, cint64 conCount, CConceptSaturationDescriptor* conDesLinker) { CBackendRepresentativeMemoryLabelCacheItem* labelItem = nullptr; CBackendRepresentativeMemoryLabelSignatureResolveCacheItem* sigResEntry = getLabelCacheEntry(signature); if (sigResEntry) { for (CBackendRepresentativeMemoryLabelCacheItem* itemIt = sigResEntry->getLabelItems(); itemIt && !labelItem; itemIt = itemIt->getNext()) { if (itemIt->getDeterministicCacheValueCount() == conCount) { bool compatible = true; CCACHINGHASH* cacheValueHash = itemIt->getDeterministicTagCacheValueHash(false); for (CConceptSaturationDescriptor* conDesIt = conDesLinker; conDesIt && compatible; conDesIt = conDesIt->getNext()) { cint64 conTag = conDesIt->getConceptTag(); CConcept* concept = conDesIt->getConcept(); bool negation = conDesIt->isNegated(); CBackendRepresentativeMemoryLabelValueLinker* labelValueLinker = cacheValueHash->value(conTag); if (!labelValueLinker || labelValueLinker->getCacheValue() != getCacheValue(concept,negation)) { compatible = false; } } if (compatible) { labelItem = itemIt; } } } } return labelItem; } CBackendRepresentativeMemoryLabelCacheItem* CBackendRepresentativeMemoryCacheReader::getLabelCacheEntry(cint64 signature, cint64 conCount, CConceptDescriptor* conDesLinker, CConcept* exceptionConcept) { CBackendRepresentativeMemoryLabelCacheItem* labelItem = nullptr; CBackendRepresentativeMemoryLabelSignatureResolveCacheItem* sigResEntry = getLabelCacheEntry(signature); if (sigResEntry) { for (CBackendRepresentativeMemoryLabelCacheItem* itemIt = sigResEntry->getLabelItems(); itemIt && !labelItem; itemIt = itemIt->getNext()) { if (itemIt->getDeterministicCacheValueCount() == conCount) { bool compatible = true; CCACHINGHASH* cacheValueHash = itemIt->getDeterministicTagCacheValueHash(false); for (CConceptDescriptor* conDesIt = conDesLinker; conDesIt && compatible; conDesIt = conDesIt->getNext()) { cint64 conTag = conDesIt->getConceptTag(); CConcept* concept = conDesIt->getConcept(); bool negation = conDesIt->isNegated(); if (concept != exceptionConcept) { CBackendRepresentativeMemoryLabelValueLinker* labelValueLinker = cacheValueHash->value(conTag); if (!labelValueLinker || labelValueLinker->getCacheValue() != getCacheValue(concept,negation)) { compatible = false; } } } if (compatible) { labelItem = itemIt; } } } } return labelItem; } CBackendRepresentativeMemoryCardinalityCacheItem* CBackendRepresentativeMemoryCacheReader::getCardinalityCacheEntry(cint64 signature, CPROCESSHASH* roleFreeCardHash) { CBackendRepresentativeMemoryCardinalityCacheItem* labelItem = nullptr; CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem* sigResEntry = getCardinalityCacheEntry(signature); if (sigResEntry) { cint64 roleCardCount = roleFreeCardHash->size(); for (CBackendRepresentativeMemoryCardinalityCacheItem* itemIt = sigResEntry->getCardinalityCacheItems(); itemIt && !labelItem; itemIt = itemIt->getNext()) { if (itemIt->getCardinalityCacheValueCount() == roleCardCount) { bool compatible = true; CCACHINGHASH* cacheValueHash = itemIt->getTagCardinalityCacheValueHash(false); for (CPROCESSHASH::const_iterator it = roleFreeCardHash->constBegin(), itEnd = roleFreeCardHash->constEnd(); it != itEnd; ++it) { CRole* role(it.key()); cint64 freeCard(it.value()); cint64 roleTag = role->getRoleTag(); CBackendRepresentativeMemoryCardinalityValueLinker* cardValueLinker = cacheValueHash->value(roleTag); if (!cardValueLinker || cardValueLinker->getCacheValue() != getCacheValue(role) || cardValueLinker->getFreeCardinality() != freeCard) { compatible = false; } } if (compatible) { labelItem = itemIt; } } } } return labelItem; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheContextHandler.cpp0000644000175000017500000006673512405707542026767 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCacheHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CCacheHandler::CCacheHandler(CSatisfiableCacheReader *satCacheReader, CUnsatisfiableCacheReader *unsatCacheReader, CSatisfiableCacheWriter *satCacheWriter, CUnsatisfiableCacheWriter *unsatCacheWriter) { satReader = satCacheReader; unsatReader = unsatCacheReader; satWriter = satCacheWriter; unsatWriter = unsatCacheWriter; incUnsatReader = 0; incSatReader = 0; lastMergingPrimClash = false; if (unsatReader) { incUnsatReader = dynamic_cast(unsatReader); } if (satReader) { incSatReader = dynamic_cast(satReader); } } CCacheHandler::~CCacheHandler() { } bool CCacheHandler::isSatisfiable(QVector &itemVec, qint64 count) { return satReader->isSatisfiable(itemVec,count); } bool CCacheHandler::getSatisfiableOutcome(QVector &itemVec, qint64 count, QList *outcomeList) { return satReader->getSatisfiableOutcome(itemVec,count,outcomeList); } bool CCacheHandler::isUnsatisfiable(QVector &itemVec, qint64 count) { return unsatReader->isUnsatisfiable(itemVec,count); } QList CCacheHandler::getUnsatisfiableItems(QVector &itemVec, qint64 count) { return unsatReader->getUnsatisfiableItems(itemVec,count); } void CCacheHandler::setSatisfiable(QVector &itemVec, qint64 itemCount, QVector &outcomeVec, qint64 outCount) { if (satWriter) { satWriter->setSatisfiable(itemVec,itemCount,outcomeVec,outCount); } } void CCacheHandler::setUnsatisfiable(QVector &itemVec, qint64 count, QVector &clashVec, qint64 clashCount) { return unsatWriter->setUnsatisfiable(itemVec,count,clashVec,clashCount); } bool CCacheHandler::isSatisfiable(CConceptSet *conceptSet) { return CSatisfiableCacheReader::isSatisfiable(conceptSet); } bool CCacheHandler::getSatisfiableOutcome(CConceptSet *conceptSet, QList *outcomeList) { return CSatisfiableCacheReader::getSatisfiableOutcome(conceptSet,outcomeList); } bool CCacheHandler::isUnsatisfiable(CConceptSet *conceptSet) { return CUnsatisfiableCacheReader::isUnsatisfiable(conceptSet); } bool CCacheHandler::isUnsatisfiable(QList &conDesNegLinkerList) { return CUnsatisfiableCacheReader::isUnsatisfiable(conDesNegLinkerList); } bool CCacheHandler::isUnsatisfiableIndividualPreferIncrementalTesting(CIndividualProcessBase *indi, QList > *sortedAddConceptsList, qint64 *maximalIndividualAncestorTestCount) { if (incUnsatReader) { incUnsatReader->incrementUnsatisfiableTestReset(); CConceptSetIterator *conSetIt = indi->getConceptSetBase()->getConceptSetIterator(); bool continueTesting = true; bool unsatisfiable = false; QList >::const_iterator addConIt = sortedAddConceptsList->constBegin(), addConItEnd = sortedAddConceptsList->constEnd(); CConcept *addConcept = 0; CConcept *lastAddConcept = 0; bool addConceptNegation = false; bool lastAddConceptNegation = false; if (addConIt != addConItEnd) { addConcept = addConIt->first; addConceptNegation = addConIt->second; ++addConIt; } while (conSetIt->hasValue() && continueTesting && !unsatisfiable) { CConceptDescriptorLinker *conDesLinker = **conSetIt; if (addConcept && conDesLinker->getConceptTag() >= addConcept->getConceptTag()) { bool addConUnsatisfiable = false; if (addConcept->getConceptTag() == conDesLinker->getConceptTag()) { if (addConceptNegation != conDesLinker->isNegated()) { lastMergingPrimClash = true; addConUnsatisfiable = true; } } if (!addConUnsatisfiable) { CConceptDescriptorLinker addConDesLinker; addConDesLinker.init(addConcept,addConceptNegation); addConUnsatisfiable = incUnsatReader->incrementUnsatisfiableTest(&addConDesLinker,&continueTesting); } if (addConUnsatisfiable) { unsatisfiable = true; } addConcept = 0; if (addConIt != addConItEnd) { lastAddConcept = addConcept; lastAddConceptNegation = addConceptNegation; addConcept = addConIt->first; addConceptNegation = addConIt->second; if (addConcept && lastAddConcept && lastAddConcept->getConceptTag() == addConcept->getConceptTag()) { if (addConceptNegation != lastAddConceptNegation) { lastMergingPrimClash = true; unsatisfiable = true; } } ++addConIt; } } else { unsatisfiable &= incUnsatReader->incrementUnsatisfiableTest(conDesLinker,&continueTesting); conSetIt->next(); } } delete conSetIt; while (addConcept && addConIt != addConItEnd && continueTesting && !unsatisfiable) { CConceptDescriptorLinker addConDesLinker; addConDesLinker.init(addConcept,addConceptNegation); bool addConUnsatisfiable = incUnsatReader->incrementUnsatisfiableTest(&addConDesLinker,&continueTesting); if (addConUnsatisfiable) { unsatisfiable = true; } addConcept = 0; if (addConIt != addConItEnd) { lastAddConcept = addConcept; lastAddConceptNegation = addConceptNegation; addConcept = addConIt->first; addConceptNegation = addConIt->second; if (addConcept && lastAddConcept && lastAddConcept->getConceptTag() == addConcept->getConceptTag()) { if (addConceptNegation != lastAddConceptNegation) { lastMergingPrimClash = true; unsatisfiable = true; } } ++addConIt; } } if (maximalIndividualAncestorTestCount) { *maximalIndividualAncestorTestCount = 1; } return unsatisfiable; } else if (unsatReader) { unsatReader->isUnsatisfiable(indi->getConceptSetBase()); } return false; } QList CCacheHandler::getIndividualUnsatisfiableConceptDescriptionLinkers(CIndividualProcessBase *indi, QList *sortedAddConceptsList, qint64 maximalIndividualAncestorTestCount, bool restartTesting) { QList conDesLinkerList; QList unsatCacheItemsList; if (restartTesting || lastMergingPrimClash) { bool incUnsatCacheTesting = incUnsatReader != 0 && !lastMergingPrimClash; bool unsatisfiable = false; lastMergingPrimClash = false; conDesLinkerList.clear(); if (incUnsatReader) { incUnsatReader->incrementUnsatisfiableTestReset(); } CConceptSetIterator *conSetIt = indi->getConceptSetBase()->getConceptSetIterator(); bool continueTesting = true; QList::const_iterator addConIt = sortedAddConceptsList->constBegin(), addConItEnd = sortedAddConceptsList->constEnd(); CConceptDescriptorLinker *addConceptDesLinker = 0; CConceptDescriptorLinker *lastAddConceptDesLinker = 0; if (addConIt != addConItEnd) { addConceptDesLinker = *addConIt; ++addConIt; } while (conSetIt->hasValue() && continueTesting && !unsatisfiable) { CConceptDescriptorLinker *conDesLinker = **conSetIt; if (addConceptDesLinker && conDesLinker->getConceptTag() >= addConceptDesLinker->getConceptTag()) { bool addConUnsatisfiable = false; if (conDesLinker->getConceptTag() == addConceptDesLinker->getConceptTag()) { if (conDesLinker->isNegated() != addConceptDesLinker->isNegated()) { addConUnsatisfiable = true; conDesLinkerList.append(conDesLinker); conDesLinkerList.append(addConceptDesLinker); lastMergingPrimClash = true; unsatisfiable = true; } } if (!addConUnsatisfiable && incUnsatCacheTesting) { addConUnsatisfiable = incUnsatReader->incrementUnsatisfiableTest(addConceptDesLinker,&continueTesting); if (addConUnsatisfiable) { unsatCacheItemsList = incUnsatReader->getIncrementalTestedUnsatisfiableItems(); unsatisfiable = true; } } addConceptDesLinker = 0; if (addConIt != addConItEnd) { lastAddConceptDesLinker = addConceptDesLinker; addConceptDesLinker = *addConIt; if (addConceptDesLinker && lastAddConceptDesLinker && lastAddConceptDesLinker->getConceptTag() == addConceptDesLinker->getConceptTag()) { if (addConceptDesLinker->isNegated() != lastAddConceptDesLinker->isNegated()) { lastMergingPrimClashList.append(lastAddConceptDesLinker); lastMergingPrimClashList.append(addConceptDesLinker); lastMergingPrimClash = true; unsatisfiable = true; } } ++addConIt; } } else { if (incUnsatCacheTesting) { unsatisfiable = incUnsatReader->incrementUnsatisfiableTest(conDesLinker,&continueTesting); if (unsatisfiable) { unsatCacheItemsList = incUnsatReader->getIncrementalTestedUnsatisfiableItems(); unsatisfiable = true; } } conSetIt->next(); } } delete conSetIt; while (addConceptDesLinker && addConIt != addConItEnd && continueTesting && !unsatisfiable) { bool addConUnsatisfiable = incUnsatReader->incrementUnsatisfiableTest(addConceptDesLinker,&continueTesting); if (addConUnsatisfiable) { unsatCacheItemsList = incUnsatReader->getIncrementalTestedUnsatisfiableItems(); unsatisfiable = true; } addConceptDesLinker = 0; if (addConIt != addConItEnd) { lastAddConceptDesLinker = addConceptDesLinker; addConceptDesLinker = *addConIt; if (addConceptDesLinker && lastAddConceptDesLinker && lastAddConceptDesLinker->getConceptTag() == addConceptDesLinker->getConceptTag()) { if (addConceptDesLinker->isNegated() != lastAddConceptDesLinker->isNegated()) { lastMergingPrimClashList.append(lastAddConceptDesLinker); lastMergingPrimClashList.append(addConceptDesLinker); lastMergingPrimClash = true; unsatisfiable = true; } } ++addConIt; } } } else if (incUnsatReader) { unsatCacheItemsList = incUnsatReader->getLastTestedUnsatisfiableItems(); } if (!lastMergingPrimClash) { conDesLinkerList = CUnsatisfiableCacheReader::cacheTrans.backTranslate(indi,sortedAddConceptsList,unsatCacheItemsList); } else { conDesLinkerList = lastMergingPrimClashList; } return conDesLinkerList; } bool CCacheHandler::isUnsatisfiableIndividualPreferIncrementalTesting(CIndividualProcessBase *indi, CConcept *additionalConcept, bool additionalConceptNegation, qint64 *maximalIndividualAncestorTestCount ) { if (incUnsatReader) { incUnsatReader->incrementUnsatisfiableTestReset(); CConceptSetIterator *conSetIt = indi->getConceptSetBase()->getConceptSetIterator(); bool continueTesting = true; bool unsatisfiable = false; bool addConTested = false; while (conSetIt->hasValue() && continueTesting && !unsatisfiable) { CConceptDescriptorLinker *conDesLinker = **conSetIt; if (conDesLinker->getConceptTag() > additionalConcept->getConceptTag()) { CConceptDescriptorLinker addConDesLinker; addConDesLinker.init(additionalConcept,additionalConceptNegation); bool addConUnsatisfiable = incUnsatReader->incrementUnsatisfiableTest(&addConDesLinker,&continueTesting); if (addConUnsatisfiable) { unsatisfiable = true; } addConTested = true; } if (continueTesting) { unsatisfiable &= incUnsatReader->incrementUnsatisfiableTest(conDesLinker,&continueTesting); } conSetIt->next(); } delete conSetIt; if (!addConTested && !unsatisfiable) { CConceptDescriptorLinker addConDesLinker; addConDesLinker.init(additionalConcept,additionalConceptNegation); bool addConUnsatisfiable = incUnsatReader->incrementUnsatisfiableTest(&addConDesLinker,&continueTesting); if (addConUnsatisfiable) { return true; } } if (maximalIndividualAncestorTestCount) { *maximalIndividualAncestorTestCount = 1; } return unsatisfiable; } else if (unsatReader) { unsatReader->isUnsatisfiable(indi->getConceptSetBase()); } return false; } bool CCacheHandler::isSatisfiableIndividualPreferIncrementalTesting(CIndividualProcessBase *indi) { bool satisfiable = false; if (incSatReader) { incSatReader->incrementSatisfiableTestReset(); CConceptSetIterator *conSetIt = indi->getConceptSetBase()->getConceptSetIterator(); bool continueTesting = true; while (conSetIt->hasValue() && continueTesting && !satisfiable) { CConceptDescriptorLinker *conDesLinker = **conSetIt; satisfiable = incSatReader->incrementSatisfiableTest(conDesLinker,&continueTesting); conSetIt->next(); } delete conSetIt; } else if (satReader) { satisfiable = satReader->isSatisfiable(indi->getConceptSetBase()); } return satisfiable; } bool CCacheHandler::isSatisfiableIndividual(CIndividualProcessBase *indi) { bool satisfiable = false; if (satReader) { satisfiable = satReader->isSatisfiable(indi->getConceptSetBase()); if (satisfiable) { QList outList; satisfiable = satReader->getSatisfiableOutcome(indi->getConceptSetBase(),&outList); if (satisfiable && !outList.isEmpty()) { bool foundPossInverseNotSat = false; CLink *ancLink = indi->getAncestorLink(); if (ancLink) { CSortedNegLinker *ancRoleIt = ancLink->getRoleLinker(); for (QList::const_iterator it = outList.constBegin(), itEnd = outList.constEnd(); it != itEnd && !foundPossInverseNotSat; ++it) { CCacheValue cacheValue(*it); if (cacheValue.isCachedRole()) { qint64 roleTag = cacheValue.getTag(); qint64 ontTag = cacheValue.getOntology(); CSortedNegLinker *testRoleIt = ancRoleIt; while (testRoleIt && !foundPossInverseNotSat) { CRole *role = testRoleIt->getData(); if (role->getRoleTag() == roleTag && role->getTerminologyTag() == ontTag) { foundPossInverseNotSat = true; break; } testRoleIt = testRoleIt->getNext(); } } } } if (foundPossInverseNotSat) { satisfiable = false; } } } } return satisfiable; } bool CCacheHandler::isUnsatisfiableIndividualPreferIncrementalTesting(CIndividualProcessBase *indi, qint64 *maximalIndividualAncestorTestCount) { bool unsatisfiable = false; if (incUnsatReader) { incUnsatReader->incrementUnsatisfiableTestReset(); CConceptSetIterator *conSetIt = indi->getConceptSetBase()->getConceptSetIterator(); bool continueTesting = true; while (conSetIt->hasValue() && continueTesting && !unsatisfiable) { CConceptDescriptorLinker *conDesLinker = **conSetIt; unsatisfiable = incUnsatReader->incrementUnsatisfiableTest(conDesLinker,&continueTesting); conSetIt->next(); } delete conSetIt; if (maximalIndividualAncestorTestCount) { *maximalIndividualAncestorTestCount = 1; } } else if (unsatReader) { unsatisfiable = unsatReader->isUnsatisfiable(indi->getConceptSetBase()); } return unsatisfiable; } bool CCacheHandler::isIndividualMergingUnsatisfiable(CIndividualProcessBase *indi1, CIndividualProcessBase *indi2) { CConceptSetBase *conSet1 = indi1->getConceptSetBase(); CConceptSetBase *conSet2 = indi2->getConceptSetBase(); lastMergingPrimClashList.clear(); lastMergingPrimClash = false; if (incUnsatReader) { incUnsatReader->incrementUnsatisfiableTestReset(); bool mergeable = true; CConceptSetIterator *conIter1 = conSet1->getConceptSetIterator(); CConceptSetIterator *conIter2 = conSet2->getConceptSetIterator(); CConceptDescriptorLinker *conDesLinker1 = 0; CConceptDescriptorLinker *conDesLinker2 = 0; if (conIter1->hasValue()) { conDesLinker1 = **conIter1; conIter1->next(); } if (conIter2->hasValue()) { conDesLinker2 = **conIter2; conIter2->next(); } bool continueTesting = true; while (conDesLinker1 && mergeable) { CConcept *con1 = conDesLinker1->getData(); qint64 conTag1 = con1->getConceptTag(); bool hasThisTag = false; while (conDesLinker2 && mergeable) { CConcept *con2 = conDesLinker2->getData(); qint64 conTag2 = con2->getConceptTag(); if (conTag2 == conTag1) { if (conDesLinker1->isNegated() == conDesLinker2->isNegated()) { hasThisTag = true; break; } else { mergeable = false; hasThisTag = true; lastMergingPrimClashList.append(conDesLinker1); lastMergingPrimClashList.append(conDesLinker2); lastMergingPrimClash = true; break; } } else if (conTag2 > conTag1) { hasThisTag = false; break; } else if (conTag2 < conTag1) { if (continueTesting) { mergeable &= !incUnsatReader->incrementUnsatisfiableTest(conDesLinker2,&continueTesting); } if (conIter2->hasValue()) { conDesLinker2 = **conIter2; conIter2->next(); } else { conDesLinker2 = 0; } } } if (!hasThisTag && continueTesting) { mergeable &= !incUnsatReader->incrementUnsatisfiableTest(conDesLinker1,&continueTesting); } if (conIter1->hasValue()) { conDesLinker1 = **conIter1; conIter1->next(); } else { conDesLinker1 = 0; } } while (incUnsatReader && continueTesting && mergeable && conDesLinker2) { mergeable &= !incUnsatReader->incrementUnsatisfiableTest(conDesLinker2,&continueTesting); if (conIter2->hasValue()) { conDesLinker2 = **conIter2; conIter2->next(); } else { conDesLinker2 = 0; } } delete conIter1; delete conIter2; return !mergeable; } else { return !CConceptSet::isMergeableWithoutClash(conSet1,conSet2); } return false; } QList CCacheHandler::getIndividualMergingUnsatisfiableItems(CIndividualProcessBase *indi1, CIndividualProcessBase *indi2, bool restartTesting) { QList conDesLinkerList; bool clashCached = false; QList cacheItems; if (!incUnsatReader || restartTesting) { if (incUnsatReader) { incUnsatReader->incrementUnsatisfiableTestReset(); } lastMergingPrimClash = false; lastMergingPrimClashList.clear(); CConceptSetBase *conSet1 = indi1->getConceptSetBase(); CConceptSetBase *conSet2 = indi2->getConceptSetBase(); bool mergeable = true; CConceptSetIterator *conIter1 = conSet1->getConceptSetIterator(); CConceptSetIterator *conIter2 = conSet2->getConceptSetIterator(); CConceptDescriptorLinker *conDesLinker1 = 0; CConceptDescriptorLinker *conDesLinker2 = 0; if (conIter1->hasValue()) { conDesLinker1 = **conIter1; conIter1->next(); } if (conIter2->hasValue()) { conDesLinker2 = **conIter2; conIter2->next(); } bool continueTesting = true; while (conDesLinker1 && mergeable) { CConcept *con1 = conDesLinker1->getData(); qint64 conTag1 = con1->getConceptTag(); bool hasThisTag = false; while (conDesLinker2 && mergeable) { CConcept *con2 = conDesLinker2->getData(); qint64 conTag2 = con2->getConceptTag(); if (conTag2 == conTag1) { if (conDesLinker1->isNegated() == conDesLinker2->isNegated()) { hasThisTag = true; break; } else { mergeable = false; lastMergingPrimClashList.append(conDesLinker1); lastMergingPrimClashList.append(conDesLinker2); lastMergingPrimClash = true; hasThisTag = true; break; } } else if (conTag2 > conTag1) { hasThisTag = false; break; } else if (conTag2 < conTag1) { if (continueTesting) { clashCached |= incUnsatReader->incrementUnsatisfiableTest(conDesLinker2,&continueTesting); mergeable &= !clashCached; } if (conIter2->hasValue()) { conDesLinker2 = **conIter2; conIter2->next(); } else { conDesLinker2 = 0; } } } if (!hasThisTag && continueTesting && incUnsatReader) { clashCached |= incUnsatReader->incrementUnsatisfiableTest(conDesLinker1,&continueTesting); mergeable &= !clashCached; } if (conIter1->hasValue()) { conDesLinker1 = **conIter1; conIter1->next(); } else { conDesLinker1 = 0; } } while (incUnsatReader && continueTesting && mergeable && conDesLinker2) { clashCached |= incUnsatReader->incrementUnsatisfiableTest(conDesLinker2,&continueTesting); mergeable &= !clashCached; if (conIter2->hasValue()) { conDesLinker2 = **conIter2; conIter2->next(); } else { conDesLinker2 = 0; } } delete conIter1; delete conIter2; if (clashCached && incUnsatReader) { cacheItems = incUnsatReader->getIncrementalTestedUnsatisfiableItems(); conDesLinkerList = CUnsatisfiableCacheReader::cacheTrans.backTranslate(indi1,indi2,cacheItems); } else if (lastMergingPrimClash) { conDesLinkerList = lastMergingPrimClashList; } } else if (!restartTesting && incUnsatReader) { if (lastMergingPrimClash) { conDesLinkerList = lastMergingPrimClashList; } else { cacheItems = incUnsatReader->getLastTestedUnsatisfiableItems(); conDesLinkerList = CUnsatisfiableCacheReader::cacheTrans.backTranslate(indi1,indi2,cacheItems); } } return conDesLinkerList; } QList CCacheHandler::getIndividualUnsatisfiableConceptDescriptionLinkers(CIndividualProcessBase *indi, qint64 maximalIndividualAncestorTestCount, bool restartTesting) { QList cacheItems; if (restartTesting || !incUnsatReader) { cacheItems = unsatReader->getUnsatisfiableItems(indi->getConceptSetBase()); } else { cacheItems = incUnsatReader->getLastTestedUnsatisfiableItems(); } QList conDesLinkerList = CUnsatisfiableCacheReader::cacheTrans.backTranslate(indi,cacheItems); return conDesLinkerList; } QList CCacheHandler::getIndividualUnsatisfiableConceptDescriptionLinkers(CIndividualProcessBase *indi, CConceptDescriptorLinker *addConDesLinker, qint64 maximalIndividualAncestorTestCount, bool restartTesting) { QList conDesLinkerList; QList unsatCacheItemsList; if (incUnsatReader) { if (restartTesting) { bool unsatisfiable = false; incUnsatReader->incrementUnsatisfiableTestReset(); CConceptSetIterator *conSetIt = indi->getConceptSetBase()->getConceptSetIterator(); bool continueTesting = true; bool addConTested = false; while (conSetIt->hasValue() && continueTesting && !unsatisfiable) { CConceptDescriptorLinker *conDesLinker = **conSetIt; if (conDesLinker->getConceptTag() > addConDesLinker->getConceptTag()) { bool addConUnsatisfiable = incUnsatReader->incrementUnsatisfiableTest(addConDesLinker,&continueTesting); if (addConUnsatisfiable) { unsatCacheItemsList = incUnsatReader->getIncrementalTestedUnsatisfiableItems(); unsatisfiable = true; } addConTested = true; } if (continueTesting) { unsatisfiable = incUnsatReader->incrementUnsatisfiableTest(conDesLinker,&continueTesting); if (unsatisfiable) { unsatCacheItemsList = incUnsatReader->getIncrementalTestedUnsatisfiableItems(); unsatisfiable = true; } } conSetIt->next(); } delete conSetIt; if (!addConTested) { bool addConUnsatisfiable = incUnsatReader->incrementUnsatisfiableTest(addConDesLinker,&continueTesting); if (addConUnsatisfiable) { unsatCacheItemsList = incUnsatReader->getIncrementalTestedUnsatisfiableItems(); unsatisfiable = true; } } } else { unsatCacheItemsList = incUnsatReader->getLastTestedUnsatisfiableItems(); } } else if (unsatReader) { unsatCacheItemsList = unsatReader->getUnsatisfiableItems(indi->getConceptSetBase()); } conDesLinkerList = CUnsatisfiableCacheReader::cacheTrans.backTranslate(indi,addConDesLinker,unsatCacheItemsList); return conDesLinkerList; } QList CCacheHandler::getUnsatisfiableItems(CConceptSet *conceptSet) { return CUnsatisfiableCacheReader::getUnsatisfiableItems(conceptSet); } void CCacheHandler::setSatisfiable(CConceptSet *conceptSet) { CSatisfiableCacheWriter::setSatisfiable(conceptSet); } void CCacheHandler::setUnsatisfiable(CConceptSet *conceptSet, CLinker *clashLinker) { CUnsatisfiableCacheWriter::setUnsatisfiable(conceptSet,clashLinker); } void CCacheHandler::setUnsatisfiable(CConceptSet *conceptSet, QList &clashList) { CUnsatisfiableCacheWriter::setUnsatisfiable(conceptSet,clashList); } void CCacheHandler::setUnsatisfiable(CConceptDescriptorLinker *conDesNegLinker, CLinker *clashLinker) { CUnsatisfiableCacheWriter::setUnsatisfiable(conDesNegLinker,clashLinker); } void CCacheHandler::setUnsatisfiable(QList &conDesNegLinkerList, CLinker *clashLinker) { CUnsatisfiableCacheWriter::setUnsatisfiable(conDesNegLinkerList,clashLinker); } void CCacheHandler::setUnsatisfiable(QList *conDesNegLinkerList, QList *clashConceptsList) { CUnsatisfiableCacheWriter::setUnsatisfiable(conDesNegLinkerList,clashConceptsList); } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelCacheItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelCacheIt0000644000175000017500000000731312520551024032133 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYLABELCACHEITEM_H #define KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYLABELCACHEITEM_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "CBackendRepresentativeMemoryCacheContext.h" #include "CBackendRepresentativeMemoryLabelValueLinker.h" // Other includes #include "Utilities/Memory/CObjectParameterizingAllocator.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CBackendRepresentativeMemoryLabelCacheItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBackendRepresentativeMemoryLabelCacheItem : public CLinkerBase { // public methods public: //! Constructor CBackendRepresentativeMemoryLabelCacheItem(CBackendRepresentativeMemoryCacheContext* context); CBackendRepresentativeMemoryLabelCacheItem* initCacheEntry(cint64 signature, cint64 entryID); cint64 getCacheEntryID(); CBackendRepresentativeMemoryLabelCacheItem* setCacheEntryID(cint64 entryID); cint64 getSignature(); CBackendRepresentativeMemoryLabelCacheItem* setSignature(cint64 signature); CBackendRepresentativeMemoryLabelCacheItem* addDeterministicCacheValueLinker(CBackendRepresentativeMemoryLabelValueLinker* linker); CBackendRepresentativeMemoryLabelValueLinker* getDeterministicCacheValueLinker(); CCACHINGHASH* getDeterministicTagCacheValueHash(bool create = false); CBackendRepresentativeMemoryLabelCacheItem* setDeterministicTagCacheValueHash(CCACHINGHASH* hash); cint64 getDeterministicCacheValueCount(); bool isCompletelyHandled(); CBackendRepresentativeMemoryLabelCacheItem* setCompletelyHandled(bool completelyHandled); bool isCompletelySaturated(); CBackendRepresentativeMemoryLabelCacheItem* setCompletelySaturated(bool completelySaturated); // protected methods protected: // protected variables protected: CBackendRepresentativeMemoryCacheContext* mContext; cint64 mSignature; CCACHINGHASH* mDetTagValueHash; CBackendRepresentativeMemoryLabelValueLinker* mDetValueLinker; cint64 mDetValueCount; bool mCompletelyHandled; bool mCompletelySaturated; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CBACKENDREPRESENTATIVEMEMORYLABELCACHEITEM_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedDependentNominalSet.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedDependentNomina0000644000175000017500000000414412520551036032243 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDDEPENDENTNOMINALSET_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDDEPENDENTNOMINALSET_H // Libraries includes // Namespace includes #include "CacheSettings.h" // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSaturationNodeAssociatedDependentNominalSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeAssociatedDependentNominalSet : public CCACHINGSET { // public methods public: //! Constructor CSaturationNodeAssociatedDependentNominalSet(CContext* context); CSaturationNodeAssociatedDependentNominalSet* initDependentNominalSet(); // protected methods protected: // protected variables protected: CContext* mContext; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDDEPENDENTNOMINALSET_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCache.h0000644000175000017500000001231312544355012030266 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHE_H #define KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHE_H // Libraries includes #include #include #include #include #include #include #include // Namespace includes #include "CacheSettings.h" #include "COccurrenceUnsatisfiableCacheReader.h" #include "COccurrenceUnsatisfiableCacheEntry.h" #include "CUnsatisfiableCache.h" #include "CCacheValue.h" #include "COccurrenceUnsatisfiableCacheUpdateSlotItem.h" #include "COccurrenceUnsatisfiableCacheEntriesHash.h" #include "COccurrenceUnsatisfiableCacheWriter.h" #include "CCacheTaggingPool.h" #include "CCacheStatistics.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CConceptTextFormater.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Concurrent/CThread.h" #include "Events/CWriteUnsatisfiableCacheEntryEvent.h" // Logger includes #include "Logger/CLogger.h" #include namespace Konclude { using namespace Concurrent; namespace Reasoner { using namespace Ontology; namespace Kernel { namespace Cache { using namespace Events; #ifdef KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED #define KONCLUCE_OCCURUNSATCACHE_CACHING_STRING_INSTRUCTION(a) #else //#define KONCLUCE_OCCURUNSATCACHE_CACHING_STRING_INSTRUCTION(a) a #define KONCLUCE_OCCURUNSATCACHE_CACHING_STRING_INSTRUCTION(a) #endif /*! * * \class COccurrenceUnsatisfiableCache * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COccurrenceUnsatisfiableCache : public CThread, public CUnsatisfiableCache { // public methods public: //! Constructor COccurrenceUnsatisfiableCache(qint64 writeUpdateSlotCount, const QString &threadIdentifierName = QString("Unsatisfiable-Cache"), CWatchDog *watchDogThread = 0); //! Destructor virtual ~COccurrenceUnsatisfiableCache(); COccurrenceUnsatisfiableCacheReader *getCacheReader(); COccurrenceUnsatisfiableCacheWriter *getCacheWriter(); COccurrenceUnsatisfiableCacheEntry *getPrimarCacheEntry(); void addUnsatisfiableCacheEntry(QList &itemList); bool isCacheWritePending(); cint64 getCurrentCachingTag(); CCacheStatistics* getCacheStatistics(); // protected methods protected: virtual void threadStarted(); virtual void threadStopped(); virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); bool writeCacheTags(CCacheValue* cacheValue, cint64 cachingTag, cint64 cachedTag, cint64 cachingSize); bool writeCacheValues(COccurrenceUnsatisfiableCacheUpdateSlotItem *updateSlot, QList *cacheValueList); bool waitCacheWritePrepared(); bool activateCacheUpdate(COccurrenceUnsatisfiableCacheUpdateSlotItem *updateSlot); QString getCachingConceptsDebugString(QList &itemList); bool testAlreadyCached(COccurrenceUnsatisfiableCacheUpdateSlotItem *updateSlot, QList *cacheValueList); // private methods private: // private variables private: QMutex cacheReaderSyncMutex; QMutex cacheWriterSyncMutex; QList cacheReaderList; QList cacheWriterList; COccurrenceUnsatisfiableCacheEntry *primarCacheEntry; QList container; qint64 updateSlotCount; QVector updatesSlotItemVector; QList usedUpdatesSlotsList; QList notusedUpdatesSlotsList; COccurrenceUnsatisfiableCacheUpdateSlotItem* lastUpdateSlot; QMutex lockFreeMutexSync; bool canGetLockFreeAccess; qint64 lockFreeAccessCount; QSemaphore lockFreeAccessLockSemaphore; bool cacheWritingRequested; qint64 writeOperationsCount; CCacheTaggingPool mCacheTaggingPool; cint64 mCachingTag; CCacheStatistics mCachStat; QString mCachingString; QStringList mCachedStringList; }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_COCCURRENCEUNSATISFIABLECACHE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheModificationTagSet.cpp0000644000175000017500000000355712520551026027543 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCacheModificationTagSet.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CCacheModificationTagSet::CCacheModificationTagSet(CDataArrayMemoryManager *modelMemMan) : tmpDataArrayMemStorer(modelMemMan) { tagSet = 0; } CCacheModificationTagSet::CCacheModificationTagSet(CCacheModificationTagSet *modTagSet, CDataArrayMemoryManager *modelMemMan) : tmpDataArrayMemStorer(modelMemMan) { tagSet = 0; tagSet = CModelDataLevelArray::extendAndCopyModelFrom(tagSet,modTagSet->getModelDataArray(),&tmpDataArrayMemStorer); } CCacheModificationTagSet::~CCacheModificationTagSet() { } CCacheModificationTagSet *CCacheModificationTagSet::addModificationTag(qint64 tag) { tagSet = CModelDataLevelArray::extendAndSetFlag(tagSet,tag,&tmpDataArrayMemStorer); return this; } CModelDataArray *CCacheModificationTagSet::getModelDataArray() { return tagSet; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CExpanderCacheValueLinker.cpp0000644000175000017500000000352312520551030027722 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExpanderCacheValueLinker.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CExpanderCacheValueLinker::CExpanderCacheValueLinker(CSignatureSatisfiableExpanderCacheContext* context) : CLinkerBase(this),mDepList(context) { mContext = context; } CExpanderCacheValueLinker* CExpanderCacheValueLinker::addExpanderDependency(CExpanderCacheValueLinker* depExpCacheValue) { mDepList.append(depExpCacheValue); return this; } CCACHINGLIST* CExpanderCacheValueLinker::getExpanderDependencyList() { return &mDepList; } CCacheValue* CExpanderCacheValueLinker::getCacheValue() { return &mCacheValue; } CExpanderCacheValueLinker* CExpanderCacheValueLinker::setCacheValue(const CCacheValue& cacheValue) { mCacheValue = cacheValue; return this; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CCacheModificationTagSet.h0000644000175000017500000000465112520551026027204 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CCACHEMODIFICATIONTAGSET_H #define KONCLUDE_REASONER_KERNEL_CACHE_CCACHEMODIFICATIONTAGSET_H // Libraries includes // Namespace includes // Other includes #include "Utilities/Container/CModelDataArray.h" #include "Utilities/Container/CModelDataLevelArray.h" #include "Utilities/Container/CDataArrayMemoryManager.h" #include "Utilities/Container/CTemporaryDataArrayMemoryStorer.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CCacheModificationTagSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCacheModificationTagSet { // public methods public: //! Constructor CCacheModificationTagSet(CDataArrayMemoryManager *modelMemMan); CCacheModificationTagSet(CCacheModificationTagSet *modTagSet, CDataArrayMemoryManager *modelMemMan); //! Destructor virtual ~CCacheModificationTagSet(); CCacheModificationTagSet *addModificationTag(qint64 tag); CModelDataArray *getModelDataArray(); // protected methods protected: // protected variables protected: CModelDataArray *tagSet; CTemporaryDataArrayMemoryStorer tmpDataArrayMemStorer; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CCACHEMODIFICATIONTAGSET_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalityCacheItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalityC0000644000175000017500000000721712520551024032244 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBackendRepresentativeMemoryCardinalityCacheItem.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CBackendRepresentativeMemoryCardinalityCacheItem::CBackendRepresentativeMemoryCardinalityCacheItem(CBackendRepresentativeMemoryCacheContext* context) : CLinkerBase(0,nullptr),mContext(context) { } CBackendRepresentativeMemoryCardinalityCacheItem* CBackendRepresentativeMemoryCardinalityCacheItem::initCacheEntry(cint64 signature, cint64 entryID) { setData(entryID); mSignature = signature; mCardinalityValueLinker = nullptr; mTagCardValueHash = nullptr; mCardinalityValueCount = 0; return this; } cint64 CBackendRepresentativeMemoryCardinalityCacheItem::getCacheEntryID() { return getData(); } CBackendRepresentativeMemoryCardinalityCacheItem* CBackendRepresentativeMemoryCardinalityCacheItem::setCacheEntryID(cint64 entryID) { setData(entryID); return this; } cint64 CBackendRepresentativeMemoryCardinalityCacheItem::getSignature() { return mSignature; } CBackendRepresentativeMemoryCardinalityCacheItem* CBackendRepresentativeMemoryCardinalityCacheItem::setSignature(cint64 signature) { mSignature = signature; return this; } CBackendRepresentativeMemoryCardinalityCacheItem* CBackendRepresentativeMemoryCardinalityCacheItem::addCardinalityCacheValueLinker(CBackendRepresentativeMemoryCardinalityValueLinker* linker) { mCardinalityValueCount += linker->getCount(); mCardinalityValueLinker = linker->append(mCardinalityValueLinker); return this; } CBackendRepresentativeMemoryCardinalityValueLinker* CBackendRepresentativeMemoryCardinalityCacheItem::getCardinalityCacheValueLinker() { return mCardinalityValueLinker; } CCACHINGHASH* CBackendRepresentativeMemoryCardinalityCacheItem::getTagCardinalityCacheValueHash(bool create) { if (!mTagCardValueHash && create) { mTagCardValueHash = CObjectParameterizingAllocator< CCACHINGHASH,CContext* >::allocateAndConstructAndParameterize(mContext->getMemoryAllocationManager(),mContext); } return mTagCardValueHash; } CBackendRepresentativeMemoryCardinalityCacheItem* CBackendRepresentativeMemoryCardinalityCacheItem::setTagCardinalityCacheValueHash(CCACHINGHASH* hash) { mTagCardValueHash = hash; return this; } cint64 CBackendRepresentativeMemoryCardinalityCacheItem::getCardinalityCacheValueCount() { return mCardinalityValueCount; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheWriteData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheW0000644000175000017500000000466712520551040032217 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEWRITEDATA_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEWRITEDATA_H // Libraries includes #include // Namespace includes #include "CacheSettings.h" #include "CCacheEntryWriteData.h" #include "CCacheValue.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSaturationNodeAssociatedExpansionCacheWriteData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeAssociatedExpansionCacheWriteData : public CCacheEntryWriteData { // public methods public: //! Constructor CSaturationNodeAssociatedExpansionCacheWriteData(); enum SATURATIONNODEASSOCIATEDEXPANSIONCACHEWRITEDATATYPE { SNAECWT_UNSAT = 1, SNAECWT_EXPAND = 2 }; SATURATIONNODEASSOCIATEDEXPANSIONCACHEWRITEDATATYPE getWriteDataType(); // protected methods protected: // protected variables protected: SATURATIONNODEASSOCIATEDEXPANSIONCACHEWRITEDATATYPE mWriteDataType; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSATURATIONNODEASSOCIATEDEXPANSIONCACHEWRITEDATA_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheRedirectionItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheRedire0000644000175000017500000000356112520551042032170 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSignatureSatisfiableExpanderCacheRedirectionItem.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSignatureSatisfiableExpanderCacheRedirectionItem::CSignatureSatisfiableExpanderCacheRedirectionItem() { } CSignatureSatisfiableExpanderCacheRedirectionItem* CSignatureSatisfiableExpanderCacheRedirectionItem::initRedirectionItem(CSignatureSatisfiableExpanderCacheEntry* cacheEntry, cint64 signature, cint64 expanderCount) { mCacheEntry = cacheEntry; mSignature = signature; mExpCount = expanderCount; return this; } CSignatureSatisfiableExpanderCacheEntry* CSignatureSatisfiableExpanderCacheRedirectionItem::getCacheEntry() { return mCacheEntry; } cint64 CSignatureSatisfiableExpanderCacheRedirectionItem::getSignature() { return mSignature; } cint64 CSignatureSatisfiableExpanderCacheRedirectionItem::getExpanderCount() { return mExpCount; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheReader.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheR0000644000175000017500000000424412520551036032206 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeAssociatedExpansionCacheReader.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CSaturationNodeAssociatedExpansionCacheReader::CSaturationNodeAssociatedExpansionCacheReader() : CLinkerBase(this) { } CSaturationNodeAssociatedExpansionCacheEntry* CSaturationNodeAssociatedExpansionCacheReader::getCacheEntry(CIndividualSaturationProcessNode* saturationNode) { CSaturationNodeAssociatedExpansionCacheEntry* cacheEntry = nullptr; if (saturationNode) { cacheEntry = (CSaturationNodeAssociatedExpansionCacheEntry*)saturationNode->getCacheExpansionData(); } return cacheEntry; } const CCacheValue CSaturationNodeAssociatedExpansionCacheReader::getCacheValue(CConcept* concept, bool negation) { cint64 conTag = concept->getConceptTag(); CCacheValue::CACHEVALUEIDENTIFIER cacheValueIdentifier = CCacheValue::CACHEVALTAGANDCONCEPT; if (negation) { cacheValueIdentifier = CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; } CCacheValue cacheValue; cacheValue.initCacheValue(conTag,(cint64)concept,cacheValueIdentifier); return cacheValue; } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCompatibilityEntryHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCompatibilityEntryH0000644000175000017500000000240312520551034032270 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReuseCompletionGraphCompatibilityEntryHash.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { CReuseCompletionGraphCompatibilityEntryHash::CReuseCompletionGraphCompatibilityEntryHash(CContext* context) : CCACHINGHASH(context) { } }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntry.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntry.0000644000175000017500000000664312520551040032137 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEENTRY_H #define KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEENTRY_H // Libraries includes // Namespace includes #include "CacheSettings.h" #include "CCacheValue.h" #include "CExpanderCacheValueLinker.h" #include "CExpanderBranchedLinker.h" #include "CSignatureSatisfiableExpanderCacheContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Cache { /*! * * \class CSignatureSatisfiableExpanderCacheEntry * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignatureSatisfiableExpanderCacheEntry { // public methods public: //! Constructor CSignatureSatisfiableExpanderCacheEntry(CSignatureSatisfiableExpanderCacheContext* context); CSignatureSatisfiableExpanderCacheEntry* appendExpanderCacheValueLinker(CExpanderCacheValueLinker* linker); CExpanderCacheValueLinker* getExpanderCacheValueLinker(); CSignatureSatisfiableExpanderCacheEntry* appendExpanderBranchedLinker(CExpanderBranchedLinker* linker); CExpanderBranchedLinker* getExpanderBranchedLinker(); CCACHINGHASH* getTagExpanderCacheValueHash(); CSignatureSatisfiableExpanderCacheEntry* setTagExpanderCacheValueHash(CCACHINGHASH* hash); cint64 getExpanderCacheValueCount(); bool isSatisfiable(); CSignatureSatisfiableExpanderCacheEntry* setSatisfiable(bool satisfiable); bool isSatisfiableWithoutBranchedConcepts(); CSignatureSatisfiableExpanderCacheEntry* setSatisfiableWithoutBranchedConcepts(bool sat); bool hasMultipleExpanded(); CSignatureSatisfiableExpanderCacheEntry* setMultipleExpanded(bool expanded); // protected methods protected: // protected variables protected: CSignatureSatisfiableExpanderCacheContext* mContext; CCACHINGHASH* mTagExpanderCacheValueHash; CExpanderCacheValueLinker* mDetExpandValueLinker; CExpanderBranchedLinker* mExpandBranchedLinker; cint64 mDetExpandCount; bool mSatisfiable; bool mSatisfiableWithoutBranchedConcept; bool mMultipleExpanded; // private methods private: // private variables private: }; }; // end namespace Cache }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CACHE_CSIGNATURESATISFIABLEEXPANDERCACHEENTRY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/0000755000175000017500000000000012613407252023210 5ustar jonasjonas././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableConsistencyPreyingAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableConsistencyPreyingAnalys0000644000175000017500000000236412520551012032410 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableConsistencyPreyingAnalyser.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CSatisfiableConsistencyPreyingAnalyser::CSatisfiableConsistencyPreyingAnalyser() { } CSatisfiableConsistencyPreyingAnalyser::~CSatisfiableConsistencyPreyingAnalyser() { } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeXMLValueSpaceHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeXMLValueSpaceH0000644000175000017500000000241112520551012032122 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeXMLValueSpaceHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualProcessNodeXMLValueSpaceHandler::CIndividualProcessNodeXMLValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType) : CIndividualProcessNodeCompareValueSpaceHandler(valueSpaceType) { } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeRealValueSpaceHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeRealValueSpace0000644000175000017500000010173212520551010032241 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeRealValueSpaceHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualProcessNodeRealValueSpaceHandler::CIndividualProcessNodeRealValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType) : CIndividualProcessNodeValueSpaceHandler(valueSpaceType) { mRealValueSpaceType = (CDatatypeValueSpaceRealType*)valueSpaceType; } bool CIndividualProcessNodeRealValueSpaceHandler::addDataLiteral(CIndividualProcessNode* indiProcNode, CDataLiteral* dataLiteral, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CDataLiteralValue* dataLitValue = dataLiteral->getDataLiteralValue(); CDataLiteralRealValue* dataLitRealValue = dynamic_cast(dataLitValue); CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeRealValueSpaceData* realValueSpaceData = datatypesSpaceValue->getRealValueSpace(mRealValueSpaceType,true); bool newValuesPotentiallyExcluded = false; if (!realValueSpaceData->isValueSpaceClashed() && dataLitRealValue) { CDatatypeRealValueSpaceMap* realValueSpaceMap = realValueSpaceData->getValueSpaceMap(true); if (!negated) { newValuesPotentiallyExcluded |= realValueSpaceMap->restrictToValue(dataLitRealValue,depTrackPoint); } else { newValuesPotentiallyExcluded |= realValueSpaceMap->excludeValue(dataLitRealValue,depTrackPoint); } } if (newValuesPotentiallyExcluded) { datatypesSpaceValue->setValueSapceModified(realValueSpaceData); realValueSpaceData->setValueSpaceInitialisationDependencyTrackPointCandidate(depTrackPoint); } return newValuesPotentiallyExcluded; } bool CIndividualProcessNodeRealValueSpaceHandler::addDataRestriction(CIndividualProcessNode* indiProcNode, CConcept* dataRestricionConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CDatatype* datatype = dataRestricionConcept->getDatatype(); cint64 restrictionCode = dataRestricionConcept->getParameter(); CDataLiteral* dataLiteral = dataRestricionConcept->getDataLiteral(); CDataLiteralValue* restrictionDataLitValue = nullptr; if (dataLiteral) { restrictionDataLitValue = dataLiteral->getDataLiteralValue(); } CDataLiteralRealValue* restrictionDataLitRealValue = nullptr; if (restrictionDataLitValue) { restrictionDataLitRealValue = dynamic_cast(restrictionDataLitValue); } CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeRealValueSpaceData* realValueSpaceData = datatypesSpaceValue->getRealValueSpace(mRealValueSpaceType,true); if (realValueSpaceData->isValueSpaceClashed()) { return false; } CDatatypeRealValueSpaceMap* realValueSpaceMap = realValueSpaceData->getValueSpaceMap(true); bool newValuesPotentiallyExcluded = false; if (!negated) { if (restrictionCode == CDFC_RATIONAL) { newValuesPotentiallyExcluded |= realValueSpaceMap->restrictToRationalValues(depTrackPoint); } else if (restrictionCode == CDFC_DECIMAL) { newValuesPotentiallyExcluded |= realValueSpaceMap->restrictToDecimalValues(depTrackPoint); } else if (restrictionCode == CDFC_INTEGER) { newValuesPotentiallyExcluded |= realValueSpaceMap->restrictToIntegerValues(depTrackPoint); } else if (restrictionDataLitRealValue) { if (restrictionCode == CDFC_MIN_EXCLUSIVE) { newValuesPotentiallyExcluded |= realValueSpaceMap->excludeMinimum(restrictionDataLitRealValue,true,depTrackPoint); } else if (restrictionCode == CDFC_MIN_INCLUSIVE) { newValuesPotentiallyExcluded |= realValueSpaceMap->excludeMinimum(restrictionDataLitRealValue,false,depTrackPoint); } else if (restrictionCode == CDFC_MAX_INCLUSIVE) { newValuesPotentiallyExcluded |= realValueSpaceMap->excludeMaximum(restrictionDataLitRealValue,false,depTrackPoint); } else if (restrictionCode == CDFC_MAX_EXCLUSIVE) { newValuesPotentiallyExcluded |= realValueSpaceMap->excludeMaximum(restrictionDataLitRealValue,true,depTrackPoint); } } } else { if (restrictionCode == CDFC_RATIONAL) { newValuesPotentiallyExcluded |= realValueSpaceMap->restrictToNonRationalValues(depTrackPoint); } else if (restrictionCode == CDFC_DECIMAL) { newValuesPotentiallyExcluded |= realValueSpaceMap->restrictToNonDecimalValues(depTrackPoint); } else if (restrictionCode == CDFC_INTEGER) { newValuesPotentiallyExcluded |= realValueSpaceMap->restrictToNonIntegerValues(depTrackPoint); } else if (restrictionDataLitRealValue) { if (restrictionCode == CDFC_MIN_EXCLUSIVE) { newValuesPotentiallyExcluded |= realValueSpaceMap->excludeMaximum(restrictionDataLitRealValue,false,depTrackPoint); } else if (restrictionCode == CDFC_MIN_INCLUSIVE) { newValuesPotentiallyExcluded |= realValueSpaceMap->excludeMaximum(restrictionDataLitRealValue,true,depTrackPoint); } else if (restrictionCode == CDFC_MAX_INCLUSIVE) { newValuesPotentiallyExcluded |= realValueSpaceMap->excludeMinimum(restrictionDataLitRealValue,true,depTrackPoint); } else if (restrictionCode == CDFC_MAX_EXCLUSIVE) { newValuesPotentiallyExcluded |= realValueSpaceMap->excludeMinimum(restrictionDataLitRealValue,false,depTrackPoint); } } } if (newValuesPotentiallyExcluded) { datatypesSpaceValue->setValueSapceModified(realValueSpaceData); realValueSpaceData->setValueSpaceInitialisationDependencyTrackPointCandidate(depTrackPoint); } return newValuesPotentiallyExcluded; } bool CIndividualProcessNodeRealValueSpaceHandler::testValueSpaceClashed(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext) { CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeRealValueSpaceData* realValueSpaceData = datatypesSpaceValue->getRealValueSpace(mRealValueSpaceType,false); if (realValueSpaceData) { if (realValueSpaceData->isValueSpaceClashed()) { return true; } CDatatypeRealValueSpaceMap* realValueSpaceMap = realValueSpaceData->getValueSpaceMap(false); if (realValueSpaceMap) { bool clashed = realValueSpaceMap->testValueSpaceReturnClashed(); if (clashed) { realValueSpaceMap->addValueSpaceDependencies(realValueSpaceData->getClashDependencyTrackPointCollection()); realValueSpaceData->setValueSpaceClashed(true); return true; } } } return false; } bool CIndividualProcessNodeRealValueSpaceHandler::addValueSpaceDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext) { CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeRealValueSpaceData* realValueSpaceData = datatypesSpaceValue->getRealValueSpace(mRealValueSpaceType,false); if (realValueSpaceData) { if (!realValueSpaceData->isValueSpaceClashed()) { CDatatypeRealValueSpaceMap* realValueSpaceMap = realValueSpaceData->getValueSpaceMap(false); if (realValueSpaceMap) { return realValueSpaceMap->addValueSpaceDependencies(depCollection); } } else { return realValueSpaceData->getClashDependencyTrackPointCollection()->addCollectionDependencies(depCollection); } } return false; } bool CIndividualProcessNodeRealValueSpaceHandler::countPossibleValueSpaceValues(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceValuesCounter* valueCounter, CCalculationAlgorithmContext* calcAlgContext) { bool counted = false; CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeRealValueSpaceData* realValueSpaceData = datatypesSpaceValue->getRealValueSpace(mRealValueSpaceType,false); if (realValueSpaceData) { if (!realValueSpaceData->isValueSpaceClashed()) { if (!realValueSpaceData->isValueSpaceCounted() || realValueSpaceData->isValueSpaceCountingRequired()) { realValueSpaceData = datatypesSpaceValue->getRealValueSpace(mRealValueSpaceType,true); CDatatypeValueSpaceValuesCounter* valueSpaceValueCounter = realValueSpaceData->getValuesCounter(); valueSpaceValueCounter->resetValueCounter(); CDatatypeRealValueSpaceMap* realValueSpaceMap = realValueSpaceData->getValueSpaceMap(false); if (realValueSpaceMap) { realValueSpaceMap->countAllValues(valueSpaceValueCounter); } else { valueSpaceValueCounter->incInfinite(); } realValueSpaceData->setValueSpaceCounted(true); realValueSpaceData->setValueSpaceCountingRequired(false); if (valueCounter) { counted = valueCounter->combineWithValueCounter(valueSpaceValueCounter); } } else { CDatatypeValueSpaceValuesCounter* valueSpaceValueCounter = realValueSpaceData->getValuesCounter(); if (valueCounter) { counted = valueCounter->combineWithValueCounter(valueSpaceValueCounter); } } } } else { if (valueCounter) { counted = valueCounter->incInfinite(); } } return counted; } CConceptDescriptor* CIndividualProcessNodeRealValueSpaceHandler::triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, cint64& remainingRequiredValuesCount, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext) { CConceptDescriptor* conceptTriggerLinker = appendConceptLinker; CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CConcreteOntology* ontology = calcAlgContext->getUsedProcessingDataBox()->getOntology(); bool substractValueSpaceValuesCount = false; CDatatypeRealValueSpaceData* realValueSpaceData = datatypesSpaceValue->getRealValueSpace(mRealValueSpaceType,false); if (!realValueSpaceData || (!realValueSpaceData->isValueSpaceClashed() && !realValueSpaceData->isValueSpaceTriggeringCompleted())) { realValueSpaceData = datatypesSpaceValue->getRealValueSpace(mRealValueSpaceType,true); bool valueSpaceTriggeringFinished = false; if (!realValueSpaceData->isValueSpaceTriggeringStarted()) { realValueSpaceData->setValueSpaceTriggeringStarted(true); } CDatatypeRealValueSpaceMap* realValueSpaceMap = realValueSpaceData->getValueSpaceMap(false); CDatatypeValueSpacesTriggers* valueSpacesTriggers = ontology->getDataBoxes()->getMBox()->getValueSpacesTriggers(false); if (valueSpacesTriggers) { CDatatypeValueSpaceRealTriggers* realValueSpaceTriggers = valueSpacesTriggers->getRealValueSpaceTriggers(); CDatatypeValueSpaceTriggeringMap* realValueSpaceTriggerMap = realValueSpaceTriggers->getValueSpaceTriggeringMap(); depCollection->addDependency(realValueSpaceData->getValueSpaceInitialisationDependencyTrackPoint()); CDatatypeValueSpaceConceptTriggeringData* valueSpaceConceptTriggeringData = realValueSpaceTriggers->getRealConceptTriggeringData(); if (valueSpaceConceptTriggeringData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,valueSpaceConceptTriggeringData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } if (realValueSpaceMap) { CDataLiteralRealValue* minValue = nullptr; bool minValueInclusive = false; CDependencyTrackPoint* minValueDepTrackPoint = nullptr; if (realValueSpaceMap->getAbsoluteMinimumValue(minValue,minValueInclusive,&minValueDepTrackPoint)) { CDatatypeDependencyCollection minValueDepCollection(depCollection,calcAlgContext); bool minDatatypeDepAdded = false; CDatatypeValueSpaceTriggeringIterator leftTriggerIt = realValueSpaceTriggerMap->getLeftTriggeringIterator(minValue,!minValueInclusive); while (leftTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = leftTriggerIt.next(); CDatatypeValueSpaceConceptTriggeringData* minExcTriggeringConceptData = triggeringData->getMinExclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* minIncTriggeringConceptData = triggeringData->getMinInclusiveTriggeringData(); if (minExcTriggeringConceptData->hasPartialConceptTriggers() || minIncTriggeringConceptData->hasPartialConceptTriggers()) { if (!minDatatypeDepAdded && minValueDepTrackPoint) { minDatatypeDepAdded = true; minValueDepCollection.addDependency(minValueDepTrackPoint); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minExcTriggeringConceptData->getPartialConceptTriggerLinker(),&minValueDepCollection,calcAlgContext); conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minIncTriggeringConceptData->getPartialConceptTriggerLinker(),&minValueDepCollection,calcAlgContext); } } CDatatypeValueSpaceTriggeringData* minValueTriggerData = realValueSpaceTriggerMap->getDatatypeValueTriggeringData(minValue,false); if (minValueTriggerData) { CDatatypeValueSpaceConceptTriggeringData* minTriggeringConceptData = nullptr; if (!minValueInclusive) { minTriggeringConceptData = minValueTriggerData->getMinExclusiveTriggeringData(); } else { minTriggeringConceptData = minValueTriggerData->getMinInclusiveTriggeringData(); } if (minTriggeringConceptData->hasPartialConceptTriggers()) { if (!minDatatypeDepAdded && minValueDepTrackPoint) { minDatatypeDepAdded = true; minValueDepCollection.addDependency(minValueDepTrackPoint); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minTriggeringConceptData->getPartialConceptTriggerLinker(),&minValueDepCollection,calcAlgContext); } } } CDataLiteralRealValue* maxValue = nullptr; bool maxValueInclusive = false; CDependencyTrackPoint* maxValueDepTrackPoint = nullptr; if (realValueSpaceMap->getAbsoluteMaximumValue(maxValue,maxValueInclusive,&maxValueDepTrackPoint)) { CDatatypeDependencyCollection maxValueDepCollection(depCollection,calcAlgContext); bool maxDatatypeDepAdded = false; CDatatypeValueSpaceTriggeringIterator rightTriggerIt = realValueSpaceTriggerMap->getRightTriggeringIterator(maxValue,!maxValueInclusive); while (rightTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = rightTriggerIt.next(); CDatatypeValueSpaceConceptTriggeringData* maxExcTriggeringConceptData = triggeringData->getMaxExclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* maxIncTriggeringConceptData = triggeringData->getMaxInclusiveTriggeringData(); if (maxExcTriggeringConceptData->hasPartialConceptTriggers() || maxIncTriggeringConceptData->hasPartialConceptTriggers()) { if (!maxDatatypeDepAdded && maxValueDepTrackPoint) { maxDatatypeDepAdded = true; maxValueDepCollection.addDependency(minValueDepTrackPoint); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxExcTriggeringConceptData->getPartialConceptTriggerLinker(),&maxValueDepCollection,calcAlgContext); conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxIncTriggeringConceptData->getPartialConceptTriggerLinker(),&maxValueDepCollection,calcAlgContext); } } CDatatypeValueSpaceTriggeringData* maxValueTriggerData = realValueSpaceTriggerMap->getDatatypeValueTriggeringData(maxValue,false); if (maxValueTriggerData) { CDatatypeValueSpaceConceptTriggeringData* maxTriggeringConceptData = nullptr; if (!maxValueInclusive) { maxTriggeringConceptData = maxValueTriggerData->getMaxExclusiveTriggeringData(); } else { maxTriggeringConceptData = maxValueTriggerData->getMaxInclusiveTriggeringData(); } if (maxTriggeringConceptData->hasPartialConceptTriggers()) { if (!maxDatatypeDepAdded && maxValueDepTrackPoint) { maxDatatypeDepAdded = true; maxValueDepCollection.addDependency(maxValueDepTrackPoint); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxTriggeringConceptData->getPartialConceptTriggerLinker(),&maxValueDepCollection,calcAlgContext); } } } if (minValue && maxValue) { CDatatypeValueSpaceRealValuesCounter valueCounter; CDataLiteralCompareValue* freeLeftValue = nullptr; CDataLiteralCompareValue* freeRightValue = nullptr; bool freeLeftValueInclusive = false; bool freeRightValueInclusive = false; if (realValueSpaceTriggerMap->getIntervalMinMaxTriggerFreeInterval(minValue,minValueInclusive,maxValue,maxValueInclusive,freeLeftValue,freeLeftValueInclusive,freeRightValue,freeRightValueInclusive)) { CDataLiteralRealValue* freeLeftRealValue = dynamic_cast(freeLeftValue); CDataLiteralRealValue* freeRightRealValue = dynamic_cast(freeRightValue); if (freeLeftRealValue && freeRightRealValue) { CDatatypeValueSpaceRealValuesCounter tmpValueCounter; if (realValueSpaceMap->countIntervalValues(freeLeftRealValue,freeLeftValueInclusive,freeRightRealValue,freeRightValueInclusive,&tmpValueCounter)) { cint64 triggerValueCount = 0; if (realValueSpaceTriggerMap->countIntervalValueTriggers(minValue,minValueInclusive,maxValue,maxValueInclusive,triggerValueCount)) { valueCounter.combineWithValueCounter(&tmpValueCounter,triggerValueCount); } } } } if (!valueCounter.hasValueAchieved(remainingRequiredValuesCount)) { bool minToMaxTriggerDirection = true; cint64 minTriggerCount = 0; cint64 maxTriggerCount = 0; cint64 valueTriggerCount = 0; realValueSpaceTriggerMap->countIntervalMinMaxValueTriggers(minValue,minValueInclusive,maxValue,maxValueInclusive,minTriggerCount,maxTriggerCount,valueTriggerCount); if (minTriggerCount < maxTriggerCount) { minToMaxTriggerDirection = false; } depCollection->addDependency(minValueDepTrackPoint); depCollection->addDependency(maxValueDepTrackPoint); CDatatypeValueSpaceTriggeringIterator triggerIt = realValueSpaceTriggerMap->getIntervalTriggeringIterator(minValue,minValueInclusive,maxValue,maxValueInclusive,minToMaxTriggerDirection); if (minTriggerCount > 0 && maxTriggerCount > 0) { CDatatypeValueSpaceTriggeringIterator minMaxDirectionTriggerIt = triggerIt; while (minMaxDirectionTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = minMaxDirectionTriggerIt.next(); if (minToMaxTriggerDirection) { CDatatypeValueSpaceConceptTriggeringData* maxExcTriggeringConceptData = triggeringData->getMaxExclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* maxIncTriggeringConceptData = triggeringData->getMaxInclusiveTriggeringData(); if (maxExcTriggeringConceptData->hasPartialConceptTriggers() || maxIncTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxExcTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxIncTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } else { CDatatypeValueSpaceConceptTriggeringData* minExcTriggeringConceptData = triggeringData->getMinExclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* minIncTriggeringConceptData = triggeringData->getMinInclusiveTriggeringData(); if (minExcTriggeringConceptData->hasPartialConceptTriggers() || minIncTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minExcTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minIncTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } } } if (!minValue->isEqualTo(maxValue)) { CDataLiteralRealValue* lastRealValue = nullptr; if (minToMaxTriggerDirection) { lastRealValue = minValue; } else { lastRealValue = maxValue; } CDatatypeValueSpaceTriggeringIterator stepMinMaxDirectionTriggerIt = triggerIt; while (!valueCounter.hasValueAchieved(remainingRequiredValuesCount) && stepMinMaxDirectionTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = stepMinMaxDirectionTriggerIt.next(); CDataLiteralCompareValue* currentValue = triggeringData->getValue(); CDataLiteralRealValue* currentRealValue = dynamic_cast(currentValue); if (lastRealValue && !lastRealValue->isEqualTo(currentRealValue)) { if (minToMaxTriggerDirection) { realValueSpaceMap->countIntervalValues(lastRealValue,false,currentRealValue,false,&valueCounter); realValueSpaceMap->addIntervalExclusionDependencies(lastRealValue,false,currentRealValue,false,depCollection); } else { realValueSpaceMap->countIntervalValues(currentRealValue,false,lastRealValue,false,&valueCounter); realValueSpaceMap->addIntervalExclusionDependencies(currentRealValue,false,lastRealValue,false,depCollection); } } if (minToMaxTriggerDirection) { CDatatypeValueSpaceConceptTriggeringData* minExcTriggeringConceptData = triggeringData->getMinExclusiveTriggeringData(); if (minExcTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minExcTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } else { CDatatypeValueSpaceConceptTriggeringData* maxExcTriggeringConceptData = triggeringData->getMaxExclusiveTriggeringData(); if (maxExcTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxExcTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } if (!triggeringData->getDirectValueTriggeringData()->hasPartialConceptTriggers()) { realValueSpaceMap->countValueValues(currentRealValue,&valueCounter); realValueSpaceMap->addValueExclusionDependencies(currentRealValue,depCollection); } if (!valueCounter.hasValueAchieved(remainingRequiredValuesCount)) { if (minToMaxTriggerDirection) { CDatatypeValueSpaceConceptTriggeringData* minIncTriggeringConceptData = triggeringData->getMinInclusiveTriggeringData(); if (minIncTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minIncTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } else { CDatatypeValueSpaceConceptTriggeringData* maxIncTriggeringConceptData = triggeringData->getMaxInclusiveTriggeringData(); if (maxIncTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxIncTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } } } } CDatatypeValueSpaceTriggeringIterator valueDirectionTriggerIt = triggerIt; while (!valueCounter.hasValueAchieved(remainingRequiredValuesCount) && valueDirectionTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = valueDirectionTriggerIt.next(); CDataLiteralCompareValue* currentValue = triggeringData->getValue(); CDataLiteralRealValue* currentRealValue = dynamic_cast(currentValue); if (triggeringData->getDirectValueTriggeringData()->hasPartialConceptTriggers()) { realValueSpaceMap->addValueExclusionDependencies(currentRealValue,depCollection); if (!realValueSpaceMap->isValueExcluded(currentRealValue,nullptr)) { realValueSpaceMap->countValueValues(currentRealValue,&valueCounter); CDatatypeValueSpaceConceptTriggeringData* directValueTriggeringConceptData = triggeringData->getDirectValueTriggeringData(); if (directValueTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,directValueTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } } } } if (!valueCounter.hasValueAchieved(CDatatypeValueSpaceRealValuesCounter::RVT_NON_RATIONAL_ONLY_COUNT,remainingRequiredValuesCount)) { // trigger integers CDatatypeValueSpaceConceptTriggeringData* conceptTriggeringData = realValueSpaceTriggers->getRationalConceptTriggeringData(); if (conceptTriggeringData->hasPartialConceptTriggers()) { if (depCollection && !depCollection->hasDependencies()) { realValueSpaceMap->addValueSpaceDependencies(depCollection); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,conceptTriggeringData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } if (!valueCounter.hasValueAchieved(CDatatypeValueSpaceRealValuesCounter::RVT_NON_DECIMAL_ONLY_COUNT,remainingRequiredValuesCount)) { // trigger integers CDatatypeValueSpaceConceptTriggeringData* conceptTriggeringData = realValueSpaceTriggers->getDecimalConceptTriggeringData(); if (conceptTriggeringData->hasPartialConceptTriggers()) { if (depCollection && !depCollection->hasDependencies()) { realValueSpaceMap->addValueSpaceDependencies(depCollection); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,conceptTriggeringData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } if (!valueCounter.hasValueAchieved(CDatatypeValueSpaceRealValuesCounter::RVT_NON_INTEGER_ONLY_COUNT,remainingRequiredValuesCount)) { // trigger integers CDatatypeValueSpaceConceptTriggeringData* conceptTriggeringData = realValueSpaceTriggers->getIntegerConceptTriggeringData(); if (conceptTriggeringData->hasPartialConceptTriggers()) { if (depCollection && !depCollection->hasDependencies()) { realValueSpaceMap->addValueSpaceDependencies(depCollection); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,conceptTriggeringData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } remainingRequiredValuesCount -= valueCounter.getValueCount(); if (valueCounter.isInfinite()) { remainingRequiredValuesCount = 0; } if (remainingRequiredValuesCount < 0) { remainingRequiredValuesCount = 0; } if (remainingRequiredValuesCount > 0) { valueSpaceTriggeringFinished = true; } } } else { remainingRequiredValuesCount = 0; } } else { valueSpaceTriggeringFinished = true; substractValueSpaceValuesCount = true; } if (valueSpaceTriggeringFinished) { if (!realValueSpaceData->isValueSpaceTriggeringCompleted()) { realValueSpaceData->setValueSpaceTriggeringCompleted(true); } } } else { substractValueSpaceValuesCount = true; } if (substractValueSpaceValuesCount) { CDatatypeValueSpaceValuesCounter valueCounter; countPossibleValueSpaceValues(indiProcNode,&valueCounter,calcAlgContext); if (valueCounter.isInfinite()) { remainingRequiredValuesCount = 0; } else { remainingRequiredValuesCount -= valueCounter.getValueCount(); if (remainingRequiredValuesCount <= 0) { remainingRequiredValuesCount = 0; } else { addValueSpaceDependencies(indiProcNode,depCollection,calcAlgContext); } } } return conceptTriggerLinker; } bool CIndividualProcessNodeRealValueSpaceHandler::getNextPossibleDataValue(CIndividualProcessNode* indiProcNode, CDataLiteralValue*& nextValue, CDataLiteralValue* lastValue, CDatatypeValueTestingCollection* valueTestingCollection, CCalculationAlgorithmContext* calcAlgContext) { CDataLiteralRealValue* lastRealValue = nullptr; if (lastValue) { lastRealValue = dynamic_cast(lastValue); } CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CConcreteOntology* ontology = calcAlgContext->getUsedProcessingDataBox()->getOntology(); CDatatypeRealValueSpaceData* realValueSpaceData = datatypesSpaceValue->getRealValueSpace(mRealValueSpaceType,true); if (realValueSpaceData && !realValueSpaceData->isValueSpaceClashed()) { CDataLiteralValue* tmpNextValue = valueTestingCollection->createDataLiteralValue(mRealValueSpaceType); CDataLiteralRealValue* nextRealValue = dynamic_cast(tmpNextValue); CDataLiteralValue* tmpLastValue = nullptr; CDataLiteralRealValue* tmpLastRealValue = nullptr; if (lastRealValue) { tmpLastValue = valueTestingCollection->createDataLiteralValue(mRealValueSpaceType); tmpLastRealValue = dynamic_cast(tmpLastValue); tmpLastRealValue->initValue(lastRealValue); } CDatatypeRealValueSpaceMap* realValueSpaceMap = realValueSpaceData->getValueSpaceMap(true); bool searchNextValue = true; while (searchNextValue) { if (realValueSpaceMap->getNextPossibleDataValue(nextRealValue,tmpLastRealValue)) { if (!valueTestingCollection->isDataLiteralValueUsed(tmpNextValue,mRealValueSpaceType)) { valueTestingCollection->releaseDataLiteralValue(tmpLastValue,mRealValueSpaceType); nextValue = tmpNextValue; return true; } } else { searchNextValue = false; } if (!tmpLastRealValue) { tmpLastValue = valueTestingCollection->createDataLiteralValue(mRealValueSpaceType); tmpLastRealValue = dynamic_cast(tmpLastValue); tmpLastRealValue->initValue(nextRealValue); } else { tmpLastRealValue->initValue(nextRealValue); } } if (!searchNextValue) { valueTestingCollection->releaseDataLiteralValue(tmpNextValue,mRealValueSpaceType); valueTestingCollection->releaseDataLiteralValue(tmpLastValue,mRealValueSpaceType); } } return false; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeDoubleValueSpaceHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeDoubleValueSpa0000644000175000017500000000465212520551010032263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEDOUBLEVALUESPACEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEDOUBLEVALUESPACEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CIndividualProcessNodeCompareValueSpaceHandler.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CIndividualProcessNodeDoubleValueSpaceHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeDoubleValueSpaceHandler : public CIndividualProcessNodeCompareValueSpaceHandler { // public methods public: //! Constructor CIndividualProcessNodeDoubleValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEDOUBLEVALUESPACEHANDLER_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSaturationNodeExpansionCacheHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSaturationNodeExpansionCacheHandler0000644000175000017500000006264712520551014032314 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeExpansionCacheHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CSaturationNodeExpansionCacheHandler::CSaturationNodeExpansionCacheHandler(CSaturationNodeAssociatedExpansionCacheReader* satCacheReader, CSaturationNodeAssociatedExpansionCacheWriter* satCacheWriter) { mSatCacheReader = satCacheReader; mSatCacheWriter = satCacheWriter; mTmpContext = nullptr; mMemAllocMan = nullptr; mWriteData = nullptr; } CIndividualSaturationProcessNode* CSaturationNodeExpansionCacheHandler::getSaturationIndividualNodeForConcept(CConcept* concept, bool negation, CCalculationAlgorithmContext* calcAlgContext) { CConceptData* conceptData = concept->getConceptData(); CIndividualSaturationProcessNode* saturationIndiNode = nullptr; if (conceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)conceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* satCalcRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(false); if (satCalcRefLinkData) { saturationIndiNode = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } return saturationIndiNode; } bool CSaturationNodeExpansionCacheHandler::cacheUnsatisfiableConcept(CConcept* concept, CCalculationAlgorithmContext* calcAlgContext) { CIndividualSaturationProcessNode* saturationIndiNode = getSaturationIndividualNodeForConcept(concept,false,calcAlgContext); if (saturationIndiNode && !saturationIndiNode->getIndirectStatusFlags()->hasClashedFlag()) { // try caching prepareCacheMessages(calcAlgContext); CTaskMemoryPoolAllocationManager* satCacheMemMan = mMemAllocMan; CContextBase* tmpContext = mTmpContext; CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData* unsatWriteData = CObjectAllocator< CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData >::allocateAndConstruct(satCacheMemMan); unsatWriteData->initUnsatisfiabilityWriteData(saturationIndiNode); addCacheMessages(unsatWriteData,calcAlgContext); return true; } return false; } bool CSaturationNodeExpansionCacheHandler::isConceptUnsatisfiableCached(CConcept* concept, bool negation, CCalculationAlgorithmContext* calcAlgContext) { CIndividualSaturationProcessNode* saturationIndiNode = getSaturationIndividualNodeForConcept(concept,negation,calcAlgContext); if (saturationIndiNode) { return saturationIndiNode->getIndirectStatusFlags()->hasClashedFlag(); } return false; } bool CSaturationNodeExpansionCacheHandler::isNodeSatisfiableCached(CIndividualProcessNode* individualProcessNode, CSaturationNodeAssociatedConceptExpansion*& expansion, CCalculationAlgorithmContext* calcAlgContext) { CIndividualNodeSaturationBlockingData* satBlockData = individualProcessNode->getIndividualSaturationBlockingData(false); CReapplyConceptLabelSet* conSet = individualProcessNode->getReapplyConceptLabelSet(false); if (conSet && satBlockData) { cint64 totalConceptCount = conSet->getConceptCount(); CConceptDescriptor* lastAddedConDes = conSet->getAddingSortedConceptDescriptionLinker(); CIndividualSaturationProcessNode* saturationNode = satBlockData->getSaturationIndividualNode(); if (satBlockData->getLastConfirmedConceptDescriptior() == lastAddedConDes) { CIndividualSaturationProcessNodeStatusFlags* flags = saturationNode->getIndirectStatusFlags(); if (!flags->hasFlags(CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED,false)) { return true; } } CReapplyConceptSaturationLabelSet* satConSet = saturationNode->getReapplyConceptSaturationLabelSet(false); CSaturationNodeAssociatedExpansionCacheEntry* cacheEntry = mSatCacheReader->getCacheEntry(saturationNode); if (cacheEntry) { CConceptDescriptor* lastConDes = satBlockData->getLastConfirmedConceptDescriptior(); CConceptDescriptor* conDes = conSet->getAddingSortedConceptDescriptionLinker(); cint64 conSetSignature = conSet->getConceptSignature()->getSignatureValue(); CSaturationNodeAssociatedDeterministicConceptExpansion* detExpansion = cacheEntry->getDeterministicConceptExpansion(); if (detExpansion && !detExpansion->requiresNonDeterministicExpansion()) { if (testNodeMatchingExpansion(detExpansion,nullptr,conSet,satBlockData,calcAlgContext)) { expansion = detExpansion; return true; } } CSaturationNodeAssociatedNondeterministicConceptExpansion* nondetExpansionLinker = cacheEntry->getNondeterministicConceptExpansionLinker(); for (CSaturationNodeAssociatedNondeterministicConceptExpansion* nondetExpansionLinkerIt = nondetExpansionLinker; nondetExpansionLinkerIt; nondetExpansionLinkerIt = nondetExpansionLinkerIt->getNext()) { CSaturationNodeAssociatedNondeterministicConceptExpansion* nondetExpansion = nondetExpansionLinkerIt; if (testNodeMatchingExpansion(nondetExpansion,detExpansion,conSet,satBlockData,calcAlgContext)) { expansion = nondetExpansion; return true; } } } } return false; } bool CSaturationNodeExpansionCacheHandler::getCachedDeterministicExpansion(CIndividualSaturationProcessNode* saturationNode, CSaturationNodeAssociatedDeterministicConceptExpansion*& expansion, CCalculationAlgorithmContext* calcAlgContext) { CSaturationNodeAssociatedExpansionCacheEntry* cacheEntry = mSatCacheReader->getCacheEntry(saturationNode); if (cacheEntry) { CSaturationNodeAssociatedDeterministicConceptExpansion* detExpansion = cacheEntry->getDeterministicConceptExpansion(); if (detExpansion) { expansion = detExpansion; return true; } } return false; } bool CSaturationNodeExpansionCacheHandler::testNodeMatchingExpansion(CSaturationNodeAssociatedConceptExpansion* expansion, CSaturationNodeAssociatedConceptExpansion* alternativeExpansion, CReapplyConceptLabelSet* conSet, CIndividualNodeSaturationBlockingData* satBlockData, CCalculationAlgorithmContext* calcAlgContext) { cint64 conSetSignature = conSet->getConceptSignature()->getSignatureValue(); if (expansion->getConceptSetSignature() != conSetSignature) { return false; } cint64 totalConceptCount = conSet->getConceptCount(); if (expansion->getTotalConceptCount() != totalConceptCount) { return false; } CConceptDescriptor* lastConDes = satBlockData->getLastConfirmedConceptDescriptior(); CConceptDescriptor* conDes = conSet->getAddingSortedConceptDescriptionLinker(); for (CConceptDescriptor* conDesIt = conDes; conDesIt != lastConDes; conDesIt = conDesIt->getNext()) { CCacheValue cacheValue(getCacheValueForConcept(conDesIt,calcAlgContext)); if (!expansion->hasConceptExpansionLinker(&cacheValue)) { if (!alternativeExpansion || !alternativeExpansion->hasConceptExpansionLinker(&cacheValue)) { return false; } } } CSaturationNodeAssociatedDependentNominalSet* dependentNominalSet = expansion->getDependentNominalSet(false); if (dependentNominalSet) { CIndividualProcessNodeVector* indiVec = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); for (CSaturationNodeAssociatedDependentNominalSet::const_iterator it = dependentNominalSet->constBegin(), itEnd = dependentNominalSet->constEnd(); it != itEnd; ++it) { cint64 dependentNominalID = (*it); bool nominalStillCached = false; CIndividualProcessNode* indiNode = indiVec->getData(dependentNominalID); if (indiNode) { if (dependentNominalID <= calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID() && indiNode->hasProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED)) { if (!indiNode->hasProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALID) && !indiNode->hasProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED)) { nominalStillCached = true; } } else if (indiNode->hasProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKEND)) { nominalStillCached = true; } } else { nominalStillCached = true; } if (!nominalStillCached) { return false; } } } return true; } CCacheValue CSaturationNodeExpansionCacheHandler::getCacheValueForConcept(CConceptDescriptor* conDes, CCalculationAlgorithmContext* calcAlgContext) { return getCacheValueForConcept(conDes->getConcept(),conDes->isNegated(),calcAlgContext); } CCacheValue CSaturationNodeExpansionCacheHandler::getCacheValueForConcept(CConcept* concept, bool negation, CCalculationAlgorithmContext* calcAlgContext) { cint64 conTag = concept->getConceptTag(); CCacheValue::CACHEVALUEIDENTIFIER cacheValueIdentifier = CCacheValue::CACHEVALTAGANDCONCEPT; if (negation) { cacheValueIdentifier = CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; } CCacheValue cacheValue; cacheValue.initCacheValue(conTag,(cint64)concept,cacheValueIdentifier); return cacheValue; } bool CSaturationNodeExpansionCacheHandler::prepareCacheMessages(CCalculationAlgorithmContext* calcAlgContext) { if (!mMemAllocMan) { CTaskMemoryPoolAllocationManager satCacheMemManCreaterMemMan(&mMemPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mMemAllocMan = CObjectAllocator::allocateAndConstruct(&satCacheMemManCreaterMemMan); mMemAllocMan->initTaskMemoryPoolAllocationManager(&mMemPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mTmpContext = CObjectParameterizingAllocator< CContextBase,CMemoryAllocationManager* >::allocateAndConstructAndParameterize(mMemAllocMan,mMemAllocMan); return true; } return false; } bool CSaturationNodeExpansionCacheHandler::commitCacheMessages(CCalculationAlgorithmContext* calcAlgContext) { if (mWriteData) { CSaturationNodeAssociatedExpansionCacheWriteData* commitWriteData = nullptr; CSaturationNodeAssociatedExpansionCacheWriteData* writeDataIt = mWriteData; while (writeDataIt) { CSaturationNodeAssociatedExpansionCacheWriteData* tmpWriteData = writeDataIt; writeDataIt = (CSaturationNodeAssociatedExpansionCacheWriteData*)writeDataIt->getNext(); tmpWriteData->clearNext(); if (commitWriteData) { commitWriteData = (CSaturationNodeAssociatedExpansionCacheWriteData*)tmpWriteData->append(commitWriteData); } else { commitWriteData = tmpWriteData; } } mSatCacheWriter->writeCacheData(commitWriteData,mMemPoolCon.takeMemoryPools()); mWriteData = nullptr; mMemAllocMan = nullptr; mTmpContext = nullptr; return true; } return false; } bool CSaturationNodeExpansionCacheHandler::addCacheMessages(CSaturationNodeAssociatedExpansionCacheWriteData* expandWriteData, CCalculationAlgorithmContext* calcAlgContext) { if (mWriteData) { mWriteData = (CSaturationNodeAssociatedExpansionCacheWriteData*)expandWriteData->append(mWriteData); } else { mWriteData = expandWriteData; } //commitCacheMessages(calcAlgContext); return true; } bool CSaturationNodeExpansionCacheHandler::testNodeCachingPossible(CIndividualProcessNode* individualProcessNode, bool& onlyIfCompletelyDeterministic, bool& onlyAllNondeterministic, CSaturationNodeAssociatedExpansionCacheEntry*& cacheEntry, CCalculationAlgorithmContext* calcAlgContext) { onlyIfCompletelyDeterministic = false; cacheEntry = nullptr; CIndividualNodeSaturationBlockingData* satBlockData = individualProcessNode->getIndividualSaturationBlockingData(false); CReapplyConceptLabelSet* conSet = individualProcessNode->getReapplyConceptLabelSet(false); if (conSet && satBlockData) { cint64 totalConceptCount = conSet->getConceptCount(); CConceptDescriptor* lastAddedConDes = conSet->getAddingSortedConceptDescriptionLinker(); CIndividualSaturationProcessNode* saturationNode = satBlockData->getSaturationIndividualNode(); CReapplyConceptSaturationLabelSet* satConSet = saturationNode->getReapplyConceptSaturationLabelSet(false); if (!saturationNode->isCompleted()) { return false; } cacheEntry = mSatCacheReader->getCacheEntry(saturationNode); if (cacheEntry) { cint64 conSetSignature = conSet->getConceptSignature()->getSignatureValue(); CSaturationNodeAssociatedDeterministicConceptExpansion* conExp = cacheEntry->getDeterministicConceptExpansion(); if (conExp && !conExp->requiresNonDeterministicExpansion()) { return false; } if (!cacheEntry->areMoreNondeterministicExpansionAllowed() || conExp && conExp->getConceptSetSignature() == conSetSignature) { onlyIfCompletelyDeterministic = true; } else { for (CSaturationNodeAssociatedNondeterministicConceptExpansion* conExpIt = cacheEntry->getNondeterministicConceptExpansionLinker(); conExpIt; conExpIt = conExpIt->getNext()) { if (conExpIt->getConceptSetSignature() == conSetSignature) { onlyIfCompletelyDeterministic = true; break; } } } } // test compatible nominal nodes CSuccessorConnectedNominalSet* depNominalSet = individualProcessNode->getSuccessorNominalConnectionSet(false); if (depNominalSet) { CIndividualProcessNodeVector* indiVec = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); for (CSuccessorConnectedNominalSet::const_iterator it = depNominalSet->constBegin(), itEnd = depNominalSet->constEnd(); it != itEnd; ++it) { cint64 nominalNodeID = *it; bool nominalStillCached = false; CIndividualProcessNode* indiNode = indiVec->getData(nominalNodeID); if (indiNode) { if (nominalNodeID <= calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID() && indiNode->hasProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED)) { if (!indiNode->hasProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALID) && !indiNode->hasProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED)) { nominalStillCached = true; if (indiNode->hasProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHEDNODEEXTENDED)) { onlyAllNondeterministic = true; } } } else if (indiNode->hasProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKEND)) { nominalStillCached = true; } } if (!nominalStillCached) { return false; } } } return true; } return false; } bool CSaturationNodeExpansionCacheHandler::tryNodeSatisfiableCaching(CIndividualProcessNode* individualProcessNode, CCalculationAlgorithmContext* calcAlgContext) { // test whether node can be cached bool cachingOnlyIfDeterministic = false; bool onlyAllNondeterministic = false; CSaturationNodeAssociatedExpansionCacheEntry* cacheEntry = nullptr; if (testNodeCachingPossible(individualProcessNode,cachingOnlyIfDeterministic,onlyAllNondeterministic,cacheEntry,calcAlgContext)) { CIndividualNodeSaturationBlockingData* satBlockData = individualProcessNode->getIndividualSaturationBlockingData(false); CConceptDescriptor* lastConDes = satBlockData->getLastConfirmedConceptDescriptior(); CIndividualSaturationProcessNode* satIndiNode = satBlockData->getSaturationIndividualNode(); CSaturationConceptDataItem* conceptSatItem = (CSaturationConceptDataItem*)satIndiNode->getSaturationConceptReferenceLinking();; CConcept* saturationConcept = conceptSatItem->getSaturationConcept(); //if (CIRIName::getRecentIRIName(saturationConcept->getClassNameLinker()) == "http://www.owllink.org/testsuite/galen#Transport") { // bool debug = true; //} CReapplyConceptLabelSet* conSet = individualProcessNode->getReapplyConceptLabelSet(false); cint64 totalConceptCount = conSet->getConceptCount(); cint64 conSetSignature = conSet->getConceptSignature()->getSignatureValue(); CConceptDescriptor* conDes = conSet->getAddingSortedConceptDescriptionLinker(); CConceptDescriptor* lastPossiblyNonDeterministicConDes = nullptr; CConceptDescriptor* satConDes = nullptr; CDependencyTrackPoint* satConDepTrackPoint = nullptr; if (conSet->getConceptDescriptor(saturationConcept,satConDes,satConDepTrackPoint)) { for (CConceptDescriptor* conDesIt = conDes; conDesIt != lastConDes; conDesIt = conDesIt->getNext()) { CDependencyTrackPoint* depTrackPoint = conDesIt->getDependencyTrackPoint(); if (onlyAllNondeterministic) { lastPossiblyNonDeterministicConDes = conDesIt; } else if (!isDeterministicallyDependingOnSaturationConcept(individualProcessNode,depTrackPoint,satConDes,calcAlgContext)) { lastPossiblyNonDeterministicConDes = conDesIt; } } if (!cachingOnlyIfDeterministic || lastPossiblyNonDeterministicConDes == nullptr) { prepareCacheMessages(calcAlgContext); CTaskMemoryPoolAllocationManager* satCacheMemMan = mMemAllocMan; CContextBase* tmpContext = mTmpContext; CSaturationNodeAssociatedExpansionCacheExpansionWriteData* detExpWriteData = nullptr; CSaturationNodeAssociatedExpansionCacheExpansionWriteData* nondetExpWriteData = nullptr; bool hasTightAtMostRestriction = false; for (CConceptDescriptor* conDesIt = conDes; conDesIt && !hasTightAtMostRestriction; conDesIt = conDesIt->getNext()) { CConcept* concept = conDesIt->getConcept(); bool negation = conDesIt->isNegated(); cint64 conCode = concept->getConceptOperator()->getOperatorCode(); if (negation && conCode == CCATLEAST || !negation && conCode == CCATMOST) { CRole* role = concept->getRole(); cint64 parameter = concept->getParameter(); cint64 cardinality = parameter+1*negation; if (individualProcessNode->getRoleSuccessorCount(role) >= cardinality) { hasTightAtMostRestriction = true; } } } CSaturationNodeAssociatedDependentNominalSet* nomDepSet = nullptr; CSuccessorConnectedNominalSet* successorNominalConnSet = individualProcessNode->getSuccessorNominalConnectionSet(false); if (successorNominalConnSet) { nomDepSet = CObjectParameterizingAllocator< CSaturationNodeAssociatedDependentNominalSet,CContext* >::allocateAndConstructAndParameterize(satCacheMemMan,tmpContext); for (CSuccessorConnectedNominalSet::const_iterator it = successorNominalConnSet->constBegin(), itEnd = successorNominalConnSet->constEnd(); it != itEnd; ++it) { cint64 nominalID = *it; nomDepSet->insert(nominalID); } } if (lastPossiblyNonDeterministicConDes) { // create non-deterministic expansion data nondetExpWriteData = CObjectAllocator< CSaturationNodeAssociatedExpansionCacheExpansionWriteData >::allocateAndConstruct(satCacheMemMan); CSaturationNodeAssociatedConceptLinker* nonDetConceptLinker = nullptr; CConceptDescriptor* conDesStop = lastPossiblyNonDeterministicConDes->getNext(); for (CConceptDescriptor* conDesIt = conDes; conDesIt != conDesStop; conDesIt = conDesIt->getNext()) { const CCacheValue& cacheValue(getCacheValueForConcept(conDesIt->getConcept(),conDesIt->isNegated(),calcAlgContext)); CSaturationNodeAssociatedConceptLinker* assConceptLinker = CObjectAllocator< CSaturationNodeAssociatedConceptLinker >::allocateAndConstruct(satCacheMemMan); assConceptLinker->initConceptLinker(cacheValue); nonDetConceptLinker = assConceptLinker->append(nonDetConceptLinker); } nondetExpWriteData->initExpansionWriteData(satIndiNode,nonDetConceptLinker); nondetExpWriteData->setDeterministicExpansion(false); nondetExpWriteData->setTightAtMostRestriction(hasTightAtMostRestriction); nondetExpWriteData->setConceptSetSignature(conSetSignature); nondetExpWriteData->setTotalConceptCount(totalConceptCount); nondetExpWriteData->setDependentNominalSet(nomDepSet); } if (!lastPossiblyNonDeterministicConDes || lastPossiblyNonDeterministicConDes->getNext() != lastConDes) { CSaturationNodeAssociatedDeterministicConceptExpansion* detConExp = nullptr; if (cacheEntry) { detConExp = cacheEntry->getDeterministicConceptExpansion(); } CSaturationNodeAssociatedConceptLinker* detConceptLinker = nullptr; CConceptDescriptor* conDesStart = nullptr; if (lastPossiblyNonDeterministicConDes) { conDesStart = lastPossiblyNonDeterministicConDes->getNext(); } if (!conDesStart) { conDesStart = conDes; } for (CConceptDescriptor* conDesIt = conDesStart; conDesIt != lastConDes; conDesIt = conDesIt->getNext()) { CCacheValue cacheValue(getCacheValueForConcept(conDesIt->getConcept(),conDesIt->isNegated(),calcAlgContext)); if (!detConExp || !detConExp->hasConceptExpansionLinker(&cacheValue)) { CSaturationNodeAssociatedConceptLinker* assConceptLinker = CObjectAllocator< CSaturationNodeAssociatedConceptLinker >::allocateAndConstruct(satCacheMemMan); assConceptLinker->initConceptLinker(cacheValue); detConceptLinker = assConceptLinker->append(detConceptLinker); } } if (detConceptLinker || !detConExp || detConExp->requiresNonDeterministicExpansion() && !detConceptLinker) { detExpWriteData = CObjectAllocator< CSaturationNodeAssociatedExpansionCacheExpansionWriteData >::allocateAndConstruct(satCacheMemMan); detExpWriteData->initExpansionWriteData(satIndiNode,detConceptLinker); detExpWriteData->setDeterministicExpansion(true); if (!lastPossiblyNonDeterministicConDes) { detExpWriteData->setRequiresNondeterministicExpansion(false); detExpWriteData->setTightAtMostRestriction(hasTightAtMostRestriction); detExpWriteData->setConceptSetSignature(conSetSignature); detExpWriteData->setTotalConceptCount(totalConceptCount); detExpWriteData->setDependentNominalSet(nomDepSet); } } } bool wroteCacheData = false; if (nondetExpWriteData) { wroteCacheData = true; addCacheMessages(nondetExpWriteData,calcAlgContext); } if (detExpWriteData) { wroteCacheData = true; addCacheMessages(detExpWriteData,calcAlgContext); } return wroteCacheData; } } } return false; } bool CSaturationNodeExpansionCacheHandler::isDeterministicallyDependingOnSaturationConcept(CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint, CConceptDescriptor* saturationConceptDescriptor, CCalculationAlgorithmContext* calcAlgContext) { CDependencyTrackPoint* satConDepTrackPoint = saturationConceptDescriptor->getDependencyTrackPoint(); if (!satConDepTrackPoint || !depTrackPoint) { return false; } else { if (satConDepTrackPoint->getBranchingTag() != depTrackPoint->getBranchingTag()) { return false; } } cint64 ancDepth = individualNode->getIndividualAncestorDepth(); if (ancDepth <= 0) { if (depTrackPoint->isPointingToIndependentDependencyNode()) { return false; } } else { CDependencyNode* depNode = depTrackPoint->getDependencyNode(); if (depNode->hasAppropriateIndividualNode()) { CIndividualProcessNode* appIndiNode = depNode->getAppropriateIndividualNode(); cint64 appIndiAncDepth = appIndiNode->getIndividualAncestorDepth(); if (appIndiAncDepth < ancDepth) { return false; } //if (!appIndiNode->isNominalIndividual()) { //} } else { CDependencyNode::DEPENDENCNODEYTYPE depType = depNode->getDependencyType(); if (depType == CDependencyNode::DNTMERGEDCONCEPT) { return false; } } } return true; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIncrementalCompletionGraphCompatibleExpansionHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIncrementalCompletionGraphCompatibl0000644000175000017500000001635312520551006032350 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIncrementalCompletionGraphCompatibleExpansionHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIncrementalCompletionGraphCompatibleExpansionHandler::CIncrementalCompletionGraphCompatibleExpansionHandler() { } CIncrementalCompletionGraphCompatibleExpansionHandler::~CIncrementalCompletionGraphCompatibleExpansionHandler() { } CSatisfiableCalculationTask* CIncrementalCompletionGraphCompatibleExpansionHandler::getPreviousDeterministicCompletionGraphTask(CCalculationAlgorithmContext* calcAlgContext) { CSatisfiableTaskIncrementalConsistencyTestingAdapter* incConsTestAdapter = calcAlgContext->getSatisfiableCalculationTask()->getSatisfiableTaskIncrementalConsistencyTestingAdapter(); if (incConsTestAdapter) { CConcreteOntology* prevConsOntology = incConsTestAdapter->getPreviousConsistentOntology(); if (prevConsOntology) { CConsistence* consistence = prevConsOntology->getConsistence(); if (consistence) { CConsistenceData* consData = consistence->getConsistenceModelData(); if (consData) { CConsistenceTaskData* consTaskData = dynamic_cast(consData); if (consTaskData) { CSatisfiableCalculationTask* prevCompGraphCalcTask = consTaskData->getDeterministicSatisfiableTask(); return prevCompGraphCalcTask; } } } } } return nullptr; } CSatisfiableCalculationTask* CIncrementalCompletionGraphCompatibleExpansionHandler::getPreviousNondeterministicCompletionGraphTask(CCalculationAlgorithmContext* calcAlgContext) { CSatisfiableTaskIncrementalConsistencyTestingAdapter* incConsTestAdapter = calcAlgContext->getSatisfiableCalculationTask()->getSatisfiableTaskIncrementalConsistencyTestingAdapter(); if (incConsTestAdapter) { CConcreteOntology* prevConsOntology = incConsTestAdapter->getPreviousConsistentOntology(); if (prevConsOntology) { CConsistence* consistence = prevConsOntology->getConsistence(); if (consistence) { CConsistenceData* consData = consistence->getConsistenceModelData(); if (consData) { CConsistenceTaskData* consTaskData = dynamic_cast(consData); if (consTaskData) { CSatisfiableCalculationTask* prevCompGraphCalcTask = consTaskData->getCompletionGraphCachedSatisfiableTask(); return prevCompGraphCalcTask; } } } } } return nullptr; } CIndividualProcessNode* CIncrementalCompletionGraphCompatibleExpansionHandler::getPreviousDeterministicCompletionGraphCorrespondingIndividualNode(CIndividualProcessNode* individualNode, CCalculationAlgorithmContext* calcAlgContext) { CIndividualProcessNode* prevIndiNode = nullptr; CIndividualNodeIncrementalExpansionData* incExpData = individualNode->getIncrementalExpansionData(false); if (!incExpData || !incExpData->isPreviousCompletionGraphCorrespondenceIndividualNodeLoaded()) { CIndividualNodeIncrementalExpansionData* locIncExpData = individualNode->getIncrementalExpansionData(true); CSatisfiableCalculationTask* prevCompGraphCalcTask = getPreviousDeterministicCompletionGraphTask(calcAlgContext); if (prevCompGraphCalcTask) { CIndividualProcessNodeVector* prevCompGraphProcNodeVec = prevCompGraphCalcTask->getProcessingDataBox()->getIndividualProcessNodeVector(); if (prevCompGraphProcNodeVec) { prevIndiNode = prevCompGraphProcNodeVec->getData(individualNode->getIndividualID()); } } locIncExpData->setPreviousCompletionGraphCorrespondenceIndividualNode(prevIndiNode); locIncExpData->setPreviousCompletionGraphCorrespondenceIndividualNodeLoaded(true); incExpData = locIncExpData; } prevIndiNode = incExpData->getPreviousCompletionGraphCorrespondenceIndividualNode(); return prevIndiNode; } bool CIncrementalCompletionGraphCompatibleExpansionHandler::isIndividualNodePreviousCompletionGraphCompatible(CIndividualProcessNode* individualNode, CCalculationAlgorithmContext* calcAlgContext) { CIndividualNodeIncrementalExpansionData* incExpData = individualNode->getIncrementalExpansionData(false); CReapplyConceptLabelSet* conSet = individualNode->getReapplyConceptLabelSet(false); CConceptDescriptor* lastConDes = conSet->getAddingSortedConceptDescriptionLinker(); CConceptDescriptor* lastCheckedConDes = incExpData->getLastCompatibleCheckedConceptDescriptor(); bool compatible = incExpData->isPreviousCompletionGraphCompatible(); if (!individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED) && lastCheckedConDes != lastConDes) { // recheck compatibility CIndividualProcessNode* prevIndiNode = getPreviousDeterministicCompletionGraphCorrespondingIndividualNode(individualNode,calcAlgContext); if (prevIndiNode && !prevIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED)) { bool incompatibleConcepts = false; CReapplyConceptLabelSet* prevConSet = prevIndiNode->getReapplyConceptLabelSet(false); if (conSet->getConceptSignatureValue() == prevConSet->getConceptSignatureValue() && prevConSet->getConceptCount() == conSet->getConceptCount()) { CReapplyConceptLabelSetIterator conSetIt = conSet->getConceptLabelSetIterator(true); CReapplyConceptLabelSetIterator prevConSetIt = prevConSet->getConceptLabelSetIterator(true); while (conSetIt.hasNext() && prevConSetIt.hasNext()) { CConceptDescriptor* conDes = conSetIt.getConceptDescriptor(); CConceptDescriptor* prevConDes = prevConSetIt.getConceptDescriptor(); if (conDes->getConcept() != prevConDes->getConcept() || conDes->isNegated() != prevConDes->isNegated()) { incompatibleConcepts = true; } conSetIt.moveNext(); prevConSetIt.moveNext(); } } else { incompatibleConcepts = true; } if (!incompatibleConcepts) { compatible = true; } } CIndividualNodeIncrementalExpansionData* locIncExpData = individualNode->getIncrementalExpansionData(true); locIncExpData->setPreviousCompletionGraphCompatible(compatible); locIncExpData->setLastCompatibleCheckedConceptDescriptor(lastConDes); } return compatible; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeCompareValueSpaceHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeCompareValueSp0000644000175000017500000007407612520551006032312 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeCompareValueSpaceHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualProcessNodeCompareValueSpaceHandler::CIndividualProcessNodeCompareValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType) : CIndividualProcessNodeValueSpaceHandler(valueSpaceType) { mCompareValueSpaceType = (CDatatypeValueSpaceCompareType*)valueSpaceType; } bool CIndividualProcessNodeCompareValueSpaceHandler::addDataLiteral(CIndividualProcessNode* indiProcNode, CDataLiteral* dataLiteral, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CDataLiteralValue* dataLitValue = dataLiteral->getDataLiteralValue(); CDataLiteralCompareValue* dataLitCompareValue = dynamic_cast(dataLitValue); CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeCompareValueSpaceData* compareValueSpaceData = (CDatatypeCompareValueSpaceData*)datatypesSpaceValue->getValueSpace(mCompareValueSpaceType,true); bool newValuesPotentiallyExcluded = false; if (!compareValueSpaceData->isValueSpaceClashed() && dataLitCompareValue) { CDatatypeCompareValueSpaceMap* compareValueSpaceMap = compareValueSpaceData->getValueSpaceMap(true); if (!negated) { newValuesPotentiallyExcluded |= compareValueSpaceMap->restrictToValue(dataLitCompareValue,depTrackPoint); } else { newValuesPotentiallyExcluded |= compareValueSpaceMap->excludeValue(dataLitCompareValue,depTrackPoint); } } if (newValuesPotentiallyExcluded) { datatypesSpaceValue->setValueSapceModified(compareValueSpaceData); compareValueSpaceData->setValueSpaceInitialisationDependencyTrackPointCandidate(depTrackPoint); } return newValuesPotentiallyExcluded; } bool CIndividualProcessNodeCompareValueSpaceHandler::addDataRestriction(CIndividualProcessNode* indiProcNode, CConcept* dataRestricionConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CDatatype* datatype = dataRestricionConcept->getDatatype(); cint64 restrictionCode = dataRestricionConcept->getParameter(); CDataLiteral* dataLiteral = dataRestricionConcept->getDataLiteral(); CDataLiteralValue* restrictionDataLitValue = nullptr; if (dataLiteral) { restrictionDataLitValue = dataLiteral->getDataLiteralValue(); } CDataLiteralCompareValue* restrictionDataLitCompareValue = nullptr; if (restrictionDataLitValue) { restrictionDataLitCompareValue = dynamic_cast(restrictionDataLitValue); } CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeCompareValueSpaceData* compareValueSpaceData = (CDatatypeCompareValueSpaceData*)datatypesSpaceValue->getValueSpace(mCompareValueSpaceType,true); if (compareValueSpaceData->isValueSpaceClashed()) { return false; } CDatatypeCompareValueSpaceMap* compareValueSpaceMap = compareValueSpaceData->getValueSpaceMap(true); bool newValuesPotentiallyExcluded = false; if (restrictionDataLitCompareValue) { if (!negated) { if (restrictionCode == CDFC_MIN_EXCLUSIVE) { newValuesPotentiallyExcluded |= compareValueSpaceMap->excludeMinimum(restrictionDataLitCompareValue,true,depTrackPoint); } else if (restrictionCode == CDFC_MIN_INCLUSIVE) { newValuesPotentiallyExcluded |= compareValueSpaceMap->excludeMinimum(restrictionDataLitCompareValue,false,depTrackPoint); } else if (restrictionCode == CDFC_MAX_INCLUSIVE) { newValuesPotentiallyExcluded |= compareValueSpaceMap->excludeMaximum(restrictionDataLitCompareValue,false,depTrackPoint); } else if (restrictionCode == CDFC_MAX_EXCLUSIVE) { newValuesPotentiallyExcluded |= compareValueSpaceMap->excludeMaximum(restrictionDataLitCompareValue,true,depTrackPoint); } } else { if (restrictionCode == CDFC_MIN_EXCLUSIVE) { newValuesPotentiallyExcluded |= compareValueSpaceMap->excludeMaximum(restrictionDataLitCompareValue,false,depTrackPoint); } else if (restrictionCode == CDFC_MIN_INCLUSIVE) { newValuesPotentiallyExcluded |= compareValueSpaceMap->excludeMaximum(restrictionDataLitCompareValue,true,depTrackPoint); } else if (restrictionCode == CDFC_MAX_INCLUSIVE) { newValuesPotentiallyExcluded |= compareValueSpaceMap->excludeMinimum(restrictionDataLitCompareValue,true,depTrackPoint); } else if (restrictionCode == CDFC_MAX_EXCLUSIVE) { newValuesPotentiallyExcluded |= compareValueSpaceMap->excludeMinimum(restrictionDataLitCompareValue,false,depTrackPoint); } } } if (newValuesPotentiallyExcluded) { datatypesSpaceValue->setValueSapceModified(compareValueSpaceData); compareValueSpaceData->setValueSpaceInitialisationDependencyTrackPointCandidate(depTrackPoint); } return newValuesPotentiallyExcluded; } bool CIndividualProcessNodeCompareValueSpaceHandler::testValueSpaceClashed(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext) { CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeCompareValueSpaceData* compareValueSpaceData = (CDatatypeCompareValueSpaceData*)datatypesSpaceValue->getValueSpace(mCompareValueSpaceType,false); if (compareValueSpaceData) { if (compareValueSpaceData->isValueSpaceClashed()) { return true; } CDatatypeCompareValueSpaceMap* compareValueSpaceMap = compareValueSpaceData->getValueSpaceMap(false); if (compareValueSpaceMap) { bool clashed = compareValueSpaceMap->testValueSpaceReturnClashed(); if (clashed) { compareValueSpaceMap->addValueSpaceDependencies(compareValueSpaceData->getClashDependencyTrackPointCollection()); compareValueSpaceData->setValueSpaceClashed(true); return true; } } } return false; } bool CIndividualProcessNodeCompareValueSpaceHandler::addValueSpaceDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext) { CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeCompareValueSpaceData* compareValueSpaceData = (CDatatypeCompareValueSpaceData*)datatypesSpaceValue->getValueSpace(mCompareValueSpaceType,false); if (compareValueSpaceData) { if (!compareValueSpaceData->isValueSpaceClashed()) { CDatatypeCompareValueSpaceMap* compareValueSpaceMap = compareValueSpaceData->getValueSpaceMap(false); if (compareValueSpaceMap) { return compareValueSpaceMap->addValueSpaceDependencies(depCollection); } } else { return compareValueSpaceData->getClashDependencyTrackPointCollection()->addCollectionDependencies(depCollection); } } return false; } bool CIndividualProcessNodeCompareValueSpaceHandler::countPossibleValueSpaceValues(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceValuesCounter* valueCounter, CCalculationAlgorithmContext* calcAlgContext) { bool counted = false; CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeCompareValueSpaceData* compareValueSpaceData = (CDatatypeCompareValueSpaceData*)datatypesSpaceValue->getValueSpace(mCompareValueSpaceType,false); if (compareValueSpaceData) { if (!compareValueSpaceData->isValueSpaceClashed()) { if (!compareValueSpaceData->isValueSpaceCounted() || compareValueSpaceData->isValueSpaceCountingRequired()) { compareValueSpaceData = (CDatatypeCompareValueSpaceData*)datatypesSpaceValue->getValueSpace(mCompareValueSpaceType,true); CDatatypeValueSpaceValuesCounter* valueSpaceValueCounter = compareValueSpaceData->getValuesCounter(); valueSpaceValueCounter->resetValueCounter(); CDatatypeCompareValueSpaceMap* compareValueSpaceMap = compareValueSpaceData->getValueSpaceMap(false); if (compareValueSpaceMap) { compareValueSpaceMap->countAllValues(valueSpaceValueCounter); } else { if (mCompareValueSpaceType->hasInfiniteManyValues()) { valueSpaceValueCounter->incInfinite(); } else { valueSpaceValueCounter->incValueCount(mCompareValueSpaceType->getMaximumValueCount()); } } compareValueSpaceData->setValueSpaceCounted(true); compareValueSpaceData->setValueSpaceCountingRequired(false); if (valueCounter) { counted = valueCounter->combineWithValueCounter(valueSpaceValueCounter); } } else { CDatatypeValueSpaceValuesCounter* valueSpaceValueCounter = compareValueSpaceData->getValuesCounter(); if (valueCounter) { counted = valueCounter->combineWithValueCounter(valueSpaceValueCounter); } } } } else { if (valueCounter) { counted = valueCounter->incInfinite(); } } return counted; } CConceptDescriptor* CIndividualProcessNodeCompareValueSpaceHandler::triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, cint64& remainingRequiredValuesCount, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext) { CConceptDescriptor* conceptTriggerLinker = appendConceptLinker; CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CConcreteOntology* ontology = calcAlgContext->getUsedProcessingDataBox()->getOntology(); bool substractValueSpaceValuesCount = false; CDatatypeCompareValueSpaceData* compareValueSpaceData = (CDatatypeCompareValueSpaceData*)datatypesSpaceValue->getValueSpace(mCompareValueSpaceType,false); if (!compareValueSpaceData || (!compareValueSpaceData->isValueSpaceClashed() && !compareValueSpaceData->isValueSpaceTriggeringCompleted())) { compareValueSpaceData = (CDatatypeCompareValueSpaceData*)datatypesSpaceValue->getValueSpace(mCompareValueSpaceType,true); bool valueSpaceTriggeringFinished = false; if (!compareValueSpaceData->isValueSpaceTriggeringStarted()) { compareValueSpaceData->setValueSpaceTriggeringStarted(true); } CDatatypeCompareValueSpaceMap* compareValueSpaceMap = compareValueSpaceData->getValueSpaceMap(true); CDatatypeValueSpacesTriggers* valueSpacesTriggers = ontology->getDataBoxes()->getMBox()->getValueSpacesTriggers(false); if (valueSpacesTriggers) { CDatatypeValueSpaceCompareTriggers* compareValueSpaceTriggers = (CDatatypeValueSpaceCompareTriggers*)valueSpacesTriggers->getValueSpaceTriggers(mCompareValueSpaceType); CDatatypeValueSpaceTriggeringMap* compareValueSpaceTriggerMap = compareValueSpaceTriggers->getValueSpaceTriggeringMap(); depCollection->addDependency(compareValueSpaceData->getValueSpaceInitialisationDependencyTrackPoint()); CDatatypeValueSpaceConceptTriggeringData* valueSpaceConceptTriggeringData = compareValueSpaceTriggers->getValueSpaceConceptTriggeringData(); if (valueSpaceConceptTriggeringData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,valueSpaceConceptTriggeringData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } CDataLiteralCompareValue* minValue = nullptr; bool minValueInclusive = false; CDependencyTrackPoint* minValueDepTrackPoint = nullptr; if (compareValueSpaceMap->getAbsoluteMinimumValue(minValue,minValueInclusive,&minValueDepTrackPoint)) { CDatatypeDependencyCollection minValueDepCollection(depCollection,calcAlgContext); bool minDatatypeDepAdded = false; CDatatypeValueSpaceTriggeringIterator leftTriggerIt = compareValueSpaceTriggerMap->getLeftTriggeringIterator(minValue,!minValueInclusive); while (leftTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = leftTriggerIt.next(); CDatatypeValueSpaceConceptTriggeringData* minExcTriggeringConceptData = triggeringData->getMinExclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* minIncTriggeringConceptData = triggeringData->getMinInclusiveTriggeringData(); if (minExcTriggeringConceptData->hasPartialConceptTriggers() || minIncTriggeringConceptData->hasPartialConceptTriggers()) { if (!minDatatypeDepAdded && minValueDepTrackPoint) { minDatatypeDepAdded = true; minValueDepCollection.addDependency(minValueDepTrackPoint); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minExcTriggeringConceptData->getPartialConceptTriggerLinker(),&minValueDepCollection,calcAlgContext); conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minIncTriggeringConceptData->getPartialConceptTriggerLinker(),&minValueDepCollection,calcAlgContext); } } CDatatypeValueSpaceTriggeringData* minValueTriggerData = compareValueSpaceTriggerMap->getDatatypeValueTriggeringData(minValue,false); if (minValueTriggerData) { CDatatypeValueSpaceConceptTriggeringData* minTriggeringConceptData = nullptr; if (!minValueInclusive) { minTriggeringConceptData = minValueTriggerData->getMinExclusiveTriggeringData(); } else { minTriggeringConceptData = minValueTriggerData->getMinInclusiveTriggeringData(); } if (minTriggeringConceptData->hasPartialConceptTriggers()) { if (!minDatatypeDepAdded && minValueDepTrackPoint) { minDatatypeDepAdded = true; minValueDepCollection.addDependency(minValueDepTrackPoint); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minTriggeringConceptData->getPartialConceptTriggerLinker(),&minValueDepCollection,calcAlgContext); } } } CDataLiteralCompareValue* maxValue = nullptr; bool maxValueInclusive = false; CDependencyTrackPoint* maxValueDepTrackPoint = nullptr; if (compareValueSpaceMap->getAbsoluteMaximumValue(maxValue,maxValueInclusive,&maxValueDepTrackPoint)) { CDatatypeDependencyCollection maxValueDepCollection(depCollection,calcAlgContext); bool maxDatatypeDepAdded = false; CDatatypeValueSpaceTriggeringIterator rightTriggerIt = compareValueSpaceTriggerMap->getRightTriggeringIterator(maxValue,!maxValueInclusive); while (rightTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = rightTriggerIt.next(); CDatatypeValueSpaceConceptTriggeringData* maxExcTriggeringConceptData = triggeringData->getMaxExclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* maxIncTriggeringConceptData = triggeringData->getMaxInclusiveTriggeringData(); if (maxExcTriggeringConceptData->hasPartialConceptTriggers() || maxIncTriggeringConceptData->hasPartialConceptTriggers()) { if (!maxDatatypeDepAdded && maxValueDepTrackPoint) { maxDatatypeDepAdded = true; maxValueDepCollection.addDependency(minValueDepTrackPoint); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxExcTriggeringConceptData->getPartialConceptTriggerLinker(),&maxValueDepCollection,calcAlgContext); conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxIncTriggeringConceptData->getPartialConceptTriggerLinker(),&maxValueDepCollection,calcAlgContext); } } CDatatypeValueSpaceTriggeringData* maxValueTriggerData = compareValueSpaceTriggerMap->getDatatypeValueTriggeringData(maxValue,false); if (maxValueTriggerData) { CDatatypeValueSpaceConceptTriggeringData* maxTriggeringConceptData = nullptr; if (!maxValueInclusive) { maxTriggeringConceptData = maxValueTriggerData->getMaxExclusiveTriggeringData(); } else { maxTriggeringConceptData = maxValueTriggerData->getMaxInclusiveTriggeringData(); } if (maxTriggeringConceptData->hasPartialConceptTriggers()) { if (!maxDatatypeDepAdded && maxValueDepTrackPoint) { maxDatatypeDepAdded = true; maxValueDepCollection.addDependency(maxValueDepTrackPoint); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxTriggeringConceptData->getPartialConceptTriggerLinker(),&maxValueDepCollection,calcAlgContext); } } } if (minValue && maxValue) { CDatatypeValueSpaceValuesCounter valueCounter; CDataLiteralCompareValue* freeLeftValue = nullptr; CDataLiteralCompareValue* freeRightValue = nullptr; bool freeLeftValueInclusive = false; bool freeRightValueInclusive = false; if (compareValueSpaceTriggerMap->getIntervalMinMaxTriggerFreeInterval(minValue,minValueInclusive,maxValue,maxValueInclusive,freeLeftValue,freeLeftValueInclusive,freeRightValue,freeRightValueInclusive)) { if (freeLeftValue && freeRightValue) { CDatatypeValueSpaceValuesCounter tmpValueCounter; if (compareValueSpaceMap->countIntervalValues(freeLeftValue,freeLeftValueInclusive,freeRightValue,freeRightValueInclusive,&tmpValueCounter)) { cint64 triggerValueCount = 0; if (compareValueSpaceTriggerMap->countIntervalValueTriggers(minValue,minValueInclusive,maxValue,maxValueInclusive,triggerValueCount)) { valueCounter.combineWithValueCounter(&tmpValueCounter,triggerValueCount); } } } } if (!valueCounter.hasValueAchieved(remainingRequiredValuesCount)) { bool minToMaxTriggerDirection = true; cint64 minTriggerCount = 0; cint64 maxTriggerCount = 0; cint64 valueTriggerCount = 0; compareValueSpaceTriggerMap->countIntervalMinMaxValueTriggers(minValue,minValueInclusive,maxValue,maxValueInclusive,minTriggerCount,maxTriggerCount,valueTriggerCount); if (minTriggerCount < maxTriggerCount) { minToMaxTriggerDirection = false; } depCollection->addDependency(minValueDepTrackPoint); depCollection->addDependency(maxValueDepTrackPoint); CDatatypeValueSpaceTriggeringIterator triggerIt = compareValueSpaceTriggerMap->getIntervalTriggeringIterator(minValue,minValueInclusive,maxValue,maxValueInclusive,minToMaxTriggerDirection); if (minTriggerCount > 0 && maxTriggerCount > 0) { CDatatypeValueSpaceTriggeringIterator minMaxDirectionTriggerIt = triggerIt; while (minMaxDirectionTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = minMaxDirectionTriggerIt.next(); if (minToMaxTriggerDirection) { CDatatypeValueSpaceConceptTriggeringData* maxExcTriggeringConceptData = triggeringData->getMaxExclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* maxIncTriggeringConceptData = triggeringData->getMaxInclusiveTriggeringData(); if (maxExcTriggeringConceptData->hasPartialConceptTriggers() || maxIncTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxExcTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxIncTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } else { CDatatypeValueSpaceConceptTriggeringData* minExcTriggeringConceptData = triggeringData->getMinExclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* minIncTriggeringConceptData = triggeringData->getMinInclusiveTriggeringData(); if (minExcTriggeringConceptData->hasPartialConceptTriggers() || minIncTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minExcTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minIncTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } } } if (!minValue->isEqualTo(maxValue)) { CDataLiteralCompareValue* lastValue = nullptr; if (minToMaxTriggerDirection) { lastValue = minValue; } else { lastValue = maxValue; } CDatatypeValueSpaceTriggeringIterator stepMinMaxDirectionTriggerIt = triggerIt; while (!valueCounter.hasValueAchieved(remainingRequiredValuesCount) && stepMinMaxDirectionTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = stepMinMaxDirectionTriggerIt.next(); CDataLiteralCompareValue* currentValue = triggeringData->getValue(); if (lastValue && !lastValue->isEqualTo(currentValue)) { if (minToMaxTriggerDirection) { compareValueSpaceMap->countIntervalValues(lastValue,false,currentValue,false,&valueCounter); compareValueSpaceMap->addIntervalExclusionDependencies(lastValue,false,currentValue,false,depCollection); } else { compareValueSpaceMap->countIntervalValues(currentValue,false,lastValue,false,&valueCounter); compareValueSpaceMap->addIntervalExclusionDependencies(currentValue,false,lastValue,false,depCollection); } } if (minToMaxTriggerDirection) { CDatatypeValueSpaceConceptTriggeringData* minExcTriggeringConceptData = triggeringData->getMinExclusiveTriggeringData(); if (minExcTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minExcTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } else { CDatatypeValueSpaceConceptTriggeringData* maxExcTriggeringConceptData = triggeringData->getMaxExclusiveTriggeringData(); if (maxExcTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxExcTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } if (!triggeringData->getDirectValueTriggeringData()->hasPartialConceptTriggers()) { compareValueSpaceMap->countValueValues(currentValue,&valueCounter); compareValueSpaceMap->addValueExclusionDependencies(currentValue,depCollection); } if (!valueCounter.hasValueAchieved(remainingRequiredValuesCount)) { if (minToMaxTriggerDirection) { CDatatypeValueSpaceConceptTriggeringData* minIncTriggeringConceptData = triggeringData->getMinInclusiveTriggeringData(); if (minIncTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minIncTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } else { CDatatypeValueSpaceConceptTriggeringData* maxIncTriggeringConceptData = triggeringData->getMaxInclusiveTriggeringData(); if (maxIncTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxIncTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } } } } CDatatypeValueSpaceTriggeringIterator valueDirectionTriggerIt = triggerIt; while (!valueCounter.hasValueAchieved(remainingRequiredValuesCount) && valueDirectionTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = valueDirectionTriggerIt.next(); CDataLiteralCompareValue* currentValue = triggeringData->getValue(); if (triggeringData->getDirectValueTriggeringData()->hasPartialConceptTriggers()) { compareValueSpaceMap->addValueExclusionDependencies(currentValue,depCollection); if (!compareValueSpaceMap->isValueExcluded(currentValue)) { compareValueSpaceMap->countValueValues(currentValue,&valueCounter); CDatatypeValueSpaceConceptTriggeringData* directValueTriggeringConceptData = triggeringData->getDirectValueTriggeringData(); if (directValueTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,directValueTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } } } } remainingRequiredValuesCount -= valueCounter.getValueCount(); if (valueCounter.isInfinite()) { remainingRequiredValuesCount = 0; } if (remainingRequiredValuesCount < 0) { remainingRequiredValuesCount = 0; } if (remainingRequiredValuesCount > 0) { valueSpaceTriggeringFinished = true; } } } else { valueSpaceTriggeringFinished = true; substractValueSpaceValuesCount = true; } if (valueSpaceTriggeringFinished) { if (!compareValueSpaceData->isValueSpaceTriggeringCompleted()) { compareValueSpaceData->setValueSpaceTriggeringCompleted(true); } } } else { substractValueSpaceValuesCount = true; } if (substractValueSpaceValuesCount) { CDatatypeValueSpaceValuesCounter valueCounter; countPossibleValueSpaceValues(indiProcNode,&valueCounter,calcAlgContext); if (valueCounter.isInfinite()) { remainingRequiredValuesCount = 0; } else { remainingRequiredValuesCount -= valueCounter.getValueCount(); if (remainingRequiredValuesCount <= 0) { remainingRequiredValuesCount = 0; } else { addValueSpaceDependencies(indiProcNode,depCollection,calcAlgContext); } } } return conceptTriggerLinker; } bool CIndividualProcessNodeCompareValueSpaceHandler::getNextPossibleDataValue(CIndividualProcessNode* indiProcNode, CDataLiteralValue*& nextValue, CDataLiteralValue* lastValue, CDatatypeValueTestingCollection* valueTestingCollection, CCalculationAlgorithmContext* calcAlgContext) { CDataLiteralCompareValue* lastCompareValue = nullptr; if (lastValue) { lastCompareValue = dynamic_cast(lastValue); } CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CConcreteOntology* ontology = calcAlgContext->getUsedProcessingDataBox()->getOntology(); CDatatypeCompareValueSpaceData* compareValueSpaceData = (CDatatypeCompareValueSpaceData*)datatypesSpaceValue->getValueSpace(mCompareValueSpaceType,true); if (compareValueSpaceData && !compareValueSpaceData->isValueSpaceClashed()) { CDataLiteralValue* tmpNextValue = valueTestingCollection->createDataLiteralValue(mCompareValueSpaceType); CDataLiteralCompareValue* nextCompareValue = dynamic_cast(tmpNextValue); CDataLiteralValue* tmpLastValue = nullptr; CDataLiteralCompareValue* tmpLastCompareValue = nullptr; if (lastCompareValue) { tmpLastValue = valueTestingCollection->createDataLiteralValue(mCompareValueSpaceType); tmpLastCompareValue = dynamic_cast(tmpLastValue); tmpLastCompareValue->initValue(lastCompareValue); } CDatatypeCompareValueSpaceMap* compareValueSpaceMap = compareValueSpaceData->getValueSpaceMap(true); bool searchNextValue = true; while (searchNextValue) { if (compareValueSpaceMap->getNextPossibleDataValue(nextCompareValue,tmpLastCompareValue)) { if (!valueTestingCollection->isDataLiteralValueUsed(tmpNextValue,mCompareValueSpaceType)) { valueTestingCollection->releaseDataLiteralValue(tmpLastValue,mCompareValueSpaceType); nextValue = tmpNextValue; return true; } } else { searchNextValue = false; } if (!tmpLastCompareValue) { tmpLastValue = valueTestingCollection->createDataLiteralValue(mCompareValueSpaceType); tmpLastCompareValue = dynamic_cast(tmpLastValue); tmpLastCompareValue->initValue(nextCompareValue); } else { tmpLastCompareValue->initValue(nextCompareValue); } } if (!searchNextValue) { valueTestingCollection->releaseDataLiteralValue(tmpNextValue,mCompareValueSpaceType); valueTestingCollection->releaseDataLiteralValue(tmpLastValue,mCompareValueSpaceType); } } return false; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeUnknownValueSpaceHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeUnknownValueSp0000644000175000017500000001203712520551012032345 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeUnknownValueSpaceHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualProcessNodeUnknownValueSpaceHandler::CIndividualProcessNodeUnknownValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType) : CIndividualProcessNodeValueSpaceHandler(valueSpaceType) { mUnknownValueSpaceType = (CDatatypeValueSpaceUnknownType*)valueSpaceType; } bool CIndividualProcessNodeUnknownValueSpaceHandler::addDataLiteral(CIndividualProcessNode* indiProcNode, CDataLiteral* dataLiteral, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { return false; } bool CIndividualProcessNodeUnknownValueSpaceHandler::addDataRestriction(CIndividualProcessNode* indiProcNode, CConcept* dataRestricionConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { return false; } bool CIndividualProcessNodeUnknownValueSpaceHandler::testValueSpaceClashed(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext) { CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeUnknownValueSpaceData* unknownValueSpaceData = datatypesSpaceValue->getUnknownValueSpace(mUnknownValueSpaceType,false); if (unknownValueSpaceData) { if (unknownValueSpaceData->isValueSpaceClashed()) { return true; } } return false; } bool CIndividualProcessNodeUnknownValueSpaceHandler::addValueSpaceDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext) { CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeUnknownValueSpaceData* unknownValueSpaceData = datatypesSpaceValue->getUnknownValueSpace(mUnknownValueSpaceType,false); if (unknownValueSpaceData) { if (unknownValueSpaceData->isValueSpaceClashed()) { return unknownValueSpaceData->getClashDependencyTrackPointCollection()->addCollectionDependencies(depCollection); } } return false; } bool CIndividualProcessNodeUnknownValueSpaceHandler::countPossibleValueSpaceValues(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceValuesCounter* valueCounter, CCalculationAlgorithmContext* calcAlgContext) { bool counted = false; CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(false); if (datatypesSpaceValue) { CDatatypeUnknownValueSpaceData* unknownValueSpaceData = datatypesSpaceValue->getUnknownValueSpace(mUnknownValueSpaceType,false); if (unknownValueSpaceData && unknownValueSpaceData->isValueSpaceClashed()) { return false; } } if (valueCounter) { counted = valueCounter->incInfinite(); } return counted; } CConceptDescriptor* CIndividualProcessNodeUnknownValueSpaceHandler::triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, cint64& remainingRequiredValuesCount, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext) { CConceptDescriptor* conceptTriggerLinker = appendConceptLinker; CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CConcreteOntology* ontology = calcAlgContext->getUsedProcessingDataBox()->getOntology(); CDatatypeUnknownValueSpaceData* unknownValueSpaceData = datatypesSpaceValue->getUnknownValueSpace(mUnknownValueSpaceType,false); if (!unknownValueSpaceData || !unknownValueSpaceData->isValueSpaceTriggeringCompleted()) { remainingRequiredValuesCount = 0; } return conceptTriggerLinker; } bool CIndividualProcessNodeUnknownValueSpaceHandler::getNextPossibleDataValue(CIndividualProcessNode* indiProcNode, CDataLiteralValue*& nextValue, CDataLiteralValue* lastValue, CDatatypeValueTestingCollection* valueTestingCollection, CCalculationAlgorithmContext* calcAlgContext) { return false; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CDatatypeValueTestingCollection.cpp0000644000175000017500000002023612520551004032134 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueTestingCollection.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CDatatypeValueTestingCollection::CDatatypeValueTestingCollection(CCalculationAlgorithmContext* collectionCalcAlgContext) { mCollectionCalcAlgContext = collectionCalcAlgContext; mFreeLinker = nullptr; for (cint64 i = 0; i < CDatatypeValueSpaceType::VALUESPACETYPECOUNT; ++i) { mFreeDataLiteralValueVec[i] = nullptr; mUseDataLiteralValueVec[i] = nullptr; } CTaskProcessorContext* taskProcessorContext = mCollectionCalcAlgContext->getUsedTaskProcessorContext(); } CDatatypeValueTestingCollection* CDatatypeValueTestingCollection::releaseUsedDataLiteralValues() { for (cint64 i = 0; i < CDatatypeValueSpaceType::VALUESPACETYPECOUNT; ++i) { CXLinker* dataLiteralValueLinker = mUseDataLiteralValueVec[i]; while (dataLiteralValueLinker) { CXLinker* tmpDataLiteralValueLinker = dataLiteralValueLinker; dataLiteralValueLinker = dataLiteralValueLinker->getNext(); tmpDataLiteralValueLinker->clearNext(); releaseFreeLinker(tmpDataLiteralValueLinker); } mUseDataLiteralValueVec[i] = nullptr; } return this; } CDatatypeValueTestingCollection* CDatatypeValueTestingCollection::addDataLiteralValueUse(CDataLiteralValue* dataLiteralValue, CDatatypeValueSpaceType* valueSpaceType) { cint64 valueSpaceIndex = valueSpaceType->getValueSpaceTypeIndex(); CXLinker* dataLiteralValueLinker = createFreeLinker(); dataLiteralValueLinker->initLinker(dataLiteralValue); mUseDataLiteralValueVec[valueSpaceIndex] = dataLiteralValueLinker->append(mUseDataLiteralValueVec[valueSpaceIndex]); return this; } bool CDatatypeValueTestingCollection::isDataLiteralValueUsed(CDataLiteralValue* dataLiteralValue, CDatatypeValueSpaceType* valueSpaceType) { cint64 valueSpaceIndex = valueSpaceType->getValueSpaceTypeIndex(); CXLinker* usedDataLiteralValueLinker = mUseDataLiteralValueVec[valueSpaceIndex]; for (CXLinker* usedDataLiteralValueLinkerIt = usedDataLiteralValueLinker; usedDataLiteralValueLinkerIt; usedDataLiteralValueLinkerIt = usedDataLiteralValueLinkerIt->getNext()) { CDataLiteralValue* usedDataLiteralValue = usedDataLiteralValueLinkerIt->getData(); if (usedDataLiteralValue->isEqualTo(dataLiteralValue)) { return true; } } return false; } CDataLiteralValue* CDatatypeValueTestingCollection::createDataLiteralValue(CDatatypeValueSpaceType* valueSpaceType) { CDataLiteralValue* dataLiteralValue = nullptr; cint64 valueSpaceIndex = valueSpaceType->getValueSpaceTypeIndex(); CXLinker* dataLiteralValueLinker = mFreeDataLiteralValueVec[valueSpaceIndex]; if (dataLiteralValueLinker) { dataLiteralValue = dataLiteralValueLinker->getData(); CXLinker* nextDataLiteralValueLinker = dataLiteralValueLinker->getNext(); mFreeDataLiteralValueVec[valueSpaceIndex] = nextDataLiteralValueLinker; dataLiteralValueLinker->clearNext(); releaseFreeLinker(dataLiteralValueLinker); } else { if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEREALTYPE) { dataLiteralValue = CObjectAllocator< CDataLiteralRealValue >::allocateAndConstruct(mCollectionCalcAlgContext->getUsedProcessTaskMemoryAllocationManager()); } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACESTRINGTYPE) { dataLiteralValue = CObjectAllocator< CDataLiteralStringValue >::allocateAndConstruct(mCollectionCalcAlgContext->getUsedProcessTaskMemoryAllocationManager()); } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEBOOLEANTYPE) { dataLiteralValue = CObjectAllocator< CDataLiteralBooleanValue>::allocateAndConstruct(mCollectionCalcAlgContext->getUsedProcessTaskMemoryAllocationManager()); } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEDOUBLETYPE) { dataLiteralValue = CObjectAllocator< CDataLiteralDoubleValue>::allocateAndConstruct(mCollectionCalcAlgContext->getUsedProcessTaskMemoryAllocationManager()); } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEFLOATTYPE) { dataLiteralValue = CObjectAllocator< CDataLiteralFloatValue>::allocateAndConstruct(mCollectionCalcAlgContext->getUsedProcessTaskMemoryAllocationManager()); } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEIRITYPE) { dataLiteralValue = CObjectAllocator< CDataLiteralIRIValue>::allocateAndConstruct(mCollectionCalcAlgContext->getUsedProcessTaskMemoryAllocationManager()); } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEXMLTYPE) { dataLiteralValue = CObjectAllocator< CDataLiteralXMLValue>::allocateAndConstruct(mCollectionCalcAlgContext->getUsedProcessTaskMemoryAllocationManager()); } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEHEXDATATYPE) { dataLiteralValue = CObjectParameterizingAllocator< CDataLiteralBinaryHexDataValue,CContext* >::allocateAndConstructAndParameterize(mCollectionCalcAlgContext->getUsedProcessTaskMemoryAllocationManager(),mCollectionCalcAlgContext); } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEBASE64DATATYPE) { dataLiteralValue = CObjectParameterizingAllocator< CDataLiteralBinaryBase64DataValue,CContext* >::allocateAndConstructAndParameterize(mCollectionCalcAlgContext->getUsedProcessTaskMemoryAllocationManager(),mCollectionCalcAlgContext); } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEDATETIMETYPE) { dataLiteralValue = CObjectAllocator< CDataLiteralDateTimeValue >::allocateAndConstruct(mCollectionCalcAlgContext->getUsedProcessTaskMemoryAllocationManager()); } } return dataLiteralValue; } CDatatypeValueTestingCollection* CDatatypeValueTestingCollection::releaseDataLiteralValue(CDataLiteralValue* dataLiteralValue, CDatatypeValueSpaceType* valueSpaceType) { if (dataLiteralValue) { cint64 valueSpaceIndex = valueSpaceType->getValueSpaceTypeIndex(); CXLinker* dataLiteralValueLinker = createFreeLinker(); dataLiteralValueLinker->initLinker(dataLiteralValue); mFreeDataLiteralValueVec[valueSpaceIndex] = dataLiteralValueLinker->append(mFreeDataLiteralValueVec[valueSpaceIndex]); } return this; } CXLinker* CDatatypeValueTestingCollection::createFreeLinker() { CXLinker* linker = mFreeLinker; if (linker) { mFreeLinker = mFreeLinker->getNext(); linker->clearNext(); } if (!linker) { linker = CObjectAllocator< CXLinker >::allocateAndConstruct(mCollectionCalcAlgContext->getUsedProcessTaskMemoryAllocationManager()); } return linker; } CDatatypeValueTestingCollection* CDatatypeValueTestingCollection::releaseFreeLinker(CXLinker* linker) { mFreeLinker = linker->append(mFreeLinker); return this; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CTrackedClashedDescriptorHasher.cpp0000644000175000017500000000670712520551016032057 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTrackedClashedDescriptorHasher.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CTrackedClashedDescriptorHasher::CTrackedClashedDescriptorHasher(CTrackedClashedDescriptor* trackedClashedDescriptor) { mTrackedClashedDes = trackedClashedDescriptor; mHashValue = calculateDescriptorHashValue(mTrackedClashedDes); } CTrackedClashedDescriptorHasher::CTrackedClashedDescriptorHasher(const CTrackedClashedDescriptorHasher& hasher) { mHashValue = hasher.mHashValue; mTrackedClashedDes = hasher.mTrackedClashedDes; } cint64 CTrackedClashedDescriptorHasher::getDescriptorHashValue() const { return mHashValue; } cint64 CTrackedClashedDescriptorHasher::calculateDescriptorHashValue(CTrackedClashedDescriptor* des) { cint64 hashValue = 0; hashValue += des->getAppropriatedIndividualID(); if (des->getConceptDescriptor()) { hashValue += (cint64)des->getConceptDescriptor()->getConcept(); if (des->getConceptDescriptor()->getNegation()) { hashValue = (hashValue << 1)+13; } } hashValue += (cint64)des->getDependencyTrackPoint(); hashValue += (cint64)des->getVariableBindingPath(); return hashValue; } bool CTrackedClashedDescriptorHasher::operator==(const CTrackedClashedDescriptorHasher& clashedDesHasher) const { if (mHashValue != clashedDesHasher.mHashValue) { return false; } if (mTrackedClashedDes->getAppropriatedIndividualID() != clashedDesHasher.mTrackedClashedDes->getAppropriatedIndividualID()) { return false; } if (mTrackedClashedDes->getConceptDescriptor() && clashedDesHasher.mTrackedClashedDes->getConceptDescriptor()) { if (mTrackedClashedDes->getConceptDescriptor()->getConcept() != clashedDesHasher.mTrackedClashedDes->getConceptDescriptor()->getConcept()) { return false; } if (mTrackedClashedDes->getConceptDescriptor()->getNegation() != clashedDesHasher.mTrackedClashedDes->getConceptDescriptor()->getNegation()) { return false; } } else { if (mTrackedClashedDes->getConceptDescriptor() || clashedDesHasher.mTrackedClashedDes->getConceptDescriptor()) { return false; } } if (mTrackedClashedDes->getDependencyTrackPoint() != clashedDesHasher.mTrackedClashedDes->getDependencyTrackPoint()) { return false; } if (mTrackedClashedDes->getVariableBindingPath() != clashedDesHasher.mTrackedClashedDes->getVariableBindingPath()) { return false; } return true; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationErrorProcessingException.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationErrorProcessingException0000644000175000017500000000432512520551002032414 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONERRORPROCESSINGEXCEPTION_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONERRORPROCESSINGEXCEPTION_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { /*! * * \class CCalculationErrorProcessingException * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationErrorProcessingException { // public methods public: enum ERRORCODE { ECNOERROR = 0, ECNOMINALMISSING = 1 }; //! Constructor CCalculationErrorProcessingException(ERRORCODE errorCode); //! Destructor virtual ~CCalculationErrorProcessingException(); ERRORCODE getErrorCode() const; bool hasError() const; static CCalculationErrorProcessingException getNominalMissingErrorException(); // protected methods protected: // protected variables protected: ERRORCODE mErrorCode; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONERRORPROCESSINGEXCEPTION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualNodeManager.h0000644000175000017500000000351212520551006027650 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALNODEMANAGER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALNODEMANAGER_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { /*! * * \class CIndividualNodeManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeManager { // public methods public: //! Constructor CIndividualNodeManager(); //! Destructor virtual ~CIndividualNodeManager(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALNODEMANAGER_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationClashProcessingException.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationClashProcessingException0000644000175000017500000000270712520551002032357 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationClashProcessingException.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CCalculationClashProcessingException::CCalculationClashProcessingException(CClashedDependencyDescriptor* clashDepDes) { mClashDepDes = clashDepDes; } CCalculationClashProcessingException::~CCalculationClashProcessingException() { } CClashedDependencyDescriptor* CCalculationClashProcessingException::getClashedDependencyDescriptor() const { return mClashDepDes; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeDateTimeValueSpaceHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeDateTimeValueS0000644000175000017500000000466612520551006032236 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEDATETIMEVALUESPACEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEDATETIMEVALUESPACEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CIndividualProcessNodeCompareValueSpaceHandler.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CIndividualProcessNodeDateTimeValueSpaceHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeDateTimeValueSpaceHandler : public CIndividualProcessNodeCompareValueSpaceHandler { // public methods public: //! Constructor CIndividualProcessNodeDateTimeValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEDATETIMEVALUESPACEHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CTrackedClashedDependencyLine.cpp0000644000175000017500000002706012520551014031465 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTrackedClashedDependencyLine.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CTrackedClashedDependencyLine::CTrackedClashedDependencyLine(CPROCESSINGSET* clashedSet) { mFreeTrackedClashedDescriptors = nullptr; mClashedSet = clashedSet; } CTrackedClashedDependencyLine* CTrackedClashedDependencyLine::initTrackedClashedDependencyLine(bool exactIndiNodeTracking, cint64 individualNodeTrackLevel, cint64 branchingLevel) { mExactIndividualTracking = exactIndiNodeTracking; mIndividualTrackLevel = individualNodeTrackLevel; mBranchingLevel = branchingLevel; mLevelTrackedClashes = nullptr; mLevelTrackedBranchingClashes = nullptr; mPrevLevelsTrackedClashes = nullptr; mPrevLevelsTrackedNonDetClashes = nullptr; mPrevLevelsTrackedNonDetBranchingClashes = nullptr; mIndependentTrackedClashes = nullptr; return this; } CTrackedClashedDependencyLine* CTrackedClashedDependencyLine::sortInTrackedClashedDescriptors(CTrackedClashedDescriptor* clashedDes, bool forceInsertion) { CTrackedClashedDescriptor* clashedDesIt = clashedDes; while (clashedDesIt) { CTrackedClashedDescriptor* clashedDesTmp = clashedDesIt; clashedDesIt = clashedDesIt->getNextDescriptor(); clashedDesTmp->clearNext(); CTrackedClashedDescriptorHasher desHasher(clashedDesTmp); bool clashDesInsertion = forceInsertion; if (!mClashedSet->contains(desHasher)) { mClashedSet->insert(desHasher); clashDesInsertion = true; } if (clashDesInsertion) { if (clashedDesTmp->isPointingToIndependentDependencyNode()) { mIndependentTrackedClashes = clashedDesTmp->append(mIndependentTrackedClashes); } else { if (clashedDesTmp->getAppropriatedIndividualLevel() > mIndividualTrackLevel) { // previous individual node level if (clashedDesTmp->isPointingToNonDeterministicDependencyNode()) { if (clashedDesTmp->getBranchingLevelTag() == mBranchingLevel) { mPrevLevelsTrackedNonDetBranchingClashes = clashedDesTmp->append(mPrevLevelsTrackedNonDetBranchingClashes); } else { mPrevLevelsTrackedNonDetClashes = clashedDesTmp->append(mPrevLevelsTrackedNonDetClashes); } } else { // deterministic, branching level does not matter mPrevLevelsTrackedClashes = clashedDesTmp->append(mPrevLevelsTrackedClashes); } } else { // current individual node level if (clashedDesTmp->getBranchingLevelTag() == mBranchingLevel) { mLevelTrackedBranchingClashes = clashedDesTmp->append(mLevelTrackedBranchingClashes); } else { mLevelTrackedClashes = clashedDesTmp->append(mLevelTrackedClashes); } } } } else { addFreeTrackedClashedDescriptor(clashedDesTmp); } } return this; } CTrackedClashedDependencyLine* CTrackedClashedDependencyLine::moveToNextIndividualNodeLevel(cint64 newLevel) { mIndividualTrackLevel = newLevel; //if (mLevelTrackedClashes) { // mPrevLevelsTrackedClashes = mLevelTrackedClashes->append(mPrevLevelsTrackedClashes); //} CTrackedClashedDescriptor* levelTrackedClashes = mLevelTrackedClashes; mLevelTrackedClashes = nullptr; sortInTrackedClashedDescriptors(levelTrackedClashes,true); CTrackedClashedDescriptor* levelTrackedBranchingClashes = mLevelTrackedBranchingClashes; mLevelTrackedBranchingClashes = nullptr; sortInTrackedClashedDescriptors(levelTrackedBranchingClashes,true); return this; } bool CTrackedClashedDependencyLine::hasIndependentTrackedClashedDescriptors() { return mIndependentTrackedClashes != nullptr; } CTrackedClashedDescriptor* CTrackedClashedDependencyLine::takeNextIndependentTrackedClashedDescriptor() { CTrackedClashedDescriptor* clashedDesTmp = mIndependentTrackedClashes; if (mIndependentTrackedClashes) { mIndependentTrackedClashes = mIndependentTrackedClashes->getNextDescriptor(); clashedDesTmp->clearNext(); } return clashedDesTmp; } CTrackedClashedDescriptor* CTrackedClashedDependencyLine::getIndependentTrackedClashedDescriptors() { return mIndependentTrackedClashes; } bool CTrackedClashedDependencyLine::hasLevelTrackedClashedDescriptors() { return mLevelTrackedClashes != nullptr; } CTrackedClashedDescriptor* CTrackedClashedDependencyLine::takeNextLevelTrackedClashedDescriptor() { CTrackedClashedDescriptor* clashedDesTmp = mLevelTrackedClashes; if (mLevelTrackedClashes) { mLevelTrackedClashes = mLevelTrackedClashes->getNextDescriptor(); clashedDesTmp->clearNext(); } return clashedDesTmp; } CTrackedClashedDescriptor* CTrackedClashedDependencyLine::getLevelTrackedClashedDescriptors() { return mLevelTrackedClashes; } bool CTrackedClashedDependencyLine::hasLevelTrackedBranchingClashedDescriptors() { return mLevelTrackedBranchingClashes != nullptr; } CTrackedClashedDescriptor* CTrackedClashedDependencyLine::takeNextLevelTrackedBranchingClashedDescriptor() { CTrackedClashedDescriptor* clashedDesTmp = mLevelTrackedBranchingClashes; if (mLevelTrackedBranchingClashes) { mLevelTrackedBranchingClashes = mLevelTrackedBranchingClashes->getNextDescriptor(); clashedDesTmp->clearNext(); } return clashedDesTmp; } CTrackedClashedDescriptor* CTrackedClashedDependencyLine::getLevelTrackedBranchingClashedDescriptors() { return mLevelTrackedBranchingClashes; } bool CTrackedClashedDependencyLine::hasPerviousLevelTrackedClashedDescriptors() { return mPrevLevelsTrackedClashes != nullptr; } CTrackedClashedDescriptor* CTrackedClashedDependencyLine::takeNextPerviousLevelTrackedClashedDescriptor() { CTrackedClashedDescriptor* clashedDesTmp = mPrevLevelsTrackedClashes; if (mPrevLevelsTrackedClashes) { mPrevLevelsTrackedClashes = mPrevLevelsTrackedClashes->getNextDescriptor(); clashedDesTmp->clearNext(); } return clashedDesTmp; } CTrackedClashedDescriptor* CTrackedClashedDependencyLine::getPerviousLevelTrackedClashedDescriptors() { return mPrevLevelsTrackedClashes; } bool CTrackedClashedDependencyLine::hasPerviousLevelTrackedNonDeterministicClashedDescriptors() { return mPrevLevelsTrackedNonDetClashes != nullptr; } CTrackedClashedDescriptor* CTrackedClashedDependencyLine::takeNextPerviousLevelTrackedNonDeterministicClashedDescriptor() { CTrackedClashedDescriptor* clashedDesTmp = mPrevLevelsTrackedNonDetClashes; if (mPrevLevelsTrackedNonDetClashes) { mPrevLevelsTrackedNonDetClashes = mPrevLevelsTrackedNonDetClashes->getNextDescriptor(); clashedDesTmp->clearNext(); } return clashedDesTmp; } CTrackedClashedDescriptor* CTrackedClashedDependencyLine::getPerviousLevelTrackedNonDeterministicClashedDescriptors() { return mPrevLevelsTrackedNonDetClashes; } bool CTrackedClashedDependencyLine::hasPerviousLevelTrackedNonDeterministicBranchingClashedDescriptors() { return mPrevLevelsTrackedNonDetBranchingClashes != nullptr; } CTrackedClashedDescriptor* CTrackedClashedDependencyLine::takeNextPerviousLevelTrackedNonDeterministicBranchingClashedDescriptor() { CTrackedClashedDescriptor* clashedDesTmp = mPrevLevelsTrackedNonDetBranchingClashes; if (mPrevLevelsTrackedNonDetBranchingClashes) { mPrevLevelsTrackedNonDetBranchingClashes = mPrevLevelsTrackedNonDetBranchingClashes->getNextDescriptor(); clashedDesTmp->clearNext(); } return clashedDesTmp; } CTrackedClashedDescriptor* CTrackedClashedDependencyLine::getPerviousLevelTrackedNonDeterministicBranchingClashedDescriptors() { return mPrevLevelsTrackedNonDetBranchingClashes; } bool CTrackedClashedDependencyLine::hasMoreTrackedClashedList() { return mLevelTrackedClashes || mLevelTrackedBranchingClashes || mPrevLevelsTrackedClashes || mPrevLevelsTrackedNonDetClashes || mPrevLevelsTrackedNonDetBranchingClashes || mIndependentTrackedClashes; } CTrackedClashedDescriptor* CTrackedClashedDependencyLine::takeNextTrackedClashedList() { CTrackedClashedDescriptor* clashes = nullptr; if (mLevelTrackedClashes) { clashes = mLevelTrackedClashes; mLevelTrackedClashes = nullptr; } else if (mLevelTrackedBranchingClashes) { clashes = mLevelTrackedBranchingClashes; mLevelTrackedBranchingClashes = nullptr; } else if (mPrevLevelsTrackedClashes) { clashes = mPrevLevelsTrackedClashes; mPrevLevelsTrackedClashes = nullptr; } else if (mPrevLevelsTrackedNonDetClashes) { clashes = mPrevLevelsTrackedNonDetClashes; mPrevLevelsTrackedNonDetClashes = nullptr; } else if (mPrevLevelsTrackedNonDetBranchingClashes) { clashes = mPrevLevelsTrackedNonDetBranchingClashes; mPrevLevelsTrackedNonDetBranchingClashes = nullptr; } else if (mIndependentTrackedClashes) { clashes = mIndependentTrackedClashes; mIndependentTrackedClashes = nullptr; } return clashes; } CTrackedClashedDescriptor* CTrackedClashedDependencyLine::takeNextFreeTrackedClashedDescriptor() { CTrackedClashedDescriptor* clashedDesTmp = mFreeTrackedClashedDescriptors; if (mFreeTrackedClashedDescriptors) { mFreeTrackedClashedDescriptors = mFreeTrackedClashedDescriptors->getNextDescriptor(); clashedDesTmp->clearNext(); } return clashedDesTmp; } CTrackedClashedDependencyLine* CTrackedClashedDependencyLine::addFreeTrackedClashedDescriptor(CTrackedClashedDescriptor* clashDes) { if (clashDes) { mFreeTrackedClashedDescriptors = clashDes->append(mFreeTrackedClashedDescriptors); } return this; } CPROCESSINGSET* CTrackedClashedDependencyLine::getTrackedClashedDescriptorSet() { return mClashedSet; } cint64 CTrackedClashedDependencyLine::getBranchingLevel() { return mBranchingLevel; } cint64 CTrackedClashedDependencyLine::getIndividualNodeLevel() { return mIndividualTrackLevel; } bool CTrackedClashedDependencyLine::hasOnlyIndependentTrackedClashedDescriptorsRemaining() { return mIndependentTrackedClashes && !mLevelTrackedClashes && !mLevelTrackedBranchingClashes && !mPrevLevelsTrackedClashes && !mPrevLevelsTrackedNonDetClashes && !mPrevLevelsTrackedNonDetBranchingClashes; } bool CTrackedClashedDependencyLine::hasOnlyCurrentIndividualNodeLevelClashesDescriptors() { return !mPrevLevelsTrackedClashes && !mPrevLevelsTrackedNonDetClashes && !mPrevLevelsTrackedNonDetBranchingClashes; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskSaturationIndividualsAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskSaturationIndividual0000644000175000017500000000615712520551014032374 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableTaskSaturationIndividualsAnalyser.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CSatisfiableTaskSaturationIndividualsAnalyser::CSatisfiableTaskSaturationIndividualsAnalyser() { } CSatisfiableTaskSaturationIndividualsAnalyser::~CSatisfiableTaskSaturationIndividualsAnalyser() { } bool CSatisfiableTaskSaturationIndividualsAnalyser::analyseSatisfiableTask(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContext* calcAlgContext) { CSaturationIndividualsAnalysingAdapter* satIndiAnAdapter = statCalcTask->getSaturationIndividualsAnalysationObserver(); if (satIndiAnAdapter) { bool foundInsufficientHandledNode = false; bool foundClashedNode = false; CProcessingDataBox* procDataBox = statCalcTask->getProcessingDataBox(); CIndividualSaturationProcessNodeLinker* indiSaturationAnalysingNodeLinker = procDataBox->getIndividualSaturationAnalysationNodeLinker(); for (CIndividualSaturationProcessNodeLinker* indiSaturationAnalysingNodeLinkerIt = indiSaturationAnalysingNodeLinker; indiSaturationAnalysingNodeLinkerIt; indiSaturationAnalysingNodeLinkerIt = indiSaturationAnalysingNodeLinkerIt->getNext()) { CIndividualSaturationProcessNode* satIndiNode = indiSaturationAnalysingNodeLinkerIt->getProcessingIndividual(); CIndividualSaturationProcessNodeStatusFlags* indStatFlags = satIndiNode->getIndirectStatusFlags(); CIndividualSaturationProcessNodeStatusFlags* dirFlags = satIndiNode->getDirectStatusFlags(); if (indStatFlags->hasInsufficientFlag() || !indStatFlags->hasCompletedFlag() || !dirFlags->hasCompletedFlag()) { foundInsufficientHandledNode = true; } if (indStatFlags->hasClashedFlag()) { foundClashedNode = true; } } CSaturationIndividualAnalysationObserver* satIndAnalObs = satIndiAnAdapter->getIndividualsAnalysationObserver(); if (satIndAnalObs) { if (foundInsufficientHandledNode) { satIndAnalObs->notifyInsufficientIndividual(); } if (foundClashedNode) { satIndAnalObs->notifyClashedIndividual(); } } return true; } return false; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeCompareValueSpaceHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeCompareValueSp0000644000175000017500000001006712520551006032300 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODECOMPAREVALUESPACEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODECOMPAREVALUESPACEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CCalculationClashProcessingException.h" #include "CDatatypeDependencyCollection.h" #include "CDependencyFactory.h" #include "CIndividualProcessNodeValueSpaceHandler.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/CDatatypeCompareValueSpaceData.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CIndividualProcessNodeCompareValueSpaceHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeCompareValueSpaceHandler : public CIndividualProcessNodeValueSpaceHandler { // public methods public: //! Constructor CIndividualProcessNodeCompareValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType); virtual bool addDataLiteral(CIndividualProcessNode* indiProcNode, CDataLiteral* dataLiteral, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); virtual bool addDataRestriction(CIndividualProcessNode* indiProcNode, CConcept* dataRestricionConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); virtual bool testValueSpaceClashed(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); virtual CConceptDescriptor* triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, cint64& remainingRequiredValuesCount, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext); virtual bool addValueSpaceDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext); virtual bool countPossibleValueSpaceValues(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceValuesCounter* valueCounter, CCalculationAlgorithmContext* calcAlgContext); virtual bool getNextPossibleDataValue(CIndividualProcessNode* indiProcNode, CDataLiteralValue*& nextValue, CDataLiteralValue* lastValue, CDatatypeValueTestingCollection* valueTestingCollection, CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: // protected variables protected: CDatatypeValueSpaceCompareType* mCompareValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODECOMPAREVALUESPACEHANDLER_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CConceptNominalSchemaGroundingHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CConceptNominalSchemaGroundingHandle0000644000175000017500000007612512520551004032264 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptNominalSchemaGroundingHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CConceptNominalSchemaGroundingHandler::CConceptNominalSchemaGroundingHandler() { mConfReuseGroundedNominalSchemaConcepts = true; } CSortedNegLinker* CConceptNominalSchemaGroundingHandler::getGroundingConceptLinker(CIndividualProcessNode* processNode, CPropagationBindingSet* propBindSet, CConcept* concept, bool negated, CPROCESSINGHASH*& groundedConPropBindDesHash, CPROCESSINGHASH*& additionalPropBindDesHash, CCalculationAlgorithmContext* calcAlgContext) { CSortedNegLinker* newLinker = nullptr; mDataBox = calcAlgContext->getUsedProcessingDataBox(); CProcessContext* context = calcAlgContext->getUsedProcessContext(); mMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CMBox* mBox = mDataBox->getOntology()->getDataBoxes()->getMBox(); CTBox* tBox = mDataBox->getOntology()->getDataBoxes()->getTBox(); mConceptVec = mDataBox->getExtendedConceptVector(false); mReplaceHash = mDataBox->getConceptNominalSchemaGroundingHash(false); CNominalSchemaTemplateVector* nomSchVec = mBox->getNominalSchemaTemplateVector(false); mLocalizedExtensions = false; CPROCESSINGHASH nominalSchemaVarBindedNominalHash(calcAlgContext->getUsedTaskProcessorContext()); CPROCESSINGSET* allNominalConceptSet = nullptr; cint64 nomSchTemplID = concept->getParameter(); if (nomSchVec) { CNominalSchemaTemplate* nomSchTempl = nomSchVec->getData(nomSchTemplID); CConcept* templateConcept = nomSchTempl->getTemplateConcept(); CBOXHASH* templateConceptNomSchVarHash = nomSchTempl->getTemplateConceptNominalSchemaConceptHash(); CBOXSET* templateConceptNomSchVarSet = nomSchTempl->getNominalSchemaConceptSet(); CPropagationBindingMap* propBindMap = propBindSet->getPropagationBindingMap(); for (CPropagationBindingMap::iterator it = propBindMap->begin(), itEnd = propBindMap->end(); it != itEnd; ++it) { CPropagationBindingMapData& propBindData = it.value(); CPropagationBindingDescriptor* propBindDes = propBindData.getPropagationBindingDescriptor(); CPropagationBinding* propBinding = propBindDes->getPropagationBinding(); CVariable* variable = propBinding->getBindedVariable(); CIndividualProcessNode* bindedIndiNode = propBinding->getBindedIndividual(); if (variable->isNominalVariable()) { CConcept* nomSchVarConcept = variable->getNominalVariableConcept(); if (templateConceptNomSchVarSet->contains(nomSchVarConcept)) { CConcept* nominalConcept = getNominalConcept(bindedIndiNode,true,calcAlgContext); if (nominalConcept) { nominalSchemaVarBindedNominalHash.insertMulti(nomSchVarConcept,TConceptPropagationBindingPair(nominalConcept,propBindDes)); } } } } for (CBOXSET::iterator it = templateConceptNomSchVarSet->begin(), itEnd = templateConceptNomSchVarSet->end(); it != itEnd; ++it) { CConcept* nomSchVarConcept = *it; if (!nominalSchemaVarBindedNominalHash.contains(nomSchVarConcept)) { collectAllNominalConcepts(allNominalConceptSet,calcAlgContext); for (CPROCESSINGSET::const_iterator nomIt = allNominalConceptSet->constBegin(), nomItEnd = allNominalConceptSet->constEnd(); nomIt != nomItEnd; ++nomIt) { CConcept* nominalConcept(*nomIt); nominalSchemaVarBindedNominalHash.insertMulti(nomSchVarConcept,TConceptPropagationBindingPair(nominalConcept,nullptr)); } } } newLinker = createNominalSchemaGroundingConcepts(processNode,nomSchTempl->getTemplateConcept(),negated,&nominalSchemaVarBindedNominalHash,groundedConPropBindDesHash,nomSchTempl,calcAlgContext); if (newLinker) { if (!additionalPropBindDesHash) { additionalPropBindDesHash = CObjectParameterizingAllocator< CPROCESSINGHASH,CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext());; } for (CPropagationBindingMap::iterator it = propBindMap->begin(), itEnd = propBindMap->end(); it != itEnd; ++it) { CPropagationBindingMapData& propBindData = it.value(); CPropagationBindingDescriptor* propBindDes = propBindData.getPropagationBindingDescriptor(); CPropagationBinding* propBinding = propBindDes->getPropagationBinding(); CVariable* variable = propBinding->getBindedVariable(); additionalPropBindDesHash->insert(variable,propBindDes); } } } return newLinker; } void CConceptNominalSchemaGroundingHandler::collectAllNominalConcepts(CPROCESSINGSET*& allNominalConceptSet, CCalculationAlgorithmContext* calcAlgContext) { if (!allNominalConceptSet) { allNominalConceptSet = CObjectParameterizingAllocator< CPROCESSINGSET,CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); CIndividualVector* individualVector = calcAlgContext->getProcessingDataBox()->getOntology()->getABox()->getIndividualVector(false); cint64 individualCount = 0; if (individualVector) { individualCount = individualVector->getItemCount(); // TODO: only active individuals for (cint64 i = 0; i < individualCount; ++i) { CIndividual* individual = individualVector->getData(i); for (CConceptAssertionLinker* assConLinkerIt = individual->getAssertionConceptLinker(); assConLinkerIt; assConLinkerIt = assConLinkerIt->getNext()) { CConcept* assCon = assConLinkerIt->getData(); bool assConNegation = assConLinkerIt->isNegated(); cint64 assConOpCode = assCon->getOperatorCode(); if (!assConNegation && assConOpCode == CCNOMINAL) { allNominalConceptSet->insert(assCon); } } } } } } CConcept* CConceptNominalSchemaGroundingHandler::getNominalConcept(CIndividualProcessNode* processNode, bool forceNotPruned, CCalculationAlgorithmContext* calcAlgContext) { CIndividualProcessNodeVector* mIndiVector = calcAlgContext->getUsedProcessingDataBox()->getIndividualProcessNodeVector(); CIndividualProcessNode* indiNode = mIndiVector->getData(processNode->getIndividualID()); //while (indiNode->getIndividualID() != indiNode->getMergedIntoIndividualNodeID()) { // indiNode = mIndiVector->getData(indiNode->getMergedIntoIndividualNodeID()); //} CConcept* nomConcept = nullptr; if (!forceNotPruned || !indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED)) { CIndividual* nomIndi = indiNode->getNominalIndividual(); CConceptAssertionLinker* assLinker = nomIndi->getAssertionConceptLinker(); while (assLinker && !nomConcept) { CConcept* assConcept = assLinker->getData(); bool assNegation = assLinker->isNegated(); if (!assNegation && assConcept->getOperatorCode() == CCNOMINAL) { nomConcept = assConcept; } assLinker = assLinker->getNext(); } } return nomConcept; } void CConceptNominalSchemaGroundingHandler::addConceptOperand(CConcept* concept, CConcept* opConcept, bool negated) { CSortedNegLinker* opConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); opConLinker->init(opConcept,negated); concept->addOperandLinker(opConLinker); concept->incOperandCount(); } CConcept* CConceptNominalSchemaGroundingHandler::createNominalSchemaConceptCopy(CConcept* concept) { CConcept* conceptCopy = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); conceptCopy->initConceptCopy(concept); conceptCopy->setOperandCount(0); conceptCopy->setConceptTag(mConceptVec->getItemCount()); mConceptVec->setData(conceptCopy->getConceptTag(),conceptCopy); return conceptCopy; } CConcept* CConceptNominalSchemaGroundingHandler::createGroundedNominalSchemaConcept(CConcept* concept, CBOXHASH* templConNomSchConHash, QHash::const_iterator >* nomSchConIndividualItHash, CCalculationAlgorithmContext* calcAlgContext) { if (templConNomSchConHash->contains(concept)) { cint64 opCode = concept->getOperatorCode(); if (opCode == CCNOMVAR) { CPROCESSINGHASH::const_iterator nomVarIt = nomSchConIndividualItHash->value(concept); CConcept* nominalConcept = nomVarIt.value().first; return nominalConcept; } if (mConfReuseGroundedNominalSchemaConcepts && mReplaceHash) { CConceptNominalSchemaGroundingData mHashedTestData(calcAlgContext->getUsedTaskProcessorContext()); mHashedTestData.setGroundingConcept(concept); CBOXHASH::const_iterator it = templConNomSchConHash->constFind(concept), itEnd = templConNomSchConHash->constEnd(); while (it != itEnd && it.key() == concept) { CConcept* nomSchemConcept = *it; CPROCESSINGHASH::const_iterator nomVarIt = nomSchConIndividualItHash->value(nomSchemConcept); CConcept* indiConcept = nomVarIt.value().first; mHashedTestData.addBindedNominalSchemaConcept(indiConcept); ++it; } CConceptNominalSchemaGroundingData* replaceConData = mReplaceHash->value(CConceptNominalSchemaGroundingHasher(&mHashedTestData),nullptr); if (replaceConData) { return replaceConData->getGroundedConcept(); } } forceExtensionLocalisation(calcAlgContext); CConcept* copiedConcept = createNominalSchemaConceptCopy(concept); for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opConNegation = opConLinkerIt->isNegated(); CConcept* newOpConcept = createGroundedNominalSchemaConcept(opConcept,templConNomSchConHash,nomSchConIndividualItHash,calcAlgContext); addConceptOperand(copiedConcept,newOpConcept,opConNegation); } if (mConfReuseGroundedNominalSchemaConcepts) { CConceptNominalSchemaGroundingData* mHashedTestData = CObjectParameterizingAllocator< CConceptNominalSchemaGroundingData,CProcessContext* >::allocateAndConstructAndParameterize(mMemMan,calcAlgContext->getUsedProcessContext()); mHashedTestData->setGroundingConcept(concept); CBOXHASH::const_iterator it = templConNomSchConHash->constFind(concept), itEnd = templConNomSchConHash->constEnd(); while (it != itEnd && it.key() == concept) { CConcept* nomSchemConcept = *it; CPROCESSINGHASH::const_iterator nomVarIt = nomSchConIndividualItHash->value(nomSchemConcept); CConcept* indiConcept = nomVarIt.value().first; mHashedTestData->addBindedNominalSchemaConcept(indiConcept); ++it; } mHashedTestData->setGroundedConcept(copiedConcept); mReplaceHash->insert(CConceptNominalSchemaGroundingHasher(mHashedTestData),mHashedTestData); } return copiedConcept; } else { return concept; } } bool CConceptNominalSchemaGroundingHandler::forceExtensionLocalisation(CCalculationAlgorithmContext* calcAlgContext) { if (!mLocalizedExtensions) { mLocalizedExtensions = true; mConceptVec = mDataBox->getExtendedConceptVector(true); mReplaceHash = mDataBox->getConceptNominalSchemaGroundingHash(true); return true; } return false; } CSortedNegLinker* CConceptNominalSchemaGroundingHandler::createNominalSchemaGroundingConcepts(CIndividualProcessNode* indiProcessNode, CConcept* concept, bool negated, CPROCESSINGHASH* nominalSchemaVarBindedNominalHash, CPROCESSINGHASH*& groundedConPropBindDesHash, CNominalSchemaTemplate* nsTemplate, CCalculationAlgorithmContext* calcAlgContext) { CSortedNegLinker* newGroundedConLinker = nullptr; CReapplyConceptLabelSet* conLabelSet = indiProcessNode->getReapplyConceptLabelSet(false); CBOXHASH* templConNomSchConHash = nsTemplate->getTemplateConceptNominalSchemaConceptHash(); CBOXSET* nomSchConSet = nsTemplate->getNominalSchemaConceptSet(); QHash::const_iterator > nomSchConIndividualItHash; CPROCESSINGHASH::const_iterator indiItEnd = nominalSchemaVarBindedNominalHash->constEnd(); for (CBOXSET::const_iterator it = nomSchConSet->constBegin(), itEnd = nomSchConSet->constEnd(); it != itEnd; ++it) { CConcept* nomSchCon(*it); CPROCESSINGHASH::const_iterator indiIt = nominalSchemaVarBindedNominalHash->constFind(nomSchCon); nomSchConIndividualItHash.insert(nomSchCon,indiIt); } bool conVarItFinished = false; while (!conVarItFinished) { CConcept* templateConcept = nsTemplate->getTemplateConcept(); CSortedNegLinker* opConLinker = createGroundedNominalSchemaConcept(templateConcept,negated,conLabelSet,templConNomSchConHash,&nomSchConIndividualItHash,calcAlgContext); if (opConLinker) { if (!groundedConPropBindDesHash) { groundedConPropBindDesHash = CObjectParameterizingAllocator< CPROCESSINGHASH,CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); } QHash::const_iterator >::const_iterator variableIt = nomSchConIndividualItHash.constBegin(), variableItEnd = nomSchConIndividualItHash.constEnd(); while (variableIt != variableItEnd) { CPROCESSINGHASH::const_iterator nomBindIt = variableIt.value(); CPropagationBindingDescriptor* bindedDes = nomBindIt.value().second; if (bindedDes) { for (CSortedNegLinker* opConLinkerIt = opConLinker; opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* groundedConcept = opConLinkerIt->getData(); groundedConPropBindDesHash->insertMulti(groundedConcept,bindedDes); } } ++variableIt; } newGroundedConLinker = opConLinker->append(newGroundedConLinker); } QHash::const_iterator >::const_iterator variableIt = nomSchConIndividualItHash.constBegin(); QHash::const_iterator >::const_iterator variableItEnd = nomSchConIndividualItHash.constEnd(); CPROCESSINGHASH::const_iterator varIndiIt = variableIt.value(); CConcept* varConcept = variableIt.key(); ++varIndiIt; bool conVarIteration = true; while ((varIndiIt == indiItEnd || varIndiIt.key() != varConcept) && conVarIteration) { conVarIteration = false; CPROCESSINGHASH::const_iterator indiIt = nominalSchemaVarBindedNominalHash->constFind(varConcept); nomSchConIndividualItHash.insert(varConcept,indiIt); ++variableIt; if (variableIt == variableItEnd) { conVarItFinished = true; } else { varIndiIt = variableIt.value(); varConcept = variableIt.key(); ++varIndiIt; if (varIndiIt == indiItEnd) { conVarIteration = true; } } } if (!conVarItFinished) { nomSchConIndividualItHash.insert(varConcept,varIndiIt); } } return newGroundedConLinker; } CSortedNegLinker* CConceptNominalSchemaGroundingHandler::getGroundingConceptLinker(CIndividualProcessNode* processNode, CVariableBindingPathSet* varBindPathSet, CConcept* concept, bool negated, CPROCESSINGHASH*& groundedConVarBindPathDesHash, CCalculationAlgorithmContext* calcAlgContext) { CSortedNegLinker* newLinker = nullptr; mDataBox = calcAlgContext->getUsedProcessingDataBox(); CProcessContext* context = calcAlgContext->getUsedProcessContext(); mMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CMBox* mBox = mDataBox->getOntology()->getDataBoxes()->getMBox(); CTBox* tBox = mDataBox->getOntology()->getDataBoxes()->getTBox(); mConceptVec = mDataBox->getExtendedConceptVector(false); mReplaceHash = mDataBox->getConceptNominalSchemaGroundingHash(false); CNominalSchemaTemplateVector* nomSchVec = mBox->getNominalSchemaTemplateVector(false); mLocalizedExtensions = false; cint64 nomSchTemplID = concept->getParameter(); if (nomSchVec) { CNominalSchemaTemplate* nomSchTempl = nomSchVec->getData(nomSchTemplID); CConcept* templateConcept = nomSchTempl->getTemplateConcept(); CBOXHASH* templateConceptNomSchVarHash = nomSchTempl->getTemplateConceptNominalSchemaConceptHash(); CBOXSET* templateConceptNomSchVarSet = nomSchTempl->getNominalSchemaConceptSet(); CVariableBindingPathMap* varBindPathMap = varBindPathSet->getVariableBindingPathMap(); for (CVariableBindingPathMap::iterator it = varBindPathMap->begin(), itEnd = varBindPathMap->end(); it != itEnd; ++it) { CVariableBindingPathMapData& varBindPathData = it.value(); CVariableBindingPathDescriptor* varBindPathDes = varBindPathData.getVariableBindingPathDescriptor(); CVariableBindingPath* varBindPath = varBindPathDes->getVariableBindingPath(); CPROCESSINGHASH nominalSchemaVarBindedNominalHash(calcAlgContext->getUsedTaskProcessorContext()); CPROCESSINGSET* allNominalConceptSet = nullptr; for (CVariableBindingDescriptor* varBindDesIt = varBindPath->getVariableBindingDescriptorLinker(); varBindDesIt; varBindDesIt = varBindDesIt->getNext()) { CVariableBinding* varBind = varBindDesIt->getVariableBinding(); CVariable* variable = varBind->getBindedVariable(); CIndividualProcessNode* bindedIndiNode = varBind->getBindedIndividual(); if (variable->isNominalVariable()) { CConcept* nomSchVarConcept = variable->getNominalVariableConcept(); if (templateConceptNomSchVarSet->contains(nomSchVarConcept)) { CConcept* nominalConcept = getNominalConcept(bindedIndiNode,false,calcAlgContext); if (nominalConcept) { nominalSchemaVarBindedNominalHash.insertMulti(nomSchVarConcept,TConceptPropagationBindingPair(nominalConcept,nullptr)); } } } } for (CBOXSET::iterator it = templateConceptNomSchVarSet->begin(), itEnd = templateConceptNomSchVarSet->end(); it != itEnd; ++it) { CConcept* nomSchVarConcept = *it; if (!nominalSchemaVarBindedNominalHash.contains(nomSchVarConcept)) { collectAllNominalConcepts(allNominalConceptSet,calcAlgContext); for (CPROCESSINGSET::const_iterator nomIt = allNominalConceptSet->constBegin(), nomItEnd = allNominalConceptSet->constEnd(); nomIt != nomItEnd; ++nomIt) { CConcept* nominalConcept(*nomIt); nominalSchemaVarBindedNominalHash.insertMulti(nomSchVarConcept,TConceptPropagationBindingPair(nominalConcept,nullptr)); } } } CSortedNegLinker* tmpNewLinker = createNominalSchemaGroundingConcepts(processNode,nomSchTempl->getTemplateConcept(),negated,&nominalSchemaVarBindedNominalHash,nomSchTempl,calcAlgContext); if (tmpNewLinker) { for (CSortedNegLinker* tmpNewLinkerIt = tmpNewLinker; tmpNewLinkerIt; tmpNewLinkerIt = tmpNewLinkerIt->getNext()) { CConcept* concept = tmpNewLinkerIt->getData(); if (!groundedConVarBindPathDesHash) { groundedConVarBindPathDesHash = CObjectParameterizingAllocator< CPROCESSINGHASH,CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); } groundedConVarBindPathDesHash->insert(concept,varBindPathDes); } newLinker = tmpNewLinker->append(newLinker); } } } return newLinker; } CSortedNegLinker* CConceptNominalSchemaGroundingHandler::getGroundingConceptLinker(CIndividualProcessNode* processNode, CRepresentativeVariableBindingPathMap* repVarBindPathSetMap, CConcept* concept, bool negated, CPROCESSINGHASH*& groundedConVarBindPathHash, CCalculationAlgorithmContext* calcAlgContext) { CSortedNegLinker* newLinker = nullptr; mDataBox = calcAlgContext->getUsedProcessingDataBox(); CProcessContext* context = calcAlgContext->getUsedProcessContext(); mMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CMBox* mBox = mDataBox->getOntology()->getDataBoxes()->getMBox(); CTBox* tBox = mDataBox->getOntology()->getDataBoxes()->getTBox(); mConceptVec = mDataBox->getExtendedConceptVector(false); mReplaceHash = mDataBox->getConceptNominalSchemaGroundingHash(false); CNominalSchemaTemplateVector* nomSchVec = mBox->getNominalSchemaTemplateVector(false); mLocalizedExtensions = false; cint64 nomSchTemplID = concept->getParameter(); if (nomSchVec) { CNominalSchemaTemplate* nomSchTempl = nomSchVec->getData(nomSchTemplID); CConcept* templateConcept = nomSchTempl->getTemplateConcept(); CBOXHASH* templateConceptNomSchVarHash = nomSchTempl->getTemplateConceptNominalSchemaConceptHash(); CBOXSET* templateConceptNomSchVarSet = nomSchTempl->getNominalSchemaConceptSet(); for (CRepresentativeVariableBindingPathMap::const_iterator it = repVarBindPathSetMap->constBegin(), itEnd = repVarBindPathSetMap->constEnd(); it != itEnd; ++it) { const CRepresentativeVariableBindingPathMapData& varBindPathData = it.value(); CVariableBindingPath* varBindPath = varBindPathData.getVariableBindingPath(); CPROCESSINGHASH nominalSchemaVarBindedNominalHash(calcAlgContext->getUsedTaskProcessorContext()); CPROCESSINGSET* allNominalConceptSet = nullptr; for (CVariableBindingDescriptor* varBindDesIt = varBindPath->getVariableBindingDescriptorLinker(); varBindDesIt; varBindDesIt = varBindDesIt->getNext()) { CVariableBinding* varBind = varBindDesIt->getVariableBinding(); CVariable* variable = varBind->getBindedVariable(); CIndividualProcessNode* bindedIndiNode = varBind->getBindedIndividual(); if (variable->isNominalVariable()) { CConcept* nomSchVarConcept = variable->getNominalVariableConcept(); if (templateConceptNomSchVarSet->contains(nomSchVarConcept)) { CConcept* nominalConcept = getNominalConcept(bindedIndiNode,false,calcAlgContext); if (nominalConcept) { nominalSchemaVarBindedNominalHash.insertMulti(nomSchVarConcept,TConceptPropagationBindingPair(nominalConcept,nullptr)); } } } } for (CBOXSET::iterator it = templateConceptNomSchVarSet->begin(), itEnd = templateConceptNomSchVarSet->end(); it != itEnd; ++it) { CConcept* nomSchVarConcept = *it; if (!nominalSchemaVarBindedNominalHash.contains(nomSchVarConcept)) { collectAllNominalConcepts(allNominalConceptSet,calcAlgContext); for (CPROCESSINGSET::const_iterator nomIt = allNominalConceptSet->constBegin(), nomItEnd = allNominalConceptSet->constEnd(); nomIt != nomItEnd; ++nomIt) { CConcept* nominalConcept(*nomIt); nominalSchemaVarBindedNominalHash.insertMulti(nomSchVarConcept,TConceptPropagationBindingPair(nominalConcept,nullptr)); } } } CSortedNegLinker* tmpNewLinker = createNominalSchemaGroundingConcepts(processNode,nomSchTempl->getTemplateConcept(),negated,&nominalSchemaVarBindedNominalHash,nomSchTempl,calcAlgContext); if (tmpNewLinker) { for (CSortedNegLinker* tmpNewLinkerIt = tmpNewLinker; tmpNewLinkerIt; tmpNewLinkerIt = tmpNewLinkerIt->getNext()) { CConcept* concept = tmpNewLinkerIt->getData(); if (!groundedConVarBindPathHash) { groundedConVarBindPathHash = CObjectParameterizingAllocator< CPROCESSINGHASH,CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); } groundedConVarBindPathHash->insert(concept,varBindPath); } newLinker = tmpNewLinker->append(newLinker); } } } return newLinker; } CSortedNegLinker* CConceptNominalSchemaGroundingHandler::createGroundedNominalSchemaConcept(CConcept* concept, bool negated, CReapplyConceptLabelSet* conLabelSet, CBOXHASH* templConNomSchConHash, QHash::const_iterator >* nomSchConIndividualItHash, CCalculationAlgorithmContext* calcAlgContext) { CSortedNegLinker* conLinker = nullptr; cint64 opCode = concept->getOperatorCode(); if (!negated && (opCode == CCAND) || negated && (opCode == CCOR)) { for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opConNegation = opConLinkerIt->isNegated()^negated; CSortedNegLinker* tmpConLinker = createGroundedNominalSchemaConcept(opConcept,opConNegation,conLabelSet,templConNomSchConHash,nomSchConIndividualItHash,calcAlgContext); if (tmpConLinker) { conLinker = tmpConLinker->append(conLinker); } } } else { CConcept* groundedConcept = createGroundedNominalSchemaConcept(concept,templConNomSchConHash,nomSchConIndividualItHash,calcAlgContext); bool alreadyContained = false; if (conLabelSet) { alreadyContained = conLabelSet->containsConcept(groundedConcept); } if (!alreadyContained) { CSortedNegLinker* opConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); opConLinker->init(groundedConcept,negated); conLinker = opConLinker->append(conLinker); } } return conLinker; } CSortedNegLinker* CConceptNominalSchemaGroundingHandler::createNominalSchemaGroundingConcepts(CIndividualProcessNode* indiProcessNode, CConcept* concept, bool negated, CPROCESSINGHASH* nominalSchemaVarBindedNominalHash, CNominalSchemaTemplate* nsTemplate, CCalculationAlgorithmContext* calcAlgContext) { CSortedNegLinker* newGroundedConLinker = nullptr; CReapplyConceptLabelSet* conLabelSet = indiProcessNode->getReapplyConceptLabelSet(false); CBOXHASH* templConNomSchConHash = nsTemplate->getTemplateConceptNominalSchemaConceptHash(); CBOXSET* nomSchConSet = nsTemplate->getNominalSchemaConceptSet(); QHash::const_iterator > nomSchConIndividualItHash; CPROCESSINGHASH::const_iterator indiItEnd = nominalSchemaVarBindedNominalHash->constEnd(); for (CBOXSET::const_iterator it = nomSchConSet->constBegin(), itEnd = nomSchConSet->constEnd(); it != itEnd; ++it) { CConcept* nomSchCon(*it); CPROCESSINGHASH::const_iterator indiIt = nominalSchemaVarBindedNominalHash->constFind(nomSchCon); nomSchConIndividualItHash.insert(nomSchCon,indiIt); } bool conVarItFinished = false; while (!conVarItFinished) { CConcept* templateConcept = nsTemplate->getTemplateConcept(); CSortedNegLinker* opConLinker = createGroundedNominalSchemaConcept(templateConcept,negated,conLabelSet,templConNomSchConHash,&nomSchConIndividualItHash,calcAlgContext); if (opConLinker) { newGroundedConLinker = opConLinker->append(newGroundedConLinker); } QHash::const_iterator >::const_iterator variableIt = nomSchConIndividualItHash.constBegin(); QHash::const_iterator >::const_iterator variableItEnd = nomSchConIndividualItHash.constEnd(); if (variableIt == variableItEnd) { conVarItFinished = true; } else { CPROCESSINGHASH::const_iterator varIndiIt = variableIt.value(); CConcept* varConcept = variableIt.key(); ++varIndiIt; bool conVarIteration = true; while ((varIndiIt == indiItEnd || varIndiIt.key() != varConcept) && conVarIteration) { conVarIteration = false; CPROCESSINGHASH::const_iterator indiIt = nominalSchemaVarBindedNominalHash->constFind(varConcept); nomSchConIndividualItHash.insert(varConcept,indiIt); ++variableIt; if (variableIt == variableItEnd) { conVarItFinished = true; } else { varIndiIt = variableIt.value(); varConcept = variableIt.key(); ++varIndiIt; if (varIndiIt == indiItEnd) { conVarIteration = true; } } } if (!conVarItFinished) { nomSchConIndividualItHash.insert(varConcept,varIndiIt); } } } return newGroundedConLinker; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableExpanderCacheHandler.cpp0000644000175000017500000012251712520551012032155 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableExpanderCacheHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CSatisfiableExpanderCacheHandler::CSatisfiableExpanderCacheHandler(CSignatureSatisfiableExpanderCacheReader* satCacheReader, CSignatureSatisfiableExpanderCacheWriter* satCacheWriter) { mSatCacheReader = satCacheReader; mSatCacheWriter = satCacheWriter; mTmpContext = nullptr; mMemAllocMan = nullptr; mWriteData = nullptr; } CSatisfiableExpanderCacheHandler::~CSatisfiableExpanderCacheHandler() { } bool CSatisfiableExpanderCacheHandler::isIndividualNodeExpandCached(CIndividualProcessNode* individualNode, bool* satisfiable, CSignatureSatisfiableExpanderCacheEntry** entry, CCalculationAlgorithmContext* calcAlgContext) { CReapplyConceptLabelSet* conSet = individualNode->getReapplyConceptLabelSet(false); if (conSet && !conSet->getConceptStructure()->hasBindingPropagationConcepts() && !conSet->getConceptStructure()->hasDynamicCreatedConcepts()) { cint64 conSig = conSet->getConceptSignatureValue(); CSignatureSatisfiableExpanderCacheEntry* cachedEntry = mSatCacheReader->getCacheEntry(conSig); if (cachedEntry) { cint64 conSetCount = conSet->getConceptCount(); cint64 expCount = cachedEntry->getExpanderCacheValueCount(); if (expCount < conSetCount) { return false; } if (!compareIndividualNodeCompatibility(individualNode,cachedEntry,calcAlgContext)) { return false; } if (entry) { *entry = cachedEntry; } if (satisfiable) { *satisfiable = cachedEntry->isSatisfiable(); } return true; } } return false; } bool CSatisfiableExpanderCacheHandler::compareIndividualNodeCompatibility(CIndividualProcessNode* individualNode, CSignatureSatisfiableExpanderCacheEntry* cachedEntry, CCalculationAlgorithmContext* calcAlgContext) { CReapplyConceptLabelSet* conSet = individualNode->getReapplyConceptLabelSet(false); cint64 conSetCount = conSet->getConceptCount(); CExpanderCacheValueLinker* expCacheValueLinker = cachedEntry->getExpanderCacheValueLinker(); cint64 conNr = 0; while (expCacheValueLinker && conNr++ < conSetCount) { CCacheValue* cacheValue = expCacheValueLinker->getCacheValue(); CConcept* concept = (CConcept*)cacheValue->getIdentification(); CConceptDescriptor* conDes = nullptr; CDependencyTrackPoint* depTrackPoint = nullptr; if (conSet->getConceptDescriptor(concept,conDes,depTrackPoint)) { bool conNegated = conDes->isNegated(); bool cacheNegated = cacheValue->getCacheValueIdentifier() == CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; if (conNegated != cacheNegated || conDes->getConcept() != concept) { return false; } } else { return false; } expCacheValueLinker = expCacheValueLinker->getNext(); } return true; } bool CSatisfiableExpanderCacheHandler::cacheIndividualNodeSatisfiable(CIndividualProcessNode* individualNode, CCalculationAlgorithmContext* calcAlgContext) { STATINC(SATEXPCACHEWRITINGREQUESTCOUNT,calcAlgContext); STATINC(SATEXPCACHESATISFIABLEWRITINGREQUESTCOUNT,calcAlgContext); CReapplyConceptLabelSet* conSet = individualNode->getReapplyConceptLabelSet(false); if (conSet) { if (conSet->getConceptStructure()->hasBindingPropagationConcepts() || conSet->getConceptStructure()->hasDynamicCreatedConcepts()) { return false; } mTestConSet = conSet; cint64 conSetSignature = conSet->getConceptSignatureValue(); CIndividualNodeSatisfiableExpandingCacheStoringData* satStorData = (CIndividualNodeSatisfiableExpandingCacheStoringData*)individualNode->getIndividualSatisfiableCacheStoringData(false); if (satStorData) { if (satStorData->hasCachingError()) { return false; } if (satStorData->hasPreviousSatisfiableCached()) { if (satStorData->getLastCachedSignature() == conSetSignature) { return false; } } } bool localizedSatStorData = false; CMemoryAllocationManager* memMan = calcAlgContext->getUsedTemporaryMemoryAllocationManager(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CIndividualNodeSatisfiableExpandingCacheStoringData* locSatStorData = (CIndividualNodeSatisfiableExpandingCacheStoringData*)individualNode->getIndividualSatisfiableCacheStoringData(true); if (locSatStorData && !satStorData) { // is probably caching by another thread return false; } if (!locSatStorData) { locSatStorData = CObjectAllocator::allocateAndConstruct(taskMemMan); locSatStorData->initSatisfiableExpandingCacheRetrievalData(satStorData); satStorData = locSatStorData; individualNode->setIndividualSatisfiableCacheStoringData(locSatStorData); localizedSatStorData = true; } CConceptDescriptor* lastAddedConDes = conSet->getAddingSortedConceptDescriptionLinker(); CSignatureSatisfiableExpanderCacheEntry* cachedEntry = mSatCacheReader->getCacheEntry(conSetSignature); if (cachedEntry) { STATINC(SATEXPCACHEWRITINGSIGNATUREALREADYCACHEDCOUNT,calcAlgContext); if (!compareIndividualNodeCompatibility(individualNode,cachedEntry,calcAlgContext)) { STATINC(SATEXPCACHEWRITINGSIGNATUREALREADYCACHEDINCOMPATIBLECOUNT,calcAlgContext); STATINC(SATEXPCACHEWRITINGERRORCOUNT,calcAlgContext); satStorData->setCachingError(true); return false; } else { if (!cachedEntry->isSatisfiable()) { // write only satisfiability STATINC(SATEXPCACHEWRITINGSIGNATUREALREADYCACHEDSATADDEDCOUNT,calcAlgContext); prepareCacheMessages(calcAlgContext); CTaskMemoryPoolAllocationManager* satCacheMemMan = mMemAllocMan; CContextBase* tmpContext = mTmpContext; CCACHINGLIST* cacheValueList = CObjectParameterizingAllocator< CCACHINGLIST,CContext* >::allocateAndConstructAndParameterize(satCacheMemMan,tmpContext); CCACHINGLIST* branchedList = CObjectParameterizingAllocator< CCACHINGLIST,CContext* >::allocateAndConstructAndParameterize(satCacheMemMan,tmpContext); CConceptDescriptor* conDesIt = lastAddedConDes; while (conDesIt) { CConceptDescriptor* conDes = conDesIt; cint64 conTag = conDes->getConceptTag(); CCacheValue::CACHEVALUEIDENTIFIER cacheValueIdentifier = CCacheValue::CACHEVALTAGANDCONCEPT; if (conDes->getNegation()) { cacheValueIdentifier = CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; } CCacheValue cacheValue; cacheValue.initCacheValue(conTag,(cint64)conDes->getConcept(),cacheValueIdentifier); cacheValueList->prepend(cacheValue); if (isCardinalityRestrictionCriticalForSatisfiable(individualNode,conDes,calcAlgContext)) { branchedList->append(cacheValue); } conDesIt = conDesIt->getNextConceptDesciptor(); } CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData* satBranchWriteData = CObjectAllocator< CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData >::allocateAndConstruct(satCacheMemMan); satBranchWriteData->initSatisfiableBranchWriteData(conSetSignature,cacheValueList,branchedList); addCacheMessages(satBranchWriteData,calcAlgContext); } satStorData->setLastCachedConceptDescriptor(lastAddedConDes); satStorData->setPreviousCached(true); satStorData->setPreviousSatisfiableCached(true); satStorData->setLastCachedSignature(conSetSignature); return true; } } CConceptDescriptor* lastCachedConceptDes = satStorData->getLastCachedConceptDescriptor(); CPROCESSINGLIST reverseConDesList(calcAlgContext->getUsedTaskProcessorContext()); // check whether to restart caching bool directBranched = false; bool dependencyToAncestor = false; cint64 lastBranchingTag = -1; CConceptDescriptor* conDesIt = lastAddedConDes; while (conDesIt != lastCachedConceptDes) { CConceptDescriptor* conDes = conDesIt; CDependencyTrackPoint* depTrackPoint = conDesIt->getDependencyTrackPoint(); if (hasDependencyToAncestor(individualNode,depTrackPoint,&directBranched,calcAlgContext)) { dependencyToAncestor = true; } reverseConDesList.prepend(conDes); conDesIt = conDesIt->getNextConceptDesciptor(); } if (dependencyToAncestor) { satStorData->setPreviousCached(false); satStorData->setPreviousSatisfiableCached(false); satStorData->setLastCachedSignature(0); satStorData->setLastCachedConceptDescriptor(nullptr); lastCachedConceptDes = nullptr; } if (directBranched) { satStorData->setIndividualNodeOrSuccessorBranchedConcept(true); } while (conDesIt) { CConceptDescriptor* conDes = conDesIt; reverseConDesList.prepend(conDes); conDesIt = conDesIt->getNextConceptDesciptor(); } cint64 lastConSetSignature = satStorData->getLastCachedSignature(); if (!satStorData->hasPreviousCached() && lastCachedConceptDes && lastConSetSignature != 0 && lastConSetSignature != conSetSignature) { cacheIndividualNodeExpansion(individualNode,satStorData,lastCachedConceptDes,nullptr,lastConSetSignature,0,calcAlgContext); } // try satisfiable caching prepareCacheMessages(calcAlgContext); CTaskMemoryPoolAllocationManager* satCacheMemMan = mMemAllocMan; CTaskMemoryPoolAllocationManager* expCacheMemMan = mMemAllocMan; CContextBase* tmpSatBranchContext = mTmpContext; CContextBase* tmpExpContext = mTmpContext; CCACHINGHASH* depHash = CObjectParameterizingAllocator< CCACHINGHASH,CContext* >::allocateAndConstructAndParameterize(expCacheMemMan,tmpExpContext); CCACHINGLIST* expValueList = CObjectParameterizingAllocator< CCACHINGLIST,CContext* >::allocateAndConstructAndParameterize(expCacheMemMan,tmpExpContext); CCACHINGLIST* satValueList = CObjectParameterizingAllocator< CCACHINGLIST,CContext* >::allocateAndConstructAndParameterize(satCacheMemMan,tmpSatBranchContext); CCACHINGLIST* branchedList = CObjectParameterizingAllocator< CCACHINGLIST,CContext* >::allocateAndConstructAndParameterize(satCacheMemMan,tmpSatBranchContext); if (!satStorData->hasPreviousCached()) { lastCachedConceptDes = nullptr; lastConSetSignature = 0; } bool lastCachedConDesReached = false; bool cachingError = false; CPROCESSINGSET notBranchConceptsSet(calcAlgContext->getUsedTaskProcessorContext()); for (CPROCESSINGLIST::const_iterator it = reverseConDesList.constBegin(), itEnd = reverseConDesList.constEnd(); it != itEnd; ++it) { CConceptDescriptor* conDesIt = *it; CConceptDescriptor* conDes = conDesIt; CDependencyTrackPoint* depTrackPoint = nullptr; bool conceptDepInNodeOrSuccesssorBranched = false; cint64 conTag = conDes->getConceptTag(); if (lastCachedConDesReached) { CConceptDescriptor* conDes = conDesIt; CDependencyTrackPoint* depTrackPoint = conDes->getDependencyTrackPoint(); if (!simpleDependencyTracking(individualNode,conTag,depTrackPoint,depHash,¬BranchConceptsSet,&conceptDepInNodeOrSuccesssorBranched,calcAlgContext)) { CPROCESSINGSET depSet(calcAlgContext->getTaskProcessorContext()); CPROCESSINGLIST depList(calcAlgContext->getTaskProcessorContext()); cint64 baseAncDepth = individualNode->getIndividualAncestorDepth(); depSet.insert(CDepthDependencyPair(baseAncDepth,depTrackPoint)); depList.append(CDepthDependencyPair(baseAncDepth,depTrackPoint)); if (!complexDependencyTracking(individualNode,conTag,&depSet,&depList,depHash,¬BranchConceptsSet,&conceptDepInNodeOrSuccesssorBranched,calcAlgContext)) { // error cachingError = true; } } } bool addConceptToSatBranchedList = false; if (conceptDepInNodeOrSuccesssorBranched) { if (isConceptRelevantForSatisfiableBranch(individualNode,conDes,calcAlgContext)) { addConceptToSatBranchedList = true; } } else { notBranchConceptsSet.insert(conDes->getConceptTag()); if (isCardinalityRestrictionCriticalForSatisfiable(individualNode,conDes,calcAlgContext)) { addConceptToSatBranchedList = true; } CCacheValue::CACHEVALUEIDENTIFIER cacheValueIdentifier = CCacheValue::CACHEVALTAGANDCONCEPT; if (conDes->getNegation()) { cacheValueIdentifier = CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; } expValueList->append(CCacheValue(conTag,(cint64)conDes->getConcept(),cacheValueIdentifier)); satValueList->append(CCacheValue(conTag,(cint64)conDes->getConcept(),cacheValueIdentifier)); } if (addConceptToSatBranchedList) { STATINC(SATEXPCACHEWRITINGSIGSATCRITICALBRANCHCONCEPTADDEDCOUNT,calcAlgContext); CCacheValue::CACHEVALUEIDENTIFIER cacheValueIdentifier = CCacheValue::CACHEVALTAGANDCONCEPT; if (conDes->getNegation()) { cacheValueIdentifier = CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; } branchedList->append(CCacheValue(conTag,(cint64)conDes->getConcept(),cacheValueIdentifier)); } directBranched |= conceptDepInNodeOrSuccesssorBranched; if (!lastCachedConDesReached) { if (conDesIt == lastCachedConceptDes) { lastCachedConDesReached = true; } } } if (cachingError) { STATINC(SATEXPCACHEWRITINGERRORCOUNT,calcAlgContext); satStorData->setCachingError(true); } else { cint64 lastSig = lastConSetSignature; if (!satStorData->hasPreviousSatisfiableCached() && lastConSetSignature == conSetSignature) { lastSig = 0; } cint64 newSig = conSetSignature; STATINC(SATEXPCACHEWRITINGSIGNATUREEXPANSIONCOUNT,calcAlgContext); CSignatureSatisfiableExpanderCacheEntryExpandWriteData* expandWriteData = CObjectAllocator< CSignatureSatisfiableExpanderCacheEntryExpandWriteData >::allocateAndConstruct(expCacheMemMan); expandWriteData->initExpandWriteData(lastSig,newSig,expValueList,depHash); STATINC(SATEXPCACHEWRITINGSIGNATURESATISFIABLECOUNT,calcAlgContext); CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData* satBranchWriteData = CObjectAllocator< CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData >::allocateAndConstruct(satCacheMemMan); satBranchWriteData->initSatisfiableBranchWriteData(newSig,satValueList,branchedList); satBranchWriteData->setNext(expandWriteData); addCacheMessages(satBranchWriteData,calcAlgContext); satStorData->setPreviousCached(true); satStorData->setPreviousSatisfiableCached(true); satStorData->setLastCachedSignature(newSig); satStorData->setLastCachedConceptDescriptor(lastAddedConDes); satStorData->setIndividualNodeOrSuccessorBranchedConcept(directBranched); return true; } } return false; } bool CSatisfiableExpanderCacheHandler::cacheIndividualNodeExpansion(CIndividualProcessNode* individualNode, CCalculationAlgorithmContext* calcAlgContext) { STATINC(SATEXPCACHEWRITINGREQUESTCOUNT,calcAlgContext); STATINC(SATEXPCACHESATISFIABLEWRITINGREQUESTCOUNT,calcAlgContext); CReapplyConceptLabelSet* conSet = individualNode->getReapplyConceptLabelSet(false); mTestConSet = conSet; cint64 conSetSignature = conSet->getConceptSignatureValue(); CIndividualNodeSatisfiableExpandingCacheStoringData* satStorData = (CIndividualNodeSatisfiableExpandingCacheStoringData*)individualNode->getIndividualSatisfiableCacheStoringData(false); if (satStorData) { if (satStorData->hasCachingError()) { return false; } if (satStorData->hasIndividualNodeOrSuccessorBranchedConcept()) { return false; } if (satStorData->getLastCachedSignature() == conSetSignature) { return false; } } CMemoryAllocationManager* memMan = calcAlgContext->getUsedTemporaryMemoryAllocationManager(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CIndividualNodeSatisfiableExpandingCacheStoringData* locSatStorData = (CIndividualNodeSatisfiableExpandingCacheStoringData*)individualNode->getIndividualSatisfiableCacheStoringData(true); if (locSatStorData && !satStorData) { // is probably caching by another thread return false; } if (!locSatStorData) { locSatStorData = CObjectAllocator::allocateAndConstruct(taskMemMan); locSatStorData->initSatisfiableExpandingCacheRetrievalData(satStorData); satStorData = locSatStorData; individualNode->setIndividualSatisfiableCacheStoringData(locSatStorData); } CConceptDescriptor* lastAddedConDes = conSet->getAddingSortedConceptDescriptionLinker(); CConceptDescriptor* lastCachedConceptDes = satStorData->getLastCachedConceptDescriptor(); if (!satStorData->hasPreviousCached() && !lastCachedConceptDes) { satStorData->setLastCachedConceptDescriptor(lastAddedConDes); satStorData->setLastCachedSignature(conSetSignature); STATINC(SATEXPCACHEWRITINGEXPANSIONDELAYEDCOUNT,calcAlgContext); return true; } CSignatureSatisfiableExpanderCacheEntry* cachedEntry = mSatCacheReader->getCacheEntry(conSetSignature); if (cachedEntry) { STATINC(SATEXPCACHEWRITINGSIGNATUREALREADYCACHEDCOUNT,calcAlgContext); cint64 conSetCount = conSet->getConceptCount(); cint64 expCount = cachedEntry->getExpanderCacheValueCount(); if (expCount < conSetCount) { return false; } if (!compareIndividualNodeCompatibility(individualNode,cachedEntry,calcAlgContext)) { STATINC(SATEXPCACHEWRITINGSIGNATUREALREADYCACHEDINCOMPATIBLECOUNT,calcAlgContext); STATINC(SATEXPCACHEWRITINGERRORCOUNT,calcAlgContext); satStorData->setCachingError(true); return false; } else { satStorData->setLastCachedConceptDescriptor(lastAddedConDes); satStorData->setPreviousCached(true); satStorData->setLastCachedSignature(conSetSignature); return true; } } //CConceptDescriptor* testConDesIt = lastAddedConDes; //while (testConDesIt && testConDesIt->hasNext() && testConDesIt->getNextConceptDesciptor()->hasNext()) { // testConDesIt = testConDesIt->getNextConceptDesciptor(); //} //QString conString; //if (testConDesIt) { // conString = CIRIName::getRecentIRIName(testConDesIt->getConcept()->getClassNameLinker()); // if (conString == "http://www.owllink.org/testsuite/galen#Diabetes" || conString == "http://www.owllink.org/testsuite/galen#ProperHepaticArtery") { // bool bug = true; // } //} // check whether to restart caching bool directBranched = false; bool dependencyToAncestor = false; CConceptDescriptor* conDesIt = lastAddedConDes; while (conDesIt != lastCachedConceptDes) { CConceptDescriptor* conDes = conDesIt; CDependencyTrackPoint* depTrackPoint = conDes->getDependencyTrackPoint(); if (hasDependencyToAncestor(individualNode,depTrackPoint,&directBranched,calcAlgContext)) { dependencyToAncestor = true; } conDesIt = conDesIt->getNextConceptDesciptor(); } if (dependencyToAncestor) { satStorData->setPreviousCached(false); satStorData->setPreviousSatisfiableCached(false); satStorData->setLastCachedSignature(conSetSignature); satStorData->setLastCachedConceptDescriptor(lastAddedConDes); return true; } if (directBranched) { satStorData->setIndividualNodeOrSuccessorBranchedConcept(true); return false; } cint64 lastConSetSignature = satStorData->getLastCachedSignature(); if (!satStorData->hasPreviousCached() && lastCachedConceptDes && lastConSetSignature != 0) { cacheIndividualNodeExpansion(individualNode,satStorData,lastCachedConceptDes,nullptr,lastConSetSignature,0,calcAlgContext); } if (!satStorData->hasCachingError() && !satStorData->hasIndividualNodeOrSuccessorBranchedConcept()) { cacheIndividualNodeExpansion(individualNode,satStorData,lastAddedConDes,lastCachedConceptDes,conSetSignature,lastConSetSignature,calcAlgContext); } //commitCacheMessages(calcAlgContext); return false; } bool CSatisfiableExpanderCacheHandler::cacheIndividualNodeExpansion(CIndividualProcessNode* individualNode, CIndividualNodeSatisfiableExpandingCacheStoringData* satStorData, CConceptDescriptor* lastAddedConDes, CConceptDescriptor* lastCachedConceptDes, cint64 lastSignature, cint64 lastCachedSignature, CCalculationAlgorithmContext* calcAlgContext) { CReapplyConceptLabelSet* conSet = individualNode->getReapplyConceptLabelSet(false); // try caching prepareCacheMessages(calcAlgContext); CTaskMemoryPoolAllocationManager* satCacheMemMan = mMemAllocMan; CContextBase* tmpContext = mTmpContext; CCACHINGHASH* depHash = CObjectParameterizingAllocator< CCACHINGHASH,CContext* >::allocateAndConstructAndParameterize(satCacheMemMan,tmpContext); CCACHINGLIST* cacheValueList = CObjectParameterizingAllocator< CCACHINGLIST,CContext* >::allocateAndConstructAndParameterize(satCacheMemMan,tmpContext); CConceptDescriptor* conDesIt = lastAddedConDes; bool directBranched = false; bool cachingError = false; if (lastCachedConceptDes) { while (conDesIt != lastCachedConceptDes && !directBranched && !cachingError) { CConceptDescriptor* conDes = conDesIt; CDependencyTrackPoint* depTrackPoint = conDes->getDependencyTrackPoint(); cint64 conTag = conDes->getConceptTag(); if (!simpleDependencyTracking(individualNode,conTag,depTrackPoint,depHash,nullptr,&directBranched,calcAlgContext)) { CPROCESSINGSET depSet(calcAlgContext->getTaskProcessorContext()); CPROCESSINGLIST depList(calcAlgContext->getTaskProcessorContext()); cint64 baseAncDepth = individualNode->getIndividualAncestorDepth(); depSet.insert(CDepthDependencyPair(baseAncDepth,depTrackPoint)); depList.append(CDepthDependencyPair(baseAncDepth,depTrackPoint)); if (!complexDependencyTracking(individualNode,conTag,&depSet,&depList,depHash,nullptr,&directBranched,calcAlgContext)) { // error cachingError = true; } } CCacheValue::CACHEVALUEIDENTIFIER cacheValueIdentifier = CCacheValue::CACHEVALTAGANDCONCEPT; if (conDes->getNegation()) { cacheValueIdentifier = CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; } cacheValueList->prepend(CCacheValue(conTag,(cint64)conDes->getConcept(),cacheValueIdentifier)); conDesIt = conDesIt->getNextConceptDesciptor(); } } if (directBranched || cachingError) { if (directBranched) { satStorData->setIndividualNodeOrSuccessorBranchedConcept(true); } if (cachingError) { STATINC(SATEXPCACHEWRITINGERRORCOUNT,calcAlgContext); satStorData->setCachingError(true); } } else { while (conDesIt) { CConceptDescriptor* conDes = conDesIt; cint64 conTag = conDes->getConceptTag(); CCacheValue::CACHEVALUEIDENTIFIER cacheValueIdentifier = CCacheValue::CACHEVALTAGANDCONCEPT; if (conDes->getNegation()) { cacheValueIdentifier = CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; } cacheValueList->prepend(CCacheValue(conTag,(cint64)conDes->getConcept(),cacheValueIdentifier)); conDesIt = conDesIt->getNextConceptDesciptor(); } cint64 lastSig = lastCachedSignature; cint64 newSig = lastSignature; STATINC(SATEXPCACHEWRITINGSIGNATUREEXPANSIONCOUNT,calcAlgContext); CSignatureSatisfiableExpanderCacheEntryExpandWriteData* expandWriteData = CObjectAllocator< CSignatureSatisfiableExpanderCacheEntryExpandWriteData >::allocateAndConstruct(satCacheMemMan); expandWriteData->initExpandWriteData(lastSig,newSig,cacheValueList,depHash); addCacheMessages(expandWriteData,calcAlgContext); satStorData->setPreviousCached(true); satStorData->setLastCachedSignature(newSig); satStorData->setLastCachedConceptDescriptor(lastAddedConDes); return true; } return false; } bool CSatisfiableExpanderCacheHandler::prepareCacheMessages(CCalculationAlgorithmContext* calcAlgContext) { if (!mMemAllocMan) { CTaskMemoryPoolAllocationManager satCacheMemManCreaterMemMan(&mMemPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mMemAllocMan = CObjectAllocator::allocateAndConstruct(&satCacheMemManCreaterMemMan); mMemAllocMan->initTaskMemoryPoolAllocationManager(&mMemPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mTmpContext = CObjectParameterizingAllocator< CContextBase,CMemoryAllocationManager* >::allocateAndConstructAndParameterize(mMemAllocMan,mMemAllocMan); return true; } return false; } bool CSatisfiableExpanderCacheHandler::commitCacheMessages(CCalculationAlgorithmContext* calcAlgContext) { if (mWriteData) { CSignatureSatisfiableExpanderCacheEntryWriteData* commitWriteData = nullptr; CSignatureSatisfiableExpanderCacheEntryWriteData* writeDataIt = mWriteData; while (writeDataIt) { CSignatureSatisfiableExpanderCacheEntryWriteData* tmpWriteData = writeDataIt; writeDataIt = (CSignatureSatisfiableExpanderCacheEntryWriteData*)writeDataIt->getNext(); tmpWriteData->clearNext(); if (commitWriteData) { commitWriteData = (CSignatureSatisfiableExpanderCacheEntryWriteData*)tmpWriteData->append(commitWriteData); } else { commitWriteData = tmpWriteData; } } mSatCacheWriter->writeCachedData(commitWriteData,mMemPoolCon.takeMemoryPools()); mWriteData = nullptr; mMemAllocMan = nullptr; mTmpContext = nullptr; return true; } return false; } bool CSatisfiableExpanderCacheHandler::addCacheMessages(CSignatureSatisfiableExpanderCacheEntryWriteData* expandWriteData, CCalculationAlgorithmContext* calcAlgContext) { if (mWriteData) { mWriteData = (CSignatureSatisfiableExpanderCacheEntryWriteData*)expandWriteData->append(mWriteData); } else { mWriteData = expandWriteData; } //commitCacheMessages(calcAlgContext); return true; } bool CSatisfiableExpanderCacheHandler::isCardinalityRestrictionCriticalForSatisfiable(CIndividualProcessNode* individualNode, CConceptDescriptor* conDes, CCalculationAlgorithmContext* calcAlgContext) { CConcept* concept = conDes->getConcept(); bool conNeg = conDes->getNegation(); cint64 conCode = concept->getOperatorCode(); if (!conNeg && (conCode == CCATMOST) || conNeg && (conCode == CCATLEAST)) { cint64 cardinality = concept->getParameter() - 1*conNeg; if (cardinality > 1) { CRole* role = concept->getRole(); if (role) { cint64 succCount = individualNode->getRoleSuccessorCount(role); if (succCount >= cardinality) { return hasInverseSubRole(role,calcAlgContext); } } } } return false; } bool CSatisfiableExpanderCacheHandler::hasInverseSubRole(CRole* role, CCalculationAlgorithmContext* calcAlgContext) { return true; } bool CSatisfiableExpanderCacheHandler::hasInverseSuperRole(CRole* role, CCalculationAlgorithmContext* calcAlgContext) { return true; } bool CSatisfiableExpanderCacheHandler::isConceptRelevantForSatisfiableBranch(CIndividualProcessNode* individualNode, CConceptDescriptor* conDes, CCalculationAlgorithmContext* calcAlgContext) { CConcept* concept = conDes->getConcept(); bool conNeg = conDes->getNegation(); cint64 conCode = concept->getOperatorCode(); CConceptOperator* conOperator = concept->getConceptOperator(); if (!conNeg && (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_AQALL_TYPE)) || conNeg && (conCode == CCSOME)) { CRole* role = concept->getRole(); if (role) { return hasInverseSubRole(role,calcAlgContext); } } if (!conNeg && (conCode == CCATMOST) || conNeg && (conCode == CCATLEAST)) { CRole* role = concept->getRole(); if (role) { if (hasInverseSubRole(role,calcAlgContext)) { cint64 cardinality = concept->getParameter() - 1*conNeg; cint64 succCount = individualNode->getRoleSuccessorCount(role); if (succCount >= cardinality) { return true; } return false; } else { return false; } } } if (!conNeg && (conCode == CCSOME || conCode == CCAQSOME || conCode == CCATLEAST) || conNeg && (conCode == CCALL || conCode == CCATMOST)) { CRole* role = concept->getRole(); if (role) { // test has ATMOST restriction for some super role CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { if (!superRoleIt->isNegated()) { CRole* superRole = superRoleIt->getData(); CReapplyQueueIterator reapplyIt = individualNode->getRoleReapplyIterator(superRole,false); while (reapplyIt.hasNext()) { CReapplyConceptDescriptor* reapplyDes = reapplyIt.next(); CConceptDescriptor* reapplyConDes = reapplyDes->getConceptDescriptor(); CConcept* reapplyConcept = reapplyConDes->getConcept(); CRole* reapplyRole = reapplyConcept->getRole(); bool reapplyConNeg = reapplyConDes->getNegation(); cint64 reapplyConOpCode = reapplyConcept->getOperatorCode(); if (reapplyConNeg && reapplyConOpCode == CCATLEAST || !reapplyConNeg && reapplyConOpCode == CCATMOST) { cint64 cardinality = reapplyConcept->getParameter() - 1*reapplyConNeg; cint64 succCount = individualNode->getRoleSuccessorCount(role); if (succCount >= cardinality) { return hasInverseSubRole(reapplyRole,calcAlgContext); } } } } superRoleIt = superRoleIt->getNext(); } return false; } } if (!conNeg && (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQAND_TYPE))) { return isAutomatConceptRelevantForSatisfiableBranch(individualNode,concept,conNeg,calcAlgContext); } return false; } bool CSatisfiableExpanderCacheHandler::isAutomatConceptRelevantForSatisfiableBranch(CIndividualProcessNode* individualNode, CConcept* concept, bool conNegation, CCalculationAlgorithmContext* calcAlgContext) { cint64 conCode = concept->getOperatorCode(); CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQALL_TYPE)) { CRole* role = concept->getRole(); if (role) { CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { if (superRoleIt->isNegated()) { return true; } superRoleIt = superRoleIt->getNext(); } } } else if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQAND_TYPE)) { CSortedNegLinker* opConLinkerIt = concept->getOperandList(); while (opConLinkerIt) { CConcept* opCon = opConLinkerIt->getData(); bool opNeg = opConLinkerIt->isNegated(); if (isAutomatConceptRelevantForSatisfiableBranch(individualNode,opCon,opNeg,calcAlgContext)) { return true; } opConLinkerIt = opConLinkerIt->getNext(); } } return false; } bool CSatisfiableExpanderCacheHandler::simpleDependencyTracking(CIndividualProcessNode* individualNode, cint64 conTag, CDependencyTrackPoint* depTrackPoint, CCACHINGHASH* depHash, CPROCESSINGSET* notBranchConceptsSet, bool* branchedFlag, CCalculationAlgorithmContext* calcAlgContext) { if (branchedFlag && !depTrackPoint->isPointingToDeterministicDependencyNode()) { *branchedFlag = true; return true; } if (depTrackPoint->isPointingToIndependentDependencyNode()) { return true; } CDependencyNode* depNode = depTrackPoint->getDependencyNode(); if (depNode->hasAdditionalDependencies()) { return false; } if (depNode->hasAppropriateIndividualNode()) { CIndividualProcessNode* appIndiNode = depNode->getAppropriateIndividualNode(); cint64 appIndiDepth = appIndiNode->getIndividualAncestorDepth(); cint64 baseDepth = individualNode->getIndividualAncestorDepth(); if (appIndiDepth != baseDepth) { return false; } } CConceptDescriptor* conDes = depNode->getConceptDescriptor(); if (conDes) { cint64 depConTag = conDes->getConceptTag(); if (branchedFlag && notBranchConceptsSet && !notBranchConceptsSet->contains(conDes->getConceptTag())) { *branchedFlag = true; return true; } depHash->insertMulti(conTag,depConTag); //CConceptDescriptor* cD = nullptr; //CDependencyTrackPoint* dTP = nullptr; //if (individualNode->getReapplyConceptLabelSet(false)->getConceptDescriptor(conTag,cD,dTP)) { // if (cD->isNegated() && cD->getConcept()->getOperatorCode() == CCSUB) { // if (conDes->isNegated() && conDes->getConcept()->getOperatorCode() == CCSUB) { // bool bug = true; // } // } //} //CConceptDescriptor* cD = nullptr; //CDependencyTrackPoint* dTP = nullptr; //if (!individualNode->getReapplyConceptLabelSet(false)->getConceptDescriptor(depConTag,cD,dTP)) { // bool bug = true; //} else { // CConceptDescriptor* conDesIt = cD; // while (conDesIt) { // if (conDesIt->getConceptTag() == conTag) { // bool bug = true; // } // conDesIt = conDesIt->getNext(); // } // bool foundDepTag = false; // conDesIt = conDes; // while (conDesIt) { // if (conDesIt->getConceptTag() == depConTag) { // foundDepTag = true; // } // conDesIt = conDesIt->getNext(); // } // if (!foundDepTag) { // bool bug = true; // } //} return true; } return false; } bool CSatisfiableExpanderCacheHandler::complexDependencyTracking(CIndividualProcessNode* individualNode, cint64 conTag, CPROCESSINGSET* depSet, CPROCESSINGLIST* depList, CCACHINGHASH* depHash, CPROCESSINGSET* notBranchConceptsSet, bool* branchedFlag, CCalculationAlgorithmContext* calcAlgContext) { cint64 baseAncDepth = individualNode->getIndividualAncestorDepth(); while (!depList->isEmpty()) { CDepthDependencyPair depthDepPair(depList->takeFirst()); cint64 ancDepth = depthDepPair.first; CDependencyTrackPoint* depTrackPoint = depthDepPair.second; if (branchedFlag && !depTrackPoint->isPointingToDeterministicDependencyNode()) { *branchedFlag = true; return true; } CDependencyNode* depNode = depTrackPoint->getDependencyNode(); CIndividualProcessNode* appIndiNode = depNode->getAppropriateIndividualNode(); cint64 newAncDepth = ancDepth; bool continueDepLoading = true; if (appIndiNode) { newAncDepth = appIndiNode->getIndividualAncestorDepth(); } if (newAncDepth == baseAncDepth) { CConceptDescriptor* conDes = depNode->getConceptDescriptor(); if (conDes) { if (branchedFlag && notBranchConceptsSet) { if (!notBranchConceptsSet->contains(conDes->getConceptTag())) { *branchedFlag = true; return true; } } continueDepLoading = false; cint64 depConTag = conDes->getConceptTag(); if (depConTag != conTag) { depHash->insertMulti(conTag,depConTag); //CConceptDescriptor* cD = nullptr; //CDependencyTrackPoint* dTP = nullptr; //if (individualNode->getReapplyConceptLabelSet(false)->getConceptDescriptor(conTag,cD,dTP)) { // if (cD->isNegated() && cD->getConcept()->getOperatorCode() == CCSUB) { // if (conDes->isNegated() && conDes->getConcept()->getOperatorCode() == CCSUB) { // bool bug = true; // } // } //} //CConceptDescriptor* cD = nullptr; //CDependencyTrackPoint* dTP = nullptr; //if (!individualNode->getReapplyConceptLabelSet(false)->getConceptDescriptor(depConTag,cD,dTP)) { // bool bug = true; //} else { // CConceptDescriptor* conDesIt = cD; // while (conDesIt) { // if (conDesIt->getConceptTag() == conTag) { // bool bug = true; // } // conDesIt = conDesIt->getNext(); // } // bool foundDepTag = false; // conDesIt = conDes; // while (conDesIt) { // if (conDesIt->getConceptTag() == depConTag) { // foundDepTag = true; // } // conDesIt = conDesIt->getNext(); // } // if (!foundDepTag) { // bool bug = true; // } //} } } } if (newAncDepth < baseAncDepth) { return false; } if (continueDepLoading) { CDependencyTrackPoint* prevDepTrackPoint = depNode->getPreviousDependencyTrackPoint(); cint64 nextAncDepth = newAncDepth; CDependencyNode* nextDepNode = prevDepTrackPoint->getDependencyNode(); if (nextDepNode && nextDepNode->hasAppropriateIndividualNode()) { nextAncDepth = nextDepNode->getAppropriateIndividualNode()->getIndividualAncestorDepth(); } if (!depSet->contains(CDepthDependencyPair(nextAncDepth,prevDepTrackPoint))) { depSet->insert(CDepthDependencyPair(nextAncDepth,prevDepTrackPoint)); depList->append(CDepthDependencyPair(nextAncDepth,prevDepTrackPoint)); } } CDependencyIterator depIt = depNode->getAdditionalDependencyIterator(); while (depIt.hasNext()) { CDependency* dependency = depIt.nextDependency(); // load additional dependencies CDependencyTrackPoint* prevDepTrackPoint = dependency->getPreviousDependencyTrackPoint(); cint64 nextAncDepth = ancDepth; CDependencyNode* nextDepNode = prevDepTrackPoint->getDependencyNode(); if (nextDepNode && nextDepNode->hasAppropriateIndividualNode()) { nextAncDepth = nextDepNode->getAppropriateIndividualNode()->getIndividualAncestorDepth(); } if (!depSet->contains(CDepthDependencyPair(ancDepth,prevDepTrackPoint))) { depSet->insert(CDepthDependencyPair(ancDepth,prevDepTrackPoint)); depList->append(CDepthDependencyPair(ancDepth,prevDepTrackPoint)); } } } return true; } bool CSatisfiableExpanderCacheHandler::hasDependencyToAncestor(CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint, bool* branchedFlag, CCalculationAlgorithmContext* calcAlgContext) { cint64 ancDepth = individualNode->getIndividualAncestorDepth(); bool dependencyToAncestor = false; if (ancDepth <= 0) { dependencyToAncestor = depTrackPoint->isPointingToIndependentDependencyNode(); } else { CDependencyNode* depNode = depTrackPoint->getDependencyNode(); if (depNode->hasAppropriateIndividualNode()) { CIndividualProcessNode* appIndiNode = depNode->getAppropriateIndividualNode(); cint64 appIndiAncDepth = appIndiNode->getIndividualAncestorDepth(); dependencyToAncestor = appIndiAncDepth < ancDepth; } else { CDependencyNode::DEPENDENCNODEYTYPE depType = depNode->getDependencyType(); if (depType == CDependencyNode::DNTMERGEDCONCEPT) { dependencyToAncestor = hasDependencyToAncestor(individualNode,depNode->getPreviousDependencyTrackPoint(),branchedFlag,calcAlgContext); } } } if (!dependencyToAncestor && branchedFlag) { if (!depTrackPoint->isPointingToDeterministicDependencyNode()) { *branchedFlag = true; } } return dependencyToAncestor; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CDatatypeIndividualProcessNodeHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CDatatypeIndividualProcessNodeHandle0000644000175000017500000001671512520551004032305 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CDATATYPEINDIVIDUALPROCESSNODEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CDATATYPEINDIVIDUALPROCESSNODEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CCalculationClashProcessingException.h" #include "CIndividualProcessNodeValueSpaceHandler.h" #include "CIndividualProcessNodeRealValueSpaceHandler.h" #include "CIndividualProcessNodeUnknownValueSpaceHandler.h" #include "CIndividualProcessNodeStringValueSpaceHandler.h" #include "CIndividualProcessNodeBooleanValueSpaceHandler.h" #include "CIndividualProcessNodeDoubleValueSpaceHandler.h" #include "CIndividualProcessNodeFloatValueSpaceHandler.h" #include "CIndividualProcessNodeIRIValueSpaceHandler.h" #include "CIndividualProcessNodeXMLValueSpaceHandler.h" #include "CIndividualProcessNodeBinaryBase64DataValueSpaceHandler.h" #include "CIndividualProcessNodeBinaryHexDataValueSpaceHandler.h" #include "CIndividualProcessNodeDateTimeValueSpaceHandler.h" #include "CDatatypeDependencyCollection.h" #include "CDependencyFactory.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CClashedDatatypeValueSpaceExclusionDescriptor.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CDatatypeIndividualProcessNodeHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeIndividualProcessNodeHandler { // public methods public: //! Constructor CDatatypeIndividualProcessNodeHandler(); //! Destructor virtual ~CDatatypeIndividualProcessNodeHandler(); bool addDataLiteral(CIndividualProcessNode* indiProcNode, CDataLiteral* dataLiteral, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); bool addDataRestriction(CIndividualProcessNode* indiProcNode, CConcept* dataRestricionConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); bool addDatatype(CIndividualProcessNode* indiProcNode, CConcept* datatypeConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); bool triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor*& triggeredConcepts, CCalculationAlgorithmContext* calcAlgContext); bool involveDistinctNodeForSatisfiabilityChecking(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); bool requiresSatisfiabilityChecking(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); bool checkSatisfiability(CIndividualProcessNode* indiProcNode, CPROCESSINGSET* distinctIndividualNodeSet, CCalculationAlgorithmContext* calcAlgContext); bool notifyDistinctChanges(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: void throwDatatypeValueSpaceExclusionClash(CClashedDependencyDescriptor* depDesLinker, CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); CIndividualProcessNodeValueSpaceHandler* getValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType, CCalculationAlgorithmContext* calcAlgContext); CClashedDependencyDescriptor* createClashedDependencyDescriptor(CClashedDependencyDescriptor* appendDepDesLinker, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CClashedDependencyDescriptor* copyClashedDependencyDescriptors(CClashedDependencyDescriptor* appendDepDesLinker, CClashedDependencyDescriptor* copyDepDesLinker, CCalculationAlgorithmContext* calcAlgContext); bool processValueSpaceModified(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); cint64 getDisjointCount(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); bool closeOtherValueSpaces(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceType* exceptionValueSpaceType, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); bool closeValueSpace(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceType* closeValueSpaceType, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); bool testAllValueSpacesClashed(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); CConceptDescriptor* triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, cint64& remainingRequiredValuesCount, CDatatypeValueSpaceData* valueSpaceData, CDatatypeValueSpaceType* valueSpaceType, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext); bool addValueSpacesDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext); bool addValueSpaceDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceData* valueSpaceData, CDatatypeValueSpaceType* valueSpaceType, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext); bool countPossibleValues(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceValuesCounter* valuesCounter, CCalculationAlgorithmContext* calcAlgContext); bool seachNextPossibleDataValue(CIndividualProcessNode* indiProcNode, CDataLiteralValue*& nextValue, CDatatypeValueSpaceType*& nextValueSpaceType, CDataLiteralValue* lastValue, CDatatypeValueTestingCollection* valueTestingCollection, CCalculationAlgorithmContext* calcAlgContext); bool addDistinctDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext); // protected variables protected: bool mConfBuildDependencies; CIndividualProcessNodeValueSpaceHandler* mValueSpaceHandlerArray[CDatatypeValueSpaceType::VALUESPACETYPECOUNT]; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CDATATYPEINDIVIDUALPROCESSNODEHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/AlgorithmSettings.h0000644000175000017500000000454612520551002027027 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_ALGORITHMSETTINGS #define KONCLUDE_REASONER_KERNEL_ALGORITHM_ALGORITHMSETTINGS // Libraries includes #include #include // Namespace includes // Other includes #include "KoncludeSettings.h" #include "Utilities/Container/CQtManagedRestrictedModificationHash.h" #include "Utilities/Container/CQtManagedRestrictedModificationMap.h" #include "Utilities/Container/CQtManagedRestrictedModificationSet.h" #include "Utilities/Container/CQtManagedRestrictedModificationList.h" // Logger includes namespace Konclude { using namespace Utilities; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Algorithm { /*! * * \file AlgorithmSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ #define CPROCESSINGLIST CQtManagedRestrictedModificationList #define CPROCESSINGSET CQtManagedRestrictedModificationSet #define CPROCESSINGHASH CQtManagedRestrictedModificationHash #define CPROCESSINGMAP CQtManagedRestrictedModificationMap // forward declarations class CCalculationAlgorithmContext; class CUnsatisfiableCacheHandler; class CIndividualNodeManager; class CClashDescriptorFactory; class CDependencyFactory; class CSatisfiableExpanderCacheHandler; class CSaturationNodeExpansionCacheHandler; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_KERNEL_ALGORITHM_ALGORITHMSETTINGS././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskIncrementalConsistencyPreyingAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskIncrementalConsisten0000644000175000017500000000571112520551014032354 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKINCREMENTALCONSISTENCYPREYINGANALYSER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKINCREMENTALCONSISTENCYPREYINGANALYSER_H // Libraries includes // Namespace includes #include "CCalculationAlgorithmContext.h" #include "CSatisfiableConsistencyPreyingAnalyser.h" // Other includes #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" #include "Reasoner/Kernel/Task/CIncrementalConsistenceTaskData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Task; namespace Algorithm { /*! * * \class CSatisfiableTaskIncrementalConsistencyPreyingAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableTaskIncrementalConsistencyPreyingAnalyser : public CSatisfiableConsistencyPreyingAnalyser { // public methods public: //! Constructor CSatisfiableTaskIncrementalConsistencyPreyingAnalyser(); //! Destructor virtual ~CSatisfiableTaskIncrementalConsistencyPreyingAnalyser(); bool analyseSatisfiableTask(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: bool analyseIncrementalChanges(CSatisfiableCalculationTask* statCalcTask, CIncrementalConsistenceTaskData* incConsData, CCalculationAlgorithmContext* calcAlgContext); CIndividualProcessNode* getMergedIntoIndividualNode(CIndividualProcessNode* indiNode, CIndividualProcessNodeVector* indiNodeVec, CCalculationAlgorithmContext* calcAlgContext); CIndividualProcessNode* getSuccessorIndividual(CIndividualProcessNode*& indi, CIndividualLinkEdge* link, CCalculationAlgorithmContext* calcAlgContext); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKINCREMENTALCONSISTENCYPREYINGANALYSER_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationStopProcessingException.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationStopProcessingException.0000644000175000017500000000262012520551002032322 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationStopProcessingException.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CCalculationStopProcessingException::CCalculationStopProcessingException(bool taskCompleted) { mTaskCompleted = taskCompleted; } CCalculationStopProcessingException::~CCalculationStopProcessingException() { } bool CCalculationStopProcessingException::isTaskCompletedProcessed() const { return mTaskCompleted; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CClashDescriptorFactory.h0000644000175000017500000000626112520551002030100 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CCLASHDESCRIPTORFACTORY_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCLASHDESCRIPTORFACTORY_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" // Other includes #include "Reasoner/Kernel/Process/CClashedIndividualLinkDescriptor.h" #include "Reasoner/Kernel/Process/CClashedConceptDescriptor.h" #include "Reasoner/Kernel/Process/CClashedIndividualDistinctDescriptor.h" #include "Reasoner/Kernel/Process/CClashedNegationDisjointLinkDescriptor.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { /*! * * \class CClashDescriptorFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClashDescriptorFactory { // public methods public: //! Constructor CClashDescriptorFactory(); //! Destructor virtual ~CClashDescriptorFactory(); CClashedDependencyDescriptor* createClashedConceptDescriptor(CClashedDependencyDescriptor* prevClashes, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext = nullptr); CClashedDependencyDescriptor* createClashedIndividualLinkDescriptor(CClashedDependencyDescriptor* prevClashes, CIndividualLinkEdge* link, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext = nullptr); CClashedDependencyDescriptor* createClashedIndividualDistinctDescriptor(CClashedDependencyDescriptor* prevClashes, CDistinctEdge* distinct, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext = nullptr); CClashedDependencyDescriptor* createClashedNegationDisjointDescriptor(CClashedDependencyDescriptor* prevClashes, CNegationDisjointEdge* disjointNegLink, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext = nullptr); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCLASHDESCRIPTORFACTORY_H ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBinaryHexDataValueSpaceHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBinaryHexDataV0000644000175000017500000000472412520551006032226 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEBINARYHEXDATAVALUESPACEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEBINARYHEXDATAVALUESPACEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CIndividualProcessNodeCompareValueSpaceHandler.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CIndividualProcessNodeBinaryHexDataValueSpaceHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeBinaryHexDataValueSpaceHandler : public CIndividualProcessNodeCompareValueSpaceHandler { // public methods public: //! Constructor CIndividualProcessNodeBinaryHexDataValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEBINARYHEXDATAVALUESPACEHANDLER_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskClassificationMessageAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskClassificationMessag0000644000175000017500000003163212520551012032317 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKCLASSIFICATIONMESSAGEANALYSER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKCLASSIFICATIONMESSAGEANALYSER_H // Libraries includes // Namespace includes #include "CCalculationAlgorithmContext.h" // Other includes #include "Context/CContextBase.h" #include "Reasoner/Classifier/CClassificationMessageDataObserver.h" #include "Reasoner/Classifier/CClassificationSubsumptionMessageData.h" #include "Reasoner/Classifier/CClassificationSubsumptionMessageData.h" #include "Reasoner/Classifier/CClassificationUpdatePossibleSubsumptionMessageData.h" #include "Reasoner/Classifier/CClassificationInitializePossibleSubsumptionMessageData.h" #include "Reasoner/Classifier/CClassificationMessageData.h" #include "Reasoner/Classifier/CClassificationSatisfiableCalculationConceptReferenceLinking.h" #include "Reasoner/Classifier/CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking.h" #include "Reasoner/Classifier/CClassificationPseudoModelIdentifierMessageData.h" #include "Reasoner/Consistiser/CSaturationConceptDataItem.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyNode.h" #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CIndividualSaturationProcessNode.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptSatisfiableReferenceLinkingData.h" #include "Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { using namespace Consistiser; using namespace Classifier; using namespace Ontology; namespace Kernel { using namespace Task; using namespace Process::Dependency; namespace Algorithm { /*! * * \class CSatisfiableTaskClassificationMessageAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableTaskClassificationMessageAnalyser { // public methods public: //! Constructor CSatisfiableTaskClassificationMessageAnalyser(); bool readCalculationConfig(CCalculationConfigurationExtension *config); bool analyseSatisfiableTask(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContext* calcAlgContext); CIndividualProcessNode* getCorrectedIndividualID(CIndividualProcessNode* baseIndiNode, CIndividualProcessNodeVector* indiNodeVec, bool* nondetMergedFlag); void checkCanHaveClashWithModel(CIndividualProcessNode* indiNode, CConcept* concept, bool negated, bool& clashFoundFlag, bool& unknownFlag, bool& clashFreeFlag, cint64 depth, QSet* testedIndividualsSet, CIndividualProcessNode* lastNode, CIndividualProcessNodeVector* indiNodeVec); void verifySubsumptionPossibleWithModel(CIndividualProcessNode* indiNode, CConcept* testingConcept, CClassificationMessageData* possSubsumMessageData, CCLASSSUBSUMPTIONMESSAGELIST* subsumerList); // protected methods protected: CClassificationMessageData* extractPossibleSubsumptionInformation(CConceptDescriptor* conDes, CIndividualProcessNode* indiNode, CReapplyConceptLabelSet* conSet, CCalculationAlgorithmContext* calcAlgContext); // protected variables protected: class CSaturatedMergedTestItem { public: CSaturatedMergedTestItem() { mSuccessfullyMerged = false; mSatisfiableMerged = false; } public: bool mSuccessfullyMerged; bool mSatisfiableMerged; }; class CConceptNegationTriggerItem { public: CConceptNegationTriggerItem() { mTriggerFlag = false; mNegationFlag = false; mConcept = nullptr; mIndiSatNode = nullptr; } public: bool mTriggerFlag; bool mNegationFlag; CConcept* mConcept; CIndividualSaturationProcessNode* mIndiSatNode; }; class CIndividualAnalyseProcessItem { public: CIndividualAnalyseProcessItem* initIndividualAnalyseProcessItem(cint64 indiID = 0, cint64 rootDistance = 0, CIndividualAnalyseProcessItem* ancItem = nullptr, CIndividualLinkEdge* ancLink = nullptr) { mRootDistance = rootDistance; mAncItem = ancItem; mIndiID = indiID; mAncLink = ancLink; return this; } public: cint64 mIndiID; cint64 mRootDistance; CIndividualLinkEdge* mAncLink; CIndividualAnalyseProcessItem* mAncItem; }; class CPseudoModelAnalyseProcessItem { public: CPseudoModelAnalyseProcessItem* initPseudoModelAnalyseProcessItem(cint64 pmModelID = 0, cint64 rootDistance = 0) { mPMModelID = pmModelID; mRootDistance = rootDistance; mNodeLinker = nullptr; return this; } CPseudoModelAnalyseProcessItem* addNodeLinker(CXNegLinker* nodeLinker) { if (nodeLinker) { mNodeLinker = nodeLinker->append(mNodeLinker); } return this; } public: cint64 mPMModelID; cint64 mRootDistance; CXNegLinker* mNodeLinker; }; typedef QPair TConceptNegationPair; bool mConfAnalyseSubSumptions; bool mConfAnalyseAllSubSumptions; bool mConfAnalyseIdentifierOccurence; bool mConfAnalysePossibleSubSumptions; bool mEquivalentAlternativesSaturationMerging; bool mConfStopAnalyseWhenNotChanging; cint64 mMaxModelAnalysingDepth; cint64 mMaxPossibleSubsumerNegationCheckingDepth; cint64 mMaxSaturatedModelMergingTestRecursionDepth; CClassPossibleSubsumptionMapIterator* mReusePossSubsumMapIterator; CPROCESSINGHASH< CConcept*,CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* >* mMultiplePossSubsumInitAvoidHash; bool mUseAlwaysConRefLinkDataHash; QHash* mConRefLinkDataHash; CTaskMemoryPoolAllocationManager* mTempMemAllocMan; CContextBase* mTmpContext; CSatisfiableCalculationTask* mStatCalcTask; CTaskMemoryPoolAllocationManager* mPMTempMemAllocMan; CContextBase* mPMTmpContext; cint64 mMaxPseudoModelDepth; cint64 mMaxPseudoModelNodes; cint64 mStatConsideredOtherNodeCount; cint64 mStatExtractedPossibleSubsumerOtherNodeCount; cint64 mStatSuccessorModelMergingTestCount; CPROCESSINGHASH< QPair,CSaturatedMergedTestItem >* mTestSaturatedMergedHash; CIndividualProcessNode* mLastMergingTestNode; // private methods private: CConceptDescriptor* getIndividualProcessNodeConceptWithSingleAncestorDependency(CIndividualProcessNode* indiNode, CIndividualAnalyseProcessItem* indiAnProcItem, CCalculationAlgorithmContext* calcAlgContext); bool hasDependencyToAncestor(CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); bool testSubsumerCandidatePossibleWithMergedSaturatedModel(CIndividualProcessNode* indiNode, CConcept* equivConcept, CCalculationAlgorithmContext* calcAlgContext); bool testSubsumerCandidatePossibleWithMergedSaturatedModel(CIndividualProcessNode* indiNode, CConcept* testConcept, bool negation, bool& mergeSatisfieableFlag, CCalculationAlgorithmContext* calcAlgContext); bool testConceptSetWithSaturatedModelMergable(CIndividualProcessNode* indiNode, CIndividualSaturationProcessNode* saturationIndiNode, bool& mergeClashedFlag, CCalculationAlgorithmContext* calcAlgContext); bool testRoleSuccessorsWithSaturatedModelMergable(CIndividualProcessNode* indiNode, CIndividualSaturationProcessNode* saturationIndiNode, CCalculationAlgorithmContext* calcAlgContext); bool testSaturatedExistentialsModelMergable(CIndividualProcessNode* indiNode, CIndividualSaturationProcessNode* saturationIndiNode, CCalculationAlgorithmContext* calcAlgContext); bool collectSuccessorMergingNodesAndConcepts(CIndividualProcessNode* indiNode, CIndividualSaturationProcessNode* saturationIndiNode, CReapplyRoleSuccessorHash* roleSuccHash, CRole* role, CPROCESSINGLIST& successorList, CPROCESSINGLIST& trivialSuccessorPropagatedConceptList, CPROCESSINGSET& backwardRoleSet, CCalculationAlgorithmContext* calcAlgContext); bool collectSuccessorMergingNodesAndConcepts(CIndividualSaturationProcessNode* excludeSaturationIndiNode, CRole* role, CPROCESSINGLIST& successorList, CPROCESSINGLIST& trivialSuccessorPropagatedConceptList, CPROCESSINGSET& backwardRoleSet, CPROCESSINGLIST& nextSuccessorList, CPROCESSINGLIST& nextTrivialSuccessorPropagatedConceptList, CPROCESSINGSET& nextBackwardRoleSet, CPROCESSINGHASH& successorInfluenceConceptsHash, CCalculationAlgorithmContext* calcAlgContext); bool collectEquivalenceConceptAlternatives(CIndividualProcessNode* indiNode, CConcept* testConcept, bool testConceptNegation, CPROCESSINGSET< QPair >& alternativesSet, CPROCESSINGHASH< QPair,CSaturatedMergedTestItem >* testSaturatedMergedHash, bool& oneMergeSatisfieableFlag, bool& allMergeUnsatisfieableFlag, CCalculationAlgorithmContext* calcAlgContext); bool testEquivalenceConceptAlternatives(CIndividualProcessNode* indiNode, CPROCESSINGSET< QPair >& alternativesSet, CPROCESSINGHASH< QPair,CSaturatedMergedTestItem >* testSaturatedMergedHash, bool& oneMergeSatisfieableFlag, bool& allMergeUnsatisfieableFlag, CCalculationAlgorithmContext* calcAlgContext); CIndividualSaturationProcessNode* getSaturatedIndividualNodeForConcept(CConcept* concept, bool conceptNegation, CCalculationAlgorithmContext* calcAlgContext); CIndividualSaturationProcessNode* getExistentialSaturatedIndividualNodeForConcept(CConcept* concept, CCalculationAlgorithmContext* calcAlgContext); bool testSaturatedSuccessorModelMergable(CIndividualSaturationProcessNode* existentialIndiNode, CPROCESSINGLIST& successorList, CPROCESSINGLIST* trivialSuccessorPropagatedConceptList, CPROCESSINGSET& backwardRoleSet, cint64 remainingMergingDepth, cint64& remainingMergingCount, CCalculationAlgorithmContext* calcAlgContext); bool testSingleSaturatedSuccessorModelMergable(CIndividualSaturationProcessNode* existentialIndiNode, CPROCESSINGLIST& successorList, CPROCESSINGLIST* trivialSuccessorPropagatedConceptList, CPROCESSINGSET& backwardRoleSet, cint64 remainingMergingDepth, cint64& remainingMergingCount, CCalculationAlgorithmContext* calcAlgContext); bool testMultipleSaturatedSuccessorModelMergable(CIndividualSaturationProcessNode* existentialIndiNode, CPROCESSINGLIST& successorList, CPROCESSINGLIST* trivialSuccessorPropagatedConceptList, CPROCESSINGSET& backwardRoleSet, cint64 remainingMergingDepth, cint64& remainingMergingCount, CCalculationAlgorithmContext* calcAlgContext); bool addAutomateTransactionConcepts(CConcept* concept, bool negation, CRole* role, CPROCESSINGLIST& successorList, CPROCESSINGLIST& trivialConceptTestingList, CCalculationAlgorithmContext* calcAlgContext); bool collectTrivialPropagationTestingConcepts(CConcept* concept, bool negation, CPROCESSINGLIST& trivialConceptTestingList, CCalculationAlgorithmContext* calcAlgContext); // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKCLASSIFICATIONMESSAGEANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationAlgorithmContext.h0000644000175000017500000002773512520551002031142 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONALGORITHMCONTEXT_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONALGORITHMCONTEXT_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" // Other includes #include "Scheduler/CTaskContext.h" #include "Scheduler/CTaskProcessorContext.h" #include "Reasoner/Kernel/Process/CProcessContext.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/CProcessingStatisticGathering.h" #include "Reasoner/Kernel/Strategy/CConceptProcessingPriorityStrategy.h" #include "Reasoner/Kernel/Strategy/CIndividualProcessingPriorityStrategy.h" #include "Reasoner/Kernel/Strategy/CTaskProcessingPriorityStrategy.h" #include "Reasoner/Kernel/Strategy/CUnsatisfiableCacheRetrievalStrategy.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Strategy; using namespace Task; namespace Algorithm { #ifdef KONCLUDE_FORCE_STATISTIC_DEACTIVATED #define STATINC(STATDESC,calcAlgContext) #define STATINCM(STATDESC,incCount,calcAlgContext) #else #define STATINC(STATDESC,calcAlgContext) STATDATAINC(STATDESC,calcAlgContext->getUsedProcessingStatisticsGathering()) #define STATINCM(STATDESC,incCount,calcAlgContext) STATDATAINCM(STATDESC,incCount,calcAlgContext->getUsedProcessingStatisticsGathering()) #endif /*! * * \class CCalculationAlgorithmContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationAlgorithmContext : public CContext { // public methods public: //! Constructor CCalculationAlgorithmContext(); //! Destructor virtual ~CCalculationAlgorithmContext(); virtual CProcessTagger* getProcessTagger() = 0; virtual CProcessContext* getProcessContext() = 0; virtual CMemoryAllocationManager* getProcessTaskMemoryAllocationManager() = 0; virtual CTaskHandleMemoryAllocationManager* getTemporaryMemoryAllocationManager() = 0; virtual CConceptProcessingPriorityStrategy* getConceptPriorityStrategy() = 0; virtual CIndividualProcessingPriorityStrategy* getIndividualPriorityStrategy() = 0; virtual CProcessingDataBox* getProcessingDataBox() = 0; virtual CSatisfiableCalculationTask* getSatisfiableCalculationTask() = 0; virtual CTaskProcessorContext* getTaskProcessorContext() = 0; virtual CTaskProcessingPriorityStrategy* getTaskPriorityStrategy() = 0; virtual CProcessingStatisticGathering* getProcessingStatisticsGathering() = 0; virtual CBranchTreeNode* getBranchTreeNode() = 0; virtual CBranchTreeNode* getNewBranchTreeNode() = 0; virtual CDependencyNode* getBaseDependencyNode() = 0; virtual CUnsatisfiableCacheHandler* getUnsatisfiableCacheHandler() = 0; virtual CIndividualNodeManager* getIndividualNodeManager() = 0; virtual CClashDescriptorFactory* getClashDescriptorFactory() = 0; virtual CUnsatisfiableCacheRetrievalStrategy* getUnsatisfiableCacheRetrievalStrategy() = 0; virtual CDependencyFactory* getDependencyFactory() = 0; virtual CSatisfiableExpanderCacheHandler* getSatisfiableExpanderCacheHandler() = 0; virtual CSaturationNodeExpansionCacheHandler* getSaturationNodeExpansionCacheHandler() = 0; inline CProcessTagger* getUsedProcessTagger(); inline CMemoryAllocationManager* getUsedProcessTaskMemoryAllocationManager(); inline CTaskHandleMemoryAllocationManager* getUsedTemporaryMemoryAllocationManager(); inline CProcessContext* getUsedProcessContext(); inline CConceptProcessingPriorityStrategy* getUsedConceptPriorityStrategy(); inline CIndividualProcessingPriorityStrategy* getUsedIndividualPriorityStrategy(); inline CProcessingDataBox* getUsedProcessingDataBox(); inline CSatisfiableCalculationTask* getUsedSatisfiableCalculationTask(); inline CTaskProcessorContext* getUsedTaskProcessorContext(); inline CTaskProcessingPriorityStrategy* getUsedTaskPriorityStrategy(); inline CProcessingStatisticGathering* getUsedProcessingStatisticsGathering(); inline CBranchTreeNode* getUsedBranchTreeNode(); inline CDependencyNode* getUsedBaseDependencyNode(); inline CUnsatisfiableCacheHandler* getUsedUnsatisfiableCacheHandler(); inline CIndividualNodeManager* getUsedIndividualNodeManager(); inline CClashDescriptorFactory* getUsedClashDescriptorFactory(); inline CUnsatisfiableCacheRetrievalStrategy* getUsedUnsatisfiableCacheRetrievalStrategy(); inline CDependencyFactory* getUsedDependencyFactory(); inline CSatisfiableExpanderCacheHandler* getUsedSatisfiableExpanderCacheHandler(); inline CSaturationNodeExpansionCacheHandler* getUsedSaturationNodeExpansionCacheHandler(); inline bool setMinModificationAncestorDepthCandidate(cint64 ancDepthCandidate); inline bool setMinModificationIndividualIDCandidate(cint64 indiIDCandidate); inline bool setMinModificationIndividualCandidate(CIndividualProcessNode* indiNode); bool isMinModificationUpdated(); CCalculationAlgorithmContext* setMinModificationAncestorDepth(cint64 ancDepth); cint64 getMinModificationAncestorDepth(); CCalculationAlgorithmContext* setMinModificationIndividualID(cint64 indiID); cint64 getMinModificationIndividualID(); CCalculationAlgorithmContext* setMinModificationIndividual(CIndividualProcessNode* indiNode); cint64 getMaxCompletionGraphCachedIndividualNodeID(); cint64 getCompletionGraphCachedLocalizationTag(); bool hasCompletionGraphCachedIndividualNodes(); CIndividualProcessNode* getCurrentIndividualNode(); CCalculationAlgorithmContext* setCurrentIndividualNode(CIndividualProcessNode* indiNode); // protected methods protected: // protected variables protected: CTaskHandleMemoryAllocationManager* mUsedTempMemMan; CMemoryAllocationManager* mUsedPrTaskMemMan; CProcessTagger* mUsedProcessTagger; CProcessContext* mUsedProcessContext; CConceptProcessingPriorityStrategy* mUsedConceptPriorityStrategy; CIndividualProcessingPriorityStrategy* mUsedIndividualPriorityStrategy; CProcessingDataBox* mUsedProcessingDataBox; CSatisfiableCalculationTask* mUsedSatCalcTask; CTaskProcessorContext* mUsedTaskProcessorContext; CTaskProcessingPriorityStrategy* mUsedTaskPriorityStrategy; CProcessingStatisticGathering* mUsedProcessStatGath; CBranchTreeNode* mUsedBranchTreeNode; CDependencyNode* mUsedBaseDepNode; cint64 mMinModificationAncestorDepth; cint64 mMinModificationIndividualID; bool mMinModificationUpdated; CUnsatisfiableCacheHandler* mUsedUnsatCacheHandler; CIndividualNodeManager* mUsedIndividualNodeManager; CClashDescriptorFactory* mUsedClashDescriptorFactory; CUnsatisfiableCacheRetrievalStrategy* mUsedUnsatCachRetStrategy; CDependencyFactory* mUsedDepFactory; CSatisfiableExpanderCacheHandler* mUsedSatExpCacheHandler; cint64 mMaxCompletionGraphCachedIndiNodeID; CIndividualProcessNode* mCurrentIndiNode; cint64 mCompletionGraphCachedLocalizationTag; CSaturationNodeExpansionCacheHandler* mUsedSatNodeExpCacheHandler; // private methods private: // private variables private: }; CProcessTagger* CCalculationAlgorithmContext::getUsedProcessTagger() { return mUsedProcessTagger; } CProcessContext* CCalculationAlgorithmContext::getUsedProcessContext() { return mUsedProcessContext; } CMemoryAllocationManager* CCalculationAlgorithmContext::getUsedProcessTaskMemoryAllocationManager() { return mUsedPrTaskMemMan; } CTaskHandleMemoryAllocationManager* CCalculationAlgorithmContext::getUsedTemporaryMemoryAllocationManager() { return mUsedTempMemMan; } CConceptProcessingPriorityStrategy* CCalculationAlgorithmContext::getUsedConceptPriorityStrategy() { return mUsedConceptPriorityStrategy; } CIndividualProcessingPriorityStrategy* CCalculationAlgorithmContext::getUsedIndividualPriorityStrategy() { return mUsedIndividualPriorityStrategy; } CProcessingDataBox* CCalculationAlgorithmContext::getUsedProcessingDataBox() { return mUsedProcessingDataBox; } CSatisfiableCalculationTask* CCalculationAlgorithmContext::getUsedSatisfiableCalculationTask() { return mUsedSatCalcTask; } CTaskProcessorContext* CCalculationAlgorithmContext::getUsedTaskProcessorContext() { return mUsedTaskProcessorContext; } CTaskProcessingPriorityStrategy* CCalculationAlgorithmContext::getUsedTaskPriorityStrategy() { return mUsedTaskPriorityStrategy; } CProcessingStatisticGathering* CCalculationAlgorithmContext::getUsedProcessingStatisticsGathering() { return mUsedProcessStatGath; } CBranchTreeNode* CCalculationAlgorithmContext::getUsedBranchTreeNode() { return mUsedBranchTreeNode; } CDependencyNode* CCalculationAlgorithmContext::getUsedBaseDependencyNode() { return mUsedBaseDepNode; } bool CCalculationAlgorithmContext::setMinModificationAncestorDepthCandidate(cint64 ancDepthCandidate) { bool updated = ancDepthCandidate < mMinModificationIndividualID; mMinModificationIndividualID = qMin(ancDepthCandidate,mMinModificationIndividualID); return updated; } bool CCalculationAlgorithmContext::setMinModificationIndividualIDCandidate(cint64 indiIDCandidate) { bool updated = indiIDCandidate < mMinModificationIndividualID; mMinModificationIndividualID = qMin(indiIDCandidate,mMinModificationIndividualID); return updated; } bool CCalculationAlgorithmContext::setMinModificationIndividualCandidate(CIndividualProcessNode* indiNode) { return setMinModificationIndividualIDCandidate(indiNode->getIndividualID()) || setMinModificationAncestorDepthCandidate(indiNode->getIndividualAncestorDepth()); } CUnsatisfiableCacheHandler* CCalculationAlgorithmContext::getUsedUnsatisfiableCacheHandler() { return mUsedUnsatCacheHandler; } CIndividualNodeManager* CCalculationAlgorithmContext::getUsedIndividualNodeManager() { return mUsedIndividualNodeManager; } CClashDescriptorFactory* CCalculationAlgorithmContext::getUsedClashDescriptorFactory() { return mUsedClashDescriptorFactory; } CUnsatisfiableCacheRetrievalStrategy* CCalculationAlgorithmContext::getUsedUnsatisfiableCacheRetrievalStrategy() { return mUsedUnsatCachRetStrategy; } CDependencyFactory* CCalculationAlgorithmContext::getUsedDependencyFactory() { return mUsedDepFactory; } CSatisfiableExpanderCacheHandler* CCalculationAlgorithmContext::getUsedSatisfiableExpanderCacheHandler() { return mUsedSatExpCacheHandler; } CSaturationNodeExpansionCacheHandler* CCalculationAlgorithmContext::getUsedSaturationNodeExpansionCacheHandler() { return mUsedSatNodeExpCacheHandler; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONALGORITHMCONTEXT_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeUnknownValueSpaceHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeUnknownValueSp0000644000175000017500000000765412520551012032356 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEUNKNOWNVALUESPACEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEUNKNOWNVALUESPACEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CCalculationClashProcessingException.h" #include "CDatatypeDependencyCollection.h" #include "CDependencyFactory.h" #include "CIndividualProcessNodeValueSpaceHandler.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CIndividualProcessNodeUnknownValueSpaceHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeUnknownValueSpaceHandler : public CIndividualProcessNodeValueSpaceHandler { // public methods public: //! Constructor CIndividualProcessNodeUnknownValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType); virtual bool addDataLiteral(CIndividualProcessNode* indiProcNode, CDataLiteral* dataLiteral, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); virtual bool addDataRestriction(CIndividualProcessNode* indiProcNode, CConcept* dataRestricionConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); virtual bool testValueSpaceClashed(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); virtual CConceptDescriptor* triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, cint64& remainingRequiredValuesCount, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext); virtual bool addValueSpaceDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext); virtual bool countPossibleValueSpaceValues(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceValuesCounter* valueCounter, CCalculationAlgorithmContext* calcAlgContext); virtual bool getNextPossibleDataValue(CIndividualProcessNode* indiProcNode, CDataLiteralValue*& nextValue, CDataLiteralValue* lastValue, CDatatypeValueTestingCollection* valueTestingCollection, CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: // protected variables protected: CDatatypeValueSpaceUnknownType* mUnknownValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEUNKNOWNVALUESPACEHANDLER_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeDateTimeValueSpaceHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeDateTimeValueS0000644000175000017500000000243012520551006032221 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeDateTimeValueSpaceHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualProcessNodeDateTimeValueSpaceHandler::CIndividualProcessNodeDateTimeValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType) : CIndividualProcessNodeCompareValueSpaceHandler(valueSpaceType) { } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CUnsatisfiableCacheHandler.h0000644000175000017500000000667112520551016030504 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CUNSATISFIABLECACHEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CUNSATISFIABLECACHEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CClashDescriptorFactory.h" #include "CTrackedClashedDescriptor.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" #include "Reasoner/Kernel/Process/CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData.h" #include "Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheReader.h" #include "Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheWriter.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Process; using namespace Cache; namespace Algorithm { /*! * * \class CUnsatisfiableCacheHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CUnsatisfiableCacheHandler { // public methods public: //! Constructor CUnsatisfiableCacheHandler(COccurrenceUnsatisfiableCacheReader* occurUnsatCacheReader, COccurrenceUnsatisfiableCacheWriter* occurUnsatCacheWriter); //! Destructor virtual ~CUnsatisfiableCacheHandler(); bool isIndividualNodeUnsatisfiableCached(CIndividualProcessNode* individualNode, CClashedDependencyDescriptor*& clashDescriptors, CCalculationAlgorithmContext* calcAlgContext); bool areClashedDescriptorsAlreadyCached(CTrackedClashedDescriptor* trackedClashedDes, CCalculationAlgorithmContext* calcAlgContext); bool writeUnsatisfiableClashedDescriptors(CTrackedClashedDescriptor* trackedClashedDes, CCalculationAlgorithmContext* calcAlgContext); bool writeUnsatisfiableClashedConcept(CConcept* concept, CCalculationAlgorithmContext* calcAlgContext); bool areClashedDescriptorsLastCached(CTrackedClashedDescriptor* trackedClashedDes, CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: // protected variables protected: COccurrenceUnsatisfiableCacheReader* mOccurUnsatCacheReader; COccurrenceUnsatisfiableCacheWriter* mOccurUnsatCacheWriter; bool mConfConceptDataUnsatisfiablePrecheck; QList mUnsatItemList; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CUNSATISFIABLECACHEHANDLER_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeFloatValueSpaceHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeFloatValueSpac0000644000175000017500000000241712520551010032256 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeFloatValueSpaceHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualProcessNodeFloatValueSpaceHandler::CIndividualProcessNodeFloatValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType) : CIndividualProcessNodeCompareValueSpaceHandler(valueSpaceType) { } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeValueSpaceHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeValueSpaceHand0000644000175000017500000001311112520551012032223 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEVALUESPACEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEVALUESPACEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CCalculationClashProcessingException.h" #include "CDatatypeDependencyCollection.h" #include "CDatatypeValueTestingCollection.h" #include "CDependencyFactory.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Reasoner/Kernel/Process/Dependency/CDATATYPETRIGGERDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CDATATYPECONNECTIONDependencyNode.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CIndividualProcessNodeValueSpaceHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeValueSpaceHandler { // public methods public: //! Constructor CIndividualProcessNodeValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType); virtual bool addDataLiteral(CIndividualProcessNode* indiProcNode, CDataLiteral* dataLiteral, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); virtual bool addDataRestriction(CIndividualProcessNode* indiProcNode, CConcept* dataRestricionConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); virtual bool closeValueSpace(CIndividualProcessNode* indiProcNode, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); virtual bool testValueSpaceClashed(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); virtual CConceptDescriptor* triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, cint64& remainingRequiredValuesCount, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext); virtual bool addValueSpaceDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext); virtual bool countPossibleValueSpaceValues(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceValuesCounter* valueCounter, CCalculationAlgorithmContext* calcAlgContext); virtual bool getNextPossibleDataValue(CIndividualProcessNode* indiProcNode, CDataLiteralValue*& nextValue, CDataLiteralValue* lastValue, CDatatypeValueTestingCollection* valueTestingCollection, CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: CClashedDependencyDescriptor* createClashedDependencyDescriptor(CClashedDependencyDescriptor* appendDepDesLinker, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext, cint64 testAlreadyContainedCount = 3); CClashedDependencyDescriptor* copyClashedDependencyDescriptors(CClashedDependencyDescriptor* appendDepDesLinker, CClashedDependencyDescriptor* copyDepDesLinker, CCalculationAlgorithmContext* calcAlgContext); CConceptDescriptor* addConceptLinker(CConceptDescriptor* appendConceptLinker, CConcept* concept, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CConceptDescriptor* addConceptLinker(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, CDatatypeValueSpaceConceptTriggerLinker* triggeringConceptLinker, CDependencyTrackPoint* depTrackPoint, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext); CConceptDescriptor* addConceptLinkerCollectionDependency(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, CDatatypeValueSpaceConceptTriggerLinker* triggeringConceptLinker, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext); bool hasConceptTriggered(CIndividualProcessNode* indiProcNode, CConcept* concept, CCalculationAlgorithmContext* calcAlgContext); // protected variables protected: CDatatypeValueSpaceType* mValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEVALUESPACEHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationAlgorithmContextBase.cpp0000644000175000017500000002220312520551002032251 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationAlgorithmContextBase.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CCalculationAlgorithmContextBase::CCalculationAlgorithmContextBase() { mTempMemMan = nullptr; mConceptPriorityStrategy = nullptr; mIndividualPriorityStrategy = nullptr; mProcessingDataBox = nullptr; mProcessContext = nullptr; mPrTaskMemMan = nullptr; mProcessTagger = nullptr; mSatCalcTask = nullptr; mTaskProcessorContext = nullptr; mTaskPriorityStrategy = nullptr; mProcStatGath = nullptr; mBranchTreeNode = nullptr; mBaseDepNode = nullptr; mUnsatCacheHandler = nullptr; mIndiNodeManager = nullptr; mClashDescriptorFactory = nullptr; mUnsatCachRetStrategy = nullptr; } CCalculationAlgorithmContextBase::~CCalculationAlgorithmContextBase() { } CCalculationAlgorithmContextBase* CCalculationAlgorithmContextBase::initCalculationAlgorithmContext(CTaskProcessorContext* taskHandleContext) { initCalculationAlgorithmContext(taskHandleContext,nullptr,nullptr,nullptr,nullptr,nullptr,nullptr,nullptr,nullptr,nullptr,nullptr); return this; } CCalculationAlgorithmContextBase* CCalculationAlgorithmContextBase::initCalculationAlgorithmContext(CTaskProcessorContext* taskProcessorContext, CConceptProcessingPriorityStrategy* conceptPriorityStrategy, CIndividualProcessingPriorityStrategy* individualPriorityStrategy, CTaskProcessingPriorityStrategy* taskPriorityStrategy, CUnsatisfiableCacheRetrievalStrategy* unsatCacheRetrievalStrategy, CIndividualNodeManager* indiNodeManager, CClashDescriptorFactory* clashDesFactory, CDependencyFactory* depFactory, CUnsatisfiableCacheHandler* unsatCacheHandler, CSatisfiableExpanderCacheHandler* satExpCacheHandler, CSaturationNodeExpansionCacheHandler* satNodeExpCacheHandler) { mTaskProcessorContext = taskProcessorContext; mUsedTaskProcessorContext = mTaskProcessorContext; mTempMemMan = mTaskProcessorContext->getTaskHandleMemoryAllocationManager(); mUsedTempMemMan = mTempMemMan; mIndividualPriorityStrategy = individualPriorityStrategy; mUsedIndividualPriorityStrategy = mIndividualPriorityStrategy; mConceptPriorityStrategy = conceptPriorityStrategy; mUsedConceptPriorityStrategy = mConceptPriorityStrategy; mTaskPriorityStrategy = taskPriorityStrategy; mUsedTaskPriorityStrategy = mTaskPriorityStrategy; mUnsatCachRetStrategy = unsatCacheRetrievalStrategy; mUsedUnsatCachRetStrategy = mUnsatCachRetStrategy; mUnsatCacheHandler = unsatCacheHandler; mUsedUnsatCacheHandler = mUnsatCacheHandler; mClashDescriptorFactory = clashDesFactory; mUsedClashDescriptorFactory = mClashDescriptorFactory; mIndiNodeManager = indiNodeManager; mUsedIndividualNodeManager = mIndiNodeManager; mDepFactory = depFactory; mUsedDepFactory = mDepFactory; mSatExpCacheHandler = satExpCacheHandler; mUsedSatExpCacheHandler = mSatExpCacheHandler; mSatNodeExpCacheHandler = satNodeExpCacheHandler; mUsedSatNodeExpCacheHandler = mSatNodeExpCacheHandler; return this; } CCalculationAlgorithmContextBase* CCalculationAlgorithmContextBase::initTaskProcessContext(CProcessContext* processContext, CSatisfiableCalculationTask* satCalcTask) { mProcessContext = processContext; mUsedProcessContext = mProcessContext; mSatCalcTask = satCalcTask; mUsedSatCalcTask = satCalcTask; mProcessingDataBox = mSatCalcTask->getProcessingDataBox(); mUsedProcessingDataBox = mProcessingDataBox; mPrTaskMemMan = mProcessContext->getUsedMemoryAllocationManager(); mUsedPrTaskMemMan = mPrTaskMemMan; mProcessTagger = mProcessContext->getUsedProcessTagger(); mUsedProcessTagger = mProcessTagger; mProcStatGath = mProcessContext->getUsedProcessingStatisticsGathering(); mUsedProcessStatGath = mProcStatGath; CBranchingTree* branchingTree = mProcessingDataBox->getBranchingTree(true); mBranchTreeNode = branchingTree->getBranchTreeNode(satCalcTask); mUsedBranchTreeNode = mBranchTreeNode; mBaseDepNode = branchingTree->getBaseDependencyNode(true); mUsedBaseDepNode = mBaseDepNode; mMaxCompletionGraphCachedIndiNodeID = -1; CConsistence* consistence = mProcessingDataBox->getOntology()->getConsistence(); if (consistence) { CConsistenceData* consData = consistence->getConsistenceModelData(); if (consData) { CConsistenceTaskData* consTaskData = dynamic_cast(consData); if (consTaskData) { CSatisfiableCalculationTask* detSatCalcTask = consTaskData->getDeterministicSatisfiableTask(); CSatisfiableCalculationTask* compGraphCachedCalcTask = consTaskData->getCompletionGraphCachedSatisfiableTask(); if (detSatCalcTask && compGraphCachedCalcTask) { mMaxCompletionGraphCachedIndiNodeID = detSatCalcTask->getProcessingDataBox()->getIndividualProcessNodeVector()->getItemCount()-1; mCompletionGraphCachedLocalizationTag = detSatCalcTask->getProcessingDataBox()->getProcessContext()->getProcessTagger()->getCurrentLocalizationTag(); } } } } return this; } CProcessTagger* CCalculationAlgorithmContextBase::getProcessTagger() { return mProcessTagger; } CProcessContext* CCalculationAlgorithmContextBase::getProcessContext() { return mProcessContext; } CMemoryAllocationManager* CCalculationAlgorithmContextBase::getProcessTaskMemoryAllocationManager() { return mPrTaskMemMan; } CMemoryAllocationManager* CCalculationAlgorithmContextBase::getMemoryAllocationManager() { return mPrTaskMemMan; } CTaskHandleMemoryAllocationManager* CCalculationAlgorithmContextBase::getTemporaryMemoryAllocationManager() { return mTempMemMan; } CConceptProcessingPriorityStrategy* CCalculationAlgorithmContextBase::getConceptPriorityStrategy() { return mConceptPriorityStrategy; } CIndividualProcessingPriorityStrategy* CCalculationAlgorithmContextBase::getIndividualPriorityStrategy() { return mIndividualPriorityStrategy; } CProcessingDataBox* CCalculationAlgorithmContextBase::getProcessingDataBox() { return mProcessingDataBox; } CSatisfiableCalculationTask* CCalculationAlgorithmContextBase::getSatisfiableCalculationTask() { return mSatCalcTask; } CTaskProcessorContext* CCalculationAlgorithmContextBase::getTaskProcessorContext() { return mTaskProcessorContext; } CTaskProcessingPriorityStrategy* CCalculationAlgorithmContextBase::getTaskPriorityStrategy() { return mTaskPriorityStrategy; } CProcessingStatisticGathering* CCalculationAlgorithmContextBase::getProcessingStatisticsGathering() { return mProcStatGath; } CBranchTreeNode* CCalculationAlgorithmContextBase::getBranchTreeNode() { return mBranchTreeNode; } CBranchTreeNode* CCalculationAlgorithmContextBase::getNewBranchTreeNode() { mBranchTreeNode = getUsedProcessingDataBox()->getBranchingTree(true)->getBranchTreeNode(mSatCalcTask,true); mUsedBranchTreeNode = mBranchTreeNode; return mBranchTreeNode; } CDependencyNode* CCalculationAlgorithmContextBase::getBaseDependencyNode() { return mBaseDepNode; } CUnsatisfiableCacheHandler* CCalculationAlgorithmContextBase::getUnsatisfiableCacheHandler() { return mUnsatCacheHandler; } CIndividualNodeManager* CCalculationAlgorithmContextBase::getIndividualNodeManager() { return mIndiNodeManager; } CClashDescriptorFactory* CCalculationAlgorithmContextBase::getClashDescriptorFactory() { return mClashDescriptorFactory; } CUnsatisfiableCacheRetrievalStrategy* CCalculationAlgorithmContextBase::getUnsatisfiableCacheRetrievalStrategy() { return mUnsatCachRetStrategy; } CDependencyFactory* CCalculationAlgorithmContextBase::getDependencyFactory() { return mDepFactory; } CSatisfiableExpanderCacheHandler* CCalculationAlgorithmContextBase::getSatisfiableExpanderCacheHandler() { return mSatExpCacheHandler; } CSaturationNodeExpansionCacheHandler* CCalculationAlgorithmContextBase::getSaturationNodeExpansionCacheHandler() { return mSatNodeExpCacheHandler; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationChooseTaskHandleAlgorithm.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationChooseTaskHandleAlgorith0000644000175000017500000000473312520551002032263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONCHOOSETASKHANDLEALGORITHM_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONCHOOSETASKHANDLEALGORITHM_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" // Other includes #include "Scheduler/CTask.h" #include "Scheduler/CTaskHandleAlgorithm.h" #include "Scheduler/CTaskProcessorContext.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Scheduler; namespace Kernel { using namespace Task; namespace Algorithm { /*! * * \class CCalculationChooseTaskHandleAlgorithm * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationChooseTaskHandleAlgorithm : public CTaskHandleAlgorithm { // public methods public: //! Constructor CCalculationChooseTaskHandleAlgorithm(CTaskHandleAlgorithm* tableauCompTaskHandleAlg = nullptr, CTaskHandleAlgorithm* tableauApproxSaturTaskHandleAlg = nullptr); virtual bool handleTask(CTaskProcessorContext *processorContext, CTask* task); // protected methods protected: // protected variables protected: CTaskHandleAlgorithm* mTableauCompTaskHandleAlg; CTaskHandleAlgorithm* mTableauApproxSaturTaskHandleAlg; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONCHOOSETASKHANDLEALGORITHM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CTrackedClashedDependencyLine.h0000644000175000017500000001161112520551014031125 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CTRACKEDCLASHEDDEPENDENCYLINE_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CTRACKEDCLASHEDDEPENDENCYLINE_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CTrackedClashedDescriptor.h" #include "CTrackedClashedDescriptorHasher.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { /*! * * \class CTrackedClashedDependencyLine * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTrackedClashedDependencyLine { // public methods public: //! Constructor CTrackedClashedDependencyLine(CPROCESSINGSET* clashedSet); CTrackedClashedDependencyLine* initTrackedClashedDependencyLine(bool exactIndiNodeTracking, cint64 individualNodeTrackLevel, cint64 branchingLevel); CTrackedClashedDependencyLine* sortInTrackedClashedDescriptors(CTrackedClashedDescriptor* clashedDes, bool forceInsertion = false); CTrackedClashedDependencyLine* moveToNextIndividualNodeLevel(cint64 newLevel); bool hasLevelTrackedClashedDescriptors(); CTrackedClashedDescriptor* takeNextLevelTrackedClashedDescriptor(); CTrackedClashedDescriptor* getLevelTrackedClashedDescriptors(); bool hasLevelTrackedBranchingClashedDescriptors(); CTrackedClashedDescriptor* takeNextLevelTrackedBranchingClashedDescriptor(); CTrackedClashedDescriptor* getLevelTrackedBranchingClashedDescriptors(); bool hasPerviousLevelTrackedClashedDescriptors(); CTrackedClashedDescriptor* takeNextPerviousLevelTrackedClashedDescriptor(); CTrackedClashedDescriptor* getPerviousLevelTrackedClashedDescriptors(); bool hasPerviousLevelTrackedNonDeterministicClashedDescriptors(); CTrackedClashedDescriptor* takeNextPerviousLevelTrackedNonDeterministicClashedDescriptor(); CTrackedClashedDescriptor* getPerviousLevelTrackedNonDeterministicClashedDescriptors(); bool hasPerviousLevelTrackedNonDeterministicBranchingClashedDescriptors(); CTrackedClashedDescriptor* takeNextPerviousLevelTrackedNonDeterministicBranchingClashedDescriptor(); CTrackedClashedDescriptor* getPerviousLevelTrackedNonDeterministicBranchingClashedDescriptors(); bool hasIndependentTrackedClashedDescriptors(); CTrackedClashedDescriptor* takeNextIndependentTrackedClashedDescriptor(); CTrackedClashedDescriptor* getIndependentTrackedClashedDescriptors(); CTrackedClashedDescriptor* takeNextTrackedClashedList(); bool hasMoreTrackedClashedList(); CTrackedClashedDescriptor* takeNextFreeTrackedClashedDescriptor(); CTrackedClashedDependencyLine* addFreeTrackedClashedDescriptor(CTrackedClashedDescriptor* clashDes); CPROCESSINGSET* getTrackedClashedDescriptorSet(); cint64 getBranchingLevel(); cint64 getIndividualNodeLevel(); bool hasOnlyIndependentTrackedClashedDescriptorsRemaining(); bool hasOnlyCurrentIndividualNodeLevelClashesDescriptors(); // protected methods protected: // protected variables protected: bool mExactIndividualTracking; cint64 mIndividualTrackLevel; cint64 mBranchingLevel; CTrackedClashedDescriptor* mIndependentTrackedClashes; CTrackedClashedDescriptor* mLevelTrackedClashes; CTrackedClashedDescriptor* mLevelTrackedBranchingClashes; CTrackedClashedDescriptor* mPrevLevelsTrackedClashes; CTrackedClashedDescriptor* mPrevLevelsTrackedNonDetClashes; CTrackedClashedDescriptor* mPrevLevelsTrackedNonDetBranchingClashes; CTrackedClashedDescriptor* mFreeTrackedClashedDescriptors; CPROCESSINGSET* mClashedSet; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CTRACKEDCLASHEDDEPENDENCYLINE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableExpanderCacheHandler.h0000644000175000017500000001431012520551012031611 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLEEXPANDERCACHEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLEEXPANDERCACHEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CClashDescriptorFactory.h" #include "CTrackedClashedDescriptor.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" #include "Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCacheStoringData.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheReader.h" #include "Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheWriter.h" #include "Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntry.h" #include "Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryWriteData.h" #include "Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryExpandWriteData.h" #include "Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; using namespace Cache; namespace Algorithm { /*! * * \class CSatisfiableExpanderCacheHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableExpanderCacheHandler { // public methods public: //! Constructor CSatisfiableExpanderCacheHandler(CSignatureSatisfiableExpanderCacheReader* satCacheReader, CSignatureSatisfiableExpanderCacheWriter* satCacheWriter); //! Destructor virtual ~CSatisfiableExpanderCacheHandler(); typedef QPair CDepthDependencyPair; bool isIndividualNodeExpandCached(CIndividualProcessNode* individualNode, bool* satisfiable, CSignatureSatisfiableExpanderCacheEntry** entry, CCalculationAlgorithmContext* calcAlgContext); bool compareIndividualNodeCompatibility(CIndividualProcessNode* individualNode, CSignatureSatisfiableExpanderCacheEntry* cachedEntry, CCalculationAlgorithmContext* calcAlgContext); bool cacheIndividualNodeExpansion(CIndividualProcessNode* individualNode, CCalculationAlgorithmContext* calcAlgContext); bool cacheIndividualNodeExpansion(CIndividualProcessNode* individualNode, CIndividualNodeSatisfiableExpandingCacheStoringData* satStorData, CConceptDescriptor* lastAddedConDes, CConceptDescriptor* lastCachedConceptDes, cint64 lastSignature, cint64 lastCachedSignature, CCalculationAlgorithmContext* calcAlgContext); bool hasDependencyToAncestor(CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint, bool* branchedFlag, CCalculationAlgorithmContext* calcAlgContext); bool simpleDependencyTracking(CIndividualProcessNode* individualNode, cint64 conTag, CDependencyTrackPoint* depTrackPoint, CCACHINGHASH* depHash, CPROCESSINGSET* notBranchConceptsSet, bool* branchedFlag, CCalculationAlgorithmContext* calcAlgContext); bool complexDependencyTracking(CIndividualProcessNode* individualNode, cint64 conTag, CPROCESSINGSET* depSet, CPROCESSINGLIST* depList, CCACHINGHASH* depHash, CPROCESSINGSET* notBranchConceptsSet, bool* branchedFlag, CCalculationAlgorithmContext* calcAlgContext); bool cacheIndividualNodeSatisfiable(CIndividualProcessNode* individualNode, CCalculationAlgorithmContext* calcAlgContext); bool isConceptRelevantForSatisfiableBranch(CIndividualProcessNode* individualNode, CConceptDescriptor* conDes, CCalculationAlgorithmContext* calcAlgContext); bool isAutomatConceptRelevantForSatisfiableBranch(CIndividualProcessNode* individualNode, CConcept* concept, bool conNegation, CCalculationAlgorithmContext* calcAlgContext); bool isCardinalityRestrictionCriticalForSatisfiable(CIndividualProcessNode* individualNode, CConceptDescriptor* conDes, CCalculationAlgorithmContext* calcAlgContext); bool hasInverseSubRole(CRole* role, CCalculationAlgorithmContext* calcAlgContext); bool hasInverseSuperRole(CRole* role, CCalculationAlgorithmContext* calcAlgContext); bool commitCacheMessages(CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: bool prepareCacheMessages(CCalculationAlgorithmContext* calcAlgContext); bool addCacheMessages(CSignatureSatisfiableExpanderCacheEntryWriteData* expandWriteData, CCalculationAlgorithmContext* calcAlgContext); // protected variables protected: CSignatureSatisfiableExpanderCacheReader* mSatCacheReader; CSignatureSatisfiableExpanderCacheWriter* mSatCacheWriter; CReapplyConceptLabelSet* mTestConSet; CSignatureSatisfiableExpanderCacheEntryWriteData* mWriteData; CTaskMemoryPoolAllocationManager* mMemAllocMan; CMemoryPoolContainer mMemPoolCon; CContextBase* mTmpContext; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLEEXPANDERCACHEHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CClashDescriptorFactory.cpp0000644000175000017500000000717012520551002030433 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClashDescriptorFactory.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CClashDescriptorFactory::CClashDescriptorFactory() { } CClashDescriptorFactory::~CClashDescriptorFactory() { } CClashedDependencyDescriptor* CClashDescriptorFactory::createClashedConceptDescriptor(CClashedDependencyDescriptor* prevClashes, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CClashedConceptDescriptor* clashDes = CObjectAllocator::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); clashDes->initClashedConceptDescriptor(conDes,prevDepTrackPoint,processIndi); if (prevClashes) { clashDes->append(prevClashes); } return clashDes; } CClashedDependencyDescriptor* CClashDescriptorFactory::createClashedIndividualLinkDescriptor(CClashedDependencyDescriptor* prevClashes, CIndividualLinkEdge* link, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CClashedIndividualLinkDescriptor* clashDes = CObjectAllocator::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); clashDes->initClashedLinkDescriptor(link,prevDepTrackPoint); if (prevClashes) { clashDes->append(prevClashes); } return clashDes; } CClashedDependencyDescriptor* CClashDescriptorFactory::createClashedIndividualDistinctDescriptor(CClashedDependencyDescriptor* prevClashes, CDistinctEdge* distinct, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CClashedIndividualDistinctDescriptor* clashDes = CObjectAllocator::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); clashDes->initClashedDistinctDescriptor(distinct,prevDepTrackPoint); if (prevClashes) { clashDes->append(prevClashes); } return clashDes; } CClashedDependencyDescriptor* CClashDescriptorFactory::createClashedNegationDisjointDescriptor(CClashedDependencyDescriptor* prevClashes, CNegationDisjointEdge* disjointNegLink, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CClashedNegationDisjointLinkDescriptor* clashDes = CObjectAllocator::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); clashDes->initClashedLinkDescriptor(disjointNegLink,prevDepTrackPoint); if (prevClashes) { clashDes->append(prevClashes); } return clashDes; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CComputedConsequencesCacheHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CComputedConsequencesCacheHandler.cp0000644000175000017500000001701412520551004032210 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CComputedConsequencesCacheHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CComputedConsequencesCacheHandler::CComputedConsequencesCacheHandler(CComputedConsequencesCacheReader* satCacheReader, CComputedConsequencesCacheWriter* satCacheWriter) { mSatCacheReader = satCacheReader; mSatCacheWriter = satCacheWriter; mTmpContext = nullptr; mMemAllocMan = nullptr; mWriteData = nullptr; } bool CComputedConsequencesCacheHandler::canCacheTypeConcept(CIndividual* individual, CConcept* concept, bool negation, CCalculationAlgorithmContext* calcAlgContext) { CConcreteOntology* ontology = calcAlgContext->getProcessingDataBox()->getOntology(); CConsistence* consistence = ontology->getConsistence(); CBOXHASH* eqConCandHash = ontology->getTBox()->getEquivalentConceptCandidateHash(false); if (consistence) { CConsistenceData* consData = consistence->getConsistenceModelData(); if (consData) { CConsistenceTaskData* consTaskData = dynamic_cast(consData); if (consTaskData) { CSatisfiableCalculationTask* detSatCalcTask = consTaskData->getDeterministicSatisfiableTask(); if (detSatCalcTask) { CIndividualProcessNodeVector* detSatProcNodeVec = detSatCalcTask->getProcessingDataBox()->getIndividualProcessNodeVector(); CIndividualProcessNode* detIndiNode = detSatProcNodeVec->getData(individual->getIndividualID()); while (detIndiNode->getIndividualID() != detIndiNode->getMergedIntoIndividualNodeID()) { detIndiNode = detSatProcNodeVec->getData(detIndiNode->getMergedIntoIndividualNodeID()); } CReapplyConceptLabelSet* detConSet = detIndiNode->getReapplyConceptLabelSet(false); if (detConSet && !detConSet->containsConcept(concept,negation)) { //if (concept->getTerminology() == ontology) { // return true; //} CSatisfiableCalculationTask* compGraphCachedCalcTask = consTaskData->getCompletionGraphCachedSatisfiableTask(); CIndividualProcessNodeVector* compGraphCachedProcNodeVec = compGraphCachedCalcTask->getProcessingDataBox()->getIndividualProcessNodeVector(); CIndividualProcessNode* compGraphCachedIndiNode = compGraphCachedProcNodeVec->getData(individual->getIndividualID()); while (compGraphCachedIndiNode->getIndividualID() != compGraphCachedIndiNode->getMergedIntoIndividualNodeID()) { compGraphCachedIndiNode = detSatProcNodeVec->getData(compGraphCachedIndiNode->getIndividualID()); } CReapplyConceptLabelSet* compGraphCachedConSet = compGraphCachedIndiNode->getReapplyConceptLabelSet(false); if (compGraphCachedConSet && compGraphCachedConSet->containsConcept(concept,negation)) { return true; } if (!negation && eqConCandHash) { CConcept* candidateConcept = eqConCandHash->value(concept); if (compGraphCachedConSet && compGraphCachedConSet->containsConcept(candidateConcept,false)) { return true; } } } } } } } return false; } bool CComputedConsequencesCacheHandler::tryCacheTypeConcept(CIndividual* individual, CConcept* concept, bool negation, CCalculationAlgorithmContext* calcAlgContext) { CComputedConsequencesTypesCacheEntry* typeCacheEntry = mSatCacheReader->getTypesCacheEntry(individual); if (!typeCacheEntry || !typeCacheEntry->hasConcept(concept,negation) && canCacheTypeConcept(individual,concept,negation,calcAlgContext)) { // try caching prepareCacheMessages(calcAlgContext); CTaskMemoryPoolAllocationManager* satCacheMemMan = mMemAllocMan; CContextBase* tmpContext = mTmpContext; CComputedConsequencesCacheWriteTypesData* unsatWriteData = CObjectAllocator< CComputedConsequencesCacheWriteTypesData >::allocateAndConstruct(satCacheMemMan); unsatWriteData->initTypesCacheWriteData(individual,concept,negation); addCacheMessages(unsatWriteData,calcAlgContext); return true; } return false; } CSortedNegLinker* CComputedConsequencesCacheHandler::getCachedTypesConceptLinker(CIndividual* individual, CCalculationAlgorithmContext* calcAlgContext) { CSortedNegLinker* typeConceptLinker = nullptr; CComputedConsequencesTypesCacheEntry* typeCacheEntry = mSatCacheReader->getTypesCacheEntry(individual); if (typeCacheEntry) { typeConceptLinker = typeCacheEntry->getConceptLinker(); } return typeConceptLinker; } bool CComputedConsequencesCacheHandler::prepareCacheMessages(CCalculationAlgorithmContext* calcAlgContext) { if (!mMemAllocMan) { CTaskMemoryPoolAllocationManager satCacheMemManCreaterMemMan(&mMemPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mMemAllocMan = CObjectAllocator::allocateAndConstruct(&satCacheMemManCreaterMemMan); mMemAllocMan->initTaskMemoryPoolAllocationManager(&mMemPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mTmpContext = CObjectParameterizingAllocator< CContextBase,CMemoryAllocationManager* >::allocateAndConstructAndParameterize(mMemAllocMan,mMemAllocMan); return true; } return false; } bool CComputedConsequencesCacheHandler::commitCacheMessages(CCalculationAlgorithmContext* calcAlgContext) { if (mWriteData) { CComputedConsequencesCacheWriteData* commitWriteData = nullptr; CComputedConsequencesCacheWriteData* writeDataIt = mWriteData; while (writeDataIt) { CComputedConsequencesCacheWriteData* tmpWriteData = writeDataIt; writeDataIt = (CComputedConsequencesCacheWriteData*)writeDataIt->getNext(); tmpWriteData->clearNext(); if (commitWriteData) { commitWriteData = (CComputedConsequencesCacheWriteData*)tmpWriteData->append(commitWriteData); } else { commitWriteData = tmpWriteData; } } mSatCacheWriter->writeCacheData(commitWriteData,mMemPoolCon.takeMemoryPools()); mWriteData = nullptr; mMemAllocMan = nullptr; mTmpContext = nullptr; return true; } return false; } bool CComputedConsequencesCacheHandler::addCacheMessages(CComputedConsequencesCacheWriteData* expandWriteData, CCalculationAlgorithmContext* calcAlgContext) { if (mWriteData) { mWriteData = (CComputedConsequencesCacheWriteData*)expandWriteData->append(mWriteData); } else { mWriteData = expandWriteData; } commitCacheMessages(calcAlgContext); return true; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CTrackedClashedDescriptor.h0000644000175000017500000000766012520551014030366 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CTRACKEDCLASHEDDESCRIPTOR_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CTRACKEDCLASHEDDESCRIPTOR_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" // Other includes #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" #include "Reasoner/Kernel/Process/CConceptDescriptor.h" #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CVariableBindingPath.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Process; namespace Algorithm { /*! * * \class CTrackedClashedDescriptor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTrackedClashedDescriptor : public CClashedDependencyDescriptor { // public methods public: //! Constructor CTrackedClashedDescriptor(); CTrackedClashedDescriptor* initTrackedClashedDescriptor(CIndividualProcessNode* indiNode, CConceptDescriptor* conDes, CVariableBindingPath* varBindPath, CDependencyTrackPoint* depTrackPoint); CTrackedClashedDescriptor* initTrackedClashedDescriptor(CTrackedClashedDescriptor* trackedClashDes); CTrackedClashedDescriptor* initTrackedClashedDescriptor(CTrackedClashedDescriptor* trackedClashDesForIndiNode, CConceptDescriptor* conDes, CVariableBindingPath* varBindPath, CDependencyTrackPoint* depTrackPoint); CTrackedClashedDescriptor* initTrackedClashedDescriptor(CTrackedClashedDescriptor* trackedClashDesForIndiNode, CConceptDescriptor* conDes, CDependencyTrackPoint* depTrackPoint); bool isAppropriatedIndividualNominal(); cint64 getAppropriatedIndividualID(); cint64 getAppropriatedIndividualLevel(); cint64 getBranchingLevelTag(); cint64 getProcessingTag(); bool isPointingToDeterministicDependencyNode(); bool isPointingToNonDeterministicDependencyNode(); bool isTrackingError(); bool isPointingToIndependentDependencyNode(); CConceptDescriptor* getConceptDescriptor(); bool candidateTracking(bool* trackingError, bool* nominalOccured, cint64* maxBranchLevel, cint64* minIndividualLevel); bool isProcessedAfter(cint64 processingTag); CTrackedClashedDescriptor* append(CTrackedClashedDescriptor* trackedClashedDescriptor); CTrackedClashedDescriptor* getNextDescriptor(); CVariableBindingPath* getVariableBindingPath(); // protected methods protected: // protected variables protected: cint64 mIndiNodeID; cint64 mIndiNodeLevel; cint64 mBranchingLevelTag; cint64 mProcessingTag; bool mDetermisticFlag; bool mNominalIndiFlag; bool mErrorFlag; bool mIndepenentFlag; CConceptDescriptor* mConceptDescriptor; CVariableBindingPath* mVarBindPath; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CTRACKEDCLASHEDDESCRIPTOR_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeValueSpaceHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeValueSpaceHand0000644000175000017500000002245112520756376032256 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeValueSpaceHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualProcessNodeValueSpaceHandler::CIndividualProcessNodeValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType) { mValueSpaceType = valueSpaceType; } bool CIndividualProcessNodeValueSpaceHandler::addDataLiteral(CIndividualProcessNode* indiProcNode, CDataLiteral* dataLiteral, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { bool potentiallyModified = false; return potentiallyModified; } bool CIndividualProcessNodeValueSpaceHandler::addDataRestriction(CIndividualProcessNode* indiProcNode, CConcept* dataRestricionConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { bool potentiallyModified = false; return potentiallyModified; } bool CIndividualProcessNodeValueSpaceHandler::closeValueSpace(CIndividualProcessNode* indiProcNode, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { bool valueSpaceClosed = false; CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeValueSpaceData* valueSpaceData = datatypesSpaceValue->getValueSpace(mValueSpaceType,false); if (!valueSpaceData || !valueSpaceData->isValueSpaceClashed()) { valueSpaceData = datatypesSpaceValue->getValueSpace(mValueSpaceType,true); valueSpaceData->getClashDependencyTrackPointCollection()->addDependency(depTrackPoint); valueSpaceData->setValueSpaceClashed(true); valueSpaceClosed = true; datatypesSpaceValue->setValueSapceModified(valueSpaceData); } return valueSpaceClosed; } bool CIndividualProcessNodeValueSpaceHandler::testValueSpaceClashed(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext) { CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CConcreteOntology* ontology = calcAlgContext->getUsedProcessingDataBox()->getOntology(); CDatatypeValueSpaceUnknownType* unknownValueSpaceType = ontology->getDataBoxes()->getDatatypeValueSpaceTypes()->getValueSpaceUnkownType(); CDatatypeUnknownValueSpaceData* unknownValueSpaceData = datatypesSpaceValue->getUnknownValueSpace(unknownValueSpaceType,false); if (unknownValueSpaceData) { if (unknownValueSpaceData->isValueSpaceClashed()) { return true; } } return false; } CClashedDependencyDescriptor* CIndividualProcessNodeValueSpaceHandler::createClashedDependencyDescriptor(CClashedDependencyDescriptor* appendDepDesLinker, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext, cint64 testAlreadyContainedCount) { if (depTrackPoint) { CClashedDependencyDescriptor* testDepDesLinker = appendDepDesLinker; for (cint64 i = testAlreadyContainedCount; i > 0 && testDepDesLinker; --i) { if (testDepDesLinker->getDependencyTrackPoint() == depTrackPoint) { return appendDepDesLinker; } testDepDesLinker = testDepDesLinker->getNext(); } CClashedDependencyDescriptor* clashDes = CObjectAllocator::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); clashDes->initClashedDependencyDescriptor(depTrackPoint); clashDes->append(appendDepDesLinker); return clashDes; } else { return appendDepDesLinker; } } CClashedDependencyDescriptor* CIndividualProcessNodeValueSpaceHandler::copyClashedDependencyDescriptors(CClashedDependencyDescriptor* appendDepDesLinker, CClashedDependencyDescriptor* copyDepDesLinker, CCalculationAlgorithmContext* calcAlgContext) { CClashedDependencyDescriptor* depDesLinker = appendDepDesLinker; for (CClashedDependencyDescriptor* copyDepDesLinkerIt = copyDepDesLinker; copyDepDesLinkerIt; copyDepDesLinkerIt = copyDepDesLinkerIt->getNext()) { depDesLinker = createClashedDependencyDescriptor(depDesLinker,copyDepDesLinkerIt->getDependencyTrackPoint(),calcAlgContext); } return depDesLinker; } CConceptDescriptor* CIndividualProcessNodeValueSpaceHandler::addConceptLinker(CConceptDescriptor* appendConceptLinker, CConcept* concept, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { if (concept) { CConceptDescriptor* newConceptLinker = CObjectAllocator< CConceptDescriptor >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); newConceptLinker->initConceptDescriptor(concept,false,depTrackPoint); newConceptLinker->append(appendConceptLinker); return newConceptLinker; } else { return appendConceptLinker; } } CConceptDescriptor* CIndividualProcessNodeValueSpaceHandler::addConceptLinker(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, CDatatypeValueSpaceConceptTriggerLinker* triggeringConceptLinker, CDependencyTrackPoint* depTrackPoint, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext) { CConceptDescriptor* conceptTriggerLinker = appendConceptLinker; for (CDatatypeValueSpaceConceptTriggerLinker* triggeringConceptLinkerIt = triggeringConceptLinker; triggeringConceptLinkerIt; triggeringConceptLinkerIt = triggeringConceptLinkerIt->getNext()) { CConcept* triggerConcept = triggeringConceptLinkerIt->getTriggerConcept(); if (!hasConceptTriggered(indiProcNode,triggerConcept,calcAlgContext)) { conceptTriggerLinker = addConceptLinker(conceptTriggerLinker,triggerConcept,depTrackPoint,calcAlgContext); } } return conceptTriggerLinker; } CConceptDescriptor* CIndividualProcessNodeValueSpaceHandler::addConceptLinkerCollectionDependency(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, CDatatypeValueSpaceConceptTriggerLinker* triggeringConceptLinker, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext) { CConceptDescriptor* conceptTriggerLinker = appendConceptLinker; for (CDatatypeValueSpaceConceptTriggerLinker* triggeringConceptLinkerIt = triggeringConceptLinker; triggeringConceptLinkerIt; triggeringConceptLinkerIt = triggeringConceptLinkerIt->getNext()) { CConcept* triggerConcept = triggeringConceptLinkerIt->getTriggerConcept(); if (!hasConceptTriggered(indiProcNode,triggerConcept,calcAlgContext)) { CDependencyTrackPoint* datatypeTriggerDepTrackPoint = nullptr; if (depCollection) { datatypeTriggerDepTrackPoint = depCollection->getDatatypeTriggerDependencyTrackPoint(); } conceptTriggerLinker = addConceptLinker(conceptTriggerLinker,triggerConcept,datatypeTriggerDepTrackPoint,calcAlgContext); } } return conceptTriggerLinker; } bool CIndividualProcessNodeValueSpaceHandler::hasConceptTriggered(CIndividualProcessNode* indiProcNode, CConcept* concept, CCalculationAlgorithmContext* calcAlgContext) { CReapplyConceptLabelSet* conSet = indiProcNode->getReapplyConceptLabelSet(false); if (conSet) { if (conSet->hasConcept(concept,false)) { return true; } } return false; } CConceptDescriptor* CIndividualProcessNodeValueSpaceHandler::triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, cint64& remainingRequiredValuesCount, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext) { return appendConceptLinker; } bool CIndividualProcessNodeValueSpaceHandler::addValueSpaceDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext) { return false; } bool CIndividualProcessNodeValueSpaceHandler::countPossibleValueSpaceValues(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceValuesCounter* valueCounter, CCalculationAlgorithmContext* calcAlgContext) { return false; } bool CIndividualProcessNodeValueSpaceHandler::getNextPossibleDataValue(CIndividualProcessNode* indiProcNode, CDataLiteralValue*& nextValue, CDataLiteralValue* lastValue, CDatatypeValueTestingCollection* valueTestingCollection, CCalculationAlgorithmContext* calcAlgContext) { return false; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationTableauCompletionTaskHandleAlgorithm.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationTableauCompletionTaskHan0000644000175000017500000033640312520756374032320 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONTABLEAUCOMPLETIONTASKHANDLEALGORITHM_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONTABLEAUCOMPLETIONTASKHANDLEALGORITHM_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContextBase.h" #include "CCalculationStopProcessingException.h" #include "CCalculationErrorProcessingException.h" #include "CCalculationClashProcessingException.h" #include "CSatisfiableTaskConsistencyPreyingAnalyser.h" #include "CSatisfiableTaskIncrementalConsistencyPreyingAnalyser.h" #include "CSatisfiableTaskClassificationMessageAnalyser.h" #include "CSatisfiableTaskMarkerIndividualPropagationAnalyser.h" #include "CTrackedClashedDependencyLine.h" #include "CTrackedClashedDescriptor.h" #include "CTrackedClashedDescriptorHasher.h" #include "CDependencyFactory.h" #include "CClashDescriptorFactory.h" #include "CIndividualNodeManager.h" #include "CUnsatisfiableCacheHandler.h" #include "CSatisfiableExpanderCacheHandler.h" #include "CReuseCompletionGraphCacheHandler.h" #include "CCompletionGraphCacheHandler.h" #include "CConceptNominalSchemaGroundingHandler.h" #include "CSaturationNodeExpansionCacheHandler.h" #include "CDatatypeIndividualProcessNodeHandler.h" #include "CComputedConsequencesCacheHandler.h" #include "CIndividualNodeBackendCacheHandler.h" #include "CIncrementalCompletionGraphCompatibleExpansionHandler.h" #include "CSatisfiableTaskPossibleAssertionCollectingAnalyser.h" // Other includes #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" #include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h" #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CConceptProcessDescriptor.h" #include "Reasoner/Kernel/Process/CConceptProcessingQueue.h" #include "Reasoner/Kernel/Process/CLinkProcessingRestrictionSpecification.h" #include "Reasoner/Kernel/Process/CBranchingORProcessingRestrictionSpecification.h" #include "Reasoner/Kernel/Process/CBranchingMergingProcessingRestrictionSpecification.h" #include "Reasoner/Kernel/Process/CTriggeredImplicationProcessingRestrictionSpecification.h" #include "Reasoner/Kernel/Process/CIndividualNodeBlockingTestData.h" #include "Reasoner/Kernel/Process/CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData.h" #include "Reasoner/Kernel/Process/CClashedConceptDescriptor.h" #include "Reasoner/Kernel/Process/CClashedIndividualLinkDescriptor.h" #include "Reasoner/Kernel/Process/CClashedIndividualDistinctDescriptor.h" #include "Reasoner/Kernel/Process/CClashedNegationDisjointLinkDescriptor.h" #include "Reasoner/Kernel/Process/CBlockingAlternativeData.h" #include "Reasoner/Kernel/Process/CBlockingAlternativeSignatureBlockingCandidateData.h" #include "Reasoner/Kernel/Process/Dependency/CANDDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CSOMEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CVALUEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CNEGVALUEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CALLDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CATLEASTDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CORDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CAUTOMATTRANSACTIONDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CAUTOMATCHOOSEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CSELFDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CDISTINCTDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CNOMINALDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CFUNCTIONALDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CATMOSTDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CMERGEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CQUALIFYDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CMERGEDCONCEPTDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CMERGEDLINKDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CIMPLICATIONDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CCONNECTIONDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CREUSEINDIVIDUALDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CREUSECONCEPTSDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CREUSECOMPLETIONGRAPHDependencyNode.h" #include "Reasoner/Kernel/Strategy/CConceptProcessingPriorityStrategy.h" #include "Reasoner/Kernel/Strategy/CIndividualProcessingPriorityStrategy.h" #include "Reasoner/Kernel/Strategy/CTaskProcessingPriorityStrategy.h" #include "Reasoner/Kernel/Strategy/CEqualDepthCacheOrientatedProcessingPriorityStrategy.h" #include "Reasoner/Kernel/Strategy/CConcreteConceptProcessingOperatorPriorityStrategy.h" #include "Reasoner/Kernel/Strategy/CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy.h" #include "Reasoner/Kernel/Strategy/CEqualDepthTaskProcessingPriorityStrategy.h" #include "Reasoner/Kernel/Strategy/CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Reasoner/Kernel/Cache/CExpanderBranchedLinker.h" #include "Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntry.h" #include "Scheduler/CTask.h" #include "Scheduler/CTaskHandleAlgorithm.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptTextFormater.h" #include "Utilities/Memory/CObjectMemoryPoolAllocator.h" #include "Utilities/Memory/CMemoryAllocationException.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Process::Dependency; using namespace Task; using namespace Strategy; using namespace Cache; namespace Algorithm { /*! * * \class CCalculationTableauCompletionTaskHandleAlgorithm * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationTableauCompletionTaskHandleAlgorithm : public CTaskHandleAlgorithm { // public methods public: //! Constructor CCalculationTableauCompletionTaskHandleAlgorithm(CUnsatisfiableCacheHandler* unsatCacheHandler, CSatisfiableExpanderCacheHandler* satExpCacheHandler, CReuseCompletionGraphCacheHandler* reuseCompGraphCacheHandler, CSaturationNodeExpansionCacheHandler* satNodeExpCacheHandler, CComputedConsequencesCacheHandler* compConsCacheHandler, CIndividualNodeBackendCacheHandler* backendCacheHandler); //! Destructor virtual ~CCalculationTableauCompletionTaskHandleAlgorithm(); virtual bool handleTask(CTaskProcessorContext *processorContext, CTask* task); void readCalculationConfig(CSatisfiableCalculationTask* satCalcTask); cint64 getAppliedANDRuleCount(); cint64 getAppliedORRuleCount(); cint64 getAppliedSOMERuleCount(); cint64 getAppliedATLEASTRuleCount(); cint64 getAppliedALLRuleCount(); cint64 getAppliedATMOSTRuleCount(); cint64 getAppliedTotalRuleCount(); // protected methods protected: typedef void (CCalculationTableauCompletionTaskHandleAlgorithm::*TableauRuleFunction) (CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); bool areAllDependentFactsUnchanged(CIndividualProcessNode* individualNode, CIndividualProcessNode* backtrackedIndividualNode, CDependencyTrackPoint* prevConDepTrackPoint, CIndividualProcessNodeVector* prevIndiNodeVec, cint64& remBacktrackCount, CCalculationAlgorithmContextBase* calcAlgContext); bool initializeIncrementalIndividualExpansion(CIndividualProcessNode* individualNode, CCalculationAlgorithmContextBase* calcAlgContext); CIndividual* getNextIncrementalExpansionIndividual(CIndividualProcessNode* individualNode, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* incrementalNodeExpansion(CIndividualProcessNode* expandNode, CCalculationAlgorithmContextBase* calcAlgContext); bool requiresIncrementalNodeExpansion(CIndividualProcessNode* individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool incrementalMergeWithPreviousNondeterministicCompletionGraph(CCalculationAlgorithmContextBase* calcAlgContext); bool incrementalMergeWithPreviousDeterministicCompletionGraph(CCalculationAlgorithmContextBase* calcAlgContext); void pruneIncrementalRemovedSuccessors(CIndividualProcessNode*& indi, CPROCESSINGSET* compatibleNominalNodeSet, CPROCESSINGSET* pruningNodeSet, CCalculationAlgorithmContextBase* calcAlgContext); bool identifyCompatibilityChangedNominalIndividualNodes(CPROCESSINGSET* nonCompatibleChangedNominalNodeSet, CPROCESSINGSET* compatibleNominalNodeSet, CPROCESSINGSET* redundantNodeSet, CPROCESSINGSET* newNodeSet, CCalculationAlgorithmContextBase* calcAlgContext); bool checkCompatibilityUpdateDirectlyChangedPropagation(CIndividualProcessNode* individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool propagateDirectlyChangedNeighbourNodeConnection(CIndividualProcessNode* individualNode, bool queueIncrementalExpansion, CCalculationAlgorithmContextBase* calcAlgContext); bool establishDirectlyChangedNeighbourConnection(CIndividualProcessNode* individualNode, CIndividualProcessNode* neighbourNodeCandidate, bool queueIncrementalExpansion, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* searchDirectlyChangedNeighbourNodeConnection(CIndividualProcessNode* individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool clearDirectlyChangedNeighbourConnection(CIndividualProcessNode* individualNode, bool queueCompatibilityChecks, CCalculationAlgorithmContextBase* calcAlgContext); bool clearPropagatedDirectlyChangedNeighbourConnection(CIndividualProcessNode* individualNode, bool queueCompatibilityChecks, CCalculationAlgorithmContextBase* calcAlgContext); bool linkCreationDirectlyChangedNeighbourConnectionUpdate(CIndividualProcessNode* sourceIndi, CIndividualProcessNode* destIndi, bool queueIncrementalExpansion, CCalculationAlgorithmContextBase* calcAlgContext); bool trackIndividualReferredDependence(cint64 indiID, CCalculationAlgorithmContextBase* calcAlgContext); bool trackIndividualExtendedDependence(cint64 indiID, CCalculationAlgorithmContextBase* calcAlgContext); bool trackIndividualDependence(cint64 indiID, bool indiReferred, bool indiExtended, CCalculationAlgorithmContextBase* calcAlgContext); bool installSaturationCachingReactivation(CIndividualProcessNode* indiProcNode, CSaturationNodeAssociatedDependentNominalSet* nominalSet, CCalculationAlgorithmContextBase* calcAlgContext); bool tryInstallSaturationCachingReactivation(CIndividualProcessNode* indiProcNode, CSuccessorConnectedNominalSet* nominalSet, CCalculationAlgorithmContextBase* calcAlgContext); bool reactivateIndividualNodesDueToNominalCachingLoss(CIndividualProcessNode* nominalProcNode, CCalculationAlgorithmContextBase* calcAlgContext); bool checkIndividualNodesReactivationDueToNominalCachingLoss(CIndividualProcessNode* nominalProcNode, CCalculationAlgorithmContextBase* calcAlgContext); bool addCachedComputedTypes(CIndividualProcessNode*& indiProcNode, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualNodeBackendCacheSynchronizationProcessingBlocked(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool detectIndividualNodeBackendCacheSynchronized(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* takeNextProcessIndividual(CCalculationAlgorithmContextBase* calcAlgContext); bool continueIndividualProcessing(CIndividualProcessNode*& indiProcNode, CCalculationAlgorithmContextBase* calcAlgContext); bool tableauRuleProcessing(CIndividualProcessNode*& indiProcNode,CConceptProcessDescriptor*& conProcDes, CCalculationAlgorithmContextBase* calcAlgContext); bool individualNodeInitializing(CIndividualProcessNode*& indiProcNode, CCalculationAlgorithmContextBase* calcAlgContext); void individualNodeConclusion(CIndividualProcessNode*& indiProcNode, CCalculationAlgorithmContextBase* calcAlgContext); void tableauRuleChoice(CIndividualProcessNode*& indiProcNode, CConceptProcessDescriptor*& conProcDes, CCalculationAlgorithmContextBase* calcAlgContext); bool initialNodeInitialize(CIndividualProcessNode*& indiProcNode, bool allowPreprocess, CCalculationAlgorithmContextBase* calcAlgContext); void eliminiateBlockedIndividuals(CIndividualProcessNode*& indiProcNode, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualNodeCompletionGraphCached(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool detectIndividualNodeCompletionGraphCached(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualNodeValidBlocker(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool rootUnsatisfiabilityWriteCaches(CSatisfiableCalculationTask* task, CCalculationAlgorithmContextBase* calcAlgContext); void clashedBacktracking(CClashedDependencyDescriptor* clashes, CCalculationAlgorithmContextBase* calcAlgContext); bool cancellationRootTask(CCalculationAlgorithmContextBase* calcAlgContext); bool cancellationTask(CSatisfiableCalculationTask* task, CCalculationAlgorithmContextBase* calcAlgContext); CTrackedClashedDescriptor* getFreeTrackedClashedDescriptor(CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext); bool backtrackFromTrackingLine(CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext); bool backtrackFromTrackingLineStep(CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext); bool backtrackNonDeterministicBranchingClashedDescriptorFromCurrentIndividualNodeLevel(CTrackedClashedDescriptor* trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext); bool backtrackNonDeterministicBranchingClashedDescriptorFromPreviousIndividualNodeLevel(CTrackedClashedDescriptor* trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext); bool backtrackNonDeterministicBranchingClashedDescriptor(CTrackedClashedDescriptor* trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext); CTrackedClashedDescriptor* getCollectedFilteredClashedDescriptorsFromBranch(CTrackedClashedDescriptor* nonDetClashedPointingDes, CNonDeterministicDependencyNode* nonDetBranchDepNode, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext, CMemoryAllocationManager* tmpMemMan = nullptr); bool backtrackDeterministicBranchingClashedDescriptorFromCurrentIndividualNodeLevel(CTrackedClashedDescriptor* trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext); bool backtrackDeterministicClashedDescriptorFromPreviousIndividualNodeLevels(CTrackedClashedDescriptor* trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext); CTrackedClashedDescriptor* getBacktrackedDeterministicClashedDescriptorsBeforeProcessingTag(CTrackedClashedDescriptor* trackedClashedDescriptors, cint64 processingTag, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext); CTrackedClashedDescriptor* getBacktrackedDeterministicClashedDescriptors(CTrackedClashedDescriptor* trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, cint64* minIndiLevel, CCalculationAlgorithmContextBase* calcAlgContext); CTrackedClashedDescriptor* tryGetInvalidSameIndividualNodeLevelBacktrackedDeterministicClashedDescriptors(CTrackedClashedDescriptor* trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, cint64* minIndiLevel, CCalculationAlgorithmContextBase* calcAlgContext); bool initializeTrackingLine(CTrackedClashedDependencyLine* trackingLine, CTrackedClashedDescriptor* trackingClashes, CCalculationAlgorithmContextBase* calcAlgContext); CTrackedClashedDescriptor* createTrackedClashesDescriptors(CClashedDependencyDescriptor* clashes, CCalculationAlgorithmContextBase* calcAlgContext, CMemoryAllocationManager* tmpMemMan = nullptr); CTrackedClashedDescriptor* createTrackedClashesDescriptor(CClashedDependencyDescriptor* clashDes, CCalculationAlgorithmContextBase* calcAlgContext, CMemoryAllocationManager* tmpMemMan = nullptr); CIndividualProcessNode* getCoresspondingIndividualNodeFromDependency(CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getCoresspondingIndividualNodeFromDependency(CDependencyNode* depNode, CCalculationAlgorithmContextBase* calcAlgContext); bool isGeneratingConceptSatisfiableCachedAbsorpable(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CCalculationAlgorithmContextBase* calcAlgContext); bool reapplySatisfiableCachedAbsorbedGeneratingConcepts(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool reapplySatisfiableCachedAbsorbedDisjunctionConcepts(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); void checkValueSpaceDistinctSatisfiability(CIndividualProcessNode* processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void triggerValueSpaceConcepts(CIndividualProcessNode* processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void tryCompletionGraphReuse(CIndividualProcessNode* processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void upgradeSignatureBlockingToIndividualReusing(CIndividualProcessNode* processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void establishIndividualReusing(CIndividualProcessNode* processIndi, CIndividualProcessNode* reuseIndi, CCalculationAlgorithmContextBase* calcAlgContext); void updateIndividualReusing(CIndividualProcessNode* processIndi, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* searchSignatureReusingIndividualNode(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool hasCompatibleConceptSetReuse(CIndividualProcessNode* indiNode, CReapplyConceptLabelSet* subConceptSet, CIndividualProcessNode* reuseNodeCand, CCalculationAlgorithmContextBase* calcAlgContext); bool addReusingBlockerFollowing(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool removeReusingBlockerFollowing(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); void propagateIndirectSuccessorReuseBlocked(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); void reactivateIndirectReuseSuccessors(CIndividualProcessNode*& indi, bool recursive, CCalculationAlgorithmContextBase* calcAlgContext); void removeIndividualReusing(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool anlyzeIndiviudalNodesConceptExpansion(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool isConceptFromDirectOrPredecessorOrNondeterminismusDependent(CIndividualProcessNode*& individualNode, CConceptDescriptor* conDes, CDependencyTrackPoint* depTrackPoint, bool* directDependentFlag, CCalculationAlgorithmContextBase* calcAlgContext); bool isConceptSignatureBlockingCritical(CIndividualProcessNode*& individualNode, CConceptDescriptor* conDes, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); bool getConceptDependenciesToSameIndividualNode(CIndividualProcessNode*& individualNode, CConceptDescriptor* conDes, CDependencyTrackPoint* depTrackPoint, CXLinker*& depLinker, CCalculationAlgorithmContextBase* calcAlgContext); bool hasCompatibleConceptSetSignature(CIndividualProcessNode*& blockingNode, CReapplyConceptLabelSet* conSet, CIndividualProcessNode* compatibleTestNode, CCalculationAlgorithmContextBase* calcAlgContext); bool detectIndividualNodeSignatureBlockingStatus(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool isSignatureBlockedProcessingBlocked(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool establishIndividualNodeSignatureBlocking(CIndividualProcessNode*& blockingIndividualNode, CIndividualProcessNode*& blockerIndividualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool refreshIndividualNodeSignatureBlocking(CIndividualProcessNode*& blockingIndividualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool updateSignatureBlockingConceptExpansion(CIndividualProcessNode*& blockingIndividualNode, CSignatureBlockingIndividualNodeConceptExpansionData* sigBlockingData, CIndividualProcessNode*& blockerIndividualNode, CIndividualNodeAnalizedConceptExpansionData* blockerAnalizedConExpData, CCalculationAlgorithmContextBase* calcAlgContext); bool removeSignatureBlockingBlockerFollowing(CIndividualProcessNode*& blockingIndividualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool addSignatureBlockingBlockerFollowing(CIndividualProcessNode*& blockingIndividualNode, CCalculationAlgorithmContextBase* calcAlgContext); void rebuildSignatureBlockingCandidateHash(CCalculationAlgorithmContextBase* calcAlgContext); void propagateIndirectSuccessorSignatureBlocked(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); void reactivateIndirectSignatureBlockedSuccessors(CIndividualProcessNode*& indi, bool recursive, CCalculationAlgorithmContextBase* calcAlgContext); bool updateBlockingReviewMarking(CIndividualProcessNode*& blockingIndividualNode, bool isBlocked, CCalculationAlgorithmContextBase* calcAlgContext); bool addSignatureIndividualNodeBlockerCandidate(CIndividualProcessNode*& indiNode, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* searchSignatureIndividualNodeBlocker(CIndividualProcessNode*& blockingNode, CCalculationAlgorithmContextBase* calcAlgContext); bool writeClashDescriptorsToCache(CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext); bool writeClashDescriptorsToCache(CTrackedClashedDescriptor*& trackedClashedDes, CTrackedClashedDescriptor* additionalTrackedClashedDes, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext); bool writeClashDescriptorsToCache(CTrackedClashedDescriptor*& trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext); bool writeUnsatisfiableClashedDescriptors(CTrackedClashedDescriptor* trackedClashedDes, CCalculationAlgorithmContextBase* calcAlgContext); CTrackedClashedDescriptor* getSortedClashedDescriptors(CTrackedClashedDescriptor* trackedClashedDes, CCalculationAlgorithmContextBase* calcAlgContext); bool isClashedDescriptorSortedBefore(CTrackedClashedDescriptor* trackedClashedDesBefore, CTrackedClashedDescriptor* trackedClashedDesAfter, CCalculationAlgorithmContextBase* calcAlgContext); bool addIndiNodeSignatureOfUnsatisfiableClashedDescriptors(CTrackedClashedDescriptor* trackedClashedDes, CCalculationAlgorithmContextBase* calcAlgContext); QString generateDebugTrackedClashedDescriptorSummaryString(CTrackedClashedDescriptor* trackedClashDescriptors, CCalculationAlgorithmContextBase* calcAlgContext); QString generateDebugTrackedClashedDescriptorString(CTrackedClashedDescriptor* trackedClashDescriptors, CCalculationAlgorithmContextBase* calcAlgContext); QString generateDebugTrackingLineString(CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext); QString writeDebugTrackingLineStringToFile(const QString& debugDataString, const QString& fileNameString, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext); QString generateDebugMergingQueueString(CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest, CCalculationAlgorithmContextBase* calcAlgContext); bool writeSatisfiableCachedIndividualNodesOfUnsatisfiableBranch(CCalculationAlgorithmContextBase* calcAlgContext); bool testAllSuccessorsProcessedAndWriteSatisfiableCache(CIndividualProcessNode* indiNode, CPROCESSINGSET* processedNodeSet, CSatisfiableExpanderCacheHandler* satExpHandler, CCalculationAlgorithmContextBase* calcAlgContext); bool cacheSatisfiableIndividualNodes(CCalculationAlgorithmContextBase* calcAlgContext); bool isSatisfiableCachedProcessingBlocked(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool isSatisfiableCachedCompatible(CIndividualProcessNode*& individualNode, CExpanderBranchedLinker* satBranchLinker, CIndividualProcessNode* ancestorIndiNode, CCalculationAlgorithmContextBase* calcAlgContext); bool isSatisfiableCachedAutomatConceptCompatible(CIndividualProcessNode*& individualNode, CConcept* concept, bool negated, CIndividualProcessNode* ancestorIndiNode, CCalculationAlgorithmContextBase* calcAlgContext); bool detectIndividualNodeSatisfiableExpandedCached(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); void expandCachedConcepts(CIndividualProcessNode*& individualNode, CSignatureSatisfiableExpanderCacheEntry* entry, CCalculationAlgorithmContextBase* calcAlgContext); void propagateIndirectSuccessorSatisfiableCached(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); void reactivateIndirectSatisfiableCachedSuccessors(CIndividualProcessNode*& indi, bool recursive, CCalculationAlgorithmContextBase* calcAlgContext); void addSatisfiableCachedAbsorbedDisjunctionConcept(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode*& processIndi, CProcessingRestrictionSpecification* procRest, CDependencyTrackPoint* dependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); void addSatisfiableCachedAbsorbedGeneratingConcept(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); bool isSaturationCachedProcessingBlocked(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); bool detectIndividualNodeSaturationCached(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext); void reactivateIndirectSaturationCachedSuccessors(CIndividualProcessNode*& indi, bool recursive, CCalculationAlgorithmContextBase* calcAlgContext); void markRelevanceForTrackedClashedDescriptors(CTrackedClashedDescriptor* descriptors, CCalculationAlgorithmContextBase* calcAlgContext); void markDependencyRelevance(CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); void addIndividualNodeForCacheUnsatisfiableRetrieval(CIndividualProcessNode*& indiNode, CCalculationAlgorithmContextBase* calcAlgContext); void testIndividualNodeUnsatisfiableCached(CIndividualProcessNode* individualNode, CCalculationAlgorithmContextBase* calcAlgContext); void commitCacheMessages(CCalculationAlgorithmContextBase* calcAlgContext); bool hasCommonVariableBindings(CIndividualProcessNode*& processIndi, CRepresentativeVariableBindingPathMap* leftRepVarBindMap, CRepresentativeVariableBindingPathMap* rightRepVarBindMap, CCalculationAlgorithmContextBase* calcAlgContext); bool areRepresentativesJoinable(CIndividualProcessNode*& processIndi, CRepresentativeVariableBindingPathSetData* leftRepData, CRepresentativeVariableBindingPathSetData* rightRepData, CSortedLinker* varLinker, CCalculationAlgorithmContextBase* calcAlgContext); void applyREPRESENTATIVEGROUNDINGRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyREPRESENTATIVEJOINRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyREPRESENTATIVEBINDVARIABLERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyREPRESENTATIVEIMPLICATIONRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void propagateRepresentativeToSuccessor(CIndividualProcessNode* processIndi, CIndividualProcessNode*& succIndi, CSortedNegLinker* conceptOpLinker, bool negate, CConceptDescriptor* conDes, CIndividualLinkEdge* restLink, CCalculationAlgorithmContextBase* calcAlgContext); void applyREPRESENTATIVEALLRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyREPRESENTATIVEANDRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); bool requiresRepresentativePropagation(CIndividualProcessNode*& processIndi, CRepresentativePropagationDescriptor* repPropDes, CRepresentativePropagationSet* testRepPropSet, CCalculationAlgorithmContextBase* calcAlgContext); void propagateRepresentative(CIndividualProcessNode*& processIndi, CRepresentativePropagationDescriptor* repPropDes, CRepresentativePropagationSet* repPropSet, CDependencyTrackPoint* nextDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); void updateRepresentativePropagationSet(CIndividualProcessNode*& processIndi, CRepresentativePropagationSet* repPropSet, CCalculationAlgorithmContextBase* calcAlgContext); void reapplyConceptUpdatedRepresentative(CIndividualProcessNode*& processIndi, CConceptDescriptor* bindingConDes, CDependencyTrackPoint* bindingDepTrackPoint, CReapplyConceptLabelSet* conSet, CCondensedReapplyQueue* reapplyQueue, CCalculationAlgorithmContextBase* calcAlgContext); void reapplyConceptUpdatedRepresentative(CIndividualProcessNode*& processIndi, CConceptDescriptor* bindingConDes, CDependencyTrackPoint* bindingDepTrackPoint, cint64 bindingCount, CReapplyConceptLabelSet* conSet, CCondensedReapplyQueue* reapplyQueue, CCalculationAlgorithmContextBase* calcAlgContext); CRepresentativeVariableBindingPathSetJoiningKeyMap* getRepresentativeJoiningKeyData(CRepresentativeVariableBindingPathSetData* repVarBindPathSetData, CConcept* joinConcept, CCalculationAlgorithmContextBase* calcAlgContext); void createCommonJoiningKeyMap(CRepresentativeJoiningCommonKeyMap* repJoinCommonKeyMap, CRepresentativeVariableBindingPathSetJoiningKeyMap* firstJoiningKeyMap, CRepresentativeVariableBindingPathSetData* firstRepData, CRepresentativeVariableBindingPathSetJoiningKeyMap* secJoiningKeyMap, CRepresentativeVariableBindingPathSetData* secRepData, bool firstLeft, CCalculationAlgorithmContextBase* calcAlgContext); void createCommonJoiningAll(CRepresentativeJoiningCommonKeyMap* repJoinCommonKeyMap, CRepresentativeJoiningAllDataExtension* joinAllExtData, CRepresentativeVariableBindingPathSetData* leftRepData, CRepresentativeVariableBindingPathSetData* rightRepData, CCalculationAlgorithmContextBase* calcAlgContext); void applyVARIABLEBINDINGANDRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyVARBINDPROPAGATEALLRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyVARBINDVARIABLERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyVARBINDPROPAGATEJOINRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); bool triggerVariableBindingPathJoining(CIndividualProcessNode* processIndi, CVariableBindingPathDescriptor* varBindPathDes, CVariableBindingDescriptor* varBindDes, bool leftTriggered, CVariableBindingTriggerHash* varBindTriggerHash, CCalculationAlgorithmContextBase* calcAlgContext); bool propagateVariableBindingsJoins(CIndividualProcessNode* processIndi, CConceptDescriptor* joiningConDes, CConcept* joinConcept, CVariableBindingPathDescriptor* varBindPathDes, bool leftTriggerPath, CVariableBindingPathJoiningHash* varBindPathJoinHash, CConceptVariableBindingPathSetHash* varBindingPathSetHash, CConceptDescriptor*& joinConDes, CVariableBindingPathSet*& varBindingPathSet, CCalculationAlgorithmContextBase* calcAlgContext); CVariableBindingDescriptor* createVariableBindingPathKey(CIndividualProcessNode* processIndi, CSortedLinker* varLinker, CVariableBindingDescriptor* varBindDes, CCalculationAlgorithmContextBase* calcAlgContext); CVariableBindingPath* getJoinedVariableBindingPath(CVariableBindingPath* leftVarBindPath, CVariableBindingPath* rightVarBindPath, CCalculationAlgorithmContextBase* calcAlgContext); void forceVariableBindingJoinCreated(CIndividualProcessNode* processIndi, CConceptDescriptor* joiningConDes, CConcept* joinConcept, CConceptDescriptor*& joinConDes, CDependencyTrackPoint* mergedDependencyTrackPoint, CVariableBindingPathSet*& varBindingPathSet, CConceptVariableBindingPathSetHash* varBindingPathSetHash, CCalculationAlgorithmContextBase* calcAlgContext); bool propagateInitialVariableBindings(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CVariableBindingPathSet* newVarBindingSet, CVariableBindingPathSet* prevVarBindingSet, CDependency* otherDependencies, CCalculationAlgorithmContextBase* calcAlgContext); bool propagateFreshVariableBindings(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CVariableBindingPathSet* newVarBindingSet, CVariableBindingPathSet* prevVarBindingSet, CDependency* otherDependencies, CCalculationAlgorithmContextBase* calcAlgContext); void propagateVariableBindingsToSuccessor(CIndividualProcessNode* processIndi, CIndividualProcessNode*& succIndi, CSortedNegLinker* conceptOpLinker, bool negate, CConceptDescriptor* conDes, CIndividualLinkEdge* restLink, CCalculationAlgorithmContextBase* calcAlgContext); bool propagateInitialVariableBindingsToSuccessor(CIndividualProcessNode*& processIndi, CIndividualProcessNode* succIndi, CConceptDescriptor* conDes, CVariableBindingPathSet* newVarBindingSet, CVariableBindingPathSet* prevVarBindingSet, CIndividualLinkEdge* restLink, CCalculationAlgorithmContextBase* calcAlgContext); bool propagateFreshVariableBindingsToSuccessor(CIndividualProcessNode*& processIndi, CIndividualProcessNode* succIndi, CConceptDescriptor* conDes, CVariableBindingPathSet* newVarBindingSet, CVariableBindingPathSet* prevVarBindingSet, CIndividualLinkEdge* restLink, CCalculationAlgorithmContextBase* calcAlgContext); void applyVARBINDPROPAGATEGROUNDINGRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyVARBINDPROPAGATEIMPLICATIONRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyBINDPROPAGATEGROUNDINGRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyBINDPROPAGATECYCLERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyBINDPROPAGATEALLRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyBINDPROPAGATEIMPLICATIONRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyBINDPROPAGATEANDRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyBINDPROPAGATEANDFLAGALLRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void propagatePropagationBindings(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, bool propagateAllFlag, CCalculationAlgorithmContextBase* calcAlgContext); void applyBINDVARIABLERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); bool propagateInitialPropagationBindings(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CPropagationBindingSet* newPropBindingSet, CPropagationBindingSet* prevPropBindingSet, CDependency* otherDependencies, CCalculationAlgorithmContextBase* calcAlgContext); bool propagateFreshPropagationBindings(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CPropagationBindingSet* newPropBindingSet, CPropagationBindingSet* prevPropBindingSet, CDependency* otherDependencies, CCalculationAlgorithmContextBase* calcAlgContext); void propagatePropagationBindingsToSuccessor(CIndividualProcessNode* processIndi, CIndividualProcessNode*& succIndi, CSortedNegLinker* conceptOpLinker, bool negate, CConceptDescriptor* conDes, CIndividualLinkEdge* restLink, CCalculationAlgorithmContextBase* calcAlgContext); bool propagateInitialPropagationBindingsToSuccessor(CIndividualProcessNode*& processIndi, CIndividualProcessNode* succIndi, CConceptDescriptor* conDes, CPropagationBindingSet* newPropBindingSet, CPropagationBindingSet* prevPropBindingSet, CIndividualLinkEdge* restLink, CCalculationAlgorithmContextBase* calcAlgContext); bool propagateFreshPropagationBindingsToSuccessor(CIndividualProcessNode*& processIndi, CIndividualProcessNode* succIndi, CConceptDescriptor* conDes, CPropagationBindingSet* newPropBindingSet, CPropagationBindingSet* prevPropBindingSet, CIndividualLinkEdge* restLink, CCalculationAlgorithmContextBase* calcAlgContext); void applyReapplyQueueConcepts(CIndividualProcessNode*& processIndi, CPropagationBindingReapplyConceptDescriptor* reapplyDesLinker, CCalculationAlgorithmContextBase* calcAlgContext); void addRoleAssertion(CIndividualProcessNode*& processIndi, CRoleAssertionLinker* roleAssertionLinker, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); void addReverseRoleAssertion(CIndividualProcessNode*& processIndi, CReverseRoleAssertionLinker* reverseRoleAssertionLinker, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); void applyAutomatChooseRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyBOTTOMRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyANDRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applySOMERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyALLRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyORRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applySELFRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyAutomatANDRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyAutomatTransactions(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, CConcept* concept, bool negated, CCalculationAlgorithmContextBase* calcAlgContext); void applyFUNCTIONALRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyATMOSTRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyATLEASTRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyNOMINALRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyVALUERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyIMPLICATIONRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyDATALITERALRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyDATARESTRICTIONRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyDATATYPERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyNegAutomatChooseRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyNegANDRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyNegSOMERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyNegALLRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyNegORRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyNegATMOSTRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); void applyNegATLEASTRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); bool hasIdenticalConceptOperands(CSortedNegLinker* opConLinker1, CSortedNegLinker* opConLinker2); CREPRESENTATIVEGROUNDINGDependencyNode* createREPRESENTATIVEGROUNDINGDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CVariableBindingPath* selectVarBindPath, CCalculationAlgorithmContextBase* calcAlgContext); CREPRESENTATIVEJOINDependencyNode* createREPRESENTATIVEJOINDependency(CDependencyTrackPoint*& joinContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* otherDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CREPRESENTATIVEBINDVARIABLEDependencyNode* createREPRESENTATIVEBINDVARIABLEDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CREPRESENTATIVEIMPLICATIONDependencyNode* createREPRESENTATIVEIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext); CREPRESENTATIVEALLDependencyNode* createREPRESENTATIVEALLDependency(CDependencyTrackPoint*& allContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CREPRESENTATIVEANDDependencyNode* createREPRESENTATIVEANDDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CRESOLVEREPRESENTATIVEDependencyNode* createRESOLVEREPRESENTATIVEDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CRepresentativeVariableBindingPathMap* resolveVarBindPathMap, CRepresentativePropagationMap* resolveRepPropMap, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* additionalDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CVARBINDPROPAGATEJOINDependencyNode* createVARBINDPROPAGATEJOINDependency(CDependencyTrackPoint*& continueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* otherDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CVARBINDPROPAGATEALLDependencyNode* createVARBINDPROPAGATEALLDependency(CDependencyTrackPoint*& allContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CVARBINDPROPAGATEANDDependencyNode* createVARBINDPROPAGATEANDDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CPROPAGATEVARIABLEBINDINGDependencyNode* createPROPAGATEVARIABLEBINDINGDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext); CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode* createPROPAGATEVARIABLEBINDINGSSUCCESSORDependency(CDependencyTrackPoint*& allContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CVARBINDVARIABLEDependencyNode* createVARBINDVARIABLEDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CVARBINDPROPAGATEGROUNDINGDependencyNode* createVARBINDPROPAGATEGROUNDINGDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext); CPROPAGATEVARIABLECONNECTIONDependencyNode* createPROPAGATEVARIABLECONNECTIONDependency(CIndividualProcessNode* processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CVARBINDPROPAGATEIMPLICATIONDependencyNode* createVARBINDPROPAGATEIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext); CBINDPROPAGATEGROUNDINGDependencyNode* createBINDPROPAGATEGROUNDINGDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext); CPROPAGATECONNECTIONAWAYDependencyNode* createPROPAGATECONNECTIONAWAYDependency(CIndividualProcessNode* processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CPROPAGATECONNECTIONDependencyNode* createPROPAGATECONNECTIONDependency(CIndividualProcessNode* processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CBINDPROPAGATECYCLEDependencyNode* createBINDPROPAGATECYCLEDependency(CDependencyTrackPoint*& continueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* triggDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CBINDPROPAGATEALLDependencyNode* createBINDPROPAGATEALLDependency(CDependencyTrackPoint*& allContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CPROPAGATEBINDINGSSUCCESSORDependencyNode* createPROPAGATEBINDINGSSUCCESSORDependency(CDependencyTrackPoint*& allContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CBINDPROPAGATEIMPLICATIONDependencyNode* createBINDPROPAGATEIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext); CBINDPROPAGATEANDDependencyNode* createBINDPROPAGATEANDDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CPROPAGATEBINDINGDependencyNode* createPROPAGATEBINDINGDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext); CBINDVARIABLEDependencyNode* createBINDVARIABLEDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CANDDependencyNode* createANDDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CSOMEDependencyNode* createSOMEDependency(CDependencyTrackPoint*& someContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CSELFDependencyNode* createSELFDependency(CDependencyTrackPoint*& selfContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CVALUEDependencyNode* createVALUEDependency(CDependencyTrackPoint*& valueContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CROLEASSERTIONDependencyNode* createROLEASSERTIONDependency(CDependencyTrackPoint*& roleAssContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CALLDependencyNode* createALLDependency(CDependencyTrackPoint*& allContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CATLEASTDependencyNode* createATLEASTDependency(CDependencyTrackPoint*& atleastContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CAUTOMATTRANSACTIONDependencyNode* createAUTOMATTRANSACTIONDependency(CDependencyTrackPoint*& allContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CAUTOMATCHOOSEDependencyNode* createAUTOMATCHOOSEDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CDISTINCTDependencyNode* createDISTINCTDependency(CDependencyTrackPoint*& distinctContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CNEGVALUEDependencyNode* createNEGVALUEDependency(CDependencyTrackPoint*& negValueContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CNOMINALDependencyNode* createNOMINALDependency(CDependencyTrackPoint*& nominalContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CFUNCTIONALDependencyNode* createFUNCTIONALDependency(CDependencyTrackPoint*& functionalContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* prevLink1DependencyTrackPoint, CDependencyTrackPoint* prevLink2DependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CORDependencyNode* createORDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CATMOSTDependencyNode* createATMOSTDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CMERGEDependencyNode* createMERGEDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CREUSEINDIVIDUALDependencyNode* createREUSEINDIVIDUALDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CREUSECOMPLETIONGRAPHDependencyNode* createREUSECOMPLETIONGRAPHDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CREUSECONCEPTSDependencyNode* createREUSECONCEPTSDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CQUALIFYDependencyNode* createQUALIFYDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CMERGEDCONCEPTDependencyNode* createMERGEDCONCEPTDependency(CDependencyTrackPoint*& mergedConceptContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* mergePrevDepTrackPoint, CDependencyTrackPoint* conceptPrevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CMERGEDLINKDependencyNode* createMERGEDLINKDependency(CDependencyTrackPoint*& mergedLinkContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* mergePrevDepTrackPoint, CDependencyTrackPoint* linkPrevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CMERGEDIndividualDependencyNode* createMERGEDINDIVIDUALDependency(CDependencyTrackPoint*& mergedIndividualContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* mergePrevDepTrackPoint, CDependencyTrackPoint* individualPrevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CIMPLICATIONDependencyNode* createIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext); CEXPANDEDDependencyNode* createEXPANDEDDependency(CDependencyTrackPoint*& expContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext); CCONNECTIONDependencyNode* createCONNECTIONDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CNonDeterministicDependencyTrackPoint* createNonDeterministicDependencyTrackPointBranch(CNonDeterministicDependencyNode* dependencyNode, bool singleBranch, CCalculationAlgorithmContextBase* calcAlgContext); bool isConceptAdditionAtomaric(CConcept* addingConcept, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); CClashedDependencyDescriptor* createIndividualMergeCausingDescriptors(CClashedDependencyDescriptor* prevClashes, CIndividualProcessNode*& processIndi, CIndividualLinkEdge* link, CSortedNegLinker* conceptAddLinker, CCalculationAlgorithmContextBase* calcAlgContext); CClashedDependencyDescriptor* createClashedIndividualNodeDescriptor(CClashedDependencyDescriptor* prevClashes, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); CClashedDependencyDescriptor* createClashedConceptDescriptor(CClashedDependencyDescriptor* prevClashes, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CClashedDependencyDescriptor* createClashedIndividualLinkDescriptor(CClashedDependencyDescriptor* prevClashes, CIndividualLinkEdge* link, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CClashedDependencyDescriptor* createClashedIndividualDistinctDescriptor(CClashedDependencyDescriptor* prevClashes, CDistinctEdge* distinct, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CClashedDependencyDescriptor* createClashedNegationDisjointDescriptor(CClashedDependencyDescriptor* prevClashes, CNegationDisjointEdge* disjointNegLink, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); bool isNominalIndividualNodeAvailable(cint64 indiID, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getCorrectedNominalIndividualNode(cint64 indiID, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getCorrectedMergedIntoIndividualNode(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getForcedInitializedNominalIndividualNode(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext); void initializeMergingIndividualNodes(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, CRoleSuccessorLinkIterator* roleSuccIt, CIndividualLinkEdge* usingLastLink, CSortedNegLinker* conceptOpLinkerIt, CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest, CCalculationAlgorithmContextBase* calcAlgContext); bool qualifyMergingIndividualNodes(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest, CCalculationAlgorithmContextBase* calcAlgContext); bool mergeMergingIndividualNodes(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, cint64 linkCount, cint64 cardinality, CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest, CCalculationAlgorithmContextBase* calcAlgContext); bool mergeMergingIndividualNodesPairwise(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, cint64 linkCount, cint64 cardinality, CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest, CCalculationAlgorithmContextBase* calcAlgContext); CSatisfiableCalculationTask* createMergeBranchingTask(CIndividualProcessNode*& processIndiNode, CConceptProcessDescriptor*& conProDes, CIndividualProcessNode*& distinctIndiNode, CIndividualProcessNode*& mergingIndiNode, CNonDeterministicDependencyNode* mergeDependencyNode, CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest, CCalculationAlgorithmContextBase* calcAlgContext); CSatisfiableCalculationTask* createDistinctBranchingTask(CIndividualProcessNode*& processIndiNode, CConceptProcessDescriptor*& conProDes, CIndividualProcessNode*& distinctIndiNode, bool createAsNominal, CNonDeterministicDependencyNode* mergeDependencyNode, CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest, CCalculationAlgorithmContextBase* calcAlgContext); bool hasSaturatedClashedFlagForConcept(CConcept* concept, bool negation, CCalculationAlgorithmContextBase* calcAlgContext); bool initializeORProcessing(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CBranchingORProcessingRestrictionSpecification** plannedBranchingProcessRestriction, CCalculationAlgorithmContextBase* calcAlgContext); bool planORProcessing(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CBranchingORProcessingRestrictionSpecification** plannedBranchingProcessRestriction, CCalculationAlgorithmContextBase* calcAlgContext); void executeORBranching(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CBranchingORProcessingRestrictionSpecification* plannedBranchingProcessRestriction, CCalculationAlgorithmContextBase* calcAlgContext); CSatisfiableCalculationTask* createDependendBranchingTaskList(cint64 newTaskCount, CCalculationAlgorithmContextBase* calcAlgContext); void prepareBranchedTaskProcessing(CIndividualProcessNode*& individual, CSatisfiableCalculationTask* newTask, CCalculationAlgorithmContextBase* calcAlgContext); CConceptRoleBranchingTrigger* searchNextConceptRoleBranchTrigger(CIndividualProcessNode*& processIndi, CConceptRoleBranchingTrigger* triggers, CCalculationAlgorithmContextBase* calcAlgContext); void installConceptRoleBranchTrigger(CIndividualProcessNode*& processIndi, CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CProcessingRestrictionSpecification* procRest, CConceptRoleBranchingTrigger* trigger, CCalculationAlgorithmContextBase* calcAlgContext); CConceptDescriptor* addConceptToIndividualReturnConceptDescriptor(CConcept* addingConcept, bool negate, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, bool allowPreprocessing, bool allowInitalization, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptToIndividualSkipANDProcessing(CConcept* addingConcept, bool negate, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, bool allowPreprocessing, bool allowInitalization, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptToIndividual(CConcept* addingConcept, bool negate, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, bool allowPreprocessing, bool allowInitalization, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptsToIndividual(CSortedNegLinker* conceptAddLinker, bool negate, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, bool allowPreprocessing, bool allowInitalization, cint64* conceptCount, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptsToIndividual(CXNegLinker* conceptAddLinker, bool negate, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, bool allowPreprocessing, bool allowInitalization, cint64* conceptCount, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptsToIndividual(CConceptAssertionLinker* conceptAddLinker, bool negate, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, bool allowPreprocessing, bool allowInitalization, cint64* conceptCount, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptsToIndividual(CXSortedNegLinker* conceptAddLinker, bool negate, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, bool allowPreprocessing, bool allowInitalization, cint64* conceptCount, CCalculationAlgorithmContextBase* calcAlgContext); bool insertConceptsToIndividualConceptSet(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* dependencyTrackPoint, CIndividualProcessNode*& processIndi, CReapplyConceptLabelSet* conLabelSet, CCondensedReapplyQueueIterator* reapplyIt, bool allowInitalization, CCalculationAlgorithmContextBase* calcAlgContext); bool addBlockingCoreConcept(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode*& processIndi, CReapplyConceptLabelSet* conLabelSet, CCalculationAlgorithmContextBase* calcAlgContext); bool isConceptUnsatisfiabilitySaturated(CConcept* concept, bool negation, CCalculationAlgorithmContextBase* calcAlgContext); bool needsProcessingForConcept(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void insertConceptProcessDescriptorToProcessingQueue(CConceptProcessDescriptor* conProDes, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void insertConceptProcessDescriptorToProcessingQueue(CConceptProcessDescriptor* conProDes, CConceptProcessingQueue*& conceptProcessingQueue, cint64 bindingCount, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptPreprocessedToProcessingQueue(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, cint64 bindingCount, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptToProcessingQueue(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, bool reapplied, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptPreprocessedToProcessingQueue(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, bool allowPreprocessing, CCalculationAlgorithmContextBase* calcAlgContext, TableauRuleFunction skipFunction = nullptr); void addConceptToProcessingQueue(CConceptProcessDescriptor* reinsertConProDes, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void addCopiedConceptToProcessingQueue(CConceptProcessDescriptor* copyConProDes, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptRestrictedToProcessingQueue(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, bool reapplied, CProcessingRestrictionSpecification* procRestriction, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptRestrictedToProcessingQueue(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, bool reapplied, CProcessingRestrictionSpecification* procRestriction, double priorityOffset, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptRestrictedFixedPriorityToProcessingQueue(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, bool reapplied, CProcessingRestrictionSpecification* procRestriction, double priority, CCalculationAlgorithmContextBase* calcAlgContext); bool addIndividualToProcessingQueue(CIndividualProcessNode* individual, CCalculationAlgorithmContextBase* calcAlgContext); bool addIndividualToProcessingQueueBasedOnProcessingConcepts(CIndividualProcessNode* individual, CCalculationAlgorithmContextBase* calcAlgContext); bool addIndividualToBlockingUpdateReviewProcessingQueue(CIndividualProcessNode* individual, CCalculationAlgorithmContextBase* calcAlgContext); bool addIndividualToBackendSynchronisationRetestQueue(CIndividualProcessNode* individual, CCalculationAlgorithmContextBase* calcAlgContext); bool addIndividualToIncrementalCompatibilityCheckingQueue(CIndividualProcessNode* individual, CCalculationAlgorithmContextBase* calcAlgContext); bool addIndividualToIncrementalExpansionQueue(CIndividualProcessNode* individual, CCalculationAlgorithmContextBase* calcAlgContext); bool isConceptInReapplyQueue(CConceptDescriptor* conceptDescriptor, CConcept* concept, bool negation, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); bool isConceptInReapplyQueue(CConceptDescriptor* conceptDescriptor, CRole* role, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptToReapplyQueue(CConceptDescriptor *conceptDescriptor, CRole* role, CIndividualProcessNode*& processIndi, CProcessingRestrictionSpecification* procRest, CDependencyTrackPoint* dependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptToReapplyQueue(CConceptDescriptor *conceptDescriptor, CConcept* concept, bool negation, CIndividualProcessNode*& processIndi, CProcessingRestrictionSpecification* procRest, CDependencyTrackPoint* dependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptToReapplyQueue(CConceptDescriptor *conceptDescriptor, CRole* role, CIndividualProcessNode*& processIndi, bool isStaticDes, CDependencyTrackPoint* dependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptToReapplyQueue(CConceptDescriptor *conceptDescriptor, CConcept* concept, bool negation, CIndividualProcessNode*& processIndi, bool isStaticDes, CDependencyTrackPoint* dependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptToReapplyQueue(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); void applyReapplyQueueConcepts(CIndividualProcessNode*& processIndi, CConcept* concept, bool negation, CCalculationAlgorithmContextBase* calcAlgContext); void applyReapplyQueueConcepts(CIndividualProcessNode*& processIndi, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); void applyReapplyQueueConceptsRestricted(CIndividualProcessNode*& processIndi, CReapplyQueueIterator* reapplyQueueIt, CIndividualLinkEdge* restrictedLink, CCalculationAlgorithmContextBase* calcAlgContext); void applyReapplyQueueConcepts(CIndividualProcessNode*& processIndi, CCondensedReapplyQueueIterator* reapplyQueueIt, CCalculationAlgorithmContextBase* calcAlgContext); bool hasRoleSuccessorConcept(CIndividualProcessNode*& processIndi, CRole* role, CConcept* concept, bool conceptNegation, CCalculationAlgorithmContextBase* calcAlgContext); bool hasRoleSuccessorConcepts(CIndividualProcessNode*& processIndi, CRole* role, CSortedNegLinker* conceptLinkerIt, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getRoleSuccessorWithConcepts(CIndividualProcessNode*& processIndi, CRole* role, CSortedNegLinker* conceptLinkerIt, bool negate, CCalculationAlgorithmContextBase* calcAlgContext); bool hasDistinctRoleSuccessorConcepts(CIndividualProcessNode*& processIndi, CRole* role, CSortedNegLinker* conceptLinkerIt, bool negate, cint64 distinctCount, CCalculationAlgorithmContextBase* calcAlgContext); bool hasAncestorIndividualNode(CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); bool containsIndividualNodeConcepts(CIndividualProcessNode*& testIndi, CSortedNegLinker* conTestLinkerIt, bool negated, CCalculationAlgorithmContextBase* calcAlgContext); bool containsIndividualNodeConcepts(CReapplyConceptLabelSet* conLabelSet, CSortedNegLinker* conTestLinkerIt, bool negated, CCalculationAlgorithmContextBase* calcAlgContext); bool containsIndividualNodeConcepts(CReapplyConceptLabelSet* conLabelSet, CSortedNegLinker* conTestLinkerIt, bool* containsNegation, CCalculationAlgorithmContextBase* calcAlgContext); bool containsIndividualNodeConcepts(CIndividualProcessNode*& testIndi, CSortedNegLinker* conTestLinkerIt, bool* containsNegation, CCalculationAlgorithmContextBase* calcAlgContext); bool containsIndividualNodeConcepts(CIndividualProcessNode*& testIndi, CSortedNegLinker* conTestLinkerIt, CCalculationAlgorithmContextBase* calcAlgContext); bool isLabelConceptSubSetIgnoreNominals(CReapplyConceptLabelSet* subConceptSet, CReapplyConceptLabelSet* superConceptSet, CCalculationAlgorithmContextBase* calcAlgContext); bool isLabelConceptSubSet(CReapplyConceptLabelSet* subConceptSet, CReapplyConceptLabelSet* superConceptSet, CConceptDescriptor** firstNotEntailedConDes, bool* equalSet, CCalculationAlgorithmContextBase* calcAlgContext); bool isLabelConceptEqualSet(CReapplyConceptLabelSet* conceptSet1, CReapplyConceptLabelSet* conceptSet2, CCalculationAlgorithmContextBase* calcAlgContext); bool isPairwiseLabelConceptEqualSet(CReapplyConceptLabelSet* conceptSet1, CReapplyConceptLabelSet* conceptSet1Pair, CReapplyConceptLabelSet* conceptSet2, CReapplyConceptLabelSet* conceptSet2Pair, CCalculationAlgorithmContextBase* calcAlgContext); bool isLabelConceptClashSet(CIndividualProcessNode* indi1, CIndividualProcessNode* indi2, CClashedDependencyDescriptor*& clashDescriptors, CCalculationAlgorithmContextBase* calcAlgContext); bool hasOptimizedBlockingB2AutomateTransitionOperands(CConcept* opConcept, CRole* role, CReapplyConceptLabelSet* vConSet, CCalculationAlgorithmContextBase* calcAlgContext); bool isLabelConceptOptimizedBlocking(CIndividualProcessNode*& testIndi, CIndividualProcessNode*& blockingIndi, CIndividualNodeBlockingTestData* blockData, bool testContinueBlocking, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext); bool isLabelConceptSubSetBlocking(CIndividualProcessNode*& testIndi, CIndividualProcessNode*& blockingIndi, CIndividualNodeBlockingTestData* blockData, bool testContinueBlocking, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext); bool isLabelConceptEqualBlocking(CIndividualProcessNode*& testIndi, CIndividualProcessNode*& blockingIndi, CIndividualNodeBlockingTestData* blockData, bool testContinueBlocking, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext); bool isLabelConceptEqualPairwiseBlocking(CIndividualProcessNode*& testIndi, CIndividualProcessNode*& blockingIndi, CIndividualNodeBlockingTestData* blockData, bool testContinueBlocking, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualNodeBlocking(CIndividualProcessNode*& testIndi, CIndividualProcessNode*& blockingIndi, CIndividualNodeBlockingTestData* blockData, bool testContinueBlocking, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext); bool isNominalVariablePropagationBindingSubSet(CIndividualProcessNode*& testIndi, CIndividualProcessNode*& blockingIndi, CIndividualNodeBlockingTestData* blockData, bool testContinueBlocking, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext); CBlockingIndividualNodeCandidateIterator getBlockingIndividualNodeCandidateIterator(CIndividualProcessNode* blockingTestIndi, CCalculationAlgorithmContextBase* calcAlgContext); void addIndividualNodeCandidateForConcept(CIndividualProcessNode*& indi, CConceptDescriptor* conDes, CCalculationAlgorithmContextBase* calcAlgContext); void addIndividualNodeCandidateForConcept(CIndividualProcessNode*& indi, CSortedNegLinker* concepts, bool negated, CCalculationAlgorithmContextBase* calcAlgContext); void propagateIndividualNodeModified(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); void setIndividualNodeConceptLabelSetModified(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); void setIndividualNodeAncestorConnectionModified(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualNodeConceptLabelSetModified(CIndividualProcessNode*& indi, cint64 modTag, CCalculationAlgorithmContextBase* calcAlgContext); void propagateProcessingRestrictionToAncestor(CIndividualProcessNode*& indi, cint64 addRestrictionFlags, bool recursive, cint64 whileNotContainsFlags, CCalculationAlgorithmContextBase* calcAlgContext); void propagateAddingProcessingRestrictionToAncestor(CIndividualProcessNode*& indi, cint64 addRestrictionFlags, bool recursive, cint64 whileNotContainsFlags, CCalculationAlgorithmContextBase* calcAlgContext); void propagateAddingBlockedProcessingRestrictionToSuccessors(CIndividualProcessNode*& indi, cint64 addRestrictionFlags, bool recursive, cint64 whileNotContainsFlags, CCalculationAlgorithmContextBase* calcAlgContext); void propagateProcessingRestrictionToSuccessors(CIndividualProcessNode*& indi, cint64 addRestrictionFlags, bool recursive, cint64 whileNotContainsFlags, CCalculationAlgorithmContextBase* calcAlgContext); void propagateAddingProcessingRestrictionToSuccessors(CIndividualProcessNode*& indi, cint64 addRestrictionFlags, bool recursive, cint64 whileNotContainsFlags, CCalculationAlgorithmContextBase* calcAlgContext); void propagateClearingProcessingRestrictionToSuccessors(CIndividualProcessNode*& indi, cint64 clearRestrictionFlags, bool recursive, cint64 whileContainsFlags, CCalculationAlgorithmContextBase* calcAlgContext); void propagateIndirectSuccessorBlocking(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); void pruneSuccessors(CIndividualProcessNode*& indi, CIndividualProcessNode* ancestorIndi, bool removeNominalLinks, CCalculationAlgorithmContextBase* calcAlgContext); bool detectIndividualNodeBlockedStatus(CIndividualProcessNode*& testIndi, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getBlockingIndividualNode(CIndividualProcessNode* blockingTestIndi, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getAncestorBlockingIndividualNode(CIndividualProcessNode* blockingTestIndi, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getAnywhereBlockingIndividualNode(CIndividualProcessNode* blockingTestIndi, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getAnywhereBlockingIndividualNodeCanidateHashed(CIndividualProcessNode* blockingTestIndi, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getAnywhereBlockingIndividualNodeLinkedCanidateHashed(CIndividualProcessNode* blockingTestIndi, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext); bool testAlternativeBlocked(CIndividualProcessNode*& testIndi, CBlockingAlternativeData* blockAltData, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualNodeProcessingBlocked(CIndividualProcessNode* blockingTestIndi, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualNodeExpansionBlocked(CIndividualProcessNode* blockingTestIndi, CCalculationAlgorithmContextBase* calcAlgContext); bool needsIndividualNodeExpansionBlockingTest(CConceptProcessDescriptor* conProDes, CIndividualProcessNode* blockingTestIndi, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getDelayProcessingBlockingNominalNode(CIndividualProcessNode* testIndi, CCalculationAlgorithmContextBase* calcAlgContext); bool tryDelayNominalProcessing(CConceptProcessDescriptor* conProDes, CIndividualProcessNode* testIndi, CCalculationAlgorithmContextBase* calcAlgContext); bool canDelayNominalProcessing(CConceptProcessDescriptor* conProDes, CIndividualProcessNode* testIndi, CCalculationAlgorithmContextBase* calcAlgContext); bool signatureCachedIndividualNodeBlock(CIndividualProcessNode*& indi, CIndividualNodeBlockingTestData* blockData, CIndividualProcessNode*& blockerIndiNode, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext); bool continueIndividualNodeBlock(CIndividualProcessNode*& indi, CIndividualNodeBlockingTestData* blockData, CIndividualProcessNode*& blockerIndiNode, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext); void reactivateIndirectBlockedSuccessors(CIndividualProcessNode*& indi, bool recursive, CCalculationAlgorithmContextBase* calcAlgContext); bool reactivateBlockedIndividuals(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); void propagateIndividualProcessedAndReactivate(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); void searchReactivateIndividualsProcessedPropagated(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); void propagateIndividualUnprocessed(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); void propagateIndividualUnprocessed(CIndividualProcessNode*& indi, bool requiresConsFlag, CCalculationAlgorithmContextBase* calcAlgContext); CCalculationAlgorithmContextBase* createCalculationAlgorithmContext(CTaskProcessorContext *processorContext, CProcessContext* processContext, CSatisfiableCalculationTask* satCalcTask); void createIndividualNodeDisjointRolesLinks(CIndividualProcessNode*& sourceIndi, CIndividualProcessNode*& destinationIndi, CSortedNegLinker* disjointRoleLinker, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); void createIndividualNodeNegationLink(CIndividualProcessNode*& sourceIndi, CIndividualProcessNode*& destinationIndi, CRole* negationRole, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); bool areIndividualNodesDisjointRolesMergeable(CIndividualProcessNode* indi1, CIndividualProcessNode* indi2, CClashedDependencyDescriptor*& clashDescriptors, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualNodeDisjointRolesMergeable(CIndividualProcessNode* indi1, CIndividualProcessNode* indi2, CClashedDependencyDescriptor*& clashDescriptors, CCalculationAlgorithmContextBase* calcAlgContext); void propagateIndirectSuccessorSaturationBlocked(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); bool validateSaturationCachingPossible(CIndividualProcessNode* indi, CIndividualSaturationProcessNode*& saturationIndiNode, bool* satCachingPossible, CConceptDescriptor** lastSatCachPossibleConDes, CConcept* addedConcept, bool addedConceptNegation, CCalculationAlgorithmContextBase* calcAlgContext); bool tryExpansionFromSaturatedData(CIndividualProcessNode*& indi, CIndividualProcessNode* createdSuccIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* depTrackPoint, CIndividualSaturationProcessNode*& saturationIndiNode, bool* satCachingPossible, CConceptDescriptor** lastSatCachPossibleConDes, CCalculationAlgorithmContextBase* calcAlgContext); bool tryEstablishSaturationCaching(CIndividualProcessNode*& indi, CIndividualProcessNode* succIndi, CIndividualSaturationProcessNode* saturationIndiNode, bool* satCachingPossible, CConceptDescriptor** lastSatCachPossibleConDes, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getSuccessorIndividual(CIndividualProcessNode*& indi, CIndividualLinkEdge* link, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getLocalizedSuccessorIndividual(CIndividualProcessNode*& indi, CIndividualLinkEdge* link, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* createSuccessorIndividual(CIndividualProcessNode*& indi, CConceptDescriptor* conDes, CSortedNegLinker* roleLinkerIt, CRole* ancRole, CSortedNegLinker* conceptLinkerIt, bool negate, CDependencyTrackPoint* depTrackPoint, CIndividualSaturationProcessNode* saturationIndiNode, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* tryExtendFunctionalSuccessorIndividual(CIndividualProcessNode*& indi, CConceptDescriptor* conDes, CSortedNegLinker* roleLinkerIt, CRole* ancRole, CSortedNegLinker* conceptLinkerIt, bool negate, CDependencyTrackPoint* depTrackPoint, CIndividualSaturationProcessNode* saturationIndiNode, CCalculationAlgorithmContextBase* calcAlgContext); void createDistinctSuccessorIndividuals(CIndividualProcessNode*& indi, CPROCESSINGLIST& indiList, CSortedNegLinker* roleLinkerIt, CRole* ancRole, CSortedNegLinker* conceptLinkerIt, bool negate, CDependencyTrackPoint* depTrackPoint, cint64 succCardCount, CCalculationAlgorithmContextBase* calcAlgContext); void createNominalsSuccessorIndividuals(CIndividualProcessNode*& indi, CSortedNegLinker* roleLinkerIt, CRole* ancRole, CSortedNegLinker* conceptLinkerIt, bool negate, CDependencyTrackPoint* depTrackPoint, cint64 succCardCount, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualSaturationProcessNode* getCreationSuccessorSaturationNode(CIndividualProcessNode*& indi, CConceptDescriptor* conDes, CCalculationAlgorithmContextBase* calcAlgContext); bool tryInitalizingFromSaturatedData(CIndividualProcessNode*& indi, CXSortedNegLinker* initConceptLinker, CDependencyTrackPoint* depTrackPoint, bool allowPreprocess, CCalculationAlgorithmContextBase* calcAlgContext); bool loadIndividualNodeDataFromBackendCache(CIndividualProcessNode* indiNode, CCalculationAlgorithmContextBase* calcAlgContext); bool tryEstablishExpansionBlockingWithBackendCacheSynchronisation(CIndividualProcessNode* indiNode, CCalculationAlgorithmContextBase* calcAlgContext); bool validateBackendSynchronisationContinued(CIndividualProcessNode* indi, CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* backendSyncData, CConcept* addedConcept, bool addedConceptNegation, CCalculationAlgorithmContextBase* calcAlgContext); bool testIndividualNodeBackendCacheSynchronization(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext); bool testIndividualNodeBackendCacheNeighbourExpansionBlockingCritical(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext); bool testIndividualNodeBackendCacheExpansionBlockingCriticalCardinality(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext); void installIndividualNodeRoleLink(CIndividualProcessNode*& sourceIndi, CIndividualProcessNode*& destinationIndi, CIndividualLinkEdge* individualLink, CCalculationAlgorithmContextBase* calcAlgContext); CReapplyQueueIterator installIndividualNodeRoleLinkReapplied(CIndividualProcessNode*& sourceIndi, CIndividualProcessNode*& destinationIndi, CIndividualLinkEdge* individualLink, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* createNewEmptyIndividual(CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* createNewIndividual(CDependencyTrackPoint* depTrackPoint, bool dataNode, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualLinkEdge* createNewIndividualsLink(CIndividualProcessNode*& indiCreator, CIndividualProcessNode*& indiSource, CIndividualProcessNode*& indiDestination, CRole* ancRole, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualLinkEdge* createNewIndividualsLinkReapplyed(CIndividualProcessNode*& indiCreator, CIndividualProcessNode*& indiSource, CIndividualProcessNode*& indiDestination, CRole* role, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualLinkEdge* createNewIndividualsLinks(CIndividualProcessNode*& indiSource, CIndividualProcessNode*& indiDestination, CSortedNegLinker* roleLinkerIt, CRole* ancRole, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualLinkEdge* createNewIndividualsLinksReapplyed(CIndividualProcessNode*& indiSource, CIndividualProcessNode*& indiDestination, CSortedNegLinker* roleLinkerIt, CRole* ancRole, CDependencyTrackPoint* depTrackPoint, bool checkRoleExisting, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getAncestorIndividual(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); bool hasIndividualsLink(CIndividualProcessNode*& indiSource, CIndividualProcessNode*& indiDestination, CRole* role, bool locateable, CCalculationAlgorithmContextBase* calcAlgContext); void createIndividualsDistinct(CIndividualProcessNode*& indiSource, CIndividualProcessNode*& indiDestination, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); void createIndividualsDistinct(CPROCESSINGLIST& indiList, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getLocalizedIndividual(CIndividualProcessNode* indi, bool updateIndividual, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getLocalizedIndividual(cint64 indiID, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getUpToDateIndividual(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getUpToDateIndividual(cint64 indiID, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getAvailableUpToDateIndividual(cint64 indiID, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualLinkEdge* getIndividualNodeLink(CIndividualProcessNode*& indiSource, CIndividualProcessNode*& indiDestination, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualLinkEdge* getLinkProcessingRestriction(CConceptProcessDescriptor*& conProDes); void propagateIndividualNodeNewNominalConnectionToAncestors(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); void propagateIndividualNodeNominalConnectionToAncestors(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); void propagateIndividualNodeNeighboursNominalConnectionToAncestors(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext); void propagateIndividualNodeNominalConnectionFlagsToAncestors(CIndividualProcessNode*& indi, cint64 nominalPropagationFlags, CCalculationAlgorithmContextBase* calcAlgContext); void propagateIndividualNodeConnectedNominalToAncestors(CIndividualProcessNode*& indi, cint64 nominalID, CCalculationAlgorithmContextBase* calcAlgContext); void propagateIndividualNodeNominalConnectionStatusToAncestors(CIndividualProcessNode*& indi, CIndividualProcessNode* copyFromIndiNode, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualNodesMergeable(CIndividualProcessNode* indi1, CIndividualProcessNode* indi2, CClashedDependencyDescriptor*& clashDescriptors, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getMergedIndividualNodes(CIndividualProcessNode*& preferedMergeIntoIndividualNode, CIndividualProcessNode*& individual2, CDependencyTrackPoint* mergeDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); void mergeIndividualNodeInto(CIndividualProcessNode*& mergeIntoIndividualNode, CIndividualProcessNode*& individual, CDependencyTrackPoint* mergeDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getIntoEmptyMergedIndividualNode(CIndividualProcessNode*& mergingIndividualNode, bool createAsNominal, CIndividualProcessNode* mergerNode, CDependencyTrackPoint* mergeDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); QString generateDebugIndiModelStringList(CCalculationAlgorithmContextBase* calcAlgContext); QString generateExtendedDebugIndiModelStringList(CCalculationAlgorithmContextBase* calcAlgContext); QString generateDebugIndiStatusString(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext); QString generateDebugDependentNominalsString(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext); QString generateDebugIncrementalExpansionString(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext); QString generateDebugDependencyString(CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); QStringList generateExtendedDebugConceptSetStringList(CReapplyConceptLabelSet* conSet, CConceptPropagationBindingSetHash* propBindSetHash, CConceptVariableBindingPathSetHash* varBindPathSetHash, CCalculationAlgorithmContextBase* calcAlgContext); void debugTestCriticalConceptSet(QStringList& conSetList, CCalculationAlgorithmContextBase* calcAlgContext); void analyzeABoxCompressionPossibilities(CCalculationAlgorithmContextBase* calcAlgContext); void analyzeCompletionGraphStatistics(CCalculationAlgorithmContextBase* calcAlgContext); void writeCompletionGraphStatistics(CCalculationAlgorithmContextBase* calcAlgContext); bool isConceptFromPredecessorDependent(CIndividualProcessNode*& individualNode, CConceptDescriptor* conDes, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext); void testCompletionGraphCachingAndBlocking(CCalculationAlgorithmContextBase* calcAlgContext, CIndividualProcessNode* exceptIndividualNode = nullptr); void testProblematicConceptSet(CCalculationAlgorithmContextBase* calcAlgContext); // protected variables protected: CCalculationAlgorithmContextBase* mCalcAlgContext; CProcessingDataBox* mProcessingDataBox; CIndividualProcessingQueue* mProcessingQueue; CIndividualDepthProcessingQueue* mNominalProcessingQueue; CIndividualUnsortedProcessingQueue* mDepthFirstProcessingQueue; CIndividualUnsortedProcessingQueue* mNominalCachingLossReactivationProcessingQueue; CSignatureBlockingReviewSet* mSigBlockRevSet; CReusingReviewData* mReusingReviewData; CIndividualUnsortedProcessingQueue* mIndiImmediateProQueue; CIndividualDepthProcessingQueue* mIndiDetExpProQueue; CIndividualUnsortedProcessingQueue* mIndiDetDeptFirstExpProQueue; CIndividualDepthProcessingQueue* mIndiBlockReactProQueue; CIndividualDepthProcessingQueue* mIndiSigBlockUpdProQueue; CIndividualDepthProcessingQueue* mDepthProcessingQueue; CIndividualReactivationProcessingQueue* mEarlyIndiReactProcessingQueue; CIndividualReactivationProcessingQueue* mLateIndiReactProcessingQueue; CIndividualConceptBatchProcessingQueue* mVarBindConBatchProcessingQueue; CIndividualUnsortedProcessingQueue* mDelayedNominalProcessingQueue; CIndividualUnsortedProcessingQueue* mRoleAssertionProcessingQueue; CIndividualDepthProcessingQueue* mValueSpaceTriggeringProQueue; CIndividualDepthProcessingQueue* mValueSpaceSatCheckingQueue; CIndividualUnsortedProcessingQueue* mBackendSyncRetestProcessingQueue; CIndividualDepthProcessingQueue* mIncrementalExpansionInitializingProcessingQueue; CIndividualCustomPriorityProcessingQueue* mIncrementalExpansionProcessingQueue; CIndividualDepthProcessingQueue* mIncrementalCompatibilityCheckingQueue; enum INDINODEQUEUETYPE { INQT_NONE, INQT_CACHETEST, INQT_IMMEDIATE, INQT_ROLEASS, INQT_BACKENDSYNCRETEST, INQT_DETEXP, INQT_VSTSATTESTING, INQT_VSTRIGGERING, INQT_BLOCKREACT, INQT_COMPCACHEDREACT, INQT_BLOCKUP, INQT_DEPTHNORMAL, INQT_NOMINAL, INQT_NOMINALCACHINGLOSSREACTIVATION, INQT_DEPTHFIRST, INQT_OUTDATED, INQT_VARBINDBATCHQUE, INQT_DELAYEDNOMINAL }; INDINODEQUEUETYPE mIndiNodeFromQueueType; double mMinConceptProcessingPriorityLevel; bool mIndiNodeConcludeUnsatCaching; cint64 mCurrentRecProcDepth; cint64 mCurrentRecProcDepthLimit; CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy* mIndiAncDepthMasConProcPriStr; CConceptProcessingPriorityStrategy* mConceptPriorityStrategy; CIndividualProcessingPriorityStrategy* mIndividualPriorityStrategy; CTaskProcessingPriorityStrategy* mTaskProcessingStrategy; CSatisfiableTaskConsistencyPreyingAnalyser mSatTaskConsAnalyser; CSatisfiableTaskIncrementalConsistencyPreyingAnalyser mSatTaskIncConsAnalyser; CSatisfiableTaskClassificationMessageAnalyser mClassMessAnalyser; CSatisfiableTaskMarkerIndividualPropagationAnalyser mMarkerPropRealMessAnalyser; CSatisfiableTaskPossibleAssertionCollectingAnalyser mPossAssCollAnalyser; CClashDescriptorFactory* mClashDesFactory; CDependencyFactory* mDependencyFactory; CIndividualNodeManager* mIndiNodeManager; CUnsatisfiableCacheHandler* mUnsatCacheHandler; CSatisfiableExpanderCacheHandler* mSatExpCacheHandler; CCompletionGraphCacheHandler* mCompGraphCacheHandler; CReuseCompletionGraphCacheHandler* mReuseCompGraphCacheHandler; CConceptNominalSchemaGroundingHandler* mGroundingHandler; CUnsatisfiableCacheRetrievalStrategy* mUnsatCachRetStrategy; CSaturationNodeExpansionCacheHandler* mSatNodeExpCacheHandler; CDatatypeIndividualProcessNodeHandler* mDatatypeHandler; CComputedConsequencesCacheHandler* mCompConsCacheHandler; CIndividualNodeBackendCacheHandler* mBackendCacheHandler; CIncrementalCompletionGraphCompatibleExpansionHandler* mIncExpHandler; CIndividualProcessNode* mLastUnsatCacheTestedIndiNode; cint64 mLastUnsatCacheTestedIndiNodeConceptSetSize; const static cint64 mRuleFuncCount = 200; TableauRuleFunction* mPosJumpFuncVec; TableauRuleFunction* mNegJumpFuncVec; TableauRuleFunction mPosTableauRuleJumpFuncVec[mRuleFuncCount]; TableauRuleFunction mNegTableauRuleJumpFuncVec[mRuleFuncCount]; bool mOptIncrementalExpansion; bool mOptIncrementalCompatibleExpansion; bool mOptIncrementalCachingExpansion; bool mOptIncrementalDeterministicExpansion; bool mOptIncrementalNondeterministicExpansion; bool mConfAncestorBlockingSearch; bool mConfAnywhereBlockingSearch; bool mConfSaveCoreBlockingConceptsCandidates; bool mConfAnywhereBlockingLinkedCandidateHashSearch; bool mConfAnywhereBlockingCandidateHashSearch; bool mConfAnywhereBlockingLazyExactHashing; bool mConfAnywhereBlockingSomeInitializationHashing; bool mConfSubSetBlocking; bool mConfOptimizedSubSetBlocking; bool mConfEqualSetBlocking; bool mConfPairwiseEqualSetBlocking; bool mConfSpecializedAutomateRules; bool mConfSemanticBranching; bool mConfAtomicSemanticBranching; bool mConfBranchTriggering; bool mConfStrictIndiNodeProcessing; bool mConfIDIndiPriorization; bool mConfPropagateNodeProcessed; bool mConfDirectRulePreprocessing; bool mConfLazyNewNominalGeneration; bool mConfConsRestrictedNonStrictIndiNodeProcessing; bool mConfUniqueNameAssumption; bool mConfPairwiseMerging; bool mConfRepresentativePropagationRules; bool mConfBuildDependencies; bool mConfDependencyBacktracking; bool mConfDependencyBackjumping; bool mConfWriteUnsatCaching; bool mConfTestOccurUnsatCached; bool mConfTestPrecheckUnsatCached; bool mConfMinimizeMerging; bool mConfTestedConceptWriteUnsatCaching; bool mConfLateBlockingResolving; bool mConfSatExpCacheRetrieval; bool mConfSatExpCacheConceptExpansion; bool mConfSatExpCacheSatisfiableBlocking; bool mConfSatExpCacheWriting; bool mConfSignatureMirroringBlocking; bool mConfSignatureSaving; bool mOptSignatureMirroringBlockingForceSubset; bool mOptSignatureMirroringBlockingInBlocking; bool mConfIndividualReusingFromSignatureBlocking; bool mConfSatExpCachedDisjAbsorp; bool mConfSatExpCachedMergAbsorp; bool mConfSatExpCachedSuccAbsorp; bool mConfUnsatCachingUseFullNodeDependency; bool mConfUnsatCachingUseNodeSignatureSet; bool mConfSkipANDConcepts; bool mConfCompletionGraphCaching; bool mConfDelayCompletionGraphCachingReactivation; bool mConfIndividualsBackendCacheLoading; bool mConfDepthOrientatedProcessing; bool mConfCurrentIndividualQueuing; bool mOptProcessedNodePropagation; bool mOptProcessedConsNodePropagation; bool mOptConsistenceNodeMarking; bool mOptProcessingBlockingTests; bool mOptConsNodeProcessingBlockingTests; bool mOptNonStrictIndiNodeProcessing; bool mOptDetExpPreporcessing; bool mConfUnsatBranchSatisfiableCaching; bool mConfAtleastAtmostFastClashCheck; bool mConfCompGraphReuseCacheRetrieval; bool mConfCompGraphDeterministicReuse; bool mConfCompGraphNonDeterministicReuse; bool mConfSaturationCachingWithNominals; bool mConfExactNominalDependencyTracking; bool mConfConceptUnsatisfiabilitySaturatedTesting; bool mConfSaturationSatisfiabilitiyExpansionCacheWriting; bool mConfSaturationExpansionCacheReading; bool mConfSaturationCachingTestingDuringBlockingTests; bool mConfSaturationConceptUnsatisfiabilitySaturatedCacheWriting; bool mConfSaturationIncompleteExpansionFromCache; bool mConfCollectCachingUpdatedBlockableIndiNodes; bool mConfDatatypeReasoning; bool mConfCacheComputedConsequences; bool mConfAddCachedComputedConsequences; bool mConfDebuggingWriteData; bool mDebug; bool mBacktrackDebug; bool mConfExpandCreatedSuccessorsFromSaturation; bool mConfCachingBlockingFromSaturation; bool mConfMergeConstructedIndividualNode; cint64 mMaxBlockingCachingSavedCandidateCount; cint64 mMapComparisonDirectLookupFactor; CCalculationConfigurationExtension *mLastConfig; QSet mUnsatCachingSignatureSet; cint64 mProcessRuleToTaskProcessingVerificationCount; cint64 mRemainProcessRuleToTaskProcessingVerification; static const cint64 mDeterministicProcessPriority = 4; static const cint64 mImmediatelyProcessPriority = 8; // for debugging QHash mIndiNodeInitConceptSigCountHash; QHash mClosedBranchLevelCountHash; QHash mSignatureIndiNodeStatusHash; QHash mSignatureIndiNodePredDepHash; QMap mIndiNodeCountMap; QList mIndiNodeCountList; QSet mCriticalConceptSetStringSet; bool mFoundCriticalConceptSet; static const cint64 mDebugTaskIDVectorSize = 100; cint64 mDebugTaskIDVector[mDebugTaskIDVectorSize]; cint64 mBacktrackingStep; TableauRuleFunction mLastJumpFunc; CBranchingMergingProcessingRestrictionSpecification* lastBranchingMergingProcRest; QStringList mDebugIndiModelStringList; QString mDebugIndiModelString; QString mBeginTaskDebugIndiModelString; QString mBeforeRuleDebugIndiModelString; QString mAfterRuleDebugIndiModelString; QString mClashedDebugIndiModelString; QString mEndTaskDebugIndiModelString; QString mIncExpCompIndiModelString; QString mIncExpMergedIndiModelString; QString mBeforeMergingTaskDebugIndiModelString; QString mAfterMergingTaskDebugIndiModelString; QStringList mMergedStringList; QString mSatTaskDebugIndiModelString; QString mBeforeRuleTaskDebugIndiModelString; QString mBeginBacktrackingClashString; QString mBeginBacktrackingTracklineString; QString mEndBacktrackingTracklineString; QString mFileBacktrackingStepTracklineString; QString mBeginBacktrackingStepTracklineString; QString mEndBacktrackingStepTracklineString; QString mBeginDetPrevBacktrackingStepTracklineString; QString mEndDetPrevBacktrackingStepTracklineString; QString mBeginNonDetPrevBacktrackingStepTracklineString; QString mEndNonDetPrevBacktrackingStepTracklineString; QString mNonDetDependencyTrackPointReasonString; QString mNonDetDependencyBeforeProcessedTrackedString; QString mNonDetDependencyCollectedTrackedString; QString mMergingClashString; QString mCachingClashString; QString mSortedCachingClashString; QString mMergingQueueString; QString mBranchLevelClosedCountString; QString mBeforeGroundingDebugIndiModelString; QString mAfterGroundingDebugIndiModelString; cint64 mAppliedALLRuleCount; cint64 mAppliedSOMERuleCount; cint64 mAppliedANDRuleCount; cint64 mAppliedORRuleCount; cint64 mAppliedATLEASTRuleCount; cint64 mAppliedATMOSTRuleCount; cint64 mAppliedTOTALRuleCount; cint64 mStatVarBindingCreatedCount; cint64 mStatVarBindingGroundingCount; cint64 mStatVarBindingImplicationCount; cint64 mStatVarBindingJoinCombinesCount; cint64 mStatVarBindingPropagateSuccCount; cint64 mStatVarBindingPropagateSuccFreshCount; cint64 mStatVarBindingPropagateSuccInitialCount; cint64 mStatVarBindingPropagateCount; cint64 mStatVarBindingPropagateFreshCount; cint64 mStatVarBindingPropagateInitialCount; cint64 mStatRepresentativeCreatedCount; cint64 mStatRepresentativeGroundingCount; cint64 mStatRepresentativeImplicationCount; cint64 mStatRepresentativeJoinCombinesCount; cint64 mStatRepresentativeJoinCount; cint64 mStatRepresentativeJoinedCount; cint64 mStatRepresentativeJoinQuickFailCount; cint64 mStatRepresentativePropagateSuccCount; cint64 mStatRepresentativePropagateCount; cint64 mStatRepresentativePropagateNewRepresentativeCount; cint64 mStatRepresentativePropagateReusedRepresentativeCount; cint64 mStatRepresentativePropagateUseRepresentativeCount; cint64 mStatBackPropActivationCount; QTime mTimerBacktracing; QTime mUnsatCacheRetrieval; QTime mComplGraphReuseCacheRetrieval; bool mNominalMerged; cint64 mNominalMergedCount; cint64 mOverJumpedNonDeterministicDecisionCount; cint64 mRelevantNonDeterministicDecisionCount; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONTABLEAUCOMPLETIONTASKHANDLEALGORITHM_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskSaturationIndividualsAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskSaturationIndividual0000644000175000017500000000460212520551014032365 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKSATURATIONINDIVIDUALSANALYSER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKSATURATIONINDIVIDUALSANALYSER_H // Libraries includes // Namespace includes #include "CCalculationAlgorithmContext.h" #include "CSatisfiableConsistencyPreyingAnalyser.h" // Other includes #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" #include "Reasoner/Kernel/Task/CSaturationTaskData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Task; namespace Algorithm { /*! * * \class CSatisfiableTaskSaturationIndividualsAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableTaskSaturationIndividualsAnalyser : public CSatisfiableConsistencyPreyingAnalyser { // public methods public: //! Constructor CSatisfiableTaskSaturationIndividualsAnalyser(); //! Destructor virtual ~CSatisfiableTaskSaturationIndividualsAnalyser(); bool analyseSatisfiableTask(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKSATURATIONINDIVIDUALSANALYSER_H ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBinaryHexDataValueSpaceHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBinaryHexDataV0000644000175000017500000000244712520551006032226 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeBinaryHexDataValueSpaceHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualProcessNodeBinaryHexDataValueSpaceHandler::CIndividualProcessNodeBinaryHexDataValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType) : CIndividualProcessNodeCompareValueSpaceHandler(valueSpaceType) { } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CUnsatisfiableCacheHandler.cpp0000644000175000017500000003775712520551016031050 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CUnsatisfiableCacheHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CUnsatisfiableCacheHandler::CUnsatisfiableCacheHandler(COccurrenceUnsatisfiableCacheReader* occurUnsatCacheReader, COccurrenceUnsatisfiableCacheWriter* occurUnsatCacheWriter) { mOccurUnsatCacheReader = occurUnsatCacheReader; mOccurUnsatCacheWriter = occurUnsatCacheWriter; mConfConceptDataUnsatisfiablePrecheck = true; } CUnsatisfiableCacheHandler::~CUnsatisfiableCacheHandler() { } bool CUnsatisfiableCacheHandler::isIndividualNodeUnsatisfiableCached(CIndividualProcessNode* individualNode, CClashedDependencyDescriptor*& clashDescriptors, CCalculationAlgorithmContext* calcAlgContext) { STATINC(UNSATCACHERETRIEVALCOUNT,calcAlgContext); bool unsatisfiableChecked = false; CConceptDescriptor* lastConDes = nullptr; cint64 lastRetCachingTag = 0; CReapplyConceptLabelSet* conSet = individualNode->getReapplyConceptLabelSet(false); CConceptDescriptor* conDesLinker = conSet->getAddingSortedConceptDescriptionLinker(); cint64 currentCachingTag = mOccurUnsatCacheReader->getCurrentCachingTag(); CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData* unsatRetData = (CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData*)individualNode->getIndividualUnsatisfiableCacheRetrievalData(false); if (unsatRetData) { lastRetCachingTag = unsatRetData->getLastRetrievalCachingTag(); lastConDes = unsatRetData->getLastRetrievalConceptDescriptor(); // nothing has changed if (lastRetCachingTag >= currentCachingTag && lastConDes == conDesLinker) { return false; } } if (lastConDes != conDesLinker) { lastRetCachingTag = 0; } if (mConfConceptDataUnsatisfiablePrecheck) { STATINC(UNSATCACHERETRIEVALPRECHECKCOUNT,calcAlgContext); cint64 minMaxCachedTag = CINT64_MAX; cint64 maxMinCachedTag = CINT64_MIN; cint64 minUnsatCachedSize = CINT64_MAX; cint64 possCachedCount = 0; cint64 maxLastCachingTag = 0; CConceptDescriptor* conDesIt = conDesLinker; while (conDesIt && lastConDes != conDesIt) { CConcept* concept = conDesIt->getConcept(); bool conNeg = conDesIt->getNegation(); CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); if (conProcData) { CUnsatisfiableCachingTags* cachingTags = conProcData->getUnsatisfiableCachingTags(conNeg); if (cachingTags) { if (cachingTags->candidateTags(minMaxCachedTag,maxMinCachedTag,minUnsatCachedSize,lastRetCachingTag+1)) { ++possCachedCount; lastConDes = nullptr; } } } conDesIt = conDesIt->getNext(); } if (possCachedCount < minUnsatCachedSize) { STATINC(UNSATCACHERETRIEVALPRECHECKDIRECTFAILEDCOUNT,calcAlgContext); unsatisfiableChecked = true; } else if (minMaxCachedTag == maxMinCachedTag) { // try to get unsatisfiable concepts cint64 unsatLineCount = CINT64_MAX; cint64 foundUnsatLineCount = 0; CConceptDescriptor* conDesIt = conDesLinker; while (conDesIt && lastConDes != conDesIt && foundUnsatLineCount <= unsatLineCount) { CConcept* concept = conDesIt->getConcept(); bool conNeg = conDesIt->getNegation(); CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); if (conProcData) { CUnsatisfiableCachingTags* cachingTags = conProcData->getUnsatisfiableCachingTags(conNeg); if (cachingTags) { if (cachingTags->hasCandidateTags(minMaxCachedTag,maxMinCachedTag,lastRetCachingTag+1)) { ++foundUnsatLineCount; cachingTags->candidateMinUnsatisfiableSize(unsatLineCount,maxMinCachedTag); } } } conDesIt = conDesIt->getNext(); } if (foundUnsatLineCount == unsatLineCount) { // found unsatisfiable concepts, try to extract clashes cint64 clashLinkerGenCount = 0; CClashedDependencyDescriptor* clashedDepDesLinker = nullptr; CReapplyConceptLabelSetIterator conSetIt = conSet->getConceptLabelSetIterator(false,true,false); while (conSetIt.hasNext()) { CConceptDescriptor* conDes = conSetIt.getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint = conSetIt.getDependencyTrackPoint(); CConcept* concept = conDes->getConcept(); bool conNeg = conDes->getNegation(); CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); if (conProcData) { CUnsatisfiableCachingTags* cachingTags = conProcData->getUnsatisfiableCachingTags(conNeg); if (cachingTags) { if (cachingTags->hasCandidateTags(minMaxCachedTag,maxMinCachedTag,lastRetCachingTag+1)) { ++clashLinkerGenCount; clashedDepDesLinker = calcAlgContext->getUsedClashDescriptorFactory()->createClashedConceptDescriptor(clashedDepDesLinker,individualNode,conDes,depTrackPoint,calcAlgContext); if (clashLinkerGenCount == unsatLineCount) { clashDescriptors = clashedDepDesLinker->append(clashDescriptors); STATINC(UNSATCACHERETRIEVALPRECHECKSUCCESSCOUNT,calcAlgContext); return true; } } } } conSetIt.moveNext(); } STATINC(UNSATCACHERETRIEVALPRECHECKINSUFFICIENTCOUNT,calcAlgContext); } else { STATINC(UNSATCACHERETRIEVALPRECHECKINSUFFICIENTCOUNT,calcAlgContext); } } } CMemoryAllocationManager* memMan = calcAlgContext->getUsedTemporaryMemoryAllocationManager(); if (!unsatisfiableChecked) { STATINC(UNSATCACHERETRIEVALHASHCOUNT,calcAlgContext); CXLinker* cacheTestLinker = nullptr; CXLinker* lastCacheTestLinker = nullptr; // build concept linkers for cache testing CReapplyConceptLabelSetIterator conSetIt = conSet->getConceptLabelSetIterator(true); while (conSetIt.hasNext()) { CConceptDescriptor* conDes = conSetIt.getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool conNeg = conDes->getNegation(); CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); if (conProcData) { CUnsatisfiableCachingTags* cachingTags = conProcData->getUnsatisfiableCachingTags(conNeg); if (cachingTags) { CCacheValue* cacheValue = CObjectAllocator::allocateAndConstruct(memMan); if (!conNeg) { cacheValue->initCacheValue(concept->getConceptTag(),(cint64)concept,CCacheValue::CACHEVALTAGANDCONCEPT); } else { cacheValue->initCacheValue(concept->getConceptTag(),(cint64)concept,CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT); } CXLinker* nextCacheTestLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(memMan); nextCacheTestLinker->initLinker(cacheValue); if (!lastCacheTestLinker) { cacheTestLinker = nextCacheTestLinker; lastCacheTestLinker = nextCacheTestLinker; } else { lastCacheTestLinker->append(nextCacheTestLinker); lastCacheTestLinker = nextCacheTestLinker; } } } conSetIt.moveNext(); } if (cacheTestLinker) { CXLinker* unsatLinker = mOccurUnsatCacheReader->getUnsatisfiableItems(cacheTestLinker,memMan); if (!unsatLinker) { // not unsatisfiable unsatisfiableChecked = true; STATINC(UNSATCACHERETRIEVALHASHFAILEDCOUNT,calcAlgContext); } else { // found unsatisfiable cached concepts, extract clashes CXLinker* unsatLinkerIt = unsatLinker; while (unsatLinkerIt) { CCacheValue* cacheValue = unsatLinkerIt->getData(); CConcept* concept = (CConcept*)cacheValue->getIdentification(); CConceptDescriptor* conDes = nullptr; CDependencyTrackPoint* depTrackPoint = nullptr; conSet->getConceptDescriptor(concept,conDes,depTrackPoint); clashDescriptors = calcAlgContext->getUsedClashDescriptorFactory()->createClashedConceptDescriptor(clashDescriptors,individualNode,conDes,depTrackPoint,calcAlgContext); unsatLinkerIt = unsatLinkerIt->getNext(); STATINC(UNSATCACHERETRIEVALHASHSUCCESSCOUNT,calcAlgContext); } return true; } } return false; } if (unsatisfiableChecked) { CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData* locUnsatRetData = (CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData*)individualNode->getIndividualUnsatisfiableCacheRetrievalData(true); if (!locUnsatRetData) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); locUnsatRetData = CObjectAllocator::allocateAndConstruct(taskMemMan); individualNode->setIndividualUnsatisfiableCacheRetrievalData(locUnsatRetData); } locUnsatRetData->setLastRetrievalCachingTag(currentCachingTag); locUnsatRetData->setLastRetrievalConceptDescriptor(conDesLinker); } return false; } bool CUnsatisfiableCacheHandler::areClashedDescriptorsLastCached(CTrackedClashedDescriptor* trackedClashedDes, CCalculationAlgorithmContext* calcAlgContext) { CTrackedClashedDescriptor* trackedClashedDesIt = trackedClashedDes; for (QList::const_iterator it = mUnsatItemList.constBegin(), itEnd = mUnsatItemList.constEnd(); it != itEnd; ++it) { if (!trackedClashedDesIt) { return false; } CCacheValue cachedValueItem(*it); CConceptDescriptor* conDes = trackedClashedDesIt->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool conNeg = conDes->getNegation(); if (conNeg) { if (cachedValueItem.getCacheValueIdentifier() != CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT) { return false; } } else { if (cachedValueItem.getCacheValueIdentifier() != CCacheValue::CACHEVALTAGANDCONCEPT) { return false; } } if ((CConcept*)cachedValueItem.getIdentification() != concept) { return false; } trackedClashedDesIt = trackedClashedDesIt->getNextDescriptor(); } if (trackedClashedDesIt) { return false; } return true; } bool CUnsatisfiableCacheHandler::areClashedDescriptorsAlreadyCached(CTrackedClashedDescriptor* trackedClashedDes, CCalculationAlgorithmContext* calcAlgContext) { STATINC(UNSATCACHEWRITINGALREADYCACHEDTESTCOUNT,calcAlgContext); if (areClashedDescriptorsLastCached(trackedClashedDes,calcAlgContext)) { return true; } CTrackedClashedDescriptor* trackedClashedDesIt = trackedClashedDes; while (trackedClashedDesIt) { CConceptDescriptor* conDes = trackedClashedDesIt->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool conNeg = conDes->getNegation(); CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); bool clashDesCached = false; if (conProcData) { CUnsatisfiableCachingTags* cachingTags = conProcData->getUnsatisfiableCachingTags(conNeg); if (cachingTags) { if (cachingTags->getLastCachingTag() > 0) { clashDesCached = true; } } } if (!clashDesCached) { STATINC(UNSATCACHEWRITINGALREADYCACHEDTESTPRECHECKFAILEDCOUNT,calcAlgContext); return false; } trackedClashedDesIt = trackedClashedDesIt->getNextDescriptor(); } CMemoryAllocationManager* memMan = calcAlgContext->getUsedTemporaryMemoryAllocationManager(); CXLinker* cacheTestLinker = nullptr; CXLinker* lastCacheTestLinker = nullptr; trackedClashedDesIt = trackedClashedDes; CCacheValue* lastCacheValue = nullptr; while (trackedClashedDesIt) { CConceptDescriptor* conDes = trackedClashedDesIt->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool conNeg = conDes->getNegation(); CCacheValue* cacheValue = CObjectAllocator::allocateAndConstruct(memMan); if (!conNeg) { cacheValue->initCacheValue(concept->getConceptTag(),(cint64)concept,CCacheValue::CACHEVALTAGANDCONCEPT); } else { cacheValue->initCacheValue(concept->getConceptTag(),(cint64)concept,CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT); } if (!lastCacheValue || *lastCacheValue != *cacheValue) { CXLinker* nextCacheTestLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(memMan); nextCacheTestLinker->initLinker(cacheValue); if (!lastCacheTestLinker) { cacheTestLinker = nextCacheTestLinker; lastCacheTestLinker = nextCacheTestLinker; } else { lastCacheTestLinker->append(nextCacheTestLinker); lastCacheTestLinker = nextCacheTestLinker; } lastCacheValue = cacheValue; } trackedClashedDesIt = trackedClashedDesIt->getNextDescriptor(); } CXLinker* unsatLinker = mOccurUnsatCacheReader->getUnsatisfiableItems(cacheTestLinker,memMan); if (unsatLinker) { STATINC(UNSATCACHEWRITINGALREADYCACHEDTESTHASHFAILEDCOUNT,calcAlgContext); } return unsatLinker != nullptr; } bool CUnsatisfiableCacheHandler::writeUnsatisfiableClashedDescriptors(CTrackedClashedDescriptor* trackedClashedDes, CCalculationAlgorithmContext* calcAlgContext) { STATINC(UNSATCACHEWRITINGTRYINGCOUNT,calcAlgContext); if (!areClashedDescriptorsAlreadyCached(trackedClashedDes,calcAlgContext)) { mUnsatItemList.clear(); CTrackedClashedDescriptor* trackedClashedDesIt = trackedClashedDes; while (trackedClashedDesIt) { CConceptDescriptor* conDes = trackedClashedDesIt->getConceptDescriptor(); if (conDes->isNegated()) { mUnsatItemList.append(CCacheValue(conDes->getConceptTag(),(cint64)conDes->getConcept(),CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT)); } else { mUnsatItemList.append(CCacheValue(conDes->getConceptTag(),(cint64)conDes->getConcept(),CCacheValue::CACHEVALTAGANDCONCEPT)); } trackedClashedDesIt = trackedClashedDesIt->getNextDescriptor(); } mOccurUnsatCacheWriter->setUnsatisfiable(mUnsatItemList); STATINC(UNSATCACHEWRITINGCOUNT,calcAlgContext); return true; } else { STATINC(UNSATCACHEWRITINGALREADYCACHEDCOUNT,calcAlgContext); } return false; } bool CUnsatisfiableCacheHandler::writeUnsatisfiableClashedConcept(CConcept* concept, CCalculationAlgorithmContext* calcAlgContext) { STATINC(UNSATCACHEWRITINGTRYINGCOUNT,calcAlgContext); if (true) { mUnsatItemList.clear(); mUnsatItemList.append(CCacheValue(concept->getConceptTag(),(cint64)concept,CCacheValue::CACHEVALTAGANDCONCEPT)); mOccurUnsatCacheWriter->setUnsatisfiable(mUnsatItemList); STATINC(UNSATCACHEWRITINGCOUNT,calcAlgContext); return true; } else { STATINC(UNSATCACHEWRITINGALREADYCACHEDCOUNT,calcAlgContext); } return false; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CTrackedClashedDescriptor.cpp0000644000175000017500000001606712520551014030722 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTrackedClashedDescriptor.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CTrackedClashedDescriptor::CTrackedClashedDescriptor() { } CTrackedClashedDescriptor* CTrackedClashedDescriptor::initTrackedClashedDescriptor(CIndividualProcessNode* indiNode, CConceptDescriptor* conDes, CVariableBindingPath* varBindPath, CDependencyTrackPoint* depTrackPoint) { initClashedDependencyDescriptor(depTrackPoint); mErrorFlag = false; mIndiNodeID = -1; mIndiNodeLevel = -1; mNominalIndiFlag = false; mConceptDescriptor = nullptr; mVarBindPath = nullptr; mDetermisticFlag = false; mIndepenentFlag = false; mBranchingLevelTag = -1; mProcessingTag = -1; if (indiNode) { mIndiNodeID = indiNode->getIndividualID(); mIndiNodeLevel = indiNode->getIndividualNominalLevelOrAncestorDepth(); mNominalIndiFlag = indiNode->isNominalIndividual(); } else { mErrorFlag = true; } mConceptDescriptor = conDes; mVarBindPath = varBindPath; if (depTrackPoint) { mDetermisticFlag = depTrackPoint->isPointingToDeterministicDependencyNode(); mIndepenentFlag = depTrackPoint->isPointingToIndependentDependencyNode(); mProcessingTag = depTrackPoint->getProcessingTag(); mBranchingLevelTag = depTrackPoint->getBranchingTag(); if (mBranchingLevelTag <= -1) { mErrorFlag = true; } } else { mErrorFlag = true; } return this; } CTrackedClashedDescriptor* CTrackedClashedDescriptor::initTrackedClashedDescriptor(CTrackedClashedDescriptor* trackedClashDes) { mErrorFlag = trackedClashDes->mErrorFlag; mIndiNodeID = trackedClashDes->mIndiNodeID; mIndiNodeLevel = trackedClashDes->mIndiNodeLevel; mNominalIndiFlag = trackedClashDes->mNominalIndiFlag; mConceptDescriptor = trackedClashDes->mConceptDescriptor; mDetermisticFlag = trackedClashDes->mDetermisticFlag; mIndepenentFlag = trackedClashDes->mIndepenentFlag; mBranchingLevelTag = trackedClashDes->mBranchingLevelTag; mProcessingTag = trackedClashDes->mProcessingTag; mVarBindPath = trackedClashDes->mVarBindPath; initClashedDependencyDescriptor(trackedClashDes->mDependencyTrackPoint); return this; } CTrackedClashedDescriptor* CTrackedClashedDescriptor::initTrackedClashedDescriptor(CTrackedClashedDescriptor* trackedClashDesForIndiNode, CConceptDescriptor* conDes, CVariableBindingPath* varBindPath, CDependencyTrackPoint* depTrackPoint) { mErrorFlag = trackedClashDesForIndiNode->mErrorFlag; mIndiNodeID = trackedClashDesForIndiNode->mIndiNodeID; mIndiNodeLevel = trackedClashDesForIndiNode->mIndiNodeLevel; mNominalIndiFlag = trackedClashDesForIndiNode->mNominalIndiFlag; mVarBindPath = varBindPath; initClashedDependencyDescriptor(depTrackPoint); mConceptDescriptor = conDes; if (depTrackPoint) { mDetermisticFlag = depTrackPoint->isPointingToDeterministicDependencyNode(); mIndepenentFlag = depTrackPoint->isPointingToIndependentDependencyNode(); mProcessingTag = depTrackPoint->getProcessingTag(); mBranchingLevelTag = depTrackPoint->getBranchingTag(); if (mBranchingLevelTag <= -1) { mErrorFlag = true; } } else { mErrorFlag = true; } return this; } CTrackedClashedDescriptor* CTrackedClashedDescriptor::initTrackedClashedDescriptor(CTrackedClashedDescriptor* trackedClashDesForIndiNode, CConceptDescriptor* conDes, CDependencyTrackPoint* depTrackPoint) { initTrackedClashedDescriptor(trackedClashDesForIndiNode,conDes,trackedClashDesForIndiNode->getVariableBindingPath(),depTrackPoint); return this; } bool CTrackedClashedDescriptor::isAppropriatedIndividualNominal() { return mNominalIndiFlag; } cint64 CTrackedClashedDescriptor::getAppropriatedIndividualID() { return mIndiNodeID; } cint64 CTrackedClashedDescriptor::getAppropriatedIndividualLevel() { return mIndiNodeLevel; } cint64 CTrackedClashedDescriptor::getBranchingLevelTag() { return mBranchingLevelTag; } cint64 CTrackedClashedDescriptor::getProcessingTag() { return mProcessingTag; } bool CTrackedClashedDescriptor::isPointingToDeterministicDependencyNode() { return mDetermisticFlag; } bool CTrackedClashedDescriptor::isPointingToNonDeterministicDependencyNode() { return !mDetermisticFlag; } bool CTrackedClashedDescriptor::isPointingToIndependentDependencyNode() { return mIndepenentFlag; } bool CTrackedClashedDescriptor::isTrackingError() { return mErrorFlag; } CConceptDescriptor* CTrackedClashedDescriptor::getConceptDescriptor() { return mConceptDescriptor; } CVariableBindingPath* CTrackedClashedDescriptor::getVariableBindingPath() { return mVarBindPath; } bool CTrackedClashedDescriptor::candidateTracking(bool* trackingError, bool* nominalOccured, cint64* maxBranchLevel, cint64* minIndividualLevel) { bool usingCandidate = false; if (mErrorFlag) { if (trackingError && !*trackingError) { *trackingError = true; usingCandidate = true; } } else { if (maxBranchLevel && *maxBranchLevel < mBranchingLevelTag) { *maxBranchLevel = mBranchingLevelTag; usingCandidate = true; } if (minIndividualLevel && *minIndividualLevel > mIndiNodeLevel) { *minIndividualLevel = mIndiNodeLevel; usingCandidate = true; } if (nominalOccured && mNominalIndiFlag && !*nominalOccured) { *nominalOccured = mNominalIndiFlag; usingCandidate = true; } } return usingCandidate; } bool CTrackedClashedDescriptor::isProcessedAfter(cint64 processingTag) { return mProcessingTag > processingTag; } CTrackedClashedDescriptor* CTrackedClashedDescriptor::append(CTrackedClashedDescriptor* trackedClashedDescriptor) { return (CTrackedClashedDescriptor*)CClashedDependencyDescriptor::append(trackedClashedDescriptor); } CTrackedClashedDescriptor* CTrackedClashedDescriptor::getNextDescriptor() { return (CTrackedClashedDescriptor*)getNext(); } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBinaryBase64DataValueSpaceHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBinaryBase64Da0000644000175000017500000000474612520551006032057 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEBINARYBASE64DATAVALUESPACEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEBINARYBASE64DATAVALUESPACEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CIndividualProcessNodeCompareValueSpaceHandler.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CIndividualProcessNodeBinaryBase64DataValueSpaceHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeBinaryBase64DataValueSpaceHandler : public CIndividualProcessNodeCompareValueSpaceHandler { // public methods public: //! Constructor CIndividualProcessNodeBinaryBase64DataValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEBINARYBASE64DATAVALUESPACEHANDLER_H ././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBinaryBase64DataValueSpaceHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBinaryBase64Da0000644000175000017500000000246012520551006032046 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeBinaryBase64DataValueSpaceHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualProcessNodeBinaryBase64DataValueSpaceHandler::CIndividualProcessNodeBinaryBase64DataValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType) : CIndividualProcessNodeCompareValueSpaceHandler(valueSpaceType) { } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationChooseTaskHandleAlgorithm.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationChooseTaskHandleAlgorith0000644000175000017500000000370112520756374032300 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationChooseTaskHandleAlgorithm.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CCalculationChooseTaskHandleAlgorithm::CCalculationChooseTaskHandleAlgorithm(CTaskHandleAlgorithm* tableauCompTaskHandleAlg, CTaskHandleAlgorithm* tableauApproxSaturTaskHandleAlg) { mTableauCompTaskHandleAlg = tableauCompTaskHandleAlg; mTableauApproxSaturTaskHandleAlg = tableauApproxSaturTaskHandleAlg; } bool CCalculationChooseTaskHandleAlgorithm::handleTask(CTaskProcessorContext *processorContext, CTask* task) { if (mTableauCompTaskHandleAlg && task->getTaskType() == CSatisfiableCalculationTask::CALCULATIONTABLEAUCOMPLETIONTASK) { return mTableauCompTaskHandleAlg->handleTask(processorContext,task); } else if (mTableauApproxSaturTaskHandleAlg && task->getTaskType() == CSatisfiableCalculationTask::CALCULATIONTABLEAUAPPROXIMATEDSATURATIONTASK) { return mTableauApproxSaturTaskHandleAlg->handleTask(processorContext,task); } return false; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationTableauCompletionTaskHandleAlgorithm.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationTableauCompletionTaskHan0000644000175000017500000407136012576064076032324 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationTableauCompletionTaskHandleAlgorithm.h" #ifdef KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED #define KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(a) #define KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION(a) #define KONCLUCE_TASK_ALGORITHM_TIME_MEASURE_INSTRUCTION(a) #else //#define KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(a) a #define KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(a) //#define KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION(a) a #define KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION(a) #define KONCLUCE_TASK_ALGORITHM_TIME_MEASURE_INSTRUCTION(a) a //#define KONCLUCE_TASK_ALGORITHM_TIME_MEASURE_INSTRUCTION(a) #endif namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CCalculationTableauCompletionTaskHandleAlgorithm::CCalculationTableauCompletionTaskHandleAlgorithm(CUnsatisfiableCacheHandler* unsatCacheHandler, CSatisfiableExpanderCacheHandler* satExpCacheHandler, CReuseCompletionGraphCacheHandler* reuseCompGraphCacheHandler, CSaturationNodeExpansionCacheHandler* satNodeExpCacheHandler, CComputedConsequencesCacheHandler* compConsCacheHandler, CIndividualNodeBackendCacheHandler* backendCacheHandler) { mConceptPriorityStrategy = new CConcreteConceptProcessingOperatorPriorityStrategy(); mIndiAncDepthMasConProcPriStr = new CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy(); //mTaskProcessingStrategy = new CEqualDepthTaskProcessingPriorityStrategy(); mTaskProcessingStrategy = new CEqualDepthCacheOrientatedProcessingPriorityStrategy(); mUnsatCachRetStrategy = new CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy(); mGroundingHandler = new CConceptNominalSchemaGroundingHandler(); mDatatypeHandler = new CDatatypeIndividualProcessNodeHandler(); mIncExpHandler = new CIncrementalCompletionGraphCompatibleExpansionHandler(); mProcessingDataBox = nullptr; mCalcAlgContext = nullptr; mClashDesFactory = new CClashDescriptorFactory(); mIndiNodeManager = new CIndividualNodeManager(); mDependencyFactory = new CDependencyFactory(); mSatExpCacheHandler = satExpCacheHandler; mUnsatCacheHandler = unsatCacheHandler; mSatNodeExpCacheHandler = satNodeExpCacheHandler; mReuseCompGraphCacheHandler = reuseCompGraphCacheHandler; mCompConsCacheHandler = compConsCacheHandler; mBackendCacheHandler = backendCacheHandler; mCompGraphCacheHandler = new CCompletionGraphCacheHandler(); mIndividualPriorityStrategy = mIndiAncDepthMasConProcPriStr; mPosJumpFuncVec = &mPosTableauRuleJumpFuncVec[mRuleFuncCount/2]; mNegJumpFuncVec = &mNegTableauRuleJumpFuncVec[mRuleFuncCount/2]; for (cint64 i = 0; i < mRuleFuncCount; ++i) { mPosTableauRuleJumpFuncVec[i] = nullptr; mNegTableauRuleJumpFuncVec[i] = nullptr; } mConfSpecializedAutomateRules = true; mConfSubSetBlocking = false; mConfOptimizedSubSetBlocking = true; mConfEqualSetBlocking = false; mConfPairwiseEqualSetBlocking = false; mConfAncestorBlockingSearch = false; mConfAnywhereBlockingSearch = false; mConfAnywhereBlockingCandidateHashSearch = false; mConfAnywhereBlockingLinkedCandidateHashSearch = true; mConfSaveCoreBlockingConceptsCandidates = true; mConfSemanticBranching = false; mConfAtomicSemanticBranching = true; mConfBranchTriggering = true; mConfStrictIndiNodeProcessing = true; mConfIDIndiPriorization = true; mConfPropagateNodeProcessed = false; mConfDirectRulePreprocessing = true; mConfLazyNewNominalGeneration = true; mConfConsRestrictedNonStrictIndiNodeProcessing = true; mConfUniqueNameAssumption = false; mConfBuildDependencies = true; mConfDependencyBacktracking = true; mConfDependencyBackjumping = true; mConfWriteUnsatCaching = true; mConfTestedConceptWriteUnsatCaching = true; mConfTestOccurUnsatCached = true; mConfTestPrecheckUnsatCached = true; mConfMinimizeMerging = true; mConfUnsatCachingUseFullNodeDependency = false; mConfUnsatCachingUseNodeSignatureSet = false; mConfSatExpCacheRetrieval = true; mConfSatExpCacheConceptExpansion = true; mConfSatExpCacheSatisfiableBlocking = true; mConfSatExpCacheWriting = true; mConfSignatureSaving = false; mConfSignatureMirroringBlocking = false; mConfSatExpCachedDisjAbsorp = true; mConfSatExpCachedMergAbsorp = true; mConfSatExpCachedSuccAbsorp = true; mConfAnywhereBlockingSomeInitializationHashing = false; mConfAnywhereBlockingLazyExactHashing = true; mConfSkipANDConcepts = false; mConfPairwiseMerging = false; mConfDepthOrientatedProcessing = true; mConfLateBlockingResolving = true; mConfUnsatBranchSatisfiableCaching = true; mConfAtleastAtmostFastClashCheck = true; mOptSignatureMirroringBlockingForceSubset = false; mOptSignatureMirroringBlockingInBlocking = false; mConfIndividualReusingFromSignatureBlocking = false; mConfCompGraphReuseCacheRetrieval = false; mConfCompGraphDeterministicReuse = true; mConfCompGraphNonDeterministicReuse = true; mConfRepresentativePropagationRules = true; mMapComparisonDirectLookupFactor = 20; mConfCurrentIndividualQueuing = false; mConfDebuggingWriteData = false; mConfExpandCreatedSuccessorsFromSaturation = true; mConfCachingBlockingFromSaturation = true; mConfExactNominalDependencyTracking = true; mConfSaturationCachingWithNominals = true; mConfConceptUnsatisfiabilitySaturatedTesting = false; mConfSaturationConceptUnsatisfiabilitySaturatedCacheWriting = true; mConfSaturationSatisfiabilitiyExpansionCacheWriting = false; mConfSaturationCachingTestingDuringBlockingTests = true; mConfSaturationExpansionCacheReading = true; mConfSaturationIncompleteExpansionFromCache = false; mConfDatatypeReasoning = true; mConfCompletionGraphCaching = true; mConfDelayCompletionGraphCachingReactivation = false; mConfCollectCachingUpdatedBlockableIndiNodes = true; mConfAddCachedComputedConsequences = true; mConfCacheComputedConsequences = true; mConfIndividualsBackendCacheLoading = true; mConfMergeConstructedIndividualNode = false; mIndiAncDepthMasConProcPriStr->configureStrategy(mConfStrictIndiNodeProcessing,mConfIDIndiPriorization); mPosJumpFuncVec[CCTOP] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCBOTTOM] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBOTTOMRule; mPosJumpFuncVec[CCAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCAQAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCIMPLAQAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCBRANCHAQAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyANDRule; if (mConfSpecializedAutomateRules) { mPosJumpFuncVec[CCAQAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyAutomatANDRule; mPosJumpFuncVec[CCIMPLAQAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyAutomatANDRule; mPosJumpFuncVec[CCBRANCHAQAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyAutomatANDRule; } mPosJumpFuncVec[CCDATATYPE] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyDATATYPERule; mNegJumpFuncVec[CCDATATYPE] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyDATATYPERule; mPosJumpFuncVec[CCDATALITERAL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyDATALITERALRule; mNegJumpFuncVec[CCDATALITERAL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyDATALITERALRule; mPosJumpFuncVec[CCDATARESTRICTION] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyDATARESTRICTIONRule; mNegJumpFuncVec[CCDATARESTRICTION] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyDATARESTRICTIONRule; mPosJumpFuncVec[CCSUB] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCEQ] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCOR] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyORRule; mPosJumpFuncVec[CCALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyALLRule; mPosJumpFuncVec[CCAQALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyALLRule; mPosJumpFuncVec[CCIMPLAQALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyALLRule; mPosJumpFuncVec[CCBRANCHAQALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyALLRule; mPosJumpFuncVec[CCSOME] = &CCalculationTableauCompletionTaskHandleAlgorithm::applySOMERule; mPosJumpFuncVec[CCAQSOME] = &CCalculationTableauCompletionTaskHandleAlgorithm::applySOMERule; mPosJumpFuncVec[CCAQCHOOCE] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyAutomatChooseRule; mPosJumpFuncVec[CCNOT] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyNegANDRule; mPosJumpFuncVec[CCSELF] = &CCalculationTableauCompletionTaskHandleAlgorithm::applySELFRule; mPosJumpFuncVec[CCATLEAST] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyATLEASTRule; mPosJumpFuncVec[CCATMOST] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyATMOSTRule; mPosJumpFuncVec[CCNOMINAL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyNOMINALRule; mPosJumpFuncVec[CCVALUE] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVALUERule; mPosJumpFuncVec[CCIMPL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyIMPLICATIONRule; mPosJumpFuncVec[CCIMPLTRIG] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCBRANCHTRIG] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCIMPLALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyALLRule; mPosJumpFuncVec[CCBRANCHALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyALLRule; mNegJumpFuncVec[CCAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyORRule; mNegJumpFuncVec[CCOR] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyANDRule; mNegJumpFuncVec[CCEQ] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyORRule; mNegJumpFuncVec[CCALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applySOMERule; mNegJumpFuncVec[CCNOT] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyNegANDRule; mNegJumpFuncVec[CCSOME] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyALLRule; mNegJumpFuncVec[CCAQCHOOCE] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyAutomatChooseRule; mNegJumpFuncVec[CCSELF] = &CCalculationTableauCompletionTaskHandleAlgorithm::applySELFRule; mNegJumpFuncVec[CCATMOST] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyATLEASTRule; mNegJumpFuncVec[CCATLEAST] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyATMOSTRule; mNegJumpFuncVec[CCNOMINAL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyNOMINALRule; mNegJumpFuncVec[CCVALUE] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVALUERule; mPosJumpFuncVec[CCPBINDVARIABLE] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDVARIABLERule; mPosJumpFuncVec[CCPBINDTRIG] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEANDRule; mPosJumpFuncVec[CCPBINDAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEANDRule; mPosJumpFuncVec[CCPBINDAQAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEANDRule; mPosJumpFuncVec[CCPBINDIMPL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEIMPLICATIONRule; mPosJumpFuncVec[CCPBINDALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEALLRule; mPosJumpFuncVec[CCPBINDAQALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEALLRule; mPosJumpFuncVec[CCPBINDCYCLE] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATECYCLERule; mPosJumpFuncVec[CCPBINDGROUND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEGROUNDINGRule; mNegJumpFuncVec[CCPBINDGROUND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEGROUNDINGRule; mPosJumpFuncVec[CCVARBINDVARIABLE] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDVARIABLERule; mPosJumpFuncVec[CCVARBINDTRIG] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARIABLEBINDINGANDRule; mPosJumpFuncVec[CCVARBINDAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARIABLEBINDINGANDRule; mPosJumpFuncVec[CCVARBINDAQAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARIABLEBINDINGANDRule; mPosJumpFuncVec[CCVARBINDIMPL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEIMPLICATIONRule; mPosJumpFuncVec[CCVARBINDALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEALLRule; mPosJumpFuncVec[CCVARBINDAQALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEALLRule; mPosJumpFuncVec[CCVARBINDJOIN] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEJOINRule; mPosJumpFuncVec[CCVARBINDGROUND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEGROUNDINGRule; mNegJumpFuncVec[CCVARBINDGROUND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEGROUNDINGRule; if (mConfRepresentativePropagationRules) { mPosJumpFuncVec[CCVARBINDVARIABLE] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEBINDVARIABLERule; mPosJumpFuncVec[CCVARBINDTRIG] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEANDRule; mPosJumpFuncVec[CCVARBINDAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEANDRule; mPosJumpFuncVec[CCVARBINDAQAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEANDRule; mPosJumpFuncVec[CCVARBINDIMPL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEIMPLICATIONRule; mPosJumpFuncVec[CCVARBINDALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEALLRule; mPosJumpFuncVec[CCVARBINDAQALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEALLRule; mPosJumpFuncVec[CCVARBINDJOIN] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEJOINRule; mPosJumpFuncVec[CCVARBINDGROUND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEGROUNDINGRule; mNegJumpFuncVec[CCVARBINDGROUND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEGROUNDINGRule; } mPosJumpFuncVec[CCBACKACTIVTRIG] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEANDFLAGALLRule; mPosJumpFuncVec[CCVARPBACKTRIG] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEANDRule; mPosJumpFuncVec[CCVARPBACKALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEALLRule; mPosJumpFuncVec[CCVARPBACKAQAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEANDRule; mPosJumpFuncVec[CCVARPBACKAQALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEALLRule; mPosJumpFuncVec[CCBACKACTIVIMPL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEIMPLICATIONRule; mLastConfig = nullptr; mAppliedALLRuleCount = 0; mAppliedSOMERuleCount = 0; mAppliedANDRuleCount = 0; mAppliedORRuleCount = 0; mAppliedATLEASTRuleCount = 0; mAppliedATMOSTRuleCount = 0; mAppliedTOTALRuleCount = 0; mStatVarBindingCreatedCount = 0; mStatVarBindingGroundingCount = 0; mStatVarBindingImplicationCount = 0; mStatVarBindingJoinCombinesCount = 0; mStatVarBindingPropagateSuccCount = 0; mStatVarBindingPropagateSuccFreshCount = 0; mStatVarBindingPropagateSuccInitialCount = 0; mStatVarBindingPropagateCount = 0; mStatVarBindingPropagateFreshCount = 0; mStatVarBindingPropagateInitialCount = 0; mStatRepresentativeCreatedCount = 0; mStatRepresentativeGroundingCount = 0; mStatRepresentativeImplicationCount = 0; mStatRepresentativeJoinCombinesCount = 0; mStatRepresentativePropagateSuccCount = 0; mStatRepresentativePropagateCount = 0; mStatRepresentativePropagateNewRepresentativeCount = 0; mStatRepresentativePropagateReusedRepresentativeCount = 0; mStatRepresentativePropagateUseRepresentativeCount = 0; mStatRepresentativeJoinCount = 0; mStatRepresentativeJoinedCount = 0; mStatRepresentativeJoinQuickFailCount = 0; mStatBackPropActivationCount = 0; mCurrentRecProcDepth = 0; mCurrentRecProcDepthLimit = 300; mMaxBlockingCachingSavedCandidateCount = 50; //bool debug = true; //if (debug) { // QStringList debugStringList; // QFile debugTestFile("debugStop.txt"); // if (debugTestFile.open(QIODevice::ReadOnly)) { // while (!debugTestFile.atEnd()) { // QByteArray lineArray(debugTestFile.readLine()); // debugStringList.append(QString(lineArray)); // } // } // foreach (const QString& debugTestString, debugStringList) { // QString testString(debugTestString); // testString = testString.remove("^"); // testString = testString.remove("0"); // testString = testString.remove("1"); // testString = testString.remove("2"); // testString = testString.remove("3"); // testString = testString.remove("4"); // testString = testString.remove("5"); // testString = testString.remove("6"); // testString = testString.remove("7"); // testString = testString.remove("8"); // testString = testString.remove("9"); // testString = testString.trimmed(); // mCriticalConceptSetStringSet.insert(testString); // } // mFoundCriticalConceptSet = false; //} //mCriticalConceptSetStringSet.insert("¬ := ¬ ( ALL http://www.owllink.org/testsuite/galen#hasState. ¬~http://www.owllink.org/testsuite/galen#actuallyHollow) ^"); //mCriticalConceptSetStringSet.insert(" := (~http://www.owllink.org/testsuite/galen#Topology AND ¬ ( ALL http://www.owllink.org/testsuite/galen#hasState. ¬~http://www.owllink.org/testsuite/galen#actuallyHollow) ) ^"); //mCriticalConceptSetStringSet.insert("¬ := ¬ ( ALL http://www.owllink.org/testsuite/galen#hasState. ¬~http://www.owllink.org/testsuite/galen#trulyHollow) ^"); //mCriticalConceptSetStringSet.insert("~http://www.owllink.org/testsuite/galen#Feature ^"); //mCriticalConceptSetStringSet.insert("~http://www.owllink.org/testsuite/galen#StructuralFeature ^"); //mCriticalConceptSetStringSet.insert("~http://www.owllink.org/testsuite/galen#Morphology ^"); //mCriticalConceptSetStringSet.insert("~http://www.owllink.org/testsuite/galen#Appearance ^"); //mCriticalConceptSetStringSet.insert("~http://www.owllink.org/testsuite/galen#Topology ^"); //mCriticalConceptSetStringSet.insert(" := (~http://www.owllink.org/testsuite/galen#Topology AND ¬ ( ALL http://www.owllink.org/testsuite/galen#hasState. ¬~http://www.owllink.org/testsuite/galen#trulyHollow) ) ^"); //mCriticalConceptSetStringSet.insert("~http://www.owllink.org/testsuite/galen#TopCategory ^"); //mCriticalConceptSetStringSet.insert("~http://www.owllink.org/testsuite/galen#DomainCategory ^"); //mCriticalConceptSetStringSet.insert("~http://www.owllink.org/testsuite/galen#ModifierConcept ^"); //mCriticalConceptSetStringSet.insert("~http://www.owllink.org/testsuite/galen#Aspect ^"); //mCriticalConceptSetStringSet.insert("~http://www.owllink.org/testsuite/galen#Status ^"); //mCriticalConceptSetStringSet.insert("~http://www.owllink.org/testsuite/galen#AbstractStatus ^"); //mCriticalConceptSetStringSet.insert("~http://www.owllink.org/testsuite/galen#CountabilityStatus ^"); //mCriticalConceptSetStringSet.insert("~http://www.owllink.org/testsuite/galen#StomachToDuodenum"); for (cint64 i = 0; i < mDebugTaskIDVectorSize; ++i) { mDebugTaskIDVector[i] = 0; } mBacktrackingStep = 0; mFoundCriticalConceptSet = false; mDebug = false; mBacktrackDebug = true; mNominalMerged = false; mNominalMergedCount = 0; mOverJumpedNonDeterministicDecisionCount = 0; mRelevantNonDeterministicDecisionCount = 0; } CCalculationTableauCompletionTaskHandleAlgorithm::~CCalculationTableauCompletionTaskHandleAlgorithm() { delete mConceptPriorityStrategy; } void CCalculationTableauCompletionTaskHandleAlgorithm::readCalculationConfig(CSatisfiableCalculationTask* satCalcTask) { CCalculationConfigurationExtension *config = satCalcTask->getCalculationConfiguration(); if (config != mLastConfig) { if (config) { mConfSpecializedAutomateRules = config->isSpecializedAutomateRuleActivated(); mConfSubSetBlocking = config->isSubSetBlockingActivated(); mConfOptimizedSubSetBlocking = config->isOptimizedBlockingActivated(); mConfEqualSetBlocking = config->isEqualSetBlockingActivated(); mConfPairwiseEqualSetBlocking = config->isPairwiseEqualSetBlockingActivated(); mConfAncestorBlockingSearch = config->isAncestorBlockingSearchActivated(); mConfAnywhereBlockingSearch = config->isAnywhereBlockingSearchActivated(); mConfAnywhereBlockingCandidateHashSearch = config->isAnywhereBlockingCandidateHashSearchActivated(); mConfSemanticBranching = config->isSemanticBranchingActivated(); mConfAtomicSemanticBranching = config->isAtomicSemanticBranchingActivated(); mConfBranchTriggering = config->isBranchTriggeringActivated(); mConfStrictIndiNodeProcessing = config->isStrictIndiNodeProcessingActivated(); mConfIDIndiPriorization = config->isIDIndiPriorizationActivated(); mConfPropagateNodeProcessed = config->isPropagateNodeProcessedActivated(); mConfDirectRulePreprocessing = config->isDirectRulePreprocessingActivated(); mConfLazyNewNominalGeneration = config->isLazyNewNominalCreationActivated(); mConfConsRestrictedNonStrictIndiNodeProcessing = config->isConsistenceRestrictedNonStictProcessingActivated(); mConfUniqueNameAssumption = config->isUniqueNameAssumptionActivated(); mConfDependencyBacktracking = config->isDependencyTrackingActivated(); mConfBuildDependencies = mConfDependencyBacktracking; mConfDependencyBackjumping = config->isBackjumpingActivated(); mConfWriteUnsatCaching = config->isSingleLevelUnsatisfiableCacheWritingActivated(); mConfTestedConceptWriteUnsatCaching = config->isTestedConceptUnsatisfiableCacheWritingActivated(); mConfTestOccurUnsatCached = config->isUnsatisfiableCacheRetrievalActivated(); mConfTestPrecheckUnsatCached = mConfTestOccurUnsatCached; mConfMinimizeMerging = config->isMinimizeMergingBranchesActivated(); mConfSatExpCacheRetrieval = config->isSatisfiableExpansionCacheRetrievalActivated(); mConfSatExpCacheConceptExpansion = config->isSatisfiableExpansionCacheConceptExpansionActivated(); mConfSatExpCacheSatisfiableBlocking = config->isSatisfiableExpansionCacheSatisfiableBlockingActivated(); mConfSatExpCacheWriting = config->isSatisfiableExpansionCacheWritingActivated(); mConfSignatureSaving = config->isSignatureSavingActivated(); mConfSignatureMirroringBlocking = config->isSignatureMirroringBlockingActivated(); mConfUnsatCachingUseFullNodeDependency = config->isUnsatisfiableCachingFullDependencyActivated(); mConfUnsatCachingUseNodeSignatureSet = config->isUnsatisfiableCachingFullSignatureActivated(); mConfPairwiseMerging = config->isPairwiseMergingActivated(); mConfCompGraphReuseCacheRetrieval = config->isCompletionGraphReuseCachingRetrievalActivated(); mConfCompGraphDeterministicReuse = config->isCompletionGraphDeterministicReuseActivated(); mConfCompGraphNonDeterministicReuse = config->isCompletionGraphNonDeterministicReuseActivated(); mConfAnywhereBlockingLinkedCandidateHashSearch = config->isAnywhereBlockingCoreConceptCandidateHashSearchActivated(); mConfRepresentativePropagationRules = config->isRepresentativePropagationActivated(); mConfDebuggingWriteData = config->isDebuggingWriteDataActivated(); mConfExpandCreatedSuccessorsFromSaturation = config->isSuccessorConceptSaturationExpansionActivated(); mConfCachingBlockingFromSaturation = config->isSaturationCachingActivated(); mConfSaturationCachingWithNominals = config->isSaturationCachingWithNominalsByReactivationActivated(); mConfSaturationConceptUnsatisfiabilitySaturatedCacheWriting = config->isSaturationUnsatisfiabilityCacheWritingActivated(); mConfSaturationSatisfiabilitiyExpansionCacheWriting = config->isSaturationExpansionSatisfiabilityCacheWritingActivated(); mConfDatatypeReasoning = config->isDatatypeReasoningActivated(); mConfCompletionGraphCaching = config->isCompletionGraphCachingActivated(); mConfDelayCompletionGraphCachingReactivation = config->isDelayedCompletionGraphCachingReactivationActivated(); mConfIndividualsBackendCacheLoading = config->isIndividualsBackendCacheLoadingActivated(); mConfAddCachedComputedConsequences = config->isComputedTypesCachingActivated(); mConfMergeConstructedIndividualNode = config->isConstructionIndividualNodeMergingActivated(); mCurrentRecProcDepthLimit = config->getMaximumRecursiveProcessingConceptCount(); } else { mConfCompletionGraphCaching = true; mConfDelayCompletionGraphCachingReactivation = false; mConfSpecializedAutomateRules = true; mConfSubSetBlocking = false; mConfOptimizedSubSetBlocking = true; mConfEqualSetBlocking = false; mConfPairwiseEqualSetBlocking = false; mConfAncestorBlockingSearch = false; mConfAnywhereBlockingSearch = false; mConfAnywhereBlockingCandidateHashSearch = false; mConfAnywhereBlockingLinkedCandidateHashSearch = true; mConfSemanticBranching = false; mConfAtomicSemanticBranching = true; mConfBranchTriggering = true; mConfStrictIndiNodeProcessing = true; mConfIDIndiPriorization = true; mConfPropagateNodeProcessed = false; mConfDirectRulePreprocessing = true; mConfLazyNewNominalGeneration = true; mConfConsRestrictedNonStrictIndiNodeProcessing = true; mConfUniqueNameAssumption = false; mConfBuildDependencies = true; mConfDependencyBacktracking = true; mConfDependencyBackjumping = true; mConfWriteUnsatCaching = true; mConfTestedConceptWriteUnsatCaching = true; mConfTestOccurUnsatCached = true; mConfTestPrecheckUnsatCached = true; mConfMinimizeMerging = true; mConfSatExpCacheRetrieval = true; mConfSatExpCacheConceptExpansion = true; mConfSatExpCacheSatisfiableBlocking = true; mConfSatExpCacheWriting = true; mConfSignatureSaving = false; mConfSignatureMirroringBlocking = false; mConfUnsatCachingUseFullNodeDependency = false; mConfUnsatCachingUseNodeSignatureSet = false; mConfCompGraphReuseCacheRetrieval = false; mConfCompGraphDeterministicReuse = true; mConfCompGraphNonDeterministicReuse = true; mConfRepresentativePropagationRules = true; mConfDebuggingWriteData = false; mConfExpandCreatedSuccessorsFromSaturation = true; mConfCachingBlockingFromSaturation = true; mConfSaturationCachingWithNominals = true; mConfSaturationConceptUnsatisfiabilitySaturatedCacheWriting = true; mConfSaturationSatisfiabilitiyExpansionCacheWriting = false; mConfDatatypeReasoning = true; mConfIndividualsBackendCacheLoading = true; mConfAddCachedComputedConsequences = true; mConfMergeConstructedIndividualNode = false; mCurrentRecProcDepthLimit = 300; } mLastConfig = config; mConfCollectCachingUpdatedBlockableIndiNodes = mConfCompletionGraphCaching; mPosJumpFuncVec[CCAQAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyANDRule; if (mConfSpecializedAutomateRules) { mPosJumpFuncVec[CCAQAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyAutomatANDRule; } if (mConfRepresentativePropagationRules) { mPosJumpFuncVec[CCVARBINDVARIABLE] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEBINDVARIABLERule; mPosJumpFuncVec[CCVARBINDTRIG] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEANDRule; mPosJumpFuncVec[CCVARBINDAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEANDRule; mPosJumpFuncVec[CCVARBINDAQAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEANDRule; mPosJumpFuncVec[CCVARBINDIMPL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEIMPLICATIONRule; mPosJumpFuncVec[CCVARBINDALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEALLRule; mPosJumpFuncVec[CCVARBINDAQALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEALLRule; mPosJumpFuncVec[CCVARBINDJOIN] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEJOINRule; mPosJumpFuncVec[CCVARBINDGROUND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEGROUNDINGRule; mNegJumpFuncVec[CCVARBINDGROUND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEGROUNDINGRule; } else { mPosJumpFuncVec[CCVARBINDVARIABLE] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDVARIABLERule; mPosJumpFuncVec[CCVARBINDTRIG] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARIABLEBINDINGANDRule; mPosJumpFuncVec[CCVARBINDAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARIABLEBINDINGANDRule; mPosJumpFuncVec[CCVARBINDAQAND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARIABLEBINDINGANDRule; mPosJumpFuncVec[CCVARBINDIMPL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEIMPLICATIONRule; mPosJumpFuncVec[CCVARBINDALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEALLRule; mPosJumpFuncVec[CCVARBINDAQALL] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEALLRule; mPosJumpFuncVec[CCVARBINDJOIN] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEJOINRule; mPosJumpFuncVec[CCVARBINDGROUND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEGROUNDINGRule; mNegJumpFuncVec[CCVARBINDGROUND] = &CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEGROUNDINGRule; } } bool consPrepProcessing = satCalcTask->getConsistenceAdapter() != nullptr && satCalcTask->getTaskDepth() <= 0; mConfSaveCoreBlockingConceptsCandidates = mConfAnywhereBlockingLinkedCandidateHashSearch; mOptIncrementalExpansion = false; mOptIncrementalDeterministicExpansion = false; mOptIncrementalNondeterministicExpansion = false; mOptIncrementalCompatibleExpansion = false; mOptIncrementalCachingExpansion = false; if (satCalcTask->getSatisfiableTaskIncrementalConsistencyTestingAdapter()) { mOptIncrementalCompatibleExpansion = !satCalcTask->getProcessingDataBox()->isIncrementalExpansionCompatibleMerged(); mOptIncrementalCachingExpansion = !mOptIncrementalCompatibleExpansion; mOptIncrementalExpansion = true; if (satCalcTask->getTaskDepth() <= 0) { consPrepProcessing = true; mOptIncrementalDeterministicExpansion = true; } else { mOptIncrementalNondeterministicExpansion = true; } } mOptConsistenceNodeMarking = consPrepProcessing && mConfConsRestrictedNonStrictIndiNodeProcessing; mOptDetExpPreporcessing = consPrepProcessing; //mOptProcessedNodePropagation = mConfPropagateNodeProcessed || !mConfStrictIndiNodeProcessing; //mOptProcessedConsNodePropagation = mConfConsRestrictedNonStrictIndiNodeProcessing; //mOptProcessingBlockingTests = !mConfStrictIndiNodeProcessing; //mOptConsNodeProcessingBlockingTests = mConfConsRestrictedNonStrictIndiNodeProcessing; //mOptNonStrictIndiNodeProcessing = !mConfStrictIndiNodeProcessing || consPrepProcessing && mConfConsRestrictedNonStrictIndiNodeProcessing; //mIndiAncDepthMasConProcPriStr->configureStrategy(!mOptNonStrictIndiNodeProcessing,mConfIDIndiPriorization); mOptNonStrictIndiNodeProcessing = true; } CCalculationAlgorithmContextBase* CCalculationTableauCompletionTaskHandleAlgorithm::createCalculationAlgorithmContext(CTaskProcessorContext *processorContext, CProcessContext* processContext, CSatisfiableCalculationTask* satCalcTask) { CCalculationAlgorithmContextBase* calcAlgContext = CObjectAllocator< CCalculationAlgorithmContextBase >::allocateAndConstruct(processContext->getUsedMemoryAllocationManager()); calcAlgContext->initTaskProcessContext(processContext,satCalcTask); calcAlgContext->initCalculationAlgorithmContext(processorContext,mConceptPriorityStrategy,mIndividualPriorityStrategy,mTaskProcessingStrategy,mUnsatCachRetStrategy, mIndiNodeManager,mClashDesFactory,mDependencyFactory,mUnsatCacheHandler,mSatExpCacheHandler,mSatNodeExpCacheHandler); return calcAlgContext; } bool CCalculationTableauCompletionTaskHandleAlgorithm::handleTask(CTaskProcessorContext *processorContext, CTask* task) { //lastBranchingMergingProcRest = nullptr; CTaskHandleMemoryAllocationManager* processorMemoryManager = processorContext->getTaskHandleMemoryAllocationManager(); CTaskProcessorCommunicator* processorCommunicator = processorContext->getTaskProcessorCommunicator(); CTaskHandleMemoryAllocationManager* taskHandleMemMan = processorContext->getTaskHandleMemoryAllocationManager(); taskHandleMemMan->releaseAllMemory(); CSatisfiableCalculationTask* satCalcTask = dynamic_cast(task); if (satCalcTask) { if (!processorCommunicator->verifyContinueTaskProcessing(satCalcTask)) { if (!satCalcTask->getTaskStatus()->isProcessable()) { processorCommunicator->communicateTaskComplete(satCalcTask); return false; } else { // continue later return true; } } readCalculationConfig(satCalcTask); mLastUnsatCacheTestedIndiNode = nullptr; CProcessContext* processContext = satCalcTask->getProcessContext(processorContext); CCalculationAlgorithmContextBase* calcAlgContext = createCalculationAlgorithmContext(processorContext,processContext,satCalcTask); mCalcAlgContext = calcAlgContext; mProcessingDataBox = satCalcTask->getProcessingDataBox(); bool clashed = false; bool satisfiable = false; bool completed = false; bool paused = false; bool error = false; cint64 errorCode = 0; CProcessTagger* processTagger = calcAlgContext->getUsedProcessTagger(); CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CNodeSwitchHistory* nodeSwitchHistory = processingDataBox->getNodeSwitchHistory(true); mProcessingQueue = nullptr; mDepthFirstProcessingQueue = nullptr; mSigBlockRevSet = nullptr; mReusingReviewData = nullptr; mIndiImmediateProQueue = nullptr; mIndiDetExpProQueue = nullptr; mIndiDetDeptFirstExpProQueue = nullptr; mValueSpaceTriggeringProQueue = nullptr; mValueSpaceSatCheckingQueue = nullptr; mNominalProcessingQueue = nullptr; mDepthProcessingQueue = nullptr; mEarlyIndiReactProcessingQueue = nullptr; mLateIndiReactProcessingQueue = nullptr; mIndiBlockReactProQueue = nullptr; mIndiSigBlockUpdProQueue = nullptr; mDelayedNominalProcessingQueue = nullptr; mVarBindConBatchProcessingQueue = nullptr; mRoleAssertionProcessingQueue = nullptr; mIncrementalExpansionInitializingProcessingQueue = nullptr; mIncrementalExpansionProcessingQueue = nullptr; mIncrementalCompatibilityCheckingQueue = nullptr; mMinConceptProcessingPriorityLevel = 0; mIndiNodeConcludeUnsatCaching = false; //CSatisfiableTaskClassificationMessageAdapter* adapter = satCalcTask->getClassificationMessageAdapter(); //if (adapter) { // CConcept* concept = adapter->getTestingConcept(); // if (concept && adapter->hasExtractionFlags(CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTSUBSUMERSROOTNODE)) { // QString className = CIRIName::getRecentIRIName(concept->getClassNameLinker()); // if (className == "http://reference.data.gov.uk/def/intervals/CalendarYear") { // bool bug = true; // } // } //} if (satCalcTask->getSatisfiableTaskIncrementalConsistencyTestingAdapter()) { if (!processingDataBox->isIncrementalExpansionInitialised()) { mIncrementalCompatibilityCheckingQueue = processingDataBox->getIncrementalCompatibilityCheckingQueue(true); CIndividualUnsortedProcessingQueue* indiNodeQueue = processingDataBox->getIndividualImmediatelyProcessingQueue(true); for (CXLinker* indiNodeLinkerIt = indiNodeQueue->getProcessIndividualNodeLinker(); indiNodeLinkerIt; indiNodeLinkerIt = indiNodeLinkerIt->getNext()) { CIndividualProcessNode* indiNode = indiNodeLinkerIt->getData(); CIndividualProcessNode* locIndiNode = getLocalizedIndividual(indiNode,true,calcAlgContext); locIndiNode->getIncrementalExpansionData(true)->setDirectlyChanged(true); locIndiNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFINCREMENTALEXPANDING | CIndividualProcessNode::PRFINCREMENTALEXPANSIONRETESTDUEDIRECTMODIFIED); locIndiNode->setIncrementalExpansionID(calcAlgContext->getProcessingDataBox()->getIncrementalExpansionID()); mIncrementalCompatibilityCheckingQueue->insertProcessIndiviudal(locIndiNode); } processingDataBox->setIncrementalExpansionInitialised(true); } } if (processingDataBox->isReapplicationLastConceptDesciptorOnLastIndividualNodeRequired()) { CIndividualProcessNode* lastProcessingIndiNode = nullptr; CConceptProcessDescriptor* lastProcessingConDes = nullptr; if (processingDataBox->getLastProcessingIndividualNodeAndConceptDescriptor(lastProcessingIndiNode,lastProcessingConDes)) { addCopiedConceptToProcessingQueue(lastProcessingConDes,lastProcessingIndiNode,calcAlgContext); } processingDataBox->setReapplicationLastConceptDesciptorOnLastIndividualNodeRequired(false); } CIndividualProcessNode* indiProcNode = takeNextProcessIndividual(calcAlgContext); CConceptProcessDescriptor* conProcDes = nullptr; mCurrentRecProcDepth = 0; mProcessRuleToTaskProcessingVerificationCount = 80; mRemainProcessRuleToTaskProcessingVerification = mProcessRuleToTaskProcessingVerificationCount; KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mBeginTaskDebugIndiModelString = generateDebugIndiModelStringList(calcAlgContext)); CIndividualProcessNode* lastIndiProcNode = nullptr; try { STATINC(TASKPROCESSCHANGECOUNT,mCalcAlgContext); while (indiProcNode) { lastIndiProcNode = indiProcNode; conProcDes = nullptr; // TODO: signature cached, but empty processing queue //CConceptProcessingQueue* prevConProcQueue = indiProcNode->getConceptProcessingQueue(false); //if (!prevConProcQueue || !prevConProcQueue->isEmpty()) { if (true) { processTagger->incNodeSwitchTag(); nodeSwitchHistory->addIndividualProcessNodeSwitch(indiProcNode,processTagger->getCurrentNodeSwitchTag()); mCalcAlgContext->setMinModificationIndividual(indiProcNode); STATINC(INDIVIDUALNODESWITCHCOUNT,mCalcAlgContext); //testCompletionGraphCachingAndBlocking(calcAlgContext); // initialize individual if (individualNodeInitializing(indiProcNode,calcAlgContext)) { bool continueProcessingIndividual = continueIndividualProcessing(indiProcNode,calcAlgContext); while (continueProcessingIndividual) { CConceptProcessingQueue* conProcQueue = indiProcNode->getConceptProcessingQueue(true); conProcDes = conProcQueue->takeNextConceptDescriptorProcess(); processingDataBox->setLastProcessingIndividualNodeAndConceptDescriptor(indiProcNode,conProcDes); // process concept mCurrentRecProcDepth = 0; ++mAppliedTOTALRuleCount; STATINC(RULEAPPLICATIONCOUNT,mCalcAlgContext); KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mBeforeRuleTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext)); KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mBeforeRuleDebugIndiModelString = generateDebugIndiModelStringList(calcAlgContext)); continueProcessingIndividual = tableauRuleProcessing(indiProcNode,conProcDes,mCalcAlgContext); KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mAfterRuleDebugIndiModelString = generateDebugIndiModelStringList(calcAlgContext)); if (continueProcessingIndividual) { continueProcessingIndividual = continueIndividualProcessing(indiProcNode,calcAlgContext); } else { addConceptToProcessingQueue(conProcDes,conProcQueue,indiProcNode,calcAlgContext); } if (--mRemainProcessRuleToTaskProcessingVerification <= 0) { mRemainProcessRuleToTaskProcessingVerification = mProcessRuleToTaskProcessingVerificationCount; if (!processorCommunicator->verifyContinueTaskProcessing(satCalcTask)) { STATINC(TASKPROCESSPAUSECOUNT,mCalcAlgContext); paused = true; calcAlgContext->setCurrentIndividualNode(nullptr); addIndividualToProcessingQueue(indiProcNode,calcAlgContext); throw CCalculationStopProcessingException(false); } } } individualNodeConclusion(indiProcNode,calcAlgContext); } if (mCalcAlgContext->isMinModificationUpdated()) { // update history nodeSwitchHistory->updateLastIndividualProcessNodeSwitch(mCalcAlgContext->getMinModificationAncestorDepth(),mCalcAlgContext->getMinModificationIndividualID()); } } indiProcNode = takeNextProcessIndividual(calcAlgContext); } if (mOptIncrementalExpansion && !mProcessingDataBox->isIncrementalExpansionCachingMerged()) { incrementalMergeWithPreviousNondeterministicCompletionGraph(calcAlgContext); mProcessingDataBox->setIncrementalExpansionCachingMerged(true); } //if (task->getTaskDepth() < 100) { // CSatisfiableCalculationTask* tasks = createDependendBranchingTaskList(2,calcAlgContext); // processorCommunicator->communicateTaskCreation(tasks); // //throw CCalculationStopProcessingException(true); // completed = true; //} else { // //CClashedConceptDescriptor* clashDes = CObjectAllocator::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); // //throw clashDes; // clashed = true; //} KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mSatTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext)); satisfiable = true; //lastBranchingMergingProcRest = lastBranchingMergingProcRest; //if (lastBranchingMergingProcRest) { // lastBranchingMergingProcRest->printIndividualContainer(); //} //analyzeCompletionGraphStatistics(calcAlgContext); //writeCompletionGraphStatistics(calcAlgContext); //testCompletionGraphCachingAndBlocking(calcAlgContext); } catch (const CClashedConceptDescriptor*& clashConLinker) { clashed = true; KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mClashedDebugIndiModelString = generateDebugIndiModelStringList(calcAlgContext)); } catch (const CCalculationClashProcessingException& calcClashProcException) { clashed = true; CClashedDependencyDescriptor* clashConLinker = calcClashProcException.getClashedDependencyDescriptor(); KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mClashedDebugIndiModelString = generateDebugIndiModelStringList(calcAlgContext)); //mClashedDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); //QFile file = QString("clashed-model.txt"); //if (file.open(QIODevice::WriteOnly)) { // file.write(mClashedDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); //} if (mConfDependencyBacktracking) { clashedBacktracking(clashConLinker,calcAlgContext); } } catch (const CCalculationStopProcessingException& calcStopProcException) { if (calcStopProcException.isTaskCompletedProcessed()) { completed = true; } } catch (const CCalculationErrorProcessingException& calcErrorProcException) { if (calcErrorProcException.hasError()) { error = true; errorCode = (cint64)calcErrorProcException.getErrorCode(); LOG(ERROR,"::Konclude::Reasoner::Kernel::Algorithm::TableauCompletionAlgorihm",logTr("Error occured, computation stopped."),this); } } catch (const CMemoryAllocationException& memAllocException) { error = true; errorCode = 2; } catch (...) { error = true; errorCode = 3; } KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mEndTaskDebugIndiModelString = generateDebugIndiModelStringList(calcAlgContext)); bool xDebug = false; if (xDebug || mConfDebuggingWriteData) { CSatisfiableTaskClassificationMessageAdapter* adapter = satCalcTask->getClassificationMessageAdapter(); if (adapter && satisfiable) { mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); CConcept* concept = adapter->getTestingConcept(); if (concept && adapter->hasExtractionFlags(CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTSUBSUMERSROOTNODE)) { QString className = CIRIName::getRecentIRIName(concept->getClassNameLinker()); if (className.contains("/")) { className = className.mid(className.lastIndexOf("/")+1); } QFile file(QString("./SATCT/%1.txt").arg(className)); if (file.open(QIODevice::WriteOnly)) { file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); file.close(); } } } else { if (mDebug || satisfiable /*|| satCalcTask->getTaskDepth() <= 0*/) { mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); QString satStopString = QString("stopped"); if (satisfiable) { satStopString = QString("satisfied"); } if (clashed) { satStopString = QString("clashed"); } QString incExpAffix; if (satCalcTask->getSatisfiableTaskIncrementalConsistencyTestingAdapter()) { incExpAffix = QString("-inc-exp-%1").arg(mProcessingDataBox->getIncrementalExpansionID()); } QFile file(QString("./SATCT/Tasks/task-%1-%2%4-%3.txt").arg(satCalcTask->getTaskDepth()).arg(satCalcTask->getTaskID()).arg(satStopString).arg(incExpAffix)); if (file.open(QIODevice::WriteOnly)) { file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); file.close(); } } } //mEndTaskDebugIndiModelString = generateDebugIndiModelStringList(calcAlgContext); } //if (satisfiable) { // QString modelString = generateDebugIndiModelStringList(calcAlgContext); // if (modelString.indexOf("http://www.owllink.org/testsuite/galen#Haem") != -1) { // QString extModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // CIndividualProcessNodeVector* indiVec = mProcessingDataBox->getIndividualProcessNodeVector(); // cint64 indiId = 1; // CIndividualProcessNode* indiNode1 = indiVec->getData(indiId); // isSatisfiableCachedProcessingBlocked(indiNode1,calcAlgContext); // bool bug = true; // } // if (modelString.indexOf("http://www.owllink.org/testsuite/galen#PulmonaryHeartDisease") != -1 && modelString.indexOf("http://www.owllink.org/testsuite/galen#LungDisease") == -1) { // QString extModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // CIndividualProcessNodeVector* indiVec = mProcessingDataBox->getIndividualProcessNodeVector(); // cint64 indiId = 1; // CIndividualProcessNode* indiNode1 = indiVec->getData(indiId); // isSatisfiableCachedProcessingBlocked(indiNode1,calcAlgContext); // bool bug = true; // } // if (modelString.indexOf("http://www.owllink.org/testsuite/galen#HeartDisease") != -1) { // QString extModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // CIndividualProcessNodeVector* indiVec = mProcessingDataBox->getIndividualProcessNodeVector(); // cint64 indiId = 1; // CIndividualProcessNode* indiNode1 = indiVec->getData(indiId); // bool bug = true; // } //} //QString modelString = generateDebugIndiModelStringList(calcAlgContext); //QString extModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // print individual node concept set signature count statistics //QList sigCountList; //cint64 totalCount = 0; //for (QHash::const_iterator it = mIndiNodeInitConceptSigCountHash.constBegin(), itEnd = mIndiNodeInitConceptSigCountHash.constEnd(); it != itEnd; ++it) { // cint64 sigCount = it.value(); // sigCountList.append(sigCount); // totalCount += sigCount; //} //qSort(sigCountList); //QListIterator sigCountIt(sigCountList); //sigCountIt.toBack(); //cint64 sigCountSize = sigCountList.size(); //QString sigCountString(QString("\r\nnode signature counts %1, total count %2\r\n").arg(sigCountSize).arg(totalCount)); //cint64 printCount = qMin(sigCountSize,50); //for (cint64 i = 0; i < printCount; ++i) { // sigCountString += QString(" n: %1, %2\t").arg(i).arg(sigCountIt.previous()); //} //LOG(INFO,"::Reasoner::Kernel::Algorithm",sigCountString,this); //mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); CBooleanTaskResult* satResult = satCalcTask->getSatisfiableCalculationTaskResult(); if (clashed) { if (!satResult->hasResult()) { satResult->installResult(false); } //writeSatisfiableCachedIndividualNodesOfUnsatisfiableBranch(mCalcAlgContext); completed = true; } if (satisfiable) { STATINC(ROOTTASKSATISFIABLECOUNT,calcAlgContext); satResult->installResult(true); if (mSatTaskConsAnalyser.analyseSatisfiableTask(satCalcTask,mCalcAlgContext) || mSatTaskIncConsAnalyser.analyseSatisfiableTask(satCalcTask,mCalcAlgContext)) { rebuildSignatureBlockingCandidateHash(mCalcAlgContext); } //testProblematicConceptSet(mCalcAlgContext); //analyzeABoxCompressionPossibilities(calcAlgContext); mClassMessAnalyser.readCalculationConfig(satCalcTask->getCalculationConfiguration()); mClassMessAnalyser.analyseSatisfiableTask(satCalcTask,mCalcAlgContext); mMarkerPropRealMessAnalyser.readCalculationConfig(satCalcTask->getCalculationConfiguration()); mMarkerPropRealMessAnalyser.analyseSatisfiableTask(satCalcTask,mCalcAlgContext); mPossAssCollAnalyser.readCalculationConfig(satCalcTask->getCalculationConfiguration()); mPossAssCollAnalyser.analyseSatisfiableTask(satCalcTask,mCalcAlgContext); cacheSatisfiableIndividualNodes(mCalcAlgContext); completed = true; } commitCacheMessages(calcAlgContext); if (error) { if (satCalcTask->hasActiveReferencedTask()) { satCalcTask->clearUninitializedReferenceTasks(); } satCalcTask->getTaskStatus()->setError(error,errorCode); processorCommunicator->communicateTaskError(satCalcTask); return false; } if (completed) { processorCommunicator->communicateTaskComplete(satCalcTask); return false; } return true; } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::continueIndividualProcessing(CIndividualProcessNode*& indiProcNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool purgedIndiBlocked = indiProcNode->hasIndirectBlockedProcessingRestrictionFlags() || indiProcNode->hasPurgedBlockedProcessingRestrictionFlags(); if (purgedIndiBlocked) { return false; } CConceptProcessingQueue* conProQue = indiProcNode->getConceptProcessingQueue(false); if (conProQue && !conProQue->isEmpty()) { CConceptProcessPriority conProPri; if (conProQue->getNextConceptProcessPriority(&conProPri)) { double priority = conProPri.getPriority(); if (priority < mMinConceptProcessingPriorityLevel) { return false; } } return true; } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::installSaturationCachingReactivation(CIndividualProcessNode* indiProcNode, CSaturationNodeAssociatedDependentNominalSet* nominalSet, CCalculationAlgorithmContextBase* calcAlgContext) { if (nominalSet) { CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); for (CSaturationNodeAssociatedDependentNominalSet::const_iterator it = nominalSet->constBegin(), itEnd = nominalSet->constEnd(); it != itEnd; ++it) { cint64 nominalID(*it); CIndividualProcessNode* nominalNode = getUpToDateIndividual(nominalID,calcAlgContext); nominalNode->setCachingLossNodeReactivationInstalled(true); CIndividualProcessNode* locNominalNode = getLocalizedIndividual(nominalNode,true,calcAlgContext); CNominalCachingLossReactivationData* locNominalReactivationData = locNominalNode->getNominalCachingLossReactivationData(true); locNominalReactivationData->addReactivationIndividualNode(indiProcNode); } } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::tryInstallSaturationCachingReactivation(CIndividualProcessNode* indiProcNode, CSuccessorConnectedNominalSet* nominalSet, CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); for (CSuccessorConnectedNominalSet::const_iterator it = nominalSet->constBegin(), itEnd = nominalSet->constEnd(); it != itEnd; ++it) { cint64 nominalID(*it); CIndividualProcessNode* nominalNode = getUpToDateIndividual(nominalID,calcAlgContext); if (nominalNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALID | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED)) { if (!nominalNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKEND)) { return false; } } nominalNode->setCachingLossNodeReactivationInstalled(true); CNominalCachingLossReactivationData* nominalReactivationData = nominalNode->getNominalCachingLossReactivationData(false); if (nominalReactivationData && nominalReactivationData->hasReactivated()) { return false; } CIndividualProcessNode* locNominalNode = getLocalizedIndividual(nominalNode,true,calcAlgContext); CNominalCachingLossReactivationData* locNominalReactivationData = locNominalNode->getNominalCachingLossReactivationData(true); locNominalReactivationData->addReactivationIndividualNode(indiProcNode); } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::checkIndividualNodesReactivationDueToNominalCachingLoss(CIndividualProcessNode* nominalProcNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (nominalProcNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALID)) { if (!nominalProcNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKEND)) { return reactivateIndividualNodesDueToNominalCachingLoss(nominalProcNode,calcAlgContext); } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::reactivateIndividualNodesDueToNominalCachingLoss(CIndividualProcessNode* nominalProcNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool nodesReactivated = false; CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CNominalCachingLossReactivationData* nominalReactivationData = nominalProcNode->getNominalCachingLossReactivationData(false); CIndividualUnsortedProcessingQueue* reactivationQueue = nullptr; if (nominalReactivationData) { if (!nominalReactivationData->hasReactivated()) { nominalReactivationData = nominalProcNode->getNominalCachingLossReactivationData(true); nominalReactivationData->setReactivated(true); for (CXLinker* reactivationLinkerIt = nominalReactivationData->takeReactivationIndividualNodeLinker(); reactivationLinkerIt; reactivationLinkerIt = reactivationLinkerIt->getNext()) { CIndividualProcessNode* reactivationIndiNode = reactivationLinkerIt->getData(); if (!reactivationQueue) { reactivationQueue = processingDataBox->getNominalCachingLossReactivationProcessingQueue(true); } reactivationQueue->insertIndiviudalProcessNode(reactivationIndiNode); nodesReactivated = true; } } } return nodesReactivated; } bool individualIDGreaterThan(CXLinker*& s1, CXLinker*& s2) { return s1->getData()->getIndividualID() > s2->getData()->getIndividualID(); } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::takeNextProcessIndividual(CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* indiProcNode = nullptr; mIndiNodeConcludeUnsatCaching = false; mIndiNodeFromQueueType = INQT_NONE; if (!indiProcNode) { mMinConceptProcessingPriorityLevel = mImmediatelyProcessPriority; if (mProcessingDataBox->hasCacheTestingIndividualNodes()) { indiProcNode = mProcessingDataBox->takeNextCacheTestingIndividualNode(); mIndiNodeConcludeUnsatCaching = true; mIndiNodeFromQueueType = INQT_CACHETEST; } } if (!indiProcNode) { mIndiImmediateProQueue = mProcessingDataBox->getIndividualImmediatelyProcessingQueue(false); if (mIndiImmediateProQueue && !mIndiImmediateProQueue->isEmpty()) { mIndiImmediateProQueue = mProcessingDataBox->getIndividualImmediatelyProcessingQueue(true); indiProcNode = mIndiImmediateProQueue->takeNextProcessIndividualNode(); mIndiNodeFromQueueType = INQT_IMMEDIATE; } } if (!indiProcNode) { mRoleAssertionProcessingQueue = mProcessingDataBox->getRoleAssertionProcessingQueue(false); if (mRoleAssertionProcessingQueue && !mRoleAssertionProcessingQueue->isEmpty()) { mRoleAssertionProcessingQueue = mProcessingDataBox->getRoleAssertionProcessingQueue(true); indiProcNode = mRoleAssertionProcessingQueue->takeNextProcessIndividualNode(); mIndiNodeFromQueueType = INQT_ROLEASS; } } if (!indiProcNode) { mMinConceptProcessingPriorityLevel = mDeterministicProcessPriority; mIndiDetExpProQueue = mProcessingDataBox->getIndividualDepthDeterministicExpansionPreprocessingQueue(false); if (mIndiDetExpProQueue && !mIndiDetExpProQueue->isEmpty()) { mIndiDetExpProQueue = mProcessingDataBox->getIndividualDepthDeterministicExpansionPreprocessingQueue(true); indiProcNode = mIndiDetExpProQueue->takeNextProcessIndividual(); mIndiNodeFromQueueType = INQT_DETEXP; } } if (!indiProcNode) { mIndiDetDeptFirstExpProQueue = mProcessingDataBox->getIndividualDepthFirstDeterministicExpansionProcessingQueue(false); if (mIndiDetDeptFirstExpProQueue && !mIndiDetDeptFirstExpProQueue->isEmpty()) { mIndiDetDeptFirstExpProQueue = mProcessingDataBox->getIndividualDepthFirstDeterministicExpansionProcessingQueue(true); indiProcNode = mIndiDetDeptFirstExpProQueue->takeNextProcessIndividualNode(); mIndiNodeFromQueueType = INQT_DEPTHFIRST; } } if (!indiProcNode) { mValueSpaceSatCheckingQueue = mProcessingDataBox->getDistinctValueSpaceSatisfiabilityCheckingQueue(false); if (mValueSpaceSatCheckingQueue && !mValueSpaceSatCheckingQueue->isEmpty()) { mValueSpaceSatCheckingQueue = mProcessingDataBox->getDistinctValueSpaceSatisfiabilityCheckingQueue(true); indiProcNode = mValueSpaceSatCheckingQueue->takeNextProcessIndividual(); mIndiNodeFromQueueType = INQT_VSTSATTESTING; if (indiProcNode) { indiProcNode = getLocalizedIndividual(indiProcNode,true,calcAlgContext); } } } if (!indiProcNode) { mValueSpaceTriggeringProQueue = mProcessingDataBox->getValueSpaceTriggeringProcessingQueue(false); if (mValueSpaceTriggeringProQueue && !mValueSpaceTriggeringProQueue->isEmpty()) { mValueSpaceTriggeringProQueue = mProcessingDataBox->getValueSpaceTriggeringProcessingQueue(true); indiProcNode = mValueSpaceTriggeringProQueue->takeNextProcessIndividual(); mIndiNodeFromQueueType = INQT_VSTRIGGERING; if (indiProcNode) { indiProcNode = getLocalizedIndividual(indiProcNode,true,calcAlgContext); } } } if (!indiProcNode) { mBackendSyncRetestProcessingQueue = mProcessingDataBox->getBackendCacheSynchronizationProcessingQueue(false); if (mBackendSyncRetestProcessingQueue && !mBackendSyncRetestProcessingQueue->isEmpty()) { mBackendSyncRetestProcessingQueue = mProcessingDataBox->getBackendCacheSynchronizationProcessingQueue(true); indiProcNode = mBackendSyncRetestProcessingQueue->takeNextProcessIndividualNode(); mIndiNodeFromQueueType = INQT_BACKENDSYNCRETEST; } } if (!indiProcNode) { mVarBindConBatchProcessingQueue = mProcessingDataBox->getVariableBindingConceptBatchProcessingQueue(false); if (mVarBindConBatchProcessingQueue && !mVarBindConBatchProcessingQueue->isEmpty()) { mVarBindConBatchProcessingQueue = mProcessingDataBox->getVariableBindingConceptBatchProcessingQueue(true); CConcept* varBindConcept = nullptr; CConceptProcessDescriptor* conProDes = nullptr; indiProcNode = nullptr; mVarBindConBatchProcessingQueue->takeNextConceptProcessIndividual(varBindConcept,indiProcNode,conProDes); if (indiProcNode) { indiProcNode = getLocalizedIndividual(indiProcNode,true,calcAlgContext); indiProcNode->getConceptProcessingQueue(true)->insertConceptProcessDescriptor(conProDes); mIndiNodeFromQueueType = INQT_VARBINDBATCHQUE; } } } if (!indiProcNode) { mIncrementalCompatibilityCheckingQueue = mProcessingDataBox->getIncrementalCompatibilityCheckingQueue(false); if (mIncrementalCompatibilityCheckingQueue && !mIncrementalCompatibilityCheckingQueue->isEmpty()) { mIncrementalCompatibilityCheckingQueue = mProcessingDataBox->getIncrementalCompatibilityCheckingQueue(true); while (!mIncrementalCompatibilityCheckingQueue->isEmpty()) { CIndividualProcessNode* compCheckIndiNode = mIncrementalCompatibilityCheckingQueue->takeNextProcessIndividual(); compCheckIndiNode = getLocalizedIndividual(compCheckIndiNode,true,calcAlgContext); compCheckIndiNode->setIncrementalCompatibilityCheckingQueued(false); if (compCheckIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINCREMENTALEXPANSIONRETESTDUEDIRECTMODIFIED)) { compCheckIndiNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFINCREMENTALEXPANSIONRETESTDUEDIRECTMODIFIED); } checkCompatibilityUpdateDirectlyChangedPropagation(compCheckIndiNode,calcAlgContext); } } } if (!indiProcNode) { mIncrementalExpansionInitializingProcessingQueue = mProcessingDataBox->getIncrementalExpansionInitializingProcessingQueue(false); if (mIncrementalExpansionInitializingProcessingQueue && !mIncrementalExpansionInitializingProcessingQueue->isEmpty()) { mIncrementalExpansionInitializingProcessingQueue = mProcessingDataBox->getIncrementalExpansionInitializingProcessingQueue(true); //if (mIncExpCompIndiModelString.isEmpty()) { // mIncExpCompIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // QFile compFile(QString("./SATCT/Tasks/task-inc-exp-check-compatible-%1.txt").arg(mProcessingDataBox->getIncrementalExpansionID())); // if (compFile.open(QIODevice::WriteOnly)) { // compFile.write(mIncExpCompIndiModelString.replace("
","\r\n").toLocal8Bit()); // compFile.close(); // } //} while (!mIncrementalExpansionInitializingProcessingQueue->isEmpty()) { CIndividualProcessNode* incExpInitIndiNode = mIncrementalExpansionInitializingProcessingQueue->takeNextProcessIndividual(); incExpInitIndiNode = getLocalizedIndividual(incExpInitIndiNode,true,calcAlgContext); incExpInitIndiNode->setIncrementalExpansionQueued(false); if (requiresIncrementalNodeExpansion(incExpInitIndiNode,calcAlgContext)) { initializeIncrementalIndividualExpansion(incExpInitIndiNode,calcAlgContext); } } } } if (!indiProcNode) { mIncrementalExpansionProcessingQueue = mProcessingDataBox->getIncrementalExpansionProcessingQueue(false); if (mIncrementalExpansionProcessingQueue && !mIncrementalExpansionProcessingQueue->isEmpty()) { mIncrementalExpansionProcessingQueue = mProcessingDataBox->getIncrementalExpansionProcessingQueue(true); while (!indiProcNode && !mIncrementalExpansionProcessingQueue->isEmpty()) { CIndividualProcessNode* incExpIndiNode = mIncrementalExpansionProcessingQueue->takeNextProcessIndividual(); incExpIndiNode = getLocalizedIndividual(incExpIndiNode,true,calcAlgContext); incExpIndiNode->setIncrementalExpansionQueued(false); if (requiresIncrementalNodeExpansion(incExpIndiNode,calcAlgContext)) { indiProcNode = incrementalNodeExpansion(incExpIndiNode,calcAlgContext); } } } } if (!indiProcNode) { if (mOptIncrementalExpansion && !mProcessingDataBox->isIncrementalExpansionCompatibleMerged()) { //mIncExpCompIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); //QFile compFile(QString("./SATCT/Tasks/task-inc-exp-compatible-%1.txt").arg(mProcessingDataBox->getIncrementalExpansionID())); //if (compFile.open(QIODevice::WriteOnly)) { // compFile.write(mIncExpCompIndiModelString.replace("
","\r\n").toLocal8Bit()); // compFile.close(); //} incrementalMergeWithPreviousDeterministicCompletionGraph(calcAlgContext); mProcessingDataBox->setIncrementalExpansionCompatibleMerged(true); mOptIncrementalCompatibleExpansion = false; mOptIncrementalCachingExpansion = true; //mIncExpMergedIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); //QFile mergeFile(QString("./SATCT/Tasks/task-inc-exp-merged-%1.txt").arg(mProcessingDataBox->getIncrementalExpansionID())); //if (mergeFile.open(QIODevice::WriteOnly)) { // mergeFile.write(mIncExpMergedIndiModelString.replace("
","\r\n").toLocal8Bit()); // mergeFile.close(); //} } } if (!indiProcNode) { mEarlyIndiReactProcessingQueue = mProcessingDataBox->getEarlyIndividualReactivationProcessingQueue(false); if (mEarlyIndiReactProcessingQueue && !mEarlyIndiReactProcessingQueue->isEmpty()) { mEarlyIndiReactProcessingQueue = mProcessingDataBox->getEarlyIndividualReactivationProcessingQueue(true); CIndividualProcessNode* reactIndiNode = nullptr; bool forceReactivation = false; mEarlyIndiReactProcessingQueue->takeNextReactivationIndividual(reactIndiNode,forceReactivation); indiProcNode = getLocalizedIndividual(reactIndiNode,true,calcAlgContext); if (forceReactivation) { if (indiProcNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED)) { indiProcNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED); reapplySatisfiableCachedAbsorbedDisjunctionConcepts(indiProcNode,calcAlgContext); reapplySatisfiableCachedAbsorbedGeneratingConcepts(indiProcNode,calcAlgContext); } indiProcNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED); } mIndiNodeFromQueueType = INQT_COMPCACHEDREACT; } } if (!indiProcNode) { if (!mProcessingDataBox->hasNominalNonDeterministicProcessingNodesSorted()) { // sort nominal processing nodes CXLinker* nomNonDetProLinker = mProcessingDataBox->getSortedNominalNonDeterministicProcessingNodeLinker(); CPROCESSINGLIST< CXLinker* > nomNonDetProLinkerList(calcAlgContext->getUsedTaskProcessorContext()); while (nomNonDetProLinker) { CXLinker* tmpNomNonDetProLinker = nomNonDetProLinker; nomNonDetProLinker = nomNonDetProLinker->getNext(); tmpNomNonDetProLinker->clearNext(); nomNonDetProLinkerList.append(tmpNomNonDetProLinker); } mProcessingDataBox->clearSortedNominalNonDeterministicProcessingNodeLinker(); qSort(nomNonDetProLinkerList.begin(),nomNonDetProLinkerList.end(),individualIDGreaterThan); for (CPROCESSINGLIST< CXLinker* >::const_iterator it = nomNonDetProLinkerList.constBegin(), itEnd = nomNonDetProLinkerList.constEnd(); it != itEnd; ++it) { CXLinker* tmpNomNonDetProLinker(*it); mProcessingDataBox->addSortedNominalNonDeterministicProcessingNodeLinker(tmpNomNonDetProLinker); } mProcessingDataBox->setNominalNonDeterministicProcessingNodesSorted(true); } } if (!indiProcNode) { mMinConceptProcessingPriorityLevel = 0; mProcessingQueue = mProcessingDataBox->getIndividualProcessingQueue(false); if (mProcessingQueue && !mProcessingQueue->isEmpty()) { mProcessingQueue = mProcessingDataBox->getIndividualProcessingQueue(true); CIndividualProcessNodeDescriptor* indiProcessNodeDes = mProcessingQueue->takeNextProcessIndividualDescriptor(); indiProcNode = indiProcessNodeDes->getIndividual(); mIndiNodeFromQueueType = INQT_OUTDATED; } } if (!indiProcNode) { // process remaining concepts on nominal nodes mNominalProcessingQueue = mProcessingDataBox->getNominalProcessingQueue(false); if (mNominalProcessingQueue && !mNominalProcessingQueue->isEmpty()) { mNominalProcessingQueue = mProcessingDataBox->getNominalProcessingQueue(true); indiProcNode = mNominalProcessingQueue->takeNextProcessIndividual(); mIndiNodeFromQueueType = INQT_NOMINAL; } } if (!indiProcNode) { if (mProcessingDataBox->hasSortedNominalNonDeterministicProcessingNodes()) { indiProcNode = mProcessingDataBox->takeSortedNominalNonDeterministicProcessingNode(); mIndiNodeFromQueueType = INQT_NOMINAL; } } if (!indiProcNode) { // depth based processing for blockable node mDepthProcessingQueue = mProcessingDataBox->getIndividualDepthProcessingQueue(false); if (mDepthProcessingQueue && !mDepthProcessingQueue->isEmpty()) { mDepthProcessingQueue = mProcessingDataBox->getIndividualDepthProcessingQueue(true); indiProcNode = mDepthProcessingQueue->takeNextProcessIndividual(); mIndiNodeFromQueueType = INQT_DEPTHNORMAL; } } if (!indiProcNode) { // processing of new nodes with depth first mNominalCachingLossReactivationProcessingQueue = mProcessingDataBox->getNominalCachingLossReactivationProcessingQueue(false); if (mNominalCachingLossReactivationProcessingQueue && !mNominalCachingLossReactivationProcessingQueue->isEmpty()) { mNominalCachingLossReactivationProcessingQueue = mProcessingDataBox->getNominalCachingLossReactivationProcessingQueue(true); CIndividualProcessNode* tmpIndiProcNode = mNominalCachingLossReactivationProcessingQueue->takeNextProcessIndividualNode(); tmpIndiProcNode = getUpToDateIndividual(tmpIndiProcNode,calcAlgContext); if (tmpIndiProcNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED)) { indiProcNode = getLocalizedIndividual(tmpIndiProcNode,false,calcAlgContext); indiProcNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHEDINVALIDATED); } mIndiNodeFromQueueType = INQT_NOMINALCACHINGLOSSREACTIVATION; } } if (!indiProcNode) { // processing of new nodes with depth first mDepthFirstProcessingQueue = mProcessingDataBox->getIndividualDepthFirstProcessingQueue(false); if (mDepthFirstProcessingQueue && !mDepthFirstProcessingQueue->isEmpty()) { mDepthFirstProcessingQueue = mProcessingDataBox->getIndividualDepthFirstProcessingQueue(true); indiProcNode = mDepthFirstProcessingQueue->takeNextProcessIndividualNode(); mIndiNodeFromQueueType = INQT_DEPTHFIRST; } } if (!indiProcNode) { mLateIndiReactProcessingQueue = mProcessingDataBox->getLateIndividualReactivationProcessingQueue(false); if (mLateIndiReactProcessingQueue && !mLateIndiReactProcessingQueue->isEmpty()) { mLateIndiReactProcessingQueue = mProcessingDataBox->getLateIndividualReactivationProcessingQueue(true); CIndividualProcessNode* reactIndiNode = nullptr; bool forceReactivation = false; mLateIndiReactProcessingQueue->takeNextReactivationIndividual(reactIndiNode,forceReactivation); indiProcNode = getLocalizedIndividual(reactIndiNode,true,calcAlgContext); if (forceReactivation) { if (indiProcNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED)) { indiProcNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED); reapplySatisfiableCachedAbsorbedDisjunctionConcepts(indiProcNode,calcAlgContext); reapplySatisfiableCachedAbsorbedGeneratingConcepts(indiProcNode,calcAlgContext); } indiProcNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED); } mIndiNodeFromQueueType = INQT_COMPCACHEDREACT; } } if (!indiProcNode) { mOptDetExpPreporcessing = false; mIndiSigBlockUpdProQueue = mProcessingDataBox->getBlockingUpdateReviewProcessingQueue(false); if (mIndiSigBlockUpdProQueue && !mIndiSigBlockUpdProQueue->isEmpty()) { mIndiSigBlockUpdProQueue = mProcessingDataBox->getBlockingUpdateReviewProcessingQueue(true); indiProcNode = mIndiSigBlockUpdProQueue->takeNextProcessIndividual(); mIndiNodeFromQueueType = INQT_BLOCKUP; } } if (!indiProcNode) { mIndiBlockReactProQueue = mProcessingDataBox->getBlockedReactivationProcessingQueue(false); if (mIndiBlockReactProQueue && !mIndiBlockReactProQueue->isEmpty()) { mIndiBlockReactProQueue = mProcessingDataBox->getBlockedReactivationProcessingQueue(true); indiProcNode = mIndiBlockReactProQueue->takeNextProcessIndividual(); mIndiNodeFromQueueType = INQT_BLOCKREACT; } } if (!indiProcNode) { mSigBlockRevSet = mProcessingDataBox->getSignatureBlockingReviewSet(false); if (mSigBlockRevSet && !mSigBlockRevSet->isEmpty()) { mSigBlockRevSet = mProcessingDataBox->getSignatureBlockingReviewSet(true); bool isNonSubSetData = true; CSignatureBlockingReviewData* reviewData = mSigBlockRevSet->getNonSubsetReviewData(); if (reviewData->isEmpty()) { isNonSubSetData = false; reviewData = mSigBlockRevSet->getSubsetReviewData(); } CSignatureBlockingReviewDataIterator revIt = reviewData->getIterator(); if (revIt.hasNext()) { cint64 blockedIndiID = revIt.next(false); revIt.removeAndMoveNext(); indiProcNode = getLocalizedIndividual(blockedIndiID,calcAlgContext); if (!isNonSubSetData && mConfIndividualReusingFromSignatureBlocking) { // try to establish individual reusing upgradeSignatureBlockingToIndividualReusing(indiProcNode,calcAlgContext); } CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CSignatureBlockingIndividualNodeConceptExpansionData* locSigBlockingData = indiProcNode->getSignatureBlockingIndividualNodeConceptExpansionData(true); if (!locSigBlockingData) { CSignatureBlockingIndividualNodeConceptExpansionData* sigBlockingData = indiProcNode->getSignatureBlockingIndividualNodeConceptExpansionData(false); locSigBlockingData = CObjectAllocator::allocateAndConstruct(taskMemMan); locSigBlockingData->initBlockingExpansionData(sigBlockingData); indiProcNode->setSignatureBlockingIndividualNodeConceptExpansionData(locSigBlockingData); } if (!locSigBlockingData->isIdenticConceptSetRequired()) { locSigBlockingData->setIdenticConceptSetRequired(true); indiProcNode->setLastSearchBlockerCandidateCount(0); detectIndividualNodeSignatureBlockingStatus(indiProcNode,calcAlgContext); } } } } if (!indiProcNode) { mReusingReviewData = calcAlgContext->getProcessingDataBox()->getReusingReviewData(false); if (mReusingReviewData && !mReusingReviewData->isEmpty()) { mReusingReviewData = calcAlgContext->getProcessingDataBox()->getReusingReviewData(false); while (mReusingReviewData->hasNextIndividualID() && !indiProcNode) { cint64 indiNodeID = mReusingReviewData->takeNextIndividualID(); indiProcNode = getLocalizedIndividual(indiNodeID,calcAlgContext); CReusingIndividualNodeConceptExpansionData* reuseData = indiProcNode->getReusingIndividualNodeConceptExpansionData(false); if (!reuseData->isConceptSetStillSubset()) { removeIndividualReusing(indiProcNode,calcAlgContext); } else { indiProcNode = nullptr; } } } } if (!indiProcNode) { mDelayedNominalProcessingQueue = mProcessingDataBox->getDelayingNominalProcessingQueue(false); if (mDelayedNominalProcessingQueue) { mDelayedNominalProcessingQueue = mProcessingDataBox->getDelayingNominalProcessingQueue(true); indiProcNode = mDelayedNominalProcessingQueue->takeNextProcessIndividualNode(); mIndiNodeFromQueueType = INQT_DELAYEDNOMINAL; } } return indiProcNode; } void CCalculationTableauCompletionTaskHandleAlgorithm::analyzeCompletionGraphStatistics(CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CIndividualProcessNodeVector* indiNodeVec = processingDataBox->getIndividualProcessNodeVector(); cint64 indiCount = indiNodeVec->getItemCount(); for (cint64 indiIdx = 0; indiIdx < indiCount; ++indiIdx) { CIndividualProcessNode* indiNode = getLocalizedIndividual(indiIdx,calcAlgContext); if (indiNode) { cint64 conSigValue = indiNode->getReapplyConceptLabelSet(false)->getConceptSignatureValue(); mSignatureIndiNodeStatusHash.insertMulti(conSigValue,indiNode->getProcessingRestrictionFlags()); if (!mSignatureIndiNodePredDepHash.contains(conSigValue)) { CReapplyConceptLabelSet* conSet = indiNode->getReapplyConceptLabelSet(false); if (conSet && indiNode->getIndividualAncestorDepth() > 0) { cint64 conFromPredCount = 0; CConceptDescriptor* conDesIt = conSet->getAddingSortedConceptDescriptionLinker(); while (conDesIt) { if (conDesIt->getConceptTag() != 1) { if (isConceptFromPredecessorDependent(indiNode,conDesIt,conDesIt->getDependencyTrackPoint(),calcAlgContext)) { ++conFromPredCount; } } conDesIt = conDesIt->getNext(); } mSignatureIndiNodePredDepHash.insert(conSigValue,conFromPredCount); } } } } mIndiNodeCountMap.insert(indiCount,mIndiNodeCountMap.value(indiCount,0)+1); mIndiNodeCountList.append(indiCount); } bool CCalculationTableauCompletionTaskHandleAlgorithm::areAllDependentFactsUnchanged(CIndividualProcessNode* individualNode, CIndividualProcessNode* backtrackedIndividualNode, CDependencyTrackPoint* prevConDepTrackPoint, CIndividualProcessNodeVector* prevIndiNodeVec, cint64& remBacktrackCount, CCalculationAlgorithmContextBase* calcAlgContext) { if (--remBacktrackCount < 0) { return false; } CDependencyNode* depNode = prevConDepTrackPoint->getDependencyNode(); if (depNode) { CIndividualProcessNode* assocIndiNode = depNode->getAppropriateIndividualNode(); if (assocIndiNode) { if (assocIndiNode->isBlockableIndividual()) { return false; } CIndividualProcessNode* locAssIndiNode = calcAlgContext->getUsedProcessingDataBox()->getIndividualProcessNodeVector()->getData(assocIndiNode->getIndividualID()); if (locAssIndiNode) { return false; } } bool addRoleExistDep = false; CDependencyIterator addDepIt = depNode->getAdditionalDependencyIterator(true,true); while (addDepIt.hasNext()) { CDependency* addDep = addDepIt.nextDependency(); CDependencyTrackPoint* prevAddDepTrackPoint = addDep->getPreviousDependencyTrackPoint(); CDependencyNode* prevAddDepNode = addDep->getPreviousTrackedDependency(); if (prevAddDepNode->getDependencyType() == CDependencyNode::DNTROLEASSERTIONDEPENDENCY) { if (addRoleExistDep) { return false; } addRoleExistDep = true; } else if (prevAddDepNode->getDependencyType() == CDependencyNode::DNTSOMEDEPENDENCY) { if (addRoleExistDep) { return false; } CIndividualProcessNode* addAssocIndiNode = prevAddDepNode->getAppropriateIndividualNode(); if (addAssocIndiNode && addAssocIndiNode->isBlockableIndividual()) { return false; } if (!areAllDependentFactsUnchanged(individualNode,addAssocIndiNode?addAssocIndiNode:backtrackedIndividualNode,prevAddDepTrackPoint,prevIndiNodeVec,remBacktrackCount,calcAlgContext)) { return false; } addRoleExistDep = true; } else if (prevAddDepTrackPoint) { if (!areAllDependentFactsUnchanged(individualNode,assocIndiNode?assocIndiNode:backtrackedIndividualNode,prevAddDepTrackPoint,prevIndiNodeVec,remBacktrackCount,calcAlgContext)) { return false; } } } if (depNode->getDependencyType() != CDependencyNode::DNTINDEPENDENTBASE) { CDependencyTrackPoint* prevDepTrackPoint = depNode->getPreviousDependencyTrackPoint(); if (prevDepTrackPoint) { if (!areAllDependentFactsUnchanged(individualNode,assocIndiNode?assocIndiNode:backtrackedIndividualNode,prevDepTrackPoint,prevIndiNodeVec,remBacktrackCount,calcAlgContext)) { return false; } return true; } } else if (backtrackedIndividualNode && backtrackedIndividualNode != individualNode) { return true; } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::initializeIncrementalIndividualExpansion(CIndividualProcessNode* individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualNodeIncrementalExpansionData* incExpData = individualNode->getIncrementalExpansionData(false); if (!incExpData || !incExpData->isIncremetnalExpansionListInitialized()) { incExpData = individualNode->getIncrementalExpansionData(true); CIndividualProcessNodeVector* indiNodeVec = calcAlgContext->getUsedProcessingDataBox()->getIndividualProcessNodeVector(); CPROCESSINGSET* searchingNodeSet = CObjectParameterizingAllocator< CPROCESSINGSET, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); CPROCESSINGLIST* searchingNodeList = CObjectParameterizingAllocator< CPROCESSINGLIST, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); CPROCESSLIST* expList = nullptr; CSatisfiableCalculationTask* prevCalcTask = mIncExpHandler->getPreviousDeterministicCompletionGraphTask(calcAlgContext); CProcessingDataBox* prevDataBox = prevCalcTask->getProcessingDataBox(); CIndividualProcessNodeVector* prevIndiNodeVec = prevDataBox->getIndividualProcessNodeVector(); CIndividualProcessNode* prevIndiNode = incExpData->getPreviousCompletionGraphCorrespondenceIndividualNode(); if (prevIndiNode) { CReapplyConceptLabelSet* conSet = individualNode->getReapplyConceptLabelSet(false); CReapplyConceptLabelSet* prevConSet = prevIndiNode->getReapplyConceptLabelSet(false); if (conSet && prevConSet) { CReapplyConceptLabelSetIterator conSetIt = conSet->getConceptLabelSetIterator(true); CReapplyConceptLabelSetIterator prevConSetIt = prevConSet->getConceptLabelSetIterator(true); while (conSetIt.hasNext() && prevConSetIt.hasNext()) { cint64 conTag = conSetIt.getDataTag(); cint64 prevConTag = prevConSetIt.getDataTag(); CConceptDescriptor* conDes = conSetIt.getConceptDescriptor(); CConceptDescriptor* prevConDes = prevConSetIt.getConceptDescriptor(); if (conTag == prevConTag) { conSetIt.moveNext(); prevConSetIt.moveNext(); } else if (prevConTag < conTag) { // concept is missing, analyse dependencies whether it can be directly added CDependencyTrackPoint* prevConDepTrackPoint = prevConSetIt.getDependencyTrackPoint(); cint64 remMaxBacktrackingCount = 15; if (areAllDependentFactsUnchanged(individualNode,nullptr,prevConDepTrackPoint,prevIndiNodeVec,remMaxBacktrackingCount,calcAlgContext)) { addConceptToIndividual(prevConDes->getConcept(),prevConDes->isNegated(),individualNode,prevConDepTrackPoint,false,false,calcAlgContext); } prevConSetIt.moveNext(); } else if (conTag < prevConTag) { conSetIt.moveNext(); } } while (prevConSetIt.hasNext()) { // concept is missing, analyse dependencies whether it can be directly added CConceptDescriptor* prevConDes = prevConSetIt.getConceptDescriptor(); CDependencyTrackPoint* prevConDepTrackPoint = prevConSetIt.getDependencyTrackPoint(); cint64 remMaxBacktrackingCount = 15; if (areAllDependentFactsUnchanged(individualNode,nullptr,prevConDepTrackPoint,prevIndiNodeVec,remMaxBacktrackingCount,calcAlgContext)) { addConceptToIndividual(prevConDes->getConcept(),prevConDes->isNegated(),individualNode,prevConDepTrackPoint,false,false,calcAlgContext); } prevConSetIt.moveNext(); } } } searchingNodeSet->insert(individualNode->getIndividualID()); searchingNodeList->append(individualNode->getIndividualID()); while (!searchingNodeList->isEmpty()) { cint64 searchIndiNodeID = searchingNodeList->takeFirst(); CIndividualProcessNode* searchIndiNode = prevIndiNodeVec->getData(searchIndiNodeID); if (searchIndiNode) { CIndividual* nominalIndi = searchIndiNode->getNominalIndividual(); if (searchIndiNode->getIndividualID() != individualNode->getIndividualID()) { if (nominalIndi) { if (!indiNodeVec->getData(nominalIndi->getIndividualID())) { if (!expList) { expList = incExpData->getIncrementalExpansionList(true); } expList->append(nominalIndi); } } } if (!nominalIndi && searchIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION) || searchIndiNodeID == individualNode->getIndividualID()) { CSuccessorIterator succIt = searchIndiNode->getSuccessorIterator(); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(); cint64 succIndiID = succLink->getOppositeIndividualID(searchIndiNodeID); if (!searchingNodeSet->contains(succIndiID)) { searchingNodeSet->insert(succIndiID); searchingNodeList->append(succIndiID); } } CConnectionSuccessorSetIterator connIt = searchIndiNode->getConnectionSuccessorIterator(); while (connIt.hasNext()) { cint64 connIndiID = connIt.next(); if (!searchingNodeSet->contains(connIndiID)) { searchingNodeSet->insert(connIndiID); searchingNodeList->append(connIndiID); } } CIndividualMergingHash* mergeHash = searchIndiNode->getIndividualMergingHash(false); if (mergeHash) { for (CPROCESSHASH::const_iterator it = mergeHash->constBegin(), itEnd = mergeHash->constEnd(); it != itEnd; ++it) { CIndividual* mergedIndi = it.key(); cint64 mergedIndiID = mergedIndi->getIndividualID(); if (!searchingNodeSet->contains(mergedIndiID)) { searchingNodeSet->insert(mergedIndiID); searchingNodeList->append(mergedIndiID); } } } } } } incExpData->setIncremetnalExpansionListInitialized(true); addIndividualToIncrementalExpansionQueue(individualNode,calcAlgContext); return true; } return false; } CIndividual* CCalculationTableauCompletionTaskHandleAlgorithm::getNextIncrementalExpansionIndividual(CIndividualProcessNode* individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualNodeIncrementalExpansionData* incExpData = individualNode->getIncrementalExpansionData(false); if (incExpData && incExpData->requiresFurtherIncrementalExpansion()) { incExpData = individualNode->getIncrementalExpansionData(true); while (incExpData->requiresFurtherIncrementalExpansion()) { CIndividual* nextIndi = incExpData->takeNextIncrementalExpansionIndividual(); CIndividualProcessNodeVector* indiProcNodeVec = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); if (!indiProcNodeVec->getData(nextIndi->getIndividualID())) { return nextIndi; } } } return nullptr; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::incrementalNodeExpansion(CIndividualProcessNode* expandNode, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividual* expIndi = getNextIncrementalExpansionIndividual(expandNode,calcAlgContext); if (expIndi) { CIndividualProcessNode* expandedIndiNode = getUpToDateIndividual(expIndi->getIndividualID(),calcAlgContext); addIndividualToIncrementalExpansionQueue(expandNode,calcAlgContext); return expandedIndiNode; } return nullptr; } bool CCalculationTableauCompletionTaskHandleAlgorithm::requiresIncrementalNodeExpansion(CIndividualProcessNode* individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualNodeIncrementalExpansionData* incExpData = individualNode->getIncrementalExpansionData(false); if (!incExpData->isPreviousCompletionGraphCompatible() && (incExpData->hasDirectlyChangedNeighbourConnection() || incExpData->isDirectlyChanged())) { return true; } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::incrementalMergeWithPreviousNondeterministicCompletionGraph(CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNodeVector* indiNodeVec = calcAlgContext->getUsedProcessingDataBox()->getIndividualProcessNodeVector(); cint64 indiCount = indiNodeVec->getItemCount(); CSatisfiableCalculationTask* prevDetCalcTask = mIncExpHandler->getPreviousDeterministicCompletionGraphTask(calcAlgContext); CSatisfiableCalculationTask* prevNondetCalcTask = mIncExpHandler->getPreviousNondeterministicCompletionGraphTask(calcAlgContext); if (prevDetCalcTask && prevNondetCalcTask && prevDetCalcTask != prevNondetCalcTask) { CProcessingDataBox* prevDetDataBox = prevDetCalcTask->getProcessingDataBox(); CIndividualProcessNodeVector* prevDetIndiNodeVec = prevDetDataBox->getIndividualProcessNodeVector(); cint64 prevDetIndiNodeCount = prevDetIndiNodeVec->getItemCount(); CProcessingDataBox* prevNondetDataBox = prevNondetCalcTask->getProcessingDataBox(); CIndividualProcessNodeVector* prevNondetIndiNodeVec = prevNondetDataBox->getIndividualProcessNodeVector(); cint64 prevNondetIndiNodeCount = prevNondetIndiNodeVec->getItemCount(); CPROCESSINGSET* transformNodeSet = CObjectParameterizingAllocator< CPROCESSINGSET, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); CIndividualProcessNodeVector* mergedIndiNodeVec = CObjectParameterizingAllocator< CIndividualProcessNodeVector,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getProcessContext()); mergedIndiNodeVec->referenceVector(indiNodeVec); calcAlgContext->getUsedProcessingDataBox()->setIndividualProcessNodeVector(mergedIndiNodeVec); for (cint64 i = 0; i < indiCount; ++i) { CIndividualProcessNode* indiNode = indiNodeVec->getData(i); CIndividualProcessNode* prevDetIndiNode = prevDetIndiNodeVec->getData(i); CIndividualProcessNode* prevNondetIndiNode = prevNondetIndiNodeVec->getData(i); if (!indiNode && prevNondetIndiNode) { mergedIndiNodeVec->setLocalData(i,prevNondetIndiNode); } else if (indiNode == prevDetIndiNode) { if (prevNondetIndiNode != prevDetIndiNode) { mergedIndiNodeVec->setLocalData(i,prevNondetIndiNode); } } else { if (!indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED)) { if (indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED) && !indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALID | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED)) { transformNodeSet->insert(i); } } } } for (CPROCESSINGSET::const_iterator it = transformNodeSet->constBegin(), itEnd = transformNodeSet->constEnd(); it != itEnd; ++it) { cint64 transformNodeID(*it); CIndividualProcessNode* locIndiNode = getLocalizedIndividual(transformNodeID,calcAlgContext); CIndividualProcessNode* prevNondetIndiNode = prevNondetIndiNodeVec->getData(transformNodeID); locIndiNode->setReapplyConceptLabelSet(prevNondetIndiNode->getReapplyConceptLabelSet(false)); CSuccessorIterator prevSuccIt = prevNondetIndiNode->getSuccessorIterator(); while (prevSuccIt.hasNext()) { CIndividualLinkEdge* succLinkEdge = prevSuccIt.nextLink(); cint64 succIndiID = succLinkEdge->getOppositeIndividualID(transformNodeID); CIndividualProcessNode* succIndiNode = getUpToDateIndividual(succIndiID,calcAlgContext); if (!succIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED)) { CIndividualProcessNode* locSuccIndiNode = getLocalizedIndividual(succIndiNode,false,calcAlgContext); CSuccessorRoleIterator succRoleIt = prevNondetIndiNode->getSuccessorRoleIterator(locSuccIndiNode); while (succRoleIt.hasNext()) { CIndividualLinkEdge* succLink = succRoleIt.next(); if (!locSuccIndiNode->hasRoleSuccessorToIndividual(succLink->getLinkRole(),locIndiNode,true)) { CIndividualLinkEdge* newSuccLink = CObjectParameterizingAllocator< CIndividualLinkEdge,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); newSuccLink->initIndividualLinkEdge(succLink); CReapplyQueueIterator reapplyIterator = installIndividualNodeRoleLinkReapplied(locIndiNode,locSuccIndiNode,newSuccLink,calcAlgContext); applyReapplyQueueConceptsRestricted(locIndiNode,&reapplyIterator,newSuccLink,calcAlgContext); } } } } CConnectionSuccessorSetIterator connIt = prevNondetIndiNode->getConnectionSuccessorIterator(); if (connIt.hasNext()) { CConnectionSuccessorSet* connSet = locIndiNode->getConnectionSuccessorSet(false); CConnectionSuccessorSet* locConnSet = nullptr; while (connIt.hasNext()) { cint64 connID = connIt.next(); if (!connSet || !connSet->hasConnectionSuccessor(connID)) { CIndividualProcessNode* connIndiNode = getUpToDateIndividual(connID,calcAlgContext); if (!connIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED)) { if (!locConnSet) { locConnSet = locIndiNode->getConnectionSuccessorSet(true); } locConnSet->insertConnectionSuccessor(connID); } } } } CDistinctHash* prevDistinctHash = prevNondetIndiNode->getDistinctHash(false); if (prevDistinctHash) { CDistinctHash* distinctHash = locIndiNode->getDistinctHash(false); CDistinctHash* locDistinctHash = nullptr; for (CDistinctHash::const_iterator it = distinctHash->constBegin(), itEnd = distinctHash->constEnd(); it != itEnd; ++it) { cint64 distinctIndiID(it.key()); CDistinctEdge* distinctEdge(it.value()); if (!distinctHash || distinctHash->isIndividualDistinct(distinctIndiID)) { CIndividualProcessNode* distinctIndiNode = getUpToDateIndividual(distinctIndiID,calcAlgContext); if (!distinctIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED)) { if (!locDistinctHash) { locDistinctHash = locIndiNode->getDistinctHash(true); } CDistinctEdge* newDistinctLink = CObjectParameterizingAllocator< CDistinctEdge,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); newDistinctLink->initDistinctEdge(locIndiNode,distinctIndiNode,distinctEdge->getDependencyTrackPoint()); locDistinctHash->insertDistinctIndividual(distinctIndiID,newDistinctLink); } } } } CIndividualMergingHash* prevIndiMergingHash = prevNondetIndiNode->getIndividualMergingHash(false); if (prevIndiMergingHash) { CIndividualMergingHash* indiMergingHash = locIndiNode->getIndividualMergingHash(false); CIndividualMergingHash* locIndiMergingHash = nullptr; for (CIndividualMergingHash::const_iterator it = indiMergingHash->constBegin(), itEnd = indiMergingHash->constEnd(); it != itEnd; ++it) { CIndividual* mergedIndi(it.key()); CDependencyTrackPoint* depTrackPoint(it.value()); if (!indiMergingHash || indiMergingHash->contains(mergedIndi)) { if (!locIndiMergingHash) { locIndiMergingHash = locIndiNode->getIndividualMergingHash(true); } locIndiMergingHash->insert(mergedIndi,depTrackPoint); } } } } return true; } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::incrementalMergeWithPreviousDeterministicCompletionGraph(CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNodeVector* indiNodeVec = calcAlgContext->getUsedProcessingDataBox()->getIndividualProcessNodeVector(); cint64 indiCount = indiNodeVec->getItemCount(); CSatisfiableCalculationTask* prevCalcTask = mIncExpHandler->getPreviousDeterministicCompletionGraphTask(calcAlgContext); if (prevCalcTask) { CPROCESSINGSET* nonCompatibleChangedNominalNodeSet = CObjectParameterizingAllocator< CPROCESSINGSET, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); CPROCESSINGSET* compatibleNominalNodeSet = CObjectParameterizingAllocator< CPROCESSINGSET, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); CPROCESSINGSET* redundantNodeSet = CObjectParameterizingAllocator< CPROCESSINGSET, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); CPROCESSINGSET* newNodeSet = CObjectParameterizingAllocator< CPROCESSINGSET, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); identifyCompatibilityChangedNominalIndividualNodes(nonCompatibleChangedNominalNodeSet,compatibleNominalNodeSet,redundantNodeSet,newNodeSet,calcAlgContext); CPROCESSINGSET* pruningNodeSet = CObjectParameterizingAllocator< CPROCESSINGSET, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); CProcessingDataBox* prevDataBox = prevCalcTask->getProcessingDataBox(); CIndividualProcessNodeVector* prevIndiNodeVec = prevDataBox->getIndividualProcessNodeVector(); cint64 prevIndiNodeCount = prevIndiNodeVec->getItemCount(); for (CPROCESSINGSET::const_iterator it = redundantNodeSet->constBegin(), itEnd = redundantNodeSet->constEnd(); it != itEnd; ++it) { cint64 redundantNodeID(*it); CIndividualProcessNode* redundantNode = indiNodeVec->getData(redundantNodeID); if (redundantNode && redundantNode->getNominalIndividual()) { redundantNode = getLocalizedIndividual(redundantNode,false,calcAlgContext); pruneIncrementalRemovedSuccessors(redundantNode,compatibleNominalNodeSet,pruningNodeSet,calcAlgContext); } } CIndividualProcessNodeVector* mergedIndiNodeVec = CObjectParameterizingAllocator< CIndividualProcessNodeVector,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getProcessContext()); mergedIndiNodeVec->referenceVector(prevIndiNodeVec); calcAlgContext->getUsedProcessingDataBox()->setIndividualProcessNodeVector(mergedIndiNodeVec); for (CPROCESSINGSET::const_iterator it = nonCompatibleChangedNominalNodeSet->constBegin(), itEnd = nonCompatibleChangedNominalNodeSet->constEnd(); it != itEnd; ++it) { cint64 changedNominalID(*it); CIndividualProcessNode* prevChangedNode = mergedIndiNodeVec->getData(changedNominalID); if (prevChangedNode) { prevChangedNode = getLocalizedIndividual(prevChangedNode,false,calcAlgContext); pruneIncrementalRemovedSuccessors(prevChangedNode,compatibleNominalNodeSet,pruningNodeSet,calcAlgContext); } } for (CPROCESSINGSET::const_iterator it = nonCompatibleChangedNominalNodeSet->constBegin(), itEnd = nonCompatibleChangedNominalNodeSet->constEnd(); it != itEnd; ++it) { cint64 changedNominalID(*it); CIndividualProcessNode* changedNode = indiNodeVec->getData(changedNominalID); mergedIndiNodeVec->setData(changedNominalID,changedNode); } for (CPROCESSINGSET::const_iterator it = compatibleNominalNodeSet->constBegin(), itEnd = compatibleNominalNodeSet->constEnd(); it != itEnd; ++it) { cint64 compNominalID(*it); CIndividualProcessNode* newCompNode = indiNodeVec->getData(compNominalID); mergedIndiNodeVec->setData(compNominalID,newCompNode); // TODO: add nodes to cached completion graph checking queue? CIndividualProcessNode* prevCompIndiNode = prevIndiNodeVec->getData(compNominalID); if (prevCompIndiNode) { CIndividualProcessNode* locNewCompNode = getLocalizedIndividual(newCompNode,false,calcAlgContext); CSuccessorIterator prevSuccIt = prevCompIndiNode->getSuccessorIterator(); while (prevSuccIt.hasNext()) { CIndividualLinkEdge* succLinkEdge = prevSuccIt.nextLink(); CIndividualProcessNode* succIndiNode = getSuccessorIndividual(prevCompIndiNode,succLinkEdge,calcAlgContext); if (succIndiNode->isNominalIndividual() || succIndiNode->hasProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { cint64 succIndiID = succIndiNode->getIndividualID(); if (!compatibleNominalNodeSet->contains(succIndiID) && !nonCompatibleChangedNominalNodeSet->contains(succIndiID) && !pruningNodeSet->contains(succIndiID)) { CSuccessorRoleIterator succRoleIt = prevCompIndiNode->getSuccessorRoleIterator(succIndiNode); while (succRoleIt.hasNext()) { CIndividualLinkEdge* succLink = succRoleIt.next(); CIndividualLinkEdge* newSuccLink = CObjectParameterizingAllocator< CIndividualLinkEdge,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); newSuccLink->initIndividualLinkEdge(succLink); CReapplyQueueIterator reapplyIterator = installIndividualNodeRoleLinkReapplied(locNewCompNode,succIndiNode,newSuccLink,calcAlgContext); applyReapplyQueueConceptsRestricted(locNewCompNode,&reapplyIterator,newSuccLink,calcAlgContext); } } } } CConnectionSuccessorSetIterator conIt = prevCompIndiNode->getConnectionSuccessorIterator(); while (conIt.hasNext()) { cint64 connNodeID = conIt.next(); if (!compatibleNominalNodeSet->contains(connNodeID) && !nonCompatibleChangedNominalNodeSet->contains(connNodeID) && !pruningNodeSet->contains(connNodeID)) { locNewCompNode->getConnectionSuccessorSet(true)->insertConnectionSuccessor(connNodeID); } } CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CIndividualReactivationProcessingQueue* reactProcQueue = nullptr; if (mConfDelayCompletionGraphCachingReactivation) { reactProcQueue = processingDataBox->getLateIndividualReactivationProcessingQueue(true); } else { reactProcQueue = processingDataBox->getEarlyIndividualReactivationProcessingQueue(true); } reactProcQueue->insertReactivationIndiviudal(locNewCompNode,false); } } for (cint64 i = prevIndiNodeCount; i < indiCount; ++i) { CIndividualProcessNode* newIndiNode = indiNodeVec->getData(i); if (newIndiNode) { mergedIndiNodeVec->setData(i,newIndiNode); } } return true; } return false; } void CCalculationTableauCompletionTaskHandleAlgorithm::pruneIncrementalRemovedSuccessors(CIndividualProcessNode*& indi, CPROCESSINGSET* compatibleNominalNodeSet, CPROCESSINGSET* pruningNodeSet, CCalculationAlgorithmContextBase* calcAlgContext) { CPROCESSINGLIST* pruningNodeList = CObjectParameterizingAllocator< CPROCESSINGLIST,CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); pruningNodeList->append(indi); while (!pruningNodeList->isEmpty()) { CIndividualProcessNode* pruningNode = pruningNodeList->takeFirst(); if (pruningNode != indi && !pruningNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED)) { pruningNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED); eliminiateBlockedIndividuals(pruningNode,calcAlgContext); } CConnectionSuccessorSet* connSuccSet = pruningNode->getConnectionSuccessorSet(false); if (connSuccSet) { if (connSuccSet->getConnectionSuccessorCount() > 0) { CConnectionSuccessorSetIterator conSuccIt = connSuccSet->getConnectionSuccessorIterator(); while (conSuccIt.hasNext()) { cint64 connID = conSuccIt.next(true); if (!pruningNodeSet->contains(connID) && !compatibleNominalNodeSet->contains(connID)) { CIndividualProcessNode* nomIndi = getUpToDateIndividual(connID,calcAlgContext); if (!nomIndi->getNominalIndividual() && !nomIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED)) { pruningNodeSet->insert(connID); CIndividualProcessNode* locNomIndi = getLocalizedIndividual(nomIndi,false,calcAlgContext); pruningNodeList->append(locNomIndi); } } } } } CSuccessorIterator succIt = pruningNode->getSuccessorIterator(); cint64 ancDepth = pruningNode->getIndividualAncestorDepth(); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(pruningNode,succLink,calcAlgContext); if (!succIndi->getNominalIndividual() && !succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED)) { cint64 succIndiID = succIndi->getIndividualID(); if (!pruningNodeSet->contains(succIndiID) && !compatibleNominalNodeSet->contains(succIndiID)) { pruningNodeSet->insert(succIndiID); CIndividualProcessNode* locSuccIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); pruningNodeList->append(locSuccIndi); } } } } } bool CCalculationTableauCompletionTaskHandleAlgorithm::identifyCompatibilityChangedNominalIndividualNodes(CPROCESSINGSET* nonCompatibleChangedNominalNodeSet, CPROCESSINGSET* compatibleNominalNodeSet, CPROCESSINGSET* redundantNodeSet, CPROCESSINGSET* newNodeSet, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNodeVector* indiNodeVec = calcAlgContext->getUsedProcessingDataBox()->getIndividualProcessNodeVector(); cint64 indiCount = indiNodeVec->getItemCount(); for (cint64 i = 0; i < indiCount; ++i) { CIndividualProcessNode* indiNode = indiNodeVec->getData(i); if (indiNode) { CIndividualNodeIncrementalExpansionData* incExpData = indiNode->getIncrementalExpansionData(false); if (indiNode->getNominalIndividual()) { if (incExpData && (incExpData->hasDirectlyChangedNeighbourConnection() || incExpData->isDirectlyChanged())) { if (!incExpData->isPreviousCompletionGraphCompatible()) { nonCompatibleChangedNominalNodeSet->insert(i); } else { compatibleNominalNodeSet->insert(i); } } } else { if (incExpData && (incExpData->hasDirectlyChangedNeighbourConnection() || incExpData->isDirectlyChanged())) { newNodeSet->insert(i); } } if (!incExpData || (!incExpData->hasDirectlyChangedNeighbourConnection() && !incExpData->isDirectlyChanged())) { redundantNodeSet->insert(i); } } } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::checkCompatibilityUpdateDirectlyChangedPropagation(CIndividualProcessNode* individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool compatible = mIncExpHandler->isIndividualNodePreviousCompletionGraphCompatible(individualNode,calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = individualNode->getIncrementalExpansionData(false); if (compatible) { clearPropagatedDirectlyChangedNeighbourConnection(individualNode,true,calcAlgContext); } else { if (incExpData->isDirectlyChanged()) { addIndividualToIncrementalExpansionQueue(individualNode,calcAlgContext); } if (!incExpData->isDirectlyChanged() && !incExpData->hasDirectlyChangedNeighbourConnection()) { CIndividualProcessNode* directlyChangedConnNode = searchDirectlyChangedNeighbourNodeConnection(individualNode,calcAlgContext); if (directlyChangedConnNode && establishDirectlyChangedNeighbourConnection(individualNode,directlyChangedConnNode,true,calcAlgContext)) { propagateDirectlyChangedNeighbourNodeConnection(individualNode,true,calcAlgContext); } } } return compatible; } bool CCalculationTableauCompletionTaskHandleAlgorithm::linkCreationDirectlyChangedNeighbourConnectionUpdate(CIndividualProcessNode* sourceIndi, CIndividualProcessNode* destIndi, bool queueIncrementalExpansion, CCalculationAlgorithmContextBase* calcAlgContext) { bool updatedNeighbourConnection = false; if (establishDirectlyChangedNeighbourConnection(sourceIndi,destIndi,true,calcAlgContext)) { propagateDirectlyChangedNeighbourNodeConnection(sourceIndi,true,calcAlgContext); updatedNeighbourConnection = true; } if (establishDirectlyChangedNeighbourConnection(destIndi,sourceIndi,true,calcAlgContext)) { propagateDirectlyChangedNeighbourNodeConnection(destIndi,true,calcAlgContext); updatedNeighbourConnection = true; } return updatedNeighbourConnection; } bool CCalculationTableauCompletionTaskHandleAlgorithm::establishDirectlyChangedNeighbourConnection(CIndividualProcessNode* individualNode, CIndividualProcessNode* neighbourNodeCandidate, bool queueIncrementalExpansion, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualNodeIncrementalExpansionData* incExpData = individualNode->getIncrementalExpansionData(false); if (!incExpData || !incExpData->hasDirectlyChangedNeighbourConnection() && !incExpData->isDirectlyChanged()) { CIndividualNodeIncrementalExpansionData* candIncExpData = neighbourNodeCandidate->getIncrementalExpansionData(false); if (candIncExpData && (candIncExpData->hasDirectlyChangedNeighbourConnection() || candIncExpData->isDirectlyChanged())) { CIndividualNodeIncrementalExpansionData* locIncExpData = individualNode->getIncrementalExpansionData(true); CIndividualProcessNode* locNeighbourNodeCandidate = getLocalizedIndividual(neighbourNodeCandidate,false,calcAlgContext); locIncExpData->setDirectlyChangedNeighbourConnectionNode(locNeighbourNodeCandidate); CIndividualNodeIncrementalExpansionData* locCandIncExpData = locNeighbourNodeCandidate->getIncrementalExpansionData(true); locCandIncExpData->addNeighbourPropagatedDirectlyChanged(individualNode); if (queueIncrementalExpansion && individualNode->getNominalIndividual()) { addIndividualToIncrementalExpansionQueue(individualNode,calcAlgContext); } return true; } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::propagateDirectlyChangedNeighbourNodeConnection(CIndividualProcessNode* individualNode, bool queueIncrementalExpansion, CCalculationAlgorithmContextBase* calcAlgContext) { CPROCESSINGLIST propNodeList(calcAlgContext->getUsedTaskProcessorContext()); propNodeList.append(individualNode); bool propagatedDirectlyChanged = false; while (!propNodeList.isEmpty()) { CIndividualProcessNode* propIndiNode = propNodeList.takeFirst(); CSuccessorIterator succIt(propIndiNode->getSuccessorIterator()); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(); CIndividualProcessNode* succIndi = getSuccessorIndividual(propIndiNode,succLink,calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = succIndi->getIncrementalExpansionData(false); if (!incExpData || (!incExpData->hasDirectlyChangedNeighbourConnection() && !incExpData->isDirectlyChanged() && !incExpData->isPreviousCompletionGraphCompatible())) { CIndividualProcessNode* locSuccIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); if (establishDirectlyChangedNeighbourConnection(locSuccIndi,propIndiNode,queueIncrementalExpansion,calcAlgContext)) { propagatedDirectlyChanged = true; propNodeList.append(locSuccIndi); } } } CConnectionSuccessorSetIterator connIt(propIndiNode->getConnectionSuccessorIterator()); while (connIt.hasNext()) { cint64 connID = connIt.next(); CIndividualProcessNode* connIndiNode = getUpToDateIndividual(connID,calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = connIndiNode->getIncrementalExpansionData(false); if (!incExpData || (!incExpData->hasDirectlyChangedNeighbourConnection() && !incExpData->isDirectlyChanged() && !incExpData->isPreviousCompletionGraphCompatible())) { CIndividualProcessNode* locConnIndiNode = getLocalizedIndividual(connIndiNode,false,calcAlgContext); if (establishDirectlyChangedNeighbourConnection(locConnIndiNode,propIndiNode,queueIncrementalExpansion,calcAlgContext)) { propagatedDirectlyChanged = true; propNodeList.append(locConnIndiNode); } } } if (propIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { for (CXLinker* blockedNodeLinkerIt = propIndiNode->getBlockedIndividualsLinker(); blockedNodeLinkerIt; blockedNodeLinkerIt = blockedNodeLinkerIt->getNext()) { CIndividualProcessNode* blockedIndiNode = getUpToDateIndividual(blockedNodeLinkerIt->getData(),calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = blockedIndiNode->getIncrementalExpansionData(false); if (!incExpData || (!incExpData->hasDirectlyChangedNeighbourConnection() && !incExpData->isDirectlyChanged() && !incExpData->isPreviousCompletionGraphCompatible())) { CIndividualProcessNode* locBlockedIndiNode = getLocalizedIndividual(blockedIndiNode,false,calcAlgContext); if (establishDirectlyChangedNeighbourConnection(locBlockedIndiNode,propIndiNode,queueIncrementalExpansion,calcAlgContext)) { propagatedDirectlyChanged = true; propNodeList.append(locBlockedIndiNode); } } } for (CXLinker* blockedNodeLinkerIt = propIndiNode->getProcessingBlockedIndividualsLinker(); blockedNodeLinkerIt; blockedNodeLinkerIt = blockedNodeLinkerIt->getNext()) { CIndividualProcessNode* blockedIndiNode = getUpToDateIndividual(blockedNodeLinkerIt->getData(),calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = blockedIndiNode->getIncrementalExpansionData(false); if (!incExpData || (!incExpData->hasDirectlyChangedNeighbourConnection() && !incExpData->isDirectlyChanged() && !incExpData->isPreviousCompletionGraphCompatible())) { CIndividualProcessNode* locBlockedIndiNode = getLocalizedIndividual(blockedIndiNode,false,calcAlgContext); if (establishDirectlyChangedNeighbourConnection(locBlockedIndiNode,propIndiNode,queueIncrementalExpansion,calcAlgContext)) { propagatedDirectlyChanged = true; propNodeList.append(locBlockedIndiNode); } } } CBlockingFollowSet* followSet = propIndiNode->getBlockingFollowSet(false); if (followSet) { for (CBlockingFollowSet::const_iterator it = followSet->constBegin(), itEnd = followSet->constEnd(); it != itEnd; ++it) { cint64 blockedIndiNodeID = *it; CIndividualProcessNode* blockedIndiNode = getUpToDateIndividual(blockedIndiNodeID,calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = blockedIndiNode->getIncrementalExpansionData(false); if (!incExpData || (!incExpData->hasDirectlyChangedNeighbourConnection() && !incExpData->isDirectlyChanged() && !incExpData->isPreviousCompletionGraphCompatible())) { CIndividualProcessNode* locBlockedIndiNode = getLocalizedIndividual(blockedIndiNode,false,calcAlgContext); if (establishDirectlyChangedNeighbourConnection(locBlockedIndiNode,propIndiNode,queueIncrementalExpansion,calcAlgContext)) { propagatedDirectlyChanged = true; propNodeList.append(locBlockedIndiNode); } } } } CIndividualProcessNode* blockerIndiNode = propIndiNode->getBlockerIndividualNode(); if (blockerIndiNode) { blockerIndiNode = getUpToDateIndividual(blockerIndiNode,calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = blockerIndiNode->getIncrementalExpansionData(false); if (!incExpData || (!incExpData->hasDirectlyChangedNeighbourConnection() && !incExpData->isDirectlyChanged() && !incExpData->isPreviousCompletionGraphCompatible())) { CIndividualProcessNode* locBlockerIndiNode = getLocalizedIndividual(blockerIndiNode,false,calcAlgContext); if (establishDirectlyChangedNeighbourConnection(locBlockerIndiNode,propIndiNode,queueIncrementalExpansion,calcAlgContext)) { propagatedDirectlyChanged = true; propNodeList.append(locBlockerIndiNode); } } } CIndividualProcessNode* followingIndiNode = propIndiNode->getFollowingIndividualNode(); if (followingIndiNode) { followingIndiNode = getUpToDateIndividual(followingIndiNode,calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = followingIndiNode->getIncrementalExpansionData(false); if (!incExpData || (!incExpData->hasDirectlyChangedNeighbourConnection() && !incExpData->isDirectlyChanged() && !incExpData->isPreviousCompletionGraphCompatible())) { CIndividualProcessNode* locFollowingIndiNode = getLocalizedIndividual(followingIndiNode,false,calcAlgContext); if (establishDirectlyChangedNeighbourConnection(locFollowingIndiNode,propIndiNode,queueIncrementalExpansion,calcAlgContext)) { propagatedDirectlyChanged = true; propNodeList.append(locFollowingIndiNode); } } } } } return propagatedDirectlyChanged; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::searchDirectlyChangedNeighbourNodeConnection(CIndividualProcessNode* individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { CSuccessorIterator succIt(individualNode->getSuccessorIterator()); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(); CIndividualProcessNode* succIndi = getSuccessorIndividual(individualNode,succLink,calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = succIndi->getIncrementalExpansionData(false); if (incExpData && (incExpData->hasDirectlyChangedNeighbourConnection() || incExpData->isDirectlyChanged())) { return succIndi; } } CConnectionSuccessorSetIterator connIt(individualNode->getConnectionSuccessorIterator()); while (connIt.hasNext()) { cint64 connID = connIt.next(); CIndividualProcessNode* connIndiNode = getUpToDateIndividual(connID,calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = connIndiNode->getIncrementalExpansionData(false); if (incExpData && (incExpData->hasDirectlyChangedNeighbourConnection() || incExpData->isDirectlyChanged())) { return connIndiNode; } } if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { for (CXLinker* blockedNodeLinkerIt = individualNode->getBlockedIndividualsLinker(); blockedNodeLinkerIt; blockedNodeLinkerIt = blockedNodeLinkerIt->getNext()) { CIndividualProcessNode* blockedIndiNode = getUpToDateIndividual(blockedNodeLinkerIt->getData(),calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = blockedIndiNode->getIncrementalExpansionData(false); if (incExpData && (incExpData->hasDirectlyChangedNeighbourConnection() || incExpData->isDirectlyChanged())) { return blockedIndiNode; } } for (CXLinker* blockedNodeLinkerIt = individualNode->getProcessingBlockedIndividualsLinker(); blockedNodeLinkerIt; blockedNodeLinkerIt = blockedNodeLinkerIt->getNext()) { CIndividualProcessNode* blockedIndiNode = getUpToDateIndividual(blockedNodeLinkerIt->getData(),calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = blockedIndiNode->getIncrementalExpansionData(false); if (incExpData && (incExpData->hasDirectlyChangedNeighbourConnection() || incExpData->isDirectlyChanged())) { return blockedIndiNode; } } CBlockingFollowSet* followSet = individualNode->getBlockingFollowSet(false); if (followSet) { for (CBlockingFollowSet::const_iterator it = followSet->constBegin(), itEnd = followSet->constEnd(); it != itEnd; ++it) { cint64 blockedIndiNodeID = *it; CIndividualProcessNode* blockedIndiNode = getUpToDateIndividual(blockedIndiNodeID,calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = blockedIndiNode->getIncrementalExpansionData(false); if (incExpData && (incExpData->hasDirectlyChangedNeighbourConnection() || incExpData->isDirectlyChanged())) { return blockedIndiNode; } } } CIndividualProcessNode* blockerIndiNode = individualNode->getBlockerIndividualNode(); if (blockerIndiNode) { blockerIndiNode = getUpToDateIndividual(blockerIndiNode,calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = blockerIndiNode->getIncrementalExpansionData(false); if (incExpData && (incExpData->hasDirectlyChangedNeighbourConnection() || incExpData->isDirectlyChanged())) { return blockerIndiNode; } } CIndividualProcessNode* followingIndiNode = individualNode->getFollowingIndividualNode(); if (followingIndiNode) { followingIndiNode = getUpToDateIndividual(followingIndiNode,calcAlgContext); CIndividualNodeIncrementalExpansionData* incExpData = followingIndiNode->getIncrementalExpansionData(false); if (incExpData && (incExpData->hasDirectlyChangedNeighbourConnection() || incExpData->isDirectlyChanged())) { return followingIndiNode; } } } return nullptr; } bool CCalculationTableauCompletionTaskHandleAlgorithm::clearDirectlyChangedNeighbourConnection(CIndividualProcessNode* individualNode, bool queueCompatibilityChecks, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualNodeIncrementalExpansionData* incExpData = individualNode->getIncrementalExpansionData(false); if (incExpData && incExpData->hasDirectlyChangedNeighbourConnection()) { CIndividualNodeIncrementalExpansionData* locIncExpData = individualNode->getIncrementalExpansionData(true); locIncExpData->setDirectlyChangedNeighbourConnectionNode(nullptr); if (queueCompatibilityChecks && individualNode->isNominalIndividual()) { calcAlgContext->getUsedProcessingDataBox()->getIncrementalCompatibilityCheckingQueue(true)->insertProcessIndiviudal(individualNode); } clearPropagatedDirectlyChangedNeighbourConnection(individualNode,true,calcAlgContext); return true; } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::clearPropagatedDirectlyChangedNeighbourConnection(CIndividualProcessNode* individualNode, bool queueCompatibilityChecks, CCalculationAlgorithmContextBase* calcAlgContext) { bool propCleared = false; CIndividualNodeIncrementalExpansionData* incExpData = individualNode->getIncrementalExpansionData(false); if (incExpData && incExpData->hasNeighbourPropagatedDirectlyChanged()) { CPROCESSINGLIST clearPropNodeList(calcAlgContext->getUsedTaskProcessorContext()); clearPropNodeList.append(individualNode); while (!clearPropNodeList.isEmpty()) { CIndividualProcessNode* clearPropIndiNode = clearPropNodeList.takeFirst(); CIndividualNodeIncrementalExpansionData* clearIncExpData = clearPropIndiNode->getIncrementalExpansionData(false); CPROCESSLIST* propIndiNodeList = clearIncExpData->getNeighbourPropagatedDirectlyChangedList(false); if (propIndiNodeList && !propIndiNodeList->isEmpty()) { clearIncExpData = clearPropIndiNode->getIncrementalExpansionData(true); propIndiNodeList = clearIncExpData->getNeighbourPropagatedDirectlyChangedList(true); for (CPROCESSLIST::const_iterator it = propIndiNodeList->constBegin(), itEnd = propIndiNodeList->constEnd(); it != itEnd; ++it) { CIndividualProcessNode* propNode(*it); propNode = getUpToDateIndividual(propNode,calcAlgContext); CIndividualNodeIncrementalExpansionData* propIncExpData = propNode->getIncrementalExpansionData(false); if (propIncExpData && propIncExpData->hasDirectlyChangedNeighbourConnection()) { if (propIncExpData->getDirectlyChangedNeighbourConnectionNode()->getIndividualID() == clearPropIndiNode->getIndividualID()) { propCleared = true; propNode = getLocalizedIndividual(propNode,false,calcAlgContext); propIncExpData = propNode->getIncrementalExpansionData(true); propIncExpData->setDirectlyChangedNeighbourConnectionNode(nullptr); if (propIncExpData->hasNeighbourPropagatedDirectlyChanged()) { clearPropNodeList.append(propNode); } if (queueCompatibilityChecks && individualNode->isNominalIndividual()) { calcAlgContext->getUsedProcessingDataBox()->getIncrementalCompatibilityCheckingQueue(true)->insertProcessIndiviudal(individualNode); } } } } clearIncExpData->clearNeighbourPropagatedDirectlyChangedList(); } } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::trackIndividualReferredDependence(cint64 indiID, CCalculationAlgorithmContextBase* calcAlgContext) { return trackIndividualDependence(indiID,true,false,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::trackIndividualExtendedDependence(cint64 indiID, CCalculationAlgorithmContextBase* calcAlgContext) { return trackIndividualDependence(indiID,false,true,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::trackIndividualDependence(cint64 indiID, bool indiReferred, bool indiExtended, CCalculationAlgorithmContextBase* calcAlgContext) { if (calcAlgContext->getUsedProcessingDataBox()->isIndividualDependenceTrackingRequired()) { CReferredIndividualTrackingVector* indiTrackVec = calcAlgContext->getUsedProcessingDataBox()->getReferredIndividualTrackingVector(); if (!indiTrackVec) { CSatisfiableCalculationTask* satCalcTask = calcAlgContext->getSatisfiableCalculationTask(); CSatisfiableTaskIndividualDependenceTrackingAdapter* indiDepTrackAdapter = satCalcTask->getSatisfiableTaskIndividualDependenceTrackingAdapter(); if (indiDepTrackAdapter) { CIndividualDependenceTrackingMarker* indiDepTrackMarker = indiDepTrackAdapter->getIndividualDependenceTrackingMarker(); if (indiDepTrackMarker) { indiDepTrackMarker->setIndividualDependenceTracked(); } CIndividualDependenceTrackingObserver* indDepTrackObserver = indiDepTrackAdapter->getIndividualDependenceTrackingObserver(); if (indDepTrackObserver) { CIndividualDependenceTracking* extendingIndiDepTrack = indDepTrackObserver->getExtendingIndividualDependenceTracking(); CReferredIndividualTrackingVector* extendingRefIndiTrackVec = nullptr; if (extendingIndiDepTrack) { extendingRefIndiTrackVec = dynamic_cast(extendingIndiDepTrack); } if (!extendingRefIndiTrackVec) { cint64 trackIndiCount = calcAlgContext->getProcessingDataBox()->getOntology()->getABox()->getIndividualCount(); CConsistenceData* consData = calcAlgContext->getProcessingDataBox()->getOntology()->getConsistence()->getConsistenceModelData(); if (consData) { CConsistenceTaskData* consTaskData = dynamic_cast(consData); if (consTaskData) { CSatisfiableCalculationTask* cachedSatTask = consTaskData->getDeterministicSatisfiableTask(); if (cachedSatTask) { trackIndiCount = qMax(trackIndiCount,cachedSatTask->getProcessingDataBox()->getIndividualProcessNodeVector()->getItemCount()); } } } extendingRefIndiTrackVec = new CReferredIndividualTrackingVector(); extendingRefIndiTrackVec->initReferredIndividualTrackingVector(trackIndiCount); indiTrackVec = dynamic_cast(indDepTrackObserver->installIndividualDependenceTracking(extendingRefIndiTrackVec)); } else { indiTrackVec = extendingRefIndiTrackVec; } satCalcTask->getProcessingDataBox()->setReferredIndividualTrackingVector(indiTrackVec); } } } if (indiTrackVec) { //CIndividualProcessNode* indiNode = calcAlgContext->getUsedProcessingDataBox()->getIndividualProcessNodeVector()->getData(indiID); //if (indiNode->getNominalIndividual()) { // if (!indiNode->getNominalIndividual()->getIndividualNominalConcept()) { // bool bug = true; // } // if (CIRIName::getRecentIRIName(indiNode->getNominalIndividual()->getIndividualNameLinker()) == "http://www.Department17.University0.edu/SystemsStaff12") { // bool bug = true; // } //} if (indiExtended) { indiTrackVec->setIndividualReferredAndExtended(indiID); } else if (indiReferred) { indiTrackVec->setIndividualReferred(indiID); } return true; } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isConceptFromPredecessorDependent(CIndividualProcessNode*& individualNode, CConceptDescriptor* conDes, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 ancDepth = individualNode->getIndividualAncestorDepth(); bool dependencyToAncestor = false; CDependencyNode* depNode = depTrackPoint->getDependencyNode(); if (depTrackPoint->isPointingToIndependentDependencyNode()) { dependencyToAncestor = true; } else if (depNode->hasAppropriateIndividualNode()) { CIndividualProcessNode* appIndiNode = depNode->getAppropriateIndividualNode(); cint64 appIndiAncDepth = appIndiNode->getIndividualAncestorDepth(); if (appIndiAncDepth < ancDepth) { dependencyToAncestor = true; } } return dependencyToAncestor; } void CCalculationTableauCompletionTaskHandleAlgorithm::testCompletionGraphCachingAndBlocking(CCalculationAlgorithmContextBase* calcAlgContext, CIndividualProcessNode* exceptIndividualNode) { CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CIndividualProcessNodeVector* indiNodeVec = processingDataBox->getIndividualProcessNodeVector(); cint64 indiCount = indiNodeVec->getItemCount(); for (cint64 indiIdx = 0; indiIdx < indiCount; ++indiIdx) { CIndividualProcessNode* indiNode = getLocalizedIndividual(indiIdx,calcAlgContext); if (indiNode && indiNode != exceptIndividualNode) { CConceptProcessingQueue* conProQue = indiNode->getConceptProcessingQueue(false); if (conProQue) { if (!conProQue->isEmpty()) { if (!indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED | CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED | CIndividualProcessNode::PRFINDIRECTBLOCKED | CIndividualProcessNode::PRFPURGEDBLOCKED | CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED | CIndividualProcessNode::PRFDIRECTBLOCKED) ) { if (!indiNode->isImmediatelyProcessingQueued() && !indiNode->isBlockedReactivationProcessingQueued() && !indiNode->isDeterministicExpandingProcessingQueued() && !indiNode->isRegularDepthProcessingQueued() && !indiNode->isProcessingQueued()) { mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); QFile file(QString("caching-error.txt")); if (file.open(QIODevice::WriteOnly)) { file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); file.close(); } bool bug = true; } } if (indiNode->getIndividualID() <= calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID() && indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED)) { if (!indiNode->isImmediatelyProcessingQueued() && !indiNode->isBlockedReactivationProcessingQueued() && !indiNode->isDeterministicExpandingProcessingQueued() && !indiNode->isRegularDepthProcessingQueued() && !indiNode->isProcessingQueued() && !calcAlgContext->getProcessingDataBox()->getEarlyIndividualReactivationProcessingQueue(false)->hasQueuedIndividual(indiNode) && !calcAlgContext->getProcessingDataBox()->getLateIndividualReactivationProcessingQueue(false)->hasQueuedIndividual(indiNode)) { mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); QFile file(QString("caching-error.txt")); if (file.open(QIODevice::WriteOnly)) { file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); file.close(); } bool bug = true; } } } } if (indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED)) { CIndividualProcessNode* ancNode = getAncestorIndividual(indiNode,calcAlgContext); if (!ancNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED | CIndividualProcessNode::PRFSATISFIABLECACHED)) { mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); bool bug = true; } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::analyzeABoxCompressionPossibilities(CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* dataBox = calcAlgContext->getProcessingDataBox(); CIndividualProcessNodeVector* indiProVec = dataBox->getIndividualProcessNodeVector(); QHash signatureCountHash; QHash signatureLabelSizeHash; QHash signatureNonDetHash; QHash signatureFirstIndiNodeHash; cint64 indiCount = indiProVec->getItemCount(); cint64 nonDetCount = 0; for (cint64 indiID = 0; indiID < indiCount; ++indiID) { CIndividualProcessNode* indiNode = indiProVec->getData(indiID); if (indiNode->isNominalIndividual()) { CIndividual* indiNominal = indiNode->getNominalIndividual(); CConcept* nominalConcept = indiNominal->getIndividualNominalConcept(); CConceptSetSignature conSetSignature; bool nonDet = false; CReapplyConceptLabelSet* labelSet = indiNode->getReapplyConceptLabelSet(false); if (labelSet) { for (CConceptDescriptor* conDesIt = labelSet->getAddingSortedConceptDescriptionLinker(); conDesIt; conDesIt = conDesIt->getNextConceptDesciptor()) { CConcept* concept = conDesIt->getConcept(); bool conNegation = conDesIt->isNegated(); if (conDesIt->getDependencyTrackPoint()->getBranchingTag() > 0) { nonDet = true; } if (concept != nominalConcept) { conSetSignature.addConceptSignature(concept,conNegation); } } cint64 signature = conSetSignature.getSignatureValue(); cint64& sigCount = signatureCountHash[signature]; ++sigCount; if (sigCount <= 1) { signatureLabelSizeHash[signature] = labelSet->getConceptCount(); signatureNonDetHash[signature] = nonDet; if (nonDet) { ++nonDetCount; } signatureFirstIndiNodeHash[signature] = indiNode->getIndividualID(); } } } } cout<<"\nNumber of signatures: "<::const_iterator it = signatureCountHash.constBegin(), itEnd = signatureCountHash.constEnd(); it != itEnd; ++it) { cint64 signature = it.key(); cint64 sigCount = it.value(); bool nonDet = signatureNonDetHash[signature]; cint64 labelSize = signatureLabelSizeHash[signature]; cout<<"Count: "<::const_iterator it = mIndiNodeCountMap.constBegin(), itEnd = mIndiNodeCountMap.constEnd(); it != itEnd; ++it) { cint64 indiNodeCount = it.key(); cint64 occurenceCount = it.value(); QString writeString = QString("%1\t%2\r\n").arg(indiNodeCount).arg(occurenceCount); nodeCountMap.write(writeString.toLocal8Bit()); } nodeCountMap.close(); } QFile nodeCountList("nodeCountList.txt"); if (nodeCountList.open(QIODevice::WriteOnly)) { cint64 number = 1; for (QList::const_iterator it = mIndiNodeCountList.constBegin(), itEnd = mIndiNodeCountList.constEnd(); it != itEnd; ++it) { cint64 indiNodeCount = *it; QString writeString = QString("%1\t%2\r\n").arg(number++).arg(indiNodeCount); nodeCountList.write(writeString.toLocal8Bit()); } nodeCountList.close(); } QFile nodeStats("nodeStats.txt"); if (nodeStats.open(QIODevice::WriteOnly)) { QString writeString; cint64 satCachedAncCount = 0; cint64 satCachedCount = 0; cint64 mirrBlockAncCount = 0; cint64 mirrBlockCount = 0; cint64 normalBlockCount = 0; cint64 indirectBlockCount = 0; cint64 prunedBlockCount = 0; cint64 elseCount = 0; cint64 totalCount = 0; for (QHash::const_iterator it = mSignatureIndiNodeStatusHash.constBegin(), itEnd = mSignatureIndiNodeStatusHash.constEnd(); it != itEnd; ++it) { cint64 indiNodeSigt = it.key(); cint64 indiNodeFlags = it.value(); if ((indiNodeFlags & CIndividualProcessNode::PRFSATISFIABLECACHED) != 0) { satCachedCount++; } else if ((indiNodeFlags & CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED) != 0) { satCachedAncCount++; } else if ((indiNodeFlags & CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED) != 0) { mirrBlockCount++; } else if ((indiNodeFlags & CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED) != 0) { mirrBlockAncCount++; } else if ((indiNodeFlags & CIndividualProcessNode::PRFDIRECTBLOCKED) != 0) { normalBlockCount++; } else if ((indiNodeFlags & CIndividualProcessNode::PRFINDIRECTBLOCKED) != 0) { indirectBlockCount++; } else if ((indiNodeFlags & CIndividualProcessNode::PRFPURGEDBLOCKED) != 0) { prunedBlockCount++; } else { elseCount++; } ++totalCount; } cint64 sig1ConFromPredDependentCount = 0; cint64 sig2ConFromPredDependentCount = 0; cint64 sig3ConFromPredDependentCount = 0; cint64 sig4ConFromPredDependentCount = 0; cint64 sig5ConFromPredDependentCount = 0; for (QHash::const_iterator it = mSignatureIndiNodePredDepHash.constBegin(), itEnd = mSignatureIndiNodePredDepHash.constEnd(); it != itEnd; ++it) { cint64 indiNodeSigt = it.key(); cint64 indiNodePredDepCount = it.value(); if (indiNodePredDepCount == 1) { sig1ConFromPredDependentCount++; } else if (indiNodePredDepCount == 2) { sig2ConFromPredDependentCount++; } else if (indiNodePredDepCount == 3) { sig3ConFromPredDependentCount++; } else if (indiNodePredDepCount == 4) { sig4ConFromPredDependentCount++; } else if (indiNodePredDepCount == 5) { sig5ConFromPredDependentCount++; } } writeString = QString("total-nodes-count\t%1\r\n").arg(totalCount); nodeStats.write(writeString.toLocal8Bit()); writeString = QString("different-signatures-count\t%1\r\n").arg(mSignatureIndiNodeStatusHash.uniqueKeys().count()); nodeStats.write(writeString.toLocal8Bit()); writeString = QString("signatures-from-1-predecessor-concept-dependent-count\t%1\r\n").arg(sig1ConFromPredDependentCount); nodeStats.write(writeString.toLocal8Bit()); writeString = QString("signatures-from-2-predecessor-concepts-dependent-count\t%1\r\n").arg(sig2ConFromPredDependentCount); nodeStats.write(writeString.toLocal8Bit()); writeString = QString("signatures-from-3-predecessor-concepts-dependent-count\t%1\r\n").arg(sig3ConFromPredDependentCount); nodeStats.write(writeString.toLocal8Bit()); writeString = QString("signatures-from-4-predecessor-concepts-dependent-count\t%1\r\n").arg(sig4ConFromPredDependentCount); nodeStats.write(writeString.toLocal8Bit()); writeString = QString("signatures-from-5-predecessor-concepts-dependent-count\t%1\r\n").arg(sig5ConFromPredDependentCount); nodeStats.write(writeString.toLocal8Bit()); writeString = QString("normal-blocked-count\t%1\r\n").arg(normalBlockCount); nodeStats.write(writeString.toLocal8Bit()); writeString = QString("indirect-blocked-count\t%1\r\n").arg(indirectBlockCount); nodeStats.write(writeString.toLocal8Bit()); writeString = QString("satisfiable-blocked-count\t%1\r\n").arg(satCachedCount); nodeStats.write(writeString.toLocal8Bit()); writeString = QString("indirect-satisfiable-blocked-count\t%1\r\n").arg(satCachedAncCount); nodeStats.write(writeString.toLocal8Bit()); writeString = QString("mirroring-blocked-count\t%1\r\n").arg(mirrBlockCount); nodeStats.write(writeString.toLocal8Bit()); writeString = QString("indirect-mirroring-blocked-count\t%1\r\n").arg(mirrBlockAncCount); nodeStats.write(writeString.toLocal8Bit()); writeString = QString("other-node-count\t%1\r\n").arg(elseCount); nodeStats.write(writeString.toLocal8Bit()); nodeStats.close(); } } bool CCalculationTableauCompletionTaskHandleAlgorithm::isIndividualNodeValidBlocker(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (individualNode->isNominalIndividual()) { return false; } if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDATEBLOCKERFLAGSCOMPINATION)) { return false; } if (calcAlgContext->hasCompletionGraphCachedIndividualNodes() && !individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED) && individualNode->getIndividualID() <= calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID()) { return false; } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isIndividualNodeCompletionGraphCached(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { detectIndividualNodeCompletionGraphCached(individualNode,calcAlgContext); return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isIndividualNodeBackendCacheSynchronizationProcessingBlocked(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool wasNeigbourExpansionBlocked = individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDNEIGHBOUREXPANSIONBLOCKED); detectIndividualNodeBackendCacheSynchronized(individualNode,calcAlgContext); if (wasNeigbourExpansionBlocked) { if (!individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDNEIGHBOUREXPANSIONBLOCKED)) { if (individualNode->getReverseAssertionRoleLinker() || individualNode->getAssertionRoleLinker()) { calcAlgContext->getProcessingDataBox()->getRoleAssertionProcessingQueue(true)->insertIndiviudalProcessNode(individualNode); } } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::detectIndividualNodeBackendCacheSynchronized(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool synchronized = false; if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKEND | CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDNEIGHBOUREXPANSIONBLOCKED | CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDSUCCESSOREXPANSIONBLOCKED)) { if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTBACKENDSYNCHRONIZATIONDUEDIRECTMODIFIED)) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTBACKENDSYNCHRONIZATIONDUEDIRECTMODIFIED); if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKEND)) { if (!testIndividualNodeBackendCacheSynchronization(individualNode,calcAlgContext)) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKEND); individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDSUCCESSOREXPANSIONBLOCKED); } } if (!individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKEND)) { if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDNEIGHBOUREXPANSIONBLOCKED)) { if (testIndividualNodeBackendCacheNeighbourExpansionBlockingCritical(individualNode,calcAlgContext)) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDNEIGHBOUREXPANSIONBLOCKED); } } if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDNEIGHBOUREXPANSIONBLOCKED | CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDSUCCESSOREXPANSIONBLOCKED)) { if (testIndividualNodeBackendCacheExpansionBlockingCriticalCardinality(individualNode,calcAlgContext)) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDNEIGHBOUREXPANSIONBLOCKED); individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDSUCCESSOREXPANSIONBLOCKED); } } if (individualNode->isCachingLossNodeReactivationInstalled()) { checkIndividualNodesReactivationDueToNominalCachingLoss(individualNode,calcAlgContext); } } } } synchronized = individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKEND); return synchronized; } bool CCalculationTableauCompletionTaskHandleAlgorithm::detectIndividualNodeCompletionGraphCached(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool indiNodeCompGraphCached = false; if (mCompGraphCacheHandler && mConfCompletionGraphCaching) { if (!individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED) && individualNode->getIndividualID() <= calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID()) { individualNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHEDNODELOCATED); if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTCOMPLETIONGRAPHCACHEDDUEDIRECTMODIFIED)) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTCOMPLETIONGRAPHCACHEDDUEDIRECTMODIFIED); } if (!individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALID | CIndividualProcessNode::PRFINVALIDBLOCKINGORCACHING)) { bool conceptSetExtended = false; indiNodeCompGraphCached = mCompGraphCacheHandler->isIndividualNodeCompletionGraphConsistenceBlocked(individualNode,conceptSetExtended,calcAlgContext); if (conceptSetExtended) { individualNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHEDNODEEXTENDED); } } if (!indiNodeCompGraphCached) { trackIndividualExtendedDependence(individualNode->getIndividualID(),calcAlgContext); if (mConfCollectCachingUpdatedBlockableIndiNodes && individualNode->isBlockableIndividual()) { CXLinker* updatedCachedIndiNodeLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); updatedCachedIndiNodeLinker->initLinker(individualNode); calcAlgContext->getUsedProcessingDataBox()->addBlockableIndividualNodeUpdatedLinker(updatedCachedIndiNodeLinker); } if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED)) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED); reapplySatisfiableCachedAbsorbedDisjunctionConcepts(individualNode,calcAlgContext); reapplySatisfiableCachedAbsorbedGeneratingConcepts(individualNode,calcAlgContext); } individualNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED); if (individualNode->isCachingLossNodeReactivationInstalled()) { checkIndividualNodesReactivationDueToNominalCachingLoss(individualNode,calcAlgContext); } CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CIndividualReactivationProcessingQueue* reactProcQueue = nullptr; if (mConfDelayCompletionGraphCachingReactivation) { reactProcQueue = processingDataBox->getLateIndividualReactivationProcessingQueue(true); } else { reactProcQueue = processingDataBox->getEarlyIndividualReactivationProcessingQueue(true); } bool reactivatedIndis = mCompGraphCacheHandler->getReactivationIndividuals(individualNode,reactProcQueue,calcAlgContext); } else { individualNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED); } } } return indiNodeCompGraphCached; } void CCalculationTableauCompletionTaskHandleAlgorithm::commitCacheMessages(CCalculationAlgorithmContextBase* calcAlgContext) { CSatisfiableExpanderCacheHandler* satExpHandler = calcAlgContext->getUsedSatisfiableExpanderCacheHandler(); if (satExpHandler) { satExpHandler->commitCacheMessages(calcAlgContext); } CSaturationNodeExpansionCacheHandler* satNodeExpHandler = calcAlgContext->getUsedSaturationNodeExpansionCacheHandler(); if (satNodeExpHandler) { satNodeExpHandler->commitCacheMessages(calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::testIndividualNodeUnsatisfiableCached(CIndividualProcessNode* individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (mConfTestOccurUnsatCached) { cint64 conSetSize = 0; if (mLastUnsatCacheTestedIndiNode != individualNode && (conSetSize = individualNode->getReapplyConceptLabelSet(false)->getConceptCount()) != mLastUnsatCacheTestedIndiNodeConceptSetSize) { CUnsatisfiableCacheHandler* unsatCacheHandler = calcAlgContext->getUsedUnsatisfiableCacheHandler(); CClashedDependencyDescriptor* clashDescriptors = nullptr; if (unsatCacheHandler) { KONCLUCE_TASK_ALGORITHM_TIME_MEASURE_INSTRUCTION(mUnsatCacheRetrieval.start()); bool unsatCached = unsatCacheHandler->isIndividualNodeUnsatisfiableCached(individualNode,clashDescriptors,calcAlgContext); KONCLUCE_TASK_ALGORITHM_TIME_MEASURE_INSTRUCTION( cint64 timeElapsed = mUnsatCacheRetrieval.elapsed(); STATINCM(TIMEUNSATCACHERETRIVAL,timeElapsed,calcAlgContext); ); if (unsatCached) { if (!mConfUnsatCachingUseNodeSignatureSet || mUnsatCachingSignatureSet.contains(individualNode->getReapplyConceptLabelSet(false)->getConceptSignatureValue())) { if (mConfUnsatCachingUseFullNodeDependency) { clashDescriptors = createClashedIndividualNodeDescriptor(nullptr,individualNode,calcAlgContext); } STATINC(UNSATCACHEUSEDCOUNT,calcAlgContext); throw CCalculationClashProcessingException(clashDescriptors); } } } mLastUnsatCacheTestedIndiNode = individualNode; mLastUnsatCacheTestedIndiNodeConceptSetSize = conSetSize; } } } CClashedDependencyDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::createClashedIndividualNodeDescriptor(CClashedDependencyDescriptor* prevClashes, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CClashedDependencyDescriptor* clashDes = prevClashes; CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CConceptDescriptor* conDesIt = conSet->getAddingSortedConceptDescriptionLinker(); while (conDesIt) { CConceptDescriptor* conDes = conDesIt; clashDes = createClashedConceptDescriptor(clashDes,processIndi,conDes,conDes->getDependencyTrackPoint(),calcAlgContext); conDesIt = conDesIt->getNext(); } return clashDes; } void CCalculationTableauCompletionTaskHandleAlgorithm::testProblematicConceptSet(CCalculationAlgorithmContextBase* calcAlgContext) { if (true) { CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CIndividualProcessNodeVector* indiNodeVec = processingDataBox->getIndividualProcessNodeVector(); cint64 indiCount = indiNodeVec->getItemCount(); cint64 indiIdx = processingDataBox->getOntology()->getABox()->getIndividualCount(); for (; indiIdx < indiCount; ++indiIdx) { CIndividualProcessNode* indiNode = getUpToDateIndividual(indiIdx,calcAlgContext); if (indiNode) { if (!indiNode->isNominalIndividual()) { if (!indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDATEBLOCKERFLAGSCOMPINATION | CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { if (!calcAlgContext->hasCompletionGraphCachedIndividualNodes() || indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED) || indiNode->getIndividualID() > calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID()) { indiNode = getLocalizedIndividual(indiNode,false,calcAlgContext); if (true) { bool base1Con = false; bool base2Con = false; CConceptDescriptor* conDes = indiNode->getReapplyConceptLabelSet(false)->getAddingSortedConceptDescriptionLinker(); for (CConceptDescriptor* conDesIt = conDes; conDesIt; conDesIt = conDesIt->getNext()) { if (!conDesIt->isNegated() && CIRIName::getRecentIRIName(conDesIt->getData()->getClassNameLinker()) == "http://www.w3.org/TR/2003/CR-owl-guide-20030818/food#SweetFruitCourse") { base1Con = true; } if (!conDesIt->isNegated() && CIRIName::getRecentIRIName(conDesIt->getData()->getClassNameLinker()) == "http://www.w3.org/TR/2003/CR-owl-guide-20030818/food#FruitCourse") { base2Con = true; } } if (!base2Con && base1Con) { mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); QFile file(QString("caching-error.txt")); if (file.open(QIODevice::WriteOnly)) { file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); file.close(); } bool bug = true; } } //QStringList conSetList = generateExtendedDebugConceptSetStringList(indiNode->getReapplyConceptLabelSet(false),nullptr,nullptr,calcAlgContext); //debugTestCriticalConceptSet(conSetList,calcAlgContext); } } } } } } } bool CCalculationTableauCompletionTaskHandleAlgorithm::cacheSatisfiableIndividualNodes(CCalculationAlgorithmContextBase* calcAlgContext) { bool nodeCached = false; CSatisfiableExpanderCacheHandler* satisfiableExpHandler = calcAlgContext->getUsedSatisfiableExpanderCacheHandler(); CSaturationNodeExpansionCacheHandler* saturationExpHandler = calcAlgContext->getUsedSaturationNodeExpansionCacheHandler(); if (mConfSatExpCacheWriting && satisfiableExpHandler || mConfSaturationSatisfiabilitiyExpansionCacheWriting && saturationExpHandler) { CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CIndividualProcessNodeVector* indiNodeVec = processingDataBox->getIndividualProcessNodeVector(); cint64 indiCount = indiNodeVec->getItemCount(); cint64 indiIdx = processingDataBox->getOntology()->getABox()->getIndividualCount(); indiIdx = qMax(processingDataBox->getMaxIncrementalPreviousCompletionGraphNodeID(),indiIdx); if (mConfCollectCachingUpdatedBlockableIndiNodes) { for (CXLinker* updatedCachedIndiNodeLinker = processingDataBox->getBlockableIndividualNodeUpdatedLinker(); updatedCachedIndiNodeLinker; updatedCachedIndiNodeLinker = updatedCachedIndiNodeLinker->getNext()) { CIndividualProcessNode* indiNode = updatedCachedIndiNodeLinker->getData(); if (indiNode) { indiNode = getUpToDateIndividual(indiIdx,calcAlgContext); if (indiNode && !indiNode->isNominalIndividual()) { if (mConfSatExpCacheWriting && satisfiableExpHandler && !indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDATEBLOCKERFLAGSCOMPINATION | CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION | CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED)) { if (!calcAlgContext->hasCompletionGraphCachedIndividualNodes() || indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED) || indiNode->getIndividualID() > calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID()) { indiNode = getLocalizedIndividual(indiNode,false,calcAlgContext); nodeCached |= satisfiableExpHandler->cacheIndividualNodeSatisfiable(indiNode,calcAlgContext); } } if (mConfSaturationSatisfiabilitiyExpansionCacheWriting && saturationExpHandler && !indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDATEBLOCKERFLAGSCOMPINATION | CIndividualProcessNode::PRFSUCCESSORNEWNOMINALCONNECTION | CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED)) { if (!calcAlgContext->hasCompletionGraphCachedIndividualNodes() || indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED) || indiNode->getIndividualID() > calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID()) { nodeCached |= saturationExpHandler->tryNodeSatisfiableCaching(indiNode,calcAlgContext); } } } } } indiIdx = qMax(calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID()+1,indiIdx); } for (; indiIdx < indiCount; ++indiIdx) { CIndividualProcessNode* indiNode = getUpToDateIndividual(indiIdx,calcAlgContext); if (indiNode) { if (!indiNode->isNominalIndividual()) { if (mConfSatExpCacheWriting && satisfiableExpHandler && !indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDATEBLOCKERFLAGSCOMPINATION | CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION | CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED)) { if (!calcAlgContext->hasCompletionGraphCachedIndividualNodes() || indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED) || indiNode->getIndividualID() > calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID()) { indiNode = getLocalizedIndividual(indiNode,false,calcAlgContext); //CConceptProcessingQueue* conProQue = indiNode->getConceptProcessingQueue(false); //if (conProQue) { // if (!conProQue->isEmpty()) { // mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // QFile file(QString("caching-error.txt")); // if (file.open(QIODevice::WriteOnly)) { // file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); // } // bool bug = true; // } //} //CConceptDescriptor* conDes = indiNode->getReapplyConceptLabelSet(false)->getAddingSortedConceptDescriptionLinker(); //bool amountSubstanceFound = false; //for (CConceptDescriptor* conDesIt = conDes; conDesIt; conDesIt = conDesIt->getNext()) { // CConcept* concept = conDesIt->getConcept(); // if (concept->getOperatorCode() == CCIMPLALL) { // if (CIRIName::getRecentIRIName(concept->getRole()->getPropertyNameLinker()) == "http://purl.org/biotop/biotop.owl#granularPartOf") { // CConcept* orCocnept = concept->getOperandList()->getData(); // if (orCocnept->getOperatorCode() == CCOR) { // for (CSortedNegLinker* opLinker = orCocnept->getOperandList(); opLinker; opLinker = opLinker->getNext()) { // if (opLinker->getData()->getOperatorCode() == CCSUB && CIRIName::getRecentIRIName(opLinker->getData()->getClassNameLinker()) == "http://purl.org/imbi/dco/dco#AmountOfSubstance") { // amountSubstanceFound = true; // } // } // } // } // } //} //if (amountSubstanceFound) { // bool base1Con = false; // bool base2Con = false; // CConceptDescriptor* conDes = indiNode->getReapplyConceptLabelSet(false)->getAddingSortedConceptDescriptionLinker(); // for (CConceptDescriptor* conDesIt = conDes; conDesIt; conDesIt = conDesIt->getNext()) { // if (!conDesIt->isNegated() && CIRIName::getRecentIRIName(conDesIt->getData()->getClassNameLinker()) == "http://purl.org/biotop/biotop.owl#AmountOfPureSubstance") { // base1Con = true; // } // if (!conDesIt->isNegated() && CIRIName::getRecentIRIName(conDesIt->getData()->getClassNameLinker()) == "http://purl.org/imbi/dco/dco#AmountOfSubstance") { // base2Con = true; // } // } // if (!base2Con && base1Con) { // mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // QFile file(QString("caching-error.txt")); // if (file.open(QIODevice::WriteOnly)) { // file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); // } // bool bug = true; // } //} //QStringList conSetList = generateExtendedDebugConceptSetStringList(indiNode->getReapplyConceptLabelSet(false),nullptr,nullptr,calcAlgContext); //debugTestCriticalConceptSet(conSetList,calcAlgContext); nodeCached |= satisfiableExpHandler->cacheIndividualNodeSatisfiable(indiNode,calcAlgContext); } } if (mConfSaturationSatisfiabilitiyExpansionCacheWriting && saturationExpHandler && !indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDATEBLOCKERFLAGSCOMPINATION | CIndividualProcessNode::PRFSUCCESSORNEWNOMINALCONNECTION | CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED)) { if (!calcAlgContext->hasCompletionGraphCachedIndividualNodes() || indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED) || indiNode->getIndividualID() > calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID()) { nodeCached |= saturationExpHandler->tryNodeSatisfiableCaching(indiNode,calcAlgContext); } } } } } } return nodeCached; } void CCalculationTableauCompletionTaskHandleAlgorithm::debugTestCriticalConceptSet(QStringList& conSetList, CCalculationAlgorithmContextBase* calcAlgContext) { if (conSetList.count() == 67) { bool containAll = true; QSet testConceptSetStringSet; for (QStringList::const_iterator it = conSetList.constBegin(), itEnd = conSetList.constEnd(); containAll && it != itEnd; ++it) { const QString& conString = *it; QString testString = conString; testString = testString.remove("^"); testString = testString.remove("0"); testString = testString.remove("1"); testString = testString.remove("2"); testString = testString.remove("3"); testString = testString.remove("4"); testString = testString.remove("5"); testString = testString.remove("6"); testString = testString.remove("7"); testString = testString.remove("8"); testString = testString.remove("9"); testString = testString.trimmed(); testConceptSetStringSet.insert(testString); } if (testConceptSetStringSet.count() >= mCriticalConceptSetStringSet.count()) { foreach (const QString& testString, mCriticalConceptSetStringSet) { if (!testConceptSetStringSet.contains(testString)) { containAll = false; } } } else { containAll = false; } if (containAll && !mFoundCriticalConceptSet) { mFoundCriticalConceptSet = true; mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); mFoundCriticalConceptSet = false; bool debug = true; } } } bool CCalculationTableauCompletionTaskHandleAlgorithm::testAllSuccessorsProcessedAndWriteSatisfiableCache(CIndividualProcessNode* indiNode, CPROCESSINGSET* processedNodeSet, CSatisfiableExpanderCacheHandler* satExpHandler, CCalculationAlgorithmContextBase* calcAlgContext) { if (!indiNode->isNominalIndividual() && !indiNode->hasBackwardDependencyToAncestorIndividualNode()) { if (!indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDATEBLOCKERFLAGSCOMPINATION | CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { if (!calcAlgContext->hasCompletionGraphCachedIndividualNodes() || indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED) || indiNode->getIndividualID() > calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID()) { CConceptProcessingQueue* conProQue = indiNode->getConceptProcessingQueue(false); if (!conProQue || conProQue->isEmpty()) { if (!processedNodeSet->contains(indiNode)) { processedNodeSet->insert(indiNode); CIndividualProcessNode* ancIndi = getAncestorIndividual(indiNode,calcAlgContext); CSuccessorIterator succIt(indiNode->getSuccessorIterator()); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(); CIndividualProcessNode* succIndi = getSuccessorIndividual(indiNode,succLink,calcAlgContext); if (!ancIndi || succIndi->getIndividualID() != ancIndi->getIndividualID()) { if (!testAllSuccessorsProcessedAndWriteSatisfiableCache(succIndi,processedNodeSet,satExpHandler,calcAlgContext)) { return false; } } } indiNode = getLocalizedIndividual(indiNode,false,calcAlgContext); satExpHandler->cacheIndividualNodeSatisfiable(indiNode,calcAlgContext); return true; } } } } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::writeSatisfiableCachedIndividualNodesOfUnsatisfiableBranch(CCalculationAlgorithmContextBase* calcAlgContext) { bool nodeCached = false; CSatisfiableExpanderCacheHandler* satExpHandler = calcAlgContext->getUsedSatisfiableExpanderCacheHandler(); if (mConfUnsatBranchSatisfiableCaching && mConfSatExpCacheWriting && satExpHandler) { CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CIndividualProcessNodeVector* indiNodeVec = processingDataBox->getIndividualProcessNodeVector(); CPROCESSINGSET* processedNodeSet = CObjectParameterizingAllocator< CPROCESSINGSET,CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); cint64 indiCount = indiNodeVec->getItemCount()-1; for (cint64 indiIdx = 0; indiIdx < indiCount; ++indiIdx) { CIndividualProcessNode* indiNode = getUpToDateIndividual(indiIdx,calcAlgContext); if (indiNode) { if (!indiNode->isNominalIndividual()) { if (!indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDATEBLOCKERFLAGSCOMPINATION | CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { if (!calcAlgContext->hasCompletionGraphCachedIndividualNodes() || indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED) || indiNode->getIndividualID() > calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID()) { CConceptProcessingQueue* conProQue = indiNode->getConceptProcessingQueue(false); if (!conProQue || conProQue->isEmpty()) { // test whether all successor nodes are already processed nodeCached |= testAllSuccessorsProcessedAndWriteSatisfiableCache(indiNode,processedNodeSet,satExpHandler,calcAlgContext); } } } } } } } return nodeCached; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isSaturationCachedProcessingBlocked(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool processingBlocked = false; bool saturationCached = detectIndividualNodeSaturationCached(individualNode,calcAlgContext); if (saturationCached) { // block processing only for successors of saturation cached nodes processingBlocked = individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHED); } return processingBlocked; } bool CCalculationTableauCompletionTaskHandleAlgorithm::detectIndividualNodeSaturationCached(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED) && !individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSATURATIONBLOCKINGCACHEDDUEDIRECTMODIFIED)) { return true; } bool prevSatCached = individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED | CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHED); bool prevSatSuccCreationBlocked = individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONSUCCESSORCREATIONBLOCKINGCACHED); if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHED)) { if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHEDABOLISHED)) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHEDABOLISHED); individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHED); } else { return true; } } if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSATURATIONBLOCKINGCACHEDDUEDIRECTMODIFIED)) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSATURATIONBLOCKINGCACHEDDUEDIRECTMODIFIED); } bool stillSaturationCached = false; if (!individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHEDINVALIDATED)) { CSaturationNodeExpansionCacheHandler* satNodeExpCacheHandler = calcAlgContext->getSaturationNodeExpansionCacheHandler(); if (!stillSaturationCached && satNodeExpCacheHandler && mConfSaturationExpansionCacheReading) { CSaturationNodeAssociatedConceptExpansion* expansion = nullptr; if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHEDRETESTDUETOMODIFICATION)) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHEDRETESTDUETOMODIFICATION); if (satNodeExpCacheHandler->isNodeSatisfiableCached(individualNode,expansion,calcAlgContext)) { stillSaturationCached = true; if (expansion && expansion->getDependentNominalSet(false) && !mConfSaturationCachingWithNominals) { stillSaturationCached = false; } else if (expansion) { installSaturationCachingReactivation(individualNode,expansion->getDependentNominalSet(false),calcAlgContext); if (prevSatSuccCreationBlocked && expansion->getHasTightAtMostRestriction()) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONSUCCESSORCREATIONBLOCKINGCACHED); reapplySatisfiableCachedAbsorbedGeneratingConcepts(individualNode,calcAlgContext); } if (!prevSatSuccCreationBlocked && !expansion->getHasTightAtMostRestriction()) { individualNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONSUCCESSORCREATIONBLOCKINGCACHED); } } } } } } if (!stillSaturationCached) { if (prevSatCached) { STATINC(SATURATIONCACHELOSECOUNT,calcAlgContext); individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED); reactivateIndirectSaturationCachedSuccessors(individualNode,false,calcAlgContext); } if (prevSatSuccCreationBlocked) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONSUCCESSORCREATIONBLOCKINGCACHED); reapplySatisfiableCachedAbsorbedGeneratingConcepts(individualNode,calcAlgContext); } } else { if (!prevSatCached) { STATINC(SATURATIONCACHEESTABLISHCOUNT,calcAlgContext); individualNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED); propagateIndirectSuccessorSaturationBlocked(individualNode,calcAlgContext); } } return stillSaturationCached; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isSatisfiableCachedProcessingBlocked(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool processingBlocked = false; bool satisfiableCached = detectIndividualNodeSatisfiableExpandedCached(individualNode,calcAlgContext); if (satisfiableCached) { // block processing only for successors of satisfiable cached nodes processingBlocked = individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED); } return processingBlocked; } bool CCalculationTableauCompletionTaskHandleAlgorithm::detectIndividualNodeSatisfiableExpandedCached(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool prevSatCached = individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATISFIABLECACHED | CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED); if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED)) { if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHEDABOLISHED)) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHEDABOLISHED); individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED); } else { return true; } } if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSATISFIABLECACHEDDUEDIRECTMODIFIED)) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSATISFIABLECACHEDDUEDIRECTMODIFIED); } //QStringList conSetList = generateExtendedDebugConceptSetStringList(individualNode->getReapplyConceptLabelSet(false),nullptr,nullptr,calcAlgContext); //debugTestCriticalConceptSet(conSetList,calcAlgContext); bool newSatCached = false; CSatisfiableExpanderCacheHandler* satExpHandler = calcAlgContext->getUsedSatisfiableExpanderCacheHandler(); if (!individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION | CIndividualProcessNode::PRFINVALIDBLOCKINGORCACHING | CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED)) { // can only satisfiable cached if there is no nominal if (mConfSatExpCacheRetrieval && satExpHandler) { bool satisfiableCached = false; CSignatureSatisfiableExpanderCacheEntry* entry = nullptr; STATINC(SATEXPCACHERETRIEVALCOUNT,calcAlgContext); if (satExpHandler->isIndividualNodeExpandCached(individualNode,&satisfiableCached,&entry,calcAlgContext)) { STATINC(SATEXPCACHERETRIEVALSUCCESSCOUNT,calcAlgContext); if (mConfSatExpCacheConceptExpansion) { expandCachedConcepts(individualNode,entry,calcAlgContext); if (mConfSatExpCacheSatisfiableBlocking && satisfiableCached && !individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDBLOCKINGORCACHING)) { STATINC(SATEXPCACHERETRIEVALFOUNDSATISFIABLECOUNT,calcAlgContext); bool satCompatible = false; CExpanderBranchedLinker* satBranchCompatibleLinker = nullptr; if (entry->isSatisfiableWithoutBranchedConcepts()) { satCompatible = true; } else { CExpanderBranchedLinker* satBranchLinker = entry->getExpanderBranchedLinker(); if (!satBranchLinker) { satCompatible = true; } else { CIndividualProcessNode* ancestorIndiNode = getAncestorIndividual(individualNode,calcAlgContext); CExpanderBranchedLinker* satBranchLinkerIt = satBranchLinker; while (satBranchLinkerIt && !satCompatible) { bool allSatCompatible = true; STATINC(SATEXPCACHERETRIEVALCOMPATIBILITYTESTCOUNT,calcAlgContext); allSatCompatible = isSatisfiableCachedCompatible(individualNode,satBranchLinkerIt,ancestorIndiNode,calcAlgContext); if (allSatCompatible) { satBranchCompatibleLinker = satBranchLinkerIt; satCompatible = true; } satBranchLinkerIt = satBranchLinkerIt->getNext(); } } } if (satCompatible) { //QStringList conSetList = generateExtendedDebugConceptSetStringList(individualNode->getReapplyConceptLabelSet(false),nullptr,nullptr,calcAlgContext); //debugTestCriticalConceptSet(conSetList,calcAlgContext); STATINC(SATEXPCACHERETRIEVALCOMPATIBLESATCOUNT,calcAlgContext); newSatCached = true; if (!prevSatCached) { individualNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFSATISFIABLECACHED); propagateIndirectSuccessorSatisfiableCached(individualNode,calcAlgContext); } } else { STATINC(SATEXPCACHERETRIEVALINCOMPATIBLESATCOUNT,calcAlgContext); } } } } } if (mConfSatExpCacheWriting && !newSatCached) { if (!individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED | CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED)) { //mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); //QFile file(QString("caching-error.txt")); //if (file.open(QIODevice::WriteOnly)) { // file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); //} satExpHandler->cacheIndividualNodeExpansion(individualNode,calcAlgContext); } } } if (!newSatCached) { if (prevSatCached) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFSATISFIABLECACHED); reactivateIndirectSatisfiableCachedSuccessors(individualNode,false,calcAlgContext); reapplySatisfiableCachedAbsorbedDisjunctionConcepts(individualNode,calcAlgContext); reapplySatisfiableCachedAbsorbedGeneratingConcepts(individualNode,calcAlgContext); } } //if (satExpHandler) { // bool satisfiableCached = false; // CSignatureSatisfiableExpanderCacheEntry* entry = nullptr; // satExpHandler->isIndividualNodeExpandCached(individualNode,&satisfiableCached,&entry,calcAlgContext); // if (entry && !individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDBLOCKINGORCACHING)) { // CReapplyConceptLabelSet* conSet = individualNode->getReapplyConceptLabelSet(false); // cint64 conSetCount = conSet->getConceptCount(); // cint64 expandCount = entry->getExpanderCacheValueCount(); // if (conSetCount != expandCount) { // bool bug = true; // } // } //} return newSatCached; } bool CCalculationTableauCompletionTaskHandleAlgorithm::hasCompatibleConceptSetReuse(CIndividualProcessNode* indiNode, CReapplyConceptLabelSet* subConceptSet, CIndividualProcessNode* reuseNodeCand, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyConceptLabelSet* superConceptSet = reuseNodeCand->getReapplyConceptLabelSet(false); bool isSubset = isLabelConceptSubSet(subConceptSet,superConceptSet,nullptr,nullptr,calcAlgContext); if (!isSubset) { return false; } CReapplyConceptLabelSetIterator superConSetIt = superConceptSet->getConceptLabelSetIterator(false,false,false); while (superConSetIt.hasNext()) { CConceptDescriptor* conDes = superConSetIt.next(); if (isConceptSignatureBlockingCritical(reuseNodeCand,conDes,conDes->getDependencyTrackPoint(),calcAlgContext)) { indiNode->setInvalidSignatureBlocking(true); return false; } } return true; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::searchSignatureReusingIndividualNode(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CSignatureBlockingCandidateHash* sigBlockCandHash = processingDataBox->getSignatureBlockingCandidateHash(false); CReapplyConceptLabelSet* conSet = individualNode->getReapplyConceptLabelSet(false); if (sigBlockCandHash && conSet) { cint64 conCount = conSet->getConceptCount(); if (!individualNode->isInvalidSignatureBlocking() && individualNode->getLastConceptCountSearchBlockingCandidate() != conCount) { individualNode->setLastConceptCountSearchBlockingCandidate(conCount); cint64 conSig = conSet->getConceptSignatureValue(); cint64 newCandCount = sigBlockCandHash->getBlockingCandidatesCount(conSig); cint64 lastCandCount = individualNode->getLastSearchBlockerCandidateCount(); cint64 lastCandSignature = individualNode->getLastSearchBlockerCandidateSignature(); if (lastCandSignature != conSig) { lastCandCount = 0; } individualNode->setLastSearchBlockerCandidateSignature(conSig); if (newCandCount != lastCandCount) { cint64 candDiffCount = newCandCount - lastCandCount; CSignatureBlockingCandidateIterator candIt(sigBlockCandHash->getBlockingCandidatesIterator(conSig)); while (candIt.hasNext() && candDiffCount-- > 0 && !individualNode->isInvalidSignatureBlocking()) { cint64 candIndiID = candIt.next(true); if (candIndiID != individualNode->getIndividualID()) { CIndividualProcessNode* candIndiNode = getUpToDateIndividual(candIndiID,calcAlgContext); if (isIndividualNodeValidBlocker(candIndiNode,calcAlgContext)) { bool compatible = hasCompatibleConceptSetReuse(individualNode,conSet,candIndiNode,calcAlgContext); if (compatible) { individualNode->setLastSearchBlockerCandidateCount(newCandCount-candDiffCount); return candIndiNode; } } } } individualNode->setLastSearchBlockerCandidateCount(newCandCount); } } } return nullptr; } void CCalculationTableauCompletionTaskHandleAlgorithm::removeIndividualReusing(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFREUSINGINDIVIDUAL); removeReusingBlockerFollowing(individualNode,calcAlgContext); reactivateIndirectReuseSuccessors(individualNode,true,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::updateIndividualReusing(CIndividualProcessNode* processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { if (processIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFREUSINGINDIVIDUAL)) { // 1. update non-deterministic expansions, 2. update deterministic expansions CReusingIndividualNodeConceptExpansionData* reusingData = processIndi->getReusingIndividualNodeConceptExpansionData(false); CIndividualProcessNode* reuseIndi = reusingData->getBlockerIndividualNode(); reuseIndi = getUpToDateIndividual(reuseIndi,calcAlgContext); // test whether reused individual is now invalid or blocked if (isIndividualNodeValidBlocker(reuseIndi,calcAlgContext)) { // search other reuseable individual removeReusingBlockerFollowing(processIndi,calcAlgContext); reuseIndi = searchSignatureReusingIndividualNode(processIndi,calcAlgContext); if (reuseIndi) { CReusingIndividualNodeConceptExpansionData* locReusingData = processIndi->getReusingIndividualNodeConceptExpansionData(true); if (!locReusingData) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); locReusingData = CObjectAllocator::allocateAndConstruct(taskMemMan); locReusingData->initBlockingExpansionData(reusingData); reusingData = locReusingData; processIndi->setReusingIndividualNodeConceptExpansionData(locReusingData); } locReusingData->setBlockerIndividualNode(reuseIndi); locReusingData->setBlockingConceptCount(0); locReusingData->setBlockingConceptSignature(0); locReusingData->setLastSubsetTestedConceptDescriptor(nullptr); locReusingData->setContinuousExpandedContainedConceptCount(0); locReusingData->setLastUpdatedConceptCount(0); locReusingData->setLastUpdatedConceptExpansionCount(0); locReusingData->setLastNonDeterministicExpansionLinker(nullptr); addReusingBlockerFollowing(processIndi,calcAlgContext); } else { reactivateIndirectReuseSuccessors(processIndi,true,calcAlgContext); processIndi->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFREUSINGINDIVIDUAL); if (reusingData->isBlockingReviewMarked()) { CReusingReviewData* reusingReviewData = calcAlgContext->getProcessingDataBox()->getReusingReviewData(true); reusingReviewData->remove(processIndi->getIndividualID()); } } } bool reusingIndiCompatible = true; if (reuseIndi) { anlyzeIndiviudalNodesConceptExpansion(reuseIndi,calcAlgContext); CIndividualNodeAnalizedConceptExpansionData* blockerAnalizedConExpData = reuseIndi->getAnalizedConceptExpansionData(false); CXLinker* nonDetExpLinker = blockerAnalizedConExpData->getAnalysedNonDeterministicConceptExpansionLinker(); reusingIndiCompatible &= !blockerAnalizedConExpData->isInvalidBlocker(); CXLinker* lastNonDetExpLinker = reusingData->getLastNonDeterministicExpansionLinker(); CReapplyConceptLabelSet* processIndiLabelSet = processIndi->getReapplyConceptLabelSet(false); if (nonDetExpLinker != lastNonDetExpLinker) { processIndiLabelSet = processIndi->getReapplyConceptLabelSet(true); CReusingIndividualNodeConceptExpansionData* locReusingData = processIndi->getReusingIndividualNodeConceptExpansionData(true); if (!locReusingData) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); locReusingData = CObjectAllocator::allocateAndConstruct(taskMemMan); locReusingData->initBlockingExpansionData(reusingData); reusingData = locReusingData; processIndi->setReusingIndividualNodeConceptExpansionData(locReusingData); } CNonDeterministicDependencyTrackPoint* lastReuseConceptsDepTrackPoint = locReusingData->getReuseConceptsDependencyTrackPoint(); CREUSECONCEPTSDependencyNode* reuseConceptsDepNode = createREUSECONCEPTSDependency(processIndi,nullptr,lastReuseConceptsDepTrackPoint,calcAlgContext); CNonDeterministicDependencyTrackPoint* reuseConceptsDependencyTrackPoint = createNonDeterministicDependencyTrackPointBranch(reuseConceptsDepNode,true,calcAlgContext); for (CXLinker* nonDetExpLinkerIt = nonDetExpLinker; nonDetExpLinkerIt; nonDetExpLinkerIt = nonDetExpLinkerIt->getNext()) { CConceptDescriptor* reusingConDes = nonDetExpLinkerIt->getData(); if (!processIndiLabelSet->containsConceptDescriptor(reusingConDes)) { // add non-deterministically the missing concept addConceptToIndividual(reusingConDes->getConcept(),reusingConDes->isNegated(),processIndi,reuseConceptsDependencyTrackPoint,false,true,calcAlgContext); } } locReusingData->setReuseConceptsDependencyTrackPoint(reuseConceptsDependencyTrackPoint); locReusingData->setLastNonDeterministicExpansionLinker(nonDetExpLinker); } CConceptDescriptor* addingSortedConDes = processIndiLabelSet->getAddingSortedConceptDescriptionLinker(); CConceptDescriptor* lastSubSetTestConDes = reusingData->getLastSubsetTestedConceptDescriptor(); if (addingSortedConDes != lastSubSetTestConDes || blockerAnalizedConExpData->getExpansionConceptCount() != reusingData->getLastUpdatedConceptExpansionCount()) { CReusingIndividualNodeConceptExpansionData* locReusingData = processIndi->getReusingIndividualNodeConceptExpansionData(true); if (!locReusingData) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); locReusingData = CObjectAllocator::allocateAndConstruct(taskMemMan); locReusingData->initBlockingExpansionData(reusingData); reusingData = locReusingData; processIndi->setReusingIndividualNodeConceptExpansionData(locReusingData); } updateSignatureBlockingConceptExpansion(processIndi,locReusingData,reuseIndi,blockerAnalizedConExpData,calcAlgContext); CReapplyConceptLabelSet* reuseIndiLabelSet = reuseIndi->getReapplyConceptLabelSet(false); // validate still subset bool stillSubset = locReusingData->isConceptSetStillSubset(); if (stillSubset) { CConceptDescriptor* addingSortedConDesIt = addingSortedConDes; while (addingSortedConDesIt != lastSubSetTestConDes && stillSubset) { CConcept* concept = addingSortedConDesIt->getConcept(); bool conNegation = addingSortedConDesIt->isNegated(); if (!processIndiLabelSet->containsConcept(concept,conNegation)) { stillSubset = false; } addingSortedConDesIt = addingSortedConDesIt->getNext(); } locReusingData->setConceptSetStillSubset(stillSubset); } locReusingData->setLastSubsetTestedConceptDescriptor(addingSortedConDes); if (!stillSubset) { reusingIndiCompatible = false; } } } if (reuseIndi) { if (!reusingIndiCompatible) { CReusingIndividualNodeConceptExpansionData* locReusingData = processIndi->getReusingIndividualNodeConceptExpansionData(true); if (!locReusingData) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); locReusingData = CObjectAllocator::allocateAndConstruct(taskMemMan); locReusingData->initBlockingExpansionData(reusingData); reusingData = locReusingData; processIndi->setReusingIndividualNodeConceptExpansionData(locReusingData); } if (!locReusingData->isBlockingReviewMarked()) { locReusingData->setBlockingReviewMarked(true); CReusingReviewData* reusingReviewData = calcAlgContext->getProcessingDataBox()->getReusingReviewData(true); reusingReviewData->insert(processIndi->getIndividualAncestorDepth(),processIndi->getIndividualID()); } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::upgradeSignatureBlockingToIndividualReusing(CIndividualProcessNode* processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CSignatureBlockingIndividualNodeConceptExpansionData* sigBlockData = processIndi->getSignatureBlockingIndividualNodeConceptExpansionData(false); CIndividualProcessNode* reuseIndi = sigBlockData->getBlockerIndividualNode(); processIndi->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED); reactivateIndirectSignatureBlockedSuccessors(processIndi,false,calcAlgContext); reapplySatisfiableCachedAbsorbedGeneratingConcepts(processIndi,calcAlgContext); establishIndividualReusing(processIndi,reuseIndi,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::establishIndividualReusing(CIndividualProcessNode* processIndi, CIndividualProcessNode* reuseIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CREUSEINDIVIDUALDependencyNode* reuseDepNode = createREUSEINDIVIDUALDependency(processIndi,nullptr,nullptr,calcAlgContext); CSatisfiableCalculationTask* newTaskList = createDependendBranchingTaskList(2,calcAlgContext); CTaskProcessorContext* processorContext = calcAlgContext->getUsedTaskProcessorContext(); anlyzeIndiviudalNodesConceptExpansion(reuseIndi,calcAlgContext); CIndividualNodeAnalizedConceptExpansionData* blockerAnalizedConExpData = reuseIndi->getAnalizedConceptExpansionData(false); if (blockerAnalizedConExpData) { CXLinker* nonDetExpLinker = blockerAnalizedConExpData->getAnalysedNonDeterministicConceptExpansionLinker(); CSatisfiableCalculationTask* newTaskIt = newTaskList; for (cint64 i = 0; i < 2; ++i) { bool reusingAlternative = i == 0; CSatisfiableCalculationTask* newSatCalcTask = newTaskIt; CProcessContext* newProcessContext = newSatCalcTask->getProcessContext(processorContext); CCalculationAlgorithmContextBase* newCalcAlgContext = createCalculationAlgorithmContext(processorContext,newProcessContext,newSatCalcTask); CProcessingDataBox* newProcessingDataBox = newSatCalcTask->getProcessingDataBox(); CProcessTagger* newProcessTagger = newCalcAlgContext->getUsedProcessTagger(); newProcessTagger->incBranchingTag(); newProcessTagger->incLocalizationTag(); CIndividualProcessNode* newLocIndiNode = getLocalizedIndividual(processIndi,false,newCalcAlgContext); CConceptProcessingQueue* newConProcQueue = newLocIndiNode->getConceptProcessingQueue(true); CReusingIndividualNodeConceptExpansionData* locReusingData = newLocIndiNode->getReusingIndividualNodeConceptExpansionData(true); if (!locReusingData) { CMemoryAllocationManager* taskMemMan = newCalcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReusingIndividualNodeConceptExpansionData* reusingData = newLocIndiNode->getReusingIndividualNodeConceptExpansionData(false); locReusingData = CObjectAllocator::allocateAndConstruct(taskMemMan); locReusingData->initBlockingExpansionData(reusingData); newLocIndiNode->setReusingIndividualNodeConceptExpansionData(locReusingData); } locReusingData->incReusingTriedCount(); locReusingData->setBlockingConceptCount(0); locReusingData->setBlockingConceptSignature(0); locReusingData->setLastSubsetTestedConceptDescriptor(nullptr); locReusingData->setContinuousExpandedContainedConceptCount(0); locReusingData->setBlockerIndividualNode(nullptr); locReusingData->setLastUpdatedConceptCount(0); locReusingData->setLastUpdatedConceptExpansionCount(0); locReusingData->setBlockingReviewMarked(false); if (reusingAlternative) { CNonDeterministicDependencyTrackPoint* newDependencyTrackPoint = createNonDeterministicDependencyTrackPointBranch(reuseDepNode,false,newCalcAlgContext); CREUSECONCEPTSDependencyNode* reuseConceptsDepNode = createREUSECONCEPTSDependency(processIndi,nullptr,newDependencyTrackPoint,newCalcAlgContext); CNonDeterministicDependencyTrackPoint* reuseConceptsDependencyTrackPoint = createNonDeterministicDependencyTrackPointBranch(reuseConceptsDepNode,true,newCalcAlgContext); locReusingData->setReuseConceptsDependencyTrackPoint(reuseConceptsDependencyTrackPoint); CReapplyConceptLabelSet* indiLabelSet = newLocIndiNode->getReapplyConceptLabelSet(true); locReusingData->setBlockingConceptCount(indiLabelSet->getConceptCount()); locReusingData->setBlockingConceptSignature(indiLabelSet->getConceptSignatureValue()); locReusingData->setLastSubsetTestedConceptDescriptor(indiLabelSet->getAddingSortedConceptDescriptionLinker()); locReusingData->setContinuousExpandedContainedConceptCount(0); locReusingData->setBlockerIndividualNode(reuseIndi); locReusingData->setLastUpdatedConceptCount(0); locReusingData->setLastUpdatedConceptExpansionCount(0); for (CXLinker* nonDetExpLinkerIt = nonDetExpLinker; nonDetExpLinkerIt; nonDetExpLinkerIt = nonDetExpLinkerIt->getNext()) { CConceptDescriptor* reusingConDes = nonDetExpLinkerIt->getData(); if (!indiLabelSet->containsConceptDescriptor(reusingConDes)) { // add non-deterministically the missing concept addConceptToIndividual(reusingConDes->getConcept(),reusingConDes->isNegated(),newLocIndiNode,reuseConceptsDependencyTrackPoint,false,true,newCalcAlgContext); } } newLocIndiNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFREUSINGINDIVIDUAL); addReusingBlockerFollowing(newLocIndiNode,newCalcAlgContext); propagateIndirectSuccessorReuseBlocked(newLocIndiNode,newCalcAlgContext); } else { CNonDeterministicDependencyTrackPoint* newDependencyTrackPoint = createNonDeterministicDependencyTrackPointBranch(reuseDepNode,false,newCalcAlgContext); locReusingData->incReusingFailedCount(); locReusingData->addReusingFailedSignatureAndIndividual(reuseIndi->getReapplyConceptLabelSet(false)->getConceptSignatureValue(),reuseIndi->getIndividualID()); } prepareBranchedTaskProcessing(newLocIndiNode,newTaskIt,newCalcAlgContext); // set new task priority double newTaskPriority = calcAlgContext->getUsedTaskPriorityStrategy()->getPriorityForTaskReusing(newSatCalcTask,calcAlgContext->getUsedSatisfiableCalculationTask(),reusingAlternative); newSatCalcTask->setTaskPriority(newTaskPriority); newTaskIt = (CSatisfiableCalculationTask*)newTaskIt->getNext(); } processorContext->getTaskProcessorCommunicator()->communicateTaskCreation(newTaskList); throw CCalculationStopProcessingException(true); } } bool CCalculationTableauCompletionTaskHandleAlgorithm::addReusingBlockerFollowing(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { CReusingIndividualNodeConceptExpansionData* reusingData = individualNode->getReusingIndividualNodeConceptExpansionData(false); if (reusingData) { CIndividualProcessNode* blockerIndividualNode = reusingData->getBlockerIndividualNode(); CIndividualProcessNode* locBlockerIndividualNode = getLocalizedIndividual(blockerIndividualNode,true,calcAlgContext); CBlockingFollowSet* followSet = locBlockerIndividualNode->getBlockingFollowSet(true); followSet->insert(individualNode->getIndividualID()); individualNode->setFollowingIndividualNode(locBlockerIndividualNode); return true; } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::removeReusingBlockerFollowing(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { individualNode->setFollowingIndividualNode(nullptr); CReusingIndividualNodeConceptExpansionData* reusingData = individualNode->getReusingIndividualNodeConceptExpansionData(false); if (reusingData) { CIndividualProcessNode* blockerIndividualNode = reusingData->getBlockerIndividualNode(); CIndividualProcessNode* locBlockerIndividualNode = getLocalizedIndividual(blockerIndividualNode,true,calcAlgContext); CBlockingFollowSet* followSet = locBlockerIndividualNode->getBlockingFollowSet(true); followSet->remove(individualNode->getIndividualID()); return true; } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isSignatureBlockedProcessingBlocked(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool processingBlocked = false; bool sigBlocked = detectIndividualNodeSignatureBlockingStatus(individualNode,calcAlgContext); if (sigBlocked) { // block processing only for successors of satisfiable cached nodes processingBlocked = individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED); } return processingBlocked; } bool CCalculationTableauCompletionTaskHandleAlgorithm::testAlternativeBlocked(CIndividualProcessNode*& individualNode, CBlockingAlternativeData* blockAltData, CCalculationAlgorithmContextBase* calcAlgContext) { bool blocked = false; if (blockAltData->getBlockingAlternativeDataType() == CBlockingAlternativeData::BADSIGNATUREBLOCKINGCANDIDATE) { if (mConfSignatureMirroringBlocking) { CBlockingAlternativeSignatureBlockingCandidateData* sigBlockCandData = (CBlockingAlternativeSignatureBlockingCandidateData*)blockAltData; CIndividualProcessNode* blockerNode = sigBlockCandData->getSignatureBlockingCandidateNode(); STATINC(SIGNATUREMIRRORINGBLOCKINGESTABLISHCOUNT,calcAlgContext); cint64 prevBlockerConSetCount = blockerNode->getReapplyConceptLabelSet(false)->getConceptCount(); if (establishIndividualNodeSignatureBlocking(individualNode,blockerNode,calcAlgContext)) { //if (blockerNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { // propagateIndividualNodeNominalConnectionToAncestors(individualNode,calcAlgContext); //} if (blockerNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { propagateIndividualNodeNominalConnectionStatusToAncestors(individualNode,blockerNode,calcAlgContext); } if (prevBlockerConSetCount != blockerNode->getReapplyConceptLabelSet(false)->getConceptCount()) { addIndividualToBlockingUpdateReviewProcessingQueue(individualNode,calcAlgContext); } addSignatureBlockingBlockerFollowing(individualNode,calcAlgContext); STATINC(SIGNATUREMIRRORINGBLOCKINGADDFOLLOWINGCOUNT,calcAlgContext); calcAlgContext->getProcessTagger()->incCurrentBlockingFollowTag(); individualNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED); propagateIndirectSuccessorSignatureBlocked(individualNode,calcAlgContext); updateBlockingReviewMarking(individualNode,true,calcAlgContext); blocked = true; } } } return blocked; } bool CCalculationTableauCompletionTaskHandleAlgorithm::detectIndividualNodeSignatureBlockingStatus(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { // TODO: 1. search nodes with identical signatures, 2. check signature compatibility, 3. expand concepts and establish blocking status, 4. block successor generation, // 5. hold blocking status as long subset, 6. validate or remove blocking status at the end of completion graph construction bool wasBlockingCached = individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED | CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED); if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED)) { if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHEDABOLISHED)) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHEDABOLISHED); individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED); } else { return true; } } if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSIGNATUREBLOCKINGCACHEDDUEDIRECTMODIFIED)) { individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSIGNATUREBLOCKINGCACHEDDUEDIRECTMODIFIED); } bool newBlockingCached = wasBlockingCached; if (mConfSignatureMirroringBlocking) { bool continueBlockerSearch = true; if (individualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDBLOCKINGORCACHING | CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED)) { continueBlockerSearch = false; } if (wasBlockingCached) { STATINC(SIGNATUREMIRRORINGBLOCKINGREFRESHCOUNT,calcAlgContext); if (continueBlockerSearch) { newBlockingCached = refreshIndividualNodeSignatureBlocking(individualNode,calcAlgContext); } if (!newBlockingCached) { // remove connection from blocker node STATINC(SIGNATUREMIRRORINGBLOCKINGREFRESHLOSEDCOUNT,calcAlgContext); STATINC(SIGNATUREMIRRORINGBLOCKINGREMOVEFOLLOWINGCOUNT,calcAlgContext); removeSignatureBlockingBlockerFollowing(individualNode,calcAlgContext); } else { calcAlgContext->getProcessTagger()->incCurrentBlockingFollowTag(); } } while (continueBlockerSearch && !newBlockingCached) { STATINC(SIGNATUREMIRRORINGBLOCKINGSEARCHCOUNT,calcAlgContext); CIndividualProcessNode* blockerNode = searchSignatureIndividualNodeBlocker(individualNode,calcAlgContext); if (blockerNode) { STATINC(SIGNATUREMIRRORINGBLOCKINGESTABLISHCOUNT,calcAlgContext); cint64 prevBlockerConSetCount = blockerNode->getReapplyConceptLabelSet(false)->getConceptCount(); if (establishIndividualNodeSignatureBlocking(individualNode,blockerNode,calcAlgContext)) { //if (blockerNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { // propagateIndividualNodeNominalConnectionToAncestors(individualNode,calcAlgContext); //} if (blockerNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { propagateIndividualNodeNominalConnectionStatusToAncestors(individualNode,blockerNode,calcAlgContext); } newBlockingCached = true; if (prevBlockerConSetCount != blockerNode->getReapplyConceptLabelSet(false)->getConceptCount()) { addIndividualToBlockingUpdateReviewProcessingQueue(individualNode,calcAlgContext); } addSignatureBlockingBlockerFollowing(individualNode,calcAlgContext); STATINC(SIGNATUREMIRRORINGBLOCKINGADDFOLLOWINGCOUNT,calcAlgContext); calcAlgContext->getProcessTagger()->incCurrentBlockingFollowTag(); } } else { continueBlockerSearch = false; } } updateBlockingReviewMarking(individualNode,newBlockingCached,calcAlgContext); if (newBlockingCached && !wasBlockingCached) { // activate caching status individualNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED); propagateIndirectSuccessorSignatureBlocked(individualNode,calcAlgContext); } else if (wasBlockingCached && !newBlockingCached) { // deactivate caching status individualNode->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED); reactivateIndirectSignatureBlockedSuccessors(individualNode,false,calcAlgContext); reapplySatisfiableCachedAbsorbedGeneratingConcepts(individualNode,calcAlgContext); } } return newBlockingCached; } bool CCalculationTableauCompletionTaskHandleAlgorithm::addSignatureBlockingBlockerFollowing(CIndividualProcessNode*& blockingIndividualNode, CCalculationAlgorithmContextBase* calcAlgContext) { CSignatureBlockingIndividualNodeConceptExpansionData* sigBlockingData = blockingIndividualNode->getSignatureBlockingIndividualNodeConceptExpansionData(false); if (sigBlockingData) { CIndividualProcessNode* blockerIndividualNode = sigBlockingData->getBlockerIndividualNode(); CIndividualProcessNode* locBlockerIndividualNode = getLocalizedIndividual(blockerIndividualNode,true,calcAlgContext); CBlockingFollowSet* sigFollowSet = locBlockerIndividualNode->getBlockingFollowSet(true); sigFollowSet->insert(blockingIndividualNode->getIndividualID()); blockingIndividualNode->setFollowingIndividualNode(locBlockerIndividualNode); return true; } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::removeSignatureBlockingBlockerFollowing(CIndividualProcessNode*& blockingIndividualNode, CCalculationAlgorithmContextBase* calcAlgContext) { blockingIndividualNode->setFollowingIndividualNode(nullptr); CSignatureBlockingIndividualNodeConceptExpansionData* sigBlockingData = blockingIndividualNode->getSignatureBlockingIndividualNodeConceptExpansionData(false); if (sigBlockingData) { CIndividualProcessNode* blockerIndividualNode = sigBlockingData->getBlockerIndividualNode(); CIndividualProcessNode* locBlockerIndividualNode = getLocalizedIndividual(blockerIndividualNode,true,calcAlgContext); CBlockingFollowSet* sigFollowSet = locBlockerIndividualNode->getBlockingFollowSet(true); sigFollowSet->remove(blockingIndividualNode->getIndividualID()); return true; } return false; } void CCalculationTableauCompletionTaskHandleAlgorithm::rebuildSignatureBlockingCandidateHash(CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CProcessContext* processContext = calcAlgContext->getUsedProcessContext(); CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CSignatureBlockingCandidateHash* sigBlockCandHash = processingDataBox->getSignatureBlockingCandidateHash(false); if (sigBlockCandHash) { CSignatureBlockingCandidateHash* newSigBlockCandHash = CObjectParameterizingAllocator< CSignatureBlockingCandidateHash,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,processContext); CSignatureIterator sigIt(sigBlockCandHash->getSignatureIterator()); while (sigIt.hasNext()) { cint64 signature = sigIt.getSignature(); CXLinker* newCandidateLinker = nullptr; CXLinker* candidateLinker = sigIt.getCandidateLinker(); for (CXLinker* candidateLinkerIt = candidateLinker; candidateLinkerIt; candidateLinkerIt = candidateLinkerIt->getNext()) { cint64 candIndiID = candidateLinkerIt->getData(); CIndividualProcessNode* candIndiNode = getUpToDateIndividual(candIndiID,calcAlgContext); if (isIndividualNodeValidBlocker(candIndiNode,calcAlgContext)) { CXLinker* tmpNewCandLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(taskMemMan); newCandidateLinker = tmpNewCandLinker->initLinker(candIndiNode->getIndividualID(),newCandidateLinker); } } if (newCandidateLinker) { newSigBlockCandHash->insertSignatureBlockingCandidates(signature,newCandidateLinker); } sigIt.moveNext(); } processingDataBox->setSignatureBlockingCandidateHash(newSigBlockCandHash); } } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::searchSignatureIndividualNodeBlocker(CIndividualProcessNode*& blockingNode, CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CSignatureBlockingCandidateHash* sigBlockCandHash = processingDataBox->getSignatureBlockingCandidateHash(false); CReapplyConceptLabelSet* conSet = blockingNode->getReapplyConceptLabelSet(false); if (sigBlockCandHash && conSet) { cint64 conCount = conSet->getConceptCount(); if (!blockingNode->isInvalidSignatureBlocking() && blockingNode->getLastConceptCountSearchBlockingCandidate() != conCount) { blockingNode->setLastConceptCountSearchBlockingCandidate(conCount); cint64 conSig = conSet->getConceptSignatureValue(); cint64 newCandCount = sigBlockCandHash->getBlockingCandidatesCount(conSig); cint64 lastCandCount = blockingNode->getLastSearchBlockerCandidateCount(); cint64 lastCandSignature = blockingNode->getLastSearchBlockerCandidateSignature(); if (lastCandSignature != conSig) { lastCandCount = 0; } blockingNode->setLastSearchBlockerCandidateSignature(conSig); if (newCandCount != lastCandCount) { cint64 candDiffCount = newCandCount - lastCandCount; CSignatureBlockingCandidateIterator candIt(sigBlockCandHash->getBlockingCandidatesIterator(conSig)); while (candIt.hasNext() && candDiffCount-- > 0 && !blockingNode->isInvalidSignatureBlocking()) { cint64 candIndiID = candIt.next(true); if (candIndiID != blockingNode->getIndividualID()) { CIndividualProcessNode* candIndiNode = getUpToDateIndividual(candIndiID,calcAlgContext); STATINC(SIGNATUREMIRRORINGBLOCKINGCANDIDATEREGARDEDCOUNT,calcAlgContext); if (isIndividualNodeValidBlocker(candIndiNode,calcAlgContext)) { bool compatible = hasCompatibleConceptSetSignature(blockingNode,conSet,candIndiNode,calcAlgContext); if (compatible) { blockingNode->setLastSearchBlockerCandidateCount(newCandCount-candDiffCount); return candIndiNode; } else { STATINC(SIGNATUREMIRRORINGBLOCKINGCANDIDATEREGARDEDINCOMPATIBLECOUNT,calcAlgContext); } } else { STATINC(SIGNATUREMIRRORINGBLOCKINGCANDIDATEREGARDEDINVALIDCOUNT,calcAlgContext); } } } blockingNode->setLastSearchBlockerCandidateCount(newCandCount); } } } return nullptr; } bool CCalculationTableauCompletionTaskHandleAlgorithm::addSignatureIndividualNodeBlockerCandidate(CIndividualProcessNode*& indiNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (indiNode->getBlockingCachingSavedCandidateCount() <= mMaxBlockingCachingSavedCandidateCount) { indiNode->incBlockingCachingSavedCandidateCount(); if (isIndividualNodeValidBlocker(indiNode,calcAlgContext)) { CReapplyConceptLabelSet* conSet = indiNode->getReapplyConceptLabelSet(false); if (conSet) { cint64 conCount = conSet->getConceptCount(); if (indiNode->getLastConceptCountCachedBlockingCandidate() != conCount) { STATINC(SIGNATURESAVINGCOUNT,calcAlgContext); cint64 conSig = conSet->getConceptSignatureValue(); CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CSignatureBlockingCandidateHash* sigBlockCandHash = processingDataBox->getSignatureBlockingCandidateHash(true); sigBlockCandHash->insertSignatureBlockingCandidate(conSig,indiNode); indiNode->setLastConceptCountCachedBlockingCandidate(conCount); return true; } } } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::establishIndividualNodeSignatureBlocking(CIndividualProcessNode*& blockingIndividualNode, CIndividualProcessNode*& blockerIndividualNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool blockingEstablished = false; anlyzeIndiviudalNodesConceptExpansion(blockerIndividualNode,calcAlgContext); CIndividualNodeAnalizedConceptExpansionData* blockerAnalizedConExpData = blockerIndividualNode->getAnalizedConceptExpansionData(false); if (blockerAnalizedConExpData) { if (!blockerAnalizedConExpData->isInvalidBlocker()) { CReapplyConceptLabelSet* blockingConSet = blockingIndividualNode->getReapplyConceptLabelSet(true); cint64 blockingConSetCount = blockingConSet->getConceptCount(); cint64 blockingConSetSignature = blockingConSet->getConceptSignatureValue(); CConceptDescriptor* blockingLastConDes = blockingConSet->getAddingSortedConceptDescriptionLinker(); CSignatureBlockingIndividualNodeConceptExpansionData* locSigBlockingData = blockingIndividualNode->getSignatureBlockingIndividualNodeConceptExpansionData(true); if (!locSigBlockingData) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CSignatureBlockingIndividualNodeConceptExpansionData* sigBlockingData = blockingIndividualNode->getSignatureBlockingIndividualNodeConceptExpansionData(false); locSigBlockingData = CObjectAllocator::allocateAndConstruct(taskMemMan); locSigBlockingData->initBlockingExpansionData(sigBlockingData); blockingIndividualNode->setSignatureBlockingIndividualNodeConceptExpansionData(locSigBlockingData); } locSigBlockingData->setBlockingConceptCount(blockingConSetCount); locSigBlockingData->setBlockingConceptSignature(blockingConSetSignature); locSigBlockingData->setLastSubsetTestedConceptDescriptor(blockingLastConDes); locSigBlockingData->setContinuousExpandedContainedConceptCount(0); locSigBlockingData->setBlockerIndividualNode(blockerIndividualNode); locSigBlockingData->setLastUpdatedConceptCount(0); locSigBlockingData->setLastUpdatedConceptExpansionCount(0); updateSignatureBlockingConceptExpansion(blockingIndividualNode,locSigBlockingData,blockerIndividualNode,blockerAnalizedConExpData,calcAlgContext); // set blocking status blockingEstablished = true; // is still subset after added expansions concepts CReapplyConceptLabelSet* blockerConSet = blockerIndividualNode->getReapplyConceptLabelSet(false); if (locSigBlockingData->isIdenticConceptSetRequired()) { if (blockingConSet->getConceptSignatureValue() != blockerConSet->getConceptSignatureValue()) { return false; } if (blockingConSet->getConceptCount() != blockerConSet->getConceptCount()) { return false; } } CConceptDescriptor* lastSubSetTestConDes = locSigBlockingData->getLastSubsetTestedConceptDescriptor(); CConceptDescriptor* addingSortedConDes = blockingConSet->getAddingSortedConceptDescriptionLinker(); if (addingSortedConDes != lastSubSetTestConDes) { bool stillSubset = true; CConceptDescriptor* addingSortedConDesIt = addingSortedConDes; while (blockingEstablished && addingSortedConDesIt != lastSubSetTestConDes && stillSubset) { CConcept* concept = addingSortedConDesIt->getConcept(); if (!blockerConSet->containsConcept(concept)) { stillSubset = false; } addingSortedConDesIt = addingSortedConDesIt->getNext(); } if (!stillSubset && mOptSignatureMirroringBlockingForceSubset) { blockingEstablished = false; } locSigBlockingData->setConceptSetStillSubset(stillSubset); if (stillSubset) { locSigBlockingData->setLastSubsetTestedConceptDescriptor(addingSortedConDes); } } } else { blockingIndividualNode->setInvalidSignatureBlocking(true); blockingEstablished = false; } } return blockingEstablished; } bool CCalculationTableauCompletionTaskHandleAlgorithm::refreshIndividualNodeSignatureBlocking(CIndividualProcessNode*& blockingIndividualNode, CCalculationAlgorithmContextBase* calcAlgContext) { CSignatureBlockingIndividualNodeConceptExpansionData* sigBlockingData = blockingIndividualNode->getSignatureBlockingIndividualNodeConceptExpansionData(false); if (sigBlockingData) { CIndividualProcessNode* blockerIndividualNode = sigBlockingData->getBlockerIndividualNode(); blockerIndividualNode = getUpToDateIndividual(blockerIndividualNode,calcAlgContext); if (!isIndividualNodeValidBlocker(blockerIndividualNode,calcAlgContext)) { return false; } if (blockingIndividualNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDBLOCKINGORCACHING)) { return false; } anlyzeIndiviudalNodesConceptExpansion(blockerIndividualNode,calcAlgContext); // test is still subset? CReapplyConceptLabelSet* blockingConSet = blockingIndividualNode->getReapplyConceptLabelSet(false); CReapplyConceptLabelSet* blockerConSet = blockerIndividualNode->getReapplyConceptLabelSet(false); CConceptDescriptor* lastSubSetTestConDes = sigBlockingData->getLastSubsetTestedConceptDescriptor(); CConceptDescriptor* addingSortedConDes = blockingConSet->getAddingSortedConceptDescriptionLinker(); CIndividualNodeAnalizedConceptExpansionData* blockerAnalizedConExpData = blockerIndividualNode->getAnalizedConceptExpansionData(false); if (!blockerAnalizedConExpData->isInvalidBlocker()) { if (addingSortedConDes != lastSubSetTestConDes || blockerAnalizedConExpData->getExpansionConceptCount() != sigBlockingData->getLastUpdatedConceptExpansionCount() || sigBlockingData->isIdenticConceptSetRequired() && blockingConSet->getConceptCount() != blockerConSet->getConceptCount()) { bool stillSubset = true; CConceptDescriptor* addingSortedConDesIt = addingSortedConDes; while (addingSortedConDesIt != lastSubSetTestConDes && stillSubset) { CConcept* concept = addingSortedConDesIt->getConcept(); bool conNegation = addingSortedConDesIt->isNegated(); if (!blockerConSet->containsConcept(concept,conNegation)) { stillSubset = false; } addingSortedConDesIt = addingSortedConDesIt->getNext(); } if (!stillSubset && mOptSignatureMirroringBlockingForceSubset) { return false; } CSignatureBlockingIndividualNodeConceptExpansionData* locSigBlockingData = blockingIndividualNode->getSignatureBlockingIndividualNodeConceptExpansionData(true); if (!locSigBlockingData) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CSignatureBlockingIndividualNodeConceptExpansionData* sigBlockingData = blockingIndividualNode->getSignatureBlockingIndividualNodeConceptExpansionData(false); locSigBlockingData = CObjectAllocator::allocateAndConstruct(taskMemMan); locSigBlockingData->initBlockingExpansionData(sigBlockingData); blockingIndividualNode->setSignatureBlockingIndividualNodeConceptExpansionData(locSigBlockingData); } locSigBlockingData->setLastSubsetTestedConceptDescriptor(addingSortedConDes); // update expansions concepts updateSignatureBlockingConceptExpansion(blockingIndividualNode,locSigBlockingData,blockerIndividualNode,blockerAnalizedConExpData,calcAlgContext); if (mConfDirectRulePreprocessing || locSigBlockingData->isIdenticConceptSetRequired()) { blockingConSet = blockingIndividualNode->getReapplyConceptLabelSet(false); if (locSigBlockingData->isIdenticConceptSetRequired()) { if (blockingConSet->getConceptSignatureValue() != blockerConSet->getConceptSignatureValue()) { return false; } if (blockingConSet->getConceptCount() != blockerConSet->getConceptCount()) { return false; } } // validate still subset addingSortedConDes = blockingConSet->getAddingSortedConceptDescriptionLinker(); lastSubSetTestConDes = locSigBlockingData->getLastSubsetTestedConceptDescriptor(); if (addingSortedConDes != lastSubSetTestConDes) { CConceptDescriptor* addingSortedConDesIt = addingSortedConDes; while (addingSortedConDesIt != lastSubSetTestConDes && stillSubset) { CConcept* concept = addingSortedConDesIt->getConcept(); bool conNegation = addingSortedConDesIt->isNegated(); if (!blockerConSet->containsConcept(concept,conNegation)) { stillSubset = false; } addingSortedConDesIt = addingSortedConDesIt->getNext(); } locSigBlockingData->setConceptSetStillSubset(stillSubset); if (stillSubset) { locSigBlockingData->setLastSubsetTestedConceptDescriptor(addingSortedConDes); } else { if (mOptSignatureMirroringBlockingForceSubset) { return false; } } } } } return true; } else { blockingIndividualNode->setInvalidSignatureBlocking(true); return false; } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::updateBlockingReviewMarking(CIndividualProcessNode*& blockingIndividualNode, bool isBlocked, CCalculationAlgorithmContextBase* calcAlgContext) { CSignatureBlockingIndividualNodeConceptExpansionData* sigBlockingData = blockingIndividualNode->getSignatureBlockingIndividualNodeConceptExpansionData(false); cint64 indiID = blockingIndividualNode->getIndividualID(); if (sigBlockingData) { if (isBlocked && !sigBlockingData->isBlockingReviewMarked()) { CIndividualProcessNode* blockerNode = getUpToDateIndividual(sigBlockingData->getBlockerIndividualNode(),calcAlgContext); if (blockerNode->getReapplyConceptLabelSet(false)->getConceptCount() != blockingIndividualNode->getReapplyConceptLabelSet(false)->getConceptCount() || !sigBlockingData->isConceptSetStillSubset()) { CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CSignatureBlockingReviewSet* revSet = processingDataBox->getSignatureBlockingReviewSet(true); revSet->getReviewData(sigBlockingData->isConceptSetStillSubset())->insert(blockingIndividualNode->getIndividualAncestorDepth(),indiID); CSignatureBlockingIndividualNodeConceptExpansionData* locSigBlockingData = blockingIndividualNode->getSignatureBlockingIndividualNodeConceptExpansionData(true); if (!locSigBlockingData) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); locSigBlockingData = CObjectAllocator::allocateAndConstruct(taskMemMan); locSigBlockingData->initBlockingExpansionData(sigBlockingData); blockingIndividualNode->setSignatureBlockingIndividualNodeConceptExpansionData(locSigBlockingData); } locSigBlockingData->setBlockingReviewMarked(true); locSigBlockingData->setBlockingSubsetReviewMarked(sigBlockingData->isConceptSetStillSubset()); return true; } } if (sigBlockingData->isBlockingReviewMarked()) { CIndividualProcessNode* blockerNode = getUpToDateIndividual(sigBlockingData->getBlockerIndividualNode(),calcAlgContext); if (!isBlocked || blockerNode->getReapplyConceptLabelSet(false)->getConceptCount() == blockingIndividualNode->getReapplyConceptLabelSet(false)->getConceptCount() && sigBlockingData->isConceptSetStillSubset()) { CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CSignatureBlockingReviewSet* revSet = processingDataBox->getSignatureBlockingReviewSet(true); revSet->getReviewData(sigBlockingData->isBlockingSubsetReviewMarked())->remove(indiID); CSignatureBlockingIndividualNodeConceptExpansionData* locSigBlockingData = blockingIndividualNode->getSignatureBlockingIndividualNodeConceptExpansionData(true); if (!locSigBlockingData) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); locSigBlockingData = CObjectAllocator::allocateAndConstruct(taskMemMan); locSigBlockingData->initBlockingExpansionData(sigBlockingData); blockingIndividualNode->setSignatureBlockingIndividualNodeConceptExpansionData(locSigBlockingData); } locSigBlockingData->setBlockingReviewMarked(false); locSigBlockingData->setBlockingSubsetReviewMarked(sigBlockingData->isConceptSetStillSubset()); return true; } else if (sigBlockingData->isBlockingSubsetReviewMarked() != sigBlockingData->isConceptSetStillSubset()) { CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CSignatureBlockingReviewSet* revSet = processingDataBox->getSignatureBlockingReviewSet(true); revSet->getReviewData(sigBlockingData->isBlockingSubsetReviewMarked())->remove(indiID); revSet->getReviewData(sigBlockingData->isConceptSetStillSubset())->insert(blockingIndividualNode->getIndividualAncestorDepth(),indiID); CSignatureBlockingIndividualNodeConceptExpansionData* locSigBlockingData = blockingIndividualNode->getSignatureBlockingIndividualNodeConceptExpansionData(true); if (!locSigBlockingData) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); locSigBlockingData = CObjectAllocator::allocateAndConstruct(taskMemMan); locSigBlockingData->initBlockingExpansionData(sigBlockingData); blockingIndividualNode->setSignatureBlockingIndividualNodeConceptExpansionData(locSigBlockingData); } locSigBlockingData->setBlockingReviewMarked(false); locSigBlockingData->setBlockingSubsetReviewMarked(sigBlockingData->isConceptSetStillSubset()); return true; } } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::updateSignatureBlockingConceptExpansion(CIndividualProcessNode*& blockingIndividualNode, CSignatureBlockingIndividualNodeConceptExpansionData* sigBlockingData, CIndividualProcessNode*& blockerIndividualNode, CIndividualNodeAnalizedConceptExpansionData* blockerAnalizedConExpData, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyConceptLabelSet* blockingConSet = blockingIndividualNode->getReapplyConceptLabelSet(true); cint64 lastUpdatedConExpCount = sigBlockingData->getLastUpdatedConceptExpansionCount(); bool updateDueChangedConcepts = blockingConSet->getConceptCount() != sigBlockingData->getLastUpdatedConceptCount(); bool updateDueChangedExpansions = blockerAnalizedConExpData->getExpansionConceptCount() > lastUpdatedConExpCount; if (updateDueChangedConcepts || updateDueChangedExpansions) { bool retestAllExpansionsConcepts = true; if (lastUpdatedConExpCount > 0 && updateDueChangedExpansions && !updateDueChangedConcepts) { retestAllExpansionsConcepts = false; } cint64 continuousExpConConceptCount = sigBlockingData->getContinuousExpandedContainedConceptCount(); CAnalizedConceptExpansionLinker* analizedConExpLinkerIt = blockerAnalizedConExpData->getReverseAnalizedConceptExpansionLinker(); cint64 skipExpConCount = continuousExpConConceptCount; if (!retestAllExpansionsConcepts) { skipExpConCount = lastUpdatedConExpCount; } cint64 conExpSearchCount = blockerAnalizedConExpData->getExpansionConceptCount() - skipExpConCount; //for (cint64 i = 0; i < skipExpConCount; ++i) { // analizedConExpLinkerIt = analizedConExpLinkerIt->getNext(); //} cint64 updateContinuousExpandedContainedConceptCount = -1; if (!retestAllExpansionsConcepts && sigBlockingData->getContinuousExpandedContainedConceptCount() != sigBlockingData->getLastUpdatedConceptExpansionCount()) { updateContinuousExpandedContainedConceptCount = 0; } sigBlockingData->setLastUpdatedConceptExpansionCount(blockerAnalizedConExpData->getExpansionConceptCount()); cint64 expandedContainedConceptCount = 0; if (sigBlockingData->isConceptSetStillSubset() && blockingConSet->getConceptCount() == blockerAnalizedConExpData->getLastConceptCount()) { // no expansion required sigBlockingData->setContinuousExpandedContainedConceptCount(blockerAnalizedConExpData->getExpansionConceptCount()); sigBlockingData->setLastUpdatedConceptCount(blockingConSet->getConceptCount()); } else { CPROCESSINGLIST revAnalizedConExpList(calcAlgContext->getTaskProcessorContext()); while (conExpSearchCount-- > 0 && analizedConExpLinkerIt) { revAnalizedConExpList.prepend(analizedConExpLinkerIt); analizedConExpLinkerIt = analizedConExpLinkerIt->getNext(); } for (CPROCESSINGLIST::const_iterator it = revAnalizedConExpList.constBegin(), itEnd = revAnalizedConExpList.constEnd(); it != itEnd; ++it) { CAnalizedConceptExpansionLinker* nextAnalizedConExpLinker = *it; CConceptDescriptor* expConDes = nextAnalizedConExpLinker->getConceptDescriptor(); CConcept* expConcept = expConDes->getConcept(); bool expConNegation = expConDes->getNegation(); if (!blockingConSet->containsConcept(expConcept,expConNegation)) { bool allDependenciesExistings = true; CDependency* dependencies = nullptr; CDependencyTrackPoint* firstDepTrackPoint = nullptr; CXLinker* depLinker = nextAnalizedConExpLinker->getDependendConceptDescriptorLinker(); CXLinker* depLinkerIt = depLinker; while (allDependenciesExistings && depLinkerIt) { CConceptDescriptor* depExpConDes = depLinkerIt->getData(); cint64 depConTag = depExpConDes->getConceptTag(); CConceptDescriptor* depConDes = nullptr; CDependencyTrackPoint* depDepTrackPoint = nullptr; if (blockingConSet->getConceptDescriptor(depConTag,depConDes,depDepTrackPoint)) { if (depConDes->isNegated() == depExpConDes->isNegated()) { KONCLUDE_ASSERT_X(depDepTrackPoint,"expandCachedConcepts","missing dependency"); CCONNECTIONDependencyNode* connDepNode = createCONNECTIONDependency(blockingIndividualNode,depConDes,depDepTrackPoint,calcAlgContext); if (!firstDepTrackPoint) { firstDepTrackPoint = connDepNode; } else { dependencies = connDepNode->append(dependencies); } } else { allDependenciesExistings = false; } } else { allDependenciesExistings = false; } depLinkerIt = depLinkerIt->getNext(); } if (allDependenciesExistings) { STATINC(SIGNATUREMIRRORINGBLOCKINGCONCEPTEXPANSIONCOUNT,calcAlgContext); KONCLUDE_ASSERT_X(firstDepTrackPoint,"expandCachedConcepts","missing dependency"); CDependencyTrackPoint* expDepTrackPoint = nullptr; CEXPANDEDDependencyNode* expDepNode = createEXPANDEDDependency(expDepTrackPoint,blockingIndividualNode,firstDepTrackPoint,dependencies,calcAlgContext); addConceptToIndividualSkipANDProcessing(expConcept,expConNegation,blockingIndividualNode,expDepTrackPoint,true,false,calcAlgContext); ++expandedContainedConceptCount; } else { if (updateContinuousExpandedContainedConceptCount < 0) { updateContinuousExpandedContainedConceptCount = expandedContainedConceptCount; } } } else { ++expandedContainedConceptCount; } } if (updateContinuousExpandedContainedConceptCount < 0) { updateContinuousExpandedContainedConceptCount = expandedContainedConceptCount; } sigBlockingData->setContinuousExpandedContainedConceptCount(continuousExpConConceptCount+updateContinuousExpandedContainedConceptCount); sigBlockingData->setLastUpdatedConceptCount(blockingConSet->getConceptCount()); } return true; } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::hasCompatibleConceptSetSignature(CIndividualProcessNode*& blockingNode, CReapplyConceptLabelSet* conSet, CIndividualProcessNode* compatibleTestNode, CCalculationAlgorithmContextBase* calcAlgContext) { // is conSet a compatible concept set to compatibleTestNode CReapplyConceptLabelSet* compTestConSet = compatibleTestNode->getReapplyConceptLabelSet(false); cint64 conCount = conSet->getConceptCount(); cint64 compTestConCount = compTestConSet->getConceptCount(); if (conCount <= 0 || compTestConCount < conCount) { return false; } cint64 diffCount = compTestConCount - conCount; CConceptDescriptor* compTestConDesIt = compTestConSet->getAddingSortedConceptDescriptionLinker(); CConceptDescriptor* conDesIt = conSet->getAddingSortedConceptDescriptionLinker(); while (diffCount-- > 0) { compTestConDesIt = compTestConDesIt->getNext(); } bool orderingCompatible = true; while (orderingCompatible && conDesIt) { CConcept* concept = conDesIt->getConcept(); bool conNeg = conDesIt->getNegation(); if (compTestConDesIt->getData() == concept && compTestConDesIt->getNegation() == conNeg) { if (isConceptSignatureBlockingCritical(blockingNode,conDesIt,conDesIt->getDependencyTrackPoint(),calcAlgContext)) { blockingNode->setInvalidSignatureBlocking(true); return false; } conDesIt = conDesIt->getNext(); compTestConDesIt = compTestConDesIt->getNext(); } else { orderingCompatible = false; } } if (!orderingCompatible) { while (conDesIt) { CConcept* concept = conDesIt->getConcept(); bool conNeg = conDesIt->getNegation(); if (isConceptSignatureBlockingCritical(blockingNode,conDesIt,conDesIt->getDependencyTrackPoint(),calcAlgContext)) { blockingNode->setInvalidSignatureBlocking(true); return false; } if (!conSet->containsConcept(concept,conNeg)) { return false; } conDesIt = conDesIt->getNext(); } } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::anlyzeIndiviudalNodesConceptExpansion(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReapplyConceptLabelSet* conSet = individualNode->getReapplyConceptLabelSet(false); if (conSet) { CConceptDescriptor* lastAddedConDes = conSet->getAddingSortedConceptDescriptionLinker(); CIndividualNodeAnalizedConceptExpansionData* anlConExpData = individualNode->getAnalizedConceptExpansionData(false); bool update = false; if (anlConExpData) { if (!anlConExpData->isInvalidBlocker()) { CConceptDescriptor* lastAnalyzedConDes = anlConExpData->getLastConceptDescriptor(); if (lastAddedConDes != lastAnalyzedConDes) { update = true; } } } else { if (lastAddedConDes) { update = true; } } if (update) { cint64 conSignature = conSet->getConceptSignatureValue(); cint64 conceptCount = conSet->getConceptCount(); individualNode = getLocalizedIndividual(individualNode,false,calcAlgContext); CIndividualNodeAnalizedConceptExpansionData* locAnlConExpData = individualNode->getAnalizedConceptExpansionData(true); cint64 minValidConCount = locAnlConExpData->getMinimalValidConceptCountLimit(); CConceptDescriptor* lastAnalizedConDes = locAnlConExpData->getLastConceptDescriptor(); CAnalizedConceptExpansionLinker* lastAnaConExpLinker = nullptr; CAnalizedConceptExpansionLinker* firstAnaConExpLinker = nullptr; CConceptDescriptor* conDesIt = lastAddedConDes; cint64 currAnalizingCount = conceptCount; bool invalidBlocking = locAnlConExpData->isInvalidBlocker(); CXLinker* nonDetConLinker = nullptr; while (conDesIt && conDesIt != lastAnalizedConDes && !invalidBlocking) { CConceptDescriptor* conDes = conDesIt; CDependencyTrackPoint* depTrackPoint = conDes->getDependencyTrackPoint(); if (isConceptSignatureBlockingCritical(individualNode,conDes,depTrackPoint,calcAlgContext)) { invalidBlocking = true; } else { bool directDependentFlag = false; if (isConceptFromDirectOrPredecessorOrNondeterminismusDependent(individualNode,conDes,depTrackPoint,&directDependentFlag,calcAlgContext)) { if (!directDependentFlag) { // do not add to expansions concepts CXLinker* newNonDetConLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(taskMemMan); newNonDetConLinker->initLinker(conDes); nonDetConLinker = newNonDetConLinker->append(nonDetConLinker); } } else { // try to find dependencies CXLinker* depLinker = nullptr; if (getConceptDependenciesToSameIndividualNode(individualNode,conDes,depTrackPoint,depLinker,calcAlgContext)) { CAnalizedConceptExpansionLinker* analizedConExpLinker = CObjectAllocator::allocateAndConstruct(taskMemMan); analizedConExpLinker->initAnalizedConceptExpansion(depLinker,conDes); if (lastAnaConExpLinker) { lastAnaConExpLinker->setNext(analizedConExpLinker); lastAnaConExpLinker = analizedConExpLinker; } else { lastAnaConExpLinker = analizedConExpLinker; firstAnaConExpLinker = analizedConExpLinker; } } else { CXLinker* newNonDetConLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(taskMemMan); newNonDetConLinker->initLinker(conDes); nonDetConLinker = newNonDetConLinker->append(nonDetConLinker); } } } conDesIt = conDesIt->getNextConceptDesciptor(); --currAnalizingCount; } if (firstAnaConExpLinker) { locAnlConExpData->addAnalizedConceptExpansionLinker(firstAnaConExpLinker); } locAnlConExpData->addAnalysedNonDeterministicConceptExpansionLinker(nonDetConLinker); locAnlConExpData->setInvalidBlocker(invalidBlocking); locAnlConExpData->setLastConceptDescriptor(lastAddedConDes); locAnlConExpData->setLastConceptSignature(conSignature); locAnlConExpData->setLastConceptCount(conceptCount); return true; } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isConceptSignatureBlockingCritical(CIndividualProcessNode*& individualNode, CConceptDescriptor* conDes, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CConcept* concept = conDes->getConcept(); bool conNeg = conDes->getNegation(); cint64 opCode = concept->getOperatorCode(); cint64 param = concept->getParameter(); cint64 cardinality = concept->getParameter() + 1*conNeg; if (cardinality > 1 && (!conNeg && opCode == CCATMOST || conNeg && opCode == CCATLEAST)) { return true; } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isConceptFromDirectOrPredecessorOrNondeterminismusDependent(CIndividualProcessNode*& individualNode, CConceptDescriptor* conDes, CDependencyTrackPoint* depTrackPoint, bool* directDependentFlag, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 ancDepth = individualNode->getIndividualAncestorDepth(); bool dependencyToAncestor = false; CDependencyNode* depNode = depTrackPoint->getDependencyNode(); if (!depTrackPoint->isPointingToDeterministicDependencyNode()) { dependencyToAncestor = true; } else { if (depTrackPoint->isPointingToIndependentDependencyNode()) { dependencyToAncestor = true; } else if (depNode->hasAppropriateIndividualNode()) { CIndividualProcessNode* appIndiNode = depNode->getAppropriateIndividualNode(); cint64 appIndiAncDepth = appIndiNode->getIndividualAncestorDepth(); if (appIndiAncDepth < ancDepth) { dependencyToAncestor = true; } else if (/*mConfDirectRulePreprocessing && */appIndiAncDepth == ancDepth) { dependencyToAncestor = !depNode->hasAdditionalDependencies(); if (*directDependentFlag) { *directDependentFlag = true; } } } else { CDependencyNode::DEPENDENCNODEYTYPE depType = depNode->getDependencyType(); if (depType == CDependencyNode::DNTMERGEDCONCEPT) { dependencyToAncestor = true; } } } return dependencyToAncestor; } bool CCalculationTableauCompletionTaskHandleAlgorithm::getConceptDependenciesToSameIndividualNode(CIndividualProcessNode*& individualNode, CConceptDescriptor* conDes, CDependencyTrackPoint* depTrackPoint, CXLinker*& depLinker, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CDependencyNode* depNode = depTrackPoint->getDependencyNode(); CConceptDescriptor* dependendConDes = depNode->getConceptDescriptor(); bool simpleSameNodeDeps = false; if (depNode->hasAppropriateIndividualNode()) { CIndividualProcessNode* appIndiNode = depNode->getAppropriateIndividualNode(); cint64 appIndiDepth = appIndiNode->getIndividualAncestorDepth(); cint64 baseDepth = individualNode->getIndividualAncestorDepth(); if (appIndiDepth == baseDepth) { simpleSameNodeDeps = true; } } else { simpleSameNodeDeps = true; } if (simpleSameNodeDeps) { if (!depTrackPoint->isPointingToIndependentDependencyNode()) { if (!dependendConDes || depNode->hasAdditionalDependencies()) { simpleSameNodeDeps = false; } } } if (simpleSameNodeDeps) { if (/*!mConfDirectRulePreprocessing*/true) { CXLinker* depedendConDesLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(taskMemMan); depedendConDesLinker->initLinker(dependendConDes,depLinker); depLinker = depedendConDesLinker; return true; } else { return false; } } else { cint64 baseAncDepth = individualNode->getIndividualAncestorDepth(); typedef QPair CDepthDependencyPair; CPROCESSINGSET depSet(calcAlgContext->getTaskProcessorContext()); CPROCESSINGLIST depList(calcAlgContext->getTaskProcessorContext()); depSet.insert(CDepthDependencyPair(baseAncDepth,depTrackPoint)); depList.append(CDepthDependencyPair(baseAncDepth,depTrackPoint)); while (!depList.isEmpty()) { CDepthDependencyPair depthDepPair(depList.takeFirst()); cint64 ancDepth = depthDepPair.first; CDependencyTrackPoint* depTrackPoint = depthDepPair.second; if (!depTrackPoint->isPointingToDeterministicDependencyNode()) { return false; } CDependencyNode* depNode = depTrackPoint->getDependencyNode(); CIndividualProcessNode* appIndiNode = depNode->getAppropriateIndividualNode(); cint64 newAncDepth = ancDepth; bool continueDepLoading = true; if (appIndiNode) { newAncDepth = appIndiNode->getIndividualAncestorDepth(); } if (newAncDepth == baseAncDepth) { CConceptDescriptor* nextConDes = depNode->getConceptDescriptor(); if (nextConDes) { continueDepLoading = false; CXLinker* depedendConDesLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(taskMemMan); depedendConDesLinker->initLinker(nextConDes,depLinker); depLinker = depedendConDesLinker; } } if (newAncDepth < baseAncDepth || depTrackPoint->isPointingToIndependentDependencyNode()) { return false; } if (continueDepLoading) { CDependencyTrackPoint* prevDepTrackPoint = depNode->getPreviousDependencyTrackPoint(); cint64 nextAncDepth = newAncDepth; CDependencyNode* nextDepNode = prevDepTrackPoint->getDependencyNode(); if (nextDepNode && nextDepNode->hasAppropriateIndividualNode()) { nextAncDepth = nextDepNode->getAppropriateIndividualNode()->getIndividualAncestorDepth(); } if (!depSet.contains(CDepthDependencyPair(nextAncDepth,prevDepTrackPoint))) { depSet.insert(CDepthDependencyPair(nextAncDepth,prevDepTrackPoint)); depList.append(CDepthDependencyPair(nextAncDepth,prevDepTrackPoint)); } } CDependencyIterator depIt = depNode->getAdditionalDependencyIterator(); while (depIt.hasNext()) { CDependency* dependency = depIt.nextDependency(); // load additional dependencies CDependencyTrackPoint* prevDepTrackPoint = dependency->getPreviousDependencyTrackPoint(); cint64 nextAncDepth = ancDepth; CDependencyNode* nextDepNode = prevDepTrackPoint->getDependencyNode(); if (nextDepNode && nextDepNode->hasAppropriateIndividualNode()) { nextAncDepth = nextDepNode->getAppropriateIndividualNode()->getIndividualAncestorDepth(); } if (!depSet.contains(CDepthDependencyPair(ancDepth,prevDepTrackPoint))) { depSet.insert(CDepthDependencyPair(ancDepth,prevDepTrackPoint)); depList.append(CDepthDependencyPair(ancDepth,prevDepTrackPoint)); } } } return true; } } bool CCalculationTableauCompletionTaskHandleAlgorithm::reapplySatisfiableCachedAbsorbedDisjunctionConcepts(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool conceptsReapplyed = false; CConceptProcessingQueue* conProQueue = individualNode->getConceptProcessingQueue(true); CReapplyConceptDescriptor* absorbedReapplyConDesLinker = individualNode->getSatisfiableCachedAbsorbedDisjunctionsLinker(); while (absorbedReapplyConDesLinker) { conceptsReapplyed = true; CConceptDescriptor* conDes = absorbedReapplyConDesLinker->getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint = absorbedReapplyConDesLinker->getDependencyTrackPoint(); CProcessingRestrictionSpecification* procRest = absorbedReapplyConDesLinker->getReapplyProcessingRestriction(); addConceptRestrictedToProcessingQueue(conDes,depTrackPoint,conProQueue,individualNode,absorbedReapplyConDesLinker->isStaticDescriptor(),procRest,calcAlgContext); absorbedReapplyConDesLinker = absorbedReapplyConDesLinker->getNext(); } individualNode->clearSatisfiableCachedAbsorbedDisjunctionsLinker(); return conceptsReapplyed; } bool CCalculationTableauCompletionTaskHandleAlgorithm::reapplySatisfiableCachedAbsorbedGeneratingConcepts(CIndividualProcessNode*& individualNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool conceptsReapplyed = false; CConceptProcessingQueue* conProQueue = individualNode->getConceptProcessingQueue(true); CReapplyConceptDescriptor* absorbedReapplyConDesLinker = individualNode->getSatisfiableCachedAbsorbedGeneratingLinker(); while (absorbedReapplyConDesLinker) { conceptsReapplyed = true; CConceptDescriptor* conDes = absorbedReapplyConDesLinker->getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint = absorbedReapplyConDesLinker->getDependencyTrackPoint(); addConceptToProcessingQueue(conDes,depTrackPoint,conProQueue,individualNode,false,calcAlgContext); absorbedReapplyConDesLinker = absorbedReapplyConDesLinker->getNext(); } individualNode->clearSatisfiableCachedAbsorbedGeneratingLinker(); return conceptsReapplyed; } void CCalculationTableauCompletionTaskHandleAlgorithm::addSatisfiableCachedAbsorbedDisjunctionConcept(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode*& processIndi, CProcessingRestrictionSpecification* procRest, CDependencyTrackPoint* dependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReapplyConceptDescriptor* reapplyConDes = CObjectAllocator::allocateAndConstruct(taskMemMan); reapplyConDes->initReapllyDescriptor(conceptDescriptor,dependencyTrackPoint,procRest); processIndi->addSatisfiableCachedAbsorbedDisjunctionsLinker(reapplyConDes); } void CCalculationTableauCompletionTaskHandleAlgorithm::addSatisfiableCachedAbsorbedGeneratingConcept(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReapplyConceptDescriptor* reapplyConDes = CObjectAllocator::allocateAndConstruct(taskMemMan); reapplyConDes->initReapllyDescriptor(conceptDescriptor,dependencyTrackPoint); processIndi->addSatisfiableCachedAbsorbedGeneratingLinker(reapplyConDes); } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndirectSuccessorSignatureBlocked(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { propagateAddingBlockedProcessingRestrictionToSuccessors(indi,CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED,true,CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndirectSuccessorSatisfiableCached(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { propagateAddingBlockedProcessingRestrictionToSuccessors(indi,CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED,true,CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndirectSuccessorReuseBlocked(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { propagateAddingBlockedProcessingRestrictionToSuccessors(indi,CIndividualProcessNode::PRFREUSINGINDIVIDUAL,true,CIndividualProcessNode::PRFANCESTORREUSINGINDIVIDUALBLOCKED,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::isSatisfiableCachedAutomatConceptCompatible(CIndividualProcessNode*& individualNode, CConcept* concept, bool negated, CIndividualProcessNode* ancestorIndiNode, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 opCode = concept->getOperatorCode(); CConceptOperator* conOperator = concept->getConceptOperator(); CSortedNegLinker* opConLinker = concept->getOperandList(); if (!negated && (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQALL_TYPE))) { CRole* role = concept->getRole(); CReapplyConceptLabelSet* ancConSet = ancestorIndiNode->getReapplyConceptLabelSet(false); if (individualNode->hasRoleSuccessorToIndividual(role,ancestorIndiNode,true)) { if (!containsIndividualNodeConcepts(ancConSet,opConLinker,false,calcAlgContext)) { return false; } } } else if (!negated && (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQAND_TYPE))) { CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opCon = opConLinkerIt->getData(); bool opNeg = opConLinkerIt->isNegated(); if (!isSatisfiableCachedAutomatConceptCompatible(individualNode,opCon,opNeg,ancestorIndiNode,calcAlgContext)) { return false; } opConLinkerIt = opConLinkerIt->getNext(); } } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isSatisfiableCachedCompatible(CIndividualProcessNode*& individualNode, CExpanderBranchedLinker* satBranchLinker, CIndividualProcessNode* ancestorIndiNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (ancestorIndiNode) { CSuccessorRoleIterator ancRoleIt = individualNode->getSuccessorRoleIterator(ancestorIndiNode); if (!ancRoleIt.hasNext()) { return true; } CReapplyConceptLabelSet* ancConSet = ancestorIndiNode->getReapplyConceptLabelSet(false); CCACHINGLIST* cacheValueList = satBranchLinker->getCacheValueList(); for (CCACHINGLIST::const_iterator it = cacheValueList->constBegin(), itEnd = cacheValueList->constEnd(); it != itEnd; ++it) { CCacheValue cacheValue(*it); CConcept* concept = (CConcept*)cacheValue.getIdentification(); bool conceptNeg = cacheValue.getCacheValueIdentifier() == CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; CRole* role = concept->getRole(); cint64 opCode = concept->getOperatorCode(); CConceptOperator* conOperator = concept->getConceptOperator(); CSortedNegLinker* opConLinker = concept->getOperandList(); if (!conceptNeg && (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_TYPE)) || conceptNeg && opCode == CCSOME) { bool operandNeg = opCode == CCSOME; if (individualNode->hasRoleSuccessorToIndividual(role,ancestorIndiNode,true)) { if (!containsIndividualNodeConcepts(ancConSet,opConLinker,operandNeg,calcAlgContext)) { return false; } } } else if (!conceptNeg && opCode == CCATMOST || conceptNeg && opCode == CCATLEAST) { if (!opConLinker) { if (individualNode->hasRoleSuccessorToIndividual(role,ancestorIndiNode,true)) { return false; } } else { if (individualNode->hasRoleSuccessorToIndividual(role,ancestorIndiNode,true)) { if (!containsIndividualNodeConcepts(ancConSet,opConLinker,true,calcAlgContext)) { return false; } } } } else if (!conceptNeg && (opCode == CCSOME || opCode == CCATLEAST || opCode == CCAQSOME) || conceptNeg && (opCode == CCALL || opCode == CCATMOST)) { CRole* minSuperRole = nullptr; cint64 minSuperRoleCount = 0; CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { CRole* superRole = superRoleIt->getData(); cint64 superRoleCount = superRole->getIndirectSuperRoleList()->getCount(); if (!minSuperRole || superRoleCount < minSuperRoleCount) { minSuperRoleCount = superRoleCount; minSuperRole = superRole; } superRoleIt = superRoleIt->getNext(); } if (individualNode->hasRoleSuccessorToIndividual(minSuperRole,ancestorIndiNode,true)) { return false; } } else if (!conceptNeg && (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQAND_AQALL_TYPE))) { if (!isSatisfiableCachedAutomatConceptCompatible(individualNode,concept,conceptNeg,ancestorIndiNode,calcAlgContext)) { return false; } } } } return true; } void CCalculationTableauCompletionTaskHandleAlgorithm::expandCachedConcepts(CIndividualProcessNode*& individualNode, CSignatureSatisfiableExpanderCacheEntry* entry, CCalculationAlgorithmContextBase* calcAlgContext) { if (entry) { CReapplyConceptLabelSet* conSet = individualNode->getReapplyConceptLabelSet(true); CMemoryAllocationManager* memMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CDependencyFactory* depFactory = calcAlgContext->getDependencyFactory(); cint64 conSetCount = conSet->getConceptCount(); cint64 expandCount = entry->getExpanderCacheValueCount(); CExpanderCacheValueLinker* expLinker = entry->getExpanderCacheValueLinker(); CCACHINGHASH* expTagHash = entry->getTagExpanderCacheValueHash(); for (cint64 i = 0; i < conSetCount; ++i) { expLinker = expLinker->getNext(); } CExpanderCacheValueLinker* expLinkerIt = expLinker; bool expanded = false; while (expLinkerIt) { CCacheValue* cacheValue = expLinkerIt->getCacheValue(); CConcept* concept = (CConcept*)cacheValue->getIdentification(); bool conceptNeg = cacheValue->getCacheValueIdentifier() == CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; if (!conSet->hasConcept(concept)) { STATINC(SATEXPCACHERETRIEVALEXPANDEDCONCEPTSCOUNT,calcAlgContext); if (!expanded) { STATINC(SATEXPCACHERETRIEVALFOUNDEXPANSIONCOUNT,calcAlgContext); expanded = true; } CDependency* dependencies = nullptr; CDependencyTrackPoint* firstDepTrackPoint = nullptr; CCACHINGLIST* depList = expLinkerIt->getExpanderDependencyList(); for (CCACHINGLIST::const_iterator depIt = depList->constBegin(), depEndIt = depList->constEnd(); depIt != depEndIt; ++depIt) { CExpanderCacheValueLinker* depLinker(*depIt); cint64 depTag = depLinker->getCacheValue()->getTag(); CDependencyTrackPoint* depTrackPoint = nullptr; CConceptDescriptor* depConDes = nullptr; conSet->getConceptDescriptor(depTag,depConDes,depTrackPoint); KONCLUDE_ASSERT_X(depTrackPoint,"expandCachedConcepts","missing dependency"); CCONNECTIONDependencyNode* connDepNode = createCONNECTIONDependency(individualNode,depConDes,depTrackPoint,calcAlgContext); if (!firstDepTrackPoint) { firstDepTrackPoint = connDepNode; } else { dependencies = connDepNode->append(dependencies); } } KONCLUDE_ASSERT_X(firstDepTrackPoint,"expandCachedConcepts","missing dependency"); CDependencyTrackPoint* expDepTrackPoint = nullptr; CEXPANDEDDependencyNode* expDepNode = createEXPANDEDDependency(expDepTrackPoint,individualNode,firstDepTrackPoint,dependencies,calcAlgContext); addConceptToIndividualSkipANDProcessing(concept,conceptNeg,individualNode,expDepTrackPoint,true,false,calcAlgContext); } expLinkerIt = expLinkerIt->getNext(); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::reactivateIndirectReuseSuccessors(CIndividualProcessNode*& indi, bool recursive, CCalculationAlgorithmContextBase* calcAlgContext) { CSuccessorIterator succIt = indi->getSuccessorIterator(); cint64 ancDepth = indi->getIndividualAncestorDepth(); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(indi,succLink,calcAlgContext); cint64 succAncDepth = succIndi->getIndividualAncestorDepth(); if (succAncDepth > ancDepth) { if (succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORREUSINGINDIVIDUALBLOCKED)) { if (!succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORREUSINGINDIVIDUALBLOCKEDABOLISHED)) { CIndividualProcessNode* locIndiNode = getLocalizedIndividual(succIndi,false,calcAlgContext); locIndiNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORREUSINGINDIVIDUALBLOCKEDABOLISHED); } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::reactivateIndirectSignatureBlockedSuccessors(CIndividualProcessNode*& indi, bool recursive, CCalculationAlgorithmContextBase* calcAlgContext) { CSuccessorIterator succIt = indi->getSuccessorIterator(); cint64 ancDepth = indi->getIndividualAncestorDepth(); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(indi,succLink,calcAlgContext); cint64 succAncDepth = succIndi->getIndividualAncestorDepth(); if (succAncDepth > ancDepth) { if (succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED)) { if (!succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHEDABOLISHED)) { CIndividualProcessNode* locIndiNode = getLocalizedIndividual(succIndi,false,calcAlgContext); locIndiNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHEDABOLISHED); addIndividualToProcessingQueue(locIndiNode,calcAlgContext); } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::reactivateIndirectSatisfiableCachedSuccessors(CIndividualProcessNode*& indi, bool recursive, CCalculationAlgorithmContextBase* calcAlgContext) { CSuccessorIterator succIt = indi->getSuccessorIterator(); cint64 ancDepth = indi->getIndividualAncestorDepth(); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(indi,succLink,calcAlgContext); cint64 succAncDepth = succIndi->getIndividualAncestorDepth(); if (succAncDepth > ancDepth) { if (succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED)) { if (!succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHEDABOLISHED)) { CIndividualProcessNode* locIndiNode = getLocalizedIndividual(succIndi,false,calcAlgContext); locIndiNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHEDABOLISHED); addIndividualToProcessingQueue(locIndiNode,calcAlgContext); } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::reactivateIndirectSaturationCachedSuccessors(CIndividualProcessNode*& indi, bool recursive, CCalculationAlgorithmContextBase* calcAlgContext) { CSuccessorIterator succIt = indi->getSuccessorIterator(); cint64 ancDepth = indi->getIndividualAncestorDepth(); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(indi,succLink,calcAlgContext); cint64 succAncDepth = succIndi->getIndividualAncestorDepth(); if (succAncDepth > ancDepth) { if (succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHED)) { if (!succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHEDABOLISHED)) { CIndividualProcessNode* locIndiNode = getLocalizedIndividual(succIndi,false,calcAlgContext); locIndiNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHEDABOLISHED); addIndividualToProcessingQueue(locIndiNode,calcAlgContext); } } } } } QString CCalculationTableauCompletionTaskHandleAlgorithm::generateDebugTrackedClashedDescriptorSummaryString(CTrackedClashedDescriptor* trackedClashDescriptors, CCalculationAlgorithmContextBase* calcAlgContext) { QString clashString; CTrackedClashedDescriptor* trackedClashDescriptorIt = trackedClashDescriptors; while (trackedClashDescriptorIt) { CConceptDescriptor* conDes = trackedClashDescriptorIt->getConceptDescriptor(); QString conceptString("null"); if (conDes) { conceptString = CConceptTextFormater::getConceptString(conDes->getConcept(),conDes->isNegated()); } if (!clashString.isEmpty()) { clashString += QString(", "); } clashString += conceptString; trackedClashDescriptorIt = trackedClashDescriptorIt->getNextDescriptor(); } return clashString; } QString CCalculationTableauCompletionTaskHandleAlgorithm::generateDebugTrackedClashedDescriptorString(CTrackedClashedDescriptor* trackedClashDescriptors, CCalculationAlgorithmContextBase* calcAlgContext) { QString clashListString; CTrackedClashedDescriptor* trackedClashDescriptorIt = trackedClashDescriptors; while (trackedClashDescriptorIt) { CConceptDescriptor* conDes = trackedClashDescriptorIt->getConceptDescriptor(); QString conceptString("null"); if (conDes) { conceptString = CConceptTextFormater::getConceptString(conDes->getConcept(),conDes->isNegated()); } CDependencyTrackPoint* depTrackPoint = trackedClashDescriptorIt->getDependencyTrackPoint(); QString dependencyString = QString("null"); if (depTrackPoint) { QString depTypeString; CDependencyNode* depNode = depTrackPoint->getDependencyNode(); switch (depNode->getDependencyType()) { case CDependencyNode::DNTINDEPENDENTBASE: { depTypeString = QString("INDEPENDENT"); break; } case CDependencyNode::DNTALLDEPENDENCY: { depTypeString = QString("ALL"); break; } case CDependencyNode::DNTSOMEDEPENDENCY: { depTypeString = QString("SOME"); break; } case CDependencyNode::DNTANDDEPENDENCY: { depTypeString = QString("AND"); break; } case CDependencyNode::DNTORDEPENDENCY: { depTypeString = QString("OR"); break; } case CDependencyNode::DNTATLEASTDEPENDENCY: { depTypeString = QString("ATLEAST"); break; } case CDependencyNode::DNTAUTOMATCHOOSEDEPENDENCY: { depTypeString = QString("AUTOMATCHOOSE"); break; } case CDependencyNode::DNTAUTOMATTRANSACTIONDEPENDENCY: { depTypeString = QString("AUTOMATTRANSACTION"); break; } case CDependencyNode::DNTSELFDEPENDENCY: { depTypeString = QString("SELF"); break; } case CDependencyNode::DNTVALUEDEPENDENCY: { depTypeString = QString("VALUE"); break; } case CDependencyNode::DNTNEGVALUEDEPENDENCY: { depTypeString = QString("NEGVALUE"); break; } case CDependencyNode::DNTDISTINCTDEPENDENCY: { depTypeString = QString("DISTINCT"); break; } case CDependencyNode::DNTMERGEDCONCEPT: { depTypeString = QString("MERGEDCONCEPT"); break; } case CDependencyNode::DNTMERGEDLINK: { depTypeString = QString("MERGEDLINK"); break; } case CDependencyNode::DNTMERGEDEPENDENCY: { depTypeString = QString("MERGE"); break; } case CDependencyNode::DNTATMOSTDEPENDENCY: { depTypeString = QString("ATMOST"); break; } case CDependencyNode::DNTQUALIFYDEPENDENCY: { depTypeString = QString("QUALIFY"); break; } case CDependencyNode::DNTFUNCTIONALDEPENDENCY: { depTypeString = QString("FUNCTIONAL"); break; } case CDependencyNode::DNTNOMINALDEPENDENCY: { depTypeString = QString("NOMINAL"); break; } case CDependencyNode::DNTIMPLICATIONDEPENDENCY: { depTypeString = QString("IMPLICATION"); break; } case CDependencyNode::DNTEXPANDEDDEPENDENCY: { depTypeString = QString("EXPANDED"); break; } case CDependencyNode::DNTDATATYPETRIGGERDEPENDENCY: { depTypeString = QString("DATATYPETRIGGER"); break; } } CConceptDescriptor* depNodeConDes = depNode->getConceptDescriptor(); QString conceptDepNodeString("null"); if (depNodeConDes) { conceptDepNodeString = CConceptTextFormater::getConceptString(depNodeConDes->getConcept(),depNodeConDes->isNegated()); } QString depInfoString; if (depNode->isNonDeterministiDependencyNode()) { CNonDeterministicDependencyNode* nonDetDepNode = (CNonDeterministicDependencyNode*)depNode; depInfoString += QString(" NonDetDep, <%1/%2>").arg(nonDetDepNode->getOpenedDependencyTrackingPointsCount()).arg(nonDetDepNode->getBranchTrackPoints()->getCount()); } depInfoString += QString(" + ...(%1)").arg(depNode->getAdditionalDependencyCount()); dependencyString = QString("%1-Dependency: {%2}%3").arg(depTypeString).arg(conceptDepNodeString).arg(depInfoString); } QString clashString = QString("\t[ID:%1 / L:%2 | B:%3]: {%4} --> %5\r\n").arg(trackedClashDescriptorIt->getAppropriatedIndividualID()).arg(trackedClashDescriptorIt->getAppropriatedIndividualLevel()).arg(trackedClashDescriptorIt->getBranchingLevelTag()).arg(conceptString).arg(dependencyString); clashListString += clashString; trackedClashDescriptorIt = trackedClashDescriptorIt->getNextDescriptor(); } clashListString.replace("\r\n","
"); return clashListString; } QString CCalculationTableauCompletionTaskHandleAlgorithm::writeDebugTrackingLineStringToFile(const QString& debugDataString, const QString& fileNameString, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext) { QString tmpDebugDataString = debugDataString; QFile file(QString("./SATCT/Tasks/backtrack-task-%1-%2-%3.txt").arg(calcAlgContext->getUsedSatisfiableCalculationTask()->getTaskDepth()).arg(calcAlgContext->getUsedSatisfiableCalculationTask()->getTaskID()).arg(fileNameString)); if (file.open(QIODevice::WriteOnly)) { file.write(tmpDebugDataString.replace("
","\r\n").toLocal8Bit()); file.close(); } return debugDataString; } QString CCalculationTableauCompletionTaskHandleAlgorithm::generateDebugTrackingLineString(CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext) { QString trackLineString = QString("branching level: %1, individual node level: %2\r\n").arg(trackingLine->getBranchingLevel()).arg(trackingLine->getIndividualNodeLevel()); CTrackedClashedDescriptor* trackedClashDescriptors = nullptr; trackedClashDescriptors = trackingLine->getIndependentTrackedClashedDescriptors(); trackLineString += QString("\r\n$ tracked clashes, independent\r\n%1").arg(generateDebugTrackedClashedDescriptorString(trackedClashDescriptors,calcAlgContext)); trackedClashDescriptors = trackingLine->getLevelTrackedBranchingClashedDescriptors(); trackLineString += QString("\r\n$ tracked clashes, current branching level %2, current individual node level %3\r\n%1").arg(generateDebugTrackedClashedDescriptorString(trackedClashDescriptors,calcAlgContext)).arg(trackingLine->getBranchingLevel()).arg(trackingLine->getIndividualNodeLevel()); trackedClashDescriptors = trackingLine->getLevelTrackedClashedDescriptors(); trackLineString += QString("\r\n$ tracked clashes, current individual node level %3\r\n%1").arg(generateDebugTrackedClashedDescriptorString(trackedClashDescriptors,calcAlgContext)).arg(trackingLine->getIndividualNodeLevel()); trackedClashDescriptors = trackingLine->getPerviousLevelTrackedClashedDescriptors(); trackLineString += QString("\r\n$ tracked clashes, previous individual node levels, not non-deterministic\r\n%1").arg(generateDebugTrackedClashedDescriptorString(trackedClashDescriptors,calcAlgContext)); trackedClashDescriptors = trackingLine->getPerviousLevelTrackedNonDeterministicBranchingClashedDescriptors(); trackLineString += QString("\r\n$ tracked clashes, previous individual node levels, non-deterministic current branching level %2\r\n%1").arg(generateDebugTrackedClashedDescriptorString(trackedClashDescriptors,calcAlgContext)).arg(trackingLine->getBranchingLevel()); trackedClashDescriptors = trackingLine->getPerviousLevelTrackedNonDeterministicClashedDescriptors(); trackLineString += QString("\r\n$ tracked clashes, previous individual node levels, non-deterministic, not current branching level\r\n%1").arg(generateDebugTrackedClashedDescriptorString(trackedClashDescriptors,calcAlgContext)); trackLineString.replace("\r\n","
"); return trackLineString; } void CCalculationTableauCompletionTaskHandleAlgorithm::clashedBacktracking(CClashedDependencyDescriptor* clashes, CCalculationAlgorithmContextBase* calcAlgContext) { calcAlgContext->getProcessingDataBox()->setClashedDescriptorLinker(clashes); //if (!mConfDependencyBackjumping) { // if (!calcAlgContext->getSatisfiableCalculationTask()->getSatisfiableCalculationTaskResult()->hasResult()) { // calcAlgContext->getSatisfiableCalculationTask()->getSatisfiableCalculationTaskResult()->installResult(false); // } // return; //} KONCLUCE_TASK_ALGORITHM_TIME_MEASURE_INSTRUCTION(mTimerBacktracing.start()); //mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); STATINC(CLASHEDBACKTRACKINGSTARTCOUNT,calcAlgContext); CMemoryAllocationManager* tmpMemMan = calcAlgContext->getUsedTemporaryMemoryAllocationManager(); CTrackedClashedDescriptor* trackedClashDescriptors = createTrackedClashesDescriptors(clashes,calcAlgContext); KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mBeginBacktrackingClashString = generateDebugTrackedClashedDescriptorSummaryString(trackedClashDescriptors,calcAlgContext); } ) for (CTrackedClashedDescriptor* trackedClashDesIt = trackedClashDescriptors; trackedClashDesIt; trackedClashDesIt = trackedClashDesIt->getNextDescriptor()) { if (trackedClashDesIt->getAppropriatedIndividualID() <= calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID()) { trackIndividualExtendedDependence(trackedClashDesIt->getAppropriatedIndividualID(),calcAlgContext); } } CPROCESSINGSET clashedSet(calcAlgContext->getUsedTaskProcessorContext()); CTrackedClashedDependencyLine trackingLine(&clashedSet); if (initializeTrackingLine(&trackingLine,trackedClashDescriptors,calcAlgContext)) { KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mBeginBacktrackingTracklineString = writeDebugTrackingLineStringToFile(generateDebugTrackingLineString(&trackingLine,calcAlgContext),"begin",&trackingLine,calcAlgContext); } ) if (trackingLine.getBranchingLevel() == 0) { // jump back to root task / cancellation cancellationRootTask(calcAlgContext); } if (trackingLine.hasOnlyCurrentIndividualNodeLevelClashesDescriptors()) { writeClashDescriptorsToCache(&trackingLine,calcAlgContext); } backtrackFromTrackingLine(&trackingLine,calcAlgContext); KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mEndBacktrackingTracklineString = writeDebugTrackingLineStringToFile(generateDebugTrackingLineString(&trackingLine,calcAlgContext),"end",&trackingLine,calcAlgContext); } ) } KONCLUCE_TASK_ALGORITHM_TIME_MEASURE_INSTRUCTION( cint64 timeElapsed = mTimerBacktracing.elapsed(); STATINCM(TIMEBACKTRACING,timeElapsed,calcAlgContext); ); } bool CCalculationTableauCompletionTaskHandleAlgorithm::rootUnsatisfiabilityWriteCaches(CSatisfiableCalculationTask* task, CCalculationAlgorithmContextBase* calcAlgContext) { CSatisfiableTaskClassificationMessageAdapter* adapter = task->getClassificationMessageAdapter(); if (adapter) { CConcept* concept = adapter->getTestingConcept(); if (concept && adapter->hasExtractionFlags(CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTSUBSUMERSROOTNODE)) { CUnsatisfiableCacheHandler* unsatCacheHandler = calcAlgContext->getUsedUnsatisfiableCacheHandler(); if (unsatCacheHandler && mConfTestedConceptWriteUnsatCaching) { unsatCacheHandler->writeUnsatisfiableClashedConcept(concept,calcAlgContext); } CSaturationNodeExpansionCacheHandler* satNodeExpanderCacheHandler = calcAlgContext->getUsedSaturationNodeExpansionCacheHandler(); if (satNodeExpanderCacheHandler && mConfSaturationConceptUnsatisfiabilitySaturatedCacheWriting) { satNodeExpanderCacheHandler->cacheUnsatisfiableConcept(concept,calcAlgContext); } } } CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CIndividualProcessNode* constIndiNode = processingDataBox->getConstructedIndividualNode(); if (!processingDataBox->hasMultipleConstructionIndividualNodes() && constIndiNode && constIndiNode->isNominalIndividual()) { CXSortedNegLinker* initConLinker = constIndiNode->getInitializingConceptLinker(); CIndividual* individual = constIndiNode->getNominalIndividual(); if (initConLinker && !initConLinker->hasNext()) { CConcept* initConcept = initConLinker->getData(); bool conNegation = initConLinker->isNegated(); if (mConfCacheComputedConsequences && mCompConsCacheHandler) { mCompConsCacheHandler->tryCacheTypeConcept(individual,initConcept,!conNegation,calcAlgContext); } } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::cancellationRootTask(CCalculationAlgorithmContextBase* calcAlgContext) { CSatisfiableCalculationTask* rootTask = (CSatisfiableCalculationTask*)calcAlgContext->getSatisfiableCalculationTask()->getRootTask(); STATINC(TASKROOTBACKJUMPINGCOUNT,calcAlgContext); STATINC(ROOTTASKUNSATISFIABLECOUNT,calcAlgContext); rootUnsatisfiabilityWriteCaches(rootTask,calcAlgContext); //mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); //QFile file(QString("./SATCT/Tasks/task-root-clashed.txt")); //if (file.open(QIODevice::WriteOnly)) { // file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); //} //mBranchLevelClosedCountString.clear(); //cint64 maxBraLevel = mClosedBranchLevelCountHash.size(); //cint64 foundLevel = 0; //for (cint64 i = 0; foundLevel < maxBraLevel; ++i) { // cint64 levelCount = mClosedBranchLevelCountHash.value(i,0); // if (levelCount > 0) { // ++foundLevel; // } // mBranchLevelClosedCountString += QString("%1: %2\n").arg(i).arg(levelCount); //} return cancellationTask(rootTask,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::cancellationTask(CSatisfiableCalculationTask* task, CCalculationAlgorithmContextBase* calcAlgContext) { if (!task->getSatisfiableCalculationTaskResult()->hasResult()) { task->getSatisfiableCalculationTaskResult()->installResult(false); if (mConfDependencyBackjumping) { STATINC(TASKBACKJUMPINGCOUNT,calcAlgContext); if (calcAlgContext->getUsedSatisfiableCalculationTask() != task) { STATINC(TASKAWAYBACKJUMPINGCOUNT,calcAlgContext); } CTaskProcessorContext* processorContext = calcAlgContext->getUsedTaskProcessorContext(); processorContext->getTaskProcessorCommunicator()->communicateTaskStatusUpdate(task); return true; } } return false; } CTrackedClashedDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::getFreeTrackedClashedDescriptor(CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext) { CTrackedClashedDescriptor* des = trackingLine->takeNextFreeTrackedClashedDescriptor(); if (!des) { CMemoryAllocationManager* tmpMemMan = calcAlgContext->getUsedTemporaryMemoryAllocationManager(); des = CObjectAllocator< CTrackedClashedDescriptor >::allocateAndConstruct(tmpMemMan); } return des; } bool CCalculationTableauCompletionTaskHandleAlgorithm::backtrackFromTrackingLine(CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 backtrackStep = 0; while (backtrackFromTrackingLineStep(trackingLine,calcAlgContext)) { // until backtracking failed KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mFileBacktrackingStepTracklineString = writeDebugTrackingLineStringToFile(generateDebugTrackingLineString(trackingLine,calcAlgContext),QString("step-%1").arg(backtrackStep++),trackingLine,calcAlgContext); } ) } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::backtrackFromTrackingLineStep(CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext) { bool trackingSuccess = true; bool prevLevelBacktracked = false; STATINC(CLASHEDBACKTRACKINGSTEPSCOUNT,calcAlgContext); KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mBeginBacktrackingStepTracklineString = generateDebugTrackingLineString(trackingLine,calcAlgContext); } ) // step 1: backtrack all deterministic dependencies in previous individual node levels while (trackingLine->hasPerviousLevelTrackedClashedDescriptors() && trackingSuccess) { CTrackedClashedDescriptor* trackedClashedDes = trackingLine->takeNextPerviousLevelTrackedClashedDescriptor(); STATINC(CLASHEDBACKTRACKINGPREVNODELEVELCOUNT,calcAlgContext); KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mBeginDetPrevBacktrackingStepTracklineString = generateDebugTrackingLineString(trackingLine,calcAlgContext); } ) trackingSuccess &= backtrackDeterministicClashedDescriptorFromPreviousIndividualNodeLevels(trackedClashedDes,trackingLine,calcAlgContext); KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mEndDetPrevBacktrackingStepTracklineString = generateDebugTrackingLineString(trackingLine,calcAlgContext); } ) prevLevelBacktracked = true; } if (prevLevelBacktracked) { if (trackingLine->hasOnlyCurrentIndividualNodeLevelClashesDescriptors()) { // write clashes to cache writeClashDescriptorsToCache(trackingLine,calcAlgContext); } } // step 2: backtrack non-deterministic dependencies in previous individual node levels with current branching level if (trackingLine->hasPerviousLevelTrackedNonDeterministicBranchingClashedDescriptors()) { CTrackedClashedDescriptor* trackedClashedDes = trackingLine->takeNextPerviousLevelTrackedNonDeterministicBranchingClashedDescriptor(); STATINC(CLASHEDBACKTRACKINGPREVNODELEVELBRANCHCOUNT,calcAlgContext); KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mBeginNonDetPrevBacktrackingStepTracklineString = generateDebugTrackingLineString(trackingLine,calcAlgContext); } ) trackingSuccess &= backtrackNonDeterministicBranchingClashedDescriptorFromPreviousIndividualNodeLevel(trackedClashedDes,trackingLine,calcAlgContext); KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mEndNonDetPrevBacktrackingStepTracklineString = generateDebugTrackingLineString(trackingLine,calcAlgContext); } ) } else // step 3: backtrack to next individual node level if (trackingLine->hasLevelTrackedBranchingClashedDescriptors()) { CTrackedClashedDescriptor* trackedClashedDes = trackingLine->takeNextLevelTrackedBranchingClashedDescriptor(); STATINC(CLASHEDBACKTRACKINGCURRNODELEVELBRANCHCOUNT,calcAlgContext); if (trackedClashedDes->isPointingToNonDeterministicDependencyNode()) { KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mBeginNonDetPrevBacktrackingStepTracklineString = generateDebugTrackingLineString(trackingLine,calcAlgContext); } ) trackingSuccess &= backtrackNonDeterministicBranchingClashedDescriptorFromCurrentIndividualNodeLevel(trackedClashedDes,trackingLine,calcAlgContext); KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mEndNonDetPrevBacktrackingStepTracklineString = generateDebugTrackingLineString(trackingLine,calcAlgContext); } ) } else { trackingSuccess &= backtrackDeterministicBranchingClashedDescriptorFromCurrentIndividualNodeLevel(trackedClashedDes,trackingLine,calcAlgContext); } } else { // check all dependencies independent if (trackingLine->hasOnlyIndependentTrackedClashedDescriptorsRemaining()) { STATINC(CLASHEDBACKTRACKINGINDEPENDENTCOUNT,calcAlgContext); // caching writeClashDescriptorsToCache(trackingLine,calcAlgContext); // no more tracking trackingSuccess = false; } else { // something failed, should never happen trackingSuccess = false; } } KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mEndBacktrackingStepTracklineString = generateDebugTrackingLineString(trackingLine,calcAlgContext); } ) return trackingSuccess; } bool CCalculationTableauCompletionTaskHandleAlgorithm::backtrackNonDeterministicBranchingClashedDescriptorFromCurrentIndividualNodeLevel(CTrackedClashedDescriptor* trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext) { return backtrackNonDeterministicBranchingClashedDescriptor(trackedClashedDes,trackingLine,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::backtrackNonDeterministicBranchingClashedDescriptorFromPreviousIndividualNodeLevel(CTrackedClashedDescriptor* trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext) { return backtrackNonDeterministicBranchingClashedDescriptor(trackedClashedDes,trackingLine,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::backtrackNonDeterministicBranchingClashedDescriptor(CTrackedClashedDescriptor* trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(CLASHEDBACKTRACKGNONDETERMINISTICCOUNT,calcAlgContext); CDependencyTrackPoint* depTrackPoint = trackedClashedDes->getDependencyTrackPoint(); CNonDeterministicDependencyTrackPoint* nonDetDepTrackPoint = (CNonDeterministicDependencyTrackPoint*)depTrackPoint; CNonDeterministicDependencyNode* nonDetDependencyNode = (CNonDeterministicDependencyNode*)nonDetDepTrackPoint->getDependencyNode(); CSatisfiableCalculationTask* nonDetAccTask = nonDetDependencyNode->getBranchNode()->getSatisfiableCalculationTask(); CSatisfiableCalculationTask* branchAccTask = nonDetDepTrackPoint->getBranchNode()->getSatisfiableCalculationTask(); cancellationTask(branchAccTask,calcAlgContext); //cint64 branchDiff = calcAlgContext->getSatisfiableCalculationTask()->getProcessingDataBox()->getProcessContext()->getProcessTagger()->getCurrentBranchingTag() - branchAccTask->getProcessingDataBox()->getProcessContext()->getProcessTagger()->getCurrentBranchingTag(); //if (branchDiff > 0) { // mOverJumpedNonDeterministicDecisionCount += branchDiff; //} if (nonDetDepTrackPoint->isClashedOrIrelevantBranch()) { // perhaps clash set by another thread STATINC(CLASHEDBACKTRACKGNONDETALREADYCLASHFAILEDCOUNT,calcAlgContext); return false; } CMemoryTemporaryAllocationManager* tmpMemMan = calcAlgContext->getUsedTemporaryMemoryAllocationManager(); CTaskProcessorContext* processorContext = calcAlgContext->getUsedTaskProcessorContext(); KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mNonDetDependencyTrackPointReasonString = generateDebugTrackedClashedDescriptorString(trackedClashedDes,calcAlgContext); } ) cint64 procTag = nonDetDependencyNode->getProcessingTag(); // backtrack all clashes before the processing tag of the non-deterministic dependency for current branch CTrackedClashedDescriptor* trackedClashedDescriptorBeforeProcTagList = nullptr; while (trackingLine->hasMoreTrackedClashedList()) { CTrackedClashedDescriptor* trackedClashedDesList = trackingLine->takeNextTrackedClashedList(); CTrackedClashedDescriptor* trackedClashedDescriptorsBeforeProcTag = getBacktrackedDeterministicClashedDescriptorsBeforeProcessingTag(trackedClashedDesList,procTag,trackingLine,calcAlgContext); if (trackedClashedDescriptorsBeforeProcTag) { trackedClashedDescriptorBeforeProcTagList = trackedClashedDescriptorsBeforeProcTag->append(trackedClashedDescriptorBeforeProcTagList); } } KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mNonDetDependencyBeforeProcessedTrackedString = generateDebugTrackedClashedDescriptorString(trackedClashedDescriptorBeforeProcTagList,calcAlgContext); } ) writeClashDescriptorsToCache(trackedClashedDescriptorBeforeProcTagList,trackedClashedDes,trackingLine,calcAlgContext); // copy clashes to memory container CMemoryPoolContainer memoryContainer; CTaskMemoryPoolAllocationManager conBranchMemMan(&memoryContainer,calcAlgContext->getTemporaryMemoryAllocationManager()); // create branch clash descriptors with memory pool which will sent to corresponding task, because other threads could be using the clash descriptors after installation CTrackedClashedDescriptor* branchMemConClashedDesList = createTrackedClashesDescriptors(trackedClashedDescriptorBeforeProcTagList,calcAlgContext,&conBranchMemMan); if (nonDetDepTrackPoint->isClashedOrIrelevantBranch()) { // perhaps clash set by another thread, release memory pools calcAlgContext->getTemporaryMemoryAllocationManager()->releaseMemoryPoolContainer(&memoryContainer); STATINC(CLASHEDBACKTRACKGNONDETALREADYCLASHFAILEDCOUNT,calcAlgContext); return false; } // otherwise install clash descriptors nonDetDepTrackPoint->setClashes(branchMemConClashedDesList,true); if (trackedClashedDescriptorBeforeProcTagList) { // and send memory pools to corresponding task processorContext->getTaskProcessorCommunicator()->communicateTaskAdditionalAllocation(nonDetAccTask,memoryContainer.takeMemoryPools()); } // test whether all branches has clash descriptors bool otherOpenedTrackPoints = nonDetDependencyNode->hasOtherOpenedDependencyTrackingPoints(nonDetDepTrackPoint); if (!otherOpenedTrackPoints) { ++mRelevantNonDeterministicDecisionCount; // collect clash descriptors of all branches and add dependency of closed dependency node STATINC(CLASHEDBACKTRACKGNONDETCLOSEDCOUNT,calcAlgContext); CTrackedClashedDescriptor* collectedTrackedClashedDes = getCollectedFilteredClashedDescriptorsFromBranch(trackedClashedDes,nonDetDependencyNode,trackingLine,calcAlgContext); KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mNonDetDependencyCollectedTrackedString = generateDebugTrackedClashedDescriptorString(collectedTrackedClashedDes,calcAlgContext); } ) if (initializeTrackingLine(trackingLine,collectedTrackedClashedDes,calcAlgContext)) { if (trackingLine->getBranchingLevel() == 0) { // jump back to root task / cancellation cancellationRootTask(calcAlgContext); } if (trackingLine->hasOnlyCurrentIndividualNodeLevelClashesDescriptors()) { writeClashDescriptorsToCache(trackingLine,calcAlgContext); } //// TODO: delete //cint64 depBraLevel = nonDetDependencyNode->getBranchNode()->getBranchingLevel(); //cint64 depBraLevelCount = mClosedBranchLevelCountHash.value(depBraLevel,0)+1; //mClosedBranchLevelCountHash.insert(depBraLevel,depBraLevelCount); return true; } } else { // mark all dependencies and corresponding tasks as relevant trackedClashedDescriptorBeforeProcTagList; } return false; } void CCalculationTableauCompletionTaskHandleAlgorithm::markRelevanceForTrackedClashedDescriptors(CTrackedClashedDescriptor* descriptors, CCalculationAlgorithmContextBase* calcAlgContext) { for (CTrackedClashedDescriptor* desIt = descriptors; desIt; desIt = desIt->getNextDescriptor()) { CDependencyTrackPoint* depTrackPoint = desIt->getDependencyTrackPoint(); markDependencyRelevance(depTrackPoint,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::markDependencyRelevance(CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { if (!depTrackPoint->isDependencyRelevant()) { depTrackPoint->setDependencyRelevance(true); CDependencyNode* depNode = depTrackPoint->getDependencyNode(); if (depNode) { CDependencyIterator depIt(depNode->getAdditionalDependencyIterator(true,true)); while (depIt.hasNext()) { CDependency* dep = depIt.nextDependency(true); CDependencyTrackPoint* prevDepTrackPoint = dep->getPreviousDependencyTrackPoint(); markDependencyRelevance(prevDepTrackPoint,calcAlgContext); } CDependencyTrackPoint* prevDepTrackPoint = depNode->getPreviousDependencyTrackPoint(); markDependencyRelevance(prevDepTrackPoint,calcAlgContext); } if (depNode->isNonDeterministiDependencyNode()) { CNonDeterministicDependencyNode* nonDetDepNode = (CNonDeterministicDependencyNode*)depNode; CBranchTreeNode* branchTreeNode = nonDetDepNode->getBranchNode(); CSatisfiableCalculationTask* branchSatCalcTask = branchTreeNode->getSatisfiableCalculationTask(); if (!branchSatCalcTask->isTaskRelevant()) { // TODO: add statistic for marked tasks as relevant CTaskProcessorContext* processorContext = calcAlgContext->getUsedTaskProcessorContext(); processorContext->getTaskProcessorCommunicator()->communicateTaskRelevant(branchSatCalcTask); } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::addIndividualNodeForCacheUnsatisfiableRetrieval(CIndividualProcessNode*& indiNode, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CXLinker* indiNodeLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(taskMemMan); indiNodeLinker->initLinker(indiNode); calcAlgContext->getUsedProcessingDataBox()->addIndividualNodeCacheTestingLinker(indiNodeLinker); } bool CCalculationTableauCompletionTaskHandleAlgorithm::writeClashDescriptorsToCache(CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext) { CTrackedClashedDescriptor* trackedClashedDesList = nullptr; while (trackingLine->hasMoreTrackedClashedList()) { trackedClashedDesList = trackingLine->takeNextTrackedClashedList()->append(trackedClashedDesList); } bool cacheWrite = writeClashDescriptorsToCache(trackedClashedDesList,trackingLine,calcAlgContext); trackingLine->sortInTrackedClashedDescriptors(trackedClashedDesList,true); return cacheWrite; } bool CCalculationTableauCompletionTaskHandleAlgorithm::writeClashDescriptorsToCache(CTrackedClashedDescriptor*& trackedClashedDes, CTrackedClashedDescriptor* additionalTrackedClashedDes, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext) { CTrackedClashedDescriptor* separatTrackedClashedDes = additionalTrackedClashedDes; trackedClashedDes = additionalTrackedClashedDes->append(trackedClashedDes); bool cacheWrite = writeClashDescriptorsToCache(trackedClashedDes,trackingLine,calcAlgContext); if (!cacheWrite) { trackedClashedDes = trackedClashedDes->getNextDescriptor(); } else { trackedClashedDes = (CTrackedClashedDescriptor*)trackedClashedDes->removeOne(additionalTrackedClashedDes); } additionalTrackedClashedDes->clearNext(); return cacheWrite; } bool CCalculationTableauCompletionTaskHandleAlgorithm::writeClashDescriptorsToCache(CTrackedClashedDescriptor*& trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext) { if (mConfWriteUnsatCaching && trackedClashedDes) { STATINC(UNSATCACHEWRITINGREQUSTCOUNT,calcAlgContext); KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mCachingClashString = generateDebugTrackedClashedDescriptorString(trackedClashedDes,calcAlgContext); } ) CTrackedClashedDescriptor* trackedClashedDesIt = trackedClashedDes; bool nominalOccured = trackedClashedDesIt->isAppropriatedIndividualNominal(); cint64 minIndiID = trackedClashedDesIt->getAppropriatedIndividualID(); bool hasOtherIndiID = false; cint64 minIndiLevel = trackedClashedDesIt->getAppropriatedIndividualLevel(); bool hasOtherIndiLevel = false; bool hasNoInvalidConDes = trackedClashedDesIt->getConceptDescriptor() != nullptr; trackedClashedDesIt = trackedClashedDesIt->getNextDescriptor(); while (trackedClashedDesIt) { CConceptDescriptor* conDes = trackedClashedDesIt->getConceptDescriptor(); hasNoInvalidConDes &= conDes != nullptr; if (conDes) { CConcept* concept = conDes->getConcept(); cint64 opCode = concept->getOperatorCode(); CConceptOperator* conOperator = concept->getConceptOperator(); if (concept->getTerminology() == nullptr || conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_PROPAGATION_TYPE)) { hasNoInvalidConDes = false; } } nominalOccured |= trackedClashedDesIt->isAppropriatedIndividualNominal(); if (trackedClashedDesIt->getAppropriatedIndividualID() != minIndiID) { hasOtherIndiID = true; if (nominalOccured) { STATINC(UNSATCACHEWRITINGREQUSTDIFFNOMINALFAILEDCOUNT,calcAlgContext); return false; } } if (trackedClashedDesIt->getAppropriatedIndividualLevel() != minIndiLevel) { STATINC(UNSATCACHEWRITINGREQUSTDIFFNODELEVELFAILEDCOUNT,calcAlgContext); hasOtherIndiLevel = true; return false; } trackedClashedDesIt = trackedClashedDesIt->getNextDescriptor(); } // TODO: unsatisfiability caching with nominals, currently deactivateds if (hasNoInvalidConDes && !nominalOccured) { bool writeCacheLine = false; if (!nominalOccured) { writeCacheLine = !hasOtherIndiLevel; } else { writeCacheLine = !hasOtherIndiID; } bool atomicClash = false; if (writeCacheLine) { CTrackedClashedDescriptor* trackedClashedDesIt = trackedClashedDes; while (trackedClashedDesIt && !atomicClash) { CConceptDescriptor* conDes = trackedClashedDesIt->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool conNeg = conDes->getNegation(); CTrackedClashedDescriptor* atomClashedDesIt = trackedClashedDesIt->getNextDescriptor(); while (atomClashedDesIt && !atomicClash) { CConceptDescriptor* othConDes = atomClashedDesIt->getConceptDescriptor(); if (othConDes->getConcept() == concept && othConDes->getNegation() != conNeg) { STATINC(UNSATCACHEWRITINGREQUSTATOMICCLASHFAILEDCOUNT,calcAlgContext); atomicClash = true; return false; } atomClashedDesIt = atomClashedDesIt->getNextDescriptor(); } trackedClashedDesIt = trackedClashedDesIt->getNextDescriptor(); } } writeCacheLine &= !atomicClash; if (writeCacheLine) { //CConcept* orConcept = nullptr; //for (CTrackedClashedDescriptor* cIt = trackedClashedDes; cIt; cIt = cIt->getNextDescriptor()) { // if (cIt->getConceptDescriptor()->getConcept()->getOperatorCode() == CCAND && cIt->getConceptDescriptor()->isNegated() && cIt->getConceptDescriptor()->getConcept()->getOperandCount() > 2) { // orConcept = cIt->getConceptDescriptor()->getConcept(); // } //} //if (orConcept) { // for (CSortedNegLinker* opConIt = orConcept->getOperandList(); opConIt; opConIt = opConIt->getNext()) { // bool found = false; // for (CTrackedClashedDescriptor* cIt = trackedClashedDes; cIt; cIt = cIt->getNextDescriptor()) { // if (cIt->getConceptDescriptor()->getConcept() == opConIt->getData()) { // found = true; // } // } // if (!found) { // mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // QFile file(QString("caching-error.txt")); // if (file.open(QIODevice::WriteOnly)) { // file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); // } // bool bug = true; // } // } //} if (mConfUnsatCachingUseNodeSignatureSet) { addIndiNodeSignatureOfUnsatisfiableClashedDescriptors(trackedClashedDes,calcAlgContext); } trackedClashedDes = getSortedClashedDescriptors(trackedClashedDes,calcAlgContext); KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION( if (mBacktrackDebug) { mSortedCachingClashString = generateDebugTrackedClashedDescriptorString(trackedClashedDes,calcAlgContext); } ) writeUnsatisfiableClashedDescriptors(trackedClashedDes,calcAlgContext); return true; } } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::addIndiNodeSignatureOfUnsatisfiableClashedDescriptors(CTrackedClashedDescriptor* trackedClashedDes, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 indiID = trackedClashedDes->getAppropriatedIndividualID(); CIndividualProcessNode* indi = getCorrectedNominalIndividualNode(indiID,calcAlgContext); CReapplyConceptLabelSet* conSet = indi->getReapplyConceptLabelSet(false); cint64 conSig = conSet->getConceptSignatureValue(); mUnsatCachingSignatureSet.insert(conSig); return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isClashedDescriptorSortedBefore(CTrackedClashedDescriptor* trackedClashedDesBefore, CTrackedClashedDescriptor* trackedClashedDesAfter, CCalculationAlgorithmContextBase* calcAlgContext) { return !trackedClashedDesAfter || trackedClashedDesBefore->getConceptDescriptor()->getConceptTag() <= trackedClashedDesAfter->getConceptDescriptor()->getConceptTag(); } CTrackedClashedDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::getSortedClashedDescriptors(CTrackedClashedDescriptor* trackedClashedDes, CCalculationAlgorithmContextBase* calcAlgContext) { CTrackedClashedDescriptor* sortedTrackedClashedDes = trackedClashedDes; trackedClashedDes = trackedClashedDes->getNextDescriptor(); sortedTrackedClashedDes->clearNext(); while (trackedClashedDes) { CTrackedClashedDescriptor* tmpTrackedClashedDes = trackedClashedDes; trackedClashedDes = trackedClashedDes->getNextDescriptor(); tmpTrackedClashedDes->clearNext(); if (isClashedDescriptorSortedBefore(tmpTrackedClashedDes,sortedTrackedClashedDes,calcAlgContext)) { sortedTrackedClashedDes = tmpTrackedClashedDes->append(sortedTrackedClashedDes); } else { CTrackedClashedDescriptor* sortedInsertPosIt = sortedTrackedClashedDes; while (sortedInsertPosIt) { CTrackedClashedDescriptor* nextSortedPosDes = sortedInsertPosIt->getNextDescriptor(); if (isClashedDescriptorSortedBefore(tmpTrackedClashedDes,nextSortedPosDes,calcAlgContext)) { sortedInsertPosIt->insertNext(tmpTrackedClashedDes); break; } sortedInsertPosIt = nextSortedPosDes; } } } return sortedTrackedClashedDes; } bool CCalculationTableauCompletionTaskHandleAlgorithm::writeUnsatisfiableClashedDescriptors(CTrackedClashedDescriptor* trackedClashedDes, CCalculationAlgorithmContextBase* calcAlgContext) { CUnsatisfiableCacheHandler* unsatCacheHandler = calcAlgContext->getUsedUnsatisfiableCacheHandler(); if (unsatCacheHandler) { return unsatCacheHandler->writeUnsatisfiableClashedDescriptors(trackedClashedDes,calcAlgContext); } return false; } CTrackedClashedDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::getCollectedFilteredClashedDescriptorsFromBranch(CTrackedClashedDescriptor* nonDetClashedPointingDes, CNonDeterministicDependencyNode* nonDetBranchDepNode, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext, CMemoryAllocationManager* tmpMemMan) { CPROCESSINGSET testClashedSet(calcAlgContext->getUsedTaskProcessorContext()); CNonDeterministicDependencyTrackPoint* trackPointIt = nonDetBranchDepNode->getBranchTrackPoints(); CTrackedClashedDescriptor* newTrackedClashedDescriptorList = nullptr; CTrackedClashedDescriptor* nonDetPointingFirstTrackedClashedDescriptor = nonDetClashedPointingDes; while (trackPointIt) { CClashedDependencyDescriptor* clashedDepDescriptors = trackPointIt->getClashes(); CClashedDependencyDescriptor* clashedDepDescriptorsIt = clashedDepDescriptors; while (clashedDepDescriptorsIt) { CClashedDependencyDescriptor* clashedDepDescriptor = clashedDepDescriptorsIt; if (clashedDepDescriptor->getDependencyTrackPoint()->getDependencyNode() != nonDetBranchDepNode) { CTrackedClashedDescriptor* netTrackedClashDes = createTrackedClashesDescriptor(clashedDepDescriptor,calcAlgContext,tmpMemMan); CTrackedClashedDescriptorHasher hasher(netTrackedClashDes); if (!testClashedSet.contains(hasher)) { // each dependency only once testClashedSet.insert(hasher); newTrackedClashedDescriptorList = netTrackedClashDes->append(newTrackedClashedDescriptorList); } } else { if (!nonDetPointingFirstTrackedClashedDescriptor) { nonDetPointingFirstTrackedClashedDescriptor = createTrackedClashesDescriptor(clashedDepDescriptor,calcAlgContext,tmpMemMan); } } clashedDepDescriptorsIt = clashedDepDescriptorsIt->getNext(); } trackPointIt = trackPointIt->getNext(); } KONCLUDE_ASSERT_X(nonDetPointingFirstTrackedClashedDescriptor,"getCollectedFilteredClashedDescriptorsFromBranch","track point for non-deterministic dependency not found"); CTrackedClashedDescriptor* nonDetBacktrackedClashedDes = getBacktrackedDeterministicClashedDescriptors(nonDetPointingFirstTrackedClashedDescriptor,trackingLine,nullptr,calcAlgContext); CTrackedClashedDescriptor* nonDetBacktrackedClashedDesIt = nonDetBacktrackedClashedDes; while (nonDetBacktrackedClashedDesIt) { nonDetBacktrackedClashedDes = nonDetBacktrackedClashedDesIt; nonDetBacktrackedClashedDesIt = nonDetBacktrackedClashedDesIt->getNextDescriptor(); nonDetBacktrackedClashedDes->clearNext(); CTrackedClashedDescriptorHasher hasher(nonDetBacktrackedClashedDes); if (!testClashedSet.contains(hasher)) { // each dependency only once testClashedSet.insert(hasher); newTrackedClashedDescriptorList = nonDetBacktrackedClashedDes->append(newTrackedClashedDescriptorList); } } return newTrackedClashedDescriptorList; } bool CCalculationTableauCompletionTaskHandleAlgorithm::backtrackDeterministicBranchingClashedDescriptorFromCurrentIndividualNodeLevel(CTrackedClashedDescriptor* trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 minIndiLevel = CINT64_MAX; CTrackedClashedDescriptor* newTrackedClashedDesList = getBacktrackedDeterministicClashedDescriptors(trackedClashedDes,trackingLine,&minIndiLevel,calcAlgContext); trackingLine->addFreeTrackedClashedDescriptor(trackedClashedDes); if (minIndiLevel < trackingLine->getIndividualNodeLevel()) { // cache with old tracked clash descriptors trackingLine->moveToNextIndividualNodeLevel(minIndiLevel); } trackingLine->sortInTrackedClashedDescriptors(newTrackedClashedDesList); return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::backtrackDeterministicClashedDescriptorFromPreviousIndividualNodeLevels(CTrackedClashedDescriptor* trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext) { CTrackedClashedDescriptor* newTrackedClashedDesList = getBacktrackedDeterministicClashedDescriptors(trackedClashedDes,trackingLine,nullptr,calcAlgContext); trackingLine->addFreeTrackedClashedDescriptor(trackedClashedDes); trackingLine->sortInTrackedClashedDescriptors(newTrackedClashedDesList); return true; } CTrackedClashedDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::getBacktrackedDeterministicClashedDescriptorsBeforeProcessingTag(CTrackedClashedDescriptor* trackedClashedDescriptors, cint64 processingTag, CTrackedClashedDependencyLine* trackingLine, CCalculationAlgorithmContextBase* calcAlgContext) { CPROCESSINGSET* testClashedSet = trackingLine->getTrackedClashedDescriptorSet(); CTrackedClashedDescriptor* newTrackedClashedDescriptorList = nullptr; CTrackedClashedDescriptor* trackedClashedDescriptorIt = trackedClashedDescriptors; while (trackedClashedDescriptorIt) { CTrackedClashedDescriptor* trackedClashedDescriptor = trackedClashedDescriptorIt; trackedClashedDescriptorIt = trackedClashedDescriptorIt->getNextDescriptor(); trackedClashedDescriptor->clearNext(); if (trackedClashedDescriptor->isPointingToNonDeterministicDependencyNode()) { KONCLUDE_ASSERT_X(!trackedClashedDescriptor->isProcessedAfter(processingTag),"getBacktrackedDeterministicClashedDescriptorsBeforeProcessingTag","non-deterministic dependency is processed after max branching leveled dependency"); newTrackedClashedDescriptorList = trackedClashedDescriptor->append(newTrackedClashedDescriptorList); } else { if (trackedClashedDescriptor->isProcessedAfter(processingTag)) { CDependencyTrackPoint* depTrackPoint = trackedClashedDescriptor->getDependencyTrackPoint(); //if (depTrackPoint->isPointingToIndependentDependencyNode()) { // CTrackedClashedDescriptor* newTrackedClashedDescriptor = getFreeTrackedClashedDescriptor(trackingLine,calcAlgContext); // newTrackedClashedDescriptor->initTrackedClashedDescriptor(trackedClashedDescriptor,nullptr,depTrackPoint); // CTrackedClashedDescriptorHasher hasher(newTrackedClashedDescriptor); // if (!testClashedSet->contains(hasher)) { // // each dependency only once // testClashedSet->insert(hasher); // trackedClashedDescriptorIt = newTrackedClashedDescriptor->append(trackedClashedDescriptorIt); // } else { // trackingLine->addFreeTrackedClashedDescriptor(newTrackedClashedDescriptor); // } //} else { CTrackedClashedDescriptor* newTrackedClashedDescriptorIt = getBacktrackedDeterministicClashedDescriptors(trackedClashedDescriptor,trackingLine,nullptr,calcAlgContext); while (newTrackedClashedDescriptorIt) { CTrackedClashedDescriptor* newTrackedClashedDescriptor = newTrackedClashedDescriptorIt; newTrackedClashedDescriptorIt = newTrackedClashedDescriptorIt->getNextDescriptor(); newTrackedClashedDescriptor->clearNext(); CTrackedClashedDescriptorHasher hasher(newTrackedClashedDescriptor); if (!testClashedSet->contains(hasher)) { // each dependency only once testClashedSet->insert(hasher); trackedClashedDescriptorIt = newTrackedClashedDescriptor->append(trackedClashedDescriptorIt); } else { trackingLine->addFreeTrackedClashedDescriptor(newTrackedClashedDescriptor); } } //} trackingLine->addFreeTrackedClashedDescriptor(trackedClashedDescriptor); } else if (!trackedClashedDescriptor->getConceptDescriptor() && !trackedClashedDescriptor->isPointingToIndependentDependencyNode()) { // try backtrack cint64 continuedIndiID = trackedClashedDescriptor->getAppropriatedIndividualID(); bool allIndiIDContinued = true; CTrackedClashedDescriptor* newTrackedClashedDescriptors = getBacktrackedDeterministicClashedDescriptors(trackedClashedDescriptor,trackingLine,nullptr,calcAlgContext); CTrackedClashedDescriptor* newTrackedClashedDescriptorIt = newTrackedClashedDescriptors; while (newTrackedClashedDescriptorIt && allIndiIDContinued) { if (newTrackedClashedDescriptorIt->getAppropriatedIndividualID() != continuedIndiID) { allIndiIDContinued = false; } newTrackedClashedDescriptorIt = newTrackedClashedDescriptorIt->getNextDescriptor(); } if (!allIndiIDContinued) { newTrackedClashedDescriptorList = trackedClashedDescriptor->append(newTrackedClashedDescriptorList); newTrackedClashedDescriptorIt = newTrackedClashedDescriptors; while (newTrackedClashedDescriptorIt) { CTrackedClashedDescriptor* newTrackedClashedDescriptor = newTrackedClashedDescriptorIt; newTrackedClashedDescriptorIt = newTrackedClashedDescriptorIt->getNextDescriptor(); newTrackedClashedDescriptor->clearNext(); trackingLine->addFreeTrackedClashedDescriptor(newTrackedClashedDescriptor); } } else { // newTrackedClashedDescriptorIt = newTrackedClashedDescriptors; while (newTrackedClashedDescriptorIt) { CTrackedClashedDescriptor* newTrackedClashedDescriptor = newTrackedClashedDescriptorIt; newTrackedClashedDescriptorIt = newTrackedClashedDescriptorIt->getNextDescriptor(); newTrackedClashedDescriptor->clearNext(); CTrackedClashedDescriptorHasher hasher(newTrackedClashedDescriptor); if (!testClashedSet->contains(hasher)) { // each dependency only once testClashedSet->insert(hasher); trackedClashedDescriptorIt = newTrackedClashedDescriptor->append(trackedClashedDescriptorIt); } else { trackingLine->addFreeTrackedClashedDescriptor(newTrackedClashedDescriptor); } } trackingLine->addFreeTrackedClashedDescriptor(trackedClashedDescriptor); } } else { newTrackedClashedDescriptorList = trackedClashedDescriptor->append(newTrackedClashedDescriptorList); } } } return newTrackedClashedDescriptorList; } CTrackedClashedDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::getBacktrackedDeterministicClashedDescriptors(CTrackedClashedDescriptor* trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, cint64* minIndiLevel, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(CLASHEDBACKTRACKEDDESCRIPTORSCOUNT,calcAlgContext); CDependencyNode* depNode = trackedClashedDes->getDependencyTrackPoint()->getDependencyNode(); CConceptDescriptor* conDes = depNode->getConceptDescriptor(); CIndividualProcessNode* indiNode = nullptr; CIndividualProcessNode* newIndiNode = nullptr; CTrackedClashedDescriptor* newTrackedClashedDesList = nullptr; if (minIndiLevel) { *minIndiLevel = trackedClashedDes->getAppropriatedIndividualLevel(); } if (depNode->hasAppropriateIndividualNode()) { newIndiNode = getCoresspondingIndividualNodeFromDependency(depNode,calcAlgContext); if (minIndiLevel) { *minIndiLevel = qMin(*minIndiLevel,newIndiNode->getIndividualNominalLevelOrAncestorDepth()); } } CDependencyTrackPoint* depTrackPoint = depNode->getPreviousDependencyTrackPoint(); CVariableBindingPath* varBindPath = trackedClashedDes->getVariableBindingPath(); if (depNode->isRepresentativeSelectDependencyNode()) { CRepresentativeSelectDependencyNode* repSelDepNode = dynamic_cast(depNode); varBindPath = repSelDepNode->getSelectedVariableBindingPath(); } else if (depNode->isRepresentativeResolveDependencyNode()) { CRepresentativeResolveDependencyNode* repResDepNode = dynamic_cast(depNode); CRepresentativeVariableBindingPathMap* repVarBindPathMap = repResDepNode->getResolveRepresentativeVariableBindingPathMap(); CRepresentativePropagationMap* repPropMap = repResDepNode->getResolveRepresentativePropagationMap(); const CRepresentativeVariableBindingPathMapData& repVarBindPathMapData = repVarBindPathMap->value(varBindPath->getPropagationID()); varBindPath = repVarBindPathMapData.getResolveVariableBindingPath(); cint64 resolveRepID = repVarBindPathMapData.getResolveRepresentativeVariableBindingPathSetDataID(); const CRepresentativePropagationMapData& repPropMapData = repPropMap->value(resolveRepID); CRepresentativePropagationDescriptor* repPropDes = repPropMapData.getRepresentativePropagationDescriptor(); depTrackPoint = repPropDes->getDependencyTrackPoint(); } CTrackedClashedDescriptor* newTrackedClashedDes = getFreeTrackedClashedDescriptor(trackingLine,calcAlgContext); if (newIndiNode) { newTrackedClashedDes->initTrackedClashedDescriptor(newIndiNode,conDes,varBindPath,depTrackPoint); } else { newTrackedClashedDes->initTrackedClashedDescriptor(trackedClashedDes,conDes,varBindPath,depTrackPoint); } newTrackedClashedDes = tryGetInvalidSameIndividualNodeLevelBacktrackedDeterministicClashedDescriptors(newTrackedClashedDes,trackingLine,nullptr,calcAlgContext); newTrackedClashedDesList = newTrackedClashedDes->append(newTrackedClashedDesList); CDependencyIterator depIt = depNode->getAdditionalDependencyIterator(); while (depIt.hasNext()) { CDependency* dependency = depIt.nextDependency(); // load additional dependencies CDependencyTrackPoint* depTrackPoint = dependency->getPreviousDependencyTrackPoint(); CIndividualProcessNode* addDepNewIndiNode = getCoresspondingIndividualNodeFromDependency(depTrackPoint,calcAlgContext); CTrackedClashedDescriptor* newTrackedClashedDes = getFreeTrackedClashedDescriptor(trackingLine,calcAlgContext); if (!addDepNewIndiNode) { newTrackedClashedDes->initTrackedClashedDescriptor(trackedClashedDes,nullptr,varBindPath,depTrackPoint); } else { if (minIndiLevel) { *minIndiLevel = qMin(*minIndiLevel,addDepNewIndiNode->getIndividualNominalLevelOrAncestorDepth()); } newTrackedClashedDes->initTrackedClashedDescriptor(addDepNewIndiNode,nullptr,varBindPath,depTrackPoint); } newTrackedClashedDes = tryGetInvalidSameIndividualNodeLevelBacktrackedDeterministicClashedDescriptors(newTrackedClashedDes,trackingLine,nullptr,calcAlgContext); newTrackedClashedDesList = newTrackedClashedDes->append(newTrackedClashedDesList); } return newTrackedClashedDesList; } CTrackedClashedDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::tryGetInvalidSameIndividualNodeLevelBacktrackedDeterministicClashedDescriptors(CTrackedClashedDescriptor* trackedClashedDes, CTrackedClashedDependencyLine* trackingLine, cint64* minIndiLevel, CCalculationAlgorithmContextBase* calcAlgContext) { if (trackedClashedDes->getConceptDescriptor() == nullptr && trackedClashedDes->isPointingToDeterministicDependencyNode() && !trackedClashedDes->isPointingToIndependentDependencyNode()) { CDependencyNode* depNode = trackedClashedDes->getDependencyTrackPoint()->getDependencyNode(); cint64 currLevel = trackedClashedDes->getAppropriatedIndividualLevel(); CIndividualProcessNode* indiNode = nullptr; CTrackedClashedDescriptor* newTrackedClashedDesList = nullptr; if (minIndiLevel) { *minIndiLevel = trackedClashedDes->getAppropriatedIndividualLevel(); } if (depNode->hasAppropriateIndividualNode()) { indiNode = getCoresspondingIndividualNodeFromDependency(depNode,calcAlgContext); if (indiNode->getIndividualNominalLevelOrAncestorDepth() != currLevel) { return trackedClashedDes; } } CDependencyIterator depIt = depNode->getAdditionalDependencyIterator(); while (depIt.hasNext()) { CDependency* dependency = depIt.nextDependency(); // load additional dependencies CDependencyTrackPoint* depTrackPoint = dependency->getPreviousDependencyTrackPoint(); CIndividualProcessNode* addDepNewIndiNode = getCoresspondingIndividualNodeFromDependency(depTrackPoint,calcAlgContext); if (addDepNewIndiNode && addDepNewIndiNode->getIndividualNominalLevelOrAncestorDepth() != currLevel) { return trackedClashedDes; } } return getBacktrackedDeterministicClashedDescriptors(trackedClashedDes,trackingLine,minIndiLevel,calcAlgContext); } return trackedClashedDes; } bool CCalculationTableauCompletionTaskHandleAlgorithm::initializeTrackingLine(CTrackedClashedDependencyLine* trackingLine, CTrackedClashedDescriptor* trackingClashes, CCalculationAlgorithmContextBase* calcAlgContext) { bool trackingError = false; bool nominalOccured = false; cint64 maxBranchingLevel = CINT64_MIN; cint64 minIndividualLevel = CINT64_MAX; CTrackedClashedDescriptor* trackingClashesIt = trackingClashes; while (trackingClashesIt && !trackingError) { trackingClashesIt->candidateTracking(&trackingError,&nominalOccured,&maxBranchingLevel,&minIndividualLevel); trackingClashesIt = trackingClashesIt->getNextDescriptor(); } if (trackingError) { return false; } trackingLine->initTrackedClashedDependencyLine(nominalOccured,minIndividualLevel,maxBranchingLevel); trackingLine->sortInTrackedClashedDescriptors(trackingClashes,true); return true; } CTrackedClashedDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::createTrackedClashesDescriptors(CClashedDependencyDescriptor* clashes, CCalculationAlgorithmContextBase* calcAlgContext, CMemoryAllocationManager* tmpMemMan) { if (!tmpMemMan) { tmpMemMan = calcAlgContext->getUsedTemporaryMemoryAllocationManager(); } CTrackedClashedDescriptor* trackingClashes = nullptr; CClashedDependencyDescriptor* nextClash = clashes; while (nextClash) { CTrackedClashedDescriptor* newTrackingClash = nullptr; newTrackingClash = createTrackedClashesDescriptor(nextClash,calcAlgContext,tmpMemMan); trackingClashes = newTrackingClash->append(trackingClashes); nextClash = nextClash->getNext(); } return trackingClashes; } CTrackedClashedDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::createTrackedClashesDescriptor(CClashedDependencyDescriptor* clashDes, CCalculationAlgorithmContextBase* calcAlgContext, CMemoryAllocationManager* tmpMemMan) { if (!tmpMemMan) { tmpMemMan = calcAlgContext->getUsedTemporaryMemoryAllocationManager(); } CTrackedClashedDescriptor* newTrackingClash = nullptr; CTrackedClashedDescriptor* clashedTrackDes = dynamic_cast(clashDes); if (clashedTrackDes) { newTrackingClash = CObjectAllocator< CTrackedClashedDescriptor >::allocateAndConstruct(tmpMemMan); newTrackingClash->initTrackedClashedDescriptor(clashedTrackDes); } else { CClashedConceptDescriptor* clashedConDes = dynamic_cast(clashDes); if (clashedConDes) { newTrackingClash = CObjectAllocator< CTrackedClashedDescriptor >::allocateAndConstruct(tmpMemMan); newTrackingClash->initTrackedClashedDescriptor(clashedConDes->getAppropriatedIndividual(),clashedConDes->getConceptDescriptor(),nullptr,clashedConDes->getDependencyTrackPoint()); } else { CClashedDatatypeValueSpaceExclusionDescriptor* clashedDataVSExDes = dynamic_cast(clashDes); if (clashedDataVSExDes) { newTrackingClash = CObjectAllocator< CTrackedClashedDescriptor >::allocateAndConstruct(tmpMemMan); newTrackingClash->initTrackedClashedDescriptor(clashedDataVSExDes->getAppropriatedIndividual(),nullptr,nullptr,clashedDataVSExDes->getDependencyTrackPoint()); } else { CIndividualProcessNode* indiNode = getCoresspondingIndividualNodeFromDependency(clashDes->getDependencyTrackPoint(),calcAlgContext); newTrackingClash = CObjectAllocator< CTrackedClashedDescriptor >::allocateAndConstruct(tmpMemMan); newTrackingClash->initTrackedClashedDescriptor(indiNode,nullptr,nullptr,clashDes->getDependencyTrackPoint()); } } } return newTrackingClash; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getCoresspondingIndividualNodeFromDependency(CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CDependencyNode* depNode = depTrackPoint->getDependencyNode(); return getCoresspondingIndividualNodeFromDependency(depNode,calcAlgContext); } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getCoresspondingIndividualNodeFromDependency(CDependencyNode* depNode, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* indi = nullptr; indi = depNode->getAppropriateIndividualNode(); //KONCLUDE_ASSERT_X(indi,"getCoresspondingIndividualNodeFromDependency","individual node not available"); if (indi) { CIndividualProcessNode* updIndi = getUpToDateIndividual(indi,calcAlgContext); if (updIndi) { if (updIndi->hasMergedIntoIndividualNodeID()) { updIndi = getCorrectedNominalIndividualNode(updIndi->getMergedIntoIndividualNodeID(),calcAlgContext); } indi = updIndi; } } return indi; } QString CCalculationTableauCompletionTaskHandleAlgorithm::generateDebugDependentNominalsString(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext) { QStringList nominalDependentStringList; CSuccessorConnectedNominalSet* connNomSet = indi->getSuccessorNominalConnectionSet(false); if (connNomSet) { for (CSuccessorConnectedNominalSet::const_iterator it = connNomSet->constBegin(), itEnd = connNomSet->constEnd(); it != itEnd; ++it) { cint64 nominalID = *it; QString nominalString = QString("%1").arg(nominalID); nominalDependentStringList.append(nominalString); } } return nominalDependentStringList.join(", "); } QString CCalculationTableauCompletionTaskHandleAlgorithm::generateDebugIncrementalExpansionString(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext) { QString incExpString; CIndividualNodeIncrementalExpansionData* incExpData = indi->getIncrementalExpansionData(false); if (incExpData) { QStringList statusStringList; if (incExpData->isPreviousCompletionGraphCompatible()) { statusStringList += QString("compatible"); } if (incExpData->hasDirectlyChangedNeighbourConnection()) { statusStringList += QString("directly-changed-connection"); } if (incExpData->isDirectlyChanged()) { statusStringList += QString("directly-changed-node"); } QString dirChangedNeighConnNodeID = "-"; if (incExpData->getDirectlyChangedNeighbourConnectionNode()) { dirChangedNeighConnNodeID = QString("%1").arg(incExpData->getDirectlyChangedNeighbourConnectionNode()->getIndividualID()); } double expansionPriority = incExpData->getExpansionPriority(); incExpString += QString("Incremental-Expansion-Status: %1\r\n Directly-Changed-Connection-Neighbour: %2\r\n Expansion-Priority: %3").arg(statusStringList.join(", ")).arg(dirChangedNeighConnNodeID).arg(expansionPriority); } return incExpString; } QString CCalculationTableauCompletionTaskHandleAlgorithm::generateDebugIndiStatusString(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext) { QStringList statusStringList; if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDATEBLOCKERFLAGSCOMPINATION)) { statusStringList.append("invalid-blocker"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED)) { statusStringList.append("pruned"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPROCESSINGBLOCKED)) { statusStringList.append("processing blocked"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATISFIABLECACHED)) { statusStringList.append("satisfiable-cached"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED)) { statusStringList.append("ancestor-satisfiable-cached"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFDIRECTBLOCKED)) { cint64 blockerIndiID = indi->getBlockerIndividualNode()->getIndividualID(); cint64 lastConTag = indi->mDebugBlockerLastConceptDes->getConceptTag(); statusStringList.append(QString("direct-blocked by %1 (%2)").arg(blockerIndiID).arg(lastConTag)); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINDIRECTBLOCKED)) { statusStringList.append("indirect-blocked"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED)) { CSignatureBlockingIndividualNodeConceptExpansionData* locSigBlockingData = indi->getSignatureBlockingIndividualNodeConceptExpansionData(false); cint64 blockerIndiID = -1; if (locSigBlockingData->getBlockerIndividualNode()) { blockerIndiID = locSigBlockingData->getBlockerIndividualNode()->getIndividualID(); } statusStringList.append(QString("signature-blocking-cached by %1").arg(blockerIndiID)); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED)) { statusStringList.append("ancestor-signature-blocking-cached"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFREUSINGINDIVIDUAL)) { statusStringList.append("reusing-individual-blocked"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORREUSINGINDIVIDUALBLOCKED)) { statusStringList.append("ancestor-reusing-individual-blocked"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED)) { statusStringList.append("saturation-cached-blocked"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHED)) { statusStringList.append("ancestor-saturation-cached-blocked"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED)) { statusStringList.append("completion-graph-cached-blocked"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALID)) { statusStringList.append("completion-graph-caching-invalid"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHEDNODELOCATED)) { statusStringList.append("completion-graph-caching-node-located"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHEDNODEEXTENDED)) { statusStringList.append("completion-graph-caching-node-extended"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED)) { statusStringList.append("completion-graph-caching-invalidated"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTCOMPLETIONGRAPHCACHEDDUEDIRECTMODIFIED)) { statusStringList.append("completion-graph-caching-retest-due-to-modification"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { statusStringList.append("successor-nominal-connection"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNEWNOMINALCONNECTION)) { statusStringList.append("successor-new-nominal-connection"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCONCRETEDATAINDINODE)) { statusStringList.append("data-node"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKEND)) { statusStringList.append("backend-synchronization"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDNEIGHBOUREXPANSIONBLOCKED)) { statusStringList.append("backend-synchronized-neighbour-expansion-blocked"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDSUCCESSOREXPANSIONBLOCKED)) { statusStringList.append("backend-synchronized-successor-expansion-blocked"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINCREMENTALEXPANDING)) { statusStringList.append("incremental-expansion"); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINCREMENTALEXPANSIONRETESTDUEDIRECTMODIFIED)) { statusStringList.append("incremental-expansion-compatibility-checking-due-to-modification"); } if (indi->isNominalIndividual()) { statusStringList.append("nominal"); } CConceptProcessingQueue* conProQue = indi->getConceptProcessingQueue(false); if (conProQue) { if (!conProQue->isEmpty() && !indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDATEBLOCKERFLAGSCOMPINATION)) { statusStringList.append("processing"); } } QString statusString; statusString = statusStringList.join(", "); return statusString; } QString CCalculationTableauCompletionTaskHandleAlgorithm::generateDebugDependencyString(CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { QString dependencyString = QString("null"); if (depTrackPoint) { QString depTypeString; CDependencyNode* depNode = depTrackPoint->getDependencyNode(); switch (depNode->getDependencyType()) { case CDependencyNode::DNTINDEPENDENTBASE: { depTypeString = QString("INDEPENDENT"); break; } case CDependencyNode::DNTALLDEPENDENCY: { depTypeString = QString("ALL"); break; } case CDependencyNode::DNTSOMEDEPENDENCY: { depTypeString = QString("SOME"); break; } case CDependencyNode::DNTANDDEPENDENCY: { depTypeString = QString("AND"); break; } case CDependencyNode::DNTORDEPENDENCY: { depTypeString = QString("OR"); break; } case CDependencyNode::DNTATLEASTDEPENDENCY: { depTypeString = QString("ATLEAST"); break; } case CDependencyNode::DNTAUTOMATCHOOSEDEPENDENCY: { depTypeString = QString("AUTOMATCHOOSE"); break; } case CDependencyNode::DNTAUTOMATTRANSACTIONDEPENDENCY: { depTypeString = QString("AUTOMATTRANSACTION"); break; } case CDependencyNode::DNTSELFDEPENDENCY: { depTypeString = QString("SELF"); break; } case CDependencyNode::DNTVALUEDEPENDENCY: { depTypeString = QString("VALUE"); break; } case CDependencyNode::DNTNEGVALUEDEPENDENCY: { depTypeString = QString("NEGVALUE"); break; } case CDependencyNode::DNTDISTINCTDEPENDENCY: { depTypeString = QString("DISTINCT"); break; } case CDependencyNode::DNTMERGEDCONCEPT: { depTypeString = QString("MERGEDCONCEPT"); break; } case CDependencyNode::DNTMERGEDLINK: { depTypeString = QString("MERGEDLINK"); break; } case CDependencyNode::DNTMERGEDEPENDENCY: { depTypeString = QString("MERGE"); break; } case CDependencyNode::DNTATMOSTDEPENDENCY: { depTypeString = QString("ATMOST"); break; } case CDependencyNode::DNTQUALIFYDEPENDENCY: { depTypeString = QString("QUALIFY"); break; } case CDependencyNode::DNTFUNCTIONALDEPENDENCY: { depTypeString = QString("FUNCTIONAL"); break; } case CDependencyNode::DNTNOMINALDEPENDENCY: { depTypeString = QString("NOMINAL"); break; } case CDependencyNode::DNTIMPLICATIONDEPENDENCY: { depTypeString = QString("IMPLICATION"); break; } case CDependencyNode::DNTEXPANDEDDEPENDENCY: { depTypeString = QString("EXPANDED"); break; } case CDependencyNode::DNTDATATYPETRIGGERDEPENDENCY: { depTypeString = QString("DATATYPETRIGGER"); break; } case CDependencyNode::DNTROLEASSERTIONDEPENDENCY: { depTypeString = QString("ROLEASSERTION"); break; } } CConceptDescriptor* depNodeConDes = depNode->getConceptDescriptor(); QString conceptDepNodeString("null"); if (depNodeConDes) { conceptDepNodeString = CConceptTextFormater::getConceptString(depNodeConDes->getConcept(),depNodeConDes->isNegated()); } QString depIndiNodeString; CIndividualProcessNode* depIndiNode = depNode->getAppropriateIndividualNode(); if (depIndiNode) { depIndiNodeString = QString("@%1 ").arg(depIndiNode->getIndividualID()); } QString depInfoString; if (depNode->isNonDeterministiDependencyNode()) { CNonDeterministicDependencyNode* nonDetDepNode = (CNonDeterministicDependencyNode*)depNode; depInfoString += QString(" NonDetDep, <%1/%2>").arg(nonDetDepNode->getOpenedDependencyTrackingPointsCount()).arg(nonDetDepNode->getBranchTrackPoints()->getCount()); } depInfoString += QString(" + ...(%1)").arg(depNode->getAdditionalDependencyCount()); dependencyString = QString("%1-Dependency: {%2}%3%4").arg(depTypeString).arg(conceptDepNodeString).arg(depIndiNodeString).arg(depInfoString); } cint64 branchTag = depTrackPoint->getBranchingTag(); dependencyString = QString(" ^%1 ---> %2").arg(branchTag).arg(dependencyString); return dependencyString; } QStringList CCalculationTableauCompletionTaskHandleAlgorithm::generateExtendedDebugConceptSetStringList(CReapplyConceptLabelSet* conSet, CConceptPropagationBindingSetHash* propBindSetHash, CConceptVariableBindingPathSetHash* varBindPathSetHash, CCalculationAlgorithmContextBase* calcAlgContext) { QStringList conSetStringList; CReapplyConceptLabelSetIterator conSetIt = conSet->getConceptLabelSetIterator(false,false,false); while (conSetIt.hasNext()) { CConceptDescriptor* conDes = conSetIt.next(); CConcept* concept = conDes->getConcept(); cint64 conTag = conDes->getConceptTag(); if (conTag != 1) { QString conceptString("null"); if (conDes) { conceptString = CConceptTextFormater::getConceptString(conDes->getConcept(),conDes->isNegated()); } if (propBindSetHash) { CPropagationBindingSet* propBindSet = propBindSetHash->getPropagationBindingSet(concept,false); if (propBindSet) { QString bindingString; CPropagationBindingMap* map = propBindSet->getPropagationBindingMap(); for (CPropagationBindingMap::const_iterator it = map->constBegin(), itEnd = map->constEnd(); it != itEnd; ++it) { cint64 propBindingID = it.key(); if (!bindingString.isEmpty()) { bindingString += QString(", "); } bindingString += QString::number(propBindingID); } conceptString += QString(" ~{%1}").arg(bindingString); } } if (varBindPathSetHash) { CVariableBindingPathSet* varBindPathSet = varBindPathSetHash->getVariableBindingPathSet(concept,false); if (varBindPathSet) { QString bindingString; CVariableBindingPathMap* map = varBindPathSet->getVariableBindingPathMap(); for (CVariableBindingPathMap::const_iterator it = map->constBegin(), itEnd = map->constEnd(); it != itEnd; ++it) { cint64 varBindingPathID = it.key(); if (!bindingString.isEmpty()) { bindingString += QString(", "); } QString bindString; CVariableBindingPathDescriptor* varBindPathDes = it.value().getVariableBindingPathDescriptor(); CVariableBindingPath* varBindPath = varBindPathDes->getVariableBindingPath(); CVariableBindingDescriptor* varBindDes = varBindPath->getVariableBindingDescriptorLinker(); for (CVariableBindingDescriptor* varBindDesIt = varBindDes; varBindDesIt; varBindDesIt = varBindDesIt->getNext()) { CVariableBinding* varBinding = varBindDesIt->getVariableBinding(); if (!bindString.isEmpty()) { bindString += QString(", "); } bindString += QString("v-%1/i-%2").arg(varBinding->getBindedVariable()->getPathVariableID()).arg(varBinding->getBindedIndividual()->getIndividualID()); } bindingString += QString("{%1:%2}").arg(varBindingPathID).arg(bindString); } conceptString += QString(" ~{%1}").arg(bindingString); } } CDependencyTrackPoint* depTrackPoint = conDes->getDependencyTrackPoint(); if (depTrackPoint) { conceptString += generateDebugDependencyString(depTrackPoint,calcAlgContext); } conSetStringList.append(conceptString); } } return conSetStringList; } QString CCalculationTableauCompletionTaskHandleAlgorithm::generateExtendedDebugIndiModelStringList(CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CIndividualProcessNodeVector* indiVec = procDataBox->getIndividualProcessNodeVector(); cint64 indiCount = indiVec->getItemCount(); QStringList indiStringList; for (cint64 i = 0; i < indiCount; ++i) { CIndividualProcessNode* indi = getAvailableUpToDateIndividual(i,calcAlgContext); if (indi) { CIndividualProcessNode* ancIndi = getAncestorIndividual(indi,calcAlgContext); CReapplyConceptLabelSet* conSet = indi->getReapplyConceptLabelSet(false); CConceptPropagationBindingSetHash* propBindSetHash = indi->getConceptPropagationBindingSetHash(false); CConceptVariableBindingPathSetHash* varBindPathSetHash = indi->getConceptVariableBindingPathSetHash(false); if (conSet) { QString nominalString = QString(""); if (indi->getNominalIndividual()) { nominalString = QString(", ")+CIRIName::getRecentIRIName(indi->getNominalIndividual()->getNameLinker()); } QString indiString = QString("[ %1%2%3 ] =
").arg(ancIndi?QString("%1->").arg(ancIndi->getIndividualID()):"").arg(indi->getIndividualID()).arg(nominalString); QString statusString = QString("%1").arg(generateDebugIndiStatusString(indi,calcAlgContext)); indiString += QString("{{%1}d%2}
").arg(statusString).arg(indi->getIndividualNominalLevelOrAncestorDepth()); QStringList conSetStringList = generateExtendedDebugConceptSetStringList(conSet,propBindSetHash,varBindPathSetHash,calcAlgContext); //debugTestCriticalConceptSet(conSetStringList,calcAlgContext); QString depNomString = generateDebugDependentNominalsString(indi,calcAlgContext); if (!depNomString.isEmpty()) { indiString += QString("SuccessorDependentNominals: %1
\r\n").arg(depNomString); } QString incExpString = generateDebugIncrementalExpansionString(indi,calcAlgContext); if (!incExpString.isEmpty()) { indiString += QString("%1
\r\n").arg(incExpString); } QString conSetString(conSetStringList.join("
")); indiString += QString("$%1$
{%2} ").arg(conSet->getConceptSignatureValue()).arg(conSetString); indiStringList.append(indiString); } } else { indiStringList.append(QString("[ %1, --unused--]
").arg(i)); } } for (cint64 i = 0; i < indiCount; ++i) { CIndividualProcessNode* indi = getAvailableUpToDateIndividual(i,calcAlgContext); if (indi && indi->hasMergedIntoIndividualNodeID()) { cint64 mergedIntoID = indi->getMergedIntoIndividualNodeID(); QString meIndiString = indiStringList.value(mergedIntoID); meIndiString += QString("+%1").arg(i); if (mergedIntoID < indiStringList.count()) { indiStringList.replace(mergedIntoID,meIndiString); } else { LOG(ERROR,"::Konclude::Reasoner::Kernel::Algorithm::TableauCompletionAlgorihm",logTr("Merging of individual %1 into %2 cannot be correctly resolved for completion graph printing.").arg(i).arg(mergedIntoID),this); } } } for (cint64 i = 0; i < indiCount; ++i) { CIndividualProcessNode* indi = getAvailableUpToDateIndividual(i,calcAlgContext); if (indi && indi->hasMergedIntoIndividualNodeID()) { cint64 mergedIntoID = indi->getMergedIntoIndividualNodeID(); QString indiString = indiStringList.value(i); indiString += QString(" -> %1").arg(mergedIntoID); if (i < indiStringList.count()) { indiStringList.replace(i,indiString); } else { LOG(ERROR,"::Konclude::Reasoner::Kernel::Algorithm::TableauCompletionAlgorihm",logTr("Merging of individual %1 into %2 cannot be correctly resolved for completion graph printing.").arg(i).arg(mergedIntoID),this); } } } cint64 succInsertions = 0; for (cint64 i = 0; i < indiCount; ++i) { CIndividualProcessNode* indi = getAvailableUpToDateIndividual(i,calcAlgContext); if (indi) { CSuccessorIterator succIt = indi->getSuccessorIterator(); while (succIt.hasNext()) { cint64 succIndi = succIt.nextIndividualID(); QString succString = QString("\t--> %1: ").arg(succIndi); CSuccessorRoleIterator succRoleIt = indi->getSuccessorRoleIterator(succIndi); while (succRoleIt.hasNext()) { CIndividualLinkEdge* link = succRoleIt.next(); CRole* role = link->getLinkRole(); succString += QString::number(role->getRoleTag()); if (role->hasPropertyName()) { succString += CIRIName::getRecentIRIName(role->getPropertyNameLinker()); } CDependencyTrackPoint* depTrackPoint = link->getDependencyTrackPoint(); if (depTrackPoint) { succString += generateDebugDependencyString(depTrackPoint,calcAlgContext); } if (succRoleIt.hasNext()) { succString += QString(", "); } } indiStringList.insert(i+1+succInsertions++,succString); } } } mDebugIndiModelStringList = indiStringList; mDebugIndiModelString = mDebugIndiModelStringList.join("


\r\n"); if (calcAlgContext->getProcessingDataBox()->hasClashedDescriptorLinker()) { CTrackedClashedDescriptor* trackedClashDescriptors = createTrackedClashesDescriptors(calcAlgContext->getProcessingDataBox()->getClashedDescriptorLinker(),calcAlgContext); QString clashedString = generateDebugTrackedClashedDescriptorSummaryString(trackedClashDescriptors,calcAlgContext); mDebugIndiModelString = mDebugIndiModelString + QString("


\r\n


\r\nClashes


\r\n%1").arg(clashedString); } return mDebugIndiModelString; } QString CCalculationTableauCompletionTaskHandleAlgorithm::generateDebugIndiModelStringList(CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CIndividualProcessNodeVector* indiVec = procDataBox->getIndividualProcessNodeVector(); cint64 indiCount = indiVec->getItemCount(); QStringList indiStringList; for (cint64 i = 0; i < indiCount; ++i) { CIndividualProcessNode* indi = getAvailableUpToDateIndividual(i,calcAlgContext); if (indi) { CIndividualProcessNode* ancIndi = getAncestorIndividual(indi,calcAlgContext); CReapplyConceptLabelSet* conSet = indi->getReapplyConceptLabelSet(false); if (conSet) { QString nominalString = QString(""); if (indi->getNominalIndividual()) { nominalString = QString(", ")+CIRIName::getRecentIRIName(indi->getNominalIndividual()->getNameLinker()); } QString indiString = QString("[ %1%2%3 ] = ").arg(ancIndi?QString("%1->").arg(ancIndi->getIndividualID()):"").arg(indi->getIndividualID()).arg(nominalString); QString conSetString; CReapplyConceptLabelSetIterator conSetIt = conSet->getConceptLabelSetIterator(false,false,false); while (conSetIt.hasNext()) { CConceptDescriptor* conDes = conSetIt.next(); CConcept* concept = conDes->getConcept(); cint64 conTag = conDes->getConceptTag(); if (conTag != 1) { QString conString = QString("%1%2").arg((conDes->isNegated())?"-":"").arg(conTag); if (concept->hasClassName()) { conString += CIRIName::getRecentIRIName(concept->getClassNameLinker()); } if (!conSetString.isEmpty()) { conSetString += QString(", "); } conSetString += conString; } } indiString += QString("{%1} ").arg(conSetString); indiStringList.append(indiString); } } } for (cint64 i = 0; i < indiCount; ++i) { CIndividualProcessNode* indi = getAvailableUpToDateIndividual(i,calcAlgContext); if (indi && indi->hasMergedIntoIndividualNodeID()) { cint64 mergedIntoID = indi->getMergedIntoIndividualNodeID(); QString meIndiString = indiStringList.value(mergedIntoID); meIndiString += QString("+%1").arg(i); indiStringList.replace(mergedIntoID,meIndiString); } } for (cint64 i = 0; i < indiCount; ++i) { CIndividualProcessNode* indi = getAvailableUpToDateIndividual(i,calcAlgContext); if (indi && indi->hasMergedIntoIndividualNodeID()) { cint64 mergedIntoID = indi->getMergedIntoIndividualNodeID(); QString indiString = indiStringList.value(i); indiString += QString(" -> %1").arg(mergedIntoID); indiStringList.replace(i,indiString); } } cint64 succInsertions = 0; for (cint64 i = 0; i < indiCount; ++i) { CIndividualProcessNode* indi = getAvailableUpToDateIndividual(i,calcAlgContext); if (indi) { CSuccessorIterator succIt = indi->getSuccessorIterator(); while (succIt.hasNext()) { cint64 succIndi = succIt.nextIndividualID(); QString succString = QString("\t--> %1: ").arg(succIndi); CSuccessorRoleIterator succRoleIt = indi->getSuccessorRoleIterator(succIndi); while (succRoleIt.hasNext()) { CIndividualLinkEdge* link = succRoleIt.next(); CRole* role = link->getLinkRole(); succString += QString::number(role->getRoleTag()); if (role->hasPropertyName()) { succString += CIRIName::getRecentIRIName(role->getPropertyNameLinker()); } if (succRoleIt.hasNext()) { succString += QString(", "); } } indiStringList.insert(i+1+succInsertions++,succString); } } } mDebugIndiModelStringList = indiStringList; mDebugIndiModelString = mDebugIndiModelStringList.join("\n"); return mDebugIndiModelString; } bool CCalculationTableauCompletionTaskHandleAlgorithm::initialNodeInitialize(CIndividualProcessNode*& indiProcNode, bool allowPreprocess, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptAssertionLinker* assertionConceptLinker = indiProcNode->getAssertionConceptLinker(); CRoleAssertionLinker* assertionRoleLinkerIt = indiProcNode->getAssertionRoleLinker(); CReverseRoleAssertionLinker* reverseAssertionRoleLinkerIt = indiProcNode->getReverseAssertionRoleLinker(); CAdditionalProcessRoleAssertionsLinker* addProcRoleAssertionsLinker = indiProcNode->getAdditionalRoleAssertionsLinker(); CXSortedNegLinker* initConceptLinker = indiProcNode->getProcessInitializingConceptLinker(); CReapplyConceptLabelSet* conSet = indiProcNode->getReapplyConceptLabelSet(false); bool initialized = false; CConceptSetSignature assInitSignature; bool assInitSignatureBuilded = false; if (assertionConceptLinker || initConceptLinker || !conSet) { CDependencyTrackPoint* depTrackPoint = calcAlgContext->getBaseDependencyNode()->getContinueDependencyTrackPoint(); CConcept* topConcept = calcAlgContext->getProcessingDataBox()->getOntologyTopConcept(); addConceptToIndividual(topConcept,false,indiProcNode,depTrackPoint,allowPreprocess,true,calcAlgContext); initialized = true; } if (indiProcNode->isNominalIndividual()) { if (!indiProcNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { propagateIndividualNodeNominalConnectionToAncestors(indiProcNode,calcAlgContext); } //propagateIndividualNodeNominalConnectionStatusToAncestors(indiProcNode,indiProcNode,calcAlgContext); } if (assertionConceptLinker || initConceptLinker) { CDependencyTrackPoint* depTrackPoint = calcAlgContext->getBaseDependencyNode()->getContinueDependencyTrackPoint(); CConcept* univConnNomValueConcept = calcAlgContext->getProcessingDataBox()->getOntology()->getTBox()->getUniversalConnectionNominalValueConcept(); if (univConnNomValueConcept) { addConceptToIndividual(univConnNomValueConcept,false,indiProcNode,depTrackPoint,allowPreprocess,true,calcAlgContext); } } if (assertionConceptLinker) { CDependencyTrackPoint* depTrackPoint = calcAlgContext->getBaseDependencyNode()->getContinueDependencyTrackPoint(); if (!mOptIncrementalCompatibleExpansion && loadIndividualNodeDataFromBackendCache(indiProcNode,calcAlgContext)) { CIndividual* nominalIndi = indiProcNode->getNominalIndividual(); if (nominalIndi) { CConcept* nominalConcept = nominalIndi->getIndividualNominalConcept(); if (nominalConcept) { addConceptToIndividual(nominalConcept,false,indiProcNode,depTrackPoint,true,true,calcAlgContext); } } tryEstablishExpansionBlockingWithBackendCacheSynchronisation(indiProcNode,calcAlgContext); } else { addConceptsToIndividual(assertionConceptLinker,false,indiProcNode,depTrackPoint,allowPreprocess,true,nullptr,calcAlgContext); for (CConceptAssertionLinker* assertionConceptLinkerIt = assertionConceptLinker; assertionConceptLinkerIt; assertionConceptLinkerIt = assertionConceptLinkerIt->getNext()) { CConcept* assertionConcept = assertionConceptLinkerIt->getData(); bool assertionConceptNegation = assertionConceptLinkerIt->isNegated(); if (assertionConcept->getOperatorCode() != CCNOMINAL) { assInitSignature.addConceptSignature(assertionConcept,assertionConceptNegation); assInitSignatureBuilded = true; } } CIndividual* nominalIndi = indiProcNode->getNominalIndividual(); if (nominalIndi) { CConcept* nominalConcept = nominalIndi->getIndividualNominalConcept(); if (nominalConcept) { addConceptToIndividual(nominalConcept,false,indiProcNode,depTrackPoint,true,true,calcAlgContext); } } } initialized = true; indiProcNode->clearAssertionConcepts(); } if (initConceptLinker) { if (!calcAlgContext->getUsedProcessingDataBox()->hasConstructedIndividualNodeInitialized()) { calcAlgContext->getUsedProcessingDataBox()->setConstructedIndividualNodeInitialized(true); tryCompletionGraphReuse(indiProcNode,calcAlgContext); } CDependencyTrackPoint* depTrackPoint = calcAlgContext->getBaseDependencyNode()->getContinueDependencyTrackPoint(); if (!mConfExpandCreatedSuccessorsFromSaturation || !tryInitalizingFromSaturatedData(indiProcNode,initConceptLinker,depTrackPoint,allowPreprocess,calcAlgContext)) { addConceptsToIndividual(initConceptLinker,false,indiProcNode,depTrackPoint,allowPreprocess,true,nullptr,calcAlgContext); } indiProcNode->clearProcessInitializingConcepts(); initialized = true; for (CXSortedNegLinker* initConceptLinkerIt = initConceptLinker; initConceptLinkerIt; initConceptLinkerIt = initConceptLinkerIt->getNext()) { CConcept* initConcept = initConceptLinkerIt->getData(); bool initConceptNegation = initConceptLinkerIt->isNegated(); if (initConcept->getOperatorCode() != CCNOMINAL) { assInitSignature.addConceptSignature(initConcept,initConceptNegation); assInitSignatureBuilded = true; } } } if (assertionRoleLinkerIt || reverseAssertionRoleLinkerIt || addProcRoleAssertionsLinker) { detectIndividualNodeBackendCacheSynchronized(indiProcNode,calcAlgContext); if (!indiProcNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDNEIGHBOUREXPANSIONBLOCKED)) { if (allowPreprocess || mCurrentRecProcDepth < mCurrentRecProcDepthLimit) { indiProcNode->clearAssertionRoles(); indiProcNode->clearReverseAssertionRoles(); indiProcNode->clearAdditionalRoleAssertionsLinker(); indiProcNode->clearAdditionalRoleAssertionsLinker(); CDependencyTrackPoint* depTrackPoint = calcAlgContext->getBaseDependencyNode()->getContinueDependencyTrackPoint(); while (assertionRoleLinkerIt) { addRoleAssertion(indiProcNode,assertionRoleLinkerIt,depTrackPoint,calcAlgContext); assertionRoleLinkerIt = assertionRoleLinkerIt->getNext(); } for (CAdditionalProcessRoleAssertionsLinker* addProcRoleAssertionsLinkerIt = addProcRoleAssertionsLinker; addProcRoleAssertionsLinkerIt; addProcRoleAssertionsLinkerIt = addProcRoleAssertionsLinkerIt->getNext()) { if (addProcRoleAssertionsLinkerIt->getRoleAssertionLinker()) { addRoleAssertion(indiProcNode,addProcRoleAssertionsLinkerIt->getRoleAssertionLinker(),depTrackPoint,calcAlgContext); } } indiProcNode->setRoleAssertionsInitialized(true); while (reverseAssertionRoleLinkerIt) { addReverseRoleAssertion(indiProcNode,reverseAssertionRoleLinkerIt,depTrackPoint,calcAlgContext); reverseAssertionRoleLinkerIt = reverseAssertionRoleLinkerIt->getNext(); } for (CAdditionalProcessRoleAssertionsLinker* addProcRoleAssertionsLinkerIt = addProcRoleAssertionsLinker; addProcRoleAssertionsLinkerIt; addProcRoleAssertionsLinkerIt = addProcRoleAssertionsLinkerIt->getNext()) { if (addProcRoleAssertionsLinkerIt->getReverseRoleAssertionLinker()) { addReverseRoleAssertion(indiProcNode,addProcRoleAssertionsLinkerIt->getReverseRoleAssertionLinker(),depTrackPoint,calcAlgContext); } } indiProcNode->setReverseRoleAssertionsInitialized(true); } else { calcAlgContext->getProcessingDataBox()->getRoleAssertionProcessingQueue(true)->insertIndiviudalProcessNode(indiProcNode); } initialized = true; } } if (assInitSignatureBuilded && mOptDetExpPreporcessing) { cint64 assInitSigValue = assInitSignature.getSignatureValue(); indiProcNode->setAssertionInitialisationSignatureValue(assInitSigValue); STATINC(SIGNATURESAVINGCOUNT,calcAlgContext); CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CSignatureBlockingCandidateHash* sigNomDelCandHash = processingDataBox->getSignatureNominalDelayingCandidateHash(true); sigNomDelCandHash->insertSignatureBlockingCandidate(assInitSigValue,indiProcNode); } if (mConfAddCachedComputedConsequences && indiProcNode->isNominalIndividual() && !mOptIncrementalExpansion) { addCachedComputedTypes(indiProcNode,calcAlgContext); } return initialized; } bool CCalculationTableauCompletionTaskHandleAlgorithm::addCachedComputedTypes(CIndividualProcessNode*& indiProcNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool addedConcepts = false; CIndividual* individual = indiProcNode->getNominalIndividual(); if (individual && mCompConsCacheHandler && !indiProcNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCACHEDCOMPUTEDTYPESADDED)) { indiProcNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFCACHEDCOMPUTEDTYPESADDED); CSortedNegLinker* typeConceptLinker = mCompConsCacheHandler->getCachedTypesConceptLinker(individual,calcAlgContext); if (typeConceptLinker) { CDependencyTrackPoint* depTrackPoint = calcAlgContext->getBaseDependencyNode()->getContinueDependencyTrackPoint(); CDependencyTrackPoint* expDepTrackPoint = nullptr; createANDDependency(expDepTrackPoint,indiProcNode,nullptr,depTrackPoint,calcAlgContext); addConceptsToIndividual(typeConceptLinker,false,indiProcNode,expDepTrackPoint,true,false,nullptr,calcAlgContext); addedConcepts = true; } } return addedConcepts; } bool CCalculationTableauCompletionTaskHandleAlgorithm::individualNodeInitializing(CIndividualProcessNode*& indiProcNode, CCalculationAlgorithmContextBase* calcAlgContext) { indiProcNode = getLocalizedIndividual(indiProcNode,true,calcAlgContext); indiProcNode->setProcessingQueued(false); indiProcNode->setExtendedQueueProcessing(true); calcAlgContext->setCurrentIndividualNode(indiProcNode); if (mIndiNodeFromQueueType == INQT_IMMEDIATE) { indiProcNode->setImmediatelyProcessingQueued(false); } else if (mIndiNodeFromQueueType == INQT_DETEXP) { indiProcNode->setDeterministicExpandingProcessingQueued(false); } else if (mIndiNodeFromQueueType == INQT_DEPTHNORMAL || mIndiNodeFromQueueType == INQT_NOMINAL) { indiProcNode->setRegularDepthProcessingQueued(false); } else if (mIndiNodeFromQueueType == INQT_BLOCKREACT) { indiProcNode->setBlockedReactivationProcessingQueued(false); } else if (mIndiNodeFromQueueType == INQT_DELAYEDNOMINAL) { indiProcNode->setDelayedNominalProcessingQueued(false); } else if (mIndiNodeFromQueueType == INQT_BACKENDSYNCRETEST) { indiProcNode->setBackendSynchronRetestProcessingQueued(false); } indiProcNode->resetLastProcessingPriority(); //if (indiProcNode->getNominalIndividual()) { // if (CIRIName::getRecentIRIName(indiProcNode->getNominalIndividual()->getIndividualNameLinker()) == "#robert_david_bright_1965") { // bool bug = true; // } //} //} initialNodeInitialize(indiProcNode,true,calcAlgContext); if (mIndiNodeFromQueueType == INQT_CACHETEST) { testIndividualNodeUnsatisfiableCached(indiProcNode,calcAlgContext); } else if (mIndiNodeFromQueueType == INQT_VSTSATTESTING) { checkValueSpaceDistinctSatisfiability(indiProcNode,calcAlgContext); } else if (mIndiNodeFromQueueType == INQT_VSTRIGGERING) { triggerValueSpaceConcepts(indiProcNode,calcAlgContext); } if (isIndividualNodeProcessingBlocked(indiProcNode,calcAlgContext)) { eliminiateBlockedIndividuals(indiProcNode,calcAlgContext); return false; } // counting same concept signature //conSet = indiProcNode->getReapplyConceptLabelSet(false); //if (conSet) { // cint64 sigVal = conSet->getConceptSignature()->getSignatureValue(); // cint64 prevCountVal = mIndiNodeInitConceptSigCountHash.value(sigVal,0); // mIndiNodeInitConceptSigCountHash.insert(sigVal,prevCountVal+1); //} if (mConfSignatureSaving) { addSignatureIndividualNodeBlockerCandidate(indiProcNode,calcAlgContext); } return true; } void CCalculationTableauCompletionTaskHandleAlgorithm::checkValueSpaceDistinctSatisfiability(CIndividualProcessNode* processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { if (mDatatypeHandler && mConfDatatypeReasoning) { //mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); //QFile file(QString("datatype-error.txt")); //if (file.open(QIODevice::WriteOnly)) { // file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); //} CTaskProcessorContext* taskProcessorContext = calcAlgContext->getUsedTaskProcessorContext(); CPROCESSINGSET* distinctIndividualNodeCollectionSet = CObjectParameterizingAllocator< CPROCESSINGSET,CContext* >::allocateAndConstructAndParameterize(taskProcessorContext->getMemoryAllocationManager(),taskProcessorContext); CPROCESSINGLIST* distinctIndividualNodeCollectionList = CObjectParameterizingAllocator< CPROCESSINGLIST,CContext* >::allocateAndConstructAndParameterize(taskProcessorContext->getMemoryAllocationManager(),taskProcessorContext); if (mDatatypeHandler->requiresSatisfiabilityChecking(processIndi,calcAlgContext)) { distinctIndividualNodeCollectionSet->insert(processIndi); distinctIndividualNodeCollectionList->append(processIndi); while (!distinctIndividualNodeCollectionList->isEmpty()) { CIndividualProcessNode* distinctIndiNode = distinctIndividualNodeCollectionList->takeFirst(); CDistinctHash* distinctHash = distinctIndiNode->getDistinctHash(false); if (distinctHash) { CDistinctIterator distinctIterator = distinctHash->getDistinctIterator(); while (distinctIterator.hasNext()) { cint64 nextDistinctIndiID = distinctIterator.nextDistinctIndividualID(); CIndividualProcessNode* nextDistinctIndiNode = getLocalizedIndividual(nextDistinctIndiID,calcAlgContext); if (mDatatypeHandler->involveDistinctNodeForSatisfiabilityChecking(nextDistinctIndiNode,calcAlgContext)) { if (!distinctIndividualNodeCollectionSet->contains(nextDistinctIndiNode)) { distinctIndividualNodeCollectionSet->insert(nextDistinctIndiNode); distinctIndividualNodeCollectionList->append(nextDistinctIndiNode); } } } } } } mDatatypeHandler->checkSatisfiability(processIndi,distinctIndividualNodeCollectionSet,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::triggerValueSpaceConcepts(CIndividualProcessNode* processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { if (mDatatypeHandler && mConfDatatypeReasoning) { CConceptDescriptor* triggeredConceptLinker = nullptr; //mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); //QFile file(QString("debug-model.txt")); //if (file.open(QIODevice::WriteOnly)) { // file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); //} mDatatypeHandler->triggerValueSpaceConcepts(processIndi,triggeredConceptLinker,calcAlgContext); CConceptDescriptor* invTriggeredConceptLinker = nullptr; while (triggeredConceptLinker) { CConceptDescriptor* tmpTriggeredConceptLinker = triggeredConceptLinker; triggeredConceptLinker = triggeredConceptLinker->getNextConceptDesciptor(); tmpTriggeredConceptLinker->clearNext(); invTriggeredConceptLinker = tmpTriggeredConceptLinker->append(invTriggeredConceptLinker); } for (CConceptDescriptor* triggeredConceptLinkerIt = invTriggeredConceptLinker; triggeredConceptLinkerIt; triggeredConceptLinkerIt = triggeredConceptLinkerIt->getNext()) { CConcept* triggeredConcept = triggeredConceptLinkerIt->getConcept(); bool triggeredNegation = triggeredConceptLinkerIt->isNegated(); CDependencyTrackPoint* triggeredDependencyTrackPoint = triggeredConceptLinkerIt->getDependencyTrackPoint(); addConceptToIndividual(triggeredConcept,triggeredNegation,processIndi,triggeredDependencyTrackPoint,true,false,calcAlgContext); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::tryCompletionGraphReuse(CIndividualProcessNode* processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { bool minimalCompletionGraph = false; bool minimalCompletionGraphConnection = false; if (mReuseCompGraphCacheHandler && mConfCompGraphReuseCacheRetrieval) { STATINC(COMPLETIONGRAPHREUSECACHERETRIEVALCOUNT,calcAlgContext); KONCLUCE_TASK_ALGORITHM_TIME_MEASURE_INSTRUCTION( mComplGraphReuseCacheRetrieval.start(); ); CReuseCompletionGraphCacheEntry* reuseCompGraphCacheEntry = mReuseCompGraphCacheHandler->getReuseCompletionGraphEntry(processIndi,&minimalCompletionGraph,&minimalCompletionGraphConnection,calcAlgContext); KONCLUCE_TASK_ALGORITHM_TIME_MEASURE_INSTRUCTION( cint64 timeElapsed = mComplGraphReuseCacheRetrieval.elapsed(); STATINCM(TIMECOMPLETIONGRAPHREUSERETRIVAL,timeElapsed,calcAlgContext); ); if (reuseCompGraphCacheEntry) { STATINC(COMPLETIONGRAPHREUSECACHERETRIEVALSUCCESSCOUNT,calcAlgContext); CXSortedNegLinker* initConceptLinkerIt = processIndi->getProcessInitializingConceptLinker(); CTaskProcessorContext* processorContext = calcAlgContext->getUsedTaskProcessorContext(); CSatisfiableCalculationTask* reuseSatCalcTask = (CSatisfiableCalculationTask*)reuseCompGraphCacheEntry->getJobInstantiation(); CProcessingDataBox* reuseProcessingDataBox = reuseSatCalcTask->getProcessingDataBox(); cint64 reuseBranchingTag = reuseProcessingDataBox->getProcessContext()->getUsedProcessTagger()->getCurrentBranchingTag(); bool deterministicReuse = reuseBranchingTag == 0 && minimalCompletionGraph && minimalCompletionGraphConnection; if (!deterministicReuse && mConfCompGraphNonDeterministicReuse || deterministicReuse && mConfCompGraphDeterministicReuse) { cint64 taskCreationCount = 2; if (deterministicReuse) { STATINC(COMPLETIONGRAPHREUSECACHEREUSINGDETCOUNT,calcAlgContext); taskCreationCount = 1; } else { STATINC(COMPLETIONGRAPHREUSECACHEREUSINGNONDETCOUNT,calcAlgContext); } CSatisfiableCalculationTask* newTaskList = createDependendBranchingTaskList(taskCreationCount,calcAlgContext); CSatisfiableCalculationTask* newTaskIt = newTaskList; CREUSECOMPLETIONGRAPHDependencyNode* reuseDepNode = createREUSECOMPLETIONGRAPHDependency(processIndi,nullptr,nullptr,calcAlgContext); for (cint64 i = 0; i < taskCreationCount; ++i) { CSatisfiableCalculationTask* newSatCalcTask = newTaskIt; bool reusingAlternative = i == 0; if (reusingAlternative) { CDependencyTrackPoint* newDependencyTrackPoint = nullptr; if (deterministicReuse) { newDependencyTrackPoint = calcAlgContext->getBaseDependencyNode()->getContinueDependencyTrackPoint(); } else { newDependencyTrackPoint = createNonDeterministicDependencyTrackPointBranch(reuseDepNode,false,calcAlgContext); } CProcessingDataBox* newProcessingDataBox = newSatCalcTask->getProcessingDataBox(); newProcessingDataBox->initProcessingDataBox(reuseProcessingDataBox); CProcessContext* newProcessContext = newSatCalcTask->getProcessContext(processorContext); CCalculationAlgorithmContextBase* newCalcAlgContext = createCalculationAlgorithmContext(processorContext,newProcessContext,newSatCalcTask); CMemoryAllocationManager* newAllocMemMan = newCalcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CProcessTagger* newProcessTagger = newCalcAlgContext->getUsedProcessTagger(); if (!deterministicReuse) { newProcessTagger->incBranchingTag(); if (!minimalCompletionGraphConnection) { newProcessingDataBox->setMaximumDeterministicBranchTag(-1); } } newProcessTagger->incLocalizationTag(); CIndividualProcessNodeVector* indiNodeVec = newProcessingDataBox->getIndividualProcessNodeVector(); cint64 nextIndiID = indiNodeVec->getItemCount(); CIndividualProcessNode* newIndi = CObjectParameterizingAllocator< CIndividualProcessNode,CProcessContext* >::allocateAndConstructAndParameterize(newAllocMemMan,newProcessContext); newIndi->setIndividualID(nextIndiID); newIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDBLOCKINGORCACHING); newProcessingDataBox->setConstructedIndividualNode(newIndi); indiNodeVec->setData(nextIndiID,newIndi); addConceptsToIndividual(initConceptLinkerIt,false,newIndi,newDependencyTrackPoint,false,true,nullptr,newCalcAlgContext); CConcept* topConcept = calcAlgContext->getProcessingDataBox()->getOntologyTopConcept(); addConceptToIndividual(topConcept,false,newIndi,newDependencyTrackPoint,false,true,newCalcAlgContext); prepareBranchedTaskProcessing(newIndi,newSatCalcTask,newCalcAlgContext); } else { CProcessContext* newProcessContext = newSatCalcTask->getProcessContext(processorContext); CCalculationAlgorithmContextBase* newCalcAlgContext = createCalculationAlgorithmContext(processorContext,newProcessContext,newSatCalcTask); CMemoryAllocationManager* newAllocMemMan = newCalcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CIndividualProcessNode* newLocIndiNode = getLocalizedIndividual(processIndi,false,newCalcAlgContext); prepareBranchedTaskProcessing(newLocIndiNode,newSatCalcTask,newCalcAlgContext); } // set new task priority double newTaskPriority = calcAlgContext->getUsedTaskPriorityStrategy()->getPriorityForTaskReusing(newSatCalcTask,calcAlgContext->getUsedSatisfiableCalculationTask(),reusingAlternative); newSatCalcTask->setTaskPriority(newTaskPriority); newTaskIt = (CSatisfiableCalculationTask*)newTaskIt->getNext(); } processorContext->getTaskProcessorCommunicator()->communicateTaskCreation(newTaskList); throw CCalculationStopProcessingException(true); } } else { STATINC(COMPLETIONGRAPHREUSECACHERETRIEVALFAILEDCOUNT,calcAlgContext); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::eliminiateBlockedIndividuals(CIndividualProcessNode*& indiProcNode, CCalculationAlgorithmContextBase* calcAlgContext) { //if (indiProcNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDATEBLOCKERFLAGSCOMPINATION)) { if (indiProcNode->hasBlockedIndividualsLinker()) { // reactivate all blocked individuals reactivateBlockedIndividuals(indiProcNode,calcAlgContext); } if (indiProcNode->hasBlockingFollower()) { CBlockingFollowSet* followerSet = indiProcNode->getBlockingFollowSet(false); for (CPROCESSSET::const_iterator it = followerSet->constBegin(), itEnd = followerSet->constEnd(); it != itEnd; ++it) { cint64 blockingIndiNodeID = *it; CIndividualProcessNode* blockingIndiNode = getUpToDateIndividual(blockingIndiNodeID,calcAlgContext); addIndividualToBlockingUpdateReviewProcessingQueue(blockingIndiNode,calcAlgContext); } } CXLinker* processingBlockedNodeLinker = indiProcNode->getProcessingBlockedIndividualsLinker(); while (processingBlockedNodeLinker) { CIndividualProcessNode* blockedNode = processingBlockedNodeLinker->getData(); CIndividualProcessNode* locBlockedNode = getLocalizedIndividual(blockedNode,true,calcAlgContext); locBlockedNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEPROCESSINGCOMPLETED); addIndividualToProcessingQueue(locBlockedNode,calcAlgContext); processingBlockedNodeLinker = processingBlockedNodeLinker->getNext(); } indiProcNode->clearBlockedIndividualsLinker(); //} } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getDelayProcessingBlockingNominalNode(CIndividualProcessNode* testIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* nominalBlockerIndividual = nullptr; CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CSignatureBlockingCandidateHash* sigNomDelCandHash = processingDataBox->getSignatureNominalDelayingCandidateHash(false); CReapplyConceptLabelSet* conSet = testIndi->getReapplyConceptLabelSet(false); if (conSet && sigNomDelCandHash) { cint64 assConSig = testIndi->getAssertionInitialisationSignatureValue(); CSignatureBlockingCandidateIterator candIt(sigNomDelCandHash->getBlockingCandidatesIterator(assConSig)); while (!nominalBlockerIndividual && candIt.hasNext()) { cint64 candIndiID = candIt.next(true); if (candIndiID != testIndi->getIndividualID()) { CIndividualProcessNode* candIndiNode = getUpToDateIndividual(candIndiID,calcAlgContext); if (candIndiNode->isNominalIndividual() && candIndiNode->getNominalIndividual() && !candIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED)) { CReapplyConceptLabelSet* blockerConSet = candIndiNode->getReapplyConceptLabelSet(false); if (isLabelConceptSubSetIgnoreNominals(conSet,blockerConSet,calcAlgContext)) { nominalBlockerIndividual = candIndiNode; } } } } } return nominalBlockerIndividual; } bool CCalculationTableauCompletionTaskHandleAlgorithm::tryDelayNominalProcessing(CConceptProcessDescriptor* conProDes, CIndividualProcessNode* testIndi, CCalculationAlgorithmContextBase* calcAlgContext) { if (canDelayNominalProcessing(conProDes,testIndi,calcAlgContext)) { testIndi->setNominalProcessingDelayingChecked(true); bool notConnectedNominal = false; CSuccessorIterator succIt(testIndi->getSuccessorIterator()); if (!succIt.hasNext()) { notConnectedNominal = true; } if (notConnectedNominal) { CIndividualProcessNode* blockerNominalIndiNode = getDelayProcessingBlockingNominalNode(testIndi,calcAlgContext); if (blockerNominalIndiNode) { CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CIndividualUnsortedProcessingQueue* delayingNominalProcessingQueu = processingDataBox->getDelayingNominalProcessingQueue(true); delayingNominalProcessingQueu->insertIndiviudalProcessNode(testIndi); testIndi->setDelayedNominalProcessingQueued(true); return true; } } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::canDelayNominalProcessing(CConceptProcessDescriptor* conProDes, CIndividualProcessNode* testIndi, CCalculationAlgorithmContextBase* calcAlgContext) { if (testIndi->isNominalIndividual() && testIndi->getNominalIndividual()) { if (conProDes->getProcessPriority() < mImmediatelyProcessPriority) { if (!testIndi->hasNominalProcessingDelayingChecked()) { return true; } } } return false; } void CCalculationTableauCompletionTaskHandleAlgorithm::individualNodeConclusion(CIndividualProcessNode*& indiProcNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (mIndiNodeConcludeUnsatCaching) { testIndividualNodeUnsatisfiableCached(indiProcNode,calcAlgContext); } calcAlgContext->setCurrentIndividualNode(nullptr); addIndividualToProcessingQueue(indiProcNode,calcAlgContext); //CConceptProcessingQueue* conProQue = indiProcNode->getConceptProcessingQueue(false); //if (nodeProcessingBreaked && conProQue && !conProQue->isEmpty()) { // addIndividualToProcessingQueue(indiProcNode,false,calcAlgContext); //} else if (!conProQue || conProQue->isEmpty()) { // propagateIndividualProcessedAndReactivate(indiProcNode,calcAlgContext); //} } bool CCalculationTableauCompletionTaskHandleAlgorithm::tableauRuleProcessing(CIndividualProcessNode*& indiProcNode,CConceptProcessDescriptor*& conProcDes, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProcDes->getConceptDescriptor(); bool conNeg = conDes->getNegation(); CConcept* concept = conDes->getConcept(); cint64 conOpCode = concept->getOperatorCode(); if (tryDelayNominalProcessing(conProcDes,indiProcNode,calcAlgContext)) { return false; } if (needsIndividualNodeExpansionBlockingTest(conProcDes,indiProcNode,calcAlgContext)) { if (isIndividualNodeBackendCacheSynchronizationProcessingBlocked(indiProcNode,calcAlgContext)) { return false; } if (isIndividualNodeExpansionBlocked(indiProcNode,calcAlgContext)) { return false; } } tableauRuleChoice(indiProcNode,conProcDes,calcAlgContext); return true; } void CCalculationTableauCompletionTaskHandleAlgorithm::tableauRuleChoice(CIndividualProcessNode*& indiProcNode,CConceptProcessDescriptor*& conProcDes, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProcDes->getConceptDescriptor(); bool conNeg = conDes->getNegation(); CConcept* concept = conDes->getConcept(); cint64 conOpCode = concept->getOperatorCode(); ++mCurrentRecProcDepth; TableauRuleFunction func = nullptr; if (!conNeg) { func = mPosJumpFuncVec[conOpCode]; if (func) { (this->*func)(indiProcNode,conProcDes,false,calcAlgContext); } mLastJumpFunc = func; } else { func = mNegJumpFuncVec[conOpCode]; if (func) { (this->*func)(indiProcNode,conProcDes,true,calcAlgContext); } mLastJumpFunc = func; } --mCurrentRecProcDepth; } void CCalculationTableauCompletionTaskHandleAlgorithm::applyNegAutomatChooseRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { applyAutomatChooseRule(processIndi,conProDes,!negate,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::applyNegANDRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { applyANDRule(processIndi,conProDes,!negate,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::applyNegSOMERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { applySOMERule(processIndi,conProDes,!negate,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::applyNegALLRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { applyALLRule(processIndi,conProDes,!negate,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::applyNegORRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { applyORRule(processIndi,conProDes,!negate,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::applyNegATMOSTRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { applyATLEASTRule(processIndi,conProDes,negate,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::applyNegATLEASTRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { applyATMOSTRule(processIndi,conProDes,negate,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::applyAutomatChooseRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(AUTOMATEINITCOUNT,calcAlgContext); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool conceptNegation = negate; CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CAUTOMATCHOOSEDependencyNode* andDepNode = createAUTOMATCHOOSEDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,calcAlgContext); while (conceptOpLinkerIt) { CConcept* opConcept = conceptOpLinkerIt->getData(); bool opNegation = conceptOpLinkerIt->isNegated(); if (opNegation == negate) { addConceptToIndividual(opConcept,false,processIndi,nextDepTrackPoint,true,false,calcAlgContext); } conceptOpLinkerIt = conceptOpLinkerIt->getNext(); } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyAutomatANDRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool conceptNegation = negate; CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); applyAutomatTransactions(processIndi,conProDes,concept,negate,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::applyAutomatTransactions(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, CConcept* concept, bool negated, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(AUTOMATERULEAPPLICATIONCOUNT,calcAlgContext); CConceptDescriptor* baseConDes = conProDes->getConceptDescriptor(); bool reapplied = conProDes->isConceptReapplied(); CIndividualLinkEdge* restLink = getLinkProcessingRestriction(conProDes); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); cint64 opCode = concept->getOperatorCode(); CSortedNegLinker* opConcepts = concept->getOperandList(); if (opCode == CCAQAND || opCode == CCIMPLAQAND || opCode == CCBRANCHAQAND) { while (opConcepts) { ++mAppliedALLRuleCount; STATINC(AUTOMATESTATECOUNT,calcAlgContext); CConcept* opCon = opConcepts->getData(); bool opConNeg = opConcepts->isNegated(); applyAutomatTransactions(processIndi,conProDes,opCon,opConNeg,calcAlgContext); opConcepts = opConcepts->getNext(); } } else if (opCode == CCAQALL || opCode == CCIMPLAQALL || opCode == CCBRANCHAQALL) { CRole* role = concept->getRole(); if (restLink) { if (restLink->getLinkRole() == role) { ++mAppliedALLRuleCount; STATINC(AUTOMATETRANSACTIONCOUNT,calcAlgContext); CDependencyTrackPoint* nextDepTrackPoint = nullptr; CAUTOMATTRANSACTIONDependencyNode* allDepNode = nullptr; bool allDepNodeCreated = false; CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,restLink,calcAlgContext); CIndividualProcessNode* locSuccIndi = nullptr; CReapplyConceptLabelSet* conLabelSet = succIndi->getReapplyConceptLabelSet(false); CSortedNegLinker* conceptOpLinkerIt = opConcepts; while (conceptOpLinkerIt) { CConcept* opConcept = conceptOpLinkerIt->getData(); bool opConNeg = conceptOpLinkerIt->isNegated() ^ negated; if (!conLabelSet->containsConcept(opConcept,opConNeg)) { // create dependency if (!allDepNodeCreated) { allDepNodeCreated = true; allDepNode = createAUTOMATTRANSACTIONDependency(nextDepTrackPoint,processIndi,baseConDes,depTrackPoint,restLink->getDependencyTrackPoint(),calcAlgContext); } // add concept if (!locSuccIndi) { locSuccIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); conLabelSet = locSuccIndi->getReapplyConceptLabelSet(true); } addConceptToIndividual(opConcept,opConNeg,locSuccIndi,nextDepTrackPoint,true,true,calcAlgContext); } conceptOpLinkerIt = conceptOpLinkerIt->getNext(); } if (locSuccIndi) { addIndividualToProcessingQueue(locSuccIndi,calcAlgContext); } } } else { CReapplyRoleSuccessorHash* roleSuccHash = processIndi->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { CRoleSuccessorLinkIterator roleSuccIt = roleSuccHash->getRoleSuccessorLinkIterator(role); while (roleSuccIt.hasNext()) { ++mAppliedALLRuleCount; STATINC(AUTOMATETRANSACTIONCOUNT,calcAlgContext); CDependencyTrackPoint* nextDepTrackPoint = nullptr; CAUTOMATTRANSACTIONDependencyNode* allDepNode = nullptr; bool allDepNodeCreated = false; CIndividualLinkEdge* link = roleSuccIt.next(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); CIndividualProcessNode* locSuccIndi = nullptr; CReapplyConceptLabelSet* conLabelSet = succIndi->getReapplyConceptLabelSet(false); CSortedNegLinker* conceptOpLinkerIt = opConcepts; while (conceptOpLinkerIt) { CConcept* opConcept = conceptOpLinkerIt->getData(); bool opConNeg = conceptOpLinkerIt->isNegated() ^ negated; if (!conLabelSet->containsConcept(opConcept,opConNeg)) { // create dependency if (!allDepNodeCreated) { allDepNodeCreated = true; allDepNode = createAUTOMATTRANSACTIONDependency(nextDepTrackPoint,processIndi,baseConDes,depTrackPoint,link->getDependencyTrackPoint(),calcAlgContext); } // add concept if (!locSuccIndi) { locSuccIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); conLabelSet = locSuccIndi->getReapplyConceptLabelSet(true); } addConceptToIndividual(opConcept,opConNeg,locSuccIndi,nextDepTrackPoint,true,true,calcAlgContext); } conceptOpLinkerIt = conceptOpLinkerIt->getNext(); } if (locSuccIndi) { addIndividualToProcessingQueue(locSuccIndi,calcAlgContext); } } } } if (!reapplied) { // add to reapply queue addConceptToReapplyQueue(baseConDes,role,processIndi,true,depTrackPoint,calcAlgContext); } } else if (!reapplied) { addConceptToIndividual(concept,negated,processIndi,depTrackPoint,true,true,calcAlgContext); } } CREPRESENTATIVEGROUNDINGDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createREPRESENTATIVEGROUNDINGDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CVariableBindingPath* selectVarBindPath, CCalculationAlgorithmContextBase* calcAlgContext) { CREPRESENTATIVEGROUNDINGDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createREPRESENTATIVEGROUNDINGDependency(implContinueDepTrackPoint,processIndi,conDes,prevDepTrackPoint,selectVarBindPath,calcAlgContext); } return depNode; } CREPRESENTATIVEJOINDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createREPRESENTATIVEJOINDependency(CDependencyTrackPoint*& joinContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* otherDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CREPRESENTATIVEJOINDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createREPRESENTATIVEJOINDependency(joinContinueDepTrackPoint,processIndi,conDes,prevDepTrackPoint,otherDepTrackPoint,calcAlgContext); } return depNode; } CREPRESENTATIVEBINDVARIABLEDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createREPRESENTATIVEBINDVARIABLEDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CREPRESENTATIVEBINDVARIABLEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createREPRESENTATIVEBINDVARIABLEDependency(andDepTrackPoint,processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CREPRESENTATIVEIMPLICATIONDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createREPRESENTATIVEIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext) { CREPRESENTATIVEIMPLICATIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createREPRESENTATIVEIMPLICATIONDependency(implContinueDepTrackPoint,processIndi,conDes,prevDepTrackPoint,prevOtherDependencies,calcAlgContext); } return depNode; } CREPRESENTATIVEALLDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createREPRESENTATIVEALLDependency(CDependencyTrackPoint*& allDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CREPRESENTATIVEALLDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createREPRESENTATIVEALLDependency(allDepTrackPoint,processIndi,conDes,prevDepTrackPoint,linkDepTrackPoint,calcAlgContext); } return depNode; } CREPRESENTATIVEANDDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createREPRESENTATIVEANDDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CREPRESENTATIVEANDDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createREPRESENTATIVEANDDependency(andDepTrackPoint,processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CRESOLVEREPRESENTATIVEDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createRESOLVEREPRESENTATIVEDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CRepresentativeVariableBindingPathMap* resolveVarBindPathMap, CRepresentativePropagationMap* resolveRepPropMap, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* additionalDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CRESOLVEREPRESENTATIVEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createRESOLVEREPRESENTATIVEDependency(andDepTrackPoint,processIndi,conDes,resolveVarBindPathMap,resolveRepPropMap,prevDepTrackPoint,additionalDepTrackPoint,calcAlgContext); } return depNode; } CPROPAGATEVARIABLECONNECTIONDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createPROPAGATEVARIABLECONNECTIONDependency(CIndividualProcessNode* processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CPROPAGATEVARIABLECONNECTIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createPROPAGATEVARIABLECONNECTIONDependency(processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CVARBINDPROPAGATEIMPLICATIONDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createVARBINDPROPAGATEIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext) { CVARBINDPROPAGATEIMPLICATIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createVARBINDPROPAGATEIMPLICATIONDependency(implContinueDepTrackPoint,processIndi,conDes,prevDepTrackPoint,prevOtherDependencies,calcAlgContext); } return depNode; } CVARBINDPROPAGATEGROUNDINGDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createVARBINDPROPAGATEGROUNDINGDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext) { CVARBINDPROPAGATEGROUNDINGDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createVARBINDPROPAGATEGROUNDINGDependency(implContinueDepTrackPoint,processIndi,conDes,prevDepTrackPoint,prevOtherDependencies,calcAlgContext); } return depNode; } CVARBINDPROPAGATEALLDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createVARBINDPROPAGATEALLDependency(CDependencyTrackPoint*& allDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CVARBINDPROPAGATEALLDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createVARBINDPROPAGATEALLDependency(allDepTrackPoint,processIndi,conDes,prevDepTrackPoint,linkDepTrackPoint,calcAlgContext); } return depNode; } CVARBINDPROPAGATEANDDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createVARBINDPROPAGATEANDDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CVARBINDPROPAGATEANDDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createVARBINDPROPAGATEANDDependency(andDepTrackPoint,processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CPROPAGATEVARIABLEBINDINGDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createPROPAGATEVARIABLEBINDINGDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext) { CPROPAGATEVARIABLEBINDINGDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createPROPAGATEVARIABLEBINDINGDependency(andDepTrackPoint,processIndi,conDes,prevDepTrackPoint,prevOtherDependencies,calcAlgContext); } return depNode; } CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createPROPAGATEVARIABLEBINDINGSSUCCESSORDependency(CDependencyTrackPoint*& allDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createPROPAGATEVARIABLEBINDINGSSUCCESSORDependency(allDepTrackPoint,processIndi,conDes,prevDepTrackPoint,linkDepTrackPoint,calcAlgContext); } return depNode; } CVARBINDVARIABLEDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createVARBINDVARIABLEDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CVARBINDVARIABLEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createVARBINDVARIABLEDependency(andDepTrackPoint,processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CVARBINDPROPAGATEJOINDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createVARBINDPROPAGATEJOINDependency(CDependencyTrackPoint*& continueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* otherDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CVARBINDPROPAGATEJOINDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createVARBINDPROPAGATEJOINDependency(continueDepTrackPoint,processIndi,conDes,prevDepTrackPoint,otherDepTrackPoint,calcAlgContext); } return depNode; } CBINDPROPAGATEGROUNDINGDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createBINDPROPAGATEGROUNDINGDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext) { CBINDPROPAGATEGROUNDINGDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createBINDPROPAGATEGROUNDINGDependency(implContinueDepTrackPoint,processIndi,conDes,prevDepTrackPoint,prevOtherDependencies,calcAlgContext); } return depNode; } CPROPAGATECONNECTIONAWAYDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createPROPAGATECONNECTIONAWAYDependency(CIndividualProcessNode* processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CPROPAGATECONNECTIONAWAYDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createPROPAGATECONNECTIONAWAYDependency(processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CPROPAGATECONNECTIONDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createPROPAGATECONNECTIONDependency(CIndividualProcessNode* processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CPROPAGATECONNECTIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createPROPAGATECONNECTIONDependency(processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CBINDPROPAGATECYCLEDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createBINDPROPAGATECYCLEDependency(CDependencyTrackPoint*& continueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* triggDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CBINDPROPAGATECYCLEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createBINDPROPAGATECYCLEDependency(continueDepTrackPoint,processIndi,conDes,prevDepTrackPoint,triggDepTrackPoint,calcAlgContext); } return depNode; } CBINDPROPAGATEALLDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createBINDPROPAGATEALLDependency(CDependencyTrackPoint*& allDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CBINDPROPAGATEALLDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createBINDPROPAGATEALLDependency(allDepTrackPoint,processIndi,conDes,prevDepTrackPoint,linkDepTrackPoint,calcAlgContext); } return depNode; } CPROPAGATEBINDINGSSUCCESSORDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createPROPAGATEBINDINGSSUCCESSORDependency(CDependencyTrackPoint*& allDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CPROPAGATEBINDINGSSUCCESSORDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createPROPAGATEBINDINGSSUCCESSORDependency(allDepTrackPoint,processIndi,conDes,prevDepTrackPoint,linkDepTrackPoint,calcAlgContext); } return depNode; } CBINDPROPAGATEIMPLICATIONDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createBINDPROPAGATEIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext) { CBINDPROPAGATEIMPLICATIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createBINDPROPAGATEIMPLICATIONDependency(implContinueDepTrackPoint,processIndi,conDes,prevDepTrackPoint,prevOtherDependencies,calcAlgContext); } return depNode; } CANDDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createANDDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CANDDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createANDDependency(andDepTrackPoint,processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CBINDPROPAGATEANDDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createBINDPROPAGATEANDDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CBINDPROPAGATEANDDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createBINDPROPAGATEANDDependency(andDepTrackPoint,processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CPROPAGATEBINDINGDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createPROPAGATEBINDINGDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext) { CPROPAGATEBINDINGDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createPROPAGATEBINDINGDependency(andDepTrackPoint,processIndi,conDes,prevDepTrackPoint,prevOtherDependencies,calcAlgContext); } return depNode; } CBINDVARIABLEDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createBINDVARIABLEDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CBINDVARIABLEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createBINDVARIABLEDependency(andDepTrackPoint,processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CNOMINALDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createNOMINALDependency(CDependencyTrackPoint*& nominalContDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CNOMINALDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createNOMINALDependency(nominalContDepTrackPoint,processIndi,conDes,prevDepTrackPoint,nominalDepTrackPoint,calcAlgContext); } return depNode; } CAUTOMATCHOOSEDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createAUTOMATCHOOSEDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CAUTOMATCHOOSEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createAUTOMATCHOOSEDependency(andDepTrackPoint,processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CSOMEDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createSOMEDependency(CDependencyTrackPoint*& someDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CSOMEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createSOMEDependency(someDepTrackPoint,processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CSELFDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createSELFDependency(CDependencyTrackPoint*& someDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CSELFDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createSELFDependency(someDepTrackPoint,processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CVALUEDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createVALUEDependency(CDependencyTrackPoint*& valueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CVALUEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createVALUEDependency(valueDepTrackPoint,processIndi,conDes,prevDepTrackPoint,nominalDepTrackPoint,calcAlgContext); } return depNode; } CROLEASSERTIONDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createROLEASSERTIONDependency(CDependencyTrackPoint*& valueDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CROLEASSERTIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createROLEASSERTIONDependency(valueDepTrackPoint,processIndi,prevDepTrackPoint,nominalDepTrackPoint,calcAlgContext); } return depNode; } CNEGVALUEDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createNEGVALUEDependency(CDependencyTrackPoint*& negValueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CNEGVALUEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createNEGVALUEDependency(negValueDepTrackPoint,processIndi,conDes,prevDepTrackPoint,nominalDepTrackPoint,calcAlgContext); } return depNode; } CALLDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createALLDependency(CDependencyTrackPoint*& allDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CALLDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createALLDependency(allDepTrackPoint,processIndi,conDes,prevDepTrackPoint,linkDepTrackPoint,calcAlgContext); } return depNode; } CMERGEDCONCEPTDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createMERGEDCONCEPTDependency(CDependencyTrackPoint*& mergedConceptContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* mergePrevDepTrackPoint, CDependencyTrackPoint* conceptPrevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CMERGEDCONCEPTDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createMERGEDCONCEPTDependency(mergedConceptContinueDepTrackPoint,processIndi,conDes,mergePrevDepTrackPoint,conceptPrevDepTrackPoint,calcAlgContext); } return depNode; } CMERGEDLINKDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createMERGEDLINKDependency(CDependencyTrackPoint*& mergedLinkContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* mergePrevDepTrackPoint, CDependencyTrackPoint* linkPrevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CMERGEDLINKDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createMERGEDLINKDependency(mergedLinkContinueDepTrackPoint,processIndi,mergePrevDepTrackPoint,linkPrevDepTrackPoint,calcAlgContext); } return depNode; } CMERGEDIndividualDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createMERGEDINDIVIDUALDependency(CDependencyTrackPoint*& mergedIndividualContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* mergePrevDepTrackPoint, CDependencyTrackPoint* individualPrevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CMERGEDIndividualDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createMERGEDINDIVIDUALDependency(mergedIndividualContinueDepTrackPoint,processIndi,mergePrevDepTrackPoint,individualPrevDepTrackPoint,calcAlgContext); } return depNode; } CFUNCTIONALDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createFUNCTIONALDependency(CDependencyTrackPoint*& functionalContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* prevLink1DependencyTrackPoint, CDependencyTrackPoint* prevLink2DependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CFUNCTIONALDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createFUNCTIONALDependency(functionalContinueDepTrackPoint,processIndi,conDes,prevDepTrackPoint,prevLink1DependencyTrackPoint,prevLink2DependencyTrackPoint,calcAlgContext); } return depNode; } CDISTINCTDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createDISTINCTDependency(CDependencyTrackPoint*& distinctDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CDISTINCTDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createDISTINCTDependency(distinctDepTrackPoint,processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CAUTOMATTRANSACTIONDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createAUTOMATTRANSACTIONDependency(CDependencyTrackPoint*& allDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CAUTOMATTRANSACTIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createAUTOMATTRANSACTIONDependency(allDepTrackPoint,processIndi,conDes,prevDepTrackPoint,linkDepTrackPoint,calcAlgContext); } return depNode; } CATLEASTDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createATLEASTDependency(CDependencyTrackPoint*& atleastDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CATLEASTDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createATLEASTDependency(atleastDepTrackPoint,processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CORDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createORDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CORDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createORDependency(processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CATMOSTDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createATMOSTDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CATMOSTDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createATMOSTDependency(processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CMERGEDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createMERGEDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CMERGEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createMERGEDependency(processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CREUSEINDIVIDUALDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createREUSEINDIVIDUALDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CREUSEINDIVIDUALDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createREUSEINDIVIDUALDependency(processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CREUSECOMPLETIONGRAPHDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createREUSECOMPLETIONGRAPHDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CREUSECOMPLETIONGRAPHDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createREUSECOMPLETIONGRAPHDependency(processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CREUSECONCEPTSDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createREUSECONCEPTSDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CREUSECONCEPTSDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createREUSECONCEPTSDependency(processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CQUALIFYDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createQUALIFYDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CQUALIFYDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createQUALIFYDependency(processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } CIMPLICATIONDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext) { CIMPLICATIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createIMPLICATIONDependency(implContinueDepTrackPoint,processIndi,conDes,prevDepTrackPoint,prevOtherDependencies,calcAlgContext); } return depNode; } CEXPANDEDDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createEXPANDEDDependency(CDependencyTrackPoint*& expContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContextBase* calcAlgContext) { CEXPANDEDDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createEXPANDEDDependency(expContinueDepTrackPoint,processIndi,prevDepTrackPoint,prevOtherDependencies,calcAlgContext); } return depNode; } CCONNECTIONDependencyNode* CCalculationTableauCompletionTaskHandleAlgorithm::createCONNECTIONDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CCONNECTIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = calcAlgContext->getUsedDependencyFactory()->createCONNECTIONDependency(processIndi,conDes,prevDepTrackPoint,calcAlgContext); } return depNode; } void CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEGROUNDINGRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CConcept* concept = conDes->getConcept(); bool negated = conDes->isNegated(); cint64 opCount = concept->getOperandCount(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CConceptRepresentativePropagationSetHash* repPropSetHash = processIndi->getConceptRepresentativePropagationSetHash(false); CRepresentativePropagationSet* repPropSet = repPropSetHash->getRepresentativePropagationSet(concept,false); STATINC(VARBINDRULEGROUNDINGAPPLICATIONCOUNT,calcAlgContext); if (repPropSet) { CRepresentativePropagationDescriptor* outRepPropDes = repPropSet->getOutgoingRepresentativePropagationDescriptorLinker(); if (outRepPropDes) { CRepresentativeVariableBindingPathSetData* repVarBindPathSetData = outRepPropDes->getRepresentativeVariableBindingPathSetData(); if (repVarBindPathSetData) { CRepresentativeVariableBindingPathSetMigrateData* repVarBindPathSetMigData = repVarBindPathSetData->getMigrateData(false); if (repVarBindPathSetMigData) { CRepresentativeVariableBindingPathMap* repVarBindPathSetMap = repVarBindPathSetMigData->getRepresentativeVariableBindingPathMap(); KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mBeforeGroundingDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext)); CPROCESSINGHASH* groundedConVarBindPathHash = nullptr; CSortedNegLinker* newGroundedLinker = mGroundingHandler->getGroundingConceptLinker(processIndi,repVarBindPathSetMap,concept,negated,groundedConVarBindPathHash,calcAlgContext); if (newGroundedLinker) { for (CSortedNegLinker* newGroundedLinkerIt = newGroundedLinker; newGroundedLinkerIt; newGroundedLinkerIt = newGroundedLinkerIt->getNext()) { STATINC(VARBINDGROUNDINGCOUNT,calcAlgContext); ++mStatRepresentativeGroundingCount; CConcept* newGroundedCocnept = newGroundedLinkerIt->getData(); bool newGroundedConceptNegation = newGroundedLinkerIt->isNegated(); CVariableBindingPath* selectedVarBindPath = groundedConVarBindPathHash->value(newGroundedCocnept); CDependencyTrackPoint* nextDepTrackPoint = nullptr; CREPRESENTATIVEGROUNDINGDependencyNode* groundingDepNode = createREPRESENTATIVEGROUNDINGDependency(nextDepTrackPoint,processIndi,conDes,outRepPropDes->getDependencyTrackPoint(),selectedVarBindPath,calcAlgContext); addConceptToIndividual(newGroundedCocnept,newGroundedConceptNegation,processIndi,nextDepTrackPoint,true,false,calcAlgContext); } } KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mAfterGroundingDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext)); } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEJOINRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opLinker = concept->getOperandList(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CConceptDescriptor* joinConDes = nullptr; CDependencyTrackPoint* joinDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; CConcept* joinConcept = opLinker->getData(); bool joinConceptNegation = opLinker->isNegated(); CSortedNegLinker* triggerLinker = opLinker->getNext(); CSortedLinker* varLinker = concept->getVariableLinker(); STATINC(VARBINDRULEJOINAPPLICATIONCOUNT,calcAlgContext); bool propagateJoins = false; bool createJoinConcept = false; if (!conSet->getConceptDescriptorAndReapplyQueue(joinConcept,joinConDes,joinDepTrackPoint,reapplyQueue)) { // search next not existing trigger bool allTriggersAvailable = true; conSet = processIndi->getReapplyConceptLabelSet(true); CSortedNegLinker* triggerLinkerIt = nullptr; for (triggerLinkerIt = triggerLinker; triggerLinkerIt && allTriggersAvailable; triggerLinkerIt = triggerLinkerIt->getNext()) { CSortedNegLinker* nextTrigger = triggerLinkerIt; CConcept* triggerConcept = nextTrigger->getData(); CConceptDescriptor* triggerConDes = nullptr; CDependencyTrackPoint* triggerDepTrackPoint = nullptr; if (conSet->getConceptDescriptor(triggerConcept,triggerConDes,triggerDepTrackPoint)) { if (triggerConDes->isNegated() == nextTrigger->isNegated()) { return; } } else { allTriggersAvailable = false; break; } } if (!allTriggersAvailable) { // install to trigger CSortedNegLinker* nextTrigger = triggerLinkerIt; CConcept* triggerConcept = nextTrigger->getData(); bool triggerNegation = !nextTrigger->isNegated(); if (!isConceptInReapplyQueue(conDes,triggerConcept,triggerNegation,processIndi,calcAlgContext)) { addConceptToReapplyQueue(conDes,triggerConcept,triggerNegation,processIndi,(CProcessingRestrictionSpecification*)nullptr,depTrackPoint,calcAlgContext); } } else { propagateJoins = true; createJoinConcept = true; } } else { propagateJoins = true; } //mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); bool propagationsDone = false; if (propagateJoins) { for (CSortedNegLinker* triggerLinkerIt = triggerLinker; triggerLinkerIt; triggerLinkerIt = triggerLinkerIt->getNext()) { CSortedNegLinker* nextTrigger = triggerLinkerIt; CConcept* triggerConcept = nextTrigger->getData(); if (!isConceptInReapplyQueue(conDes,triggerConcept,false,processIndi,calcAlgContext)) { addConceptToReapplyQueue(conDes,triggerConcept,false,processIndi,(CProcessingRestrictionSpecification*)nullptr,depTrackPoint,calcAlgContext); } } CConceptPropagationBindingSetHash* conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(false); CConceptRepresentativePropagationSetHash* repPropSetHash = processIndi->getConceptRepresentativePropagationSetHash(false); CPropagationBindingSet* propBindingSet = nullptr; if (conPropBindingSetHash && repPropSetHash) { propBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,false); if (propBindingSet) { CPropagationRepresentativeTransitionExtension* propRepTransExt = propBindingSet->getPropagationRepresentativeTransitionExtension(false); CSortedNegLinker* leftTriggerLinker = triggerLinker; CSortedNegLinker* rightTriggerLinker = triggerLinker->getNext(); CConcept* leftConcept = leftTriggerLinker->getData(); CConcept* rightConcept = rightTriggerLinker->getData(); CRepresentativePropagationSet* leftRepPropSet = repPropSetHash->getRepresentativePropagationSet(leftConcept,false); CRepresentativePropagationSet* rightRepPropSet = repPropSetHash->getRepresentativePropagationSet(rightConcept,false); bool examineTransExt = false; CRepresentativePropagationDescriptor* leftRepPropDes = leftRepPropSet->getOutgoingRepresentativePropagationDescriptorLinker(); CRepresentativePropagationDescriptor* rightRepPropDes = rightRepPropSet->getOutgoingRepresentativePropagationDescriptorLinker(); if (leftRepPropSet && rightRepPropSet && leftRepPropDes && rightRepPropDes) { if (!propRepTransExt) { examineTransExt = true; } else { if (propRepTransExt->getLastAnalysedPropagateAllFlag() != propBindingSet->getPropagateAllFlag() || propRepTransExt->getLastAnalysedPropagationBindingDescriptor() != propBindingSet->getPropagationBindingDescriptorLinker() || propRepTransExt->getLeftLastRepresentativeJoiningDescriptor() != leftRepPropDes || propRepTransExt->getRightLastRepresentativeJoiningDescriptor() != rightRepPropDes) { examineTransExt = true; } } } if (examineTransExt) { ++mStatRepresentativeJoinCount; conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(true); repPropSetHash = processIndi->getConceptRepresentativePropagationSetHash(true); propBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,true); propRepTransExt = propBindingSet->getPropagationRepresentativeTransitionExtension(true); CRepresentativePropagationSet* joinRepPropSet = repPropSetHash->getRepresentativePropagationSet(joinConcept,true); CPropagationBindingDescriptor* lastAnalyPropBindDes = propRepTransExt->getLastAnalysedPropagationBindingDescriptor(); CPropagationBindingDescriptor* propBindDes = propBindingSet->getPropagationBindingDescriptorLinker(); bool propAllFlag = propBindingSet->hasPropagateAllFlag(); CRepresentativeVariableBindingPathSetData* leftRepData = leftRepPropDes->getRepresentativeVariableBindingPathSetData(); CRepresentativeVariableBindingPathSetData* rightRepData = rightRepPropDes->getRepresentativeVariableBindingPathSetData(); if (areRepresentativesJoinable(processIndi,leftRepData,rightRepData,varLinker,calcAlgContext)) { CRepresentativeJoiningData* joinData = nullptr; CRepresentativeJoiningData* locJoinData = nullptr; CRepresentativeJoiningHash* repJoiningHash = procDataBox->getRepresentativeJoiningHash(false); if (repJoiningHash) { joinData = repJoiningHash->getRepresentativeJoiningData(leftRepData,rightRepData,false); } if (!joinData) { CRepresentativeVariableBindingPathSetHash* repVarBindPathSetHash = nullptr; if (!leftRepData->hasJoiningData(concept)) { if (!repVarBindPathSetHash) { repVarBindPathSetHash = procDataBox->getRepresentativeVariableBindingPathSetHash(true); } leftRepData = repVarBindPathSetHash->getRepresentativeVariableBindingPathSetData(leftRepData,true); } if (!rightRepData->hasJoiningData(concept)) { if (!repVarBindPathSetHash) { repVarBindPathSetHash = procDataBox->getRepresentativeVariableBindingPathSetHash(true); } rightRepData = repVarBindPathSetHash->getRepresentativeVariableBindingPathSetData(rightRepData,true); } if (!locJoinData) { repJoiningHash = procDataBox->getRepresentativeJoiningHash(true); locJoinData = repJoiningHash->getRepresentativeJoiningData(leftRepData,rightRepData,true); joinData = locJoinData; } CRepresentativeVariableBindingPathSetJoiningKeyMap* leftJoiningKeyMap = getRepresentativeJoiningKeyData(leftRepData,concept,calcAlgContext); CRepresentativeVariableBindingPathSetJoiningKeyMap* rightJoiningKeyMap = getRepresentativeJoiningKeyData(rightRepData,concept,calcAlgContext); CRepresentativeJoiningCommonKeyMap* repJoinCommonKeyMap = joinData->getRepresentativeJoiningCommonKeyMap(); createCommonJoiningKeyMap(repJoinCommonKeyMap,leftJoiningKeyMap,leftRepData,rightJoiningKeyMap,rightRepData,true,calcAlgContext); } CRepresentativeJoiningCommonKeyMap* repJoinCommonKeyMap = joinData->getRepresentativeJoiningCommonKeyMap(); if (!repJoinCommonKeyMap->isEmpty()) { ++mStatRepresentativeJoinedCount; if (propAllFlag) { CRepresentativeJoiningAllDataExtension* joinAllExtData = joinData->getJoiningAllExtension(false); if (!joinAllExtData) { if (!locJoinData) { repJoiningHash = procDataBox->getRepresentativeJoiningHash(true); locJoinData = repJoiningHash->getRepresentativeJoiningData(leftRepData,rightRepData,true); joinData = locJoinData; } joinAllExtData = joinData->getJoiningAllExtension(true); createCommonJoiningAll(joinData->getRepresentativeJoiningCommonKeyMap(),joinAllExtData,leftRepData,rightRepData,calcAlgContext); } CRepresentativeVariableBindingPathSetData* joinedRepData = joinAllExtData->getRepresentativeVariableBindingPathSetData(); CRepresentativePropagationMap* leftRepPropMap = propRepTransExt->getLeftRepresentativePropagationMap(); CRepresentativePropagationMap* rightRepPropMap = propRepTransExt->getRightRepresentativePropagationMap(); if (!leftRepPropMap->contains(leftRepData->getRepresentativeID())) { CDependencyTrackPoint* nextDepTrackPoint = nullptr; CREPRESENTATIVEANDDependencyNode* repPropDepNode = createREPRESENTATIVEANDDependency(nextDepTrackPoint,processIndi,conDes,leftRepPropDes->getDependencyTrackPoint(),calcAlgContext); CRepresentativePropagationDescriptor* propagateRepDes = CObjectAllocator::allocateAndConstruct(taskMemMan); propagateRepDes->initRepresentativeDescriptor(leftRepData,nextDepTrackPoint); leftRepPropMap->insert(leftRepData->getRepresentativeID(),CRepresentativePropagationMapData(propagateRepDes)); } if (!rightRepPropMap->contains(rightRepData->getRepresentativeID())) { CDependencyTrackPoint* nextDepTrackPoint = nullptr; CREPRESENTATIVEANDDependencyNode* repPropDepNode = createREPRESENTATIVEANDDependency(nextDepTrackPoint,processIndi,conDes,rightRepPropDes->getDependencyTrackPoint(),calcAlgContext); CRepresentativePropagationDescriptor* propagateRepDes = CObjectAllocator::allocateAndConstruct(taskMemMan); propagateRepDes->initRepresentativeDescriptor(rightRepData,nextDepTrackPoint); rightRepPropMap->insert(rightRepData->getRepresentativeID(),CRepresentativePropagationMapData(propagateRepDes)); } CDependencyTrackPoint* leftNextResolveDepTrackPoint = nullptr; CRESOLVEREPRESENTATIVEDependencyNode* leftResolveRepNode = createRESOLVEREPRESENTATIVEDependency(leftNextResolveDepTrackPoint,processIndi,nullptr,joinAllExtData->getLeftResolveVariableBindingPathMap(false),leftRepPropMap,leftRepPropDes->getDependencyTrackPoint(),nullptr,calcAlgContext); CDependencyTrackPoint* rightNextResolveDepTrackPoint = nullptr; CRESOLVEREPRESENTATIVEDependencyNode* rightResolveRepNode = createRESOLVEREPRESENTATIVEDependency(rightNextResolveDepTrackPoint,processIndi,nullptr,joinAllExtData->getRightResolveVariableBindingPathMap(false),rightRepPropMap,rightRepPropDes->getDependencyTrackPoint(),nullptr,calcAlgContext); CDependencyTrackPoint* joinNextDepTrackPoint = nullptr; CREPRESENTATIVEJOINDependencyNode* joinResolveRepNode = createREPRESENTATIVEJOINDependency(joinNextDepTrackPoint,processIndi,conDes,leftNextResolveDepTrackPoint,rightNextResolveDepTrackPoint,calcAlgContext); CRepresentativePropagationDescriptor* propagateRepDes = CObjectAllocator::allocateAndConstruct(taskMemMan); propagateRepDes->initRepresentativeDescriptor(joinedRepData,joinNextDepTrackPoint); joinRepPropSet->addIncomingRepresentativePropagation(propagateRepDes); updateRepresentativePropagationSet(processIndi,joinRepPropSet,calcAlgContext); if (!joinConDes) { joinDepTrackPoint = joinNextDepTrackPoint; joinConDes = addConceptToIndividualReturnConceptDescriptor(joinConcept,false,processIndi,joinNextDepTrackPoint,false,false,calcAlgContext); } } else { // ToDo! } propagationsDone = true; } } propRepTransExt->setLeftLastRepresentativeJoiningDescriptor(leftRepPropDes); propRepTransExt->setRightLastRepresentativeJoiningDescriptor(rightRepPropDes); propRepTransExt->setLastAnalysedPropagationBindingDescriptor(propBindDes); propRepTransExt->setLastAnalysedPropagateAllFlag(propBindingSet->hasPropagateAllFlag()); } } } } if (propagationsDone) { if (!createJoinConcept) { reapplyConceptUpdatedRepresentative(processIndi,joinConDes,joinDepTrackPoint,conSet,reapplyQueue,calcAlgContext); } } } bool CCalculationTableauCompletionTaskHandleAlgorithm::hasCommonVariableBindings(CIndividualProcessNode*& processIndi, CRepresentativeVariableBindingPathMap* leftRepVarBindMap, CRepresentativeVariableBindingPathMap* rightRepVarBindMap, CCalculationAlgorithmContextBase* calcAlgContext) { if (rightRepVarBindMap->count() < leftRepVarBindMap->count()) { return hasCommonVariableBindings(processIndi,rightRepVarBindMap,leftRepVarBindMap,calcAlgContext); } if (leftRepVarBindMap->count()*mMapComparisonDirectLookupFactor < rightRepVarBindMap->count()) { for (CRepresentativeVariableBindingPathMap::const_iterator it1 = leftRepVarBindMap->constBegin(), it1End = leftRepVarBindMap->constEnd(); it1 != it1End; ++it1) { if (rightRepVarBindMap->contains(it1.key())) { return true; } } return false; } else { CRepresentativeVariableBindingPathMap::const_iterator it1 = leftRepVarBindMap->constBegin(), it1End = leftRepVarBindMap->constEnd(); CRepresentativeVariableBindingPathMap::const_iterator it2 = rightRepVarBindMap->constBegin(), it2End = rightRepVarBindMap->constEnd(); while (it1 != it1End && it2 != it2End) { cint64 key1 = it1.key(); cint64 key2 = it2.key(); if (key1 == key2) { return true; } if (key1 < key2) { ++it1; } else if (key2 < key1) { ++it2; } } return false; } } bool CCalculationTableauCompletionTaskHandleAlgorithm::areRepresentativesJoinable(CIndividualProcessNode*& processIndi, CRepresentativeVariableBindingPathSetData* leftRepData, CRepresentativeVariableBindingPathSetData* rightRepData, CSortedLinker* varLinker, CCalculationAlgorithmContextBase* calcAlgContext) { CRepresentativeVariableBindingPathSetMigrateData* leftRepMigData = leftRepData->getMigrateData(); CRepresentativeVariableBindingPathSetMigrateData* rightRepMigData = rightRepData->getMigrateData(); if (varLinker && leftRepMigData && rightRepMigData) { CRepresentativeVariableBindingPathMap* leftRepVarBindMap = leftRepMigData->getRepresentativeVariableBindingPathMap(); CRepresentativeVariableBindingPathMap* rightRepVarBindMap = rightRepMigData->getRepresentativeVariableBindingPathMap(); const CRepresentativeVariableBindingPathMapData& leftRepVarBindData = leftRepVarBindMap->constBegin().value(); const CRepresentativeVariableBindingPathMapData& rightRepVarBindData = rightRepVarBindMap->constBegin().value(); CVariableBindingPath* leftVarBindPath = leftRepVarBindData.getVariableBindingPath(); CVariableBindingPath* rightVarBindPath = rightRepVarBindData.getVariableBindingPath(); if (leftVarBindPath->getVariableBindingCount() == 1 && rightVarBindPath->getVariableBindingCount() == 1) { if (!hasCommonVariableBindings(processIndi,leftRepVarBindMap,rightRepVarBindMap,calcAlgContext)) { ++mStatRepresentativeJoinQuickFailCount; return false; } } } return true; } void CCalculationTableauCompletionTaskHandleAlgorithm::createCommonJoiningAll(CRepresentativeJoiningCommonKeyMap* repJoinCommonKeyMap, CRepresentativeJoiningAllDataExtension* joinAllExtData, CRepresentativeVariableBindingPathSetData* leftRepData, CRepresentativeVariableBindingPathSetData* rightRepData, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CProcessContext* processContext = calcAlgContext->getUsedProcessContext(); CRepresentativeVariableBindingPathSetData* repData = CObjectParameterizingAllocator< CRepresentativeVariableBindingPathSetData,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,processContext); repData->initRepresentativeVariableBindingPathData(nullptr); repData->setRepresentativeID(procDataBox->getNextRepresentativeVariableBindingPathID(true)); repData->setMigratable(false); repData->incUseCount(); repData->incShareCount(); CRepresentativeVariableBindingPathSetMigrateData* repMigData = repData->getMigrateData(true); CRepresentativeVariableBindingPathMap* varBindPathResolveMap = repMigData->getRepresentativeVariableBindingPathMap(); CRepresentativeVariableBindingPathMap* leftRepVarBindPathResolveMap = joinAllExtData->getLeftResolveVariableBindingPathMap(true); CRepresentativeVariableBindingPathMap* rightRepVarBindPathResolveMap = joinAllExtData->getRightResolveVariableBindingPathMap(true); for (CRepresentativeJoiningCommonKeyMap::const_iterator it = repJoinCommonKeyMap->constBegin(), itEnd = repJoinCommonKeyMap->constEnd(); it != itEnd; ++it) { cint64 joiningKey = it.key(); const CRepresentativeJoiningCommonKeyData& commonKeyData = it.value(); CRepresentativeVariableBindingPathSetJoiningKeyDataMap* leftKeyDataMap = commonKeyData.getLeftJoiningDataMap(); CRepresentativeVariableBindingPathSetJoiningKeyDataMap* rightKeyDataMap = commonKeyData.getRightJoiningDataMap(); for (CRepresentativeVariableBindingPathSetJoiningKeyDataMap::const_iterator it1 = leftKeyDataMap->constBegin(), it1End = leftKeyDataMap->constEnd(); it1 != it1End; ++it1) { for (CRepresentativeVariableBindingPathSetJoiningKeyDataMap::const_iterator it2 = rightKeyDataMap->constBegin(), it2End = rightKeyDataMap->constEnd(); it2 != it2End; ++it2) { CVariableBindingPath* varBindPath1 = it1.value(); CVariableBindingPath* varBindPath2 = it2.value(); CVariableBindingPath* mergedVarBindPath = getJoinedVariableBindingPath(varBindPath1,varBindPath2,calcAlgContext); leftRepVarBindPathResolveMap->insert(mergedVarBindPath->getPropagationID(),CRepresentativeVariableBindingPathMapData(mergedVarBindPath,varBindPath1,leftRepData)); rightRepVarBindPathResolveMap->insert(mergedVarBindPath->getPropagationID(),CRepresentativeVariableBindingPathMapData(mergedVarBindPath,varBindPath2,rightRepData)); varBindPathResolveMap->insert(mergedVarBindPath->getPropagationID(),CRepresentativeVariableBindingPathMapData(mergedVarBindPath,repData)); } } } ++mStatRepresentativeJoinCombinesCount; repMigData->getRepresentativeContainingMap()->insertContainedRepresentative(repData,false); repData->addKeySignatureValue(repData->getRepresentativeID()); CRepresentativeVariableBindingPathSetHash* repVarBindPathSetHash = procDataBox->getRepresentativeVariableBindingPathSetHash(true); repVarBindPathSetHash->insertRepresentativeVariableBindingPathSetData(repData); joinAllExtData->setRepresentativeVariableBindingPathSetData(repData); } void CCalculationTableauCompletionTaskHandleAlgorithm::createCommonJoiningKeyMap(CRepresentativeJoiningCommonKeyMap* repJoinCommonKeyMap, CRepresentativeVariableBindingPathSetJoiningKeyMap* firstJoiningKeyMap, CRepresentativeVariableBindingPathSetData* firstRepData, CRepresentativeVariableBindingPathSetJoiningKeyMap* secJoiningKeyMap, CRepresentativeVariableBindingPathSetData* secRepData, bool firstLeft, CCalculationAlgorithmContextBase* calcAlgContext) { if (secJoiningKeyMap->count() < firstJoiningKeyMap->count()) { createCommonJoiningKeyMap(repJoinCommonKeyMap,secJoiningKeyMap,secRepData,firstJoiningKeyMap,firstRepData,!firstLeft,calcAlgContext); } if (firstJoiningKeyMap->count()*mMapComparisonDirectLookupFactor < secJoiningKeyMap->count()) { for (CRepresentativeVariableBindingPathSetJoiningKeyMap::const_iterator it = firstJoiningKeyMap->constBegin(), itEnd = firstJoiningKeyMap->constEnd(); it != itEnd; ++it) { cint64 joiningKey = it.key(); CRepresentativeVariableBindingPathSetJoiningKeyDataMap* firstJoiningDataMap = it.value().getRepresentativeVariableBindingPathSetJoiningKeyDataMap(); CRepresentativeVariableBindingPathSetJoiningKeyDataMap* secJoiningDataMap = secJoiningKeyMap->value(joiningKey).getRepresentativeVariableBindingPathSetJoiningKeyDataMap(); if (secJoiningDataMap) { CRepresentativeVariableBindingPathSetJoiningKeyDataMap* leftJoiningDataMap = firstJoiningDataMap; CRepresentativeVariableBindingPathSetJoiningKeyDataMap* rightJoiningDataMap = secJoiningDataMap; if (!firstLeft) { leftJoiningDataMap = secJoiningDataMap; rightJoiningDataMap = firstJoiningDataMap; } repJoinCommonKeyMap->insert(joiningKey,CRepresentativeJoiningCommonKeyData(leftJoiningDataMap,rightJoiningDataMap)); } } } else { CRepresentativeVariableBindingPathSetJoiningKeyMap::const_iterator it1 = firstJoiningKeyMap->constBegin(), it1End = firstJoiningKeyMap->constEnd(); CRepresentativeVariableBindingPathSetJoiningKeyMap::const_iterator it2 = secJoiningKeyMap->constBegin(), it2End = secJoiningKeyMap->constEnd(); while (it1 != it1End && it2 != it2End) { cint64 joiningKey1 = it1.key(); cint64 joiningKey2 = it2.key(); if (joiningKey1 == joiningKey2) { CRepresentativeVariableBindingPathSetJoiningKeyDataMap* firstJoiningDataMap = it1.value().getRepresentativeVariableBindingPathSetJoiningKeyDataMap(); CRepresentativeVariableBindingPathSetJoiningKeyDataMap* secJoiningDataMap = it2.value().getRepresentativeVariableBindingPathSetJoiningKeyDataMap(); if (firstJoiningDataMap && secJoiningDataMap) { CRepresentativeVariableBindingPathSetJoiningKeyDataMap* leftJoiningDataMap = firstJoiningDataMap; CRepresentativeVariableBindingPathSetJoiningKeyDataMap* rightJoiningDataMap = secJoiningDataMap; if (!firstLeft) { leftJoiningDataMap = secJoiningDataMap; rightJoiningDataMap = firstJoiningDataMap; } repJoinCommonKeyMap->insert(joiningKey1,CRepresentativeJoiningCommonKeyData(leftJoiningDataMap,rightJoiningDataMap)); } ++it1; ++it2; } else if (joiningKey1 < joiningKey2) { ++it1; } else if (joiningKey2 < joiningKey1) { ++it2; } } } } CRepresentativeVariableBindingPathSetJoiningKeyMap* CCalculationTableauCompletionTaskHandleAlgorithm::getRepresentativeJoiningKeyData(CRepresentativeVariableBindingPathSetData* repVarBindPathSetData, CConcept* joinConcept, CCalculationAlgorithmContextBase* calcAlgContext) { CProcessContext* processContext = calcAlgContext->getUsedProcessContext(); CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CSortedLinker* keyVarLinker = joinConcept->getVariableLinker(); CRepresentativeVariableBindingPathSetJoiningData* joiningData = nullptr; CRepresentativeVariableBindingPathSetJoiningHash* joiningHash = repVarBindPathSetData->getJoiningHash(false); if (joiningHash) { joiningData = joiningHash->getRepresentativeVariableBindingPathSetJoiningData(joinConcept,false); } if (!joiningData) { joiningHash = repVarBindPathSetData->getJoiningHash(true); joiningData = joiningHash->getRepresentativeVariableBindingPathSetJoiningData(joinConcept,true); CRepresentativeVariableBindingPathJoiningKeyHash* varBindPathJoiningKeyHash = procDataBox->getRepresentativeVariableBindingPathJoiningKeyHash(true); CRepresentativeVariableBindingPathSetJoiningKeyMap* joiningKeyMap = joiningData->getJoiningKeyMap(); CRepresentativeVariableBindingPathMap* varBindPathMap = repVarBindPathSetData->getMigrateData(false)->getRepresentativeVariableBindingPathMap(); for (CRepresentativeVariableBindingPathMap::const_iterator it = varBindPathMap->constBegin(), itEnd = varBindPathMap->constEnd(); it != itEnd; ++it) { CVariableBindingPath* varBindPath = it.value().getVariableBindingPath(); cint64 joinKey = varBindPathJoiningKeyHash->getRepresentativeVariableBindingPathJoiningKey(varBindPath,keyVarLinker,true); CRepresentativeVariableBindingPathSetJoiningKeyDataMap* joiningKeyDataMap = joiningKeyMap->getJoiningKeyDataMap(joinKey,true); joiningKeyDataMap->insert(varBindPath->getPropagationID(),varBindPath); } } return joiningData->getJoiningKeyMap(); } void CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEBINDVARIABLERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CVariable* variable = concept->getVariable(); bool conceptNegation = negate; CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CSortedNegLinker* opConLinker = concept->getOperandList(); CConcept* bindingTriggerConcept = opConLinker->getData(); bool bindingTriggerConceptNegation = opConLinker->isNegated(); CProcessContext* processContext = calcAlgContext->getUsedProcessContext(); CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CConceptDescriptor* bindingConDes = nullptr; CDependencyTrackPoint* bindingDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; STATINC(VARBINDRULEBINDAPPLICATIONCOUNT,calcAlgContext); bool updateExt = false; CConceptPropagationBindingSetHash* conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(false); if (conPropBindingSetHash) { CPropagationBindingSet* propBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,false); if (propBindingSet) { CPropagationVariableBindingTransitionExtension* propVarBindTransExt = propBindingSet->getPropagationVariableBindingTransitionExtension(false); if (!propVarBindTransExt || !propVarBindTransExt->isProcessingCompleted()) { if (!propVarBindTransExt || propBindingSet->hasPropagateAllFlag()) { updateExt = true; } else { CPropagationBindingDescriptor* lastAnalyPropBindDes = propVarBindTransExt->getLastAnalysedPropagationBindingDescriptor(); CPropagationBindingDescriptor* propBindDes = propBindingSet->getPropagationBindingDescriptorLinker(); if (lastAnalyPropBindDes != propBindDes) { updateExt = true; } } } } } if (updateExt) { CConceptPropagationBindingSetHash* conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(true); CPropagationBindingSet* propBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,true); CPropagationVariableBindingTransitionExtension* propVarBindTransExt = propBindingSet->getPropagationVariableBindingTransitionExtension(true); CPropagationBindingDescriptor* lastAnalyPropBindDes = propVarBindTransExt->getLastAnalysedPropagationBindingDescriptor(); CPropagationBindingDescriptor* propBindDes = propBindingSet->getPropagationBindingDescriptorLinker(); propVarBindTransExt->setTriggeredVariableIndividualPair(variable,processIndi); bool createVarBinding = false; createVarBinding = propBindingSet->hasPropagateAllFlag(); for (CPropagationBindingDescriptor* propBindDesIt = propBindDes; propBindDesIt != lastAnalyPropBindDes; propBindDesIt = propBindDesIt->getNext()) { if (propVarBindTransExt->addAnalysedPropagationBindingDescriptorReturnMatched(propBindDesIt)) { createVarBinding = true; } } propVarBindTransExt->setLastAnalysedPropagationBindingDescriptor(propBindDes); propVarBindTransExt->setLastAnalysedPropagateAllFlag(propBindingSet->hasPropagateAllFlag()); if (createVarBinding) { ++mStatRepresentativeCreatedCount; STATINC(VARBINDVARIABLEBINDCOUNT,calcAlgContext); propVarBindTransExt->setProcessingCompleted(true); CConceptRepresentativePropagationSetHash* conRepPropSetHash = processIndi->getConceptRepresentativePropagationSetHash(true); CRepresentativePropagationSet* repPropSet = conRepPropSetHash->getRepresentativePropagationSet(bindingTriggerConcept,true); CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); cint64 nextPathPropID = processingDataBox->getNextVariableBindingPathID(true); CDependencyTrackPoint* nextDepTrackPoint = nullptr; CREPRESENTATIVEBINDVARIABLEDependencyNode* bindDepNode = createREPRESENTATIVEBINDVARIABLEDependency(nextDepTrackPoint,processIndi,conDes,processIndi->getDependencyTrackPoint(),calcAlgContext); if (!conSet->getConceptDescriptorAndReapplyQueue(bindingTriggerConcept,bindingConDes,bindingDepTrackPoint,reapplyQueue)) { bindingConDes = addConceptToIndividualReturnConceptDescriptor(bindingTriggerConcept,bindingTriggerConceptNegation,processIndi,nextDepTrackPoint,false,false,calcAlgContext); } else { reapplyConceptUpdatedRepresentative(processIndi,bindingConDes,bindingDepTrackPoint,conSet,reapplyQueue,calcAlgContext); } repPropSet->setConceptDescriptor(bindingConDes); CVariableBinding* varBinding = CObjectAllocator::allocateAndConstruct(taskMemMan); varBinding->initVariableBinding(nextDepTrackPoint,processIndi,variable); CVariableBindingDescriptor* varBindingDes = CObjectAllocator::allocateAndConstruct(taskMemMan); varBindingDes->initVariableBindingDescriptor(varBinding); CVariableBindingPath* varBindingPath = CObjectAllocator::allocateAndConstruct(taskMemMan); varBindingPath->initVariableBindingPath(nextPathPropID,varBindingDes); CRepresentativeVariableBindingPathHash* repVarBindPathHash = procDataBox->getRepresentativeVariableBindingPathHash(true); CRepresentativeVariableBindingPathSetData* repData = repVarBindPathHash->getRepresentativeVariableBindingPathSetData(varBindingPath,true); repData->setRepresentativeID(procDataBox->getNextRepresentativeVariableBindingPathID(true)); repData->setMigratable(false); repData->incUseCount(); repData->incShareCount(); CRepresentativeVariableBindingPathSetMigrateData* repMigData = repData->getMigrateData(true); repMigData->getRepresentativeVariableBindingPathMap()->insert(varBindingPath->getPropagationID(),CRepresentativeVariableBindingPathMapData(varBindingPath,repData)); repMigData->getRepresentativeContainingMap()->insertContainedRepresentative(repData,false); repData->addKeySignatureValue(repData->getRepresentativeID()); CRepresentativeVariableBindingPathSetHash* repVarBindPathSetHash = procDataBox->getRepresentativeVariableBindingPathSetHash(true); repVarBindPathSetHash->insertRepresentativeVariableBindingPathSetData(repData); CRepresentativePropagationDescriptor* repPropDes = CObjectAllocator::allocateAndConstruct(taskMemMan); repPropDes->initRepresentativeDescriptor(repData,nextDepTrackPoint); repPropSet->addIncomingRepresentativePropagationDescriptorLinker(repPropDes); updateRepresentativePropagationSet(processIndi,repPropSet,calcAlgContext); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEIMPLICATIONRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opLinker = concept->getOperandList(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CConceptDescriptor* bindingConDes = nullptr; CDependencyTrackPoint* bindingDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; CConcept* bindingTriggerConcept = opLinker->getData(); bool bindingTriggerConceptNegation = opLinker->isNegated(); CSortedNegLinker* triggerLinker = opLinker->getNext(); STATINC(VARBINDRULEIMPLICATIONAPPLICATIONCOUNT,calcAlgContext); if (!conSet->getConceptDescriptorAndReapplyQueue(bindingTriggerConcept,bindingConDes,bindingDepTrackPoint,reapplyQueue)) { // search next not existing trigger bool allTriggersAvailable = true; conSet = processIndi->getReapplyConceptLabelSet(true); CSortedNegLinker* triggerLinkerIt = nullptr; for (triggerLinkerIt = triggerLinker; triggerLinkerIt; triggerLinkerIt = triggerLinkerIt->getNext()) { CSortedNegLinker* nextTrigger = triggerLinkerIt; CConcept* triggerConcept = nextTrigger->getData(); CConceptDescriptor* triggerConDes = nullptr; CDependencyTrackPoint* triggerDepTrackPoint = nullptr; if (conSet->getConceptDescriptor(triggerConcept,triggerConDes,triggerDepTrackPoint)) { if (triggerConDes->isNegated() == nextTrigger->isNegated()) { return; } } else { allTriggersAvailable = false; break; } } if (!allTriggersAvailable) { // install to trigger CSortedNegLinker* nextTrigger = triggerLinkerIt; CConcept* triggerConcept = nextTrigger->getData(); bool triggerNegation = !nextTrigger->isNegated(); if (!isConceptInReapplyQueue(conDes,triggerConcept,triggerNegation,processIndi,calcAlgContext)) { addConceptToReapplyQueue(conDes,triggerConcept,triggerNegation,processIndi,(CProcessingRestrictionSpecification*)nullptr,depTrackPoint,calcAlgContext); } } else { CDependency* triggerDeps = nullptr; for (CSortedNegLinker* triggerLinkerIt = triggerLinker; triggerLinkerIt; triggerLinkerIt = triggerLinkerIt->getNext()) { CConcept* triggerConcept = triggerLinkerIt->getData(); CConceptDescriptor* triggerConDes = nullptr; CDependencyTrackPoint* triggerDepTrackPoint = nullptr; conSet->getConceptDescriptor(triggerConcept,triggerConDes,triggerDepTrackPoint); CCONNECTIONDependencyNode* connDep = createCONNECTIONDependency(processIndi,triggerConDes,triggerDepTrackPoint,calcAlgContext); connDep->setNext(triggerDeps); triggerDeps = connDep; } ++mStatRepresentativeImplicationCount; CConceptRepresentativePropagationSetHash* conRepPropSetHash = processIndi->getConceptRepresentativePropagationSetHash(true); CRepresentativePropagationSet* prevRepPropSet = conRepPropSetHash->getRepresentativePropagationSet(concept,false); CRepresentativePropagationSet* repPropSet = conRepPropSetHash->getRepresentativePropagationSet(bindingTriggerConcept,true); CRepresentativePropagationDescriptor* procRepPropDes = nullptr; CDependencyTrackPoint* propDepTrackPoint = nullptr; if (prevRepPropSet) { procRepPropDes = prevRepPropSet->getOutgoingRepresentativePropagationDescriptorLinker(); } if (procRepPropDes) { propDepTrackPoint = procRepPropDes->getDependencyTrackPoint(); repPropSet->setConceptDescriptor(bindingConDes); CDependencyTrackPoint* nextDepTrackPoint = nullptr; CREPRESENTATIVEIMPLICATIONDependencyNode* implDepNode = createREPRESENTATIVEIMPLICATIONDependency(nextDepTrackPoint,processIndi,conDes,propDepTrackPoint,triggerDeps,calcAlgContext); bindingConDes = addConceptToIndividualReturnConceptDescriptor(bindingTriggerConcept,bindingTriggerConceptNegation,processIndi,nextDepTrackPoint,true,false,calcAlgContext); propagateRepresentative(processIndi,procRepPropDes,repPropSet,nextDepTrackPoint,calcAlgContext); } } } else { CConceptRepresentativePropagationSetHash* conRepPropSetHash = processIndi->getConceptRepresentativePropagationSetHash(true); CRepresentativePropagationSet* prevRepPropSet = conRepPropSetHash->getRepresentativePropagationSet(concept,false); CRepresentativePropagationSet* repPropSet = conRepPropSetHash->getRepresentativePropagationSet(bindingTriggerConcept,true); CRepresentativePropagationDescriptor* procRepPropDes = nullptr; CDependencyTrackPoint* propDepTrackPoint = nullptr; if (prevRepPropSet) { procRepPropDes = prevRepPropSet->getOutgoingRepresentativePropagationDescriptorLinker(); } if (procRepPropDes) { propDepTrackPoint = procRepPropDes->getDependencyTrackPoint(); if (requiresRepresentativePropagation(processIndi,procRepPropDes,repPropSet,calcAlgContext)) { CDependency* triggerDeps = nullptr; for (CSortedNegLinker* triggerLinkerIt = triggerLinker; triggerLinkerIt; triggerLinkerIt = triggerLinkerIt->getNext()) { CConcept* triggerConcept = triggerLinkerIt->getData(); CConceptDescriptor* triggerConDes = nullptr; CDependencyTrackPoint* triggerDepTrackPoint = nullptr; conSet->getConceptDescriptor(triggerConcept,triggerConDes,triggerDepTrackPoint); CCONNECTIONDependencyNode* connDep = createCONNECTIONDependency(processIndi,triggerConDes,triggerDepTrackPoint,calcAlgContext); connDep->setNext(triggerDeps); triggerDeps = connDep; } ++mStatRepresentativeImplicationCount; CDependencyTrackPoint* nextDepTrackPoint = nullptr; CREPRESENTATIVEIMPLICATIONDependencyNode* implDepNode = createREPRESENTATIVEIMPLICATIONDependency(nextDepTrackPoint,processIndi,conDes,propDepTrackPoint,triggerDeps,calcAlgContext); propagateRepresentative(processIndi,procRepPropDes,repPropSet,nextDepTrackPoint,calcAlgContext); reapplyConceptUpdatedRepresentative(processIndi,bindingConDes,bindingDepTrackPoint,conSet,reapplyQueue,calcAlgContext); } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateRepresentativeToSuccessor(CIndividualProcessNode* processIndi, CIndividualProcessNode*& succIndi, CSortedNegLinker* conceptOpLinker, bool negate, CConceptDescriptor* conDes, CIndividualLinkEdge* restLink, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CDependencyTrackPoint* depTrackPoint = conDes->getDependencyTrackPoint(); CConcept* concept = conDes->getConcept(); succIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); CReapplyConceptLabelSet* conSet = succIndi->getReapplyConceptLabelSet(false); // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; bool continuePropagation = false; for (CSortedNegLinker* conceptOpLinkerIt = conceptOpLinker; conceptOpLinkerIt; conceptOpLinkerIt = conceptOpLinkerIt->getNext()) { CConcept* opConcept = conceptOpLinkerIt->getData(); bool opConNeg = conceptOpLinkerIt->isNegated() ^ negate; CConceptDescriptor* bindingConDes = nullptr; CDependencyTrackPoint* bindingDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; CConceptRepresentativePropagationSetHash* conRepPropSetHash = processIndi->getConceptRepresentativePropagationSetHash(true); CRepresentativePropagationSet* prevRepPropSet = conRepPropSetHash->getRepresentativePropagationSet(concept,false); CConceptRepresentativePropagationSetHash* succConRepPropSetHash = succIndi->getConceptRepresentativePropagationSetHash(true); CRepresentativePropagationSet* succRepPropSet = succConRepPropSetHash->getRepresentativePropagationSet(opConcept,true); CRepresentativePropagationDescriptor* procRepPropDes = nullptr; CDependencyTrackPoint* propDepTrackPoint = nullptr; if (prevRepPropSet) { procRepPropDes = prevRepPropSet->getOutgoingRepresentativePropagationDescriptorLinker(); } if (procRepPropDes) { propDepTrackPoint = procRepPropDes->getDependencyTrackPoint(); if (!conSet->getConceptDescriptorAndReapplyQueue(opConcept,bindingConDes,bindingDepTrackPoint,reapplyQueue)) { ++mStatRepresentativePropagateSuccCount; if (!nextDepTrackPoint) { conSet = succIndi->getReapplyConceptLabelSet(true); CREPRESENTATIVEALLDependencyNode* repAllDepNode = createREPRESENTATIVEALLDependency(nextDepTrackPoint,processIndi,conDes,propDepTrackPoint,restLink->getDependencyTrackPoint(),calcAlgContext); } bindingConDes = addConceptToIndividualReturnConceptDescriptor(opConcept,opConNeg,succIndi,nextDepTrackPoint,false,false,calcAlgContext); succRepPropSet->setConceptDescriptor(bindingConDes); propagateRepresentative(succIndi,procRepPropDes,succRepPropSet,nextDepTrackPoint,calcAlgContext); continuePropagation = true; } else { if (requiresRepresentativePropagation(succIndi,procRepPropDes,succRepPropSet,calcAlgContext)) { ++mStatRepresentativePropagateSuccCount; if (!nextDepTrackPoint) { conSet = succIndi->getReapplyConceptLabelSet(true); CREPRESENTATIVEALLDependencyNode* repAllDepNode = createREPRESENTATIVEALLDependency(nextDepTrackPoint,processIndi,conDes,propDepTrackPoint,restLink->getDependencyTrackPoint(),calcAlgContext); } propagateRepresentative(succIndi,procRepPropDes,succRepPropSet,nextDepTrackPoint,calcAlgContext); cint64 varCount = succRepPropSet->getOutgoingRepresentativePropagationDescriptorLinker()->getRepresentativeVariableBindingPathSetData()->getRepresentatedVariableCount(); reapplyConceptUpdatedRepresentative(succIndi,bindingConDes,bindingDepTrackPoint,varCount,conSet,reapplyQueue,calcAlgContext); continuePropagation = true; } } } } if (continuePropagation) { addIndividualToProcessingQueue(succIndi,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEALLRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opLinker = concept->getOperandList(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CSortedNegLinker* conceptOpLinker = concept->getOperandList(); STATINC(VARBINDRULEALLAPPLICATIONCOUNT,calcAlgContext); CIndividualLinkEdge* restLink = getLinkProcessingRestriction(conProDes); if (restLink) { CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,restLink,calcAlgContext); propagateRepresentativeToSuccessor(processIndi,succIndi,opLinker,negate,conDes,restLink,calcAlgContext); } else { CReapplyRoleSuccessorHash* roleSuccHash = processIndi->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { CRoleSuccessorLinkIterator roleSuccIt = roleSuccHash->getRoleSuccessorLinkIterator(role); while (roleSuccIt.hasNext()) { CIndividualLinkEdge* link = roleSuccIt.next(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); propagateRepresentativeToSuccessor(processIndi,succIndi,opLinker,negate,conDes,link,calcAlgContext); } } } if (!conProDes->isConceptReapplied()) { if (!isConceptInReapplyQueue(conDes,role,processIndi,calcAlgContext)) { addConceptToReapplyQueue(conDes,role,processIndi,true,depTrackPoint,calcAlgContext); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyREPRESENTATIVEANDRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool conceptNegation = negate; CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CSortedNegLinker* opConLinker = concept->getOperandList(); CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CDependencyTrackPoint* nextDepTrackPoint = nullptr; CConceptRepresentativePropagationSetHash* conRepPropHash = nullptr; CRepresentativePropagationSet* prevRepPropSet = nullptr; CRepresentativePropagationDescriptor* procRepPropDes = nullptr; CDependencyTrackPoint* propDepTrackPoint = nullptr; STATINC(VARBINDRULEANDAPPLICATIONCOUNT,calcAlgContext); for (CSortedNegLinker* opConLinkerIt = opConLinker; opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* bindingTriggerConcept = opConLinkerIt->getData(); bool bindingTriggerConceptNegation = opConLinkerIt->isNegated()^conceptNegation; if (!conRepPropHash) { conRepPropHash = processIndi->getConceptRepresentativePropagationSetHash(true); } if (!prevRepPropSet) { prevRepPropSet = conRepPropHash->getRepresentativePropagationSet(concept,false); } if (prevRepPropSet) { procRepPropDes = prevRepPropSet->getOutgoingRepresentativePropagationDescriptorLinker(); } if (procRepPropDes) { propDepTrackPoint = procRepPropDes->getDependencyTrackPoint(); CRepresentativePropagationSet* repPropSet = conRepPropHash->getRepresentativePropagationSet(bindingTriggerConcept,true); CConceptDescriptor* bindingConDes = nullptr; CDependencyTrackPoint* bindingDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; if (!conSet->getConceptDescriptorAndReapplyQueue(bindingTriggerConcept,bindingConDes,bindingDepTrackPoint,reapplyQueue)) { ++mStatRepresentativePropagateCount; if (!nextDepTrackPoint) { conSet = processIndi->getReapplyConceptLabelSet(true); CREPRESENTATIVEANDDependencyNode* repPropDepNode = createREPRESENTATIVEANDDependency(nextDepTrackPoint,processIndi,conDes,propDepTrackPoint,calcAlgContext); } bindingConDes = addConceptToIndividualReturnConceptDescriptor(bindingTriggerConcept,bindingTriggerConceptNegation,processIndi,nextDepTrackPoint,false,false,calcAlgContext); repPropSet->setConceptDescriptor(bindingConDes); propagateRepresentative(processIndi,procRepPropDes,repPropSet,nextDepTrackPoint,calcAlgContext); } else { if (requiresRepresentativePropagation(processIndi,procRepPropDes,repPropSet,calcAlgContext)) { ++mStatRepresentativePropagateCount; if (!nextDepTrackPoint) { conSet = processIndi->getReapplyConceptLabelSet(true); CREPRESENTATIVEANDDependencyNode* repPropDepNode = createREPRESENTATIVEANDDependency(nextDepTrackPoint,processIndi,conDes,propDepTrackPoint,calcAlgContext); } propagateRepresentative(processIndi,procRepPropDes,repPropSet,nextDepTrackPoint,calcAlgContext); cint64 varCount = repPropSet->getOutgoingRepresentativePropagationDescriptorLinker()->getRepresentativeVariableBindingPathSetData()->getRepresentatedVariableCount(); reapplyConceptUpdatedRepresentative(processIndi,bindingConDes,bindingDepTrackPoint,varCount,conSet,reapplyQueue,calcAlgContext); } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::reapplyConceptUpdatedRepresentative(CIndividualProcessNode*& processIndi, CConceptDescriptor* bindingConDes, CDependencyTrackPoint* bindingDepTrackPoint, CReapplyConceptLabelSet* conSet, CCondensedReapplyQueue* reapplyQueue, CCalculationAlgorithmContextBase* calcAlgContext) { setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); addConceptPreprocessedToProcessingQueue(bindingConDes,bindingDepTrackPoint,conProQueue,processIndi,true,calcAlgContext); if (!reapplyQueue->isEmpty()) { CCondensedReapplyQueueIterator reapplyQueueIt(conSet->getConceptReapplyIterator(bindingConDes)); applyReapplyQueueConcepts(processIndi,&reapplyQueueIt,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::reapplyConceptUpdatedRepresentative(CIndividualProcessNode*& processIndi, CConceptDescriptor* bindingConDes, CDependencyTrackPoint* bindingDepTrackPoint, cint64 bindingCount, CReapplyConceptLabelSet* conSet, CCondensedReapplyQueue* reapplyQueue, CCalculationAlgorithmContextBase* calcAlgContext) { setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); addConceptPreprocessedToProcessingQueue(bindingConDes,bindingDepTrackPoint,conProQueue,processIndi,bindingCount,calcAlgContext); if (!reapplyQueue->isEmpty()) { CCondensedReapplyQueueIterator reapplyQueueIt(conSet->getConceptReapplyIterator(bindingConDes)); applyReapplyQueueConcepts(processIndi,&reapplyQueueIt,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::updateRepresentativePropagationSet(CIndividualProcessNode*& processIndi, CRepresentativePropagationSet* repPropSet, CCalculationAlgorithmContextBase* calcAlgContext) { if (repPropSet->getLastProcessedIncomingRepresentativePropagationDescriptorLinker() != repPropSet->getIncomingRepresentativePropagationDescriptorLinker()) { CRepresentativePropagationDescriptor* lastRepPropDes = repPropSet->getLastProcessedIncomingRepresentativePropagationDescriptorLinker(); CRepresentativePropagationDescriptor* lastIncRepPropDes = repPropSet->getIncomingRepresentativePropagationDescriptorLinker(); CRepresentativePropagationDescriptor* lastOutRepPropDes = repPropSet->getOutgoingRepresentativePropagationDescriptorLinker(); repPropSet->setLastProcessedIncomingRepresentativePropagationDescriptorLinker(lastIncRepPropDes); if (!repPropSet->getOutgoingRepresentativePropagationDescriptorLinker() && !lastIncRepPropDes->hasNext()) { repPropSet->setOutgoingRepresentativePropagationDescriptorLinker(lastIncRepPropDes); if (lastIncRepPropDes->getRepresentativeVariableBindingPathSetData()->isLocalizationTagUpToDate(calcAlgContext->getUsedProcessTagger())) { lastIncRepPropDes->getRepresentativeVariableBindingPathSetData()->incShareCount(); } } else { ++mStatRepresentativePropagateUseRepresentativeCount; CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CRepresentativeVariableBindingPathSetHash* repVarBindPathSetHash = procDataBox->getRepresentativeVariableBindingPathSetHash(true); CRepresentativeVariableBindingPathSetData* lastRepVarBindPathSetData = nullptr; bool migrateable = false; if (lastOutRepPropDes) { lastRepVarBindPathSetData = lastOutRepPropDes->getRepresentativeVariableBindingPathSetData(); } if (lastRepVarBindPathSetData) { if (lastRepVarBindPathSetData->isLocalizationTagUpToDate(calcAlgContext->getUsedProcessTagger())) { lastRepVarBindPathSetData->decShareCount(); if (lastRepVarBindPathSetData->isMigratable() && lastRepVarBindPathSetData->getShareCount() <= 0 && lastRepVarBindPathSetData->getUseCount() <= 20) { migrateable = true; } } } CRepresentativeVariableBindingPathSetData* repVarBindPathSetData = repVarBindPathSetHash->getRepresentativeVariableBindingPathSetData(repPropSet,true); repVarBindPathSetData->incShareCount(); repVarBindPathSetData->incUseCount(); if (!repVarBindPathSetData->hasMigrateData()) { ++mStatRepresentativePropagateNewRepresentativeCount; repVarBindPathSetData->setRepresentativeID(procDataBox->getNextRepresentativeVariableBindingPathID(true)); bool updateNewOnly = false; if (migrateable) { updateNewOnly = true; repVarBindPathSetData->takeMigrateDataFrom(lastRepVarBindPathSetData); } else if (lastRepVarBindPathSetData) { updateNewOnly = true; repVarBindPathSetData->copyMigrateDataFrom(lastRepVarBindPathSetData); } CRepresentativeVariableBindingPathSetMigrateData* repMigrateData = repVarBindPathSetData->getMigrateData(true); CRepresentativeVariableBindingPathMap* repVarBindPathMap = repMigrateData->getRepresentativeVariableBindingPathMap(); CRepresentativePropagationDescriptor* untilUpdateRepPropDes = nullptr; if (updateNewOnly) { untilUpdateRepPropDes = lastRepPropDes; } for (CRepresentativePropagationDescriptor* newRepPropDesIt = lastIncRepPropDes; newRepPropDesIt != untilUpdateRepPropDes; newRepPropDesIt = newRepPropDesIt->getNext()) { CRepresentativeVariableBindingPathSetData* newRepVarBindPathSetData = newRepPropDesIt->getRepresentativeVariableBindingPathSetData(); CRepresentativeVariableBindingPathSetMigrateData* newRepMigrateData = newRepVarBindPathSetData->getMigrateData(true); repMigrateData->getRepresentativeContainingMap()->insertContainedRepresentative(newRepVarBindPathSetData,true); repVarBindPathSetData->addKeySignatureValue(newRepVarBindPathSetData->getRepresentativeKey()); CRepresentativeVariableBindingPathMap* newRepVarBindPathMap = newRepMigrateData->getRepresentativeVariableBindingPathMap(); if (newRepVarBindPathMap->count()*mMapComparisonDirectLookupFactor <= repVarBindPathMap->count()) { for (CRepresentativeVariableBindingPathMap::const_iterator propIt = newRepVarBindPathMap->constBegin(), propItEnd = newRepVarBindPathMap->constEnd(); propIt != propItEnd; ++propIt) { cint64 propVarBindPathID = propIt.key(); if (!repVarBindPathMap->contains(propVarBindPathID)) { repVarBindPathMap->insert(propVarBindPathID,CRepresentativeVariableBindingPathMapData(propIt.value().getVariableBindingPath(),newRepVarBindPathSetData)); } } } else { CRepresentativeVariableBindingPathMap::const_iterator availIt = repVarBindPathMap->begin(), availItEnd = repVarBindPathMap->end(); CRepresentativeVariableBindingPathMap::const_iterator propIt = newRepVarBindPathMap->constBegin(), propItEnd = newRepVarBindPathMap->constEnd(); while (propIt != propItEnd) { cint64 propID = propIt.key(); if (availIt == availItEnd) { availIt = repVarBindPathMap->insert(propID,CRepresentativeVariableBindingPathMapData(propIt.value().getVariableBindingPath(),newRepVarBindPathSetData)); ++propIt; ++availIt; } else { cint64 availID = availIt.key(); if (availID < propID) { ++availIt; } else if (availID > propID) { availIt = repVarBindPathMap->insert(propID,CRepresentativeVariableBindingPathMapData(propIt.value().getVariableBindingPath(),newRepVarBindPathSetData)); ++propIt; ++availIt; } else { ++propIt; ++availIt; } } } } } } else { ++mStatRepresentativePropagateReusedRepresentativeCount; } CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CRepresentativePropagationDescriptor* outPropRepDes = CObjectAllocator::allocateAndConstruct(taskMemMan); CDependencyTrackPoint* nextDepTrackPoint = nullptr; CRepresentativeVariableBindingPathMap* repVarBindPathMap = repVarBindPathSetData->getMigrateData(false)->getRepresentativeVariableBindingPathMap(); CRepresentativeContainingMap* repConMap = repVarBindPathSetData->getMigrateData(false)->getRepresentativeContainingMap(); CRESOLVEREPRESENTATIVEDependencyNode* resolveRepNode = createRESOLVEREPRESENTATIVEDependency(nextDepTrackPoint,processIndi,repPropSet->getConceptDescriptor(),repVarBindPathMap,repPropSet->getRepresentativePropagationMap(),lastIncRepPropDes->getDependencyTrackPoint(),lastOutRepPropDes->getDependencyTrackPoint(),calcAlgContext); outPropRepDes->initRepresentativeDescriptor(repVarBindPathSetData,nextDepTrackPoint); repPropSet->addOutgoingRepresentativePropagationDescriptorLinker(outPropRepDes); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateRepresentative(CIndividualProcessNode*& processIndi, CRepresentativePropagationDescriptor* repPropDes, CRepresentativePropagationSet* repPropSet, CDependencyTrackPoint* nextDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CRepresentativePropagationDescriptor* propagateRepDes = CObjectAllocator::allocateAndConstruct(taskMemMan); propagateRepDes->initRepresentativeDescriptor(repPropDes->getRepresentativeVariableBindingPathSetData(),nextDepTrackPoint); repPropSet->addIncomingRepresentativePropagation(propagateRepDes); updateRepresentativePropagationSet(processIndi,repPropSet,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::requiresRepresentativePropagation(CIndividualProcessNode*& processIndi, CRepresentativePropagationDescriptor* repPropDes, CRepresentativePropagationSet* testRepPropSet, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 propRepID = repPropDes->getRepresentativeVariableBindingPathSetData()->getRepresentativeID(); if (testRepPropSet->containsRepresentativePropagation(propRepID)) { return false; } CRepresentativePropagationDescriptor* lastRepPropDes = testRepPropSet->getOutgoingRepresentativePropagationDescriptorLinker(); if (lastRepPropDes) { CRepresentativeVariableBindingPathSetData* availRepData = lastRepPropDes->getRepresentativeVariableBindingPathSetData(); CRepresentativeVariableBindingPathSetMigrateData* availMigData = availRepData->getMigrateData(false); if (availMigData) { CRepresentativeContainingMap* repContMap = availMigData->getRepresentativeContainingMap(); if (repContMap->contains(propRepID)) { return false; } CRepresentativeVariableBindingPathMap* availVarBindPathMap = availMigData->getRepresentativeVariableBindingPathMap(); CRepresentativeVariableBindingPathSetMigrateData* propMigData = repPropDes->getRepresentativeVariableBindingPathSetData()->getMigrateData(false); CRepresentativeVariableBindingPathMap* propVarBindPathMap = propMigData->getRepresentativeVariableBindingPathMap(); if (propVarBindPathMap->count()*mMapComparisonDirectLookupFactor <= availVarBindPathMap->count()) { for (CRepresentativeVariableBindingPathMap::const_iterator propIt = propVarBindPathMap->constBegin(), propItEnd = propVarBindPathMap->constEnd(); propIt != propItEnd; ++propIt) { cint64 propVarBindPathID = propIt.key(); if (!availVarBindPathMap->contains(propVarBindPathID)) { return true; } } return false; } else { CRepresentativeVariableBindingPathMap::const_iterator availIt = availVarBindPathMap->constBegin(), availItEnd = availVarBindPathMap->constEnd(); CRepresentativeVariableBindingPathMap::const_iterator propIt = propVarBindPathMap->constBegin(), propItEnd = propVarBindPathMap->constEnd(); while (propIt != propItEnd) { cint64 propID = propIt.key(); if (availIt == availItEnd) { return true; } cint64 availID = availIt.key(); if (availID < propID) { ++availIt; } else if (propID < availID) { return true; } else { ++availIt; ++propIt; } } return false; } } } return true; } void CCalculationTableauCompletionTaskHandleAlgorithm::applyVARIABLEBINDINGANDRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool conceptNegation = negate; CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CSortedNegLinker* opConLinker = concept->getOperandList(); CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CDependencyTrackPoint* nextDepTrackPoint = nullptr; STATINC(VARBINDRULEANDAPPLICATIONCOUNT,calcAlgContext); for (CSortedNegLinker* opConLinkerIt = opConLinker; opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* bindingTriggerConcept = opConLinkerIt->getData(); bool bindingTriggerConceptNegation = opConLinkerIt->isNegated()^conceptNegation; CConceptDescriptor* bindingConDes = nullptr; CDependencyTrackPoint* bindingDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; if (!conSet->getConceptDescriptorAndReapplyQueue(bindingTriggerConcept,bindingConDes,bindingDepTrackPoint,reapplyQueue)) { if (!nextDepTrackPoint) { conSet = processIndi->getReapplyConceptLabelSet(true); CVARBINDPROPAGATEANDDependencyNode* bindDepNode = createVARBINDPROPAGATEANDDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,calcAlgContext); } bindingConDes = addConceptToIndividualReturnConceptDescriptor(bindingTriggerConcept,bindingTriggerConceptNegation,processIndi,nextDepTrackPoint,false,false,calcAlgContext); CConceptVariableBindingPathSetHash* conVarBindingSetHash = processIndi->getConceptVariableBindingPathSetHash(true); CVariableBindingPathSet* prevVarBindingPathSet = conVarBindingSetHash->getVariableBindingPathSet(concept,false); CVariableBindingPathSet* varBindingPathSet = conVarBindingSetHash->getVariableBindingPathSet(bindingTriggerConcept,true); varBindingPathSet->setConceptDescriptor(bindingConDes); propagateInitialVariableBindings(processIndi,bindingConDes,varBindingPathSet,prevVarBindingPathSet,nullptr,calcAlgContext); } else { CConceptVariableBindingPathSetHash* conVarBindingSetHash = processIndi->getConceptVariableBindingPathSetHash(true); CVariableBindingPathSet* prevVarBindingPathSet = conVarBindingSetHash->getVariableBindingPathSet(concept,false); CVariableBindingPathSet* varBindingPathSet = conVarBindingSetHash->getVariableBindingPathSet(bindingTriggerConcept,true); if (propagateFreshVariableBindings(processIndi,conDes,varBindingPathSet,prevVarBindingPathSet,nullptr,calcAlgContext)) { setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true);; cint64 bindingCount = varBindingPathSet->getVariableBindingPathMap()->count(); addConceptPreprocessedToProcessingQueue(bindingConDes,bindingDepTrackPoint,conProQueue,processIndi,true,calcAlgContext); if (!reapplyQueue->isEmpty()) { CCondensedReapplyQueueIterator reapplyQueueIt(conSet->getConceptReapplyIterator(bindingConDes)); applyReapplyQueueConcepts(processIndi,&reapplyQueueIt,calcAlgContext); } } } } } bool CCalculationTableauCompletionTaskHandleAlgorithm::propagateInitialVariableBindings(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CVariableBindingPathSet* newVarBindingSet, CVariableBindingPathSet* prevVarBindingSet, CDependency* otherDependencies, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); bool propagations = false; CVariableBindingPathDescriptor* newVarBindPathDesLinker = nullptr; if (prevVarBindingSet) { newVarBindingSet->copyVariableBindingPaths(prevVarBindingSet->getVariableBindingPathMap()); CVariableBindingPathMap* varBindMap = newVarBindingSet->getVariableBindingPathMap(); for (CVariableBindingPathMap::iterator it = varBindMap->begin(), itEnd = varBindMap->end(); it != itEnd; ++it) { ++mStatVarBindingPropagateCount; ++mStatVarBindingPropagateInitialCount; STATINC(VARBINDPROPAGATEDCOUNT,calcAlgContext); STATINC(VARBINDPROPAGATEDINITIALCOUNT,calcAlgContext); CVariableBindingPathMapData& varBindPathMapData = it.value(); CVariableBindingPathDescriptor* prevVarBindPathDes = varBindPathMapData.getVariableBindingPathDescriptor(); CVariableBindingPathDescriptor* newVarBindPathDes = CObjectAllocator::allocateAndConstruct(taskMemMan); CDependencyTrackPoint* newDepTrackPoint = nullptr; CPROPAGATEVARIABLEBINDINGDependencyNode* bindDepNode = createPROPAGATEVARIABLEBINDINGDependency(newDepTrackPoint,processIndi,conDes,prevVarBindPathDes->getDependencyTrackPoint(),otherDependencies,calcAlgContext); newVarBindPathDes->initVariableBindingPathDescriptor(prevVarBindPathDes->getVariableBindingPath(),newDepTrackPoint); varBindPathMapData.setVariableBindingPathDescriptor(newVarBindPathDes); newVarBindPathDesLinker = newVarBindPathDes->append(newVarBindPathDesLinker); propagations = true; } if (newVarBindPathDesLinker) { newVarBindingSet->addVariableBindingPathDescriptorLinker(newVarBindPathDesLinker); } } return propagations; } bool CCalculationTableauCompletionTaskHandleAlgorithm::propagateFreshVariableBindings(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CVariableBindingPathSet* newVarBindingSet, CVariableBindingPathSet* prevVarBindingSet, CDependency* otherDependencies, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); bool propagations = false; if (prevVarBindingSet) { CVariableBindingPathMap* prevVarBindPathMap = prevVarBindingSet->getVariableBindingPathMap(); CVariableBindingPathMap* newVarBindPathMap = newVarBindingSet->getVariableBindingPathMap(); CVariableBindingPathMap::iterator itNew = newVarBindPathMap->begin(); CVariableBindingPathMap::const_iterator itPrev = prevVarBindPathMap->constBegin(), itPrevEnd = prevVarBindPathMap->constEnd(); CVariableBindingPathDescriptor* newVarBindPathDesLinker = nullptr; while (itPrev != itPrevEnd) { cint64 prevPropID = itPrev.key(); bool doPropagation = false; if (itNew == newVarBindPathMap->end()) { doPropagation = true; } else { cint64 newPropID = itNew.key(); if (newPropID < prevPropID) { ++itNew; } else if (newPropID == prevPropID) { ++itNew; ++itPrev; } else { doPropagation = true; } } if (doPropagation) { ++mStatVarBindingPropagateCount; ++mStatVarBindingPropagateFreshCount; STATINC(VARBINDPROPAGATEDCOUNT,calcAlgContext); STATINC(VARBINDPROPAGATEDFRESHCOUNT,calcAlgContext); const CVariableBindingPathMapData& prevVarBindPathMapData = itPrev.value(); CVariableBindingPathDescriptor* prevVarBindPathDes = prevVarBindPathMapData.getVariableBindingPathDescriptor(); CVariableBindingPathDescriptor* newVarBindPathDes = CObjectAllocator::allocateAndConstruct(taskMemMan); CDependencyTrackPoint* newDepTrackPoint = nullptr; CPROPAGATEVARIABLEBINDINGDependencyNode* bindDepNode = createPROPAGATEVARIABLEBINDINGDependency(newDepTrackPoint,processIndi,conDes,prevVarBindPathDes->getDependencyTrackPoint(),otherDependencies,calcAlgContext); CVariableBindingPath* varBindingPath = prevVarBindPathDes->getVariableBindingPath(); newVarBindPathDes->initVariableBindingPathDescriptor(varBindingPath,newDepTrackPoint); itNew = newVarBindPathMap->insert(varBindingPath->getPropagationID(),CVariableBindingPathMapData(newVarBindPathDes)); newVarBindPathDesLinker = newVarBindPathDes->append(newVarBindPathDesLinker); propagations = true; } } if (newVarBindPathDesLinker) { newVarBindingSet->addVariableBindingPathDescriptorLinker(newVarBindPathDesLinker); } } return propagations; } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateVariableBindingsToSuccessor(CIndividualProcessNode* processIndi, CIndividualProcessNode*& succIndi, CSortedNegLinker* conceptOpLinker, bool negate, CConceptDescriptor* conDes, CIndividualLinkEdge* restLink, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CDependencyTrackPoint* depTrackPoint = conDes->getDependencyTrackPoint(); CConcept* concept = conDes->getConcept(); succIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); CReapplyConceptLabelSet* conSet = succIndi->getReapplyConceptLabelSet(false); // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; bool continuePropagation = false; for (CSortedNegLinker* conceptOpLinkerIt = conceptOpLinker; conceptOpLinkerIt; conceptOpLinkerIt = conceptOpLinkerIt->getNext()) { CConcept* opConcept = conceptOpLinkerIt->getData(); bool opConNeg = conceptOpLinkerIt->isNegated() ^ negate; CConceptDescriptor* bindingConDes = nullptr; CDependencyTrackPoint* bindingDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; if (!conSet->getConceptDescriptorAndReapplyQueue(opConcept,bindingConDes,bindingDepTrackPoint,reapplyQueue)) { if (!nextDepTrackPoint) { conSet = processIndi->getReapplyConceptLabelSet(true); CVARBINDPROPAGATEALLDependencyNode* bindDepNode = createVARBINDPROPAGATEALLDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,restLink->getDependencyTrackPoint(),calcAlgContext); } bindingConDes = addConceptToIndividualReturnConceptDescriptor(opConcept,opConNeg,succIndi,nextDepTrackPoint,false,false,calcAlgContext); CConceptVariableBindingPathSetHash* conVarBindingPathSetHash = processIndi->getConceptVariableBindingPathSetHash(true); CVariableBindingPathSet* prevVarBindingPathSet = conVarBindingPathSetHash->getVariableBindingPathSet(concept,false); CConceptVariableBindingPathSetHash* succConVarBindingPathSetHash = succIndi->getConceptVariableBindingPathSetHash(true); CVariableBindingPathSet* succVarBindingPathSet = succConVarBindingPathSetHash->getVariableBindingPathSet(opConcept,true); succVarBindingPathSet->setConceptDescriptor(bindingConDes); propagateInitialVariableBindingsToSuccessor(processIndi,succIndi,bindingConDes,succVarBindingPathSet,prevVarBindingPathSet,restLink,calcAlgContext); continuePropagation = true; } else { CConceptVariableBindingPathSetHash* conVarBindingPathSetHash = processIndi->getConceptVariableBindingPathSetHash(true); CVariableBindingPathSet* prevVarBindingPathSet = conVarBindingPathSetHash->getVariableBindingPathSet(concept,false); CConceptVariableBindingPathSetHash* succConVarBindingPathSetHash = succIndi->getConceptVariableBindingPathSetHash(true); CVariableBindingPathSet* succVarBindingPathSet = succConVarBindingPathSetHash->getVariableBindingPathSet(opConcept,true); if (propagateFreshVariableBindingsToSuccessor(processIndi,succIndi,conDes,succVarBindingPathSet,prevVarBindingPathSet,restLink,calcAlgContext)) { setIndividualNodeConceptLabelSetModified(succIndi,calcAlgContext); CConceptProcessingQueue* conProQueue = succIndi->getConceptProcessingQueue(true);; cint64 bindingCount = succVarBindingPathSet->getVariableBindingPathMap()->count(); addConceptPreprocessedToProcessingQueue(bindingConDes,bindingDepTrackPoint,conProQueue,succIndi,true,calcAlgContext); if (!reapplyQueue->isEmpty()) { CCondensedReapplyQueueIterator reapplyQueueIt(conSet->getConceptReapplyIterator(bindingConDes)); applyReapplyQueueConcepts(succIndi,&reapplyQueueIt,calcAlgContext); } continuePropagation = true; } } } if (continuePropagation) { addIndividualToProcessingQueue(succIndi,calcAlgContext); } } bool CCalculationTableauCompletionTaskHandleAlgorithm::propagateInitialVariableBindingsToSuccessor(CIndividualProcessNode*& processIndi, CIndividualProcessNode* succIndi, CConceptDescriptor* conDes, CVariableBindingPathSet* newVarBindingPathSet, CVariableBindingPathSet* prevVarBindingPathSet, CIndividualLinkEdge* restLink, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); bool propagations = false; CVariableBindingPathDescriptor* newVarBindPathDesLinker = nullptr; if (prevVarBindingPathSet) { newVarBindingPathSet->copyVariableBindingPaths(prevVarBindingPathSet->getVariableBindingPathMap()); CVariableBindingPathMap* varBindPathMap = newVarBindingPathSet->getVariableBindingPathMap(); for (CVariableBindingPathMap::iterator it = varBindPathMap->begin(), itEnd = varBindPathMap->end(); it != itEnd; ++it) { STATINC(VARBINDPROPAGATEDCOUNT,calcAlgContext); STATINC(VARBINDPROPAGATEDINITIALCOUNT,calcAlgContext); ++mStatVarBindingPropagateSuccCount; ++mStatVarBindingPropagateSuccInitialCount; CVariableBindingPathMapData& varBindPathMapData = it.value(); CVariableBindingPathDescriptor* prevVarBindPathDes = varBindPathMapData.getVariableBindingPathDescriptor(); CVariableBindingPathDescriptor* newVarBindPathDes = CObjectAllocator::allocateAndConstruct(taskMemMan); CDependencyTrackPoint* newDepTrackPoint = nullptr; CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode* bindDepNode = createPROPAGATEVARIABLEBINDINGSSUCCESSORDependency(newDepTrackPoint,processIndi,conDes,prevVarBindPathDes->getDependencyTrackPoint(),restLink->getDependencyTrackPoint(),calcAlgContext); newVarBindPathDes->initVariableBindingPathDescriptor(prevVarBindPathDes->getVariableBindingPath(),newDepTrackPoint); varBindPathMapData.setVariableBindingPathDescriptor(newVarBindPathDes); newVarBindPathDesLinker = newVarBindPathDes->append(newVarBindPathDesLinker); propagations = true; } if (newVarBindPathDesLinker) { newVarBindingPathSet->addVariableBindingPathDescriptorLinker(newVarBindPathDesLinker); } } return propagations; } bool CCalculationTableauCompletionTaskHandleAlgorithm::propagateFreshVariableBindingsToSuccessor(CIndividualProcessNode*& processIndi, CIndividualProcessNode* succIndi, CConceptDescriptor* conDes, CVariableBindingPathSet* newVarBindingPathSet, CVariableBindingPathSet* prevVarBindingPathSet, CIndividualLinkEdge* restLink, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); bool propagations = false; if (prevVarBindingPathSet) { CVariableBindingPathMap* prevVarBindPathMap = prevVarBindingPathSet->getVariableBindingPathMap(); CVariableBindingPathMap* newVarBindPathMap = newVarBindingPathSet->getVariableBindingPathMap(); CVariableBindingPathMap::iterator itNew = newVarBindPathMap->begin(); CVariableBindingPathMap::const_iterator itPrev = prevVarBindPathMap->constBegin(), itPrevEnd = prevVarBindPathMap->constEnd(); CVariableBindingPathDescriptor* newVarBindPathDesLinker = nullptr; while (itPrev != itPrevEnd) { cint64 prevPropID = itPrev.key(); bool doPropagation = false; if (itNew == newVarBindPathMap->end()) { doPropagation = true; } else { cint64 newPropID = itNew.key(); if (newPropID < prevPropID) { ++itNew; } else if (newPropID == prevPropID) { ++itNew; ++itPrev; } else { doPropagation = true; } } if (doPropagation) { STATINC(VARBINDPROPAGATEDCOUNT,calcAlgContext); STATINC(VARBINDPROPAGATEDFRESHCOUNT,calcAlgContext); ++mStatVarBindingPropagateSuccCount; ++mStatVarBindingPropagateSuccFreshCount; const CVariableBindingPathMapData& prevVarBindPathMapData = itPrev.value(); CVariableBindingPathDescriptor* prevVarBindPathDes = prevVarBindPathMapData.getVariableBindingPathDescriptor(); CVariableBindingPathDescriptor* newVarBindPathDes = CObjectAllocator::allocateAndConstruct(taskMemMan); CDependencyTrackPoint* newDepTrackPoint = nullptr; CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode* bindDepNode = createPROPAGATEVARIABLEBINDINGSSUCCESSORDependency(newDepTrackPoint,processIndi,conDes,prevVarBindPathDes->getDependencyTrackPoint(),restLink->getDependencyTrackPoint(),calcAlgContext); CVariableBindingPath* varBindingPath = prevVarBindPathDes->getVariableBindingPath(); newVarBindPathDes->initVariableBindingPathDescriptor(varBindingPath,newDepTrackPoint); itNew = newVarBindPathMap->insert(varBindingPath->getPropagationID(),CVariableBindingPathMapData(newVarBindPathDes)); newVarBindPathDesLinker = newVarBindPathDes->append(newVarBindPathDesLinker); propagations = true; } } if (newVarBindPathDesLinker) { newVarBindingPathSet->addVariableBindingPathDescriptorLinker(newVarBindPathDesLinker); } } return propagations; } void CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEALLRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opLinker = concept->getOperandList(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CSortedNegLinker* conceptOpLinker = concept->getOperandList(); STATINC(VARBINDRULEALLAPPLICATIONCOUNT,calcAlgContext); CIndividualLinkEdge* restLink = getLinkProcessingRestriction(conProDes); if (restLink) { CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,restLink,calcAlgContext); propagateVariableBindingsToSuccessor(processIndi,succIndi,opLinker,negate,conDes,restLink,calcAlgContext); } else { CReapplyRoleSuccessorHash* roleSuccHash = processIndi->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { CRoleSuccessorLinkIterator roleSuccIt = roleSuccHash->getRoleSuccessorLinkIterator(role); while (roleSuccIt.hasNext()) { CIndividualLinkEdge* link = roleSuccIt.next(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); propagateVariableBindingsToSuccessor(processIndi,succIndi,opLinker,negate,conDes,link,calcAlgContext); } } } if (!conProDes->isConceptReapplied()) { if (!isConceptInReapplyQueue(conDes,role,processIndi,calcAlgContext)) { addConceptToReapplyQueue(conDes,role,processIndi,true,depTrackPoint,calcAlgContext); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDVARIABLERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CVariable* variable = concept->getVariable(); bool conceptNegation = negate; CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CSortedNegLinker* opConLinker = concept->getOperandList(); CConcept* bindingTriggerConcept = opConLinker->getData(); bool bindingTriggerConceptNegation = opConLinker->isNegated(); CProcessContext* processContext = calcAlgContext->getUsedProcessContext(); CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CConceptDescriptor* bindingConDes = nullptr; CDependencyTrackPoint* bindingDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; STATINC(VARBINDRULEBINDAPPLICATIONCOUNT,calcAlgContext); bool updateExt = false; CConceptPropagationBindingSetHash* conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(false); if (conPropBindingSetHash) { CPropagationBindingSet* propBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,false); if (propBindingSet) { CPropagationVariableBindingTransitionExtension* propVarBindTransExt = propBindingSet->getPropagationVariableBindingTransitionExtension(false); if (!propVarBindTransExt || !propVarBindTransExt->isProcessingCompleted()) { if (!propVarBindTransExt || propBindingSet->hasPropagateAllFlag()) { updateExt = true; } else { CPropagationBindingDescriptor* lastAnalyPropBindDes = propVarBindTransExt->getLastAnalysedPropagationBindingDescriptor(); CPropagationBindingDescriptor* propBindDes = propBindingSet->getPropagationBindingDescriptorLinker(); if (lastAnalyPropBindDes != propBindDes) { updateExt = true; } } } } } if (updateExt) { CConceptPropagationBindingSetHash* conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(true); CPropagationBindingSet* propBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,true); CPropagationVariableBindingTransitionExtension* propVarBindTransExt = propBindingSet->getPropagationVariableBindingTransitionExtension(true); CPropagationBindingDescriptor* lastAnalyPropBindDes = propVarBindTransExt->getLastAnalysedPropagationBindingDescriptor(); CPropagationBindingDescriptor* propBindDes = propBindingSet->getPropagationBindingDescriptorLinker(); propVarBindTransExt->setTriggeredVariableIndividualPair(variable,processIndi); bool createVarBinding = false; createVarBinding = propBindingSet->hasPropagateAllFlag(); for (CPropagationBindingDescriptor* propBindDesIt = propBindDes; propBindDesIt != lastAnalyPropBindDes; propBindDesIt = propBindDesIt->getNext()) { if (propVarBindTransExt->addAnalysedPropagationBindingDescriptorReturnMatched(propBindDesIt)) { createVarBinding = true; } } propVarBindTransExt->setLastAnalysedPropagationBindingDescriptor(propBindDes); propVarBindTransExt->setLastAnalysedPropagateAllFlag(propBindingSet->hasPropagateAllFlag()); if (createVarBinding) { ++mStatVarBindingCreatedCount; STATINC(VARBINDVARIABLEBINDCOUNT,calcAlgContext); propVarBindTransExt->setProcessingCompleted(true); CConceptVariableBindingPathSetHash* conVarBindingPathSetHash = processIndi->getConceptVariableBindingPathSetHash(true); CVariableBindingPathSet* varBindPathSet = conVarBindingPathSetHash->getVariableBindingPathSet(bindingTriggerConcept,true); CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); cint64 nextPathPropID = processingDataBox->getNextVariableBindingPathID(true); CDependencyTrackPoint* nextDepTrackPoint = nullptr; CVARBINDVARIABLEDependencyNode* bindDepNode = createVARBINDVARIABLEDependency(nextDepTrackPoint,processIndi,conDes,processIndi->getDependencyTrackPoint(),calcAlgContext); if (!conSet->getConceptDescriptorAndReapplyQueue(bindingTriggerConcept,bindingConDes,bindingDepTrackPoint,reapplyQueue)) { bindingConDes = addConceptToIndividualReturnConceptDescriptor(bindingTriggerConcept,bindingTriggerConceptNegation,processIndi,nextDepTrackPoint,false,false,calcAlgContext); } else { setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); addConceptPreprocessedToProcessingQueue(bindingConDes,bindingDepTrackPoint,conProQueue,processIndi,true,calcAlgContext); if (!reapplyQueue->isEmpty()) { CCondensedReapplyQueueIterator reapplyQueueIt(conSet->getConceptReapplyIterator(bindingConDes)); applyReapplyQueueConcepts(processIndi,&reapplyQueueIt,calcAlgContext); } } varBindPathSet->setConceptDescriptor(bindingConDes); CVariableBinding* varBinding = CObjectAllocator::allocateAndConstruct(taskMemMan); varBinding->initVariableBinding(nextDepTrackPoint,processIndi,variable); CVariableBindingDescriptor* varBindingDes = CObjectAllocator::allocateAndConstruct(taskMemMan); varBindingDes->initVariableBindingDescriptor(varBinding); CVariableBindingPath* varBindingPath = CObjectAllocator::allocateAndConstruct(taskMemMan); varBindingPath->initVariableBindingPath(nextPathPropID,varBindingDes); CVariableBindingPathDescriptor* varBindingPathDes = CObjectAllocator::allocateAndConstruct(taskMemMan); varBindingPathDes->initVariableBindingPathDescriptor(varBindingPath,nextDepTrackPoint); varBindPathSet->addVariableBindingPath(varBindingPathDes); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEJOINRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opLinker = concept->getOperandList(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CConceptDescriptor* joinConDes = nullptr; CDependencyTrackPoint* joinDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; CConcept* joinConcept = opLinker->getData(); bool joinConceptNegation = opLinker->isNegated(); CSortedNegLinker* triggerLinker = opLinker->getNext(); CSortedLinker* varLinker = concept->getVariableLinker(); STATINC(VARBINDRULEJOINAPPLICATIONCOUNT,calcAlgContext); bool propagateJoins = false; bool createJoinConcept = false; if (!conSet->getConceptDescriptorAndReapplyQueue(joinConcept,joinConDes,joinDepTrackPoint,reapplyQueue)) { // search next not existing trigger bool allTriggersAvailable = true; conSet = processIndi->getReapplyConceptLabelSet(true); CSortedNegLinker* triggerLinkerIt = nullptr; for (triggerLinkerIt = triggerLinker; triggerLinkerIt && allTriggersAvailable; triggerLinkerIt = triggerLinkerIt->getNext()) { CSortedNegLinker* nextTrigger = triggerLinkerIt; CConcept* triggerConcept = nextTrigger->getData(); CConceptDescriptor* triggerConDes = nullptr; CDependencyTrackPoint* triggerDepTrackPoint = nullptr; if (conSet->getConceptDescriptor(triggerConcept,triggerConDes,triggerDepTrackPoint)) { if (triggerConDes->isNegated() == nextTrigger->isNegated()) { return; } } else { allTriggersAvailable = false; break; } } if (!allTriggersAvailable) { // install to trigger CSortedNegLinker* nextTrigger = triggerLinkerIt; CConcept* triggerConcept = nextTrigger->getData(); bool triggerNegation = !nextTrigger->isNegated(); if (!isConceptInReapplyQueue(conDes,triggerConcept,triggerNegation,processIndi,calcAlgContext)) { addConceptToReapplyQueue(conDes,triggerConcept,triggerNegation,processIndi,(CProcessingRestrictionSpecification*)nullptr,depTrackPoint,calcAlgContext); } } else { propagateJoins = true; createJoinConcept = true; } } else { propagateJoins = true; } //mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); bool propagationsDone = false; if (propagateJoins) { for (CSortedNegLinker* triggerLinkerIt = triggerLinker; triggerLinkerIt; triggerLinkerIt = triggerLinkerIt->getNext()) { CSortedNegLinker* nextTrigger = triggerLinkerIt; CConcept* triggerConcept = nextTrigger->getData(); if (!isConceptInReapplyQueue(conDes,triggerConcept,false,processIndi,calcAlgContext)) { addConceptToReapplyQueue(conDes,triggerConcept,false,processIndi,(CProcessingRestrictionSpecification*)nullptr,depTrackPoint,calcAlgContext); } } CConceptPropagationBindingSetHash* conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(false); CConceptVariableBindingPathSetHash* varBindingPathSetHash = processIndi->getConceptVariableBindingPathSetHash(false); CPropagationBindingSet* propBindingSet = nullptr; if (conPropBindingSetHash && varBindingPathSetHash) { propBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,false); if (propBindingSet) { CPropagationVariableBindingTransitionExtension* propVarBindTransExt = propBindingSet->getPropagationVariableBindingTransitionExtension(false); CSortedNegLinker* leftTriggerLinker = triggerLinker; CSortedNegLinker* rightTriggerLinker = triggerLinker->getNext(); CConcept* leftConcept = leftTriggerLinker->getData(); CConcept* rightConcept = rightTriggerLinker->getData(); CVariableBindingPathSet* leftVarBindPathSet = varBindingPathSetHash->getVariableBindingPathSet(leftConcept,false); CVariableBindingPathSet* rightVarBindPathSet = varBindingPathSetHash->getVariableBindingPathSet(rightConcept,false); bool examineTransExt = false; if (leftVarBindPathSet && rightVarBindPathSet) { if (!propVarBindTransExt) { examineTransExt = true; } else { if (propVarBindTransExt->getLastAnalysedPropagateAllFlag() != propBindingSet->getPropagateAllFlag() || propVarBindTransExt->getLastAnalysedPropagationBindingDescriptor() != propBindingSet->getPropagationBindingDescriptorLinker() || propVarBindTransExt->getLeftLastVariableBindingPathJoiningDescriptor() != leftVarBindPathSet->getVariableBindingPathDescriptorLinker() || propVarBindTransExt->getRightLastVariableBindingPathJoiningDescriptor() != rightVarBindPathSet->getVariableBindingPathDescriptorLinker()) { examineTransExt = true; } } } if (examineTransExt) { conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(true); varBindingPathSetHash = processIndi->getConceptVariableBindingPathSetHash(true); propBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,true); propVarBindTransExt = propBindingSet->getPropagationVariableBindingTransitionExtension(true); CVariableBindingPathSet* joinVarBindingPathSet = nullptr; CVariableBindingTriggerHash* varBindTriggerHash = propVarBindTransExt->getVariableBindingTriggerHash(true); CVariableBindingPathJoiningHash* varBindPathJoinHash = propVarBindTransExt->getVariableBindingPathJoiningHash(true); CPropagationBindingDescriptor* lastAnalyPropBindDes = propVarBindTransExt->getLastAnalysedPropagationBindingDescriptor(); CPropagationBindingDescriptor* propBindDes = propBindingSet->getPropagationBindingDescriptorLinker(); bool propAllFlag = propBindingSet->hasPropagateAllFlag(); if (propAllFlag) { for (CVariableBindingTriggerHash::iterator it = varBindTriggerHash->begin(), itEnd = varBindTriggerHash->end(); it != itEnd; ++it) { CVariableBindingTriggerData& data = it.value(); CVariableBindingTriggerLinker* varBindTriggerLinker = data.getVariableBindingTriggerLinker(); data.setTriggered(true); data.clearVariableBindingTriggerLinker(); for (CVariableBindingTriggerLinker* varBindTriggerIt = varBindTriggerLinker; varBindTriggerIt; varBindTriggerIt = varBindTriggerIt->getNext()) { STATINC(VARBINDJOINTRIGGEREXECUTECOUNT,calcAlgContext); CVariableBindingPathDescriptor* varBindPathDes = varBindTriggerIt->getVariableBindingPathDescriptor(); CVariableBindingDescriptor* varBindTriggerDes = varBindTriggerIt->getNextTriggerVariableBindingDescriptor(); bool leftTriggered = varBindTriggerIt->isLeftTriggered(); propagationsDone |= propagateVariableBindingsJoins(processIndi,conDes,joinConcept,varBindPathDes,leftTriggered,varBindPathJoinHash,varBindingPathSetHash,joinConDes,joinVarBindingPathSet,calcAlgContext); } } } else { for (CPropagationBindingDescriptor* propBindDesIt = propBindDes; propBindDesIt != lastAnalyPropBindDes; propBindDesIt = propBindDesIt->getNext()) { CVariableBindingTriggerLinker* varBindTriggerLinker = nullptr; if (propVarBindTransExt->addAnalysedPropagationBindingDescriptorReturnMatched(propBindDesIt,&varBindTriggerLinker)) { for (CVariableBindingTriggerLinker* varBindTriggerIt = varBindTriggerLinker; varBindTriggerIt; varBindTriggerIt = varBindTriggerIt->getNext()) { STATINC(VARBINDJOINTRIGGEREXECUTECOUNT,calcAlgContext); CVariableBindingPathDescriptor* varBindPathDes = varBindTriggerIt->getVariableBindingPathDescriptor(); CVariableBindingDescriptor* varBindTriggerDes = varBindTriggerIt->getNextTriggerVariableBindingDescriptor(); bool leftTriggered = varBindTriggerIt->isLeftTriggered(); if (!triggerVariableBindingPathJoining(processIndi,varBindPathDes,varBindTriggerDes,leftTriggered,varBindTriggerHash,calcAlgContext)) { propagationsDone |= propagateVariableBindingsJoins(processIndi,conDes,joinConcept,varBindPathDes,leftTriggered,varBindPathJoinHash,varBindingPathSetHash,joinConDes,joinVarBindingPathSet,calcAlgContext); } } } } } propVarBindTransExt->setLastAnalysedPropagationBindingDescriptor(propBindDes); propVarBindTransExt->setLastAnalysedPropagateAllFlag(propBindingSet->hasPropagateAllFlag()); if (propVarBindTransExt->getLeftLastVariableBindingPathJoiningDescriptor() != leftVarBindPathSet->getVariableBindingPathDescriptorLinker()) { for (CVariableBindingPathDescriptor* varBindPathDes = leftVarBindPathSet->getVariableBindingPathDescriptorLinker(); varBindPathDes != propVarBindTransExt->getLeftLastVariableBindingPathJoiningDescriptor(); varBindPathDes = varBindPathDes->getNext()) { CVariableBindingPath* varBindPath = varBindPathDes->getVariableBindingPath(); CVariableBindingDescriptor* varBindTriggerDes = varBindPath->getVariableBindingDescriptorLinker(); bool leftTriggered = true; if (propAllFlag || !triggerVariableBindingPathJoining(processIndi,varBindPathDes,varBindTriggerDes,leftTriggered,varBindTriggerHash,calcAlgContext)) { propagationsDone |= propagateVariableBindingsJoins(processIndi,conDes,joinConcept,varBindPathDes,leftTriggered,varBindPathJoinHash,varBindingPathSetHash,joinConDes,joinVarBindingPathSet,calcAlgContext); } } propVarBindTransExt->setLeftLastVariableBindingPathJoiningDescriptor(leftVarBindPathSet->getVariableBindingPathDescriptorLinker()); } if (propVarBindTransExt->getRightLastVariableBindingPathJoiningDescriptor() != rightVarBindPathSet->getVariableBindingPathDescriptorLinker()) { for (CVariableBindingPathDescriptor* varBindPathDes = rightVarBindPathSet->getVariableBindingPathDescriptorLinker(); varBindPathDes != propVarBindTransExt->getRightLastVariableBindingPathJoiningDescriptor(); varBindPathDes = varBindPathDes->getNext()) { CVariableBindingPath* varBindPath = varBindPathDes->getVariableBindingPath(); CVariableBindingDescriptor* varBindTriggerDes = varBindPath->getVariableBindingDescriptorLinker(); bool leftTriggered = false; if (propAllFlag || !triggerVariableBindingPathJoining(processIndi,varBindPathDes,varBindTriggerDes,leftTriggered,varBindTriggerHash,calcAlgContext)) { propagationsDone |= propagateVariableBindingsJoins(processIndi,conDes,joinConcept,varBindPathDes,leftTriggered,varBindPathJoinHash,varBindingPathSetHash,joinConDes,joinVarBindingPathSet,calcAlgContext); } } propVarBindTransExt->setRightLastVariableBindingPathJoiningDescriptor(rightVarBindPathSet->getVariableBindingPathDescriptorLinker()); } } } } } if (propagationsDone) { if (!createJoinConcept) { setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); addConceptPreprocessedToProcessingQueue(joinConDes,joinDepTrackPoint,conProQueue,processIndi,true,calcAlgContext); if (!reapplyQueue->isEmpty()) { CCondensedReapplyQueueIterator reapplyQueueIt(conSet->getConceptReapplyIterator(joinConDes)); applyReapplyQueueConcepts(processIndi,&reapplyQueueIt,calcAlgContext); } } } } bool CCalculationTableauCompletionTaskHandleAlgorithm::propagateVariableBindingsJoins(CIndividualProcessNode* processIndi, CConceptDescriptor* joiningConDes, CConcept* joinConcept, CVariableBindingPathDescriptor* varBindPathDes, bool leftTriggerPath, CVariableBindingPathJoiningHash* varBindPathJoinHash, CConceptVariableBindingPathSetHash* varBindingPathSetHash, CConceptDescriptor*& joinConDes, CVariableBindingPathSet*& varBindingPathSet, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CConcept* joiningConcept = joiningConDes->getConcept(); CSortedLinker* varLinker = joiningConcept->getVariableLinker(); CVariableBindingPath* varBindPath = varBindPathDes->getVariableBindingPath(); CVariableBindingPathJoiningData* varBindPathJoinData = varBindPathJoinHash->getVariableBindingPathJoiningData(CVariableBindingPathJoiningHasher(varBindPath,varLinker),true); CVariableBindingDescriptor* varBindDes = varBindPath->getVariableBindingDescriptorLinker(); if (!varBindPathJoinData) { varBindPathJoinData = CObjectAllocator< CVariableBindingPathJoiningData >::allocateAndConstruct(taskMemMan); CVariableBindingDescriptor* keyVarBindDesLinker = createVariableBindingPathKey(processIndi,varLinker,varBindDes,calcAlgContext); varBindPathJoinData->initVariableBindingPathJoiningData(keyVarBindDesLinker,nullptr,nullptr); varBindPathJoinHash->insertVariableBindingPathJoiningData(CVariableBindingPathJoiningHasher(varBindPathJoinData),varBindPathJoinData); } CVariableBindingPathDescriptor* otherVarBindPathDes = nullptr; if (leftTriggerPath) { otherVarBindPathDes = varBindPathJoinData->getRightVariableBindingPathDescriptorLinker(); } else { otherVarBindPathDes = varBindPathJoinData->getLeftVariableBindingPathDescriptorLinker(); } bool addedVarBindPath = false; for (CVariableBindingPathDescriptor* otherVarBindPathDesIt = otherVarBindPathDes; otherVarBindPathDesIt; otherVarBindPathDesIt = otherVarBindPathDesIt->getNext()) { STATINC(VARBINDJOINCOMBINECOUNT,calcAlgContext); ++mStatVarBindingJoinCombinesCount; CVariableBindingPath* mergedVarBindPath = getJoinedVariableBindingPath(varBindPathDes->getVariableBindingPath(),otherVarBindPathDesIt->getVariableBindingPath(),calcAlgContext); CVariableBindingPathDescriptor* mergedVarBindPathDes = CObjectAllocator< CVariableBindingPathDescriptor >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); CDependencyTrackPoint* mergedDependencyTrackPoint = nullptr; CVARBINDPROPAGATEJOINDependencyNode* bindJoinDepNode = createVARBINDPROPAGATEJOINDependency(mergedDependencyTrackPoint,processIndi,joiningConDes,varBindPathDes->getDependencyTrackPoint(),otherVarBindPathDesIt->getDependencyTrackPoint(),calcAlgContext); forceVariableBindingJoinCreated(processIndi,joiningConDes,joinConcept,joinConDes,mergedDependencyTrackPoint,varBindingPathSet,varBindingPathSetHash,calcAlgContext); mergedVarBindPathDes->initVariableBindingPathDescriptor(mergedVarBindPath,mergedDependencyTrackPoint); varBindingPathSet->addVariableBindingPath(mergedVarBindPathDes); addedVarBindPath = true; } CVariableBindingPathDescriptor* newVarBindPathDes = CObjectAllocator< CVariableBindingPathDescriptor >::allocateAndConstruct(taskMemMan); newVarBindPathDes->initVariableBindingPathDescriptor(varBindPath,varBindPathDes->getDependencyTrackPoint()); if (leftTriggerPath) { varBindPathJoinData->addLeftVariableBindingPathDescriptorLinker(newVarBindPathDes); } else { varBindPathJoinData->addRightVariableBindingPathDescriptorLinker(newVarBindPathDes); } return addedVarBindPath; } CVariableBindingDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::createVariableBindingPathKey(CIndividualProcessNode* processIndi, CSortedLinker* varLinker, CVariableBindingDescriptor* varBindDes, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CVariableBindingDescriptor* keyVarBindDesLinker = nullptr; CVariableBindingDescriptor* lastKeyVarBindDesLinker = nullptr; CSortedLinker* varLinkerIt = varLinker; CVariableBindingDescriptor* varBindDesIt = varBindDes; while (varLinkerIt) { CVariableBinding* varBind = varBindDesIt->getVariableBinding(); if (varBind->getBindedVariable() == varLinkerIt->getData()) { CVariableBindingDescriptor* nextKeyVarBindDesLinker = CObjectAllocator< CVariableBindingDescriptor >::allocateAndConstruct(taskMemMan); nextKeyVarBindDesLinker->initVariableBindingDescriptor(varBind); if (lastKeyVarBindDesLinker) { lastKeyVarBindDesLinker->setNext(nextKeyVarBindDesLinker); lastKeyVarBindDesLinker = nextKeyVarBindDesLinker; } else { keyVarBindDesLinker = lastKeyVarBindDesLinker = nextKeyVarBindDesLinker; } varLinkerIt = varLinkerIt->getNext(); varBindDesIt = varBindDesIt->getNext(); } else { varBindDesIt = varBindDesIt->getNext(); } } return keyVarBindDesLinker; } bool CCalculationTableauCompletionTaskHandleAlgorithm::triggerVariableBindingPathJoining(CIndividualProcessNode* processIndi, CVariableBindingPathDescriptor* varBindPathDes, CVariableBindingDescriptor* varBindDes, bool leftTriggered, CVariableBindingTriggerHash* varBindTriggerHash, CCalculationAlgorithmContextBase* calcAlgContext) { CVariableBindingDescriptor* nextVarBindDesTrigger = varBindDes; if (nextVarBindDesTrigger) { while (nextVarBindDesTrigger) { CVariableBinding* varBind = nextVarBindDesTrigger->getVariableBinding(); nextVarBindDesTrigger = nextVarBindDesTrigger->getNext(); if (!varBindTriggerHash->tryInsertVariableBindingTrigger(varBind->getBindedVariable(),varBind->getBindedIndividual(),varBindPathDes,nextVarBindDesTrigger,leftTriggered)) { } else { STATINC(VARBINDJOINTRIGGERINSTALLCOUNT,calcAlgContext); return true; } } } return false; } void CCalculationTableauCompletionTaskHandleAlgorithm::forceVariableBindingJoinCreated(CIndividualProcessNode* processIndi, CConceptDescriptor* joiningConDes, CConcept* joinConcept, CConceptDescriptor*& joinConDes, CDependencyTrackPoint* mergedDependencyTrackPoint, CVariableBindingPathSet*& varBindingPathSet, CConceptVariableBindingPathSetHash* varBindingPathSetHash, CCalculationAlgorithmContextBase* calcAlgContext) { if (!joinConDes) { joinConDes = addConceptToIndividualReturnConceptDescriptor(joinConcept,false,processIndi,mergedDependencyTrackPoint,false,false,calcAlgContext); } if (!varBindingPathSet) { varBindingPathSet = varBindingPathSetHash->getVariableBindingPathSet(joinConcept,true); varBindingPathSet->setConceptDescriptor(joinConDes); } } CVariableBindingPath* CCalculationTableauCompletionTaskHandleAlgorithm::getJoinedVariableBindingPath(CVariableBindingPath* leftVarBindPath, CVariableBindingPath* rightVarBindPath, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CVariableBindingPathMergingHash* varBindPathMergingHash = processingDataBox->getVariableBindingPathMergingHash(true); CVariableBindingPathMergingHashData* mergeHashData = varBindPathMergingHash->getMergedVariableBindingPathData(leftVarBindPath,rightVarBindPath); CVariableBindingPath* mergedVarBindPath = mergeHashData->getVariableBindingPath(); if (!mergedVarBindPath) { STATINC(VARBINDJOINCREATENEWCOUNT,calcAlgContext); CVariableBindingDescriptor* leftVarBindDesIt = leftVarBindPath->getVariableBindingDescriptorLinker(); CVariableBindingDescriptor* rightVarBindDesIt = rightVarBindPath->getVariableBindingDescriptorLinker(); CVariableBindingDescriptor* mergedVarBindDes = nullptr; CVariableBindingDescriptor* lastMergedVarBindDes = nullptr; while (leftVarBindDesIt || rightVarBindDesIt) { CVariableBindingDescriptor* nextMergedVarBindDes = nullptr; if (leftVarBindDesIt && rightVarBindDesIt) { bool leftLE = *leftVarBindDesIt->getVariableBinding() <= *rightVarBindDesIt->getVariableBinding(); bool rightLE = *rightVarBindDesIt->getVariableBinding() <= *leftVarBindDesIt->getVariableBinding(); if (leftLE && rightLE) { nextMergedVarBindDes = CObjectAllocator< CVariableBindingDescriptor >::allocateAndConstruct(taskMemMan); nextMergedVarBindDes->initVariableBindingDescriptor(leftVarBindDesIt->getVariableBinding()); leftVarBindDesIt = leftVarBindDesIt->getNext(); rightVarBindDesIt = rightVarBindDesIt->getNext(); } else if (rightLE) { nextMergedVarBindDes = CObjectAllocator< CVariableBindingDescriptor >::allocateAndConstruct(taskMemMan); nextMergedVarBindDes->initVariableBindingDescriptor(rightVarBindDesIt->getVariableBinding()); rightVarBindDesIt = rightVarBindDesIt->getNext(); } else if (leftLE) { nextMergedVarBindDes = CObjectAllocator< CVariableBindingDescriptor >::allocateAndConstruct(taskMemMan); nextMergedVarBindDes->initVariableBindingDescriptor(leftVarBindDesIt->getVariableBinding()); leftVarBindDesIt = leftVarBindDesIt->getNext(); } } else if (leftVarBindDesIt) { nextMergedVarBindDes = CObjectAllocator< CVariableBindingDescriptor >::allocateAndConstruct(taskMemMan); nextMergedVarBindDes->initVariableBindingDescriptor(leftVarBindDesIt->getVariableBinding()); leftVarBindDesIt = leftVarBindDesIt->getNext(); } else if (rightVarBindDesIt) { nextMergedVarBindDes = CObjectAllocator< CVariableBindingDescriptor >::allocateAndConstruct(taskMemMan); nextMergedVarBindDes->initVariableBindingDescriptor(rightVarBindDesIt->getVariableBinding()); rightVarBindDesIt = rightVarBindDesIt->getNext(); } if (nextMergedVarBindDes) { if (lastMergedVarBindDes) { lastMergedVarBindDes->setNext(nextMergedVarBindDes); lastMergedVarBindDes = nextMergedVarBindDes; } else { mergedVarBindDes = lastMergedVarBindDes = nextMergedVarBindDes; } } } mergedVarBindPath = CObjectAllocator< CVariableBindingPath >::allocateAndConstruct(taskMemMan); mergedVarBindPath->initVariableBindingPath(processingDataBox->getNextVariableBindingPathID(true),mergedVarBindDes); mergeHashData->setVariableBindingPath(mergedVarBindPath); } return mergedVarBindPath; } void CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEGROUNDINGRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CConcept* concept = conDes->getConcept(); bool negated = conDes->isNegated(); cint64 opCount = concept->getOperandCount(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CConceptVariableBindingPathSetHash* conVarBindPathSetHash = processIndi->getConceptVariableBindingPathSetHash(false); CVariableBindingPathSet* varBindPathSet = conVarBindPathSetHash->getVariableBindingPathSet(concept,false); STATINC(VARBINDRULEGROUNDINGAPPLICATIONCOUNT,calcAlgContext); if (varBindPathSet) { KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mBeforeGroundingDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext)); CPROCESSINGHASH* groundedConVarBindPathDesHash = nullptr; CSortedNegLinker* newGroundedLinker = mGroundingHandler->getGroundingConceptLinker(processIndi,varBindPathSet,concept,negated,groundedConVarBindPathDesHash,calcAlgContext); if (newGroundedLinker) { for (CSortedNegLinker* newGroundedLinkerIt = newGroundedLinker; newGroundedLinkerIt; newGroundedLinkerIt = newGroundedLinkerIt->getNext()) { STATINC(VARBINDGROUNDINGCOUNT,calcAlgContext); ++mStatVarBindingGroundingCount; CConcept* newGroundedCocnept = newGroundedLinkerIt->getData(); bool newGroundedConceptNegation = newGroundedLinkerIt->isNegated(); CDependencyTrackPoint* baseDependencyTrackPoint = nullptr; CDependency* additionalsDependencies = nullptr; // collect dependencies CPROCESSINGHASH::const_iterator it = groundedConVarBindPathDesHash->constFind(newGroundedCocnept), itEnd = groundedConVarBindPathDesHash->constEnd(); while (it != itEnd && it.key() == newGroundedCocnept) { CVariableBindingPathDescriptor* varBindPathDes = it.value(); CDependencyTrackPoint* propVarDepTrackPoint = varBindPathDes->getDependencyTrackPoint(); if (propVarDepTrackPoint) { if (!baseDependencyTrackPoint) { baseDependencyTrackPoint = propVarDepTrackPoint; } } ++it; } if (!baseDependencyTrackPoint) { baseDependencyTrackPoint = depTrackPoint; } CDependencyTrackPoint* nextDepTrackPoint = nullptr; CVARBINDPROPAGATEGROUNDINGDependencyNode* groundingDepNode = createVARBINDPROPAGATEGROUNDINGDependency(nextDepTrackPoint,processIndi,conDes,baseDependencyTrackPoint,additionalsDependencies,calcAlgContext); addConceptToIndividual(newGroundedCocnept,newGroundedConceptNegation,processIndi,nextDepTrackPoint,true,false,calcAlgContext); } } KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mAfterGroundingDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext)); } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyVARBINDPROPAGATEIMPLICATIONRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opLinker = concept->getOperandList(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CConceptDescriptor* bindingConDes = nullptr; CDependencyTrackPoint* bindingDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; CConcept* bindingTriggerConcept = opLinker->getData(); bool bindingTriggerConceptNegation = opLinker->isNegated(); CSortedNegLinker* triggerLinker = opLinker->getNext(); STATINC(VARBINDRULEIMPLICATIONAPPLICATIONCOUNT,calcAlgContext); if (!conSet->getConceptDescriptorAndReapplyQueue(bindingTriggerConcept,bindingConDes,bindingDepTrackPoint,reapplyQueue)) { // search next not existing trigger bool allTriggersAvailable = true; conSet = processIndi->getReapplyConceptLabelSet(true); CSortedNegLinker* triggerLinkerIt = nullptr; for (triggerLinkerIt = triggerLinker; triggerLinkerIt; triggerLinkerIt = triggerLinkerIt->getNext()) { CSortedNegLinker* nextTrigger = triggerLinkerIt; CConcept* triggerConcept = nextTrigger->getData(); CConceptDescriptor* triggerConDes = nullptr; CDependencyTrackPoint* triggerDepTrackPoint = nullptr; if (conSet->getConceptDescriptor(triggerConcept,triggerConDes,triggerDepTrackPoint)) { if (triggerConDes->isNegated() == nextTrigger->isNegated()) { return; } } else { allTriggersAvailable = false; break; } } if (!allTriggersAvailable) { // install to trigger CSortedNegLinker* nextTrigger = triggerLinkerIt; CConcept* triggerConcept = nextTrigger->getData(); bool triggerNegation = !nextTrigger->isNegated(); if (!isConceptInReapplyQueue(conDes,triggerConcept,triggerNegation,processIndi,calcAlgContext)) { addConceptToReapplyQueue(conDes,triggerConcept,triggerNegation,processIndi,(CProcessingRestrictionSpecification*)nullptr,depTrackPoint,calcAlgContext); } } else { CDependency* triggerDeps = nullptr; for (CSortedNegLinker* triggerLinkerIt = triggerLinker; triggerLinkerIt; triggerLinkerIt = triggerLinkerIt->getNext()) { CConcept* triggerConcept = triggerLinkerIt->getData(); CConceptDescriptor* triggerConDes = nullptr; CDependencyTrackPoint* triggerDepTrackPoint = nullptr; conSet->getConceptDescriptor(triggerConcept,triggerConDes,triggerDepTrackPoint); CCONNECTIONDependencyNode* connDep = createCONNECTIONDependency(processIndi,triggerConDes,triggerDepTrackPoint,calcAlgContext); connDep->setNext(triggerDeps); triggerDeps = connDep; } ++mStatVarBindingImplicationCount; CDependencyTrackPoint* nextDepTrackPoint = nullptr; CVARBINDPROPAGATEIMPLICATIONDependencyNode* implDepNode = createVARBINDPROPAGATEIMPLICATIONDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,triggerDeps,calcAlgContext); bindingConDes = addConceptToIndividualReturnConceptDescriptor(bindingTriggerConcept,bindingTriggerConceptNegation,processIndi,nextDepTrackPoint,true,false,calcAlgContext); CConceptVariableBindingPathSetHash* conVarBindingSetHash = processIndi->getConceptVariableBindingPathSetHash(true); CVariableBindingPathSet* prevVarBindingPathSet = conVarBindingSetHash->getVariableBindingPathSet(concept,false); CVariableBindingPathSet* varBindingPathSet = conVarBindingSetHash->getVariableBindingPathSet(bindingTriggerConcept,true); varBindingPathSet->setConceptDescriptor(bindingConDes); propagateInitialVariableBindings(processIndi,bindingConDes,varBindingPathSet,prevVarBindingPathSet,triggerDeps,calcAlgContext); } } else { CDependency* triggerDeps = nullptr; for (CSortedNegLinker* triggerLinkerIt = triggerLinker; triggerLinkerIt; triggerLinkerIt = triggerLinkerIt->getNext()) { CConcept* triggerConcept = triggerLinkerIt->getData(); CConceptDescriptor* triggerConDes = nullptr; CDependencyTrackPoint* triggerDepTrackPoint = nullptr; conSet->getConceptDescriptor(triggerConcept,triggerConDes,triggerDepTrackPoint); CCONNECTIONDependencyNode* connDep = createCONNECTIONDependency(processIndi,triggerConDes,triggerDepTrackPoint,calcAlgContext); connDep->setNext(triggerDeps); triggerDeps = connDep; } ++mStatVarBindingImplicationCount; CConceptVariableBindingPathSetHash* conVarBindingSetHash = processIndi->getConceptVariableBindingPathSetHash(true); CVariableBindingPathSet* prevVarBindingPathSet = conVarBindingSetHash->getVariableBindingPathSet(concept,false); CVariableBindingPathSet* varBindingPathSet = conVarBindingSetHash->getVariableBindingPathSet(bindingTriggerConcept,true); if (propagateFreshVariableBindings(processIndi,conDes,varBindingPathSet,prevVarBindingPathSet,triggerDeps,calcAlgContext)) { setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); cint64 bindingCount = varBindingPathSet->getVariableBindingPathMap()->count(); addConceptPreprocessedToProcessingQueue(bindingConDes,bindingDepTrackPoint,conProQueue,processIndi,bindingCount,calcAlgContext); if (!reapplyQueue->isEmpty()) { CCondensedReapplyQueueIterator reapplyQueueIt(conSet->getConceptReapplyIterator(bindingConDes)); applyReapplyQueueConcepts(processIndi,&reapplyQueueIt,calcAlgContext); } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEGROUNDINGRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CConcept* concept = conDes->getConcept(); bool negated = conDes->isNegated(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opConLinker = concept->getOperandList(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CConceptPropagationBindingSetHash* conPropBindSetHash = processIndi->getConceptPropagationBindingSetHash(false); CPropagationBindingSet* propBindSet = conPropBindSetHash->getPropagationBindingSet(concept,false); if (propBindSet) { STATINC(PBINDRULEGROUNDINGAPPLICATIONCOUNT,calcAlgContext); if (!opConLinker) { KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mBeforeGroundingDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext)); CPROCESSINGHASH* groundedConPropBindDesHash = nullptr; CPROCESSINGHASH* additionalPropBindDesHash = nullptr; CSortedNegLinker* newGroundedLinker = mGroundingHandler->getGroundingConceptLinker(processIndi,propBindSet,concept,negated,groundedConPropBindDesHash,additionalPropBindDesHash,calcAlgContext); if (newGroundedLinker) { for (CSortedNegLinker* newGroundedLinkerIt = newGroundedLinker; newGroundedLinkerIt; newGroundedLinkerIt = newGroundedLinkerIt->getNext()) { CConcept* newGroundedCocnept = newGroundedLinkerIt->getData(); bool newGroundedConceptNegation = newGroundedLinkerIt->isNegated(); STATINC(PBINDGROUNDINGCOUNT,calcAlgContext); CDependencyTrackPoint* baseDependencyTrackPoint = nullptr; CDependency* additionalsDependencies = nullptr; // collect dependencies CPROCESSINGHASH::const_iterator it = groundedConPropBindDesHash->constFind(newGroundedCocnept), itEnd = groundedConPropBindDesHash->constEnd(); while (it != itEnd && it.key() == newGroundedCocnept) { CPropagationBindingDescriptor* propBindDes = it.value(); CDependencyTrackPoint* propBindDepTrackPoint = propBindDes->getDependencyTrackPoint(); if (propBindDepTrackPoint) { if (!baseDependencyTrackPoint) { baseDependencyTrackPoint = propBindDepTrackPoint; } else { CPROPAGATECONNECTIONDependencyNode* connDep = createPROPAGATECONNECTIONDependency(nullptr,conDes,propBindDepTrackPoint,calcAlgContext); additionalsDependencies = connDep->append(additionalsDependencies); } } ++it; } for (CPROCESSINGHASH::const_iterator it = additionalPropBindDesHash->constBegin(), itEnd = additionalPropBindDesHash->constEnd(); it != itEnd; ++it) { CPropagationBindingDescriptor* propBindDes = *it; CDependencyTrackPoint* propBindDepTrackPoint = propBindDes->getDependencyTrackPoint(); if (propBindDepTrackPoint) { if (!baseDependencyTrackPoint) { baseDependencyTrackPoint = propBindDepTrackPoint; } else { CPROPAGATECONNECTIONDependencyNode* connDep = createPROPAGATECONNECTIONDependency(nullptr,conDes,propBindDepTrackPoint,calcAlgContext); additionalsDependencies = connDep->append(additionalsDependencies); } } } if (!baseDependencyTrackPoint) { baseDependencyTrackPoint = depTrackPoint; } CDependencyTrackPoint* nextDepTrackPoint = nullptr; CBINDPROPAGATEGROUNDINGDependencyNode* groundingDepNode = createBINDPROPAGATEGROUNDINGDependency(nextDepTrackPoint,processIndi,conDes,baseDependencyTrackPoint,additionalsDependencies,calcAlgContext); addConceptToIndividual(newGroundedCocnept,newGroundedConceptNegation,processIndi,nextDepTrackPoint,true,false,calcAlgContext); } } KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mAfterGroundingDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext)); } else { CPROCESSINGHASH* groundedConPropBindDesHash = nullptr; CPROCESSINGHASH* additionalPropBindDesHash = nullptr; CSortedNegLinker* newGroundedLinker = mGroundingHandler->getGroundingConceptLinker(processIndi,propBindSet,concept,negated,groundedConPropBindDesHash,additionalPropBindDesHash,calcAlgContext); if (newGroundedLinker) { for (CSortedNegLinker* opConLinkerIt = opConLinker; opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* bindingTriggerConcept = opConLinkerIt->getData(); bool bindingTriggerConceptNegation = opConLinkerIt->isNegated(); CConceptDescriptor* bindingConDes = nullptr; CDependencyTrackPoint* bindingDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; CPropagationBindingSet* prevPropBindingSet = propBindSet; CPropagationBindingSet* newPropBindingSet = conPropBindSetHash->getPropagationBindingSet(bindingTriggerConcept,true); bool createdBindConcept = false; bool doneBindPropagations = false; if (!conSet->getConceptDescriptorAndReapplyQueue(bindingTriggerConcept,bindingConDes,bindingDepTrackPoint,reapplyQueue)) { CConcept* newGroundedCocnept = newGroundedLinker->getData(); bool newGroundedConceptNegation = newGroundedLinker->isNegated(); CDependencyTrackPoint* baseDependencyTrackPoint = nullptr; CDependency* additionalsDependencies = nullptr; CPROCESSINGHASH::const_iterator it = groundedConPropBindDesHash->constFind(newGroundedCocnept), itEnd = groundedConPropBindDesHash->constEnd(); while (it != itEnd && it.key() == newGroundedCocnept) { CPropagationBindingDescriptor* propBindDes = it.value(); CDependencyTrackPoint* propBindDepTrackPoint = propBindDes->getDependencyTrackPoint(); if (propBindDepTrackPoint) { if (!baseDependencyTrackPoint) { baseDependencyTrackPoint = propBindDepTrackPoint; } else { CPROPAGATECONNECTIONDependencyNode* connDep = createPROPAGATECONNECTIONDependency(nullptr,conDes,propBindDepTrackPoint,calcAlgContext); additionalsDependencies = connDep->append(additionalsDependencies); } } ++it; } for (CPROCESSINGHASH::const_iterator it = additionalPropBindDesHash->constBegin(), itEnd = additionalPropBindDesHash->constEnd(); it != itEnd; ++it) { CPropagationBindingDescriptor* propBindDes = *it; CDependencyTrackPoint* propBindDepTrackPoint = propBindDes->getDependencyTrackPoint(); if (propBindDepTrackPoint) { if (!baseDependencyTrackPoint) { baseDependencyTrackPoint = propBindDepTrackPoint; } else { CPROPAGATECONNECTIONDependencyNode* connDep = createPROPAGATECONNECTIONDependency(nullptr,conDes,propBindDepTrackPoint,calcAlgContext); additionalsDependencies = connDep->append(additionalsDependencies); } } } if (!baseDependencyTrackPoint) { baseDependencyTrackPoint = depTrackPoint; } CDependencyTrackPoint* nextDepTrackPoint = nullptr; CBINDPROPAGATEGROUNDINGDependencyNode* groundingDepNode = createBINDPROPAGATEGROUNDINGDependency(nextDepTrackPoint,processIndi,conDes,baseDependencyTrackPoint,additionalsDependencies,calcAlgContext); bindingConDes = addConceptToIndividualReturnConceptDescriptor(bindingTriggerConcept,bindingTriggerConceptNegation,processIndi,nextDepTrackPoint,false,false,calcAlgContext); conSet = processIndi->getReapplyConceptLabelSet(true); createdBindConcept = true; } for (CSortedNegLinker* newGroundedLinkerIt = newGroundedLinker; newGroundedLinkerIt; newGroundedLinkerIt = newGroundedLinkerIt->getNext()) { CConcept* newGroundedCocnept = newGroundedLinkerIt->getData(); bool newGroundedConceptNegation = newGroundedLinkerIt->isNegated(); CPROCESSINGHASH::const_iterator it = groundedConPropBindDesHash->constFind(newGroundedCocnept), itEnd = groundedConPropBindDesHash->constEnd(); while (it != itEnd && it.key() == newGroundedCocnept) { CPropagationBindingDescriptor* propBindDes = it.value(); CPropagationBinding* propBinding = propBindDes->getPropagationBinding(); if (!newPropBindingSet->containsPropagationBinding(propBinding)) { STATINC(PBINDGROUNDINGCOUNT,calcAlgContext); CDependencyTrackPoint* propBindDepTrackPoint = propBindDes->getDependencyTrackPoint(); CDependencyTrackPoint* newDepTrackPoint = nullptr; CPROPAGATEBINDINGDependencyNode* bindDepNode = createPROPAGATEBINDINGDependency(newDepTrackPoint,processIndi,conDes,propBindDepTrackPoint,nullptr,calcAlgContext); CPropagationBindingDescriptor* newPropBindDes = CObjectAllocator::allocateAndConstruct(taskMemMan); newPropBindDes->initPropagationBindingDescriptor(propBinding,newDepTrackPoint); newPropBindingSet->addPropagationBinding(newPropBindDes,false); doneBindPropagations = true; } ++it; } for (CPROCESSINGHASH::const_iterator it = additionalPropBindDesHash->constBegin(), itEnd = additionalPropBindDesHash->constEnd(); it != itEnd; ++it) { CPropagationBindingDescriptor* propBindDes = *it; CDependencyTrackPoint* propBindDepTrackPoint = propBindDes->getDependencyTrackPoint(); CPropagationBinding* propBinding = propBindDes->getPropagationBinding(); if (!newPropBindingSet->containsPropagationBinding(propBinding)) { STATINC(PBINDGROUNDINGCOUNT,calcAlgContext); CDependencyTrackPoint* propBindDepTrackPoint = propBindDes->getDependencyTrackPoint(); CDependencyTrackPoint* newDepTrackPoint = nullptr; CPROPAGATEBINDINGDependencyNode* bindDepNode = createPROPAGATEBINDINGDependency(newDepTrackPoint,processIndi,conDes,propBindDepTrackPoint,nullptr,calcAlgContext); CPropagationBindingDescriptor* newPropBindDes = CObjectAllocator::allocateAndConstruct(taskMemMan); newPropBindDes->initPropagationBindingDescriptor(propBinding,newDepTrackPoint); newPropBindingSet->addPropagationBinding(newPropBindDes,false); doneBindPropagations = true; } } } if (doneBindPropagations) { if (!createdBindConcept) { if (propagateFreshPropagationBindings(processIndi,conDes,newPropBindingSet,prevPropBindingSet,nullptr,calcAlgContext)) { setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true);; addConceptPreprocessedToProcessingQueue(bindingConDes,bindingDepTrackPoint,conProQueue,processIndi,true,calcAlgContext); if (!reapplyQueue->isEmpty()) { CCondensedReapplyQueueIterator reapplyQueueIt(conSet->getConceptReapplyIterator(bindingConDes)); applyReapplyQueueConcepts(processIndi,&reapplyQueueIt,calcAlgContext); } } } } } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATECYCLERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CConcept* concept = conDes->getConcept(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opLinker = concept->getOperandList(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CConceptDescriptor* bindingConDes = nullptr; CDependencyTrackPoint* bindingDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; CConcept* bindingTriggerConcept = opLinker->getData(); bool bindingTriggerConceptNegation = opLinker->isNegated(); CSortedNegLinker* triggerLinker = opLinker->getNext(); CConcept* cycleTriggerConcept = triggerLinker->getData(); bool cycleTriggerConceptNegation = triggerLinker->isNegated(); CConceptDescriptor* cycleTriggerConDes = nullptr; CDependencyTrackPoint* cycleTriggerDepTrackPoint = nullptr; bool testCycleBindingClosed = false; bool addCycleCloseConcept = false; if (!conSet->getConceptDescriptorAndReapplyQueue(bindingTriggerConcept,bindingConDes,bindingDepTrackPoint,reapplyQueue)) { bool cycleTriggersAvailable = true; if (conSet->getConceptDescriptor(cycleTriggerConcept,cycleTriggerConDes,cycleTriggerDepTrackPoint)) { if (cycleTriggerConDes->isNegated() == cycleTriggerConceptNegation) { return; } } else { cycleTriggersAvailable = false; } if (cycleTriggersAvailable) { addCycleCloseConcept = true; testCycleBindingClosed = true; } } else { testCycleBindingClosed = true; } CPropagationBindingDescriptor* cycleTriggerConceptNewBindingDescriptor = nullptr; CPropagationBindingDescriptor* cyclePropagationConceptDescriptor = nullptr; CPropagationBindingSet* cycleTriggerConceptBindingSet = nullptr; CPropagationBindingSet* cyclePropConceptBindingSet = nullptr; CConceptPropagationBindingSetHash* conPropBindingSetHash = nullptr; CPropagationBinding* cycleTriggerConceptNewBinding = nullptr; bool cycleBindingPropagation = false; if (testCycleBindingClosed) { conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(false); if (conPropBindingSetHash) { cycleTriggerConceptBindingSet = conPropBindingSetHash->getPropagationBindingSet(cycleTriggerConcept,false); if (cycleTriggerConceptBindingSet) { cycleTriggerConceptNewBindingDescriptor = cycleTriggerConceptBindingSet->getNewSepcialPropagationBindingDescriptor(); cycleTriggerConceptNewBinding = cycleTriggerConceptNewBindingDescriptor->getPropagationBinding(); cint64 bindingID = cycleTriggerConceptNewBinding->getPropagationID(); cyclePropConceptBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,false); if (cyclePropConceptBindingSet) { cyclePropagationConceptDescriptor = cyclePropConceptBindingSet->getPropagationBindingDescriptor(cycleTriggerConceptNewBinding); if (cyclePropagationConceptDescriptor) { cycleBindingPropagation = true; } } } } } bool propagations = false; if (cycleBindingPropagation) { STATINC(PBINDRULECYCLEAPPLICATIONCOUNT,calcAlgContext); if (addCycleCloseConcept) { conSet = processIndi->getReapplyConceptLabelSet(true); CBINDPROPAGATECYCLEDependencyNode* cycleDepNode = createBINDPROPAGATECYCLEDependency(bindingDepTrackPoint,processIndi,conDes,cyclePropagationConceptDescriptor->getDependencyTrackPoint(),cycleTriggerConceptNewBindingDescriptor->getDependencyTrackPoint(),calcAlgContext); bindingConDes = addConceptToIndividualReturnConceptDescriptor(bindingTriggerConcept,bindingTriggerConceptNegation,processIndi,bindingDepTrackPoint,true,false,calcAlgContext); } // propagate bindings CPropagationBindingMap* cyclePropConceptBindingMap = cyclePropConceptBindingSet->getPropagationBindingMap(); CPropagationBindingMap* cycleTriggerConceptBindingMap = cycleTriggerConceptBindingSet->getPropagationBindingMap(); CPropagationBindingMap::iterator itCycle = cyclePropConceptBindingMap->begin(), itCycleEnd = cyclePropConceptBindingMap->end(); CPropagationBindingMap::iterator itTrigger = cycleTriggerConceptBindingMap->begin(), itTriggerEnd = cycleTriggerConceptBindingMap->end(); CPropagationBindingSet* newPropBindSet = conPropBindingSetHash->getPropagationBindingSet(bindingTriggerConcept,false); CPropagationBindingMap* newPropBindMap = nullptr; CPropagationBindingDescriptor* newPropBindDesLinker = nullptr; if (newPropBindSet) { newPropBindMap = newPropBindSet->getPropagationBindingMap(); } while (itCycle != itCycleEnd) { cint64 cycleID = itCycle.key(); cint64 triggerID = -1; if (itTrigger != itTriggerEnd) { triggerID = itTrigger.key(); } if (triggerID != -1 && triggerID < cycleID) { ++itTrigger; } else if (triggerID == cycleID) { if (!newPropBindSet || !newPropBindSet->containsPropagationBinding(cycleID)) { STATINC(PBINDCYCLEPROPAGATECOUNT,calcAlgContext); if (!newPropBindSet) { newPropBindSet = conPropBindingSetHash->getPropagationBindingSet(bindingTriggerConcept,true); newPropBindMap = newPropBindSet->getPropagationBindingMap(); newPropBindSet->setConceptDescriptor(bindingConDes); } CPropagationBindingMapData& cyclePropBindMapData = itCycle.value(); CPropagationBindingDescriptor* cyclePropBindDes = cyclePropBindMapData.getPropagationBindingDescriptor(); CPropagationBindingMapData& triggerPropBindMapData = itTrigger.value(); CPropagationBindingDescriptor* triggerPropBindDes = triggerPropBindMapData.getPropagationBindingDescriptor(); CPROPAGATECONNECTIONDependencyNode* connDep1 = createPROPAGATECONNECTIONDependency(nullptr,cycleTriggerConceptBindingSet->getConceptDescriptor(),triggerPropBindDes->getDependencyTrackPoint(),calcAlgContext); CPROPAGATECONNECTIONDependencyNode* connDep2 = createPROPAGATECONNECTIONDependency(nullptr,conDes,cyclePropagationConceptDescriptor->getDependencyTrackPoint(),calcAlgContext); CDependency* connDep = connDep1->setNext(connDep2); CDependencyTrackPoint* newDepTrackPoint = nullptr; CPROPAGATEBINDINGDependencyNode* bindDepNode = createPROPAGATEBINDINGDependency(newDepTrackPoint,processIndi,conDes,cyclePropBindDes->getDependencyTrackPoint(),connDep,calcAlgContext); CPropagationBinding* propBinding = cyclePropBindDes->getPropagationBinding(); CPropagationBindingDescriptor* newPropBindDes = CObjectAllocator::allocateAndConstruct(taskMemMan); newPropBindDes->initPropagationBindingDescriptor(propBinding,newDepTrackPoint); CPropagationBindingMapData& data = (*newPropBindMap)[propBinding->getPropagationID()]; data.setPropagationBindingDescriptor(newPropBindDes); CPropagationBindingReapplyConceptDescriptor* reapplyDes = data.getReapplyConceptDescriptor(); if (reapplyDes) { applyReapplyQueueConcepts(processIndi,reapplyDes,calcAlgContext); } newPropBindDesLinker = newPropBindDes->append(newPropBindDesLinker); propagations = true; } ++itCycle; ++itTrigger; } else { if (!newPropBindSet || !newPropBindSet->containsPropagationBinding(cycleID)) { CPropagationBindingMapData& cyclePropBindMapData = itCycle.value(); CPropagationBindingDescriptor* cyclePropBindDes = cyclePropBindMapData.getPropagationBindingDescriptor(); CPropagationBinding* propBinding = cyclePropBindDes->getPropagationBinding(); CIndividualProcessNode* bindedIndiNode = propBinding->getBindedIndividual(); CConceptDescriptor* bindedConDes = propBinding->getBindedConceptDescriptor(); bindedIndiNode = getUpToDateIndividual(bindedIndiNode,calcAlgContext); bindedIndiNode = getCorrectedMergedIntoIndividualNode(bindedIndiNode,calcAlgContext); CConceptPropagationBindingSetHash* bindedIndiConPropBindingSetHash = bindedIndiNode->getConceptPropagationBindingSetHash(false); if (bindedIndiConPropBindingSetHash) { CPropagationBindingSet* bindedIndiConPropBindingSet = bindedIndiConPropBindingSetHash->getPropagationBindingSet(bindedConDes->getConcept(),false); if (bindedIndiConPropBindingSet) { CPropagationBindingDescriptor* triggerPropBindDes = bindedIndiConPropBindingSet->getPropagationBindingDescriptor(cycleTriggerConceptNewBinding); if (triggerPropBindDes) { STATINC(PBINDCYCLEPROPAGATECOUNT,calcAlgContext); if (!newPropBindSet) { newPropBindSet = conPropBindingSetHash->getPropagationBindingSet(bindingTriggerConcept,true); newPropBindMap = newPropBindSet->getPropagationBindingMap(); } // do propagation CPROPAGATECONNECTIONDependencyNode* connDep1 = createPROPAGATECONNECTIONDependency(bindedIndiNode,cycleTriggerConceptBindingSet->getConceptDescriptor(),triggerPropBindDes->getDependencyTrackPoint(),calcAlgContext); CPROPAGATECONNECTIONDependencyNode* connDep2 = createPROPAGATECONNECTIONDependency(nullptr,conDes,cyclePropagationConceptDescriptor->getDependencyTrackPoint(),calcAlgContext); CDependency* connDep = connDep1->setNext(connDep2); CDependencyTrackPoint* newDepTrackPoint = nullptr; CPROPAGATEBINDINGDependencyNode* bindDepNode = createPROPAGATEBINDINGDependency(newDepTrackPoint,processIndi,conDes,cyclePropBindDes->getDependencyTrackPoint(),connDep,calcAlgContext); CPropagationBindingDescriptor* newPropBindDes = CObjectAllocator::allocateAndConstruct(taskMemMan); newPropBindDes->initPropagationBindingDescriptor(propBinding,newDepTrackPoint); CPropagationBindingMapData& data = (*newPropBindMap)[propBinding->getPropagationID()]; data.setPropagationBindingDescriptor(newPropBindDes); CPropagationBindingReapplyConceptDescriptor* reapplyDes = data.getReapplyConceptDescriptor(); if (reapplyDes) { applyReapplyQueueConcepts(processIndi,reapplyDes,calcAlgContext); } newPropBindDesLinker = newPropBindDes->append(newPropBindDesLinker); propagations = true; } else { // install rule reapplication if variable bindings will change TIndividualConceptPair indiConPair(bindedIndiNode->getIndividualID(),concept); CPropagationBindingReapplyConceptHash* reapplyHash = bindedIndiConPropBindingSet->getPropagationBindingReapplyConceptHash(false); if (reapplyHash) { if (!reapplyHash->hasPropagationBindingReapplyConceptDescriptor(indiConPair)) { STATINC(PBINDCYCLEREAPPLYINSTALLCOUNT,calcAlgContext); bindedIndiNode = getLocalizedIndividual(bindedIndiNode,false,calcAlgContext); bindedIndiConPropBindingSetHash = bindedIndiNode->getConceptPropagationBindingSetHash(true); bindedIndiConPropBindingSet = bindedIndiConPropBindingSetHash->getPropagationBindingSet(bindedConDes->getConcept(),true); CPropagationBindingReapplyConceptDescriptor* propBindReapplyConDes = CObjectAllocator::allocateAndConstruct(taskMemMan); propBindReapplyConDes->initReapllyDescriptor(processIndi,cycleTriggerConceptNewBinding,conDes,depTrackPoint); bindedIndiConPropBindingSet->addPropagationBindingReapplyConceptDescriptor(propBindReapplyConDes); } } } } } } ++itCycle; } } if (newPropBindSet && newPropBindDesLinker) { newPropBindSet->addPropagationBindingDescriptorLinker(newPropBindDesLinker); } } if (propagations && !addCycleCloseConcept) { setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true);; addConceptPreprocessedToProcessingQueue(bindingConDes,bindingDepTrackPoint,conProQueue,processIndi,true,calcAlgContext); if (!reapplyQueue->isEmpty()) { CCondensedReapplyQueueIterator reapplyQueueIt(conSet->getConceptReapplyIterator(bindingConDes)); applyReapplyQueueConcepts(processIndi,&reapplyQueueIt,calcAlgContext); } } if (!isConceptInReapplyQueue(conDes,cycleTriggerConcept,!cycleTriggerConceptNegation,processIndi,calcAlgContext)) { addConceptToReapplyQueue(conDes,cycleTriggerConcept,!cycleTriggerConceptNegation,processIndi,(CProcessingRestrictionSpecification*)nullptr,depTrackPoint,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::propagatePropagationBindingsToSuccessor(CIndividualProcessNode* processIndi, CIndividualProcessNode*& succIndi, CSortedNegLinker* conceptOpLinker, bool negate, CConceptDescriptor* conDes, CIndividualLinkEdge* restLink, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CDependencyTrackPoint* depTrackPoint = conDes->getDependencyTrackPoint(); CConcept* concept = conDes->getConcept(); succIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); CReapplyConceptLabelSet* conSet = succIndi->getReapplyConceptLabelSet(false); // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; bool continuePropagation = false; for (CSortedNegLinker* conceptOpLinkerIt = conceptOpLinker; conceptOpLinkerIt; conceptOpLinkerIt = conceptOpLinkerIt->getNext()) { CConcept* opConcept = conceptOpLinkerIt->getData(); bool opConNeg = conceptOpLinkerIt->isNegated() ^ negate; CConceptDescriptor* bindingConDes = nullptr; CDependencyTrackPoint* bindingDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; if (!conSet->getConceptDescriptorAndReapplyQueue(opConcept,bindingConDes,bindingDepTrackPoint,reapplyQueue)) { if (!nextDepTrackPoint) { conSet = processIndi->getReapplyConceptLabelSet(true); CBINDPROPAGATEALLDependencyNode* bindDepNode = createBINDPROPAGATEALLDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,restLink->getDependencyTrackPoint(),calcAlgContext); } bindingConDes = addConceptToIndividualReturnConceptDescriptor(opConcept,opConNeg,succIndi,nextDepTrackPoint,false,false,calcAlgContext); CConceptPropagationBindingSetHash* conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(true); CPropagationBindingSet* prevPropBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,false); CConceptPropagationBindingSetHash* succConPropBindingSetHash = succIndi->getConceptPropagationBindingSetHash(true); CPropagationBindingSet* propBindingSet = succConPropBindingSetHash->getPropagationBindingSet(opConcept,true); propBindingSet->setConceptDescriptor(bindingConDes); propagateInitialPropagationBindingsToSuccessor(processIndi,succIndi,bindingConDes,propBindingSet,prevPropBindingSet,restLink,calcAlgContext); continuePropagation = true; } else { CConceptPropagationBindingSetHash* conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(true); CPropagationBindingSet* prevPropBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,false); CConceptPropagationBindingSetHash* succConPropBindingSetHash = succIndi->getConceptPropagationBindingSetHash(true); CPropagationBindingSet* propBindingSet = succConPropBindingSetHash->getPropagationBindingSet(opConcept,true); if (propagateFreshPropagationBindingsToSuccessor(processIndi,succIndi,conDes,propBindingSet,prevPropBindingSet,restLink,calcAlgContext)) { setIndividualNodeConceptLabelSetModified(succIndi,calcAlgContext); CConceptProcessingQueue* conProQueue = succIndi->getConceptProcessingQueue(true);; addConceptPreprocessedToProcessingQueue(bindingConDes,bindingDepTrackPoint,conProQueue,succIndi,true,calcAlgContext); if (!reapplyQueue->isEmpty()) { CCondensedReapplyQueueIterator reapplyQueueIt(conSet->getConceptReapplyIterator(bindingConDes)); applyReapplyQueueConcepts(succIndi,&reapplyQueueIt,calcAlgContext); } continuePropagation = true; } } } if (continuePropagation) { addIndividualToProcessingQueue(succIndi,calcAlgContext); } } bool CCalculationTableauCompletionTaskHandleAlgorithm::propagateInitialPropagationBindingsToSuccessor(CIndividualProcessNode*& processIndi, CIndividualProcessNode* succIndi, CConceptDescriptor* conDes, CPropagationBindingSet* newPropBindingSet, CPropagationBindingSet* prevPropBindingSet, CIndividualLinkEdge* restLink, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); bool propagations = false; CPropagationBindingDescriptor* newPropBindDesLinker = nullptr; if (prevPropBindingSet) { propagations |= newPropBindingSet->adoptPropagateAllFlag(prevPropBindingSet); newPropBindingSet->copyPropagationBindings(prevPropBindingSet->getPropagationBindingMap()); CPropagationBindingMap* propBindMap = newPropBindingSet->getPropagationBindingMap(); for (CPropagationBindingMap::iterator it = propBindMap->begin(), itEnd = propBindMap->end(); it != itEnd; ++it) { STATINC(PBINDPROPAGATEDCOUNT,calcAlgContext); STATINC(PBINDPROPAGATEDINITIALCOUNT,calcAlgContext); CPropagationBindingMapData& propBindMapData = it.value(); propBindMapData.clearReapplyConceptDescriptor(); CPropagationBindingDescriptor* prevPropBindDes = propBindMapData.getPropagationBindingDescriptor(); CPropagationBindingDescriptor* newPropBindDes = CObjectAllocator::allocateAndConstruct(taskMemMan); CDependencyTrackPoint* newDepTrackPoint = nullptr; CPROPAGATEBINDINGSSUCCESSORDependencyNode* bindDepNode = createPROPAGATEBINDINGSSUCCESSORDependency(newDepTrackPoint,processIndi,conDes,prevPropBindDes->getDependencyTrackPoint(),restLink->getDependencyTrackPoint(),calcAlgContext); newPropBindDes->initPropagationBindingDescriptor(prevPropBindDes->getPropagationBinding(),newDepTrackPoint); propBindMapData.setPropagationBindingDescriptor(newPropBindDes); newPropBindDesLinker = newPropBindDes->append(newPropBindDesLinker); propagations = true; } if (newPropBindDesLinker) { newPropBindingSet->addPropagationBindingDescriptorLinker(newPropBindDesLinker); } } return propagations; } bool CCalculationTableauCompletionTaskHandleAlgorithm::propagateFreshPropagationBindingsToSuccessor(CIndividualProcessNode*& processIndi, CIndividualProcessNode* succIndi, CConceptDescriptor* conDes, CPropagationBindingSet* newPropBindingSet, CPropagationBindingSet* prevPropBindingSet, CIndividualLinkEdge* restLink, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); bool propagations = false; if (prevPropBindingSet) { propagations |= newPropBindingSet->adoptPropagateAllFlag(prevPropBindingSet); CPropagationBindingMap* prevPropBindMap = prevPropBindingSet->getPropagationBindingMap(); CPropagationBindingMap* newPropBindMap = newPropBindingSet->getPropagationBindingMap(); CPropagationBindingMap::iterator itNew = newPropBindMap->begin(); CPropagationBindingMap::const_iterator itPrev = prevPropBindMap->constBegin(), itPrevEnd = prevPropBindMap->constEnd(); CPropagationBindingDescriptor* newPropBindDesLinker = nullptr; while (itPrev != itPrevEnd) { cint64 prevPropID = itPrev.key(); bool doPropagation = false; bool updateExisting = false; if (itNew == newPropBindMap->end()) { doPropagation = true; } else { cint64 newPropID = itNew.key(); if (newPropID < prevPropID) { ++itNew; } else if (newPropID == prevPropID) { if (!itNew.value().hasPropagationBindingDescriptor()) { doPropagation = true; updateExisting = true; } else { ++itNew; ++itPrev; } } else { doPropagation = true; } } if (doPropagation) { STATINC(PBINDPROPAGATEDCOUNT,calcAlgContext); STATINC(PBINDPROPAGATEDFRESHCOUNT,calcAlgContext); const CPropagationBindingMapData& prevPropBindMapData = itPrev.value(); CPropagationBindingDescriptor* prevPropBindDes = prevPropBindMapData.getPropagationBindingDescriptor(); CPropagationBindingDescriptor* newPropBindDes = CObjectAllocator::allocateAndConstruct(taskMemMan); CDependencyTrackPoint* newDepTrackPoint = nullptr; CPROPAGATEBINDINGSSUCCESSORDependencyNode* bindDepNode = createPROPAGATEBINDINGSSUCCESSORDependency(newDepTrackPoint,processIndi,conDes,prevPropBindDes->getDependencyTrackPoint(),restLink->getDependencyTrackPoint(),calcAlgContext); CPropagationBinding* propBinding = prevPropBindDes->getPropagationBinding(); newPropBindDes->initPropagationBindingDescriptor(propBinding,newDepTrackPoint); if (updateExisting) { CPropagationBindingMapData& data = (*newPropBindMap)[propBinding->getPropagationID()]; data.setPropagationBindingDescriptor(newPropBindDes); CPropagationBindingReapplyConceptDescriptor* reapplyDes = data.getReapplyConceptDescriptor(); if (reapplyDes) { applyReapplyQueueConcepts(succIndi,reapplyDes,calcAlgContext); } } else { itNew = newPropBindMap->insert(propBinding->getPropagationID(),CPropagationBindingMapData(newPropBindDes)); } newPropBindDesLinker = newPropBindDes->append(newPropBindDesLinker); propagations = true; } } if (newPropBindDesLinker) { newPropBindingSet->addPropagationBindingDescriptorLinker(newPropBindDesLinker); } } return propagations; } void CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEALLRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opLinker = concept->getOperandList(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CSortedNegLinker* conceptOpLinker = concept->getOperandList(); STATINC(PBINDRULEALLAPPLICATIONCOUNT,calcAlgContext); CIndividualLinkEdge* restLink = getLinkProcessingRestriction(conProDes); if (restLink) { CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,restLink,calcAlgContext); propagatePropagationBindingsToSuccessor(processIndi,succIndi,opLinker,negate,conDes,restLink,calcAlgContext); } else { CReapplyRoleSuccessorHash* roleSuccHash = processIndi->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { CRoleSuccessorLinkIterator roleSuccIt = roleSuccHash->getRoleSuccessorLinkIterator(role); while (roleSuccIt.hasNext()) { CIndividualLinkEdge* link = roleSuccIt.next(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); propagatePropagationBindingsToSuccessor(processIndi,succIndi,opLinker,negate,conDes,link,calcAlgContext); } } } if (!conProDes->isConceptReapplied()) { if (!isConceptInReapplyQueue(conDes,role,processIndi,calcAlgContext)) { addConceptToReapplyQueue(conDes,role,processIndi,true,depTrackPoint,calcAlgContext); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEIMPLICATIONRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opLinker = concept->getOperandList(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); STATINC(PBINDRULEIMPLICATIONAPPLICATIONCOUNT,calcAlgContext); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CConceptDescriptor* bindingConDes = nullptr; CDependencyTrackPoint* bindingDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; CConcept* bindingTriggerConcept = opLinker->getData(); bool bindingTriggerConceptNegation = opLinker->isNegated(); CSortedNegLinker* triggerLinker = opLinker->getNext(); if (!conSet->getConceptDescriptorAndReapplyQueue(bindingTriggerConcept,bindingConDes,bindingDepTrackPoint,reapplyQueue)) { // search next not existing trigger bool allTriggersAvailable = true; conSet = processIndi->getReapplyConceptLabelSet(true); CSortedNegLinker* triggerLinkerIt = nullptr; for (triggerLinkerIt = triggerLinker; triggerLinkerIt; triggerLinkerIt = triggerLinkerIt->getNext()) { CSortedNegLinker* nextTrigger = triggerLinkerIt; CConcept* triggerConcept = nextTrigger->getData(); CConceptDescriptor* triggerConDes = nullptr; CDependencyTrackPoint* triggerDepTrackPoint = nullptr; if (conSet->getConceptDescriptor(triggerConcept,triggerConDes,triggerDepTrackPoint)) { if (triggerConDes->isNegated() == nextTrigger->isNegated()) { return; } } else { allTriggersAvailable = false; break; } } if (!allTriggersAvailable) { // install to trigger CSortedNegLinker* nextTrigger = triggerLinkerIt; CConcept* triggerConcept = nextTrigger->getData(); bool triggerNegation = !nextTrigger->isNegated(); if (!isConceptInReapplyQueue(conDes,triggerConcept,triggerNegation,processIndi,calcAlgContext)) { addConceptToReapplyQueue(conDes,triggerConcept,triggerNegation,processIndi,(CProcessingRestrictionSpecification*)nullptr,depTrackPoint,calcAlgContext); } } else { CDependency* triggerDeps = nullptr; for (CSortedNegLinker* triggerLinkerIt = triggerLinker; triggerLinkerIt; triggerLinkerIt = triggerLinkerIt->getNext()) { CConcept* triggerConcept = triggerLinkerIt->getData(); CConceptDescriptor* triggerConDes = nullptr; CDependencyTrackPoint* triggerDepTrackPoint = nullptr; conSet->getConceptDescriptor(triggerConcept,triggerConDes,triggerDepTrackPoint); CCONNECTIONDependencyNode* connDep = createCONNECTIONDependency(processIndi,triggerConDes,triggerDepTrackPoint,calcAlgContext); connDep->setNext(triggerDeps); triggerDeps = connDep; } CDependencyTrackPoint* nextDepTrackPoint = nullptr; CBINDPROPAGATEIMPLICATIONDependencyNode* implDepNode = createBINDPROPAGATEIMPLICATIONDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,triggerDeps,calcAlgContext); bindingConDes = addConceptToIndividualReturnConceptDescriptor(bindingTriggerConcept,bindingTriggerConceptNegation,processIndi,nextDepTrackPoint,true,false,calcAlgContext); CConceptPropagationBindingSetHash* conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(true); CPropagationBindingSet* prevPropBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,false); CPropagationBindingSet* propBindingSet = conPropBindingSetHash->getPropagationBindingSet(bindingTriggerConcept,true); propBindingSet->setConceptDescriptor(bindingConDes); propagateInitialPropagationBindings(processIndi,bindingConDes,propBindingSet,prevPropBindingSet,triggerDeps,calcAlgContext); } } else { CDependency* triggerDeps = nullptr; for (CSortedNegLinker* triggerLinkerIt = triggerLinker; triggerLinkerIt; triggerLinkerIt = triggerLinkerIt->getNext()) { CConcept* triggerConcept = triggerLinkerIt->getData(); CConceptDescriptor* triggerConDes = nullptr; CDependencyTrackPoint* triggerDepTrackPoint = nullptr; conSet->getConceptDescriptor(triggerConcept,triggerConDes,triggerDepTrackPoint); CCONNECTIONDependencyNode* connDep = createCONNECTIONDependency(processIndi,triggerConDes,triggerDepTrackPoint,calcAlgContext); connDep->setNext(triggerDeps); triggerDeps = connDep; } CConceptPropagationBindingSetHash* conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(true); CPropagationBindingSet* prevPropBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,false); CPropagationBindingSet* propBindingSet = conPropBindingSetHash->getPropagationBindingSet(bindingTriggerConcept,true); if (propagateFreshPropagationBindings(processIndi,conDes,propBindingSet,prevPropBindingSet,triggerDeps,calcAlgContext)) { setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true);; addConceptPreprocessedToProcessingQueue(bindingConDes,bindingDepTrackPoint,conProQueue,processIndi,true,calcAlgContext); if (!reapplyQueue->isEmpty()) { CCondensedReapplyQueueIterator reapplyQueueIt(conSet->getConceptReapplyIterator(bindingConDes)); applyReapplyQueueConcepts(processIndi,&reapplyQueueIt,calcAlgContext); } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEANDRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { propagatePropagationBindings(processIndi,conProDes,negate,false,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDPROPAGATEANDFLAGALLRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { ++mStatBackPropActivationCount; propagatePropagationBindings(processIndi,conProDes,negate,true,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::propagatePropagationBindings(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, bool propagateAllFlag, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool conceptNegation = negate; CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CSortedNegLinker* opConLinker = concept->getOperandList(); STATINC(PBINDRULEANDAPPLICATIONCOUNT,calcAlgContext); CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CDependencyTrackPoint* nextDepTrackPoint = nullptr; for (CSortedNegLinker* opConLinkerIt = opConLinker; opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* bindingTriggerConcept = opConLinkerIt->getData(); bool bindingTriggerConceptNegation = opConLinkerIt->isNegated()^conceptNegation; CConceptDescriptor* bindingConDes = nullptr; CDependencyTrackPoint* bindingDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; if (!conSet->getConceptDescriptorAndReapplyQueue(bindingTriggerConcept,bindingConDes,bindingDepTrackPoint,reapplyQueue)) { if (!nextDepTrackPoint) { conSet = processIndi->getReapplyConceptLabelSet(true); CBINDPROPAGATEANDDependencyNode* bindDepNode = createBINDPROPAGATEANDDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,calcAlgContext); } bindingConDes = addConceptToIndividualReturnConceptDescriptor(bindingTriggerConcept,bindingTriggerConceptNegation,processIndi,nextDepTrackPoint,false,false,calcAlgContext); CConceptPropagationBindingSetHash* conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(true); CPropagationBindingSet* prevPropBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,false); CPropagationBindingSet* propBindingSet = conPropBindingSetHash->getPropagationBindingSet(bindingTriggerConcept,true); propBindingSet->setConceptDescriptor(bindingConDes); if (propagateAllFlag) { propBindingSet->setPropagateAllFlag(true); } propagateInitialPropagationBindings(processIndi,bindingConDes,propBindingSet,prevPropBindingSet,nullptr,calcAlgContext); } else { CConceptPropagationBindingSetHash* conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(true); CPropagationBindingSet* prevPropBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,false); CPropagationBindingSet* propBindingSet = conPropBindingSetHash->getPropagationBindingSet(bindingTriggerConcept,true); if (propagateFreshPropagationBindings(processIndi,conDes,propBindingSet,prevPropBindingSet,nullptr,calcAlgContext) || propagateAllFlag && !propBindingSet->hasPropagateAllFlag()) { if (propagateAllFlag) { propBindingSet->setPropagateAllFlag(true); } setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true);; addConceptPreprocessedToProcessingQueue(bindingConDes,bindingDepTrackPoint,conProQueue,processIndi,true,calcAlgContext); if (!reapplyQueue->isEmpty()) { CCondensedReapplyQueueIterator reapplyQueueIt(conSet->getConceptReapplyIterator(bindingConDes)); applyReapplyQueueConcepts(processIndi,&reapplyQueueIt,calcAlgContext); } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyBINDVARIABLERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CVariable* variable = concept->getVariable(); bool conceptNegation = negate; CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CSortedNegLinker* opConLinker = concept->getOperandList(); CConcept* bindingTriggerConcept = opConLinker->getData(); bool bindingTriggerConceptNegation = opConLinker->isNegated(); CProcessContext* processContext = calcAlgContext->getUsedProcessContext(); CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CConceptDescriptor* bindingConDes = nullptr; CDependencyTrackPoint* bindingDepTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; STATINC(PBINDRULEBINDNAPPLICATIONCOUNT,calcAlgContext); if (!conSet->getConceptDescriptorAndReapplyQueue(bindingTriggerConcept,bindingConDes,bindingDepTrackPoint,reapplyQueue)) { STATINC(PBINDVARIABLEBINDCOUNT,calcAlgContext); CDependencyTrackPoint* nextDepTrackPoint = nullptr; CBINDVARIABLEDependencyNode* bindDepNode = createBINDVARIABLEDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,calcAlgContext); conSet = processIndi->getReapplyConceptLabelSet(true); bindingConDes = addConceptToIndividualReturnConceptDescriptor(bindingTriggerConcept,bindingTriggerConceptNegation,processIndi,nextDepTrackPoint,false,false,calcAlgContext); CConceptPropagationBindingSetHash* conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(true); CPropagationBindingSet* prevPropBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,false); CPropagationBindingSet* propBindingSet = conPropBindingSetHash->getPropagationBindingSet(bindingTriggerConcept,true); propBindingSet->setConceptDescriptor(bindingConDes); propagateInitialPropagationBindings(processIndi,bindingConDes,propBindingSet,prevPropBindingSet,nullptr,calcAlgContext); CPropagationBinding* propVarBinding = CObjectAllocator::allocateAndConstruct(taskMemMan); cint64 nextPropBindingID = procDataBox->getNextBindingPropagationID(true); propVarBinding->initPropagationBinding(nextPropBindingID,nextDepTrackPoint,processIndi,bindingConDes,variable); CPropagationBindingDescriptor* propBindDes = CObjectAllocator::allocateAndConstruct(taskMemMan); propBindDes->initPropagationBindingDescriptor(propVarBinding,nextDepTrackPoint); propBindingSet->addPropagationBinding(propBindDes,true); } else { CConceptPropagationBindingSetHash* conPropBindingSetHash = processIndi->getConceptPropagationBindingSetHash(true); CPropagationBindingSet* prevPropBindingSet = conPropBindingSetHash->getPropagationBindingSet(concept,false); CPropagationBindingSet* propBindingSet = conPropBindingSetHash->getPropagationBindingSet(bindingTriggerConcept,true); bool newVarBindCreated = false; if (!propBindingSet->getNewSepcialPropagationBindingDescriptor()) { STATINC(PBINDVARIABLEBINDCOUNT,calcAlgContext); CDependencyTrackPoint* nextDepTrackPoint = nullptr; CBINDVARIABLEDependencyNode* bindDepNode = createBINDVARIABLEDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,calcAlgContext); CPropagationBinding* propVarBinding = CObjectAllocator::allocateAndConstruct(taskMemMan); cint64 nextPropBindingID = procDataBox->getNextBindingPropagationID(true); propVarBinding->initPropagationBinding(nextPropBindingID,nextDepTrackPoint,processIndi,bindingConDes,variable); CPropagationBindingDescriptor* propBindDes = CObjectAllocator::allocateAndConstruct(taskMemMan); propBindDes->initPropagationBindingDescriptor(propVarBinding,nextDepTrackPoint); propBindingSet->addPropagationBinding(propBindDes,true); newVarBindCreated = true; } if (propagateFreshPropagationBindings(processIndi,conDes,propBindingSet,prevPropBindingSet,nullptr,calcAlgContext) || newVarBindCreated) { setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true);; addConceptPreprocessedToProcessingQueue(bindingConDes,bindingDepTrackPoint,conProQueue,processIndi,true,calcAlgContext); if (!reapplyQueue->isEmpty()) { CCondensedReapplyQueueIterator reapplyQueueIt(conSet->getConceptReapplyIterator(bindingConDes)); applyReapplyQueueConcepts(processIndi,&reapplyQueueIt,calcAlgContext); } } } } bool CCalculationTableauCompletionTaskHandleAlgorithm::propagateInitialPropagationBindings(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CPropagationBindingSet* newPropBindingSet, CPropagationBindingSet* prevPropBindingSet, CDependency* otherDependencies, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); bool propagations = false; CPropagationBindingDescriptor* newPropBindDesLinker = nullptr; if (prevPropBindingSet) { propagations |= newPropBindingSet->adoptPropagateAllFlag(prevPropBindingSet); newPropBindingSet->copyPropagationBindings(prevPropBindingSet->getPropagationBindingMap()); CPropagationBindingMap* propBindMap = newPropBindingSet->getPropagationBindingMap(); for (CPropagationBindingMap::iterator it = propBindMap->begin(), itEnd = propBindMap->end(); it != itEnd; ++it) { STATINC(PBINDPROPAGATEDCOUNT,calcAlgContext); STATINC(PBINDPROPAGATEDINITIALCOUNT,calcAlgContext); CPropagationBindingMapData& propBindMapData = it.value(); propBindMapData.clearReapplyConceptDescriptor(); CPropagationBindingDescriptor* prevPropBindDes = propBindMapData.getPropagationBindingDescriptor(); CPropagationBindingDescriptor* newPropBindDes = CObjectAllocator::allocateAndConstruct(taskMemMan); CDependencyTrackPoint* newDepTrackPoint = nullptr; CPROPAGATEBINDINGDependencyNode* bindDepNode = createPROPAGATEBINDINGDependency(newDepTrackPoint,processIndi,conDes,prevPropBindDes->getDependencyTrackPoint(),otherDependencies,calcAlgContext); newPropBindDes->initPropagationBindingDescriptor(prevPropBindDes->getPropagationBinding(),newDepTrackPoint); propBindMapData.setPropagationBindingDescriptor(newPropBindDes); newPropBindDesLinker = newPropBindDes->append(newPropBindDesLinker); propagations = true; } if (newPropBindDesLinker) { newPropBindingSet->addPropagationBindingDescriptorLinker(newPropBindDesLinker); } } return propagations; } bool CCalculationTableauCompletionTaskHandleAlgorithm::propagateFreshPropagationBindings(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CPropagationBindingSet* newPropBindingSet, CPropagationBindingSet* prevPropBindingSet, CDependency* otherDependencies, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); bool propagations = false; if (prevPropBindingSet) { propagations |= newPropBindingSet->adoptPropagateAllFlag(prevPropBindingSet); CPropagationBindingMap* prevPropBindMap = prevPropBindingSet->getPropagationBindingMap(); CPropagationBindingMap* newPropBindMap = newPropBindingSet->getPropagationBindingMap(); CPropagationBindingMap::iterator itNew = newPropBindMap->begin(); CPropagationBindingMap::const_iterator itPrev = prevPropBindMap->constBegin(), itPrevEnd = prevPropBindMap->constEnd(); CPropagationBindingDescriptor* newPropBindDesLinker = nullptr; while (itPrev != itPrevEnd) { cint64 prevPropID = itPrev.key(); bool doPropagation = false; bool updateExisting = false; if (itNew == newPropBindMap->end()) { doPropagation = true; } else { cint64 newPropID = itNew.key(); if (newPropID < prevPropID) { ++itNew; } else if (newPropID == prevPropID) { if (!itNew.value().hasPropagationBindingDescriptor()) { doPropagation = true; updateExisting = true; } else { ++itNew; ++itPrev; } } else { doPropagation = true; } } if (doPropagation) { STATINC(PBINDPROPAGATEDCOUNT,calcAlgContext); STATINC(PBINDPROPAGATEDFRESHCOUNT,calcAlgContext); const CPropagationBindingMapData& prevPropBindMapData = itPrev.value(); CPropagationBindingDescriptor* prevPropBindDes = prevPropBindMapData.getPropagationBindingDescriptor(); CPropagationBindingDescriptor* newPropBindDes = CObjectAllocator::allocateAndConstruct(taskMemMan); CDependencyTrackPoint* newDepTrackPoint = nullptr; CPROPAGATEBINDINGDependencyNode* bindDepNode = createPROPAGATEBINDINGDependency(newDepTrackPoint,processIndi,conDes,prevPropBindDes->getDependencyTrackPoint(),otherDependencies,calcAlgContext); CPropagationBinding* propBinding = prevPropBindDes->getPropagationBinding(); newPropBindDes->initPropagationBindingDescriptor(propBinding,newDepTrackPoint); if (updateExisting) { CPropagationBindingMapData& data = (*newPropBindMap)[propBinding->getPropagationID()]; data.setPropagationBindingDescriptor(newPropBindDes); CPropagationBindingReapplyConceptDescriptor* reapplyDes = data.getReapplyConceptDescriptor(); if (reapplyDes) { applyReapplyQueueConcepts(processIndi,reapplyDes,calcAlgContext); } } else { itNew = newPropBindMap->insert(propBinding->getPropagationID(),CPropagationBindingMapData(newPropBindDes)); } newPropBindDesLinker = newPropBindDes->append(newPropBindDesLinker); propagations = true; } } if (newPropBindDesLinker) { newPropBindingSet->addPropagationBindingDescriptorLinker(newPropBindDesLinker); } } return propagations; } void CCalculationTableauCompletionTaskHandleAlgorithm::applyReapplyQueueConcepts(CIndividualProcessNode*& processIndi, CPropagationBindingReapplyConceptDescriptor* reapplyDesLinker, CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingRestrictionSpecification* procRest = nullptr; for (CPropagationBindingReapplyConceptDescriptor* reapplyDesLinkerIt = reapplyDesLinker; reapplyDesLinkerIt; reapplyDesLinkerIt = reapplyDesLinkerIt->getNext()) { STATINC(PBINDREAPPLICATIONCOUNT,calcAlgContext); CPropagationBindingReapplyConceptDescriptor* reapplyDes = reapplyDesLinkerIt; CConceptDescriptor* conDes = reapplyDes->getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint = conDes->getDependencyTrackPoint(); CIndividualProcessNode* indiNode = reapplyDes->getReapllyIndividualNode(); CIndividualProcessNode* locIndiNode = indiNode; if (processIndi->getIndividualID() != indiNode->getIndividualID()) { locIndiNode = getLocalizedIndividual(indiNode,true,calcAlgContext); } CConceptProcessingQueue* conProQueue = locIndiNode->getConceptProcessingQueue(true); addConceptRestrictedToProcessingQueue(conDes,depTrackPoint,conProQueue,locIndiNode,false,nullptr,calcAlgContext); if (processIndi->getIndividualID() != indiNode->getIndividualID()) { addIndividualToProcessingQueue(locIndiNode,calcAlgContext); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyDATATYPERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); //mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); //QFile file(QString("debug-model.txt")); //if (file.open(QIODevice::WriteOnly)) { // file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); //} if (mDatatypeHandler && mConfDatatypeReasoning) { mDatatypeHandler->addDatatype(processIndi,concept,negate,depTrackPoint,calcAlgContext); } if (!negate || concept->getOperandCount() <= 1) { applyANDRule(processIndi,conProDes,negate,calcAlgContext); } else { applyORRule(processIndi,conProDes,negate,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyDATARESTRICTIONRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); //mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); //QFile file(QString("debug-model.txt")); //if (file.open(QIODevice::WriteOnly)) { // file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); //} if (mDatatypeHandler && mConfDatatypeReasoning) { mDatatypeHandler->addDataRestriction(processIndi,concept,negate,depTrackPoint,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyDATALITERALRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CDataLiteral* dataLiteral = concept->getDataLiteral(); if (dataLiteral) { CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); //mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); //QFile file(QString("debug-model.txt")); //if (file.open(QIODevice::WriteOnly)) { // file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); //} if (mDatatypeHandler && mConfDatatypeReasoning) { mDatatypeHandler->addDataLiteral(processIndi,dataLiteral,negate,depTrackPoint,calcAlgContext); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyBOTTOMRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { ++mAppliedANDRuleCount; STATINC(ANDRULEAPPLICATIONCOUNT,calcAlgContext); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CConcept* topConcept = calcAlgContext->getProcessingDataBox()->getOntologyTopConcept(); // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CANDDependencyNode* andDepNode = createANDDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,calcAlgContext); addConceptToIndividual(topConcept,true,processIndi,nextDepTrackPoint,true,false,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::applyANDRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { ++mAppliedANDRuleCount; STATINC(ANDRULEAPPLICATIONCOUNT,calcAlgContext); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool conceptNegation = negate; CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CANDDependencyNode* andDepNode = createANDDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,calcAlgContext); CSortedNegLinker* opConLinkerIt = concept->getOperandList(); addConceptsToIndividual(opConLinkerIt,conceptNegation,processIndi,nextDepTrackPoint,true,false,nullptr,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::isGeneratingConceptSatisfiableCachedAbsorpable(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* ancestorIndiNode = getAncestorIndividual(processIndi,calcAlgContext); if (ancestorIndiNode) { CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { bool superRoleNeg = superRoleIt->isNegated(); if (!superRoleNeg) { CRole* superRole = superRoleIt->getData(); if (processIndi->hasRoleSuccessorToIndividual(superRole,ancestorIndiNode,true)) { if (superRole->isFunctional()) { return false; } // check additional for ATMOST restriction CReapplyRoleSuccessorHash* reapplyRoleSuccHash = processIndi->getReapplyRoleSuccessorHash(false); CReapplyQueueIterator reapplyQueueIt = reapplyRoleSuccHash->getRoleReapplyIterator(superRole,false); while (reapplyQueueIt.hasNext()) { CReapplyConceptDescriptor* reapplyConceptDes = reapplyQueueIt.next(); CConceptDescriptor* reapplyConDes = reapplyConceptDes->getConceptDescriptor(); CConcept* reapplyConcept = reapplyConDes->getConcept(); bool reapplyConNeg = reapplyConDes->getNegation(); cint64 opCode = reapplyConcept->getOperatorCode(); if (opCode == CCATMOST || opCode == CCATLEAST) { cint64 cardinality = concept->getParameter() + 1*reapplyConNeg; if (cardinality <= 1) { return false; } } } } } superRoleIt = superRoleIt->getNext(); } } return true; } void CCalculationTableauCompletionTaskHandleAlgorithm::applySOMERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); CIndividualSaturationProcessNode* saturationNode = getCreationSuccessorSaturationNode(processIndi,conDes,calcAlgContext); if (!conceptOpLinkerIt->hasNext()) { if (!conceptOpLinkerIt->isNegated()^negate || (saturationNode && saturationNode->hasNominalIntegrated())) { CConcept* nominalConcept = conceptOpLinkerIt->getData(); if (nominalConcept->getOperatorCode() == CCNOMINAL || (saturationNode && saturationNode->hasNominalIntegrated())) { STATINC(VALUERULEAPPLICATIONCOUNT,calcAlgContext); CIndividual* indi = nominalConcept->getNominalIndividual(); bool saturationIntegrateNominal = false; if (nominalConcept->getOperatorCode() != CCNOMINAL && saturationNode && saturationNode->hasNominalIntegrated()) { indi = saturationNode->getIntegratedNominalIndividual(); saturationIntegrateNominal = true; } CIndividualProcessNode* nominalIndi = getCorrectedNominalIndividualNode(indi->getIndividualID(),calcAlgContext); CIndividualProcessNode* locNominalIndi = getLocalizedIndividual(nominalIndi,false,calcAlgContext); // force initialized if (locNominalIndi != processIndi) { locNominalIndi = getForcedInitializedNominalIndividualNode(locNominalIndi,calcAlgContext); } CReapplyConceptLabelSet* locNominalNodeConSet = locNominalIndi->getReapplyConceptLabelSet(true); CConcept* nominalConcept = indi->getIndividualNominalConcept(); CConceptDescriptor* nominalConDes = nullptr; CDependencyTrackPoint* nominalConDepTrackPoint = nullptr; if (indi->getIndividualID() != locNominalIndi->getIndividualID()) { locNominalNodeConSet->getConceptDescriptor(nominalConcept,nominalConDes,nominalConDepTrackPoint); } if (!hasIndividualsLink(processIndi,locNominalIndi,role,true,calcAlgContext)) { // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CVALUEDependencyNode* valueDepNode = createVALUEDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,nominalConDepTrackPoint,calcAlgContext); if (saturationIntegrateNominal) { if (!locNominalIndi->getReapplyConceptLabelSet(false)->containsConcept(conceptOpLinkerIt->getData(),conceptOpLinkerIt->isNegated()^negate)) { addConceptsToIndividual(conceptOpLinkerIt,negate,locNominalIndi,nextDepTrackPoint,true,true,nullptr,calcAlgContext); } } // create link createNewIndividualsLinksReapplyed(processIndi,locNominalIndi,role->getIndirectSuperRoleList(),role,nextDepTrackPoint,true,calcAlgContext); //propagateIndividualNodeNominalConnectionToAncestors(processIndi,calcAlgContext); if (!processIndi->isNominalIndividual()) { propagateIndividualNodeNominalConnectionStatusToAncestors(processIndi,locNominalIndi,calcAlgContext); } propagateIndividualNodeModified(locNominalIndi,calcAlgContext); addIndividualToProcessingQueue(locNominalIndi,calcAlgContext); } else { if (saturationIntegrateNominal) { if (!locNominalIndi->getReapplyConceptLabelSet(false)->containsConcept(conceptOpLinkerIt->getData(),conceptOpLinkerIt->isNegated()^negate)) { CDependencyTrackPoint* nextDepTrackPoint = nullptr; CVALUEDependencyNode* valueDepNode = createVALUEDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,nominalConDepTrackPoint,calcAlgContext); addConceptsToIndividual(conceptOpLinkerIt,negate,locNominalIndi,nextDepTrackPoint,true,true,nullptr,calcAlgContext); } } } return; } } } STATINC(SOMERULEAPPLICATIONCOUNT,calcAlgContext); CIndividualProcessNode* alreadyExistSuitableSuccessor = getRoleSuccessorWithConcepts(processIndi,role,conceptOpLinkerIt,negate,calcAlgContext); if (!alreadyExistSuitableSuccessor) { if (mConfSatExpCachedSuccAbsorp && processIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATISFIABLECACHED | CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED | CIndividualProcessNode::PRFSATURATIONSUCCESSORCREATIONBLOCKINGCACHED)) { if (isGeneratingConceptSatisfiableCachedAbsorpable(processIndi,conDes,calcAlgContext)) { STATINC(SATCACHEDABSORBEDGENERATINGCONCEPTSCOUNT,calcAlgContext); return addSatisfiableCachedAbsorbedGeneratingConcept(conDes,processIndi,depTrackPoint,calcAlgContext); } } ++mAppliedSOMERuleCount; STATINC(SEPARATESUCCESSORINDINODECREATIONCOUNT,calcAlgContext); if (calcAlgContext->getUsedUnsatisfiableCacheRetrievalStrategy()->testUnsatisfiableCacheForSuccessorGeneration(conProDes,processIndi)) { testIndividualNodeUnsatisfiableCached(processIndi,calcAlgContext); } // generate new role successor CIndividualProcessNode* succIndi = tryExtendFunctionalSuccessorIndividual(processIndi,conDes,role->getIndirectSuperRoleList(),role,conceptOpLinkerIt,negate,depTrackPoint,saturationNode,calcAlgContext); if (!succIndi) { succIndi = createSuccessorIndividual(processIndi,conDes,role->getIndirectSuperRoleList(),role,conceptOpLinkerIt,negate,depTrackPoint,saturationNode,calcAlgContext); if (processIndi->isNominalIndividual() && processIndi->getIndividualNominalLevel() <= 0) { succIndi->setExtendedQueueProcessing(true); } } // check for backward dependencies if (processIndi->isIndividualAncestor(succIndi)) { if (mConfSatExpCachedSuccAbsorp && processIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATISFIABLECACHED | CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED | CIndividualProcessNode::PRFSATURATIONSUCCESSORCREATIONBLOCKINGCACHED)) { reapplySatisfiableCachedAbsorbedGeneratingConcepts(processIndi,calcAlgContext); } CXLinker* newBackwardDepLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); newBackwardDepLinker->initLinker(processIndi); succIndi->addSuccessorIndividualNodeBackwardDependencyLinker(newBackwardDepLinker); processIndi->setBackwardDependencyToAncestorIndividualNode(true); if (succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { //propagateIndividualNodeNominalConnectionToAncestors(processIndi,calcAlgContext); if (!processIndi->isNominalIndividual()) { propagateIndividualNodeNominalConnectionStatusToAncestors(processIndi,succIndi,calcAlgContext); } } } addIndividualToProcessingQueue(succIndi,calcAlgContext); if (mConfAnywhereBlockingSomeInitializationHashing) { addIndividualNodeCandidateForConcept(succIndi,conceptOpLinkerIt,negate,calcAlgContext); } } else { // check for backward dependencies if (processIndi->isIndividualAncestor(alreadyExistSuitableSuccessor)) { CIndividualProcessNode* locAncestorIndiNode = getLocalizedIndividual(alreadyExistSuitableSuccessor,false,calcAlgContext); CXLinker* newBackwardDepLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); newBackwardDepLinker->initLinker(processIndi); locAncestorIndiNode->addSuccessorIndividualNodeBackwardDependencyLinker(newBackwardDepLinker); processIndi->setBackwardDependencyToAncestorIndividualNode(true); if (locAncestorIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { //propagateIndividualNodeNominalConnectionToAncestors(processIndi,calcAlgContext); if (!processIndi->isNominalIndividual()) { propagateIndividualNodeNominalConnectionStatusToAncestors(processIndi,locAncestorIndiNode,calcAlgContext); } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::addReverseRoleAssertion(CIndividualProcessNode*& processIndi, CReverseRoleAssertionLinker* reverseRoleAssertionLinker, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(VALUERULEAPPLICATIONCOUNT,calcAlgContext); CRole* role = reverseRoleAssertionLinker->getRole(); CIndividual* indi = reverseRoleAssertionLinker->getIndividual(); if (indi) { if (!mOptIncrementalCompatibleExpansion || isNominalIndividualNodeAvailable(indi->getIndividualID(),calcAlgContext)) { CIndividualProcessNode* nominalIndi = getCorrectedNominalIndividualNode(indi->getIndividualID(),calcAlgContext); if (nominalIndi && (!nominalIndi->hasRoleAssertionsInitialized() || processIndi->getRoleAssertionCreationID() > nominalIndi->getRoleAssertionCreationID())) { CIndividualProcessNode* locNominalIndi = getLocalizedIndividual(nominalIndi,false,calcAlgContext); if (locNominalIndi != processIndi) { locNominalIndi = getForcedInitializedNominalIndividualNode(locNominalIndi,calcAlgContext); } CDependencyTrackPoint* nominalConDepTrackPoint = nullptr; if (indi->getIndividualID() != locNominalIndi->getIndividualID()) { nominalConDepTrackPoint = locNominalIndi->getIndividualMergingHash(false)->value(indi); } if (!hasIndividualsLink(locNominalIndi,processIndi,role,true,calcAlgContext)) { // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CROLEASSERTIONDependencyNode* roleAssDepNode = createROLEASSERTIONDependency(nextDepTrackPoint,processIndi,depTrackPoint,nominalConDepTrackPoint,calcAlgContext); // create link createNewIndividualsLinksReapplyed(locNominalIndi,processIndi,role->getIndirectSuperRoleList(),role,nextDepTrackPoint,true,calcAlgContext); propagateIndividualNodeModified(locNominalIndi,calcAlgContext); addIndividualToProcessingQueue(locNominalIndi,calcAlgContext); } } } else if (mOptIncrementalCompatibleExpansion) { for (CSortedNegLinker* roleLinkerIt = role->getIndirectSuperRoleList(); roleLinkerIt; roleLinkerIt = roleLinkerIt->getNext()) { CRole* role = roleLinkerIt->getData(); bool invRole = roleLinkerIt->isNegated(); CSortedNegLinker* domainConLinkerIt = role->getDomainRangeConceptList(!invRole); if (domainConLinkerIt) { addConceptsToIndividual(domainConLinkerIt,false,processIndi,depTrackPoint,true,false,nullptr,calcAlgContext); } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::addRoleAssertion(CIndividualProcessNode*& processIndi, CRoleAssertionLinker* roleAssertionLinker, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(VALUERULEAPPLICATIONCOUNT,calcAlgContext); CRole* role = roleAssertionLinker->getRole(); CIndividual* indi = roleAssertionLinker->getIndividual(); if (indi) { if (!mOptIncrementalCompatibleExpansion || isNominalIndividualNodeAvailable(indi->getIndividualID(),calcAlgContext)) { CIndividualProcessNode* nominalIndi = getCorrectedNominalIndividualNode(indi->getIndividualID(),calcAlgContext); if (nominalIndi && (!nominalIndi->hasReverseRoleAssertionsInitialized() || processIndi->getRoleAssertionCreationID() > nominalIndi->getRoleAssertionCreationID())) { CIndividualProcessNode* locNominalIndi = getLocalizedIndividual(nominalIndi,false,calcAlgContext); if (locNominalIndi != processIndi) { locNominalIndi = getForcedInitializedNominalIndividualNode(locNominalIndi,calcAlgContext); } CDependencyTrackPoint* nominalConDepTrackPoint = nullptr; if (indi->getIndividualID() != locNominalIndi->getIndividualID()) { nominalConDepTrackPoint = locNominalIndi->getIndividualMergingHash(false)->value(indi); } if (!hasIndividualsLink(processIndi,locNominalIndi,role,true,calcAlgContext)) { // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CROLEASSERTIONDependencyNode* roleAssDepNode = createROLEASSERTIONDependency(nextDepTrackPoint,processIndi,depTrackPoint,nominalConDepTrackPoint,calcAlgContext); // create link createNewIndividualsLinksReapplyed(processIndi,locNominalIndi,role->getIndirectSuperRoleList(),role,nextDepTrackPoint,true,calcAlgContext); propagateIndividualNodeModified(locNominalIndi,calcAlgContext); addIndividualToProcessingQueue(locNominalIndi,calcAlgContext); } } } else if (mOptIncrementalCompatibleExpansion) { for (CSortedNegLinker* roleLinkerIt = role->getIndirectSuperRoleList(); roleLinkerIt; roleLinkerIt = roleLinkerIt->getNext()) { CRole* role = roleLinkerIt->getData(); bool invRole = roleLinkerIt->isNegated(); CSortedNegLinker* domainConLinkerIt = role->getDomainRangeConceptList(invRole); if (domainConLinkerIt) { addConceptsToIndividual(domainConLinkerIt,false,processIndi,depTrackPoint,true,false,nullptr,calcAlgContext); } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyVALUERule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(VALUERULEAPPLICATIONCOUNT,calcAlgContext); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CIndividual* indi = concept->getNominalIndividual(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); if (indi) { CIndividualProcessNode* nominalIndi = getCorrectedNominalIndividualNode(indi->getIndividualID(),calcAlgContext); CIndividualProcessNode* locNominalIndi = getLocalizedIndividual(nominalIndi,false,calcAlgContext); // force initialized if (locNominalIndi != processIndi) { locNominalIndi = getForcedInitializedNominalIndividualNode(locNominalIndi,calcAlgContext); } CDependencyTrackPoint* nominalConDepTrackPoint = nullptr; if (indi->getIndividualID() != locNominalIndi->getIndividualID()) { nominalConDepTrackPoint = locNominalIndi->getIndividualMergingHash(false)->value(indi); } if (!negate) { if (!hasIndividualsLink(processIndi,locNominalIndi,role,true,calcAlgContext)) { // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CVALUEDependencyNode* valueDepNode = createVALUEDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,nominalConDepTrackPoint,calcAlgContext); // create link createNewIndividualsLinksReapplyed(processIndi,locNominalIndi,role->getIndirectSuperRoleList(),role,nextDepTrackPoint,true,calcAlgContext); //propagateIndividualNodeNominalConnectionToAncestors(processIndi,calcAlgContext); if (!processIndi->isNominalIndividual()) { propagateIndividualNodeNominalConnectionStatusToAncestors(processIndi,locNominalIndi,calcAlgContext); } propagateIndividualNodeModified(locNominalIndi,calcAlgContext); addIndividualToProcessingQueue(locNominalIndi,calcAlgContext); } } else { // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CNEGVALUEDependencyNode* negValueDepNode = createNEGVALUEDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,nominalConDepTrackPoint,calcAlgContext); // create negation/disjoint link createIndividualNodeNegationLink(processIndi,locNominalIndi,role,nextDepTrackPoint,calcAlgContext); //propagateIndividualNodeNominalConnectionToAncestors(processIndi,calcAlgContext); if (!processIndi->isNominalIndividual()) { propagateIndividualNodeNominalConnectionStatusToAncestors(processIndi,locNominalIndi,calcAlgContext); } addIndividualToProcessingQueue(locNominalIndi,calcAlgContext); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyFUNCTIONALRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(FUNCTIONALRULEAPPLICATIONCOUNT,calcAlgContext); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); bool reapplied = conProDes->isConceptReapplied(); CRoleSuccessorLinkIterator roleSuccIt(processIndi->getRoleSuccessorLinkIterator(role)); CIndividualProcessNode* firstSuccNode = nullptr; CIndividualLinkEdge* firstLink = nullptr; CDependencyTrackPoint* nnRequireDepTrackPoint = nullptr; bool nominalNode = processIndi->isNominalIndividual(); bool requiresNNRule = false; bool hasAlreadyMergingNominal = false; if (nominalNode && roleSuccIt.hasNext()) { // has to apply NN-rule? CRoleSuccessorLinkIterator checkNNRoleSuccIt(roleSuccIt); while (!hasAlreadyMergingNominal && checkNNRoleSuccIt.hasNext()) { CIndividualLinkEdge* link = checkNNRoleSuccIt.next(); if (!requiresNNRule) { if (link->getCreatorIndividualID() != processIndi->getIndividualID()) { requiresNNRule = true; nnRequireDepTrackPoint = link->getDependencyTrackPoint(); } } if (!hasAlreadyMergingNominal) { CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); if (succIndi->isNominalIndividual()) { hasAlreadyMergingNominal = true; firstSuccNode = succIndi; firstLink = link; } } } } if (!hasAlreadyMergingNominal) { if (requiresNNRule) { createNominalsSuccessorIndividuals(processIndi,role->getIndirectSuperRoleList(),role,conceptOpLinkerIt,false,nnRequireDepTrackPoint,1,calcAlgContext); CRoleSuccessorLinkIterator lastRoleSuccIt = processIndi->getRoleSuccessorHistoryLinkIterator(role,nullptr); if (lastRoleSuccIt.hasNext()) { CIndividualLinkEdge* link = lastRoleSuccIt.next(); CIndividualProcessNode* nominalSuccIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); firstSuccNode = nominalSuccIndi; firstLink = link; } } else { while (!firstSuccNode && roleSuccIt.hasNext()) { firstLink = roleSuccIt.next(); if (roleSuccIt.hasNext()) { CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,firstLink,calcAlgContext); firstSuccNode = succIndi; } } } } if (firstSuccNode) { CIndividualProcessNode* locFirstSuccNode = nullptr; while (roleSuccIt.hasNext()) { CIndividualLinkEdge* link = roleSuccIt.next(); if (link != firstLink) { CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); CClashedDependencyDescriptor* clashDescriptors = nullptr; if (isIndividualNodesMergeable(firstSuccNode,succIndi,clashDescriptors,calcAlgContext)) { setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); if (!locFirstSuccNode) { locFirstSuccNode = getLocalizedIndividual(firstSuccNode,link,calcAlgContext); firstSuccNode = locFirstSuccNode; } CIndividualProcessNode* locSuccIndiNode = getLocalizedIndividual(succIndi,false,calcAlgContext); // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CFUNCTIONALDependencyNode* funcDepNode = createFUNCTIONALDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,firstLink->getDependencyTrackPoint(),link->getDependencyTrackPoint(),calcAlgContext); // merge to first successor locFirstSuccNode = getMergedIndividualNodes(locFirstSuccNode,locSuccIndiNode,nextDepTrackPoint,calcAlgContext); if (locFirstSuccNode == locSuccIndiNode) { firstLink = link; } if (mConfSatExpCachedSuccAbsorp && processIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATISFIABLECACHED | CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED | CIndividualProcessNode::PRFSATURATIONSUCCESSORCREATIONBLOCKINGCACHED)) { if (locFirstSuccNode == getAncestorIndividual(processIndi,calcAlgContext)) { reapplySatisfiableCachedAbsorbedGeneratingConcepts(processIndi,calcAlgContext); } } } else { // clash clashDescriptors = createClashedConceptDescriptor(clashDescriptors,processIndi,conDes,depTrackPoint,calcAlgContext); clashDescriptors = createIndividualMergeCausingDescriptors(clashDescriptors,firstSuccNode,firstLink,nullptr,calcAlgContext); clashDescriptors = createIndividualMergeCausingDescriptors(clashDescriptors,succIndi,link,nullptr,calcAlgContext); throw CCalculationClashProcessingException(clashDescriptors); } } } } if (!reapplied) { CDependencyTrackPoint* contDepTrackPoint = depTrackPoint; addConceptToReapplyQueue(conDes,role,processIndi,true,contDepTrackPoint,calcAlgContext); } } bool CCalculationTableauCompletionTaskHandleAlgorithm::hasIdenticalConceptOperands(CSortedNegLinker* opConLinker1, CSortedNegLinker* opConLinker2) { if (opConLinker1->getCount() != opConLinker2->getCount()) { return false; } for (CSortedNegLinker* opConLinker1It = opConLinker1; opConLinker1It; opConLinker1It = opConLinker1It->getNext()) { CConcept* con1 = opConLinker1It->getData(); bool neg1 = opConLinker1It->isNegated(); bool foundOperand = false; for (CSortedNegLinker* opConLinker2It = opConLinker2; opConLinker2It && !foundOperand; opConLinker2It = opConLinker2It->getNext()) { CConcept* con2 = opConLinker2It->getData(); bool neg2 = opConLinker2It->isNegated(); if (con1 == con2 && neg1 == neg2) { foundOperand = true; } } if (!foundOperand) { return false; } } for (CSortedNegLinker* opConLinker2It = opConLinker2; opConLinker2It; opConLinker2It = opConLinker2It->getNext()) { CConcept* con1 = opConLinker2It->getData(); bool neg1 = opConLinker2It->isNegated(); bool foundOperand = false; for (CSortedNegLinker* opConLinker1It = opConLinker1; opConLinker1It && !foundOperand; opConLinker1It = opConLinker1It->getNext()) { CConcept* con2 = opConLinker1It->getData(); bool neg2 = opConLinker1It->isNegated(); if (con1 == con2 && neg1 == neg2) { foundOperand = true; } } if (!foundOperand) { return false; } } return true; } void CCalculationTableauCompletionTaskHandleAlgorithm::applyATMOSTRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(ATMOSTRULEAPPLICATIONCOUNT,calcAlgContext); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CProcessContext* processContext = calcAlgContext->getUsedProcessContext(); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); CProcessingRestrictionSpecification* procRest = conProDes->getProcessingRestrictionSpecification(); cint64 cardinality = concept->getParameter() - 1*negate; bool installReapplication = false; if (cardinality < 0) { // clash CClashedDependencyDescriptor* clashConDesLinker = nullptr; clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,conDes,depTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(clashConDesLinker); } if (cardinality == 1 && !conceptOpLinkerIt) { return applyFUNCTIONALRule(processIndi,conProDes,negate,calcAlgContext); } if (mConfSatExpCachedMergAbsorp && processIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATISFIABLECACHED | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED)) { STATINC(SATCACHEDABSORBEDMERGINGCONCEPTSCOUNT,calcAlgContext); return addSatisfiableCachedAbsorbedDisjunctionConcept(conDes,processIndi,procRest,depTrackPoint,calcAlgContext); } CReapplyRoleSuccessorHash* roleSuccHash = processIndi->getReapplyRoleSuccessorHash(false); CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest = nullptr; CRoleSuccessorLinkIterator roleSuccIt; CIndividualLinkEdge* usingLastLink = nullptr; cint64 linkCount = 0; if (!procRest) { if (roleSuccHash) { roleSuccIt = roleSuccHash->getRoleSuccessorLinkIterator(role,&linkCount,usingLastLink); } if (!roleSuccIt.hasNext()) { // no need for merging } else if (cardinality <= 0 && !conceptOpLinkerIt) { // clash CClashedDependencyDescriptor* clashConDesLinker = nullptr; clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,conDes,depTrackPoint,calcAlgContext); CIndividualLinkEdge* link = roleSuccIt.next(false); clashConDesLinker = createClashedIndividualLinkDescriptor(clashConDesLinker,link,link->getDependencyTrackPoint(),calcAlgContext); throw CCalculationClashProcessingException(clashConDesLinker); } if (mConfAtleastAtmostFastClashCheck) { CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); if (conSet) { CConceptDescriptor* conDesIt = conSet->getAddingSortedConceptDescriptionLinker(); while (conDesIt) { CConcept* atleastConcept = conDesIt->getData(); bool conNegated = conDesIt->isNegated(); cint64 opCode = atleastConcept->getOperatorCode(); if (!conNegated && (opCode == CCATLEAST) || conNegated && (opCode == CCATMOST)) { cint64 param = atleastConcept->getParameter(); cint64 atleastCardinality = param + 1*conNegated; if (atleastCardinality > cardinality && (hasIdenticalConceptOperands(atleastConcept->getOperandList(),conceptOpLinkerIt) || !conceptOpLinkerIt)) { CRole* atmostRole = role; CRole* atleastRole = atleastConcept->getRole(); CSortedNegLinker* superRoleIt = atleastRole->getIndirectSuperRoleList(); while (superRoleIt) { if (!superRoleIt->isNegated()) { if (superRoleIt->getData() == atmostRole) { CClashedDependencyDescriptor* clashConDesLinker = nullptr; clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,conDes,depTrackPoint,calcAlgContext); clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,conDesIt,conDesIt->getDependencyTrackPoint(),calcAlgContext); throw CCalculationClashProcessingException(clashConDesLinker); } } superRoleIt = superRoleIt->getNext(); } } } conDesIt = conDesIt->getNext(); } } } // create basis dependency CATMOSTDependencyNode* atMostDepNode = createATMOSTDependency(processIndi,conDes,depTrackPoint,calcAlgContext); CNonDeterministicDependencyTrackPoint* atMostNonDetDepTrackPoint = createNonDeterministicDependencyTrackPointBranch(atMostDepNode,true,calcAlgContext); // initialize qualifying and merging branchingMergingProcRest = CObjectParameterizingAllocator< CBranchingMergingProcessingRestrictionSpecification,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,processContext); branchingMergingProcRest->initBranchingMergingProcessingRestriction(); branchingMergingProcRest->initDependencyTracker(atMostNonDetDepTrackPoint); branchingMergingProcRest->initMergingDependencyNode(atMostDepNode); if (calcAlgContext->getUsedUnsatisfiableCacheRetrievalStrategy()->testUnsatisfiableCacheForMergingInitialization(conProDes,processIndi)) { testIndividualNodeUnsatisfiableCached(processIndi,calcAlgContext); } } else { CBranchingMergingProcessingRestrictionSpecification* prevBranchingMergingProcRest = (CBranchingMergingProcessingRestrictionSpecification*)procRest; roleSuccIt = roleSuccHash->getRoleSuccessorHistoryLinkIterator(role,prevBranchingMergingProcRest->getLastIndividualLink(),&linkCount); if (cardinality <= 0 && linkCount > 0 && !conceptOpLinkerIt) { // clash CClashedDependencyDescriptor* clashConDesLinker = nullptr; clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,conDes,depTrackPoint,calcAlgContext); CIndividualLinkEdge* link = roleSuccIt.next(false); clashConDesLinker = createClashedIndividualLinkDescriptor(clashConDesLinker,link,link->getDependencyTrackPoint(),calcAlgContext); throw CCalculationClashProcessingException(clashConDesLinker); } CBranchingMergingProcessingRestrictionSpecification* newBranchingMergingProcRest = CObjectParameterizingAllocator< CBranchingMergingProcessingRestrictionSpecification,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,processContext); newBranchingMergingProcRest->initBranchingMergingProcessingRestriction(prevBranchingMergingProcRest); branchingMergingProcRest = newBranchingMergingProcRest; } //lastBranchingMergingProcRest = branchingMergingProcRest; //CIndividual* nominalIndividual = processIndi->getNominalIndividual(); //if (nominalIndividual && cardinality == 2) { // if (CIRIName::getRecentIRIName(nominalIndividual->getIndividualNameLinker()) == "http://www.cs.man.ac.uk/~stevensr/ontology/fhkb.owl#richard_john_bright_1962") { // bool bug = true; // } //} initializeMergingIndividualNodes(processIndi,conProDes,&roleSuccIt,usingLastLink,conceptOpLinkerIt,branchingMergingProcRest,calcAlgContext); qualifyMergingIndividualNodes(processIndi,conProDes,branchingMergingProcRest,calcAlgContext); if (mConfPairwiseMerging) { mergeMergingIndividualNodesPairwise(processIndi,conProDes,linkCount,cardinality,branchingMergingProcRest,calcAlgContext); } else { mergeMergingIndividualNodes(processIndi,conProDes,linkCount,cardinality,branchingMergingProcRest,calcAlgContext); } installReapplication = true; if (installReapplication) { CDependencyTrackPoint* contDepTrackPoint = depTrackPoint; addConceptToReapplyQueue(conDes,role,processIndi,branchingMergingProcRest,contDepTrackPoint,calcAlgContext); } } QString CCalculationTableauCompletionTaskHandleAlgorithm::generateDebugMergingQueueString(CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest, CCalculationAlgorithmContextBase* calcAlgContext) { QString mergingString; CBranchingMergingIndividualNodeCandidateLinker* mergCandLinker = branchingMergingProcRest->getMergingCandidateNodeLinker(); while (mergCandLinker) { CIndividualProcessNode* indiNode = mergCandLinker->getMergingIndividualNodeCandidate(); QString indiString = QString("[ %1 ] = ").arg(indiNode->getIndividualID()); QString conSetString; CReapplyConceptLabelSet* conSet = indiNode->getReapplyConceptLabelSet(false); CReapplyConceptLabelSetIterator conSetIt = conSet->getConceptLabelSetIterator(false,false,false); while (conSetIt.hasNext()) { CConceptDescriptor* conDes = conSetIt.next(); CConcept* concept = conDes->getConcept(); cint64 conTag = conDes->getConceptTag(); if (conTag != 1) { QString conString = QString("%1%2").arg((conDes->isNegated())?"-":"").arg(conTag); if (concept->hasClassName()) { conString += CIRIName::getRecentIRIName(concept->getClassNameLinker()); } if (!conSetString.isEmpty()) { conSetString += QString(", "); } conSetString += conString; } } indiString += QString("{%1} \n").arg(conSetString); mergingString += indiString; mergCandLinker = mergCandLinker->getNext(); } return mergingString; } bool CCalculationTableauCompletionTaskHandleAlgorithm::mergeMergingIndividualNodesPairwise(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, cint64 linkCount, cint64 cardinality, CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); CDependencyTrackPoint* baseDepTrackPoint = branchingMergingProcRest->getDependencyTrackPoint(); cint64 indiCount = processIndi->getRoleSuccessorCount(role); if (indiCount > cardinality) { CSatisfiableCalculationTask* newTaskList = nullptr; CMERGEDependencyNode* mergeDependencyNode = createMERGEDependency(processIndi,nullptr,baseDepTrackPoint,calcAlgContext); CClashedDependencyDescriptor* clashDescriptors = nullptr; CRoleSuccessorLinkIterator roleSuccIt1 = processIndi->getRoleSuccessorLinkIterator(role); while (roleSuccIt1.hasNext()) { CIndividualLinkEdge* link1 = roleSuccIt1.next(); CIndividualProcessNode* succNode1 = getSuccessorIndividual(processIndi,link1,calcAlgContext); clashDescriptors = createIndividualMergeCausingDescriptors(clashDescriptors,succNode1,link1,conceptOpLinkerIt,calcAlgContext); CRoleSuccessorLinkIterator roleSuccIt2 = roleSuccIt1; while (roleSuccIt2.hasNext()) { CIndividualLinkEdge* link2 = roleSuccIt2.next(); CIndividualProcessNode* succNode2 = getSuccessorIndividual(processIndi,link2,calcAlgContext); clashDescriptors = createIndividualMergeCausingDescriptors(clashDescriptors,succNode2,link2,conceptOpLinkerIt,calcAlgContext); if (isIndividualNodesMergeable(succNode1,succNode2,clashDescriptors,calcAlgContext)) { CSatisfiableCalculationTask* newTask = createMergeBranchingTask(processIndi,conProDes,succNode1,succNode2,mergeDependencyNode,branchingMergingProcRest,calcAlgContext); newTaskList = (CSatisfiableCalculationTask*)newTask->append(newTaskList); } } } if (mergeDependencyNode) { mergeDependencyNode->addBranchClashes(clashDescriptors); } if (newTaskList) { CTaskProcessorContext* processorContext = calcAlgContext->getUsedTaskProcessorContext(); processorContext->getTaskProcessorCommunicator()->communicateTaskCreation(newTaskList); } else { clashDescriptors = createClashedConceptDescriptor(clashDescriptors,processIndi,nullptr,baseDepTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(clashDescriptors); } throw CCalculationStopProcessingException(true); } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::mergeMergingIndividualNodes(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, cint64 linkCount, cint64 cardinality, CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); CPROCESSSET* distinctMergedSet = branchingMergingProcRest->getDistinctMergedNodesSet(false); CPROCESSSET* locDistinctMergedSet = nullptr; cint64 deterministicMergingAttempt = 0; cint64 deterministicMergingStep = 0; cint64 distinctCount = 0; if (distinctMergedSet) { distinctCount = distinctMergedSet->count(); } cint64 linkAndCandidateCount = branchingMergingProcRest->getRemainingLinkerMergingCandidateIndividualNodeCount() + distinctCount; if (linkCount != linkAndCandidateCount) { // update branchingMergingProcRest->setRemainingValidMergingCandidateIndividualNodeCount(linkCount-distinctCount); } CDependencyTrackPoint* baseDepTrackPoint = branchingMergingProcRest->getDependencyTrackPoint(); CDependencyTrackPoint* nextDepTrackPoint = nullptr; cint64 tmpCardinality = cardinality; if (cardinality <= 0 && branchingMergingProcRest->getRemainingLinkerMergingCandidateIndividualNodeCount() > 0) { // clash CBranchingMergingIndividualNodeCandidateLinker* mergeCandLinker = branchingMergingProcRest->takeNextMergingCandidateNodeLinker(); while (mergeCandLinker) { CIndividualProcessNode* mergeCandIndiNode = mergeCandLinker->getMergingIndividualNodeCandidate(); if (branchingMergingProcRest->hasValidRemainingMergingCandidates() || processIndi->hasRoleSuccessorToIndividual(role,mergeCandIndiNode,true)) { CClashedDependencyDescriptor* clashDescriptors = nullptr; CIndividualProcessNode* mergingIndiNode = getUpToDateIndividual(mergeCandIndiNode,calcAlgContext); clashDescriptors = createIndividualMergeCausingDescriptors(clashDescriptors,mergingIndiNode,mergeCandLinker->getMergingIndividualLink(),conceptOpLinkerIt,calcAlgContext); clashDescriptors = createClashedConceptDescriptor(clashDescriptors,processIndi,nullptr,baseDepTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(clashDescriptors); } else { // invalid link branchingMergingProcRest->incRemainingValidMergingCandidateIndividualNodeCount(); } mergeCandLinker = branchingMergingProcRest->takeNextMergingCandidateNodeLinker(); } } bool fixedNominalMerging = processIndi->isNominalIndividual() && branchingMergingProcRest->hasAddedBlockablePredecessorMergingNodeCandidate(); bool requiresNNOperating = false; if (fixedNominalMerging) { cint64 fixDisCount = distinctCount + branchingMergingProcRest->getRemainingNominalCreationCount(); if (fixDisCount > 0) { tmpCardinality = distinctCount; if (branchingMergingProcRest->hasRemainingMergingCandidates()) { requiresNNOperating = true; } } else if (linkAndCandidateCount > 0) { requiresNNOperating = true; } } CClashedDependencyDescriptor* initClashDescriptors = nullptr; if (linkAndCandidateCount > tmpCardinality || requiresNNOperating) { // needs merging if (fixedNominalMerging) { bool requiresNNInitialization = fixedNominalMerging && !branchingMergingProcRest->isDistinctSetFixed(); if (requiresNNInitialization) { STATINC(INDINODEMERGENEWNOMINALINITCOUNT,calcAlgContext); if (!locDistinctMergedSet) { locDistinctMergedSet = branchingMergingProcRest->getDistinctMergedNodesSet(true); distinctMergedSet = locDistinctMergedSet; locDistinctMergedSet->clear(); distinctCount = 0; } if (mConfLazyNewNominalGeneration) { branchingMergingProcRest->setRemainingNominalCreationCount(tmpCardinality); tmpCardinality = 0; } else { // generate new nominal successor nodes createNominalsSuccessorIndividuals(processIndi,role->getIndirectSuperRoleList(),role,conceptOpLinkerIt,false,branchingMergingProcRest->getAddedBlockablePredecessorDependencyTrackPoint(),tmpCardinality,calcAlgContext); distinctCount = tmpCardinality; cint64 disIndiIdx = 0; CIndividualLinkEdge* newLastLink = nullptr; CRoleSuccessorLinkIterator roleSuccIt(processIndi->getRoleSuccessorHistoryLinkIterator(role,branchingMergingProcRest->getLastIndividualLink())); while (roleSuccIt.hasNext()) { CIndividualLinkEdge* link = roleSuccIt.next(); if (!newLastLink) { newLastLink = link; } CIndividualProcessNode* nominalSuccIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); distinctMergedSet->insert(nominalSuccIndi->getIndividualID()); ++disIndiIdx; } branchingMergingProcRest->setLastIndividualLink(newLastLink); } branchingMergingProcRest->setDistinctSetFixed(true); } } else { while (distinctCount <= 0) { if (!locDistinctMergedSet) { locDistinctMergedSet = branchingMergingProcRest->getDistinctMergedNodesSet(true); distinctMergedSet = locDistinctMergedSet; } initClashDescriptors = branchingMergingProcRest->getMultipleMergingNodesInitializationClashesDescriptors(); CBranchingMergingIndividualNodeCandidateLinker* mergeCandLinker = branchingMergingProcRest->takeNextMergingCandidateNodeLinker(); while (mergeCandLinker) { CIndividualProcessNode* mergeCandIndiNode = mergeCandLinker->getMergingIndividualNodeCandidate(); if (!branchingMergingProcRest->hasValidRemainingMergingCandidates()) { mergeCandIndiNode = getCorrectedNominalIndividualNode(mergeCandIndiNode->getIndividualID(),calcAlgContext); } CIndividualProcessNode* mergingIndiNode = getUpToDateIndividual(mergeCandIndiNode,calcAlgContext); initClashDescriptors = createIndividualMergeCausingDescriptors(initClashDescriptors,mergingIndiNode,mergeCandLinker->getMergingIndividualLink(),conceptOpLinkerIt,calcAlgContext); distinctMergedSet->insert(mergeCandIndiNode->getIndividualID()); ++distinctCount; if (distinctCount > tmpCardinality) { // clash, not able to merge if (!initClashDescriptors) { initClashDescriptors = branchingMergingProcRest->getMergingNodesInitializationClashesDescriptors(); } initClashDescriptors = createClashedConceptDescriptor(initClashDescriptors,processIndi,nullptr,baseDepTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(initClashDescriptors); } mergeCandLinker = branchingMergingProcRest->takeNextMergingInitializationCandidateNodeLinker(); } } } if (!branchingMergingProcRest->hasValidRemainingMergingCandidates()) { // update distinct hash if (!distinctMergedSet) { locDistinctMergedSet = branchingMergingProcRest->getDistinctMergedNodesSet(true); distinctMergedSet = locDistinctMergedSet; } bool relocated = false; for (CPROCESSSET::const_iterator disIt = distinctMergedSet->constBegin(), disItEnd = distinctMergedSet->constEnd(); disIt != disItEnd; ++disIt) { cint64 distinctIndiID = *disIt; CIndividualLinkEdge* disIndiLink = processIndi->getRoleSuccessorToIndividualLink(role,distinctIndiID,true); if (!disIndiLink) { CIndividualProcessNode* mergedIntoNode = getCorrectedNominalIndividualNode(distinctIndiID,calcAlgContext); if (!locDistinctMergedSet) { locDistinctMergedSet = branchingMergingProcRest->getDistinctMergedNodesSet(true); distinctMergedSet = locDistinctMergedSet; } locDistinctMergedSet->remove(distinctIndiID); relocated = true; if (locDistinctMergedSet->contains(mergedIntoNode->getIndividualID())) { --distinctCount; if (fixedNominalMerging) { tmpCardinality = distinctCount; } } locDistinctMergedSet->insert(mergedIntoNode->getIndividualID()); } else if (locDistinctMergedSet) { locDistinctMergedSet->insert(distinctIndiID); } } if (relocated) { branchingMergingProcRest->setDistinctSetNodeRelocated(true); } } while (branchingMergingProcRest->hasRemainingMergingCandidates()) { ++deterministicMergingAttempt; bool createNewNodesAsNominals = false; if (mConfLazyNewNominalGeneration) { cint64 remainingNewNominalCreationCount = branchingMergingProcRest->getRemainingNominalCreationCount(); if (remainingNewNominalCreationCount > 0) { // generate new nominal //createNominalsSuccessorIndividuals(processIndi,role->getIndirectSuperRoleList(),role,conceptOpLinkerIt,false,branchingMergingProcRest->getAddedBlockablePredecessorDependencyTrackPoint(),1,calcAlgContext); //if (!locDistinctMergedSet) { // locDistinctMergedSet = branchingMergingProcRest->getDistinctMergedNodesSet(true); // distinctMergedSet = locDistinctMergedSet; //} //++distinctCount; ++tmpCardinality; createNewNodesAsNominals = true; //CRoleSuccessorLinkIterator roleSuccIt(processIndi->getRoleSuccessorHistoryLinkIterator(role,branchingMergingProcRest->getLastIndividualLink())); //if (roleSuccIt.hasNext()) { // CIndividualLinkEdge* link = roleSuccIt.next(); // branchingMergingProcRest->setLastIndividualLink(link); // CIndividualProcessNode* nominalSuccIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); // distinctMergedSet->insert(nominalSuccIndi->getIndividualID()); //} //branchingMergingProcRest->setRemainingNominalCreationCount(remainingNewNominalCreationCount-1); } } CBranchingMergingIndividualNodeCandidateLinker* mergeCandLinker = branchingMergingProcRest->takeNextMergingCandidateNodeLinker(); CIndividualProcessNode* mergeCandIndiNode = mergeCandLinker->getMergingIndividualNodeCandidate(); KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mDebugIndiModelString = generateDebugIndiModelStringList(calcAlgContext)); if ((branchingMergingProcRest->hasValidRemainingMergingCandidates() || processIndi->hasRoleSuccessorToIndividual(role,mergeCandIndiNode,true)) && !distinctMergedSet->contains(mergeCandIndiNode->getIndividualID())) { ++deterministicMergingStep; CIndividualProcessNode* mergingIndiNode = getUpToDateIndividual(mergeCandIndiNode,calcAlgContext); // TODO: collect clashes and update distinct node set CClashedDependencyDescriptor* clashDescriptors = initClashDescriptors; initClashDescriptors = nullptr; clashDescriptors = createIndividualMergeCausingDescriptors(clashDescriptors,mergingIndiNode,mergeCandLinker->getMergingIndividualLink(),conceptOpLinkerIt,calcAlgContext); CPROCESSSET* itDistinctMergedSet = distinctMergedSet; CPROCESSSET::const_iterator disItEnd = distinctMergedSet->constEnd(); CPROCESSSET::const_iterator firstMergeableIt = disItEnd; CPROCESSSET::const_iterator secondMergeableIt = disItEnd; cint64 firstContIndex = 0; cint64 secondContIndex = 0; cint64 contIndex = 0; for (CPROCESSSET::const_iterator disIt = distinctMergedSet->constBegin(); disIt != disItEnd;) { ++contIndex; cint64 distinctIndiID = *disIt; CIndividualLinkEdge* disIndiLink = processIndi->getRoleSuccessorToIndividualLink(role,distinctIndiID,true); //if (!disIndiLink) { // mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // QFile file(QString("./SATCT/Tasks/task-root-clashed.txt")); // if (file.open(QIODevice::WriteOnly)) { // file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); // } // bool bug = true; //} KONCLUDE_ASSERT_X(disIndiLink,"merging individual nodes","individual node link for distinct hashed individual node not found"); if (disIndiLink) { CIndividualProcessNode* disIndiNode = getSuccessorIndividual(processIndi,disIndiLink,calcAlgContext); clashDescriptors = createIndividualMergeCausingDescriptors(clashDescriptors,disIndiNode,disIndiLink,conceptOpLinkerIt,calcAlgContext); if (isIndividualNodesMergeable(disIndiNode,mergingIndiNode,clashDescriptors,calcAlgContext)) { if (firstMergeableIt == disItEnd) { firstMergeableIt = disIt; firstContIndex = contIndex; } else { secondMergeableIt = disIt; secondContIndex = contIndex; break; } } ++disIt; } } //KONCLUCE_TASK_ALGORITHM_CLASH_STRING_INSTRUCTION(mMergingClashString = generateDebugTrackedClashedDescriptorString(createTrackedClashesDescriptors(clashDescriptors,calcAlgContext),calcAlgContext)); CMERGEDependencyNode* mergeDependencyNode = createMERGEDependency(processIndi,nullptr,baseDepTrackPoint,calcAlgContext); if (mergeDependencyNode) { mergeDependencyNode->addBranchClashes(clashDescriptors); } //KONCLUCE_TASK_ALGORITHM_BRANCH_STRING_INSTRUCTION(mergeDependencyNode->getBranchNode()->setBranchString(new QString(QString("%1").arg(mergingIndiNode->getIndividualID())))); if (firstMergeableIt == disItEnd) { if (distinctCount < tmpCardinality) { ++mAppliedATMOSTRuleCount; // add individual to distinct set if (!locDistinctMergedSet) { locDistinctMergedSet = branchingMergingProcRest->getDistinctMergedNodesSet(true); distinctMergedSet = locDistinctMergedSet; } CNonDeterministicDependencyTrackPoint* mergeNonDetDepTrackPoint = createNonDeterministicDependencyTrackPointBranch(mergeDependencyNode,true,calcAlgContext); if ((!mConfMinimizeMerging && !createNewNodesAsNominals) || mergingIndiNode->isNominalIndividual()) { distinctMergedSet->insert(mergingIndiNode->getIndividualID()); branchingMergingProcRest->initMergingDependencyNode(mergeDependencyNode); branchingMergingProcRest->initDependencyTracker(mergeNonDetDepTrackPoint); baseDepTrackPoint = mergeNonDetDepTrackPoint; } else { CIndividualProcessNode* locMergingIndiNode = getLocalizedIndividual(mergingIndiNode,false,calcAlgContext); if (createNewNodesAsNominals) { branchingMergingProcRest->decRemainingNominalCreationCount(); } CIndividualProcessNode* mergedIntoEmptyIndiNode = getIntoEmptyMergedIndividualNode(locMergingIndiNode,createNewNodesAsNominals,processIndi,mergeNonDetDepTrackPoint,calcAlgContext); distinctMergedSet->insert(mergedIntoEmptyIndiNode->getIndividualID()); CRoleSuccessorLinkIterator roleSuccIt(processIndi->getRoleSuccessorHistoryLinkIterator(role,branchingMergingProcRest->getLastIndividualLink())); if (roleSuccIt.hasNext()) { CIndividualLinkEdge* link = roleSuccIt.next(); branchingMergingProcRest->setLastIndividualLink(link); } addIndividualToProcessingQueue(mergedIntoEmptyIndiNode,calcAlgContext); KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mDebugIndiModelString = generateDebugIndiModelStringList(calcAlgContext)); } ++distinctCount; } else { // clash, not able to merge clashDescriptors = createClashedConceptDescriptor(clashDescriptors,processIndi,nullptr,baseDepTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(clashDescriptors); } } else if (secondMergeableIt == disItEnd && distinctCount >= tmpCardinality) { ++mAppliedATMOSTRuleCount; // only one possibility to merge setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); CIndividualProcessNode* locDisIndiNode = getLocalizedIndividual(*firstMergeableIt,calcAlgContext); CIndividualProcessNode* locMergingIndiNode = getLocalizedIndividual(mergingIndiNode,false,calcAlgContext); CNonDeterministicDependencyTrackPoint* mergeNonDetDepTrackPoint = createNonDeterministicDependencyTrackPointBranch(mergeDependencyNode,true,calcAlgContext); if (branchingMergingProcRest->isDistinctSetNodeRelocated()) { branchingMergingProcRest->setDistinctSetNodeRelocated(false); branchingMergingProcRest->initMergingDependencyNode(mergeDependencyNode); branchingMergingProcRest->initDependencyTracker(mergeNonDetDepTrackPoint); } CIndividualProcessNode* locMergedIndiNode = getMergedIndividualNodes(locDisIndiNode,locMergingIndiNode,mergeNonDetDepTrackPoint,calcAlgContext); if (locMergedIndiNode->getIndividualID() != locDisIndiNode->getIndividualID()) { if (!locDistinctMergedSet) { locDistinctMergedSet = branchingMergingProcRest->getDistinctMergedNodesSet(true); distinctMergedSet = locDistinctMergedSet; } distinctMergedSet->remove(locDisIndiNode->getIndividualID()); distinctMergedSet->insert(locMergedIndiNode->getIndividualID()); branchingMergingProcRest->setDistinctSetNodeRelocated(true); } if (calcAlgContext->getUsedUnsatisfiableCacheRetrievalStrategy()->testUnsatisfiableCacheForMergedIndividualNodes(conProDes,processIndi,locMergedIndiNode)) { testIndividualNodeUnsatisfiableCached(locMergedIndiNode,calcAlgContext); } CReapplyRoleSuccessorHash* roleSuccHash = processIndi->getReapplyRoleSuccessorHash(false); CRoleSuccessorLinkIterator roleSuccIt = roleSuccHash->getRoleSuccessorHistoryLinkIterator(role,branchingMergingProcRest->getLastIndividualLink(),&linkCount); if (roleSuccIt.hasNext()) { initializeMergingIndividualNodes(processIndi,conProDes,&roleSuccIt,nullptr,conceptOpLinkerIt,branchingMergingProcRest,calcAlgContext); qualifyMergingIndividualNodes(processIndi,conProDes,branchingMergingProcRest,calcAlgContext); } } else { ++mAppliedATMOSTRuleCount; CSatisfiableCalculationTask* newTaskList = nullptr; setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); if (firstMergeableIt != disItEnd) { CIndividualProcessNode* firstDistinctIndiNode = getUpToDateIndividual(*firstMergeableIt,calcAlgContext); CSatisfiableCalculationTask* newTask = createMergeBranchingTask(processIndi,conProDes,firstDistinctIndiNode,mergingIndiNode,mergeDependencyNode,branchingMergingProcRest,calcAlgContext); newTaskList = (CSatisfiableCalculationTask*)newTask->append(newTaskList); } if (secondMergeableIt != disItEnd) { CIndividualProcessNode* secondDistinctIndiNode = getUpToDateIndividual(*secondMergeableIt,calcAlgContext); CSatisfiableCalculationTask* newTask = createMergeBranchingTask(processIndi,conProDes,secondDistinctIndiNode,mergingIndiNode,mergeDependencyNode,branchingMergingProcRest,calcAlgContext); newTaskList = (CSatisfiableCalculationTask*)newTask->append(newTaskList); CPROCESSSET::const_iterator mergeableIt = secondMergeableIt; while (++mergeableIt != disItEnd) { cint64 distinctIndiID = *mergeableIt; CIndividualLinkEdge* disIndiLink = processIndi->getRoleSuccessorToIndividualLink(role,distinctIndiID,true); KONCLUDE_ASSERT_X(disIndiLink,"merging individual nodes","individual node link for distinct hashed individual node not found"); if (disIndiLink) { CIndividualProcessNode* distinctIndiNode = getSuccessorIndividual(processIndi,disIndiLink,calcAlgContext); CClashedDependencyDescriptor* moreClashDescriptors = createIndividualMergeCausingDescriptors(nullptr,distinctIndiNode,disIndiLink,conceptOpLinkerIt,calcAlgContext); if (isIndividualNodesMergeable(distinctIndiNode,mergingIndiNode,moreClashDescriptors,calcAlgContext)) { CSatisfiableCalculationTask* newTask = createMergeBranchingTask(processIndi,conProDes,distinctIndiNode,mergingIndiNode,mergeDependencyNode,branchingMergingProcRest,calcAlgContext); newTaskList = (CSatisfiableCalculationTask*)newTask->append(newTaskList); } if (mergeDependencyNode) { mergeDependencyNode->addBranchClashes(moreClashDescriptors); } } } } if (distinctCount < tmpCardinality) { CSatisfiableCalculationTask* newTask = createDistinctBranchingTask(processIndi,conProDes,mergingIndiNode,createNewNodesAsNominals,mergeDependencyNode,branchingMergingProcRest,calcAlgContext); newTaskList = (CSatisfiableCalculationTask*)newTask->append(newTaskList); } CTaskProcessorContext* processorContext = calcAlgContext->getUsedTaskProcessorContext(); processorContext->getTaskProcessorCommunicator()->communicateTaskCreation(newTaskList); throw CCalculationStopProcessingException(true); } } else { // invalid link branchingMergingProcRest->incRemainingValidMergingCandidateIndividualNodeCount(); } } } return false; } CSatisfiableCalculationTask* CCalculationTableauCompletionTaskHandleAlgorithm::createDistinctBranchingTask(CIndividualProcessNode*& processIndiNode, CConceptProcessDescriptor*& conProDes, CIndividualProcessNode*& distinctIndiNode, bool createAsNominal, CNonDeterministicDependencyNode* mergeDependencyNode, CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(TASKDISTINCTMERGEBRANCHCREATIONCOUNT,calcAlgContext); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CRole* role = conDes->getConcept()->getRole(); CSatisfiableCalculationTask* newSatCalcTask = createDependendBranchingTaskList(1,calcAlgContext); CTaskProcessorContext* processorContext = calcAlgContext->getUsedTaskProcessorContext(); CProcessContext* newProcessContext = newSatCalcTask->getProcessContext(processorContext); CCalculationAlgorithmContextBase* newCalcAlgContext = createCalculationAlgorithmContext(processorContext,newProcessContext,newSatCalcTask); CProcessingDataBox* newProcessingDataBox = newSatCalcTask->getProcessingDataBox(); CMemoryAllocationManager* newTaskMemMan = newCalcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CNonDeterministicDependencyTrackPoint* mergeNonDetDepTrackPoint = createNonDeterministicDependencyTrackPointBranch(mergeDependencyNode,false,newCalcAlgContext); CBranchingMergingProcessingRestrictionSpecification* newBranchingMergingProcRest = CObjectParameterizingAllocator< CBranchingMergingProcessingRestrictionSpecification,CProcessContext* >::allocateAndConstructAndParameterize(newTaskMemMan,newProcessContext); newBranchingMergingProcRest->initBranchingMergingProcessingRestriction(branchingMergingProcRest); CProcessTagger* newProcessTagger = newCalcAlgContext->getUsedProcessTagger(); newProcessTagger->incBranchingTag(); newProcessTagger->incLocalizationTag(); CIndividualProcessNode* newLocDistinctIndiNode = getLocalizedIndividual(distinctIndiNode,false,newCalcAlgContext); CIndividualProcessNode* locProcessIndiNode = getLocalizedIndividual(processIndiNode,false,newCalcAlgContext); // make distinct to all other CPROCESSSET* locDistinctMergedSet = newBranchingMergingProcRest->getDistinctMergedNodesSet(true); if ((mConfMinimizeMerging || createAsNominal) && !newLocDistinctIndiNode->isNominalIndividual()) { if (createAsNominal) { newBranchingMergingProcRest->decRemainingNominalCreationCount(); } CIndividualProcessNode* mergedIntoEmptyIndiNode = getIntoEmptyMergedIndividualNode(newLocDistinctIndiNode,createAsNominal,processIndiNode,mergeNonDetDepTrackPoint,newCalcAlgContext); locDistinctMergedSet->insert(mergedIntoEmptyIndiNode->getIndividualID()); CRoleSuccessorLinkIterator roleSuccIt(locProcessIndiNode->getRoleSuccessorHistoryLinkIterator(role,newBranchingMergingProcRest->getLastIndividualLink())); if (roleSuccIt.hasNext()) { CIndividualLinkEdge* link = roleSuccIt.next(); newBranchingMergingProcRest->setLastIndividualLink(link); } addIndividualToProcessingQueue(mergedIntoEmptyIndiNode,newCalcAlgContext); KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mDebugIndiModelString = generateDebugIndiModelStringList(newCalcAlgContext)); } else { newBranchingMergingProcRest->initMergingDependencyNode(mergeDependencyNode); newBranchingMergingProcRest->initDependencyTracker(mergeNonDetDepTrackPoint); locDistinctMergedSet->insert(newLocDistinctIndiNode->getIndividualID()); } if (newBranchingMergingProcRest->isDistinctSetNodeRelocated()) { newBranchingMergingProcRest->setDistinctSetNodeRelocated(false); newBranchingMergingProcRest->initMergingDependencyNode(mergeDependencyNode); newBranchingMergingProcRest->initDependencyTracker(mergeNonDetDepTrackPoint); } // continue merging CConceptProcessingQueue* conProQueu = locProcessIndiNode->getConceptProcessingQueue(true); addConceptRestrictedToProcessingQueue(conDes,mergeNonDetDepTrackPoint,conProQueu,locProcessIndiNode,true,newBranchingMergingProcRest,newCalcAlgContext); prepareBranchedTaskProcessing(locProcessIndiNode,newSatCalcTask,newCalcAlgContext); KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mDebugIndiModelString = generateDebugIndiModelStringList(newCalcAlgContext)); // set new task priority double newTaskPriority = calcAlgContext->getUsedTaskPriorityStrategy()->getPriorityForTaskMerging(newSatCalcTask,calcAlgContext->getUsedSatisfiableCalculationTask()); newSatCalcTask->setTaskPriority(newTaskPriority); return newSatCalcTask; } CSatisfiableCalculationTask* CCalculationTableauCompletionTaskHandleAlgorithm::createMergeBranchingTask(CIndividualProcessNode*& processIndiNode, CConceptProcessDescriptor*& conProDes, CIndividualProcessNode*& distinctIndiNode, CIndividualProcessNode*& mergingIndiNode, CNonDeterministicDependencyNode* mergeDependencyNode, CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(TASKINDINODEMERGEBRANCHCREATIONCOUNT,calcAlgContext); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CSatisfiableCalculationTask* newSatCalcTask = createDependendBranchingTaskList(1,calcAlgContext); CTaskProcessorContext* processorContext = calcAlgContext->getUsedTaskProcessorContext(); CProcessContext* newProcessContext = newSatCalcTask->getProcessContext(processorContext); CCalculationAlgorithmContextBase* newCalcAlgContext = createCalculationAlgorithmContext(processorContext,newProcessContext,newSatCalcTask); CProcessingDataBox* newProcessingDataBox = newSatCalcTask->getProcessingDataBox(); CMemoryAllocationManager* newTaskMemMan = newCalcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CNonDeterministicDependencyTrackPoint* mergeNonDetDepTrackPoint = createNonDeterministicDependencyTrackPointBranch(mergeDependencyNode,false,newCalcAlgContext); CBranchingMergingProcessingRestrictionSpecification* newBranchingMergingProcRest = CObjectParameterizingAllocator< CBranchingMergingProcessingRestrictionSpecification,CProcessContext* >::allocateAndConstructAndParameterize(newTaskMemMan,newProcessContext); newBranchingMergingProcRest->initBranchingMergingProcessingRestriction(branchingMergingProcRest); CProcessTagger* newProcessTagger = newCalcAlgContext->getUsedProcessTagger(); newProcessTagger->incBranchingTag(); newProcessTagger->incLocalizationTag(); CIndividualProcessNode* newLocDistinctIndiNode = getLocalizedIndividual(distinctIndiNode,false,newCalcAlgContext); CIndividualProcessNode* newLocMergingIndiNode = getLocalizedIndividual(mergingIndiNode,false,newCalcAlgContext); if (newBranchingMergingProcRest->isDistinctSetNodeRelocated()) { newBranchingMergingProcRest->setDistinctSetNodeRelocated(false); newBranchingMergingProcRest->initMergingDependencyNode(mergeDependencyNode); newBranchingMergingProcRest->initDependencyTracker(mergeNonDetDepTrackPoint); } CIndividualProcessNode* locMergedIndiNode = getMergedIndividualNodes(newLocDistinctIndiNode,newLocMergingIndiNode,mergeNonDetDepTrackPoint,newCalcAlgContext); if (locMergedIndiNode->getIndividualID() != newLocDistinctIndiNode->getIndividualID()) { CPROCESSSET* locDistinctMergedSet = newBranchingMergingProcRest->getDistinctMergedNodesSet(true); locDistinctMergedSet->remove(newLocDistinctIndiNode->getIndividualID()); locDistinctMergedSet->insert(locMergedIndiNode->getIndividualID()); newBranchingMergingProcRest->setDistinctSetNodeRelocated(true); } // continue merging CIndividualProcessNode* locProcessIndiNode = getLocalizedIndividual(processIndiNode,true,newCalcAlgContext); CConceptProcessingQueue* conProQueu = locProcessIndiNode->getConceptProcessingQueue(true); addConceptRestrictedToProcessingQueue(conDes,mergeNonDetDepTrackPoint,conProQueu,locProcessIndiNode,true,newBranchingMergingProcRest,newCalcAlgContext); if (calcAlgContext->getUsedUnsatisfiableCacheRetrievalStrategy()->testUnsatisfiableCacheForMergedIndividualNodes(conProDes,locProcessIndiNode,locMergedIndiNode)) { addIndividualNodeForCacheUnsatisfiableRetrieval(locMergedIndiNode,newCalcAlgContext); } prepareBranchedTaskProcessing(locProcessIndiNode,newSatCalcTask,newCalcAlgContext); KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mDebugIndiModelString = generateDebugIndiModelStringList(newCalcAlgContext)); // set new task priority double newTaskPriority = calcAlgContext->getUsedTaskPriorityStrategy()->getPriorityForTaskMerging(newSatCalcTask,calcAlgContext->getUsedSatisfiableCalculationTask()); newSatCalcTask->setTaskPriority(newTaskPriority); return newSatCalcTask; } bool CCalculationTableauCompletionTaskHandleAlgorithm::qualifyMergingIndividualNodes(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CProcessContext* processContext = calcAlgContext->getUsedProcessContext(); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); cint64 cardinality = concept->getParameter() - 1*conDes->isNegated(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); bool qualifing = false; CBranchingMergingIndividualNodeCandidateLinker* qualifyPosNegCandLinker = branchingMergingProcRest->getBothQualifyCandidateNodeLinker(); while (qualifyPosNegCandLinker) { CIndividualProcessNode* qualifyIndiNode = qualifyPosNegCandLinker->getMergingIndividualNodeCandidate(); // check still valid CIndividualLinkEdge* link = processIndi->getRoleSuccessorToIndividualLink(role,qualifyIndiNode,true); if (link) { CIndividualProcessNode* upQualifyIndiNode = getUpToDateIndividual(qualifyIndiNode,calcAlgContext); bool negated = false; if (containsIndividualNodeConcepts(upQualifyIndiNode,conceptOpLinkerIt,&negated,calcAlgContext)) { if (!negated) { if (cardinality <= 0) { // clash } CBranchingMergingIndividualNodeCandidateLinker* qualifiedMovedCandLinker = CObjectParameterizingAllocator< CBranchingMergingIndividualNodeCandidateLinker,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,calcAlgContext->getUsedProcessContext()); qualifiedMovedCandLinker->initBranchingMergingIndividualNodeCandidate(qualifyPosNegCandLinker); branchingMergingProcRest->addMergingCandidateNodeLinker(qualifiedMovedCandLinker); } } else { setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); CClashedDependencyDescriptor* clashDes = createClashedIndividualLinkDescriptor(nullptr,link,link->getDependencyTrackPoint(),calcAlgContext); // create dependency CQUALIFYDependencyNode* qualifyDepNode = createQUALIFYDependency(processIndi,nullptr,branchingMergingProcRest->getDependencyTrackPoint(),calcAlgContext); if (qualifyDepNode) { qualifyDepNode->addBranchClashes(clashDes); } branchingMergingProcRest->setBothQualifyCandidateNodeLinker(qualifyPosNegCandLinker->getNext()); if (cardinality <= 0) { ++mAppliedATMOSTRuleCount; STATINC(INDINODEQUALIFYCHOOCECOUNT,calcAlgContext); CDependencyTrackPoint* newDependencyTrackPoint = createNonDeterministicDependencyTrackPointBranch(qualifyDepNode,true,calcAlgContext); CIndividualProcessNode* locQualifyIndiNode = getLocalizedIndividual(upQualifyIndiNode,false,calcAlgContext); // qualify only negated addConceptsToIndividual(conceptOpLinkerIt,true,locQualifyIndiNode,newDependencyTrackPoint,false,true,nullptr,calcAlgContext); addIndividualToProcessingQueue(locQualifyIndiNode,calcAlgContext); if (calcAlgContext->getUsedUnsatisfiableCacheRetrievalStrategy()->testUnsatisfiableCacheForQualifiedIndividualNodes(conProDes,processIndi,locQualifyIndiNode)) { addIndividualNodeForCacheUnsatisfiableRetrieval(locQualifyIndiNode,calcAlgContext); } } else { ++mAppliedATMOSTRuleCount; STATINC(INDINODEQUALIFYCHOOCECOUNT,calcAlgContext); qualifing = true; CSatisfiableCalculationTask* newTaskList = createDependendBranchingTaskList(2,calcAlgContext); CTaskProcessorContext* processorContext = calcAlgContext->getUsedTaskProcessorContext(); CSatisfiableCalculationTask* newTaskIt = newTaskList; cint64 branchNumber = 1; bool qualNeg = true; while (newTaskIt) { STATINC(TASKQUALIFYCHOOSEBRANCHCREATIONCOUNT,calcAlgContext); CSatisfiableCalculationTask* newSatCalcTask = newTaskIt; CProcessContext* newProcessContext = newSatCalcTask->getProcessContext(processorContext); CCalculationAlgorithmContextBase* newCalcAlgContext = createCalculationAlgorithmContext(processorContext,newProcessContext,newSatCalcTask); CProcessingDataBox* newProcessingDataBox = newSatCalcTask->getProcessingDataBox(); CProcessTagger* newProcessTagger = newCalcAlgContext->getUsedProcessTagger(); newProcessTagger->incBranchingTag(); newProcessTagger->incLocalizationTag(); CIndividualProcessNode* newLocIndiNode = getLocalizedIndividual(processIndi,false,newCalcAlgContext); CConceptProcessingQueue* newConProcQueue = newLocIndiNode->getConceptProcessingQueue(true); CIndividualProcessNode* newLocQualifyIndiNode = getLocalizedIndividual(upQualifyIndiNode,false,newCalcAlgContext); // create dependency track point CDependencyTrackPoint* newDependencyTrackPoint = createNonDeterministicDependencyTrackPointBranch(qualifyDepNode,false,newCalcAlgContext); if (!qualNeg) { CMemoryAllocationManager* newTaskMemMan = newCalcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CBranchingMergingProcessingRestrictionSpecification* newBranchingMergingProcRest = CObjectParameterizingAllocator< CBranchingMergingProcessingRestrictionSpecification,CProcessContext* >::allocateAndConstructAndParameterize(newTaskMemMan,newProcessContext); newBranchingMergingProcRest->initBranchingMergingProcessingRestriction(branchingMergingProcRest); CBranchingMergingIndividualNodeCandidateLinker* qualifiedMovedCandLinker = CObjectParameterizingAllocator< CBranchingMergingIndividualNodeCandidateLinker,CProcessContext* >::allocateAndConstructAndParameterize(newTaskMemMan,newProcessContext); qualifiedMovedCandLinker->initBranchingMergingIndividualNodeCandidate(qualifyPosNegCandLinker); newBranchingMergingProcRest->addMergingCandidateNodeLinker(qualifiedMovedCandLinker); branchingMergingProcRest = newBranchingMergingProcRest; } // ATMOST reapplication in new tasks addConceptRestrictedToProcessingQueue(conDes,depTrackPoint,newConProcQueue,newLocIndiNode,true,branchingMergingProcRest,newCalcAlgContext); // qualify addConceptsToIndividual(conceptOpLinkerIt,qualNeg,newLocQualifyIndiNode,newDependencyTrackPoint,false,true,nullptr,newCalcAlgContext); addIndividualToProcessingQueue(newLocQualifyIndiNode,newCalcAlgContext); if (calcAlgContext->getUsedUnsatisfiableCacheRetrievalStrategy()->testUnsatisfiableCacheForQualifiedIndividualNodes(conProDes,newLocIndiNode,newLocQualifyIndiNode)) { addIndividualNodeForCacheUnsatisfiableRetrieval(newLocQualifyIndiNode,newCalcAlgContext); } prepareBranchedTaskProcessing(newLocIndiNode,newTaskIt,newCalcAlgContext); // set new task priority double newTaskPriority = calcAlgContext->getUsedTaskPriorityStrategy()->getPriorityForTaskQualifing(newSatCalcTask,calcAlgContext->getUsedSatisfiableCalculationTask(),qualNeg); newSatCalcTask->setTaskPriority(newTaskPriority); ++branchNumber; qualNeg = !qualNeg; newTaskIt = (CSatisfiableCalculationTask*)newTaskIt->getNext(); } processorContext->getTaskProcessorCommunicator()->communicateTaskCreation(newTaskList); throw CCalculationStopProcessingException(true); } } } qualifyPosNegCandLinker = qualifyPosNegCandLinker->getNext(); } branchingMergingProcRest->setBothQualifyCandidateNodeLinker(nullptr); return qualifing; } void CCalculationTableauCompletionTaskHandleAlgorithm::initializeMergingIndividualNodes(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, CRoleSuccessorLinkIterator* roleSuccIt, CIndividualLinkEdge* usingLastLink, CSortedNegLinker* conceptOpLinkerIt, CBranchingMergingProcessingRestrictionSpecification* branchingMergingProcRest, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CProcessContext* processContext = calcAlgContext->getUsedProcessContext(); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); bool negate = conDes->getNegation(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CConcept* concept = conDes->getConcept(); cint64 cardinality = concept->getParameter() - 1*negate; CIndividualLinkEdge* firstLink = usingLastLink; CBranchingMergingIndividualNodeCandidateLinker* disIndiNodeCandLinker = nullptr; CBranchingMergingIndividualNodeCandidateLinker* maxDisIndiNodeCandLinker = nullptr; cint64 maxDisIndiNodeCandCount = 0; cint64 disIndiNodeCandCount = 0; bool collectMaxDistinctMergingNodes = true; bool canInitMerging = !branchingMergingProcRest->hasMergingInitializationCandidates(); while (roleSuccIt->hasNext()) { STATINC(INDINODEMERGEINITCOUNT,calcAlgContext); CIndividualLinkEdge* link = roleSuccIt->next(); CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); CBranchingMergingIndividualNodeCandidateLinker* mergeIndiNodeCandLinker = CObjectParameterizingAllocator< CBranchingMergingIndividualNodeCandidateLinker,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,processContext); mergeIndiNodeCandLinker->initBranchingMergingIndividualNodeCandidate(succIndi,link); bool containsNegation = false; if (containsIndividualNodeConcepts(succIndi,conceptOpLinkerIt,&containsNegation,calcAlgContext)) { if (!containsNegation) { bool delayedCandAdded = false; CDistinctHash* disHash = succIndi->getDistinctHash(false); if (collectMaxDistinctMergingNodes && disHash) { if (disIndiNodeCandLinker) { bool distinctToAllPrev = true; CBranchingMergingIndividualNodeCandidateLinker* disIndiNodeCandLinkerIt = disIndiNodeCandLinker; while (disIndiNodeCandLinkerIt) { if (!disHash->isIndividualDistinct(disIndiNodeCandLinkerIt->getMergingIndividualNodeCandidate()->getIndividualID())) { distinctToAllPrev = false; break; } disIndiNodeCandLinkerIt = disIndiNodeCandLinkerIt->getNext(); } if (distinctToAllPrev) { disIndiNodeCandLinker = mergeIndiNodeCandLinker->append(disIndiNodeCandLinker); ++disIndiNodeCandCount; delayedCandAdded = true; } else { if (disIndiNodeCandCount > maxDisIndiNodeCandCount) { maxDisIndiNodeCandCount = disIndiNodeCandCount; branchingMergingProcRest->addMergingCandidateNodeLinker(maxDisIndiNodeCandLinker); maxDisIndiNodeCandLinker = disIndiNodeCandLinker; } else { branchingMergingProcRest->addMergingCandidateNodeLinker(disIndiNodeCandLinker); } disIndiNodeCandCount = 0; disIndiNodeCandLinker = nullptr; } } if (!disIndiNodeCandLinker) { if (disHash->getDistinctCount() >= maxDisIndiNodeCandCount) { disIndiNodeCandLinker = mergeIndiNodeCandLinker; disIndiNodeCandCount = 1; delayedCandAdded = true; } } } if (!delayedCandAdded) { branchingMergingProcRest->addMergingCandidateNodeLinker(mergeIndiNodeCandLinker); } } } else { // TODO: check cache, add to only pos or neg qualify candidate node linker branchingMergingProcRest->addBothQualifyCandidateNodeLinker(mergeIndiNodeCandLinker); } if (!firstLink) { firstLink = link; } } if (disIndiNodeCandLinker) { if (disIndiNodeCandCount > maxDisIndiNodeCandCount) { maxDisIndiNodeCandCount = disIndiNodeCandCount; branchingMergingProcRest->addMergingCandidateNodeLinker(maxDisIndiNodeCandLinker); maxDisIndiNodeCandLinker = disIndiNodeCandLinker; } else { branchingMergingProcRest->addMergingCandidateNodeLinker(disIndiNodeCandLinker); } } if (maxDisIndiNodeCandLinker) { cint64 disIndiCollCount = 0; if (canInitMerging || maxDisIndiNodeCandCount > cardinality) { CPROCESSINGSET distinctInitDepTrackPointSet(calcAlgContext->getUsedTaskProcessorContext()); bool multipleDistinctInitClashes = false; CClashedDependencyDescriptor* distinctInitClashes = nullptr; CBranchingMergingIndividualNodeCandidateLinker* initMergingIndiNodeCandIt = maxDisIndiNodeCandLinker; while (initMergingIndiNodeCandIt && disIndiCollCount <= cardinality) { CIndividualProcessNode* indiNodeMergeCand = initMergingIndiNodeCandIt->getMergingIndividualNodeCandidate(); CBranchingMergingIndividualNodeCandidateLinker* initMergingIndiNodeCandIt2 = initMergingIndiNodeCandIt->getNext(); while (initMergingIndiNodeCandIt2) { CIndividualProcessNode* otherIndiNodeMergeCand = initMergingIndiNodeCandIt2->getMergingIndividualNodeCandidate(); CDistinctEdge* disEdge = indiNodeMergeCand->getDistinctHash(false)->getIndividualDistinctEdge(otherIndiNodeMergeCand->getIndividualID()); CDependencyTrackPoint* disEdgeDepTrackPoint = disEdge->getDependencyTrackPoint(); if (!distinctInitDepTrackPointSet.contains(disEdgeDepTrackPoint)) { distinctInitDepTrackPointSet.insert(disEdgeDepTrackPoint); if (distinctInitClashes) { multipleDistinctInitClashes = true; } distinctInitClashes = createClashedIndividualDistinctDescriptor(distinctInitClashes,disEdge,disEdgeDepTrackPoint,calcAlgContext); } initMergingIndiNodeCandIt2 = initMergingIndiNodeCandIt2->getNext(); } distinctInitClashes = createIndividualMergeCausingDescriptors(distinctInitClashes,indiNodeMergeCand,initMergingIndiNodeCandIt->getMergingIndividualLink(),conceptOpLinkerIt,calcAlgContext); ++disIndiCollCount; initMergingIndiNodeCandIt = initMergingIndiNodeCandIt->getNext(); } if (maxDisIndiNodeCandCount > cardinality) { distinctInitClashes = createClashedConceptDescriptor(distinctInitClashes,processIndi,conDes,depTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(distinctInitClashes); } if (multipleDistinctInitClashes) { branchingMergingProcRest->setMultipleMergingNodesInitializationClashesDescriptors(distinctInitClashes); } else { branchingMergingProcRest->setMergingNodesInitializationClashesDescriptors(distinctInitClashes); } branchingMergingProcRest->addMergingInitializationCandidateNodeLinker(maxDisIndiNodeCandLinker); } else { branchingMergingProcRest->addMergingCandidateNodeLinker(maxDisIndiNodeCandLinker); } } if (firstLink) { branchingMergingProcRest->setLastIndividualLink(firstLink); //KONCLUCE_TASK_ALGORITHM_BRANCH_STRING_INSTRUCTION(mMergingQueueString = generateDebugMergingQueueString(branchingMergingProcRest,calcAlgContext)); } for (cint64 i = 0; i < 2; ++i) { bool qualPosNeg = false; CBranchingMergingIndividualNodeCandidateLinker* qualifyPosNegCandLinker = nullptr; if (i == 0) { qualPosNeg = false; qualifyPosNegCandLinker = branchingMergingProcRest->getOnlyPosQualifyCandidateNodeLinker(); } else { qualPosNeg = true; qualifyPosNegCandLinker = branchingMergingProcRest->getOnlyNegQualifyCandidateNodeLinker(); } while (qualifyPosNegCandLinker) { STATINC(INDINODEQUALIFYCHOOCECOUNT,calcAlgContext); CIndividualProcessNode* qualifyIndiNode = qualifyPosNegCandLinker->getMergingIndividualNodeCandidate(); CIndividualProcessNode* locQualifyIndiNode = getLocalizedIndividual(qualifyIndiNode,true,calcAlgContext); CDependencyTrackPoint* nextDepTrackPoint = nullptr; addConceptsToIndividual(conceptOpLinkerIt,qualPosNeg,locQualifyIndiNode,nextDepTrackPoint,true,true,nullptr,calcAlgContext); addIndividualToProcessingQueue(locQualifyIndiNode,calcAlgContext); if (!qualPosNeg) { branchingMergingProcRest->addMergingCandidateNodeLinker(qualifyPosNegCandLinker); } qualifyPosNegCandLinker = qualifyPosNegCandLinker->getNext(); } } branchingMergingProcRest->clearOnlyNegQualifyCandidateNodeLinker(); branchingMergingProcRest->clearOnlyPosQualifyCandidateNodeLinker(); } void CCalculationTableauCompletionTaskHandleAlgorithm::applyATLEASTRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(ATLEASTRULEAPPLICATIONCOUNT,calcAlgContext); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); cint64 cardinality = concept->getParameter() + 1*negate; if (cardinality <= 0) { return; } else if (cardinality == 1) { applySOMERule(processIndi,conProDes,false,calcAlgContext); } if (mConfSatExpCachedSuccAbsorp && processIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATISFIABLECACHED | CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED | CIndividualProcessNode::PRFSATURATIONSUCCESSORCREATIONBLOCKINGCACHED)) { STATINC(SATCACHEDABSORBEDGENERATINGCONCEPTSCOUNT,calcAlgContext); return addSatisfiableCachedAbsorbedGeneratingConcept(conDes,processIndi,depTrackPoint,calcAlgContext); } bool alreadyExistSuitableSuccessors = hasDistinctRoleSuccessorConcepts(processIndi,role,conceptOpLinkerIt,false,cardinality,calcAlgContext); if (!alreadyExistSuitableSuccessors) { if (mConfAtleastAtmostFastClashCheck) { CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); if (conSet) { CConceptDescriptor* conDesIt = conSet->getAddingSortedConceptDescriptionLinker(); while (conDesIt) { CConcept* atmostConcept = conDesIt->getData(); bool conNegated = conDesIt->isNegated(); cint64 opCode = atmostConcept->getOperatorCode(); if (!conNegated && (opCode == CCATMOST) || conNegated && (opCode == CCATLEAST)) { cint64 param = atmostConcept->getParameter(); cint64 atmostCardinality = param - 1*conNegated; if (atmostCardinality < cardinality && (hasIdenticalConceptOperands(atmostConcept->getOperandList(),conceptOpLinkerIt) || !atmostConcept->getOperandList())) { CRole* atmostRole = atmostConcept->getRole(); CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { if (!superRoleIt->isNegated()) { if (superRoleIt->getData() == atmostRole) { CClashedDependencyDescriptor* clashConDesLinker = nullptr; clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,conDes,depTrackPoint,calcAlgContext); clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,conDesIt,conDesIt->getDependencyTrackPoint(),calcAlgContext); throw CCalculationClashProcessingException(clashConDesLinker); } } superRoleIt = superRoleIt->getNext(); } } } conDesIt = conDesIt->getNext(); } } } if (calcAlgContext->getUsedUnsatisfiableCacheRetrievalStrategy()->testUnsatisfiableCacheForSuccessorGeneration(conProDes,processIndi)) { testIndividualNodeUnsatisfiableCached(processIndi,calcAlgContext); } ++mAppliedATLEASTRuleCount; // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CATLEASTDependencyNode* atleastDepNode = createATLEASTDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,calcAlgContext); CPROCESSINGLIST indiList(calcAlgContext->getUsedTaskProcessorContext()); createDistinctSuccessorIndividuals(processIndi,indiList,role->getIndirectSuperRoleList(),role,conceptOpLinkerIt,false,nextDepTrackPoint,cardinality,calcAlgContext); for (CPROCESSINGLIST::const_iterator it = indiList.constBegin(), itEnd = indiList.constEnd(); it != itEnd; ++it) { STATINC(DISTINCTSUCCESSORINDINODECREATIONCOUNT,calcAlgContext); CIndividualProcessNode* succIndi = *it; if (processIndi->isNominalIndividual() && processIndi->getIndividualNominalLevel() <= 0) { succIndi->setExtendedQueueProcessing(true); } addIndividualToProcessingQueue(succIndi,calcAlgContext); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyNOMINALRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(NOMINALRULEAPPLICATIONCOUNT,calcAlgContext); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CIndividual* indi = concept->getNominalIndividual(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CIndividualProcessNode* nominalNode = getCorrectedNominalIndividualNode(indi->getIndividualID(),calcAlgContext); if (nominalNode->getIndividualID() != processIndi->getIndividualID()) { CIndividualProcessNode* locNominalNode = getLocalizedIndividual(nominalNode,false,calcAlgContext); if (!negate) { // force initialized locNominalNode = getForcedInitializedNominalIndividualNode(locNominalNode,calcAlgContext); CReapplyConceptLabelSet* locNominalNodeConSet = locNominalNode->getReapplyConceptLabelSet(true); CConcept* nominalConcept = indi->getIndividualNominalConcept(); CConceptDescriptor* nominalConDes = nullptr; CDependencyTrackPoint* nominalConDepTrackPoint = nullptr; if (indi->getIndividualID() != locNominalNode->getIndividualID()) { locNominalNodeConSet->getConceptDescriptor(nominalConcept,nominalConDes,nominalConDepTrackPoint); } STATINC(INDINODENOMINALMERGECOUNT,calcAlgContext); CClashedDependencyDescriptor* clashDescriptors = nullptr; // test if merging is possible if (isIndividualNodesMergeable(processIndi,locNominalNode,clashDescriptors,calcAlgContext)) { // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CNOMINALDependencyNode* nominalDepNode = createNOMINALDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,nominalConDepTrackPoint,calcAlgContext); CIndividualProcessNode* mergedNode = getMergedIndividualNodes(processIndi,locNominalNode,nextDepTrackPoint,calcAlgContext); propagateIndividualNodeNeighboursNominalConnectionToAncestors(mergedNode,calcAlgContext); } else { // clash clashDescriptors = createClashedConceptDescriptor(clashDescriptors,processIndi,conDes,depTrackPoint,calcAlgContext); if (nominalConDes) { clashDescriptors = createClashedConceptDescriptor(clashDescriptors,locNominalNode,nominalConDes,nominalConDepTrackPoint,calcAlgContext); } throw CCalculationClashProcessingException(clashDescriptors); } } } } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getForcedInitializedNominalIndividualNode(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext) { ++mCurrentRecProcDepth; CIndividualProcessNode* nominalIndividual = indi; initialNodeInitialize(nominalIndividual,false,calcAlgContext); --mCurrentRecProcDepth; return nominalIndividual; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getCorrectedMergedIntoIndividualNode(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext) { while (indi->hasMergedIntoIndividualNodeID()) { cint64 mergedIntoID = indi->getMergedIntoIndividualNodeID(); indi = getUpToDateIndividual(mergedIntoID,calcAlgContext); } return indi; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isNominalIndividualNodeAvailable(cint64 indiID, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNodeVector* indiProcNodeVec = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); return indiProcNodeVec->hasData(indiID); } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getCorrectedNominalIndividualNode(cint64 indiID, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* indi = getUpToDateIndividual(indiID,calcAlgContext); if (indi) { while (indi->hasMergedIntoIndividualNodeID()) { STATINC(INDINODENOMINALCORRECTIDCOUNT,calcAlgContext); cint64 mergedIntoID = indi->getMergedIntoIndividualNodeID(); indi = getUpToDateIndividual(mergedIntoID,calcAlgContext); // TODO: path compression? -> update merged into IDs } } else { // throw error throw CCalculationErrorProcessingException::getNominalMissingErrorException(); } return indi; } void CCalculationTableauCompletionTaskHandleAlgorithm::applyALLRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(ALLRULEAPPLICATIONCOUNT,calcAlgContext); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CSortedNegLinker* conceptOpLinker = concept->getOperandList(); CIndividualLinkEdge* restLink = getLinkProcessingRestriction(conProDes); if (restLink) { ++mAppliedALLRuleCount; STATINC(ALLROLERESTRICTIONCOUNT,calcAlgContext); CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,restLink,calcAlgContext); CIndividualProcessNode* locSuccIndi = nullptr; CReapplyConceptLabelSet* conLabelSet = succIndi->getReapplyConceptLabelSet(false); // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CALLDependencyNode* allDepNode = nullptr; bool allDepNodeCreated = false; CSortedNegLinker* conceptOpLinkerIt = conceptOpLinker; while (conceptOpLinkerIt) { CConcept* opConcept = conceptOpLinkerIt->getData(); bool opConNeg = conceptOpLinkerIt->isNegated() ^ negate; if (!conLabelSet->hasConcept(opConcept,opConNeg)) { // add concept if (!allDepNodeCreated) { allDepNodeCreated = true; allDepNode = createALLDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,restLink->getDependencyTrackPoint(),calcAlgContext); } if (!locSuccIndi) { locSuccIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); conLabelSet = locSuccIndi->getReapplyConceptLabelSet(true); } addConceptToIndividual(opConcept,opConNeg,locSuccIndi,nextDepTrackPoint,true,true,calcAlgContext); } conceptOpLinkerIt = conceptOpLinkerIt->getNext(); } if (locSuccIndi) { addIndividualToProcessingQueue(locSuccIndi,calcAlgContext); } } else { CReapplyRoleSuccessorHash* roleSuccHash = processIndi->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { CRoleSuccessorLinkIterator roleSuccIt = roleSuccHash->getRoleSuccessorLinkIterator(role); while (roleSuccIt.hasNext()) { ++mAppliedALLRuleCount; STATINC(ALLROLERESTRICTIONCOUNT,calcAlgContext); CIndividualLinkEdge* link = roleSuccIt.next(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); CIndividualProcessNode* locSuccIndi = nullptr; CReapplyConceptLabelSet* conLabelSet = succIndi->getReapplyConceptLabelSet(false); // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CALLDependencyNode* allDepNode = nullptr; bool allDepNodeCreated = false; CSortedNegLinker* conceptOpLinkerIt = conceptOpLinker; while (conceptOpLinkerIt) { CConcept* opConcept = conceptOpLinkerIt->getData(); bool opConNeg = conceptOpLinkerIt->isNegated() ^ negate; if (!conLabelSet->hasConcept(opConcept,opConNeg)) { // add concept if (!allDepNodeCreated) { allDepNodeCreated = true; allDepNode = createALLDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,link->getDependencyTrackPoint(),calcAlgContext); } if (!locSuccIndi) { locSuccIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); conLabelSet = locSuccIndi->getReapplyConceptLabelSet(true); } addConceptToIndividual(opConcept,opConNeg,locSuccIndi,nextDepTrackPoint,true,true,calcAlgContext); } conceptOpLinkerIt = conceptOpLinkerIt->getNext(); } if (locSuccIndi) { addIndividualToProcessingQueue(locSuccIndi,calcAlgContext); } } } } if (!conProDes->isConceptReapplied()) { addConceptToReapplyQueue(conDes,role,processIndi,true,depTrackPoint,calcAlgContext); } } bool CCalculationTableauCompletionTaskHandleAlgorithm::initializeORProcessing(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CBranchingORProcessingRestrictionSpecification** plannedBranchingProcessRestriction, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); if (conProDes->getProcessPriority().getPriority() >= mDeterministicProcessPriority) { CConceptProcessData* conProData = (CConceptProcessData*)concept->getConceptData(); if (conProData) { CConcept* impConcept = nullptr; CReplacementData* repData = conProData->getReplacementData(); CXNegLinker* commDisConLinker = nullptr; if (repData) { impConcept = repData->getImplicationReplacementConcept(); commDisConLinker = repData->getCommonDisjunctConceptLinker(); } if (commDisConLinker) { addConceptsToIndividual(commDisConLinker,false,processIndi,depTrackPoint,true,false,nullptr,calcAlgContext); } if (impConcept) { STATINC(ORREPLACEMENTIMPLICATIONCOUNT,calcAlgContext); addConceptToIndividual(impConcept,false,processIndi,depTrackPoint,true,false,calcAlgContext); return true; } } CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); double priorityOffset = calcAlgContext->getUsedConceptPriorityStrategy()->getPriorityOffsetForDisjunctionDelayedConsidering(conDes,processIndi); addConceptRestrictedToProcessingQueue(conDes,depTrackPoint,conProQueue,processIndi,true,nullptr,priorityOffset,calcAlgContext); return true; } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::hasSaturatedClashedFlagForConcept(CConcept* concept, bool negation, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptData* conceptData = concept->getConceptData(); CIndividualSaturationProcessNode* saturationIndiNode = nullptr; if (conceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)conceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* satCalcRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(negation); if (satCalcRefLinkData) { saturationIndiNode = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } if (saturationIndiNode) { if (saturationIndiNode->getIndirectStatusFlags()->hasClashedFlag()) { return true; } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::planORProcessing(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CBranchingORProcessingRestrictionSpecification** plannedBranchingProcessRestriction, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CProcessingRestrictionSpecification* procRest = conProDes->getProcessingRestrictionSpecification(); if (initializeORProcessing(processIndi,conProDes,negate,plannedBranchingProcessRestriction,calcAlgContext)) { return true; } // plan OR processing if (!procRest) { STATINC(OREXECUTIONINITCOUNT,calcAlgContext); // concept is processed first time CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CSortedNegLinker* firstNotPosAndNegContainedOperand = nullptr; CSortedNegLinker* secondNotPosAndNegContainedOperand = nullptr; CSortedNegLinker* containedOperand = nullptr; CClashedDependencyDescriptor* clashConDesLinker = nullptr; CSortedNegLinker* opLinker = concept->getOperandList(); while (opLinker && !containedOperand) { CConcept* opConcept = opLinker->getData(); bool opConNegation = opLinker->isNegated() ^ negate; bool containsNegation = false; CConceptDescriptor* containedConDes = nullptr; CDependencyTrackPoint* containedConDepTrackPoint = nullptr; bool contains = conSet->getConceptDescriptor(opConcept,containedConDes,containedConDepTrackPoint); if (!contains) { if (!hasSaturatedClashedFlagForConcept(opConcept,opConNegation,calcAlgContext)) { if (!firstNotPosAndNegContainedOperand) { firstNotPosAndNegContainedOperand = opLinker; } else if (!secondNotPosAndNegContainedOperand) { secondNotPosAndNegContainedOperand = opLinker; } } } else { containsNegation = containedConDes->isNegated(); if (containsNegation == opConNegation) { containedOperand = opLinker; } else { clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,containedConDes,containedConDepTrackPoint,calcAlgContext); } } opLinker = opLinker->getNext(); } if (containedOperand || !secondNotPosAndNegContainedOperand) { STATINC(ORINSTANTCONTAINSEXECUTEDCOUNT,calcAlgContext); // only one branch is applicable, execute OR rule if (plannedBranchingProcessRestriction) { CBranchingORProcessingRestrictionSpecification* branchORProcRest = CObjectAllocator< CBranchingORProcessingRestrictionSpecification >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); branchORProcRest->initBranchingORProcessingRestriction(); branchORProcRest->setContainedOperand(containedOperand); branchORProcRest->setFirstNotPosAndNegContainedOperand(firstNotPosAndNegContainedOperand); branchORProcRest->setSecondNotPosAndNegContainedOperand(secondNotPosAndNegContainedOperand); branchORProcRest->addClashedConceptDescriptors(clashConDesLinker); *plannedBranchingProcessRestriction = branchORProcRest; } return false; } else { // try to trigger branching CConceptProcessData* conProcessData = (CConceptProcessData*)concept->getConceptData(); CConceptRoleBranchingTrigger* conRoleBranchTriggerLinkerIt = nullptr; CConceptRoleBranchingTrigger* nextConRoleBranchTriggerLinkerIt = nullptr; CBranchingORProcessingRestrictionSpecification* branchORProcRest = CObjectAllocator< CBranchingORProcessingRestrictionSpecification >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); branchORProcRest->initBranchingORProcessingRestriction(); branchORProcRest->setFirstNotPosAndNegContainedOperand(firstNotPosAndNegContainedOperand); branchORProcRest->setSecondNotPosAndNegContainedOperand(secondNotPosAndNegContainedOperand); branchORProcRest->addClashedConceptDescriptors(clashConDesLinker); if (conProcessData) { if (mConfBranchTriggering) { conRoleBranchTriggerLinkerIt = conProcessData->getConceptRoleBranchTrigger(); } } if (conRoleBranchTriggerLinkerIt) { // search trigger STATINC(ORTRIGGERSEARCHCOUNT,calcAlgContext); conRoleBranchTriggerLinkerIt = searchNextConceptRoleBranchTrigger(processIndi,conRoleBranchTriggerLinkerIt,calcAlgContext); } if (conRoleBranchTriggerLinkerIt) { // install trigger STATINC(ORTRIGGEREDDELAYEDEXECUTEDCOUNT,calcAlgContext); nextConRoleBranchTriggerLinkerIt = conRoleBranchTriggerLinkerIt->getNextBranchingTrigger(); branchORProcRest->setConceptRoleBranchingTrigger(nextConRoleBranchTriggerLinkerIt); installConceptRoleBranchTrigger(processIndi,conDes,depTrackPoint,branchORProcRest,conRoleBranchTriggerLinkerIt,calcAlgContext); return true; } else { // branch triggering is not anymore possible, determine priority for this OR branch // determine additional OR priority offset STATINC(ORQUEUEDDELAYEDEXECUTEDCOUNT,calcAlgContext); double priorityOffset = calcAlgContext->getUsedConceptPriorityStrategy()->getPriorityOffsetForDisjunctionDelayedProcessing(conDes,processIndi); branchORProcRest->setPriorityOffset(priorityOffset); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); addConceptRestrictedToProcessingQueue(conDes,depTrackPoint,conProQueue,processIndi,true,branchORProcRest,priorityOffset,calcAlgContext); return true; } } } else { STATINC(OREXECUTIONCONTINUECOUNT,calcAlgContext); // OR branching concept has already been considered before // try triggering again CBranchingORProcessingRestrictionSpecification* branchORProcRest = (CBranchingORProcessingRestrictionSpecification*)procRest; if (branchORProcRest->getContainedOperand()) { *plannedBranchingProcessRestriction = branchORProcRest; return false; } CConceptRoleBranchingTrigger* conRoleBranchTriggerLinkerIt = branchORProcRest->getConceptRoleBranchingTrigger(); CConceptRoleBranchingTrigger* nextConRoleBranchTriggerLinkerIt = nullptr; if (!conRoleBranchTriggerLinkerIt) { // OR branch was not triggered, execute OR rule if (plannedBranchingProcessRestriction) { *plannedBranchingProcessRestriction = branchORProcRest; } return false; } else { // search trigger STATINC(ORTRIGGERSEARCHCOUNT,calcAlgContext); conRoleBranchTriggerLinkerIt = searchNextConceptRoleBranchTrigger(processIndi,conRoleBranchTriggerLinkerIt,calcAlgContext); } CBranchingORProcessingRestrictionSpecification* nextBranchORProcRest = CObjectAllocator< CBranchingORProcessingRestrictionSpecification >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); nextBranchORProcRest->initBranchingORProcessingRestriction(branchORProcRest); if (conRoleBranchTriggerLinkerIt) { // install trigger STATINC(ORTRIGGEREDDELAYEDEXECUTEDCOUNT,calcAlgContext); nextConRoleBranchTriggerLinkerIt = conRoleBranchTriggerLinkerIt->getNextBranchingTrigger(); nextBranchORProcRest->setConceptRoleBranchingTrigger(nextConRoleBranchTriggerLinkerIt); installConceptRoleBranchTrigger(processIndi,conDes,depTrackPoint,nextBranchORProcRest,conRoleBranchTriggerLinkerIt,calcAlgContext); return true; } else { STATINC(ORQUEUEDDELAYEDEXECUTEDCOUNT,calcAlgContext); double priorityOffset = calcAlgContext->getUsedConceptPriorityStrategy()->getPriorityOffsetForDisjunctionDelayedProcessing(conDes,processIndi); nextBranchORProcRest->setPriorityOffset(priorityOffset); nextBranchORProcRest->setConceptRoleBranchingTrigger(nullptr); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); addConceptRestrictedToProcessingQueue(conDes,depTrackPoint,conProQueue,processIndi,true,nextBranchORProcRest,priorityOffset,calcAlgContext); return true; } } } CNonDeterministicDependencyTrackPoint* CCalculationTableauCompletionTaskHandleAlgorithm::createNonDeterministicDependencyTrackPointBranch(CNonDeterministicDependencyNode* dependencyNode, bool singleBranch, CCalculationAlgorithmContextBase* calcAlgContext) { CNonDeterministicDependencyTrackPoint* nonDepTrackPoint = nullptr; if (mConfBuildDependencies && dependencyNode) { if (singleBranch) { CBranchTreeNode* branchNode = calcAlgContext->getNewBranchTreeNode(); nonDepTrackPoint = dependencyNode->getDependencyTrackPointBranch(); branchNode->branchingIncrement(nonDepTrackPoint); nonDepTrackPoint->initBranch(branchNode); } else { CBranchTreeNode* branchNode = calcAlgContext->getUsedBranchTreeNode(); nonDepTrackPoint = dependencyNode->getDependencyTrackPointBranch(); branchNode->branchingIncrement(nonDepTrackPoint); nonDepTrackPoint->initBranch(branchNode); } } return nonDepTrackPoint; } CClashedDependencyDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::createIndividualMergeCausingDescriptors(CClashedDependencyDescriptor* prevClashes, CIndividualProcessNode*& processIndi, CIndividualLinkEdge* link, CSortedNegLinker* conceptAddLinker, CCalculationAlgorithmContextBase* calcAlgContext) { CClashedDependencyDescriptor* clashDes = prevClashes; if (link->getDependencyTrackPoint() != processIndi->getDependencyTrackPoint()) { clashDes = createClashedIndividualLinkDescriptor(clashDes,link,link->getDependencyTrackPoint(),calcAlgContext); } CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CSortedNegLinker* conceptAddLinkerIt = conceptAddLinker; while (conceptAddLinkerIt) { CConcept* concept = conceptAddLinkerIt->getData(); bool conNegation = conceptAddLinkerIt->isNegated(); CConceptDescriptor* containedConDes = nullptr; CDependencyTrackPoint* containedDepTrackPoint = nullptr; conSet->getConceptDescriptor(concept,containedConDes,containedDepTrackPoint); clashDes = createClashedConceptDescriptor(clashDes,processIndi,containedConDes,containedDepTrackPoint,calcAlgContext); conceptAddLinkerIt = conceptAddLinkerIt->getNext(); } return clashDes; } CClashedDependencyDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::createClashedConceptDescriptor(CClashedDependencyDescriptor* prevClashes, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CClashedDependencyDescriptor* clashDes = calcAlgContext->getClashDescriptorFactory()->createClashedConceptDescriptor(prevClashes,processIndi,conDes,prevDepTrackPoint,calcAlgContext); return clashDes; } CClashedDependencyDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::createClashedIndividualLinkDescriptor(CClashedDependencyDescriptor* prevClashes, CIndividualLinkEdge* link, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CClashedDependencyDescriptor* clashDes = calcAlgContext->getClashDescriptorFactory()->createClashedIndividualLinkDescriptor(prevClashes,link,prevDepTrackPoint,calcAlgContext); return clashDes; } CClashedDependencyDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::createClashedIndividualDistinctDescriptor(CClashedDependencyDescriptor* prevClashes, CDistinctEdge* distinct, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CClashedDependencyDescriptor* clashDes = calcAlgContext->getClashDescriptorFactory()->createClashedIndividualDistinctDescriptor(prevClashes,distinct,prevDepTrackPoint,calcAlgContext); return clashDes; } CClashedDependencyDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::createClashedNegationDisjointDescriptor(CClashedDependencyDescriptor* prevClashes, CNegationDisjointEdge* disjointNegLink, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CClashedDependencyDescriptor* clashDes = calcAlgContext->getClashDescriptorFactory()->createClashedNegationDisjointDescriptor(prevClashes,disjointNegLink,prevDepTrackPoint,calcAlgContext); return clashDes; } void CCalculationTableauCompletionTaskHandleAlgorithm::executeORBranching(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CBranchingORProcessingRestrictionSpecification* plannedBranchingProcessRestriction, CCalculationAlgorithmContextBase* calcAlgContext) { ++mAppliedORRuleCount; STATINC(OREXECUTIONCOUNT,calcAlgContext); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); CSortedNegLinker* containedOperand = nullptr; CSortedNegLinker* firstNotPosAndNegContainedOperand = nullptr; CSortedNegLinker* secondNotPosAndNegContainedOperand = nullptr; CPROCESSINGLIST< CSortedNegLinker* > notContainedOperandsList(calcAlgContext->getUsedTaskProcessorContext()); cint64 notPosAndNegContainedOperandCount = 0; if (plannedBranchingProcessRestriction) { containedOperand = plannedBranchingProcessRestriction->getContainedOperand(); firstNotPosAndNegContainedOperand = plannedBranchingProcessRestriction->getFirstNotPosAndNegContainedOperand(); secondNotPosAndNegContainedOperand = plannedBranchingProcessRestriction->getSecondNotPosAndNegContainedOperand(); } CClashedDependencyDescriptor* clashConDesLinker = plannedBranchingProcessRestriction->getClashedConceptDescriptors(); if (!containedOperand) { // check if one operand is already in the concept set if (firstNotPosAndNegContainedOperand) { bool containsNegation = false; bool correctNegation = firstNotPosAndNegContainedOperand->isNegated() ^ negate; CConceptDescriptor* containedConDes = nullptr; CDependencyTrackPoint* containedConDepTrackPoint = nullptr; bool contains = conSet->getConceptDescriptor(firstNotPosAndNegContainedOperand->getData(),containedConDes,containedConDepTrackPoint); if (contains) { containsNegation = containedConDes->isNegated(); if (containsNegation == correctNegation) { containedOperand = firstNotPosAndNegContainedOperand; // update first/second not contained operands firstNotPosAndNegContainedOperand = secondNotPosAndNegContainedOperand; } else { firstNotPosAndNegContainedOperand = nullptr; clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,containedConDes,containedConDepTrackPoint,calcAlgContext); } } else { ++notPosAndNegContainedOperandCount; notContainedOperandsList.append(firstNotPosAndNegContainedOperand); } if (!containedOperand && secondNotPosAndNegContainedOperand) { bool remainingDisjunctsUseless = false; CSortedNegLinker* containsOperandCheckIt = secondNotPosAndNegContainedOperand; secondNotPosAndNegContainedOperand = nullptr; while (containsOperandCheckIt) { bool containsNegation = false; bool correctNegation = containsOperandCheckIt->isNegated() ^ negate; CConceptDescriptor* containedConDes = nullptr; CDependencyTrackPoint* containedConDepTrackPoint = nullptr; bool contains = conSet->getConceptDescriptor(containsOperandCheckIt->getData(),containedConDes,containedConDepTrackPoint); if (contains) { containsNegation = containedConDes->isNegated(); if (containsNegation == correctNegation) { containedOperand = containsOperandCheckIt; break; } else { clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,containedConDes,containedConDepTrackPoint,calcAlgContext); } } else { if (!hasSaturatedClashedFlagForConcept(containsOperandCheckIt->getData(),correctNegation,calcAlgContext)) { bool criticalWithOtherOperand = false; if (remainingDisjunctsUseless) { criticalWithOtherOperand = true; } for (CPROCESSINGLIST< CSortedNegLinker* >::const_iterator opIt = notContainedOperandsList.constBegin(), opItEnd = notContainedOperandsList.constEnd(); opIt != opItEnd && !criticalWithOtherOperand; ++opIt) { CSortedNegLinker* notContOpLinker = *opIt; if (containsOperandCheckIt->getData() == notContOpLinker->getData()) { if (containsOperandCheckIt->isNegated() == notContOpLinker->isNegated()) { criticalWithOtherOperand = true; } else { remainingDisjunctsUseless = true; } } } if (!criticalWithOtherOperand) { ++notPosAndNegContainedOperandCount; notContainedOperandsList.append(containsOperandCheckIt); // update first/second not contained operands if (!firstNotPosAndNegContainedOperand) { firstNotPosAndNegContainedOperand = containsOperandCheckIt; } else { if (!secondNotPosAndNegContainedOperand) { secondNotPosAndNegContainedOperand = containsOperandCheckIt; } } } } } containsOperandCheckIt = containsOperandCheckIt->getNext(); } } } } if (!containedOperand) { // collect clashes // do branching if (calcAlgContext->getUsedUnsatisfiableCacheRetrievalStrategy()->testUnsatisfiableCacheForDisjunctionBranching(conProDes,processIndi,¬ContainedOperandsList)) { testIndividualNodeUnsatisfiableCached(processIndi,calcAlgContext); } CORDependencyNode* orDependencyNode = createORDependency(processIndi,conDes,depTrackPoint,calcAlgContext); if (orDependencyNode && clashConDesLinker) { orDependencyNode->addBranchClashes(clashConDesLinker); } if (notPosAndNegContainedOperandCount == 1) { STATINC(ORSINGLEBRANCHCOUNT,calcAlgContext); CNonDeterministicDependencyTrackPoint* newDependencyTrackPoint = createNonDeterministicDependencyTrackPointBranch(orDependencyNode,true,calcAlgContext); CPROCESSINGLIST< CSortedNegLinker* >::const_iterator opIt = notContainedOperandsList.constBegin(); CSortedNegLinker* operandConcept = *opIt; bool addOpNegated = operandConcept->isNegated() ^ negate; addConceptToIndividual(operandConcept->getData(),addOpNegated,processIndi,newDependencyTrackPoint,true,false,calcAlgContext); if (calcAlgContext->getUsedUnsatisfiableCacheRetrievalStrategy()->testUnsatisfiableCacheForBranchedDisjuncts(conProDes,processIndi,operandConcept)) { testIndividualNodeUnsatisfiableCached(processIndi,calcAlgContext); } } else if (notPosAndNegContainedOperandCount > 1) { STATINC(ORMULTIPLEBRANCHCOUNT,calcAlgContext); CSatisfiableCalculationTask* newTaskList = createDependendBranchingTaskList(notPosAndNegContainedOperandCount,calcAlgContext); CTaskProcessorContext* processorContext = calcAlgContext->getUsedTaskProcessorContext(); // semantic branching CPROCESSINGLIST< CSortedNegLinker* >::const_iterator branchOpConIt = notContainedOperandsList.constBegin(); CSatisfiableCalculationTask* newTaskIt = newTaskList; cint64 branchNumber = 1; while (newTaskIt) { CSatisfiableCalculationTask* newSatCalcTask = newTaskIt; CProcessContext* newProcessContext = newSatCalcTask->getProcessContext(processorContext); CCalculationAlgorithmContextBase* newCalcAlgContext = createCalculationAlgorithmContext(processorContext,newProcessContext,newSatCalcTask); CProcessingDataBox* newProcessingDataBox = newSatCalcTask->getProcessingDataBox(); CProcessTagger* newProcessTagger = newCalcAlgContext->getUsedProcessTagger(); newProcessTagger->incBranchingTag(); newProcessTagger->incLocalizationTag(); CIndividualProcessNode* newLocIndiNode = getLocalizedIndividual(processIndi,false,newCalcAlgContext); CConceptProcessingQueue* newConProcQueue = newLocIndiNode->getConceptProcessingQueue(true); CNonDeterministicDependencyTrackPoint* newDependencyTrackPoint = createNonDeterministicDependencyTrackPointBranch(orDependencyNode,false,newCalcAlgContext); CSortedNegLinker* branchingOperandConcept = nullptr; CPROCESSINGLIST< CSortedNegLinker* >::const_iterator opIt = notContainedOperandsList.constBegin(); do { STATINC(TASKORBRANCHCREATIONCOUNT,calcAlgContext); CSortedNegLinker* operandConcept = *opIt; bool posOperand = (opIt == branchOpConIt); if (posOperand) { branchingOperandConcept = operandConcept; } bool addOpNegated = !posOperand ^ operandConcept->isNegated() ^ negate; if (posOperand || mConfSemanticBranching || mConfAtomicSemanticBranching && isConceptAdditionAtomaric(operandConcept->getData(),addOpNegated,newCalcAlgContext)) { addConceptToIndividual(operandConcept->getData(),addOpNegated,newLocIndiNode,newDependencyTrackPoint,false,true,newCalcAlgContext); } } while (opIt++ != branchOpConIt); ++branchOpConIt; if (calcAlgContext->getUsedUnsatisfiableCacheRetrievalStrategy()->testUnsatisfiableCacheForBranchedDisjuncts(conProDes,processIndi,branchingOperandConcept)) { addIndividualNodeForCacheUnsatisfiableRetrieval(newLocIndiNode,newCalcAlgContext); } prepareBranchedTaskProcessing(newLocIndiNode,newTaskIt,newCalcAlgContext); // set new task priority double newTaskPriority = calcAlgContext->getUsedTaskPriorityStrategy()->getPriorityForTaskBranching(newSatCalcTask,calcAlgContext->getUsedSatisfiableCalculationTask(),newLocIndiNode,conDes,branchingOperandConcept,branchNumber); newSatCalcTask->setTaskPriority(newTaskPriority); ++branchNumber; newTaskIt = (CSatisfiableCalculationTask*)newTaskIt->getNext(); } processorContext->getTaskProcessorCommunicator()->communicateTaskCreation(newTaskList); throw CCalculationStopProcessingException(true); } else { // throw clash clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,conDes,depTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(clashConDesLinker); } } else { // contains at least one operand, branching is not necessary, ignoring or concept } } bool CCalculationTableauCompletionTaskHandleAlgorithm::isConceptAdditionAtomaric(CConcept* addingConcept, bool negated, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 opCode = addingConcept->getOperatorCode(); if (negated && (opCode == CCSUB || opCode == CCIMPLTRIG) || opCode == CCATOM) { return true; } return false; } void CCalculationTableauCompletionTaskHandleAlgorithm::applyORRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(ORRULEAPPLICATIONCOUNT,calcAlgContext); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); cint64 opCount = concept->getOperandCount(); if (opCount <= 0) { // throw clash CClashedDependencyDescriptor* clashConDesLinker = nullptr; clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,conDes,depTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(clashConDesLinker); } else if (opCount == 1) { // apply AND rule applyANDRule(processIndi,conProDes,negate,calcAlgContext); } else { CBranchingORProcessingRestrictionSpecification* plannedBranchingProcessRestriction = nullptr; if (!planORProcessing(processIndi,conProDes,negate,&plannedBranchingProcessRestriction,calcAlgContext)) { if (mConfSatExpCachedDisjAbsorp && processIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATISFIABLECACHED | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED)) { STATINC(SATCACHEDABSORBEDDISJUNCTIONCONCEPTSCOUNT,calcAlgContext); addSatisfiableCachedAbsorbedDisjunctionConcept(conDes,processIndi,plannedBranchingProcessRestriction,depTrackPoint,calcAlgContext); } else { // delaying failed, execute OR rule executeORBranching(processIndi,conProDes,negate,plannedBranchingProcessRestriction,calcAlgContext); } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyIMPLICATIONRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(IMPLICATIONRULEAPPLICATIONCOUNT,calcAlgContext); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); CProcessingRestrictionSpecification* procRest = conProDes->getProcessingRestrictionSpecification(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opLinker = concept->getOperandList(); CTriggeredImplicationProcessingRestrictionSpecification* triggImpProcRes = nullptr; CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); if (!procRest) { triggImpProcRes = CObjectAllocator< CTriggeredImplicationProcessingRestrictionSpecification >::allocateAndConstruct(taskMemMan); triggImpProcRes->setConceptImplicationTrigger(opLinker->getNext()); } else { CTriggeredImplicationProcessingRestrictionSpecification* lastTriggImpProcRes = (CTriggeredImplicationProcessingRestrictionSpecification*)procRest; triggImpProcRes = CObjectAllocator< CTriggeredImplicationProcessingRestrictionSpecification >::allocateAndConstruct(taskMemMan); triggImpProcRes->initImplicationTriggeringProcessingRestriction(lastTriggImpProcRes); } // search next not existing trigger bool allTriggersAvailable = false; CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(true); while (triggImpProcRes->hasConceptImplicationTrigger()) { CSortedNegLinker* nextTrigger = triggImpProcRes->getConceptImplicationTrigger(); CConcept* triggerConcept = nextTrigger->getData(); CConceptDescriptor* triggerConDes = nullptr; CDependencyTrackPoint* triggerDepTrackPoint = nullptr; if (conSet->getConceptDescriptor(triggerConcept,triggerConDes,triggerDepTrackPoint)) { if (triggerConDes->isNegated() == nextTrigger->isNegated()) { return; } else { if (triggerDepTrackPoint != depTrackPoint) { // add dependency track point CCONNECTIONDependencyNode* connDep = createCONNECTIONDependency(processIndi,triggerConDes,triggerDepTrackPoint,calcAlgContext); connDep->setNext(triggImpProcRes->getImplicationDependency()); triggImpProcRes->setImplicationDependency(connDep); } triggImpProcRes->setConceptImplicationTrigger(nextTrigger->getNext()); } } else { break; } } if (!triggImpProcRes->hasConceptImplicationTrigger()) { allTriggersAvailable = true; } if (!allTriggersAvailable) { // install to trigger STATINC(IMPLICATIONTRIGGERINGCOUNT,calcAlgContext); CSortedNegLinker* nextTrigger = triggImpProcRes->getConceptImplicationTrigger(); CConcept* triggerConcept = nextTrigger->getData(); bool triggerNegation = !nextTrigger->isNegated(); addConceptToReapplyQueue(conDes,triggerConcept,triggerNegation,processIndi,triggImpProcRes,depTrackPoint,calcAlgContext); } else { STATINC(IMPLICATIONEXECUTINGCOUNT,calcAlgContext); CDependency* triggerDeps = triggImpProcRes->getImplicationDependency(); CDependencyTrackPoint* nextDepTrackPoint = nullptr; CIMPLICATIONDependencyNode* implDepNode = createIMPLICATIONDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,triggerDeps,calcAlgContext); CConcept* implConcept = opLinker->getData(); bool impConNeg = opLinker->isNegated(); addConceptToIndividual(implConcept,impConNeg,processIndi,nextDepTrackPoint,true,false,calcAlgContext); } } CSatisfiableCalculationTask* CCalculationTableauCompletionTaskHandleAlgorithm::createDependendBranchingTaskList(cint64 newTaskCount, CCalculationAlgorithmContextBase* calcAlgContext) { CSatisfiableCalculationTask* taskList = nullptr; CMemoryTemporaryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedTemporaryMemoryAllocationManager(); for (cint64 i = 0; i < newTaskCount; ++i) { STATINC(TASKCREATIONCOUNT,calcAlgContext); CSatisfiableCalculationTask* satCalcTask = CObjectMemoryPoolAllocator::allocateAndConstructWithMemroyPool(taskMemMan); satCalcTask->initBranchDependedSatisfiableCalculationTask(calcAlgContext->getUsedSatisfiableCalculationTask(),calcAlgContext->getTaskProcessorContext()); if (calcAlgContext->getUsedSatisfiableCalculationTask()->getTaskDepth() < 90) { satCalcTask->setTaskID(mDebugTaskIDVector[calcAlgContext->getUsedSatisfiableCalculationTask()->getTaskDepth()+1]++); } taskList = (CSatisfiableCalculationTask*)satCalcTask->append(taskList); } return taskList; } void CCalculationTableauCompletionTaskHandleAlgorithm::prepareBranchedTaskProcessing(CIndividualProcessNode*& individual, CSatisfiableCalculationTask* newTask, CCalculationAlgorithmContextBase* calcAlgContext) { addIndividualToProcessingQueue(individual,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::installConceptRoleBranchTrigger(CIndividualProcessNode*& processIndi, CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CProcessingRestrictionSpecification* procRest, CConceptRoleBranchingTrigger* trigger, CCalculationAlgorithmContextBase* calcAlgContext) { if (trigger->isConceptTrigger()) { STATINC(CONCEPTTRIGGERINSTALLCOUNT,calcAlgContext); CConcept* triggerConcept = trigger->getTriggerConcept(); bool triggerNegation = trigger->getTriggerNegation(); addConceptToReapplyQueue(conceptDescriptor,triggerConcept,triggerNegation,processIndi,procRest,depTrackPoint,calcAlgContext); } else { STATINC(ROLETRIGGERINSTALLCOUNT,calcAlgContext); CRole* role = trigger->getTriggerRole(); addConceptToReapplyQueue(conceptDescriptor,role,processIndi,procRest,depTrackPoint,calcAlgContext); } } CConceptRoleBranchingTrigger* CCalculationTableauCompletionTaskHandleAlgorithm::searchNextConceptRoleBranchTrigger(CIndividualProcessNode*& processIndi, CConceptRoleBranchingTrigger* triggers, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyRoleSuccessorHash* reapplySuccHash = processIndi->getReapplyRoleSuccessorHash(false); CReapplyConceptLabelSet* conSet = processIndi->getReapplyConceptLabelSet(false); while (triggers) { if (triggers->isConceptTrigger()) { CConcept* triggerConcept = triggers->getTriggerConcept(); bool triggerNegation = triggers->getTriggerNegation(); if (!conSet || !conSet->containsConcept(triggerConcept,triggerNegation)) { return triggers; } } else { CRole* role = triggers->getTriggerRole(); if (!reapplySuccHash || !reapplySuccHash->hasRoleSuccessor(role)) { return triggers; } } triggers = triggers->getNextBranchingTrigger(); } return nullptr; } void CCalculationTableauCompletionTaskHandleAlgorithm::applySELFRule(CIndividualProcessNode*& processIndi, CConceptProcessDescriptor*& conProDes, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(SELFRULEAPPLICATIONCOUNT,calcAlgContext); CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CDependencyTrackPoint* depTrackPoint = conProDes->getDependencyTrackPoint(); bool reapplied = conProDes->isConceptReapplied(); CIndividualLinkEdge* restLink = getLinkProcessingRestriction(conProDes); if (!negate) { CIndividualLinkEdge* link = getIndividualNodeLink(processIndi,processIndi,role,calcAlgContext); if (!link) { // self edge/link does not exist // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CSELFDependencyNode* selfDepNode = createSELFDependency(nextDepTrackPoint,processIndi,conDes,depTrackPoint,calcAlgContext); createNewIndividualsLinksReapplyed(processIndi,processIndi,role->getIndirectSuperRoleList(),role,nextDepTrackPoint,true,calcAlgContext); } } else { if (restLink) { if (restLink->isDestinationIndividual(processIndi) && restLink->isSourceIndividual(processIndi)) { // throw clash CClashedDependencyDescriptor* clashDes = nullptr; clashDes = createClashedIndividualLinkDescriptor(clashDes,restLink,restLink->getDependencyTrackPoint(),calcAlgContext); clashDes = createClashedConceptDescriptor(clashDes,processIndi,conDes,depTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(clashDes); } } else { CIndividualLinkEdge* link = getIndividualNodeLink(processIndi,processIndi,role,calcAlgContext); if (link) { // throw clash CClashedDependencyDescriptor* clashDes = nullptr; clashDes = createClashedIndividualLinkDescriptor(clashDes,link,link->getDependencyTrackPoint(),calcAlgContext); clashDes = createClashedConceptDescriptor(clashDes,processIndi,conDes,depTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(clashDes); } } if (!reapplied) { addConceptToReapplyQueue(conDes,role,processIndi,true,depTrackPoint,calcAlgContext); } } } CIndividualLinkEdge* CCalculationTableauCompletionTaskHandleAlgorithm::getLinkProcessingRestriction(CConceptProcessDescriptor*& conProDes) { CProcessingRestrictionSpecification* procRestSpec = conProDes->getProcessingRestrictionSpecification(); CIndividualLinkEdge* restLink = nullptr; if (procRestSpec) { CLinkProcessingRestrictionSpecification* linkProcRestSpec = (CLinkProcessingRestrictionSpecification*)procRestSpec; restLink = linkProcRestSpec->getLinkRestriction(); } return restLink; } CIndividualLinkEdge* CCalculationTableauCompletionTaskHandleAlgorithm::getIndividualNodeLink(CIndividualProcessNode*& indiSource, CIndividualProcessNode*& indiDestination, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { CSuccessorRoleHash* succRoleHash = indiSource->getSuccessorRoleHash(false); if (succRoleHash) { CSuccessorRoleIterator succRoleIt = succRoleHash->getSuccessorRoleIterator(indiSource->getIndividualID()); while (succRoleIt.hasNext()) { CIndividualLinkEdge* link = succRoleIt.next(true); if (link->getLinkRole() == role) { return link; } } } return nullptr; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isLabelConceptSubSetIgnoreNominals(CReapplyConceptLabelSet* subConceptSet, CReapplyConceptLabelSet* superConceptSet, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(LABELCONCEPTSUBSETTESTCOUNT,calcAlgContext); cint64 subConSetCount = subConceptSet->getConceptCount(); cint64 superConSetCount = superConceptSet->getConceptCount(); cint64 thresholdFactor = mMapComparisonDirectLookupFactor; if (subConSetCount * thresholdFactor < superConSetCount) { CReapplyConceptLabelSetIterator subConSetIt = subConceptSet->getConceptLabelSetIterator(true,false,false); while (subConSetIt.hasValue()) { CConceptDescriptor* subConDes = subConSetIt.getConceptDescriptor(); if (subConDes->getConcept()->getOperatorCode() != CCNOMINAL) { if (!superConceptSet->containsConceptDescriptor(subConDes)) { return false; } } subConSetIt.moveNext(); } } else { CReapplyConceptLabelSetIterator subConSetIt(subConceptSet->getConceptLabelSetIterator(true,false,false)); CReapplyConceptLabelSetIterator superConSetIt(superConceptSet->getConceptLabelSetIterator(true,false,false)); CConceptDescriptor* superConDes = superConSetIt.getConceptDescriptor(); cint64 superConTag = superConDes->getConceptTag(); superConSetIt.moveNext(); while (subConSetIt.hasValue()) { CConceptDescriptor* subConDes = subConSetIt.getConceptDescriptor(); if (subConDes->getConcept()->getOperatorCode() != CCNOMINAL) { cint64 subConTag = subConDes->getConceptTag(); while (superConTag < subConTag) { if (!superConSetIt.hasValue()) { return false; } superConDes = superConSetIt.getConceptDescriptor(); superConTag = superConDes->getConceptTag(); superConSetIt.moveNext(); } if (subConTag != superConTag) { return false; } else { if (subConDes->isNegated() != superConDes->isNegated()) { return false; } } } subConSetIt.moveNext(); } } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isLabelConceptSubSet(CReapplyConceptLabelSet* subConceptSet, CReapplyConceptLabelSet* superConceptSet, CConceptDescriptor** firstNotEntailedConDes, bool* equalConSet, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(LABELCONCEPTSUBSETTESTCOUNT,calcAlgContext); cint64 subConSetCount = subConceptSet->getConceptCount(); cint64 superConSetCount = superConceptSet->getConceptCount(); if (equalConSet) { if (subConSetCount != superConSetCount) { *equalConSet = false; } else { *equalConSet = true; } } if (subConSetCount > superConSetCount) { return false; } if (superConSetCount == 0) { return true; } cint64 thresholdFactor = 10; if (subConSetCount * thresholdFactor < superConSetCount) { CReapplyConceptLabelSetIterator subConSetIt = subConceptSet->getConceptLabelSetIterator(true,false,false); while (subConSetIt.hasValue()) { CConceptDescriptor* subConDes = subConSetIt.getConceptDescriptor(); if (!superConceptSet->containsConceptDescriptor(subConDes)) { if (firstNotEntailedConDes) { *firstNotEntailedConDes = subConDes; } return false; } subConSetIt.moveNext(); } } else { CReapplyConceptLabelSetIterator subConSetIt = subConceptSet->getConceptLabelSetIterator(true,false,false); CReapplyConceptLabelSetIterator superConSetIt = superConceptSet->getConceptLabelSetIterator(true,false,false); CConceptDescriptor* superConDes = superConSetIt.getConceptDescriptor(); cint64 superConTag = superConDes->getConceptTag(); superConSetIt.moveNext(); while (subConSetIt.hasValue()) { CConceptDescriptor* subConDes = subConSetIt.getConceptDescriptor(); cint64 subConTag = subConDes->getConceptTag(); while (superConTag < subConTag) { if (!superConSetIt.hasValue()) { if (firstNotEntailedConDes) { *firstNotEntailedConDes = subConDes; } return false; } superConDes = superConSetIt.getConceptDescriptor(); superConTag = superConDes->getConceptTag(); superConSetIt.moveNext(); if (equalConSet && superConTag < subConTag) { *equalConSet = false; } } if (subConTag != superConTag) { if (firstNotEntailedConDes) { *firstNotEntailedConDes = subConDes; } if (equalConSet) { *equalConSet = false; } return false; } else { if (subConDes->isNegated() != superConDes->isNegated()) { if (firstNotEntailedConDes) { *firstNotEntailedConDes = subConDes; } if (equalConSet) { *equalConSet = false; } return false; } } subConSetIt.moveNext(); } } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isLabelConceptEqualSet(CReapplyConceptLabelSet* conceptSet1, CReapplyConceptLabelSet* conceptSet2, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(LABELCONCEPTEQUALSETTESTCOUNT,calcAlgContext); cint64 conceptSet1Count = conceptSet1->getConceptCount(); cint64 conceptSet2Count = conceptSet2->getConceptCount(); if (conceptSet1Count != conceptSet2Count) { return false; } if (!conceptSet1->getConceptSignature()->isSignatureEquivalent(conceptSet2->getConceptSignature())) { return false; } CReapplyConceptLabelSetIterator conSet1It = conceptSet1->getConceptLabelSetIterator(true,false,false); CReapplyConceptLabelSetIterator conSet2It = conceptSet2->getConceptLabelSetIterator(true,false,false); while (conSet1It.hasValue()) { if (!conSet2It.hasValue()) { return false; } CConceptDescriptor* conDes1 = conSet1It.getConceptDescriptor(); CConceptDescriptor* conDes2 = conSet2It.getConceptDescriptor(); if (conDes1->getConcept() != conDes2->getConcept()) { return false; } if (conDes1->isNegated() != conDes2->isNegated()) { return false; } conSet1It.moveNext(); conSet2It.moveNext(); } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isPairwiseLabelConceptEqualSet(CReapplyConceptLabelSet* conceptSet1, CReapplyConceptLabelSet* conceptSet1Pair, CReapplyConceptLabelSet* conceptSet2, CReapplyConceptLabelSet* conceptSet2Pair, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(LABELCONCEPTPAIRWISEEQUALSETTESTCOUNT,calcAlgContext); cint64 conceptSet1Count = conceptSet1->getConceptCount(); cint64 conceptSet1PCount = conceptSet1Pair->getConceptCount(); if (conceptSet1Count != conceptSet1PCount) { return false; } cint64 conceptSet2Count = conceptSet2->getConceptCount(); cint64 conceptSet2PCount = conceptSet2Pair->getConceptCount(); if (conceptSet2Count != conceptSet2PCount) { return false; } if (!conceptSet1->getConceptSignature()->isSignatureEquivalent(conceptSet1Pair->getConceptSignature())) { return false; } if (!conceptSet2->getConceptSignature()->isSignatureEquivalent(conceptSet2Pair->getConceptSignature())) { return false; } CReapplyConceptLabelSetIterator conSet1It = conceptSet1->getConceptLabelSetIterator(true,false,false); CReapplyConceptLabelSetIterator conSet1PairIt = conceptSet1Pair->getConceptLabelSetIterator(true,false,false); while (conSet1It.hasValue()) { if (!conSet1PairIt.hasValue()) { return false; } CConceptDescriptor* conDes1 = conSet1It.getConceptDescriptor(); CConceptDescriptor* conDes1Pair = conSet1PairIt.getConceptDescriptor(); if (conDes1->getConcept() != conDes1Pair->getConcept()) { return false; } if (conDes1->isNegated() != conDes1Pair->isNegated()) { return false; } conSet1It.moveNext(); conSet1PairIt.moveNext(); } CReapplyConceptLabelSetIterator conSet2It = conceptSet2->getConceptLabelSetIterator(true,false); CReapplyConceptLabelSetIterator conSet2PairIt = conceptSet2Pair->getConceptLabelSetIterator(true,false,false); while (conSet2It.hasValue()) { if (!conSet2PairIt.hasValue()) { return false; } CConceptDescriptor* conDes2 = conSet2It.getConceptDescriptor(); CConceptDescriptor* conDes2Pair = conSet2PairIt.getConceptDescriptor(); if (conDes2->getConcept() != conDes2Pair->getConcept()) { return false; } if (conDes2->isNegated() != conDes2Pair->isNegated()) { return false; } conSet2It.moveNext(); conSet2PairIt.moveNext(); } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::hasOptimizedBlockingB2AutomateTransitionOperands(CConcept* concept, CRole* role, CReapplyConceptLabelSet* vConSet, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(OPTIMIZEDBLOCKINGB2AUTOMATETRANSACTIONTESTCOUNT,calcAlgContext); cint64 opCode = concept->getOperatorCode(); CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQAND_TYPE)) { // recursive CSortedNegLinker* opLinkerIt = concept->getOperandList(); while (opLinkerIt) { CConcept* opConcept = opLinkerIt->getData(); if (!hasOptimizedBlockingB2AutomateTransitionOperands(opConcept,role,vConSet,calcAlgContext)) { return false; } opLinkerIt = opLinkerIt->getNext(); } } else if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQALL_TYPE)) { CRole* conRole = concept->getRole(); if (conRole == role) { CSortedNegLinker* opLinkerIt = concept->getOperandList(); while (opLinkerIt) { CConcept* opConcept = opLinkerIt->getData(); if (!vConSet->containsConcept(opConcept,false)) { return false; } opLinkerIt = opLinkerIt->getNext(); } } } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isNominalVariablePropagationBindingSubSet(CIndividualProcessNode*& testIndi, CIndividualProcessNode*& blockingIndi, CIndividualNodeBlockingTestData* blockData, bool testContinueBlocking, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* ancestorIndiNode = nullptr; CConceptPropagationBindingSetHash* conPropBindSetHash = testIndi->getConceptPropagationBindingSetHash(false); CConceptPropagationBindingSetHash* blockerConPropBindSetHash = blockerConPropBindSetHash = blockingIndi->getConceptPropagationBindingSetHash(false); if (conPropBindSetHash) { for (CConceptPropagationBindingSetHash::iterator it1 = conPropBindSetHash->begin(), it1End = conPropBindSetHash->end(); it1 != it1End; ++it1) { CConceptPropagationBindingSetHashData& hashData = it1.value(); CPropagationBindingSet* propBindSet = hashData.mUsePropBindingSet; CConceptDescriptor* conDes = propBindSet->getConceptDescriptor(); if (propBindSet && conDes) { CConcept* concept = conDes->getConcept(); CPropagationBindingSet* blockerPropBindSet = nullptr; CPropagationBindingMap* propBindMap = propBindSet->getPropagationBindingMap(); for (CPropagationBindingMap::iterator it2 = propBindMap->begin(), it2End = propBindMap->end(); it2 != it2End; ++it2) { CPropagationBindingMapData& mapData = it2.value(); CPropagationBindingDescriptor* propBindDes = mapData.getPropagationBindingDescriptor(); if (propBindDes) { CPropagationBinding* propBind = propBindDes->getPropagationBinding(); if (propBind) { CVariable* propBindVar = propBind->getBindedVariable(); if (propBindVar) { if (propBindVar->isNominalVariable()) { // propagation variable binding is also required in blocker node if (!blockerPropBindSet) { if (!blockerConPropBindSetHash) { return false; } blockerPropBindSet = blockerConPropBindSetHash->getPropagationBindingSet(concept,false); if (!blockerPropBindSet) { return false; } } bool blockingPossible = false; CPropagationBindingDescriptor* blockerPropBindDes = blockerPropBindSet->getPropagationBindingDescriptor(propBind); if (blockerPropBindDes) { blockingPossible = true; } if (!blockingPossible) { return false; } } } } } } } } } if (blockerConPropBindSetHash) { if (!ancestorIndiNode) { ancestorIndiNode = getAncestorIndividual(testIndi,calcAlgContext); } if (ancestorIndiNode) { CConceptPropagationBindingSetHash* ancConPropBindSetHash = ancestorIndiNode->getConceptPropagationBindingSetHash(false); for (CConceptPropagationBindingSetHash::iterator it1 = blockerConPropBindSetHash->begin(), it1End = blockerConPropBindSetHash->end(); it1 != it1End; ++it1) { CConceptPropagationBindingSetHashData& hashData = it1.value(); CPropagationBindingSet* blockerPropBindSet = hashData.mUsePropBindingSet; CConceptDescriptor* conDes = blockerPropBindSet->getConceptDescriptor(); if (blockerPropBindSet && conDes) { CConcept* concept = conDes->getConcept(); cint64 opCode = concept->getOperatorCode(); bool negation = conDes->isNegated(); if (!negation && (opCode == CCPBINDALL || opCode == CCPBINDAQALL)) { CRole* role = concept->getRole(); for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); if (testIndi->hasRoleSuccessorToIndividual(role,ancestorIndiNode,true)) { if (!ancConPropBindSetHash) { return false; } else { CPropagationBindingSet* ancPropBindSet = nullptr; CPropagationBindingMap* propBindMap = blockerPropBindSet->getPropagationBindingMap(); for (CPropagationBindingMap::iterator it2 = propBindMap->begin(), it2End = propBindMap->end(); it2 != it2End; ++it2) { CPropagationBindingMapData& mapData = it2.value(); CPropagationBindingDescriptor* blockerPropBindDes = mapData.getPropagationBindingDescriptor(); if (blockerPropBindDes) { CPropagationBinding* blockerPropBind = blockerPropBindDes->getPropagationBinding(); if (blockerPropBind) { CVariable* blockerPropBindVar = blockerPropBind->getBindedVariable(); if (blockerPropBindVar) { if (blockerPropBindVar->isNominalVariable()) { bool blockingPossible = false; if (!ancPropBindSet) { ancPropBindSet = ancConPropBindSetHash->getPropagationBindingSet(opConcept); if (!ancPropBindSet) { return false; } } CPropagationBindingDescriptor* ancPropBindDes = ancPropBindSet->getPropagationBindingDescriptor(blockerPropBind); if (ancPropBindDes) { blockingPossible = true; } if (!blockingPossible) { return false; } } } } } } } } } } } } } } CConceptVariableBindingPathSetHash* conVarBindSetHash = testIndi->getConceptVariableBindingPathSetHash(false); CConceptVariableBindingPathSetHash* blockerConVarBindSetHash = blockerConVarBindSetHash = blockingIndi->getConceptVariableBindingPathSetHash(false); if (conVarBindSetHash) { for (CConceptVariableBindingPathSetHash::iterator it1 = conVarBindSetHash->begin(), it1End = conVarBindSetHash->end(); it1 != it1End; ++it1) { CConceptVariableBindingPathSetHashData& hashData = it1.value(); CVariableBindingPathSet* varBindSet = hashData.mUseVariableBindingPathSet; CConceptDescriptor* conDes = varBindSet->getConceptDescriptor(); if (varBindSet && conDes) { CConcept* concept = conDes->getConcept(); CVariableBindingPathSet* blockerVarBindSet = nullptr; CVariableBindingPathMap* varBindMap = varBindSet->getVariableBindingPathMap(); for (CVariableBindingPathMap::iterator it2 = varBindMap->begin(), it2End = varBindMap->end(); it2 != it2End; ++it2) { CVariableBindingPathMapData& mapData = it2.value(); CVariableBindingPathDescriptor* varBindDes = mapData.getVariableBindingPathDescriptor(); if (varBindDes) { CVariableBindingPath* varBindPath = varBindDes->getVariableBindingPath(); if (varBindPath) { // propagation variable binding is also required in blocker node if (!blockerVarBindSet) { if (!blockerConVarBindSetHash) { return false; } blockerVarBindSet = blockerConVarBindSetHash->getVariableBindingPathSet(concept,false); if (!blockerVarBindSet) { return false; } } bool blockingPossible = false; CVariableBindingPathDescriptor* blockerVarBindDes = blockerVarBindSet->getVariableBindingPathDescriptor(varBindPath); if (blockerVarBindDes) { blockingPossible = true; } if (!blockingPossible) { return false; } } } } } } } if (blockerConVarBindSetHash) { if (!ancestorIndiNode) { ancestorIndiNode = getAncestorIndividual(testIndi,calcAlgContext); } if (ancestorIndiNode) { CConceptVariableBindingPathSetHash* ancConVarBindSetHash = ancestorIndiNode->getConceptVariableBindingPathSetHash(false); for (CConceptVariableBindingPathSetHash::iterator it1 = blockerConVarBindSetHash->begin(), it1End = blockerConVarBindSetHash->end(); it1 != it1End; ++it1) { CConceptVariableBindingPathSetHashData& hashData = it1.value(); CVariableBindingPathSet* blockerVarBindSet = hashData.mUseVariableBindingPathSet; CConceptDescriptor* conDes = blockerVarBindSet->getConceptDescriptor(); if (blockerVarBindSet && conDes) { CConcept* concept = conDes->getConcept(); cint64 opCode = concept->getOperatorCode(); bool negation = conDes->isNegated(); if (!negation && (opCode == CCVARBINDALL || opCode == CCVARBINDAQALL)) { CRole* role = concept->getRole(); for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); if (testIndi->hasRoleSuccessorToIndividual(role,ancestorIndiNode,true)) { if (!ancConVarBindSetHash) { return false; } else { CVariableBindingPathSet* ancVarBindSet = nullptr; CVariableBindingPathMap* varBindMap = blockerVarBindSet->getVariableBindingPathMap(); for (CVariableBindingPathMap::iterator it2 = varBindMap->begin(), it2End = varBindMap->end(); it2 != it2End; ++it2) { CVariableBindingPathMapData& mapData = it2.value(); CVariableBindingPathDescriptor* blockerVarBindDes = mapData.getVariableBindingPathDescriptor(); if (blockerVarBindDes) { CVariableBindingPath* blockerVarBindPath = blockerVarBindDes->getVariableBindingPath(); if (blockerVarBindPath) { bool blockingPossible = false; if (!ancVarBindSet) { ancVarBindSet = ancConVarBindSetHash->getVariableBindingPathSet(opConcept); if (!ancVarBindSet) { return false; } } CVariableBindingPathDescriptor* ancVarBindPathDes = ancVarBindSet->getVariableBindingPathDescriptor(blockerVarBindPath); if (ancVarBindPathDes) { blockingPossible = true; } if (!blockingPossible) { return false; } } } } } } } } } } } } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isLabelConceptOptimizedBlocking(CIndividualProcessNode*& testIndi, CIndividualProcessNode*& blockingIndi, CIndividualNodeBlockingTestData* blockData, bool testContinueBlocking, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(OPTIMIZEDBLOCKINGTESTCOUNT,calcAlgContext); CIndividualProcessNode* wNode = testIndi; CIndividualProcessNode* wPredNode = blockingIndi; CReapplyConceptLabelSet* wSubConSet = wNode->getReapplyConceptLabelSet(false); CReapplyConceptLabelSet* wPredSuperConSet = wPredNode->getReapplyConceptLabelSet(false); CConceptDescriptor* firstNotEntailedConDes = nullptr; // B1 test bool equalSet = false; bool subSet = isLabelConceptSubSet(wSubConSet,wPredSuperConSet,&firstNotEntailedConDes,&equalSet,calcAlgContext); if (!subSet) { return false; } CIndividualProcessNode* vNode = getAncestorIndividual(wNode,calcAlgContext); CReapplyConceptLabelSet* vConSet = vNode->getReapplyConceptLabelSet(false); // B2 test CSuccessorRoleHash* ancRoleHash = wNode->getSuccessorRoleHash(false); if (!ancRoleHash) { // no inverse roles return true; } // assume blocking is possible bool blocked = true; cint64 violatingB2Restrictions = 0; cint64 violatingNonDetB2Restrictions = 0; CSuccessorRoleIterator baseAncRoleIt = ancRoleHash->getSuccessorRoleIterator(vNode->getIndividualID()); CSuccessorRoleIterator ancRoleIt1 = baseAncRoleIt; while (ancRoleIt1.hasNext() && blocked) { CIndividualLinkEdge* link = ancRoleIt1.next(); // from w to v is a edge labeled with r, w is an inv(r)-successor of v CRole* role = link->getLinkRole(); // B2, (ALL r. C) in w' CReapplyQueueIterator reapplyQuIt = wPredNode->getRoleReapplyIterator(role,false); while (reapplyQuIt.hasNext() && blocked) { CReapplyConceptDescriptor* reapplyConDes = reapplyQuIt.next(); CConceptDescriptor* conDes = reapplyConDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool conNeg = conDes->isNegated(); cint64 conOpCode = concept->getOperatorCode(); CConceptOperator* conOperator = concept->getConceptOperator(); if (!conNeg && (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_AQALL_TYPE)) || conNeg && conOpCode == CCSOME) { // B2a CSortedNegLinker* opLinkerIt = concept->getOperandList(); while (opLinkerIt && blocked) { CConcept* opConcept = opLinkerIt->getData(); bool opConNeg = opLinkerIt->isNegated() ^ conNeg; if (!vConSet->containsConcept(opConcept,opConNeg)) { blocked = false; CDependencyTrackPoint* depTrackPoint = conDes->getDependencyTrackPoint(); bool nonDetDependency = depTrackPoint->getBranchingTag() > 0; ++violatingB2Restrictions; if (nonDetDependency) { ++violatingNonDetB2Restrictions; } } opLinkerIt = opLinkerIt->getNext(); } } else if (!conNeg && (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQAND_TYPE))) { // B2b, transitive and automate transitions if (!hasOptimizedBlockingB2AutomateTransitionOperands(concept,role,vConSet,calcAlgContext)) { blocked = false; CDependencyTrackPoint* depTrackPoint = conDes->getDependencyTrackPoint(); bool nonDetDependency = depTrackPoint->getBranchingTag() > 0; ++violatingB2Restrictions; if (nonDetDependency) { ++violatingNonDetB2Restrictions; } } } } } CReapplyRoleSuccessorHash* wPredSuccHash = wPredNode->getReapplyRoleSuccessorHash(false); if (blocked) { // test c-blocked and a-blocked specific parts // B3, B5 bool cBlocked = true; bool aBlocked = true; CSuccessorRoleIterator ancRoleIt2 = baseAncRoleIt; while (ancRoleIt2.hasNext() && blocked) { CIndividualLinkEdge* link = ancRoleIt2.next(); CRole* role = link->getLinkRole(); // B§, (ATMOST n r. C) in w' CReapplyQueueIterator reapplyQuIt = wPredNode->getRoleReapplyIterator(role,false); while (reapplyQuIt.hasNext() && blocked) { CReapplyConceptDescriptor* reapplyConDes = reapplyQuIt.next(); CConceptDescriptor* conDes = reapplyConDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool conNeg = conDes->isNegated(); cint64 conOpCode = concept->getOperatorCode(); bool checkBlockerRoleCardinality = false; cint64 blockerMinSuccCardinality = 0; CSortedNegLinker* opLinker = concept->getOperandList(); if (!conNeg && conOpCode == CCATMOST || conNeg && conOpCode == CCATLEAST) { cint64 cardinality = concept->getParameter(); if (conNeg) { --cardinality; } CSortedNegLinker* opLinkerIt = opLinker; if (!opLinkerIt) { cBlocked = false; if (!checkBlockerRoleCardinality) { checkBlockerRoleCardinality = true; blockerMinSuccCardinality = cardinality; } } while (opLinkerIt) { CConcept* opConcept = opLinkerIt->getData(); bool opConNeg = opLinkerIt->isNegated(); bool containsNeg = false; if (!vConSet->containsConcept(opConcept,&containsNeg)) { // contains not positive and negative cBlocked = false; if (!checkBlockerRoleCardinality) { checkBlockerRoleCardinality = true; blockerMinSuccCardinality = cardinality; } } if (containsNeg == opConNeg) { cBlocked = false; if (!checkBlockerRoleCardinality) { checkBlockerRoleCardinality = true; blockerMinSuccCardinality = cardinality; } } opLinkerIt = opLinkerIt->getNext(); } } if (checkBlockerRoleCardinality) { // count cint64 minRoleCardinality = 0; if (wPredSuccHash) { CRoleSuccessorLinkIterator succIt = wPredSuccHash->getRoleSuccessorLinkIterator(role); while (succIt.hasNext() && blocked) { CIndividualLinkEdge* succLink = succIt.next(); CIndividualProcessNode* succIndiNode = getSuccessorIndividual(wPredNode,succLink,calcAlgContext); if (succIndiNode->getIndividualAncestorDepth() > wPredNode->getIndividualAncestorDepth()) { if (!opLinker) { ++minRoleCardinality; if (minRoleCardinality >= blockerMinSuccCardinality) { blocked = false; } } else { if (containsIndividualNodeConcepts(succIndiNode,opLinker,false,calcAlgContext)) { ++minRoleCardinality; if (minRoleCardinality >= blockerMinSuccCardinality) { blocked = false; } } } } } } } } } if (cBlocked) { // test whether B6 holds CReapplyConceptLabelSetIterator vConSetIt = vConSet->getConceptLabelSetIterator(false,false,false); while (cBlocked && vConSetIt.hasNext()) { CConceptDescriptor* conDes = vConSetIt.next(); CConcept* concept = conDes->getConcept(); bool conNeg = conDes->isNegated(); cint64 conOpCode = concept->getOperatorCode(); if (!conNeg && conOpCode == CCATLEAST || conNeg && conOpCode == CCATMOST) { cint64 cardinality = concept->getParameter() + 1*conNeg; if (cardinality > 1) { CRole* role = concept->getRole(); if (hasIndividualsLink(vNode,wNode,role,false,calcAlgContext)) { CSortedNegLinker* opLinker = concept->getOperandList(); if (opLinker) { if (!containsIndividualNodeConcepts(wSubConSet,opLinker,!conNeg,calcAlgContext)) { cBlocked = false; } } else { cBlocked = false; } } } } } if (cBlocked) { return true; } } } if (blocked) { // test whether B4 holds CReapplyConceptLabelSetIterator blockerConLabSetIt = wPredSuperConSet->getConceptLabelSetIterator(false,false,false); while (blockerConLabSetIt.hasNext() && blocked) { CConceptDescriptor* conDes = blockerConLabSetIt.next(); CConcept* concept = conDes->getConcept(); bool conNeg = conDes->isNegated(); cint64 conOpCode = concept->getOperatorCode(); CRole* role = concept->getRole(); cint64 cardinality = concept->getParameter(); CSortedNegLinker* opLinker = concept->getOperandList(); bool needsRestrictionTest = false; bool negateOps = false; if (!conNeg && conOpCode == CCATLEAST || conNeg && conOpCode == CCATMOST) { if (conNeg) { ++cardinality; } needsRestrictionTest = true; } else if (!conNeg && (conOpCode == CCSOME || conOpCode == CCAQSOME) || conNeg && conOpCode == CCALL) { cardinality = 1; needsRestrictionTest = true; negateOps = conNeg; } if (needsRestrictionTest) { // B4b bool restrictionHolds = false; if (hasIndividualsLink(wNode,vNode,role,false,calcAlgContext)) { if (containsIndividualNodeConcepts(vConSet,opLinker,negateOps,calcAlgContext)) { restrictionHolds = true; } } if (!restrictionHolds) { // B4a // w' needs m role-successors cint64 minRoleCardinality = 0; if (wPredSuccHash) { CRoleSuccessorLinkIterator succIt = wPredSuccHash->getRoleSuccessorLinkIterator(role); while (succIt.hasNext()) { CIndividualLinkEdge* link = succIt.next(); CIndividualProcessNode* succIndi = getSuccessorIndividual(wPredNode,link,calcAlgContext); if (succIndi->getIndividualAncestorDepth() > wPredNode->getIndividualAncestorDepth()) { if (!opLinker) { ++minRoleCardinality; } else { if (containsIndividualNodeConcepts(succIndi,opLinker,negateOps,calcAlgContext)) { ++minRoleCardinality; } } } } } if (minRoleCardinality < cardinality) { blocked = false; } } } } } if (!blocked && blockAltData && mConfSignatureMirroringBlocking && mOptSignatureMirroringBlockingInBlocking) { cint64 diffConceptCount = wPredSuperConSet->getConceptCount() - wSubConSet->getConceptCount(); CBlockingAlternativeSignatureBlockingCandidateData* sigBlockCandData = nullptr; if (*blockAltData) { sigBlockCandData = dynamic_cast(*blockAltData); } if (!sigBlockCandData) { CMemoryAllocationManager* tempMemMan = calcAlgContext->getUsedTemporaryMemoryAllocationManager(); sigBlockCandData = CObjectAllocator::allocateAndConstruct(tempMemMan); sigBlockCandData->initSignatureBlockingCandidateData(wPredNode,violatingB2Restrictions,violatingNonDetB2Restrictions,diffConceptCount); *blockAltData = sigBlockCandData; } else { bool lessViolNonDetRes = violatingNonDetB2Restrictions < sigBlockCandData->getViolatedNonDeterministicRestrictionCount(); bool lessViolRes = violatingB2Restrictions < sigBlockCandData->getViolatedRestrictionCount(); bool lessConcepts = diffConceptCount < sigBlockCandData->getConceptDifferenceCount(); double newScore = violatingNonDetB2Restrictions*1.2 + violatingB2Restrictions + diffConceptCount*0.1; double oldScore = sigBlockCandData->getViolatedNonDeterministicRestrictionCount()*1.2 + sigBlockCandData->getViolatedRestrictionCount() + sigBlockCandData->getConceptDifferenceCount()*0.1; if (newScore > oldScore) { sigBlockCandData->initSignatureBlockingCandidateData(wPredNode,violatingB2Restrictions,violatingNonDetB2Restrictions,diffConceptCount); } } } return blocked; } bool CCalculationTableauCompletionTaskHandleAlgorithm::containsIndividualNodeConcepts(CReapplyConceptLabelSet* conLabelSet, CSortedNegLinker* conTestLinkerIt, bool* containsNegation, CCalculationAlgorithmContextBase* calcAlgContext) { bool containsAllNegated = true; bool containsAllNonNegated = true; if (!conTestLinkerIt) { // interpret as top if (containsNegation) { *containsNegation = false; } containsAllNegated = false; } while (conTestLinkerIt && (containsAllNegated || containsAllNonNegated)) { CConcept* concept = conTestLinkerIt->getData(); bool conNeg = conTestLinkerIt->isNegated(); bool containsNeg = false; if (!conLabelSet->containsConcept(concept,&containsNeg)) { return false; } if (containsNeg == conNeg) { containsAllNegated = false; } else { containsAllNonNegated = false; } conTestLinkerIt = conTestLinkerIt->getNext(); } if (containsNegation) { if (containsAllNegated) { *containsNegation = true; return true; } if (containsAllNonNegated) { *containsNegation = false; return true; } } if (containsAllNonNegated) { return true; } if (containsAllNegated) { return true; } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::containsIndividualNodeConcepts(CReapplyConceptLabelSet* conLabelSet, CSortedNegLinker* conTestLinkerIt, bool negated, CCalculationAlgorithmContextBase* calcAlgContext) { while (conTestLinkerIt) { CConcept* concept = conTestLinkerIt->getData(); bool conNeg = conTestLinkerIt->isNegated() ^ negated; if (!conLabelSet->containsConcept(concept,conNeg)) { return false; } conTestLinkerIt = conTestLinkerIt->getNext(); } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::containsIndividualNodeConcepts(CIndividualProcessNode*& testIndi, CSortedNegLinker* conTestLinkerIt, bool negated, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyConceptLabelSet* conLabelSet = testIndi->getReapplyConceptLabelSet(false); return containsIndividualNodeConcepts(conLabelSet,conTestLinkerIt,negated,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::containsIndividualNodeConcepts(CIndividualProcessNode*& testIndi, CSortedNegLinker* conTestLinkerIt, bool* containsNegation, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyConceptLabelSet* conLabelSet = testIndi->getReapplyConceptLabelSet(false); return containsIndividualNodeConcepts(conLabelSet,conTestLinkerIt,containsNegation,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::containsIndividualNodeConcepts(CIndividualProcessNode*& testIndi, CSortedNegLinker* conTestLinkerIt, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyConceptLabelSet* conLabelSet = testIndi->getReapplyConceptLabelSet(false); return containsIndividualNodeConcepts(conLabelSet,conTestLinkerIt,(bool*)nullptr,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::isLabelConceptSubSetBlocking(CIndividualProcessNode*& testIndi, CIndividualProcessNode*& blockingIndi, CIndividualNodeBlockingTestData* blockData, bool testContinueBlocking, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(SUBSETBLOCKINGTESTCOUNT,calcAlgContext); if (testContinueBlocking) { // is still sub set when added something to blocker individual node return true; } CReapplyConceptLabelSet* subConSet = testIndi->getReapplyConceptLabelSet(false); CReapplyConceptLabelSet* superConSet = blockingIndi->getReapplyConceptLabelSet(false); CConceptDescriptor* firstNotEntailedConDes = nullptr; bool subSet = isLabelConceptSubSet(subConSet,superConSet,&firstNotEntailedConDes,nullptr,calcAlgContext); return subSet; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isLabelConceptEqualBlocking(CIndividualProcessNode*& testIndi, CIndividualProcessNode*& blockingIndi, CIndividualNodeBlockingTestData* blockData, bool testContinueBlocking, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(EQUALSETBLOCKINGTESTCOUNT,calcAlgContext); CReapplyConceptLabelSet* conSet1 = testIndi->getReapplyConceptLabelSet(false); CReapplyConceptLabelSet* conSet2 = blockingIndi->getReapplyConceptLabelSet(false); return isLabelConceptEqualSet(conSet1,conSet2,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::isLabelConceptEqualPairwiseBlocking(CIndividualProcessNode*& testIndi, CIndividualProcessNode*& blockingIndi, CIndividualNodeBlockingTestData* blockData, bool testContinueBlocking, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(PAIRWISEEQUALSETBLOCKINGTESTCOUNT,calcAlgContext); CIndividualProcessNode* ancTestIndi = getAncestorIndividual(testIndi,calcAlgContext); if (!ancTestIndi) { return false; } CIndividualProcessNode* ancBlockingIndi = getAncestorIndividual(blockingIndi,calcAlgContext); if (!ancBlockingIndi) { return false; } CIndividualLinkEdge* testIndiAncLink = testIndi->getAncestorLink(); CIndividualLinkEdge* blockingIndiAncLink = testIndi->getAncestorLink(); if (testIndiAncLink->getLinkRole() != blockingIndiAncLink->getLinkRole()) { return false; } CReapplyConceptLabelSet* conSet1 = testIndi->getReapplyConceptLabelSet(false); CReapplyConceptLabelSet* conSet1Pair = blockingIndi->getReapplyConceptLabelSet(false); CReapplyConceptLabelSet* conSet2 = ancTestIndi->getReapplyConceptLabelSet(false); CReapplyConceptLabelSet* conSet2Pair = ancBlockingIndi->getReapplyConceptLabelSet(false); return isPairwiseLabelConceptEqualSet(conSet1,conSet1Pair,conSet2,conSet2Pair,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::isIndividualNodeBlocking(CIndividualProcessNode*& testIndi, CIndividualProcessNode*& blockingIndi, CIndividualNodeBlockingTestData* blockData, bool testContinueBlocking, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(INDINODEBLOCKINGTESTCOUNT,calcAlgContext); // TODO: check config, first test concept set sizes CReapplyConceptLabelSet* testConSet = testIndi->getReapplyConceptLabelSet(false); CReapplyConceptLabelSet* blockingConSet = blockingIndi->getReapplyConceptLabelSet(false); cint64 testConSetCount = testConSet->getConceptCount(); cint64 blockingConSetCount = blockingConSet->getConceptCount(); if (testConSetCount > blockingConSetCount) { return false; } if (!testContinueBlocking) { CConceptDescriptor* initConDes = testIndi->getIndividualInitializationConcept(); if (initConDes) { if (!blockingIndi->getReapplyConceptLabelSet(false)->containsConceptDescriptor(initConDes)) { return false; } } } bool testProcessingBlocking = false; if (mOptDetExpPreporcessing) { testProcessingBlocking = true; } bool blockingConcepts = false; if (testProcessingBlocking || mConfSubSetBlocking) { if (isLabelConceptSubSetBlocking(testIndi,blockingIndi,blockData,testContinueBlocking,blockAltData,calcAlgContext)) { blockingConcepts = true; } } else if (mConfOptimizedSubSetBlocking) { if (isLabelConceptOptimizedBlocking(testIndi,blockingIndi,blockData,testContinueBlocking,blockAltData,calcAlgContext)) { blockingConcepts = true; } } else if (mConfEqualSetBlocking) { if (isLabelConceptEqualBlocking(testIndi,blockingIndi,blockData,testContinueBlocking,blockAltData,calcAlgContext)) { blockingConcepts = true; } } else if (mConfPairwiseEqualSetBlocking) { if (isLabelConceptEqualPairwiseBlocking(testIndi,blockingIndi,blockData,testContinueBlocking,blockAltData,calcAlgContext)) { blockingConcepts = true; } } bool blockingPropBindings = false; if (blockingConcepts) { blockingPropBindings = isNominalVariablePropagationBindingSubSet(testIndi,blockingIndi,blockData,testContinueBlocking,blockAltData,calcAlgContext); } return blockingConcepts && blockingPropBindings; } bool CCalculationTableauCompletionTaskHandleAlgorithm::detectIndividualNodeBlockedStatus(CIndividualProcessNode*& testIndi, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(DETECTINDINODEBLOCKINGSTATUSCOUNT,calcAlgContext); bool previousProcessingBlocked = false; bool previousBlocked = testIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFDIRECTBLOCKED | CIndividualProcessNode::PRFINDIRECTBLOCKED | CIndividualProcessNode::PRFPROCESSINGBLOCKED); if (!mOptDetExpPreporcessing && testIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPROCESSINGBLOCKED)) { testIndi->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFPROCESSINGBLOCKED); previousProcessingBlocked = true; } else if (mOptDetExpPreporcessing && testIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPROCESSINGBLOCKED)) { return true; } else { if (!testIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEANCESTORMODIFIED | CIndividualProcessNode::PRFBLOCKINGRETESTDUEDIRECTMODIFIED | CIndividualProcessNode::PRFBLOCKINGRETESTDUEBLOCKERMODIFIED | CIndividualProcessNode::PRFBLOCKINGRETESTDUEINDIRECTBLOCKERLOSS)) { return previousBlocked; } } bool previousIndirectBlocked = testIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINDIRECTBLOCKED); if (previousIndirectBlocked) { if (!testIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEINDIRECTBLOCKERLOSS)) { testIndi->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEANCESTORMODIFIED | CIndividualProcessNode::PRFBLOCKINGRETESTDUEDIRECTMODIFIED | CIndividualProcessNode::PRFBLOCKINGRETESTDUEBLOCKERMODIFIED); return true; } } bool previousDirectBlocked = testIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFDIRECTBLOCKED); CIndividualProcessNode* ancTestIndi = testIndi; CIndividualProcessNode* blockingIndi = nullptr; CBlockingAlternativeData* blockAltData = nullptr; bool blocked = false; // test each modified ancestor while (!blocked && ancTestIndi && ancTestIndi->isBlockableIndividual() && ancTestIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEANCESTORMODIFIED | CIndividualProcessNode::PRFBLOCKINGRETESTDUEDIRECTMODIFIED | CIndividualProcessNode::PRFBLOCKINGRETESTDUEBLOCKERMODIFIED | CIndividualProcessNode::PRFBLOCKINGRETESTDUEINDIRECTBLOCKERLOSS) && !ancTestIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDBLOCKINGORCACHING)) { STATINC(DETECTANCINDINODEBLOCKINGSTATUSCOUNT,calcAlgContext); CIndividualProcessNode* locAncTestIndi = getLocalizedIndividual(ancTestIndi,false,calcAlgContext); // search blocker node blockAltData = nullptr; blockingIndi = nullptr; if (mConfSaturationCachingTestingDuringBlockingTests) { detectIndividualNodeSaturationCached(locAncTestIndi,calcAlgContext); } bool skipBlockerSearch = false; if (locAncTestIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED) && locAncTestIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONSUCCESSORCREATIONBLOCKINGCACHED)) { skipBlockerSearch = true; } if (!skipBlockerSearch) { blockingIndi = getBlockingIndividualNode(locAncTestIndi,&blockAltData,calcAlgContext); } locAncTestIndi->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEANCESTORMODIFIED | CIndividualProcessNode::PRFBLOCKINGRETESTDUEDIRECTMODIFIED | CIndividualProcessNode::PRFBLOCKINGRETESTDUEBLOCKERMODIFIED | CIndividualProcessNode::PRFBLOCKINGRETESTDUEINDIRECTBLOCKERLOSS | CIndividualProcessNode::PRFDIRECTBLOCKED | CIndividualProcessNode::PRFINDIRECTBLOCKED | CIndividualProcessNode::PRFPROCESSINGBLOCKED); if (!blockingIndi) { STATINC(FAILEDBLOCKINGSTATUSDETECTIONCOUNT,calcAlgContext); if (blockAltData) { blocked = testAlternativeBlocked(locAncTestIndi,blockAltData,calcAlgContext); } if (!blocked) { locAncTestIndi->setBlockerIndividualNode(nullptr); ancTestIndi = getAncestorIndividual(locAncTestIndi,calcAlgContext); } } else { STATINC(SUCCESSBLOCKINGSTATUSDETECTIONCOUNT,calcAlgContext); //if (blockingIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { // propagateIndividualNodeNominalConnectionToAncestors(locAncTestIndi,calcAlgContext); //} if (blockingIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { propagateIndividualNodeNominalConnectionStatusToAncestors(locAncTestIndi,blockingIndi,calcAlgContext); } bool testProcessingBlocking = false; if (mOptDetExpPreporcessing) { testProcessingBlocking = true; } locAncTestIndi->setBlockerIndividualNode(blockingIndi); locAncTestIndi->mDebugBlockerLastConceptDes = blockingIndi->getReapplyConceptLabelSet(false)->getAddingSortedConceptDescriptionLinker(); if (!testProcessingBlocking) { CIndividualProcessNode* locBlockingNode = getLocalizedIndividual(blockingIndi,false,calcAlgContext); CXLinker* blockedIndiNodeLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); blockedIndiNodeLinker->initLinker(locAncTestIndi); locBlockingNode->addBlockedIndividualsLinker(blockedIndiNodeLinker); locAncTestIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFDIRECTBLOCKED); } else { locAncTestIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFPROCESSINGBLOCKED); addIndividualToBlockingUpdateReviewProcessingQueue(blockingIndi,calcAlgContext); } propagateIndirectSuccessorBlocking(locAncTestIndi,calcAlgContext); blocked = true; } } if (!blockingIndi && previousBlocked) { reactivateIndirectBlockedSuccessors(testIndi,false,calcAlgContext); } return blocked; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getBlockingIndividualNode(CIndividualProcessNode* blockingTestIndi, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* blockingIndi = nullptr; if (!blockingIndi && mConfAnywhereBlockingLinkedCandidateHashSearch) { blockingIndi = getAnywhereBlockingIndividualNodeLinkedCanidateHashed(blockingTestIndi,blockAltData,calcAlgContext); } if (!blockingIndi && mConfAnywhereBlockingCandidateHashSearch) { blockingIndi = getAnywhereBlockingIndividualNodeCanidateHashed(blockingTestIndi,blockAltData,calcAlgContext); } if (!blockingIndi && mConfAnywhereBlockingSearch) { blockingIndi = getAnywhereBlockingIndividualNode(blockingTestIndi,blockAltData,calcAlgContext); } if (!blockingIndi && mConfAncestorBlockingSearch) { blockingIndi = getAncestorBlockingIndividualNode(blockingTestIndi,blockAltData,calcAlgContext); } return blockingIndi; } bool CCalculationTableauCompletionTaskHandleAlgorithm::continueIndividualNodeBlock(CIndividualProcessNode*& indi, CIndividualNodeBlockingTestData* blockData, CIndividualProcessNode*& blockerIndiNode, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* blockingIndiNode = nullptr; if (blockData) { blockingIndiNode = blockData->getBlockingIndividualNode(); if (blockingIndiNode) { STATINC(CONTINUEBLOCKINGTESTCOUNT,calcAlgContext); blockingIndiNode = getUpToDateIndividual(blockingIndiNode,calcAlgContext); if (blockingIndiNode->isBlockableIndividual() && isIndividualNodeValidBlocker(blockingIndiNode,calcAlgContext)) { if (isIndividualNodeBlocking(indi,blockingIndiNode,blockData,true,blockAltData,calcAlgContext)) { blockerIndiNode = blockingIndiNode; return true; } else { blockData->clearBlockingIndividualNode(); } } } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::signatureCachedIndividualNodeBlock(CIndividualProcessNode*& indi, CIndividualNodeBlockingTestData* blockData, CIndividualProcessNode*& blockerIndiNode, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext) { if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED)) { CSignatureBlockingIndividualNodeConceptExpansionData* sigBlockExpData = indi->getSignatureBlockingIndividualNodeConceptExpansionData(false); if (sigBlockExpData) { CIndividualProcessNode* blockingIndiNode = sigBlockExpData->getBlockerIndividualNode(); if (blockingIndiNode) { blockingIndiNode = getUpToDateIndividual(blockingIndiNode,calcAlgContext); if (blockingIndiNode->isBlockableIndividual() && isIndividualNodeValidBlocker(blockingIndiNode,calcAlgContext)) { if (isIndividualNodeBlocking(indi,blockingIndiNode,blockData,false,blockAltData,calcAlgContext)) { blockerIndiNode = blockingIndiNode; return true; } } } } } return false; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getAncestorBlockingIndividualNode(CIndividualProcessNode* blockingTestIndi, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; CIndividualProcessNode* blockerNode = nullptr; CNodeSwitchHistory* nodeSwitchHistory = calcAlgContext->getUsedProcessingDataBox()->getNodeSwitchHistory(false); taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CIndividualNodeBlockingTestData* blockData = (CIndividualNodeBlockingTestData*)blockingTestIndi->getIndividualBlockData(false); CIndividualNodeBlockingTestData* locBlockData = (CIndividualNodeBlockingTestData*)blockingTestIndi->getIndividualBlockData(true); if (!locBlockData) { locBlockData = CObjectAllocator::allocateAndConstruct(taskMemMan); locBlockData->initBlockData(blockData); blockingTestIndi->setIndividualBlockData(locBlockData); } cint64 prevNodeSwitchTag = locBlockData->getNodeSwitchTag(); cint64 prevNodeConceptLabelModTag = locBlockData->getConceptLabelSetModificationTag(); cint64 minTestIndiNodeID = 0; cint64 minTestAncIndiDepth = 0; locBlockData->updateNodeSwitchTag(calcAlgContext->getUsedProcessTagger()); locBlockData->updateConceptLabelSetModificationTag(calcAlgContext->getUsedProcessTagger()); CIndividualProcessNode* continueBlockingIndiNode = nullptr; if (continueIndividualNodeBlock(blockingTestIndi,locBlockData,continueBlockingIndiNode,blockAltData,calcAlgContext)) { blockerNode = continueBlockingIndiNode; } else { if (signatureCachedIndividualNodeBlock(blockingTestIndi,locBlockData,continueBlockingIndiNode,blockAltData,calcAlgContext)) { blockerNode = continueBlockingIndiNode; } else { if (nodeSwitchHistory && locBlockData && prevNodeSwitchTag > 0) { nodeSwitchHistory->getMinIndividualAncestorDepthAndNodeID(prevNodeSwitchTag,minTestAncIndiDepth,minTestIndiNodeID); minTestIndiNodeID = qMax(minTestIndiNodeID,(cint64)0); minTestAncIndiDepth = qMax(minTestAncIndiDepth,(cint64)0); } CIndividualProcessNode* ancIndiNode = getAncestorIndividual(blockingTestIndi,calcAlgContext); while (!blockerNode && ancIndiNode && isIndividualNodeValidBlocker(ancIndiNode,calcAlgContext) && ancIndiNode->getIndividualAncestorDepth() >= minTestAncIndiDepth) { if (continueBlockingIndiNode != ancIndiNode) { STATINC(ANCESTORBLOCKINGSEARCHINDINODECOUNT,calcAlgContext); if (isIndividualNodeConceptLabelSetModified(ancIndiNode,prevNodeConceptLabelModTag,calcAlgContext) && isIndividualNodeBlocking(blockingTestIndi,ancIndiNode,locBlockData,false,blockAltData,calcAlgContext)) { blockerNode = ancIndiNode; } } if (!blockerNode) { ancIndiNode = getAncestorIndividual(ancIndiNode,calcAlgContext); } } } } locBlockData->setBlockingIndividualNode(blockerNode); return blockerNode; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getAnywhereBlockingIndividualNode(CIndividualProcessNode* blockingTestIndi, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; CIndividualProcessNode* blockerNode = nullptr; CNodeSwitchHistory* nodeSwitchHistory = calcAlgContext->getUsedProcessingDataBox()->getNodeSwitchHistory(false); taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CIndividualNodeBlockingTestData* blockData = (CIndividualNodeBlockingTestData*)blockingTestIndi->getIndividualBlockData(false); CIndividualNodeBlockingTestData* locBlockData = (CIndividualNodeBlockingTestData*)blockingTestIndi->getIndividualBlockData(true); if (!locBlockData) { locBlockData = CObjectAllocator::allocateAndConstruct(taskMemMan); locBlockData->initBlockData(blockData); blockingTestIndi->setIndividualBlockData(locBlockData); } cint64 prevNodeSwitchTag = locBlockData->getNodeSwitchTag(); cint64 prevNodeConceptLabelModTag = locBlockData->getConceptLabelSetModificationTag(); cint64 minTestIndiNodeID = 0; cint64 minTestAncIndiDepth = 0; locBlockData->updateNodeSwitchTag(calcAlgContext->getUsedProcessTagger()); locBlockData->updateConceptLabelSetModificationTag(calcAlgContext->getUsedProcessTagger()); CIndividualProcessNode* continueBlockingIndiNode = nullptr; if (continueIndividualNodeBlock(blockingTestIndi,locBlockData,continueBlockingIndiNode,blockAltData,calcAlgContext)) { blockerNode = continueBlockingIndiNode; } else { if (signatureCachedIndividualNodeBlock(blockingTestIndi,locBlockData,continueBlockingIndiNode,blockAltData,calcAlgContext)) { blockerNode = continueBlockingIndiNode; } else { cint64 continueBlockingIndiNodeID = -1; if (continueBlockingIndiNode) { continueBlockingIndiNodeID = continueBlockingIndiNode->getIndividualID(); } if (nodeSwitchHistory && locBlockData && prevNodeSwitchTag > 0) { nodeSwitchHistory->getMinIndividualAncestorDepthAndNodeID(prevNodeSwitchTag,minTestAncIndiDepth,minTestIndiNodeID); minTestIndiNodeID = qMax(minTestIndiNodeID,(cint64)0); minTestAncIndiDepth = qMax(minTestAncIndiDepth,(cint64)0); } cint64 prevIndiID = blockingTestIndi->getIndividualID() - 1; CIndividualProcessNode* prevIndiNode = nullptr; while (!blockerNode && prevIndiID > 0 && prevIndiID >= minTestIndiNodeID) { if (prevIndiID != continueBlockingIndiNodeID) { prevIndiNode = getUpToDateIndividual(prevIndiID,calcAlgContext); if (prevIndiNode && isIndividualNodeValidBlocker(prevIndiNode,calcAlgContext) && isIndividualNodeConceptLabelSetModified(prevIndiNode,prevNodeConceptLabelModTag,calcAlgContext)) { STATINC(ANYWHEREBLOCKINGSEARCHINDINODECOUNT,calcAlgContext); if (isIndividualNodeBlocking(blockingTestIndi,prevIndiNode,locBlockData,false,blockAltData,calcAlgContext)) { blockerNode = prevIndiNode; } } } --prevIndiID; } } } locBlockData->setBlockingIndividualNode(blockerNode); return blockerNode; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getAnywhereBlockingIndividualNodeLinkedCanidateHashed(CIndividualProcessNode* blockingTestIndi, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CIndividualProcessNode* blockerNode = nullptr; CIndividualNodeBlockingTestData* blockData = (CIndividualNodeBlockingTestData*)blockingTestIndi->getIndividualBlockData(false); CIndividualNodeBlockingTestData* locBlockData = (CIndividualNodeBlockingTestData*)blockingTestIndi->getIndividualBlockData(true); if (!locBlockData) { locBlockData = CObjectAllocator::allocateAndConstruct(taskMemMan); locBlockData->initBlockData(blockData); blockingTestIndi->setIndividualBlockData(locBlockData); } CIndividualProcessNode* continueBlockingIndiNode = nullptr; if (continueIndividualNodeBlock(blockingTestIndi,locBlockData,continueBlockingIndiNode,blockAltData,calcAlgContext)) { blockerNode = continueBlockingIndiNode; } else { if (signatureCachedIndividualNodeBlock(blockingTestIndi,locBlockData,continueBlockingIndiNode,blockAltData,calcAlgContext)) { blockerNode = continueBlockingIndiNode; } else { cint64 continueBlockingIndiNodeID = -1; if (continueBlockingIndiNode) { continueBlockingIndiNodeID = continueBlockingIndiNode->getIndividualID(); } CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CBlockingIndividualNodeLinkedCandidateHash* blockingCandHash = procDataBox->getBlockingIndividualNodeLinkedCandidateHash(false); CReapplyConceptLabelSet* conSet = blockingTestIndi->getReapplyConceptLabelSet(false); CCoreConceptDescriptor* coreConDesLinker = conSet->getCoreConceptDescriptorLinker(); cint64 blockingTestIndiID = blockingTestIndi->getIndividualID(); if (!coreConDesLinker) { blockerNode = getAnywhereBlockingIndividualNodeCanidateHashed(blockingTestIndi,blockAltData,calcAlgContext); } else { CBlockingIndividualNodeLinkedCandidateData* minBlockingIndNodeCandData = nullptr; cint64 minBlockingIndNodeCandDataCount = 0; CConceptDescriptor* minBlockingConDes = nullptr; CCoreConceptDescriptor* lastAddedCoreConDes = locBlockData->getLastAddedCoreConceptDescriptor(); CConceptDescriptor* lastConDes = locBlockData->getLastCoreBlockingCandidateConceptDescriptor(); cint64 lastNodeDiff = locBlockData->getLastCoreBlockingCandidateConceptNodeDifference(); if (lastAddedCoreConDes != coreConDesLinker) { lastConDes = nullptr; } CBlockingIndividualNodeLinkedCandidateData* lastMinBlockingIndNodeCandData = nullptr; if (lastConDes) { CBlockingIndividualNodeLinkedCandidateData* blockingCandData = blockingCandHash->getBlockingIndividualCandidateData(lastConDes,false); if (blockingCandData) { cint64 blockingIndNodeCandDataCount = blockingCandData->getCandidateCount(); if (blockingIndNodeCandDataCount <= lastNodeDiff) { minBlockingIndNodeCandData = blockingCandData; minBlockingIndNodeCandDataCount = blockingIndNodeCandDataCount; } } } if (!minBlockingIndNodeCandData) { for (CCoreConceptDescriptor* coreConDesLinkerIt = coreConDesLinker; coreConDesLinkerIt; coreConDesLinkerIt = coreConDesLinkerIt->getNext()) { CConceptDescriptor* conDes = coreConDesLinkerIt->getConceptDesciptor(); CBlockingIndividualNodeLinkedCandidateData* blockingCandData = blockingCandHash->getBlockingIndividualCandidateData(conDes,false); if (blockingCandData) { cint64 blockingIndNodeCandDataCount = blockingCandData->getCandidateCount(); if (!minBlockingIndNodeCandData || blockingIndNodeCandDataCount < minBlockingIndNodeCandDataCount) { lastMinBlockingIndNodeCandData = minBlockingIndNodeCandData; minBlockingIndNodeCandDataCount = blockingIndNodeCandDataCount; minBlockingIndNodeCandData = blockingCandData; minBlockingConDes = conDes; } else if (!lastMinBlockingIndNodeCandData) { lastMinBlockingIndNodeCandData = blockingCandData; } } } } locBlockData->setLastAddedCoreConceptDescriptor(coreConDesLinker); locBlockData->setLastCoreBlockingCandidateConceptDescriptor(minBlockingConDes); locBlockData->setLastCoreBlockingCandidateConceptNodeDifference(0); if (lastMinBlockingIndNodeCandData) { cint64 diffCount = lastMinBlockingIndNodeCandData->getCandidateCount(); locBlockData->setLastCoreBlockingCandidateConceptNodeDifference(diffCount); } CBlockingIndividualNodeLinkedCandidateData* blockingCandData = minBlockingIndNodeCandData; if (blockingCandData) { CBlockingIndividualNodeLinker* blockingIndNodeLinker = blockingCandData->getBlockingCandidatesIndividualNodeLinker(); while (blockingIndNodeLinker && !blockerNode) { CIndividualProcessNode* blockerCandIndiNode = blockingIndNodeLinker->getCandidateIndividualNode(); cint64 blockerCandIndiNodeID = blockerCandIndiNode->getIndividualID(); if (blockerCandIndiNodeID != continueBlockingIndiNodeID && blockerCandIndiNodeID != blockingTestIndiID) { STATINC(ANYWHERECORECONCEPTBLOCKINGCANDIDATEHASHSEARCHINDINODECOUNT,calcAlgContext); CIndividualProcessNode* upBlockerCandIndiNode = getUpToDateIndividual(blockerCandIndiNode,calcAlgContext); if (isIndividualNodeValidBlocker(upBlockerCandIndiNode,calcAlgContext)) { if (isIndividualNodeBlocking(blockingTestIndi,upBlockerCandIndiNode,locBlockData,false,blockAltData,calcAlgContext)) { blockerNode = upBlockerCandIndiNode; } } } blockingIndNodeLinker = blockingIndNodeLinker->getNext(); } } } } } return blockerNode; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getAnywhereBlockingIndividualNodeCanidateHashed(CIndividualProcessNode* blockingTestIndi, CBlockingAlternativeData** blockAltData, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; CIndividualProcessNode* blockerNode = nullptr; CNodeSwitchHistory* nodeSwitchHistory = calcAlgContext->getUsedProcessingDataBox()->getNodeSwitchHistory(false); taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CIndividualNodeBlockingTestData* blockData = (CIndividualNodeBlockingTestData*)blockingTestIndi->getIndividualBlockData(false); CIndividualNodeBlockingTestData* locBlockData = (CIndividualNodeBlockingTestData*)blockingTestIndi->getIndividualBlockData(true); if (!locBlockData) { locBlockData = CObjectAllocator::allocateAndConstruct(taskMemMan); locBlockData->initBlockData(blockData); blockingTestIndi->setIndividualBlockData(locBlockData); } cint64 prevNodeSwitchTag = locBlockData->getNodeSwitchTag(); cint64 prevNodeConceptLabelModTag = locBlockData->getConceptLabelSetModificationTag(); cint64 minTestIndiNodeID = 0; cint64 minTestAncIndiDepth = 0; locBlockData->updateNodeSwitchTag(calcAlgContext->getUsedProcessTagger()); locBlockData->updateConceptLabelSetModificationTag(calcAlgContext->getUsedProcessTagger()); CIndividualProcessNode* continueBlockingIndiNode = nullptr; if (continueIndividualNodeBlock(blockingTestIndi,locBlockData,continueBlockingIndiNode,blockAltData,calcAlgContext)) { blockerNode = continueBlockingIndiNode; } else { cint64 continueBlockingIndiNodeID = -1; if (continueBlockingIndiNode) { continueBlockingIndiNodeID = continueBlockingIndiNode->getIndividualID(); } if (nodeSwitchHistory && locBlockData && prevNodeSwitchTag > 0) { nodeSwitchHistory->getMinIndividualAncestorDepthAndNodeID(prevNodeSwitchTag,minTestAncIndiDepth,minTestIndiNodeID); minTestIndiNodeID = qMax(minTestIndiNodeID,(cint64)0); minTestAncIndiDepth = qMax(minTestAncIndiDepth,(cint64)0); } if (blockingTestIndi->getIndividualInitializationConcept()) { CBlockingIndividualNodeCandidateIterator indiNodeCandIt(getBlockingIndividualNodeCandidateIterator(blockingTestIndi,calcAlgContext)); while (!blockerNode && indiNodeCandIt.hasNext()) { CIndividualProcessNode* indiNode = indiNodeCandIt.nextIndividualCandidate(true); CIndividualProcessNode* upIndiNode = getUpToDateIndividual(indiNode,calcAlgContext); cint64 upIndiNodeID = upIndiNode->getIndividualID(); if (upIndiNodeID != continueBlockingIndiNodeID) { if (upIndiNode->hasPurgedBlockedProcessingRestrictionFlags() || !upIndiNode->isBlockableIndividual()) { STATINC(ANYWHEREBLOCKINGCANDIDATEHASHUDATEREMOVECOUNT,calcAlgContext); indiNodeCandIt.removeLastIndividualCandidate(); } else if (isIndividualNodeValidBlocker(upIndiNode,calcAlgContext) && isIndividualNodeConceptLabelSetModified(upIndiNode,prevNodeConceptLabelModTag,calcAlgContext)) { STATINC(ANYWHEREBLOCKINGCANDIDATEHASHSEARCHINDINODECOUNT,calcAlgContext); if (isIndividualNodeBlocking(blockingTestIndi,upIndiNode,locBlockData,false,blockAltData,calcAlgContext)) { blockerNode = upIndiNode; } } } } } else { cint64 prevIndiID = blockingTestIndi->getIndividualID() - 1; CIndividualProcessNode* prevIndiNode = nullptr; while (!blockerNode && prevIndiID > 0 && prevIndiID >= minTestIndiNodeID) { if (prevIndiID != continueBlockingIndiNodeID) { prevIndiNode = getUpToDateIndividual(prevIndiID,calcAlgContext); if (prevIndiNode && isIndividualNodeValidBlocker(prevIndiNode,calcAlgContext) && isIndividualNodeConceptLabelSetModified(prevIndiNode,prevNodeConceptLabelModTag,calcAlgContext)) { STATINC(ANYWHEREBLOCKINGCANDIDATEHASHSEARCHINDINODECOUNT,calcAlgContext); if (isIndividualNodeBlocking(blockingTestIndi,prevIndiNode,locBlockData,false,blockAltData,calcAlgContext)) { blockerNode = prevIndiNode; } } } --prevIndiID; } } } locBlockData->setBlockingIndividualNode(blockerNode); return blockerNode; } void CCalculationTableauCompletionTaskHandleAlgorithm::addIndividualNodeCandidateForConcept(CIndividualProcessNode*& indi, CConceptDescriptor* conDes, CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CBlockingIndividualNodeCandidateHash* blockingCandHash = procDataBox->getBlockingIndividualNodeCandidateHash(true); CBlockingIndividualNodeCandidateData* blockingCandData = blockingCandHash->getBlockingIndividualCandidateData(conDes,true); STATINC(ANYWHEREBLOCKINGCANDIDATEHASHUDATEADDCOUNT,calcAlgContext); blockingCandData->insertBlockingCandidateIndividualNode(indi); } void CCalculationTableauCompletionTaskHandleAlgorithm::addIndividualNodeCandidateForConcept(CIndividualProcessNode*& indi, CSortedNegLinker* concepts, bool negated, CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CBlockingIndividualNodeCandidateHash* blockingCandHash = procDataBox->getBlockingIndividualNodeCandidateHash(true); CSortedNegLinker* conceptIt = concepts; while (conceptIt) { CConcept* concept = conceptIt->getData(); bool conceptNeg = conceptIt->isNegated()^negated; CBlockingIndividualNodeCandidateData* blockingCandData = blockingCandHash->getBlockingIndividualCandidateData(concept,conceptNeg,true); STATINC(ANYWHEREBLOCKINGCANDIDATEHASHUDATEADDCOUNT,calcAlgContext); blockingCandData->insertBlockingCandidateIndividualNode(indi); cint64 opCode = concept->getOperatorCode(); if (!conceptNeg && opCode == CCAND || conceptNeg && opCode == CCOR) { addIndividualNodeCandidateForConcept(indi,concept->getOperandList(),conceptNeg,calcAlgContext); } conceptIt = conceptIt->getNext(); } } CBlockingIndividualNodeCandidateIterator CCalculationTableauCompletionTaskHandleAlgorithm::getBlockingIndividualNodeCandidateIterator(CIndividualProcessNode* blockingTestIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; cint64 testingIndiID = blockingTestIndi->getIndividualID(); CConceptDescriptor* initializationConceptDes = blockingTestIndi->getIndividualInitializationConcept(); CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CNodeSwitchHistory* nodeSwitchHistory = procDataBox->getNodeSwitchHistory(false); // test whether hash has to be updated bool needsHashUpdate = true; CBlockingIndividualNodeCandidateHash* blockingCandHash = procDataBox->getBlockingIndividualNodeCandidateHash(true); CBlockingIndividualNodeCandidateData* blockingCandData = blockingCandHash->getBlockingIndividualCandidateData(initializationConceptDes,true); if (mConfAnywhereBlockingLazyExactHashing) { cint64 maxValidIndiID = blockingCandData->getMaxValidIndividualID()+1; cint64 conLabelSetModTag = blockingCandData->getConceptLabelSetModificationTag(); cint64 nodeSwitchTag = blockingCandData->getNodeSwitchTag(); cint64 minTestIndiNodeID = 0; cint64 minTestAncIndiDepth = 0; if (nodeSwitchHistory && nodeSwitchTag > 0) { nodeSwitchHistory->getMinIndividualAncestorDepthAndNodeID(nodeSwitchTag,minTestAncIndiDepth,minTestIndiNodeID); minTestIndiNodeID = qMax(minTestIndiNodeID,(cint64)0); minTestAncIndiDepth = qMax(minTestAncIndiDepth,(cint64)0); } if (maxValidIndiID >= testingIndiID && minTestIndiNodeID >= testingIndiID) { needsHashUpdate = false; } if (needsHashUpdate) { STATINC(ANYWHEREBLOCKINGCANDIDATEHASHUDATECOUNT,calcAlgContext); if (maxValidIndiID != testingIndiID) { // insert testing node STATINC(ANYWHEREBLOCKINGCANDIDATEHASHUDATEADDCOUNT,calcAlgContext); blockingCandData->insertBlockingCandidateIndividualNode(blockingTestIndi); } cint64 destIndiID = qMin(maxValidIndiID,minTestIndiNodeID); destIndiID = qMax(destIndiID,(cint64)0); for (cint64 indiID = testingIndiID-1; indiID >= destIndiID; --indiID) { CIndividualProcessNode* indi = getUpToDateIndividual(indiID,calcAlgContext); if (indi && indi->isBlockableIndividual() && !indi->hasPurgedBlockedProcessingRestrictionFlags()) { if (indiID >= maxValidIndiID || isIndividualNodeConceptLabelSetModified(indi,conLabelSetModTag,calcAlgContext)) { if (indi->getReapplyConceptLabelSet(false)->containsConceptDescriptor(initializationConceptDes)) { // add to candidate hash STATINC(ANYWHEREBLOCKINGCANDIDATEHASHUDATEADDCOUNT,calcAlgContext); blockingCandData->insertBlockingCandidateIndividualNode(indi); } } } } CProcessTagger* processTagger = calcAlgContext->getUsedProcessTagger(); blockingCandData->updateConceptLabelSetModificationTag(processTagger); blockingCandData->updateNodeSwitchTag(processTagger); blockingCandData->setMaxValidIndividualID(qMax(maxValidIndiID,testingIndiID)); } } return blockingCandData->getBlockingCandidatesIndividualNodeIterator(blockingTestIndi); } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndividualNodeModified(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { bool addIndividualToProcessingQueueDueToModification = false; if (!indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHEDRETESTDUETOMODIFICATION)) { indi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHEDRETESTDUETOMODIFICATION); } if (!indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEDIRECTMODIFIED)) { indi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEDIRECTMODIFIED); propagateProcessingRestrictionToSuccessors(indi,CIndividualProcessNode::PRFBLOCKINGRETESTDUEANCESTORMODIFIED,true, CIndividualProcessNode::PRFDIRECTBLOCKED | CIndividualProcessNode::PRFINDIRECTBLOCKED | CIndividualProcessNode::PRFPROCESSINGBLOCKED,calcAlgContext); addIndividualToProcessingQueueDueToModification = true; } eliminiateBlockedIndividuals(indi,calcAlgContext); if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATISFIABLECACHED) && !indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSATISFIABLECACHEDDUEDIRECTMODIFIED)) { indi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSATISFIABLECACHEDDUEDIRECTMODIFIED); addIndividualToProcessingQueueDueToModification = true; } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED) && !indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSIGNATUREBLOCKINGCACHEDDUEDIRECTMODIFIED)) { indi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSIGNATUREBLOCKINGCACHEDDUEDIRECTMODIFIED); addIndividualToProcessingQueueDueToModification = true; } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED) && !indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTCOMPLETIONGRAPHCACHEDDUEDIRECTMODIFIED)) { indi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTCOMPLETIONGRAPHCACHEDDUEDIRECTMODIFIED); addIndividualToProcessingQueueDueToModification = true; } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED) && !indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSATURATIONBLOCKINGCACHEDDUEDIRECTMODIFIED)) { indi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSATURATIONBLOCKINGCACHEDDUEDIRECTMODIFIED); addIndividualToProcessingQueueDueToModification = true; } if (addIndividualToProcessingQueueDueToModification) { addIndividualToBlockingUpdateReviewProcessingQueue(indi,calcAlgContext); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKEND | CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDSUCCESSOREXPANSIONBLOCKED | CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDNEIGHBOUREXPANSIONBLOCKED) && !indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTBACKENDSYNCHRONIZATIONDUEDIRECTMODIFIED)) { indi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTBACKENDSYNCHRONIZATIONDUEDIRECTMODIFIED); if (!addIndividualToProcessingQueueDueToModification) { addIndividualToBackendSynchronisationRetestQueue(indi,calcAlgContext); } } if (mOptIncrementalCompatibleExpansion && indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINCREMENTALEXPANDING) && !indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINCREMENTALEXPANSIONRETESTDUEDIRECTMODIFIED)) { indi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFINCREMENTALEXPANSIONRETESTDUEDIRECTMODIFIED); addIndividualToIncrementalCompatibilityCheckingQueue(indi,calcAlgContext); } if (indi->isNominalIndividual() && indi->getNominalIndividual() && indi->isDelayedNominalProcessingQueued()) { indi->setDelayedNominalProcessingQueued(false); addIndividualToProcessingQueue(indi,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndirectSuccessorBlocking(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { propagateAddingBlockedProcessingRestrictionToSuccessors(indi,CIndividualProcessNode::PRFINDIRECTBLOCKED,true,CIndividualProcessNode::PRFINDIRECTBLOCKED,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::pruneSuccessors(CIndividualProcessNode*& indi, CIndividualProcessNode* ancestorIndi, bool removeNominalLinks, CCalculationAlgorithmContextBase* calcAlgContext) { indi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED); eliminiateBlockedIndividuals(indi,calcAlgContext); if (removeNominalLinks && ancestorIndi) { cint64 ancIndiID = ancestorIndi->getIndividualID(); CConnectionSuccessorSet* connSuccSet = indi->getConnectionSuccessorSet(false); if (connSuccSet) { if (connSuccSet->getConnectionSuccessorCount() > 0) { CConnectionSuccessorSetIterator conSuccIt = connSuccSet->getConnectionSuccessorIterator(); while (conSuccIt.hasNext()) { cint64 connID = conSuccIt.next(true); if (ancIndiID != connID) { CIndividualProcessNode* nomIndi = getUpToDateIndividual(connID,calcAlgContext); if (nomIndi->isNominalIndividual()) { CIndividualProcessNode* locNomIndi = getLocalizedIndividual(nomIndi,false,calcAlgContext); CSuccessorRoleIterator succRoleIt = locNomIndi->getSuccessorRoleIterator(indi); while (succRoleIt.hasNext()) { CIndividualLinkEdge* link = succRoleIt.next(true); locNomIndi->removeIndividualLink(link); } locNomIndi->removeIndividualConnection(indi); } } } } } CSuccessorIterator succIt = indi->getSuccessorIterator(); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(indi,succLink,calcAlgContext); if (succIndi->isNominalIndividual() && succIndi->getIndividualID() != ancIndiID) { CIndividualProcessNode* locNomIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); CSuccessorRoleIterator succRoleIt = locNomIndi->getSuccessorRoleIterator(indi); while (succRoleIt.hasNext()) { CIndividualLinkEdge* link = succRoleIt.next(true); locNomIndi->removeIndividualLink(link); } locNomIndi->removeIndividualConnection(indi); } } } CSuccessorIterator succIt = indi->getSuccessorIterator(); cint64 ancDepth = indi->getIndividualAncestorDepth(); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(true); if (succLink->getCreatorIndividual()->getIndividualID() == indi->getIndividualID()) { CIndividualProcessNode* succIndi = getSuccessorIndividual(indi,succLink,calcAlgContext); cint64 succAncDepth = succIndi->getIndividualAncestorDepth(); if (succAncDepth > ancDepth) { if (succIndi->isBlockableIndividual() && !succIndi->hasPurgedBlockedProcessingRestrictionFlags()) { CIndividualProcessNode* locSuccIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); pruneSuccessors(locSuccIndi,indi,true,calcAlgContext); } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateProcessingRestrictionToAncestor(CIndividualProcessNode*& indi, cint64 addRestrictionFlags, bool recursive, cint64 whileNotContainsFlags, CCalculationAlgorithmContextBase* calcAlgContext) { propagateAddingProcessingRestrictionToAncestor(indi,addRestrictionFlags,recursive,whileNotContainsFlags,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateAddingProcessingRestrictionToAncestor(CIndividualProcessNode*& indi, cint64 addRestrictionFlags, bool recursive, cint64 whileNotContainsFlags, CCalculationAlgorithmContextBase* calcAlgContext) { if (indi->hasIndividualAncestor()) { CIndividualProcessNode* ancIndi = getAncestorIndividual(indi,calcAlgContext); if (!ancIndi->hasPartialProcessingRestrictionFlags(whileNotContainsFlags)) { CIndividualProcessNode* locAncIndi = getLocalizedIndividual(ancIndi,false,calcAlgContext); locAncIndi->addProcessingRestrictionFlags(addRestrictionFlags); if (recursive) { propagateAddingProcessingRestrictionToAncestor(locAncIndi,addRestrictionFlags,recursive,whileNotContainsFlags,calcAlgContext); } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateProcessingRestrictionToSuccessors(CIndividualProcessNode*& indi, cint64 addRestrictionFlags, bool recursive, cint64 whileNotContainsFlags, CCalculationAlgorithmContextBase* calcAlgContext) { propagateAddingProcessingRestrictionToSuccessors(indi,addRestrictionFlags,recursive,whileNotContainsFlags,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateAddingBlockedProcessingRestrictionToSuccessors(CIndividualProcessNode*& indi, cint64 addRestrictionFlags, bool recursive, cint64 whileNotContainsFlags, CCalculationAlgorithmContextBase* calcAlgContext) { CSuccessorIterator succIt = indi->getSuccessorIterator(); cint64 ancDepth = indi->getIndividualAncestorDepth(); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(indi,succLink,calcAlgContext); cint64 succAncDepth = succIndi->getIndividualAncestorDepth(); if (succAncDepth > ancDepth) { if (!succIndi->hasPartialProcessingRestrictionFlags(whileNotContainsFlags)) { CIndividualProcessNode* locSuccIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); locSuccIndi->addProcessingRestrictionFlags(addRestrictionFlags); if (recursive) { propagateAddingBlockedProcessingRestrictionToSuccessors(locSuccIndi,addRestrictionFlags,recursive,whileNotContainsFlags,calcAlgContext); } eliminiateBlockedIndividuals(locSuccIndi,calcAlgContext); } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateAddingProcessingRestrictionToSuccessors(CIndividualProcessNode*& indi, cint64 addRestrictionFlags, bool recursive, cint64 whileNotContainsFlags, CCalculationAlgorithmContextBase* calcAlgContext) { CSuccessorIterator succIt = indi->getSuccessorIterator(); cint64 ancDepth = indi->getIndividualAncestorDepth(); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(indi,succLink,calcAlgContext); cint64 succAncDepth = succIndi->getIndividualAncestorDepth(); if (succAncDepth > ancDepth) { if (!succIndi->hasPartialProcessingRestrictionFlags(whileNotContainsFlags)) { CIndividualProcessNode* locSuccIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); locSuccIndi->addProcessingRestrictionFlags(addRestrictionFlags); if (recursive) { propagateAddingProcessingRestrictionToSuccessors(locSuccIndi,addRestrictionFlags,recursive,whileNotContainsFlags,calcAlgContext); } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateClearingProcessingRestrictionToSuccessors(CIndividualProcessNode*& indi, cint64 clearRestrictionFlags, bool recursive, cint64 whileContainsFlags, CCalculationAlgorithmContextBase* calcAlgContext) { CSuccessorIterator succIt = indi->getSuccessorIterator(); cint64 ancDepth = indi->getIndividualAncestorDepth(); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(indi,succLink,calcAlgContext); cint64 succAncDepth = succIndi->getIndividualAncestorDepth(); if (succAncDepth > ancDepth) { if (!succIndi->hasPartialProcessingRestrictionFlags(whileContainsFlags)) { CIndividualProcessNode* locSuccIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); locSuccIndi->clearProcessingRestrictionFlags(clearRestrictionFlags); if (recursive) { propagateClearingProcessingRestrictionToSuccessors(locSuccIndi,clearRestrictionFlags,recursive,whileContainsFlags,calcAlgContext); } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::reactivateIndirectBlockedSuccessors(CIndividualProcessNode*& indi, bool recursive, CCalculationAlgorithmContextBase* calcAlgContext) { CSuccessorIterator succIt = indi->getSuccessorIterator(); cint64 ancDepth = indi->getIndividualAncestorDepth(); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(indi,succLink,calcAlgContext); cint64 succAncDepth = succIndi->getIndividualAncestorDepth(); if (succAncDepth > ancDepth) { if (succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINDIRECTBLOCKED)) { if (!succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEINDIRECTBLOCKERLOSS)) { CIndividualProcessNode* locBlockedIndiNode = getLocalizedIndividual(succIndi,true,calcAlgContext); locBlockedIndiNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEINDIRECTBLOCKERLOSS); addIndividualToProcessingQueue(locBlockedIndiNode,calcAlgContext); } } } } } bool CCalculationTableauCompletionTaskHandleAlgorithm::reactivateBlockedIndividuals(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { CXLinker* blockedIndiNodeIt = indi->getBlockedIndividualsLinker(); while (blockedIndiNodeIt) { CIndividualProcessNode* blockedIndiNode = blockedIndiNodeIt->getData(); if (!blockedIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEBLOCKERMODIFIED)) { CIndividualProcessNode* locBlockedIndiNode = getLocalizedIndividual(blockedIndiNode,true,calcAlgContext); locBlockedIndiNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEBLOCKERMODIFIED); addIndividualToProcessingQueue(locBlockedIndiNode,calcAlgContext); } blockedIndiNodeIt = blockedIndiNodeIt->getNext(); } indi->clearBlockedIndividualsLinker(); return true; } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndividualProcessedAndReactivate(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { if (mOptProcessedNodePropagation || mOptProcessedConsNodePropagation && indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCONSNODEPREPARATIONINDINODE)) { if (!indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPROCESSINGCOMPLETED)) { indi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFPROCESSINGCOMPLETED); if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORALLPROCESSED) || !hasAncestorIndividualNode(indi,calcAlgContext)) { // wake up next individual nodes searchReactivateIndividualsProcessedPropagated(indi,calcAlgContext); } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::searchReactivateIndividualsProcessedPropagated(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { CXLinker* processingBlockedNodeLinker = indi->getProcessingBlockedIndividualsLinker(); while (processingBlockedNodeLinker) { CIndividualProcessNode* blockedNode = processingBlockedNodeLinker->getData(); CIndividualProcessNode* locBlockedNode = getLocalizedIndividual(blockedNode,true,calcAlgContext); locBlockedNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEPROCESSINGCOMPLETED); addIndividualToProcessingQueue(locBlockedNode,calcAlgContext); // set blocking retest flag, clear processing blocked flag processingBlockedNodeLinker = processingBlockedNodeLinker->getNext(); } indi->clearBlockedIndividualsLinker(); cint64 indiID = indi->getIndividualID(); // TODO: check multiple not processed ancestors CSuccessorIterator succIt = indi->getSuccessorIterator(); cint64 ancDepth = indi->getIndividualAncestorDepth(); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(indi,succLink,calcAlgContext); cint64 succAncDepth = succIndi->getIndividualAncestorDepth(); if (succAncDepth > ancDepth) { if (!succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORALLPROCESSED)) { // test whether have unprocessed nominals or ancestor bool allProcessedAncestor = true; CConnectionSuccessorSetIterator connIt = succIndi->getConnectionSuccessorIterator(); while (allProcessedAncestor && connIt.hasNext()) { cint64 connIndiNodeID = connIt.next(); if (connIndiNodeID != indiID) { CIndividualProcessNode* ancNomIndi = getUpToDateIndividual(connIndiNodeID,calcAlgContext); if (ancNomIndi->getIndividualAncestorDepth() >= ancDepth || ancNomIndi->isNominalIndividual()) { if (!ancNomIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPROCESSINGCOMPLETED | CIndividualProcessNode::PRFANCESTORALLPROCESSED)) { allProcessedAncestor = false; } } } } if (allProcessedAncestor) { CIndividualProcessNode* locSuccIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); locSuccIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORALLPROCESSED); if (!locSuccIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPROCESSINGCOMPLETED)) { if (locSuccIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPROCESSINGBLOCKED)) { locSuccIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEPROCESSINGCOMPLETED); addIndividualToProcessingQueue(locSuccIndi,calcAlgContext); } } else { // search recursive all nodes which has to be reactivated searchReactivateIndividualsProcessedPropagated(locSuccIndi,calcAlgContext); } } } } } } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndividualUnprocessed(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { if (mOptProcessedNodePropagation) { propagateIndividualUnprocessed(indi,false,calcAlgContext); } else if (mOptProcessedConsNodePropagation) { propagateIndividualUnprocessed(indi,true,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndividualUnprocessed(CIndividualProcessNode*& indi, bool requiresConsFlag, CCalculationAlgorithmContextBase* calcAlgContext) { if (!requiresConsFlag || indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCONSNODEPREPARATIONINDINODE)) { if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPROCESSINGCOMPLETED)) { indi->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFPROCESSINGCOMPLETED); if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORALLPROCESSED)) { CSuccessorIterator succIt = indi->getSuccessorIterator(); cint64 ancDepth = indi->getIndividualAncestorDepth(); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(true); CIndividualProcessNode* succIndi = getSuccessorIndividual(indi,succLink,calcAlgContext); cint64 succAncDepth = succIndi->getIndividualAncestorDepth(); if (succAncDepth > ancDepth) { if (!succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORALLPROCESSED)) { CIndividualProcessNode* locSuccIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); locSuccIndi->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORALLPROCESSED); propagateIndividualUnprocessed(locSuccIndi,CIndividualProcessNode::PRFANCESTORALLPROCESSED,calcAlgContext); } } } } } } } bool CCalculationTableauCompletionTaskHandleAlgorithm::isIndividualNodeProcessingBlocked(CIndividualProcessNode* blockingTestIndi, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(INDINODEPROCESSINGBLOCKINGTESTCOUNT,calcAlgContext); if (blockingTestIndi->hasPurgedBlockedProcessingRestrictionFlags()) { return true; } if (isSaturationCachedProcessingBlocked(blockingTestIndi,calcAlgContext)) { return true; } if (isIndividualNodeCompletionGraphCached(blockingTestIndi,calcAlgContext)) { return true; } if (isSatisfiableCachedProcessingBlocked(blockingTestIndi,calcAlgContext)) { return true; } if (isSignatureBlockedProcessingBlocked(blockingTestIndi,calcAlgContext)) { return true; } if (blockingTestIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPROCESSINGBLOCKED)) { if (mOptDetExpPreporcessing) { return true; } else { return detectIndividualNodeBlockedStatus(blockingTestIndi,calcAlgContext); } } if (blockingTestIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINDIRECTBLOCKED)) { if (blockingTestIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEINDIRECTBLOCKERLOSS)) { return detectIndividualNodeBlockedStatus(blockingTestIndi,calcAlgContext); } else { return true; } } if (blockingTestIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFDIRECTBLOCKED)) { if (blockingTestIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEDIRECTMODIFIED | CIndividualProcessNode::PRFBLOCKINGRETESTDUEBLOCKERMODIFIED)) { return detectIndividualNodeBlockedStatus(blockingTestIndi,calcAlgContext); } else { return true; } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isIndividualNodeExpansionBlocked(CIndividualProcessNode* blockingTestIndi, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(INDINODEEXPANSIONBLOCKINGTESTCOUNT,calcAlgContext); return detectIndividualNodeBlockedStatus(blockingTestIndi,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::needsIndividualNodeExpansionBlockingTest(CConceptProcessDescriptor* conProDes, CIndividualProcessNode* blockingTestIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* conDes = conProDes->getConceptDescriptor(); CConcept* concept = conDes->getConcept(); double conPriority = conProDes->getProcessPriority().getPriority(); bool conNeg = conDes->getNegation(); cint64 opCode = concept->getOperatorCode(); cint64 opCount = concept->getOperandCount();; cint64 parameter = concept->getParameter(); bool needsBlockingTest = false; if (!conNeg) { switch (opCode) { case CCSOME : case CCATLEAST : case CCAQSOME: { needsBlockingTest = true; break; } case CCOR : { if (mOptNonStrictIndiNodeProcessing) { if (opCount >= 1) { needsBlockingTest = true; } } break; } case CCATMOST : { if (mOptNonStrictIndiNodeProcessing) { if (parameter > 1) { needsBlockingTest = true; } } break; } } } else { switch (opCode) { case CCALL : case CCATMOST : { needsBlockingTest = true; break; } case CCAND : case CCEQ : { if (mOptNonStrictIndiNodeProcessing) { if (opCount >= 1) { needsBlockingTest = true; } } break; } case CCATLEAST : { if (mOptNonStrictIndiNodeProcessing) { if (parameter > 2) { needsBlockingTest = true; } } break; } } } return needsBlockingTest; } bool CCalculationTableauCompletionTaskHandleAlgorithm::hasAncestorIndividualNode(CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* ancIndi = nullptr; CIndividualLinkEdge* ancLink = processIndi->getAncestorLink(); return ancLink != nullptr; } bool CCalculationTableauCompletionTaskHandleAlgorithm::hasRoleSuccessorConcept(CIndividualProcessNode*& processIndi, CRole* role, CConcept* concept, bool conceptNegation, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyRoleSuccessorHash* roleSuccHash = processIndi->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { CRoleSuccessorLinkIterator roleSuccIt = roleSuccHash->getRoleSuccessorLinkIterator(role); while (roleSuccIt.hasNext()) { CIndividualLinkEdge* link = roleSuccIt.next(); CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); CReapplyConceptLabelSet* conLabelSet = succIndi->getReapplyConceptLabelSet(false); bool contained = conLabelSet->hasConcept(concept,conceptNegation); if (contained) { return true; } } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::hasRoleSuccessorConcepts(CIndividualProcessNode*& processIndi, CRole* role, CSortedNegLinker* conceptLinker, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyRoleSuccessorHash* roleSuccHash = processIndi->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { CRoleSuccessorLinkIterator roleSuccIt = roleSuccHash->getRoleSuccessorLinkIterator(role); while (roleSuccIt.hasNext()) { bool allContained = true; CIndividualLinkEdge* link = roleSuccIt.next(); CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); CReapplyConceptLabelSet* conLabelSet = succIndi->getReapplyConceptLabelSet(false); CSortedNegLinker* conceptLinkerIt = conceptLinker; while (conceptLinkerIt && allContained) { CConcept* concept = conceptLinkerIt->getData(); bool conceptNegation = conceptLinkerIt->isNegated() ^ negate; bool contained = conLabelSet->hasConcept(concept,conceptNegation); allContained &= contained; conceptLinkerIt = conceptLinkerIt->getNext(); } if (allContained) { if (processIndi->isIndividualAncestor(succIndi)) { } return true; } } } return false; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getRoleSuccessorWithConcepts(CIndividualProcessNode*& processIndi, CRole* role, CSortedNegLinker* conceptLinker, bool negate, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyRoleSuccessorHash* roleSuccHash = processIndi->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { CRoleSuccessorLinkIterator roleSuccIt = roleSuccHash->getRoleSuccessorLinkIterator(role); while (roleSuccIt.hasNext()) { bool allContained = true; CIndividualLinkEdge* link = roleSuccIt.next(); CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); CReapplyConceptLabelSet* conLabelSet = succIndi->getReapplyConceptLabelSet(false); CSortedNegLinker* conceptLinkerIt = conceptLinker; while (conceptLinkerIt && allContained) { CConcept* concept = conceptLinkerIt->getData(); bool conceptNegation = conceptLinkerIt->isNegated() ^ negate; bool contained = conLabelSet->hasConcept(concept,conceptNegation); allContained &= contained; conceptLinkerIt = conceptLinkerIt->getNext(); } if (allContained) { return succIndi; } } } return nullptr; } bool CCalculationTableauCompletionTaskHandleAlgorithm::hasDistinctRoleSuccessorConcepts(CIndividualProcessNode*& processIndi, CRole* role, CSortedNegLinker* conceptLinker, bool negate, cint64 distinctCount, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyRoleSuccessorHash* roleSuccHash = processIndi->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { CRoleSuccessorLinkIterator roleSuccIt = roleSuccHash->getRoleSuccessorLinkIterator(role); while (roleSuccIt.hasNext()) { bool allContained = true; CIndividualLinkEdge* link = roleSuccIt.next(); CIndividualProcessNode* succIndi = getSuccessorIndividual(processIndi,link,calcAlgContext); cint64 succIndiID = succIndi->getIndividualID(); CDistinctHash* disHash = succIndi->getDistinctHash(false); if (disHash) { cint64 maxSuccDisCount = disHash->getDistinctCount()+1; if (maxSuccDisCount >= distinctCount && containsIndividualNodeConcepts(succIndi,conceptLinker,negate,calcAlgContext)) { cint64 succDisCount = 1; cint64 failDisCount = 0; CDistinctIterator disIt = disHash->getDistinctIterator(); while (disIt.hasNext() && maxSuccDisCount-failDisCount >= distinctCount && succDisCount < distinctCount) { cint64 disIndiID = disIt.nextDistinctIndividualID(); if (disIndiID != succIndiID && processIndi->hasRoleSuccessorToIndividual(role,disIndiID,true)) { // check has necessary concept if (disIndiID < succIndiID) { // the combination has been already checked, where successor individual node had the smaller ID break; } CIndividualProcessNode* disIndi = getUpToDateIndividual(disIndiID,calcAlgContext); if (containsIndividualNodeConcepts(disIndi,conceptLinker,negate,calcAlgContext)) { ++succDisCount; } else { ++failDisCount; } } } if (succDisCount >= distinctCount) { return true; } } } } } return false; } void CCalculationTableauCompletionTaskHandleAlgorithm::createIndividualNodeDisjointRolesLinks(CIndividualProcessNode*& sourceIndi, CIndividualProcessNode*& destinationIndi, CSortedNegLinker* disjointRoleLinker, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { if (disjointRoleLinker) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CSortedNegLinker* disjointRoleLinkerIt = disjointRoleLinker; while (disjointRoleLinkerIt) { CRole* disjointRole = disjointRoleLinkerIt->getData(); // add negation / disjoint edge CNegationDisjointEdge* negDisEdge = CObjectParameterizingAllocator< CNegationDisjointEdge,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,calcAlgContext->getUsedProcessContext()); negDisEdge->initNegationDisjointEdge(sourceIndi,destinationIndi,disjointRole,depTrackPoint); CIndividualLinkEdge* linkIndi = sourceIndi->getRoleSuccessorToIndividualLink(disjointRole,destinationIndi,true); if (linkIndi) { // create clash CClashedDependencyDescriptor* clashDes = nullptr; clashDes = createClashedIndividualLinkDescriptor(clashDes,linkIndi,linkIndi->getDependencyTrackPoint(),calcAlgContext); clashDes = createClashedNegationDisjointDescriptor(clashDes,negDisEdge,depTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(clashDes); } else { sourceIndi->setDisjointRoleConnections(true); destinationIndi->setDisjointRoleConnections(true); sourceIndi->installDisjointLink(negDisEdge); } disjointRoleLinkerIt = disjointRoleLinkerIt->getNext(); } // it is not necessary to install to the destination individual node the connection from the source node, the disjoint roles have a role link which does this already } } void CCalculationTableauCompletionTaskHandleAlgorithm::createIndividualNodeNegationLink(CIndividualProcessNode*& sourceIndi, CIndividualProcessNode*& destinationIndi, CRole* negationRole, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CNegationDisjointEdge* negDisEdge = CObjectParameterizingAllocator< CNegationDisjointEdge,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,calcAlgContext->getUsedProcessContext()); negDisEdge->initNegationDisjointEdge(sourceIndi,destinationIndi,negationRole,depTrackPoint); CIndividualLinkEdge* linkIndi = sourceIndi->getRoleSuccessorToIndividualLink(negationRole,destinationIndi,true); if (linkIndi) { // create clash CClashedDependencyDescriptor* clashDes = nullptr; clashDes = createClashedIndividualLinkDescriptor(clashDes,linkIndi,linkIndi->getDependencyTrackPoint(),calcAlgContext); clashDes = createClashedNegationDisjointDescriptor(clashDes,negDisEdge,depTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(clashDes); } else { // add negation / disjoint edge sourceIndi->installDisjointLink(negDisEdge); sourceIndi->setDisjointRoleConnections(true); destinationIndi->setDisjointRoleConnections(true); destinationIndi->getConnectionSuccessorSet(true)->insertConnectionSuccessor(sourceIndi->getIndividualID()); } } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndividualNodeNewNominalConnectionToAncestors(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { propagateIndividualNodeNominalConnectionFlagsToAncestors(indi,CIndividualProcessNode::PRFSUCCESSORNEWNOMINALCONNECTION | CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndividualNodeNominalConnectionToAncestors(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { propagateIndividualNodeNominalConnectionFlagsToAncestors(indi,CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndividualNodeNominalConnectionFlagsToAncestors(CIndividualProcessNode*& indi, cint64 nominalPropagationFlags, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* ancIndi = indi; while (ancIndi && !ancIndi->hasPartialProcessingRestrictionFlags(nominalPropagationFlags)) { ancIndi->addProcessingRestrictionFlags(nominalPropagationFlags); CXLinker* procBlockIndiLinkerIt = ancIndi->getProcessingBlockedIndividualsLinker(); while (procBlockIndiLinkerIt) { CIndividualProcessNode* blockedIndiNode = procBlockIndiLinkerIt->getData(); if (!blockedIndiNode->hasPartialProcessingRestrictionFlags(nominalPropagationFlags)) { CIndividualProcessNode* locBlockedIndiNode = getLocalizedIndividual(blockedIndiNode,true,calcAlgContext); propagateIndividualNodeNominalConnectionFlagsToAncestors(locBlockedIndiNode,nominalPropagationFlags,calcAlgContext); } procBlockIndiLinkerIt = procBlockIndiLinkerIt->getNext(); } CXLinker* blockedIndiLinkerIt = ancIndi->getBlockedIndividualsLinker(); while (blockedIndiLinkerIt) { CIndividualProcessNode* blockedIndiNode = blockedIndiLinkerIt->getData(); if (!blockedIndiNode->hasPartialProcessingRestrictionFlags(nominalPropagationFlags)) { CIndividualProcessNode* locBlockedIndiNode = getLocalizedIndividual(blockedIndiNode,true,calcAlgContext); propagateIndividualNodeNominalConnectionFlagsToAncestors(locBlockedIndiNode,nominalPropagationFlags,calcAlgContext); } blockedIndiLinkerIt = blockedIndiLinkerIt->getNext(); } CBlockingFollowSet* followSet = ancIndi->getBlockingFollowSet(false); if (followSet) { for (CBlockingFollowSet::const_iterator it = followSet->constBegin(), itEnd = followSet->constEnd(); it != itEnd; ++it) { cint64 blockedIndiNodeID = *it; CIndividualProcessNode* locBlockedIndiNode = getLocalizedIndividual(blockedIndiNodeID,calcAlgContext); propagateIndividualNodeNominalConnectionFlagsToAncestors(locBlockedIndiNode,nominalPropagationFlags,calcAlgContext); } } if (ancIndi->hasSuccessorIndividualNodeBackwardDependencyLinker()) { CXLinker* succIndiNodeBackwardDepLinkerIt = ancIndi->getSuccessorIndividualNodeBackwardDependencyLinker(); while (succIndiNodeBackwardDepLinkerIt) { CIndividualProcessNode* succIndiNodeBackwardDep = succIndiNodeBackwardDepLinkerIt->getData(); if (ancIndi->hasSuccessorIndividualNode(succIndiNodeBackwardDep) && !succIndiNodeBackwardDep->hasPartialProcessingRestrictionFlags(nominalPropagationFlags)) { CIndividualProcessNode* locSuccIndiNodeBackwardDep = getLocalizedIndividual(succIndiNodeBackwardDep,true,calcAlgContext); propagateIndividualNodeNominalConnectionFlagsToAncestors(locSuccIndiNodeBackwardDep,nominalPropagationFlags,calcAlgContext); } succIndiNodeBackwardDepLinkerIt = succIndiNodeBackwardDepLinkerIt->getNext(); } } if (ancIndi->hasIndividualAncestor()) { ancIndi = getAncestorIndividual(ancIndi,calcAlgContext); CIndividualProcessNode* locAncIndi = getLocalizedIndividual(ancIndi,false,calcAlgContext); ancIndi = locAncIndi; } else { ancIndi = nullptr; } } } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndividualNodeNominalConnectionStatusToAncestors(CIndividualProcessNode*& indi, CIndividualProcessNode* copyFromIndiNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (copyFromIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION) || copyFromIndiNode->isNominalIndividual()) { if (mConfExactNominalDependencyTracking) { CSuccessorConnectedNominalSet* copySuccConnNomSet = copyFromIndiNode->getSuccessorNominalConnectionSet(false); if (copySuccConnNomSet) { for (CSuccessorConnectedNominalSet::const_iterator it = copySuccConnNomSet->constBegin(), itEnd = copySuccConnNomSet->constEnd(); it != itEnd; ++it) { cint64 nominalID = *it; if (!indi->hasSuccessorConnectionToNominal(nominalID)) { propagateIndividualNodeConnectedNominalToAncestors(indi,nominalID,calcAlgContext); } } } } if (copyFromIndiNode->isNominalIndividual()) { CIndividual* nominalIndi = copyFromIndiNode->getNominalIndividual(); if (mConfExactNominalDependencyTracking && nominalIndi) { cint64 nominalID = nominalIndi->getIndividualID(); if (!indi->hasSuccessorConnectionToNominal(nominalID)) { propagateIndividualNodeConnectedNominalToAncestors(indi,nominalID,calcAlgContext); } } cint64 level = copyFromIndiNode->getIndividualNominalLevelOrAncestorDepth(); if (!nominalIndi || level > 0) { propagateIndividualNodeNewNominalConnectionToAncestors(indi,calcAlgContext); } } if (!indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { propagateIndividualNodeNominalConnectionToAncestors(indi,calcAlgContext); } if (copyFromIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNEWNOMINALCONNECTION)) { propagateIndividualNodeNewNominalConnectionToAncestors(indi,calcAlgContext); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndividualNodeConnectedNominalToAncestors(CIndividualProcessNode*& indi, cint64 nominalID, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 nominalPropagationFlags = CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION; CIndividualProcessNode* ancIndi = indi; while (ancIndi && !ancIndi->hasSuccessorConnectionToNominal(nominalID)) { ancIndi->addProcessingRestrictionFlags(nominalPropagationFlags); ancIndi->addSuccessorConnectionToNominal(nominalID); CXLinker* procBlockIndiLinkerIt = ancIndi->getProcessingBlockedIndividualsLinker(); while (procBlockIndiLinkerIt) { CIndividualProcessNode* blockedIndiNode = procBlockIndiLinkerIt->getData(); if (!blockedIndiNode->hasSuccessorConnectionToNominal(nominalID)) { CIndividualProcessNode* locBlockedIndiNode = getLocalizedIndividual(blockedIndiNode,true,calcAlgContext); propagateIndividualNodeConnectedNominalToAncestors(locBlockedIndiNode,nominalID,calcAlgContext); } procBlockIndiLinkerIt = procBlockIndiLinkerIt->getNext(); } CXLinker* blockedIndiLinkerIt = ancIndi->getBlockedIndividualsLinker(); while (blockedIndiLinkerIt) { CIndividualProcessNode* blockedIndiNode = blockedIndiLinkerIt->getData(); if (!blockedIndiNode->hasSuccessorConnectionToNominal(nominalID)) { CIndividualProcessNode* locBlockedIndiNode = getLocalizedIndividual(blockedIndiNode,true,calcAlgContext); propagateIndividualNodeConnectedNominalToAncestors(locBlockedIndiNode,nominalID,calcAlgContext); } blockedIndiLinkerIt = blockedIndiLinkerIt->getNext(); } CBlockingFollowSet* followSet = ancIndi->getBlockingFollowSet(false); if (followSet) { for (CBlockingFollowSet::const_iterator it = followSet->constBegin(), itEnd = followSet->constEnd(); it != itEnd; ++it) { cint64 blockedIndiNodeID = *it; CIndividualProcessNode* locBlockedIndiNode = getLocalizedIndividual(blockedIndiNodeID,calcAlgContext); propagateIndividualNodeConnectedNominalToAncestors(locBlockedIndiNode,nominalID,calcAlgContext); } } if (ancIndi->hasSuccessorIndividualNodeBackwardDependencyLinker()) { CXLinker* succIndiNodeBackwardDepLinkerIt = ancIndi->getSuccessorIndividualNodeBackwardDependencyLinker(); while (succIndiNodeBackwardDepLinkerIt) { CIndividualProcessNode* succIndiNodeBackwardDep = succIndiNodeBackwardDepLinkerIt->getData(); if (ancIndi->hasSuccessorIndividualNode(succIndiNodeBackwardDep) && !succIndiNodeBackwardDep->hasSuccessorConnectionToNominal(nominalID)) { CIndividualProcessNode* locSuccIndiNodeBackwardDep = getLocalizedIndividual(succIndiNodeBackwardDep,true,calcAlgContext); propagateIndividualNodeConnectedNominalToAncestors(locSuccIndiNodeBackwardDep,nominalID,calcAlgContext); } succIndiNodeBackwardDepLinkerIt = succIndiNodeBackwardDepLinkerIt->getNext(); } } if (ancIndi->hasIndividualAncestor()) { ancIndi = getAncestorIndividual(ancIndi,calcAlgContext); CIndividualProcessNode* locAncIndi = getLocalizedIndividual(ancIndi,false,calcAlgContext); ancIndi = locAncIndi; } else { ancIndi = nullptr; } } } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndividualNodeNeighboursNominalConnectionToAncestors(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { CConnectionSuccessorSetIterator conSuccIt = indi->getConnectionSuccessorIterator(); while (conSuccIt.hasNext()) { cint64 neighbourID = conSuccIt.nextSuccessorConnectionID(); CIndividualProcessNode* neighbourIndiNode = getUpToDateIndividual(neighbourID,calcAlgContext); if (!neighbourIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { CIndividualProcessNode* locNeighbourIndiNode = getLocalizedIndividual(neighbourIndiNode,false,calcAlgContext); propagateIndividualNodeNominalConnectionStatusToAncestors(locNeighbourIndiNode,indi,calcAlgContext); } } } bool CCalculationTableauCompletionTaskHandleAlgorithm::isIndividualNodesMergeable(CIndividualProcessNode* indi1, CIndividualProcessNode* indi2, CClashedDependencyDescriptor*& clashDescriptors, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(INDINODESMERGEABLETESTCOUNT,calcAlgContext); CDistinctHash* disHash = indi1->getDistinctHash(false); STATINC(INDINODESMERGEABLEDISTINCTTESTCOUNT,calcAlgContext); if (disHash) { CDistinctEdge* disEdge = disHash->getIndividualDistinctEdge(indi2->getIndividualID()); if (disEdge) { clashDescriptors = createClashedIndividualDistinctDescriptor(clashDescriptors,disEdge,disEdge->getDependencyTrackPoint(),calcAlgContext); return false; } } if (mConfUniqueNameAssumption) { if (indi1->isNominalIndividual() && indi2->isNominalIndividual()) { if (indi1->getNominalIndividual() != indi2->getNominalIndividual()) { // TODO: clashes correct? clashDescriptors = createClashedConceptDescriptor(clashDescriptors,indi1,nullptr,indi1->getDependencyTrackPoint(),calcAlgContext); clashDescriptors = createClashedConceptDescriptor(clashDescriptors,indi2,nullptr,indi2->getDependencyTrackPoint(),calcAlgContext); return false; } } } if (isLabelConceptClashSet(indi1,indi2,clashDescriptors,calcAlgContext)) { return false; } if (!areIndividualNodesDisjointRolesMergeable(indi1,indi2,clashDescriptors,calcAlgContext)) { return false; } STATINC(INDINODESMERGEABLETESTSUCCESSCOUNT,calcAlgContext); return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::areIndividualNodesDisjointRolesMergeable(CIndividualProcessNode* indi1, CIndividualProcessNode* indi2, CClashedDependencyDescriptor*& clashDescriptors, CCalculationAlgorithmContextBase* calcAlgContext) { if (indi1->hasDisjointRoleConnections() || indi2->hasDisjointRoleConnections()) { if (!isIndividualNodeDisjointRolesMergeable(indi1,indi2,clashDescriptors,calcAlgContext)) { return false; } if (!isIndividualNodeDisjointRolesMergeable(indi2,indi1,clashDescriptors,calcAlgContext)) { return false; } } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isIndividualNodeDisjointRolesMergeable(CIndividualProcessNode* indi1, CIndividualProcessNode* indi2, CClashedDependencyDescriptor*& clashDescriptors, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(INDINODESMERGEABLEDISJOINTROLETESTCOUNT,calcAlgContext); CConnectionSuccessorSet* connSuccSet1 = indi1->getConnectionSuccessorSet(false); CIndividualProcessNode* indi = indi1; CIndividualProcessNode* othIndi = indi2; CConnectionSuccessorSet* connSuccSet = connSuccSet1; cint64 indiID = indi->getIndividualID(); cint64 othIndiID = othIndi->getIndividualID(); if (connSuccSet) { // links which point to adding individual node CConnectionSuccessorSetIterator connIt = connSuccSet->getConnectionSuccessorIterator(); while (connIt.hasNext()) { cint64 connID = connIt.next(); if (connID == indiID) { // test self links CDisjointSuccessorRoleIterator connDisSuccRoleIt(indi->getDisjointSuccessorRoleIterator(indi)); while (connDisSuccRoleIt.hasNext()) { CNegationDisjointEdge* disNegLink = connDisSuccRoleIt.next(); CRole* role = disNegLink->getLinkRole(); CIndividualLinkEdge* link = othIndi->getRoleSuccessorToIndividualLink(role,othIndi,false); if (link) { clashDescriptors = createClashedIndividualLinkDescriptor(clashDescriptors,link,link->getDependencyTrackPoint(),calcAlgContext); clashDescriptors = createClashedNegationDisjointDescriptor(clashDescriptors,disNegLink,disNegLink->getDependencyTrackPoint(),calcAlgContext); return false; } } } else if (othIndiID == connID) { // test ancestor/successor merging link clashes CDisjointSuccessorRoleIterator connDisSuccRoleIt(othIndi->getDisjointSuccessorRoleIterator(indi)); while (connDisSuccRoleIt.hasNext()) { CNegationDisjointEdge* disNegLink = connDisSuccRoleIt.next(); CRole* role = disNegLink->getLinkRole(); CIndividualLinkEdge* link = nullptr; // ancestor self test link = othIndi->getRoleSuccessorToIndividualLink(role,othIndi,false); if (link) { clashDescriptors = createClashedIndividualLinkDescriptor(clashDescriptors,link,link->getDependencyTrackPoint(),calcAlgContext); clashDescriptors = createClashedNegationDisjointDescriptor(clashDescriptors,disNegLink,disNegLink->getDependencyTrackPoint(),calcAlgContext); return false; } // successor self test link = indi->getRoleSuccessorToIndividualLink(role,indi,false); if (link) { clashDescriptors = createClashedIndividualLinkDescriptor(clashDescriptors,link,link->getDependencyTrackPoint(),calcAlgContext); clashDescriptors = createClashedNegationDisjointDescriptor(clashDescriptors,disNegLink,disNegLink->getDependencyTrackPoint(),calcAlgContext); return false; } // ancestor to successor test link = othIndi->getRoleSuccessorToIndividualLink(role,indi,false); if (link) { clashDescriptors = createClashedIndividualLinkDescriptor(clashDescriptors,link,link->getDependencyTrackPoint(),calcAlgContext); clashDescriptors = createClashedNegationDisjointDescriptor(clashDescriptors,disNegLink,disNegLink->getDependencyTrackPoint(),calcAlgContext); return false; } // successor to ancestor test link = indi->getRoleSuccessorToIndividualLink(role,othIndi,false); if (link) { clashDescriptors = createClashedIndividualLinkDescriptor(clashDescriptors,link,link->getDependencyTrackPoint(),calcAlgContext); clashDescriptors = createClashedNegationDisjointDescriptor(clashDescriptors,disNegLink,disNegLink->getDependencyTrackPoint(),calcAlgContext); return false; } } } else { CIndividualProcessNode* connIndi = getUpToDateIndividual(connID,calcAlgContext); CDisjointSuccessorRoleIterator connDisSuccRoleIt(connIndi->getDisjointSuccessorRoleIterator(indi)); while (connDisSuccRoleIt.hasNext()) { CNegationDisjointEdge* disNegLink = connDisSuccRoleIt.next(); CRole* role = disNegLink->getLinkRole(); CIndividualLinkEdge* link = connIndi->getRoleSuccessorToIndividualLink(role,othIndi,false); if (link) { clashDescriptors = createClashedIndividualLinkDescriptor(clashDescriptors,link,link->getDependencyTrackPoint(),calcAlgContext); clashDescriptors = createClashedNegationDisjointDescriptor(clashDescriptors,disNegLink,disNegLink->getDependencyTrackPoint(),calcAlgContext); return false; } } CDisjointSuccessorRoleIterator disSuccRoleIt(indi->getDisjointSuccessorRoleIterator(connIndi)); while (disSuccRoleIt.hasNext()) { CNegationDisjointEdge* disNegLink = disSuccRoleIt.next(); CRole* role = disNegLink->getLinkRole(); CIndividualLinkEdge* link = othIndi->getRoleSuccessorToIndividualLink(role,connIndi,false); if (link) { clashDescriptors = createClashedIndividualLinkDescriptor(clashDescriptors,link,link->getDependencyTrackPoint(),calcAlgContext); clashDescriptors = createClashedNegationDisjointDescriptor(clashDescriptors,disNegLink,disNegLink->getDependencyTrackPoint(),calcAlgContext); return false; } } } } } return true; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isLabelConceptClashSet(CIndividualProcessNode* indi1, CIndividualProcessNode* indi2, CClashedDependencyDescriptor*& clashDescriptors, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(INDINODESMERGEABLECONCEPTSETTESTCOUNT,calcAlgContext); CReapplyConceptLabelSet* conSet1 = indi1->getReapplyConceptLabelSet(false); CReapplyConceptLabelSet* conSet2 = indi2->getReapplyConceptLabelSet(false); if (conSet2->getConceptCount() < conSet1->getConceptCount()) { CReapplyConceptLabelSet* tmpConSet = conSet1; conSet1 = conSet2; conSet2 = tmpConSet; CIndividualProcessNode* tmpIndi = indi1; indi1 = indi2; indi2 = tmpIndi; } CReapplyConceptLabelSetIterator conSet1It = conSet1->getConceptLabelSetIterator(true,false,false); CReapplyConceptLabelSetIterator conSet2It = conSet2->getConceptLabelSetIterator(true,false,false); CConceptDescriptor* conDes2 = conSet2It.getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint2 = conSet2It.getDependencyTrackPoint(); cint64 conTag2 = conDes2->getConceptTag(); conSet2It.moveNext(); while (conSet1It.hasValue()) { CConceptDescriptor* conDes1 = conSet1It.getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint1 = conSet1It.getDependencyTrackPoint(); cint64 conTag1 = conDes1->getConceptTag(); while (conTag2 < conTag1) { if (!conSet2It.hasValue()) { return false; } conDes2 = conSet2It.getConceptDescriptor(); depTrackPoint2 = conSet2It.getDependencyTrackPoint(); conTag2 = conDes2->getConceptTag(); conSet2It.moveNext(); } if (conTag1 == conTag2) { if (conDes1->isNegated() != conDes2->isNegated()) { clashDescriptors = createClashedConceptDescriptor(clashDescriptors,indi1,conDes1,depTrackPoint1,calcAlgContext); clashDescriptors = createClashedConceptDescriptor(clashDescriptors,indi2,conDes2,depTrackPoint2,calcAlgContext); return true; } } conSet1It.moveNext(); } return false; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getMergedIndividualNodes(CIndividualProcessNode*& preferedMergeIntoIndividualNode, CIndividualProcessNode*& individual2, CDependencyTrackPoint* mergeDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* mergedIndividual = nullptr; CIndividualProcessNode* addingIndividual = nullptr; bool switchNodes = false; CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); if (!mConfMergeConstructedIndividualNode && procDataBox->getConstructedIndividualNode()->getIndividualID() == preferedMergeIntoIndividualNode->getIndividualID()) { switchNodes = false; } else if (!mConfMergeConstructedIndividualNode && procDataBox->getConstructedIndividualNode()->getIndividualID() == individual2->getIndividualID()) { switchNodes = true; } else if (preferedMergeIntoIndividualNode->isNominalIndividual() && individual2->isNominalIndividual()) { if (individual2->getIndividualNominalLevel() < preferedMergeIntoIndividualNode->getIndividualNominalLevel()) { switchNodes = true; } else if (individual2->getIndividualNominalLevel() == preferedMergeIntoIndividualNode->getIndividualNominalLevel()) { if (individual2->getIndividualID() < preferedMergeIntoIndividualNode->getIndividualID()) { switchNodes = true; } } } else if (preferedMergeIntoIndividualNode->isNominalIndividual()) { switchNodes = false; } else if (individual2->isNominalIndividual()) { switchNodes = true; } else if (preferedMergeIntoIndividualNode->isIndividualAncestor(individual2)) { switchNodes = false; } else if (individual2->isIndividualAncestor(preferedMergeIntoIndividualNode)) { switchNodes = true; } else { if (individual2->getIndividualAncestorDepth() < preferedMergeIntoIndividualNode->getIndividualAncestorDepth()) { switchNodes = true; } // TODO: check is this if useful? //else if (individual2->getIndividualID() < preferedMergeIntoIndividualNode->getIndividualID()) { // switchNodes = true; //} } if (!switchNodes) { mergedIndividual = preferedMergeIntoIndividualNode; addingIndividual = individual2; } else { mergedIndividual = individual2; addingIndividual = preferedMergeIntoIndividualNode; } mergeIndividualNodeInto(mergedIndividual,addingIndividual,mergeDepTrackPoint,calcAlgContext); return mergedIndividual; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getIntoEmptyMergedIndividualNode(CIndividualProcessNode*& mergingIndividualNode, bool createAsNominal, CIndividualProcessNode* mergerNode, CDependencyTrackPoint* mergeDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* newEmptyIndiNode = createNewEmptyIndividual(calcAlgContext); if (!createAsNominal) { newEmptyIndiNode->setIndividualNominalLevel(mergingIndividualNode->getIndividualNominalLevel()); newEmptyIndiNode->setIndividualAncestorDepth(mergingIndividualNode->getIndividualAncestorDepth()); if (mergingIndividualNode->isNominalIndividual()) { newEmptyIndiNode->setIndividualType(CIndividualProcessNode::NOMINALINDIVIDUALTYPE); } else { newEmptyIndiNode->setIndividualType(CIndividualProcessNode::BLOCKABLEINDIVIDUALTYPE); } } else { newEmptyIndiNode->setIndividualType(CIndividualProcessNode::NOMINALINDIVIDUALTYPE); newEmptyIndiNode->setIndividualNominalLevel(mergerNode->getIndividualNominalLevel()+1); } mergeIndividualNodeInto(newEmptyIndiNode,mergingIndividualNode,mergeDepTrackPoint,calcAlgContext); return newEmptyIndiNode; } void CCalculationTableauCompletionTaskHandleAlgorithm::mergeIndividualNodeInto(CIndividualProcessNode*& mergeIntoIndividualNode, CIndividualProcessNode*& individual, CDependencyTrackPoint* mergeDepTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; STATINC(INDINODEMERGECOUNT,calcAlgContext); KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mBeforeMergingTaskDebugIndiModelString = generateDebugIndiModelStringList(calcAlgContext)); //mMergedStringList.append(QString("merged %1 into %2").arg(individual->getIndividualID()).arg(mergeIntoIndividualNode->getIndividualID())); //if (individual->isNominalIndividual()) { // ++mNominalMergedCount; // cout<<" start-nominal-merge "; // mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // QFile file(QString("./SATCT/Tasks/task-start-nominal-merge-%1-%2-%3.txt").arg(mNominalMergedCount).arg(individual->getIndividualID()).arg(mergeIntoIndividualNode->getIndividualID())); // if (file.open(QIODevice::WriteOnly)) { // file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); // } //} mergeIntoIndividualNode->setLastMergedIntoIndividualNode(individual); individual->setMergedDependencyTrackPoint(mergeDepTrackPoint); bool newLinksAdded = false; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); // merge concept label set CReapplyConceptLabelSet* addingConceptLabelSet = individual->getReapplyConceptLabelSet(false); CConceptProcessingQueue* mergeIntoConProQueue = mergeIntoIndividualNode->getConceptProcessingQueue(true); if (addingConceptLabelSet) { CReapplyConceptLabelSet* mergeIntoConceptLabelSet = mergeIntoIndividualNode->getReapplyConceptLabelSet(true); CReapplyConceptLabelSetIterator prevSetIt = mergeIntoConceptLabelSet->getConceptLabelSetIterator(true,true,false); CReapplyConceptLabelSetIterator conSetIt = addingConceptLabelSet->getConceptLabelSetIterator(true,true,false); cint64 prevDataTag = 0; bool hasPrevData = false; if (prevSetIt.hasNext()) { prevDataTag = prevSetIt.getDataTag(); hasPrevData = true; prevSetIt.moveNext(); } while (conSetIt.hasNext()) { cint64 conTag = conSetIt.getDataTag(); CConceptDescriptor* conDes = conSetIt.getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint = conSetIt.getDependencyTrackPoint(); const CCondensedReapplyQueue* reapplyQueue = conSetIt.getPosNegReapplyQueue(); if (conDes) { while (hasPrevData && prevDataTag < conTag) { if (prevSetIt.hasNext()) { prevDataTag = prevSetIt.getDataTag(); hasPrevData = true; prevSetIt.moveNext(); } else { hasPrevData = false; } } if (!hasPrevData || (hasPrevData && prevDataTag != conTag)) { STATINC(INDINODEMERGECONCEPTSADDCOUNT,calcAlgContext); // create dependency CDependencyTrackPoint* newDepTrackPoint = nullptr; CMERGEDCONCEPTDependencyNode* mergedConDepNode = createMERGEDCONCEPTDependency(newDepTrackPoint,mergeIntoIndividualNode,conDes,mergeDepTrackPoint,depTrackPoint,calcAlgContext); addConceptToIndividual(conDes->getConcept(),conDes->getNegation(),mergeIntoIndividualNode,newDepTrackPoint,false,true,calcAlgContext); } } conSetIt.moveNext(); } } CPROCESSINGHASH depTrackPointHash(calcAlgContext->getUsedTaskProcessorContext()); // move all connected incoming links CConnectionSuccessorSet* connSuccSet = individual->getConnectionSuccessorSet(false); if (connSuccSet) { // links which point to adding individual node CConnectionSuccessorSetIterator connIt = connSuccSet->getConnectionSuccessorIterator(); while (connIt.hasNext()) { cint64 connID = connIt.next(); if (connID != individual->getIndividualID()) { CIndividualProcessNode* locConnIndi = getLocalizedIndividual(connID,calcAlgContext); if (individual->isNominalIndividual() || locConnIndi->isNominalIndividual() || individual->isIndividualAncestor(locConnIndi) || mergeIntoIndividualNode->hasSuccessorIndividualNode(locConnIndi)) { if (!individual->isNominalIndividual() || !locConnIndi->isIndividualAncestor(individual)) { // links from connected individual node CSuccessorRoleIterator connRoleIt(locConnIndi->getSuccessorRoleIterator(individual)); while (connRoleIt.hasNext()) { CIndividualLinkEdge* link = connRoleIt.next(); CRole* role = link->getLinkRole(); CIndividualProcessNode* creatorIndiNode = mergeIntoIndividualNode; if (link->isCreatorIndividualID(locConnIndi)) { creatorIndiNode = locConnIndi; } if (!locConnIndi->hasRoleSuccessorToIndividual(role,mergeIntoIndividualNode,true)) { STATINC(INDINODEMERGELINKSADDCOUNT,calcAlgContext); // create dependency CDependencyTrackPoint* newDepTrackPoint = nullptr; CDependencyTrackPoint* prevLinkDepTrackPoint = link->getDependencyTrackPoint(); if (depTrackPointHash.contains(prevLinkDepTrackPoint)) { newDepTrackPoint = depTrackPointHash.value(prevLinkDepTrackPoint); } else { CMERGEDLINKDependencyNode* mergedLinkDepNode = createMERGEDLINKDependency(newDepTrackPoint,mergeIntoIndividualNode,mergeDepTrackPoint,prevLinkDepTrackPoint,calcAlgContext); depTrackPointHash.insert(prevLinkDepTrackPoint,newDepTrackPoint); } // generate new link newLinksAdded = true; createNewIndividualsLinkReapplyed(creatorIndiNode,locConnIndi,mergeIntoIndividualNode,role,newDepTrackPoint,calcAlgContext); } locConnIndi->removeIndividualLink(link); } // and reverse CSuccessorRoleIterator succRoleIt(individual->getSuccessorRoleIterator(locConnIndi)); while (succRoleIt.hasNext()) { CIndividualLinkEdge* link = succRoleIt.next(); CIndividualProcessNode* creatorIndiNode = mergeIntoIndividualNode; if (link->isCreatorIndividualID(locConnIndi)) { creatorIndiNode = locConnIndi; } CRole* role = link->getLinkRole(); if (!mergeIntoIndividualNode->hasRoleSuccessorToIndividual(role,locConnIndi,true)) { STATINC(INDINODEMERGELINKSADDCOUNT,calcAlgContext); // create dependency CDependencyTrackPoint* newDepTrackPoint = nullptr; CDependencyTrackPoint* prevLinkDepTrackPoint = link->getDependencyTrackPoint(); if (depTrackPointHash.contains(prevLinkDepTrackPoint)) { newDepTrackPoint = depTrackPointHash.value(prevLinkDepTrackPoint); } else { CMERGEDLINKDependencyNode* mergedLinkDepNode = createMERGEDLINKDependency(newDepTrackPoint,mergeIntoIndividualNode,mergeDepTrackPoint,link->getDependencyTrackPoint(),calcAlgContext); depTrackPointHash.insert(prevLinkDepTrackPoint,newDepTrackPoint); } // generate new link newLinksAdded = true; createNewIndividualsLinkReapplyed(creatorIndiNode,mergeIntoIndividualNode,locConnIndi,role,newDepTrackPoint,calcAlgContext); } } // neg/disjoint links from connected individual node CDisjointSuccessorRoleIterator connNegDisIt(locConnIndi->getDisjointSuccessorRoleIterator(individual)); while (connNegDisIt.hasNext()) { CNegationDisjointEdge* negDisLink = connNegDisIt.next(); CRole* role = negDisLink->getLinkRole(); if (!locConnIndi->hasNegationDisjointToIndividual(role,mergeIntoIndividualNode)) { // TODO: change stat to neg/dis link STATINC(INDINODEMERGELINKSADDCOUNT,calcAlgContext); // create dependency CDependencyTrackPoint* newDepTrackPoint = nullptr; CMERGEDLINKDependencyNode* mergedLinkDepNode = createMERGEDLINKDependency(newDepTrackPoint,mergeIntoIndividualNode,mergeDepTrackPoint,negDisLink->getDependencyTrackPoint(),calcAlgContext); // generate new negation link createIndividualNodeNegationLink(locConnIndi,mergeIntoIndividualNode,role,newDepTrackPoint,calcAlgContext); } } locConnIndi->removeDisjointLinks(individual->getIndividualID()); // and reverse CDisjointSuccessorRoleIterator succNegDisIt(individual->getDisjointSuccessorRoleIterator(locConnIndi)); while (succNegDisIt.hasNext()) { CNegationDisjointEdge* negDisLink = succNegDisIt.next(); CRole* role = negDisLink->getLinkRole(); if (!mergeIntoIndividualNode->hasNegationDisjointToIndividual(role,locConnIndi)) { // TODO: change stat to neg/dis link STATINC(INDINODEMERGELINKSADDCOUNT,calcAlgContext); // create dependency CDependencyTrackPoint* newDepTrackPoint = nullptr; CMERGEDLINKDependencyNode* mergedLinkDepNode = createMERGEDLINKDependency(newDepTrackPoint,mergeIntoIndividualNode,mergeDepTrackPoint,negDisLink->getDependencyTrackPoint(),calcAlgContext); // generate new negation link createIndividualNodeNegationLink(mergeIntoIndividualNode,locConnIndi,role,newDepTrackPoint,calcAlgContext); } } locConnIndi->removeIndividualConnection(individual); } } } } } if (individual->isNominalIndividual()) { CIndividual* nominalIndividual = individual->getNominalIndividual(); if (!mergeIntoIndividualNode->isNominalIndividual()) { mergeIntoIndividualNode->setIndividualType(CIndividualProcessNode::NOMINALINDIVIDUALTYPE); mergeIntoIndividualNode->setNominalIndividual(nominalIndividual); } if (nominalIndividual) { CIndividualMergingHash* otherIndiMergingHash = individual->getIndividualMergingHash(false); CIndividualMergingHash* indiMergingHash = mergeIntoIndividualNode->getIndividualMergingHash(true); if (otherIndiMergingHash) { if (indiMergingHash->isEmpty()) { indiMergingHash->initIndividualMergingHash(otherIndiMergingHash); for (CIndividualMergingHash::iterator it = indiMergingHash->begin(), itEnd = indiMergingHash->end(); it != itEnd; ++it) { CIndividual* individual = it.key(); CDependencyTrackPoint*& indiDepTrackPoint = it.value(); // create dependency CDependencyTrackPoint* newIndiDepTrackPoint = nullptr; CMERGEDIndividualDependencyNode* mergedIndiDepNode = createMERGEDINDIVIDUALDependency(newIndiDepTrackPoint,mergeIntoIndividualNode,mergeDepTrackPoint,indiDepTrackPoint,calcAlgContext); indiDepTrackPoint = newIndiDepTrackPoint; } } else { for (CIndividualMergingHash::const_iterator it = otherIndiMergingHash->constBegin(), itEnd = otherIndiMergingHash->constEnd(); it != itEnd; ++it) { CIndividual* individual = it.key(); CDependencyTrackPoint* indiDepTrackPoint = it.value(); // create dependency CDependencyTrackPoint* newIndiDepTrackPoint = nullptr; CMERGEDIndividualDependencyNode* mergedIndiDepNode = createMERGEDINDIVIDUALDependency(newIndiDepTrackPoint,mergeIntoIndividualNode,mergeDepTrackPoint,indiDepTrackPoint,calcAlgContext); indiMergingHash->insert(nominalIndividual,newIndiDepTrackPoint); } } } if (nominalIndividual->getIndividualID() == individual->getIndividualID()) { CDependencyTrackPoint* indiDepTrackPoint = calcAlgContext->getBaseDependencyNode()->getContinueDependencyTrackPoint(); // create dependency CDependencyTrackPoint* newIndiDepTrackPoint = nullptr; CMERGEDIndividualDependencyNode* mergedIndiDepNode = createMERGEDINDIVIDUALDependency(newIndiDepTrackPoint,mergeIntoIndividualNode,mergeDepTrackPoint,indiDepTrackPoint,calcAlgContext); indiMergingHash->insert(nominalIndividual,newIndiDepTrackPoint); } } } if (!mergeIntoIndividualNode->getDependencyTrackPoint()) { mergeIntoIndividualNode->setDependencyTrackPoint(depTrackPointHash.value(individual->getDependencyTrackPoint())); } if (mConfMinimizeMerging) { if (mergeIntoIndividualNode->isBlockableIndividual() && !mergeIntoIndividualNode->hasIndividualAncestor()) { CIndividualLinkEdge* ancLink = individual->getAncestorLink(); if (ancLink) { CIndividualProcessNode* ancIndiNode = getAncestorIndividual(individual,calcAlgContext); CIndividualLinkEdge* mergedNewAncLink = ancIndiNode->getRoleSuccessorToIndividualLink(ancLink->getLinkRole(),mergeIntoIndividualNode,false); mergeIntoIndividualNode->setAncestorLink(mergedNewAncLink); } } } // add distinct information bool mergedNodeDatatypeDistinctChangeNotified = false; CDistinctHash* addDisHash = individual->getDistinctHash(false); if (addDisHash) { CDistinctHash* mergeDisHash = mergeIntoIndividualNode->getDistinctHash(true); CDistinctIterator disIt = addDisHash->getDistinctIterator(); while (disIt.hasNext()) { CDependencyTrackPoint* depTrackPoint = nullptr; cint64 disIndiID = disIt.nextDistinctIndividualID(depTrackPoint); CIndividualProcessNode* locDisIndiNode = getLocalizedIndividual(disIndiID,calcAlgContext); CDistinctHash* disHash = locDisIndiNode->getDistinctHash(true); disHash->removeDistinctIndividual(individual->getIndividualID()); if (!mergeDisHash->isIndividualDistinct(disIndiID)) { STATINC(INDINODEMERGEDISTINCTADDCOUNT,calcAlgContext); STATINC(DISTINCTCREATIONCOUNT,calcAlgContext); // create dependency CDependencyTrackPoint* newDepTrackPoint = nullptr; CMERGEDLINKDependencyNode* mergedLinkDepNode = createMERGEDLINKDependency(newDepTrackPoint,mergeIntoIndividualNode,mergeDepTrackPoint,depTrackPoint,calcAlgContext); CDistinctEdge* disEdge = CObjectParameterizingAllocator< CDistinctEdge,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,calcAlgContext->getUsedProcessContext()); disEdge->initDistinctEdge(locDisIndiNode,mergeIntoIndividualNode,newDepTrackPoint); mergeDisHash->insertDistinctIndividual(disIndiID,disEdge); disHash->insertDistinctIndividual(mergeIntoIndividualNode->getIndividualID(),disEdge); if (mDatatypeHandler) { mDatatypeHandler->notifyDistinctChanges(locDisIndiNode,calcAlgContext); if (!mergedNodeDatatypeDistinctChangeNotified) { mergedNodeDatatypeDistinctChangeNotified = true; mDatatypeHandler->notifyDistinctChanges(mergeIntoIndividualNode,calcAlgContext); } } } } } // prune nodes individual->setMergedIntoIndividualNodeID(mergeIntoIndividualNode->getIndividualID()); pruneSuccessors(individual,nullptr,false,calcAlgContext); if (individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDBLOCKINGORCACHING)) { mergeIntoIndividualNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDBLOCKINGORCACHING); } if (mConfExactNominalDependencyTracking) { if (individual->isNominalIndividual() && mergeIntoIndividualNode->isNominalIndividual()) { CSuccessorConnectedNominalSet* copySuccConnNomSet = individual->getSuccessorNominalConnectionSet(false); if (copySuccConnNomSet) { for (CSuccessorConnectedNominalSet::const_iterator it = copySuccConnNomSet->constBegin(), itEnd = copySuccConnNomSet->constEnd(); it != itEnd; ++it) { cint64 nominalID = *it; mergeIntoIndividualNode->addSuccessorConnectionToNominal(nominalID); } } CIndividual* nominalIndi = individual->getNominalIndividual(); if (nominalIndi) { cint64 nominalID = nominalIndi->getIndividualID(); mergeIntoIndividualNode->addSuccessorConnectionToNominal(nominalID); } } } // is not necessary since rules are applied again for new added concepts //if (individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { // propagateIndividualNodeNominalConnectionToAncestors(mergeIntoIndividualNode,calcAlgContext); //} if (newLinksAdded) { propagateIndividualNodeModified(mergeIntoIndividualNode,calcAlgContext); } addIndividualToProcessingQueue(mergeIntoIndividualNode,calcAlgContext); //if (individual->isNominalIndividual()) { // ++mNominalMergedCount; // cout<<" end-nominal-merge "; // mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // QFile file(QString("./SATCT/Tasks/task-end-nominal-merge-%1-%2-%3.txt").arg(mNominalMergedCount).arg(individual->getIndividualID()).arg(mergeIntoIndividualNode->getIndividualID())); // if (file.open(QIODevice::WriteOnly)) { // file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); // } //} CRoleAssertionLinker* roleAssLinker = individual->getAssertionRoleLinker(); CReverseRoleAssertionLinker* reverseRoleAssLinker = individual->getReverseAssertionRoleLinker(); if (roleAssLinker || reverseRoleAssLinker) { CAdditionalProcessRoleAssertionsLinker* additionalRoleAssLinker = CObjectAllocator< CAdditionalProcessRoleAssertionsLinker >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); additionalRoleAssLinker->initAdditionalProcessRoleAssertionsLinker(individual->getNominalIndividual(),roleAssLinker,reverseRoleAssLinker); mergeIntoIndividualNode->addAdditionalRoleAssertionsLinker(additionalRoleAssLinker); } for (CAdditionalProcessRoleAssertionsLinker* additionalRoleAssLinkerIt = individual->getAdditionalRoleAssertionsLinker(); additionalRoleAssLinkerIt; additionalRoleAssLinkerIt = additionalRoleAssLinkerIt->getNext()) { CAdditionalProcessRoleAssertionsLinker* additionalRoleAssLinker = CObjectAllocator< CAdditionalProcessRoleAssertionsLinker >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); additionalRoleAssLinker->initAdditionalProcessRoleAssertionsLinker(additionalRoleAssLinkerIt->getIndividual(),additionalRoleAssLinkerIt->getRoleAssertionLinker(),additionalRoleAssLinkerIt->getReverseRoleAssertionLinker()); mergeIntoIndividualNode->addAdditionalRoleAssertionsLinker(additionalRoleAssLinker); } KONCLUCE_TASK_ALGORITHM_MODEL_STRING_INSTRUCTION(mAfterMergingTaskDebugIndiModelString = generateDebugIndiModelStringList(calcAlgContext)); } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::tryExtendFunctionalSuccessorIndividual(CIndividualProcessNode*& indi, CConceptDescriptor* conDes, CSortedNegLinker* roleLinkerIt, CRole* ancRole, CSortedNegLinker* conceptLinkerIt, bool negate, CDependencyTrackPoint* depTrackPoint, CIndividualSaturationProcessNode* saturationIndiNode, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CIndividualProcessNode* succIndi = nullptr; // TODO: test super roles for functional CReapplyRoleSuccessorHash* roleSucc = indi->getReapplyRoleSuccessorHash(false); CIndividualLinkEdge* mergeLink = nullptr; if (roleSucc) { CSortedNegLinker* funTestRoleLinkerIt = roleLinkerIt; while (funTestRoleLinkerIt && !succIndi) { CRole* role = funTestRoleLinkerIt->getData(); bool invRole = funTestRoleLinkerIt->isNegated(); bool functionalRole = !invRole && role->isFunctional(); if (functionalRole) { CRoleSuccessorLinkIterator roleSuccIt = roleSucc->getRoleSuccessorLinkIterator(role); if (roleSuccIt.hasNext()) { CIndividualLinkEdge* link = roleSuccIt.next(false); succIndi = getLocalizedSuccessorIndividual(indi,link,calcAlgContext); mergeLink = link; } } funTestRoleLinkerIt = funTestRoleLinkerIt->getNext(); } } if (succIndi) { // create dependency CDependencyTrackPoint* nextAllDepTrackPoint = nullptr; CALLDependencyNode* allDepNode = createALLDependency(nextAllDepTrackPoint,indi,conDes,depTrackPoint,mergeLink->getDependencyTrackPoint(),calcAlgContext); bool satCachingPossible; CConceptDescriptor* lastSatCachPossibleConDes = nullptr; if (mConfExpandCreatedSuccessorsFromSaturation) { tryExpansionFromSaturatedData(indi,succIndi,conDes,nextAllDepTrackPoint,saturationIndiNode,&satCachingPossible,&lastSatCachPossibleConDes,calcAlgContext); } // update successor links bool newLinksAdded = false; CSortedNegLinker* tmpRoleLinkerIt = roleLinkerIt; while (tmpRoleLinkerIt) { CRole* role = tmpRoleLinkerIt->getData(); bool invRole = tmpRoleLinkerIt->isNegated(); if (!invRole) { if (!hasIndividualsLink(indi,succIndi,role,true,calcAlgContext)) { // add link createNewIndividualsLinkReapplyed(indi,indi,succIndi,role,nextAllDepTrackPoint,calcAlgContext); newLinksAdded = true; } } else { if (!hasIndividualsLink(succIndi,indi,role,true,calcAlgContext)) { // add link createNewIndividualsLinkReapplyed(indi,succIndi,indi,role,nextAllDepTrackPoint,calcAlgContext); newLinksAdded = true; } } tmpRoleLinkerIt = tmpRoleLinkerIt->getNext(); } if (newLinksAdded) { propagateIndividualNodeModified(succIndi,calcAlgContext); } addConceptsToIndividual(conceptLinkerIt,negate,succIndi,nextAllDepTrackPoint,true,true,nullptr,calcAlgContext); if (mConfCachingBlockingFromSaturation) { tryEstablishSaturationCaching(indi,succIndi,saturationIndiNode,&satCachingPossible,&lastSatCachPossibleConDes,calcAlgContext); } } return succIndi; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::createSuccessorIndividual(CIndividualProcessNode*& indi, CConceptDescriptor* conDes, CSortedNegLinker* roleLinkerIt, CRole* ancRole, CSortedNegLinker* conceptLinkerIt, bool negate, CDependencyTrackPoint* depTrackPoint, CIndividualSaturationProcessNode* saturationIndiNode, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CIndividualProcessNode* succIndi = nullptr; // create dependency CDependencyTrackPoint* nextDepTrackPoint = nullptr; CSOMEDependencyNode* someDepNode = createSOMEDependency(nextDepTrackPoint,indi,conDes,depTrackPoint,calcAlgContext); // generate new role successor succIndi = createNewIndividual(nextDepTrackPoint,ancRole->isDataRole(),calcAlgContext); bool satCachingPossible = true; CConceptDescriptor* lastSatCachPossibleConDes = nullptr; if (mConfExpandCreatedSuccessorsFromSaturation) { tryExpansionFromSaturatedData(indi,succIndi,conDes,nextDepTrackPoint,saturationIndiNode,&satCachingPossible,&lastSatCachPossibleConDes,calcAlgContext); } CIndividualLinkEdge* ancLink = createNewIndividualsLinksReapplyed(indi,succIndi,roleLinkerIt,ancRole,nextDepTrackPoint,false,calcAlgContext); succIndi->setAncestorLink(ancLink); succIndi->setIndividualAncestorDepth(indi->getIndividualAncestorDepth()+1); if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATISFIABLECACHED | CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED)) { succIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED | CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED)) { succIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED | CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHED)) { succIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHED); } addConceptsToIndividual(conceptLinkerIt,negate,succIndi,nextDepTrackPoint,true,true,nullptr,calcAlgContext); if (mConfCachingBlockingFromSaturation) { tryEstablishSaturationCaching(indi,succIndi,saturationIndiNode,&satCachingPossible,&lastSatCachPossibleConDes,calcAlgContext); } return succIndi; } bool CCalculationTableauCompletionTaskHandleAlgorithm::tryEstablishSaturationCaching(CIndividualProcessNode*& indi, CIndividualProcessNode* succIndi, CIndividualSaturationProcessNode* saturationIndiNode, bool* satCachingPossible, CConceptDescriptor** lastSatCachPossibleConDes, CCalculationAlgorithmContextBase* calcAlgContext) { if (saturationIndiNode && saturationIndiNode->isInitialized() && saturationIndiNode->isCompleted()) { bool cachingEstablishmentPossible = false; CIndividualSaturationProcessNodeStatusFlags* flags = saturationIndiNode->getIndirectStatusFlags(); if (!flags->hasFlags(CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED,false)) { if (validateSaturationCachingPossible(succIndi,saturationIndiNode,satCachingPossible,lastSatCachPossibleConDes,nullptr,false,calcAlgContext)) { bool nominalNodesCompatible = true; if (flags->hasFlags(CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGNOMINALCONNECTION,false)) { if (!mConfSaturationCachingWithNominals) { nominalNodesCompatible = false; } CSuccessorConnectedNominalSet* succConnNominalSet = saturationIndiNode->getSuccessorConnectedNominalSet(false); if (!succConnNominalSet) { nominalNodesCompatible = false; } else if (!tryInstallSaturationCachingReactivation(succIndi,succConnNominalSet,calcAlgContext)) { nominalNodesCompatible = false; } } if (nominalNodesCompatible) { cachingEstablishmentPossible = true; } } } cint64 succIndiConCount = succIndi->getReapplyConceptLabelSet(false)->getConceptCount(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CIndividualNodeSaturationBlockingData* satBlockingData = CObjectAllocator< CIndividualNodeSaturationBlockingData >::allocateAndConstruct(taskMemMan); satBlockingData->initSaturationBlockingData(succIndiConCount,*lastSatCachPossibleConDes,saturationIndiNode); succIndi->setIndividualSaturationBlockingData(satBlockingData); if (cachingEstablishmentPossible) { STATINC(SATURATIONCACHEESTABLISHCOUNT,calcAlgContext); succIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED); propagateIndirectSuccessorSaturationBlocked(succIndi,calcAlgContext); if (!flags->hasFlags(CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCARDINALITYPROPLEMATIC,false)) { succIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONSUCCESSORCREATIONBLOCKINGCACHED); } return true; } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::tryInitalizingFromSaturatedData(CIndividualProcessNode*& indi, CXSortedNegLinker* initConceptLinker, CDependencyTrackPoint* depTrackPoint, bool allowPreprocess, CCalculationAlgorithmContextBase* calcAlgContext) { if (initConceptLinker) { CConcept* concept = initConceptLinker->getData(); bool conceptNegation = initConceptLinker->isNegated(); CConceptData* conceptData = concept->getConceptData(); CIndividualSaturationProcessNode* baseSatIndiNode = nullptr; if (conceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)conceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* extSatCalcRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(conceptNegation); if (extSatCalcRefLinkData) { baseSatIndiNode = (CIndividualSaturationProcessNode*)extSatCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } if (baseSatIndiNode && baseSatIndiNode->isInitialized()) { CIndividualSaturationProcessNode* satIndiNode = baseSatIndiNode; while (satIndiNode->hasSubstituteIndividualNode()) { satIndiNode = satIndiNode->getSubstituteIndividualNode(); } CReapplyConceptSaturationLabelSet* satConSet = satIndiNode->getReapplyConceptSaturationLabelSet(false); if (satConSet) { if (satIndiNode->getIndirectStatusFlags()->hasClashedFlag() || baseSatIndiNode->getIndirectStatusFlags()->hasClashedFlag()) { CClashedDependencyDescriptor* clashDes = nullptr; addConceptToIndividualSkipANDProcessing(concept,conceptNegation,indi,depTrackPoint,false,false,calcAlgContext); CConceptDescriptor* clashedConDes = nullptr; CDependencyTrackPoint* clashedDepTrackPoint = nullptr; indi->getReapplyConceptLabelSet(false)->getConceptDescriptor(concept,clashedConDes,clashedDepTrackPoint); clashDes = createClashedConceptDescriptor(clashDes,indi,clashedConDes,clashedDepTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(clashDes); } else { bool nominalConnectionFlag = satIndiNode->getIndirectStatusFlags()->hasNominalConnectionFlag(); if (nominalConnectionFlag) { propagateIndividualNodeNominalConnectionToAncestors(indi,calcAlgContext); if (mConfExactNominalDependencyTracking) { CSuccessorConnectedNominalSet* satSuccConnNomSet = satIndiNode->getSuccessorConnectedNominalSet(false); if (satSuccConnNomSet) { CSuccessorConnectedNominalSet* succConnNomSet = indi->getSuccessorNominalConnectionSet(true); for (CSuccessorConnectedNominalSet::const_iterator it = satSuccConnNomSet->constBegin(), itEnd = satSuccConnNomSet->constEnd(); it != itEnd; ++it) { cint64 nominalID = *it; succConnNomSet->insert(nominalID); } } } } bool satCachingPossible = true; CConceptDescriptor* lastSatCachPossibleConDes = nullptr; if (satIndiNode = baseSatIndiNode) { addConceptToIndividualSkipANDProcessing(concept,conceptNegation,indi,depTrackPoint,allowPreprocess,false,calcAlgContext); } else { addConceptToIndividual(concept,conceptNegation,indi,depTrackPoint,allowPreprocess,false,calcAlgContext); } CConceptDescriptor* conDes = nullptr; CDependencyTrackPoint* conDepTrackPoint = nullptr; indi->getReapplyConceptLabelSet(false)->getConceptDescriptor(concept,conDes,conDepTrackPoint); CDependencyTrackPoint* expandDepTrackPoint = nullptr; CANDDependencyNode* andDepNode = createANDDependency(expandDepTrackPoint,indi,conDes,conDepTrackPoint,calcAlgContext); for (CConceptSaturationDescriptor* conSatDesIt = satConSet->getConceptSaturationDescriptionLinker(); conSatDesIt; conSatDesIt = conSatDesIt->getNext()) { CConcept* satConcept = conSatDesIt->getConcept(); bool satConceptNegation = conSatDesIt->isNegated(); STATINC(SATURATIONCACHECONCEPTEXPANSIONCOUNT,calcAlgContext); if (satConcept != concept || conceptNegation != satConceptNegation) { addConceptToIndividualSkipANDProcessing(satConcept,satConceptNegation,indi,expandDepTrackPoint,allowPreprocess,false,calcAlgContext); validateSaturationCachingPossible(indi,satIndiNode,&satCachingPossible,&lastSatCachPossibleConDes,satConcept,satConceptNegation,calcAlgContext); } } CSaturationNodeAssociatedDeterministicConceptExpansion* detExpansion = nullptr; CSaturationNodeExpansionCacheHandler* satCacheHandler = calcAlgContext->getUsedSaturationNodeExpansionCacheHandler(); if (satCacheHandler) { if (satCacheHandler->getCachedDeterministicExpansion(baseSatIndiNode,detExpansion,calcAlgContext)) { if (detExpansion && (mConfSaturationIncompleteExpansionFromCache || !detExpansion->requiresNonDeterministicExpansion())) { for (CSaturationNodeAssociatedConceptLinker* conceptExpansionLinkerIt = detExpansion->getConceptExpansionLinker(); conceptExpansionLinkerIt; conceptExpansionLinkerIt = conceptExpansionLinkerIt->getNext()) { CCacheValue* cacheValue = conceptExpansionLinkerIt->getCacheValue(); CConcept* expansionConcept = (CConcept*)cacheValue->getIdentification(); bool expansionConceptNeg = cacheValue->getCacheValueIdentifier() == CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; addConceptToIndividualSkipANDProcessing(expansionConcept,expansionConceptNeg,indi,expandDepTrackPoint,allowPreprocess,false,calcAlgContext); } } } } cint64 indiConCount = indi->getReapplyConceptLabelSet(false)->getConceptCount(); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CIndividualNodeSaturationBlockingData* satBlockingData = CObjectAllocator< CIndividualNodeSaturationBlockingData >::allocateAndConstruct(taskMemMan); satBlockingData->initSaturationBlockingData(indiConCount,lastSatCachPossibleConDes,baseSatIndiNode); indi->setIndividualSaturationBlockingData(satBlockingData); } CXSortedNegLinker* nextInitConceptLinker = initConceptLinker; if (baseSatIndiNode == satIndiNode) { nextInitConceptLinker = initConceptLinker->getNext(); } for (CXSortedNegLinker* nextInitConceptLinkerIt = nextInitConceptLinker; nextInitConceptLinkerIt; nextInitConceptLinkerIt = nextInitConceptLinkerIt->getNext()) { CConcept* nextConcept = nextInitConceptLinkerIt->getData(); bool nextConceptNegation = nextInitConceptLinkerIt->isNegated(); addConceptToIndividual(nextConcept,nextConceptNegation,indi,depTrackPoint,allowPreprocess,true,calcAlgContext); } return true; } } } return false; } void CCalculationTableauCompletionTaskHandleAlgorithm::propagateIndirectSuccessorSaturationBlocked(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { propagateAddingBlockedProcessingRestrictionToSuccessors(indi,CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHED,true,CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHED,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::validateSaturationCachingPossible(CIndividualProcessNode* indi, CIndividualSaturationProcessNode*& saturationIndiNode, bool* satCachingPossible, CConceptDescriptor** lastSatCachPossibleConDes, CConcept* addedConcept, bool addedConceptNegation, CCalculationAlgorithmContextBase* calcAlgContext) { bool satCachingStillPossible = true; if (satCachingPossible) { satCachingStillPossible = *satCachingPossible; } if (satCachingStillPossible) { if (!saturationIndiNode->isCompleted()) { satCachingStillPossible = false; } else { CReapplyConceptLabelSet* conSet = indi->getReapplyConceptLabelSet(false); CReapplyConceptSaturationLabelSet* satConSet = saturationIndiNode->getReapplyConceptSaturationLabelSet(false); if (conSet && satConSet) { CConceptDescriptor* conDesLinker = conSet->getAddingSortedConceptDescriptionLinker(); CConceptDescriptor* conDesIt = conDesLinker; CConceptDescriptor* lastTestedConDesIt = nullptr; if (lastSatCachPossibleConDes) { lastTestedConDesIt = *lastSatCachPossibleConDes; } if (addedConcept && conDesIt != lastTestedConDesIt) { if (conDesIt->getConcept() == addedConcept || conDesIt->isNegated() == addedConceptNegation) { conDesIt = conDesIt->getNext(); } } //while (conDesIt != lastTestedConDesIt && fromSatDataConceptsAddedCount > 0) { // --fromSatDataConceptsAddedCount; // conDesIt = conDesIt->getNext(); //} while (conDesIt != lastTestedConDesIt && satCachingStillPossible) { if (!satConSet->hasConcept(conDesIt->getConcept(),conDesIt->isNegated())) { satCachingStillPossible = false; } conDesIt = conDesIt->getNext(); } if (lastSatCachPossibleConDes) { *lastSatCachPossibleConDes = conDesLinker; } } else { satCachingStillPossible = false; } } } if (satCachingPossible) { *satCachingPossible = satCachingStillPossible; } return satCachingStillPossible; } CIndividualSaturationProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getCreationSuccessorSaturationNode(CIndividualProcessNode*& indi, CConceptDescriptor* conDes, CCalculationAlgorithmContextBase* calcAlgContext) { CConcept* concept = conDes->getConcept(); bool conceptNegation = conDes->isNegated(); CConceptData* conceptData = concept->getConceptData(); CIndividualSaturationProcessNode* existIndiNode = nullptr; if (conceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)conceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* extSatCalcRefLinkData = confSatRefLinkingData->getExistentialSuccessorConceptSaturationReferenceLinkingData(); if (extSatCalcRefLinkData) { existIndiNode = (CIndividualSaturationProcessNode*)extSatCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } if (!existIndiNode) { CSortedNegLinker* conceptOpLinker = concept->getOperandList(); if (!conceptOpLinker->hasNext()) { CConcept* opConcept = conceptOpLinker->getData(); bool opConNegation = conceptOpLinker->isNegated()^conceptNegation; CConceptData* opConceptData = opConcept->getConceptData(); if (opConceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)opConceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* satCalcRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(opConNegation); if (satCalcRefLinkData) { existIndiNode = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } } } return existIndiNode; } bool CCalculationTableauCompletionTaskHandleAlgorithm::tryExpansionFromSaturatedData(CIndividualProcessNode*& indi, CIndividualProcessNode* createdSuccIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* depTrackPoint, CIndividualSaturationProcessNode*& saturationIndiNode, bool* satCachingPossible, CConceptDescriptor** lastSatCachPossibleConDes, CCalculationAlgorithmContextBase* calcAlgContext) { if (saturationIndiNode && saturationIndiNode->isInitialized()) { CReapplyConceptSaturationLabelSet* satConSet = saturationIndiNode->getReapplyConceptSaturationLabelSet(false); if (satConSet) { bool nominalConnectionFlag = saturationIndiNode->getIndirectStatusFlags()->hasNominalConnectionFlag(); if (saturationIndiNode->getIndirectStatusFlags()->hasClashedFlag()) { if (!nominalConnectionFlag || !mOptIncrementalExpansion) { CClashedDependencyDescriptor* clashDes = nullptr; clashDes = createClashedConceptDescriptor(clashDes,indi,conDes,depTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(clashDes); } } else { if (!mOptIncrementalExpansion || !nominalConnectionFlag) { if (nominalConnectionFlag) { propagateIndividualNodeNominalConnectionToAncestors(createdSuccIndi,calcAlgContext); if (mConfExactNominalDependencyTracking) { CSuccessorConnectedNominalSet* satSuccConnNomSet = saturationIndiNode->getSuccessorConnectedNominalSet(false); if (satSuccConnNomSet) { CSuccessorConnectedNominalSet* succConnNomSet = createdSuccIndi->getSuccessorNominalConnectionSet(true); for (CSuccessorConnectedNominalSet::const_iterator it = satSuccConnNomSet->constBegin(), itEnd = satSuccConnNomSet->constEnd(); it != itEnd; ++it) { cint64 nominalID = *it; succConnNomSet->insert(nominalID); } } } propagateIndividualNodeNominalConnectionStatusToAncestors(indi,createdSuccIndi,calcAlgContext); } for (CConceptSaturationDescriptor* conSatDesIt = satConSet->getConceptSaturationDescriptionLinker(); conSatDesIt; conSatDesIt = conSatDesIt->getNext()) { CConcept* satConcept = conSatDesIt->getConcept(); bool satConceptNegation = conSatDesIt->isNegated(); STATINC(SATURATIONCACHECONCEPTEXPANSIONCOUNT,calcAlgContext); addConceptToIndividualSkipANDProcessing(satConcept,satConceptNegation,createdSuccIndi,depTrackPoint,true,false,calcAlgContext); validateSaturationCachingPossible(createdSuccIndi,saturationIndiNode,satCachingPossible,lastSatCachPossibleConDes,satConcept,satConceptNegation,calcAlgContext); } CSaturationNodeAssociatedDeterministicConceptExpansion* detExpansion = nullptr; CSaturationNodeExpansionCacheHandler* satCacheHandler = calcAlgContext->getUsedSaturationNodeExpansionCacheHandler(); if (satCacheHandler) { if (satCacheHandler->getCachedDeterministicExpansion(saturationIndiNode,detExpansion,calcAlgContext)) { if (detExpansion && (mConfSaturationIncompleteExpansionFromCache || !detExpansion->requiresNonDeterministicExpansion())) { for (CSaturationNodeAssociatedConceptLinker* conceptExpansionLinkerIt = detExpansion->getConceptExpansionLinker(); conceptExpansionLinkerIt; conceptExpansionLinkerIt = conceptExpansionLinkerIt->getNext()) { CCacheValue* cacheValue = conceptExpansionLinkerIt->getCacheValue(); CConcept* expansionConcept = (CConcept*)cacheValue->getIdentification(); bool expansionConceptNeg = cacheValue->getCacheValueIdentifier() == CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; addConceptToIndividualSkipANDProcessing(expansionConcept,expansionConceptNeg,createdSuccIndi,depTrackPoint,true,false,calcAlgContext); } } } } return true; } } } } return false; } void CCalculationTableauCompletionTaskHandleAlgorithm::createDistinctSuccessorIndividuals(CIndividualProcessNode*& indi, CPROCESSINGLIST& indiList, CSortedNegLinker* roleLinkerIt, CRole* ancRole, CSortedNegLinker* conceptLinkerIt, bool negate, CDependencyTrackPoint* depTrackPoint, cint64 succCardCount, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); for (cint64 i = 0; i < succCardCount; ++i) { CIndividualProcessNode* succIndi = nullptr; succIndi = createNewIndividual(depTrackPoint,ancRole->isDataRole(),calcAlgContext); indiList.append(succIndi); } createIndividualsDistinct(indiList,depTrackPoint,calcAlgContext); for (CPROCESSINGLIST::const_iterator it = indiList.constBegin(), itEnd = indiList.constEnd(); it != itEnd; ++it) { CIndividualProcessNode* succIndi = *it; CIndividualLinkEdge* ancLink = createNewIndividualsLinksReapplyed(indi,succIndi,roleLinkerIt,ancRole,depTrackPoint,false,calcAlgContext); succIndi->setAncestorLink(ancLink); succIndi->setIndividualAncestorDepth(indi->getIndividualAncestorDepth()+1); if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATISFIABLECACHED | CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED)) { succIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED | CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED)) { succIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED); } if (indi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED | CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHED)) { succIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHED); } addConceptsToIndividual(conceptLinkerIt,negate,succIndi,depTrackPoint,true,true,nullptr,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::createNominalsSuccessorIndividuals(CIndividualProcessNode*& indi, CSortedNegLinker* roleLinkerIt, CRole* ancRole, CSortedNegLinker* conceptLinkerIt, bool negate, CDependencyTrackPoint* depTrackPoint, cint64 succCardCount, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); for (cint64 i = 0; i < succCardCount; ++i) { STATINC(NOMINALSUCCESSORINDINODECREATIONCOUNT,calcAlgContext); CIndividualProcessNode* succIndi = nullptr; succIndi = createNewIndividual(depTrackPoint,false,calcAlgContext); CIndividualLinkEdge* ancLink = createNewIndividualsLinksReapplyed(indi,succIndi,roleLinkerIt,ancRole,depTrackPoint,false,calcAlgContext); succIndi->setIndividualType(CIndividualProcessNode::NOMINALINDIVIDUALTYPE); succIndi->setIndividualNominalLevel(indi->getIndividualNominalLevel()+1); addIndividualToProcessingQueue(succIndi,calcAlgContext); } } CIndividualLinkEdge* CCalculationTableauCompletionTaskHandleAlgorithm::createNewIndividualsLinks(CIndividualProcessNode*& indiSource, CIndividualProcessNode*& indiDestination, CSortedNegLinker* roleLinkerIt, CRole* ancRole, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualLinkEdge* ancRoleLink = nullptr; CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); bool generatedInvLink = false; while (roleLinkerIt) { CRole* role = roleLinkerIt->getData(); bool invRole = roleLinkerIt->isNegated(); STATINC(LINKSCREATIONCOUNT,calcAlgContext); CIndividualLinkEdge* individualLink = CObjectParameterizingAllocator< CIndividualLinkEdge,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,calcAlgContext->getUsedProcessContext()); if (!invRole) { createIndividualNodeDisjointRolesLinks(indiSource,indiDestination,role->getDisjointRoleList(),depTrackPoint,calcAlgContext); individualLink->initIndividualLinkEdge(indiSource,indiSource,indiDestination,role,depTrackPoint); //indiSource->installIndividualLink(individualLink); installIndividualNodeRoleLink(indiSource,indiDestination,individualLink,calcAlgContext); } else { generatedInvLink = true; createIndividualNodeDisjointRolesLinks(indiDestination,indiSource,role->getDisjointRoleList(),depTrackPoint,calcAlgContext); individualLink->initIndividualLinkEdge(indiSource,indiDestination,indiSource,role,depTrackPoint); //indiDestination->installIndividualLink(individualLink); installIndividualNodeRoleLink(indiDestination,indiSource,individualLink,calcAlgContext); } if (ancRole == role) { ancRoleLink = individualLink; } roleLinkerIt = roleLinkerIt->getNext(); } if (generatedInvLink || indiDestination->isNominalIndividual()) { indiSource->getConnectionSuccessorSet(true)->insertConnectionSuccessor(indiDestination->getIndividualID()); } indiDestination->getConnectionSuccessorSet(true)->insertConnectionSuccessor(indiSource->getIndividualID()); if (mOptIncrementalCompatibleExpansion) { linkCreationDirectlyChangedNeighbourConnectionUpdate(indiDestination,indiSource,true,calcAlgContext); } return ancRoleLink; } void CCalculationTableauCompletionTaskHandleAlgorithm::installIndividualNodeRoleLink(CIndividualProcessNode*& sourceIndi, CIndividualProcessNode*& destinationIndi, CIndividualLinkEdge* individualLink, CCalculationAlgorithmContextBase* calcAlgContext) { CNegationDisjointEdge* negDisEdge = nullptr; CDisjointSuccessorRoleHash* disSuccRoleHash = sourceIndi->getDisjointSuccessorRoleHash(false); if (disSuccRoleHash) { negDisEdge = disSuccRoleHash->getDisjointSuccessorRoleLink(destinationIndi->getIndividualID(),individualLink->getLinkRole()); if (negDisEdge) { CClashedDependencyDescriptor* clashDes = nullptr; clashDes = createClashedIndividualLinkDescriptor(clashDes,individualLink,individualLink->getDependencyTrackPoint(),calcAlgContext); clashDes = createClashedNegationDisjointDescriptor(clashDes,negDisEdge,negDisEdge->getDependencyTrackPoint(),calcAlgContext); throw CCalculationClashProcessingException(clashDes); } } sourceIndi->installIndividualLink(individualLink); } CReapplyQueueIterator CCalculationTableauCompletionTaskHandleAlgorithm::installIndividualNodeRoleLinkReapplied(CIndividualProcessNode*& sourceIndi, CIndividualProcessNode*& destinationIndi, CIndividualLinkEdge* individualLink, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyQueueIterator reapplyIterator; CNegationDisjointEdge* negDisEdge = nullptr; CDisjointSuccessorRoleHash* disSuccRoleHash = sourceIndi->getDisjointSuccessorRoleHash(false); if (disSuccRoleHash) { negDisEdge = disSuccRoleHash->getDisjointSuccessorRoleLink(destinationIndi->getIndividualID(),individualLink->getLinkRole()); if (negDisEdge) { CClashedDependencyDescriptor* clashDes = nullptr; clashDes = createClashedIndividualLinkDescriptor(clashDes,individualLink,individualLink->getDependencyTrackPoint(),calcAlgContext); clashDes = createClashedNegationDisjointDescriptor(clashDes,negDisEdge,negDisEdge->getDependencyTrackPoint(),calcAlgContext); throw CCalculationClashProcessingException(clashDes); } } sourceIndi->installIndividualLink(individualLink,&reapplyIterator); return reapplyIterator; } CIndividualLinkEdge* CCalculationTableauCompletionTaskHandleAlgorithm::createNewIndividualsLinksReapplyed(CIndividualProcessNode*& indiSource, CIndividualProcessNode*& indiDestination, CSortedNegLinker* roleLinkerIt, CRole* ancRole, CDependencyTrackPoint* depTrackPoint, bool checkRoleExisting, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualLinkEdge* ancRoleLink = nullptr; CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); bool generatedInvLink = false; while (roleLinkerIt) { CRole* role = roleLinkerIt->getData(); bool invRole = roleLinkerIt->isNegated(); CSortedNegLinker *rangeConLinkerIt = role->getRangeConceptList(); STATINC(LINKSCREATIONCOUNT,calcAlgContext); CIndividualLinkEdge* individualLink = CObjectParameterizingAllocator< CIndividualLinkEdge,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,calcAlgContext->getUsedProcessContext()); if (!invRole) { if (!checkRoleExisting || !hasIndividualsLink(indiSource,indiDestination,role,true,calcAlgContext)) { createIndividualNodeDisjointRolesLinks(indiSource,indiDestination,role->getDisjointRoleList(),depTrackPoint,calcAlgContext); individualLink->initIndividualLinkEdge(indiSource,indiSource,indiDestination,role,depTrackPoint); CReapplyQueueIterator reapplyIterator; //indiSource->installIndividualLink(individualLink,&reapplyIterator); reapplyIterator = installIndividualNodeRoleLinkReapplied(indiSource,indiDestination,individualLink,calcAlgContext); if (rangeConLinkerIt) { addConceptsToIndividual(rangeConLinkerIt,false,indiDestination,depTrackPoint,true,false,nullptr,calcAlgContext); } CSortedNegLinker *domainConLinkerIt = role->getDomainConceptList(); if (domainConLinkerIt) { addConceptsToIndividual(domainConLinkerIt,false,indiSource,depTrackPoint,true,false,nullptr,calcAlgContext); } applyReapplyQueueConceptsRestricted(indiSource,&reapplyIterator,individualLink,calcAlgContext); } } else { if (!checkRoleExisting || !hasIndividualsLink(indiDestination,indiSource,role,true,calcAlgContext)) { generatedInvLink = true; createIndividualNodeDisjointRolesLinks(indiDestination,indiSource,role->getDisjointRoleList(),depTrackPoint,calcAlgContext); individualLink->initIndividualLinkEdge(indiSource,indiDestination,indiSource,role,depTrackPoint); //indiDestination->installIndividualLink(individualLink); CReapplyQueueIterator reapplyIterator; reapplyIterator = installIndividualNodeRoleLinkReapplied(indiDestination,indiSource,individualLink,calcAlgContext); if (rangeConLinkerIt) { addConceptsToIndividual(rangeConLinkerIt,false,indiSource,depTrackPoint,true,false,nullptr,calcAlgContext); } CSortedNegLinker *domainConLinkerIt = role->getDomainConceptList(); if (domainConLinkerIt) { addConceptsToIndividual(domainConLinkerIt,false,indiDestination,depTrackPoint,true,false,nullptr,calcAlgContext); } applyReapplyQueueConceptsRestricted(indiDestination,&reapplyIterator,individualLink,calcAlgContext); } } if (ancRole == role) { ancRoleLink = individualLink; } roleLinkerIt = roleLinkerIt->getNext(); } if (generatedInvLink || indiDestination->isNominalIndividual()) { indiSource->getConnectionSuccessorSet(true)->insertConnectionSuccessor(indiDestination->getIndividualID()); } indiDestination->getConnectionSuccessorSet(true)->insertConnectionSuccessor(indiSource->getIndividualID()); if (mOptIncrementalCompatibleExpansion) { linkCreationDirectlyChangedNeighbourConnectionUpdate(indiDestination,indiSource,true,calcAlgContext); } return ancRoleLink; } CIndividualLinkEdge* CCalculationTableauCompletionTaskHandleAlgorithm::createNewIndividualsLink(CIndividualProcessNode*& indiCreator, CIndividualProcessNode*& indiSource, CIndividualProcessNode*& indiDestination, CRole* role, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); STATINC(LINKSCREATIONCOUNT,calcAlgContext); createIndividualNodeDisjointRolesLinks(indiSource,indiDestination,role->getDisjointRoleList(),depTrackPoint,calcAlgContext); CIndividualLinkEdge* individualLink = CObjectParameterizingAllocator< CIndividualLinkEdge,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,calcAlgContext->getUsedProcessContext()); individualLink->initIndividualLinkEdge(indiCreator,indiSource,indiDestination,role,depTrackPoint); //indiSource->installIndividualLink(individualLink); installIndividualNodeRoleLink(indiSource,indiDestination,individualLink,calcAlgContext); indiDestination->getConnectionSuccessorSet(true)->insertConnectionSuccessor(indiSource->getIndividualID()); if (mOptIncrementalCompatibleExpansion) { linkCreationDirectlyChangedNeighbourConnectionUpdate(indiDestination,indiSource,true,calcAlgContext); } return individualLink; } CIndividualLinkEdge* CCalculationTableauCompletionTaskHandleAlgorithm::createNewIndividualsLinkReapplyed(CIndividualProcessNode*& indiCreator, CIndividualProcessNode*& indiSource, CIndividualProcessNode*& indiDestination, CRole* role, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); createIndividualNodeDisjointRolesLinks(indiSource,indiDestination,role->getDisjointRoleList(),depTrackPoint,calcAlgContext); CReapplyQueueIterator reapplyIterator; STATINC(LINKSCREATIONCOUNT,calcAlgContext); CIndividualLinkEdge* individualLink = CObjectParameterizingAllocator< CIndividualLinkEdge,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,calcAlgContext->getUsedProcessContext()); individualLink->initIndividualLinkEdge(indiCreator,indiSource,indiDestination,role,depTrackPoint); //indiSource->installIndividualLink(individualLink,&reapplyIterator); reapplyIterator = installIndividualNodeRoleLinkReapplied(indiSource,indiDestination,individualLink,calcAlgContext); CSortedNegLinker *rangeConLinkerIt = role->getRangeConceptList(); if (rangeConLinkerIt) { // no preprocessing, because of possible not intercepted clashes while merging addConceptsToIndividual(rangeConLinkerIt,false,indiDestination,depTrackPoint,false,false,nullptr,calcAlgContext); } CSortedNegLinker *domainConLinkerIt = role->getDomainConceptList(); if (domainConLinkerIt) { // no preprocessing, because of possible not intercepted clashes while merging addConceptsToIndividual(domainConLinkerIt,false,indiSource,depTrackPoint,false,false,nullptr,calcAlgContext); } applyReapplyQueueConceptsRestricted(indiSource,&reapplyIterator,individualLink,calcAlgContext); indiDestination->getConnectionSuccessorSet(true)->insertConnectionSuccessor(indiSource->getIndividualID()); if (mOptIncrementalCompatibleExpansion) { linkCreationDirectlyChangedNeighbourConnectionUpdate(indiDestination,indiSource,true,calcAlgContext); } return individualLink; } void CCalculationTableauCompletionTaskHandleAlgorithm::createIndividualsDistinct(CIndividualProcessNode*& indiSource, CIndividualProcessNode*& indiDestination, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(DISTINCTCREATIONCOUNT,calcAlgContext); CDistinctEdge* disEdge = CObjectParameterizingAllocator< CDistinctEdge,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); disEdge->initDistinctEdge(indiSource,indiDestination,depTrackPoint); indiSource->getDistinctHash(true)->insertDistinctIndividual(indiDestination->getIndividualID(),disEdge); indiDestination->getDistinctHash(true)->insertDistinctIndividual(indiSource->getIndividualID(),disEdge); } void CCalculationTableauCompletionTaskHandleAlgorithm::createIndividualsDistinct(CPROCESSINGLIST& indiList, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { for (CPROCESSINGLIST::const_iterator it = indiList.constBegin(), itEnd = indiList.constEnd(); it != itEnd; ++it) { CIndividualProcessNode* indi1 = *it; CDistinctHash* disHash1 = indi1->getDistinctHash(true); CPROCESSINGLIST::const_iterator it2 = it; for (++it2; it2 != itEnd; ++it2) { CIndividualProcessNode* indi2 = *it2; CDistinctHash* disHash2 = indi2->getDistinctHash(true); STATINC(DISTINCTCREATIONCOUNT,calcAlgContext); CDistinctEdge* disEdge = CObjectParameterizingAllocator< CDistinctEdge,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); disEdge->initDistinctEdge(indi1,indi2,depTrackPoint); disHash1->insertDistinctIndividual(indi2->getIndividualID(),disEdge); disHash2->insertDistinctIndividual(indi1->getIndividualID(),disEdge); } } } bool CCalculationTableauCompletionTaskHandleAlgorithm::hasIndividualsLink(CIndividualProcessNode*& indiSource, CIndividualProcessNode*& indiDestination, CRole* role, bool locateable, CCalculationAlgorithmContextBase* calcAlgContext) { return indiSource->hasRoleSuccessorToIndividual(role,indiDestination,locateable); } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::createNewEmptyIndividual(CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; STATINC(SUCCESSORINDINODECREATIONCOUNT,calcAlgContext); taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CIndividualProcessNodeVector* indiProcNodeVec = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); CIndividualProcessNode* newIndividual = CObjectParameterizingAllocator< CIndividualProcessNode,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,calcAlgContext->getUsedProcessContext()); cint64 newIndividualID = calcAlgContext->getProcessingDataBox()->getNextIndividualNodeID(); newIndividualID = qMax(indiProcNodeVec->getItemCount(),newIndividualID); newIndividual->setIndividualID(newIndividualID); indiProcNodeVec->setLocalData(newIndividualID,newIndividual); if (mOptConsistenceNodeMarking) { newIndividual->addProcessingRestrictionFlags(CIndividualProcessNode::PRFCONSNODEPREPARATIONINDINODE); } if (mOptIncrementalCompatibleExpansion) { newIndividual->addProcessingRestrictionFlags(CIndividualProcessNode::PRFINCREMENTALEXPANDING); newIndividual->setIncrementalExpansionID(calcAlgContext->getProcessingDataBox()->getIncrementalExpansionID()); } return newIndividual; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::createNewIndividual(CDependencyTrackPoint* depTrackPoint, bool dataNode, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* newIndividual = createNewEmptyIndividual(calcAlgContext); newIndividual->initDependencyTracker(depTrackPoint); if (!dataNode) { CConcept* topConcept = calcAlgContext->getProcessingDataBox()->getOntologyTopConcept(); addConceptToIndividual(topConcept,false,newIndividual,depTrackPoint,true,false,calcAlgContext); } else { newIndividual->setExtendedQueueProcessing(true); CConcept* topDataRangeConcept = calcAlgContext->getProcessingDataBox()->getOntologyTopDataRangeConcept(); addConceptToIndividual(topDataRangeConcept,false,newIndividual,depTrackPoint,true,false,calcAlgContext); newIndividual->addProcessingRestrictionFlags(CIndividualProcessNode::PRFCONCRETEDATAINDINODE); } return newIndividual; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getAvailableUpToDateIndividual(cint64 indiID, CCalculationAlgorithmContextBase* calcAlgContext) { if (isNominalIndividualNodeAvailable(indiID,calcAlgContext)) { return getUpToDateIndividual(indiID,calcAlgContext); } return nullptr; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getUpToDateIndividual(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext) { if (!indi->isLocalizationTagUpToDate(calcAlgContext->getUsedProcessTagger()->getCurrentLocalizationTag()) && indi->isRelocalized()) { STATINC(INDINODEUPDATELOADCOUNT,calcAlgContext); CIndividualProcessNodeVector* indiProcNodeVec = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); CIndividualProcessNode* upToDateIndi = indiProcNodeVec->getData(indi->getIndividualID()); return upToDateIndi; } return indi; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getUpToDateIndividual(cint64 indiID, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(INDINODEUPDATELOADCOUNT,calcAlgContext); CIndividualProcessNodeVector* indiProcNodeVec = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); CIndividualProcessNode* upToDateIndi = indiProcNodeVec->getData(indiID); if (!upToDateIndi) { CIndividualVector* indiVec = calcAlgContext->getProcessingDataBox()->getOntology()->getABox()->getIndividualVector(false); if (indiVec) { if (indiID < indiVec->getItemCount()) { CIndividual* individual = indiVec->getData(indiID); if (individual) { trackIndividualReferredDependence(indiID,calcAlgContext); STATINC(INDINODELOCALIZEDLOADCOUNT,calcAlgContext); CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CIndividualProcessNodeVector* indiProcNodeVec = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); CIndividualProcessNode* localicedIndi = CObjectParameterizingAllocator< CIndividualProcessNode,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,calcAlgContext->getUsedProcessContext()); CDependencyTrackPoint* depTrackPoint = calcAlgContext->getBaseDependencyNode()->getContinueDependencyTrackPoint(); localicedIndi->initDependencyTracker(depTrackPoint); localicedIndi->setNominalIndividual(individual); localicedIndi->setIndividualType(CIndividualProcessNode::NOMINALINDIVIDUALTYPE); localicedIndi->setIndividualID(indiID); indiProcNodeVec->setLocalData(localicedIndi->getIndividualID(),localicedIndi); localicedIndi->setAssertionRoleLinker(individual->getAssertionRoleLinker()); localicedIndi->setReverseAssertionRoleLinker(individual->getReverseAssertionRoleLinker()); localicedIndi->setRoleAssertionCreationID(calcAlgContext->getUsedProcessingDataBox()->getNextRoleAssertionCreationID()); CConcept* univConnNomValueConcept = calcAlgContext->getProcessingDataBox()->getOntology()->getTBox()->getUniversalConnectionNominalValueConcept(); if (univConnNomValueConcept) { addConceptToIndividual(univConnNomValueConcept,false,localicedIndi,depTrackPoint,true,true,calcAlgContext); } CConcept* nominalConcept = individual->getIndividualNominalConcept(); if (nominalConcept) { addConceptToIndividual(nominalConcept,false,localicedIndi,depTrackPoint,true,true,calcAlgContext); } if (mOptConsistenceNodeMarking) { localicedIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFCONSNODEPREPARATIONINDINODE); } if (!mOptIncrementalCompatibleExpansion) { bool expansionBlocked = false; if (loadIndividualNodeDataFromBackendCache(localicedIndi,calcAlgContext)) { expansionBlocked = tryEstablishExpansionBlockingWithBackendCacheSynchronisation(localicedIndi,calcAlgContext); } if (!expansionBlocked) { addIndividualToProcessingQueue(localicedIndi,calcAlgContext); } } else { localicedIndi->setAssertionConceptLinker(individual->getAssertionConceptLinker()); localicedIndi->setIncrementalExpansionID(calcAlgContext->getProcessingDataBox()->getIncrementalExpansionID()); localicedIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFINCREMENTALEXPANDING); CIndividualNodeIncrementalExpansionData* expData = localicedIndi->getIncrementalExpansionData(true); expData->setExpansionID(calcAlgContext->getProcessingDataBox()->getNextIncrementalIndividualExpansionID(true)); } upToDateIndi = localicedIndi; } } } } return upToDateIndi; } bool CCalculationTableauCompletionTaskHandleAlgorithm::tryEstablishExpansionBlockingWithBackendCacheSynchronisation(CIndividualProcessNode* indiNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool expansionBlocked = false; CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* backendSyncData = (CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData*)indiNode->getIndividualBackendCacheSynchronisationData(false); if (backendSyncData) { CBackendRepresentativeMemoryCacheIndividualAssociationData* assocData = backendSyncData->getAssocitaionData(); bool backendExpBlocking = assocData->isCompletelyHandled() && assocData->isCompletelySaturated(); if (backendExpBlocking && testIndividualNodeBackendCacheSynchronization(indiNode,calcAlgContext)) { indiNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKEND | CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDSUCCESSOREXPANSIONBLOCKED); if (indiNode->getAssertionRoleLinker() || indiNode->getReverseAssertionRoleLinker()) { indiNode->addProcessingRestrictionFlags(CIndividualProcessNode::PRFSYNCHRONIZEDBACKENDNEIGHBOUREXPANSIONBLOCKED); } expansionBlocked = true; } } return expansionBlocked; } bool CCalculationTableauCompletionTaskHandleAlgorithm::loadIndividualNodeDataFromBackendCache(CIndividualProcessNode* indiNode, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividual* individual = indiNode->getNominalIndividual(); if (mConfIndividualsBackendCacheLoading && mBackendCacheHandler) { CBackendRepresentativeMemoryCacheIndividualAssociationData* indiAssData = mBackendCacheHandler->getIndividualAssociationData(individual); if (indiAssData) { CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* backendSyncData = CObjectAllocator< CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); backendSyncData->initSynchronisationData(indiAssData); indiNode->setIndividualBackendCacheSynchronisationData(backendSyncData); CDependencyTrackPoint* depTrackPoint = calcAlgContext->getBaseDependencyNode()->getContinueDependencyTrackPoint(); CBackendRepresentativeMemoryLabelCacheItem* labelCacheItem = indiAssData->getBackendLabelCacheEntry(); for (CBackendRepresentativeMemoryLabelValueLinker* labelValueLinker = labelCacheItem->getDeterministicCacheValueLinker(); labelValueLinker; labelValueLinker = labelValueLinker->getNext()) { const CCacheValue& cacheValue = labelValueLinker->getCacheValue(); CConcept* concept = (CConcept*)cacheValue.getIdentification(); bool conNegation = cacheValue.getCacheValueIdentifier() == CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; addConceptToIndividualSkipANDProcessing(concept,conNegation,indiNode,depTrackPoint,true,false,calcAlgContext); validateBackendSynchronisationContinued(indiNode,backendSyncData,concept,conNegation,calcAlgContext); } for (CConceptAssertionLinker* conAssLinkerIt = individual->getAssertionConceptLinker(); conAssLinkerIt; conAssLinkerIt = conAssLinkerIt->getNext()) { CConcept* concept = conAssLinkerIt->getData(); bool negation = conAssLinkerIt->isNegated(); if (concept->getOperatorCode() == CCNOMINAL && (concept->getNominalIndividual() == individual || negation)) { addConceptToIndividual(concept,negation,indiNode,depTrackPoint,true,false,calcAlgContext); } } return true; } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::testIndividualNodeBackendCacheExpansionBlockingCriticalCardinality(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext) { bool expansionBlockingCritical = true; CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* backendSyncData = (CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData*)indi->getIndividualBackendCacheSynchronisationData(false); CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* locBackendSyncData = (CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData*)indi->getIndividualBackendCacheSynchronisationData(true); if (backendSyncData) { if (!backendSyncData->isCriticalCardinalityExpansionBlocking()) { CBackendRepresentativeMemoryCacheIndividualAssociationData* assocData = backendSyncData->getAssocitaionData(); expansionBlockingCritical = false; CBackendRepresentativeMemoryCardinalityCacheItem* cardCacheItem = assocData->getBackendCardinalityCacheEntry(); if (cardCacheItem) { CReapplyRoleSuccessorHash* roleSuccHash = indi->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { CIndividualLinkEdge* lastAddedLinkEdge = indi->getLastAddedRoleLink(); CIndividualLinkEdge* lastTestedLinkEdge = backendSyncData->getLastCriticalCardinalityLinkEdge(); if (lastTestedLinkEdge != lastAddedLinkEdge) { for (CBackendRepresentativeMemoryCardinalityValueLinker* cardValueLinkerIt = cardCacheItem->getCardinalityCacheValueLinker(); cardValueLinkerIt && !expansionBlockingCritical; cardValueLinkerIt = cardValueLinkerIt->getNext()) { CRole* role = (CRole*)cardValueLinkerIt->getCacheValue().getIdentification(); cint64 freeCardinality = cardValueLinkerIt->getFreeCardinality(); cint64 linkCount = roleSuccHash->getRoleSuccessorCount(role); if (linkCount > freeCardinality) { cint64 nonAssertionLinkCount = 0; CRoleSuccessorLinkIterator roleSuccIt(roleSuccHash->getRoleSuccessorLinkIterator(role)); while (roleSuccIt.hasNext() && nonAssertionLinkCount <= freeCardinality) { CIndividualLinkEdge* link = roleSuccIt.next(); CDependencyTrackPoint* linkDepTrackPoint = link->getDependencyTrackPoint(); if (!linkDepTrackPoint || linkDepTrackPoint->getDependencyNode()->getDependencyType() != CDependencyNode::DNTROLEASSERTIONDEPENDENCY) { ++nonAssertionLinkCount; } } if (nonAssertionLinkCount > freeCardinality) { expansionBlockingCritical = true; } } } if (!locBackendSyncData) { locBackendSyncData = CObjectAllocator< CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); locBackendSyncData->initSynchronisationData(backendSyncData); indi->setIndividualBackendCacheSynchronisationData(locBackendSyncData); } locBackendSyncData->setLastCriticalCardinalityLinkEdge(lastAddedLinkEdge); locBackendSyncData->setCriticalCardinalityExpansionBlocking(expansionBlockingCritical); } } } } } return expansionBlockingCritical; } bool CCalculationTableauCompletionTaskHandleAlgorithm::testIndividualNodeBackendCacheNeighbourExpansionBlockingCritical(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext) { bool expansionBlockingCritical = true; CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* backendSyncData = (CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData*)indi->getIndividualBackendCacheSynchronisationData(false); CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* locBackendSyncData = (CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData*)indi->getIndividualBackendCacheSynchronisationData(true); if (backendSyncData) { if (!backendSyncData->isCriticalNeighbourExpansionBlocking()) { CBackendRepresentativeMemoryCacheIndividualAssociationData* assocData = backendSyncData->getAssocitaionData(); if (backendSyncData->isBackendCacheSynchron()) { expansionBlockingCritical = false; } else { CConceptDescriptor* lastTestedConDes = backendSyncData->getLastCriticalNeighbourExpansionTestedConceptDescriptor(); CConceptDescriptor* lastSynchedConDes = backendSyncData->getLastSynchronizationTestedConceptDescriptor(); CReapplyConceptLabelSet* conSet = indi->getReapplyConceptLabelSet(false); if (conSet) { CConceptDescriptor* conDesLinker = conSet->getAddingSortedConceptDescriptionLinker(); if (conDesLinker != lastTestedConDes) { CConceptDescriptor* conDesIt = conDesLinker; expansionBlockingCritical = false; while (conDesIt != lastTestedConDes && !expansionBlockingCritical) { CConcept* concept = conDesIt->getConcept(); bool conNegation = conDesIt->getNegation(); CConceptOperator* conOperator = concept->getConceptOperator(); if (!conNegation && conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQAND_AQALL_TYPE | CConceptOperator::CCFS_ALL_AQALL_TYPE | CConceptOperator::CCFS_PROPAGATION_ALL_TYPE | CConceptOperator::CCF_ATMOST) || conNegation && conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_SOME_TYPE | CConceptOperator::CCF_VALUE | CConceptOperator::CCF_ATLEAST)) { if (!mBackendCacheHandler || !mBackendCacheHandler->hasConceptIndividualAssociation(assocData,conDesIt->getConcept(),conDesIt->isNegated(),calcAlgContext)) { expansionBlockingCritical = true; } } conDesIt = conDesIt->getNext(); } if (!locBackendSyncData) { locBackendSyncData = CObjectAllocator< CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); locBackendSyncData->initSynchronisationData(backendSyncData); indi->setIndividualBackendCacheSynchronisationData(locBackendSyncData); } locBackendSyncData->setLastCriticalNeighbourExpansionTestedConceptDescriptor(conDesLinker); locBackendSyncData->setCriticalNeighbourExpansionBlocking(expansionBlockingCritical); } } } } } return expansionBlockingCritical; } bool CCalculationTableauCompletionTaskHandleAlgorithm::testIndividualNodeBackendCacheSynchronization(CIndividualProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext) { bool backendSynched = true; CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* backendSyncData = (CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData*)indi->getIndividualBackendCacheSynchronisationData(false); CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* locBackendSyncData = (CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData*)indi->getIndividualBackendCacheSynchronisationData(true); if (backendSyncData && backendSyncData->isBackendCacheSynchron()) { CConceptDescriptor* lastTestedConDes = backendSyncData->getLastSynchronizationTestedConceptDescriptor(); CReapplyConceptLabelSet* conSet = indi->getReapplyConceptLabelSet(false); if (conSet) { CConceptDescriptor* conDesLinker = conSet->getAddingSortedConceptDescriptionLinker(); if (conDesLinker != lastTestedConDes) { CConceptDescriptor* conDesIt = conDesLinker; CConceptDescriptor* lastSyncConDes = nullptr; CBackendRepresentativeMemoryCacheIndividualAssociationData* assocData = backendSyncData->getAssocitaionData(); CConcept* nominalConcept = indi->getNominalIndividual()->getIndividualNominalConcept(); while (conDesIt != lastTestedConDes && backendSynched) { if (conDesIt->getConcept() != nominalConcept || conDesIt->isNegated()) { if (!mBackendCacheHandler || !mBackendCacheHandler->hasConceptIndividualAssociation(assocData,conDesIt->getConcept(),conDesIt->isNegated(),calcAlgContext)) { backendSynched = false; } } lastSyncConDes = conDesIt; conDesIt = conDesIt->getNext(); } if (!locBackendSyncData) { locBackendSyncData = CObjectAllocator< CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); locBackendSyncData->initSynchronisationData(backendSyncData); indi->setIndividualBackendCacheSynchronisationData(locBackendSyncData); } locBackendSyncData->setLastSynchronizationTestedConceptDescriptor(conDesLinker); locBackendSyncData->setLastSynchedConceptDescriptor(lastSyncConDes); locBackendSyncData->setBackendCacheSynchron(backendSynched); } } else { backendSynched = false; } } else { backendSynched = false; } return backendSynched; } bool CCalculationTableauCompletionTaskHandleAlgorithm::validateBackendSynchronisationContinued(CIndividualProcessNode* indi, CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData* backendSyncData, CConcept* addedConcept, bool addedConceptNegation, CCalculationAlgorithmContextBase* calcAlgContext) { bool backendSynched = true; if (backendSyncData && backendSyncData->isBackendCacheSynchron()) { CConceptDescriptor* lastTestedConDes = backendSyncData->getLastSynchronizationTestedConceptDescriptor(); CReapplyConceptLabelSet* conSet = indi->getReapplyConceptLabelSet(false); if (conSet) { CConceptDescriptor* conDesLinker = conSet->getAddingSortedConceptDescriptionLinker(); CConceptDescriptor* conDesIt = conDesLinker; CBackendRepresentativeMemoryCacheIndividualAssociationData* assocData = backendSyncData->getAssocitaionData(); if (addedConcept && conDesIt != lastTestedConDes) { if (conDesIt->getConcept() == addedConcept || conDesIt->isNegated() == addedConceptNegation) { conDesIt = conDesIt->getNext(); } } CConcept* nominalConcept = indi->getNominalIndividual()->getIndividualNominalConcept(); while (conDesIt != lastTestedConDes && backendSynched) { if (conDesIt->getConcept() != nominalConcept || conDesIt->isNegated()) { if (!mBackendCacheHandler || !mBackendCacheHandler->hasConceptIndividualAssociation(assocData,conDesIt->getConcept(),conDesIt->isNegated(),calcAlgContext)) { backendSynched = false; } } if (backendSynched) { backendSyncData->setLastSynchedConceptDescriptor(conDesIt); } conDesIt = conDesIt->getNext(); } backendSyncData->setLastSynchronizationTestedConceptDescriptor(conDesLinker); } else { backendSynched = false; } backendSyncData->setBackendCacheSynchron(backendSynched); } else { backendSynched = false; } return backendSynched; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getLocalizedIndividual(cint64 indiID, CCalculationAlgorithmContextBase* calcAlgContext) { return getLocalizedIndividual(getUpToDateIndividual(indiID,calcAlgContext),false,calcAlgContext); } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getLocalizedIndividual(CIndividualProcessNode* indi, bool updateIndividual, CCalculationAlgorithmContextBase* calcAlgContext) { if (!indi->isLocalizationTagUpToDate(calcAlgContext->getUsedProcessTagger()->getCurrentLocalizationTag())) { if (updateIndividual) { indi = getUpToDateIndividual(indi,calcAlgContext); } if (!indi->isLocalizationTagUpToDate(calcAlgContext->getUsedProcessTagger()->getCurrentLocalizationTag())) { STATINC(INDINODELOCALIZEDLOADCOUNT,calcAlgContext); CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CIndividualProcessNodeVector* indiProcNodeVec = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); CIndividualProcessNode* localicedIndi = CObjectParameterizingAllocator< CIndividualProcessNode,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,calcAlgContext->getUsedProcessContext()); localicedIndi->initIndividualProcessNode(indi); indiProcNodeVec->setLocalData(localicedIndi->getIndividualID(),localicedIndi); if (calcAlgContext->hasCompletionGraphCachedIndividualNodes() && mConfCompletionGraphCaching) { if (localicedIndi->getIndividualID() <= calcAlgContext->getMaxCompletionGraphCachedIndividualNodeID()) { if (indi->getLocalizationTag() <= calcAlgContext->getCompletionGraphCachedLocalizationTag()) { trackIndividualReferredDependence(indi->getIndividualID(),calcAlgContext); localicedIndi->clearProcessingQueued(); localicedIndi->clearProcessingRestrictionFlags(CIndividualProcessNode::PRFCACHEDCOMPUTEDTYPESADDED); localicedIndi->addProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED); } } } return localicedIndi; } } return indi; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getSuccessorIndividual(CIndividualProcessNode*& indi, CIndividualLinkEdge* link, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* succIndi = nullptr; if (link->isLocalizationTagUpToDate(calcAlgContext->getUsedProcessTagger()->getCurrentLocalizationTag())) { succIndi = link->getOppositeIndividual(indi); } else { STATINC(INDINODEUPDATELOADCOUNT,calcAlgContext); succIndi = link->getOppositeIndividual(indi); if (!succIndi->isLocalizationTagUpToDate(calcAlgContext->getUsedProcessTagger()->getCurrentLocalizationTag()) && succIndi->isRelocalized()) { cint64 succIndiId = link->getOppositeIndividualID(indi); CIndividualProcessNodeVector* indiProcNodeVec = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); succIndi = indiProcNodeVec->getData(succIndiId); } } return succIndi; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getLocalizedSuccessorIndividual(CIndividualProcessNode*& indi, CIndividualLinkEdge* link, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* succIndi = nullptr; if (link->isLocalizationTagUpToDate(calcAlgContext->getUsedProcessTagger()->getCurrentLocalizationTag())) { succIndi = link->getOppositeIndividual(indi); } else { STATINC(INDINODEUPDATELOADCOUNT,calcAlgContext); cint64 succIndiId = link->getOppositeIndividualID(indi); CIndividualProcessNodeVector* indiProcNodeVec = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); succIndi = indiProcNodeVec->getData(succIndiId); succIndi = getLocalizedIndividual(succIndi,false,calcAlgContext); } return succIndi; } CIndividualProcessNode* CCalculationTableauCompletionTaskHandleAlgorithm::getAncestorIndividual(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* ancIndi = nullptr; CIndividualLinkEdge* ancLink = indi->getAncestorLink(); if (ancLink) { ancIndi = getSuccessorIndividual(indi,ancLink,calcAlgContext); } return ancIndi; } void CCalculationTableauCompletionTaskHandleAlgorithm::applyReapplyQueueConcepts(CIndividualProcessNode*& processIndi, CConcept* concept, bool negation, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CCondensedReapplyQueueIterator reapplyQueueIt = processIndi->getConceptReapplyIterator(concept,negation,true); CConceptProcessingQueue* conProQueue = nullptr; CProcessingRestrictionSpecification* procRest = nullptr; while (reapplyQueueIt.hasNext()) { STATINC(REAPPLIEDCONCEPTSCOUNT,calcAlgContext); CReapplyConceptDescriptor* reapplyConceptDes = reapplyQueueIt.next(); CConceptDescriptor* conDes = reapplyConceptDes->getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint = reapplyConceptDes->getDependencyTrackPoint(); procRest = reapplyConceptDes->getReapplyProcessingRestriction(); if (!conProQueue) { conProQueue = processIndi->getConceptProcessingQueue(true); } addConceptRestrictedToProcessingQueue(conDes,depTrackPoint,conProQueue,processIndi,reapplyConceptDes->isStaticDescriptor(),procRest,calcAlgContext); } if (conProQueue) { addIndividualToProcessingQueue(processIndi,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyReapplyQueueConcepts(CIndividualProcessNode*& processIndi, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CReapplyQueueIterator reapplyQueueIt = processIndi->getRoleReapplyIterator(role,true); CConceptProcessingQueue* conProQueue = nullptr; CProcessingRestrictionSpecification* procRest = nullptr; while (reapplyQueueIt.hasNext()) { STATINC(REAPPLIEDCONCEPTSCOUNT,calcAlgContext); CReapplyConceptDescriptor* reapplyConceptDes = reapplyQueueIt.next(); CConceptDescriptor* conDes = reapplyConceptDes->getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint = reapplyConceptDes->getDependencyTrackPoint(); procRest = reapplyConceptDes->getReapplyProcessingRestriction(); if (!conProQueue) { conProQueue = processIndi->getConceptProcessingQueue(true); } addConceptRestrictedToProcessingQueue(conDes,depTrackPoint,conProQueue,processIndi,reapplyConceptDes->isStaticDescriptor(),procRest,calcAlgContext); } if (conProQueue) { addIndividualToProcessingQueue(processIndi,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyReapplyQueueConceptsRestricted(CIndividualProcessNode*& processIndi, CReapplyQueueIterator* reapplyQueueIt, CIndividualLinkEdge* restrictedLink, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CConceptProcessingQueue* conProQueue = nullptr; CLinkProcessingRestrictionSpecification* linkProcRest = nullptr; CProcessingRestrictionSpecification* procRest = nullptr; while (reapplyQueueIt->hasNext()) { STATINC(REAPPLIEDCONCEPTSCOUNT,calcAlgContext); CReapplyConceptDescriptor* reapplyConceptDes = reapplyQueueIt->next(); CConceptDescriptor* conDes = reapplyConceptDes->getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint = reapplyConceptDes->getDependencyTrackPoint(); procRest = reapplyConceptDes->getReapplyProcessingRestriction(); if (!conProQueue) { conProQueue = processIndi->getConceptProcessingQueue(true); } if (!procRest) { if (!linkProcRest) { linkProcRest = CObjectAllocator< CLinkProcessingRestrictionSpecification >::allocateAndConstruct(taskMemMan); linkProcRest->initLinkRestriction(restrictedLink); } procRest = linkProcRest; } addConceptRestrictedToProcessingQueue(conDes,depTrackPoint,conProQueue,processIndi,reapplyConceptDes->isStaticDescriptor(),procRest,calcAlgContext); } if (conProQueue) { addIndividualToProcessingQueue(processIndi,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::applyReapplyQueueConcepts(CIndividualProcessNode*& processIndi, CCondensedReapplyQueueIterator* reapplyQueueIt, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CConceptProcessingQueue* conProQueue = nullptr; CProcessingRestrictionSpecification* procRest = nullptr; while (reapplyQueueIt->hasNext()) { STATINC(REAPPLIEDCONCEPTSCOUNT,calcAlgContext); CReapplyConceptDescriptor* reapplyConceptDes = reapplyQueueIt->next(); CConceptDescriptor* conDes = reapplyConceptDes->getConceptDescriptor(); CDependencyTrackPoint* depTrackPoint = reapplyConceptDes->getDependencyTrackPoint(); procRest = reapplyConceptDes->getReapplyProcessingRestriction(); if (!conProQueue) { conProQueue = processIndi->getConceptProcessingQueue(true); } addConceptRestrictedToProcessingQueue(conDes,depTrackPoint,conProQueue,processIndi,reapplyConceptDes->isStaticDescriptor(),procRest,calcAlgContext); } if (conProQueue) { addIndividualToProcessingQueue(processIndi,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptToReapplyQueue(CConceptDescriptor *conceptDescriptor, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CConcept* concept = conceptDescriptor->getConcept(); CRole* role = concept->getRole(); return addConceptToReapplyQueue(conceptDescriptor,role,processIndi,true,dependencyTrackPoint,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptToReapplyQueue(CConceptDescriptor *conceptDescriptor, CRole* role, CIndividualProcessNode*& processIndi, bool isStaticDes, CDependencyTrackPoint* dependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); STATINC(INSERTCONCEPTREAPPLICATIONSCOUNT,calcAlgContext); CReapplyQueue* reapplyQueue = processIndi->getRoleReapplyQueue(role,true); CReapplyConceptDescriptor* reapplyConDes = CObjectAllocator::allocateAndConstruct(taskMemMan); reapplyConDes->initReapllyDescriptor(conceptDescriptor,dependencyTrackPoint,isStaticDes); reapplyQueue->addReapplyConceptDescriptor(reapplyConDes); } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptToReapplyQueue(CConceptDescriptor *conceptDescriptor, CConcept* concept, bool negation, CIndividualProcessNode*& processIndi, bool isStaticDes, CDependencyTrackPoint* dependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); STATINC(INSERTCONCEPTREAPPLICATIONSCOUNT,calcAlgContext); CCondensedReapplyQueue* reapplyQueue = processIndi->getConceptReapplyQueue(concept,negation,true); CCondensedReapplyConceptDescriptor* reapplyConDes = CObjectAllocator::allocateAndConstruct(taskMemMan); reapplyConDes->initReapllyDescriptor(conceptDescriptor,dependencyTrackPoint,!negation); reapplyQueue->addReapplyConceptDescriptor(reapplyConDes); } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptToReapplyQueue(CConceptDescriptor *conceptDescriptor, CRole* role, CIndividualProcessNode*& processIndi, CProcessingRestrictionSpecification* procRest, CDependencyTrackPoint* dependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); STATINC(INSERTCONCEPTREAPPLICATIONSCOUNT,calcAlgContext); CReapplyQueue* reapplyQueue = processIndi->getRoleReapplyQueue(role,true); CReapplyConceptDescriptor* reapplyConDes = CObjectAllocator::allocateAndConstruct(taskMemMan); reapplyConDes->initReapllyDescriptor(conceptDescriptor,dependencyTrackPoint,procRest); reapplyQueue->addReapplyConceptDescriptor(reapplyConDes); } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptToReapplyQueue(CConceptDescriptor *conceptDescriptor, CConcept* concept, bool negation, CIndividualProcessNode*& processIndi, CProcessingRestrictionSpecification* procRest, CDependencyTrackPoint* dependencyTrackPoint, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); STATINC(INSERTCONCEPTREAPPLICATIONSCOUNT,calcAlgContext); CCondensedReapplyQueue* reapplyQueue = processIndi->getConceptReapplyQueue(concept,negation,true); CCondensedReapplyConceptDescriptor* reapplyConDes = CObjectAllocator::allocateAndConstruct(taskMemMan); reapplyConDes->initReapllyDescriptor(conceptDescriptor,dependencyTrackPoint,!negation,procRest); reapplyQueue->addReapplyConceptDescriptor(reapplyConDes); } bool CCalculationTableauCompletionTaskHandleAlgorithm::isConceptInReapplyQueue(CConceptDescriptor* conceptDescriptor, CConcept* concept, bool negation, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CCondensedReapplyQueue* reapplyQueue = processIndi->getConceptReapplyQueue(concept,negation,false); if (reapplyQueue) { return reapplyQueue->hasConceptDescriptor(conceptDescriptor); } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isConceptInReapplyQueue(CConceptDescriptor* conceptDescriptor, CRole* role, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyQueue* reapplyQueue = processIndi->getRoleReapplyQueue(role,false); if (reapplyQueue) { return reapplyQueue->hasConceptDescriptor(conceptDescriptor); } return false; } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptToIndividualSkipANDProcessing(CConcept* addingConcept, bool negate, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, bool allowPreprocessing, bool allowInitalization, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); CReapplyConceptLabelSet* conLabelSet = processIndi->getReapplyConceptLabelSet(true); KONCLUDE_ASSERT_X(dependencyTrackPoint,"adding concept to individual","dependency track point missing"); KONCLUDE_ASSERT_X(addingConcept,"adding concept to individual","concept missing"); CConceptDescriptor* conceptDescriptor = CObjectAllocator::allocateAndConstruct(taskMemMan); conceptDescriptor->initConceptDescriptor(addingConcept,negate,dependencyTrackPoint); CCondensedReapplyQueueIterator reapplyIt; bool contained = insertConceptsToIndividualConceptSet(conceptDescriptor,dependencyTrackPoint,processIndi,conLabelSet,&reapplyIt,allowInitalization,calcAlgContext); if (!contained) { STATINC(CONCEPTSADDEDINDINODELABELSETCOUNT,calcAlgContext); addBlockingCoreConcept(conceptDescriptor,processIndi,conLabelSet,calcAlgContext); setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); addConceptPreprocessedToProcessingQueue(conceptDescriptor,dependencyTrackPoint,conProQueue,processIndi,allowPreprocessing,calcAlgContext,&CCalculationTableauCompletionTaskHandleAlgorithm::applyANDRule); if (reapplyIt.hasNext()) { // reapply reapplying concept applyReapplyQueueConcepts(processIndi,&reapplyIt,calcAlgContext); } } } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptToIndividual(CConcept* addingConcept, bool negate, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, bool allowPreprocessing, bool allowInitalization, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); CReapplyConceptLabelSet* conLabelSet = processIndi->getReapplyConceptLabelSet(true); KONCLUDE_ASSERT_X(dependencyTrackPoint,"adding concept to individual","dependency track point missing"); KONCLUDE_ASSERT_X(addingConcept,"adding concept to individual","concept missing"); CConceptDescriptor* conceptDescriptor = CObjectAllocator::allocateAndConstruct(taskMemMan); conceptDescriptor->initConceptDescriptor(addingConcept,negate,dependencyTrackPoint); CCondensedReapplyQueueIterator reapplyIt; bool contained = insertConceptsToIndividualConceptSet(conceptDescriptor,dependencyTrackPoint,processIndi,conLabelSet,&reapplyIt,allowInitalization,calcAlgContext); if (!contained) { STATINC(CONCEPTSADDEDINDINODELABELSETCOUNT,calcAlgContext); addBlockingCoreConcept(conceptDescriptor,processIndi,conLabelSet,calcAlgContext); setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); addConceptPreprocessedToProcessingQueue(conceptDescriptor,dependencyTrackPoint,conProQueue,processIndi,allowPreprocessing,calcAlgContext); if (reapplyIt.hasNext()) { // reapply reapplying concept applyReapplyQueueConcepts(processIndi,&reapplyIt,calcAlgContext); } } } CConceptDescriptor* CCalculationTableauCompletionTaskHandleAlgorithm::addConceptToIndividualReturnConceptDescriptor(CConcept* addingConcept, bool negate, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, bool allowPreprocessing, bool allowInitalization, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); CReapplyConceptLabelSet* conLabelSet = processIndi->getReapplyConceptLabelSet(true); KONCLUDE_ASSERT_X(dependencyTrackPoint,"adding concept to individual","dependency track point missing"); KONCLUDE_ASSERT_X(addingConcept,"adding concept to individual","concept missing"); CConceptDescriptor* conceptDescriptor = CObjectAllocator::allocateAndConstruct(taskMemMan); conceptDescriptor->initConceptDescriptor(addingConcept,negate,dependencyTrackPoint); CCondensedReapplyQueueIterator reapplyIt; insertConceptsToIndividualConceptSet(conceptDescriptor,dependencyTrackPoint,processIndi,conLabelSet,&reapplyIt,allowInitalization,calcAlgContext); STATINC(CONCEPTSADDEDINDINODELABELSETCOUNT,calcAlgContext); addBlockingCoreConcept(conceptDescriptor,processIndi,conLabelSet,calcAlgContext); setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); addConceptPreprocessedToProcessingQueue(conceptDescriptor,dependencyTrackPoint,conProQueue,processIndi,allowPreprocessing,calcAlgContext); if (reapplyIt.hasNext()) { // reapply reapplying concept applyReapplyQueueConcepts(processIndi,&reapplyIt,calcAlgContext); } return conceptDescriptor; } void CCalculationTableauCompletionTaskHandleAlgorithm::setIndividualNodeAncestorConnectionModified(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { propagateIndividualNodeModified(indi,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::setIndividualNodeConceptLabelSetModified(CIndividualProcessNode*& indi, CCalculationAlgorithmContextBase* calcAlgContext) { CProcessTagger* processTagger = calcAlgContext->getUsedProcessTagger(); processTagger->incConceptLabelSetModificationTag(); indi->getReapplyConceptLabelSet(true)->updateConceptLabelSetModificationTag(processTagger); calcAlgContext->setMinModificationIndividualCandidate(indi); propagateIndividualNodeModified(indi,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::isIndividualNodeConceptLabelSetModified(CIndividualProcessNode*& indi, cint64 modTag, CCalculationAlgorithmContextBase* calcAlgContext) { return indi->getReapplyConceptLabelSet(false)->isConceptLabelSetModificationTagUpToDate(modTag); } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptsToIndividual(CSortedNegLinker* conceptAddLinkerIt, bool negate, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, bool allowPreprocessing, bool allowInitalization, cint64* conceptCount, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); KONCLUDE_ASSERT_X(dependencyTrackPoint,"adding concept to individual","dependency track point missing"); cint64 conCount = 0; CReapplyConceptLabelSet* conLabelSet = processIndi->getReapplyConceptLabelSet(true); while (conceptAddLinkerIt) { CConcept* concept = conceptAddLinkerIt->getData(); bool conNeg = conceptAddLinkerIt->isNegated()^negate; KONCLUDE_ASSERT_X(concept,"adding concept to individual","concept missing"); CConceptDescriptor* conceptDescriptor = CObjectAllocator::allocateAndConstruct(taskMemMan); conceptDescriptor->initConceptDescriptor(concept,conNeg,dependencyTrackPoint); CCondensedReapplyQueueIterator reapplyIt; bool contained = insertConceptsToIndividualConceptSet(conceptDescriptor,dependencyTrackPoint,processIndi,conLabelSet,&reapplyIt,allowInitalization,calcAlgContext); if (!contained) { STATINC(CONCEPTSADDEDINDINODELABELSETCOUNT,calcAlgContext); addBlockingCoreConcept(conceptDescriptor,processIndi,conLabelSet,calcAlgContext); setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); addConceptPreprocessedToProcessingQueue(conceptDescriptor,dependencyTrackPoint,conProQueue,processIndi,allowPreprocessing,calcAlgContext); if (reapplyIt.hasNext()) { // reapply reapplying concept applyReapplyQueueConcepts(processIndi,&reapplyIt,calcAlgContext); } } ++conCount; conceptAddLinkerIt = conceptAddLinkerIt->getNext(); } if (conceptCount) { *conceptCount = conCount; } } bool CCalculationTableauCompletionTaskHandleAlgorithm::addBlockingCoreConcept(CConceptDescriptor* conceptDescriptor, CIndividualProcessNode*& processIndi, CReapplyConceptLabelSet* conLabelSet, CCalculationAlgorithmContextBase* calcAlgContext) { if (mConfSaveCoreBlockingConceptsCandidates) { CConceptData* conData = conceptDescriptor->getConcept()->getConceptData(); if (conData) { CConceptProcessData* conProData = (CConceptProcessData*)conData; if (conProData->isCoreBlockingConcept(conceptDescriptor->isNegated())) { if (!processIndi->isNominalIndividual()) { STATINC(CORECONCEPTSADDEDINDINODELABELSETCOUNT,calcAlgContext); CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CCoreConceptDescriptor* coreConceptDescriptor = CObjectAllocator::allocateAndConstruct(taskMemMan); coreConceptDescriptor->initCoreConceptDescriptor(conceptDescriptor); conLabelSet->addCoreConceptDescriptor(coreConceptDescriptor); CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CBlockingIndividualNodeLinkedCandidateHash* blockingCandHash = procDataBox->getBlockingIndividualNodeLinkedCandidateHash(true); CBlockingIndividualNodeLinkedCandidateData* blockingCandData = blockingCandHash->getBlockingIndividualCandidateData(conceptDescriptor,true); blockingCandData->addBlockingCandidateIndividualNode(processIndi); } return true; } } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::isConceptUnsatisfiabilitySaturated(CConcept* concept, bool negation, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptData* conceptData = concept->getConceptData(); CIndividualSaturationProcessNode* saturationIndiNode = nullptr; if (conceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)conceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* satCalcRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(negation); if (satCalcRefLinkData) { saturationIndiNode = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } if (saturationIndiNode) { if (saturationIndiNode->getIndirectStatusFlags()->hasClashedFlag()) { return true; } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::insertConceptsToIndividualConceptSet(CConceptDescriptor* conceptDescriptor, CDependencyTrackPoint* dependencyTrackPoint, CIndividualProcessNode*& processIndi, CReapplyConceptLabelSet* conLabelSet, CCondensedReapplyQueueIterator* reapplyIt, bool allowInitalization, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptDescriptor* clashedConceptDescriptor = nullptr; CDependencyTrackPoint* clashedDependencyTrackPoint = nullptr; if (mConfConceptUnsatisfiabilitySaturatedTesting) { if (isConceptUnsatisfiabilitySaturated(conceptDescriptor->getConcept(),conceptDescriptor->isNegated(),calcAlgContext)) { CClashedDependencyDescriptor* clashConDesLinker = nullptr; clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,conceptDescriptor,dependencyTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(clashConDesLinker); } } bool contained = conLabelSet->insertConceptGetClash(conceptDescriptor,dependencyTrackPoint,reapplyIt,&clashedConceptDescriptor,&clashedDependencyTrackPoint); if (allowInitalization) { if (!processIndi->getIndividualInitializationConcept()) { processIndi->setIndividualInitializationConcept(conceptDescriptor); } } if (!contained) { if (conceptDescriptor->getConcept()->getOperatorCode() == CCMARKER) { bool nondeterministically = true; if (dependencyTrackPoint && dependencyTrackPoint->getBranchingTag() <= 0) { nondeterministically = false; } calcAlgContext->getProcessingDataBox()->getMarkerIndividualNodeHash(true)->addMarkerIndividualNode(conceptDescriptor->getConcept(),processIndi,nondeterministically); } } if (contained && clashedConceptDescriptor) { //mClashedDebugIndiModelString = generateDebugIndiModelStringList(calcAlgContext); //QFile file = QString("model.txt"); //if (file.open(QIODevice::WriteOnly)) { // file.write(mClashedDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); //} CClashedDependencyDescriptor* clashConDesLinker = nullptr; clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,clashedConceptDescriptor,clashedDependencyTrackPoint,calcAlgContext); clashConDesLinker = createClashedConceptDescriptor(clashConDesLinker,processIndi,conceptDescriptor,dependencyTrackPoint,calcAlgContext); throw CCalculationClashProcessingException(clashConDesLinker); } //CConceptDescriptor* conDes = processIndi->getReapplyConceptLabelSet(false)->getAddingSortedConceptDescriptionLinker(); //bool amountSubstanceFound = false; //for (CConceptDescriptor* conDesIt = conDes; conDesIt; conDesIt = conDesIt->getNext()) { // CConcept* concept = conDesIt->getConcept(); // if (concept->getOperatorCode() == CCIMPLALL) { // if (CIRIName::getRecentIRIName(concept->getRole()->getPropertyNameLinker()) == "http://purl.org/biotop/biotop.owl#granularPartOf") { // CConcept* orCocnept = concept->getOperandList()->getData(); // if (orCocnept->getOperatorCode() == CCOR) { // for (CSortedNegLinker* opLinker = orCocnept->getOperandList(); opLinker; opLinker = opLinker->getNext()) { // if (opLinker->getData()->getOperatorCode() == CCSUB && CIRIName::getRecentIRIName(opLinker->getData()->getClassNameLinker()) == "http://purl.org/imbi/dco/dco#AmountOfSubstance") { // amountSubstanceFound = true; // } // } // } // } // } //} //if (amountSubstanceFound) { // bool base1Con = false; // bool base2Con = false; // for (CConceptDescriptor* conDesIt = conDes; conDesIt; conDesIt = conDesIt->getNext()) { // if (CIRIName::getRecentIRIName(conDesIt->getData()->getClassNameLinker()) == "http://purl.org/biotop/biotop.owl#Atom") { // base1Con = true; // } // if (CIRIName::getRecentIRIName(conDesIt->getData()->getClassNameLinker()) == "http://purl.org/biotop/biotop.owl#MonoMolecularEntity") { // base2Con = true; // } // } // if (!base2Con && !base1Con) { // mEndTaskDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // QFile file(QString("caching-error.txt")); // if (file.open(QIODevice::WriteOnly)) { // file.write(mEndTaskDebugIndiModelString.replace("
","\r\n").toLocal8Bit()); // file.close(); // } // bool bug = true; // } //} return contained; } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptsToIndividual(CConceptAssertionLinker* conceptAddLinkerIt, bool negate, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, bool allowPreprocessing, bool allowInitalization, cint64* conceptCount, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); KONCLUDE_ASSERT_X(dependencyTrackPoint,"adding concept to individual","dependency track point missing"); cint64 conCount = 0; CReapplyConceptLabelSet* conLabelSet = processIndi->getReapplyConceptLabelSet(true); while (conceptAddLinkerIt) { CConcept* concept = conceptAddLinkerIt->getData(); bool conNeg = conceptAddLinkerIt->isNegated()^negate; KONCLUDE_ASSERT_X(concept,"adding concept to individual","concept missing"); CConceptDescriptor* conceptDescriptor = CObjectAllocator::allocateAndConstruct(taskMemMan); conceptDescriptor->initConceptDescriptor(concept,conNeg,dependencyTrackPoint); CCondensedReapplyQueueIterator reapplyIt; bool contained = insertConceptsToIndividualConceptSet(conceptDescriptor,dependencyTrackPoint,processIndi,conLabelSet,&reapplyIt,allowInitalization,calcAlgContext); if (!contained) { STATINC(CONCEPTSADDEDINDINODELABELSETCOUNT,calcAlgContext); addBlockingCoreConcept(conceptDescriptor,processIndi,conLabelSet,calcAlgContext); setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); addConceptPreprocessedToProcessingQueue(conceptDescriptor,dependencyTrackPoint,conProQueue,processIndi,allowPreprocessing,calcAlgContext); if (reapplyIt.hasNext()) { // reapply reapplying concept applyReapplyQueueConcepts(processIndi,&reapplyIt,calcAlgContext); } } conceptAddLinkerIt = conceptAddLinkerIt->getNext(); } if (conceptCount) { *conceptCount = conCount; } } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptsToIndividual(CXNegLinker* conceptAddLinkerIt, bool negate, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, bool allowPreprocessing, bool allowInitalization, cint64* conceptCount, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); KONCLUDE_ASSERT_X(dependencyTrackPoint,"adding concept to individual","dependency track point missing"); cint64 conCount = 0; CReapplyConceptLabelSet* conLabelSet = processIndi->getReapplyConceptLabelSet(true); while (conceptAddLinkerIt) { CConcept* concept = conceptAddLinkerIt->getData(); bool conNeg = conceptAddLinkerIt->isNegated()^negate; KONCLUDE_ASSERT_X(concept,"adding concept to individual","concept missing"); CConceptDescriptor* conceptDescriptor = CObjectAllocator::allocateAndConstruct(taskMemMan); conceptDescriptor->initConceptDescriptor(concept,conNeg,dependencyTrackPoint); CCondensedReapplyQueueIterator reapplyIt; bool contained = insertConceptsToIndividualConceptSet(conceptDescriptor,dependencyTrackPoint,processIndi,conLabelSet,&reapplyIt,allowInitalization,calcAlgContext); if (!contained) { STATINC(CONCEPTSADDEDINDINODELABELSETCOUNT,calcAlgContext); addBlockingCoreConcept(conceptDescriptor,processIndi,conLabelSet,calcAlgContext); setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); addConceptPreprocessedToProcessingQueue(conceptDescriptor,dependencyTrackPoint,conProQueue,processIndi,allowPreprocessing,calcAlgContext); if (reapplyIt.hasNext()) { // reapply reapplying concept applyReapplyQueueConcepts(processIndi,&reapplyIt,calcAlgContext); } } conceptAddLinkerIt = conceptAddLinkerIt->getNext(); } if (conceptCount) { *conceptCount = conCount; } } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptsToIndividual(CXSortedNegLinker* conceptAddLinkerIt, bool negate, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* dependencyTrackPoint, bool allowPreprocessing, bool allowInitalization, cint64* conceptCount, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CConceptProcessingQueue* conProQueue = processIndi->getConceptProcessingQueue(true); KONCLUDE_ASSERT_X(dependencyTrackPoint,"adding concept to individual","dependency track point missing"); cint64 conCount = 0; CReapplyConceptLabelSet* conLabelSet = processIndi->getReapplyConceptLabelSet(true); while (conceptAddLinkerIt) { CConcept* concept = conceptAddLinkerIt->getData(); KONCLUDE_ASSERT_X(concept,"adding concept to individual","concept missing"); bool conNeg = conceptAddLinkerIt->isNegated()^negate; CConceptDescriptor* conceptDescriptor = CObjectAllocator::allocateAndConstruct(taskMemMan); conceptDescriptor->initConceptDescriptor(concept,conNeg,dependencyTrackPoint); CCondensedReapplyQueueIterator reapplyIt; bool contained = insertConceptsToIndividualConceptSet(conceptDescriptor,dependencyTrackPoint,processIndi,conLabelSet,&reapplyIt,allowInitalization,calcAlgContext); if (!contained) { STATINC(CONCEPTSADDEDINDINODELABELSETCOUNT,calcAlgContext); addBlockingCoreConcept(conceptDescriptor,processIndi,conLabelSet,calcAlgContext); setIndividualNodeConceptLabelSetModified(processIndi,calcAlgContext); addConceptPreprocessedToProcessingQueue(conceptDescriptor,dependencyTrackPoint,conProQueue,processIndi,allowPreprocessing,calcAlgContext); if (reapplyIt.hasNext()) { // reapply reapplying concept applyReapplyQueueConcepts(processIndi,&reapplyIt,calcAlgContext); } } conceptAddLinkerIt = conceptAddLinkerIt->getNext(); } if (conceptCount) { *conceptCount = conCount; } } void CCalculationTableauCompletionTaskHandleAlgorithm::insertConceptProcessDescriptorToProcessingQueue(CConceptProcessDescriptor* conProDes, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CConcept* concept = conProDes->getConceptDescriptor()->getConcept(); CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_PROPAGATION_TYPE)) { CProcessingDataBox* procDataBox = calcAlgContext->getProcessingDataBox(); CIndividualConceptBatchProcessingQueue* varBindConBatchProcQueue = procDataBox->getVariableBindingConceptBatchProcessingQueue(true); varBindConBatchProcQueue->insertIndiviudalForConcept(concept,processIndi,conProDes); } else { conceptProcessingQueue->insertConceptProcessDescriptor(conProDes); } } void CCalculationTableauCompletionTaskHandleAlgorithm::insertConceptProcessDescriptorToProcessingQueue(CConceptProcessDescriptor* conProDes, CConceptProcessingQueue*& conceptProcessingQueue, cint64 bindingCount, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CConcept* concept = conProDes->getConceptDescriptor()->getConcept(); CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_PROPAGATION_ALL_TYPE | CConceptOperator::CCFS_PROPAGATION_AND_TYPE)) { CProcessingDataBox* procDataBox = calcAlgContext->getProcessingDataBox(); CIndividualConceptBatchProcessingQueue* varBindConBatchProcQueue = procDataBox->getVariableBindingConceptBatchProcessingQueue(true); varBindConBatchProcQueue->insertIndiviudalForBindingCount(concept,bindingCount,processIndi,conProDes); } else if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_PROPAGATION_TYPE)) { CProcessingDataBox* procDataBox = calcAlgContext->getProcessingDataBox(); CIndividualConceptBatchProcessingQueue* varBindConBatchProcQueue = procDataBox->getVariableBindingConceptBatchProcessingQueue(true); varBindConBatchProcQueue->insertIndiviudalForConcept(concept,processIndi,conProDes); } else { conceptProcessingQueue->insertConceptProcessDescriptor(conProDes); } } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptToProcessingQueue(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, bool reapplied, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); if (needsProcessingForConcept(conceptDescriptor,depTrackPoint,processIndi,calcAlgContext)) { STATINC(CONCEPTSADDEDINDINODEPROCESSINGQUEUECOUNT,calcAlgContext); CConceptProcessDescriptor* conProDes = CObjectAllocator::allocateAndConstruct(taskMemMan); CConceptProcessPriority conProPriority = calcAlgContext->getUsedConceptPriorityStrategy()->getPriorityForConcept(conceptDescriptor,processIndi); conProDes->init(conceptDescriptor,conProPriority,reapplied,depTrackPoint); insertConceptProcessDescriptorToProcessingQueue(conProDes,conceptProcessingQueue,processIndi,calcAlgContext); //propagateIndividualUnprocessed(processIndi,calcAlgContext); } } bool CCalculationTableauCompletionTaskHandleAlgorithm::needsProcessingForConcept(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { TableauRuleFunction func = nullptr; cint64 opCode = conceptDescriptor->getConcept()->getOperatorCode(); bool conNeg = conceptDescriptor->isNegated(); if (conNeg) { func = mNegJumpFuncVec[opCode]; } else { func = mPosJumpFuncVec[opCode]; } return func != nullptr; } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptPreprocessedToProcessingQueue(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, cint64 bindingCount, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); STATINC(CONCEPTSADDEDINDINODEPROCESSINGQUEUECOUNT,calcAlgContext); CConceptProcessPriority conProPriority = calcAlgContext->getUsedConceptPriorityStrategy()->getPriorityForConcept(conceptDescriptor,processIndi); CConceptProcessDescriptor* conProDes = CObjectAllocator::allocateAndConstruct(taskMemMan); conProDes->init(conceptDescriptor,conProPriority,false,depTrackPoint); insertConceptProcessDescriptorToProcessingQueue(conProDes,conceptProcessingQueue,bindingCount,processIndi,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptPreprocessedToProcessingQueue(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, bool allowPreprocessing, CCalculationAlgorithmContextBase* calcAlgContext, TableauRuleFunction skipFunction) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); // TODO: check necessary TableauRuleFunction func = nullptr; cint64 opCode = conceptDescriptor->getConcept()->getOperatorCode(); bool conNeg = conceptDescriptor->isNegated(); if (conNeg) { func = mNegJumpFuncVec[opCode]; } else { func = mPosJumpFuncVec[opCode]; } if (!func || func == skipFunction) { return; } allowPreprocessing &= mConfDirectRulePreprocessing; if (mCurrentRecProcDepth > mCurrentRecProcDepthLimit) { allowPreprocessing = false; } CConcept* concept = conceptDescriptor->getConcept(); CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_PROPAGATION_TYPE)) { allowPreprocessing = false; } STATINC(CONCEPTSADDEDINDINODEPROCESSINGQUEUECOUNT,calcAlgContext); CConceptProcessPriority conProPriority = calcAlgContext->getUsedConceptPriorityStrategy()->getPriorityForConcept(conceptDescriptor,processIndi); CConceptProcessDescriptor* conProDes = CObjectAllocator::allocateAndConstruct(taskMemMan); conProDes->init(conceptDescriptor,conProPriority,false,depTrackPoint); if (allowPreprocessing && conProPriority.getPriority() >= mImmediatelyProcessPriority) { STATINC(RULEAPPLICATIONCOUNT,calcAlgContext); tableauRuleChoice(processIndi,conProDes,calcAlgContext); } else { insertConceptProcessDescriptorToProcessingQueue(conProDes,conceptProcessingQueue,processIndi,calcAlgContext); //propagateIndividualUnprocessed(processIndi,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptToProcessingQueue(CConceptProcessDescriptor* reinsertConProDes, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(CONCEPTSADDEDINDINODEPROCESSINGQUEUECOUNT,calcAlgContext); conceptProcessingQueue->reinsertConceptProcessDescriptor(reinsertConProDes); } void CCalculationTableauCompletionTaskHandleAlgorithm::addCopiedConceptToProcessingQueue(CConceptProcessDescriptor* copyConProDes, CIndividualProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); if (!processIndi->isLocalizationTagUpToDate(calcAlgContext->getUsedProcessTagger()->getCurrentLocalizationTag())) { processIndi = getUpToDateIndividual(processIndi,calcAlgContext); if (!processIndi->isLocalizationTagUpToDate(calcAlgContext->getUsedProcessTagger()->getCurrentLocalizationTag())) { STATINC(INDINODELOCALIZEDLOADCOUNT,calcAlgContext); CMemoryAllocationManager* taskMemMan = nullptr; CIndividualProcessNodeVector* indiProcNodeVec = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); CIndividualProcessNode* localicedIndi = CObjectParameterizingAllocator< CIndividualProcessNode,CProcessContext* >::allocateAndConstructAndParameterize(taskMemMan,calcAlgContext->getUsedProcessContext()); localicedIndi->initIndividualProcessNode(processIndi); indiProcNodeVec->setLocalData(localicedIndi->getIndividualID(),localicedIndi); processIndi = localicedIndi; calcAlgContext->getUsedProcessTagger()->incLocalizationTag(); } } CConceptProcessDescriptor* conProDes = CObjectAllocator::allocateAndConstruct(taskMemMan); CConceptProcessPriority conProPriority = calcAlgContext->getUsedConceptPriorityStrategy()->getPriorityForConcept(copyConProDes->getConceptDescriptor(),processIndi); conProDes->initCopy(copyConProDes); CConceptProcessingQueue* conceptProcessingQueue = processIndi->getConceptProcessingQueue(true); insertConceptProcessDescriptorToProcessingQueue(conProDes,conceptProcessingQueue,processIndi,calcAlgContext); } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptRestrictedToProcessingQueue(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, bool reapplied, CProcessingRestrictionSpecification* procRestriction, CCalculationAlgorithmContextBase* calcAlgContext) { bool insertedWithPriorityOffset = false; if (procRestriction) { double priorityOffset = procRestriction->getPriorityOffset(); insertedWithPriorityOffset = true; addConceptRestrictedToProcessingQueue(conceptDescriptor,depTrackPoint,conceptProcessingQueue,processIndi,reapplied,procRestriction,priorityOffset,calcAlgContext); } if (!insertedWithPriorityOffset) { addConceptRestrictedToProcessingQueue(conceptDescriptor,depTrackPoint,conceptProcessingQueue,processIndi,reapplied,procRestriction,0,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptRestrictedToProcessingQueue(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, bool reapplied, CProcessingRestrictionSpecification* procRestriction, double priorityOffset, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); if (needsProcessingForConcept(conceptDescriptor,depTrackPoint,processIndi,calcAlgContext)) { STATINC(CONCEPTSADDEDINDINODEPROCESSINGQUEUECOUNT,calcAlgContext); CConceptProcessDescriptor* conProDes = CObjectAllocator::allocateAndConstruct(taskMemMan); CConceptProcessPriority conProPriority = calcAlgContext->getUsedConceptPriorityStrategy()->getPriorityForConcept(conceptDescriptor,processIndi); conProPriority.addPriorityOffset(priorityOffset); conProDes->init(conceptDescriptor,conProPriority,reapplied,depTrackPoint,procRestriction); insertConceptProcessDescriptorToProcessingQueue(conProDes,conceptProcessingQueue,processIndi,calcAlgContext); //propagateIndividualUnprocessed(processIndi,calcAlgContext); } } void CCalculationTableauCompletionTaskHandleAlgorithm::addConceptRestrictedFixedPriorityToProcessingQueue(CConceptDescriptor *conceptDescriptor, CDependencyTrackPoint* depTrackPoint, CConceptProcessingQueue*& conceptProcessingQueue, CIndividualProcessNode*& processIndi, bool reapplied, CProcessingRestrictionSpecification* procRestriction, double priority, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = nullptr; taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); STATINC(CONCEPTSADDEDINDINODEPROCESSINGQUEUECOUNT,calcAlgContext); CConceptProcessDescriptor* conProDes = CObjectAllocator::allocateAndConstruct(taskMemMan); CConceptProcessPriority conProPriority(priority); conProDes->init(conceptDescriptor,conProPriority,reapplied,depTrackPoint,procRestriction); insertConceptProcessDescriptorToProcessingQueue(conProDes,conceptProcessingQueue,processIndi,calcAlgContext); //propagateIndividualUnprocessed(processIndi,calcAlgContext); } bool CCalculationTableauCompletionTaskHandleAlgorithm::addIndividualToProcessingQueueBasedOnProcessingConcepts(CIndividualProcessNode* individual, CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); bool individualInserted = false; CConceptProcessingQueue* conProQueue = individual->getConceptProcessingQueue(false); if (!conProQueue) { if (!mConfCurrentIndividualQueuing && calcAlgContext->getCurrentIndividualNode() == individual) { individualInserted = true; } else if (!individual->isImmediatelyProcessingQueued()) { individual->setImmediatelyProcessingQueued(true); CIndividualUnsortedProcessingQueue* unPrQueue = processingDataBox->getIndividualImmediatelyProcessingQueue(true); unPrQueue->insertIndiviudalProcessNode(individual); individualInserted = true; } } else if (!conProQueue->isEmpty()) { CConceptProcessPriority conProPri; if (conProQueue->getNextConceptProcessPriority(&conProPri)) { double priority = conProPri.getPriority(); if (priority >= mImmediatelyProcessPriority) { if (!mConfCurrentIndividualQueuing && calcAlgContext->getCurrentIndividualNode() == individual) { individualInserted = true; } else if (!individual->isImmediatelyProcessingQueued()) { individual->setImmediatelyProcessingQueued(true); CIndividualUnsortedProcessingQueue* unPrQueue = processingDataBox->getIndividualImmediatelyProcessingQueue(true); unPrQueue->insertIndiviudalProcessNode(individual); individualInserted = true; } } else if (mOptDetExpPreporcessing && priority >= mDeterministicProcessPriority) { if (!individual->isDeterministicExpandingProcessingQueued()) { individual->setDeterministicExpandingProcessingQueued(true); CIndividualDepthProcessingQueue* unPrQueue = processingDataBox->getIndividualDepthDeterministicExpansionPreprocessingQueue(true); unPrQueue->insertProcessIndiviudal(individual); individualInserted = true; } } else { if (!individual->isRegularDepthProcessingQueued()) { individual->setRegularDepthProcessingQueued(true); if (individual->isNominalIndividual() && individual->getIndividualNominalLevelOrAncestorDepth() <= 0) { if (!processingDataBox->hasNominalNonDeterministicProcessingNodesSorted()) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CXLinker* linker = CObjectAllocator< CXLinker >::allocateAndConstruct(taskMemMan); linker->initLinker(individual); processingDataBox->addSortedNominalNonDeterministicProcessingNodeLinker(linker); } else { CIndividualDepthProcessingQueue* nominalProQueue = processingDataBox->getNominalProcessingQueue(true); nominalProQueue->insertProcessIndiviudal(individual); } } else { CIndividualDepthProcessingQueue* inDepthProQueue = processingDataBox->getIndividualDepthProcessingQueue(true); inDepthProQueue->insertProcessIndiviudal(individual); } individualInserted = true; } } } } return individualInserted; } bool CCalculationTableauCompletionTaskHandleAlgorithm::addIndividualToProcessingQueue(CIndividualProcessNode* individual, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); bool individualInserted = false; CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); if (mConfDepthOrientatedProcessing && !individual->isNominalIndividual() && !individual->isExtendedQueueProcessing()) { if (!individual->isProcessingQueued()) { bool deterministicPreprocessingQueued = false; if (mOptDetExpPreporcessing) { deterministicPreprocessingQueued = true; CConceptProcessingQueue* conProQueue = individual->getConceptProcessingQueue(false); if (!conProQueue) { CConceptProcessPriority conProPri; if (conProQueue->getNextConceptProcessPriority(&conProPri)) { double priority = conProPri.getPriority(); if (priority < mDeterministicProcessPriority) { deterministicPreprocessingQueued = false; } } } } if (deterministicPreprocessingQueued) { CIndividualUnsortedProcessingQueue* unPrQueue = processingDataBox->getIndividualDepthFirstDeterministicExpansionProcessingQueue(true); unPrQueue->insertIndiviudalProcessNode(individual); } else { CIndividualUnsortedProcessingQueue* depthProcessingQueue = processingDataBox->getIndividualDepthFirstProcessingQueue(true); depthProcessingQueue->insertIndiviudalProcessNode(individual); } individual->setProcessingQueued(true); individualInserted = true; } } else { bool insertIndividual = true; bool individualBlocked = false; if (insertIndividual && individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFDIRECTBLOCKED)) { individualBlocked = true; if (!individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEDIRECTMODIFIED | CIndividualProcessNode::PRFBLOCKINGRETESTDUEBLOCKERMODIFIED)) { insertIndividual = false; } } //if (insertIndividual && individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSATISFIABLECACHED)) { // individualBlocked = true; // if (!individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSATISFIABLECACHEDDUEDIRECTMODIFIED)) { // insertIndividual = false; // } //} //if (insertIndividual && individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSIGNATUREBLOCKINGCACHED)) { // individualBlocked = true; // if (!individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTSIGNATUREBLOCKINGCACHEDDUEDIRECTMODIFIED)) { // insertIndividual = false; // } //} if (insertIndividual && individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED)) { individualBlocked = true; if (!individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFRETESTCOMPLETIONGRAPHCACHEDDUEDIRECTMODIFIED | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALID)) { insertIndividual = false; } } if (insertIndividual && individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINDIRECTBLOCKED)) { individualBlocked = true; if (!individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFBLOCKINGRETESTDUEINDIRECTBLOCKERLOSS)) { insertIndividual = false; } } if (insertIndividual && individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHED)) { individualBlocked = true; if (!individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATISFIABLECACHEDABOLISHED)) { insertIndividual = false; } } if (insertIndividual && individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHED)) { individualBlocked = true; if (!individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSIGNATUREBLOCKINGCACHEDABOLISHED)) { insertIndividual = false; } } if (insertIndividual && individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHED)) { individualBlocked = true; if (!individual->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFANCESTORSATURATIONBLOCKINGCACHEDABOLISHED)) { insertIndividual = false; } } if (insertIndividual && individual->isDelayedNominalProcessingQueued()) { individualBlocked = true; insertIndividual = false; } if (individualBlocked && insertIndividual) { if (mConfLateBlockingResolving) { if (!individual->isBlockedReactivationProcessingQueued()) { individual->setBlockedReactivationProcessingQueued(true); CIndividualDepthProcessingQueue* blockReactProQueue = processingDataBox->getBlockedReactivationProcessingQueue(true); blockReactProQueue->insertProcessIndiviudal(individual); //CXLinker* indiNodeLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); //indiNodeLinker->initLinker(individual); //processingDataBox->addIndividualNodeBlockedResolveLinker(indiNodeLinker); individualInserted = true; } } else { individualInserted = addIndividualToProcessingQueueBasedOnProcessingConcepts(individual,calcAlgContext); if (!individualInserted) { if (!individual->isRegularDepthProcessingQueued()) { individual->setRegularDepthProcessingQueued(true); CIndividualDepthProcessingQueue* inDepthProQueue = processingDataBox->getIndividualDepthProcessingQueue(true); inDepthProQueue->insertProcessIndiviudal(individual); individualInserted = true; } } } } if (!individualBlocked) { individualInserted = addIndividualToProcessingQueueBasedOnProcessingConcepts(individual,calcAlgContext); } } if (individualInserted) { STATINC(INDINODESADDEDPROCESSINGQUEUECOUNT,calcAlgContext); } return individualInserted; } bool CCalculationTableauCompletionTaskHandleAlgorithm::addIndividualToIncrementalCompatibilityCheckingQueue(CIndividualProcessNode* individual, CCalculationAlgorithmContextBase* calcAlgContext) { if (!individual->isIncrementalCompatibilityCheckingQueued() && individual->isNominalIndividual()) { individual->setIncrementalCompatibilityCheckingQueued(true); CIndividualDepthProcessingQueue* incCompCheckingQueue = calcAlgContext->getProcessingDataBox()->getIncrementalCompatibilityCheckingQueue(true); incCompCheckingQueue->insertProcessIndiviudal(individual); STATINC(INDINODESADDEDPROCESSINGQUEUECOUNT,calcAlgContext); return true; } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::addIndividualToIncrementalExpansionQueue(CIndividualProcessNode* individual, CCalculationAlgorithmContextBase* calcAlgContext) { if (!individual->isIncrementalExpansionQueued()) { CIndividualNodeIncrementalExpansionData* incExpData = individual->getIncrementalExpansionData(false); if (!incExpData || !incExpData->isIncremetnalExpansionListInitialized()) { individual->setIncrementalExpansionQueued(true); CIndividualDepthProcessingQueue* incExpInitQueue = calcAlgContext->getProcessingDataBox()->getIncrementalExpansionInitializingProcessingQueue(true); incExpInitQueue->insertProcessIndiviudal(individual); STATINC(INDINODESADDEDPROCESSINGQUEUECOUNT,calcAlgContext); return true; } else if (incExpData->requiresFurtherIncrementalExpansion()) { individual->setIncrementalExpansionQueued(true); double nextExpPriority = incExpData->getNextIncrementalExpansionPriority(); CIndividualCustomPriorityProcessingQueue* incExpQueue = calcAlgContext->getProcessingDataBox()->getIncrementalExpansionProcessingQueue(true); incExpQueue->insertIndiviudal(nextExpPriority,individual); STATINC(INDINODESADDEDPROCESSINGQUEUECOUNT,calcAlgContext); return true; } } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::addIndividualToBackendSynchronisationRetestQueue(CIndividualProcessNode* individual, CCalculationAlgorithmContextBase* calcAlgContext) { if (!individual->isBackendSynchronRetestProcessingQueued()) { individual->setBackendSynchronRetestProcessingQueued(true); CIndividualUnsortedProcessingQueue* backendCacheSyncQueue = calcAlgContext->getProcessingDataBox()->getBackendCacheSynchronizationProcessingQueue(true); backendCacheSyncQueue->insertIndiviudalProcessNode(individual); STATINC(INDINODESADDEDPROCESSINGQUEUECOUNT,calcAlgContext); return true; } return false; } bool CCalculationTableauCompletionTaskHandleAlgorithm::addIndividualToBlockingUpdateReviewProcessingQueue(CIndividualProcessNode* individual, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualDepthProcessingQueue* sigBlockUpdProQueue = calcAlgContext->getProcessingDataBox()->getBlockingUpdateReviewProcessingQueue(true); sigBlockUpdProQueue->insertProcessIndiviudal(individual); STATINC(INDINODESADDEDPROCESSINGQUEUECOUNT,calcAlgContext); return true; } cint64 CCalculationTableauCompletionTaskHandleAlgorithm::getAppliedANDRuleCount() { return mAppliedANDRuleCount; } cint64 CCalculationTableauCompletionTaskHandleAlgorithm::getAppliedORRuleCount() { return mAppliedORRuleCount; } cint64 CCalculationTableauCompletionTaskHandleAlgorithm::getAppliedSOMERuleCount() { return mAppliedSOMERuleCount; } cint64 CCalculationTableauCompletionTaskHandleAlgorithm::getAppliedATLEASTRuleCount() { return mAppliedATLEASTRuleCount; } cint64 CCalculationTableauCompletionTaskHandleAlgorithm::getAppliedALLRuleCount() { return mAppliedALLRuleCount; } cint64 CCalculationTableauCompletionTaskHandleAlgorithm::getAppliedATMOSTRuleCount() { return mAppliedATMOSTRuleCount; } cint64 CCalculationTableauCompletionTaskHandleAlgorithm::getAppliedTotalRuleCount() { return mAppliedTOTALRuleCount; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeStringValueSpaceHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeStringValueSpa0000644000175000017500000001021412520551010032306 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODESTRINGVALUESPACEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODESTRINGVALUESPACEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CCalculationClashProcessingException.h" #include "CDatatypeDependencyCollection.h" #include "CDependencyFactory.h" #include "CIndividualProcessNodeValueSpaceHandler.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Reasoner/Kernel/Process/Dependency/CDATATYPETRIGGERDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CDATATYPECONNECTIONDependencyNode.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CIndividualProcessNodeStringValueSpaceHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeStringValueSpaceHandler : public CIndividualProcessNodeValueSpaceHandler { // public methods public: //! Constructor CIndividualProcessNodeStringValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType); virtual bool addDataLiteral(CIndividualProcessNode* indiProcNode, CDataLiteral* dataLiteral, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); virtual bool addDataRestriction(CIndividualProcessNode* indiProcNode, CConcept* dataRestricionConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); virtual bool testValueSpaceClashed(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); virtual CConceptDescriptor* triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, cint64& remainingRequiredValuesCount, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext); virtual bool addValueSpaceDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext); virtual bool countPossibleValueSpaceValues(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceValuesCounter* valueCounter, CCalculationAlgorithmContext* calcAlgContext); virtual bool getNextPossibleDataValue(CIndividualProcessNode* indiProcNode, CDataLiteralValue*& nextValue, CDataLiteralValue* lastValue, CDatatypeValueTestingCollection* valueTestingCollection, CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: // protected variables protected: CDatatypeValueSpaceStringType* mStringValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODESTRINGVALUESPACEHANDLER_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeFloatValueSpaceHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeFloatValueSpac0000644000175000017500000000464412520551010032262 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEFLOATVALUESPACEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEFLOATVALUESPACEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CIndividualProcessNodeCompareValueSpaceHandler.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CIndividualProcessNodeFloatValueSpaceHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeFloatValueSpaceHandler : public CIndividualProcessNodeCompareValueSpaceHandler { // public methods public: //! Constructor CIndividualProcessNodeFloatValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEFLOATVALUESPACEHANDLER_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CReuseCompletionGraphCacheHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CReuseCompletionGraphCacheHandler.cp0000644000175000017500000001130612520551012032150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReuseCompletionGraphCacheHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CReuseCompletionGraphCacheHandler::CReuseCompletionGraphCacheHandler(CReuseCompletionGraphCacheReader* reuseCompGraphCacheReader, CReuseCompletionGraphCacheWriter* reuseCompGraphCacheWriter) { mReuseCompGraphCacheReader = reuseCompGraphCacheReader; mReuseCompGraphCacheWriter = reuseCompGraphCacheWriter; mTmpContext = nullptr; mMemAllocMan = nullptr; mWriteData = nullptr; } CReuseCompletionGraphCacheHandler::~CReuseCompletionGraphCacheHandler() { } CReuseCompletionGraphCacheEntry* CReuseCompletionGraphCacheHandler::getReuseCompletionGraphEntry(CIndividualProcessNode* indiProcNode, bool* minimalCompletionGraph, bool* deterministicConnection, CCalculationAlgorithmContext* calcAlgContext) { CReuseCompletionGraphCacheEntry* cacheEntry = nullptr; if (mReuseCompGraphCacheReader) { CProcessingDataBox* dataBox = calcAlgContext->getUsedProcessingDataBox(); if (indiProcNode) { CConcept* initConcept = nullptr; CXSortedNegLinker* initConceptLinkerIt = indiProcNode->getProcessInitializingConceptLinker(); while (!initConcept && initConceptLinkerIt) { if (!initConceptLinkerIt->isNegated()) { CConcept* tmpConcept = initConceptLinkerIt->getData(); if (tmpConcept->hasClassName()) { initConcept = tmpConcept; } } initConceptLinkerIt = initConceptLinkerIt->getNext(); } if (initConcept) { cacheEntry = mReuseCompGraphCacheReader->getCacheEntry(initConcept,minimalCompletionGraph,deterministicConnection); } } } return cacheEntry; } bool CReuseCompletionGraphCacheHandler::prepareCacheMessages(CCalculationAlgorithmContext* calcAlgContext) { if (!mMemAllocMan) { CTaskMemoryPoolAllocationManager reuseCacheMemManCreaterMemMan(&mMemPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mMemAllocMan = CObjectAllocator::allocateAndConstruct(&reuseCacheMemManCreaterMemMan); mMemAllocMan->initTaskMemoryPoolAllocationManager(&mMemPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mTmpContext = CObjectParameterizingAllocator< CContextBase,CMemoryAllocationManager* >::allocateAndConstructAndParameterize(mMemAllocMan,mMemAllocMan); return true; } return false; } bool CReuseCompletionGraphCacheHandler::commitCacheMessages(CCalculationAlgorithmContext* calcAlgContext) { if (mWriteData) { CReuseCompletionGraphCacheEntryWriteData* commitWriteData = nullptr; CReuseCompletionGraphCacheEntryWriteData* writeDataIt = mWriteData; while (writeDataIt) { CReuseCompletionGraphCacheEntryWriteData* tmpWriteData = writeDataIt; writeDataIt = (CReuseCompletionGraphCacheEntryWriteData*)writeDataIt->getNext(); tmpWriteData->clearNext(); if (commitWriteData) { commitWriteData = (CReuseCompletionGraphCacheEntryWriteData*)tmpWriteData->append(commitWriteData); } else { commitWriteData = tmpWriteData; } } mReuseCompGraphCacheWriter->writeExpandCache(commitWriteData,mMemPoolCon.takeMemoryPools()); mWriteData = nullptr; mMemAllocMan = nullptr; mTmpContext = nullptr; return true; } return false; } bool CReuseCompletionGraphCacheHandler::addCacheMessages(CReuseCompletionGraphCacheEntryWriteData* expandWriteData, CCalculationAlgorithmContext* calcAlgContext) { if (mWriteData) { mWriteData = (CReuseCompletionGraphCacheEntryWriteData*)expandWriteData->append(mWriteData); } else { mWriteData = expandWriteData; } return true; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeDoubleValueSpaceHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeDoubleValueSpa0000644000175000017500000000242212520551010032254 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeDoubleValueSpaceHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualProcessNodeDoubleValueSpaceHandler::CIndividualProcessNodeDoubleValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType) : CIndividualProcessNodeCompareValueSpaceHandler(valueSpaceType) { } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CDatatypeIndividualProcessNodeHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CDatatypeIndividualProcessNodeHandle0000644000175000017500000010664412520756374032327 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeIndividualProcessNodeHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CDatatypeIndividualProcessNodeHandler::CDatatypeIndividualProcessNodeHandler() { mConfBuildDependencies = true; CDatatypeValueSpaceTypes* valueSpaceTypes = CDatatypeValueSpaceTypes::getValueSpaceTypes(); CDatatypeValueSpaceRealType* realValueSpaceType = valueSpaceTypes->getValueSpaceRealType(); mValueSpaceHandlerArray[realValueSpaceType->getValueSpaceTypeIndex()] = new CIndividualProcessNodeRealValueSpaceHandler(realValueSpaceType); CDatatypeValueSpaceUnknownType* unknownValueSpaceType = valueSpaceTypes->getValueSpaceUnkownType(); mValueSpaceHandlerArray[unknownValueSpaceType->getValueSpaceTypeIndex()] = new CIndividualProcessNodeUnknownValueSpaceHandler(unknownValueSpaceType); CDatatypeValueSpaceStringType* stringValueSpaceType = valueSpaceTypes->getValueSpaceStringType(); mValueSpaceHandlerArray[stringValueSpaceType->getValueSpaceTypeIndex()] = new CIndividualProcessNodeStringValueSpaceHandler(stringValueSpaceType); CDatatypeValueSpaceBooleanType* booleanValueSpaceType = valueSpaceTypes->getValueSpaceBooleanType(); mValueSpaceHandlerArray[booleanValueSpaceType->getValueSpaceTypeIndex()] = new CIndividualProcessNodeBooleanValueSpaceHandler(booleanValueSpaceType); CDatatypeValueSpaceDoubleType* doubleValueSpaceType = valueSpaceTypes->getValueSpaceDoubleType(); mValueSpaceHandlerArray[doubleValueSpaceType->getValueSpaceTypeIndex()] = new CIndividualProcessNodeDoubleValueSpaceHandler(doubleValueSpaceType); CDatatypeValueSpaceFloatType* floatValueSpaceType = valueSpaceTypes->getValueSpaceFloatType(); mValueSpaceHandlerArray[floatValueSpaceType->getValueSpaceTypeIndex()] = new CIndividualProcessNodeFloatValueSpaceHandler(floatValueSpaceType); CDatatypeValueSpaceIRIType* iriValueSpaceType = valueSpaceTypes->getValueSpaceIRIType(); mValueSpaceHandlerArray[iriValueSpaceType->getValueSpaceTypeIndex()] = new CIndividualProcessNodeIRIValueSpaceHandler(iriValueSpaceType); CDatatypeValueSpaceBinaryBase64DataType* binaryBase64DataValueSpaceType = valueSpaceTypes->getValueSpaceBinaryBase64DataType(); mValueSpaceHandlerArray[binaryBase64DataValueSpaceType->getValueSpaceTypeIndex()] = new CIndividualProcessNodeBinaryBase64DataValueSpaceHandler(binaryBase64DataValueSpaceType); CDatatypeValueSpaceBinaryHexDataType* binaryHexDataValueSpaceType = valueSpaceTypes->getValueSpaceBinaryHexDataType(); mValueSpaceHandlerArray[binaryHexDataValueSpaceType->getValueSpaceTypeIndex()] = new CIndividualProcessNodeBinaryHexDataValueSpaceHandler(binaryHexDataValueSpaceType); CDatatypeValueSpaceXMLType* xmlValueSpaceType = valueSpaceTypes->getValueSpaceXMLType(); mValueSpaceHandlerArray[xmlValueSpaceType->getValueSpaceTypeIndex()] = new CIndividualProcessNodeXMLValueSpaceHandler(xmlValueSpaceType); CDatatypeValueSpaceDateTimeType* dateTimeValueSpaceType = valueSpaceTypes->getValueSpaceDateTimeType(); mValueSpaceHandlerArray[dateTimeValueSpaceType->getValueSpaceTypeIndex()] = new CIndividualProcessNodeDateTimeValueSpaceHandler(dateTimeValueSpaceType); } CDatatypeIndividualProcessNodeHandler::~CDatatypeIndividualProcessNodeHandler() { } bool CDatatypeIndividualProcessNodeHandler::addDatatype(CIndividualProcessNode* indiProcNode, CConcept* datatypeConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { bool potentiallyModified = false; CDatatype* datatype = datatypeConcept->getDatatype(); if (datatype) { CDatatypeValueSpaceType* valueSpaceType = datatype->getValueSpaceType(); if (valueSpaceType) { CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeValueSpaceData* valueSpaceData = datatypesSpaceValue->getValueSpace(valueSpaceType,true); valueSpaceData->setValueSpaceInitialisationDependencyTrackPointCandidate(depTrackPoint); if (!negated) { potentiallyModified |= closeOtherValueSpaces(indiProcNode,valueSpaceType,depTrackPoint,calcAlgContext); } else { potentiallyModified |= closeValueSpace(indiProcNode,valueSpaceType,depTrackPoint,calcAlgContext); } } } if (potentiallyModified) { processValueSpaceModified(indiProcNode,calcAlgContext); } return potentiallyModified; } bool CDatatypeIndividualProcessNodeHandler::addDataLiteral(CIndividualProcessNode* indiProcNode, CDataLiteral* dataLiteral, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { bool potentiallyModified = false; CDatatype* datatype = dataLiteral->getDatatype(); if (datatype) { CDatatypeValueSpaceType* valueSpaceType = datatype->getValueSpaceType(); if (valueSpaceType) { CIndividualProcessNodeValueSpaceHandler* valueSpaceHandler = getValueSpaceHandler(valueSpaceType,calcAlgContext); potentiallyModified |= valueSpaceHandler->addDataLiteral(indiProcNode,dataLiteral,negated,depTrackPoint,calcAlgContext); if (!negated) { potentiallyModified |= closeOtherValueSpaces(indiProcNode,valueSpaceType,depTrackPoint,calcAlgContext); } } } if (potentiallyModified) { processValueSpaceModified(indiProcNode,calcAlgContext); } return potentiallyModified; } bool CDatatypeIndividualProcessNodeHandler::addDataRestriction(CIndividualProcessNode* indiProcNode, CConcept* dataRestricionConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { bool potentiallyModified = false; CDatatype* datatype = dataRestricionConcept->getDatatype(); cint64 restrictionCode = dataRestricionConcept->getParameter(); CDataLiteral* dataLiteral = dataRestricionConcept->getDataLiteral(); if (datatype) { CDatatypeValueSpaceType* valueSpaceType = datatype->getValueSpaceType(); if (valueSpaceType) { if (dataLiteral && dataLiteral->getDatatype()) { if (valueSpaceType != dataLiteral->getDatatype()->getValueSpaceType()) { return false; } } CIndividualProcessNodeValueSpaceHandler* valueSpaceHandler = getValueSpaceHandler(valueSpaceType,calcAlgContext); potentiallyModified |= valueSpaceHandler->addDataRestriction(indiProcNode,dataRestricionConcept,negated,depTrackPoint,calcAlgContext); if (!negated && restrictionCode > 0) { potentiallyModified |= closeOtherValueSpaces(indiProcNode,valueSpaceType,depTrackPoint,calcAlgContext); } } } if (potentiallyModified) { processValueSpaceModified(indiProcNode,calcAlgContext); } return potentiallyModified; } bool CDatatypeIndividualProcessNodeHandler::processValueSpaceModified(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext) { // test clashes CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(false); if (datatypesSpaceValue->isValueSpaceClashCheckingRequired()) { datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); datatypesSpaceValue->setValueSpaceClashCheckingRequired(false); testAllValueSpacesClashed(indiProcNode,calcAlgContext); } // queue triggering if (datatypesSpaceValue->isValueSpaceTriggeringRequired()) { if (!datatypesSpaceValue->isValueSpaceTriggeringQueued()) { CDatatypeValueSpacesTriggers* valueSpacesTriggers = calcAlgContext->getUsedProcessingDataBox()->getOntology()->getDataBoxes()->getMBox()->getValueSpacesTriggers(false); if (valueSpacesTriggers) { datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); calcAlgContext->getUsedProcessingDataBox()->getValueSpaceTriggeringProcessingQueue(true)->insertProcessIndiviudal(indiProcNode); datatypesSpaceValue->setValueSpaceTriggeringQueued(true); } } } // queue satisfiability checking if (datatypesSpaceValue->isValueSpaceSatisfiabilityCheckingRequired()) { if (!datatypesSpaceValue->isValueSpaceSatisfiabilityCheckingQueued()) { datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeValueSpaceValuesCounter valuesCounter; countPossibleValues(indiProcNode,&valuesCounter,calcAlgContext); cint64 disjointCount = getDisjointCount(indiProcNode,calcAlgContext); if (!valuesCounter.hasValueAchieved(disjointCount+1)) { // requires detailed satisfiability checking calcAlgContext->getUsedProcessingDataBox()->getDistinctValueSpaceSatisfiabilityCheckingQueue(true)->insertProcessIndiviudal(indiProcNode); datatypesSpaceValue->setValueSpaceSatisfiabilityCheckingQueued(true); } else { datatypesSpaceValue->setValueSpaceSatisfiabilityCheckingRequired(false); } } } return true; } bool CDatatypeIndividualProcessNodeHandler::triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor*& triggeredConcepts, CCalculationAlgorithmContext* calcAlgContext) { cint64 distinctCount = getDisjointCount(indiProcNode,calcAlgContext); CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CConceptDescriptor* conceptTriggerLinker = nullptr; bool triggered = false; if (datatypesSpaceValue->isValueSpaceTriggeringRequired() || distinctCount > datatypesSpaceValue->getLastTriggeringDisjointCount()) { datatypesSpaceValue->setLastTriggeringDisjointCount(distinctCount); cint64 remainingRequiredValueCount = distinctCount+1; CDatatypeDependencyCollection depCollection(calcAlgContext); addDistinctDependencies(indiProcNode,&depCollection,calcAlgContext); CConcreteOntology* ontology = calcAlgContext->getUsedProcessingDataBox()->getOntology(); CDatatypeValueSpaceType* valueSpaceTypeLinker = ontology->getDataBoxes()->getDatatypeValueSpaceTypes()->getValueSpaceTypeLinker(); for (CDatatypeValueSpaceType* valueSpaceTypeIt = valueSpaceTypeLinker; remainingRequiredValueCount > 0 && valueSpaceTypeIt; valueSpaceTypeIt = valueSpaceTypeIt->getNextValueSpaceType()) { CDatatypeValueSpaceType* valueSpaceType = valueSpaceTypeIt; CDatatypeValueSpaceData* valueSpaceData = datatypesSpaceValue->getValueSpace(valueSpaceType,false); if (valueSpaceData && valueSpaceData->isValueSpaceClashed()) { addValueSpaceDependencies(indiProcNode,valueSpaceData,valueSpaceType,&depCollection,calcAlgContext); } else { conceptTriggerLinker = triggerValueSpaceConcepts(indiProcNode,conceptTriggerLinker,remainingRequiredValueCount,valueSpaceData,valueSpaceType,&depCollection,calcAlgContext); } } datatypesSpaceValue->setValueSpaceTriggeringRequired(false); triggered = true; } datatypesSpaceValue->setValueSpaceTriggeringQueued(false); triggeredConcepts = conceptTriggerLinker; return triggered; } bool CDatatypeIndividualProcessNodeHandler::notifyDistinctChanges(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext) { bool queued = false; CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(false); if (datatypesSpaceValue) { if (!datatypesSpaceValue->isValueSpaceTriggeringQueued()) { cint64 disjointCount = getDisjointCount(indiProcNode,calcAlgContext); if (datatypesSpaceValue->isValueSpaceTriggeringRequired() || datatypesSpaceValue->getLastTriggeringDisjointCount() < disjointCount) { datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); calcAlgContext->getUsedProcessingDataBox()->getValueSpaceTriggeringProcessingQueue(true)->insertProcessIndiviudal(indiProcNode); datatypesSpaceValue->setValueSpaceTriggeringQueued(true); datatypesSpaceValue->setValueSpaceTriggeringRequired(true); queued = true; } } if (!datatypesSpaceValue->isValueSpaceSatisfiabilityCheckingQueued()) { CDatatypeValueSpaceValuesCounter valuesCounter; countPossibleValues(indiProcNode,&valuesCounter,calcAlgContext); cint64 disjointCount = getDisjointCount(indiProcNode,calcAlgContext); if (datatypesSpaceValue->isValueSpaceSatisfiabilityCheckingRequired() || !valuesCounter.hasValueAchieved(disjointCount+1)) { datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); calcAlgContext->getUsedProcessingDataBox()->getDistinctValueSpaceSatisfiabilityCheckingQueue(true)->insertProcessIndiviudal(indiProcNode); datatypesSpaceValue->setValueSpaceSatisfiabilityCheckingQueued(true); datatypesSpaceValue->setValueSpaceSatisfiabilityCheckingRequired(true); queued = true; } } } return queued; } bool CDatatypeIndividualProcessNodeHandler::involveDistinctNodeForSatisfiabilityChecking(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext) { CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(false); if (datatypesSpaceValue) { cint64 requiredValueCount = getDisjointCount(indiProcNode,calcAlgContext)+1; CDatatypeValueSpaceValuesCounter valuesCounter; countPossibleValues(indiProcNode,&valuesCounter,calcAlgContext); if (!valuesCounter.hasValueAchieved(requiredValueCount)) { return true; } datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); datatypesSpaceValue->setValueSpaceSatisfiabilityCheckingRequired(false); } return false; } bool CDatatypeIndividualProcessNodeHandler::requiresSatisfiabilityChecking(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext) { CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(false); if (datatypesSpaceValue) { if (datatypesSpaceValue->isValueSpaceSatisfiabilityCheckingRequired()) { cint64 requiredValueCount = getDisjointCount(indiProcNode,calcAlgContext)+1; CDatatypeValueSpaceValuesCounter valuesCounter; countPossibleValues(indiProcNode,&valuesCounter,calcAlgContext); if (!valuesCounter.hasValueAchieved(requiredValueCount)) { return true; } datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); datatypesSpaceValue->setValueSpaceSatisfiabilityCheckingRequired(false); } } return false; } bool CDatatypeIndividualProcessNodeHandler::checkSatisfiability(CIndividualProcessNode* indiProcNode, CPROCESSINGSET* distinctIndividualNodeSet, CCalculationAlgorithmContext* calcAlgContext) { indiProcNode->getDatatypesValueSpaceData(true)->setValueSpaceSatisfiabilityCheckingQueued(false); if (distinctIndividualNodeSet->size() > 1) { CTaskProcessorContext* taskProcessorContext = calcAlgContext->getUsedTaskProcessorContext(); CIndividualProcessNodeVector* indiNodeVector = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); CConcreteOntology* ontology = calcAlgContext->getUsedProcessingDataBox()->getOntology(); CDatatypeValueSpaceTypes* valueSpaceTypes = ontology->getDataBoxes()->getDatatypeValueSpaceTypes(); CDatatypeValueSpaceType* valueSpaceLinker = valueSpaceTypes->getValueSpaceTypeLinker(); CPROCESSINGMAP* sortedDistinctNodeMap = CObjectParameterizingAllocator< CPROCESSINGMAP,CContext* >::allocateAndConstructAndParameterize(taskProcessorContext->getMemoryAllocationManager(),taskProcessorContext); for (CPROCESSINGSET::const_iterator it = distinctIndividualNodeSet->constBegin(), itEnd = distinctIndividualNodeSet->constEnd(); it != itEnd; ++it) { CIndividualProcessNode* distinctIndiNode(*it); cint64 distinctIndiID = distinctIndiNode->getIndividualID(); sortedDistinctNodeMap->insert(distinctIndiID,distinctIndiNode); } CDatatypeValueTestingCollection valueTestingCollection(calcAlgContext); CPROCESSINGHASH* nodeValueAssociationHash = CObjectParameterizingAllocator< CPROCESSINGHASH,CContext* >::allocateAndConstructAndParameterize(taskProcessorContext->getMemoryAllocationManager(),taskProcessorContext); CPROCESSINGHASH* nodeValueTypeAssociationHash = CObjectParameterizingAllocator< CPROCESSINGHASH,CContext* >::allocateAndConstructAndParameterize(taskProcessorContext->getMemoryAllocationManager(),taskProcessorContext); CPROCESSINGMAP::iterator firstValueit = sortedDistinctNodeMap->begin(); cint64 firstIndiNodeID = firstValueit.key(); CIndividualProcessNode* firstIndiNode = firstValueit.value(); sortedDistinctNodeMap->erase(firstValueit); CDatatypeValueSpaceType* firstIndiNodeValueSpaceType = valueSpaceLinker; CDataLiteralValue* firstIndiNextValue = nullptr; CDataLiteralValue* firstIndiLastValue = nullptr; bool foundSatisfiableValues = false; bool moreValuesPossible = true; while (moreValuesPossible && !foundSatisfiableValues) { valueTestingCollection.releaseUsedDataLiteralValues(); CDatatypeValueSpaceType* firstIndiNodeLastValueSpaceType = firstIndiNodeValueSpaceType; bool firstNodeFoundValue = seachNextPossibleDataValue(firstIndiNode,firstIndiNextValue,firstIndiNodeValueSpaceType,firstIndiLastValue,&valueTestingCollection,calcAlgContext); if (firstNodeFoundValue) { if (firstIndiLastValue) { valueTestingCollection.releaseDataLiteralValue(firstIndiLastValue,firstIndiNodeLastValueSpaceType); } firstIndiLastValue = firstIndiNextValue; for (CPROCESSINGMAP::const_iterator it = sortedDistinctNodeMap->constBegin(), itEnd = sortedDistinctNodeMap->constEnd(); it != itEnd; ++it) { cint64 indiNodeID = it.key(); CIndividualProcessNode* indiNode = it.value(); nodeValueAssociationHash->insert(indiNodeID,nullptr); nodeValueTypeAssociationHash->insert(indiNodeID,valueSpaceLinker); } nodeValueAssociationHash->insert(firstIndiNodeID,firstIndiLastValue); nodeValueTypeAssociationHash->insert(firstIndiNodeID,firstIndiNodeValueSpaceType); bool allNodesFoundValue = true; for (CPROCESSINGMAP::const_iterator it = sortedDistinctNodeMap->constBegin(), itEnd = sortedDistinctNodeMap->constEnd(); allNodesFoundValue && it != itEnd; ++it) { valueTestingCollection.releaseUsedDataLiteralValues(); cint64 indiNodeID = it.key(); CIndividualProcessNode* indiNode = it.value(); CDataLiteralValue* nodeLastTestingValue = nodeValueAssociationHash->value(indiNodeID); CDatatypeValueSpaceType* nodeValueSpaceType = nodeValueTypeAssociationHash->value(indiNodeID); CDataLiteralValue* nodeNextTestingValue = nullptr; CDistinctHash* distinctHash = indiNode->getDistinctHash(false); if (distinctHash) { CDistinctIterator distinctIterator = distinctHash->getDistinctIterator(); while (distinctIterator.hasNext()) { cint64 distinctIndiID = distinctIterator.nextDistinctIndividualID(); if (distinctIndiID < indiNodeID && sortedDistinctNodeMap->contains(distinctIndiID)) { CDataLiteralValue* distinctValue = nodeValueAssociationHash->value(distinctIndiID); CDatatypeValueSpaceType* distinctValueSpaceType = nodeValueTypeAssociationHash->value(distinctIndiID); valueTestingCollection.addDataLiteralValueUse(distinctValue,distinctValueSpaceType); } } } CDatatypeValueSpaceType* nodeLastValueSpaceType = nodeValueSpaceType; bool foundValue = seachNextPossibleDataValue(indiNode,nodeNextTestingValue,nodeValueSpaceType,nodeLastTestingValue,&valueTestingCollection,calcAlgContext); if (!foundValue) { allNodesFoundValue = false; } else { if (nodeLastTestingValue) { valueTestingCollection.releaseDataLiteralValue(nodeLastTestingValue,nodeLastValueSpaceType); } nodeValueAssociationHash->insert(indiNodeID,nodeNextTestingValue); nodeValueTypeAssociationHash->insert(indiNodeID,nodeValueSpaceType); } } if (allNodesFoundValue) { foundSatisfiableValues = true; } } else { moreValuesPossible = false; } } if (foundSatisfiableValues) { // mark for all nodes that value space satisfiability is checked for (CPROCESSINGSET::const_iterator it = distinctIndividualNodeSet->constBegin(), itEnd = distinctIndividualNodeSet->constEnd(); it != itEnd; ++it) { CIndividualProcessNode* distinctIndiNode(*it); CDatatypesValueSpaceData* datatypesSpaceValue = distinctIndiNode->getDatatypesValueSpaceData(true); datatypesSpaceValue->setValueSpaceSatisfiabilityCheckingRequired(false); } CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); datatypesSpaceValue->setValueSpaceSatisfiabilityCheckingRequired(false); } else { // create clash CDatatypeDependencyTrackPointCollection clashedDepTrackPointCollection(calcAlgContext->getUsedProcessContext()); for (CPROCESSINGSET::const_iterator it = distinctIndividualNodeSet->constBegin(), itEnd = distinctIndividualNodeSet->constEnd(); it != itEnd; ++it) { CIndividualProcessNode* distinctIndiNode(*it); addValueSpacesDependencies(distinctIndiNode,&clashedDepTrackPointCollection,calcAlgContext); addDistinctDependencies(distinctIndiNode,&clashedDepTrackPointCollection,calcAlgContext); } CClashedDependencyDescriptor* depDesLinker = nullptr; depDesLinker = copyClashedDependencyDescriptors(depDesLinker,clashedDepTrackPointCollection.getClashedDependencyDescriptors(),calcAlgContext); throwDatatypeValueSpaceExclusionClash(depDesLinker,indiProcNode,calcAlgContext); } } return true; } bool CDatatypeIndividualProcessNodeHandler::addDistinctDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext) { bool dependenciesAdded = false; cint64 indiNodeID = indiProcNode->getIndividualID(); CDistinctHash* distinctHash = indiProcNode->getDistinctHash(false); if (distinctHash) { CDistinctIterator distinctIterator = distinctHash->getDistinctIterator(); while (distinctIterator.hasNext()) { CDistinctEdge* distinctEdge = distinctIterator.next(); CDependencyTrackPoint* depTrackPoint = distinctEdge->getDependencyTrackPoint(); dependenciesAdded |= depCollection->addDependency(depTrackPoint); } } return dependenciesAdded; } bool CDatatypeIndividualProcessNodeHandler::seachNextPossibleDataValue(CIndividualProcessNode* indiProcNode, CDataLiteralValue*& nextValue, CDatatypeValueSpaceType*& nextValueSpaceType, CDataLiteralValue* lastValue, CDatatypeValueTestingCollection* valueTestingCollection, CCalculationAlgorithmContext* calcAlgContext) { CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); for (; nextValueSpaceType; nextValueSpaceType = nextValueSpaceType->getNextValueSpaceType()) { CDatatypeValueSpaceData* valueSpaceData = datatypesSpaceValue->getValueSpace(nextValueSpaceType,false); if (!valueSpaceData->isValueSpaceClashed()) { CIndividualProcessNodeValueSpaceHandler* valueSpaceHandler = getValueSpaceHandler(nextValueSpaceType,calcAlgContext); if (valueSpaceHandler->getNextPossibleDataValue(indiProcNode,nextValue,lastValue,valueTestingCollection,calcAlgContext)) { return true; } } } return false; } bool CDatatypeIndividualProcessNodeHandler::countPossibleValues(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceValuesCounter* valuesCounter, CCalculationAlgorithmContext* calcAlgContext) { CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(false); if (!datatypesSpaceValue->isValueSpaceCounted() || datatypesSpaceValue->isValueSpaceCountingRequired()) { datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); datatypesSpaceValue->setValueSpaceCounted(true); datatypesSpaceValue->setValueSpaceCountingRequired(false); CDatatypeValueSpaceValuesCounter* valueSpacesValuesCounter = datatypesSpaceValue->getValuesCounter(); valueSpacesValuesCounter->resetValueCounter(); CConcreteOntology* ontology = calcAlgContext->getUsedProcessingDataBox()->getOntology(); CDatatypeValueSpaceType* valueSpaceTypeLinker = ontology->getDataBoxes()->getDatatypeValueSpaceTypes()->getValueSpaceTypeLinker(); for (CDatatypeValueSpaceType* valueSpaceTypeIt = valueSpaceTypeLinker; valueSpaceTypeIt && !valueSpacesValuesCounter->isInfinite(); valueSpaceTypeIt = valueSpaceTypeIt->getNextValueSpaceType()) { CDatatypeValueSpaceType* valueSpaceType = valueSpaceTypeIt; CIndividualProcessNodeValueSpaceHandler* valueSpaceHandler = getValueSpaceHandler(valueSpaceType,calcAlgContext); valueSpaceHandler->countPossibleValueSpaceValues(indiProcNode,valueSpacesValuesCounter,calcAlgContext); } } bool counted = false; if (valuesCounter) { CDatatypeValueSpaceValuesCounter* valueSpacesValuesCounter = datatypesSpaceValue->getValuesCounter(); counted = valuesCounter->combineWithValueCounter(valueSpacesValuesCounter); } return counted; } bool CDatatypeIndividualProcessNodeHandler::addValueSpacesDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext) { bool dependenciesAdded = false; CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CConcreteOntology* ontology = calcAlgContext->getUsedProcessingDataBox()->getOntology(); for (CDatatypeValueSpaceType* valueSpaceTypeIt = ontology->getDataBoxes()->getDatatypeValueSpaceTypes()->getValueSpaceTypeLinker(); valueSpaceTypeIt; valueSpaceTypeIt = valueSpaceTypeIt->getNextValueSpaceType()) { CDatatypeValueSpaceData* valueSpaceData = datatypesSpaceValue->getValueSpace(valueSpaceTypeIt,false); if (valueSpaceData) { dependenciesAdded = addValueSpaceDependencies(indiProcNode,valueSpaceData,valueSpaceTypeIt,depCollection,calcAlgContext); } } return dependenciesAdded; } bool CDatatypeIndividualProcessNodeHandler::addValueSpaceDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceData* valueSpaceData, CDatatypeValueSpaceType* valueSpaceType, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext) { if (valueSpaceData->isValueSpaceClashed()) { bool depAddeds = false; CClashedDependencyDescriptor* clashedDepDesLinker = valueSpaceData->getClashDependencyDescriptorLinker(); for (CClashedDependencyDescriptor* clashedDepDesIt = clashedDepDesLinker; clashedDepDesIt; clashedDepDesIt = clashedDepDesIt->getNext()) { CDependencyTrackPoint* depTrackPoint = clashedDepDesIt->getDependencyTrackPoint(); depAddeds |= depCollection->addDependency(depTrackPoint); } return depAddeds; } else { CIndividualProcessNodeValueSpaceHandler* valueSpaceHandler = getValueSpaceHandler(valueSpaceType,calcAlgContext); return valueSpaceHandler->addValueSpaceDependencies(indiProcNode,depCollection,calcAlgContext); } return false; } CIndividualProcessNodeValueSpaceHandler* CDatatypeIndividualProcessNodeHandler::getValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType, CCalculationAlgorithmContext* calcAlgContext) { CIndividualProcessNodeValueSpaceHandler* valueSpaceHandler = nullptr; valueSpaceHandler = mValueSpaceHandlerArray[valueSpaceType->getValueSpaceTypeIndex()]; return valueSpaceHandler; } cint64 CDatatypeIndividualProcessNodeHandler::getDisjointCount(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext) { cint64 disjointCount = 0; CDistinctHash* distinctHash = indiProcNode->getDistinctHash(false); if (distinctHash) { disjointCount = distinctHash->getDistinctCount(); } return disjointCount; } bool CDatatypeIndividualProcessNodeHandler::closeValueSpace(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceType* closeValueSpaceType, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { bool valueSpaceClosed = false; CIndividualProcessNodeValueSpaceHandler* valueSpaceHandler = getValueSpaceHandler(closeValueSpaceType,calcAlgContext); if (valueSpaceHandler) { valueSpaceClosed |= valueSpaceHandler->closeValueSpace(indiProcNode,depTrackPoint,calcAlgContext); } return valueSpaceClosed; } bool CDatatypeIndividualProcessNodeHandler::closeOtherValueSpaces(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceType* exceptionValueSpaceType, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { bool valueSpaceClosed = false; CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CConcreteOntology* ontology = calcAlgContext->getUsedProcessingDataBox()->getOntology(); for (CDatatypeValueSpaceType* valueSpaceTypeIt = ontology->getDataBoxes()->getDatatypeValueSpaceTypes()->getValueSpaceTypeLinker(); valueSpaceTypeIt; valueSpaceTypeIt = valueSpaceTypeIt->getNextValueSpaceType()) { if (valueSpaceTypeIt != exceptionValueSpaceType) { valueSpaceClosed |= closeValueSpace(indiProcNode,valueSpaceTypeIt,depTrackPoint,calcAlgContext); } } return valueSpaceClosed; } bool CDatatypeIndividualProcessNodeHandler::testAllValueSpacesClashed(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext) { bool allClashed = true; CConcreteOntology* ontology = calcAlgContext->getUsedProcessingDataBox()->getOntology(); CDatatypeValueSpaceTypes* valueSpaceTypes = ontology->getDataBoxes()->getDatatypeValueSpaceTypes(); CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); for (CDatatypeValueSpaceType* valueSpaceTypeIt = valueSpaceTypes->getValueSpaceTypeLinker(); valueSpaceTypeIt; valueSpaceTypeIt = valueSpaceTypeIt->getNextValueSpaceType()) { CIndividualProcessNodeValueSpaceHandler* valueSpaceHandler = getValueSpaceHandler(valueSpaceTypeIt,calcAlgContext); allClashed &= valueSpaceHandler->testValueSpaceClashed(indiProcNode,calcAlgContext); } if (allClashed) { CClashedDependencyDescriptor* depDesLinker = nullptr; for (CDatatypeValueSpaceType* valueSpaceTypeIt = valueSpaceTypes->getValueSpaceTypeLinker(); valueSpaceTypeIt; valueSpaceTypeIt = valueSpaceTypeIt->getNextValueSpaceType()) { CDatatypeValueSpaceData* valueSpaceData = datatypesSpaceValue->getValueSpace(valueSpaceTypeIt,false); if (valueSpaceData) { depDesLinker = copyClashedDependencyDescriptors(depDesLinker,valueSpaceData->getClashDependencyDescriptorLinker(),calcAlgContext); } } throwDatatypeValueSpaceExclusionClash(depDesLinker,indiProcNode,calcAlgContext); } return allClashed; } void CDatatypeIndividualProcessNodeHandler::throwDatatypeValueSpaceExclusionClash(CClashedDependencyDescriptor* depDesLinker, CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext) { CClashedDatatypeValueSpaceExclusionDescriptor* clashDepLinker = nullptr; for (CClashedDependencyDescriptor* copyDepDesLinkerIt = depDesLinker; copyDepDesLinkerIt; copyDepDesLinkerIt = copyDepDesLinkerIt->getNext()) { CClashedDatatypeValueSpaceExclusionDescriptor* clashDes = CObjectAllocator::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); clashDes->initClashedDatatypeValueSpaceExclusionDescriptor(copyDepDesLinkerIt->getDependencyTrackPoint(),indiProcNode); clashDepLinker = (CClashedDatatypeValueSpaceExclusionDescriptor*)clashDes->append(clashDepLinker); } throw CCalculationClashProcessingException(clashDepLinker); } CClashedDependencyDescriptor* CDatatypeIndividualProcessNodeHandler::createClashedDependencyDescriptor(CClashedDependencyDescriptor* appendDepDesLinker, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { if (depTrackPoint) { CClashedDependencyDescriptor* clashDes = CObjectAllocator::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); clashDes->initClashedDependencyDescriptor(depTrackPoint); clashDes->append(appendDepDesLinker); return clashDes; } else { return appendDepDesLinker; } } CClashedDependencyDescriptor* CDatatypeIndividualProcessNodeHandler::copyClashedDependencyDescriptors(CClashedDependencyDescriptor* appendDepDesLinker, CClashedDependencyDescriptor* copyDepDesLinker, CCalculationAlgorithmContext* calcAlgContext) { CClashedDependencyDescriptor* depDesLinker = appendDepDesLinker; for (CClashedDependencyDescriptor* copyDepDesLinkerIt = copyDepDesLinker; copyDepDesLinkerIt; copyDepDesLinkerIt = copyDepDesLinkerIt->getNext()) { depDesLinker = createClashedDependencyDescriptor(depDesLinker,copyDepDesLinkerIt->getDependencyTrackPoint(),calcAlgContext); } return depDesLinker; } CConceptDescriptor* CDatatypeIndividualProcessNodeHandler::triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, cint64& remainingRequiredValuesCount, CDatatypeValueSpaceData* valueSpaceData, CDatatypeValueSpaceType* valueSpaceType, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext) { CConceptDescriptor* triggerConcepts = nullptr; CIndividualProcessNodeValueSpaceHandler* valueSpaceHandler = getValueSpaceHandler(valueSpaceType,calcAlgContext); triggerConcepts = valueSpaceHandler->triggerValueSpaceConcepts(indiProcNode,appendConceptLinker,remainingRequiredValuesCount,depCollection,calcAlgContext); return triggerConcepts; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationAlgorithmContextBase.h0000644000175000017500000001332012520551002031716 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONALGORITHMCONTEXTBASE_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONALGORITHMCONTEXTBASE_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" // Other includes #include "Scheduler/CTaskContext.h" #include "Reasoner/Kernel/Process/CProcessContext.h" #include "Reasoner/Kernel/Task/CConsistenceTaskData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Strategy; using namespace Task; namespace Algorithm { /*! * * \class CCalculationAlgorithmContextBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationAlgorithmContextBase : public CCalculationAlgorithmContext { // public methods public: //! Constructor CCalculationAlgorithmContextBase(); //! Destructor virtual ~CCalculationAlgorithmContextBase(); CCalculationAlgorithmContextBase* initCalculationAlgorithmContext(CTaskProcessorContext* taskHandleContext); CCalculationAlgorithmContextBase* initCalculationAlgorithmContext(CTaskProcessorContext* taskHandleContext, CConceptProcessingPriorityStrategy* conceptPriorityStrategy, CIndividualProcessingPriorityStrategy* individualPriorityStrategy, CTaskProcessingPriorityStrategy* taskPriorityStrategy, CUnsatisfiableCacheRetrievalStrategy* unsatCacheRetrievalStrategy, CIndividualNodeManager* indiNodeManager, CClashDescriptorFactory* clashDesFactory, CDependencyFactory* depFactory, CUnsatisfiableCacheHandler* unsatCacheHandler, CSatisfiableExpanderCacheHandler* satExpCacheHandler, CSaturationNodeExpansionCacheHandler* satNodeExpCacheHandler); CCalculationAlgorithmContextBase* initTaskProcessContext(CProcessContext* processContext, CSatisfiableCalculationTask* satCalcTask); virtual CProcessTagger* getProcessTagger(); virtual CProcessContext* getProcessContext(); virtual CMemoryAllocationManager* getProcessTaskMemoryAllocationManager(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); virtual CTaskHandleMemoryAllocationManager* getTemporaryMemoryAllocationManager(); virtual CConceptProcessingPriorityStrategy* getConceptPriorityStrategy(); virtual CIndividualProcessingPriorityStrategy* getIndividualPriorityStrategy(); virtual CProcessingDataBox* getProcessingDataBox(); virtual CSatisfiableCalculationTask* getSatisfiableCalculationTask(); virtual CTaskProcessorContext* getTaskProcessorContext(); virtual CTaskProcessingPriorityStrategy* getTaskPriorityStrategy(); virtual CProcessingStatisticGathering* getProcessingStatisticsGathering(); virtual CBranchTreeNode* getBranchTreeNode(); virtual CBranchTreeNode* getNewBranchTreeNode(); virtual CDependencyNode* getBaseDependencyNode(); virtual CUnsatisfiableCacheHandler* getUnsatisfiableCacheHandler(); virtual CIndividualNodeManager* getIndividualNodeManager(); virtual CClashDescriptorFactory* getClashDescriptorFactory(); virtual CUnsatisfiableCacheRetrievalStrategy* getUnsatisfiableCacheRetrievalStrategy(); virtual CDependencyFactory* getDependencyFactory(); virtual CSatisfiableExpanderCacheHandler* getSatisfiableExpanderCacheHandler(); virtual CSaturationNodeExpansionCacheHandler* getSaturationNodeExpansionCacheHandler(); // protected methods protected: // protected variables protected: CTaskHandleMemoryAllocationManager* mTempMemMan; CMemoryAllocationManager* mPrTaskMemMan; CProcessTagger* mProcessTagger; CProcessContext* mProcessContext; CConceptProcessingPriorityStrategy* mConceptPriorityStrategy; CIndividualProcessingPriorityStrategy* mIndividualPriorityStrategy; CTaskProcessingPriorityStrategy* mTaskPriorityStrategy; CProcessingDataBox* mProcessingDataBox; CSatisfiableCalculationTask* mSatCalcTask; CTaskProcessorContext* mTaskProcessorContext; CProcessingStatisticGathering* mProcStatGath; CBranchTreeNode* mBranchTreeNode; CDependencyNode* mBaseDepNode; CIndividualNodeManager* mIndiNodeManager; CUnsatisfiableCacheHandler* mUnsatCacheHandler; CClashDescriptorFactory* mClashDescriptorFactory; CUnsatisfiableCacheRetrievalStrategy* mUnsatCachRetStrategy; CDependencyFactory* mDepFactory; CSatisfiableExpanderCacheHandler* mSatExpCacheHandler; CSaturationNodeExpansionCacheHandler* mSatNodeExpCacheHandler; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONALGORITHMCONTEXTBASE_H ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationTableauApproximationSaturationTaskHandleAlgorithm.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationTableauApproximationSatu0000644000175000017500000137133412574303130032412 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationTableauApproximationSaturationTaskHandleAlgorithm.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CCalculationTableauApproximationSaturationTaskHandleAlgorithm::CCalculationTableauApproximationSaturationTaskHandleAlgorithm(CSaturationNodeBackendAssociationCacheHandler* backendAssCaceHandler) { mProcessingDataBox = nullptr; mCalcAlgContext = nullptr; mBackendAssCaceHandler = backendAssCaceHandler; mProcessingDataBox = nullptr; mCalcAlgContext = nullptr; mPosJumpFuncVec = &mPosTableauRuleJumpFuncVec[mRuleFuncCount/2]; mNegJumpFuncVec = &mNegTableauRuleJumpFuncVec[mRuleFuncCount/2]; for (cint64 i = 0; i < mRuleFuncCount; ++i) { mPosTableauRuleJumpFuncVec[i] = nullptr; mNegTableauRuleJumpFuncVec[i] = nullptr; } mPosJumpFuncVec[CCDATATYPE] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyDATATYPERule; //mNegJumpFuncVec[CCDATATYPE] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyNotDATATYPERule; mPosJumpFuncVec[CCBOTTOM] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyBOTTOMRule; mPosJumpFuncVec[CCATOM] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyNONERule; mPosJumpFuncVec[CCTOP] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCAND] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCAQAND] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCIMPLAQAND] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCBRANCHAQAND] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCSUB] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCALL] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyALLRule; mPosJumpFuncVec[CCAQALL] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyALLRule; mPosJumpFuncVec[CCSOME] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applySOMERule; mPosJumpFuncVec[CCAQSOME] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applySOMERule; mPosJumpFuncVec[CCAQCHOOCE] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyAutomatChooseRule; mPosJumpFuncVec[CCIMPLTRIG] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCBRANCHTRIG] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCIMPLALL] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyALLRule; mPosJumpFuncVec[CCBRANCHALL] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyALLRule; mPosJumpFuncVec[CCBRANCHAQALL] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyALLRule; mPosJumpFuncVec[CCIMPLAQALL] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyALLRule; mPosJumpFuncVec[CCOR] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyORRule; mPosJumpFuncVec[CCIMPL] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyIMPLICATIONRule; mPosJumpFuncVec[CCBRANCHIMPL] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyIMPLICATIONRule; mPosJumpFuncVec[CCEQCAND] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyEQCANDRule; mPosJumpFuncVec[CCEQ] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyANDRule; mPosJumpFuncVec[CCSELF] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applySELFRule; mPosJumpFuncVec[CCATLEAST] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyATLEASTRule; mNegJumpFuncVec[CCATMOST] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyATLEASTRule; mPosJumpFuncVec[CCATMOST] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyATMOSTRule; mNegJumpFuncVec[CCATLEAST] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyATMOSTRule; mNegJumpFuncVec[CCOR] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyANDRule; mNegJumpFuncVec[CCALL] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applySOMERule; mNegJumpFuncVec[CCSOME] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyALLRule; mNegJumpFuncVec[CCAQCHOOCE] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyAutomatChooseRule; mNegJumpFuncVec[CCAND] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyORRule; mNegJumpFuncVec[CCEQ] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyORRule; mNegJumpFuncVec[CCSUB] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyNONERule; mNegJumpFuncVec[CCATOM] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyNONERule; mPosJumpFuncVec[CCVALUE] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyVALUERule; mPosJumpFuncVec[CCNOMINAL] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyNOMINALRule; mPosJumpFuncVec[CCDATALITERAL] = &CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyDATALITERALRule; mLastConfig = nullptr; mAppliedALLRuleCount = 0; mAppliedSOMERuleCount = 0; mAppliedANDRuleCount = 0; mAppliedORRuleCount = 0; mAppliedATLEASTRuleCount = 0; mAppliedATMOSTRuleCount = 0; mAppliedTOTALRuleCount = 0; mAddedALLConcepts = 0; mAddedSOMEConcepts = 0; mAddedIMPLConcepts = 0; mAddedTRIGGConcepts = 0; mAddedSUBConcepts = 0; mAddedELSEConcepts = 0; mSubstituitedIndiNodeCount = 0; mCopiedIndiNodeCount = 0; mALLSuccExtInitializedCount = 0; mDirectUpdatedStatusIndiNodeCount = 0; mIndirectUpdatedStatusIndiNodeCount = 0; mDisjunctionInitializedSkippedCount = 0; mDebugTestingSaturationTask = nullptr; mConfImplicationAddingSkipping = true; mConfForceAllConceptInsertion = false; mConfDebuggingWriteData = false; mConfForceAllCopyInsteadOfSubstituition = false; mConfAddCriticalConceptsToQueues = false; mConfDirectlyCriticalToInsufficient = true; mConfCheckCriticalConcepts = false; mConfALLConceptsExtensionProcessing = false; mConfFUNCTIONALConceptsExtensionProcessing = false; mConfConceptsExtensionProcessing = false; mConfResolveOperandConceptSize = 100; mConfReferredNodeManyConceptCount = 500; mConfManyConceptReferredNodeCountProcessLimit = 2; mConfReferredNodeConceptCountProcessLimit = 1500; mConfReferredNodeUnprocessedCountProcessLimit = 1; mConfReferredNodeCheckingDepth = 5; mConfCopyNodeFromTopIndividualForManyConcepts = true; mConfForceManyConceptSaturation = false; mWroteFunctionalSuccPredMergingDebugString = false; mConfDetailedMergingTestForATMOSTCriticalTesting = true; mConfSimpleMergingTestForATMOSTCriticalTesting = true; } CCalculationTableauApproximationSaturationTaskHandleAlgorithm::~CCalculationTableauApproximationSaturationTaskHandleAlgorithm() { } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::readCalculationConfig(CSatisfiableCalculationTask* satCalcTask) { CCalculationConfigurationExtension *config = satCalcTask->getCalculationConfiguration(); if (config != mLastConfig) { if (config) { CConcreteOntology* ontology = satCalcTask->getProcessingDataBox()->getOntology(); COntologyStructureSummary* ontStructureSummary = ontology->getStructureSummary(); mConfForceAllConceptInsertion = false; mConfForceAllCopyInsteadOfSubstituition = false; mConfImplicationAddingSkipping = true; mConfDebuggingWriteData = config->isDebuggingWriteDataActivated(); if (!ontStructureSummary || !ontStructureSummary->hasOnlyELConceptClasses() || ontology->getABox()->getIndividualCount() > 0) { mConfForceAllConceptInsertion = true; mConfImplicationAddingSkipping = false; } mConfDirectlyCriticalToInsufficient = config->isSaturationDirectCriticalToInsufficientActivated(); mConfAddCriticalConceptsToQueues = config->isSaturationCriticalConceptTestingActivated(); mConfCheckCriticalConcepts = config->isSaturationCriticalConceptTestingActivated(); mConfConceptsExtensionProcessing = config->isSaturationSuccessorExtensionActivated(); mConfNominalProcessing = config->isNominalSaturationActivated(); mConfReferredNodeManyConceptCount = config->getSaturationReferredNodeManyConceptCount(); mConfManyConceptReferredNodeCountProcessLimit = config->getSaturationManyConceptReferredNodeCountProcessLimit(); mConfReferredNodeConceptCountProcessLimit = config->getSaturationReferredNodeConceptCountProcessLimit(); mConfReferredNodeUnprocessedCountProcessLimit = config->getSaturationReferredNodeUnprocessedCountProcessLimit(); mConfReferredNodeCheckingDepth = config->getSaturationReferredNodeCheckingDepth(); } else { mConfForceAllCopyInsteadOfSubstituition = false; mConfForceAllConceptInsertion = true; mConfImplicationAddingSkipping = true; mConfNominalProcessing = true; mConfDebuggingWriteData = false; mConfDirectlyCriticalToInsufficient = true; mConfAddCriticalConceptsToQueues = false; mConfCheckCriticalConcepts = false; mConfConceptsExtensionProcessing = false; mConfReferredNodeManyConceptCount = 500; mConfManyConceptReferredNodeCountProcessLimit = 2; mConfReferredNodeConceptCountProcessLimit = 1500; mConfReferredNodeUnprocessedCountProcessLimit = 1; mConfReferredNodeCheckingDepth = 5; } mConfALLConceptsExtensionProcessing = mConfConceptsExtensionProcessing; mConfFUNCTIONALConceptsExtensionProcessing = mConfConceptsExtensionProcessing; mLastConfig = config; } //mConfForceAllConceptInsertion = true; } CCalculationAlgorithmContextBase* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::createCalculationAlgorithmContext(CTaskProcessorContext *processorContext, CProcessContext* processContext, CSatisfiableCalculationTask* satCalcTask) { CCalculationAlgorithmContextBase* calcAlgContext = CObjectAllocator< CCalculationAlgorithmContextBase >::allocateAndConstruct(processContext->getUsedMemoryAllocationManager()); calcAlgContext->initTaskProcessContext(processContext,satCalcTask); calcAlgContext->initCalculationAlgorithmContext(processorContext); return calcAlgContext; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::handleTask(CTaskProcessorContext *processorContext, CTask* task) { //lastBranchingMergingProcRest = nullptr; CTaskHandleMemoryAllocationManager* processorMemoryManager = processorContext->getTaskHandleMemoryAllocationManager(); CTaskProcessorCommunicator* processorCommunicator = processorContext->getTaskProcessorCommunicator(); CTaskHandleMemoryAllocationManager* taskHandleMemMan = processorContext->getTaskHandleMemoryAllocationManager(); taskHandleMemMan->releaseAllMemory(); CSatisfiableCalculationTask* satCalcTask = dynamic_cast(task); if (satCalcTask) { if (!processorCommunicator->verifyContinueTaskProcessing(satCalcTask)) { if (!satCalcTask->getTaskStatus()->isProcessable()) { processorCommunicator->communicateTaskComplete(satCalcTask); return false; } else { // continue later return true; } } readCalculationConfig(satCalcTask); mInsufficientALLCount = 0; mInsufficientATMOSTCount = 0; mCachedCompletionGraphLoaded = false; mRepresentativeDataLoaded = false; mCachedCompletionGraphMissing = false; mDetCachedCGIndiVector = nullptr; mNonDetCachedCGIndiVector = nullptr; mNonDetConsistencyCG = false; mDetConsistencyCG = false; CProcessContext* processContext = satCalcTask->getProcessContext(processorContext); CCalculationAlgorithmContextBase* calcAlgContext = createCalculationAlgorithmContext(processorContext,processContext,satCalcTask); mCalcAlgContext = calcAlgContext; mProcessingDataBox = satCalcTask->getProcessingDataBox(); bool clashed = false; bool satisfiable = false; bool completed = false; bool paused = false; bool error = false; cint64 errorCode = 0; CProcessTagger* processTagger = calcAlgContext->getUsedProcessTagger(); CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CNodeSwitchHistory* nodeSwitchHistory = processingDataBox->getNodeSwitchHistory(true); cint64 indiProcessedCount = 0; CIndividualSaturationProcessNode* indiProcSatNode = nullptr; CConceptProcessDescriptor* conProcDes = nullptr; cint64 processRuleToTaskProcessingVerificationCount = 10; cint64 remainProcessRuleToTaskProcessingVerification = processRuleToTaskProcessingVerificationCount; bool separatedSaturation = false; bool hasFirstProcessedNodeID = false; cint64 firstProcessedNodeID = 0; CIndividualSaturationProcessNode* lastindiProcSatNode = nullptr; try { STATINC(TASKPROCESSCHANGECOUNT,calcAlgContext); continueNominalDelayedIndividualNodeProcessing(mProcessingDataBox,calcAlgContext); bool wroteExtensionProcDebugString = false; while (hasRemainingExtensionProcessingNodes(mProcessingDataBox,calcAlgContext)) { while (hasRemainingProcessingNodes(mProcessingDataBox,calcAlgContext)) { while (mProcessingDataBox->hasIndividualSaturationProcessNodeLinker()) { CIndividualSaturationProcessNodeLinker* indiProcessSaturationNodeLinker = mProcessingDataBox->takeIndividualSaturationProcessNodeLinker(); CIndividualSaturationProcessNode* indiProcSatNode = indiProcessSaturationNodeLinker->getData(); if (indiProcSatNode->isSeparated()) { separatedSaturation = true; } if (!hasFirstProcessedNodeID || indiProcSatNode->getIndividualID() < firstProcessedNodeID) { hasFirstProcessedNodeID = true; firstProcessedNodeID = indiProcSatNode->getIndividualID(); } lastindiProcSatNode = indiProcSatNode; STATINC(INDIVIDUALNODESWITCHCOUNT,calcAlgContext); ++indiProcessedCount; KONCLUCE_TASK_ALGORITHM_SATURATION_SATURATION_MODEL_STRING_INSTRUCTION(mRuleBeginDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext)); if (individualNodeInitializing(indiProcSatNode,calcAlgContext)) { CConceptSaturationProcessLinker* conceptSaturationProcessLinker = indiProcSatNode->takeConceptSaturationProcessLinker(); while (conceptSaturationProcessLinker) { STATINC(RULEAPPLICATIONCOUNT,calcAlgContext); KONCLUCE_TASK_ALGORITHM_SATURATION_SATURATION_MODEL_STRING_INSTRUCTION(mRuleBeginDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext)); applyTableauSaturationRule(indiProcSatNode,conceptSaturationProcessLinker); KONCLUCE_TASK_ALGORITHM_SATURATION_SATURATION_MODEL_STRING_INSTRUCTION(mRuleEndDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext)); releaseConceptSaturationProcessLinker(conceptSaturationProcessLinker,calcAlgContext); conceptSaturationProcessLinker = indiProcSatNode->takeConceptSaturationProcessLinker(); } } indiProcessSaturationNodeLinker->clearProcessingQueued(); individualNodeConclusion(indiProcSatNode,calcAlgContext); //if ((indiProcessedCount % 100000) == 0) { // writeIndividualSaturationStatistics(calcAlgContext); //} } if (mProcessingDataBox->hasIndividualDisjunctCommonConceptExtractProcessLinker()) { CIndividualSaturationProcessNodeLinker* indiDisjCommonConExtProcessLinker = mProcessingDataBox->takeIndividualDisjunctCommonConceptExtractProcessLinker(); indiDisjCommonConExtProcessLinker->setProcessingQueued(false); CIndividualSaturationProcessNode* indiProcSatNode = indiDisjCommonConExtProcessLinker->getData(); lastindiProcSatNode = indiProcSatNode; STATINC(INDIVIDUALNODESWITCHCOUNT,calcAlgContext); ++indiProcessedCount; if (individualNodeInitializing(indiProcSatNode,calcAlgContext)) { updateExtractDisjunctCommonConcept(indiProcSatNode,calcAlgContext); } individualNodeConclusion(indiProcSatNode,calcAlgContext); } } //if (mConfDebuggingWriteData && !wroteExtensionProcDebugString) { // wroteExtensionProcDebugString = true; // mEndSaturationDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // QString fileName("saturation-model-ext-proc.txt"); // QFile tmpFile(fileName); // if (tmpFile.open(QIODevice::WriteOnly)) { // tmpFile.write(mEndSaturationDebugIndiModelString.replace("
","").replace("

","\n").toLocal8Bit()); // tmpFile.close(); // } //} processNextSuccessorExtensions(calcAlgContext); } //if (mConfDebuggingWriteData) { // wroteExtensionProcDebugString = true; // mEndSaturationDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // QString fileName("saturation-model-bc.txt"); // QFile tmpFile(fileName); // if (tmpFile.open(QIODevice::WriteOnly)) { // tmpFile.write(mEndSaturationDebugIndiModelString.replace("
","").replace("

","\n").toLocal8Bit()); // tmpFile.close(); // } //} if (mConfCheckCriticalConcepts && hasNextCriticalConcepts(mCalcAlgContext)) { while (hasNextCriticalConcepts(mCalcAlgContext)) { checkNextCriticalConcepts(mCalcAlgContext); } } completeSaturatedIndividualNodes(mProcessingDataBox,mCalcAlgContext); if (mConfDebuggingWriteData) { writeIndividualSaturationStatistics(calcAlgContext); mEndSaturationDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); QString fileName("saturation-model.txt"); if (separatedSaturation) { fileName = QString("saturation-model-individuals-%1.txt").arg(firstProcessedNodeID); } QFile tmpFile(fileName); if (tmpFile.open(QIODevice::WriteOnly)) { tmpFile.write(mEndSaturationDebugIndiModelString.replace("
","").replace("

","\n").toLocal8Bit()); tmpFile.close(); } } satisfiable = true; //testRelevantConceptRoleRatio(calcAlgContext); } catch (const CCalculationErrorProcessingException& calcErrorProcException) { if (calcErrorProcException.hasError()) { error = true; errorCode = (cint64)calcErrorProcException.getErrorCode(); LOG(ERROR,"::Konclude::Reasoner::Kernel::Algorithm::TableauSaturationAlgorihm",logTr("Error occured, computation stopped."),this); } } catch (const CMemoryAllocationException& memAllocException) { error = true; errorCode = 2; } catch (...) { error = true; errorCode = 3; } CBooleanTaskResult* satResult = satCalcTask->getSatisfiableCalculationTaskResult(); if (clashed) { if (!satResult->hasResult()) { satResult->installResult(false); } completed = true; } if (satisfiable) { STATINC(ROOTTASKSATISFIABLECOUNT,calcAlgContext); //mSubsumAnalyser.analyseSatisfiableTask(satCalcTask,calcAlgContext); mSatTaskSaturationIndiAnalyser.analyseSatisfiableTask(satCalcTask,mCalcAlgContext); mSatTaskSaturationPreyAnalyser.analyseSatisfiableTask(satCalcTask,mCalcAlgContext); tryAssociateIndividualNodesWithBackendCache(satCalcTask,mCalcAlgContext); //testInsufficientIndividuls(mCalcAlgContext); satResult->installResult(true); completed = true; } if (error) { satCalcTask->getTaskStatus()->setError(error,errorCode); processorCommunicator->communicateTaskError(satCalcTask); return false; } if (completed) { processorCommunicator->communicateTaskComplete(satCalcTask); return false; } return true; } return false; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::writeIndividualSaturationStatistics(CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNodeVector* indiVec = calcAlgContext->getProcessingDataBox()->getIndividualSaturationProcessNodeVector(false); cint64 insufficientCount = 0; QFile tmpFile("saturation-statistics.txt"); if (tmpFile.open(QIODevice::WriteOnly)) { QString headerString = QString("IndividualID\tIndividualName\tTotalCount\tConceptCount\tTriggerCount\tRoleBackConnectionCount\tRoleBackPropagationCount\tRoleBackLinkedCount\r\n"); tmpFile.write(headerString.toUtf8()); if (indiVec) { cint64 indiCount = indiVec->getItemCount(); for (cint64 i = 0; i < indiCount; ++i) { CIndividualSaturationProcessNode* indi = indiVec->getData(i); if (indi) { QString indiName = getDebugIndividualConceptName(indi,calcAlgContext); if (indiName == "") { indiName = "-"; } cint64 indiID = indi->getIndividualID(); cint64 conCount = 0; cint64 totalCount = 0; cint64 implCount = 0; cint64 roleBackCount = 0; cint64 roleBackPropCount = 0; cint64 roleBackLinkCount = 0; QString indiDirectFlags = generateStatusFlagsStringList(indi->getDirectStatusFlags(),calcAlgContext).join(","); QString indiIndirectFlags = generateStatusFlagsStringList(indi->getIndirectStatusFlags(),calcAlgContext).join(","); CReapplyConceptSaturationLabelSet* labelConSet = indi->getReapplyConceptSaturationLabelSet(false); if (labelConSet) { conCount = labelConSet->getConceptCount(); totalCount = labelConSet->getTotalCount(); implCount = totalCount-conCount; } CRoleBackwardSaturationPropagationHash* roleBackPropHash = indi->getRoleBackwardPropagationHash(false); if (roleBackPropHash) { CPROCESSHASH* rolePropHash = roleBackPropHash->getRoleBackwardPropagationDataHash(); roleBackCount = rolePropHash->size(); for (CPROCESSHASH::const_iterator rolePropHashIt = rolePropHash->constBegin(), rolePropHashEndIt = rolePropHash->constEnd(); rolePropHashIt != rolePropHashEndIt; ++rolePropHashIt) { CRole* role = rolePropHashIt.key(); const CRoleBackwardSaturationPropagationHashData& roleBackData = rolePropHashIt.value(); for (CBackwardSaturationPropagationLink* linkLinkerIt = roleBackData.mLinkLinker; linkLinkerIt; linkLinkerIt = linkLinkerIt->getNext()) { ++roleBackLinkCount; } for (CBackwardSaturationPropagationReapplyDescriptor* reapDesIt = roleBackData.mReapplyLinker; reapDesIt; reapDesIt = reapDesIt->getNext()) { ++roleBackPropCount; } } } QString indiString = QString("%1\t%2\t%3\t%4\t%5\t%6\t%7\t%8\t").arg(indiID).arg(indiName).arg(totalCount).arg(conCount).arg(implCount).arg(roleBackCount).arg(roleBackPropCount).arg(roleBackLinkCount); indiString += QString("%1\t%2\r\n").arg(indiDirectFlags).arg(indiIndirectFlags); tmpFile.write(indiString.toUtf8()); } } } tmpFile.close(); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::testInsufficientIndividuls(CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNodeVector* indiVec = calcAlgContext->getProcessingDataBox()->getIndividualSaturationProcessNodeVector(false); cint64 insufficientCount = 0; if (indiVec) { cint64 indiCount = indiVec->getItemCount(); for (cint64 i = 0; i < indiCount; ++i) { CIndividualSaturationProcessNode* indi = indiVec->getData(i); if (indi) { CIndividual* nominalIndi = indi->getNominalIndividual(); if (nominalIndi) { if (indi->getIndirectStatusFlags()->hasInsufficientFlag()) { ++insufficientCount; } } } } } if (insufficientCount > 0) { bool bug = true; } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::tryAssociateIndividualNodesWithBackendCache(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* procDataBox = statCalcTask->getProcessingDataBox(); CIndividualSaturationProcessNodeLinker* indiSaturationAnalysingNodeLinker = procDataBox->getIndividualSaturationAnalysationNodeLinker(); if (indiSaturationAnalysingNodeLinker) { for (CIndividualSaturationProcessNodeLinker* indiSaturationAnalysingNodeLinkerIt = indiSaturationAnalysingNodeLinker; indiSaturationAnalysingNodeLinkerIt; indiSaturationAnalysingNodeLinkerIt = indiSaturationAnalysingNodeLinkerIt->getNext()) { CIndividualSaturationProcessNode* satIndiNode = indiSaturationAnalysingNodeLinkerIt->getProcessingIndividual(); CIndividualSaturationProcessNodeStatusFlags* indStatFlags = satIndiNode->getIndirectStatusFlags(); if (indStatFlags->hasClashedFlag()) { return; } } mBackendAssCaceHandler->tryAssociateNodesWithBackendCache(indiSaturationAnalysingNodeLinker,calcAlgContext); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::testRelevantConceptRoleRatio(CCalculationAlgorithmContextBase* calcAlgContext) { cint64 totalConceptCount = 0; cint64 relevantConceptCount = 0; cint64 totalRoleCount = 0; cint64 relevantRoleCount = 0; CIndividualSaturationProcessNodeVector* indiVec = calcAlgContext->getProcessingDataBox()->getIndividualSaturationProcessNodeVector(false); if (indiVec) { cint64 indiCount = indiVec->getItemCount(); for (cint64 i = 0; i < indiCount; ++i) { CIndividualSaturationProcessNode* indi = indiVec->getData(i); if (indi) { CReapplyConceptSaturationLabelSet* conSet = indi->getReapplyConceptSaturationLabelSet(false); if (conSet) { CConceptSaturationDescriptor* conDesIt = conSet->getConceptSaturationDescriptionLinker(); while (conDesIt) { bool relevantFlag = false; CConceptSaturationDescriptor* conDes = conDesIt; CConcept* concept = conDes->getConcept(); CConceptProcessData* conProData = (CConceptProcessData*)concept->getConceptData(); if (conProData) { if (conProData->hasInferRelevantFlag()) { relevantFlag = true; } } ++totalConceptCount; if (relevantFlag) { ++relevantConceptCount; } conDesIt = conDesIt->getNextConceptDesciptor(); } } CRoleBackwardSaturationPropagationHash* roleBackSatPropHash = indi->getRoleBackwardPropagationHash(false); if (roleBackSatPropHash) { CPROCESSHASH* backPropDataHash = roleBackSatPropHash->getRoleBackwardPropagationDataHash(); for (CPROCESSHASH::const_iterator it = backPropDataHash->constBegin(), itEnd = backPropDataHash->constEnd(); it != itEnd; ++it) { CRole* role = it.key(); const CRoleBackwardSaturationPropagationHashData& hashData = it.value(); bool relevantFlag = false; CRoleProcessData* roleProData = (CRoleProcessData*)role->getRoleData(); if (roleProData) { relevantFlag = roleProData->hasInferRelevantFlag(); } for (CBackwardSaturationPropagationLink* linkLinker = hashData.mLinkLinker; linkLinker; linkLinker = linkLinker->getNext()) { ++totalRoleCount; if (relevantFlag) { ++relevantRoleCount; } } } } } } } } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::hasRemainingExtensionProcessingNodes(CProcessingDataBox* processingDataBox, CCalculationAlgorithmContextBase* calcAlgContext) { if (hasRemainingProcessingNodes(processingDataBox,calcAlgContext)) { return true; } CSaturationSuccessorExtensionIndividualNodeProcessingQueue* extProIndiQueue = processingDataBox->getSaturationSucessorExtensionIndividualNodeProcessingQueue(false); if (extProIndiQueue && !extProIndiQueue->isEmpty()) { return true; } return false; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::continueNominalDelayedIndividualNodeProcessing(CProcessingDataBox* processingDataBox, CCalculationAlgorithmContextBase* calcAlgContext) { bool nominalDelayedIndividualNodeProcessingContinued = false; if (processingDataBox->hasNominalDelayedIndividualSaturationProcessNodeLinker()) { if (isConsistenceDataAvailable(calcAlgContext)) { while (processingDataBox->hasNominalDelayedIndividualSaturationProcessNodeLinker()) { CIndividualSaturationProcessNodeLinker* nominalDelayedIndSatProcNodeLinker = processingDataBox->takeNominalDelayedIndividualSaturationProcessNodeLinker(); CIndividualSaturationProcessNode* indiProcessNode = nominalDelayedIndSatProcNodeLinker->getProcessingIndividual(); nominalDelayedIndSatProcNodeLinker->setProcessingQueued(false); CCriticalSaturationConceptTypeQueues* criticalConceptQueues = indiProcessNode->getCriticalConceptTypeQueues(false); if (criticalConceptQueues) { if (criticalConceptQueues->hasCriticalSaturationConceptsQueued()) { CCriticalIndividualNodeProcessingQueue* criticalIndNodProcQueue = processingDataBox->getSaturationCriticalIndividualNodeProcessingQueue(true); criticalIndNodProcQueue->insertProcessIndiviudal(indiProcessNode); criticalConceptQueues->setProcessNodeQueued(true); } } CSaturationIndividualNodeNominalHandlingData* nominalHandlingData = indiProcessNode->getNominalHandlingData(false); if (nominalHandlingData) { if (nominalHandlingData->getDelayedNominalConceptSaturationProcessLinker()) { while (nominalHandlingData->getDelayedNominalConceptSaturationProcessLinker()) { CConceptSaturationProcessLinker* delConSatProLinker = nominalHandlingData->takeDelayedNominalConceptSaturationProcessLinker(); delConSatProLinker->clearNext(); indiProcessNode->addConceptSaturationProcessLinker(delConSatProLinker); } addIndividualToProcessingQueue(indiProcessNode,calcAlgContext); } } indiProcessNode->getIndividualSaturationCompletionNodeLinker(true)->setProcessingQueued(false); addIndividualToCompletionQueue(indiProcessNode,calcAlgContext); nominalDelayedIndividualNodeProcessingContinued = true; } calcAlgContext->getUsedProcessingDataBox()->setDelayedNominalProcessingOccured(false); } } return nominalDelayedIndividualNodeProcessingContinued; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::completeSaturatedIndividualNodes(CProcessingDataBox* processingDataBox, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 completedIndividualCount = 0; if (processingDataBox->hasIndividualSaturationCompletionNodeLinker()) { while (processingDataBox->hasIndividualSaturationCompletionNodeLinker()) { CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker = processingDataBox->takeIndividualSaturationCompletionNodeLinker(); CIndividualSaturationProcessNode* indiProcessNode = indiProcessNodeLinker->getProcessingIndividual(); bool completeIndividual = true; if (indiProcessNode->getIndirectStatusFlags()->hasMissedABoxConsistencyFlag()) { if (!isConsistenceDataAvailable(calcAlgContext)) { completeIndividual = false; processingDataBox->addNominalDelayedIndividualSaturationProcessNodeLinker(indiProcessNodeLinker); if (indiProcessNode->getReapplyConceptSaturationLabelSet(false)) { indiProcessNode->getReapplyConceptSaturationLabelSet(false)->setLastNominalIndependentConceptSaturationDescriptorLinker(indiProcessNode->getReapplyConceptSaturationLabelSet(false)->getConceptSaturationDescriptionLinker()); } } } if (completeIndividual) { completedIndividualCount++; indiProcessNode->setCompleted(true); } } } return completedIndividualCount > 0; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::hasRemainingProcessingNodes(CProcessingDataBox* processingDataBox, CCalculationAlgorithmContextBase* calcAlgContext) { if (processingDataBox->hasIndividualSaturationProcessNodeLinker() || processingDataBox->hasIndividualDisjunctCommonConceptExtractProcessLinker()) { return true; } return false; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::individualNodeInitializing(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (!indiProcSatNode->isInitialized()) { initializeInitializationConcepts(indiProcSatNode,calcAlgContext); initializeRoleAssertions(indiProcSatNode,calcAlgContext); indiProcSatNode->setInitialized(true); if (indiProcSatNode->getNominalIndividual() && calcAlgContext->getSatisfiableCalculationTask()->getSaturationIndividualsAnalysationObserver()) { CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CIndividualSaturationProcessNodeLinker* indiProcessNodeLinker = CObjectAllocator< CIndividualSaturationProcessNodeLinker >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); indiProcessNodeLinker->initProcessNodeLinker(indiProcSatNode,true); processingDataBox->addIndividualSaturationAnalysationNodeLinker(indiProcessNodeLinker); } } return true; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::hasNextCriticalConcepts(CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CCriticalIndividualNodeProcessingQueue* critIndNodeProcQueue = procDataBox->getSaturationCriticalIndividualNodeProcessingQueue(false); if (critIndNodeProcQueue) { if (!critIndNodeProcQueue->isEmpty()) { return true; } } return false; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::checkNextCriticalConcepts(CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CCriticalIndividualNodeProcessingQueue* critIndNodeProcQueue = procDataBox->getSaturationCriticalIndividualNodeProcessingQueue(false); if (critIndNodeProcQueue) { CIndividualSaturationProcessNode* indiProcSatNode = critIndNodeProcQueue->takeNextProcessIndividual(); bool checkCriticalConcepts = true; if (indiProcSatNode->getDirectStatusFlags()->hasMissedABoxConsistencyFlag()) { if (!isConsistenceDataAvailable(calcAlgContext)) { checkCriticalConcepts = false; CCriticalSaturationConceptTypeQueues* criticalConceptQueues = indiProcSatNode->getCriticalConceptTypeQueues(false); if (criticalConceptQueues) { criticalConceptQueues->setProcessNodeQueued(false); } } } if (checkCriticalConcepts) { checkCriticalConceptsForNode(indiProcSatNode,calcAlgContext); } } } CSaturationSuccessorExtensionData* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getSucessorExtensionData(CLinkedRoleSaturationSuccessorData* succData, bool create, CCalculationAlgorithmContextBase* calcAlgContext) { CSaturationSuccessorExtensionData*& succExtData = succData->mExtensionData; if (!succExtData && create) { succExtData = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getProcessContext()); succExtData->initSuccessorExtensionData(); } return succExtData; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::initializeSuccessorALLConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CSaturationIndividualNodeSuccessorExtensionData* indiProcSatNodeSuccExt = indiProcSatNode->getSuccessorExtensionData(); CSaturationIndividualNodeALLConceptsExtensionData* indiProcSatNodeALLConSuccExt = indiProcSatNodeSuccExt->getALLConceptsExtensionData(true); CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { CPROCESSHASH* succHash = linkedSuccHash->getLinkedRoleSuccessorHash(); CRoleBackwardSaturationPropagationHash* backwardPropHash = indiProcSatNode->getRoleBackwardPropagationHash(false); if (backwardPropHash) { CPROCESSHASH* backwardPropDataHash = backwardPropHash->getRoleBackwardPropagationDataHash(); for (CPROCESSHASH::const_iterator itSucc = succHash->constBegin(), itSuccEnd = succHash->constEnd(); itSucc != itSuccEnd; ++itSucc) { CRole* role(itSucc.key()); CLinkedRoleSaturationSuccessorData* succData(itSucc.value()); CRoleBackwardSaturationPropagationHashData* backwardPropData(backwardPropDataHash->valuePointer(role)); if (backwardPropData && backwardPropData->mReapplyLinker) { backwardPropData->mRoleALLConceptsProcessingQueued = false; updateSuccessorRoleALLConceptsExtensions(indiProcSatNode,role,succData,*backwardPropData,calcAlgContext); } } } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateSuccessorRoleALLConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CLinkedRoleSaturationSuccessorData* succData, const CRoleBackwardSaturationPropagationHashData& backwardPropData, CCalculationAlgorithmContextBase* calcAlgContext) { CSaturationIndividualNodeSuccessorExtensionData* indiProcSatNodeSuccExt = indiProcSatNode->getSuccessorExtensionData(); CSaturationIndividualNodeALLConceptsExtensionData* indiProcSatNodeALLConSuccExt = indiProcSatNodeSuccExt->getALLConceptsExtensionData(true); if (succData) { if (backwardPropData.mReapplyLinker) { bool succLinksUpdated = false; bool allConUpdated = false; CSaturationSuccessorExtensionData* satSuccExtData = getSucessorExtensionData(succData,true,calcAlgContext); CSaturationSuccessorData* lastExaminedLinkLinker = satSuccExtData->getLastExaminedLinkLinker(); CBackwardSaturationPropagationReapplyDescriptor* lastExaminedALLConReaDes = satSuccExtData->getLastExaminedALLConceptReapplyDescriptor(); bool iterateFullAllConReaDes = false; bool continueIterateLinks = false; if (lastExaminedALLConReaDes != backwardPropData.mReapplyLinker) { allConUpdated = true; continueIterateLinks = true; } if (lastExaminedLinkLinker != succData->mLastLink) { continueIterateLinks = true; succLinksUpdated = true; iterateFullAllConReaDes = true; } for (CSaturationSuccessorData* linkLinkerIt = succData->mLastLink; linkLinkerIt && continueIterateLinks; ) { if (!linkLinkerIt->mVALUENominalConnection) { CIndividualSaturationProcessNode* succIndiNode = linkLinkerIt->mSuccIndiNode; for (CXNegLinker* creationRoleLinkerIt = linkLinkerIt->mCreationRoleLinker; creationRoleLinkerIt; creationRoleLinkerIt = creationRoleLinkerIt->getNext()) { CRole* creationRole = creationRoleLinkerIt->getData(); CSaturationSuccessorALLConceptExtensionData* allConSuccExtData = indiProcSatNodeALLConSuccExt->getALLConceptsExtensionData(succIndiNode)->getRoleSuccessorALLConceptExtensionData(creationRole); bool conceptsForSuccIndiNodeModified = false; conceptsForSuccIndiNodeModified |= allConSuccExtData->addRequiredSuccessorCardinality(linkLinkerIt->mSuccCount); bool continueIterateALLReapConDes = true; for (CBackwardSaturationPropagationReapplyDescriptor* backReapplyIt = backwardPropData.mReapplyLinker; backReapplyIt && continueIterateALLReapConDes; ) { CConceptSaturationDescriptor* reapplyConDes = backReapplyIt->getReapplyConceptSaturationDescriptor(); CConcept* concept = reapplyConDes->getConcept(); bool conceptNegation = reapplyConDes->getNegation(); conceptsForSuccIndiNodeModified |= addSuccessorExtensionsALLConcept(indiProcSatNode,concept,conceptNegation,allConSuccExtData,calcAlgContext); backReapplyIt = backReapplyIt->getNext(); if (backReapplyIt == lastExaminedALLConReaDes) { if (!iterateFullAllConReaDes) { continueIterateALLReapConDes = false; } } } if (conceptsForSuccIndiNodeModified) { if (!allConSuccExtData->isExtensionProcessingQueued()) { allConSuccExtData->setExtensionProcessingQueued(true); indiProcSatNodeALLConSuccExt->addExtensionProcessData(allConSuccExtData); } } } } linkLinkerIt = linkLinkerIt->mNextLink; if (linkLinkerIt == lastExaminedLinkLinker) { if (!allConUpdated) { continueIterateLinks = false; } else { iterateFullAllConReaDes = false; } } } satSuccExtData->setLastExaminedLinkLinker(succData->mLastLink); satSuccExtData->setLastExaminedALLConceptReapplyDescriptor(backwardPropData.mReapplyLinker); } } } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::installSuccessorPredecessorRoleFunctionalityConceptsExtension(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { bool installed = false; CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { CPROCESSHASH* succHash = linkedSuccHash->getLinkedRoleSuccessorHash(); CLinkedRoleSaturationSuccessorData* succData = linkedSuccHash->getLinkedRoleSuccessorData(role,true); if (succData) { if (!succData->mRoleFUNCTIONALConceptsQueuingRequired) { succData->mRoleFUNCTIONALConceptsQueuingRequired = true; installed = true; } } } CRoleBackwardSaturationPropagationHash* backwardPropHash = indiProcSatNode->getRoleBackwardPropagationHash(true); if (backwardPropHash) { CPROCESSHASH* backwardPropDataHash = backwardPropHash->getRoleBackwardPropagationDataHash(); if (backwardPropDataHash) { CRoleBackwardSaturationPropagationHashData& backPropData = (*backwardPropDataHash)[role]; if (!backPropData.mRolePredecessorMergingQueuingRequired) { backPropData.mRolePredecessorMergingQueuingRequired = true; installed = true; } } } return installed; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateSuccessorRoleFUNCTIONALConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { bool updated = false; CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { CPROCESSHASH* succHash = linkedSuccHash->getLinkedRoleSuccessorHash(); CLinkedRoleSaturationSuccessorData* succData = linkedSuccHash->getLinkedRoleSuccessorData(role,false); if (succData && succData->mRoleFUNCTIONALConceptsQueuingRequired) { succData->mRoleFUNCTIONALConceptsProcessingQueued = false; if (succData->mSuccCount > 1) { updated |= updateSuccessorRoleFUNCTIONALConceptsExtensions(indiProcSatNode,role,succData,calcAlgContext); } } } return updated; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateSuccessorRoleQualifiedFUNCTIONALConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CSortedNegLinker* qualifiyConLinker, CCalculationAlgorithmContextBase* calcAlgContext) { bool updated = false; CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { CPROCESSHASH* succHash = linkedSuccHash->getLinkedRoleSuccessorHash(); CLinkedRoleSaturationSuccessorData* succData = linkedSuccHash->getLinkedRoleSuccessorData(role,false); if (succData && succData->mSuccCount > 1) { updated |= updateSuccessorRoleQualifiedFUNCTIONALConceptsExtensions(indiProcSatNode,role,qualifiyConLinker,succData,calcAlgContext); } } return updated; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updatePredecessorRoleFUNCTIONALConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { bool updated = false; CRoleBackwardSaturationPropagationHash* backwardPropHash = indiProcSatNode->getRoleBackwardPropagationHash(true); if (backwardPropHash) { CPROCESSHASH* backwardPropDataHash = backwardPropHash->getRoleBackwardPropagationDataHash(); if (backwardPropDataHash) { CRoleBackwardSaturationPropagationHashData& backPropData = (*backwardPropDataHash)[role]; if (backPropData.mRolePredecessorMergingQueuingRequired) { backPropData.mRolePredecessorMergingProcessingQueued = false; if (backPropData.mLinkLinker) { CBackwardSaturationPropagationLink* backPropLinkLinker = backPropData.mLinkLinker; CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { CPROCESSHASH* succHash = linkedSuccHash->getLinkedRoleSuccessorHash(); CLinkedRoleSaturationSuccessorData* succData = linkedSuccHash->getLinkedRoleSuccessorData(role,false); if (succData->mSuccCount >= 1) { updated |= updatePredecessorRoleFUNCTIONALConceptsExtensions(indiProcSatNode,role,succData,backPropLinkLinker,calcAlgContext); } } } } } } return updated; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updatePredecessorRoleFUNCTIONALConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CLinkedRoleSaturationSuccessorData* succData, CBackwardSaturationPropagationLink* backPropLinkLinker, CCalculationAlgorithmContextBase* calcAlgContext) { bool updated = false; CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); CPROCESSHASH* succDataHash = linkedSuccHash->getLinkedRoleSuccessorHash(); CSaturationIndividualNodeSuccessorExtensionData* indiProcSatNodeSuccExt = indiProcSatNode->getSuccessorExtensionData(); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* indiProcSatNodeFunctionalConSuccExt = indiProcSatNodeSuccExt->getFUNCTIONALConceptsExtensionData(true); if (succData) { CSaturationPredecessorFUNCTIONALConceptExtensionData* predRoleFuncConExtData = indiProcSatNodeFunctionalConSuccExt->getPredecessorFUNCTIONALConceptsExtensionData(role,true); CSaturationSuccessorData* lastLinkedSucc = succData->getLastSuccessorLinkData(); CSaturationSuccessorData* activeLinkedSucc = nullptr; for (CSaturationSuccessorData* linkedSuccIt = lastLinkedSucc; linkedSuccIt && !activeLinkedSucc; linkedSuccIt = linkedSuccIt->mNextLink) { if (linkedSuccIt->mActiveCount >= 1) { activeLinkedSucc = linkedSuccIt; } } if (activeLinkedSucc) { CIndividualSaturationProcessNode* succIndiNode = activeLinkedSucc->mSuccIndiNode; if (succIndiNode) { for (CBackwardSaturationPropagationLink* backPropLinkLinkerIt = backPropLinkLinker; backPropLinkLinkerIt; backPropLinkLinkerIt = backPropLinkLinkerIt->getNext()) { CIndividualSaturationProcessNode* predAncIndiNode = backPropLinkLinkerIt->getSourceIndividual(); if (succIndiNode != predAncIndiNode) { updated |= createAncestorSuccessorMergingExtension(indiProcSatNode,role,succIndiNode,predAncIndiNode,activeLinkedSucc->mCreationRoleLinker,calcAlgContext); } } } } } return updated; } CRole* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getInverseRole(CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { CRole* invRole = role->getInverseRole(); if (!invRole) { for (CSortedNegLinker* invEqRoleLinkerIt = role->getInverseEquivalentRoleList(); !invRole && invEqRoleLinkerIt; invEqRoleLinkerIt = invEqRoleLinkerIt->getNext()) { if (invEqRoleLinkerIt->isNegated()) { invRole = invEqRoleLinkerIt->getData(); } } } if (!invRole) { for (CSortedNegLinker* invSuperRoleLinkerIt = role->getIndirectSuperRoleList(); !invRole && invSuperRoleLinkerIt; invSuperRoleLinkerIt = invSuperRoleLinkerIt->getNext()) { if (invSuperRoleLinkerIt->isNegated()) { CRole* invSuperRole = invSuperRoleLinkerIt->getData(); for (CSortedNegLinker* superSuperRoleLinkerIt = invSuperRole->getIndirectSuperRoleList(); !invRole && superSuperRoleLinkerIt; superSuperRoleLinkerIt = superSuperRoleLinkerIt->getNext()) { if (superSuperRoleLinkerIt->isNegated() && superSuperRoleLinkerIt->getData() == role) { invRole = invSuperRole; } } } } } return invRole; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::createAncestorSuccessorMergingExtension(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CIndividualSaturationProcessNode* succSatNode, CIndividualSaturationProcessNode* ancSatNode, CXNegLinker* creationRoleLinker, CCalculationAlgorithmContextBase* calcAlgContext) { CSaturationSuccessorData* ancSuccLinkData = nullptr; collectLinkedSuccessorNodes(ancSatNode,calcAlgContext); CRole* invRole = getInverseRole(role,calcAlgContext); CLinkedRoleSaturationSuccessorData* ancSuccData = nullptr; CLinkedRoleSaturationSuccessorHash* ancLinkedSuccHash = ancSatNode->getLinkedRoleSuccessorHash(true); if (ancLinkedSuccHash) { ancSuccData = ancLinkedSuccHash->getLinkedRoleSuccessorData(invRole,false); if (ancSuccData) { ancSuccLinkData = ancSuccData->mSuccNodeDataMap.value(indiProcSatNode->getIndividualID()); } } CXNegLinker* ancSuccCreationRoleLinker = nullptr; if (ancSuccLinkData && ancSuccLinkData->mActiveCount >= 1) { ancSuccCreationRoleLinker = ancSuccLinkData->mCreationRoleLinker; bool updated = false; //if (mConfDebuggingWriteData && !mWroteFunctionalSuccPredMergingDebugString) { // mWroteFunctionalSuccPredMergingDebugString = true; // mEndSaturationDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // QString fileName("saturation-model-fun-succ-pred-merged.txt"); // QFile tmpFile(fileName); // if (tmpFile.open(QIODevice::WriteOnly)) { // tmpFile.write(mEndSaturationDebugIndiModelString.replace("
","").replace("

","\n").toLocal8Bit()); // tmpFile.close(); // } //} CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* funcConExtData = succSatNode->getSuccessorExtensionData(true)->getFUNCTIONALConceptsExtensionData(true); if (!funcConExtData->hasIndividualNodeForwardingPredecessorMerged(ancSatNode)) { CReapplyConceptSaturationLabelSet* succConSet = succSatNode->getReapplyConceptSaturationLabelSet(false); if (succConSet) { for (CConceptSaturationDescriptor* conSatDesIt = succConSet->getConceptSaturationDescriptionLinker(); conSatDesIt; conSatDesIt = conSatDesIt->getNext()) { CConcept* concept = conSatDesIt->getConcept(); bool negation = conSatDesIt->isNegated(); addConceptFilteredToIndividual(concept,negation,ancSatNode,calcAlgContext); } } CXNegLinker* depCopyLinker = CObjectAllocator< CXNegLinker >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); depCopyLinker->initNegLinker(ancSatNode,false); succSatNode->addCopyDependingIndividualNodeLinker(depCopyLinker); preprocessResolvedIndividualNode(ancSatNode,calcAlgContext); } for (CXNegLinker* creationRoleLinkerIt = creationRoleLinker; creationRoleLinkerIt; creationRoleLinkerIt = creationRoleLinkerIt->getNext()) { if (!creationRoleLinkerIt->isNegated()) { CRole* creationRole = creationRoleLinkerIt->getData(); if (!funcConExtData->hasIndividualNodeForwardingPredecessorMerged(ancSatNode,creationRole)) { updated = true; funcConExtData->setIndividualNodeForwardingPredecessorMerged(ancSatNode,creationRole); CRole* invCreationRole = getInverseRole(creationRole,calcAlgContext); if (invCreationRole && !ancLinkedSuccHash->hasActiveLinkedSuccessor(invCreationRole,indiProcSatNode)) { for (CSortedNegLinker* invCreationSuperRoleIt = invCreationRole->getIndirectSuperRoleList(); invCreationSuperRoleIt; invCreationSuperRoleIt = invCreationSuperRoleIt->getNext()) { CRole* creationSuperRole = invCreationSuperRoleIt->getData(); if (!invCreationSuperRoleIt->isNegated()) { ancLinkedSuccHash->addExtensionSuccessor(creationSuperRole,indiProcSatNode,invCreationRole,1); //ancLinkedSuccHash->setSuccessorMergedCreation(creationSuperRole,indiProcSatNode); addNewLinkedExtensionProcessingRole(creationSuperRole,ancSatNode,true,true,calcAlgContext); } else { CBackwardSaturationPropagationLink* backPropLink = CObjectAllocator::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); backPropLink->initBackwardPropagationLink(ancSatNode,creationSuperRole); installBackwardPropagationLink(ancSatNode,indiProcSatNode,creationSuperRole,backPropLink,true,false,calcAlgContext); } } } } } } return updated; } return false; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isLinkedIndividualSuccessorNodeMergingSubset(CIndividualSaturationProcessNode*& indiProcSatNode, CSaturationSuccessorData* subsetIndiSuccData, CSaturationSuccessorData* superIndiSuccData, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNode* subsetIndiSuccNode = subsetIndiSuccData->mSuccIndiNode; CIndividualSaturationProcessNode* superIndiSuccNode = superIndiSuccData->mSuccIndiNode; return isLinkedIndividualSuccessorNodeMergingSubset(indiProcSatNode,subsetIndiSuccNode,subsetIndiSuccData,superIndiSuccNode,superIndiSuccData,role,calcAlgContext); } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isLinkedIndividualSuccessorNodeMergingSubset(CIndividualSaturationProcessNode*& indiProcSatNode, CIndividualSaturationProcessNode* subsetIndiSuccNode, CSaturationSuccessorData* subsetIndiSuccData, CIndividualSaturationProcessNode* superIndiSuccNode, CSaturationSuccessorData* superIndiSuccData, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { if (subsetIndiSuccData->mVALUENominalConnection || superIndiSuccData->mVALUENominalConnection) { return false; } if (subsetIndiSuccNode->hasNominalIntegrated()) { return false; } if (subsetIndiSuccNode->hasDataValueApplied()) { return false; } if (superIndiSuccData->mActiveCount <= 0) { return false; } if (subsetIndiSuccData->mSuccCount > superIndiSuccData->mSuccCount) { return false; } if (!isSuccessorCreationRoleMergingSubset(role,superIndiSuccData->mCreationRoleLinker,calcAlgContext)) { return false; } if (!isIndividualNodeLabelMergingSubset(subsetIndiSuccNode,superIndiSuccNode,false,calcAlgContext)) { return false; } return true; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isSuccessorCreationRoleMergingSubset(CXNegLinker* subCreationRoleLinker, CXNegLinker* superCreationRoleLinker, CCalculationAlgorithmContextBase* calcAlgContext) { for (CXNegLinker* subCreationRoleLinkerIt = superCreationRoleLinker; subCreationRoleLinkerIt; subCreationRoleLinkerIt = subCreationRoleLinkerIt->getNext()) { if (!subCreationRoleLinkerIt->isNegated()) { CRole* subCreationRole = subCreationRoleLinkerIt->getData(); if (!isSuccessorCreationRoleMergingSubset(subCreationRole,superCreationRoleLinker,calcAlgContext)) { return false; } } } return true; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isSuccessorCreationRoleMergingSubset(CRole* subCreationRole, CXNegLinker* superCreationRoleLinker, CCalculationAlgorithmContextBase* calcAlgContext) { for (CXNegLinker* superCreationRoleLinkerIt = superCreationRoleLinker; superCreationRoleLinkerIt; superCreationRoleLinkerIt = superCreationRoleLinkerIt->getNext()) { if (!superCreationRoleLinkerIt->isNegated()) { if (superCreationRoleLinkerIt->getData() == subCreationRole) { return true; } } } return false; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isIndividualNodeLabelMergingSubset(CIndividualSaturationProcessNode* subsetIndiSuccNode, CIndividualSaturationProcessNode* superIndiSuccNode, bool ignoreANDConcepts, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyConceptSaturationLabelSet* subsetConSet = subsetIndiSuccNode->getReapplyConceptSaturationLabelSet(false); CReapplyConceptSaturationLabelSet* superConSet = superIndiSuccNode->getReapplyConceptSaturationLabelSet(false); if (!superConSet && subsetConSet) { return false; } if (subsetConSet && superConSet) { if (subsetConSet->getConceptCount() <= superConSet->getConceptCount()) { for (CConceptSaturationDescriptor* conDesIt = subsetConSet->getConceptSaturationDescriptionLinker(); conDesIt; conDesIt = conDesIt->getNext()) { CConcept* concept = conDesIt->getConcept(); bool negation = conDesIt->isNegated(); cint64 conCode = concept->getOperatorCode(); if (!ignoreANDConcepts || (!negation && (conCode != CCAND && conCode != CCAQAND && conCode != CCIMPLAQAND && conCode != CCBRANCHAQAND)) || (negation && (conCode != CCOR))) { if (!superConSet->containsConcept(concept,negation)) { return false; } } } } else { return false; } } return true; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::deactivateSubsetMergeableSuccessorLinks(CIndividualSaturationProcessNode*& indiProcSatNode, CLinkedRoleSaturationSuccessorHash* linkedSuccHash, CPROCESSMAP* succDataMap, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { bool linksDeactivated = false; cint64 removedSuccCardCount = 0; for (CPROCESSMAP::const_iterator succDataIt = succDataMap->constBegin(), succDataItEnd = succDataMap->constEnd(); succDataIt != succDataItEnd; ++succDataIt) { cint64 indiID = succDataIt.key(); CSaturationSuccessorData* succLinkData = succDataIt.value(); if (succLinkData->mActiveCount > 0) { cint64 succCard = succLinkData->mSuccCount; bool nodeMergeable = true; if (succLinkData->mSuccIndiNode && (succLinkData->mSuccIndiNode->hasDataValueApplied() || succLinkData->mSuccIndiNode->hasNominalIntegrated())) { nodeMergeable = false; } if (succLinkData->mVALUENominalConnection) { nodeMergeable = false; } if (nodeMergeable) { for (CXNegLinker* creationRoleLinkerIt = succLinkData->mCreationRoleLinker; creationRoleLinkerIt; creationRoleLinkerIt = creationRoleLinkerIt->getNext()) { if (!creationRoleLinkerIt->isNegated()) { CRole* creationRole = creationRoleLinkerIt->getData(); bool deactivateLink = false; for (CPROCESSMAP::const_iterator mergeSuccDataIt = succDataMap->constBegin(); !deactivateLink && mergeSuccDataIt != succDataItEnd; ++mergeSuccDataIt) { cint64 mergeIndiID = mergeSuccDataIt.key(); if (indiID != mergeIndiID) { CSaturationSuccessorData* mergeSuccLinkData = mergeSuccDataIt.value(); if (mergeSuccLinkData->mActiveCount > 0) { if (isLinkedIndividualSuccessorNodeMergingSubset(indiProcSatNode,succLinkData,mergeSuccLinkData,creationRole,calcAlgContext)) { deactivateLink = true; } } } } if (deactivateLink) { for (CSortedNegLinker* creationSuperRoleIt = creationRole->getIndirectSuperRoleList(); creationSuperRoleIt; creationSuperRoleIt = creationSuperRoleIt->getNext()) { CRole* creationSuperRole = creationSuperRoleIt->getData(); if (!creationSuperRoleIt->isNegated()) { linkedSuccHash->deactivateLinkedSuccessor(creationSuperRole,succLinkData->mSuccIndiNode,creationRole); } } } } } } if (succLinkData->mActiveCount <= 0) { removedSuccCardCount += succCard; } } } return linksDeactivated; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateSuccessorRoleFUNCTIONALConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CLinkedRoleSaturationSuccessorData* succData, CCalculationAlgorithmContextBase* calcAlgContext) { bool updated = false; CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); CPROCESSHASH* succDataHash = linkedSuccHash->getLinkedRoleSuccessorHash(); CSaturationIndividualNodeSuccessorExtensionData* indiProcSatNodeSuccExt = indiProcSatNode->getSuccessorExtensionData(); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* indiProcSatNodeFunctionalConSuccExt = indiProcSatNodeSuccExt->getFUNCTIONALConceptsExtensionData(true); if (succData) { CSaturationSuccessorFUNCTIONALConceptExtensionData* roleFuncConExtData = indiProcSatNodeFunctionalConSuccExt->getSuccessorFUNCTIONALConceptsExtensionData(role,true); CSaturationSuccessorData* lastExaminedLinkedSucc = roleFuncConExtData->getLastExaminedLinkedSuccessorData(); CSaturationSuccessorData* lastLinkedSucc = succData->getLastSuccessorLinkData(); if (lastLinkedSucc != lastExaminedLinkedSucc) { CPROCESSMAP* succDataMap = succData->getSuccessorNodeDataMap(false); deactivateSubsetMergeableSuccessorLinks(indiProcSatNode,linkedSuccHash,succDataMap,role,calcAlgContext); cint64 succCount = 0; cint64 maxSuccCardinality = CINT64_MIN; for (CSaturationSuccessorData* lastLinkedSuccIt = lastLinkedSucc; lastLinkedSuccIt; lastLinkedSuccIt = lastLinkedSuccIt->mNextLink) { if (lastLinkedSuccIt->mActiveCount >= 1 && !lastLinkedSuccIt->mVALUENominalConnection) { succCount++; maxSuccCardinality = qMax(maxSuccCardinality,lastLinkedSuccIt->mSuccCount); } } if (succCount > 1 && maxSuccCardinality <= 1) { //if (getDebugIndividualConceptName(indiProcSatNode,calcAlgContext) == "http://www.owllink.org/testsuite/galen#Kussmaul-KienRespiration") { // bool debug = true; //} CIndividualSaturationProcessNode* copyIndiProcSatNode = nullptr; CSaturationIndividualNodeExtensionResolveData* resolveData = nullptr; CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinker = nullptr; CSaturationSuccessorData* maxLabelResolveIndiLinkedSuccData = nullptr; cint64 maxLabelResolveIndiConceptCount = 0; // resolve new individual node for (CPROCESSMAP::const_iterator it = succDataMap->constBegin(), itEnd = succDataMap->constEnd(); it != itEnd; ++it) { cint64 succID = it.key(); CSaturationSuccessorData* linkedSuccData = it.value(); if (linkedSuccData->mActiveCount >= 1 && !linkedSuccData->mVALUENominalConnection) { cint64 succLabelConCount = linkedSuccData->mSuccIndiNode->getReapplyConceptSaturationLabelSet(false)->getConceptCount(); if (!maxLabelResolveIndiLinkedSuccData && succLabelConCount > maxLabelResolveIndiConceptCount) { maxLabelResolveIndiConceptCount = succLabelConCount; maxLabelResolveIndiLinkedSuccData = linkedSuccData; } CIndividualSaturationSuccessorLinkDataLinker* tmpMergingSuccDataLinker = createIndividualSaturationSuccessorLinkDataLinker(calcAlgContext); tmpMergingSuccDataLinker->initSuccessorLinkDataLinker(linkedSuccData); mergingSuccDataLinker = tmpMergingSuccDataLinker->append(mergingSuccDataLinker); } } CPROCESSINGHASH* conExtMap = nullptr; CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinkerIt = mergingSuccDataLinker; CSaturationSuccessorData* resolveLinkedSuccData = maxLabelResolveIndiLinkedSuccData; copyIndiProcSatNode = resolveLinkedSuccData->mSuccIndiNode; for (CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinkerIt = mergingSuccDataLinker; mergingSuccDataLinkerIt; mergingSuccDataLinkerIt = mergingSuccDataLinkerIt->getNext()) { CSaturationSuccessorData* linkedSuccData = mergingSuccDataLinkerIt->getData(); if (linkedSuccData != resolveLinkedSuccData) { CIndividualSaturationProcessNode* succNode = linkedSuccData->mSuccIndiNode; collectResolveIndividualExtendableConceptMap(copyIndiProcSatNode,succNode,conExtMap,calcAlgContext); } } releaseIndividualSaturationSuccessorLinkDataLinker(mergingSuccDataLinker,calcAlgContext); resolveData = copyIndiProcSatNode->getSuccessorExtensionData(true)->getBaseExtensionResolveData(true); resolveData = getResolvedIndividualNodeExtension(resolveData,conExtMap,copyIndiProcSatNode,calcAlgContext); CIndividualSaturationProcessNode* resolvedIndiNode = resolveData->getProcessingIndividualNode(); roleFuncConExtData->setLastResolvedIndividualNode(resolvedIndiNode); bool backwardLinkConnected = false; bool connectionAlreadyExist = false; // deactivate previous successor connections, activate new ones for (CPROCESSMAP::const_iterator it = succDataMap->constBegin(), itEnd = succDataMap->constEnd(); it != itEnd; ++it) { cint64 succID = it.key(); CSaturationSuccessorData* linkedSuccData = it.value(); if (linkedSuccData->mActiveCount >= 1 && !linkedSuccData->mVALUENominalConnection) { cint64 linkSuccCount = linkedSuccData->mSuccCount; CIndividualSaturationProcessNode* succNode = linkedSuccData->mSuccIndiNode; for (CXNegLinker* creationRoleLinkerIt = linkedSuccData->mCreationRoleLinker; creationRoleLinkerIt; creationRoleLinkerIt = creationRoleLinkerIt->getNext()) { if (!creationRoleLinkerIt->isNegated()) { CRole* creationRole = creationRoleLinkerIt->getData(); bool makeNewSuccessorConnections = true; bool removePreviousSuccessorConnections = true; // test whether creation role already exists for this successor connection if (linkedSuccHash->hasActiveLinkedSuccessor(creationRole,resolvedIndiNode)) { connectionAlreadyExist = true; makeNewSuccessorConnections = false; if (succNode == resolvedIndiNode) { removePreviousSuccessorConnections = false; } } for (CSortedNegLinker* creationSuperRoleIt = creationRole->getIndirectSuperRoleList(); creationSuperRoleIt; creationSuperRoleIt = creationSuperRoleIt->getNext()) { CRole* creationSuperRole = creationSuperRoleIt->getData(); if (!creationSuperRoleIt->isNegated()) { if (removePreviousSuccessorConnections) { linkedSuccHash->deactivateLinkedSuccessor(creationSuperRole,succNode,creationRole); } if (makeNewSuccessorConnections) { linkedSuccHash->addExtensionSuccessor(creationSuperRole,resolvedIndiNode,creationRole,1); //linkedSuccHash->setSuccessorMergedCreation(creationSuperRole,resolvedIndiNode); } } else { if (makeNewSuccessorConnections) { backwardLinkConnected = true; CBackwardSaturationPropagationLink* backPropLink = CObjectAllocator::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); backPropLink->initBackwardPropagationLink(indiProcSatNode,creationSuperRole); installBackwardPropagationLink(indiProcSatNode,resolvedIndiNode,creationSuperRole,backPropLink,true,true,calcAlgContext); } } } } } } } //linkedSuccHash->setSuccessorMergedCreation(role,resolvedIndiNode); //if (succData->mSuccCount >= 2) { // bool debug = true; //} //cint64 countedSucc = 0; //for (CSaturationSuccessorData* linkedSuccDataIt = succData->mLastLink; linkedSuccDataIt; linkedSuccDataIt = linkedSuccDataIt->mNextLink) { // if (linkedSuccDataIt->mActiveCount >= 1) { // countedSucc += linkedSuccDataIt->mSuccCount; // } //} //if (countedSucc >= 2) { // mEndSaturationDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); // QFile tmpFile("saturation-model.txt"); // if (tmpFile.open(QIODevice::WriteOnly)) { // tmpFile.write(mEndSaturationDebugIndiModelString.replace("
","").replace("

","\n").toLocal8Bit()); // tmpFile.close(); // } // bool bug = true; //} updateIndirectAddingIndividualStatusFlags(indiProcSatNode,resolvedIndiNode->getIndirectStatusFlags(),mCalcAlgContext); updateAddingSuccessorConnectedNominal(indiProcSatNode,resolvedIndiNode->getSuccessorConnectedNominalSet(false),mCalcAlgContext); if (!connectionAlreadyExist && !backwardLinkConnected) { CXLinker* nonInvConnectedIndiNodeLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); nonInvConnectedIndiNodeLinker->initLinker(indiProcSatNode); resolvedIndiNode->addNonInverseConnectedIndividualNodeLinker(nonInvConnectedIndiNodeLinker); } updated = true; } } } return updated; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateSuccessorRoleQualifiedFUNCTIONALConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CSortedNegLinker* qualifiyConLinker, CLinkedRoleSaturationSuccessorData* succData, CCalculationAlgorithmContextBase* calcAlgContext) { bool updated = false; CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); CPROCESSHASH* succDataHash = linkedSuccHash->getLinkedRoleSuccessorHash(); CSaturationIndividualNodeSuccessorExtensionData* indiProcSatNodeSuccExt = indiProcSatNode->getSuccessorExtensionData(); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* indiProcSatNodeFunctionalConSuccExt = indiProcSatNodeSuccExt->getFUNCTIONALConceptsExtensionData(true); if (succData) { CPROCESSMAP* succDataMap = succData->getSuccessorNodeDataMap(false); cint64 succCount = 0; cint64 maxSuccCardinality = CINT64_MIN; CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinker = nullptr; CSaturationSuccessorData* maxLabelResolveIndiLinkedSuccData = nullptr; cint64 maxLabelResolveIndiConceptCount = 0; for (CSaturationSuccessorData* lastLinkedSuccIt = succData->getLastSuccessorLinkData(); lastLinkedSuccIt; lastLinkedSuccIt = lastLinkedSuccIt->mNextLink) { if (lastLinkedSuccIt->mActiveCount >= 1 && !lastLinkedSuccIt->mVALUENominalConnection) { CReapplyConceptSaturationLabelSet* succConSet = lastLinkedSuccIt->mSuccIndiNode->getReapplyConceptSaturationLabelSet(false); bool containsQualification = false; for (CSortedNegLinker* qualifiyConLinkerIt = qualifiyConLinker; !containsQualification && qualifiyConLinkerIt; qualifiyConLinkerIt = qualifiyConLinkerIt->getNext()) { CConcept* qualCon = qualifiyConLinkerIt->getData(); bool qualNegation = qualifiyConLinkerIt->isNegated(); if (succConSet->containsConcept(qualCon,qualNegation)) { containsQualification = true; } } if (containsQualification) { succCount++; maxSuccCardinality = qMax(maxSuccCardinality,lastLinkedSuccIt->mSuccCount); cint64 succLabelConCount = succConSet->getConceptCount(); if (!maxLabelResolveIndiLinkedSuccData && succLabelConCount > maxLabelResolveIndiConceptCount) { maxLabelResolveIndiConceptCount = succLabelConCount; maxLabelResolveIndiLinkedSuccData = lastLinkedSuccIt; } CIndividualSaturationSuccessorLinkDataLinker* tmpMergingSuccDataLinker = createIndividualSaturationSuccessorLinkDataLinker(calcAlgContext); tmpMergingSuccDataLinker->initSuccessorLinkDataLinker(lastLinkedSuccIt); mergingSuccDataLinker = tmpMergingSuccDataLinker->append(mergingSuccDataLinker); } } } if (succCount > 1 && maxSuccCardinality <= 1) { CIndividualSaturationProcessNode* copyIndiProcSatNode = nullptr; CSaturationIndividualNodeExtensionResolveData* resolveData = nullptr; CPROCESSINGHASH* conExtMap = nullptr; CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinkerIt = mergingSuccDataLinker; CSaturationSuccessorData* resolveLinkedSuccData = maxLabelResolveIndiLinkedSuccData; copyIndiProcSatNode = resolveLinkedSuccData->mSuccIndiNode; for (CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinkerIt = mergingSuccDataLinker; mergingSuccDataLinkerIt; mergingSuccDataLinkerIt = mergingSuccDataLinkerIt->getNext()) { CSaturationSuccessorData* linkedSuccData = mergingSuccDataLinkerIt->getData(); if (linkedSuccData != resolveLinkedSuccData) { CIndividualSaturationProcessNode* succNode = linkedSuccData->mSuccIndiNode; collectResolveIndividualExtendableConceptMap(copyIndiProcSatNode,succNode,conExtMap,calcAlgContext); } } resolveData = copyIndiProcSatNode->getSuccessorExtensionData(true)->getBaseExtensionResolveData(true); resolveData = getResolvedIndividualNodeExtension(resolveData,conExtMap,copyIndiProcSatNode,calcAlgContext); CIndividualSaturationProcessNode* resolvedIndiNode = resolveData->getProcessingIndividualNode(); bool backwardLinkConnected = false; bool connectionAlreadyExist = false; // deactivate previous successor connections, activate new ones for (CPROCESSMAP::const_iterator it = succDataMap->constBegin(), itEnd = succDataMap->constEnd(); it != itEnd; ++it) { cint64 succID = it.key(); CSaturationSuccessorData* linkedSuccData = it.value(); if (linkedSuccData->mActiveCount >= 1 && !linkedSuccData->mVALUENominalConnection) { cint64 linkSuccCount = linkedSuccData->mSuccCount; CIndividualSaturationProcessNode* succNode = linkedSuccData->mSuccIndiNode; for (CXNegLinker* creationRoleLinkerIt = linkedSuccData->mCreationRoleLinker; creationRoleLinkerIt; creationRoleLinkerIt = creationRoleLinkerIt->getNext()) { if (!creationRoleLinkerIt->isNegated()) { CRole* creationRole = creationRoleLinkerIt->getData(); bool makeNewSuccessorConnections = true; bool removePreviousSuccessorConnections = true; // test whether creation role already exists for this successor connection if (linkedSuccHash->hasActiveLinkedSuccessor(creationRole,resolvedIndiNode)) { connectionAlreadyExist = true; makeNewSuccessorConnections = false; if (succNode == resolvedIndiNode) { removePreviousSuccessorConnections = false; } } for (CSortedNegLinker* creationSuperRoleIt = creationRole->getIndirectSuperRoleList(); creationSuperRoleIt; creationSuperRoleIt = creationSuperRoleIt->getNext()) { CRole* creationSuperRole = creationSuperRoleIt->getData(); if (!creationSuperRoleIt->isNegated()) { if (removePreviousSuccessorConnections) { linkedSuccHash->deactivateLinkedSuccessor(creationSuperRole,succNode,creationRole); } if (makeNewSuccessorConnections) { linkedSuccHash->addExtensionSuccessor(creationSuperRole,resolvedIndiNode,creationRole,1); //linkedSuccHash->setSuccessorMergedCreation(creationSuperRole,resolvedIndiNode); } } else { if (makeNewSuccessorConnections) { backwardLinkConnected = true; CBackwardSaturationPropagationLink* backPropLink = CObjectAllocator::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); backPropLink->initBackwardPropagationLink(indiProcSatNode,creationSuperRole); installBackwardPropagationLink(indiProcSatNode,resolvedIndiNode,creationSuperRole,backPropLink,true,true,calcAlgContext); } } } } } } } updateIndirectAddingIndividualStatusFlags(indiProcSatNode,resolvedIndiNode->getIndirectStatusFlags(),mCalcAlgContext); updateAddingSuccessorConnectedNominal(indiProcSatNode,resolvedIndiNode->getSuccessorConnectedNominalSet(false),mCalcAlgContext); updated = true; } releaseIndividualSaturationSuccessorLinkDataLinker(mergingSuccDataLinker,calcAlgContext); } return updated; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateSuccessorRoleALLConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { CPROCESSHASH* succHash = linkedSuccHash->getLinkedRoleSuccessorHash(); CLinkedRoleSaturationSuccessorData* succData = succHash->value(role,nullptr); if (succData) { succData->mRoleALLConceptsProcessingQueued = false; CRoleBackwardSaturationPropagationHash* backwardPropHash = indiProcSatNode->getRoleBackwardPropagationHash(false); if (backwardPropHash) { CPROCESSHASH* backwardPropDataHash = backwardPropHash->getRoleBackwardPropagationDataHash(); CRoleBackwardSaturationPropagationHashData* backwardPropData(backwardPropDataHash->valuePointer(role)); if (backwardPropData && backwardPropData->mReapplyLinker) { backwardPropData->mRoleALLConceptsProcessingQueued = false; updateSuccessorRoleALLConceptsExtensions(indiProcSatNode,role,succData,*backwardPropData,calcAlgContext); } } } } } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateSuccessorALLConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool updated = false; CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { CSaturationIndividualNodeSuccessorExtensionData* indiProcSatNodeSuccExt = indiProcSatNode->getSuccessorExtensionData(false); if (indiProcSatNodeSuccExt) { CSaturationIndividualNodeALLConceptsExtensionData* indiProcSatNodeALLConSuccExt = indiProcSatNodeSuccExt->getALLConceptsExtensionData(false); if (indiProcSatNodeALLConSuccExt) { CPROCESSHASH* succHash = linkedSuccHash->getLinkedRoleSuccessorHash(); while (indiProcSatNodeALLConSuccExt->hasExtensionProcessData()) { CSaturationSuccessorALLConceptExtensionData* satSucALLConExtData = indiProcSatNodeALLConSuccExt->takeNextExtensionProcessData(); satSucALLConExtData->setExtensionProcessingQueued(false); CSaturationSuccessorConceptExtensionMap* satSucConExtMap = satSucALLConExtData->getSuccessorConceptExtensionMap(); CIndividualSaturationProcessNode* indiNode = satSucALLConExtData->getIndividualNode(); CRole* role = satSucALLConExtData->getRole(); CIndividualSaturationProcessNode* lastResolvedIndiNode = satSucALLConExtData->getLastResolvedIndividualNode(); if (!lastResolvedIndiNode) { lastResolvedIndiNode = indiNode; } cint64 lastSuccCard = satSucALLConExtData->getLastConnectedSuccessorCardinality(); cint64 requiredSuccCard = satSucALLConExtData->getRequiredSuccessorCardinality(); //CRoleBackwardSaturationPropagationHash* backwardPropHash = indiProcSatNode->getRoleBackwardPropagationHash(false); //if (backwardPropHash) { // CPROCESSHASH* extMap = satSucConExtMap->getSuccessorConceptExtensionMap(); // CPROCESSHASH* backPropDataHash = backwardPropHash->getRoleBackwardPropagationDataHash(); // if (backPropDataHash) { // for (CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { // CRole* superRole = superRoleIt->getData(); // if (!superRoleIt->isNegated()) { // const CRoleBackwardSaturationPropagationHashData& backPropData = backPropDataHash->value(superRole); // for (CBackwardSaturationPropagationReapplyDescriptor* backPropIt = backPropData.mReapplyLinker; backPropIt; backPropIt = backPropIt->getNext()) { // CConceptSaturationDescriptor* conDes = backPropIt->getReapplyConceptSaturationDescriptor(); // CConcept* concept = conDes->getConcept(); // bool negation = conDes->isNegated(); // for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { // CConcept* opConcept = opLinkerIt->getData(); // bool opNegation = opLinkerIt->isNegated()^negation; // const CSaturationSuccessorConceptExtensionMapData& satSuccConExtMapData = extMap->value(opConcept->getConceptTag()); // if (opNegation && !satSuccConExtMapData.mNegative) { // bool bug = true; // } // if (!opNegation && !satSuccConExtMapData.mPositive) { // bool bug = true; // } // } // } // } // } // } //} bool onlySuccessorCardinalityUpdated = true; CIndividualSaturationProcessNode* resolvedIndiNode = lastResolvedIndiNode; if (satSucALLConExtData->hasConceptsUpdatedFlag()) { resolvedIndiNode = getResolvedIndividualNodeExtensionSuccessor(indiNode,satSucConExtMap,calcAlgContext); if (lastResolvedIndiNode != resolvedIndiNode) { onlySuccessorCardinalityUpdated = false; } } if (lastResolvedIndiNode != resolvedIndiNode || lastSuccCard != requiredSuccCard) { updated = true; bool backwardLinkConnected = false; if (lastResolvedIndiNode) { for (CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { if (!superRoleIt->isNegated()) { CRole* superRole = superRoleIt->getData(); linkedSuccHash->deactivateLinkedSuccessor(superRole,lastResolvedIndiNode,role); } } } for (CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { CRole* superRole = superRoleIt->getData(); if (!superRoleIt->isNegated()) { linkedSuccHash->addExtensionSuccessor(superRole,resolvedIndiNode,role,requiredSuccCard); addNewLinkedExtensionProcessingRole(superRole,indiProcSatNode,false,true,calcAlgContext); } else { if (!onlySuccessorCardinalityUpdated) { backwardLinkConnected = true; CBackwardSaturationPropagationLink* backPropLink = CObjectAllocator::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); backPropLink->initBackwardPropagationLink(indiProcSatNode,superRole); installBackwardPropagationLink(indiProcSatNode,resolvedIndiNode,superRole,backPropLink,true,true,calcAlgContext); } } } updateIndirectAddingIndividualStatusFlags(indiProcSatNode,resolvedIndiNode->getIndirectStatusFlags(),mCalcAlgContext); updateAddingSuccessorConnectedNominal(indiProcSatNode,resolvedIndiNode->getSuccessorConnectedNominalSet(false),mCalcAlgContext); if (!onlySuccessorCardinalityUpdated && !backwardLinkConnected) { CXLinker* nonInvConnectedIndiNodeLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); nonInvConnectedIndiNodeLinker->initLinker(indiProcSatNode); resolvedIndiNode->addNonInverseConnectedIndividualNodeLinker(nonInvConnectedIndiNodeLinker); } satSucALLConExtData->setLastResolvedIndividualNode(resolvedIndiNode); satSucALLConExtData->setLastConnectedSuccessorCardinality(requiredSuccCard); } } } } } return updated; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::installBackwardPropagationLink(CIndividualSaturationProcessNode* sourceIndiProcSatNode, CIndividualSaturationProcessNode* destIndiProcSatNode, CRole* role, CBackwardSaturationPropagationLink* link, bool applyBackPropDes, bool queueFunctionalProcessing, CCalculationAlgorithmContextBase* calcAlgContext) { CRoleBackwardSaturationPropagationHash* resolvedIndiBackPropHash = destIndiProcSatNode->getRoleBackwardPropagationHash(true); CPROCESSHASH* backPropDataHash = resolvedIndiBackPropHash->getRoleBackwardPropagationDataHash(); CRoleBackwardSaturationPropagationHashData& backPropData = (*backPropDataHash)[role]; bool installLink = true; bool linkInstalled = false; if (backPropData.mLinkLinker) { if (backPropData.mLinkLinker->getSourceIndividual() == link->getSourceIndividual()) { installLink = false; } } if (installLink) { linkInstalled = true; backPropData.mLinkLinker = link->append(backPropData.mLinkLinker); CBackwardSaturationPropagationReapplyDescriptor* backPropReapplyDes = backPropData.mReapplyLinker; if (backPropReapplyDes && applyBackPropDes) { applyBackwardPropagationConcepts(sourceIndiProcSatNode,backPropReapplyDes,calcAlgContext); } } if (backPropData.mRolePredecessorMergingQueuingRequired && queueFunctionalProcessing) { if (!backPropData.mRolePredecessorMergingProcessingQueued) { backPropData.mRolePredecessorMergingProcessingQueued = true; addSuccessorExtensionToProcessingQueue(destIndiProcSatNode,calcAlgContext); CSaturationIndividualNodeSuccessorExtensionData* succExtData = destIndiProcSatNode->getSuccessorExtensionData(false); if (succExtData) { CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* succIndiFUNCTIONALConExtData = succExtData->getFUNCTIONALConceptsExtensionData(false); if (succIndiFUNCTIONALConExtData) { if (succIndiFUNCTIONALConExtData->isSuccessorExtensionInitialized()) { if (!succIndiFUNCTIONALConExtData->hasLinkedPredecessorAddedProcessLinkerForRole(role)) { CRoleSaturationProcessLinker* roleProcessLinker = createRoleSaturationProcessLinker(calcAlgContext); roleProcessLinker->initRoleProcessLinker(role); succIndiFUNCTIONALConExtData->addLinkedPredecessorAddedRoleProcessLinker(roleProcessLinker); } } } } } } return linkInstalled; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::initializeIndividualNodeByCoping(CIndividualSaturationProcessNode* indiProcSatNode, CIndividualSaturationProcessNode* copyFromIndiProcSatNode, bool tryFlatLabelCopy, CCalculationAlgorithmContextBase* calcAlgContext) { ++mCopiedIndiNodeCount; indiProcSatNode->initCopingIndividualSaturationProcessNode(copyFromIndiProcSatNode,tryFlatLabelCopy); indiProcSatNode->setReferenceMode(2); indiProcSatNode->setCopyIndividualNode(copyFromIndiProcSatNode); indiProcSatNode->setReferenceIndividualSaturationProcessNode(copyFromIndiProcSatNode); updateDirectAddingIndividualStatusFlags(indiProcSatNode,copyFromIndiProcSatNode->getDirectStatusFlags(),mCalcAlgContext); updateIndirectAddingIndividualStatusFlags(indiProcSatNode,copyFromIndiProcSatNode->getIndirectStatusFlags(),mCalcAlgContext); updateAddingSuccessorConnectedNominal(indiProcSatNode,copyFromIndiProcSatNode->getSuccessorConnectedNominalSet(false),mCalcAlgContext); for (CConceptSaturationProcessLinker* conSatProLinkerIt = copyFromIndiProcSatNode->getConceptSaturationProcessLinker(); conSatProLinkerIt; conSatProLinkerIt = conSatProLinkerIt->getNext()) { CConceptSaturationProcessLinker* conSatProLinker = createConceptSaturationProcessLinker(calcAlgContext); conSatProLinker->initLinker(conSatProLinkerIt->getConceptSaturationDescriptor()); indiProcSatNode->addConceptSaturationProcessLinker(conSatProLinker); } CSaturationIndividualNodeSuccessorExtensionData* copySuccExtensionData = copyFromIndiProcSatNode->getSuccessorExtensionData(false); if (copySuccExtensionData) { CSaturationIndividualNodeALLConceptsExtensionData* copyALLConceptsExtension = copySuccExtensionData->getALLConceptsExtensionData(false); if (copyALLConceptsExtension) { if (copyALLConceptsExtension->isSuccessorExtensionInitialized()) { addSuccessorExtensionToProcessingQueue(indiProcSatNode,calcAlgContext); } } CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* copyFUNCTIONALConceptsExtension = copySuccExtensionData->getFUNCTIONALConceptsExtensionData(false); if (copyFUNCTIONALConceptsExtension) { if (copyFUNCTIONALConceptsExtension->isSuccessorExtensionInitialized()) { CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* functionalConceptsExtension = indiProcSatNode->getSuccessorExtensionData(true)->getFUNCTIONALConceptsExtensionData(true); addSuccessorExtensionToProcessingQueue(indiProcSatNode,calcAlgContext); for (CRoleSaturationProcessLinker* roleLinkerIt = copyFUNCTIONALConceptsExtension->getCopyingInitializingRoleProcessLinker(); roleLinkerIt; roleLinkerIt = roleLinkerIt->getNext()) { CRole* role = roleLinkerIt->getRole(); CRoleSaturationProcessLinker* tmpRoleLinker = createRoleSaturationProcessLinker(calcAlgContext); tmpRoleLinker->initRoleProcessLinker(role); functionalConceptsExtension->addFunctionalityAddedRoleProcessLinker(tmpRoleLinker); } } } } } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::preprocessResolvedIndividualNode(CIndividualSaturationProcessNode* resolvedIndiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool processed = false; CConceptSaturationProcessLinker* conceptSaturationProcessLinker = resolvedIndiProcSatNode->takeConceptSaturationProcessLinker(); while (conceptSaturationProcessLinker) { STATINC(RULEAPPLICATIONCOUNT,calcAlgContext); KONCLUCE_TASK_ALGORITHM_SATURATION_SATURATION_MODEL_STRING_INSTRUCTION(mRuleBeginDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext)); applyTableauSaturationRule(resolvedIndiProcSatNode,conceptSaturationProcessLinker); KONCLUCE_TASK_ALGORITHM_SATURATION_SATURATION_MODEL_STRING_INSTRUCTION(mRuleEndDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext)); releaseConceptSaturationProcessLinker(conceptSaturationProcessLinker,calcAlgContext); conceptSaturationProcessLinker = resolvedIndiProcSatNode->takeConceptSaturationProcessLinker(); processed = true; } return processed; } CIndividualSaturationProcessNode* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getResolvedIndividualNodeRepresentativeRangeAssertion(CIndividualSaturationProcessNode* indiProcSatNode, CIndividual* nominalIndi, CRole* role, bool inversedRole, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNode* resolvedNode = nullptr; CSaturationIndividualNodeExtensionResolveData* resolveData = indiProcSatNode->getSuccessorExtensionData(true)->getBaseExtensionResolveData(true); CIndividualSaturationProcessNode* copyIndiProcSatNode = indiProcSatNode; CConceptAssertionLinker* conAssLinker = nominalIndi->getAssertionConceptLinker(); CConcept* topConcept = calcAlgContext->getProcessingDataBox()->getOntologyTopConcept(); CConcept* nominalConcept = nominalIndi->getIndividualNominalConcept(); // resolve individual for (CConceptAssertionLinker* conAssLinkerIt = conAssLinker; conAssLinkerIt; conAssLinkerIt = conAssLinkerIt->getNext()) { CConcept* concept = conAssLinkerIt->getData(); bool negated = conAssLinkerIt->isNegated(); if (concept == nominalConcept) { if (negated) { resolveData = getResolvedIndividualNodeExtension(resolveData,topConcept,true,copyIndiProcSatNode,calcAlgContext); } } else { if (concept->getOperatorCode() == CCNOMINAL) { if (concept->getNominalIndividual() == nominalIndi) { if (negated) { resolveData = getResolvedIndividualNodeExtension(resolveData,topConcept,true,copyIndiProcSatNode,calcAlgContext); } } else if (!negated) { resolveData = getResolvedIndividualNodeExtension(resolveData,concept,negated,copyIndiProcSatNode,calcAlgContext); } } else { resolveData = getResolvedIndividualNodeExtension(resolveData,concept,negated,copyIndiProcSatNode,calcAlgContext); } } } for (CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { CRole* superRole = superRoleIt->getData(); CSortedNegLinker* rangeConLinker = superRole->getRelativeRangeConceptList(superRoleIt->isNegated()^inversedRole); for (CSortedNegLinker* rangeConLinkerIt = rangeConLinker; rangeConLinkerIt; rangeConLinkerIt = rangeConLinkerIt->getNext()) { CConcept* rangeConcept = rangeConLinkerIt->getData(); bool rangeConceptNegation = rangeConLinkerIt->isNegated(); resolveData = getResolvedIndividualNodeExtension(resolveData,rangeConcept,rangeConceptNegation,copyIndiProcSatNode,calcAlgContext); } } if (!resolveData->hasProcessingIndividualNode()) { // create individual resolvedNode = createResolvedIndividualNode(resolveData,copyIndiProcSatNode,true,calcAlgContext); resolvedNode->setSeparated(indiProcSatNode->isSeparated()); CReapplyConceptSaturationLabelSet* conSet = resolvedNode->getReapplyConceptSaturationLabelSet(true); // add all concepts to individual for (CConceptAssertionLinker* conAssLinkerIt = conAssLinker; conAssLinkerIt; conAssLinkerIt = conAssLinkerIt->getNext()) { CConcept* concept = conAssLinkerIt->getData(); bool negated = conAssLinkerIt->isNegated(); if (concept == nominalConcept) { if (negated) { addConceptFilteredToIndividual(topConcept,true,resolvedNode,calcAlgContext); } } else { if (concept->getOperatorCode() == CCNOMINAL) { if (concept->getNominalIndividual() == nominalIndi) { if (negated) { addConceptFilteredToIndividual(topConcept,true,resolvedNode,calcAlgContext); } } else if (!negated) { addConceptFilteredToIndividual(concept,negated,resolvedNode,calcAlgContext); } } else { addConceptFilteredToIndividual(concept,negated,resolvedNode,calcAlgContext); } } } for (CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { CRole* superRole = superRoleIt->getData(); CSortedNegLinker* rangeConLinker = superRole->getRelativeRangeConceptList(superRoleIt->isNegated()^inversedRole); for (CSortedNegLinker* rangeConLinkerIt = rangeConLinker; rangeConLinkerIt; rangeConLinkerIt = rangeConLinkerIt->getNext()) { CConcept* rangeConcept = rangeConLinkerIt->getData(); bool rangeConceptNegation = rangeConLinkerIt->isNegated(); addConceptFilteredToIndividual(rangeConcept,rangeConceptNegation,resolvedNode,calcAlgContext); } } preprocessResolvedIndividualNode(resolvedNode,calcAlgContext); } resolvedNode = resolveData->getProcessingIndividualNode(); return resolvedNode; } CIndividualSaturationProcessNode* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getResolvedIndividualNodeRepresentativeAssertion(CIndividualSaturationProcessNode* indiProcSatNode, CIndividual* nominalIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNode* resolvedNode = nullptr; CSaturationIndividualNodeExtensionResolveData* resolveData = indiProcSatNode->getSuccessorExtensionData(true)->getBaseExtensionResolveData(true); CIndividualSaturationProcessNode* copyIndiProcSatNode = indiProcSatNode; CConceptAssertionLinker* conAssLinker = nominalIndi->getAssertionConceptLinker(); CConcept* topConcept = calcAlgContext->getProcessingDataBox()->getOntologyTopConcept(); CConcept* nominalConcept = nominalIndi->getIndividualNominalConcept(); // resolve individual for (CConceptAssertionLinker* conAssLinkerIt = conAssLinker; conAssLinkerIt; conAssLinkerIt = conAssLinkerIt->getNext()) { CConcept* concept = conAssLinkerIt->getData(); bool negated = conAssLinkerIt->isNegated(); if (concept == nominalConcept) { if (negated) { resolveData = getResolvedIndividualNodeExtension(resolveData,topConcept,true,copyIndiProcSatNode,calcAlgContext); } } else { if (concept->getOperatorCode() == CCNOMINAL) { if (concept->getNominalIndividual() == nominalIndi) { if (negated) { resolveData = getResolvedIndividualNodeExtension(resolveData,topConcept,true,copyIndiProcSatNode,calcAlgContext); } } else if (!negated) { resolveData = getResolvedIndividualNodeExtension(resolveData,concept,negated,copyIndiProcSatNode,calcAlgContext); } } else { resolveData = getResolvedIndividualNodeExtension(resolveData,concept,negated,copyIndiProcSatNode,calcAlgContext); } } } if (!resolveData->hasProcessingIndividualNode()) { // create individual resolvedNode = createResolvedIndividualNode(resolveData,copyIndiProcSatNode,true,calcAlgContext); resolvedNode->setSeparated(indiProcSatNode->isSeparated()); CReapplyConceptSaturationLabelSet* conSet = resolvedNode->getReapplyConceptSaturationLabelSet(true); // add all concepts to individual for (CConceptAssertionLinker* conAssLinkerIt = conAssLinker; conAssLinkerIt; conAssLinkerIt = conAssLinkerIt->getNext()) { CConcept* concept = conAssLinkerIt->getData(); bool negated = conAssLinkerIt->isNegated(); if (concept == nominalConcept) { if (negated) { addConceptFilteredToIndividual(topConcept,true,resolvedNode,calcAlgContext); } } else { if (concept->getOperatorCode() == CCNOMINAL) { if (concept->getNominalIndividual() == nominalIndi) { if (negated) { addConceptFilteredToIndividual(topConcept,true,resolvedNode,calcAlgContext); } } else if (!negated) { addConceptFilteredToIndividual(concept,negated,resolvedNode,calcAlgContext); } } else { addConceptFilteredToIndividual(concept,negated,resolvedNode,calcAlgContext); } } } preprocessResolvedIndividualNode(resolvedNode,calcAlgContext); } resolvedNode = resolveData->getProcessingIndividualNode(); return resolvedNode; } CIndividualSaturationProcessNode* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getResolvedIndividualNodeAssertion(CIndividualSaturationProcessNode* indiProcSatNode, CIndividual* nominalIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNode* resolvedNode = nullptr; CSaturationIndividualNodeExtensionResolveData* resolveData = indiProcSatNode->getSuccessorExtensionData(true)->getBaseExtensionResolveData(true); CIndividualSaturationProcessNode* copyIndiProcSatNode = indiProcSatNode; CConceptAssertionLinker* conAssLinker = nominalIndi->getAssertionConceptLinker(); CConcept* nominalConcept = nominalIndi->getIndividualNominalConcept(); // resolve individual for (CConceptAssertionLinker* conAssLinkerIt = conAssLinker; conAssLinkerIt; conAssLinkerIt = conAssLinkerIt->getNext()) { CConcept* concept = conAssLinkerIt->getData(); bool negated = conAssLinkerIt->isNegated(); if (negated || concept != nominalConcept) { resolveData = getResolvedIndividualNodeExtension(resolveData,concept,negated,copyIndiProcSatNode,calcAlgContext); } } if (!resolveData->hasProcessingIndividualNode()) { // create individual resolvedNode = createResolvedIndividualNode(resolveData,copyIndiProcSatNode,true,calcAlgContext); resolvedNode->setSeparated(indiProcSatNode->isSeparated()); CReapplyConceptSaturationLabelSet* conSet = resolvedNode->getReapplyConceptSaturationLabelSet(true); // add all concepts to individual for (CConceptAssertionLinker* conAssLinkerIt = conAssLinker; conAssLinkerIt; conAssLinkerIt = conAssLinkerIt->getNext()) { CConcept* concept = conAssLinkerIt->getData(); bool negated = conAssLinkerIt->isNegated(); if (negated || concept != nominalConcept) { addConceptFilteredToIndividual(concept,negated,resolvedNode,calcAlgContext); } } preprocessResolvedIndividualNode(resolvedNode,calcAlgContext); } resolvedNode = resolveData->getProcessingIndividualNode(); return resolvedNode; } CIndividualSaturationProcessNode* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getResolvedIndividualNodeExtensionSuccessor(CIndividualSaturationProcessNode* indiProcSatNode, CSaturationSuccessorConceptExtensionMap* succConExtMap, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNode* resolvedNode = nullptr; CSaturationIndividualNodeExtensionResolveData* resolveData = indiProcSatNode->getSuccessorExtensionData(true)->getBaseExtensionResolveData(true); CPROCESSHASH* succConExtDataMap = succConExtMap->getSuccessorConceptExtensionMap(); CIndividualSaturationProcessNode* copyIndiProcSatNode = indiProcSatNode; // resolve individual for (CPROCESSHASH::const_iterator it = succConExtDataMap->constBegin(), itEnd = succConExtDataMap->constEnd(); it != itEnd; ++it) { const CSaturationSuccessorConceptExtensionMapData& conExtDat(it.value()); CConcept* concept = conExtDat.mConcept; bool addPositive = conExtDat.mPositive; bool addNegative = conExtDat.mNegative; if (addPositive) { resolveData = getResolvedIndividualNodeExtension(resolveData,concept,false,copyIndiProcSatNode,calcAlgContext); } if (addNegative) { resolveData = getResolvedIndividualNodeExtension(resolveData,concept,true,copyIndiProcSatNode,calcAlgContext); } } if (!resolveData->hasProcessingIndividualNode()) { // create individual resolvedNode = createResolvedIndividualNode(resolveData,copyIndiProcSatNode,true,calcAlgContext); CReapplyConceptSaturationLabelSet* conSet = resolvedNode->getReapplyConceptSaturationLabelSet(true); // add all concepts to individual for (CPROCESSHASH::const_iterator it = succConExtDataMap->constBegin(), itEnd = succConExtDataMap->constEnd(); it != itEnd; ++it) { const CSaturationSuccessorConceptExtensionMapData& conExtDat(it.value()); CConcept* concept = conExtDat.mConcept; bool addPositive = conExtDat.mPositive; bool addNegative = conExtDat.mNegative; if (addPositive) { addConceptFilteredToIndividual(concept,false,resolvedNode,calcAlgContext); } if (addNegative) { addConceptFilteredToIndividual(concept,true,resolvedNode,calcAlgContext); } } preprocessResolvedIndividualNode(resolvedNode,calcAlgContext); } resolvedNode = resolveData->getProcessingIndividualNode(); return resolvedNode; } CIndividualSaturationProcessNode* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::createResolvedIndividualNode(CSaturationIndividualNodeExtensionResolveData* resolveData, CIndividualSaturationProcessNode*& copyIndiProcSatNode, bool queueProcessing, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNode* resolvedNode = nullptr; resolvedNode = CObjectParameterizingAllocator< CIndividualSaturationProcessNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); resolvedNode->initIndividualSaturationProcessNode(resolveData->getProcessingIndividualNodeID(),nullptr,nullptr); initializeIndividualNodeByCoping(resolvedNode,copyIndiProcSatNode,false,calcAlgContext); resolveData->setProcessingIndividualNode(resolvedNode); resolvedNode->getSuccessorExtensionData(true)->setExtensionResolveData(resolveData); resolvedNode->setInitialized(true); resolvedNode->setRequiredBackwardPropagation(true); addIndividualToCompletionQueue(resolvedNode,calcAlgContext); CIndividualSaturationProcessNodeLinker* resolveNodeProcessLiner = CObjectAllocator::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); resolveNodeProcessLiner->initProcessNodeLinker(resolvedNode,queueProcessing); resolvedNode->setIndividualSaturationProcessNodeLinker(resolveNodeProcessLiner); if (queueProcessing) { calcAlgContext->getUsedProcessingDataBox()->addIndividualSaturationProcessNodeLinker(resolveNodeProcessLiner); } CIndividualSaturationProcessNodeVector* indiVec = calcAlgContext->getUsedProcessingDataBox()->getIndividualSaturationProcessNodeVector(true); indiVec->setData(resolvedNode->getIndividualID(),resolvedNode); return resolvedNode; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::collectResolveIndividualExtendableConceptMap(CIndividualSaturationProcessNode* baseIndiNode, CIndividualSaturationProcessNode* extensionIndiNode, CPROCESSINGHASH*& conExtMap, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyConceptSaturationLabelSet* extConSet = extensionIndiNode->getReapplyConceptSaturationLabelSet(false); bool extensionRequired = false; for (CConceptSaturationDescriptor* conIt = extConSet->getConceptSaturationDescriptionLinker(); conIt; conIt = conIt->getNextConceptDesciptor()) { CConceptSaturationDescriptor* containedConDes = nullptr; CImplicationReapplyConceptSaturationDescriptor* containedImpReaDes = nullptr; bool insertionRequired = false; CReapplyConceptSaturationLabelSet* baseConSet = baseIndiNode->getReapplyConceptSaturationLabelSet(false); if (baseConSet->getConceptSaturationDescriptor(conIt->getConcept(),containedConDes,containedImpReaDes)) { if (!containedConDes) { insertionRequired = true; } else if (containedConDes->isNegated() != conIt->isNegated()) { insertionRequired = true; } } else { insertionRequired = true; } if (insertionRequired) { extensionRequired = true; if (!conExtMap) { conExtMap = CObjectParameterizingAllocator< CPROCESSINGHASH,CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getTaskProcessorContext()); } conExtMap->insert(conIt->getConceptTag(),CConceptNegationPair(conIt->getConcept(),conIt->isNegated())); } } return extensionRequired; } CSaturationIndividualNodeExtensionResolveData* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getResolvedIndividualNodeExtension(CSaturationIndividualNodeExtensionResolveData* resolveData, CPROCESSINGHASH* conExtensionMap, CIndividualSaturationProcessNode*& copyIndiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (conExtensionMap) { for (CPROCESSHASH::const_iterator it = conExtensionMap->constBegin(), itEnd = conExtensionMap->constEnd(); it != itEnd; ++it) { const CConceptNegationPair& conExtDat(it.value()); CConcept* concept = conExtDat.first; bool negation = conExtDat.second; resolveData = getResolvedIndividualNodeExtension(resolveData,concept,negation,copyIndiProcSatNode,calcAlgContext); } if (!resolveData->getProcessingIndividualNode()) { CIndividualSaturationProcessNode* resolvedNode = createResolvedIndividualNode(resolveData,copyIndiProcSatNode,true,calcAlgContext); resolveData->setProcessingIndividualNode(resolvedNode); for (CPROCESSHASH::const_iterator it = conExtensionMap->constBegin(), itEnd = conExtensionMap->constEnd(); it != itEnd; ++it) { const CConceptNegationPair& conExtDat(it.value()); CConcept* concept = conExtDat.first; bool negation = conExtDat.second; addConceptFilteredToIndividual(concept,negation,resolvedNode,calcAlgContext); } preprocessResolvedIndividualNode(resolvedNode,calcAlgContext); } copyIndiProcSatNode = resolveData->getProcessingIndividualNode(); } return resolveData; } CSaturationIndividualNodeExtensionResolveData* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getResolvedIndividualNodeExtension(CSaturationIndividualNodeExtensionResolveData* resolveData, CIndividualSaturationProcessNode* extensionNode, CIndividualSaturationProcessNode*& copyIndiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CSaturationIndividualNodeExtensionResolveHashData& resolveHashData = resolveData->getIndividualNodeExtensionResolveHash(true)->getResolvedIndividualNodeExtensionData(extensionNode); if (!resolveHashData.mResolveData) { CReapplyConceptSaturationLabelSet* extConSet = extensionNode->getReapplyConceptSaturationLabelSet(false); CPROCESSINGHASH* conExtensionMap = nullptr; for (CConceptSaturationDescriptor* conIt = extConSet->getConceptSaturationDescriptionLinker(); conIt; conIt = conIt->getNextConceptDesciptor()) { CConceptSaturationDescriptor* containedConDes = nullptr; CImplicationReapplyConceptSaturationDescriptor* containedImpReaDes = nullptr; bool insertionRequired = false; CReapplyConceptSaturationLabelSet* baseConSet = copyIndiProcSatNode->getReapplyConceptSaturationLabelSet(false); if (baseConSet->getConceptSaturationDescriptor(conIt->getConcept(),containedConDes,containedImpReaDes)) { if (!containedConDes) { insertionRequired = true; } else if (containedConDes->isNegated() != conIt->isNegated()) { insertionRequired = true; } } else { insertionRequired = true; } if (insertionRequired) { if (!conExtensionMap) { conExtensionMap = CObjectParameterizingAllocator< CPROCESSINGHASH,CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getTaskProcessorContext()); } conExtensionMap->insert(conIt->getConceptTag(),CConceptNegationPair(conIt->getConcept(),conIt->isNegated())); } } resolveData = getResolvedIndividualNodeExtension(resolveData,conExtensionMap,copyIndiProcSatNode,calcAlgContext); resolveHashData.mResolveData = resolveData; } return resolveHashData.mResolveData; } CSaturationIndividualNodeExtensionResolveData* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getResolvedIndividualNodeExtension(CSaturationIndividualNodeExtensionResolveData* resolveData, CConcept* concept, bool negation, CIndividualSaturationProcessNode*& copyIndiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CSaturationIndividualNodeExtensionResolveHashData& resolveHashData = resolveData->getIndividualNodeExtensionResolveHash(true)->getResolvedIndividualNodeExtensionData(concept,negation); if (!resolveHashData.mResolveData) { CReapplyConceptSaturationLabelSet* conSet = copyIndiProcSatNode->getReapplyConceptSaturationLabelSet(false); if (conSet && conSet->containsConcept(concept,negation)) { resolveHashData.mResolveData = resolveData; } else { resolveHashData.mResolveData = CObjectParameterizingAllocator< CSaturationIndividualNodeExtensionResolveData,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); cint64 nextResolveIndiID = calcAlgContext->getUsedProcessingDataBox()->getNextSaturationResolvedSuccessorExtensionIndividualNodeID(); resolveHashData.mResolveData->initExtensionResolveData(nextResolveIndiID); } } if (resolveHashData.mResolveData->hasProcessingIndividualNode()) { copyIndiProcSatNode = resolveHashData.mResolveData->getProcessingIndividualNode(); } return resolveHashData.mResolveData; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addSuccessorExtensionsALLConcept(CIndividualSaturationProcessNode*& indiProcSatNode, CConcept* concept, bool conceptNegation, CSaturationSuccessorALLConceptExtensionData* allConSuccExtData, CCalculationAlgorithmContextBase* calcAlgContext) { bool newConceptAdded = false; bool addOperandConcepts = false; bool useNegatedOperandConcepts = false; CConceptOperator* conOp = concept->getConceptOperator(); if (!conceptNegation && conOp->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_AQALL_TYPE)) { addOperandConcepts = true; useNegatedOperandConcepts = false; } if (conceptNegation && conOp->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_SOME_TYPE)) { addOperandConcepts = true; useNegatedOperandConcepts = true; } if (addOperandConcepts) { for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConceptNegation = opLinkerIt->isNegated()^useNegatedOperandConcepts; newConceptAdded |= allConSuccExtData->addExtensionConcept(opConcept,opConceptNegation); } } return newConceptAdded; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::processSuccessorFUNCTIONALConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CSaturationIndividualNodeSuccessorExtensionData* succExtensionData = indiProcSatNode->getSuccessorExtensionData(); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* functionalConceptsExtension = succExtensionData->getFUNCTIONALConceptsExtensionData(); bool updated = false; bool initialized = false; collectLinkedSuccessorNodes(indiProcSatNode,calcAlgContext); if (!functionalConceptsExtension->isSuccessorExtensionInitialized()) { functionalConceptsExtension->setSuccessorExtensionInitialized(true); } CRoleSaturationProcessLinker* functionalityRoleSatProcLinker = functionalConceptsExtension->takeFunctionalityAddedRoleProcessLinker(); while (functionalityRoleSatProcLinker) { CRole* role = functionalityRoleSatProcLinker->getRole(); CRoleSaturationProcessLinker* tmpRoleSatProcLinker = functionalityRoleSatProcLinker; functionalityRoleSatProcLinker = functionalityRoleSatProcLinker->getNext(); tmpRoleSatProcLinker->clearNext(); if (installSuccessorPredecessorRoleFunctionalityConceptsExtension(indiProcSatNode,role,calcAlgContext)) { functionalConceptsExtension->addLinkedSuccessorAddedRoleProcessLinker(tmpRoleSatProcLinker); addFUNCTIONALProcessRoleExtensionFunctionalityAddedToDependentIndividuals(indiProcSatNode,role,calcAlgContext); CRoleSaturationProcessLinker* predFuncRoleProcLinker = createRoleSaturationProcessLinker(calcAlgContext); predFuncRoleProcLinker->initRoleProcessLinker(role); functionalConceptsExtension->addLinkedPredecessorAddedRoleProcessLinker(predFuncRoleProcLinker); CRoleSaturationProcessLinker* copyInitRoleLinker = createRoleSaturationProcessLinker(calcAlgContext); copyInitRoleLinker->initRoleProcessLinker(role); functionalConceptsExtension->addCopyingInitializingRoleProcessLinker(copyInitRoleLinker); } } if (!updated) { CRoleSaturationProcessLinker* succLinkedAddedRoleSatProcLinker = functionalConceptsExtension->takeLinkedSuccessorAddedRoleProcessLinker(); while (succLinkedAddedRoleSatProcLinker) { CRole* role = succLinkedAddedRoleSatProcLinker->getRole(); CRoleSaturationProcessLinker* tmpRoleSatProcLinker = succLinkedAddedRoleSatProcLinker; succLinkedAddedRoleSatProcLinker = succLinkedAddedRoleSatProcLinker->getNext(); tmpRoleSatProcLinker->clearNext(); updated |= updateSuccessorRoleFUNCTIONALConceptsExtensions(indiProcSatNode,role,calcAlgContext); releaseRoleSaturationProcessLinker(tmpRoleSatProcLinker,calcAlgContext); //addFUNCTIONALProcessRoleExtensionLinkedSuccessorAddedToDependentIndividuals(indiProcSatNode,role,calcAlgContext); } } if (!updated) { CRoleSaturationProcessLinker* predLinkedAddedRoleSatProcLinker = functionalConceptsExtension->takeLinkedPredecessorAddedRoleProcessLinker(); while (predLinkedAddedRoleSatProcLinker) { CRole* role = predLinkedAddedRoleSatProcLinker->getRole(); CRoleSaturationProcessLinker* tmpRoleSatProcLinker = predLinkedAddedRoleSatProcLinker; predLinkedAddedRoleSatProcLinker = predLinkedAddedRoleSatProcLinker->getNext(); tmpRoleSatProcLinker->clearNext(); updated |= updatePredecessorRoleFUNCTIONALConceptsExtensions(indiProcSatNode,role,calcAlgContext); releaseRoleSaturationProcessLinker(tmpRoleSatProcLinker,calcAlgContext); //addFUNCTIONALProcessRoleExtensionLinkedPredecessorAddedToDependentIndividuals(indiProcSatNode,role,calcAlgContext); } } if (!updated) { CConceptSaturationProcessLinker* funcQualAtmostConSatProcLinker = functionalConceptsExtension->takeQualifiedFunctionalAtmostConceptProcessLinker(); while (funcQualAtmostConSatProcLinker) { CConceptSaturationDescriptor* conDes = funcQualAtmostConSatProcLinker->getConceptSaturationDescriptor(); CConceptSaturationProcessLinker* tmpConDesSatProcLinker = funcQualAtmostConSatProcLinker; funcQualAtmostConSatProcLinker = funcQualAtmostConSatProcLinker->getNext(); tmpConDesSatProcLinker->clearNext(); CConcept* funcQualAtleastConcept = conDes->getConcept(); updated |= updateSuccessorRoleQualifiedFUNCTIONALConceptsExtensions(indiProcSatNode,funcQualAtleastConcept->getRole(),funcQualAtleastConcept->getOperandList(),calcAlgContext); releaseConceptSaturationProcessLinker(tmpConDesSatProcLinker,calcAlgContext); addFUNCTIONALQualifiedProcessAtmostConceptExtensionToDependentIndividuals(indiProcSatNode,conDes,calcAlgContext); } } if (succExtensionData->isExtensionProcessingQueued()) { succExtensionData->setExtensionProcessingQueued(false); } return updated; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::processNextSuccessorExtensions(CCalculationAlgorithmContextBase* calcAlgContext) { bool extensionProcessed = false; CIndividualSaturationProcessNode* indiProcSatNode = nullptr; CSaturationSuccessorExtensionIndividualNodeProcessingQueue* extProIndiQueue = mProcessingDataBox->getSaturationSucessorExtensionIndividualNodeProcessingQueue(false); while (!extensionProcessed && extProIndiQueue && !extProIndiQueue->isEmpty()) { indiProcSatNode = extProIndiQueue->takeNextToCurrentProcessIndividual(); if (indiProcSatNode && !indiProcSatNode->isSeparated()) { if (!extensionProcessed && mConfALLConceptsExtensionProcessing) { extensionProcessed |= processSuccessorALLConceptsExtensions(indiProcSatNode,calcAlgContext); } if (!extensionProcessed && mConfFUNCTIONALConceptsExtensionProcessing) { extensionProcessed |= processSuccessorFUNCTIONALConceptsExtensions(indiProcSatNode,calcAlgContext); } } if (!extensionProcessed) { extProIndiQueue->clearCurrentProcessIndividual(); } } return extensionProcessed; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::processSuccessorALLConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CSaturationIndividualNodeSuccessorExtensionData* succExtensionData = indiProcSatNode->getSuccessorExtensionData(); CSaturationIndividualNodeALLConceptsExtensionData* allConceptsExtension = succExtensionData->getALLConceptsExtensionData(); bool updated = false; bool initialized = false; collectLinkedSuccessorNodes(indiProcSatNode,calcAlgContext); //QString indiDebugNameString = getDebugIndividualConceptName(indiProcSatNode,calcAlgContext); //if (indiDebugNameString == "http://www.co-ode.org/ontologies/galen#Atlas") { // bool debug = true; //} if (!allConceptsExtension->isSuccessorExtensionInitialized()) { allConceptsExtension->setSuccessorExtensionInitialized(true); initializeSuccessorALLConceptsExtensions(indiProcSatNode,calcAlgContext); addProcessExtensionToDependentIndividuals(indiProcSatNode,calcAlgContext); initialized = true; mALLSuccExtInitializedCount++; } CRoleSaturationProcessLinker* roleSatProcLinker = allConceptsExtension->takeRoleProcessLinker(); while (roleSatProcLinker) { CRole* role = roleSatProcLinker->getRole(); CRoleSaturationProcessLinker* tmpRoleSatProcLinker = roleSatProcLinker; roleSatProcLinker = roleSatProcLinker->getNext(); tmpRoleSatProcLinker->clearNext(); updateSuccessorRoleALLConceptsExtensions(indiProcSatNode,role,calcAlgContext); releaseRoleSaturationProcessLinker(tmpRoleSatProcLinker,calcAlgContext); //addALLProcessRoleExtensionToDependentIndividuals(indiProcSatNode,role,calcAlgContext); } if (allConceptsExtension->isExtensionProcessingQueued()) { allConceptsExtension->setExtensionProcessingQueued(false); } if (succExtensionData->isExtensionProcessingQueued()) { succExtensionData->setExtensionProcessingQueued(false); } updated = updateSuccessorALLConceptsExtensions(indiProcSatNode,calcAlgContext); //testInsufficientALLConcepts(indiProcSatNode,calcAlgContext); return updated; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addSuccessorExtensionToProcessingQueue(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CSaturationIndividualNodeSuccessorExtensionData* succExtData = indiProcSatNode->getSuccessorExtensionData(true); CSaturationIndividualNodeALLConceptsExtensionData* succIndiALLConExtData = succExtData->getALLConceptsExtensionData(true); if (!succExtData->isExtensionProcessingQueued()) { succExtData->setExtensionProcessingQueued(true); calcAlgContext->getUsedProcessingDataBox()->getSaturationSucessorExtensionIndividualNodeProcessingQueue(true)->insertProcessIndiviudal(indiProcSatNode); return true; } return false; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addProcessExtensionToDependentIndividuals(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { for (CXNegLinker* depIndiLinkerIt = indiProcSatNode->getCopyDependingIndividualNodeLinker(); depIndiLinkerIt; depIndiLinkerIt = depIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* depIndi = depIndiLinkerIt->getData(); if (depIndi) { addSuccessorExtensionToProcessingQueue(depIndi,calcAlgContext); } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addALLProcessRoleExtensionToDependentIndividuals(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { for (CXNegLinker* depIndiLinkerIt = indiProcSatNode->getCopyDependingIndividualNodeLinker(); depIndiLinkerIt; depIndiLinkerIt = depIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* depIndi = depIndiLinkerIt->getData(); if (depIndi) { CSaturationIndividualNodeSuccessorExtensionData* succExtData = depIndi->getSuccessorExtensionData(true); CSaturationIndividualNodeALLConceptsExtensionData* succIndiALLConExtData = succExtData->getALLConceptsExtensionData(true); addSuccessorExtensionToProcessingQueue(depIndi,calcAlgContext); if (succIndiALLConExtData->isSuccessorExtensionInitialized()) { if (!succIndiALLConExtData->hasProcessLinkerForRole(role)) { CRoleSaturationProcessLinker* roleProcLinker = createRoleSaturationProcessLinker(calcAlgContext); roleProcLinker->initRoleProcessLinker(role); succIndiALLConExtData->addRoleProcessLinker(roleProcLinker); } } } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addFUNCTIONALProcessRoleExtensionLinkedSuccessorAddedToDependentIndividuals(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { for (CXNegLinker* depIndiLinkerIt = indiProcSatNode->getCopyDependingIndividualNodeLinker(); depIndiLinkerIt; depIndiLinkerIt = depIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* depIndi = depIndiLinkerIt->getData(); if (depIndi) { CSaturationIndividualNodeSuccessorExtensionData* succExtData = depIndi->getSuccessorExtensionData(true); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* succIndiFunctionalConExtData = succExtData->getFUNCTIONALConceptsExtensionData(true); addSuccessorExtensionToProcessingQueue(depIndi,calcAlgContext); if (succIndiFunctionalConExtData->isSuccessorExtensionInitialized()) { if (!succIndiFunctionalConExtData->hasLinkedSuccessorAddedProcessLinkerForRole(role)) { CRoleSaturationProcessLinker* roleProcLinker = createRoleSaturationProcessLinker(calcAlgContext); roleProcLinker->initRoleProcessLinker(role); succIndiFunctionalConExtData->addLinkedSuccessorAddedRoleProcessLinker(roleProcLinker); } } } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addFUNCTIONALQualifiedProcessAtmostConceptExtensionToDependentIndividuals(CIndividualSaturationProcessNode*& indiProcSatNode, CConceptSaturationDescriptor* conDes, CCalculationAlgorithmContextBase* calcAlgContext) { for (CXNegLinker* depIndiLinkerIt = indiProcSatNode->getCopyDependingIndividualNodeLinker(); depIndiLinkerIt; depIndiLinkerIt = depIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* depIndi = depIndiLinkerIt->getData(); if (depIndi) { addQualifiedFUNCTIONALAtmostConceptExtensionProcessing(conDes,depIndi,calcAlgContext); } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addFUNCTIONALProcessRoleExtensionLinkedPredecessorAddedToDependentIndividuals(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { for (CXNegLinker* depIndiLinkerIt = indiProcSatNode->getCopyDependingIndividualNodeLinker(); depIndiLinkerIt; depIndiLinkerIt = depIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* depIndi = depIndiLinkerIt->getData(); if (depIndi) { CSaturationIndividualNodeSuccessorExtensionData* succExtData = depIndi->getSuccessorExtensionData(true); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* succIndiFunctionalConExtData = succExtData->getFUNCTIONALConceptsExtensionData(true); if (succIndiFunctionalConExtData->isSuccessorExtensionInitialized()) { addSuccessorExtensionToProcessingQueue(depIndi,calcAlgContext); if (!succIndiFunctionalConExtData->hasLinkedPredecessorAddedProcessLinkerForRole(role)) { CRoleSaturationProcessLinker* roleProcLinker = createRoleSaturationProcessLinker(calcAlgContext); roleProcLinker->initRoleProcessLinker(role); succIndiFunctionalConExtData->addLinkedPredecessorAddedRoleProcessLinker(roleProcLinker); } } } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addFUNCTIONALProcessRoleExtensionFunctionalityAddedToDependentIndividuals(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { for (CXNegLinker* depIndiLinkerIt = indiProcSatNode->getCopyDependingIndividualNodeLinker(); depIndiLinkerIt; depIndiLinkerIt = depIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* depIndi = depIndiLinkerIt->getData(); if (depIndi) { CSaturationIndividualNodeSuccessorExtensionData* succExtData = depIndi->getSuccessorExtensionData(true); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* succIndiFunctionalConExtData = succExtData->getFUNCTIONALConceptsExtensionData(true); addSuccessorExtensionToProcessingQueue(depIndi,calcAlgContext); if (!succIndiFunctionalConExtData->hasFunctionalityAddedProcessLinkerForRole(role)) { CRoleSaturationProcessLinker* roleProcLinker = createRoleSaturationProcessLinker(calcAlgContext); roleProcLinker->initRoleProcessLinker(role); succIndiFunctionalConExtData->addFunctionalityAddedRoleProcessLinker(roleProcLinker); } } } } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::markNominalATMOSTRestrictedAncestorsAsInsufficient(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool ancestorsRestricted = false; CRoleBackwardSaturationPropagationHash* backwardPropHash = indiProcSatNode->getRoleBackwardPropagationHash(false); CConcept* concept = conDes->getConcept(); bool conceptNegation = conDes->isNegated(); CRole* role = concept->getRole(); if (backwardPropHash) { CPROCESSHASH* backPropDataHash = backwardPropHash->getRoleBackwardPropagationDataHash(); if (backPropDataHash) { for (CPROCESSHASH::const_iterator it = backPropDataHash->constFind(role), itEnd = backPropDataHash->constEnd(); it != itEnd && it.key() == role; ++it) { const CRoleBackwardSaturationPropagationHashData& backPropData = it.value(); for (CBackwardSaturationPropagationLink* backPropLinkIt = backPropData.mLinkLinker; backPropLinkIt; backPropLinkIt = backPropLinkIt->getNext()) { CBackwardSaturationPropagationLink* backPropLink = backPropLinkIt; CIndividualSaturationProcessNode* sourceIndi = backPropLink->getSourceIndividual(); updateDirectAddingIndividualStatusFlags(sourceIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); ancestorsRestricted = true; } } } } CCriticalPredecessorRoleCardinalityHash* critPredRolCardHash = indiProcSatNode->getCriticalPredecessorRoleCardinalityHash(true); critPredRolCardHash->addCriticalPredecessorRoleCardinality(role,concept,!conceptNegation); return ancestorsRestricted; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::markATMOSTRestrictedAncestorsAsInsufficient(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode* functionallyRestrictedSuccessorNode, CXNegLinker* functionallyRestrictedSuccessorCreationRoleLinker, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool ancestorsRestricted = false; CRoleBackwardSaturationPropagationHash* backwardPropHash = indiProcSatNode->getRoleBackwardPropagationHash(false); CConcept* concept = conDes->getConcept(); bool conceptNegation = conDes->isNegated(); CRole* role = concept->getRole(); if (backwardPropHash) { CPROCESSHASH* backPropDataHash = backwardPropHash->getRoleBackwardPropagationDataHash(); if (backPropDataHash) { for (CPROCESSHASH::const_iterator it = backPropDataHash->constFind(role), itEnd = backPropDataHash->constEnd(); it != itEnd && it.key() == role; ++it) { const CRoleBackwardSaturationPropagationHashData& backPropData = it.value(); for (CBackwardSaturationPropagationLink* backPropLinkIt = backPropData.mLinkLinker; backPropLinkIt; backPropLinkIt = backPropLinkIt->getNext()) { CBackwardSaturationPropagationLink* backPropLink = backPropLinkIt; CIndividualSaturationProcessNode* sourceIndi = backPropLink->getSourceIndividual(); bool ancestorInsufficient = true; cint64 allowedCardinality = concept->getParameter() - 1*conceptNegation; if (!sourceIndi->getIndirectStatusFlags()->hasInsufficientFlag()) { if (allowedCardinality == 1 && !concept->getOperandList()) { if (sourceIndi == functionallyRestrictedSuccessorNode) { ancestorInsufficient = false; } else { collectLinkedSuccessorNodes(sourceIndi,calcAlgContext); CLinkedRoleSaturationSuccessorHash* linkedSuccHash = sourceIndi->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { CPROCESSHASH* succHash = linkedSuccHash->getLinkedRoleSuccessorHash(); CRole* inverseRole = getInverseRole(role,calcAlgContext); CLinkedRoleSaturationSuccessorData* succData = succHash->value(inverseRole); if (succData) { CSaturationSuccessorData* succRoleData = succData->mSuccNodeDataMap.value(indiProcSatNode->getIndividualID()); if (succRoleData) { if (succRoleData->mActiveCount <= 0) { ancestorInsufficient = false; } else { bool funcSuccAllRolePredMerged = false; CSaturationIndividualNodeSuccessorExtensionData* succExtData = functionallyRestrictedSuccessorNode->getSuccessorExtensionData(false); if (succExtData) { CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* funcConExtData = succExtData->getFUNCTIONALConceptsExtensionData(false); if (funcConExtData) { funcSuccAllRolePredMerged = true; for (CXNegLinker* functionallyRestrictedSuccessorCreationRoleIt = functionallyRestrictedSuccessorCreationRoleLinker; funcSuccAllRolePredMerged && functionallyRestrictedSuccessorCreationRoleIt; functionallyRestrictedSuccessorCreationRoleIt = functionallyRestrictedSuccessorCreationRoleIt->getNext()) { if (!functionallyRestrictedSuccessorCreationRoleIt->isNegated()) { if (!funcConExtData->hasIndividualNodeForwardingPredecessorMerged(sourceIndi,functionallyRestrictedSuccessorCreationRoleIt->getData())) { funcSuccAllRolePredMerged = false; } } } } } if (funcSuccAllRolePredMerged || isIndividualNodeLabelMergingSubset(functionallyRestrictedSuccessorNode,sourceIndi,true,calcAlgContext)) { if (funcSuccAllRolePredMerged || isSuccessorCreationRoleMergingSubset(functionallyRestrictedSuccessorCreationRoleLinker,succRoleData->mCreationRoleLinker,calcAlgContext)) { ancestorInsufficient = false; } } } } } } } } } if (ancestorInsufficient) { updateDirectAddingIndividualStatusFlags(sourceIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); ancestorsRestricted = true; } } } } } CCriticalPredecessorRoleCardinalityHash* critPredRolCardHash = indiProcSatNode->getCriticalPredecessorRoleCardinalityHash(true); critPredRolCardHash->addCriticalPredecessorRoleCardinality(role,concept,!conceptNegation); return ancestorsRestricted; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addCriticalORConceptTestedForDependentNodes(CConceptSaturationDescriptor* conDes, CCriticalSaturationConceptTypeQueues::CRITICALSATURATIONCONCEPTQUEUETYPE conceptType, CIndividualSaturationProcessNode*& indiProcSatNode, CCriticalIndividualNodeConceptTestSet* criticalIndiNodeConTestSet, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 updatedNodes = 0; cint64 currentUpdateLinkerCount = 1; CIndividualSaturationProcessNodeStatusUpdateLinker* directUpdateLinker = createIndividualSaturationUpdateLinker(calcAlgContext); directUpdateLinker->initUpdateNodeLinker(indiProcSatNode); while (directUpdateLinker) { CIndividualSaturationProcessNodeStatusUpdateLinker* nextUpdateLinker = directUpdateLinker; directUpdateLinker = directUpdateLinker->getNext(); CIndividualSaturationProcessNode* updateIndiNode = nextUpdateLinker->getData(); nextUpdateLinker->clearNext(); releaseIndividualSaturationUpdateLinker(nextUpdateLinker,calcAlgContext); --currentUpdateLinkerCount; ++updatedNodes; for (CXNegLinker* depIndiIt = updateIndiNode->getCopyDependingIndividualNodeLinker(); depIndiIt; depIndiIt = depIndiIt->getNext()) { if (depIndiIt->isNegated()) { CIndividualSaturationProcessNode* dependingIndiNode = depIndiIt->getData(); CIndividualSaturationProcessNodeStatusFlags* statusFlag = dependingIndiNode->getDirectStatusFlags(); bool continueDepending = false; if (!statusFlag->hasFlags(CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,false)) { if (!criticalIndiNodeConTestSet->isConceptTestedForIndividual(conDes,dependingIndiNode)) { criticalIndiNodeConTestSet->insertConceptTestedForIndividual(conDes,dependingIndiNode); STATINC(SATURATIONCRITICALTESTCOUNT,calcAlgContext); if (isCriticalORConceptDescriptorInsufficient(conDes,dependingIndiNode,calcAlgContext)) { updateDirectNotDependentAddingIndividualStatusFlags(dependingIndiNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); setInsufficientNodeOccured(calcAlgContext); continueDepending = true; } } } else { continueDepending = true; } if (continueDepending) { CIndividualSaturationProcessNodeStatusUpdateLinker* nextUpdateLinker = createIndividualSaturationUpdateLinker(calcAlgContext); nextUpdateLinker->initUpdateNodeLinker(dependingIndiNode); directUpdateLinker = nextUpdateLinker->append(directUpdateLinker); ++currentUpdateLinkerCount; } } } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addCriticalConceptForDependentNodes(CConceptSaturationDescriptor* conDes, CCriticalSaturationConceptTypeQueues::CRITICALSATURATIONCONCEPTQUEUETYPE conceptType, CIndividualSaturationProcessNode*& indiProcSatNode, bool directFlagsCheck, cint64 checkFlags, CCalculationAlgorithmContextBase* calcAlgContext) { for (CXNegLinker* depIndiIt = indiProcSatNode->getCopyDependingIndividualNodeLinker(); depIndiIt; depIndiIt = depIndiIt->getNext()) { CIndividualSaturationProcessNode* dependingIndiNode = depIndiIt->getData(); CIndividualSaturationProcessNodeStatusFlags* statusFlag = nullptr; if (directFlagsCheck) { statusFlag = dependingIndiNode->getDirectStatusFlags(); } else { statusFlag = dependingIndiNode->getIndirectStatusFlags(); } if (checkFlags == 0 || !statusFlag->hasFlags(checkFlags,false)) { addCriticalConceptDescriptor(conDes,conceptType,dependingIndiNode,calcAlgContext); } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::checkCriticalConceptsForNode(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CCriticalSaturationConceptTypeQueues* criticalConceptQueues = indiProcSatNode->getCriticalConceptTypeQueues(false); CIndividualSaturationProcessNodeStatusFlags* indirectFlags = indiProcSatNode->getIndirectStatusFlags(); CIndividualSaturationProcessNodeStatusFlags* directFlags = indiProcSatNode->getDirectStatusFlags(); CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CCriticalIndividualNodeConceptTestSet* criticalIndiNodeConTestSet = processingDataBox->getSaturationCriticalIndividualNodeConceptTestSet(true); criticalConceptQueues->setProcessNodeQueued(false); if (!indirectFlags->hasInsufficientFlag() && !indirectFlags->hasClashedFlag()) { CCriticalSaturationConceptTypeQueues::CRITICALSATURATIONCONCEPTQUEUETYPE conceptType = CCriticalSaturationConceptTypeQueues::CCT_FORALL; CCriticalSaturationConceptQueue* criticalConTypeQueue = criticalConceptQueues->getCriticalSaturationConceptQueue(conceptType,false); if (criticalConTypeQueue) { while (criticalConTypeQueue->hasCriticalConceptDescriptorLinker() && !indirectFlags->hasInsufficientFlag()) { CConceptSaturationProcessLinker* criticalConProcDes = criticalConTypeQueue->takeNextCriticalConceptDescriptor(); CConceptSaturationDescriptor* criticalConDes = criticalConProcDes->getConceptSaturationDescriptor(); if (!criticalIndiNodeConTestSet->isConceptTestedForIndividual(criticalConDes,indiProcSatNode)) { criticalIndiNodeConTestSet->insertConceptTestedForIndividual(criticalConDes,indiProcSatNode); STATINC(SATURATIONCRITICALTESTCOUNT,calcAlgContext); if (isCriticalALLConceptDescriptorInsufficient(criticalConDes,indiProcSatNode,calcAlgContext)) { updateDirectAddingIndividualStatusFlags(indiProcSatNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); setInsufficientNodeOccured(calcAlgContext); ++mInsufficientALLCount; } else { addCriticalConceptForDependentNodes(criticalConDes,conceptType,indiProcSatNode,false,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); } } releaseConceptSaturationProcessLinker(criticalConProcDes,calcAlgContext); } } } if (!indirectFlags->hasInsufficientFlag() && !indirectFlags->hasClashedFlag()) { CCriticalSaturationConceptTypeQueues::CRITICALSATURATIONCONCEPTQUEUETYPE conceptType = CCriticalSaturationConceptTypeQueues::CCT_ATMOST; CCriticalSaturationConceptQueue* criticalConTypeQueue = criticalConceptQueues->getCriticalSaturationConceptQueue(conceptType,false); if (criticalConTypeQueue) { while (criticalConTypeQueue->hasCriticalConceptDescriptorLinker() && !indirectFlags->hasInsufficientFlag()) { CConceptSaturationProcessLinker* criticalConProcDes = criticalConTypeQueue->takeNextCriticalConceptDescriptor(); CConceptSaturationDescriptor* criticalConDes = criticalConProcDes->getConceptSaturationDescriptor(); if (!criticalIndiNodeConTestSet->isConceptTestedForIndividual(criticalConDes,indiProcSatNode)) { criticalIndiNodeConTestSet->insertConceptTestedForIndividual(criticalConDes,indiProcSatNode); bool ancestorPossiblyInsufficient = false; CIndividualSaturationProcessNode* functionallyRestrictedSuccessorNode = nullptr; CXNegLinker* functionallyRestrictedSuccessorCreationRoleLinker = nullptr; STATINC(SATURATIONCRITICALTESTCOUNT,calcAlgContext); if (isCriticalATMOSTConceptDescriptorInsufficient(criticalConDes,ancestorPossiblyInsufficient,functionallyRestrictedSuccessorNode,functionallyRestrictedSuccessorCreationRoleLinker,indiProcSatNode,calcAlgContext)) { ++mInsufficientATMOSTCount; //bool bug = false; //while (bug) { // isCriticalATMOSTConceptDescriptorInsufficient(criticalConDes,ancestorPossiblyInsufficient,functionallyRestrictedSuccessorNode,functionallyRestrictedSuccessorCreationRoleLinker,indiProcSatNode,calcAlgContext); //} updateDirectAddingIndividualStatusFlags(indiProcSatNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); setInsufficientNodeOccured(calcAlgContext); } else { addCriticalConceptForDependentNodes(criticalConDes,conceptType,indiProcSatNode,false,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); } if (indiProcSatNode->hasNominalIntegrated()) { markNominalATMOSTRestrictedAncestorsAsInsufficient(criticalConDes,indiProcSatNode,calcAlgContext); } if (ancestorPossiblyInsufficient) { markATMOSTRestrictedAncestorsAsInsufficient(criticalConDes,functionallyRestrictedSuccessorNode,functionallyRestrictedSuccessorCreationRoleLinker,indiProcSatNode,calcAlgContext); updateDirectAddingIndividualStatusFlags(indiProcSatNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCARDINALITYPROPLEMATIC,calcAlgContext); } } releaseConceptSaturationProcessLinker(criticalConProcDes,calcAlgContext); } } } if (!indirectFlags->hasInsufficientFlag() && !indirectFlags->hasClashedFlag()) { CCriticalSaturationConceptTypeQueues::CRITICALSATURATIONCONCEPTQUEUETYPE conceptType = CCriticalSaturationConceptTypeQueues::CCT_VALUE; CCriticalSaturationConceptQueue* criticalConTypeQueue = criticalConceptQueues->getCriticalSaturationConceptQueue(conceptType,false); if (criticalConTypeQueue) { while (criticalConTypeQueue->hasCriticalConceptDescriptorLinker() && !indirectFlags->hasInsufficientFlag()) { CConceptSaturationProcessLinker* criticalConProcDes = criticalConTypeQueue->takeNextCriticalConceptDescriptor(); CConceptSaturationDescriptor* criticalConDes = criticalConProcDes->getConceptSaturationDescriptor(); if (!criticalIndiNodeConTestSet->isConceptTestedForIndividual(criticalConDes,indiProcSatNode)) { criticalIndiNodeConTestSet->insertConceptTestedForIndividual(criticalConDes,indiProcSatNode); STATINC(SATURATIONCRITICALTESTCOUNT,calcAlgContext); if (isCriticalVALUEConceptDescriptorInsufficient(criticalConDes,indiProcSatNode,calcAlgContext)) { updateDirectAddingIndividualStatusFlags(indiProcSatNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); setInsufficientNodeOccured(calcAlgContext); } else { addCriticalConceptForDependentNodes(criticalConDes,conceptType,indiProcSatNode,false,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); } } releaseConceptSaturationProcessLinker(criticalConProcDes,calcAlgContext); } } } if (!indirectFlags->hasInsufficientFlag() && !indirectFlags->hasClashedFlag()) { CCriticalSaturationConceptTypeQueues::CRITICALSATURATIONCONCEPTQUEUETYPE conceptType = CCriticalSaturationConceptTypeQueues::CCT_NOMINAL; CCriticalSaturationConceptQueue* criticalConTypeQueue = criticalConceptQueues->getCriticalSaturationConceptQueue(conceptType,false); if (criticalConTypeQueue) { while (criticalConTypeQueue->hasCriticalConceptDescriptorLinker() && !indirectFlags->hasInsufficientFlag()) { CConceptSaturationProcessLinker* criticalConProcDes = criticalConTypeQueue->takeNextCriticalConceptDescriptor(); CConceptSaturationDescriptor* criticalConDes = criticalConProcDes->getConceptSaturationDescriptor(); if (!criticalIndiNodeConTestSet->isConceptTestedForIndividual(criticalConDes,indiProcSatNode)) { criticalIndiNodeConTestSet->insertConceptTestedForIndividual(criticalConDes,indiProcSatNode); STATINC(SATURATIONCRITICALTESTCOUNT,calcAlgContext); if (isCriticalNOMINALConceptDescriptorInsufficient(criticalConDes,indiProcSatNode,calcAlgContext)) { updateDirectAddingIndividualStatusFlags(indiProcSatNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); setInsufficientNodeOccured(calcAlgContext); } else { addCriticalConceptForDependentNodes(criticalConDes,conceptType,indiProcSatNode,false,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); } } releaseConceptSaturationProcessLinker(criticalConProcDes,calcAlgContext); } } } if (!indirectFlags->hasClashedFlag()) { CCriticalSaturationConceptTypeQueues::CRITICALSATURATIONCONCEPTQUEUETYPE conceptType = CCriticalSaturationConceptTypeQueues::CCT_DISJUNCTION; CCriticalSaturationConceptQueue* criticalConTypeQueue = criticalConceptQueues->getCriticalSaturationConceptQueue(conceptType,false); if (criticalConTypeQueue) { while (criticalConTypeQueue->hasCriticalConceptDescriptorLinker()) { CConceptSaturationProcessLinker* criticalConProcDes = criticalConTypeQueue->takeNextCriticalConceptDescriptor(); CConceptSaturationDescriptor* criticalConDes = criticalConProcDes->getConceptSaturationDescriptor(); if (!criticalIndiNodeConTestSet->isConceptTestedForIndividual(criticalConDes,indiProcSatNode)) { criticalIndiNodeConTestSet->insertConceptTestedForIndividual(criticalConDes,indiProcSatNode); STATINC(SATURATIONCRITICALTESTCOUNT,calcAlgContext); if (isCriticalORConceptDescriptorInsufficient(criticalConDes,indiProcSatNode,calcAlgContext)) { updateDirectNotDependentAddingIndividualStatusFlags(indiProcSatNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); setInsufficientNodeOccured(calcAlgContext); addCriticalORConceptTestedForDependentNodes(criticalConDes,conceptType,indiProcSatNode,criticalIndiNodeConTestSet,calcAlgContext); } } releaseConceptSaturationProcessLinker(criticalConProcDes,calcAlgContext); } } } if (!indirectFlags->hasClashedFlag()) { CCriticalSaturationConceptTypeQueues::CRITICALSATURATIONCONCEPTQUEUETYPE conceptType = CCriticalSaturationConceptTypeQueues::CCT_EQCANDIDATE; CCriticalSaturationConceptQueue* criticalConTypeQueue = criticalConceptQueues->getCriticalSaturationConceptQueue(conceptType,false); if (criticalConTypeQueue) { while (criticalConTypeQueue->hasCriticalConceptDescriptorLinker()) { CConceptSaturationProcessLinker* criticalConProcDes = criticalConTypeQueue->takeNextCriticalConceptDescriptor(); CConceptSaturationDescriptor* criticalConDes = criticalConProcDes->getConceptSaturationDescriptor(); if (!criticalIndiNodeConTestSet->isConceptTestedForIndividual(criticalConDes,indiProcSatNode)) { criticalIndiNodeConTestSet->insertConceptTestedForIndividual(criticalConDes,indiProcSatNode); if (isCriticalEQCANDConceptDescriptorProblematic(criticalConDes,indiProcSatNode,calcAlgContext)) { updateDirectNotDependentAddingIndividualStatusFlags(indiProcSatNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGEQCANDPROPLEMATIC,calcAlgContext); setProblematicEQCandidateOccured(calcAlgContext); addCriticalConceptForDependentNodes(criticalConDes,conceptType,indiProcSatNode,true,0,calcAlgContext); } } releaseConceptSaturationProcessLinker(criticalConProcDes,calcAlgContext); } } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::collectLinkedSuccessorNodes(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CLinkedRoleSaturationSuccessorHash* linkedRoleSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(true); CConceptSaturationDescriptor* lastExaminedConDes = linkedRoleSuccHash->getLastExaminedConceptDescriptor(); CReapplyConceptSaturationLabelSet* conSet = indiProcSatNode->getReapplyConceptSaturationLabelSet(true); CConceptSaturationDescriptor* conDesLinker = conSet->getConceptSaturationDescriptionLinker(); for (CConceptSaturationDescriptor* conDesIt = conDesLinker; conDesIt && conDesIt != lastExaminedConDes; conDesIt = conDesIt->getNext()) { CConceptSaturationDescriptor* conDes = conDesIt; CConcept* concept = conDes->getConcept(); bool conNegation = conDes->isNegated(); cint64 conCode = concept->getOperatorCode(); if (!conNegation && (conCode == CCSOME || conCode == CCAQSOME) || conNegation && (conCode == CCALL)) { addLinkedSuccessorNodeForConcept(conDes,linkedRoleSuccHash,indiProcSatNode,calcAlgContext); } if (!conNegation && conCode == CCATLEAST || conNegation && conCode == CCATMOST) { addLinkedSuccessorNodeForConcept(conDes,linkedRoleSuccHash,indiProcSatNode,calcAlgContext); } if (!conNegation && conCode == CCVALUE) { addLinkedSuccessorNodeForConcept(conDes,linkedRoleSuccHash,indiProcSatNode,calcAlgContext); } } CSaturationSuccessorRoleAssertionLinker* lastSatSuccRoleAssLinker = linkedRoleSuccHash->getLastExaminedRoleAssertionLinker(); CSaturationSuccessorRoleAssertionLinker* satSuccRoleAssLinker = indiProcSatNode->getRoleAssertionLinker(); for (CSaturationSuccessorRoleAssertionLinker* satSuccRoleAssLinkerIt = satSuccRoleAssLinker; satSuccRoleAssLinkerIt && satSuccRoleAssLinkerIt != lastSatSuccRoleAssLinker; satSuccRoleAssLinkerIt = satSuccRoleAssLinkerIt->getNext()) { CRole* role = satSuccRoleAssLinkerIt->getAssertionRole(); bool roleNegation = satSuccRoleAssLinkerIt->getAssertionRoleNegation(); CIndividualSaturationProcessNode* destNode = satSuccRoleAssLinkerIt->getAssertionDestinationNode(); addLinkedSuccessorNodeForRoleAssertion(destNode,role,roleNegation,linkedRoleSuccHash,indiProcSatNode,calcAlgContext); } linkedRoleSuccHash->setLastExaminedRoleAssertionLinker(satSuccRoleAssLinker); linkedRoleSuccHash->setLastExaminedConceptDescriptor(conDesLinker); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addLinkedSuccessorNodeForRoleAssertion(CIndividualSaturationProcessNode* destNode, CRole* role, bool roleInversion, CLinkedRoleSaturationSuccessorHash* linkedRoleSuccHash, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { CRole* superRole = superRoleIt->getData(); if (!superRoleIt->isNegated() ^ roleInversion) { linkedRoleSuccHash->addLinkedSuccessor(superRole,destNode,superRole,1,true); } superRoleIt = superRoleIt->getNext(); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addLinkedSuccessorNodeForConcept(CConceptSaturationDescriptor* conDes, CLinkedRoleSaturationSuccessorHash* linkedRoleSuccHash, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CConcept* concept = conDes->getConcept(); bool conNegation = conDes->isNegated(); CRole* role = concept->getRole(); cint64 param = concept->getParameter(); cint64 cardinality = param + 1*conNegation; cint64 conCode = concept->getOperatorCode(); bool addSuccessor = false; bool nominalSuccessor = false; cint64 successorCount = 0; cint64 nominalID = 0; if (!conNegation && (conCode == CCVALUE)) { addSuccessor = true; successorCount = 1; nominalSuccessor = true; CIndividual* nominalIndividual = concept->getNominalIndividual(); nominalID = nominalIndividual->getIndividualID(); } if (!conNegation && (conCode == CCSOME || conCode == CCAQSOME) || conNegation && (conCode == CCALL)) { addSuccessor = true; successorCount = 1; nominalSuccessor = false; } if (cardinality >= 1 && (!conNegation && conCode == CCATLEAST || conNegation && conCode == CCATMOST)) { addSuccessor = true; successorCount = cardinality; nominalSuccessor = false; } if (addSuccessor) { bool foundSpecialIndiNode = false; bool foundOperandIndiNode = false; CConceptData* conceptData = concept->getConceptData(); if (conceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)conceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* extSatCalcRefLinkData = confSatRefLinkingData->getExistentialSuccessorConceptSaturationReferenceLinkingData(); if (extSatCalcRefLinkData) { CIndividualSaturationProcessNode* existIndiNode = (CIndividualSaturationProcessNode*)extSatCalcRefLinkData->getIndividualProcessNodeForConcept(); if (existIndiNode) { foundSpecialIndiNode = true; CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { CRole* superRole = superRoleIt->getData(); if (!superRoleIt->isNegated()) { if (nominalSuccessor) { linkedRoleSuccHash->addLinkedVALUESuccessor(superRole,nominalID,role); } else { linkedRoleSuccHash->addLinkedSuccessor(superRole,existIndiNode,role,successorCount,false); } } superRoleIt = superRoleIt->getNext(); } } } } } if (!foundSpecialIndiNode) { CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); while (conceptOpLinkerIt) { foundOperandIndiNode = true; CConcept* opConcept = conceptOpLinkerIt->getData(); bool opConNegation = conceptOpLinkerIt->isNegated()^conNegation; CConceptData* opConceptData = opConcept->getConceptData(); if (opConceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)opConceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* satCalcRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(opConNegation); if (satCalcRefLinkData) { CIndividualSaturationProcessNode* existIndiNode = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); if (existIndiNode) { CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { CRole* superRole = superRoleIt->getData(); if (!superRoleIt->isNegated()) { if (nominalSuccessor) { linkedRoleSuccHash->addLinkedVALUESuccessor(superRole,nominalID,role); } else { linkedRoleSuccHash->addLinkedSuccessor(superRole,existIndiNode,role,successorCount,false); } } superRoleIt = superRoleIt->getNext(); } } } } } conceptOpLinkerIt = conceptOpLinkerIt->getNext(); } } if (!foundSpecialIndiNode && !foundOperandIndiNode) { CConcept* baseTopConcept = nullptr; if (!role->isDataRole()) { baseTopConcept = calcAlgContext->getUsedProcessingDataBox()->getOntologyTopConcept(); } else { baseTopConcept = calcAlgContext->getUsedProcessingDataBox()->getOntologyTopDataRangeConcept(); } CConcept* opConcept = baseTopConcept; bool opConNegation = false; CConceptData* opConceptData = opConcept->getConceptData(); if (opConceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)opConceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* satCalcRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(opConNegation); if (satCalcRefLinkData) { CIndividualSaturationProcessNode* existIndiNode = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); if (existIndiNode) { CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { CRole* superRole = superRoleIt->getData(); if (!superRoleIt->isNegated()) { if (nominalSuccessor) { linkedRoleSuccHash->addLinkedVALUESuccessor(superRole,nominalID,role); } else { linkedRoleSuccHash->addLinkedSuccessor(superRole,existIndiNode,role,successorCount,false); } } superRoleIt = superRoleIt->getNext(); } } } } } } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addCriticalConceptDescriptor(CConceptSaturationDescriptor* conDes, CCriticalSaturationConceptTypeQueues::CRITICALSATURATIONCONCEPTQUEUETYPE conceptType, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (mConfAddCriticalConceptsToQueues) { STATINC(SATURATIONCRITICALADDCOUNT,calcAlgContext); CConceptSaturationProcessLinker* conDesProLinker = createConceptSaturationProcessLinker(calcAlgContext); conDesProLinker->initConceptSaturationProcessLinker(conDes); CCriticalSaturationConceptTypeQueues* queues = indiProcSatNode->getCriticalConceptTypeQueues(true); CCriticalSaturationConceptQueue* criticalConceptQueue = queues->getCriticalSaturationConceptQueue(conceptType,true); criticalConceptQueue->addCriticalConceptDescriptorLinker(conDesProLinker); if (!queues->isProcessNodeQueued()) { // TODO: insert into a queue CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CCriticalIndividualNodeProcessingQueue* criticalIndNodProcQueue = processingDataBox->getSaturationCriticalIndividualNodeProcessingQueue(true); criticalIndNodProcQueue->insertProcessIndiviudal(indiProcSatNode); queues->setProcessNodeQueued(true); } } if (mConfDirectlyCriticalToInsufficient) { updateDirectAddingIndividualStatusFlags(indiProcSatNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::testInsufficientALLConcepts(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { collectLinkedSuccessorNodes(indiProcSatNode,calcAlgContext); CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); CRoleBackwardSaturationPropagationHash* backwardPropHash = indiProcSatNode->getRoleBackwardPropagationHash(false); if (backwardPropHash && linkedSuccHash) { CSaturationIndividualNodeSuccessorExtensionData* succExtData = indiProcSatNode->getSuccessorExtensionData(false); if (succExtData && !succExtData->isExtensionProcessingQueued()) { CPROCESSHASH* backPropDataHash = backwardPropHash->getRoleBackwardPropagationDataHash(); if (backPropDataHash) { CPROCESSHASH* succHash = linkedSuccHash->getLinkedRoleSuccessorHash(); for (CPROCESSHASH::const_iterator itSucc = succHash->constBegin(), itSuccEnd = succHash->constEnd(); itSucc != itSuccEnd; ++itSucc) { CRole* role(itSucc.key()); CLinkedRoleSaturationSuccessorData* succData(itSucc.value()); for (CPROCESSMAP::const_iterator itSuccIndi = succData->mSuccNodeDataMap.constBegin(), itSuccIndiEnd = succData->mSuccNodeDataMap.constEnd(); itSuccIndi != itSuccIndiEnd; ++itSuccIndi) { CSaturationSuccessorData* succDataIndi(itSuccIndi.value()); if (succDataIndi->mActiveCount >= 1) { if (succDataIndi->mVALUENominalConnection) { } else { CIndividualSaturationProcessNode* succIndi = succDataIndi->mSuccIndiNode; CReapplyConceptSaturationLabelSet* succConSet = succIndi->getReapplyConceptSaturationLabelSet(false); const CRoleBackwardSaturationPropagationHashData& backPropData = backPropDataHash->value(role); for (CBackwardSaturationPropagationReapplyDescriptor* backPropIt = backPropData.mReapplyLinker; backPropIt; backPropIt = backPropIt->getNext()) { CConceptSaturationDescriptor* conDes = backPropIt->getReapplyConceptSaturationDescriptor(); CConcept* concept = conDes->getConcept(); bool negation = conDes->isNegated(); for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opNegation = opLinkerIt->isNegated()^negation; if (!succConSet || !succConSet->containsConcept(opConcept,opNegation)) { mEndSaturationDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); QFile tmpFile("saturation-model.txt"); if (tmpFile.open(QIODevice::WriteOnly)) { tmpFile.write(mEndSaturationDebugIndiModelString.replace("
","").replace("

","\n").toLocal8Bit()); tmpFile.close(); } bool bug = true; } } } } } } } } } } } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isCriticalALLConceptDescriptorInsufficient(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(SATURATIONCRITICALALLCOUNT,calcAlgContext); if (!indiProcSatNode->hasSubstituteIndividualNode()) { collectLinkedSuccessorNodes(indiProcSatNode,calcAlgContext); CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { CConcept* concept = conDes->getConcept(); bool conceptNegation = conDes->isNegated(); CRole* role = concept->getRole(); CPROCESSHASH* succHash = linkedSuccHash->getLinkedRoleSuccessorHash(); CLinkedRoleSaturationSuccessorData* succData = succHash->value(role); if (succData) { for (CPROCESSMAP::const_iterator itSucc = succData->mSuccNodeDataMap.constBegin(), itSuccEnd = succData->mSuccNodeDataMap.constEnd(); itSucc != itSuccEnd; ++itSucc) { CSaturationSuccessorData* indiSuccData(itSucc.value()); if (indiSuccData->mActiveCount >= 1) { if (indiSuccData->mVALUENominalConnection) { if (isConsistenceDataAvailable(calcAlgContext)) { CIndividualProcessNode* indiProcNode = getCorrectedNode(indiSuccData->mVALUENominalID,mDetCachedCGIndiVector,mCalcAlgContext); if (indiProcNode) { CReapplyConceptLabelSet* reapplyConSet = indiProcNode->getReapplyConceptLabelSet(false); bool operantsContained = true; if (reapplyConSet) { for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt && operantsContained; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConceptNegation = opLinkerIt->isNegated()^conceptNegation; if (!reapplyConSet->containsConcept(opConcept,opConceptNegation)) { operantsContained = false; } } } else { operantsContained = false; } if (!operantsContained) { return true; } } else { return true; } } } else { CIndividualSaturationProcessNode* succNode = indiSuccData->mSuccIndiNode; CReapplyConceptSaturationLabelSet* succConSet = succNode->getReapplyConceptSaturationLabelSet(false); bool operantsContained = true; if (succConSet) { for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt && operantsContained; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConceptNegation = opLinkerIt->isNegated()^conceptNegation; if (!succConSet->containsConcept(opConcept,opConceptNegation)) { operantsContained = false; } } } else { operantsContained = false; } if (!operantsContained) { //mEndSaturationDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); //QFile tmpFile("saturation-model.txt"); //if (tmpFile.open(QIODevice::WriteOnly)) { // tmpFile.write(mEndSaturationDebugIndiModelString.replace("
","").replace("

","\n").toLocal8Bit()); // tmpFile.close(); //} //bool bug = true; //CRoleBackwardSaturationPropagationHashData* backwardPropData = nullptr; //CRoleBackwardSaturationPropagationHash* backwardPropHash = indiProcSatNode->getRoleBackwardPropagationHash(false); //if (backwardPropHash) { // CPROCESSHASH* backwardPropDataHash = backwardPropHash->getRoleBackwardPropagationDataHash(); // backwardPropData = backwardPropDataHash->valuePointer(role); //} //CSaturationSuccessorALLConceptExtensionData* satSucALLConExtData = nullptr; //CSaturationLinkedSuccessorIndividualALLConceptsExtensionData* satSucALLConExtRoleData = nullptr; //CSaturationIndividualNodeSuccessorExtensionData* indiProcSatNodeSuccExt = indiProcSatNode->getSuccessorExtensionData(false); //if (indiProcSatNodeSuccExt) { // CSaturationIndividualNodeALLConceptsExtensionData* indiProcSatNodeALLConSuccExt = indiProcSatNodeSuccExt->getALLConceptsExtensionData(false); // if (indiProcSatNodeALLConSuccExt) { // satSucALLConExtRoleData = indiProcSatNodeALLConSuccExt->getALLConceptsExtensionData(succNode,false); // if (satSucALLConExtRoleData) { // satSucALLConExtData = satSucALLConExtRoleData->getRoleSuccessorALLConceptExtensionData(role,false); // } // } //} return true; } } } } } } } return false; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isCriticalORConceptDescriptorInsufficient(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(SATURATIONCRITICALORCOUNT,calcAlgContext); CConcept* concept = conDes->getConcept(); bool conceptNegation = conDes->isNegated(); CReapplyConceptSaturationLabelSet* conSet = indiProcSatNode->getReapplyConceptSaturationLabelSet(false); if (conSet) { for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConceptNegation = opLinkerIt->isNegated()^conceptNegation; if (conSet->containsConcept(opConcept,opConceptNegation)) { return false; } } } return true; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isCriticalEQCANDConceptDescriptorProblematic(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(SATURATIONCRITICALORCOUNT,calcAlgContext); CConcept* concept = conDes->getConcept(); bool conceptNegation = conDes->isNegated(); CReapplyConceptSaturationLabelSet* conSet = indiProcSatNode->getReapplyConceptSaturationLabelSet(false); if (conSet) { for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConceptNegation = opLinkerIt->isNegated()^conceptNegation; if (conSet->containsConcept(opConcept,opConceptNegation)) { return false; } } } return true; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isCriticalATMOSTConceptDescriptorInsufficient(CConceptSaturationDescriptor* conDes, bool& ancestorPossiblyCriticalFlag, CIndividualSaturationProcessNode*& functionallyRestrictedSuccessorNode, CXNegLinker*& functionallyRestrictedSuccessorCreationRoleLinker, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(SATURATIONCRITICALATMOSTCOUNT,calcAlgContext); CConcept* concept = conDes->getConcept(); bool conceptNegation = conDes->isNegated(); CRole* role = concept->getRole(); cint64 allowedCardinality = concept->getParameter() - 1*conceptNegation; if (allowedCardinality < 0) { return true; } if (!indiProcSatNode->hasSubstituteIndividualNode()) { //if (getDebugIndividualConceptName(indiProcSatNode,calcAlgContext) == "http://www.projecthalo.com/aura#Hydrogenated-Margarine") { // bool debug = true; //} collectLinkedSuccessorNodes(indiProcSatNode,calcAlgContext); CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { cint64 foundCardinality = 0; CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinker = nullptr; CPROCESSHASH* succHash = linkedSuccHash->getLinkedRoleSuccessorHash(); CLinkedRoleSaturationSuccessorData* succData = succHash->value(role); if (succData) { if (succData->mSuccCount >= allowedCardinality) { bool trivialQualification = true; for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); trivialQualification && opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConceptNegation = opLinkerIt->isNegated(); cint64 opCode = opConcept->getOperatorCode(); if (opConceptNegation || (opCode != CCATOM && opCode != CCSUB)) { trivialQualification = false; } } CIndividualSaturationProcessNode* lastSuccessorNode = nullptr; CXNegLinker* lastSuccessorCreationRoleLinker = nullptr; for (CPROCESSMAP::const_iterator itSucc = succData->mSuccNodeDataMap.constBegin(), itSuccEnd = succData->mSuccNodeDataMap.constEnd(); itSucc != itSuccEnd; ++itSucc) { CSaturationSuccessorData* succRoleData = itSucc.value(); if (succRoleData->mActiveCount >= 1) { cint64 succCardinality(succRoleData->mSuccCount); bool operantsContainedNegative = true; bool operantsContainedPositive = true; bool operantsContained = true; if (succRoleData->mVALUENominalConnection) { lastSuccessorNode = nullptr; lastSuccessorCreationRoleLinker = nullptr; CIndividualProcessNode* indiProcNode = getCorrectedNode(succRoleData->mVALUENominalID,mDetCachedCGIndiVector,mCalcAlgContext); if (indiProcNode) { CReapplyConceptLabelSet* reapplyConSet = indiProcNode->getReapplyConceptLabelSet(false); if (reapplyConSet) { if (concept->getOperandList()) { for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConceptNegation = opLinkerIt->isNegated(); bool containedNegation = false; if (reapplyConSet->containsConcept(opConcept,&containedNegation)) { if (containedNegation == opConceptNegation) { operantsContainedNegative = false; } else { operantsContainedPositive = false; } } else { if (trivialQualification) { operantsContainedPositive = false; } else { operantsContained = false; } } } } else { operantsContainedNegative = false; } } else { if (trivialQualification) { operantsContainedPositive = false; } else { operantsContained = false; } } } } else { CIndividualSaturationProcessNode* succNode(succRoleData->mSuccIndiNode); lastSuccessorNode = succNode; lastSuccessorCreationRoleLinker = succRoleData->mCreationRoleLinker; CReapplyConceptSaturationLabelSet* succConSet = succNode->getReapplyConceptSaturationLabelSet(false); if (succConSet) { if (concept->getOperandList()) { for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConceptNegation = opLinkerIt->isNegated(); bool containedNegation = false; if (succConSet->containsConcept(opConcept,&containedNegation)) { if (containedNegation == opConceptNegation) { operantsContainedNegative = false; } else { operantsContainedPositive = false; } } else { if (trivialQualification) { operantsContainedPositive = false; } else { operantsContained = false; } } } } else { operantsContainedNegative = false; } } else { if (trivialQualification) { operantsContainedPositive = false; } else { operantsContained = false; } } } if (operantsContainedPositive || !operantsContained) { if (!indiProcSatNode->getNominalIndividual() && succCardinality > allowedCardinality) { updateDirectAddingIndividualStatusFlags(indiProcSatNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED,calcAlgContext); } foundCardinality += succCardinality; CIndividualSaturationSuccessorLinkDataLinker* newMergingSuccDataLinker = createIndividualSaturationSuccessorLinkDataLinker(calcAlgContext); newMergingSuccDataLinker->initSuccessorLinkDataLinker(succRoleData); mergingSuccDataLinker = newMergingSuccDataLinker->append(mergingSuccDataLinker); } } } cint64 mergeableCardinality = 0; if (foundCardinality >= allowedCardinality && foundCardinality > 1) { // check whether some trivial merging is possible CPROCESSINGHASH* remainMergeableCardHash = CObjectParameterizingAllocator< CPROCESSINGHASH,CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getTaskProcessorContext()); CPROCESSINGHASH* mergeDistintHash = CObjectParameterizingAllocator< CPROCESSINGHASH,CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getTaskProcessorContext()); CPROCESSINGSET< QPair >* mergeDistintSet = CObjectParameterizingAllocator< CPROCESSINGSET< QPair >,CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getTaskProcessorContext()); if (mergingSuccDataLinker) { if (mConfSimpleMergingTestForATMOSTCriticalTesting) { for (CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinkerIt = mergingSuccDataLinker; mergingSuccDataLinkerIt && foundCardinality-mergeableCardinality >= allowedCardinality; mergingSuccDataLinkerIt = mergingSuccDataLinkerIt->getNext()) { CSaturationSuccessorData* succLinkData = mergingSuccDataLinkerIt->getData(); if (succLinkData->mSuccCount >= 1) { cint64 maxRequiredMergingCardinality = foundCardinality-mergeableCardinality-(allowedCardinality-1); cint64 mergingCardinality = getSuccessorLinkSimplyMergeableCardinalityCount(indiProcSatNode,succLinkData,mergingSuccDataLinker,remainMergeableCardHash,role,maxRequiredMergingCardinality,mergeDistintHash,mergeDistintSet,calcAlgContext); cint64 remainingCardinality = succLinkData->mSuccCount-mergingCardinality; remainMergeableCardHash->insert(succLinkData,remainingCardinality); mergeableCardinality += mergingCardinality; } } } if (mConfDetailedMergingTestForATMOSTCriticalTesting && foundCardinality-mergeableCardinality >= allowedCardinality && foundCardinality-mergeableCardinality <= allowedCardinality*2) { for (CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinkerIt = mergingSuccDataLinker; mergingSuccDataLinkerIt && foundCardinality-mergeableCardinality >= allowedCardinality; mergingSuccDataLinkerIt = mergingSuccDataLinkerIt->getNext()) { CSaturationSuccessorData* succLinkData = mergingSuccDataLinkerIt->getData(); if (succLinkData->mSuccCount >= 1) { cint64 succRemainingCardinality = remainMergeableCardHash->value(succLinkData,succLinkData->mSuccCount); if (succRemainingCardinality > 0) { cint64 maxRequiredMergingCardinality = foundCardinality-mergeableCardinality-(allowedCardinality-1); //for (CIndividualSaturationSuccessorLinkDataLinker* otherSuccDataLinkerIt = mergingSuccDataLinker; otherSuccDataLinkerIt && foundCardinality-mergeableCardinality >= allowedCardinality; otherSuccDataLinkerIt = otherSuccDataLinkerIt->getNext()) { // if (otherSuccDataLinkerIt != mergingSuccDataLinkerIt) { // CSaturationSuccessorData* otherSuccLinkData = otherSuccDataLinkerIt->getData(); // if (otherSuccLinkData->mSuccCount >= 1) { // cint64 otherSuccRemainingCardinality = remainMergeableCardHash->value(otherSuccLinkData,otherSuccLinkData->mSuccCount); // if (otherSuccRemainingCardinality > 0) { cint64 mergingCardinality = getSuccessorLinkExtendedMergeableCardinalityCount(indiProcSatNode,succLinkData,mergingSuccDataLinkerIt->getNext(),remainMergeableCardHash,role,maxRequiredMergingCardinality,mergeDistintSet,calcAlgContext); if (mergingCardinality > 0) { cint64 newSuccCard = qMax(succRemainingCardinality,mergingCardinality); remainMergeableCardHash->insert(succLinkData,newSuccCard); cint64 removedSuccCard = qMin(succRemainingCardinality,mergingCardinality); mergeableCardinality += removedSuccCard; } } } } } } if (mergingSuccDataLinker) { releaseIndividualSaturationSuccessorLinkDataLinker(mergingSuccDataLinker,calcAlgContext); } } if (foundCardinality-mergeableCardinality == allowedCardinality) { ancestorPossiblyCriticalFlag = true; if (allowedCardinality == 1) { functionallyRestrictedSuccessorNode = lastSuccessorNode; functionallyRestrictedSuccessorCreationRoleLinker = lastSuccessorCreationRoleLinker; } } if (foundCardinality-mergeableCardinality > allowedCardinality) { //mEndSaturationDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); //QFile tmpFile("saturation-model.txt"); //if (tmpFile.open(QIODevice::WriteOnly)) { // tmpFile.write(mEndSaturationDebugIndiModelString.replace("
","").replace("

","\n").toLocal8Bit()); // tmpFile.close(); //} //bool bug = true; return true; } } } } } return false; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isIndividualSuccessorLinkCardinalityMergeable(CSaturationSuccessorData* subsetIndiSuccData, CSaturationSuccessorData* superIndiSuccData, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNode* subsetIndiSuccNode = subsetIndiSuccData->mSuccIndiNode; CIndividualSaturationProcessNode* superIndiSuccNode = superIndiSuccData->mSuccIndiNode; return isIndividualSuccessorLinkCardinalityMergeable(subsetIndiSuccNode,subsetIndiSuccData,superIndiSuccNode,superIndiSuccData,calcAlgContext); } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isIndividualSuccessorLinkCardinalityMergeable(CIndividualSaturationProcessNode* subsetIndiSuccNode, CSaturationSuccessorData* subsetIndiSuccData, CIndividualSaturationProcessNode* superIndiSuccNode, CSaturationSuccessorData* superIndiSuccData, CCalculationAlgorithmContextBase* calcAlgContext) { if (subsetIndiSuccData->mVALUENominalConnection || superIndiSuccData->mVALUENominalConnection) { return false; } if (subsetIndiSuccNode->hasNominalIntegrated() || superIndiSuccNode->hasNominalIntegrated()) { return false; } if (subsetIndiSuccNode->hasDataValueApplied() || superIndiSuccNode->hasDataValueApplied()) { return false; } if (!isSuccessorCreationRoleMergingSubset(subsetIndiSuccData->mCreationRoleLinker,superIndiSuccData->mCreationRoleLinker,calcAlgContext)) { return false; } if (!isIndividualNodeLabelMergingSubset(subsetIndiSuccNode,superIndiSuccNode,true,calcAlgContext)) { return false; } return true; } cint64 CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getSuccessorLinkSimplyMergeableCardinalityCount(CIndividualSaturationProcessNode*& indiProcSatNode, CSaturationSuccessorData* succLinkData, CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinker, CPROCESSINGHASH* remainMergeableCardHash, CRole* role, cint64 maxRequiredMergingCardinality, CPROCESSINGHASH* mergeDistintHash, CPROCESSINGSET< QPair >* mergeDistintSet, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 remainingCardinality = succLinkData->mSuccCount; bool intoAllMergeable = false; bool intoAllMergeableChecked = false; for (CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinkerIt = mergingSuccDataLinker; mergingSuccDataLinkerIt; mergingSuccDataLinkerIt = mergingSuccDataLinkerIt->getNext()) { CSaturationSuccessorData* mergeSuccLinkData = mergingSuccDataLinkerIt->getData(); if (mergeSuccLinkData != succLinkData) { cint64 mergeableCardinality = remainMergeableCardHash->value(mergeSuccLinkData,mergeSuccLinkData->mSuccCount); if (mergeableCardinality >= succLinkData->mSuccCount) { if (!mergeDistintSet->contains(QPair(qMin(mergeSuccLinkData,succLinkData),qMax(mergeSuccLinkData,succLinkData)))) { if (isIndividualSuccessorLinkCardinalityMergeable(succLinkData,mergeSuccLinkData,calcAlgContext)) { return remainingCardinality; } else { intoAllMergeableChecked = true; } } else { intoAllMergeableChecked = true; } } } } cint64 mergedCardinality = 0; for (CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinkerIt = mergingSuccDataLinker; mergingSuccDataLinkerIt && remainingCardinality > 0 && mergedCardinality < maxRequiredMergingCardinality; mergingSuccDataLinkerIt = mergingSuccDataLinkerIt->getNext()) { CSaturationSuccessorData* mergeSuccLinkData = mergingSuccDataLinkerIt->getData(); if (mergeSuccLinkData != succLinkData) { cint64 mergeableCardinality = remainMergeableCardHash->value(mergeSuccLinkData,mergeSuccLinkData->mSuccCount); if (mergeableCardinality > 0 && mergeableCardinality < succLinkData->mSuccCount) { if (!mergeDistintSet->contains(QPair(qMin(mergeSuccLinkData,succLinkData),qMax(mergeSuccLinkData,succLinkData)))) { if (intoAllMergeable || isIndividualSuccessorLinkCardinalityMergeable(succLinkData,mergeSuccLinkData,calcAlgContext)) { if (!intoAllMergeableChecked) { intoAllMergeable = true; for (CIndividualSaturationSuccessorLinkDataLinker* remTestSuccDataLinkerIt = mergingSuccDataLinkerIt->getNext(); remTestSuccDataLinkerIt; remTestSuccDataLinkerIt = remTestSuccDataLinkerIt->getNext()) { CSaturationSuccessorData* remTestSuccLinkData = remTestSuccDataLinkerIt->getData(); if (remTestSuccLinkData != succLinkData && remTestSuccLinkData != mergeSuccLinkData) { cint64 mergeableCardinality = remainMergeableCardHash->value(remTestSuccLinkData,remTestSuccLinkData->mSuccCount); if (mergeableCardinality > 0 && mergeableCardinality < succLinkData->mSuccCount) { if (!mergeDistintSet->contains(QPair(qMin(remTestSuccLinkData,succLinkData),qMax(remTestSuccLinkData,succLinkData)))) { if (!isIndividualSuccessorLinkCardinalityMergeable(succLinkData,mergeSuccLinkData,calcAlgContext)) { intoAllMergeable = false; } } } } } intoAllMergeableChecked = true; } if (!intoAllMergeable && succLinkData->mSuccCount > 1) { mergeDistintSet->insert(QPair(qMin(mergeSuccLinkData,succLinkData),qMax(mergeSuccLinkData,succLinkData))); for (CPROCESSINGHASH::const_iterator mDIt = mergeDistintHash->constFind(succLinkData), mDItEnd = mergeDistintHash->constEnd(); mDIt != mDItEnd && mDIt.key() == succLinkData; ++mDIt) { CSaturationSuccessorData* distSuccData = mDIt.value(); mergeDistintHash->insertMulti(distSuccData,mergeSuccLinkData); mergeDistintHash->insertMulti(mergeSuccLinkData,distSuccData); mergeDistintSet->insert(QPair(qMin(mergeSuccLinkData,distSuccData),qMax(mergeSuccLinkData,distSuccData))); } mergeDistintHash->insertMulti(succLinkData,mergeSuccLinkData); mergeDistintHash->insertMulti(mergeSuccLinkData,succLinkData); } cint64 mergingCardinality = qMin(remainingCardinality,mergeableCardinality); remainingCardinality -= mergingCardinality; mergedCardinality += mergingCardinality; } else { intoAllMergeableChecked = true; } } else { intoAllMergeableChecked = true; } } } } return mergedCardinality; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isIndividualSuccessorLinkCardinalityExtendedMergeable(CIndividualSaturationProcessNode*& indiProcSatNode, CSaturationSuccessorData* indiSuccData1, CSaturationSuccessorData* indiSuccData2, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNode* indiSuccNode1 = indiSuccData1->mSuccIndiNode; CIndividualSaturationProcessNode* indiSuccNode2 = indiSuccData2->mSuccIndiNode; return isIndividualSuccessorLinkCardinalityExtendedMergeable(indiProcSatNode,indiSuccNode1,indiSuccData1,indiSuccNode2,indiSuccData2,calcAlgContext); } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isIndividualSuccessorLinkCardinalityExtendedMergeable(CIndividualSaturationProcessNode*& indiProcSatNode, CIndividualSaturationProcessNode* indiSuccNode1, CSaturationSuccessorData* indiSuccData1, CIndividualSaturationProcessNode* indiSuccNode2, CSaturationSuccessorData* indiSuccData2, CCalculationAlgorithmContextBase* calcAlgContext) { if (indiSuccData1->mVALUENominalConnection || indiSuccData2->mVALUENominalConnection) { return false; } if (indiSuccNode1->hasNominalIntegrated() || indiSuccNode2->hasNominalIntegrated()) { return false; } if (indiSuccNode1->hasDataValueApplied() || indiSuccNode2->hasDataValueApplied()) { return false; } if (!isSuccessorCreationRoleMergingSubset(indiSuccData1->mCreationRoleLinker,indiSuccData2->mCreationRoleLinker,calcAlgContext)) { return false; } if (!isSuccessorCreationRoleMergingSubset(indiSuccData2->mCreationRoleLinker,indiSuccData1->mCreationRoleLinker,calcAlgContext)) { return false; } if (isIndividualNodeLabelMergingProblematic(indiProcSatNode,indiSuccNode1,indiSuccNode2,indiSuccData1->mCreationRoleLinker,calcAlgContext)) { return false; } if (isIndividualNodeLabelMergingProblematic(indiProcSatNode,indiSuccNode2,indiSuccNode1,indiSuccData2->mCreationRoleLinker,calcAlgContext)) { return false; } return true; } cint64 CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getIndividualNodeQualifiedSuccessorCount(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CSortedNegLinker* conQualificationLinker, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 matchingSuccCount = 0; CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { CPROCESSHASH* succHash = linkedSuccHash->getLinkedRoleSuccessorHash(); CLinkedRoleSaturationSuccessorData* predSuccData = succHash->value(role); if (predSuccData) { bool trivialQualification = true; for (CSortedNegLinker* opLinkerIt = conQualificationLinker; trivialQualification && opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConceptNegation = opLinkerIt->isNegated(); cint64 opCode = opConcept->getOperatorCode(); if (opConceptNegation || (opCode != CCATOM && opCode != CCSUB)) { trivialQualification = false; } } CIndividualSaturationProcessNode* lastSuccessorNode = nullptr; CXNegLinker* lastSuccessorCreationRoleLinker = nullptr; for (CPROCESSMAP::const_iterator itSucc = predSuccData->mSuccNodeDataMap.constBegin(), itSuccEnd = predSuccData->mSuccNodeDataMap.constEnd(); itSucc != itSuccEnd; ++itSucc) { CSaturationSuccessorData* succRoleData = itSucc.value(); if (succRoleData->mActiveCount >= 1) { cint64 succCardinality(succRoleData->mSuccCount); bool operantsContainedNegative = true; bool operantsContainedPositive = true; bool operantsContained = true; if (succRoleData->mVALUENominalConnection) { operantsContainedPositive = true; } else { CIndividualSaturationProcessNode* succNode(succRoleData->mSuccIndiNode); lastSuccessorNode = succNode; lastSuccessorCreationRoleLinker = succRoleData->mCreationRoleLinker; CReapplyConceptSaturationLabelSet* succConSet = succNode->getReapplyConceptSaturationLabelSet(false); if (succConSet) { if (conQualificationLinker) { for (CSortedNegLinker* opLinkerIt = conQualificationLinker; opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConceptNegation = opLinkerIt->isNegated(); bool containedNegation = false; if (succConSet->containsConcept(opConcept,&containedNegation)) { if (containedNegation == opConceptNegation) { operantsContainedNegative = false; } else { operantsContainedPositive = false; } } else { if (trivialQualification) { operantsContainedPositive = false; } else { operantsContained = false; } } } } else { operantsContainedNegative = false; } } else { if (trivialQualification) { operantsContainedPositive = false; } else { operantsContained = false; } } } if (operantsContainedPositive || !operantsContained) { matchingSuccCount += succCardinality; } } } } } return matchingSuccCount; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isIndividualNodeLabelMergingProblematic(CIndividualSaturationProcessNode*& indiProcSatNode, CIndividualSaturationProcessNode* mergingSuccNode, CIndividualSaturationProcessNode* probTestingSuccNode, CXNegLinker* creationRoleLinker, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyConceptSaturationLabelSet* mergingConSet = mergingSuccNode->getReapplyConceptSaturationLabelSet(false); CReapplyConceptSaturationLabelSet* propTestConSet = probTestingSuccNode->getReapplyConceptSaturationLabelSet(false); for (CConceptSaturationDescriptor* conDesIt = mergingConSet->getConceptSaturationDescriptionLinker(); conDesIt; conDesIt = conDesIt->getNextConceptDesciptor()) { CConcept* concept = conDesIt->getConcept(); bool negation = conDesIt->isNegated(); CConceptSaturationDescriptor* propTestConDes = nullptr; CImplicationReapplyConceptSaturationDescriptor* propTestImpReapDes = nullptr; if (propTestConSet->getConceptDescriptorAndReapplyQueue(concept,propTestConDes,propTestImpReapDes)) { if (propTestConDes) { if (propTestConDes->isNegated() != negation) { return true; } } else if (!negation && propTestImpReapDes) { CConcept* propTestImpCon = propTestImpReapDes->getImplicationConcept(); if (!propTestConSet->containsConcept(propTestImpCon->getOperandList()->getData()) && !mergingConSet->containsConcept(propTestImpCon->getOperandList()->getData())) { return true; } } } else { // test whether concept is critical for (CConceptSaturationDescriptor* predConDesIt = indiProcSatNode->getReapplyConceptSaturationLabelSet(false)->getConceptSaturationDescriptionLinker(); predConDesIt; predConDesIt = predConDesIt->getNextConceptDesciptor()) { CConcept* predConcept = predConDesIt->getConcept(); bool predConNegation = predConDesIt->isNegated(); cint64 predConOpCode = concept->getOperatorCode(); if (predConNegation && predConOpCode == CCATLEAST || !predConNegation && predConOpCode == CCATMOST) { CConcept* predOpCon = nullptr; if (predConcept->getOperandList()) { predOpCon = predConcept = predConcept->getOperandList()->getData(); } if (!predOpCon || predOpCon == concept) { for (CXNegLinker* creationRoleLinkerIt = creationRoleLinker; creationRoleLinkerIt; creationRoleLinkerIt = creationRoleLinkerIt->getNext()) { if (!creationRoleLinkerIt->isNegated()) { CRole* creationRole = creationRoleLinkerIt->getData(); for (CSortedNegLinker* creationSuperRoleIt = creationRole->getIndirectSuperRoleList(); creationSuperRoleIt; creationSuperRoleIt = creationSuperRoleIt->getNext()) { if (!creationSuperRoleIt->isNegated()) { CRole* creationSuperRole = creationSuperRoleIt->getData(); if (creationSuperRole == predConcept->getRole()) { cint64 allowedCardinality = predConcept->getParameter() - 1*predConNegation; if (getIndividualNodeQualifiedSuccessorCount(indiProcSatNode,creationSuperRole,predConcept->getOperandList(),calcAlgContext) > allowedCardinality) { return true; } } } } } } } } } cint64 opCode = concept->getOperatorCode(); CConceptOperator* conOp = concept->getConceptOperator(); if (!negation && conOp->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQALL_TYPE) || negation && conOp->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_SOME_TYPE) || !negation && opCode == CCATMOST || negation && opCode == CCATLEAST) { collectLinkedSuccessorNodes(probTestingSuccNode,calcAlgContext); CLinkedRoleSaturationSuccessorHash* propTestLinkedSuccHash = probTestingSuccNode->getLinkedRoleSuccessorHash(false); if (propTestLinkedSuccHash) { CRole* role = concept->getRole(); if (propTestLinkedSuccHash->hasLinkedRoleSuccessorData(role)) { return true; } } } if (!negation && conOp->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_SOME_TYPE | CConceptOperator::CCF_SELF | CConceptOperator::CCF_ATLEAST) || negation && conOp->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQALL_TYPE | CConceptOperator::CCF_ATMOST)) { CRoleBackwardSaturationPropagationHash* propTestBackwardPropHash = probTestingSuccNode->getRoleBackwardPropagationHash(false); if (propTestBackwardPropHash) { CRole* role = concept->getRole(); CPROCESSHASH* backwardPropDataHash = propTestBackwardPropHash->getRoleBackwardPropagationDataHash(); for (CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { if (!superRoleIt->isNegated()) { CRole* superRole = superRoleIt->getData(); CRoleBackwardSaturationPropagationHashData* backwardPropData = backwardPropDataHash->valuePointer(superRole); if (backwardPropData && backwardPropData->mReapplyLinker) { return true; } } } } } } } return false; } cint64 CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getSuccessorLinkExtendedMergeableCardinalityCount(CIndividualSaturationProcessNode*& indiProcSatNode, CSaturationSuccessorData* succLinkData, CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinker, CPROCESSINGHASH* remainMergeableCardHash, CRole* role, cint64 maxRequiredMergingCardinality, CPROCESSINGSET< QPair >* mergeDistintSet, CCalculationAlgorithmContextBase* calcAlgContext) { for (CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinkerIt = mergingSuccDataLinker; mergingSuccDataLinkerIt; mergingSuccDataLinkerIt = mergingSuccDataLinkerIt->getNext()) { CSaturationSuccessorData* mergeSuccLinkData = mergingSuccDataLinkerIt->getData(); cint64 mergeableCardinality = remainMergeableCardHash->value(mergeSuccLinkData,mergeSuccLinkData->mSuccCount); if (mergeableCardinality > 0) { if (!mergeDistintSet->contains(QPair(qMin(mergeSuccLinkData,succLinkData),qMax(mergeSuccLinkData,succLinkData)))) { if (isIndividualSuccessorLinkCardinalityExtendedMergeable(indiProcSatNode,succLinkData,mergeSuccLinkData,calcAlgContext)) { remainMergeableCardHash->insert(mergeSuccLinkData,0); return mergeableCardinality; } } } } return 0; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isCriticalNOMINALConceptDescriptorInsufficient(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CIndividual* nominal = concept->getNominalIndividual(); cint64 nominalID = nominal->getIndividualID(); if (isConsistenceDataAvailable(calcAlgContext)) { CIndividualProcessNode* detNominalProcessNode = getCorrectedNode(nominalID,mDetCachedCGIndiVector,mCalcAlgContext); if (detNominalProcessNode) { CIndividualProcessNode* nonDetNominalProcessNode = getCorrectedNode(nominalID,mNonDetCachedCGIndiVector,mCalcAlgContext); CReapplyConceptLabelSet* detNominalReapplyConSet = detNominalProcessNode->getReapplyConceptLabelSet(false); CReapplyConceptLabelSet* nonDetNominalReapplyConSet = nonDetNominalProcessNode->getReapplyConceptLabelSet(false); CReapplyConceptSaturationLabelSet* satIndiNodeConSet = indiProcSatNode->getReapplyConceptSaturationLabelSet(false); CConceptDescriptor* lastDetConDesIt = detNominalReapplyConSet->getAddingSortedConceptDescriptionLinker(); for (CConceptDescriptor* conDesIt = nonDetNominalReapplyConSet->getAddingSortedConceptDescriptionLinker(); conDesIt && conDesIt != lastDetConDesIt; conDesIt = conDesIt->getNext()) { CConcept* nominalConcept = conDesIt->getConcept(); bool nominalConceptNegation = conDesIt->isNegated(); if (!satIndiNodeConSet->containsConcept(nominalConcept,nominalConceptNegation)) { return true; } } return false; } else { return true; } } else { return true; } } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isCriticalVALUEConceptDescriptorInsufficient(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CIndividual* nominal = concept->getNominalIndividual(); cint64 nominalID = nominal->getIndividualID(); if (isConsistenceDataAvailable(calcAlgContext)) { CIndividualProcessNode* detNominalProcessNode = getCorrectedNode(nominalID,mDetCachedCGIndiVector,mCalcAlgContext); if (detNominalProcessNode) { CIndividualProcessNode* nonDetNominalProcessNode = getCorrectedNode(nominalID,mNonDetCachedCGIndiVector,mCalcAlgContext); CReapplyConceptLabelSet* detNominalReapplyConSet = detNominalProcessNode->getReapplyConceptLabelSet(false); CReapplyRoleSuccessorHash* nonDetNominalReapplyRoleSuccHash = nonDetNominalProcessNode->getReapplyRoleSuccessorHash(false); CReapplyConceptSaturationLabelSet* satIndiNodeConSet = indiProcSatNode->getReapplyConceptSaturationLabelSet(false); if (nonDetNominalReapplyRoleSuccHash) { for (CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { CRole* superRole = superRoleIt->getData(); bool inversedSuperRole = superRoleIt->isNegated(); if (!inversedSuperRole) { CReapplyQueueIterator reapplyRoleIt(nonDetNominalReapplyRoleSuccHash->getRoleReapplyIterator(superRole)); while (reapplyRoleIt.hasNext()) { CReapplyConceptDescriptor* reapplyDes = reapplyRoleIt.next(); CConceptDescriptor* reapplyConDes = reapplyDes->getConceptDescriptor(); CConcept* reapplyConcept = reapplyConDes->getConcept(); bool reapplyConceptNegation = reapplyConDes->isNegated(); if (!reapplyConceptNegation && detNominalReapplyConSet->containsConcept(reapplyConcept,reapplyConceptNegation)) { cint64 reapplyConceptCode = reapplyConcept->getOperatorCode(); CConceptOperator* reapplyConceptOperator = reapplyConcept->getConceptOperator(); if (!reapplyConceptNegation && reapplyConceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_PROPAGATION_ALL_TYPE)) { return true; } else if (!reapplyConceptNegation && reapplyConceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_AQALL_TYPE) || reapplyConceptNegation && reapplyConceptCode == CCSOME) { for (CSortedNegLinker* reapplyConceptOpLinkerIt = reapplyConcept->getOperandList(); reapplyConceptOpLinkerIt; reapplyConceptOpLinkerIt = reapplyConceptOpLinkerIt->getNext()) { CConcept* reapplyOperandConcept = reapplyConceptOpLinkerIt->getData(); bool reapplyOperandConceptNegation = reapplyConceptOpLinkerIt->isNegated()^reapplyConceptNegation; if (!satIndiNodeConSet->containsConcept(reapplyOperandConcept,reapplyOperandConceptNegation)) { return true; } } } else if (!reapplyConceptNegation && reapplyConceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQAND_TYPE)) { testAutomateTransitionOperandsAddable(indiProcSatNode,reapplyConcept,role,mCalcAlgContext); } else { return true; } return false; } } } } } } return false; } else { return true; } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateExtractDisjunctCommonConcept(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CSaturationConceptDataItem* conceptSatItem = (CSaturationConceptDataItem*)indiProcSatNode->getSaturationConceptReferenceLinking();; CConcept* disjunctionConcept = conceptSatItem->getSaturationConcept(); bool disjunctionNegation = conceptSatItem->getSaturationNegation(); CSortedNegLinker* disjunctConceptLinker = disjunctionConcept->getOperandList(); CSaturationDisjunctCommonConceptExtractionData* extractionData = indiProcSatNode->getDisjunctCommonConceptExtractionData(false); if (extractionData) { CReapplyConceptSaturationLabelSet* disjunctionConSet = indiProcSatNode->getReapplyConceptSaturationLabelSet(true); CSaturationDisjunctCommonConceptCountHash* commonConceptCountHash = extractionData->getSaturationDisjunctCommonConceptCountHash(); for (CSaturationDisjunctExtractionLinker* satDisjExtLinkerIt = extractionData->getDisjunctIndividualNodeExtractionLinker(); satDisjExtLinkerIt; satDisjExtLinkerIt = satDisjExtLinkerIt->getNext()) { CIndividualSaturationProcessNode* disjConIndiNode = satDisjExtLinkerIt->getDisjunctIndividualSaturationProcessNode(); CConceptSaturationDescriptor* lastExaminedDisjConSatDes = satDisjExtLinkerIt->getLastExaminedConceptSaturationDescriptor(); CReapplyConceptSaturationLabelSet* disjConConSet = disjConIndiNode->getReapplyConceptSaturationLabelSet(false); if (disjConConSet) { CConceptSaturationDescriptor* newLastExaminedDisjConSatDes = disjConConSet->getConceptSaturationDescriptionLinker(); satDisjExtLinkerIt->setLastExaminedConceptSaturationDescriptor(newLastExaminedDisjConSatDes); for (CConceptSaturationDescriptor* disjConSatDesIt = newLastExaminedDisjConSatDes; disjConSatDesIt != lastExaminedDisjConSatDes; disjConSatDesIt = disjConSatDesIt->getNext()) { CConcept* disjConcept = disjConSatDesIt->getConcept(); bool disjNegation = disjConSatDesIt->isNegated(); if (commonConceptCountHash->incCommonConceptCountReturnMaxReached(disjConSatDesIt)) { addConceptFilteredToIndividual(disjConcept,disjNegation,indiProcSatNode,disjunctionConSet,true,calcAlgContext); } } } } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::initializeExtractDisjunctCommonConcept(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CSaturationDisjunctCommonConceptExtractionData* extractionData = indiProcSatNode->getDisjunctCommonConceptExtractionData(true); CSaturationConceptDataItem* conceptSatItem = (CSaturationConceptDataItem*)indiProcSatNode->getSaturationConceptReferenceLinking(); CConcept* disjunctionConcept = conceptSatItem->getSaturationConcept(); bool disjunctionNegation = conceptSatItem->getSaturationNegation(); CSortedNegLinker* disjunctConceptLinker = disjunctionConcept->getOperandList(); cint64 disjCount = 0; for (CSortedNegLinker* disjunctConceptLinkerIt = disjunctConceptLinker; disjunctConceptLinkerIt; disjunctConceptLinkerIt = disjunctConceptLinkerIt->getNext()) { ++disjCount; CConcept* disjunctConcept = disjunctConceptLinkerIt->getData(); bool disjunctNegation = disjunctConceptLinkerIt->isNegated()^disjunctionNegation; CConceptProcessData* conProData = (CConceptProcessData*)disjunctConcept->getConceptData(); CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conProData->getConceptReferenceLinking(); CSaturationConceptReferenceLinking* disjunctConceptRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(disjunctNegation); CIndividualSaturationProcessNode* disConIndiNode = (CIndividualSaturationProcessNode*)disjunctConceptRefLinkData->getIndividualProcessNodeForConcept(); addUninitializedIndividualToProcessingQueue(disConIndiNode,calcAlgContext); CSaturationDisjunctExtractionLinker* disNodeExtLinker = CObjectAllocator::allocateAndConstruct(taskMemMan); disNodeExtLinker->initSaturationDisjunctExtractionLinker(disConIndiNode,nullptr); extractionData->addDisjunctIndividualNodeExtractionLinker(disNodeExtLinker); CSaturationModifiedProcessUpdateLinker* modProcUpdLinker = createModifiedProcessUpdateLinker(calcAlgContext); modProcUpdLinker->initProcessUpdateLinker(indiProcSatNode,CSaturationModifiedProcessUpdateLinker::UPDATEPDISJUNCTCOMMONCONCEPTSEXTRACTION); disConIndiNode->getReapplyConceptSaturationLabelSet(true)->addModifiedUpdateLinker(modProcUpdLinker); } extractionData->getSaturationDisjunctCommonConceptCountHash()->setDisjunctCount(disjCount); updateExtractDisjunctCommonConcept(indiProcSatNode,calcAlgContext); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addDisjunctCommonConceptExtractionToProcessingQueue(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CSaturationDisjunctCommonConceptExtractionData* extractionData = indiProcSatNode->getDisjunctCommonConceptExtractionData(false); if (extractionData) { CIndividualSaturationProcessNodeLinker* processNodeLinker = extractionData->getExtractionContinueProcessLinker(); if (!processNodeLinker->isProcessingQueued()) { processNodeLinker->setProcessingQueued(); calcAlgContext->getUsedProcessingDataBox()->addIndividualDisjunctCommonConceptExtractProcessLinker(processNodeLinker); } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::createRoleAssertionLink(CIndividualSaturationProcessNode*& sourceNode, CIndividualSaturationProcessNode*& destinationNode, CRole* role, bool roleInversed, CCalculationAlgorithmContextBase* calcAlgContext) { updateIndirectAddingIndividualStatusFlags(sourceNode,destinationNode->getIndirectStatusFlags(),mCalcAlgContext); CMemoryAllocationManager* taskMemMan = mCalcAlgContext->getUsedProcessTaskMemoryAllocationManager(); bool existIndiInitialized = destinationNode->isInitialized() || destinationNode == sourceNode; CReapplyConceptSaturationLabelSet* conSet = nullptr; CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); bool connected = false; while (superRoleIt) { CRole* superRole = superRoleIt->getData(); if (superRole->getDisjointRoleList() != nullptr) { updateDirectAddingIndividualStatusFlags(sourceNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } CSortedNegLinker* domainConLinker = superRole->getDomainRangeConceptList(superRoleIt->isNegated()^roleInversed); for (CSortedNegLinker* domainConLinkerIt = domainConLinker; domainConLinkerIt; domainConLinkerIt = domainConLinkerIt->getNext()) { CConcept* domainConcept = domainConLinkerIt->getData(); bool domainConceptNegation = domainConLinkerIt->isNegated(); if (!conSet) { conSet = sourceNode->getReapplyConceptSaturationLabelSet(true); } addConceptFilteredToIndividual(domainConcept,domainConceptNegation,sourceNode,conSet,false,mCalcAlgContext); } if (superRoleIt->isNegated()^roleInversed) { connected = true; CBackwardSaturationPropagationLink* backPropLink = CObjectAllocator::allocateAndConstruct(taskMemMan); backPropLink->initBackwardPropagationLink(sourceNode,superRole); if (!existIndiInitialized) { destinationNode->addInitializingBackwardPropagationLinks(backPropLink); } else { installBackwardPropagationLink(sourceNode,destinationNode,superRole,backPropLink,true,true,calcAlgContext); } } else { addNewLinkedExtensionProcessingRole(superRole,sourceNode,true,true,mCalcAlgContext); } superRoleIt = superRoleIt->getNext(); } if (!connected) { CXLinker* nonInvConnectedIndiNodeLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(taskMemMan); nonInvConnectedIndiNodeLinker->initLinker(sourceNode); destinationNode->addNonInverseConnectedIndividualNodeLinker(nonInvConnectedIndiNodeLinker); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::initializeRoleAssertions(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividual* nominalIndi = indiProcSatNode->getNominalIndividual(); if (nominalIndi) { cint64 saturationID = getSaturationIDForIndividualNode(nominalIndi,calcAlgContext); //if (CIRIName::getRecentIRIName(nominalIndi->getIndividualNameLinker()) == "http://www.biopax.org/release/biopax-level2.owl#protein1189") { // bool bug = true; //} CIndividualSaturationProcessNode* resolveNode = nullptr; if (indiProcSatNode->isSeparated()) { resolveNode = getSeparatedSaturationConceptAssertionResolveNode(calcAlgContext); } else { CConcept* topConcept = calcAlgContext->getUsedProcessingDataBox()->getOntologyTopConcept(); resolveNode = getIndividualNodeForConcept(topConcept,false,calcAlgContext); } for (CRoleAssertionLinker* assRoleLinkerIt = nominalIndi->getAssertionRoleLinker(); assRoleLinkerIt; assRoleLinkerIt = assRoleLinkerIt->getNext()) { CRole* role = assRoleLinkerIt->getRole(); CIndividual* othIndi = assRoleLinkerIt->getIndividual(); CIndividualSaturationProcessNode* othIndiNode = getIndividualNodeForIndividual(indiProcSatNode,othIndi,saturationID,calcAlgContext); if (othIndiNode && (othIndiNode->isInitialized() || othIndiNode == indiProcSatNode)) { createRoleAssertionLink(indiProcSatNode,othIndiNode,role,false,calcAlgContext); indiProcSatNode->addRoleAssertion(othIndiNode,role,false); createRoleAssertionLink(othIndiNode,indiProcSatNode,role,true,calcAlgContext); othIndiNode->addRoleAssertion(indiProcSatNode,role,true); } else if (!othIndiNode) { CIndividualSaturationProcessNode* otherIndiRepNode = getResolvedIndividualNodeRepresentativeRangeAssertion(resolveNode,othIndi,role,false,calcAlgContext); createRoleAssertionLink(indiProcSatNode,otherIndiRepNode,role,false,calcAlgContext); indiProcSatNode->addRoleAssertion(otherIndiRepNode,role,false); } } for (CReverseRoleAssertionLinker* reverseAssRoleLinkerIt = nominalIndi->getReverseAssertionRoleLinker(); reverseAssRoleLinkerIt; reverseAssRoleLinkerIt = reverseAssRoleLinkerIt->getNext()) { CRole* role = reverseAssRoleLinkerIt->getRole(); CIndividual* othIndi = reverseAssRoleLinkerIt->getIndividual(); CIndividualSaturationProcessNode* othIndiNode = getIndividualNodeForIndividual(indiProcSatNode,othIndi,saturationID,calcAlgContext); if (othIndiNode && othIndiNode->isInitialized()) { createRoleAssertionLink(othIndiNode,indiProcSatNode,role,false,calcAlgContext); othIndiNode->addRoleAssertion(indiProcSatNode,role,false); createRoleAssertionLink(indiProcSatNode,othIndiNode,role,true,calcAlgContext); indiProcSatNode->addRoleAssertion(othIndiNode,role,true); } else if (!othIndiNode) { CIndividualSaturationProcessNode* otherIndiRepNode = getResolvedIndividualNodeRepresentativeRangeAssertion(resolveNode,othIndi,role,true,calcAlgContext); createRoleAssertionLink(indiProcSatNode,otherIndiRepNode,role,true,calcAlgContext); indiProcSatNode->addRoleAssertion(otherIndiRepNode,role,true); } } } } CIndividualSaturationProcessNode* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getSeparatedSaturationConceptAssertionResolveNode(CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CConcept* topConcept = procDataBox->getOntologyTopConcept(); CIndividualSaturationProcessNode* resolveNode = procDataBox->getSeparatedSaturationConceptAssertionResolveNode(); if (!resolveNode) { resolveNode = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); cint64 nextResolveIndiID = calcAlgContext->getUsedProcessingDataBox()->getNextSaturationResolvedSuccessorExtensionIndividualNodeID(); resolveNode->initIndividualSaturationProcessNode(nextResolveIndiID,nullptr,nullptr); resolveNode->setInitialized(true); resolveNode->setSeparated(true); resolveNode->setRequiredBackwardPropagation(true); addIndividualToCompletionQueue(resolveNode,calcAlgContext); CIndividualSaturationProcessNodeLinker* resolveNodeProcessLiner = CObjectAllocator::allocateAndConstruct(calcAlgContext->getUsedProcessTaskMemoryAllocationManager()); resolveNodeProcessLiner->initProcessNodeLinker(resolveNode,true); resolveNode->setIndividualSaturationProcessNodeLinker(resolveNodeProcessLiner); calcAlgContext->getUsedProcessingDataBox()->addIndividualSaturationProcessNodeLinker(resolveNodeProcessLiner); CIndividualSaturationProcessNodeVector* indiVec = calcAlgContext->getUsedProcessingDataBox()->getIndividualSaturationProcessNodeVector(true); indiVec->setData(resolveNode->getIndividualID(),resolveNode); CReapplyConceptSaturationLabelSet* resolveConSet = resolveNode->getReapplyConceptSaturationLabelSet(true); addConceptFilteredToIndividual(topConcept,false,resolveNode,resolveConSet,false,calcAlgContext); procDataBox->setSeparatedSaturationConceptAssertionResolveNode(resolveNode); } return resolveNode; } CIndividualSaturationProcessNode* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getIndividualNodeForConcept(CConcept* concept, bool negated, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNode* node = nullptr; CConceptData* conceptData = concept->getConceptData(); if (conceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)conceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* satCalcRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(negated); if (satCalcRefLinkData) { node = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } return node; } cint64 CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getSaturationIDForIndividualNode(CIndividual* individual, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessData* indiProcData = (CIndividualProcessData*)individual->getIndividualData(); bool hasRefLinking = false; if (indiProcData) { CConceptReferenceLinking* refLinking = indiProcData->getSaturationReferenceLinkingData(); if (refLinking) { CIndividualSaturationReferenceLinkingData* satCalcRefLinkData = (CIndividualSaturationReferenceLinkingData*)refLinking; if (satCalcRefLinkData) { hasRefLinking = true; return satCalcRefLinkData->getSaturationID(); } } } return 0; } CIndividualSaturationProcessNode* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getIndividualNodeForIndividual(CIndividualSaturationProcessNode* indiProcSatNode, CIndividual* individual, cint64 saturationID, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNode* node = nullptr; if (indiProcSatNode->getNominalIndividual() == individual) { node = indiProcSatNode; } else { CIndividualProcessData* indiProcData = (CIndividualProcessData*)individual->getIndividualData(); bool hasRefLinking = false; if (indiProcData) { CConceptReferenceLinking* refLinking = indiProcData->getSaturationReferenceLinkingData(); if (refLinking) { CIndividualSaturationReferenceLinkingData* satCalcRefLinkData = (CIndividualSaturationReferenceLinkingData*)refLinking; if (satCalcRefLinkData) { hasRefLinking = true; if (satCalcRefLinkData->getSaturationID() == saturationID) { node = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); if (node->getNominalIndividual() != individual) { node = nullptr; } } } } } } //if (!hasRefLinking) { // CIndividualSaturationProcessNodeVector* indiNodeVec = calcAlgContext->getProcessingDataBox()->getIndividualSaturationProcessNodeVector(false); // node = indiNodeVec->getData(individual->getIndividualID()); //} return node; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::countConceptsOfReferredNodes(CConcept* concept, bool negation, cint64 depth, cint64& manyConceptRefIndiNodeCount, cint64& totalRefConceptCount, cint64& unprocessedRefCount, CCalculationAlgorithmContextBase* calcAlgContext) { if (depth <= 0) { return false; } if (concept) { cint64 initConCode = concept->getOperatorCode(); if (!negation && (initConCode == CCSUB || initConCode == CCEQ || initConCode == CCAND) || negation && (initConCode == CCEQ || initConCode == CCOR)) { for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegation = opConLinkerIt->isNegated()^negation; CIndividualSaturationProcessNode* opIndiNode = getIndividualNodeForConcept(opConcept,opNegation,calcAlgContext); if (opIndiNode && opIndiNode->isInitialized()) { if (opIndiNode->getDirectStatusFlags()->hasUnprocessedFlag()) { ++unprocessedRefCount; } CReapplyConceptSaturationLabelSet* opConSet = opIndiNode->getReapplyConceptSaturationLabelSet(false); if (opConSet) { cint64 opConCount = opConSet->getConceptCount(); totalRefConceptCount += opConCount; if (opConCount >= mConfReferredNodeManyConceptCount) { ++manyConceptRefIndiNodeCount; } } } else { countConceptsOfReferredNodes(opConcept,opNegation,depth-1,manyConceptRefIndiNodeCount,totalRefConceptCount,unprocessedRefCount,calcAlgContext); } } } } return false; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isProcessingCritical(CIndividualSaturationProcessNode* indiProcSatNode, CSaturationConceptDataItem* conceptSatItem, CIndividualSaturationProcessNode* specRefIndiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (mConfForceManyConceptSaturation && specRefIndiProcSatNode && conceptSatItem) { CConcept* initConcept = conceptSatItem->getSaturationConcept(); bool initNegated = conceptSatItem->getSaturationNegation(); cint64 manyRefIndiConCount = 0; cint64 totalRefConCount = 0; cint64 unprocessedRefCount = 0; countConceptsOfReferredNodes(initConcept,initNegated,mConfReferredNodeCheckingDepth,manyRefIndiConCount,totalRefConCount,unprocessedRefCount,calcAlgContext); if (manyRefIndiConCount >= mConfManyConceptReferredNodeCountProcessLimit || totalRefConCount >= mConfReferredNodeConceptCountProcessLimit || unprocessedRefCount >= mConfReferredNodeUnprocessedCountProcessLimit) { return true; } } return false; } CIndividualSaturationProcessNode* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::resolveSpecialInitializationIndividualNode(CIndividualSaturationProcessNode* indiProcSatNode, CSaturationConceptDataItem* conceptSatItem, CIndividualSaturationProcessNode* specRefIndiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (specRefIndiProcSatNode && conceptSatItem) { CConcept* initConcept = conceptSatItem->getSaturationConcept(); bool initNegated = conceptSatItem->getSaturationNegation(); CIndividualSaturationProcessNode* maxConCountSpecRefIndiNode = nullptr; cint64 maxConCount = 0; if (initConcept) { cint64 initConCode = initConcept->getOperatorCode(); if (!initNegated && (initConCode == CCSUB || initConCode == CCEQ || initConCode == CCAND) || initNegated && (initConCode == CCEQ || initConCode == CCOR)) { for (CSortedNegLinker* opConLinkerIt = initConcept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegation = opConLinkerIt->isNegated()^initNegated; CIndividualSaturationProcessNode* opIndiNode = getIndividualNodeForConcept(opConcept,opNegation,calcAlgContext); if (opIndiNode && opIndiNode->isInitialized()) { CReapplyConceptSaturationLabelSet* opConSet = opIndiNode->getReapplyConceptSaturationLabelSet(false); if (opConSet) { cint64 opConCount = opConSet->getConceptCount(); if (!maxConCountSpecRefIndiNode || opConCount > maxConCount) { maxConCount = opConCount; maxConCountSpecRefIndiNode = opIndiNode; } } } } } } if (maxConCountSpecRefIndiNode) { specRefIndiProcSatNode = maxConCountSpecRefIndiNode; } } return specRefIndiProcSatNode; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::initializeInitializationConcepts(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { bool requiredBackProp = true; CIndividualSaturationProcessNode* specialIndiNode = nullptr; CSaturationConceptReferenceLinking* confSatRefLinkingData = nullptr; CSaturationConceptDataItem* conceptSatItem = nullptr; bool copyIndividualNode = false; bool substituiteIndividualNode = false; confSatRefLinkingData = (CSaturationConceptReferenceLinking*)indiProcSatNode->getSaturationConceptReferenceLinking(); conceptSatItem = (CSaturationConceptDataItem*)confSatRefLinkingData; CConcept* initConcept = nullptr; bool initNegated = false; bool dataRangeConcept = false; CRole* initRole = nullptr; if (conceptSatItem) { initConcept = conceptSatItem->getSaturationConcept(); initNegated = conceptSatItem->getSaturationNegation(); initRole = conceptSatItem->getSaturationRoleRanges(); if (!mConfForceAllConceptInsertion) { requiredBackProp = conceptSatItem->isPotentiallyExistInitializationConcept(); } dataRangeConcept = conceptSatItem->isDataRangeConcept(); } if (conceptSatItem) { CSaturationConceptDataItem* specialRefItem = conceptSatItem->getSpecialItemReference(); if (specialRefItem) { specialIndiNode = (CIndividualSaturationProcessNode*)specialRefItem->getIndividualProcessNodeForConcept(); } } if (conceptSatItem) { CSaturationConceptDataItem::SATURATIONITEMREFERENCESPECIALMODE mode = conceptSatItem->getSpecialReferenceMode(); if (mode == CSaturationConceptDataItem::SATURATIONCOPYMODE) { //specialIndiNode = resolveSpecialInitializationIndividualNode(indiProcSatNode,conceptSatItem,specialIndiNode,calcAlgContext); copyIndividualNode = true; } else if (mode == CSaturationConceptDataItem::SATURATIONSUBSTITUTEMODE) { substituiteIndividualNode = true; } } bool addInitializationConcepts = true; bool initialized = false; if (specialIndiNode && !specialIndiNode->isInitialized()) { specialIndiNode = nullptr; } if (specialIndiNode) { indiProcSatNode->setReferenceIndividualSaturationProcessNode(specialIndiNode); } if (specialIndiNode && substituiteIndividualNode && (mConfForceAllCopyInsteadOfSubstituition || initRole)) { substituiteIndividualNode = false; copyIndividualNode = true; } if (specialIndiNode && substituiteIndividualNode) { CIndividualSaturationProcessNode* blockedIndiNode = specialIndiNode; while (blockedIndiNode->hasSubstituteIndividualNode()) { blockedIndiNode = blockedIndiNode->getSubstituteIndividualNode(); } CReapplyConceptSaturationLabelSet* blockConSet = blockedIndiNode->getReapplyConceptSaturationLabelSet(false); CConceptSaturationDescriptor* conceptSaturationDescriptor = nullptr; CImplicationReapplyConceptSaturationDescriptor* impReapplyConSatDes = nullptr; bool contained = false; if (blockConSet && blockConSet->getConceptDescriptorAndReapplyQueue(initConcept,conceptSaturationDescriptor,impReapplyConSatDes)) { contained = true; } if (!contained) { ++mSubstituitedIndiNodeCount; indiProcSatNode->initSubstituitingIndividualSaturationProcessNode(blockedIndiNode); indiProcSatNode->setSubstituteIndividualNode(specialIndiNode); indiProcSatNode->setReferenceMode(1); indiProcSatNode->clearConceptSaturationProcessLinker(); addInitializationConcepts = false; initialized = true; updateDirectAddingIndividualStatusFlags(indiProcSatNode,blockedIndiNode->getDirectStatusFlags(),mCalcAlgContext); updateIndirectAddingIndividualStatusFlags(indiProcSatNode,blockedIndiNode->getIndirectStatusFlags(),mCalcAlgContext); updateAddingSuccessorConnectedNominal(indiProcSatNode,blockedIndiNode->getSuccessorConnectedNominalSet(false),mCalcAlgContext); } else { copyIndividualNode = true; } } bool tryFlatLabelCopy = false; indiProcSatNode->setRequiredBackwardPropagation(requiredBackProp); if (!specialIndiNode) { CIndividual* nominalIndi = indiProcSatNode->getNominalIndividual(); if (nominalIndi) { if (nominalIndi->hasIndividualName()) { CIndividualSaturationProcessNodeVector* indiNodeVec = calcAlgContext->getProcessingDataBox()->getIndividualSaturationProcessNodeVector(false); CIndividualSaturationProcessNode* resolveNode = nullptr; if (indiProcSatNode->isSeparated()) { resolveNode = getSeparatedSaturationConceptAssertionResolveNode(calcAlgContext); } else { CConcept* topConcept = calcAlgContext->getUsedProcessingDataBox()->getOntologyTopConcept(); resolveNode = getIndividualNodeForConcept(topConcept,false,calcAlgContext); } CIndividualSaturationProcessNode* assertionResolvedNode = getResolvedIndividualNodeRepresentativeAssertion(resolveNode,nominalIndi,calcAlgContext); specialIndiNode = assertionResolvedNode; copyIndividualNode = true; tryFlatLabelCopy = true; } else { specialIndiNode = nullptr; copyIndividualNode = false; for (CConceptAssertionLinker* conAssLinkerIt = nominalIndi->getAssertionConceptLinker(); conAssLinkerIt; conAssLinkerIt = conAssLinkerIt->getNext()) { CConcept* assConcept = conAssLinkerIt->getData(); bool assNegation = conAssLinkerIt->isNegated(); addConceptFilteredToIndividual(assConcept,assNegation,indiProcSatNode,indiProcSatNode->getReapplyConceptSaturationLabelSet(true),false,calcAlgContext); } } } } if (!specialIndiNode && !dataRangeConcept && mConfCopyNodeFromTopIndividualForManyConcepts) { CConcept* topConcept = calcAlgContext->getUsedProcessingDataBox()->getOntologyTopConcept(); CConceptData* topConceptData = topConcept->getConceptData(); if (topConceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)topConceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* satCalcRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(false); if (satCalcRefLinkData) { specialIndiNode = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } if (specialIndiNode && specialIndiNode->isInitialized()) { CReapplyConceptSaturationLabelSet* topConSet = specialIndiNode->getReapplyConceptSaturationLabelSet(false); if (topConSet) { if (topConSet->getConceptCount() > 10) { copyIndividualNode = true; } } } else { specialIndiNode = nullptr; } } if (specialIndiNode && copyIndividualNode) { if (isProcessingCritical(indiProcSatNode,conceptSatItem,specialIndiNode,calcAlgContext)) { updateDirectAddingIndividualStatusFlags(indiProcSatNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGUNPROCESSED | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); setInsufficientNodeOccured(calcAlgContext); addInitializationConcepts = false; indiProcSatNode->clearConceptSaturationProcessLinker(); } else { CIndividualSaturationProcessNode* blockedIndiNode = specialIndiNode; while (blockedIndiNode->hasSubstituteIndividualNode()) { blockedIndiNode = blockedIndiNode->getSubstituteIndividualNode(); } initializeIndividualNodeByCoping(indiProcSatNode,blockedIndiNode,tryFlatLabelCopy,mCalcAlgContext); } initialized = true; } if (!initialized) { specialIndiNode = nullptr; indiProcSatNode->initRootIndividualSaturationProcessNode(); indiProcSatNode->setReferenceMode(4); CConcept* baseTopConcept = nullptr; if (!dataRangeConcept) { baseTopConcept = calcAlgContext->getUsedProcessingDataBox()->getOntologyTopConcept(); } else { baseTopConcept = calcAlgContext->getUsedProcessingDataBox()->getOntologyTopDataRangeConcept(); } if (baseTopConcept) { addConceptFilteredToIndividual(baseTopConcept,false,indiProcSatNode,false,calcAlgContext); } CConcept* univConnNomValueConcept = calcAlgContext->getProcessingDataBox()->getOntology()->getTBox()->getUniversalConnectionNominalValueConcept(); if (univConnNomValueConcept) { addConceptFilteredToIndividual(univConnNomValueConcept,false,indiProcSatNode,false,calcAlgContext); } initialized = true; } addIndividualToCompletionQueue(indiProcSatNode,calcAlgContext); if (addInitializationConcepts) { if (initConcept) { addConceptFilteredToIndividual(initConcept,initNegated,indiProcSatNode,indiProcSatNode->getReapplyConceptSaturationLabelSet(true),false,calcAlgContext); if (specialIndiNode) { bool initConceptDisjunction = false; cint64 initConOpCode = initConcept->getOperatorCode(); if (initNegated && (initConOpCode == CCAND || initConOpCode == CCEQ) || !initNegated && (initConOpCode == CCOR)) { initConceptDisjunction = true; } if (initConceptDisjunction) { CReapplyConceptSaturationLabelSet* specConSet = specialIndiNode->getReapplyConceptSaturationLabelSet(false); CConceptSaturationDescriptor* initConSatDes = nullptr; CImplicationReapplyConceptSaturationDescriptor* initConImpDes = nullptr; if (specConSet->getConceptSaturationDescriptor(initConcept,initConSatDes,initConImpDes)) { if (initConSatDes->isNegated() == initNegated) { CConceptSaturationProcessLinker* conceptSaturationProcessLinker = createConceptSaturationProcessLinker(calcAlgContext); conceptSaturationProcessLinker->initConceptSaturationProcessLinker(initConSatDes); indiProcSatNode->addConceptSaturationProcessLinker(conceptSaturationProcessLinker); } } } } } if (initRole) { for (CSortedNegLinker* superRoleIt = initRole->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { CRole* superRole = superRoleIt->getData(); bool roleInversed = superRoleIt->isNegated(); for (CSortedNegLinker* rangeConceptIt = superRole->getDomainRangeConceptList(!roleInversed); rangeConceptIt; rangeConceptIt = rangeConceptIt->getNext()) { CConcept* rangeConcept = rangeConceptIt->getData(); bool rangeConceptNegation = rangeConceptIt->isNegated(); addConceptFilteredToIndividual(rangeConcept,rangeConceptNegation,indiProcSatNode,calcAlgContext); } } } } CBackwardSaturationPropagationLink* backSatPropLinkIt = indiProcSatNode->getInitializingBackwardPropagationLinks(); if (backSatPropLinkIt) { while (backSatPropLinkIt) { CBackwardSaturationPropagationLink* backPropLink = backSatPropLinkIt; backSatPropLinkIt = backSatPropLinkIt->getNext(); backPropLink->clearNext(); installBackwardPropagationLink(backPropLink->getSourceIndividual(),indiProcSatNode,backPropLink->getLinkRole(),backPropLink,true,true,calcAlgContext); updateIndirectAddingIndividualStatusFlags(backPropLink->getSourceIndividual(),indiProcSatNode->getIndirectStatusFlags(),mCalcAlgContext); updateAddingSuccessorConnectedNominal(backPropLink->getSourceIndividual(),indiProcSatNode->getSuccessorConnectedNominalSet(false),mCalcAlgContext); } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::individualNodeConclusion(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptSaturationProcessLinker* conSatProLinker = indiProcSatNode->getConceptSaturationProcessLinker(); if (conSatProLinker) { addIndividualToProcessingQueue(indiProcSatNode,calcAlgContext); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyTableauSaturationRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { CConceptSaturationDescriptor* conDes = conSatProLinker->getConceptSaturationDescriptor(); bool conNeg = conDes->getNegation(); CConcept* concept = conDes->getConcept(); cint64 conOpCode = concept->getOperatorCode(); TableauRuleFunction func = nullptr; if (!conNeg) { func = mPosJumpFuncVec[conOpCode]; if (func) { (this->*func)(processIndi,conSatProLinker); } else { applyELSERule(processIndi,conSatProLinker); } } else { func = mNegJumpFuncVec[conOpCode]; if (func) { (this->*func)(processIndi,conSatProLinker); } else { applyELSERule(processIndi,conSatProLinker); } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyAutomatChooseRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { STATINC(AUTOMATEINITCOUNT,mCalcAlgContext); CConceptSaturationDescriptor* conDes = conSatProLinker->getConceptSaturationDescriptor(); bool conNegation = conDes->getNegation(); CConcept* concept = conDes->getConcept(); CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); while (conceptOpLinkerIt) { CConcept* opConcept = conceptOpLinkerIt->getData(); bool opNegation = conceptOpLinkerIt->isNegated(); if (opNegation == conNegation) { addConceptFilteredToIndividual(opConcept,false,processIndi,false,mCalcAlgContext); } conceptOpLinkerIt = conceptOpLinkerIt->getNext(); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyDATATYPERule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker) { CConceptSaturationDescriptor* conDes = conProLinker->getConceptSaturationDescriptor(); CConcept* concept = conDes->getConcept(); CDatatype* datatype = concept->getDatatype(); CSaturationIndividualNodeDatatypeData* appliedDatatypeData = processIndi->getAppliedDatatypeData(true); if (!appliedDatatypeData->getAppliedDatatype()) { processIndi->setDataValueApplied(true); bool dataValueTriviallySat = true; bool dataValueTriviallyUnsat = false; if (dataValueTriviallySat && !dataValueTriviallyUnsat) { CDatatypeValueSpacesTriggers* valueSpaceTriggers = mCalcAlgContext->getUsedProcessingDataBox()->getOntology()->getDataBoxes()->getMBox()->getValueSpacesTriggers(false); if (valueSpaceTriggers) { CDatatypeValueSpaceTriggers* datatypeValueSpaceTrigger = valueSpaceTriggers->getValueSpaceTriggers(datatype->getValueSpaceType()); if (datatypeValueSpaceTrigger) { if (datatypeValueSpaceTrigger->getConceptTriggerCount() > 0) { dataValueTriviallySat = false; } } } } if (dataValueTriviallyUnsat) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED,mCalcAlgContext); } else if (!dataValueTriviallySat) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } appliedDatatypeData->setAppliedDatatype(datatype); } else if (datatype != appliedDatatypeData->getAppliedDatatype()) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyDATALITERALRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker) { CConceptSaturationDescriptor* conDes = conProLinker->getConceptSaturationDescriptor(); bool conNegation = conDes->getNegation(); CConcept* concept = conDes->getConcept(); CDataLiteral* dataLiteral = concept->getDataLiteral(); CDatatype* datatype = concept->getDatatype(); CSaturationIndividualNodeDatatypeData* appliedDatatypeData = processIndi->getAppliedDatatypeData(true); if (!datatype) { datatype = dataLiteral->getDatatype(); } else if (datatype != dataLiteral->getDatatype()) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } if (!appliedDatatypeData->getAppliedDatatype()) { processIndi->setDataValueApplied(true); appliedDatatypeData->setAppliedDatatype(datatype); } else if (datatype != appliedDatatypeData->getAppliedDatatype()) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } if (!appliedDatatypeData->getAppliedDataLiteral()) { processIndi->setDataValueApplied(true); appliedDatatypeData->setAppliedDataLiteral(dataLiteral); CDataLiteralValue* dataLitValue = dataLiteral->getDataLiteralValue(); bool dataValueTriviallySat = true; bool dataValueTriviallyUnsat = false; if (!dataLitValue) { dataValueTriviallySat = false; } if (dataValueTriviallySat && !dataValueTriviallyUnsat) { CDatatypeValueSpacesTriggers* valueSpaceTriggers = mCalcAlgContext->getUsedProcessingDataBox()->getOntology()->getDataBoxes()->getMBox()->getValueSpacesTriggers(false); if (valueSpaceTriggers) { CDatatypeValueSpaceTriggers* datatypeValueSpaceTrigger = valueSpaceTriggers->getValueSpaceTriggers(datatype->getValueSpaceType()); if (datatypeValueSpaceTrigger) { if (datatypeValueSpaceTrigger->getConceptTriggerCount() > 0) { dataValueTriviallySat = false; } } } } if (dataValueTriviallySat && !dataValueTriviallyUnsat) { bool valueValid = false; CDatatype::DATATYPE_TYPE datatypeType = datatype->getDatatypeType(); if (datatypeType == CDatatype::DT_BOOLEAN) { CDataLiteralBooleanValue* booleanDataLitValue = dynamic_cast(dataLitValue); if (booleanDataLitValue) { valueValid = true; } } else if (datatypeType == CDatatype::DT_FLOAT) { CDataLiteralFloatValue* floatDataLitValue = dynamic_cast(dataLitValue); if (floatDataLitValue) { valueValid = true; } } else if (datatypeType == CDatatype::DT_DOUBLE) { CDataLiteralDoubleValue* doubleDataLitValue = dynamic_cast(dataLitValue); if (doubleDataLitValue) { valueValid = true; } } else if (datatypeType == CDatatype::DT_PLAINLITERAL) { CDataLiteralStringValue* stringDataLitValue = dynamic_cast(dataLitValue); if (stringDataLitValue) { valueValid = true; } } else if (datatypeType == CDatatype::DT_STRING) { CDataLiteralStringValue* stringDataLitValue = dynamic_cast(dataLitValue); if (stringDataLitValue) { if (stringDataLitValue->hasLanguageTag()) { dataValueTriviallyUnsat = true; } else { valueValid = true; } } } else if (datatypeType == CDatatype::DT_RATIONAL) { CDataLiteralRealValue* realDataLitValue = dynamic_cast(dataLitValue); if (realDataLitValue) { if (realDataLitValue->hasFlag(CDataLiteralRealValue::DLRV_RATIONAL_FLAG)) { valueValid = true; } else { dataValueTriviallyUnsat = true; } } } else if (datatypeType == CDatatype::DT_DECIMAL) { CDataLiteralRealValue* realDataLitValue = dynamic_cast(dataLitValue); if (realDataLitValue) { if (realDataLitValue->hasFlag(CDataLiteralRealValue::DLRV_DECIMAL_FLAG)) { valueValid = true; } else { dataValueTriviallyUnsat = true; } } } else if (datatypeType == CDatatype::DT_INTEGER) { CDataLiteralRealValue* realDataLitValue = dynamic_cast(dataLitValue); if (realDataLitValue) { if (realDataLitValue->hasFlag(CDataLiteralRealValue::DLRV_INTEGER_FLAG)) { valueValid = true; } else { dataValueTriviallyUnsat = true; } } } if (!valueValid) { dataValueTriviallySat = false; } } if (dataValueTriviallyUnsat) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED,mCalcAlgContext); } else if (!dataValueTriviallySat) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } } else if (dataLiteral != appliedDatatypeData->getAppliedDataLiteral()) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyANDRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { STATINC(ANDRULEAPPLICATIONCOUNT,mCalcAlgContext); CConceptSaturationDescriptor* conDes = conSatProLinker->getConceptSaturationDescriptor(); bool conNegation = conDes->getNegation(); CConcept* concept = conDes->getConcept(); CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); addConceptsFilteredToIndividual(conceptOpLinkerIt,conNegation,processIndi,false,mCalcAlgContext); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyNONERule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyIMPLICATIONRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { STATINC(ANDRULEAPPLICATIONCOUNT,mCalcAlgContext); CConceptSaturationDescriptor* conDes = conSatProLinker->getConceptSaturationDescriptor(); CImplicationReapplyConceptSaturationDescriptor tmpNewReapplyImpReapplyConSatDes; CConcept* implConcept = conDes->getConcept(); CSortedNegLinker* nextTriggerConcept = implConcept->getOperandList(); tmpNewReapplyImpReapplyConSatDes.initImplicationReapllyConceptSaturationDescriptor(implConcept,nextTriggerConcept); updateImplicationReapplyConceptSaturationDescriptor(&tmpNewReapplyImpReapplyConSatDes,processIndi,processIndi->getReapplyConceptSaturationLabelSet(true),mCalcAlgContext); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyNotDATATYPERule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); applyORRule(processIndi,conProLinker); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyORRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { CConceptSaturationDescriptor* conDes = conSatProLinker->getConceptSaturationDescriptor(); bool conNegation = conDes->getNegation(); CConcept* concept = conDes->getConcept(); if (concept->getOperandCount() == 0) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED,mCalcAlgContext); } else if (concept->getOperandCount() == 1) { STATINC(ANDRULEAPPLICATIONCOUNT,mCalcAlgContext); CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); addConceptsFilteredToIndividual(conceptOpLinkerIt,conNegation,processIndi,false,mCalcAlgContext); } else { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCRITICAL,mCalcAlgContext); addCriticalConceptDescriptor(conDes,CCriticalSaturationConceptTypeQueues::CCT_DISJUNCTION,processIndi,mCalcAlgContext); CSaturationConceptDataItem* conceptSatItem = (CSaturationConceptDataItem*)processIndi->getSaturationConceptReferenceLinking(); if (conceptSatItem) { CConcept* indiConcept = conceptSatItem->getSaturationConcept(); bool indiConNegation = conceptSatItem->getSaturationNegation(); if (concept == indiConcept && conNegation == indiConNegation) { initializeExtractDisjunctCommonConcept(processIndi,mCalcAlgContext); } else { if (indiConcept) { CConceptProcessData* disjunctionConProData = (CConceptProcessData*)concept->getConceptData(); CConceptSaturationReferenceLinkingData* disjConRefLinking = (CConceptSaturationReferenceLinkingData*)disjunctionConProData->getConceptReferenceLinking(); if (disjConRefLinking) { CSaturationConceptDataItem* disjConceptSatItem = (CSaturationConceptDataItem*)disjConRefLinking->getConceptSaturationReferenceLinkingData(conNegation); if (disjConceptSatItem) { CIndividualSaturationProcessNode* disjunctionIndiNode = (CIndividualSaturationProcessNode*)disjConceptSatItem->getIndividualProcessNodeForConcept(); bool separatedMode = processIndi->isSeparated() && !disjunctionIndiNode->isSeparated(); if (!separatedMode) { addUninitializedIndividualToProcessingQueue(disjunctionIndiNode,mCalcAlgContext); } CMemoryAllocationManager* taskMemMan = mCalcAlgContext->getUsedProcessTaskMemoryAllocationManager(); bool requiresDisjunctionProcessing = true; CIndividualSaturationProcessNode* copiedIndividualNode = processIndi->getCopyIndividualNode(); if (copiedIndividualNode) { CReapplyConceptSaturationLabelSet* copiedNodeConSet = copiedIndividualNode->getReapplyConceptSaturationLabelSet(false); if (copiedNodeConSet->containsConcept(concept,conNegation)) { requiresDisjunctionProcessing = false; ++mDisjunctionInitializedSkippedCount; } } if (requiresDisjunctionProcessing) { if (!separatedMode) { CXNegLinker* depCopyLinker = CObjectAllocator< CXNegLinker >::allocateAndConstruct(taskMemMan); depCopyLinker->initNegLinker(processIndi,false); disjunctionIndiNode->addCopyDependingIndividualNodeLinker(depCopyLinker); } // add already extracted common disjunct concepts CReapplyConceptSaturationLabelSet* disjConSet = disjunctionIndiNode->getReapplyConceptSaturationLabelSet(false); if (disjConSet) { CReapplyConceptSaturationLabelSet* conSet = processIndi->getReapplyConceptSaturationLabelSet(true); for (CConceptSaturationDescriptor* disjConDesIt = disjConSet->getConceptSaturationDescriptionLinker(); disjConDesIt; disjConDesIt = disjConDesIt->getNextConceptDesciptor()) { addConceptToIndividual(disjConDesIt->getConcept(),disjConDesIt->isNegated(),processIndi,conSet,true,mCalcAlgContext); } } } } } } } } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyELSERule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyATMOSTRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { STATINC(ATMOSTRULEAPPLICATIONCOUNT,mCalcAlgContext); CConceptSaturationDescriptor* conDes = conSatProLinker->getConceptSaturationDescriptor(); bool conNegation = conDes->getNegation(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); cint64 cardinality = concept->getParameter() - 1*conNegation; if (cardinality < 0) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED,mCalcAlgContext); } else { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCARDINALITYRESTRICTED,mCalcAlgContext); if (cardinality == 1) { if (!concept->getOperandList()) { addFUNCTIONALConceptExtensionProcessingRole(role,processIndi,mCalcAlgContext); } else { addQualifiedFUNCTIONALAtmostConceptExtensionProcessing(conDes,processIndi,mCalcAlgContext); } } addCriticalConceptDescriptor(conDes,CCriticalSaturationConceptTypeQueues::CCT_ATMOST,processIndi,mCalcAlgContext); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyATLEASTRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { STATINC(ATLEASTRULEAPPLICATIONCOUNT,mCalcAlgContext); CConceptSaturationDescriptor* conDes = conSatProLinker->getConceptSaturationDescriptor(); bool conNegation = conDes->getNegation(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); cint64 cardinality = concept->getParameter() + 1*conNegation; if (cardinality > 0) { createSuccessorForConcept(processIndi,conSatProLinker,cardinality,mCalcAlgContext); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyEQCANDRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { CConceptSaturationDescriptor* conDes = conSatProLinker->getConceptSaturationDescriptor(); addCriticalConceptDescriptor(conDes,CCriticalSaturationConceptTypeQueues::CCT_EQCANDIDATE,processIndi,mCalcAlgContext); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyBOTTOMRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED,mCalcAlgContext); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyALLRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { STATINC(ALLRULEAPPLICATIONCOUNT,mCalcAlgContext); CConceptSaturationDescriptor* conDes = conSatProLinker->getConceptSaturationDescriptor(); bool conNegation = conDes->getNegation(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CMemoryAllocationManager* taskMemMan = mCalcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CRoleBackwardSaturationPropagationHash* backPropHash = processIndi->getRoleBackwardPropagationHash(true); CBackwardSaturationPropagationReapplyDescriptor* backPropReapplyDes = CObjectAllocator::allocateAndConstruct(taskMemMan); backPropReapplyDes->initBackwardPropagationReapplyDescriptor(conDes); CRoleBackwardSaturationPropagationHashData& backPropHashData = backPropHash->addBackwardPropagationConceptDescriptor(role,backPropReapplyDes); CBackwardSaturationPropagationLink* backPropLinkIt = backPropHashData.mLinkLinker; if (backPropLinkIt) { while (backPropLinkIt) { CIndividualSaturationProcessNode* backPropIndiNode = backPropLinkIt->getSourceIndividual(); CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); while (conceptOpLinkerIt) { CConcept* opConcept = conceptOpLinkerIt->getData(); bool opConNegation = conceptOpLinkerIt->isNegated()^conNegation; STATINC(ALLROLERESTRICTIONCOUNT,mCalcAlgContext); addConceptFilteredToIndividual(opConcept,opConNegation,backPropIndiNode,true,mCalcAlgContext); conceptOpLinkerIt = conceptOpLinkerIt->getNext(); } backPropLinkIt = backPropLinkIt->getNext(); } } CConceptProcessData* conProData = (CConceptProcessData*)concept->getConceptData(); if (conProData) { if (conProData->hasPropagationIntoCreationDirection()) { addALLConceptExtensionProcessingRole(role,backPropHashData,processIndi,mCalcAlgContext); updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCRITICAL,mCalcAlgContext); addCriticalConceptDescriptor(conDes,CCriticalSaturationConceptTypeQueues::CCT_FORALL,processIndi,mCalcAlgContext); } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addALLConceptExtensionProcessingRole(CRole* role, CRoleBackwardSaturationPropagationHashData& backPropHashData, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (mConfALLConceptsExtensionProcessing) { if (!backPropHashData.mRoleALLConceptsProcessingQueued) { backPropHashData.mRoleALLConceptsProcessingQueued = true; CSaturationIndividualNodeSuccessorExtensionData* succExtData = indiProcSatNode->getSuccessorExtensionData(true); CSaturationIndividualNodeALLConceptsExtensionData* succIndiALLConExtData = succExtData->getALLConceptsExtensionData(true); addSuccessorExtensionToProcessingQueue(indiProcSatNode,calcAlgContext); if (succIndiALLConExtData->isSuccessorExtensionInitialized()) { if (!succIndiALLConExtData->hasProcessLinkerForRole(role)) { //QString indiDebugNameString = getDebugIndividualConceptName(indiProcSatNode,calcAlgContext); //if (indiDebugNameString == "http://www.co-ode.org/ontologies/galen#Atlas" || indiDebugNameString == "http://www.co-ode.org/ontologies/galen#CervicalSpine") { // bool debug = true; //} CRoleSaturationProcessLinker* roleProcessLinker = createRoleSaturationProcessLinker(calcAlgContext); roleProcessLinker->initRoleProcessLinker(role); succIndiALLConExtData->addRoleProcessLinker(roleProcessLinker); } } } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addFUNCTIONALConceptExtensionProcessingRole(CRole* role, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (mConfFUNCTIONALConceptsExtensionProcessing) { CSaturationIndividualNodeSuccessorExtensionData* succExtData = indiProcSatNode->getSuccessorExtensionData(true); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* succIndiFUNCTIONALConExtData = succExtData->getFUNCTIONALConceptsExtensionData(true); addSuccessorExtensionToProcessingQueue(indiProcSatNode,calcAlgContext); if (!succIndiFUNCTIONALConExtData->hasFunctionalityAddedProcessLinkerForRole(role)) { CRoleSaturationProcessLinker* roleProcessLinker = createRoleSaturationProcessLinker(calcAlgContext); roleProcessLinker->initRoleProcessLinker(role); succIndiFUNCTIONALConExtData->addFunctionalityAddedRoleProcessLinker(roleProcessLinker); } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addQualifiedFUNCTIONALAtmostConceptExtensionProcessing(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (mConfFUNCTIONALConceptsExtensionProcessing) { CSaturationIndividualNodeSuccessorExtensionData* succExtData = indiProcSatNode->getSuccessorExtensionData(true); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* succIndiFUNCTIONALConExtData = succExtData->getFUNCTIONALConceptsExtensionData(true); addSuccessorExtensionToProcessingQueue(indiProcSatNode,calcAlgContext); if (!succIndiFUNCTIONALConExtData->hasQualifiedFunctionalAtmostConceptProcessLinkerForConcept(conDes)) { CConceptSaturationProcessLinker* conProcessLinker = createConceptSaturationProcessLinker(calcAlgContext); conProcessLinker->initConceptSaturationProcessLinker(conDes); succIndiFUNCTIONALConExtData->addQualifiedFunctionalAtmostConceptProcessLinker(conProcessLinker); } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addNewLinkedExtensionProcessingRole(CRole* role, CIndividualSaturationProcessNode*& indiProcSatNode, bool queueALLExtension, bool queueFUNCTIONALExtension, CCalculationAlgorithmContextBase* calcAlgContext) { if (mConfConceptsExtensionProcessing) { CSaturationIndividualNodeSuccessorExtensionData* succExtData = indiProcSatNode->getSuccessorExtensionData(false); if (succExtData) { CSaturationIndividualNodeALLConceptsExtensionData* succIndiALLConExtData = succExtData->getALLConceptsExtensionData(false); CSaturationIndividualNodeFUNCTIONALConceptsExtensionData* succIndiFUNCTIONALConExtData = succExtData->getFUNCTIONALConceptsExtensionData(false); bool succExtensionInitialized = false; bool succALLExtensionInitialized = false; bool succFUNCTIONALExtensionInitialized = false; if (succIndiALLConExtData) { if (succIndiALLConExtData->isSuccessorExtensionInitialized()) { succExtensionInitialized = true; succALLExtensionInitialized = true; } } if (succIndiFUNCTIONALConExtData) { if (succIndiFUNCTIONALConExtData->isSuccessorExtensionInitialized()) { succExtensionInitialized = true; succFUNCTIONALExtensionInitialized = true; } } if (succExtensionInitialized) { CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indiProcSatNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { CLinkedRoleSaturationSuccessorData*& succData = linkedSuccHash->getLinkedRoleSuccessorData(role,true); if (succData) { bool queueProcessing = false; if (succALLExtensionInitialized && !succData->mRoleALLConceptsProcessingQueued && queueALLExtension) { bool allQueueingRequired = succData->mRoleALLConceptsQueuingRequired; if (!allQueueingRequired) { CRoleBackwardSaturationPropagationHash* backwardPropHash = indiProcSatNode->getRoleBackwardPropagationHash(false); if (backwardPropHash) { CPROCESSHASH* backwardPropDataHash = backwardPropHash->getRoleBackwardPropagationDataHash(); CRoleBackwardSaturationPropagationHashData* backwardPropData(backwardPropDataHash->valuePointer(role)); if (backwardPropData && backwardPropData->mReapplyLinker) { allQueueingRequired = true; succData->mRoleALLConceptsQueuingRequired = true; } } } if (allQueueingRequired) { succData->mRoleALLConceptsProcessingQueued = true; queueProcessing = true; if (succIndiALLConExtData->isSuccessorExtensionInitialized()) { if (!succIndiALLConExtData->hasProcessLinkerForRole(role)) { CRoleSaturationProcessLinker* roleProcessLinker = createRoleSaturationProcessLinker(calcAlgContext); roleProcessLinker->initRoleProcessLinker(role); succIndiALLConExtData->addRoleProcessLinker(roleProcessLinker); } } } } if (succFUNCTIONALExtensionInitialized && !succData->mRoleFUNCTIONALConceptsProcessingQueued && succData->mRoleFUNCTIONALConceptsQueuingRequired /*&& succData->mSuccCount > 1 */&& queueFUNCTIONALExtension) { succData->mRoleFUNCTIONALConceptsProcessingQueued = true; queueProcessing = true; if (succIndiFUNCTIONALConExtData->isSuccessorExtensionInitialized()) { if (!succIndiFUNCTIONALConExtData->hasLinkedSuccessorAddedProcessLinkerForRole(role)) { CRoleSaturationProcessLinker* roleProcessLinker = createRoleSaturationProcessLinker(calcAlgContext); roleProcessLinker->initRoleProcessLinker(role); succIndiFUNCTIONALConExtData->addLinkedSuccessorAddedRoleProcessLinker(roleProcessLinker); } if (!succIndiFUNCTIONALConExtData->hasLinkedPredecessorAddedProcessLinkerForRole(role)) { CRoleSaturationProcessLinker* roleProcessLinker = createRoleSaturationProcessLinker(calcAlgContext); roleProcessLinker->initRoleProcessLinker(role); succIndiFUNCTIONALConExtData->addLinkedPredecessorAddedRoleProcessLinker(roleProcessLinker); } } } if (queueProcessing) { addSuccessorExtensionToProcessingQueue(indiProcSatNode,calcAlgContext); } } } } } } } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::loadConsistenceModelData(CCalculationAlgorithmContext* calcAlgContext) { bool consCompGraphAvailable = false; if (!mCachedCompletionGraphLoaded) { CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CConcreteOntology* ontology = processingDataBox->getOntology(); CConsistence* consistence = ontology->getConsistence(); if (consistence) { CConsistenceData* consData = consistence->getConsistenceModelData(); if (consData) { CConsistenceTaskData* consTaskData = dynamic_cast(consData); if (consTaskData) { CSatisfiableCalculationTask* detSatCalcTask = consTaskData->getDeterministicSatisfiableTask(); CSatisfiableCalculationTask* compGraphCachedCalcTask = consTaskData->getCompletionGraphCachedSatisfiableTask(); if (detSatCalcTask) { mDetCachedCGIndiVector = detSatCalcTask->getProcessingDataBox()->getIndividualProcessNodeVector(); mDetConsistencyCG = true; } else { mDetConsistencyCG = false; } if (compGraphCachedCalcTask && compGraphCachedCalcTask != detSatCalcTask) { mNonDetCachedCGIndiVector = compGraphCachedCalcTask->getProcessingDataBox()->getIndividualProcessNodeVector(); mNonDetConsistencyCG = true; } else { mNonDetConsistencyCG = false; } } } } mCachedCompletionGraphLoaded = true; } if (mDetConsistencyCG) { consCompGraphAvailable = true; } else { mCachedCompletionGraphMissing = true; } return consCompGraphAvailable; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::loadConsistenceRepresentativeData(CCalculationAlgorithmContext* calcAlgContext) { bool consRepDataAvailable = false; if (!mRepresentativeDataLoaded) { mRepresentativeDataAvailable = false; CProcessingDataBox* processingDataBox = calcAlgContext->getProcessingDataBox(); CConcreteOntology* ontology = processingDataBox->getOntology(); CConsistence* consistence = ontology->getConsistence(); if (consistence) { mRepresentativeDataAvailable = consistence->areIndividualsRepresentativelyStored(); } mRepresentativeDataLoaded = true; } consRepDataAvailable = mRepresentativeDataAvailable; return consRepDataAvailable; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::isConsistenceDataAvailable(CCalculationAlgorithmContext* calcAlgContext) { if (loadConsistenceModelData(calcAlgContext) || loadConsistenceRepresentativeData(calcAlgContext)) { return true; } return false; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addNominalDependentIndividualNode(cint64 nominalID, CIndividualSaturationProcessNode* dependentIndiNode, CSaturationNominalDependentNodeData::NOMINALCONNECTIONTYPE connectionType, CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CSaturationNominalDependentNodeHash* nominalDependentNodeHash = processingDataBox->getSaturationNominalDependentNodeHash(true); nominalDependentNodeHash->addNominalDependentNode(nominalID,dependentIndiNode,connectionType); CSaturationInfluencedNominalSet* influencedNominalSet = processingDataBox->getSaturationInfluencedNominalSet(true); if (influencedNominalSet->isNominalInfluenced(nominalID)) { // insufficient updateDirectAddingIndividualStatusFlags(dependentIndiNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); setInsufficientNodeOccured(calcAlgContext); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addInfluencedNominal(cint64 influencedNominalID, CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CSaturationInfluencedNominalSet* influencedNominalSet = processingDataBox->getSaturationInfluencedNominalSet(true); bool firstInfluence = influencedNominalSet->setNominalInfluenced(influencedNominalID); if (firstInfluence) { CSaturationNominalDependentNodeHash* nominalDependentNodeHash = processingDataBox->getSaturationNominalDependentNodeHash(true); for (CSaturationNominalDependentNodeData* nominalDepNodeDataIt = nominalDependentNodeHash->getNominalDependentNodeData(influencedNominalID); nominalDepNodeDataIt; nominalDepNodeDataIt = nominalDepNodeDataIt->getNext()) { CIndividualSaturationProcessNode* dependentIndSatProcNode = nominalDepNodeDataIt->getDependentIndividualSaturationNode(); // insufficient updateDirectAddingIndividualStatusFlags(dependentIndSatProcNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,calcAlgContext); setInsufficientNodeOccured(calcAlgContext); } } } CIndividualProcessNode* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getCorrectedNode(cint64 individualID, CIndividualProcessNodeVector* indiVec, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualProcessNode* indiNode = nullptr; if (indiVec) { indiNode = indiVec->getData(individualID); if (indiNode && indiNode->getMergedIntoIndividualNodeID() != indiNode->getIndividualID()) { indiNode = indiVec->getData(indiNode->getMergedIntoIndividualNodeID()); } } return indiNode; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyVALUERule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { STATINC(VALUERULEAPPLICATIONCOUNT,mCalcAlgContext); CConceptSaturationDescriptor* conDes = conSatProLinker->getConceptSaturationDescriptor(); bool conNegation = conDes->getNegation(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CIndividual* nominalIndividual = concept->getNominalIndividual(); cint64 nominalID = nominalIndividual->getIndividualID(); if (mConfNominalProcessing) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGNOMINALCONNECTION,mCalcAlgContext); updateAddingSuccessorConnectedNominal(processIndi,nominalID,mCalcAlgContext); if (isConsistenceDataAvailable(mCalcAlgContext)) { CIndividualProcessNode* nominalProcessNode = getCorrectedNode(nominalID,mDetCachedCGIndiVector,mCalcAlgContext); if (nominalProcessNode) { bool nominalInfluenced = false; bool insufficientNominalConnection = false; CReapplyRoleSuccessorHash* nominalReapplyRoleSuccHash = nominalProcessNode->getReapplyRoleSuccessorHash(false); for (CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { CRole* superRole = superRoleIt->getData(); bool inversedSuperRole = superRoleIt->isNegated(); if (superRole->hasDisjointRoles()) { insufficientNominalConnection = true; } CIndividualSaturationProcessNodeStatusFlags* directStatFlags = processIndi->getDirectStatusFlags(); for (CSortedNegLinker* domainConLinkerIt = superRole->getDomainRangeConceptList(inversedSuperRole); domainConLinkerIt; domainConLinkerIt = domainConLinkerIt->getNext()) { CConcept* domainConcept = domainConLinkerIt->getData(); bool domainConceptNegation = domainConLinkerIt->isNegated(); addConceptFilteredToIndividual(domainConcept,domainConceptNegation,processIndi,mCalcAlgContext); } for (CSortedNegLinker* rangeConLinkerIt = superRole->getDomainRangeConceptList(!inversedSuperRole); rangeConLinkerIt && !directStatFlags->hasInsufficientFlag(); rangeConLinkerIt = rangeConLinkerIt->getNext()) { CConcept* rangeConcept = rangeConLinkerIt->getData(); bool rangeConceptNegation = rangeConLinkerIt->isNegated(); CReapplyConceptLabelSet* nominalConSet = nominalProcessNode->getReapplyConceptLabelSet(false); if (!nominalConSet || !nominalConSet->containsConcept(rangeConcept,rangeConceptNegation)) { nominalInfluenced = true; } } if (inversedSuperRole) { if (nominalReapplyRoleSuccHash) { CReapplyQueueIterator reapplyRoleIt(nominalReapplyRoleSuccHash->getRoleReapplyIterator(superRole)); while (reapplyRoleIt.hasNext()) { CReapplyConceptDescriptor* reapplyDes = reapplyRoleIt.next(); CConceptDescriptor* reapplyConDes = reapplyDes->getConceptDescriptor(); CConcept* reapplyConcept = reapplyConDes->getConcept(); bool reapplyConceptNegation = reapplyConDes->isNegated(); cint64 reapplyConceptCode = reapplyConcept->getOperatorCode(); CConceptOperator* reapplyConceptOperator = reapplyConcept->getConceptOperator(); if (!reapplyConceptNegation && reapplyConceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_PROPAGATION_ALL_TYPE)) { // cannot be handled with this algorithm, hence mark as insufficient insufficientNominalConnection = true; } else if (!reapplyConceptNegation && reapplyConceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_AQALL_TYPE) || reapplyConceptNegation && reapplyConceptCode == CCSOME) { for (CSortedNegLinker* reapplyConceptOpLinkerIt = reapplyConcept->getOperandList(); reapplyConceptOpLinkerIt; reapplyConceptOpLinkerIt = reapplyConceptOpLinkerIt->getNext()) { CConcept* reapplyOperandConcept = reapplyConceptOpLinkerIt->getData(); bool reapplyOperandConceptNegation = reapplyConceptOpLinkerIt->isNegated()^reapplyConceptNegation; addConceptFilteredToIndividual(reapplyOperandConcept,reapplyOperandConceptNegation,processIndi,mCalcAlgContext); } } else if (!reapplyConceptNegation && reapplyConceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQAND_TYPE)) { addAutomateTransitionOperands(processIndi,reapplyConcept,role,mCalcAlgContext); } else { insufficientNominalConnection = true; } } } } } if (nominalInfluenced) { insufficientNominalConnection = true; if (!processIndi->getNominalIndividual()) { addInfluencedNominal(nominalID,mCalcAlgContext); } } if (insufficientNominalConnection) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } if (mNonDetConsistencyCG) { addCriticalConceptDescriptor(conDes,CCriticalSaturationConceptTypeQueues::CCT_VALUE,processIndi,mCalcAlgContext); } addNominalDependentIndividualNode(nominalID,processIndi,CSaturationNominalDependentNodeData::VALUECONNECTION,mCalcAlgContext); } else { bool nominalInfluenced = false; bool insufficientNominalConnection = false; CBackendRepresentativeMemoryCacheIndividualAssociationData* indiAssData = mBackendAssCaceHandler->getIndividualAssociation(nominalIndividual,mCalcAlgContext); CBackendRepresentativeMemoryLabelCacheItem* labelCacheItem = nullptr; CCACHINGHASH* labelValueHash = nullptr; CBackendRepresentativeMemoryLabelValueLinker* lablelValueLinker = nullptr; if (indiAssData) { labelCacheItem = indiAssData->getBackendLabelCacheEntry(); if (labelCacheItem) { labelValueHash = labelCacheItem->getDeterministicTagCacheValueHash(false); lablelValueLinker = labelCacheItem->getDeterministicCacheValueLinker(); } } for (CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { CRole* superRole = superRoleIt->getData(); bool inversedSuperRole = superRoleIt->isNegated(); if (superRole->hasDisjointRoles()) { insufficientNominalConnection = true; } CIndividualSaturationProcessNodeStatusFlags* directStatFlags = processIndi->getDirectStatusFlags(); for (CSortedNegLinker* domainConLinkerIt = superRole->getDomainRangeConceptList(inversedSuperRole); domainConLinkerIt; domainConLinkerIt = domainConLinkerIt->getNext()) { CConcept* domainConcept = domainConLinkerIt->getData(); bool domainConceptNegation = domainConLinkerIt->isNegated(); addConceptFilteredToIndividual(domainConcept,domainConceptNegation,processIndi,mCalcAlgContext); } for (CSortedNegLinker* rangeConLinkerIt = superRole->getDomainRangeConceptList(!inversedSuperRole); rangeConLinkerIt && !directStatFlags->hasInsufficientFlag(); rangeConLinkerIt = rangeConLinkerIt->getNext()) { CConcept* rangeConcept = rangeConLinkerIt->getData(); bool rangeConceptNegation = rangeConLinkerIt->isNegated(); if (!labelValueHash) { nominalInfluenced = true; } else { CBackendRepresentativeMemoryLabelValueLinker* labelLinker = labelValueHash->value(rangeConcept->getConceptTag()); if (!labelLinker) { nominalInfluenced = true; } else { CCacheValue cacheValue(mBackendAssCaceHandler->getCacheValue(rangeConcept,rangeConceptNegation)); if (labelLinker->getCacheValue() != cacheValue) { nominalInfluenced = true; } } } } if (inversedSuperRole) { if (lablelValueLinker) { for (CBackendRepresentativeMemoryLabelValueLinker* lablelValueLinkerIt = lablelValueLinker; lablelValueLinkerIt; lablelValueLinkerIt = lablelValueLinkerIt->getNext()) { const CCacheValue& cacheValue = lablelValueLinkerIt->getCacheValue(); CConcept* reapplyConcept = (CConcept*)cacheValue.getIdentification(); bool reapplyConceptNegation = cacheValue.getCacheValueIdentifier() == CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; if (reapplyConcept->getRole() == superRole) { cint64 reapplyConceptCode = reapplyConcept->getOperatorCode(); CConceptOperator* reapplyConceptOperator = reapplyConcept->getConceptOperator(); if (!reapplyConceptNegation && reapplyConceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_PROPAGATION_ALL_TYPE)) { // cannot be handled with this algorithm, hence mark as insufficient insufficientNominalConnection = true; } else if (!reapplyConceptNegation && reapplyConceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_AQALL_TYPE) || reapplyConceptNegation && reapplyConceptCode == CCSOME) { for (CSortedNegLinker* reapplyConceptOpLinkerIt = reapplyConcept->getOperandList(); reapplyConceptOpLinkerIt; reapplyConceptOpLinkerIt = reapplyConceptOpLinkerIt->getNext()) { CConcept* reapplyOperandConcept = reapplyConceptOpLinkerIt->getData(); bool reapplyOperandConceptNegation = reapplyConceptOpLinkerIt->isNegated()^reapplyConceptNegation; addConceptFilteredToIndividual(reapplyOperandConcept,reapplyOperandConceptNegation,processIndi,mCalcAlgContext); } } else if (!reapplyConceptNegation && reapplyConceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQAND_TYPE)) { addAutomateTransitionOperands(processIndi,reapplyConcept,role,mCalcAlgContext); } else { insufficientNominalConnection = true; } } } } } } if (nominalInfluenced) { insufficientNominalConnection = true; if (!processIndi->getNominalIndividual()) { addInfluencedNominal(nominalID,mCalcAlgContext); } } if (insufficientNominalConnection) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } addNominalDependentIndividualNode(nominalID,processIndi,CSaturationNominalDependentNodeData::VALUECONNECTION,mCalcAlgContext); } } else { delayNominalSaturationConceptProcessing(processIndi,conSatProLinker,nominalID,mCalcAlgContext); } } else { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::delayNominalSaturationConceptProcessing(CIndividualSaturationProcessNode* processIndi, CConceptSaturationProcessLinker* conProLinker, cint64 nominalID, CCalculationAlgorithmContextBase* calcAlgContext) { propagateUnloadedABoxCompletionGraphDependentIndividualNodeFlag(processIndi,conProLinker,nominalID,calcAlgContext); CConceptSaturationProcessLinker* nomDelayedConSatProcLinker = createConceptSaturationProcessLinker(calcAlgContext); nomDelayedConSatProcLinker->initConceptSaturationProcessLinker(conProLinker->getConceptSaturationDescriptor()); processIndi->getNominalHandlingData(true)->addDelayedNominalConceptSaturationProcessLinker(nomDelayedConSatProcLinker); setDelayedNominalProcessingOccured(calcAlgContext); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addAutomateTransitionOperands(CIndividualSaturationProcessNode*& processIndi, CConcept* automatConcept, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptOperator* automatConceptOperator = automatConcept->getConceptOperator(); if (automatConceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQAND_TYPE)) { for (CSortedNegLinker* automateConceptOpLinkerIt = automatConcept->getOperandList(); automateConceptOpLinkerIt; automateConceptOpLinkerIt = automateConceptOpLinkerIt->getNext()) { CConcept* automateOperandConcept = automateConceptOpLinkerIt->getData(); addAutomateTransitionOperands(processIndi,automateOperandConcept,role,calcAlgContext); } } else if (automatConceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQALL_TYPE)) { CRole* automateRole = automatConcept->getRole(); if (automateRole == role) { for (CSortedNegLinker* automateConceptOpLinkerIt = automatConcept->getOperandList(); automateConceptOpLinkerIt; automateConceptOpLinkerIt = automateConceptOpLinkerIt->getNext()) { CConcept* automateOperandConcept = automateConceptOpLinkerIt->getData(); bool automateOperandConceptNegation = automateConceptOpLinkerIt->isNegated(); addConceptFilteredToIndividual(automateOperandConcept,automateOperandConceptNegation,processIndi,calcAlgContext); } } } } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::testAutomateTransitionOperandsAddable(CIndividualSaturationProcessNode*& processIndi, CConcept* automatConcept, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptOperator* automatConceptOperator = automatConcept->getConceptOperator(); if (automatConceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQAND_TYPE)) { for (CSortedNegLinker* automateConceptOpLinkerIt = automatConcept->getOperandList(); automateConceptOpLinkerIt; automateConceptOpLinkerIt = automateConceptOpLinkerIt->getNext()) { CConcept* automateOperandConcept = automateConceptOpLinkerIt->getData(); if (testAutomateTransitionOperandsAddable(processIndi,automateOperandConcept,role,calcAlgContext)) { return true; } } } else if (automatConceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQALL_TYPE)) { CRole* automateRole = automatConcept->getRole(); if (automateRole == role) { CReapplyConceptSaturationLabelSet* conSet = processIndi->getReapplyConceptSaturationLabelSet(false); for (CSortedNegLinker* automateConceptOpLinkerIt = automatConcept->getOperandList(); automateConceptOpLinkerIt; automateConceptOpLinkerIt = automateConceptOpLinkerIt->getNext()) { CConcept* automateOperandConcept = automateConceptOpLinkerIt->getData(); bool automateOperandConceptNegation = automateConceptOpLinkerIt->isNegated(); if (!conSet->containsConcept(automateOperandConcept,automateOperandConceptNegation)) { return true; } } } } return false; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyNOMINALRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { STATINC(NOMINALRULEAPPLICATIONCOUNT,mCalcAlgContext); CConceptSaturationDescriptor* conDes = conSatProLinker->getConceptSaturationDescriptor(); bool conNegation = conDes->getNegation(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CIndividual* nominalIndividual = concept->getNominalIndividual(); cint64 nominalID = nominalIndividual->getIndividualID(); //mEndSaturationDebugIndiModelString = generateExtendedDebugIndiModelStringList(mCalcAlgContext); //QFile tmpFile("saturation-model.txt"); //if (tmpFile.open(QIODevice::WriteOnly)) { // tmpFile.write(mEndSaturationDebugIndiModelString.replace("
","").replace("

","\n").toLocal8Bit()); // tmpFile.close(); //} if (!processIndi->hasNominalIntegrated()) { processIndi->setIntegratedNominal(nominalIndividual); } if (mConfNominalProcessing) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGNOMINALCONNECTION,mCalcAlgContext); updateAddingSuccessorConnectedNominal(processIndi,nominalID,mCalcAlgContext); for (CXLinker* multipleCardinalityAncestorNodesLinkerIt = processIndi->getMultipleCardinalityAncestorNodesLinker(); multipleCardinalityAncestorNodesLinkerIt; multipleCardinalityAncestorNodesLinkerIt = multipleCardinalityAncestorNodesLinkerIt->getNext()) { CIndividualSaturationProcessNode* multipleCardinalityAncestorNode = multipleCardinalityAncestorNodesLinkerIt->getData(); updateDirectAddingIndividualStatusFlags(multipleCardinalityAncestorNode,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED,mCalcAlgContext); } CBackendRepresentativeMemoryCacheIndividualAssociationData* indiAssData = nullptr; if (isConsistenceDataAvailable(mCalcAlgContext)) { CIndividualProcessNode* nominalProcessNode = getCorrectedNode(nominalID,mDetCachedCGIndiVector,mCalcAlgContext); if (nominalProcessNode) { CReapplyConceptLabelSet* nominalConSet = nominalProcessNode->getReapplyConceptLabelSet(false); if (nominalConSet) { bool nominalInfluenced = false; CReapplyConceptSaturationLabelSet* satConSet = processIndi->getReapplyConceptSaturationLabelSet(false); for (CConceptSaturationDescriptor* satConDesIt = satConSet->getConceptSaturationDescriptionLinker(); satConDesIt && !nominalInfluenced; satConDesIt = satConDesIt->getNext()) { CConcept* satConcept = satConDesIt->getConcept(); bool satConceptNegation = satConDesIt->isNegated(); if (!nominalConSet->containsConcept(satConcept,satConceptNegation)) { nominalInfluenced = true; } } if (nominalInfluenced) { if (!processIndi->getNominalIndividual()) { addInfluencedNominal(nominalID,mCalcAlgContext); } } for (CConceptDescriptor* nominalConDesIt = nominalConSet->getAddingSortedConceptDescriptionLinker(); nominalConDesIt; nominalConDesIt = nominalConDesIt->getNextConceptDesciptor()) { CConcept* nominalConcept = nominalConDesIt->getConcept(); bool nominalConceptNegation = nominalConDesIt->isNegated(); addConceptFilteredToIndividual(nominalConcept,nominalConceptNegation,processIndi,mCalcAlgContext); } } if (mNonDetConsistencyCG) { addCriticalConceptDescriptor(conDes,CCriticalSaturationConceptTypeQueues::CCT_NOMINAL,processIndi,mCalcAlgContext); } } else { CBackendRepresentativeMemoryCacheIndividualAssociationData* indiAssData = mBackendAssCaceHandler->getIndividualAssociation(nominalIndividual,mCalcAlgContext); if (indiAssData) { CBackendRepresentativeMemoryLabelCacheItem* labelCacheItem = indiAssData->getBackendLabelCacheEntry(); if (labelCacheItem) { CCACHINGHASH* labelValueHash = labelCacheItem->getDeterministicTagCacheValueHash(false); bool nominalInfluenced = false; CReapplyConceptSaturationLabelSet* satConSet = processIndi->getReapplyConceptSaturationLabelSet(false); for (CConceptSaturationDescriptor* satConDesIt = satConSet->getConceptSaturationDescriptionLinker(); satConDesIt && !nominalInfluenced; satConDesIt = satConDesIt->getNext()) { CConcept* satConcept = satConDesIt->getConcept(); bool satConceptNegation = satConDesIt->isNegated(); if (satConceptNegation || satConcept->getOperatorCode() != CCNOMINAL || satConcept->getNominalIndividual() != nominalIndividual) { CBackendRepresentativeMemoryLabelValueLinker* valueLinker = labelValueHash->value(satConcept->getConceptTag()); if (!valueLinker) { nominalInfluenced = true; } else { CCacheValue cacheValue(mBackendAssCaceHandler->getCacheValue(satConcept,satConceptNegation)); if (valueLinker->getCacheValue() != cacheValue) { nominalInfluenced = true; } } } } if (nominalInfluenced) { if (!processIndi->getNominalIndividual()) { addInfluencedNominal(nominalID,mCalcAlgContext); } } for (CBackendRepresentativeMemoryLabelValueLinker* labelValueLinkerIt = labelCacheItem->getDeterministicCacheValueLinker(); labelValueLinkerIt; labelValueLinkerIt = labelValueLinkerIt->getNext()) { const CCacheValue& cacheValue = labelValueLinkerIt->getCacheValue(); CConcept* addConcept = (CConcept*)cacheValue.getIdentification(); bool addConceptNegation = cacheValue.getCacheValueIdentifier() == CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; addConceptFilteredToIndividual(addConcept,addConceptNegation,processIndi,mCalcAlgContext); } } } } addNominalDependentIndividualNode(nominalID,processIndi,CSaturationNominalDependentNodeData::NOMINALCONNECTION,mCalcAlgContext); } else { delayNominalSaturationConceptProcessing(processIndi,conSatProLinker,nominalID,mCalcAlgContext); } } else { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::propagateUnloadedABoxCompletionGraphDependentIndividualNodeFlag(CIndividualSaturationProcessNode* processIndi, CConceptSaturationProcessLinker* conProLinker, cint64 nominalID, CCalculationAlgorithmContextBase* calcAlgContext) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDMISSEDABOXCONSISTENCYDATA,calcAlgContext); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applySELFRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { STATINC(SELFRULEAPPLICATIONCOUNT,mCalcAlgContext); CConceptSaturationDescriptor* conDes = conSatProLinker->getConceptSaturationDescriptor(); bool conNegation = conDes->getNegation(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); CMemoryAllocationManager* taskMemMan = nullptr; CRoleBackwardSaturationPropagationHash* backPropHash = nullptr; CReapplyConceptSaturationLabelSet* conSet = nullptr; CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { CRole* superRole = superRoleIt->getData(); CSortedNegLinker* domainConLinker = superRole->getDomainRangeConceptList(superRoleIt->isNegated()); for (CSortedNegLinker* domainConLinkerIt = domainConLinker; domainConLinkerIt; domainConLinkerIt = domainConLinkerIt->getNext()) { CConcept* domainConcept = domainConLinkerIt->getData(); bool domainConceptNegation = domainConLinkerIt->isNegated(); if (!conSet) { conSet = processIndi->getReapplyConceptSaturationLabelSet(true); } addConceptFilteredToIndividual(domainConcept,domainConceptNegation,processIndi,conSet,false,mCalcAlgContext); } CSortedNegLinker* rangeConLinker = superRole->getDomainRangeConceptList(!superRoleIt->isNegated()); for (CSortedNegLinker* rangeConLinkerIt = rangeConLinker; rangeConLinkerIt; rangeConLinkerIt = rangeConLinkerIt->getNext()) { CConcept* rangeConcept = rangeConLinkerIt->getData(); bool rangeConceptNegation = rangeConLinkerIt->isNegated(); if (!conSet) { conSet = processIndi->getReapplyConceptSaturationLabelSet(true); } addConceptFilteredToIndividual(rangeConcept,rangeConceptNegation,processIndi,conSet,false,mCalcAlgContext); } if (!taskMemMan) { taskMemMan = mCalcAlgContext->getUsedProcessTaskMemoryAllocationManager(); } CBackwardSaturationPropagationLink* backPropLink = CObjectAllocator::allocateAndConstruct(taskMemMan); backPropLink->initBackwardPropagationLink(processIndi,superRole); if (!backPropHash) { backPropHash = processIndi->getRoleBackwardPropagationHash(true); } CBackwardSaturationPropagationReapplyDescriptor* backPropReapplyDes = backPropHash->addSelfConnectedBackwardPropagationLink(superRole,backPropLink); if (backPropReapplyDes) { applyBackwardPropagationConcepts(processIndi,backPropReapplyDes,mCalcAlgContext); } superRoleIt = superRoleIt->getNext(); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::setDelayedNominalProcessingOccured(CCalculationAlgorithmContextBase* calcAlgContext) { calcAlgContext->getUsedProcessingDataBox()->setDelayedNominalProcessingOccured(true); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::setInsufficientNodeOccured(CCalculationAlgorithmContextBase* calcAlgContext) { calcAlgContext->getUsedProcessingDataBox()->setInsufficientNodeOccured(true); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::setProblematicEQCandidateOccured(CCalculationAlgorithmContextBase* calcAlgContext) { calcAlgContext->getUsedProcessingDataBox()->setProblematicEQCandidateOccured(true); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applySOMERule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker) { STATINC(SOMERULEAPPLICATIONCOUNT,mCalcAlgContext); createSuccessorForConcept(processIndi,conSatProLinker,1,mCalcAlgContext); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::createSuccessorForConcept(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conSatProLinker, cint64 cardinality, CCalculationAlgorithmContextBase* calcAlgContext) { CConceptSaturationDescriptor* conDes = conSatProLinker->getConceptSaturationDescriptor(); bool conNegation = conDes->getNegation(); CConcept* concept = conDes->getConcept(); CRole* role = concept->getRole(); CSortedNegLinker* conceptOpLinkerIt = concept->getOperandList(); CIndividualSaturationProcessNode* existIndiNode = nullptr; bool specializedExistentialRestriction = false; bool operandExistentialRestriction = false; CConceptData* conceptData = concept->getConceptData(); if (!existIndiNode && conceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)conceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* extSatCalcRefLinkData = confSatRefLinkingData->getExistentialSuccessorConceptSaturationReferenceLinkingData(); if (extSatCalcRefLinkData) { existIndiNode = (CIndividualSaturationProcessNode*)extSatCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } if (!existIndiNode && !specializedExistentialRestriction) { while (!existIndiNode && conceptOpLinkerIt) { CConcept* opConcept = conceptOpLinkerIt->getData(); bool opConNegation = conceptOpLinkerIt->isNegated()^conNegation; CConceptData* opConceptData = opConcept->getConceptData(); KONCLUDE_ASSERT_X(opConceptData,"SOME saturation rule","concept data missing"); if (opConceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)opConceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); KONCLUDE_ASSERT_X(conRefLinking,"SOME saturation rule","concept reference linking data missing"); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* satCalcRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(opConNegation); if (satCalcRefLinkData) { existIndiNode = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } conceptOpLinkerIt = conceptOpLinkerIt->getNext(); } } if (!existIndiNode && !specializedExistentialRestriction && !operandExistentialRestriction) { CConcept* baseTopConcept = nullptr; if (!role->isDataRole()) { baseTopConcept = calcAlgContext->getUsedProcessingDataBox()->getOntologyTopConcept(); } else { baseTopConcept = calcAlgContext->getUsedProcessingDataBox()->getOntologyTopDataRangeConcept(); } CConcept* opConcept = baseTopConcept; bool opConNegation = false; CConceptData* opConceptData = opConcept->getConceptData(); CConceptProcessData* conProcData = (CConceptProcessData*)opConceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); KONCLUDE_ASSERT_X(conRefLinking,"SOME saturation rule","concept reference linking data missing"); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* satCalcRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(opConNegation); if (satCalcRefLinkData) { existIndiNode = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } KONCLUDE_ASSERT_X(existIndiNode,"SOME saturation rule","concept reference linked individual node missing"); if (existIndiNode) { bool separatedMode = processIndi->isSeparated() && !existIndiNode->isSeparated(); if (!separatedMode) { addUninitializedIndividualToProcessingQueue(existIndiNode,mCalcAlgContext); } updateIndirectAddingIndividualStatusFlags(processIndi,existIndiNode->getIndirectStatusFlags(),mCalcAlgContext); updateAddingSuccessorConnectedNominal(processIndi,existIndiNode->getSuccessorConnectedNominalSet(false),mCalcAlgContext); CMemoryAllocationManager* taskMemMan = mCalcAlgContext->getUsedProcessTaskMemoryAllocationManager(); if (cardinality > 1) { if (existIndiNode->hasNominalIntegrated()) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED,calcAlgContext); } else { CXLinker* multipleCardinalityAncestorNodesLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(taskMemMan); multipleCardinalityAncestorNodesLinker->initLinker(processIndi); existIndiNode->addMultipleCardinalityAncestorNodesLinker(multipleCardinalityAncestorNodesLinker); } } bool existIndiInitialized = existIndiNode->isInitialized(); bool existIndiCompleted = existIndiNode->isCompleted(); if (separatedMode && !existIndiCompleted) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } else { CRoleBackwardSaturationPropagationHash* backPropHash = nullptr; CReapplyConceptSaturationLabelSet* conSet = nullptr; CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); bool connected = false; while (superRoleIt) { CRole* superRole = superRoleIt->getData(); if (superRole->getDisjointRoleList() != nullptr) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } CSortedNegLinker* domainConLinker = superRole->getDomainRangeConceptList(superRoleIt->isNegated()); for (CSortedNegLinker* domainConLinkerIt = domainConLinker; domainConLinkerIt; domainConLinkerIt = domainConLinkerIt->getNext()) { CConcept* domainConcept = domainConLinkerIt->getData(); bool domainConceptNegation = domainConLinkerIt->isNegated(); if (!conSet) { conSet = processIndi->getReapplyConceptSaturationLabelSet(true); } addConceptFilteredToIndividual(domainConcept,domainConceptNegation,processIndi,conSet,false,mCalcAlgContext); } if (superRoleIt->isNegated()) { connected = true; CBackwardSaturationPropagationLink* backPropLink = nullptr; if (!separatedMode) { backPropLink = CObjectAllocator::allocateAndConstruct(taskMemMan); backPropLink->initBackwardPropagationLink(processIndi,superRole); if (!existIndiInitialized) { existIndiNode->addInitializingBackwardPropagationLinks(backPropLink); } else { installBackwardPropagationLink(processIndi,existIndiNode,superRole,backPropLink,true,true,calcAlgContext); } } else { if (!backPropHash) { backPropHash = existIndiNode->getRoleBackwardPropagationHash(false); } if (backPropHash) { CBackwardSaturationPropagationReapplyDescriptor* backPropReapplyDes = backPropHash->getBackwardPropagationBackwardPropagationConceptDescriptor(superRole); if (backPropReapplyDes) { applyBackwardPropagationConcepts(processIndi,backPropReapplyDes,mCalcAlgContext); } } CCriticalPredecessorRoleCardinalityHash* criticalPredRoleCardHash = existIndiNode->getCriticalPredecessorRoleCardinalityHash(false); if (criticalPredRoleCardHash) { CCriticalPredecessorRoleCardinalityData* criticalPredRoleCardData = criticalPredRoleCardHash->getCriticalPredecessorRoleCardinalityData(role,false); if (criticalPredRoleCardData) { updateDirectAddingIndividualStatusFlags(processIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT,mCalcAlgContext); setInsufficientNodeOccured(mCalcAlgContext); } } } } else { addNewLinkedExtensionProcessingRole(superRole,processIndi,true,true,mCalcAlgContext); } superRoleIt = superRoleIt->getNext(); } if (!connected && !separatedMode) { CXLinker* nonInvConnectedIndiNodeLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(taskMemMan); nonInvConnectedIndiNodeLinker->initLinker(processIndi); existIndiNode->addNonInverseConnectedIndividualNodeLinker(nonInvConnectedIndiNodeLinker); } } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::applyBackwardPropagationConcepts(CIndividualSaturationProcessNode* sourceIndiNode, CBackwardSaturationPropagationReapplyDescriptor* backPropReapplyDesIt, CCalculationAlgorithmContextBase* calcAlgContext) { while (backPropReapplyDesIt) { CConceptSaturationDescriptor* reapplyConSatDes = backPropReapplyDesIt->getReapplyConceptSaturationDescriptor(); CConcept* reapplyConcept = reapplyConSatDes->getConcept(); bool reapplyConNegation = reapplyConSatDes->getNegation(); CSortedNegLinker* reapplyOpLinker = reapplyConcept->getOperandList(); while (reapplyOpLinker) { CConcept* opConcept = reapplyOpLinker->getData(); bool opNegation = reapplyOpLinker->isNegated()^reapplyConNegation; STATINC(ALLROLERESTRICTIONCOUNT,calcAlgContext); addConceptFilteredToIndividual(opConcept,opNegation,sourceIndiNode,true,calcAlgContext); reapplyOpLinker = reapplyOpLinker->getNext(); } backPropReapplyDesIt = backPropReapplyDesIt->getNext(); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addIndividualToProcessingQueue(CIndividualSaturationProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNodeLinker* processNodeLinker = processIndi->getIndividualSaturationProcessNodeLinker(); if (!processNodeLinker->isProcessingQueued()) { processNodeLinker->setProcessingQueued(); calcAlgContext->getUsedProcessingDataBox()->addIndividualSaturationProcessNodeLinker(processNodeLinker); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addUninitializedIndividualToProcessingQueue(CIndividualSaturationProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { if (!processIndi->isInitialized()) { addIndividualToProcessingQueue(processIndi,calcAlgContext); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addIndividualToCompletionQueue(CIndividualSaturationProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { if (!processIndi->isIndividualSaturationCompletionNodeLinkerQueued()) { CIndividualSaturationProcessNodeLinker* processNodeLinker = processIndi->getIndividualSaturationCompletionNodeLinker(true); processNodeLinker->setProcessingQueued(); calcAlgContext->getUsedProcessingDataBox()->addIndividualSaturationCompletionNodeLinker(processNodeLinker); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addConceptsFilteredToIndividual(CSortedNegLinker* conceptAddLinker, bool negate, CIndividualSaturationProcessNode*& processIndi, bool updateCopyDependedIndividual, CCalculationAlgorithmContextBase* calcAlgContext) { CSortedNegLinker* conceptAddLinkerIt = conceptAddLinker; while (conceptAddLinkerIt) { CConcept* opConcept = conceptAddLinkerIt->getData(); bool opConNegation = conceptAddLinkerIt->isNegated()^negate; addConceptFilteredToIndividual(opConcept,opConNegation,processIndi,updateCopyDependedIndividual,calcAlgContext); conceptAddLinkerIt = conceptAddLinkerIt->getNext(); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addConceptsFilteredToIndividual(CSortedNegLinker* conceptAddLinker, bool negate, CIndividualSaturationProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CSortedNegLinker* conceptAddLinkerIt = conceptAddLinker; while (conceptAddLinkerIt) { CConcept* opConcept = conceptAddLinkerIt->getData(); bool opConNegation = conceptAddLinkerIt->isNegated()^negate; addConceptFilteredToIndividual(opConcept,opConNegation,processIndi,calcAlgContext); conceptAddLinkerIt = conceptAddLinkerIt->getNext(); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addConceptsFilteredToIndividual(CXNegLinker* conceptAddLinker, bool negate, CIndividualSaturationProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CXNegLinker* conceptAddLinkerIt = conceptAddLinker; while (conceptAddLinkerIt) { CConcept* opConcept = conceptAddLinkerIt->getData(); bool opConNegation = conceptAddLinkerIt->isNegated()^negate; addConceptFilteredToIndividual(opConcept,opConNegation,processIndi,calcAlgContext); conceptAddLinkerIt = conceptAddLinkerIt->getNext(); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addConceptsFilteredToIndividual(CXSortedNegLinker* conceptAddLinker, bool negate, CIndividualSaturationProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CXSortedNegLinker* conceptAddLinkerIt = conceptAddLinker; while (conceptAddLinkerIt) { CConcept* opConcept = conceptAddLinkerIt->getData(); bool opConNegation = conceptAddLinkerIt->isNegated()^negate; addConceptFilteredToIndividual(opConcept,opConNegation,processIndi,calcAlgContext); conceptAddLinkerIt = conceptAddLinkerIt->getNext(); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addConceptFilteredToIndividual(CConcept* addingConcept, bool negate, CIndividualSaturationProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyConceptSaturationLabelSet* labelSet = processIndi->getReapplyConceptSaturationLabelSet(); addConceptFilteredToIndividual(addingConcept,negate,processIndi,labelSet,true,calcAlgContext); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addConceptFilteredToIndividual(CConcept* addingConcept, bool negate, CIndividualSaturationProcessNode*& processIndi, bool updateCopyDependedIndividual, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyConceptSaturationLabelSet* labelSet = processIndi->getReapplyConceptSaturationLabelSet(); addConceptFilteredToIndividual(addingConcept,negate,processIndi,labelSet,updateCopyDependedIndividual,calcAlgContext); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addConceptFilteredToIndividual(CConcept* addingConcept, bool negate, CIndividualSaturationProcessNode*& rootProcessIndi, CReapplyConceptSaturationLabelSet* labelSet, bool updateCopyDependedIndividual, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 opCode = addingConcept->getOperatorCode(); bool insertConcept = mConfForceAllConceptInsertion; if (!insertConcept) { CSortedNegLinker* opConLinkerIt = addingConcept->getOperandList(); if (!negate && (opCode == CCAND || opCode == CCAQAND || opCode == CCIMPLAQAND || opCode == CCBRANCHAQAND) || negate && opCode == CCOR) { addConceptsFilteredToIndividual(opConLinkerIt,negate,rootProcessIndi,updateCopyDependedIndividual,calcAlgContext); } else if (opCode == CCAQCHOOCE) { while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegation = opConLinkerIt->isNegated(); if (opNegation == negate) { addConceptFilteredToIndividual(opConcept,false,rootProcessIndi,labelSet,updateCopyDependedIndividual,calcAlgContext); } opConLinkerIt = opConLinkerIt->getNext(); } } else if (mConfImplicationAddingSkipping && opCode == CCIMPL) { insertConcept = false; } else { insertConcept = true; } } if (insertConcept) { addConceptToIndividual(addingConcept,negate,rootProcessIndi,labelSet,updateCopyDependedIndividual,calcAlgContext); } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::addConceptToIndividual(CConcept* addingConcept, bool negate, CIndividualSaturationProcessNode*& rootProcessIndi, CReapplyConceptSaturationLabelSet* labelSet, bool updateCopyDependedIndividual, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(CONCEPTSADDEDINDINODELABELSETCOUNT,calcAlgContext); KONCLUDE_ASSERT_X(addingConcept,"adding concept to individual","concept missing"); //if (rootProcessIndi->getNominalIndividual()) { // if (CIRIName::getRecentIRIName(rootProcessIndi->getNominalIndividual()->getIndividualNameLinker()).contains("http://www.biopax.org/release/biopax-level2.owl#protein")) { // if (CIRIName::getRecentIRIName(addingConcept->getClassNameLinker()) == "http://www.biopax.org/release/biopax-level2.owl#physicalEntityParticipant") { // bool bug = true; // } // if (addingConcept->getOperandCount() == 1 && CIRIName::getRecentIRIName(addingConcept->getOperandList()->getData()->getClassNameLinker()) == "http://www.biopax.org/release/biopax-level2.owl#physicalEntityParticipant") { // bool bug = true; // } // } //} //if (rootProcessIndi->getIndividualID() == 3087) { // if (addingConcept->getOperatorCode() == CCALL) { // if (CIRIName::getRecentIRIName(addingConcept->getRole()->getPropertyNameLinker()) == "http://www.science.uva.nl/~jliem/ontologies/QRvocabulary.owl#hasConfiguration") { // bool bug = true; // } // } //} CConceptSaturationDescriptor* conceptSaturationDescriptor = createConceptSaturationDescriptor(calcAlgContext); conceptSaturationDescriptor->initConceptSaturationDescriptor(addingConcept,negate); bool contained = insertConceptToIndividualConceptSet(conceptSaturationDescriptor,rootProcessIndi,labelSet,calcAlgContext); if (!contained) { STATINC(CONCEPTSADDEDINDINODEPROCESSINGQUEUECOUNT,calcAlgContext); CConceptSaturationProcessLinker* conceptSaturationProcessLinker = createConceptSaturationProcessLinker(calcAlgContext); conceptSaturationProcessLinker->initConceptSaturationProcessLinker(conceptSaturationDescriptor); rootProcessIndi->addConceptSaturationProcessLinker(conceptSaturationProcessLinker); addIndividualToProcessingQueue(rootProcessIndi,calcAlgContext); if (updateCopyDependedIndividual && rootProcessIndi->hasCopyDependingIndividualNodeLinker()) { // add concept to copy dependent individual nodes CXNegLinker* copyDepIndiLinkerIt = rootProcessIndi->getCopyDependingIndividualNodeLinker(); while (copyDepIndiLinkerIt) { CIndividualSaturationProcessNode* copyDepIndiNode = copyDepIndiLinkerIt->getData(); addConceptToIndividual(addingConcept,negate,copyDepIndiNode,copyDepIndiNode->getReapplyConceptSaturationLabelSet(true),true,calcAlgContext); copyDepIndiLinkerIt = copyDepIndiLinkerIt->getNext(); } } } else { // TODO: may release the concept saturation descriptor //releaseConceptSaturationDescriptor(conceptSaturationDescriptor,calcAlgContext); } } CConceptSaturationDescriptor* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::createConceptSaturationDescriptor(CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CConceptSaturationDescriptor* conSatDes = processingDataBox->takeRemainingConceptSaturationDescriptor(); if (!conSatDes) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); conSatDes = CObjectAllocator::allocateAndConstruct(taskMemMan); } return conSatDes; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::releaseConceptSaturationDescriptor(CConceptSaturationDescriptor* conSatDes, CCalculationAlgorithmContextBase* calcAlgContext) { conSatDes->clearNext(); CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); processingDataBox->addRemainingConceptSaturationDescriptor(conSatDes); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::releaseConceptSaturationProcessLinker(CConceptSaturationProcessLinker* conSatProcLinker, CCalculationAlgorithmContextBase* calcAlgContext) { conSatProcLinker->clearNext(); CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); processingDataBox->addRemainingConceptSaturationProcessLinker(conSatProcLinker); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::releaseRoleSaturationProcessLinker(CRoleSaturationProcessLinker* roleSatProcLinker, CCalculationAlgorithmContextBase* calcAlgContext) { roleSatProcLinker->clearNext(); CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); processingDataBox->addRemainingRoleSaturationProcessLinker(roleSatProcLinker); } CRoleSaturationProcessLinker* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::createRoleSaturationProcessLinker(CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CRoleSaturationProcessLinker* roleSatProcLinker = processingDataBox->takeRemainingRoleSaturationProcessLinker(); if (!roleSatProcLinker) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); roleSatProcLinker = CObjectAllocator::allocateAndConstruct(taskMemMan); } return roleSatProcLinker; } CConceptSaturationProcessLinker* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::createConceptSaturationProcessLinker(CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CConceptSaturationProcessLinker* conSatProcLinker = processingDataBox->takeRemainingConceptSaturationProcessLinker(); if (!conSatProcLinker) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); conSatProcLinker = CObjectAllocator::allocateAndConstruct(taskMemMan); } return conSatProcLinker; } CIndividualSaturationProcessNodeLinker* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::createIndividualSaturationNodeLinker(CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CIndividualSaturationProcessNodeLinker* indiSatNodeLinker = processingDataBox->takeRemainingIndividualSaturationNodeLinker(); if (!indiSatNodeLinker) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); indiSatNodeLinker = CObjectAllocator::allocateAndConstruct(taskMemMan); } return indiSatNodeLinker; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::releaseIndividualSaturationNodeLinker(CIndividualSaturationProcessNodeLinker* indSatNodeLinker, CCalculationAlgorithmContextBase* calcAlgContext) { indSatNodeLinker->clearNext(); CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); processingDataBox->addRemainingIndividualSaturationNodeLinker(indSatNodeLinker); } CIndividualSaturationSuccessorLinkDataLinker* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::createIndividualSaturationSuccessorLinkDataLinker(CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CIndividualSaturationSuccessorLinkDataLinker* succLinkDataLinker = processingDataBox->takeRemainingIndividualSuccessorLinkDataLinker(); if (!succLinkDataLinker) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); succLinkDataLinker = CObjectAllocator::allocateAndConstruct(taskMemMan); } return succLinkDataLinker; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::releaseIndividualSaturationSuccessorLinkDataLinker(CIndividualSaturationSuccessorLinkDataLinker* succLinkDataLinker, CCalculationAlgorithmContextBase* calcAlgContext) { if (succLinkDataLinker) { succLinkDataLinker->clearNext(); CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); processingDataBox->addRemainingIndividualSuccessorLinkDataLinker(succLinkDataLinker); } } CIndividualSaturationProcessNodeStatusUpdateLinker* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::createIndividualSaturationUpdateLinker(CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); CIndividualSaturationProcessNodeStatusUpdateLinker* conSatUpdateLinker = processingDataBox->takeRemainingIndividualSaturationUpdateLinker(); if (!conSatUpdateLinker) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); conSatUpdateLinker = CObjectAllocator::allocateAndConstruct(taskMemMan); } return conSatUpdateLinker; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::releaseIndividualSaturationUpdateLinker(CIndividualSaturationProcessNodeStatusUpdateLinker* conSatUpdateLinker, CCalculationAlgorithmContextBase* calcAlgContext) { conSatUpdateLinker->clearNext(); CProcessingDataBox* processingDataBox = calcAlgContext->getUsedProcessingDataBox(); processingDataBox->addRemainingIndividualSaturationUpdateLinker(conSatUpdateLinker); } CSaturationModifiedProcessUpdateLinker* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::createModifiedProcessUpdateLinker(CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); return CObjectAllocator::allocateAndConstruct(taskMemMan); } CImplicationReapplyConceptSaturationDescriptor* CCalculationTableauApproximationSaturationTaskHandleAlgorithm::createImplicationReapplyConceptSaturationDescriptor(CCalculationAlgorithmContextBase* calcAlgContext) { CMemoryAllocationManager* taskMemMan = calcAlgContext->getUsedProcessTaskMemoryAllocationManager(); CImplicationReapplyConceptSaturationDescriptor* impReaConSatDes = CObjectAllocator::allocateAndConstruct(taskMemMan); return impReaConSatDes; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::insertConceptToIndividualConceptSet(CConceptSaturationDescriptor* conceptSaturationDescriptor, CIndividualSaturationProcessNode*& rootProcessIndi, CReapplyConceptSaturationLabelSet* labelSet, CCalculationAlgorithmContextBase* calcAlgContext) { bool contained = false; bool insertConcept = true; bool implTriggerGeneration = false; bool requiredBackProp = rootProcessIndi->getRequiredBackwardPropagation(); CConcept* concept = conceptSaturationDescriptor->getConcept(); bool conNeg = conceptSaturationDescriptor->getNegation(); cint64 opCode = concept->getOperatorCode(); if (!mConfForceAllConceptInsertion) { if (opCode == CCATOM) { ++mAddedSUBConcepts; } else if (opCode == CCSUB) { ++mAddedSUBConcepts; } else if (!conNeg && (opCode == CCALL || opCode == CCIMPLALL)) { ++mAddedALLConcepts; insertConcept = false; contained = !requiredBackProp; } else if ((!conNeg && (opCode == CCSOME || opCode == CCAQSOME)) || (conNeg && opCode == CCALL)) { ++mAddedSOMEConcepts; } else if (opCode == CCIMPL) { ++mAddedIMPLConcepts; if (!requiredBackProp && !hasConceptLocalImpact(concept,false,calcAlgContext)) { insertConcept = false; contained = true; } else { implTriggerGeneration = true; contained = true; } } else if (opCode == CCIMPLTRIG || opCode == CCBRANCHTRIG) { ++mAddedTRIGGConcepts; } else if (opCode == CCAQCHOOCE) { insertConcept = false; ++mAddedELSEConcepts; } else { ++mAddedELSEConcepts; } } if (insertConcept) { bool newInsertion = false; CImplicationReapplyConceptSaturationDescriptor* reapplyImpReapplyConSatDes = nullptr; CImplicationReapplyConceptSaturationDescriptor** reapplyImpReapplyConSatDesPtr = nullptr; bool clashed = labelSet->insertConceptReturnClashed(conceptSaturationDescriptor,&newInsertion,&reapplyImpReapplyConSatDesPtr); if (!clashed) { if (newInsertion) { if (reapplyImpReapplyConSatDesPtr) { reapplyImpReapplyConSatDes = *reapplyImpReapplyConSatDesPtr; } CImplicationReapplyConceptSaturationDescriptor* reapplyImpReapplyConSatDesIt = reapplyImpReapplyConSatDes; while (reapplyImpReapplyConSatDesIt) { CSortedNegLinker* triggerConLinker = reapplyImpReapplyConSatDesIt->getNextTriggerConcept(); if (triggerConLinker->getData() == conceptSaturationDescriptor->getConcept() && triggerConLinker->isNegated() != conceptSaturationDescriptor->isNegated()) { updateImplicationReapplyConceptSaturationDescriptor(reapplyImpReapplyConSatDesIt,rootProcessIndi,labelSet,calcAlgContext); } reapplyImpReapplyConSatDesIt = reapplyImpReapplyConSatDesIt->getNext(); } if (implTriggerGeneration) { // add first trigger CImplicationReapplyConceptSaturationDescriptor tmpNewReapplyImpReapplyConSatDes; CConcept* implConcept = conceptSaturationDescriptor->getConcept(); CSortedNegLinker* nextTriggerConcept = implConcept->getOperandList(); tmpNewReapplyImpReapplyConSatDes.initImplicationReapllyConceptSaturationDescriptor(implConcept,nextTriggerConcept); updateImplicationReapplyConceptSaturationDescriptor(&tmpNewReapplyImpReapplyConSatDes,rootProcessIndi,labelSet,calcAlgContext); } if (mConfImplicationAddingSkipping) { if (!conNeg && (opCode == CCATOM || opCode == CCSUB || opCode == CCIMPLTRIG || opCode == CCBRANCHTRIG)) { CSortedNegLinker* opConceptLinkerIt = concept->getOperandList(); while (opConceptLinkerIt) { if (!opConceptLinkerIt->isNegated()) { CConcept* opConcept = opConceptLinkerIt->getData(); if (opConcept->getOperatorCode() == CCIMPL) { CImplicationReapplyConceptSaturationDescriptor tmpNewReapplyImpReapplyConSatDes; CConcept* implConcept = opConcept; CSortedNegLinker* nextTriggerConcept = implConcept->getOperandList(); tmpNewReapplyImpReapplyConSatDes.initImplicationReapllyConceptSaturationDescriptor(implConcept,nextTriggerConcept); updateImplicationReapplyConceptSaturationDescriptor(&tmpNewReapplyImpReapplyConSatDes,rootProcessIndi,labelSet,calcAlgContext); } } opConceptLinkerIt = opConceptLinkerIt->getNext(); } } } if (labelSet->hasModifiedUpdateLinkers()) { processModificationUpdateLinkers(rootProcessIndi,labelSet,labelSet->getModifiedUpdateLinker(),calcAlgContext); } } else { contained = true; } } else { rootProcessIndi->addClashedConceptSaturationDescriptorLinker(conceptSaturationDescriptor); //mEndSaturationDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); //QFile tmpFile("saturation-model.txt"); //if (tmpFile.open(QIODevice::WriteOnly)) { // tmpFile.write(mEndSaturationDebugIndiModelString.replace("
","").replace("

","\n").toLocal8Bit()); // tmpFile.close(); //} updateDirectAddingIndividualStatusFlags(rootProcessIndi,CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED,calcAlgContext); contained = true; } } return contained; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::processModificationUpdateLinkers(CIndividualSaturationProcessNode*& rootProcessIndi, CReapplyConceptSaturationLabelSet* labelSet, CSaturationModifiedProcessUpdateLinker* modProcUpdateLinker, CCalculationAlgorithmContextBase* calcAlgContext) { for (CSaturationModifiedProcessUpdateLinker* modProcUpdateLinkerIt = modProcUpdateLinker; modProcUpdateLinkerIt; modProcUpdateLinkerIt = modProcUpdateLinkerIt->getNext()) { CIndividualSaturationProcessNode* indiProcNode = modProcUpdateLinkerIt->getProcessingIndividual(); CSaturationModifiedProcessUpdateLinker::MODIFICATIONPROCESSUPDATETYPE updateType = modProcUpdateLinkerIt->getUpdateType(); if (updateType == CSaturationModifiedProcessUpdateLinker::UPDATEPDISJUNCTCOMMONCONCEPTSEXTRACTION) { addDisjunctCommonConceptExtractionToProcessingQueue(indiProcNode,calcAlgContext); } } } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateImplicationReapplyConceptSaturationDescriptor(CImplicationReapplyConceptSaturationDescriptor* reapplyImpReapplyConSatDes, CIndividualSaturationProcessNode*& rootProcessIndi, CReapplyConceptSaturationLabelSet* labelSet, CCalculationAlgorithmContextBase* calcAlgContext) { STATINC(IMPLICATIONTRIGGERINGCOUNT,calcAlgContext); CSortedNegLinker* currTriggerConcept = reapplyImpReapplyConSatDes->getNextTriggerConcept(); CSortedNegLinker* nextTriggerConcept = currTriggerConcept->getNext(); CConcept* implConcept = reapplyImpReapplyConSatDes->getImplicationConcept(); if (!nextTriggerConcept) { // execute implication STATINC(IMPLICATIONEXECUTINGCOUNT,calcAlgContext); CSortedNegLinker* impExConOpLinker = implConcept->getOperandList(); addConceptFilteredToIndividual(impExConOpLinker->getData(),impExConOpLinker->isNegated(),rootProcessIndi,labelSet,false,calcAlgContext); } else { CConcept* nextTrigger = nextTriggerConcept->getData(); // add next trigger CImplicationReapplyConceptSaturationDescriptor* newReapplyImpReapplyConSatDes = createImplicationReapplyConceptSaturationDescriptor(calcAlgContext); newReapplyImpReapplyConSatDes->initImplicationReapllyConceptSaturationDescriptor(implConcept,nextTriggerConcept); CConceptSaturationDescriptor* conSatDes = nullptr; bool triggered = labelSet->insertConceptReapplicationReturnTriggered(nextTrigger->getConceptTag(),newReapplyImpReapplyConSatDes,&conSatDes); if (triggered) { updateImplicationReapplyConceptSaturationDescriptor(newReapplyImpReapplyConSatDes,rootProcessIndi,labelSet,calcAlgContext); } } return true; } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::hasConceptLocalImpact(CConcept* concept, bool conNeg, CCalculationAlgorithmContextBase* calcAlgContext) { cint64 opCode = concept->getOperatorCode(); if (opCode == CCSUB || opCode == CCIMPLTRIG || opCode == CCBRANCHTRIG) { return true; } else if (!conNeg && (opCode == CCALL || opCode == CCIMPLALL || opCode == CCBRANCHALL) || conNeg && (opCode == CCSOME)) { return false; } else if (!conNeg && (opCode == CCAND || opCode == CCAQAND || opCode == CCBRANCHAQAND || opCode == CCIMPLAQAND) || conNeg && opCode == CCOR) { CSortedNegLinker* opConList = concept->getOperandList(); while (opConList) { CConcept* opConcept = opConList->getData(); bool opConNeg = opConList->isNegated()^conNeg; if (hasConceptLocalImpact(opConcept,opConNeg,calcAlgContext)) { return true; } opConList = opConList->getNext(); } return false; } else if (!conNeg && (opCode == CCSOME || opCode == CCAQSOME) || conNeg && (opCode == CCALL)) { return true; } else if (!conNeg && (opCode == CCAQALL || opCode == CCIMPLAQALL || opCode == CCBRANCHAQALL) || conNeg && (opCode == CCSOME || opCode == CCAQSOME)) { return false; } else if (opCode == CCAQCHOOCE) { CSortedNegLinker* opConList = concept->getOperandList(); while (opConList) { CConcept* opConcept = opConList->getData(); bool opNegation = opConList->isNegated(); if (opNegation == conNeg) { if (hasConceptLocalImpact(opConcept,false,calcAlgContext)) { return true; } } opConList = opConList->getNext(); } return false; } else if (opCode == CCIMPL) { CSortedNegLinker* opConList = concept->getOperandList(); CConcept* opConcept = opConList->getData(); bool opNegation = opConList->isNegated(); if (hasConceptLocalImpact(opConcept,opNegation,calcAlgContext)) { return true; } return false; } return false; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateDirectAddingIndividualStatusFlags(CIndividualSaturationProcessNode* indiNode, cint64 flags, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNodeStatusFlags addingFlags; addingFlags.initStatusFlags(); addingFlags.addFlags(flags); updateDirectAddingIndividualStatusFlags(indiNode,&addingFlags,calcAlgContext); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateDirectNotDependentAddingIndividualStatusFlags(CIndividualSaturationProcessNode* indiNode, cint64 flags, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNodeStatusFlags addingFlags; addingFlags.initStatusFlags(); addingFlags.addFlags(flags); updateDirectNotDependentAddingIndividualStatusFlags(indiNode,&addingFlags,calcAlgContext); } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::requiresDirectAddingIndividualStatusFlagsUpdate(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNodeStatusFlags* indiDirectFlags = indiNode->getDirectStatusFlags(); return !indiDirectFlags->hasFlags(addingFlags,true); } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::requiresIndirectAddingIndividualStatusFlagsUpdate(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CCalculationAlgorithmContextBase* calcAlgContext) { CIndividualSaturationProcessNodeStatusFlags* indiIndirectFlags = indiNode->getIndirectStatusFlags(); return !indiIndirectFlags->hasFlags(addingFlags,true); } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateDirectAddingIndividualStatusFlags(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CCalculationAlgorithmContextBase* calcAlgContext) { if (requiresDirectAddingIndividualStatusFlagsUpdate(indiNode,addingFlags,calcAlgContext)) { CIndividualSaturationProcessNodeStatusUpdateLinker* directUpdateLinker = createIndividualSaturationUpdateLinker(calcAlgContext); directUpdateLinker->initUpdateNodeLinker(indiNode); CIndividualSaturationProcessNodeStatusFlags* directIndiFlags = indiNode->getDirectStatusFlags(); directIndiFlags->addFlags(addingFlags); ++mDirectUpdatedStatusIndiNodeCount; while (directUpdateLinker) { CIndividualSaturationProcessNodeStatusUpdateLinker* nextUpdateLinker = directUpdateLinker; directUpdateLinker = directUpdateLinker->getNext(); CIndividualSaturationProcessNode* updateIndiNode = nextUpdateLinker->getData(); nextUpdateLinker->clearNext(); releaseIndividualSaturationUpdateLinker(nextUpdateLinker,calcAlgContext); for (CXNegLinker* depdendingIndiLinkerIt = updateIndiNode->getCopyDependingIndividualNodeLinker(); depdendingIndiLinkerIt; depdendingIndiLinkerIt = depdendingIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* dependingIndi = depdendingIndiLinkerIt->getData(); if (requiresDirectAddingIndividualStatusFlagsUpdate(dependingIndi,addingFlags,calcAlgContext)) { CIndividualSaturationProcessNodeStatusFlags* directIndiFlags = dependingIndi->getDirectStatusFlags(); directIndiFlags->addFlags(addingFlags); ++mDirectUpdatedStatusIndiNodeCount; directUpdateLinker = createIndividualSaturationUpdateLinker(calcAlgContext)->initUpdateNodeLinker(dependingIndi)->append(directUpdateLinker); } } updateIndirectAddingIndividualStatusFlags(updateIndiNode,addingFlags,calcAlgContext); } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateDirectNotDependentAddingIndividualStatusFlags(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CCalculationAlgorithmContextBase* calcAlgContext) { if (requiresDirectAddingIndividualStatusFlagsUpdate(indiNode,addingFlags,calcAlgContext)) { CIndividualSaturationProcessNodeStatusFlags* directIndiFlags = indiNode->getDirectStatusFlags(); directIndiFlags->addFlags(addingFlags); if (requiresIndirectAddingIndividualStatusFlagsUpdate(indiNode,addingFlags,calcAlgContext)) { CIndividualSaturationProcessNodeStatusFlags* indirectIndiFlags = indiNode->getIndirectStatusFlags(); indirectIndiFlags->addFlags(addingFlags); ++mIndirectUpdatedStatusIndiNodeCount; } ++mDirectUpdatedStatusIndiNodeCount; CRoleBackwardSaturationPropagationHash* backwardPropHash = indiNode->getRoleBackwardPropagationHash(false); if (backwardPropHash) { CPROCESSHASH* backPropHash = backwardPropHash->getRoleBackwardPropagationDataHash(); for (CPROCESSHASH::const_iterator it = backPropHash->constBegin(), itEnd = backPropHash->constEnd(); it != itEnd; ++it) { CRole* backwardPropRole = it.key(); const CRoleBackwardSaturationPropagationHashData& backwardPropData = it.value(); for (CBackwardSaturationPropagationLink* linkIt = backwardPropData.mLinkLinker; linkIt; linkIt = linkIt->getNext()) { CIndividualSaturationProcessNode* sourceIndividual = linkIt->getSourceIndividual(); updateIndirectAddingIndividualStatusFlags(sourceIndividual,addingFlags,calcAlgContext); } } } for (CXLinker* nonInvConnIndiLinkerIt = indiNode->getNonInverseConnectedIndividualNodeLinker(); nonInvConnIndiLinkerIt; nonInvConnIndiLinkerIt = nonInvConnIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* sourceIndividual = nonInvConnIndiLinkerIt->getData(); updateIndirectAddingIndividualStatusFlags(sourceIndividual,addingFlags,calcAlgContext); } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateIndirectAddingIndividualStatusFlags(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CCalculationAlgorithmContextBase* calcAlgContext) { if (requiresIndirectAddingIndividualStatusFlagsUpdate(indiNode,addingFlags,calcAlgContext)) { CIndividualSaturationProcessNodeStatusUpdateLinker* directUpdateLinker = createIndividualSaturationUpdateLinker(calcAlgContext); directUpdateLinker->initUpdateNodeLinker(indiNode); CIndividualSaturationProcessNodeStatusFlags* indirectIndiFlags = indiNode->getIndirectStatusFlags(); indirectIndiFlags->addFlags(addingFlags); ++mIndirectUpdatedStatusIndiNodeCount; while (directUpdateLinker) { CIndividualSaturationProcessNodeStatusUpdateLinker* nextUpdateLinker = directUpdateLinker; directUpdateLinker = directUpdateLinker->getNext(); CIndividualSaturationProcessNode* updateIndiNode = nextUpdateLinker->getData(); nextUpdateLinker->clearNext(); releaseIndividualSaturationUpdateLinker(nextUpdateLinker,calcAlgContext); for (CXNegLinker* depdendingIndiLinkerIt = updateIndiNode->getCopyDependingIndividualNodeLinker(); depdendingIndiLinkerIt; depdendingIndiLinkerIt = depdendingIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* dependingIndi = depdendingIndiLinkerIt->getData(); if (requiresIndirectAddingIndividualStatusFlagsUpdate(dependingIndi,addingFlags,calcAlgContext)) { CIndividualSaturationProcessNodeStatusFlags* indirectIndiFlags = dependingIndi->getIndirectStatusFlags(); indirectIndiFlags->addFlags(addingFlags); ++mIndirectUpdatedStatusIndiNodeCount; directUpdateLinker = createIndividualSaturationUpdateLinker(calcAlgContext)->initUpdateNodeLinker(dependingIndi)->append(directUpdateLinker); } } CRoleBackwardSaturationPropagationHash* backwardPropHash = updateIndiNode->getRoleBackwardPropagationHash(false); if (backwardPropHash) { CPROCESSHASH* backPropHash = backwardPropHash->getRoleBackwardPropagationDataHash(); for (CPROCESSHASH::const_iterator it = backPropHash->constBegin(), itEnd = backPropHash->constEnd(); it != itEnd; ++it) { CRole* backwardPropRole = it.key(); const CRoleBackwardSaturationPropagationHashData& backwardPropData = it.value(); for (CBackwardSaturationPropagationLink* linkIt = backwardPropData.mLinkLinker; linkIt; linkIt = linkIt->getNext()) { CIndividualSaturationProcessNode* sourceIndividual = linkIt->getSourceIndividual(); if (requiresIndirectAddingIndividualStatusFlagsUpdate(sourceIndividual,addingFlags,calcAlgContext)) { CIndividualSaturationProcessNodeStatusFlags* indirectIndiFlags = sourceIndividual->getIndirectStatusFlags(); indirectIndiFlags->addFlags(addingFlags); ++mIndirectUpdatedStatusIndiNodeCount; directUpdateLinker = createIndividualSaturationUpdateLinker(calcAlgContext)->initUpdateNodeLinker(sourceIndividual)->append(directUpdateLinker); } } } } for (CXLinker* nonInvConnIndiLinkerIt = updateIndiNode->getNonInverseConnectedIndividualNodeLinker(); nonInvConnIndiLinkerIt; nonInvConnIndiLinkerIt = nonInvConnIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* sourceIndividual = nonInvConnIndiLinkerIt->getData(); if (requiresIndirectAddingIndividualStatusFlagsUpdate(sourceIndividual,addingFlags,calcAlgContext)) { CIndividualSaturationProcessNodeStatusFlags* indirectIndiFlags = sourceIndividual->getIndirectStatusFlags(); indirectIndiFlags->addFlags(addingFlags); ++mIndirectUpdatedStatusIndiNodeCount; directUpdateLinker = createIndividualSaturationUpdateLinker(calcAlgContext)->initUpdateNodeLinker(sourceIndividual)->append(directUpdateLinker); } } } } } bool CCalculationTableauApproximationSaturationTaskHandleAlgorithm::requiresAddingSuccessorConnectedNominals(CIndividualSaturationProcessNode* indiNode, cint64 addingNominalID, CCalculationAlgorithmContextBase* calcAlgContext) { CSuccessorConnectedNominalSet* succConnNomSet = indiNode->getSuccessorConnectedNominalSet(false); if (succConnNomSet) { if (succConnNomSet->hasSuccessorConnectedNominal(addingNominalID)) { return false; } } return true; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateAddingSuccessorConnectedNominal(CIndividualSaturationProcessNode* indiNode, CSuccessorConnectedNominalSet* succConnNomSet, CCalculationAlgorithmContextBase* calcAlgContext) { if (succConnNomSet) { for (CSuccessorConnectedNominalSet::const_iterator it = succConnNomSet->constBegin(), itEnd = succConnNomSet->constEnd(); it != itEnd; ++it) { cint64 connectedNominalID(*it); updateAddingSuccessorConnectedNominal(indiNode,connectedNominalID,calcAlgContext); } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::updateAddingSuccessorConnectedNominal(CIndividualSaturationProcessNode* indiNode, cint64 addingNominalID, CCalculationAlgorithmContextBase* calcAlgContext) { if (requiresAddingSuccessorConnectedNominals(indiNode,addingNominalID,calcAlgContext)) { CIndividualSaturationProcessNodeStatusUpdateLinker* directUpdateLinker = createIndividualSaturationUpdateLinker(calcAlgContext); directUpdateLinker->initUpdateNodeLinker(indiNode); CSuccessorConnectedNominalSet* succConnNomSet = indiNode->getSuccessorConnectedNominalSet(true); succConnNomSet->addSuccessorConnectedNominal(addingNominalID); ++mSuccessorConnectedNominalUpdatedCount; while (directUpdateLinker) { CIndividualSaturationProcessNodeStatusUpdateLinker* nextUpdateLinker = directUpdateLinker; directUpdateLinker = directUpdateLinker->getNext(); CIndividualSaturationProcessNode* updateIndiNode = nextUpdateLinker->getData(); nextUpdateLinker->clearNext(); releaseIndividualSaturationUpdateLinker(nextUpdateLinker,calcAlgContext); for (CXNegLinker* depdendingIndiLinkerIt = updateIndiNode->getCopyDependingIndividualNodeLinker(); depdendingIndiLinkerIt; depdendingIndiLinkerIt = depdendingIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* dependingIndi = depdendingIndiLinkerIt->getData(); if (requiresAddingSuccessorConnectedNominals(dependingIndi,addingNominalID,calcAlgContext)) { CSuccessorConnectedNominalSet* depIndiSuccConnNomSet = dependingIndi->getSuccessorConnectedNominalSet(true); depIndiSuccConnNomSet->addSuccessorConnectedNominal(addingNominalID); ++mSuccessorConnectedNominalUpdatedCount; directUpdateLinker = createIndividualSaturationUpdateLinker(calcAlgContext)->initUpdateNodeLinker(dependingIndi)->append(directUpdateLinker); } } CRoleBackwardSaturationPropagationHash* backwardPropHash = updateIndiNode->getRoleBackwardPropagationHash(false); if (backwardPropHash) { CPROCESSHASH* backPropHash = backwardPropHash->getRoleBackwardPropagationDataHash(); for (CPROCESSHASH::const_iterator it = backPropHash->constBegin(), itEnd = backPropHash->constEnd(); it != itEnd; ++it) { CRole* backwardPropRole = it.key(); const CRoleBackwardSaturationPropagationHashData& backwardPropData = it.value(); for (CBackwardSaturationPropagationLink* linkIt = backwardPropData.mLinkLinker; linkIt; linkIt = linkIt->getNext()) { CIndividualSaturationProcessNode* sourceIndividual = linkIt->getSourceIndividual(); if (requiresAddingSuccessorConnectedNominals(sourceIndividual,addingNominalID,calcAlgContext)) { CSuccessorConnectedNominalSet* sourceIndiSuccConnNomSet = sourceIndividual->getSuccessorConnectedNominalSet(true); sourceIndiSuccConnNomSet->addSuccessorConnectedNominal(addingNominalID); ++mSuccessorConnectedNominalUpdatedCount; directUpdateLinker = createIndividualSaturationUpdateLinker(calcAlgContext)->initUpdateNodeLinker(sourceIndividual)->append(directUpdateLinker); } } } } for (CXLinker* nonInvConnIndiLinkerIt = updateIndiNode->getNonInverseConnectedIndividualNodeLinker(); nonInvConnIndiLinkerIt; nonInvConnIndiLinkerIt = nonInvConnIndiLinkerIt->getNext()) { CIndividualSaturationProcessNode* sourceIndividual = nonInvConnIndiLinkerIt->getData(); if (requiresAddingSuccessorConnectedNominals(sourceIndividual,addingNominalID,calcAlgContext)) { CSuccessorConnectedNominalSet* sourceIndiSuccConnNomSet = sourceIndividual->getSuccessorConnectedNominalSet(true); sourceIndiSuccConnNomSet->addSuccessorConnectedNominal(addingNominalID); ++mSuccessorConnectedNominalUpdatedCount; directUpdateLinker = createIndividualSaturationUpdateLinker(calcAlgContext)->initUpdateNodeLinker(sourceIndividual)->append(directUpdateLinker); } } } } } cint64 CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getAppliedANDRuleCount() { return mAppliedANDRuleCount; } cint64 CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getAppliedORRuleCount() { return mAppliedORRuleCount; } cint64 CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getAppliedSOMERuleCount() { return mAppliedSOMERuleCount; } cint64 CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getAppliedATLEASTRuleCount() { return mAppliedATLEASTRuleCount; } cint64 CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getAppliedALLRuleCount() { return mAppliedALLRuleCount; } cint64 CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getAppliedATMOSTRuleCount() { return mAppliedATMOSTRuleCount; } cint64 CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getAppliedTotalRuleCount() { return mAppliedTOTALRuleCount; } QString CCalculationTableauApproximationSaturationTaskHandleAlgorithm::generateExtendedDebugIndiModelStringList(CCalculationAlgorithmContextBase* calcAlgContext, cint64 firstIndiID, cint64 lastIndiID) { CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CIndividualSaturationProcessNodeVector* indiVec = procDataBox->getIndividualSaturationProcessNodeVector(); cint64 indiCount = indiVec->getItemCount(); if (lastIndiID >= 0) { indiCount = qMin(lastIndiID,indiCount); } firstIndiID = qMin(firstIndiID,indiCount); QStringList indiStringList; for (cint64 i = firstIndiID; i < indiCount; ++i) { CIndividualSaturationProcessNode* indi = indiVec->getData(i); if (indi) { CExtendedConceptReferenceLinkingData* extConRefLinkData = indi->getSaturationConceptReferenceLinking(); CSaturationConceptDataItem* conceptSatItem = (CSaturationConceptDataItem*)extConRefLinkData; QString nominalString = QString(""); if (conceptSatItem) { CConcept* initializedConcept = conceptSatItem->getSaturationConcept(); bool initializedNegation = conceptSatItem->getSaturationNegation(); if (initializedConcept->hasClassName() && !initializedNegation) { nominalString = QString(", ")+CIRIName::getRecentIRIName(initializedConcept->getClassNameLinker()); } else { if (!initializedNegation) { nominalString = QString(", %1").arg(initializedConcept->getConceptTag()); } else { nominalString = QString(", %1%2").arg(QChar(0x00AC)).arg(initializedConcept->getConceptTag()); } } //if (indi->getNominalIndividual()) { // nominalString = QString(", ")+CIRIName::getRecentIRIName(indi->getNominalIndividual()->getNameLinker()); //} } else { if (indi->getNominalIndividual()) { nominalString = QString(", ")+CIRIName::getRecentIRIName(indi->getNominalIndividual()->getNameLinker()); } else { nominalString = QString(",Resolved-Extension-Node"); } } QString refModeString("[new root node]"); CIndividualSaturationProcessNode* refIndi = indi->getReferenceIndividualSaturationProcessNode(); if (refIndi) { cint64 refIndiID = refIndi->getIndividualID(); if (refIndi->getReferenceMode() == 1) { refModeString = QString("[substitute node %1]").arg(refIndiID); } else if (refIndi->getReferenceMode() == 2) { refModeString = QString("[copy node %1]").arg(refIndiID); } } QString indiString = QString("[ %1%2 ] <- %3
\n").arg(indi->getIndividualID()).arg(nominalString).arg(refModeString); QString conSetString; CReapplyConceptSaturationLabelSet* conSet = indi->getReapplyConceptSaturationLabelSet(false); if (conSet) { CConceptSaturationDescriptor* conDesIt = conSet->getConceptSaturationDescriptionLinker(); while (conDesIt) { CConceptSaturationDescriptor* conDes = conDesIt; CConcept* concept = conDes->getConcept(); cint64 conTag = conDes->getConceptTag(); if (conTag != 1) { QString conceptString("null"); if (conDes) { conceptString = CConceptTextFormater::getConceptString(conDes->getConcept(),conDes->isNegated()); } if (!conSetString.isEmpty()) { conSetString += QString("
\n"); } conSetString += conceptString; } conDesIt = conDesIt->getNextConceptDesciptor(); } } QString propString; CRoleBackwardSaturationPropagationHash* backwardPropHash = indi->getRoleBackwardPropagationHash(false); if (backwardPropHash) { CPROCESSHASH* backPropHash = backwardPropHash->getRoleBackwardPropagationDataHash(); for (CPROCESSHASH::const_iterator it = backPropHash->constBegin(), itEnd = backPropHash->constEnd(); it != itEnd; ++it) { CRole* backwardPropRole = it.key(); const CRoleBackwardSaturationPropagationHashData& backwardPropData = it.value(); QString roleString; roleString += QString::number(backwardPropRole->getRoleTag()); if (backwardPropRole->hasPropertyName()) { roleString += QString("~")+CIRIName::getRecentIRIName(backwardPropRole->getPropertyNameLinker()); } QString sourceIndiListString; CBackwardSaturationPropagationLink* backPropLinkIt = backwardPropData.mLinkLinker; while (backPropLinkIt) { CIndividualSaturationProcessNode* sourceIndiNode = backPropLinkIt->getSourceIndividual(); if (!sourceIndiListString.isEmpty()) { sourceIndiListString.append(", ->"); } else { sourceIndiListString.append(" ->"); } sourceIndiListString += QString::number(sourceIndiNode->getIndividualID()); backPropLinkIt = backPropLinkIt->getNext(); } QString roleBackPropString = QString("%1:%2").arg(roleString).arg(sourceIndiListString); propString += QString("
\n%1").arg(roleBackPropString); } } if (propString.isEmpty()) { propString = "-"; } QString succString; CLinkedRoleSaturationSuccessorHash* linkedSuccHash = indi->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { QStringList succRoleStringList; CPROCESSHASH* succHash = linkedSuccHash->getLinkedRoleSuccessorHash(); for (CPROCESSHASH::const_iterator it = succHash->constBegin(), itEnd = succHash->constEnd(); it != itEnd; ++it) { CRole* role(it.key()); CLinkedRoleSaturationSuccessorData* succLinkData(it.value()); CPROCESSMAP* succDataMap = succLinkData->getSuccessorNodeDataMap(false); QStringList linkedSuccIndiStringList; for (CPROCESSMAP::const_iterator itSucc = succDataMap->constBegin(), itSuccEnd = succDataMap->constEnd(); itSucc != itSuccEnd; ++itSucc) { cint64 succIndiID = itSucc.key(); CSaturationSuccessorData* succData(itSucc.value()); QStringList indiSuccStatusStringList; if (succData->mExtension) { indiSuccStatusStringList << QString("~extension"); } else { indiSuccStatusStringList << QString("~base"); } if (succData->mActiveCount > 0) { indiSuccStatusStringList << QString("~active"); } else { indiSuccStatusStringList << QString("~inactive"); } if (succLinkData->mRoleALLConceptsProcessingQueued) { indiSuccStatusStringList << QString("~all-ext-queued"); } QStringList createRoleStingList; for (CXNegLinker* roleCreationLinkerIt = succData->mCreationRoleLinker; roleCreationLinkerIt; roleCreationLinkerIt = roleCreationLinkerIt->getNext()) { QString creationRoleString; CRole* creationRole = roleCreationLinkerIt->getData(); creationRoleString += QString::number(creationRole->getRoleTag()); if (creationRole->hasPropertyName()) { creationRoleString += QString("~")+CIRIName::getRecentIRIName(creationRole->getPropertyNameLinker()); } createRoleStingList << creationRoleString; } QString linkedSuccIndiString = QString("\t~>%1; link-status: %2; creation-roles: %3;").arg(succIndiID).arg(indiSuccStatusStringList.join(", ")).arg(createRoleStingList.join(", ")); linkedSuccIndiStringList.append(linkedSuccIndiString); } if (!linkedSuccIndiStringList.isEmpty()) { QString roleString; roleString += QString::number(role->getRoleTag()); if (role->hasPropertyName()) { roleString += QString("~")+CIRIName::getRecentIRIName(role->getPropertyNameLinker()); } QString roleSuccString = QString("
\n%1:
\n%2").arg(roleString).arg(linkedSuccIndiStringList.join("
\n")); succRoleStringList.append(roleSuccString); } } succString = QString("
\n%1").arg(succRoleStringList.join("")); } if (succString.isEmpty()) { succString = "-"; } QString depIndiString; CXNegLinker* depIndiLinker = indi->getCopyDependingIndividualNodeLinker(); if (depIndiLinker) { QString depIndiListString; while (depIndiLinker) { CIndividualSaturationProcessNode* depIndi = depIndiLinker->getData(); depIndiLinker = depIndiLinker->getNext(); if (!depIndiListString.isEmpty()) { depIndiListString.append(", "); } else { depIndiListString.append(">>"); } depIndiListString.append(QString::number(depIndi->getIndividualID())); } depIndiString = QString("
\nForwarding to: %1
\n").arg(depIndiListString); } CIndividualSaturationProcessNodeStatusFlags* directStatusFlags = indi->getDirectStatusFlags(); QString directFlagString; QStringList directFlagsStringList = generateStatusFlagsStringList(directStatusFlags,calcAlgContext); if (!directFlagsStringList.isEmpty()) { directFlagString = QString("
\nDirect Flags: %1
\n").arg(directFlagsStringList.join(",")); } CIndividualSaturationProcessNodeStatusFlags* indirectStatusFlags = indi->getIndirectStatusFlags(); QString indirectFlagString; QStringList indirectFlagsStringList = generateStatusFlagsStringList(indirectStatusFlags,calcAlgContext); if (!indirectFlagsStringList.isEmpty()) { indirectFlagString = QString("
\nIndirect Flags: %1
\n").arg(indirectFlagsStringList.join(",")); } QString clashedString; CConceptSaturationDescriptor* clashConDesLinker = indi->getClashedConceptSaturationDescriptorLinker(); if (clashConDesLinker) { QString clashedConDesString; for (CConceptSaturationDescriptor* clashConDesLinkerIt = clashConDesLinker; clashConDesLinkerIt; clashConDesLinkerIt = clashConDesLinkerIt->getNext()) { CConcept* concept = clashConDesLinkerIt->getConcept(); cint64 conTag = clashConDesLinkerIt->getConceptTag(); QString conceptString("null"); if (clashConDesLinkerIt) { conceptString = CConceptTextFormater::getConceptString(clashConDesLinkerIt->getConcept(),clashConDesLinkerIt->isNegated()); } if (!clashedConDesString.isEmpty()) { clashedConDesString += QString("
\n"); } clashedConDesString += conceptString; } clashedString += QString("
\nClashed Inserted Concepts: {
\n%1
\n}
\n").arg(clashedConDesString); } indiString += QString("{%1}
\n
\nBackwardlinks %2
\nSuccessorLinks %3
\n%4%5%6%7").arg(conSetString).arg(propString).arg(succString).arg(depIndiString).arg(directFlagString).arg(indirectFlagString).arg(clashedString); indiStringList.append(indiString); } } mDebugIndiModelStringList = indiStringList; mDebugIndiModelString = mDebugIndiModelStringList.join("
\n


\n\r\n"); return mDebugIndiModelString; } QStringList CCalculationTableauApproximationSaturationTaskHandleAlgorithm::generateStatusFlagsStringList(CIndividualSaturationProcessNodeStatusFlags* statusFlags, CCalculationAlgorithmContextBase* calcAlgContext) { QStringList flagsStringList; if (statusFlags->hasClashedFlag()) { flagsStringList += QString("clashed"); } if (statusFlags->hasInsufficientFlag()) { flagsStringList += QString("insufficient"); } if (statusFlags->hasNominalConnectionFlag()) { flagsStringList += QString("nominal connection"); } if (statusFlags->hasCriticalFlag()) { flagsStringList += QString("critical"); } if (statusFlags->hasCardinalityProplematicFlag()) { flagsStringList += QString("cardinality problematic"); } if (statusFlags->hasEQCandidateProplematicFlag()) { flagsStringList += QString("eqCandidate problematic"); } if (statusFlags->hasMissedABoxConsistencyFlag()) { flagsStringList += QString("missed ABox consistency data"); } if (statusFlags->hasInitializedFlag()) { flagsStringList += QString("initialized"); } if (statusFlags->hasCompletedFlag()) { flagsStringList += QString("completed"); } if (statusFlags->hasUnprocessedFlag()) { flagsStringList += QString("unprocessed"); } if (flagsStringList.isEmpty()) { flagsStringList += QString("none"); } return flagsStringList; } QString CCalculationTableauApproximationSaturationTaskHandleAlgorithm::getDebugIndividualConceptName(CIndividualSaturationProcessNode* indi, CCalculationAlgorithmContextBase* calcAlgContext) { CExtendedConceptReferenceLinkingData* extConRefLinkData = indi->getSaturationConceptReferenceLinking(); CSaturationConceptDataItem* conceptSatItem = (CSaturationConceptDataItem*)extConRefLinkData; QString nominalString = QString(""); if (conceptSatItem) { CConcept* initializedConcept = conceptSatItem->getSaturationConcept(); bool initializedNegation = conceptSatItem->getSaturationNegation(); if (initializedConcept->hasClassName() && !initializedNegation) { nominalString = CIRIName::getRecentIRIName(initializedConcept->getClassNameLinker()); } } return nominalString; } QString CCalculationTableauApproximationSaturationTaskHandleAlgorithm::generateDebugIndiModelStringList(CCalculationAlgorithmContextBase* calcAlgContext) { CProcessingDataBox* procDataBox = calcAlgContext->getUsedProcessingDataBox(); CIndividualSaturationProcessNodeVector* indiVec = procDataBox->getIndividualSaturationProcessNodeVector(); cint64 indiCount = indiVec->getItemCount(); QStringList indiStringList; for (cint64 i = 0; i < indiCount; ++i) { CIndividualSaturationProcessNode* indi = indiVec->getData(i); CReapplyConceptSaturationLabelSet* conSet = indi->getReapplyConceptSaturationLabelSet(false); if (conSet) { QString nominalString = QString(""); //if (indi->getNominalIndividual()) { // nominalString = QString(", ")+CIRIName::getRecentIRIName(indi->getNominalIndividual()->getNameLinker()); //} QString indiString = QString("[ %1%2 ] = ").arg(indi->getIndividualID()).arg(nominalString); QString conSetString; CReapplyConceptSaturationLabelSetIterator conSetIt = conSet->getIterator(true,false); while (conSetIt.hasNext()) { CConceptSaturationDescriptor* conDes = conSetIt.getConceptSaturationDescriptor(); CConcept* concept = conDes->getConcept(); cint64 conTag = conDes->getConceptTag(); if (conTag != 1) { QString conString = QString("%1%2").arg((conDes->isNegated())?"-":"").arg(conTag); if (concept->hasClassName()) { conString += CIRIName::getRecentIRIName(concept->getClassNameLinker()); } if (!conSetString.isEmpty()) { conSetString += QString(", "); } conSetString += conString; } conSetIt.moveNext(); } indiString += QString("{%1} ").arg(conSetString); indiStringList.append(indiString); } } mDebugIndiModelStringList = indiStringList; mDebugIndiModelString = mDebugIndiModelStringList.join("\n"); return mDebugIndiModelString; } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::testDebugSaturationTaskContainsConcepts(CIndividualSaturationProcessNode* indiNode, CCalculationAlgorithmContextBase* calcAlgContext) { CReapplyConceptSaturationLabelSet* conSet = indiNode->getReapplyConceptSaturationLabelSet(); if (conSet) { CReapplyConceptSaturationLabelSetIterator it = conSet->getIterator(true,false); while (it.hasNext()) { CConceptSaturationDescriptor* conSatDes = it.getConceptSaturationDescriptor(); if (conSatDes) { CConcept* concept = conSatDes->getConcept(); bool conceptNegation = conSatDes->getNegation(); testDebugSaturationTaskContainsConcept(concept,conceptNegation,indiNode,calcAlgContext); } it.moveNext(); } } } void CCalculationTableauApproximationSaturationTaskHandleAlgorithm::testDebugSaturationTaskContainsConcept(CConcept* concept, bool conNegation, CIndividualSaturationProcessNode* indiNode, CCalculationAlgorithmContextBase* calcAlgContext) { if (mDebugTestingSaturationTask) { cint64 individualID = indiNode->getIndividualID(); CProcessingDataBox* procDataBox = mDebugTestingSaturationTask->getProcessingDataBox(); if (procDataBox) { CIndividualProcessNodeVector* indiVec = procDataBox->getIndividualProcessNodeVector(); CIndividualProcessNode* indiNode = indiVec->getData(individualID); CReapplyConceptLabelSet* conSet = indiNode->getReapplyConceptLabelSet(false); bool contained = conSet->containsConcept(concept,conNegation); if (!contained) { mDebugTestSaturationDebugIndiModelString = generateExtendedDebugIndiModelStringList(calcAlgContext); QFile tmpFile("tmp4.txt"); if (tmpFile.open(QIODevice::WriteOnly)) { tmpFile.write(mDebugTestSaturationDebugIndiModelString.toLocal8Bit()); tmpFile.close(); } bool bug = true; } } } } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualNodeManager.cpp0000644000175000017500000000224412520551006030204 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeManager.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualNodeManager::CIndividualNodeManager() { } CIndividualNodeManager::~CIndividualNodeManager() { } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskPossibleAssertionCollectingAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskPossibleAssertionCol0000644000175000017500000002136312520551014032334 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableTaskPossibleAssertionCollectingAnalyser.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CSatisfiableTaskPossibleAssertionCollectingAnalyser::CSatisfiableTaskPossibleAssertionCollectingAnalyser() { } bool CSatisfiableTaskPossibleAssertionCollectingAnalyser::readCalculationConfig(CCalculationConfigurationExtension *config) { if (config) { return true; } return false; } CIndividualProcessNode* CSatisfiableTaskPossibleAssertionCollectingAnalyser::getCorrectedIndividualNode(cint64 baseIndiID, CIndividualProcessNodeVector* indiNodeVec) { CIndividualProcessNode* indi = indiNodeVec->getData(baseIndiID); while (indi->hasMergedIntoIndividualNodeID()) { indi = indiNodeVec->getData(indi->getMergedIntoIndividualNodeID()); } return indi; } bool CSatisfiableTaskPossibleAssertionCollectingAnalyser::analyseSatisfiableTask(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContext* calcAlgContext) { CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter* possAssCollAdapter = statCalcTask->getPossibleAssertionCollectionAdapter(); if (possAssCollAdapter) { CPossibleAssertionsCollectionSet* possAssCollSet = possAssCollAdapter->getPossibleAssertionsCollectionSet(); CConcreteOntology* ontology = possAssCollAdapter->getTestingOntology(); if (possAssCollSet) { CSatisfiableCalculationTask* cachedDetTask = getCachedDeterministicCompletionGraphTask(calcAlgContext); CIndividualProcessNodeVector* detCachedIndiNodeVec = nullptr; if (cachedDetTask) { detCachedIndiNodeVec = cachedDetTask->getProcessingDataBox()->getIndividualProcessNodeVector(); } CBOXSET* eqNonCanSet = ontology->getTBox()->getEquivalentConceptNonCandidateSet(false); QSet< QPair > possConAssSet; CProcessingDataBox* procDataBox = calcAlgContext->getProcessingDataBox(); CIndividualProcessNodeVector* indiNodeVec = procDataBox->getIndividualProcessNodeVector(); cint64 indiCount = indiNodeVec->getItemCount(); for (cint64 i = 0; i < indiCount; ++i) { CIndividualProcessNode* indiNode = indiNodeVec->getData(i); CIndividualProcessNode* cachedDetIndiNode = nullptr; if (detCachedIndiNodeVec) { cachedDetIndiNode = detCachedIndiNodeVec->getData(i); } if (indiNode && indiNode != cachedDetIndiNode && indiNode->getNominalIndividual()) { if (!cachedDetIndiNode || !indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED) || indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALID | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED)) { CReapplyConceptLabelSet* conLabelSet = indiNode->getReapplyConceptLabelSet(false); if (conLabelSet) { CIndividual* individual = indiNode->getNominalIndividual(); for (CConceptDescriptor* conDesIt = conLabelSet->getAddingSortedConceptDescriptionLinker(); conDesIt; conDesIt = conDesIt->getNext()) { CDependencyTrackPoint* depTrackPoint = conDesIt->getDependencyTrackPoint(); CConcept* concept = conDesIt->getConcept(); bool conNegation = conDesIt->isNegated(); if (!depTrackPoint || depTrackPoint->getBranchingTag() > 0) { if (!conNegation && concept && concept->hasClassName()) { possConAssSet.insert( QPair(individual,concept) ); } } if (concept->getOperatorCode() == CCEQCAND) { CConcept* eqConcept = concept->getOperandList()->getData(); bool negation = false; if (!conLabelSet->containsConcept(eqConcept,negation)) { possConAssSet.insert( QPair(individual,eqConcept) ); } } } if (eqNonCanSet) { for (CBOXSET::const_iterator it = eqNonCanSet->constBegin(), itEnd = eqNonCanSet->constEnd(); it != itEnd; ++it) { CConcept* eqConcept(*it); bool negation = false; if (!conLabelSet->containsConcept(eqConcept,negation)) { possConAssSet.insert( QPair(individual,eqConcept) ); } } } CIndividualMergingHash* indiMergingHash = indiNode->getIndividualMergingHash(false); if (indiMergingHash) { for (CIndividualMergingHash::const_iterator indiIt = indiMergingHash->constBegin(), indiItEnd = indiMergingHash->constEnd(); indiIt != indiItEnd; ++indiIt) { CIndividual* mergedIndividual = indiIt.key(); CDependencyTrackPoint* mergeDepTrackPoint = indiIt.value(); bool nonDetMerged = true; if (mergeDepTrackPoint && mergeDepTrackPoint->getBranchingTag() <= 0) { nonDetMerged = false; } for (CConceptDescriptor* conDesIt = conLabelSet->getAddingSortedConceptDescriptionLinker(); conDesIt; conDesIt = conDesIt->getNext()) { CDependencyTrackPoint* depTrackPoint = conDesIt->getDependencyTrackPoint(); CConcept* concept = conDesIt->getConcept(); bool conNegation = conDesIt->isNegated(); if (nonDetMerged || !depTrackPoint || depTrackPoint->getBranchingTag() > 0) { if (!conNegation && concept && concept->hasClassName()) { possConAssSet.insert( QPair(mergedIndividual,concept) ); } } if (concept->getOperatorCode() == CCEQCAND) { CConcept* eqConcept = concept->getOperandList()->getData(); bool negation = false; if (!conLabelSet->containsConcept(eqConcept,negation)) { possConAssSet.insert( QPair(mergedIndividual,eqConcept) ); } } } if (eqNonCanSet) { for (CBOXSET::const_iterator it = eqNonCanSet->constBegin(), itEnd = eqNonCanSet->constEnd(); it != itEnd; ++it) { CConcept* eqConcept(*it); bool negation = false; if (!conLabelSet->containsConcept(eqConcept,negation)) { possConAssSet.insert( QPair(mergedIndividual,eqConcept) ); } } } } } } } } } if (!possConAssSet.isEmpty()) { possAssCollSet->acquireSynchronisationLock(); for (QSet< QPair >::const_iterator it = possConAssSet.constBegin(), itEnd = possConAssSet.constEnd(); it != itEnd; ++it) { const QPair& indiConPair(*it); possAssCollSet->addPossibleAssertion(indiConPair.first,indiConPair.second); } possAssCollSet->releaseSynchronisationLock(); } } } return false; } CSatisfiableCalculationTask* CSatisfiableTaskPossibleAssertionCollectingAnalyser::getCachedDeterministicCompletionGraphTask(CCalculationAlgorithmContext* calcAlgContext) { CConcreteOntology* consOntology = calcAlgContext->getProcessingDataBox()->getOntology(); if (consOntology) { CConsistence* consistence = consOntology->getConsistence(); if (consistence) { CConsistenceData* consData = consistence->getConsistenceModelData(); if (consData) { CConsistenceTaskData* consTaskData = dynamic_cast(consData); if (consTaskData) { CSatisfiableCalculationTask* compGraphCalcTask = consTaskData->getDeterministicSatisfiableTask(); return compGraphCalcTask; } } } } return nullptr; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationAlgorithmContext.cpp0000644000175000017500000000760512520551002031467 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationAlgorithmContext.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CCalculationAlgorithmContext::CCalculationAlgorithmContext() { mUsedProcessTagger = nullptr; mUsedTempMemMan = nullptr; mUsedPrTaskMemMan = nullptr; mUsedProcessContext = nullptr; mUsedProcessingDataBox = nullptr; mUsedIndividualPriorityStrategy = nullptr; mUsedConceptPriorityStrategy = nullptr; mUsedSatCalcTask = nullptr; mUsedTaskProcessorContext = nullptr; mUsedTaskPriorityStrategy = nullptr; mUsedProcessStatGath = nullptr; mMinModificationAncestorDepth = 0; mMinModificationIndividualID = 0; mMinModificationUpdated = false; mUsedBranchTreeNode = nullptr; mUsedBaseDepNode = nullptr; mUsedUnsatCacheHandler = nullptr; mUsedIndividualNodeManager = nullptr; mUsedClashDescriptorFactory = nullptr; mUsedUnsatCachRetStrategy = nullptr; mMaxCompletionGraphCachedIndiNodeID = -1; mCompletionGraphCachedLocalizationTag = -1; mCurrentIndiNode = nullptr; } CCalculationAlgorithmContext::~CCalculationAlgorithmContext() { } cint64 CCalculationAlgorithmContext::getMaxCompletionGraphCachedIndividualNodeID() { return mMaxCompletionGraphCachedIndiNodeID; } cint64 CCalculationAlgorithmContext::getCompletionGraphCachedLocalizationTag() { return mCompletionGraphCachedLocalizationTag; } bool CCalculationAlgorithmContext::hasCompletionGraphCachedIndividualNodes() { return mMaxCompletionGraphCachedIndiNodeID >= 0; } bool CCalculationAlgorithmContext::isMinModificationUpdated() { return mMinModificationUpdated; } cint64 CCalculationAlgorithmContext::getMinModificationAncestorDepth() { return mMinModificationAncestorDepth; } CCalculationAlgorithmContext* CCalculationAlgorithmContext::setMinModificationAncestorDepth(cint64 ancDepth) { mMinModificationAncestorDepth = ancDepth; mMinModificationUpdated = false; return this; } CCalculationAlgorithmContext* CCalculationAlgorithmContext::setMinModificationIndividualID(cint64 indiID) { mMinModificationIndividualID = indiID; mMinModificationUpdated = false; return this; } cint64 CCalculationAlgorithmContext::getMinModificationIndividualID() { return mMinModificationIndividualID; } CCalculationAlgorithmContext* CCalculationAlgorithmContext::setMinModificationIndividual(CIndividualProcessNode* indiNode) { setMinModificationIndividualID(indiNode->getIndividualID()); setMinModificationAncestorDepth(indiNode->getIndividualAncestorDepth()); return this; } CIndividualProcessNode* CCalculationAlgorithmContext::getCurrentIndividualNode() { return mCurrentIndiNode; } CCalculationAlgorithmContext* CCalculationAlgorithmContext::setCurrentIndividualNode(CIndividualProcessNode* indiNode) { mCurrentIndiNode = indiNode; return this; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeStringValueSpaceHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeStringValueSpa0000644000175000017500000007664512520551010032332 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeStringValueSpaceHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualProcessNodeStringValueSpaceHandler::CIndividualProcessNodeStringValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType) : CIndividualProcessNodeValueSpaceHandler(valueSpaceType) { mStringValueSpaceType = (CDatatypeValueSpaceStringType*)valueSpaceType; } bool CIndividualProcessNodeStringValueSpaceHandler::addDataLiteral(CIndividualProcessNode* indiProcNode, CDataLiteral* dataLiteral, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CDataLiteralValue* dataLitValue = dataLiteral->getDataLiteralValue(); CDataLiteralStringValue* dataLitStringValue = dynamic_cast(dataLitValue); CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeStringValueSpaceData* stringValueSpaceData = datatypesSpaceValue->getStringValueSpace(mStringValueSpaceType,true); bool newValuesPotentiallyExcluded = false; if (!stringValueSpaceData->isValueSpaceClashed() && dataLitStringValue) { CDatatypeStringValueSpaceMap* stringValueSpaceMap = stringValueSpaceData->getValueSpaceMap(true); if (!negated) { newValuesPotentiallyExcluded |= stringValueSpaceMap->restrictToValue(dataLitStringValue,depTrackPoint); } else { newValuesPotentiallyExcluded |= stringValueSpaceMap->excludeValue(dataLitStringValue,depTrackPoint); } } if (newValuesPotentiallyExcluded) { datatypesSpaceValue->setValueSapceModified(stringValueSpaceData); stringValueSpaceData->setValueSpaceInitialisationDependencyTrackPointCandidate(depTrackPoint); } return newValuesPotentiallyExcluded; } bool CIndividualProcessNodeStringValueSpaceHandler::addDataRestriction(CIndividualProcessNode* indiProcNode, CConcept* dataRestricionConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CDatatype* datatype = dataRestricionConcept->getDatatype(); cint64 restrictionCode = dataRestricionConcept->getParameter(); CDataLiteral* dataLiteral = dataRestricionConcept->getDataLiteral(); CDataLiteralValue* restrictionDataLitValue = nullptr; if (dataLiteral) { restrictionDataLitValue = dataLiteral->getDataLiteralValue(); } CDataLiteralStringValue* restrictionDataLitStringValue = nullptr; if (restrictionDataLitValue) { restrictionDataLitStringValue = dynamic_cast(restrictionDataLitValue); } CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeStringValueSpaceData* stringValueSpaceData = datatypesSpaceValue->getStringValueSpace(mStringValueSpaceType,true); if (stringValueSpaceData->isValueSpaceClashed()) { return false; } CDatatypeStringValueSpaceMap* stringValueSpaceMap = stringValueSpaceData->getValueSpaceMap(true); bool newValuesPotentiallyExcluded = false; if (!negated) { if (restrictionCode == CDFC_STRING) { newValuesPotentiallyExcluded |= stringValueSpaceMap->restrictToWithoutLanguageTagsValues(depTrackPoint); } else if (restrictionDataLitStringValue) { if (restrictionCode == CDFC_MIN_EXCLUSIVE) { newValuesPotentiallyExcluded |= stringValueSpaceMap->excludeMinimum(restrictionDataLitStringValue,true,depTrackPoint); } else if (restrictionCode == CDFC_MIN_INCLUSIVE) { newValuesPotentiallyExcluded |= stringValueSpaceMap->excludeMinimum(restrictionDataLitStringValue,false,depTrackPoint); } else if (restrictionCode == CDFC_MAX_INCLUSIVE) { newValuesPotentiallyExcluded |= stringValueSpaceMap->excludeMaximum(restrictionDataLitStringValue,false,depTrackPoint); } else if (restrictionCode == CDFC_MAX_EXCLUSIVE) { newValuesPotentiallyExcluded |= stringValueSpaceMap->excludeMaximum(restrictionDataLitStringValue,true,depTrackPoint); } } } else { if (restrictionCode == CDFC_STRING) { newValuesPotentiallyExcluded |= stringValueSpaceMap->restrictToWithLanguageTagsValues(depTrackPoint); } else if (restrictionDataLitStringValue) { if (restrictionCode == CDFC_MIN_EXCLUSIVE) { newValuesPotentiallyExcluded |= stringValueSpaceMap->excludeMaximum(restrictionDataLitStringValue,false,depTrackPoint); } else if (restrictionCode == CDFC_MIN_INCLUSIVE) { newValuesPotentiallyExcluded |= stringValueSpaceMap->excludeMaximum(restrictionDataLitStringValue,true,depTrackPoint); } else if (restrictionCode == CDFC_MAX_INCLUSIVE) { newValuesPotentiallyExcluded |= stringValueSpaceMap->excludeMinimum(restrictionDataLitStringValue,true,depTrackPoint); } else if (restrictionCode == CDFC_MAX_EXCLUSIVE) { newValuesPotentiallyExcluded |= stringValueSpaceMap->excludeMinimum(restrictionDataLitStringValue,false,depTrackPoint); } } } if (newValuesPotentiallyExcluded) { datatypesSpaceValue->setValueSapceModified(stringValueSpaceData); stringValueSpaceData->setValueSpaceInitialisationDependencyTrackPointCandidate(depTrackPoint); } return newValuesPotentiallyExcluded; } bool CIndividualProcessNodeStringValueSpaceHandler::testValueSpaceClashed(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext) { CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeStringValueSpaceData* stringValueSpaceData = datatypesSpaceValue->getStringValueSpace(mStringValueSpaceType,false); if (stringValueSpaceData) { if (stringValueSpaceData->isValueSpaceClashed()) { return true; } CDatatypeStringValueSpaceMap* stringValueSpaceMap = stringValueSpaceData->getValueSpaceMap(false); if (stringValueSpaceMap) { bool clashed = stringValueSpaceMap->testValueSpaceReturnClashed(); if (clashed) { stringValueSpaceMap->addValueSpaceDependencies(stringValueSpaceData->getClashDependencyTrackPointCollection()); stringValueSpaceData->setValueSpaceClashed(true); return true; } } } return false; } bool CIndividualProcessNodeStringValueSpaceHandler::addValueSpaceDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext) { CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeStringValueSpaceData* stringValueSpaceData = datatypesSpaceValue->getStringValueSpace(mStringValueSpaceType,false); if (stringValueSpaceData) { if (!stringValueSpaceData->isValueSpaceClashed()) { CDatatypeStringValueSpaceMap* stringValueSpaceMap = stringValueSpaceData->getValueSpaceMap(false); if (stringValueSpaceMap) { return stringValueSpaceMap->addValueSpaceDependencies(depCollection); } } else { return stringValueSpaceData->getClashDependencyTrackPointCollection()->addCollectionDependencies(depCollection); } } return false; } bool CIndividualProcessNodeStringValueSpaceHandler::countPossibleValueSpaceValues(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceValuesCounter* valueCounter, CCalculationAlgorithmContext* calcAlgContext) { bool counted = false; CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CDatatypeStringValueSpaceData* stringValueSpaceData = datatypesSpaceValue->getStringValueSpace(mStringValueSpaceType,false); if (stringValueSpaceData) { if (!stringValueSpaceData->isValueSpaceClashed()) { if (!stringValueSpaceData->isValueSpaceCounted() || stringValueSpaceData->isValueSpaceCountingRequired()) { stringValueSpaceData = datatypesSpaceValue->getStringValueSpace(mStringValueSpaceType,true); CDatatypeValueSpaceValuesCounter* valueSpaceValueCounter = stringValueSpaceData->getValuesCounter(); valueSpaceValueCounter->resetValueCounter(); CDatatypeStringValueSpaceMap* stringValueSpaceMap = stringValueSpaceData->getValueSpaceMap(false); if (stringValueSpaceMap) { stringValueSpaceMap->countAllValues(valueSpaceValueCounter); } else { valueSpaceValueCounter->incInfinite(); } stringValueSpaceData->setValueSpaceCounted(true); stringValueSpaceData->setValueSpaceCountingRequired(false); if (valueCounter) { counted = valueCounter->combineWithValueCounter(valueSpaceValueCounter); } } else { CDatatypeValueSpaceValuesCounter* valueSpaceValueCounter = stringValueSpaceData->getValuesCounter(); if (valueCounter) { counted = valueCounter->combineWithValueCounter(valueSpaceValueCounter); } } } } else { if (valueCounter) { counted = valueCounter->incInfinite(); } } return counted; } CConceptDescriptor* CIndividualProcessNodeStringValueSpaceHandler::triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, cint64& remainingRequiredValuesCount, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext) { CConceptDescriptor* conceptTriggerLinker = appendConceptLinker; CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CConcreteOntology* ontology = calcAlgContext->getUsedProcessingDataBox()->getOntology(); bool substractValueSpaceValuesCount = false; CDatatypeStringValueSpaceData* stringValueSpaceData = datatypesSpaceValue->getStringValueSpace(mStringValueSpaceType,false); if (!stringValueSpaceData || (!stringValueSpaceData->isValueSpaceClashed() && !stringValueSpaceData->isValueSpaceTriggeringCompleted())) { stringValueSpaceData = datatypesSpaceValue->getStringValueSpace(mStringValueSpaceType,true); bool valueSpaceTriggeringFinished = false; if (!stringValueSpaceData->isValueSpaceTriggeringStarted()) { stringValueSpaceData->setValueSpaceTriggeringStarted(true); } CDatatypeStringValueSpaceMap* stringValueSpaceMap = stringValueSpaceData->getValueSpaceMap(false); CDatatypeValueSpacesTriggers* valueSpacesTriggers = ontology->getDataBoxes()->getMBox()->getValueSpacesTriggers(false); if (valueSpacesTriggers) { CDatatypeValueSpaceStringTriggers* stringValueSpaceTriggers = valueSpacesTriggers->getStringValueSpaceTriggers(); CDatatypeValueSpaceTriggeringMap* stringValueSpaceTriggerMap = stringValueSpaceTriggers->getValueSpaceTriggeringMap(); depCollection->addDependency(stringValueSpaceData->getValueSpaceInitialisationDependencyTrackPoint()); CDatatypeValueSpaceConceptTriggeringData* valueSpaceConceptTriggeringData = stringValueSpaceTriggers->getStringConceptTriggeringData(); if (valueSpaceConceptTriggeringData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,valueSpaceConceptTriggeringData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } if (stringValueSpaceMap) { CDataLiteralStringValue* minValue = nullptr; bool minValueInclusive = false; CDependencyTrackPoint* minValueDepTrackPoint = nullptr; if (stringValueSpaceMap->getAbsoluteMinimumValue(minValue,minValueInclusive,&minValueDepTrackPoint)) { CDatatypeDependencyCollection minValueDepCollection(depCollection,calcAlgContext); bool minDatatypeDepAdded = false; CDatatypeValueSpaceTriggeringIterator leftTriggerIt = stringValueSpaceTriggerMap->getLeftTriggeringIterator(minValue,!minValueInclusive); while (leftTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = leftTriggerIt.next(); CDatatypeValueSpaceConceptTriggeringData* minExcTriggeringConceptData = triggeringData->getMinExclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* minIncTriggeringConceptData = triggeringData->getMinInclusiveTriggeringData(); if (minExcTriggeringConceptData->hasPartialConceptTriggers() || minIncTriggeringConceptData->hasPartialConceptTriggers()) { if (!minDatatypeDepAdded && minValueDepTrackPoint) { minDatatypeDepAdded = true; minValueDepCollection.addDependency(minValueDepTrackPoint); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minExcTriggeringConceptData->getPartialConceptTriggerLinker(),&minValueDepCollection,calcAlgContext); conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minIncTriggeringConceptData->getPartialConceptTriggerLinker(),&minValueDepCollection,calcAlgContext); } } CDatatypeValueSpaceTriggeringData* minValueTriggerData = stringValueSpaceTriggerMap->getDatatypeValueTriggeringData(minValue,false); if (minValueTriggerData) { CDatatypeValueSpaceConceptTriggeringData* minTriggeringConceptData = nullptr; if (!minValueInclusive) { minTriggeringConceptData = minValueTriggerData->getMinExclusiveTriggeringData(); } else { minTriggeringConceptData = minValueTriggerData->getMinInclusiveTriggeringData(); } if (minTriggeringConceptData->hasPartialConceptTriggers()) { if (!minDatatypeDepAdded && minValueDepTrackPoint) { minDatatypeDepAdded = true; minValueDepCollection.addDependency(minValueDepTrackPoint); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minTriggeringConceptData->getPartialConceptTriggerLinker(),&minValueDepCollection,calcAlgContext); } } } CDataLiteralStringValue* maxValue = nullptr; bool maxValueInclusive = false; CDependencyTrackPoint* maxValueDepTrackPoint = nullptr; if (stringValueSpaceMap->getAbsoluteMaximumValue(maxValue,maxValueInclusive,&maxValueDepTrackPoint)) { CDatatypeDependencyCollection maxValueDepCollection(depCollection,calcAlgContext); bool maxDatatypeDepAdded = false; CDatatypeValueSpaceTriggeringIterator rightTriggerIt = stringValueSpaceTriggerMap->getRightTriggeringIterator(maxValue,!maxValueInclusive); while (rightTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = rightTriggerIt.next(); CDatatypeValueSpaceConceptTriggeringData* maxExcTriggeringConceptData = triggeringData->getMaxExclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* maxIncTriggeringConceptData = triggeringData->getMaxInclusiveTriggeringData(); if (maxExcTriggeringConceptData->hasPartialConceptTriggers() || maxIncTriggeringConceptData->hasPartialConceptTriggers()) { if (!maxDatatypeDepAdded && maxValueDepTrackPoint) { maxDatatypeDepAdded = true; maxValueDepCollection.addDependency(minValueDepTrackPoint); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxExcTriggeringConceptData->getPartialConceptTriggerLinker(),&maxValueDepCollection,calcAlgContext); conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxIncTriggeringConceptData->getPartialConceptTriggerLinker(),&maxValueDepCollection,calcAlgContext); } } CDatatypeValueSpaceTriggeringData* maxValueTriggerData = stringValueSpaceTriggerMap->getDatatypeValueTriggeringData(maxValue,false); if (maxValueTriggerData) { CDatatypeValueSpaceConceptTriggeringData* maxTriggeringConceptData = nullptr; if (!maxValueInclusive) { maxTriggeringConceptData = maxValueTriggerData->getMaxExclusiveTriggeringData(); } else { maxTriggeringConceptData = maxValueTriggerData->getMaxInclusiveTriggeringData(); } if (maxTriggeringConceptData->hasPartialConceptTriggers()) { if (!maxDatatypeDepAdded && maxValueDepTrackPoint) { maxDatatypeDepAdded = true; maxValueDepCollection.addDependency(maxValueDepTrackPoint); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxTriggeringConceptData->getPartialConceptTriggerLinker(),&maxValueDepCollection,calcAlgContext); } } } if (minValue && maxValue) { CDatatypeValueSpaceStringValuesCounter valueCounter; CDataLiteralCompareValue* freeLeftValue = nullptr; CDataLiteralCompareValue* freeRightValue = nullptr; bool freeLeftValueInclusive = false; bool freeRightValueInclusive = false; if (stringValueSpaceTriggerMap->getIntervalMinMaxTriggerFreeInterval(minValue,minValueInclusive,maxValue,maxValueInclusive,freeLeftValue,freeLeftValueInclusive,freeRightValue,freeRightValueInclusive)) { CDataLiteralStringValue* freeLeftStringValue = dynamic_cast(freeLeftValue); CDataLiteralStringValue* freeRightStringValue = dynamic_cast(freeRightValue); if (freeLeftStringValue && freeRightStringValue) { CDatatypeValueSpaceStringValuesCounter tmpValueCounter; if (stringValueSpaceMap->countIntervalValues(freeLeftStringValue,freeLeftValueInclusive,freeRightStringValue,freeRightValueInclusive,&tmpValueCounter)) { cint64 triggerValueCount = 0; if (stringValueSpaceTriggerMap->countIntervalValueTriggers(minValue,minValueInclusive,maxValue,maxValueInclusive,triggerValueCount)) { valueCounter.combineWithValueCounter(&tmpValueCounter,triggerValueCount); } } } } if (!valueCounter.hasValueAchieved(remainingRequiredValuesCount)) { bool minToMaxTriggerDirection = true; cint64 minTriggerCount = 0; cint64 maxTriggerCount = 0; cint64 valueTriggerCount = 0; stringValueSpaceTriggerMap->countIntervalMinMaxValueTriggers(minValue,minValueInclusive,maxValue,maxValueInclusive,minTriggerCount,maxTriggerCount,valueTriggerCount); if (minTriggerCount < maxTriggerCount) { minToMaxTriggerDirection = false; } depCollection->addDependency(minValueDepTrackPoint); depCollection->addDependency(maxValueDepTrackPoint); CDatatypeValueSpaceTriggeringIterator triggerIt = stringValueSpaceTriggerMap->getIntervalTriggeringIterator(minValue,minValueInclusive,maxValue,maxValueInclusive,minToMaxTriggerDirection); if (minTriggerCount > 0 && maxTriggerCount > 0) { CDatatypeValueSpaceTriggeringIterator minMaxDirectionTriggerIt = triggerIt; while (minMaxDirectionTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = minMaxDirectionTriggerIt.next(); if (minToMaxTriggerDirection) { CDatatypeValueSpaceConceptTriggeringData* maxExcTriggeringConceptData = triggeringData->getMaxExclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* maxIncTriggeringConceptData = triggeringData->getMaxInclusiveTriggeringData(); if (maxExcTriggeringConceptData->hasPartialConceptTriggers() || maxIncTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxExcTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxIncTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } else { CDatatypeValueSpaceConceptTriggeringData* minExcTriggeringConceptData = triggeringData->getMinExclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* minIncTriggeringConceptData = triggeringData->getMinInclusiveTriggeringData(); if (minExcTriggeringConceptData->hasPartialConceptTriggers() || minIncTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minExcTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minIncTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } } } if (!minValue->isEqualTo(maxValue)) { CDataLiteralStringValue* lastStringValue = nullptr; if (minToMaxTriggerDirection) { lastStringValue = minValue; } else { lastStringValue = maxValue; } CDatatypeValueSpaceTriggeringIterator stepMinMaxDirectionTriggerIt = triggerIt; while (!valueCounter.hasValueAchieved(remainingRequiredValuesCount) && stepMinMaxDirectionTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = stepMinMaxDirectionTriggerIt.next(); CDataLiteralCompareValue* currentValue = triggeringData->getValue(); CDataLiteralStringValue* currentStringValue = dynamic_cast(currentValue); if (lastStringValue && !lastStringValue->isEqualTo(currentStringValue)) { if (minToMaxTriggerDirection) { stringValueSpaceMap->countIntervalValues(lastStringValue,false,currentStringValue,false,&valueCounter); stringValueSpaceMap->addIntervalExclusionDependencies(lastStringValue,false,currentStringValue,false,depCollection); } else { stringValueSpaceMap->countIntervalValues(currentStringValue,false,lastStringValue,false,&valueCounter); stringValueSpaceMap->addIntervalExclusionDependencies(currentStringValue,false,lastStringValue,false,depCollection); } } if (minToMaxTriggerDirection) { CDatatypeValueSpaceConceptTriggeringData* minExcTriggeringConceptData = triggeringData->getMinExclusiveTriggeringData(); if (minExcTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minExcTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } else { CDatatypeValueSpaceConceptTriggeringData* maxExcTriggeringConceptData = triggeringData->getMaxExclusiveTriggeringData(); if (maxExcTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxExcTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } if (!triggeringData->getDirectValueTriggeringData()->hasPartialConceptTriggers()) { stringValueSpaceMap->countValueValues(currentStringValue,&valueCounter); stringValueSpaceMap->addValueExclusionDependencies(currentStringValue,depCollection); } if (!valueCounter.hasValueAchieved(remainingRequiredValuesCount)) { if (minToMaxTriggerDirection) { CDatatypeValueSpaceConceptTriggeringData* minIncTriggeringConceptData = triggeringData->getMinInclusiveTriggeringData(); if (minIncTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,minIncTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } else { CDatatypeValueSpaceConceptTriggeringData* maxIncTriggeringConceptData = triggeringData->getMaxInclusiveTriggeringData(); if (maxIncTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,maxIncTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } } } } CDatatypeValueSpaceTriggeringIterator valueDirectionTriggerIt = triggerIt; while (!valueCounter.hasValueAchieved(remainingRequiredValuesCount) && valueDirectionTriggerIt.hasNext()) { CDatatypeValueSpaceTriggeringData* triggeringData = valueDirectionTriggerIt.next(); CDataLiteralCompareValue* currentValue = triggeringData->getValue(); CDataLiteralStringValue* currentStringValue = dynamic_cast(currentValue); if (triggeringData->getDirectValueTriggeringData()->hasPartialConceptTriggers()) { stringValueSpaceMap->addValueExclusionDependencies(currentStringValue,depCollection); if (!stringValueSpaceMap->isValueExcluded(currentStringValue,nullptr)) { stringValueSpaceMap->countValueValues(currentStringValue,&valueCounter); CDatatypeValueSpaceConceptTriggeringData* directValueTriggeringConceptData = triggeringData->getDirectValueTriggeringData(); if (directValueTriggeringConceptData->hasPartialConceptTriggers()) { conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,directValueTriggeringConceptData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } } } } if (!valueCounter.hasValueAchieved(CDatatypeValueSpaceStringValuesCounter::SVT_WITH_LANGUAG_TAG_COUNT,remainingRequiredValuesCount)) { // trigger non-language stings CDatatypeValueSpaceConceptTriggeringData* conceptTriggeringData = stringValueSpaceTriggers->getNonLanguageTagConceptTriggeringData(); if (conceptTriggeringData->hasPartialConceptTriggers()) { if (depCollection && !depCollection->hasDependencies()) { stringValueSpaceMap->addValueSpaceDependencies(depCollection); } conceptTriggerLinker = addConceptLinkerCollectionDependency(indiProcNode,conceptTriggerLinker,conceptTriggeringData->getPartialConceptTriggerLinker(),depCollection,calcAlgContext); } } remainingRequiredValuesCount -= valueCounter.getValueCount(); if (valueCounter.isInfinite()) { remainingRequiredValuesCount = 0; } if (remainingRequiredValuesCount < 0) { remainingRequiredValuesCount = 0; } if (remainingRequiredValuesCount > 0) { valueSpaceTriggeringFinished = true; } } } else { remainingRequiredValuesCount = 0; } } else { valueSpaceTriggeringFinished = true; substractValueSpaceValuesCount = true; } if (valueSpaceTriggeringFinished) { if (!stringValueSpaceData->isValueSpaceTriggeringCompleted()) { stringValueSpaceData->setValueSpaceTriggeringCompleted(true); } } } else { substractValueSpaceValuesCount = true; } if (substractValueSpaceValuesCount) { CDatatypeValueSpaceValuesCounter valueCounter; countPossibleValueSpaceValues(indiProcNode,&valueCounter,calcAlgContext); if (valueCounter.isInfinite()) { remainingRequiredValuesCount = 0; } else { remainingRequiredValuesCount -= valueCounter.getValueCount(); if (remainingRequiredValuesCount <= 0) { remainingRequiredValuesCount = 0; } else { addValueSpaceDependencies(indiProcNode,depCollection,calcAlgContext); } } } return conceptTriggerLinker; } bool CIndividualProcessNodeStringValueSpaceHandler::getNextPossibleDataValue(CIndividualProcessNode* indiProcNode, CDataLiteralValue*& nextValue, CDataLiteralValue* lastValue, CDatatypeValueTestingCollection* valueTestingCollection, CCalculationAlgorithmContext* calcAlgContext) { CDataLiteralStringValue* lastStringValue = nullptr; if (lastValue) { lastStringValue = dynamic_cast(lastValue); } CDatatypesValueSpaceData* datatypesSpaceValue = indiProcNode->getDatatypesValueSpaceData(true); CConcreteOntology* ontology = calcAlgContext->getUsedProcessingDataBox()->getOntology(); CDatatypeStringValueSpaceData* stringValueSpaceData = datatypesSpaceValue->getStringValueSpace(mStringValueSpaceType,true); if (stringValueSpaceData && !stringValueSpaceData->isValueSpaceClashed()) { CDataLiteralValue* tmpNextValue = valueTestingCollection->createDataLiteralValue(mStringValueSpaceType); CDataLiteralStringValue* nextStringValue = dynamic_cast(tmpNextValue); CDataLiteralValue* tmpLastValue = nullptr; CDataLiteralStringValue* tmpLastStringValue = nullptr; if (lastStringValue) { tmpLastValue = valueTestingCollection->createDataLiteralValue(mStringValueSpaceType); tmpLastStringValue = dynamic_cast(tmpLastValue); tmpLastStringValue->initValue(lastStringValue); } CDatatypeStringValueSpaceMap* stringValueSpaceMap = stringValueSpaceData->getValueSpaceMap(true); bool searchNextValue = true; while (searchNextValue) { if (stringValueSpaceMap->getNextPossibleDataValue(nextStringValue,tmpLastStringValue)) { if (!valueTestingCollection->isDataLiteralValueUsed(tmpNextValue,mStringValueSpaceType)) { valueTestingCollection->releaseDataLiteralValue(tmpLastValue,mStringValueSpaceType); nextValue = tmpNextValue; return true; } } else { searchNextValue = false; } if (!tmpLastStringValue) { tmpLastValue = valueTestingCollection->createDataLiteralValue(mStringValueSpaceType); tmpLastStringValue = dynamic_cast(tmpLastValue); tmpLastStringValue->initValue(nextStringValue); } else { tmpLastStringValue->initValue(nextStringValue); } } if (!searchNextValue) { valueTestingCollection->releaseDataLiteralValue(tmpNextValue,mStringValueSpaceType); valueTestingCollection->releaseDataLiteralValue(tmpLastValue,mStringValueSpaceType); } } return false; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CDatatypeDependencyCollection.cpp0000644000175000017500000001124312520551004031576 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeDependencyCollection.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CDatatypeDependencyCollection::CDatatypeDependencyCollection(CCalculationAlgorithmContext* collectionCalcAlgContext) { mCollectionCalcAlgContext = collectionCalcAlgContext; mCollectedFirstDependency = nullptr; mCollectedAdditionalDependencies = nullptr; mCollectionDatatypeDepCreated = false; mCollectionDataTriggerDepTrackPoint = nullptr; mDepTrackPointSet = CObjectParameterizingAllocator< CPROCESSINGSET, CContext* >::allocateAndConstructAndParameterize(mCollectionCalcAlgContext->getUsedTemporaryMemoryAllocationManager(),mCollectionCalcAlgContext->getTaskProcessorContext()); mTestDepTrackPointSet = mDepTrackPointSet; } CDatatypeDependencyCollection::CDatatypeDependencyCollection(CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* collectionCalcAlgContext) { mCollectionCalcAlgContext = collectionCalcAlgContext; mCollectedFirstDependency = depCollection->mCollectedFirstDependency; mCollectedAdditionalDependencies = depCollection->mCollectedAdditionalDependencies; mCollectionDatatypeDepCreated = depCollection->mCollectionDatatypeDepCreated; mCollectionDataTriggerDepTrackPoint = depCollection->mCollectionDataTriggerDepTrackPoint; mDepTrackPointSet = nullptr; mTestDepTrackPointSet = depCollection->mTestDepTrackPointSet; } bool CDatatypeDependencyCollection::hasDependencies() { return mCollectedFirstDependency != nullptr; } bool CDatatypeDependencyCollection::addDependency(CDependencyTrackPoint* depTrackPoint) { if (depTrackPoint && mCollectionCalcAlgContext) { if (!mTestDepTrackPointSet || !mTestDepTrackPointSet->contains(depTrackPoint)) { if (mDepTrackPointSet) { mDepTrackPointSet->insert(depTrackPoint); } mCollectionDatatypeDepCreated = false; CDATATYPECONNECTIONDependencyNode* connDep = createDATATYPECONNECTIONDependency(depTrackPoint, mCollectionCalcAlgContext); if (connDep) { if (!mCollectedFirstDependency) { mCollectedFirstDependency = connDep; } else { mCollectedAdditionalDependencies = connDep->append(mCollectedAdditionalDependencies); } } return true; } } return false; } CDependencyTrackPoint* CDatatypeDependencyCollection::getDatatypeTriggerDependencyTrackPoint(bool create) { if (!mCollectionDatatypeDepCreated || mCollectedFirstDependency) { mCollectionDatatypeDepCreated = true; createDATATYPETRIGGERDependency(mCollectionDataTriggerDepTrackPoint,mCollectedFirstDependency,mCollectedAdditionalDependencies,mCollectionCalcAlgContext); } return mCollectionDataTriggerDepTrackPoint; } CDATATYPETRIGGERDependencyNode* CDatatypeDependencyCollection::createDATATYPETRIGGERDependency(CDependencyTrackPoint*& expContinueDepTrackPoint, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext) { CDATATYPETRIGGERDependencyNode* depNode = nullptr; depNode = calcAlgContext->getUsedDependencyFactory()->createDATATYPETRIGGERDependency(expContinueDepTrackPoint,prevDepTrackPoint,prevOtherDependencies,calcAlgContext); return depNode; } CDATATYPECONNECTIONDependencyNode* CDatatypeDependencyCollection::createDATATYPECONNECTIONDependency(CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CDATATYPECONNECTIONDependencyNode* depNode = nullptr; depNode = calcAlgContext->getUsedDependencyFactory()->createDATATYPECONNECTIONDependency(prevDepTrackPoint,calcAlgContext); return depNode; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CReuseCompletionGraphCacheHandler.h0000644000175000017500000000665712520551012032012 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CREUSECOMPLETIONGRAPHCACHEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CREUSECOMPLETIONGRAPHCACHEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Cache/CReuseCompletionGraphCacheReader.h" #include "Reasoner/Kernel/Cache/CReuseCompletionGraphCacheWriter.h" #include "Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntry.h" #include "Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryWriteData.h" #include "Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryExpandWriteData.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Cache; namespace Algorithm { /*! * * \class CReuseCompletionGraphCacheHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReuseCompletionGraphCacheHandler { // public methods public: //! Constructor CReuseCompletionGraphCacheHandler(CReuseCompletionGraphCacheReader* reuseCompGraphCacheReader, CReuseCompletionGraphCacheWriter* reuseCompGraphCacheWriter); //! Destructor virtual ~CReuseCompletionGraphCacheHandler(); CReuseCompletionGraphCacheEntry* getReuseCompletionGraphEntry(CIndividualProcessNode* indiProcNode, bool* minimalCompletionGraph, bool* deterministicConnection, CCalculationAlgorithmContext* calcAlgContext); bool commitCacheMessages(CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: bool prepareCacheMessages(CCalculationAlgorithmContext* calcAlgContext); bool addCacheMessages(CReuseCompletionGraphCacheEntryWriteData* expandWriteData, CCalculationAlgorithmContext* calcAlgContext); // protected variables protected: CReuseCompletionGraphCacheReader* mReuseCompGraphCacheReader; CReuseCompletionGraphCacheWriter* mReuseCompGraphCacheWriter; CReuseCompletionGraphCacheEntryWriteData* mWriteData; CTaskMemoryPoolAllocationManager* mMemAllocMan; CMemoryPoolContainer mMemPoolCon; CContextBase* mTmpContext; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CREUSECOMPLETIONGRAPHCACHEHANDLER_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeXMLValueSpaceHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeXMLValueSpaceH0000644000175000017500000000463012520551012032127 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEXMLVALUESPACEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEXMLVALUESPACEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CIndividualProcessNodeCompareValueSpaceHandler.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CIndividualProcessNodeXMLValueSpaceHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeXMLValueSpaceHandler : public CIndividualProcessNodeCompareValueSpaceHandler { // public methods public: //! Constructor CIndividualProcessNodeXMLValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEXMLVALUESPACEHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CDatatypeValueTestingCollection.h0000644000175000017500000000614112520551004031600 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CDatatypeValueTestingCollection_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CDatatypeValueTestingCollection_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" // Other includes #include "Context/CContextBase.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; using namespace Utilities::Container; namespace Reasoner { namespace Kernel { namespace Algorithm { /*! * * \class CDatatypeValueTestingCollection * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueTestingCollection { // public methods public: //! Constructor CDatatypeValueTestingCollection(CCalculationAlgorithmContext* collectionCalcAlgContext); CDatatypeValueTestingCollection* addDataLiteralValueUse(CDataLiteralValue* dataLiteralValue, CDatatypeValueSpaceType* valueSpaceType); bool isDataLiteralValueUsed(CDataLiteralValue* dataLiteralValue, CDatatypeValueSpaceType* valueSpaceType); CDatatypeValueTestingCollection* releaseUsedDataLiteralValues(); CDataLiteralValue* createDataLiteralValue(CDatatypeValueSpaceType* valueSpaceType); CDatatypeValueTestingCollection* releaseDataLiteralValue(CDataLiteralValue* dataLiteralValue, CDatatypeValueSpaceType* valueSpaceType); // protected methods protected: CXLinker* createFreeLinker(); CDatatypeValueTestingCollection* releaseFreeLinker(CXLinker* linker); // protected variables protected: CCalculationAlgorithmContext* mCollectionCalcAlgContext; CXLinker* mFreeLinker; CXLinker* mFreeDataLiteralValueVec[CDatatypeValueSpaceType::VALUESPACETYPECOUNT]; CXLinker* mUseDataLiteralValueVec[CDatatypeValueSpaceType::VALUESPACETYPECOUNT]; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CDatatypeValueTestingCollection_H ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBooleanValueSpaceHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBooleanValueSp0000644000175000017500000000242512520551006032270 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeBooleanValueSpaceHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualProcessNodeBooleanValueSpaceHandler::CIndividualProcessNodeBooleanValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType) : CIndividualProcessNodeCompareValueSpaceHandler(valueSpaceType) { } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationTableauApproximationSaturationTaskHandleAlgorithm.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationTableauApproximationSatu0000644000175000017500000012064212520756374032420 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONTABLEAUAPPROXIMATIONSATURATIONTASKHANDLEALGORITHM_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONTABLEAUAPPROXIMATIONSATURATIONTASKHANDLEALGORITHM_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContextBase.h" #include "CCalculationStopProcessingException.h" #include "CCalculationErrorProcessingException.h" #include "CSatisfiableTaskSaturationPreyingAnalyser.h" #include "CSatisfiableTaskSaturationIndividualsAnalyser.h" #include "CSaturationNodeBackendAssociationCacheHandler.h" // Other includes #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" #include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h" #include "Reasoner/Kernel/Process/CConceptSaturationProcessLinker.h" #include "Reasoner/Kernel/Process/CIndividualSaturationProcessNodeStatusUpdateLinker.h" #include "Scheduler/CTask.h" #include "Scheduler/CTaskHandleAlgorithm.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptTextFormater.h" #include "Reasoner/Ontology/CRoleProcessData.h" #include "Reasoner/Ontology/CConceptNegationPair.h" #include "Reasoner/Ontology/CIndividualProcessData.h" #include "Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h" #include "Reasoner/Consistiser/CSaturationConceptDataItem.h" #include "Utilities/Memory/CObjectMemoryPoolAllocator.h" #include "Utilities/Memory/CMemoryAllocationException.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; using namespace Utilities::Memory; namespace Reasoner { using namespace Consistiser; namespace Kernel { using namespace Process; using namespace Task; namespace Algorithm { #ifdef KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED #define KONCLUCE_TASK_ALGORITHM_SATURATION_SATURATION_MODEL_STRING_INSTRUCTION(a) #else //#define KONCLUCE_TASK_ALGORITHM_SATURATION_SATURATION_MODEL_STRING_INSTRUCTION(a) a #define KONCLUCE_TASK_ALGORITHM_SATURATION_SATURATION_MODEL_STRING_INSTRUCTION(a) #endif /*! * * \class CCalculationTableauApproximationSaturationTaskHandleAlgorithm * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationTableauApproximationSaturationTaskHandleAlgorithm : public CTaskHandleAlgorithm { // public methods public: //! Constructor CCalculationTableauApproximationSaturationTaskHandleAlgorithm(CSaturationNodeBackendAssociationCacheHandler* backendAssCaceHandler); //! Destructor virtual ~CCalculationTableauApproximationSaturationTaskHandleAlgorithm(); virtual bool handleTask(CTaskProcessorContext *processorContext, CTask* task); void readCalculationConfig(CSatisfiableCalculationTask* satCalcTask); cint64 getAppliedANDRuleCount(); cint64 getAppliedORRuleCount(); cint64 getAppliedSOMERuleCount(); cint64 getAppliedATLEASTRuleCount(); cint64 getAppliedALLRuleCount(); cint64 getAppliedATMOSTRuleCount(); cint64 getAppliedTotalRuleCount(); // protected methods protected: CCalculationAlgorithmContextBase* createCalculationAlgorithmContext(CTaskProcessorContext *processorContext, CProcessContext* processContext, CSatisfiableCalculationTask* satCalcTask); bool hasRemainingProcessingNodes(CProcessingDataBox* processingDataBox, CCalculationAlgorithmContextBase* calcAlgContext); bool hasRemainingExtensionProcessingNodes(CProcessingDataBox* processingDataBox, CCalculationAlgorithmContextBase* calcAlgContext); bool completeSaturatedIndividualNodes(CProcessingDataBox* processingDataBox, CCalculationAlgorithmContextBase* calcAlgContext); bool continueNominalDelayedIndividualNodeProcessing(CProcessingDataBox* processingDataBox, CCalculationAlgorithmContextBase* calcAlgContext); void testInsufficientALLConcepts(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void testRelevantConceptRoleRatio(CCalculationAlgorithmContextBase* calcAlgContext); void writeIndividualSaturationStatistics(CCalculationAlgorithmContextBase* calcAlgContext); void testInsufficientIndividuls(CCalculationAlgorithmContextBase* calcAlgContext); void tryAssociateIndividualNodesWithBackendCache(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContextBase* calcAlgContext); bool individualNodeInitializing(CIndividualSaturationProcessNode*& indiProcNode, CCalculationAlgorithmContextBase* calcAlgContext); void individualNodeConclusion(CIndividualSaturationProcessNode*& indiProcNode, CCalculationAlgorithmContextBase* calcAlgContext); bool countConceptsOfReferredNodes(CConcept* concept, bool negation, cint64 depth, cint64& manyConceptRefIndiNodeCount, cint64& totalRefConceptCount, cint64& unprocessedRefCount, CCalculationAlgorithmContextBase* calcAlgContext); bool isProcessingCritical(CIndividualSaturationProcessNode* indiProcSatNode, CSaturationConceptDataItem* conceptSatItem, CIndividualSaturationProcessNode* specRefIndiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualSaturationProcessNode* resolveSpecialInitializationIndividualNode(CIndividualSaturationProcessNode* indiProcSatNode, CSaturationConceptDataItem* conceptSatItem, CIndividualSaturationProcessNode* specRefIndiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void initializeInitializationConcepts(CIndividualSaturationProcessNode*& indiProcNode, CCalculationAlgorithmContextBase* calcAlgContext); void initializeRoleAssertions(CIndividualSaturationProcessNode*& indiProcNode, CCalculationAlgorithmContextBase* calcAlgContext); void createRoleAssertionLink(CIndividualSaturationProcessNode*& sourceNode, CIndividualSaturationProcessNode*& destinationNode, CRole* role, bool roleInversed, CCalculationAlgorithmContextBase* calcAlgContext); void applyTableauSaturationRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyAutomatChooseRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyNONERule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyDATATYPERule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyNotDATATYPERule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyANDRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyORRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applySOMERule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applySELFRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyALLRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyATMOSTRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyATLEASTRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyIMPLICATIONRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyEQCANDRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyBOTTOMRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyVALUERule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyNOMINALRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyDATALITERALRule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void createSuccessorForConcept(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker, cint64 cardinality, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualProcessNode* getCorrectedNode(cint64 individualID, CIndividualProcessNodeVector* indiVec, CCalculationAlgorithmContextBase* calcAlgContext); void addNominalDependentIndividualNode(cint64 nominalID, CIndividualSaturationProcessNode* dependentIndiNode, CSaturationNominalDependentNodeData::NOMINALCONNECTIONTYPE connectionType, CCalculationAlgorithmContextBase* calcAlgContext); void addInfluencedNominal(cint64 influencedNominalID, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualSaturationProcessNode* getIndividualNodeForConcept(CConcept* concept, bool negated, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualSaturationProcessNode* getIndividualNodeForIndividual(CIndividualSaturationProcessNode* indiProcSatNode, CIndividual* individual, cint64 saturationID, CCalculationAlgorithmContextBase* calcAlgContext); cint64 getSaturationIDForIndividualNode(CIndividual* individual, CCalculationAlgorithmContextBase* calcAlgContext); void delayNominalSaturationConceptProcessing(CIndividualSaturationProcessNode* processIndi, CConceptSaturationProcessLinker* conProLinker, cint64 nominalID, CCalculationAlgorithmContextBase* calcAlgContext); void propagateUnloadedABoxCompletionGraphDependentIndividualNodeFlag(CIndividualSaturationProcessNode* processIndi, CConceptSaturationProcessLinker* conProLinker, cint64 nominalID, CCalculationAlgorithmContextBase* calcAlgContext); void addAutomateTransitionOperands(CIndividualSaturationProcessNode*& processIndi, CConcept* automatConcept, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); bool testAutomateTransitionOperandsAddable(CIndividualSaturationProcessNode*& processIndi, CConcept* automatConcept, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); void applyELSERule(CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); void applyBackwardPropagationConcepts(CIndividualSaturationProcessNode* sourceIndi, CBackwardSaturationPropagationReapplyDescriptor* backPropReapplyDesIt, CCalculationAlgorithmContextBase* calcAlgContext); void addIndividualToProcessingQueue(CIndividualSaturationProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void addUninitializedIndividualToProcessingQueue(CIndividualSaturationProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void addIndividualToCompletionQueue(CIndividualSaturationProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void setDelayedNominalProcessingOccured(CCalculationAlgorithmContextBase* calcAlgContext); void setInsufficientNodeOccured(CCalculationAlgorithmContextBase* calcAlgContext); void setProblematicEQCandidateOccured(CCalculationAlgorithmContextBase* calcAlgContext); void collectLinkedSuccessorNodes(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void addLinkedSuccessorNodeForConcept(CConceptSaturationDescriptor* conDes, CLinkedRoleSaturationSuccessorHash* linkedRoleSuccHash, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void addLinkedSuccessorNodeForRoleAssertion(CIndividualSaturationProcessNode* destNode, CRole* role, bool roleInversion, CLinkedRoleSaturationSuccessorHash* linkedRoleSuccHash, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); CSaturationSuccessorExtensionData* getSucessorExtensionData(CLinkedRoleSaturationSuccessorData* succData, bool create, CCalculationAlgorithmContextBase* calcAlgContext); void initializeSuccessorALLConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void updateSuccessorRoleALLConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CLinkedRoleSaturationSuccessorData* succData, const CRoleBackwardSaturationPropagationHashData& backwardPropData, CCalculationAlgorithmContextBase* calcAlgContext); void updateSuccessorRoleALLConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); bool updateSuccessorALLConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); bool addSuccessorExtensionsALLConcept(CIndividualSaturationProcessNode*& indiProcSatNode, CConcept* concept, bool conceptNegation, CSaturationSuccessorALLConceptExtensionData* allConSuccExtData, CCalculationAlgorithmContextBase* calcAlgContext); bool processSuccessorALLConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void addALLProcessRoleExtensionToDependentIndividuals(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); void addProcessExtensionToDependentIndividuals(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void addFUNCTIONALProcessRoleExtensionFunctionalityAddedToDependentIndividuals(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); void addFUNCTIONALProcessRoleExtensionLinkedSuccessorAddedToDependentIndividuals(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); void addFUNCTIONALProcessRoleExtensionLinkedPredecessorAddedToDependentIndividuals(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); void addFUNCTIONALQualifiedProcessAtmostConceptExtensionToDependentIndividuals(CIndividualSaturationProcessNode*& indiProcSatNode, CConceptSaturationDescriptor* conDes, CCalculationAlgorithmContextBase* calcAlgContext); bool processSuccessorFUNCTIONALConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); bool updateSuccessorRoleFUNCTIONALConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); bool updateSuccessorRoleFUNCTIONALConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CLinkedRoleSaturationSuccessorData* succData, CCalculationAlgorithmContextBase* calcAlgContext); bool updateSuccessorRoleQualifiedFUNCTIONALConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CSortedNegLinker* qualifiyConLinker, CCalculationAlgorithmContextBase* calcAlgContext); bool updateSuccessorRoleQualifiedFUNCTIONALConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CSortedNegLinker* qualifiyConLinker, CLinkedRoleSaturationSuccessorData* succData, CCalculationAlgorithmContextBase* calcAlgContext); bool updatePredecessorRoleFUNCTIONALConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); bool updatePredecessorRoleFUNCTIONALConceptsExtensions(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CLinkedRoleSaturationSuccessorData* succData, CBackwardSaturationPropagationLink* backPropLinkLinker, CCalculationAlgorithmContextBase* calcAlgContext); bool installSuccessorPredecessorRoleFunctionalityConceptsExtension(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); bool processNextSuccessorExtensions(CCalculationAlgorithmContextBase* calcAlgContext); bool addSuccessorExtensionToProcessingQueue(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualSaturationProcessNode* getSeparatedSaturationConceptAssertionResolveNode(CCalculationAlgorithmContextBase* calcAlgContext); CIndividualSaturationProcessNode* getResolvedIndividualNodeAssertion(CIndividualSaturationProcessNode* indiProcSatNode, CIndividual* othIndi, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualSaturationProcessNode* getResolvedIndividualNodeRepresentativeAssertion(CIndividualSaturationProcessNode* indiProcSatNode, CIndividual* othIndi, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualSaturationProcessNode* getResolvedIndividualNodeRepresentativeRangeAssertion(CIndividualSaturationProcessNode* indiProcSatNode, CIndividual* othIndi, CRole* role, bool inversedRole, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualSaturationProcessNode* createResolvedIndividualNode(CSaturationIndividualNodeExtensionResolveData* resolveData, CIndividualSaturationProcessNode*& copyIndiProcSatNode, bool queueProcessing, CCalculationAlgorithmContextBase* calcAlgContext); bool preprocessResolvedIndividualNode(CIndividualSaturationProcessNode* resolvedIndiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualSaturationProcessNode* getResolvedIndividualNodeExtensionSuccessor(CIndividualSaturationProcessNode* indiProcSatNode, CSaturationSuccessorConceptExtensionMap* succConExtMap, CCalculationAlgorithmContextBase* calcAlgContext); CSaturationIndividualNodeExtensionResolveData* getResolvedIndividualNodeExtension(CSaturationIndividualNodeExtensionResolveData* resolveData, CConcept* concept, bool negation, CIndividualSaturationProcessNode*& copyIndiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); CSaturationIndividualNodeExtensionResolveData* getResolvedIndividualNodeExtension(CSaturationIndividualNodeExtensionResolveData* resolveData, CIndividualSaturationProcessNode* extensionNode, CIndividualSaturationProcessNode*& copyIndiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); CSaturationIndividualNodeExtensionResolveData* getResolvedIndividualNodeExtension(CSaturationIndividualNodeExtensionResolveData* resolveData, CPROCESSINGHASH* conExtensionMap, CIndividualSaturationProcessNode*& copyIndiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); bool collectResolveIndividualExtendableConceptMap(CIndividualSaturationProcessNode* baseIndiNode, CIndividualSaturationProcessNode* extensionIndiNode, CPROCESSINGHASH*& conExtMap, CCalculationAlgorithmContextBase* calcAlgContext); void addALLConceptExtensionProcessingRole(CRole* role, CRoleBackwardSaturationPropagationHashData& backPropHashData, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void addFUNCTIONALConceptExtensionProcessingRole(CRole* role, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void addNewLinkedExtensionProcessingRole(CRole* role, CIndividualSaturationProcessNode*& indiProcSatNode, bool queueALLExtension, bool queueFUNCTIONALExtension, CCalculationAlgorithmContextBase* calcAlgContext); void addQualifiedFUNCTIONALAtmostConceptExtensionProcessing(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void initializeIndividualNodeByCoping(CIndividualSaturationProcessNode* indiProcSatNode, CIndividualSaturationProcessNode* copyFromIndiProcSatNode, bool tryFlatLabelCopy, CCalculationAlgorithmContextBase* calcAlgContext); bool installBackwardPropagationLink(CIndividualSaturationProcessNode* sourceIndiProcSatNode, CIndividualSaturationProcessNode* destIndiProcSatNode, CRole* role, CBackwardSaturationPropagationLink* link, bool applyBackPropDes, bool queueFunctionalProcessing, CCalculationAlgorithmContextBase* calcAlgContext); void checkNextCriticalConcepts(CCalculationAlgorithmContextBase* calcAlgContext); bool hasNextCriticalConcepts(CCalculationAlgorithmContextBase* calcAlgContext); void addCriticalConceptDescriptor(CConceptSaturationDescriptor* conDes, CCriticalSaturationConceptTypeQueues::CRITICALSATURATIONCONCEPTQUEUETYPE conceptType, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void checkCriticalConceptsForNode(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void addCriticalConceptForDependentNodes(CConceptSaturationDescriptor* conDes, CCriticalSaturationConceptTypeQueues::CRITICALSATURATIONCONCEPTQUEUETYPE conceptType, CIndividualSaturationProcessNode*& indiProcSatNode, bool directFlagsCheck, cint64 checkFlags, CCalculationAlgorithmContextBase* calcAlgContext); void addCriticalORConceptTestedForDependentNodes(CConceptSaturationDescriptor* conDes, CCriticalSaturationConceptTypeQueues::CRITICALSATURATIONCONCEPTQUEUETYPE conceptType, CIndividualSaturationProcessNode*& indiProcSatNode, CCriticalIndividualNodeConceptTestSet* criticalIndiNodeConTestSet, CCalculationAlgorithmContextBase* calcAlgContext); bool isCriticalALLConceptDescriptorInsufficient(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); bool isCriticalORConceptDescriptorInsufficient(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); bool isCriticalATMOSTConceptDescriptorInsufficient(CConceptSaturationDescriptor* conDes, bool& ancestorPossiblyCriticalFlag, CIndividualSaturationProcessNode*& functionallyRestrictedSuccessorNode, CXNegLinker*& functionallyRestrictedSuccessorCreationRoleLinker, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); bool isCriticalVALUEConceptDescriptorInsufficient(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); bool isCriticalNOMINALConceptDescriptorInsufficient(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); bool isCriticalEQCANDConceptDescriptorProblematic(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); bool markATMOSTRestrictedAncestorsAsInsufficient(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode* functionallyRestrictedSuccessorNode, CXNegLinker* functionallyRestrictedSuccessorCreationRoleLinker, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); bool markNominalATMOSTRestrictedAncestorsAsInsufficient(CConceptSaturationDescriptor* conDes, CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void updateExtractDisjunctCommonConcept(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void initializeExtractDisjunctCommonConcept(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void addDisjunctCommonConceptExtractionToProcessingQueue(CIndividualSaturationProcessNode*& indiProcSatNode, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptsFilteredToIndividual(CSortedNegLinker* conceptAddLinker, bool negate, CIndividualSaturationProcessNode*& processIndi, bool updateCopyDependedIndividual, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptsFilteredToIndividual(CSortedNegLinker* conceptAddLinker, bool negate, CIndividualSaturationProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptsFilteredToIndividual(CXNegLinker* conceptAddLinker, bool negate, CIndividualSaturationProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptsFilteredToIndividual(CXSortedNegLinker* conceptAddLinker, bool negate, CIndividualSaturationProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptFilteredToIndividual(CConcept* addingConcept, bool negate, CIndividualSaturationProcessNode*& rootProcessIndi, CReapplyConceptSaturationLabelSet* labelSet, bool updateCopyDependedIndividual, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptFilteredToIndividual(CConcept* addingConcept, bool negate, CIndividualSaturationProcessNode*& processIndi, bool updateCopyDependedIndividual, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptFilteredToIndividual(CConcept* addingConcept, bool negate, CIndividualSaturationProcessNode*& processIndi, CCalculationAlgorithmContextBase* calcAlgContext); void addConceptToIndividual(CConcept* addingConcept, bool negate, CIndividualSaturationProcessNode*& rootProcessIndi, CReapplyConceptSaturationLabelSet* labelSet, bool updateCopyDependedIndividual, CCalculationAlgorithmContextBase* calcAlgContext); bool insertConceptToIndividualConceptSet(CConceptSaturationDescriptor* conceptSaturationDescriptor, CIndividualSaturationProcessNode*& rootProcessIndi, CReapplyConceptSaturationLabelSet* labelSet, CCalculationAlgorithmContextBase* calcAlgContext); void processModificationUpdateLinkers(CIndividualSaturationProcessNode*& rootProcessIndi, CReapplyConceptSaturationLabelSet* labelSet, CSaturationModifiedProcessUpdateLinker* modProcUpdateLinker, CCalculationAlgorithmContextBase* calcAlgContext); bool hasConceptLocalImpact(CConcept* concept, bool conNeg, CCalculationAlgorithmContextBase* calcAlgContext); bool updateImplicationReapplyConceptSaturationDescriptor(CImplicationReapplyConceptSaturationDescriptor* reapplyImpReapplyConSatDes, CIndividualSaturationProcessNode*& rootProcessIndi, CReapplyConceptSaturationLabelSet* labelSet, CCalculationAlgorithmContextBase* calcAlgContext); CRoleSaturationProcessLinker* createRoleSaturationProcessLinker(CCalculationAlgorithmContextBase* calcAlgContext); CConceptSaturationDescriptor* createConceptSaturationDescriptor(CCalculationAlgorithmContextBase* calcAlgContext); CConceptSaturationProcessLinker* createConceptSaturationProcessLinker(CCalculationAlgorithmContextBase* calcAlgContext); CImplicationReapplyConceptSaturationDescriptor* createImplicationReapplyConceptSaturationDescriptor(CCalculationAlgorithmContextBase* calcAlgContext); void releaseConceptSaturationDescriptor(CConceptSaturationDescriptor* conSatDes, CCalculationAlgorithmContextBase* calcAlgContext); void releaseConceptSaturationProcessLinker(CConceptSaturationProcessLinker* conSatProcLinker, CCalculationAlgorithmContextBase* calcAlgContext); void releaseRoleSaturationProcessLinker(CRoleSaturationProcessLinker* roleSatProcLinker, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualSaturationProcessNodeLinker* createIndividualSaturationNodeLinker(CCalculationAlgorithmContextBase* calcAlgContext); void releaseIndividualSaturationNodeLinker(CIndividualSaturationProcessNodeLinker* indSatNodeLinker, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualSaturationProcessNodeStatusUpdateLinker* createIndividualSaturationUpdateLinker(CCalculationAlgorithmContextBase* calcAlgContext); void releaseIndividualSaturationUpdateLinker(CIndividualSaturationProcessNodeStatusUpdateLinker* conSatUpdateLinker, CCalculationAlgorithmContextBase* calcAlgContext); CIndividualSaturationSuccessorLinkDataLinker* createIndividualSaturationSuccessorLinkDataLinker(CCalculationAlgorithmContextBase* calcAlgContext); void releaseIndividualSaturationSuccessorLinkDataLinker(CIndividualSaturationSuccessorLinkDataLinker* succLinkDataLinker, CCalculationAlgorithmContextBase* calcAlgContext); CSaturationModifiedProcessUpdateLinker* createModifiedProcessUpdateLinker(CCalculationAlgorithmContextBase* calcAlgContext); QString getDebugIndividualConceptName(CIndividualSaturationProcessNode* indiNode, CCalculationAlgorithmContextBase* calcAlgContext); QString generateDebugIndiModelStringList(CCalculationAlgorithmContextBase* calcAlgContext); QString generateExtendedDebugIndiModelStringList(CCalculationAlgorithmContextBase* calcAlgContext, cint64 firstIndiID = 0, cint64 lastIndiID = -1); QStringList generateStatusFlagsStringList(CIndividualSaturationProcessNodeStatusFlags* statusFlags, CCalculationAlgorithmContextBase* calcAlgContext); void testDebugSaturationTaskContainsConcept(CConcept* concept, bool conNegation, CIndividualSaturationProcessNode* indiNode, CCalculationAlgorithmContextBase* calcAlgContext); void testDebugSaturationTaskContainsConcepts(CIndividualSaturationProcessNode* indiNode, CCalculationAlgorithmContextBase* calcAlgContext); void updateDirectAddingIndividualStatusFlags(CIndividualSaturationProcessNode* indiNode, cint64 flags, CCalculationAlgorithmContextBase* calcAlgContext); void updateDirectNotDependentAddingIndividualStatusFlags(CIndividualSaturationProcessNode* indiNode, cint64 flags, CCalculationAlgorithmContextBase* calcAlgContext); void updateDirectAddingIndividualStatusFlags(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CCalculationAlgorithmContextBase* calcAlgContext); void updateDirectNotDependentAddingIndividualStatusFlags(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CCalculationAlgorithmContextBase* calcAlgContext); void updateIndirectAddingIndividualStatusFlags(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CCalculationAlgorithmContextBase* calcAlgContext); bool requiresDirectAddingIndividualStatusFlagsUpdate(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CCalculationAlgorithmContextBase* calcAlgContext); bool requiresIndirectAddingIndividualStatusFlagsUpdate(CIndividualSaturationProcessNode* indiNode, CIndividualSaturationProcessNodeStatusFlags* addingFlags, CCalculationAlgorithmContextBase* calcAlgContext); bool loadConsistenceModelData(CCalculationAlgorithmContext* calcAlgContext); bool requiresAddingSuccessorConnectedNominals(CIndividualSaturationProcessNode* indiNode, cint64 addingNominalID, CCalculationAlgorithmContextBase* calcAlgContext); void updateAddingSuccessorConnectedNominal(CIndividualSaturationProcessNode* indiNode, cint64 addingNominalID, CCalculationAlgorithmContextBase* calcAlgContext); void updateAddingSuccessorConnectedNominal(CIndividualSaturationProcessNode* indiNode, CSuccessorConnectedNominalSet* succConnNomSet, CCalculationAlgorithmContextBase* calcAlgContext); bool loadConsistenceRepresentativeData(CCalculationAlgorithmContext* calcAlgContext); bool isConsistenceDataAvailable(CCalculationAlgorithmContext* calcAlgContext); bool createAncestorSuccessorMergingExtension(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CIndividualSaturationProcessNode* succSatNode, CIndividualSaturationProcessNode* ancSatNode, CXNegLinker* creationRoleLinker, CCalculationAlgorithmContextBase* calcAlgContext); CRole* getInverseRole(CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); bool isLinkedIndividualSuccessorNodeMergingSubset(CIndividualSaturationProcessNode*& indiProcSatNode, CIndividualSaturationProcessNode* subsetIndiSuccNode, CSaturationSuccessorData* subsetIndiSuccData, CIndividualSaturationProcessNode* superIndiSuccNode, CSaturationSuccessorData* superIndiSuccData, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); bool isLinkedIndividualSuccessorNodeMergingSubset(CIndividualSaturationProcessNode*& indiProcSatNode, CSaturationSuccessorData* subsetIndiSuccData, CSaturationSuccessorData* superIndiSuccData, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); bool deactivateSubsetMergeableSuccessorLinks(CIndividualSaturationProcessNode*& indiProcSatNode, CLinkedRoleSaturationSuccessorHash* linkedSuccHash, CPROCESSMAP* succDataMap, CRole* role, CCalculationAlgorithmContextBase* calcAlgContext); bool isSuccessorCreationRoleMergingSubset(CXNegLinker* subCreationRoleLinker, CXNegLinker* superCreationRoleLinker, CCalculationAlgorithmContextBase* calcAlgContext); bool isSuccessorCreationRoleMergingSubset(CRole* subCreationRole, CXNegLinker* superCreationRoleLinker, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualNodeLabelMergingSubset(CIndividualSaturationProcessNode* subsetIndiSuccNode, CIndividualSaturationProcessNode* superIndiSuccNode, bool ignoreANDConcepts, CCalculationAlgorithmContextBase* calcAlgContext); cint64 getSuccessorLinkSimplyMergeableCardinalityCount(CIndividualSaturationProcessNode*& indiProcSatNode, CSaturationSuccessorData* succLinkData, CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinker, CPROCESSINGHASH* remainMergeableCardHash, CRole* role, cint64 maxRequiredMergingCardinality, CPROCESSINGHASH* mergeDistintHash, CPROCESSINGSET< QPair >* mergeDistintSet, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualSuccessorLinkCardinalityMergeable(CSaturationSuccessorData* subsetIndiSuccData, CSaturationSuccessorData* superIndiSuccData, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualSuccessorLinkCardinalityMergeable(CIndividualSaturationProcessNode* subsetIndiSuccNode, CSaturationSuccessorData* subsetIndiSuccData, CIndividualSaturationProcessNode* superIndiSuccNode, CSaturationSuccessorData* superIndiSuccData, CCalculationAlgorithmContextBase* calcAlgContext); cint64 getSuccessorLinkExtendedMergeableCardinalityCount(CIndividualSaturationProcessNode*& indiProcSatNode, CSaturationSuccessorData* succLinkData, CIndividualSaturationSuccessorLinkDataLinker* mergingSuccDataLinker, CPROCESSINGHASH* remainMergeableCardHash, CRole* role, cint64 maxRequiredMergingCardinality, CPROCESSINGSET< QPair >* mergeDistintSet, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualSuccessorLinkCardinalityExtendedMergeable(CIndividualSaturationProcessNode*& indiProcSatNode, CSaturationSuccessorData* indiSuccData1, CSaturationSuccessorData* indiSuccData2, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualSuccessorLinkCardinalityExtendedMergeable(CIndividualSaturationProcessNode*& indiProcSatNode, CIndividualSaturationProcessNode* indiSuccNode1, CSaturationSuccessorData* indiSuccData1, CIndividualSaturationProcessNode* indiSuccNode2, CSaturationSuccessorData* indiSuccData2, CCalculationAlgorithmContextBase* calcAlgContext); bool isIndividualNodeLabelMergingProblematic(CIndividualSaturationProcessNode*& indiProcSatNode, CIndividualSaturationProcessNode* mergingSuccNode, CIndividualSaturationProcessNode* probTestingSuccNode, CXNegLinker* creationRoleLinker, CCalculationAlgorithmContextBase* calcAlgContext); cint64 getIndividualNodeQualifiedSuccessorCount(CIndividualSaturationProcessNode*& indiProcSatNode, CRole* role, CSortedNegLinker* conQualificationLinker, CCalculationAlgorithmContextBase* calcAlgContext); // protected variables protected: CCalculationAlgorithmContextBase* mCalcAlgContext; CProcessingDataBox* mProcessingDataBox; CSatisfiableTaskSaturationPreyingAnalyser mSatTaskSaturationPreyAnalyser; CSatisfiableTaskSaturationIndividualsAnalyser mSatTaskSaturationIndiAnalyser; CSaturationNodeBackendAssociationCacheHandler* mBackendAssCaceHandler; typedef void (CCalculationTableauApproximationSaturationTaskHandleAlgorithm::*TableauRuleFunction) (CIndividualSaturationProcessNode*& processIndi, CConceptSaturationProcessLinker* conProLinker); const static cint64 mRuleFuncCount = 200; TableauRuleFunction* mPosJumpFuncVec; TableauRuleFunction* mNegJumpFuncVec; TableauRuleFunction mPosTableauRuleJumpFuncVec[mRuleFuncCount]; TableauRuleFunction mNegTableauRuleJumpFuncVec[mRuleFuncCount]; bool mOptIndependentSaturationMode; bool mConfImplicationAddingSkipping; bool mConfForceAllConceptInsertion; bool mConfForceAllCopyInsteadOfSubstituition; bool mConfDebuggingWriteData; bool mWroteFunctionalSuccPredMergingDebugString; bool mConfAddCriticalConceptsToQueues; bool mConfDirectlyCriticalToInsufficient; bool mConfCheckCriticalConcepts; bool mConfConceptsExtensionProcessing; bool mConfALLConceptsExtensionProcessing; bool mConfFUNCTIONALConceptsExtensionProcessing; bool mConfNominalProcessing; bool mConfCopyNodeFromTopIndividualForManyConcepts; bool mConfSimpleMergingTestForATMOSTCriticalTesting; bool mConfDetailedMergingTestForATMOSTCriticalTesting; cint64 mConfResolveOperandConceptSize; cint64 mConfForceManyConceptSaturation; cint64 mConfReferredNodeManyConceptCount; cint64 mConfManyConceptReferredNodeCountProcessLimit; cint64 mConfReferredNodeConceptCountProcessLimit; cint64 mConfReferredNodeUnprocessedCountProcessLimit; cint64 mConfReferredNodeCheckingDepth; CCalculationConfigurationExtension *mLastConfig; bool mCachedCompletionGraphMissing; bool mCachedCompletionGraphLoaded; CIndividualProcessNodeVector* mDetCachedCGIndiVector; CIndividualProcessNodeVector* mNonDetCachedCGIndiVector; bool mNonDetConsistencyCG; bool mDetConsistencyCG; bool mRepresentativeDataLoaded; bool mRepresentativeDataAvailable; // for debugging cint64 mAppliedALLRuleCount; cint64 mAppliedSOMERuleCount; cint64 mAppliedANDRuleCount; cint64 mAppliedORRuleCount; cint64 mAppliedATLEASTRuleCount; cint64 mAppliedATMOSTRuleCount; cint64 mAppliedTOTALRuleCount; cint64 mAddedALLConcepts; cint64 mAddedSOMEConcepts; cint64 mAddedIMPLConcepts; cint64 mAddedTRIGGConcepts; cint64 mAddedSUBConcepts; cint64 mAddedELSEConcepts; cint64 mSubstituitedIndiNodeCount; cint64 mCopiedIndiNodeCount; cint64 mDirectUpdatedStatusIndiNodeCount; cint64 mIndirectUpdatedStatusIndiNodeCount; cint64 mSuccessorConnectedNominalUpdatedCount; cint64 mALLSuccExtInitializedCount; cint64 mDisjunctionInitializedSkippedCount; QStringList mDebugIndiModelStringList; QString mDebugIndiModelString; QString mRuleBeginDebugIndiModelString; QString mRuleEndDebugIndiModelString; QString mEndSaturationDebugIndiModelString; CSatisfiableCalculationTask* mDebugTestingSaturationTask; QString mDebugTestSaturationDebugIndiModelString; cint64 mInsufficientATMOSTCount; cint64 mInsufficientALLCount; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONTABLEAUAPPROXIMATIONSATURATIONTASKHANDLEALGORITHM_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSaturationNodeBackendAssociationCacheHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSaturationNodeBackendAssociationCac0000644000175000017500000001304612520551014032246 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATURATIONNODEBACKENDASSOCIATIONCACHEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATURATIONNODEBACKENDASSOCIATIONCACHEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualSaturationProcessNode.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheReader.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheWriter.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelCacheItem.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheLabelAssociationWriteData.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { using namespace Ontology; namespace Kernel { using namespace Process; using namespace Cache; namespace Algorithm { /*! * * \class CSaturationNodeBackendAssociationCacheHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeBackendAssociationCacheHandler { // public methods public: //! Constructor CSaturationNodeBackendAssociationCacheHandler(CBackendRepresentativeMemoryCacheReader* backAssCacheReader, CBackendRepresentativeMemoryCacheWriter* backAssCacheWriter); bool tryAssociateNodesWithBackendCache(CIndividualSaturationProcessNodeLinker* indiSaturationAnalysingNodeLinker, CCalculationAlgorithmContext* calcAlgContext); bool commitCacheMessages(CCalculationAlgorithmContext* calcAlgContext); CBackendRepresentativeMemoryCacheIndividualAssociationData* getIndividualAssociation(CIndividual* individual, CCalculationAlgorithmContext* calcAlgContext); const CCacheValue getCacheValue(CConcept* concept, bool negation); const CCacheValue getCacheValue(CRole* role); // protected methods protected: bool prepareCacheMessages(CCalculationAlgorithmContext* calcAlgContext); bool addCacheMessages(CBackendRepresentativeMemoryCacheLabelAssociationWriteData* backAssWriteData, CCalculationAlgorithmContext* calcAlgContext); bool findAssociationBackendLabel(CIndividualSaturationProcessNode* satNode, CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tmpAssWriteDataLinker, CCalculationAlgorithmContext* calcAlgContext); bool findAssociationBackendCardinality(CIndividualSaturationProcessNode* satNode, CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tmpAssWriteDataLinker, CCalculationAlgorithmContext* calcAlgContext); // protected variables protected: CBackendRepresentativeMemoryCacheReader* mAssBackCacheReader; CBackendRepresentativeMemoryCacheWriter* mAssBackCacheWriter; CPROCESSHASH< CIndividualSaturationProcessNode*,QPair >* mIndiNodeRefLabelHash; CPROCESSHASH< cint64,CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* >* mSignatureTmpRefLabelHash; CPROCESSHASH< CIndividualSaturationProcessNode*,QPair >* mIndiNodeRefCardHash; CPROCESSHASH< cint64,CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* >* mSignatureTmpRefCardHash; CPROCESSLIST< CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* >* mNewTmpLabelList; CPROCESSLIST< CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* >* mNewTmpCardList; CBackendRepresentativeMemoryCacheLabelAssociationWriteData* mWriteData; CTaskMemoryPoolAllocationManager* mMemAllocMan; CMemoryPoolContainer mMemPoolCon; CContextBase* mTmpContext; cint64 mStatCreatedTempLabels; cint64 mStatReusedTempLabels; cint64 mStatReusedCachedLabels; cint64 mStatReusedHashedIndiLabels; cint64 mStatReusedHashedSignatureLabels; bool mConfDirectCardinalityInsufficient; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATURATIONNODEBACKENDASSOCIATIONCACHEHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualNodeBackendCacheHandler.h0000644000175000017500000001254412520551006032054 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALNODEBACKENDCACHEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALNODEBACKENDCACHEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNodeLinker.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheReader.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheWriter.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelCacheItem.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheLabelAssociationWriteData.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { using namespace Ontology; namespace Kernel { using namespace Process; using namespace Cache; namespace Algorithm { /*! * * \class CIndividualNodeBackendCacheHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualNodeBackendCacheHandler { // public methods public: //! Constructor CIndividualNodeBackendCacheHandler(CBackendRepresentativeMemoryCacheReader* backAssCacheReader, CBackendRepresentativeMemoryCacheWriter* backAssCacheWriter); CBackendRepresentativeMemoryCacheIndividualAssociationData* getIndividualAssociationData(CIndividual* individual); bool hasConceptIndividualAssociation(CBackendRepresentativeMemoryCacheIndividualAssociationData* associationData, CConcept* concept, bool negation, CCalculationAlgorithmContext* calcAlgContext); bool tryAssociateNodesWithBackendCache(CIndividualProcessNodeLinker* indiNodeLinker, CCalculationAlgorithmContext* calcAlgContext); bool commitCacheMessages(CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: bool prepareCacheMessages(CCalculationAlgorithmContext* calcAlgContext); bool addCacheMessages(CBackendRepresentativeMemoryCacheLabelAssociationWriteData* backAssWriteData, CCalculationAlgorithmContext* calcAlgContext); const CCacheValue getCacheValue(CConcept* concept, bool negation); bool findAssociationBackendLabel(CIndividualProcessNode* indiNode, CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tmpAssWriteDataLinker, CCalculationAlgorithmContext* calcAlgContext); bool findAssociationBackendCardinality(CIndividualProcessNode* indiNode, CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tmpAssWriteDataLinker, CCalculationAlgorithmContext* calcAlgContext); // protected variables protected: CBackendRepresentativeMemoryCacheReader* mAssBackCacheReader; CBackendRepresentativeMemoryCacheWriter* mAssBackCacheWriter; CPROCESSHASH< CIndividualProcessNode*,QPair >* mIndiNodeRefLabelHash; CPROCESSHASH< cint64,CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* >* mSignatureTmpRefLabelHash; CPROCESSHASH< CIndividualProcessNode*,QPair >* mIndiNodeRefCardHash; CPROCESSHASH< cint64,CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* >* mSignatureTmpRefCardHash; CPROCESSLIST< CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* >* mNewTmpLabelList; CPROCESSLIST< CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* >* mNewTmpCardList; CBackendRepresentativeMemoryCacheLabelAssociationWriteData* mWriteData; CTaskMemoryPoolAllocationManager* mMemAllocMan; CMemoryPoolContainer mMemPoolCon; CContextBase* mTmpContext; cint64 mStatCreatedTempLabels; cint64 mStatReusedTempLabels; cint64 mStatReusedCachedLabels; cint64 mStatReusedHashedIndiLabels; cint64 mStatReusedHashedSignatureLabels; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALNODEBACKENDCACHEHANDLER_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationStopProcessingException.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationStopProcessingException.0000644000175000017500000000404412520551002032324 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONSTOPPROCESSINGEXCEPTION_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONSTOPPROCESSINGEXCEPTION_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { /*! * * \class CCalculationStopProcessingException * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationStopProcessingException { // public methods public: //! Constructor CCalculationStopProcessingException(bool taskCompleted = true); //! Destructor virtual ~CCalculationStopProcessingException(); bool isTaskCompletedProcessed() const; // protected methods protected: // protected variables protected: bool mTaskCompleted; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONSTOPPROCESSINGEXCEPTION_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeIRIValueSpaceHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeIRIValueSpaceH0000644000175000017500000000463012520551010032110 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEIRIVALUESPACEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEIRIVALUESPACEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CIndividualProcessNodeCompareValueSpaceHandler.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CIndividualProcessNodeIRIValueSpaceHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeIRIValueSpaceHandler : public CIndividualProcessNodeCompareValueSpaceHandler { // public methods public: //! Constructor CIndividualProcessNodeIRIValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEIRIVALUESPACEHANDLER_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskSaturationPreyingAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskSaturationPreyingAna0000644000175000017500000000454612520551014032341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKSATURATIONPREYINGANALYSER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKSATURATIONPREYINGANALYSER_H // Libraries includes // Namespace includes #include "CCalculationAlgorithmContext.h" #include "CSatisfiableConsistencyPreyingAnalyser.h" // Other includes #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" #include "Reasoner/Kernel/Task/CSaturationTaskData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Task; namespace Algorithm { /*! * * \class CSatisfiableTaskSaturationPreyingAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableTaskSaturationPreyingAnalyser : public CSatisfiableConsistencyPreyingAnalyser { // public methods public: //! Constructor CSatisfiableTaskSaturationPreyingAnalyser(); //! Destructor virtual ~CSatisfiableTaskSaturationPreyingAnalyser(); bool analyseSatisfiableTask(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKSATURATIONPREYINGANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCompletionGraphCacheHandler.h0000644000175000017500000001253512520551004030777 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CCOMPLETIONGRAPHCACHEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCOMPLETIONGRAPHCACHEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CClashDescriptorFactory.h" #include "CTrackedClashedDescriptor.h" #include "CCalculationAlgorithmContextBase.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" #include "Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCacheStoringData.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Reasoner/Kernel/Task/CConsistenceTaskData.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; using namespace Task; namespace Algorithm { /*! * * \class CCompletionGraphCacheHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCompletionGraphCacheHandler { // public methods public: //! Constructor CCompletionGraphCacheHandler(); //! Destructor virtual ~CCompletionGraphCacheHandler(); bool isIndividualNodeCompletionGraphConsistenceBlocked(CIndividualProcessNode* individualNode, bool& conceptSetExtended, CCalculationAlgorithmContext* calcAlgContext); bool getReactivationIndividuals(CIndividualProcessNode* individualNode, CIndividualReactivationProcessingQueue* reactProcQueue, CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: bool testCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext); bool testConceptLabelExtended(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext); bool testConceptLabelSubSetCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext); bool testDistinctSubSetCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext); bool testMergingSubSetCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext); bool testBindingSubSetCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext); bool testCriticalConcept(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CConceptDescriptor* conDes, bool containedFlag, CCalculationAlgorithmContext* calcAlgContext); bool testCriticalB2AutomateTransitionOperands(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CConcept* concept, CCalculationAlgorithmContext* calcAlgContext); bool loadConsistenceModelData(CCalculationAlgorithmContext* calcAlgContext); // protected variables protected: CConcreteOntology* mLastOntology; bool mLastLoadedCachedCompletionGraph; bool mPreviousConsistencyCachedCompletionGraph; CSatisfiableCalculationTask* mCalcTask; CSatisfiableCalculationTask* mDetSatCalcTask; CSatisfiableCalculationTask* mCompGraphCachedCalcTask; CIndividualProcessNodeVector* mIndiProcNodeVec; CIndividualProcessNodeVector* mDetSatProcNodeVec; CIndividualProcessNodeVector* mCompGraphCachedProcNodeVec; cint64 mDetLocalizationTag; bool mIncrementalExpansionCaching; cint64 mCurrentIncrementalExpansionID; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCOMPLETIONGRAPHCACHEHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CComputedConsequencesCacheHandler.h0000644000175000017500000000700512520551004032034 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CCOMPUTEDCONSEQUENCESCACHEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCOMPUTEDCONSEQUENCESCACHEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" // Other includes #include "Reasoner/Ontology/CIndividual.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Kernel/Cache/CComputedConsequencesCacheReader.h" #include "Reasoner/Kernel/Cache/CComputedConsequencesCacheWriter.h" #include "Reasoner/Kernel/Cache/CComputedConsequencesCacheEntry.h" #include "Reasoner/Kernel/Cache/CComputedConsequencesCacheWriteData.h" #include "Context/CContextBase.h" #include "Reasoner/Kernel/Task/CConsistenceTaskData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { using namespace Ontology; namespace Kernel { using namespace Cache; using namespace Task; namespace Algorithm { /*! * * \class CComputedConsequencesCacheHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CComputedConsequencesCacheHandler { // public methods public: //! Constructor CComputedConsequencesCacheHandler(CComputedConsequencesCacheReader* satCacheReader, CComputedConsequencesCacheWriter* satCacheWriter); bool tryCacheTypeConcept(CIndividual* individual, CConcept* concept, bool negation, CCalculationAlgorithmContext* calcAlgContext); CSortedNegLinker* getCachedTypesConceptLinker(CIndividual* individual, CCalculationAlgorithmContext* calcAlgContext); bool commitCacheMessages(CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: bool prepareCacheMessages(CCalculationAlgorithmContext* calcAlgContext); bool addCacheMessages(CComputedConsequencesCacheWriteData* expandWriteData, CCalculationAlgorithmContext* calcAlgContext); bool canCacheTypeConcept(CIndividual* individual, CConcept* concept, bool negation, CCalculationAlgorithmContext* calcAlgContext); // protected variables protected: CComputedConsequencesCacheReader* mSatCacheReader; CComputedConsequencesCacheWriter* mSatCacheWriter; CComputedConsequencesCacheWriteData* mWriteData; CTaskMemoryPoolAllocationManager* mMemAllocMan; CMemoryPoolContainer mMemPoolCon; CContextBase* mTmpContext; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCOMPUTEDCONSEQUENCESCACHEHANDLER_H ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskMarkerIndividualPropagationAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskMarkerIndividualProp0000644000175000017500000001501512520551014032316 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableTaskMarkerIndividualPropagationAnalyser.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CSatisfiableTaskMarkerIndividualPropagationAnalyser::CSatisfiableTaskMarkerIndividualPropagationAnalyser() { } bool CSatisfiableTaskMarkerIndividualPropagationAnalyser::readCalculationConfig(CCalculationConfigurationExtension *config) { if (config) { return true; } return false; } CIndividualProcessNode* CSatisfiableTaskMarkerIndividualPropagationAnalyser::getCorrectedIndividualNode(cint64 baseIndiID, CIndividualProcessNodeVector* indiNodeVec) { CIndividualProcessNode* indi = indiNodeVec->getData(baseIndiID); while (indi->hasMergedIntoIndividualNodeID()) { indi = indiNodeVec->getData(indi->getMergedIntoIndividualNodeID()); } return indi; } bool CSatisfiableTaskMarkerIndividualPropagationAnalyser::analyseSatisfiableTask(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContext* calcAlgContext) { CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter* realMessAdapter = statCalcTask->getRealizationMarkedCandidatesMessageAdapter(); if (realMessAdapter) { CRealizationMessageObserver* realMessObserver = realMessAdapter->getRealizationMessageDataObserver(); CIndividual* individual = realMessAdapter->getTestingIndividual(); CConcreteOntology* ontology = realMessAdapter->getTestingOntology(); CTaskProcessorContext* taskProcessorContext = calcAlgContext->getUsedTaskProcessorContext(); CTaskHandleMemoryAllocationManager* taskMemMan = calcAlgContext->getTemporaryMemoryAllocationManager(); CMemoryPoolContainer memPoolCon; CTaskMemoryPoolAllocationManager realMessMemManCreaterMemMan(&memPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); CTaskMemoryPoolAllocationManager* tempMemAllocMan = CObjectAllocator::allocateAndConstruct(&realMessMemManCreaterMemMan); tempMemAllocMan->initTaskMemoryPoolAllocationManager(&memPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); CContextBase* tmpContext = CObjectParameterizingAllocator< CContextBase,CMemoryAllocationManager* >::allocateAndConstructAndParameterize(tempMemAllocMan,tempMemAllocMan); CRealizationMessageData* realMessageData = nullptr; CProcessingDataBox* procDataBox = calcAlgContext->getProcessingDataBox(); CMarkerIndividualNodeHash* markerIndiNodeHash = procDataBox->getMarkerIndividualNodeHash(false); if (markerIndiNodeHash) { for (CPROCESSHASH< CConcept*,CXNegLinker* >::const_iterator it = markerIndiNodeHash->constBegin(), itEnd = markerIndiNodeHash->constEnd(); it != itEnd; ++it) { CConcept* markerConcept = it.key(); CXLinker* detIndiCandLinker = nullptr; CXLinker* ndetIndiCandLinker = nullptr; CXNegLinker* candIndiLinker = it.value(); for (CXNegLinker* candIndiLinkerIt = candIndiLinker; candIndiLinkerIt; candIndiLinkerIt = candIndiLinkerIt->getNext()) { CIndividualProcessNode* indiNode = candIndiLinkerIt->getData(); CIndividual* candIndividual = indiNode->getNominalIndividual(); if (candIndividual) { CXLinker* tmpLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(tempMemAllocMan); tmpLinker->initLinker(candIndividual); bool nondeterministicallyAdded = candIndiLinkerIt->isNegated(); if (nondeterministicallyAdded) { ndetIndiCandLinker = tmpLinker->append(ndetIndiCandLinker); } else { detIndiCandLinker = tmpLinker->append(detIndiCandLinker); } for (CConceptDescriptor* conDesIt = indiNode->getReapplyConceptLabelSet(false)->getAddingSortedConceptDescriptionLinker(); conDesIt; conDesIt = conDesIt->getNext()) { if (!conDesIt->isNegated()) { bool nondeterministicallyMerged = true; CDependencyTrackPoint* depTrackPoint = conDesIt->getDependencyTrackPoint(); if (depTrackPoint && depTrackPoint->getBranchingTag() <= 0) { nondeterministicallyMerged = false; } if (nondeterministicallyMerged) { CConcept* concept = conDesIt->getConcept(); if (concept->getOperatorCode() == CCNOMINAL) { CIndividual* nomIndividual = concept->getNominalIndividual(); if (nomIndividual != candIndividual) { CXLinker* nomTmpLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(tempMemAllocMan); nomTmpLinker->initLinker(nomIndividual); ndetIndiCandLinker = nomTmpLinker->append(ndetIndiCandLinker); } } } } } } } CRealizationMarkerCandidatesMessageData* realMarkCandMessageData = CObjectAllocator::allocateAndConstruct(tempMemAllocMan); realMarkCandMessageData->initRealizationMarkerCandidatesMessageData(individual,markerConcept,detIndiCandLinker,ndetIndiCandLinker); realMessageData = realMarkCandMessageData->append(realMessageData); } } if (realMessageData) { realMessObserver->tellRealizationMessage(ontology,realMessageData,memPoolCon.takeMemoryPools()); } else { taskMemMan->releaseTemporaryMemoryPools(memPoolCon.takeMemoryPools()); } if (individual) { return true; } } return false; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskConsistencyPreyingAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskConsistencyPreyingAn0000644000175000017500000000441712520551012032343 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableTaskConsistencyPreyingAnalyser.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CSatisfiableTaskConsistencyPreyingAnalyser::CSatisfiableTaskConsistencyPreyingAnalyser() { } CSatisfiableTaskConsistencyPreyingAnalyser::~CSatisfiableTaskConsistencyPreyingAnalyser() { } bool CSatisfiableTaskConsistencyPreyingAnalyser::analyseSatisfiableTask(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContext* calcAlgContext) { CTaskPreyingAdapter* consPreyAdatper = statCalcTask->getConsistenceAdapter(); if (consPreyAdatper) { if (consPreyAdatper) { CTaskPreyingListner* taskPreyingListner = consPreyAdatper->getTaskPreyingListner(); if (taskPreyingListner) { taskPreyingListner->tellPreyedSatisfialbeTask(statCalcTask); return true; } } CConsistenceObserver* consObs = nullptr; if (consPreyAdatper) { consObs = consPreyAdatper->getConsitenceObserver(); } if (consObs) { CSatisfiableCalculationTask* rootStatCalcTask = (CSatisfiableCalculationTask*)statCalcTask->getRootTask(); CConsistenceTaskData* consTaskData = new CConsistenceTaskData(rootStatCalcTask,statCalcTask); consObs->tellConsistenceData(consTaskData); return true; } } return false; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSaturationNodeExpansionCacheHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSaturationNodeExpansionCacheHandler0000644000175000017500000001367512520551014032311 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATURATIONNODEEXPANSIONCACHEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATURATIONNODEEXPANSIONCACHEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CClashDescriptorFactory.h" #include "CTrackedClashedDescriptor.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" #include "Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCacheStoringData.h" #include "Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCacheStoringData.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptReferenceLinking.h" #include "Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h" #include "Reasoner/Consistiser/CSaturationConceptDataItem.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheReader.h" #include "Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheWriter.h" #include "Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheEntry.h" #include "Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheWriteData.h" #include "Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData.h" #include "Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheExpansionWriteData.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { using namespace Ontology; using namespace Consistiser; namespace Kernel { using namespace Process; using namespace Dependency; using namespace Cache; namespace Algorithm { /*! * * \class CSaturationNodeExpansionCacheHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationNodeExpansionCacheHandler { // public methods public: //! Constructor CSaturationNodeExpansionCacheHandler(CSaturationNodeAssociatedExpansionCacheReader* satCacheReader, CSaturationNodeAssociatedExpansionCacheWriter* satCacheWriter); CIndividualSaturationProcessNode* getSaturationIndividualNodeForConcept(CConcept* concept, bool negation, CCalculationAlgorithmContext* calcAlgContext); bool cacheUnsatisfiableConcept(CConcept* concept, CCalculationAlgorithmContext* calcAlgContext); bool isConceptUnsatisfiableCached(CConcept* concept, bool negation, CCalculationAlgorithmContext* calcAlgContext); bool isNodeSatisfiableCached(CIndividualProcessNode* individualProcessNode, CSaturationNodeAssociatedConceptExpansion*& expansion, CCalculationAlgorithmContext* calcAlgContext); bool tryNodeSatisfiableCaching(CIndividualProcessNode* individualProcessNode, CCalculationAlgorithmContext* calcAlgContext); bool getCachedDeterministicExpansion(CIndividualSaturationProcessNode* saturationNode, CSaturationNodeAssociatedDeterministicConceptExpansion*& expansion, CCalculationAlgorithmContext* calcAlgContext); bool commitCacheMessages(CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: bool prepareCacheMessages(CCalculationAlgorithmContext* calcAlgContext); bool addCacheMessages(CSaturationNodeAssociatedExpansionCacheWriteData* expandWriteData, CCalculationAlgorithmContext* calcAlgContext); CCacheValue getCacheValueForConcept(CConcept* concept, bool negation, CCalculationAlgorithmContext* calcAlgContext); CCacheValue getCacheValueForConcept(CConceptDescriptor* conDes, CCalculationAlgorithmContext* calcAlgContext); bool testNodeMatchingExpansion(CSaturationNodeAssociatedConceptExpansion* expansion, CSaturationNodeAssociatedConceptExpansion* alternativeExpansion, CReapplyConceptLabelSet* conSet, CIndividualNodeSaturationBlockingData* satBlockData, CCalculationAlgorithmContext* calcAlgContext); bool isDeterministicallyDependingOnSaturationConcept(CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint, CConceptDescriptor* saturationConceptDescriptor, CCalculationAlgorithmContext* calcAlgContext); bool testNodeCachingPossible(CIndividualProcessNode* individualProcessNode, bool& onlyIfCompletelyDeterministic, bool& onlyAllNondeterministic, CSaturationNodeAssociatedExpansionCacheEntry*& cacheEntry, CCalculationAlgorithmContext* calcAlgContext); // protected variables protected: CSaturationNodeAssociatedExpansionCacheReader* mSatCacheReader; CSaturationNodeAssociatedExpansionCacheWriter* mSatCacheWriter; CSaturationNodeAssociatedExpansionCacheWriteData* mWriteData; CTaskMemoryPoolAllocationManager* mMemAllocMan; CMemoryPoolContainer mMemPoolCon; CContextBase* mTmpContext; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATURATIONNODEEXPANSIONCACHEHANDLER_H ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskMarkerIndividualPropagationAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskMarkerIndividualProp0000644000175000017500000000631012520551014032314 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKMARKERINDIVIDUALPROPAGATIONANALYSER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKMARKERINDIVIDUALPROPAGATIONANALYSER_H // Libraries includes // Namespace includes #include "CCalculationAlgorithmContext.h" // Other includes #include "Context/CContextBase.h" #include "Reasoner/Realizer/CRealizationMessageObserver.h" #include "Reasoner/Realizer/CRealizationMarkerCandidatesMessageData.h" #include "Reasoner/Consistiser/CSaturationConceptDataItem.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyNode.h" #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CIndividualSaturationProcessNode.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptSatisfiableReferenceLinkingData.h" #include "Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { using namespace Consistiser; using namespace Realizer; using namespace Ontology; namespace Kernel { using namespace Task; using namespace Process::Dependency; namespace Algorithm { /*! * * \class CSatisfiableTaskMarkerIndividualPropagationAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableTaskMarkerIndividualPropagationAnalyser { // public methods public: //! Constructor CSatisfiableTaskMarkerIndividualPropagationAnalyser(); bool readCalculationConfig(CCalculationConfigurationExtension *config); bool analyseSatisfiableTask(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContext* calcAlgContext); CIndividualProcessNode* getCorrectedIndividualNode(cint64 baseIndiID, CIndividualProcessNodeVector* indiNodeVec); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKMARKERINDIVIDUALPROPAGATIONANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCompletionGraphCacheHandler.cpp0000644000175000017500000010561512544361212031342 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCompletionGraphCacheHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CCompletionGraphCacheHandler::CCompletionGraphCacheHandler() { mLastOntology = nullptr; mLastLoadedCachedCompletionGraph = false; mPreviousConsistencyCachedCompletionGraph = false; } CCompletionGraphCacheHandler::~CCompletionGraphCacheHandler() { } bool CCompletionGraphCacheHandler::loadConsistenceModelData(CCalculationAlgorithmContext* calcAlgContext) { CConcreteOntology* ontology = calcAlgContext->getProcessingDataBox()->getOntology(); mCalcTask = calcAlgContext->getUsedSatisfiableCalculationTask(); mIndiProcNodeVec = mCalcTask->getProcessingDataBox()->getIndividualProcessNodeVector(); if (mLastOntology != ontology) { mLastOntology = ontology; mIncrementalExpansionCaching = false; mLastLoadedCachedCompletionGraph = false; mPreviousConsistencyCachedCompletionGraph = false; mCurrentIncrementalExpansionID = 0; CConsistence* consistence = ontology->getConsistence(); if (consistence) { CConsistenceData* consData = consistence->getConsistenceModelData(); if (consData) { CConsistenceTaskData* consTaskData = dynamic_cast(consData); if (consTaskData) { mDetSatCalcTask = consTaskData->getDeterministicSatisfiableTask(); mCompGraphCachedCalcTask = consTaskData->getCompletionGraphCachedSatisfiableTask(); if (mDetSatCalcTask && mCompGraphCachedCalcTask) { mDetSatProcNodeVec = mDetSatCalcTask->getProcessingDataBox()->getIndividualProcessNodeVector(); mCompGraphCachedProcNodeVec = mCompGraphCachedCalcTask->getProcessingDataBox()->getIndividualProcessNodeVector(); mLastLoadedCachedCompletionGraph = true; mDetLocalizationTag = mDetSatCalcTask->getProcessingDataBox()->getProcessContext()->getProcessTagger()->getCurrentLocalizationTag(); } } } } if (!mLastLoadedCachedCompletionGraph) { CSatisfiableTaskIncrementalConsistencyTestingAdapter* incConsTestAd = mCalcTask->getSatisfiableTaskIncrementalConsistencyTestingAdapter(); if (incConsTestAd) { CConcreteOntology* prevConsOntology = incConsTestAd->getPreviousConsistentOntology(); CConsistence* prevConsistence = prevConsOntology->getConsistence(); if (prevConsistence) { CConsistenceData* prevConsData = prevConsistence->getConsistenceModelData(); if (prevConsData) { CConsistenceTaskData* prevConsTaskData = dynamic_cast(prevConsData); if (prevConsTaskData) { mDetSatCalcTask = prevConsTaskData->getDeterministicSatisfiableTask(); mCompGraphCachedCalcTask = prevConsTaskData->getCompletionGraphCachedSatisfiableTask(); if (mDetSatCalcTask && mCompGraphCachedCalcTask) { mDetSatProcNodeVec = mDetSatCalcTask->getProcessingDataBox()->getIndividualProcessNodeVector(); mCompGraphCachedProcNodeVec = mCompGraphCachedCalcTask->getProcessingDataBox()->getIndividualProcessNodeVector(); mPreviousConsistencyCachedCompletionGraph = true; mIncrementalExpansionCaching = true; mCurrentIncrementalExpansionID = mCalcTask->getProcessingDataBox()->getIncrementalExpansionID(); mDetLocalizationTag = mDetSatCalcTask->getProcessingDataBox()->getProcessContext()->getProcessTagger()->getCurrentLocalizationTag(); } } } } } } } return mLastLoadedCachedCompletionGraph; } bool CCompletionGraphCacheHandler::getReactivationIndividuals(CIndividualProcessNode* individualNode, CIndividualReactivationProcessingQueue* reactProcQueue, CCalculationAlgorithmContext* calcAlgContext) { loadConsistenceModelData(calcAlgContext); bool addedReactivationIndi = false; cint64 indiID = individualNode->getIndividualID(); CIndividualProcessNode* compGraphCachedIndiNode = mCompGraphCachedProcNodeVec->getData(indiID); CIndividualProcessNode* detCompGraphCachedIndiNode = mDetSatProcNodeVec->getData(indiID); if (compGraphCachedIndiNode && compGraphCachedIndiNode != detCompGraphCachedIndiNode) { cint64 detSatIndiCount = mDetSatProcNodeVec->getItemCount()-1; CPROCESSINGLIST reactivateComplGraphCachedIndiList(calcAlgContext->getTaskProcessorContext()); CPROCESSINGSET reactivateComplGraphCachedIndiSet(calcAlgContext->getTaskProcessorContext()); CIndividualMergingHash* mergingHash = compGraphCachedIndiNode->getIndividualMergingHash(false); if (mergingHash) { for (CIndividualMergingHash::const_iterator it = mergingHash->constBegin(), itEnd = mergingHash->constEnd(); it != itEnd; ++it) { CIndividual* mergedIndi = it.key(); cint64 mergedIndiID = mergedIndi->getIndividualID(); CIndividualProcessNode* compGraphCachedMergedIndiNode = mCompGraphCachedProcNodeVec->getData(mergedIndiID); CIndividualProcessNode* detSatMergedIndiNode = nullptr; if (mergedIndiID <= detSatIndiCount) { detSatMergedIndiNode = mDetSatProcNodeVec->getData(mergedIndiID); } if (compGraphCachedMergedIndiNode != detSatMergedIndiNode && detSatMergedIndiNode) { addedReactivationIndi |= reactProcQueue->insertReactivationIndiviudal(detSatMergedIndiNode,true); } } } CConnectionSuccessorSetIterator connSuccSetIt(compGraphCachedIndiNode->getConnectionSuccessorIterator()); while (connSuccSetIt.hasNext()) { cint64 connIndiID = connSuccSetIt.next(); CIndividualProcessNode* detSatConnIndiNode = nullptr; if (connIndiID <= detSatIndiCount) { detSatConnIndiNode = mDetSatProcNodeVec->getData(connIndiID); } if (detSatConnIndiNode) { CIndividualProcessNode* compGraphCachedConnIndiNode = mCompGraphCachedProcNodeVec->getData(connIndiID); if (compGraphCachedConnIndiNode != detSatConnIndiNode) { addedReactivationIndi |= reactProcQueue->insertReactivationIndiviudal(detSatConnIndiNode,false); } } else { reactivateComplGraphCachedIndiList.append(connIndiID); reactivateComplGraphCachedIndiSet.insert(connIndiID); } } while (!reactivateComplGraphCachedIndiList.isEmpty()) { cint64 connIndiID = reactivateComplGraphCachedIndiList.takeFirst(); CIndividualProcessNode* detSatConnIndiNode = nullptr; if (connIndiID <= detSatIndiCount) { detSatConnIndiNode = mDetSatProcNodeVec->getData(connIndiID); } if (!detSatConnIndiNode) { CIndividualProcessNode* compGraphCachedConnIndiNode = mCompGraphCachedProcNodeVec->getData(connIndiID); CConnectionSuccessorSetIterator connSuccSetIt(compGraphCachedConnIndiNode->getConnectionSuccessorIterator()); while (connSuccSetIt.hasNext()) { cint64 connIndiID = connSuccSetIt.next(); if (!reactivateComplGraphCachedIndiSet.contains(connIndiID)) { reactivateComplGraphCachedIndiSet.insert(connIndiID); reactivateComplGraphCachedIndiList.append(connIndiID); } } } else { addedReactivationIndi |= reactProcQueue->insertReactivationIndiviudal(detSatConnIndiNode,true); } } } return addedReactivationIndi; } bool CCompletionGraphCacheHandler::isIndividualNodeCompletionGraphConsistenceBlocked(CIndividualProcessNode* individualNode, bool& conceptSetExtended, CCalculationAlgorithmContext* calcAlgContext) { conceptSetExtended = false; if (loadConsistenceModelData(calcAlgContext)) { if (mIncrementalExpansionCaching) { if (individualNode->getIncrementalExpansionID() >= mCurrentIncrementalExpansionID) { return false; } } cint64 detSatIndiCount = mDetSatProcNodeVec->getItemCount()-1; cint64 indiID = individualNode->getIndividualID(); if (indiID <= detSatIndiCount) { CIndividualProcessNode* detSatIndiNode = mDetSatProcNodeVec->getData(indiID); if (detSatIndiNode) { CIndividualProcessNode* compGraphCachedIndiNode = mCompGraphCachedProcNodeVec->getData(indiID); while (compGraphCachedIndiNode->getMergedIntoIndividualNodeID() != compGraphCachedIndiNode->getIndividualID()) { compGraphCachedIndiNode = mCompGraphCachedProcNodeVec->getData(compGraphCachedIndiNode->getMergedIntoIndividualNodeID()); } if (testCompletionGraphCached(individualNode,detSatIndiNode,compGraphCachedIndiNode,calcAlgContext)) { conceptSetExtended = testConceptLabelExtended(individualNode,detSatIndiNode,compGraphCachedIndiNode,calcAlgContext); return true; } } } } return false; } bool CCompletionGraphCacheHandler::testConceptLabelExtended(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext) { CReapplyConceptLabelSet* conSet = individualNode->getReapplyConceptLabelSet(false); CReapplyConceptLabelSet* detCachedConSet = detSatIndiNode->getReapplyConceptLabelSet(false); if (conSet->getAddingSortedConceptDescriptionLinker() != detCachedConSet->getAddingSortedConceptDescriptionLinker()) { return true; } return false; } bool CCompletionGraphCacheHandler::testCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext) { bool cached = true; if (cached) { cached &= testConceptLabelSubSetCompletionGraphCached(individualNode,detSatIndiNode,compGraphCachedIndiNode,calcAlgContext); } if (cached) { cached &= testDistinctSubSetCompletionGraphCached(individualNode,detSatIndiNode,compGraphCachedIndiNode,calcAlgContext); } if (cached) { cached &= testMergingSubSetCompletionGraphCached(individualNode,detSatIndiNode,compGraphCachedIndiNode,calcAlgContext); } if (cached) { cached &= testBindingSubSetCompletionGraphCached(individualNode,detSatIndiNode,compGraphCachedIndiNode,calcAlgContext); } return cached; } bool CCompletionGraphCacheHandler::testMergingSubSetCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext) { return true; } bool CCompletionGraphCacheHandler::testDistinctSubSetCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext) { CDistinctHash* subDistinctHash = individualNode->getDistinctHash(false); CDistinctHash* superDistinctHash = compGraphCachedIndiNode->getDistinctHash(false); if (subDistinctHash) { if (!superDistinctHash) { return false; } for (CDistinctHash::const_iterator it = subDistinctHash->constBegin(), itEnd = subDistinctHash->constEnd(); it != itEnd; ++it) { cint64 disIndiID = it.key(); if (!superDistinctHash->isIndividualDistinct(disIndiID)) { return false; } } } return true; } bool CCompletionGraphCacheHandler::testBindingSubSetCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext) { CReapplyConceptLabelSet* subConceptSet = individualNode->getReapplyConceptLabelSet(false); CReapplyConceptLabelSetIterator subConSetIt = subConceptSet->getConceptLabelSetIterator(true,false,false); while (subConSetIt.hasValue()) { CConceptDescriptor* subConDes = subConSetIt.getConceptDescriptor(); CConcept* concept = subConDes->getConcept(); CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_PROPAGATION_BIND_TYPE)) { CConceptPropagationBindingSetHash* indiPropBindSetHash = individualNode->getConceptPropagationBindingSetHash(false); if (indiPropBindSetHash) { CPropagationBindingSet* indiPropBindSet = indiPropBindSetHash->getPropagationBindingSet(concept,false); if (indiPropBindSet) { CPropagationBindingMap* indiPropBindMap = indiPropBindSet->getPropagationBindingMap(); if (!indiPropBindMap->empty()) { CConceptPropagationBindingSetHash* compGraphCachedPropBindSetHash = compGraphCachedIndiNode->getConceptPropagationBindingSetHash(false); if (!compGraphCachedPropBindSetHash) { return true; } CPropagationBindingSet* compGraphCachedPropBindSet = compGraphCachedPropBindSetHash->getPropagationBindingSet(concept,false); if (!compGraphCachedPropBindSet) { return true; } CPropagationBindingMap* compGraphCachedPropBindMap = compGraphCachedPropBindSet->getPropagationBindingMap(); if (!indiPropBindMap->isKeySubSetOf(compGraphCachedPropBindMap)) { return true; } } } } } if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_VARIABLE_BIND_TYPE)) { CConceptVariableBindingPathSetHash* indiVarBindSetHash = individualNode->getConceptVariableBindingPathSetHash(false); if (indiVarBindSetHash) { CVariableBindingPathSet* indiVarBindSet = indiVarBindSetHash->getVariableBindingPathSet(concept,false); if (indiVarBindSet) { CVariableBindingPathMap* indiVarBindMap = indiVarBindSet->getVariableBindingPathMap(); if (!indiVarBindMap->empty()) { CConceptVariableBindingPathSetHash* compGraphCachedVarBindSetHash = compGraphCachedIndiNode->getConceptVariableBindingPathSetHash(false); if (!compGraphCachedVarBindSetHash) { return true; } CVariableBindingPathSet* compGraphCachedVarBindSet = compGraphCachedVarBindSetHash->getVariableBindingPathSet(concept,false); if (!compGraphCachedVarBindSet) { return true; } CVariableBindingPathMap* compGraphCachedVarBindMap = compGraphCachedVarBindSet->getVariableBindingPathMap(); if (!indiVarBindMap->isKeySubSetOf(compGraphCachedVarBindMap)) { return true; } } } } CConceptRepresentativePropagationSetHash* indiVarRepBindSetHash = individualNode->getConceptRepresentativePropagationSetHash(false); if (indiVarRepBindSetHash) { CRepresentativePropagationSet* indiVarRepBindSet = indiVarRepBindSetHash->getRepresentativePropagationSet(concept,false); if (indiVarRepBindSet) { CRepresentativePropagationMap* indiVarRepBindMap = indiVarRepBindSet->getRepresentativePropagationMap(); if (!indiVarRepBindMap->empty()) { CConceptRepresentativePropagationSetHash* compGraphCachedVarRepBindSetHash = compGraphCachedIndiNode->getConceptRepresentativePropagationSetHash(false); if (!compGraphCachedVarRepBindSetHash) { return true; } CRepresentativePropagationSet* compGraphCachedVarRepBindSet = compGraphCachedVarRepBindSetHash->getRepresentativePropagationSet(concept,false); if (!compGraphCachedVarRepBindSet) { return true; } CRepresentativePropagationMap* compGraphCachedVarRepBindMap = compGraphCachedVarRepBindSet->getRepresentativePropagationMap(); if (!indiVarRepBindMap->isKeySubSetOf(compGraphCachedVarRepBindMap)) { return true; } } } } } subConSetIt.moveNext(); } return true; } bool CCompletionGraphCacheHandler::testConceptLabelSubSetCompletionGraphCached(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CCalculationAlgorithmContext* calcAlgContext) { CReapplyConceptLabelSet* subConceptSet = individualNode->getReapplyConceptLabelSet(false); CReapplyConceptLabelSet* superConceptSet = compGraphCachedIndiNode->getReapplyConceptLabelSet(false); cint64 subConSetCount = subConceptSet->getConceptCount(); cint64 superConSetCount = superConceptSet->getConceptCount(); if (subConSetCount > superConSetCount) { return false; } if (superConSetCount == 0) { return true; } CReapplyConceptLabelSetIterator subConSetIt = subConceptSet->getConceptLabelSetIterator(true,false,false); CReapplyConceptLabelSetIterator superConSetIt = superConceptSet->getConceptLabelSetIterator(true,false,false); CConceptDescriptor* superConDes = superConSetIt.getConceptDescriptor(); cint64 superConTag = superConDes->getConceptTag(); superConSetIt.moveNext(); bool contained = false; while (subConSetIt.hasValue()) { CConceptDescriptor* subConDes = subConSetIt.getConceptDescriptor(); cint64 subConTag = subConDes->getConceptTag(); while (superConTag < subConTag) { if (!superConSetIt.hasValue()) { return false; } if (testCriticalConcept(individualNode,detSatIndiNode,compGraphCachedIndiNode,superConDes,contained,calcAlgContext)) { return false; } contained = false; superConDes = superConSetIt.getConceptDescriptor(); superConTag = superConDes->getConceptTag(); superConSetIt.moveNext(); } if (subConTag != superConTag) { return false; } else { if (subConDes->isNegated() != superConDes->isNegated()) { return false; } contained = true; } subConSetIt.moveNext(); } while (superConSetIt.hasValue()) { if (testCriticalConcept(individualNode,detSatIndiNode,compGraphCachedIndiNode,superConDes,contained,calcAlgContext)) { return false; } contained = false; superConDes = superConSetIt.getConceptDescriptor(); superConTag = superConDes->getConceptTag(); superConSetIt.moveNext(); } if (testCriticalConcept(individualNode,detSatIndiNode,compGraphCachedIndiNode,superConDes,contained,calcAlgContext)) { return false; } return true; } bool CCompletionGraphCacheHandler::testCriticalConcept(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CConceptDescriptor* conDes, bool containedFlag, CCalculationAlgorithmContext* calcAlgContext) { CConcept* concept = conDes->getConcept(); bool conNegation = conDes->getNegation(); cint64 opCode = concept->getOperatorCode(); CRole* role = concept->getRole(); CConceptOperator* conOperator = concept->getConceptOperator(); if (!containedFlag) { if (!conNegation && (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_AQALL_TYPE)) || conNegation && opCode == CCSOME) { CRoleSuccessorLinkIterator succLinkIt = individualNode->getRoleSuccessorLinkIterator(role); while (succLinkIt.hasNext()) { CIndividualLinkEdge* link = succLinkIt.next(); CIndividualProcessNode* succIndi = link->getOppositeIndividual(individualNode); if (link->isLocalizationTagUpdated(calcAlgContext->getUsedProcessTagger())) { succIndi = mIndiProcNodeVec->getData(link->getOppositeIndividualID(individualNode)); } if (succIndi->getLocalizationTag() > mDetLocalizationTag && !succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED) || succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALID)) { CSortedNegLinker* opConLinkerIt = concept->getOperandList(); while (opConLinkerIt) { bool opNegated = opConLinkerIt->isNegated()^conNegation; CConcept* opCon = opConLinkerIt->getData(); CReapplyConceptLabelSet* succConSet = succIndi->getReapplyConceptLabelSet(false); if (!succConSet || !succConSet->containsConcept(opCon,opNegated)) { return true; } if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCF_PBINDAQALL | CConceptOperator::CCF_PBINDALL)) { CConceptPropagationBindingSetHash* compGraphCachedPropBindSetHash = compGraphCachedIndiNode->getConceptPropagationBindingSetHash(false); if (compGraphCachedPropBindSetHash) { CPropagationBindingSet* compGraphCachedPropBindSet = compGraphCachedPropBindSetHash->getPropagationBindingSet(concept,false); if (compGraphCachedPropBindSet) { CPropagationBindingMap* compGraphCachedPropBindMap = compGraphCachedPropBindSet->getPropagationBindingMap(); if (!compGraphCachedPropBindMap->empty()) { CConceptPropagationBindingSetHash* succPropBindSetHash = succIndi->getConceptPropagationBindingSetHash(false); if (!succPropBindSetHash) { return true; } CPropagationBindingSet* succPropBindSet = succPropBindSetHash->getPropagationBindingSet(opCon,false); if (!succPropBindSet) { return true; } CPropagationBindingMap* succPropBindMap = succPropBindSet->getPropagationBindingMap(); if (!compGraphCachedPropBindMap->isKeySubSetOf(succPropBindMap)) { return true; } } } } } if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCF_VARBINDAQALL | CConceptOperator::CCF_VARBINDALL)) { CConceptVariableBindingPathSetHash* compGraphCachedVarBindSetHash = compGraphCachedIndiNode->getConceptVariableBindingPathSetHash(false); if (compGraphCachedVarBindSetHash) { CVariableBindingPathSet* compGraphCachedVarBindSet = compGraphCachedVarBindSetHash->getVariableBindingPathSet(concept,false); if (compGraphCachedVarBindSet) { CVariableBindingPathMap* compGraphCachedVarBindMap = compGraphCachedVarBindSet->getVariableBindingPathMap(); if (!compGraphCachedVarBindMap->empty()) { CConceptVariableBindingPathSetHash* succVarBindSetHash = succIndi->getConceptVariableBindingPathSetHash(false); if (!succVarBindSetHash) { return true; } CVariableBindingPathSet* succVarBindSet = succVarBindSetHash->getVariableBindingPathSet(opCon,false); if (!succVarBindSet) { return true; } CVariableBindingPathMap* succVarBindMap = succVarBindSet->getVariableBindingPathMap(); if (!compGraphCachedVarBindMap->isKeySubSetOf(succVarBindMap)) { return true; } } } } CConceptRepresentativePropagationSetHash* compGraphCachedVarRepBindSetHash = compGraphCachedIndiNode->getConceptRepresentativePropagationSetHash(false); if (compGraphCachedVarRepBindSetHash) { CRepresentativePropagationSet* compGraphCachedVarRepBindSet = compGraphCachedVarRepBindSetHash->getRepresentativePropagationSet(concept,false); if (compGraphCachedVarRepBindSet) { CRepresentativePropagationMap* compGraphCachedVarRepBindMap = compGraphCachedVarRepBindSet->getRepresentativePropagationMap(); if (!compGraphCachedVarRepBindMap->empty()) { CConceptRepresentativePropagationSetHash* succVarRepBindSetHash = succIndi->getConceptRepresentativePropagationSetHash(false); if (!succVarRepBindSetHash) { return true; } CRepresentativePropagationSet* succVarRepBindSet = succVarRepBindSetHash->getRepresentativePropagationSet(opCon,false); if (!succVarRepBindSet) { return true; } CRepresentativePropagationMap* succVarRepBindMap = succVarRepBindSet->getRepresentativePropagationMap(); if (!compGraphCachedVarRepBindMap->isKeySubSetOf(succVarRepBindMap)) { return true; } } } } } opConLinkerIt = opConLinkerIt->getNext(); } } } } else if (!conNegation && (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQAND_TYPE))) { return testCriticalB2AutomateTransitionOperands(individualNode,detSatIndiNode,compGraphCachedIndiNode,concept,calcAlgContext); } } if (!conNegation && opCode == CCATMOST || conNegation && opCode == CCATLEAST) { // check cardinality cint64 cardinality = concept->getParameter() - 1*conNegation; bool nominalIndiNode = individualNode->isNominalIndividual(); cint64 updatedCardinality = 0; CRoleSuccessorLinkIterator succLinkIt = individualNode->getRoleSuccessorLinkIterator(role); while (updatedCardinality <= cardinality && succLinkIt.hasNext()) { CIndividualLinkEdge* link = succLinkIt.next(); CSortedNegLinker* opConLinkerIt = concept->getOperandList(); if (!opConLinkerIt) { CIndividualProcessNode* succIndi = link->getOppositeIndividual(individualNode); if (link->isLocalizationTagUpdated(calcAlgContext->getUsedProcessTagger())) { succIndi = mIndiProcNodeVec->getData(link->getOppositeIndividualID(individualNode)); } //CIndividualProcessNode* corrCachedSuccIndi = mCompGraphCachedProcNodeVec->getData(succIndi->getIndividualID()); //while (corrCachedSuccIndi && corrCachedSuccIndi->getMergedIntoIndividualNodeID() != corrCachedSuccIndi->getIndividualID()) { // corrCachedSuccIndi = mCompGraphCachedProcNodeVec->getData(corrCachedSuccIndi->getMergedIntoIndividualNodeID()); //} if (succIndi->getLocalizationTag() > mDetLocalizationTag) { if (succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALID)) { CIndividualProcessNode* corrCachedSuccIndi = mCompGraphCachedProcNodeVec->getData(succIndi->getIndividualID()); if (corrCachedSuccIndi->getMergedIntoIndividualNodeID() != succIndi->getIndividualID() || corrCachedSuccIndi->getLastMergedIntoIndividualNode() != succIndi->getLastMergedIntoIndividualNode()) { ++updatedCardinality; } } } if (nominalIndiNode) { if (link->getCreatorIndividualID() != individualNode->getIndividualID()) { if (link->isLocalizationTagUpdated(calcAlgContext->getUsedProcessTagger())) { succIndi = mIndiProcNodeVec->getData(link->getOppositeIndividualID(individualNode)); } if (succIndi->isBlockableIndividual()) { // requires NN-rule return true; } } } } else { CIndividualProcessNode* succIndi = link->getOppositeIndividual(individualNode); if (link->isLocalizationTagUpdated(calcAlgContext->getUsedProcessTagger())) { succIndi = mIndiProcNodeVec->getData(link->getOppositeIndividualID(individualNode)); } if (nominalIndiNode) { if (link->getCreatorIndividualID() != individualNode->getIndividualID()) { if (succIndi->isBlockableIndividual()) { // requires NN-rule return true; } } } if (succIndi->getLocalizationTag() > mDetLocalizationTag) { if (succIndi->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALID)) { bool containsSomeOps = false; while (opConLinkerIt && !containsSomeOps) { bool opNegated = opConLinkerIt->isNegated()^conNegation; CConcept* opCon = opConLinkerIt->getData(); bool containsNegated = false; CReapplyConceptLabelSet* succConSet = succIndi->getReapplyConceptLabelSet(false); if (succConSet) { if (succConSet->containsConcept(opCon,&containsNegated)) { if (containsNegated == opNegated) { containsSomeOps = true; } } else { containsSomeOps = true; } } opConLinkerIt = opConLinkerIt->getNext(); } if (containsSomeOps) { CIndividualProcessNode* corrCachedSuccIndi = mCompGraphCachedProcNodeVec->getData(succIndi->getIndividualID()); if (corrCachedSuccIndi->getMergedIntoIndividualNodeID() != succIndi->getIndividualID() || corrCachedSuccIndi->getLastMergedIntoIndividualNode() != succIndi->getLastMergedIntoIndividualNode()) { ++updatedCardinality; } } //CIndividualProcessNode* succIndi = link->getOppositeIndividual(individualNode); //CIndividualProcessNode* corrCachedSuccIndi = mCompGraphCachedProcNodeVec->getData(succIndi->getIndividualID()); //while (corrCachedSuccIndi && corrCachedSuccIndi->getMergedIntoIndividualNodeID() != corrCachedSuccIndi->getIndividualID()) { // corrCachedSuccIndi = mCompGraphCachedProcNodeVec->getData(corrCachedSuccIndi->getMergedIntoIndividualNodeID()); //} //if (!corrCachedSuccIndi) { // ++updatedCardinality; //} else { // bool cachedContainsSomeOps = false; // CSortedNegLinker* opConLinkerIt = concept->getOperandList(); // while (opConLinkerIt && !cachedContainsSomeOps) { // bool opNegated = opConLinkerIt->isNegated()^conNegation; // CConcept* opCon = opConLinkerIt->getData(); // bool containsNegated = false; // CReapplyConceptLabelSet* cachedSuccConSet = corrCachedSuccIndi->getReapplyConceptLabelSet(false); // if (cachedSuccConSet) { // if (cachedSuccConSet->containsConcept(opCon,&containsNegated)) { // if (containsNegated == opNegated) { // cachedContainsSomeOps = true; // } // } else { // cachedContainsSomeOps = true; // } // } // opConLinkerIt = opConLinkerIt->getNext(); // } // if (!cachedContainsSomeOps) { // ++updatedCardinality; // } //} } } } } if (updatedCardinality > cardinality) { return true; } CReapplyRoleSuccessorHash* cachedSuccHash = compGraphCachedIndiNode->getReapplyRoleSuccessorHash(false); if (cachedSuccHash) { cint64 linkCount = 0; CRoleSuccessorLinkIterator succLinkIt = cachedSuccHash->getRoleSuccessorLinkIterator(role,&linkCount); if (cardinality - linkCount < updatedCardinality) { cint64 cachedCardinality = 0; while (succLinkIt.hasNext()) { CIndividualLinkEdge* link = succLinkIt.next(); CSortedNegLinker* opConLinkerIt = concept->getOperandList(); if (!opConLinkerIt) { ++cachedCardinality; } else { CIndividualProcessNode* succIndi = link->getOppositeIndividual(individualNode); if (link->isLocalizationTagUpdated(mCompGraphCachedCalcTask->getProcessingDataBox()->getProcessContext()->getUsedProcessTagger())) { succIndi = mCompGraphCachedProcNodeVec->getData(link->getOppositeIndividualID(individualNode)); } bool containsSomeOps = false; while (opConLinkerIt && !containsSomeOps) { bool opNegated = opConLinkerIt->isNegated(); CConcept* opCon = opConLinkerIt->getData(); CReapplyConceptLabelSet* succConSet = succIndi->getReapplyConceptLabelSet(false); if (succConSet && succConSet->containsConcept(opCon,opNegated)) { containsSomeOps = true; } opConLinkerIt = opConLinkerIt->getNext(); } if (containsSomeOps) { ++cachedCardinality; } } if (updatedCardinality + cachedCardinality > cardinality) { return true; } } } } } return false; } bool CCompletionGraphCacheHandler::testCriticalB2AutomateTransitionOperands(CIndividualProcessNode* individualNode, CIndividualProcessNode* detSatIndiNode, CIndividualProcessNode* compGraphCachedIndiNode, CConcept* concept, CCalculationAlgorithmContext* calcAlgContext) { cint64 opCode = concept->getOperatorCode(); CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQAND_TYPE)) { // recursive CSortedNegLinker* opLinkerIt = concept->getOperandList(); while (opLinkerIt) { CConcept* opConcept = opLinkerIt->getData(); if (testCriticalB2AutomateTransitionOperands(individualNode,detSatIndiNode,compGraphCachedIndiNode,opConcept,calcAlgContext)) { return true; } opLinkerIt = opLinkerIt->getNext(); } } else if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQALL_TYPE)) { CRole* conRole = concept->getRole(); CRoleSuccessorLinkIterator succLinkIt = individualNode->getRoleSuccessorLinkIterator(conRole); while (succLinkIt.hasNext()) { CIndividualLinkEdge* link = succLinkIt.next(); CIndividualProcessNode* succIndi = link->getOppositeIndividual(individualNode); if (link->isLocalizationTagUpdated(calcAlgContext->getUsedProcessTagger())) { succIndi = mIndiProcNodeVec->getData(link->getOppositeIndividualID(individualNode)); } if (succIndi->getLocalizationTag() > mDetLocalizationTag) { CSortedNegLinker* opLinkerIt = concept->getOperandList(); while (opLinkerIt) { CConcept* opConcept = opLinkerIt->getData(); CReapplyConceptLabelSet* succConSet = succIndi->getReapplyConceptLabelSet(false); if (succConSet) { if (!succConSet->containsConcept(opConcept,false)) { return true; } } opLinkerIt = opLinkerIt->getNext(); } } } } return true; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationClashProcessingException.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationClashProcessingException0000644000175000017500000000432112520551002032351 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONCLASHPROCESSINGEXCEPTION_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONCLASHPROCESSINGEXCEPTION_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" // Other includes #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Process; namespace Algorithm { /*! * * \class CCalculationClashProcessingException * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationClashProcessingException { // public methods public: //! Constructor CCalculationClashProcessingException(CClashedDependencyDescriptor* clashDepDes); //! Destructor virtual ~CCalculationClashProcessingException(); CClashedDependencyDescriptor* getClashedDependencyDescriptor() const; // protected methods protected: // protected variables protected: CClashedDependencyDescriptor* mClashDepDes; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCALCULATIONCLASHPROCESSINGEXCEPTION_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskSaturationPreyingAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskSaturationPreyingAna0000644000175000017500000000350412520551014032332 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableTaskSaturationPreyingAnalyser.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CSatisfiableTaskSaturationPreyingAnalyser::CSatisfiableTaskSaturationPreyingAnalyser() { } CSatisfiableTaskSaturationPreyingAnalyser::~CSatisfiableTaskSaturationPreyingAnalyser() { } bool CSatisfiableTaskSaturationPreyingAnalyser::analyseSatisfiableTask(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContext* calcAlgContext) { CTaskPreyingAdapter* consPreyAdatper = statCalcTask->getConsistenceAdapter(); if (consPreyAdatper) { CSaturationObserver* saturObs = consPreyAdatper->getSaturationObserver(); if (saturObs) { CSaturationTaskData* saturTaskData = new CSaturationTaskData(statCalcTask); saturObs->tellSaturationData(saturTaskData); return true; } } return false; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIncrementalCompletionGraphCompatibleExpansionHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIncrementalCompletionGraphCompatibl0000644000175000017500000000662712520551006032353 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINCREMENTALCOMPLETIONGRAPHCOMPATIBLEEXPANSIONHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINCREMENTALCOMPLETIONGRAPHCOMPATIBLEEXPANSIONHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CClashDescriptorFactory.h" #include "CTrackedClashedDescriptor.h" #include "CCalculationAlgorithmContextBase.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CClashedDependencyDescriptor.h" #include "Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCacheStoringData.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Reasoner/Kernel/Task/CConsistenceTaskData.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; using namespace Task; namespace Algorithm { /*! * * \class CIncrementalCompletionGraphCompatibleExpansionHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIncrementalCompletionGraphCompatibleExpansionHandler { // public methods public: //! Constructor CIncrementalCompletionGraphCompatibleExpansionHandler(); //! Destructor virtual ~CIncrementalCompletionGraphCompatibleExpansionHandler(); CIndividualProcessNode* getPreviousDeterministicCompletionGraphCorrespondingIndividualNode(CIndividualProcessNode* individualNode, CCalculationAlgorithmContext* calcAlgContext); bool isIndividualNodePreviousCompletionGraphCompatible(CIndividualProcessNode* individualNode, CCalculationAlgorithmContext* calcAlgContext); CSatisfiableCalculationTask* getPreviousDeterministicCompletionGraphTask(CCalculationAlgorithmContext* calcAlgContext); CSatisfiableCalculationTask* getPreviousNondeterministicCompletionGraphTask(CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: // protected variables protected: CSatisfiableCalculationTask* mPrevCompGraphCalcTask; CIndividualProcessNodeVector* mPrevCompGraphProcNodeVec; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINCREMENTALCOMPLETIONGRAPHCOMPATIBLEEXPANSIONHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CDatatypeDependencyCollection.h0000644000175000017500000000704112520551004031244 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CDATATYPEDEPENDENCYCOLLECTION_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CDATATYPEDEPENDENCYCOLLECTION_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CDependencyFactory.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Reasoner/Kernel/Process/Dependency/CDATATYPETRIGGERDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CDATATYPECONNECTIONDependencyNode.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CDatatypeDependencyCollection * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeDependencyCollection : public CDatatypeValueSpaceDependencyCollector { // public methods public: //! Constructor CDatatypeDependencyCollection(CCalculationAlgorithmContext* collectionCalcAlgContext); CDatatypeDependencyCollection(CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* collectionCalcAlgContext); bool addDependency(CDependencyTrackPoint* depTrackPoint); bool hasDependencies(); CDependencyTrackPoint* getDatatypeTriggerDependencyTrackPoint(bool create = true); // protected methods protected: CDATATYPETRIGGERDependencyNode* createDATATYPETRIGGERDependency(CDependencyTrackPoint*& expContinueDepTrackPoint, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext); CDATATYPECONNECTIONDependencyNode* createDATATYPECONNECTIONDependency(CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); // protected variables protected: CPROCESSINGSET* mTestDepTrackPointSet; CPROCESSINGSET* mDepTrackPointSet; CDependencyTrackPoint* mCollectedFirstDependency; CDependency* mCollectedAdditionalDependencies; CCalculationAlgorithmContext* mCollectionCalcAlgContext; bool mCollectionDatatypeDepCreated; CDependencyTrackPoint* mCollectionDataTriggerDepTrackPoint; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CDATATYPEDEPENDENCYCOLLECTION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CDependencyFactory.cpp0000644000175000017500000013107412520551004027423 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDependencyFactory.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CDependencyFactory::CDependencyFactory() { mConfBuildDependencies = true; } CREPRESENTATIVEGROUNDINGDependencyNode* CDependencyFactory::createREPRESENTATIVEGROUNDINGDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CVariableBindingPath* selectVarBindPath, CCalculationAlgorithmContext* calcAlgContext) { CREPRESENTATIVEGROUNDINGDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CREPRESENTATIVEGROUNDINGDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initREPRESENTATIVEGROUNDINGDependencyNode(conDes,prevDepTrackPoint,selectVarBindPath); implContinueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CREPRESENTATIVEJOINDependencyNode* CDependencyFactory::createREPRESENTATIVEJOINDependency(CDependencyTrackPoint*& joinContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* otherDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CREPRESENTATIVEJOINDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CREPRESENTATIVEJOINDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initREPRESENTATIVEJOINDependencyNode(conDes,prevDepTrackPoint,otherDepTrackPoint); joinContinueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CREPRESENTATIVEBINDVARIABLEDependencyNode* CDependencyFactory::createREPRESENTATIVEBINDVARIABLEDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CREPRESENTATIVEBINDVARIABLEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CREPRESENTATIVEBINDVARIABLEDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initREPRESENTATIVEBINDVARIABLEDependencyNode(conDes,prevDepTrackPoint); andDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CREPRESENTATIVEIMPLICATIONDependencyNode* CDependencyFactory::createREPRESENTATIVEIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext) { CREPRESENTATIVEIMPLICATIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CREPRESENTATIVEIMPLICATIONDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initREPRESENTATIVEIMPLICATIONDependencyNode(conDes,prevDepTrackPoint,prevOtherDependencies); implContinueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CREPRESENTATIVEALLDependencyNode* CDependencyFactory::createREPRESENTATIVEALLDependency(CDependencyTrackPoint*& allDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CREPRESENTATIVEALLDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CREPRESENTATIVEALLDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initREPRESENTATIVEALLDependencyNode(conDes,processIndi,prevDepTrackPoint,linkDepTrackPoint); allDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CREPRESENTATIVEANDDependencyNode* CDependencyFactory::createREPRESENTATIVEANDDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CREPRESENTATIVEANDDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CREPRESENTATIVEANDDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initREPRESENTATIVEANDDependencyNode(conDes,prevDepTrackPoint); andDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CRESOLVEREPRESENTATIVEDependencyNode* CDependencyFactory::createRESOLVEREPRESENTATIVEDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CRepresentativeVariableBindingPathMap* resolveVarBindPathMap, CRepresentativePropagationMap* resolveRepPropMap, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* additionalDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CRESOLVEREPRESENTATIVEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CRESOLVEREPRESENTATIVEDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initRESOLVEREPRESENTATIVEDependencyNode(conDes,resolveVarBindPathMap,resolveRepPropMap,prevDepTrackPoint,additionalDepTrackPoint); andDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CVARBINDPROPAGATEIMPLICATIONDependencyNode* CDependencyFactory::createVARBINDPROPAGATEIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext) { CVARBINDPROPAGATEIMPLICATIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CVARBINDPROPAGATEIMPLICATIONDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initVARBINDPROPAGATEIMPLICATIONDependencyNode(conDes,prevDepTrackPoint,prevOtherDependencies); implContinueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CPROPAGATEVARIABLECONNECTIONDependencyNode* CDependencyFactory::createPROPAGATEVARIABLECONNECTIONDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CPROPAGATEVARIABLECONNECTIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CPROPAGATEVARIABLECONNECTIONDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initPROPAGATEVARIABLECONNECTIONDependencyNode(conDes,processIndi,prevDepTrackPoint); } return depNode; } CVARBINDPROPAGATEGROUNDINGDependencyNode* CDependencyFactory::createVARBINDPROPAGATEGROUNDINGDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext) { CVARBINDPROPAGATEGROUNDINGDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CVARBINDPROPAGATEGROUNDINGDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initVARBINDPROPAGATEGROUNDINGDependencyNode(conDes,prevDepTrackPoint,prevOtherDependencies); implContinueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CVARBINDPROPAGATEANDDependencyNode* CDependencyFactory::createVARBINDPROPAGATEANDDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CVARBINDPROPAGATEANDDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CVARBINDPROPAGATEANDDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initVARBINDPROPAGATEANDDependencyNode(conDes,prevDepTrackPoint); andDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CPROPAGATEVARIABLEBINDINGDependencyNode* CDependencyFactory::createPROPAGATEVARIABLEBINDINGDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext) { CPROPAGATEVARIABLEBINDINGDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CPROPAGATEVARIABLEBINDINGDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initPROPAGATEVARIABLEBINDINGDependencyNode(conDes,prevDepTrackPoint,prevOtherDependencies); andDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CVARBINDPROPAGATEALLDependencyNode* CDependencyFactory::createVARBINDPROPAGATEALLDependency(CDependencyTrackPoint*& allDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CVARBINDPROPAGATEALLDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CVARBINDPROPAGATEALLDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initVARBINDPROPAGATEALLDependencyNode(conDes,processIndi,prevDepTrackPoint,linkDepTrackPoint); allDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode* CDependencyFactory::createPROPAGATEVARIABLEBINDINGSSUCCESSORDependency(CDependencyTrackPoint*& allDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode(conDes,processIndi,prevDepTrackPoint,linkDepTrackPoint); allDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CVARBINDVARIABLEDependencyNode* CDependencyFactory::createVARBINDVARIABLEDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CVARBINDVARIABLEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CVARBINDVARIABLEDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initVARBINDVARIABLEDependencyNode(conDes,prevDepTrackPoint); andDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CVARBINDPROPAGATEJOINDependencyNode* CDependencyFactory::createVARBINDPROPAGATEJOINDependency(CDependencyTrackPoint*& mergeDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* otherDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CVARBINDPROPAGATEJOINDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CVARBINDPROPAGATEJOINDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initVARBINDPROPAGATEJOINDependencyNode(conDes,prevDepTrackPoint,otherDepTrackPoint); mergeDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CBINDPROPAGATEGROUNDINGDependencyNode* CDependencyFactory::createBINDPROPAGATEGROUNDINGDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext) { CBINDPROPAGATEGROUNDINGDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CBINDPROPAGATEGROUNDINGDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initBINDPROPAGATEGROUNDINGDependencyNode(conDes,prevDepTrackPoint,prevOtherDependencies); implContinueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CPROPAGATECONNECTIONAWAYDependencyNode* CDependencyFactory::createPROPAGATECONNECTIONAWAYDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CPROPAGATECONNECTIONAWAYDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CPROPAGATECONNECTIONAWAYDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initPROPAGATECONNECTIONAWAYDependencyNode(conDes,processIndi,prevDepTrackPoint); } return depNode; } CPROPAGATECONNECTIONDependencyNode* CDependencyFactory::createPROPAGATECONNECTIONDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CPROPAGATECONNECTIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CPROPAGATECONNECTIONDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initPROPAGATECONNECTIONDependencyNode(conDes,processIndi,prevDepTrackPoint); } return depNode; } CBINDPROPAGATECYCLEDependencyNode* CDependencyFactory::createBINDPROPAGATECYCLEDependency(CDependencyTrackPoint*& depTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* triggDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CBINDPROPAGATECYCLEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CBINDPROPAGATECYCLEDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initBINDPROPAGATECYCLEDependencyNode(conDes,prevDepTrackPoint,triggDepTrackPoint); depTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CBINDPROPAGATEALLDependencyNode* CDependencyFactory::createBINDPROPAGATEALLDependency(CDependencyTrackPoint*& allDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CBINDPROPAGATEALLDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CBINDPROPAGATEALLDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initBINDPROPAGATEALLDependencyNode(conDes,processIndi,prevDepTrackPoint,linkDepTrackPoint); allDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CPROPAGATEBINDINGSSUCCESSORDependencyNode* CDependencyFactory::createPROPAGATEBINDINGSSUCCESSORDependency(CDependencyTrackPoint*& allDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CPROPAGATEBINDINGSSUCCESSORDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CPROPAGATEBINDINGSSUCCESSORDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initPROPAGATEBINDINGSSUCCESSORDependencyNode(conDes,processIndi,prevDepTrackPoint,linkDepTrackPoint); allDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CBINDPROPAGATEIMPLICATIONDependencyNode* CDependencyFactory::createBINDPROPAGATEIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext) { CBINDPROPAGATEIMPLICATIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CBINDPROPAGATEIMPLICATIONDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initBINDPROPAGATEIMPLICATIONDependencyNode(conDes,prevDepTrackPoint,prevOtherDependencies); implContinueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CBINDPROPAGATEANDDependencyNode* CDependencyFactory::createBINDPROPAGATEANDDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CBINDPROPAGATEANDDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CBINDPROPAGATEANDDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initBINDPROPAGATEANDDependencyNode(conDes,prevDepTrackPoint); andDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CPROPAGATEBINDINGDependencyNode* CDependencyFactory::createPROPAGATEBINDINGDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext) { CPROPAGATEBINDINGDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CPROPAGATEBINDINGDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initPROPAGATEBINDINGDependencyNode(conDes,prevDepTrackPoint,prevOtherDependencies); andDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CBINDVARIABLEDependencyNode* CDependencyFactory::createBINDVARIABLEDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CBINDVARIABLEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CBINDVARIABLEDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initBINDVARIABLEDependencyNode(conDes,prevDepTrackPoint); andDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CANDDependencyNode* CDependencyFactory::createANDDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CANDDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CANDDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initANDDependencyNode(conDes,prevDepTrackPoint); andDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CNOMINALDependencyNode* CDependencyFactory::createNOMINALDependency(CDependencyTrackPoint*& nominalContDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CNOMINALDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CNOMINALDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initNOMINALDependencyNode(conDes,processIndi,prevDepTrackPoint,nominalDepTrackPoint); nominalContDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CAUTOMATCHOOSEDependencyNode* CDependencyFactory::createAUTOMATCHOOSEDependency(CDependencyTrackPoint*& andDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CAUTOMATCHOOSEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CAUTOMATCHOOSEDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initAUTOMATCHOOSEDependencyNode(conDes,prevDepTrackPoint); andDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CSOMEDependencyNode* CDependencyFactory::createSOMEDependency(CDependencyTrackPoint*& someDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CSOMEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CSOMEDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initSOMEDependencyNode(conDes,processIndi,prevDepTrackPoint); someDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CSELFDependencyNode* CDependencyFactory::createSELFDependency(CDependencyTrackPoint*& someDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CSELFDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CSELFDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initSELFDependencyNode(conDes,processIndi,prevDepTrackPoint); someDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CVALUEDependencyNode* CDependencyFactory::createVALUEDependency(CDependencyTrackPoint*& valueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CVALUEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CVALUEDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initVALUEDependencyNode(conDes,processIndi,prevDepTrackPoint,nominalDepTrackPoint); valueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CROLEASSERTIONDependencyNode* CDependencyFactory::createROLEASSERTIONDependency(CDependencyTrackPoint*& roleAssDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CROLEASSERTIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CROLEASSERTIONDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initROLEASSERTIONDependencyNode(processIndi,prevDepTrackPoint,nominalDepTrackPoint); roleAssDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CNEGVALUEDependencyNode* CDependencyFactory::createNEGVALUEDependency(CDependencyTrackPoint*& negValueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CNEGVALUEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CNEGVALUEDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initNEGVALUEDependencyNode(conDes,processIndi,prevDepTrackPoint,nominalDepTrackPoint); negValueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CALLDependencyNode* CDependencyFactory::createALLDependency(CDependencyTrackPoint*& allDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CALLDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CALLDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initALLDependencyNode(conDes,processIndi,prevDepTrackPoint,linkDepTrackPoint); allDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CMERGEDCONCEPTDependencyNode* CDependencyFactory::createMERGEDCONCEPTDependency(CDependencyTrackPoint*& mergedConceptContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* mergePrevDepTrackPoint, CDependencyTrackPoint* conceptPrevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CMERGEDCONCEPTDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CMERGEDCONCEPTDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initMERGEDCONCEPTDependencyNode(conDes,mergePrevDepTrackPoint,conceptPrevDepTrackPoint); mergedConceptContinueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CMERGEDLINKDependencyNode* CDependencyFactory::createMERGEDLINKDependency(CDependencyTrackPoint*& mergedLinkContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* mergePrevDepTrackPoint, CDependencyTrackPoint* linkPrevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CMERGEDLINKDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CMERGEDLINKDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initMERGEDLINKDependencyNode(nullptr,processIndi,mergePrevDepTrackPoint,linkPrevDepTrackPoint); mergedLinkContinueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CFUNCTIONALDependencyNode* CDependencyFactory::createFUNCTIONALDependency(CDependencyTrackPoint*& functionalContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* prevLink1DependencyTrackPoint, CDependencyTrackPoint* prevLink2DependencyTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CFUNCTIONALDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CFUNCTIONALDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initFUNCTIONALDependencyNode(conDes,processIndi,prevDepTrackPoint,prevLink1DependencyTrackPoint,prevLink2DependencyTrackPoint); functionalContinueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CDISTINCTDependencyNode* CDependencyFactory::createDISTINCTDependency(CDependencyTrackPoint*& distinctDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CDISTINCTDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CDISTINCTDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initDISTINCTDependencyNode(conDes,processIndi,prevDepTrackPoint); distinctDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CAUTOMATTRANSACTIONDependencyNode* CDependencyFactory::createAUTOMATTRANSACTIONDependency(CDependencyTrackPoint*& allDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CAUTOMATTRANSACTIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CAUTOMATTRANSACTIONDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initAUTOMATTRANSACTIONDependencyNode(conDes,processIndi,prevDepTrackPoint,linkDepTrackPoint); allDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CATLEASTDependencyNode* CDependencyFactory::createATLEASTDependency(CDependencyTrackPoint*& atleastDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CATLEASTDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CATLEASTDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initATLEASTDependencyNode(conDes,processIndi,prevDepTrackPoint); atleastDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CORDependencyNode* CDependencyFactory::createORDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CORDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CORDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initORDependencyNode(calcAlgContext->getUsedBranchTreeNode(),conDes,prevDepTrackPoint); } return depNode; } CATMOSTDependencyNode* CDependencyFactory::createATMOSTDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CATMOSTDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CATMOSTDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initATMOSTDependencyNode(calcAlgContext->getUsedBranchTreeNode(),conDes,processIndi,prevDepTrackPoint); } return depNode; } CMERGEDependencyNode* CDependencyFactory::createMERGEDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CMERGEDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CMERGEDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initMERGEDependencyNode(calcAlgContext->getUsedBranchTreeNode(),conDes,processIndi,prevDepTrackPoint); } return depNode; } CREUSEINDIVIDUALDependencyNode* CDependencyFactory::createREUSEINDIVIDUALDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CREUSEINDIVIDUALDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CREUSEINDIVIDUALDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initREUSEINDIVIDUALDependencyNode(calcAlgContext->getUsedBranchTreeNode(),conDes,processIndi,prevDepTrackPoint); } return depNode; } CREUSECOMPLETIONGRAPHDependencyNode* CDependencyFactory::createREUSECOMPLETIONGRAPHDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CREUSECOMPLETIONGRAPHDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CREUSECOMPLETIONGRAPHDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initREUSECOMPLETIONGRAPHDependencyNode(calcAlgContext->getUsedBranchTreeNode(),conDes,processIndi,prevDepTrackPoint); } return depNode; } CREUSECONCEPTSDependencyNode* CDependencyFactory::createREUSECONCEPTSDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CREUSECONCEPTSDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CREUSECONCEPTSDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initREUSECONCEPTSDependencyNode(calcAlgContext->getUsedBranchTreeNode(),conDes,processIndi,prevDepTrackPoint); } return depNode; } CQUALIFYDependencyNode* CDependencyFactory::createQUALIFYDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CQUALIFYDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CQUALIFYDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initQUALIFYDependencyNode(calcAlgContext->getUsedBranchTreeNode(),conDes,processIndi,prevDepTrackPoint); } return depNode; } CIMPLICATIONDependencyNode* CDependencyFactory::createIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext) { CIMPLICATIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CIMPLICATIONDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initIMPLICATIONDependencyNode(conDes,prevDepTrackPoint,prevOtherDependencies); implContinueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CEXPANDEDDependencyNode* CDependencyFactory::createEXPANDEDDependency(CDependencyTrackPoint*& expContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext) { CEXPANDEDDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CEXPANDEDDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initEXPANDEDDependencyNode(prevDepTrackPoint,prevOtherDependencies); expContinueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CCONNECTIONDependencyNode* CDependencyFactory::createCONNECTIONDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CCONNECTIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CCONNECTIONDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initCONNECTIONDependencyNode(conDes,prevDepTrackPoint); } return depNode; } CDATATYPETRIGGERDependencyNode* CDependencyFactory::createDATATYPETRIGGERDependency(CDependencyTrackPoint*& triggerContinueDepTrackPoint, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext) { CDATATYPETRIGGERDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CDATATYPETRIGGERDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initDATATYPETRIGGERDependencyNode(prevDepTrackPoint,prevOtherDependencies); triggerContinueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } CDATATYPECONNECTIONDependencyNode* CDependencyFactory::createDATATYPECONNECTIONDependency(CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CDATATYPECONNECTIONDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CDATATYPECONNECTIONDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initDATATYPECONNECTIONDependencyNode(prevDepTrackPoint); } return depNode; } CMERGEDIndividualDependencyNode* CDependencyFactory::createMERGEDINDIVIDUALDependency(CDependencyTrackPoint*& mergedIndividualContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* mergePrevDepTrackPoint, CDependencyTrackPoint* individualPrevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { CMERGEDIndividualDependencyNode* depNode = nullptr; if (mConfBuildDependencies) { depNode = CObjectParameterizingAllocator< CMERGEDIndividualDependencyNode,CProcessContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedProcessTaskMemoryAllocationManager(),calcAlgContext->getUsedProcessContext()); depNode->initMERGEDIndividualDependencyNode(processIndi,mergePrevDepTrackPoint,individualPrevDepTrackPoint); mergedIndividualContinueDepTrackPoint = depNode->getContinueDependencyTrackPoint(); } return depNode; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CDependencyFactory.h0000644000175000017500000005243512520551004027073 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CDEPENDENCYFACTORY_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CDEPENDENCYFACTORY_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" // Other includes #include "Reasoner/Kernel/Process/Dependency/CANDDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CSOMEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CVALUEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CROLEASSERTIONDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CNEGVALUEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CALLDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CATLEASTDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CORDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CAUTOMATTRANSACTIONDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CAUTOMATCHOOSEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CSELFDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CDISTINCTDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CNOMINALDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CFUNCTIONALDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CATMOSTDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CMERGEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CQUALIFYDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CMERGEDCONCEPTDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CMERGEDLINKDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CMERGEDIndividualDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CIMPLICATIONDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CEXPANDEDDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CCONNECTIONDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CREUSEINDIVIDUALDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CREUSECOMPLETIONGRAPHDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CREUSECONCEPTSDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CBINDVARIABLEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CPROPAGATEBINDINGDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEANDDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEIMPLICATIONDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CPROPAGATEBINDINGSSUCCESSORDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEALLDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CBINDPROPAGATECYCLEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CPROPAGATECONNECTIONDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CPROPAGATECONNECTIONAWAYDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEGROUNDINGDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEANDDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEALLDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLEBINDINGDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CVARBINDVARIABLEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEJOINDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEGROUNDINGDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLECONNECTIONDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEIMPLICATIONDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEANDDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CRESOLVEREPRESENTATIVEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEIMPLICATIONDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEALLDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEBINDVARIABLEDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEJOINDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEGROUNDINGDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CDATATYPETRIGGERDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CDATATYPECONNECTIONDependencyNode.h" #include "Utilities/Memory/CObjectParameterizingAllocator.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Algorithm { /*! * * \class CDependencyFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDependencyFactory { // public methods public: //! Constructor CDependencyFactory(); CREPRESENTATIVEGROUNDINGDependencyNode* createREPRESENTATIVEGROUNDINGDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CVariableBindingPath* selectVarBindPath, CCalculationAlgorithmContext* calcAlgContext); CREPRESENTATIVEJOINDependencyNode* createREPRESENTATIVEJOINDependency(CDependencyTrackPoint*& joinContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* otherDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CREPRESENTATIVEBINDVARIABLEDependencyNode* createREPRESENTATIVEBINDVARIABLEDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CREPRESENTATIVEIMPLICATIONDependencyNode* createREPRESENTATIVEIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext); CREPRESENTATIVEALLDependencyNode* createREPRESENTATIVEALLDependency(CDependencyTrackPoint*& allContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CREPRESENTATIVEANDDependencyNode* createREPRESENTATIVEANDDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CRESOLVEREPRESENTATIVEDependencyNode* createRESOLVEREPRESENTATIVEDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CRepresentativeVariableBindingPathMap* resolveVarBindPathMap, CRepresentativePropagationMap* resolveRepPropMap, CDependencyTrackPoint* additionalDepTrackPoint, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CVARBINDPROPAGATEALLDependencyNode* createVARBINDPROPAGATEALLDependency(CDependencyTrackPoint*& allContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CVARBINDPROPAGATEANDDependencyNode* createVARBINDPROPAGATEANDDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CPROPAGATEVARIABLEBINDINGDependencyNode* createPROPAGATEVARIABLEBINDINGDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext); CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode* createPROPAGATEVARIABLEBINDINGSSUCCESSORDependency(CDependencyTrackPoint*& allContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CVARBINDVARIABLEDependencyNode* createVARBINDVARIABLEDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CVARBINDPROPAGATEJOINDependencyNode* createVARBINDPROPAGATEJOINDependency(CDependencyTrackPoint*& mergeDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* otherDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CVARBINDPROPAGATEGROUNDINGDependencyNode* createVARBINDPROPAGATEGROUNDINGDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext); CPROPAGATEVARIABLECONNECTIONDependencyNode* createPROPAGATEVARIABLECONNECTIONDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CVARBINDPROPAGATEIMPLICATIONDependencyNode* createVARBINDPROPAGATEIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext); CBINDPROPAGATEGROUNDINGDependencyNode* createBINDPROPAGATEGROUNDINGDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext); CPROPAGATECONNECTIONAWAYDependencyNode* createPROPAGATECONNECTIONAWAYDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CPROPAGATECONNECTIONDependencyNode* createPROPAGATECONNECTIONDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CBINDPROPAGATECYCLEDependencyNode* createBINDPROPAGATECYCLEDependency(CDependencyTrackPoint*& continueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* triggDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CBINDPROPAGATEALLDependencyNode* createBINDPROPAGATEALLDependency(CDependencyTrackPoint*& allContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CPROPAGATEBINDINGSSUCCESSORDependencyNode* createPROPAGATEBINDINGSSUCCESSORDependency(CDependencyTrackPoint*& allContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CBINDPROPAGATEIMPLICATIONDependencyNode* createBINDPROPAGATEIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext); CBINDPROPAGATEANDDependencyNode* createBINDPROPAGATEANDDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CPROPAGATEBINDINGDependencyNode* createPROPAGATEBINDINGDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext); CBINDVARIABLEDependencyNode* createBINDVARIABLEDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CANDDependencyNode* createANDDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CSOMEDependencyNode* createSOMEDependency(CDependencyTrackPoint*& someContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CSELFDependencyNode* createSELFDependency(CDependencyTrackPoint*& selfContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CVALUEDependencyNode* createVALUEDependency(CDependencyTrackPoint*& valueContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CROLEASSERTIONDependencyNode* createROLEASSERTIONDependency(CDependencyTrackPoint*& roleAssDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CALLDependencyNode* createALLDependency(CDependencyTrackPoint*& allContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CATLEASTDependencyNode* createATLEASTDependency(CDependencyTrackPoint*& atleastContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CAUTOMATTRANSACTIONDependencyNode* createAUTOMATTRANSACTIONDependency(CDependencyTrackPoint*& allContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* linkDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CAUTOMATCHOOSEDependencyNode* createAUTOMATCHOOSEDependency(CDependencyTrackPoint*& andContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CDISTINCTDependencyNode* createDISTINCTDependency(CDependencyTrackPoint*& distinctContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CNEGVALUEDependencyNode* createNEGVALUEDependency(CDependencyTrackPoint*& negValueContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CNOMINALDependencyNode* createNOMINALDependency(CDependencyTrackPoint*& nominalContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* nominalDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CFUNCTIONALDependencyNode* createFUNCTIONALDependency(CDependencyTrackPoint*& functionalContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependencyTrackPoint* prevLink1DependencyTrackPoint, CDependencyTrackPoint* prevLink2DependencyTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CORDependencyNode* createORDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CATMOSTDependencyNode* createATMOSTDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CMERGEDependencyNode* createMERGEDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CREUSEINDIVIDUALDependencyNode* createREUSEINDIVIDUALDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CREUSECOMPLETIONGRAPHDependencyNode* createREUSECOMPLETIONGRAPHDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CREUSECONCEPTSDependencyNode* createREUSECONCEPTSDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CQUALIFYDependencyNode* createQUALIFYDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CMERGEDCONCEPTDependencyNode* createMERGEDCONCEPTDependency(CDependencyTrackPoint*& mergedConceptContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* mergePrevDepTrackPoint, CDependencyTrackPoint* conceptPrevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CMERGEDLINKDependencyNode* createMERGEDLINKDependency(CDependencyTrackPoint*& mergedLinkContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* mergePrevDepTrackPoint, CDependencyTrackPoint* linkPrevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CIMPLICATIONDependencyNode* createIMPLICATIONDependency(CDependencyTrackPoint*& implContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext); CEXPANDEDDependencyNode* createEXPANDEDDependency(CDependencyTrackPoint*& expContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext); CCONNECTIONDependencyNode* createCONNECTIONDependency(CIndividualProcessNode*& processIndi, CConceptDescriptor* conDes, CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CDATATYPETRIGGERDependencyNode* createDATATYPETRIGGERDependency(CDependencyTrackPoint*& triggerContinueDepTrackPoint, CDependencyTrackPoint* prevDepTrackPoint, CDependency* prevOtherDependencies, CCalculationAlgorithmContext* calcAlgContext); CDATATYPECONNECTIONDependencyNode* createDATATYPECONNECTIONDependency(CDependencyTrackPoint* prevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); CMERGEDIndividualDependencyNode* createMERGEDINDIVIDUALDependency(CDependencyTrackPoint*& mergedIndividualContinueDepTrackPoint, CIndividualProcessNode*& processIndi, CDependencyTrackPoint* mergePrevDepTrackPoint, CDependencyTrackPoint* individualPrevDepTrackPoint, CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: // protected variables protected: bool mConfBuildDependencies; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CDEPENDENCYFACTORY_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeRealValueSpaceHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeRealValueSpace0000644000175000017500000001017412520551010032240 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEREALVALUESPACEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEREALVALUESPACEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CCalculationClashProcessingException.h" #include "CDatatypeDependencyCollection.h" #include "CDependencyFactory.h" #include "CIndividualProcessNodeValueSpaceHandler.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Reasoner/Kernel/Process/Dependency/CDATATYPETRIGGERDependencyNode.h" #include "Reasoner/Kernel/Process/Dependency/CDATATYPECONNECTIONDependencyNode.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CIndividualProcessNodeRealValueSpaceHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeRealValueSpaceHandler : public CIndividualProcessNodeValueSpaceHandler { // public methods public: //! Constructor CIndividualProcessNodeRealValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType); virtual bool addDataLiteral(CIndividualProcessNode* indiProcNode, CDataLiteral* dataLiteral, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); virtual bool addDataRestriction(CIndividualProcessNode* indiProcNode, CConcept* dataRestricionConcept, bool negated, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext); virtual bool testValueSpaceClashed(CIndividualProcessNode* indiProcNode, CCalculationAlgorithmContext* calcAlgContext); virtual CConceptDescriptor* triggerValueSpaceConcepts(CIndividualProcessNode* indiProcNode, CConceptDescriptor* appendConceptLinker, cint64& remainingRequiredValuesCount, CDatatypeDependencyCollection* depCollection, CCalculationAlgorithmContext* calcAlgContext); virtual bool addValueSpaceDependencies(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceDependencyCollector* depCollection, CCalculationAlgorithmContext* calcAlgContext); virtual bool countPossibleValueSpaceValues(CIndividualProcessNode* indiProcNode, CDatatypeValueSpaceValuesCounter* valueCounter, CCalculationAlgorithmContext* calcAlgContext); virtual bool getNextPossibleDataValue(CIndividualProcessNode* indiProcNode, CDataLiteralValue*& nextValue, CDataLiteralValue* lastValue, CDatatypeValueTestingCollection* valueTestingCollection, CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: // protected variables protected: CDatatypeValueSpaceRealType* mRealValueSpaceType; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEREALVALUESPACEHANDLER_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSaturationNodeBackendAssociationCacheHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSaturationNodeBackendAssociationCac0000644000175000017500000005513212520551014032250 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationNodeBackendAssociationCacheHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CSaturationNodeBackendAssociationCacheHandler::CSaturationNodeBackendAssociationCacheHandler(CBackendRepresentativeMemoryCacheReader* backAssCacheReader, CBackendRepresentativeMemoryCacheWriter* backAssCacheWriter) { mAssBackCacheReader = backAssCacheReader; mAssBackCacheWriter = backAssCacheWriter; mStatCreatedTempLabels = 0; mStatReusedTempLabels = 0; mStatReusedCachedLabels = 0; mStatReusedHashedIndiLabels = 0; mStatReusedHashedSignatureLabels = 0; mTmpContext = nullptr; mMemAllocMan = nullptr; mWriteData = nullptr; mConfDirectCardinalityInsufficient = false; } CBackendRepresentativeMemoryCacheIndividualAssociationData* CSaturationNodeBackendAssociationCacheHandler::getIndividualAssociation(CIndividual* individual, CCalculationAlgorithmContext* calcAlgContext) { return mAssBackCacheReader->getIndividualAssociation(individual); } bool CSaturationNodeBackendAssociationCacheHandler::prepareCacheMessages(CCalculationAlgorithmContext* calcAlgContext) { if (!mMemAllocMan) { CTaskMemoryPoolAllocationManager satCacheMemManCreaterMemMan(&mMemPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mMemAllocMan = CObjectAllocator::allocateAndConstruct(&satCacheMemManCreaterMemMan); mMemAllocMan->initTaskMemoryPoolAllocationManager(&mMemPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mTmpContext = CObjectParameterizingAllocator< CContextBase,CMemoryAllocationManager* >::allocateAndConstructAndParameterize(mMemAllocMan,mMemAllocMan); return true; } return false; } bool CSaturationNodeBackendAssociationCacheHandler::commitCacheMessages(CCalculationAlgorithmContext* calcAlgContext) { if (mWriteData) { CBackendRepresentativeMemoryCacheLabelAssociationWriteData* commitWriteData = nullptr; CBackendRepresentativeMemoryCacheLabelAssociationWriteData* writeDataIt = mWriteData; while (writeDataIt) { CBackendRepresentativeMemoryCacheLabelAssociationWriteData* tmpWriteData = writeDataIt; writeDataIt = (CBackendRepresentativeMemoryCacheLabelAssociationWriteData*)writeDataIt->getNext(); tmpWriteData->clearNext(); if (commitWriteData) { commitWriteData = (CBackendRepresentativeMemoryCacheLabelAssociationWriteData*)tmpWriteData->append(commitWriteData); } else { commitWriteData = tmpWriteData; } } mAssBackCacheWriter->writeCachedData(commitWriteData,mMemPoolCon.takeMemoryPools()); mWriteData = nullptr; mMemAllocMan = nullptr; mTmpContext = nullptr; return true; } return false; } bool CSaturationNodeBackendAssociationCacheHandler::addCacheMessages(CBackendRepresentativeMemoryCacheLabelAssociationWriteData* backAssWriteData, CCalculationAlgorithmContext* calcAlgContext) { if (mWriteData) { mWriteData = (CBackendRepresentativeMemoryCacheLabelAssociationWriteData*)backAssWriteData->append(mWriteData); } else { mWriteData = backAssWriteData; } return true; } bool CSaturationNodeBackendAssociationCacheHandler::findAssociationBackendCardinality(CIndividualSaturationProcessNode* satNode, CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tmpAssWriteDataLinker, CCalculationAlgorithmContext* calcAlgContext) { CIndividualSaturationProcessNodeStatusFlags* directIndFlags = satNode->getIndirectStatusFlags(); CIndividualSaturationProcessNodeStatusFlags* indirectIndFlags = satNode->getIndirectStatusFlags(); CIndividualSaturationProcessNodeStatusFlags* dirFlags = satNode->getDirectStatusFlags(); bool insufficient = indirectIndFlags->hasInsufficientFlag() || !indirectIndFlags->hasCompletedFlag() || !dirFlags->hasCompletedFlag(); if (!insufficient && directIndFlags->hasCardinalityRestrictedFlag()) { if (mConfDirectCardinalityInsufficient) { tmpAssWriteDataLinker->setCompletelyHandled(false); tmpAssWriteDataLinker->setCompletelySaturated(false); } else { CReapplyConceptSaturationLabelSet* conSet = satNode->getReapplyConceptSaturationLabelSet(false); if (!conSet) { return false; } CIndividualSaturationProcessNode* copiedNode = satNode->getCopyIndividualNode(); if (copiedNode && copiedNode->getReapplyConceptSaturationLabelSet(false) && copiedNode->getReapplyConceptSaturationLabelSet(false)->getConceptSaturationDescriptionLinker() == conSet->getConceptSaturationDescriptionLinker()) { return findAssociationBackendCardinality(copiedNode,tmpAssWriteDataLinker,calcAlgContext); } QPair* hashedRefPair = nullptr; if (satNode->getNominalIndividual() == nullptr) { QPair& refPair = (*mIndiNodeRefCardHash)[satNode]; if (refPair.first) { tmpAssWriteDataLinker->setReferredCardinalityData(refPair.first); ++mStatReusedHashedIndiLabels; return true; } else if (refPair.second) { tmpAssWriteDataLinker->setReferredTemporaryCardinalityData(refPair.second); ++mStatReusedHashedIndiLabels; return true; } hashedRefPair = &refPair; } CPROCESSHASH* roleFreeCardHash = CObjectParameterizingAllocator< CPROCESSHASH,CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); for (CConceptSaturationDescriptor* conSatDesIt = conSet->getConceptSaturationDescriptionLinker(); conSatDesIt; conSatDesIt = conSatDesIt->getNext()) { CConcept* concept = conSatDesIt->getConcept(); bool negation = conSatDesIt->isNegated(); cint64 conOpCode = concept->getOperatorCode(); if (!negation && conOpCode == CCATMOST || negation && conOpCode == CCATLEAST) { CRole* role = concept->getRole(); cint64 cardinality = concept->getParameter(); if (negation) { cardinality -= 1; } cint64 freeCardinality = 0; CLinkedRoleSaturationSuccessorHash* linkedSuccHash = satNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { cint64 foundCardinality = 0; CPROCESSHASH* succHash = linkedSuccHash->getLinkedRoleSuccessorHash(); CLinkedRoleSaturationSuccessorData* succData = succHash->value(role); if (succData && succData->mSuccCount > 0) { freeCardinality = cardinality - succData->mSuccCount; if (freeCardinality < 0) { freeCardinality = 0; } cint64& roleCard = (*roleFreeCardHash)[role]; if (roleCard > freeCardinality || roleCard < 0) { roleCard = freeCardinality; } } } } } cint64 roleCardSigValue = 0; for (CPROCESSHASH::const_iterator it = roleFreeCardHash->constBegin(), itEnd = roleFreeCardHash->constEnd(); it != itEnd; ++it) { CRole* role(it.key()); cint64 freeCard(it.value()); roleCardSigValue += role->getRoleTag(); roleCardSigValue += (cint64)role; roleCardSigValue += freeCard; } CBackendRepresentativeMemoryCardinalityCacheItem* cachedCardItem = mAssBackCacheReader->getCardinalityCacheEntry(roleCardSigValue,roleFreeCardHash); if (cachedCardItem) { ++mStatReusedCachedLabels; if (hashedRefPair) { hashedRefPair->first = cachedCardItem; } tmpAssWriteDataLinker->setReferredCardinalityData(cachedCardItem); return true; } CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker*& prevTempRefCards = (*mSignatureTmpRefCardHash)[roleCardSigValue]; if (prevTempRefCards) { for (CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* prevTempRefCardIt = prevTempRefCards; prevTempRefCardIt; prevTempRefCardIt = prevTempRefCardIt->getNext()) { if (prevTempRefCardIt->getCardinalityCacheValueCount() == roleFreeCardHash->size()) { bool compatibleCards = true; for (CBackendRepresentativeMemoryCardinalityValueLinker* cardValueLinkerIt = prevTempRefCardIt->getCardinalityCacheValueLinker(); cardValueLinkerIt && compatibleCards; cardValueLinkerIt = cardValueLinkerIt->getNext()) { CCacheValue& cacheValue = cardValueLinkerIt->getCacheValue(); CRole* role = (CRole*)cacheValue.getIdentification(); if (roleFreeCardHash->contains(role)) { if (roleFreeCardHash->value(role) != cardValueLinkerIt->getFreeCardinality()) { compatibleCards = false; } } else { compatibleCards = false; } } if (compatibleCards) { ++mStatReusedHashedSignatureLabels; ++mStatReusedTempLabels; if (hashedRefPair) { hashedRefPair->second = prevTempRefCardIt; } tmpAssWriteDataLinker->setReferredTemporaryCardinalityData(prevTempRefCardIt); return true; } } } } CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* newTempRefCard = CObjectAllocator< CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker >::allocateAndConstruct(mMemAllocMan); newTempRefCard->initLabelWriteData(roleCardSigValue); for (CPROCESSHASH::const_iterator it = roleFreeCardHash->constBegin(), itEnd = roleFreeCardHash->constEnd(); it != itEnd; ++it) { CRole* role(it.key()); cint64 freeCard(it.value()); CBackendRepresentativeMemoryCardinalityValueLinker* cardValueLinker = CObjectAllocator< CBackendRepresentativeMemoryCardinalityValueLinker >::allocateAndConstruct(mMemAllocMan); cardValueLinker->initCardinalityValueLinker(getCacheValue(role),freeCard); newTempRefCard->appendCardinalityCacheValueLinker(cardValueLinker); } mNewTmpCardList->append(newTempRefCard); ++mStatCreatedTempLabels; if (hashedRefPair) { hashedRefPair->second = newTempRefCard; } tmpAssWriteDataLinker->setReferredTemporaryCardinalityData(newTempRefCard); prevTempRefCards = newTempRefCard->append(prevTempRefCards); } return true; } return false; } bool CSaturationNodeBackendAssociationCacheHandler::findAssociationBackendLabel(CIndividualSaturationProcessNode* satNode, CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tmpAssWriteDataLinker, CCalculationAlgorithmContext* calcAlgContext) { CReapplyConceptSaturationLabelSet* conSet = satNode->getReapplyConceptSaturationLabelSet(false); if (!conSet) { return false; } CIndividualSaturationProcessNode* copiedNode = satNode->getCopyIndividualNode(); if (copiedNode && copiedNode->getReapplyConceptSaturationLabelSet(false) && copiedNode->getReapplyConceptSaturationLabelSet(false)->getConceptSaturationDescriptionLinker() == conSet->getConceptSaturationDescriptionLinker()) { return findAssociationBackendLabel(copiedNode,tmpAssWriteDataLinker,calcAlgContext); } QPair* hashedRefPair = nullptr; if (satNode->getNominalIndividual() == nullptr) { QPair& refPair = (*mIndiNodeRefLabelHash)[satNode]; if (refPair.first) { tmpAssWriteDataLinker->setReferredLabelData(refPair.first); ++mStatReusedHashedIndiLabels; return true; } else if (refPair.second) { tmpAssWriteDataLinker->setReferredTemporaryLabelData(refPair.second); ++mStatReusedHashedIndiLabels; return true; } hashedRefPair = &refPair; } CConceptSetSignature conSetSignature; for (CConceptSaturationDescriptor* conSatDesIt = conSet->getConceptSaturationDescriptionLinker(); conSatDesIt; conSatDesIt = conSatDesIt->getNext()) { CConcept* concept = conSatDesIt->getConcept(); bool negation = conSatDesIt->isNegated(); conSetSignature.addConceptSignature(concept,negation); } cint64 conSetSigValue = conSetSignature.getSignatureValue(); CBackendRepresentativeMemoryLabelCacheItem* cachedLabelItem = mAssBackCacheReader->getLabelCacheEntry(conSetSigValue,conSet->getConceptCount(),conSet->getConceptSaturationDescriptionLinker()); if (cachedLabelItem) { ++mStatReusedCachedLabels; if (hashedRefPair) { hashedRefPair->first = cachedLabelItem; } tmpAssWriteDataLinker->setReferredLabelData(cachedLabelItem); return true; } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker*& prevTempRefLabels = (*mSignatureTmpRefLabelHash)[conSetSigValue]; if (prevTempRefLabels) { for (CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* prevTempRefLabelIt = prevTempRefLabels; prevTempRefLabelIt; prevTempRefLabelIt = prevTempRefLabelIt->getNext()) { if (prevTempRefLabelIt->getDeterministicCacheValueCount() == conSet->getConceptCount()) { bool compatibleConcepts = true; for (CBackendRepresentativeMemoryLabelValueLinker* labelValueLinkerIt = prevTempRefLabelIt->getDeterministicCacheValueLinker(); labelValueLinkerIt && compatibleConcepts; labelValueLinkerIt = labelValueLinkerIt->getNext()) { CCacheValue& cacheValue = labelValueLinkerIt->getCacheValue(); CConcept* concept = (CConcept*)cacheValue.getIdentification(); bool negation = cacheValue.getCacheValueIdentifier() == CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; if (!conSet->hasConcept(concept,negation)) { compatibleConcepts = false; } } if (compatibleConcepts) { ++mStatReusedHashedSignatureLabels; ++mStatReusedTempLabels; if (hashedRefPair) { hashedRefPair->second = prevTempRefLabelIt; } tmpAssWriteDataLinker->setReferredTemporaryLabelData(prevTempRefLabelIt); return true; } } } } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* newTempRefLabel = CObjectAllocator< CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker >::allocateAndConstruct(mMemAllocMan); newTempRefLabel->initLabelWriteData(conSetSigValue); CIndividualSaturationProcessNodeStatusFlags* indFlags = satNode->getIndirectStatusFlags(); CIndividualSaturationProcessNodeStatusFlags* dirFlags = satNode->getDirectStatusFlags(); bool insufficient = indFlags->hasInsufficientFlag() || !indFlags->hasCompletedFlag() || !dirFlags->hasCompletedFlag(); if (!insufficient) { newTempRefLabel->setCompletelySaturated(true); newTempRefLabel->setCompletelyHandled(true); } for (CConceptSaturationDescriptor* conSatDesIt = conSet->getConceptSaturationDescriptionLinker(); conSatDesIt; conSatDesIt = conSatDesIt->getNext()) { CConcept* concept = conSatDesIt->getConcept(); bool negation = conSatDesIt->isNegated(); CBackendRepresentativeMemoryLabelValueLinker* labelValueLinker = CObjectAllocator< CBackendRepresentativeMemoryLabelValueLinker >::allocateAndConstruct(mMemAllocMan); labelValueLinker->initLabelValueLinker(getCacheValue(concept,negation)); newTempRefLabel->appendDeterministicCacheValueLinker(labelValueLinker); } mNewTmpLabelList->append(newTempRefLabel); ++mStatCreatedTempLabels; if (hashedRefPair) { hashedRefPair->second = newTempRefLabel; } tmpAssWriteDataLinker->setReferredTemporaryLabelData(newTempRefLabel); prevTempRefLabels = newTempRefLabel->append(prevTempRefLabels); return true; } const CCacheValue CSaturationNodeBackendAssociationCacheHandler::getCacheValue(CConcept* concept, bool negation) { return mAssBackCacheReader->getCacheValue(concept,negation); } const CCacheValue CSaturationNodeBackendAssociationCacheHandler::getCacheValue(CRole* role) { return mAssBackCacheReader->getCacheValue(role); } bool CSaturationNodeBackendAssociationCacheHandler::tryAssociateNodesWithBackendCache(CIndividualSaturationProcessNodeLinker* indiSaturationAnalysingNodeLinker, CCalculationAlgorithmContext* calcAlgContext) { mIndiNodeRefLabelHash = CObjectParameterizingAllocator< CPROCESSHASH< CIndividualSaturationProcessNode*,QPair >, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); mSignatureTmpRefLabelHash = CObjectParameterizingAllocator< CPROCESSHASH, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); mIndiNodeRefCardHash = CObjectParameterizingAllocator< CPROCESSHASH< CIndividualSaturationProcessNode*,QPair >, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); mSignatureTmpRefCardHash = CObjectParameterizingAllocator< CPROCESSHASH, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); mNewTmpLabelList = CObjectParameterizingAllocator< CPROCESSLIST< CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* >, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); mNewTmpCardList = CObjectParameterizingAllocator< CPROCESSLIST< CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* >, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); prepareCacheMessages(calcAlgContext); CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tmpAssWriteDataLinker = nullptr; for (CIndividualSaturationProcessNodeLinker* indiSaturationAnalysingNodeLinkerIt = indiSaturationAnalysingNodeLinker; indiSaturationAnalysingNodeLinkerIt; indiSaturationAnalysingNodeLinkerIt = indiSaturationAnalysingNodeLinkerIt->getNext()) { CIndividualSaturationProcessNode* satNode = indiSaturationAnalysingNodeLinkerIt->getProcessingIndividual(); CIndividual* nominalIndividual = satNode->getNominalIndividual(); if (nominalIndividual) { CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* newAssWriteDataLinker = CObjectAllocator< CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker >::allocateAndConstruct(mMemAllocMan); newAssWriteDataLinker->initAccociationWriteData(nominalIndividual); findAssociationBackendLabel(satNode,newAssWriteDataLinker,calcAlgContext); findAssociationBackendCardinality(satNode,newAssWriteDataLinker,calcAlgContext); CIndividualSaturationProcessNodeStatusFlags* indFlags = satNode->getIndirectStatusFlags(); CIndividualSaturationProcessNodeStatusFlags* dirFlags = satNode->getDirectStatusFlags(); bool insufficient = indFlags->hasInsufficientFlag() || !indFlags->hasCompletedFlag() || !dirFlags->hasCompletedFlag(); if (insufficient) { newAssWriteDataLinker->setCompletelySaturated(false); newAssWriteDataLinker->setCompletelyHandled(false); } tmpAssWriteDataLinker = newAssWriteDataLinker->append(tmpAssWriteDataLinker); } } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* tempLabelWriteDataLinker = nullptr; for (CPROCESSLIST< CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* >::const_iterator it = mNewTmpLabelList->constBegin(), itEnd = mNewTmpLabelList->constEnd(); it != itEnd; ++it) { CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* newTmpLabelLinker = (*it); newTmpLabelLinker->clearNext(); tempLabelWriteDataLinker = newTmpLabelLinker->append(tempLabelWriteDataLinker); } CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* tempCardWriteDataLinker = nullptr; for (CPROCESSLIST< CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* >::const_iterator it = mNewTmpCardList->constBegin(), itEnd = mNewTmpCardList->constEnd(); it != itEnd; ++it) { CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* newTmpCardLinker = (*it); newTmpCardLinker->clearNext(); tempCardWriteDataLinker = newTmpCardLinker->append(tempCardWriteDataLinker); } CBackendRepresentativeMemoryCacheLabelAssociationWriteData* writeData = CObjectAllocator< CBackendRepresentativeMemoryCacheLabelAssociationWriteData >::allocateAndConstruct(mMemAllocMan); writeData->initWriteData(tmpAssWriteDataLinker,tempLabelWriteDataLinker,tempCardWriteDataLinker); addCacheMessages(writeData,calcAlgContext); commitCacheMessages(calcAlgContext); return false; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskPossibleAssertionCollectingAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskPossibleAssertionCol0000644000175000017500000000616612520551014032340 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKPOSSIBLEASSERTIONCOLLECTINGANALYSER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKPOSSIBLEASSERTIONCOLLECTINGANALYSER_H // Libraries includes // Namespace includes #include "CCalculationAlgorithmContext.h" // Other includes #include "Context/CContextBase.h" #include "Reasoner/Realizer/CRealizationMessageObserver.h" #include "Reasoner/Realizer/CRealizationMarkerCandidatesMessageData.h" #include "Reasoner/Consistiser/CSaturationConceptDataItem.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" #include "Reasoner/Kernel/Task/CConsistenceTaskData.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyNode.h" #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { using namespace Consistiser; using namespace Realizer; using namespace Ontology; namespace Kernel { using namespace Task; using namespace Process::Dependency; namespace Algorithm { /*! * * \class CSatisfiableTaskPossibleAssertionCollectingAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableTaskPossibleAssertionCollectingAnalyser { // public methods public: //! Constructor CSatisfiableTaskPossibleAssertionCollectingAnalyser(); bool readCalculationConfig(CCalculationConfigurationExtension *config); bool analyseSatisfiableTask(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContext* calcAlgContext); CIndividualProcessNode* getCorrectedIndividualNode(cint64 baseIndiID, CIndividualProcessNodeVector* indiNodeVec); CSatisfiableCalculationTask* getCachedDeterministicCompletionGraphTask(CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKPOSSIBLEASSERTIONCOLLECTINGANALYSER_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableConsistencyPreyingAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableConsistencyPreyingAnalys0000644000175000017500000000367212520551012032413 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLECONSISTENCYPREYINGANALYSER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLECONSISTENCYPREYINGANALYSER_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { /*! * * \class CSatisfiableConsistencyPreyingAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableConsistencyPreyingAnalyser { // public methods public: //! Constructor CSatisfiableConsistencyPreyingAnalyser(); //! Destructor virtual ~CSatisfiableConsistencyPreyingAnalyser(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLECONSISTENCYPREYINGANALYSER_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeIRIValueSpaceHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeIRIValueSpaceH0000644000175000017500000000241112520551010032103 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessNodeIRIValueSpaceHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualProcessNodeIRIValueSpaceHandler::CIndividualProcessNodeIRIValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType) : CIndividualProcessNodeCompareValueSpaceHandler(valueSpaceType) { } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskConsistencyPreyingAnalyser.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskConsistencyPreyingAn0000644000175000017500000000455612520551014032351 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKCONSISTENCYPREYINGANALYSER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKCONSISTENCYPREYINGANALYSER_H // Libraries includes // Namespace includes #include "CCalculationAlgorithmContext.h" #include "CSatisfiableConsistencyPreyingAnalyser.h" // Other includes #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" #include "Reasoner/Kernel/Task/CConsistenceTaskData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Task; namespace Algorithm { /*! * * \class CSatisfiableTaskConsistencyPreyingAnalyser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableTaskConsistencyPreyingAnalyser : public CSatisfiableConsistencyPreyingAnalyser { // public methods public: //! Constructor CSatisfiableTaskConsistencyPreyingAnalyser(); //! Destructor virtual ~CSatisfiableTaskConsistencyPreyingAnalyser(); bool analyseSatisfiableTask(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CSATISFIABLETASKCONSISTENCYPREYINGANALYSER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CTrackedClashedDescriptorHasher.h0000644000175000017500000000515112520551016031514 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CTRACKEDCLASHEDDESCRIPTORHASHER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CTRACKEDCLASHEDDESCRIPTORHASHER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CTrackedClashedDescriptor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Kernel { using namespace Process; namespace Algorithm { /*! * * \class CTrackedClashedDescriptorHasher * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTrackedClashedDescriptorHasher { // public methods public: //! Constructor CTrackedClashedDescriptorHasher(CTrackedClashedDescriptor* trackedClashedDescriptor); CTrackedClashedDescriptorHasher(const CTrackedClashedDescriptorHasher& hasher); cint64 getDescriptorHashValue() const; bool operator==(const CTrackedClashedDescriptorHasher& clashedDesHasher) const; // protected methods protected: cint64 calculateDescriptorHashValue(CTrackedClashedDescriptor* des); // protected variables protected: CTrackedClashedDescriptor* mTrackedClashedDes; cint64 mHashValue; // private methods private: // private variables private: }; inline uint qHash(const CTrackedClashedDescriptorHasher& desHasher) { qint64 key = (qint64)desHasher.getDescriptorHashValue(); if (sizeof(quint64) > sizeof(uint)) { return uint((key >> (8 * sizeof(uint) - 1)) ^ key); } else { return uint(key); } } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CTRACKEDCLASHEDDESCRIPTORHASHER_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskClassificationMessageAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskClassificationMessag0000644000175000017500000032765412520551012032333 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableTaskClassificationMessageAnalyser.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CSatisfiableTaskClassificationMessageAnalyser::CSatisfiableTaskClassificationMessageAnalyser() { mConfAnalyseSubSumptions = true; mConfAnalyseAllSubSumptions = false; mConfAnalyseIdentifierOccurence = true; mConfAnalysePossibleSubSumptions = true; mMaxPossibleSubsumerNegationCheckingDepth = 5; mMaxModelAnalysingDepth = 20; mConfStopAnalyseWhenNotChanging = true; mEquivalentAlternativesSaturationMerging = true; mStatSuccessorModelMergingTestCount = 0; } bool CSatisfiableTaskClassificationMessageAnalyser::readCalculationConfig(CCalculationConfigurationExtension *config) { mConfAnalyseSubSumptions = true; mConfAnalyseAllSubSumptions = false; mConfAnalyseIdentifierOccurence = true; mConfAnalysePossibleSubSumptions = true; mConfStopAnalyseWhenNotChanging = true; mEquivalentAlternativesSaturationMerging = true; if (config) { mEquivalentAlternativesSaturationMerging = config->isEquivalentAlternativesSaturationMergingActivated(); return true; } return false; } CIndividualProcessNode* CSatisfiableTaskClassificationMessageAnalyser::getCorrectedIndividualID(CIndividualProcessNode* baseIndiNode, CIndividualProcessNodeVector* indiNodeVec, bool* nondetMergedFlag) { CIndividualProcessNode* indi = indiNodeVec->getData(baseIndiNode->getIndividualID()); while (indi->hasMergedIntoIndividualNodeID()) { if (nondetMergedFlag && *nondetMergedFlag == false) { if (!indi->getMergedDependencyTrackPoint() || indi->getMergedDependencyTrackPoint()->getBranchingTag() > 0) { *nondetMergedFlag = true; } } indi = indiNodeVec->getData(indi->getMergedIntoIndividualNodeID()); } return indi; } bool CSatisfiableTaskClassificationMessageAnalyser::hasDependencyToAncestor(CIndividualProcessNode* individualNode, CDependencyTrackPoint* depTrackPoint, CCalculationAlgorithmContext* calcAlgContext) { cint64 ancDepth = individualNode->getIndividualAncestorDepth(); bool dependencyToAncestor = false; if (ancDepth <= 0) { dependencyToAncestor = depTrackPoint->isPointingToIndependentDependencyNode(); } else { CDependencyNode* depNode = depTrackPoint->getDependencyNode(); if (depNode->hasAppropriateIndividualNode()) { CIndividualProcessNode* appIndiNode = depNode->getAppropriateIndividualNode(); cint64 appIndiAncDepth = appIndiNode->getIndividualAncestorDepth(); dependencyToAncestor = appIndiAncDepth < ancDepth; } else { CDependencyNode::DEPENDENCNODEYTYPE depType = depNode->getDependencyType(); if (depType == CDependencyNode::DNTMERGEDCONCEPT) { dependencyToAncestor = hasDependencyToAncestor(individualNode,depNode->getPreviousDependencyTrackPoint(),calcAlgContext); } } } return dependencyToAncestor; } CConceptDescriptor* CSatisfiableTaskClassificationMessageAnalyser::getIndividualProcessNodeConceptWithSingleAncestorDependency(CIndividualProcessNode* indiNode, CIndividualAnalyseProcessItem* indiAnProcItem, CCalculationAlgorithmContext* calcAlgContext) { if (indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { return nullptr; } CConceptDescriptor* singleAncDepConceptDes = nullptr; CReapplyConceptLabelSet* conSet = indiNode->getReapplyConceptLabelSet(false); CConceptDescriptor* conDesIt = conSet->getAddingSortedConceptDescriptionLinker(); while (conDesIt) { CConceptDescriptor* conDes = conDesIt; if (conDes->getConceptTag() != 1) { CDependencyTrackPoint* depTrackPoint = conDes->getDependencyTrackPoint(); if (depTrackPoint) { if (hasDependencyToAncestor(indiNode,depTrackPoint,calcAlgContext)) { if (singleAncDepConceptDes != nullptr) { return nullptr; } singleAncDepConceptDes = conDes; } } else { return nullptr; } } conDesIt = conDesIt->getNext(); } return singleAncDepConceptDes; } bool CSatisfiableTaskClassificationMessageAnalyser::testSubsumerCandidatePossibleWithMergedSaturatedModel(CIndividualProcessNode* indiNode, CConcept* equivConcept, CCalculationAlgorithmContext* calcAlgContext) { CTaskProcessorContext* taskProcessorContext = calcAlgContext->getUsedTaskProcessorContext(); if (mEquivalentAlternativesSaturationMerging) { if (!mTestSaturatedMergedHash) { mTestSaturatedMergedHash = CObjectParameterizingAllocator< CPROCESSINGHASH< QPair,CSaturatedMergedTestItem >,CContext* >::allocateAndConstructAndParameterize(taskProcessorContext->getMemoryAllocationManager(),taskProcessorContext); } if (mLastMergingTestNode != indiNode) { mLastMergingTestNode = indiNode; mTestSaturatedMergedHash->clear(); } STATINC(ANALYSECANDIDATECONCEPTSATURATEDALTERNATIVETESTCOUNT,calcAlgContext); if (equivConcept->getOperatorCode() == CCEQ) { CPROCESSINGSET< QPair > alternativesSet(taskProcessorContext); bool oneMergeSatisfieableFlag = false; bool allMergeUnsatisfieableFlag = true; if (collectEquivalenceConceptAlternatives(indiNode,equivConcept,true,alternativesSet,mTestSaturatedMergedHash,oneMergeSatisfieableFlag,allMergeUnsatisfieableFlag,calcAlgContext)) { if (oneMergeSatisfieableFlag) { STATINC(ANALYSECANDIDATECONCEPTSATURATEDALTERNATIVEFOUNDCOUNT,calcAlgContext); return false; } } else { if (testEquivalenceConceptAlternatives(indiNode,alternativesSet,mTestSaturatedMergedHash,oneMergeSatisfieableFlag,allMergeUnsatisfieableFlag,calcAlgContext)) { if (oneMergeSatisfieableFlag) { STATINC(ANALYSECANDIDATECONCEPTSATURATEDALTERNATIVEFOUNDCOUNT,calcAlgContext); return false; } } } } } return true; } bool CSatisfiableTaskClassificationMessageAnalyser::testConceptSetWithSaturatedModelMergable(CIndividualProcessNode* indiNode, CIndividualSaturationProcessNode* saturationIndiNode, bool& mergeClashedFlag, CCalculationAlgorithmContext* calcAlgContext) { STATINC(ANALYSECANDIDATECONCEPTSATURATEDCONCEPTSETMERGINGCOUNT,calcAlgContext); CReapplyConceptSaturationLabelSet* saturatedConSet = saturationIndiNode->getReapplyConceptSaturationLabelSet(false); CReapplyConceptLabelSet* conSet = indiNode->getReapplyConceptLabelSet(false); bool mergedConceptsClashed = saturationIndiNode->getIndirectStatusFlags()->hasFlags(CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED,false); if (saturatedConSet && conSet) { CReapplyConceptSaturationLabelSetIterator satConSetIt(saturatedConSet->getIterator(true,true)); while (satConSetIt.hasNext() && !mergedConceptsClashed) { cint64 dataTag = satConSetIt.getDataTag(); CConceptSaturationDescriptor* satConDes = satConSetIt.getConceptSaturationDescriptor(); CImplicationReapplyConceptSaturationDescriptor* satReapplyDes = satConSetIt.getImplicationReapplyConceptSaturationDescriptor(); CConceptDescriptor* conDes = nullptr; CDependencyTrackPoint* depTrackPoint = nullptr; CCondensedReapplyQueue* reapplyQueue = nullptr; if (conSet->getConceptDescriptorOrReapplyQueue(dataTag,conDes,depTrackPoint,reapplyQueue)) { if (conDes && satConDes) { if (conDes->isNegated() != satConDes->isNegated()) { mergedConceptsClashed = true; } } else if (conDes) { if (!conDes->isNegated() && satReapplyDes) { return false; } } else if (satConDes) { if (!satConDes->isNegated() && reapplyQueue && !reapplyQueue->isEmpty()) { return false; } } } satConSetIt.moveNext(); } if (mergedConceptsClashed) { mergeClashedFlag = true; } return true; } return false; } bool CSatisfiableTaskClassificationMessageAnalyser::testRoleSuccessorsWithSaturatedModelMergable(CIndividualProcessNode* indiNode, CIndividualSaturationProcessNode* saturationIndiNode, CCalculationAlgorithmContext* calcAlgContext) { STATINC(ANALYSECANDIDATECONCEPTSATURATEDROLESUCCESSORMERGINGCOUNT,calcAlgContext); CReapplyRoleSuccessorHash* roleSuccHash = indiNode->getReapplyRoleSuccessorHash(false); CReapplyConceptLabelSet* conSet = indiNode->getReapplyConceptLabelSet(false); CRoleBackwardSaturationPropagationHash* roleBackPropHash = saturationIndiNode->getRoleBackwardPropagationHash(false); if (roleSuccHash && roleBackPropHash) { CPROCESSHASH* roleBackPropDataHash = roleBackPropHash->getRoleBackwardPropagationDataHash(); for (CPROCESSHASH::const_iterator it = roleBackPropDataHash->constBegin(), itEnd = roleBackPropDataHash->constEnd(); it != itEnd; ++it) { CRole* role = it.key(); const CRoleBackwardSaturationPropagationHashData& backPropData = it.value(); CBackwardSaturationPropagationReapplyDescriptor* reapplyLinker = backPropData.mReapplyLinker; if (reapplyLinker) { CRoleSuccessorLinkIterator roleSuccIt(roleSuccHash->getRoleSuccessorLinkIterator(role)); if (roleSuccIt.hasNext()) { for (CBackwardSaturationPropagationReapplyDescriptor* reapplyLinkerIt = reapplyLinker; reapplyLinkerIt; reapplyLinkerIt = reapplyLinkerIt->getNext()) { CConceptSaturationDescriptor* conSatDes = reapplyLinkerIt->getReapplyConceptSaturationDescriptor(); CConcept* concept = conSatDes->getConcept(); bool negation = conSatDes->isNegated(); if (!conSet || !conSet->containsConcept(concept,negation)) { CRoleSuccessorLinkIterator roleSucc2It(roleSuccIt); while (roleSucc2It.hasNext()) { CIndividualLinkEdge* succLink = roleSucc2It.next(true); CIndividualProcessNode* succIndi = nullptr; if (succLink->isLocalizationTagUpToDate(calcAlgContext->getUsedProcessTagger()->getCurrentLocalizationTag())) { succIndi = succLink->getOppositeIndividual(indiNode); } else { if (!succIndi->isLocalizationTagUpToDate(calcAlgContext->getUsedProcessTagger()->getCurrentLocalizationTag()) && succIndi->isRelocalized()) { cint64 succIndiId = succLink->getOppositeIndividualID(indiNode); CIndividualProcessNodeVector* indiProcNodeVec = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); succIndi = indiProcNodeVec->getData(succIndiId); } } CReapplyConceptLabelSet* succConSet = succIndi->getReapplyConceptLabelSet(false); for (CSortedNegLinker* opConIt = concept->getOperandList(); opConIt; opConIt = opConIt->getNext()) { CConcept* opConcept = opConIt->getData(); bool opNegation = conSatDes->isNegated()^negation; if (!succConSet || !succConSet->containsConcept(opConcept,opNegation)) { return false; } } } } } } //if (roleSuccHash->hasRoleSuccessor(role)) { // return false; //} } } } return true; } bool CSatisfiableTaskClassificationMessageAnalyser::collectSuccessorMergingNodesAndConcepts(CIndividualProcessNode* indiNode, CIndividualSaturationProcessNode* saturationIndiNode, CReapplyRoleSuccessorHash* roleSuccHash, CRole* role, CPROCESSINGLIST& successorList, CPROCESSINGLIST& trivialSuccessorPropagatedConceptList, CPROCESSINGSET& backwardRoleSet, CCalculationAlgorithmContext* calcAlgContext) { for (CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { CRole* superRole = superRoleIt->getData(); bool superRoleInversed = superRoleIt->isNegated(); if (roleSuccHash && !superRoleInversed) { CReapplyQueueIterator reapplyIt(roleSuccHash->getRoleReapplyIterator(superRole,false)); while (reapplyIt.hasNext()) { CReapplyConceptDescriptor* reapplyConDes = reapplyIt.next(); CConceptDescriptor* conDes = reapplyConDes->getConceptDescriptor(); CConcept* reapplyConcept = conDes->getConcept(); bool reapplyConceptNegation = conDes->isNegated(); cint64 reapplyConceptOpCode = reapplyConcept->getOperatorCode(); if (reapplyConceptNegation && (reapplyConceptOpCode == CCSOME) || !reapplyConceptNegation && (reapplyConceptOpCode == CCALL || reapplyConceptOpCode == CCIMPLALL || reapplyConceptOpCode == CCBRANCHALL || reapplyConceptOpCode == CCAQALL || reapplyConceptOpCode == CCIMPLAQALL || reapplyConceptOpCode == CCBRANCHAQALL)) { for (CSortedNegLinker* reapplyOperandConLinkerIt = reapplyConcept->getOperandList(); reapplyOperandConLinkerIt; reapplyOperandConLinkerIt = reapplyOperandConLinkerIt->getNext()) { CConcept* reapplyOperandCon = reapplyOperandConLinkerIt->getData(); bool reapplyOperandConNeg = reapplyOperandConLinkerIt->isNegated()^reapplyConceptNegation; CIndividualSaturationProcessNode* satIndiNode = getSaturatedIndividualNodeForConcept(reapplyOperandCon,reapplyOperandConNeg,calcAlgContext); if (!satIndiNode) { if (!collectTrivialPropagationTestingConcepts(reapplyOperandCon,reapplyOperandConNeg,trivialSuccessorPropagatedConceptList,calcAlgContext)) { return false; } } else if (!satIndiNode->isCompleted() || satIndiNode->getIndirectStatusFlags()->hasFlags(CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCARDINALITYPROPLEMATIC | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGNOMINALCONNECTION,false)) { return false; } if (satIndiNode) { successorList.append(satIndiNode); } } } else if (!reapplyConceptNegation && (reapplyConceptOpCode == CCAQAND || reapplyConceptOpCode == CCIMPLAQAND || reapplyConceptOpCode == CCBRANCHAQAND)) { if (!addAutomateTransactionConcepts(reapplyConcept,reapplyConceptNegation,superRole,successorList,trivialSuccessorPropagatedConceptList,calcAlgContext)) { return false; } } else { return false; } } } else { backwardRoleSet.insert(superRole); } } return true; } bool CSatisfiableTaskClassificationMessageAnalyser::testSaturatedExistentialsModelMergable(CIndividualProcessNode* indiNode, CIndividualSaturationProcessNode* saturationIndiNode, CCalculationAlgorithmContext* calcAlgContext) { STATINC(ANALYSECANDIDATECONCEPTSATURATEDROLESUCCESSOREXTENDEDMERGINGCOUNT,calcAlgContext); CTaskProcessorContext* taskProcessorContext = calcAlgContext->getUsedTaskProcessorContext(); cint64 remainingMergingDepth = 5; cint64 remainingMergingCount = 100; CReapplyRoleSuccessorHash* roleSuccHash = indiNode->getReapplyRoleSuccessorHash(false); if (saturationIndiNode->getDirectStatusFlags()->hasSuccessorNodeExtensionsFlag()) { CLinkedRoleSaturationSuccessorHash* linkedSuccHash = saturationIndiNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { CPROCESSHASH* roleLinkedSuccHash = linkedSuccHash->getLinkedRoleSuccessorHash(); for (CPROCESSHASH::const_iterator itSucc = roleLinkedSuccHash->constBegin(), itEndSucc = roleLinkedSuccHash->constEnd(); itSucc != itEndSucc; ++itSucc) { CRole* role = itSucc.key(); CLinkedRoleSaturationSuccessorData* linkedSuccData = itSucc.value(); CPROCESSMAP* succDataMap = linkedSuccData->getSuccessorNodeDataMap(false); if (succDataMap) { for (CPROCESSMAP::const_iterator it = succDataMap->constBegin(), itEnd = succDataMap->constEnd(); it != itEnd; ++it) { CSaturationSuccessorData* succData = it.value(); if (succData->mActiveCount >= 1) { for (CXNegLinker* creationRoleLinkerIt = succData->mCreationRoleLinker; creationRoleLinkerIt; creationRoleLinkerIt = creationRoleLinkerIt->getNext()) { if (!creationRoleLinkerIt->isNegated()) { CRole* creationRole = creationRoleLinkerIt->getData(); if (creationRole == role) { CPROCESSINGLIST successorList(taskProcessorContext); CPROCESSINGLIST trivialSuccessorPropagatedConceptList(taskProcessorContext); CPROCESSINGSET backwardRoleSet(taskProcessorContext); if (!collectSuccessorMergingNodesAndConcepts(indiNode,saturationIndiNode,roleSuccHash,role,successorList,trivialSuccessorPropagatedConceptList,backwardRoleSet,calcAlgContext)) { return false; } if (!successorList.isEmpty() || !trivialSuccessorPropagatedConceptList.isEmpty()) { CIndividualSaturationProcessNode* extSatIndiNode = succData->mSuccIndiNode; successorList.prepend(extSatIndiNode); if (!testSaturatedSuccessorModelMergable(extSatIndiNode,successorList,&trivialSuccessorPropagatedConceptList,backwardRoleSet,remainingMergingDepth,remainingMergingCount,calcAlgContext)) { return false; } } } } } } } } } } } else { CReapplyConceptSaturationLabelSet* saturatedConSet = saturationIndiNode->getReapplyConceptSaturationLabelSet(false); for (CConceptSaturationDescriptor* conSatDesIt = saturatedConSet->getConceptSaturationDescriptionLinker(); conSatDesIt; conSatDesIt = conSatDesIt->getNext()) { CConceptSaturationDescriptor* conSatDes = conSatDesIt; CConcept* concept = conSatDes->getConcept(); bool negated = conSatDes->isNegated(); cint64 opCode = concept->getOperatorCode(); cint64 card = concept->getParameter(); if (!negated && (opCode == CCSOME || opCode == CCAQSOME || opCode == CCATLEAST && card > 0) || negated && (opCode == CCALL || opCode == CCATMOST && card >= 0)) { CPROCESSINGLIST successorList(taskProcessorContext); CPROCESSINGLIST trivialSuccessorPropagatedConceptList(taskProcessorContext); CPROCESSINGSET backwardRoleSet(taskProcessorContext); CRole* role = concept->getRole(); if (!collectSuccessorMergingNodesAndConcepts(indiNode,saturationIndiNode,roleSuccHash,role,successorList,trivialSuccessorPropagatedConceptList,backwardRoleSet,calcAlgContext)) { return false; } if (!successorList.isEmpty() || !trivialSuccessorPropagatedConceptList.isEmpty()) { CIndividualSaturationProcessNode* extSatIndiNode = getExistentialSaturatedIndividualNodeForConcept(concept,calcAlgContext); if (!extSatIndiNode) { return false; } successorList.prepend(extSatIndiNode); if (!testSaturatedSuccessorModelMergable(extSatIndiNode,successorList,&trivialSuccessorPropagatedConceptList,backwardRoleSet,remainingMergingDepth,remainingMergingCount,calcAlgContext)) { return false; } } } } } return true; } bool CSatisfiableTaskClassificationMessageAnalyser::collectTrivialPropagationTestingConcepts(CConcept* concept, bool negation, CPROCESSINGLIST& trivialConceptTestingList, CCalculationAlgorithmContext* calcAlgContext) { CConceptOperator* conOperator = concept->getConceptOperator(); cint64 conOpCode = concept->getOperatorCode(); if (negation && conOpCode == CCSUB) { trivialConceptTestingList.append(TConceptNegationPair(concept,negation)); return true; } else if (!negation && (conOpCode == CCALL || conOpCode == CCIMPLALL || conOpCode == CCBRANCHALL || conOpCode == CCAQALL || conOpCode == CCIMPLAQALL || conOpCode == CCBRANCHAQALL)) { trivialConceptTestingList.append(TConceptNegationPair(concept,negation)); return true; } else if (!negation && (conOpCode == CCAQAND || conOpCode == CCIMPLAQAND || conOpCode == CCBRANCHAQAND)) { bool allOperandsSucceeded = true; for (CSortedNegLinker* operandConLinkerIt = concept->getOperandList(); operandConLinkerIt; operandConLinkerIt = operandConLinkerIt->getNext()) { CConcept* operandCon = operandConLinkerIt->getData(); bool operandConNeg = operandConLinkerIt->isNegated(); allOperandsSucceeded &= collectTrivialPropagationTestingConcepts(operandCon,operandConNeg,trivialConceptTestingList,calcAlgContext); } return allOperandsSucceeded; } return false; } bool CSatisfiableTaskClassificationMessageAnalyser::addAutomateTransactionConcepts(CConcept* concept, bool negation, CRole* role, CPROCESSINGLIST& successorList, CPROCESSINGLIST& trivialConceptTestingList, CCalculationAlgorithmContext* calcAlgContext) { cint64 conOpCode = concept->getOperatorCode(); if (!negation && (conOpCode == CCAQALL || conOpCode == CCIMPLAQALL || conOpCode == CCBRANCHAQALL)) { if (concept->getRole() == role) { for (CSortedNegLinker* operandConLinkerIt = concept->getOperandList(); operandConLinkerIt; operandConLinkerIt = operandConLinkerIt->getNext()) { CConcept* reapplyOperandCon = operandConLinkerIt->getData(); bool reapplyOperandConNeg = operandConLinkerIt->isNegated(); CIndividualSaturationProcessNode* satIndiNode = getSaturatedIndividualNodeForConcept(reapplyOperandCon,reapplyOperandConNeg,calcAlgContext); if (!satIndiNode) { if (!collectTrivialPropagationTestingConcepts(reapplyOperandCon,reapplyOperandConNeg,trivialConceptTestingList,calcAlgContext)) { return false; } } else if (!satIndiNode->isCompleted() || satIndiNode->getIndirectStatusFlags()->hasFlags(CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCARDINALITYPROPLEMATIC | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGNOMINALCONNECTION,false)) { return false; } if (satIndiNode) { successorList.append(satIndiNode); } } } } else if (!negation && (conOpCode == CCAQAND || conOpCode == CCIMPLAQAND || conOpCode == CCBRANCHAQAND)) { bool allOperandsSucceeded = true; for (CSortedNegLinker* operandConLinkerIt = concept->getOperandList(); operandConLinkerIt; operandConLinkerIt = operandConLinkerIt->getNext()) { CConcept* reapplyOperandCon = operandConLinkerIt->getData(); bool reapplyOperandConNeg = operandConLinkerIt->isNegated(); allOperandsSucceeded &= addAutomateTransactionConcepts(reapplyOperandCon,reapplyOperandConNeg,role,successorList,trivialConceptTestingList,calcAlgContext); } return allOperandsSucceeded; } return true; } bool CSatisfiableTaskClassificationMessageAnalyser::testSaturatedSuccessorModelMergable(CIndividualSaturationProcessNode* existentialIndiNode, CPROCESSINGLIST& successorList, CPROCESSINGLIST* trivialSuccessorPropagatedConceptList, CPROCESSINGSET& backwardRoleSet, cint64 remainingMergingDepth, cint64& remainingMergingCount, CCalculationAlgorithmContext* calcAlgContext) { ++mStatSuccessorModelMergingTestCount; if (--remainingMergingDepth < 0) { return false; } if (--remainingMergingCount < 0) { return false; } if (successorList.count() == 1) { return testSingleSaturatedSuccessorModelMergable(existentialIndiNode,successorList,trivialSuccessorPropagatedConceptList,backwardRoleSet,remainingMergingDepth,remainingMergingCount,calcAlgContext); } else { return testMultipleSaturatedSuccessorModelMergable(existentialIndiNode,successorList,trivialSuccessorPropagatedConceptList,backwardRoleSet,remainingMergingDepth,remainingMergingCount,calcAlgContext); } } bool CSatisfiableTaskClassificationMessageAnalyser::testSingleSaturatedSuccessorModelMergable(CIndividualSaturationProcessNode* existentialIndiNode, CPROCESSINGLIST& successorList, CPROCESSINGLIST* trivialSuccessorPropagatedConceptList, CPROCESSINGSET& backwardRoleSet, cint64 remainingMergingDepth, cint64& remainingMergingCount, CCalculationAlgorithmContext* calcAlgContext) { CTaskProcessorContext* taskProcessorContext = calcAlgContext->getUsedTaskProcessorContext(); CIndividualSaturationProcessNode* subResolvedExistentialIndiNode = existentialIndiNode; while (subResolvedExistentialIndiNode->hasSubstituteIndividualNode()) { subResolvedExistentialIndiNode = subResolvedExistentialIndiNode->getSubstituteIndividualNode(); } CReapplyConceptSaturationLabelSet* satConSet = subResolvedExistentialIndiNode->getReapplyConceptSaturationLabelSet(false); CPROCESSINGHASH successorInfluenceConceptsHash(taskProcessorContext); if (trivialSuccessorPropagatedConceptList) { for (CPROCESSINGLIST::const_iterator trivConIt = trivialSuccessorPropagatedConceptList->constBegin(), trivConItEnd = trivialSuccessorPropagatedConceptList->constEnd(); trivConIt != trivConItEnd; ++trivConIt) { TConceptNegationPair conNegPair(*trivConIt); CConcept* concept = conNegPair.first; bool negation = conNegPair.second; cint64 conOpCode = concept->getOperatorCode(); if (negation && conOpCode == CCSUB) { CConceptSaturationDescriptor* conSatDes = nullptr; CImplicationReapplyConceptSaturationDescriptor* impConSatDes = nullptr; if (satConSet->getConceptSaturationDescriptor(concept,conSatDes,impConSatDes)) { if (conSatDes && conSatDes->isNegated() != negation) { return false; } if (!conSatDes && impConSatDes) { return false; } } else { CIndividualSaturationProcessNode* tmpSubExistentialIndiNode = existentialIndiNode; while (tmpSubExistentialIndiNode->hasSubstituteIndividualNode()) { CSaturationConceptDataItem* conceptSatItem = (CSaturationConceptDataItem*)tmpSubExistentialIndiNode->getSaturationConceptReferenceLinking(); CConcept* satConcept = conceptSatItem->getSaturationConcept(); bool satNegation = conceptSatItem->getSaturationNegation(); if (satConcept == concept && negation != satNegation) { return false; } tmpSubExistentialIndiNode = tmpSubExistentialIndiNode->getSubstituteIndividualNode(); } } } else if (!negation && (conOpCode == CCALL || conOpCode == CCIMPLALL || conOpCode == CCBRANCHALL || conOpCode == CCAQALL || conOpCode == CCIMPLAQALL || conOpCode == CCBRANCHAQALL)) { CRole* role = concept->getRole(); if (backwardRoleSet.contains(role)) { return false; } for (CSortedNegLinker* operandConLinkerIt = concept->getOperandList(); operandConLinkerIt; operandConLinkerIt = operandConLinkerIt->getNext()) { CConcept* operandCon = operandConLinkerIt->getData(); bool operandConNeg = operandConLinkerIt->isNegated()^negation; successorInfluenceConceptsHash.insertMulti(role,TConceptNegationPair(operandCon,operandConNeg)); } } } } if (!existentialIndiNode->getDirectStatusFlags()->hasSuccessorNodeExtensionsFlag()) { for (CConceptSaturationDescriptor* conSatDesIt = satConSet->getConceptSaturationDescriptionLinker(); conSatDesIt; conSatDesIt = conSatDesIt->getNext()) { CConcept* concept = conSatDesIt->getConcept(); bool negated = conSatDesIt->isNegated(); cint64 opCode = concept->getOperatorCode(); //if (!negated && (opCode == CCSOME || opCode == CCAQSOME) || negated && (opCode == CCALL)) { cint64 card = concept->getParameter(); if (!negated && (opCode == CCSOME || opCode == CCAQSOME || opCode == CCATLEAST && card > 0) || negated && (opCode == CCALL || opCode == CCATMOST && card >= 0)) { CPROCESSINGLIST nextSuccessorList(taskProcessorContext); CPROCESSINGLIST nextTrivialSuccessorPropagatedConceptList(taskProcessorContext); CPROCESSINGSET nextBackwardRoleSet(taskProcessorContext); CRole* role = concept->getRole(); if (!collectSuccessorMergingNodesAndConcepts(existentialIndiNode,role,successorList,*trivialSuccessorPropagatedConceptList,backwardRoleSet,nextSuccessorList,nextTrivialSuccessorPropagatedConceptList,nextBackwardRoleSet,successorInfluenceConceptsHash,calcAlgContext)) { return false; } if (!nextSuccessorList.isEmpty() || !trivialSuccessorPropagatedConceptList->isEmpty()) { CIndividualSaturationProcessNode* extSatIndiNode = getExistentialSaturatedIndividualNodeForConcept(concept,calcAlgContext); nextSuccessorList.prepend(extSatIndiNode); if (!testSaturatedSuccessorModelMergable(extSatIndiNode,nextSuccessorList,&nextTrivialSuccessorPropagatedConceptList,nextBackwardRoleSet,remainingMergingDepth,remainingMergingCount,calcAlgContext)) { return false; } } } } } else { CLinkedRoleSaturationSuccessorHash* linkedSuccHash = existentialIndiNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { CPROCESSHASH* roleLinkedSuccHash = linkedSuccHash->getLinkedRoleSuccessorHash(); for (CPROCESSHASH::const_iterator itSucc = roleLinkedSuccHash->constBegin(), itEndSucc = roleLinkedSuccHash->constEnd(); itSucc != itEndSucc; ++itSucc) { CRole* role = itSucc.key(); CLinkedRoleSaturationSuccessorData* linkedSuccData = itSucc.value(); CPROCESSMAP* succDataMap = linkedSuccData->getSuccessorNodeDataMap(false); if (succDataMap) { for (CPROCESSMAP::const_iterator it = succDataMap->constBegin(), itEnd = succDataMap->constEnd(); it != itEnd; ++it) { CSaturationSuccessorData* succData = it.value(); if (succData->mActiveCount >= 1) { for (CXNegLinker* creationRoleLinkerIt = succData->mCreationRoleLinker; creationRoleLinkerIt; creationRoleLinkerIt = creationRoleLinkerIt->getNext()) { if (!creationRoleLinkerIt->isNegated()) { CRole* creationRole = creationRoleLinkerIt->getData(); if (creationRole == role) { CPROCESSINGLIST nextSuccessorList(taskProcessorContext); CPROCESSINGLIST nextTrivialSuccessorPropagatedConceptList(taskProcessorContext); CPROCESSINGSET nextBackwardRoleSet(taskProcessorContext); if (!collectSuccessorMergingNodesAndConcepts(existentialIndiNode,role,successorList,*trivialSuccessorPropagatedConceptList,backwardRoleSet,nextSuccessorList,nextTrivialSuccessorPropagatedConceptList,nextBackwardRoleSet,successorInfluenceConceptsHash,calcAlgContext)) { return false; } if (!nextSuccessorList.isEmpty() || !trivialSuccessorPropagatedConceptList->isEmpty()) { CIndividualSaturationProcessNode* extSatIndiNode = succData->mSuccIndiNode; nextSuccessorList.prepend(extSatIndiNode); if (!testSaturatedSuccessorModelMergable(extSatIndiNode,nextSuccessorList,&nextTrivialSuccessorPropagatedConceptList,nextBackwardRoleSet,remainingMergingDepth,remainingMergingCount,calcAlgContext)) { return false; } } } } } } } } } } } return true; } bool CSatisfiableTaskClassificationMessageAnalyser::testMultipleSaturatedSuccessorModelMergable(CIndividualSaturationProcessNode* existentialIndiNode, CPROCESSINGLIST& successorList, CPROCESSINGLIST* trivialSuccessorPropagatedConceptList, CPROCESSINGSET& backwardRoleSet, cint64 remainingMergingDepth, cint64& remainingMergingCount, CCalculationAlgorithmContext* calcAlgContext) { CTaskProcessorContext* taskProcessorContext = calcAlgContext->getUsedTaskProcessorContext(); // check for problematic forall concepts for (CPROCESSINGLIST::const_iterator succIt = successorList.constBegin(), succItEnd = successorList.constEnd(); succIt != succItEnd; ++succIt) { CIndividualSaturationProcessNode* succIndiNode(*succIt); if (succIndiNode != existentialIndiNode) { while (succIndiNode->hasSubstituteIndividualNode()) { succIndiNode = succIndiNode->getSubstituteIndividualNode(); } CRoleBackwardSaturationPropagationHash* roleBackwardPropHash = succIndiNode->getRoleBackwardPropagationHash(false); if (roleBackwardPropHash) { CPROCESSHASH* roleBackwardPropDataHash = roleBackwardPropHash->getRoleBackwardPropagationDataHash(); for (CPROCESSINGSET::const_iterator it = backwardRoleSet.constBegin(), itEnd = backwardRoleSet.constEnd(); it != itEnd; ++it) { CRole* backwardRole(*it); const CRoleBackwardSaturationPropagationHashData& roleBackwardRoleData = roleBackwardPropDataHash->value(backwardRole); if (roleBackwardRoleData.mLinkLinker) { return false; } } } } } CPROCESSINGHASH conceptNegationTriggerHash(taskProcessorContext); CPROCESSINGHASH successorInfluenceConceptsHash(taskProcessorContext); if (trivialSuccessorPropagatedConceptList) { for (CPROCESSINGLIST::const_iterator trivConIt = trivialSuccessorPropagatedConceptList->constBegin(), trivConItEnd = trivialSuccessorPropagatedConceptList->constEnd(); trivConIt != trivConItEnd; ++trivConIt) { TConceptNegationPair conNegPair(*trivConIt); CConcept* concept = conNegPair.first; bool negation = conNegPair.second; cint64 conOpCode = concept->getOperatorCode(); if (negation && conOpCode == CCSUB) { CConceptNegationTriggerItem& conNegTriggerItem = conceptNegationTriggerHash[concept->getConceptTag()]; if (conNegTriggerItem.mTriggerFlag) { return false; } if (conNegTriggerItem.mConcept && conNegTriggerItem.mNegationFlag != negation) { return false; } conNegTriggerItem.mNegationFlag = negation; conNegTriggerItem.mConcept = concept; } else if (!negation && (conOpCode == CCALL || conOpCode == CCIMPLALL || conOpCode == CCBRANCHALL || conOpCode == CCAQALL || conOpCode == CCIMPLAQALL || conOpCode == CCBRANCHAQALL)) { CRole* role = concept->getRole(); if (backwardRoleSet.contains(role)) { return false; } for (CSortedNegLinker* operandConLinkerIt = concept->getOperandList(); operandConLinkerIt; operandConLinkerIt = operandConLinkerIt->getNext()) { CConcept* operandCon = operandConLinkerIt->getData(); bool operandConNeg = operandConLinkerIt->isNegated()^negation; successorInfluenceConceptsHash.insertMulti(role,TConceptNegationPair(operandCon,operandConNeg)); } } } } for (CPROCESSINGLIST::const_iterator succIt = successorList.constBegin(), succItEnd = successorList.constEnd(); succIt != succItEnd; ++succIt) { CIndividualSaturationProcessNode* succIndiNode(*succIt); while (succIndiNode->hasSubstituteIndividualNode()) { CSaturationConceptDataItem* conceptSatItem = (CSaturationConceptDataItem*)succIndiNode->getSaturationConceptReferenceLinking(); CConcept* satConcept = conceptSatItem->getSaturationConcept(); bool satNegation = conceptSatItem->getSaturationNegation(); CConceptNegationTriggerItem& conNegTriggerItem = conceptNegationTriggerHash[satConcept->getConceptTag()]; if (conNegTriggerItem.mTriggerFlag) { return false; } if (conNegTriggerItem.mConcept && conNegTriggerItem.mNegationFlag != satNegation) { return false; } if (!conNegTriggerItem.mIndiSatNode) { conNegTriggerItem.mIndiSatNode = succIndiNode; } conNegTriggerItem.mNegationFlag = satNegation; conNegTriggerItem.mConcept = satConcept; succIndiNode = succIndiNode->getSubstituteIndividualNode(); } CReapplyConceptSaturationLabelSet* satConSet = succIndiNode->getReapplyConceptSaturationLabelSet(false); if (satConSet) { CReapplyConceptSaturationLabelSetIterator satConSetIt = satConSet->getIterator(true,true); while (satConSetIt.hasNext()) { CConceptSaturationDescriptor* conSatDes = satConSetIt.getConceptSaturationDescriptor(); CImplicationReapplyConceptSaturationDescriptor* implTrigger = satConSetIt.getImplicationReapplyConceptSaturationDescriptor(); CConceptNegationTriggerItem& conNegTriggerItem = conceptNegationTriggerHash[satConSetIt.getDataTag()]; if (conSatDes) { CConcept* satConcept = conSatDes->getConcept(); bool satNegation = conSatDes->isNegated(); if (conNegTriggerItem.mTriggerFlag) { return false; } if (conNegTriggerItem.mConcept && conNegTriggerItem.mNegationFlag != satNegation) { return false; } if (!conNegTriggerItem.mIndiSatNode) { conNegTriggerItem.mIndiSatNode = succIndiNode; } conNegTriggerItem.mNegationFlag = satNegation; conNegTriggerItem.mConcept = satConcept; } else if (implTrigger) { if (conNegTriggerItem.mConcept) { return false; } conNegTriggerItem.mTriggerFlag = true; } satConSetIt.moveNext(); } } } for (CPROCESSINGHASH::const_iterator conIt = conceptNegationTriggerHash.constBegin(), conItEnd = conceptNegationTriggerHash.constEnd(); conIt != conItEnd; ++conIt) { CConceptNegationTriggerItem conNegTriggerItem(conIt.value()); if (conNegTriggerItem.mConcept) { CConcept* concept = conNegTriggerItem.mConcept; bool negated = conNegTriggerItem.mNegationFlag; CIndividualSaturationProcessNode* satIndiNode = conNegTriggerItem.mIndiSatNode; cint64 opCode = concept->getOperatorCode(); //if (!negated && (opCode == CCSOME || opCode == CCAQSOME) || negated && (opCode == CCALL)) { cint64 card = concept->getParameter(); if (!negated && (opCode == CCSOME || opCode == CCAQSOME || opCode == CCATLEAST && card > 0) || negated && (opCode == CCALL || opCode == CCATMOST && card >= 0)) { CPROCESSINGLIST nextSuccessorList(taskProcessorContext); CPROCESSINGLIST nextTrivialSuccessorPropagatedConceptList(taskProcessorContext); CPROCESSINGSET nextBackwardRoleSet(taskProcessorContext); CRole* role = concept->getRole(); if (!collectSuccessorMergingNodesAndConcepts(satIndiNode,role,successorList,*trivialSuccessorPropagatedConceptList,backwardRoleSet,nextSuccessorList,nextTrivialSuccessorPropagatedConceptList,nextBackwardRoleSet,successorInfluenceConceptsHash,calcAlgContext)) { return false; } if (!nextSuccessorList.isEmpty() || !trivialSuccessorPropagatedConceptList->isEmpty()) { CIndividualSaturationProcessNode* extSatIndiNode = getExistentialSaturatedIndividualNodeForConcept(concept,calcAlgContext); nextSuccessorList.prepend(extSatIndiNode); if (!testSaturatedSuccessorModelMergable(extSatIndiNode,nextSuccessorList,&nextTrivialSuccessorPropagatedConceptList,nextBackwardRoleSet,remainingMergingDepth,remainingMergingCount,calcAlgContext)) { return false; } } } } } for (CPROCESSINGLIST::const_iterator succIt = successorList.constBegin(), succItEnd = successorList.constEnd(); succIt != succItEnd; ++succIt) { CIndividualSaturationProcessNode* succIndiNode(*succIt); if (succIndiNode->getDirectStatusFlags()->hasSuccessorNodeExtensionsFlag()) { CLinkedRoleSaturationSuccessorHash* linkedSuccHash = succIndiNode->getLinkedRoleSuccessorHash(false); if (linkedSuccHash) { CPROCESSHASH* roleLinkedSuccHash = linkedSuccHash->getLinkedRoleSuccessorHash(); for (CPROCESSHASH::const_iterator itSucc = roleLinkedSuccHash->constBegin(), itEndSucc = roleLinkedSuccHash->constEnd(); itSucc != itEndSucc; ++itSucc) { CRole* role = itSucc.key(); CLinkedRoleSaturationSuccessorData* linkedSuccData = itSucc.value(); CPROCESSMAP* succDataMap = linkedSuccData->getSuccessorNodeDataMap(false); if (succDataMap) { for (CPROCESSMAP::const_iterator it = succDataMap->constBegin(), itEnd = succDataMap->constEnd(); it != itEnd; ++it) { CSaturationSuccessorData* succData = it.value(); if (succData->mActiveCount >= 1) { for (CXNegLinker* creationRoleLinkerIt = succData->mCreationRoleLinker; creationRoleLinkerIt; creationRoleLinkerIt = creationRoleLinkerIt->getNext()) { if (!creationRoleLinkerIt->isNegated()) { CRole* creationRole = creationRoleLinkerIt->getData(); if (creationRole == role) { CPROCESSINGLIST nextSuccessorList(taskProcessorContext); CPROCESSINGLIST nextTrivialSuccessorPropagatedConceptList(taskProcessorContext); CPROCESSINGSET nextBackwardRoleSet(taskProcessorContext); if (!collectSuccessorMergingNodesAndConcepts(succIndiNode,role,successorList,*trivialSuccessorPropagatedConceptList,backwardRoleSet,nextSuccessorList,nextTrivialSuccessorPropagatedConceptList,nextBackwardRoleSet,successorInfluenceConceptsHash,calcAlgContext)) { return false; } if (!nextSuccessorList.isEmpty() || !trivialSuccessorPropagatedConceptList->isEmpty()) { CIndividualSaturationProcessNode* extSatIndiNode = succData->mSuccIndiNode; nextSuccessorList.prepend(extSatIndiNode); if (!testSaturatedSuccessorModelMergable(extSatIndiNode,nextSuccessorList,&nextTrivialSuccessorPropagatedConceptList,nextBackwardRoleSet,remainingMergingDepth,remainingMergingCount,calcAlgContext)) { return false; } } } } } } } } } } } } return true; } bool CSatisfiableTaskClassificationMessageAnalyser::collectSuccessorMergingNodesAndConcepts(CIndividualSaturationProcessNode* excludeSaturationIndiNode, CRole* role, CPROCESSINGLIST& successorList, CPROCESSINGLIST& trivialSuccessorPropagatedConceptList, CPROCESSINGSET& backwardRoleSet, CPROCESSINGLIST& nextSuccessorList, CPROCESSINGLIST& nextTrivialSuccessorPropagatedConceptList, CPROCESSINGSET& nextBackwardRoleSet, CPROCESSINGHASH& successorInfluenceConceptsHash, CCalculationAlgorithmContext* calcAlgContext) { for (CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { CRole* superRole = superRoleIt->getData(); bool superRoleInversed = superRoleIt->isNegated(); if (!superRoleInversed) { for (CPROCESSINGHASH::const_iterator it = successorInfluenceConceptsHash.constFind(superRole), itEnd = successorInfluenceConceptsHash.constEnd(); it != itEnd; ++it) { CRole* hashRole(it.key()); if (role == hashRole) { TConceptNegationPair conNegPair(it.value()); CConcept* reapplyOperandCon = conNegPair.first; bool reapplyOperandConNeg = conNegPair.second; CIndividualSaturationProcessNode* satIndiNode = getSaturatedIndividualNodeForConcept(reapplyOperandCon,reapplyOperandConNeg,calcAlgContext); if (!satIndiNode) { if (!collectTrivialPropagationTestingConcepts(reapplyOperandCon,reapplyOperandConNeg,nextTrivialSuccessorPropagatedConceptList,calcAlgContext)) { return false; } } else if (!satIndiNode->isCompleted() || satIndiNode->getIndirectStatusFlags()->hasFlags(CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCARDINALITYPROPLEMATIC | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGNOMINALCONNECTION,false)) { return false; } if (satIndiNode) { nextSuccessorList.append(satIndiNode); } } else { break; } } for (CPROCESSINGLIST::const_iterator succIt = successorList.constBegin(), succItEnd = successorList.constEnd(); succIt != succItEnd; ++succIt) { CIndividualSaturationProcessNode* succIndiNode(*succIt); while (succIndiNode->hasSubstituteIndividualNode()) { succIndiNode = succIndiNode->getSubstituteIndividualNode(); } if (succIndiNode != excludeSaturationIndiNode) { CRoleBackwardSaturationPropagationHash* roleBackPropHash = succIndiNode->getRoleBackwardPropagationHash(false); if (roleBackPropHash) { CPROCESSHASH* roleBackPropDataHash = roleBackPropHash->getRoleBackwardPropagationDataHash(); const CRoleBackwardSaturationPropagationHashData& backPropData = roleBackPropDataHash->value(superRole); for (CBackwardSaturationPropagationReapplyDescriptor* reapplyLinkerIt = backPropData.mReapplyLinker; reapplyLinkerIt; reapplyLinkerIt = reapplyLinkerIt->getNext()) { CConceptSaturationDescriptor* reapplyConDes = reapplyLinkerIt->getReapplyConceptSaturationDescriptor(); CConcept* reapplyConcept = reapplyConDes->getConcept(); bool reapplyConceptNegation = reapplyConDes->isNegated(); cint64 reapplyConceptOpCode = reapplyConcept->getOperatorCode(); if (reapplyConceptNegation && (reapplyConceptOpCode == CCSOME) || !reapplyConceptNegation && (reapplyConceptOpCode == CCALL || reapplyConceptOpCode == CCIMPLALL || reapplyConceptOpCode == CCBRANCHALL || reapplyConceptOpCode == CCAQALL || reapplyConceptOpCode == CCIMPLAQALL || reapplyConceptOpCode == CCBRANCHAQALL)) { for (CSortedNegLinker* reapplyOperandConLinkerIt = reapplyConcept->getOperandList(); reapplyOperandConLinkerIt; reapplyOperandConLinkerIt = reapplyOperandConLinkerIt->getNext()) { CConcept* reapplyOperandCon = reapplyOperandConLinkerIt->getData(); bool reapplyOperandConNeg = reapplyOperandConLinkerIt->isNegated()^reapplyConceptNegation; CIndividualSaturationProcessNode* satIndiNode = getSaturatedIndividualNodeForConcept(reapplyOperandCon,reapplyOperandConNeg,calcAlgContext); if (!satIndiNode) { if (!collectTrivialPropagationTestingConcepts(reapplyOperandCon,reapplyOperandConNeg,nextTrivialSuccessorPropagatedConceptList,calcAlgContext)) { return false; } } else if (!satIndiNode->isCompleted() || satIndiNode->getIndirectStatusFlags()->hasFlags(CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCARDINALITYPROPLEMATIC | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCLASHED | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGNOMINALCONNECTION,false)) { return false; } nextSuccessorList.append(satIndiNode); } } else { return false; } } } } } } else { nextBackwardRoleSet.insert(superRole); } } return true; } CIndividualSaturationProcessNode* CSatisfiableTaskClassificationMessageAnalyser::getExistentialSaturatedIndividualNodeForConcept(CConcept* concept, CCalculationAlgorithmContext* calcAlgContext) { CIndividualSaturationProcessNode* satIndiNode = nullptr; CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); if (conProcData) { CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* satCalcRefLinkData = confSatRefLinkingData->getExistentialSuccessorConceptSaturationReferenceLinkingData(); if (satCalcRefLinkData) { satIndiNode = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } if (!satIndiNode) { CSortedNegLinker* opConceptLinker = concept->getOperandList(); CConcept* opConcept = nullptr; bool opNegation = false; if (!opConceptLinker) { opConcept = calcAlgContext->getProcessingDataBox()->getOntologyTopConcept(); } else { if (!opConceptLinker->hasNext()) { opConcept = opConceptLinker->getData(); bool negateOp = false; if (concept->getOperatorCode() == CCALL) { negateOp = true; } opNegation = opConceptLinker->isNegated()^negateOp; } } if (opConcept) { satIndiNode = getSaturatedIndividualNodeForConcept(opConcept,opNegation,calcAlgContext); } } return satIndiNode; } CIndividualSaturationProcessNode* CSatisfiableTaskClassificationMessageAnalyser::getSaturatedIndividualNodeForConcept(CConcept* concept, bool conceptNegation, CCalculationAlgorithmContext* calcAlgContext) { CIndividualSaturationProcessNode* satIndiNode = nullptr; CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); if (conProcData) { CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* satCalcRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(conceptNegation); if (satCalcRefLinkData) { satIndiNode = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } return satIndiNode; } bool CSatisfiableTaskClassificationMessageAnalyser::testSubsumerCandidatePossibleWithMergedSaturatedModel(CIndividualProcessNode* indiNode, CConcept* testConcept, bool negation, bool& mergeSatisfieableFlag, CCalculationAlgorithmContext* calcAlgContext) { CIndividualSaturationProcessNode* saturationIndiNode = getSaturatedIndividualNodeForConcept(testConcept,negation,calcAlgContext); if (saturationIndiNode) { if (saturationIndiNode->isCompleted() && !saturationIndiNode->getIndirectStatusFlags()->hasFlags(CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGCARDINALITYPROPLEMATIC | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGINSUFFICIENT | CIndividualSaturationProcessNodeStatusFlags::INDSATFLAGNOMINALCONNECTION,false)) { bool clashedFlag = false; if (!testConceptSetWithSaturatedModelMergable(indiNode,saturationIndiNode,clashedFlag,calcAlgContext)) { return false; } if (clashedFlag) { mergeSatisfieableFlag = false; return true; } if (!testRoleSuccessorsWithSaturatedModelMergable(indiNode,saturationIndiNode,calcAlgContext)) { return false; } if (!testSaturatedExistentialsModelMergable(indiNode,saturationIndiNode,calcAlgContext)) { return false; } mergeSatisfieableFlag = true; return true; } return false; } return false; } bool CSatisfiableTaskClassificationMessageAnalyser::testEquivalenceConceptAlternatives(CIndividualProcessNode* indiNode, CPROCESSINGSET< QPair >& alternativesSet, CPROCESSINGHASH< QPair,CSaturatedMergedTestItem >* testSaturatedMergedHash, bool& oneMergeSatisfieableFlag, bool& allMergeUnsatisfieableFlag, CCalculationAlgorithmContext* calcAlgContext) { for (CPROCESSINGSET< QPair >::const_iterator it = alternativesSet.constBegin(), itEnd = alternativesSet.constEnd(); it != itEnd; ++it) { QPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negation = conNegPair.second; bool mergedSatisfiableFlag = false; STATINC(ANALYSECANDIDATECONCEPTSATURATEDALTERNATIVEMERGINGCOUNT,calcAlgContext); bool mergedSuccessfullyFlag = testSubsumerCandidatePossibleWithMergedSaturatedModel(indiNode,concept,negation,mergedSatisfiableFlag,calcAlgContext); CSaturatedMergedTestItem& saturatedMergedTestItem = (*testSaturatedMergedHash)[conNegPair]; saturatedMergedTestItem.mSuccessfullyMerged = mergedSuccessfullyFlag; saturatedMergedTestItem.mSatisfiableMerged = mergedSatisfiableFlag; if (!mergedSuccessfullyFlag) { allMergeUnsatisfieableFlag = false; } else { if (mergedSatisfiableFlag) { oneMergeSatisfieableFlag = true; allMergeUnsatisfieableFlag = false; return true; } } } if (allMergeUnsatisfieableFlag) { return true; } return false; } bool CSatisfiableTaskClassificationMessageAnalyser::collectEquivalenceConceptAlternatives(CIndividualProcessNode* indiNode, CConcept* testConcept, bool testConceptNegation, CPROCESSINGSET< QPair >& alternativesSet, CPROCESSINGHASH< QPair,CSaturatedMergedTestItem >* testSaturatedMergedHash, bool& oneMergeSatisfieableFlag, bool& allMergeUnsatisfieableFlag, CCalculationAlgorithmContext* calcAlgContext) { CTaskProcessorContext* taskProcessorContext = calcAlgContext->getUsedTaskProcessorContext(); CPROCESSINGLIST< QPair > alternativeExpList(taskProcessorContext); CPROCESSINGSET< QPair > alternativeExpSet(taskProcessorContext); CReapplyConceptLabelSet* conSet = indiNode->getReapplyConceptLabelSet(false); allMergeUnsatisfieableFlag = true; QPair conNegPair(testConcept,testConceptNegation); alternativeExpList.append(conNegPair); alternativeExpSet.insert(conNegPair); while (!alternativeExpList.isEmpty()) { conNegPair = alternativeExpList.takeFirst(); CConcept* concept = conNegPair.first; bool negation = conNegPair.second; cint64 conOpCode = concept->getOperatorCode(); if (negation && (conOpCode == CCEQ || conOpCode == CCAND) || !negation && (conOpCode == CCOR)) { for (CSortedNegLinker* operandConceptLinkerIt = concept->getOperandList(); operandConceptLinkerIt; operandConceptLinkerIt = operandConceptLinkerIt->getNext()) { CConcept* operandConcept = operandConceptLinkerIt->getData(); bool operandNegation = operandConceptLinkerIt->isNegated()^negation; QPair opConNegPair(operandConcept,operandNegation); if (!alternativeExpSet.contains(opConNegPair)) { alternativeExpSet.insert(opConNegPair); alternativeExpList.append(opConNegPair); } } } else if (conOpCode == CCAQCHOOCE) { for (CSortedNegLinker* operandConceptLinkerIt = concept->getOperandList(); operandConceptLinkerIt; operandConceptLinkerIt = operandConceptLinkerIt->getNext()) { CConcept* operandConcept = operandConceptLinkerIt->getData(); bool operandNegation = operandConceptLinkerIt->isNegated(); if (negation == operandNegation) { QPair opConNegPair(operandConcept,operandNegation); if (!alternativeExpSet.contains(opConNegPair)) { alternativeExpSet.insert(opConNegPair); alternativeExpList.append(opConNegPair); } } } } else if (negation && (conOpCode == CCALL) || !negation && (conOpCode == CCSOME || conOpCode == CCAQSOME)) { bool containsNegation = false; if (!conSet->containsConcept(concept,&containsNegation)) { CSaturatedMergedTestItem& saturatedMergedTestItem = (*testSaturatedMergedHash)[conNegPair]; if (saturatedMergedTestItem.mSuccessfullyMerged) { if (saturatedMergedTestItem.mSatisfiableMerged) { oneMergeSatisfieableFlag = true; allMergeUnsatisfieableFlag = false; return true; } } else { alternativesSet.insert(conNegPair); } } else { if (containsNegation == negation) { oneMergeSatisfieableFlag = true; allMergeUnsatisfieableFlag = false; return true; } } } else { bool containsNegation = false; if (!conSet->containsConcept(concept,&containsNegation)) { allMergeUnsatisfieableFlag = false; } else { if (containsNegation == negation) { oneMergeSatisfieableFlag = true; allMergeUnsatisfieableFlag = false; return true; } } } } if (alternativesSet.isEmpty() && allMergeUnsatisfieableFlag) { return true; } return false; } CClassificationMessageData* CSatisfiableTaskClassificationMessageAnalyser::extractPossibleSubsumptionInformation(CConceptDescriptor* conDes, CIndividualProcessNode* indiNode, CReapplyConceptLabelSet* conSet, CCalculationAlgorithmContext* calcAlgContext) { STATINC(ANALYSEPOSSIBLESUBSUMPTIONSCOUNT,calcAlgContext); CClassificationMessageData* messageDataLinker = nullptr; CConcept* testingConcept = conDes->getConcept(); bool negated = conDes->getNegation(); CConceptReferenceLinking* conRefLinking = nullptr; CConceptData* conData = testingConcept->getConceptData(); if (conData && !mUseAlwaysConRefLinkDataHash) { CConceptProcessData* conProcData = (CConceptProcessData*)conData; if (!conProcData->isInvalidatedReferenceLinking()) { conRefLinking = conProcData->getConceptReferenceLinking(); } } CClassificationConceptReferenceLinking* classConRefLinkData = nullptr; if (conRefLinking) { CConceptSatisfiableReferenceLinkingData* conSatRefLinkData = (CConceptSatisfiableReferenceLinkingData*)conRefLinking; classConRefLinkData = conSatRefLinkData->getClassifierReferenceLinkingData(); } else { classConRefLinkData = mConRefLinkDataHash->value(testingConcept); } if (classConRefLinkData) { CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking* possSubsumRefLinkData = (CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking*)classConRefLinkData; if (possSubsumRefLinkData) { if (!possSubsumRefLinkData->isPossibleSubsumptionMapInitialized()) { // initialize possible subsumption list CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* possSubsumerList = nullptr; if (!mMultiplePossSubsumInitAvoidHash) { mMultiplePossSubsumInitAvoidHash = CObjectParameterizingAllocator< CPROCESSINGHASH< CConcept*,CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* >,CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getTemporaryMemoryAllocationManager(),calcAlgContext->getTaskProcessorContext()); } possSubsumerList = mMultiplePossSubsumInitAvoidHash->value(testingConcept); CReapplyConceptLabelSetIterator conSetIt = conSet->getConceptLabelSetIterator(true,true,false); if (possSubsumerList) { // prune already initialization list for possible subsumers CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST::iterator itPossSubsum = possSubsumerList->begin(), itPossSubsumEnd = possSubsumerList->end(); while (conSetIt.hasNext() && itPossSubsum != itPossSubsumEnd) { CConceptDescriptor* conDes = conSetIt.getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool negated = conDes->getNegation(); CClassificationInitializePossibleSubsumptionData* possSubsumConData = *itPossSubsum; CConcept* possSubsumConcept = possSubsumConData->getPossibleSubsumerConcept(); cint64 conDesTag = conDes->getConceptTag(); cint64 possSubsumConTag = possSubsumConcept->getConceptTag(); if (conDesTag < possSubsumConTag) { conSetIt.moveNext(); } else if (conDesTag == possSubsumConTag) { //if (concept->getOperatorCode() == CCEQCAND) { // if (!testSubsumerCandidatePossibleWithMergedSaturatedModel(indiNode,concept->getOperandList()->getData(),calcAlgContext)) { // possSubsumConData->setPossibleSubsumerInvalid(); // } //} conSetIt.moveNext(); ++itPossSubsum; } else { possSubsumConData->setPossibleSubsumerInvalid(); ++itPossSubsum; } } while (itPossSubsum != itPossSubsumEnd) { CClassificationInitializePossibleSubsumptionData* subsumData(*itPossSubsum); subsumData->setPossibleSubsumerInvalid(); ++itPossSubsum; } } else { // create new initialization list for possible subsumers while (conSetIt.hasNext()) { CConceptDescriptor* conDes = conSetIt.getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool negated = conDes->getNegation(); if (!negated && (concept->hasClassName() && concept->getConceptTag() != 1 && concept != testingConcept)) { if (!possSubsumerList) { possSubsumerList = CObjectParameterizingAllocator< CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST,CContext* >::allocateAndConstructAndParameterize(mTempMemAllocMan,mTmpContext); } CClassificationInitializePossibleSubsumptionData* possSubsumData = CObjectAllocator< CClassificationInitializePossibleSubsumptionData >::allocateAndConstruct(mTempMemAllocMan); possSubsumData->initClassificationPossibleSubsumptionData(concept); possSubsumerList->append(possSubsumData); } if (concept->getOperatorCode() == CCEQCAND) { CConcept* eqConcept = concept->getOperandList()->getData(); //if (CIRIName::getRecentIRIName(testingConcept->getClassNameLinker()) == "http://oiled.man.example.net/facts#All+Friends+Happy+or+All+Friends+Students") { // if (CIRIName::getRecentIRIName(eqConcept->getClassNameLinker()) == "http://oiled.man.example.net/facts#All+Friends+Happy+or+Students") { // bool bug = true; // } //} if (testSubsumerCandidatePossibleWithMergedSaturatedModel(indiNode,eqConcept,calcAlgContext)) { if (!possSubsumerList) { possSubsumerList = CObjectParameterizingAllocator< CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST,CContext* >::allocateAndConstructAndParameterize(mTempMemAllocMan,mTmpContext); } CClassificationInitializePossibleSubsumptionData* possSubsumData = CObjectAllocator< CClassificationInitializePossibleSubsumptionData >::allocateAndConstruct(mTempMemAllocMan); possSubsumData->initClassificationPossibleSubsumptionData(concept); possSubsumerList->append(possSubsumData); } } conSetIt.moveNext(); } CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* eqConNonCandPossSubsumerList = nullptr; bool eqConceptsNonCandidatePossSubsumers = false; QSet* equivConceptNonCandidateSet = calcAlgContext->getUsedProcessingDataBox()->getOntology()->getTBox()->getEquivalentConceptNonCandidateSet(false); if (equivConceptNonCandidateSet) { eqConceptsNonCandidatePossSubsumers = true; for (QSet::const_iterator it = equivConceptNonCandidateSet->constBegin(), itEnd = equivConceptNonCandidateSet->constEnd(); it != itEnd; ++it) { CConcept* eqConcept = *it; //if (CIRIName::getRecentIRIName(testingConcept->getClassNameLinker()) == "http://oiled.man.example.net/facts#All+Friends+Happy+or+All+Friends+Students") { // if (CIRIName::getRecentIRIName(eqConcept->getClassNameLinker()) == "http://oiled.man.example.net/facts#All+Friends+Happy+or+Students") { // bool bug = true; // } //} if (testSubsumerCandidatePossibleWithMergedSaturatedModel(indiNode,eqConcept,calcAlgContext)) { if (!eqConNonCandPossSubsumerList) { eqConNonCandPossSubsumerList = CObjectParameterizingAllocator< CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST,CContext* >::allocateAndConstructAndParameterize(mTempMemAllocMan,mTmpContext); } eqConNonCandPossSubsumerList->append(eqConcept); } } } if (possSubsumerList) { mMultiplePossSubsumInitAvoidHash->insert(testingConcept,possSubsumerList); } CClassificationInitializePossibleSubsumptionMessageData* possSubsumMessageData = CObjectAllocator::allocateAndConstruct(mTempMemAllocMan); possSubsumMessageData->initClassificationPossibleSubsumptionMessageData(testingConcept,possSubsumerList,eqConceptsNonCandidatePossSubsumers,eqConNonCandPossSubsumerList); messageDataLinker = possSubsumMessageData->append(messageDataLinker); } } else { CClassPossibleSubsumptionMap* possSubsumMap = possSubsumRefLinkData->getClassPossibleSubsumptionMap(); if (possSubsumMap && possSubsumMap->hasRemainingPossibleSubsumptions()) { // update / prune possible subsumer list bool updatedPossSubsumptions = false; CClassPossibleSubsumptionMapIterator* possSubsumIt = possSubsumMap->getIterator(mReusePossSubsumMapIterator,calcAlgContext); mReusePossSubsumMapIterator = possSubsumIt; CReapplyConceptLabelSetIterator conSetIt = conSet->getConceptLabelSetIterator(true,true,false); while (possSubsumIt->hasNext() && conSetIt.hasNext()) { CConceptDescriptor* conDes = conSetIt.getConceptDescriptor(); CConcept* concept = conDes->getConcept(); bool negated = conDes->getNegation(); CConcept* possSubCon = possSubsumIt->getSubsumptionConcept(); cint64 conDesTag = conDes->getConceptTag(); cint64 possSubsumConTag = possSubCon->getConceptTag(); if (conDesTag == possSubsumConTag) { //if (concept->getOperatorCode() == CCEQCAND) { // if (!testSubsumerCandidatePossibleWithMergedSaturatedModel(indiNode,concept->getOperandList()->getData(),calcAlgContext)) { // updatedPossSubsumptions |= possSubsumIt->invalidateSubsumption(); // } //} possSubsumIt->moveNext(); conSetIt.moveNext(); } else if (conDesTag < possSubsumConTag) { conSetIt.moveNext(); } else if (possSubsumConTag < conDesTag) { if (possSubCon->getOperatorCode() != CCEQ) { updatedPossSubsumptions |= possSubsumIt->invalidateSubsumption(); } possSubsumIt->moveNext(); } } while (possSubsumIt->hasNext()) { CConcept* possSubCon = possSubsumIt->getSubsumptionConcept(); if (possSubCon->getOperatorCode() != CCEQ) { possSubsumIt->invalidateSubsumption(); } possSubsumIt->moveNext(); } if (updatedPossSubsumptions) { CClassificationUpdatePossibleSubsumptionMessageData* possSubsumMessageData = CObjectAllocator::allocateAndConstruct(mTempMemAllocMan); possSubsumMessageData->initClassificationPossibleSubsumptionMessageData(testingConcept); messageDataLinker = possSubsumMessageData->append(messageDataLinker); } } } } } return messageDataLinker; } void CSatisfiableTaskClassificationMessageAnalyser::verifySubsumptionPossibleWithModel(CIndividualProcessNode* indiNode, CConcept* testingConcept, CClassificationMessageData* possSubsumMessageData, CCLASSSUBSUMPTIONMESSAGELIST* subsumerList) { if (possSubsumMessageData) { if (possSubsumMessageData->getClassificationMessageDataType() == CClassificationInitializePossibleSubsumptionMessageData::TELLCLASSINITIALIZEPOSSIBLESUBSUM) { CClassificationInitializePossibleSubsumptionMessageData* initPossSubMessageData = (CClassificationInitializePossibleSubsumptionMessageData*)possSubsumMessageData; if (initPossSubMessageData) { CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* possSubsumList = initPossSubMessageData->getClassPossibleSubsumerList(); if (possSubsumList) { for (CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST::const_iterator it = possSubsumList->constBegin(), itEnd = possSubsumList->constEnd(); it != itEnd; ++it) { CClassificationInitializePossibleSubsumptionData* possSubsumData = *it; if (possSubsumData->isPossibleSubsumerValid()) { CConcept* possSubsumerConcept = possSubsumData->getPossibleSubsumerConcept(); if (possSubsumerConcept->getOperatorCode() == CCEQCAND) { possSubsumerConcept = possSubsumerConcept->getOperandList()->getData(); } } } } } } } } void CSatisfiableTaskClassificationMessageAnalyser::checkCanHaveClashWithModel(CIndividualProcessNode* indiNode, CConcept* concept, bool negated, bool& clashFoundFlag, bool& unknownFlag, bool& clashFreeFlag, cint64 depth, QSet* testedIndividualsSet, CIndividualProcessNode* lastNode, CIndividualProcessNodeVector* indiNodeVec) { if (depth > mMaxPossibleSubsumerNegationCheckingDepth) { unknownFlag = true; } else { if (indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDATEBLOCKERFLAGSCOMPINATION) || (lastNode != indiNode && testedIndividualsSet->contains(indiNode))) { unknownFlag = true; } else { if (lastNode != indiNode) { testedIndividualsSet->insert(indiNode); } CReapplyConceptLabelSet* labelSet = indiNode->getReapplyConceptLabelSet(false); bool containsNegated = false; CConceptDescriptor* conDes = nullptr; CCondensedReapplyQueue* reapplyQueue = labelSet->getConceptDescriptorAndReapplyQueue(concept,conDes,false); if (conDes || reapplyQueue) { if (conDes) { containsNegated = conDes->getNegation(); if (containsNegated ^ negated) { CDependencyTrackPoint* depTrackPoint = conDes->getDependencyTrackPoint(); if (!depTrackPoint || depTrackPoint->getBranchingTag() > 0) { unknownFlag = true; } else { clashFoundFlag = true; } } else { clashFreeFlag = true; } } else { unknownFlag = true; } } else { // not contained by the model cint64 opCode = concept->getOperatorCode(); cint64 opCount = concept->getOperandCount(); CConceptOperator* conOperator = concept->getConceptOperator(); if (negated && (opCode == CCAND) || !negated && (opCode == CCOR || opCode == CCEQ)) { bool allClashFoundFlag = true; bool oneClashFreeFoundFlag = false; bool oneUnknownFound = false; for (CSortedNegLinker* operandLinker = concept->getOperandList(); !oneClashFreeFoundFlag && operandLinker; operandLinker = operandLinker->getNext()) { CConcept* opConcept = operandLinker->getData(); bool opConNegation = operandLinker->isNegated() ^ negated; bool tmpClashFoundFlag = false; bool tmpClashFreeFoundFlag = false; bool tmpUnknownFound = false; checkCanHaveClashWithModel(indiNode,opConcept,opConNegation,tmpClashFoundFlag,tmpUnknownFound,tmpClashFreeFoundFlag,depth+1,testedIndividualsSet,indiNode,indiNodeVec); oneClashFreeFoundFlag |= tmpClashFreeFoundFlag; oneUnknownFound |= tmpUnknownFound; allClashFoundFlag &= tmpClashFoundFlag; } if (oneClashFreeFoundFlag) { clashFreeFlag = true; } else if (allClashFoundFlag) { clashFoundFlag = true; } else { unknownFlag = true; } } else if (opCount == 1 && (opCode == CCOR || opCode == CCEQ || opCode == CCAND)) { CSortedNegLinker* operandLinker = concept->getOperandList(); CConcept* opConcept = operandLinker->getData(); bool opConNegation = operandLinker->isNegated() ^ negated; checkCanHaveClashWithModel(indiNode,opConcept,opConNegation,clashFoundFlag,unknownFlag,clashFreeFlag,depth+1,testedIndividualsSet,indiNode,indiNodeVec); } else if (negated && (opCode == CCSUB || conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE))) { clashFreeFlag = true; } else if (opCode == CCAQCHOOCE) { bool allClashFoundFlag = true; bool oneClashFreeFoundFlag = false; bool oneUnknownFound = false; for (CSortedNegLinker* operandLinker = concept->getOperandList(); !oneClashFreeFoundFlag && operandLinker; operandLinker = operandLinker->getNext()) { CConcept* opConcept = operandLinker->getData(); bool opConNegation = operandLinker->isNegated(); if (opConNegation == negated) { bool tmpClashFoundFlag = false; bool tmpClashFreeFoundFlag = false; bool tmpUnknownFound = false; checkCanHaveClashWithModel(indiNode,opConcept,opConNegation,tmpClashFoundFlag,tmpUnknownFound,tmpClashFreeFoundFlag,depth+1,testedIndividualsSet,indiNode,indiNodeVec); oneClashFreeFoundFlag |= tmpClashFreeFoundFlag; oneUnknownFound |= tmpUnknownFound; allClashFoundFlag &= tmpClashFoundFlag; } } if (oneClashFreeFoundFlag) { clashFreeFlag = true; } else if (allClashFoundFlag) { clashFoundFlag = true; } else { unknownFlag = true; } } else if (negated && (opCode == CCSOME) || !negated && (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_AQALL_TYPE))) { CRole* role = concept->getRole(); CRoleSuccessorLinkIterator linkIt = indiNode->getRoleSuccessorLinkIterator(role); if (!linkIt.hasNext()) { clashFreeFlag = true; } else { bool oneClashFoundFlag = false; bool allClashFreeFoundFlag = true; bool oneUnknownFound = false; while (!oneClashFoundFlag && linkIt.hasNext()) { CIndividualLinkEdge* link = linkIt.next(true); cint64 succIndiID = link->getOppositeIndividualID(indiNode->getIndividualID()); CIndividualProcessNode* succIndiNode = indiNodeVec->getData(succIndiID); for (CSortedNegLinker* operandLinker = concept->getOperandList(); !oneClashFoundFlag && operandLinker; operandLinker = operandLinker->getNext()) { CConcept* opConcept = operandLinker->getData(); bool opConNegation = operandLinker->isNegated() ^ negated; bool tmpClashFoundFlag = false; bool tmpClashFreeFoundFlag = false; bool tmpUnknownFound = false; checkCanHaveClashWithModel(succIndiNode,opConcept,opConNegation,tmpClashFoundFlag,tmpUnknownFound,tmpClashFreeFoundFlag,depth+1,testedIndividualsSet,indiNode,indiNodeVec); allClashFreeFoundFlag &= tmpClashFreeFoundFlag; oneUnknownFound |= tmpUnknownFound; oneClashFoundFlag |= tmpClashFoundFlag; } } if (oneClashFoundFlag) { clashFreeFlag = true; } else if (allClashFreeFoundFlag) { clashFoundFlag = true; } else { unknownFlag = true; } } } else { unknownFlag = true; } } } } } bool CSatisfiableTaskClassificationMessageAnalyser::analyseSatisfiableTask(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContext* calcAlgContext) { mStatCalcTask = statCalcTask; mReusePossSubsumMapIterator = nullptr; CSatisfiableTaskClassificationMessageAdapter* classMessAdapter = statCalcTask->getClassificationMessageAdapter(); if (classMessAdapter) { mConRefLinkDataHash = classMessAdapter->getConceptReferenceLinkingDataHash(); CClassificationMessageDataObserver* classMessObserver = classMessAdapter->getClassificationMessageDataObserver(); CClassificationMessageData* subsumMessageDataLinker = nullptr; CClassificationMessageData* possSubsumMessageDataLinker = nullptr; CClassificationMessageData* pmMessageDataLinker = nullptr; bool extractSubsumersRootNode = classMessAdapter->hasExtractionFlags(CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTSUBSUMERSROOTNODE); bool extractSubsumersOtherNodes = classMessAdapter->hasExtractionFlags(CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTSUBSUMERSOTHERNODES); bool extractPossibleSubsumersRootNode = classMessAdapter->hasExtractionFlags(CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTPOSSIBLESUBSUMERSROOTNODE); bool extractPossibleSubsumersOtherNodes = classMessAdapter->hasExtractionFlags(CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTPOSSIBLESUBSUMERSOTHERNODES); bool extractPseudoModelRootNode = classMessAdapter->hasExtractionFlags(CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTIDENTIFIERPSEUDOMODEL); bool extractOtherNodesSingleDependency = classMessAdapter->hasExtractionFlags(CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTOTHERNODESSINGLEDEPENDENCY); bool extractOtherNodesMultipleDependency = classMessAdapter->hasExtractionFlags(CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTOTHERNODESMULTIPLEDEPENDENCY); bool considerRootNode = extractSubsumersRootNode | extractPossibleSubsumersRootNode; bool considerOtherNode = extractSubsumersOtherNodes | extractPossibleSubsumersOtherNodes; mMultiplePossSubsumInitAvoidHash = nullptr; mLastMergingTestNode = nullptr; mTestSaturatedMergedHash = nullptr; CTaskProcessorContext* taskProcessorContext = calcAlgContext->getUsedTaskProcessorContext(); CTaskHandleMemoryAllocationManager* taskMemMan = calcAlgContext->getTemporaryMemoryAllocationManager(); CConcept* testingConcept = classMessAdapter->getTestingConcept(); //QString iriClassNameString = CIRIName::getRecentIRIName(testingConcept->getClassNameLinker()); //if (iriClassNameString == "http://www.owllink.org/testsuite/galen#LowerLobeOfLeftLung") { // bool bug = true; //} //} //considerOtherNode = false; CConcreteOntology* testOntology = classMessAdapter->getTestingOntology(); CProcessingDataBox* processingDataBox = statCalcTask->getProcessingDataBox(); CIndividualProcessNode* constructedIndiNode = processingDataBox->getConstructedIndividualNode(); CIndividualProcessNodeVector* indiNodeVec = processingDataBox->getIndividualProcessNodeVector(); cint64 maxDetBranchTag = processingDataBox->getMaximumDeterministicBranchTag(); if (processingDataBox->getOntology()->getDataBoxes()->getMBox()->getValueSpacesTriggers(false)) { extractPseudoModelRootNode = false; } mUseAlwaysConRefLinkDataHash = false; if (testOntology && testingConcept && constructedIndiNode) { cint64 constructedID = constructedIndiNode->getIndividualID(); bool nondetMerged = false; CIndividualProcessNode* baseIndi = getCorrectedIndividualID(constructedIndiNode,indiNodeVec,&nondetMerged); cint64 baseIndiID = baseIndi->getIndividualID(); if (nondetMerged) { maxDetBranchTag = 0; } CPROCESSINGSET* analysedConceptSet = nullptr; CMemoryPoolContainer memPoolCon; CTaskMemoryPoolAllocationManager classMessMemManCreaterMemMan(&memPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mTempMemAllocMan = CObjectAllocator::allocateAndConstruct(&classMessMemManCreaterMemMan); mTempMemAllocMan->initTaskMemoryPoolAllocationManager(&memPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mTmpContext = CObjectParameterizingAllocator< CContextBase,CMemoryAllocationManager* >::allocateAndConstructAndParameterize(mTempMemAllocMan,mTempMemAllocMan); CCLASSSUBSUMPTIONMESSAGELIST* subsumerList = nullptr; if (considerRootNode) { CReapplyConceptLabelSet* conSet = baseIndi->getReapplyConceptLabelSet(false); if (conSet) { CReapplyConceptLabelSetIterator conSetIt = conSet->getConceptLabelSetIterator(true,true,true); while (conSetIt.hasNext()) { CConceptDescriptor* conDes = conSetIt.getConceptDescriptor(); if (conDes) { CConcept* concept = conDes->getConcept(); bool negated = conDes->getNegation(); if (concept->hasClassName()) { CDependencyTrackPoint* depTrackPoint = conSetIt.getDependencyTrackPoint(); bool deterministic = false; if (depTrackPoint) { if (depTrackPoint->getBranchingTag() <= maxDetBranchTag) { deterministic = true; } } if (extractSubsumersRootNode && deterministic && !negated && concept != testingConcept && concept->getConceptTag() != 1) { if (!subsumerList) { subsumerList = CObjectParameterizingAllocator< CCLASSSUBSUMPTIONMESSAGELIST,CContext* >::allocateAndConstructAndParameterize(mTempMemAllocMan,mTmpContext); } subsumerList->append(concept); } if (extractPossibleSubsumersRootNode && !negated) { CClassificationMessageData* messageData = extractPossibleSubsumptionInformation(conDes,baseIndi,conSet,calcAlgContext); if (messageData) { possSubsumMessageDataLinker = messageData->append(possSubsumMessageDataLinker); } if (conDes->getConcept() == testingConcept) { //verifySubsumptionPossibleWithModel(CIndividualProcessNode* indiNode, ); } } } } conSetIt.moveNext(); } } CClassificationSubsumptionMessageData* subsumMessageData = CObjectAllocator::allocateAndConstruct(mTempMemAllocMan); subsumMessageData->initClassificationSubsumptionMessageData(testingConcept,subsumerList); subsumMessageDataLinker = subsumMessageData->append(subsumMessageDataLinker); subsumerList = nullptr; STATINC(ANALYSESUBSUMERCOUNT,calcAlgContext); } if (considerOtherNode) { cint64 consideredOtherNodeCount = 0; cint64 extractedPossibleSubsumerOtherNodeCount = 0; CSuccessorIterator succIt(baseIndi->getSuccessorIterator()); if (succIt.hasNext()) { CPROCESSINGHASH succIndiProcHash(taskProcessorContext); CPROCESSINGLIST succIndiProcList(taskProcessorContext); CIndividualAnalyseProcessItem* baseAncItem = CObjectAllocator::allocateAndConstruct(taskMemMan); baseAncItem->initIndividualAnalyseProcessItem(baseIndi->getIndividualID(),0,nullptr,nullptr); succIndiProcHash.insert(0,baseAncItem); while (succIt.hasNext()) { CIndividualLinkEdge* succLink = succIt.nextLink(); cint64 succIndiID = succLink->getOppositeIndividualID(baseIndiID); if (!succIndiProcHash.contains(succIndiID)) { CIndividualAnalyseProcessItem* indiAnProcItem = CObjectAllocator::allocateAndConstruct(taskMemMan); indiAnProcItem->initIndividualAnalyseProcessItem(succIndiID,1,baseAncItem,succLink); succIndiProcHash.insert(succIndiID,indiAnProcItem); succIndiProcList.append(indiAnProcItem); } } while (!succIndiProcList.isEmpty()) { ++consideredOtherNodeCount; CIndividualAnalyseProcessItem* indiAnProcItem = succIndiProcList.takeFirst(); cint64 indiID = indiAnProcItem->mIndiID; CIndividualProcessNode* indiNode = indiNodeVec->getData(indiID); if (!indiNode->isNominalIndividual() && !indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDATEBLOCKERFLAGSCOMPINATION)) { CConceptDescriptor* analyseConDes = nullptr; CConceptDescriptor* conDesSingleDep = nullptr; CReapplyConceptLabelSet* conSet = indiNode->getReapplyConceptLabelSet(false); CConceptDescriptor* conDesMultipleIt = conSet->getAddingSortedConceptDescriptionLinker(); if (extractOtherNodesMultipleDependency) { analyseConDes = conDesMultipleIt; if (conDesMultipleIt) { conDesMultipleIt = conDesMultipleIt->getNext(); } } if (conDesMultipleIt || extractOtherNodesSingleDependency) { if (!indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { conDesSingleDep = getIndividualProcessNodeConceptWithSingleAncestorDependency(indiNode,indiAnProcItem,calcAlgContext); } } if (!conDesSingleDep) { analyseConDes = conDesMultipleIt; } while (analyseConDes) { if (analyseConDes && analyseConDes->getConcept() != testingConcept && analyseConDes->getConceptTag() != 1 && !analyseConDes->isNegated() && analyseConDes->getConcept()->hasClassName()) { CConcept* analyseConcept = analyseConDes->getConcept(); // test whether the concept has already been analyzed bool analysationRequired = false; CConceptReferenceLinking* conRefLinking = nullptr; CConceptData* conData = analyseConcept->getConceptData(); if (conData && !mUseAlwaysConRefLinkDataHash) { CConceptProcessData* conProcData = (CConceptProcessData*)conData; if (!conProcData->isInvalidatedReferenceLinking()) { conRefLinking = conProcData->getConceptReferenceLinking(); } } CClassificationConceptReferenceLinking* classConRefLinkData = nullptr; if (!conRefLinking) { classConRefLinkData = mConRefLinkDataHash->value(analyseConcept); } else { CConceptSatisfiableReferenceLinkingData* conSatRefLinkData = (CConceptSatisfiableReferenceLinkingData*)conRefLinking; classConRefLinkData = conSatRefLinkData->getClassifierReferenceLinkingData(); } if (classConRefLinkData) { CClassificationSatisfiableCalculationConceptReferenceLinking* classSatCalcConRefLinkData = (CClassificationSatisfiableCalculationConceptReferenceLinking*)classConRefLinkData; analysationRequired = classSatCalcConRefLinkData->isMoreConceptClassificationInformationRequired(); } CDependencyTrackPoint* analyseDepTrackPoint = analyseConDes->getDependencyTrackPoint(); if (analysationRequired && analyseDepTrackPoint) { cint64 analyseBranchTag = analyseDepTrackPoint->getBranchingTag(); bool branchingError = false; if (!analysedConceptSet) { analysedConceptSet = CObjectParameterizingAllocator< CPROCESSINGSET,CContext* >::allocateAndConstructAndParameterize(taskMemMan,taskProcessorContext); } if (!analysedConceptSet->contains(analyseConcept)) { analysedConceptSet->insert(analyseConcept); if (extractSubsumersOtherNodes && analyseConDes == conDesSingleDep) { if (conSet) { CReapplyConceptLabelSetIterator conSetIt = conSet->getConceptLabelSetIterator(true,true,false); while (conSetIt.hasNext() && !branchingError) { CConceptDescriptor* conDes = conSetIt.getConceptDescriptor(); if (conDes) { CConcept* concept = conDes->getConcept(); bool negated = conDes->getNegation(); if (concept->hasClassName()) { CDependencyTrackPoint* depTrackPoint = conSetIt.getDependencyTrackPoint(); bool deterministic = false; if (depTrackPoint) { if (depTrackPoint->getBranchingTag() == analyseBranchTag) { deterministic = true; } else if (depTrackPoint->getBranchingTag() < analyseBranchTag) { branchingError = true; } } if (deterministic && !negated && concept != analyseConcept && concept->getConceptTag() != 1) { if (!subsumerList) { subsumerList = CObjectParameterizingAllocator< CCLASSSUBSUMPTIONMESSAGELIST,CContext* >::allocateAndConstructAndParameterize(mTempMemAllocMan,mTmpContext); } subsumerList->append(concept); } } } conSetIt.moveNext(); } } } if (!branchingError && subsumerList) { CClassificationSubsumptionMessageData* subsumMessageData = CObjectAllocator::allocateAndConstruct(mTempMemAllocMan); subsumMessageData->initClassificationSubsumptionMessageData(analyseConcept,subsumerList); subsumMessageDataLinker = subsumMessageData->append(subsumMessageDataLinker); subsumerList = nullptr; STATINC(ANALYSESUBSUMERCOUNT,calcAlgContext); } if (extractPossibleSubsumersOtherNodes) { CClassificationMessageData* messageData = extractPossibleSubsumptionInformation(analyseConDes,indiNode,conSet,calcAlgContext); if (messageData) { ++extractedPossibleSubsumerOtherNodeCount; possSubsumMessageDataLinker = messageData->append(possSubsumMessageDataLinker); } } } } } if (extractOtherNodesMultipleDependency) { if (analyseConDes == conDesMultipleIt) { conDesMultipleIt = conDesMultipleIt->getNext(); } analyseConDes = conDesMultipleIt; if (conDesMultipleIt) { conDesMultipleIt = conDesMultipleIt->getNext(); } } else { analyseConDes = nullptr; } } // next successor nodes CSuccessorIterator nextSuccIt(indiNode->getSuccessorIterator()); while (nextSuccIt.hasNext()) { CIndividualLinkEdge* nextSuccLink = nextSuccIt.nextLink(); cint64 nextSuccIndiID = nextSuccLink->getOppositeIndividualID(indiID); if (!succIndiProcHash.contains(nextSuccIndiID)) { CIndividualAnalyseProcessItem* nextIndiAnProcItem = CObjectAllocator::allocateAndConstruct(taskMemMan); nextIndiAnProcItem->initIndividualAnalyseProcessItem(nextSuccIndiID,indiAnProcItem->mRootDistance+1,indiAnProcItem,nextSuccLink); succIndiProcHash.insert(nextSuccIndiID,nextIndiAnProcItem); succIndiProcList.append(nextIndiAnProcItem); } } } } } mStatConsideredOtherNodeCount += consideredOtherNodeCount; mStatExtractedPossibleSubsumerOtherNodeCount += extractedPossibleSubsumerOtherNodeCount; } if (extractPseudoModelRootNode) { // create pseudo model mMaxPseudoModelDepth = 3; mMaxPseudoModelNodes = 30; cint64 currentPMModelNodesCount = 0; CConceptReferenceLinking* conRefLinking = nullptr; CConceptData* conData = testingConcept->getConceptData(); if (conData && !mUseAlwaysConRefLinkDataHash) { CConceptProcessData* conProcData = (CConceptProcessData*)conData; if (!conProcData->isInvalidatedReferenceLinking()) { conRefLinking = conProcData->getConceptReferenceLinking(); } } CClassificationConceptReferenceLinking* classConRefLinkData = nullptr; if (!conRefLinking) { classConRefLinkData = mConRefLinkDataHash->value(testingConcept); } else { CConceptSatisfiableReferenceLinkingData* conSatRefLinkData = (CConceptSatisfiableReferenceLinkingData*)conRefLinking; classConRefLinkData = conSatRefLinkData->getClassifierReferenceLinkingData(); } if (classConRefLinkData) { CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking* possSubsumRefLinkData = (CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking*)classConRefLinkData; if (possSubsumRefLinkData) { CMemoryPoolContainer pmMemPoolCon; CTaskMemoryPoolAllocationManager classMessMemManCreaterMemMan(&pmMemPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mPMTempMemAllocMan = CObjectAllocator::allocateAndConstruct(&classMessMemManCreaterMemMan); mPMTempMemAllocMan->initTaskMemoryPoolAllocationManager(&pmMemPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mPMTmpContext = CObjectParameterizingAllocator< CContextBase,CMemoryAllocationManager* >::allocateAndConstructAndParameterize(mPMTempMemAllocMan,mPMTempMemAllocMan); CClassificationClassPseudoModel* pmModel = possSubsumRefLinkData->getClassPseudoModel(); CClassificationClassPseudoModelHash* pmModelHash = CObjectParameterizingAllocator< CClassificationClassPseudoModelHash,CContext* >::allocateAndConstructAndParameterize(mPMTempMemAllocMan,mPMTmpContext); cint64 nextModelID = 1; CPseudoModelAnalyseProcessItem* basePMItem = CObjectAllocator::allocateAndConstruct(taskMemMan); basePMItem->initPseudoModelAnalyseProcessItem(0,0); CXNegLinker* pmBaseNodeLinker = CObjectAllocator< CXNegLinker >::allocateAndConstruct(taskMemMan); pmBaseNodeLinker->initNegLinker(baseIndi,false); basePMItem->addNodeLinker(pmBaseNodeLinker); CXLinker* processItemLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(taskMemMan); processItemLinker->initLinker(basePMItem); while (processItemLinker) { ++currentPMModelNodesCount; CXLinker* tmpItemLinker = processItemLinker; processItemLinker = processItemLinker->getNext(); CPseudoModelAnalyseProcessItem* pmAnalyseProcessItem = tmpItemLinker->getData(); cint64 pmModelID = pmAnalyseProcessItem->mPMModelID; CClassificationClassPseudoModelData* pmModel = pmModelHash->getPseudoModelData(pmModelID,true); bool vaidConcepts = true; bool vaidSuccessors = true; for (CXNegLinker* nodeIt = pmAnalyseProcessItem->mNodeLinker; nodeIt; nodeIt = nodeIt->getNext()) { CIndividualProcessNode* node = nodeIt->getData(); bool blockedOrCached = node->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINVALIDATEBLOCKERFLAGSCOMPINATION | CIndividualProcessNode::PRFSATURATIONBLOCKINGCACHED) || node->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED) && !node->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALID |CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED); if (blockedOrCached) { vaidConcepts = false; vaidSuccessors = false; } bool nominalNode = node->isNominalIndividual(); if (nominalNode) { vaidSuccessors = false; } } if (pmAnalyseProcessItem->mRootDistance > mMaxPseudoModelDepth || currentPMModelNodesCount > mMaxPseudoModelNodes) { vaidSuccessors = false; } pmModel->setValidConceptMap(vaidConcepts); pmModel->setValidRoleMap(vaidSuccessors); if (vaidConcepts) { // update pseudo model concept map CClassificationClassPseudoModelConceptMap* pmModelConMap = pmModel->getPseudoModelConceptMap(true); for (CXNegLinker* nodeIt = pmAnalyseProcessItem->mNodeLinker; nodeIt; nodeIt = nodeIt->getNext()) { bool nonDeterministicConnected = nodeIt->isNegated(); CIndividualProcessNode* node = nodeIt->getData(); CReapplyConceptLabelSet* conSet = node->getReapplyConceptLabelSet(false); if (conSet) { CReapplyConceptLabelSetIterator conSetIt = conSet->getConceptLabelSetIterator(true,true,false); while (conSetIt.hasNext()) { CConceptDescriptor* conDes = conSetIt.getConceptDescriptor(); if (conDes) { CDependencyTrackPoint* depTrackPoint = conSetIt.getDependencyTrackPoint(); bool deterministic = false; if (depTrackPoint) { if (depTrackPoint->getBranchingTag() <= maxDetBranchTag) { if (!nonDeterministicConnected) { deterministic = true; } } } CConcept* concept = conDes->getConcept(); cint64 conOpCode = concept->getOperatorCode(); bool insertCon = false; if (!conDes->isNegated()) { if ((concept->hasClassName() && conOpCode == CCATOM) || conOpCode == CCSUB || conOpCode == CCIMPLTRIG || conOpCode == CCEQCAND) { insertCon = true; } } if (insertCon) { pmModelConMap->insert(CConceptTagComparer(concept),CClassificationClassPseudoModelConceptData(deterministic)); } } conSetIt.moveNext(); } } } } if (vaidSuccessors) { // update pseudo model role map CPROCESSINGSET processedRoles(taskProcessorContext); CClassificationClassPseudoModelRoleMap* pmModelRoleMap = pmModel->getPseudoModelRoleMap(true); for (CXNegLinker* nodeIt = pmAnalyseProcessItem->mNodeLinker; nodeIt; nodeIt = nodeIt->getNext()) { bool nonDeterministicConnected = nodeIt->isNegated(); CIndividualProcessNode* node = nodeIt->getData(); CRoleSuccessorIterator roleIt = node->getRoleIterator(); while (roleIt.hasNext()) { CRole* role = roleIt.next(); if (!role->isComplexRole()) { // do not analyze complex roles if (!processedRoles.contains(role)) { processedRoles.insert(role); CPROCESSINGSET roleSuccessorIDSet(taskProcessorContext); // collect all successors for this role over all nodes cint64 lowerDetAtLeastBound = 0; cint64 upperAtLeastBound = 0; cint64 upperDetAtMostBound = CINT64_MAX; cint64 lowerAtMostBound = CINT64_MAX; CXNegLinker* succNodeLinker = nullptr; bool hasDeterministicSuccessor = false; for (CXNegLinker* nodeIt2 = pmAnalyseProcessItem->mNodeLinker; nodeIt2; nodeIt2 = nodeIt2->getNext()) { CIndividualProcessNode* node2 = nodeIt2->getData(); CReapplyRoleSuccessorHash* roleSuccHash = node2->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { cint64 linkCount = 0; CRoleSuccessorLinkIterator roleSuccIt = roleSuccHash->getRoleSuccessorLinkIterator(role,&linkCount); upperAtLeastBound = qMax(upperAtLeastBound,linkCount); lowerAtMostBound = qMin(lowerAtMostBound,linkCount); while (roleSuccIt.hasNext()) { CIndividualLinkEdge* succLink = roleSuccIt.next(); cint64 succIndiID = succLink->getOppositeIndividualID(node2); if (!roleSuccessorIDSet.contains(succIndiID)) { roleSuccessorIDSet.insert(succIndiID); bool deterministicLink = !nonDeterministicConnected; CDependencyTrackPoint* depTrackPoint = succLink->getDependencyTrackPoint(); if (depTrackPoint && depTrackPoint->getBranchingTag() <= maxDetBranchTag) { lowerDetAtLeastBound = qMax(lowerDetAtLeastBound,(cint64)1); if (!nonDeterministicConnected) { hasDeterministicSuccessor = true; } deterministicLink = false; } CIndividualProcessNode* succIndiNode = indiNodeVec->getData(succIndiID); CXNegLinker* nextSuccNodeLinker = CObjectAllocator< CXNegLinker >::allocateAndConstruct(taskMemMan); nextSuccNodeLinker->initNegLinker(succIndiNode,deterministicLink); succNodeLinker = nextSuccNodeLinker->append(succNodeLinker); } } } else { lowerAtMostBound = 0; } CReapplyConceptLabelSet* conSet = node2->getReapplyConceptLabelSet(false); if (conSet) { for (CConceptDescriptor* conDesLinkerIt = conSet->getAddingSortedConceptDescriptionLinker(); conDesLinkerIt; conDesLinkerIt = conDesLinkerIt->getNextConceptDesciptor()) { CConcept* concept = conDesLinkerIt->getConcept(); if (concept->getRole() == role) { bool conNegation = conDesLinkerIt->getNegation(); cint64 opCode = concept->getOperatorCode(); CDependencyTrackPoint* depTrackPoint = conDesLinkerIt->getDependencyTrackPoint(); if (depTrackPoint && depTrackPoint->getBranchingTag() <= maxDetBranchTag) { if (!conNegation && opCode == CCATLEAST || conNegation && opCode == CCATMOST) { cint64 atLeastParam = concept->getParameter() + 1 * conNegation; if (atLeastParam >= 0) { lowerDetAtLeastBound = qMax(lowerDetAtLeastBound,atLeastParam); } } else if (conNegation && opCode == CCATLEAST || !conNegation && opCode == CCATMOST && concept->getOperandList() == nullptr) { cint64 atMostParam = concept->getParameter() - 1 * conNegation; if (atMostParam >= 0) { upperDetAtMostBound = qMin(upperDetAtMostBound,atMostParam); } } } } } } } cint64 succPMModelID = 0; if (succPMModelID == 0) { succPMModelID = nextModelID++; } CClassificationClassPseudoModelRoleData& roleSuccModelData = (*pmModelRoleMap)[CRoleTagComparer(role)]; roleSuccModelData.setSuccessorModelID(succPMModelID); roleSuccModelData.setDeterministic(hasDeterministicSuccessor); roleSuccModelData.setLowerAtLeastBound(lowerDetAtLeastBound); roleSuccModelData.setUpperAtLeastBound(upperAtLeastBound); roleSuccModelData.setUpperAtMostBound(upperDetAtMostBound); roleSuccModelData.setLowerAtMostBound(lowerAtMostBound); CPseudoModelAnalyseProcessItem* roleSuccessorsPMItem = CObjectAllocator::allocateAndConstruct(taskMemMan); roleSuccessorsPMItem->initPseudoModelAnalyseProcessItem(succPMModelID,pmAnalyseProcessItem->mRootDistance+1); roleSuccessorsPMItem->addNodeLinker(succNodeLinker); CXLinker* nextProcessItemLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(taskMemMan); nextProcessItemLinker->initLinker(roleSuccessorsPMItem); processItemLinker = nextProcessItemLinker->append(processItemLinker); } } } } } } STATINC(ANALYSEPSEUDOMODELCOUNT,calcAlgContext); CClassificationPseudoModelIdentifierMessageData* pmMessageData = CObjectAllocator::allocateAndConstruct(mTempMemAllocMan); pmMessageData->initClassificationPseudoModelIdentifierMessageData(testingConcept,pmModelHash,pmMemPoolCon.takeMemoryPools()); pmMessageDataLinker = pmMessageData->append(pmMessageDataLinker); } } } CClassificationMessageData* messageDataLinker = subsumMessageDataLinker; if (pmMessageDataLinker) { messageDataLinker = pmMessageDataLinker->append(messageDataLinker); } if (possSubsumMessageDataLinker) { messageDataLinker = possSubsumMessageDataLinker->append(messageDataLinker); } if (messageDataLinker) { classMessObserver->tellClassificationMessage(testOntology,messageDataLinker,memPoolCon.takeMemoryPools()); } else { taskMemMan->releaseTemporaryMemoryPools(memPoolCon.takeMemoryPools()); } return true; } } return false; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CConceptNominalSchemaGroundingHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CConceptNominalSchemaGroundingHandle0000644000175000017500000001255012520551004032254 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CCONCEPTNOMINALSCHEMAGROUNDINGHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CCONCEPTNOMINALSCHEMAGROUNDINGHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CConceptNominalSchemaGroundingHasher.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; namespace Algorithm { typedef QPair TConceptPropagationBindingPair; /*! * * \class CConceptNominalSchemaGroundingHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptNominalSchemaGroundingHandler { // public methods public: //! Constructor CConceptNominalSchemaGroundingHandler(); CSortedNegLinker* getGroundingConceptLinker(CIndividualProcessNode* processNode, CPropagationBindingSet* propBindSet, CConcept* concept, bool negated, CPROCESSINGHASH*& groundedConPropBindDesHash, CPROCESSINGHASH*& additionalPropBindDesHash, CCalculationAlgorithmContext* calcAlgContext); CSortedNegLinker* getGroundingConceptLinker(CIndividualProcessNode* processNode, CVariableBindingPathSet* varBindPathSet, CConcept* concept, bool negated, CPROCESSINGHASH*& groundedConVarBindPathDesHash, CCalculationAlgorithmContext* calcAlgContext); CSortedNegLinker* getGroundingConceptLinker(CIndividualProcessNode* processNode, CRepresentativeVariableBindingPathMap* repVarBindPathSetMap, CConcept* concept, bool negated, CPROCESSINGHASH*& groundedConVarBindPathHash, CCalculationAlgorithmContext* calcAlgContext); // protected methods protected: CConcept* getNominalConcept(CIndividualProcessNode* processNode, bool forceNotPruned, CCalculationAlgorithmContext* calcAlgContext); void collectAllNominalConcepts(CPROCESSINGSET*& allNominalConceptSet, CCalculationAlgorithmContext* calcAlgContext); void addConceptOperand(CConcept* concept, CConcept* opConcept, bool negated); CConcept* createNominalSchemaConceptCopy(CConcept* concept); CConcept* createGroundedNominalSchemaConcept(CConcept* concept, CBOXHASH* templConNomSchConHash, QHash::const_iterator >* nomSchConIndividualItHash, CCalculationAlgorithmContext* calcAlgContext); CSortedNegLinker* createGroundedNominalSchemaConcept(CConcept* concept, bool negated, CReapplyConceptLabelSet* conLabelSet, CBOXHASH* templConNomSchConHash, QHash::const_iterator >* nomSchConIndividualItHash, CCalculationAlgorithmContext* calcAlgContext); CSortedNegLinker* createNominalSchemaGroundingConcepts(CIndividualProcessNode* indiProcessNode, CConcept* concept, bool negated, CPROCESSINGHASH* nominalSchemaVarBindedNominalHash, CPROCESSINGHASH*& groundedConPropBindDesHash, CNominalSchemaTemplate* nsTemplate, CCalculationAlgorithmContext* calcAlgContext); CSortedNegLinker* createNominalSchemaGroundingConcepts(CIndividualProcessNode* indiProcessNode, CConcept* concept, bool negated, CPROCESSINGHASH* nominalSchemaVarBindedNominalHash, CNominalSchemaTemplate* nsTemplate, CCalculationAlgorithmContext* calcAlgContext); bool forceExtensionLocalisation(CCalculationAlgorithmContext* calcAlgContext); // protected variables protected: CMemoryAllocationManager* mMemMan; CConceptVector* mConceptVec; CConceptNominalSchemaGroundingHash* mReplaceHash; CProcessingDataBox* mDataBox; bool mLocalizedExtensions; bool mConfReuseGroundedNominalSchemaConcepts; // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CCONCEPTNOMINALSCHEMAGROUNDINGHANDLER_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualNodeBackendCacheHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualNodeBackendCacheHandler.c0000644000175000017500000003262012520551006032044 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualNodeBackendCacheHandler.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CIndividualNodeBackendCacheHandler::CIndividualNodeBackendCacheHandler(CBackendRepresentativeMemoryCacheReader* backAssCacheReader, CBackendRepresentativeMemoryCacheWriter* backAssCacheWriter) { mAssBackCacheReader = backAssCacheReader; mAssBackCacheWriter = backAssCacheWriter; mStatCreatedTempLabels = 0; mStatReusedTempLabels = 0; mStatReusedCachedLabels = 0; mStatReusedHashedIndiLabels = 0; mStatReusedHashedSignatureLabels = 0; mTmpContext = nullptr; mMemAllocMan = nullptr; mWriteData = nullptr; } bool CIndividualNodeBackendCacheHandler::prepareCacheMessages(CCalculationAlgorithmContext* calcAlgContext) { if (!mMemAllocMan) { CTaskMemoryPoolAllocationManager satCacheMemManCreaterMemMan(&mMemPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mMemAllocMan = CObjectAllocator::allocateAndConstruct(&satCacheMemManCreaterMemMan); mMemAllocMan->initTaskMemoryPoolAllocationManager(&mMemPoolCon,calcAlgContext->getTemporaryMemoryAllocationManager()); mTmpContext = CObjectParameterizingAllocator< CContextBase,CMemoryAllocationManager* >::allocateAndConstructAndParameterize(mMemAllocMan,mMemAllocMan); return true; } return false; } bool CIndividualNodeBackendCacheHandler::commitCacheMessages(CCalculationAlgorithmContext* calcAlgContext) { if (mWriteData) { CBackendRepresentativeMemoryCacheLabelAssociationWriteData* commitWriteData = nullptr; CBackendRepresentativeMemoryCacheLabelAssociationWriteData* writeDataIt = mWriteData; while (writeDataIt) { CBackendRepresentativeMemoryCacheLabelAssociationWriteData* tmpWriteData = writeDataIt; writeDataIt = (CBackendRepresentativeMemoryCacheLabelAssociationWriteData*)writeDataIt->getNext(); tmpWriteData->clearNext(); if (commitWriteData) { commitWriteData = (CBackendRepresentativeMemoryCacheLabelAssociationWriteData*)tmpWriteData->append(commitWriteData); } else { commitWriteData = tmpWriteData; } } mAssBackCacheWriter->writeCachedData(commitWriteData,mMemPoolCon.takeMemoryPools()); mWriteData = nullptr; mMemAllocMan = nullptr; mTmpContext = nullptr; return true; } return false; } bool CIndividualNodeBackendCacheHandler::addCacheMessages(CBackendRepresentativeMemoryCacheLabelAssociationWriteData* backAssWriteData, CCalculationAlgorithmContext* calcAlgContext) { if (mWriteData) { mWriteData = (CBackendRepresentativeMemoryCacheLabelAssociationWriteData*)backAssWriteData->append(mWriteData); } else { mWriteData = backAssWriteData; } return true; } bool CIndividualNodeBackendCacheHandler::findAssociationBackendCardinality(CIndividualProcessNode* indiNode, CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tmpAssWriteDataLinker, CCalculationAlgorithmContext* calcAlgContext) { CReapplyConceptLabelSet* conSet = indiNode->getReapplyConceptLabelSet(false); if (!conSet) { return false; } return false; } bool CIndividualNodeBackendCacheHandler::findAssociationBackendLabel(CIndividualProcessNode* indiNode, CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tmpAssWriteDataLinker, CCalculationAlgorithmContext* calcAlgContext) { CReapplyConceptLabelSet* conSet = indiNode->getReapplyConceptLabelSet(false); if (!conSet) { return false; } QPair* hashedRefPair = nullptr; if (indiNode->getNominalIndividual() == nullptr) { QPair& refPair = (*mIndiNodeRefLabelHash)[indiNode]; if (refPair.first) { tmpAssWriteDataLinker->setReferredLabelData(refPair.first); ++mStatReusedHashedIndiLabels; return true; } else if (refPair.second) { tmpAssWriteDataLinker->setReferredTemporaryLabelData(refPair.second); ++mStatReusedHashedIndiLabels; return true; } hashedRefPair = &refPair; } CIndividual* nominalIndi = indiNode->getNominalIndividual(); CConcept* nomIndiConcept = nullptr; if (nominalIndi) { nomIndiConcept = nominalIndi->getIndividualNominalConcept(); } CConceptSetSignature conSetSignature; for (CConceptDescriptor* conDesIt = conSet->getAddingSortedConceptDescriptionLinker(); conDesIt; conDesIt = conDesIt->getNext()) { CConcept* concept = conDesIt->getConcept(); bool negation = conDesIt->isNegated(); if (concept != nomIndiConcept) { conSetSignature.addConceptSignature(concept,negation); } } cint64 conSetSigValue = conSetSignature.getSignatureValue(); cint64 conCount = conSet->getConceptCount(); if (nomIndiConcept) { --conCount; } CBackendRepresentativeMemoryLabelCacheItem* cachedLabelItem = mAssBackCacheReader->getLabelCacheEntry(conSetSigValue,conCount,conSet->getAddingSortedConceptDescriptionLinker(),nomIndiConcept); if (cachedLabelItem) { ++mStatReusedCachedLabels; if (hashedRefPair) { hashedRefPair->first = cachedLabelItem; } tmpAssWriteDataLinker->setReferredLabelData(cachedLabelItem); return true; } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker*& prevTempRefLabels = (*mSignatureTmpRefLabelHash)[conSetSigValue]; if (prevTempRefLabels) { for (CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* prevTempRefLabelIt = prevTempRefLabels; prevTempRefLabelIt; prevTempRefLabelIt = prevTempRefLabelIt->getNext()) { if (prevTempRefLabelIt->getDeterministicCacheValueCount() == conCount) { bool compatibleConcepts = true; for (CBackendRepresentativeMemoryLabelValueLinker* labelValueLinkerIt = prevTempRefLabelIt->getDeterministicCacheValueLinker(); labelValueLinkerIt && compatibleConcepts; labelValueLinkerIt = labelValueLinkerIt->getNext()) { CCacheValue cacheValue = labelValueLinkerIt->getCacheValue(); CConcept* concept = (CConcept*)cacheValue.getIdentification(); bool negation = cacheValue.getCacheValueIdentifier() == CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; if (!conSet->hasConcept(concept,negation)) { compatibleConcepts = false; } } if (compatibleConcepts) { ++mStatReusedHashedSignatureLabels; ++mStatReusedTempLabels; if (hashedRefPair) { hashedRefPair->second = prevTempRefLabelIt; } tmpAssWriteDataLinker->setReferredTemporaryLabelData(prevTempRefLabelIt); return true; } } } } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* newTempRefLabel = CObjectAllocator< CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker >::allocateAndConstruct(mMemAllocMan); newTempRefLabel->initLabelWriteData(conSetSigValue); newTempRefLabel->setCompletelySaturated(false); newTempRefLabel->setCompletelyHandled(true); for (CConceptDescriptor* conDesIt = conSet->getAddingSortedConceptDescriptionLinker(); conDesIt; conDesIt = conDesIt->getNext()) { CConcept* concept = conDesIt->getConcept(); bool negation = conDesIt->isNegated(); CBackendRepresentativeMemoryLabelValueLinker* labelValueLinker = CObjectAllocator< CBackendRepresentativeMemoryLabelValueLinker >::allocateAndConstruct(mMemAllocMan); labelValueLinker->initLabelValueLinker(getCacheValue(concept,negation)); newTempRefLabel->appendDeterministicCacheValueLinker(labelValueLinker); } mNewTmpLabelList->append(newTempRefLabel); ++mStatCreatedTempLabels; if (hashedRefPair) { hashedRefPair->second = newTempRefLabel; } tmpAssWriteDataLinker->setReferredTemporaryLabelData(newTempRefLabel); prevTempRefLabels = newTempRefLabel->append(prevTempRefLabels); return true; } const CCacheValue CIndividualNodeBackendCacheHandler::getCacheValue(CConcept* concept, bool negation) { return mAssBackCacheReader->getCacheValue(concept,negation); } CBackendRepresentativeMemoryCacheIndividualAssociationData* CIndividualNodeBackendCacheHandler::getIndividualAssociationData(CIndividual* individual) { return mAssBackCacheReader->getIndividualAssociation(individual); } bool CIndividualNodeBackendCacheHandler::hasConceptIndividualAssociation(CBackendRepresentativeMemoryCacheIndividualAssociationData* associationData, CConcept* concept, bool negation, CCalculationAlgorithmContext* calcAlgContext) { CBackendRepresentativeMemoryLabelCacheItem* backendLabelItem = associationData->getBackendLabelCacheEntry(); if (backendLabelItem) { CCACHINGHASH* valueHash = backendLabelItem->getDeterministicTagCacheValueHash(false); if (valueHash) { CBackendRepresentativeMemoryLabelValueLinker* valueLinker = valueHash->value(concept->getConceptTag()); if (valueLinker && valueLinker->getCacheValue() == getCacheValue(concept,negation)) { return true; } } } return false; } bool CIndividualNodeBackendCacheHandler::tryAssociateNodesWithBackendCache(CIndividualProcessNodeLinker* indiNodeLinker, CCalculationAlgorithmContext* calcAlgContext) { mIndiNodeRefLabelHash = CObjectParameterizingAllocator< CPROCESSHASH< CIndividualProcessNode*,QPair >, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); mSignatureTmpRefLabelHash = CObjectParameterizingAllocator< CPROCESSHASH, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); mNewTmpLabelList = CObjectParameterizingAllocator< CPROCESSLIST< CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* >, CContext* >::allocateAndConstructAndParameterize(calcAlgContext->getUsedTemporaryMemoryAllocationManager(),calcAlgContext->getUsedTaskProcessorContext()); prepareCacheMessages(calcAlgContext); CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* tmpAssWriteDataLinker = nullptr; for (CIndividualProcessNodeLinker* indiNodeLinkerIt = indiNodeLinker; indiNodeLinkerIt; indiNodeLinkerIt = indiNodeLinkerIt->getNext()) { CIndividualProcessNode* indiNode = indiNodeLinkerIt->getProcessingIndividual(); CIndividual* nominalIndividual = indiNode->getNominalIndividual(); if (nominalIndividual) { CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker* newAssWriteDataLinker = CObjectAllocator< CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker >::allocateAndConstruct(mMemAllocMan); newAssWriteDataLinker->initAccociationWriteData(nominalIndividual); findAssociationBackendLabel(indiNode,newAssWriteDataLinker,calcAlgContext); tmpAssWriteDataLinker = newAssWriteDataLinker->append(tmpAssWriteDataLinker); } } CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* tempLabelWriteDataLinker = nullptr; for (CPROCESSLIST< CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* >::const_iterator it = mNewTmpLabelList->constBegin(), itEnd = mNewTmpLabelList->constEnd(); it != itEnd; ++it) { CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker* newTmpLabelLinker = (*it); newTmpLabelLinker->clearNext(); tempLabelWriteDataLinker = newTmpLabelLinker->append(tempLabelWriteDataLinker); } CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker* tempCardWriteDataLinker = nullptr; CBackendRepresentativeMemoryCacheLabelAssociationWriteData* writeData = CObjectAllocator< CBackendRepresentativeMemoryCacheLabelAssociationWriteData >::allocateAndConstruct(mMemAllocMan); writeData->initWriteData(tmpAssWriteDataLinker,tempLabelWriteDataLinker,tempCardWriteDataLinker); addCacheMessages(writeData,calcAlgContext); commitCacheMessages(calcAlgContext); return false; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBooleanValueSpaceHandler.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBooleanValueSp0000644000175000017500000000466012520551006032273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEBOOLEANVALUESPACEHANDLER_H #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEBOOLEANVALUESPACEHANDLER_H // Libraries includes // Namespace includes #include "AlgorithmSettings.h" #include "CCalculationAlgorithmContext.h" #include "CIndividualProcessNodeCompareValueSpaceHandler.h" // Other includes #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CProcessingDataBox.h" #include "Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h" #include "Context/CContextBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Kernel { using namespace Process; using namespace Dependency; namespace Algorithm { /*! * * \class CIndividualProcessNodeBooleanValueSpaceHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessNodeBooleanValueSpaceHandler : public CIndividualProcessNodeCompareValueSpaceHandler { // public methods public: //! Constructor CIndividualProcessNodeBooleanValueSpaceHandler(CDatatypeValueSpaceType* valueSpaceType); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDIVIDUALPROCESSNODEBOOLEANVALUESPACEHANDLER_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationErrorProcessingException.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CCalculationErrorProcessingException0000644000175000017500000000337512520551002032420 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationErrorProcessingException.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CCalculationErrorProcessingException::CCalculationErrorProcessingException(CCalculationErrorProcessingException::ERRORCODE errorCode) { mErrorCode = errorCode; } CCalculationErrorProcessingException::~CCalculationErrorProcessingException() { } CCalculationErrorProcessingException::ERRORCODE CCalculationErrorProcessingException::getErrorCode() const { return mErrorCode; } bool CCalculationErrorProcessingException::hasError() const { return mErrorCode != ECNOERROR; } CCalculationErrorProcessingException CCalculationErrorProcessingException::getNominalMissingErrorException() { return CCalculationErrorProcessingException(ECNOMINALMISSING); } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskIncrementalConsistencyPreyingAnalyser.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskIncrementalConsisten0000644000175000017500000003030512520551014032351 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableTaskIncrementalConsistencyPreyingAnalyser.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Algorithm { CSatisfiableTaskIncrementalConsistencyPreyingAnalyser::CSatisfiableTaskIncrementalConsistencyPreyingAnalyser() { } CSatisfiableTaskIncrementalConsistencyPreyingAnalyser::~CSatisfiableTaskIncrementalConsistencyPreyingAnalyser() { } bool CSatisfiableTaskIncrementalConsistencyPreyingAnalyser::analyseSatisfiableTask(CSatisfiableCalculationTask* statCalcTask, CCalculationAlgorithmContext* calcAlgContext) { CSatisfiableTaskIncrementalConsistencyTestingAdapter* incConsAdapter = statCalcTask->getSatisfiableTaskIncrementalConsistencyTestingAdapter(); if (incConsAdapter) { CConsistenceObserver* consObs = nullptr; consObs = incConsAdapter->getConsistenceObserver(); if (consObs) { CConcreteOntology* prevConsOntology = incConsAdapter->getPreviousConsistentOntology(); CConsistenceTaskData* prevConsTaskData = nullptr; if (prevConsOntology) { CConsistence* prevConsistence = prevConsOntology->getConsistence(); if (prevConsistence) { CConsistenceData* prevConsData = prevConsistence->getConsistenceModelData(); if (prevConsData) { prevConsTaskData = dynamic_cast(prevConsData); } } } CSatisfiableCalculationTask* rootStatCalcTask = (CSatisfiableCalculationTask*)statCalcTask->getRootTask(); CIncrementalConsistenceTaskData* consTaskData = new CIncrementalConsistenceTaskData(rootStatCalcTask,statCalcTask,prevConsOntology,prevConsTaskData); analyseIncrementalChanges(statCalcTask,consTaskData,calcAlgContext); consObs->tellConsistenceData(consTaskData); return true; } } return false; } CIndividualProcessNode* CSatisfiableTaskIncrementalConsistencyPreyingAnalyser::getMergedIntoIndividualNode(CIndividualProcessNode* indiNode, CIndividualProcessNodeVector* indiNodeVec, CCalculationAlgorithmContext* calcAlgContext) { CIndividualProcessNode* mergedIntoIndiNode = indiNode; while (mergedIntoIndiNode && mergedIntoIndiNode->getMergedIntoIndividualNodeID() != mergedIntoIndiNode->getIndividualID()) { mergedIntoIndiNode = indiNodeVec->getData(mergedIntoIndiNode->getMergedIntoIndividualNodeID()); } return mergedIntoIndiNode; } bool CSatisfiableTaskIncrementalConsistencyPreyingAnalyser::analyseIncrementalChanges(CSatisfiableCalculationTask* statCalcTask, CIncrementalConsistenceTaskData* incConsData, CCalculationAlgorithmContext* calcAlgContext) { CConcreteOntology* prevConsOntology = incConsData->getPreviousOntology(); CConsistenceTaskData* prevConsTaskData = incConsData->getPreviousConsistenceData(); QSet* indirectlyChangedNodeSet = incConsData->getIndirectlyChangedNodeSet(); QSet* deterministicallyChangedNodeSet = incConsData->getDeterministicallyChangedNodeSet(); QSet* changedCompatibleNodeSet = incConsData->getChangedCompatibleNodeSet(); if (prevConsTaskData) { CSatisfiableCalculationTask* prevCompGraphCalcTask = prevConsTaskData->getCompletionGraphCachedSatisfiableTask(); CIndividualProcessNodeVector* indiNodeVec = statCalcTask->getProcessingDataBox()->getIndividualProcessNodeVector(); CIndividualProcessNodeVector* prevIndiNodeVec = prevCompGraphCalcTask->getProcessingDataBox()->getIndividualProcessNodeVector(); cint64 incExpID = statCalcTask->getProcessingDataBox()->getIncrementalExpansionID(); cint64 indiNodeCount = indiNodeVec->getItemCount(); cint64 addNodeCount = 0; cint64 totalNodeCount = 0; cint64 prevNodeCount = 0; statCalcTask->getProcessingDataBox()->setMaxIncrementalPreviousCompletionGraphNodeID(prevIndiNodeVec->getItemCount()); for (cint64 i = 0; i < indiNodeCount; ++i) { CIndividualProcessNode* indiNode = indiNodeVec->getData(i); CIndividualProcessNode* prevIndiNode = prevIndiNodeVec->getData(i); if (prevIndiNode) { ++prevNodeCount; } if (indiNode) { ++totalNodeCount; if (!prevIndiNode) { ++addNodeCount; } if (!indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED) || prevIndiNode && !prevIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFPURGEDBLOCKED) && prevIndiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFSUCCESSORNOMINALCONNECTION)) { bool indirectlyChanged = false; bool deterministicallyChanged = false; if (prevIndiNode || indiNode->isNominalIndividual()) { if (indiNode != prevIndiNode) { indirectlyChangedNodeSet->insert(i); indirectlyChanged = true; } if (indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFINCREMENTALEXPANDING)) { if (indiNode->getIncrementalExpansionID() == incExpID) { deterministicallyChangedNodeSet->insert(i); deterministicallyChanged = true; } } } if (indirectlyChanged || deterministicallyChanged) { bool compatible = false; if (indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHED) && !indiNode->hasPartialProcessingRestrictionFlags(CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALID | CIndividualProcessNode::PRFCOMPLETIONGRAPHCACHINGINVALIDATED)) { compatible = true; } else { CIndividualProcessNode* mergedIntoIndiNode = getMergedIntoIndividualNode(indiNode,indiNodeVec,calcAlgContext); if (prevIndiNode) { CIndividualProcessNode* prevMergedIntoIndiNode = getMergedIntoIndividualNode(prevIndiNode,prevIndiNodeVec,calcAlgContext); if (mergedIntoIndiNode->getIndividualID() == prevMergedIntoIndiNode->getIndividualID()) { CReapplyConceptLabelSet* conSet = mergedIntoIndiNode->getReapplyConceptLabelSet(false); if (conSet && prevMergedIntoIndiNode) { CReapplyConceptLabelSet* prevConSet = prevMergedIntoIndiNode->getReapplyConceptLabelSet(false); if (prevConSet && prevConSet->getConceptSignatureValue() == conSet->getConceptSignatureValue() && conSet->getConceptCount() == prevConSet->getConceptCount()) { CReapplyConceptLabelSetIterator prevConIt = prevConSet->getConceptLabelSetIterator(true); CReapplyConceptLabelSetIterator conIt = conSet->getConceptLabelSetIterator(true); bool identicalLabels = true; while (prevConIt.hasValue() && conIt.hasValue() && identicalLabels) { CConceptDescriptor* conDes = conIt.getConceptDescriptor(); CConceptDescriptor* prevConDes = prevConIt.getConceptDescriptor(); if (conDes && prevConDes) { if (conDes->getConcept() != prevConDes->getConcept()) { identicalLabels = false; } if (conDes->isNegated() != prevConDes->isNegated()) { identicalLabels = false; } } else if (conDes || prevConDes) { identicalLabels = false; } conIt.moveNext(); prevConIt.moveNext(); } if (conIt.hasNext() || prevConIt.hasNext()) { identicalLabels = false; } if (identicalLabels) { compatible = true; } } } } } } if (compatible) { // test for problematic at-most cardinality restrictions bool problematicConcepts = false; CReapplyConceptLabelSet* conSet = indiNode->getReapplyConceptLabelSet(false); for (CConceptDescriptor* conDesIt = conSet->getAddingSortedConceptDescriptionLinker(); conDesIt && !problematicConcepts; conDesIt = conDesIt->getNext()) { CConcept* concept = conDesIt->getConcept(); bool negation = conDesIt->isNegated(); cint64 opCode = concept->getOperatorCode(); if (!negation && opCode == CCATMOST || negation && opCode == CCATLEAST) { problematicConcepts = true; } } bool problematicNeighbour = false; if (problematicConcepts) { CSuccessorIterator succIt(indiNode->getSuccessorIterator()); while (succIt.hasNext() && !problematicNeighbour) { CIndividualLinkEdge* succLink = succIt.nextLink(); CIndividualProcessNode* succIndi = getSuccessorIndividual(indiNode,succLink,calcAlgContext); if (succIndi->isNominalIndividual()) { if (!prevIndiNode->hasRoleSuccessorToIndividual(succLink->getLinkRole(),succIndi->getIndividualID(),false)) { problematicNeighbour = true; } } } CConnectionSuccessorSetIterator connIt(indiNode->getConnectionSuccessorIterator()); while (connIt.hasNext() && !problematicNeighbour) { cint64 connID = connIt.next(); CIndividualProcessNode* connIndiNode = indiNodeVec->getData(connID); if (connIndiNode->isNominalIndividual()) { CIndividualProcessNode* prevConnIndiNode = prevIndiNodeVec->getData(connID); if (prevConnIndiNode) { CSuccessorRoleIterator connRoleIt(connIndiNode->getSuccessorRoleIterator(indiNode)); while (connRoleIt.hasNext() && !problematicNeighbour) { CIndividualLinkEdge* connLink = connRoleIt.next(); if (!prevConnIndiNode->hasRoleSuccessorToIndividual(connLink->getLinkRole(),prevIndiNode,false)) { problematicNeighbour = true; } } } else { problematicNeighbour = true; } } } } if (!problematicConcepts || !problematicNeighbour) { changedCompatibleNodeSet->insert(i); } } } } } } incConsData->setAddedNodeCount(addNodeCount); incConsData->setPreviousNodeCount(prevNodeCount); incConsData->setTotalNodeCount(totalNodeCount); } return true; } CIndividualProcessNode* CSatisfiableTaskIncrementalConsistencyPreyingAnalyser::getSuccessorIndividual(CIndividualProcessNode*& indi, CIndividualLinkEdge* link, CCalculationAlgorithmContext* calcAlgContext) { CIndividualProcessNode* succIndi = nullptr; if (link->isLocalizationTagUpToDate(calcAlgContext->getUsedProcessTagger()->getCurrentLocalizationTag())) { succIndi = link->getOppositeIndividual(indi); } else { STATINC(INDINODEUPDATELOADCOUNT,calcAlgContext); succIndi = link->getOppositeIndividual(indi); if (!succIndi->isLocalizationTagUpToDate(calcAlgContext->getUsedProcessTagger()->getCurrentLocalizationTag()) && succIndi->isRelocalized()) { cint64 succIndiId = link->getOppositeIndividualID(indi); CIndividualProcessNodeVector* indiProcNodeVec = calcAlgContext->getProcessingDataBox()->getIndividualProcessNodeVector(); succIndi = indiProcNodeVec->getData(succIndiId); } } return succIndi; } }; // end namespace Algorithm }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/0000755000175000017500000000000012613407254023522 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CCalculationAdapter.cpp0000644000175000017500000000222412405707542030072 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationFactory.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Calculation { CCalculationFactory::CCalculationFactory() { } CCalculationFactory::~CCalculationFactory() { } }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConcurrentTaskCalculationManager.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConcurrentTaskCalculationManager.0000644000175000017500000000630512520551044032243 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CALCULATION_CCONCURRENTTASKCALCULATIONMANAGER_H #define KONCLUDE_REASONER_KERNEL_CALCULATION_CCONCURRENTTASKCALCULATIONMANAGER_H // Libraries includes // Namespace includes #include "CCalculationManager.h" #include "CConcurrentTaskCalculationEnvironment.h" // Other includes #include "Reasoner/Generator/CSatisfiableCalculationTaskFromCalculationJobGenerator.h" #include "Reasoner/Query/CSatisfiableCalculationJob.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Query; using namespace Generator; namespace Kernel { namespace Calculation { /*! * * \class CConcurrentTaskCalculationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcurrentTaskCalculationManager : public CCalculationManager { // public methods public: //! Constructor CConcurrentTaskCalculationManager(CWatchDog *watchDog = 0); virtual CCalculationManager *calculateJobs(const QList< QPair >& jobCallbackList); virtual CCalculationManager *calculateJob(CCalculationJob* job, CCallbackData* callbackData = nullptr); virtual CCalculationManager *calculateTask(CSatisfiableCalculationTask* task); virtual CCalculationManager *initializeManager(CCalculationEnvironmentFactory *contextFactory, CConfigurationProvider *configurationProvider); virtual CCalculationEnviroment *getCalculationContext(); virtual QString getCalculationErrorString(cint64 errorCode); virtual QHash* getCalculationStatistics(); virtual QHash* getUpdatedCalculationStatistics(QHash* stat); virtual double getCalculationApproximatedRemainingTasksCount(); // protected methods protected: // protected variables protected: CCalculationEnviroment *calcContext; CConcurrentTaskCalculationEnvironment* mTaskCalcEn; CGeneratorTaskHandleContextBase* mGenTaskHandleContext; CMemoryTemporaryAllocationManager* mTemMemMan; // private methods private: // private variables private: }; }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CALCULATION_CCONCURRENTTASKCALCULATIONMANAGER_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConfigDependedCalculationFactory.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConfigDependedCalculationFactory.0000644000175000017500000000527512520551044032176 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CALCULATION_CCONFIGDEPENDEDCALCULATIONFACTORY_H #define KONCLUDE_REASONER_KERNEL_CALCULATION_CCONFIGDEPENDEDCALCULATIONFACTORY_H // Libraries includes // Namespace includes #include "CCalculationFactory.h" #include "CConcurrentTaskCalculationManager.h" #include "CCalculationEnvironmentFactory.h" #include "CConfigDependedCalculationEnvironmentFactory.h" #include "CTaskHandleAlgorithmBuilder.h" // Other includes #include "Reasoner/Kernel/Task/CSatisfiableCalculationTaskJobCallbackExecuter.h" #include "Config/CConfigurationProvider.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Kernel { namespace Calculation { /*! * * \class CConfigDependedCalculationFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConfigDependedCalculationFactory : public CCalculationFactory { // public methods public: //! Constructor CConfigDependedCalculationFactory(CTaskHandleAlgorithmBuilder* taskHandleAlgBuilder); //! Destructor virtual ~CConfigDependedCalculationFactory(); virtual CCalculationManager* createCalculationManager(CConfigurationProvider* configurationProvider); virtual CCalculationManager* initializeManager(CCalculationManager* calculationManager, CConfigurationProvider* configurationProvider); // protected methods protected: // protected variables protected: CTaskHandleAlgorithmBuilder* mTaskHandleAlgBuilder; // private methods private: // private variables private: }; }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CALCULATION_CCONFIGDEPENDEDCALCULATIONFACTORY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CCalculationEnvironmentFactory.cpp0000644000175000017500000000232112520551044032334 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationEnvironmentFactory.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Calculation { CCalculationEnvironmentFactory::CCalculationEnvironmentFactory() { } CCalculationEnvironmentFactory::~CCalculationEnvironmentFactory() { } }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CTaskHandleAlgorithmBuilder.h0000644000175000017500000000400512520551044031163 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CALCULATION_CTASKHANDLEALGORITHMBUILDER_H #define KONCLUDE_REASONER_KERNEL_CALCULATION_CTASKHANDLEALGORITHMBUILDER_H // Libraries includes // Namespace includes // Other includes #include "Scheduler/CTaskHandleAlgorithm.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; namespace Reasoner { namespace Kernel { namespace Calculation { /*! * * \class CTaskHandleAlgorithmBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaskHandleAlgorithmBuilder { // public methods public: //! Constructor CTaskHandleAlgorithmBuilder(); //! Destructor virtual ~CTaskHandleAlgorithmBuilder(); virtual CTaskHandleAlgorithm *createTaskHandleAlgorithm() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CALCULATION_CTASKHANDLEALGORITHMBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CCalculationEnviroment.cpp0000644000175000017500000000225112520551042030626 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationEnviroment.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Calculation { CCalculationEnviroment::CCalculationEnviroment() { } CCalculationEnviroment::~CCalculationEnviroment() { } }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CCalculationEnviroment.h0000644000175000017500000000362712520551044030305 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONENVIROMENT_H #define KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONENVIROMENT_H // Libraries includes // Namespace includes // Other includes #include "Config/CConfigurationProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Kernel { namespace Calculation { /*! * * \class CCalculationEnviroment * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationEnviroment { // public methods public: //! Constructor CCalculationEnviroment(); //! Destructor virtual ~CCalculationEnviroment(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONENVIROMENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CCalculationFactory.h0000644000175000017500000000424512520551044027563 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONFACTORY_H #define KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONFACTORY_H // Libraries includes // Namespace includes #include "CCalculationManager.h" // Other includes #include "Config/CConfigurationProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Kernel { namespace Calculation { /*! * * \class CCalculationFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationFactory { // public methods public: //! Constructor CCalculationFactory(); //! Destructor virtual ~CCalculationFactory(); virtual CCalculationManager* createCalculationManager(CConfigurationProvider* configurationProvider) = 0; virtual CCalculationManager* initializeManager(CCalculationManager* calculationManager, CConfigurationProvider* configurationProvider) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONFACTORY_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConfigDependedCalculationFactory.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConfigDependedCalculationFactory.0000644000175000017500000000544112520551044032171 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfigDependedCalculationFactory.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Calculation { CConfigDependedCalculationFactory::CConfigDependedCalculationFactory(CTaskHandleAlgorithmBuilder* taskHandleAlgBuilder) { mTaskHandleAlgBuilder = taskHandleAlgBuilder; } CConfigDependedCalculationFactory::~CConfigDependedCalculationFactory() { } CCalculationManager *CConfigDependedCalculationFactory::createCalculationManager(CConfigurationProvider* configurationProvider) { CCalculationManager* calculationManager = nullptr; CConfigurationBase* config = nullptr; if (configurationProvider) { config = configurationProvider->getCurrentConfiguration(); } CWatchDog *watchDog = 0; bool configErrorFlag = false; bool taskCalcManager = false; bool workCalcManager = false; QString calcManagerString = CConfigDataReader::readConfigString(config,"Konclude.Execution.CalculationManager",QString(),&configErrorFlag); if (!configErrorFlag) { if (calcManagerString.isEmpty() || calcManagerString == "Konclude.Calculation.Calculator.ConcurrentTaskCalculationManager") { taskCalcManager = true; } else { taskCalcManager = true; } } else { taskCalcManager = true; } if (taskCalcManager) { calculationManager = new CConcurrentTaskCalculationManager(watchDog); } return calculationManager; } CCalculationManager* CConfigDependedCalculationFactory::initializeManager(CCalculationManager* calculationManager, CConfigurationProvider* configurationProvider) { CCalculationEnvironmentFactory *calcContextFactory = new CConfigDependedCalculationEnvironmentFactory(mTaskHandleAlgBuilder); calculationManager->initializeManager(calcContextFactory,configurationProvider); return calculationManager; } }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConfigDependedCalculationEnvironmentFactory.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConfigDependedCalculationEnvironm0000644000175000017500000001422312520551044032277 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfigDependedCalculationEnvironmentFactory.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Calculation { CConfigDependedCalculationEnvironmentFactory::CConfigDependedCalculationEnvironmentFactory(CTaskHandleAlgorithmBuilder* taskHandleAlgBuilder) { mTaskHandleAlgBuilder = taskHandleAlgBuilder; } CConfigDependedCalculationEnvironmentFactory::~CConfigDependedCalculationEnvironmentFactory() { } CCalculationEnviroment *CConfigDependedCalculationEnvironmentFactory::createCalculationContext(CConfigurationProvider* configProvider) { CCalculationEnviroment *context = nullptr; CConfigurationBase* config = nullptr; if (configProvider) { config = configProvider->getCurrentConfiguration(); } CWatchDog *watchDog = 0; bool configErrorFlag = false; bool taskCalcManager = false; QString calcManagerString = CConfigDataReader::readConfigString(config,"Konclude.Execution.CalculationManager",QString(),&configErrorFlag); if (!configErrorFlag) { if (calcManagerString.isEmpty() || calcManagerString == "Konclude.Calculation.Calculator.ConcurrentTaskCalculationManager") { taskCalcManager = true; } else { taskCalcManager = true; } } else { taskCalcManager = true; } if (taskCalcManager) { CConcurrentTaskCalculationEnvironment *taskContext = new CConcurrentTaskCalculationEnvironment(); qint64 taskProcessorCount = 1; QString taskProcessorCountString = CConfigDataReader::readConfigString(config,"Konclude.Calculation.ProcessorCount",QString(),&configErrorFlag); if (!configErrorFlag) { if (taskProcessorCountString == "AUTO") { taskProcessorCount = CThread::idealThreadCount(); } qint64 convertedTaskProcessorCount = taskProcessorCountString.toInt(&configErrorFlag); if (configErrorFlag) { taskProcessorCount = convertedTaskProcessorCount; } } CCentralizedAllocationConfigProvidedDependendLimitation* allocLimitation = new CCentralizedAllocationConfigProvidedDependendLimitation(configProvider,"Konclude.Calculation.Memory"); taskContext->setAllocationLimitation(allocLimitation); CSatisfiableCalculationTaskJobCallbackExecuter* callbackExecuter = new CSatisfiableCalculationTaskJobCallbackExecuter(); taskContext->initCallbackExecuter(callbackExecuter); CSatisfiableCalculationTaskStatusPropagator* taskStatusPropagator = new CSatisfiableCalculationTaskStatusPropagator(); taskContext->initStatusPropagator(taskStatusPropagator); if (taskProcessorCount <= 1) { CTaskHandleAlgorithm* taskHandleAlg = mTaskHandleAlgBuilder->createTaskHandleAlgorithm(); CConsiderateMemoryPoolProvider* memProv = new CNewCentralizedLimitedAllocationMemoryPoolProvider(allocLimitation->getLimitator()); CSingleThreadTaskProcessorUnit* singlePocessUnit = new CSingleThreadTaskProcessorUnit(taskHandleAlg,memProv); singlePocessUnit->startProcessing(); taskContext->initSingleTaskProcessor(singlePocessUnit); singlePocessUnit->installCallbackExecuter(callbackExecuter); singlePocessUnit->installStatusPropagator(taskStatusPropagator); } else { CTaskHandleAlgorithm* completorTaskHandleAlg = mTaskHandleAlgBuilder->createTaskHandleAlgorithm(); CTaskHandleAlgorithm* schedulerTaskHandleAlg = mTaskHandleAlgBuilder->createTaskHandleAlgorithm(); CConsiderateMemoryPoolProvider* compMemProv = new CNewCentralizedLimitedAllocationMemoryPoolProvider(allocLimitation->getLimitator()); CConsiderateMemoryPoolProvider* schedMemProv = new CNewCentralizedLimitedAllocationMemoryPoolProvider(allocLimitation->getLimitator()); CTaskProcessorCompletorThread* completorUnit = new CTaskProcessorCompletorThread(completorTaskHandleAlg,compMemProv); CTaskProcessorSchedulerThread* schedulerUnit = new CTaskProcessorSchedulerThread(schedulerTaskHandleAlg,completorUnit,schedMemProv); completorUnit->installScheduler(schedulerUnit); schedulerUnit->installScheduler(schedulerUnit); completorUnit->installCallbackExecuter(callbackExecuter); schedulerUnit->installCallbackExecuter(callbackExecuter); completorUnit->installStatusPropagator(taskStatusPropagator); schedulerUnit->installStatusPropagator(taskStatusPropagator); completorUnit->startProcessing(); schedulerUnit->startProcessing(); taskContext->initMultiTaskProcessor(schedulerUnit,completorUnit); while (taskProcessorCount-- > 2) { CTaskHandleAlgorithm* taskHandleAlg = mTaskHandleAlgBuilder->createTaskHandleAlgorithm(); CConsiderateMemoryPoolProvider* memProv = new CNewCentralizedLimitedAllocationMemoryPoolProvider(allocLimitation->getLimitator()); CTaskProcessorThread* taskProcessor = new CTaskProcessorThread(taskHandleAlg,completorUnit,memProv); taskProcessor->installScheduler(schedulerUnit); taskProcessor->installCallbackExecuter(callbackExecuter); taskProcessor->installStatusPropagator(taskStatusPropagator); taskProcessor->startProcessing(); taskContext->appendMultiTaskProcessor(taskProcessor); } } context = taskContext; } return context; } }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CTaskHandleAlgorithmBuilder.cpp0000644000175000017500000000230212520551044031514 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaskHandleAlgorithmBuilder.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Calculation { CTaskHandleAlgorithmBuilder::CTaskHandleAlgorithmBuilder() { } CTaskHandleAlgorithmBuilder::~CTaskHandleAlgorithmBuilder() { } }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CCalculationManager.cpp0000644000175000017500000000327412520551044030062 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationManager.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Calculation { CCalculationManager::CCalculationManager() { } CCalculationManager::~CCalculationManager() { } CCalculationManager* CCalculationManager::calculateJobs(const QList< QPair >& jobCallbackList) { for (QList< QPair >::const_iterator it = jobCallbackList.constBegin(), itEnd = jobCallbackList.constEnd(); it != itEnd; ++it) { QPair jobCallbackPair(*it); CCalculationJob* job(jobCallbackPair.first); CCallbackData* callbackData(jobCallbackPair.second); calculateJob(job,callbackData); } return this; } }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConfigDependedCalculationEnvironmentFactory.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConfigDependedCalculationEnvironm0000644000175000017500000000554212520551044032303 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CALCULATION_CCONFIGDEPENDEDCALCULATIONENVIRONMENTFACTORY_H #define KONCLUDE_REASONER_KERNEL_CALCULATION_CCONFIGDEPENDEDCALCULATIONENVIRONMENTFACTORY_H // Libraries includes // Namespace includes #include "CConcurrentTaskCalculationEnvironment.h" #include "CCalculationEnvironmentFactory.h" #include "CTaskHandleAlgorithmBuilder.h" // Other includes #include "Reasoner/Kernel/Task/CSatisfiableCalculationTaskJobCallbackExecuter.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTaskStatusPropagator.h" #include "Config/CConfigurationProvider.h" #include "Config/CConfigDataReader.h" #include "Utilities/Memory/CCentralizedAllocationConfigProvidedDependendLimitation.h" #include "Utilities/Memory/CNewCentralizedLimitedAllocationMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Scheduler; using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { namespace Calculation { /*! * * \class CConfigDependedCalculationEnvironmentFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConfigDependedCalculationEnvironmentFactory : public CCalculationEnvironmentFactory { // public methods public: //! Constructor CConfigDependedCalculationEnvironmentFactory(CTaskHandleAlgorithmBuilder* taskHandleAlgBuilder); //! Destructor virtual ~CConfigDependedCalculationEnvironmentFactory(); virtual CCalculationEnviroment *createCalculationContext(CConfigurationProvider* configProvider); // protected methods protected: // protected variables protected: CTaskHandleAlgorithmBuilder* mTaskHandleAlgBuilder; // private methods private: // private variables private: }; }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CALCULATION_CCONFIGDEPENDEDCALCULATIONENVIRONMENTFACTORY_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConcurrentTaskCalculationManager.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConcurrentTaskCalculationManager.0000644000175000017500000002053112520551044032240 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcurrentTaskCalculationManager.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Calculation { CConcurrentTaskCalculationManager::CConcurrentTaskCalculationManager(CWatchDog *watchDog) { calcContext = nullptr; mTaskCalcEn = nullptr; mGenTaskHandleContext = nullptr; mTemMemMan = nullptr; } CCalculationManager *CConcurrentTaskCalculationManager::calculateTask(CSatisfiableCalculationTask* task) { if (mTaskCalcEn) { CTaskEventCommunicator::postSendTaskScheduleEvent(mTaskCalcEn->getSchedulerTaskProcessorUnit()->getEventHandler(),task,mTemMemMan); } return this; } CCalculationManager *CConcurrentTaskCalculationManager::calculateJob(CCalculationJob* job, CCallbackData* callbackData) { CSatisfiableCalculationTaskFromCalculationJobGenerator gen(mGenTaskHandleContext); CSatisfiableCalculationTask* task = gen.createSatisfiableCalculationTask(job,callbackData); if (task) { calculateTask(task); } return this; } CCalculationManager* CConcurrentTaskCalculationManager::calculateJobs(const QList< QPair >& jobCallbackList) { CSatisfiableCalculationTask* taskLinker = nullptr; CSatisfiableCalculationTaskFromCalculationJobGenerator gen(mGenTaskHandleContext); for (QList< QPair >::const_iterator it = jobCallbackList.constBegin(), itEnd = jobCallbackList.constEnd(); it != itEnd; ++it) { QPair jobCallbackPair(*it); CCalculationJob* job(jobCallbackPair.first); CCallbackData* callbackData(jobCallbackPair.second); CSatisfiableCalculationTask* task = gen.createSatisfiableCalculationTask(job,callbackData); if (task) { taskLinker = (CSatisfiableCalculationTask*)task->append(taskLinker); } } if (taskLinker) { calculateTask(taskLinker); } return this; } CCalculationManager *CConcurrentTaskCalculationManager::initializeManager(CCalculationEnvironmentFactory *contextFactory, CConfigurationProvider *configurationProvider) { CConfigurationBase *config = 0; calcContext = contextFactory->createCalculationContext(configurationProvider); mTaskCalcEn = dynamic_cast(calcContext); mGenTaskHandleContext = new CGeneratorTaskHandleContextBase(); mTemMemMan = mGenTaskHandleContext->getTaskHandleMemoryAllocationManager(); return this; } CCalculationEnviroment *CConcurrentTaskCalculationManager::getCalculationContext() { return calcContext; } QString CConcurrentTaskCalculationManager::getCalculationErrorString(cint64 errorCode) { switch (errorCode) { case 1: { return QString("Nominal couldn't be resolved."); } case 2: { return QString("Memory allocation failed / out of memory / memory allocation limit reached."); } case 3: { return QString("Unknow fatal error."); } } return QString("Unknown error."); } QHash* CConcurrentTaskCalculationManager::getCalculationStatistics() { QHash* statHash = new QHash(); CConcurrentTaskCalculationEnvironment* conTaskEnv = dynamic_cast(calcContext); if (conTaskEnv) { statHash->insert(QString("calculation-computing-time"),conTaskEnv->getCalculationComputionTime()); statHash->insert(QString("calculation-blocking-time"),conTaskEnv->getCalculationBlockingTime()); statHash->insert(QString("calculation-memory-consumption"),conTaskEnv->getCalculationMemoryConsumption()); statHash->insert(QString("calculation-memory-reservation"),conTaskEnv->getCalculationMemoryReserved()); statHash->insert(QString("calculation-tasks-processed-count"),conTaskEnv->getCalculationStatisticTasksProcessedCount()); statHash->insert(QString("calculation-tasks-created-count"),conTaskEnv->getCalculationStatisticTasksCreatedCount()); statHash->insert(QString("calculation-tasks-added-count"),conTaskEnv->getCalculationStatisticTasksAddedCount()); statHash->insert(QString("calculation-tasks-updated-count"),conTaskEnv->getCalculationStatisticTasksUpdatedCount()); statHash->insert(QString("calculation-tasks-completed-count"),conTaskEnv->getCalculationStatisticTasksCompletedCount()); statHash->insert(QString("calculation-tasks-requested-count"),conTaskEnv->getCalculationStatisticTasksRequestedCount()); statHash->insert(QString("calculation-threads-blocking-count"),conTaskEnv->getCalculationStatisticThreadsBlockedCount()); statHash->insert(QString("calculation-threads-events-processed-count"),conTaskEnv->getCalculationStatisticEventsProcessedCount()); } return statHash; } QHash* CConcurrentTaskCalculationManager::getUpdatedCalculationStatistics(QHash* stat) { QHash* statHash = new QHash(); CConcurrentTaskCalculationEnvironment* conTaskEnv = dynamic_cast(calcContext); if (conTaskEnv && stat) { statHash->insert(QString("calculation-computing-time"),conTaskEnv->getCalculationComputionTime() - stat->value("calculation-computing-time",0)); statHash->insert(QString("calculation-blocking-time"),conTaskEnv->getCalculationBlockingTime() - stat->value("calculation-blocking-time",0)); statHash->insert(QString("calculation-memory-consumption"),conTaskEnv->getCalculationMemoryConsumption()); statHash->insert(QString("calculation-memory-reservation"),conTaskEnv->getCalculationMemoryReserved()); statHash->insert(QString("calculation-tasks-processed-count"),conTaskEnv->getCalculationStatisticTasksProcessedCount() - stat->value("calculation-tasks-processed-count",0)); statHash->insert(QString("calculation-tasks-created-count"),conTaskEnv->getCalculationStatisticTasksCreatedCount() - stat->value("calculation-tasks-created-count",0)); statHash->insert(QString("calculation-tasks-added-count"),conTaskEnv->getCalculationStatisticTasksAddedCount() - stat->value("calculation-tasks-added-count",0)); statHash->insert(QString("calculation-tasks-updated-count"),conTaskEnv->getCalculationStatisticTasksUpdatedCount() - stat->value("calculation-tasks-updated-count",0)); statHash->insert(QString("calculation-tasks-completed-count"),conTaskEnv->getCalculationStatisticTasksCompletedCount() - stat->value("calculation-tasks-completed-count",0)); statHash->insert(QString("calculation-tasks-requested-count"),conTaskEnv->getCalculationStatisticTasksRequestedCount() - stat->value("calculation-tasks-requested-count",0)); statHash->insert(QString("calculation-threads-blocking-count"),conTaskEnv->getCalculationStatisticThreadsBlockedCount() - stat->value("calculation-threads-blocking-count",0)); statHash->insert(QString("calculation-threads-events-processed-count"),conTaskEnv->getCalculationStatisticEventsProcessedCount() - stat->value("calculation-threads-events-processed-count",0)); } return statHash; } double CConcurrentTaskCalculationManager::getCalculationApproximatedRemainingTasksCount() { CConcurrentTaskCalculationEnvironment* conTaskEnv = dynamic_cast(calcContext); if (conTaskEnv) { return conTaskEnv->getCalculationApproximatedRemainingTasksCount(); } return 0.; } }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CCalculationManager.h0000644000175000017500000000532612520551044027527 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONMANAGER_H #define KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONMANAGER_H // Libraries includes // Namespace includes #include "CCalculationEnviroment.h" #include "CCalculationEnvironmentFactory.h" // Other includes #include "Reasoner/Query/CCalculationJob.h" #include "Config/CConfigurationProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Query; namespace Kernel { namespace Calculation { /*! * * \class CCalculationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationManager { // public methods public: //! Constructor CCalculationManager(); //! Destructor virtual ~CCalculationManager(); virtual CCalculationManager *calculateJob(CCalculationJob* job, CCallbackData* callbackData = nullptr) = 0; virtual CCalculationManager *calculateJobs(const QList< QPair >& jobCallbackList); virtual CCalculationManager *initializeManager(CCalculationEnvironmentFactory *contextFactory, CConfigurationProvider *configurationProvider) = 0; virtual CCalculationEnviroment *getCalculationContext() = 0; virtual QString getCalculationErrorString(cint64 errorCode) = 0; virtual QHash* getCalculationStatistics() = 0; virtual QHash* getUpdatedCalculationStatistics(QHash* stat) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CCalculationAdapter.h0000644000175000017500000000423312405707542027541 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONFACTORY_H #define KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONFACTORY_H // Qt includes // Namespace includes #include "CCalculationManager.h" // Other includes #include "Config/CConfigurationProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Kernel { namespace Calculation { /*! * * \class CCalculationFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationFactory { // public methods public: //! Constructor CCalculationFactory(); //! Deconstructor virtual ~CCalculationFactory(); virtual CCalculationManager* createCalculationManager(CConfigurationProvider* configurationProvider) = 0; virtual CCalculationManager* initializeManager(CCalculationManager* calculationManager, CConfigurationProvider* configurationProvider) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONFACTORY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CCalculationEnvironmentFactory.h0000644000175000017500000000413712520551044032010 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONENVIRONMENTFACTORY_H #define KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONENVIRONMENTFACTORY_H // Libraries includes // Namespace includes #include "CCalculationEnviroment.h" // Other includes #include "Config/CConfigurationProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Kernel { namespace Calculation { /*! * * \class CCalculationEnvironmentFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculationEnvironmentFactory { // public methods public: //! Constructor CCalculationEnvironmentFactory(); //! Destructor virtual ~CCalculationEnvironmentFactory(); virtual CCalculationEnviroment *createCalculationContext(CConfigurationProvider* configProvider) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CALCULATION_CCALCULATIONENVIRONMENTFACTORY_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConcurrentTaskCalculationEnvironment.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConcurrentTaskCalculationEnvironm0000644000175000017500000001231612520551044032407 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_CALCULATION_CCONCURRENTTASKCALCULATIONENVIRONMENT_H #define KONCLUDE_REASONER_KERNEL_CALCULATION_CCONCURRENTTASKCALCULATIONENVIRONMENT_H // Libraries includes // Namespace includes #include "CCalculationEnviroment.h" // Other includes #include "Reasoner/Kernel/Task/CSatisfiableCalculationTaskJobCallbackExecuter.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTaskStatusPropagator.h" #include "Scheduler/CSingleThreadTaskProcessorUnit.h" #include "Scheduler/CTaskProcessorSchedulerThread.h" #include "Scheduler/CTaskProcessorCompletorThread.h" #include "Scheduler/CTaskProcessorThread.h" #include "Utilities/Memory/CCentralizedAllocationLimitation.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Scheduler; using namespace Utilities::Memory; namespace Reasoner { namespace Kernel { using namespace Task; namespace Calculation { /*! * * \class CConcurrentTaskCalculationEnvironment * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcurrentTaskCalculationEnvironment : public CCalculationEnviroment { // public methods public: //! Constructor CConcurrentTaskCalculationEnvironment(); //! Destructor virtual ~CConcurrentTaskCalculationEnvironment(); CConcurrentTaskCalculationEnvironment* initSingleTaskProcessor(CSingleThreadTaskProcessorUnit* processUnit); CConcurrentTaskCalculationEnvironment* initMultiTaskProcessor(CTaskProcessorSchedulerThread* schedulerUnit, CTaskProcessorCompletorThread* completorUnit); CConcurrentTaskCalculationEnvironment* appendMultiTaskProcessor(CTaskProcessorThread* processorUnit); CConcurrentTaskCalculationEnvironment* initCallbackExecuter(CSatisfiableCalculationTaskJobCallbackExecuter* callbackExecuter); CConcurrentTaskCalculationEnvironment* initStatusPropagator(CSatisfiableCalculationTaskStatusPropagator* statusPropagator); CSingleThreadTaskProcessorUnit* getSingleTaskProcessorUnit(); CTaskEventHandlerBasedScheduler* getSchedulerTaskProcessorUnit(); CTaskEventHandlerBasedCompletor* getCompletorTaskProcessorUnit(); QList getTaskProcessorUnitList(); CSatisfiableCalculationTaskJobCallbackExecuter* getSatisfiableCalculationTaskJobCallbackExecuter(); CSatisfiableCalculationTaskStatusPropagator* getSatisfiableCalculationTaskStatusPropagator(); CCentralizedAllocationLimitation* getAllocationLimitation(); CConcurrentTaskCalculationEnvironment* setAllocationLimitation(CCentralizedAllocationLimitation* allocationLimitation); cint64 getCalculationComputionTime(); cint64 getCalculationBlockingTime(); cint64 getCalculationMemoryConsumption(); cint64 getCalculationMemoryReserved(); cint64 getCalculationStatisticTasksProcessedCount(); cint64 getCalculationStatisticTasksAddedCount(); cint64 getCalculationStatisticTasksCreatedCount(); cint64 getCalculationStatisticTasksCompletedCount(); cint64 getCalculationStatisticTasksUpdatedCount(); cint64 getCalculationStatisticEventsProcessedCount(); cint64 getCalculationStatisticTasksRequestedCount(); cint64 getCalculationStatisticThreadsBlockedCount(); double getCalculationApproximatedRemainingTasksCount(); // protected methods protected: // protected variables protected: CSingleThreadTaskProcessorUnit* mProcessUnit; CTaskEventHandlerBasedScheduler* mSchedulerUnit; CTaskEventHandlerBasedCompletor* mCompletorUnit; QList mThreadUnitList; QList mProcessorUnitList; CSatisfiableCalculationTaskJobCallbackExecuter* mCallbackExecuter; CSatisfiableCalculationTaskStatusPropagator* mStatusPropagator; CCentralizedAllocationLimitation* mAllocationLimitation; QVector mTaskCreatedDepthCountVec; QVector mTaskProcessedDepthCountVec; QVector mTaskRelativeIncreaseTaskPerDepthVec; QVector mTaskTotalIncreaseTaskPerDepthVec; // private methods private: // private variables private: }; }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_CALCULATION_CCONCURRENTTASKCALCULATIONENVIRONMENT_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConcurrentTaskCalculationEnvironment.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CConcurrentTaskCalculationEnvironm0000644000175000017500000003103612520551044032407 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcurrentTaskCalculationEnvironment.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Calculation { CConcurrentTaskCalculationEnvironment::CConcurrentTaskCalculationEnvironment() { mProcessUnit = nullptr; mSchedulerUnit = nullptr; mCompletorUnit = nullptr; mCallbackExecuter = nullptr; mStatusPropagator = nullptr; mAllocationLimitation = nullptr; mTaskCreatedDepthCountVec.resize(CTaskProcessingStatistics::VECCOUNTERSIZE); mTaskProcessedDepthCountVec.resize(CTaskProcessingStatistics::VECCOUNTERSIZE); mTaskRelativeIncreaseTaskPerDepthVec.resize(CTaskProcessingStatistics::VECCOUNTERSIZE); mTaskTotalIncreaseTaskPerDepthVec.resize(CTaskProcessingStatistics::VECCOUNTERSIZE); } CConcurrentTaskCalculationEnvironment::~CConcurrentTaskCalculationEnvironment() { qDeleteAll(mProcessorUnitList); mProcessorUnitList.clear(); } CConcurrentTaskCalculationEnvironment* CConcurrentTaskCalculationEnvironment::initSingleTaskProcessor(CSingleThreadTaskProcessorUnit* processUnit) { mProcessUnit = processUnit; mSchedulerUnit = mProcessUnit; mCompletorUnit = mProcessUnit; mProcessorUnitList.append(mProcessUnit); return this; } CConcurrentTaskCalculationEnvironment* CConcurrentTaskCalculationEnvironment::initMultiTaskProcessor(CTaskProcessorSchedulerThread* schedulerUnit, CTaskProcessorCompletorThread* completorUnit) { mProcessUnit = nullptr; mSchedulerUnit = schedulerUnit; mCompletorUnit = completorUnit; mProcessorUnitList.append(schedulerUnit); mProcessorUnitList.append(completorUnit); mThreadUnitList.append(schedulerUnit); mThreadUnitList.append(completorUnit); return this; } CConcurrentTaskCalculationEnvironment* CConcurrentTaskCalculationEnvironment::appendMultiTaskProcessor(CTaskProcessorThread* processorUnit) { mProcessorUnitList.append(processorUnit); mThreadUnitList.append(processorUnit); return this; } CConcurrentTaskCalculationEnvironment* CConcurrentTaskCalculationEnvironment::initCallbackExecuter(CSatisfiableCalculationTaskJobCallbackExecuter* callbackExecuter) { mCallbackExecuter = callbackExecuter; return this; } CConcurrentTaskCalculationEnvironment* CConcurrentTaskCalculationEnvironment::initStatusPropagator(CSatisfiableCalculationTaskStatusPropagator* statusPropagator) { mStatusPropagator = statusPropagator; return this; } CConcurrentTaskCalculationEnvironment* CConcurrentTaskCalculationEnvironment::setAllocationLimitation(CCentralizedAllocationLimitation* allocationLimitation) { mAllocationLimitation = allocationLimitation; return this; } CSatisfiableCalculationTaskJobCallbackExecuter* CConcurrentTaskCalculationEnvironment::getSatisfiableCalculationTaskJobCallbackExecuter() { return mCallbackExecuter; } CSatisfiableCalculationTaskStatusPropagator* CConcurrentTaskCalculationEnvironment::getSatisfiableCalculationTaskStatusPropagator() { return mStatusPropagator; } CSingleThreadTaskProcessorUnit* CConcurrentTaskCalculationEnvironment::getSingleTaskProcessorUnit() { return mProcessUnit; } CTaskEventHandlerBasedScheduler* CConcurrentTaskCalculationEnvironment::getSchedulerTaskProcessorUnit() { return mSchedulerUnit; } CTaskEventHandlerBasedCompletor* CConcurrentTaskCalculationEnvironment::getCompletorTaskProcessorUnit() { return mCompletorUnit; } QList CConcurrentTaskCalculationEnvironment::getTaskProcessorUnitList() { return mProcessorUnitList; } CCentralizedAllocationLimitation* CConcurrentTaskCalculationEnvironment::getAllocationLimitation() { return mAllocationLimitation; } cint64 CConcurrentTaskCalculationEnvironment::getCalculationComputionTime() { cint64 compTime = 0; if (mProcessUnit) { compTime += mProcessUnit->getStatisticComputionTime(); } foreach (CTaskProcessorThreadBase* threadUnit, mThreadUnitList) { compTime += threadUnit->getStatisticComputionTime(); } return compTime; } cint64 CConcurrentTaskCalculationEnvironment::getCalculationBlockingTime() { cint64 compTime = 0; if (mProcessUnit) { compTime += mProcessUnit->getStatisticBlockingTime(); } foreach (CTaskProcessorThreadBase* threadUnit, mThreadUnitList) { compTime += threadUnit->getStatisticBlockingTime(); } return compTime; } cint64 CConcurrentTaskCalculationEnvironment::getCalculationMemoryConsumption() { cint64 memComp = 0; memComp = mAllocationLimitation->getAllocatedMemorySizeMaximum(); return memComp; } cint64 CConcurrentTaskCalculationEnvironment::getCalculationMemoryReserved() { cint64 memComp = 0; memComp = mAllocationLimitation->getReservedMemorySizeMaximum(); return memComp; } cint64 CConcurrentTaskCalculationEnvironment::getCalculationStatisticTasksProcessedCount() { cint64 statVal = 0; if (mProcessUnit) { statVal += mProcessUnit->getTaskProcessingStatistics()->getStatisticTasksProcessedCount(); } foreach (CTaskProcessorThreadBase* threadUnit, mThreadUnitList) { statVal += threadUnit->getTaskProcessingStatistics()->getStatisticTasksProcessedCount(); } return statVal; } cint64 CConcurrentTaskCalculationEnvironment::getCalculationStatisticTasksAddedCount() { cint64 statVal = 0; if (mProcessUnit) { statVal += mProcessUnit->getTaskProcessingStatistics()->getStatisticTasksAddedCount(); } foreach (CTaskProcessorThreadBase* threadUnit, mThreadUnitList) { statVal += threadUnit->getTaskProcessingStatistics()->getStatisticTasksAddedCount(); } return statVal; } cint64 CConcurrentTaskCalculationEnvironment::getCalculationStatisticTasksCreatedCount() { cint64 statVal = 0; if (mProcessUnit) { statVal += mProcessUnit->getTaskProcessingStatistics()->getStatisticTasksCreatedCount(); } foreach (CTaskProcessorThreadBase* threadUnit, mThreadUnitList) { statVal += threadUnit->getTaskProcessingStatistics()->getStatisticTasksCreatedCount(); } return statVal; } cint64 CConcurrentTaskCalculationEnvironment::getCalculationStatisticTasksCompletedCount() { cint64 statVal = 0; if (mProcessUnit) { statVal += mProcessUnit->getTaskProcessingStatistics()->getStatisticTasksCompletedCount(); } foreach (CTaskProcessorThreadBase* threadUnit, mThreadUnitList) { statVal += threadUnit->getTaskProcessingStatistics()->getStatisticTasksCompletedCount(); } return statVal; } cint64 CConcurrentTaskCalculationEnvironment::getCalculationStatisticTasksUpdatedCount() { cint64 statVal = 0; if (mProcessUnit) { statVal += mProcessUnit->getTaskProcessingStatistics()->getStatisticTasksUpdatedCount(); } foreach (CTaskProcessorThreadBase* threadUnit, mThreadUnitList) { statVal += threadUnit->getTaskProcessingStatistics()->getStatisticTasksUpdatedCount(); } return statVal; } cint64 CConcurrentTaskCalculationEnvironment::getCalculationStatisticEventsProcessedCount() { cint64 statVal = 0; if (mProcessUnit) { statVal += mProcessUnit->getTaskProcessingStatistics()->getStatisticEventsProcessedCount(); } foreach (CTaskProcessorThreadBase* threadUnit, mThreadUnitList) { statVal += threadUnit->getTaskProcessingStatistics()->getStatisticEventsProcessedCount(); } return statVal; } cint64 CConcurrentTaskCalculationEnvironment::getCalculationStatisticTasksRequestedCount() { cint64 statVal = 0; if (mProcessUnit) { statVal += mProcessUnit->getTaskProcessingStatistics()->getStatisticTasksRequestedCount(); } foreach (CTaskProcessorThreadBase* threadUnit, mThreadUnitList) { statVal += threadUnit->getTaskProcessingStatistics()->getStatisticTasksRequestedCount(); } return statVal; } cint64 CConcurrentTaskCalculationEnvironment::getCalculationStatisticThreadsBlockedCount() { cint64 statVal = 0; if (mProcessUnit) { statVal += mProcessUnit->getTaskProcessingStatistics()->getStatisticThreadsBlockedCount(); } foreach (CTaskProcessorThreadBase* threadUnit, mThreadUnitList) { statVal += threadUnit->getTaskProcessingStatistics()->getStatisticThreadsBlockedCount(); } return statVal; } double CConcurrentTaskCalculationEnvironment::getCalculationApproximatedRemainingTasksCount() { double remainingTasksCount = 0; for (cint64 i = 0; i < CTaskProcessingStatistics::VECCOUNTERSIZE; ++i) { mTaskCreatedDepthCountVec[i] = 0; mTaskProcessedDepthCountVec[i] = 0; mTaskRelativeIncreaseTaskPerDepthVec[i] = 0.; mTaskTotalIncreaseTaskPerDepthVec[i] = 1.; } if (mProcessUnit) { QVector* createdVec = mProcessUnit->getTaskProcessingStatistics()->getStatisticTasksCreatedDepthCountVector(); QVector* processedVec = mProcessUnit->getTaskProcessingStatistics()->getStatisticTasksProcessedDepthCountVector(); for (cint64 i = 0; i < CTaskProcessingStatistics::VECCOUNTERSIZE; ++i) { mTaskCreatedDepthCountVec[i] += (*createdVec)[i]; mTaskProcessedDepthCountVec[i] += (*processedVec)[i]; } } foreach (CTaskProcessorThreadBase* threadUnit, mThreadUnitList) { QVector* createdVec = threadUnit->getTaskProcessingStatistics()->getStatisticTasksCreatedDepthCountVector(); QVector* processedVec = threadUnit->getTaskProcessingStatistics()->getStatisticTasksProcessedDepthCountVector(); for (cint64 i = 0; i < CTaskProcessingStatistics::VECCOUNTERSIZE; ++i) { mTaskCreatedDepthCountVec[i] += (*createdVec)[i]; mTaskProcessedDepthCountVec[i] += (*processedVec)[i]; } } for (cint64 i = 0; i < CTaskProcessingStatistics::VECCOUNTERSIZE-1; ++i) { cint64 processedTaskCount = mTaskProcessedDepthCountVec[i]; cint64 nextDepthCreatedCount = mTaskCreatedDepthCountVec[i+1]; double relIncTaskRate = 0; if (nextDepthCreatedCount) { if (processedTaskCount < 1) { processedTaskCount = 1; mTaskProcessedDepthCountVec[i] = processedTaskCount; } relIncTaskRate = (double)nextDepthCreatedCount/(double)processedTaskCount; } mTaskRelativeIncreaseTaskPerDepthVec[i] = relIncTaskRate; } for (cint64 i = CTaskProcessingStatistics::VECCOUNTERSIZE-1; i >= 0; --i) { double relIncValue = mTaskRelativeIncreaseTaskPerDepthVec[i]; if (relIncValue > 0.) { double nextTotIncValue = mTaskTotalIncreaseTaskPerDepthVec[i+1]; if (nextTotIncValue > 0.) { mTaskTotalIncreaseTaskPerDepthVec[i] = 1 + nextTotIncValue * relIncValue; } else { mTaskTotalIncreaseTaskPerDepthVec[i] = relIncValue; } } } for (cint64 i = 0; i < CTaskProcessingStatistics::VECCOUNTERSIZE-1; ++i) { cint64 openTaskCount = mTaskCreatedDepthCountVec[i] - mTaskProcessedDepthCountVec[i]; if (openTaskCount > 0) { remainingTasksCount += openTaskCount * mTaskTotalIncreaseTaskPerDepthVec[i]; } } QStringList debugStringList; for (cint64 i = 0; i < CTaskProcessingStatistics::VECCOUNTERSIZE-1; ++i) { QString depthString = QString("Depth: %1, C:%2, P:%3, +:%4, *%5").arg(i).arg(mTaskCreatedDepthCountVec[i]).arg(mTaskProcessedDepthCountVec[i]) .arg(mTaskRelativeIncreaseTaskPerDepthVec[i]).arg(mTaskTotalIncreaseTaskPerDepthVec[i]); debugStringList.append(depthString); } QString debugString = debugStringList.join("\r\n"); return remainingTasksCount; } }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Kernel/Calculation/CCalculationFactory.cpp0000644000175000017500000000223212520551044030110 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculationFactory.h" namespace Konclude { namespace Reasoner { namespace Kernel { namespace Calculation { CCalculationFactory::CCalculationFactory() { } CCalculationFactory::~CCalculationFactory() { } }; // end namespace Calculation }; // end namespace Kernel }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistence/0000755000175000017500000000000012613407252022317 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistence/CSaturationData.cpp0000644000175000017500000000211412520550764026053 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationData.h" namespace Konclude { namespace Reasoner { namespace Consistence { CSaturationData::CSaturationData() { } CSaturationData::~CSaturationData() { } }; // end namespace Consistence }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistence/CConsistence.cpp0000644000175000017500000000443012520550764025410 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConsistence.h" namespace Konclude { namespace Reasoner { namespace Consistence { CConsistence::CConsistence() { mConsistent = false; mConsData = nullptr; mRepresentativelyStored = false; mAllRepresentativelyStored = false; } CConsistence::~CConsistence() { delete mConsData; } bool CConsistence::isOntologyConsistent() { return mConsistent; } CConsistence* CConsistence::setOntologyConsistent(bool consistency) { mConsistent = consistency; return this; } CConsistenceData* CConsistence::getConsistenceModelData() { return mConsData; } bool CConsistence::hasConsistenceModelData() { return mConsData != nullptr; } CConsistence* CConsistence::setConsistenceModelData(CConsistenceData* consData) { mConsData = consData; return this; } bool CConsistence::areIndividualsRepresentativelyStored() { return mRepresentativelyStored; } bool CConsistence::areAllIndividualsRepresentativelyStored() { return mAllRepresentativelyStored; } CConsistence* CConsistence::setIndividualsRepresentativelyStored(bool representativelyStored) { mRepresentativelyStored = representativelyStored; return this; } CConsistence* CConsistence::setAllIndividualsRepresentativelyStored(bool representativelyStored) { mAllRepresentativelyStored = representativelyStored; return this; } }; // end namespace Consistence }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistence/CConsistenceData.h0000644000175000017500000000341312520550764025647 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_Consistence_CCONSISTENCEDATA_H #define KONCLUDE_REASONER_Consistence_CCONSISTENCEDATA_H // Libraries includes // Namespace includes #include "ConsistenceSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Consistence { /*! * * \class CConsistenceData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConsistenceData { // public methods public: //! Constructor CConsistenceData(); //! Destructor virtual ~CConsistenceData(); virtual bool overtakeData() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Consistence }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_Consistence_CCONSISTENCEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistence/CPrecomputation.h0000644000175000017500000000402712520550764025613 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTENCE_CPRECOMPUTATION_H #define KONCLUDE_REASONER_CONSISTENCE_CPRECOMPUTATION_H // Libraries includes // Namespace includes #include "ConsistenceSettings.h" #include "CSaturationData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Consistence { /*! * * \class CPrecomputation * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPrecomputation { // public methods public: //! Constructor CPrecomputation(); virtual ~CPrecomputation(); bool isPrecomputed(); CPrecomputation* setPrecomputed(bool precomputed); CSaturationData* getSaturationModelData(); bool hasSaturationModelData(); CPrecomputation* setSaturationModelData(CSaturationData* saturationData); // protected methods protected: // protected variables protected: bool mPrecomputed; CSaturationData* mSaturData; // private methods private: // private variables private: }; }; // end namespace Consistence }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTENCE_CPRECOMPUTATION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistence/CPrecomputation.cpp0000644000175000017500000000325712520550764026152 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecomputation.h" namespace Konclude { namespace Reasoner { namespace Consistence { CPrecomputation::CPrecomputation() { mPrecomputed = false; mSaturData = nullptr; } CPrecomputation::~CPrecomputation() { delete mSaturData; } bool CPrecomputation::isPrecomputed() { return mPrecomputed; } CPrecomputation* CPrecomputation::setPrecomputed(bool precomputed) { mPrecomputed = precomputed; return this; } CSaturationData* CPrecomputation::getSaturationModelData() { return mSaturData; } bool CPrecomputation::hasSaturationModelData() { return mSaturData != nullptr; } CPrecomputation* CPrecomputation::setSaturationModelData(CSaturationData* saturationData) { mSaturData = saturationData; return this; } }; // end namespace Consistence }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistence/CConsistence.h0000644000175000017500000000460012520550764025054 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTENCE_CCONSISTENCE_H #define KONCLUDE_REASONER_CONSISTENCE_CCONSISTENCE_H // Libraries includes // Namespace includes #include "ConsistenceSettings.h" #include "CConsistenceData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Consistence { /*! * * \class CConsistence * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConsistence { // public methods public: //! Constructor CConsistence(); //! Destructor virtual ~CConsistence(); bool isOntologyConsistent(); CConsistence* setOntologyConsistent(bool consistency); CConsistenceData* getConsistenceModelData(); bool hasConsistenceModelData(); CConsistence* setConsistenceModelData(CConsistenceData* consData); bool areIndividualsRepresentativelyStored(); bool areAllIndividualsRepresentativelyStored(); CConsistence* setIndividualsRepresentativelyStored(bool representativelyStored); CConsistence* setAllIndividualsRepresentativelyStored(bool representativelyStored); // protected methods protected: // protected variables protected: bool mConsistent; CConsistenceData* mConsData; bool mRepresentativelyStored; bool mAllRepresentativelyStored; // private methods private: // private variables private: }; }; // end namespace Consistence }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTENCE_CCONSISTENCE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistence/CConsistenceData.cpp0000644000175000017500000000212112520550764026175 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConsistenceData.h" namespace Konclude { namespace Reasoner { namespace Consistence { CConsistenceData::CConsistenceData() { } CConsistenceData::~CConsistenceData() { } }; // end namespace Consistence }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistence/ConsistenceSettings.h0000644000175000017500000000271112520550764026473 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTENCE_CONSISTENCESETTINGS #define KONCLUDE_REASONER_CONSISTENCE_CONSISTENCESETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Reasoner { namespace Consistence { /*! * * \file ConsistenceSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations // Custom Events >= 2000 }; // end namespace Consistence }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_CONSISTENCE_CONSISTENCESETTINGSKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistence/CSaturationData.h0000644000175000017500000000340412520550764025523 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTENCE_CSATURATIONDATA_H #define KONCLUDE_REASONER_CONSISTENCE_CSATURATIONDATA_H // Libraries includes // Namespace includes #include "ConsistenceSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Consistence { /*! * * \class CSaturationData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationData { // public methods public: //! Constructor CSaturationData(); //! Destructor virtual ~CSaturationData(); virtual bool overtakeData() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Consistence }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTENCE_CSATURATIONDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/0000755000175000017500000000000012613407252022347 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIndividualDependenceTrackingObserver.h0000644000175000017500000000426312520550770032067 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CINDIVIDUALDEPENDENCETRACKINGOBSERVER_H #define KONCLUDE_REASONER_CONSISTISER_CINDIVIDUALDEPENDENCETRACKINGOBSERVER_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes #include "Reasoner/Ontology/CIndividualDependenceTracking.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Consistiser { /*! * * \class CIndividualDependenceTrackingObserver * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualDependenceTrackingObserver { // public methods public: //! Constructor CIndividualDependenceTrackingObserver(); //! Destructor virtual ~CIndividualDependenceTrackingObserver(); virtual CIndividualDependenceTracking* getExtendingIndividualDependenceTracking() = 0; virtual CIndividualDependenceTracking* installIndividualDependenceTracking(CIndividualDependenceTracking* indDepTrack) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CINDIVIDUALDEPENDENCETRACKINGOBSERVER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CPrecomputationCallbackDataContext.h0000644000175000017500000000424212520550770031413 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_Consistiser_CPRECOMPUTATIONCALLBACKDATACONTEXT_H #define KONCLUDE_REASONER_Consistiser_CPRECOMPUTATIONCALLBACKDATACONTEXT_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes #include "Concurrent/Callback/CCallbackDataContext.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; namespace Consistiser { /*! * * \class CPrecomputationCallbackDataContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPrecomputationCallbackDataContext : public CCallbackDataContext { // public methods public: //! Constructor CPrecomputationCallbackDataContext(bool precomputing, CConcreteOntology* ontology); virtual CConcreteOntology *getOntology(); virtual bool isPrecomputing(); // protected methods protected: // protected variables protected: CConcreteOntology* mOntology; bool mPrecomputing; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_Consistiser_CPRECOMPUTATIONCALLBACKDATACONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationConceptReferenceLinking.h0000644000175000017500000000473512520550772031437 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CSATURATIONCONCEPTREFERENCELINKING_H #define KONCLUDE_REASONER_CONSISTISER_CSATURATIONCONCEPTREFERENCELINKING_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes #include "Reasoner/Ontology/CExtendedConceptReferenceLinkingData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Consistiser { /*! * * \class CSaturationConceptReferenceLinking * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationConceptReferenceLinking : public CExtendedConceptReferenceLinkingData { // public methods public: //! Constructor CSaturationConceptReferenceLinking(); bool isPotentiallyExistInitializationConcept(); CSaturationConceptReferenceLinking* setPotentiallyExistInitializationConcept(bool initConcept); bool isDataRangeConcept(); CSaturationConceptReferenceLinking* setDataRangeConcept(bool dataRangeConcept); CProcessReference* getIndividualProcessNodeForConcept(); CSaturationConceptReferenceLinking* setIndividualProcessNodeForConcept(CProcessReference* indiNode); // protected methods protected: // protected variables protected: bool mPotentiallyExistInitConcept; bool mDataRangeConcept; CProcessReference* mIndiProcessNodeForConcept; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CSATURATIONCONCEPTREFERENCELINKING_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIncrementalPrecomputationThread.cpp0000644000175000017500000004664712520550766031530 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIncrementalPrecomputationThread.h" #ifndef KONCLUDE_FORCE_STATISTIC_DEACTIVATED #define KONCLUDE_PRECOMPUTATION_SATURATION_STATISTIC_OUTPUT #endif namespace Konclude { namespace Reasoner { namespace Consistiser { CIncrementalPrecomputationThread::CIncrementalPrecomputationThread(CReasonerManager *reasonerManager) : CPrecomputationThread(reasonerManager),CLogIdentifier("::Konclude::Reasoner::Kernel::Precomputator",this) { mReuseCompletionGraphCacheWriter = nullptr; CCompletionGraphCache* complGraphCache = reasonerManager->getCompletionGraphCache(); if (complGraphCache) { CReuseCompletionGraphCache* reuseComplGraphCache = dynamic_cast(complGraphCache); if (reuseComplGraphCache) { mReuseCompletionGraphCacheWriter = reuseComplGraphCache->createCacheWriter(); } } mBackendAssocCache = nullptr; CBackendCache* backendCache = reasonerManager->getBackendAssociationCache(); if (backendCache) { mBackendAssocCache = dynamic_cast(backendCache); } } CIncrementalPrecomputationThread::~CIncrementalPrecomputationThread() { } COntologyPrecomputationItem* CIncrementalPrecomputationThread::initializeOntologyPrecomputionItem(CConcreteOntology* ontology, CConfigurationBase* config) { CIncrementalOntologyPrecomputationItem* item = new CIncrementalOntologyPrecomputationItem(); item->initTotallyPrecomputationItem(ontology,config); if (config) { bool configErrorFlag = false; cint64 processorCount = 1; QString processorCountString = CConfigDataReader::readConfigString(config,"Konclude.Calculation.ProcessorCount",QString(),&configErrorFlag); if (!configErrorFlag) { if (processorCountString == "AUTO") { processorCount = CThread::idealThreadCount(); } else { qint64 convertedWorkerCount = processorCountString.toInt(&configErrorFlag); if (configErrorFlag) { processorCount = convertedWorkerCount; } } } bool mulConfigErrorFlag = false; cint64 multiplicator = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Precomputation.TotalPrecomputor.MultipliedUnitsParallelCalculationCount",1,&mulConfigErrorFlag); mConfMaxTestParallelCount = processorCount*multiplicator; bool maxConfigErrorFlag = false; cint64 maxParallel = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Precomputation.TotalPrecomputor.MaximumParallelCalculationCount",1,&maxConfigErrorFlag); if (!maxConfigErrorFlag) { if (!mulConfigErrorFlag) { mConfMaxTestParallelCount = qMin(mConfMaxTestParallelCount,maxParallel); } else { mConfMaxTestParallelCount = maxParallel; } } } else { mConfMaxTestParallelCount = 1; } return item; } bool CIncrementalPrecomputationThread::createNextTest() { COntologyPrecomputationItem* loopOntPreCompItem = 0; bool workTestCreated = false; while (!workTestCreated && !mProcessingOntItemList.isEmpty()) { COntologyPrecomputationItem* ontPreCompItem = mProcessingOntItemList.first(); if (ontPreCompItem == loopOntPreCompItem) { // don't run into infinite loop without doing something break; } CIncrementalOntologyPrecomputationItem* incPreCompItem = (CIncrementalOntologyPrecomputationItem*)ontPreCompItem; bool failDebug = false; if (!workTestCreated && incPreCompItem->isConsistenceStepRequired()) { if (!incPreCompItem->isConsistenceStepFinished()) { if (incPreCompItem->areConsistenceStepProcessingRequirementSatisfied()) { if (!failDebug && !incPreCompItem->hasConsistenceCheckCreated()) { LOG(INFO,getLogDomain(),logTr("Incrementally precompute ontology consistency."),this); incPreCompItem->setConsistenceCheckCreated(true); workTestCreated = createConsistencePrecomputationCheck(incPreCompItem); } if (incPreCompItem->hasConsistenceCheched()) { incPreCompItem->getConsistencePrecomputationStep()->setStepFinished(true); if (incPreCompItem->getOntology()->getConsistence()->isOntologyConsistent()) { incPreCompItem->getConsistencePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSSUCESSFULL); } else { incPreCompItem->getConsistencePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSSUCESSFULL | COntologyProcessingStatus::PSINCONSITENT); } } } else { incPreCompItem->getConsistencePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); incPreCompItem->getConsistencePrecomputationStep()->setStepFinished(true); } } else { incPreCompItem->getConsistencePrecomputationStep()->submitRequirementsUpdate(); } } if (!workTestCreated && incPreCompItem->isIndividualStepRequired() && incPreCompItem->isConsistenceStepFinished()) { if (!incPreCompItem->isIndividualStepFinished()) { if (incPreCompItem->areIndividualStepProcessingRequirementSatisfied()) { if (!incPreCompItem->hasIndividualPrecomputationCreated()) { incPreCompItem->setIndividualPrecomputationCreated(true); workTestCreated = createIndividualPrecomputationCheck(incPreCompItem); } if (incPreCompItem->hasIndividualPrecomputationChecked() && !incPreCompItem->isIndividualComputationRunning()) { incPreCompItem->setIndividualStepRunning(false); incPreCompItem->getIndividualPrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSSUCESSFULL); incPreCompItem->getIndividualPrecomputationStep()->setStepFinished(true); } } else { incPreCompItem->setIndividualStepRunning(false); incPreCompItem->getIndividualPrecomputationStep()->setStepFinished(true); incPreCompItem->getIndividualPrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); } } else { incPreCompItem->getIndividualPrecomputationStep()->submitRequirementsUpdate(); } } if (!workTestCreated && incPreCompItem->isSaturationStepRequired() && incPreCompItem->isConsistenceStepFinished() && incPreCompItem->isIndividualStepFinished()) { if (!incPreCompItem->isSaturationStepFinished()) { if (incPreCompItem->areSaturationStepProcessingRequirementSatisfied()) { incPreCompItem->getSaturationPrecomputationStep()->setStepFinished(true); incPreCompItem->getSaturationPrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSSUCESSFULL); } else { incPreCompItem->getSaturationPrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); } } else { incPreCompItem->getSaturationPrecomputationStep()->submitRequirementsUpdate(); } } if (!workTestCreated && incPreCompItem->isCycleStepRequired() && incPreCompItem->isConsistenceStepFinished()) { if (!incPreCompItem->isCycleStepFinished()) { if (incPreCompItem->areCycleStepProcessingRequirementSatisfied()) { incPreCompItem->getCyclePrecomputationStep()->setStepFinished(true); incPreCompItem->getCyclePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSSUCESSFULL); } else { incPreCompItem->getCyclePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); incPreCompItem->getCyclePrecomputationStep()->setStepFinished(true); } } else { incPreCompItem->getCyclePrecomputationStep()->submitRequirementsUpdate(); } } if (!workTestCreated) { if (!incPreCompItem->hasRemainingProcessingRequirements()) { finishOntologyPrecomputation(incPreCompItem); mProcessingOntItemList.removeFirst(); } else { mProcessingOntItemList.removeFirst(); mProcessingOntItemList.append(incPreCompItem); loopOntPreCompItem = ontPreCompItem; } } } return workTestCreated; } bool CIncrementalPrecomputationThread::createIndividualPrecomputationCheck(CIncrementalOntologyPrecomputationItem* incPreCompItem) { CConcreteOntology* onto = incPreCompItem->getOntology(); CSatisfiableCalculationJob* satCalcJob = nullptr; return false; } QSet* CIncrementalPrecomputationThread::getDirectlyChangedIndividualsFromLastConsistentlyTestedOntology(CIncrementalOntologyPrecomputationItem* incPreCompItem) { CConcreteOntology* lastConOntVer = getLastConsistentlyTestedOntologyVersion(incPreCompItem); return getDirectlyChangedIndividuals(lastConOntVer,incPreCompItem); } QSet* CIncrementalPrecomputationThread::getDirectlyChangedIndividuals(CConcreteOntology* lastOntologyVersion, CIncrementalOntologyPrecomputationItem* incPreCompItem) { QSet* indiSet = incPreCompItem->getDirectlyChangedIndividualSet(); if (!incPreCompItem->hasDirectlyChangedIndividualsIdentified()) { CConcreteOntology* ontology = incPreCompItem->getOntology(); CIndividualVector* indiVec = ontology->getABox()->getIndividualVector(false); if (indiVec) { cint64 indiCount = indiVec->getItemCount(); CIndividualVector* prevIndiVec = lastOntologyVersion->getABox()->getIndividualVector(false); if (!prevIndiVec) { for (cint64 i = 0; i < indiCount; ++i) { CIndividual* individual = indiVec->getData(i); if (individual) { indiSet->insert(individual); } } } else { for (cint64 i = 0; i < indiCount; ++i) { CIndividual* individual = indiVec->getData(i); if (individual) { CIndividual* prevIndividual = prevIndiVec->getData(i); if (individual != prevIndividual) { indiSet->insert(individual); } } } } } incPreCompItem->setDirectlyChangedIndividualsIdentified(true); } return indiSet; } CConcreteOntology* CIncrementalPrecomputationThread::getLastConsistentlyTestedOntologyVersion(CIncrementalOntologyPrecomputationItem* incPreCompItem) { CConcreteOntology* lastConsOntology = incPreCompItem->getLastConsistentlyTestedVersion(); if (!lastConsOntology) { CConcreteOntology* ontology = incPreCompItem->getOntology(); CConcreteOntology* prevOntology = ontology->getIncrementalRevisionData()->getPreviousOntologyVersion(); while (prevOntology && !lastConsOntology) { CConsistence* prevConsistenceData = prevOntology->getConsistence(); if (prevConsistenceData && prevConsistenceData->isOntologyConsistent()) { if (prevConsistenceData->areAllIndividualsRepresentativelyStored() || prevConsistenceData->hasConsistenceModelData()) { lastConsOntology = prevOntology; } } if (!lastConsOntology) { prevOntology = prevOntology->getIncrementalRevisionData()->getPreviousOntologyVersion(); } } incPreCompItem->setLastConsistentlyTestedVersion(lastConsOntology); } return lastConsOntology; } bool CIncrementalPrecomputationThread::createConsistencePrecomputationCheck(CIncrementalOntologyPrecomputationItem* incPreCompItem) { CConcreteOntology* onto = incPreCompItem->getOntology(); CSatisfiableCalculationJob* satCalcJob = nullptr; CConcreteOntology* lastConsistentlyTestedOnto = getLastConsistentlyTestedOntologyVersion(incPreCompItem); CIndividualVector* indiVec = onto->getABox()->getIndividualVector(false); cint64 indiCount = 0; if (indiVec) { indiCount = indiVec->getItemCount(); } bool consistencyDetected = false; bool detectedConsistency = true; if (false) { consistencyDetected = true; detectedConsistency = true; LOG(INFO,getLogDomain(),logTr("Trivial consistency detected with merged individual."),getLogObject()); } else { QSet* changedIndividualSet = getDirectlyChangedIndividuals(lastConsistentlyTestedOnto,incPreCompItem); QList indiList; for (QSet::const_iterator it = changedIndividualSet->constBegin(), itEnd = changedIndividualSet->constEnd(); it != itEnd; ++it) { CIndividual* individual(*it); indiList.append(individual); } CSatisfiableCalculationJobGenerator satCalcJobGen(onto); if (indiList.isEmpty()) { CConcept* topConcept = onto->getTBox()->getTopConcept(); if (topConcept->getOperandCount() > 0) { satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(topConcept); } else { consistencyDetected = true; detectedConsistency = true; } } else { satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(indiList); } } CConsistence* consistence = onto->getConsistence(); if (!consistence) { consistence = new CConsistence(); onto->setConsistence(consistence); } incPreCompItem->setConsistence(consistence); if (consistencyDetected) { consistence->setOntologyConsistent(detectedConsistency); incPreCompItem->setConsistenceCheched(true); return false; } else { cint64 incRevID = incPreCompItem->getIncrementalExpansionID(); CIncrementalConsistencePrecomputationTestingItem* consTestItem = new CIncrementalConsistencePrecomputationTestingItem(incPreCompItem,lastConsistentlyTestedOnto,incRevID,incPreCompItem); CCalculationConfigurationExtension* calcConfig = incPreCompItem->getCalculationConfiguration(); satCalcJob->setCalculationConfiguration(calcConfig); satCalcJob->setSatisfiableTaskIncrementalConsistencyTestingAdapter(consTestItem->getIncrementalConsistencyTestingAdapter()); processCalculationJob(satCalcJob,incPreCompItem,consTestItem); return true; } } bool CIncrementalPrecomputationThread::precomputationTested(COntologyPrecomputationItem* ontPreCompItem, CPrecomputationTestingItem* preTestItem, CSaturationPrecomputationCalculatedCallbackEvent* pcce) { return false; } bool CIncrementalPrecomputationThread::precomputationTested(COntologyPrecomputationItem* ontPreCompItem, CPrecomputationTestingItem* preTestItem, CPrecomputationCalculatedCallbackEvent* pcce) { CIncrementalOntologyPrecomputationItem* incPreCompItem = (CIncrementalOntologyPrecomputationItem*)ontPreCompItem; if (preTestItem->getPrecomputationTestingType() == CPrecomputationTestingItem::CONSISTENCEPRECOMPUTATIONTYPE) { CIncrementalConsistencePrecomputationTestingItem* consPreTestItem = (CIncrementalConsistencePrecomputationTestingItem*)preTestItem; incPreCompItem->setIndividualStepRunning(false); incPreCompItem->setIndividualPrecomputationChecked(true); incPreCompItem->setConsistenceCheched(true); if (pcce->hasCalculationError()) { LOG(ERROR,getLogDomain(),logTr("Error in computation, consistence testing for ontology '%1' failed.").arg(ontPreCompItem->getOntology()->getTerminologyName()),getLogObject()); incPreCompItem->getConsistencePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED); incPreCompItem->getIndividualPrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED); } else { CConsistence* consistence = incPreCompItem->getConsistence(); consistence->setConsistenceModelData(incPreCompItem->getConsistenceData()); consistence->setOntologyConsistent(pcce->getTestResultSatisfiable()); } logIncrementalReasoningInfos(incPreCompItem); return true; } return false; } bool CIncrementalPrecomputationThread::logIncrementalReasoningInfos(CIncrementalOntologyPrecomputationItem* incPreCompItem) { CConsistenceData* consData = incPreCompItem->getConsistenceData(); if (consData) { CIncrementalConsistenceTaskData* incConsTaskData = dynamic_cast(consData); if (incConsTaskData) { cint64 directlyChangedNodeCount = incPreCompItem->getDirectlyChangedIndividualSet()->count(); cint64 deterministicallyChangedNodeCount = incConsTaskData->getDeterministicallyChangedNodeCount(); cint64 indirectlyChangedNodeCount = incConsTaskData->getIndirectlyChangedCount(); cint64 changedCompatibleNodeCount = incConsTaskData->getChangedCompatibleNodeCount(); COntologyProcessingStatistics* ontProcStats = incPreCompItem->getConsistencePrecomputationStep()->getProcessingStepData()->getProcessingStatistics(true); ontProcStats->setProcessingCountStatisticValue("incremental-consistency-checking-directly-changed-individual-count",directlyChangedNodeCount); ontProcStats->setProcessingCountStatisticValue("incremental-consistency-checking-deterministically-changed-node-count",deterministicallyChangedNodeCount); ontProcStats->setProcessingCountStatisticValue("incremental-consistency-checking-indirectly-changed-node-count",indirectlyChangedNodeCount); ontProcStats->setProcessingCountStatisticValue("incremental-consistency-checking-changed-compatible-node-count",changedCompatibleNodeCount); ontProcStats->setProcessingCountStatisticValue("incremental-consistency-checking-added-node-count",incConsTaskData->getAddedNodeCount()); ontProcStats->setProcessingCountStatisticValue("incremental-consistency-checking-new-total-node-count",incConsTaskData->getTotalNodeCount()); ontProcStats->setProcessingCountStatisticValue("incremental-consistency-checking-previous-total-node-count",incConsTaskData->getPreviousNodeCount()); ontProcStats->setProcessingCountStatisticValue("incremental-consistency-checking-time",incPreCompItem->getInitializationTime()->elapsed()); LOG(INFO,getLogDomain(),logTr("Established consistency incrementally, %1 individuals directly changed, %2 nodes deterministically changed, %3 nodes indirectly changed.").arg(directlyChangedNodeCount).arg(deterministicallyChangedNodeCount).arg(indirectlyChangedNodeCount),this); } } return false; } bool CIncrementalPrecomputationThread::finishOntologyPrecomputation(CIncrementalOntologyPrecomputationItem* incPreCompItem) { if (incPreCompItem->areAllStepFinished()) { incPreCompItem->setPrecomputationFinished(true); CConcreteOntology* ontology = incPreCompItem->getOntology(); CPrecomputation* precomputation = ontology->getPrecomputation(); precomputation->setPrecomputed(true); } incPreCompItem->doPrecomputationFinishedCallback(true); mActiveOntItemSet.remove(incPreCompItem); mInactiveOntItemSet.insert(incPreCompItem); return true; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CPrecomputationCallbackDataContext.cpp0000644000175000017500000000260512520550770031747 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecomputationCallbackDataContext.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CPrecomputationCallbackDataContext::CPrecomputationCallbackDataContext(bool precomputing, CConcreteOntology *ontology) { mOntology = ontology; mPrecomputing = precomputing; } CConcreteOntology *CPrecomputationCallbackDataContext::getOntology() { return mOntology; } bool CPrecomputationCallbackDataContext::isPrecomputing() { return mPrecomputing; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CConsistenceObserver.cpp0000644000175000017500000000214512520550766027153 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConsistenceObserver.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CConsistenceObserver::CConsistenceObserver() { } CConsistenceObserver::~CConsistenceObserver() { } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CPrecomputator.h0000644000175000017500000000456612520550772025505 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATOR_H #define KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATOR_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Concurrent/Callback/CCallbackData.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; using namespace Config; namespace Reasoner { using namespace Ontology; namespace Consistiser { /*! * * \class CPrecomputator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPrecomputator { // public methods public: //! Constructor CPrecomputator(); virtual bool precompute(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList, CCallbackData* callback) = 0; virtual bool precompute(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList) = 0; virtual bool callbackPrecomputed(CConcreteOntology* ontology, CCallbackData* callback) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CConsistenceObserver.h0000644000175000017500000000406512520550766026623 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CCONSISTENCEOBSERVER_H #define KONCLUDE_REASONER_CONSISTISER_CCONSISTENCEOBSERVER_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes #include "Reasoner/Consistence/CConsistenceData.h" #include "Reasoner/Ontology/CConcept.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Ontology; using namespace Consistence; namespace Consistiser { /*! * * \class CConsistenceObserver * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConsistenceObserver { // public methods public: //! Constructor CConsistenceObserver(); //! Destructor virtual ~CConsistenceObserver(); virtual CConsistenceObserver* tellConsistenceData(CConsistenceData* consData) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CCONSISTENCEOBSERVER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationPrecomputationTestingItem.cpp0000644000175000017500000000312412520550774032423 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationPrecomputationTestingItem.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CSaturationPrecomputationTestingItem::CSaturationPrecomputationTestingItem(COntologyPrecomputationItem* preCompItem, CPrecomputationTestingItem::PRECOMPUTATIONTYPE precomputationType, cint64 saturationID) : CPrecomputationTestingItem(preCompItem),mSaturationID(saturationID) { mPrecomputationType = precomputationType; } CPrecomputationTestingItem::PRECOMPUTATIONTYPE CSaturationPrecomputationTestingItem::getPrecomputationTestingType() { return mPrecomputationType; } cint64 CSaturationPrecomputationTestingItem::getSaturationID() { return mSaturationID; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/0000755000175000017500000000000012613407252023613 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/CPrecomputeOntologyEvent.cpp0000644000175000017500000000362112520550764031310 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecomputeOntologyEvent.h" namespace Konclude { namespace Reasoner { namespace Consistiser { namespace Events { CPrecomputeOntologyEvent::CPrecomputeOntologyEvent(CConcreteOntology* ontology, CConfigurationBase* configuration, const QList& requirementList, CCallbackData* callbackData) : CCustomEvent(EVENTTYPE) { onto = ontology; callback = callbackData; config = configuration; mRequirementList = requirementList; } CPrecomputeOntologyEvent::~CPrecomputeOntologyEvent() { } CConcreteOntology *CPrecomputeOntologyEvent::getOntology() { return onto; } CCallbackData *CPrecomputeOntologyEvent::getCallbackData() { return callback; } CConfigurationBase *CPrecomputeOntologyEvent::getConfiguration() { return config; } QList* CPrecomputeOntologyEvent::getProcessingRequirementList() { return &mRequirementList; } }; // end namespace Events }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/CSaturationPrecomputationCalculatedCallbackEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/CSaturationPrecomputationCalculate0000644000175000017500000000573012520550766032555 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_EVENTS_CSATURATIONPRECOMPUTATIONCALCULATEDCALLBACKEVENT_H #define KONCLUDE_REASONER_CONSISTISER_EVENTS_CSATURATIONPRECOMPUTATIONCALCULATEDCALLBACKEVENT_H // Libraries includes // Namespace includes #include "../ConsistiserSettings.h" #include "../CPrecomputationTestingItem.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Concurrent/Callback/CCallbackData.h" #include "Reasoner/Query/CApproximatedSaturationCalculationJob.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; using namespace Taxonomy; using namespace Query; namespace Consistiser { namespace Events { /*! * \class CSaturationPrecomputationCalculatedCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CSaturationPrecomputationCalculatedCallbackEvent : public CCustomEvent, public CCallbackData { // public methods public: //! Constructor CSaturationPrecomputationCalculatedCallbackEvent(CThread *receiverThread, CApproximatedSaturationCalculationJob *satCalcJob, CPrecomputationTestingItem* preTestItem); //! Destructor virtual ~CSaturationPrecomputationCalculatedCallbackEvent(); static const QEvent::Type EVENTTYPE = EVENTSATURATIONCALCULATEDCALLBACK; virtual void doCallback(); CApproximatedSaturationCalculationJob *getSaturationCalculationJob(); CPrecomputationTestingItem* getPrecomputationTestingItem(); // protected methods protected: // protected variables protected: CThread *recThread; CApproximatedSaturationCalculationJob* mSatCalcJob; CPrecomputationTestingItem* mPreTestItem; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_EVENTS_CSATURATIONPRECOMPUTATIONCALCULATEDCALLBACKEVENT_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/CPrecomputationCalculatedCallbackEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/CPrecomputationCalculatedCallbackE0000644000175000017500000000573712520550764032376 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_EVENTS_CPRECOMPUTATIONCALCULATEDCALLBACKEVENT_H #define KONCLUDE_REASONER_CONSISTISER_EVENTS_CPRECOMPUTATIONCALCULATEDCALLBACKEVENT_H // Libraries includes // Namespace includes #include "../ConsistiserSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Concurrent/Callback/CCallbackData.h" #include "Reasoner/Query/CSatisfiableCalculationJob.h" #include "Reasoner/Query/CJobSatisfiableCallbackContextData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Reasoner { using namespace Query; using namespace Ontology; using namespace Kernel::Task; namespace Consistiser { namespace Events { /*! * \class CPrecomputationCalculatedCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CPrecomputationCalculatedCallbackEvent : public CCustomEvent, public CJobSatisfiableCallbackContextData, public CCallbackData { // public methods public: //! Constructor CPrecomputationCalculatedCallbackEvent(CThread* receiverThread, CSatisfiableCalculationJob* satCalcJob, CPrecomputationTestingItem* testingItem); //! Destructor virtual ~CPrecomputationCalculatedCallbackEvent(); static const QEvent::Type EVENTTYPE = EVENTPRECOMPUTATIONCALCULATEDCALLBACK; virtual void doCallback(); virtual bool getTestResultSatisfiable(); virtual CSatisfiableCalculationJob* getSatisfiableCalculationJob(); virtual CPrecomputationTestingItem* getTestingItem(); // protected methods protected: // protected variables protected: CThread* mRecThread; CSatisfiableCalculationJob* mSatCalcJob; CPrecomputationTestingItem* mTestingItem; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_EVENTS_CPRECOMPUTATIONCALCULATEDCALLBACKEVENT_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/CPrecomputationCalculatedCallbackEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/CPrecomputationCalculatedCallbackE0000644000175000017500000000406412520550764032366 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecomputationCalculatedCallbackEvent.h" namespace Konclude { namespace Reasoner { namespace Consistiser { namespace Events { CPrecomputationCalculatedCallbackEvent::CPrecomputationCalculatedCallbackEvent(CThread *receiverThread, CSatisfiableCalculationJob *satCalcJob, CPrecomputationTestingItem* testingItem) : CCustomEvent(EVENTTYPE),CJobSatisfiableCallbackContextData(satCalcJob) { mRecThread = receiverThread; mSatCalcJob = satCalcJob; mTestingItem = testingItem; setCallbackDataContext(this); } CPrecomputationCalculatedCallbackEvent::~CPrecomputationCalculatedCallbackEvent() { takeCallbackDataContext(); } void CPrecomputationCalculatedCallbackEvent::doCallback() { mRecThread->postEvent(this); } bool CPrecomputationCalculatedCallbackEvent::getTestResultSatisfiable() { return mSatisfiable; } CSatisfiableCalculationJob *CPrecomputationCalculatedCallbackEvent::getSatisfiableCalculationJob() { return mSatCalcJob; } CPrecomputationTestingItem* CPrecomputationCalculatedCallbackEvent::getTestingItem() { return mTestingItem; } }; // end namespace Events }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/CPrecomputeOntologyEvent.h0000644000175000017500000000545712520550764030766 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_Consistiser_EVENTS_CPRECOMPUTEONTOLOGYEVENT_H #define KONCLUDE_REASONER_Consistiser_EVENTS_CPRECOMPUTEONTOLOGYEVENT_H // Libraries includes // Namespace includes #include "../ConsistiserSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; using namespace Config; namespace Reasoner { using namespace Ontology; namespace Consistiser { namespace Events { /*! * \class CPrecomputeOntologyEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CPrecomputeOntologyEvent : public CCustomEvent { // public methods public: //! Constructor CPrecomputeOntologyEvent(CConcreteOntology* ontology, CConfigurationBase* configuration, const QList& requirementList, CCallbackData* callbackData = 0); //! Destructor virtual ~CPrecomputeOntologyEvent(); virtual CConcreteOntology *getOntology(); virtual CCallbackData *getCallbackData(); virtual CConfigurationBase *getConfiguration(); virtual QList* getProcessingRequirementList(); static const QEvent::Type EVENTTYPE = EVENTPRECOMPUTEONTOLOGY; // protected methods protected: // protected variables protected: CConcreteOntology* onto; CConfigurationBase* config; CCallbackData* callback; QList mRequirementList; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_Consistiser_EVENTS_CPRECOMPUTEONTOLOGYEVENT_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/CCallbackPrecomputedOntologyEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/CCallbackPrecomputedOntologyEvent.0000644000175000017500000000347312520550764032373 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCallbackPrecomputedOntologyEvent.h" namespace Konclude { namespace Reasoner { namespace Consistiser { namespace Events { CCallbackPrecomputedOntologyEvent::CCallbackPrecomputedOntologyEvent(CConcreteOntology *ontology, CCallbackData *callbackPossibleCallbackData, CCallbackData *callbackData) : CCustomEvent(EVENTTYPE) { onto = ontology; precomputedCallback = callbackData; possibleCallback = callbackPossibleCallbackData; } CCallbackPrecomputedOntologyEvent::~CCallbackPrecomputedOntologyEvent() { } CConcreteOntology *CCallbackPrecomputedOntologyEvent::getOntology() { return onto; } CCallbackData *CCallbackPrecomputedOntologyEvent::getPrecomputedCallbackData() { return precomputedCallback; } CCallbackData *CCallbackPrecomputedOntologyEvent::getCallbackPossibleCallbackData() { return possibleCallback; } }; // end namespace Events }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/CSaturationPrecomputationCalculatedCallbackEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/CSaturationPrecomputationCalculate0000644000175000017500000000370512520550766032555 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationPrecomputationCalculatedCallbackEvent.h" namespace Konclude { namespace Reasoner { namespace Consistiser { namespace Events { CSaturationPrecomputationCalculatedCallbackEvent::CSaturationPrecomputationCalculatedCallbackEvent(CThread *receiverThread, CApproximatedSaturationCalculationJob *satCalcJob, CPrecomputationTestingItem* preTestItem) : CCustomEvent(EVENTTYPE) { recThread = receiverThread; mSatCalcJob = satCalcJob; mPreTestItem = preTestItem; } CSaturationPrecomputationCalculatedCallbackEvent::~CSaturationPrecomputationCalculatedCallbackEvent() { } void CSaturationPrecomputationCalculatedCallbackEvent::doCallback() { recThread->postEvent(this); } CApproximatedSaturationCalculationJob *CSaturationPrecomputationCalculatedCallbackEvent::getSaturationCalculationJob() { return mSatCalcJob; } CPrecomputationTestingItem* CSaturationPrecomputationCalculatedCallbackEvent::getPrecomputationTestingItem() { return mPreTestItem; } }; // end namespace Events }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/CCallbackPrecomputedOntologyEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/Events/CCallbackPrecomputedOntologyEvent.0000644000175000017500000000520012520550764032361 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_EVENTS_CCALLBACKPRECOMPUTEDONTOLOGYEVENT_H #define KONCLUDE_REASONER_CONSISTISER_EVENTS_CCALLBACKPRECOMPUTEDONTOLOGYEVENT_H // Libraries includes // Namespace includes #include "../ConsistiserSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; namespace Consistiser { namespace Events { /*! * \class CCallbackPrecomputedOntologyEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CCallbackPrecomputedOntologyEvent : public CCustomEvent { // public methods public: //! Constructor CCallbackPrecomputedOntologyEvent(CConcreteOntology* ontology, CCallbackData* callbackPossibleCallbackData, CCallbackData* precomputedCallbackData); //! Destructor virtual ~CCallbackPrecomputedOntologyEvent(); CConcreteOntology* getOntology(); CCallbackData* getPrecomputedCallbackData(); CCallbackData* getCallbackPossibleCallbackData(); static const QEvent::Type EVENTTYPE = EVENTCALLBACKPRECOMPUTEDONTOLOGY; // protected methods protected: // protected variables protected: CConcreteOntology* onto; CCallbackData* precomputedCallback; CCallbackData* possibleCallback; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_EVENTS_CCALLBACKPRECOMPUTEDONTOLOGYEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CConceptCyclePrecomputationTestingItem.h0000644000175000017500000000515012520550766032314 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CCONCEPTCYCLEPRECOMPUTATIONTESTINGITEM_H #define KONCLUDE_REASONER_CONSISTISER_CCONCEPTCYCLEPRECOMPUTATIONTESTINGITEM_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" #include "CPrecomputationTestingItem.h" // Other includes #include "Reasoner/Kernel/Task/CTaskPreyingAdapter.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; namespace Consistiser { /*! * * \class CConceptCyclePrecomputationTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptCyclePrecomputationTestingItem : public CPrecomputationTestingItem, public CTaskPreyingListner { // public methods public: //! Constructor CConceptCyclePrecomputationTestingItem(CConceptCycleData* conceptCycleData, COntologyPrecomputationItem* preCompItem); virtual PRECOMPUTATIONTYPE getPrecomputationTestingType(); CTaskPreyingAdapter* getTaskPreyingAdapter(); virtual CTaskPreyingListner* tellPreyedSatisfialbeTask(CSatisfiableCalculationTask* task); CConceptCycleData* getConceptCycleData(); CSatisfiableCalculationJobInstantiation* getJobInstantiation(); // protected methods protected: // protected variables protected: CTaskPreyingAdapter mTaskPreyingAdapter; QAtomicPointer mSatCalcTaskPointer; CConceptCycleData* mConceptCycleData; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CCONCEPTCYCLEPRECOMPUTATIONTESTINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CConsistencePrecomputationTestingItem.cpp0000644000175000017500000000310612520550766032550 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConsistencePrecomputationTestingItem.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CConsistencePrecomputationTestingItem::CConsistencePrecomputationTestingItem(CConsistenceObserver* observer, COntologyPrecomputationItem* preCompItem) : CPrecomputationTestingItem(preCompItem),mObserver(observer) { mTaskPreyingAdapter.setConsitenceObserver(observer); } CPrecomputationTestingItem::PRECOMPUTATIONTYPE CConsistencePrecomputationTestingItem::getPrecomputationTestingType() { return CONSISTENCEPRECOMPUTATIONTYPE; } CTaskPreyingAdapter* CConsistencePrecomputationTestingItem::getTaskPreyingAdapter() { return &mTaskPreyingAdapter; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationIndividualReferenceLinking.cpp0000644000175000017500000000213612520550772032460 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationIndividualReferenceLinking.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CSaturationIndividualReferenceLinking::CSaturationIndividualReferenceLinking() { } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/COntologyPrecomputationItem.cpp0000644000175000017500000000566712520550770030560 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyPrecomputationItem.h" namespace Konclude { namespace Reasoner { namespace Consistiser { COntologyPrecomputationItem::COntologyPrecomputationItem() { } COntologyPrecomputationItem* COntologyPrecomputationItem::initPrecomputationItem(CConcreteOntology* ontology, CConfigurationBase* config) { mOntology = ontology; mConfig = config; mPrecomputationFinishedFlag = false; return this; } COntologyPrecomputationItem* COntologyPrecomputationItem::addPrecomputationRequirement(COntologyProcessingRequirement* ontoRequirement) { ontoRequirement->submitRequirementUpdate(COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSUNSUPPORTED); return this; } bool COntologyPrecomputationItem::isPrecomputationFinished() { return mPrecomputationFinishedFlag; } COntologyPrecomputationItem* COntologyPrecomputationItem::setPrecomputationFinished(bool finished, bool doCallbacks) { mPrecomputationFinishedFlag = finished; doPrecomputationFinishedCallback(doCallbacks); return this; } COntologyPrecomputationItem* COntologyPrecomputationItem::doPrecomputationFinishedCallback(bool doCallbacks) { if (doCallbacks) { mCallbackExecuter.doCallback(); } return this; } COntologyPrecomputationItem* COntologyPrecomputationItem::addPrecomputationFinishedCallback(CCallbackData* callback) { mCallbackExecuter.addCallbackData(callback); return this; } CConcreteOntology* COntologyPrecomputationItem::getOntology() { return mOntology; } CConfigurationBase* COntologyPrecomputationItem::getConfiguration() { return mConfig; } QSet* COntologyPrecomputationItem::getPrecomputationTestingItemSet() { return &mTestItemSet; } cint64 COntologyPrecomputationItem::getCurrentPrecomputationTestingCount() { return mTestItemSet.count(); } bool COntologyPrecomputationItem::hasCurrentPrecomputationTesting() { return mTestItemSet.count() > 0; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationConceptReferenceLinking.cpp0000644000175000017500000000423312520550772031763 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationConceptReferenceLinking.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CSaturationConceptReferenceLinking::CSaturationConceptReferenceLinking() { mPotentiallyExistInitConcept = false; mDataRangeConcept = false; mIndiProcessNodeForConcept = nullptr; } bool CSaturationConceptReferenceLinking::isPotentiallyExistInitializationConcept() { return mPotentiallyExistInitConcept; } CSaturationConceptReferenceLinking* CSaturationConceptReferenceLinking::setPotentiallyExistInitializationConcept(bool initConcept) { mPotentiallyExistInitConcept = initConcept; return this; } CSaturationConceptReferenceLinking* CSaturationConceptReferenceLinking::setIndividualProcessNodeForConcept(CProcessReference* indiNode) { mIndiProcessNodeForConcept = indiNode; return this; } CProcessReference* CSaturationConceptReferenceLinking::getIndividualProcessNodeForConcept() { return mIndiProcessNodeForConcept; } bool CSaturationConceptReferenceLinking::isDataRangeConcept() { return mDataRangeConcept; } CSaturationConceptReferenceLinking* CSaturationConceptReferenceLinking::setDataRangeConcept(bool dataRangeConcept) { mDataRangeConcept = dataRangeConcept; return this; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationIndividualReferenceLinking.h0000644000175000017500000000370412520550772032127 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CSATURATIONINDIVIDUALREFERENCELINKING_H #define KONCLUDE_REASONER_CONSISTISER_CSATURATIONINDIVIDUALREFERENCELINKING_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes #include "Reasoner/Ontology/CIndividualSaturationReferenceLinkingData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Consistiser { /*! * * \class CSaturationIndividualReferenceLinking * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationIndividualReferenceLinking : public CIndividualSaturationReferenceLinkingData { // public methods public: //! Constructor CSaturationIndividualReferenceLinking(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CSATURATIONINDIVIDUALREFERENCELINKING_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIncrementalConsistencePrecomputationTestingItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIncrementalConsistencePrecomputationTest0000644000175000017500000000341012520550766032632 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIncrementalConsistencePrecomputationTestingItem.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CIncrementalConsistencePrecomputationTestingItem::CIncrementalConsistencePrecomputationTestingItem(CConsistenceObserver* observer, CConcreteOntology* lastConsOntology, cint64 incRevID, COntologyPrecomputationItem* preCompItem) : CPrecomputationTestingItem(preCompItem),mObserver(observer),mTaskIncConsTestAdapter(preCompItem->getOntology(),lastConsOntology,incRevID,observer) { } CPrecomputationTestingItem::PRECOMPUTATIONTYPE CIncrementalConsistencePrecomputationTestingItem::getPrecomputationTestingType() { return CONSISTENCEPRECOMPUTATIONTYPE; } CSatisfiableTaskIncrementalConsistencyTestingAdapter* CIncrementalConsistencePrecomputationTestingItem::getIncrementalConsistencyTestingAdapter() { return &mTaskIncConsTestAdapter; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/COntologyPrecomputationItem.h0000644000175000017500000000622012520550770030207 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CONTOLOGYPRECOMPUTATIONITEM_H #define KONCLUDE_REASONER_CONSISTISER_CONTOLOGYPRECOMPUTATIONITEM_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Concurrent/Callback/CCallbackRememberLinkedExecuter.h" #include "Concurrent/Callback/CCallbackData.h" #include "Concurrent/Callback/CCallbackListExecuter.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; using namespace Config; namespace Reasoner { using namespace Ontology; namespace Consistiser { /*! * * \class COntologyPrecomputationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyPrecomputationItem { // public methods public: //! Constructor COntologyPrecomputationItem(); COntologyPrecomputationItem* initPrecomputationItem(CConcreteOntology* ontology, CConfigurationBase* config); virtual COntologyPrecomputationItem* addPrecomputationRequirement(COntologyProcessingRequirement* ontoRequirement); bool isPrecomputationFinished(); COntologyPrecomputationItem* setPrecomputationFinished(bool finished, bool doCallbacks = true); COntologyPrecomputationItem* doPrecomputationFinishedCallback(bool doCallbacks); COntologyPrecomputationItem* addPrecomputationFinishedCallback(CCallbackData* callback); CConfigurationBase* getConfiguration(); CConcreteOntology* getOntology(); QSet* getPrecomputationTestingItemSet(); cint64 getCurrentPrecomputationTestingCount(); bool hasCurrentPrecomputationTesting(); // protected methods protected: // protected variables protected: CConcreteOntology* mOntology; CConfigurationBase* mConfig; bool mPrecomputationFinishedFlag; CCallbackListExecuter mCallbackExecuter; QSet mTestItemSet; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CONTOLOGYPRECOMPUTATIONITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationConceptDataItem.h0000644000175000017500000001027212520550772027706 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CSATURATIONCONCEPTDATAITEM_H #define KONCLUDE_REASONER_CONSISTISER_CSATURATIONCONCEPTDATAITEM_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" #include "CSaturationConceptReferenceLinking.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CConceptReferenceLinking.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Consistiser { /*! * * \class CSaturationConceptDataItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationConceptDataItem : public CSaturationConceptReferenceLinking { // public methods public: //! Constructor CSaturationConceptDataItem(); CSaturationConceptDataItem* initConceptSaturationTestingItem(CConcept* satTestConcept, bool negated, CRole* role); CConcept* getSaturationConcept(); CRole* getSaturationRoleRanges(); bool getSaturationNegation(); CConceptReferenceLinking* getConceptReferenceLinking(); CSaturationConceptDataItem* setConceptReferenceLinking(CConceptReferenceLinking* refLinking); QList* getExistReferenceConceptItemList(); CSaturationConceptDataItem* addExistReferenceConceptItemList(CSaturationConceptDataItem* existItem); bool isOrderingQueued(); CSaturationConceptDataItem* setOrderingQueued(bool queued); bool hasIndirectSuccessorsItems(); CSaturationConceptDataItem* setIndirectSuccessorsItems(bool hasSuccessors); bool hasMultipleDirectPredecessorsItems(); CSaturationConceptDataItem* setMultipleDirectPredecessorsItems(bool multiblePredItems); // for saturation algorithm enum SATURATIONITEMREFERENCESPECIALMODE { NONESATURATIONMODE, SATURATIONCOPYMODE, SATURATIONSUBSTITUTEMODE }; bool isInvalidSpecialItemReference(); CSaturationConceptDataItem* setInvalidSpecialItemReference(bool invalid); CSaturationConceptDataItem* getSpecialItemReference(); CSaturationConceptDataItem* setSpecialItemReference(CSaturationConceptDataItem* reference); SATURATIONITEMREFERENCESPECIALMODE getSpecialReferenceMode(); CSaturationConceptDataItem* setSpecialItemReferenceMode(SATURATIONITEMREFERENCESPECIALMODE mode); bool isItemProcessingQueued(); CSaturationConceptDataItem* setItemProcessingQueued(bool queued); bool isItemProcessingMarked(); CSaturationConceptDataItem* setItemProcessingMarked(bool marked); // protected methods protected: // protected variables protected: CConcept* mConceptSat; CRole* mRoleRanges; bool mNegation; QList mExistReferenceItemList; bool mOrderingQueued; bool mSucessorsItems; bool mMultiplePredItems; bool mInvalidSpecialItemReference; bool mProcessingQueued; bool mProcessingMarked; CConceptReferenceLinking* mConRefLinking; CSaturationConceptDataItem* mSpecialItemReference; SATURATIONITEMREFERENCESPECIALMODE mSpecialReferenceMode; //QString mSubsumingConceptString; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CSATURATIONCONCEPTDATAITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationIndividualDataItem.cpp0000644000175000017500000000272212520550772030737 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationIndividualDataItem.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CSaturationIndividualDataItem::CSaturationIndividualDataItem() : CLinkerBase(nullptr,nullptr) { } CSaturationIndividualDataItem* CSaturationIndividualDataItem::initConceptSaturationTestingItem(CIndividual* individual, cint64 saturationID) { setData(individual); mSaturationID = saturationID; return this; } CIndividual* CSaturationIndividualDataItem::getIndividual() { return getData(); } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationIndividualDataItem.h0000644000175000017500000000431112520550772030400 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CSATURATIONINDIVIDUALDATAITEM_H #define KONCLUDE_REASONER_CONSISTISER_CSATURATIONINDIVIDUALDATAITEM_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" #include "CSaturationIndividualReferenceLinking.h" // Other includes #include "Reasoner/Ontology/CIndividual.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Consistiser { /*! * * \class CSaturationIndividualDataItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationIndividualDataItem : public CLinkerBase, public CSaturationIndividualReferenceLinking { // public methods public: //! Constructor CSaturationIndividualDataItem(); CSaturationIndividualDataItem* initConceptSaturationTestingItem(CIndividual* individual, cint64 saturationID); CIndividual* getIndividual(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CSATURATIONINDIVIDUALDATAITEM_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationIndividualAnalysationObserver.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationIndividualAnalysationObserver.0000644000175000017500000000410112520550772032527 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CSATURATIONINDIVIDUALANALYSATIONOBSERVER_H #define KONCLUDE_REASONER_CONSISTISER_CSATURATIONINDIVIDUALANALYSATIONOBSERVER_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Consistiser { /*! * * \class CSaturationIndividualAnalysationObserver * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationIndividualAnalysationObserver { // public methods public: //! Constructor CSaturationIndividualAnalysationObserver(); //! Destructor virtual ~CSaturationIndividualAnalysationObserver(); virtual CSaturationIndividualAnalysationObserver* notifyClashedIndividual() = 0; virtual CSaturationIndividualAnalysationObserver* notifyInsufficientIndividual() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CSATURATIONINDIVIDUALANALYSATIONOBSERVER_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationCommonDisjunctConceptsExtractor.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationCommonDisjunctConceptsExtracto0000644000175000017500000000476012520550772032626 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CSATURATIONCOMMONDISJUNCTCONCEPTSEXTRACTOR_H #define KONCLUDE_REASONER_CONSISTISER_CSATURATIONCOMMONDISJUNCTCONCEPTSEXTRACTOR_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h" #include "Reasoner/Consistence/CSaturationData.h" #include "Reasoner/Kernel/Task/CSaturationTaskData.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" #include "Reasoner/Kernel/Process/CIndividualSaturationProcessNode.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Consistence; using namespace Kernel::Task; using namespace Kernel::Process; namespace Consistiser { /*! * * \class CSaturationCommonDisjunctConceptsExtractor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationCommonDisjunctConceptsExtractor { // public methods public: //! Constructor CSaturationCommonDisjunctConceptsExtractor(); bool extractCommonDisjunctConcepts(CConcreteOntology* ontology, CSaturationData* saturationData, QSet* disjunctionConceptSet); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CSATURATIONCOMMONDISJUNCTCONCEPTSEXTRACTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationObserver.h0000644000175000017500000000406012520550774026471 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CSATURATIONOBSERVER_H #define KONCLUDE_REASONER_CONSISTISER_CSATURATIONOBSERVER_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes #include "Reasoner/Consistence/CSaturationData.h" #include "Reasoner/Ontology/CConcept.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Ontology; using namespace Consistence; namespace Consistiser { /*! * * \class CSaturationObserver * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationObserver { // public methods public: //! Constructor CSaturationObserver(); //! Destructor virtual ~CSaturationObserver(); virtual CSaturationObserver* tellSaturationData(CSaturationData* saturationData) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CSATURATIONOBSERVER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CPrecomputationTestingStep.h0000644000175000017500000000651112520550770030032 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATIONTESTINGSTEP_H #define KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATIONTESTINGSTEP_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Reasoner/Ontology/COntologyProcessingStepData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Consistiser { /*! * * \class CPrecomputationTestingStep * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPrecomputationTestingStep { // public methods public: enum TESTINGSTEPTYPE { CONSISTENCYPRECOMPUTATIONSTEP, CYCLEPRECOMPUTATIONSTEP, SATURATIONPRECOMPUTATIONSTEP, INDIVIDUALPRECOMPUTATIONSTEP }; //! Constructor CPrecomputationTestingStep(TESTINGSTEPTYPE testingStepType, COntologyProcessingStepData* processingStepData, COntologyPrecomputationItem* precompItem); COntologyPrecomputationItem* getOntologyPrecomputationItem(); CPrecomputationTestingStep* setOntologyPrecomputationItem(COntologyPrecomputationItem* precompItem); bool hasRequirements(); bool isStepFinished(); bool areStepProcessingRequirementSatisfied(); CPrecomputationTestingStep* setStepFinished(bool finished); QList* getRequirementList(); COntologyProcessingStepData* getProcessingStepData(); CPrecomputationTestingStep* setProcessingStepData(COntologyProcessingStepData* processingData); CPrecomputationTestingStep* addProcessingRequirement(COntologyProcessingRequirement* processingRequirement); CPrecomputationTestingStep* submitRequirementsUpdate(cint64 flags, bool clearRequirements = true); CPrecomputationTestingStep* submitRequirementsUpdate(bool clearRequirements = true); TESTINGSTEPTYPE getPrecomputationTestingType(); // protected methods protected: // protected variables protected: TESTINGSTEPTYPE mTestingStepType; COntologyPrecomputationItem* mOntologyPrecompItem; COntologyProcessingStepData* mProcessingStepData; QList mRequirementStepDataList; bool mStepFinished; cint64 mCombineLastFlags; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATIONTESTINGSTEP_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIncrementalOntologyPrecomputationItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIncrementalOntologyPrecomputationItem.cp0000644000175000017500000003102012520550766032545 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIncrementalOntologyPrecomputationItem.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CIncrementalOntologyPrecomputationItem::CIncrementalOntologyPrecomputationItem() { } CIncrementalOntologyPrecomputationItem* CIncrementalOntologyPrecomputationItem::initTotallyPrecomputationItem(CConcreteOntology* ontology, CConfigurationBase* config) { COntologyPrecomputationItem::initPrecomputationItem(ontology,config); mConsistenceCheched = false; mConsistence = nullptr; mPrecomputation = ontology->getPrecomputation(); mCalculationConfig = new CCalculationConfigurationExtension(config,0); mConsistenceCheckCreated = false; mIndividualPrecomputationCreated = false; mIndividualPrecomputationChecked = false; COntologyProcessingStepDataVector* ontProStepDataVec = mOntology->getProcessingSteps()->getOntologyProcessingStepDataVector(); mConsistencePrecomputationStep = new CPrecomputationTestingStep(CPrecomputationTestingStep::CONSISTENCYPRECOMPUTATIONSTEP,ontProStepDataVec->getProcessingStepData(COntologyProcessingStep::OPSCONSISTENCY),this); mCyclePrecomputationStep = new CPrecomputationTestingStep(CPrecomputationTestingStep::CYCLEPRECOMPUTATIONSTEP,ontProStepDataVec->getProcessingStepData(COntologyProcessingStep::OPSPRECOMPUTECYCLES),this); mSaturationPrecomputationStep = new CPrecomputationTestingStep(CPrecomputationTestingStep::SATURATIONPRECOMPUTATIONSTEP,ontProStepDataVec->getProcessingStepData(COntologyProcessingStep::OPSPRECOMPUTESATURATION),this); mIndividualPrecomputationStep = new CPrecomputationTestingStep(CPrecomputationTestingStep::INDIVIDUALPRECOMPUTATIONSTEP,ontProStepDataVec->getProcessingStepData(COntologyProcessingStep::OPSPRECOMPUTEINDIVIDUAL),this); mProcessingSteps.append(mCyclePrecomputationStep); mProcessingSteps.append(mConsistencePrecomputationStep); mProcessingSteps.append(mSaturationPrecomputationStep); mProcessingSteps.append(mIndividualPrecomputationStep); mIndividualComputationRunning = false; mIndividualTestRunning = false; mLastConsistentlyTestedVersion = nullptr; mDirectlyChangedIndividualsIdentified = false; mInitTime.start(); return this; } CIncrementalOntologyPrecomputationItem::~CIncrementalOntologyPrecomputationItem() { delete mCalculationConfig; delete mConsistencePrecomputationStep; delete mCyclePrecomputationStep; delete mSaturationPrecomputationStep; delete mIndividualPrecomputationStep; } COntologyPrecomputationItem* CIncrementalOntologyPrecomputationItem::addPrecomputationRequirement(COntologyProcessingRequirement* ontoRequirement) { bool supportRequirement = false; COntologyProcessingStepRequirement* stepProcRequirement = dynamic_cast(ontoRequirement); if (stepProcRequirement) { if (stepProcRequirement->getRequiredProcessingStep()->getOntologyProcessingType() == COntologyProcessingStep::OPSCONSISTENCY) { mConsistencePrecomputationStep->addProcessingRequirement(stepProcRequirement); supportRequirement = true; } if (stepProcRequirement->getRequiredProcessingStep()->getOntologyProcessingType() == COntologyProcessingStep::OPSPRECOMPUTESATURATION) { mSaturationPrecomputationStep->addProcessingRequirement(stepProcRequirement); supportRequirement = true; } if (stepProcRequirement->getRequiredProcessingStep()->getOntologyProcessingType() == COntologyProcessingStep::OPSPRECOMPUTECYCLES) { mCyclePrecomputationStep->addProcessingRequirement(stepProcRequirement); supportRequirement = true; } if (stepProcRequirement->getRequiredProcessingStep()->getOntologyProcessingType() == COntologyProcessingStep::OPSPRECOMPUTEINDIVIDUAL) { mIndividualPrecomputationStep->addProcessingRequirement(stepProcRequirement); supportRequirement = true; } } COntologyProcessingConceptSaturationRequirement* conSatRequirement = dynamic_cast(ontoRequirement); if (conSatRequirement) { mSaturationPrecomputationStep->addProcessingRequirement(conSatRequirement); supportRequirement = true; } if (!supportRequirement) { stepProcRequirement->submitRequirementUpdate(COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSUNSUPPORTED); } return this; } CIncrementalOntologyPrecomputationItem* CIncrementalOntologyPrecomputationItem::setConsistenceCheched(bool consistenceChecked) { mConsistenceCheched = consistenceChecked; return this; } bool CIncrementalOntologyPrecomputationItem::hasConsistenceCheched() { return mConsistenceCheched; } CIncrementalOntologyPrecomputationItem* CIncrementalOntologyPrecomputationItem::setConsistenceCheckCreated(bool consistenceCheckCreated) { mConsistenceCheckCreated = consistenceCheckCreated; return this; } bool CIncrementalOntologyPrecomputationItem::hasConsistenceCheckCreated() { return mConsistenceCheckCreated; } CConsistenceObserver* CIncrementalOntologyPrecomputationItem::tellConsistenceData(CConsistenceData* consData) { if (mConsData.testAndSetOrdered(nullptr,consData)) { consData->overtakeData(); } else { delete consData; } return this; } CConsistenceData* CIncrementalOntologyPrecomputationItem::getConsistenceData() { return mConsData.fetchAndAddRelaxed(0); } CConsistence* CIncrementalOntologyPrecomputationItem::getConsistence() { return mConsistence; } CIncrementalOntologyPrecomputationItem* CIncrementalOntologyPrecomputationItem::setConsistence(CConsistence* consistence) { mConsistence = consistence; return this; } CCalculationConfigurationExtension* CIncrementalOntologyPrecomputationItem::getCalculationConfiguration() { return mCalculationConfig; } CIncrementalOntologyPrecomputationItem* CIncrementalOntologyPrecomputationItem::setPrecomputation(CPrecomputation* precomputation) { mPrecomputation = precomputation; return this; } CPrecomputation* CIncrementalOntologyPrecomputationItem::getPrecomputation() { return mPrecomputation; } CPrecomputationTestingStep* CIncrementalOntologyPrecomputationItem::getConsistencePrecomputationStep() { return mConsistencePrecomputationStep; } bool CIncrementalOntologyPrecomputationItem::isConsistenceStepFinished() { return mConsistencePrecomputationStep->isStepFinished(); } bool CIncrementalOntologyPrecomputationItem::isConsistenceStepRequired() { return mConsistencePrecomputationStep->hasRequirements(); } bool CIncrementalOntologyPrecomputationItem::areConsistenceStepProcessingRequirementSatisfied() { return mConsistencePrecomputationStep->areStepProcessingRequirementSatisfied(); } bool CIncrementalOntologyPrecomputationItem::areCycleStepProcessingRequirementSatisfied() { return mCyclePrecomputationStep->areStepProcessingRequirementSatisfied(); } CPrecomputationTestingStep* CIncrementalOntologyPrecomputationItem::getCyclePrecomputationStep() { return mCyclePrecomputationStep; } bool CIncrementalOntologyPrecomputationItem::isCycleStepFinished() { return mCyclePrecomputationStep->isStepFinished(); } bool CIncrementalOntologyPrecomputationItem::isCycleStepRequired() { return mCyclePrecomputationStep->hasRequirements(); } bool CIncrementalOntologyPrecomputationItem::areSaturationStepProcessingRequirementSatisfied() { return mSaturationPrecomputationStep->areStepProcessingRequirementSatisfied(); } CPrecomputationTestingStep* CIncrementalOntologyPrecomputationItem::getSaturationPrecomputationStep() { return mSaturationPrecomputationStep; } bool CIncrementalOntologyPrecomputationItem::isSaturationStepFinished() { return mSaturationPrecomputationStep->isStepFinished(); } bool CIncrementalOntologyPrecomputationItem::isSaturationStepRequired() { return mSaturationPrecomputationStep->hasRequirements(); } bool CIncrementalOntologyPrecomputationItem::areAllStepFinished() { for (QList::const_iterator it = mProcessingSteps.constBegin(), itEnd = mProcessingSteps.constEnd(); it != itEnd; ++it) { if (!(*it)->isStepFinished()) { return false; } } return true; } bool CIncrementalOntologyPrecomputationItem::hasRemainingProcessingRequirements() { for (QList::const_iterator it = mProcessingSteps.constBegin(), itEnd = mProcessingSteps.constEnd(); it != itEnd; ++it) { if ((*it)->hasRequirements()) { return true; } } return false; } bool CIncrementalOntologyPrecomputationItem::areIndividualStepProcessingRequirementSatisfied() { return mIndividualPrecomputationStep->areStepProcessingRequirementSatisfied(); } CPrecomputationTestingStep* CIncrementalOntologyPrecomputationItem::getIndividualPrecomputationStep() { return mIndividualPrecomputationStep; } bool CIncrementalOntologyPrecomputationItem::isIndividualStepRunning() { return mIndividualTestRunning; } CIncrementalOntologyPrecomputationItem* CIncrementalOntologyPrecomputationItem::setIndividualStepRunning(bool satStepRunning) { mIndividualTestRunning = satStepRunning; return this; } bool CIncrementalOntologyPrecomputationItem::isIndividualComputationRunning() { return mIndividualComputationRunning; } CIncrementalOntologyPrecomputationItem* CIncrementalOntologyPrecomputationItem::setIndividualComputationRunning(bool indiCompRunning) { mIndividualComputationRunning = indiCompRunning; return this; } CIncrementalOntologyPrecomputationItem* CIncrementalOntologyPrecomputationItem::setIndividualPrecomputationCreated(bool initialized) { mIndividualPrecomputationCreated = initialized; return this; } bool CIncrementalOntologyPrecomputationItem::hasIndividualPrecomputationCreated() { return mIndividualPrecomputationCreated; } CIncrementalOntologyPrecomputationItem* CIncrementalOntologyPrecomputationItem::setIndividualPrecomputationChecked(bool checked) { mIndividualPrecomputationChecked = checked; return this; } bool CIncrementalOntologyPrecomputationItem::hasIndividualPrecomputationChecked() { return mIndividualPrecomputationChecked; } bool CIncrementalOntologyPrecomputationItem::isIndividualStepFinished() { return mIndividualPrecomputationStep->isStepFinished(); } bool CIncrementalOntologyPrecomputationItem::isIndividualStepRequired() { return mIndividualPrecomputationStep->hasRequirements(); } CConcreteOntology* CIncrementalOntologyPrecomputationItem::getLastConsistentlyTestedVersion() { return mLastConsistentlyTestedVersion; } CIncrementalOntologyPrecomputationItem* CIncrementalOntologyPrecomputationItem::setLastConsistentlyTestedVersion(CConcreteOntology* ontology) { mLastConsistentlyTestedVersion = ontology; return this; } QSet* CIncrementalOntologyPrecomputationItem::getDirectlyChangedIndividualSet() { return &mDirectlyChangedIndividualSet; } bool CIncrementalOntologyPrecomputationItem::hasDirectlyChangedIndividualsIdentified() { return mDirectlyChangedIndividualsIdentified; } bool CIncrementalOntologyPrecomputationItem::setDirectlyChangedIndividualsIdentified(bool identified) { mDirectlyChangedIndividualsIdentified = identified; return this; } cint64 CIncrementalOntologyPrecomputationItem::getIncrementalExpansionID() { return mOntology->getOntologyID(); } QTime* CIncrementalOntologyPrecomputationItem::getInitializationTime() { return &mInitTime; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CDirectBlockedProcessingConsistiser.cpp0000644000175000017500000000647112520550766032155 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDirectBlockedProcessingConsistiser.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CDirectBlockedProcessingConsistiser::CDirectBlockedProcessingConsistiser() : mConsAdapter(this) { mConsistence = nullptr; } CDirectBlockedProcessingConsistiser::~CDirectBlockedProcessingConsistiser() { } bool CDirectBlockedProcessingConsistiser::determineConsistency(CConcreteOntology* onto, CConfiguration *config) { QList indiList; CIndividualVector* indiVec = onto->getABox()->getIndividualVector(false); if (indiVec) { cint64 indiCount = indiVec->getItemCount(); for (cint64 idx = 0; idx < indiCount; ++idx) { CIndividual* indi = indiVec->getData(idx); if (indi) { indiList.append(indi); } } } CReasonerManager* reasonerManager = CConfigManagerReader::readReasonerManagerConfig(config); CSatisfiableCalculationJobGenerator satCalcJobGen(onto); CSatisfiableCalculationJob* satCalcJob = nullptr; bool simpleConsistency = false; if (indiList.isEmpty()) { CConcept* topConcept = onto->getTBox()->getTopConcept(); if (topConcept->getOperandCount() > 0) { satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(topConcept); } else { simpleConsistency = true; } } else { satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(indiList); satCalcJob->setSatisfiableTaskPreyingAdapter(&mConsAdapter); } mConsistence = new CConsistence(); if (satCalcJob) { CConfigurationBase* configBase = nullptr; if (config) { configBase = dynamic_cast(config); } CCalculationConfigurationExtension calcConfig(configBase,0); satCalcJob->setCalculationConfiguration(&calcConfig); CJobSatisfiableResult* result = reasonerManager->reasoningSatisfiableCalcualtionJob(satCalcJob); mConsistence->setOntologyConsistent(result->isSatisfiable()); } else { mConsistence->setOntologyConsistent(simpleConsistency); } onto->setConsistence(mConsistence); return this; } CConsistenceObserver* CDirectBlockedProcessingConsistiser::tellConsistenceData(CConsistenceData* consData) { mSynMutex.lock(); if (!mConsistence->hasConsistenceModelData()) { mConsistence->setConsistenceModelData(consData); consData->overtakeData(); } else { delete consData; } mSynMutex.unlock(); return this; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIndividualDependenceTrackingMarker.h0000644000175000017500000000357312520550770031524 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CINDIVIDUALDEPENDENCETRACKINGMARKER_H #define KONCLUDE_REASONER_CONSISTISER_CINDIVIDUALDEPENDENCETRACKINGMARKER_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Consistiser { /*! * * \class CIndividualDependenceTrackingMarker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualDependenceTrackingMarker { // public methods public: //! Constructor CIndividualDependenceTrackingMarker(); virtual CIndividualDependenceTrackingMarker* setIndividualDependenceTracked() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CINDIVIDUALDEPENDENCETRACKINGMARKER_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIndividualDependenceTrackingCollector.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIndividualDependenceTrackingCollector.cp0000644000175000017500000000332612574525554032413 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualDependenceTrackingCollector.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CIndividualDependenceTrackingCollector::CIndividualDependenceTrackingCollector() { } CIndividualDependenceTrackingCollector::~CIndividualDependenceTrackingCollector() { } CIndividualDependenceTracking* CIndividualDependenceTrackingCollector::getExtendingIndividualDependenceTracking() { return mIndiDepTrackingPointer.fetchAndAddRelaxed(0); } CIndividualDependenceTracking* CIndividualDependenceTrackingCollector::installIndividualDependenceTracking(CIndividualDependenceTracking* indDepTrack) { if (!mIndiDepTrackingPointer.testAndSetOrdered(nullptr,indDepTrack)) { delete indDepTrack; } return mIndiDepTrackingPointer.fetchAndAddRelaxed(0); } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CPrecomputationContext.cpp0000644000175000017500000000321612520550770027537 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecomputationContext.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CPrecomputationContext::CPrecomputationContext() { mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); mMemMan = new CLimitedReserveMemoryPoolAllocationManager(mMemoryPoolProvider); } CPrecomputationContext::~CPrecomputationContext() { delete mMemMan; delete mMemoryPoolProvider; } CMemoryPoolAllocationManager* CPrecomputationContext::getMemoryPoolAllocationManager() { return mMemMan; } CMemoryAllocationManager* CPrecomputationContext::getMemoryAllocationManager() { return mMemMan; } CMemoryPoolProvider* CPrecomputationContext::getMemoryPoolProvider() { return mMemoryPoolProvider; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationPrecomputationTestingItem.h0000644000175000017500000000434312520550774032074 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CSATURATIONPRECOMPUTATIONTESTINGITEM_H #define KONCLUDE_REASONER_CONSISTISER_CSATURATIONPRECOMPUTATIONTESTINGITEM_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" #include "CPrecomputationTestingItem.h" // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Consistiser { /*! * * \class CSaturationPrecomputationTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaturationPrecomputationTestingItem : public CPrecomputationTestingItem { // public methods public: //! Constructor CSaturationPrecomputationTestingItem(COntologyPrecomputationItem* preCompItem, CPrecomputationTestingItem::PRECOMPUTATIONTYPE precomputationType, cint64 saturationID = 0); virtual PRECOMPUTATIONTYPE getPrecomputationTestingType(); cint64 getSaturationID(); // protected methods protected: // protected variables protected: cint64 mSaturationID; PRECOMPUTATIONTYPE mPrecomputationType; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CSATURATIONPRECOMPUTATIONTESTINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CTotallyPrecomputationThread.cpp0000644000175000017500000024722212520550774030706 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTotallyPrecomputationThread.h" #ifndef KONCLUDE_FORCE_STATISTIC_DEACTIVATED #define KONCLUDE_PRECOMPUTATION_SATURATION_STATISTIC_OUTPUT #endif namespace Konclude { namespace Reasoner { namespace Consistiser { CTotallyPrecomputationThread::CTotallyPrecomputationThread(CReasonerManager *reasonerManager) : CPrecomputationThread(reasonerManager),CLogIdentifier("::Konclude::Reasoner::Kernel::Precomputator",this) { mReuseCompletionGraphCacheWriter = nullptr; CCompletionGraphCache* complGraphCache = reasonerManager->getCompletionGraphCache(); if (complGraphCache) { CReuseCompletionGraphCache* reuseComplGraphCache = dynamic_cast(complGraphCache); if (reuseComplGraphCache) { mReuseCompletionGraphCacheWriter = reuseComplGraphCache->createCacheWriter(); } } mBackendAssocCache = nullptr; CBackendCache* backendCache = reasonerManager->getBackendAssociationCache(); if (backendCache) { mBackendAssocCache = dynamic_cast(backendCache); } } CTotallyPrecomputationThread::~CTotallyPrecomputationThread() { } COntologyPrecomputationItem* CTotallyPrecomputationThread::initializeOntologyPrecomputionItem(CConcreteOntology* ontology, CConfigurationBase* config) { CTotallyOntologyPrecomputationItem* item = new CTotallyOntologyPrecomputationItem(); item->initTotallyPrecomputationItem(ontology,config); if (config) { bool configErrorFlag = false; cint64 processorCount = 1; QString processorCountString = CConfigDataReader::readConfigString(config,"Konclude.Calculation.ProcessorCount",QString(),&configErrorFlag); if (!configErrorFlag) { if (processorCountString == "AUTO") { processorCount = CThread::idealThreadCount(); } else { qint64 convertedWorkerCount = processorCountString.toInt(&configErrorFlag); if (configErrorFlag) { processorCount = convertedWorkerCount; } } } bool mulConfigErrorFlag = false; cint64 multiplicator = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Precomputation.TotalPrecomputor.MultipliedUnitsParallelCalculationCount",1,&mulConfigErrorFlag); mConfMaxTestParallelCount = processorCount*multiplicator; bool maxConfigErrorFlag = false; cint64 maxParallel = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Precomputation.TotalPrecomputor.MaximumParallelCalculationCount",1,&maxConfigErrorFlag); if (!maxConfigErrorFlag) { if (!mulConfigErrorFlag) { mConfMaxTestParallelCount = qMin(mConfMaxTestParallelCount,maxParallel); } else { mConfMaxTestParallelCount = maxParallel; } } } else { mConfMaxTestParallelCount = 1; } mIndividualSaturationCount = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Precomputation.TotalPrecomputor.IndividualsSaturationSize",1000); mConfForceFullCompletionGraphConstruction = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Precomputation.ForceFullCompletionGraphConstruction",false); return item; } bool CTotallyPrecomputationThread::createNextTest() { COntologyPrecomputationItem* loopOntPreCompItem = 0; bool workTestCreated = false; while (!workTestCreated && !mProcessingOntItemList.isEmpty()) { COntologyPrecomputationItem* ontPreCompItem = mProcessingOntItemList.first(); if (ontPreCompItem == loopOntPreCompItem) { // don't run into infinite loop without doing something break; } CTotallyOntologyPrecomputationItem* totallyPreCompItem = (CTotallyOntologyPrecomputationItem*)ontPreCompItem; bool failDebug = false; if (!workTestCreated && totallyPreCompItem->isConsistenceStepRequired()) { if (!totallyPreCompItem->isConsistenceStepFinished()) { if (totallyPreCompItem->areConsistenceStepProcessingRequirementSatisfied()) { if (!totallyPreCompItem->hasConceptSaturationPrecomputationCreated()) { LOG(INFO,getLogDomain(),logTr("Preparing concept saturation."),this); CConcreteOntology* ontology = totallyPreCompItem->getOntology(); totallyPreCompItem->setSaturationStepRunning(true); createSaturationConstructionJob(totallyPreCompItem); totallyPreCompItem->setSaturationComputationRunning(true); totallyPreCompItem->setConceptSaturationPrecomputationCreated(true); addIdentifiedRemainingConsistencyRequiredConcepts(totallyPreCompItem); addConsistencyRequiredSaturationIndividuals(totallyPreCompItem); } if (totallyPreCompItem->hasRemainingConsistencyRequiredSaturationConcepts() && !totallyPreCompItem->isSaturationComputationRunning()) { if (saturateRemainingConsistencyRequiredConcepts(totallyPreCompItem)) { totallyPreCompItem->setSaturationComputationRunning(true); workTestCreated = true; } } if (totallyPreCompItem->hasRemainingConsistencyRequiredSaturationIndividuals() && (!totallyPreCompItem->isSaturationComputationRunning() || totallyPreCompItem->hasIndividualSaturationRunning())) { if (!isAllAssertionIndividualSaturationSufficient(totallyPreCompItem)) { if (saturateRemainingConsistencyRequiredIndividuals(totallyPreCompItem)) { totallyPreCompItem->incIndividualSaturationRunningCount(); totallyPreCompItem->setSaturationComputationRunning(true); workTestCreated = true; } } } if (!totallyPreCompItem->isSaturationComputationRunning()) { if (totallyPreCompItem->failAfterConsistencyConceptSaturation()) { totallyPreCompItem->getConsistencePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED); totallyPreCompItem->getConsistencePrecomputationStep()->setStepFinished(true); failDebug |= true; } } if (!failDebug && !totallyPreCompItem->hasConsistenceCheckCreated() && !totallyPreCompItem->isSaturationComputationRunning()) { LOG(INFO,getLogDomain(),logTr("Precompute ontology consistency."),this); totallyPreCompItem->setConsistenceCheckCreated(true); workTestCreated = createConsistencePrecomputationCheck(totallyPreCompItem); } if (totallyPreCompItem->hasConsistenceCheched()) { LOG(INFO,getLogDomain(),logTr("Consistency computation completed."),this); totallyPreCompItem->getConsistencePrecomputationStep()->setStepFinished(true); COntologyProcessingStatistics* ontProcStats = totallyPreCompItem->getConsistencePrecomputationStep()->getProcessingStepData()->getProcessingStatistics(true); ontProcStats->setProcessingCountStatisticValue("consistency-checking-time",totallyPreCompItem->getInitializationTime()->elapsed()); if (totallyPreCompItem->failAfterConsistencyChecking()) { totallyPreCompItem->getConsistencePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED); failDebug |= true; } else { if (totallyPreCompItem->getOntology()->getConsistence()->isOntologyConsistent()) { totallyPreCompItem->getConsistencePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSSUCESSFULL); } else { totallyPreCompItem->getConsistencePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSSUCESSFULL | COntologyProcessingStatus::PSINCONSITENT); } } } } else { totallyPreCompItem->getConsistencePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); totallyPreCompItem->getConsistencePrecomputationStep()->setStepFinished(true); } } else { totallyPreCompItem->getConsistencePrecomputationStep()->submitRequirementsUpdate(); } } if (!workTestCreated && totallyPreCompItem->isIndividualStepRequired() && totallyPreCompItem->isConsistenceStepFinished()) { if (!totallyPreCompItem->isIndividualStepFinished()) { if (totallyPreCompItem->areIndividualStepProcessingRequirementSatisfied()) { if (totallyPreCompItem->hasRemainingConsistencyRequiredSaturationIndividuals() && (!totallyPreCompItem->isSaturationComputationRunning() || totallyPreCompItem->hasIndividualSaturationRunning())) { if (saturateRemainingConsistencyRequiredIndividuals(totallyPreCompItem)) { totallyPreCompItem->incIndividualSaturationRunningCount(); totallyPreCompItem->setSaturationComputationRunning(true); totallyPreCompItem->setIndividualStepRunning(true); workTestCreated = true; } } if (!totallyPreCompItem->hasIndividualPrecomputationCreated() && !totallyPreCompItem->isSaturationComputationRunning() && !totallyPreCompItem->hasIndividualSaturationRunning()) { totallyPreCompItem->setIndividualPrecomputationCreated(true); workTestCreated = createIndividualPrecomputationCheck(totallyPreCompItem); totallyPreCompItem->setIndividualStepRunning(true); } if (totallyPreCompItem->hasIndividualPrecomputationChecked() && !totallyPreCompItem->isIndividualComputationRunning()) { totallyPreCompItem->setIndividualStepRunning(false); totallyPreCompItem->getIndividualPrecomputationStep()->setStepFinished(true); totallyPreCompItem->getIndividualPrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSSUCESSFULL); } } else { totallyPreCompItem->setIndividualStepRunning(false); totallyPreCompItem->getIndividualPrecomputationStep()->setStepFinished(true); totallyPreCompItem->getIndividualPrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); } } else { totallyPreCompItem->getIndividualPrecomputationStep()->submitRequirementsUpdate(); } } if (!workTestCreated && totallyPreCompItem->isSaturationStepRequired() && totallyPreCompItem->isConsistenceStepFinished() && !totallyPreCompItem->hasIndividualSaturationRunning() && !totallyPreCompItem->isIndividualStepRunning()) { if (!totallyPreCompItem->isSaturationStepFinished()) { if (totallyPreCompItem->areSaturationStepProcessingRequirementSatisfied()) { if (totallyPreCompItem->hasRemainingRequiredSaturationConcepts() && !totallyPreCompItem->isSaturationComputationRunning()) { if (saturateRemainingRequiredItems(totallyPreCompItem)) { totallyPreCompItem->setSaturationComputationRunning(true); workTestCreated = true; } } if (totallyPreCompItem->hasConceptSaturationPrecomputationChecked() && !totallyPreCompItem->isSaturationComputationRunning()) { totallyPreCompItem->setSaturationStepRunning(false); if (totallyPreCompItem->requiresAllConceptsSaturation()) { LOG(INFO,getLogDomain(),logTr("Concept saturation finished."),this); totallyPreCompItem->getSaturationPrecomputationStep()->setStepFinished(true); } CPrecomputation* precomputation = totallyPreCompItem->getPrecomputation(); CSaturationData* saturationData = totallyPreCompItem->getSaturationData(); if (totallyPreCompItem->failAfterConceptSaturation()) { totallyPreCompItem->getSaturationPrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED); failDebug |= true; } else { if (!saturationData) { LOG(ERROR,getLogDomain(),logTr("Unknow error in computation, tableau saturation for ontology '%1' failed.").arg(ontPreCompItem->getOntology()->getTerminologyName()),getLogObject()); totallyPreCompItem->getSaturationPrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); } else { #ifdef KONCLUDE_PRECOMPUTATION_SATURATION_STATISTIC_OUTPUT logSaturationInfos(totallyPreCompItem); #endif extractCommonDisjunctConceptsFromPrecomputedSaturation(totallyPreCompItem); totallyPreCompItem->getSaturationPrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSSUCESSFULL); } } } } else { totallyPreCompItem->setSaturationStepRunning(false); totallyPreCompItem->getSaturationPrecomputationStep()->setStepFinished(true); totallyPreCompItem->getSaturationPrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); } } else { totallyPreCompItem->getSaturationPrecomputationStep()->submitRequirementsUpdate(); } } if (!workTestCreated && totallyPreCompItem->isCycleStepRequired() && totallyPreCompItem->isConsistenceStepFinished() && !totallyPreCompItem->isSaturationStepRunning()) { if (!totallyPreCompItem->isCycleStepFinished()) { if (totallyPreCompItem->areCycleStepProcessingRequirementSatisfied()) { if (!totallyPreCompItem->hasConceptCyclePrecomputationChecked()) { if (!totallyPreCompItem->hasConceptCyclePrecomputationInitialized()) { CConcreteOntology* ontology = totallyPreCompItem->getOntology(); COntologyCoreConceptCyclesData* coreConceptCycles = ontology->getCoreConceptCyclesData(); bool hasConceptCycles = false; if (coreConceptCycles) { CBOXLIST* coreConceptCycleList = coreConceptCycles->getConceptCycleList(); for (CBOXLIST::const_iterator it = coreConceptCycleList->constBegin(), itEnd = coreConceptCycleList->constEnd(); it != itEnd; ++it) { CConceptCycleData* conCycleData = *it; if (mReuseCompletionGraphCacheWriter) { totallyPreCompItem->addRemainingConceptCyclePrecomputation(conCycleData); hasConceptCycles = true; } } } cint64 conceptCount = totallyPreCompItem->getOntology()->getTBox()->getConceptCount(); cint64 minSizeCount = qMax(conceptCount*0.001,50); totallyPreCompItem->setMinConceptCycleTestSize(minSizeCount); totallyPreCompItem->setConceptCyclePrecomputationInitialized(true); if (!hasConceptCycles) { totallyPreCompItem->setConceptCyclePrecomputationChecked(true); } } if (totallyPreCompItem->hasRemainingConceptCyclePrecomputation()) { CConcreteOntology* ontology = totallyPreCompItem->getOntology(); COntologyCoreConceptCyclesData* coreConceptCycles = ontology->getCoreConceptCyclesData(); QList* remConCycPreTestList = totallyPreCompItem->getRemainingConceptCyclePrecomputationList(); while (!workTestCreated && !remConCycPreTestList->isEmpty()) { CConceptCycleData* conceptCycleData = remConCycPreTestList->takeFirst(); if (conceptCycleData->hasNominalConnection()) { workTestCreated = createConceptCyclePrecomputation(conceptCycleData,totallyPreCompItem); if (workTestCreated) { LOG(INFO,getLogDomain(),logTr("Precompute core concept cycle '%1' of '%2' with '%3' concepts.").arg(conceptCycleData->getCycleID()).arg(coreConceptCycles->getConceptCycleCount()).arg(conceptCycleData->getConceptCount()),this); } } } } if (!workTestCreated) { if (!totallyPreCompItem->hasRemainingConceptCyclePrecomputation() && !totallyPreCompItem->hasCurrentPrecomputationTesting()) { totallyPreCompItem->setConceptCyclePrecomputationChecked(true); } } } if (!workTestCreated) { if (totallyPreCompItem->hasConceptCyclePrecomputationChecked()) { totallyPreCompItem->getCyclePrecomputationStep()->setStepFinished(true); totallyPreCompItem->getCyclePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSSUCESSFULL); } } } else { totallyPreCompItem->getCyclePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); totallyPreCompItem->getCyclePrecomputationStep()->setStepFinished(true); } } else { totallyPreCompItem->getCyclePrecomputationStep()->submitRequirementsUpdate(); } } if (!workTestCreated) { if (!totallyPreCompItem->hasRemainingProcessingRequirements()) { finishOntologyPrecomputation(totallyPreCompItem); mProcessingOntItemList.removeFirst(); } else { mProcessingOntItemList.removeFirst(); mProcessingOntItemList.append(totallyPreCompItem); loopOntPreCompItem = ontPreCompItem; } } } return workTestCreated; } void CTotallyPrecomputationThread::extractCommonDisjunctConceptsFromPrecomputedSaturation(CTotallyOntologyPrecomputationItem* totallyPreCompItem) { LOG(INFO,getLogDomain(),logTr("Extract common disjunct concepts."),this); CSaturationCommonDisjunctConceptsExtractor satCommonDisjConExt; satCommonDisjConExt.extractCommonDisjunctConcepts(totallyPreCompItem->getOntology(),totallyPreCompItem->getSaturationData(),totallyPreCompItem->getSaturatedDisjunctionSet()); } bool CTotallyPrecomputationThread::isAllAssertionIndividualSaturationSufficient(CTotallyOntologyPrecomputationItem* totallyPreCompItem) { if (!totallyPreCompItem->hasAllAssertionIndividualSufficientSaturationChecked()) { CIndividual* allAssertionIndi = totallyPreCompItem->getAllAssertionIndividual(); bool saturationSufficient = false; if (allAssertionIndi) { CSaturationData* saturationData = totallyPreCompItem->getSaturationData(); CSaturationTaskData* satTaskData = (CSaturationTaskData*)saturationData; if (satTaskData) { CSatisfiableCalculationTask* satCalcTask = satTaskData->getSaturationTask(); if (satCalcTask) { CProcessingDataBox* procDataBox = satCalcTask->getProcessingDataBox(); if (procDataBox) { CIndividualSaturationProcessNodeVector* satIndiNodeVec = procDataBox->getIndividualSaturationProcessNodeVector(false); if (satIndiNodeVec) { CIndividualSaturationProcessNode* allAssertionIndiNode = satIndiNodeVec->getData(allAssertionIndi->getIndividualID()); if (allAssertionIndiNode) { CIndividualSaturationProcessNodeStatusFlags* indFlags = allAssertionIndiNode->getIndirectStatusFlags(); CIndividualSaturationProcessNodeStatusFlags* dirFlags = allAssertionIndiNode->getDirectStatusFlags(); if (!indFlags->hasClashedFlag() && indFlags->hasCompletedFlag() && dirFlags->hasCompletedFlag() && !indFlags->hasInsufficientFlag()) { saturationSufficient = true; } } } } } } } if (saturationSufficient) { totallyPreCompItem->setAllAssertionIndividualSaturationSufficient(true); } totallyPreCompItem->setAllAssertionIndividualSufficientSaturationChecked(true); } return totallyPreCompItem->isAllAssertionIndividualSaturationSufficient(); } void CTotallyPrecomputationThread::logSaturationInfos(CTotallyOntologyPrecomputationItem* totallyPreCompItem) { CConcreteOntology* ontology = totallyPreCompItem->getOntology(); CSaturationData* saturationData = totallyPreCompItem->getSaturationData(); CSaturationTaskData* satTaskData = (CSaturationTaskData*)saturationData; if (satTaskData) { CSatisfiableCalculationTask* satCalcTask = satTaskData->getSaturationTask(); if (satCalcTask) { CProcessingDataBox* procDataBox = satCalcTask->getProcessingDataBox(); if (procDataBox) { CIndividualSaturationProcessNodeVector* satIndiNodeVec = procDataBox->getIndividualSaturationProcessNodeVector(false); if (satIndiNodeVec) { cint64 saturatedCount = 0; cint64 insufficientCount = 0; cint64 criticalCount = 0; cint64 clashedCount = 0; cint64 indiCount = satIndiNodeVec->getItemCount(); for (cint64 indiID = 0; indiID < indiCount; ++indiID) { CIndividualSaturationProcessNode* indiNode = satIndiNodeVec->getData(indiID); if (indiNode && indiNode->isCompleted()) { ++saturatedCount; CIndividualSaturationProcessNodeStatusFlags* flags = indiNode->getIndirectStatusFlags(); if (flags->hasClashedFlag()) { ++clashedCount; } if (flags->hasInsufficientFlag()) { ++insufficientCount; } if (flags->hasCriticalFlag()) { ++criticalCount; } } } LOG(INFO,getLogDomain(),logTr("Saturated %1 individual nodes, thereof %2 with clashes, %3 critical and %4 insufficient.").arg(saturatedCount).arg(clashedCount).arg(criticalCount).arg(insufficientCount),this); } } } } } bool CTotallyPrecomputationThread::createConceptCyclePrecomputation(CConceptCycleData* conceptCycleData, CTotallyOntologyPrecomputationItem* totallyPreCompItem) { CConcreteOntology* onto = totallyPreCompItem->getOntology(); CConcept* repCycleClassConcept = conceptCycleData->getRepresentativeCycleClass(); if (repCycleClassConcept) { CSaturationConceptDataItem* conSatItem = totallyPreCompItem->getSaturationConceptDataItem(repCycleClassConcept,false,false); if (conSatItem) { CIndividualSaturationProcessNode* satNode = (CIndividualSaturationProcessNode*)conSatItem->getIndividualProcessNodeForConcept(); if (!satNode->getIndirectStatusFlags()->hasInsufficientFlag()) { return false; } } if (conceptCycleData->getConceptCount() >= totallyPreCompItem->getMinConceptCycleTestSize()) { CConceptCyclePrecomputationTestingItem* conCycPrecTestItem = new CConceptCyclePrecomputationTestingItem(conceptCycleData,totallyPreCompItem); CSatisfiableCalculationJobGenerator satCalcJobGen(onto); CSatisfiableCalculationJob* satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(repCycleClassConcept); CCalculationConfigurationExtension* calcConfig = totallyPreCompItem->getCalculationConfiguration(); satCalcJob->setCalculationConfiguration(calcConfig); satCalcJob->setSatisfiableTaskPreyingAdapter(conCycPrecTestItem->getTaskPreyingAdapter()); processCalculationJob(satCalcJob,totallyPreCompItem,conCycPrecTestItem); return true; } } return false; } bool CTotallyPrecomputationThread::createIndividualPrecomputationCheck(CTotallyOntologyPrecomputationItem* totallyPreCompItem) { CConcreteOntology* onto = totallyPreCompItem->getOntology(); CSatisfiableCalculationJob* satCalcJob = nullptr; if (totallyPreCompItem->hasIndividualsSaturated() && totallyPreCompItem->hasALLIndividualsSaturationOrderd() && totallyPreCompItem->hasInsufficientSaturationIndividuals()) { if (!totallyPreCompItem->hasIndividualPrecomputationChecked()) { QSet* procReqIndiSet = totallyPreCompItem->getIncompletelySaturatedIndividuaSet(); bool allIndiProRequired = false; if (mConfForceFullCompletionGraphConstruction || !totallyPreCompItem->hasIndividualsSaturated()) { allIndiProRequired = true; } if (allIndiProRequired || !procReqIndiSet->isEmpty()) { QList indiList; CIndividualVector* indiVec = onto->getABox()->getIndividualVector(false); if (indiVec) { cint64 indiCount = indiVec->getItemCount(); for (cint64 idx = 0; idx < indiCount; ++idx) { CIndividual* indi = indiVec->getData(idx); if (indi && allIndiProRequired || procReqIndiSet && procReqIndiSet->contains(indi)) { indiList.append(indi); } } } CSatisfiableCalculationJobGenerator satCalcJobGen(onto); satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(indiList); CConsistencePrecomputationTestingItem* consTestItem = new CConsistencePrecomputationTestingItem(totallyPreCompItem,totallyPreCompItem); CCalculationConfigurationExtension* calcConfig = totallyPreCompItem->getCalculationConfiguration(); satCalcJob->setCalculationConfiguration(calcConfig); satCalcJob->setSatisfiableTaskPreyingAdapter(consTestItem->getTaskPreyingAdapter()); processCalculationJob(satCalcJob,totallyPreCompItem,consTestItem); return true; } } } else { totallyPreCompItem->setIndividualPrecomputationChecked(true); } return false; } bool CTotallyPrecomputationThread::createConsistencePrecomputationCheck(CTotallyOntologyPrecomputationItem* totallyPreCompItem) { CConcreteOntology* onto = totallyPreCompItem->getOntology(); CSatisfiableCalculationJob* satCalcJob = nullptr; CIndividualVector* indiVec = onto->getABox()->getIndividualVector(false); cint64 indiCount = 0; if (indiVec) { indiCount = indiVec->getItemCount(); } bool consistencyDetected = false; bool detectedConsistency = true; if (!mConfForceFullCompletionGraphConstruction && isAllAssertionIndividualSaturationSufficient(totallyPreCompItem)) { consistencyDetected = true; detectedConsistency = true; LOG(INFO,getLogDomain(),logTr("Trivial consistency detected with merged individual."),getLogObject()); } else if (totallyPreCompItem->hasClashedSaturationIndividuals()) { consistencyDetected = true; detectedConsistency = false; LOG(INFO,getLogDomain(),logTr("Trivial inconsistency detected with individual saturation."),getLogObject()); } else if (!mConfForceFullCompletionGraphConstruction && totallyPreCompItem->hasIndividualsSaturated() && !totallyPreCompItem->hasInsufficientSaturationIndividuals() && indiCount > 0) { consistencyDetected = true; detectedConsistency = true; LOG(INFO,getLogDomain(),logTr("Trivial consistency detected with individual saturation."),getLogObject()); } else { QList indiList; bool allIndiProRequired = false; if (mConfForceFullCompletionGraphConstruction || !totallyPreCompItem->hasIndividualsSaturated()) { allIndiProRequired = true; } QSet* procReqIndiSet = procReqIndiSet = totallyPreCompItem->getIncompletelySaturatedIndividuaSet(); //QSet procReqIndiSet; //mBackendAssocCache->getIncompletlyAssociationCachedIndividuals(&procReqIndiSet); if (indiVec) { for (cint64 idx = 0; idx < indiCount; ++idx) { CIndividual* indi = indiVec->getData(idx); //if (indi && allIndiProRequired || procReqIndiSet && procReqIndiSet.contains(indi)) { if (indi && allIndiProRequired || procReqIndiSet && procReqIndiSet->contains(indi)) { indiList.append(indi); } } } CSatisfiableCalculationJobGenerator satCalcJobGen(onto); if (indiList.isEmpty()) { CConcept* topConcept = onto->getTBox()->getTopConcept(); if (topConcept->getOperandCount() > 0) { satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(topConcept); } else { consistencyDetected = true; detectedConsistency = true; } } else { satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(indiList); } } CConsistence* consistence = onto->getConsistence(); if (!consistence) { consistence = new CConsistence(); onto->setConsistence(consistence); } if (totallyPreCompItem->hasIndividualsSaturated() && totallyPreCompItem->hasALLIndividualsSaturationOrderd()) { consistence->setIndividualsRepresentativelyStored(true); if (totallyPreCompItem->hasInsufficientSaturationIndividuals()) { consistence->setAllIndividualsRepresentativelyStored(true); } } totallyPreCompItem->setConsistence(consistence); if (consistencyDetected) { consistence->setOntologyConsistent(detectedConsistency); totallyPreCompItem->setConsistenceCheched(true); return false; } else { CConsistencePrecomputationTestingItem* consTestItem = new CConsistencePrecomputationTestingItem(totallyPreCompItem,totallyPreCompItem); CCalculationConfigurationExtension* calcConfig = totallyPreCompItem->getCalculationConfiguration(); satCalcJob->setCalculationConfiguration(calcConfig); satCalcJob->setSatisfiableTaskPreyingAdapter(consTestItem->getTaskPreyingAdapter()); processCalculationJob(satCalcJob,totallyPreCompItem,consTestItem); return true; } } void CTotallyPrecomputationThread::propagateExistInitializationFlag(CSaturationConceptDataItem* ontConSatDataItem) { if (ontConSatDataItem->isPotentiallyExistInitializationConcept()) { CSaturationConceptDataItem* parentOntConceptSatTestItem = ontConSatDataItem->getSpecialItemReference(); while (parentOntConceptSatTestItem && !parentOntConceptSatTestItem->isPotentiallyExistInitializationConcept()) { parentOntConceptSatTestItem->setPotentiallyExistInitializationConcept(true); parentOntConceptSatTestItem = parentOntConceptSatTestItem->getSpecialItemReference(); } } } void CTotallyPrecomputationThread::propagateSubsumerItemFlag(CSaturationConceptDataItem* ontClassSatTestItem) { if (ontClassSatTestItem->hasIndirectSuccessorsItems()) { CSaturationConceptDataItem* subsumerItem = ontClassSatTestItem->getSpecialItemReference(); while (subsumerItem && !subsumerItem->hasIndirectSuccessorsItems()) { subsumerItem->setIndirectSuccessorsItems(true); subsumerItem = subsumerItem->getSpecialItemReference(); } } } void CTotallyPrecomputationThread::analyseConceptSaturationSubsumerExistItems(CTotallyOntologyPrecomputationItem* totallyPreCompItem, QList& processList) { QSet processSet; for (QList::const_iterator it = processList.constBegin(), itEnd = processList.constEnd(); it != itEnd; ++it) { CConceptNegationSaturationItem conNegSatItem(*it); processSet.insert(conNegSatItem); } while (!processList.isEmpty()) { CConceptNegationSaturationItem conNegSatItem(processList.takeLast()); CConcept* concept = conNegSatItem.getConcept(); bool negated = conNegSatItem.getNegation(); CSaturationConceptDataItem* ontConSatDataItem = conNegSatItem.getSaturationConceptDataItem(); cint64 nOpCode = concept->getOperatorCode(); cint64 opCount = concept->getOperandCount(); if (!negated && (nOpCode == CCAND || nOpCode == CCSUB || nOpCode == CCEQ || ((nOpCode == CCOR) && opCount == 1)) || negated && (nOpCode == CCOR || ((nOpCode == CCAND || nOpCode == CCEQ) && opCount == 1))) { CSortedNegLinker* opConIt = concept->getOperandList(); while (opConIt) { CConcept* opConcept = opConIt->getData(); bool opNegation = opConIt->isNegated()^negated; cint64 opConOpCode = opConcept->getOperatorCode(); if (!opNegation && (opConOpCode == CCEQ || opConOpCode == CCSUB || opConOpCode == CCATOM && opConcept->hasClassName())) { CSaturationConceptDataItem* subsumerClassTestItem = totallyPreCompItem->getSaturationConceptDataItem(opConcept,opNegation,false); subsumerClassTestItem->setIndirectSuccessorsItems(true); if (!ontConSatDataItem->getSpecialItemReference() && !ontConSatDataItem->isInvalidSpecialItemReference()) { ontConSatDataItem->setSpecialItemReference(subsumerClassTestItem); } else { ontConSatDataItem->setMultipleDirectPredecessorsItems(true); } } else if (!opNegation && opConOpCode == CCAND || opNegation && opConOpCode == CCOR) { if (opConcept->getOperandCount() > 1) { ontConSatDataItem->setMultipleDirectPredecessorsItems(true); } if (!processSet.contains(CConceptNegationSaturationItem(opConcept,opNegation,ontConSatDataItem))) { processSet.insert(CConceptNegationSaturationItem(opConcept,opNegation,ontConSatDataItem)); processList.append(CConceptNegationSaturationItem(opConcept,opNegation,ontConSatDataItem)); } } else if ((!opNegation && (opConOpCode == CCSOME || opConOpCode == CCAQSOME)) || opNegation && opConOpCode == CCALL) { CRole* role = opConcept->getRole(); CConcept* existConcept = opConcept->getOperandList()->getData(); bool existConNegation = opConcept->getOperandList()->isNegated()^opNegation; CSaturationConceptDataItem* existConceptTestItem = nullptr; if (hasRoleRanges(totallyPreCompItem,role)) { existConceptTestItem = totallyPreCompItem->getSaturationRoleSuccessorConceptDataItem(role,existConcept,existConNegation,false); } else { existConceptTestItem = totallyPreCompItem->getSaturationConceptDataItem(existConcept,existConNegation,false); } ontConSatDataItem->addExistReferenceConceptItemList(existConceptTestItem); ontConSatDataItem->setMultipleDirectPredecessorsItems(true); } else if (negated && opConOpCode == CCATMOST || !negated && opConOpCode == CCATLEAST) { CRole* role = opConcept->getRole(); CConcept* existConcept = totallyPreCompItem->getOntology()->getTBox()->getTopConcept(); bool existConceptNegation = false; if (opConcept->getOperandList()) { existConcept = opConcept->getOperandList()->getData(); existConceptNegation = opConcept->getOperandList()->isNegated(); } CSaturationConceptDataItem* existConceptTestItem = nullptr; if (hasRoleRanges(totallyPreCompItem,role)) { existConceptTestItem = totallyPreCompItem->getSaturationRoleSuccessorConceptDataItem(role,existConcept,existConceptNegation,false); } else { existConceptTestItem = totallyPreCompItem->getSaturationConceptDataItem(existConcept,existConceptNegation,false); } ontConSatDataItem->addExistReferenceConceptItemList(existConceptTestItem); ontConSatDataItem->setMultipleDirectPredecessorsItems(true); } else if (opConOpCode == CCAQCHOOCE) { CSortedNegLinker* opOpConIt = opConcept->getOperandList(); while (opOpConIt) { if (opNegation == opOpConIt->isNegated()) { CConcept* opOpConcept = opOpConIt->getData(); if (opOpConcept->getOperatorCode() == CCAQSOME) { CConcept* existConcept = opOpConcept->getOperandList()->getData(); bool existConNegation = opOpConcept->getOperandList()->isNegated(); CRole* role = opOpConcept->getRole(); CSaturationConceptDataItem* existConceptTestItem = nullptr; if (hasRoleRanges(totallyPreCompItem,role)) { existConceptTestItem = totallyPreCompItem->getSaturationRoleSuccessorConceptDataItem(role,existConcept,existConNegation,false); } else { existConceptTestItem = totallyPreCompItem->getSaturationConceptDataItem(existConcept,existConNegation,false); } ontConSatDataItem->addExistReferenceConceptItemList(existConceptTestItem); ontConSatDataItem->setMultipleDirectPredecessorsItems(true); } else if (opOpConcept->getOperatorCode() == CCAQAND) { if (opConcept->getOperandCount() > 1) { ontConSatDataItem->setMultipleDirectPredecessorsItems(true); } if (!processSet.contains(CConceptNegationSaturationItem(opOpConcept,false,ontConSatDataItem))) { processSet.insert(CConceptNegationSaturationItem(opOpConcept,false,ontConSatDataItem)); processList.append(CConceptNegationSaturationItem(opOpConcept,false,ontConSatDataItem)); } } } opOpConIt = opOpConIt->getNext(); } } else { ontConSatDataItem->setMultipleDirectPredecessorsItems(true); } opConIt = opConIt->getNext(); } } } } void CTotallyPrecomputationThread::extendDisjunctionsCandidateAlternativesItems(CTotallyOntologyPrecomputationItem* totallyPreCompItem, CSaturationConceptDataItem* ontConSatDataItem, QList* newDisjunctionCandidateAlternativeList) { CConcept* concept = ontConSatDataItem->getSaturationConcept(); bool negation = ontConSatDataItem->getSaturationNegation(); QList conNegPairList; bool directExamine = true; bool candidateAlternativeExtraction = false; if (!negation && concept->hasClassName()) { if (concept->getOperatorCode() == CCEQ) { //CBOXHASH* eqConHash = totallyPreCompItem->getOntology()->getTBox()->getEquivalentConceptCandidateHash(false); //if (eqConHash->contains(concept)) { candidateAlternativeExtraction = true; //} } for (CSortedNegLinker* opConIt = concept->getOperandList(); opConIt; opConIt = opConIt->getNext()) { CConcept* opConcept = opConIt->getData(); bool opNegation = opConIt->isNegated()^negation; conNegPairList.append(TConceptNegPair(opConcept,opNegation)); directExamine = false; } } if (directExamine) { conNegPairList.append(TConceptNegPair(concept,negation)); } while (!conNegPairList.isEmpty()) { TConceptNegPair nextConNegPair(conNegPairList.takeFirst()); CConcept* nextConcept = nextConNegPair.first; bool nextNegation = nextConNegPair.second; cint64 nOpCode = nextConcept->getOperatorCode(); cint64 opCount = nextConcept->getOperandCount(); if (!nextNegation && (nOpCode == CCAND || (nOpCode == CCOR && opCount == 1)) || nextNegation && (nOpCode == CCOR || ((nOpCode == CCAND) && opCount == 1))) { for (CSortedNegLinker* opConIt = nextConcept->getOperandList(); opConIt; opConIt = opConIt->getNext()) { CConcept* opConcept = opConIt->getData(); bool opNegation = opConIt->isNegated()^nextNegation; conNegPairList.append(TConceptNegPair(opConcept,opNegation)); } } else if (nOpCode == CCAQCHOOCE) { for (CSortedNegLinker* opConIt = nextConcept->getOperandList(); opConIt; opConIt = opConIt->getNext()) { CConcept* opConcept = opConIt->getData(); bool opNegation = opConIt->isNegated(); if (nextNegation == opNegation) { conNegPairList.append(TConceptNegPair(opConcept,opNegation)); } if (candidateAlternativeExtraction && nextNegation != opNegation) { conNegPairList.append(TConceptNegPair(opConcept,!opNegation)); } } } else if (nextNegation && ((nOpCode == CCAND || nOpCode == CCEQ) && opCount > 1) || !nextNegation && nOpCode == CCOR) { // saturate all disjuncts to extract common concepts from all disjunctions totallyPreCompItem->addSaturatedDisjunction(nextConcept); for (CSortedNegLinker* opConIt = nextConcept->getOperandList(); opConIt; opConIt = opConIt->getNext()) { CConcept* opConcept = opConIt->getData(); bool opNegation = opConIt->isNegated()^nextNegation; CConceptProcessData* conProcData = (CConceptProcessData*)opConcept->getConceptData(); CConceptSaturationReferenceLinkingData* conRefSatLinking = (CConceptSaturationReferenceLinkingData*)conProcData->getConceptReferenceLinking(); if (!conRefSatLinking) { conRefSatLinking = new CConceptSaturationReferenceLinkingData(); conProcData->setConceptReferenceLinking(conRefSatLinking); } if (conRefSatLinking->getConceptSaturationReferenceLinkingData(opNegation) == nullptr) { CSaturationConceptDataItem* conItem = totallyPreCompItem->getSaturationConceptDataItem(opConcept,opNegation,true); conRefSatLinking->setSaturationReferenceLinkingData(conItem,opNegation); newDisjunctionCandidateAlternativeList->append(conItem); if (!opConcept->hasClassName() || opNegation) { conItem->setInvalidSpecialItemReference(true); } } } CConceptProcessData* conProcData = (CConceptProcessData*)nextConcept->getConceptData(); CConceptSaturationReferenceLinkingData* conRefSatLinking = (CConceptSaturationReferenceLinkingData*)conProcData->getConceptReferenceLinking(); if (!conRefSatLinking) { conRefSatLinking = new CConceptSaturationReferenceLinkingData(); conProcData->setConceptReferenceLinking(conRefSatLinking); } if (conRefSatLinking->getConceptSaturationReferenceLinkingData(nextNegation) == nullptr) { CSaturationConceptDataItem* conItem = totallyPreCompItem->getSaturationConceptDataItem(nextConcept,nextNegation,true); conRefSatLinking->setSaturationReferenceLinkingData(conItem,nextNegation); newDisjunctionCandidateAlternativeList->append(conItem); conItem->setInvalidSpecialItemReference(true); } } else if (!nextNegation && (nOpCode == CCALL) || nextNegation && (nOpCode == CCSOME || nOpCode == CCAQSOME)) { if (candidateAlternativeExtraction) { // saturate pseudo models to invalidate candidates concepts bool saturateNegation = !nextNegation; CConceptProcessData* conProcData = (CConceptProcessData*)nextConcept->getConceptData(); CConceptSaturationReferenceLinkingData* conRefSatLinking = (CConceptSaturationReferenceLinkingData*)conProcData->getConceptReferenceLinking(); if (!conRefSatLinking) { conRefSatLinking = new CConceptSaturationReferenceLinkingData(); conProcData->setConceptReferenceLinking(conRefSatLinking); } if (conRefSatLinking->getConceptSaturationReferenceLinkingData(saturateNegation) == nullptr) { CSaturationConceptDataItem* conItem = totallyPreCompItem->getSaturationConceptDataItem(nextConcept,saturateNegation,true); conRefSatLinking->setSaturationReferenceLinkingData(conItem,saturateNegation); newDisjunctionCandidateAlternativeList->append(conItem); conItem->setInvalidSpecialItemReference(true); } } } } } bool CTotallyPrecomputationThread::saturateRemainingRequiredItems(CTotallyOntologyPrecomputationItem* totallyPreCompItem) { cint64 saturatingConceptCount = 0; bool allConSaturReq = totallyPreCompItem->requiresAllConceptsSaturation(); QList* reqConSatList = totallyPreCompItem->getRemainingRequiredSaturationConceptList(); if (allConSaturReq) { totallyPreCompItem->setAllConceptsSaturationOrdered(true); QList* satOrderdItemList = totallyPreCompItem->getSaturationOrderedItemList(); for (QList::const_iterator it = satOrderdItemList->constBegin(), itEnd = satOrderdItemList->constEnd(); it != itEnd; ++it) { CSaturationConceptDataItem* satConItem(*it); if (!satConItem->isItemProcessingMarked()) { ++saturatingConceptCount; satConItem->setItemProcessingMarked(true); } } } else { for (QList::const_iterator it = reqConSatList->constBegin(), itEnd = reqConSatList->constEnd(); it != itEnd; ++it) { const TConceptNegPair& conNegPair(*it); CConcept* concept(conNegPair.first); bool negation(conNegPair.second); saturatingConceptCount += markSaturationProcessingItems(totallyPreCompItem,nullptr,concept,negation); } } reqConSatList->clear(); if (saturatingConceptCount > 0 || totallyPreCompItem->requiresNominalDelayedConceptsSaturationUpdate() && !totallyPreCompItem->hasNominalDelayedConceptsSaturationUpdated()) { totallyPreCompItem->setNominalDelayedConceptsSaturationUpdateRequired(false); totallyPreCompItem->setNominalDelayedConceptsSaturationUpdated(true); createMarkedConceptSaturationProcessingJob(totallyPreCompItem,true); return true; } return false; } bool CTotallyPrecomputationThread::addConsistencyRequiredSaturationIndividuals(CTotallyOntologyPrecomputationItem* totallyPreCompItem) { CIndividualVector* indiVec = totallyPreCompItem->getOntology()->getABox()->getIndividualVector(false); bool individualsAdded = false; bool saturateConcepts = CConfigDataReader::readConfigBoolean(totallyPreCompItem->getCalculationConfiguration(),"Konclude.Calculation.Optimization.ConceptSaturation",true); bool individualSaturation = CConfigDataReader::readConfigBoolean(totallyPreCompItem->getCalculationConfiguration(),"Konclude.Calculation.Optimization.IndividualSaturation",false); if (saturateConcepts && individualSaturation) { if (indiVec) { QSet assConNegPairSet; cint64 indiCount = indiVec->getItemCount(); for (cint64 indiId = 0; indiId < indiCount; ++indiId) { CIndividual* indi = indiVec->getData(indiId); if (indi) { totallyPreCompItem->addConsistencyRequiredSaturationIndividual(indi); individualsAdded = true; } } } totallyPreCompItem->setIndividualsSaturated(true); } else { totallyPreCompItem->setIndividualsSaturated(false); } return individualsAdded; } bool CTotallyPrecomputationThread::addIdentifiedRemainingConsistencyRequiredConcepts(CTotallyOntologyPrecomputationItem* totallyPreCompItem) { bool constConReqSatAdded = false; bool saturateConcepts = CConfigDataReader::readConfigBoolean(totallyPreCompItem->getCalculationConfiguration(),"Konclude.Calculation.Optimization.ConceptSaturation",true); if (saturateConcepts) { CConcept* topConcept = totallyPreCompItem->getOntology()->getTBox()->getTopConcept(); if (topConcept->getOperandList() != nullptr) { totallyPreCompItem->addConsistencyRequiredSaturationConcept(topConcept,false); constConReqSatAdded = true; } CIndividualVector* indiVec = totallyPreCompItem->getOntology()->getABox()->getIndividualVector(false); if (indiVec) { QSet assConNegPairSet; QSet assRoleSet; cint64 indiCount = indiVec->getItemCount(); for (cint64 indiId = 0; indiId < indiCount; ++indiId) { CIndividual* indi = indiVec->getData(indiId); if (indi) { for (CConceptAssertionLinker* conAssLinkIt = indi->getAssertionConceptLinker(); conAssLinkIt; conAssLinkIt = conAssLinkIt->getNext()) { CConcept* assCon = conAssLinkIt->getData(); bool assConNeg = conAssLinkIt->isNegated(); if (assCon->getOperatorCode() == CCNOMINAL) { if (assCon->getNominalIndividual() != indi || assConNeg && assCon->getNominalIndividual() == indi) { assConNegPairSet.insert(TConceptNegPair(assCon,assConNeg)); } } else { assConNegPairSet.insert(TConceptNegPair(assCon,assConNeg)); } } for (CRoleAssertionLinker* roleAssLinkIt = indi->getAssertionRoleLinker(); roleAssLinkIt; roleAssLinkIt = roleAssLinkIt->getNext()) { CRole* role = roleAssLinkIt->getRole(); assRoleSet.insert(role); } } } CIndividual* tmpAllAssertionIndi = new CIndividual(); tmpAllAssertionIndi->initIndividual(indiVec->getItemCount()); for (QSet::const_iterator it = assConNegPairSet.constBegin(), itEnd = assConNegPairSet.constEnd(); it != itEnd; ++it) { constConReqSatAdded = true; TConceptNegPair assConNegPair(*it); totallyPreCompItem->addConsistencyRequiredSaturationConcept(assConNegPair.first,assConNegPair.second); CConceptAssertionLinker* tmpConAssLinker = new CConceptAssertionLinker(); tmpConAssLinker->initNegLinker(assConNegPair.first,assConNegPair.second); tmpAllAssertionIndi->addAssertionConceptLinker(tmpConAssLinker); } for (QSet::const_iterator it = assRoleSet.constBegin(), itEnd = assRoleSet.constEnd(); it != itEnd; ++it) { CRole* role(*it); CRoleAssertionLinker* tmpRoleAssLinker = new CRoleAssertionLinker(); tmpRoleAssLinker->initRoleAssertionLinker(role,tmpAllAssertionIndi); tmpAllAssertionIndi->addAssertionRoleLinker(tmpRoleAssLinker); } totallyPreCompItem->setAllAssertionIndividual(tmpAllAssertionIndi); } } return constConReqSatAdded; } bool CTotallyPrecomputationThread::saturateRemainingConsistencyRequiredConcepts(CTotallyOntologyPrecomputationItem* totallyPreCompItem) { cint64 saturatingConceptCount = 0; QList* reqConSatList = totallyPreCompItem->getRemainingConsistencyRequiredSaturationConceptList(); for (QList::const_iterator it = reqConSatList->constBegin(), itEnd = reqConSatList->constEnd(); it != itEnd; ++it) { const TConceptNegPair& conNegPair(*it); CConcept* concept(conNegPair.first); bool negation(conNegPair.second); saturatingConceptCount += markSaturationProcessingItems(totallyPreCompItem,nullptr,concept,negation); } reqConSatList->clear(); if (saturatingConceptCount > 0) { createMarkedConceptSaturationProcessingJob(totallyPreCompItem,false); return true; } return false; } bool CTotallyPrecomputationThread::saturateRemainingConsistencyRequiredIndividuals(CTotallyOntologyPrecomputationItem* totallyPreCompItem) { cint64 saturatingIndividualCount = 0; QList indiSatList; QList* reqIndiSatList = totallyPreCompItem->getRemainingConsistencyRequiredSaturationIndividuals(); while (!reqIndiSatList->isEmpty() && saturatingIndividualCount < mIndividualSaturationCount) { CIndividual* individual = reqIndiSatList->takeFirst(); indiSatList.append(individual); ++saturatingIndividualCount; } if (!totallyPreCompItem->hasRemainingConsistencyRequiredSaturationIndividuals()) { totallyPreCompItem->setALLIndividualsSaturationOrderd(true); } if (saturatingIndividualCount > 0) { createIndividualSaturationProcessingJob(totallyPreCompItem,indiSatList); return true; } return false; } cint64 CTotallyPrecomputationThread::markSaturationProcessingItems(CTotallyOntologyPrecomputationItem* totallyPreCompItem, CSaturationConceptDataItem* startMarkingItem, CConcept* startMarkingConcept, bool startMarkingConceptNegation) { cint64 markedConcepts = 0; QList itemList; QList conNegPairList; if (startMarkingItem && !startMarkingItem->isItemProcessingMarked()) { ++markedConcepts; startMarkingItem->setItemProcessingMarked(true); itemList.append(startMarkingItem); } if (startMarkingConcept) { CSaturationConceptDataItem* opMarkingItem = totallyPreCompItem->getSaturationConceptDataItem(startMarkingConcept,startMarkingConceptNegation,false); if (opMarkingItem) { if (!opMarkingItem->isItemProcessingMarked()) { ++markedConcepts; opMarkingItem->setItemProcessingMarked(true); itemList.append(opMarkingItem); } } else { conNegPairList.append(TConceptNegPair(startMarkingConcept,startMarkingConceptNegation)); } } while (!itemList.isEmpty() || !conNegPairList.isEmpty()) { while (!itemList.isEmpty()) { CSaturationConceptDataItem* item = itemList.takeFirst(); CConcept* nextConcept = item->getSaturationConcept(); bool nextNegation = item->getSaturationNegation(); conNegPairList.append(TConceptNegPair(nextConcept,nextNegation)); QList* existRefItemList = item->getExistReferenceConceptItemList(); for (QList::const_iterator it2 = existRefItemList->constBegin(), it2End = existRefItemList->constEnd(); it2 != it2End; ++it2) { CSaturationConceptDataItem* existRefItem = *it2; if (!existRefItem->isItemProcessingMarked()) { ++markedConcepts; existRefItem->setItemProcessingMarked(true); itemList.append(existRefItem); } } } while (!conNegPairList.isEmpty()) { TConceptNegPair nextConNegPair(conNegPairList.takeFirst()); CConcept* nextConcept = nextConNegPair.first; bool nextNegation = nextConNegPair.second; cint64 nOpCode = nextConcept->getOperatorCode(); cint64 opCount = nextConcept->getOperandCount(); if (!nextNegation && (nOpCode == CCAND || nOpCode == CCSUB || nOpCode == CCIMPLTRIG || nOpCode == CCEQ || (nOpCode == CCOR && opCount == 1) || nOpCode == CCAQSOME || nOpCode == CCSOME || nOpCode == CCATLEAST) || nextNegation && (nOpCode == CCOR || ((nOpCode == CCAND || nOpCode == CCEQ) && opCount == 1) || nOpCode == CCALL || nOpCode == CCATMOST)) { for (CSortedNegLinker* opConIt = nextConcept->getOperandList(); opConIt; opConIt = opConIt->getNext()) { CConcept* opConcept = opConIt->getData(); bool influenceNegation = true; if (nOpCode == CCAQSOME || nOpCode == CCATLEAST || nOpCode == CCATMOST) { influenceNegation = false; } bool opNegation = opConIt->isNegated(); if (influenceNegation && nextNegation) { opNegation = !opNegation; } bool opConceptMarked = false; if (nOpCode != CCAQCHOOCE || !opNegation) { CSaturationConceptDataItem* opMarkingItem = totallyPreCompItem->getSaturationConceptDataItem(opConcept,opNegation,false); CSaturationConceptDataItem* roleOpMarkingItem = nullptr; if (nextConcept->getRole()) { CRole* role = nextConcept->getRole(); roleOpMarkingItem = totallyPreCompItem->getSaturationRoleSuccessorConceptDataItem(role,opConcept,opNegation,false); } if (opMarkingItem || roleOpMarkingItem) { if (opMarkingItem && !opMarkingItem->isItemProcessingMarked()) { ++markedConcepts; opMarkingItem->setItemProcessingMarked(true); itemList.append(opMarkingItem); } if (roleOpMarkingItem && !roleOpMarkingItem->isItemProcessingMarked()) { ++markedConcepts; roleOpMarkingItem->setItemProcessingMarked(true); itemList.append(roleOpMarkingItem); } } else { conNegPairList.append(TConceptNegPair(opConcept,opNegation)); } } } } else if (nOpCode == CCAQCHOOCE) { for (CSortedNegLinker* opConIt = nextConcept->getOperandList(); opConIt; opConIt = opConIt->getNext()) { CConcept* opConcept = opConIt->getData(); if (opConIt->isNegated() == nextNegation) { CSaturationConceptDataItem* opMarkingItem = totallyPreCompItem->getSaturationConceptDataItem(opConcept,false,false); if (opMarkingItem) { if (!opMarkingItem->isItemProcessingMarked()) { ++markedConcepts; opMarkingItem->setItemProcessingMarked(true); itemList.append(opMarkingItem); } } else { conNegPairList.append(TConceptNegPair(opConcept,false)); } } } } } } return markedConcepts; } void CTotallyPrecomputationThread::orderItemsSaturationTesting(CTotallyOntologyPrecomputationItem* totallyPreCompItem, CSaturationConceptDataItem* ontConSatDataItem, QList& orderedItemList, QStack& saturationItemStack) { if (!ontConSatDataItem->isOrderingQueued()) { saturationItemStack.push(CSaturationSaturationListItem(ontConSatDataItem)); while (!saturationItemStack.isEmpty()) { CSaturationSaturationListItem& topSatSatListItem = saturationItemStack.top(); CSaturationConceptDataItem* topOntConSatDataItem = topSatSatListItem.mSaturationItem; QList& markOderingSubsumerList = topSatSatListItem.mSaturationItemList; if (!topOntConSatDataItem->isOrderingQueued()) { if (!topSatSatListItem.mSubsumerOrdered) { topSatSatListItem.mSubsumerOrdered = true; // first mark all subsumer items CSaturationConceptDataItem* subsumerItem = topOntConSatDataItem; while (subsumerItem && !subsumerItem->isOrderingQueued()) { subsumerItem->setOrderingQueued(true); markOderingSubsumerList.prepend(subsumerItem); subsumerItem = subsumerItem->getSpecialItemReference(); } } } if (topSatSatListItem.mLastSubsumerSaturationItem) { orderedItemList.append(topSatSatListItem.mLastSubsumerSaturationItem); topSatSatListItem.mLastSubsumerSaturationItem = nullptr; } if (!markOderingSubsumerList.isEmpty()) { CSaturationConceptDataItem* subsumerItem = markOderingSubsumerList.takeFirst(); topSatSatListItem.mLastSubsumerSaturationItem = subsumerItem; QList* existRefItemList = subsumerItem->getExistReferenceConceptItemList(); for (QList::const_iterator it2 = existRefItemList->constBegin(), it2End = existRefItemList->constEnd(); it2 != it2End; ++it2) { CSaturationConceptDataItem* existRefItem = *it2; saturationItemStack.push(CSaturationSaturationListItem(existRefItem)); } //QListIterator it2(*existRefItemList); //it2.toBack(); //while (it2.hasPrevious()) { // CSaturationConceptDataItem* existRefItem = it2.previous(); // saturationItemStack.push(CSaturationSaturationListItem(existRefItem)); //} } else { saturationItemStack.pop(); } } } //if (!ontConSatDataItem->isOrderingQueued()) { // // first mark all subsumer items // QList markOderingSubsumerList; // CSaturationConceptDataItem* subsumerItem = ontConSatDataItem; // while (subsumerItem && !subsumerItem->isOrderingQueued()) { // subsumerItem->setOrderingQueued(true); // markOderingSubsumerList.prepend(subsumerItem); // subsumerItem = subsumerItem->getSpecialItemReference(); // } // for (QList::const_iterator it1 = markOderingSubsumerList.constBegin(), it1End = markOderingSubsumerList.constEnd(); it1 != it1End; ++it1) { // CSaturationConceptDataItem* subsumerItem = *it1; // QList* existRefItemList = subsumerItem->getExistReferenceConceptItemList(); // for (QList::const_iterator it2 = existRefItemList->constBegin(), it2End = existRefItemList->constEnd(); it2 != it2End; ++it2) { // CSaturationConceptDataItem* existRefItem = *it2; // orderItemsSaturationTesting(totallyPreCompItem,existRefItem,orderedItemList); // } // orderedItemList.append(subsumerItem); // } //} } bool CTotallyPrecomputationThread::hasRoleRanges(CTotallyOntologyPrecomputationItem* totallyPreCompItem, CRole* role) { for (CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { CRole* superRole = superRoleIt->getData(); bool superRoleNegation = superRoleIt->isNegated(); CSortedNegLinker* rangeConceptLinker = superRole->getDomainRangeConceptList(!superRoleNegation); if (rangeConceptLinker) { return true; } } return false; } void CTotallyPrecomputationThread::createMarkedConceptSaturationProcessingJob(CTotallyOntologyPrecomputationItem* totallyPreCompItem, bool allowAllSaturation) { CApproximatedSaturationCalculationJob* satCalculationJob = nullptr; CConcreteOntology *onto = totallyPreCompItem->getOntology(); CApproximatedSaturationCalculationJobGenerator satCalculationJobGenerator(onto); satCalculationJob = satCalculationJobGenerator.getApproximatedSaturationCalculationJob(0,totallyPreCompItem->getSaturationData()); bool imiadelyProcessAllConcepts = totallyPreCompItem->requiresAllConceptsSaturation(); if (!allowAllSaturation) { imiadelyProcessAllConcepts = false; } cint64 saturationConceptCount = 0; QList* orderedItemList = totallyPreCompItem->getSaturationOrderedItemList(); for (QList::const_iterator it = orderedItemList->constBegin(), itEnd = orderedItemList->constEnd(); it != itEnd; ++it) { CSaturationConceptDataItem* conItem = *it; CConcept* concept = conItem->getSaturationConcept(); bool negation = conItem->getSaturationNegation(); CRole* role = conItem->getSaturationRoleRanges(); if (conItem->isItemProcessingMarked() && !conItem->isItemProcessingQueued() || imiadelyProcessAllConcepts) { conItem->setItemProcessingQueued(true); satCalculationJob = satCalculationJobGenerator.extendApproximatedSaturationCalculationJobProcessing(conItem,satCalculationJob); saturationConceptCount++; } } if (!totallyPreCompItem->isAllAssertionIndividualSaturated()) { CIndividual* allAssertionIndi = totallyPreCompItem->getAllAssertionIndividual(); if (allAssertionIndi) { satCalculationJob = satCalculationJobGenerator.extendApproximatedSaturationCalculationJobProcessing(allAssertionIndi,nullptr,satCalculationJob); } totallyPreCompItem->setAllAssertionIndividualSaturated(true); } LOG(INFO,getLogDomain(),logTr("Scheduled %1 concepts for saturation for ontology '%2'.").arg(saturationConceptCount).arg(totallyPreCompItem->getOntology()->getTerminologyName()),this); CSaturationPrecomputationTestingItem* satTestingItem = new CSaturationPrecomputationTestingItem(totallyPreCompItem,CPrecomputationTestingItem::CONCEPTSATURATIONPRECOMPUTATIONTYPE); CCalculationConfigurationExtension* calcConfig = totallyPreCompItem->getCalculationConfiguration(); satCalculationJob->setCalculationConfiguration(calcConfig); satCalculationJob->setSaturationTaskPreyingAdapter(new CTaskPreyingAdapter((CSaturationObserver*)totallyPreCompItem)); totallyPreCompItem->setSaturationCalculationJob(satCalculationJob); processCalculationJob(satCalculationJob,totallyPreCompItem,satTestingItem); } void CTotallyPrecomputationThread::createIndividualSaturationProcessingJob(CTotallyOntologyPrecomputationItem* totallyPreCompItem, const QList& individualList) { CApproximatedSaturationCalculationJob* satCalculationJob = nullptr; CConcreteOntology *onto = totallyPreCompItem->getOntology(); CApproximatedSaturationCalculationJobGenerator satCalculationJobGenerator(onto); satCalculationJob = satCalculationJobGenerator.getApproximatedSaturationCalculationJob(0,totallyPreCompItem->getSaturationData()); satCalculationJob->setSeparateSaturation(true); cint64 nextSaturationID = totallyPreCompItem->getNextSaturationID(); CSaturationIndividualDataItem* satIndiDataItemLinker = nullptr; cint64 saturationIndividualCount = 0; for (QList::const_iterator it = individualList.constBegin(), itEnd = individualList.constEnd(); it != itEnd; ++it) { CIndividual* individual = *it; CSaturationIndividualDataItem* satIndiDataItem = totallyPreCompItem->takeFreeSaturationIndividualDataItem(); satIndiDataItem->initConceptSaturationTestingItem(individual,nextSaturationID); satIndiDataItemLinker = satIndiDataItem->append(satIndiDataItemLinker); CIndividualProcessData* indiProcessData = (CIndividualProcessData*)individual->getIndividualData(); if (indiProcessData) { indiProcessData->setSaturationReferenceLinkingData(satIndiDataItem); } satCalculationJob = satCalculationJobGenerator.extendApproximatedSaturationCalculationJobProcessing(individual,satIndiDataItem,satCalculationJob); ++saturationIndividualCount; } totallyPreCompItem->setSaturationIDIndividualDataItems(nextSaturationID,satIndiDataItemLinker); LOG(INFO,getLogDomain(),logTr("Scheduled %1 individuals for saturation for ontology '%2'.").arg(saturationIndividualCount).arg(totallyPreCompItem->getOntology()->getTerminologyName()),this); CSaturationPrecomputationTestingItem* satTestingItem = new CSaturationPrecomputationTestingItem(totallyPreCompItem,CPrecomputationTestingItem::INDIVIDUALSATURATIONPRECOMPUTATIONTYPE,nextSaturationID); CCalculationConfigurationExtension* calcConfig = totallyPreCompItem->getCalculationConfiguration(); satCalculationJob->setCalculationConfiguration(calcConfig); satCalculationJob->setSaturationIndividualsAnalysationObserver(new CSaturationIndividualsAnalysingAdapter((CSaturationIndividualAnalysationObserver*)totallyPreCompItem)); totallyPreCompItem->setSaturationCalculationJob(satCalculationJob); processCalculationJob(satCalculationJob,totallyPreCompItem,satTestingItem); } void CTotallyPrecomputationThread::createSaturationConstructionJob(CTotallyOntologyPrecomputationItem* totallyPreCompItem) { CTBox* tBox = totallyPreCompItem->getOntology()->getDataBoxes()->getTBox(); CConcreteOntology *onto = totallyPreCompItem->getOntology(); CConcept* topConcept = onto->getDataBoxes()->getTopConcept(); CConcept* bottomConcept = onto->getDataBoxes()->getBottomConcept(); CConcept* topDataRangeConcept = tBox->getTopDataRangeConcept(); CConceptVector* conVec = tBox->getConceptVector(); LOG(INFO,getLogDomain(),logTr("Determine concepts for saturation for ontology '%1'.").arg(totallyPreCompItem->getOntology()->getTerminologyName()),this); CApproximatedSaturationCalculationJob* satCalculationJob = nullptr; CApproximatedSaturationCalculationJobGenerator satCalculationJobGenerator(onto); bool saturateConcepts = CConfigDataReader::readConfigBoolean(totallyPreCompItem->getCalculationConfiguration(),"Konclude.Calculation.Optimization.ConceptSaturation",true); cint64 statExistsConceptCount = 0; cint64 statClassCount = 0; QList existConList; QList analyseExistSubsumerList; QList allConItemList; QList disjunctionCandidateAlternativeList; cint64 conCount = conVec->getItemCount(); if (saturateConcepts) { for (cint64 conIdx = 1; conIdx < conCount; ++conIdx) { CConcept* concept = conVec->getData(conIdx); //if (CIRIName::getRecentIRIName(concept->getClassNameLinker()) == "file:F:/Projects/OIL/DAMLOilEd/ontologies/ka.daml#Publication") { // bool bug = true; //} if (concept) { cint64 opCode = concept->getOperatorCode(); if (opCode == CCSOME || opCode == CCALL || opCode == CCAQSOME || opCode == CCATLEAST || opCode == CCATMOST) { ++statExistsConceptCount; bool negation = opCode == CCALL; CRole* role = concept->getRole(); CSortedNegLinker* opLinker = concept->getOperandList(); CConcept* opConcept = nullptr; bool opNegation = false; if (opLinker) { opConcept = opLinker->getData(); if (opCode == CCATLEAST || opCode == CCATMOST) { opNegation = opLinker->isNegated(); } else { opNegation = opLinker->isNegated()^negation; } } else { opConcept = topConcept; if (opCode == CCATLEAST || opCode == CCATMOST) { opNegation = false; } else { opNegation = negation; } } if (hasRoleRanges(totallyPreCompItem,role)) { CSaturationConceptDataItem* conItem = nullptr; conItem = totallyPreCompItem->getSaturationRoleSuccessorConceptDataItem(role,opConcept,opNegation,true); conItem->setPotentiallyExistInitializationConcept(true); existConList.append(conItem); if (role->isDataRole()) { conItem->setDataRangeConcept(true); } CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); CConceptSaturationReferenceLinkingData* conRefSatLinking = (CConceptSaturationReferenceLinkingData*)conProcData->getConceptReferenceLinking(); if (!conRefSatLinking) { conRefSatLinking = new CConceptSaturationReferenceLinkingData(); conProcData->setConceptReferenceLinking(conRefSatLinking); } if (conRefSatLinking->getExistentialSuccessorConceptSaturationReferenceLinkingData() == nullptr) { conRefSatLinking->setExistentialSuccessorConceptSaturationReferenceLinkingData(conItem); allConItemList.append(conItem); } } else { CSaturationConceptDataItem* conItem = nullptr; conItem = totallyPreCompItem->getSaturationConceptDataItem(opConcept,opNegation,true); conItem->setPotentiallyExistInitializationConcept(true); existConList.append(conItem); if (role->isDataRole()) { conItem->setDataRangeConcept(true); } CConceptProcessData* opConProcData = (CConceptProcessData*)opConcept->getConceptData(); CConceptSaturationReferenceLinkingData* opConRefSatLinking = (CConceptSaturationReferenceLinkingData*)opConProcData->getConceptReferenceLinking(); if (!opConRefSatLinking) { opConRefSatLinking = new CConceptSaturationReferenceLinkingData(); opConProcData->setConceptReferenceLinking(opConRefSatLinking); } if (opConRefSatLinking->getConceptSaturationReferenceLinkingData(opNegation) == nullptr) { opConRefSatLinking->setSaturationReferenceLinkingData(conItem,opNegation); allConItemList.append(conItem); } } } else if (concept->hasClassName() || concept == topDataRangeConcept) { ++statClassCount; CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); CConceptSaturationReferenceLinkingData* conRefSatLinking = (CConceptSaturationReferenceLinkingData*)conProcData->getConceptReferenceLinking(); if (!conRefSatLinking) { conRefSatLinking = new CConceptSaturationReferenceLinkingData(); conProcData->setConceptReferenceLinking(conRefSatLinking); } if (conRefSatLinking->getConceptSaturationReferenceLinkingData(false) == nullptr) { CSaturationConceptDataItem* conItem = totallyPreCompItem->getSaturationConceptDataItem(concept,false,true); conRefSatLinking->setSaturationReferenceLinkingData(conItem,false); allConItemList.append(conItem); } } } } } disjunctionCandidateAlternativeList = allConItemList; while (!disjunctionCandidateAlternativeList.isEmpty()) { CSaturationConceptDataItem* conTestItem = disjunctionCandidateAlternativeList.takeFirst(); QList tempNewItems; extendDisjunctionsCandidateAlternativesItems(totallyPreCompItem,conTestItem,&tempNewItems); if (!tempNewItems.isEmpty()) { disjunctionCandidateAlternativeList.append(tempNewItems); allConItemList.append(tempNewItems); } } analyseExistSubsumerList = allConItemList; QList processList; // identify all items, which aren't subsumers of other items for (QList::const_iterator it = analyseExistSubsumerList.constBegin(), itEnd = analyseExistSubsumerList.constEnd(); it != itEnd; ++it) { CSaturationConceptDataItem* conTestItem = *it; CConcept* concept = conTestItem->getSaturationConcept(); bool conceptNegation = conTestItem->getSaturationNegation(); processList.append(CConceptNegationSaturationItem(concept,conceptNegation,conTestItem)); } analyseConceptSaturationSubsumerExistItems(totallyPreCompItem,processList); // find all potentially subsumer items for (QList::const_iterator it = analyseExistSubsumerList.constBegin(), itEnd = analyseExistSubsumerList.constEnd(); it != itEnd; ++it) { CSaturationConceptDataItem* conTestItem = *it; propagateSubsumerItemFlag(conTestItem); } // find all potentially role successors, for which back propagation is necessary for (QList::const_iterator it = existConList.constBegin(), itEnd = existConList.constEnd(); it != itEnd; ++it) { CSaturationConceptDataItem* conTestItem = *it; propagateExistInitializationFlag(conTestItem); } QList leafConList; QList leafExistConList; // collect all leaf nodes for (QList::const_iterator it = allConItemList.constBegin(), itEnd = allConItemList.constEnd(); it != itEnd; ++it) { CSaturationConceptDataItem* conTestItem = *it; if (!conTestItem->hasIndirectSuccessorsItems()) { if (!conTestItem->isPotentiallyExistInitializationConcept()) { leafConList.append(conTestItem); } else { leafExistConList.append(conTestItem); } } } QList* orderedItemList = totallyPreCompItem->getSaturationOrderedItemList(); QStack saturationItemStack; // order all concepts associated to the items for efficient Saturation testing, start with the real leaf items for (QList::const_iterator it = leafConList.constBegin(), itEnd = leafConList.constEnd(); it != itEnd; ++it) { CSaturationConceptDataItem* conTestItem = *it; if (!conTestItem->isOrderingQueued()) { orderItemsSaturationTesting(totallyPreCompItem,conTestItem,*orderedItemList,saturationItemStack); } } for (QList::const_iterator it = leafExistConList.constBegin(), itEnd = leafExistConList.constEnd(); it != itEnd; ++it) { CSaturationConceptDataItem* conTestItem = *it; if (!conTestItem->isOrderingQueued()) { orderItemsSaturationTesting(totallyPreCompItem,conTestItem,*orderedItemList,saturationItemStack); } } for (QList::const_iterator it = allConItemList.constBegin(), itEnd = allConItemList.constEnd(); it != itEnd; ++it) { CSaturationConceptDataItem* conTestItem = *it; if (!conTestItem->isOrderingQueued()) { orderItemsSaturationTesting(totallyPreCompItem,conTestItem,*orderedItemList,saturationItemStack); } } // set reference mode for saturation: substitute or copy QListIterator reverseOrderedIt(*orderedItemList); reverseOrderedIt.toBack(); CBOXHASH* triggerImpHash = totallyPreCompItem->getOntology()->getTBox()->getTriggerImplicationHash(false); while (reverseOrderedIt.hasPrevious()) { CSaturationConceptDataItem* conTestItem = reverseOrderedIt.previous(); CSaturationConceptDataItem* referencedTestItem = conTestItem->getSpecialItemReference(); if (referencedTestItem) { if (!conTestItem->isPotentiallyExistInitializationConcept() && !conTestItem->hasMultipleDirectPredecessorsItems() && (!triggerImpHash || !triggerImpHash->contains(conTestItem->getSaturationConcept()))) { conTestItem->setSpecialItemReferenceMode(CSaturationConceptDataItem::SATURATIONSUBSTITUTEMODE); } else { conTestItem->setSpecialItemReferenceMode(CSaturationConceptDataItem::SATURATIONCOPYMODE); } } } satCalculationJob = satCalculationJobGenerator.getApproximatedSaturationCalculationJob(0); cint64 mSaturationConceptCount = 0; for (QList::const_iterator it = orderedItemList->constBegin(), itEnd = orderedItemList->constEnd(); it != itEnd; ++it) { CSaturationConceptDataItem* conItem = *it; CConcept* concept = conItem->getSaturationConcept(); bool negation = conItem->getSaturationNegation(); CRole* role = conItem->getSaturationRoleRanges(); conItem->setItemProcessingQueued(false); satCalculationJob = satCalculationJobGenerator.extendApproximatedSaturationCalculationJobConstruction(role,concept,negation,false,conItem,satCalculationJob); mSaturationConceptCount++; } LOG(INFO,getLogDomain(),logTr("Preparing saturation of %1 concepts for ontology '%2'.").arg(mSaturationConceptCount).arg(totallyPreCompItem->getOntology()->getTerminologyName()),this); CSaturationPrecomputationTestingItem* satTestingItem = new CSaturationPrecomputationTestingItem(totallyPreCompItem,CPrecomputationTestingItem::CONCEPTSATURATIONPRECOMPUTATIONTYPE); CCalculationConfigurationExtension* calcConfig = totallyPreCompItem->getCalculationConfiguration(); satCalculationJob->setCalculationConfiguration(calcConfig); satCalculationJob->setSaturationTaskPreyingAdapter(new CTaskPreyingAdapter((CSaturationObserver*)totallyPreCompItem)); totallyPreCompItem->setSaturationCalculationJob(satCalculationJob); processCalculationJob(satCalculationJob,totallyPreCompItem,satTestingItem); } bool CTotallyPrecomputationThread::precomputationTested(COntologyPrecomputationItem* ontPreCompItem, CPrecomputationTestingItem* preTestItem, CSaturationPrecomputationCalculatedCallbackEvent* pcce) { CTotallyOntologyPrecomputationItem* totallyPreCompItem = (CTotallyOntologyPrecomputationItem*)ontPreCompItem; if (preTestItem->getPrecomputationTestingType() == CPrecomputationTestingItem::CONCEPTSATURATIONPRECOMPUTATIONTYPE) { CSaturationPrecomputationTestingItem* satPreTestItem = (CSaturationPrecomputationTestingItem*)preTestItem; totallyPreCompItem->setConceptSaturationPrecomputationChecked(true); CPrecomputation* precomputation = totallyPreCompItem->getPrecomputation(); CSaturationData* saturationData = totallyPreCompItem->getSaturationData(); precomputation->setSaturationModelData(saturationData); totallyPreCompItem->setSaturationComputationRunning(false); CSaturationTaskData* satTaskData = (CSaturationTaskData*)saturationData; if (satTaskData) { CSatisfiableCalculationTask* satCalcTask = satTaskData->getSaturationTask(); if (satCalcTask) { CProcessingDataBox* procDataBox = satCalcTask->getProcessingDataBox(); if (procDataBox) { totallyPreCompItem->setNominalDelayedConceptsSaturationUpdateRequired(procDataBox->isDelayedNominalProcessingOccured()); } } } return true; } else if (preTestItem->getPrecomputationTestingType() == CPrecomputationTestingItem::INDIVIDUALSATURATIONPRECOMPUTATIONTYPE) { CSaturationPrecomputationTestingItem* satPreTestItem = (CSaturationPrecomputationTestingItem*)preTestItem; cint64 saturationID = satPreTestItem->getSaturationID(); totallyPreCompItem->releaseSaturationIDIndividualDataItems(saturationID); totallyPreCompItem->decIndividualSaturationRunningCount(); if (!totallyPreCompItem->hasIndividualSaturationRunning()) { totallyPreCompItem->setSaturationComputationRunning(false); if (totallyPreCompItem->hasIndividualsSaturated() && totallyPreCompItem->hasALLIndividualsSaturationOrderd()) { if (!totallyPreCompItem->hasIndividualsSaturationCacheSynchronisation()) { totallyPreCompItem->setIndividualsSaturationCacheSynchronisation(true); QSet* procReqIndiSet = totallyPreCompItem->getIncompletelySaturatedIndividuaSet(); mBackendAssocCache->getIncompletlyAssociationCachedIndividuals(procReqIndiSet); LOG(INFO,getLogDomain(),logTr("Individual saturation insufficient for %1 individuals.").arg(procReqIndiSet->size()),getLogObject()); } CConsistence* consistence = totallyPreCompItem->getConsistence(); if (consistence) { consistence->setIndividualsRepresentativelyStored(true); if (totallyPreCompItem->hasInsufficientSaturationIndividuals()) { consistence->setAllIndividualsRepresentativelyStored(true); } } } } return true; } return false; } bool CTotallyPrecomputationThread::precomputationTested(COntologyPrecomputationItem* ontPreCompItem, CPrecomputationTestingItem* preTestItem, CPrecomputationCalculatedCallbackEvent* pcce) { CTotallyOntologyPrecomputationItem* totallyPreCompItem = (CTotallyOntologyPrecomputationItem*)ontPreCompItem; if (preTestItem->getPrecomputationTestingType() == CPrecomputationTestingItem::CONSISTENCEPRECOMPUTATIONTYPE) { CConsistencePrecomputationTestingItem* consPreTestItem = (CConsistencePrecomputationTestingItem*)preTestItem; totallyPreCompItem->setIndividualStepRunning(false); totallyPreCompItem->setIndividualPrecomputationChecked(true); totallyPreCompItem->setConsistenceCheched(true); if (pcce->hasCalculationError()) { LOG(ERROR,getLogDomain(),logTr("Error in computation, consistence testing for ontology '%1' failed.").arg(ontPreCompItem->getOntology()->getTerminologyName()),getLogObject()); totallyPreCompItem->getConsistencePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED); totallyPreCompItem->getIndividualPrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED); } else { CConsistence* consistence = totallyPreCompItem->getConsistence(); consistence->setConsistenceModelData(totallyPreCompItem->getConsistenceData()); consistence->setOntologyConsistent(pcce->getTestResultSatisfiable()); } return true; } else if (preTestItem->getPrecomputationTestingType() == CPrecomputationTestingItem::CONCEPTCYCLEPRECOMPUTATIONTYPE) { CConceptCyclePrecomputationTestingItem* conCyclePreTestItem = (CConceptCyclePrecomputationTestingItem*)preTestItem; CConceptCycleData* conCycleData = conCyclePreTestItem->getConceptCycleData(); CBOXSET* classCycleSet = conCycleData->getCycleClassSet(); if (pcce->hasCalculationError()) { LOG(ERROR,getLogDomain(),logTr("Error in computation, cyclic concept graph caching for ontology '%1' failed.").arg(ontPreCompItem->getOntology()->getTerminologyName()),getLogObject()); totallyPreCompItem->setConsistenceCheched(true); totallyPreCompItem->getCyclePrecomputationStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED); } else { if (pcce->getTestResultSatisfiable()) { // insert into cache CTempMemoryPoolContainerAllocationManager tmpMemMan(mContext.getMemoryPoolProvider()); CContextBase* tmpContext = CObjectParameterizingAllocator< CContextBase,CMemoryAllocationManager* >::allocateAndConstructAndParameterize(&tmpMemMan,&tmpMemMan); CCACHINGLIST* cacheValueList = CObjectParameterizingAllocator< CCACHINGLIST,CContext* >::allocateAndConstructAndParameterize(&tmpMemMan,tmpContext); for (CBOXSET::const_iterator it = classCycleSet->constBegin(), itEnd = classCycleSet->constEnd(); it != itEnd; ++it) { CConcept* classConcept(*it); CCacheValue cacheValue(classConcept->getConceptTag(),(cint64)classConcept,CCacheValue::CACHEVALTAGANDCONCEPT); cacheValueList->append(cacheValue); } CReuseCompletionGraphCacheEntryExpandWriteData* writeData = CObjectAllocator::allocateAndConstruct(&tmpMemMan); writeData->initExpandWriteData(cacheValueList,cacheValueList,conCyclePreTestItem->getJobInstantiation()); mReuseCompletionGraphCacheWriter->writeExpandCache(writeData,tmpMemMan.takeMemoryPools()); } } if (!totallyPreCompItem->hasRemainingConceptCyclePrecomputation() && !totallyPreCompItem->hasCurrentPrecomputationTesting()) { totallyPreCompItem->setConceptCyclePrecomputationChecked(true); } } return false; } bool CTotallyPrecomputationThread::finishOntologyPrecomputation(CTotallyOntologyPrecomputationItem* totallyPreCompItem) { if (totallyPreCompItem->areAllStepFinished()) { totallyPreCompItem->setPrecomputationFinished(true); CConcreteOntology* ontology = totallyPreCompItem->getOntology(); CPrecomputation* precomputation = ontology->getPrecomputation(); precomputation->setPrecomputed(true); } totallyPreCompItem->doPrecomputationFinishedCallback(true); mActiveOntItemSet.remove(totallyPreCompItem); mInactiveOntItemSet.insert(totallyPreCompItem); return true; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationObserver.cpp0000644000175000017500000000214012520550772027017 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationObserver.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CSaturationObserver::CSaturationObserver() { } CSaturationObserver::~CSaturationObserver() { } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CConceptCyclePrecomputationTestingItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CConceptCyclePrecomputationTestingItem.cp0000644000175000017500000000444112520550766032471 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptCyclePrecomputationTestingItem.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CConceptCyclePrecomputationTestingItem::CConceptCyclePrecomputationTestingItem(CConceptCycleData* conceptCycleData, COntologyPrecomputationItem* preCompItem) : CPrecomputationTestingItem(preCompItem),mTaskPreyingAdapter(this) { mConceptCycleData = conceptCycleData; } CPrecomputationTestingItem::PRECOMPUTATIONTYPE CConceptCyclePrecomputationTestingItem::getPrecomputationTestingType() { return CONCEPTCYCLEPRECOMPUTATIONTYPE; } CTaskPreyingAdapter* CConceptCyclePrecomputationTestingItem::getTaskPreyingAdapter() { return &mTaskPreyingAdapter; } CTaskPreyingListner* CConceptCyclePrecomputationTestingItem::tellPreyedSatisfialbeTask(CSatisfiableCalculationTask* task) { if (mSatCalcTaskPointer.testAndSetOrdered(nullptr,task)) { CSatisfiableCalculationTask* taskIt = task; while (taskIt) { taskIt->getTaskStatus()->setMemoryReleaseable(false); taskIt = (CSatisfiableCalculationTask*)taskIt->getParentTask(); } } return this; } CConceptCycleData* CConceptCyclePrecomputationTestingItem::getConceptCycleData() { return mConceptCycleData; } CSatisfiableCalculationJobInstantiation* CConceptCyclePrecomputationTestingItem::getJobInstantiation() { return mSatCalcTaskPointer.fetchAndAddRelaxed(0); } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CConsistencePrecomputationTestingItem.h0000644000175000017500000000433612520550766032223 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CCONSISTENCEPRECOMPUTATIONTESTINGITEM_H #define KONCLUDE_REASONER_CONSISTISER_CCONSISTENCEPRECOMPUTATIONTESTINGITEM_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" #include "CPrecomputationTestingItem.h" // Other includes #include "Reasoner/Kernel/Task/CTaskPreyingAdapter.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; namespace Consistiser { /*! * * \class CConsistencePrecomputationTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConsistencePrecomputationTestingItem : public CPrecomputationTestingItem { // public methods public: //! Constructor CConsistencePrecomputationTestingItem(CConsistenceObserver* observer, COntologyPrecomputationItem* preCompItem); virtual PRECOMPUTATIONTYPE getPrecomputationTestingType(); CTaskPreyingAdapter* getTaskPreyingAdapter(); // protected methods protected: // protected variables protected: CTaskPreyingAdapter mTaskPreyingAdapter; CConsistenceObserver* mObserver; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CCONSISTENCEPRECOMPUTATIONTESTINGITEM_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationIndividualAnalysationObserver.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationIndividualAnalysationObserver.0000644000175000017500000000231112520550772032530 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationIndividualAnalysationObserver.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CSaturationIndividualAnalysationObserver::CSaturationIndividualAnalysationObserver() { } CSaturationIndividualAnalysationObserver::~CSaturationIndividualAnalysationObserver() { } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CConsistiser.h0000644000175000017500000000352112520550766025137 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CCONSISTISER_H #define KONCLUDE_REASONER_CONSISTISER_CCONSISTISER_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Ontology; namespace Consistiser { /*! * * \class CConsistiser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConsistiser { // public methods public: //! Constructor CConsistiser(); //! Destructor virtual ~CConsistiser(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CCONSISTISER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CPrecomputator.cpp0000644000175000017500000000203112520550772026021 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecomputator.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CPrecomputator::CPrecomputator() { } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIndividualDependenceTrackingMarker.cpp0000644000175000017500000000213012520550770032043 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualDependenceTrackingMarker.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CIndividualDependenceTrackingMarker::CIndividualDependenceTrackingMarker() { } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationConceptDataItem.cpp0000644000175000017500000001140712520550772030242 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationConceptDataItem.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CSaturationConceptDataItem::CSaturationConceptDataItem() { } CSaturationConceptDataItem* CSaturationConceptDataItem::initConceptSaturationTestingItem(CConcept* satTestConcept, bool negated, CRole* role) { mConceptSat = satTestConcept; mNegation = negated; mConRefLinking = nullptr; mSpecialItemReference = nullptr; mSpecialReferenceMode = NONESATURATIONMODE; mOrderingQueued = false; mSucessorsItems = false; mMultiplePredItems = false; mRoleRanges = role; mInvalidSpecialItemReference = false; mProcessingQueued = false; mProcessingMarked = false; return this; } CConcept* CSaturationConceptDataItem::getSaturationConcept() { return mConceptSat; } CRole* CSaturationConceptDataItem::getSaturationRoleRanges() { return mRoleRanges; } bool CSaturationConceptDataItem::getSaturationNegation() { return mNegation; } CConceptReferenceLinking* CSaturationConceptDataItem::getConceptReferenceLinking() { return mConRefLinking; } CSaturationConceptDataItem* CSaturationConceptDataItem::setConceptReferenceLinking(CConceptReferenceLinking* refLinking) { mConRefLinking = refLinking; return this; } CSaturationConceptDataItem* CSaturationConceptDataItem::getSpecialItemReference() { return mSpecialItemReference; } CSaturationConceptDataItem* CSaturationConceptDataItem::setSpecialItemReference(CSaturationConceptDataItem* reference) { mSpecialItemReference = reference; return this; } CSaturationConceptDataItem::SATURATIONITEMREFERENCESPECIALMODE CSaturationConceptDataItem::getSpecialReferenceMode() { return mSpecialReferenceMode; } CSaturationConceptDataItem* CSaturationConceptDataItem::setSpecialItemReferenceMode(CSaturationConceptDataItem::SATURATIONITEMREFERENCESPECIALMODE mode) { mSpecialReferenceMode = mode; return this; } bool CSaturationConceptDataItem::isOrderingQueued() { return mOrderingQueued; } CSaturationConceptDataItem* CSaturationConceptDataItem::setOrderingQueued(bool queued) { mOrderingQueued = queued; return this; } bool CSaturationConceptDataItem::hasIndirectSuccessorsItems() { return mSucessorsItems; } CSaturationConceptDataItem* CSaturationConceptDataItem::setIndirectSuccessorsItems(bool hasSuccessors) { mSucessorsItems = hasSuccessors; return this; } QList* CSaturationConceptDataItem::getExistReferenceConceptItemList() { return &mExistReferenceItemList; } CSaturationConceptDataItem* CSaturationConceptDataItem::addExistReferenceConceptItemList(CSaturationConceptDataItem* existItem) { mExistReferenceItemList.append(existItem); return this; } bool CSaturationConceptDataItem::hasMultipleDirectPredecessorsItems() { return mMultiplePredItems; } CSaturationConceptDataItem* CSaturationConceptDataItem::setMultipleDirectPredecessorsItems(bool multiblePredItems) { mMultiplePredItems = multiblePredItems; return this; } bool CSaturationConceptDataItem::isInvalidSpecialItemReference() { return mInvalidSpecialItemReference; } CSaturationConceptDataItem* CSaturationConceptDataItem::setInvalidSpecialItemReference(bool invalid) { mInvalidSpecialItemReference = invalid; return this; } bool CSaturationConceptDataItem::isItemProcessingQueued() { return mProcessingQueued; } CSaturationConceptDataItem* CSaturationConceptDataItem::setItemProcessingQueued(bool queued) { mProcessingQueued = queued; return this; } bool CSaturationConceptDataItem::isItemProcessingMarked() { return mProcessingMarked; } CSaturationConceptDataItem* CSaturationConceptDataItem::setItemProcessingMarked(bool marked) { mProcessingMarked = marked; return this; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CDirectBlockedProcessingConsistiser.h0000644000175000017500000000510612520550766031614 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CDIRECTBLOCKEDPROCESSINGCONSISTISER_H #define KONCLUDE_REASONER_CONSISTISER_CDIRECTBLOCKEDPROCESSINGCONSISTISER_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" #include "CConsistiser.h" #include "CConsistenceObserver.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Generator/CSatisfiableCalculationJobGenerator.h" #include "Control/Command/CConfigManagerReader.h" #include "Reasoner/Kernel/Task/CTaskPreyingAdapter.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Control::Command; namespace Reasoner { using namespace Ontology; using namespace Generator; using namespace Kernel::Task; namespace Consistiser { /*! * * \class CDirectBlockedProcessingConsistiser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDirectBlockedProcessingConsistiser : public CConsistiser, public CConsistenceObserver { // public methods public: //! Constructor CDirectBlockedProcessingConsistiser(); //! Destructor virtual ~CDirectBlockedProcessingConsistiser(); virtual bool determineConsistency(CConcreteOntology* onto, CConfiguration *config); virtual CConsistenceObserver* tellConsistenceData(CConsistenceData* consData); // protected methods protected: // protected variables protected: CConsistence* mConsistence; CTaskPreyingAdapter mConsAdapter; QMutex mSynMutex; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CDIRECTBLOCKEDPROCESSINGCONSISTISER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIndividualDependenceTrackingCollector.h0000644000175000017500000000457112520550770032230 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CINDIVIDUALDEPENDENCETRACKINGCOLLECTOR_H #define KONCLUDE_REASONER_CONSISTISER_CINDIVIDUALDEPENDENCETRACKINGCOLLECTOR_H // Libraries includes #include // Namespace includes #include "ConsistiserSettings.h" #include "CIndividualDependenceTrackingObserver.h" // Other includes #include "Reasoner/Ontology/CIndividualDependenceTracking.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Consistiser { /*! * * \class CIndividualDependenceTrackingCollector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualDependenceTrackingCollector : public CIndividualDependenceTrackingObserver { // public methods public: //! Constructor CIndividualDependenceTrackingCollector(); //! Destructor virtual ~CIndividualDependenceTrackingCollector(); virtual CIndividualDependenceTracking* getExtendingIndividualDependenceTracking(); virtual CIndividualDependenceTracking* installIndividualDependenceTracking(CIndividualDependenceTracking* indDepTrack); // protected methods protected: // protected variables protected: QAtomicPointer mIndiDepTrackingPointer; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CINDIVIDUALDEPENDENCETRACKINGCOLLECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CPrecomputationContext.h0000644000175000017500000000472212520550770027207 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATIONCONTEXT_H #define KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATIONCONTEXT_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes #include "Context/CContext.h" #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" #include "Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Consistiser { /*! * * \class CPrecomputationContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPrecomputationContext : public CContext { // public methods public: //! Constructor CPrecomputationContext(); virtual ~CPrecomputationContext(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); virtual CMemoryPoolAllocationManager* getMemoryPoolAllocationManager(); virtual CMemoryPoolProvider* getMemoryPoolProvider(); // protected methods protected: // protected variables protected: CMemoryPoolAllocationManager* mMemMan; CMemoryPoolProvider* mMemoryPoolProvider; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATIONCONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIncrementalPrecomputationThread.h0000644000175000017500000001057512520550766031164 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CINCREMENTALPRECOMPUTATIONTHREAD_H #define KONCLUDE_REASONER_CONSISTISER_CINCREMENTALPRECOMPUTATIONTHREAD_H // Libraries includes #include #include // Namespace includes #include "ConsistiserSettings.h" #include "CPrecomputationThread.h" #include "CPrecomputationTestingItem.h" #include "CIncrementalConsistencePrecomputationTestingItem.h" #include "CIncrementalOntologyPrecomputationItem.h" // Other includes #include "Reasoner/Kernel/Manager/CReasonerManager.h" #include "Reasoner/Kernel/Cache/CReuseCompletionGraphCacheWriter.h" #include "Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryExpandWriteData.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCache.h" #include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h" #include "Reasoner/Kernel/Task/CIncrementalConsistenceTaskData.h" #include "Reasoner/Generator/CSatisfiableCalculationJobGenerator.h" #include "Utilities/Memory/CTempMemoryPoolContainerAllocationManager.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { using namespace Kernel::Task; using namespace Kernel::Manager; using namespace Kernel::Cache; using namespace Generator; namespace Consistiser { using namespace Events; /*! * * \class CIncrementalPrecomputationThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIncrementalPrecomputationThread : public CPrecomputationThread, public CLogIdentifier { // public methods public: //! Constructor CIncrementalPrecomputationThread(CReasonerManager* reasonerManager); //! Destructor virtual ~CIncrementalPrecomputationThread(); // protected methods protected: virtual COntologyPrecomputationItem* initializeOntologyPrecomputionItem(CConcreteOntology* ontology, CConfigurationBase* config); virtual bool createNextTest(); virtual bool finishOntologyPrecomputation(CIncrementalOntologyPrecomputationItem* incPreCompItem); virtual bool precomputationTested(COntologyPrecomputationItem* ontPreCompItem, CPrecomputationTestingItem* preTestItem, CPrecomputationCalculatedCallbackEvent* pcce); virtual bool precomputationTested(COntologyPrecomputationItem* ontPreCompItem, CPrecomputationTestingItem* preTestItem, CSaturationPrecomputationCalculatedCallbackEvent* pcce); bool createIndividualPrecomputationCheck(CIncrementalOntologyPrecomputationItem* incPreCompItem); bool createConsistencePrecomputationCheck(CIncrementalOntologyPrecomputationItem* incPreCompItem); CConcreteOntology* getLastConsistentlyTestedOntologyVersion(CIncrementalOntologyPrecomputationItem* incPreCompItem); QSet* getDirectlyChangedIndividuals(CConcreteOntology* lastOntologyVersion, CIncrementalOntologyPrecomputationItem* incPreCompItem); QSet* getDirectlyChangedIndividualsFromLastConsistentlyTestedOntology(CIncrementalOntologyPrecomputationItem* incPreCompItem); bool logIncrementalReasoningInfos(CIncrementalOntologyPrecomputationItem* incPreCompItem); // protected variables protected: CReuseCompletionGraphCacheWriter* mReuseCompletionGraphCacheWriter; CBackendRepresentativeMemoryCache* mBackendAssocCache; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CINCREMENTALPRECOMPUTATIONTHREAD_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIncrementalConsistencePrecomputationTestingItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIncrementalConsistencePrecomputationTest0000644000175000017500000000477012520550766032644 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CINCREMENTALCONSISTENCEPRECOMPUTATIONTESTINGITEM_H #define KONCLUDE_REASONER_CONSISTISER_CINCREMENTALCONSISTENCEPRECOMPUTATIONTESTINGITEM_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" #include "CPrecomputationTestingItem.h" #include "COntologyPrecomputationItem.h" // Other includes #include "Reasoner/Kernel/Task/CSatisfiableTaskIncrementalConsistencyTestingAdapter.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; namespace Consistiser { /*! * * \class CIncrementalConsistencePrecomputationTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIncrementalConsistencePrecomputationTestingItem : public CPrecomputationTestingItem { // public methods public: //! Constructor CIncrementalConsistencePrecomputationTestingItem(CConsistenceObserver* observer, CConcreteOntology* lastConsOntology, cint64 incRevID, COntologyPrecomputationItem* preCompItem); virtual PRECOMPUTATIONTYPE getPrecomputationTestingType(); CSatisfiableTaskIncrementalConsistencyTestingAdapter* getIncrementalConsistencyTestingAdapter(); // protected methods protected: // protected variables protected: CSatisfiableTaskIncrementalConsistencyTestingAdapter mTaskIncConsTestAdapter; CConsistenceObserver* mObserver; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CIncrementalConsistencePrecomputationTestingItem_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CTotallyPrecomputationThread.h0000644000175000017500000001736212520550774030353 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CTOTALLYPRECOMPUTATIONTHREAD_H #define KONCLUDE_REASONER_CONSISTISER_CTOTALLYPRECOMPUTATIONTHREAD_H // Libraries includes #include #include // Namespace includes #include "ConsistiserSettings.h" #include "CPrecomputationThread.h" #include "CPrecomputationTestingItem.h" #include "CConsistencePrecomputationTestingItem.h" #include "CConceptCyclePrecomputationTestingItem.h" #include "CSaturationPrecomputationTestingItem.h" #include "CTotallyOntologyPrecomputationItem.h" #include "CSaturationCommonDisjunctConceptsExtractor.h" // Other includes #include "Reasoner/Kernel/Manager/CReasonerManager.h" #include "Reasoner/Kernel/Cache/CReuseCompletionGraphCacheWriter.h" #include "Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryExpandWriteData.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCache.h" #include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h" #include "Reasoner/Generator/CSatisfiableCalculationJobGenerator.h" #include "Reasoner/Generator/CApproximatedSaturationCalculationJobGenerator.h" #include "Utilities/Memory/CTempMemoryPoolContainerAllocationManager.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { using namespace Kernel::Task; using namespace Kernel::Manager; using namespace Kernel::Cache; using namespace Generator; namespace Consistiser { using namespace Events; class CConceptNegationSaturationItem : public QPair > { public: CConceptNegationSaturationItem(CConcept* concept, bool negation, CSaturationConceptDataItem* ontConSatDataItem) : QPair >(ontConSatDataItem,QPair(concept,negation)) { } CSaturationConceptDataItem* getSaturationConceptDataItem() { return first; } CConcept* getConcept() { return second.first; } bool getNegation() { return second.second; } }; class CSaturationSaturationListItem { public: CSaturationSaturationListItem() { mSubsumerOrdered = false; mLastSubsumerSaturationItem = nullptr; mSaturationItem = nullptr; } CSaturationSaturationListItem(CSaturationConceptDataItem* saturationItem) : mSaturationItem(saturationItem) { mSubsumerOrdered = false; mLastSubsumerSaturationItem = nullptr; } CSaturationConceptDataItem* mSaturationItem; CSaturationConceptDataItem* mLastSubsumerSaturationItem; QList mSaturationItemList; bool mSubsumerOrdered; }; /*! * * \class CTotallyPrecomputationThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTotallyPrecomputationThread : public CPrecomputationThread, public CLogIdentifier { // public methods public: //! Constructor CTotallyPrecomputationThread(CReasonerManager* reasonerManager); //! Destructor virtual ~CTotallyPrecomputationThread(); // protected methods protected: virtual COntologyPrecomputationItem* initializeOntologyPrecomputionItem(CConcreteOntology* ontology, CConfigurationBase* config); virtual bool createNextTest(); virtual bool finishOntologyPrecomputation(CTotallyOntologyPrecomputationItem* totallyPreCompItem); virtual bool precomputationTested(COntologyPrecomputationItem* ontPreCompItem, CPrecomputationTestingItem* preTestItem, CPrecomputationCalculatedCallbackEvent* pcce); virtual bool precomputationTested(COntologyPrecomputationItem* ontPreCompItem, CPrecomputationTestingItem* preTestItem, CSaturationPrecomputationCalculatedCallbackEvent* pcce); bool createIndividualPrecomputationCheck(CTotallyOntologyPrecomputationItem* totallyPreCompItem); bool createConsistencePrecomputationCheck(CTotallyOntologyPrecomputationItem* totallyPreCompItem); bool createConceptCyclePrecomputation(CConceptCycleData* conceptCycleData, CTotallyOntologyPrecomputationItem* totallyPreCompItem); void createSaturationConstructionJob(CTotallyOntologyPrecomputationItem* totallyPreCompItem); bool hasRoleRanges(CTotallyOntologyPrecomputationItem* totallyPreCompItem, CRole* role); void orderItemsSaturationTesting(CTotallyOntologyPrecomputationItem* totallyPreCompItem, CSaturationConceptDataItem* ontConSatDataItem, QList& orderedItemList, QStack& saturationItemStack); void analyseConceptSaturationSubsumerExistItems(CTotallyOntologyPrecomputationItem* totallyPreCompItem, QList& processList); void propagateSubsumerItemFlag(CSaturationConceptDataItem* ontClassSatTestItem); void propagateExistInitializationFlag(CSaturationConceptDataItem* ontConSatDataItem); void extendDisjunctionsCandidateAlternativesItems(CTotallyOntologyPrecomputationItem* totallyPreCompItem, CSaturationConceptDataItem* ontConSatDataItem, QList* newDisjunctionCandidateAlternativeList); bool isAllAssertionIndividualSaturationSufficient(CTotallyOntologyPrecomputationItem* totallyPreCompItem); void createMarkedConceptSaturationProcessingJob(CTotallyOntologyPrecomputationItem* totallyPreCompItem, bool allowAllSaturation); void createIndividualSaturationProcessingJob(CTotallyOntologyPrecomputationItem* totallyPreCompItem, const QList& individualList); bool saturateRemainingRequiredItems(CTotallyOntologyPrecomputationItem* totallyPreCompItem); cint64 markSaturationProcessingItems(CTotallyOntologyPrecomputationItem* totallyPreCompItem, CSaturationConceptDataItem* startMarkingItem, CConcept* startMarkingConcept, bool startMarkingConceptNegation); bool saturateRemainingConsistencyRequiredConcepts(CTotallyOntologyPrecomputationItem* totallyPreCompItem); bool saturateRemainingConsistencyRequiredIndividuals(CTotallyOntologyPrecomputationItem* totallyPreCompItem); bool addIdentifiedRemainingConsistencyRequiredConcepts(CTotallyOntologyPrecomputationItem* totallyPreCompItem); bool addConsistencyRequiredSaturationIndividuals(CTotallyOntologyPrecomputationItem* totallyPreCompItem); void extractCommonDisjunctConceptsFromPrecomputedSaturation(CTotallyOntologyPrecomputationItem* totallyPreCompItem); void logSaturationInfos(CTotallyOntologyPrecomputationItem* totallyPreCompItem); // protected variables protected: CReuseCompletionGraphCacheWriter* mReuseCompletionGraphCacheWriter; CBackendRepresentativeMemoryCache* mBackendAssocCache; cint64 mIndividualSaturationCount; bool mConfForceFullCompletionGraphConstruction; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CTOTALLYPRECOMPUTATIONTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CPrecomputationTestingItem.h0000644000175000017500000000435212520550770030016 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATIONTESTINGITEM_H #define KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATIONTESTINGITEM_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Consistiser { /*! * * \class CPrecomputationTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPrecomputationTestingItem { // public methods public: //! Constructor CPrecomputationTestingItem(COntologyPrecomputationItem* preCompItem); enum PRECOMPUTATIONTYPE { CONSISTENCEPRECOMPUTATIONTYPE, CONCEPTSATURATIONPRECOMPUTATIONTYPE, INDIVIDUALSATURATIONPRECOMPUTATIONTYPE, CONCEPTCYCLEPRECOMPUTATIONTYPE }; COntologyPrecomputationItem* getOntologyPrecomputationItem(); CPrecomputationTestingItem* setOntologyPrecomputationItem(COntologyPrecomputationItem* preCompItem); virtual PRECOMPUTATIONTYPE getPrecomputationTestingType() = 0; // protected methods protected: // protected variables protected: COntologyPrecomputationItem* mOntologyPreCompItem; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATIONTESTINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIndividualDependenceTrackingObserver.cpp0000644000175000017500000000227212520550770032420 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualDependenceTrackingObserver.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CIndividualDependenceTrackingObserver::CIndividualDependenceTrackingObserver() { } CIndividualDependenceTrackingObserver::~CIndividualDependenceTrackingObserver() { } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationCommonDisjunctConceptsExtractor.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CSaturationCommonDisjunctConceptsExtracto0000644000175000017500000001203012520550772032613 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaturationCommonDisjunctConceptsExtractor.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CSaturationCommonDisjunctConceptsExtractor::CSaturationCommonDisjunctConceptsExtractor() { } bool CSaturationCommonDisjunctConceptsExtractor::extractCommonDisjunctConcepts(CConcreteOntology* ontology, CSaturationData* saturationData, QSet* disjunctionConceptSet) { CSaturationTaskData* satTaskData = (CSaturationTaskData*)saturationData; if (satTaskData) { CSatisfiableCalculationTask* satCalcTask = satTaskData->getSaturationTask(); if (satCalcTask) { CMemoryAllocationManager* mMemMan = ontology->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); CImplicationReplacementVector* repVector = ontology->getDataBoxes()->getMBox()->getImplicationReplacementVector(true); for (QSet::const_iterator it = disjunctionConceptSet->constBegin(), itEnd = disjunctionConceptSet->constEnd(); it != itEnd; ++it) { CConcept* disjunctionConcept(*it); bool disjunctionNegation = false; cint64 disjunctionOpCode = disjunctionConcept->getOperatorCode(); if (disjunctionOpCode == CCAND || disjunctionOpCode == CCEQ) { disjunctionNegation = true; } CConceptProcessData* disjConProData = (CConceptProcessData*)disjunctionConcept->getConceptData(); if (disjConProData) { CReplacementData* disjReplData = disjConProData->getReplacementData(); bool replacementDataInitialized = false; QSet< QPair > commonConceptNegationPairSet; CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)disjConProData->getConceptReferenceLinking(); if (confSatRefLinkingData) { CSaturationConceptReferenceLinking* disjunctConceptRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(disjunctionNegation); if (disjunctConceptRefLinkData) { CIndividualSaturationProcessNode* satIndiNode = (CIndividualSaturationProcessNode*)disjunctConceptRefLinkData->getIndividualProcessNodeForConcept(); if (satIndiNode && satIndiNode->isCompleted()) { CReapplyConceptSaturationLabelSet* conSet = satIndiNode->getReapplyConceptSaturationLabelSet(false); if (conSet) { for (CConceptSaturationDescriptor* conDesIt = conSet->getConceptSaturationDescriptionLinker(); conDesIt; conDesIt = conDesIt->getNext()) { CConcept* concept = conDesIt->getConcept(); bool negation = conDesIt->isNegated(); if (concept != disjunctionConcept && concept->getOperatorCode() != CCTOP) { if (!disjReplData) { disjReplData = CObjectAllocator::allocateAndConstruct(mMemMan); disjReplData->initReplacementData(nullptr); disjConProData->setReplacementData(disjReplData); repVector->setData(concept->getConceptTag(),disjReplData); replacementDataInitialized = true; } if (!replacementDataInitialized) { for (CXNegLinker* commonConLinkIt = disjReplData->getCommonDisjunctConceptLinker(); commonConLinkIt; commonConLinkIt = commonConLinkIt->getNext()) { CConcept* commonConcept = commonConLinkIt->getData(); bool commonConceptNeg = commonConLinkIt->isNegated(); commonConceptNegationPairSet.insert( QPair(commonConcept,commonConceptNeg) ); } } if (!commonConceptNegationPairSet.contains(QPair(concept,negation))) { commonConceptNegationPairSet.insert(QPair(concept,negation)); CXNegLinker* commNegConLinker = CObjectAllocator< CXNegLinker >::allocateAndConstruct(mMemMan); commNegConLinker->initNegLinker(concept,negation); disjReplData->addCommonDisjunctConceptLinker(commNegConLinker); } } } } } } } } } } } return false; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CPrecomputationThread.cpp0000644000175000017500000002255612520550770027332 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecomputationThread.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CPrecomputationThread::CPrecomputationThread(CReasonerManager *reasonerManager) : CThread("Precomputation-Thread") { mReasoner = reasonerManager; mCalculationManager = 0; mCurrRunningTestParallelCount = 0; mConfMaxTestParallelCount = 1; mStatCalculatingJobs = 0; startThread(QThread::HighPriority); } CPrecomputationThread::~CPrecomputationThread() { stopThread(); } bool CPrecomputationThread::precompute(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList, CCallbackData* callback) { postEvent(new CPrecomputeOntologyEvent(ontology,config,requirementList,callback)); return true; } bool CPrecomputationThread::precompute(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList) { CBlockingCallbackData callback; postEvent(new CPrecomputeOntologyEvent(ontology,config,requirementList,&callback)); callback.waitForCallback(); return true; } bool CPrecomputationThread::callbackPrecomputed(CConcreteOntology* ontology, CCallbackData* callback) { bool callbackPecomputedOnto = false; CPrecomputation* precomputation = ontology->getPrecomputation(); if (precomputation && precomputation->isPrecomputed()) { callbackPecomputedOnto = true; if (callback) { callback->doCallback(); } } else { CBlockingCallbackData callbackBlock; postEvent(new CCallbackPrecomputedOntologyEvent(ontology,&callbackBlock,callback)); callbackBlock.waitForCallback(); CCallbackDataContext* callbackContext = callbackBlock.getCallbackDataContext(); if (callbackContext) { CPrecomputationCallbackDataContext* possCallbackContext = dynamic_cast(callbackContext); callbackPecomputedOnto = possCallbackContext->isPrecomputing(); } } return callbackPecomputedOnto; } bool CPrecomputationThread::canProcessMoreTests() { return mCurrRunningTestParallelCount < mConfMaxTestParallelCount; } bool CPrecomputationThread::doNextPendingTests() { bool createdNewTests = false; bool nextTestCreated = true; while (canProcessMoreTests() && nextTestCreated) { nextTestCreated = false; bool workCreated = createNextTest(); if (workCreated) { nextTestCreated = true; createdNewTests = true; } else { nextTestCreated = false; } } return createdNewTests; } CPrecomputationThread* CPrecomputationThread::processCalculationJob(CSatisfiableCalculationJob* job, COntologyPrecomputationItem* preCompItem, CPrecomputationTestingItem* preTestItem) { CPrecomputationCalculatedCallbackEvent* callbackEvent = new CPrecomputationCalculatedCallbackEvent(this,job,preTestItem); preCompItem->getPrecomputationTestingItemSet()->insert(preTestItem); mCurrRunningTestParallelCount++; ++mStatCalculatingJobs; if (!mCalculationManager) { mCalculationManager = mReasoner->getCalculationManager(); } if (mCalculationManager) { mCalculationManager->calculateJob(job,callbackEvent); } else { mReasoner->reasoningSatisfiableCalcualtionJob(job,callbackEvent); } return this; } CPrecomputationThread* CPrecomputationThread::processCalculationJob(CApproximatedSaturationCalculationJob* job, COntologyPrecomputationItem* preCompItem, CPrecomputationTestingItem* preTestItem) { CSaturationPrecomputationCalculatedCallbackEvent* callbackEvent = new CSaturationPrecomputationCalculatedCallbackEvent(this,job,preTestItem); preCompItem->getPrecomputationTestingItemSet()->insert(preTestItem); mCurrRunningTestParallelCount++; ++mStatCalculatingJobs; if (!mCalculationManager) { mCalculationManager = mReasoner->getCalculationManager(); } if (mCalculationManager) { mCalculationManager->calculateJob(job,callbackEvent); } return this; } COntologyPrecomputationItem* CPrecomputationThread::initializeOntologyPrecomputionItem(CConcreteOntology* ontology, CConfigurationBase* config) { COntologyPrecomputationItem* item = new COntologyPrecomputationItem(); item->initPrecomputationItem(ontology,config); return item; } bool CPrecomputationThread::addOntologyPrecomputionCallback(COntologyPrecomputationItem* item, CCallbackData* callback) { item->addPrecomputationFinishedCallback(callback); return this; } bool CPrecomputationThread::addOntologyPrecomputionRequirements(COntologyPrecomputationItem* item, COntologyProcessingRequirement* requirement) { item->addPrecomputationRequirement(requirement); return true; } bool CPrecomputationThread::processCustomsEvents(QEvent::Type type, CCustomEvent* event) { if (CThread::processCustomsEvents(type,event)) { return true; } else if (type == CPrecomputeOntologyEvent::EVENTTYPE) { CPrecomputeOntologyEvent* poe = (CPrecomputeOntologyEvent*)event; CCallbackData* callbackData = poe->getCallbackData(); CConfigurationBase* configBase = poe->getConfiguration(); CConcreteOntology* ontology = poe->getOntology(); QList* requirementList = poe->getProcessingRequirementList(); COntologyPrecomputationItem* item = mOntItemHash.value(ontology); if (!item) { item = initializeOntologyPrecomputionItem(ontology,configBase); mOntItemHash.insert(ontology,item); mActiveOntItemSet.insert(item); mProcessingOntItemList.append(item); } else { if (!mActiveOntItemSet.contains(item)) { mInactiveOntItemSet.remove(item); mActiveOntItemSet.insert(item); mProcessingOntItemList.append(item); } } for (QList::const_iterator it = requirementList->constBegin(), itEnd = requirementList->constEnd(); it != itEnd; ++it) { COntologyProcessingRequirement* requ(*it); addOntologyPrecomputionRequirements(item,requ); } if (callbackData) { addOntologyPrecomputionCallback(item,callbackData); } doNextPendingTests(); return true; } else if (type == CCallbackPrecomputedOntologyEvent::EVENTTYPE) { CCallbackPrecomputedOntologyEvent* cpoe = (CCallbackPrecomputedOntologyEvent*)event; CConcreteOntology* ontology = cpoe->getOntology(); CCallbackData* precomputedCallbackData = cpoe->getPrecomputedCallbackData(); CCallbackData* installedCallbackData = cpoe->getCallbackPossibleCallbackData(); COntologyPrecomputationItem* item = mOntItemHash.value(ontology); if (item) { addOntologyPrecomputionCallback(item,precomputedCallbackData); if (installedCallbackData) { CPrecomputationCallbackDataContext* callbackDataContext = new CPrecomputationCallbackDataContext(true,ontology); installedCallbackData->setCallbackDataContext(callbackDataContext); installedCallbackData->doCallback(); } } else { if (installedCallbackData) { CPrecomputationCallbackDataContext* callbackDataContext = new CPrecomputationCallbackDataContext(false,ontology); installedCallbackData->setCallbackDataContext(callbackDataContext); installedCallbackData->doCallback(); } } return true; } else if (type == CPrecomputationCalculatedCallbackEvent::EVENTTYPE) { CPrecomputationCalculatedCallbackEvent* pcce = (CPrecomputationCalculatedCallbackEvent*)event; --mCurrRunningTestParallelCount; CPrecomputationTestingItem* testingItem = pcce->getTestingItem(); COntologyPrecomputationItem* ontPreCompItem = testingItem->getOntologyPrecomputationItem(); ontPreCompItem->getPrecomputationTestingItemSet()->remove(testingItem); precomputationTested(ontPreCompItem,testingItem,pcce); doNextPendingTests(); return true; } else if (type == CSaturationPrecomputationCalculatedCallbackEvent::EVENTTYPE) { CSaturationPrecomputationCalculatedCallbackEvent* spcce = (CSaturationPrecomputationCalculatedCallbackEvent*)event; --mCurrRunningTestParallelCount; CPrecomputationTestingItem* testingItem = spcce->getPrecomputationTestingItem(); COntologyPrecomputationItem* ontPreCompItem = testingItem->getOntologyPrecomputationItem(); ontPreCompItem->getPrecomputationTestingItemSet()->remove(testingItem); precomputationTested(ontPreCompItem,testingItem,spcce); doNextPendingTests(); return true; } return false; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CPrecomputationThread.h0000644000175000017500000001170212520550772026770 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATIONTHREAD_H #define KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATIONTHREAD_H // Libraries includes // Namespace includes #include "ConsistiserSettings.h" #include "CPrecomputator.h" #include "CConsistiser.h" #include "CPrecomputationContext.h" #include "COntologyPrecomputationItem.h" #include "CPrecomputationCallbackDataContext.h" #include "CPrecomputationTestingItem.h" // Other includes #include "Reasoner/Consistiser/Events/CCallbackPrecomputedOntologyEvent.h" #include "Reasoner/Consistiser/Events/CPrecomputeOntologyEvent.h" #include "Reasoner/Consistiser/Events/CPrecomputationCalculatedCallbackEvent.h" #include "Reasoner/Consistiser/Events/CSaturationPrecomputationCalculatedCallbackEvent.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Kernel/Manager/CReasonerManager.h" #include "Concurrent/CThread.h" #include "Concurrent/Callback/CBlockingCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; using namespace Kernel::Manager; using namespace Kernel::Calculation; namespace Consistiser { using namespace Events; /*! * * \class CPrecomputationThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPrecomputationThread : public CPrecomputator, public CConsistiser, public CThread { // public methods public: //! Constructor CPrecomputationThread(CReasonerManager* reasonerManager); //! Destructor virtual ~CPrecomputationThread(); virtual bool precompute(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList, CCallbackData* callback); virtual bool precompute(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList); virtual bool callbackPrecomputed(CConcreteOntology* ontology, CCallbackData* callback); // protected methods protected: virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); virtual bool createNextTest() = 0; virtual bool canProcessMoreTests(); virtual bool doNextPendingTests(); virtual COntologyPrecomputationItem* initializeOntologyPrecomputionItem(CConcreteOntology* ontology, CConfigurationBase* config); virtual bool addOntologyPrecomputionCallback(COntologyPrecomputationItem* item, CCallbackData* callback); virtual bool addOntologyPrecomputionRequirements(COntologyPrecomputationItem* item, COntologyProcessingRequirement* requirement); CPrecomputationThread* processCalculationJob(CSatisfiableCalculationJob* job, COntologyPrecomputationItem* preCompItem, CPrecomputationTestingItem* preTestItem); CPrecomputationThread* processCalculationJob(CApproximatedSaturationCalculationJob* job, COntologyPrecomputationItem* preCompItem, CPrecomputationTestingItem* preTestItem); virtual bool precomputationTested(COntologyPrecomputationItem* ontPreCompItem, CPrecomputationTestingItem* preTestItem, CPrecomputationCalculatedCallbackEvent* pcce) = 0; virtual bool precomputationTested(COntologyPrecomputationItem* ontPreCompItem, CPrecomputationTestingItem* preTestItem, CSaturationPrecomputationCalculatedCallbackEvent* pcce) = 0; // protected variables protected: qint64 mConfMaxTestParallelCount; qint64 mCurrRunningTestParallelCount; QSet mActiveOntItemSet; QSet mInactiveOntItemSet; QList mProcessingOntItemList; QHash mOntItemHash; cint64 mPrecomputationCount; CReasonerManager* mReasoner; CCalculationManager* mCalculationManager; cint64 mStatCalculatingJobs; CPrecomputationContext mContext; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CPRECOMPUTATIONTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CConsistiser.cpp0000644000175000017500000000207512520550766025475 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConsistiser.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CConsistiser::CConsistiser() { } CConsistiser::~CConsistiser() { } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CTotallyOntologyPrecomputationItem.cpp0000644000175000017500000006772312520550774032136 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTotallyOntologyPrecomputationItem.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CTotallyOntologyPrecomputationItem::CTotallyOntologyPrecomputationItem() { } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::initTotallyPrecomputationItem(CConcreteOntology* ontology, CConfigurationBase* config) { COntologyPrecomputationItem::initPrecomputationItem(ontology,config); mConsistenceCheched = false; mConsistence = nullptr; mPrecomputation = ontology->getPrecomputation(); mCalculationConfig = new CCalculationConfigurationExtension(config,0); mConsistenceCheckCreated = false; mConceptCyclePrecomputationChecked = false; mConceptCyclePrecomputationInitialized = false; mMinConceptCycleTestSize = 0; mConceptSaturationPrecomputationChecked = false; mConceptSaturationPrecomputationCreated = false; mSaturationTestRunning = false; mIndividualPrecomputationCreated = false; mIndividualPrecomputationChecked = false; COntologyProcessingStepDataVector* ontProStepDataVec = mOntology->getProcessingSteps()->getOntologyProcessingStepDataVector(); mConsistencePrecomputationStep = new CPrecomputationTestingStep(CPrecomputationTestingStep::CONSISTENCYPRECOMPUTATIONSTEP,ontProStepDataVec->getProcessingStepData(COntologyProcessingStep::OPSCONSISTENCY),this); mCyclePrecomputationStep = new CPrecomputationTestingStep(CPrecomputationTestingStep::CYCLEPRECOMPUTATIONSTEP,ontProStepDataVec->getProcessingStepData(COntologyProcessingStep::OPSPRECOMPUTECYCLES),this); mSaturationPrecomputationStep = new CPrecomputationTestingStep(CPrecomputationTestingStep::SATURATIONPRECOMPUTATIONSTEP,ontProStepDataVec->getProcessingStepData(COntologyProcessingStep::OPSPRECOMPUTESATURATION),this); mIndividualPrecomputationStep = new CPrecomputationTestingStep(CPrecomputationTestingStep::INDIVIDUALPRECOMPUTATIONSTEP,ontProStepDataVec->getProcessingStepData(COntologyProcessingStep::OPSPRECOMPUTEINDIVIDUAL),this); mProcessingSteps.append(mCyclePrecomputationStep); mProcessingSteps.append(mConsistencePrecomputationStep); mProcessingSteps.append(mSaturationPrecomputationStep); mProcessingSteps.append(mIndividualPrecomputationStep); mApproxSatCalcJob = nullptr; mLastSaturData = nullptr; mAllConSatRequired = false; mAllConSatOrdered = false; mNomDelayedConSatUpRequired = false; mNomDelayedConSatUpdated = false; mSaturationComputationRunning = false; mIndividualComputationRunning = false; mAllAssertionIndividual = nullptr; mAllAssertionIndividualSaturated = false; mAllAssertionIndividualSufficientSaturationChecked = false; mAllAssertionIndividualSaturationSufficient = false; mIndividualSaturationClashed = false; mIndividualSaturationInsufficient = false; mIndividualSaturated = false; mAllIndividualSaturaturationOrderd = false; mIndividualSaturationRunningCount = 0; mFreeItemLinker = nullptr; mNextSaturationID = 1; mIndividualTestRunning = false; mIndividualsSaturationCacheSynchronisation = false; mFailAfterConsistencyConceptSaturation = CConfigDataReader::readConfigBoolean(config,"Konclude.Debug.FailAfterConsistencyConceptSaturation",false); mFailAfterConsistencyChecking = CConfigDataReader::readConfigBoolean(config,"Konclude.Debug.FailAfterConsistencyCheck",false); mFailAfterConceptSaturation = CConfigDataReader::readConfigBoolean(config,"Konclude.Debug.FailAfterConceptSaturation",false); mInitTime.start(); return this; } CTotallyOntologyPrecomputationItem::~CTotallyOntologyPrecomputationItem() { delete mCalculationConfig; delete mConsistencePrecomputationStep; delete mCyclePrecomputationStep; delete mSaturationPrecomputationStep; delete mIndividualPrecomputationStep; if (mAllAssertionIndividual) { CConceptAssertionLinker* conAssLinker = mAllAssertionIndividual->getAssertionConceptLinker(); while (conAssLinker) { CConceptAssertionLinker* tmpConAssLinker = conAssLinker; conAssLinker = conAssLinker->getNext(); delete tmpConAssLinker; } CRoleAssertionLinker* roleAssLinker = mAllAssertionIndividual->getAssertionRoleLinker(); while (roleAssLinker) { CRoleAssertionLinker* tmpRoleAssLinker = roleAssLinker; roleAssLinker = roleAssLinker->getNext(); delete tmpRoleAssLinker; } delete mAllAssertionIndividual; } } bool CTotallyOntologyPrecomputationItem::failAfterConsistencyConceptSaturation() { return mFailAfterConsistencyConceptSaturation; } bool CTotallyOntologyPrecomputationItem::failAfterConsistencyChecking() { return mFailAfterConsistencyChecking; } bool CTotallyOntologyPrecomputationItem::failAfterConceptSaturation() { return mFailAfterConceptSaturation; } COntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::addPrecomputationRequirement(COntologyProcessingRequirement* ontoRequirement) { bool supportRequirement = false; COntologyProcessingStepRequirement* stepProcRequirement = dynamic_cast(ontoRequirement); if (stepProcRequirement) { if (stepProcRequirement->getRequiredProcessingStep()->getOntologyProcessingType() == COntologyProcessingStep::OPSCONSISTENCY) { mConsistencePrecomputationStep->addProcessingRequirement(stepProcRequirement); supportRequirement = true; } if (stepProcRequirement->getRequiredProcessingStep()->getOntologyProcessingType() == COntologyProcessingStep::OPSPRECOMPUTESATURATION) { mSaturationPrecomputationStep->addProcessingRequirement(stepProcRequirement); mAllConSatRequired = true; supportRequirement = true; } if (stepProcRequirement->getRequiredProcessingStep()->getOntologyProcessingType() == COntologyProcessingStep::OPSPRECOMPUTECYCLES) { mCyclePrecomputationStep->addProcessingRequirement(stepProcRequirement); supportRequirement = true; } if (stepProcRequirement->getRequiredProcessingStep()->getOntologyProcessingType() == COntologyProcessingStep::OPSPRECOMPUTEINDIVIDUAL) { mIndividualPrecomputationStep->addProcessingRequirement(stepProcRequirement); supportRequirement = true; } } COntologyProcessingConceptSaturationRequirement* conSatRequirement = dynamic_cast(ontoRequirement); if (conSatRequirement) { addRequiredSaturationConcept(conSatRequirement->getConcept(),conSatRequirement->getConceptNegation()); mSaturationPrecomputationStep->addProcessingRequirement(conSatRequirement); supportRequirement = true; } if (!supportRequirement) { stepProcRequirement->submitRequirementUpdate(COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSUNSUPPORTED); } return this; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setConsistenceCheched(bool consistenceChecked) { mConsistenceCheched = consistenceChecked; return this; } bool CTotallyOntologyPrecomputationItem::hasConsistenceCheched() { return mConsistenceCheched; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setConsistenceCheckCreated(bool consistenceCheckCreated) { mConsistenceCheckCreated = consistenceCheckCreated; return this; } bool CTotallyOntologyPrecomputationItem::hasConsistenceCheckCreated() { return mConsistenceCheckCreated; } CConsistenceObserver* CTotallyOntologyPrecomputationItem::tellConsistenceData(CConsistenceData* consData) { if (mConsData.testAndSetOrdered(nullptr,consData)) { consData->overtakeData(); } else { delete consData; } return this; } CSaturationObserver* CTotallyOntologyPrecomputationItem::tellSaturationData(CSaturationData* saturationData) { //if (mSaturData.testAndSetOrdered(nullptr,saturationData)) { // saturationData->overtakeData(); //} else { // delete saturationData; //} saturationData->overtakeData(); mSaturDataAddMutex.lock(); mLastSaturData = saturationData; mSaturDataList.append(mLastSaturData); mSaturDataAddMutex.unlock(); return this; } CSaturationData* CTotallyOntologyPrecomputationItem::getSaturationData() { return mLastSaturData; } CConsistenceData* CTotallyOntologyPrecomputationItem::getConsistenceData() { return mConsData.fetchAndAddRelaxed(0); } CConsistence* CTotallyOntologyPrecomputationItem::getConsistence() { return mConsistence; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setConsistence(CConsistence* consistence) { mConsistence = consistence; return this; } CCalculationConfigurationExtension* CTotallyOntologyPrecomputationItem::getCalculationConfiguration() { return mCalculationConfig; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setPrecomputation(CPrecomputation* precomputation) { mPrecomputation = precomputation; return this; } CPrecomputation* CTotallyOntologyPrecomputationItem::getPrecomputation() { return mPrecomputation; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setConceptCyclePrecomputationInitialized(bool initialized) { mConceptCyclePrecomputationInitialized = initialized; return this; } bool CTotallyOntologyPrecomputationItem::hasConceptCyclePrecomputationInitialized() { return mConceptCyclePrecomputationInitialized; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setConceptCyclePrecomputationChecked(bool checked) { mConceptCyclePrecomputationChecked = checked; return this; } bool CTotallyOntologyPrecomputationItem::hasConceptCyclePrecomputationChecked() { return mConceptCyclePrecomputationChecked; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setConceptSaturationPrecomputationCreated(bool initialized) { mConceptSaturationPrecomputationCreated = initialized; return this; } bool CTotallyOntologyPrecomputationItem::hasConceptSaturationPrecomputationCreated() { return mConceptSaturationPrecomputationCreated; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setConceptSaturationPrecomputationChecked(bool checked) { mConceptSaturationPrecomputationChecked = checked; return this; } bool CTotallyOntologyPrecomputationItem::hasConceptSaturationPrecomputationChecked() { return mConceptSaturationPrecomputationChecked; } bool CTotallyOntologyPrecomputationItem::requiresAllConceptsSaturation() { return mAllConSatRequired; } bool CTotallyOntologyPrecomputationItem::hasAllConceptsSaturationOrdered() { return mAllConSatOrdered; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setAllConceptsSaturationOrdered(bool ordered) { mAllConSatOrdered = ordered; return this; } bool CTotallyOntologyPrecomputationItem::requiresNominalDelayedConceptsSaturationUpdate() { return mNomDelayedConSatUpRequired; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setNominalDelayedConceptsSaturationUpdateRequired(bool updateRequired) { mNomDelayedConSatUpRequired = updateRequired; return this; } QList* CTotallyOntologyPrecomputationItem::getSaturationOrderedItemList() { return &mSatOrderedItemList; } bool CTotallyOntologyPrecomputationItem::hasRemainingRequiredSaturationConcepts() { return !mRemainingReqSatConList.isEmpty() || mAllConSatRequired && !mAllConSatOrdered || mNomDelayedConSatUpRequired && !mNomDelayedConSatUpdated; } QList* CTotallyOntologyPrecomputationItem::getRemainingRequiredSaturationConceptList() { return &mRemainingReqSatConList; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::addRequiredSaturationConcept(CConcept* concept, bool negation) { if (!mAllConSatRequired) { mRemainingReqSatConList.append(TConceptNegPair(concept,negation)); } return this; } bool CTotallyOntologyPrecomputationItem::hasRemainingConsistencyRequiredSaturationConcepts() { return !mRemainingConsReqSatConList.isEmpty(); } QList* CTotallyOntologyPrecomputationItem::getRemainingConsistencyRequiredSaturationConceptList() { return &mRemainingConsReqSatConList; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::addConsistencyRequiredSaturationConcept(CConcept* concept, bool negation) { mRemainingConsReqSatConList.append(TConceptNegPair(concept,negation)); return this; } bool CTotallyOntologyPrecomputationItem::hasRemainingConsistencyRequiredSaturationIndividuals() { return !mRemainingABoxSatConList.isEmpty(); } QList* CTotallyOntologyPrecomputationItem::getRemainingConsistencyRequiredSaturationIndividuals() { return &mRemainingABoxSatConList; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::addConsistencyRequiredSaturationIndividual(CIndividual* individual) { mRemainingABoxSatConList.append(individual); return this; } QList* CTotallyOntologyPrecomputationItem::getRemainingConceptCyclePrecomputationList() { return &mRemainingConceptCyclePrecomputationList; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::addRemainingConceptCyclePrecomputation(CConceptCycleData* conceptCycleData) { mRemainingConceptCyclePrecomputationList.append(conceptCycleData); return this; } bool CTotallyOntologyPrecomputationItem::hasRemainingConceptCyclePrecomputation() { return !mRemainingConceptCyclePrecomputationList.isEmpty(); } cint64 CTotallyOntologyPrecomputationItem::getMinConceptCycleTestSize() { return mMinConceptCycleTestSize; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setMinConceptCycleTestSize(cint64 minSize) { mMinConceptCycleTestSize = minSize; return this; } CPrecomputationTestingStep* CTotallyOntologyPrecomputationItem::getConsistencePrecomputationStep() { return mConsistencePrecomputationStep; } bool CTotallyOntologyPrecomputationItem::isConsistenceStepFinished() { return mConsistencePrecomputationStep->isStepFinished(); } bool CTotallyOntologyPrecomputationItem::isConsistenceStepRequired() { return mConsistencePrecomputationStep->hasRequirements(); } bool CTotallyOntologyPrecomputationItem::areConsistenceStepProcessingRequirementSatisfied() { return mConsistencePrecomputationStep->areStepProcessingRequirementSatisfied(); } bool CTotallyOntologyPrecomputationItem::areCycleStepProcessingRequirementSatisfied() { return mCyclePrecomputationStep->areStepProcessingRequirementSatisfied(); } CPrecomputationTestingStep* CTotallyOntologyPrecomputationItem::getCyclePrecomputationStep() { return mCyclePrecomputationStep; } bool CTotallyOntologyPrecomputationItem::isCycleStepFinished() { return mCyclePrecomputationStep->isStepFinished(); } bool CTotallyOntologyPrecomputationItem::isCycleStepRequired() { return mCyclePrecomputationStep->hasRequirements(); } bool CTotallyOntologyPrecomputationItem::areSaturationStepProcessingRequirementSatisfied() { return mSaturationPrecomputationStep->areStepProcessingRequirementSatisfied(); } CPrecomputationTestingStep* CTotallyOntologyPrecomputationItem::getSaturationPrecomputationStep() { return mSaturationPrecomputationStep; } bool CTotallyOntologyPrecomputationItem::isSaturationStepRunning() { return mSaturationTestRunning; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setSaturationStepRunning(bool satStepRunning) { mSaturationTestRunning = satStepRunning; return this; } bool CTotallyOntologyPrecomputationItem::isSaturationComputationRunning() { return mSaturationComputationRunning; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setSaturationComputationRunning(bool satCompRunning) { mSaturationComputationRunning = satCompRunning; return this; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::incIndividualSaturationRunningCount(cint64 incCount) { mIndividualSaturationRunningCount += incCount; return this; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::decIndividualSaturationRunningCount(cint64 decCount) { mIndividualSaturationRunningCount -= decCount; return this; } cint64 CTotallyOntologyPrecomputationItem::getIndividualSaturationRunningCount() { return mIndividualSaturationRunningCount; } bool CTotallyOntologyPrecomputationItem::hasIndividualSaturationRunning() { return mIndividualSaturationRunningCount > 0; } bool CTotallyOntologyPrecomputationItem::isSaturationStepFinished() { return mSaturationPrecomputationStep->isStepFinished(); } bool CTotallyOntologyPrecomputationItem::isSaturationStepRequired() { return mSaturationPrecomputationStep->hasRequirements(); } bool CTotallyOntologyPrecomputationItem::areAllStepFinished() { for (QList::const_iterator it = mProcessingSteps.constBegin(), itEnd = mProcessingSteps.constEnd(); it != itEnd; ++it) { if (!(*it)->isStepFinished()) { return false; } } return true; } bool CTotallyOntologyPrecomputationItem::hasRemainingProcessingRequirements() { for (QList::const_iterator it = mProcessingSteps.constBegin(), itEnd = mProcessingSteps.constEnd(); it != itEnd; ++it) { if ((*it)->hasRequirements()) { return true; } } return false; } CSaturationConceptDataItem* CTotallyOntologyPrecomputationItem::getSaturationConceptDataItem(CConcept* satConcept, bool negated, bool create) { CSaturationConceptDataItem* item = nullptr; CConceptProcessData* conProcData = (CConceptProcessData*)satConcept->getConceptData(); CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* conRefSatLinking = (CConceptSaturationReferenceLinkingData*)conRefLinking; item = (CSaturationConceptDataItem*)conRefSatLinking->getConceptSaturationReferenceLinkingData(negated); } if (!item && create) { item = new CSaturationConceptDataItem(); item->initConceptSaturationTestingItem(satConcept,negated,nullptr); mConceptNegationSatItemHash.insert(TConceptNegPair(satConcept,negated),item); mSatItemContainer.append(item); } return item; } CSaturationConceptDataItem* CTotallyOntologyPrecomputationItem::getSaturationRoleSuccessorConceptDataItem(CRole* role, CConcept* satConcept, bool negated, bool create) { CSaturationConceptDataItem* item = nullptr; item = mRoleConceptNegationSatItemHash.value(TRoleConceptNegTriple(role,TConceptNegPair(satConcept,negated))); if (!item && create) { item = new CSaturationConceptDataItem(); item->initConceptSaturationTestingItem(satConcept,negated,role); mRoleConceptNegationSatItemHash.insert(TRoleConceptNegTriple(role,TConceptNegPair(satConcept,negated)),item); mSatItemContainer.append(item); } return item; } CApproximatedSaturationCalculationJob* CTotallyOntologyPrecomputationItem::getSaturationCalculationJob() { return mApproxSatCalcJob; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setSaturationCalculationJob(CApproximatedSaturationCalculationJob* calculationJob) { mApproxSatCalcJob = calculationJob; return this; } QSet* CTotallyOntologyPrecomputationItem::getSaturatedDisjunctionSet() { return &mDisjunctionSaturationSet; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::addSaturatedDisjunction(CConcept* disjunctionConcept) { mDisjunctionSaturationSet.insert(disjunctionConcept); return this; } CIndividual* CTotallyOntologyPrecomputationItem::getAllAssertionIndividual() { return mAllAssertionIndividual; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setAllAssertionIndividual(CIndividual* individual) { mAllAssertionIndividual = individual; return this; } bool CTotallyOntologyPrecomputationItem::isAllAssertionIndividualSaturated() { return mAllAssertionIndividualSaturated; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setAllAssertionIndividualSaturated(bool saturated) { mAllAssertionIndividualSaturated = saturated; return this; } bool CTotallyOntologyPrecomputationItem::hasAllAssertionIndividualSufficientSaturationChecked() { return mAllAssertionIndividualSufficientSaturationChecked; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setAllAssertionIndividualSufficientSaturationChecked(bool sufficientSaturatedChecked) { mAllAssertionIndividualSufficientSaturationChecked = sufficientSaturatedChecked; return this; } bool CTotallyOntologyPrecomputationItem::isAllAssertionIndividualSaturationSufficient() { return mAllAssertionIndividualSaturationSufficient; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setAllAssertionIndividualSaturationSufficient(bool sufficientSaturated) { mAllAssertionIndividualSaturationSufficient = sufficientSaturated; return this; } CSaturationIndividualDataItem* CTotallyOntologyPrecomputationItem::takeFreeSaturationIndividualDataItem(bool create) { CSaturationIndividualDataItem* item = mFreeItemLinker; if (mFreeItemLinker) { mFreeItemLinker = mFreeItemLinker->getNext(); } if (item) { item->clearNext(); } if (!item) { item = new CSaturationIndividualDataItem(); } return item; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::addFreeSaturationIndividualDataItem(CSaturationIndividualDataItem* item) { if (item) { for (CSaturationIndividualDataItem* itemIt = item; itemIt; itemIt = itemIt->getNext()) { itemIt->initConceptSaturationTestingItem(nullptr,0); } mFreeItemLinker = item->append(mFreeItemLinker); } return this; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setSaturationIDIndividualDataItems(cint64 saturationID, CSaturationIndividualDataItem* items) { mSatIDIndividualItemsHash.insert(saturationID,items); return this; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::releaseSaturationIDIndividualDataItems(cint64 saturationID) { CSaturationIndividualDataItem* items = mSatIDIndividualItemsHash.value(saturationID); mSatIDIndividualItemsHash.insert(saturationID,nullptr); addFreeSaturationIndividualDataItem(items); return this; } cint64 CTotallyOntologyPrecomputationItem::getNextSaturationID(bool moveNext) { cint64 nextID = mNextSaturationID; if (moveNext) { ++mNextSaturationID; } return nextID; } CSaturationIndividualAnalysationObserver* CTotallyOntologyPrecomputationItem::notifyClashedIndividual() { mIndividualSaturationClashed = true; return this; } CSaturationIndividualAnalysationObserver* CTotallyOntologyPrecomputationItem::notifyInsufficientIndividual() { mIndividualSaturationInsufficient = true; return this; } bool CTotallyOntologyPrecomputationItem::hasClashedSaturationIndividuals() { return mIndividualSaturationClashed; } bool CTotallyOntologyPrecomputationItem::hasInsufficientSaturationIndividuals() { return mIndividualSaturationInsufficient; } bool CTotallyOntologyPrecomputationItem::hasIndividualsSaturated() { return mIndividualSaturated; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setIndividualsSaturated(bool saturated) { mIndividualSaturated = saturated; return this; } bool CTotallyOntologyPrecomputationItem::hasALLIndividualsSaturationOrderd() { return mAllIndividualSaturaturationOrderd; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setALLIndividualsSaturationOrderd(bool allSaturationOrderd) { mAllIndividualSaturaturationOrderd = allSaturationOrderd; return this; } bool CTotallyOntologyPrecomputationItem::hasNominalDelayedConceptsSaturationUpdated() { return mNomDelayedConSatUpdated; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setNominalDelayedConceptsSaturationUpdated(bool updated) { mNomDelayedConSatUpdated = updated; return this; } bool CTotallyOntologyPrecomputationItem::hasIndividualsSaturationCacheSynchronisation() { return mIndividualsSaturationCacheSynchronisation; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setIndividualsSaturationCacheSynchronisation(bool synchronized) { mIndividualsSaturationCacheSynchronisation = synchronized; return this; } QSet* CTotallyOntologyPrecomputationItem::getIncompletelySaturatedIndividuaSet() { return &mIncompIndiSatSet; } bool CTotallyOntologyPrecomputationItem::areIndividualStepProcessingRequirementSatisfied() { return mIndividualPrecomputationStep->areStepProcessingRequirementSatisfied(); } CPrecomputationTestingStep* CTotallyOntologyPrecomputationItem::getIndividualPrecomputationStep() { return mIndividualPrecomputationStep; } bool CTotallyOntologyPrecomputationItem::isIndividualStepRunning() { return mIndividualTestRunning; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setIndividualStepRunning(bool satStepRunning) { mIndividualTestRunning = satStepRunning; return this; } bool CTotallyOntologyPrecomputationItem::isIndividualComputationRunning() { return mIndividualComputationRunning; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setIndividualComputationRunning(bool indiCompRunning) { mIndividualComputationRunning = indiCompRunning; return this; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setIndividualPrecomputationCreated(bool initialized) { mIndividualPrecomputationCreated = initialized; return this; } bool CTotallyOntologyPrecomputationItem::hasIndividualPrecomputationCreated() { return mIndividualPrecomputationCreated; } CTotallyOntologyPrecomputationItem* CTotallyOntologyPrecomputationItem::setIndividualPrecomputationChecked(bool checked) { mIndividualPrecomputationChecked = checked; return this; } bool CTotallyOntologyPrecomputationItem::hasIndividualPrecomputationChecked() { return mIndividualPrecomputationChecked; } bool CTotallyOntologyPrecomputationItem::isIndividualStepFinished() { return mIndividualPrecomputationStep->isStepFinished(); } bool CTotallyOntologyPrecomputationItem::isIndividualStepRequired() { return mIndividualPrecomputationStep->hasRequirements(); } QTime* CTotallyOntologyPrecomputationItem::getInitializationTime() { return &mInitTime; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CPrecomputationTestingItem.cpp0000644000175000017500000000272612520550770030354 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecomputationTestingItem.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CPrecomputationTestingItem::CPrecomputationTestingItem(COntologyPrecomputationItem* preCompItem) { mOntologyPreCompItem = preCompItem; } COntologyPrecomputationItem* CPrecomputationTestingItem::getOntologyPrecomputationItem() { return mOntologyPreCompItem; } CPrecomputationTestingItem* CPrecomputationTestingItem::setOntologyPrecomputationItem(COntologyPrecomputationItem* preCompItem) { mOntologyPreCompItem = preCompItem; return this; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CPrecomputationTestingStep.cpp0000644000175000017500000001007312520550770030363 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecomputationTestingStep.h" #include "COntologyPrecomputationItem.h" namespace Konclude { namespace Reasoner { namespace Consistiser { CPrecomputationTestingStep::CPrecomputationTestingStep(TESTINGSTEPTYPE testingStepType, COntologyProcessingStepData* processingStepData, COntologyPrecomputationItem* precompItem) { mTestingStepType = testingStepType; mOntologyPrecompItem = precompItem; mProcessingStepData = processingStepData; mStepFinished = false; mCombineLastFlags = 0; } COntologyPrecomputationItem* CPrecomputationTestingStep::getOntologyPrecomputationItem() { return mOntologyPrecompItem; } CPrecomputationTestingStep* CPrecomputationTestingStep::setOntologyPrecomputationItem(COntologyPrecomputationItem* precompItem) { mOntologyPrecompItem = precompItem; return this; } bool CPrecomputationTestingStep::isStepFinished() { return mStepFinished; } bool CPrecomputationTestingStep::areStepProcessingRequirementSatisfied() { return mProcessingStepData->getProcessingStep()->areAllRequirementsSatisfied(mOntologyPrecompItem->getOntology()); } bool CPrecomputationTestingStep::hasRequirements() { return !mRequirementStepDataList.isEmpty(); } CPrecomputationTestingStep* CPrecomputationTestingStep::setStepFinished(bool finished) { mStepFinished = finished; cint64 installFlags = COntologyProcessingStatus::PSCOMPLETELYYPROCESSED; mProcessingStepData->getProcessingStatus()->setProcessingFlags(installFlags); return this; } QList* CPrecomputationTestingStep::getRequirementList() { return &mRequirementStepDataList; } COntologyProcessingStepData* CPrecomputationTestingStep::getProcessingStepData() { return mProcessingStepData; } CPrecomputationTestingStep::TESTINGSTEPTYPE CPrecomputationTestingStep::getPrecomputationTestingType() { return mTestingStepType; } CPrecomputationTestingStep* CPrecomputationTestingStep::setProcessingStepData(COntologyProcessingStepData* processingData) { mProcessingStepData = processingData; return this; } CPrecomputationTestingStep* CPrecomputationTestingStep::addProcessingRequirement(COntologyProcessingRequirement* processingRequirement) { mRequirementStepDataList.append(processingRequirement); return this; } CPrecomputationTestingStep* CPrecomputationTestingStep::submitRequirementsUpdate(bool clearRequirements) { submitRequirementsUpdate(mCombineLastFlags,true); return this; } CPrecomputationTestingStep* CPrecomputationTestingStep::submitRequirementsUpdate(cint64 flags, bool clearRequirements) { mCombineLastFlags |= flags; mProcessingStepData->getProcessingStatus()->setErrorFlags(mCombineLastFlags); for (QList::const_iterator it = mRequirementStepDataList.constBegin(), itEnd = mRequirementStepDataList.constEnd(); it != itEnd; ++it) { COntologyProcessingRequirement* requirement(*it); requirement->submitRequirementUpdate(COntologyProcessingStatus::PSCOMPLETELYYPROCESSED,mCombineLastFlags); } if (clearRequirements) { mRequirementStepDataList.clear(); } return this; } }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CTotallyOntologyPrecomputationItem.h0000644000175000017500000003343612520550774031575 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CTOTALLYONTOLOGYPRECOMPUTATIONITEM_H #define KONCLUDE_REASONER_CONSISTISER_CTOTALLYONTOLOGYPRECOMPUTATIONITEM_H // Libraries includes #include // Namespace includes #include "ConsistiserSettings.h" #include "CConsistenceObserver.h" #include "CSaturationObserver.h" #include "COntologyPrecomputationItem.h" #include "CPrecomputationTestingStep.h" #include "CSaturationConceptDataItem.h" #include "CSaturationIndividualDataItem.h" #include "CSaturationIndividualAnalysationObserver.h" // Other includes #include "Reasoner/Consistence/CConsistenceData.h" #include "Reasoner/Consistence/CSaturationData.h" #include "Reasoner/Consistence/CConsistence.h" #include "Reasoner/Ontology/COntologyProcessingStepRequirement.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CIndividualProcessData.h" #include "Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h" #include "Reasoner/Ontology/COntologyProcessingConceptSaturationRequirement.h" #include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h" #include "Reasoner/Query/CApproximatedSaturationCalculationJob.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; using namespace Consistence; using namespace Ontology; using namespace Query; namespace Consistiser { typedef QPair TConceptNegPair; typedef QPair TRoleConceptNegTriple; /*! * * \class CTotallyOntologyPrecomputationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTotallyOntologyPrecomputationItem : public COntologyPrecomputationItem, public CConsistenceObserver, public CSaturationObserver, public CSaturationIndividualAnalysationObserver { // public methods public: //! Constructor CTotallyOntologyPrecomputationItem(); ~CTotallyOntologyPrecomputationItem(); CTotallyOntologyPrecomputationItem* initTotallyPrecomputationItem(CConcreteOntology* ontology, CConfigurationBase* config); virtual COntologyPrecomputationItem* addPrecomputationRequirement(COntologyProcessingRequirement* ontoRequirement); CTotallyOntologyPrecomputationItem* setConsistenceCheched(bool consistenceChecked); bool hasConsistenceCheched(); CTotallyOntologyPrecomputationItem* setConsistenceCheckCreated(bool consistenceCheckCreated); bool hasConsistenceCheckCreated(); virtual CConsistenceObserver* tellConsistenceData(CConsistenceData* consData); CConsistenceData* getConsistenceData(); virtual CSaturationObserver* tellSaturationData(CSaturationData* saturationData); CSaturationData* getSaturationData(); CConsistence* getConsistence(); CTotallyOntologyPrecomputationItem* setConsistence(CConsistence* consistence); CCalculationConfigurationExtension* getCalculationConfiguration(); CTotallyOntologyPrecomputationItem* setPrecomputation(CPrecomputation* precomputation); CPrecomputation* getPrecomputation(); CTotallyOntologyPrecomputationItem* setConceptCyclePrecomputationInitialized(bool initialized); bool hasConceptCyclePrecomputationInitialized(); CTotallyOntologyPrecomputationItem* setConceptCyclePrecomputationChecked(bool checked); bool hasConceptCyclePrecomputationChecked(); QList* getRemainingConceptCyclePrecomputationList(); CTotallyOntologyPrecomputationItem* addRemainingConceptCyclePrecomputation(CConceptCycleData* conceptCycleData); bool hasRemainingConceptCyclePrecomputation(); CTotallyOntologyPrecomputationItem* setConceptSaturationPrecomputationCreated(bool initialized); bool hasConceptSaturationPrecomputationCreated(); CTotallyOntologyPrecomputationItem* setConceptSaturationPrecomputationChecked(bool checked); bool hasConceptSaturationPrecomputationChecked(); CSaturationIndividualAnalysationObserver* notifyClashedIndividual(); CSaturationIndividualAnalysationObserver* notifyInsufficientIndividual(); bool hasClashedSaturationIndividuals(); bool hasInsufficientSaturationIndividuals(); bool hasIndividualsSaturated(); CTotallyOntologyPrecomputationItem* setIndividualsSaturated(bool saturated); bool hasALLIndividualsSaturationOrderd(); CTotallyOntologyPrecomputationItem* setALLIndividualsSaturationOrderd(bool allSaturationOrderd); bool failAfterConsistencyConceptSaturation(); bool failAfterConsistencyChecking(); bool failAfterConceptSaturation(); bool requiresAllConceptsSaturation(); bool hasAllConceptsSaturationOrdered(); CTotallyOntologyPrecomputationItem* setAllConceptsSaturationOrdered(bool ordered); QList* getSaturationOrderedItemList(); bool hasRemainingRequiredSaturationConcepts(); QList* getRemainingRequiredSaturationConceptList(); CTotallyOntologyPrecomputationItem* addRequiredSaturationConcept(CConcept* concept, bool negation); bool requiresNominalDelayedConceptsSaturationUpdate(); CTotallyOntologyPrecomputationItem* setNominalDelayedConceptsSaturationUpdateRequired(bool updateRequired); bool hasNominalDelayedConceptsSaturationUpdated(); CTotallyOntologyPrecomputationItem* setNominalDelayedConceptsSaturationUpdated(bool updated); bool hasRemainingConsistencyRequiredSaturationConcepts(); QList* getRemainingConsistencyRequiredSaturationConceptList(); CTotallyOntologyPrecomputationItem* addConsistencyRequiredSaturationConcept(CConcept* concept, bool negation); bool hasRemainingConsistencyRequiredSaturationIndividuals(); QList* getRemainingConsistencyRequiredSaturationIndividuals(); CTotallyOntologyPrecomputationItem* addConsistencyRequiredSaturationIndividual(CIndividual* individual); cint64 getMinConceptCycleTestSize(); CTotallyOntologyPrecomputationItem* setMinConceptCycleTestSize(cint64 minSize); CPrecomputationTestingStep* getConsistencePrecomputationStep(); bool isConsistenceStepFinished(); bool isConsistenceStepRequired(); bool areConsistenceStepProcessingRequirementSatisfied(); CPrecomputationTestingStep* getCyclePrecomputationStep(); bool isCycleStepFinished(); bool isCycleStepRequired(); bool areCycleStepProcessingRequirementSatisfied(); CPrecomputationTestingStep* getSaturationPrecomputationStep(); bool isSaturationStepRunning(); bool isSaturationStepFinished(); bool isSaturationStepRequired(); bool areSaturationStepProcessingRequirementSatisfied(); CTotallyOntologyPrecomputationItem* setSaturationStepRunning(bool satStepRunning); bool isSaturationComputationRunning(); CTotallyOntologyPrecomputationItem* setSaturationComputationRunning(bool satCompRunning); CPrecomputationTestingStep* getIndividualPrecomputationStep(); bool isIndividualStepRunning(); bool isIndividualStepFinished(); bool isIndividualStepRequired(); bool areIndividualStepProcessingRequirementSatisfied(); CTotallyOntologyPrecomputationItem* setIndividualStepRunning(bool satStepRunning); bool isIndividualComputationRunning(); CTotallyOntologyPrecomputationItem* setIndividualComputationRunning(bool indiCompRunning); CTotallyOntologyPrecomputationItem* setIndividualPrecomputationCreated(bool initialized); bool hasIndividualPrecomputationCreated(); CTotallyOntologyPrecomputationItem* setIndividualPrecomputationChecked(bool checked); bool hasIndividualPrecomputationChecked(); CTotallyOntologyPrecomputationItem* incIndividualSaturationRunningCount(cint64 incCount = 1); CTotallyOntologyPrecomputationItem* decIndividualSaturationRunningCount(cint64 decCount = 1); cint64 getIndividualSaturationRunningCount(); bool hasIndividualSaturationRunning(); bool areAllStepFinished(); bool hasRemainingProcessingRequirements(); CSaturationConceptDataItem* getSaturationConceptDataItem(CConcept* satConcept, bool negated, bool create); CSaturationConceptDataItem* getSaturationRoleSuccessorConceptDataItem(CRole* role, CConcept* satConcept, bool negated, bool create); CApproximatedSaturationCalculationJob* getSaturationCalculationJob(); CTotallyOntologyPrecomputationItem* setSaturationCalculationJob(CApproximatedSaturationCalculationJob* calculationJob); QSet* getSaturatedDisjunctionSet(); CTotallyOntologyPrecomputationItem* addSaturatedDisjunction(CConcept* disjunctionConcept); CIndividual* getAllAssertionIndividual(); CTotallyOntologyPrecomputationItem* setAllAssertionIndividual(CIndividual* individual); bool isAllAssertionIndividualSaturated(); CTotallyOntologyPrecomputationItem* setAllAssertionIndividualSaturated(bool saturated); bool hasAllAssertionIndividualSufficientSaturationChecked(); CTotallyOntologyPrecomputationItem* setAllAssertionIndividualSufficientSaturationChecked(bool sufficientSaturatedChecked); bool isAllAssertionIndividualSaturationSufficient(); CTotallyOntologyPrecomputationItem* setAllAssertionIndividualSaturationSufficient(bool sufficientSaturated); CSaturationIndividualDataItem* takeFreeSaturationIndividualDataItem(bool create = true); CTotallyOntologyPrecomputationItem* addFreeSaturationIndividualDataItem(CSaturationIndividualDataItem* item); CTotallyOntologyPrecomputationItem* setSaturationIDIndividualDataItems(cint64 saturationID, CSaturationIndividualDataItem* items); CTotallyOntologyPrecomputationItem* releaseSaturationIDIndividualDataItems(cint64 saturationID); cint64 getNextSaturationID(bool moveNext = true); bool hasIndividualsSaturationCacheSynchronisation(); CTotallyOntologyPrecomputationItem* setIndividualsSaturationCacheSynchronisation(bool synchronized); QSet* getIncompletelySaturatedIndividuaSet(); QTime* getInitializationTime(); // protected methods protected: // protected variables protected: CConsistence* mConsistence; bool mConsistenceCheckCreated; bool mConsistenceCheched; QAtomicPointer mConsData; QAtomicPointer mSaturData; QMutex mSaturDataAddMutex; QList mSaturDataList; CSaturationData* mLastSaturData; CPrecomputation* mPrecomputation; bool mConceptCyclePrecomputationInitialized; bool mConceptCyclePrecomputationChecked; QList mRemainingConceptCyclePrecomputationList; cint64 mMinConceptCycleTestSize; bool mFailAfterConsistencyConceptSaturation; bool mFailAfterConsistencyChecking; bool mFailAfterConceptSaturation; bool mSaturationTestRunning; bool mSaturationComputationRunning; bool mIndividualTestRunning; cint64 mIndividualSaturationRunningCount; bool mIndividualComputationRunning; bool mIndividualPrecomputationCreated; bool mIndividualPrecomputationChecked; CPrecomputationTestingStep* mConsistencePrecomputationStep; CPrecomputationTestingStep* mCyclePrecomputationStep; CPrecomputationTestingStep* mSaturationPrecomputationStep; CPrecomputationTestingStep* mIndividualPrecomputationStep; QList mProcessingSteps; QSet mDisjunctionSaturationSet; bool mConceptSaturationPrecomputationCreated; bool mConceptSaturationPrecomputationChecked; QHash mConceptNegationSatItemHash; QHash mRoleConceptNegationSatItemHash; QList mSatItemContainer; QList mSatOrderedItemList; bool mAllConSatRequired; bool mAllConSatOrdered; QList mRemainingReqSatConList; QList mRemainingConsReqSatConList; bool mNomDelayedConSatUpRequired; bool mNomDelayedConSatUpdated; QList mRemainingABoxSatConList; CApproximatedSaturationCalculationJob* mApproxSatCalcJob; CCalculationConfigurationExtension* mCalculationConfig; CIndividual* mAllAssertionIndividual; bool mAllAssertionIndividualSaturated; bool mAllAssertionIndividualSufficientSaturationChecked; bool mAllAssertionIndividualSaturationSufficient; CSaturationIndividualDataItem* mFreeItemLinker; QHash mSatIDIndividualItemsHash; cint64 mNextSaturationID; bool mIndividualSaturationClashed; bool mIndividualSaturationInsufficient; bool mIndividualSaturated; bool mAllIndividualSaturaturationOrderd; bool mIndividualsSaturationCacheSynchronisation; QSet mIncompIndiSatSet; QTime mInitTime; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CTOTALLYONTOLOGYPRECOMPUTATIONITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/CIncrementalOntologyPrecomputationItem.h0000644000175000017500000001541312520550766032402 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CINCREMENTALONTOLOGYPRECOMPUTATIONITEM_H #define KONCLUDE_REASONER_CONSISTISER_CINCREMENTALONTOLOGYPRECOMPUTATIONITEM_H // Libraries includes #include // Namespace includes #include "ConsistiserSettings.h" #include "CConsistenceObserver.h" #include "CSaturationObserver.h" #include "COntologyPrecomputationItem.h" #include "CPrecomputationTestingStep.h" #include "CSaturationConceptDataItem.h" #include "CSaturationIndividualDataItem.h" #include "CSaturationIndividualAnalysationObserver.h" // Other includes #include "Reasoner/Consistence/CConsistenceData.h" #include "Reasoner/Consistence/CSaturationData.h" #include "Reasoner/Consistence/CConsistence.h" #include "Reasoner/Ontology/COntologyProcessingStepRequirement.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CIndividualProcessData.h" #include "Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h" #include "Reasoner/Ontology/COntologyProcessingConceptSaturationRequirement.h" #include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h" #include "Reasoner/Query/CApproximatedSaturationCalculationJob.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; using namespace Consistence; using namespace Ontology; using namespace Query; namespace Consistiser { typedef QPair TConceptNegPair; typedef QPair TRoleConceptNegTriple; /*! * * \class CIncrementalOntologyPrecomputationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIncrementalOntologyPrecomputationItem : public COntologyPrecomputationItem, public CConsistenceObserver { // public methods public: //! Constructor CIncrementalOntologyPrecomputationItem(); ~CIncrementalOntologyPrecomputationItem(); CIncrementalOntologyPrecomputationItem* initTotallyPrecomputationItem(CConcreteOntology* ontology, CConfigurationBase* config); virtual COntologyPrecomputationItem* addPrecomputationRequirement(COntologyProcessingRequirement* ontoRequirement); CIncrementalOntologyPrecomputationItem* setConsistenceCheched(bool consistenceChecked); bool hasConsistenceCheched(); CIncrementalOntologyPrecomputationItem* setConsistenceCheckCreated(bool consistenceCheckCreated); bool hasConsistenceCheckCreated(); virtual CConsistenceObserver* tellConsistenceData(CConsistenceData* consData); CConsistenceData* getConsistenceData(); CConsistence* getConsistence(); CIncrementalOntologyPrecomputationItem* setConsistence(CConsistence* consistence); CCalculationConfigurationExtension* getCalculationConfiguration(); CIncrementalOntologyPrecomputationItem* setPrecomputation(CPrecomputation* precomputation); CPrecomputation* getPrecomputation(); CPrecomputationTestingStep* getConsistencePrecomputationStep(); bool isConsistenceStepFinished(); bool isConsistenceStepRequired(); bool areConsistenceStepProcessingRequirementSatisfied(); CPrecomputationTestingStep* getCyclePrecomputationStep(); bool isCycleStepFinished(); bool isCycleStepRequired(); bool areCycleStepProcessingRequirementSatisfied(); CPrecomputationTestingStep* getSaturationPrecomputationStep(); bool isSaturationStepFinished(); bool isSaturationStepRequired(); bool areSaturationStepProcessingRequirementSatisfied(); CPrecomputationTestingStep* getIndividualPrecomputationStep(); bool isIndividualStepRunning(); bool isIndividualStepFinished(); bool isIndividualStepRequired(); bool areIndividualStepProcessingRequirementSatisfied(); CIncrementalOntologyPrecomputationItem* setIndividualStepRunning(bool satStepRunning); bool isIndividualComputationRunning(); CIncrementalOntologyPrecomputationItem* setIndividualComputationRunning(bool indiCompRunning); CIncrementalOntologyPrecomputationItem* setIndividualPrecomputationCreated(bool initialized); bool hasIndividualPrecomputationCreated(); CIncrementalOntologyPrecomputationItem* setIndividualPrecomputationChecked(bool checked); bool hasIndividualPrecomputationChecked(); bool areAllStepFinished(); bool hasRemainingProcessingRequirements(); CConcreteOntology* getLastConsistentlyTestedVersion(); CIncrementalOntologyPrecomputationItem* setLastConsistentlyTestedVersion(CConcreteOntology* ontology); QSet* getDirectlyChangedIndividualSet(); bool hasDirectlyChangedIndividualsIdentified(); bool setDirectlyChangedIndividualsIdentified(bool identified); cint64 getIncrementalExpansionID(); QTime* getInitializationTime(); // protected methods protected: // protected variables protected: CPrecomputation* mPrecomputation; CConcreteOntology* mLastConsistentlyTestedVersion; QSet mDirectlyChangedIndividualSet; bool mDirectlyChangedIndividualsIdentified; CConsistence* mConsistence; bool mConsistenceCheckCreated; bool mConsistenceCheched; QAtomicPointer mConsData; bool mIndividualTestRunning; bool mIndividualComputationRunning; bool mIndividualPrecomputationCreated; bool mIndividualPrecomputationChecked; CPrecomputationTestingStep* mConsistencePrecomputationStep; CPrecomputationTestingStep* mCyclePrecomputationStep; CPrecomputationTestingStep* mSaturationPrecomputationStep; CPrecomputationTestingStep* mIndividualPrecomputationStep; QList mProcessingSteps; CCalculationConfigurationExtension* mCalculationConfig; QTime mInitTime; // private methods private: // private variables private: }; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CONSISTISER_CIncrementalOntologyPrecomputationItem_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Consistiser/ConsistiserSettings.h0000644000175000017500000000351412520550770026552 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CONSISTISER_CONSISTISERSETTINGS #define KONCLUDE_REASONER_CONSISTISER_CONSISTISERSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Reasoner { namespace Consistiser { /*! * * \file ConsistiserSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CPrecomputationTestingItem; class COntologyPrecomputationItem; // Custom Events >= 2000 const QEvent::Type EVENTPRECOMPUTEONTOLOGY = (QEvent::Type)2000; const QEvent::Type EVENTCALLBACKPRECOMPUTEDONTOLOGY = (QEvent::Type)2001; const QEvent::Type EVENTPRECOMPUTATIONCALCULATEDCALLBACK = (QEvent::Type)2002; const QEvent::Type EVENTSATURATIONCALCULATEDCALLBACK = (QEvent::Type)2003; }; // end namespace Consistiser }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_CONSISTISER_CONSISTISERSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/0000755000175000017500000000000012613407260021657 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/TaxonomySettings.h0000644000175000017500000000261712520551266025400 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_TAXONOMYSETTINGS #define KONCLUDE_REASONER_TAXONOMY_TAXONOMYSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \file TaxonomySettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_TAXONOMY_TAXONOMYSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CEATaxonomyBuilder.h0000644000175000017500000000420212520551262025463 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CEATAXONOMYBUILDER_H #define KONCLUDE_REASONER_TAXONOMY_CEATAXONOMYBUILDER_H // Libraries includes // Namespace includes #include "TaxonomySettings.h" #include "CATaxonomyBuilder.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CEATaxonomyBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CEATaxonomyBuilder : public CATaxonomyBuilder { // public methods public: //! Constructor CEATaxonomyBuilder(); T* setElementNotSubsumption(const E& notSubsumerElement, const E& notSubsumedElement); T* setElementDisjoints(const E& disjointElement1, const E& disjointElement2); virtual T* setNodeNotSubsumption(N* notSubsumerNode, N* notSubsumedNode) = 0; virtual T* setNodeDisjoints(N* disjointNode1, N* disjointNode2) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #include "CEATaxonomyBuilder.cpp" #endif // KONCLUDE_REASONER_TAXONOMY_CEATAXONOMYBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CConceptClassesPCPrTaxonomy.cpp0000644000175000017500000000315112520551262027662 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CCONCEPTCLASSESPCPRTAXONOMY_CPP #define KONCLUDE_REASONER_TAXONOMY_CCONCEPTCLASSESPCPRTAXONOMY_CPP #include "CConceptClassesPCPrTaxonomy.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { template CConceptClassesPCPrTaxonomy::CConceptClassesPCPrTaxonomy(N* topHierarchyNode, N* bottomHierarchyNode) : CPCPrTaxonomy(topHierarchyNode,bottomHierarchyNode) { } template CConceptClassesPCPrTaxonomy::CConceptClassesPCPrTaxonomy(CConcept* topConcept, CConcept* bottomConcept) : CPCPrTaxonomy(topConcept,bottomConcept) { } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CCONCEPTCLASSESPCPRTAXONOMY_CPP Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CLightConceptClassesHierarchyNode.h0000644000175000017500000000374312520551264030511 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CLIGHTCONCEPTCLASSESHIERARCHYNODE_H #define KONCLUDE_REASONER_TAXONOMY_CLIGHTCONCEPTCLASSESHIERARCHYNODE_H // Libraries includes #include #include // Namespace includes #include "TaxonomySettings.h" #include "CConceptClassesPCPrHierarchyNode.h" // Other includes #include "KoncludeSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CLightConceptClassesHierarchyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLightConceptClassesHierarchyNode : public CConceptClassesPCPrHierarchyNode { // public methods public: //! Constructor CLightConceptClassesHierarchyNode(CConcept* representiveConcept); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CLIGHTCONCEPTCLASSESHIERARCHYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CHierarchyNode.cpp0000644000175000017500000003036012520551264025215 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CHierarchyNode.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { CHierarchyNode::CHierarchyNode(CConcept *representiveConcept) { eqConList.append(representiveConcept); eqConCount = 1; active = true; mention = false; #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif } CHierarchyNode::~CHierarchyNode() { } CHierarchyNode *CHierarchyNode::addParentNode(CHierarchyNode *parentNode) { parentNodeSet.insert(parentNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CHierarchyNode::addChildNode(CHierarchyNode *childNode) { childNodeSet.insert(childNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CHierarchyNode::makeParent(CHierarchyNode *parentNode) { addParentNode(parentNode); parentNode->addChildNode(this); makePredecessor(parentNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CHierarchyNode::makeChild(CHierarchyNode *childNode) { childNodeSet.insert(childNode); childNode->addParentNode(this); makeSuccessor(childNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } bool CHierarchyNode::hasChildNode(CHierarchyNode *node) { return childNodeSet.contains(node); } bool CHierarchyNode::hasParentNode(CHierarchyNode *node) { return parentNodeSet.contains(node); } CHierarchyNode *CHierarchyNode::addEquivalentConcept(CConcept *concept) { eqConList.append(concept); eqConCount++; #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CHierarchyNode::addPredecessorNode(CHierarchyNode *preNode) { predNodeSet.insert(preNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CHierarchyNode::addSuccessorNode(CHierarchyNode *succNode) { succNodeSet.insert(succNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CHierarchyNode::makePredecessor(CHierarchyNode *preNode) { predNodeSet.insert(preNode); preNode->addSuccessorNode(this); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CHierarchyNode::makeSuccessor(CHierarchyNode *succNode) { succNodeSet.insert(succNode); succNode->addPredecessorNode(this); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } bool CHierarchyNode::hasSuccessorNode(CHierarchyNode *node) { return succNodeSet.contains(node); } bool CHierarchyNode::hasPredecessorNode(CHierarchyNode *node) { return predNodeSet.contains(node); } CHierarchyNode *CHierarchyNode::removeParent(CHierarchyNode *parentNode) { parentNodeSet.remove(parentNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CHierarchyNode::removeChild(CHierarchyNode *childNode) { childNodeSet.remove(childNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } QSet *CHierarchyNode::getParentNodeSet() { return &parentNodeSet; } QSet *CHierarchyNode::getChildNodeSet() { return &childNodeSet; } QSet *CHierarchyNode::getPredecessorNodeSet() { return &predNodeSet; } QSet *CHierarchyNode::getSuccessorNodeSet() { return &succNodeSet; } QList *CHierarchyNode::getEquivalentConceptList() { return &eqConList; } CHierarchyNode *CHierarchyNode::removePredecessor(CHierarchyNode *predNode) { predNodeSet.remove(predNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CHierarchyNode::removeSuccessor(CHierarchyNode *succNode) { succNodeSet.remove(succNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } QList CHierarchyNode::getParentNodeList() { return parentNodeSet.values(); } QList CHierarchyNode::getChildNodeList() { return childNodeSet.values(); } QList CHierarchyNode::getPredecessorNodeList() { return predNodeSet.values(); } QList CHierarchyNode::getSuccessorNodeList() { return succNodeSet.values(); } CHierarchyNode *CHierarchyNode::addIncompatiblePredecessorNode(CHierarchyNode *incompNode) { incompPredNodeSet.insert(incompNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CHierarchyNode::makeIncompatiblePredecessor(CHierarchyNode *incompNode) { addIncompatiblePredecessorNode(incompNode); incompNode->addIncompatibleSuccessorNode(this); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } bool CHierarchyNode::hasIncompatiblePredecessorNode(CHierarchyNode *node) { return incompPredNodeSet.contains(node); } CHierarchyNode *CHierarchyNode::removeIncompatiblePredecessorNode(CHierarchyNode *incompNode) { incompPredNodeSet.remove(incompNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CHierarchyNode::addIncompatibleSuccessorNode(CHierarchyNode *incompNode) { incompSuccNodeSet.insert(incompNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CHierarchyNode::makeIncompatibleSuccessor(CHierarchyNode *incompNode) { addIncompatibleSuccessorNode(incompNode); incompNode->addIncompatiblePredecessorNode(this); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } bool CHierarchyNode::hasIncompatibleSuccessorNode(CHierarchyNode *node) { return incompSuccNodeSet.contains(node); } CHierarchyNode *CHierarchyNode::removeIncompatibleSuccessorNode(CHierarchyNode *incompNode) { incompSuccNodeSet.remove(incompNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CHierarchyNode::addDisjointNode(CHierarchyNode *disjNode) { disjointNodeSet.insert(disjNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CHierarchyNode::makeDisjoint(CHierarchyNode *disjNode) { addDisjointNode(disjNode); disjNode->addDisjointNode(this); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } bool CHierarchyNode::hasDisjointNode(CHierarchyNode *node) { return disjointNodeSet.contains(node); } CHierarchyNode *CHierarchyNode::removeDisjointNode(CHierarchyNode *disjNode) { disjointNodeSet.remove(disjNode); #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } QSet *CHierarchyNode::getIncompatibleSuccessorNodeSet() { return &incompSuccNodeSet; } QSet *CHierarchyNode::getIncompatiblePredecessorNodeSet() { return &incompPredNodeSet; } QList CHierarchyNode::getIncompatibleSuccessorNodeList() { return incompSuccNodeSet.values(); } QList CHierarchyNode::getIncompatiblePredecessorNodeList() { return incompPredNodeSet.values(); } QSet *CHierarchyNode::getDisjointNodeSet() { return &disjointNodeSet; } QList CHierarchyNode::getDisjointNodeList() { return disjointNodeSet.values(); } CConcept *CHierarchyNode::getOneEquivalentConcept() { CConcept *concept = 0; if (!eqConList.isEmpty()) { concept = eqConList.first(); } return concept; } bool CHierarchyNode::isActive() { return active; } CHierarchyNode *CHierarchyNode::setActive(bool activeNode) { active = activeNode; return this; } CHierarchyNode *CHierarchyNode::setInactive(bool inactiveNode) { active = !inactiveNode; return this; } bool CHierarchyNode::isNeedExplicitMentioned() { return mention; } CHierarchyNode *CHierarchyNode::setNeedExplicitMentioned(bool needsExplicitMentioned) { mention = needsExplicitMentioned; return this; } QString CHierarchyNode::getEquivalentConceptsNodeString() { QString string; foreach (CConcept *con, eqConList) { QString iriClassNameString = CIRIName::getRecentIRIName(con->getClassNameLinker()); if (!string.isEmpty()) { string += QString(" <=> %1").arg(iriClassNameString); } else { string = iriClassNameString; } } return string; } QString CHierarchyNode::getHierarchyConceptsNodeString(qint64 depth) { QString string(depth,'\t'); string += QString("< ") + getEquivalentConceptsNodeString() + QString(" >\n"); foreach (CHierarchyNode *childNode, getChildNodeList()) { string += childNode->getHierarchyConceptsNodeString(depth+1); } string += QString(depth,'\t')+QString("\n"); return string; } QStringList CHierarchyNode::getEquivalentConceptStringList(bool preferAbbreviatedNames) { QStringList stringList; foreach (CConcept *con, eqConList) { QStringList iriClassNameStringList; if (preferAbbreviatedNames) { iriClassNameStringList.append(CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(con->getClassNameLinker())); } if (!preferAbbreviatedNames || iriClassNameStringList.isEmpty()) { iriClassNameStringList.append(CIRIName::getRecentIRIName(con->getClassNameLinker())); } stringList<getEquivalentConceptsNodeString(); } childNodeStrings.clear(); foreach (CHierarchyNode *node, getChildNodeList()) { childNodeStrings<getEquivalentConceptsNodeString(); } precNodeStrings.clear(); foreach (CHierarchyNode *node, getPredecessorNodeList()) { precNodeStrings<getEquivalentConceptsNodeString(); } succNodeStrings.clear(); foreach (CHierarchyNode *node, getSuccessorNodeList()) { succNodeStrings<getEquivalentConceptsNodeString(); } incPrecNodeStrings.clear(); foreach (CHierarchyNode *node, getIncompatiblePredecessorNodeList()) { incPrecNodeStrings<getEquivalentConceptsNodeString(); } incSuccNodeStrings.clear(); foreach (CHierarchyNode *node, getIncompatibleSuccessorNodeList()) { incSuccNodeStrings<getEquivalentConceptsNodeString(); } disjointNodeStrings.clear(); foreach (CHierarchyNode *node, getDisjointNodeList()) { disjointNodeStrings<getEquivalentConceptsNodeString(); } return this; } #endif }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CPCPrHierarchyNode.cpp0000644000175000017500000001267012520551264025746 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CPCPRHIERARCHYNODE_CPP #define KONCLUDE_REASONER_TAXONOMY_CPCPRHIERARCHYNODE_CPP #include "CPCPrHierarchyNode.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { template CPCPrHierarchyNode::CPCPrHierarchyNode(const E &representiveElement) : CAHierarchyNode(representiveElement) { addPredecessorNode(this); } template CPCPrHierarchyNode::~CPCPrHierarchyNode() { } template T* CPCPrHierarchyNode::addParentNode(CPCPrHierarchyNode* parentNode) { parentNodeSet.insert(parentNode); #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS generateNodeRelationStrings(); #endif return (T*)this; } template T* CPCPrHierarchyNode::addChildNode(CPCPrHierarchyNode* childNode) { childNodeSet.insert(childNode); #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS generateNodeRelationStrings(); #endif return (T*)this; } template T* CPCPrHierarchyNode::makeParent(CPCPrHierarchyNode* parentNode) { parentNodeSet.insert(parentNode); parentNode->addChildNode(this); makePredecessor(parentNode); #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS generateNodeRelationStrings(); #endif return (T*)this; } template T* CPCPrHierarchyNode::makeChild(CPCPrHierarchyNode* childNode) { childNodeSet.insert(childNode); childNode->addParentNode(this); #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS generateNodeRelationStrings(); #endif return (T*)this; } template bool CPCPrHierarchyNode::hasChildNode(CPCPrHierarchyNode* node) { return childNodeSet.contains(node); } template bool CPCPrHierarchyNode::hasParentNode(CPCPrHierarchyNode* node) { return parentNodeSet.contains(node); } template T* CPCPrHierarchyNode::addPredecessorNode(CPCPrHierarchyNode* preNode) { predNodeSet.insert(preNode); #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS generateNodeRelationStrings(); #endif return (T*)this; } template T* CPCPrHierarchyNode::makePredecessor(CPCPrHierarchyNode* preNode) { predNodeSet.insert(preNode); #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS generateNodeRelationStrings(); #endif return (T*)this; } template bool CPCPrHierarchyNode::hasPredecessorNode(CPCPrHierarchyNode* node) { return predNodeSet.contains(node); } template T* CPCPrHierarchyNode::removeParent(CPCPrHierarchyNode* parentNode) { parentNodeSet.remove(parentNode); #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS generateNodeRelationStrings(); #endif return (T*)this; } template T* CPCPrHierarchyNode::removeChild(CPCPrHierarchyNode* childNode) { childNodeSet.remove(childNode); #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS generateNodeRelationStrings(); #endif return (T*)this; } template QSet* CPCPrHierarchyNode::getParentNodeSet() { return (QSet* )&parentNodeSet; } template QSet* CPCPrHierarchyNode::getChildNodeSet() { return (QSet* )&childNodeSet; } template QSet* CPCPrHierarchyNode::getPredecessorNodeSet() { return (QSet* )&predNodeSet; } template T* CPCPrHierarchyNode::removePredecessor(CPCPrHierarchyNode* predNode) { predNodeSet.remove(predNode); #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS generateNodeRelationStrings(); #endif return (T*)this; } template QList CPCPrHierarchyNode::getParentNodeList() { QList parentNodeList(parentNodeSet.values()); return (*(QList* )(&parentNodeList)); } template QList CPCPrHierarchyNode::getChildNodeList() { QList childNodeList(childNodeSet.values()); return (*(QList* )(&(childNodeList))); } template QList CPCPrHierarchyNode::getPredecessorNodeList() { QList predNodeList(predNodeSet.values()); return (*(QList* )(&(predNodeList))); } #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS template void CPCPrHierarchyNode::generateNodeRelationStrings() { } #endif }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CPCPRHIERARCHYNODE_CPP Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CTaxonomy.cpp0000644000175000017500000001761612520551264024320 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTaxonomy.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { CTaxonomy::CTaxonomy(CHierarchyNode *topHierarchyNode, CHierarchyNode *bottomHierarchyNode) { topNode = topHierarchyNode; bottomNode = bottomHierarchyNode; topNode->makeChild(bottomNode); nodeContainer.append(topNode); nodeContainer.append(bottomNode); topIsUnsatisfiable = false; foreach (CConcept *con, *topNode->getEquivalentConceptList()) { conNodeHash.insert(con,topNode); } foreach (CConcept *con, *bottomNode->getEquivalentConceptList()) { conNodeHash.insert(con,bottomNode); } taxonomyComplete = false; } CTaxonomy::CTaxonomy(CConcept *topConcept, CConcept *bottomConcept) { topNode = createHierarchyNode(topConcept); bottomNode = createHierarchyNode(bottomConcept); topNode->makeChild(bottomNode); nodeContainer.append(topNode); nodeContainer.append(bottomNode); topIsUnsatisfiable = false; foreach (CConcept *con, *topNode->getEquivalentConceptList()) { conNodeHash.insert(con,topNode); } foreach (CConcept *con, *bottomNode->getEquivalentConceptList()) { conNodeHash.insert(con,bottomNode); } taxonomyComplete = false; } CTaxonomy::~CTaxonomy() { qDeleteAll(nodeContainer); } bool CTaxonomy::isSubsumption(CConcept *subsumerConcept, CConcept *subsumedConcept) { if (topIsUnsatisfiable) { return true; } bool subsumed = false; CHierarchyNode *subsumerNode = conNodeHash.value(subsumerConcept); if (subsumerNode) { CHierarchyNode *subsumedNode = conNodeHash.value(subsumedConcept); if (subsumedNode) { return subsumerNode == subsumedNode || subsumerNode->hasPredecessorNode(subsumedNode); } } return subsumed; } bool CTaxonomy::isSatisfiable(CConcept *concept) { if (topIsUnsatisfiable) { return false; } CHierarchyNode *node = conNodeHash.value(concept); if (node) { if (node == topNode) { return topNode->hasIncompatiblePredecessorNode(bottomNode); } return node != bottomNode; } return false; } bool CTaxonomy::isNotSatisfiable(CConcept *concept) { if (topIsUnsatisfiable) { return true; } CHierarchyNode *node = conNodeHash.value(concept); if (node) { return node == bottomNode; } return false; } bool CTaxonomy::isTopHierarchyNode(CConcept *concept) { if (topIsUnsatisfiable) { return true; } CHierarchyNode *node = conNodeHash.value(concept); if (node) { return node == topNode; } return false; } bool CTaxonomy::isBottomHierarchyNode(CConcept *concept) { if (topIsUnsatisfiable) { return true; } CHierarchyNode *node = conNodeHash.value(concept); if (node) { return node == bottomNode; } return false; } bool CTaxonomy::isEquivalence(CConcept *concept1, CConcept *concept2) { if (topIsUnsatisfiable) { return true; } CHierarchyNode *node1 = conNodeHash.value(concept1); CHierarchyNode *node2 = conNodeHash.value(concept2); if (node1 && node2) { return node1 == node2; } else { return false; } } bool CTaxonomy::isDisjoint(CConcept *disjointConcept1, CConcept *disjointConcept2) { if (topIsUnsatisfiable) { return false; } CHierarchyNode *node1 = conNodeHash.value(disjointConcept1); CHierarchyNode *node2 = conNodeHash.value(disjointConcept2); if (node1 && node2) { if (node1 == node2) { return false; } else { return node1->hasDisjointNode(node2); } } else { return false; } } bool CTaxonomy::isNotDisjoint(CConcept *disjointConcept1, CConcept *disjointConcept2) { if (topIsUnsatisfiable) { return true; } CHierarchyNode *node1 = conNodeHash.value(disjointConcept1); CHierarchyNode *node2 = conNodeHash.value(disjointConcept2); if (node1 && node2) { if (node1 == node2) { return true; } else if (node1->hasPredecessorNode(node2)) { return true; } else if (node2->hasPredecessorNode(node1)) { return true; } } return false; } CHierarchyNode *CTaxonomy::getTopHierarchyNode() { return topNode; } CHierarchyNode *CTaxonomy::getBottomHierarchyNode() { return bottomNode; } CHierarchyNode *CTaxonomy::createHierarchyNode(CConcept *concept) { return new CHierarchyNode(concept); } CHierarchyNode *CTaxonomy::getHierarchyNode(CConcept *concept, bool create) { CHierarchyNode *node = 0; if (concept) { node = conNodeHash.value(concept,0); if (topIsUnsatisfiable) { if (node != bottomNode && (node || create)) { conNodeHash.insert(concept,bottomNode); bottomNode->addEquivalentConcept(concept); } } if (!node && create) { node = createHierarchyNode(concept); conNodeHash.insert(concept,node); nodeContainer.append(node); } } return node; } bool CTaxonomy::hasHierarchyNode(CConcept *concept) { return conNodeHash.contains(concept); } bool CTaxonomy::isNotSubsumption(CConcept *notSubsumerConcept, CConcept *notSubsumedConcept) { if (topIsUnsatisfiable) { return false; } bool notSubsumed = false; CHierarchyNode *notSubsumerNode = conNodeHash.value(notSubsumerConcept); if (notSubsumerNode) { CHierarchyNode *notSubsumedNode = conNodeHash.value(notSubsumedConcept); if (notSubsumedNode) { return notSubsumerNode != notSubsumedNode && notSubsumerNode->hasIncompatiblePredecessorNode(notSubsumedNode); } } return notSubsumed; } QString CTaxonomy::getConceptHierarchyString() { QString string = topNode->getHierarchyConceptsNodeString(0); return string; } bool CTaxonomy::isComplete() { return taxonomyComplete; } CTaxonomy *CTaxonomy::setTaxonomyComplete(bool completed) { taxonomyComplete = completed; return this;; } bool CTaxonomy::isActiveNode(CHierarchyNode *node) { return node->isActive(); } CTaxonomy *CTaxonomy::setActiveNode(CHierarchyNode *node, bool nodeActive) { node->setActive(nodeActive); if (nodeActive) { activeNodeSet.insert(node); } else { activeNodeSet.remove(node); } return this; } CTaxonomy *CTaxonomy::setInactiveNode(CHierarchyNode *node, bool nodeInactive) { node->setInactive(nodeInactive); if (!nodeInactive) { activeNodeSet.insert(node); } else { activeNodeSet.remove(node); } return this; } CHierarchyNode *CTaxonomy::getActiveNode(CHierarchyNode *node) { if (node->isActive()) { return node; } else { CConcept *con = node->getOneEquivalentConcept(); return getHierarchyNode(con,false); } } CTaxonomy *CTaxonomy::updateNodeEquivalences(CHierarchyNode *node) { foreach (CConcept *con, *node->getEquivalentConceptList()) { conNodeHash.insert(con,node); } return this; } QHash* CTaxonomy::getConceptHierarchyNodeHash() { return &conNodeHash; } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CATaxonomy.h0000644000175000017500000000543512520551262024060 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CATAXONOMY_H #define KONCLUDE_REASONER_TAXONOMY_CATAXONOMY_H // Libraries includes // Namespace includes #include "TaxonomySettings.h" #include "CHierarchy.h" #include "CTaxonomy.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CATaxonomy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CATaxonomy : public CHierarchy { // public methods public: //! Constructor CATaxonomy(); virtual N* getTopHierarchyNode() = 0; virtual N* getBottomHierarchyNode() = 0; virtual N* getHierarchyNode(const E& element) = 0; virtual bool hasHierarchyNode(const E& element) = 0; bool isElementSubsumption(const E& subsumerElement, const E& subsumedElement); bool isElementEquivalence(const E& element1, const E& element2); bool isElementSatisfiable(const E& element); bool isElementNotSatisfiable(const E& element); bool isTopHierarchyElement(const E& element); bool isBottomHierarchyElement(const E& element); virtual bool isNodeSubsumption(N* subsumerNode, N* subsumedNode) = 0; virtual bool isNodeEquivalence(N* node1, N* node2) = 0; virtual bool isNodeSatisfiable(N* node) = 0; virtual bool isNodeNotSatisfiable(N* node) = 0; virtual bool isTopHierarchyNode(N* element) = 0; virtual bool isBottomHierarchyNode(N* element) = 0; virtual bool isComplete() = 0; virtual bool isActiveNode(N* node) = 0; virtual N* getActiveNode(N* node) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #include "CATaxonomy.cpp" #endif // KONCLUDE_REASONER_TAXONOMY_CATAXONOMY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CHierarchyDepthTraversalIterator.h0000644000175000017500000000467412520551264030450 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CHIERARCHYDEPTHTRAVERSALITERATOR_H #define KONCLUDE_REASONER_TAXONOMY_CHIERARCHYDEPTHTRAVERSALITERATOR_H // Libraries includes // Namespace includes #include "TaxonomySettings.h" #include "CHierarchyNodeIterator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CHierarchyDepthTraversalIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CHierarchyDepthTraversalIterator { // public methods public: //! Constructor CHierarchyDepthTraversalIterator(); CHierarchyDepthTraversalIterator(N* topNode, N* bottomNode, bool forceUniqueVisit = true); bool hasNextHierarchyNode(); N* nextHierarchyNode(bool moveNext = true); CHierarchyNodeIterator getTraversedParentNodeIterator(); CHierarchyNodeIterator getClosedTraversedNodeIterator(); // protected methods protected: // protected variables protected: bool mUnigueVisit; N* mCurrentNode; QSetIterator mCurrentIterator; N* mTopNode; N* mBottomNode; QSet mUniqueNodeSet; QList mParentNodeList; QList< QSetIterator > mParentNodeIteratorList; QList mClosedNodeBranchesList; // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #include "CHierarchyDepthTraversalIterator.cpp" #endif // KONCLUDE_REASONER_TAXONOMY_CHIERARCHYDEPTHTRAVERSALITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CHierarchyNodeData.cpp0000644000175000017500000000212612520551264026006 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CHierarchyNodeData.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { CHierarchyNodeData::CHierarchyNodeData() { } CHierarchyNodeData::~CHierarchyNodeData() { } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CAHierarchyNode.cpp0000644000175000017500000000722012520551262025313 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CAHIERARCHYNODE_CPP #define KONCLUDE_REASONER_TAXONOMY_CAHIERARCHYNODE_CPP #include "CAHierarchyNode.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { template CAHierarchyNode::CAHierarchyNode(const E &representiveElement) { eqElementList.append(representiveElement); eqElemCount = 1; active = true; mention = false; mNodeData = nullptr; #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS generateNodeElementStrings(); #endif } template CAHierarchyNode::~CAHierarchyNode() { } template T* CAHierarchyNode::addEquivalentElement(const E &element) { eqElementList.append(element); eqElemCount++; #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS generateNodeElementStrings(); #endif return (T*)this; } template QList* CAHierarchyNode::getEquivalentElementList() { return &eqElementList; } template E CAHierarchyNode::getOneEquivalentElement(const E &defaultValue) { E element(defaultValue); if (!eqElementList.isEmpty()) { element = eqElementList.first(); } return element; } template E CAHierarchyNode::getOneEquivalentElement() { return eqElementList.first(); } template bool CAHierarchyNode::isActive() { return active; } template T* CAHierarchyNode::setActive(bool activeNode) { active = activeNode; return (T*)this; } template T* CAHierarchyNode::setInactive(bool inactiveNode) { active = !inactiveNode; return (T*)this; } template bool CAHierarchyNode::isNeedExplicitMentioned() { return mention; } template T* CAHierarchyNode::setNeedExplicitMentioned(bool needsExplicitMentioned) { mention = needsExplicitMentioned; return (T*)this; } template qint64 CAHierarchyNode::getEquivalentElementCount() { return eqElemCount; } template CHierarchyNodeData* CAHierarchyNode::getNodeData() { return mNodeData; } template bool CAHierarchyNode::hasNodeData() { return mNodeData != nullptr; } #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS template void CAHierarchyNode::generateNodeElementStrings() { } #endif template CHierarchyNodeData* CAHierarchyNode::setNodeData(CHierarchyNodeData* nodeData) { CHierarchyNodeData* tmpData = nodeData; mNodeData = nodeData; return tmpData; } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CAHIERARCHYNODE_CPP Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CEATaxonomy.cpp0000644000175000017500000000460012520551262024511 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CEATAXONOMY_CPP #define KONCLUDE_REASONER_TAXONOMY_CEATAXONOMY_CPP #include "CEATaxonomy.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { template CEATaxonomy::CEATaxonomy() { } template bool CEATaxonomy::isElementDisjoint(const E& disjointElement1, const E& disjointElement2) { N* node1 = getHierarchyNode(disjointElement1); if (!node1) { return false; } N* node2 = getHierarchyNode(disjointElement2); if (!node2) { return false; } return isNodeDisjoint(node1,node2); } template bool CEATaxonomy::isElementNotDisjoint(const E& disjointElement1, const E& disjointElement2) { N* node1 = getHierarchyNode(disjointElement1); if (!node1) { return false; } N* node2 = getHierarchyNode(disjointElement2); if (!node2) { return false; } return isNodeNotDisjoint(node1,node2); } template bool CEATaxonomy::isElementNotSubsumption(const E& notSubsumerElement, const E& notSubsumedElement) { N* subsumerNode = getHierarchyNode(notSubsumerElement); if (!subsumerNode) { return false; } N* subsumedNode = getHierarchyNode(notSubsumedElement); if (!subsumedNode) { return false; } return isNodeNotSubsumption(subsumerNode,subsumedNode); } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CEATAXONOMY_CPP Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CConceptClassesPCPrHierarchyNode.cpp0000644000175000017500000001227212520551262030574 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CCONCEPTCLASSESPCPRHIERARCHYNODE_CPP #define KONCLUDE_REASONER_TAXONOMY_CCONCEPTCLASSESPCPRHIERARCHYNODE_CPP #include "CConceptClassesPCPrHierarchyNode.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { template CConceptClassesPCPrHierarchyNode::CConceptClassesPCPrHierarchyNode(CConcept* representiveConcept) : CPCPrHierarchyNode(representiveConcept) { } template T* CConceptClassesPCPrHierarchyNode::addEquivalentConcept(CConcept* concept) { CPCPrHierarchyNode::addEquivalentElement(concept); return (T*)this; } template QList* CConceptClassesPCPrHierarchyNode::getEquivalentConceptList() { return CPCPrHierarchyNode::getEquivalentElementList(); } template CConcept* CConceptClassesPCPrHierarchyNode::getOneEquivalentConcept() { return CPCPrHierarchyNode::getOneEquivalentElement(0); } template qint64 CConceptClassesPCPrHierarchyNode::getEquivalentConceptCount() { return CPCPrHierarchyNode::getEquivalentElementCount(); } template QString CConceptClassesPCPrHierarchyNode::getEquivalentConceptsNodeString() { QString string; QList* eqList = CPCPrHierarchyNode::getEquivalentElementList(); for (typename QList::const_iterator it = eqList->constBegin(), itEnd = eqList->constEnd(); it != itEnd; ++it) { CConcept* con = *it; QString iriClassNameString = CIRIName::getRecentIRIName(con->getClassNameLinker()); if (!string.isEmpty()) { string += QString(" <=> %1").arg(iriClassNameString); } else { string = iriClassNameString; } } return string; } template QString CConceptClassesPCPrHierarchyNode::getHierarchyConceptsNodeString(qint64 depth) { QString string(depth,'\t'); string += QString("< ") + CPCPrHierarchyNode::getEquivalentConceptsNodeString() + QString(" >\n"); QSet* childNodeSet = CPCPrHierarchyNode::getChildNodeSet(); for (typename QSet::const_iterator it = childNodeSet->constBegin(), itEnd = childNodeSet->constEnd(); it != itEnd; ++it) { CConceptClassesPCPrHierarchyNode* childNode = *it; string += childNode->getHierarchyConceptsNodeString(depth+1); } string += QString(depth,'\t')+QString("\n"); return string; } template QStringList CConceptClassesPCPrHierarchyNode::getEquivalentConceptStringList(bool preferAbbreviatedNames) { QStringList stringList; QList* eqList = CPCPrHierarchyNode::getEquivalentElementList(); for (typename QList::const_iterator it = eqList->constBegin(), itEnd = eqList->constEnd(); it != itEnd; ++it) { CConcept* con = *it; QStringList iriClassNameStringList; if (preferAbbreviatedNames) { iriClassNameStringList = CAbbreviatedIRIName::getAbbreviatedPrefixWithAbbreviatedIRINames(con->getClassNameLinker()); } if (!preferAbbreviatedNames || iriClassNameStringList.isEmpty()) { iriClassNameStringList = CIRIName::getIRINames(con->getClassNameLinker()); } stringList< void CConceptClassesPCPrHierarchyNode::generateNodeRelationStrings() { parentNodeStrings.clear(); foreach (CConceptClassesPCPrHierarchyNode* node, getParentNodeList()) { parentNodeStrings<getEquivalentConceptsNodeString(); } childNodeStrings.clear(); foreach (CConceptClassesPCPrHierarchyNode* node, getChildNodeList()) { childNodeStrings<getEquivalentConceptsNodeString(); } precNodeStrings.clear(); foreach (CConceptClassesPCPrHierarchyNode* node, getPredecessorNodeList()) { precNodeStrings<getEquivalentConceptsNodeString(); } } #endif #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS template void CConceptClassesPCPrHierarchyNode::generateNodeElementStrings() { nodeStrings.clear(); nodeStrings = getEquivalentConceptStringList(true); } #endif }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CCONCEPTCLASSESPCPRHIERARCHYNODE_CPP Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CConceptPCPrHierarchyNode.h0000644000175000017500000000541412405707550026730 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CCONCEPTPCPRHIERARCHYNODE_H #define KONCLUDE_REASONER_TAXONOMY_CCONCEPTPCPRHIERARCHYNODE_H // Qt includes #include // Namespace includes #include "TaxonomySettings.h" #include "CPCPrHierarchyNode.h" // Other includes #include "KoncludeSettings.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CAbbreviatedIRIName.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CConceptPCPrHierarchyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptPCPrHierarchyNode : public CPCPrHierarchyNode { // public methods public: //! Constructor CConceptPCPrHierarchyNode(CConcept *representiveConcept); //! Deconstructor virtual ~CConceptPCPrHierarchyNode(); virtual CConceptPCPrHierarchyNode *addEquivalentConcept(CConcept *concept); virtual QList *getEquivalentConceptList(); virtual CConcept *getOneEquivalentConcept(); virtual QString getEquivalentConceptsNodeString(); virtual QString getHierarchyConceptsNodeString(qint64 depth); virtual QStringList getEquivalentConceptStringList(bool preferAbbreviatedNames); virtual qint64 getEquivalentConceptCount(); // protected methods protected: #ifdef DEBUGCPCPRHIERARCHYNODEELEMENTSTRINGS virtual CConceptPCPrHierarchyNode *generateNodeStrings(); #endif // protected variables protected: #ifdef DEBUGCPCPRHIERARCHYNODEELEMENTSTRINGS QStringList nodeStrings; QStringList parentNodeStrings; QStringList childNodeStrings; QStringList precNodeStrings; #endif // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CCONCEPTPCPRHIERARCHYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CPCPrTaxonomy.h0000644000175000017500000000717312520551264024507 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CPCPRTAXONOMY_H #define KONCLUDE_REASONER_TAXONOMY_CPCPRTAXONOMY_H // Libraries includes // Namespace includes #include "TaxonomySettings.h" #include "CATaxonomy.h" #include "CATaxonomyBuilder.h" #include "CPCPrHierarchyNode.h" #include "CHierarchyDepthTraversalIterator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CPCPrTaxonomy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CPCPrTaxonomy : public CATaxonomy, public CATaxonomyBuilder { // public methods public: //! Constructor CPCPrTaxonomy(); CPCPrTaxonomy(N* topHierarchyNode, N* bottomHierarchyNode); CPCPrTaxonomy(const E& topElement, const E& bottomElement); //! Destructor virtual ~CPCPrTaxonomy(); T* initTaxonomy(const E& topElement, const E& bottomElement); virtual N* getTopHierarchyNode(); virtual N* getBottomHierarchyNode(); virtual N* getHierarchyNode(const E& element); virtual N* getHierarchyNode(const E& element, bool create); virtual bool hasHierarchyNode(const E& element); virtual bool isComplete(); virtual bool isNodeSubsumption(N* subsumerNode, N* subsumedNode); virtual bool isNodeEquivalence(N* node1, N* node2); virtual bool isNodeSatisfiable(N* node); virtual bool isNodeNotSatisfiable(N* node); virtual bool isTopHierarchyNode(N* node); virtual bool isBottomHierarchyNode(N* node); virtual T* setTaxonomyComplete(bool completed = true); virtual bool isActiveNode(N* node); virtual T* setActiveNode(N* node, bool nodeActive = true); virtual T* setInactiveNode(N* node, bool nodeInactive = true); virtual N* getActiveNode(N* node); virtual T* setNodeSatisfiable(N* node); virtual T* setNodeUnsatisfiable(N* node); virtual T* setNodeSubsumption(N* subsumerNode, N* subsumedNode); virtual T* setNodeEquivalence(N* eqNode1, N* eqNode2); virtual CHierarchyDepthTraversalIterator getDepthTraversalIterator(bool forceUnique = true); // protected methods protected: N* createHierarchyNode(const E& element); bool repairedParentNodeInsertion(N* node, N* insertParentNode); bool repairInsertion(N* node, N* insertParentNode); // protected variables protected: QHash elmNodeHash; N* topNode; N* bottomNode; bool taxonomyComplete; QList nodeContainer; // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #include "CPCPrTaxonomy.cpp" #endif // KONCLUDE_REASONER_TAXONOMY_CPCPRTAXONOMY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CLightConceptClassesTaxonomy.cpp0000644000175000017500000000303212520551264030125 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLightConceptClassesTaxonomy.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { CLightConceptClassesTaxonomy::CLightConceptClassesTaxonomy(CLightConceptClassesHierarchyNode* topHierarchyNode, CLightConceptClassesHierarchyNode* bottomHierarchyNode) : CConceptClassesPCPrTaxonomy(topHierarchyNode,bottomHierarchyNode) { } CLightConceptClassesTaxonomy::CLightConceptClassesTaxonomy(CConcept* topConcept, CConcept* bottomConcept) : CConceptClassesPCPrTaxonomy(topConcept,bottomConcept) { } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CHierarchyNodeIterator.cpp0000644000175000017500000000430712520551264026731 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CHIERARCHYNODEITERATOR_CPP #define KONCLUDE_REASONER_TAXONOMY_CHIERARCHYNODEITERATOR_CPP #include "CHierarchyNodeIterator.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { template CHierarchyNodeIterator::CHierarchyNodeIterator(QList* nodeList, bool backwardIterating) : mListIterator(*nodeList) { mNodeList = nodeList; mBackwardIterating = backwardIterating; if (mBackwardIterating) { mListIterator.toBack(); } } template bool CHierarchyNodeIterator::hasNextHierarchyNode() { if (mNodeList && (!mBackwardIterating && mListIterator.hasNext()) || (mBackwardIterating && mListIterator.hasPrevious())) { return true; } return false; } template N* CHierarchyNodeIterator::nextHierarchyNode(bool moveNext) { N* node = nullptr; if (!mBackwardIterating) { if (mNodeList && mListIterator.hasNext()) { node = mListIterator.peekNext(); if (moveNext) { mListIterator.next(); } } } else { if (mNodeList && mListIterator.hasPrevious()) { node = mListIterator.peekPrevious(); if (moveNext) { mListIterator.previous(); } } } return node; } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CHIERARCHYNODEITERATOR_CPP Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CEATaxonomyBuilder.cpp0000644000175000017500000000365612520551262026032 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CEATAXONOMYBUILDER_CPP #define KONCLUDE_REASONER_TAXONOMY_CEATAXONOMYBUILDER_CPP #include "CEATaxonomyBuilder.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { template CEATaxonomyBuilder::CEATaxonomyBuilder() { } template T* CEATaxonomyBuilder::setElementNotSubsumption(const E& notSubsumerElement, const E& notSubsumedElement) { N* notSubsumerNode = getHierarchyNode(notSubsumerElement,true); N* notSubsumedNode = getHierarchyNode(notSubsumedElement,true); return setNodeNotSubsumption(notSubsumerNode,notSubsumedNode); } template T* CEATaxonomyBuilder::setElementDisjoints(const E& disjointElement1, const E& disjointElement2) { N* dis1Node = getHierarchyNode(disjointElement1,true); N* dis2Node = getHierarchyNode(disjointElement2,true); return setNodeDisjoints(dis1Node,dis2Node); } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CEATAXONOMYBUILDER_CPP Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CConceptClassesPCPrTaxonomy.h0000644000175000017500000000402712520551262027332 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CCONCEPTCLASSESPCPRTAXONOMY_H #define KONCLUDE_REASONER_TAXONOMY_CCONCEPTCLASSESPCPRTAXONOMY_H // Libraries includes // Namespace includes #include "TaxonomySettings.h" #include "CPCPrTaxonomy.h" #include "CConceptClassesPCPrHierarchyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CConceptClassesPCPrTaxonomy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CConceptClassesPCPrTaxonomy : public CPCPrTaxonomy { // public methods public: //! Constructor CConceptClassesPCPrTaxonomy(N* topHierarchyNode, N* bottomHierarchyNode); CConceptClassesPCPrTaxonomy(CConcept* topConcept, CConcept* bottomConcept); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #include "CConceptClassesPCPrTaxonomy.cpp" #endif // KONCLUDE_REASONER_TAXONOMY_CCONCEPTCLASSESPCPRTAXONOMY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CHierarchyNodeIterator.h0000644000175000017500000000401412520551264026371 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CHIERARCHYNODEITERATOR_H #define KONCLUDE_REASONER_TAXONOMY_CHIERARCHYNODEITERATOR_H // Libraries includes #include #include // Namespace includes #include "TaxonomySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CHierarchyNodeIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CHierarchyNodeIterator { // public methods public: //! Constructor CHierarchyNodeIterator(QList* nodeList, bool backwardIterating = false); bool hasNextHierarchyNode(); N* nextHierarchyNode(bool moveNext = true); // protected methods protected: // protected variables protected: QList* mNodeList; QListIterator mListIterator; bool mBackwardIterating; // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #include "CHierarchyNodeIterator.cpp" #endif // KONCLUDE_REASONER_TAXONOMY_CHIERARCHYNODEITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CAHierarchyNode.h0000644000175000017500000000552612520551262024767 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CAHIERARCHYNODE_H #define KONCLUDE_REASONER_TAXONOMY_CAHIERARCHYNODE_H // Libraries includes #include #include // Namespace includes #include "TaxonomySettings.h" #include "CHierarchyNodeData.h" // Other includes #include "KoncludeSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { #ifndef KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED //#define DEBUGHIERARCHYNODEELEMENTSTRINGS #endif /*! * * \class CAHierarchyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CAHierarchyNode { // public methods public: //! Constructor CAHierarchyNode(const E &representiveElement); //! Destructor ~CAHierarchyNode(); T* addEquivalentElement(const E &element); QList* getEquivalentElementList(); E getOneEquivalentElement(const E &defaultValue); E getOneEquivalentElement(); qint64 getEquivalentElementCount(); bool isActive(); T* setActive(bool activeNode = true); T* setInactive(bool inactiveNode = true); bool isNeedExplicitMentioned(); T* setNeedExplicitMentioned(bool needsExplicitMentioned = true); bool hasNodeData(); CHierarchyNodeData* getNodeData(); CHierarchyNodeData* setNodeData(CHierarchyNodeData* nodeData); // protected methods protected: #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS virtual void generateNodeElementStrings(); #endif // protected variables protected: #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS QStringList nodeStrings; #endif QList eqElementList; qint64 eqElemCount; bool active; bool mention; CHierarchyNodeData* mNodeData; // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #include "CAHierarchyNode.cpp" #endif // KONCLUDE_REASONER_TAXONOMY_CAHIERARCHYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/COntologyTaxonomy.h0000644000175000017500000000350512520551264025510 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CONTOLOGYTAXONOMY_H #define KONCLUDE_REASONER_TAXONOMY_CONTOLOGYTAXONOMY_H // Libraries includes // Namespace includes #include "TaxonomySettings.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Taxonomy { /*! * * \class COntologyTaxonomy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyTaxonomy { // public methods public: //! Constructor COntologyTaxonomy(); //! Destructor virtual ~COntologyTaxonomy(); // protected methods protected: // protected variables protected: CConcreteOntology *onto; // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CONTOLOGYTAXONOMY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CATaxonomyBuilder.h0000644000175000017500000000537612520551262025373 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CATAXONOMYBUILDER_H #define KONCLUDE_REASONER_TAXONOMY_CATAXONOMYBUILDER_H // Libraries includes // Namespace includes #include "TaxonomySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CATaxonomyBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CATaxonomyBuilder { // public methods public: //! Constructor CATaxonomyBuilder(); virtual N* getTopHierarchyNode() = 0; virtual N* getBottomHierarchyNode() = 0; virtual N* getHierarchyNode(const E& element, bool create) = 0; virtual bool hasHierarchyNode(const E& element) = 0; T* setElementSatisfiable(const E& element, bool satisfiable); T* setElementSatisfiable(const E& element); T* setElementUnsatisfiable(const E& element); T* setElementSubsumption(const E& subsumerElement, const E& subsumedElement); T* setElementEquivalence(const E& element1, const E& element2); T* setNodeSatisfiable(N* node, bool satisfiable); virtual T* setNodeSatisfiable(N* node) = 0; virtual T* setNodeUnsatisfiable(N* node) = 0; virtual T* setNodeSubsumption(N* subsumerNode, N* subsumedNode) = 0; virtual T* setNodeEquivalence(N* eqNode1, N* eqNode2) = 0; virtual T* setTaxonomyComplete(bool completed = true) = 0; virtual T* setActiveNode(N* node, bool nodeActive = true) = 0; virtual T* setInactiveNode(N* node, bool nodeInactive = true) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #include "CATaxonomyBuilder.cpp" #endif // KONCLUDE_REASONER_TAXONOMY_CATAXONOMYBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CPCPrSuIpIsDiHierarchyNode.h0000644000175000017500000001654312405707550026773 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CPCPrSuIpIsDiHierarchyNode_H #define KONCLUDE_REASONER_TAXONOMY_CPCPrSuIpIsDiHierarchyNode_H // Qt includes #include // Namespace includes #include "TaxonomySettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CAbbreviatedIRIName.h" #include "KoncludeSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { #ifndef KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED #define DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS #endif /*! * * \class CPCPrSuIpIsDiHierarchyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPCPrSuIpIsDiHierarchyNode { // public methods public: //! Constructor CPCPrSuIpIsDiHierarchyNode(CConcept *representiveConcept); //! Deconstructor virtual ~CPCPrSuIpIsDiHierarchyNode(); virtual CPCPrSuIpIsDiHierarchyNode *addParentNode(CPCPrSuIpIsDiHierarchyNode *parentNode); virtual CPCPrSuIpIsDiHierarchyNode *addChildNode(CPCPrSuIpIsDiHierarchyNode *childNode); virtual CPCPrSuIpIsDiHierarchyNode *makeParent(CPCPrSuIpIsDiHierarchyNode *parentNode); virtual CPCPrSuIpIsDiHierarchyNode *makeChild(CPCPrSuIpIsDiHierarchyNode *childNode); virtual CPCPrSuIpIsDiHierarchyNode *addEquivalentConcept(CConcept *concept); virtual bool hasChildNode(CPCPrSuIpIsDiHierarchyNode *node); virtual bool hasParentNode(CPCPrSuIpIsDiHierarchyNode *node); virtual CPCPrSuIpIsDiHierarchyNode *addPredecessorNode(CPCPrSuIpIsDiHierarchyNode *preNode); virtual CPCPrSuIpIsDiHierarchyNode *addSuccessorNode(CPCPrSuIpIsDiHierarchyNode *succNode); virtual CPCPrSuIpIsDiHierarchyNode *makePredecessor(CPCPrSuIpIsDiHierarchyNode *parentNode); virtual CPCPrSuIpIsDiHierarchyNode *makeSuccessor(CPCPrSuIpIsDiHierarchyNode *childNode); virtual bool hasSuccessorNode(CPCPrSuIpIsDiHierarchyNode *node); virtual bool hasPredecessorNode(CPCPrSuIpIsDiHierarchyNode *node); virtual CPCPrSuIpIsDiHierarchyNode *removeParent(CPCPrSuIpIsDiHierarchyNode *parentNode); virtual CPCPrSuIpIsDiHierarchyNode *removeChild(CPCPrSuIpIsDiHierarchyNode *childNode); virtual CPCPrSuIpIsDiHierarchyNode *removePredecessor(CPCPrSuIpIsDiHierarchyNode *predNode); virtual CPCPrSuIpIsDiHierarchyNode *removeSuccessor(CPCPrSuIpIsDiHierarchyNode *succNode); virtual QSet *getParentNodeSet(); virtual QSet *getChildNodeSet(); virtual QSet *getPredecessorNodeSet(); virtual QSet *getSuccessorNodeSet(); virtual QList *getEquivalentConceptList(); virtual QList getParentNodeList(); virtual QList getChildNodeList(); virtual QList getPredecessorNodeList(); virtual QList getSuccessorNodeList(); virtual CPCPrSuIpIsDiHierarchyNode *addIncompatiblePredecessorNode(CPCPrSuIpIsDiHierarchyNode *incompNode); virtual CPCPrSuIpIsDiHierarchyNode *makeIncompatiblePredecessor(CPCPrSuIpIsDiHierarchyNode *incompNode); virtual bool hasIncompatiblePredecessorNode(CPCPrSuIpIsDiHierarchyNode *node); virtual CPCPrSuIpIsDiHierarchyNode *removeIncompatiblePredecessorNode(CPCPrSuIpIsDiHierarchyNode *incompNode); virtual CPCPrSuIpIsDiHierarchyNode *addDisjointNode(CPCPrSuIpIsDiHierarchyNode *disjNode); virtual CPCPrSuIpIsDiHierarchyNode *makeDisjoint(CPCPrSuIpIsDiHierarchyNode *disjNode); virtual bool hasDisjointNode(CPCPrSuIpIsDiHierarchyNode *node); virtual CPCPrSuIpIsDiHierarchyNode *removeDisjointNode(CPCPrSuIpIsDiHierarchyNode *disjNode); virtual CPCPrSuIpIsDiHierarchyNode *addIncompatibleSuccessorNode(CPCPrSuIpIsDiHierarchyNode *incompNode); virtual CPCPrSuIpIsDiHierarchyNode *makeIncompatibleSuccessor(CPCPrSuIpIsDiHierarchyNode *incompNode); virtual bool hasIncompatibleSuccessorNode(CPCPrSuIpIsDiHierarchyNode *node); virtual CPCPrSuIpIsDiHierarchyNode *removeIncompatibleSuccessorNode(CPCPrSuIpIsDiHierarchyNode *incompNode); virtual QSet *getIncompatibleSuccessorNodeSet(); virtual QSet *getIncompatiblePredecessorNodeSet(); virtual QList getIncompatibleSuccessorNodeList(); virtual QList getIncompatiblePredecessorNodeList(); virtual QSet *getDisjointNodeSet(); virtual QList getDisjointNodeList(); virtual CConcept *getOneEquivalentConcept(); virtual QString getEquivalentConceptsNodeString(); virtual QString getHierarchyConceptsNodeString(qint64 depth); virtual QStringList getEquivalentConceptStringList(bool preferAbbreviatedNames); virtual qint64 getEquivalentConceptCount(); virtual bool isActive(); virtual CPCPrSuIpIsDiHierarchyNode *setActive(bool activeNode = true); virtual CPCPrSuIpIsDiHierarchyNode *setInactive(bool inactiveNode = true); virtual bool isNeedExplicitMentioned(); virtual CPCPrSuIpIsDiHierarchyNode *setNeedExplicitMentioned(bool needsExplicitMentioned = true); // protected methods protected: #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS virtual CPCPrSuIpIsDiHierarchyNode *generateNodeStrings(); #endif // protected variables protected: #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS QStringList nodeStrings; QStringList parentNodeStrings; QStringList childNodeStrings; QStringList precNodeStrings; QStringList succNodeStrings; QStringList incPrecNodeStrings; QStringList incSuccNodeStrings; QStringList disjointNodeStrings; #endif QList eqConList; qint64 eqConCount; bool active; bool mention; QSet parentNodeSet; QSet childNodeSet; QSet predNodeSet; QSet succNodeSet; QSet incompPredNodeSet; QSet incompSuccNodeSet; QSet disjointNodeSet; // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CPCPrSuIpIsDiHierarchyNode_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CHierarchy.h0000644000175000017500000000325112520551262024051 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CHIERARCHY_H #define KONCLUDE_REASONER_TAXONOMY_CHIERARCHY_H // Libraries includes // Namespace includes #include "TaxonomySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CHierarchy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CHierarchy { // public methods public: //! Constructor CHierarchy(); //! Destructor virtual ~CHierarchy(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CHIERARCHY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CConceptClassesPCPrHierarchyNode.h0000644000175000017500000000515512520551262030243 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CCONCEPTCLASSESPCPRHIERARCHYNODE_H #define KONCLUDE_REASONER_TAXONOMY_CCONCEPTCLASSESPCPRHIERARCHYNODE_H // Libraries includes #include #include // Namespace includes #include "TaxonomySettings.h" #include "CPCPrHierarchyNode.h" // Other includes #include "KoncludeSettings.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CAbbreviatedIRIName.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Taxonomy { /*! * * \class CConceptClassesPCPrHierarchyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CConceptClassesPCPrHierarchyNode : public CPCPrHierarchyNode { // public methods public: //! Constructor CConceptClassesPCPrHierarchyNode(CConcept* representiveConcept); T* addEquivalentConcept(CConcept* concept); QList* getEquivalentConceptList(); CConcept* getOneEquivalentConcept(); QString getEquivalentConceptsNodeString(); QString getHierarchyConceptsNodeString(qint64 depth); QStringList getEquivalentConceptStringList(bool preferAbbreviatedNames); qint64 getEquivalentConceptCount(); // protected methods protected: #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS virtual void generateNodeRelationStrings(); virtual void generateNodeElementStrings(); #endif // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #include "CConceptClassesPCPrHierarchyNode.cpp" #endif // KONCLUDE_REASONER_TAXONOMY_CCONCEPTCLASSESPCPRHIERARCHYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CPCPrHierarchyNode.h0000644000175000017500000000626012520551264025411 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CPCPRHIERARCHYNODE_H #define KONCLUDE_REASONER_TAXONOMY_CPCPRHIERARCHYNODE_H // Libraries includes #include // Namespace includes #include "TaxonomySettings.h" #include "CHierarchyNodeData.h" #include "CAHierarchyNode.h" // Other includes #include "KoncludeSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CPCPrHierarchyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CPCPrHierarchyNode : public CAHierarchyNode { // public methods public: //! Constructor CPCPrHierarchyNode(const E &representiveElement); //! Destructor ~CPCPrHierarchyNode(); T* addParentNode(CPCPrHierarchyNode* parentNode); T* addChildNode(CPCPrHierarchyNode* childNode); T* makeParent(CPCPrHierarchyNode* parentNode); T* makeChild(CPCPrHierarchyNode* childNode); bool hasChildNode(CPCPrHierarchyNode* node); bool hasParentNode(CPCPrHierarchyNode* node); T* addPredecessorNode(CPCPrHierarchyNode* preNode); T* makePredecessor(CPCPrHierarchyNode* parentNode); bool hasPredecessorNode(CPCPrHierarchyNode* node); T* removeParent(CPCPrHierarchyNode* parentNode); T* removeChild(CPCPrHierarchyNode* childNode); T* removePredecessor(CPCPrHierarchyNode* predNode); QSet* getParentNodeSet(); QSet* getChildNodeSet(); QSet* getPredecessorNodeSet(); QList getParentNodeList(); QList getChildNodeList(); QList getPredecessorNodeList(); // protected methods protected: #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS virtual void generateNodeRelationStrings(); #endif // protected variables protected: #ifdef DEBUGHIERARCHYNODEELEMENTSTRINGS QStringList parentNodeStrings; QStringList childNodeStrings; QStringList precNodeStrings; #endif QSet parentNodeSet; QSet childNodeSet; QSet predNodeSet; // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #include "CPCPrHierarchyNode.cpp" #endif // KONCLUDE_REASONER_TAXONOMY_CPCPRHIERARCHYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CHierarchyDepthTraversalIterator.cpp0000644000175000017500000001201512520551264030767 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CHIERARCHYDEPTHTRAVERSALITERATOR_CPP #define KONCLUDE_REASONER_TAXONOMY_CHIERARCHYDEPTHTRAVERSALITERATOR_CPP #include "CHierarchyDepthTraversalIterator.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { template CHierarchyDepthTraversalIterator::CHierarchyDepthTraversalIterator() : mCurrentIterator(QSet()) { mTopNode = nullptr; mBottomNode = nullptr; mUnigueVisit = false; mCurrentNode = nullptr; } template CHierarchyDepthTraversalIterator::CHierarchyDepthTraversalIterator(N* topNode, N* bottomNode, bool forceUniqueVisit) : mCurrentIterator(*topNode->getChildNodeSet()) { mTopNode = topNode; mBottomNode = bottomNode; mUnigueVisit = forceUniqueVisit; mCurrentNode = topNode; mUniqueNodeSet.insert(mBottomNode); } template bool CHierarchyDepthTraversalIterator::hasNextHierarchyNode() { if (mCurrentIterator.hasNext()) { QSetIterator tmpIterator(mCurrentIterator); while (tmpIterator.hasNext()) { N* nextNode = tmpIterator.next(); if (!mUniqueNodeSet.contains(nextNode)) { return true; } } } for (typename QList< QSetIterator >::const_iterator it = mParentNodeIteratorList.constBegin(), itEnd = mParentNodeIteratorList.constEnd(); it != itEnd; ++it) { QSetIterator prevIt(*it); QSetIterator tmpIterator(prevIt); while (tmpIterator.hasNext()) { N* nextNode = tmpIterator.next(); if (!mUniqueNodeSet.contains(nextNode)) { return true; } } } return false; } template N* CHierarchyDepthTraversalIterator::nextHierarchyNode(bool moveNext) { N* node = nullptr; if (mCurrentIterator.hasNext()) { node = mCurrentIterator.peekNext(); while (node && mUniqueNodeSet.contains(node)) { mCurrentIterator.next(); if (mCurrentIterator.hasNext()) { node = mCurrentIterator.peekNext(); } else { node = nullptr; } } if (moveNext && node) { mCurrentIterator.next(); mParentNodeList.append(mCurrentNode); mParentNodeIteratorList.append(mCurrentIterator); mCurrentNode = node; mCurrentIterator = QSetIterator(*node->getChildNodeSet()); } } if (!node) { QListIterator lastNodeIt(mParentNodeList); lastNodeIt.toBack(); QListIterator< QSetIterator > lastIteratorIt(mParentNodeIteratorList); lastIteratorIt.toBack(); while (!node && lastNodeIt.hasPrevious()) { N* lastNode = lastNodeIt.previous(); QSetIterator lastIterator = lastIteratorIt.previous(); if (lastIterator.hasNext()) { node = lastIterator.peekNext(); while (node && mUniqueNodeSet.contains(node)) { lastIterator.next(); if (lastIterator.hasNext()) { node = lastIterator.peekNext(); } else { node = nullptr; } } } if (moveNext && node) { mClosedNodeBranchesList.append(mCurrentNode); QListIterator lastNodeRemIt(mParentNodeList); lastNodeRemIt.toBack(); while (lastNodeRemIt.previous() != lastNode) { mClosedNodeBranchesList.append(mParentNodeList.takeLast()); mParentNodeIteratorList.removeLast(); } mParentNodeList.removeLast(); mParentNodeIteratorList.removeLast(); lastIterator.next(); mParentNodeList.append(lastNode); mParentNodeIteratorList.append(lastIterator); mCurrentNode = node; mCurrentIterator = QSetIterator(*node->getChildNodeSet()); } } } if (node && mUnigueVisit) { mUniqueNodeSet.insert(node); } return node; } template CHierarchyNodeIterator CHierarchyDepthTraversalIterator::getTraversedParentNodeIterator() { return CHierarchyNodeIterator(&mParentNodeList,true); } template CHierarchyNodeIterator CHierarchyDepthTraversalIterator::getClosedTraversedNodeIterator() { return CHierarchyNodeIterator(&mClosedNodeBranchesList,true); } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CHIERARCHYDEPTHTRAVERSALITERATOR_CPP Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CPCPrTaxonomy.cpp0000644000175000017500000003174112520551264025040 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CPCPRTAXONOMY_CPP #define KONCLUDE_REASONER_TAXONOMY_CPCPRTAXONOMY_CPP #include "CPCPrTaxonomy.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { template CPCPrTaxonomy::CPCPrTaxonomy() { topNode = nullptr; bottomNode = nullptr; taxonomyComplete = false; } template CPCPrTaxonomy::CPCPrTaxonomy(N* topHierarchyNode, N* bottomHierarchyNode) { topNode = topHierarchyNode; bottomNode = bottomHierarchyNode; nodeContainer.append(topNode); nodeContainer.append(bottomNode); bottomNode->makeParent(topNode); taxonomyComplete = false; } template CPCPrTaxonomy::CPCPrTaxonomy(const E& topElement, const E& bottomElement) { topNode = createHierarchyNode(topElement); bottomNode = createHierarchyNode(bottomElement); bottomNode->makeParent(topNode); taxonomyComplete = false; } template T* CPCPrTaxonomy::initTaxonomy(const E& topElement, const E& bottomElement) { qDeleteAll(nodeContainer); nodeContainer.clear(); elmNodeHash.clear(); topNode = createHierarchyNode(topElement); bottomNode = createHierarchyNode(bottomElement); bottomNode->makeParent(topNode); taxonomyComplete = false; return (T*)this; } template CPCPrTaxonomy::~CPCPrTaxonomy() { qDeleteAll(nodeContainer); } template N* CPCPrTaxonomy::createHierarchyNode(const E& element) { N* node = new N(element); nodeContainer.append(node); elmNodeHash.insert(element,node); return node; } template N* CPCPrTaxonomy::getTopHierarchyNode() { return topNode; } template N* CPCPrTaxonomy::getBottomHierarchyNode() { return bottomNode; } template N* CPCPrTaxonomy::getHierarchyNode(const E& element) { return elmNodeHash.value(element,nullptr); } template N* CPCPrTaxonomy::getHierarchyNode(const E& element, bool create) { N* node = getHierarchyNode(element); if (!node) { node = createHierarchyNode(element); } return node; } template bool CPCPrTaxonomy::hasHierarchyNode(const E& element) { return elmNodeHash.contains(element); } template bool CPCPrTaxonomy::isComplete() { return taxonomyComplete; } template bool CPCPrTaxonomy::isNodeSubsumption(N* subsumerNode, N* subsumedNode) { subsumerNode = getActiveNode(subsumerNode); subsumedNode = getActiveNode(subsumedNode); if (!subsumerNode || !subsumedNode) { return false; } if (subsumerNode == subsumedNode) { return true; } return subsumerNode->hasPredecessorNode(subsumedNode); } template bool CPCPrTaxonomy::isNodeEquivalence(N* node1, N* node2) { node1 = getActiveNode(node1); node2 = getActiveNode(node2); if (!node1 || !node2) { return false; } if (node1 == node2) { return true; } return node1->hasPredecessorNode(node2) && node2->hasPredecessorNode(node1); } template bool CPCPrTaxonomy::isNodeSatisfiable(N* node) { node = getActiveNode(node); return node != bottomNode && !node->hasPredecessorNode(bottomNode); } template bool CPCPrTaxonomy::isNodeNotSatisfiable(N* node) { node = getActiveNode(node); return node = bottomNode; } template bool CPCPrTaxonomy::isTopHierarchyNode(N* node) { node = getActiveNode(node); return node && topNode == node; } template bool CPCPrTaxonomy::isBottomHierarchyNode(N* node) { node = getActiveNode(node); return node && bottomNode == node; } template T* CPCPrTaxonomy::setTaxonomyComplete(bool completed) { taxonomyComplete = true; return (T*)this; } template bool CPCPrTaxonomy::isActiveNode(N* node) { return node->isActive(); } template T* CPCPrTaxonomy::setActiveNode(N* node, bool nodeActive) { node->setActive(nodeActive); return (T*)this; } template T* CPCPrTaxonomy::setInactiveNode(N* node, bool nodeInactive) { node->setActive(!nodeInactive); return (T*)this; } template N* CPCPrTaxonomy::getActiveNode(N* node) { if (!node->isActive()) { node = getHierarchyNode(node->getOneEquivalentElement()); } return node; } template bool CPCPrTaxonomy::repairInsertion(N* node, N* insertParentNode) { QSet* nodeChildSet = insertParentNode->getChildNodeSet(); for (typename QSet::iterator it = nodeChildSet->begin(), itEnd = nodeChildSet->end(); it != itEnd; ++it) { N* childNode = *it; if (childNode != node && childNode->hasPredecessorNode(node)) { // now indirect predecessor childNode->removeParent(insertParentNode); it = nodeChildSet->erase(it); if (it == itEnd) { break; } } } QSet* nodeParentSet = node->getParentNodeSet(); for (typename QSet::iterator it = nodeParentSet->begin(), itEnd = nodeParentSet->end(); it != itEnd; ++it) { N* parentNode = *it; if (parentNode != insertParentNode && insertParentNode->hasPredecessorNode(parentNode)) { // now indirect predecessor parentNode->removeChild(node); it = nodeParentSet->erase(it); if (it == itEnd) { break; } } } return true; } template bool CPCPrTaxonomy::repairedParentNodeInsertion(N* node, N* insertParentNode) { if (!node->hasPredecessorNode(insertParentNode)) { node->makeParent(insertParentNode); repairInsertion(node,insertParentNode); N* updatePredNode = insertParentNode; QSet* updatePredSet = updatePredNode->getPredecessorNodeSet(); for (typename QSet::const_iterator predIt = updatePredSet->constBegin(), predItEnd = updatePredSet->constEnd(); predIt != predItEnd; ++predIt) { updatePredNode = *predIt; QList updateList(node->getChildNodeList()); while (!updateList.isEmpty()) { N* updateNode = updateList.takeFirst(); if (!updateNode->hasPredecessorNode(updatePredNode)) { updateNode->makePredecessor(updatePredNode); QSet* updateNodeChildSet = updateNode->getChildNodeSet(); for (typename QSet::const_iterator it = updateNodeChildSet->constBegin(), itEnd = updateNodeChildSet->constEnd(); it != itEnd; ++it) { updateList.append(*it); } } } updatePredNode = nullptr; } } return false; } template T* CPCPrTaxonomy::setNodeSatisfiable(N* node) { node = getActiveNode(node); KONCLUDE_ASSERT_X(node != bottomNode,"taxonomy satisfiable","bottom element can not be satisfiable"); bottomNode->makeParent(node); node->makeParent(topNode); repairInsertion(bottomNode,node); repairInsertion(node,topNode); return (T*)this; } template T* CPCPrTaxonomy::setNodeUnsatisfiable(N* node) { node = getActiveNode(node); QList updateList; updateList.append(node); while (!updateList.isEmpty()) { N* updateNode = updateList.takeFirst(); updateNode->setInactive(); QList* elementList = updateNode->getEquivalentElementList(); for (typename QList::const_iterator it = elementList->constBegin(), itEnd = elementList->constEnd(); it != itEnd; ++it) { E element = *it; bottomNode->addEquivalentElement(element); elmNodeHash.insert(element,bottomNode); } QSet* updateNodeChildSet = updateNode->getChildNodeSet(); for (typename QSet::const_iterator it = updateNodeChildSet->constBegin(), itEnd = updateNodeChildSet->constEnd(); it != itEnd; ++it) { updateList.append(*it); } } QSet* nodeParentSet = node->getParentNodeSet(); for (typename QSet::iterator it = nodeParentSet->begin(), itEnd = nodeParentSet->end(); it != itEnd; ++it) { N* parentNode = *it; it = nodeParentSet->erase(it); node->removeParent(parentNode); repairedParentNodeInsertion(bottomNode,parentNode); if (it == itEnd) { break; } } return (T*)this; } template T* CPCPrTaxonomy::setNodeSubsumption(N* subsumerNode, N* subsumedNode) { subsumerNode = getActiveNode(subsumerNode); subsumedNode = getActiveNode(subsumedNode); if (subsumerNode != subsumedNode) { if (subsumedNode == bottomNode) { // unsatisfiable setNodeUnsatisfiable(subsumerNode); } if (subsumerNode->hasPredecessorNode(subsumedNode)) { // make equivalent N* mergeIntoNode = subsumedNode; N* mergingNode = subsumerNode; if (subsumerNode == bottomNode || subsumerNode == topNode) { mergeIntoNode = subsumerNode; mergingNode = subsumedNode; } mergingNode->setInactive(); QList* elementList = mergingNode->getEquivalentElementList(); for (typename QList::const_iterator it = elementList->constBegin(), itEnd = elementList->constEnd(); it != itEnd; ++it) { E element = *it; mergeIntoNode->addEquivalentElement(element); elmNodeHash.insert(element,mergeIntoNode); } QList nodeChildList(mergingNode->getChildNodeList()); QList updateList(nodeChildList); QList nodeParentList(mergingNode->getParentNodeList()); for (typename QList::const_iterator it = nodeChildList.constBegin(), itEnd = nodeChildList.constEnd(); it != itEnd; ++it) { N* parentNode = *it; parentNode->removeChild(mergingNode); mergingNode->removeParent(parentNode); } for (typename QList::const_iterator it = nodeChildList.constBegin(), itEnd = nodeChildList.constEnd(); it != itEnd; ++it) { N* childNode = *it; childNode->removeParent(mergingNode); mergingNode->removeChild(childNode); } while (!updateList.isEmpty()) { N* updateNode = updateList.takeFirst(); if (updateNode->hasPredecessorNode(mergingNode)) { updateNode->removePredecessor(mergingNode); QSet* updateNodeChildSet = updateNode->getChildNodeSet(); for (typename QSet::const_iterator it = updateNodeChildSet->constBegin(), itEnd = updateNodeChildSet->constEnd(); it != itEnd; ++it) { updateList.append(*it); } } } for (typename QList::const_iterator it = nodeChildList.constBegin(), itEnd = nodeChildList.constEnd(); it != itEnd; ++it) { N* parentNode = *it; setNodeSubsumption(mergeIntoNode,parentNode); } for (typename QList::const_iterator it = nodeChildList.constBegin(), itEnd = nodeChildList.constEnd(); it != itEnd; ++it) { N* childNode = *it; setNodeSubsumption(childNode,mergeIntoNode); } } else { repairedParentNodeInsertion(subsumerNode,subsumedNode); } } return (T*)this; } template T* CPCPrTaxonomy::setNodeEquivalence(N* eqNode1, N* eqNode2) { eqNode1 = getActiveNode(eqNode1); eqNode2 = getActiveNode(eqNode2); if (eqNode1 != eqNode2) { setNodeSubsumption(eqNode1,eqNode2); setNodeSubsumption(eqNode2,eqNode1); } return (T*)this; } template CHierarchyDepthTraversalIterator CPCPrTaxonomy::getDepthTraversalIterator(bool forceUnique) { return CHierarchyDepthTraversalIterator(topNode,bottomNode,forceUnique); } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CPCPRTAXONOMY_CPP Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CHierarchy.cpp0000644000175000017500000000205512520551262024405 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CHierarchy.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { CHierarchy::CHierarchy() { } CHierarchy::~CHierarchy() { } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/COntologyTaxonomy.cpp0000644000175000017500000000212012520551264026033 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyTaxonomy.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { COntologyTaxonomy::COntologyTaxonomy() { } COntologyTaxonomy::~COntologyTaxonomy() { } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CLightConceptClassesTaxonomy.h0000644000175000017500000000414312520551264027576 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CLIGHTCONCEPTCLASSESTAXONOMY_H #define KONCLUDE_REASONER_TAXONOMY_CLIGHTCONCEPTCLASSESTAXONOMY_H // Libraries includes // Namespace includes #include "TaxonomySettings.h" #include "CConceptClassesPCPrTaxonomy.h" #include "CLightConceptClassesHierarchyNode.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CLightConceptClassesTaxonomy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLightConceptClassesTaxonomy : public CConceptClassesPCPrTaxonomy { // public methods public: //! Constructor CLightConceptClassesTaxonomy(CLightConceptClassesHierarchyNode* topHierarchyNode, CLightConceptClassesHierarchyNode* bottomHierarchyNode); CLightConceptClassesTaxonomy(CConcept* topConcept, CConcept* bottomConcept); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CLIGHTCONCEPTCLASSESTAXONOMY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CEATaxonomy.h0000644000175000017500000000434612520551262024165 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CEATAXONOMY_H #define KONCLUDE_REASONER_TAXONOMY_CEATAXONOMY_H // Libraries includes // Namespace includes #include "TaxonomySettings.h" #include "CATaxonomy.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CEATaxonomy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CEATaxonomy : public CATaxonomy { // public methods public: //! Constructor CEATaxonomy(); bool isElementNotSubsumption(const E& notSubsumerElement, const E& notSubsumedElement); bool isElementDisjoint(const E& disjointElement1, const E& disjointElement2); bool isElementNotDisjoint(const E& disjointElement1, const E& disjointElement2); virtual bool isNodeNotSubsumption(N* notSubsumerNode, N* notSubsumedNode) = 0; virtual bool isNodeDisjoint(N* disjointNode1, N* disjointNode2) = 0; virtual bool isNodeNotDisjoint(N* disjointNode1, N* disjointNode2) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #include "CEATaxonomy.cpp" #endif // KONCLUDE_REASONER_TAXONOMY_CEATAXONOMY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CConceptPCPrHierarchyNode.cpp0000644000175000017500000001011412405707550027254 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptPCPrHierarchyNode.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { CConceptPCPrHierarchyNode::CConceptPCPrHierarchyNode(CConcept *representiveConcept) : CPCPrHierarchyNode(representiveConcept) { } CConceptPCPrHierarchyNode::~CConceptPCPrHierarchyNode() { } CConceptPCPrHierarchyNode *CConceptPCPrHierarchyNode::addEquivalentConcept(CConcept *concept) { CPCPrHierarchyNode::addEquivalentElement(concept); return this; } QList *CConceptPCPrHierarchyNode::getEquivalentConceptList() { return CPCPrHierarchyNode::getEquivalentElementList(); } CConcept *CConceptPCPrHierarchyNode::getOneEquivalentConcept() { return CPCPrHierarchyNode::getOneEquivalentElement(0); } qint64 CConceptPCPrHierarchyNode::getEquivalentConceptCount() { return eqElemCount; } QString CConceptPCPrHierarchyNode::getEquivalentConceptsNodeString() { QString string; foreach (CConcept *con, eqElementList) { QString iriClassNameString = CIRIName::getRecentIRIName(con->getClassNameLinker()); if (!string.isEmpty()) { string += QString(" <=> %1").arg(iriClassNameString); } else { string = iriClassNameString; } } return string; } QString CConceptPCPrHierarchyNode::getHierarchyConceptsNodeString(qint64 depth) { QString string(depth,'\t'); string += QString("< ") + getEquivalentConceptsNodeString() + QString(" >\n"); foreach (CConceptPCPrHierarchyNode *childNode, getChildNodeList()) { string += childNode->getHierarchyConceptsNodeString(depth+1); } string += QString(depth,'\t')+QString("\n"); return string; } QStringList CConceptPCPrHierarchyNode::getEquivalentConceptStringList(bool preferAbbreviatedNames) { QStringList stringList; foreach (CConcept *con, eqElementList) { QStringList iriClassNameStringList; if (preferAbbreviatedNames) { iriClassNameStringList = CAbbreviatedIRIName::getAbbreviatedPrefixWithAbbreviatedIRINames(con->getClassNameLinker()); } if (!preferAbbreviatedNames || iriClassNameStringList.isEmpty()) { iriClassNameStringList = CIRIName::getIRINames(con->getClassNameLinker()); } stringList<getEquivalentConceptsNodeString(); } childNodeStrings.clear(); foreach (CConceptPCPrHierarchyNode *node, getChildNodeList()) { childNodeStrings<getEquivalentConceptsNodeString(); } precNodeStrings.clear(); foreach (CConceptPCPrHierarchyNode *node, getPredecessorNodeList()) { precNodeStrings<getEquivalentConceptsNodeString(); } return this; } #endif }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CHierarchyNode.h0000644000175000017500000001461512520551264024667 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CHIERARCHYNODE_H #define KONCLUDE_REASONER_TAXONOMY_CHIERARCHYNODE_H // Libraries includes #include // Namespace includes #include "TaxonomySettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CAbbreviatedIRIName.h" #include "KoncludeSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Taxonomy { #ifndef KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED //#define DEBUGHIERARCHYNODECONCEPTSTRINGS #endif /*! * * \class CHierarchyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CHierarchyNode { // public methods public: //! Constructor CHierarchyNode(CConcept *representiveConcept); //! Destructor virtual ~CHierarchyNode(); virtual CHierarchyNode *addParentNode(CHierarchyNode *parentNode); virtual CHierarchyNode *addChildNode(CHierarchyNode *childNode); virtual CHierarchyNode *makeParent(CHierarchyNode *parentNode); virtual CHierarchyNode *makeChild(CHierarchyNode *childNode); virtual CHierarchyNode *addEquivalentConcept(CConcept *concept); virtual bool hasChildNode(CHierarchyNode *node); virtual bool hasParentNode(CHierarchyNode *node); virtual CHierarchyNode *addPredecessorNode(CHierarchyNode *preNode); virtual CHierarchyNode *addSuccessorNode(CHierarchyNode *succNode); virtual CHierarchyNode *makePredecessor(CHierarchyNode *parentNode); virtual CHierarchyNode *makeSuccessor(CHierarchyNode *childNode); virtual bool hasSuccessorNode(CHierarchyNode *node); virtual bool hasPredecessorNode(CHierarchyNode *node); virtual CHierarchyNode *removeParent(CHierarchyNode *parentNode); virtual CHierarchyNode *removeChild(CHierarchyNode *childNode); virtual CHierarchyNode *removePredecessor(CHierarchyNode *predNode); virtual CHierarchyNode *removeSuccessor(CHierarchyNode *succNode); virtual QSet *getParentNodeSet(); virtual QSet *getChildNodeSet(); virtual QSet *getPredecessorNodeSet(); virtual QSet *getSuccessorNodeSet(); virtual QList *getEquivalentConceptList(); virtual QList getParentNodeList(); virtual QList getChildNodeList(); virtual QList getPredecessorNodeList(); virtual QList getSuccessorNodeList(); virtual CHierarchyNode *addIncompatiblePredecessorNode(CHierarchyNode *incompNode); virtual CHierarchyNode *makeIncompatiblePredecessor(CHierarchyNode *incompNode); virtual bool hasIncompatiblePredecessorNode(CHierarchyNode *node); virtual CHierarchyNode *removeIncompatiblePredecessorNode(CHierarchyNode *incompNode); virtual CHierarchyNode *addDisjointNode(CHierarchyNode *disjNode); virtual CHierarchyNode *makeDisjoint(CHierarchyNode *disjNode); virtual bool hasDisjointNode(CHierarchyNode *node); virtual CHierarchyNode *removeDisjointNode(CHierarchyNode *disjNode); virtual CHierarchyNode *addIncompatibleSuccessorNode(CHierarchyNode *incompNode); virtual CHierarchyNode *makeIncompatibleSuccessor(CHierarchyNode *incompNode); virtual bool hasIncompatibleSuccessorNode(CHierarchyNode *node); virtual CHierarchyNode *removeIncompatibleSuccessorNode(CHierarchyNode *incompNode); virtual QSet *getIncompatibleSuccessorNodeSet(); virtual QSet *getIncompatiblePredecessorNodeSet(); virtual QList getIncompatibleSuccessorNodeList(); virtual QList getIncompatiblePredecessorNodeList(); virtual QSet *getDisjointNodeSet(); virtual QList getDisjointNodeList(); virtual CConcept *getOneEquivalentConcept(); virtual QString getEquivalentConceptsNodeString(); virtual QString getHierarchyConceptsNodeString(qint64 depth); virtual QStringList getEquivalentConceptStringList(bool preferAbbreviatedNames); virtual qint64 getEquivalentConceptCount(); virtual bool isActive(); virtual CHierarchyNode *setActive(bool activeNode = true); virtual CHierarchyNode *setInactive(bool inactiveNode = true); virtual bool isNeedExplicitMentioned(); virtual CHierarchyNode *setNeedExplicitMentioned(bool needsExplicitMentioned = true); // protected methods protected: #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS virtual CHierarchyNode *generateNodeStrings(); #endif // protected variables protected: #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS QStringList nodeStrings; QStringList parentNodeStrings; QStringList childNodeStrings; QStringList precNodeStrings; QStringList succNodeStrings; QStringList incPrecNodeStrings; QStringList incSuccNodeStrings; QStringList disjointNodeStrings; #endif QList eqConList; qint64 eqConCount; bool active; bool mention; QSet parentNodeSet; QSet childNodeSet; QSet predNodeSet; QSet succNodeSet; QSet incompPredNodeSet; QSet incompSuccNodeSet; QSet disjointNodeSet; // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CHIERARCHYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CTaxonomy.h0000644000175000017500000001007312520551266023755 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CTAXONOMY_H #define KONCLUDE_REASONER_TAXONOMY_CTAXONOMY_H // Libraries includes // Namespace includes #include "TaxonomySettings.h" #include "CHierarchyNode.h" #include "CHierarchy.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CTaxonomy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTaxonomy : public CHierarchy { // public methods public: //! Constructor CTaxonomy(CHierarchyNode *topHierarchyNode, CHierarchyNode *bottomHierarchyNode); CTaxonomy(CConcept *topConcept, CConcept *bottomConcept); //! Destructor virtual ~CTaxonomy(); virtual CHierarchyNode *getTopHierarchyNode(); virtual CHierarchyNode *getBottomHierarchyNode(); virtual CHierarchyNode *getHierarchyNode(CConcept *concept, bool create = true); virtual bool hasHierarchyNode(CConcept *concept); virtual CTaxonomy *setConceptSatisfiable(CConcept *concept, bool satisfiable) = 0; virtual CTaxonomy *setConceptSubsumption(CConcept *subsumerConcept, CConcept *subsumedConcept) = 0; virtual CTaxonomy *setConceptNotSubsumption(CConcept *notSubsumerConcept, CConcept *notSubsumedConcept) = 0; virtual CTaxonomy *setConceptDisjoints(CConcept *disjointConcept1, CConcept *disjointConcept2) = 0; virtual bool isSubsumption(CConcept *subsumerConcept, CConcept *subsumedConcept); virtual bool isEquivalence(CConcept *concept1, CConcept *concept2); virtual bool isNotSubsumption(CConcept *notSubsumerConcept, CConcept *notSubsumedConcept); virtual bool isSatisfiable(CConcept *concept); virtual bool isNotSatisfiable(CConcept *concept); virtual bool isDisjoint(CConcept *disjointConcept1, CConcept *disjointConcept2); virtual bool isNotDisjoint(CConcept *disjointConcept1, CConcept *disjointConcept2); virtual bool isTopHierarchyNode(CConcept *concept); virtual bool isBottomHierarchyNode(CConcept *concept); virtual QString getConceptHierarchyString(); virtual bool isComplete(); virtual CTaxonomy *setTaxonomyComplete(bool completed = true); virtual bool isActiveNode(CHierarchyNode *node); virtual CTaxonomy *setActiveNode(CHierarchyNode *node, bool nodeActive = true); virtual CTaxonomy *setInactiveNode(CHierarchyNode *node, bool nodeInactive = true); virtual CHierarchyNode *getActiveNode(CHierarchyNode *node); virtual CTaxonomy *updateNodeEquivalences(CHierarchyNode *node); virtual QHash* getConceptHierarchyNodeHash(); // protected methods protected: virtual CHierarchyNode *createHierarchyNode(CConcept *concept); // protected variables protected: QHash conNodeHash; CHierarchyNode *topNode; CHierarchyNode *bottomNode; bool topIsUnsatisfiable; bool taxonomyComplete; QList nodeContainer; QSet activeNodeSet; // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CTAXONOMY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CHierarchyNodeData.h0000644000175000017500000000336112520551264025455 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CHIERARCHYNODEDATA_H #define KONCLUDE_REASONER_TAXONOMY_CHIERARCHYNODEDATA_H // Libraries includes #include // Namespace includes #include "TaxonomySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { /*! * * \class CHierarchyNodeData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CHierarchyNodeData { // public methods public: //! Constructor CHierarchyNodeData(); //! Destructor ~CHierarchyNodeData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CHIERARCHYNODEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CPCPrSuIpIsDiHierarchyNode.cpp0000644000175000017500000003416312405707550027324 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPCPrSuIpIsDiHierarchyNode.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { CPCPrSuIpIsDiHierarchyNode::CPCPrSuIpIsDiHierarchyNode(CConcept *representiveConcept) { eqConList.append(representiveConcept); eqConCount = 1; active = true; mention = false; #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif } CPCPrSuIpIsDiHierarchyNode::~CPCPrSuIpIsDiHierarchyNode() { } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::addParentNode(CPCPrSuIpIsDiHierarchyNode *parentNode) { parentNodeSet.insert(parentNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::addChildNode(CPCPrSuIpIsDiHierarchyNode *childNode) { childNodeSet.insert(childNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::makeParent(CPCPrSuIpIsDiHierarchyNode *parentNode) { parentNodeSet.insert(parentNode); parentNode->addChildNode(this); makePredecessor(parentNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::makeChild(CPCPrSuIpIsDiHierarchyNode *childNode) { childNodeSet.insert(childNode); childNode->addParentNode(this); makeSuccessor(childNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } bool CPCPrSuIpIsDiHierarchyNode::hasChildNode(CPCPrSuIpIsDiHierarchyNode *node) { return childNodeSet.contains(node); } bool CPCPrSuIpIsDiHierarchyNode::hasParentNode(CPCPrSuIpIsDiHierarchyNode *node) { return parentNodeSet.contains(node); } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::addEquivalentConcept(CConcept *concept) { eqConList.append(concept); eqConCount++; #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::addPredecessorNode(CPCPrSuIpIsDiHierarchyNode *preNode) { predNodeSet.insert(preNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::addSuccessorNode(CPCPrSuIpIsDiHierarchyNode *succNode) { succNodeSet.insert(succNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::makePredecessor(CPCPrSuIpIsDiHierarchyNode *preNode) { predNodeSet.insert(preNode); preNode->addSuccessorNode(this); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::makeSuccessor(CPCPrSuIpIsDiHierarchyNode *succNode) { succNodeSet.insert(succNode); succNode->addPredecessorNode(this); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } bool CPCPrSuIpIsDiHierarchyNode::hasSuccessorNode(CPCPrSuIpIsDiHierarchyNode *node) { return succNodeSet.contains(node); } bool CPCPrSuIpIsDiHierarchyNode::hasPredecessorNode(CPCPrSuIpIsDiHierarchyNode *node) { return predNodeSet.contains(node); } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::removeParent(CPCPrSuIpIsDiHierarchyNode *parentNode) { parentNodeSet.remove(parentNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::removeChild(CPCPrSuIpIsDiHierarchyNode *childNode) { childNodeSet.remove(childNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } QSet *CPCPrSuIpIsDiHierarchyNode::getParentNodeSet() { return &parentNodeSet; } QSet *CPCPrSuIpIsDiHierarchyNode::getChildNodeSet() { return &childNodeSet; } QSet *CPCPrSuIpIsDiHierarchyNode::getPredecessorNodeSet() { return &predNodeSet; } QSet *CPCPrSuIpIsDiHierarchyNode::getSuccessorNodeSet() { return &succNodeSet; } QList *CPCPrSuIpIsDiHierarchyNode::getEquivalentConceptList() { return &eqConList; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::removePredecessor(CPCPrSuIpIsDiHierarchyNode *predNode) { predNodeSet.remove(predNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::removeSuccessor(CPCPrSuIpIsDiHierarchyNode *succNode) { succNodeSet.remove(succNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } QList CPCPrSuIpIsDiHierarchyNode::getParentNodeList() { return parentNodeSet.values(); } QList CPCPrSuIpIsDiHierarchyNode::getChildNodeList() { return childNodeSet.values(); } QList CPCPrSuIpIsDiHierarchyNode::getPredecessorNodeList() { return predNodeSet.values(); } QList CPCPrSuIpIsDiHierarchyNode::getSuccessorNodeList() { return succNodeSet.values(); } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::addIncompatiblePredecessorNode(CPCPrSuIpIsDiHierarchyNode *incompNode) { incompPredNodeSet.insert(incompNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::makeIncompatiblePredecessor(CPCPrSuIpIsDiHierarchyNode *incompNode) { addIncompatiblePredecessorNode(incompNode); incompNode->addIncompatibleSuccessorNode(this); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } bool CPCPrSuIpIsDiHierarchyNode::hasIncompatiblePredecessorNode(CPCPrSuIpIsDiHierarchyNode *node) { return incompPredNodeSet.contains(node); } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::removeIncompatiblePredecessorNode(CPCPrSuIpIsDiHierarchyNode *incompNode) { incompPredNodeSet.remove(incompNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::addIncompatibleSuccessorNode(CPCPrSuIpIsDiHierarchyNode *incompNode) { incompSuccNodeSet.insert(incompNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::makeIncompatibleSuccessor(CPCPrSuIpIsDiHierarchyNode *incompNode) { addIncompatibleSuccessorNode(incompNode); incompNode->addIncompatiblePredecessorNode(this); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } bool CPCPrSuIpIsDiHierarchyNode::hasIncompatibleSuccessorNode(CPCPrSuIpIsDiHierarchyNode *node) { return incompSuccNodeSet.contains(node); } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::removeIncompatibleSuccessorNode(CPCPrSuIpIsDiHierarchyNode *incompNode) { incompSuccNodeSet.remove(incompNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::addDisjointNode(CPCPrSuIpIsDiHierarchyNode *disjNode) { disjointNodeSet.insert(disjNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::makeDisjoint(CPCPrSuIpIsDiHierarchyNode *disjNode) { addDisjointNode(disjNode); disjNode->addDisjointNode(this); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } bool CPCPrSuIpIsDiHierarchyNode::hasDisjointNode(CPCPrSuIpIsDiHierarchyNode *node) { return disjointNodeSet.contains(node); } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::removeDisjointNode(CPCPrSuIpIsDiHierarchyNode *disjNode) { disjointNodeSet.remove(disjNode); #ifdef DEBUGCPCPRSUIPISDIHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } QSet *CPCPrSuIpIsDiHierarchyNode::getIncompatibleSuccessorNodeSet() { return &incompSuccNodeSet; } QSet *CPCPrSuIpIsDiHierarchyNode::getIncompatiblePredecessorNodeSet() { return &incompPredNodeSet; } QList CPCPrSuIpIsDiHierarchyNode::getIncompatibleSuccessorNodeList() { return incompSuccNodeSet.values(); } QList CPCPrSuIpIsDiHierarchyNode::getIncompatiblePredecessorNodeList() { return incompPredNodeSet.values(); } QSet *CPCPrSuIpIsDiHierarchyNode::getDisjointNodeSet() { return &disjointNodeSet; } QList CPCPrSuIpIsDiHierarchyNode::getDisjointNodeList() { return disjointNodeSet.values(); } CConcept *CPCPrSuIpIsDiHierarchyNode::getOneEquivalentConcept() { CConcept *concept = 0; if (!eqConList.isEmpty()) { concept = eqConList.first(); } return concept; } bool CPCPrSuIpIsDiHierarchyNode::isActive() { return active; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::setActive(bool activeNode) { active = activeNode; return this; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::setInactive(bool inactiveNode) { active = !inactiveNode; return this; } bool CPCPrSuIpIsDiHierarchyNode::isNeedExplicitMentioned() { return mention; } CPCPrSuIpIsDiHierarchyNode *CPCPrSuIpIsDiHierarchyNode::setNeedExplicitMentioned(bool needsExplicitMentioned) { mention = needsExplicitMentioned; return this; } QString CPCPrSuIpIsDiHierarchyNode::getEquivalentConceptsNodeString() { QString string; foreach (CConcept *con, eqConList) { QString iriClassNameString = CIRIName::getRecentIRIName(con->getClassNameLinker()); if (!string.isEmpty()) { string += QString(" <=> %1").arg(iriClassNameString); } else { string = iriClassNameString; } } return string; } QString CPCPrSuIpIsDiHierarchyNode::getHierarchyConceptsNodeString(qint64 depth) { QString string(depth,'\t'); string += QString("< ") + getEquivalentConceptsNodeString() + QString(" >\n"); foreach (CPCPrSuIpIsDiHierarchyNode *childNode, getChildNodeList()) { string += childNode->getHierarchyConceptsNodeString(depth+1); } string += QString(depth,'\t')+QString("\n"); return string; } QStringList CPCPrSuIpIsDiHierarchyNode::getEquivalentConceptStringList(bool preferAbbreviatedNames) { QStringList stringList; foreach (CConcept *con, eqConList) { QStringList iriClassNameStringList; if (preferAbbreviatedNames) { iriClassNameStringList = CAbbreviatedIRIName::getAbbreviatedPrefixWithAbbreviatedIRINames(con->getClassNameLinker()); } if (!preferAbbreviatedNames || iriClassNameStringList.isEmpty()) { iriClassNameStringList = CIRIName::getIRINames(con->getClassNameLinker()); } stringList<getEquivalentConceptsNodeString(); } childNodeStrings.clear(); foreach (CPCPrSuIpIsDiHierarchyNode *node, getChildNodeList()) { childNodeStrings<getEquivalentConceptsNodeString(); } precNodeStrings.clear(); foreach (CPCPrSuIpIsDiHierarchyNode *node, getPredecessorNodeList()) { precNodeStrings<getEquivalentConceptsNodeString(); } succNodeStrings.clear(); foreach (CPCPrSuIpIsDiHierarchyNode *node, getSuccessorNodeList()) { succNodeStrings<getEquivalentConceptsNodeString(); } incPrecNodeStrings.clear(); foreach (CPCPrSuIpIsDiHierarchyNode *node, getIncompatiblePredecessorNodeList()) { incPrecNodeStrings<getEquivalentConceptsNodeString(); } incSuccNodeStrings.clear(); foreach (CPCPrSuIpIsDiHierarchyNode *node, getIncompatibleSuccessorNodeList()) { incSuccNodeStrings<getEquivalentConceptsNodeString(); } disjointNodeStrings.clear(); foreach (CPCPrSuIpIsDiHierarchyNode *node, getDisjointNodeList()) { disjointNodeStrings<getEquivalentConceptsNodeString(); } return this; } #endif }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CATaxonomyBuilder.cpp0000644000175000017500000000540612520551262025720 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CATAXONOMYBUILDER_CPP #define KONCLUDE_REASONER_TAXONOMY_CATAXONOMYBUILDER_CPP #include "CATaxonomyBuilder.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { template CATaxonomyBuilder::CATaxonomyBuilder() { } template T* CATaxonomyBuilder::setElementSatisfiable(const E& element, bool satisfiable) { if (satisfiable) { return setElementSatisfiable(element); } else { return setElementUnsatisfiable(element); } } template T* CATaxonomyBuilder::setElementSatisfiable(const E& element) { N* node = getHierarchyNode(element,true); return setNodeSatisfiable(node); } template T* CATaxonomyBuilder::setElementUnsatisfiable(const E& element) { N* node = getHierarchyNode(element,true); return setNodeUnsatisfiable(node); } template T* CATaxonomyBuilder::setElementSubsumption(const E& subsumerElement, const E& subsumedElement) { N* subsumerNode = getHierarchyNode(subsumerElement,true); N* subsumedNode = getHierarchyNode(subsumedElement,true); return setNodeSubsumption(subsumerNode,subsumedNode); } template T* CATaxonomyBuilder::setElementEquivalence(const E& element1, const E& element2) { N* eqNode1 = getHierarchyNode(element1,true); N* eqNode2 = getHierarchyNode(element2,true); return setNodeEquivalence(eqNode1,eqNode2); } template T* CATaxonomyBuilder::setNodeSatisfiable(N* node, bool satisfiable) { if (satisfiable) { return setNodeSatisfiable(node); } else { return setNodeUnsatisfiable(node); } } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CATAXONOMYBUILDER_CPP Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CLightConceptClassesHierarchyNode.cpp0000644000175000017500000000230412520551264031034 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLightConceptClassesHierarchyNode.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { CLightConceptClassesHierarchyNode::CLightConceptClassesHierarchyNode(CConcept* representiveConcept) : CConceptClassesPCPrHierarchyNode(representiveConcept) { } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Taxonomy/CATaxonomy.cpp0000644000175000017500000000567412520551262024420 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_TAXONOMY_CATAXONOMY_CPP #define KONCLUDE_REASONER_TAXONOMY_CATAXONOMY_CPP #include "CATaxonomy.h" namespace Konclude { namespace Reasoner { namespace Taxonomy { template CATaxonomy::CATaxonomy() { } template bool CATaxonomy::isElementSubsumption(const E& subsumerElement, const E& subsumedElement) { N* subsumerNode = getHierarchyNode(subsumerElement); if (!subsumerNode) { return false; } N* subsumedNode = getHierarchyNode(subsumedElement); if (!subsumedNode) { return false; } return isNodeSubsumption(subsumerNode,subsumedNode); } template bool CATaxonomy::isElementEquivalence(const E& element1, const E& element2) { N* node1 = getHierarchyNode(element1); if (!node1) { return false; } N* node2 = getHierarchyNode(element2); if (!node2) { return false; } return node1 == node2 || isNodeSubsumption(node1,node2) && isNodeSubsumption(node2,node1); } template bool CATaxonomy::isElementSatisfiable(const E& element) { N* node = getHierarchyNode(element); if (!node) { return false; } return isNodeSatisfiable(node); } template bool CATaxonomy::isElementNotSatisfiable(const E& element) { N* node = getHierarchyNode(element); if (!node) { return false; } return isElementNotSatisfiable(node); } template bool CATaxonomy::isTopHierarchyElement(const E& element) { N* node = getHierarchyNode(element); if (!node) { return false; } return isTopHierarchyNode(node); } template bool CATaxonomy::isBottomHierarchyElement(const E& element) { N* node = getHierarchyNode(element); if (!node) { return false; } return isBottomHierarchyNode(node); } }; // end namespace Taxonomy }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_TAXONOMY_CATAXONOMY_CPP Konclude-v0.6.2-544-SourceCode/Source/Reasoner/ReasonerSettings.h0000644000175000017500000000320112520551266023510 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REASONERSETTINGS #define KONCLUDE_REASONER_REASONERSETTINGS // Libraries includes #include #include // Namespace includes // Other includes #include "KoncludeSettings.h" // Logger includes namespace Konclude { namespace Reasoner { /*! * * \file ReasonerSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations // Custom Events >= 2000 const QEvent::Type EVENTCALCBOXSATISFIABLE = (QEvent::Type)2000; const QEvent::Type EVENTCALCEDBOXSATISFIABLECALLBACK = (QEvent::Type)2001; const QEvent::Type EVENTCALCQUERY = (QEvent::Type)2002; const QEvent::Type EVENTCALCEDQUERY = (QEvent::Type)2003; }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_REASONERSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/0000755000175000017500000000000012613407252022126 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassifierStatistics.h0000644000175000017500000001140312520550752026541 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFIERSTATISTICS_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFIERSTATISTICS_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Classifier { /*! * * \class CClassifierStatistics * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassifierStatistics { // public methods public: //! Constructor CClassifierStatistics(CClassifierStatistics *nextClassificationStatistics = 0); qint64 getPseudoModelMergedTestedSubsumptionCount(); qint64 getSubclassTestedSubsumptionCount(); qint64 getSubclassIdentifierOccurTestedSubsumptionCount(); qint64 getDerivatedTestedSubsumptionCount(); qint64 getCalculatedTestedSubsumptionCount(); qint64 getPrunedTestedSubsumptionCount(); qint64 getTestedSubsumptionCount(); qint64 getToldSubsumptionCount(); qint64 getPseudoModelMergedTestedSatisfiableCount(); qint64 getDerivatedTestedSatisfiableCount(); qint64 getCalculatedTestedSatisfiableCount(); qint64 getPrunedTestedSatisfiableCount(); qint64 getTestedSatisfiableCount(); qint64 getToldSatisfiableCount(); qint64 getTotalSubsumptionTestCount(); qint64 getTotalSatisfiableCount(); qint64 getPseudoModelMergedTestedDisjointCount(); qint64 getToldDisjointCount(); qint64 getCalculatedTestedDisjointCount(); CClassifierStatistics *incPseudoModelMergedTestedSubsumptionCount(qint64 incCount = 1); CClassifierStatistics *incSubclassTestedSubsumptionCount(qint64 incCount = 1); CClassifierStatistics *incSubclassIdentifierOccurTestedSubsumptionCount(qint64 incCount = 1); CClassifierStatistics *incDerivatedTestedSubsumptionCount(qint64 incCount = 1); CClassifierStatistics *incCalculatedTestedSubsumptionCount(qint64 incCount = 1); CClassifierStatistics *incPrunedTestedSubsumptionCount(qint64 incCount = 1); CClassifierStatistics *incToldSubsumptionCount(qint64 incCount = 1); CClassifierStatistics *incPseudoModelMergedTestedSatisfiableCount(qint64 incCount = 1); CClassifierStatistics *incDerivatedTestedSatisfiableCount(qint64 incCount = 1); CClassifierStatistics *incCalculatedTestedSatisfiableCount(qint64 incCount = 1); CClassifierStatistics *incPrunedTestedSatisfiableCount(qint64 incCount = 1); CClassifierStatistics *incToldSatisfiableCount(qint64 incCount = 1); CClassifierStatistics *incPseudoModelMergedTestedDisjointCount(qint64 incCount = 1); CClassifierStatistics *incToldDisjointCount(qint64 incCount = 1); CClassifierStatistics *incCalculatedTestedDisjointCount(qint64 incCount = 1); CClassifierStatistics *incTotalSubsumptionTestCount(qint64 incCount = 1); CClassifierStatistics *incTotalSatisfiableTestCount(qint64 incCount = 1); CClassifierStatistics *resetValues(); CClassifierStatistics *appendStatistics(CClassifierStatistics *statistics); // protected methods protected: // protected variables protected: qint64 pseudoModelSubsumTests; qint64 subclassSubsumTests; qint64 subclassIdOccSubsumTests; qint64 derivatedSubsumTests; qint64 prunedSubsumTests; qint64 calculatedSubsumTests; qint64 toldSubsumTests; qint64 pseudoModelSatisTests; qint64 derivatedSatisTests; qint64 calculatedSatisTests; qint64 prunedSatisTests; qint64 toldSatisTests; qint64 pseudoModelDisjointTests; qint64 calculatedDisjointTests; qint64 toldDisjointTests; qint64 totalSubsumTests; qint64 totalSatisTests; CClassifierStatistics *nextClassifStat; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFIERSTATISTICS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodeChildrenOrderClassificationItem.cpp0000644000175000017500000000346412520550754031774 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNodeChildrenOrderClassificationItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { CNodeChildrenOrderClassificationItem::CNodeChildrenOrderClassificationItem(CHierarchyNode *node, QHash,double> *subsumptionProbabilisticHash) { parentNode = node; subsumProbabilisticHash = subsumptionProbabilisticHash; } CNodeChildrenOrderClassificationItem::~CNodeChildrenOrderClassificationItem() { } CHierarchyNode *CNodeChildrenOrderClassificationItem::getTestingNode() { return parentNode; } QHash,double> *CNodeChildrenOrderClassificationItem::getSubsumptionProbabilisticHash() { return subsumProbabilisticHash; } QList > *CNodeChildrenOrderClassificationItem::getSubsumptionCalculationOrderList() { return &subsumCalcOrderList; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedSubClassOntologyClassificationItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedSubClassOntologyClassificationIt0000644000175000017500000001277312520550762032500 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedSubClassOntologyClassificationItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedSubClassOntologyClassificationItem::COptimizedSubClassOntologyClassificationItem(CConfigurationBase *configuration, CClassifierStatistics *nextClassificationStatistics) : COntologyClassificationItem(configuration,nextClassificationStatistics) { mTopSatTestItem = nullptr; mBottomSatTestItem = nullptr; mRemainingSatTests = 0; mRunningSatTests = 0; } COptimizedSubClassOntologyClassificationItem::~COptimizedSubClassOntologyClassificationItem() { } QHash* COptimizedSubClassOntologyClassificationItem::getConceptSatisfiableTestItemHash() { return &mConceptSatItemHash; } QList* COptimizedSubClassOntologyClassificationItem::getConceptSatisfiableTestItemContainer() { return &mSatTestItemContainer; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassOntologyClassificationItem::getTopConceptSatisfiableTestItem() { return mTopSatTestItem; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassOntologyClassificationItem::getBottomConceptSatisfiableTestItem() { return mBottomSatTestItem; } QList* COptimizedSubClassOntologyClassificationItem::getNextSatisfiableTestingItemList() { return &mNextItemList; } QSet* COptimizedSubClassOntologyClassificationItem::getNextCandidateSatisfiableTestingItemSet() { return &mNextCandItemSet; } QSet* COptimizedSubClassOntologyClassificationItem::getRemainingCandidateSatisfiableTestingItemSet() { return &mRemainingCandItemSet; } COptimizedSubClassOntologyClassificationItem* COptimizedSubClassOntologyClassificationItem::initTopBottomSatisfiableTestingItems(COptimizedSubClassSatisfiableTestingItem* topItem, COptimizedSubClassSatisfiableTestingItem* bottomItem) { mTopSatTestItem = topItem; mBottomSatTestItem = bottomItem; return this; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassOntologyClassificationItem::getConceptSatisfiableTestItem(CConcept* satTestConcept, bool create) { COptimizedSubClassSatisfiableTestingItem* item = nullptr; item = mConceptSatItemHash.value(satTestConcept); if (!item && create) { item = new COptimizedSubClassSatisfiableTestingItem(); item->initSatisfiableTestingItem(satTestConcept); mConceptSatItemHash.insert(satTestConcept,item); mSatTestItemContainer.append(item); } return item; } bool COptimizedSubClassOntologyClassificationItem::hasAllSatisfiableTestsCompleted() { return mRemainingSatTests <= 0 && mRunningSatTests <= 0; } bool COptimizedSubClassOntologyClassificationItem::hasRemainingSatisfiableTests() { return mRemainingSatTests > 0; } cint64 COptimizedSubClassOntologyClassificationItem::getRemainingSatisfiableTestsCount() { return mRemainingSatTests; } cint64 COptimizedSubClassOntologyClassificationItem::getRunningSatisfiableTestsCount() { return mRunningSatTests; } COptimizedSubClassOntologyClassificationItem* COptimizedSubClassOntologyClassificationItem::incRemainingSatisfiableTestsCount(cint64 incCount) { mRemainingSatTests += incCount; return this; } COptimizedSubClassOntologyClassificationItem* COptimizedSubClassOntologyClassificationItem::incRunningSatisfiableTestsCount(cint64 incCount) { mRunningSatTests += incCount; return this; } COptimizedSubClassOntologyClassificationItem* COptimizedSubClassOntologyClassificationItem::decRemainingSatisfiableTestsCount(cint64 decCount) { mRemainingSatTests -= decCount; return this; } COptimizedSubClassOntologyClassificationItem* COptimizedSubClassOntologyClassificationItem::decRunningSatisfiableTestsCount(cint64 decCount) { mRunningSatTests -= decCount; return this; } QList* COptimizedSubClassOntologyClassificationItem::getSatisfiableConceptItemList() { return &mSatisfiableItemList; } COptimizedSubClassOntologyClassificationItem* COptimizedSubClassOntologyClassificationItem::addSatisfiableConceptItem(COptimizedSubClassSatisfiableTestingItem* item) { mSatisfiableItemList.append(item); return this; } QHash* COptimizedSubClassOntologyClassificationItem::getConceptReferenceLinkingDataHash() { return &mConceptRefLinkData; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassifiedCallbackDataContext.cpp0000644000175000017500000000263712520550752030570 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassifiedCallbackDataContext.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassifiedCallbackDataContext::CClassifiedCallbackDataContext(CTaxonomy *taxanomy, CConcreteOntology *ontology) { tax = taxanomy; onto = ontology; } CClassifiedCallbackDataContext::~CClassifiedCallbackDataContext() { } CConcreteOntology *CClassifiedCallbackDataContext::getOntology() { return onto; } CTaxonomy *CClassifiedCallbackDataContext::getTaxonomy() { return tax; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationSatisfiableCalculationData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationSatisfiableCalculationData.0000644000175000017500000000661412520550750032313 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONSATISFIABLECALCULATIONDATA_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONSATISFIABLECALCULATIONDATA_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes #include "Reasoner/Taxonomy/CHierarchyNodeData.h" #include "Reasoner/Kernel/Task/CTaskPreyingListner.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationJobInstantiation.h" #include "Utilities/UtilitiesSettings.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Memory; namespace Reasoner { using namespace Taxonomy; using namespace Kernel::Task; namespace Classifier { /*! * * \class CClassificationSatisfiableCalculationData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationSatisfiableCalculationData : public CHierarchyNodeData, public CTaskPreyingListner { // public methods public: //! Constructor CClassificationSatisfiableCalculationData(); virtual CTaskPreyingListner* tellPreyedSatisfialbeTask(CSatisfiableCalculationTask* task); bool hasSatisfiableCalculationTask(); CSatisfiableCalculationTask* getSatisfiableCalculationTask(); CClassificationSatisfiableCalculationData* setSatisfiableCalculationTask(CSatisfiableCalculationTask* task); bool hasSatisfiableCalculationJobInstantiation(); CSatisfiableCalculationJobInstantiation* getSatisfiableCalculationJobInstantiation(); bool clearSatisfiableCalculationJobInstantiation(); CClassificationSatisfiableCalculationData* getPreviousCalculationData(); CClassificationSatisfiableCalculationData* setPreviousCalculationData(CClassificationSatisfiableCalculationData* data); cint64 getDependendCalculationCount(); CClassificationSatisfiableCalculationData* incDependendCalculationCount(cint64 incCount = 1); bool decDependendCalculationCount(cint64 decCount = 1); // protected methods protected: // protected variables protected: CSatisfiableCalculationTask* mSatCalcedTask; CSatisfiableCalculationJobInstantiation* mSatCalcedJob; CClassificationSatisfiableCalculationData* mPrevData; cint64 mDependendCalculationCount; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONSATISFIABLECALCULATIONDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CRolePossibleSubsumptionMapIterator.h0000644000175000017500000000414212405707542031432 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSPOSSIBLESUBSUMPTIONMAPITERATOR_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSPOSSIBLESUBSUMPTIONMAPITERATOR_H // Libraries includes #include // Namespace includes #include "ClassifierSettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CClassPossibleSubsumptionMapIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassPossibleSubsumptionMapIterator { // public methods public: virtual bool hasNext() = 0; virtual bool isSubsumptionConfirmed() = 0; virtual bool isSubsumptionInvalided() = 0; virtual CConcept* getSubsumptionConcept() = 0; virtual bool invalidateSubsumption() = 0; virtual bool confirmSubsumption() = 0; virtual bool moveNext() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSPOSSIBLESUBSUMPTIONMAPITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassTestingItem.cpp0000644000175000017500000003001512520551406030750 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetClassTestingItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedKPSetClassTestingItem::COptimizedKPSetClassTestingItem() { } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::initSatisfiableTestingItem(CConcept* satTestConcept, QHash* conRefLinkDataHash) { mConceptSat = satTestConcept; mConSatHierNode = nullptr; mPredCounter = 0; mSatTestedResult = false; mSatTestOrdered = false; mTestedSat = false; mUnsatDerivated = false; mSatDerivated = false; mEquiItem = false; mPredOfItem = false; mPossibleSubsumptionMap = nullptr; mPossSubsumMapInitialized = false; mPropagationConnected = false; mPseudoModelInitialized = false; mPossibleSubsumedList = nullptr; mPossibleSubsumedSet = nullptr; mFastSatCacheEntry = nullptr; mSuccFastSatTested = false; mIndiDepTracked = false; mConRefLinkDataHash = conRefLinkDataHash; return this; } COptimizedKPSetClassTestingItem::~COptimizedKPSetClassTestingItem() { delete mPossibleSubsumedList; delete mPossibleSubsumedSet; } CConcept* COptimizedKPSetClassTestingItem::getTestingConcept() { return mConceptSat; } CHierarchyNode* COptimizedKPSetClassTestingItem::getSatisfiableConceptHierarchyNode() { return mConSatHierNode; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setSatisfiableConceptHierarchyNode(CHierarchyNode* hierNode) { mConSatHierNode = hierNode; return this; } QSet* COptimizedKPSetClassTestingItem::getSubsumingConceptItemSet() { return &mSubsumingConceptItemSet; } QList* COptimizedKPSetClassTestingItem::getSubsumingConceptItemList() { return &mSubsumingConceptItemList; } cint64 COptimizedKPSetClassTestingItem::getSubsumingConceptItemCount() const { return mSubsumingConceptItemSet.count(); } bool COptimizedKPSetClassTestingItem::hasSubsumerConceptItem(COptimizedKPSetClassTestingItem* item) { return mSubsumingConceptItemSet.contains(item); } QList* COptimizedKPSetClassTestingItem::getSuccessorItemList() { return &mSuccList; } cint64 COptimizedKPSetClassTestingItem::getUnprocessedPredecessorItemCount() { return mPredCounter; } bool COptimizedKPSetClassTestingItem::hasOnlyProcessedPredecessorItems() { return mPredCounter <= 0; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::decUnprocessedPredecessorItems(cint64 decCount) { mPredCounter -= decCount; return this; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::incUnprocessedPredecessorItems(cint64 incCount) { mPredCounter += incCount; return this; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setUnprocessedPredecessorItems(cint64 predCount) { mPredCounter = predCount; return this; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::addSuccessorSatisfiableTestItem(COptimizedKPSetClassTestingItem* succItem) { mSuccList.append(succItem); return this; } bool COptimizedKPSetClassTestingItem::isSatisfiableTestOrdered() { return mSatTestOrdered; } bool COptimizedKPSetClassTestingItem::isSatisfiableTested() { return mTestedSat; } bool COptimizedKPSetClassTestingItem::isResultUnsatisfiableDerivated() { return mUnsatDerivated; } bool COptimizedKPSetClassTestingItem::isResultSatisfiableDerivated() { return mSatDerivated; } bool COptimizedKPSetClassTestingItem::getSatisfiableTestedResult() { return mSatTestedResult; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setSatisfiableTestOrdered(bool satTestOrdered) { mSatTestOrdered = satTestOrdered; return this; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setSatisfiableTested(bool satTested) { mTestedSat = satTested; return this; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setSatisfiableTestedResult(bool satTestedResult) { mSatTestedResult = satTestedResult; return this; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setResultUnsatisfiableDerivated(bool unsatDerivated) { mUnsatDerivated = unsatDerivated; return this; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setResultSatisfiableDerivated(bool satDerivated) { mSatDerivated = satDerivated; return this; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::addSubsumingConceptItem(COptimizedKPSetClassTestingItem* subsumingItem) { if (!mSubsumingConceptItemSet.contains(subsumingItem)) { mSubsumingConceptItemList.append(subsumingItem); mSubsumingConceptItemSet.insert(subsumingItem); //QString iriClassNameString = CIRIName::getRecentIRIName(subsumingItem->getTestingConcept()->getClassNameLinker()); //mSubsumingConceptString += QString("%1\r\n").arg(iriClassNameString); } return this; } CConceptSubsumerObserver* COptimizedKPSetClassTestingItem::tellConceptSupsumption(CConcept* subsumedConcept, CConcept* subsumerConcept) { if (subsumerConcept->getOperatorCode() != CCTOP) { CConceptProcessData* conProData = (CConceptProcessData*)subsumerConcept->getConceptData(); if (!conProData->isInvalidatedReferenceLinking()) { CConceptSatisfiableReferenceLinkingData* conSatRefLinking = (CConceptSatisfiableReferenceLinkingData*)conProData->getConceptReferenceLinking(); if (conSatRefLinking) { COptimizedKPSetClassTestingItem* subsumerClassSaturationItem = (COptimizedKPSetClassTestingItem*)conSatRefLinking->getClassifierReferenceLinkingData(); addSubsumingConceptItem(subsumerClassSaturationItem); } } else if (mConRefLinkDataHash) { COptimizedKPSetClassTestingItem* subsumerClasItem = (COptimizedKPSetClassTestingItem*)mConRefLinkDataHash->value(subsumerConcept); addSubsumingConceptItem(subsumerClasItem); } } return this; } bool itemSortLessThan(const COptimizedKPSetClassTestingItem* item1, const COptimizedKPSetClassTestingItem* item2) { return item1->getSubsumingConceptItemCount() > item2->getSubsumingConceptItemCount(); } QList* COptimizedKPSetClassTestingItem::sortSubsumingConceptItemList() { qSort(mSubsumingConceptItemList.begin(),mSubsumingConceptItemList.end(),itemSortLessThan); return &mSubsumingConceptItemList; } bool COptimizedKPSetClassTestingItem::isEquivalentItem() { return mEquiItem; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setEquivalentItem(bool equivalent) { mEquiItem = equivalent; return this; } bool COptimizedKPSetClassTestingItem::isPredecessorItem() { return mPredOfItem; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setPredecessorItem(bool isPredecessorOfOneItem) { mPredOfItem = isPredecessorOfOneItem; return this; } bool COptimizedKPSetClassTestingItem::isMoreConceptClassificationInformationRequired() { if (mSatTestOrdered || mTestedSat || mUnsatDerivated || mSatDerivated) { return false; } return true; } COptimizedKPSetClassPossibleSubsumptionMap* COptimizedKPSetClassTestingItem::getPossibleSubsumptionMap(bool create) { if (!mPossibleSubsumptionMap && create) { mPossibleSubsumptionMap = new COptimizedKPSetClassPossibleSubsumptionMap(); } return mPossibleSubsumptionMap; } CClassPossibleSubsumptionMap* COptimizedKPSetClassTestingItem::getClassPossibleSubsumptionMap() { return getPossibleSubsumptionMap(false); } QSet* COptimizedKPSetClassTestingItem::getUpPropagationItemSet() { return &mUpPropagationItemSet; } QSet* COptimizedKPSetClassTestingItem::getDownPropagationItemSet() { return &mDownPropagationItemSet; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::addUpPropagationItem(COptimizedKPSetClassTestingItem* item) { mUpPropagationItemSet.insert(item); return this; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::addDownPropagationItem(COptimizedKPSetClassTestingItem* item) { mDownPropagationItemSet.insert(item); return this; } bool COptimizedKPSetClassTestingItem::isPossibleSubsumptionMapInitialized() { return mPossSubsumMapInitialized; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setPossibleSubsumptionMapInitialized(bool initialized) { mPossSubsumMapInitialized = initialized; return this; } bool COptimizedKPSetClassTestingItem::isPropagationConnected() { return mPropagationConnected; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setPropagationConnected(bool connected) { mPropagationConnected = connected; return this; } CClassificationClassPseudoModel* COptimizedKPSetClassTestingItem::getClassPseudoModel() { return &mPseudoModel; } bool COptimizedKPSetClassTestingItem::isClassPseudoModelInitalized() { return mPseudoModelInitialized; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setClassPseudoModelInitalized(bool initialized) { mPseudoModelInitialized = initialized; return this; } QSet* COptimizedKPSetClassTestingItem::getPossibleSubsumedSet(bool create) { if (create && !mPossibleSubsumedSet) { mPossibleSubsumedSet = new QSet(); } return mPossibleSubsumedSet; } QList* COptimizedKPSetClassTestingItem::getPossibleSubsumedList() { return mPossibleSubsumedList; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setPossibleSubsumedList(QList* possSubsumedList) { mPossibleSubsumedList = possSubsumedList; return this; } bool COptimizedKPSetClassTestingItem::hasRemainingPossibleSubsumedItems() { return mPossibleSubsumedList && !mPossibleSubsumedList->isEmpty(); } CCacheEntry* COptimizedKPSetClassTestingItem::getFastSatisfiabilityTestedSaturationCacheEntry() { return mFastSatCacheEntry; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setFastSatisfiabilityTestedSaturationCacheEntry(CCacheEntry* cacheEntry) { mFastSatCacheEntry = cacheEntry; return this; } bool COptimizedKPSetClassTestingItem::hasSuccessfullyFastSatisfiabilityTested() { return mSuccFastSatTested; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassTestingItem::setSuccessfullyFastSatisfiabilityTested(bool successfullyTested) { mSuccFastSatTested = successfullyTested; return this; } CIndividualDependenceTrackingMarker* COptimizedKPSetClassTestingItem::setIndividualDependenceTracked() { mIndiDepTracked = true; return this; } bool COptimizedKPSetClassTestingItem::hasIndividualDependenceTracked() { return mIndiDepTracked; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelRoleMap.cpp0000644000175000017500000000265612520550746032314 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationClassPseudoModelRoleMap.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationClassPseudoModelRoleMap::CClassificationClassPseudoModelRoleMap(CContext* context) : CCLASSPSEUDOMODELMAP(context) { } CClassificationClassPseudoModelRoleMap* CClassificationClassPseudoModelRoleMap::initPseudoModelRoleMap(CClassificationClassPseudoModelRoleMap* roleMap) { if (roleMap) { *this = *roleMap; } return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodeChildrenOrderClassificationItem.h0000644000175000017500000000511712520550754031436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CNODECHILDRENORDERCLASSIFICATIONITEM_H #define KONCLUDE_REASONER_CLASSIFIER_CNODECHILDRENORDERCLASSIFICATIONITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassifierStatistics.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Taxonomy/CTaxonomy.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Taxonomy; namespace Classifier { /*! * * \class CNodeChildrenOrderClassificationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNodeChildrenOrderClassificationItem { // public methods public: //! Constructor CNodeChildrenOrderClassificationItem(CHierarchyNode *node, QHash,double> *subsumptionProbabilisticHash); //! Destructor virtual ~CNodeChildrenOrderClassificationItem(); virtual CHierarchyNode *getTestingNode(); virtual QHash,double> *getSubsumptionProbabilisticHash(); virtual QList > *getSubsumptionCalculationOrderList(); // protected methods protected: // protected variables protected: CHierarchyNode *parentNode; QHash,double> *subsumProbabilisticHash; QList > subsumCalcOrderList; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CNODECHILDRENORDERCLASSIFICATIONITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CSubsumptionClassifierFactory.cpp0000644000175000017500000000222112520550762030621 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSubsumptionClassifierFactory.h" namespace Konclude { namespace Reasoner { namespace Classifier { CSubsumptionClassifierFactory::CSubsumptionClassifierFactory() { } CSubsumptionClassifierFactory::~CSubsumptionClassifierFactory() { } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassifyingCallbackDataContext.cpp0000644000175000017500000000306712520550752030773 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassifyingCallbackDataContext.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassifyingCallbackDataContext::CClassifyingCallbackDataContext(bool classifying, CTaxonomy *taxanomy, CConcreteOntology *ontology) { tax = taxanomy; onto = ontology; ontClassifying = classifying; } CClassifyingCallbackDataContext::~CClassifyingCallbackDataContext() { } CConcreteOntology *CClassifyingCallbackDataContext::getOntology() { return onto; } CTaxonomy *CClassifyingCallbackDataContext::getTaxonomy() { return tax; } bool CClassifyingCallbackDataContext::isClassifying() { return ontClassifying; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CRolePossibleSubsumptionMapIterator.cpp0000644000175000017500000000177312405707542031774 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassPossibleSubsumptionMapIterator.h" namespace Konclude { namespace Reasoner { namespace Classifier { }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/Events/0000755000175000017500000000000012613407252023372 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/Events/CClassifyOntologyEvent.h0000644000175000017500000000574712520550744030177 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_EVENTS_CCLASSIFYONTOLOGYEVENT_H #define KONCLUDE_REASONER_CLASSIFIER_EVENTS_CCLASSIFYONTOLOGYEVENT_H // Libraries includes // Namespace includes #include "../ClassifierSettings.h" #include "../CClassificationCalculationSupport.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Reasoner/Taxonomy/CTaxonomy.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; using namespace Config; namespace Reasoner { using namespace Ontology; using namespace Taxonomy; namespace Classifier { namespace Events { /*! * \class CClassifyOntologyEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CClassifyOntologyEvent : public CCustomEvent { // public methods public: //! Constructor CClassifyOntologyEvent(CConcreteOntology* ontology, CConfigurationBase* configuration, const QList& requirementList, CCallbackData* callbackData = nullptr); //! Destructor virtual ~CClassifyOntologyEvent(); virtual CConcreteOntology *getOntology(); virtual QList* getClassificationRequirementList(); virtual CCallbackData *getCallbackData(); virtual CConfigurationBase *getConfiguration(); static const QEvent::Type EVENTTYPE = EVENTCLASSIFYONTOLOGY; // protected methods protected: // protected variables protected: CConcreteOntology *onto; CTaxonomy *tax; QList mReqList; CConfigurationBase *config; CCallbackData *callback; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_EVENTS_CCLASSIFYONTOLOGYEVENT_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/Events/COntologyTellClassificationMessageEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/Events/COntologyTellClassificationMessageE0000644000175000017500000000331712520550744032347 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyTellClassificationMessageEvent.h" namespace Konclude { namespace Reasoner { namespace Classifier { namespace Events { COntologyTellClassificationMessageEvent::COntologyTellClassificationMessageEvent(CConcreteOntology *ontology, CClassificationMessageData* messageData, CMemoryPool* memoryPool) : CCustomEvent(EVENTTYPE) { mOntology = ontology; mMessageData = messageData; mMemoryPool = memoryPool; } CConcreteOntology *COntologyTellClassificationMessageEvent::getOntology() { return mOntology; } CClassificationMessageData* COntologyTellClassificationMessageEvent::getMessageData() { return mMessageData; } CMemoryPool* COntologyTellClassificationMessageEvent::getMemoryPool() { return mMemoryPool; } }; // end namespace Events }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/Events/CTestCalculatedCallbackEvent.h0000644000175000017500000000647612520550744031205 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_EVENTS_CTESTCALCULATEDUPDATEEVENT_H #define KONCLUDE_REASONER_CLASSIFIER_EVENTS_CTESTCALCULATEDUPDATEEVENT_H // Libraries includes // Namespace includes #include "../ClassifierSettings.h" #include "../CClassificationWorkItem.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Taxonomy/CTaxonomy.h" #include "Concurrent/Callback/CCallbackData.h" #include "Reasoner/Query/CSatisfiableCalculationJob.h" #include "Reasoner/Query/CJobSatisfiableCallbackContextData.h" #include "Reasoner/Classification/CClassificationCalculationStatisticsCollection.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; using namespace Taxonomy; using namespace Classification; using namespace Kernel::Task; namespace Classifier { namespace Events { /*! * \class CTestCalculatedCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CTestCalculatedCallbackEvent : public CCustomEvent, public CJobSatisfiableCallbackContextData, public CCallbackData { // public methods public: //! Constructor CTestCalculatedCallbackEvent(CThread *receiverThread, CSatisfiableCalculationJob *satCalcJob, CClassificationWorkItem *classBoxWorkItem, CClassificationCalculationStatisticsCollection* statisticCollection); //! Destructor virtual ~CTestCalculatedCallbackEvent(); static const QEvent::Type EVENTTYPE = EVENTTESTCALCULATEDCALLBACK; virtual void doCallback(); virtual bool getTestResultSatisfiable(); virtual CSatisfiableCalculationJob *getSatisfiableCalculationJob(); virtual CClassificationWorkItem *getClassificationWorkItem(); CClassificationCalculationStatisticsCollection* getUsedStatisticsCollection(); // protected methods protected: // protected variables protected: CThread *recThread; CSatisfiableCalculationJob* mSatCalcJob; CClassificationWorkItem *workItem; CClassificationCalculationStatisticsCollection* mUsedStatisticsCollection; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_EVENTS_CTESTCALCULATEDUPDATEEVENT_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/Events/COntologyTellClassificationMessageEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/Events/COntologyTellClassificationMessageE0000644000175000017500000000513412520550744032346 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_EVENTS_CONTOLOGYTELLCLASSIFICATIONMESSAGEEVENT_H #define KONCLUDE_REASONER_CLASSIFIER_EVENTS_CONTOLOGYTELLCLASSIFICATIONMESSAGEEVENT_H // Libraries includes // Namespace includes #include "../ClassifierSettings.h" #include "../CClassificationMessageData.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Utilities/Memory/CMemoryPool.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Utilities::Memory; namespace Reasoner { using namespace Ontology; namespace Classifier { namespace Events { /*! * \class COntologyTellClassificationMessageEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class COntologyTellClassificationMessageEvent : public CCustomEvent { // public methods public: //! Constructor COntologyTellClassificationMessageEvent(CConcreteOntology *ontology, CClassificationMessageData* messageData, CMemoryPool* memoryPool); CConcreteOntology* getOntology(); CClassificationMessageData* getMessageData(); CMemoryPool* getMemoryPool(); static const QEvent::Type EVENTTYPE = EVENTONTOLOGYTELLCLASSIFICATIONMESSAGE; // protected methods protected: // protected variables protected: CConcreteOntology* mOntology; CClassificationMessageData* mMessageData; CMemoryPool* mMemoryPool; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_EVENTS_CONTOLOGYTELLCLASSIFICATIONMESSAGEEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/Events/CCallbackClassifiedOntologyEvent.h0000644000175000017500000000515712520550744032100 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_EVENTS_CCallbackClassifiedOntologyEvent_H #define KONCLUDE_REASONER_CLASSIFIER_EVENTS_CCallbackClassifiedOntologyEvent_H // Libraries includes // Namespace includes #include "../ClassifierSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; namespace Classifier { namespace Events { /*! * \class CCallbackClassifiedOntologyEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CCallbackClassifiedOntologyEvent : public CCustomEvent { // public methods public: //! Constructor CCallbackClassifiedOntologyEvent(CConcreteOntology *ontology, CCallbackData *callbackPossibleCallbackData, CCallbackData *classifiedCallbackData); //! Destructor virtual ~CCallbackClassifiedOntologyEvent(); CConcreteOntology *getOntology(); CCallbackData *getClassifiedCallbackData(); CCallbackData *getCallbackPossibleCallbackData(); static const QEvent::Type EVENTTYPE = EVENTCALLBACKCLASSIFIEDONTOLOGY; // protected methods protected: // protected variables protected: CConcreteOntology *onto; CCallbackData *classifiedCallback; CCallbackData *possibleCallback; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_EVENTS_CCallbackClassifiedOntologyEvent_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/Events/CTestCalculatedCallbackEvent.cpp0000644000175000017500000000441312520550744031525 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTestCalculatedCallbackEvent.h" namespace Konclude { namespace Reasoner { namespace Classifier { namespace Events { CTestCalculatedCallbackEvent::CTestCalculatedCallbackEvent(CThread *receiverThread, CSatisfiableCalculationJob *satCalcJob, CClassificationWorkItem *classBoxWorkItem, CClassificationCalculationStatisticsCollection* statisticCollection) : CCustomEvent(EVENTTESTCALCULATEDCALLBACK),CJobSatisfiableCallbackContextData(satCalcJob) { recThread = receiverThread; mSatCalcJob = satCalcJob; workItem = classBoxWorkItem; mUsedStatisticsCollection = statisticCollection; setCallbackDataContext(this); } CTestCalculatedCallbackEvent::~CTestCalculatedCallbackEvent() { takeCallbackDataContext(); } CClassificationWorkItem *CTestCalculatedCallbackEvent::getClassificationWorkItem() { return workItem; } void CTestCalculatedCallbackEvent::doCallback() { recThread->postEvent(this); } bool CTestCalculatedCallbackEvent::getTestResultSatisfiable() { return mSatisfiable; } CSatisfiableCalculationJob *CTestCalculatedCallbackEvent::getSatisfiableCalculationJob() { return mSatCalcJob; } CClassificationCalculationStatisticsCollection* CTestCalculatedCallbackEvent::getUsedStatisticsCollection() { return mUsedStatisticsCollection; } }; // end namespace Events }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/Events/CClassifyOntologyEvent.cpp0000644000175000017500000000356012520550744030521 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassifyOntologyEvent.h" namespace Konclude { namespace Reasoner { namespace Classifier { namespace Events { CClassifyOntologyEvent::CClassifyOntologyEvent(CConcreteOntology* ontology, CConfigurationBase* configuration, const QList& requirementList, CCallbackData* callbackData) : CCustomEvent(EVENTTYPE) { onto = ontology; mReqList = requirementList; callback = callbackData; config = configuration; } CClassifyOntologyEvent::~CClassifyOntologyEvent() { } CConcreteOntology *CClassifyOntologyEvent::getOntology() { return onto; } QList* CClassifyOntologyEvent::getClassificationRequirementList() { return &mReqList; } CCallbackData *CClassifyOntologyEvent::getCallbackData() { return callback; } CConfigurationBase *CClassifyOntologyEvent::getConfiguration() { return config; } }; // end namespace Events }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/Events/CCallbackClassifiedOntologyEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/Events/CCallbackClassifiedOntologyEvent.cp0000644000175000017500000000350412520550744032245 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCallbackClassifiedOntologyEvent.h" namespace Konclude { namespace Reasoner { namespace Classifier { namespace Events { CCallbackClassifiedOntologyEvent::CCallbackClassifiedOntologyEvent(CConcreteOntology *ontology, CCallbackData *callbackPossibleCallbackData, CCallbackData *callbackData) : CCustomEvent(EVENTCALLBACKCLASSIFIEDONTOLOGY) { onto = ontology; classifiedCallback = callbackData; possibleCallback = callbackPossibleCallbackData; } CCallbackClassifiedOntologyEvent::~CCallbackClassifiedOntologyEvent() { } CConcreteOntology *CCallbackClassifiedOntologyEvent::getOntology() { return onto; } CCallbackData *CCallbackClassifiedOntologyEvent::getClassifiedCallbackData() { return classifiedCallback; } CCallbackData *CCallbackClassifiedOntologyEvent::getCallbackPossibleCallbackData() { return possibleCallback; } }; // end namespace Events }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationCalculationSupport.cpp0000644000175000017500000000232312520550744031446 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationCalculationSupport.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationCalculationSupport::CClassificationCalculationSupport() { } CClassificationCalculationSupport::~CClassificationCalculationSupport() { } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationSatisfiableCalculationConceptReferenceLinking.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationSatisfiableCalculationConce0000644000175000017500000000424212520550750032406 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONSATISFIABLECALCULATIONCONCEPTREFERENCELINKING_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONSATISFIABLECALCULATIONCONCEPTREFERENCELINKING_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationConceptReferenceLinking.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CClassificationSatisfiableCalculationConceptReferenceLinking * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationSatisfiableCalculationConceptReferenceLinking : public CClassificationConceptReferenceLinking { // public methods public: //! Constructor CClassificationSatisfiableCalculationConceptReferenceLinking(); virtual bool isMoreConceptClassificationInformationRequired() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONSATISFIABLECALCULATIONCONCEPTREFERENCELINKING_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassPossibleSubsumptionMap.h0000644000175000017500000000370012520550752030060 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSPOSSIBLESUBSUMPTIONMAP_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSPOSSIBLESUBSUMPTIONMAP_H // Libraries includes #include // Namespace includes #include "ClassifierSettings.h" #include "CClassPossibleSubsumptionMapIterator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Classifier { /*! * * \class CClassPossibleSubsumptionMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassPossibleSubsumptionMap { // public methods public: virtual bool hasRemainingPossibleSubsumptions() = 0; virtual CClassPossibleSubsumptionMapIterator* getIterator(CClassPossibleSubsumptionMapIterator* reuseIterator, CContext* context) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSPOSSIBLESUBSUMPTIONMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassTestingItem.h0000644000175000017500000002046012520550760030422 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSTESTINGITEM_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSTESTINGITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "COptimizedKPSetClassPossibleSubsumptionMap.h" #include "CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking.h" #include "CClassificationClassPseudoModel.h" #include "CConceptSubsumerObserver.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptSatisfiableReferenceLinkingData.h" #include "Reasoner/Consistiser/CIndividualDependenceTrackingMarker.h" #include "Reasoner/Taxonomy/CHierarchyNode.h" #include "Reasoner/Kernel/Cache/CCacheEntry.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Taxonomy; using namespace Consistiser; using namespace Kernel::Cache; namespace Classifier { /*! * * \class COptimizedKPSetClassTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetClassTestingItem : public CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking, public CConceptSubsumerObserver, public CIndividualDependenceTrackingMarker { // public methods public: //! Constructor COptimizedKPSetClassTestingItem(); ~COptimizedKPSetClassTestingItem(); COptimizedKPSetClassTestingItem* initSatisfiableTestingItem(CConcept* satTestConcept, QHash* conRefLinkDataHash); CConcept* getTestingConcept(); CHierarchyNode* getSatisfiableConceptHierarchyNode(); COptimizedKPSetClassTestingItem* setSatisfiableConceptHierarchyNode(CHierarchyNode* hierNode); QSet* getSubsumingConceptItemSet(); QList* getSubsumingConceptItemList(); cint64 getSubsumingConceptItemCount() const; bool hasSubsumerConceptItem(COptimizedKPSetClassTestingItem* item); QList* getSuccessorItemList(); cint64 getUnprocessedPredecessorItemCount(); bool hasOnlyProcessedPredecessorItems(); COptimizedKPSetClassTestingItem* decUnprocessedPredecessorItems(cint64 decCount = 1); COptimizedKPSetClassTestingItem* incUnprocessedPredecessorItems(cint64 incCount = 1); COptimizedKPSetClassTestingItem* setUnprocessedPredecessorItems(cint64 predCount); COptimizedKPSetClassTestingItem* addSuccessorSatisfiableTestItem(COptimizedKPSetClassTestingItem* succItem); bool isSatisfiableTestOrdered(); bool isSatisfiableTested(); bool isResultUnsatisfiableDerivated(); bool isResultSatisfiableDerivated(); bool getSatisfiableTestedResult(); COptimizedKPSetClassTestingItem* setSatisfiableTestOrdered(bool satTestOrdered); COptimizedKPSetClassTestingItem* setSatisfiableTested(bool satTested); COptimizedKPSetClassTestingItem* setResultUnsatisfiableDerivated(bool unsatDerivated); COptimizedKPSetClassTestingItem* setResultSatisfiableDerivated(bool satDerivated); COptimizedKPSetClassTestingItem* setSatisfiableTestedResult(bool satTestedResult); COptimizedKPSetClassTestingItem* addSubsumingConceptItem(COptimizedKPSetClassTestingItem* subsumingItem); CConceptSubsumerObserver* tellConceptSupsumption(CConcept* subsumedConcept, CConcept* subsumerConcept); QList* sortSubsumingConceptItemList(); bool isEquivalentItem(); COptimizedKPSetClassTestingItem* setEquivalentItem(bool equivalent); bool isPredecessorItem(); COptimizedKPSetClassTestingItem* setPredecessorItem(bool isPredecessorOfOneItem); bool isMoreConceptClassificationInformationRequired(); COptimizedKPSetClassPossibleSubsumptionMap* getPossibleSubsumptionMap(bool create = false); QSet* getUpPropagationItemSet(); QSet* getDownPropagationItemSet(); COptimizedKPSetClassTestingItem* addUpPropagationItem(COptimizedKPSetClassTestingItem* item); COptimizedKPSetClassTestingItem* addDownPropagationItem(COptimizedKPSetClassTestingItem* item); bool isPropagationConnected(); COptimizedKPSetClassTestingItem* setPropagationConnected(bool connected); virtual CClassPossibleSubsumptionMap* getClassPossibleSubsumptionMap(); bool isPossibleSubsumptionMapInitialized(); COptimizedKPSetClassTestingItem* setPossibleSubsumptionMapInitialized(bool initialized); CClassificationClassPseudoModel* getClassPseudoModel(); bool isClassPseudoModelInitalized(); COptimizedKPSetClassTestingItem* setClassPseudoModelInitalized(bool initialized); QSet* getPossibleSubsumedSet(bool create); QList* getPossibleSubsumedList(); COptimizedKPSetClassTestingItem* setPossibleSubsumedList(QList* possSubsumedList); bool hasRemainingPossibleSubsumedItems(); CCacheEntry* getFastSatisfiabilityTestedSaturationCacheEntry(); COptimizedKPSetClassTestingItem* setFastSatisfiabilityTestedSaturationCacheEntry(CCacheEntry* cacheEntry); bool hasSuccessfullyFastSatisfiabilityTested(); COptimizedKPSetClassTestingItem* setSuccessfullyFastSatisfiabilityTested(bool successfullyTested); virtual CIndividualDependenceTrackingMarker* setIndividualDependenceTracked(); bool hasIndividualDependenceTracked(); // protected methods protected: // protected variables protected: CConcept* mConceptSat; CHierarchyNode* mConSatHierNode; QSet mSubsumingConceptItemSet; QList mSubsumingConceptItemList; QList mSuccList; cint64 mPredCounter; // true, if the satisfiability testing for this concept has started bool mSatTestOrdered; // true, if the satisfiability testing has finished bool mTestedSat; // true, if for a super concept the unsatisfiability has been discovered bool mUnsatDerivated; // true, if for the concept the satisfiability has been extracted from a completion graph bool mSatDerivated; // true of false if the concept is satisfiable respectively unsatisfiable bool mSatTestedResult; bool mPropagationConnected; QSet mUpPropagationItemSet; QSet mDownPropagationItemSet; QSet* mPossibleSubsumedSet; QList* mPossibleSubsumedList; bool mEquiItem; bool mPredOfItem; COptimizedKPSetClassPossibleSubsumptionMap* mPossibleSubsumptionMap; bool mPossSubsumMapInitialized; //QString mSubsumingConceptString; CClassificationClassPseudoModel mPseudoModel; bool mPseudoModelInitialized; CCacheEntry* mFastSatCacheEntry; bool mSuccFastSatTested; bool mIndiDepTracked; QHash* mConRefLinkDataHash; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSTESTINGITEM_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelConceptMap.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelConceptMap.0000644000175000017500000000457212520550744032300 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELCONCEPTMAP_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELCONCEPTMAP_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationClassPseudoModelConceptData.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CConceptTagComparer.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CClassificationClassPseudoModelConceptMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationClassPseudoModelConceptMap : public CCLASSPSEUDOMODELMAP { // public methods public: //! Constructor CClassificationClassPseudoModelConceptMap(CContext* context); CClassificationClassPseudoModelConceptMap* initPseudoModelConceptMap(CClassificationClassPseudoModelConceptMap* conMap); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELCONCEPTMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationSubsumptionMessageData.cpp0000644000175000017500000000326312520550750032243 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationSubsumptionMessageData.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationSubsumptionMessageData::CClassificationSubsumptionMessageData() { mMessageDataType = TELLCLASSSUBSUMPTION; } CClassificationSubsumptionMessageData* CClassificationSubsumptionMessageData::initClassificationSubsumptionMessageData(CConcept* subsumedConcept, CCLASSSUBSUMPTIONMESSAGELIST* subsumerList) { mSubsumedConcept = subsumedConcept; mSubsumerList = subsumerList; return this; } CCLASSSUBSUMPTIONMESSAGELIST* CClassificationSubsumptionMessageData::getClassSubsumerList() { return mSubsumerList; } CConcept* CClassificationSubsumptionMessageData::getSubsumedConcept() { return mSubsumedConcept; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelDeterministicFlag.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelDeterminist0000644000175000017500000000316212520550746032454 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationClassPseudoModelDeterministicFlag.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationClassPseudoModelDeterministicFlag::CClassificationClassPseudoModelDeterministicFlag() { mDeterministicFlag = false; } bool CClassificationClassPseudoModelDeterministicFlag::isDeterministic() const { return mDeterministicFlag; } bool CClassificationClassPseudoModelDeterministicFlag::isNonDeterministic() const { return !mDeterministicFlag; } bool CClassificationClassPseudoModelDeterministicFlag::setDeterministic(bool deterministic) { bool different = mDeterministicFlag != deterministic; mDeterministicFlag = deterministic; return different; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CRolePossibleSubsumptionMap.h0000644000175000017500000000367212405707542027727 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSPOSSIBLESUBSUMPTIONMAP_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSPOSSIBLESUBSUMPTIONMAP_H // Libraries includes #include // Namespace includes #include "ClassifierSettings.h" #include "CClassPossibleSubsumptionMapIterator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Classifier { /*! * * \class CClassPossibleSubsumptionMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassPossibleSubsumptionMap { // public methods public: virtual bool hasRemainingPossibleSubsumptions() = 0; virtual CClassPossibleSubsumptionMapIterator* getIterator(CClassPossibleSubsumptionMapIterator* reuseIterator, CContext* context) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSPOSSIBLESUBSUMPTIONMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationWorkItem.cpp0000644000175000017500000000612012520550750027350 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationWorkItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationWorkItem::CClassificationWorkItem(CSatisfiableCalculationJob* satCalcJob, CConcept *satisfiableTestedConcept) { mSatCalcJob = satCalcJob; testValid = true; conceptSatisfiableTest = true; conceptSubsumptionTest = false; con0 = satisfiableTestedConcept; con1 = 0; } CClassificationWorkItem::CClassificationWorkItem(CSatisfiableCalculationJob* satCalcJob, CConcept *subsumerTestedConcept, CConcept *subsumedTestedConcept) { mSatCalcJob = satCalcJob; testValid = true; conceptSatisfiableTest = false; conceptSubsumptionTest = true; con0 = subsumerTestedConcept; con1 = subsumedTestedConcept; } CClassificationWorkItem::~CClassificationWorkItem() { } bool CClassificationWorkItem::isConceptSatisfiableTest() { return conceptSatisfiableTest; } bool CClassificationWorkItem::isConceptSubsumptionTest() { return conceptSubsumptionTest; } CConcept *CClassificationWorkItem::getSatisfiableTestedConcept() { if (conceptSatisfiableTest) { return con0; } return 0; } CConcept *CClassificationWorkItem::getSubsumerTestedConcept() { if (conceptSubsumptionTest) { return con0; } return 0; } CConcept *CClassificationWorkItem::getSubsumedTestedConcept() { if (conceptSubsumptionTest) { return con1; } return 0; } bool CClassificationWorkItem::isTestValid() { return testValid; } CClassificationWorkItem *CClassificationWorkItem::setTestInvalid() { testValid = false; return this; } CSatisfiableCalculationJob* CClassificationWorkItem::getSatisfiableCalculationJob() { return mSatCalcJob; } bool CClassificationWorkItem::testIsTestRedundant(CTaxonomy *taxonomy) { bool redundant = false; if (conceptSatisfiableTest) { if (taxonomy->isSatisfiable(con0) || taxonomy->isNotSatisfiable(con0)) { redundant = true; } } else if (conceptSubsumptionTest) { if (taxonomy->isSubsumption(con0,con1) || taxonomy->isNotSubsumption(con0,con1)) { redundant = true; } } return redundant; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedConceptSaturationSatisfiableTestingItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedConceptSaturationSatisfiableTest0000644000175000017500000001153212520550756032524 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedConceptSaturationSatisfiableTestingItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedConceptSaturationSatisfiableTestingItem::COptimizedConceptSaturationSatisfiableTestingItem() { } COptimizedConceptSaturationSatisfiableTestingItem* COptimizedConceptSaturationSatisfiableTestingItem::initConceptSatisfiableTestingItem(CConcept* satTestConcept) { mConceptSat = satTestConcept; mConRefLinking = nullptr; mSpecialItemReference = nullptr; mSpecialReferenceMode = NONESATURATIONMODE; mOrderingQueued = false; mSucessorsItems = false; mPilingReference = false; mMultiplePredItems = false; return this; } CConcept* COptimizedConceptSaturationSatisfiableTestingItem::getSatisfiableConcept() { return mConceptSat; } bool COptimizedConceptSaturationSatisfiableTestingItem::isClassSatisfiableTestingItem() { return false; } CConceptReferenceLinking* COptimizedConceptSaturationSatisfiableTestingItem::getConceptReferenceLinking() { return mConRefLinking; } COptimizedConceptSaturationSatisfiableTestingItem* COptimizedConceptSaturationSatisfiableTestingItem::setConceptReferenceLinking(CConceptReferenceLinking* refLinking) { mConRefLinking = refLinking; return this; } COptimizedConceptSaturationSatisfiableTestingItem* COptimizedConceptSaturationSatisfiableTestingItem::getSpecialItemReference() { return mSpecialItemReference; } COptimizedConceptSaturationSatisfiableTestingItem* COptimizedConceptSaturationSatisfiableTestingItem::setSpecialItemReference(COptimizedConceptSaturationSatisfiableTestingItem* reference) { mSpecialItemReference = reference; return this; } COptimizedConceptSaturationSatisfiableTestingItem::SATURATIONITEMREFERENCESPECIALMODE COptimizedConceptSaturationSatisfiableTestingItem::getSpecialReferenceMode() { return mSpecialReferenceMode; } COptimizedConceptSaturationSatisfiableTestingItem* COptimizedConceptSaturationSatisfiableTestingItem::setSpecialItemReferenceMode(COptimizedConceptSaturationSatisfiableTestingItem::SATURATIONITEMREFERENCESPECIALMODE mode) { mSpecialReferenceMode = mode; return this; } bool COptimizedConceptSaturationSatisfiableTestingItem::isOrderingQueued() { return mOrderingQueued; } COptimizedConceptSaturationSatisfiableTestingItem* COptimizedConceptSaturationSatisfiableTestingItem::setOrderingQueued(bool queued) { mOrderingQueued = queued; return this; } bool COptimizedConceptSaturationSatisfiableTestingItem::hasIndirectSuccessorsItems() { return mSucessorsItems; } COptimizedConceptSaturationSatisfiableTestingItem* COptimizedConceptSaturationSatisfiableTestingItem::setIndirectSuccessorsItems(bool hasSuccessors) { mSucessorsItems = hasSuccessors; return this; } bool COptimizedConceptSaturationSatisfiableTestingItem::hasPilingReferenceItem() { return mPilingReference; } COptimizedConceptSaturationSatisfiableTestingItem* COptimizedConceptSaturationSatisfiableTestingItem::setPilingReferenceItem(bool piledReference) { mPilingReference = piledReference; return this; } QList* COptimizedConceptSaturationSatisfiableTestingItem::getExistReferenceConceptItemList() { return &mExistReferenceItemList; } COptimizedConceptSaturationSatisfiableTestingItem* COptimizedConceptSaturationSatisfiableTestingItem::addExistReferenceConceptItemList(COptimizedConceptSaturationSatisfiableTestingItem* existItem) { mExistReferenceItemList.append(existItem); return this; } bool COptimizedConceptSaturationSatisfiableTestingItem::hasMultipleDirectPredecessorsItems() { return mMultiplePredItems; } COptimizedConceptSaturationSatisfiableTestingItem* COptimizedConceptSaturationSatisfiableTestingItem::setMultipleDirectPredecessorsItems(bool multiblePredItems) { mMultiplePredItems = multiblePredItems; return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000021400000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationSatisfiablePossibleSubsumpt0000644000175000017500000000505012520550750032521 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONSATISFIABLEPOSSIBLESUBSUMPTIONCALCULATIONCONCEPTREFERENCELINKING_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONSATISFIABLEPOSSIBLESUBSUMPTIONCALCULATIONCONCEPTREFERENCELINKING_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationSatisfiableCalculationConceptReferenceLinking.h" #include "CClassPossibleSubsumptionMap.h" #include "CClassificationClassPseudoModel.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking : public CClassificationSatisfiableCalculationConceptReferenceLinking { // public methods public: //! Constructor CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking(); virtual CClassPossibleSubsumptionMap* getClassPossibleSubsumptionMap() = 0; virtual bool isPossibleSubsumptionMapInitialized() = 0; virtual CClassificationClassPseudoModel* getClassPseudoModel() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONSATISFIABLEPOSSIBLESUBSUMPTIONCALCULATIONCONCEPTREFERENCELINKING_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassSubsumptionClassifierContext.h0000644000175000017500000000504012520550752031272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSSUBSUMPTIONCLASSIFIERCONTEXT_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSSUBSUMPTIONCLASSIFIERCONTEXT_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes #include "Context/CContext.h" #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" #include "Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Classifier { /*! * * \class CClassSubsumptionClassifierContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassSubsumptionClassifierContext : public CContext { // public methods public: //! Constructor CClassSubsumptionClassifierContext(); virtual ~CClassSubsumptionClassifierContext(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); virtual CMemoryPoolAllocationManager* getMemoryPoolAllocationManager(); virtual CMemoryPoolProvider* getMemoryPoolProvider(); // protected methods protected: // protected variables protected: CMemoryPoolAllocationManager* mMemMan; CMemoryPoolProvider* mMemoryPoolProvider; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSSUBSUMPTIONCLASSIFIERCONTEXT_H ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedClassExtractedSaturationSatisfiableTestingItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedClassExtractedSaturationSatisfia0000644000175000017500000001031512520550756032515 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDCLASSEXTRACTEDSATURATIONSATISFIABLETESTINGITEM_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDCLASSEXTRACTEDSATURATIONSATISFIABLETESTINGITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CConceptSubsumerObserver.h" #include "CClassificationConceptReferenceLinking.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptReferenceLinking.h" #include "Reasoner/Ontology/CConceptSatisfiableReferenceLinkingData.h" #include "Reasoner/Taxonomy/CHierarchyNode.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Taxonomy; namespace Classifier { /*! * * \class COptimizedClassExtractedSaturationSatisfiableTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedClassExtractedSaturationSatisfiableTestingItem : public CClassificationConceptReferenceLinking, public CConceptSubsumerObserver { // public methods public: //! Constructor COptimizedClassExtractedSaturationSatisfiableTestingItem(); COptimizedClassExtractedSaturationSatisfiableTestingItem* initSatisfiableTestingItem(CConcept* satTestConcept); CConcept* getTestingConcept(); CHierarchyNode* getSatisfiableConceptHierarchyNode(); COptimizedClassExtractedSaturationSatisfiableTestingItem* setSatisfiableConceptHierarchyNode(CHierarchyNode* hierNode); QList* getSubsumingConceptItemList(); COptimizedClassExtractedSaturationSatisfiableTestingItem* setExtractionSubsumerCount(cint64 subsumerCount); cint64 getExtractionSubsumerCount() const; COptimizedClassExtractedSaturationSatisfiableTestingItem* setDirectSubsumer(COptimizedClassExtractedSaturationSatisfiableTestingItem* subsumingItem); COptimizedClassExtractedSaturationSatisfiableTestingItem* getDirectSubsumer(); bool hasDirectSubsumer(); COptimizedClassExtractedSaturationSatisfiableTestingItem* addSubsumingConceptItem(COptimizedClassExtractedSaturationSatisfiableTestingItem* subsumingItem); CConceptSubsumerObserver* tellConceptSupsumption(CConcept* subsumedConcept, CConcept* subsumerConcept); QList* sortSubsumingConceptItemList(); bool isEquivalentItem(); COptimizedClassExtractedSaturationSatisfiableTestingItem* setEquivalentItem(bool equivalent); bool isPredecessorItem(); COptimizedClassExtractedSaturationSatisfiableTestingItem* setPredecessorItem(bool predecessorItem); // protected methods protected: // protected variables protected: CConcept* mTestConcept; CHierarchyNode* mConSatHierNode; QList mSubsumingConceptItemList; COptimizedClassExtractedSaturationSatisfiableTestingItem* mDirectSubsumerItem; cint64 mExtractedSubsumerCount; bool mEquiItem; bool mPredecessorItem; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDCLASSEXTRACTEDSATURATIONSATISFIABLETESTINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CPartialPruningTaxonomy.cpp0000644000175000017500000004157512520550762027451 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPartialPruningTaxonomy.h" namespace Konclude { namespace Reasoner { namespace Classifier { CPartialPruningTaxonomy::CPartialPruningTaxonomy(CConcept *topConcept, CConcept *bottomConcept) : CTaxonomy(new CPartialPruningHierarchyNode(topConcept),new CPartialPruningHierarchyNode(bottomConcept)) { activeNodeSet.insert(bottomNode); confPruneRelations = true; confDerivateRelations = true; statistics = 0; testCompStatistics = 0; } CPartialPruningTaxonomy::~CPartialPruningTaxonomy() { if (statistics) { delete statistics; } } CPartialPruningTaxonomy *CPartialPruningTaxonomy::createStatistics(CClassifierStatistics *nextClassificationStatistics) { testCompStatistics = nextClassificationStatistics; if (!statistics) { statistics = new CClassifierStatistics(nextClassificationStatistics); } return this; } CPartialPruningTaxonomy *CPartialPruningTaxonomy::readConfig(CConfigurationBase *config) { confPruneRelations = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Classification.PruneSubsumptionRelations",false); confDerivateRelations = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Classification.DerivateSubsumptionRelations",false); return this; } CTaxonomy *CPartialPruningTaxonomy::setConceptSatisfiable(CConcept *concept, bool satisfiable) { if (satisfiable) { CHierarchyNode *conNode = getHierarchyNode(concept); if (conNode != topNode && !conNode->hasParentNode(topNode)) { activeNodeSet.insert(conNode); topNode->makeChild(conNode); conNode->makeChild(bottomNode); ((CPartialPruningHierarchyNode *)topNode)->repairChildNodes(statistics); ((CPartialPruningHierarchyNode *)conNode)->repairParentNodes(statistics); //((CPartialPruningHierarchyNode *)topNode)->repairChildsParentNodeReplacement(conNode,statistics); //((CPartialPruningHierarchyNode *)conNode)->repairParentNodeInsertion(topNode,statistics); conNode->addIncompatiblePredecessorNode(bottomNode); bottomNode->addIncompatibleSuccessorNode(conNode); if (statistics) { // inc statistics to top concepts statistics->incDerivatedTestedSubsumptionCount(topNode->getEquivalentConceptCount()*conNode->getEquivalentConceptCount()); // inc statistics to bottom concepts statistics->incDerivatedTestedSubsumptionCount(bottomNode->getEquivalentConceptCount()*conNode->getEquivalentConceptCount()); statistics->incPrunedTestedSubsumptionCount(bottomNode->getEquivalentConceptCount()*conNode->getEquivalentConceptCount()); } if (confDerivateRelations) { ((CPartialPruningHierarchyNode *)conNode)->propagateTransitiveRelations(statistics); } } else if (conNode == topNode) { activeNodeSet.insert(topNode); topNode->addIncompatiblePredecessorNode(bottomNode); bottomNode->addIncompatibleSuccessorNode(topNode); if (statistics) { statistics->incDerivatedTestedSubsumptionCount(bottomNode->getEquivalentConceptCount()*topNode->getEquivalentConceptCount()); statistics->incPrunedTestedSubsumptionCount(bottomNode->getEquivalentConceptCount()*topNode->getEquivalentConceptCount()); } if (confDerivateRelations) { ((CPartialPruningHierarchyNode *)conNode)->propagateTransitiveRelations(statistics); } } } else { CHierarchyNode *conNode = getHierarchyNode(concept,false); activeNodeSet.remove(conNode); if (conNode == topNode) { topNode = bottomNode; } bottomNode->addEquivalentConcept(concept); conNodeHash.insert(concept,bottomNode); } #ifdef DEBUGTESTTAXONOMYCONSITENCE testTaxonomyConsistence(); #endif return this; } CTaxonomy *CPartialPruningTaxonomy::setConceptSubsumption(CConcept *subsumerConcept, CConcept *subsumedConcept) { CHierarchyNode *subsumedNode = getHierarchyNode(subsumedConcept); CHierarchyNode *subsumerNode = getHierarchyNode(subsumerConcept); if (subsumedNode != subsumerNode && !subsumedNode->hasSuccessorNode(subsumerNode)) { bool makeEquivalent = subsumerNode->hasSuccessorNode(subsumedNode); if (makeEquivalent) { //taxString = getConceptHierarchyString(); ((CPartialPruningHierarchyNode *)subsumedNode)->mergeToParentNode(subsumerNode,statistics); QList *eqList = subsumedNode->getEquivalentConceptList(); foreach (CConcept *concept, *eqList) { CHierarchyNode *prevNode = conNodeHash.value(concept); if (prevNode != subsumedNode) { setInactiveNode(prevNode); conNodeHash.insert(concept,subsumedNode); } } //QString taxString2 = getConceptHierarchyString(); #ifdef DEBUGTESTTAXONOMYCONSITENCE testTaxonomyConsistence(); #endif } else { subsumedNode->makeChild(subsumerNode); // for all common predecessors and successors repair quasi ordering relation ((CPartialPruningHierarchyNode *)subsumedNode)->repairChildNodes(statistics); ((CPartialPruningHierarchyNode *)subsumedNode)->repairParentNodes(statistics); ((CPartialPruningHierarchyNode *)subsumerNode)->repairParentNodes(statistics); ((CPartialPruningHierarchyNode *)subsumerNode)->repairChildNodes(statistics); //((CPartialPruningHierarchyNode *)subsumedNode)->repairChildsParentNodeReplacement(subsumerNode,statistics); //((CPartialPruningHierarchyNode *)subsumerNode)->repairParentNodeInsertion(subsumedNode,statistics); } if (confDerivateRelations) { ((CPartialPruningHierarchyNode *)subsumerNode)->propagateTransitiveRelations(statistics); ((CPartialPruningHierarchyNode *)subsumedNode)->propagateTransitiveRelations(statistics); } } #ifdef DEBUGTESTTAXONOMYCONSITENCE testTaxonomyConsistence(); #endif return this; } CTaxonomy *CPartialPruningTaxonomy::setConceptNotSubsumption(CConcept *notSubsumerConcept, CConcept *notSubsumedConcept) { CHierarchyNode *notSubsumedNode = getHierarchyNode(notSubsumedConcept); CHierarchyNode *notSubsumerNode = getHierarchyNode(notSubsumerConcept); if (statistics) { statistics->incPrunedTestedSubsumptionCount(-notSubsumedNode->getEquivalentConceptCount()*notSubsumerNode->getEquivalentConceptCount()); } if (confPruneRelations) { ((CPartialPruningHierarchyNode *)notSubsumerNode)->pruneTransitiveRelations(notSubsumedNode,statistics); } if (confDerivateRelations) { ((CPartialPruningHierarchyNode *)notSubsumerNode)->propagateTransitiveRelations(statistics); ((CPartialPruningHierarchyNode *)notSubsumedNode)->propagateTransitiveRelations(statistics); } #ifdef DEBUGTESTTAXONOMYCONSITENCE testTaxonomyConsistence(); #endif return this; } CTaxonomy *CPartialPruningTaxonomy::setConceptDisjoints(CConcept *disjointConcept1, CConcept *disjointConcept2) { CHierarchyNode *disjNode1 = getHierarchyNode(disjointConcept1); CHierarchyNode *disjNode2 = getHierarchyNode(disjointConcept2); if (!disjNode1->hasIncompatiblePredecessorNode(disjNode2)) { if (confPruneRelations) { ((CPartialPruningHierarchyNode *)disjNode1)->pruneTransitiveRelations(disjNode2,statistics); } if (confDerivateRelations) { ((CPartialPruningHierarchyNode *)disjNode1)->propagateTransitiveRelations(statistics); ((CPartialPruningHierarchyNode *)disjNode2)->propagateTransitiveRelations(statistics); } } if (!disjNode2->hasIncompatiblePredecessorNode(disjNode1)) { if (confPruneRelations) { ((CPartialPruningHierarchyNode *)disjNode2)->pruneTransitiveRelations(disjNode1,statistics); } if (confDerivateRelations) { ((CPartialPruningHierarchyNode *)disjNode2)->propagateTransitiveRelations(statistics); ((CPartialPruningHierarchyNode *)disjNode1)->propagateTransitiveRelations(statistics); } } disjNode2->makeDisjoint(disjNode1); if (confDerivateRelations) { ((CPartialPruningHierarchyNode *)disjNode2)->propagateTransitiveRelations(statistics); ((CPartialPruningHierarchyNode *)disjNode1)->propagateTransitiveRelations(statistics); } #ifdef DEBUGTESTTAXONOMYCONSITENCE testTaxonomyConsistence(); #endif return this; } CHierarchyNode *CPartialPruningTaxonomy::createHierarchyNode(CConcept *concept) { return new CPartialPruningHierarchyNode(concept); } void CPartialPruningTaxonomy::testTaxonomyConsistence() { //#ifdef DEBUGTESTTAXONOMYCONSITENCE // taxString = getConceptHierarchyString(); //#endif //for (QList::iterator it = nodeContainer.begin(); it != nodeContainer.end(); ++it) { // CHierarchyNode* node = *it; // if (node->getParentNodeSet()->isEmpty() && node->isActive() && node->getOneEquivalentConcept()->getConceptTag() != 0 && node->getOneEquivalentConcept()->getConceptTag() != 1) { // bool bug = true; // } //} //for (QHash::iterator conIt = conNodeHash.begin(), conItEnd = conNodeHash.end(); conIt != conItEnd; ++conIt) { // CConcept* con = conIt.key(); // cint count = 0; // CHierarchyNode* firstNode = nullptr; // for (QList::iterator it = nodeContainer.begin(); it != nodeContainer.end(); ++it) { // CHierarchyNode* node = *it; // if (node->isActive() && node->getEquivalentConceptList()->count(con) > 0) { // count += node->getEquivalentConceptList()->count(con); // if (count > 1) { // bool bug = true; // } // firstNode = node; // } // } //} //if (testCompStatistics) { // testSubsumptionStatistics(testCompStatistics->getTestedSubsumptionCount()); //} //for (QHash::const_iterator it = conNodeHash.constBegin(), itEnd = conNodeHash.constEnd(); it != itEnd; ++it) { // CHierarchyNode *node = *it; //if (node->getEquivalentConceptsNodeString() == "#Existential" || node->getEquivalentConceptsNodeString() == "#EliminateExistential2") { // foreach (CHierarchyNode *otherNode, *node->getIncompatiblePredecessorNodeSet()) { // if (otherNode->getEquivalentConceptsNodeString() == "#Existential" || otherNode->getEquivalentConceptsNodeString() == "#EliminateExistential2") { // bool bug = true; // } // } // foreach (CHierarchyNode *otherNode, *node->getSuccessorNodeSet()) { // if (otherNode->getEquivalentConceptsNodeString() == "#Existential" || otherNode->getEquivalentConceptsNodeString() == "#EliminateExistential2") { // bool bug = true; // } // } //} // if (isActiveNode(node)) { // bool consistence = true; // foreach (CHierarchyNode *otherNode, node->getPredecessorNodeList()) { // if (isActiveNode(otherNode) && node != bottomNode) { // if (node->hasIncompatiblePredecessorNode(otherNode)) { // consistence = false; // } // } // } // foreach (CHierarchyNode *otherNode, node->getSuccessorNodeList()) { // if (otherNode != bottomNode && node->hasIncompatibleSuccessorNode(otherNode) && isActiveNode(otherNode)) { // consistence = false; // } // } // foreach (CHierarchyNode *otherNode, node->getChildNodeList()) { // if (!otherNode->hasParentNode(node) && isActiveNode(otherNode)) { // consistence = false; // } // if (!otherNode->hasPredecessorNode(node) && isActiveNode(otherNode)) { // consistence = false; // } // } // foreach (CHierarchyNode *otherNode, node->getParentNodeList()) { // if (!otherNode->hasChildNode(node) && isActiveNode(otherNode)) { // consistence = false; // } // if (!otherNode->hasSuccessorNode(node) && isActiveNode(otherNode)) { // consistence = false; // } // } // foreach (CHierarchyNode *otherNode, node->getPredecessorNodeList()) { // if (!otherNode->hasSuccessorNode(node) && isActiveNode(otherNode)) { // consistence = false; // } // } // foreach (CHierarchyNode *otherNode, node->getSuccessorNodeList()) { // if (!otherNode->hasPredecessorNode(node) && isActiveNode(otherNode)) { // consistence = false; // } // } // foreach (CHierarchyNode *otherNode, *node->getIncompatiblePredecessorNodeSet()) { // if (!otherNode->hasIncompatibleSuccessorNode(node) && isActiveNode(otherNode) && node != bottomNode) { // consistence = false; // } // } // foreach (CHierarchyNode *otherNode, *node->getIncompatibleSuccessorNodeSet()) { // if (!otherNode->hasIncompatiblePredecessorNode(node) && isActiveNode(otherNode)) { // consistence = false; // } // } // if (!consistence) { // LOG(ERROR,"::Konclude::Taxonomy::PartialPruningTaxonomy",logTr("Taxonomy inconsistence detected."),this); // } // } //} } void CPartialPruningTaxonomy::testSubsumptionStatistics(qint64 subsumCount) { qint64 testSubSumCount = 0; QSet checkedSet; for (QHash::const_iterator it = conNodeHash.constBegin(), itEnd = conNodeHash.constEnd(); it != itEnd; ++it) { CHierarchyNode *node = *it; qint64 thisNodeSubSumCount = 0; if (isActiveNode(node) && !checkedSet.contains(node)) { checkedSet.insert(node); if (node->getEquivalentConceptCount() > 1) { thisNodeSubSumCount += node->getEquivalentConceptCount(); } foreach (CHierarchyNode *otherNode, node->getPredecessorNodeList()) { if (isActiveNode(otherNode)) { thisNodeSubSumCount += node->getEquivalentConceptCount() * otherNode->getEquivalentConceptCount(); } } foreach (CHierarchyNode *otherNode, *node->getIncompatiblePredecessorNodeSet()) { if (isActiveNode(otherNode)) { thisNodeSubSumCount += node->getEquivalentConceptCount() * otherNode->getEquivalentConceptCount(); } } } testSubSumCount += thisNodeSubSumCount; } if (subsumCount != testSubSumCount) { bool bug = true; } } CTaxonomy *CPartialPruningTaxonomy::completeUnknownAsNonSubsumptions() { foreach (CHierarchyNode *updateNode, bottomNode->getParentNodeList()) { QSet *parentNodeSet = updateNode->getParentNodeSet(); for (QSet::const_iterator it1 = parentNodeSet->constBegin(), it1End = parentNodeSet->constEnd(); it1 != it1End; ++it1) { CHierarchyNode *parentNode(*it1); if (!updateNode->hasIncompatibleSuccessorNode(parentNode)) { setConceptNotSubsumption(parentNode->getOneEquivalentConcept(),updateNode->getOneEquivalentConcept()); } QSet *predNodeSet = updateNode->getPredecessorNodeSet(); for (QSet::const_iterator it1 = predNodeSet->constBegin(), it1End = predNodeSet->constEnd(); it1 != it1End; ++it1) { CHierarchyNode *predNode(*it1); QSet *predChildNodeSet = predNode->getChildNodeSet(); for (QSet::const_iterator it2 = predChildNodeSet->constBegin(), it2End = predChildNodeSet->constEnd(); it2 != it2End; ++it2) { CHierarchyNode *predChildNode(*it2); for (QSet::const_iterator it3 = predChildNodeSet->constBegin(), it3End = predChildNodeSet->constEnd(); it3 != it3End; ++it3) { CHierarchyNode *otherPredChildNode(*it3); if (predChildNode != otherPredChildNode) { if (!predChildNode->hasIncompatiblePredecessorNode(otherPredChildNode)) { setConceptNotSubsumption(predChildNode->getOneEquivalentConcept(),otherPredChildNode->getOneEquivalentConcept()); } } } if (predChildNode != updateNode) { if (!updateNode->hasPredecessorNode(predChildNode) && !updateNode->hasIncompatiblePredecessorNode(predChildNode)) { setConceptNotSubsumption(updateNode->getOneEquivalentConcept(),predChildNode->getOneEquivalentConcept()); } if (!predChildNode->hasIncompatibleSuccessorNode(predNode)) { setConceptNotSubsumption(predNode->getOneEquivalentConcept(),predChildNode->getOneEquivalentConcept()); } } } } } } return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CConceptSatisfiableObserver.h0000644000175000017500000000441712520550752027663 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCONCEPTSATISFIABLEOBSERVER_H #define KONCLUDE_REASONER_CLASSIFIER_CCONCEPTSATISFIABLEOBSERVER_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CConceptSatisfiableObserver * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptSatisfiableObserver { // public methods public: //! Constructor CConceptSatisfiableObserver(); //! Destructor virtual ~CConceptSatisfiableObserver(); virtual CConceptSatisfiableObserver *tellConceptSatisfiable(CConcreteOntology *ontology, CConcept *satisfiableConcept, bool isSatisfiable = true); virtual CConceptSatisfiableObserver *tellConceptSatisfiable(CConcreteOntology *ontology, const QList &satisfiableConceptList, bool isSatisfiable = true) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCONCEPTSATISFIABLEOBSERVER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CPartialPruningHierarchyNode.cpp0000644000175000017500000006532312520550762030354 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPartialPruningHierarchyNode.h" namespace Konclude { namespace Reasoner { namespace Classifier { CPartialPruningHierarchyNode::CPartialPruningHierarchyNode(CConcept *representiveConcept) : CHierarchyNode(representiveConcept) { #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif } CPartialPruningHierarchyNode::~CPartialPruningHierarchyNode() { } CHierarchyNode *CPartialPruningHierarchyNode::repairParentNodeInsertion(CHierarchyNode *replacedParentNodeCandidate, CClassifierStatistics *statistics) { // called for the subsumer node QList parentNodes(parentNodeSet.values()); for (QList::const_iterator it = parentNodes.constBegin(), itEnd = parentNodes.constEnd(); it != itEnd; ++it) { CHierarchyNode *parentNode = *it; if (parentNode != replacedParentNodeCandidate) { if (replacedParentNodeCandidate->hasPredecessorNode(parentNode)) { // the previous parent node is not longer a direct parent removeParent(parentNode); parentNode->removeChild(this); } } } #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CPartialPruningHierarchyNode::repairChildsParentNodeReplacement(CHierarchyNode *replacedParentNodeCandidate, CClassifierStatistics *statistics) { // called for the subsumed node QList childNodes(childNodeSet.values()); for (QList::const_iterator it = childNodes.constBegin(), itEnd = childNodes.constEnd(); it != itEnd; ++it) { CHierarchyNode *childNode = *it; if (childNode->hasPredecessorNode(replacedParentNodeCandidate)) { removeChild(childNode); childNode->removeParent(this); } } #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CPartialPruningHierarchyNode::mergeToParentNode(CHierarchyNode *mergeParentDirection, CClassifierStatistics *statistics) { QSet mergeNodesSet; QList potMergeNodesList(getParentNodeList()); while (!potMergeNodesList.isEmpty()) { CHierarchyNode* potMergeNode = potMergeNodesList.takeFirst(); if (potMergeNode->hasPredecessorNode(mergeParentDirection) || potMergeNode == mergeParentDirection) { if (!mergeNodesSet.contains(potMergeNode)) { mergeNodesSet.insert(potMergeNode); if (potMergeNode != mergeParentDirection) { potMergeNodesList.append(potMergeNode->getParentNodeList()); } } } } foreach (CHierarchyNode* mergeNode, mergeNodesSet) { foreach (CConcept* concept, *mergeNode->getEquivalentConceptList()) { addEquivalentConcept(concept); } foreach (CHierarchyNode* parentNode, *mergeNode->getParentNodeSet()) { if (!hasParentNode(parentNode) && !mergeNodesSet.contains(parentNode)) { makeParent(parentNode); } mergeNode->removeParent(parentNode); parentNode->removeChild(mergeNode); } foreach (CHierarchyNode* childNode, *mergeNode->getChildNodeSet()) { if (!hasChildNode(childNode) && !mergeNodesSet.contains(childNode) && childNode != this) { makeChild(childNode); } mergeNode->removeChild(childNode); childNode->removeParent(mergeNode); } foreach (CHierarchyNode* predNode, *mergeNode->getPredecessorNodeSet()) { if (!hasPredecessorNode(predNode) && !mergeNodesSet.contains(predNode)) { makePredecessor(predNode); } mergeNode->removePredecessor(predNode); predNode->removeSuccessor(mergeNode); } foreach (CHierarchyNode* succNode, *mergeNode->getSuccessorNodeSet()) { if (!hasSuccessorNode(succNode) && !mergeNodesSet.contains(succNode) && succNode != this) { makeSuccessor(succNode); } mergeNode->removeSuccessor(succNode); succNode->removePredecessor(mergeNode); } foreach (CHierarchyNode* incPredNode, *mergeNode->getIncompatiblePredecessorNodeSet()) { if (!hasIncompatiblePredecessorNode(incPredNode)) { makeIncompatiblePredecessor(incPredNode); } mergeNode->removeIncompatiblePredecessorNode(incPredNode); incPredNode->removeIncompatibleSuccessorNode(mergeNode); } foreach (CHierarchyNode* incSuccNode, *mergeNode->getIncompatibleSuccessorNodeSet()) { if (!hasIncompatibleSuccessorNode(incSuccNode)) { makeIncompatibleSuccessor(incSuccNode); } mergeNode->removeIncompatibleSuccessorNode(incSuccNode); incSuccNode->removeIncompatiblePredecessorNode(mergeNode); } foreach (CHierarchyNode* disjNode, *mergeNode->getDisjointNodeSet()) { if (!hasDisjointNode(disjNode)) { makeDisjoint(disjNode); } mergeNode->removeDisjointNode(disjNode); disjNode->removeDisjointNode(mergeNode); } } foreach (CHierarchyNode* parNode1, parentNodeSet) { foreach (CHierarchyNode* parNode2, parentNodeSet) { if (parNode1 != parNode2 && parNode2->hasPredecessorNode(parNode1)) { removeParent(parNode1); parNode1->removeChild(this); } } } foreach (CHierarchyNode* childNode1, childNodeSet) { foreach (CHierarchyNode* childNode2, childNodeSet) { if (childNode1 != childNode2 && childNode1->hasPredecessorNode(childNode2)) { removeChild(childNode1); childNode1->removeParent(this); } } } //QSet parentMergeNodesSet(parentNodeSet); //QList parentMergeNodesList(parentMergeNodesSet.values()); //parentMergeNodesSet.insert(this); //bool mergedIntoDirection = false; //while (!parentMergeNodesList.isEmpty()) { // CHierarchyNode *parentNode = parentMergeNodesList.takeFirst(); // if (parentNode == this) { // bool bug = true; // } // if (parentNode == mergeParentDirection || parentNode->hasPredecessorNode(mergeParentDirection)) { // // has to merge // qint64 addParentEqConCount = parentNode->getEquivalentConceptCount(); // qint64 thisPrevEqConCount = eqConCount; // foreach (CConcept *con, *parentNode->getEquivalentConceptList()) { // eqConCount++; // eqConList.append(con); // } // if (statistics && parentNode != mergeParentDirection) { // statistics->incDerivatedTestedSubsumptionCount(addParentEqConCount*thisPrevEqConCount); // } // if (statistics) { // foreach (CHierarchyNode *precNode, predNodeSet) { // if (!parentNode->hasPredecessorNode(precNode) && parentNode != mergeParentDirection) { // statistics->incDerivatedTestedSubsumptionCount(addParentEqConCount*precNode->getEquivalentConceptCount()); // } // } // foreach (CHierarchyNode *succNode, succNodeSet) { // if (!parentNode->hasSuccessorNode(succNode)) { // statistics->incDerivatedTestedSubsumptionCount(addParentEqConCount*succNode->getEquivalentConceptCount()); // } // } // foreach (CHierarchyNode *incPrecNode, incompPredNodeSet) { // if (!parentNode->hasIncompatiblePredecessorNode(incPrecNode)) { // statistics->incPrunedTestedSubsumptionCount(addParentEqConCount*incPrecNode->getEquivalentConceptCount()); // } // } // foreach (CHierarchyNode *incSuccNode, incompSuccNodeSet) { // if (!parentNode->hasIncompatibleSuccessorNode(incSuccNode)) { // statistics->incPrunedTestedSubsumptionCount(addParentEqConCount*incSuccNode->getEquivalentConceptCount()); // } // } // } // //((CPartialPruningHierarchyNode *)parentNode)->repairChildsParentNodeReplacement(this,statistics); // QList parentList(parentNode->getParentNodeList()); // foreach (CHierarchyNode *parentParentNode, parentList) { // parentParentNode->removeChild(parentNode); // parentNode->removeParent(parentParentNode); // if (parentNodeSet.isEmpty()) { // bool bug = true; // } // if (!hasPredecessorNode(parentParentNode)) { // if (statistics && parentParentNode != mergeParentDirection) { // statistics->incDerivatedTestedSubsumptionCount(thisPrevEqConCount*parentParentNode->getEquivalentConceptCount()); // } // } // bool oldParPredecessor = false; // foreach (CHierarchyNode* oldParNode, parentNodeSet) { // if (oldParNode == parentParentNode && oldParNode->hasPredecessorNode(parentParentNode)) { // oldParPredecessor = true; // } // } // if (!oldParPredecessor) { // makeParent(parentParentNode); // if (!parentMergeNodesSet.contains(parentParentNode)) { // parentMergeNodesSet.insert(parentParentNode); // parentMergeNodesList.append(parentParentNode); // } // } // } // QList childList(parentNode->getChildNodeList()); // foreach (CHierarchyNode *parentChildNode, childList) { // parentChildNode->removeParent(parentNode); // parentNode->removeChild(parentChildNode); // if (parentNodeSet.isEmpty()) { // bool bug = true; // } // if (parentChildNode != this) { // if (!hasSuccessorNode(parentChildNode)) { // if (statistics) { // statistics->incDerivatedTestedSubsumptionCount(thisPrevEqConCount*parentChildNode->getEquivalentConceptCount()); // } // makeChild(parentChildNode); // } // } // } // QList predList(parentNode->getPredecessorNodeList()); // foreach (CHierarchyNode *parentPredeccessorNode, predList) { // parentPredeccessorNode->removeSuccessor(parentNode); // parentNode->removePredecessor(parentPredeccessorNode); // if (!hasPredecessorNode(parentPredeccessorNode)) { // if (statistics && parentPredeccessorNode != mergeParentDirection) { // statistics->incDerivatedTestedSubsumptionCount(thisPrevEqConCount*parentPredeccessorNode->getEquivalentConceptCount()); // } // makePredecessor(parentPredeccessorNode); // } // } // QSet *disjointSet(parentNode->getDisjointNodeSet()); // foreach (CHierarchyNode *disjointNode, *disjointSet) { // disjointNode->removeDisjointNode(parentNode); // parentNode->removeDisjointNode(disjointNode); // if (!hasDisjointNode(disjointNode)) { // makeDisjoint(disjointNode); // if (!hasIncompatiblePredecessorNode(disjointNode)) { // if (statistics) { // statistics->incPrunedTestedSubsumptionCount(thisPrevEqConCount*disjointNode->getEquivalentConceptCount()); // } // addIncompatiblePredecessorNode(disjointNode); // disjointNode->addIncompatibleSuccessorNode(this); // } // if (!hasIncompatibleSuccessorNode(disjointNode)) { // if (statistics) { // statistics->incPrunedTestedSubsumptionCount(thisPrevEqConCount*disjointNode->getEquivalentConceptCount()); // } // addIncompatibleSuccessorNode(disjointNode); // disjointNode->addIncompatiblePredecessorNode(this); // } // } // } // QList succList(parentNode->getSuccessorNodeList()); // foreach (CHierarchyNode *parentSuccessorNode, succList) { // parentSuccessorNode->removePredecessor(parentNode); // parentNode->removeSuccessor(parentSuccessorNode); // if (parentSuccessorNode != this) { // if (!hasSuccessorNode(parentSuccessorNode)) { // if (statistics) { // statistics->incDerivatedTestedSubsumptionCount(thisPrevEqConCount*parentSuccessorNode->getEquivalentConceptCount()); // } // makeSuccessor(parentSuccessorNode); // } // } // } // QSet *incPredList(parentNode->getIncompatiblePredecessorNodeSet()); // foreach (CHierarchyNode *parentIncompatiblePredNode, *incPredList) { // parentIncompatiblePredNode->removeIncompatibleSuccessorNode(parentNode); // parentNode->removeIncompatiblePredecessorNode(parentIncompatiblePredNode); // if (!hasIncompatiblePredecessorNode(parentIncompatiblePredNode)) { // if (statistics) { // statistics->incPrunedTestedSubsumptionCount(thisPrevEqConCount*parentIncompatiblePredNode->getEquivalentConceptCount()); // } // addIncompatiblePredecessorNode(parentIncompatiblePredNode); // parentIncompatiblePredNode->addIncompatibleSuccessorNode(this); // } // } // QSet *incSuccList(parentNode->getIncompatibleSuccessorNodeSet()); // foreach (CHierarchyNode *parentIncompatibleSuccNode, *incSuccList) { // parentIncompatibleSuccNode->removeIncompatiblePredecessorNode(parentNode); // parentNode->removeIncompatibleSuccessorNode(parentIncompatibleSuccNode); // if (!hasIncompatibleSuccessorNode(parentIncompatibleSuccNode)) { // if (statistics) { // statistics->incPrunedTestedSubsumptionCount(thisPrevEqConCount*parentIncompatibleSuccNode->getEquivalentConceptCount()); // } // addIncompatibleSuccessorNode(parentIncompatibleSuccNode); // parentIncompatibleSuccNode->addIncompatiblePredecessorNode(this); // } // } // foreach (CHierarchyNode* parNode1, parentNodeSet) { // foreach (CHierarchyNode* parNode2, parentNodeSet) { // if (parNode1 != parNode2 && parNode2->hasPredecessorNode(parNode1)) { // removeParent(parNode1); // parNode1->removeChild(this); // if (parentNodeSet.isEmpty()) { // bool bug = true; // } // } // } // } // foreach (CHierarchyNode* childNode1, childNodeSet) { // foreach (CHierarchyNode* childNode2, childNodeSet) { // if (childNode1 != childNode2 && childNode1->hasPredecessorNode(childNode2)) { // removeChild(childNode1); // childNode1->removeParent(this); // if (childNode1->getParentNodeSet()->isEmpty()) { // bool bug = true; // } // } // } // } // } else { // //repairParentNodeInsertion(parentNode,statistics); // //((CPartialPruningHierarchyNode *)parentNode)->repairChildsParentNodeReplacement(this,statistics); // if (parentNodeSet.isEmpty()) { // bool bug = true; // } // } //} #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CPartialPruningHierarchyNode::propagateTransitiveRelations(CClassifierStatistics *statistics) { CHierarchyNode *updateNode = this; QSet *updateChildNodeSet = getChildNodeSet(); QSet *updateParentNodeSet = getParentNodeSet(); QSet *updatePredNodeSet = getPredecessorNodeSet(); QSet *updateSuccNodeSet = getSuccessorNodeSet(); QSet *updateDisjointSet = getDisjointNodeSet(); for (QSet::const_iterator itPred = updatePredNodeSet->constBegin(), itPredEnd = updatePredNodeSet->constEnd(); itPred != itPredEnd; ++itPred) { CHierarchyNode *predNode = (*itPred); QList updateList; // add missing predecessor nodes to children updateList += getChildNodeList(); while (!updateList.isEmpty()) { CHierarchyNode *updateNode = updateList.takeFirst(); if (!updateNode->hasPredecessorNode(predNode)) { if (statistics) { statistics->incDerivatedTestedSubsumptionCount(updateNode->getEquivalentConceptCount()*predNode->getEquivalentConceptCount()); } updateNode->makePredecessor(predNode); updateList += updateNode->getChildNodeList(); } } } for (QSet::const_iterator itDisj = updateDisjointSet->constBegin(), itDisjEnd = updateDisjointSet->constEnd(); itDisj != itDisjEnd; ++itDisj) { CHierarchyNode *disjNode = (*itDisj); QList updateList; // add missing disjoint nodes to children updateList += getChildNodeList(); while (!updateList.isEmpty()) { CHierarchyNode *updateNode = updateList.takeFirst(); if (!updateNode->hasDisjointNode(disjNode)) { updateNode->makeDisjoint(disjNode); if (!updateNode->hasIncompatiblePredecessorNode(disjNode)) { if (statistics) { statistics->incPrunedTestedSubsumptionCount(updateNode->getEquivalentConceptCount()*disjNode->getEquivalentConceptCount()); } updateNode->makeIncompatiblePredecessor(disjNode); } if (!updateNode->hasIncompatibleSuccessorNode(disjNode)) { if (statistics) { statistics->incPrunedTestedSubsumptionCount(updateNode->getEquivalentConceptCount()*disjNode->getEquivalentConceptCount()); } updateNode->makeIncompatibleSuccessor(disjNode); } updateList += updateNode->getChildNodeList(); } } } for (QSet::const_iterator itSucc = updateSuccNodeSet->constBegin(), itSuccEnd = updateSuccNodeSet->constEnd(); itSucc != itSuccEnd; ++itSucc) { CHierarchyNode *succNode = (*itSucc); QList updateList; // add missing successor nodes to parents updateList += getParentNodeList(); while (!updateList.isEmpty()) { CHierarchyNode *updateNode = updateList.takeFirst(); if (!updateNode->hasSuccessorNode(succNode)) { if (statistics) { statistics->incDerivatedTestedSubsumptionCount(updateNode->getEquivalentConceptCount()*succNode->getEquivalentConceptCount()); } updateNode->makeSuccessor(succNode); updateList += updateNode->getParentNodeList(); } } } QSet *incompSuccNodeSet = getIncompatibleSuccessorNodeSet(); for (QSet::const_iterator itIncomp = incompSuccNodeSet->constBegin(), itIncompEnd = incompSuccNodeSet->constEnd(); itIncomp != itIncompEnd; ++itIncomp) { CHierarchyNode *incompNode = (*itIncomp); QList updateList; // propagate incompatible successor node relations from current node to all children updateList += getChildNodeList(); while (!updateList.isEmpty()) { CHierarchyNode *updateNode = updateList.takeFirst(); if (!updateNode->hasIncompatibleSuccessorNode(incompNode)) { if (statistics) { statistics->incPrunedTestedSubsumptionCount(updateNode->getEquivalentConceptCount()*incompNode->getEquivalentConceptCount()); } updateNode->addIncompatibleSuccessorNode(incompNode); incompNode->addIncompatiblePredecessorNode(updateNode); QSet *updateChildNodeSet = updateNode->getChildNodeSet(); for (QSet::const_iterator itUpChild = updateChildNodeSet->constBegin(), itUpChildEnd = updateChildNodeSet->constEnd(); itUpChild != itUpChildEnd; ++itUpChild) { CHierarchyNode *updateChildNode = (*itUpChild); updateList.append(updateChildNode); } } } } QSet *incompPredNodeSet = getIncompatiblePredecessorNodeSet(); for (QSet::const_iterator itIncomp = incompPredNodeSet->constBegin(), itIncompEnd = incompPredNodeSet->constEnd(); itIncomp != itIncompEnd; ++itIncomp) { CHierarchyNode *incompNode = (*itIncomp); QList updateList; // propagate incompatible predecessor node relations from current node to all parents updateList += getParentNodeList(); while (!updateList.isEmpty()) { CHierarchyNode *updateNode = updateList.takeFirst(); if (!updateNode->hasIncompatiblePredecessorNode(incompNode)) { if (statistics) { statistics->incPrunedTestedSubsumptionCount(updateNode->getEquivalentConceptCount()*incompNode->getEquivalentConceptCount()); } updateNode->addIncompatiblePredecessorNode(incompNode); incompNode->addIncompatibleSuccessorNode(updateNode); QSet *updateParentNodeSet = updateNode->getParentNodeSet(); for (QSet::const_iterator itUpParent = updateParentNodeSet->constBegin(), itUpParentEnd = updateParentNodeSet->constEnd(); itUpParent != itUpParentEnd; ++itUpParent) { CHierarchyNode *updateParentNode = (*itUpParent); updateList.append(updateParentNode); } } } } //// derivate new incompatible equivalences to parent nodes //for (QSet::const_iterator itParent = updateParentNodeSet->constBegin(), itParentEnd = updateParentNodeSet->constEnd(); itParent != itParentEnd; ++itParent) { // CHierarchyNode *parentNode = (*itParent); // if (!hasIncompatibleSuccessorNode(parentNode)) { // for (QSet::const_iterator itUpChild = parentNode->getChildNodeSet()->constBegin(), itUpChildEnd = parentNode->getChildNodeSet()->constEnd(); itUpChild != itUpChildEnd; ++itUpChild) { // CHierarchyNode *parentChildNode = (*itUpChild); // if (hasIncompatibleSuccessorNode(parentChildNode) || hasIncompatiblePredecessorNode(parentChildNode)) { // if (statistics) { // statistics->incDerivatedTestedSubsumptionCount(getEquivalentConceptCount()*parentNode->getEquivalentConceptCount()); // } // makeIncompatiblePredecessor(parentNode); // } // } // } //} #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CPartialPruningHierarchyNode::repairChildNodes(CClassifierStatistics *statistics) { foreach (CHierarchyNode* childNode1, childNodeSet) { foreach (CHierarchyNode* childNode2, childNodeSet) { if (childNode1 != childNode2 && childNode1->hasPredecessorNode(childNode2)) { removeChild(childNode1); childNode1->removeParent(this); } } } return this; } CHierarchyNode *CPartialPruningHierarchyNode::repairParentNodes(CClassifierStatistics *statistics) { foreach (CHierarchyNode* parNode1, parentNodeSet) { foreach (CHierarchyNode* parNode2, parentNodeSet) { if (parNode1 != parNode2 && parNode2->hasPredecessorNode(parNode1)) { removeParent(parNode1); parNode1->removeChild(this); } } } return this; } CHierarchyNode *CPartialPruningHierarchyNode::propagateTransitivePredecessorRelation(CHierarchyNode *transAddPredNode, CClassifierStatistics *statistics) { QList updateList; updateList.append(this); while (!updateList.isEmpty()) { CHierarchyNode *updateNode = updateList.takeFirst(); QSet *updateChildNodeSet = updateNode->getChildNodeSet(); QSet *updatePredNodeSet = updateNode->getPredecessorNodeSet(); for (QSet::const_iterator itChild = updateChildNodeSet->constBegin(), itChildEnd = updateChildNodeSet->constEnd(); itChild != itChildEnd; ++itChild) { CHierarchyNode *childNode = (*itChild); if (!childNode->hasPredecessorNode(transAddPredNode)) { if (statistics) { statistics->incDerivatedTestedSubsumptionCount(childNode->getEquivalentConceptCount()*transAddPredNode->getEquivalentConceptCount()); } childNode->makePredecessor(transAddPredNode); updateList.append(childNode); } } } #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } CHierarchyNode *CPartialPruningHierarchyNode::pruneTransitiveRelations(CHierarchyNode *initIncompNode, CClassifierStatistics *statistics) { for (QSet::const_iterator parentIt = initIncompNode->getParentNodeSet()->constBegin(), parentItEnd = initIncompNode->getParentNodeSet()->constEnd(); parentIt != parentItEnd; ++parentIt) { CHierarchyNode *incompNodeParent = (*parentIt); if (!incompNodeParent->hasIncompatiblePredecessorNode(initIncompNode)) { if (hasPredecessorNode(incompNodeParent)) { if (statistics) { statistics->incPrunedTestedSubsumptionCount(incompNodeParent->getEquivalentConceptCount()*initIncompNode->getEquivalentConceptCount()); } incompNodeParent->makeIncompatiblePredecessor(initIncompNode); } } } QList incompChildNodeList; QSet incompNodeSet; incompChildNodeList.append(initIncompNode); incompNodeSet.insert(initIncompNode); while (!incompChildNodeList.isEmpty()) { CHierarchyNode *nextIncompNode = incompChildNodeList.takeFirst(); QSet *incNodeSet = nextIncompNode->getChildNodeSet(); for (QSet::const_iterator childIt = incNodeSet->constBegin(), childItEnd = incNodeSet->constEnd(); childIt != childItEnd; ++childIt) { CHierarchyNode *childIncompNode = (*childIt); if (!hasIncompatiblePredecessorNode(childIncompNode)) { if (!incompNodeSet.contains(childIncompNode)) { incompNodeSet.insert(childIncompNode); incompChildNodeList.append(childIncompNode); } } } } QList predList; for (QSet::const_iterator incompIt = incompNodeSet.constBegin(), incompItEnd = incompNodeSet.constEnd(); incompIt != incompItEnd; ++incompIt) { CHierarchyNode *incompNode = (*incompIt); // set incompatible to all predecessors predList.append(this); while (!predList.isEmpty()) { CHierarchyNode *predNode = predList.takeFirst(); if (!predNode->hasIncompatiblePredecessorNode(incompNode)) { if (statistics) { statistics->incPrunedTestedSubsumptionCount(predNode->getEquivalentConceptCount()*incompNode->getEquivalentConceptCount()); } predNode->addIncompatiblePredecessorNode(incompNode); incompNode->addIncompatibleSuccessorNode(predNode); QSet *parentNodeSet = predNode->getParentNodeSet(); for (QSet::const_iterator parentIt = parentNodeSet->constBegin(), parentItEnd = parentNodeSet->constEnd(); parentIt != parentItEnd; ++parentIt) { CHierarchyNode *parentNode = (*parentIt); predList.append(parentNode); } } } } #ifdef DEBUGHIERARCHYNODECONCEPTSTRINGS generateNodeStrings(); #endif return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CConfigDependedSubsumptionClassifierFactory.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CConfigDependedSubsumptionClassifierFactor0000644000175000017500000001256112520550754032437 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfigDependedSubsumptionClassifierFactory.h" namespace Konclude { namespace Reasoner { namespace Classifier { CConfigDependedSubsumptionClassifierFactory::CConfigDependedSubsumptionClassifierFactory(CReasonerManager *reasonerManager) { reasonerMan = reasonerManager; } CConfigDependedSubsumptionClassifierFactory::~CConfigDependedSubsumptionClassifierFactory() { } CSubsumptionClassifier *CConfigDependedSubsumptionClassifierFactory::createClassifier(CConcreteOntology *ontology, CConfigurationBase *config) { CSubsumptionClassifier *classifier = 0; bool automatedClassifierSelection = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Classification.AutomatedOptimizedClassifierSelection",true); if (automatedClassifierSelection) { bool onlyChangedABoxAxioms = ontology->getIncrementalRevisionData()->getAxiomChangeData()->hasOnlyChangedABoxAxioms(); bool previousClassifiedOntologyVersion = ontology->getIncrementalRevisionData()->getPreviousClassesClassifiedOntology() != nullptr; if (previousClassifiedOntologyVersion && onlyChangedABoxAxioms) { classifier = new CIncrementalKPSetClassSubsumptionClassifierThread(reasonerMan); } else if (isClassificationBySaturationCalculationSufficient(ontology,config)) { LOG(INFO,"::Konclude::Reasoner::Classifier::Factory",logTr("Ontology '%1' has been sufficiently saturated, extracting data for classification.").arg(ontology->getOntologyName()),this); classifier = new COptimizedClassExtractedSaturationSubsumptionClassifierThread(reasonerMan); } else if (isClassificationBySatisfiableCalculationSufficient(ontology,config)) { LOG(INFO,"::Konclude::Reasoner::Classifier::Factory",logTr("Ontology '%1' is deterministic, using satisfiable tests for classification.").arg(ontology->getOntologyName()),this); classifier = new COptimizedSubClassSubsumptionClassifierThread(reasonerMan); } } if (!classifier) { QString classifierName = CConfigDataReader::readConfigString(config,"Konclude.Calculation.Classification.Classifier","Konclude.Calculation.Classification.Classifier.OptimizedKPSetClassClassifier"); if (classifierName == "Konclude.Calculation.Classification.Classifier.OptimizedSubClassClassifier") { classifier = new COptimizedSubClassSubsumptionClassifierThread(reasonerMan); } else if (classifierName == "Konclude.Calculation.Classification.Classifier.OptimizedKPSetClassClassifier") { classifier = new COptimizedKPSetClassSubsumptionClassifierThread(reasonerMan); } else if (classifierName == "Konclude.Calculation.Classification.Classifier.OptimizedClassExtractedSaturationClassifier") { classifier = new COptimizedClassExtractedSaturationSubsumptionClassifierThread(reasonerMan); } } return classifier; } CSubsumptionClassifier *CConfigDependedSubsumptionClassifierFactory::createBackgroundClassifier(CConcreteOntology *ontology, CConfigurationBase *config) { CSubsumptionClassifier *classifier = createClassifier(ontology,config); return classifier; } bool CConfigDependedSubsumptionClassifierFactory::isClassificationBySatisfiableCalculationSufficient(CConcreteOntology *ontology, CConfigurationBase *config) { COntologyStructureSummary* ontoStrSum = ontology->getStructureSummary(); if (ontoStrSum) { return ontoStrSum->hasOnlyDeterministicConceptClasses(); } else { return false; } } bool CConfigDependedSubsumptionClassifierFactory::isClassificationBySaturationCalculationSufficient(CConcreteOntology *ontology, CConfigurationBase *config) { bool subsumerSaturationExtraction = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Classification.SaturationSubsumerExtraction",true); if (!subsumerSaturationExtraction) { return false; } CSaturationData* satData = ontology->getPrecomputation()->getSaturationModelData(); if (satData) { CSaturationTaskData* satTaskData = dynamic_cast(satData); if (satTaskData) { CSatisfiableCalculationTask* satCalcTask = satTaskData->getSaturationTask(); if (!satCalcTask->getProcessingDataBox()->isInsufficientNodeOccured() && !satCalcTask->getProcessingDataBox()->isProblematicEQCandidateOccured()) { CBOXSET* eqConceptNonCandSet = ontology->getTBox()->getEquivalentConceptNonCandidateSet(false); if (!eqConceptNonCandSet || eqConceptNonCandSet->isEmpty()) { return true; } } } } return false; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionMap.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionMap.0000644000175000017500000000742612520550760032350 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetRolePossibleSubsumptionMap.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedKPSetRolePossibleSubsumptionMap::COptimizedKPSetRolePossibleSubsumptionMap() : QMap() { mRequirePossibleSubsumptionUpdate = false; mRemainingPossibleSubsumptionCount = 0; } bool COptimizedKPSetRolePossibleSubsumptionMap::isPossibleSubsumptionUpdateRequired() { return mRequirePossibleSubsumptionUpdate; } cint64 COptimizedKPSetRolePossibleSubsumptionMap::getRemainingPossibleSubsumptionCount() { return mRemainingPossibleSubsumptionCount; } COptimizedKPSetRolePossibleSubsumptionMap* COptimizedKPSetRolePossibleSubsumptionMap::setRemainingPossibleSubsumptionCount(cint64 possSubsumCount) { mRemainingPossibleSubsumptionCount = possSubsumCount; return this; } COptimizedKPSetRolePossibleSubsumptionMap* COptimizedKPSetRolePossibleSubsumptionMap::decRemainingPossibleSubsumptionCount(cint64 decCount) { mRemainingPossibleSubsumptionCount -= decCount; return this; } COptimizedKPSetRolePossibleSubsumptionMap* COptimizedKPSetRolePossibleSubsumptionMap::incRemainingPossibleSubsumptionCount(cint64 incCount) { mRemainingPossibleSubsumptionCount += incCount; return this; } COptimizedKPSetRolePossibleSubsumptionMap* COptimizedKPSetRolePossibleSubsumptionMap::setPossibleSubsumptionUpdateRequired(bool requiredUpdate) { mRequirePossibleSubsumptionUpdate = requiredUpdate; return this; } bool COptimizedKPSetRolePossibleSubsumptionMap::hasRemainingPossibleSubsumptions() { return mRemainingPossibleSubsumptionCount > 0; } CClassPossibleSubsumptionMapIterator* COptimizedKPSetRolePossibleSubsumptionMap::getIterator(CClassPossibleSubsumptionMapIterator* reuseIterator, CContext* context) { if (reuseIterator) { COptimizedKPSetRolePossibleSubsumptionMapIterator* optKPSetClassPossSubMapIterator = (COptimizedKPSetRolePossibleSubsumptionMapIterator*)reuseIterator; *optKPSetClassPossSubMapIterator = COptimizedKPSetRolePossibleSubsumptionMapIterator(QMap::begin(),QMap::end()); return optKPSetClassPossSubMapIterator; } else { CMemoryAllocationManager* memMan = context->getMemoryAllocationManager(); COptimizedKPSetRolePossibleSubsumptionMapIterator* optKPSetClassPossSubMapIterator = CObjectAllocator::allocateAndConstruct(memMan); *optKPSetClassPossSubMapIterator = COptimizedKPSetRolePossibleSubsumptionMapIterator(QMap::begin(),QMap::end()); return optKPSetClassPossSubMapIterator; } } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionData0000644000175000017500000000607212520550760032422 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetRolePossibleSubsumptionData.h" #include "COptimizedKPSetRoleTestingItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedKPSetRolePossibleSubsumptionData::COptimizedKPSetRolePossibleSubsumptionData(COptimizedKPSetRoleTestingItem* item) { mSubsumptionUpdatedFlag = false; mSubsumptionConfirmedFlag = false; mSubsumptionInvalidFlag = false; mTestingItem = item; } bool COptimizedKPSetRolePossibleSubsumptionData::isUpdateRequired() { return !mSubsumptionUpdatedFlag && (mSubsumptionConfirmedFlag || mSubsumptionInvalidFlag); } bool COptimizedKPSetRolePossibleSubsumptionData::isSubsumptionUpdated() { return mSubsumptionUpdatedFlag; } COptimizedKPSetRolePossibleSubsumptionData* COptimizedKPSetRolePossibleSubsumptionData::setSubsumptionUpdated(bool updated) { mSubsumptionUpdatedFlag = updated; return this; } bool COptimizedKPSetRolePossibleSubsumptionData::isSubsumptionConfirmed() { return mSubsumptionConfirmedFlag; } COptimizedKPSetRolePossibleSubsumptionData* COptimizedKPSetRolePossibleSubsumptionData::setSubsumptionConfirmed(bool confirmedSubsumption) { mSubsumptionConfirmedFlag = confirmedSubsumption; return this; } bool COptimizedKPSetRolePossibleSubsumptionData::isSubsumptionInvalided() { return mSubsumptionInvalidFlag; } COptimizedKPSetRolePossibleSubsumptionData* COptimizedKPSetRolePossibleSubsumptionData::setSubsumptionInvalid(bool invalidSubsumption) { mSubsumptionInvalidFlag = invalidSubsumption; return this; } bool COptimizedKPSetRolePossibleSubsumptionData::isSubsumptionKnown() { return mSubsumptionInvalidFlag || mSubsumptionConfirmedFlag; } bool COptimizedKPSetRolePossibleSubsumptionData::isSubsumptionUnknown() { return !mSubsumptionConfirmedFlag && !mSubsumptionInvalidFlag; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRolePossibleSubsumptionData::getTestingItem() { return mTestingItem; } COptimizedKPSetRolePossibleSubsumptionData* COptimizedKPSetRolePossibleSubsumptionData::setTestingItem(COptimizedKPSetRoleTestingItem* item) { mTestingItem = item; return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodeBottomUpTraversalClassificationItem.h0000644000175000017500000001217612520550754032352 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CNODEBOTTOMUPTRAVERSALCLASSIFICATIONITEM_H #define KONCLUDE_REASONER_CLASSIFIER_CNODEBOTTOMUPTRAVERSALCLASSIFICATIONITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassifierStatistics.h" #include "CNodeBlockedClassificationItem.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Taxonomy/CTaxonomy.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Taxonomy; namespace Classifier { /*! * * \class CNodeBottomUpTraversalClassificationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNodeBottomUpTraversalClassificationItem : public CNodeBlockedClassificationItem { // public methods public: //! Constructor CNodeBottomUpTraversalClassificationItem(CHierarchyNode *node, QList &branchNodes, QList *lockedReleaseProcessingList); //! Destructor virtual ~CNodeBottomUpTraversalClassificationItem(); CNodeBlockedClassificationItem *releaseBlockedResumeProcessing(); CNodeBlockedClassificationItem *releaseTestingBlockedResumeProcessing(CConcept *subsumerConcept, CConcept *subsumedConcept, bool testingResult); CHierarchyNode *getTraversalNode(); QList *getTestingNodeList(); CNodeBottomUpTraversalClassificationItem *appendTestingNodeList(QList &nodeList); CNodeBottomUpTraversalClassificationItem *appendTestingNode(CHierarchyNode *node); QList *getChildNodeList(); CNodeBottomUpTraversalClassificationItem *appendChildNodeList(QList &nodeList); CNodeBottomUpTraversalClassificationItem *appendChildNode(CHierarchyNode *parentNode); QList *getBranchLockedNodeList(); CNodeBottomUpTraversalClassificationItem *appendBranchLockedNodeList(QList &nodeList); CNodeBottomUpTraversalClassificationItem *appendBranchLockedNode(CHierarchyNode *branchNode); bool hasNextTestingNode(); CHierarchyNode *takeNextTestingNode(); CHierarchyNode *getTestingNode(); CNodeBottomUpTraversalClassificationItem *clearTestingNode(); bool getTestingResult(); bool hasDirectBranchLockedNode(); CHierarchyNode *getDirectBranchLockedNode(); CNodeBottomUpTraversalClassificationItem *setDirectBranchLockedNode(CHierarchyNode *parentLockedNode); QList *getNewBranchNodeList(); CNodeBottomUpTraversalClassificationItem *appendNewBranchNodeList(QList &nodeList); CNodeBottomUpTraversalClassificationItem *appendNewBranchNode(CHierarchyNode *branchNode); bool hasAllSilbingBranchTested(); CNodeBottomUpTraversalClassificationItem *setAllSilbingBranchTested(bool allSilbingsTested = true); qint64 getSilbingBranchTestNodeCount(); CNodeBottomUpTraversalClassificationItem *decSilbingBranchTestNodeCount(); bool isChildNodeAddedContinueBlocking(); QList getChildNodeAddedContinueBlockingList(); CNodeBottomUpTraversalClassificationItem* setChildNodeAddedContinueBlocking(bool addedChildNode); CNodeBottomUpTraversalClassificationItem* addChildNodeAddedContinueBlocking(CHierarchyNode* continueBlocking); // protected methods protected: // protected variables protected: CHierarchyNode *traversalNode; CHierarchyNode *parLockNode; CHierarchyNode *testNode; QList testingNodeList; QList branchLockedNodeList; QList newBranchNodeList; QSet newBranchNodeSet; QList childNodeList; QList childNodeContinueBlockingList; QList *lockedReleaseProcList; bool subSumTestingResult; bool mChildNodeAdded; qint64 silbingBranchTestNodeCount; bool allSilbingBranchTested; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CNODEBOTTOMUPTRAVERSALCLASSIFICATIONITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationConceptReferenceLinking.cpp0000644000175000017500000000213712520550746032346 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationConceptReferenceLinking.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationConceptReferenceLinking::CClassificationConceptReferenceLinking() { } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationManager.h0000644000175000017500000000611712520550746026641 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONMANAGER_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONMANAGER_H // Libraries includes #include // Namespace includes #include "ClassifierSettings.h" #include "CSubsumptionClassifierFactory.h" #include "CClassificationProgress.h" #include "CSubsumptionClassifierThread.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Taxonomy/CTaxonomy.h" #include "Config/CConfigurationProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Ontology; using namespace Taxonomy; namespace Classifier { /*! * * \class CClassificationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationManager { // public methods public: //! Constructor CClassificationManager(); //! Destructor virtual ~CClassificationManager(); virtual CClassificationManager *initializeManager(CSubsumptionClassifierFactory *takeClassifierFactory, CConfigurationProvider *configurationProvider); virtual CSubsumptionClassifier *getClassifier(CConcreteOntology *ontology, CConfigurationBase *config, bool create = true, bool backgroundClassification = false); virtual CClassifierStatistics *collectClassificationStatistics(CClassifierStatistics *statistics); virtual QList getClassifierList(); virtual CClassificationProgress* getClassificationProgress(); virtual cint64 getActiveClassifierCount(); // protected methods protected: // protected variables protected: QReadWriteLock readWriteLock; CSubsumptionClassifierFactory *classifierFac; QHash ontoClassifierHash; QHash ontoBackgroundClassifierHash; QSet ontoClassifierSet; CClassificationProgress mClassificationProgress; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONMANAGER_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodePredecessorPositionClassificationItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodePredecessorPositionClassificationItem0000644000175000017500000000401112520550754032457 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNodePredecessorPositionClassificationItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { CNodePredecessorPositionClassificationItem::CNodePredecessorPositionClassificationItem(CHierarchyNode *node) { testNode = node; initPredNodelist<getParentNodeList(); } CNodePredecessorPositionClassificationItem::~CNodePredecessorPositionClassificationItem() { } CHierarchyNode *CNodePredecessorPositionClassificationItem::getTestingNode() { return testNode; } CNodePredecessorPositionClassificationItem *CNodePredecessorPositionClassificationItem::appendPredecessorNode(CHierarchyNode *node) { predNodelist.append(node); return this; } QList *CNodePredecessorPositionClassificationItem::getPredecessorNodeList() { return &predNodelist; } QList *CNodePredecessorPositionClassificationItem::getInitializationPredecessorNodeList() { return &initPredNodelist; } bool CNodePredecessorPositionClassificationItem::isTestingConcluded() { return predNodelist.isEmpty() && initPredNodelist.isEmpty(); } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CConceptNegationOverRoleTuble.cpp0000644000175000017500000000337612520550752030501 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptNegationOverRoleTuble.h" namespace Konclude { namespace Reasoner { namespace Classifier { CConceptNegationOverRoleTuble::CConceptNegationOverRoleTuble(qint64 conceptTag, bool conceptNegation, bool conceptOverRole) { conTag = conceptTag; conNeg = conceptNegation; overRole = conceptOverRole; } CConceptNegationOverRoleTuble::~CConceptNegationOverRoleTuble() { } qint64 CConceptNegationOverRoleTuble::getConceptTag() const { return conTag; } bool CConceptNegationOverRoleTuble::isConceptNegation() const { return conNeg; } bool CConceptNegationOverRoleTuble::isConceptOverRole() const { return overRole; } bool CConceptNegationOverRoleTuble::operator==(const CConceptNegationOverRoleTuble& tuple) const { return conNeg == tuple.conNeg && conTag == tuple.conTag && overRole == tuple.overRole; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassPossibleSubsumptionMap.cpp0000644000175000017500000000177112520550752030421 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassPossibleSubsumptionMap.h" namespace Konclude { namespace Reasoner { namespace Classifier { }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassIdentifierMap.h0000644000175000017500000000402612405707542030712 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSPOSSIBLESUBSUMPTIONMAP_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSPOSSIBLESUBSUMPTIONMAP_H // Qt includes #include // Namespace includes #include "ClassifierSettings.h" #include "COptimizedKPSetClassPossibleSubsumptionData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Taxonomy; namespace Classifier { /*! * * \class COptimizedKPSetClassPossibleSubsumptionMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetClassPossibleSubsumptionMap : public QMap { // public methods public: //! Constructor COptimizedKPSetClassPossibleSubsumptionMap(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSPOSSIBLESUBSUMPTIONMAP_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionMapIterator.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionMap0000644000175000017500000000536612520550760032437 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSPOSSIBLESUBSUMPTIONMAPITERATOR_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSPOSSIBLESUBSUMPTIONMAPITERATOR_H // Libraries includes #include // Namespace includes #include "ClassifierSettings.h" #include "CClassPossibleSubsumptionMapIterator.h" #include "COptimizedKPSetClassPossibleSubsumptionData.h" // Other includes #include "Reasoner/Ontology/CConceptTagComparer.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class COptimizedKPSetClassPossibleSubsumptionMapIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetClassPossibleSubsumptionMapIterator : public CClassPossibleSubsumptionMapIterator { // public methods public: // Constructor COptimizedKPSetClassPossibleSubsumptionMapIterator(); COptimizedKPSetClassPossibleSubsumptionMapIterator(QMap::iterator itBegin, QMap::iterator itEnd); bool hasNext(); bool isSubsumptionConfirmed(); bool isSubsumptionInvalided(); CConcept* getSubsumptionConcept(); bool invalidateSubsumption(); bool confirmSubsumption(); bool moveNext(); // protected methods protected: // protected variables protected: QMap::iterator mItBegin; QMap::iterator mItEnd; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSPOSSIBLESUBSUMPTIONMAPITERATOR_H ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationSatisfiableCalculationConceptReferenceLinking.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationSatisfiableCalculationConce0000644000175000017500000000224112520550750032403 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationSatisfiableCalculationConceptReferenceLinking.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationSatisfiableCalculationConceptReferenceLinking::CClassificationSatisfiableCalculationConceptReferenceLinking() { } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CIncrementalKPSetClassOntologyClassificationItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CIncrementalKPSetClassOntologyClassificati0000644000175000017500000000704012520550754032370 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIncrementalKPSetClassOntologyClassificationItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { CIncrementalKPSetClassOntologyClassificationItem::CIncrementalKPSetClassOntologyClassificationItem(CConfigurationBase *configuration, CClassifierStatistics *nextClassificationStatistics) : COptimizedKPSetClassOntologyClassificationItem(configuration,nextClassificationStatistics) { mPreviousHierarchyReused = false; mReusedClassConClassification = nullptr; mPreviousReusedClassCalculationCount = 0; mNewInitializedClassCalculationCount = 0; } CIncrementalKPSetClassOntologyClassificationItem::~CIncrementalKPSetClassOntologyClassificationItem() { } CIncrementalKPSetClassOntologyClassificationItem* CIncrementalKPSetClassOntologyClassificationItem::setPreviousHierarchyReused(bool reused) { mPreviousHierarchyReused = reused; return this; } bool CIncrementalKPSetClassOntologyClassificationItem::isPreviousHierarchyReused() { return mPreviousHierarchyReused; } CClassConceptClassification* CIncrementalKPSetClassOntologyClassificationItem::getPreviousReusedClassClassification() { return mReusedClassConClassification; } CClassConceptClassification* CIncrementalKPSetClassOntologyClassificationItem::setPreviousReusedClassClassification(CClassConceptClassification* reusedClassClassification) { return mReusedClassConClassification; } cint64 CIncrementalKPSetClassOntologyClassificationItem::getPreviousReusedClassCalculationCount() { return mPreviousReusedClassCalculationCount; } cint64 CIncrementalKPSetClassOntologyClassificationItem::getNewInitializedClassCalculationCount() { return mNewInitializedClassCalculationCount; } CIncrementalKPSetClassOntologyClassificationItem* CIncrementalKPSetClassOntologyClassificationItem::setPreviousReusedClassCalculationCount(cint64 count) { mPreviousReusedClassCalculationCount = count; return this; } CIncrementalKPSetClassOntologyClassificationItem* CIncrementalKPSetClassOntologyClassificationItem::incPreviousReusedClassCalculationCount(cint64 incCount) { mPreviousReusedClassCalculationCount += incCount; return this; } CIncrementalKPSetClassOntologyClassificationItem* CIncrementalKPSetClassOntologyClassificationItem::setNewInitializedClassCalculationCount(cint64 count) { mNewInitializedClassCalculationCount = count; return this; } CIncrementalKPSetClassOntologyClassificationItem* CIncrementalKPSetClassOntologyClassificationItem::incNewInitializedClassCalculationCount(cint64 incCount) { mNewInitializedClassCalculationCount += incCount; return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationProgress.h0000644000175000017500000000533612520550750027070 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CClassificationProgress_H #define KONCLUDE_REASONER_CLASSIFIER_CClassificationProgress_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Classifier { /*! * * \class CClassificationProgress * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationProgress { // public methods public: //! Constructor CClassificationProgress(); qint64 getClassificationCount(); qint64 getTestedClasses(); qint64 getTotalClasses(); qint64 getTestedSubsumptions(); qint64 getTotalSubsumptions(); double getRemainingMilliSeconds(); double getProgessPercent(); CClassificationProgress *setClassificationCount(qint64 classificationCount); CClassificationProgress *setTestedClasses(qint64 testedClasses); CClassificationProgress *setTotalClasses(qint64 totalClasses); CClassificationProgress *setTestedSubsumptions(qint64 testedSubsumptions); CClassificationProgress *setTotalSubsumptions(qint64 totalSubsumptions); CClassificationProgress *setRemainingMilliSeconds(double remainingMilliSeconds); CClassificationProgress *setProgessPercent(double progessPercent); CClassificationProgress *resetValues(); // protected methods protected: // protected variables protected: qint64 mClassificationCount; qint64 mTestedClasses; qint64 mTotalClasses; qint64 mTestedSubsum; qint64 mTotalSubsum; double mRemainingMilliSeconds; double mProgessPercent; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CClassificationProgress_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRoleOntologyClassificationItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRoleOntologyClassificationI0000644000175000017500000003123012520550760032370 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetRoleOntologyClassificationItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedKPSetRoleOntologyClassificationItem::COptimizedKPSetRoleOntologyClassificationItem(CConfigurationBase *configuration, CClassifierStatistics *nextClassificationStatistics) : COntologyClassificationItem(configuration,nextClassificationStatistics) { mTopSatTestItem = nullptr; mBottomSatTestItem = nullptr; mRemainingSatTests = 0; mRunningSatTests = 0; mSatisfiableTestingPhaseFinished = false; mPossibleSubsumptionTestingPhaseFinished = false; mRemainingPossibleSubsumptionTests = 0; mRunningPossibleSubsumptionTests = 0; mCalculatedPossibleSubsumCount = 0; mCalculatedTruePossibleSubsumCount = 0; mCalculatedFalsePossibleSubsumCount = 0; mPossibleSubsumCount = 0; mTruePossibleSubsumCount = 0; mFalsePossibleSubsumCount = 0; mInitTime.start(); } COptimizedKPSetRoleOntologyClassificationItem::~COptimizedKPSetRoleOntologyClassificationItem() { } QHash* COptimizedKPSetRoleOntologyClassificationItem::getConceptSatisfiableTestItemHash() { return &mConceptSatItemHash; } QList* COptimizedKPSetRoleOntologyClassificationItem::getConceptSatisfiableTestItemContainer() { return &mSatTestItemContainer; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleOntologyClassificationItem::getTopConceptSatisfiableTestItem() { return mTopSatTestItem; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleOntologyClassificationItem::getBottomConceptSatisfiableTestItem() { return mBottomSatTestItem; } QList* COptimizedKPSetRoleOntologyClassificationItem::getNextSatisfiableTestingItemList() { return &mNextItemList; } QSet* COptimizedKPSetRoleOntologyClassificationItem::getNextCandidateSatisfiableTestingItemSet() { return &mNextCandItemSet; } QSet* COptimizedKPSetRoleOntologyClassificationItem::getRemainingCandidateSatisfiableTestingItemSet() { return &mRemainingCandItemSet; } QList* COptimizedKPSetRoleOntologyClassificationItem::getNextPossibleSubsumptionTestingItemList() { return &mNextPossSubsumItemList; } QSet* COptimizedKPSetRoleOntologyClassificationItem::getCurrentPossibleSubsumptionTestingItemSet() { return &mCurrentPossSubsumItemSet; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::initTopBottomSatisfiableTestingItems(COptimizedKPSetRoleTestingItem* topItem, COptimizedKPSetRoleTestingItem* bottomItem) { mTopSatTestItem = topItem; mBottomSatTestItem = bottomItem; return this; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleOntologyClassificationItem::getConceptSatisfiableTestItem(CConcept* satTestConcept, bool create) { COptimizedKPSetRoleTestingItem* item = nullptr; if (satTestConcept->getOperatorCode() == CCEQCAND) { satTestConcept = satTestConcept->getOperandList()->getData(); } item = mConceptSatItemHash.value(satTestConcept); if (!item && create) { item = new COptimizedKPSetRoleTestingItem(); item->initSatisfiableTestingItem(satTestConcept); mConceptSatItemHash.insert(satTestConcept,item); mSatTestItemContainer.append(item); } return item; } bool COptimizedKPSetRoleOntologyClassificationItem::hasAllSatisfiableTestsCompleted() { return mRemainingSatTests <= 0 && mRunningSatTests <= 0; } bool COptimizedKPSetRoleOntologyClassificationItem::hasRemainingSatisfiableTests() { return mRemainingSatTests > 0; } cint64 COptimizedKPSetRoleOntologyClassificationItem::getRemainingSatisfiableTestsCount() { return mRemainingSatTests; } cint64 COptimizedKPSetRoleOntologyClassificationItem::getRunningSatisfiableTestsCount() { return mRunningSatTests; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::incRemainingSatisfiableTestsCount(cint64 incCount) { mRemainingSatTests += incCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::incRunningSatisfiableTestsCount(cint64 incCount) { mRunningSatTests += incCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::decRemainingSatisfiableTestsCount(cint64 decCount) { mRemainingSatTests -= decCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::decRunningSatisfiableTestsCount(cint64 decCount) { mRunningSatTests -= decCount; return this; } QList* COptimizedKPSetRoleOntologyClassificationItem::getSatisfiableConceptItemList() { return &mSatisfiableItemList; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::addSatisfiableConceptItem(COptimizedKPSetRoleTestingItem* item) { mSatisfiableItemList.append(item); return this; } QHash* COptimizedKPSetRoleOntologyClassificationItem::getConceptReferenceLinkingDataHash() { return &mConceptRefLinkData; } bool COptimizedKPSetRoleOntologyClassificationItem::hasSatisfiableTestingPhaseFinished() { return mSatisfiableTestingPhaseFinished; } bool COptimizedKPSetRoleOntologyClassificationItem::hasPossibleSubsumptionTestingPhaseFinished() { return mPossibleSubsumptionTestingPhaseFinished; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::setSatisfiableTestingPhaseFinished(bool finished) { mSatisfiableTestingPhaseFinished = finished; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::setPossibleSubsumptionTestingPhaseFinished(bool finished) { mPossibleSubsumptionTestingPhaseFinished = finished; return this; } cint64 COptimizedKPSetRoleOntologyClassificationItem::getRemainingPossibleSubsumptionTestsCount() { return mRemainingPossibleSubsumptionTests; } cint64 COptimizedKPSetRoleOntologyClassificationItem::hasRemainingPossibleSubsumptionTests() { return mRemainingPossibleSubsumptionTests > 0; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::incRemainingPossibleSubsumptionTestsCount(cint64 incCount) { mRemainingPossibleSubsumptionTests += incCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::decRemainingPossibleSubsumptionTestsCount(cint64 decCount) { mRemainingPossibleSubsumptionTests -= decCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::setRemainingPossibleSubsumptionTestsCount(cint64 testCount) { mRemainingPossibleSubsumptionTests = testCount; return this; } QSet* COptimizedKPSetRoleOntologyClassificationItem::getRemainingPossibleSubsumptionTestingSet() { return &mRemPossClassTestingSet; } cint64 COptimizedKPSetRoleOntologyClassificationItem::getRemainingPossibleSubsumptionTestingCount() { return mRemPossClassTestingSet.count(); } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::incRunningPossibleSubsumptionTestsCount(cint64 incCount) { mRunningPossibleSubsumptionTests += incCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::decRunningPossibleSubsumptionTestsCount(cint64 decCount) { mRunningPossibleSubsumptionTests -= decCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::addMemoryPools(CMemoryPool* memoryPools) { mMemoryPoolContainer.appendMemoryPool(memoryPools); return this; } CMemoryPool* COptimizedKPSetRoleOntologyClassificationItem::takeMemoryPools() { return mMemoryPoolContainer.takeMemoryPools(); } cint64 COptimizedKPSetRoleOntologyClassificationItem::getCalculatedPossibleSubsumerCount() { return mCalculatedPossibleSubsumCount; } cint64 COptimizedKPSetRoleOntologyClassificationItem::getCalculatedTruePossibleSubsumerCount() { return mCalculatedTruePossibleSubsumCount; } cint64 COptimizedKPSetRoleOntologyClassificationItem::getCalculatedFalsePossibleSubsumerCount() { return mCalculatedFalsePossibleSubsumCount; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::setCalculatedPossibleSubsumerCount(cint64 subsumCount) { mCalculatedPossibleSubsumCount = subsumCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::setCalculatedTruePossibleSubsumerCount(cint64 subsumCount) { mCalculatedTruePossibleSubsumCount = subsumCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::setCalculatedFalsePossibleSubsumerCount(cint64 subsumCount) { mCalculatedFalsePossibleSubsumCount = subsumCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::incCalculatedPossibleSubsumerCount(cint64 incSubsumCount) { mCalculatedPossibleSubsumCount += incSubsumCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::incCalculatedTruePossibleSubsumerCount(cint64 incSubsumCount) { mCalculatedTruePossibleSubsumCount += incSubsumCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::incCalculatedFalsePossibleSubsumerCount(cint64 incSubsumCount) { mCalculatedFalsePossibleSubsumCount += incSubsumCount; return this; } cint64 COptimizedKPSetRoleOntologyClassificationItem::getPossibleSubsumerCount() { return mPossibleSubsumCount; } cint64 COptimizedKPSetRoleOntologyClassificationItem::getTruePossibleSubsumerCount() { return mTruePossibleSubsumCount; } cint64 COptimizedKPSetRoleOntologyClassificationItem::getFalsePossibleSubsumerCount() { return mFalsePossibleSubsumCount; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::setPossibleSubsumerCount(cint64 subsumCount) { mPossibleSubsumCount = subsumCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::setTruePossibleSubsumerCount(cint64 subsumCount) { mTruePossibleSubsumCount = subsumCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::setFalsePossibleSubsumerCount(cint64 subsumCount) { mFalsePossibleSubsumCount = subsumCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::incPossibleSubsumerCount(cint64 incSubsumCount) { mPossibleSubsumCount += incSubsumCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::incTruePossibleSubsumerCount(cint64 incSubsumCount) { mTruePossibleSubsumCount += incSubsumCount; return this; } COptimizedKPSetRoleOntologyClassificationItem* COptimizedKPSetRoleOntologyClassificationItem::incFalsePossibleSubsumerCount(cint64 incSubsumCount) { mFalsePossibleSubsumCount += incSubsumCount; return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationInitializePossibleSubsumptionMessageData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationInitializePossibleSubsumpti0000644000175000017500000000615112520550746032555 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONINITIALIZEPOSSIBLESUBSUMPTIONMESSAGEDATA_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONINITIALIZEPOSSIBLESUBSUMPTIONMESSAGEDATA_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationMessageData.h" #include "CClassificationInitializePossibleSubsumptionData.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CClassificationInitializePossibleSubsumptionMessageData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationInitializePossibleSubsumptionMessageData : public CClassificationMessageData { // public methods public: //! Constructor CClassificationInitializePossibleSubsumptionMessageData(); CClassificationInitializePossibleSubsumptionMessageData* initClassificationPossibleSubsumptionMessageData(CConcept* subsumedConcept, CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* possSubsumerList, bool eqConceptsNonCandidatePossSubsumers = false, CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* eqConNonCandpossSubsumerList = nullptr); CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* getClassPossibleSubsumerList(); CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* getClassEqConceptNonCandidatePossibleSubsumerList(); CConcept* getSubsumedConcept(); bool hasEqConceptsNonCandidatePossSubsumers(); // protected methods protected: // protected variables protected: CConcept* mSubsumedConcept; bool mEqConceptsNonCandidatePossSubsumers; // list has to be sorted by concept tag CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* mPossSubsumerList; CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* mEqConNonCandPossSubsumerList; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONINITIALIZEPOSSIBLESUBSUMPTIONMESSAGEDATA_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionMapIterator.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionMap0000644000175000017500000000502112520550760032423 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetClassPossibleSubsumptionMapIterator.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedKPSetClassPossibleSubsumptionMapIterator::COptimizedKPSetClassPossibleSubsumptionMapIterator() { } COptimizedKPSetClassPossibleSubsumptionMapIterator::COptimizedKPSetClassPossibleSubsumptionMapIterator(QMap::iterator itBegin, QMap::iterator itEnd) { mItBegin = itBegin; mItEnd = itEnd; } bool COptimizedKPSetClassPossibleSubsumptionMapIterator::hasNext() { return mItBegin != mItEnd; } bool COptimizedKPSetClassPossibleSubsumptionMapIterator::isSubsumptionConfirmed() { return mItBegin.value()->isSubsumptionConfirmed(); } bool COptimizedKPSetClassPossibleSubsumptionMapIterator::isSubsumptionInvalided() { return mItBegin.value()->isSubsumptionInvalided(); } CConcept* COptimizedKPSetClassPossibleSubsumptionMapIterator::getSubsumptionConcept() { return mItBegin.key().getConcept(); } bool COptimizedKPSetClassPossibleSubsumptionMapIterator::invalidateSubsumption() { bool wasInvalid = isSubsumptionInvalided(); mItBegin.value()->setSubsumptionInvalid(true); return wasInvalid; } bool COptimizedKPSetClassPossibleSubsumptionMapIterator::confirmSubsumption() { bool wasConfirmed = isSubsumptionConfirmed(); mItBegin.value()->setSubsumptionConfirmed(true); return wasConfirmed; } bool COptimizedKPSetClassPossibleSubsumptionMapIterator::moveNext() { ++mItBegin; return true; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationUpdatePossibleSubsumptionMessageData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationUpdatePossibleSubsumptionMe0000644000175000017500000000433012520550750032505 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONUPDATEPOSSIBLESUBSUMPTIONMESSAGEDATA_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONUPDATEPOSSIBLESUBSUMPTIONMESSAGEDATA_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationMessageData.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CClassificationUpdatePossibleSubsumptionMessageData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationUpdatePossibleSubsumptionMessageData : public CClassificationMessageData { // public methods public: //! Constructor CClassificationUpdatePossibleSubsumptionMessageData(); CClassificationUpdatePossibleSubsumptionMessageData* initClassificationPossibleSubsumptionMessageData(CConcept* subsumedConcept); CConcept* getSubsumedConcept(); // protected methods protected: // protected variables protected: CConcept* mSubsumedConcept; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONUPDATEPOSSIBLESUBSUMPTIONMESSAGEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassSubsumptionClassifierContext.cpp0000644000175000017500000000335412520550752031633 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassSubsumptionClassifierContext.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassSubsumptionClassifierContext::CClassSubsumptionClassifierContext() { mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); mMemMan = new CLimitedReserveMemoryPoolAllocationManager(mMemoryPoolProvider); } CClassSubsumptionClassifierContext::~CClassSubsumptionClassifierContext() { delete mMemMan; delete mMemoryPoolProvider; } CMemoryPoolAllocationManager* CClassSubsumptionClassifierContext::getMemoryPoolAllocationManager() { return mMemMan; } CMemoryAllocationManager* CClassSubsumptionClassifierContext::getMemoryAllocationManager() { return mMemMan; } CMemoryPoolProvider* CClassSubsumptionClassifierContext::getMemoryPoolProvider() { return mMemoryPoolProvider; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRoleSubsumptionClassifierThread.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRoleSubsumptionClassifierTh0000644000175000017500000002117012520550762032426 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COptimizedKPSetRoleSubsumptionClassifierThread_H #define KONCLUDE_REASONER_CLASSIFIER_COptimizedKPSetRoleSubsumptionClassifierThread_H // Libraries includes #include // Namespace includes #include "ClassifierSettings.h" #include "CSubsumptionClassifier.h" #include "CSubsumptionClassifierThread.h" #include "CPartialPruningTaxonomy.h" #include "CClassificationWorkItem.h" #include "COptimizedKPSetRoleOntologyClassificationItem.h" #include "CClassificationPseudoModelIdentifierMessageData.h" #include "COptimizedKPSetRolePossibleSubsumptionData.h" #include "COptimizedKPSetRoleTestingItem.h" #include "CClassificationSubsumptionMessageData.h" #include "CClassificationInitializePossibleSubsumptionMessageData.h" #include "CClassificationUpdatePossibleSubsumptionMessageData.h" #include "CPrecomputedSaturationSubsumerExtractor.h" // Other includes #include "Context/CContextBase.h" #include "Reasoner/Revision/COntologyRevision.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h" #include "Reasoner/Generator/CSatisfiableCalculationJobGenerator.h" #include "Utilities/Memory/CTempMemoryPoolContainerAllocationManager.h" #include "KoncludeSettings.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include using namespace std; namespace Konclude { using namespace Context; using namespace Utilities::Memory; namespace Reasoner { using namespace Revision; using namespace Ontology; using namespace Generator; using namespace Kernel; using namespace Task; namespace Classifier { #ifndef KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED //#define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCOUTOUTPUT //#define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGTAXONOMYCOUTOUTPUT //#define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGLOGOUTPUT //#define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGBOXDESCRIPTION #define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGSTATUSDESCRIPTION #endif /*! * * \class COptimizedKPSetRoleSubsumptionClassifierThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetRoleSubsumptionClassifierThread : public CSubsumptionClassifierThread, public CLogIdentifier { // public methods public: //! Constructor COptimizedKPSetRoleSubsumptionClassifierThread(CReasonerManager *reasonerManager); //! Destructor virtual ~COptimizedKPSetRoleSubsumptionClassifierThread(); virtual QString getStatusString(); virtual CClassificationProgress* getClassificationProgress(); // protected methods protected: virtual bool finishOntologyClassification(COntologyClassificationItem *ontClassItem); virtual CSubsumptionClassifierThread *scheduleOntologyClassification(CConcreteOntology *ontology, CTaxonomy *taxonomy, CClassificationCalculationSupport *classificationSupport, CConfigurationBase *config); virtual CSubsumptionClassifierThread *processCalculationJob(CSatisfiableCalculationJob* job, COntologyClassificationItem *ontClassItem, CClassificationWorkItem* workItem); virtual void readCalculationConfig(CCalculationConfigurationExtension *config); virtual bool interpreteSubsumptionResult(COntologyClassificationItem *ontClassItem, CConcept *subsumerConcept, CConcept *subsumedConcept, bool isSubsumption); virtual bool interpreteSatisfiableResult(COntologyClassificationItem *ontClassItem, CConcept *satisfiableConcept, bool isSatis); virtual bool interpreteTestResults(CTestCalculatedCallbackEvent *testResult); virtual bool createNextSubsumtionTest(); virtual CTaxonomy *createEmptyTaxonomyForOntology(CConcreteOntology *ontology, CConfigurationBase *config); virtual bool interpreteToldSubsumptionResult(COntologyClassificationItem *ontClassItem, const QList > &subSumRelList, bool isSubSum); bool calculateSatisfiable(COptimizedKPSetRoleOntologyClassificationItem *optSubClassItem, COptimizedKPSetRoleTestingItem* nextSatTestItem); virtual bool processToldClassificationMessage(COntologyClassificationItem *ontClassItem, CClassificationMessageData* messageData, CMemoryPool* memoryPools); bool calculateSubsumption(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRoleTestingItem* subsumedItem, COptimizedKPSetRoleTestingItem* possSubsumerItem, COptimizedKPSetRolePossibleSubsumptionData* possSubsumData); COptimizedKPSetRolePossibleSubsumptionData* getNextPossibleSubsumptionCalculation(COptimizedKPSetRoleOntologyClassificationItem *ontClassItem, COptimizedKPSetRoleTestingItem* classItem); bool prunePossibleSubsumptions(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRoleTestingItem* item, COptimizedKPSetRolePossibleSubsumptionData* possSubsumData); bool propagateDownSubsumption(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRoleTestingItem* item, COptimizedKPSetRoleTestingItem* subsumerItem); bool pruneDownSubsumption(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRoleTestingItem* item, CConcept* subsumerConcept); bool pruneUpNotSubsumption(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRoleTestingItem* item, CConcept* notSubsumerConcept); bool propagateUnsatisfiability(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRoleTestingItem* item); QString createDebugKPSetString(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, const QString& filename); void testDebugPossibleSubsumerCorrectCounted(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem); void testDebugPossibleSubsumerCorrectReferenced(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem); void incRemainingPossibleSubsumptionTestingCount(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRolePossibleSubsumptionMap* posSubsumMap); void decRemainingPossibleSubsumptionTestingCount(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRolePossibleSubsumptionMap* posSubsumMap, bool subsumptionConfirmed); // protected variables protected: QHash workOntItemHash; QStringList satTestedConList; QStringList possSubsumInitConList; QString statusString; QMutex statUpdateMutex; CClassificationProgress mClassifyProgess; cint64 satTestedCount; cint64 totalToSatTestClassCount; cint64 subsumTestedCount; cint64 totalToSubsumTestCount; QTime classStartTime; QSet > subsumCalcedSet; bool mConfPossSubsumCalcOrderTopDown; bool mConfPossSubsumCalcOrderBottomUp; bool mConfPossSubsumCalcOrderConceptSorted; bool mConfPossSubsumCalcOrderFewestSubsumptionSorted; bool mConfPossSubsumPseudoModelPretest; bool mConfPossSubsumPseudoModelTest; bool mConfWriteDebuggingData; cint64 mStatProcesedSubsumMessCount; cint64 mStatProcesedPossSubsumInitMessCount; cint64 mStatProcesedPossSubsumUpdateMessCount; cint64 mStatProcesedPseudoModelMessCount; cint64 mInterpretedSubsumptionCalculationCount; cint64 mOrderedSubsumptionCalculationCount; cint64 mPseudoModelPretestSubsumptionCalculationCount; cint64 mCreatedCalculationTaskCount; cint64 mRecievedCallbackCount; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COptimizedKPSetRoleSubsumptionClassifierThread_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassPossibleSubsumptionMapIterator.cpp0000644000175000017500000000200112520550752032116 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassPossibleSubsumptionMapIterator.h" namespace Konclude { namespace Reasoner { namespace Classifier { }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CConceptNegationOverRoleTuble.h0000644000175000017500000000471212520550752030141 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCONCEPTNEGATIONOVERROLETUBLE_H #define KONCLUDE_REASONER_CLASSIFIER_CCONCEPTNEGATIONOVERROLETUBLE_H // Libraries includes #include // Namespace includes #include "ClassifierSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Classifier { /*! * * \class CConceptNegationOverRoleTuble * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptNegationOverRoleTuble { // public methods public: //! Constructor CConceptNegationOverRoleTuble(qint64 conceptTag, bool conceptNegation, bool conceptOverRole); //! Destructor virtual ~CConceptNegationOverRoleTuble(); qint64 getConceptTag() const; bool isConceptNegation() const; bool isConceptOverRole() const; bool operator==(const CConceptNegationOverRoleTuble& tuple) const; // protected methods protected: // protected variables protected: qint64 conTag; bool conNeg; bool overRole; // private methods private: // private variables private: }; inline uint qHash(const CConceptNegationOverRoleTuble& tuple) { qint64 key = tuple.getConceptTag(); key += 17*tuple.isConceptNegation(); key += 13*tuple.isConceptOverRole(); if (sizeof(quint64) > sizeof(uint)) { return uint((key >> (8 * sizeof(uint) - 1)) ^ key); } else { return uint(key); } } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCONCEPTNEGATIONOVERROLETUBLE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedSubClassSatisfiableTestingItem.h0000644000175000017500000001374612520550762032347 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDSUBCLASSSATISFIABLETESTINGITEM_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDSUBCLASSSATISFIABLETESTINGITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CConceptSubsumerObserver.h" #include "CClassificationSatisfiableCalculationConceptReferenceLinking.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptSatisfiableReferenceLinkingData.h" #include "Reasoner/Consistiser/CIndividualDependenceTrackingMarker.h" #include "Reasoner/Taxonomy/CHierarchyNode.h" #include "Reasoner/Kernel/Cache/CCacheEntry.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Taxonomy; using namespace Consistiser; using namespace Kernel::Cache; namespace Classifier { /*! * * \class COptimizedSubClassSatisfiableTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedSubClassSatisfiableTestingItem : public CClassificationSatisfiableCalculationConceptReferenceLinking, public CConceptSubsumerObserver, public CIndividualDependenceTrackingMarker { // public methods public: //! Constructor COptimizedSubClassSatisfiableTestingItem(); COptimizedSubClassSatisfiableTestingItem* initSatisfiableTestingItem(CConcept* satTestConcept); CConcept* getSatisfiableConcept(); CHierarchyNode* getSatisfiableConceptHierarchyNode(); COptimizedSubClassSatisfiableTestingItem* setSatisfiableConceptHierarchyNode(CHierarchyNode* hierNode); QSet* getSubsumingConceptItemSet(); QList* getSubsumingConceptItemList(); cint64 getSubsumingConceptItemCount() const; QList* getSuccessorItemList(); cint64 getUnprocessedPredecessorItemCount(); bool hasOnlyProcessedPredecessorItems(); COptimizedSubClassSatisfiableTestingItem* decUnprocessedPredecessorItems(cint64 decCount = 1); COptimizedSubClassSatisfiableTestingItem* incUnprocessedPredecessorItems(cint64 incCount = 1); COptimizedSubClassSatisfiableTestingItem* setUnprocessedPredecessorItems(cint64 count); COptimizedSubClassSatisfiableTestingItem* addSuccessorSatisfiableTestItem(COptimizedSubClassSatisfiableTestingItem* succItem); bool isSatisfiableTestOrdered(); bool isSatisfiableTested(); bool isResultUnsatisfiableDerivated(); bool isResultSatisfiableDerivated(); bool getSatisfiableTestedResult(); COptimizedSubClassSatisfiableTestingItem* setSatisfiableTestOrdered(bool satTestOrdered); COptimizedSubClassSatisfiableTestingItem* setSatisfiableTested(bool satTested); COptimizedSubClassSatisfiableTestingItem* setResultUnsatisfiableDerivated(bool unsatDerivated); COptimizedSubClassSatisfiableTestingItem* setResultSatisfiableDerivated(bool satDerivated); COptimizedSubClassSatisfiableTestingItem* setSatisfiableTestedResult(bool satTestedResult); COptimizedSubClassSatisfiableTestingItem* addSubsumingConceptItem(COptimizedSubClassSatisfiableTestingItem* subsumingItem); CConceptSubsumerObserver* tellConceptSupsumption(CConcept* subsumedConcept, CConcept* subsumerConcept); QList* sortSubsumingConceptItemList(); bool isEquivalentItem(); COptimizedSubClassSatisfiableTestingItem* setEquivalentItem(bool equivalent); bool isPredecessorItem(); COptimizedSubClassSatisfiableTestingItem* setPredecessorItem(bool isPredecessorOfOneItem); bool isMoreConceptClassificationInformationRequired(); CCacheEntry* getFastSatisfiabilityTestedSaturationCacheEntry(); COptimizedSubClassSatisfiableTestingItem* setFastSatisfiabilityTestedSaturationCacheEntry(CCacheEntry* cacheEntry); bool hasSuccessfullyFastSatisfiabilityTested(); COptimizedSubClassSatisfiableTestingItem* setSuccessfullyFastSatisfiabilityTested(bool successfullyTested); virtual CIndividualDependenceTrackingMarker* setIndividualDependenceTracked(); bool hasIndividualDependenceTracked(); // protected methods protected: // protected variables protected: CConcept* mConceptSat; CHierarchyNode* mConSatHierNode; QSet mSubsumingConceptItemSet; QList mSubsumingConceptItemList; QList mSuccList; cint64 mPredCounter; bool mSatTestOrdered; bool mTestedSat; bool mUnsatDerivated; bool mSatDerivated; bool mSatTestedResult; bool mEquiItem; bool mPredOfItem; //QString mSubsumingConceptString; CCacheEntry* mFastSatCacheEntry; bool mSuccFastSatTested; bool mIndiDepTracked; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDSUBCLASSSATISFIABLETESTINGITEM_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodeTopDownTraversalClassificationItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodeTopDownTraversalClassificationItem.cp0000644000175000017500000001416512520550756032350 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNodeTopDownTraversalClassificationItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { CNodeTopDownTraversalClassificationItem::CNodeTopDownTraversalClassificationItem(CHierarchyNode *node, CHierarchyNode *topNode, QList *lockedReleaseProcessingList) { traversalNode = node; newBranchNodeList << topNode; lockedReleaseProcList = lockedReleaseProcessingList; testNode = 0; parLockNode = 0; eqTestNode = 0; subSumTestingResult = false; alredyTraversedDirectBlockedSuccessorNode = false; } CNodeTopDownTraversalClassificationItem::~CNodeTopDownTraversalClassificationItem() { } CNodeBlockedClassificationItem *CNodeTopDownTraversalClassificationItem::releaseBlockedResumeProcessing() { lockedReleaseProcList->append(this); return this; } CNodeBlockedClassificationItem *CNodeTopDownTraversalClassificationItem::releaseTestingBlockedResumeProcessing(CConcept *subsumerConcept, CConcept *subsumedConcept, bool testingResult) { subSumTestingResult = testingResult; lockedReleaseProcList->append(this); return this; } CHierarchyNode *CNodeTopDownTraversalClassificationItem::getTraversalNode() { return traversalNode; } QList *CNodeTopDownTraversalClassificationItem::getTestingNodeList() { return &testingNodeList; } CNodeTopDownTraversalClassificationItem *CNodeTopDownTraversalClassificationItem::appendTestingNodeList(QList &nodeList) { testingNodeList << nodeList; return this; } CNodeTopDownTraversalClassificationItem *CNodeTopDownTraversalClassificationItem::appendTestingNode(CHierarchyNode *node) { testingNodeList.append(node); return this; } QList *CNodeTopDownTraversalClassificationItem::getParentNodeList() { return &parentNodeList; } CNodeTopDownTraversalClassificationItem *CNodeTopDownTraversalClassificationItem::appendParentNodeList(QList &nodeList) { parentNodeList << nodeList; return this; } CNodeTopDownTraversalClassificationItem *CNodeTopDownTraversalClassificationItem::appendParentNode(CHierarchyNode *node) { parentNodeList.append(node); return this; } bool CNodeTopDownTraversalClassificationItem::hasNextTestingNode() { return !testingNodeList.isEmpty(); } CHierarchyNode *CNodeTopDownTraversalClassificationItem::takeNextTestingNode() { testNode = testingNodeList.takeFirst(); return testNode; } CHierarchyNode *CNodeTopDownTraversalClassificationItem::getTestingNode() { return testNode; } CNodeTopDownTraversalClassificationItem *CNodeTopDownTraversalClassificationItem::clearTestingNode() { testNode = 0; return this; } bool CNodeTopDownTraversalClassificationItem::getTestingResult() { return subSumTestingResult; } QList *CNodeTopDownTraversalClassificationItem::getBranchLockedNodeList() { return &branchLockedNodeList; } CNodeTopDownTraversalClassificationItem *CNodeTopDownTraversalClassificationItem::appendBranchLockedNodeList(QList &nodeList) { foreach (CHierarchyNode *node, nodeList) { appendBranchLockedNode(node); } return this; } CNodeTopDownTraversalClassificationItem *CNodeTopDownTraversalClassificationItem::appendBranchLockedNode(CHierarchyNode *branchNode) { if (!branchLockedNodeSet.contains(branchNode)) { branchLockedNodeSet.insert(branchNode); branchLockedNodeList.append(branchNode); } return this; } bool CNodeTopDownTraversalClassificationItem::hasDirectBranchLockedNode() { return parLockNode != 0; } CHierarchyNode *CNodeTopDownTraversalClassificationItem::getDirectBranchLockedNode() { return parLockNode; } CNodeTopDownTraversalClassificationItem *CNodeTopDownTraversalClassificationItem::setDirectBranchLockedNode(CHierarchyNode *parentLockedNode) { parLockNode = parentLockedNode; return this; } QList *CNodeTopDownTraversalClassificationItem::getNewBranchNodeList() { return &newBranchNodeList; } CNodeTopDownTraversalClassificationItem *CNodeTopDownTraversalClassificationItem::appendNewBranchNodeList(QList &nodeList) { newBranchNodeList << nodeList; return this; } CNodeTopDownTraversalClassificationItem *CNodeTopDownTraversalClassificationItem::appendNewBranchNode(CHierarchyNode *branchNode) { newBranchNodeList.append(branchNode); return this; } CHierarchyNode *CNodeTopDownTraversalClassificationItem::getEquivalentTestingNode() { return eqTestNode; } CNodeTopDownTraversalClassificationItem *CNodeTopDownTraversalClassificationItem::setEquivalentTestingNode(CHierarchyNode *equivalentTestingNode) { eqTestNode = equivalentTestingNode; return this; } CNodeTopDownTraversalClassificationItem* CNodeTopDownTraversalClassificationItem::setAlreadyTraversedDirectBlockedSuccessorNode(bool alredyTraversed) { alredyTraversedDirectBlockedSuccessorNode = alredyTraversed; return this; } bool CNodeTopDownTraversalClassificationItem::hasAlreadyTraversedDirectBlockedSuccessorNode() { return alredyTraversedDirectBlockedSuccessorNode; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedClassExtractedSaturationOntologyClassificationItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedClassExtractedSaturationOntology0000644000175000017500000000646712520550756032601 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDCLASSEXTRACTEDSATURATIONONTOLOGYCLASSIFICATIONITEM_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDCLASSEXTRACTEDSATURATIONONTOLOGYCLASSIFICATIONITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "COntologyClassificationItem.h" #include "COptimizedClassExtractedSaturationSatisfiableTestingItem.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Classifier { /*! * * \class COptimizedClassExtractedSaturationOntologyClassificationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedClassExtractedSaturationOntologyClassificationItem : public COntologyClassificationItem { // public methods public: //! Constructor COptimizedClassExtractedSaturationOntologyClassificationItem(CConfigurationBase *configuration, CClassifierStatistics *nextClassificationStatistics = 0); QHash* getClassSatisfiableTestItemHash(); QList* getClassSatisfiableTestItemList(); COptimizedClassExtractedSaturationSatisfiableTestingItem* getTopConceptSatisfiableTestItem(); COptimizedClassExtractedSaturationSatisfiableTestingItem* getBottomConceptSatisfiableTestItem(); COptimizedClassExtractedSaturationOntologyClassificationItem* initTopBottomSatisfiableTestingItems(COptimizedClassExtractedSaturationSatisfiableTestingItem* topItem, COptimizedClassExtractedSaturationSatisfiableTestingItem* bottomItem); COptimizedClassExtractedSaturationSatisfiableTestingItem* getClassSatisfiableTestItem(CConcept* satTestConcept, bool create = false); // protected methods protected: // protected variables protected: QHash mClassSatItemHash; QList mClassSatTestItemContainer; COptimizedClassExtractedSaturationSatisfiableTestingItem* mTopSatTestItem; COptimizedClassExtractedSaturationSatisfiableTestingItem* mBottomSatTestItem; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDCLASSEXTRACTEDSATURATIONONTOLOGYCLASSIFICATIONITEM_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodeBottomUpTraversalClassificationItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodeBottomUpTraversalClassificationItem.c0000644000175000017500000001565612520550754032353 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNodeBottomUpTraversalClassificationItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { CNodeBottomUpTraversalClassificationItem::CNodeBottomUpTraversalClassificationItem(CHierarchyNode *node, QList &branchNodes, QList *lockedReleaseProcessingList) { traversalNode = node; lockedReleaseProcList = lockedReleaseProcessingList; testNode = 0; parLockNode = 0; subSumTestingResult = false; allSilbingBranchTested = false; branchLockedNodeList << branchNodes; foreach (CHierarchyNode* node, branchNodes) { newBranchNodeSet.insert(node); } silbingBranchTestNodeCount = branchLockedNodeList.count(); mChildNodeAdded = false; } CNodeBottomUpTraversalClassificationItem::~CNodeBottomUpTraversalClassificationItem() { } CNodeBlockedClassificationItem *CNodeBottomUpTraversalClassificationItem::releaseBlockedResumeProcessing() { lockedReleaseProcList->append(this); return this; } CNodeBlockedClassificationItem *CNodeBottomUpTraversalClassificationItem::releaseTestingBlockedResumeProcessing(CConcept *subsumerConcept, CConcept *subsumedConcept, bool testingResult) { subSumTestingResult = testingResult; lockedReleaseProcList->append(this); return this; } CHierarchyNode *CNodeBottomUpTraversalClassificationItem::getTraversalNode() { return traversalNode; } QList *CNodeBottomUpTraversalClassificationItem::getTestingNodeList() { return &testingNodeList; } CNodeBottomUpTraversalClassificationItem *CNodeBottomUpTraversalClassificationItem::appendTestingNodeList(QList &nodeList) { testingNodeList << nodeList; return this; } CNodeBottomUpTraversalClassificationItem *CNodeBottomUpTraversalClassificationItem::appendTestingNode(CHierarchyNode *node) { testingNodeList.append(node); return this; } QList *CNodeBottomUpTraversalClassificationItem::getChildNodeList() { return &childNodeList; } CNodeBottomUpTraversalClassificationItem *CNodeBottomUpTraversalClassificationItem::appendChildNodeList(QList &nodeList) { childNodeList << nodeList; return this; } CNodeBottomUpTraversalClassificationItem *CNodeBottomUpTraversalClassificationItem::appendChildNode(CHierarchyNode *node) { childNodeList.append(node); return this; } bool CNodeBottomUpTraversalClassificationItem::hasNextTestingNode() { return !testingNodeList.isEmpty(); } CHierarchyNode *CNodeBottomUpTraversalClassificationItem::takeNextTestingNode() { testNode = testingNodeList.takeFirst(); return testNode; } CHierarchyNode *CNodeBottomUpTraversalClassificationItem::getTestingNode() { return testNode; } CNodeBottomUpTraversalClassificationItem *CNodeBottomUpTraversalClassificationItem::clearTestingNode() { testNode = 0; return this; } bool CNodeBottomUpTraversalClassificationItem::getTestingResult() { return subSumTestingResult; } QList *CNodeBottomUpTraversalClassificationItem::getBranchLockedNodeList() { return &branchLockedNodeList; } CNodeBottomUpTraversalClassificationItem *CNodeBottomUpTraversalClassificationItem::appendBranchLockedNodeList(QList &nodeList) { branchLockedNodeList << nodeList; return this; } CNodeBottomUpTraversalClassificationItem *CNodeBottomUpTraversalClassificationItem::appendBranchLockedNode(CHierarchyNode *branchNode) { branchLockedNodeList.append(branchNode); return this; } bool CNodeBottomUpTraversalClassificationItem::hasDirectBranchLockedNode() { return parLockNode != 0; } CHierarchyNode *CNodeBottomUpTraversalClassificationItem::getDirectBranchLockedNode() { return parLockNode; } CNodeBottomUpTraversalClassificationItem *CNodeBottomUpTraversalClassificationItem::setDirectBranchLockedNode(CHierarchyNode *parentLockedNode) { parLockNode = parentLockedNode; return this; } QList *CNodeBottomUpTraversalClassificationItem::getNewBranchNodeList() { return &newBranchNodeList; } CNodeBottomUpTraversalClassificationItem *CNodeBottomUpTraversalClassificationItem::appendNewBranchNodeList(QList &nodeList) { foreach (CHierarchyNode* node, nodeList) { appendNewBranchNode(node); } return this; } CNodeBottomUpTraversalClassificationItem *CNodeBottomUpTraversalClassificationItem::appendNewBranchNode(CHierarchyNode *branchNode) { if (!newBranchNodeSet.contains(branchNode)) { newBranchNodeList.append(branchNode); newBranchNodeSet.insert(branchNode); } return this; } bool CNodeBottomUpTraversalClassificationItem::hasAllSilbingBranchTested() { return allSilbingBranchTested; } CNodeBottomUpTraversalClassificationItem *CNodeBottomUpTraversalClassificationItem::setAllSilbingBranchTested(bool allSilbingsTested) { allSilbingBranchTested = allSilbingsTested; return this; } qint64 CNodeBottomUpTraversalClassificationItem::getSilbingBranchTestNodeCount() { return silbingBranchTestNodeCount; } CNodeBottomUpTraversalClassificationItem *CNodeBottomUpTraversalClassificationItem::decSilbingBranchTestNodeCount() { --silbingBranchTestNodeCount; return this; } bool CNodeBottomUpTraversalClassificationItem::isChildNodeAddedContinueBlocking() { return mChildNodeAdded; } CNodeBottomUpTraversalClassificationItem *CNodeBottomUpTraversalClassificationItem::setChildNodeAddedContinueBlocking(bool addedChildNode) { mChildNodeAdded = addedChildNode; return this; } QList CNodeBottomUpTraversalClassificationItem::getChildNodeAddedContinueBlockingList() { return childNodeContinueBlockingList; } CNodeBottomUpTraversalClassificationItem* CNodeBottomUpTraversalClassificationItem::addChildNodeAddedContinueBlocking(CHierarchyNode* continueBlocking) { childNodeContinueBlockingList.append(continueBlocking); return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassIdentifierData.h0000644000175000017500000000374412405707542031054 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COptimizedKPSetClassPossibleSubsumptionData_H #define KONCLUDE_REASONER_CLASSIFIER_COptimizedKPSetClassPossibleSubsumptionData_H // Qt includes // Namespace includes #include "ClassifierSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Taxonomy; namespace Classifier { /*! * * \class COptimizedKPSetClassPossibleSubsumptionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetClassPossibleSubsumptionData { // public methods public: //! Constructor COptimizedKPSetClassPossibleSubsumptionData(); // protected methods protected: // protected variables protected: bool mSubsumptionInvalidFlag; bool mSubsumptionConfirmedFlag; bool mSubsumptionInsertedFlag; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COptimizedKPSetClassPossibleSubsumptionData_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CPrecomputedSaturationSubsumerExtractor.h0000644000175000017500000000663412520550762032400 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CPRECOMPUTEDSATURATIONSUBSUMEREXTRACTOR_H #define KONCLUDE_REASONER_CLASSIFIER_CPRECOMPUTEDSATURATIONSUBSUMEREXTRACTOR_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CConceptSubsumerObserver.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h" #include "Reasoner/Kernel/Task/CSaturationTaskData.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" #include "Reasoner/Kernel/Task/CConsistenceTaskData.h" #include "Reasoner/Kernel/Process/CIndividualSaturationProcessNode.h" #include "Reasoner/Kernel/Process/CReferredIndividualTrackingVector.h" #include "Reasoner/Consistiser/CSaturationConceptDataItem.h" #include "Reasoner/Consistiser/CIndividualDependenceTrackingObserver.h" #include "Reasoner/Consistiser/CIndividualDependenceTrackingMarker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Consistiser; using namespace Kernel::Task; using namespace Kernel::Process; namespace Classifier { /*! * * \class CPrecomputedSaturationSubsumerExtractor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPrecomputedSaturationSubsumerExtractor { // public methods public: //! Constructor CPrecomputedSaturationSubsumerExtractor(CConcreteOntology* ontology); virtual bool extractSubsumers(CConcept* concept, CConceptSubsumerObserver* subsumerObserver, bool* possibleSubsumerFlag = nullptr, CIndividualDependenceTrackingObserver* indDepTrackingObserver = nullptr, CIndividualDependenceTrackingMarker* indiDepTrackMarker = nullptr); virtual bool getConceptFlags(CConcept* concept, bool* unsatisfiableFlag, bool* insufficientFlag, bool* incompleteProcessedFlag); virtual cint64 getSubsumerCount(CConcept* concept); virtual CConcept* getDirectSubsumerCount(CConcept* concept, bool (*isDirectSubsumer)(CConcept*, CConcept*)); virtual bool hasSubsumerConcept(CConcept* concept, CConcept* testSubsumerConcept); // protected methods protected: // protected variables protected: CConcreteOntology* mOntology; CSatisfiableCalculationTask* mSatCalcTask; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CPRECOMPUTEDSATURATIONSUBSUMEREXTRACTOR_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CConfigDependedSubsumptionClassifierFactory.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CConfigDependedSubsumptionClassifierFactor0000644000175000017500000000612312520550754032434 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCONFIGDEPENDEDSUBSUMPTIONCLASSIFIERFACTORY_H #define KONCLUDE_REASONER_CLASSIFIER_CCONFIGDEPENDEDSUBSUMPTIONCLASSIFIERFACTORY_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CSubsumptionClassifier.h" #include "CSubsumptionClassifierFactory.h" #include "COptimizedSubClassSubsumptionClassifierThread.h" #include "COptimizedKPSetClassSubsumptionClassifierThread.h" #include "COptimizedClassExtractedSaturationSubsumptionClassifierThread.h" #include "CIncrementalKPSetClassSubsumptionClassifierThread.h" // Other includes #include "Config/CConfigurationBase.h" #include "Config/CConfigDataReader.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Kernel/Manager/CReasonerManager.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Ontology; using namespace Kernel; using namespace Manager; namespace Classifier { /*! * * \class CConfigDependedSubsumptionClassifierFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConfigDependedSubsumptionClassifierFactory : public CSubsumptionClassifierFactory { // public methods public: //! Constructor CConfigDependedSubsumptionClassifierFactory(CReasonerManager *reasonerManager); //! Destructor virtual ~CConfigDependedSubsumptionClassifierFactory(); virtual CSubsumptionClassifier *createClassifier(CConcreteOntology *ontology, CConfigurationBase *config); virtual CSubsumptionClassifier *createBackgroundClassifier(CConcreteOntology *ontology, CConfigurationBase *config); // protected methods protected: bool isClassificationBySatisfiableCalculationSufficient(CConcreteOntology *ontology, CConfigurationBase *config); bool isClassificationBySaturationCalculationSufficient(CConcreteOntology *ontology, CConfigurationBase *config); // protected variables protected: CReasonerManager *reasonerMan; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCONFIGDEPENDEDSUBSUMPTIONCLASSIFIERFACTORY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CSubsumptionClassifierThread.h0000644000175000017500000001321012520550764030070 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CSUBSUMPTIONCLASSIFIERTHREAD_H #define KONCLUDE_REASONER_CLASSIFIER_CSUBSUMPTIONCLASSIFIERTHREAD_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CSubsumptionClassifier.h" #include "COntologyClassificationItem.h" #include "CClassifyingCallbackDataContext.h" #include "CClassSubsumptionClassifierContext.h" // Other includes #include "Reasoner/Classifier/Events/CClassifyOntologyEvent.h" #include "Reasoner/Classifier/Events/CTestCalculatedCallbackEvent.h" #include "Reasoner/Classifier/Events/CCallbackClassifiedOntologyEvent.h" #include "Reasoner/Classifier/Events/COntologyTellClassificationMessageEvent.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Kernel/Manager/CReasonerManager.h" #include "Concurrent/CThread.h" #include "Concurrent/Callback/CBlockingCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; using namespace Kernel::Manager; using namespace Kernel::Calculation; namespace Classifier { using namespace Events; /*! * * \class CSubsumptionClassifierThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSubsumptionClassifierThread : public CSubsumptionClassifier, public CThread { // public methods public: //! Constructor CSubsumptionClassifierThread(CReasonerManager *reasonerManager); //! Destructor virtual ~CSubsumptionClassifierThread(); virtual bool classify(CConcreteOntology *ontology, CConfigurationBase *config, const QList& requirementList, CCallbackData* callback); virtual bool classify(CConcreteOntology *ontology, CConfigurationBase *config, const QList& requirementList); virtual bool callbackClassified(CConcreteOntology *ontology, CCallbackData *callback); virtual CClassifierStatistics *getClassificationStatistics(); virtual CClassificationProgress* getClassificationProgress(); virtual CClassificationMessageDataObserver* tellClassificationMessage(CConcreteOntology *ontology, CClassificationMessageData* messageData, CMemoryPool* memoryPool); virtual bool isClassifierActive(); // protected methods protected: virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); virtual CTaxonomy* createEmptyTaxonomyForOntology(CConcreteOntology *ontology, CConfigurationBase *config) = 0; virtual bool isOntologyClassificationScheduled(CConcreteOntology *ontology); virtual CSubsumptionClassifierThread* scheduleOntologyClassification(CConcreteOntology *ontology, CTaxonomy *taxonomy, CClassificationCalculationSupport *classificationSupport, CConfigurationBase *config); virtual CSubsumptionClassifierThread* rescheduleOntologyClassification(CConcreteOntology *ontology); virtual CSubsumptionClassifierThread* addOntologyClassifiedCallback(CConcreteOntology *ontology, CCallbackData *callback); virtual CSubsumptionClassifierThread* addOntologyClassifyRequirements(CConcreteOntology *ontology, const QList& requirementList); virtual bool createNextSubsumtionTest() = 0; virtual CSubsumptionClassifierThread* processCalculationJob(CSatisfiableCalculationJob* job, COntologyClassificationItem *ontClassItem, CCallbackData* callback, bool directlySubmit = true); virtual CSubsumptionClassifierThread* submitCalculationJobs(); virtual bool interpreteTestResults(CTestCalculatedCallbackEvent *testResult) = 0; virtual bool startProcessMoreTests(); virtual bool canProcessMoreTests(); virtual bool doNextPendingTests(); virtual bool processToldClassificationMessage(COntologyClassificationItem *ontClassItem, CClassificationMessageData* messageData, CMemoryPool* memoryPools); // protected variables protected: qint64 confMaxTestParallelCount; qint64 confMinTestParallelCount; qint64 currRunningTestParallelCount; QList ontItemList; QList processingOntItemList; QHash ontItemHash; cint64 mClassificationCount; CReasonerManager* reasoner; CCalculationManager* calculationManager; QList< QPair > mJobCallbackList; CClassifierStatistics* statistics; cint64 mStatCalculatingJobs; CClassSubsumptionClassifierContext mContext; bool mClassifierActive; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CSUBSUMPTIONCLASSIFIERTHREAD_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedSubClassOntologyClassificationItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedSubClassOntologyClassificationIt0000644000175000017500000001153512520550762032473 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDSUBCLASSONTOLOGYCLASSIFICATIONITEM_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDSUBCLASSONTOLOGYCLASSIFICATIONITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "COntologyClassificationItem.h" #include "COptimizedSubClassSatisfiableTestingItem.h" // Other includes #include "Reasoner/Ontology/CConceptReferenceLinking.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class COptimizedSubClassOntologyClassificationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedSubClassOntologyClassificationItem : public COntologyClassificationItem { // public methods public: //! Constructor COptimizedSubClassOntologyClassificationItem(CConfigurationBase *configuration, CClassifierStatistics *nextClassificationStatistics = 0); //! Destructor virtual ~COptimizedSubClassOntologyClassificationItem(); QHash* getConceptSatisfiableTestItemHash(); QList* getConceptSatisfiableTestItemContainer(); COptimizedSubClassSatisfiableTestingItem* getTopConceptSatisfiableTestItem(); COptimizedSubClassSatisfiableTestingItem* getBottomConceptSatisfiableTestItem(); QList* getNextSatisfiableTestingItemList(); QSet* getNextCandidateSatisfiableTestingItemSet(); QSet* getRemainingCandidateSatisfiableTestingItemSet(); COptimizedSubClassOntologyClassificationItem* initTopBottomSatisfiableTestingItems(COptimizedSubClassSatisfiableTestingItem* topItem, COptimizedSubClassSatisfiableTestingItem* bottomItem); COptimizedSubClassSatisfiableTestingItem* getConceptSatisfiableTestItem(CConcept* satTestConcept, bool create = false); cint64 getRemainingSatisfiableTestsCount(); cint64 getRunningSatisfiableTestsCount(); COptimizedSubClassOntologyClassificationItem* incRemainingSatisfiableTestsCount(cint64 incCount = 1); COptimizedSubClassOntologyClassificationItem* incRunningSatisfiableTestsCount(cint64 incCount = 1); COptimizedSubClassOntologyClassificationItem* decRemainingSatisfiableTestsCount(cint64 decCount = 1); COptimizedSubClassOntologyClassificationItem* decRunningSatisfiableTestsCount(cint64 decCount = 1); bool hasAllSatisfiableTestsCompleted(); bool hasRemainingSatisfiableTests(); QList* getSatisfiableConceptItemList(); COptimizedSubClassOntologyClassificationItem* addSatisfiableConceptItem(COptimizedSubClassSatisfiableTestingItem* item); QHash* getConceptReferenceLinkingDataHash(); // protected methods protected: // protected variables protected: QHash mConceptSatItemHash; QList mSatTestItemContainer; COptimizedSubClassSatisfiableTestingItem* mTopSatTestItem; COptimizedSubClassSatisfiableTestingItem* mBottomSatTestItem; QList mNextItemList; QSet mNextCandItemSet; QSet mRemainingCandItemSet; QHash mConceptRefLinkData; cint64 mRemainingSatTests; cint64 mRunningSatTests; QList mSatisfiableItemList; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDSUBCLASSONTOLOGYCLASSIFICATIONITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CPartialPruningTaxonomy.h0000644000175000017500000000631712520550762027111 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CPARTIALPRUNINGTAXONOMY_H #define KONCLUDE_REASONER_CLASSIFIER_CPARTIALPRUNINGTAXONOMY_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CPartialPruningHierarchyNode.h" #include "CClassifierStatistics.h" // Other includes #include "Reasoner/Taxonomy/CTaxonomy.h" #include "Config/CConfigDataReader.h" #include "Config/CConfigurationBase.h" #include "KoncludeSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Taxonomy; namespace Classifier { #ifndef KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED //#define DEBUGTESTTAXONOMYCONSITENCE #endif /*! * * \class CPartialPruningTaxonomy * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPartialPruningTaxonomy : public CTaxonomy { // public methods public: //! Constructor CPartialPruningTaxonomy(CConcept *topConcept, CConcept *bottomConcept); //! Destructor virtual ~CPartialPruningTaxonomy(); virtual CPartialPruningTaxonomy *readConfig(CConfigurationBase *config); virtual CTaxonomy *setConceptSatisfiable(CConcept *concept, bool satisfiable); virtual CTaxonomy *setConceptSubsumption(CConcept *subsumerConcept, CConcept *subsumedConcept); virtual CTaxonomy *setConceptNotSubsumption(CConcept *notSubsumerConcept, CConcept *notSubsumedConcept); virtual CTaxonomy *setConceptDisjoints(CConcept *disjointConcept1, CConcept *disjointConcept2); virtual CPartialPruningTaxonomy *createStatistics(CClassifierStatistics *nextClassificationStatistics); void testSubsumptionStatistics(qint64 subsumCount); virtual CTaxonomy *completeUnknownAsNonSubsumptions(); // protected methods protected: virtual CHierarchyNode *createHierarchyNode(CConcept *concept); void testTaxonomyConsistence(); // protected variables protected: CClassifierStatistics *statistics; bool confDerivateRelations; bool confPruneRelations; #ifdef DEBUGTESTTAXONOMYCONSITENCE QString taxString; #endif CClassifierStatistics *testCompStatistics; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CPARTIALPRUNINGTAXONOMY_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationInitializePossibleSubsumptionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationInitializePossibleSubsumpti0000644000175000017500000000441412520550746032555 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONINITIALIZEPOSSIBLESUBSUMPTIONDATA_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONINITIALIZEPOSSIBLESUBSUMPTIONDATA_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CClassificationInitializePossibleSubsumptionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationInitializePossibleSubsumptionData { // public methods public: //! Constructor CClassificationInitializePossibleSubsumptionData(); CClassificationInitializePossibleSubsumptionData* initClassificationPossibleSubsumptionData(CConcept* possSubsumerConcept); CConcept* getPossibleSubsumerConcept(); bool isPossibleSubsumerValid(); CClassificationInitializePossibleSubsumptionData* setPossibleSubsumerInvalid(); // protected methods protected: // protected variables protected: CConcept* mPossSubsumedConcept; bool mValid; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONINITIALIZEPOSSIBLESUBSUMPTIONDATA_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CIncrementalKPSetClassSubsumptionClassifierThread.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CIncrementalKPSetClassSubsumptionClassifie0000644000175000017500000000577112520550754032423 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CINCREMENTALKPSETCLASSSUBSUMPTIONCLASSIFIERTHREAD_H #define KONCLUDE_REASONER_CLASSIFIER_CINCREMENTALKPSETCLASSSUBSUMPTIONCLASSIFIERTHREAD_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "COptimizedKPSetClassSubsumptionClassifierThread.h" #include "CIncrementalKPSetClassOntologyClassificationItem.h" #include "COptimizedSubClassOntologyClassificationItem.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { namespace Reasoner { namespace Classifier { /*! * * \class CIncrementalKPSetClassSubsumptionClassifierThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIncrementalKPSetClassSubsumptionClassifierThread : public COptimizedKPSetClassSubsumptionClassifierThread { // public methods public: //! Constructor CIncrementalKPSetClassSubsumptionClassifierThread(CReasonerManager *reasonerManager); //! Destructor virtual ~CIncrementalKPSetClassSubsumptionClassifierThread(); // protected methods protected: virtual void readCalculationConfig(CCalculationConfigurationExtension *config); virtual CSubsumptionClassifierThread* scheduleOntologyClassification(CConcreteOntology *ontology, CTaxonomy *taxonomy, CClassificationCalculationSupport *classificationSupport, CConfigurationBase *config); virtual COptimizedKPSetClassOntologyClassificationItem* createOntologyClassificationItem(CConcreteOntology *ontology, CConfigurationBase *config); virtual bool addClassificationStatistics(COntologyClassificationItem *ontClassItem, CClassConceptClassification* classConClassification); bool tryReusePreviousClassesCalculations(CIncrementalKPSetClassOntologyClassificationItem *ontClassItem, CClassConceptClassification* prevClassConClassification); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CINCREMENTALKPSETCLASSSUBSUMPTIONCLASSIFIERTHREAD_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRoleOntologyClassificationItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRoleOntologyClassificationI0000644000175000017500000002054312520550760032375 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETROLEONTOLOGYCLASSIFICATIONITEM_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETROLEONTOLOGYCLASSIFICATIONITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "COntologyClassificationItem.h" #include "COptimizedKPSetRoleTestingItem.h" // Other includes #include "Reasoner/Ontology/CConceptReferenceLinking.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class COptimizedKPSetRoleOntologyClassificationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetRoleOntologyClassificationItem : public COntologyClassificationItem { // public methods public: //! Constructor COptimizedKPSetRoleOntologyClassificationItem(CConfigurationBase *configuration, CClassifierStatistics *nextClassificationStatistics = 0); //! Destructor virtual ~COptimizedKPSetRoleOntologyClassificationItem(); QHash* getConceptSatisfiableTestItemHash(); QList* getConceptSatisfiableTestItemContainer(); COptimizedKPSetRoleTestingItem* getTopConceptSatisfiableTestItem(); COptimizedKPSetRoleTestingItem* getBottomConceptSatisfiableTestItem(); QList* getNextSatisfiableTestingItemList(); QSet* getNextCandidateSatisfiableTestingItemSet(); QSet* getRemainingCandidateSatisfiableTestingItemSet(); QList* getNextPossibleSubsumptionTestingItemList(); QSet* getCurrentPossibleSubsumptionTestingItemSet(); COptimizedKPSetRoleOntologyClassificationItem* initTopBottomSatisfiableTestingItems(COptimizedKPSetRoleTestingItem* topItem, COptimizedKPSetRoleTestingItem* bottomItem); COptimizedKPSetRoleTestingItem* getConceptSatisfiableTestItem(CConcept* satTestConcept, bool create = false); cint64 getRemainingSatisfiableTestsCount(); cint64 getRunningSatisfiableTestsCount(); COptimizedKPSetRoleOntologyClassificationItem* incRemainingSatisfiableTestsCount(cint64 incCount = 1); COptimizedKPSetRoleOntologyClassificationItem* incRunningSatisfiableTestsCount(cint64 incCount = 1); COptimizedKPSetRoleOntologyClassificationItem* decRemainingSatisfiableTestsCount(cint64 decCount = 1); COptimizedKPSetRoleOntologyClassificationItem* decRunningSatisfiableTestsCount(cint64 decCount = 1); bool hasAllSatisfiableTestsCompleted(); bool hasRemainingSatisfiableTests(); QList* getSatisfiableConceptItemList(); COptimizedKPSetRoleOntologyClassificationItem* addSatisfiableConceptItem(COptimizedKPSetRoleTestingItem* item); QHash* getConceptReferenceLinkingDataHash(); bool hasSatisfiableTestingPhaseFinished(); bool hasPossibleSubsumptionTestingPhaseFinished(); COptimizedKPSetRoleOntologyClassificationItem* setSatisfiableTestingPhaseFinished(bool finished); COptimizedKPSetRoleOntologyClassificationItem* setPossibleSubsumptionTestingPhaseFinished(bool finished); cint64 hasRemainingPossibleSubsumptionTests(); cint64 getRemainingPossibleSubsumptionTestsCount(); COptimizedKPSetRoleOntologyClassificationItem* setRemainingPossibleSubsumptionTestsCount(cint64 testCount); COptimizedKPSetRoleOntologyClassificationItem* incRemainingPossibleSubsumptionTestsCount(cint64 incCount = 1); COptimizedKPSetRoleOntologyClassificationItem* decRemainingPossibleSubsumptionTestsCount(cint64 decCount = 1); COptimizedKPSetRoleOntologyClassificationItem* incRunningPossibleSubsumptionTestsCount(cint64 incCount = 1); COptimizedKPSetRoleOntologyClassificationItem* decRunningPossibleSubsumptionTestsCount(cint64 decCount = 1); QSet* getRemainingPossibleSubsumptionTestingSet(); cint64 getRemainingPossibleSubsumptionTestingCount(); COptimizedKPSetRoleOntologyClassificationItem* addMemoryPools(CMemoryPool* memoryPools); CMemoryPool* takeMemoryPools(); cint64 getCalculatedPossibleSubsumerCount(); cint64 getCalculatedTruePossibleSubsumerCount(); cint64 getCalculatedFalsePossibleSubsumerCount(); COptimizedKPSetRoleOntologyClassificationItem* setCalculatedPossibleSubsumerCount(cint64 subsumCount); COptimizedKPSetRoleOntologyClassificationItem* setCalculatedTruePossibleSubsumerCount(cint64 subsumCount); COptimizedKPSetRoleOntologyClassificationItem* setCalculatedFalsePossibleSubsumerCount(cint64 subsumCount); COptimizedKPSetRoleOntologyClassificationItem* incCalculatedPossibleSubsumerCount(cint64 incSubsumCount = 1); COptimizedKPSetRoleOntologyClassificationItem* incCalculatedTruePossibleSubsumerCount(cint64 incSubsumCount = 1); COptimizedKPSetRoleOntologyClassificationItem* incCalculatedFalsePossibleSubsumerCount(cint64 incSubsumCount = 1); cint64 getPossibleSubsumerCount(); cint64 getTruePossibleSubsumerCount(); cint64 getFalsePossibleSubsumerCount(); COptimizedKPSetRoleOntologyClassificationItem* setPossibleSubsumerCount(cint64 subsumCount); COptimizedKPSetRoleOntologyClassificationItem* setTruePossibleSubsumerCount(cint64 subsumCount); COptimizedKPSetRoleOntologyClassificationItem* setFalsePossibleSubsumerCount(cint64 subsumCount); COptimizedKPSetRoleOntologyClassificationItem* incPossibleSubsumerCount(cint64 incSubsumCount = 1); COptimizedKPSetRoleOntologyClassificationItem* incTruePossibleSubsumerCount(cint64 incSubsumCount = 1); COptimizedKPSetRoleOntologyClassificationItem* incFalsePossibleSubsumerCount(cint64 incSubsumCount = 1); // protected methods protected: // protected variables protected: QHash mConceptSatItemHash; QList mSatTestItemContainer; COptimizedKPSetRoleTestingItem* mTopSatTestItem; COptimizedKPSetRoleTestingItem* mBottomSatTestItem; QList mNextItemList; QSet mNextCandItemSet; QSet mRemainingCandItemSet; QList mNextPossSubsumItemList; QSet mCurrentPossSubsumItemSet; QHash mConceptRefLinkData; cint64 mRemainingSatTests; cint64 mRunningSatTests; bool mSatisfiableTestingPhaseFinished; bool mPossibleSubsumptionTestingPhaseFinished; cint64 mRemainingPossibleSubsumptionTests; cint64 mRunningPossibleSubsumptionTests; cint64 mCalculatedPossibleSubsumCount; cint64 mCalculatedTruePossibleSubsumCount; cint64 mCalculatedFalsePossibleSubsumCount; cint64 mPossibleSubsumCount; cint64 mTruePossibleSubsumCount; cint64 mFalsePossibleSubsumCount; QSet mRemPossClassTestingSet; QList mSatisfiableItemList; CMemoryPoolContainer mMemoryPoolContainer; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETROLEONTOLOGYCLASSIFICATIONITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CConceptSubsumerObserver.h0000644000175000017500000000405112520550754027236 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCONCEPTSUBSUMEROBSERVER_H #define KONCLUDE_REASONER_CLASSIFIER_CCONCEPTSUBSUMEROBSERVER_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CConceptSubsumerObserver * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptSubsumerObserver { // public methods public: //! Constructor CConceptSubsumerObserver(); //! Destructor virtual ~CConceptSubsumerObserver(); virtual CConceptSubsumerObserver* tellConceptSupsumption(CConcept* subsumedConcept, CConcept* subsumerConcept) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCONCEPTSUBSUMEROBSERVER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassifierStatistics.cpp0000644000175000017500000002344212520550752027102 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassifierStatistics.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassifierStatistics::CClassifierStatistics(CClassifierStatistics *nextClassificationStatistics) { resetValues(); nextClassifStat = nextClassificationStatistics; } qint64 CClassifierStatistics::getPseudoModelMergedTestedSubsumptionCount() { return pseudoModelSubsumTests; } qint64 CClassifierStatistics::getSubclassTestedSubsumptionCount() { return subclassSubsumTests; } qint64 CClassifierStatistics::getSubclassIdentifierOccurTestedSubsumptionCount() { return subclassIdOccSubsumTests; } qint64 CClassifierStatistics::getDerivatedTestedSubsumptionCount() { return derivatedSubsumTests; } qint64 CClassifierStatistics::getCalculatedTestedSubsumptionCount() { return calculatedSubsumTests; } qint64 CClassifierStatistics::getPrunedTestedSubsumptionCount() { return prunedSubsumTests; } qint64 CClassifierStatistics::getToldSubsumptionCount() { return toldSubsumTests; } qint64 CClassifierStatistics::getTestedSubsumptionCount() { return getToldSubsumptionCount()+getPrunedTestedSubsumptionCount()+getDerivatedTestedSubsumptionCount()+getPseudoModelMergedTestedSubsumptionCount()+getSubclassTestedSubsumptionCount()+getSubclassIdentifierOccurTestedSubsumptionCount(); } qint64 CClassifierStatistics::getPseudoModelMergedTestedSatisfiableCount() { return pseudoModelSatisTests; } qint64 CClassifierStatistics::getDerivatedTestedSatisfiableCount() { return derivatedSatisTests; } qint64 CClassifierStatistics::getCalculatedTestedSatisfiableCount() { return calculatedSatisTests; } qint64 CClassifierStatistics::getPrunedTestedSatisfiableCount() { return prunedSatisTests; } qint64 CClassifierStatistics::getTestedSatisfiableCount() { return getToldSatisfiableCount()+getPrunedTestedSatisfiableCount()+getDerivatedTestedSatisfiableCount()+getPseudoModelMergedTestedSatisfiableCount(); } qint64 CClassifierStatistics::getTotalSubsumptionTestCount() { return totalSubsumTests; } qint64 CClassifierStatistics::getTotalSatisfiableCount() { return totalSatisTests; } qint64 CClassifierStatistics::getToldSatisfiableCount() { return toldSatisTests; } qint64 CClassifierStatistics::getPseudoModelMergedTestedDisjointCount() { return pseudoModelDisjointTests; } qint64 CClassifierStatistics::getToldDisjointCount() { return toldDisjointTests; } qint64 CClassifierStatistics::getCalculatedTestedDisjointCount() { return calculatedDisjointTests; } CClassifierStatistics *CClassifierStatistics::incPseudoModelMergedTestedSubsumptionCount(qint64 incCount) { pseudoModelSubsumTests += incCount; if (nextClassifStat) { nextClassifStat->incPseudoModelMergedTestedSubsumptionCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incSubclassTestedSubsumptionCount(qint64 incCount) { subclassSubsumTests += incCount; if (nextClassifStat) { nextClassifStat->incSubclassTestedSubsumptionCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incDerivatedTestedSubsumptionCount(qint64 incCount) { derivatedSubsumTests += incCount; if (nextClassifStat) { nextClassifStat->incDerivatedTestedSubsumptionCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incCalculatedTestedSubsumptionCount(qint64 incCount) { calculatedSubsumTests += incCount; if (nextClassifStat) { nextClassifStat->incCalculatedTestedSubsumptionCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incPrunedTestedSubsumptionCount(qint64 incCount) { prunedSubsumTests += incCount; if (nextClassifStat) { nextClassifStat->incPrunedTestedSubsumptionCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incToldSubsumptionCount(qint64 incCount) { toldSubsumTests += incCount; if (nextClassifStat) { nextClassifStat->incToldSubsumptionCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incPseudoModelMergedTestedSatisfiableCount(qint64 incCount) { pseudoModelSatisTests += incCount; if (nextClassifStat) { nextClassifStat->incPseudoModelMergedTestedSatisfiableCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incDerivatedTestedSatisfiableCount(qint64 incCount) { derivatedSatisTests += incCount; if (nextClassifStat) { nextClassifStat->incDerivatedTestedSatisfiableCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incCalculatedTestedSatisfiableCount(qint64 incCount) { calculatedSatisTests += incCount; if (nextClassifStat) { nextClassifStat->incCalculatedTestedSatisfiableCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incPrunedTestedSatisfiableCount(qint64 incCount) { prunedSatisTests += incCount; if (nextClassifStat) { nextClassifStat->incPrunedTestedSatisfiableCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incTotalSubsumptionTestCount(qint64 incCount) { totalSubsumTests += incCount; if (nextClassifStat) { nextClassifStat->incTotalSubsumptionTestCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incTotalSatisfiableTestCount(qint64 incCount) { totalSatisTests += incCount; if (nextClassifStat) { nextClassifStat->incTotalSatisfiableTestCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incToldSatisfiableCount(qint64 incCount) { toldSatisTests += incCount; if (nextClassifStat) { nextClassifStat->incToldSatisfiableCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incPseudoModelMergedTestedDisjointCount(qint64 incCount) { pseudoModelDisjointTests += incCount; if (nextClassifStat) { nextClassifStat->incPseudoModelMergedTestedDisjointCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incToldDisjointCount(qint64 incCount) { toldDisjointTests += incCount; if (nextClassifStat) { nextClassifStat->incToldDisjointCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incCalculatedTestedDisjointCount(qint64 incCount) { calculatedDisjointTests += incCount; if (nextClassifStat) { nextClassifStat->incCalculatedTestedDisjointCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::incSubclassIdentifierOccurTestedSubsumptionCount(qint64 incCount) { subclassIdOccSubsumTests += incCount; if (nextClassifStat) { nextClassifStat->incSubclassIdentifierOccurTestedSubsumptionCount(incCount); } return this; } CClassifierStatistics *CClassifierStatistics::resetValues() { pseudoModelSubsumTests = 0; subclassSubsumTests = 0; derivatedSubsumTests = 0; calculatedSubsumTests = 0; prunedSubsumTests = 0; pseudoModelSatisTests = 0; derivatedSatisTests = 0; calculatedSatisTests = 0; prunedSatisTests = 0; totalSubsumTests = 0; totalSatisTests = 0; toldSubsumTests = 0; toldSatisTests = 0; pseudoModelDisjointTests = 0; toldDisjointTests = 0; calculatedDisjointTests = 0; subclassIdOccSubsumTests = 0; return this; } CClassifierStatistics *CClassifierStatistics::appendStatistics(CClassifierStatistics *statistics) { pseudoModelSubsumTests += statistics->getPseudoModelMergedTestedSubsumptionCount(); subclassSubsumTests += statistics->getSubclassTestedSubsumptionCount(); derivatedSubsumTests += statistics->getDerivatedTestedSubsumptionCount(); calculatedSubsumTests += statistics->getCalculatedTestedSubsumptionCount(); prunedSubsumTests += statistics->getPrunedTestedSubsumptionCount(); pseudoModelSatisTests += statistics->getPseudoModelMergedTestedSatisfiableCount(); derivatedSatisTests += statistics->getDerivatedTestedSatisfiableCount(); calculatedSatisTests += statistics->getCalculatedTestedSatisfiableCount(); prunedSatisTests += statistics->getPrunedTestedSatisfiableCount(); totalSubsumTests += statistics->getTotalSubsumptionTestCount(); totalSatisTests += statistics->getTotalSatisfiableCount(); toldSubsumTests += statistics->getToldSubsumptionCount(); toldSatisTests += statistics->getToldSatisfiableCount(); pseudoModelDisjointTests += statistics->getPseudoModelMergedTestedDisjointCount(); toldDisjointTests += statistics->getToldDisjointCount(); calculatedDisjointTests += statistics->getCalculatedTestedDisjointCount(); subclassIdOccSubsumTests += statistics->getSubclassIdentifierOccurTestedSubsumptionCount(); return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CSubsumptionClassifierFactory.h0000644000175000017500000000433112520550764030274 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CSUBSUMPTIONCLASSIFIERFACTORY_H #define KONCLUDE_REASONER_CLASSIFIER_CSUBSUMPTIONCLASSIFIERFACTORY_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CSubsumptionClassifier.h" // Other includes #include "Config/CConfigurationBase.h" #include "Reasoner/Ontology/COntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CSubsumptionClassifierFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSubsumptionClassifierFactory { // public methods public: //! Constructor CSubsumptionClassifierFactory(); //! Destructor virtual ~CSubsumptionClassifierFactory(); virtual CSubsumptionClassifier *createClassifier(CConcreteOntology *ontology, CConfigurationBase *config) = 0; virtual CSubsumptionClassifier *createBackgroundClassifier(CConcreteOntology *ontology, CConfigurationBase *config) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CSUBSUMPTIONCLASSIFIERFACTORY_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CIncrementalKPSetClassOntologyClassificationItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CIncrementalKPSetClassOntologyClassificati0000644000175000017500000000633412520550754032375 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CINCREMENTALKPSETCLASSONTOLOGYCLASSIFICATIONITEM_H #define KONCLUDE_REASONER_CLASSIFIER_CINCREMENTALKPSETCLASSONTOLOGYCLASSIFICATIONITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "COptimizedKPSetClassOntologyClassificationItem.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Classifier { /*! * * \class CIncrementalKPSetClassOntologyClassificationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIncrementalKPSetClassOntologyClassificationItem : public COptimizedKPSetClassOntologyClassificationItem { // public methods public: //! Constructor CIncrementalKPSetClassOntologyClassificationItem(CConfigurationBase *configuration, CClassifierStatistics *nextClassificationStatistics = 0); //! Destructor virtual ~CIncrementalKPSetClassOntologyClassificationItem(); CIncrementalKPSetClassOntologyClassificationItem* setPreviousHierarchyReused(bool reused); bool isPreviousHierarchyReused(); CClassConceptClassification* getPreviousReusedClassClassification(); CClassConceptClassification* setPreviousReusedClassClassification(CClassConceptClassification* reusedClassClassification); cint64 getPreviousReusedClassCalculationCount(); cint64 getNewInitializedClassCalculationCount(); CIncrementalKPSetClassOntologyClassificationItem* setPreviousReusedClassCalculationCount(cint64 count); CIncrementalKPSetClassOntologyClassificationItem* incPreviousReusedClassCalculationCount(cint64 incCount = 1); CIncrementalKPSetClassOntologyClassificationItem* setNewInitializedClassCalculationCount(cint64 count); CIncrementalKPSetClassOntologyClassificationItem* incNewInitializedClassCalculationCount(cint64 incCount = 1); // protected methods protected: // protected variables protected: bool mPreviousHierarchyReused; CClassConceptClassification* mReusedClassConClassification; cint64 mPreviousReusedClassCalculationCount; cint64 mNewInitializedClassCalculationCount; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CINCREMENTALKPSETCLASSONTOLOGYCLASSIFICATIONITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodeBlockedClassificationItem.cpp0000644000175000017500000000222612520550754030606 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNodeBlockedClassificationItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { CNodeBlockedClassificationItem::CNodeBlockedClassificationItem() { } CNodeBlockedClassificationItem::~CNodeBlockedClassificationItem() { } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelRoleData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelRoleData.cp0000644000175000017500000000600712520550746032262 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationClassPseudoModelRoleData.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationClassPseudoModelRoleData::CClassificationClassPseudoModelRoleData() { mLowerAtLeast = 0; mUpperAtLeast = 0; mLowerAtMost = 0; mUpperAtMost = 0; mSuccessorModel = 0; } cint64 CClassificationClassPseudoModelRoleData::getLowerAtLeastBound() { return mLowerAtLeast; } cint64 CClassificationClassPseudoModelRoleData::getUpperAtLeastBound() { return mUpperAtLeast; } cint64 CClassificationClassPseudoModelRoleData::getLowerAtMostBound() { return mLowerAtMost; } cint64 CClassificationClassPseudoModelRoleData::getUpperAtMostBound() { return mUpperAtMost; } bool CClassificationClassPseudoModelRoleData::setLowerAtLeastBound(cint64 bound) { bool diff = mLowerAtLeast != bound; mLowerAtLeast = bound; return diff; } bool CClassificationClassPseudoModelRoleData::setUpperAtLeastBound(cint64 bound) { bool diff = mUpperAtLeast != bound; mUpperAtLeast = bound; return diff; } bool CClassificationClassPseudoModelRoleData::setLowerAtMostBound(cint64 bound) { bool diff = mLowerAtMost != bound; mLowerAtMost = bound; return diff; } bool CClassificationClassPseudoModelRoleData::setUpperAtMostBound(cint64 bound) { bool diff = mUpperAtMost != bound; mUpperAtMost = bound; return diff; } cint64 CClassificationClassPseudoModelRoleData::getSuccessorModelID() const { return mSuccessorModel; } bool CClassificationClassPseudoModelRoleData::setSuccessorModelID(cint64 modelID) { bool diff = mSuccessorModel != modelID; mSuccessorModel = modelID; return diff; } bool CClassificationClassPseudoModelRoleData::isPossibleSubsumerOf(const CClassificationClassPseudoModelRoleData& possibleSubsumedData) const { if (mDeterministicFlag) { if (mLowerAtLeast > possibleSubsumedData.mUpperAtLeast) { return false; } if (mUpperAtMost < possibleSubsumedData.mLowerAtMost) { return false; } return true; } else { return true; } } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationSatisfiableCalculationData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationSatisfiableCalculationData.0000644000175000017500000000710412520550750032306 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationSatisfiableCalculationData.h" #include "Reasoner/Kernel/Task/CSatisfiableCalculationTask.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationSatisfiableCalculationData::CClassificationSatisfiableCalculationData() { mSatCalcedTask = nullptr; mSatCalcedJob = nullptr; mPrevData = nullptr; mDependendCalculationCount = 0; } bool CClassificationSatisfiableCalculationData::hasSatisfiableCalculationTask() { return mSatCalcedTask != nullptr; } CSatisfiableCalculationTask* CClassificationSatisfiableCalculationData::getSatisfiableCalculationTask() { return mSatCalcedTask; } CClassificationSatisfiableCalculationData* CClassificationSatisfiableCalculationData::setSatisfiableCalculationTask(CSatisfiableCalculationTask* task) { mSatCalcedTask = task; mSatCalcedJob = mSatCalcedTask; return this; } bool CClassificationSatisfiableCalculationData::hasSatisfiableCalculationJobInstantiation() { return mSatCalcedJob != nullptr; } bool CClassificationSatisfiableCalculationData::clearSatisfiableCalculationJobInstantiation() { bool cleared = false; if (mSatCalcedTask) { CNewAllocationMemoryPoolProvider tmpProv; tmpProv.releaseMemoryPool(mSatCalcedTask->getMemoryPools()); mSatCalcedTask = nullptr; mSatCalcedJob = nullptr; cleared = true; } return cleared; } CSatisfiableCalculationJobInstantiation* CClassificationSatisfiableCalculationData::getSatisfiableCalculationJobInstantiation() { return mSatCalcedJob; } CTaskPreyingListner* CClassificationSatisfiableCalculationData::tellPreyedSatisfialbeTask(CSatisfiableCalculationTask* task) { task->getTaskStatus()->setMemoryReleaseable(false); setSatisfiableCalculationTask(task); return this; } CClassificationSatisfiableCalculationData* CClassificationSatisfiableCalculationData::getPreviousCalculationData() { return mPrevData; } CClassificationSatisfiableCalculationData* CClassificationSatisfiableCalculationData::setPreviousCalculationData(CClassificationSatisfiableCalculationData* data) { mPrevData = data; return this; } cint64 CClassificationSatisfiableCalculationData::getDependendCalculationCount() { return mDependendCalculationCount; } CClassificationSatisfiableCalculationData* CClassificationSatisfiableCalculationData::incDependendCalculationCount(cint64 incCount) { mDependendCalculationCount += incCount; return this; } bool CClassificationSatisfiableCalculationData::decDependendCalculationCount(cint64 decCount) { mDependendCalculationCount -= decCount; return mDependendCalculationCount <= 0; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedClassExtractedSaturationOntologyClassificationItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedClassExtractedSaturationOntology0000644000175000017500000000625412520550756032573 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedClassExtractedSaturationOntologyClassificationItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedClassExtractedSaturationOntologyClassificationItem::COptimizedClassExtractedSaturationOntologyClassificationItem(CConfigurationBase *configuration, CClassifierStatistics *nextClassificationStatistics) : COntologyClassificationItem(configuration,nextClassificationStatistics) { mTopSatTestItem = nullptr; mBottomSatTestItem = nullptr; } QHash* COptimizedClassExtractedSaturationOntologyClassificationItem::getClassSatisfiableTestItemHash() { return &mClassSatItemHash; } QList* COptimizedClassExtractedSaturationOntologyClassificationItem::getClassSatisfiableTestItemList() { return &mClassSatTestItemContainer; } COptimizedClassExtractedSaturationSatisfiableTestingItem* COptimizedClassExtractedSaturationOntologyClassificationItem::getTopConceptSatisfiableTestItem() { return mTopSatTestItem; } COptimizedClassExtractedSaturationSatisfiableTestingItem* COptimizedClassExtractedSaturationOntologyClassificationItem::getBottomConceptSatisfiableTestItem() { return mBottomSatTestItem; } COptimizedClassExtractedSaturationOntologyClassificationItem* COptimizedClassExtractedSaturationOntologyClassificationItem::initTopBottomSatisfiableTestingItems(COptimizedClassExtractedSaturationSatisfiableTestingItem* topItem, COptimizedClassExtractedSaturationSatisfiableTestingItem* bottomItem) { mTopSatTestItem = topItem; mBottomSatTestItem = bottomItem; return this; } COptimizedClassExtractedSaturationSatisfiableTestingItem* COptimizedClassExtractedSaturationOntologyClassificationItem::getClassSatisfiableTestItem(CConcept* satTestConcept, bool create) { COptimizedClassExtractedSaturationSatisfiableTestingItem* item = nullptr; item = mClassSatItemHash.value(satTestConcept); if (!item && create) { item = new COptimizedClassExtractedSaturationSatisfiableTestingItem(); item->initSatisfiableTestingItem(satTestConcept); mClassSatItemHash.insert(satTestConcept,item); mClassSatTestItemContainer.append(item); } return item; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassIdentifierData.cpp0000644000175000017500000000215012405707542031375 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetClassPossibleSubsumptionData.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedKPSetClassPossibleSubsumptionData::COptimizedKPSetClassPossibleSubsumptionData() { } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CConceptSatisfiableObserver.cpp0000644000175000017500000000270512520550752030214 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptSatisfiableObserver.h" namespace Konclude { namespace Reasoner { namespace Classifier { CConceptSatisfiableObserver::CConceptSatisfiableObserver() { } CConceptSatisfiableObserver::~CConceptSatisfiableObserver() { } CConceptSatisfiableObserver *CConceptSatisfiableObserver::tellConceptSatisfiable(CConcreteOntology *ontology, CConcept *satisfiableConcept, bool isSatisfiable) { return tellConceptSatisfiable(ontology,QList()<. * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSSUBSUMPTIONCLASSIFIERTHREAD_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSSUBSUMPTIONCLASSIFIERTHREAD_H // Libraries includes #include // Namespace includes #include "ClassifierSettings.h" #include "CSubsumptionClassifier.h" #include "CSubsumptionClassifierThread.h" #include "CPartialPruningTaxonomy.h" #include "CClassificationWorkItem.h" #include "COptimizedKPSetClassOntologyClassificationItem.h" #include "CClassificationPseudoModelIdentifierMessageData.h" #include "COptimizedKPSetClassPossibleSubsumptionData.h" #include "COptimizedKPSetClassTestingItem.h" #include "CClassificationSubsumptionMessageData.h" #include "CClassificationInitializePossibleSubsumptionMessageData.h" #include "CClassificationUpdatePossibleSubsumptionMessageData.h" #include "CPrecomputedSaturationSubsumerExtractor.h" // Other includes #include "Context/CContextBase.h" #include "Reasoner/Revision/COntologyRevision.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h" #include "Reasoner/Consistiser/CSaturationConceptReferenceLinking.h" #include "Reasoner/Generator/CSatisfiableCalculationJobGenerator.h" #include "Utilities/Memory/CTempMemoryPoolContainerAllocationManager.h" #include "Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCache.h" #include "Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheReader.h" #include "KoncludeSettings.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include using namespace std; namespace Konclude { using namespace Context; using namespace Utilities::Memory; namespace Reasoner { using namespace Revision; using namespace Ontology; using namespace Generator; using namespace Kernel; using namespace Cache; using namespace Task; using namespace Consistiser; namespace Classifier { #ifndef KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED //#define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCOUTOUTPUT //#define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGTAXONOMYCOUTOUTPUT //#define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGLOGOUTPUT //#define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGBOXDESCRIPTION #define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGSTATUSDESCRIPTION #endif /*! * * \class COptimizedKPSetClassSubsumptionClassifierThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetClassSubsumptionClassifierThread : public CSubsumptionClassifierThread, public CLogIdentifier { // public methods public: //! Constructor COptimizedKPSetClassSubsumptionClassifierThread(CReasonerManager *reasonerManager); //! Destructor virtual ~COptimizedKPSetClassSubsumptionClassifierThread(); virtual QString getStatusString(); virtual CClassificationProgress* getClassificationProgress(); // protected methods protected: virtual bool addClassificationStatistics(COntologyClassificationItem *ontClassItem, CClassConceptClassification* classConClassification); COptimizedKPSetClassSubsumptionClassifierThread* addIndividualDependencyTrackingStatistics(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, const QString& classificationTypeString = "class-classification"); virtual bool finishOntologyClassification(COntologyClassificationItem *ontClassItem); virtual CSubsumptionClassifierThread* scheduleOntologyClassification(CConcreteOntology *ontology, CTaxonomy *taxonomy, CClassificationCalculationSupport *classificationSupport, CConfigurationBase *config); virtual COptimizedKPSetClassOntologyClassificationItem* createOntologyClassificationItem(CConcreteOntology *ontology, CConfigurationBase *config); virtual CSubsumptionClassifierThread *processCalculationJob(CSatisfiableCalculationJob* job, COntologyClassificationItem *ontClassItem, CClassificationWorkItem* workItem); virtual void readCalculationConfig(CCalculationConfigurationExtension *config); virtual bool interpreteSubsumptionResult(COntologyClassificationItem *ontClassItem, CConcept *subsumerConcept, CConcept *subsumedConcept, bool isSubsumption); virtual bool interpreteSatisfiableResult(COntologyClassificationItem *ontClassItem, CConcept *satisfiableConcept, bool isSatis); virtual bool interpreteTestResults(CTestCalculatedCallbackEvent *testResult); virtual bool createNextSubsumtionTest(); virtual CTaxonomy *createEmptyTaxonomyForOntology(CConcreteOntology *ontology, CConfigurationBase *config); virtual bool interpreteToldSubsumptionResult(COntologyClassificationItem *ontClassItem, const QList > &subSumRelList, bool isSubSum); void createObviousSubsumptionSatisfiableTestingOrder(COptimizedKPSetClassOntologyClassificationItem* ontClassItem); QSet getSubsumerSetFromBuildData(CConcept* concept, COptimizedKPSetClassOntologyClassificationItem* ontClassItem); void createObviousSubsumptionSatisfiableTestingOrderFromBuildData(COptimizedKPSetClassOntologyClassificationItem* ontClassItem); void createObviousSubsumptionSatisfiableTestingOrderFromSaturationData(COptimizedKPSetClassOntologyClassificationItem* ontClassItem); bool calculateSatisfiable(COptimizedKPSetClassOntologyClassificationItem *optSubClassItem, COptimizedKPSetClassTestingItem* nextSatTestItem); bool fastSatisfiableOnlySubClassPrecheckTest(COptimizedKPSetClassOntologyClassificationItem *optSubClassItem, COptimizedKPSetClassTestingItem* nextSatTestItem, bool* isSatisfiableFlag); bool fastPseudoModelSubsumptionClassPrecheckTest(COptimizedKPSetClassOntologyClassificationItem *optSubClassItem, COptimizedKPSetClassTestingItem* subsumedItem, COptimizedKPSetClassTestingItem* subsumerItem, bool* isSubsumptionFlag); bool isPseudoModelSubsumerPossible(COptimizedKPSetClassOntologyClassificationItem *optSubClassItem, CClassificationClassPseudoModelData* subsumedPMData, CClassificationClassPseudoModelHash* subsumedPMHash, CClassificationClassPseudoModelData* subsumerPMData, CClassificationClassPseudoModelHash* subsumerPMHash); virtual bool processToldClassificationMessage(COntologyClassificationItem *ontClassItem, CClassificationMessageData* messageData, CMemoryPool* memoryPools); bool calculateSubsumption(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassTestingItem* subsumedItem, COptimizedKPSetClassTestingItem* possSubsumerItem, COptimizedKPSetClassPossibleSubsumptionData* possSubsumData); COptimizedKPSetClassPossibleSubsumptionData* getNextPossibleSubsumptionCalculation(COptimizedKPSetClassOntologyClassificationItem *ontClassItem, COptimizedKPSetClassTestingItem* classItem); bool prunePossibleSubsumptions(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassTestingItem* item, COptimizedKPSetClassPossibleSubsumptionData* possSubsumData); bool propagateDownSubsumption(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassTestingItem* item, COptimizedKPSetClassTestingItem* subsumerItem); bool pruneDownSubsumption(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassTestingItem* item, CConcept* subsumerConcept); bool pruneUpNotSubsumption(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassTestingItem* item, CConcept* notSubsumerConcept); bool propagateUnsatisfiability(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassTestingItem* item); QString createDebugKPSetString(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, const QString& filename); void testDebugPossibleSubsumerCorrectCounted(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem); void testDebugPossibleSubsumerCorrectReferenced(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem); void incRemainingPossibleSubsumptionTestingCount(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassPossibleSubsumptionMap* posSubsumMap); void decRemainingPossibleSubsumptionTestingCount(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassPossibleSubsumptionMap* posSubsumMap, bool subsumptionConfirmed); CIndividualSaturationProcessNode* getSaturationIndividualNodeForConcept(CConcept* concept, bool negated); bool hasCachedSaturationIndividualNodeAssociatedExpansionProplematicConcept(CCacheEntry* cacheEntry, CConcept* testingConcept); CCacheEntry* getAssociatedSaturationCacheEntry(COptimizedKPSetClassTestingItem* classConItem); // protected variables protected: QHash workOntItemHash; QStringList satTestedConList; QStringList possSubsumInitConList; QString statusString; QMutex statUpdateMutex; CClassificationProgress mClassifyProgess; cint64 satTestedCount; cint64 totalToSatTestClassCount; cint64 subsumTestedCount; cint64 totalToSubsumTestCount; QTime classStartTime; QSet > subsumCalcedSet; bool mConfPossSubsumCalcOrderTopDown; bool mConfPossSubsumCalcOrderBottomUp; bool mConfPossSubsumCalcOrderConceptSorted; bool mConfPossSubsumCalcOrderFewestSubsumptionSorted; bool mConfPossSubsumPseudoModelPretest; bool mConfPossSubsumPseudoModelTest; bool mConfWriteDebuggingData; cint64 mStatProcesedSubsumMessCount; cint64 mStatProcesedPossSubsumInitMessCount; cint64 mStatProcesedPossSubsumUpdateMessCount; cint64 mStatProcesedPseudoModelMessCount; cint64 mInterpretedSubsumptionCalculationCount; cint64 mOrderedSubsumptionCalculationCount; cint64 mPseudoModelPretestSubsumptionCalculationCount; cint64 mCreatedCalculationTaskCount; cint64 mRecievedCallbackCount; CSaturationNodeAssociatedExpansionCache* mSatNodeExpCache; CSaturationNodeAssociatedExpansionCacheReader* mSatNodeExpCacheReader; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSSUBSUMPTIONCLASSIFIERTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelRoleMap.h0000644000175000017500000000452112520550746031752 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELROLEMAP_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELROLEMAP_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationClassPseudoModelRoleData.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Container/CLinker.h" #include "Reasoner/Ontology/CRole.h" #include "Reasoner/Ontology/CRoleTagComparer.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CClassificationClassPseudoModelRoleMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationClassPseudoModelRoleMap : public CCLASSPSEUDOMODELMAP { // public methods public: //! Constructor CClassificationClassPseudoModelRoleMap(CContext* context); CClassificationClassPseudoModelRoleMap* initPseudoModelRoleMap(CClassificationClassPseudoModelRoleMap* roleMap); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELROLEMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassifyingCallbackDataContext.h0000644000175000017500000000454112520550752030436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFYINGCALLBACKDATACONTEXT_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFYINGCALLBACKDATACONTEXT_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes #include "Concurrent/Callback/CCallbackDataContext.h" #include "Reasoner/Taxonomy/CTaxonomy.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; namespace Reasoner { using namespace Taxonomy; using namespace Ontology; namespace Classifier { /*! * * \class CClassifyingCallbackDataContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassifyingCallbackDataContext : public CCallbackDataContext { // public methods public: //! Constructor CClassifyingCallbackDataContext(bool classifying, CTaxonomy *taxanomy, CConcreteOntology *ontology); //! Destructor virtual ~CClassifyingCallbackDataContext(); virtual CConcreteOntology *getOntology(); virtual CTaxonomy *getTaxonomy(); virtual bool isClassifying(); // protected methods protected: // protected variables protected: CTaxonomy *tax; CConcreteOntology *onto; bool ontClassifying; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFYINGCALLBACKDATACONTEXT_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionMap.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionMap0000644000175000017500000000575212520550760032436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSPOSSIBLESUBSUMPTIONMAP_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSPOSSIBLESUBSUMPTIONMAP_H // Libraries includes #include // Namespace includes #include "ClassifierSettings.h" #include "CClassPossibleSubsumptionMap.h" #include "COptimizedKPSetClassPossibleSubsumptionData.h" #include "COptimizedKPSetClassPossibleSubsumptionMapIterator.h" // Other includes #include "Reasoner/Ontology/CConceptTagComparer.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class COptimizedKPSetClassPossibleSubsumptionMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetClassPossibleSubsumptionMap : public QMap, public CClassPossibleSubsumptionMap { // public methods public: //! Constructor COptimizedKPSetClassPossibleSubsumptionMap(); bool isPossibleSubsumptionUpdateRequired(); cint64 getRemainingPossibleSubsumptionCount(); COptimizedKPSetClassPossibleSubsumptionMap* setRemainingPossibleSubsumptionCount(cint64 possSubsumCount); COptimizedKPSetClassPossibleSubsumptionMap* decRemainingPossibleSubsumptionCount(cint64 decCount = 1); COptimizedKPSetClassPossibleSubsumptionMap* incRemainingPossibleSubsumptionCount(cint64 incCount = 1); COptimizedKPSetClassPossibleSubsumptionMap* setPossibleSubsumptionUpdateRequired(bool requiredUpdate = true); bool hasRemainingPossibleSubsumptions(); CClassPossibleSubsumptionMapIterator* getIterator(CClassPossibleSubsumptionMapIterator* reuseIterator, CContext* context); // protected methods protected: // protected variables protected: bool mRequirePossibleSubsumptionUpdate; cint64 mRemainingPossibleSubsumptionCount; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSPOSSIBLESUBSUMPTIONMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelHash.h0000644000175000017500000000557412520550746031307 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELHASH_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELHASH_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationClassPseudoModelData.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Memory/CObjectParameterizingAllocator.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Classifier { /*! * * \class CClassificationClassPseudoModelHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationClassPseudoModelHash { // public methods public: //! Constructor CClassificationClassPseudoModelHash(CContext* context); CClassificationClassPseudoModelData* getPseudoModelData(cint64 node, bool create); cint64 getCount(); CClassificationClassPseudoModelHash* initPseudoModelHash(CClassificationClassPseudoModelHash* hash); // protected methods protected: // protected variables protected: class CClassificationClassPseudoModelHashData { public: CClassificationClassPseudoModelHashData() { mUseData = nullptr; mLocData = nullptr; } CClassificationClassPseudoModelHashData(const CClassificationClassPseudoModelHashData& data) { mUseData = data.mUseData; mLocData = nullptr; } CClassificationClassPseudoModelData* mUseData; CClassificationClassPseudoModelData* mLocData; }; CContext* mContext; CCLASSPSEUDOMODELHASH mPMDataHash; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CSubsumptionClassifier.h0000644000175000017500000000546512520550762026753 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CSUBSUMPTIONCLASSIFIER_H #define KONCLUDE_REASONER_CLASSIFIER_CSUBSUMPTIONCLASSIFIER_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassifierStatistics.h" #include "CClassificationProgress.h" #include "CClassificationMessageDataObserver.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Taxonomy/CTaxonomy.h" #include "Concurrent/Callback/CCallbackData.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; using namespace Config; namespace Reasoner { using namespace Ontology; using namespace Taxonomy; namespace Classifier { /*! * * \class CSubsumptionClassifier * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSubsumptionClassifier : public CClassificationMessageDataObserver { // public methods public: //! Constructor CSubsumptionClassifier(); //! Destructor virtual ~CSubsumptionClassifier(); virtual bool classify(CConcreteOntology *ontology, CConfigurationBase *config, const QList& requirementList, CCallbackData* callback) = 0; virtual bool classify(CConcreteOntology *ontology, CConfigurationBase *config, const QList& requirementList) = 0; virtual bool callbackClassified(CConcreteOntology *ontology, CCallbackData *callback) = 0; virtual CClassifierStatistics *getClassificationStatistics() = 0; virtual QString getStatusString() = 0; virtual CClassificationProgress* getClassificationProgress() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CSUBSUMPTIONCLASSIFIER_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CPrecomputedSaturationSubsumerExtractor.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CPrecomputedSaturationSubsumerExtractor.cp0000644000175000017500000003576012520550762032555 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecomputedSaturationSubsumerExtractor.h" namespace Konclude { namespace Reasoner { namespace Classifier { CPrecomputedSaturationSubsumerExtractor::CPrecomputedSaturationSubsumerExtractor(CConcreteOntology* ontology) { mSatCalcTask = nullptr; mOntology = ontology; CSaturationData* saturationData = mOntology->getPrecomputation()->getSaturationModelData(); CSaturationTaskData* saturationTaskData = (CSaturationTaskData*)saturationData; if (saturationTaskData) { mSatCalcTask = saturationTaskData->getSaturationTask(); } } bool CPrecomputedSaturationSubsumerExtractor::extractSubsumers(CConcept* concept, CConceptSubsumerObserver* subsumerObserver, bool* possibleSubsumerFlag, CIndividualDependenceTrackingObserver* indDepTrackingObserver, CIndividualDependenceTrackingMarker* indiDepTrackMarker) { if (mSatCalcTask) { CProcessingDataBox* procDataBox = mSatCalcTask->getProcessingDataBox(); CConceptProcessData* conProData = (CConceptProcessData*)concept->getConceptData(); if (conProData) { CConceptSaturationReferenceLinkingData* conSatRefLinking = (CConceptSaturationReferenceLinkingData*)conProData->getConceptReferenceLinking(); if (conSatRefLinking) { CSaturationConceptReferenceLinking* saturationConceptRefLinkingData = (CSaturationConceptReferenceLinking*)conSatRefLinking->getPositiveConceptSaturationReferenceLinkingData(); if (saturationConceptRefLinkingData) { CIndividualSaturationProcessNode* baseIndiNode = (CIndividualSaturationProcessNode*)saturationConceptRefLinkingData->getIndividualProcessNodeForConcept(); if (baseIndiNode) { CIndividualSaturationProcessNode* indiNode = baseIndiNode; while (indiNode->hasSubstituteIndividualNode()) { if (indiNode != baseIndiNode) { CSaturationConceptDataItem* subsumerSatConDataItem = (CSaturationConceptDataItem*)indiNode->getSaturationConceptReferenceLinking(); if (!subsumerSatConDataItem->getSaturationNegation() && !subsumerSatConDataItem->getSaturationRoleRanges()) { CConcept* subsumerConcept = subsumerSatConDataItem->getSaturationConcept(); if (subsumerConcept != concept && subsumerConcept->hasClassName()) { subsumerObserver->tellConceptSupsumption(concept,subsumerConcept); } } } indiNode = indiNode->getSubstituteIndividualNode(); } CReapplyConceptSaturationLabelSet* conSet = indiNode->getReapplyConceptSaturationLabelSet(false); if (conSet) { for (CConceptSaturationDescriptor* conSatDesIt = conSet->getConceptSaturationDescriptionLinker(); conSatDesIt; conSatDesIt = conSatDesIt->getNext()) { if (!conSatDesIt->isNegated()) { CConcept* subsumerConcept = conSatDesIt->getConcept(); if (subsumerConcept != concept && subsumerConcept->hasClassName()) { subsumerObserver->tellConceptSupsumption(concept,subsumerConcept); } else { if (subsumerConcept->getOperatorCode() == CCEQCAND) { CIndividualSaturationProcessNodeStatusFlags* directFlags = indiNode->getDirectStatusFlags(); if (directFlags->hasEQCandidateProplematicFlag()) { if (possibleSubsumerFlag) { *possibleSubsumerFlag = true; } } } } } } } if (indiDepTrackMarker) { CSuccessorConnectedNominalSet* succConnNomSet = indiNode->getSuccessorConnectedNominalSet(false); if (succConnNomSet) { indiDepTrackMarker->setIndividualDependenceTracked(); } } if (indDepTrackingObserver) { CSuccessorConnectedNominalSet* succConnNomSet = indiNode->getSuccessorConnectedNominalSet(false); if (succConnNomSet) { CIndividualDependenceTracking* indiDepTracking = indDepTrackingObserver->getExtendingIndividualDependenceTracking(); CReferredIndividualTrackingVector* refIndiDepTrackVec = nullptr; if (indiDepTracking) { refIndiDepTrackVec = dynamic_cast(indiDepTracking); } if (!refIndiDepTrackVec) { cint64 trackIndiCount = mOntology->getABox()->getIndividualCount(); CConsistenceData* consData = mOntology->getConsistence()->getConsistenceModelData(); if (consData) { CConsistenceTaskData* consTaskData = dynamic_cast(consData); if (consTaskData) { CSatisfiableCalculationTask* cachedSatTask = consTaskData->getDeterministicSatisfiableTask(); if (cachedSatTask) { trackIndiCount = qMax(trackIndiCount,cachedSatTask->getProcessingDataBox()->getIndividualProcessNodeVector()->getItemCount()); } } } refIndiDepTrackVec = new CReferredIndividualTrackingVector(); refIndiDepTrackVec->initReferredIndividualTrackingVector(trackIndiCount); refIndiDepTrackVec = dynamic_cast(indDepTrackingObserver->installIndividualDependenceTracking(refIndiDepTrackVec)); } if (refIndiDepTrackVec) { for (CSuccessorConnectedNominalSet::const_iterator it = succConnNomSet->constBegin(), itEnd = succConnNomSet->constEnd(); it != itEnd; ++it) { cint64 nominalIndiID(*it); refIndiDepTrackVec->setIndividualReferred(nominalIndiID); } } } } return true; } } } } } return false; } cint64 CPrecomputedSaturationSubsumerExtractor::getSubsumerCount(CConcept* concept) { cint64 subsumerCount = 0; if (mSatCalcTask) { CProcessingDataBox* procDataBox = mSatCalcTask->getProcessingDataBox(); CConceptProcessData* conProData = (CConceptProcessData*)concept->getConceptData(); if (conProData) { CConceptSaturationReferenceLinkingData* conSatRefLinking = (CConceptSaturationReferenceLinkingData*)conProData->getConceptReferenceLinking(); if (conSatRefLinking) { CSaturationConceptReferenceLinking* saturationConceptRefLinkingData = (CSaturationConceptReferenceLinking*)conSatRefLinking->getPositiveConceptSaturationReferenceLinkingData(); if (saturationConceptRefLinkingData) { CIndividualSaturationProcessNode* baseIndiNode = (CIndividualSaturationProcessNode*)saturationConceptRefLinkingData->getIndividualProcessNodeForConcept(); if (baseIndiNode) { CIndividualSaturationProcessNode* indiNode = baseIndiNode; while (indiNode->hasSubstituteIndividualNode()) { if (indiNode != baseIndiNode) { CSaturationConceptDataItem* subsumerSatConDataItem = (CSaturationConceptDataItem*)indiNode->getSaturationConceptReferenceLinking(); if (!subsumerSatConDataItem->getSaturationNegation() && !subsumerSatConDataItem->getSaturationRoleRanges()) { CConcept* subsumerConcept = subsumerSatConDataItem->getSaturationConcept(); if (subsumerConcept != concept && subsumerConcept->hasClassName()) { ++subsumerCount; } } } indiNode = indiNode->getSubstituteIndividualNode(); } CReapplyConceptSaturationLabelSet* conSet = indiNode->getReapplyConceptSaturationLabelSet(false); if (conSet) { for (CConceptSaturationDescriptor* conSatDesIt = conSet->getConceptSaturationDescriptionLinker(); conSatDesIt; conSatDesIt = conSatDesIt->getNext()) { if (!conSatDesIt->isNegated()) { CConcept* subsumerConcept = conSatDesIt->getConcept(); if (subsumerConcept != concept && subsumerConcept->hasClassName()) { ++subsumerCount; } } } } } } } } } return subsumerCount; } bool CPrecomputedSaturationSubsumerExtractor::hasSubsumerConcept(CConcept* concept, CConcept* testSubsumerConcept) { if (mSatCalcTask) { CProcessingDataBox* procDataBox = mSatCalcTask->getProcessingDataBox(); CConceptProcessData* conProData = (CConceptProcessData*)concept->getConceptData(); if (conProData) { CConceptSaturationReferenceLinkingData* conSatRefLinking = (CConceptSaturationReferenceLinkingData*)conProData->getConceptReferenceLinking(); if (conSatRefLinking) { CSaturationConceptReferenceLinking* saturationConceptRefLinkingData = (CSaturationConceptReferenceLinking*)conSatRefLinking->getPositiveConceptSaturationReferenceLinkingData(); if (saturationConceptRefLinkingData) { CIndividualSaturationProcessNode* baseIndiNode = (CIndividualSaturationProcessNode*)saturationConceptRefLinkingData->getIndividualProcessNodeForConcept(); if (baseIndiNode) { CIndividualSaturationProcessNode* indiNode = baseIndiNode; while (indiNode->hasSubstituteIndividualNode()) { if (indiNode != baseIndiNode) { CSaturationConceptDataItem* subsumerSatConDataItem = (CSaturationConceptDataItem*)indiNode->getSaturationConceptReferenceLinking(); if (!subsumerSatConDataItem->getSaturationNegation() && !subsumerSatConDataItem->getSaturationRoleRanges()) { CConcept* subsumerConcept = subsumerSatConDataItem->getSaturationConcept(); if (subsumerConcept == testSubsumerConcept) { return true; } } } indiNode = indiNode->getSubstituteIndividualNode(); } CReapplyConceptSaturationLabelSet* conSet = indiNode->getReapplyConceptSaturationLabelSet(false); if (conSet) { if (conSet->containsConcept(testSubsumerConcept,false)) { return true; } } } } } } } return false; } CConcept* CPrecomputedSaturationSubsumerExtractor::getDirectSubsumerCount(CConcept* concept, bool (*isDirectSubsumer)(CConcept*, CConcept*)) { if (mSatCalcTask) { CProcessingDataBox* procDataBox = mSatCalcTask->getProcessingDataBox(); CConceptProcessData* conProData = (CConceptProcessData*)concept->getConceptData(); if (conProData) { CConceptSaturationReferenceLinkingData* conSatRefLinking = (CConceptSaturationReferenceLinkingData*)conProData->getConceptReferenceLinking(); if (conSatRefLinking) { CSaturationConceptReferenceLinking* saturationConceptRefLinkingData = (CSaturationConceptReferenceLinking*)conSatRefLinking->getPositiveConceptSaturationReferenceLinkingData(); if (saturationConceptRefLinkingData) { CIndividualSaturationProcessNode* baseIndiNode = (CIndividualSaturationProcessNode*)saturationConceptRefLinkingData->getIndividualProcessNodeForConcept(); if (baseIndiNode) { CIndividualSaturationProcessNode* indiNode = baseIndiNode; while (indiNode->hasSubstituteIndividualNode()) { if (indiNode != baseIndiNode) { CSaturationConceptDataItem* subsumerSatConDataItem = (CSaturationConceptDataItem*)indiNode->getSaturationConceptReferenceLinking(); if (!subsumerSatConDataItem->getSaturationNegation() && !subsumerSatConDataItem->getSaturationRoleRanges()) { CConcept* subsumerConcept = subsumerSatConDataItem->getSaturationConcept(); if (subsumerConcept != concept && subsumerConcept->hasClassName()) { if (isDirectSubsumer(concept,subsumerConcept)) { return subsumerConcept; } } } } indiNode = indiNode->getSubstituteIndividualNode(); } CReapplyConceptSaturationLabelSet* conSet = indiNode->getReapplyConceptSaturationLabelSet(false); if (conSet) { for (CConceptSaturationDescriptor* conSatDesIt = conSet->getConceptSaturationDescriptionLinker(); conSatDesIt; conSatDesIt = conSatDesIt->getNext()) { if (!conSatDesIt->isNegated()) { CConcept* subsumerConcept = conSatDesIt->getConcept(); if (subsumerConcept != concept && subsumerConcept->hasClassName()) { if (isDirectSubsumer(concept,subsumerConcept)) { return subsumerConcept; } } } } } } } } } } return nullptr; } bool CPrecomputedSaturationSubsumerExtractor::getConceptFlags(CConcept* concept, bool* unsatisfiableFlag, bool* insufficientFlag, bool* incompleteProcessedFlag) { if (mSatCalcTask) { CProcessingDataBox* procDataBox = mSatCalcTask->getProcessingDataBox(); CConceptProcessData* conProData = (CConceptProcessData*)concept->getConceptData(); if (conProData) { CConceptSaturationReferenceLinkingData* conSatRefLinking = (CConceptSaturationReferenceLinkingData*)conProData->getConceptReferenceLinking(); if (conSatRefLinking) { CSaturationConceptReferenceLinking* saturationConceptRefLinkingData = (CSaturationConceptReferenceLinking*)conSatRefLinking->getPositiveConceptSaturationReferenceLinkingData(); if (saturationConceptRefLinkingData) { CIndividualSaturationProcessNode* baseIndiNode = (CIndividualSaturationProcessNode*)saturationConceptRefLinkingData->getIndividualProcessNodeForConcept(); if (baseIndiNode) { CIndividualSaturationProcessNode* indiNode = baseIndiNode; while (indiNode->hasSubstituteIndividualNode()) { indiNode = indiNode->getSubstituteIndividualNode(); } CIndividualSaturationProcessNodeStatusFlags* baseFlags = baseIndiNode->getIndirectStatusFlags(); CIndividualSaturationProcessNodeStatusFlags* flags = indiNode->getIndirectStatusFlags(); if ((baseFlags->hasClashedFlag() || flags->hasClashedFlag()) && unsatisfiableFlag) { *unsatisfiableFlag = true; } if ((baseFlags->hasInsufficientFlag() || flags->hasInsufficientFlag()) && insufficientFlag) { *insufficientFlag = true; } if ((baseFlags->hasUnprocessedFlag() || flags->hasUnprocessedFlag()) && incompleteProcessedFlag) { *incompleteProcessedFlag = true; } return true; } } } } } return false; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionMapIterator.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionMapI0000644000175000017500000000500312520550760032370 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetRolePossibleSubsumptionMapIterator.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedKPSetRolePossibleSubsumptionMapIterator::COptimizedKPSetRolePossibleSubsumptionMapIterator() { } COptimizedKPSetRolePossibleSubsumptionMapIterator::COptimizedKPSetRolePossibleSubsumptionMapIterator(QMap::iterator itBegin, QMap::iterator itEnd) { mItBegin = itBegin; mItEnd = itEnd; } bool COptimizedKPSetRolePossibleSubsumptionMapIterator::hasNext() { return mItBegin != mItEnd; } bool COptimizedKPSetRolePossibleSubsumptionMapIterator::isSubsumptionConfirmed() { return mItBegin.value()->isSubsumptionConfirmed(); } bool COptimizedKPSetRolePossibleSubsumptionMapIterator::isSubsumptionInvalided() { return mItBegin.value()->isSubsumptionInvalided(); } CConcept* COptimizedKPSetRolePossibleSubsumptionMapIterator::getSubsumptionConcept() { return mItBegin.key().getConcept(); } bool COptimizedKPSetRolePossibleSubsumptionMapIterator::invalidateSubsumption() { bool wasInvalid = isSubsumptionInvalided(); mItBegin.value()->setSubsumptionInvalid(true); return wasInvalid; } bool COptimizedKPSetRolePossibleSubsumptionMapIterator::confirmSubsumption() { bool wasConfirmed = isSubsumptionConfirmed(); mItBegin.value()->setSubsumptionConfirmed(true); return wasConfirmed; } bool COptimizedKPSetRolePossibleSubsumptionMapIterator::moveNext() { ++mItBegin; return true; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/ClassifierSettings.h0000644000175000017500000000561412520550754026115 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CLASSIFICATIONSETTINGS #define KONCLUDE_REASONER_CLASSIFIER_CLASSIFICATIONSETTINGS // Libraries includes #include #include // Namespace includes // Other includes #include "Utilities/Container/CQtManagedRestrictedModificationList.h" #include "Utilities/Container/CQtManagedRestrictedModificationMap.h" #include "Utilities/Container/CQtManagedRestrictedModificationHash.h" // Logger includes namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Classifier { /*! * * \file ClassificationSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class COptimizedKPSetClassTestingItem; class COptimizedKPSetRoleTestingItem; // Custom Events >= 2000 const QEvent::Type EVENTCLASSIFYONTOLOGY = (QEvent::Type)2000; const QEvent::Type EVENTTESTCALCULATEDCALLBACK = (QEvent::Type)2001; const QEvent::Type EVENTINTERCEPTONTOLOGYTESTRESULT = (QEvent::Type)2002; const QEvent::Type EVENTONTOLOGYTELLSUBSUMPTION = (QEvent::Type)2003; const QEvent::Type EVENTCALLBACKCLASSIFIEDONTOLOGY = (QEvent::Type)2004; const QEvent::Type EVENTONTOLOGYTELLDISJOINTS = (QEvent::Type)2005; const QEvent::Type EVENTONTOLOGYTELLSATISFIABLE = (QEvent::Type)2006; const QEvent::Type EVENTONTOLOGYTELLCONNECIDENOCCUR = (QEvent::Type)2007; const QEvent::Type EVENTONTOLOGYTELLCONPOSSSUBSUM = (QEvent::Type)2008; const QEvent::Type EVENTSATURATIONCALCULATEDCALLBACK = (QEvent::Type)2009; const QEvent::Type EVENTONTOLOGYTELLCLASSIFICATIONMESSAGE = (QEvent::Type)2010; #define CCLASSSUBSUMPTIONMESSAGELIST CQtManagedRestrictedModificationList #define CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST CQtManagedRestrictedModificationList #define CCLASSPSEUDOMODELHASH CQtManagedRestrictedModificationHash #define CCLASSPSEUDOMODELMAP CQtManagedRestrictedModificationMap }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_CLASSIFIER_CLASSIFICATIONSETTINGS././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassOntologyClassificationItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassOntologyClassification0000644000175000017500000003207712520756372032444 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetClassOntologyClassificationItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedKPSetClassOntologyClassificationItem::COptimizedKPSetClassOntologyClassificationItem(CConfigurationBase *configuration, CClassifierStatistics *nextClassificationStatistics) : COntologyClassificationItem(configuration,nextClassificationStatistics) { mTopSatTestItem = nullptr; mBottomSatTestItem = nullptr; mRemainingSatTests = 0; mRunningSatTests = 0; mSatisfiableTestingPhaseFinished = false; mPossibleSubsumptionTestingPhaseFinished = false; mRemainingPossibleSubsumptionTests = 0; mRunningPossibleSubsumptionTests = 0; mCalculatedPossibleSubsumCount = 0; mCalculatedTruePossibleSubsumCount = 0; mCalculatedFalsePossibleSubsumCount = 0; mPossibleSubsumCount = 0; mTruePossibleSubsumCount = 0; mFalsePossibleSubsumCount = 0; } COptimizedKPSetClassOntologyClassificationItem::~COptimizedKPSetClassOntologyClassificationItem() { } QHash* COptimizedKPSetClassOntologyClassificationItem::getConceptSatisfiableTestItemHash() { return &mConceptSatItemHash; } QList* COptimizedKPSetClassOntologyClassificationItem::getConceptSatisfiableTestItemContainer() { return &mSatTestItemContainer; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassOntologyClassificationItem::getTopConceptSatisfiableTestItem() { return mTopSatTestItem; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassOntologyClassificationItem::getBottomConceptSatisfiableTestItem() { return mBottomSatTestItem; } QList* COptimizedKPSetClassOntologyClassificationItem::getNextSatisfiableTestingItemList() { return &mNextItemList; } QSet* COptimizedKPSetClassOntologyClassificationItem::getNextCandidateSatisfiableTestingItemSet() { return &mNextCandItemSet; } QSet* COptimizedKPSetClassOntologyClassificationItem::getRemainingCandidateSatisfiableTestingItemSet() { return &mRemainingCandItemSet; } QList* COptimizedKPSetClassOntologyClassificationItem::getNextPossibleSubsumptionTestingItemList() { return &mNextPossSubsumItemList; } QSet* COptimizedKPSetClassOntologyClassificationItem::getCurrentPossibleSubsumptionTestingItemSet() { return &mCurrentPossSubsumItemSet; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::initTopBottomSatisfiableTestingItems(COptimizedKPSetClassTestingItem* topItem, COptimizedKPSetClassTestingItem* bottomItem) { mTopSatTestItem = topItem; mBottomSatTestItem = bottomItem; return this; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassOntologyClassificationItem::getConceptSatisfiableTestItem(CConcept* satTestConcept, bool create) { COptimizedKPSetClassTestingItem* item = nullptr; if (satTestConcept->getOperatorCode() == CCEQCAND) { satTestConcept = satTestConcept->getOperandList()->getData(); } item = mConceptSatItemHash.value(satTestConcept); if (!item && create) { item = new COptimizedKPSetClassTestingItem(); item->initSatisfiableTestingItem(satTestConcept,&mConceptRefLinkData); mConceptSatItemHash.insert(satTestConcept,item); mSatTestItemContainer.append(item); } return item; } bool COptimizedKPSetClassOntologyClassificationItem::hasAllSatisfiableTestsCompleted() { return mRemainingSatTests <= 0 && mRunningSatTests <= 0; } bool COptimizedKPSetClassOntologyClassificationItem::hasRemainingSatisfiableTests() { return mRemainingSatTests > 0; } cint64 COptimizedKPSetClassOntologyClassificationItem::getRemainingSatisfiableTestsCount() { return mRemainingSatTests; } cint64 COptimizedKPSetClassOntologyClassificationItem::getRunningSatisfiableTestsCount() { return mRunningSatTests; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::incRemainingSatisfiableTestsCount(cint64 incCount) { mRemainingSatTests += incCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::incRunningSatisfiableTestsCount(cint64 incCount) { mRunningSatTests += incCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::decRemainingSatisfiableTestsCount(cint64 decCount) { mRemainingSatTests -= decCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::decRunningSatisfiableTestsCount(cint64 decCount) { mRunningSatTests -= decCount; return this; } QList* COptimizedKPSetClassOntologyClassificationItem::getSatisfiableConceptItemList() { return &mSatisfiableItemList; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::addSatisfiableConceptItem(COptimizedKPSetClassTestingItem* item) { mSatisfiableItemList.append(item); return this; } QHash* COptimizedKPSetClassOntologyClassificationItem::getConceptReferenceLinkingDataHash() { return &mConceptRefLinkData; } bool COptimizedKPSetClassOntologyClassificationItem::hasSatisfiableTestingPhaseFinished() { return mSatisfiableTestingPhaseFinished; } bool COptimizedKPSetClassOntologyClassificationItem::hasPossibleSubsumptionTestingPhaseFinished() { return mPossibleSubsumptionTestingPhaseFinished; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::setSatisfiableTestingPhaseFinished(bool finished) { mSatisfiableTestingPhaseFinished = finished; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::setPossibleSubsumptionTestingPhaseFinished(bool finished) { mPossibleSubsumptionTestingPhaseFinished = finished; return this; } cint64 COptimizedKPSetClassOntologyClassificationItem::getRemainingPossibleSubsumptionTestsCount() { return mRemainingPossibleSubsumptionTests; } cint64 COptimizedKPSetClassOntologyClassificationItem::hasRemainingPossibleSubsumptionTests() { return mRemainingPossibleSubsumptionTests > 0; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::incRemainingPossibleSubsumptionTestsCount(cint64 incCount) { mRemainingPossibleSubsumptionTests += incCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::decRemainingPossibleSubsumptionTestsCount(cint64 decCount) { mRemainingPossibleSubsumptionTests -= decCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::setRemainingPossibleSubsumptionTestsCount(cint64 testCount) { mRemainingPossibleSubsumptionTests = testCount; return this; } QSet* COptimizedKPSetClassOntologyClassificationItem::getRemainingPossibleSubsumptionClassTestingSet() { return &mRemPossClassTestingSet; } cint64 COptimizedKPSetClassOntologyClassificationItem::getRemainingPossibleSubsumptionClassTestingCount() { return mRemPossClassTestingSet.count(); } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::incRunningPossibleSubsumptionTestsCount(cint64 incCount) { mRunningPossibleSubsumptionTests += incCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::decRunningPossibleSubsumptionTestsCount(cint64 decCount) { mRunningPossibleSubsumptionTests -= decCount; return this; } QSet* COptimizedKPSetClassOntologyClassificationItem::getEquivaltentConceptNonCandidateSet() { return &mEquivConNonCandidateSet; } CBOXHASH* COptimizedKPSetClassOntologyClassificationItem::getEquivalentConceptCandidateHash() { return &mEquivConCandidateHash; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::addMemoryPools(CMemoryPool* memoryPools) { mMemoryPoolContainer.appendMemoryPool(memoryPools); return this; } CMemoryPool* COptimizedKPSetClassOntologyClassificationItem::takeMemoryPools() { return mMemoryPoolContainer.takeMemoryPools(); } cint64 COptimizedKPSetClassOntologyClassificationItem::getCalculatedPossibleSubsumerCount() { return mCalculatedPossibleSubsumCount; } cint64 COptimizedKPSetClassOntologyClassificationItem::getCalculatedTruePossibleSubsumerCount() { return mCalculatedTruePossibleSubsumCount; } cint64 COptimizedKPSetClassOntologyClassificationItem::getCalculatedFalsePossibleSubsumerCount() { return mCalculatedFalsePossibleSubsumCount; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::setCalculatedPossibleSubsumerCount(cint64 subsumCount) { mCalculatedPossibleSubsumCount = subsumCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::setCalculatedTruePossibleSubsumerCount(cint64 subsumCount) { mCalculatedTruePossibleSubsumCount = subsumCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::setCalculatedFalsePossibleSubsumerCount(cint64 subsumCount) { mCalculatedFalsePossibleSubsumCount = subsumCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::incCalculatedPossibleSubsumerCount(cint64 incSubsumCount) { mCalculatedPossibleSubsumCount += incSubsumCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::incCalculatedTruePossibleSubsumerCount(cint64 incSubsumCount) { mCalculatedTruePossibleSubsumCount += incSubsumCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::incCalculatedFalsePossibleSubsumerCount(cint64 incSubsumCount) { mCalculatedFalsePossibleSubsumCount += incSubsumCount; return this; } cint64 COptimizedKPSetClassOntologyClassificationItem::getPossibleSubsumerCount() { return mPossibleSubsumCount; } cint64 COptimizedKPSetClassOntologyClassificationItem::getTruePossibleSubsumerCount() { return mTruePossibleSubsumCount; } cint64 COptimizedKPSetClassOntologyClassificationItem::getFalsePossibleSubsumerCount() { return mFalsePossibleSubsumCount; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::setPossibleSubsumerCount(cint64 subsumCount) { mPossibleSubsumCount = subsumCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::setTruePossibleSubsumerCount(cint64 subsumCount) { mTruePossibleSubsumCount = subsumCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::setFalsePossibleSubsumerCount(cint64 subsumCount) { mFalsePossibleSubsumCount = subsumCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::incPossibleSubsumerCount(cint64 incSubsumCount) { mPossibleSubsumCount += incSubsumCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::incTruePossibleSubsumerCount(cint64 incSubsumCount) { mTruePossibleSubsumCount += incSubsumCount; return this; } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassOntologyClassificationItem::incFalsePossibleSubsumerCount(cint64 incSubsumCount) { mFalsePossibleSubsumCount += incSubsumCount; return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassPossibleSubsumptionMapIterator.h0000644000175000017500000000415012520550752031572 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSPOSSIBLESUBSUMPTIONMAPITERATOR_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSPOSSIBLESUBSUMPTIONMAPITERATOR_H // Libraries includes #include // Namespace includes #include "ClassifierSettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CClassPossibleSubsumptionMapIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassPossibleSubsumptionMapIterator { // public methods public: virtual bool hasNext() = 0; virtual bool isSubsumptionConfirmed() = 0; virtual bool isSubsumptionInvalided() = 0; virtual CConcept* getSubsumptionConcept() = 0; virtual bool invalidateSubsumption() = 0; virtual bool confirmSubsumption() = 0; virtual bool moveNext() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSPOSSIBLESUBSUMPTIONMAPITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodeTraversalOrderClassificationItem.h0000644000175000017500000000612612520550756031654 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CNODETRAVERSALORDERCLASSIFICATIONITEM_H #define KONCLUDE_REASONER_CLASSIFIER_CNODETRAVERSALORDERCLASSIFICATIONITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassifierStatistics.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Taxonomy/CTaxonomy.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Taxonomy; namespace Classifier { /*! * * \class CNodeTraversalOrderClassificationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNodeTraversalOrderClassificationItem { // public methods public: //! Constructor CNodeTraversalOrderClassificationItem(CHierarchyNode *node, CHierarchyNode *parentNode); //! Destructor virtual ~CNodeTraversalOrderClassificationItem(); virtual CHierarchyNode *getTraversalNode(); virtual CHierarchyNode *getParentTestingNode(); virtual CHierarchyNode *getParentAgainstTestingNode(); virtual CNodeTraversalOrderClassificationItem *setParentTestingNode(CHierarchyNode *node); virtual CNodeTraversalOrderClassificationItem *setParentAgainstTestingNode(CHierarchyNode *node); virtual bool isParentAgainstTesting(); virtual QList *getOrderTraversalList(); virtual CNodeTraversalOrderClassificationItem *appendOrderTraversalList(QList &nodeList); virtual QList *getAgainstOrderTraversalList(); virtual CNodeTraversalOrderClassificationItem *appendAgainstOrderTraversalList(QList &nodeList); // protected methods protected: // protected variables protected: CHierarchyNode *traversalNode; CHierarchyNode *parentTestNode; CHierarchyNode *parentAgainstTestNode; bool againstTested; QList orderTraversalList; QList againstOrderTraversalList; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CNODETRAVERSALORDERCLASSIFICATIONITEM_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionMapIterator.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionMapI0000644000175000017500000000535212520550760032377 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETROLEPOSSIBLESUBSUMPTIONMAPITERATOR_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETROLEPOSSIBLESUBSUMPTIONMAPITERATOR_H // Libraries includes #include // Namespace includes #include "ClassifierSettings.h" #include "CClassPossibleSubsumptionMapIterator.h" #include "COptimizedKPSetRolePossibleSubsumptionData.h" // Other includes #include "Reasoner/Ontology/CConceptTagComparer.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class COptimizedKPSetRolePossibleSubsumptionMapIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetRolePossibleSubsumptionMapIterator : public CClassPossibleSubsumptionMapIterator { // public methods public: // Constructor COptimizedKPSetRolePossibleSubsumptionMapIterator(); COptimizedKPSetRolePossibleSubsumptionMapIterator(QMap::iterator itBegin, QMap::iterator itEnd); bool hasNext(); bool isSubsumptionConfirmed(); bool isSubsumptionInvalided(); CConcept* getSubsumptionConcept(); bool invalidateSubsumption(); bool confirmSubsumption(); bool moveNext(); // protected methods protected: // protected variables protected: QMap::iterator mItBegin; QMap::iterator mItEnd; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETROLEPOSSIBLESUBSUMPTIONMAPITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRoleTestingItem.h0000644000175000017500000001464512520550762030270 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COptimizedKPSetRoleTestingItem_H #define KONCLUDE_REASONER_CLASSIFIER_COptimizedKPSetRoleTestingItem_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "COptimizedKPSetRolePossibleSubsumptionMap.h" #include "CConceptSubsumerObserver.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptSatisfiableReferenceLinkingData.h" #include "Reasoner/Taxonomy/CHierarchyNode.h" #include "Reasoner/Kernel/Cache/CCacheEntry.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Taxonomy; namespace Classifier { /*! * * \class COptimizedKPSetRoleTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetRoleTestingItem : public CConceptSubsumerObserver { // public methods public: //! Constructor COptimizedKPSetRoleTestingItem(); ~COptimizedKPSetRoleTestingItem(); COptimizedKPSetRoleTestingItem* initSatisfiableTestingItem(CConcept* satTestConcept); CConcept* getTestingConcept(); CHierarchyNode* getSatisfiableConceptHierarchyNode(); COptimizedKPSetRoleTestingItem* setSatisfiableConceptHierarchyNode(CHierarchyNode* hierNode); QSet* getSubsumingConceptItemSet(); QList* getSubsumingConceptItemList(); cint64 getSubsumingConceptItemCount() const; bool hasSubsumerConceptItem(COptimizedKPSetRoleTestingItem* item); QList* getSuccessorItemList(); cint64 getUnprocessedPredecessorItemCount(); bool hasOnlyProcessedPredecessorItems(); COptimizedKPSetRoleTestingItem* decUnprocessedPredecessorItems(cint64 decCount = 1); COptimizedKPSetRoleTestingItem* incUnprocessedPredecessorItems(cint64 incCount = 1); COptimizedKPSetRoleTestingItem* setUnprocessedPredecessorItems(cint64 predCount); COptimizedKPSetRoleTestingItem* addSuccessorSatisfiableTestItem(COptimizedKPSetRoleTestingItem* succItem); bool isSatisfiableTestOrdered(); bool isSatisfiableTested(); bool isResultUnsatisfiableDerivated(); bool isResultSatisfiableDerivated(); bool getSatisfiableTestedResult(); COptimizedKPSetRoleTestingItem* setSatisfiableTestOrdered(bool satTestOrdered); COptimizedKPSetRoleTestingItem* setSatisfiableTested(bool satTested); COptimizedKPSetRoleTestingItem* setResultUnsatisfiableDerivated(bool unsatDerivated); COptimizedKPSetRoleTestingItem* setResultSatisfiableDerivated(bool satDerivated); COptimizedKPSetRoleTestingItem* setSatisfiableTestedResult(bool satTestedResult); COptimizedKPSetRoleTestingItem* addSubsumingConceptItem(COptimizedKPSetRoleTestingItem* subsumingItem); CConceptSubsumerObserver* tellConceptSupsumption(CConcept* subsumedConcept, CConcept* subsumerConcept); QList* sortSubsumingConceptItemList(); bool isEquivalentItem(); COptimizedKPSetRoleTestingItem* setEquivalentItem(bool equivalent); bool isPredecessorItem(); COptimizedKPSetRoleTestingItem* setPredecessorItem(bool isPredecessorOfOneItem); bool isMoreConceptClassificationInformationRequired(); COptimizedKPSetRolePossibleSubsumptionMap* getPossibleSubsumptionMap(bool create = false); QSet* getUpPropagationItemSet(); QSet* getDownPropagationItemSet(); COptimizedKPSetRoleTestingItem* addUpPropagationItem(COptimizedKPSetRoleTestingItem* item); COptimizedKPSetRoleTestingItem* addDownPropagationItem(COptimizedKPSetRoleTestingItem* item); bool isPropagationConnected(); COptimizedKPSetRoleTestingItem* setPropagationConnected(bool connected); virtual CClassPossibleSubsumptionMap* getClassPossibleSubsumptionMap(); bool isPossibleSubsumptionMapInitialized(); COptimizedKPSetRoleTestingItem* setPossibleSubsumptionMapInitialized(bool initialized); QSet* getPossibleSubsumedSet(bool create); QList* getPossibleSubsumedList(); COptimizedKPSetRoleTestingItem* setPossibleSubsumedList(QList* possSubsumedList); bool hasRemainingPossibleSubsumedItems(); // protected methods protected: // protected variables protected: CConcept* mConceptSat; CHierarchyNode* mConSatHierNode; QSet mSubsumingConceptItemSet; QList mSubsumingConceptItemList; QList mSuccList; cint64 mPredCounter; bool mSatTestOrdered; bool mTestedSat; bool mUnsatDerivated; bool mSatDerivated; bool mSatTestedResult; bool mPropagationConnected; QSet mUpPropagationItemSet; QSet mDownPropagationItemSet; QSet* mPossibleSubsumedSet; QList* mPossibleSubsumedList; bool mEquiItem; bool mPredOfItem; COptimizedKPSetRolePossibleSubsumptionMap* mPossibleSubsumptionMap; bool mPossSubsumMapInitialized; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COptimizedKPSetRoleTestingItem_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationPseudoModelIdentifierMessageData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationPseudoModelIdentifierMessag0000644000175000017500000000476712520550750032430 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONPSEUDOMODELIDENTIFIERMESSAGEDATA_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONPSEUDOMODELIDENTIFIERMESSAGEDATA_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationMessageData.h" #include "CClassificationClassPseudoModelHash.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CClassificationPseudoModelIdentifierMessageData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationPseudoModelIdentifierMessageData : public CClassificationMessageData { // public methods public: //! Constructor CClassificationPseudoModelIdentifierMessageData(); CClassificationPseudoModelIdentifierMessageData* initClassificationPseudoModelIdentifierMessageData(CConcept* pmConcept, CClassificationClassPseudoModelHash* pmModelHash, CMemoryPool* pmMemPools); CConcept* getPseudoModelConcept(); CMemoryPool* getPseudoModelMemoryPools(); CClassificationClassPseudoModelHash* getPseudoModelHash(); // protected methods protected: // protected variables protected: CConcept* mPMConcept; CMemoryPool* mPMMemPools; CClassificationClassPseudoModelHash* mPMModelHash; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONPSEUDOMODELIDENTIFIERMESSAGEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodeTraversalOrderClassificationItem.cpp0000644000175000017500000000555412520550756032213 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNodeTraversalOrderClassificationItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { CNodeTraversalOrderClassificationItem::CNodeTraversalOrderClassificationItem(CHierarchyNode *node, CHierarchyNode *parentNode) { parentTestNode = parentNode; traversalNode = node; parentAgainstTestNode = 0; againstTested = false; } CNodeTraversalOrderClassificationItem::~CNodeTraversalOrderClassificationItem() { } CHierarchyNode *CNodeTraversalOrderClassificationItem::getTraversalNode() { return traversalNode; } CHierarchyNode *CNodeTraversalOrderClassificationItem::getParentTestingNode() { return parentTestNode; } CHierarchyNode *CNodeTraversalOrderClassificationItem::getParentAgainstTestingNode() { return parentAgainstTestNode; } CNodeTraversalOrderClassificationItem *CNodeTraversalOrderClassificationItem::setParentTestingNode(CHierarchyNode *node) { parentTestNode = node; return this; } QList *CNodeTraversalOrderClassificationItem::getOrderTraversalList() { return &orderTraversalList; } CNodeTraversalOrderClassificationItem *CNodeTraversalOrderClassificationItem::appendOrderTraversalList(QList &nodeList) { orderTraversalList << nodeList; return this; } CNodeTraversalOrderClassificationItem *CNodeTraversalOrderClassificationItem::setParentAgainstTestingNode(CHierarchyNode *node) { parentAgainstTestNode = node; againstTested = true; return this; } bool CNodeTraversalOrderClassificationItem::isParentAgainstTesting() { return againstTested; } QList *CNodeTraversalOrderClassificationItem::getAgainstOrderTraversalList() { return &againstOrderTraversalList; } CNodeTraversalOrderClassificationItem *CNodeTraversalOrderClassificationItem::appendAgainstOrderTraversalList(QList &nodeList) { againstOrderTraversalList << nodeList; return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CConceptSubsumerObserver.cpp0000644000175000017500000000224412520550752027571 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptSubsumerObserver.h" namespace Konclude { namespace Reasoner { namespace Classifier { CConceptSubsumerObserver::CConceptSubsumerObserver() { } CConceptSubsumerObserver::~CConceptSubsumerObserver() { } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedConceptSaturationSatisfiableTestingItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedConceptSaturationSatisfiableTest0000644000175000017500000001060112520550756032520 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDCONCEPTSATURATIONSATISFIABLETESTINGITEM_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDCONCEPTSATURATIONSATISFIABLETESTINGITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationConceptReferenceLinking.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CConceptReferenceLinking.h" #include "Reasoner/Taxonomy/CHierarchyNode.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Taxonomy; namespace Classifier { /*! * * \class COptimizedConceptSaturationSatisfiableTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedConceptSaturationSatisfiableTestingItem : public CClassificationConceptReferenceLinking { // public methods public: //! Constructor COptimizedConceptSaturationSatisfiableTestingItem(); COptimizedConceptSaturationSatisfiableTestingItem* initConceptSatisfiableTestingItem(CConcept* satTestConcept); CConcept* getSatisfiableConcept(); virtual bool isClassSatisfiableTestingItem(); CConceptReferenceLinking* getConceptReferenceLinking(); COptimizedConceptSaturationSatisfiableTestingItem* setConceptReferenceLinking(CConceptReferenceLinking* refLinking); QList* getExistReferenceConceptItemList(); COptimizedConceptSaturationSatisfiableTestingItem* addExistReferenceConceptItemList(COptimizedConceptSaturationSatisfiableTestingItem* existItem); bool isOrderingQueued(); COptimizedConceptSaturationSatisfiableTestingItem* setOrderingQueued(bool queued); bool hasIndirectSuccessorsItems(); COptimizedConceptSaturationSatisfiableTestingItem* setIndirectSuccessorsItems(bool hasSuccessors); bool hasPilingReferenceItem(); COptimizedConceptSaturationSatisfiableTestingItem* setPilingReferenceItem(bool piledReference); bool hasMultipleDirectPredecessorsItems(); COptimizedConceptSaturationSatisfiableTestingItem* setMultipleDirectPredecessorsItems(bool multiblePredItems); // for piling saturation algorithm enum SATURATIONITEMREFERENCESPECIALMODE { NONESATURATIONMODE, SATURATIONCOPYMODE, SATURATIONPILINGMODE, SATURATIONSUBSTITUTEMODE }; COptimizedConceptSaturationSatisfiableTestingItem* getSpecialItemReference(); COptimizedConceptSaturationSatisfiableTestingItem* setSpecialItemReference(COptimizedConceptSaturationSatisfiableTestingItem* reference); SATURATIONITEMREFERENCESPECIALMODE getSpecialReferenceMode(); COptimizedConceptSaturationSatisfiableTestingItem* setSpecialItemReferenceMode(SATURATIONITEMREFERENCESPECIALMODE mode); // protected methods protected: // protected variables protected: CConcept* mConceptSat; QList mExistReferenceItemList; bool mOrderingQueued; bool mPilingReference; bool mSucessorsItems; bool mMultiplePredItems; CConceptReferenceLinking* mConRefLinking; COptimizedConceptSaturationSatisfiableTestingItem* mSpecialItemReference; SATURATIONITEMREFERENCESPECIALMODE mSpecialReferenceMode; //QString mSubsumingConceptString; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDCONCEPTSATURATIONSATISFIABLETESTINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CRolePossibleSubsumptionMap.cpp0000644000175000017500000000176312405707542030261 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassPossibleSubsumptionMap.h" namespace Konclude { namespace Reasoner { namespace Classifier { }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelDeterministicFlag.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelDeterminist0000644000175000017500000000400012520550746032444 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELDETERMINISTICFLAG_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELDETERMINISTICFLAG_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Classifier { /*! * * \class CClassificationClassPseudoModelDeterministicFlag * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationClassPseudoModelDeterministicFlag { // public methods public: //! Constructor CClassificationClassPseudoModelDeterministicFlag(); bool isDeterministic() const; bool isNonDeterministic() const; bool setDeterministic(bool deterministic); // protected methods protected: // protected variables protected: bool mDeterministicFlag; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELDETERMINISTICFLAG_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedSubClassSatisfiableTestingItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedSubClassSatisfiableTestingItem.c0000644000175000017500000002140212520550762032326 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedSubClassSatisfiableTestingItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedSubClassSatisfiableTestingItem::COptimizedSubClassSatisfiableTestingItem() { } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::initSatisfiableTestingItem(CConcept* satTestConcept) { mConceptSat = satTestConcept; mConSatHierNode = nullptr; mPredCounter = 0; mSatTestedResult = false; mSatTestOrdered = false; mTestedSat = false; mUnsatDerivated = false; mSatDerivated = false; mEquiItem = false; mPredOfItem = false; mFastSatCacheEntry = nullptr; mSuccFastSatTested = false; mIndiDepTracked = false; return this; } CConcept* COptimizedSubClassSatisfiableTestingItem::getSatisfiableConcept() { return mConceptSat; } CHierarchyNode* COptimizedSubClassSatisfiableTestingItem::getSatisfiableConceptHierarchyNode() { return mConSatHierNode; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::setSatisfiableConceptHierarchyNode(CHierarchyNode* hierNode) { mConSatHierNode = hierNode; return this; } QSet* COptimizedSubClassSatisfiableTestingItem::getSubsumingConceptItemSet() { return &mSubsumingConceptItemSet; } QList* COptimizedSubClassSatisfiableTestingItem::getSubsumingConceptItemList() { return &mSubsumingConceptItemList; } cint64 COptimizedSubClassSatisfiableTestingItem::getSubsumingConceptItemCount() const { return mSubsumingConceptItemSet.count(); } QList* COptimizedSubClassSatisfiableTestingItem::getSuccessorItemList() { return &mSuccList; } cint64 COptimizedSubClassSatisfiableTestingItem::getUnprocessedPredecessorItemCount() { return mPredCounter; } bool COptimizedSubClassSatisfiableTestingItem::hasOnlyProcessedPredecessorItems() { return mPredCounter <= 0; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::decUnprocessedPredecessorItems(cint64 decCount) { mPredCounter -= decCount; return this; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::incUnprocessedPredecessorItems(cint64 incCount) { mPredCounter += incCount; return this; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::setUnprocessedPredecessorItems(cint64 count) { mPredCounter = count; return this; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::addSuccessorSatisfiableTestItem(COptimizedSubClassSatisfiableTestingItem* succItem) { mSuccList.append(succItem); return this; } bool COptimizedSubClassSatisfiableTestingItem::isSatisfiableTestOrdered() { return mSatTestOrdered; } bool COptimizedSubClassSatisfiableTestingItem::isSatisfiableTested() { return mTestedSat; } bool COptimizedSubClassSatisfiableTestingItem::isResultUnsatisfiableDerivated() { return mUnsatDerivated; } bool COptimizedSubClassSatisfiableTestingItem::isResultSatisfiableDerivated() { return mSatDerivated; } bool COptimizedSubClassSatisfiableTestingItem::getSatisfiableTestedResult() { return mSatTestedResult; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::setSatisfiableTestOrdered(bool satTestOrdered) { mSatTestOrdered = satTestOrdered; return this; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::setSatisfiableTested(bool satTested) { mTestedSat = satTested; return this; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::setSatisfiableTestedResult(bool satTestedResult) { mSatTestedResult = satTestedResult; return this; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::setResultUnsatisfiableDerivated(bool unsatDerivated) { mUnsatDerivated = unsatDerivated; return this; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::setResultSatisfiableDerivated(bool satDerivated) { mSatDerivated = satDerivated; return this; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::addSubsumingConceptItem(COptimizedSubClassSatisfiableTestingItem* subsumingItem) { if (!mSubsumingConceptItemSet.contains(subsumingItem)) { mSubsumingConceptItemList.append(subsumingItem); mSubsumingConceptItemSet.insert(subsumingItem); //QString iriClassNameString = CIRIName::getRecentIRIName(subsumingItem->getSatisfiableConcept()->getClassNameLinker()); //mSubsumingConceptString += QString("%1\r\n").arg(iriClassNameString); } return this; } CConceptSubsumerObserver* COptimizedSubClassSatisfiableTestingItem::tellConceptSupsumption(CConcept* subsumedConcept, CConcept* subsumerConcept) { if (subsumerConcept->getOperatorCode() != CCTOP) { CConceptProcessData* conProData = (CConceptProcessData*)subsumerConcept->getConceptData(); CConceptSatisfiableReferenceLinkingData* conSatRefLinking = (CConceptSatisfiableReferenceLinkingData*)conProData->getConceptReferenceLinking(); if (conSatRefLinking) { COptimizedSubClassSatisfiableTestingItem* subsumerClassSaturationItem = (COptimizedSubClassSatisfiableTestingItem*)conSatRefLinking->getClassifierReferenceLinkingData(); addSubsumingConceptItem(subsumerClassSaturationItem); } } return this; } bool itemSortLessThan(const COptimizedSubClassSatisfiableTestingItem* item1, const COptimizedSubClassSatisfiableTestingItem* item2) { return item1->getSubsumingConceptItemCount() > item2->getSubsumingConceptItemCount(); } QList* COptimizedSubClassSatisfiableTestingItem::sortSubsumingConceptItemList() { qSort(mSubsumingConceptItemList.begin(),mSubsumingConceptItemList.end(),itemSortLessThan); return &mSubsumingConceptItemList; } bool COptimizedSubClassSatisfiableTestingItem::isEquivalentItem() { return mEquiItem; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::setEquivalentItem(bool equivalent) { mEquiItem = equivalent; return this; } bool COptimizedSubClassSatisfiableTestingItem::isPredecessorItem() { return mPredOfItem; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::setPredecessorItem(bool isPredecessorOfOneItem) { mPredOfItem = isPredecessorOfOneItem; return this; } bool COptimizedSubClassSatisfiableTestingItem::isMoreConceptClassificationInformationRequired() { if (mSatTestOrdered || mTestedSat || mUnsatDerivated || mSatDerivated) { return false; } return true; } CCacheEntry* COptimizedSubClassSatisfiableTestingItem::getFastSatisfiabilityTestedSaturationCacheEntry() { return mFastSatCacheEntry; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::setFastSatisfiabilityTestedSaturationCacheEntry(CCacheEntry* cacheEntry) { mFastSatCacheEntry = cacheEntry; return this; } bool COptimizedSubClassSatisfiableTestingItem::hasSuccessfullyFastSatisfiabilityTested() { return mSuccFastSatTested; } COptimizedSubClassSatisfiableTestingItem* COptimizedSubClassSatisfiableTestingItem::setSuccessfullyFastSatisfiabilityTested(bool successfullyTested) { mSuccFastSatTested = successfullyTested; return this; } CIndividualDependenceTrackingMarker* COptimizedSubClassSatisfiableTestingItem::setIndividualDependenceTracked() { mIndiDepTracked = true; return this; } bool COptimizedSubClassSatisfiableTestingItem::hasIndividualDependenceTracked() { return mIndiDepTracked; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationInitializePossibleSubsumptionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationInitializePossibleSubsumpti0000644000175000017500000000354512520550746032561 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationInitializePossibleSubsumptionData.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationInitializePossibleSubsumptionData::CClassificationInitializePossibleSubsumptionData() { mPossSubsumedConcept = nullptr; mValid = true; } CClassificationInitializePossibleSubsumptionData* CClassificationInitializePossibleSubsumptionData::initClassificationPossibleSubsumptionData(CConcept* possSubsumerConcept) { mPossSubsumedConcept = possSubsumerConcept; mValid = true; return this; } CConcept* CClassificationInitializePossibleSubsumptionData::getPossibleSubsumerConcept() { return mPossSubsumedConcept; } bool CClassificationInitializePossibleSubsumptionData::isPossibleSubsumerValid() { return mValid; } CClassificationInitializePossibleSubsumptionData* CClassificationInitializePossibleSubsumptionData::setPossibleSubsumerInvalid() { mValid = false; return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedClassExtractedSaturationSubsumptionClassifierThread.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedClassExtractedSaturationSubsumpt0000644000175000017500000006300212520550756032575 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedClassExtractedSaturationSubsumptionClassifierThread.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedClassExtractedSaturationSubsumptionClassifierThread::COptimizedClassExtractedSaturationSubsumptionClassifierThread(CReasonerManager *reasonerManager) : CSubsumptionClassifierThread(reasonerManager), CLogIdentifier("::Konclude::Reasoner::Kernel::Classifier::OptimizedClassExtractedSaturationSubsumptionClassifierThread",this) { mClassificationCount = 0; satTestedCount = 0; totalToTestCount = 0; } COptimizedClassExtractedSaturationSubsumptionClassifierThread::~COptimizedClassExtractedSaturationSubsumptionClassifierThread() { } CTaxonomy *COptimizedClassExtractedSaturationSubsumptionClassifierThread::createEmptyTaxonomyForOntology(CConcreteOntology *ontology, CConfigurationBase *config) { CTBox *tBox = ontology->getTBox(); CConceptVector *conVec = tBox->getConceptVector(); CConcept *topConcept = conVec->getData(1); CConcept *bottomConcept = conVec->getData(0); CPartialPruningTaxonomy *tax = new CPartialPruningTaxonomy(topConcept,bottomConcept); return tax->readConfig(config); } void COptimizedClassExtractedSaturationSubsumptionClassifierThread::readCalculationConfig(CCalculationConfigurationExtension *config) { mTransitiveReductionAddAllPredecessors = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Classification.TransitiveReduction.AddAllPredecessors",true); } CSubsumptionClassifierThread *COptimizedClassExtractedSaturationSubsumptionClassifierThread::scheduleOntologyClassification(CConcreteOntology *ontology, CTaxonomy *taxonomy, CClassificationCalculationSupport *classificationSupport, CConfigurationBase *config) { COptimizedClassExtractedSaturationOntologyClassificationItem *ontClassItem = new COptimizedClassExtractedSaturationOntologyClassificationItem(config,statistics); ontClassItem->initTaxonomyConcepts(ontology,taxonomy); ontItemList.append(ontClassItem); processingOntItemList.append(ontClassItem); ontItemHash.insert(ontology,ontClassItem); CCalculationConfigurationExtension* calcConfig = ontClassItem->getCalculationConfiguration(); readCalculationConfig(calcConfig); if (CConfigDataReader::readConfigBoolean(ontClassItem->getCalculationConfiguration(),"Konclude.Calculation.Classification.IndividualDependenceTracking",true)) { ontClassItem->setIndividualDependenceTrackingCollector(new CIndividualDependenceTrackingCollector()); } CPartialPruningTaxonomy *parTax = dynamic_cast(taxonomy); if (parTax) { COntologyClassificationItem *ontClassItem = ontItemHash.value(ontology); parTax->createStatistics(ontClassItem->getClassifierStatistics()); } readSubsumptionFromPrecomputedSaturation(ontClassItem); if (satTestedCount == totalToTestCount) { satTestedCount = 0; totalToTestCount = 1; classStartTime.start(); } else { totalToTestCount += 1; } ++mClassificationCount; return this; } void COptimizedClassExtractedSaturationSubsumptionClassifierThread::readSubsumptionFromPrecomputedSaturation(COptimizedClassExtractedSaturationOntologyClassificationItem* ontClassItem) { CTBox *tBox = ontClassItem->getOntology()->getDataBoxes()->getTBox(); CConcreteOntology *onto = ontClassItem->getOntology(); CConcept *topConcept = onto->getDataBoxes()->getTopConcept(); CConcept *bottomConcept = onto->getDataBoxes()->getBottomConcept(); CConceptVector* conVec = tBox->getConceptVector(); LOG(INFO,getLogDomain(),logTr("Read subsumers from precomputed saturation for ontology '%1'.").arg(ontClassItem->getOntology()->getTerminologyName()),getLogObject()); QHash* conceptSatItemHash = ontClassItem->getClassSatisfiableTestItemHash(); QList* satTestItemContainer = ontClassItem->getClassSatisfiableTestItemList(); COptimizedClassExtractedSaturationSatisfiableTestingItem* topItem = ontClassItem->getClassSatisfiableTestItem(topConcept,true); COptimizedClassExtractedSaturationSatisfiableTestingItem* bottomItem = ontClassItem->getClassSatisfiableTestItem(bottomConcept,true); ontClassItem->initTopBottomSatisfiableTestingItems(topItem,bottomItem); CTaxonomy *tax = ontClassItem->getTaxonomy(); CHierarchyNode* bottomHierNode = tax->getBottomHierarchyNode(); CPrecomputedSaturationSubsumerExtractor precSatSubsumerExtractor(onto); QList extClassItemList; CBOXSET *conceptHash = tBox->getActiveClassConceptSet(false); if (conceptHash) { cint64 conCount = conVec->getItemCount(); for (cint64 conIdx = 1; conIdx < conCount; ++conIdx) { CConcept* concept = conVec->getData(conIdx); if (concept) { if (concept->hasClassName() && conceptHash->contains(concept)) { bool unsatFlag = false; bool insuffFlag = false; bool incProcFlag = false; precSatSubsumerExtractor.getConceptFlags(concept,&unsatFlag,&insuffFlag,&incProcFlag); if (unsatFlag) { bottomHierNode->addEquivalentConcept(concept); } else { CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); CConceptSaturationReferenceLinkingData* conRefSatLinking = (CConceptSaturationReferenceLinkingData*)conProcData->getConceptReferenceLinking(); if (!conRefSatLinking) { conRefSatLinking = new CConceptSaturationReferenceLinkingData(); conProcData->setConceptReferenceLinking(conRefSatLinking); } COptimizedClassExtractedSaturationSatisfiableTestingItem* classItem = ontClassItem->getClassSatisfiableTestItem(concept,true); conRefSatLinking->setClassifierReferenceLinkingData(classItem); extClassItemList.append(classItem); } } } } } for (QList::const_iterator it = extClassItemList.constBegin(), itEnd = extClassItemList.constEnd(); it != itEnd; ++it) { COptimizedClassExtractedSaturationSatisfiableTestingItem* classExtTestItem(*it); CConcept* concept = classExtTestItem->getTestingConcept(); cint64 subsumerCount = precSatSubsumerExtractor.getSubsumerCount(concept); classExtTestItem->setExtractionSubsumerCount(subsumerCount); } ontClassItem->decCurrentCalculatingCount(); ++satTestedCount; } COptimizedClassExtractedSaturationSatisfiableTestingItem* getItemForConcept(CConcept* concept) { CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); if (conProcData) { CConceptSaturationReferenceLinkingData* conRefSatLinking = (CConceptSaturationReferenceLinkingData*)conProcData->getConceptReferenceLinking(); if (conRefSatLinking) { COptimizedClassExtractedSaturationSatisfiableTestingItem* classItem = (COptimizedClassExtractedSaturationSatisfiableTestingItem*)conRefSatLinking->getClassifierReferenceLinkingData(); return classItem; } } return nullptr; } bool isDirectSubsumer(CConcept* concept, CConcept* subsumerConcept) { COptimizedClassExtractedSaturationSatisfiableTestingItem* classItem = getItemForConcept(concept);; if (classItem) { cint64 conSubsumerCount = classItem->getExtractionSubsumerCount(); COptimizedClassExtractedSaturationSatisfiableTestingItem* subsumerClassItem = getItemForConcept(subsumerConcept); if (subsumerClassItem) { cint64 subsumerConSubsumerCount = subsumerClassItem->getExtractionSubsumerCount(); if (subsumerConSubsumerCount == conSubsumerCount-1) { return true; } } } return false; } QString COptimizedClassExtractedSaturationSubsumptionClassifierThread::getStatusString() { statUpdateMutex.lock(); QString string = statusString; string.detach(); statUpdateMutex.unlock(); return string; } CClassificationProgress* COptimizedClassExtractedSaturationSubsumptionClassifierThread::getClassificationProgress() { if (satTestedCount != totalToTestCount) { cint64 testedClasses = satTestedCount; cint64 totalClasses = totalToTestCount; cint64 elapsedTime = classStartTime.elapsed(); double remainingMilliSeconds = 0.; double progessPercent = 0.; if (elapsedTime <= 0 && testedClasses > 0) { remainingMilliSeconds = 0.; } else { remainingMilliSeconds = ((double)elapsedTime / (double)satTestedCount) * (totalToTestCount-testedClasses); } if (totalClasses <= 0) { progessPercent = 0.; } else { progessPercent = ((double)testedClasses / (double)totalClasses) * 100.; } cint64 classificCount = mClassificationCount; mClassifyProgess.setClassificationCount(classificCount); mClassifyProgess.setProgessPercent(progessPercent); mClassifyProgess.setRemainingMilliSeconds(remainingMilliSeconds); mClassifyProgess.setTestedClasses(testedClasses); mClassifyProgess.setTotalClasses(totalClasses); } else { mClassifyProgess.setProgessPercent(0.); mClassifyProgess.setRemainingMilliSeconds(0.); mClassifyProgess.setTestedClasses(satTestedCount); mClassifyProgess.setTotalClasses(totalToTestCount); } return &mClassifyProgess; } bool COptimizedClassExtractedSaturationSubsumptionClassifierThread::createNextSubsumtionTest() { COntologyClassificationItem *loopOntClassItem = 0; bool workTestCreated = false; while (!workTestCreated && !processingOntItemList.isEmpty()) { COntologyClassificationItem *ontClassItem = processingOntItemList.first(); if (ontClassItem == loopOntClassItem) { // don't run into infinite loop without doing something break; } COptimizedClassExtractedSaturationOntologyClassificationItem *optSubClassItem = (COptimizedClassExtractedSaturationOntologyClassificationItem *)ontClassItem; if (!workTestCreated) { if (optSubClassItem || ontClassItem->isTaxonomyConstructionFailed()) { finishOntologyClassification(ontClassItem); processingOntItemList.removeFirst(); } else { processingOntItemList.removeFirst(); processingOntItemList.append(ontClassItem); loopOntClassItem = ontClassItem; } } } return workTestCreated; } bool COptimizedClassExtractedSaturationSubsumptionClassifierThread::interpreteTestResults(CTestCalculatedCallbackEvent *testResult) { return false; } bool itemSortLessThan(const COptimizedClassExtractedSaturationSatisfiableTestingItem* item1, const COptimizedClassExtractedSaturationSatisfiableTestingItem* item2) { return item1->getExtractionSubsumerCount() < item2->getExtractionSubsumerCount(); } bool COptimizedClassExtractedSaturationSubsumptionClassifierThread::finishOntologyClassification(COntologyClassificationItem *ontClassItem) { if (!ontClassItem->isTaxonomyConstructed() && !ontClassItem->isTaxonomyConstructionFailed()) { CTaxonomy *taxonomy = ontClassItem->getTaxonomy(); CConcreteOntology *ontology = ontClassItem->getOntology(); LOG(INFO,getLogDomain(),logTr("Building class taxonomy for ontology '%1'.").arg(ontology->getTerminologyName()),getLogObject()); #ifdef OPTIMIZEDCLASSEXTRACTEDSATURATIONCLASSIFIERDEBUGLOGOUTPUT LOG(INFO,getLogDomain(),QString("Building Class Taxonomy"),this); #endif // build taxonomy COptimizedClassExtractedSaturationOntologyClassificationItem *optSubClassItem = (COptimizedClassExtractedSaturationOntologyClassificationItem *)ontClassItem; QList* satItemList = optSubClassItem->getClassSatisfiableTestItemList(); COptimizedClassExtractedSaturationSatisfiableTestingItem* bottomItem = optSubClassItem->getBottomConceptSatisfiableTestItem(); CTaxonomy *tax = optSubClassItem->getTaxonomy(); QList itemList; COptimizedClassExtractedSaturationSatisfiableTestingItem* topItem = optSubClassItem->getTopConceptSatisfiableTestItem(); CHierarchyNode* topHierNode = tax->getTopHierarchyNode(); CHierarchyNode* bottomHierNode = tax->getBottomHierarchyNode(); CPrecomputedSaturationSubsumerExtractor precSatSubsumerExtractor(ontology); cint64 topSubsumingItemCount = topItem->getExtractionSubsumerCount(); topItem->setSatisfiableConceptHierarchyNode(topHierNode); if (topSubsumingItemCount > 0) { precSatSubsumerExtractor.extractSubsumers(topItem->getTestingConcept(),topItem); QList* subsumingConceptItemList = topItem->sortSubsumingConceptItemList(); for (QList::const_iterator subsumedIt = subsumingConceptItemList->constBegin(), subsumedItEnd = subsumingConceptItemList->constEnd(); subsumedIt != subsumedItEnd; ++subsumedIt) { COptimizedClassExtractedSaturationSatisfiableTestingItem* subsumedConceptItem = *subsumedIt; // mark as equivalent subsumedConceptItem->setEquivalentItem(true); topHierNode->addEquivalentConcept(subsumedConceptItem->getTestingConcept()); tax->updateNodeEquivalences(topHierNode); } } qSort(satItemList->begin(),satItemList->end(),itemSortLessThan); for (QList::const_iterator it = satItemList->constBegin(), itEnd = satItemList->constEnd(); it != itEnd; ++it) { COptimizedClassExtractedSaturationSatisfiableTestingItem* item = *it; if (!item->isEquivalentItem() && item != bottomItem && item != topItem) { CHierarchyNode* itemNode = tax->getHierarchyNode(item->getTestingConcept(),true); item->setSatisfiableConceptHierarchyNode(itemNode); cint64 itemSubsumingCount = item->getExtractionSubsumerCount(); itemList.append(item); if (itemSubsumingCount > topSubsumingItemCount) { CConcept* directSubsumerConcept = precSatSubsumerExtractor.getDirectSubsumerCount(item->getTestingConcept(),&isDirectSubsumer); bool requiresDetailedSubsumerSearch = true; if (directSubsumerConcept) { COptimizedClassExtractedSaturationSatisfiableTestingItem* directSubsumerItem = getItemForConcept(directSubsumerConcept); if (!directSubsumerItem->isEquivalentItem()) { item->setDirectSubsumer(directSubsumerItem); requiresDetailedSubsumerSearch = false; } } if (requiresDetailedSubsumerSearch) { precSatSubsumerExtractor.extractSubsumers(item->getTestingConcept(),item); QList* subsumingConceptItemList = item->sortSubsumingConceptItemList(); for (QList::const_iterator subsumedIt = subsumingConceptItemList->constBegin(), subsumedItEnd = subsumingConceptItemList->constEnd(); subsumedIt != subsumedItEnd; ++subsumedIt) { COptimizedClassExtractedSaturationSatisfiableTestingItem* subsumedConceptItem = *subsumedIt; cint64 subsumedItemSubsumingCount = subsumedConceptItem->getExtractionSubsumerCount(); if (subsumedItemSubsumingCount == itemSubsumingCount) { // mark as equivalent subsumedConceptItem->setEquivalentItem(true); itemNode->addEquivalentConcept(subsumedConceptItem->getTestingConcept()); tax->updateNodeEquivalences(itemNode); } else { break; } } } } } } for (QList::const_iterator it = itemList.constBegin(), itEnd = itemList.constEnd(); it != itEnd; ++it) { COptimizedClassExtractedSaturationSatisfiableTestingItem* item = *it; if (!item->isEquivalentItem() && item != topItem) { cint64 itemSubsumingCount = item->getExtractionSubsumerCount(); CHierarchyNode* itemHierNode = item->getSatisfiableConceptHierarchyNode(); if (item->hasDirectSubsumer()) { if (mTransitiveReductionAddAllPredecessors) { itemHierNode->addPredecessorNode(topHierNode); } COptimizedClassExtractedSaturationSatisfiableTestingItem* directSubsumerItem = item->getDirectSubsumer(); directSubsumerItem->setPredecessorItem(true); CHierarchyNode* subsumedHierNode = directSubsumerItem->getSatisfiableConceptHierarchyNode(); itemHierNode->makeParent(subsumedHierNode); QSet* predSet = subsumedHierNode->getPredecessorNodeSet(); if (mTransitiveReductionAddAllPredecessors) { for (QSet::const_iterator itPred = predSet->constBegin(), itPredEnd = predSet->constEnd(); itPred != itPredEnd; ++itPred) { CHierarchyNode* predNode(*itPred); itemHierNode->addPredecessorNode(predNode); } } } else { QList* subsumingConceptItemList = item->getSubsumingConceptItemList(); QList::const_iterator subsumedIt = subsumingConceptItemList->constBegin(), subsumedItEnd = subsumingConceptItemList->constEnd(); cint64 eqCount = 0; cint64 remainingSubsumingCount = itemSubsumingCount; // remove direct equivalences while (subsumedIt != subsumedItEnd) { COptimizedClassExtractedSaturationSatisfiableTestingItem* subsumedConceptItem = *subsumedIt; cint64 subsumedItemSubsumingCount = subsumedConceptItem->getExtractionSubsumerCount(); if (subsumedItemSubsumingCount != itemSubsumingCount) { break; } else { ++eqCount; ++subsumedIt; } } while (subsumedIt != subsumedItEnd && (*subsumedIt)->isEquivalentItem()) { ++subsumedIt; } // find first parent if (subsumedIt == subsumedItEnd) { // no parent, use top as parent itemHierNode->makeParent(topHierNode); } else { while (subsumedIt != subsumedItEnd) { COptimizedClassExtractedSaturationSatisfiableTestingItem* subsumedConceptItem = *subsumedIt; if (!subsumedConceptItem->isEquivalentItem()) { remainingSubsumingCount -= makeParentAddPredeccessors(item,subsumedConceptItem,remainingSubsumingCount,true); ++subsumedIt; break; } else { ++subsumedIt; } } while (subsumedIt != subsumedItEnd && (remainingSubsumingCount > 0)) { COptimizedClassExtractedSaturationSatisfiableTestingItem* subsumedConceptItem = *subsumedIt; if (!subsumedConceptItem->isEquivalentItem()) { remainingSubsumingCount -= makeParentAddPredeccessors(item,subsumedConceptItem,remainingSubsumingCount,false); } ++subsumedIt; } //bool searchForMoreParents = remainingSubsumingCount > 0; //while (subsumedIt != subsumedItEnd) { // COptimizedClassExtractedSaturationSatisfiableTestingItem* subsumedConceptItem = *subsumedIt; // if (!subsumedConceptItem->isEquivalentItem()) { // bool predOfOnePrevParent = false; // if (searchForMoreParents) { // for (QList::const_iterator parentIt = parentItemList.constBegin(), parentItEnd = parentItemList.constEnd(); parentIt != parentItEnd && !predOfOnePrevParent; ++parentIt) { // COptimizedClassExtractedSaturationSatisfiableTestingItem* parentItem = *parentIt; // if (precSatSubsumerExtractor.hasSubsumerConcept(parentItem->getTestingConcept(),subsumedConceptItem->getTestingConcept())) { // predOfOnePrevParent = true; // } // } // } // subsumedConceptItem->setPredecessorItem(true); // CHierarchyNode* subsumedHierNode = subsumedConceptItem->getSatisfiableConceptHierarchyNode(); // if (!predOfOnePrevParent && searchForMoreParents) { // itemHierNode->makeParent(subsumedHierNode); // parentItemList.append(subsumedConceptItem); // } else { // if (mTransitiveReductionAddAllPredecessors) { // itemHierNode->addPredecessorNode(subsumedHierNode); // } // } // } // ++subsumedIt; //} } } } } for (QList::const_iterator it = itemList.constBegin(), itEnd = itemList.constEnd(); it != itEnd; ++it) { COptimizedClassExtractedSaturationSatisfiableTestingItem* item = *it; if (!item->isPredecessorItem() && !item->isEquivalentItem()) { CHierarchyNode* itemHierNode = item->getSatisfiableConceptHierarchyNode(); bottomHierNode->makeParent(itemHierNode); } } #ifdef OPTIMIZEDCLASSEXTRACTEDSATURATIONCLASSIFIERDEBUGSTATUSDESCRIPTION statUpdateMutex.lock(); statusString = QString("Finished ontology classification"); statUpdateMutex.unlock(); #endif CClassification* classification = ontology->getClassification(); if (classification) { CClassConceptClassification* classConClassification = ontClassItem->getClassConceptClassification(); CClassificationStatisticsCollectionStrings* classifStatCollStrings = ontClassItem->getClassificationStatisticsCollectionStrings(); CClassifierStatistics* classifierStats = ontClassItem->getClassifierStatistics(); classifStatCollStrings->addProcessingStatistics("class-classification-total-satisfiable-test-count",classifierStats->getTotalSatisfiableCount()); classConClassification->setClassConceptTaxonomy(taxonomy); classConClassification->setClassificationStatistics(classifStatCollStrings); if (ontClassItem->getIndividualDependenceTrackingCollector()) { classConClassification->setDependentIndividualsTracking(ontClassItem->getIndividualDependenceTrackingCollector()->getExtendingIndividualDependenceTracking()); } classification->setClassConceptClassification(classConClassification); } ontology->setConceptTaxonomy(taxonomy); ontClassItem->setGoneOutRemainingTests(false); taxonomy->setTaxonomyComplete(true); --mClassificationCount; LOG(INFO,getLogDomain(),logTr("Ontology '%1' classified.").arg(ontology->getTerminologyName()),getLogObject()); } ontClassItem->submitTaxonomyConstructed(); ontClassItem->doClassifiedCallback(); return true; } bool COptimizedClassExtractedSaturationSubsumptionClassifierThread::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CSubsumptionClassifierThread::processCustomsEvents(type,event)) { return true; } return false; } cint64 COptimizedClassExtractedSaturationSubsumptionClassifierThread::makeParentAddPredeccessors(COptimizedClassExtractedSaturationSatisfiableTestingItem* conceptItem, COptimizedClassExtractedSaturationSatisfiableTestingItem* subsumedConceptItem, cint64 remainingSubsumingResolvingCount, bool firstResolve) { CHierarchyNode* node = conceptItem->getSatisfiableConceptHierarchyNode(); CHierarchyNode* newParentNode = subsumedConceptItem->getSatisfiableConceptHierarchyNode(); cint64 resolvedExtSubsumerCount = 0; if (!node->hasPredecessorNode(newParentNode)) { if (firstResolve) { resolvedExtSubsumerCount = subsumedConceptItem->getExtractionSubsumerCount(); } else { resolvedExtSubsumerCount = newParentNode->getEquivalentConceptCount(); } node->addParentNode(newParentNode); newParentNode->addChildNode(node); if (mTransitiveReductionAddAllPredecessors || resolvedExtSubsumerCount != remainingSubsumingResolvingCount) { resolvedExtSubsumerCount = 0; QList predAddList; predAddList.append(newParentNode); while (!predAddList.isEmpty()) { CHierarchyNode* nextPredNode = predAddList.takeFirst(); if (!node->hasPredecessorNode(nextPredNode)) { node->addPredecessorNode(nextPredNode); //nextPredNode->addSuccessorNode(node); resolvedExtSubsumerCount += nextPredNode->getEquivalentConceptCount(); QSet* nextParentPredSet = nextPredNode->getParentNodeSet(); for (QSet::const_iterator it = nextParentPredSet->constBegin(), itEnd = nextParentPredSet->constEnd(); it != itEnd; ++it) { CHierarchyNode* nextPredPredNode(*it); predAddList.append(nextPredPredNode); } } } } else { node->makePredecessor(newParentNode); } } return resolvedExtSubsumerCount; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedClassExtractedSaturationSubsumptionClassifierThread.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedClassExtractedSaturationSubsumpt0000644000175000017500000001017212520550756032575 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDCLASSEXTRACTEDSATURATIONSUBSUMPTIONCLASSIFIERTHREAD_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDCLASSEXTRACTEDSATURATIONSUBSUMPTIONCLASSIFIERTHREAD_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CSubsumptionClassifier.h" #include "CSubsumptionClassifierThread.h" #include "CPartialPruningTaxonomy.h" #include "CPrecomputedSaturationSubsumerExtractor.h" #include "COptimizedClassExtractedSaturationOntologyClassificationItem.h" // Other includes #include "Reasoner/Revision/COntologyRevision.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h" #include "KoncludeSettings.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include using namespace std; namespace Konclude { namespace Reasoner { using namespace Revision; using namespace Ontology; using namespace Kernel; namespace Classifier { /*! * * \class COptimizedClassExtractedSaturationSubsumptionClassifierThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedClassExtractedSaturationSubsumptionClassifierThread : public CSubsumptionClassifierThread, public CLogIdentifier { // public methods public: //! Constructor COptimizedClassExtractedSaturationSubsumptionClassifierThread(CReasonerManager *reasonerManager); //! Destructor virtual ~COptimizedClassExtractedSaturationSubsumptionClassifierThread(); virtual QString getStatusString(); virtual CClassificationProgress* getClassificationProgress(); // protected methods protected: virtual bool finishOntologyClassification(COntologyClassificationItem *ontClassItem); virtual CSubsumptionClassifierThread *scheduleOntologyClassification(CConcreteOntology *ontology, CTaxonomy *taxonomy, CClassificationCalculationSupport *classificationSupport, CConfigurationBase *config); virtual void readCalculationConfig(CCalculationConfigurationExtension *config); virtual bool interpreteTestResults(CTestCalculatedCallbackEvent *testResult); virtual bool createNextSubsumtionTest(); virtual CTaxonomy *createEmptyTaxonomyForOntology(CConcreteOntology *ontology, CConfigurationBase *config); virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); void readSubsumptionFromPrecomputedSaturation(COptimizedClassExtractedSaturationOntologyClassificationItem* ontClassItem); cint64 makeParentAddPredeccessors(COptimizedClassExtractedSaturationSatisfiableTestingItem* conceptItem, COptimizedClassExtractedSaturationSatisfiableTestingItem* subsumedConceptItem, cint64 remainingSubsumingResolvingCount, bool firstResolve); // protected variables protected: QString statusString; QMutex statUpdateMutex; bool mTransitiveReductionAddAllPredecessors; CClassificationProgress mClassifyProgess; QTime classStartTime; cint64 satTestedCount; cint64 totalToTestCount; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDCLASSEXTRACTEDSATURATIONSUBSUMPTIONCLASSIFIERTHREAD_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodePredecessorPositionClassificationItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodePredecessorPositionClassificationItem0000644000175000017500000000505012520550754032463 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CNODEPREDECESSORPOSITIONCLASSIFICATIONITEM_H #define KONCLUDE_REASONER_CLASSIFIER_CNODEPREDECESSORPOSITIONCLASSIFICATIONITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassifierStatistics.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Taxonomy/CTaxonomy.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Taxonomy; namespace Classifier { /*! * * \class CNodePredecessorPositionClassificationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNodePredecessorPositionClassificationItem { // public methods public: //! Constructor CNodePredecessorPositionClassificationItem(CHierarchyNode *node); //! Destructor virtual ~CNodePredecessorPositionClassificationItem(); virtual CHierarchyNode *getTestingNode(); virtual CNodePredecessorPositionClassificationItem *appendPredecessorNode(CHierarchyNode *node); virtual QList *getPredecessorNodeList(); virtual QList *getInitializationPredecessorNodeList(); virtual bool isTestingConcluded(); // protected methods protected: // protected variables protected: CHierarchyNode *testNode; QList predNodelist; QList initPredNodelist; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CNODEPREDECESSORPOSITIONCLASSIFICATIONITEM_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionMap.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionMap.0000644000175000017500000000573512520550760032351 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETROLEPOSSIBLESUBSUMPTIONMAP_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETROLEPOSSIBLESUBSUMPTIONMAP_H // Libraries includes #include // Namespace includes #include "ClassifierSettings.h" #include "CClassPossibleSubsumptionMap.h" #include "COptimizedKPSetRolePossibleSubsumptionData.h" #include "COptimizedKPSetRolePossibleSubsumptionMapIterator.h" // Other includes #include "Reasoner/Ontology/CConceptTagComparer.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class COptimizedKPSetRolePossibleSubsumptionMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetRolePossibleSubsumptionMap : public QMap, public CClassPossibleSubsumptionMap { // public methods public: //! Constructor COptimizedKPSetRolePossibleSubsumptionMap(); bool isPossibleSubsumptionUpdateRequired(); cint64 getRemainingPossibleSubsumptionCount(); COptimizedKPSetRolePossibleSubsumptionMap* setRemainingPossibleSubsumptionCount(cint64 possSubsumCount); COptimizedKPSetRolePossibleSubsumptionMap* decRemainingPossibleSubsumptionCount(cint64 decCount = 1); COptimizedKPSetRolePossibleSubsumptionMap* incRemainingPossibleSubsumptionCount(cint64 incCount = 1); COptimizedKPSetRolePossibleSubsumptionMap* setPossibleSubsumptionUpdateRequired(bool requiredUpdate = true); bool hasRemainingPossibleSubsumptions(); CClassPossibleSubsumptionMapIterator* getIterator(CClassPossibleSubsumptionMapIterator* reuseIterator, CContext* context); // protected methods protected: // protected variables protected: bool mRequirePossibleSubsumptionUpdate; cint64 mRemainingPossibleSubsumptionCount; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETROLEPOSSIBLESUBSUMPTIONMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModel.cpp0000644000175000017500000000263312520550744031025 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationClassPseudoModel.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationClassPseudoModel::CClassificationClassPseudoModel() { mPMDataHash = nullptr; } CClassificationClassPseudoModelHash* CClassificationClassPseudoModel::getPseudoModelHash() { return mPMDataHash; } CClassificationClassPseudoModel* CClassificationClassPseudoModel::setPseudoModelHash(CClassificationClassPseudoModelHash* pmHash) { mPMDataHash = pmHash; return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CPartialPruningHierarchyNode.h0000644000175000017500000000556712520550762030025 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CPARTIALPRUNINGHIERARCHYNODE_H #define KONCLUDE_REASONER_CLASSIFIER_CPARTIALPRUNINGHIERARCHYNODE_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassifierStatistics.h" // Other includes #include "Reasoner/Taxonomy/CHierarchyNode.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Taxonomy; namespace Classifier { /*! * * \class CPartialPruningHierarchyNode * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPartialPruningHierarchyNode : public CHierarchyNode { // public methods public: //! Constructor CPartialPruningHierarchyNode(CConcept *representiveConcept); //! Destructor virtual ~CPartialPruningHierarchyNode(); virtual CHierarchyNode *repairParentNodeInsertion(CHierarchyNode *replacedParentNodeCandidate, CClassifierStatistics *statistics = 0); virtual CHierarchyNode *repairChildsParentNodeReplacement(CHierarchyNode *replacedParentNodeCandidate, CClassifierStatistics *statistics = 0); virtual CHierarchyNode *mergeToParentNode(CHierarchyNode *mergeParentDirection, CClassifierStatistics *statistics = 0); virtual CHierarchyNode *propagateTransitiveRelations(CClassifierStatistics *statistics = 0); virtual CHierarchyNode *propagateTransitivePredecessorRelation(CHierarchyNode *transAddPredNode, CClassifierStatistics *statistics = 0); virtual CHierarchyNode *pruneTransitiveRelations(CHierarchyNode *incompNode, CClassifierStatistics *statistics = 0); CHierarchyNode* repairChildNodes(CClassifierStatistics *statistics); CHierarchyNode* repairParentNodes(CClassifierStatistics *statistics); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CPARTIALPRUNINGHIERARCHYNODE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationCalculationSupport.h0000644000175000017500000000365212520550744031121 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCALCULATIONSUPPORT_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCALCULATIONSUPPORT_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Classifier { /*! * * \class CClassificationCalculationSupport * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationCalculationSupport { // public methods public: //! Constructor CClassificationCalculationSupport(); //! Destructor virtual ~CClassificationCalculationSupport(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCALCULATIONSUPPORT_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelConceptData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelConceptData0000644000175000017500000000240412520550744032346 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationClassPseudoModelConceptData.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationClassPseudoModelConceptData::CClassificationClassPseudoModelConceptData() { } CClassificationClassPseudoModelConceptData::CClassificationClassPseudoModelConceptData(bool deterministic) { setDeterministic(deterministic); } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelRoleData.h0000644000175000017500000000565112520550746032113 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELROLEDATA_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELROLEDATA_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationClassPseudoModelDeterministicFlag.h" // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Classifier { /*! * * \class CClassificationClassPseudoModelRoleData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationClassPseudoModelRoleData : public CClassificationClassPseudoModelDeterministicFlag { // public methods public: //! Constructor CClassificationClassPseudoModelRoleData(); cint64 getLowerAtLeastBound(); cint64 getUpperAtLeastBound(); cint64 getLowerAtMostBound(); cint64 getUpperAtMostBound(); cint64 getSuccessorModelID() const; bool setLowerAtLeastBound(cint64 bound); bool setUpperAtLeastBound(cint64 bound); bool setLowerAtMostBound(cint64 bound); bool setUpperAtMostBound(cint64 bound); bool setSuccessorModelID(cint64 modelID); bool isPossibleSubsumerOf(const CClassificationClassPseudoModelRoleData& possibleSubsumedData) const; // protected methods protected: // protected variables protected: // lower at-least bound, the maximum deterministically instanced at-least concept cint64 mLowerAtLeast; // upper at-least bound, the number of successor nodes cint64 mUpperAtLeast; // upper at-most bound, the minimal deterministically instanced at-most concept cint64 mUpperAtMost; // lower at-most bound, the number of successor nodes cint64 mLowerAtMost; cint64 mSuccessorModel; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELROLEDATA_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionData0000644000175000017500000000522012520550760032414 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETROLEPOSSIBLESUBSUMPTIONDATA_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETROLEPOSSIBLESUBSUMPTIONDATA_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Classifier { /*! * * \class COptimizedKPSetRolePossibleSubsumptionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetRolePossibleSubsumptionData { // public methods public: //! Constructor COptimizedKPSetRolePossibleSubsumptionData(COptimizedKPSetRoleTestingItem* item); bool isUpdateRequired(); bool isSubsumptionUpdated(); COptimizedKPSetRolePossibleSubsumptionData* setSubsumptionUpdated(bool updated); bool isSubsumptionConfirmed(); COptimizedKPSetRolePossibleSubsumptionData* setSubsumptionConfirmed(bool confirmedSubsumption); bool isSubsumptionInvalided(); COptimizedKPSetRolePossibleSubsumptionData* setSubsumptionInvalid(bool invalidSubsumption); bool isSubsumptionKnown(); bool isSubsumptionUnknown(); COptimizedKPSetRoleTestingItem* getTestingItem(); COptimizedKPSetRolePossibleSubsumptionData* setTestingItem(COptimizedKPSetRoleTestingItem* item); // protected methods protected: // protected variables protected: COptimizedKPSetRoleTestingItem* mTestingItem; bool mSubsumptionInvalidFlag; bool mSubsumptionConfirmedFlag; bool mSubsumptionUpdatedFlag; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETROLEPOSSIBLESUBSUMPTIONDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodeTopDownTraversalClassificationItem.h0000644000175000017500000001141212520550756032165 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CNODETOPDOWNTRAVERSALCLASSIFICATIONITEM_H #define KONCLUDE_REASONER_CLASSIFIER_CNODETOPDOWNTRAVERSALCLASSIFICATIONITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassifierStatistics.h" #include "CNodeBlockedClassificationItem.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Taxonomy/CTaxonomy.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Taxonomy; namespace Classifier { /*! * * \class CNodeTopDownTraversalClassificationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNodeTopDownTraversalClassificationItem : public CNodeBlockedClassificationItem { // public methods public: //! Constructor CNodeTopDownTraversalClassificationItem(CHierarchyNode *node, CHierarchyNode *topNode, QList *lockedReleaseProcessingList); //! Destructor virtual ~CNodeTopDownTraversalClassificationItem(); CNodeBlockedClassificationItem *releaseBlockedResumeProcessing(); CNodeBlockedClassificationItem *releaseTestingBlockedResumeProcessing(CConcept *subsumerConcept, CConcept *subsumedConcept, bool testingResult); CHierarchyNode *getTraversalNode(); QList *getTestingNodeList(); CNodeTopDownTraversalClassificationItem *appendTestingNodeList(QList &nodeList); CNodeTopDownTraversalClassificationItem *appendTestingNode(CHierarchyNode *node); QList *getParentNodeList(); CNodeTopDownTraversalClassificationItem *appendParentNodeList(QList &nodeList); CNodeTopDownTraversalClassificationItem *appendParentNode(CHierarchyNode *parentNode); QList *getBranchLockedNodeList(); CNodeTopDownTraversalClassificationItem *appendBranchLockedNodeList(QList &nodeList); CNodeTopDownTraversalClassificationItem *appendBranchLockedNode(CHierarchyNode *branchNode); bool hasNextTestingNode(); CHierarchyNode *takeNextTestingNode(); CHierarchyNode *getTestingNode(); CNodeTopDownTraversalClassificationItem *clearTestingNode(); bool getTestingResult(); CHierarchyNode *getEquivalentTestingNode(); CNodeTopDownTraversalClassificationItem *setEquivalentTestingNode(CHierarchyNode *equivalentTestingNode); bool hasDirectBranchLockedNode(); CHierarchyNode *getDirectBranchLockedNode(); CNodeTopDownTraversalClassificationItem *setDirectBranchLockedNode(CHierarchyNode *parentLockedNode); QList *getNewBranchNodeList(); CNodeTopDownTraversalClassificationItem *appendNewBranchNodeList(QList &nodeList); CNodeTopDownTraversalClassificationItem *appendNewBranchNode(CHierarchyNode *branchNode); CNodeTopDownTraversalClassificationItem* setAlreadyTraversedDirectBlockedSuccessorNode(bool alredyTraversed); bool hasAlreadyTraversedDirectBlockedSuccessorNode(); // protected methods protected: // protected variables protected: CHierarchyNode *traversalNode; CHierarchyNode *parLockNode; CHierarchyNode *testNode; CHierarchyNode *eqTestNode; QList testingNodeList; QList branchLockedNodeList; QList newBranchNodeList; QList parentNodeList; QSet branchLockedNodeSet; QList *lockedReleaseProcList; bool subSumTestingResult; bool alredyTraversedDirectBlockedSuccessorNode; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CNODETOPDOWNTRAVERSALCLASSIFICATIONITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassifiedCallbackDataContext.h0000644000175000017500000000441312520550752030227 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFIEDCALLBACKDATACONTEXT_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFIEDCALLBACKDATACONTEXT_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes #include "Concurrent/Callback/CCallbackDataContext.h" #include "Reasoner/Taxonomy/CTaxonomy.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; namespace Reasoner { using namespace Taxonomy; using namespace Ontology; namespace Classifier { /*! * * \class CClassifiedCallbackDataContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassifiedCallbackDataContext : public CCallbackDataContext { // public methods public: //! Constructor CClassifiedCallbackDataContext(CTaxonomy *taxanomy, CConcreteOntology *ontology); //! Destructor virtual ~CClassifiedCallbackDataContext(); virtual CConcreteOntology *getOntology(); virtual CTaxonomy *getTaxonomy(); // protected methods protected: // protected variables protected: CTaxonomy *tax; CConcreteOntology *onto; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFIEDCALLBACKDATACONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationMessageDataObserver.h0000644000175000017500000000405712520550750031151 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONMESSAGEDATAOBSERVER_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONMESSAGEDATAOBSERVER_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationMessageData.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CClassificationMessageDataObserver * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationMessageDataObserver { // public methods public: //! Constructor CClassificationMessageDataObserver(); virtual CClassificationMessageDataObserver* tellClassificationMessage(CConcreteOntology *ontology, CClassificationMessageData* messageData, CMemoryPool* memoryPool) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONMESSAGEDATAOBSERVER_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedSubClassSubsumptionClassifierThread.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedSubClassSubsumptionClassifierThr0000644000175000017500000001512312520550762032520 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDSUBCLASSSUBSUMPTIONCLASSIFIERTHREAD_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDSUBCLASSSUBSUMPTIONCLASSIFIERTHREAD_H // Libraries includes #include // Namespace includes #include "ClassifierSettings.h" #include "CSubsumptionClassifier.h" #include "CSubsumptionClassifierThread.h" #include "CPartialPruningTaxonomy.h" #include "CClassificationWorkItem.h" #include "COptimizedSubClassOntologyClassificationItem.h" #include "CClassificationSubsumptionMessageData.h" #include "CPrecomputedSaturationSubsumerExtractor.h" // Other includes #include "Reasoner/Revision/COntologyRevision.h" #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptSatisfiableReferenceLinkingData.h" #include "Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h" #include "Reasoner/Generator/CSatisfiableCalculationJobGenerator.h" #include "Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCache.h" #include "Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheReader.h" #include "KoncludeSettings.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include using namespace std; namespace Konclude { namespace Reasoner { using namespace Revision; using namespace Ontology; using namespace Generator; using namespace Kernel; using namespace Task; using namespace Cache; namespace Classifier { #ifndef KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED //#define OPTIMIZEDSUBCLASSCLASSIFIERDEBUGCOUTOUTPUT //#define OPTIMIZEDSUBCLASSCLASSIFIERDEBUGTAXONOMYCOUTOUTPUT //#define OPTIMIZEDSUBCLASSCLASSIFIERDEBUGLOGOUTPUT //#define OPTIMIZEDSUBCLASSCLASSIFIERDEBUGBOXDESCRIPTION #define OPTIMIZEDSUBCLASSCLASSIFIERDEBUGSTATUSDESCRIPTION #endif /*! * * \class COptimizedSubClassSubsumptionClassifierThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedSubClassSubsumptionClassifierThread : public CSubsumptionClassifierThread, public CLogIdentifier { // public methods public: //! Constructor COptimizedSubClassSubsumptionClassifierThread(CReasonerManager *reasonerManager); //! Destructor virtual ~COptimizedSubClassSubsumptionClassifierThread(); virtual QString getStatusString(); virtual CClassificationProgress* getClassificationProgress(); // protected methods protected: virtual bool finishOntologyClassification(COntologyClassificationItem *ontClassItem); virtual CSubsumptionClassifierThread *scheduleOntologyClassification(CConcreteOntology *ontology, CTaxonomy *taxonomy, CClassificationCalculationSupport *classificationSupport, CConfigurationBase *config); virtual CSubsumptionClassifierThread *processCalculationJob(CSatisfiableCalculationJob* job, COntologyClassificationItem *ontClassItem, CClassificationWorkItem* workItem); virtual void readCalculationConfig(CCalculationConfigurationExtension *config); virtual bool interpreteSubsumptionResult(COntologyClassificationItem *ontClassItem, CConcept *subsumerConcept, CConcept *subsumedConcept, bool isSubsumption); virtual bool interpreteSatisfiableResult(COntologyClassificationItem *ontClassItem, CConcept *satisfiableConcept, bool isSatis); virtual bool interpreteTestResults(CTestCalculatedCallbackEvent *testResult); virtual bool createNextSubsumtionTest(); virtual CTaxonomy *createEmptyTaxonomyForOntology(CConcreteOntology *ontology, CConfigurationBase *config); virtual bool interpreteToldSubsumptionResult(COntologyClassificationItem *ontClassItem, const QList > &subSumRelList, bool isSubSum); void createObviousSubsumptionSatisfiableTestingOrder(COptimizedSubClassOntologyClassificationItem* ontClassItem); void createObviousSubsumptionSatisfiableTestingOrderFromBuildData(COptimizedSubClassOntologyClassificationItem* ontClassItem); void createObviousSubsumptionSatisfiableTestingOrderFromSaturationData(COptimizedSubClassOntologyClassificationItem* ontClassItem); bool calculateSatisfiable(COptimizedSubClassOntologyClassificationItem *optSubClassItem, COptimizedSubClassSatisfiableTestingItem* nextSatTestItem); bool fastSatisfiableOnlySubClassPrecheckTest(COptimizedSubClassOntologyClassificationItem *optSubClassItem, COptimizedSubClassSatisfiableTestingItem* nextSatTestItem, bool* isSatisfiableFlag); virtual bool processToldClassificationMessage(COntologyClassificationItem *ontClassItem, CClassificationMessageData* messageData, CMemoryPool* memoryPools); CIndividualSaturationProcessNode* getSaturationIndividualNodeForConcept(CConcept* concept, bool negated); bool hasCachedSaturationIndividualNodeAssociatedExpansionProplematicConcept(CCacheEntry* cacheEntry, CConcept* testingConcept); CCacheEntry* getAssociatedSaturationCacheEntry(COptimizedSubClassSatisfiableTestingItem* classConItem); // protected variables protected: QHash workOntItemHash; QStringList satTestedConList; QString statusString; QMutex statUpdateMutex; CClassificationProgress mClassifyProgess; cint64 satTestedCount; cint64 totalToTestCount; QTime classStartTime; QSet > subsumCalcedSet; CSaturationNodeAssociatedExpansionCache* mSatNodeExpCache; CSaturationNodeAssociatedExpansionCacheReader* mSatNodeExpCacheReader; cint64 mStatFastSubClassCheckCacheTryCount; cint64 mStatFastSubClassCheckCacheSuccCount; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDSUBCLASSSUBSUMPTIONCLASSIFIERTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationProgress.cpp0000644000175000017500000000615112520550750027417 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationProgress.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationProgress::CClassificationProgress() { resetValues(); } qint64 CClassificationProgress::getClassificationCount() { return mClassificationCount; } qint64 CClassificationProgress::getTestedClasses() { return mTestedClasses; } qint64 CClassificationProgress::getTotalClasses() { return mTotalClasses; } qint64 CClassificationProgress::getTestedSubsumptions() { return mTestedSubsum; } qint64 CClassificationProgress::getTotalSubsumptions() { return mTotalSubsum; } double CClassificationProgress::getRemainingMilliSeconds() { return mRemainingMilliSeconds; } double CClassificationProgress::getProgessPercent() { return mProgessPercent; } CClassificationProgress *CClassificationProgress::setClassificationCount(qint64 classificationCount) { mClassificationCount = classificationCount; return this; } CClassificationProgress *CClassificationProgress::setTestedClasses(qint64 testedClasses) { mTestedClasses = testedClasses; return this; } CClassificationProgress *CClassificationProgress::setTotalClasses(qint64 totalClasses) { mTotalClasses = totalClasses; return this; } CClassificationProgress *CClassificationProgress::setTestedSubsumptions(qint64 testedSubsumptions) { mTestedSubsum = testedSubsumptions; return this; } CClassificationProgress *CClassificationProgress::setTotalSubsumptions(qint64 totalSubsumptions) { mTotalSubsum = totalSubsumptions; return this; } CClassificationProgress *CClassificationProgress::setRemainingMilliSeconds(double remainingMilliSeconds) { mRemainingMilliSeconds = remainingMilliSeconds; return this; } CClassificationProgress *CClassificationProgress::setProgessPercent(double progessPercent) { mProgessPercent = progessPercent; return this; } CClassificationProgress *CClassificationProgress::resetValues() { mClassificationCount = 0; mTestedClasses = 0; mTotalClasses = 0; mRemainingMilliSeconds = 0.; mProgessPercent = 0.; mTotalSubsum = 0; mTestedSubsum = 0; return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedClassExtractedSaturationSatisfiableTestingItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedClassExtractedSaturationSatisfia0000644000175000017500000001313612520550756032521 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedClassExtractedSaturationSatisfiableTestingItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedClassExtractedSaturationSatisfiableTestingItem::COptimizedClassExtractedSaturationSatisfiableTestingItem() { } COptimizedClassExtractedSaturationSatisfiableTestingItem* COptimizedClassExtractedSaturationSatisfiableTestingItem::initSatisfiableTestingItem(CConcept* satTestConcept) { mTestConcept = satTestConcept; mExtractedSubsumerCount = 0; mConSatHierNode = nullptr; mDirectSubsumerItem = nullptr; mPredecessorItem = false; mEquiItem = false; return this; } CConcept* COptimizedClassExtractedSaturationSatisfiableTestingItem::getTestingConcept() { return mTestConcept; } CHierarchyNode* COptimizedClassExtractedSaturationSatisfiableTestingItem::getSatisfiableConceptHierarchyNode() { return mConSatHierNode; } COptimizedClassExtractedSaturationSatisfiableTestingItem* COptimizedClassExtractedSaturationSatisfiableTestingItem::setSatisfiableConceptHierarchyNode(CHierarchyNode* hierNode) { mConSatHierNode = hierNode; return this; } QList* COptimizedClassExtractedSaturationSatisfiableTestingItem::getSubsumingConceptItemList() { return &mSubsumingConceptItemList; } COptimizedClassExtractedSaturationSatisfiableTestingItem* COptimizedClassExtractedSaturationSatisfiableTestingItem::setDirectSubsumer(COptimizedClassExtractedSaturationSatisfiableTestingItem* subsumingItem) { mDirectSubsumerItem = subsumingItem; return this; } COptimizedClassExtractedSaturationSatisfiableTestingItem* COptimizedClassExtractedSaturationSatisfiableTestingItem::getDirectSubsumer() { return mDirectSubsumerItem; } bool COptimizedClassExtractedSaturationSatisfiableTestingItem::hasDirectSubsumer() { return mDirectSubsumerItem != nullptr; } COptimizedClassExtractedSaturationSatisfiableTestingItem* COptimizedClassExtractedSaturationSatisfiableTestingItem::setExtractionSubsumerCount(cint64 subsumerCount) { mExtractedSubsumerCount = subsumerCount; return this; } cint64 COptimizedClassExtractedSaturationSatisfiableTestingItem::getExtractionSubsumerCount() const { return mExtractedSubsumerCount; } COptimizedClassExtractedSaturationSatisfiableTestingItem* COptimizedClassExtractedSaturationSatisfiableTestingItem::addSubsumingConceptItem(COptimizedClassExtractedSaturationSatisfiableTestingItem* subsumingItem) { mSubsumingConceptItemList.append(subsumingItem); //QString iriClassNameString = CIRIName::getRecentIRIName(subsumingItem->getSatisfiableConcept()->getClassNameLinker()); //mSubsumingConceptString += QString("%1\r\n").arg(iriClassNameString); return this; } CConceptSubsumerObserver* COptimizedClassExtractedSaturationSatisfiableTestingItem::tellConceptSupsumption(CConcept* subsumedConcept, CConcept* subsumerConcept) { CConceptProcessData* conProData = (CConceptProcessData*)subsumerConcept->getConceptData(); CConceptSatisfiableReferenceLinkingData* conSatRefLinking = (CConceptSatisfiableReferenceLinkingData*)conProData->getConceptReferenceLinking(); if (conSatRefLinking) { COptimizedClassExtractedSaturationSatisfiableTestingItem* subsumerClassSaturationItem = (COptimizedClassExtractedSaturationSatisfiableTestingItem*)conSatRefLinking->getClassifierReferenceLinkingData(); addSubsumingConceptItem(subsumerClassSaturationItem); } return this; } bool itemSortGreaterThan(const COptimizedClassExtractedSaturationSatisfiableTestingItem* item1, const COptimizedClassExtractedSaturationSatisfiableTestingItem* item2) { return item1->getExtractionSubsumerCount() > item2->getExtractionSubsumerCount(); } QList* COptimizedClassExtractedSaturationSatisfiableTestingItem::sortSubsumingConceptItemList() { qSort(mSubsumingConceptItemList.begin(),mSubsumingConceptItemList.end(),itemSortGreaterThan); return &mSubsumingConceptItemList; } bool COptimizedClassExtractedSaturationSatisfiableTestingItem::isEquivalentItem() { return mEquiItem; } COptimizedClassExtractedSaturationSatisfiableTestingItem* COptimizedClassExtractedSaturationSatisfiableTestingItem::setEquivalentItem(bool equivalent) { mEquiItem = equivalent; return this; } bool COptimizedClassExtractedSaturationSatisfiableTestingItem::isPredecessorItem() { return mPredecessorItem; } COptimizedClassExtractedSaturationSatisfiableTestingItem* COptimizedClassExtractedSaturationSatisfiableTestingItem::setPredecessorItem(bool predecessorItem) { mPredecessorItem = predecessorItem; return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionMap.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionMap0000644000175000017500000000746012520550760032434 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetClassPossibleSubsumptionMap.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedKPSetClassPossibleSubsumptionMap::COptimizedKPSetClassPossibleSubsumptionMap() : QMap() { mRequirePossibleSubsumptionUpdate = false; mRemainingPossibleSubsumptionCount = 0; } bool COptimizedKPSetClassPossibleSubsumptionMap::isPossibleSubsumptionUpdateRequired() { return mRequirePossibleSubsumptionUpdate; } cint64 COptimizedKPSetClassPossibleSubsumptionMap::getRemainingPossibleSubsumptionCount() { return mRemainingPossibleSubsumptionCount; } COptimizedKPSetClassPossibleSubsumptionMap* COptimizedKPSetClassPossibleSubsumptionMap::setRemainingPossibleSubsumptionCount(cint64 possSubsumCount) { mRemainingPossibleSubsumptionCount = possSubsumCount; return this; } COptimizedKPSetClassPossibleSubsumptionMap* COptimizedKPSetClassPossibleSubsumptionMap::decRemainingPossibleSubsumptionCount(cint64 decCount) { mRemainingPossibleSubsumptionCount -= decCount; return this; } COptimizedKPSetClassPossibleSubsumptionMap* COptimizedKPSetClassPossibleSubsumptionMap::incRemainingPossibleSubsumptionCount(cint64 incCount) { mRemainingPossibleSubsumptionCount += incCount; return this; } COptimizedKPSetClassPossibleSubsumptionMap* COptimizedKPSetClassPossibleSubsumptionMap::setPossibleSubsumptionUpdateRequired(bool requiredUpdate) { mRequirePossibleSubsumptionUpdate = requiredUpdate; return this; } bool COptimizedKPSetClassPossibleSubsumptionMap::hasRemainingPossibleSubsumptions() { return mRemainingPossibleSubsumptionCount > 0; } CClassPossibleSubsumptionMapIterator* COptimizedKPSetClassPossibleSubsumptionMap::getIterator(CClassPossibleSubsumptionMapIterator* reuseIterator, CContext* context) { if (reuseIterator) { COptimizedKPSetClassPossibleSubsumptionMapIterator* optKPSetClassPossSubMapIterator = (COptimizedKPSetClassPossibleSubsumptionMapIterator*)reuseIterator; *optKPSetClassPossSubMapIterator = COptimizedKPSetClassPossibleSubsumptionMapIterator(QMap::begin(),QMap::end()); return optKPSetClassPossSubMapIterator; } else { CMemoryAllocationManager* memMan = context->getMemoryAllocationManager(); COptimizedKPSetClassPossibleSubsumptionMapIterator* optKPSetClassPossSubMapIterator = CObjectAllocator::allocateAndConstruct(memMan); *optKPSetClassPossSubMapIterator = COptimizedKPSetClassPossibleSubsumptionMapIterator(QMap::begin(),QMap::end()); return optKPSetClassPossSubMapIterator; } } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassSubsumptionClassifierThread.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassSubsumptionClassifierT0000644000175000017500000043221312520551406032422 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetClassSubsumptionClassifierThread.h" namespace Konclude { namespace Reasoner { namespace Classifier { #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCOUTOUTPUT #define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGB #endif #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCOUTOUTPUT #define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGB #endif #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGBOXDESCRIPTION #define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGB #endif #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGSTATUSDESCRIPTION #define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGB #endif #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGB #define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(a) #else #define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(a) #endif //#define OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(a) a COptimizedKPSetClassSubsumptionClassifierThread::COptimizedKPSetClassSubsumptionClassifierThread(CReasonerManager *reasonerManager) : CSubsumptionClassifierThread(reasonerManager), CLogIdentifier("::Konclude::Reasoner::Kernel::Classifier::OptimizedKPSetClassSubsumptionClassifierThread",this) { satTestedCount = 0; totalToSatTestClassCount = 0; mClassificationCount = 0; subsumTestedCount = 0; totalToSubsumTestCount = 0; mConfPossSubsumCalcOrderConceptSorted = true; mConfPossSubsumCalcOrderFewestSubsumptionSorted = false; mConfPossSubsumCalcOrderTopDown = true; mConfPossSubsumCalcOrderBottomUp = false; mConfPossSubsumPseudoModelPretest = true; mConfPossSubsumPseudoModelTest = true; mConfWriteDebuggingData = false; mStatProcesedSubsumMessCount = 0; mStatProcesedPossSubsumInitMessCount = 0; mStatProcesedPossSubsumUpdateMessCount = 0; mStatProcesedPseudoModelMessCount = 0; mInterpretedSubsumptionCalculationCount = 0; mOrderedSubsumptionCalculationCount = 0; mPseudoModelPretestSubsumptionCalculationCount = 0; mCreatedCalculationTaskCount = 0; mRecievedCallbackCount = 0; mSatNodeExpCacheReader = nullptr; mSatNodeExpCache = dynamic_cast(reasonerManager->getSaturationAssociationExpansionCache()); if (mSatNodeExpCache) { mSatNodeExpCacheReader = mSatNodeExpCache->createCacheReader(); } } COptimizedKPSetClassSubsumptionClassifierThread::~COptimizedKPSetClassSubsumptionClassifierThread() { } CTaxonomy *COptimizedKPSetClassSubsumptionClassifierThread::createEmptyTaxonomyForOntology(CConcreteOntology *ontology, CConfigurationBase *config) { CTBox *tBox = ontology->getTBox(); CConceptVector *conVec = tBox->getConceptVector(); CConcept *topConcept = conVec->getData(1); CConcept *bottomConcept = conVec->getData(0); CPartialPruningTaxonomy *tax = new CPartialPruningTaxonomy(topConcept,bottomConcept); return tax->readConfig(config); } void COptimizedKPSetClassSubsumptionClassifierThread::readCalculationConfig(CCalculationConfigurationExtension *config) { if (config) { bool configErrorFlag = false; cint64 processorCount = 1; QString processorCountString = CConfigDataReader::readConfigString(config,"Konclude.Calculation.ProcessorCount",QString(),&configErrorFlag); if (!configErrorFlag) { if (processorCountString == "AUTO") { processorCount = CThread::idealThreadCount(); } else { qint64 convertedWorkerCount = processorCountString.toInt(&configErrorFlag); if (configErrorFlag) { processorCount = convertedWorkerCount; } } } bool mulConfigErrorFlag = false; cint64 multiplicator = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Classification.OptimizedKPSetClassSubsumptionClassifier.MultipliedUnitsParallelSatisfiableCalculationCount",1,&mulConfigErrorFlag); confMaxTestParallelCount = processorCount*multiplicator; bool maxConfigErrorFlag = false; cint64 maxParallel = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Classification.OptimizedKPSetClassSubsumptionClassifier.MaximumParallelSatisfiableCalculationCount",1,&maxConfigErrorFlag); if (!maxConfigErrorFlag) { if (!mulConfigErrorFlag) { confMaxTestParallelCount = qMin(confMaxTestParallelCount,maxParallel); } else { confMaxTestParallelCount = maxParallel; } } double factor = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Classification.OptimizedKPSetClassSubsumptionClassifier.ParallelSatisfiableCalculationCreationFactor",1000)/1000.; confMinTestParallelCount = confMaxTestParallelCount*factor; mConfWriteDebuggingData = CConfigDataReader::readConfigBoolean(config,"Konclude.Debugging.WriteDebuggingData",false); } else { confMaxTestParallelCount = 1; confMinTestParallelCount = 1; mConfWriteDebuggingData = false; } } COptimizedKPSetClassOntologyClassificationItem* COptimizedKPSetClassSubsumptionClassifierThread::createOntologyClassificationItem(CConcreteOntology *ontology, CConfigurationBase *config) { return new COptimizedKPSetClassOntologyClassificationItem(config,statistics); } CSubsumptionClassifierThread *COptimizedKPSetClassSubsumptionClassifierThread::scheduleOntologyClassification(CConcreteOntology *ontology, CTaxonomy *taxonomy, CClassificationCalculationSupport *classificationSupport, CConfigurationBase *config) { COptimizedKPSetClassOntologyClassificationItem *ontClassItem = createOntologyClassificationItem(ontology,config); ontClassItem->initTaxonomyConcepts(ontology,taxonomy); ontItemList.append(ontClassItem); processingOntItemList.append(ontClassItem); ontItemHash.insert(ontology,ontClassItem); readCalculationConfig(ontClassItem->getCalculationConfiguration()); if (CConfigDataReader::readConfigBoolean(ontClassItem->getCalculationConfiguration(),"Konclude.Calculation.Classification.IndividualDependenceTracking",true)) { ontClassItem->setIndividualDependenceTrackingCollector(new CIndividualDependenceTrackingCollector()); } CPartialPruningTaxonomy *parTax = dynamic_cast(taxonomy); if (parTax) { COntologyClassificationItem *ontClassItem = ontItemHash.value(ontology); parTax->createStatistics(ontClassItem->getClassifierStatistics()); } createObviousSubsumptionSatisfiableTestingOrder(ontClassItem); if (satTestedCount == totalToSatTestClassCount) { satTestedCount = 0; totalToSatTestClassCount = ontClassItem->getRemainingSatisfiableTestsCount(); classStartTime.start(); } else { totalToSatTestClassCount += ontClassItem->getRemainingSatisfiableTestsCount(); } ++mClassificationCount; return this; } void COptimizedKPSetClassSubsumptionClassifierThread::createObviousSubsumptionSatisfiableTestingOrder(COptimizedKPSetClassOntologyClassificationItem* ontClassItem) { CPrecomputation* precomputation = ontClassItem->getOntology()->getPrecomputation(); CSaturationData* saturationData = precomputation->getSaturationModelData(); bool subsumerSaturationExtraction = CConfigDataReader::readConfigBoolean(ontClassItem->getCalculationConfiguration(),"Konclude.Calculation.Classification.SaturationSubsumerExtraction",true); if (saturationData && subsumerSaturationExtraction) { createObviousSubsumptionSatisfiableTestingOrderFromSaturationData(ontClassItem); } else { createObviousSubsumptionSatisfiableTestingOrderFromBuildData(ontClassItem); } } void COptimizedKPSetClassSubsumptionClassifierThread::createObviousSubsumptionSatisfiableTestingOrderFromSaturationData(COptimizedKPSetClassOntologyClassificationItem* ontClassItem) { CTBox *tBox = ontClassItem->getOntology()->getDataBoxes()->getTBox(); CBOXHASH* candidateEqConHash = tBox->getCandidateEquivalentConceptHash(false); CBOXHASH* eqConCandidateHash = tBox->getEquivalentConceptCandidateHash(false); CBOXSET* eqConNonCandidateSet = tBox->getEquivalentConceptNonCandidateSet(false); CConcreteOntology *onto = ontClassItem->getOntology(); CConcept *topConcept = onto->getDataBoxes()->getTopConcept(); CConcept *bottomConcept = onto->getDataBoxes()->getBottomConcept(); QHash* conceptSatItemHash = ontClassItem->getConceptSatisfiableTestItemHash(); QList* satTestItemContainer = ontClassItem->getConceptSatisfiableTestItemContainer(); COptimizedKPSetClassTestingItem* topItem = ontClassItem->getConceptSatisfiableTestItem(topConcept,true); COptimizedKPSetClassTestingItem* bottomItem = ontClassItem->getConceptSatisfiableTestItem(bottomConcept,true); ontClassItem->initTopBottomSatisfiableTestingItems(topItem,bottomItem); QList* nextItemList = ontClassItem->getNextSatisfiableTestingItemList(); QSet* nextCandItemSet = ontClassItem->getNextCandidateSatisfiableTestingItemSet(); QSet* remainingCandItemSet = ontClassItem->getRemainingCandidateSatisfiableTestingItemSet(); bool testTopConcept = false; if (topConcept->getOperandList() || eqConNonCandidateSet && !eqConNonCandidateSet->isEmpty()) { // has not absorbed GCIs nextItemList->append(topItem); testTopConcept = true; } else { topItem->setPossibleSubsumptionMapInitialized(true); } bool invalidatedConRefLinking = false; QSet* equivConNonCandSet = ontClassItem->getEquivaltentConceptNonCandidateSet(); CBOXHASH* equivConCandidateHash = ontClassItem->getEquivalentConceptCandidateHash(); if (eqConCandidateHash) { for (CBOXHASH::const_iterator it = eqConCandidateHash->constBegin(), itEnd = eqConCandidateHash->constEnd(); it != itEnd; ++it) { CConcept* eqCon = it.key(); CConcept* candCon = it.value(); equivConCandidateHash->insert(eqCon,candCon); } } QHash* conRefLinkDataHash = ontClassItem->getConceptReferenceLinkingDataHash(); QList extClassConceptItemList; CPrecomputedSaturationSubsumerExtractor* precSatSubsumerExtractor = ontClassItem->getPrecomputedSaturationSubsumerExtractor(true); CBOXSET *conceptHash = tBox->getActiveClassConceptSet(false); if (conceptHash) { for (CBOXSET::const_iterator it = conceptHash->constBegin(), itEnd = conceptHash->constEnd(); it != itEnd; ++it) { CConcept *concept = (*it); if (concept && concept != topConcept && concept != bottomConcept || (concept == topConcept && testTopConcept)) { if (concept->getOperatorCode() == CCEQ) { if (!eqConCandidateHash || !eqConCandidateHash->contains(concept)) { equivConNonCandSet->insert(concept); } } COptimizedKPSetClassTestingItem* classItem = ontClassItem->getConceptSatisfiableTestItem(concept,true); CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); CConceptSaturationReferenceLinkingData* conRefSatLinking = (CConceptSaturationReferenceLinkingData*)conProcData->getConceptReferenceLinking(); if (!conRefSatLinking) { conRefSatLinking = new CConceptSaturationReferenceLinkingData(); conProcData->setConceptReferenceLinking(conRefSatLinking); } conRefLinkDataHash->insert(concept,classItem); if (conRefSatLinking->getClassifierReferenceLinkingData() || invalidatedConRefLinking) { conProcData->setInvalidatedReferenceLinking(true); } else { conRefSatLinking->setClassifierReferenceLinkingData(classItem); } extClassConceptItemList.append(classItem); } } } for (QList::const_iterator it = extClassConceptItemList.constBegin(), itEnd = extClassConceptItemList.constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* classItem = (*it); CConcept* concept = classItem->getTestingConcept(); bool unsatisfiableFlag = false; bool insufficientFlag = false; bool incompleteProcessedFlag = false; //QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); //if (iriClassNameString == "http://owl.man.ac.uk/2005/07/sssw/people#sheep") { // bool bug = true; //} if (!classItem->isSatisfiableTested()) { if (precSatSubsumerExtractor->getConceptFlags(concept,&unsatisfiableFlag,&insufficientFlag,&incompleteProcessedFlag)) { if (!unsatisfiableFlag) { bool possibleSubsumerFlag = false; precSatSubsumerExtractor->extractSubsumers(concept,classItem,&possibleSubsumerFlag,ontClassItem->getIndividualDependenceTrackingCollector(),classItem); if (incompleteProcessedFlag) { QSet conSubsumSet = getSubsumerSetFromBuildData(concept,ontClassItem); for (QSet::const_iterator it = conSubsumSet.constBegin(), itEnd = conSubsumSet.constEnd(); it != itEnd; ++it) { CConcept* subsumerConcept = *it; COptimizedKPSetClassTestingItem* subsumerItem = ontClassItem->getConceptSatisfiableTestItem(subsumerConcept,true); classItem->addSubsumingConceptItem(subsumerItem); } } if (equivConNonCandSet && !equivConNonCandSet->isEmpty()) { for (CBOXSET::const_iterator eqConIt = equivConNonCandSet->constBegin(), eqConItEnd = equivConNonCandSet->constEnd(); !possibleSubsumerFlag && eqConIt != eqConItEnd; ++eqConIt) { CConcept* eqCon = *eqConIt; CConceptProcessData* eqConProcData = (CConceptProcessData*)eqCon->getConceptData(); CConceptSaturationReferenceLinkingData* eqConRefSatLinking = (CConceptSaturationReferenceLinkingData*)eqConProcData->getConceptReferenceLinking(); COptimizedKPSetClassTestingItem* eqClassItem = (COptimizedKPSetClassTestingItem*)eqConRefSatLinking->getClassifierReferenceLinkingData(); if (!classItem->hasSubsumerConceptItem(eqClassItem)) { possibleSubsumerFlag = true; } } } cint64 foundSubsumerCount = 0; QList* subsumerItemList = classItem->getSubsumingConceptItemList(); for (QList::const_iterator subsubItemIt = subsumerItemList->constBegin(), itEnd = subsumerItemList->constEnd(); subsubItemIt != itEnd; ++subsubItemIt) { COptimizedKPSetClassTestingItem* subsumerItem(*subsubItemIt); ++foundSubsumerCount; subsumerItem->addSuccessorSatisfiableTestItem(classItem); } classItem->setUnprocessedPredecessorItems(foundSubsumerCount); if (!insufficientFlag && !possibleSubsumerFlag && !incompleteProcessedFlag) { classItem->setResultSatisfiableDerivated(true); classItem->setPossibleSubsumptionMapInitialized(true); } ontClassItem->incRemainingSatisfiableTestsCount(); remainingCandItemSet->insert(classItem); if (foundSubsumerCount <= 0) { nextItemList->append(classItem); } } else { ontClassItem->incRemainingSatisfiableTestsCount(); classItem->setResultUnsatisfiableDerivated(true); nextItemList->append(classItem); } } else { bool foundSubsumingConcepts = false; QSet conSubsumSet = getSubsumerSetFromBuildData(concept,ontClassItem); for (QSet::const_iterator it = conSubsumSet.constBegin(), itEnd = conSubsumSet.constEnd(); it != itEnd; ++it) { CConcept* subsumedConcept = *it; COptimizedKPSetClassTestingItem* subsumerItem = ontClassItem->getConceptSatisfiableTestItem(subsumedConcept,true); subsumerItem->addSuccessorSatisfiableTestItem(classItem); classItem->incUnprocessedPredecessorItems(); foundSubsumingConcepts = true; } ontClassItem->incRemainingSatisfiableTestsCount(); remainingCandItemSet->insert(classItem); if (!foundSubsumingConcepts) { nextItemList->append(classItem); } } } } } QSet COptimizedKPSetClassSubsumptionClassifierThread::getSubsumerSetFromBuildData(CConcept* concept, COptimizedKPSetClassOntologyClassificationItem* ontClassItem) { QSet > conSet; QList > conList; QSet conSubsumSet; conList.append(QPair(concept,false)); conSet.insert(QPair(concept,false)); while (!conList.isEmpty()) { QPair conNegPair = conList.takeFirst(); CConcept *con = conNegPair.first; bool neg = conNegPair.second; qint64 conOpCode = con->getProcessingOperatorTag(); cint64 opCount = con->getOperandCount(); cint64 param = con->getParameter(); if (conOpCode == CCAND && (!neg || neg && opCount <= 1) || conOpCode == CCOR && (neg || !neg && opCount <= 1)) { CSortedNegLinker *opConIt = con->getOperandList(); while (opConIt) { CConcept *opCon = opConIt->getData(); bool opNeg = opConIt->isNegated(); QPair opConNegPair(opCon,neg ^ opNeg); if (opCon->hasClassName()) { if (neg ^ opNeg) { if (!conSet.contains(opConNegPair)) { conSet.insert(opConNegPair); conList.append(opConNegPair); } } else { conSubsumSet.insert(opCon); } } else { if (!conSet.contains(opConNegPair)) { conSet.insert(opConNegPair); conList.append(opConNegPair); } } opConIt = opConIt->getNext(); } } else if (!neg && (conOpCode == CCSOME || conOpCode == CCATLEAST && param >= 1) || neg && (conOpCode == CCALL || conOpCode == CCATMOST && param >= 2)) { CRole* role = con->getRole(); CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { CRole* superRole = superRoleIt->getData(); bool superRoleNeg = superRoleIt->isNegated(); CSortedNegLinker* domainConIt = superRole->getDomainRangeConceptList(superRoleNeg); while (domainConIt) { CConcept *domCon = domainConIt->getData(); bool opDomNeg = domainConIt->isNegated(); QPair domConNegPair(domCon,neg ^ opDomNeg); if (domCon->hasClassName()) { if (neg ^ opDomNeg) { if (!conSet.contains(domConNegPair)) { conSet.insert(domConNegPair); conList.append(domConNegPair); } } else { conSubsumSet.insert(domCon); } } else { if (!conSet.contains(domConNegPair)) { conSet.insert(domConNegPair); conList.append(domConNegPair); } } domainConIt = domainConIt->getNext(); } superRoleIt = superRoleIt->getNext(); } } else if (!neg && (conOpCode == CCNOMINAL)) { CIndividual* individual = con->getNominalIndividual(); CConceptAssertionLinker* assConLinkIt = individual->getAssertionConceptLinker(); while (assConLinkIt) { CConcept* assCon = assConLinkIt->getData(); bool assConNeg = assConLinkIt->isNegated(); QPair assConNegPair(assCon,neg ^ assConNeg); if (assCon->hasClassName()) { if (neg ^ assConNeg) { if (!conSet.contains(assConNegPair)) { conSet.insert(assConNegPair); conList.append(assConNegPair); } } else { conSubsumSet.insert(assCon); } } else { if (!conSet.contains(assConNegPair)) { conSet.insert(assConNegPair); conList.append(assConNegPair); } } assConLinkIt = assConLinkIt->getNext(); } } } return conSubsumSet; } void COptimizedKPSetClassSubsumptionClassifierThread::createObviousSubsumptionSatisfiableTestingOrderFromBuildData(COptimizedKPSetClassOntologyClassificationItem* ontClassItem) { CTBox *tBox = ontClassItem->getOntology()->getDataBoxes()->getTBox(); CBOXHASH* candidateEqConHash = tBox->getCandidateEquivalentConceptHash(false); CBOXHASH* eqConCandidateHash = tBox->getEquivalentConceptCandidateHash(false); CBOXSET* eqConNonCandidateSet = tBox->getEquivalentConceptNonCandidateSet(false); CConcreteOntology *onto = ontClassItem->getOntology(); CConcept *topConcept = onto->getDataBoxes()->getTopConcept(); CConcept *bottomConcept = onto->getDataBoxes()->getBottomConcept(); QHash* conceptSatItemHash = ontClassItem->getConceptSatisfiableTestItemHash(); QList* satTestItemContainer = ontClassItem->getConceptSatisfiableTestItemContainer(); COptimizedKPSetClassTestingItem* topItem = ontClassItem->getConceptSatisfiableTestItem(topConcept,true); COptimizedKPSetClassTestingItem* bottomItem = ontClassItem->getConceptSatisfiableTestItem(bottomConcept,true); ontClassItem->initTopBottomSatisfiableTestingItems(topItem,bottomItem); QList* nextItemList = ontClassItem->getNextSatisfiableTestingItemList(); QSet* nextCandItemSet = ontClassItem->getNextCandidateSatisfiableTestingItemSet(); QSet* remainingCandItemSet = ontClassItem->getRemainingCandidateSatisfiableTestingItemSet(); bool testTopConcept = true; if (topConcept->getOperandList() || eqConNonCandidateSet && !eqConNonCandidateSet->isEmpty()) { // has not absorbed GCIs nextItemList->append(topItem); testTopConcept = true; } else { topItem->setPossibleSubsumptionMapInitialized(true); } bool invalidatedConRefLinking = false; QSet* equivConNonCandSet = ontClassItem->getEquivaltentConceptNonCandidateSet(); CBOXHASH* equivConCandidateHash = ontClassItem->getEquivalentConceptCandidateHash(); if (eqConCandidateHash) { for (CBOXHASH::const_iterator it = eqConCandidateHash->constBegin(), itEnd = eqConCandidateHash->constEnd(); it != itEnd; ++it) { CConcept* eqCon = it.key(); CConcept* candCon = it.value(); equivConCandidateHash->insert(eqCon,candCon); } } QHash* conRefLinkDataHash = ontClassItem->getConceptReferenceLinkingDataHash(); CBOXSET *conceptHash = tBox->getActiveClassConceptSet(false); if (conceptHash) { for (CBOXSET::const_iterator it = conceptHash->constBegin(), itEnd = conceptHash->constEnd(); it != itEnd; ++it) { CConcept *concept = (*it); if (concept && concept != topConcept && concept != bottomConcept || (concept == topConcept && testTopConcept)) { if (concept->getOperatorCode() == CCEQ) { if (!eqConCandidateHash || !eqConCandidateHash->contains(concept)) { equivConNonCandSet->insert(concept); } } QSet conSubsumSet = getSubsumerSetFromBuildData(concept,ontClassItem); //QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); //if (iriClassNameString == "http://www.owllink.org/testsuite/galen#Haem") { // bool bug = true; //} COptimizedKPSetClassTestingItem* subsumerItem = ontClassItem->getConceptSatisfiableTestItem(concept,true); CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); CConceptSaturationReferenceLinkingData* conRefSatLinking = (CConceptSaturationReferenceLinkingData*)conProcData->getConceptReferenceLinking(); if (!conRefSatLinking) { conRefSatLinking = new CConceptSaturationReferenceLinkingData(); conProcData->setConceptReferenceLinking(conRefSatLinking); } conRefLinkDataHash->insert(concept,subsumerItem); if (conRefSatLinking->getClassifierReferenceLinkingData() || invalidatedConRefLinking) { conProcData->setInvalidatedReferenceLinking(true); } else { conRefSatLinking->setClassifierReferenceLinkingData(subsumerItem); } bool foundSubsumingConcepts = false; for (QSet::const_iterator it = conSubsumSet.constBegin(), itEnd = conSubsumSet.constEnd(); it != itEnd; ++it) { CConcept* subsumedConcept = *it; COptimizedKPSetClassTestingItem* subsumedItem = ontClassItem->getConceptSatisfiableTestItem(subsumedConcept,true); subsumedItem->addSuccessorSatisfiableTestItem(subsumerItem); subsumerItem->incUnprocessedPredecessorItems(); foundSubsumingConcepts = true; } ontClassItem->incRemainingSatisfiableTestsCount(); remainingCandItemSet->insert(subsumerItem); if (!foundSubsumingConcepts) { nextItemList->append(subsumerItem); } } } } } QString COptimizedKPSetClassSubsumptionClassifierThread::getStatusString() { statUpdateMutex.lock(); QString string = statusString; string.detach(); statUpdateMutex.unlock(); return string; } CClassificationProgress* COptimizedKPSetClassSubsumptionClassifierThread::getClassificationProgress() { if (satTestedCount != totalToSatTestClassCount || subsumTestedCount != totalToSubsumTestCount) { cint64 tested = satTestedCount + subsumTestedCount; cint64 total = totalToSatTestClassCount + totalToSubsumTestCount; cint64 elapsedTime = classStartTime.elapsed(); double remainingMilliSeconds = 0.; double progessPercent = 0.; if (elapsedTime <= 0 && total > 0) { remainingMilliSeconds = 0.; } else { remainingMilliSeconds = ((double)elapsedTime / (double)tested) * (total-tested); } if (total <= 0) { progessPercent = 0.; } else { progessPercent = ((double)tested / (double)total) * 100.; } cint64 classificCount = mClassificationCount; mClassifyProgess.setClassificationCount(classificCount); mClassifyProgess.setProgessPercent(progessPercent); mClassifyProgess.setRemainingMilliSeconds(remainingMilliSeconds); mClassifyProgess.setTestedClasses(satTestedCount); mClassifyProgess.setTotalClasses(totalToSatTestClassCount); mClassifyProgess.setTestedSubsumptions(subsumTestedCount); mClassifyProgess.setTotalSubsumptions(totalToSubsumTestCount); } else { mClassifyProgess.setProgessPercent(0.); mClassifyProgess.setRemainingMilliSeconds(0.); mClassifyProgess.setTestedClasses(satTestedCount); mClassifyProgess.setTotalClasses(totalToSatTestClassCount); mClassifyProgess.setTestedSubsumptions(subsumTestedCount); mClassifyProgess.setTotalSubsumptions(totalToSubsumTestCount); } return &mClassifyProgess; } bool itemSortLessSubsumptionsThan(const COptimizedKPSetClassTestingItem* item1, const COptimizedKPSetClassTestingItem* item2) { return item1->getSubsumingConceptItemCount() < item2->getSubsumingConceptItemCount(); } bool itemSortMoreSubsumptionsThan(const COptimizedKPSetClassTestingItem* item1, const COptimizedKPSetClassTestingItem* item2) { return item1->getSubsumingConceptItemCount() > item2->getSubsumingConceptItemCount(); } void COptimizedKPSetClassSubsumptionClassifierThread::testDebugPossibleSubsumerCorrectCounted(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem) { QList* classList = optKPSetClassificationItem->getConceptSatisfiableTestItemContainer(); cint64 totalCount = 0; foreach (COptimizedKPSetClassTestingItem* item, *classList) { COptimizedKPSetClassPossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); if (possSubsumMap) { cint64 mapCount = 0; for (COptimizedKPSetClassPossibleSubsumptionMap::const_iterator it = possSubsumMap->constBegin(), itEnd = possSubsumMap->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassPossibleSubsumptionData* data = it.value(); if (data->isSubsumptionUnknown() || data->isUpdateRequired()) { mapCount++; totalCount++; } } if (mapCount != possSubsumMap->getRemainingPossibleSubsumptionCount()) { bool bug = true; } } } if (totalCount != optKPSetClassificationItem->getRemainingPossibleSubsumptionTestsCount()) { bool bug = true; } } void COptimizedKPSetClassSubsumptionClassifierThread::testDebugPossibleSubsumerCorrectReferenced(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem) { QList* classList = optKPSetClassificationItem->getSatisfiableConceptItemList(); if (mConfPossSubsumCalcOrderBottomUp) { QSet* remItemSet = optKPSetClassificationItem->getRemainingPossibleSubsumptionClassTestingSet(); foreach (COptimizedKPSetClassTestingItem* item, *classList) { COptimizedKPSetClassPossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); if (possSubsumMap) { for (COptimizedKPSetClassPossibleSubsumptionMap::const_iterator it = possSubsumMap->constBegin(), itEnd = possSubsumMap->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassPossibleSubsumptionData* data = it.value(); if (data->isSubsumptionUnknown() || data->isUpdateRequired()) { COptimizedKPSetClassTestingItem* possSubsumerItem = data->getClassItem(); if (!possSubsumerItem->getPossibleSubsumedSet(false)->contains(item) && !optKPSetClassificationItem->getCurrentPossibleSubsumptionTestingItemSet()->contains(possSubsumerItem)) { bool bug = true; } if (!remItemSet->contains(possSubsumerItem) && !optKPSetClassificationItem->getCurrentPossibleSubsumptionTestingItemSet()->contains(possSubsumerItem)) { bool bug = true; } } } } } } } QString COptimizedKPSetClassSubsumptionClassifierThread::createDebugKPSetString(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, const QString& filename) { QString debugString; QList* classList = optKPSetClassificationItem->getSatisfiableConceptItemList(); foreach (COptimizedKPSetClassTestingItem* item, *classList) { QString iriClassNameString = CIRIName::getRecentIRIName(item->getTestingConcept()->getClassNameLinker()); QString classDebugString = QString("Class: %1\r\n").arg(iriClassNameString); QString subsumString; foreach (COptimizedKPSetClassTestingItem* subsumItem, *item->getSubsumingConceptItemList()) { QString subsumIRIClassNameString = CIRIName::getRecentIRIName(subsumItem->getTestingConcept()->getClassNameLinker()); if (subsumString.isEmpty()) { subsumString += subsumIRIClassNameString; } else { subsumString += QString(", %1").arg(subsumIRIClassNameString); } } classDebugString += QString("Subsumer Classes: %1\r\n").arg(subsumString); QString possSubsumString; COptimizedKPSetClassPossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); if (possSubsumMap) { for (COptimizedKPSetClassPossibleSubsumptionMap::const_iterator it = possSubsumMap->constBegin(), itEnd = possSubsumMap->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassPossibleSubsumptionData* data = it.value(); QString subsumIRIClassNameString = CIRIName::getRecentIRIName(data->getClassItem()->getTestingConcept()->getClassNameLinker()); QString possString; if (data->isSubsumptionConfirmed()) { possString = "s"; } else if (data->isSubsumptionInvalided()) { possString = "n"; } else { possString = "u"; } if (possSubsumString.isEmpty()) { possSubsumString += QString("%1(%2)").arg(subsumIRIClassNameString).arg(possString); } else { possSubsumString += QString(", %1(%2)").arg(subsumIRIClassNameString).arg(possString); } } } classDebugString += QString("Possible Subsumer Classes: %1\r\n\r\n\r\n").arg(possSubsumString); debugString += classDebugString; } QFile file(filename); if (file.open(QIODevice::WriteOnly)) { file.write(debugString.toLocal8Bit()); file.close(); } return debugString; } bool COptimizedKPSetClassSubsumptionClassifierThread::createNextSubsumtionTest() { COntologyClassificationItem *loopOntClassItem = 0; bool workTestCreated = false; while (!workTestCreated && !processingOntItemList.isEmpty()) { COntologyClassificationItem *ontClassItem = processingOntItemList.first(); if (ontClassItem == loopOntClassItem) { // don't run into infinite loop without doing something break; } COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem = (COptimizedKPSetClassOntologyClassificationItem *)ontClassItem; if (!optKPSetClassificationItem->hasSatisfiableTestingPhaseFinished() && !ontClassItem->isTaxonomyConstructionFailed()) { while (!workTestCreated && optKPSetClassificationItem->hasRemainingSatisfiableTests()) { // get next satisfiable test QList* nextItemList = optKPSetClassificationItem->getNextSatisfiableTestingItemList(); QSet* nextCandItemSet = optKPSetClassificationItem->getNextCandidateSatisfiableTestingItemSet(); QSet* remainingCandItemSet = optKPSetClassificationItem->getRemainingCandidateSatisfiableTestingItemSet(); COptimizedKPSetClassTestingItem* nextSatTestItem = nullptr; if (!nextItemList->isEmpty()) { nextSatTestItem = nextItemList->takeFirst(); remainingCandItemSet->remove(nextSatTestItem); nextCandItemSet->remove(nextSatTestItem); } else if (!nextCandItemSet->isEmpty()) { COptimizedKPSetClassTestingItem* minItem = nullptr; cint64 minUnpPredCount = 0; cint64 maxItCount = 100; for (QSet::const_iterator it = nextCandItemSet->constBegin(), itEnd = nextCandItemSet->constEnd(); it != itEnd && maxItCount > 0; ++it, --maxItCount) { COptimizedKPSetClassTestingItem* item = (*it); cint64 predCount = item->getUnprocessedPredecessorItemCount(); if (!minItem || predCount < minUnpPredCount) { minUnpPredCount = predCount; minItem = item; } } nextSatTestItem = minItem; remainingCandItemSet->remove(nextSatTestItem); nextCandItemSet->remove(nextSatTestItem); } else if (!remainingCandItemSet->isEmpty()) { COptimizedKPSetClassTestingItem* minItem = nullptr; //cint64 minUnpPredCount = 0; //for (QSet::const_iterator it = remainingCandItemSet->constBegin(), itEnd = remainingCandItemSet->constEnd(); it != itEnd; ++it) { // COptimizedKPSetClassTestingItem* item = (*it); // cint64 predCount = item->getUnprocessedPredecessorItemCount(); // if (!minItem || minUnpPredCount < predCount) { // minUnpPredCount = predCount; // minItem = item; // } //} //nextSatTestItem = minItem; QSet::const_iterator itNext = remainingCandItemSet->constBegin(); nextSatTestItem = *itNext; remainingCandItemSet->remove(nextSatTestItem); } if (nextSatTestItem && !nextSatTestItem->isSatisfiableTestOrdered()) { optKPSetClassificationItem->decRemainingSatisfiableTestsCount(); optKPSetClassificationItem->incRunningSatisfiableTestsCount(); if (calculateSatisfiable(optKPSetClassificationItem,nextSatTestItem)) { workTestCreated = true; } else { interpreteSatisfiableResult(optKPSetClassificationItem,nextSatTestItem->getTestingConcept(),nextSatTestItem->getSatisfiableTestedResult()); } } } if (!workTestCreated) { if (optKPSetClassificationItem->hasAllSatisfiableTestsCompleted()) { optKPSetClassificationItem->setSatisfiableTestingPhaseFinished(true); OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); // initialize possible subsumption testing phase cint64 remainingSubSumTestCount = 0; QSet* remTestingSet = optKPSetClassificationItem->getRemainingPossibleSubsumptionClassTestingSet(); QList* nextItemList = optKPSetClassificationItem->getNextPossibleSubsumptionTestingItemList(); COptimizedKPSetClassTestingItem* topItem = optKPSetClassificationItem->getTopConceptSatisfiableTestItem(); COptimizedKPSetClassTestingItem* bottomItem = optKPSetClassificationItem->getBottomConceptSatisfiableTestItem(); if (topItem) { topItem->setPropagationConnected(true); } QList classList(*optKPSetClassificationItem->getSatisfiableConceptItemList()); qSort(classList.begin(),classList.end(),itemSortLessSubsumptionsThan); QList resevePossSubsumClassList; foreach (COptimizedKPSetClassTestingItem* item, classList) { COptimizedKPSetClassPossibleSubsumptionMap* possSubSumMap = item->getPossibleSubsumptionMap(false); if (possSubSumMap && possSubSumMap->hasRemainingPossibleSubsumptions()) { if (mConfPossSubsumCalcOrderTopDown) { nextItemList->append(item); remTestingSet->insert(item); } remainingSubSumTestCount += possSubSumMap->getRemainingPossibleSubsumptionCount(); resevePossSubsumClassList.append(item); } if (!item->isPossibleSubsumptionMapInitialized()) { bool bug = true; } QList* subsumerList = item->getSubsumingConceptItemList(); COptimizedKPSetClassTestingItem* maxSubsumerItem = nullptr; cint64 maxSubsumerCount = 0; for (QList::const_iterator it = subsumerList->constBegin(), itEnd = subsumerList->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* subsumerItem = *it; if (!maxSubsumerItem || subsumerItem->getSubsumingConceptItemCount() > maxSubsumerCount) { maxSubsumerCount = subsumerItem->getSubsumingConceptItemCount(); maxSubsumerItem = subsumerItem; } } if (!maxSubsumerItem) { maxSubsumerItem = topItem; } bool upPropConnected = false; QSet* upPropSet = item->getUpPropagationItemSet(); if (item != topItem) { upPropSet->insert(maxSubsumerItem); maxSubsumerItem->addDownPropagationItem(item); upPropConnected |= maxSubsumerItem->isPropagationConnected(); } for (QList::const_iterator itSub = subsumerList->constBegin(), itSubEnd = subsumerList->constEnd(); itSub != itSubEnd; ++itSub) { COptimizedKPSetClassTestingItem* subsumerItem = *itSub; bool alreadySubsumed = false; for (QSet::const_iterator itProp = upPropSet->constBegin(), itPropEnd = upPropSet->constEnd(); !alreadySubsumed && itProp != itPropEnd; ++itProp) { COptimizedKPSetClassTestingItem* propItem = *itProp; if (propItem == subsumerItem || propItem->hasSubsumerConceptItem(subsumerItem)) { alreadySubsumed = true; } } if (!alreadySubsumed) { upPropSet->insert(subsumerItem); subsumerItem->addDownPropagationItem(item); upPropConnected |= subsumerItem->isPropagationConnected(); } } if (!upPropConnected) { for (QList::const_iterator itSub = subsumerList->constBegin(), itSubEnd = subsumerList->constEnd(); itSub != itSubEnd && !upPropConnected; ++itSub) { COptimizedKPSetClassTestingItem* subsumerItem = *itSub; if (subsumerItem->isPropagationConnected()) { upPropSet->insert(subsumerItem); subsumerItem->addDownPropagationItem(item); upPropConnected |= subsumerItem->isPropagationConnected(); } } if (!upPropConnected) { upPropSet->insert(topItem); topItem->addDownPropagationItem(item); upPropConnected |= topItem->isPropagationConnected(); } } item->setPropagationConnected(upPropConnected); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(createDebugKPSetString(optKPSetClassificationItem,"classkpsets-inital.txt")); foreach (COptimizedKPSetClassTestingItem* item, classList) { COptimizedKPSetClassPossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); QSet* upPropSet = item->getUpPropagationItemSet(); if (!possSubsumMap && item->isPossibleSubsumptionMapInitialized()) { for (QSet::const_iterator itProp = upPropSet->constBegin(), itPropEnd = upPropSet->constEnd(); itProp != itPropEnd; ++itProp) { COptimizedKPSetClassTestingItem* upPropItem = *itProp; COptimizedKPSetClassPossibleSubsumptionMap* upPropItemPossSubsumMap = upPropItem->getPossibleSubsumptionMap(false); if (upPropItemPossSubsumMap) { for (COptimizedKPSetClassPossibleSubsumptionMap::const_iterator itUpPoss = upPropItemPossSubsumMap->constBegin(), itUpPossEnd = upPropItemPossSubsumMap->constEnd(); itUpPoss != itUpPossEnd; ++itUpPoss) { COptimizedKPSetClassPossibleSubsumptionData* upPossData = itUpPoss.value(); if (!item->hasSubsumerConceptItem(upPossData->getClassItem()) && item != upPossData->getClassItem()) { if (!upPossData->isSubsumptionInvalided()) { upPossData->setSubsumptionInvalid(true); if (upPossData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,upPropItem,upPossData); } } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } } } } else { for (QSet::const_iterator itProp = upPropSet->constBegin(), itPropEnd = upPropSet->constEnd(); itProp != itPropEnd; ++itProp) { COptimizedKPSetClassTestingItem* upPropItem = *itProp; COptimizedKPSetClassPossibleSubsumptionMap* upPropItemPossSubsumMap = upPropItem->getPossibleSubsumptionMap(false); if (upPropItemPossSubsumMap) { COptimizedKPSetClassPossibleSubsumptionMap::const_iterator itUpPoss = upPropItemPossSubsumMap->constBegin(), itUpPossEnd = upPropItemPossSubsumMap->constEnd(); if (possSubsumMap) { COptimizedKPSetClassPossibleSubsumptionMap::const_iterator itPoss = possSubsumMap->constBegin(), itPossEnd = possSubsumMap->constEnd(); while (itPoss != itPossEnd && itUpPoss != itUpPossEnd) { CConcept* possCon = itPoss.key().getConcept(); CConcept* possUpCon = itUpPoss.key().getConcept(); if (possCon->getConceptTag() == possUpCon->getConceptTag()) { ++itPoss; ++itUpPoss; } else if (possCon->getConceptTag() < possUpCon->getConceptTag()) { ++itPoss; } else if (possCon->getConceptTag() > possUpCon->getConceptTag()) { COptimizedKPSetClassPossibleSubsumptionData* upPossData = itUpPoss.value(); if (!item->hasSubsumerConceptItem(upPossData->getClassItem()) && item != upPossData->getClassItem()) { if (!upPossData->isSubsumptionInvalided()) { upPossData->setSubsumptionInvalid(true); if (upPossData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,upPropItem,upPossData); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } ++itUpPoss; } } } while (itUpPoss != itUpPossEnd) { COptimizedKPSetClassPossibleSubsumptionData* upPossData = itUpPoss.value(); if (!item->hasSubsumerConceptItem(upPossData->getClassItem()) && item != upPossData->getClassItem()) { if (!upPossData->isSubsumptionInvalided()) { upPossData->setSubsumptionInvalid(true); if (upPossData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,upPropItem,upPossData); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } ++itUpPoss; } } } } } foreach (COptimizedKPSetClassTestingItem* item, resevePossSubsumClassList) { COptimizedKPSetClassPossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); if (possSubsumMap) { if (possSubsumMap->hasRemainingPossibleSubsumptions()) { for (COptimizedKPSetClassPossibleSubsumptionMap::const_iterator it = possSubsumMap->constBegin(), itEnd = possSubsumMap->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumData = it.value(); if (mConfPossSubsumPseudoModelPretest) { if (possSubsumData->isSubsumptionUnknown()) { bool isSubsumptionFlag = false; if (fastPseudoModelSubsumptionClassPrecheckTest(optKPSetClassificationItem,item,possSubsumData->getClassItem(),&isSubsumptionFlag)) { CClassifierStatistics* ontClassStat = optKPSetClassificationItem->getClassifierStatistics(); if (ontClassStat) { ontClassStat->incPseudoModelMergedTestedSubsumptionCount(1); } if (!isSubsumptionFlag) { optKPSetClassificationItem->incRunningPossibleSubsumptionTestsCount(); possSubsumData->setSubsumptionInvalid(true); ++mPseudoModelPretestSubsumptionCalculationCount; interpreteSubsumptionResult(optKPSetClassificationItem,item->getTestingConcept(),possSubsumData->getClassItem()->getTestingConcept(),possSubsumData->isSubsumptionConfirmed()); } } } } if (mConfPossSubsumCalcOrderBottomUp) { if (possSubsumData->isSubsumptionUnknown() || possSubsumData->isUpdateRequired()) { COptimizedKPSetClassTestingItem* possSubsumerItem = possSubsumData->getClassItem(); possSubsumerItem->getPossibleSubsumedSet(true)->insert(item); if (!remTestingSet->contains(possSubsumerItem)) { remTestingSet->insert(possSubsumerItem); nextItemList->append(possSubsumerItem); } } } } } } } if (mConfPossSubsumCalcOrderBottomUp) { for (QSet::const_iterator it = remTestingSet->constBegin(), itEnd = remTestingSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* possSubsumerItem = *it; QList* subsumersSortedList = new QList(possSubsumerItem->getPossibleSubsumedSet(false)->toList()); qSort(subsumersSortedList->begin(),subsumersSortedList->end(),itemSortMoreSubsumptionsThan); possSubsumerItem->setPossibleSubsumedList(subsumersSortedList); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectReferenced(optKPSetClassificationItem)); } if (mConfWriteDebuggingData) { createDebugKPSetString(optKPSetClassificationItem,"classkpsets-inital-pruned.txt"); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(createDebugKPSetString(optKPSetClassificationItem,"classkpsets-inital-pruned.txt")); OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } } if (optKPSetClassificationItem->hasSatisfiableTestingPhaseFinished() && !optKPSetClassificationItem->hasPossibleSubsumptionTestingPhaseFinished() && !ontClassItem->isTaxonomyConstructionFailed()) { QList* nextItemList = optKPSetClassificationItem->getNextPossibleSubsumptionTestingItemList(); QSet* currentItemSet = optKPSetClassificationItem->getCurrentPossibleSubsumptionTestingItemSet(); bool canContinueSearchingForTests = true; while (!workTestCreated && optKPSetClassificationItem->hasRemainingPossibleSubsumptionTests() && canContinueSearchingForTests) { // get next possible subsumption test canContinueSearchingForTests = false; COptimizedKPSetClassTestingItem* nextPossSubsumTestItem = nullptr; if (!nextItemList->isEmpty()) { nextPossSubsumTestItem = nextItemList->takeFirst(); } if (nextPossSubsumTestItem) { canContinueSearchingForTests = true; if (mConfPossSubsumCalcOrderTopDown) { COptimizedKPSetClassPossibleSubsumptionMap* possSubsumerMap = nextPossSubsumTestItem->getPossibleSubsumptionMap(false); if (possSubsumerMap && possSubsumerMap->hasRemainingPossibleSubsumptions()) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumCalcData = getNextPossibleSubsumptionCalculation(optKPSetClassificationItem,nextPossSubsumTestItem); if (possSubsumCalcData) { currentItemSet->insert(nextPossSubsumTestItem); optKPSetClassificationItem->incRunningPossibleSubsumptionTestsCount(); if (calculateSubsumption(optKPSetClassificationItem,nextPossSubsumTestItem,possSubsumCalcData->getClassItem(),possSubsumCalcData)) { workTestCreated = true; } else { interpreteSubsumptionResult(optKPSetClassificationItem,nextPossSubsumTestItem->getTestingConcept(),possSubsumCalcData->getClassItem()->getTestingConcept(),possSubsumCalcData->isSubsumptionConfirmed()); } } } else { QSet* remTestingSet = optKPSetClassificationItem->getRemainingPossibleSubsumptionClassTestingSet(); remTestingSet->remove(nextPossSubsumTestItem); } } else if (mConfPossSubsumCalcOrderBottomUp) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumCalcData = nullptr; COptimizedKPSetClassTestingItem* possSubsumedItem = nullptr; OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectReferenced(optKPSetClassificationItem)); CConcept* possSubsumerConcept = nextPossSubsumTestItem->getTestingConcept(); CConcept* candidateConcept = possSubsumerConcept; if (possSubsumerConcept->getOperatorCode() == CCEQ) { candidateConcept = optKPSetClassificationItem->getEquivalentConceptCandidateHash()->value(possSubsumerConcept); if (!candidateConcept) { candidateConcept = possSubsumerConcept; } } QList* possSubsumedSortedList = nextPossSubsumTestItem->getPossibleSubsumedList(); if (possSubsumedSortedList && !possSubsumedSortedList->isEmpty()) { while (!possSubsumCalcData && !possSubsumedSortedList->isEmpty()) { possSubsumedItem = possSubsumedSortedList->takeFirst(); if (nextPossSubsumTestItem->getPossibleSubsumedSet(false)->contains(possSubsumedItem)) { nextPossSubsumTestItem->getPossibleSubsumedSet(false)->remove(possSubsumedItem); COptimizedKPSetClassPossibleSubsumptionMap* possSubsumerMap = possSubsumedItem->getPossibleSubsumptionMap(false); if (possSubsumerMap && possSubsumerMap->hasRemainingPossibleSubsumptions()) { possSubsumCalcData = possSubsumerMap->value(CConceptTagComparer(candidateConcept)); } } } } if (possSubsumCalcData) { //if ((possSubsumCalcData->isUpdateRequired() || possSubsumCalcData->isSubsumptionUnknown())) { currentItemSet->insert(nextPossSubsumTestItem); optKPSetClassificationItem->incRunningPossibleSubsumptionTestsCount(); //QString iriClassNameString1 = CIRIName::getRecentIRIName(possSubsumedItem->getTestingConcept()->getClassNameLinker()); //QString iriClassNameString2 = CIRIName::getRecentIRIName(nextPossSubsumTestItem->getTestingConcept()->getClassNameLinker()); //if (iriClassNameString2 == "http://www.owllink.org/testsuite/npt8-D#TransitionMetalAtom" && iriClassNameString1 == "http://www.owllink.org/testsuite/npt8-D#TitaniumFamilyAtom") { // bool bug = true; //} //if (subsumCalcedSet.contains(QPair(possSubsumedItem->getTestingConcept(),nextPossSubsumTestItem->getTestingConcept()))) { // bool bug = true; //} //subsumCalcedSet.insert(QPair(possSubsumedItem->getTestingConcept(),nextPossSubsumTestItem->getTestingConcept())); if (calculateSubsumption(optKPSetClassificationItem,possSubsumedItem,nextPossSubsumTestItem,possSubsumCalcData)) { workTestCreated = true; } else { interpreteSubsumptionResult(optKPSetClassificationItem,possSubsumedItem->getTestingConcept(),nextPossSubsumTestItem->getTestingConcept(),possSubsumCalcData->isSubsumptionConfirmed()); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectReferenced(optKPSetClassificationItem)); //} } else { QSet* remTestingSet = optKPSetClassificationItem->getRemainingPossibleSubsumptionClassTestingSet(); remTestingSet->remove(nextPossSubsumTestItem); OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectReferenced(optKPSetClassificationItem)); } } } } if (!workTestCreated && currentItemSet->isEmpty()) { optKPSetClassificationItem->setPossibleSubsumptionTestingPhaseFinished(true); } } if (!workTestCreated) { if (optKPSetClassificationItem->hasPossibleSubsumptionTestingPhaseFinished() || ontClassItem->isTaxonomyConstructionFailed()) { finishOntologyClassification(ontClassItem); processingOntItemList.removeFirst(); } else { processingOntItemList.removeFirst(); processingOntItemList.append(ontClassItem); loopOntClassItem = ontClassItem; } } } return workTestCreated; } COptimizedKPSetClassPossibleSubsumptionData* COptimizedKPSetClassSubsumptionClassifierThread::getNextPossibleSubsumptionCalculation(COptimizedKPSetClassOntologyClassificationItem *ontClassItem, COptimizedKPSetClassTestingItem* classItem) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumer = nullptr; // I don't know which is the best, simply return the first one // sort by subsumer count? COptimizedKPSetClassPossibleSubsumptionMap* possSubsumerMap = classItem->getPossibleSubsumptionMap(false); if (possSubsumerMap) { if (mConfPossSubsumCalcOrderConceptSorted) { for (COptimizedKPSetClassPossibleSubsumptionMap::const_iterator it = possSubsumerMap->constBegin(), itEnd = possSubsumerMap->constEnd(); !possSubsumer && it != itEnd; ++it) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumData = it.value(); if (possSubsumData->isSubsumptionUnknown()) { possSubsumer = possSubsumData; } else if (possSubsumData->isUpdateRequired()) { prunePossibleSubsumptions(ontClassItem,classItem,possSubsumData); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(ontClassItem)); } } } return possSubsumer; } bool COptimizedKPSetClassSubsumptionClassifierThread::calculateSatisfiable(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassTestingItem* nextSatTestItem) { CSatisfiableCalculationJob* satCalcJob = nullptr; CClassificationWorkItem *workItem = 0; CConcept* concept = nextSatTestItem->getTestingConcept(); nextSatTestItem->setSatisfiableTestOrdered(true); bool satisfiableFlag = false; #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGB QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); #endif #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGSTATUSDESCRIPTION statUpdateMutex.lock(); statusString = QString("[%2/%3] Calculating, is '%1' satisfiable").arg(iriClassNameString).arg(optKPSetClassificationItem->getClassifierStatistics()->getTestedSatisfiableCount()).arg(optKPSetClassificationItem->getClassifierStatistics()->getTotalSatisfiableCount()); statUpdateMutex.unlock(); #endif #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGLOGOUTPUT LOG(INFO,getLogDomain(),QString("Calculating whether '%1' is satisfiable").arg(iriClassNameString),this); #endif #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCOUTOUTPUT cout<isResultSatisfiableDerivated()) { satisfiableFlag = true; nextSatTestItem->setSatisfiableTested(true); nextSatTestItem->setSatisfiableTestedResult(true); return false; } if (nextSatTestItem->isResultUnsatisfiableDerivated()) { satisfiableFlag = false; nextSatTestItem->setSatisfiableTested(true); nextSatTestItem->setSatisfiableTestedResult(false); return false; } CPrecomputedSaturationSubsumerExtractor* precSatSubsumerExtractor = optKPSetClassificationItem->getPrecomputedSaturationSubsumerExtractor(false); bool unsatisfiableFlag = false; if (precSatSubsumerExtractor && precSatSubsumerExtractor->getConceptFlags(concept,&unsatisfiableFlag,nullptr,nullptr) && unsatisfiableFlag) { satisfiableFlag = false; nextSatTestItem->setSatisfiableTested(true); nextSatTestItem->setSatisfiableTestedResult(false); return false; } if (fastSatisfiableOnlySubClassPrecheckTest(optKPSetClassificationItem,nextSatTestItem,&satisfiableFlag)) { nextSatTestItem->setSatisfiableTested(true); nextSatTestItem->setSatisfiableTestedResult(satisfiableFlag); return false; } CSatisfiableCalculationJobGenerator satCalcJobGen(optKPSetClassificationItem->getOntology()); satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(concept); QHash *workHash = optKPSetClassificationItem->getWorkItemHash(); CClassifierStatistics *ontClassStat = optKPSetClassificationItem->getClassifierStatistics(); if (ontClassStat) { ontClassStat->incCalculatedTestedSatisfiableCount(1); } workItem = new CClassificationWorkItem(satCalcJob,concept); workHash->insertMulti(satCalcJob,workItem); workOntItemHash.insert(workItem,optKPSetClassificationItem); QHash* conRefLinkDataHash = optKPSetClassificationItem->getConceptReferenceLinkingDataHash(); cint64 extFlags = CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTALL; // TODO: set extraction flags satCalcJob->setSatisfiableClassificationMessageAdapter(new CSatisfiableTaskClassificationMessageAdapter(concept,optKPSetClassificationItem->getOntology(),this,conRefLinkDataHash,extFlags)); optKPSetClassificationItem->incCurrentCalculatingCount(); processCalculationJob(satCalcJob,optKPSetClassificationItem,workItem); if (optKPSetClassificationItem->getIndividualDependenceTrackingCollector()) { satCalcJob->setSatisfiableTaskIndividualDependenceTrackingAdapter(new CSatisfiableTaskIndividualDependenceTrackingAdapter(optKPSetClassificationItem->getIndividualDependenceTrackingCollector(),nextSatTestItem)); } ++mCreatedCalculationTaskCount; return true; } bool COptimizedKPSetClassSubsumptionClassifierThread::calculateSubsumption(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassTestingItem* subsumedItem, COptimizedKPSetClassTestingItem* possSubsumerItem, COptimizedKPSetClassPossibleSubsumptionData* possSubsumData) { CSatisfiableCalculationJob* satCalcJob = nullptr; CClassificationWorkItem *workItem = 0; ++mOrderedSubsumptionCalculationCount; CConcept* subsumedConcept = subsumedItem->getTestingConcept(); CConcept* subsumerConcept = possSubsumerItem->getTestingConcept(); bool isSubsumptionFlag = false; bool precheckedSubsum = false; #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGB QString iriClassNameString1 = CIRIName::getRecentIRIName(subsumedConcept->getClassNameLinker()); QString iriClassNameString2 = CIRIName::getRecentIRIName(subsumerConcept->getClassNameLinker()); #endif #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGSTATUSDESCRIPTION statUpdateMutex.lock(); statusString = QString("Calculating, is '%1' subsumed by '%2'").arg(iriClassNameString1).arg(iriClassNameString2); statUpdateMutex.unlock(); #endif #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGLOGOUTPUT LOG(INFO,getLogDomain(),QString("Calculating whether '%1' is subsumed by '%2'").arg(iriClassNameString1).arg(iriClassNameString2),this); #endif #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCOUTOUTPUT cout<getClassifierStatistics(); if (possSubsumData && possSubsumData->isSubsumptionKnown()) { return false; } else if (possSubsumData && subsumedItem->hasSubsumerConceptItem(possSubsumerItem)) { possSubsumData->setSubsumptionConfirmed(true); return false; } else if (mConfPossSubsumPseudoModelTest && fastPseudoModelSubsumptionClassPrecheckTest(optKPSetClassificationItem,subsumedItem,possSubsumerItem,&isSubsumptionFlag)) { if (ontClassStat) { ontClassStat->incPseudoModelMergedTestedSubsumptionCount(1); } return false; } CSatisfiableCalculationJobGenerator satCalcJobGen(optKPSetClassificationItem->getOntology()); satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(subsumedConcept,false,subsumerConcept,true); QHash *workHash = optKPSetClassificationItem->getWorkItemHash(); if (ontClassStat) { ontClassStat->incCalculatedTestedSubsumptionCount(1); ontClassStat->incToldSubsumptionCount(1); } workItem = new CClassificationWorkItem(satCalcJob,subsumerConcept,subsumedConcept); workHash->insertMulti(satCalcJob,workItem); workOntItemHash.insert(workItem,optKPSetClassificationItem); QHash* conRefLinkDataHash = optKPSetClassificationItem->getConceptReferenceLinkingDataHash(); cint64 extFlags = CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTSUBSUMERSOTHERNODES | CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTPOSSIBLESUBSUMERSROOTNODE | CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTPOSSIBLESUBSUMERSOTHERNODES | CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTOTHERNODESMULTIPLEDEPENDENCY; // TODO: set extraction flags satCalcJob->setSatisfiableClassificationMessageAdapter(new CSatisfiableTaskClassificationMessageAdapter(subsumedConcept,optKPSetClassificationItem->getOntology(),this,conRefLinkDataHash,extFlags)); if (optKPSetClassificationItem->getIndividualDependenceTrackingCollector()) { satCalcJob->setSatisfiableTaskIndividualDependenceTrackingAdapter(new CSatisfiableTaskIndividualDependenceTrackingAdapter(optKPSetClassificationItem->getIndividualDependenceTrackingCollector(),subsumedItem)); } optKPSetClassificationItem->incCurrentCalculatingCount(); processCalculationJob(satCalcJob,optKPSetClassificationItem,workItem); optKPSetClassificationItem->incCalculatedPossibleSubsumerCount(); ++mCreatedCalculationTaskCount; return true; } CIndividualSaturationProcessNode* COptimizedKPSetClassSubsumptionClassifierThread::getSaturationIndividualNodeForConcept(CConcept* concept, bool negated) { CIndividualSaturationProcessNode* node = nullptr; CConceptData* conceptData = concept->getConceptData(); if (conceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)conceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* satCalcRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(negated); if (satCalcRefLinkData) { node = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } return node; } bool COptimizedKPSetClassSubsumptionClassifierThread::hasCachedSaturationIndividualNodeAssociatedExpansionProplematicConcept(CCacheEntry* cacheEntry, CConcept* testingConcept) { if (!cacheEntry) { return true; } CSaturationNodeAssociatedExpansionCacheEntry* satNodeExpCacheEntry = (CSaturationNodeAssociatedExpansionCacheEntry*)cacheEntry; CSaturationNodeAssociatedDeterministicConceptExpansion* detExp = satNodeExpCacheEntry->getDeterministicConceptExpansion(); CSaturationNodeAssociatedNondeterministicConceptExpansion* ndetExpLinker = satNodeExpCacheEntry->getNondeterministicConceptExpansionLinker(); if (!detExp && !ndetExpLinker) { return true; } CCacheValue cacheValue(mSatNodeExpCacheReader->getCacheValue(testingConcept,true)); if (detExp) { CSaturationNodeAssociatedConceptLinker* cacheValueExpLinker = detExp->getConceptExpansionLinker(&cacheValue); if (cacheValueExpLinker) { return true; } } if (ndetExpLinker && (!detExp || detExp->requiresNonDeterministicExpansion())) { bool allNonDetExpansionsProblematic = true; for (CSaturationNodeAssociatedNondeterministicConceptExpansion* ndetExpLinkerIt = ndetExpLinker; allNonDetExpansionsProblematic && ndetExpLinkerIt; ndetExpLinkerIt = ndetExpLinkerIt->getNext()) { CSaturationNodeAssociatedConceptLinker* ndetCacheValueExpLinker = ndetExpLinkerIt->getConceptExpansionLinker(&cacheValue); if (!ndetCacheValueExpLinker) { allNonDetExpansionsProblematic = false; } } if (allNonDetExpansionsProblematic) { return true; } } return false; } CCacheEntry* COptimizedKPSetClassSubsumptionClassifierThread::getAssociatedSaturationCacheEntry(COptimizedKPSetClassTestingItem* classConItem) { CCacheEntry* cacheEntry = classConItem->getFastSatisfiabilityTestedSaturationCacheEntry(); if (!cacheEntry) { CConcept* concept = classConItem->getTestingConcept(); CIndividualSaturationProcessNode* satNode = getSaturationIndividualNodeForConcept(concept,false); cacheEntry = mSatNodeExpCacheReader->getCacheEntry(satNode); classConItem->setFastSatisfiabilityTestedSaturationCacheEntry(cacheEntry); } return cacheEntry; } bool COptimizedKPSetClassSubsumptionClassifierThread::fastSatisfiableOnlySubClassPrecheckTest(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassTestingItem* nextSatTestItem, bool* isSatisfiableFlag) { QHash* conceptSatItemHash = optKPSetClassificationItem->getConceptSatisfiableTestItemHash(); CBOXHASH* triggerImpHash = optKPSetClassificationItem->getOntology()->getTBox()->getTriggerImplicationHash(false); CConcept* concept = nextSatTestItem->getTestingConcept(); bool satFlag = false; bool testComplete = false; if (concept->getOperatorCode() == CCSUB) { cint64 conCount = concept->getOperandCount(); if (conCount == 1) { CSortedNegLinker* opLinkerIt = concept->getOperandList(); CConcept* firstConcept = opLinkerIt->getData(); cint64 firstOpCode = firstConcept->getOperatorCode(); CConcept* superClassConcept = nullptr; if (!opLinkerIt->isNegated() && (firstOpCode == CCATOM || firstOpCode == CCSUB || firstOpCode == CCEQ)) { superClassConcept = firstConcept; } if ((!triggerImpHash || !triggerImpHash->contains(concept)) && superClassConcept) { COptimizedKPSetClassTestingItem* superClassConItem = conceptSatItemHash->value(superClassConcept); if (superClassConItem && superClassConItem->isSatisfiableTested()) { if (!triggerImpHash || !triggerImpHash->contains(superClassConcept)) { CCacheEntry* superCacheEntry = getAssociatedSaturationCacheEntry(superClassConItem); if (!hasCachedSaturationIndividualNodeAssociatedExpansionProplematicConcept(superCacheEntry,concept)) { nextSatTestItem->setFastSatisfiabilityTestedSaturationCacheEntry(superCacheEntry); nextSatTestItem->setSuccessfullyFastSatisfiabilityTested(true); QList* subsumedSubsumingConList = superClassConItem->getSubsumingConceptItemList(); for (QList::const_iterator it = subsumedSubsumingConList->constBegin(), itEnd = subsumedSubsumingConList->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* subsumedItem = (*it); if (nextSatTestItem != subsumedItem && superClassConItem != subsumedItem) { nextSatTestItem->addSubsumingConceptItem(subsumedItem); } } nextSatTestItem->addSubsumingConceptItem(superClassConItem); satFlag = superClassConItem->getSatisfiableTestedResult(); testComplete = true; if (superClassConItem->isClassPseudoModelInitalized()) { CClassificationClassPseudoModel* superClassPMModel = superClassConItem->getClassPseudoModel(); CClassificationClassPseudoModel* classPMModel = nextSatTestItem->getClassPseudoModel(); CTempMemoryPoolContainerAllocationManager tempMemoryPoolConAllocMan(mContext.getMemoryPoolAllocationManager()); CContext* tmpContext = CObjectParameterizingAllocator< CContextBase,CMemoryAllocationManager* >::allocateAndConstructAndParameterize(&tempMemoryPoolConAllocMan,&tempMemoryPoolConAllocMan); CClassificationClassPseudoModelHash* pmModelHash = CObjectParameterizingAllocator< CClassificationClassPseudoModelHash,CContext* >::allocateAndConstructAndParameterize(&tempMemoryPoolConAllocMan,tmpContext); pmModelHash->initPseudoModelHash(superClassPMModel->getPseudoModelHash()); CClassificationClassPseudoModelData* pmModelData = pmModelHash->getPseudoModelData(0,true); CClassificationClassPseudoModelConceptMap* pmModelConMap = pmModelData->getPseudoModelConceptMap(true); CClassificationClassPseudoModelConceptData& pmModelConData = (*pmModelConMap)[CConceptTagComparer(concept)]; pmModelConData.setDeterministic(true); optKPSetClassificationItem->addMemoryPools(tempMemoryPoolConAllocMan.takeMemoryPools()); classPMModel->setPseudoModelHash(pmModelHash); nextSatTestItem->setClassPseudoModelInitalized(true); } if (superClassConItem->isPossibleSubsumptionMapInitialized()) { COptimizedKPSetClassPossibleSubsumptionMap* superPosSubsumMap = superClassConItem->getPossibleSubsumptionMap(false); if (superPosSubsumMap && !nextSatTestItem->isPossibleSubsumptionMapInitialized()) { COptimizedKPSetClassPossibleSubsumptionMap* subPosSubsumMap = nextSatTestItem->getPossibleSubsumptionMap(true); for (COptimizedKPSetClassPossibleSubsumptionMap::const_iterator it = superPosSubsumMap->constBegin(), itEnd = superPosSubsumMap->constEnd(); it != itEnd; ++it) { CConcept* con = it.key().getConcept(); COptimizedKPSetClassPossibleSubsumptionData* data = it.value(); if (data->isSubsumptionUnknown() && !nextSatTestItem->hasSubsumerConceptItem(data->getClassItem()) && nextSatTestItem != data->getClassItem()) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumData = new COptimizedKPSetClassPossibleSubsumptionData(data->getClassItem()); subPosSubsumMap->insert(CConceptTagComparer(con),possSubsumData); incRemainingPossibleSubsumptionTestingCount(optKPSetClassificationItem,subPosSubsumMap); } } } nextSatTestItem->setPossibleSubsumptionMapInitialized(true); } } } } } } } else if (concept->getOperatorCode() == CCATOM) { COptimizedKPSetClassTestingItem* topClassConItem = optKPSetClassificationItem->getTopConceptSatisfiableTestItem(); if (topClassConItem->isPossibleSubsumptionMapInitialized()) { CCacheEntry* topCacheEntry = getAssociatedSaturationCacheEntry(topClassConItem); if (!hasCachedSaturationIndividualNodeAssociatedExpansionProplematicConcept(topCacheEntry,concept)) { nextSatTestItem->setFastSatisfiabilityTestedSaturationCacheEntry(topCacheEntry); nextSatTestItem->setSuccessfullyFastSatisfiabilityTested(true); satFlag = true; testComplete = true; CClassificationClassPseudoModel* classPMModel = nextSatTestItem->getClassPseudoModel(); CTempMemoryPoolContainerAllocationManager tempMemoryPoolConAllocMan(mContext.getMemoryPoolAllocationManager()); CContext* tmpContext = CObjectParameterizingAllocator< CContextBase,CMemoryAllocationManager* >::allocateAndConstructAndParameterize(&tempMemoryPoolConAllocMan,&tempMemoryPoolConAllocMan); CClassificationClassPseudoModelHash* pmModelHash = CObjectParameterizingAllocator< CClassificationClassPseudoModelHash,CContext* >::allocateAndConstructAndParameterize(&tempMemoryPoolConAllocMan,tmpContext); CClassificationClassPseudoModelData* pmModelData = pmModelHash->getPseudoModelData(0,true); CClassificationClassPseudoModelConceptMap* pmModelConMap = pmModelData->getPseudoModelConceptMap(true); CClassificationClassPseudoModelConceptData& pmModelConData = (*pmModelConMap)[CConceptTagComparer(concept)]; pmModelConData.setDeterministic(true); optKPSetClassificationItem->addMemoryPools(tempMemoryPoolConAllocMan.takeMemoryPools()); classPMModel->setPseudoModelHash(pmModelHash); nextSatTestItem->setClassPseudoModelInitalized(true); COptimizedKPSetClassPossibleSubsumptionMap* superPosSubsumMap = topClassConItem->getPossibleSubsumptionMap(false); if (superPosSubsumMap && !nextSatTestItem->isPossibleSubsumptionMapInitialized()) { COptimizedKPSetClassPossibleSubsumptionMap* subPosSubsumMap = nextSatTestItem->getPossibleSubsumptionMap(true); for (COptimizedKPSetClassPossibleSubsumptionMap::const_iterator it = superPosSubsumMap->constBegin(), itEnd = superPosSubsumMap->constEnd(); it != itEnd; ++it) { CConcept* con = it.key().getConcept(); COptimizedKPSetClassPossibleSubsumptionData* data = it.value(); if (data->isSubsumptionUnknown() && !nextSatTestItem->hasSubsumerConceptItem(data->getClassItem()) && nextSatTestItem != data->getClassItem()) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumData = new COptimizedKPSetClassPossibleSubsumptionData(data->getClassItem()); subPosSubsumMap->insert(CConceptTagComparer(con),possSubsumData); incRemainingPossibleSubsumptionTestingCount(optKPSetClassificationItem,subPosSubsumMap); } } } nextSatTestItem->setPossibleSubsumptionMapInitialized(true); OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } } if (satFlag && isSatisfiableFlag) { *isSatisfiableFlag = true; } return testComplete; } void COptimizedKPSetClassSubsumptionClassifierThread::incRemainingPossibleSubsumptionTestingCount(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassPossibleSubsumptionMap* posSubsumMap) { optKPSetClassificationItem->incPossibleSubsumerCount(); optKPSetClassificationItem->incRemainingPossibleSubsumptionTestsCount(); posSubsumMap->incRemainingPossibleSubsumptionCount(); ++totalToSubsumTestCount; } void COptimizedKPSetClassSubsumptionClassifierThread::decRemainingPossibleSubsumptionTestingCount(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassPossibleSubsumptionMap* posSubsumMap, bool subsumptionConfirmed) { if (subsumptionConfirmed) { optKPSetClassificationItem->incTruePossibleSubsumerCount(); } else { optKPSetClassificationItem->incFalsePossibleSubsumerCount(); } optKPSetClassificationItem->decRemainingPossibleSubsumptionTestsCount(); posSubsumMap->decRemainingPossibleSubsumptionCount(); ++subsumTestedCount; } bool COptimizedKPSetClassSubsumptionClassifierThread::fastPseudoModelSubsumptionClassPrecheckTest(COptimizedKPSetClassOntologyClassificationItem *optSubClassItem, COptimizedKPSetClassTestingItem* subsumedItem, COptimizedKPSetClassTestingItem* subsumerItem, bool* isSubsumptionFlag) { if (subsumedItem->isClassPseudoModelInitalized() && subsumerItem->isClassPseudoModelInitalized()) { CClassificationClassPseudoModel* subsumedPM = subsumedItem->getClassPseudoModel(); CClassificationClassPseudoModel* subsumerPM = subsumerItem->getClassPseudoModel(); CClassificationClassPseudoModelHash* subsumedPMHash = subsumedPM->getPseudoModelHash(); CClassificationClassPseudoModelHash* subsumerPMHash = subsumerPM->getPseudoModelHash(); CClassificationClassPseudoModelData* subsumedPMData = subsumedPMHash->getPseudoModelData(0,false); CClassificationClassPseudoModelData* subsumerPMData = subsumerPMHash->getPseudoModelData(0,false); if (subsumedPMData && subsumerPMData) { bool isSubSumPossible = isPseudoModelSubsumerPossible(optSubClassItem,subsumedPMData,subsumedPMHash,subsumerPMData,subsumerPMHash); if (!isSubSumPossible) { if (isSubsumptionFlag) { *isSubsumptionFlag = false; } return true; } } return false; } return false; } bool COptimizedKPSetClassSubsumptionClassifierThread::isPseudoModelSubsumerPossible(COptimizedKPSetClassOntologyClassificationItem *optSubClassItem, CClassificationClassPseudoModelData* subsumedPMData, CClassificationClassPseudoModelHash* subsumedPMHash, CClassificationClassPseudoModelData* subsumerPMData, CClassificationClassPseudoModelHash* subsumerPMHash) { if (subsumedPMData->hasValidConceptMap() && subsumerPMData->hasValidConceptMap()) { CClassificationClassPseudoModelConceptMap* subsumedConMap = subsumedPMData->getPseudoModelConceptMap(false); CClassificationClassPseudoModelConceptMap* subsumerConMap = subsumerPMData->getPseudoModelConceptMap(false); if (subsumedConMap && subsumerConMap) { CClassificationClassPseudoModelConceptMap::const_iterator it1 = subsumerConMap->constBegin(), it1End = subsumerConMap->constEnd(); CClassificationClassPseudoModelConceptMap::const_iterator it2 = subsumedConMap->constBegin(), it2End = subsumedConMap->constEnd(); while (it1 != it1End && it2 != it2End) { CConcept* concept1 = it1.key().getConcept(); CConcept* concept2 = it2.key().getConcept(); cint64 con1Tag = concept1->getConceptTag(); cint64 con2Tag = concept2->getConceptTag(); if (con2Tag < con1Tag) { ++it2; } else if (con2Tag == con1Tag) { ++it1; ++it2; } else if (con2Tag > con1Tag) { if (it1.value().isDeterministic()) { // in the possible subsumed model is missing a concept, subsumption is not possible return false; } ++it1; } } while (it1 != it1End) { if (it1.value().isDeterministic()) { return false; } ++it1; } } } if (subsumedPMData->hasValidRoleMap() && subsumerPMData->hasValidRoleMap()) { CClassificationClassPseudoModelRoleMap* subsumedRoleMap = subsumedPMData->getPseudoModelRoleMap(false); CClassificationClassPseudoModelRoleMap* subsumerRoleMap = subsumerPMData->getPseudoModelRoleMap(false); if (subsumedRoleMap && subsumerRoleMap) { CClassificationClassPseudoModelRoleMap::const_iterator it1 = subsumerRoleMap->constBegin(), it1End = subsumerRoleMap->constEnd(); CClassificationClassPseudoModelRoleMap::const_iterator it2 = subsumedRoleMap->constBegin(), it2End = subsumedRoleMap->constEnd(); while (it1 != it1End && it2 != it2End) { CRole* role1 = it1.key().getRole(); CRole* role2 = it2.key().getRole(); cint64 role1Tag = role1->getRoleTag(); cint64 role2Tag = role2->getRoleTag(); if (role2Tag < role1Tag) { ++it2; } else if (role2Tag == role1Tag) { const CClassificationClassPseudoModelRoleData& role1Data = it1.value(); const CClassificationClassPseudoModelRoleData& role2Data = it2.value(); if (!role1Data.isPossibleSubsumerOf(role2Data)) { // some cardinalities are not satisfy the subsumption condition return false; } cint64 succ1ID = role1Data.getSuccessorModelID(); cint64 succ2ID = role2Data.getSuccessorModelID(); CClassificationClassPseudoModelData* succ1ModelData = subsumerPMHash->getPseudoModelData(succ1ID,false); CClassificationClassPseudoModelData* succ2ModelData = subsumedPMHash->getPseudoModelData(succ2ID,false); if (succ1ModelData && succ2ModelData) { if (!isPseudoModelSubsumerPossible(optSubClassItem,succ2ModelData,subsumedPMHash,succ1ModelData,subsumerPMHash)) { return false; } } ++it1; ++it2; } else if (role2Tag > role1Tag) { if (it1.value().isDeterministic()) { // in the possible subsumed model is missing a concept, subsumption is not possible return false; } ++it1; } } while (it1 != it1End) { if (it1.value().isDeterministic()) { return false; } ++it1; } } } return true; } CSubsumptionClassifierThread *COptimizedKPSetClassSubsumptionClassifierThread::processCalculationJob(CSatisfiableCalculationJob* job, COntologyClassificationItem *ontClassItem, CClassificationWorkItem* workItem) { CClassificationCalculationStatisticsCollection* statColl = nullptr; if (ontClassItem->isCollectProcessStatisticsActivated()) { statColl = ontClassItem->getCalculationStatisticsCollection(); } job->setCalclulationStatisticsCollector(statColl); CTestCalculatedCallbackEvent *testResultCallback = new CTestCalculatedCallbackEvent(this,job,workItem,statColl); job->setCalculationConfiguration(ontClassItem->getCalculationConfiguration()); CSubsumptionClassifierThread::processCalculationJob(job,ontClassItem,testResultCallback,false); return this; } bool COptimizedKPSetClassSubsumptionClassifierThread::processToldClassificationMessage(COntologyClassificationItem *ontClassItem, CClassificationMessageData* messageDataLinker, CMemoryPool* memoryPools) { COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem = (COptimizedKPSetClassOntologyClassificationItem *)ontClassItem; OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); CClassificationMessageData* messageDataLinkerIt = messageDataLinker; while (messageDataLinkerIt) { CClassificationMessageData* messageData = messageDataLinkerIt; if (messageData->getClassificationMessageDataType() == CClassificationMessageData::TELLCLASSSUBSUMPTION) { ++mStatProcesedSubsumMessCount; CClassificationSubsumptionMessageData* subsumMessageData = (CClassificationSubsumptionMessageData*)messageData; CConcept* subsumedConcept = subsumMessageData->getSubsumedConcept(); CCLASSSUBSUMPTIONMESSAGELIST* subsumerList = subsumMessageData->getClassSubsumerList(); COptimizedKPSetClassTestingItem* subsumedItem = nullptr; subsumedItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumedConcept); //QString iriClassNameString = CIRIName::getRecentIRIName(subsumedItem->getTestingConcept()->getClassNameLinker()); //if (iriClassNameString == "http://www.owllink.org/testsuite/galen#LowerLobeOfLeftLung") { // bool bug = true; //} COptimizedKPSetClassPossibleSubsumptionMap* possSubsumMap = subsumedItem->getPossibleSubsumptionMap(false); OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); if (subsumerList) { for (CCLASSSUBSUMPTIONMESSAGELIST::const_iterator it = subsumerList->constBegin(), itEnd = subsumerList->constEnd(); it != itEnd; ++it) { CConcept* subsumerConcept(*it); COptimizedKPSetClassTestingItem* subsumerItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumerConcept); if (subsumedItem != subsumerItem) { subsumedItem->addSubsumingConceptItem(subsumerItem); if (possSubsumMap) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumData = possSubsumMap->value(subsumerConcept,nullptr); if (possSubsumData) { if (!possSubsumData->isSubsumptionConfirmed()) { possSubsumData->setSubsumptionConfirmed(true); if (possSubsumData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possSubsumData); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } } propagateDownSubsumption(optKPSetClassificationItem,subsumedItem,subsumerItem); } } } //if (!possSubsumMap || !possSubsumMap->hasRemainingPossibleSubsumptions()) { subsumedItem->setResultSatisfiableDerivated(true); //} } else if (messageData->getClassificationMessageDataType() == CClassificationMessageData::TELLCLASSINITIALIZEPOSSIBLESUBSUM) { ++mStatProcesedPossSubsumInitMessCount; CClassificationInitializePossibleSubsumptionMessageData* possSubsumMessageData = (CClassificationInitializePossibleSubsumptionMessageData*)messageData; CConcept* subsumedConcept = possSubsumMessageData->getSubsumedConcept(); CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* possSubsumerList = possSubsumMessageData->getClassPossibleSubsumerList(); bool eqConceptsNonCandidatePossSubsumers = possSubsumMessageData->hasEqConceptsNonCandidatePossSubsumers(); CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* eqConNonCandPossSubsumerList = possSubsumMessageData->getClassEqConceptNonCandidatePossibleSubsumerList(); #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGB QString iriClassNameString = CIRIName::getRecentIRIName(subsumedConcept->getClassNameLinker()); possSubsumInitConList.append(iriClassNameString); #endif COptimizedKPSetClassTestingItem* subsumedItem = nullptr; subsumedItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumedConcept); QSet* equivConNonCandidateSet = optKPSetClassificationItem->getEquivaltentConceptNonCandidateSet(); COptimizedKPSetClassPossibleSubsumptionMap* possSubsumMap = subsumedItem->getPossibleSubsumptionMap(false); if (equivConNonCandidateSet->isEmpty() && (!possSubsumerList || possSubsumerList->empty())) { if (possSubsumMap) { for (COptimizedKPSetClassPossibleSubsumptionMap::const_iterator it = possSubsumMap->constBegin(), itEnd = possSubsumMap->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumData = it.value(); if (possSubsumData->isSubsumptionUnknown()) { possSubsumData->setSubsumptionInvalid(true); if (possSubsumData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possSubsumData); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } } } else { if (!subsumedItem->isPossibleSubsumptionMapInitialized() || possSubsumMap) { possSubsumMap = subsumedItem->getPossibleSubsumptionMap(true); CBOXHASH* equivConCandidateHash = optKPSetClassificationItem->getEquivalentConceptCandidateHash(); if (possSubsumMap->isEmpty()) { // initialize the possible subsumption map if (possSubsumerList) { for (CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST::const_iterator it = possSubsumerList->constBegin(), itEnd = possSubsumerList->constEnd(); it != itEnd; ++it) { CClassificationInitializePossibleSubsumptionData* possSubsumDataIt = *it; if (possSubsumDataIt->isPossibleSubsumerValid()) { CConcept* possSubsumConcept = possSubsumDataIt->getPossibleSubsumerConcept(); if (possSubsumConcept->getOperatorCode() != CCEQ || !equivConCandidateHash->contains(possSubsumConcept)) { COptimizedKPSetClassTestingItem* possSubsumItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(possSubsumConcept); if (!subsumedItem->hasSubsumerConceptItem(possSubsumItem) && subsumedItem != possSubsumItem) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumData = new COptimizedKPSetClassPossibleSubsumptionData(possSubsumItem); possSubsumMap->insert(CConceptTagComparer(possSubsumConcept),possSubsumData); incRemainingPossibleSubsumptionTestingCount(optKPSetClassificationItem,possSubsumMap); OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } } } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); if (eqConceptsNonCandidatePossSubsumers) { if (eqConNonCandPossSubsumerList) { for (CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST::const_iterator it = eqConNonCandPossSubsumerList->constBegin(), itEnd = eqConNonCandPossSubsumerList->constEnd(); it != itEnd; ++it) { CConcept* eqConcept = *it; COptimizedKPSetClassTestingItem* possEqSubsumItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(eqConcept); if (!subsumedItem->hasSubsumerConceptItem(possEqSubsumItem) && subsumedItem != possEqSubsumItem) { if (!possSubsumMap->contains(CConceptTagComparer(eqConcept))) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumData = new COptimizedKPSetClassPossibleSubsumptionData(possEqSubsumItem); possSubsumMap->insert(CConceptTagComparer(eqConcept),possSubsumData); incRemainingPossibleSubsumptionTestingCount(optKPSetClassificationItem,possSubsumMap); } } } } } else { for (QSet::const_iterator it = equivConNonCandidateSet->constBegin(), itEnd = equivConNonCandidateSet->constEnd(); it != itEnd; ++it) { CConcept* eqConcept = *it; COptimizedKPSetClassTestingItem* possEqSubsumItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(eqConcept); if (!subsumedItem->hasSubsumerConceptItem(possEqSubsumItem) && subsumedItem != possEqSubsumItem) { if (!possSubsumMap->contains(CConceptTagComparer(eqConcept))) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumData = new COptimizedKPSetClassPossibleSubsumptionData(possEqSubsumItem); possSubsumMap->insert(CConceptTagComparer(eqConcept),possSubsumData); incRemainingPossibleSubsumptionTestingCount(optKPSetClassificationItem,possSubsumMap); } } } } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); // prune ancestor items QSet* upPropSet = subsumedItem->getUpPropagationItemSet(); for (QSet::const_iterator it = upPropSet->constBegin(), itEnd = upPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* upPropItem = *it; COptimizedKPSetClassPossibleSubsumptionMap* upPropItemPossSubsumMap = upPropItem->getPossibleSubsumptionMap(false); if (upPropItemPossSubsumMap) { COptimizedKPSetClassPossibleSubsumptionMap::const_iterator itPoss = possSubsumMap->constBegin(), itPossEnd = possSubsumMap->constEnd(); COptimizedKPSetClassPossibleSubsumptionMap::const_iterator itUpPoss = upPropItemPossSubsumMap->constBegin(), itUpPossEnd = upPropItemPossSubsumMap->constEnd(); while (itPoss != itPossEnd && itUpPoss != itUpPossEnd) { CConcept* possCon = itPoss.key().getConcept(); CConcept* possUpCon = itUpPoss.key().getConcept(); if (possCon->getConceptTag() == possUpCon->getConceptTag()) { ++itPoss; ++itUpPoss; } else if (possCon->getConceptTag() < possUpCon->getConceptTag()) { ++itPoss; } else if (possCon->getConceptTag() > possUpCon->getConceptTag()) { COptimizedKPSetClassPossibleSubsumptionData* upPossData = itUpPoss.value(); if (!subsumedItem->hasSubsumerConceptItem(upPossData->getClassItem()) && subsumedItem != upPossData->getClassItem()) { if (!upPossData->isSubsumptionInvalided()) { upPossData->setSubsumptionInvalid(true); if (upPossData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,upPropItem,upPossData); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } ++itUpPoss; } } while (itUpPoss != itUpPossEnd) { COptimizedKPSetClassPossibleSubsumptionData* upPossData = itUpPoss.value(); if (!subsumedItem->hasSubsumerConceptItem(upPossData->getClassItem()) && subsumedItem != upPossData->getClassItem()) { if (!upPossData->isSubsumptionInvalided()) { upPossData->setSubsumptionInvalid(true); if (upPossData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,upPropItem,upPossData); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } ++itUpPoss; } } } // prune descendant items QSet* downPropSet = subsumedItem->getDownPropagationItemSet(); for (QSet::const_iterator it = downPropSet->constBegin(), itEnd = downPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* downPropItem = *it; COptimizedKPSetClassPossibleSubsumptionMap* downPropItemPossSubsumMap = downPropItem->getPossibleSubsumptionMap(false); if (downPropItemPossSubsumMap) { COptimizedKPSetClassPossibleSubsumptionMap::const_iterator itPoss = possSubsumMap->constBegin(), itPossEnd = possSubsumMap->constEnd(); COptimizedKPSetClassPossibleSubsumptionMap::const_iterator itDownPoss = downPropItemPossSubsumMap->constBegin(), itDownPossEnd = downPropItemPossSubsumMap->constEnd(); while (itPoss != itPossEnd && itDownPoss != itDownPossEnd) { CConcept* possCon = itPoss.key().getConcept(); CConcept* possDownCon = itDownPoss.key().getConcept(); if (possCon->getConceptTag() == possDownCon->getConceptTag()) { ++itPoss; ++itDownPoss; } else if (possDownCon->getConceptTag() < possCon->getConceptTag()) { ++itDownPoss; } else if (possDownCon->getConceptTag() > possCon->getConceptTag()) { COptimizedKPSetClassPossibleSubsumptionData* possData = itPoss.value(); if (!downPropItem->hasSubsumerConceptItem(possData->getClassItem()) && downPropItem != possData->getClassItem()) { if (!possData->isSubsumptionInvalided()) { possData->setSubsumptionInvalid(true); if (possData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possData); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } ++itPoss; } } while (itPoss != itPossEnd) { COptimizedKPSetClassPossibleSubsumptionData* possData = itDownPoss.value(); if (!downPropItem->hasSubsumerConceptItem(possData->getClassItem()) && downPropItem != possData->getClassItem()) { if (!possData->isSubsumptionInvalided()) { possData->setSubsumptionInvalid(true); if (possData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possData); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } ++itPoss; } } else if (downPropItem->isPossibleSubsumptionMapInitialized()) { for (COptimizedKPSetClassPossibleSubsumptionMap::const_iterator itPoss = possSubsumMap->constBegin(), itPossEnd = possSubsumMap->constEnd(); itPoss != itPossEnd; ++itPoss) { COptimizedKPSetClassPossibleSubsumptionData* possData = itPoss.value(); if (!downPropItem->hasSubsumerConceptItem(possData->getClassItem()) && downPropItem != possData->getClassItem()) { if (!possData->isSubsumptionInvalided()) { possData->setSubsumptionInvalid(true); if (possData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possData); } } } } } } } else { // prune the possible subsumption map COptimizedKPSetClassPossibleSubsumptionMap::const_iterator itPoss = possSubsumMap->constBegin(), itPossEnd = possSubsumMap->constEnd(); if (possSubsumerList) { CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST::const_iterator itNew = possSubsumerList->constBegin(), itNewEnd = possSubsumerList->constEnd(); while (itPoss != itPossEnd && itNew != itNewEnd) { COptimizedKPSetClassPossibleSubsumptionData* possData = itPoss.value(); CConcept* possCon = itPoss.key().getConcept(); CClassificationInitializePossibleSubsumptionData* possNewSubsumDataIt = *itNew; if (possNewSubsumDataIt->isPossibleSubsumerValid()) { CConcept* newCon = possNewSubsumDataIt->getPossibleSubsumerConcept(); if (possCon->getConceptTag() == newCon->getConceptTag()) { ++itPoss; ++itNew; } else if (possCon->getConceptTag() < newCon->getConceptTag()) { if (possCon->getOperatorCode() != CCEQ) { if (!possData->isSubsumptionInvalided()) { possData->setSubsumptionInvalid(true); if (possData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possData); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } ++itPoss; } else if (possCon->getConceptTag() > newCon->getConceptTag()) { ++itNew; } } else { ++itNew; } } } while (itPoss != itPossEnd) { COptimizedKPSetClassPossibleSubsumptionData* possData = itPoss.value(); CConcept* possCon = itPoss.key().getConcept(); if (possCon->getOperatorCode() != CCEQ) { if (!possData->isSubsumptionInvalided()) { possData->setSubsumptionInvalid(true); if (possData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possData); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } ++itPoss; } } } } subsumedItem->setPossibleSubsumptionMapInitialized(true); } else if (messageData->getClassificationMessageDataType() == CClassificationMessageData::TELLCLASSUPDATEPOSSIBLESUBSUM) { ++mStatProcesedPossSubsumUpdateMessCount; CClassificationUpdatePossibleSubsumptionMessageData* possSubsumMessageData = (CClassificationUpdatePossibleSubsumptionMessageData*)messageData; CConcept* subsumedConcept = possSubsumMessageData->getSubsumedConcept(); COptimizedKPSetClassTestingItem* subsumedItem = nullptr; subsumedItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumedConcept); COptimizedKPSetClassPossibleSubsumptionMap* possSubsumMap = subsumedItem->getPossibleSubsumptionMap(false); if (possSubsumMap && !possSubsumMap->empty()) { possSubsumMap = subsumedItem->getPossibleSubsumptionMap(true); for (COptimizedKPSetClassPossibleSubsumptionMap::const_iterator it = possSubsumMap->constBegin(), itEnd = possSubsumMap->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumData = it.value(); if (possSubsumData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possSubsumData); OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } } } } else if (messageData->getClassificationMessageDataType() == CClassificationMessageData::TELLCLASSPSEUDOMODELIDENTIFIERS) { ++mStatProcesedPseudoModelMessCount; CClassificationPseudoModelIdentifierMessageData* pmMessageData = (CClassificationPseudoModelIdentifierMessageData*)messageData; CConcept* pmConcept = pmMessageData->getPseudoModelConcept(); CMemoryPool* pmMemoryPools = pmMessageData->getPseudoModelMemoryPools(); CClassificationClassPseudoModelHash* pmHash = pmMessageData->getPseudoModelHash(); COptimizedKPSetClassTestingItem* pmItem = nullptr; pmItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(pmConcept); pmItem->getClassPseudoModel()->setPseudoModelHash(pmHash); pmItem->setClassPseudoModelInitalized(true); optKPSetClassificationItem->addMemoryPools(pmMemoryPools); } messageDataLinkerIt = messageDataLinkerIt->getNext(); } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); return true; } bool COptimizedKPSetClassSubsumptionClassifierThread::interpreteToldSubsumptionResult(COntologyClassificationItem *ontClassItem, const QList > &subSumRelList, bool isSubSum) { CConcept *lastConcept = nullptr; COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem = (COptimizedKPSetClassOntologyClassificationItem *)ontClassItem; COptimizedKPSetClassTestingItem* subsumerItem = nullptr; for (QList >::const_iterator it = subSumRelList.constBegin(), itEnd = subSumRelList.constEnd(); it != itEnd; ++it) { CConcept *subsumerConcept = it->first; if (lastConcept != subsumerConcept) { lastConcept = subsumerConcept; subsumerItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumerConcept); } CConcept *subsumedConcept = it->second; if (isSubSum) { COptimizedKPSetClassTestingItem* subsumedItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumedConcept); subsumerItem->addSubsumingConceptItem(subsumedItem); } } return true; } bool COptimizedKPSetClassSubsumptionClassifierThread::interpreteSubsumptionResult(COntologyClassificationItem *ontClassItem, CConcept *subsumedConcept, CConcept *subsumerConcept, bool isSubsumption) { COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem = (COptimizedKPSetClassOntologyClassificationItem *)ontClassItem; ++mInterpretedSubsumptionCalculationCount; CConcept* candidateConcept = subsumerConcept; if (subsumerConcept->getOperatorCode() == CCEQ) { candidateConcept = optKPSetClassificationItem->getEquivalentConceptCandidateHash()->value(subsumerConcept); if (!candidateConcept) { candidateConcept = subsumerConcept; } } optKPSetClassificationItem->decRunningPossibleSubsumptionTestsCount(); COptimizedKPSetClassTestingItem* subsumedItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumedConcept); COptimizedKPSetClassTestingItem* subsumerItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumerConcept); //QString iriClassNameString1 = CIRIName::getRecentIRIName(subsumedConcept->getClassNameLinker()); //QString iriClassNameString2 = CIRIName::getRecentIRIName(subsumerConcept->getClassNameLinker()); //if (iriClassNameString1 == "http://purl.org/biotop/biotop.owl#EntireCarbohydrateMonomer" && iriClassNameString2 == "http://purl.org/biotop/biotop.owl#EntireMolecularEntity" && !isSubsumption) { // bool bug = true; // calculateSubsumption(optKPSetClassificationItem,subsumedItem,subsumerItem,nullptr); // return false; //} //if (iriClassNameString1 == "http://www.bootstrep.eu/ontology/GRO#BindingOfProteinToProteinBindingSiteOfDNA" && iriClassNameString2 == "http://www.bootstrep.eu/ontology/GRO#DNAProteinInteraction") { // bool isSubsumptionFlag = false; // if (fastPseudoModelSubsumptionClassPrecheckTest(optKPSetClassificationItem,subsumedItem,subsumerItem,&isSubsumptionFlag)) { // if (isSubsumptionFlag != isSubsumption) { // while (true) { // fastPseudoModelSubsumptionClassPrecheckTest(optKPSetClassificationItem,subsumedItem,subsumerItem,&isSubsumptionFlag); // } // } // } //} COptimizedKPSetClassTestingItem* topItem = optKPSetClassificationItem->getTopConceptSatisfiableTestItem(); COptimizedKPSetClassPossibleSubsumptionMap* possSubsumMap = subsumedItem->getPossibleSubsumptionMap(false); COptimizedKPSetClassPossibleSubsumptionData* possSubsumData = nullptr; if (possSubsumMap) { possSubsumData = possSubsumMap->value(candidateConcept); } if (isSubsumption) { optKPSetClassificationItem->incCalculatedTruePossibleSubsumerCount(); if (possSubsumData) { possSubsumData->setSubsumptionConfirmed(true); } subsumedItem->addSubsumingConceptItem(subsumerItem); subsumedItem->addUpPropagationItem(subsumerItem); subsumerItem->addDownPropagationItem(subsumedItem); propagateDownSubsumption(optKPSetClassificationItem,subsumedItem,subsumerItem); } else { //if (CIRIName::getRecentIRIName(possSubsumData->getClassItem()->getTestingConcept()->getClassNameLinker()) == "http://www.loria.fr/~coulet/ontology/snpontology/version1.6/snpontology_full.owl#haplotype") { // LOG(ERROR,getLogDomain(),logTr("Calcualted non subsumption with haplotype for item %1.").arg(CIRIName::getRecentIRIName(subsumedItem->getTestingConcept()->getClassNameLinker())),getLogObject()); // bool bug = true; //} optKPSetClassificationItem->incCalculatedFalsePossibleSubsumerCount(); if (possSubsumData) { possSubsumData->setSubsumptionInvalid(true); } } if (possSubsumData && possSubsumData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possSubsumData); OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); } QList* nextItemList = optKPSetClassificationItem->getNextPossibleSubsumptionTestingItemList(); QSet* currentItemSet = optKPSetClassificationItem->getCurrentPossibleSubsumptionTestingItemSet(); if (mConfPossSubsumCalcOrderTopDown) { if (currentItemSet->contains(subsumedItem)) { currentItemSet->remove(subsumedItem); if (possSubsumMap) { if (possSubsumMap->hasRemainingPossibleSubsumptions()) { nextItemList->prepend(subsumedItem); } else { QSet* remTestingSet = optKPSetClassificationItem->getRemainingPossibleSubsumptionClassTestingSet(); remTestingSet->remove(subsumedItem); } } } } if (mConfPossSubsumCalcOrderBottomUp) { if (currentItemSet->contains(subsumerItem)) { currentItemSet->remove(subsumerItem); if (subsumerItem->hasRemainingPossibleSubsumedItems()) { QSet* remPossSubsumedItemSet = subsumerItem->getPossibleSubsumedSet(false); QList* remPossSubsumedItemList = subsumerItem->getPossibleSubsumedList(); nextItemList->prepend(subsumerItem); QSet* upPropSet = subsumedItem->getUpPropagationItemSet(); for (QSet::const_iterator itUp = upPropSet->constBegin(), itUpEnd = upPropSet->constEnd(); itUp != itUpEnd; ++itUp) { COptimizedKPSetClassTestingItem* upItem = *itUp; if (remPossSubsumedItemSet->contains(upItem)) { remPossSubsumedItemList->prepend(upItem); } } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectReferenced(optKPSetClassificationItem)); } else { QSet* remTestingSet = optKPSetClassificationItem->getRemainingPossibleSubsumptionClassTestingSet(); remTestingSet->remove(subsumerItem); OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectReferenced(optKPSetClassificationItem)); } } } return true; } bool COptimizedKPSetClassSubsumptionClassifierThread::prunePossibleSubsumptions(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassTestingItem* item, COptimizedKPSetClassPossibleSubsumptionData* possSubsumData) { //if (possSubsumData->isSubsumptionInvalided()) { // //if (CIRIName::getRecentIRIName(item->getTestingConcept()->getClassNameLinker()) == "http://www.w3.org/2002/07/owl#Thing") { // if (CIRIName::getRecentIRIName(possSubsumData->getClassItem()->getTestingConcept()->getClassNameLinker()) == "http://www.loria.fr/~coulet/ontology/snpontology/version1.6/snpontology_full.owl#haplotype") { // LOG(ERROR,getLogDomain(),logTr("Pruned haplotype for item %1.").arg(CIRIName::getRecentIRIName(item->getTestingConcept()->getClassNameLinker())),getLogObject()); // bool bug = true; // } // //} //} if (possSubsumData->isUpdateRequired()) { COptimizedKPSetClassPossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); possSubsumData->setSubsumptionUpdated(true); decRemainingPossibleSubsumptionTestingCount(optKPSetClassificationItem,possSubsumMap,true); if (possSubsumData->isSubsumptionConfirmed()) { // is subsuming COptimizedKPSetClassTestingItem* subsumerItem = possSubsumData->getClassItem(); CConcept* subsumerConcept = subsumerItem->getTestingConcept(); // establish the subsumption for all successor nodes QSet* downPropSet = item->getDownPropagationItemSet(); for (QSet::const_iterator it = downPropSet->constBegin(), itEnd = downPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* downPropItem = *it; pruneDownSubsumption(optKPSetClassificationItem,downPropItem,subsumerConcept); } if (subsumerConcept->getOperatorCode() == CCEQ) { CConcept* candidateConcept = optKPSetClassificationItem->getEquivalentConceptCandidateHash()->value(subsumerConcept); if (candidateConcept) { for (QSet::const_iterator it = downPropSet->constBegin(), itEnd = downPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* downPropItem = *it; pruneDownSubsumption(optKPSetClassificationItem,downPropItem,candidateConcept); } } } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); return true; } else { // is not subsuming COptimizedKPSetClassTestingItem* notSubsumerItem = possSubsumData->getClassItem(); CConcept* notSubsumerConcept = notSubsumerItem->getTestingConcept(); // establish the subsumption for all successor nodes QSet* upPropSet = item->getUpPropagationItemSet(); for (QSet::const_iterator it = upPropSet->constBegin(), itEnd = upPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* upPropItem = *it; pruneUpNotSubsumption(optKPSetClassificationItem,upPropItem,notSubsumerConcept); } if (notSubsumerConcept->getOperatorCode() == CCEQ) { CConcept* candidateConcept = optKPSetClassificationItem->getEquivalentConceptCandidateHash()->value(notSubsumerConcept); if (candidateConcept) { for (QSet::const_iterator it = upPropSet->constBegin(), itEnd = upPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* upPropItem = *it; pruneUpNotSubsumption(optKPSetClassificationItem,upPropItem,candidateConcept); } } } OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(testDebugPossibleSubsumerCorrectCounted(optKPSetClassificationItem)); return true; } } return false; } bool COptimizedKPSetClassSubsumptionClassifierThread::propagateDownSubsumption(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassTestingItem* item, COptimizedKPSetClassTestingItem* subsumerItem) { bool propagated = false; QSet* downPropSet = item->getDownPropagationItemSet(); for (QSet::const_iterator it = downPropSet->constBegin(), itEnd = downPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* downPropItem = *it; if (!downPropItem->hasSubsumerConceptItem(subsumerItem) && downPropItem != subsumerItem) { downPropItem->addSubsumingConceptItem(subsumerItem); propagateDownSubsumption(optKPSetClassificationItem,downPropItem,subsumerItem); propagated = true; } } return propagated; } bool COptimizedKPSetClassSubsumptionClassifierThread::pruneDownSubsumption(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassTestingItem* item, CConcept* subsumerConcept) { COptimizedKPSetClassPossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); if (possSubsumMap) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumData = possSubsumMap->value(subsumerConcept); if (possSubsumData && !possSubsumData->isSubsumptionConfirmed()) { possSubsumData->setSubsumptionConfirmed(true); possSubsumData->setSubsumptionUpdated(true); decRemainingPossibleSubsumptionTestingCount(optKPSetClassificationItem,possSubsumMap,true); CClassifierStatistics *ontClassStat = optKPSetClassificationItem->getClassifierStatistics(); if (ontClassStat) { ontClassStat->incDerivatedTestedSubsumptionCount(1); } QSet* downPropSet = item->getDownPropagationItemSet(); for (QSet::const_iterator it = downPropSet->constBegin(), itEnd = downPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* downPropItem = *it; pruneDownSubsumption(optKPSetClassificationItem,downPropItem,subsumerConcept); } return true; } } return false; } bool COptimizedKPSetClassSubsumptionClassifierThread::pruneUpNotSubsumption(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetClassTestingItem* item, CConcept* notSubsumerConcept) { COptimizedKPSetClassPossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); if (possSubsumMap) { COptimizedKPSetClassPossibleSubsumptionData* possSubsumData = possSubsumMap->value(notSubsumerConcept); if (possSubsumData && !possSubsumData->isSubsumptionInvalided()) { possSubsumData->setSubsumptionInvalid(true); possSubsumData->setSubsumptionUpdated(true); decRemainingPossibleSubsumptionTestingCount(optKPSetClassificationItem,possSubsumMap,false); CClassifierStatistics *ontClassStat = optKPSetClassificationItem->getClassifierStatistics(); if (ontClassStat) { ontClassStat->incPrunedTestedSubsumptionCount(1); } QSet* upPropSet = item->getUpPropagationItemSet(); for (QSet::const_iterator it = upPropSet->constBegin(), itEnd = upPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* upPropItem = *it; pruneUpNotSubsumption(optKPSetClassificationItem,upPropItem,notSubsumerConcept); } return true; } } return false; } bool COptimizedKPSetClassSubsumptionClassifierThread::interpreteSatisfiableResult(COntologyClassificationItem *ontClassItem, CConcept *satisfiableConcept, bool isSatis) { COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem = (COptimizedKPSetClassOntologyClassificationItem *)ontClassItem; CClassifierStatistics *ontClassStat = optKPSetClassificationItem->getClassifierStatistics(); if (ontClassStat) { ontClassStat->incToldSatisfiableCount(1); } ++satTestedCount; optKPSetClassificationItem->decRunningSatisfiableTestsCount(); COptimizedKPSetClassTestingItem* satTestedItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(satisfiableConcept); //if (CIRIName::getRecentIRIName(satisfiableConcept->getClassNameLinker()) == "http://www.gdst.uqam.ca/Documents/Ontologies/HIT/Equipment_SH_Ontology.owl#Folding_chair" && !isSatis) { // bool bug = true; // calculateSatisfiable(optKPSetClassificationItem,satTestedItem); // return false; //} satTestedItem->setSatisfiableTested(true); satTestedItem->setSatisfiableTestedResult(isSatis); COptimizedKPSetClassTestingItem* topItem = optKPSetClassificationItem->getTopConceptSatisfiableTestItem(); if (isSatis) { // update processing lists #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGB QString iriClassNameString = CIRIName::getRecentIRIName(satisfiableConcept->getClassNameLinker()); satTestedConList.append(iriClassNameString); #endif #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGLOGOUTPUT LOG(INFO,getLogDomain(),QString("[%1 / %2] Calculated: '%3' is satisfiable").arg(satTestedCount).arg(totalToSatTestClassCount).arg(iriClassNameString),this); #endif #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGSTATUSDESCRIPTION statUpdateMutex.lock(); statusString = QString("Interpreting, '%1' is satisfiable").arg(iriClassNameString); statUpdateMutex.unlock(); #endif #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCOUTOUTPUT cout<addSatisfiableConceptItem(satTestedItem); } else { CTaxonomy *tax = optKPSetClassificationItem->getTaxonomy(); if (topItem) { tax->setConceptSatisfiable(satisfiableConcept,false); } else { tax->getBottomHierarchyNode()->addEquivalentConcept(satisfiableConcept); tax->updateNodeEquivalences(tax->getBottomHierarchyNode()); } } QList* nextItemList = optKPSetClassificationItem->getNextSatisfiableTestingItemList(); QSet* nextCandItemSet = optKPSetClassificationItem->getNextCandidateSatisfiableTestingItemSet(); QSet* remainingCandItemSet = optKPSetClassificationItem->getRemainingCandidateSatisfiableTestingItemSet(); QList* subSumItemList = satTestedItem->getSubsumingConceptItemList(); QList* succItemList = satTestedItem->getSuccessorItemList(); for (QList::const_iterator it = succItemList->constBegin(), itEnd = succItemList->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* succItem = *it; if (!isSatis) { succItem->setResultUnsatisfiableDerivated(true); } else { for (QList::const_iterator itSubsum = subSumItemList->constBegin(), itSubsumEnd = subSumItemList->constEnd(); itSubsum != itSubsumEnd; ++itSubsum) { COptimizedKPSetClassTestingItem* subusmerItem = *itSubsum; if (succItem != subusmerItem) { succItem->addSubsumingConceptItem(subusmerItem); } } } succItem->decUnprocessedPredecessorItems(); if (succItem->hasOnlyProcessedPredecessorItems()) { nextItemList->append(succItem); } else { nextCandItemSet->insert(succItem); } } return false; } bool COptimizedKPSetClassSubsumptionClassifierThread::interpreteTestResults(CTestCalculatedCallbackEvent *testResult) { CSatisfiableCalculationJob *satCalcJob = testResult->getSatisfiableCalculationJob(); bool testSat = testResult->getTestResultSatisfiable(); CClassificationWorkItem *workItem = testResult->getClassificationWorkItem(); ++mRecievedCallbackCount; COntologyClassificationItem *ontClassItem = workOntItemHash.value(workItem); if (ontClassItem) { QHash *workHash = ontClassItem->getWorkItemHash(); CTaxonomy *taxonomy = ontClassItem->getTaxonomy(); if (workItem) { ontClassItem->decCurrentCalculatingCount(); if (workItem->isTestValid()) { if (testResult->hasCalculationError()) { LOG(ERROR,getLogDomain(),logTr("Error in computation, classification for ontology '%1' failed.").arg(ontClassItem->getOntology()->getTerminologyName()),getLogObject()); ontClassItem->setTaxonomyConstructionFailed(); } else { if (workItem->isConceptSatisfiableTest()) { interpreteSatisfiableResult(ontClassItem,workItem->getSatisfiableTestedConcept(),testSat); } else if (workItem->isConceptSubsumptionTest()) { interpreteSubsumptionResult(ontClassItem,workItem->getSubsumedTestedConcept(),workItem->getSubsumerTestedConcept(),!testSat); } } } QHash::iterator itWorkItem = workHash->find(satCalcJob); while (itWorkItem != workHash->end()) { if (itWorkItem.value() == workItem) { workHash->erase(itWorkItem); break; } ++itWorkItem; } delete workItem; delete satCalcJob; } workOntItemHash.remove(workItem); CClassificationCalculationStatisticsCollection* statisticCollection = testResult->getUsedStatisticsCollection(); if (statisticCollection) { ontClassItem->reuseCalculationStatisticsCollection(statisticCollection); } #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGTAXONOMYCOUTOUTPUT QString taxString = taxonomy->getConceptHierarchyString(); cout<isTaxonomyConstructed() && !ontClassItem->isTaxonomyConstructionFailed()) { #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGLOGOUTPUT LOG(INFO,getLogDomain(),QString("Building Class Taxonomy"),this); #endif CTaxonomy *taxonomy = ontClassItem->getTaxonomy(); CConcreteOntology *ontology = ontClassItem->getOntology(); LOG(INFO,getLogDomain(),logTr("Starting Transitive Reduction for Ontology '%1'.").arg(ontology->getTerminologyName()),getLogObject()); // build taxonomy COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem = (COptimizedKPSetClassOntologyClassificationItem *)ontClassItem; QList* satItemList = optKPSetClassificationItem->getSatisfiableConceptItemList(); OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGCONSISTENCYTEST(createDebugKPSetString(optKPSetClassificationItem,"classkpsets-final.txt")); CTaxonomy *tax = optKPSetClassificationItem->getTaxonomy(); QList itemList; COptimizedKPSetClassTestingItem* topItem = optKPSetClassificationItem->getTopConceptSatisfiableTestItem(); CHierarchyNode* topHierNode = tax->getTopHierarchyNode(); CHierarchyNode* bottomHierNode = tax->getBottomHierarchyNode(); cint64 topSubsumingItemCount = topItem->getSubsumingConceptItemCount(); topItem->setSatisfiableConceptHierarchyNode(topHierNode); if (topSubsumingItemCount) { QList* subsumingConceptItemList = topItem->sortSubsumingConceptItemList(); for (QList::const_iterator subsumedIt = subsumingConceptItemList->constBegin(), subsumedItEnd = subsumingConceptItemList->constEnd(); subsumedIt != subsumedItEnd; ++subsumedIt) { COptimizedKPSetClassTestingItem* subsumedConceptItem = *subsumedIt; // mark as equivalent subsumedConceptItem->setEquivalentItem(true); topHierNode->addEquivalentConcept(subsumedConceptItem->getTestingConcept()); tax->updateNodeEquivalences(topHierNode); } } LOG(INFO,getLogDomain(),logTr("Sorting classes for Ontology '%1'.").arg(ontology->getTerminologyName()),getLogObject()); for (QList::const_iterator it = satItemList->constBegin(), itEnd = satItemList->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* item = *it; //QString iriClassNameString = CIRIName::getRecentIRIName(item->getTestingConcept()->getClassNameLinker()); //if (iriClassNameString == "http://ontology.dumontierlab.com/UnitRaisedToPower") { // bool bug = true; //} if (!item->isEquivalentItem() && item != topItem) { CHierarchyNode* itemNode = tax->getHierarchyNode(item->getTestingConcept(),true); item->setSatisfiableConceptHierarchyNode(itemNode); cint64 itemSubsumingCount = item->getSubsumingConceptItemCount(); itemList.append(item); if (itemSubsumingCount > topSubsumingItemCount) { QList* subsumingConceptItemList = item->sortSubsumingConceptItemList(); for (QList::const_iterator subsumedIt = subsumingConceptItemList->constBegin(), subsumedItEnd = subsumingConceptItemList->constEnd(); subsumedIt != subsumedItEnd; ++subsumedIt) { COptimizedKPSetClassTestingItem* subsumedConceptItem = *subsumedIt; cint64 subsumedItemSubsumingCount = subsumedConceptItem->getSubsumingConceptItemCount(); if (subsumedItemSubsumingCount == itemSubsumingCount) { // mark as equivalent subsumedConceptItem->setEquivalentItem(true); itemNode->addEquivalentConcept(subsumedConceptItem->getTestingConcept()); tax->updateNodeEquivalences(itemNode); } else { break; } } } } } LOG(INFO,getLogDomain(),logTr("Transitive Reduction for Ontology '%1'.").arg(ontology->getTerminologyName()),getLogObject()); for (QList::const_iterator it = itemList.constBegin(), itEnd = itemList.constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* item = *it; //QString iriClassNameString = CIRIName::getRecentIRIName(item->getTestingConcept()->getClassNameLinker()); //if (iriClassNameString == "http://usefulinc.com/ns/doap#Project") { // bool bug = true; //} if (!item->isEquivalentItem() && item != topItem) { cint64 itemSubsumingCount = item->getSubsumingConceptItemCount(); CHierarchyNode* itemHierNode = item->getSatisfiableConceptHierarchyNode(); QList* subsumingConceptItemList = item->getSubsumingConceptItemList(); QList::const_iterator subsumedIt = subsumingConceptItemList->constBegin(), subsumedItEnd = subsumingConceptItemList->constEnd(); cint64 eqCount = 0; cint64 remainingSubsumingCount = itemSubsumingCount; // remove direct equivalences while (subsumedIt != subsumedItEnd) { COptimizedKPSetClassTestingItem* subsumedConceptItem = *subsumedIt; cint64 subsumedItemSubsumingCount = subsumedConceptItem->getSubsumingConceptItemCount(); if (itemSubsumingCount != subsumedItemSubsumingCount) { break; } else { ++eqCount; ++subsumedIt; --remainingSubsumingCount; } } while (subsumedIt != subsumedItEnd && (*subsumedIt)->isEquivalentItem()) { ++subsumedIt; } // find first parent if (subsumedIt == subsumedItEnd) { // no parent, use top as parent itemHierNode->makeParent(topHierNode); } else { itemHierNode->addPredecessorNode(topHierNode); QList parentItemList; while (subsumedIt != subsumedItEnd) { COptimizedKPSetClassTestingItem* subsumedConceptItem = *subsumedIt; if (!subsumedConceptItem->isEquivalentItem()) { subsumedConceptItem->setPredecessorItem(true); CHierarchyNode* subsumedHierNode = subsumedConceptItem->getSatisfiableConceptHierarchyNode(); itemHierNode->makeParent(subsumedHierNode); parentItemList.append(subsumedConceptItem); remainingSubsumingCount -= subsumedConceptItem->getSubsumingConceptItemCount()+1; ++subsumedIt; break; } else { ++subsumedIt; } } bool searchForMoreParents = remainingSubsumingCount > 0; while (subsumedIt != subsumedItEnd) { COptimizedKPSetClassTestingItem* subsumedConceptItem = *subsumedIt; if (!subsumedConceptItem->isEquivalentItem()) { bool predOfOnePrevParent = false; if (searchForMoreParents) { for (QList::const_iterator parentIt = parentItemList.constBegin(), parentItEnd = parentItemList.constEnd(); parentIt != parentItEnd && !predOfOnePrevParent; ++parentIt) { COptimizedKPSetClassTestingItem* parentItem = *parentIt; if (parentItem->getSubsumingConceptItemSet()->contains(subsumedConceptItem)) { predOfOnePrevParent = true; } } } subsumedConceptItem->setPredecessorItem(true); CHierarchyNode* subsumedHierNode = subsumedConceptItem->getSatisfiableConceptHierarchyNode(); if (!predOfOnePrevParent && searchForMoreParents) { itemHierNode->makeParent(subsumedHierNode); parentItemList.append(subsumedConceptItem); } else { itemHierNode->addPredecessorNode(subsumedHierNode); } } ++subsumedIt; } } } } for (QList::const_iterator it = itemList.constBegin(), itEnd = itemList.constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* item = *it; if (!item->isPredecessorItem() && !item->isEquivalentItem()) { CHierarchyNode* itemHierNode = item->getSatisfiableConceptHierarchyNode(); bottomHierNode->makeParent(itemHierNode); } } LOG(INFO,getLogDomain(),logTr("Collect statistics for Ontology '%1'.").arg(ontology->getTerminologyName()),getLogObject()); #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGSTATUSDESCRIPTION statUpdateMutex.lock(); statusString = QString("Finished ontology classification"); statUpdateMutex.unlock(); #endif CClassification* classification = ontology->getClassification(); if (classification) { CClassConceptClassification* classConClassification = ontClassItem->getClassConceptClassification(); addClassificationStatistics(ontClassItem,classConClassification); if (ontClassItem->getIndividualDependenceTrackingCollector()) { classConClassification->setDependentIndividualsTracking(ontClassItem->getIndividualDependenceTrackingCollector()->getExtendingIndividualDependenceTracking()); } classConClassification->setClassConceptTaxonomy(taxonomy); CClassificationStatisticsCollectionStrings* classifStatCollStrings = ontClassItem->getClassificationStatisticsCollectionStrings(); classConClassification->setClassificationStatistics(classifStatCollStrings); classification->setClassConceptClassification(classConClassification); } ontology->setConceptTaxonomy(taxonomy); ontClassItem->setGoneOutRemainingTests(false); taxonomy->setTaxonomyComplete(true); --mClassificationCount; LOG(INFO,getLogDomain(),logTr("Ontology '%1' classified.").arg(ontology->getTerminologyName()),getLogObject()); LOG(INFO,getLogDomain(),logTr("Used %1 satisfiable tests, %2 pseudo model merged subsumption tests and %3 calculated subsumption tests.").arg(ontClassItem->getCalcedSatisfiableCount()).arg(ontClassItem->getClassifierStatistics()->getPseudoModelMergedTestedSubsumptionCount()).arg(ontClassItem->getClassifierStatistics()->getCalculatedTestedSubsumptionCount()),getLogObject()); LOG(INFO,getLogDomain(),logTr("Confirmed %1 of %2 possible subsumer concepts.").arg(optKPSetClassificationItem->getTruePossibleSubsumerCount()).arg(optKPSetClassificationItem->getPossibleSubsumerCount()),getLogObject()); LOG(INFO,getLogDomain(),logTr("Confirmed %1 and invalidated %2 possible subsumer concepts with calculation.").arg(optKPSetClassificationItem->getCalculatedTruePossibleSubsumerCount()).arg(optKPSetClassificationItem->getFalsePossibleSubsumerCount()),getLogObject()); } ontClassItem->submitTaxonomyConstructed(); ontClassItem->doClassifiedCallback(); return true; } bool COptimizedKPSetClassSubsumptionClassifierThread::addClassificationStatistics(COntologyClassificationItem *ontClassItem, CClassConceptClassification* classConClassification) { CClassificationStatisticsCollectionStrings* classifStatCollStrings = ontClassItem->getClassificationStatisticsCollectionStrings(); CClassifierStatistics* classifierStats = ontClassItem->getClassifierStatistics(); classifStatCollStrings->addProcessingStatistics("class-classification-total-satisfiable-test-count",classifierStats->getTotalSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("class-classification-satisfiable-tested-count",classifierStats->getTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("class-classification-satisfiable-pseudo-model-merged-tested-count",classifierStats->getPseudoModelMergedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("class-classification-satisfiable-derivation-tested-count",classifierStats->getDerivatedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("class-classification-satisfiable-calculated-tested-count",classifierStats->getCalculatedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("class-classification-satisfiable-pruned-tested-count",classifierStats->getPrunedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("class-classification-satisfiable-told-tested-count",classifierStats->getToldSatisfiableCount()-classifierStats->getCalculatedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("class-classification-total-subsumption-test-count",classifierStats->getTotalSatisfiableCount()*(classifierStats->getTotalSatisfiableCount()-1)); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-tested-count",classifierStats->getTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-pseudo-model-merged-tested-count",classifierStats->getPseudoModelMergedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-subclass-tested-count",classifierStats->getSubclassTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-subclass-identifier-occur-tested-count",classifierStats->getSubclassIdentifierOccurTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-derivation-tested-count",classifierStats->getDerivatedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-calculated-tested-count",classifierStats->getCalculatedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-pruned-tested-count",classifierStats->getPrunedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-told-tested-count",classifierStats->getToldSubsumptionCount()-classifierStats->getCalculatedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-time",ontClassItem->getInitializationTime()->elapsed()); COntologyProcessingStatistics* ontProcStats = ontClassItem->getClassificationProcessingStep()->getProcessingStatistics(true); ontProcStats->setProcessingCountStatisticValue("class-classification-time",ontClassItem->getInitializationTime()->elapsed()); COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem = dynamic_cast(ontClassItem); if (optKPSetClassificationItem) { addIndividualDependencyTrackingStatistics(optKPSetClassificationItem); } return true; } COptimizedKPSetClassSubsumptionClassifierThread* COptimizedKPSetClassSubsumptionClassifierThread::addIndividualDependencyTrackingStatistics(COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem, const QString& classificationTypeString) { if (optKPSetClassificationItem->getIndividualDependenceTrackingCollector()) { CClassificationStatisticsCollectionStrings* classifStatCollStrings = optKPSetClassificationItem->getClassificationStatisticsCollectionStrings(); CIndividualDependenceTracking* indiDepTack = optKPSetClassificationItem->getIndividualDependenceTrackingCollector()->getExtendingIndividualDependenceTracking(); if (indiDepTack) { classifStatCollStrings->addProcessingStatistics(QString("%1-tracked-node-dependency-size").arg(classificationTypeString),indiDepTack->getDependenceSize()); classifStatCollStrings->addProcessingStatistics(QString("%1-tracked-node-dependency-count").arg(classificationTypeString),1); } } return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationWorkItem.h0000644000175000017500000000552312520550752027025 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONWORKITEM_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONWORKITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Taxonomy/CTaxonomy.h" #include "Reasoner/Query/CSatisfiableCalculationJob.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Taxonomy; using namespace Query; namespace Classifier { /*! * * \class CClassificationWorkItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationWorkItem { // public methods public: //! Constructor CClassificationWorkItem(CSatisfiableCalculationJob* satCalcJob, CConcept *satisfiableTestedConcept); CClassificationWorkItem(CSatisfiableCalculationJob* satCalcJob, CConcept *subsumerTestedConcept, CConcept *subsumedTestedConcept); //! Destructor virtual ~CClassificationWorkItem(); virtual bool isTestValid(); virtual CClassificationWorkItem *setTestInvalid(); virtual bool isConceptSatisfiableTest(); virtual bool isConceptSubsumptionTest(); virtual CConcept *getSatisfiableTestedConcept(); virtual CConcept *getSubsumerTestedConcept(); virtual CConcept *getSubsumedTestedConcept(); virtual CSatisfiableCalculationJob* getSatisfiableCalculationJob(); virtual bool testIsTestRedundant(CTaxonomy *taxonomy); // protected methods protected: // protected variables protected: CSatisfiableCalculationJob* mSatCalcJob; bool testValid; bool conceptSatisfiableTest; bool conceptSubsumptionTest; CConcept *con0; CConcept *con1; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONWORKITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationMessageData.cpp0000644000175000017500000000244512520550746030000 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationMessageData.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationMessageData::CClassificationMessageData() : CLinkerBase(this) { } CClassificationMessageData::CLASSIFICATIONMESSAGEDATA CClassificationMessageData::getClassificationMessageDataType() { return mMessageDataType; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationConceptReferenceLinking.h0000644000175000017500000000367312520550746032021 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCONCEPTREFERENCELINKING_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCONCEPTREFERENCELINKING_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes #include "Reasoner/Ontology/CExtendedConceptReferenceLinkingData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CClassificationConceptReferenceLinking * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationConceptReferenceLinking : public CExtendedConceptReferenceLinkingData { // public methods public: //! Constructor CClassificationConceptReferenceLinking(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCONCEPTREFERENCELINKING_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelData.cpp0000644000175000017500000000612612520550744031620 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationClassPseudoModelData.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationClassPseudoModelData::CClassificationClassPseudoModelData(CContext* context) : mContext(context) { mLocConceptMap = nullptr; mUseConceptMap = nullptr; mLocRoleMap = nullptr; mUseRoleMap = nullptr; mValidConceptMap = false; mValidRoleMap = false; } CClassificationClassPseudoModelData* CClassificationClassPseudoModelData::initPseudoModelData(CClassificationClassPseudoModelData* data) { if (data) { mUseConceptMap = data->mUseConceptMap; mUseRoleMap = data->mUseRoleMap; mValidConceptMap = data->mValidConceptMap; mValidRoleMap = data->mValidRoleMap; } return this; } CClassificationClassPseudoModelConceptMap* CClassificationClassPseudoModelData::getPseudoModelConceptMap(bool create) { if (!mLocConceptMap && create) { mLocConceptMap = CObjectParameterizingAllocator< CClassificationClassPseudoModelConceptMap,CContext* >::allocateAndConstructAndParameterize(mContext->getMemoryAllocationManager(),mContext); mLocConceptMap->initPseudoModelConceptMap(mUseConceptMap); mUseConceptMap = mLocConceptMap; } return mUseConceptMap; } CClassificationClassPseudoModelRoleMap* CClassificationClassPseudoModelData::getPseudoModelRoleMap(bool create) { if (!mLocRoleMap && create) { mLocRoleMap = CObjectParameterizingAllocator< CClassificationClassPseudoModelRoleMap,CContext* >::allocateAndConstructAndParameterize(mContext->getMemoryAllocationManager(),mContext); mLocRoleMap->initPseudoModelRoleMap(mUseRoleMap); mUseRoleMap = mLocRoleMap; } return mUseRoleMap; } bool CClassificationClassPseudoModelData::hasValidRoleMap() { return mValidRoleMap; } bool CClassificationClassPseudoModelData::hasValidConceptMap() { return mValidConceptMap; } CClassificationClassPseudoModelData* CClassificationClassPseudoModelData::setValidRoleMap(bool valid) { mValidRoleMap = valid; return this; } CClassificationClassPseudoModelData* CClassificationClassPseudoModelData::setValidConceptMap(bool valid) { mValidConceptMap = valid; return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationUpdatePossibleSubsumptionMessageData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationUpdatePossibleSubsumptionMe0000644000175000017500000000306212520550750032506 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationUpdatePossibleSubsumptionMessageData.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationUpdatePossibleSubsumptionMessageData::CClassificationUpdatePossibleSubsumptionMessageData() { mMessageDataType = TELLCLASSUPDATEPOSSIBLESUBSUM; } CClassificationUpdatePossibleSubsumptionMessageData* CClassificationUpdatePossibleSubsumptionMessageData::initClassificationPossibleSubsumptionMessageData(CConcept* subsumedConcept) { mSubsumedConcept = subsumedConcept; return this; } CConcept* CClassificationUpdatePossibleSubsumptionMessageData::getSubsumedConcept() { return mSubsumedConcept; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CNodeBlockedClassificationItem.h0000644000175000017500000000414512520550754030255 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CNODEBLOCKEDCLASSIFICATIONITEM_H #define KONCLUDE_REASONER_CLASSIFIER_CNODEBLOCKEDCLASSIFICATIONITEM_H // Libraries includes // Namespace includes #include "Reasoner/Ontology/CConcreteOntology.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CNodeBlockedClassificationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNodeBlockedClassificationItem { // public methods public: //! Constructor CNodeBlockedClassificationItem(); //! Destructor virtual ~CNodeBlockedClassificationItem(); virtual CNodeBlockedClassificationItem *releaseBlockedResumeProcessing() = 0; virtual CNodeBlockedClassificationItem *releaseTestingBlockedResumeProcessing(CConcept *subsumerConcept, CConcept *subsumedConcept, bool testingResult) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CNODEBLOCKEDCLASSIFICATIONITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationMessageDataObserver.cpp0000644000175000017500000000212312520550750031474 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationMessageDataObserver.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationMessageDataObserver::CClassificationMessageDataObserver() { } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassOntologyClassificationItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassOntologyClassification0000644000175000017500000002122612520756372032436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSONTOLOGYCLASSIFICATIONITEM_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSONTOLOGYCLASSIFICATIONITEM_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "COntologyClassificationItem.h" #include "COptimizedKPSetClassTestingItem.h" // Other includes #include "Reasoner/Ontology/CConceptReferenceLinking.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class COptimizedKPSetClassOntologyClassificationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetClassOntologyClassificationItem : public COntologyClassificationItem { // public methods public: //! Constructor COptimizedKPSetClassOntologyClassificationItem(CConfigurationBase *configuration, CClassifierStatistics *nextClassificationStatistics = 0); //! Destructor virtual ~COptimizedKPSetClassOntologyClassificationItem(); QHash* getConceptSatisfiableTestItemHash(); QList* getConceptSatisfiableTestItemContainer(); COptimizedKPSetClassTestingItem* getTopConceptSatisfiableTestItem(); COptimizedKPSetClassTestingItem* getBottomConceptSatisfiableTestItem(); QList* getNextSatisfiableTestingItemList(); QSet* getNextCandidateSatisfiableTestingItemSet(); QSet* getRemainingCandidateSatisfiableTestingItemSet(); QList* getNextPossibleSubsumptionTestingItemList(); QSet* getCurrentPossibleSubsumptionTestingItemSet(); COptimizedKPSetClassOntologyClassificationItem* initTopBottomSatisfiableTestingItems(COptimizedKPSetClassTestingItem* topItem, COptimizedKPSetClassTestingItem* bottomItem); COptimizedKPSetClassTestingItem* getConceptSatisfiableTestItem(CConcept* satTestConcept, bool create = false); cint64 getRemainingSatisfiableTestsCount(); cint64 getRunningSatisfiableTestsCount(); COptimizedKPSetClassOntologyClassificationItem* incRemainingSatisfiableTestsCount(cint64 incCount = 1); COptimizedKPSetClassOntologyClassificationItem* incRunningSatisfiableTestsCount(cint64 incCount = 1); COptimizedKPSetClassOntologyClassificationItem* decRemainingSatisfiableTestsCount(cint64 decCount = 1); COptimizedKPSetClassOntologyClassificationItem* decRunningSatisfiableTestsCount(cint64 decCount = 1); bool hasAllSatisfiableTestsCompleted(); bool hasRemainingSatisfiableTests(); QList* getSatisfiableConceptItemList(); COptimizedKPSetClassOntologyClassificationItem* addSatisfiableConceptItem(COptimizedKPSetClassTestingItem* item); QHash* getConceptReferenceLinkingDataHash(); bool hasSatisfiableTestingPhaseFinished(); bool hasPossibleSubsumptionTestingPhaseFinished(); COptimizedKPSetClassOntologyClassificationItem* setSatisfiableTestingPhaseFinished(bool finished); COptimizedKPSetClassOntologyClassificationItem* setPossibleSubsumptionTestingPhaseFinished(bool finished); cint64 hasRemainingPossibleSubsumptionTests(); cint64 getRemainingPossibleSubsumptionTestsCount(); COptimizedKPSetClassOntologyClassificationItem* setRemainingPossibleSubsumptionTestsCount(cint64 testCount); COptimizedKPSetClassOntologyClassificationItem* incRemainingPossibleSubsumptionTestsCount(cint64 incCount = 1); COptimizedKPSetClassOntologyClassificationItem* decRemainingPossibleSubsumptionTestsCount(cint64 decCount = 1); COptimizedKPSetClassOntologyClassificationItem* incRunningPossibleSubsumptionTestsCount(cint64 incCount = 1); COptimizedKPSetClassOntologyClassificationItem* decRunningPossibleSubsumptionTestsCount(cint64 decCount = 1); QSet* getRemainingPossibleSubsumptionClassTestingSet(); cint64 getRemainingPossibleSubsumptionClassTestingCount(); QSet* getEquivaltentConceptNonCandidateSet(); CBOXHASH* getEquivalentConceptCandidateHash(); COptimizedKPSetClassOntologyClassificationItem* addMemoryPools(CMemoryPool* memoryPools); CMemoryPool* takeMemoryPools(); cint64 getCalculatedPossibleSubsumerCount(); cint64 getCalculatedTruePossibleSubsumerCount(); cint64 getCalculatedFalsePossibleSubsumerCount(); COptimizedKPSetClassOntologyClassificationItem* setCalculatedPossibleSubsumerCount(cint64 subsumCount); COptimizedKPSetClassOntologyClassificationItem* setCalculatedTruePossibleSubsumerCount(cint64 subsumCount); COptimizedKPSetClassOntologyClassificationItem* setCalculatedFalsePossibleSubsumerCount(cint64 subsumCount); COptimizedKPSetClassOntologyClassificationItem* incCalculatedPossibleSubsumerCount(cint64 incSubsumCount = 1); COptimizedKPSetClassOntologyClassificationItem* incCalculatedTruePossibleSubsumerCount(cint64 incSubsumCount = 1); COptimizedKPSetClassOntologyClassificationItem* incCalculatedFalsePossibleSubsumerCount(cint64 incSubsumCount = 1); cint64 getPossibleSubsumerCount(); cint64 getTruePossibleSubsumerCount(); cint64 getFalsePossibleSubsumerCount(); COptimizedKPSetClassOntologyClassificationItem* setPossibleSubsumerCount(cint64 subsumCount); COptimizedKPSetClassOntologyClassificationItem* setTruePossibleSubsumerCount(cint64 subsumCount); COptimizedKPSetClassOntologyClassificationItem* setFalsePossibleSubsumerCount(cint64 subsumCount); COptimizedKPSetClassOntologyClassificationItem* incPossibleSubsumerCount(cint64 incSubsumCount = 1); COptimizedKPSetClassOntologyClassificationItem* incTruePossibleSubsumerCount(cint64 incSubsumCount = 1); COptimizedKPSetClassOntologyClassificationItem* incFalsePossibleSubsumerCount(cint64 incSubsumCount = 1); // protected methods protected: // protected variables protected: QHash mConceptSatItemHash; QList mSatTestItemContainer; COptimizedKPSetClassTestingItem* mTopSatTestItem; COptimizedKPSetClassTestingItem* mBottomSatTestItem; QList mNextItemList; QSet mNextCandItemSet; QSet mRemainingCandItemSet; QList mNextPossSubsumItemList; QSet mCurrentPossSubsumItemSet; QHash mConceptRefLinkData; cint64 mRemainingSatTests; cint64 mRunningSatTests; bool mSatisfiableTestingPhaseFinished; bool mPossibleSubsumptionTestingPhaseFinished; cint64 mRemainingPossibleSubsumptionTests; cint64 mRunningPossibleSubsumptionTests; cint64 mCalculatedPossibleSubsumCount; cint64 mCalculatedTruePossibleSubsumCount; cint64 mCalculatedFalsePossibleSubsumCount; cint64 mPossibleSubsumCount; cint64 mTruePossibleSubsumCount; cint64 mFalsePossibleSubsumCount; QSet mRemPossClassTestingSet; QList mSatisfiableItemList; QSet mEquivConNonCandidateSet; CBOXHASH mEquivConCandidateHash; CMemoryPoolContainer mMemoryPoolContainer; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSONTOLOGYCLASSIFICATIONITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRoleTestingItem.cpp0000644000175000017500000002404412520550762030615 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetRoleTestingItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedKPSetRoleTestingItem::COptimizedKPSetRoleTestingItem() { } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::initSatisfiableTestingItem(CConcept* satTestConcept) { mConceptSat = satTestConcept; mConSatHierNode = nullptr; mPredCounter = 0; mSatTestedResult = false; mSatTestOrdered = false; mTestedSat = false; mUnsatDerivated = false; mSatDerivated = false; mEquiItem = false; mPredOfItem = false; mPossibleSubsumptionMap = nullptr; mPossSubsumMapInitialized = false; mPropagationConnected = false; mPossibleSubsumedList = nullptr; mPossibleSubsumedSet = nullptr; return this; } COptimizedKPSetRoleTestingItem::~COptimizedKPSetRoleTestingItem() { delete mPossibleSubsumedList; delete mPossibleSubsumedSet; } CConcept* COptimizedKPSetRoleTestingItem::getTestingConcept() { return mConceptSat; } CHierarchyNode* COptimizedKPSetRoleTestingItem::getSatisfiableConceptHierarchyNode() { return mConSatHierNode; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::setSatisfiableConceptHierarchyNode(CHierarchyNode* hierNode) { mConSatHierNode = hierNode; return this; } QSet* COptimizedKPSetRoleTestingItem::getSubsumingConceptItemSet() { return &mSubsumingConceptItemSet; } QList* COptimizedKPSetRoleTestingItem::getSubsumingConceptItemList() { return &mSubsumingConceptItemList; } cint64 COptimizedKPSetRoleTestingItem::getSubsumingConceptItemCount() const { return mSubsumingConceptItemSet.count(); } bool COptimizedKPSetRoleTestingItem::hasSubsumerConceptItem(COptimizedKPSetRoleTestingItem* item) { return mSubsumingConceptItemSet.contains(item); } QList* COptimizedKPSetRoleTestingItem::getSuccessorItemList() { return &mSuccList; } cint64 COptimizedKPSetRoleTestingItem::getUnprocessedPredecessorItemCount() { return mPredCounter; } bool COptimizedKPSetRoleTestingItem::hasOnlyProcessedPredecessorItems() { return mPredCounter <= 0; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::decUnprocessedPredecessorItems(cint64 decCount) { mPredCounter -= decCount; return this; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::incUnprocessedPredecessorItems(cint64 incCount) { mPredCounter += incCount; return this; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::setUnprocessedPredecessorItems(cint64 predCount) { mPredCounter = predCount; return this; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::addSuccessorSatisfiableTestItem(COptimizedKPSetRoleTestingItem* succItem) { mSuccList.append(succItem); return this; } bool COptimizedKPSetRoleTestingItem::isSatisfiableTestOrdered() { return mSatTestOrdered; } bool COptimizedKPSetRoleTestingItem::isSatisfiableTested() { return mTestedSat; } bool COptimizedKPSetRoleTestingItem::isResultUnsatisfiableDerivated() { return mUnsatDerivated; } bool COptimizedKPSetRoleTestingItem::isResultSatisfiableDerivated() { return mSatDerivated; } bool COptimizedKPSetRoleTestingItem::getSatisfiableTestedResult() { return mSatTestedResult; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::setSatisfiableTestOrdered(bool satTestOrdered) { mSatTestOrdered = satTestOrdered; return this; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::setSatisfiableTested(bool satTested) { mTestedSat = satTested; return this; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::setSatisfiableTestedResult(bool satTestedResult) { mSatTestedResult = satTestedResult; return this; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::setResultUnsatisfiableDerivated(bool unsatDerivated) { mUnsatDerivated = unsatDerivated; return this; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::setResultSatisfiableDerivated(bool satDerivated) { mSatDerivated = satDerivated; return this; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::addSubsumingConceptItem(COptimizedKPSetRoleTestingItem* subsumingItem) { if (!mSubsumingConceptItemSet.contains(subsumingItem)) { mSubsumingConceptItemList.append(subsumingItem); mSubsumingConceptItemSet.insert(subsumingItem); //QString iriClassNameString = CIRIName::getRecentIRIName(subsumingItem->getTestingConcept()->getClassNameLinker()); //mSubsumingConceptString += QString("%1\r\n").arg(iriClassNameString); } return this; } CConceptSubsumerObserver* COptimizedKPSetRoleTestingItem::tellConceptSupsumption(CConcept* subsumedConcept, CConcept* subsumerConcept) { if (subsumerConcept->getOperatorCode() != CCTOP) { CConceptProcessData* conProData = (CConceptProcessData*)subsumerConcept->getConceptData(); CConceptSatisfiableReferenceLinkingData* conSatRefLinking = (CConceptSatisfiableReferenceLinkingData*)conProData->getConceptReferenceLinking(); if (conSatRefLinking) { COptimizedKPSetRoleTestingItem* subsumerClassSaturationItem = (COptimizedKPSetRoleTestingItem*)conSatRefLinking->getClassifierReferenceLinkingData(); addSubsumingConceptItem(subsumerClassSaturationItem); } } return this; } bool itemSortLessThan(const COptimizedKPSetRoleTestingItem* item1, const COptimizedKPSetRoleTestingItem* item2) { return item1->getSubsumingConceptItemCount() > item2->getSubsumingConceptItemCount(); } QList* COptimizedKPSetRoleTestingItem::sortSubsumingConceptItemList() { qSort(mSubsumingConceptItemList.begin(),mSubsumingConceptItemList.end(),itemSortLessThan); return &mSubsumingConceptItemList; } bool COptimizedKPSetRoleTestingItem::isEquivalentItem() { return mEquiItem; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::setEquivalentItem(bool equivalent) { mEquiItem = equivalent; return this; } bool COptimizedKPSetRoleTestingItem::isPredecessorItem() { return mPredOfItem; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::setPredecessorItem(bool isPredecessorOfOneItem) { mPredOfItem = isPredecessorOfOneItem; return this; } bool COptimizedKPSetRoleTestingItem::isMoreConceptClassificationInformationRequired() { if (mSatTestOrdered || mTestedSat || mUnsatDerivated || mSatDerivated) { return false; } return true; } COptimizedKPSetRolePossibleSubsumptionMap* COptimizedKPSetRoleTestingItem::getPossibleSubsumptionMap(bool create) { if (!mPossibleSubsumptionMap && create) { mPossibleSubsumptionMap = new COptimizedKPSetRolePossibleSubsumptionMap(); } return mPossibleSubsumptionMap; } CClassPossibleSubsumptionMap* COptimizedKPSetRoleTestingItem::getClassPossibleSubsumptionMap() { return getPossibleSubsumptionMap(false); } QSet* COptimizedKPSetRoleTestingItem::getUpPropagationItemSet() { return &mUpPropagationItemSet; } QSet* COptimizedKPSetRoleTestingItem::getDownPropagationItemSet() { return &mDownPropagationItemSet; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::addUpPropagationItem(COptimizedKPSetRoleTestingItem* item) { mUpPropagationItemSet.insert(item); return this; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::addDownPropagationItem(COptimizedKPSetRoleTestingItem* item) { mDownPropagationItemSet.insert(item); return this; } bool COptimizedKPSetRoleTestingItem::isPossibleSubsumptionMapInitialized() { return mPossSubsumMapInitialized; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::setPossibleSubsumptionMapInitialized(bool initialized) { mPossSubsumMapInitialized = initialized; return this; } bool COptimizedKPSetRoleTestingItem::isPropagationConnected() { return mPropagationConnected; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::setPropagationConnected(bool connected) { mPropagationConnected = connected; return this; } QSet* COptimizedKPSetRoleTestingItem::getPossibleSubsumedSet(bool create) { if (create && !mPossibleSubsumedSet) { mPossibleSubsumedSet = new QSet(); } return mPossibleSubsumedSet; } QList* COptimizedKPSetRoleTestingItem::getPossibleSubsumedList() { return mPossibleSubsumedList; } COptimizedKPSetRoleTestingItem* COptimizedKPSetRoleTestingItem::setPossibleSubsumedList(QList* possSubsumedList) { mPossibleSubsumedList = possSubsumedList; return this; } bool COptimizedKPSetRoleTestingItem::hasRemainingPossibleSubsumedItems() { return mPossibleSubsumedList && !mPossibleSubsumedList->isEmpty(); } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationSubsumptionMessageData.h0000644000175000017500000000445012520550750031707 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONSUBSUMPTIONMESSAGEDATA_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONSUBSUMPTIONMESSAGEDATA_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationMessageData.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class CClassificationSubsumptionMessageData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationSubsumptionMessageData : public CClassificationMessageData { // public methods public: //! Constructor CClassificationSubsumptionMessageData(); CClassificationSubsumptionMessageData* initClassificationSubsumptionMessageData(CConcept* subsumedConcept, CCLASSSUBSUMPTIONMESSAGELIST* subsumerList); CCLASSSUBSUMPTIONMESSAGELIST* getClassSubsumerList(); CConcept* getSubsumedConcept(); // protected methods protected: // protected variables protected: CConcept* mSubsumedConcept; CCLASSSUBSUMPTIONMESSAGELIST* mSubsumerList; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONSUBSUMPTIONMESSAGEDATA_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelConceptData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelConceptData0000644000175000017500000000400112520550744032341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELCONCEPTDATA_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELCONCEPTDATA_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationClassPseudoModelDeterministicFlag.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Classifier { /*! * * \class CClassificationClassPseudoModelConceptData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationClassPseudoModelConceptData : public CClassificationClassPseudoModelDeterministicFlag { // public methods public: //! Constructor CClassificationClassPseudoModelConceptData(); CClassificationClassPseudoModelConceptData(bool deterministic); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELCONCEPTDATA_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelConceptMap.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelConceptMap.0000644000175000017500000000270612520550744032275 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationClassPseudoModelConceptMap.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationClassPseudoModelConceptMap::CClassificationClassPseudoModelConceptMap(CContext* context) : CCLASSPSEUDOMODELMAP(context) { } CClassificationClassPseudoModelConceptMap* CClassificationClassPseudoModelConceptMap::initPseudoModelConceptMap(CClassificationClassPseudoModelConceptMap* conMap) { if (conMap) { *this = *conMap; } return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CIncrementalKPSetClassSubsumptionClassifierThread.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CIncrementalKPSetClassSubsumptionClassifie0000644000175000017500000004343312520550754032420 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIncrementalKPSetClassSubsumptionClassifierThread.h" namespace Konclude { namespace Reasoner { namespace Classifier { CIncrementalKPSetClassSubsumptionClassifierThread::CIncrementalKPSetClassSubsumptionClassifierThread(CReasonerManager *reasonerManager) : COptimizedKPSetClassSubsumptionClassifierThread(reasonerManager) { } CIncrementalKPSetClassSubsumptionClassifierThread::~CIncrementalKPSetClassSubsumptionClassifierThread() { } void CIncrementalKPSetClassSubsumptionClassifierThread::readCalculationConfig(CCalculationConfigurationExtension *config) { COptimizedKPSetClassSubsumptionClassifierThread::readCalculationConfig(config); } COptimizedKPSetClassOntologyClassificationItem* CIncrementalKPSetClassSubsumptionClassifierThread::createOntologyClassificationItem(CConcreteOntology *ontology, CConfigurationBase *config) { return new CIncrementalKPSetClassOntologyClassificationItem(config,statistics); } CSubsumptionClassifierThread *CIncrementalKPSetClassSubsumptionClassifierThread::scheduleOntologyClassification(CConcreteOntology *ontology, CTaxonomy *taxonomy, CClassificationCalculationSupport *classificationSupport, CConfigurationBase *config) { CIncrementalKPSetClassOntologyClassificationItem* ontClassItem = (CIncrementalKPSetClassOntologyClassificationItem*)createOntologyClassificationItem(ontology,config); ontClassItem->initTaxonomyConcepts(ontology,taxonomy); ontItemList.append(ontClassItem); processingOntItemList.append(ontClassItem); ontItemHash.insert(ontology,ontClassItem); readCalculationConfig(ontClassItem->getCalculationConfiguration()); // get previous classification result COntologyIncrementalRevisionData* incOntData = ontology->getIncrementalRevisionData(); CConcreteOntology* prevClassifiedOnt = incOntData->getPreviousClassesClassifiedOntology(); bool reclassificationRequired = false; CClassConceptClassification* prevClassification = nullptr; if (prevClassifiedOnt) { prevClassification = prevClassifiedOnt->getClassification()->getClassConceptClassification(); if (prevClassification) { CIndividualDependenceTracking* prevDepIndiTracking = prevClassification->getDependentIndividualsTracking(); if (prevDepIndiTracking) { CConcreteOntology* prevConsOnt = ontology; do { CConsistence* prevConsData = prevConsOnt->getConsistence(); if (prevConsData) { if (prevDepIndiTracking->areIndividualsAffected(prevConsData->getConsistenceModelData())) { reclassificationRequired = true; } } if (prevConsOnt != prevClassifiedOnt) { prevConsOnt = prevConsOnt->getIncrementalRevisionData()->getPreviousConsistentOntology(); } } while (!reclassificationRequired && prevConsOnt && prevConsOnt != prevClassifiedOnt); } else if (!prevClassification->isIndividualDependentTrackingSet()) { reclassificationRequired = true; } } else { reclassificationRequired = true; } } else { reclassificationRequired = true; } if (!reclassificationRequired) { ontClassItem->setPreviousHierarchyReused(true); CIndividualDependenceTracking* prevDepIndiTracking = prevClassification->getDependentIndividualsTracking(); CTaxonomy* prevTaxonomy = prevClassification->getClassConceptTaxonomy(); if (prevTaxonomy) { QHash* prevConHierNodeHash = prevTaxonomy->getConceptHierarchyNodeHash(); for (QHash::const_iterator it = prevConHierNodeHash->constBegin(), itEnd = prevConHierNodeHash->constEnd(); it != itEnd; ++it) { CConcept* concept = it.key(); CHierarchyNode* prevHierNode = it.value(); ontClassItem->incPreviousReusedClassCalculationCount(); if (prevHierNode->isActive()) { CHierarchyNode* hierNode = taxonomy->getHierarchyNode(concept,true); QList* eqConList = prevHierNode->getEquivalentConceptList(); if (eqConList->count() > 1 && hierNode->getEquivalentConceptList()->count() <= 1) { for (QList::const_iterator eqConIt = eqConList->constBegin(), eqConItEnd = eqConList->constEnd(); eqConIt != eqConItEnd; ++eqConIt) { CConcept* eqConcept = *eqConIt; if (eqConcept != concept) { hierNode->addEquivalentConcept(eqConcept); } } taxonomy->updateNodeEquivalences(hierNode); } } } for (QHash::const_iterator it = prevConHierNodeHash->constBegin(), itEnd = prevConHierNodeHash->constEnd(); it != itEnd; ++it) { CConcept* concept = it.key(); CHierarchyNode* prevHierNode = it.value(); if (prevHierNode->isActive()) { CHierarchyNode* hierNode = taxonomy->getHierarchyNode(concept,true); QSet* prevPredSet = prevHierNode->getPredecessorNodeSet(); for (QSet::const_iterator prevPredIt = prevPredSet->constBegin(), prevPredItEnd = prevPredSet->constEnd(); prevPredIt != prevPredItEnd; ++prevPredIt) { CHierarchyNode* prevPredNode(*prevPredIt); CHierarchyNode* predHierNode = taxonomy->getHierarchyNode(prevPredNode->getOneEquivalentConcept(),true); hierNode->addPredecessorNode(predHierNode); } QSet* prevParentSet = prevHierNode->getParentNodeSet(); for (QSet::const_iterator prevParentIt = prevParentSet->constBegin(), prevParentItEnd = prevParentSet->constEnd(); prevParentIt != prevParentItEnd; ++prevParentIt) { CHierarchyNode* prevParentNode(*prevParentIt); CHierarchyNode* parentHierNode = taxonomy->getHierarchyNode(prevParentNode->getOneEquivalentConcept(),true); hierNode->makeParent(parentHierNode); } } } CClassification* classification = ontology->getClassification(); if (classification) { CClassConceptClassification* classConClassification = ontClassItem->getClassConceptClassification(); addClassificationStatistics(ontClassItem,classConClassification); classConClassification->setClassConceptTaxonomy(taxonomy); classification->setClassConceptClassification(classConClassification); CClassificationStatisticsCollectionStrings* classifStatCollStrings = ontClassItem->getClassificationStatisticsCollectionStrings(); classConClassification->setClassificationStatistics(classifStatCollStrings); if (prevDepIndiTracking) { classConClassification->setDependentIndividualsTracking(prevDepIndiTracking->getCopiedIndividualDependencyTracking()); } } ontology->setConceptTaxonomy(taxonomy); ontClassItem->setGoneOutRemainingTests(false); taxonomy->setTaxonomyComplete(true); ontClassItem->submitTaxonomyConstructed(); ontClassItem->doClassifiedCallback(); LOG(INFO,getLogDomain(),logTr("Obtained classification of ontology '%1' by reusing previous class hierarchy.").arg(ontology->getTerminologyName()),getLogObject()); } else { reclassificationRequired = true; } } if (reclassificationRequired) { if (CConfigDataReader::readConfigBoolean(ontClassItem->getCalculationConfiguration(),"Konclude.Calculation.Classification.IndividualDependenceTracking",true)) { ontClassItem->setIndividualDependenceTrackingCollector(new CIndividualDependenceTrackingCollector()); } CPartialPruningTaxonomy *parTax = dynamic_cast(taxonomy); if (parTax) { COntologyClassificationItem *ontClassItem = ontItemHash.value(ontology); parTax->createStatistics(ontClassItem->getClassifierStatistics()); } tryReusePreviousClassesCalculations(ontClassItem,prevClassification); createObviousSubsumptionSatisfiableTestingOrder(ontClassItem); if (satTestedCount == totalToSatTestClassCount) { satTestedCount = 0; totalToSatTestClassCount = ontClassItem->getRemainingSatisfiableTestsCount(); classStartTime.start(); } else { totalToSatTestClassCount += ontClassItem->getRemainingSatisfiableTestsCount(); } ++mClassificationCount; } return this; } bool CIncrementalKPSetClassSubsumptionClassifierThread::tryReusePreviousClassesCalculations(CIncrementalKPSetClassOntologyClassificationItem *ontClassItem, CClassConceptClassification* prevClassConClassification) { CIncrementalKPSetClassOntologyClassificationItem* prevIncKPClassItem = dynamic_cast(prevClassConClassification); while (prevIncKPClassItem && prevIncKPClassItem->getPreviousReusedClassClassification()) { prevClassConClassification = prevIncKPClassItem->getPreviousReusedClassClassification(); prevIncKPClassItem = dynamic_cast(prevClassConClassification); } COptimizedKPSetClassOntologyClassificationItem* prevKPClassOntItem = dynamic_cast(prevClassConClassification); if (prevKPClassOntItem) { QList* prevConTestItemCont = prevKPClassOntItem->getConceptSatisfiableTestItemContainer(); for (QList::const_iterator prevConItemIt = prevConTestItemCont->constBegin(), prevConItemItEnd = prevConTestItemCont->constEnd(); prevConItemIt != prevConItemItEnd; ++prevConItemIt) { COptimizedKPSetClassTestingItem* prevConItem = (*prevConItemIt); if (!prevConItem->hasIndividualDependenceTracked()) { ontClassItem->incPreviousReusedClassCalculationCount(); COptimizedKPSetClassTestingItem* conItem = ontClassItem->getConceptSatisfiableTestItem(prevConItem->getTestingConcept(),true); conItem->setSatisfiableTestedResult(prevConItem->getSatisfiableTestedResult()); conItem->setSatisfiableTested(true); QSet* prevSubsumerSet = prevConItem->getSubsumingConceptItemSet(); for (QSet::const_iterator it = prevSubsumerSet->constBegin(), itEnd = prevSubsumerSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetClassTestingItem* prevSubsumerItem = (*it); COptimizedKPSetClassTestingItem* subsumerConItem = ontClassItem->getConceptSatisfiableTestItem(prevSubsumerItem->getTestingConcept(),true); conItem->addSubsumingConceptItem(subsumerConItem); } } else { ontClassItem->incNewInitializedClassCalculationCount(); } } return true; } COptimizedSubClassOntologyClassificationItem* prevSubClassOntItem = dynamic_cast(prevClassConClassification); if (prevSubClassOntItem) { QList* prevConTestItemCont = prevSubClassOntItem->getConceptSatisfiableTestItemContainer(); for (QList::const_iterator prevConItemIt = prevConTestItemCont->constBegin(), prevConItemItEnd = prevConTestItemCont->constEnd(); prevConItemIt != prevConItemItEnd; ++prevConItemIt) { COptimizedSubClassSatisfiableTestingItem* prevConItem = (*prevConItemIt); if (!prevConItem->hasIndividualDependenceTracked()) { ontClassItem->incPreviousReusedClassCalculationCount(); COptimizedKPSetClassTestingItem* conItem = ontClassItem->getConceptSatisfiableTestItem(prevConItem->getSatisfiableConcept(),true); conItem->setSatisfiableTestedResult(prevConItem->getSatisfiableTestedResult()); conItem->setSatisfiableTested(true); QSet* prevSubsumerSet = prevConItem->getSubsumingConceptItemSet(); for (QSet::const_iterator it = prevSubsumerSet->constBegin(), itEnd = prevSubsumerSet->constEnd(); it != itEnd; ++it) { COptimizedSubClassSatisfiableTestingItem* prevSubsumerItem = (*it); COptimizedKPSetClassTestingItem* subsumerConItem = ontClassItem->getConceptSatisfiableTestItem(prevSubsumerItem->getSatisfiableConcept(),true); conItem->addSubsumingConceptItem(subsumerConItem); } } else { ontClassItem->incNewInitializedClassCalculationCount(); } } return true; } return false; } bool CIncrementalKPSetClassSubsumptionClassifierThread::addClassificationStatistics(COntologyClassificationItem *ontClassItem, CClassConceptClassification* classConClassification) { CClassificationStatisticsCollectionStrings* classifStatCollStrings = ontClassItem->getClassificationStatisticsCollectionStrings(); CClassifierStatistics* classifierStats = ontClassItem->getClassifierStatistics(); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-total-satisfiable-test-count",classifierStats->getTotalSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-satisfiable-tested-count",classifierStats->getTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-satisfiable-pseudo-model-merged-tested-count",classifierStats->getPseudoModelMergedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-satisfiable-derivation-tested-count",classifierStats->getDerivatedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-satisfiable-calculated-tested-count",classifierStats->getCalculatedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-satisfiable-pruned-tested-count",classifierStats->getPrunedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-satisfiable-told-tested-count",classifierStats->getToldSatisfiableCount()-classifierStats->getCalculatedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-total-subsumption-test-count",classifierStats->getTotalSatisfiableCount()*(classifierStats->getTotalSatisfiableCount()-1)); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-subsumption-tested-count",classifierStats->getTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-subsumption-pseudo-model-merged-tested-count",classifierStats->getPseudoModelMergedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-subsumption-subclass-tested-count",classifierStats->getSubclassTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-subsumption-subclass-identifier-occur-tested-count",classifierStats->getSubclassIdentifierOccurTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-subsumption-derivation-tested-count",classifierStats->getDerivatedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-subsumption-calculated-tested-count",classifierStats->getCalculatedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-subsumption-pruned-tested-count",classifierStats->getPrunedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-subsumption-told-tested-count",classifierStats->getToldSubsumptionCount()-classifierStats->getCalculatedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("incremental-class-classification-time",ontClassItem->getInitializationTime()->elapsed()); COptimizedKPSetClassOntologyClassificationItem *optKPSetClassificationItem = dynamic_cast(ontClassItem); if (optKPSetClassificationItem) { addIndividualDependencyTrackingStatistics(optKPSetClassificationItem,"incremental-class-classification"); } COntologyProcessingStatistics* ontProcStats = ontClassItem->getClassificationProcessingStep()->getProcessingStatistics(true); ontProcStats->setProcessingCountStatisticValue("incremental-class-classification-time",ontClassItem->getInitializationTime()->elapsed()); CIncrementalKPSetClassOntologyClassificationItem* incOntClassItem = dynamic_cast(ontClassItem); if (incOntClassItem) { ontProcStats->setProcessingCountStatisticValue("incremental-class-classification-previous-hierarchy-reused-count",incOntClassItem->isPreviousHierarchyReused()); ontProcStats->setProcessingCountStatisticValue("incremental-class-classification-previously-reused-class-calculation-count",incOntClassItem->getPreviousReusedClassCalculationCount()); ontProcStats->setProcessingCountStatisticValue("incremental-class-classification-newly-initialized-class-calculation-count",incOntClassItem->getNewInitializedClassCalculationCount()); } return true; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRoleSubsumptionClassifierThread.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetRoleSubsumptionClassifierTh0000644000175000017500000024667612520550760032450 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetRoleSubsumptionClassifierThread.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedKPSetRoleSubsumptionClassifierThread::COptimizedKPSetRoleSubsumptionClassifierThread(CReasonerManager *reasonerManager) : CSubsumptionClassifierThread(reasonerManager), CLogIdentifier("::Konclude::Reasoner::Kernel::Classifier::OptimizedKPSetRoleSubsumptionClassifierThread",this) { satTestedCount = 0; totalToSatTestClassCount = 0; mClassificationCount = 0; subsumTestedCount = 0; totalToSubsumTestCount = 0; mConfPossSubsumCalcOrderConceptSorted = true; mConfPossSubsumCalcOrderFewestSubsumptionSorted = false; mConfPossSubsumCalcOrderTopDown = true; mConfPossSubsumCalcOrderBottomUp = false; mConfPossSubsumPseudoModelPretest = true; mConfPossSubsumPseudoModelTest = true; mConfWriteDebuggingData = false; mStatProcesedSubsumMessCount = 0; mStatProcesedPossSubsumInitMessCount = 0; mStatProcesedPossSubsumUpdateMessCount = 0; mStatProcesedPseudoModelMessCount = 0; mInterpretedSubsumptionCalculationCount = 0; mOrderedSubsumptionCalculationCount = 0; mPseudoModelPretestSubsumptionCalculationCount = 0; mCreatedCalculationTaskCount = 0; mRecievedCallbackCount = 0; } COptimizedKPSetRoleSubsumptionClassifierThread::~COptimizedKPSetRoleSubsumptionClassifierThread() { } CTaxonomy *COptimizedKPSetRoleSubsumptionClassifierThread::createEmptyTaxonomyForOntology(CConcreteOntology *ontology, CConfigurationBase *config) { CTBox *tBox = ontology->getTBox(); CConceptVector *conVec = tBox->getConceptVector(); CConcept *topConcept = conVec->getData(1); CConcept *bottomConcept = conVec->getData(0); CPartialPruningTaxonomy *tax = new CPartialPruningTaxonomy(topConcept,bottomConcept); return tax->readConfig(config); } void COptimizedKPSetRoleSubsumptionClassifierThread::readCalculationConfig(CCalculationConfigurationExtension *config) { if (config) { bool configErrorFlag = false; cint64 processorCount = 1; QString processorCountString = CConfigDataReader::readConfigString(config,"Konclude.Calculation.ProcessorCount",QString(),&configErrorFlag); if (!configErrorFlag) { if (processorCountString == "AUTO") { processorCount = CThread::idealThreadCount(); } else { qint64 convertedWorkerCount = processorCountString.toInt(&configErrorFlag); if (configErrorFlag) { processorCount = convertedWorkerCount; } } } bool mulConfigErrorFlag = false; cint64 multiplicator = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Classification.OptimizedKPSetClassSubsumptionClassifier.MultipliedUnitsParallelSatisfiableCalculationCount",1,&mulConfigErrorFlag); confMaxTestParallelCount = processorCount*multiplicator; bool maxConfigErrorFlag = false; cint64 maxParallel = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Classification.OptimizedKPSetClassSubsumptionClassifier.MaximumParallelSatisfiableCalculationCount",1,&maxConfigErrorFlag); if (!maxConfigErrorFlag) { if (!mulConfigErrorFlag) { confMaxTestParallelCount = qMin(confMaxTestParallelCount,maxParallel); } else { confMaxTestParallelCount = maxParallel; } } double factor = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Classification.OptimizedKPSetClassSubsumptionClassifier.ParallelSatisfiableCalculationCreationFactor",1000)/1000.; confMinTestParallelCount = confMaxTestParallelCount*factor; mConfWriteDebuggingData = CConfigDataReader::readConfigBoolean(config,"Konclude.Debugging.WriteDebuggingData",false); } else { confMaxTestParallelCount = 1; confMinTestParallelCount = 1; mConfWriteDebuggingData = false; } } CSubsumptionClassifierThread *COptimizedKPSetRoleSubsumptionClassifierThread::scheduleOntologyClassification(CConcreteOntology *ontology, CTaxonomy *taxonomy, CClassificationCalculationSupport *classificationSupport, CConfigurationBase *config) { COptimizedKPSetRoleOntologyClassificationItem *ontClassItem = new COptimizedKPSetRoleOntologyClassificationItem(config,statistics); ontClassItem->initTaxonomyConcepts(ontology,taxonomy); ontItemList.append(ontClassItem); processingOntItemList.append(ontClassItem); ontItemHash.insert(ontology,ontClassItem); readCalculationConfig(ontClassItem->getCalculationConfiguration()); if (CConfigDataReader::readConfigBoolean(ontClassItem->getCalculationConfiguration(),"Konclude.Calculation.Classification.IndividualDependenceTracking",true)) { ontClassItem->setIndividualDependenceTrackingCollector(new CIndividualDependenceTrackingCollector()); } CPartialPruningTaxonomy *parTax = dynamic_cast(taxonomy); if (parTax) { COntologyClassificationItem *ontClassItem = ontItemHash.value(ontology); parTax->createStatistics(ontClassItem->getClassifierStatistics()); } if (satTestedCount == totalToSatTestClassCount) { satTestedCount = 0; totalToSatTestClassCount = ontClassItem->getRemainingSatisfiableTestsCount(); classStartTime.start(); } else { totalToSatTestClassCount += ontClassItem->getRemainingSatisfiableTestsCount(); } ++mClassificationCount; return this; } QString COptimizedKPSetRoleSubsumptionClassifierThread::getStatusString() { statUpdateMutex.lock(); QString string = statusString; string.detach(); statUpdateMutex.unlock(); return string; } CClassificationProgress* COptimizedKPSetRoleSubsumptionClassifierThread::getClassificationProgress() { if (satTestedCount != totalToSatTestClassCount || subsumTestedCount != totalToSubsumTestCount) { cint64 tested = satTestedCount + subsumTestedCount; cint64 total = totalToSatTestClassCount + totalToSubsumTestCount; cint64 elapsedTime = classStartTime.elapsed(); double remainingMilliSeconds = 0.; double progessPercent = 0.; if (elapsedTime <= 0 && total > 0) { remainingMilliSeconds = 0.; } else { remainingMilliSeconds = ((double)elapsedTime / (double)tested) * (total-tested); } if (total <= 0) { progessPercent = 0.; } else { progessPercent = ((double)tested / (double)total) * 100.; } cint64 classificCount = mClassificationCount; mClassifyProgess.setClassificationCount(classificCount); mClassifyProgess.setProgessPercent(progessPercent); mClassifyProgess.setRemainingMilliSeconds(remainingMilliSeconds); mClassifyProgess.setTestedClasses(satTestedCount); mClassifyProgess.setTotalClasses(totalToSatTestClassCount); mClassifyProgess.setTestedSubsumptions(subsumTestedCount); mClassifyProgess.setTotalSubsumptions(totalToSubsumTestCount); } else { mClassifyProgess.setProgessPercent(0.); mClassifyProgess.setRemainingMilliSeconds(0.); mClassifyProgess.setTestedClasses(satTestedCount); mClassifyProgess.setTotalClasses(totalToSatTestClassCount); mClassifyProgess.setTestedSubsumptions(subsumTestedCount); mClassifyProgess.setTotalSubsumptions(totalToSubsumTestCount); } return &mClassifyProgess; } bool itemSortLessSubsumptionsThan(const COptimizedKPSetRoleTestingItem* item1, const COptimizedKPSetRoleTestingItem* item2) { return item1->getSubsumingConceptItemCount() < item2->getSubsumingConceptItemCount(); } bool itemSortMoreSubsumptionsThan(const COptimizedKPSetRoleTestingItem* item1, const COptimizedKPSetRoleTestingItem* item2) { return item1->getSubsumingConceptItemCount() > item2->getSubsumingConceptItemCount(); } void COptimizedKPSetRoleSubsumptionClassifierThread::testDebugPossibleSubsumerCorrectCounted(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem) { QList* classList = optKPSetClassificationItem->getConceptSatisfiableTestItemContainer(); cint64 totalCount = 0; foreach (COptimizedKPSetRoleTestingItem* item, *classList) { COptimizedKPSetRolePossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); if (possSubsumMap) { cint64 mapCount = 0; for (COptimizedKPSetRolePossibleSubsumptionMap::const_iterator it = possSubsumMap->constBegin(), itEnd = possSubsumMap->constEnd(); it != itEnd; ++it) { COptimizedKPSetRolePossibleSubsumptionData* data = it.value(); if (data->isSubsumptionUnknown() || data->isUpdateRequired()) { mapCount++; totalCount++; } } if (mapCount != possSubsumMap->getRemainingPossibleSubsumptionCount()) { bool bug = true; } } } if (totalCount != optKPSetClassificationItem->getRemainingPossibleSubsumptionTestsCount()) { bool bug = true; } } void COptimizedKPSetRoleSubsumptionClassifierThread::testDebugPossibleSubsumerCorrectReferenced(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem) { QList* classList = optKPSetClassificationItem->getSatisfiableConceptItemList(); if (mConfPossSubsumCalcOrderBottomUp) { QSet* remItemSet = optKPSetClassificationItem->getRemainingPossibleSubsumptionTestingSet(); foreach (COptimizedKPSetRoleTestingItem* item, *classList) { COptimizedKPSetRolePossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); if (possSubsumMap) { for (COptimizedKPSetRolePossibleSubsumptionMap::const_iterator it = possSubsumMap->constBegin(), itEnd = possSubsumMap->constEnd(); it != itEnd; ++it) { COptimizedKPSetRolePossibleSubsumptionData* data = it.value(); if (data->isSubsumptionUnknown() || data->isUpdateRequired()) { COptimizedKPSetRoleTestingItem* possSubsumerItem = data->getTestingItem(); if (!possSubsumerItem->getPossibleSubsumedSet(false)->contains(item) && !optKPSetClassificationItem->getCurrentPossibleSubsumptionTestingItemSet()->contains(possSubsumerItem)) { bool bug = true; } if (!remItemSet->contains(possSubsumerItem) && !optKPSetClassificationItem->getCurrentPossibleSubsumptionTestingItemSet()->contains(possSubsumerItem)) { bool bug = true; } } } } } } } QString COptimizedKPSetRoleSubsumptionClassifierThread::createDebugKPSetString(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, const QString& filename) { QString debugString; QList* classList = optKPSetClassificationItem->getSatisfiableConceptItemList(); foreach (COptimizedKPSetRoleTestingItem* item, *classList) { QString iriClassNameString = CIRIName::getRecentIRIName(item->getTestingConcept()->getClassNameLinker()); QString classDebugString = QString("Class: %1\r\n").arg(iriClassNameString); QString subsumString; foreach (COptimizedKPSetRoleTestingItem* subsumItem, *item->getSubsumingConceptItemList()) { QString subsumIRIClassNameString = CIRIName::getRecentIRIName(subsumItem->getTestingConcept()->getClassNameLinker()); if (subsumString.isEmpty()) { subsumString += subsumIRIClassNameString; } else { subsumString += QString(", %1").arg(subsumIRIClassNameString); } } classDebugString += QString("Subsumer Roles: %1\r\n").arg(subsumString); QString possSubsumString; COptimizedKPSetRolePossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); if (possSubsumMap) { for (COptimizedKPSetRolePossibleSubsumptionMap::const_iterator it = possSubsumMap->constBegin(), itEnd = possSubsumMap->constEnd(); it != itEnd; ++it) { COptimizedKPSetRolePossibleSubsumptionData* data = it.value(); QString subsumIRIClassNameString = CIRIName::getRecentIRIName(data->getTestingItem()->getTestingConcept()->getClassNameLinker()); QString possString; if (data->isSubsumptionConfirmed()) { possString = "s"; } else if (data->isSubsumptionInvalided()) { possString = "n"; } else { possString = "u"; } if (possSubsumString.isEmpty()) { possSubsumString += QString("%1(%2)").arg(subsumIRIClassNameString).arg(possString); } else { possSubsumString += QString(", %1(%2)").arg(subsumIRIClassNameString).arg(possString); } } } classDebugString += QString("Possible Subsumer Roles: %1\r\n\r\n\r\n").arg(possSubsumString); debugString += classDebugString; } QFile file(filename); if (file.open(QIODevice::WriteOnly)) { file.write(debugString.toLocal8Bit()); file.close(); } return debugString; } bool COptimizedKPSetRoleSubsumptionClassifierThread::createNextSubsumtionTest() { COntologyClassificationItem *loopOntClassItem = 0; bool workTestCreated = false; while (!workTestCreated && !processingOntItemList.isEmpty()) { COntologyClassificationItem *ontClassItem = processingOntItemList.first(); if (ontClassItem == loopOntClassItem) { // don't run into infinite loop without doing something break; } COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem = (COptimizedKPSetRoleOntologyClassificationItem *)ontClassItem; if (!optKPSetClassificationItem->hasSatisfiableTestingPhaseFinished() && !ontClassItem->isTaxonomyConstructionFailed()) { while (!workTestCreated && optKPSetClassificationItem->hasRemainingSatisfiableTests()) { // get next satisfiable test QList* nextItemList = optKPSetClassificationItem->getNextSatisfiableTestingItemList(); QSet* nextCandItemSet = optKPSetClassificationItem->getNextCandidateSatisfiableTestingItemSet(); QSet* remainingCandItemSet = optKPSetClassificationItem->getRemainingCandidateSatisfiableTestingItemSet(); COptimizedKPSetRoleTestingItem* nextSatTestItem = nullptr; if (!nextItemList->isEmpty()) { nextSatTestItem = nextItemList->takeFirst(); remainingCandItemSet->remove(nextSatTestItem); nextCandItemSet->remove(nextSatTestItem); } else if (!nextCandItemSet->isEmpty()) { COptimizedKPSetRoleTestingItem* minItem = nullptr; cint64 minUnpPredCount = 0; for (QSet::const_iterator it = nextCandItemSet->constBegin(), itEnd = nextCandItemSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleTestingItem* item = (*it); cint64 predCount = item->getUnprocessedPredecessorItemCount(); if (!minItem || minUnpPredCount < predCount) { minUnpPredCount = predCount; minItem = item; } } nextSatTestItem = minItem; remainingCandItemSet->remove(nextSatTestItem); nextCandItemSet->remove(nextSatTestItem); } else if (!remainingCandItemSet->isEmpty()) { COptimizedKPSetRoleTestingItem* minItem = nullptr; QSet::const_iterator itNext = remainingCandItemSet->constBegin(); nextSatTestItem = *itNext; remainingCandItemSet->remove(nextSatTestItem); } if (nextSatTestItem && !nextSatTestItem->isSatisfiableTestOrdered()) { optKPSetClassificationItem->decRemainingSatisfiableTestsCount(); optKPSetClassificationItem->incRunningSatisfiableTestsCount(); if (calculateSatisfiable(optKPSetClassificationItem,nextSatTestItem)) { workTestCreated = true; } else { interpreteSatisfiableResult(optKPSetClassificationItem,nextSatTestItem->getTestingConcept(),nextSatTestItem->getSatisfiableTestedResult()); } } } if (!workTestCreated) { if (optKPSetClassificationItem->hasAllSatisfiableTestsCompleted()) { optKPSetClassificationItem->setSatisfiableTestingPhaseFinished(true); // initialize possible subsumption testing phase cint64 remainingSubSumTestCount = 0; QSet* remTestingSet = optKPSetClassificationItem->getRemainingPossibleSubsumptionTestingSet(); QList* nextItemList = optKPSetClassificationItem->getNextPossibleSubsumptionTestingItemList(); COptimizedKPSetRoleTestingItem* topItem = optKPSetClassificationItem->getTopConceptSatisfiableTestItem(); COptimizedKPSetRoleTestingItem* bottomItem = optKPSetClassificationItem->getBottomConceptSatisfiableTestItem(); topItem->setPropagationConnected(true); QList classList(*optKPSetClassificationItem->getSatisfiableConceptItemList()); qSort(classList.begin(),classList.end(),itemSortLessSubsumptionsThan); QList resevePossSubsumClassList; foreach (COptimizedKPSetRoleTestingItem* item, classList) { COptimizedKPSetRolePossibleSubsumptionMap* possSubSumMap = item->getPossibleSubsumptionMap(false); if (possSubSumMap && possSubSumMap->hasRemainingPossibleSubsumptions()) { if (mConfPossSubsumCalcOrderTopDown) { nextItemList->append(item); remTestingSet->insert(item); } remainingSubSumTestCount += possSubSumMap->getRemainingPossibleSubsumptionCount(); resevePossSubsumClassList.append(item); } if (!item->isPossibleSubsumptionMapInitialized()) { bool bug = true; } QList* subsumerList = item->getSubsumingConceptItemList(); COptimizedKPSetRoleTestingItem* maxSubsumerItem = nullptr; cint64 maxSubsumerCount = 0; for (QList::const_iterator it = subsumerList->constBegin(), itEnd = subsumerList->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleTestingItem* subsumerItem = *it; if (!maxSubsumerItem || subsumerItem->getSubsumingConceptItemCount() > maxSubsumerCount) { maxSubsumerCount = subsumerItem->getSubsumingConceptItemCount(); maxSubsumerItem = subsumerItem; } } if (!maxSubsumerItem) { maxSubsumerItem = topItem; } bool upPropConnected = false; QSet* upPropSet = item->getUpPropagationItemSet(); if (item != topItem) { upPropSet->insert(maxSubsumerItem); maxSubsumerItem->addDownPropagationItem(item); upPropConnected |= maxSubsumerItem->isPropagationConnected(); } for (QList::const_iterator itSub = subsumerList->constBegin(), itSubEnd = subsumerList->constEnd(); itSub != itSubEnd; ++itSub) { COptimizedKPSetRoleTestingItem* subsumerItem = *itSub; bool alreadySubsumed = false; for (QSet::const_iterator itProp = upPropSet->constBegin(), itPropEnd = upPropSet->constEnd(); !alreadySubsumed && itProp != itPropEnd; ++itProp) { COptimizedKPSetRoleTestingItem* propItem = *itProp; if (propItem == subsumerItem || propItem->hasSubsumerConceptItem(subsumerItem)) { alreadySubsumed = true; } } if (!alreadySubsumed) { upPropSet->insert(subsumerItem); subsumerItem->addDownPropagationItem(item); upPropConnected |= subsumerItem->isPropagationConnected(); } } if (!upPropConnected) { for (QList::const_iterator itSub = subsumerList->constBegin(), itSubEnd = subsumerList->constEnd(); itSub != itSubEnd && !upPropConnected; ++itSub) { COptimizedKPSetRoleTestingItem* subsumerItem = *itSub; if (subsumerItem->isPropagationConnected()) { upPropSet->insert(subsumerItem); subsumerItem->addDownPropagationItem(item); upPropConnected |= subsumerItem->isPropagationConnected(); } } if (!upPropConnected) { upPropSet->insert(topItem); topItem->addDownPropagationItem(item); upPropConnected |= topItem->isPropagationConnected(); } } item->setPropagationConnected(upPropConnected); } foreach (COptimizedKPSetRoleTestingItem* item, classList) { COptimizedKPSetRolePossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); QSet* upPropSet = item->getUpPropagationItemSet(); if (!possSubsumMap && item->isPossibleSubsumptionMapInitialized()) { for (QSet::const_iterator itProp = upPropSet->constBegin(), itPropEnd = upPropSet->constEnd(); itProp != itPropEnd; ++itProp) { COptimizedKPSetRoleTestingItem* upPropItem = *itProp; COptimizedKPSetRolePossibleSubsumptionMap* upPropItemPossSubsumMap = upPropItem->getPossibleSubsumptionMap(false); if (upPropItemPossSubsumMap) { for (COptimizedKPSetRolePossibleSubsumptionMap::const_iterator itUpPoss = upPropItemPossSubsumMap->constBegin(), itUpPossEnd = upPropItemPossSubsumMap->constEnd(); itUpPoss != itUpPossEnd; ++itUpPoss) { COptimizedKPSetRolePossibleSubsumptionData* upPossData = itUpPoss.value(); if (!item->hasSubsumerConceptItem(upPossData->getTestingItem()) && item != upPossData->getTestingItem()) { if (!upPossData->isSubsumptionInvalided()) { upPossData->setSubsumptionInvalid(true); if (upPossData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,upPropItem,upPossData); } } } } } } } else { for (QSet::const_iterator itProp = upPropSet->constBegin(), itPropEnd = upPropSet->constEnd(); itProp != itPropEnd; ++itProp) { COptimizedKPSetRoleTestingItem* upPropItem = *itProp; COptimizedKPSetRolePossibleSubsumptionMap* upPropItemPossSubsumMap = upPropItem->getPossibleSubsumptionMap(false); if (upPropItemPossSubsumMap) { COptimizedKPSetRolePossibleSubsumptionMap::const_iterator itUpPoss = upPropItemPossSubsumMap->constBegin(), itUpPossEnd = upPropItemPossSubsumMap->constEnd(); if (possSubsumMap) { COptimizedKPSetRolePossibleSubsumptionMap::const_iterator itPoss = possSubsumMap->constBegin(), itPossEnd = possSubsumMap->constEnd(); while (itPoss != itPossEnd && itUpPoss != itUpPossEnd) { CConcept* possCon = itPoss.key().getConcept(); CConcept* possUpCon = itUpPoss.key().getConcept(); if (possCon->getConceptTag() == possUpCon->getConceptTag()) { ++itPoss; ++itUpPoss; } else if (possCon->getConceptTag() < possUpCon->getConceptTag()) { ++itPoss; } else if (possCon->getConceptTag() > possUpCon->getConceptTag()) { COptimizedKPSetRolePossibleSubsumptionData* upPossData = itUpPoss.value(); if (!item->hasSubsumerConceptItem(upPossData->getTestingItem()) && item != upPossData->getTestingItem()) { if (!upPossData->isSubsumptionInvalided()) { upPossData->setSubsumptionInvalid(true); if (upPossData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,upPropItem,upPossData); } } } ++itUpPoss; } } } while (itUpPoss != itUpPossEnd) { COptimizedKPSetRolePossibleSubsumptionData* upPossData = itUpPoss.value(); if (!item->hasSubsumerConceptItem(upPossData->getTestingItem()) && item != upPossData->getTestingItem()) { if (!upPossData->isSubsumptionInvalided()) { upPossData->setSubsumptionInvalid(true); if (upPossData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,upPropItem,upPossData); } } } ++itUpPoss; } } } } } foreach (COptimizedKPSetRoleTestingItem* item, resevePossSubsumClassList) { COptimizedKPSetRolePossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); if (possSubsumMap) { if (possSubsumMap->hasRemainingPossibleSubsumptions()) { for (COptimizedKPSetRolePossibleSubsumptionMap::const_iterator it = possSubsumMap->constBegin(), itEnd = possSubsumMap->constEnd(); it != itEnd; ++it) { COptimizedKPSetRolePossibleSubsumptionData* possSubsumData = it.value(); if (mConfPossSubsumCalcOrderBottomUp) { if (possSubsumData->isSubsumptionUnknown() || possSubsumData->isUpdateRequired()) { COptimizedKPSetRoleTestingItem* possSubsumerItem = possSubsumData->getTestingItem(); possSubsumerItem->getPossibleSubsumedSet(true)->insert(item); if (!remTestingSet->contains(possSubsumerItem)) { remTestingSet->insert(possSubsumerItem); nextItemList->append(possSubsumerItem); } } } } } } } if (mConfPossSubsumCalcOrderBottomUp) { for (QSet::const_iterator it = remTestingSet->constBegin(), itEnd = remTestingSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleTestingItem* possSubsumerItem = *it; QList* subsumersSortedList = new QList(possSubsumerItem->getPossibleSubsumedSet(false)->toList()); qSort(subsumersSortedList->begin(),subsumersSortedList->end(),itemSortMoreSubsumptionsThan); possSubsumerItem->setPossibleSubsumedList(subsumersSortedList); } } if (mConfWriteDebuggingData) { createDebugKPSetString(optKPSetClassificationItem,"classkpsets-inital-pruned.txt"); } } } } if (optKPSetClassificationItem->hasSatisfiableTestingPhaseFinished() && !optKPSetClassificationItem->hasPossibleSubsumptionTestingPhaseFinished() && !ontClassItem->isTaxonomyConstructionFailed()) { QList* nextItemList = optKPSetClassificationItem->getNextPossibleSubsumptionTestingItemList(); QSet* currentItemSet = optKPSetClassificationItem->getCurrentPossibleSubsumptionTestingItemSet(); bool canContinueSearchingForTests = true; while (!workTestCreated && optKPSetClassificationItem->hasRemainingPossibleSubsumptionTests() && canContinueSearchingForTests) { // get next possible subsumption test canContinueSearchingForTests = false; COptimizedKPSetRoleTestingItem* nextPossSubsumTestItem = nullptr; if (!nextItemList->isEmpty()) { nextPossSubsumTestItem = nextItemList->takeFirst(); } if (nextPossSubsumTestItem) { canContinueSearchingForTests = true; if (mConfPossSubsumCalcOrderTopDown) { COptimizedKPSetRolePossibleSubsumptionMap* possSubsumerMap = nextPossSubsumTestItem->getPossibleSubsumptionMap(false); if (possSubsumerMap && possSubsumerMap->hasRemainingPossibleSubsumptions()) { COptimizedKPSetRolePossibleSubsumptionData* possSubsumCalcData = getNextPossibleSubsumptionCalculation(optKPSetClassificationItem,nextPossSubsumTestItem); if (possSubsumCalcData) { currentItemSet->insert(nextPossSubsumTestItem); optKPSetClassificationItem->incRunningPossibleSubsumptionTestsCount(); if (calculateSubsumption(optKPSetClassificationItem,nextPossSubsumTestItem,possSubsumCalcData->getTestingItem(),possSubsumCalcData)) { workTestCreated = true; } else { interpreteSubsumptionResult(optKPSetClassificationItem,nextPossSubsumTestItem->getTestingConcept(),possSubsumCalcData->getTestingItem()->getTestingConcept(),possSubsumCalcData->isSubsumptionConfirmed()); } } } else { QSet* remTestingSet = optKPSetClassificationItem->getRemainingPossibleSubsumptionTestingSet(); remTestingSet->remove(nextPossSubsumTestItem); } } else if (mConfPossSubsumCalcOrderBottomUp) { COptimizedKPSetRolePossibleSubsumptionData* possSubsumCalcData = nullptr; COptimizedKPSetRoleTestingItem* possSubsumedItem = nullptr; CConcept* possSubsumerConcept = nextPossSubsumTestItem->getTestingConcept(); CConcept* candidateConcept = possSubsumerConcept; QList* possSubsumedSortedList = nextPossSubsumTestItem->getPossibleSubsumedList(); if (possSubsumedSortedList && !possSubsumedSortedList->isEmpty()) { while (!possSubsumCalcData && !possSubsumedSortedList->isEmpty()) { possSubsumedItem = possSubsumedSortedList->takeFirst(); if (nextPossSubsumTestItem->getPossibleSubsumedSet(false)->contains(possSubsumedItem)) { nextPossSubsumTestItem->getPossibleSubsumedSet(false)->remove(possSubsumedItem); COptimizedKPSetRolePossibleSubsumptionMap* possSubsumerMap = possSubsumedItem->getPossibleSubsumptionMap(false); if (possSubsumerMap && possSubsumerMap->hasRemainingPossibleSubsumptions()) { possSubsumCalcData = possSubsumerMap->value(CConceptTagComparer(candidateConcept)); } } } } if (possSubsumCalcData) { //if ((possSubsumCalcData->isUpdateRequired() || possSubsumCalcData->isSubsumptionUnknown())) { currentItemSet->insert(nextPossSubsumTestItem); optKPSetClassificationItem->incRunningPossibleSubsumptionTestsCount(); if (calculateSubsumption(optKPSetClassificationItem,possSubsumedItem,nextPossSubsumTestItem,possSubsumCalcData)) { workTestCreated = true; } else { interpreteSubsumptionResult(optKPSetClassificationItem,possSubsumedItem->getTestingConcept(),nextPossSubsumTestItem->getTestingConcept(),possSubsumCalcData->isSubsumptionConfirmed()); } //} } else { QSet* remTestingSet = optKPSetClassificationItem->getRemainingPossibleSubsumptionTestingSet(); remTestingSet->remove(nextPossSubsumTestItem); } } } } if (!workTestCreated && currentItemSet->isEmpty()) { optKPSetClassificationItem->setPossibleSubsumptionTestingPhaseFinished(true); } } if (!workTestCreated) { if (optKPSetClassificationItem->hasPossibleSubsumptionTestingPhaseFinished() || ontClassItem->isTaxonomyConstructionFailed()) { finishOntologyClassification(ontClassItem); processingOntItemList.removeFirst(); } else { processingOntItemList.removeFirst(); processingOntItemList.append(ontClassItem); loopOntClassItem = ontClassItem; } } } return workTestCreated; } COptimizedKPSetRolePossibleSubsumptionData* COptimizedKPSetRoleSubsumptionClassifierThread::getNextPossibleSubsumptionCalculation(COptimizedKPSetRoleOntologyClassificationItem *ontClassItem, COptimizedKPSetRoleTestingItem* classItem) { COptimizedKPSetRolePossibleSubsumptionData* possSubsumer = nullptr; // I don't know which is the best, simply return the first one // sort by subsumer count? COptimizedKPSetRolePossibleSubsumptionMap* possSubsumerMap = classItem->getPossibleSubsumptionMap(false); if (possSubsumerMap) { if (mConfPossSubsumCalcOrderConceptSorted) { for (COptimizedKPSetRolePossibleSubsumptionMap::const_iterator it = possSubsumerMap->constBegin(), itEnd = possSubsumerMap->constEnd(); !possSubsumer && it != itEnd; ++it) { COptimizedKPSetRolePossibleSubsumptionData* possSubsumData = it.value(); if (possSubsumData->isSubsumptionUnknown()) { possSubsumer = possSubsumData; } else if (possSubsumData->isUpdateRequired()) { prunePossibleSubsumptions(ontClassItem,classItem,possSubsumData); } } } } return possSubsumer; } bool COptimizedKPSetRoleSubsumptionClassifierThread::calculateSatisfiable(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRoleTestingItem* nextSatTestItem) { CSatisfiableCalculationJob* satCalcJob = nullptr; CClassificationWorkItem *workItem = 0; CConcept* concept = nextSatTestItem->getTestingConcept(); nextSatTestItem->setSatisfiableTestOrdered(true); bool satisfiableFlag = false; if (nextSatTestItem->isResultSatisfiableDerivated()) { satisfiableFlag = true; nextSatTestItem->setSatisfiableTested(true); nextSatTestItem->setSatisfiableTestedResult(true); return false; } if (nextSatTestItem->isResultUnsatisfiableDerivated()) { satisfiableFlag = false; nextSatTestItem->setSatisfiableTested(true); nextSatTestItem->setSatisfiableTestedResult(false); return false; } CPrecomputedSaturationSubsumerExtractor* precSatSubsumerExtractor = optKPSetClassificationItem->getPrecomputedSaturationSubsumerExtractor(false); bool unsatisfiableFlag = false; if (precSatSubsumerExtractor && precSatSubsumerExtractor->getConceptFlags(concept,&unsatisfiableFlag,nullptr,nullptr) && unsatisfiableFlag) { satisfiableFlag = false; nextSatTestItem->setSatisfiableTested(true); nextSatTestItem->setSatisfiableTestedResult(false); return false; } CSatisfiableCalculationJobGenerator satCalcJobGen(optKPSetClassificationItem->getOntology()); satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(concept); QHash *workHash = optKPSetClassificationItem->getWorkItemHash(); CClassifierStatistics *ontClassStat = optKPSetClassificationItem->getClassifierStatistics(); if (ontClassStat) { ontClassStat->incCalculatedTestedSatisfiableCount(1); } workItem = new CClassificationWorkItem(satCalcJob,concept); workHash->insertMulti(satCalcJob,workItem); workOntItemHash.insert(workItem,optKPSetClassificationItem); QHash* conRefLinkDataHash = optKPSetClassificationItem->getConceptReferenceLinkingDataHash(); cint64 extFlags = CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTALL; // TODO: set extraction flags satCalcJob->setSatisfiableClassificationMessageAdapter(new CSatisfiableTaskClassificationMessageAdapter(concept,optKPSetClassificationItem->getOntology(),this,conRefLinkDataHash,extFlags)); optKPSetClassificationItem->incCurrentCalculatingCount(); processCalculationJob(satCalcJob,optKPSetClassificationItem,workItem); if (optKPSetClassificationItem->getIndividualDependenceTrackingCollector()) { satCalcJob->setSatisfiableTaskIndividualDependenceTrackingAdapter(new CSatisfiableTaskIndividualDependenceTrackingAdapter(optKPSetClassificationItem->getIndividualDependenceTrackingCollector())); } ++mCreatedCalculationTaskCount; return true; } bool COptimizedKPSetRoleSubsumptionClassifierThread::calculateSubsumption(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRoleTestingItem* subsumedItem, COptimizedKPSetRoleTestingItem* possSubsumerItem, COptimizedKPSetRolePossibleSubsumptionData* possSubsumData) { CSatisfiableCalculationJob* satCalcJob = nullptr; CClassificationWorkItem *workItem = 0; ++mOrderedSubsumptionCalculationCount; CConcept* subsumedConcept = subsumedItem->getTestingConcept(); CConcept* subsumerConcept = possSubsumerItem->getTestingConcept(); bool isSubsumptionFlag = false; bool precheckedSubsum = false; CClassifierStatistics *ontClassStat = optKPSetClassificationItem->getClassifierStatistics(); if (possSubsumData && possSubsumData->isSubsumptionKnown()) { return false; } else if (possSubsumData && subsumedItem->hasSubsumerConceptItem(possSubsumerItem)) { possSubsumData->setSubsumptionConfirmed(true); return false; } CSatisfiableCalculationJobGenerator satCalcJobGen(optKPSetClassificationItem->getOntology()); satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(subsumedConcept,false,subsumerConcept,true); QHash *workHash = optKPSetClassificationItem->getWorkItemHash(); if (ontClassStat) { ontClassStat->incCalculatedTestedSubsumptionCount(1); ontClassStat->incToldSubsumptionCount(1); } workItem = new CClassificationWorkItem(satCalcJob,subsumerConcept,subsumedConcept); workHash->insertMulti(satCalcJob,workItem); workOntItemHash.insert(workItem,optKPSetClassificationItem); QHash* conRefLinkDataHash = optKPSetClassificationItem->getConceptReferenceLinkingDataHash(); cint64 extFlags = CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTSUBSUMERSOTHERNODES | CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTPOSSIBLESUBSUMERSROOTNODE | CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTPOSSIBLESUBSUMERSOTHERNODES | CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTOTHERNODESMULTIPLEDEPENDENCY; // TODO: set extraction flags satCalcJob->setSatisfiableClassificationMessageAdapter(new CSatisfiableTaskClassificationMessageAdapter(subsumedConcept,optKPSetClassificationItem->getOntology(),this,conRefLinkDataHash,extFlags)); if (optKPSetClassificationItem->getIndividualDependenceTrackingCollector()) { satCalcJob->setSatisfiableTaskIndividualDependenceTrackingAdapter(new CSatisfiableTaskIndividualDependenceTrackingAdapter(optKPSetClassificationItem->getIndividualDependenceTrackingCollector())); } optKPSetClassificationItem->incCurrentCalculatingCount(); processCalculationJob(satCalcJob,optKPSetClassificationItem,workItem); optKPSetClassificationItem->incCalculatedPossibleSubsumerCount(); ++mCreatedCalculationTaskCount; return true; } void COptimizedKPSetRoleSubsumptionClassifierThread::incRemainingPossibleSubsumptionTestingCount(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRolePossibleSubsumptionMap* posSubsumMap) { optKPSetClassificationItem->incPossibleSubsumerCount(); optKPSetClassificationItem->incRemainingPossibleSubsumptionTestsCount(); posSubsumMap->incRemainingPossibleSubsumptionCount(); ++totalToSubsumTestCount; } void COptimizedKPSetRoleSubsumptionClassifierThread::decRemainingPossibleSubsumptionTestingCount(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRolePossibleSubsumptionMap* posSubsumMap, bool subsumptionConfirmed) { if (subsumptionConfirmed) { optKPSetClassificationItem->incTruePossibleSubsumerCount(); } else { optKPSetClassificationItem->incFalsePossibleSubsumerCount(); } optKPSetClassificationItem->decRemainingPossibleSubsumptionTestsCount(); posSubsumMap->decRemainingPossibleSubsumptionCount(); ++subsumTestedCount; } CSubsumptionClassifierThread *COptimizedKPSetRoleSubsumptionClassifierThread::processCalculationJob(CSatisfiableCalculationJob* job, COntologyClassificationItem *ontClassItem, CClassificationWorkItem* workItem) { CClassificationCalculationStatisticsCollection* statColl = nullptr; if (ontClassItem->isCollectProcessStatisticsActivated()) { statColl = ontClassItem->getCalculationStatisticsCollection(); } job->setCalclulationStatisticsCollector(statColl); CTestCalculatedCallbackEvent *testResultCallback = new CTestCalculatedCallbackEvent(this,job,workItem,statColl); job->setCalculationConfiguration(ontClassItem->getCalculationConfiguration()); CSubsumptionClassifierThread::processCalculationJob(job,ontClassItem,testResultCallback,false); return this; } bool COptimizedKPSetRoleSubsumptionClassifierThread::processToldClassificationMessage(COntologyClassificationItem *ontClassItem, CClassificationMessageData* messageDataLinker, CMemoryPool* memoryPools) { COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem = (COptimizedKPSetRoleOntologyClassificationItem *)ontClassItem; CClassificationMessageData* messageDataLinkerIt = messageDataLinker; while (messageDataLinkerIt) { CClassificationMessageData* messageData = messageDataLinkerIt; if (messageData->getClassificationMessageDataType() == CClassificationMessageData::TELLCLASSSUBSUMPTION) { ++mStatProcesedSubsumMessCount; CClassificationSubsumptionMessageData* subsumMessageData = (CClassificationSubsumptionMessageData*)messageData; CConcept* subsumedConcept = subsumMessageData->getSubsumedConcept(); CCLASSSUBSUMPTIONMESSAGELIST* subsumerList = subsumMessageData->getClassSubsumerList(); COptimizedKPSetRoleTestingItem* subsumedItem = nullptr; subsumedItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumedConcept); COptimizedKPSetRolePossibleSubsumptionMap* possSubsumMap = subsumedItem->getPossibleSubsumptionMap(false); if (subsumerList) { for (CCLASSSUBSUMPTIONMESSAGELIST::const_iterator it = subsumerList->constBegin(), itEnd = subsumerList->constEnd(); it != itEnd; ++it) { CConcept* subsumerConcept(*it); COptimizedKPSetRoleTestingItem* subsumerItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumerConcept); if (subsumedItem != subsumerItem) { subsumedItem->addSubsumingConceptItem(subsumerItem); if (possSubsumMap) { COptimizedKPSetRolePossibleSubsumptionData* possSubsumData = possSubsumMap->value(subsumerConcept,nullptr); if (possSubsumData) { if (!possSubsumData->isSubsumptionConfirmed()) { possSubsumData->setSubsumptionConfirmed(true); if (possSubsumData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possSubsumData); } } } } propagateDownSubsumption(optKPSetClassificationItem,subsumedItem,subsumerItem); } } } //if (!possSubsumMap || !possSubsumMap->hasRemainingPossibleSubsumptions()) { subsumedItem->setResultSatisfiableDerivated(true); //} } else if (messageData->getClassificationMessageDataType() == CClassificationMessageData::TELLCLASSINITIALIZEPOSSIBLESUBSUM) { ++mStatProcesedPossSubsumInitMessCount; CClassificationInitializePossibleSubsumptionMessageData* possSubsumMessageData = (CClassificationInitializePossibleSubsumptionMessageData*)messageData; CConcept* subsumedConcept = possSubsumMessageData->getSubsumedConcept(); CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* possSubsumerList = possSubsumMessageData->getClassPossibleSubsumerList(); COptimizedKPSetRoleTestingItem* subsumedItem = nullptr; subsumedItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumedConcept); COptimizedKPSetRolePossibleSubsumptionMap* possSubsumMap = subsumedItem->getPossibleSubsumptionMap(false); if (!possSubsumerList || possSubsumerList->empty()) { if (possSubsumMap) { for (COptimizedKPSetRolePossibleSubsumptionMap::const_iterator it = possSubsumMap->constBegin(), itEnd = possSubsumMap->constEnd(); it != itEnd; ++it) { COptimizedKPSetRolePossibleSubsumptionData* possSubsumData = it.value(); if (possSubsumData->isSubsumptionUnknown()) { possSubsumData->setSubsumptionInvalid(true); if (possSubsumData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possSubsumData); } } } } } else { if (!subsumedItem->isPossibleSubsumptionMapInitialized() || possSubsumMap) { possSubsumMap = subsumedItem->getPossibleSubsumptionMap(true); if (possSubsumMap->isEmpty()) { // initialize the possible subsumption map if (possSubsumerList) { for (CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST::const_iterator it = possSubsumerList->constBegin(), itEnd = possSubsumerList->constEnd(); it != itEnd; ++it) { CClassificationInitializePossibleSubsumptionData* possSubsumDataIt = *it; if (possSubsumDataIt->isPossibleSubsumerValid()) { CConcept* possSubsumConcept = possSubsumDataIt->getPossibleSubsumerConcept(); COptimizedKPSetRoleTestingItem* possSubsumItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(possSubsumConcept); if (!subsumedItem->hasSubsumerConceptItem(possSubsumItem) && subsumedItem != possSubsumItem) { COptimizedKPSetRolePossibleSubsumptionData* possSubsumData = new COptimizedKPSetRolePossibleSubsumptionData(possSubsumItem); possSubsumMap->insert(CConceptTagComparer(possSubsumConcept),possSubsumData); incRemainingPossibleSubsumptionTestingCount(optKPSetClassificationItem,possSubsumMap); } } } } // prune ancestor items QSet* upPropSet = subsumedItem->getUpPropagationItemSet(); for (QSet::const_iterator it = upPropSet->constBegin(), itEnd = upPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleTestingItem* upPropItem = *it; COptimizedKPSetRolePossibleSubsumptionMap* upPropItemPossSubsumMap = upPropItem->getPossibleSubsumptionMap(false); if (upPropItemPossSubsumMap) { COptimizedKPSetRolePossibleSubsumptionMap::const_iterator itPoss = possSubsumMap->constBegin(), itPossEnd = possSubsumMap->constEnd(); COptimizedKPSetRolePossibleSubsumptionMap::const_iterator itUpPoss = upPropItemPossSubsumMap->constBegin(), itUpPossEnd = upPropItemPossSubsumMap->constEnd(); while (itPoss != itPossEnd && itUpPoss != itUpPossEnd) { CConcept* possCon = itPoss.key().getConcept(); CConcept* possUpCon = itUpPoss.key().getConcept(); if (possCon->getConceptTag() == possUpCon->getConceptTag()) { ++itPoss; ++itUpPoss; } else if (possCon->getConceptTag() < possUpCon->getConceptTag()) { ++itPoss; } else if (possCon->getConceptTag() > possUpCon->getConceptTag()) { COptimizedKPSetRolePossibleSubsumptionData* upPossData = itUpPoss.value(); if (!subsumedItem->hasSubsumerConceptItem(upPossData->getTestingItem()) && subsumedItem != upPossData->getTestingItem()) { if (!upPossData->isSubsumptionInvalided()) { upPossData->setSubsumptionInvalid(true); if (upPossData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,upPropItem,upPossData); } } } ++itUpPoss; } } while (itUpPoss != itUpPossEnd) { COptimizedKPSetRolePossibleSubsumptionData* upPossData = itUpPoss.value(); if (!subsumedItem->hasSubsumerConceptItem(upPossData->getTestingItem()) && subsumedItem != upPossData->getTestingItem()) { if (!upPossData->isSubsumptionInvalided()) { upPossData->setSubsumptionInvalid(true); if (upPossData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,upPropItem,upPossData); } } } ++itUpPoss; } } } // prune descendant items QSet* downPropSet = subsumedItem->getDownPropagationItemSet(); for (QSet::const_iterator it = downPropSet->constBegin(), itEnd = downPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleTestingItem* downPropItem = *it; COptimizedKPSetRolePossibleSubsumptionMap* downPropItemPossSubsumMap = downPropItem->getPossibleSubsumptionMap(false); if (downPropItemPossSubsumMap) { COptimizedKPSetRolePossibleSubsumptionMap::const_iterator itPoss = possSubsumMap->constBegin(), itPossEnd = possSubsumMap->constEnd(); COptimizedKPSetRolePossibleSubsumptionMap::const_iterator itDownPoss = downPropItemPossSubsumMap->constBegin(), itDownPossEnd = downPropItemPossSubsumMap->constEnd(); while (itPoss != itPossEnd && itDownPoss != itDownPossEnd) { CConcept* possCon = itPoss.key().getConcept(); CConcept* possDownCon = itDownPoss.key().getConcept(); if (possCon->getConceptTag() == possDownCon->getConceptTag()) { ++itPoss; ++itDownPoss; } else if (possDownCon->getConceptTag() < possCon->getConceptTag()) { ++itDownPoss; } else if (possDownCon->getConceptTag() > possCon->getConceptTag()) { COptimizedKPSetRolePossibleSubsumptionData* possData = itPoss.value(); if (!downPropItem->hasSubsumerConceptItem(possData->getTestingItem()) && downPropItem != possData->getTestingItem()) { if (!possData->isSubsumptionInvalided()) { possData->setSubsumptionInvalid(true); if (possData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possData); } } } ++itPoss; } } while (itPoss != itPossEnd) { COptimizedKPSetRolePossibleSubsumptionData* possData = itDownPoss.value(); if (!downPropItem->hasSubsumerConceptItem(possData->getTestingItem()) && downPropItem != possData->getTestingItem()) { if (!possData->isSubsumptionInvalided()) { possData->setSubsumptionInvalid(true); if (possData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possData); } } } ++itPoss; } } else if (downPropItem->isPossibleSubsumptionMapInitialized()) { for (COptimizedKPSetRolePossibleSubsumptionMap::const_iterator itPoss = possSubsumMap->constBegin(), itPossEnd = possSubsumMap->constEnd(); itPoss != itPossEnd; ++itPoss) { COptimizedKPSetRolePossibleSubsumptionData* possData = itPoss.value(); if (!downPropItem->hasSubsumerConceptItem(possData->getTestingItem()) && downPropItem != possData->getTestingItem()) { if (!possData->isSubsumptionInvalided()) { possData->setSubsumptionInvalid(true); if (possData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possData); } } } } } } } else { // prune the possible subsumption map COptimizedKPSetRolePossibleSubsumptionMap::const_iterator itPoss = possSubsumMap->constBegin(), itPossEnd = possSubsumMap->constEnd(); if (possSubsumerList) { CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST::const_iterator itNew = possSubsumerList->constBegin(), itNewEnd = possSubsumerList->constEnd(); while (itPoss != itPossEnd && itNew != itNewEnd) { COptimizedKPSetRolePossibleSubsumptionData* possData = itPoss.value(); CConcept* possCon = itPoss.key().getConcept(); CClassificationInitializePossibleSubsumptionData* possNewSubsumDataIt = *itNew; if (possNewSubsumDataIt->isPossibleSubsumerValid()) { CConcept* newCon = possNewSubsumDataIt->getPossibleSubsumerConcept(); if (possCon->getConceptTag() == newCon->getConceptTag()) { ++itPoss; ++itNew; } else if (possCon->getConceptTag() < newCon->getConceptTag()) { if (!possData->isSubsumptionInvalided()) { possData->setSubsumptionInvalid(true); if (possData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possData); } } ++itPoss; } else if (possCon->getConceptTag() > newCon->getConceptTag()) { ++itNew; } } else { ++itNew; } } } while (itPoss != itPossEnd) { COptimizedKPSetRolePossibleSubsumptionData* possData = itPoss.value(); CConcept* possCon = itPoss.key().getConcept(); if (!possData->isSubsumptionInvalided()) { possData->setSubsumptionInvalid(true); if (possData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possData); } } ++itPoss; } } } } subsumedItem->setPossibleSubsumptionMapInitialized(true); } else if (messageData->getClassificationMessageDataType() == CClassificationMessageData::TELLCLASSUPDATEPOSSIBLESUBSUM) { ++mStatProcesedPossSubsumUpdateMessCount; CClassificationUpdatePossibleSubsumptionMessageData* possSubsumMessageData = (CClassificationUpdatePossibleSubsumptionMessageData*)messageData; CConcept* subsumedConcept = possSubsumMessageData->getSubsumedConcept(); COptimizedKPSetRoleTestingItem* subsumedItem = nullptr; subsumedItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumedConcept); COptimizedKPSetRolePossibleSubsumptionMap* possSubsumMap = subsumedItem->getPossibleSubsumptionMap(false); if (possSubsumMap && !possSubsumMap->empty()) { possSubsumMap = subsumedItem->getPossibleSubsumptionMap(true); for (COptimizedKPSetRolePossibleSubsumptionMap::const_iterator it = possSubsumMap->constBegin(), itEnd = possSubsumMap->constEnd(); it != itEnd; ++it) { COptimizedKPSetRolePossibleSubsumptionData* possSubsumData = it.value(); if (possSubsumData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possSubsumData); } } } } messageDataLinkerIt = messageDataLinkerIt->getNext(); } return true; } bool COptimizedKPSetRoleSubsumptionClassifierThread::interpreteToldSubsumptionResult(COntologyClassificationItem *ontClassItem, const QList > &subSumRelList, bool isSubSum) { CConcept *lastConcept = nullptr; COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem = (COptimizedKPSetRoleOntologyClassificationItem *)ontClassItem; COptimizedKPSetRoleTestingItem* subsumerItem = nullptr; for (QList >::const_iterator it = subSumRelList.constBegin(), itEnd = subSumRelList.constEnd(); it != itEnd; ++it) { CConcept *subsumerConcept = it->first; if (lastConcept != subsumerConcept) { lastConcept = subsumerConcept; subsumerItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumerConcept); } CConcept *subsumedConcept = it->second; if (isSubSum) { COptimizedKPSetRoleTestingItem* subsumedItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumedConcept); subsumerItem->addSubsumingConceptItem(subsumedItem); } } return true; } bool COptimizedKPSetRoleSubsumptionClassifierThread::interpreteSubsumptionResult(COntologyClassificationItem *ontClassItem, CConcept *subsumedConcept, CConcept *subsumerConcept, bool isSubsumption) { COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem = (COptimizedKPSetRoleOntologyClassificationItem *)ontClassItem; ++mInterpretedSubsumptionCalculationCount; CConcept* candidateConcept = subsumerConcept; optKPSetClassificationItem->decRunningPossibleSubsumptionTestsCount(); COptimizedKPSetRoleTestingItem* subsumedItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumedConcept); COptimizedKPSetRoleTestingItem* subsumerItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(subsumerConcept); //QString iriClassNameString1 = CIRIName::getRecentIRIName(subsumedConcept->getClassNameLinker()); //QString iriClassNameString2 = CIRIName::getRecentIRIName(subsumerConcept->getClassNameLinker()); //if (iriClassNameString1 == "http://www.bootstrep.eu/ontology/GRO#BindingOfProteinToProteinBindingSiteOfDNA" && iriClassNameString2 == "http://www.bootstrep.eu/ontology/GRO#DNAProteinInteraction" && !isSubsumption) { // bool bug = true; // calculateSubsumption(optKPSetClassificationItem,subsumedItem,subsumerItem,nullptr); //} COptimizedKPSetRoleTestingItem* topItem = optKPSetClassificationItem->getTopConceptSatisfiableTestItem(); COptimizedKPSetRolePossibleSubsumptionMap* possSubsumMap = subsumedItem->getPossibleSubsumptionMap(false); COptimizedKPSetRolePossibleSubsumptionData* possSubsumData = nullptr; if (possSubsumMap) { possSubsumData = possSubsumMap->value(candidateConcept); } if (isSubsumption) { optKPSetClassificationItem->incCalculatedTruePossibleSubsumerCount(); if (possSubsumData) { possSubsumData->setSubsumptionConfirmed(true); } subsumedItem->addSubsumingConceptItem(subsumerItem); subsumedItem->addUpPropagationItem(subsumerItem); subsumerItem->addDownPropagationItem(subsumedItem); propagateDownSubsumption(optKPSetClassificationItem,subsumedItem,subsumerItem); } else { optKPSetClassificationItem->incCalculatedFalsePossibleSubsumerCount(); if (possSubsumData) { possSubsumData->setSubsumptionInvalid(true); } } if (possSubsumData && possSubsumData->isUpdateRequired()) { prunePossibleSubsumptions(optKPSetClassificationItem,subsumedItem,possSubsumData); } QList* nextItemList = optKPSetClassificationItem->getNextPossibleSubsumptionTestingItemList(); QSet* currentItemSet = optKPSetClassificationItem->getCurrentPossibleSubsumptionTestingItemSet(); if (mConfPossSubsumCalcOrderTopDown) { if (currentItemSet->contains(subsumedItem)) { currentItemSet->remove(subsumedItem); if (possSubsumMap) { if (possSubsumMap->hasRemainingPossibleSubsumptions()) { nextItemList->prepend(subsumedItem); } else { QSet* remTestingSet = optKPSetClassificationItem->getRemainingPossibleSubsumptionTestingSet(); remTestingSet->remove(subsumedItem); } } } } if (mConfPossSubsumCalcOrderBottomUp) { if (currentItemSet->contains(subsumerItem)) { currentItemSet->remove(subsumerItem); if (subsumerItem->hasRemainingPossibleSubsumedItems()) { QSet* remPossSubsumedItemSet = subsumerItem->getPossibleSubsumedSet(false); QList* remPossSubsumedItemList = subsumerItem->getPossibleSubsumedList(); nextItemList->prepend(subsumerItem); QSet* upPropSet = subsumedItem->getUpPropagationItemSet(); for (QSet::const_iterator itUp = upPropSet->constBegin(), itUpEnd = upPropSet->constEnd(); itUp != itUpEnd; ++itUp) { COptimizedKPSetRoleTestingItem* upItem = *itUp; if (remPossSubsumedItemSet->contains(upItem)) { remPossSubsumedItemList->prepend(upItem); } } } else { QSet* remTestingSet = optKPSetClassificationItem->getRemainingPossibleSubsumptionTestingSet(); remTestingSet->remove(subsumerItem); } } } return true; } bool COptimizedKPSetRoleSubsumptionClassifierThread::prunePossibleSubsumptions(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRoleTestingItem* item, COptimizedKPSetRolePossibleSubsumptionData* possSubsumData) { if (possSubsumData->isUpdateRequired()) { COptimizedKPSetRolePossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); possSubsumData->setSubsumptionUpdated(true); decRemainingPossibleSubsumptionTestingCount(optKPSetClassificationItem,possSubsumMap,true); if (possSubsumData->isSubsumptionConfirmed()) { // is subsuming COptimizedKPSetRoleTestingItem* subsumerItem = possSubsumData->getTestingItem(); CConcept* subsumerConcept = subsumerItem->getTestingConcept(); // establish the subsumption for all successor nodes QSet* downPropSet = item->getDownPropagationItemSet(); for (QSet::const_iterator it = downPropSet->constBegin(), itEnd = downPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleTestingItem* downPropItem = *it; pruneDownSubsumption(optKPSetClassificationItem,downPropItem,subsumerConcept); } return true; } else { // is not subsuming COptimizedKPSetRoleTestingItem* notSubsumerItem = possSubsumData->getTestingItem(); CConcept* notSubsumerConcept = notSubsumerItem->getTestingConcept(); // establish the subsumption for all successor nodes QSet* upPropSet = item->getUpPropagationItemSet(); for (QSet::const_iterator it = upPropSet->constBegin(), itEnd = upPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleTestingItem* upPropItem = *it; pruneUpNotSubsumption(optKPSetClassificationItem,upPropItem,notSubsumerConcept); } return true; } } return false; } bool COptimizedKPSetRoleSubsumptionClassifierThread::propagateDownSubsumption(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRoleTestingItem* item, COptimizedKPSetRoleTestingItem* subsumerItem) { bool propagated = false; QSet* downPropSet = item->getDownPropagationItemSet(); for (QSet::const_iterator it = downPropSet->constBegin(), itEnd = downPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleTestingItem* downPropItem = *it; if (!downPropItem->hasSubsumerConceptItem(subsumerItem) && downPropItem != subsumerItem) { downPropItem->addSubsumingConceptItem(subsumerItem); propagateDownSubsumption(optKPSetClassificationItem,downPropItem,subsumerItem); propagated = true; } } return propagated; } bool COptimizedKPSetRoleSubsumptionClassifierThread::pruneDownSubsumption(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRoleTestingItem* item, CConcept* subsumerConcept) { COptimizedKPSetRolePossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); if (possSubsumMap) { COptimizedKPSetRolePossibleSubsumptionData* possSubsumData = possSubsumMap->value(subsumerConcept); if (possSubsumData && !possSubsumData->isSubsumptionConfirmed()) { possSubsumData->setSubsumptionConfirmed(true); possSubsumData->setSubsumptionUpdated(true); decRemainingPossibleSubsumptionTestingCount(optKPSetClassificationItem,possSubsumMap,true); CClassifierStatistics *ontClassStat = optKPSetClassificationItem->getClassifierStatistics(); if (ontClassStat) { ontClassStat->incDerivatedTestedSubsumptionCount(1); } QSet* downPropSet = item->getDownPropagationItemSet(); for (QSet::const_iterator it = downPropSet->constBegin(), itEnd = downPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleTestingItem* downPropItem = *it; pruneDownSubsumption(optKPSetClassificationItem,downPropItem,subsumerConcept); } return true; } } return false; } bool COptimizedKPSetRoleSubsumptionClassifierThread::pruneUpNotSubsumption(COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem, COptimizedKPSetRoleTestingItem* item, CConcept* notSubsumerConcept) { COptimizedKPSetRolePossibleSubsumptionMap* possSubsumMap = item->getPossibleSubsumptionMap(false); if (possSubsumMap) { COptimizedKPSetRolePossibleSubsumptionData* possSubsumData = possSubsumMap->value(notSubsumerConcept); if (possSubsumData && !possSubsumData->isSubsumptionInvalided()) { possSubsumData->setSubsumptionInvalid(true); possSubsumData->setSubsumptionUpdated(true); decRemainingPossibleSubsumptionTestingCount(optKPSetClassificationItem,possSubsumMap,false); CClassifierStatistics *ontClassStat = optKPSetClassificationItem->getClassifierStatistics(); if (ontClassStat) { ontClassStat->incPrunedTestedSubsumptionCount(1); } QSet* upPropSet = item->getUpPropagationItemSet(); for (QSet::const_iterator it = upPropSet->constBegin(), itEnd = upPropSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleTestingItem* upPropItem = *it; pruneUpNotSubsumption(optKPSetClassificationItem,upPropItem,notSubsumerConcept); } return true; } } return false; } bool COptimizedKPSetRoleSubsumptionClassifierThread::interpreteSatisfiableResult(COntologyClassificationItem *ontClassItem, CConcept *satisfiableConcept, bool isSatis) { COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem = (COptimizedKPSetRoleOntologyClassificationItem *)ontClassItem; CClassifierStatistics *ontClassStat = optKPSetClassificationItem->getClassifierStatistics(); if (ontClassStat) { ontClassStat->incToldSatisfiableCount(1); } ++satTestedCount; optKPSetClassificationItem->decRunningSatisfiableTestsCount(); COptimizedKPSetRoleTestingItem* satTestedItem = optKPSetClassificationItem->getConceptSatisfiableTestItem(satisfiableConcept); //if (CIRIName::getRecentIRIName(satisfiableConcept->getClassNameLinker()) == "http://www.gdst.uqam.ca/Documents/Ontologies/HIT/Equipment_SH_Ontology.owl#Folding_chair" && !isSatis) { // bool bug = true; // calculateSatisfiable(optKPSetClassificationItem,satTestedItem); // return false; //} satTestedItem->setSatisfiableTested(true); satTestedItem->setSatisfiableTestedResult(isSatis); COptimizedKPSetRoleTestingItem* topItem = optKPSetClassificationItem->getTopConceptSatisfiableTestItem(); if (isSatis) { optKPSetClassificationItem->addSatisfiableConceptItem(satTestedItem); } else { CTaxonomy *tax = optKPSetClassificationItem->getTaxonomy(); if (topItem) { tax->setConceptSatisfiable(satisfiableConcept,false); } else { tax->getBottomHierarchyNode()->addEquivalentConcept(satisfiableConcept); tax->updateNodeEquivalences(tax->getBottomHierarchyNode()); } } QList* nextItemList = optKPSetClassificationItem->getNextSatisfiableTestingItemList(); QSet* nextCandItemSet = optKPSetClassificationItem->getNextCandidateSatisfiableTestingItemSet(); QSet* remainingCandItemSet = optKPSetClassificationItem->getRemainingCandidateSatisfiableTestingItemSet(); QList* subSumItemList = satTestedItem->getSubsumingConceptItemList(); QList* succItemList = satTestedItem->getSuccessorItemList(); for (QList::const_iterator it = succItemList->constBegin(), itEnd = succItemList->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleTestingItem* succItem = *it; if (!isSatis) { succItem->setResultUnsatisfiableDerivated(true); } else { for (QList::const_iterator itSubsum = subSumItemList->constBegin(), itSubsumEnd = subSumItemList->constEnd(); itSubsum != itSubsumEnd; ++itSubsum) { COptimizedKPSetRoleTestingItem* subusmerItem = *itSubsum; if (succItem != subusmerItem) { succItem->addSubsumingConceptItem(subusmerItem); } } } succItem->decUnprocessedPredecessorItems(); if (succItem->hasOnlyProcessedPredecessorItems()) { nextItemList->append(succItem); } else { nextCandItemSet->insert(succItem); } } return false; } bool COptimizedKPSetRoleSubsumptionClassifierThread::interpreteTestResults(CTestCalculatedCallbackEvent *testResult) { CSatisfiableCalculationJob *satCalcJob = testResult->getSatisfiableCalculationJob(); bool testSat = testResult->getTestResultSatisfiable(); CClassificationWorkItem *workItem = testResult->getClassificationWorkItem(); ++mRecievedCallbackCount; COntologyClassificationItem *ontClassItem = workOntItemHash.value(workItem); if (ontClassItem) { QHash *workHash = ontClassItem->getWorkItemHash(); CTaxonomy *taxonomy = ontClassItem->getTaxonomy(); if (workItem) { ontClassItem->decCurrentCalculatingCount(); if (workItem->isTestValid()) { if (testResult->hasCalculationError()) { LOG(ERROR,getLogDomain(),logTr("Error in computation, classification for ontology '%1' failed.").arg(ontClassItem->getOntology()->getTerminologyName()),getLogObject()); ontClassItem->setTaxonomyConstructionFailed(); } else { if (workItem->isConceptSatisfiableTest()) { interpreteSatisfiableResult(ontClassItem,workItem->getSatisfiableTestedConcept(),testSat); } else if (workItem->isConceptSubsumptionTest()) { interpreteSubsumptionResult(ontClassItem,workItem->getSubsumedTestedConcept(),workItem->getSubsumerTestedConcept(),!testSat); } } } QHash::iterator itWorkItem = workHash->find(satCalcJob); while (itWorkItem != workHash->end()) { if (itWorkItem.value() == workItem) { workHash->erase(itWorkItem); break; } ++itWorkItem; } delete workItem; delete satCalcJob; } workOntItemHash.remove(workItem); CClassificationCalculationStatisticsCollection* statisticCollection = testResult->getUsedStatisticsCollection(); if (statisticCollection) { ontClassItem->reuseCalculationStatisticsCollection(statisticCollection); } } return true; } bool COptimizedKPSetRoleSubsumptionClassifierThread::finishOntologyClassification(COntologyClassificationItem *ontClassItem) { if (!ontClassItem->isTaxonomyConstructed() && !ontClassItem->isTaxonomyConstructionFailed()) { CTaxonomy *taxonomy = ontClassItem->getTaxonomy(); CConcreteOntology *ontology = ontClassItem->getOntology(); LOG(INFO,getLogDomain(),logTr("Starting Transitive Reduction for Ontology '%1'.").arg(ontology->getTerminologyName()),getLogObject()); // build taxonomy COptimizedKPSetRoleOntologyClassificationItem *optKPSetClassificationItem = (COptimizedKPSetRoleOntologyClassificationItem *)ontClassItem; QList* satItemList = optKPSetClassificationItem->getSatisfiableConceptItemList(); CTaxonomy *tax = optKPSetClassificationItem->getTaxonomy(); QList itemList; COptimizedKPSetRoleTestingItem* topItem = optKPSetClassificationItem->getTopConceptSatisfiableTestItem(); CHierarchyNode* topHierNode = tax->getTopHierarchyNode(); CHierarchyNode* bottomHierNode = tax->getBottomHierarchyNode(); cint64 topSubsumingItemCount = topItem->getSubsumingConceptItemCount(); topItem->setSatisfiableConceptHierarchyNode(topHierNode); if (topSubsumingItemCount) { QList* subsumingConceptItemList = topItem->sortSubsumingConceptItemList(); for (QList::const_iterator subsumedIt = subsumingConceptItemList->constBegin(), subsumedItEnd = subsumingConceptItemList->constEnd(); subsumedIt != subsumedItEnd; ++subsumedIt) { COptimizedKPSetRoleTestingItem* subsumedConceptItem = *subsumedIt; // mark as equivalent subsumedConceptItem->setEquivalentItem(true); topHierNode->addEquivalentConcept(subsumedConceptItem->getTestingConcept()); tax->updateNodeEquivalences(topHierNode); } } LOG(INFO,getLogDomain(),logTr("Sorting classes for Ontology '%1'.").arg(ontology->getTerminologyName()),getLogObject()); for (QList::const_iterator it = satItemList->constBegin(), itEnd = satItemList->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleTestingItem* item = *it; if (!item->isEquivalentItem() && item != topItem) { CHierarchyNode* itemNode = tax->getHierarchyNode(item->getTestingConcept(),true); item->setSatisfiableConceptHierarchyNode(itemNode); cint64 itemSubsumingCount = item->getSubsumingConceptItemCount(); itemList.append(item); if (itemSubsumingCount > topSubsumingItemCount) { QList* subsumingConceptItemList = item->sortSubsumingConceptItemList(); for (QList::const_iterator subsumedIt = subsumingConceptItemList->constBegin(), subsumedItEnd = subsumingConceptItemList->constEnd(); subsumedIt != subsumedItEnd; ++subsumedIt) { COptimizedKPSetRoleTestingItem* subsumedConceptItem = *subsumedIt; cint64 subsumedItemSubsumingCount = subsumedConceptItem->getSubsumingConceptItemCount(); if (subsumedItemSubsumingCount == itemSubsumingCount) { // mark as equivalent subsumedConceptItem->setEquivalentItem(true); itemNode->addEquivalentConcept(subsumedConceptItem->getTestingConcept()); tax->updateNodeEquivalences(itemNode); } else { break; } } } } } LOG(INFO,getLogDomain(),logTr("Transitive Reduction for Ontology '%1'.").arg(ontology->getTerminologyName()),getLogObject()); for (QList::const_iterator it = itemList.constBegin(), itEnd = itemList.constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleTestingItem* item = *it; if (!item->isEquivalentItem() && item != topItem) { cint64 itemSubsumingCount = item->getSubsumingConceptItemCount(); CHierarchyNode* itemHierNode = item->getSatisfiableConceptHierarchyNode(); QList* subsumingConceptItemList = item->getSubsumingConceptItemList(); QList::const_iterator subsumedIt = subsumingConceptItemList->constBegin(), subsumedItEnd = subsumingConceptItemList->constEnd(); cint64 eqCount = 0; cint64 remainingSubsumingCount = itemSubsumingCount; // remove direct equivalences while (subsumedIt != subsumedItEnd) { COptimizedKPSetRoleTestingItem* subsumedConceptItem = *subsumedIt; cint64 subsumedItemSubsumingCount = subsumedConceptItem->getSubsumingConceptItemCount(); if (itemSubsumingCount != subsumedItemSubsumingCount) { break; } else { ++eqCount; ++subsumedIt; --remainingSubsumingCount; } } while (subsumedIt != subsumedItEnd && (*subsumedIt)->isEquivalentItem()) { ++subsumedIt; } // find first parent if (subsumedIt == subsumedItEnd) { // no parent, use top as parent itemHierNode->makeParent(topHierNode); } else { itemHierNode->addPredecessorNode(topHierNode); QList parentItemList; while (subsumedIt != subsumedItEnd) { COptimizedKPSetRoleTestingItem* subsumedConceptItem = *subsumedIt; if (!subsumedConceptItem->isEquivalentItem()) { subsumedConceptItem->setPredecessorItem(true); CHierarchyNode* subsumedHierNode = subsumedConceptItem->getSatisfiableConceptHierarchyNode(); itemHierNode->makeParent(subsumedHierNode); parentItemList.append(subsumedConceptItem); remainingSubsumingCount -= subsumedConceptItem->getSubsumingConceptItemCount()+1; ++subsumedIt; break; } else { ++subsumedIt; } } bool searchForMoreParents = remainingSubsumingCount > 0; while (subsumedIt != subsumedItEnd) { COptimizedKPSetRoleTestingItem* subsumedConceptItem = *subsumedIt; if (!subsumedConceptItem->isEquivalentItem()) { bool predOfOnePrevParent = false; if (searchForMoreParents) { for (QList::const_iterator parentIt = parentItemList.constBegin(), parentItEnd = parentItemList.constEnd(); parentIt != parentItEnd && !predOfOnePrevParent; ++parentIt) { COptimizedKPSetRoleTestingItem* parentItem = *parentIt; if (parentItem->getSubsumingConceptItemSet()->contains(subsumedConceptItem)) { predOfOnePrevParent = true; } } } subsumedConceptItem->setPredecessorItem(true); CHierarchyNode* subsumedHierNode = subsumedConceptItem->getSatisfiableConceptHierarchyNode(); if (!predOfOnePrevParent && searchForMoreParents) { itemHierNode->makeParent(subsumedHierNode); parentItemList.append(subsumedConceptItem); } else { itemHierNode->addPredecessorNode(subsumedHierNode); } } ++subsumedIt; } } } } for (QList::const_iterator it = itemList.constBegin(), itEnd = itemList.constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleTestingItem* item = *it; if (!item->isPredecessorItem() && !item->isEquivalentItem()) { CHierarchyNode* itemHierNode = item->getSatisfiableConceptHierarchyNode(); bottomHierNode->makeParent(itemHierNode); } } LOG(INFO,getLogDomain(),logTr("Collect statistics for Ontology '%1'.").arg(ontology->getTerminologyName()),getLogObject()); #ifdef OPTIMIZEDKPSETCLASSCLASSIFIERDEBUGSTATUSDESCRIPTION statUpdateMutex.lock(); statusString = QString("Finished ontology classification"); statUpdateMutex.unlock(); #endif CClassification* classification = ontology->getClassification(); if (classification) { CClassConceptClassification* classConClassification = ontClassItem->getClassConceptClassification(); CClassificationStatisticsCollectionStrings* classifStatCollStrings = ontClassItem->getClassificationStatisticsCollectionStrings(); CClassifierStatistics* classifierStats = ontClassItem->getClassifierStatistics(); classifStatCollStrings->addProcessingStatistics("role-classification-total-satisfiable-test-count",classifierStats->getTotalSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("role-classification-satisfiable-tested-count",classifierStats->getTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("role-classification-satisfiable-pseudo-model-merged-tested-count",classifierStats->getPseudoModelMergedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("role-classification-satisfiable-derivate-tested-count",classifierStats->getDerivatedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("role-classification-satisfiable-calculated-tested-count",classifierStats->getCalculatedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("role-classification-satisfiable-pruned-tested-count",classifierStats->getPrunedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("role-classification-satisfiable-told-tested-count",classifierStats->getToldSatisfiableCount()-classifierStats->getCalculatedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("role-classification-total-subsumption-test-count",classifierStats->getTotalSatisfiableCount()*(classifierStats->getTotalSatisfiableCount()-1)); classifStatCollStrings->addProcessingStatistics("role-classification-subsumption-tested-count",classifierStats->getTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("role-classification-subsumption-pseudo-model-merged-tested-count",classifierStats->getPseudoModelMergedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("role-classification-subsumption-subclass-tested-count",classifierStats->getSubclassTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("role-classification-subsumption-subclass-identifier-occur-tested-count",classifierStats->getSubclassIdentifierOccurTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("role-classification-subsumption-derivate-tested-count",classifierStats->getDerivatedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("role-classification-subsumption-calculated-tested-count",classifierStats->getCalculatedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("role-classification-subsumption-pruned-tested-count",classifierStats->getPrunedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("role-classification-subsumption-told-tested-count",classifierStats->getToldSubsumptionCount()-classifierStats->getCalculatedTestedSubsumptionCount()); classConClassification->setClassConceptTaxonomy(taxonomy); classConClassification->setClassificationStatistics(classifStatCollStrings); classification->setClassConceptClassification(classConClassification); } ontology->setConceptTaxonomy(taxonomy); ontClassItem->setGoneOutRemainingTests(false); taxonomy->setTaxonomyComplete(true); --mClassificationCount; LOG(INFO,getLogDomain(),logTr("Ontology '%1' classified.").arg(ontology->getTerminologyName()),getLogObject()); LOG(INFO,getLogDomain(),logTr("Used %1 satisfiable tests and %3 calculated subsumption tests.").arg(ontClassItem->getCalcedSatisfiableCount()).arg(ontClassItem->getClassifierStatistics()->getCalculatedTestedSubsumptionCount()),getLogObject()); LOG(INFO,getLogDomain(),logTr("Confirmed %1 of %2 possible subsumer concepts.").arg(optKPSetClassificationItem->getTruePossibleSubsumerCount()).arg(optKPSetClassificationItem->getPossibleSubsumerCount()),getLogObject()); LOG(INFO,getLogDomain(),logTr("Confirmed %1 and invalidated %2 possible subsumer concepts with calculation.").arg(optKPSetClassificationItem->getCalculatedTruePossibleSubsumerCount()).arg(optKPSetClassificationItem->getFalsePossibleSubsumerCount()),getLogObject()); } ontClassItem->submitTaxonomyConstructed(); ontClassItem->doClassifiedCallback(); return true; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelData.h0000644000175000017500000000527612520550744031272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELDATA_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELDATA_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationClassPseudoModelRoleMap.h" #include "CClassificationClassPseudoModelConceptMap.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Classifier { /*! * * \class CClassificationClassPseudoModelData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationClassPseudoModelData { // public methods public: //! Constructor CClassificationClassPseudoModelData(CContext* context); CClassificationClassPseudoModelData* initPseudoModelData(CClassificationClassPseudoModelData* data); CClassificationClassPseudoModelConceptMap* getPseudoModelConceptMap(bool create); CClassificationClassPseudoModelRoleMap* getPseudoModelRoleMap(bool create); bool hasValidRoleMap(); bool hasValidConceptMap(); CClassificationClassPseudoModelData* setValidRoleMap(bool valid); CClassificationClassPseudoModelData* setValidConceptMap(bool valid); // protected methods protected: // protected variables protected: CContext* mContext; CClassificationClassPseudoModelConceptMap* mLocConceptMap; CClassificationClassPseudoModelConceptMap* mUseConceptMap; CClassificationClassPseudoModelRoleMap* mLocRoleMap; CClassificationClassPseudoModelRoleMap* mUseRoleMap; bool mValidRoleMap; bool mValidConceptMap; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODELDATA_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedSubClassSubsumptionClassifierThread.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedSubClassSubsumptionClassifierThr0000644000175000017500000016210312574305416032524 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedSubClassSubsumptionClassifierThread.h" namespace Konclude { namespace Reasoner { namespace Classifier { #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGCOUTOUTPUT #define OPTIMIZEDSUBCLASSCLASSIFIERDEBUGB #endif #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGCOUTOUTPUT #define OPTIMIZEDSUBCLASSCLASSIFIERDEBUGB #endif #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGBOXDESCRIPTION #define OPTIMIZEDSUBCLASSCLASSIFIERDEBUGB #endif #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGSTATUSDESCRIPTION #define OPTIMIZEDSUBCLASSCLASSIFIERDEBUGB #endif COptimizedSubClassSubsumptionClassifierThread::COptimizedSubClassSubsumptionClassifierThread(CReasonerManager *reasonerManager) : CSubsumptionClassifierThread(reasonerManager), CLogIdentifier("::Konclude::Reasoner::Kernel::Classifier::OptimizedSubClassSubsumptionClassifierThread",this) { satTestedCount = 0; totalToTestCount = 0; mClassificationCount = 0; mSatNodeExpCacheReader = nullptr; mSatNodeExpCache = dynamic_cast(reasonerManager->getSaturationAssociationExpansionCache()); if (mSatNodeExpCache) { mSatNodeExpCacheReader = mSatNodeExpCache->createCacheReader(); } mStatFastSubClassCheckCacheTryCount = 0; mStatFastSubClassCheckCacheSuccCount = 0; } COptimizedSubClassSubsumptionClassifierThread::~COptimizedSubClassSubsumptionClassifierThread() { } CTaxonomy *COptimizedSubClassSubsumptionClassifierThread::createEmptyTaxonomyForOntology(CConcreteOntology *ontology, CConfigurationBase *config) { CTBox *tBox = ontology->getTBox(); CConceptVector *conVec = tBox->getConceptVector(); CConcept *topConcept = conVec->getData(1); CConcept *bottomConcept = conVec->getData(0); CPartialPruningTaxonomy *tax = new CPartialPruningTaxonomy(topConcept,bottomConcept); return tax->readConfig(config); } void COptimizedSubClassSubsumptionClassifierThread::readCalculationConfig(CCalculationConfigurationExtension *config) { if (config) { bool configErrorFlag = false; cint64 processorCount = 1; QString processorCountString = CConfigDataReader::readConfigString(config,"Konclude.Calculation.ProcessorCount",QString(),&configErrorFlag); if (!configErrorFlag) { if (processorCountString == "AUTO") { processorCount = CThread::idealThreadCount(); } else { qint64 convertedWorkerCount = processorCountString.toInt(&configErrorFlag); if (configErrorFlag) { processorCount = convertedWorkerCount; } } } bool mulConfigErrorFlag = false; cint64 multiplicator = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Classification.OptimizedSubClassSubsumptionClassifier.MultipliedUnitsParallelSatisfiableCalculationCount",1,&mulConfigErrorFlag); confMaxTestParallelCount = processorCount*multiplicator; bool maxConfigErrorFlag = false; cint64 maxParallel = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Classification.OptimizedSubClassSubsumptionClassifier.MaximumParallelSatisfiableCalculationCount",1,&maxConfigErrorFlag); if (!maxConfigErrorFlag) { if (!mulConfigErrorFlag) { confMaxTestParallelCount = qMin(confMaxTestParallelCount,maxParallel); } else { confMaxTestParallelCount = maxParallel; } } } else { confMaxTestParallelCount = 1; } } CSubsumptionClassifierThread *COptimizedSubClassSubsumptionClassifierThread::scheduleOntologyClassification(CConcreteOntology *ontology, CTaxonomy *taxonomy, CClassificationCalculationSupport *classificationSupport, CConfigurationBase *config) { COptimizedSubClassOntologyClassificationItem *ontClassItem = new COptimizedSubClassOntologyClassificationItem(config,statistics); ontClassItem->initTaxonomyConcepts(ontology,taxonomy); ontItemList.append(ontClassItem); processingOntItemList.append(ontClassItem); ontItemHash.insert(ontology,ontClassItem); readCalculationConfig(ontClassItem->getCalculationConfiguration()); if (CConfigDataReader::readConfigBoolean(ontClassItem->getCalculationConfiguration(),"Konclude.Calculation.Classification.IndividualDependenceTracking",true)) { ontClassItem->setIndividualDependenceTrackingCollector(new CIndividualDependenceTrackingCollector()); } CPartialPruningTaxonomy *parTax = dynamic_cast(taxonomy); if (parTax) { COntologyClassificationItem *ontClassItem = ontItemHash.value(ontology); parTax->createStatistics(ontClassItem->getClassifierStatistics()); } createObviousSubsumptionSatisfiableTestingOrder(ontClassItem); if (satTestedCount == totalToTestCount) { satTestedCount = 0; totalToTestCount = ontClassItem->getRemainingSatisfiableTestsCount(); classStartTime.start(); } else { totalToTestCount += ontClassItem->getRemainingSatisfiableTestsCount(); } ++mClassificationCount; return this; } void COptimizedSubClassSubsumptionClassifierThread::createObviousSubsumptionSatisfiableTestingOrder(COptimizedSubClassOntologyClassificationItem* ontClassItem) { CPrecomputation* precomputation = ontClassItem->getOntology()->getPrecomputation(); CSaturationData* saturationData = precomputation->getSaturationModelData(); bool subsumerSaturationExtraction = CConfigDataReader::readConfigBoolean(ontClassItem->getCalculationConfiguration(),"Konclude.Calculation.Classification.SaturationSubsumerExtraction",true); if (saturationData && subsumerSaturationExtraction) { createObviousSubsumptionSatisfiableTestingOrderFromSaturationData(ontClassItem); } else { createObviousSubsumptionSatisfiableTestingOrderFromBuildData(ontClassItem); } } void COptimizedSubClassSubsumptionClassifierThread::createObviousSubsumptionSatisfiableTestingOrderFromSaturationData(COptimizedSubClassOntologyClassificationItem* ontClassItem) { CTBox *tBox = ontClassItem->getOntology()->getDataBoxes()->getTBox(); CBOXHASH* candidateEqConHash = tBox->getCandidateEquivalentConceptHash(false); CBOXHASH* eqConCandidateHash = tBox->getEquivalentConceptCandidateHash(false); CBOXSET* eqConNonCandidateSet = tBox->getEquivalentConceptNonCandidateSet(false); CConcreteOntology *onto = ontClassItem->getOntology(); CConcept *topConcept = onto->getDataBoxes()->getTopConcept(); CConcept *bottomConcept = onto->getDataBoxes()->getBottomConcept(); QHash* conceptSatItemHash = ontClassItem->getConceptSatisfiableTestItemHash(); QList* satTestItemContainer = ontClassItem->getConceptSatisfiableTestItemContainer(); COptimizedSubClassSatisfiableTestingItem* topItem = ontClassItem->getConceptSatisfiableTestItem(topConcept,true); COptimizedSubClassSatisfiableTestingItem* bottomItem = ontClassItem->getConceptSatisfiableTestItem(bottomConcept,true); ontClassItem->initTopBottomSatisfiableTestingItems(topItem,bottomItem); QList* nextItemList = ontClassItem->getNextSatisfiableTestingItemList(); QSet* nextCandItemSet = ontClassItem->getNextCandidateSatisfiableTestingItemSet(); QSet* remainingCandItemSet = ontClassItem->getRemainingCandidateSatisfiableTestingItemSet(); if (topConcept->getOperandList()) { // has not absorbed GCIs nextItemList->append(topItem); } bool invalidatedConRefLinking = false; QHash* conRefLinkDataHash = ontClassItem->getConceptReferenceLinkingDataHash(); QList extClassConceptList; CPrecomputedSaturationSubsumerExtractor* precSatSubsumerExtractor = ontClassItem->getPrecomputedSaturationSubsumerExtractor(true); CBOXSET *conceptHash = tBox->getActiveClassConceptSet(false); if (conceptHash) { for (CBOXSET::const_iterator it = conceptHash->constBegin(), itEnd = conceptHash->constEnd(); it != itEnd; ++it) { CConcept *concept = (*it); if (concept && concept != topConcept && concept != bottomConcept || (concept == topConcept && topConcept->getOperandList())) { COptimizedSubClassSatisfiableTestingItem* subsumerItem = ontClassItem->getConceptSatisfiableTestItem(concept,true); CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); CConceptSaturationReferenceLinkingData* conRefSatLinking = (CConceptSaturationReferenceLinkingData*)conProcData->getConceptReferenceLinking(); if (!conRefSatLinking) { conRefSatLinking = new CConceptSaturationReferenceLinkingData(); conProcData->setConceptReferenceLinking(conRefSatLinking); } conRefLinkDataHash->insert(concept,subsumerItem); if (conRefSatLinking->getClassifierReferenceLinkingData() || invalidatedConRefLinking) { conProcData->setInvalidatedReferenceLinking(true); } else { conRefSatLinking->setClassifierReferenceLinkingData(subsumerItem); } extClassConceptList.append(concept); } } } for (QList::const_iterator it = extClassConceptList.constBegin(), itEnd = extClassConceptList.constEnd(); it != itEnd; ++it) { CConcept* concept(*it); CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); CConceptSaturationReferenceLinkingData* conRefSatLinking = (CConceptSaturationReferenceLinkingData*)conProcData->getConceptReferenceLinking(); COptimizedSubClassSatisfiableTestingItem* classItem = (COptimizedSubClassSatisfiableTestingItem*)conRefSatLinking->getClassifierReferenceLinkingData(); bool unsatisfiableFlag = false; bool insufficientFlag = false; bool incompleteProcessingFlag = false; if (precSatSubsumerExtractor->getConceptFlags(concept,&unsatisfiableFlag,&insufficientFlag,&incompleteProcessingFlag)) { if (!unsatisfiableFlag) { bool possibleSubsumerFlag = false; precSatSubsumerExtractor->extractSubsumers(concept,classItem,&possibleSubsumerFlag,ontClassItem->getIndividualDependenceTrackingCollector(),classItem); cint64 foundSubsumerCount = classItem->getSubsumingConceptItemCount(); classItem->setUnprocessedPredecessorItems(foundSubsumerCount); if (!insufficientFlag) { classItem->setResultSatisfiableDerivated(true); } ontClassItem->incRemainingSatisfiableTestsCount(); remainingCandItemSet->insert(classItem); if (foundSubsumerCount <= 0) { nextItemList->append(classItem); } } else { ontClassItem->incRemainingSatisfiableTestsCount(); classItem->setResultUnsatisfiableDerivated(true); nextItemList->append(classItem); } } } } void COptimizedSubClassSubsumptionClassifierThread::createObviousSubsumptionSatisfiableTestingOrderFromBuildData(COptimizedSubClassOntologyClassificationItem* ontClassItem) { CTBox *tBox = ontClassItem->getOntology()->getDataBoxes()->getTBox(); CBOXHASH* candidateEqConHash = tBox->getCandidateEquivalentConceptHash(false); CBOXHASH* eqConCandidateHash = tBox->getEquivalentConceptCandidateHash(false); CBOXSET* eqConNonCandidateSet = tBox->getEquivalentConceptNonCandidateSet(false); CConcreteOntology *onto = ontClassItem->getOntology(); CConcept *topConcept = onto->getDataBoxes()->getTopConcept(); CConcept *bottomConcept = onto->getDataBoxes()->getBottomConcept(); QHash* conceptSatItemHash = ontClassItem->getConceptSatisfiableTestItemHash(); QList* satTestItemContainer = ontClassItem->getConceptSatisfiableTestItemContainer(); COptimizedSubClassSatisfiableTestingItem* topItem = ontClassItem->getConceptSatisfiableTestItem(topConcept,true); COptimizedSubClassSatisfiableTestingItem* bottomItem = ontClassItem->getConceptSatisfiableTestItem(bottomConcept,true); ontClassItem->initTopBottomSatisfiableTestingItems(topItem,bottomItem); QList* nextItemList = ontClassItem->getNextSatisfiableTestingItemList(); QSet* nextCandItemSet = ontClassItem->getNextCandidateSatisfiableTestingItemSet(); QSet* remainingCandItemSet = ontClassItem->getRemainingCandidateSatisfiableTestingItemSet(); if (topConcept->getOperandList()) { // has not absorbed GCIs nextItemList->append(topItem); } bool invalidatedConRefLinking = false; QHash* conRefLinkDataHash = ontClassItem->getConceptReferenceLinkingDataHash(); CBOXSET *conceptHash = tBox->getActiveClassConceptSet(false); if (conceptHash) { for (CBOXSET::const_iterator it = conceptHash->constBegin(), itEnd = conceptHash->constEnd(); it != itEnd; ++it) { CConcept *concept = (*it); if (concept && concept != topConcept && concept != bottomConcept || (concept == topConcept && topConcept->getOperandList())) { QSet > conSet; QList > conList; QSet conSubsumSet; conList.append(QPair(concept,false)); conSet.insert(QPair(concept,false)); while (!conList.isEmpty()) { QPair conNegPair = conList.takeFirst(); CConcept *con = conNegPair.first; bool neg = conNegPair.second; qint64 conOpCode = con->getProcessingOperatorTag(); cint64 opCount = con->getOperandCount(); cint64 param = con->getParameter(); if (conOpCode == CCAND && (!neg || neg && opCount <= 1) || conOpCode == CCOR && (neg || !neg && opCount <= 1)) { CSortedNegLinker *opConIt = con->getOperandList(); while (opConIt) { CConcept *opCon = opConIt->getData(); bool opNeg = opConIt->isNegated(); QPair opConNegPair(opCon,neg ^ opNeg); if (opCon->hasClassName()) { if (neg ^ opNeg) { if (!conSet.contains(opConNegPair)) { conSet.insert(opConNegPair); conList.append(opConNegPair); } } else { conSubsumSet.insert(opCon); } } else { if (!conSet.contains(opConNegPair)) { conSet.insert(opConNegPair); conList.append(opConNegPair); } } opConIt = opConIt->getNext(); } } else if (!neg && (conOpCode == CCSOME || conOpCode == CCATLEAST && param >= 1) || neg && (conOpCode == CCALL || conOpCode == CCATMOST && param >= 2)) { CRole* role = con->getRole(); CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { CRole* superRole = superRoleIt->getData(); bool superRoleNeg = superRoleIt->isNegated(); CSortedNegLinker* domainConIt = superRole->getDomainRangeConceptList(superRoleNeg); while (domainConIt) { CConcept *domCon = domainConIt->getData(); bool opDomNeg = domainConIt->isNegated(); QPair domConNegPair(domCon,neg ^ opDomNeg); if (domCon->hasClassName()) { if (neg ^ opDomNeg) { if (!conSet.contains(domConNegPair)) { conSet.insert(domConNegPair); conList.append(domConNegPair); } } else { conSubsumSet.insert(domCon); } } else { if (!conSet.contains(domConNegPair)) { conSet.insert(domConNegPair); conList.append(domConNegPair); } } domainConIt = domainConIt->getNext(); } superRoleIt = superRoleIt->getNext(); } } else if (!neg && (conOpCode == CCNOMINAL)) { CIndividual* individual = con->getNominalIndividual(); CConceptAssertionLinker* assConLinkIt = individual->getAssertionConceptLinker(); while (assConLinkIt) { CConcept* assCon = assConLinkIt->getData(); bool assConNeg = assConLinkIt->isNegated(); QPair assConNegPair(assCon,neg ^ assConNeg); if (assCon->hasClassName()) { if (neg ^ assConNeg) { if (!conSet.contains(assConNegPair)) { conSet.insert(assConNegPair); conList.append(assConNegPair); } } else { conSubsumSet.insert(assCon); } } else { if (!conSet.contains(assConNegPair)) { conSet.insert(assConNegPair); conList.append(assConNegPair); } } assConLinkIt = assConLinkIt->getNext(); } } } //QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); //if (iriClassNameString == "http://www.owllink.org/testsuite/galen#Haem") { // bool bug = true; //} COptimizedSubClassSatisfiableTestingItem* subsumerItem = ontClassItem->getConceptSatisfiableTestItem(concept,true); CConceptProcessData* conProcData = (CConceptProcessData*)concept->getConceptData(); CConceptSaturationReferenceLinkingData* conRefSatLinking = (CConceptSaturationReferenceLinkingData*)conProcData->getConceptReferenceLinking(); if (!conRefSatLinking) { conRefSatLinking = new CConceptSaturationReferenceLinkingData(); conProcData->setConceptReferenceLinking(conRefSatLinking); } conRefLinkDataHash->insert(concept,subsumerItem); if (conRefSatLinking->getClassifierReferenceLinkingData() || invalidatedConRefLinking) { conProcData->setInvalidatedReferenceLinking(true); } else { conRefSatLinking->setClassifierReferenceLinkingData(subsumerItem); } bool foundSubsumingConcepts = false; for (QSet::const_iterator it = conSubsumSet.constBegin(), itEnd = conSubsumSet.constEnd(); it != itEnd; ++it) { CConcept* subsumedConcept = *it; COptimizedSubClassSatisfiableTestingItem* subsumedItem = ontClassItem->getConceptSatisfiableTestItem(subsumedConcept,true); subsumedItem->addSuccessorSatisfiableTestItem(subsumerItem); subsumerItem->incUnprocessedPredecessorItems(); foundSubsumingConcepts = true; } ontClassItem->incRemainingSatisfiableTestsCount(); remainingCandItemSet->insert(subsumerItem); if (!foundSubsumingConcepts) { nextItemList->append(subsumerItem); } } } } } QString COptimizedSubClassSubsumptionClassifierThread::getStatusString() { statUpdateMutex.lock(); QString string = statusString; string.detach(); statUpdateMutex.unlock(); return string; } CClassificationProgress* COptimizedSubClassSubsumptionClassifierThread::getClassificationProgress() { if (satTestedCount != totalToTestCount) { cint64 testedClasses = satTestedCount; cint64 totalClasses = totalToTestCount; cint64 elapsedTime = classStartTime.elapsed(); double remainingMilliSeconds = 0.; double progessPercent = 0.; if (elapsedTime <= 0 && testedClasses > 0) { remainingMilliSeconds = 0.; } else { remainingMilliSeconds = ((double)elapsedTime / (double)satTestedCount) * (totalToTestCount-testedClasses); } if (totalClasses <= 0) { progessPercent = 0.; } else { progessPercent = ((double)testedClasses / (double)totalClasses) * 100.; } cint64 classificCount = mClassificationCount; mClassifyProgess.setClassificationCount(classificCount); mClassifyProgess.setProgessPercent(progessPercent); mClassifyProgess.setRemainingMilliSeconds(remainingMilliSeconds); mClassifyProgess.setTestedClasses(testedClasses); mClassifyProgess.setTotalClasses(totalClasses); } else { mClassifyProgess.setProgessPercent(0.); mClassifyProgess.setRemainingMilliSeconds(0.); mClassifyProgess.setTestedClasses(satTestedCount); mClassifyProgess.setTotalClasses(totalToTestCount); } return &mClassifyProgess; } bool COptimizedSubClassSubsumptionClassifierThread::createNextSubsumtionTest() { COntologyClassificationItem *loopOntClassItem = 0; bool workTestCreated = false; while (!workTestCreated && !processingOntItemList.isEmpty()) { COntologyClassificationItem *ontClassItem = processingOntItemList.first(); if (ontClassItem == loopOntClassItem) { // don't run into infinite loop without doing something break; } COptimizedSubClassOntologyClassificationItem *optSubClassItem = (COptimizedSubClassOntologyClassificationItem *)ontClassItem; while (!workTestCreated && optSubClassItem->hasRemainingSatisfiableTests() && !ontClassItem->isTaxonomyConstructionFailed()) { // get next satisfiable test QList* nextItemList = optSubClassItem->getNextSatisfiableTestingItemList(); QSet* nextCandItemSet = optSubClassItem->getNextCandidateSatisfiableTestingItemSet(); QSet* remainingCandItemSet = optSubClassItem->getRemainingCandidateSatisfiableTestingItemSet(); COptimizedSubClassSatisfiableTestingItem* nextSatTestItem = nullptr; if (!nextItemList->isEmpty()) { nextSatTestItem = nextItemList->takeFirst(); remainingCandItemSet->remove(nextSatTestItem); nextCandItemSet->remove(nextSatTestItem); } else if (!nextCandItemSet->isEmpty()) { COptimizedSubClassSatisfiableTestingItem* minItem = nullptr; cint64 minUnpPredCount = 0; cint64 maxItCount = 100; for (QSet::const_iterator it = nextCandItemSet->constBegin(), itEnd = nextCandItemSet->constEnd(); it != itEnd && maxItCount > 0; ++it, --maxItCount) { COptimizedSubClassSatisfiableTestingItem* item = (*it); cint64 predCount = item->getUnprocessedPredecessorItemCount(); if (!minItem || minUnpPredCount < predCount) { minUnpPredCount = predCount; minItem = item; } } nextSatTestItem = minItem; remainingCandItemSet->remove(nextSatTestItem); nextCandItemSet->remove(nextSatTestItem); } else if (!remainingCandItemSet->isEmpty()) { COptimizedSubClassSatisfiableTestingItem* minItem = nullptr; //cint64 minUnpPredCount = 0; //for (QSet::const_iterator it = remainingCandItemSet->constBegin(), itEnd = remainingCandItemSet->constEnd(); it != itEnd; ++it) { // COptimizedSubClassSatisfiableTestingItem* item = (*it); // cint64 predCount = item->getUnprocessedPredecessorItemCount(); // if (!minItem || minUnpPredCount < predCount) { // minUnpPredCount = predCount; // minItem = item; // } //} //nextSatTestItem = minItem; //remainingCandItemSet->remove(nextSatTestItem); QSet::const_iterator itNext = remainingCandItemSet->constBegin(); nextSatTestItem = *itNext; remainingCandItemSet->remove(nextSatTestItem); } if (nextSatTestItem && !nextSatTestItem->isSatisfiableTestOrdered()) { optSubClassItem->decRemainingSatisfiableTestsCount(); optSubClassItem->incRunningSatisfiableTestsCount(); if (calculateSatisfiable(optSubClassItem,nextSatTestItem)) { workTestCreated = true; } else { interpreteSatisfiableResult(optSubClassItem,nextSatTestItem->getSatisfiableConcept(),nextSatTestItem->getSatisfiableTestedResult()); } } } if (!workTestCreated) { if (optSubClassItem->hasAllSatisfiableTestsCompleted() || ontClassItem->isTaxonomyConstructionFailed()) { finishOntologyClassification(ontClassItem); processingOntItemList.removeFirst(); } else { processingOntItemList.removeFirst(); processingOntItemList.append(ontClassItem); loopOntClassItem = ontClassItem; } } } return workTestCreated; } bool COptimizedSubClassSubsumptionClassifierThread::calculateSatisfiable(COptimizedSubClassOntologyClassificationItem *optSubClassItem, COptimizedSubClassSatisfiableTestingItem* nextSatTestItem) { CSatisfiableCalculationJob* satCalcJob = nullptr; CClassificationWorkItem *workItem = 0; CConcept* concept = nextSatTestItem->getSatisfiableConcept(); nextSatTestItem->setSatisfiableTestOrdered(true); bool satisfiableFlag = false; #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGB QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); #endif #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGSTATUSDESCRIPTION statUpdateMutex.lock(); statusString = QString("[%2/%3] Calculating, is '%1' satisfiable").arg(iriClassNameString).arg(optSubClassItem->getClassifierStatistics()->getTestedSatisfiableCount()).arg(optSubClassItem->getClassifierStatistics()->getTotalSatisfiableCount()); statUpdateMutex.unlock(); #endif #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGLOGOUTPUT LOG(INFO,getLogDomain(),QString("Calculating whether '%1' is satisfiable").arg(iriClassNameString),this); #endif #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGCOUTOUTPUT cout<isResultSatisfiableDerivated()) { satisfiableFlag = true; nextSatTestItem->setSatisfiableTested(true); nextSatTestItem->setSatisfiableTestedResult(true); return false; } if (nextSatTestItem->isResultUnsatisfiableDerivated()) { satisfiableFlag = false; nextSatTestItem->setSatisfiableTested(true); nextSatTestItem->setSatisfiableTestedResult(false); return false; } CPrecomputedSaturationSubsumerExtractor* precSatSubsumerExtractor = optSubClassItem->getPrecomputedSaturationSubsumerExtractor(false); bool unsatisfiableFlag = false; if (precSatSubsumerExtractor && precSatSubsumerExtractor->getConceptFlags(concept,&unsatisfiableFlag,nullptr,nullptr) && unsatisfiableFlag) { satisfiableFlag = false; nextSatTestItem->setSatisfiableTested(true); nextSatTestItem->setSatisfiableTestedResult(false); return false; } if (fastSatisfiableOnlySubClassPrecheckTest(optSubClassItem,nextSatTestItem,&satisfiableFlag)) { nextSatTestItem->setSatisfiableTested(true); nextSatTestItem->setSatisfiableTestedResult(satisfiableFlag); return false; } CSatisfiableCalculationJobGenerator satCalcJobGen(optSubClassItem->getOntology()); satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(concept); QHash *workHash = optSubClassItem->getWorkItemHash(); CClassifierStatistics *ontClassStat = optSubClassItem->getClassifierStatistics(); if (ontClassStat) { ontClassStat->incCalculatedTestedSatisfiableCount(1); } workItem = new CClassificationWorkItem(satCalcJob,concept); workHash->insertMulti(satCalcJob,workItem); workOntItemHash.insert(workItem,optSubClassItem); QHash* conRefLinkDataHash = optSubClassItem->getConceptReferenceLinkingDataHash(); satCalcJob->setSatisfiableClassificationMessageAdapter(new CSatisfiableTaskClassificationMessageAdapter(concept,optSubClassItem->getOntology(),this,nullptr, CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTSUBSUMERSROOTNODE | CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTOTHERNODESSINGLEDEPENDENCY | CSatisfiableTaskClassificationMessageAdapter::EFEXTRACTSUBSUMERSOTHERNODES)); if (optSubClassItem->getIndividualDependenceTrackingCollector()) { satCalcJob->setSatisfiableTaskIndividualDependenceTrackingAdapter(new CSatisfiableTaskIndividualDependenceTrackingAdapter(optSubClassItem->getIndividualDependenceTrackingCollector(),nextSatTestItem)); } optSubClassItem->incCurrentCalculatingCount(); processCalculationJob(satCalcJob,optSubClassItem,workItem); return true; } CIndividualSaturationProcessNode* COptimizedSubClassSubsumptionClassifierThread::getSaturationIndividualNodeForConcept(CConcept* concept, bool negated) { CIndividualSaturationProcessNode* node = nullptr; CConceptData* conceptData = concept->getConceptData(); if (conceptData) { CConceptProcessData* conProcData = (CConceptProcessData*)conceptData; CConceptReferenceLinking* conRefLinking = conProcData->getConceptReferenceLinking(); if (conRefLinking) { CConceptSaturationReferenceLinkingData* confSatRefLinkingData = (CConceptSaturationReferenceLinkingData*)conRefLinking; CSaturationConceptReferenceLinking* satCalcRefLinkData = confSatRefLinkingData->getConceptSaturationReferenceLinkingData(negated); if (satCalcRefLinkData) { node = (CIndividualSaturationProcessNode*)satCalcRefLinkData->getIndividualProcessNodeForConcept(); } } } return node; } bool COptimizedSubClassSubsumptionClassifierThread::hasCachedSaturationIndividualNodeAssociatedExpansionProplematicConcept(CCacheEntry* cacheEntry, CConcept* testingConcept) { if (!cacheEntry) { return true; } CSaturationNodeAssociatedExpansionCacheEntry* satNodeExpCacheEntry = (CSaturationNodeAssociatedExpansionCacheEntry*)cacheEntry; CSaturationNodeAssociatedDeterministicConceptExpansion* detExp = satNodeExpCacheEntry->getDeterministicConceptExpansion(); CSaturationNodeAssociatedNondeterministicConceptExpansion* ndetExpLinker = satNodeExpCacheEntry->getNondeterministicConceptExpansionLinker(); if (!detExp && !ndetExpLinker) { return true; } CCacheValue cacheValue(mSatNodeExpCacheReader->getCacheValue(testingConcept,true)); if (detExp) { CSaturationNodeAssociatedConceptLinker* cacheValueExpLinker = detExp->getConceptExpansionLinker(&cacheValue); if (cacheValueExpLinker) { return true; } } if (ndetExpLinker && (!detExp || detExp->requiresNonDeterministicExpansion())) { bool allNonDetExpansionsProblematic = true; for (CSaturationNodeAssociatedNondeterministicConceptExpansion* ndetExpLinkerIt = ndetExpLinker; allNonDetExpansionsProblematic && ndetExpLinkerIt; ndetExpLinkerIt = ndetExpLinkerIt->getNext()) { CSaturationNodeAssociatedConceptLinker* ndetCacheValueExpLinker = ndetExpLinkerIt->getConceptExpansionLinker(&cacheValue); if (!ndetCacheValueExpLinker) { allNonDetExpansionsProblematic = false; } } if (allNonDetExpansionsProblematic) { return true; } } return false; } CCacheEntry* COptimizedSubClassSubsumptionClassifierThread::getAssociatedSaturationCacheEntry(COptimizedSubClassSatisfiableTestingItem* classConItem) { CCacheEntry* cacheEntry = classConItem->getFastSatisfiabilityTestedSaturationCacheEntry(); if (!cacheEntry) { CConcept* concept = classConItem->getSatisfiableConcept(); CIndividualSaturationProcessNode* satNode = getSaturationIndividualNodeForConcept(concept,false); cacheEntry = mSatNodeExpCacheReader->getCacheEntry(satNode); classConItem->setFastSatisfiabilityTestedSaturationCacheEntry(cacheEntry); } return cacheEntry; } bool COptimizedSubClassSubsumptionClassifierThread::fastSatisfiableOnlySubClassPrecheckTest(COptimizedSubClassOntologyClassificationItem *optSubClassItem, COptimizedSubClassSatisfiableTestingItem* nextSatTestItem, bool* isSatisfiableFlag) { QHash* conceptSatItemHash = optSubClassItem->getConceptSatisfiableTestItemHash(); CBOXHASH* triggerImpHash = optSubClassItem->getOntology()->getTBox()->getTriggerImplicationHash(false); CConcept* concept = nextSatTestItem->getSatisfiableConcept(); //QString className = CIRIName::getRecentIRIName(concept->getClassNameLinker()); //if (className == "galen#Salmonella" || className == "http://www.owllink.org/testsuite/galen#SalmonellaGroupA") { // bool bug = true; //} bool satFlag = false; bool testComplete = false; if (concept->getOperatorCode() == CCSUB) { cint64 conCount = concept->getOperandCount(); if (conCount == 1) { CSortedNegLinker* opLinkerIt = concept->getOperandList(); CConcept* firstConcept = opLinkerIt->getData(); cint64 firstOpCode = firstConcept->getOperatorCode(); CConcept* subClassConcept = nullptr; if (!opLinkerIt->isNegated() && (firstOpCode == CCATOM || firstOpCode == CCSUB || firstOpCode == CCEQ)) { subClassConcept = firstConcept; } if ((!triggerImpHash || !triggerImpHash->contains(concept)) && subClassConcept) { COptimizedSubClassSatisfiableTestingItem* subClassConItem = conceptSatItemHash->value(subClassConcept); if (subClassConItem && subClassConItem->isSatisfiableTested()) { if (!triggerImpHash || !triggerImpHash->contains(subClassConcept)) { ++mStatFastSubClassCheckCacheTryCount; CCacheEntry* superCacheEntry = getAssociatedSaturationCacheEntry(subClassConItem); if (!hasCachedSaturationIndividualNodeAssociatedExpansionProplematicConcept(superCacheEntry,concept)) { nextSatTestItem->setFastSatisfiabilityTestedSaturationCacheEntry(superCacheEntry); nextSatTestItem->setSuccessfullyFastSatisfiabilityTested(true); ++mStatFastSubClassCheckCacheSuccCount; QList* subsumedSubsumingConList = subClassConItem->getSubsumingConceptItemList(); for (QList::const_iterator it = subsumedSubsumingConList->constBegin(), itEnd = subsumedSubsumingConList->constEnd(); it != itEnd; ++it) { COptimizedSubClassSatisfiableTestingItem* subsumedItem = (*it); if (subClassConItem != subsumedItem && subsumedItem != nextSatTestItem) { nextSatTestItem->addSubsumingConceptItem(subsumedItem); } } nextSatTestItem->addSubsumingConceptItem(subClassConItem); satFlag = subClassConItem->getSatisfiableTestedResult(); testComplete = true; } } } } } } else if (concept->getOperatorCode() == CCATOM) { COptimizedSubClassSatisfiableTestingItem* topClassConItem = optSubClassItem->getTopConceptSatisfiableTestItem(); if (topClassConItem) { CCacheEntry* topCacheEntry = getAssociatedSaturationCacheEntry(topClassConItem); ++mStatFastSubClassCheckCacheTryCount; if (!hasCachedSaturationIndividualNodeAssociatedExpansionProplematicConcept(topCacheEntry,concept)) { nextSatTestItem->setFastSatisfiabilityTestedSaturationCacheEntry(topCacheEntry); nextSatTestItem->setSuccessfullyFastSatisfiabilityTested(true); ++mStatFastSubClassCheckCacheSuccCount; satFlag = true; testComplete = true; } } } if (satFlag && isSatisfiableFlag) { *isSatisfiableFlag = true; } return testComplete; } CSubsumptionClassifierThread *COptimizedSubClassSubsumptionClassifierThread::processCalculationJob(CSatisfiableCalculationJob* job, COntologyClassificationItem *ontClassItem, CClassificationWorkItem* workItem) { CClassificationCalculationStatisticsCollection* statColl = nullptr; if (ontClassItem->isCollectProcessStatisticsActivated()) { statColl = ontClassItem->getCalculationStatisticsCollection(); } job->setCalclulationStatisticsCollector(statColl); CTestCalculatedCallbackEvent *testResultCallback = new CTestCalculatedCallbackEvent(this,job,workItem,statColl); job->setCalculationConfiguration(ontClassItem->getCalculationConfiguration()); CSubsumptionClassifierThread::processCalculationJob(job,ontClassItem,testResultCallback); return this; } bool COptimizedSubClassSubsumptionClassifierThread::processToldClassificationMessage(COntologyClassificationItem *ontClassItem, CClassificationMessageData* messageDataLinker, CMemoryPool* memoryPools) { COptimizedSubClassOntologyClassificationItem *optSubClassItem = (COptimizedSubClassOntologyClassificationItem *)ontClassItem; CClassificationMessageData* messageDataLinkerIt = messageDataLinker; while (messageDataLinkerIt) { CClassificationMessageData* messageData = messageDataLinkerIt; if (messageData->getClassificationMessageDataType() == CClassificationMessageData::TELLCLASSSUBSUMPTION) { CClassificationSubsumptionMessageData* subsumMessageData = (CClassificationSubsumptionMessageData*)messageData; CConcept* subsumedConcept = subsumMessageData->getSubsumedConcept(); CCLASSSUBSUMPTIONMESSAGELIST* subsumerList = subsumMessageData->getClassSubsumerList(); COptimizedSubClassSatisfiableTestingItem* subsumedItem = nullptr; subsumedItem = optSubClassItem->getConceptSatisfiableTestItem(subsumedConcept); //QString iriClassNameString = CIRIName::getRecentIRIName(subsumedItem->getSatisfiableConcept()->getClassNameLinker()); //if (iriClassNameString == "http://www.owllink.org/testsuite/galen#LowerLobeOfLeftLung") { // bool bug = true; //} if (subsumerList) { for (CCLASSSUBSUMPTIONMESSAGELIST::const_iterator it = subsumerList->constBegin(), itEnd = subsumerList->constEnd(); it != itEnd; ++it) { CConcept* subsumerConcept(*it); COptimizedSubClassSatisfiableTestingItem* subsumerItem = optSubClassItem->getConceptSatisfiableTestItem(subsumerConcept); subsumedItem->addSubsumingConceptItem(subsumerItem); } } subsumedItem->setResultSatisfiableDerivated(true); } messageDataLinkerIt = messageDataLinkerIt->getNext(); } return true; } bool COptimizedSubClassSubsumptionClassifierThread::interpreteToldSubsumptionResult(COntologyClassificationItem *ontClassItem, const QList > &subSumRelList, bool isSubSum) { CConcept *lastConcept = nullptr; COptimizedSubClassOntologyClassificationItem *optSubClassItem = (COptimizedSubClassOntologyClassificationItem *)ontClassItem; COptimizedSubClassSatisfiableTestingItem* subsumerItem = nullptr; for (QList >::const_iterator it = subSumRelList.constBegin(), itEnd = subSumRelList.constEnd(); it != itEnd; ++it) { CConcept *subsumerConcept = it->first; if (lastConcept != subsumerConcept) { lastConcept = subsumerConcept; subsumerItem = optSubClassItem->getConceptSatisfiableTestItem(subsumerConcept); } CConcept *subsumedConcept = it->second; if (isSubSum) { COptimizedSubClassSatisfiableTestingItem* subsumedItem = optSubClassItem->getConceptSatisfiableTestItem(subsumedConcept); subsumerItem->addSubsumingConceptItem(subsumedItem); } } return true; } bool COptimizedSubClassSubsumptionClassifierThread::interpreteSubsumptionResult(COntologyClassificationItem *ontClassItem, CConcept *subsumerConcept, CConcept *subsumedConcept, bool isSubsumption) { return false; } bool COptimizedSubClassSubsumptionClassifierThread::interpreteSatisfiableResult(COntologyClassificationItem *ontClassItem, CConcept *satisfiableConcept, bool isSatis) { COptimizedSubClassOntologyClassificationItem *optSubClassItem = (COptimizedSubClassOntologyClassificationItem *)ontClassItem; CClassifierStatistics *ontClassStat = optSubClassItem->getClassifierStatistics(); if (ontClassStat) { ontClassStat->incToldSatisfiableCount(1); } ++satTestedCount; optSubClassItem->decRunningSatisfiableTestsCount(); COptimizedSubClassSatisfiableTestingItem* satTestedItem = optSubClassItem->getConceptSatisfiableTestItem(satisfiableConcept); satTestedItem->setSatisfiableTested(true); satTestedItem->setSatisfiableTestedResult(isSatis); COptimizedSubClassSatisfiableTestingItem* topItem = optSubClassItem->getTopConceptSatisfiableTestItem(); if (isSatis) { // update processing lists #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGB QString iriClassNameString = CIRIName::getRecentIRIName(satisfiableConcept->getClassNameLinker()); satTestedConList.append(iriClassNameString); #endif #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGLOGOUTPUT LOG(INFO,getLogDomain(),QString("[%1 / %2] Calculated: '%3' is satisfiable").arg(satTestedCount).arg(totalToTestCount).arg(iriClassNameString),this); #endif #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGSTATUSDESCRIPTION statUpdateMutex.lock(); statusString = QString("Interpreting, '%1' is satisfiable").arg(iriClassNameString); statUpdateMutex.unlock(); #endif #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGCOUTOUTPUT cout<addSatisfiableConceptItem(satTestedItem); } else { CTaxonomy *tax = optSubClassItem->getTaxonomy(); if (topItem) { tax->setConceptSatisfiable(satisfiableConcept,false); } else { tax->getBottomHierarchyNode()->addEquivalentConcept(satisfiableConcept); tax->updateNodeEquivalences(tax->getBottomHierarchyNode()); } } QList* nextItemList = optSubClassItem->getNextSatisfiableTestingItemList(); QSet* nextCandItemSet = optSubClassItem->getNextCandidateSatisfiableTestingItemSet(); QSet* remainingCandItemSet = optSubClassItem->getRemainingCandidateSatisfiableTestingItemSet(); QList* succItemList = satTestedItem->getSuccessorItemList(); for (QList::const_iterator it = succItemList->constBegin(), itEnd = succItemList->constEnd(); it != itEnd; ++it) { COptimizedSubClassSatisfiableTestingItem* succItem = *it; if (!isSatis) { succItem->setResultUnsatisfiableDerivated(true); } succItem->decUnprocessedPredecessorItems(); if (succItem->hasOnlyProcessedPredecessorItems()) { nextItemList->append(succItem); } else { nextCandItemSet->insert(succItem); } } return false; } bool COptimizedSubClassSubsumptionClassifierThread::interpreteTestResults(CTestCalculatedCallbackEvent *testResult) { CSatisfiableCalculationJob *satCalcJob = testResult->getSatisfiableCalculationJob(); bool testSat = testResult->getTestResultSatisfiable(); CClassificationWorkItem *workItem = testResult->getClassificationWorkItem(); COntologyClassificationItem *ontClassItem = workOntItemHash.value(workItem); if (ontClassItem) { QHash *workHash = ontClassItem->getWorkItemHash(); CTaxonomy *taxonomy = ontClassItem->getTaxonomy(); if (workItem) { ontClassItem->decCurrentCalculatingCount(); if (workItem->isTestValid()) { if (testResult->hasCalculationError()) { LOG(ERROR,getLogDomain(),logTr("Error in computation, classification for ontology '%1' failed.").arg(ontClassItem->getOntology()->getTerminologyName()),getLogObject()); ontClassItem->setTaxonomyConstructionFailed(); } else { if (workItem->isConceptSatisfiableTest()) { interpreteSatisfiableResult(ontClassItem,workItem->getSatisfiableTestedConcept(),testSat); } } } QHash::iterator itWorkItem = workHash->find(satCalcJob); while (itWorkItem != workHash->end()) { if (itWorkItem.value() == workItem) { workHash->erase(itWorkItem); break; } ++itWorkItem; } delete workItem; } workOntItemHash.remove(workItem); CClassificationCalculationStatisticsCollection* statisticCollection = testResult->getUsedStatisticsCollection(); if (statisticCollection) { ontClassItem->reuseCalculationStatisticsCollection(statisticCollection); } #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGTAXONOMYCOUTOUTPUT QString taxString = taxonomy->getConceptHierarchyString(); cout<isTaxonomyConstructed() && !ontClassItem->isTaxonomyConstructionFailed()) { #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGLOGOUTPUT LOG(INFO,getLogDomain(),QString("Building Class Taxonomy"),this); #endif // build taxonomy COptimizedSubClassOntologyClassificationItem *optSubClassItem = (COptimizedSubClassOntologyClassificationItem *)ontClassItem; QList* satItemList = optSubClassItem->getSatisfiableConceptItemList(); CTaxonomy *tax = optSubClassItem->getTaxonomy(); QList itemList; COptimizedSubClassSatisfiableTestingItem* topItem = optSubClassItem->getTopConceptSatisfiableTestItem(); CHierarchyNode* topHierNode = tax->getTopHierarchyNode(); CHierarchyNode* bottomHierNode = tax->getBottomHierarchyNode(); cint64 topSubsumingItemCount = topItem->getSubsumingConceptItemCount(); topItem->setSatisfiableConceptHierarchyNode(topHierNode); if (topSubsumingItemCount) { QList* subsumingConceptItemList = topItem->sortSubsumingConceptItemList(); for (QList::const_iterator subsumedIt = subsumingConceptItemList->constBegin(), subsumedItEnd = subsumingConceptItemList->constEnd(); subsumedIt != subsumedItEnd; ++subsumedIt) { COptimizedSubClassSatisfiableTestingItem* subsumedConceptItem = *subsumedIt; // mark as equivalent subsumedConceptItem->setEquivalentItem(true); topHierNode->addEquivalentConcept(subsumedConceptItem->getSatisfiableConcept()); tax->updateNodeEquivalences(topHierNode); } } for (QList::const_iterator it = satItemList->constBegin(), itEnd = satItemList->constEnd(); it != itEnd; ++it) { COptimizedSubClassSatisfiableTestingItem* item = *it; if (!item->isEquivalentItem() && item != topItem) { CHierarchyNode* itemNode = tax->getHierarchyNode(item->getSatisfiableConcept(),true); item->setSatisfiableConceptHierarchyNode(itemNode); cint64 itemSubsumingCount = item->getSubsumingConceptItemCount(); itemList.append(item); if (itemSubsumingCount > topSubsumingItemCount) { QList* subsumingConceptItemList = item->sortSubsumingConceptItemList(); for (QList::const_iterator subsumedIt = subsumingConceptItemList->constBegin(), subsumedItEnd = subsumingConceptItemList->constEnd(); subsumedIt != subsumedItEnd; ++subsumedIt) { COptimizedSubClassSatisfiableTestingItem* subsumedConceptItem = *subsumedIt; cint64 subsumedItemSubsumingCount = subsumedConceptItem->getSubsumingConceptItemCount(); if (subsumedItemSubsumingCount == itemSubsumingCount) { // mark as equivalent subsumedConceptItem->setEquivalentItem(true); itemNode->addEquivalentConcept(subsumedConceptItem->getSatisfiableConcept()); tax->updateNodeEquivalences(itemNode); } else { break; } } } } } for (QList::const_iterator it = itemList.constBegin(), itEnd = itemList.constEnd(); it != itEnd; ++it) { COptimizedSubClassSatisfiableTestingItem* item = *it; if (!item->isEquivalentItem() && item != topItem) { cint64 itemSubsumingCount = item->getSubsumingConceptItemCount(); CHierarchyNode* itemHierNode = item->getSatisfiableConceptHierarchyNode(); //QString iriClassNameString = CIRIName::getRecentIRIName(item->getSatisfiableConcept()->getClassNameLinker()); //if (iriClassNameString == "http://www.owllink.org/testsuite/galen#LowerLobeOfLeftLung") { // bool bug = true; //} QList* subsumingConceptItemList = item->getSubsumingConceptItemList(); QList::const_iterator subsumedIt = subsumingConceptItemList->constBegin(), subsumedItEnd = subsumingConceptItemList->constEnd(); cint64 eqCount = 0; cint64 remainingSubsumingCount = itemSubsumingCount; // remove direct equivalences while (subsumedIt != subsumedItEnd) { COptimizedSubClassSatisfiableTestingItem* subsumedConceptItem = *subsumedIt; cint64 subsumedItemSubsumingCount = subsumedConceptItem->getSubsumingConceptItemCount(); if (subsumedItemSubsumingCount != itemSubsumingCount) { break; } else { ++eqCount; ++subsumedIt; --remainingSubsumingCount; } } while (subsumedIt != subsumedItEnd && (*subsumedIt)->isEquivalentItem()) { ++subsumedIt; } // find first parent if (subsumedIt == subsumedItEnd) { // no parent, use top as parent itemHierNode->makeParent(topHierNode); } else { itemHierNode->addPredecessorNode(topHierNode); QList parentItemList; while (subsumedIt != subsumedItEnd) { COptimizedSubClassSatisfiableTestingItem* subsumedConceptItem = *subsumedIt; if (!subsumedConceptItem->isEquivalentItem()) { subsumedConceptItem->setPredecessorItem(true); CHierarchyNode* subsumedHierNode = subsumedConceptItem->getSatisfiableConceptHierarchyNode(); itemHierNode->makeParent(subsumedHierNode); parentItemList.append(subsumedConceptItem); remainingSubsumingCount -= subsumedConceptItem->getSubsumingConceptItemCount()+1; ++subsumedIt; break; } else { ++subsumedIt; } } bool searchForMoreParents = remainingSubsumingCount > 0; while (subsumedIt != subsumedItEnd) { COptimizedSubClassSatisfiableTestingItem* subsumedConceptItem = *subsumedIt; if (!subsumedConceptItem->isEquivalentItem()) { bool predOfOnePrevParent = false; if (searchForMoreParents) { for (QList::const_iterator parentIt = parentItemList.constBegin(), parentItEnd = parentItemList.constEnd(); parentIt != parentItEnd && !predOfOnePrevParent; ++parentIt) { COptimizedSubClassSatisfiableTestingItem* parentItem = *parentIt; if (parentItem->getSubsumingConceptItemSet()->contains(subsumedConceptItem)) { predOfOnePrevParent = true; } } } subsumedConceptItem->setPredecessorItem(true); CHierarchyNode* subsumedHierNode = subsumedConceptItem->getSatisfiableConceptHierarchyNode(); if (!predOfOnePrevParent && searchForMoreParents) { itemHierNode->makeParent(subsumedHierNode); parentItemList.append(subsumedConceptItem); } else { itemHierNode->addPredecessorNode(subsumedHierNode); } } ++subsumedIt; } } } } for (QList::const_iterator it = itemList.constBegin(), itEnd = itemList.constEnd(); it != itEnd; ++it) { COptimizedSubClassSatisfiableTestingItem* item = *it; if (!item->isPredecessorItem() && !item->isEquivalentItem()) { CHierarchyNode* itemHierNode = item->getSatisfiableConceptHierarchyNode(); bottomHierNode->makeParent(itemHierNode); } } #ifdef OPTIMIZEDSUBCLASSCLASSIFIERDEBUGSTATUSDESCRIPTION statUpdateMutex.lock(); statusString = QString("Finished ontology classification"); statUpdateMutex.unlock(); #endif CTaxonomy *taxonomy = ontClassItem->getTaxonomy(); CConcreteOntology *ontology = ontClassItem->getOntology(); CClassification* classification = ontology->getClassification(); if (classification) { CClassConceptClassification* classConClassification = ontClassItem->getClassConceptClassification(); CClassificationStatisticsCollectionStrings* classifStatCollStrings = ontClassItem->getClassificationStatisticsCollectionStrings(); CClassifierStatistics* classifierStats = ontClassItem->getClassifierStatistics(); classifStatCollStrings->addProcessingStatistics("class-classification-total-satisfiable-test-count",classifierStats->getTotalSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("class-classification-satisfiable-tested-count",classifierStats->getTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("class-classification-satisfiable-pseudo-model-merged-tested-count",classifierStats->getPseudoModelMergedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("class-classification-satisfiable-derivate-tested-count",classifierStats->getDerivatedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("class-classification-satisfiable-calculated-tested-count",classifierStats->getCalculatedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("class-classification-satisfiable-pruned-tested-count",classifierStats->getPrunedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("class-classification-satisfiable-told-tested-count",classifierStats->getToldSatisfiableCount()-classifierStats->getCalculatedTestedSatisfiableCount()); classifStatCollStrings->addProcessingStatistics("class-classification-total-subsumption-test-count",classifierStats->getTotalSatisfiableCount()*(classifierStats->getTotalSatisfiableCount()-1)); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-tested-count",classifierStats->getTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-pseudo-model-merged-tested-count",classifierStats->getPseudoModelMergedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-subclass-tested-count",classifierStats->getSubclassTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-subclass-identifier-occur-tested-count",classifierStats->getSubclassIdentifierOccurTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-derivate-tested-count",classifierStats->getDerivatedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-calculated-tested-count",classifierStats->getCalculatedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-pruned-tested-count",classifierStats->getPrunedTestedSubsumptionCount()); classifStatCollStrings->addProcessingStatistics("class-classification-subsumption-told-tested-count",classifierStats->getToldSubsumptionCount()-classifierStats->getCalculatedTestedSubsumptionCount()); classConClassification->setClassConceptTaxonomy(taxonomy); classConClassification->setClassificationStatistics(classifStatCollStrings); if (ontClassItem->getIndividualDependenceTrackingCollector()) { classConClassification->setDependentIndividualsTracking(ontClassItem->getIndividualDependenceTrackingCollector()->getExtendingIndividualDependenceTracking()); } classification->setClassConceptClassification(classConClassification); } ontology->setConceptTaxonomy(taxonomy); ontClassItem->setGoneOutRemainingTests(false); taxonomy->setTaxonomyComplete(true); --mClassificationCount; LOG(INFO,getLogDomain(),logTr("Ontology '%1' classified with %2 satisfiable tests.").arg(ontology->getTerminologyName()).arg(ontClassItem->getCalcedSatisfiableCount()),getLogObject()); } ontClassItem->submitTaxonomyConstructed(); ontClassItem->doClassifiedCallback(); return true; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationManager.cpp0000644000175000017500000001126412520550746027173 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationManager.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationManager::CClassificationManager() { } CClassificationManager::~CClassificationManager() { if (classifierFac) { delete classifierFac; } } cint64 CClassificationManager::getActiveClassifierCount() { readWriteLock.lockForRead(); cint64 activeCount = 0; foreach (CSubsumptionClassifier* classifier, ontoClassifierSet) { CSubsumptionClassifierThread* threadClassifier = dynamic_cast(classifier); if (threadClassifier && threadClassifier->isClassifierActive()) { ++activeCount; } } readWriteLock.unlock(); return activeCount; } CClassificationManager *CClassificationManager::initializeManager(CSubsumptionClassifierFactory *takeClassifierFactory, CConfigurationProvider *configurationProvider) { classifierFac = takeClassifierFactory; return this; } CSubsumptionClassifier *CClassificationManager::getClassifier(CConcreteOntology *ontology, CConfigurationBase *config, bool create, bool backgroundClassification) { readWriteLock.lockForRead(); CSubsumptionClassifier *classifier = ontoClassifierHash.value(ontology); readWriteLock.unlock(); if (!classifier) { readWriteLock.lockForWrite(); classifier = ontoClassifierHash.value(ontology); if (!classifier) { classifier = classifierFac->createClassifier(ontology,config); ontoClassifierSet.insert(classifier); ontoClassifierHash.insert(ontology,classifier); } readWriteLock.unlock(); } return classifier; } CClassifierStatistics *CClassificationManager::collectClassificationStatistics(CClassifierStatistics *statistics) { statistics->resetValues(); readWriteLock.lockForRead(); foreach (CSubsumptionClassifier *classifier, ontoClassifierSet) { CClassifierStatistics *classifierStatistics = classifier->getClassificationStatistics(); statistics->appendStatistics(classifierStatistics); } readWriteLock.unlock(); return statistics; } QList CClassificationManager::getClassifierList() { readWriteLock.lockForRead(); QList list(ontoClassifierSet.values()); readWriteLock.unlock(); return list; } CClassificationProgress* CClassificationManager::getClassificationProgress() { CClassificationProgress newClassProg; readWriteLock.lockForRead(); double percentAvg = 0; cint64 percentCount = 0; foreach (CSubsumptionClassifier *classifier, ontoClassifierSet) { CClassificationProgress* classificationProgress = classifier->getClassificationProgress(); if (classificationProgress) { newClassProg.setTotalClasses(newClassProg.getTotalClasses()+classificationProgress->getTotalClasses()); newClassProg.setClassificationCount(newClassProg.getClassificationCount()+classificationProgress->getClassificationCount()); newClassProg.setTestedClasses(newClassProg.getTestedClasses()+classificationProgress->getTestedClasses()); newClassProg.setTestedSubsumptions(newClassProg.getTestedSubsumptions()+classificationProgress->getTestedSubsumptions()); newClassProg.setTotalSubsumptions(newClassProg.getTotalSubsumptions()+classificationProgress->getTotalSubsumptions()); newClassProg.setRemainingMilliSeconds(qMax(newClassProg.getRemainingMilliSeconds(),classificationProgress->getRemainingMilliSeconds())); percentAvg += classificationProgress->getProgessPercent(); ++percentCount; } } readWriteLock.unlock(); if (percentCount != 0) { percentAvg /= (double)percentCount; } newClassProg.setProgessPercent(percentAvg); mClassificationProgress = newClassProg; return &mClassificationProgress; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COntologyClassificationItem.cpp0000644000175000017500000002205012520550756030246 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyClassificationItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { COntologyClassificationItem::COntologyClassificationItem(CConfigurationBase *configuration, CClassifierStatistics *nextClassificationStatistics) { statistics = new CClassifierStatistics(nextClassificationStatistics); config = new CCalculationConfigurationExtension(configuration,0); mClassificationStatCollStrings = new CClassificationStatisticsCollectionStrings(); mConfCollectProcessStatistics = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Classification.CollectProcessStatistics",true);; mClassifyProcessingStepData = nullptr; mTaxonomyConstructed = false; mTaxonomyConstructionFailed = false; mPrecSatSubsumerExtractor = nullptr; mIndiDepTrackingCollector = nullptr; mInitTime.start(); } COntologyClassificationItem::~COntologyClassificationItem() { delete mPrecSatSubsumerExtractor; delete statistics; delete config; delete mIndiDepTrackingCollector; } CPrecomputedSaturationSubsumerExtractor* COntologyClassificationItem::getPrecomputedSaturationSubsumerExtractor(bool create) { if (!mPrecSatSubsumerExtractor && create) { mPrecSatSubsumerExtractor = new CPrecomputedSaturationSubsumerExtractor(onto); } return mPrecSatSubsumerExtractor; } COntologyClassificationItem *COntologyClassificationItem::initTaxonomyConcepts(CConcreteOntology *ontology, CTaxonomy *taxonomy) { onto = ontology; tax = taxonomy; CABox *aBox = onto->getABox(); CTBox *tBox = onto->getTBox(); currentCalculatingCount = 0; mClassifyProcessingStepData = onto->getProcessingSteps()->getOntologyProcessingStepDataVector()->getProcessingStepData(COntologyProcessingStep::OPSCLASSCLASSIFY); mTaxonomyConstructionFailed = !mClassifyProcessingStepData->getProcessingStep()->areAllRequirementsSatisfied(ontology); remainingTests = true; CConcept *topConcept = onto->getDataBoxes()->getTopConcept(); CConcept *bottomConcept = onto->getDataBoxes()->getBottomConcept(); cint64 satConCount = 0; CBOXSET *conceptHash = tBox->getActiveClassConceptSet(false); if (conceptHash) { for (CBOXSET::const_iterator it = conceptHash->constBegin(), itEnd = conceptHash->constEnd(); it != itEnd; ++it) { CConcept *concept = (*it); if (concept && concept != topConcept && concept != bottomConcept) { // concept which has to be inserted in the taxonomy ++satConCount; } } } statistics->incTotalSatisfiableTestCount(satConCount); return this; } CConcreteOntology *COntologyClassificationItem::getOntology() { return onto; } CTaxonomy *COntologyClassificationItem::getTaxonomy() { return tax; } CTBox *COntologyClassificationItem::getTBox() { return onto->getTBox(); } CCalculationConfigurationExtension *COntologyClassificationItem::getCalculationConfiguration() { return config; } QList *COntologyClassificationItem::getAllNodeList() { return &allNodeList; } QList *COntologyClassificationItem::getProcessingNodeList() { return &processingNodeList; } QHash * COntologyClassificationItem::getWorkItemHash() { return &workItemHash; } COntologyClassificationItem *COntologyClassificationItem::incCurrentCalculatingCount(qint64 incCount) { currentCalculatingCount += incCount; return this; } COntologyClassificationItem *COntologyClassificationItem::decCurrentCalculatingCount(qint64 decCount) { currentCalculatingCount -= decCount; return this; } COntologyClassificationItem *COntologyClassificationItem::setGoneOutRemainingTests(bool moreTests) { remainingTests = moreTests; return this; } bool COntologyClassificationItem::hasRemainingTests() { return remainingTests || currentCalculatingCount > 0; } qint64 COntologyClassificationItem::getCurrentCalculatingCount() { return currentCalculatingCount; } COntologyClassificationItem *COntologyClassificationItem::doClassifiedCallback() { classifiedCallbackList.doCallback(); return this; } COntologyClassificationItem *COntologyClassificationItem::addClassifiedCallback(CCallbackData *callback) { callback->setCallbackDataContext(new CClassifiedCallbackDataContext(tax,onto)); classifiedCallbackList.addCallbackData(callback); if (!hasRemainingTests()) { doClassifiedCallback(); } return this; } qint64 COntologyClassificationItem::getCalcedSatisfiableCount() { return statistics->getTestedSatisfiableCount(); } qint64 COntologyClassificationItem::getCalcedSubsumptionCount() { return statistics->getTestedSubsumptionCount(); } CClassifierStatistics *COntologyClassificationItem::getClassifierStatistics() { return statistics; } CClassConceptClassification* COntologyClassificationItem::getClassConceptClassification() { return this; } CClassificationStatisticsCollectionStrings* COntologyClassificationItem::getClassificationStatisticsCollectionStrings() { return mClassificationStatCollStrings; } CClassificationCalculationStatisticsCollection* COntologyClassificationItem::getCalculationStatisticsCollection() { CClassificationCalculationStatisticsCollection* statColl = nullptr; if (!mReuseStatCollList.isEmpty()) { statColl = mReuseStatCollList.takeFirst(); } if (!statColl && mClassificationStatCollStrings) { statColl = mClassificationStatCollStrings->createCalculationStatisticsCollection(); } return statColl; } COntologyClassificationItem* COntologyClassificationItem::reuseCalculationStatisticsCollection(CClassificationCalculationStatisticsCollection* statColl) { mReuseStatCollList.append(statColl); return this; } bool COntologyClassificationItem::isCollectProcessStatisticsActivated() { return mConfCollectProcessStatistics; } QList COntologyClassificationItem::getOntologyProcessingRequirementList() { return mRequirementList; } COntologyClassificationItem* COntologyClassificationItem::addOntologyProcessingRequirements(const QList& reqList) { mRequirementList.append(reqList); return this; } bool COntologyClassificationItem::isTaxonomyConstructed() { return mTaxonomyConstructed; } COntologyClassificationItem* COntologyClassificationItem::setTaxonomyConstructionFailed() { mTaxonomyConstructionFailed = true; return this; } bool COntologyClassificationItem::isTaxonomyConstructionFailed() { return mTaxonomyConstructionFailed; } COntologyClassificationItem* COntologyClassificationItem::submitTaxonomyConstructed() { mTaxonomyConstructed = true; mClassifyProcessingStepData->getProcessingStatus()->setProcessingFlags(COntologyProcessingStatus::PSCOMPLETELYYPROCESSED); cint64 errorFlags = COntologyProcessingStatus::PSSUCESSFULL; if (mTaxonomyConstructionFailed) { errorFlags = COntologyProcessingStatus::PSFAILED; } mClassifyProcessingStepData->getProcessingStatus()->setErrorFlags(errorFlags); for (QList::const_iterator it = mRequirementList.constBegin(), itEnd = mRequirementList.constEnd(); it != itEnd; ++it) { COntologyProcessingRequirement* ontReq(*it); ontReq->submitRequirementUpdate(COntologyProcessingStatus::PSCOMPLETELYYPROCESSED,errorFlags); } return this; } CIndividualDependenceTrackingCollector* COntologyClassificationItem::getIndividualDependenceTrackingCollector() { return mIndiDepTrackingCollector; } COntologyClassificationItem* COntologyClassificationItem::setIndividualDependenceTrackingCollector(CIndividualDependenceTrackingCollector* indiDepTrackColl) { mIndiDepTrackingCollector = indiDepTrackColl; return this; } COntologyProcessingStepData* COntologyClassificationItem::getClassificationProcessingStep() { return mClassifyProcessingStepData; } QTime* COntologyClassificationItem::getInitializationTime() { return &mInitTime; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionDat0000644000175000017500000000533412520550756032432 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSPOSSIBLESUBSUMPTIONDATA_H #define KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSPOSSIBLESUBSUMPTIONDATA_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes #include "Reasoner/Ontology/CIRIName.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Classifier { /*! * * \class COptimizedKPSetClassPossibleSubsumptionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetClassPossibleSubsumptionData { // public methods public: //! Constructor COptimizedKPSetClassPossibleSubsumptionData(COptimizedKPSetClassTestingItem* item); bool isUpdateRequired(); bool isSubsumptionUpdated(); COptimizedKPSetClassPossibleSubsumptionData* setSubsumptionUpdated(bool updated); bool isSubsumptionConfirmed(); COptimizedKPSetClassPossibleSubsumptionData* setSubsumptionConfirmed(bool confirmedSubsumption); bool isSubsumptionInvalided(); COptimizedKPSetClassPossibleSubsumptionData* setSubsumptionInvalid(bool invalidSubsumption); bool isSubsumptionKnown(); bool isSubsumptionUnknown(); COptimizedKPSetClassTestingItem* getClassItem(); COptimizedKPSetClassPossibleSubsumptionData* setClassItem(COptimizedKPSetClassTestingItem* item); // protected methods protected: // protected variables protected: COptimizedKPSetClassTestingItem* mClassItem; bool mSubsumptionInvalidFlag; bool mSubsumptionConfirmedFlag; bool mSubsumptionUpdatedFlag; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_COPTIMIZEDKPSETCLASSPOSSIBLESUBSUMPTIONDATA_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationPseudoModelIdentifierMessageData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationPseudoModelIdentifierMessag0000644000175000017500000000364012520550750032415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationPseudoModelIdentifierMessageData.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationPseudoModelIdentifierMessageData::CClassificationPseudoModelIdentifierMessageData() { mMessageDataType = TELLCLASSPSEUDOMODELIDENTIFIERS; } CClassificationPseudoModelIdentifierMessageData* CClassificationPseudoModelIdentifierMessageData::initClassificationPseudoModelIdentifierMessageData(CConcept* pmConcept, CClassificationClassPseudoModelHash* pmModelHash, CMemoryPool* pmMemPools) { mPMConcept = pmConcept; mPMModelHash = pmModelHash; mPMMemPools = pmMemPools; return this; } CConcept* CClassificationPseudoModelIdentifierMessageData::getPseudoModelConcept() { return mPMConcept; } CMemoryPool* CClassificationPseudoModelIdentifierMessageData::getPseudoModelMemoryPools() { return mPMMemPools; } CClassificationClassPseudoModelHash* CClassificationPseudoModelIdentifierMessageData::getPseudoModelHash() { return mPMModelHash; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CSubsumptionClassifier.cpp0000644000175000017500000000215512520550762027277 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSubsumptionClassifier.h" namespace Konclude { namespace Reasoner { namespace Classifier { CSubsumptionClassifier::CSubsumptionClassifier() { } CSubsumptionClassifier::~CSubsumptionClassifier() { } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COntologyClassificationItem.h0000644000175000017500000001470712520550756027725 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CONTOLOGYCLASSIFICATIONITEM_H #define KONCLUDE_REASONER_CLASSIFIER_CONTOLOGYCLASSIFICATIONITEM_H // Libraries includes #include // Namespace includes #include "ClassifierSettings.h" #include "CClassificationWorkItem.h" #include "CClassifiedCallbackDataContext.h" #include "CClassifierStatistics.h" #include "CPrecomputedSaturationSubsumerExtractor.h" // Other includes #include "Reasoner/Classification/CClassConceptClassification.h" #include "Reasoner/Classification/CClassificationCalculationStatisticsCollection.h" #include "Reasoner/Classification/CClassificationStatisticsCollectionStrings.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/COntologyProcessingStep.h" #include "Reasoner/Ontology/COntologyProcessingSteps.h" #include "Reasoner/Ontology/COntologyProcessingStepData.h" #include "Reasoner/Ontology/CConceptNegationPair.h" #include "Reasoner/Consistiser/CIndividualDependenceTrackingCollector.h" #include "Reasoner/Taxonomy/CTaxonomy.h" #include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h" #include "Concurrent/Callback/CCallbackListExecuter.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; using namespace Taxonomy; using namespace Classification; using namespace Consistiser; using namespace Kernel::Task; namespace Classifier { /*! * * \class COntologyClassificationItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyClassificationItem : public CClassConceptClassification { // public methods public: //! Constructor COntologyClassificationItem(CConfigurationBase *configuration, CClassifierStatistics *nextClassificationStatistics = 0); //! Destructor virtual ~COntologyClassificationItem(); virtual COntologyClassificationItem *initTaxonomyConcepts(CConcreteOntology *ontology, CTaxonomy *taxonomy); CPrecomputedSaturationSubsumerExtractor* getPrecomputedSaturationSubsumerExtractor(bool create = true); virtual CConcreteOntology *getOntology(); virtual CTaxonomy *getTaxonomy(); virtual CTBox *getTBox(); virtual CCalculationConfigurationExtension *getCalculationConfiguration(); virtual QHash *getWorkItemHash(); virtual QList *getAllNodeList(); virtual QList *getProcessingNodeList(); virtual COntologyClassificationItem *incCurrentCalculatingCount(qint64 incCount = 1); virtual COntologyClassificationItem *decCurrentCalculatingCount(qint64 decCount = 1); virtual qint64 getCurrentCalculatingCount(); virtual COntologyClassificationItem *setGoneOutRemainingTests(bool moreTests = false); virtual bool hasRemainingTests(); virtual COntologyClassificationItem *doClassifiedCallback(); virtual COntologyClassificationItem *addClassifiedCallback(CCallbackData *callback); virtual qint64 getCalcedSatisfiableCount(); virtual qint64 getCalcedSubsumptionCount(); virtual CClassifierStatistics *getClassifierStatistics(); CClassConceptClassification* getClassConceptClassification(); CClassificationStatisticsCollectionStrings* getClassificationStatisticsCollectionStrings(); CClassificationCalculationStatisticsCollection* getCalculationStatisticsCollection(); COntologyClassificationItem* reuseCalculationStatisticsCollection(CClassificationCalculationStatisticsCollection* statColl); bool isCollectProcessStatisticsActivated(); QList getOntologyProcessingRequirementList(); COntologyClassificationItem* addOntologyProcessingRequirements(const QList& reqList); bool isTaxonomyConstructed(); COntologyClassificationItem* submitTaxonomyConstructed(); COntologyClassificationItem* setTaxonomyConstructionFailed(); bool isTaxonomyConstructionFailed(); CIndividualDependenceTrackingCollector* getIndividualDependenceTrackingCollector(); COntologyClassificationItem* setIndividualDependenceTrackingCollector(CIndividualDependenceTrackingCollector* indiDepTrackColl); COntologyProcessingStepData* getClassificationProcessingStep(); QTime* getInitializationTime(); // protected methods protected: // protected variables protected: CConcreteOntology *onto; CTaxonomy *tax; CClassificationStatisticsCollectionStrings* mClassificationStatCollStrings; QList mReuseStatCollList; CPrecomputedSaturationSubsumerExtractor* mPrecSatSubsumerExtractor; QHash workItemHash; QList allNodeList; QList processingNodeList; CCallbackListExecuter classifiedCallbackList; qint64 currentCalculatingCount; bool remainingTests; CClassifierStatistics *statistics; CCalculationConfigurationExtension *config; bool mConfCollectProcessStatistics; QList mRequirementList; bool mTaxonomyConstructed; bool mTaxonomyConstructionFailed; COntologyProcessingStepData* mClassifyProcessingStepData; CIndividualDependenceTrackingCollector* mIndiDepTrackingCollector; QTime mInitTime; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CONTOLOGYCLASSIFICATIONITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModel.h0000644000175000017500000000402412520550744030466 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODEL_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODEL_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" #include "CClassificationClassPseudoModelHash.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Classifier { /*! * * \class CClassificationClassPseudoModel * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationClassPseudoModel { // public methods public: //! Constructor CClassificationClassPseudoModel(); CClassificationClassPseudoModelHash* getPseudoModelHash(); CClassificationClassPseudoModel* setPseudoModelHash(CClassificationClassPseudoModelHash* pmHash); // protected methods protected: // protected variables protected: CClassificationClassPseudoModelHash* mPMDataHash; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONCLASSPSEUDOMODEL_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationClassPseudoModelHash.cpp0000644000175000017500000000445412520550746031636 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationClassPseudoModelHash.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationClassPseudoModelHash::CClassificationClassPseudoModelHash(CContext* context) : mPMDataHash(context),mContext(context) { } CClassificationClassPseudoModelHash* CClassificationClassPseudoModelHash::initPseudoModelHash(CClassificationClassPseudoModelHash* hash) { if (hash) { mPMDataHash = hash->mPMDataHash; } else { mPMDataHash.clear(); } return this; } CClassificationClassPseudoModelData* CClassificationClassPseudoModelHash::getPseudoModelData(cint64 node, bool create) { CClassificationClassPseudoModelData* pmData = nullptr; if (create) { CClassificationClassPseudoModelHashData& data = mPMDataHash[node]; if (!data.mLocData) { data.mLocData = CObjectParameterizingAllocator< CClassificationClassPseudoModelData,CContext* >::allocateAndConstructAndParameterize(mContext->getMemoryAllocationManager(),mContext); data.mLocData->initPseudoModelData(data.mUseData); data.mUseData = data.mLocData; } pmData = data.mUseData; } else { const CClassificationClassPseudoModelHashData& data = mPMDataHash.value(node,CClassificationClassPseudoModelHashData()); pmData = data.mUseData; } return pmData; } cint64 CClassificationClassPseudoModelHash::getCount() { return mPMDataHash.count(); } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassIdentifierMap.cpp0000644000175000017500000000227412405707542031250 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetClassPossibleSubsumptionMap.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedKPSetClassPossibleSubsumptionMap::COptimizedKPSetClassPossibleSubsumptionMap() : QMap() { } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CSubsumptionClassifierThread.cpp0000644000175000017500000002434212520550764030433 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSubsumptionClassifierThread.h" namespace Konclude { namespace Reasoner { namespace Classifier { CSubsumptionClassifierThread::CSubsumptionClassifierThread(CReasonerManager *reasonerManager) : CThread("Classifier-Thread") { reasoner = reasonerManager; calculationManager = 0; currRunningTestParallelCount = 0; confMaxTestParallelCount = 1; confMinTestParallelCount = 15; mStatCalculatingJobs = 0; mClassifierActive = false; statistics = new CClassifierStatistics(); startThread(QThread::HighPriority); } CSubsumptionClassifierThread::~CSubsumptionClassifierThread() { stopThread(); } bool CSubsumptionClassifierThread::classify(CConcreteOntology *ontology, CConfigurationBase *config, const QList& requirementList, CCallbackData* callback) { postEvent(new CClassifyOntologyEvent(ontology,config,requirementList,callback)); return true; } bool CSubsumptionClassifierThread::classify(CConcreteOntology *ontology, CConfigurationBase *config, const QList& requirementList) { CBlockingCallbackData callback; postEvent(new CClassifyOntologyEvent(ontology,config,requirementList,&callback)); callback.waitForCallback(); return true; } bool CSubsumptionClassifierThread::callbackClassified(CConcreteOntology *ontology, CCallbackData *callback) { bool isClassifyOnto = false; CTaxonomy *taxonomy = ontology->getConceptTaxonomy(); if (taxonomy && taxonomy->isComplete()) { isClassifyOnto = true; if (callback) { callback->doCallback(); } } else { CBlockingCallbackData callbackBlock; postEvent(new CCallbackClassifiedOntologyEvent(ontology,&callbackBlock,callback)); callbackBlock.waitForCallback(); CClassifyingCallbackDataContext *classifyingContext = dynamic_cast(callbackBlock.getCallbackDataContext()); if (classifyingContext) { isClassifyOnto = classifyingContext->isClassifying(); } } return isClassifyOnto; } CClassificationMessageDataObserver* CSubsumptionClassifierThread::tellClassificationMessage(CConcreteOntology *ontology, CClassificationMessageData* messageData, CMemoryPool* memoryPool) { postEvent(new COntologyTellClassificationMessageEvent(ontology,messageData,memoryPool)); return this; } CSubsumptionClassifierThread *CSubsumptionClassifierThread::addOntologyClassifiedCallback(CConcreteOntology *ontology, CCallbackData *callback) { COntologyClassificationItem *ontClassItem = ontItemHash.value(ontology,0); if (ontClassItem) { ontClassItem->addClassifiedCallback(callback); } return this; } CSubsumptionClassifierThread* CSubsumptionClassifierThread::addOntologyClassifyRequirements(CConcreteOntology *ontology, const QList& requirementList) { COntologyClassificationItem *ontClassItem = ontItemHash.value(ontology,nullptr); if (ontClassItem) { ontClassItem->addOntologyProcessingRequirements(requirementList); } return this; } CSubsumptionClassifierThread *CSubsumptionClassifierThread::scheduleOntologyClassification(CConcreteOntology *ontology, CTaxonomy *taxonomy, CClassificationCalculationSupport *classificationSupport, CConfigurationBase *config) { COntologyClassificationItem *ontClassItem = new COntologyClassificationItem(config,statistics); ontClassItem->initTaxonomyConcepts(ontology,taxonomy); ontItemList.append(ontClassItem); processingOntItemList.append(ontClassItem); ontItemHash.insert(ontology,ontClassItem); return this; } CSubsumptionClassifierThread* CSubsumptionClassifierThread::rescheduleOntologyClassification(CConcreteOntology *ontology) { COntologyClassificationItem *ontClassItem = ontItemHash.value(ontology); processingOntItemList.append(ontClassItem); return this; } bool CSubsumptionClassifierThread::isOntologyClassificationScheduled(CConcreteOntology *ontology) { return ontItemHash.contains(ontology); } bool CSubsumptionClassifierThread::canProcessMoreTests() { return currRunningTestParallelCount < confMaxTestParallelCount; } bool CSubsumptionClassifierThread::startProcessMoreTests() { return currRunningTestParallelCount <= confMinTestParallelCount; } bool CSubsumptionClassifierThread::doNextPendingTests() { bool createdNewTests = false; if (startProcessMoreTests()) { bool nextTestCreated = true; while (canProcessMoreTests() && nextTestCreated) { nextTestCreated = false; bool workCreated = createNextSubsumtionTest(); if (workCreated) { nextTestCreated = true; createdNewTests = true; } else { nextTestCreated = false; } } submitCalculationJobs(); } return createdNewTests; } CSubsumptionClassifierThread* CSubsumptionClassifierThread::submitCalculationJobs() { if (!mJobCallbackList.isEmpty()) { calculationManager->calculateJobs(mJobCallbackList); mJobCallbackList.clear(); } return this; } CSubsumptionClassifierThread* CSubsumptionClassifierThread::processCalculationJob(CSatisfiableCalculationJob* job, COntologyClassificationItem *ontClassItem, CCallbackData* callback, bool directlySubmit) { currRunningTestParallelCount++; ++mStatCalculatingJobs; if (!calculationManager) { calculationManager = reasoner->getCalculationManager(); } if (!calculationManager || directlySubmit || currRunningTestParallelCount-1 < confMinTestParallelCount/2) { if (calculationManager) { calculationManager->calculateJob(job,callback); } else { reasoner->reasoningSatisfiableCalcualtionJob(job,callback); } } else { mJobCallbackList.append(QPair(job,callback)); } return this; } bool CSubsumptionClassifierThread::processToldClassificationMessage(COntologyClassificationItem *ontClassItem, CClassificationMessageData* messageData, CMemoryPool* memoryPools) { return false; } bool CSubsumptionClassifierThread::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CThread::processCustomsEvents(type,event)) { return true; } else if (type == CClassifyOntologyEvent::EVENTTYPE) { CClassifyOntologyEvent *coe = (CClassifyOntologyEvent *)event; CConcreteOntology* onto = coe->getOntology(); CCallbackData *callback = coe->getCallbackData(); CConfigurationBase* config = coe->getConfiguration(); QList* reqList = coe->getClassificationRequirementList(); if (!isOntologyClassificationScheduled(onto)) { CTaxonomy* taxonomy = createEmptyTaxonomyForOntology(onto,config); scheduleOntologyClassification(onto,taxonomy,nullptr,config); addOntologyClassifyRequirements(onto,*reqList); } else { rescheduleOntologyClassification(onto); } if (reqList) { addOntologyClassifyRequirements(onto,*reqList); } if (callback) { addOntologyClassifiedCallback(onto,callback); } doNextPendingTests(); return true; } else if (type == COntologyTellClassificationMessageEvent::EVENTTYPE) { COntologyTellClassificationMessageEvent *otcme = (COntologyTellClassificationMessageEvent *)event; CConcreteOntology *ontology = otcme->getOntology(); COntologyClassificationItem *ontClassItem = ontItemHash.value(ontology,0); if (ontClassItem) { CClassificationMessageData* messageData = otcme->getMessageData(); CMemoryPool* memoryPools = otcme->getMemoryPool(); processToldClassificationMessage(ontClassItem,messageData,memoryPools); mContext.getMemoryPoolAllocationManager()->releaseTemporaryMemoryPools(memoryPools); } doNextPendingTests(); return true; } else if (type == CTestCalculatedCallbackEvent::EVENTTYPE) { CTestCalculatedCallbackEvent *tcue = (CTestCalculatedCallbackEvent *)event; interpreteTestResults(tcue); currRunningTestParallelCount--; doNextPendingTests(); return true; } else if (type == CCallbackClassifiedOntologyEvent::EVENTTYPE) { CCallbackClassifiedOntologyEvent *ccoe = (CCallbackClassifiedOntologyEvent *)event; CCallbackData *possCallback = ccoe->getCallbackPossibleCallbackData(); COntologyClassificationItem *ontClassItem = ontItemHash.value(ccoe->getOntology(),0); if (possCallback) { CTaxonomy *taxonomy = 0; if (ontClassItem) { taxonomy = ontClassItem->getTaxonomy(); } CClassifyingCallbackDataContext *possCallbackContext = new CClassifyingCallbackDataContext(ontClassItem,taxonomy,ccoe->getOntology()); possCallback->setCallbackDataContext(possCallbackContext); possCallback->doCallback(); } CCallbackData *classifiedCallback = ccoe->getClassifiedCallbackData(); if (classifiedCallback) { addOntologyClassifiedCallback(ccoe->getOntology(),classifiedCallback); rescheduleOntologyClassification(ccoe->getOntology()); } return true; } return false; } CClassifierStatistics *CSubsumptionClassifierThread::getClassificationStatistics() { return statistics; } CClassificationProgress* CSubsumptionClassifierThread::getClassificationProgress() { return nullptr; } bool CSubsumptionClassifierThread::isClassifierActive() { return isThreadProcessingEvents(); } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionDat0000644000175000017500000000643212520550756032432 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetClassPossibleSubsumptionData.h" #include "COptimizedKPSetClassTestingItem.h" namespace Konclude { namespace Reasoner { namespace Classifier { COptimizedKPSetClassPossibleSubsumptionData::COptimizedKPSetClassPossibleSubsumptionData(COptimizedKPSetClassTestingItem* item) { mSubsumptionUpdatedFlag = false; mSubsumptionConfirmedFlag = false; mSubsumptionInvalidFlag = false; mClassItem = item; } bool COptimizedKPSetClassPossibleSubsumptionData::isUpdateRequired() { return !mSubsumptionUpdatedFlag && (mSubsumptionConfirmedFlag || mSubsumptionInvalidFlag); } bool COptimizedKPSetClassPossibleSubsumptionData::isSubsumptionUpdated() { return mSubsumptionUpdatedFlag; } COptimizedKPSetClassPossibleSubsumptionData* COptimizedKPSetClassPossibleSubsumptionData::setSubsumptionUpdated(bool updated) { mSubsumptionUpdatedFlag = updated; return this; } bool COptimizedKPSetClassPossibleSubsumptionData::isSubsumptionConfirmed() { return mSubsumptionConfirmedFlag; } COptimizedKPSetClassPossibleSubsumptionData* COptimizedKPSetClassPossibleSubsumptionData::setSubsumptionConfirmed(bool confirmedSubsumption) { mSubsumptionConfirmedFlag = confirmedSubsumption; return this; } bool COptimizedKPSetClassPossibleSubsumptionData::isSubsumptionInvalided() { return mSubsumptionInvalidFlag; } COptimizedKPSetClassPossibleSubsumptionData* COptimizedKPSetClassPossibleSubsumptionData::setSubsumptionInvalid(bool invalidSubsumption) { //QString iriClassNameString1 = CIRIName::getRecentIRIName(mClassItem->getTestingConcept()->getClassNameLinker()); //if (iriClassNameString1 == "#EntireMolecularEntity") { // bool bug = true; //} mSubsumptionInvalidFlag = invalidSubsumption; return this; } bool COptimizedKPSetClassPossibleSubsumptionData::isSubsumptionKnown() { return mSubsumptionInvalidFlag || mSubsumptionConfirmedFlag; } bool COptimizedKPSetClassPossibleSubsumptionData::isSubsumptionUnknown() { return !mSubsumptionConfirmedFlag && !mSubsumptionInvalidFlag; } COptimizedKPSetClassTestingItem* COptimizedKPSetClassPossibleSubsumptionData::getClassItem() { return mClassItem; } COptimizedKPSetClassPossibleSubsumptionData* COptimizedKPSetClassPossibleSubsumptionData::setClassItem(COptimizedKPSetClassTestingItem* item) { mClassItem = item; return this; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationMessageData.h0000644000175000017500000000434612520550750027442 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONMESSAGEDATA_H #define KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONMESSAGEDATA_H // Libraries includes // Namespace includes #include "ClassifierSettings.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Classifier { /*! * * \class CClassificationMessageData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationMessageData : public CLinkerBase { // public methods public: //! Constructor CClassificationMessageData(); enum CLASSIFICATIONMESSAGEDATA { TELLCLASSSUBSUMPTION, TELLCLASSPSEUDOMODELIDENTIFIERS, TELLCLASSINITIALIZEPOSSIBLESUBSUM, TELLCLASSUPDATEPOSSIBLESUBSUM }; CLASSIFICATIONMESSAGEDATA getClassificationMessageDataType(); // protected methods protected: // protected variables protected: CLASSIFICATIONMESSAGEDATA mMessageDataType; // private methods private: // private variables private: }; }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFIER_CCLASSIFICATIONMESSAGEDATA_H ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationInitializePossibleSubsumptionMessageData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationInitializePossibleSubsumpti0000644000175000017500000000510012520550746032546 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationInitializePossibleSubsumptionMessageData.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationInitializePossibleSubsumptionMessageData::CClassificationInitializePossibleSubsumptionMessageData() { mMessageDataType = TELLCLASSINITIALIZEPOSSIBLESUBSUM; } CClassificationInitializePossibleSubsumptionMessageData* CClassificationInitializePossibleSubsumptionMessageData::initClassificationPossibleSubsumptionMessageData(CConcept* subsumedConcept, CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* possSubsumerList, bool eqConceptsNonCandidatePossSubsumers, CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* eqConNonCandpossSubsumerList) { mSubsumedConcept = subsumedConcept; mPossSubsumerList = possSubsumerList; mEqConceptsNonCandidatePossSubsumers = eqConceptsNonCandidatePossSubsumers; mEqConNonCandPossSubsumerList = eqConNonCandpossSubsumerList; return this; } CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* CClassificationInitializePossibleSubsumptionMessageData::getClassPossibleSubsumerList() { return mPossSubsumerList; } CCLASSPOSSIBLESUBSUMPTIONMESSAGELIST* CClassificationInitializePossibleSubsumptionMessageData::getClassEqConceptNonCandidatePossibleSubsumerList() { return mEqConNonCandPossSubsumerList; } CConcept* CClassificationInitializePossibleSubsumptionMessageData::getSubsumedConcept() { return mSubsumedConcept; } bool CClassificationInitializePossibleSubsumptionMessageData::hasEqConceptsNonCandidatePossSubsumers() { return mEqConceptsNonCandidatePossSubsumers; } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000021600000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classifier/CClassificationSatisfiablePossibleSubsumpt0000644000175000017500000000233212520550750032521 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking.h" namespace Konclude { namespace Reasoner { namespace Classifier { CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking::CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking() { } }; // end namespace Classifier }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Revision/0000755000175000017500000000000012613407260021637 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Revision/COntologyRevision.cpp0000644000175000017500000000530112520551262025775 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyRevision.h" namespace Konclude { namespace Reasoner { namespace Revision { COntologyRevision::COntologyRevision(CConcreteOntology *ontology, COntologyRevision *previousOntologyRevision, COntologyConfigurationExtension *ontRevConfig) { revisionDepth = 0; rootRev = 0; revisionPath = 0; prevRev = previousOntologyRevision; onto = ontology; config = ontRevConfig; if (prevRev) { revisionDepth = prevRev->getOntologyRevisionDepth() + 1; rootRev = prevRev->getRootOntologyRevision(); revisionPath = prevRev->getOntologyRevisionPath(); } } COntologyRevision::~COntologyRevision() { delete config; delete onto; } COntologyRevision *COntologyRevision::getPreviousOntologyRevision() { return rootRev; } COntologyRevision *COntologyRevision::getRootOntologyRevision() { return prevRev; } CConcreteOntology *COntologyRevision::getOntology() { return onto; } COntologyRevision *COntologyRevision::setOntology(CConcreteOntology *ontology) { onto = ontology; return this; } qint64 COntologyRevision::getOntologyRevisionDepth() { return revisionDepth; } COntologyRevision *COntologyRevision::setOntologyRevisionDepth(qint64 depth) { revisionDepth = depth; return this; } qint64 COntologyRevision::getOntologyRevisionPath() { return revisionPath; } COntologyRevision *COntologyRevision::setOntologyRevisionPath(qint64 ontologyRevisionPath) { revisionPath = ontologyRevisionPath; return this; } COntologyConfigurationExtension *COntologyRevision::getOntologyConfiguration() { return config; } COntologyRevision *COntologyRevision::setOntologyConfiguration(COntologyConfigurationExtension *ontRevConfig) { config = ontRevConfig; return this; } }; // end namespace Revision }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Revision/CSPOntologyRevisionManager.cpp0000644000175000017500000004223312520551410027533 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSPOntologyRevisionManager.h" namespace Konclude { namespace Reasoner { namespace Revision { CSPOntologyRevisionManager::CSPOntologyRevisionManager() : CLogIdentifier("::Konclude::Reasoner::Revision::SPOntologyRevisionManager",this) { classificationMan = 0; nextOntologyID = 0; nextRevisionPathID = 0; nextUnamedOntologyNumber = 0; confProvider = 0; mBaseOnto = nullptr; } CSPOntologyRevisionManager::~CSPOntologyRevisionManager() { qDeleteAll(onRevContainer); } COntologyRevisionManager *CSPOntologyRevisionManager::initializeManager(CConfigurationProvider *configurationProvider) { confProvider = configurationProvider; classificationMan = CConfigManagerReader::readClassificationManagerConfig(confProvider); return this; } qint64 CSPOntologyRevisionManager::getOntologyCount() { return ontologyCount; } CConcreteOntology* CSPOntologyRevisionManager::getBasementOntology(CCommandRecordRouter& commandRecordRouter) { CConcreteOntology* usedBasementOntology = nullptr; if (mBaseOnto) { QString resolveBasementKBNameString = CConfigDataReader::readConfigString(confProvider,"Konclude.Ontology.Revision.BasementResolveKBName"); if (!resolveBasementKBNameString.isEmpty()) { qint64 revPath = nameIDHash.value(resolveBasementKBNameString); COntologyRevision *currOntologyRev = revisionHash.value(revPath,0); if (currOntologyRev) { usedBasementOntology = currOntologyRev->getOntology(); } } } if (!usedBasementOntology) { if (!mBaseOnto) { CUnspecifiedMessageInformationRecord::makeRecord("Creating ontology basement.",&commandRecordRouter); mBaseOnto = new CConcreteOntology(confProvider->getCurrentConfiguration()); CConcreteOntologyBasementBuilder* basementOntoBuilder = new CConcreteOntologyBasementBuilder(mBaseOnto); basementOntoBuilder->initializeBuilding(); basementOntoBuilder->buildOntologyBasement(); basementOntoBuilder->completeBuilding(); delete basementOntoBuilder; COntologyConfigDependedPreProcesser* preProcessor = new COntologyConfigDependedPreProcesser(commandRecordRouter); preProcessor->preprocess(mBaseOnto,confProvider->getCurrentConfiguration()); delete preProcessor; CUnspecifiedMessageInformationRecord::makeRecord("Ontology basement created.",&commandRecordRouter); } usedBasementOntology = mBaseOnto; } return usedBasementOntology; } CCommandDelegater *CSPOntologyRevisionManager::delegateCommand(CCommand *command) { if (dynamic_cast(command)) { CCreateKnowledgeBaseCommand *cKBC = dynamic_cast(command); CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); QString kbName = cKBC->getKnowledgeBaseName(); if (kbName.isEmpty()) { QString unKBName = QString("http://Konclude.com/Ontologies/UnnamedOntologies/%1/%2/").arg(nextUnamedOntologyNumber++).arg(QDateTime::currentMSecsSinceEpoch()); while (nameIDHash.contains(unKBName)) { unKBName = QString("http://Konclude.com/Ontologies/UnnamedOntologies/%1/%2/").arg(nextUnamedOntologyNumber++).arg(QDateTime::currentMSecsSinceEpoch()); } kbName = unKBName; } cKBC->setKnowledgeBaseName(kbName); if (nameIDHash.contains(kbName)) { // ontology already exists CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' already exists.").arg(kbName),&commandRecordRouter); } else { qint64 ontologyID = nextOntologyID++; qint64 revPath = nextRevisionPathID++; COntologyConfigurationExtension *ontConfig = new COntologyConfigurationExtension(confProvider->getCurrentConfiguration(),0); CConcreteOntology* baseOnto = getBasementOntology(commandRecordRouter); CConcreteOntology *ont = new CConcreteOntology(baseOnto,ontConfig); ont->setOntologyID(ontologyID); ont->setOntologyName(kbName); if (cKBC->hasPrefixes()) { COntologyStringMapping* ontoStrings = ont->getStringMapping(); CMAPPINGHASH* abbreviatedNamePrefixMapHash = ontoStrings->getAbbreviatedNamePrefixHash(true); CMAPPINGHASH* namePrefixMapHash = ontoStrings->getNamePrefixHash(true); QList* prefixList = cKBC->getPrefixList(); foreach (CNamePrefix* prefix, *prefixList) { CNamePrefix* newPrefix = new CNamePrefix(prefix->getAbbreviatedPrefixString(),prefix->getPrefixString()); abbreviatedNamePrefixMapHash->insert(newPrefix->getAbbreviatedPrefixString(),newPrefix); namePrefixMapHash->insert(newPrefix->getPrefixString(),newPrefix); } } COntologyRevision *onRev = new COntologyRevision(ont,0,ontConfig); onRev->setOntologyRevisionPath(revPath); onRevContainer.insert(onRev); revisionHash.insert(revPath,onRev); nameIDHash.insert(kbName,revPath); ontologyCount++; } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCreateKnowledgeBaseRevisionUpdateCommand *cKBRevUpC = (CCreateKnowledgeBaseRevisionUpdateCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); QString kbName = cKBRevUpC->getKnowledgeBaseName(); if (!nameIDHash.contains(kbName)) { CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' doesn't exist.").arg(kbName),&commandRecordRouter); } else { qint64 revPath = nameIDHash.value(kbName); COntologyRevision *currOntologyRev = revisionHash.value(revPath,0); if (currOntologyRev) { qint64 ontologyID = nextOntologyID++; CConcreteOntology *currOnt = currOntologyRev->getOntology(); COntologyConfigurationExtension *currOntConfig = currOntologyRev->getOntologyConfiguration(); COntologyConfigurationExtension *nextOntConfig = new COntologyConfigurationExtension(currOntConfig,currOntConfig->getAdditionalConfigurationList(),currOntConfig->getConfigurationID()+1); CConcreteOntology *ont = new CConcreteOntology(currOnt,nextOntConfig); ont->setOntologyName(currOnt->getOntologyName()); ont->setOntologyID(ontologyID); COntologyRevision *nextOntologyRev = new COntologyRevision(ont,currOntologyRev,nextOntConfig); cKBRevUpC->setOntologyRevision(nextOntologyRev); } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' couldn't be resolved.").arg(kbName),&commandRecordRouter); } } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CReleaseKnowledgeBaseCommand *rKBRevUpC = (CReleaseKnowledgeBaseCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); QString kbName = rKBRevUpC->getKnowledgeBaseName(); if (!nameIDHash.contains(kbName)) { CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' doesn't exist.").arg(kbName),&commandRecordRouter); } else { nameIDHash.remove(kbName); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CGetKnowledgeBaseConfigCommand *getConfigComm = (CGetKnowledgeBaseConfigCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); QString kbName = getConfigComm->getKnowlegeBaseString(); if (!nameIDHash.contains(kbName)) { CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' doesn't exist.").arg(kbName),&commandRecordRouter); } else { qint64 revPath = nameIDHash.value(kbName); COntologyRevision *currOntologyRev = revisionHash.value(revPath,0); if (currOntologyRev) { COntologyConfigurationExtension *config = currOntologyRev->getOntologyConfiguration(); CConfigData *configData = config->getRelatedConfigChange(getConfigComm->getConfigNameString()); getConfigComm->setConfigData(configData); } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' couldn't be resolved.").arg(kbName),&commandRecordRouter); } } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CGetKnowledgeBaseSettingsCommand *getConfigComm = (CGetKnowledgeBaseSettingsCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); QString kbName = getConfigComm->getKnowlegeBaseString(); if (!nameIDHash.contains(kbName)) { CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' doesn't exist.").arg(kbName),&commandRecordRouter); } else { qint64 revPath = nameIDHash.value(kbName); COntologyRevision *currOntologyRev = revisionHash.value(revPath,0); if (currOntologyRev) { COntologyConfigurationExtension *config = currOntologyRev->getOntologyConfiguration(); getConfigComm->setConfiguration(config); } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' couldn't be resolved.").arg(kbName),&commandRecordRouter); } } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CSetKnowledgeBaseConfigCommand *setConfigComm = (CSetKnowledgeBaseConfigCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); QString kbName = setConfigComm->getKnowlegeBaseString(); if (!nameIDHash.contains(kbName)) { CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' doesn't exist.").arg(kbName),&commandRecordRouter); } else { qint64 revPath = nameIDHash.value(kbName); COntologyRevision *currOntologyRev = revisionHash.value(revPath,0); if (currOntologyRev) { COntologyConfigurationExtension *config = currOntologyRev->getOntologyConfiguration(); if (!config->isConfigLevelLocked(setConfigComm->getConfigNameString())) { CCreateKnowledgeBaseRevisionUpdateCommand *createUpdateRevComm = new CCreateKnowledgeBaseRevisionUpdateCommand(setConfigComm->getKnowlegeBaseString(),setConfigComm); delegateCommand(createUpdateRevComm); COntologyRevision *ontoRev = createUpdateRevComm->getOntologyRevision(); if (ontoRev) { COntologyConfigurationExtension *config = ontoRev->getOntologyConfiguration(); CConfigData *configData = config->createAndSetConfig(setConfigComm->getConfigNameString()); if (configData) { if (configData->supportsStringConvertion()) { configData->readFromString(setConfigComm->getConfigValueString()); } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Value for configuration property '%1' could not read from string.").arg(setConfigComm->getConfigNameString()),&commandRecordRouter); } } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Configuration property '%1' not available.").arg(setConfigComm->getConfigNameString()),&commandRecordRouter); } } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' couldn't be resolved.").arg(setConfigComm->getKnowlegeBaseString()),&commandRecordRouter); } CInstallKnowledgeBaseRevisionUpdateCommand *installRevUpdateComm = new CInstallKnowledgeBaseRevisionUpdateCommand(setConfigComm->getKnowlegeBaseString(),createUpdateRevComm,setConfigComm); delegateCommand(installRevUpdateComm); } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Configuration property '%1' is locked.").arg(setConfigComm->getConfigNameString()),&commandRecordRouter); } } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' couldn't be resolved.").arg(kbName),&commandRecordRouter); } } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CInstallKnowledgeBaseRevisionUpdateCommand *inKBRevUpC = (CInstallKnowledgeBaseRevisionUpdateCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); QString kbName = inKBRevUpC->getKnowledgeBaseName(); COntologyRevision *nextOntRev = inKBRevUpC->getOntologyRevision(); if (!nextOntRev) { CUnspecifiedMessageErrorRecord::makeRecord(QString("New KnowledgeBase '%1' revision not available.").arg(kbName),&commandRecordRouter); } else { qint64 nextRevPath = nextOntRev->getOntologyRevisionPath(); qint64 nextRevDepth = nextOntRev->getOntologyRevisionDepth(); if (!nameIDHash.contains(kbName)) { CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' doesn't exist.").arg(kbName),&commandRecordRouter); } else { qint64 revPath = nameIDHash.value(kbName); COntologyRevision *ontologyRev = revisionHash.value(revPath,0); if (ontologyRev) { qint64 revDepth = ontologyRev->getOntologyRevisionDepth(); if (nextRevDepth > revDepth+1) { COntologyRevision* prevOntRev = nextOntRev->getPreviousOntologyRevision(); CConcreteOntology* prevOnt = prevOntRev->getOntology(); CConcreteOntology* currOnt = ontologyRev->getOntology(); CConcreteOntology* nextOnt = nextOntRev->getOntology(); CConcreteOntologyMergingBuilder mergingBuilder(currOnt,nextOnt,prevOnt); mergingBuilder.initializeBuilding(); mergingBuilder.mergingBuilding(); mergingBuilder.completeBuilding(); // install new knowledge base revision revisionHash.insert(revPath,nextOntRev); onRevContainer.insert(nextOntRev); CUnspecifiedMessageInformationRecord::makeRecord(QString("Merging KnowledgeBase '%1' because of concurrent modification.").arg(kbName),&commandRecordRouter); } else { // install new knowledge base revision revisionHash.insert(revPath,nextOntRev); onRevContainer.insert(nextOntRev); } } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' couldn't be resolved.").arg(kbName),&commandRecordRouter); } } } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CGetCurrentKnowledgeBaseRevisionCommand *gCurrKBRevUpC = (CGetCurrentKnowledgeBaseRevisionCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); QString kbName = gCurrKBRevUpC->getKnowledgeBaseName(); if (!nameIDHash.contains(kbName)) { CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' doesn't exist.").arg(kbName),&commandRecordRouter); } else { qint64 revPath = nameIDHash.value(kbName); COntologyRevision *currOntologyRev = revisionHash.value(revPath,0); if (currOntologyRev) { gCurrKBRevUpC->setOntologyRevision(currOntologyRev); } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("KnowledgeBase '%1' couldn't be resolved.").arg(kbName),&commandRecordRouter); } } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } return this; } }; // end namespace Revision }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Revision/COntologyRevisionManager.cpp0000644000175000017500000000216312520551262027273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyRevisionManager.h" namespace Konclude { namespace Reasoner { namespace Revision { COntologyRevisionManager::COntologyRevisionManager() { } COntologyRevisionManager::~COntologyRevisionManager() { } }; // end namespace Revision }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Revision/COntologyRevision.h0000644000175000017500000000561012520551262025445 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYREVISION_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYREVISION_H // Libraries includes // Namespace includes #include "RevisionSettings.h" #include "COntologyConfigurationExtension.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { using namespace Ontology; namespace Revision { /*! * * \class COntologyRevision * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyRevision { // public methods public: //! Constructor COntologyRevision(CConcreteOntology *ontology = 0, COntologyRevision *previousOntologyRevision = 0, COntologyConfigurationExtension *ontRevConfig = 0); //! Destructor virtual ~COntologyRevision(); virtual CConcreteOntology *getOntology(); virtual COntologyRevision *setOntology(CConcreteOntology *ontology); virtual qint64 getOntologyRevisionDepth(); virtual COntologyRevision *setOntologyRevisionDepth(qint64 depth); virtual COntologyRevision *getPreviousOntologyRevision(); virtual COntologyRevision *getRootOntologyRevision(); virtual qint64 getOntologyRevisionPath(); virtual COntologyRevision *setOntologyRevisionPath(qint64 ontologyRevisionPath); virtual COntologyConfigurationExtension *getOntologyConfiguration(); virtual COntologyRevision *setOntologyConfiguration(COntologyConfigurationExtension *ontRevConfig); // protected methods protected: // protected variables protected: CConcreteOntology *onto; qint64 revisionDepth; qint64 revisionPath; COntologyRevision *prevRev; COntologyRevision *rootRev; COntologyConfigurationExtension *config; // private methods private: // private variables private: }; }; // end namespace Revision }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYREVISION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Revision/COntologyConfigurationExtension.cpp0000644000175000017500000000406012520551260030702 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyConfigurationExtension.h" namespace Konclude { namespace Reasoner { namespace Revision { COntologyConfigurationExtension::COntologyConfigurationExtension(CConfigurationBase *fixedConfigurationExt, qint64 configID) : CLocalConfigurationFixedExtension((fixedConfigurationExt)?fixedConfigurationExt->getConfigurationGroup():0,configID) { addCollectedConfigurations(fixedConfigurationExt); } COntologyConfigurationExtension::COntologyConfigurationExtension(COntologyConfigurationExtension *previousLocalOntologyExtension, CConfigurationBase *fixedConfigurationExt, qint64 configID) : CLocalConfigurationFixedExtension(previousLocalOntologyExtension,configID) { addCollectedConfigurations(fixedConfigurationExt); } COntologyConfigurationExtension::COntologyConfigurationExtension(COntologyConfigurationExtension *previousLocalOntologyExtension, const QLinkedList &fixedConfigExtList, qint64 configID) : CLocalConfigurationFixedExtension(previousLocalOntologyExtension,configID) { addConfigurationList(fixedConfigExtList); } COntologyConfigurationExtension::~COntologyConfigurationExtension() { } }; // end namespace Revision }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Revision/RevisionSettings.h0000644000175000017500000000262012520551262025326 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REVISION_REVISIONSETTINGS #define KONCLUDE_REASONER_REVISION_REVISIONSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Reasoner { namespace Revision { /*! * * \file RevisionSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations }; // end namespace Revision }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_REVISION_REVISIONSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Revision/COntologyRevisionManager.h0000644000175000017500000000435312520551262026743 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REVISION_CONTOLOGYREVISIONMANAGER_H #define KONCLUDE_REASONER_REVISION_CONTOLOGYREVISIONMANAGER_H // Libraries includes #include // Namespace includes #include "COntologyRevision.h" // Other includes #include "Reasoner/Ontology/CTerminology.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Control/Command/CCommandDelegater.h" #include "Config/CConfigurationProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Control::Command; using namespace Config; namespace Reasoner { using namespace Ontology; namespace Revision { /*! * * \class COntologyRevisionManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyRevisionManager : public CCommandDelegater { // public methods public: //! Constructor COntologyRevisionManager(); //! Destructor virtual ~COntologyRevisionManager(); virtual COntologyRevisionManager *initializeManager(CConfigurationProvider *configurationProvider) = 0; virtual qint64 getOntologyCount() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Revision }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REVISION_CONTOLOGYREVISIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Revision/CSPOntologyRevisionManager.h0000644000175000017500000001041412520551262027201 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REVISION_CSPONTOLOGYREVISIONMANAGER_H #define KONCLUDE_REASONER_REVISION_CSPONTOLOGYREVISIONMANAGER_H // Libraries includes #include // Namespace includes #include "COntologyRevisionManager.h" // Other includes #include "Reasoner/Classifier/CClassificationManager.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CMBox.h" #include "Control/Command/Instructions/CCreateKnowledgeBaseCommand.h" #include "Control/Command/Instructions/CCreateKnowledgeBaseRevisionUpdateCommand.h" #include "Control/Command/Instructions/CInstallKnowledgeBaseRevisionUpdateCommand.h" #include "Control/Command/Instructions/CGetCurrentKnowledgeBaseRevisionCommand.h" #include "Control/Command/Instructions/CReleaseKnowledgeBaseCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseConfigCommand.h" #include "Control/Command/Instructions/CSetKnowledgeBaseConfigCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseSettingsCommand.h" #include "Control/Command/CCommandRecordRouter.h" #include "Control/Command/CConfigManagerReader.h" #include "Control/Command/Records/CStartProcessCommandRecord.h" #include "Control/Command/Records/CStopProcessCommandRecord.h" #include "Control/Command/Records/CFinishProcessCommandRecord.h" #include "Control/Command/Records/CUnspecifiedMessageErrorRecord.h" #include "Config/CConfigurationProvider.h" #include "Config/CConfigDataReader.h" #include "Reasoner/Generator/CConcreteOntologyBasementBuilder.h" #include "Reasoner/Generator/CConcreteOntologyMergingBuilder.h" #include "Reasoner/Preprocess/COntologyConfigDependedPreProcesser.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Logger; using namespace Config; using namespace Utilities; using namespace Control::Command::Instructions; using namespace Control::Command::Records; using namespace Control::Command; namespace Reasoner { using namespace Ontology; using namespace Classifier; using namespace Generator; using namespace Preprocess; namespace Revision { /*! * * \class CSPOntologyRevisionManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSPOntologyRevisionManager : public COntologyRevisionManager, public CLogIdentifier { // public methods public: //! Constructor CSPOntologyRevisionManager(); //! Destructor virtual ~CSPOntologyRevisionManager(); virtual COntologyRevisionManager *initializeManager(CConfigurationProvider *configurationProvider); virtual qint64 getOntologyCount(); virtual CCommandDelegater *delegateCommand(CCommand *command); // protected methods protected: CConcreteOntology* getBasementOntology(CCommandRecordRouter& commandRecordRouter); // protected variables protected: qint64 nextOntologyID; qint64 ontologyCount; qint64 nextRevisionPathID; QHash revisionHash; QHash nameIDHash; QSet onRevContainer; qint64 nextUnamedOntologyNumber; CConfigurationProvider *confProvider; CClassificationManager *classificationMan; CConcreteOntology* mBaseOnto; // private methods private: // private variables private: }; }; // end namespace Revision }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REVISION_CSPONTOLOGYREVISIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Revision/COntologyConfigurationExtension.h0000644000175000017500000000462312520551262030356 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REVISION_CLOCALONTOLOGYCONFIGURATIONEXTENSION_H #define KONCLUDE_REASONER_REVISION_CLOCALONTOLOGYCONFIGURATIONEXTENSION_H // Libraries includes // Namespace includes // Other includes #include "Config/CConfigurationBase.h" #include "Config/CLocalConfigurationFixedExtension.h" #include "Config/CGlobalConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { namespace Revision { /*! * * \class COntologyConfigurationExtension * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyConfigurationExtension : public CLocalConfigurationFixedExtension { // public methods public: //! Constructor COntologyConfigurationExtension(CConfigurationBase *fixedConfigurationExt, qint64 configID); COntologyConfigurationExtension(COntologyConfigurationExtension *previousLocalOntologyExtension, CConfigurationBase *fixedConfigurationExt, qint64 configID); COntologyConfigurationExtension(COntologyConfigurationExtension *previousLocalOntologyExtension, const QLinkedList &fixedConfigExtList, qint64 configID); //! Destructor virtual ~COntologyConfigurationExtension(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Revision }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REVISION_CLOCALONTOLOGYCONFIGURATIONEXTENSION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/0000755000175000017500000000000012613407252022775 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/CClassificationStatistics.h0000644000175000017500000000413712520550742030264 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFICATION_CCLASSIFICATIONSTATISTICS_H #define KONCLUDE_REASONER_CLASSIFICATION_CCLASSIFICATIONSTATISTICS_H // Libraries includes #include #include // Namespace includes // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Classification { /*! * * \class CClassificationStatistics * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationStatistics { // public methods public: //! Constructor CClassificationStatistics(); //! Destructor virtual ~CClassificationStatistics(); virtual QList getStatisticsNameStringList() = 0; virtual cint64 getStatisticIntegerValue(const QString& statName) = 0; virtual bool addProcessingStatistics(const QString& statName, cint64 statValue) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Classification }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFICATION_CCLASSIFICATIONSTATISTICS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/CClassConceptClassification.h0000644000175000017500000000544112520550742030512 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFICATION_CCLASSCONCEPTCLASSIFICATION_H #define KONCLUDE_REASONER_CLASSIFICATION_CCLASSCONCEPTCLASSIFICATION_H // Libraries includes // Namespace includes #include "ClassificationSettings.h" #include "CClassificationStatistics.h" // Other includes #include "Reasoner/Taxonomy/CTaxonomy.h" #include "Reasoner/Ontology/CIndividualDependenceTracking.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Taxonomy; namespace Classification { /*! * * \class CClassConceptClassification * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassConceptClassification { // public methods public: //! Constructor CClassConceptClassification(); virtual ~CClassConceptClassification(); bool hasClassConceptTaxonomy(); CTaxonomy* getClassConceptTaxonomy(); CClassConceptClassification* setClassConceptTaxonomy(CTaxonomy* taxonomy); bool hasClassificationStatistics(); CClassificationStatistics* getClassificationStatistics(); CClassConceptClassification* setClassificationStatistics(CClassificationStatistics* statColl); bool hasDependentIndividualsTracking(); bool isIndividualDependentTrackingSet(); CIndividualDependenceTracking* getDependentIndividualsTracking(); CClassConceptClassification* setDependentIndividualsTracking(CIndividualDependenceTracking* indiDepTracking); // protected methods protected: // protected variables protected: CTaxonomy* mClassConceptTaxonomy; CClassificationStatistics* mStatsColl; CIndividualDependenceTracking* mIndiDepTracking; bool mIndiDepTrackingSet; // private methods private: // private variables private: }; }; // end namespace Classification }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFICATION_CCLASSCONCEPTCLASSIFICATION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/CClassification.cpp0000644000175000017500000000346012520550742026542 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassification.h" namespace Konclude { namespace Reasoner { namespace Classification { CClassification::CClassification() { mClassified = false; mClassConceptClassification = nullptr; } CClassification::~CClassification() { } bool CClassification::isOntologyClassified() { return mClassified; } CClassification* CClassification::setOntologyClassified(bool classified) { mClassified = classified; return this; } bool CClassification::hasClassConceptClassification() { return mClassConceptClassification != nullptr; } CClassConceptClassification* CClassification::getClassConceptClassification() { return mClassConceptClassification; } CClassification* CClassification::setClassConceptClassification(CClassConceptClassification* classConceptClassificaton) { mClassConceptClassification = classConceptClassificaton; return this; } }; // end namespace Classification }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/CClassification.h0000644000175000017500000000425312520550742026210 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFICATION_CCLASSIFICATION_H #define KONCLUDE_REASONER_CLASSIFICATION_CCLASSIFICATION_H // Libraries includes // Namespace includes #include "ClassificationSettings.h" #include "CClassConceptClassification.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Classification { /*! * * \class CClassification * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassification { // public methods public: //! Constructor CClassification(); //! Destructor virtual ~CClassification(); bool isOntologyClassified(); CClassification* setOntologyClassified(bool classified); bool hasClassConceptClassification(); CClassConceptClassification* getClassConceptClassification(); CClassification* setClassConceptClassification(CClassConceptClassification* classConceptClassificaton); // protected methods protected: // protected variables protected: bool mClassified; CClassConceptClassification* mClassConceptClassification; // private methods private: // private variables private: }; }; // end namespace Classification }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFICATION_CCLASSIFICATION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/CClassConceptClassification.cpp0000644000175000017500000000521512520550742031044 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassConceptClassification.h" namespace Konclude { namespace Reasoner { namespace Classification { CClassConceptClassification::CClassConceptClassification() { mClassConceptTaxonomy = nullptr; mStatsColl = nullptr; mIndiDepTracking = nullptr; mIndiDepTrackingSet = false; } CClassConceptClassification::~CClassConceptClassification() { } bool CClassConceptClassification::hasClassConceptTaxonomy() { return mClassConceptTaxonomy != nullptr; } CTaxonomy* CClassConceptClassification::getClassConceptTaxonomy() { return mClassConceptTaxonomy; } CClassConceptClassification* CClassConceptClassification::setClassConceptTaxonomy(CTaxonomy* taxonomy) { mClassConceptTaxonomy = taxonomy; return this; } bool CClassConceptClassification::hasClassificationStatistics() { return mStatsColl != nullptr; } CClassificationStatistics* CClassConceptClassification::getClassificationStatistics() { return mStatsColl; } CClassConceptClassification* CClassConceptClassification::setClassificationStatistics(CClassificationStatistics* statColl) { mStatsColl = statColl; return this; } bool CClassConceptClassification::hasDependentIndividualsTracking() { return mIndiDepTracking != nullptr; } CIndividualDependenceTracking* CClassConceptClassification::getDependentIndividualsTracking() { return mIndiDepTracking; } CClassConceptClassification* CClassConceptClassification::setDependentIndividualsTracking(CIndividualDependenceTracking* indiDepTracking) { mIndiDepTracking = indiDepTracking; mIndiDepTrackingSet = true; return this; } bool CClassConceptClassification::isIndividualDependentTrackingSet() { return mIndiDepTrackingSet; } }; // end namespace Classification }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/CClassificationCalculationStatisticsCollection.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/CClassificationCalculationStatisticsCo0000644000175000017500000000512612520550742032476 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFICATION_CCLASSIFICATIONCALCULATIONSTATISTICSCOLLECTION_H #define KONCLUDE_REASONER_CLASSIFICATION_CCLASSIFICATIONCALCULATIONSTATISTICSCOLLECTION_H // Libraries includes // Namespace includes #include "ClassificationSettings.h" // Other includes #include "Reasoner/Kernel/Task/CCalculationStatisticsCollector.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Kernel::Task; namespace Classification { /*! * * \class CClassificationCalculationStatisticsCollection * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationCalculationStatisticsCollection : public CLinkerBase, public CCalculationStatisticsCollector { // public methods public: //! Constructor CClassificationCalculationStatisticsCollection(); //! Destructor virtual ~CClassificationCalculationStatisticsCollection(); virtual bool addProcessingStatistics(const QString& statName, cint64 statValue); CClassificationCalculationStatisticsCollection* appendStatisticsStringNames(QSet* statNamesSet); cint64 getStatisticIntegerValue(const QString& statName); // protected methods protected: // protected variables protected: QHash mStatNameStringsValueHash; // private methods private: // private variables private: }; }; // end namespace Classification }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFICATION_CCLASSIFICATIONCALCULATIONSTATISTICSCOLLECTION_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/ClassificationSettings.h0000644000175000017500000000274412520550742027631 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFICATION_CLASSIFICATIONSETTINGS #define KONCLUDE_REASONER_CLASSIFICATION_CLASSIFICATIONSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Reasoner { namespace Classification { /*! * * \file ClassificationSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations // Custom Events >= 2000 }; // end namespace Classification }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_CLASSIFICATION_CLASSIFICATIONSETTINGS././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/CClassificationCalculationStatisticsCollection.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/CClassificationCalculationStatisticsCo0000644000175000017500000000415712520550742032501 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationCalculationStatisticsCollection.h" namespace Konclude { namespace Reasoner { namespace Classification { CClassificationCalculationStatisticsCollection::CClassificationCalculationStatisticsCollection() : CLinkerBase(this) { } CClassificationCalculationStatisticsCollection::~CClassificationCalculationStatisticsCollection() { } bool CClassificationCalculationStatisticsCollection::addProcessingStatistics(const QString& statName, cint64 statValue) { cint64 prevValue = mStatNameStringsValueHash.value(statName,0); mStatNameStringsValueHash.insert(statName,statValue+prevValue); return true; } CClassificationCalculationStatisticsCollection* CClassificationCalculationStatisticsCollection::appendStatisticsStringNames(QSet* statNamesSet) { if (statNamesSet) { foreach (QString statName, mStatNameStringsValueHash.keys()) { statNamesSet->insert(statName); } } return this; } cint64 CClassificationCalculationStatisticsCollection::getStatisticIntegerValue(const QString& statName) { return mStatNameStringsValueHash.value(statName,0); } }; // end namespace Classification }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/CClassificationStatisticsCollectionStrings.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/CClassificationStatisticsCollectionStr0000644000175000017500000000536212520550742032544 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CLASSIFICATION_CCLASSIFICATIONSTATISTICSCOLLECTIONSTRINGS_H #define KONCLUDE_REASONER_CLASSIFICATION_CCLASSIFICATIONSTATISTICSCOLLECTIONSTRINGS_H // Libraries includes // Namespace includes #include "ClassificationSettings.h" #include "CClassificationStatistics.h" #include "CClassificationCalculationStatisticsCollection.h" // Other includes #include "Reasoner/Kernel/Task/CCalculationStatisticsCollector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; namespace Classification { /*! * * \class CClassificationStatisticsCollectionStrings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationStatisticsCollectionStrings : public CClassificationStatistics { // public methods public: //! Constructor CClassificationStatisticsCollectionStrings(); //! Destructor virtual ~CClassificationStatisticsCollectionStrings(); virtual bool addProcessingStatistics(const QString& statName, cint64 statValue); CClassificationCalculationStatisticsCollection* getCalculationStatisticsCollectorLinker(); CClassificationCalculationStatisticsCollection* createCalculationStatisticsCollection(); virtual QList getStatisticsNameStringList(); virtual cint64 getStatisticIntegerValue(const QString& statName); // protected methods protected: // protected variables protected: CClassificationCalculationStatisticsCollection* mCalcStatCollLinker; bool mStatStringsCollected; QHash mStatNameStringsValueHash; QSet mStatNameStrings; // private methods private: // private variables private: }; }; // end namespace Classification }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CLASSIFICATION_CCLASSIFICATIONSTATISTICSCOLLECTIONSTRINGS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/CClassificationStatistics.cpp0000644000175000017500000000220712520550742030613 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationStatistics.h" namespace Konclude { namespace Reasoner { namespace Classification { CClassificationStatistics::CClassificationStatistics() { } CClassificationStatistics::~CClassificationStatistics() { } }; // end namespace Classification }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/CClassificationStatisticsCollectionStrings.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Classification/CClassificationStatisticsCollectionStr0000644000175000017500000000666512520550742032553 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationStatisticsCollectionStrings.h" namespace Konclude { namespace Reasoner { namespace Classification { CClassificationStatisticsCollectionStrings::CClassificationStatisticsCollectionStrings() { mCalcStatCollLinker = nullptr; mStatStringsCollected = false; } CClassificationStatisticsCollectionStrings::~CClassificationStatisticsCollectionStrings() { CClassificationCalculationStatisticsCollection* mCalcStatCollLinkerIt = mCalcStatCollLinker; while (mCalcStatCollLinkerIt) { CClassificationCalculationStatisticsCollection* tmpCalcStatCollLinker = mCalcStatCollLinkerIt; mCalcStatCollLinkerIt = mCalcStatCollLinkerIt->getNext(); delete tmpCalcStatCollLinker; } } CClassificationCalculationStatisticsCollection* CClassificationStatisticsCollectionStrings::getCalculationStatisticsCollectorLinker() { return mCalcStatCollLinker; } CClassificationCalculationStatisticsCollection* CClassificationStatisticsCollectionStrings::createCalculationStatisticsCollection() { CClassificationCalculationStatisticsCollection* tmpCalcStatCollLinker = new CClassificationCalculationStatisticsCollection(); mCalcStatCollLinker = tmpCalcStatCollLinker->append(mCalcStatCollLinker); return tmpCalcStatCollLinker; } bool CClassificationStatisticsCollectionStrings::addProcessingStatistics(const QString& statName, cint64 statValue) { mStatNameStringsValueHash.insert(statName,statValue); return true; } QList CClassificationStatisticsCollectionStrings::getStatisticsNameStringList() { if (!mStatStringsCollected) { CClassificationCalculationStatisticsCollection* mCalcStatCollLinkerIt = mCalcStatCollLinker; while (mCalcStatCollLinkerIt) { mCalcStatCollLinkerIt->appendStatisticsStringNames(&mStatNameStrings); mCalcStatCollLinkerIt = mCalcStatCollLinkerIt->getNext(); } foreach (QString statName, mStatNameStringsValueHash.keys()) { mStatNameStrings.insert(statName); } mStatStringsCollected = true; } return mStatNameStrings.toList(); } cint64 CClassificationStatisticsCollectionStrings::getStatisticIntegerValue(const QString& statName) { cint64 statValue = mStatNameStringsValueHash.value(statName,0); CClassificationCalculationStatisticsCollection* mCalcStatCollLinkerIt = mCalcStatCollLinker; while (mCalcStatCollLinkerIt) { statValue += mCalcStatCollLinkerIt->getStatisticIntegerValue(statName); mCalcStatCollLinkerIt = mCalcStatCollLinkerIt->getNext(); } return statValue; } }; // end namespace Classification }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/0000755000175000017500000000000012613407256021660 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyBuildExpressionCounter.cpp0000644000175000017500000002530012520551210030664 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyBuildExpressionCounter.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyBuildExpressionCounter::COntologyBuildExpressionCounter(COntologyContext* ontoContext) { mOntoContext = ontoContext; mConsistencyProblematicExpressionsChecked = false; mConsistencyProblematicExpressions = true; mExpCountVec = CObjectAllocator< cint64 >::allocateAndConstructArray(mOntoContext->getMemoryAllocationManager(),mExpTypeCount); resetBuildExpressionCount(); } COntologyBuildExpressionCounter* COntologyBuildExpressionCounter::referenceBuildExpressionCounter(COntologyBuildExpressionCounter* buildExpCounter) { mConsistencyProblematicExpressions = true; mConsistencyProblematicExpressionsChecked = false; if (buildExpCounter) { for (cint64 i = 0; i < mExpTypeCount; ++i) { mExpCountVec[i] = buildExpCounter->mExpCountVec[i]; } } else { resetBuildExpressionCount(); } return this; } COntologyBuildExpressionCounter* COntologyBuildExpressionCounter::resetBuildExpressionCount() { for (cint64 i = 0; i < mExpTypeCount; ++i) { mExpCountVec[i] = 0; } mMinimumMaxObjectCardinality = 0; mMaximumMaxObjectCardinality = 0; mMinimumMinObjectCardinality = 0; mMaximumMinObjectCardinality = 0; mMinimumMinDataCardinality = 0; mMaximumMinDataCardinality = 0; mMinimumMaxDataCardinality = 0; mMaximumMaxDataCardinality = 0; mRefferedBottomClassCount = 0; mRefferedBottomObjectPropertyCount = 0; mRefferedBottomDataPropertyCount = 0; return this; } cint64& COntologyBuildExpressionCounter::getBuildExpressionCount(CBuildExpression::ExpressionType expType) { return mExpCountVec[(cint64)expType]; } COntologyBuildExpressionCounter* COntologyBuildExpressionCounter::incBuildExpressionCount(CBuildExpression::ExpressionType expType, cint64 incCount) { mExpCountVec[(cint64)expType] += incCount; return this; } bool COntologyBuildExpressionCounter::hasBuildExpressions(CBuildExpression::ExpressionType expType){ return mExpCountVec[(cint64)expType] > 0; } cint64 COntologyBuildExpressionCounter::getMinimumMaxObjectCardinality() { return mMinimumMaxObjectCardinality; } cint64 COntologyBuildExpressionCounter::getMaximumMaxObjectCardinality() { return mMaximumMaxObjectCardinality; } cint64 COntologyBuildExpressionCounter::getMinimumMinObjectCardinality() { return mMinimumMinObjectCardinality; } cint64 COntologyBuildExpressionCounter::getMaximumMinObjectCardinality() { return mMaximumMinObjectCardinality; } COntologyBuildExpressionCounter* COntologyBuildExpressionCounter::setMinObjectCardinalityMinimumMaximumCandidate(cint64 cardinality) { mMaximumMinObjectCardinality = qMax(cardinality,mMaximumMinObjectCardinality); mMinimumMinObjectCardinality = qMin(cardinality,mMinimumMinObjectCardinality); return this; } COntologyBuildExpressionCounter* COntologyBuildExpressionCounter::setMaxObjectCardinalityMinimumMaximumCandidate(cint64 cardinality) { mMaximumMaxObjectCardinality = qMax(cardinality,mMaximumMaxObjectCardinality); mMinimumMaxObjectCardinality = qMin(cardinality,mMinimumMaxObjectCardinality); return this; } cint64 COntologyBuildExpressionCounter::getMinimumMaxDataCardinality() { return mMinimumMaxDataCardinality; } cint64 COntologyBuildExpressionCounter::getMaximumMaxDataCardinality() { return mMaximumMaxDataCardinality; } cint64 COntologyBuildExpressionCounter::getMinimumMinDataCardinality() { return mMinimumMinDataCardinality; } cint64 COntologyBuildExpressionCounter::getMaximumMinDataCardinality() { return mMaximumMinDataCardinality; } COntologyBuildExpressionCounter* COntologyBuildExpressionCounter::setMinDataCardinalityMinimumMaximumCandidate(cint64 cardinality) { mMaximumMinDataCardinality = qMax(cardinality,mMaximumMinDataCardinality); mMinimumMinDataCardinality = qMin(cardinality,mMinimumMinDataCardinality); return this; } COntologyBuildExpressionCounter* COntologyBuildExpressionCounter::setMaxDataCardinalityMinimumMaximumCandidate(cint64 cardinality) { mMaximumMaxDataCardinality = qMax(cardinality,mMaximumMaxDataCardinality); mMinimumMaxDataCardinality = qMin(cardinality,mMinimumMaxDataCardinality); return this; } COntologyBuildExpressionCounter* COntologyBuildExpressionCounter::incRefferedBottomClassCount(cint64 incCount) { mRefferedBottomClassCount += incCount; return this; } cint64 COntologyBuildExpressionCounter::getRefferedBottomClassCount() { return mRefferedBottomClassCount; } COntologyBuildExpressionCounter* COntologyBuildExpressionCounter::incRefferedBottomObjectPropertyCount(cint64 incCount) { mRefferedBottomObjectPropertyCount += incCount; return this; } cint64 COntologyBuildExpressionCounter::getRefferedBottomObjectPropertyCount() { return mRefferedBottomObjectPropertyCount; } COntologyBuildExpressionCounter* COntologyBuildExpressionCounter::incRefferedBottomDataPropertyCount(cint64 incCount) { mRefferedBottomDataPropertyCount += incCount; return this; } cint64 COntologyBuildExpressionCounter::getRefferedBottomDataPropertyCount() { return mRefferedBottomDataPropertyCount; } bool COntologyBuildExpressionCounter::hasConsistencyProblematicExpressions() { if (!mConsistencyProblematicExpressionsChecked) { mConsistencyProblematicExpressions = false; if (hasBuildExpressions(CBuildExpression::BETDISJOINTCLASSES)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETDISJOINTUNION)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETOBJECTCOMPLEMENTOF)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETDISJOINTOBJECTPROPERTIES)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETIRREFLEXIVEPROPERTY)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETASYMMETRICPROPERTY)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETDIFFERENTINDIVIDUAL)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETNEGATIVEOBJECTPROPERTYASSERTION)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETDISJOINTDATAPROPERTIES)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETDATASOMEVALUEFROM)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETDATAHASVALUE)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETDATAMINCARDINALITY)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETDATAEXACTCARDINALITY)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETDATASOMEVALUEFROM)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETNEGATIVEDATAPROPERTYASSERTION)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETDATAPROPERTYASSERTION)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETINDIVIDUALVARIABLE)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETRULECLASSATOM)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETRULEPROPERTYATOM)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETRULEDIFFERENTINDIVIDUALSATOM)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETRULEATOMBODYLIST)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETRULEATOMHEADLIST)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETOBJECTEXACTLYCARDINALITY) || hasBuildExpressions(CBuildExpression::BETOBJECTMAXCARDINALITY)) { if (getMinimumMaxObjectCardinality() <= 0) { mConsistencyProblematicExpressions = true; } } if (hasBuildExpressions(CBuildExpression::BETOBJECTMINCARDINALITY) || hasBuildExpressions(CBuildExpression::BETOBJECTEXACTLYCARDINALITY)) { if (getMaximumMinObjectCardinality() < 0) { mConsistencyProblematicExpressions = true; } if (getMaximumMinObjectCardinality() > 1) { if (hasBuildExpressions(CBuildExpression::BETFUNCTIONALPROPERTYOF)) { mConsistencyProblematicExpressions = true; } if (hasBuildExpressions(CBuildExpression::BETFUNCTIONALPROPERTYOF)) { mConsistencyProblematicExpressions = true; } } if (hasBuildExpressions(CBuildExpression::BETOBJECTEXACTLYCARDINALITY) || hasBuildExpressions(CBuildExpression::BETOBJECTMAXCARDINALITY)) { if (getMaximumMinObjectCardinality() > getMinimumMaxObjectCardinality()) { mConsistencyProblematicExpressions = true; } } } if (getRefferedBottomClassCount() > 0) { mConsistencyProblematicExpressions = true; } if (getRefferedBottomClassCount() > 0) { mRefferedBottomObjectPropertyCount = true; } if (getRefferedBottomClassCount() > 0) { mRefferedBottomDataPropertyCount = true; } mConsistencyProblematicExpressionsChecked = true; } return mConsistencyProblematicExpressions; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntology.cpp0000644000175000017500000000265012520551210024267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntology.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntology::COntology() { } COntology::~COntology() { } QString COntology::getOntologyName() { return getTerminologyName(); } COntology *COntology::setOntologyName(const QString &name) { setTerminologyName(name); return this; } qint64 COntology::getOntologyID() const { return getTerminologyID(); } COntology *COntology::setOntologyID(qint64 id) { setTerminologyID(id); return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CTagItem.cpp0000644000175000017500000000237712520551214024021 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTagItem.h" namespace Konclude { namespace Reasoner { namespace Ontology { CTagItem::CTagItem(cint64 tag) { mTag = tag; } CTagItem* CTagItem::setTag(cint64 tag) { mTag = tag; return this; } CTagItem* CTagItem::initTag(cint64 tag) { mTag = tag; return this; } cint64 CTagItem::getTag() const { return mTag; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualBackendCachingData.h0000644000175000017500000000331312520551206027533 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALBACKENDCACHINGDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALBACKENDCACHINGDATA_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CIndividualBackendCachingData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualBackendCachingData { // public methods public: //! Constructor CIndividualBackendCachingData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALBACKENDCACHINGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceCompareTriggers.cpp0000644000175000017500000001213212520551200031212 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceCompareTriggers.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceCompareTriggers::CDatatypeValueSpaceCompareTriggers(CBoxContext* boxContext) : CDatatypeValueSpaceTriggers(boxContext),mValueTriggerMap(boxContext) { } CDatatypeValueSpaceCompareTriggers* CDatatypeValueSpaceCompareTriggers::initValueSpaceCompareTriggers(CDatatypeValueSpaceCompareTriggers* data) { initValueSpaceTriggers(data); if (data) { mValueTriggerMap.initValueSpaceTriggeringMap(&data->mValueTriggerMap); } else { mValueTriggerMap.initValueSpaceTriggeringMap(nullptr); } return this; } CDatatypeValueSpaceCompareTriggers* CDatatypeValueSpaceCompareTriggers::addValueConceptTrigger(CDataLiteralCompareValue* value, CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger) { incConceptTriggerCount(conceptTrigger->getCount()); CDatatypeValueSpaceConceptTriggeringData* valueConceptTriggerData = getValueConceptTriggeringData(value); valueConceptTriggerData->appendPartialConceptTriggers(conceptTrigger); return this; } CDatatypeValueSpaceCompareTriggers* CDatatypeValueSpaceCompareTriggers::addMinValueConceptTrigger(CDataLiteralCompareValue* value, bool inclusive, CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger) { incConceptTriggerCount(conceptTrigger->getCount()); CDatatypeValueSpaceConceptTriggeringData* minValueConceptTriggerData = getMinValueConceptTriggeringData(value,inclusive); minValueConceptTriggerData->appendPartialConceptTriggers(conceptTrigger); return this; } CDatatypeValueSpaceCompareTriggers* CDatatypeValueSpaceCompareTriggers::addMaxValueConceptTrigger(CDataLiteralCompareValue* value, bool inclusive, CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger) { incConceptTriggerCount(conceptTrigger->getCount()); CDatatypeValueSpaceConceptTriggeringData* maxValueConceptTriggerData = getMaxValueConceptTriggeringData(value,inclusive); maxValueConceptTriggerData->appendPartialConceptTriggers(conceptTrigger); return this; } CDatatypeValueSpaceCompareTriggers* CDatatypeValueSpaceCompareTriggers::addMinMaxValueConceptTrigger(CDataLiteralCompareValue* value, bool minRestriction, bool inclusive, CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger) { if (minRestriction) { return addMinValueConceptTrigger(value,inclusive,conceptTrigger); } else { return addMaxValueConceptTrigger(value,inclusive,conceptTrigger); } } CDatatypeValueSpaceTriggeringMap* CDatatypeValueSpaceCompareTriggers::getValueSpaceTriggeringMap() { return &mValueTriggerMap; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceCompareTriggers::getValueConceptTriggeringData(CDataLiteralCompareValue* value, bool createOrLocalize) { CDatatypeValueSpaceConceptTriggeringData* conTriggerData = nullptr; CDatatypeValueSpaceTriggeringData* valueSpaceTriggerData = mValueTriggerMap.getDatatypeValueTriggeringData(value,createOrLocalize); if (valueSpaceTriggerData) { conTriggerData = valueSpaceTriggerData->getDirectValueTriggeringData(); } return conTriggerData; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceCompareTriggers::getMinValueConceptTriggeringData(CDataLiteralCompareValue* value, bool inclusive, bool createOrLocalize) { CDatatypeValueSpaceConceptTriggeringData* conTriggerData = nullptr; CDatatypeValueSpaceTriggeringData* valueSpaceTriggerData = mValueTriggerMap.getDatatypeValueTriggeringData(value,createOrLocalize); if (valueSpaceTriggerData) { conTriggerData = valueSpaceTriggerData->getTriggeringData(true,inclusive); } return conTriggerData; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceCompareTriggers::getMaxValueConceptTriggeringData(CDataLiteralCompareValue* value, bool inclusive, bool createOrLocalize) { CDatatypeValueSpaceConceptTriggeringData* conTriggerData = nullptr; CDatatypeValueSpaceTriggeringData* valueSpaceTriggerData = mValueTriggerMap.getDatatypeValueTriggeringData(value,createOrLocalize); if (valueSpaceTriggerData) { conTriggerData = valueSpaceTriggerData->getTriggeringData(false,inclusive); } return conTriggerData; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleVector.cpp0000644000175000017500000000224212520551214024542 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleVector.h" namespace Konclude { namespace Reasoner { namespace Ontology { CRoleVector::CRoleVector(CBoxContext* boxContext) : CDefaultDynamicReferenceVectorBase(boxContext) { } CRoleVector::~CRoleVector() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CNominalSchemaTemplateVector.h0000644000175000017500000000416512520551210027522 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CNOMINALSCHEMATEMPLATEVECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CNOMINALSCHEMATEMPLATEVECTOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CNominalSchemaTemplate.h" #include "CBoxContext.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CNominalSchemaTemplateVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNominalSchemaTemplateVector : public CDefaultDynamicReferenceVectorBase { // public methods public: //! Constructor CNominalSchemaTemplateVector(CBoxContext* boxContext = nullptr); //! Destructor virtual ~CNominalSchemaTemplateVector(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CNOMINALSCHEMATEMPLATEVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralDateTimeValue.cpp0000644000175000017500000001506612520551176027275 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralDateTimeValue.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDataLiteralDateTimeValue::CDataLiteralDateTimeValue() { clearValue(); } CDataLiteralValue::DATA_LITERAL_VALUE_TYPE CDataLiteralDateTimeValue::getDataValueType() { return CDataLiteralValue::DLVT_DATETIME; } CDataLiteralCompareValue* CDataLiteralDateTimeValue::initValue(CDataLiteralCompareValue* value) { clearValue(); CDataLiteralDateTimeValue* dateTimeValue = dynamic_cast(value); if (dateTimeValue) { mFirstDateTime = dateTimeValue->mFirstDateTime; mLastDateTime = dateTimeValue->mLastDateTime; mDateTimeValue = dateTimeValue->mDateTimeValue; mZoneOffset = dateTimeValue->mZoneOffset; } return this; } CDataLiteralDateTimeValue* CDataLiteralDateTimeValue::initValueFromFirstDateTime() { clearValue(); mFirstDateTime = true; return this; } CDataLiteralDateTimeValue* CDataLiteralDateTimeValue::initValueFromLastDateTime() { clearValue(); mLastDateTime = true; return this; } CDataLiteralDateTimeValue* CDataLiteralDateTimeValue::initValueFromDataTime(const QDateTime& dateTime, cint64 zoneOffset) { clearValue(); mDateTimeValue = dateTime; mZoneOffset = zoneOffset; return this; } CDataLiteralDateTimeValue* CDataLiteralDateTimeValue::initValue(CDataLiteralDateTimeValue* value) { if (value) { mFirstDateTime = value->mFirstDateTime; mLastDateTime = value->mLastDateTime; mDateTimeValue = value->mDateTimeValue; mZoneOffset = value->mZoneOffset; } return this; } CDataLiteralDateTimeValue* CDataLiteralDateTimeValue::clearValue() { mFirstDateTime = false; mLastDateTime = false; mDateTimeValue = QDateTime(); mZoneOffset = 0; return this; } bool CDataLiteralDateTimeValue::isFirstDateTime() { return mFirstDateTime; } bool CDataLiteralDateTimeValue::isLastDateTime() { return mLastDateTime; } QDateTime CDataLiteralDateTimeValue::getDateTimeValue() { return mDateTimeValue; } cint64 CDataLiteralDateTimeValue::getTimeZoneOffset() { return mZoneOffset; } bool CDataLiteralDateTimeValue::isEqualTo(CDataLiteralValue* value) { CDataLiteralDateTimeValue* dateTimeValue = dynamic_cast(value); if (dateTimeValue) { return isEqualTo(dateTimeValue); } return false; } bool CDataLiteralDateTimeValue::isLessEqualThan(CDataLiteralCompareValue* value) { CDataLiteralDateTimeValue* dateTimeValue = dynamic_cast(value); if (dateTimeValue) { return isEqualTo(dateTimeValue) || isLessThan(dateTimeValue); } return false; } bool CDataLiteralDateTimeValue::isLessEqualThan(CDataLiteralDateTimeValue* dateTimeValue) { return isEqualTo(dateTimeValue) || isLessThan(dateTimeValue); } bool CDataLiteralDateTimeValue::isEqualTo(CDataLiteralCompareValue* value) { CDataLiteralDateTimeValue* dateTimeValue = dynamic_cast(value); if (dateTimeValue) { return isEqualTo(dateTimeValue); } return false; } bool CDataLiteralDateTimeValue::isEqualTo(CDataLiteralDateTimeValue* dateTimeValue) { if (mFirstDateTime && dateTimeValue->mFirstDateTime) { return true; } if (mFirstDateTime || dateTimeValue->mFirstDateTime) { return false; } if (mLastDateTime && dateTimeValue->mLastDateTime) { return true; } if (mLastDateTime || dateTimeValue->mLastDateTime) { return false; } if (mDateTimeValue == dateTimeValue->mDateTimeValue && mZoneOffset == dateTimeValue->mZoneOffset) { return true; } return false; } bool CDataLiteralDateTimeValue::isGreaterEqualThan(CDataLiteralDateTimeValue* dateTimeValue) { return isEqualTo(dateTimeValue) || isGreaterThan(dateTimeValue); } bool CDataLiteralDateTimeValue::isGreaterEqualThan(CDataLiteralCompareValue* value) { CDataLiteralDateTimeValue* dateTimeValue = dynamic_cast(value); if (dateTimeValue) { return isEqualTo(dateTimeValue) || isGreaterThan(dateTimeValue); } return false; } bool CDataLiteralDateTimeValue::isGreaterThan(CDataLiteralCompareValue* value) { return value->isLessThan(this); } bool CDataLiteralDateTimeValue::isGreaterThan(CDataLiteralDateTimeValue* dateTimeValue) { return dateTimeValue->isLessThan(this); } bool CDataLiteralDateTimeValue::isLessThan(CDataLiteralCompareValue* value) { CDataLiteralDateTimeValue* dateTimeValue = dynamic_cast(value); if (dateTimeValue) { return isLessThan(dateTimeValue); } return false; } bool CDataLiteralDateTimeValue::incrementDateTimeValue() { if (mFirstDateTime || mLastDateTime) { return false; } if (mZoneOffset >= 840) { QDateTime tmpDateTime = mDateTimeValue.addSecs(1); if (!tmpDateTime.isValid()) { return false; } mDateTimeValue = tmpDateTime; mZoneOffset = -840; } else { mZoneOffset++; } return true; } bool CDataLiteralDateTimeValue::isLessThan(CDataLiteralDateTimeValue* dateTimeValue) { if (!mLastDateTime && dateTimeValue->mLastDateTime) { return true; } if (mLastDateTime) { return false; } if (dateTimeValue->mFirstDateTime) { return false; } if (mFirstDateTime) { return true; } if (mDateTimeValue < dateTimeValue->mDateTimeValue) { return true; } if (mDateTimeValue > dateTimeValue->mDateTimeValue) { return false; } return mZoneOffset < dateTimeValue->mZoneOffset; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralBooleanValue.h0000644000175000017500000000546612520551176026630 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATALITERALBOOLEANVALUE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATALITERALBOOLEANVALUE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDataLiteralValue.h" #include "CDataLiteralCompareValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataLiteralBooleanValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralBooleanValue : public CDataLiteralCompareValue { // public methods public: //! Constructor CDataLiteralBooleanValue(); virtual CDataLiteralCompareValue* initValue(CDataLiteralCompareValue* value); CDataLiteralBooleanValue* initValueFromBoolean(bool boolean); CDataLiteralBooleanValue* initValue(CDataLiteralBooleanValue* value); CDataLiteralBooleanValue* clearValue(); virtual DATA_LITERAL_VALUE_TYPE getDataValueType(); bool getBoolean(); bool isEqualTo(CDataLiteralValue* value); bool isLessEqualThan(CDataLiteralCompareValue* value); bool isLessThan(CDataLiteralCompareValue* value); bool isEqualTo(CDataLiteralCompareValue* value); bool isGreaterEqualThan(CDataLiteralCompareValue* value); bool isGreaterThan(CDataLiteralCompareValue* value); bool isLessEqualThan(CDataLiteralBooleanValue* value); bool isLessThan(CDataLiteralBooleanValue* value); bool isEqualTo(CDataLiteralBooleanValue* value); bool isGreaterEqualThan(CDataLiteralBooleanValue* value); bool isGreaterThan(CDataLiteralBooleanValue* value); // protected methods protected: // protected variables protected: bool mBoolean; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATALITERALBOOLEANVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStepDataVector.cpp0000644000175000017500000000435112520551212031137 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyProcessingStepDataVector.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyProcessingStepDataVector::COntologyProcessingStepDataVector(COntologyContext* context) { mContext = context; mPrStepVector = COntologyProcessingStepVector::getProcessingStepVectorInstance(); CMemoryAllocationManager* memMan = mContext->getMemoryAllocationManager(); cint64 stepCount = mPrStepVector->getProcessingStepCount(); mPrStCount = stepCount; mPrStepDataVector = CObjectAllocator::allocateArray(memMan,stepCount); for (cint64 i = 0; i < stepCount; ++i) { COntologyProcessingStepData* stepData = CObjectParameterizingAllocator< COntologyProcessingStepData,COntologyContext* >::allocateAndConstructAndParameterize(memMan,mContext); stepData->initProcessingStepData(mPrStepVector->getProcessingStep(i)); mPrStepDataVector[i] = stepData; } } COntologyProcessingStepData* COntologyProcessingStepDataVector::getProcessingStepData(cint64 stepID) { if (stepID < 0 || stepID >= mPrStCount) { return nullptr; } return mPrStepDataVector[stepID]; } COntologyProcessingStepData* COntologyProcessingStepDataVector::getProcessingStepData(COntologyProcessingStep::PROCESSINGSTEPTYPE stepType) { return getProcessingStepData((cint64)stepType); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleChain.h0000644000175000017500000000531012520551214023766 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CROLECHAIN_H #define KONCLUDE_REASONER_ONTOLOGY_CROLECHAIN_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CTagItem.h" #include "CRole.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CRoleChain * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleChain : public CTagItem { // public methods public: //! Constructor CRoleChain(); virtual ~CRoleChain(); CRoleChain* initRoleChain(); CRoleChain* setRoleChainTag(qint64 roleChainTag); qint64 getRoleChainTag(); CRoleChain* setTerminology(CTerminology* ontology); CTerminology* getTerminology(); qint64 getTerminologyTag() const; CXLinker* getRoleChainLinker(); CRoleChain* appendRoleChainLinker(CXLinker* roleChainLinker); CRoleChain* prependRoleChainLinker(CXLinker* roleChainLinker); CRoleChain* setRoleChainLinker(CXLinker* roleChainLinker); CXLinker* getInverseRoleChainLinker(); CRoleChain* appendInverseRoleChainLinker(CXLinker* roleChainLinker); CRoleChain* prependInverseRoleChainLinker(CXLinker* roleChainLinker); CRoleChain* setInverseRoleChainLinker(CXLinker* roleChainLinker); // protected methods protected: // protected variables protected: CTerminology *mTerm; CXLinker* mRoleChainLinker; CXLinker* mInverseRoleChainLinker; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CROLECHAIN_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualBackendCachingData.cpp0000644000175000017500000000210112520551206030060 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualBackendCachingData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CIndividualBackendCachingData::CIndividualBackendCachingData() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleChain.cpp0000644000175000017500000000667512520551214024340 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleChain.h" namespace Konclude { namespace Reasoner { namespace Ontology { CRoleChain::CRoleChain() { } CRoleChain::~CRoleChain() { } CRoleChain* CRoleChain::initRoleChain() { mTerm = nullptr; mTag = 0; mRoleChainLinker = nullptr; mInverseRoleChainLinker = nullptr; return this; } CRoleChain* CRoleChain::setRoleChainTag(qint64 roleChainTag) { mTag = roleChainTag; return this; } qint64 CRoleChain::getRoleChainTag() { return mTag; } CRoleChain* CRoleChain::setTerminology(CTerminology* ontology) { mTerm = ontology; return this; } CTerminology* CRoleChain::getTerminology() { return mTerm; } qint64 CRoleChain::getTerminologyTag() const { cint64 termTag = 0; if (mTerm) { termTag = mTerm->getTerminologyID(); } return termTag; } CXLinker* CRoleChain::getRoleChainLinker() { return mRoleChainLinker; } CRoleChain* CRoleChain::appendRoleChainLinker(CXLinker* roleChainLinker) { if (roleChainLinker) { if (!mRoleChainLinker) { mRoleChainLinker = roleChainLinker; } else { mRoleChainLinker->append(roleChainLinker); } } return this; } CRoleChain* CRoleChain::prependRoleChainLinker(CXLinker* roleChainLinker) { if (roleChainLinker) { if (!mRoleChainLinker) { mRoleChainLinker = roleChainLinker; } else { mRoleChainLinker = roleChainLinker->append(mRoleChainLinker); } } return this; } CRoleChain* CRoleChain::setRoleChainLinker(CXLinker* roleChainLinker) { mRoleChainLinker = roleChainLinker; return this; } CXLinker* CRoleChain::getInverseRoleChainLinker() { return mInverseRoleChainLinker; } CRoleChain* CRoleChain::appendInverseRoleChainLinker(CXLinker* roleChainLinker) { if (roleChainLinker) { if (!mInverseRoleChainLinker) { mInverseRoleChainLinker = roleChainLinker; } else { mInverseRoleChainLinker->append(roleChainLinker); } } return this; } CRoleChain* CRoleChain::prependInverseRoleChainLinker(CXLinker* roleChainLinker) { if (roleChainLinker) { if (!mInverseRoleChainLinker) { mInverseRoleChainLinker = roleChainLinker; } else { mInverseRoleChainLinker = roleChainLinker->append(mInverseRoleChainLinker); } } return this; } CRoleChain* CRoleChain::setInverseRoleChainLinker(CXLinker* roleChainLinker) { mInverseRoleChainLinker = roleChainLinker; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringIterator.h0000644000175000017500000000626312520551204031411 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDatatypeValueSpaceTriggeringIterator_H #define KONCLUDE_REASONER_ONTOLOGY_CDatatypeValueSpaceTriggeringIterator_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceTriggeringMapArranger.h" #include "CDatatypeValueSpaceTriggeringMapData.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceTriggeringIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceTriggeringIterator { // public methods public: //! Constructor CDatatypeValueSpaceTriggeringIterator(const CBOXMAP::const_iterator beginIt, const CBOXMAP::const_iterator endIt, bool upIteration = true); CDatatypeValueSpaceTriggeringIterator(const CBOXMAP::const_iterator beginIt, const CBOXMAP::const_iterator lastIt, const CBOXMAP::const_iterator endIt, bool upIteration = true); bool hasNext(); CDatatypeValueSpaceTriggeringData* next(bool moveNext = true); // protected methods protected: // protected variables protected: CBOXMAP::const_iterator mBegIt; CBOXMAP::const_iterator mCurIt; CBOXMAP::const_iterator mEndIt; CBOXMAP::const_iterator mLastIt; bool mUpIteration; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDatatypeValueSpaceTriggeringIterator_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConcept.h0000644000175000017500000001247612520551174023535 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPT_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPT_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CRole.h" #include "CTerminology.h" #include "CName.h" #include "CTagItem.h" #include "CNamedItem.h" #include "CConceptData.h" #include "CVariable.h" #include "CConceptOperator.h" #include "CDataLiteral.h" // Other includes #include "Utilities/CSortedNegLinker.hpp" #include "Utilities/CAllocationObject.h" #include "Utilities/CMemoryManager.hpp" #include "Utilities/CLinker.hpp" #include "Utilities/CSortedLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CConcept * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcept : public CTagItem, public CNamedItem, public CAllocationObject { // public methods public: //! Constructor CConcept(); CConcept* initConcept(); CConcept *initConceptCopy(CConcept *concept, CMemoryAllocationManager* memMan = nullptr); CConcept *setConceptTag(qint64 conTag); qint64 getConceptTag() const; CConcept *setOperatorCode(qint64 opCode); qint64 getOperatorCode(); CConceptOperator* getConceptOperator(); CConcept *setTerminology(CTerminology *terminology); CTerminology *getTerminology(); qint64 getTerminologyTag() const; QPair getTerminologyConceptTagPair(); CConcept *setParameter(qint64 parameter); qint64 getParameter(); CConcept *setOperandCount(qint64 count); qint64 getOperandCount(); CConcept* incOperandCount(cint64 incCount = 1); CConcept *setOperandList(CSortedNegLinker *operandList); CConcept *addOperandLinker(CSortedNegLinker *operandLinker); CSortedNegLinker *getOperandList(); CConcept *setRole(CRole *role); CRole *getRole(); CVariable* getVariable(); CSortedLinker* getVariableLinker(); CConcept* setVariableLinker(CSortedLinker* variableLinker); CConcept* addVariableLinker(CSortedLinker* variableLinker); bool hasClassName(); CConcept *setClassNameLinker(CLinker *conceptNameLinker); CConcept *addClassNameLinker(CLinker *conceptNameLinker); CLinker *getClassNameLinker(); bool hasOperandConceptTag(CConcept *concept); bool hasOperandConceptTag(qint64 conceptTag); bool hasOperandConceptTag(CConcept *concept, bool negation); bool hasOperandConceptTag(qint64 conceptTag, bool negation); bool hasOperandConcept(CConcept *concept, bool negation); bool hasOperandConcept(CConcept *concept); CIndividual* getNominalIndividual(); CConcept* setNominalIndividual(CIndividual* nominalIndividual); bool hasNominalIndividual(); bool hasConceptData(); CConceptData* getConceptData(); CConcept* setConceptData(CConceptData* conceptData); bool hasMappingNegation(); CConcept* setMappingNegation(bool negation); CDataLiteral* getDataLiteral(); CConcept* setDataLiteral(CDataLiteral* dataLiteral); CDatatype* getDatatype(); CConcept* setDatatype(CDatatype* datatype); // deprecated CConcept *init(qint64 conTag); CConcept *init(CConcept *concept); CConcept *setOperatorTag(qint64 opTag); qint64 getDefinitionOperatorTag(); qint64 getProcessingOperatorTag(); bool operator<=(const CConcept &concept); bool operator==(const CConcept &concept); bool isGeneratingOperator(bool negated = false); bool isNegatedGeneratingOperator(); bool isNonGeneratingOperator(); bool isEqualsToBOTTOM(bool negated = false); bool isEqualsToTOP(bool negated = false); // protected methods protected: // protected variables protected: CTerminology *tax; CConceptOperator* mOperatorCode; qint64 opParameter; qint64 operandCount; CRole *operatorRole; CSortedNegLinker *operands; CIndividual* mNominalIndiviual; CSortedLinker* mVariableLinker; CDataLiteral* mDataLiteral; CDatatype* mDatatype; CConceptData* mConceptData; bool mMappingNegated; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceXMLType.h0000644000175000017500000000442712520551204027100 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEXMLTYPE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEXMLTYPE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareType.h" #include "CDataLiteralXMLValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceXMLType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceXMLType : public CDatatypeValueSpaceCompareType { // public methods public: //! Constructor CDatatypeValueSpaceXMLType(); CDataLiteralXMLValue* getMinimumDataLiteralXMLValue(); CDataLiteralXMLValue* getMaximumDataLiteralXMLValue(); virtual CDataLiteralCompareValue* getMinimumDataLiteralCompareValue(); virtual CDataLiteralCompareValue* getMaximumDataLiteralCompareValue(); virtual bool hasInfiniteManyValues(); virtual cint64 getMaximumValueCount(); // protected methods protected: // protected variables protected: CDataLiteralXMLValue* mMinValue; CDataLiteralXMLValue* mMaxValue; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEXMLTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingRequirement.h0000644000175000017500000000404612520551212030215 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGREQUIREMENT_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGREQUIREMENT_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyProcessingRequirement * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyProcessingRequirement { // public methods public: //! Constructor COntologyProcessingRequirement(); virtual bool isRequirementSatisfied(COntology* ontology) = 0; virtual COntologyProcessingRequirement* submitRequirementUpdate(cint64 processingFlags, cint64 errorFlags) = 0; virtual const QString getRequirementFailureString(COntology* ontology) = 0; virtual bool isDynamicRequirement(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGREQUIREMENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptCycleData.cpp0000644000175000017500000000627512520551174025642 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptCycleData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptCycleData::CConceptCycleData(CContext* context) : mContext(context),mCycleConceptSet(context) { } cint64 CConceptCycleData::getCycleID() { return mCycleID; } CConceptCycleData* CConceptCycleData::setCycleID(cint64 cycleID) { mCycleID = cycleID; return this; } CConceptCycleData* CConceptCycleData::initConceptCycleData(CConceptCycleData* prevData) { if (prevData) { mCycleID = prevData->mCycleID; mCycleConceptSet = prevData->mCycleConceptSet; mRepCycleClass = prevData->mRepCycleClass; mNominalConnection = prevData->mNominalConnection; } else { mCycleID = 0; mCycleConceptSet.clear(); mRepCycleClass = nullptr; mNominalConnection = false; } return this; } cint64 CConceptCycleData::getConceptCount() { return mCycleConceptSet.count(); } CBOXSET* CConceptCycleData::getCycleConceptSet() { return &mCycleConceptSet; } CConceptCycleData* CConceptCycleData::addCycleConcept(CConcept* concept, bool negation) { addCycleConcept(TConceptNegPair(concept,negation)); return this; } CConceptCycleData* CConceptCycleData::addCycleConcept(const TConceptNegPair& conNegPair) { mCycleConceptSet.insert(conNegPair); CConcept* concept = conNegPair.first; bool conNeg = conNegPair.second; if (!conNeg && concept->hasClassName()) { mCycleClassSet.insert(concept); if (!mRepCycleClass) { mRepCycleClass = concept; } } return this; } CConceptCycleData* CConceptCycleData::addCycleConcepts(const QSet& conNegPairSet) { for (QSet::const_iterator it = conNegPairSet.constBegin(), itEnd = conNegPairSet.constEnd(); it != itEnd; ++it) { addCycleConcept(*it); } return this; } CBOXSET* CConceptCycleData::getCycleClassSet() { return &mCycleClassSet; } CConcept* CConceptCycleData::getRepresentativeCycleClass() { return mRepCycleClass; } bool CConceptCycleData::hasNominalConnection() { return mNominalConnection; } CConceptCycleData* CConceptCycleData::setNominalConnection(bool nominalConnection) { mNominalConnection = nominalConnection; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralBinaryBase64DataValue.h0000644000175000017500000000371712520551176030231 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATALITERALBINARYBASE64DATAVALUE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATALITERALBINARYBASE64DATAVALUE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDataLiteralValue.h" #include "CDataLiteralBinaryDataValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataLiteralBinaryBase64DataValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralBinaryBase64DataValue : public CDataLiteralBinaryDataValue { // public methods public: //! Constructor CDataLiteralBinaryBase64DataValue(CContext* context); virtual DATA_LITERAL_VALUE_TYPE getDataValueType(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATALITERALBINARYBASE64DATAVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CReplacementData.h0000644000175000017500000000454212520551214025161 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CReplacementData_H #define KONCLUDE_REASONER_ONTOLOGY_CReplacementData_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CConcept.h" // Other includes #include "Utilities/Container/CNegLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CReplacementData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReplacementData { // public methods public: //! Constructor CReplacementData(); CConcept* getImplicationReplacementConcept(); CXNegLinker* getCommonDisjunctConceptLinker(); CReplacementData* setImplicationReplacementConcept(CConcept* implConcept); CReplacementData* setCommonDisjunctConceptLinker(CXNegLinker* conLinker); CReplacementData* addCommonDisjunctConceptLinker(CXNegLinker* conLinker); CReplacementData* initReplacementData(CReplacementData* replData); CReplacementData* clearCommonDisjunctConceptLinker(); // protected methods protected: // protected variables protected: CConcept* mImplicationReplacementConcept; CXNegLinker* mCommDisjConLinker; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CReplacementData_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptCycleData.h0000644000175000017500000000542312520551174025301 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTCYCLEDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTCYCLEDATA_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CConcept.h" // Other includes #include "Utilities/Container/CNegLinker.h" #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; using namespace Context; namespace Reasoner { namespace Ontology { typedef QPair TConceptNegPair; /*! * * \class CConceptCycleData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptCycleData { // public methods public: //! Constructor CConceptCycleData(CContext* context = nullptr); CConceptCycleData* initConceptCycleData(CConceptCycleData* prevData = nullptr); cint64 getCycleID(); CConceptCycleData* setCycleID(cint64 cycleID); cint64 getConceptCount(); CBOXSET* getCycleConceptSet(); CConceptCycleData* addCycleConcept(CConcept* concept, bool negation); CConceptCycleData* addCycleConcept(const TConceptNegPair& conNegPair); CConceptCycleData* addCycleConcepts(const QSet& conNegPairSet); CBOXSET* getCycleClassSet(); CConcept* getRepresentativeCycleClass(); bool hasNominalConnection(); CConceptCycleData* setNominalConnection(bool nominalConnection); // protected methods protected: // protected variables protected: CContext* mContext; cint64 mCycleID; bool mNominalConnection; CBOXSET mCycleConceptSet; CBOXSET mCycleClassSet; CConcept* mRepCycleClass; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTCYCLEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h0000644000175000017500000000625612520551176031535 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATURATIONREFERENCELINKINGDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATURATIONREFERENCELINKINGDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CConceptSatisfiableReferenceLinkingData.h" // Other includes #include "Reasoner/Consistiser/CSaturationConceptReferenceLinking.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Consistiser; namespace Ontology { /*! * * \class CConceptSaturationReferenceLinkingData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptSaturationReferenceLinkingData : public CConceptSatisfiableReferenceLinkingData { // public methods public: //! Constructor CConceptSaturationReferenceLinkingData(); CSaturationConceptReferenceLinking* getPositiveConceptSaturationReferenceLinkingData(); CConceptSaturationReferenceLinkingData* setPositiveSaturationReferenceLinkingData(CSaturationConceptReferenceLinking* satConRefLinking); CSaturationConceptReferenceLinking* getNegativeConceptSaturationReferenceLinkingData(); CConceptSaturationReferenceLinkingData* setNegativeSaturationReferenceLinkingData(CSaturationConceptReferenceLinking* satConRefLinking); CConceptSaturationReferenceLinkingData* setSaturationReferenceLinkingData(CSaturationConceptReferenceLinking* satConRefLinking, bool negated); CSaturationConceptReferenceLinking* getConceptSaturationReferenceLinkingData(bool negated); CSaturationConceptReferenceLinking* getExistentialSuccessorConceptSaturationReferenceLinkingData(); CConceptSaturationReferenceLinkingData* setExistentialSuccessorConceptSaturationReferenceLinkingData(CSaturationConceptReferenceLinking* satConRefLinking); // protected methods protected: // protected variables protected: CSaturationConceptReferenceLinking* mPositiveSatConRefLinking; CSaturationConceptReferenceLinking* mNegativeSatConRefLinking; CSaturationConceptReferenceLinking* mExistentialSuccessorSatConRefLinking; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATURATIONREFERENCELINKINGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceFloatType.h0000644000175000017500000000446112520551202027501 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEFLOATTYPE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEFLOATTYPE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareType.h" #include "CDataLiteralFloatValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceFloatType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceFloatType : public CDatatypeValueSpaceCompareType { // public methods public: //! Constructor CDatatypeValueSpaceFloatType(); CDataLiteralFloatValue* getMinimumDataLiteralFloatValue(); CDataLiteralFloatValue* getMaximumDataLiteralFloatValue(); virtual CDataLiteralCompareValue* getMinimumDataLiteralCompareValue(); virtual CDataLiteralCompareValue* getMaximumDataLiteralCompareValue(); virtual bool hasInfiniteManyValues(); virtual cint64 getMaximumValueCount(); // protected methods protected: // protected variables protected: CDataLiteralFloatValue* mMinValue; CDataLiteralFloatValue* mMaxValue; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEFLOATTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRole.h0000644000175000017500000001675412520551214023041 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CROLE_H #define KONCLUDE_REASONER_ONTOLOGY_CROLE_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CConcept.h" #include "CTerminology.h" #include "CName.h" #include "CTagItem.h" #include "CNamedItem.h" #include "CRoleChain.h" #include "CRoleData.h" // Other includes #include "Utilities/CSortedNegLinker.hpp" #include "Utilities/CMemoryManager.hpp" #include "Utilities/CLinker.hpp" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CRole * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRole : public CTagItem, public CNamedItem { // public methods public: //! Constructor CRole(); //! Destructor virtual ~CRole(); CRole *initRole(); CRole *initRoleCopy(CRole *role, CMemoryAllocationManager* memMan); CRole *setRoleTag(qint64 roleTag); qint64 getRoleTag() const; CRole *setTerminology(CTerminology *ontology); CTerminology *getTerminology(); qint64 getTerminologyTag() const; bool hasPropertyName(); CRole *setPropertyNameLinker(CLinker *propertyNameLinker); CRole *addPropertyNameLinker(CLinker *propertyNameLinker); CLinker *getPropertyNameLinker(); CRole* getInverseRole(); CRole* setInverseRole(CRole* inverseRole); bool isDataRole(); bool isObjectRole(); CRole* setDataRole(bool dataRole); CRole* setObjectRole(bool objectRole); // domain and range methods CSortedNegLinker *getRelativeRangeConceptList(bool roleInversed); CSortedNegLinker *getDomainRangeConceptList(bool roleInversed); CSortedNegLinker *getRangeConceptList(); CRole *setRangeConceptList(CSortedNegLinker *rangeConceptList); CRole *addRangeConceptLinker(CSortedNegLinker *rangeConceptLinker); bool hasRangeConceptTag(qint64 rangeConceptTag); bool hasRangeConcept(CConcept* concept); CSortedNegLinker *getDomainConceptList(); CRole *setDomainConceptList(CSortedNegLinker *domainConceptList); CRole *addDomainConceptLinker(CSortedNegLinker *domainConceptLinker); bool hasDomainConceptTag(qint64 domainConceptTag); bool hasDomainConcept(CConcept* concept); bool hasDomainOrRangeConceptTag(qint64 conceptTag); // methods for super, inverse, equivalent roles CRole *setSuperRoleList(CSortedNegLinker *superRoleList); CRole *addSuperRoleLinker(CSortedNegLinker *superRoleLinker); CSortedNegLinker *getSuperRoleList(); bool hasSuperRoleTag(qint64 tag, bool negated); bool hasSuperRoleTag(qint64 tag); bool hasSuperRole(CRole* role); CRole *setIndirectSuperRoleLinker(CSortedNegLinker *superRoleList); CRole *addIndirectSuperRoleLinker(CSortedNegLinker *superRoleLinker); CSortedNegLinker *getIndirectSuperRoleList(); bool hasIndirectSuperRoleTag(qint64 tag, bool negated); bool hasIndirectSuperRoleTag(qint64 tag); bool hasIndirectSuperRole(CRole* role); bool hasInverseRoles(); CRole *addInverseRoleLinker(CSortedNegLinker *inverseRole); CSortedNegLinker *getInverseRoleList(); bool hasInverseRole(CRole* role); bool hasEquivalentRoles(); CRole *addEquivalentRoleLinker(CSortedNegLinker *equivalentRole); CSortedNegLinker *getEquivalentRoleList(); bool hasEquivalentRole(CRole* role); CRole *setInverseEquivalentRoleList(CSortedNegLinker *invEqRoleList); CSortedNegLinker *getInverseEquivalentRoleList(); bool hasDisjointRoles(); CRole *setDisjointRoleList(CSortedNegLinker *disRoleList); CRole *addDisjointRoleLinker(CSortedNegLinker *disjointRole); CSortedNegLinker *getDisjointRoleList(); bool hasDisjointRole(CRole* role); // methods for other role properties CRole *setTransitive(bool transetive); bool isTransitive(); bool getTransitive(); CRole *setFunctional(bool functional); bool isFunctional(); bool getFunctional(); CRole *setInverseFunctional(bool invFunctional); bool isInverseFunctional(); bool getInverseFunctional(); CRole *setAsymmetric(bool asymmetric); bool isAsymmetric(); bool getAsymmetric(); CRole *setSymmetric(bool symmetric); bool isSymmetric(); bool getSymmetric(); CRole *setReflexive(bool reflexive); bool isReflexive(); bool getReflexive(); CRole *setIrreflexive(bool irreflexive); bool isIrreflexive(); bool getIrreflexive(); CRole* setRoleComplexity(bool complexRole); bool isComplexRole(); bool isSimpleRole(); bool getRoleComplexity(); bool hasRoleChainSubSharing(); CRole *addRoleChainSubSharingLinker(CXLinker* roleChainLinker); CXLinker* getRoleChainSubSharingLinker(); bool hasRoleChainSubSharingLinker(CRoleChain* roleChain); bool hasRoleChainSuperSharing(); CRole *addRoleChainSuperSharingLinker(CXLinker* roleChainLinker); CXLinker* getRoleChainSuperSharingLinker(); bool hasRoleChainSuperSharingLinker(CRoleChain* roleChain); bool hasRoleData(); CRoleData* getRoleData(); CRole* setRoleData(CRoleData* roleData); // deprecated CRole *init(qint64 roleTag); CRole *init(CRole *role); bool operator<=(const CRole &role); bool operator==(const CRole &role); // protected methods protected: // private methods private: // private variables private: CRoleData* mRoleData; CTerminology *tax; bool mTransetive; bool mFunctional; bool mInvFunctional; bool mAsymmetric; bool mSymmetric; bool mReflexive; bool mIrreflexive; bool mComplexity; bool mDataRole; CRole* mInverseRole; CSortedNegLinker *rangeLinker; CSortedNegLinker *domainLinker; CSortedNegLinker* mInverseEquivalentRoles; CSortedNegLinker* mDisjointRoles; CSortedNegLinker *superRoles; CSortedNegLinker *indirectSuperRoles; CXLinker* mRoleChainSuperSharingLinker; CXLinker* mRoleChainSubSharingLinker; }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CROLE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyTextFormater.h0000644000175000017500000000476712520551212026316 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYTEXTFORMATER_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYTEXTFORMATER_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CRole.h" #include "CConcept.h" #include "CConcreteOntology.h" #include "CIRIName.h" #include "CConceptTextFormater.h" #include "CConceptProcessData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyTextFormater * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyTextFormater { // public methods public: //! Constructor COntologyTextFormater(); //! Destructor virtual ~COntologyTextFormater(); static QString getConceptString(CConcept* concept, CConcreteOntology* ontology); static QString getTBoxConceptsString(CConcreteOntology* ontology); static QString getRoleString(CRole* role, CConcreteOntology* ontology); static QString getRBoxRolesString(CConcreteOntology* ontology); static QString getIndividualString(CIndividual* indi, CConcreteOntology* ontology); static QString getABoxIndividualsString(CConcreteOntology* ontology); static QString getOntologyString(CConcreteOntology* ontology); static bool writeOntologyToFile(CConcreteOntology* ontology, const QString& filename); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYTEXTFORMATER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStatus.cpp0000644000175000017500000000346112520551212027533 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyProcessingStatus.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyProcessingStatus::COntologyProcessingStatus() { mProcessingFlags = PSUNPROCESSED; mErrorFlags = 0; } cint64 COntologyProcessingStatus::getProcessingFlags() { return mProcessingFlags; } COntologyProcessingStatus* COntologyProcessingStatus::setProcessingFlags(cint64 flags) { mProcessingFlags = flags; return this; } cint64 COntologyProcessingStatus::getErrorFlags() { return mErrorFlags; } COntologyProcessingStatus* COntologyProcessingStatus::setErrorFlags(cint64 flags) { mErrorFlags = flags; return this; } bool COntologyProcessingStatus::hasPartialProcessingFlags(cint64 flags) { return (mProcessingFlags & flags) != 0; } bool COntologyProcessingStatus::hasPartialErrorFlags(cint64 flags) { return (mErrorFlags & flags) != 0; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleProcessData.h0000644000175000017500000000357112520551214025163 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CROLEPROCESSDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CROLEPROCESSDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CRoleData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CRoleProcessData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleProcessData : public CRoleData { // public methods public: //! Constructor CRoleProcessData(); CRoleProcessData* initRoleProcessExtensionData(); bool hasInferRelevantFlag(); CRoleProcessData* setInferRelevantFlag(bool flag); // protected methods protected: // protected variables protected: bool mInferRelevantFlag; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CROLEPROCESSDATA_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryBase64DataTriggers.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryBase64DataTriggers.0000644000175000017500000000423612520551200032112 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBINARYBASE64DATATRIGGERS_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBINARYBASE64DATATRIGGERS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareTriggers.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceBinaryBase64DataTriggers * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceBinaryBase64DataTriggers : public CDatatypeValueSpaceCompareTriggers { // public methods public: //! Constructor CDatatypeValueSpaceBinaryBase64DataTriggers(CBoxContext* boxContext); CDatatypeValueSpaceBinaryBase64DataTriggers* initValueSpaceBinaryBase64DataTriggers(CDatatypeValueSpaceBinaryBase64DataTriggers* data); CDatatypeValueSpaceConceptTriggeringData* getBinaryBase64DataConceptTriggeringData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBINARYBASE64DATATRIGGERS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringMap.cpp0000644000175000017500000002705112520551204030666 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceTriggeringMap.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceTriggeringMap::CDatatypeValueSpaceTriggeringMap(CBoxContext* boxContext) : CBOXMAP(boxContext),mBoxContext(boxContext) { } CDatatypeValueSpaceTriggeringMap* CDatatypeValueSpaceTriggeringMap::initValueSpaceTriggeringMap(CDatatypeValueSpaceTriggeringMap* map) { if (map) { *this = *map; } else { CBOXMAP::clear(); } return this; } CDatatypeValueSpaceTriggeringData* CDatatypeValueSpaceTriggeringMap::getDatatypeValueTriggeringData(CDataLiteralCompareValue* value, CDatatypeValueSpaceTriggeringMapData& valueMapData, bool createOrLocalize) { CDatatypeValueSpaceTriggeringData* valueData = nullptr; if (!valueMapData.mLocValue) { valueData = CObjectAllocator< CDatatypeValueSpaceTriggeringData >::allocateAndConstruct(mBoxContext->getMemoryAllocationManager()); valueData->initValueTriggeringData(valueMapData.mUseValue,value); valueMapData.mUseValue = valueMapData.mLocValue = valueData; } else { valueData = valueMapData.mUseValue; } return valueData; } CDatatypeValueSpaceTriggeringData* CDatatypeValueSpaceTriggeringMap::getDatatypeValueTriggeringData(CDataLiteralCompareValue* value, bool createOrLocalize) { CDatatypeValueSpaceTriggeringData* valueData = nullptr; CDatatypeValueSpaceTriggeringMapArranger mapValueArranger(value); if (createOrLocalize) { CDatatypeValueSpaceTriggeringMapData& data = CBOXMAP::operator[](mapValueArranger); valueData = getDatatypeValueTriggeringData(value,data,createOrLocalize); } else { CDatatypeValueSpaceTriggeringMapData data = CBOXMAP::value(mapValueArranger); valueData = data.mUseValue; } return valueData; } CDatatypeValueSpaceTriggeringIterator CDatatypeValueSpaceTriggeringMap::getLeftTriggeringIterator(CDataLiteralCompareValue* value, bool inclusive) { CDatatypeValueSpaceTriggeringMapArranger mapValueArranger(value); CBOXMAP::const_iterator itLB = CBOXMAP::lowerBound(mapValueArranger), itEnd = CBOXMAP::constEnd(); if (itLB != itEnd) { const CDatatypeValueSpaceTriggeringMapData& mapData = itLB.value(); CDatatypeValueSpaceTriggeringData* triggerData = mapData.mUseValue; if (triggerData->getValue()->isEqualTo(value) && !inclusive) { --itLB; } else if (triggerData->getValue()->isGreaterThan(value)) { --itLB; } return CDatatypeValueSpaceTriggeringIterator(itLB,itEnd,false); } else { CBOXMAP::const_iterator itBegin = CBOXMAP::constBegin(); return CDatatypeValueSpaceTriggeringIterator(itBegin,itEnd,true); } } CDatatypeValueSpaceTriggeringIterator CDatatypeValueSpaceTriggeringMap::getRightTriggeringIterator(CDataLiteralCompareValue* value, bool inclusive) { CDatatypeValueSpaceTriggeringMapArranger mapValueArranger(value); CBOXMAP::const_iterator itLB = CBOXMAP::lowerBound(mapValueArranger), itEnd = CBOXMAP::constEnd(); if (itLB != itEnd) { const CDatatypeValueSpaceTriggeringMapData& mapData = itLB.value(); CDatatypeValueSpaceTriggeringData* triggerData = mapData.mUseValue; if (triggerData->getValue()->isEqualTo(value) && !inclusive) { ++itLB; } else if (triggerData->getValue()->isLessThan(value)) { ++itLB; } } return CDatatypeValueSpaceTriggeringIterator(itLB,itEnd,true); } CDatatypeValueSpaceTriggeringIterator CDatatypeValueSpaceTriggeringMap::getTriggeringIterator(CDataLiteralCompareValue* value, bool left, bool inclusive) { if (left) { return getLeftTriggeringIterator(value,inclusive); } else { return getRightTriggeringIterator(value,inclusive); } } CDatatypeValueSpaceTriggeringIterator CDatatypeValueSpaceTriggeringMap::getIntervalTriggeringIterator(CDataLiteralCompareValue* minValue, bool minInclusive, CDataLiteralCompareValue* maxValue, bool maxInclusive, bool fromMinToMax) { CDatatypeValueSpaceTriggeringMapArranger mapValueArrangerMin(minValue); CDatatypeValueSpaceTriggeringMapArranger mapValueArrangerMax(maxValue); CBOXMAP::const_iterator itEnd = CBOXMAP::constEnd(), minItLB = CBOXMAP::lowerBound(mapValueArrangerMin), maxItLB = CBOXMAP::lowerBound(mapValueArrangerMax); if (maxItLB != itEnd) { const CDatatypeValueSpaceTriggeringMapData& mapData = maxItLB.value(); CDatatypeValueSpaceTriggeringData* triggerData = mapData.mUseValue; bool moveToPrev = false; if (triggerData->getValue()->isEqualTo(maxValue) && !maxInclusive) { moveToPrev = true; } else if (triggerData->getValue()->isGreaterThan(maxValue)) { moveToPrev = true; } if (moveToPrev) { if (maxItLB != minItLB) { --maxItLB; } else { maxItLB = itEnd; minItLB = itEnd; } } } if (minItLB != itEnd && maxItLB != minItLB) { const CDatatypeValueSpaceTriggeringMapData& mapData = minItLB.value(); CDatatypeValueSpaceTriggeringData* triggerData = mapData.mUseValue; bool moveToNext = false; if (triggerData->getValue()->isEqualTo(minValue) && !minInclusive) { moveToNext = true; } else if (triggerData->getValue()->isLessThan(minValue)) { moveToNext = true; } if (moveToNext) { if (maxItLB != minItLB) { ++minItLB; } else { maxItLB = itEnd; minItLB = itEnd; } } } if (fromMinToMax) { return CDatatypeValueSpaceTriggeringIterator(minItLB,maxItLB,itEnd,true); } else { return CDatatypeValueSpaceTriggeringIterator(maxItLB,minItLB,itEnd,false); } } bool CDatatypeValueSpaceTriggeringMap::countIntervalMinMaxValueTriggers(CDataLiteralCompareValue* minValue, bool minInclusive, CDataLiteralCompareValue* maxValue, bool maxInclusive, cint64& minTriggerCount, cint64& maxTriggerCount, cint64& valueTriggerCount) { CDatatypeValueSpaceTriggeringIterator iterator = getIntervalTriggeringIterator(minValue,minInclusive,maxValue,maxInclusive,true); return countIntervalMinMaxValueTriggers(iterator,minTriggerCount,maxTriggerCount,valueTriggerCount); } bool CDatatypeValueSpaceTriggeringMap::countIntervalValueTriggers(CDataLiteralCompareValue* minValue, bool minInclusive, CDataLiteralCompareValue* maxValue, bool maxInclusive, cint64& valueTriggerCount) { cint64 minTriggerCount = 0; cint64 maxTriggerCount = 0; CDatatypeValueSpaceTriggeringIterator iterator = getIntervalTriggeringIterator(minValue,minInclusive,maxValue,maxInclusive,true); return countIntervalMinMaxValueTriggers(iterator,minTriggerCount,maxTriggerCount,valueTriggerCount); } bool CDatatypeValueSpaceTriggeringMap::countIntervalMinMaxValueTriggers(CDatatypeValueSpaceTriggeringIterator iterator, cint64& minTriggerCount, cint64& maxTriggerCount, cint64& valueTriggerCount) { minTriggerCount = 0; maxTriggerCount = 0; valueTriggerCount = 0; while (iterator.hasNext()) { CDatatypeValueSpaceTriggeringData* triggerData = iterator.next(); if (triggerData->getDirectValueTriggeringData()->hasPartialConceptTriggers()) { ++valueTriggerCount; } if (triggerData->getMaxExclusiveTriggeringData()->hasPartialConceptTriggers()) { ++maxTriggerCount; } if (triggerData->getMaxInclusiveTriggeringData()->hasPartialConceptTriggers()) { ++maxTriggerCount; } if (triggerData->getMinExclusiveTriggeringData()->hasPartialConceptTriggers()) { ++minTriggerCount; } if (triggerData->getMinInclusiveTriggeringData()->hasPartialConceptTriggers()) { ++minTriggerCount; } } return true; } bool CDatatypeValueSpaceTriggeringMap::getIntervalMinMaxTriggerFreeInterval(CDataLiteralCompareValue* minValue, bool minInclusive, CDataLiteralCompareValue* maxValue, bool maxInclusive, CDataLiteralCompareValue*& freeLeftValue, bool& freeLeftInclusive, CDataLiteralCompareValue*& freeRightValue, bool& freeRightInclusive) { freeRightValue = nullptr; freeLeftValue = nullptr; freeRightInclusive = false; freeLeftInclusive = false; CDatatypeValueSpaceTriggeringIterator iterator = getIntervalTriggeringIterator(minValue,minInclusive,maxValue,maxInclusive,true); while (iterator.hasNext()) { CDatatypeValueSpaceTriggeringData* triggerData = iterator.next(); if (triggerData->getMaxExclusiveTriggeringData()->hasPartialConceptTriggers()) { freeLeftInclusive = true; freeLeftValue = triggerData->getValue(); } if (triggerData->getMaxInclusiveTriggeringData()->hasPartialConceptTriggers()) { freeLeftInclusive = false; freeLeftValue = triggerData->getValue(); } if (!freeRightValue) { if (triggerData->getMinExclusiveTriggeringData()->hasPartialConceptTriggers()) { freeRightInclusive = true; freeRightValue = triggerData->getValue(); } if (triggerData->getMinInclusiveTriggeringData()->hasPartialConceptTriggers()) { freeRightInclusive = false; freeRightValue = triggerData->getValue(); } } } if (freeRightValue == nullptr) { freeRightValue = maxValue; freeRightInclusive = maxInclusive; } if (freeLeftValue == nullptr) { freeLeftValue = minValue; freeLeftInclusive = minInclusive; } if (freeLeftValue->isGreaterThan(freeRightValue)) { return false; } else if (freeLeftValue->isEqualTo(freeRightValue)) { if (!freeLeftInclusive || !freeRightInclusive) { return false; } } return true; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralBinaryDataValue.h0000644000175000017500000000651112520551176027257 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATALITERALBINARYDATAVALUE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATALITERALBINARYDATAVALUE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDataLiteralValue.h" #include "CDataLiteralCompareValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataLiteralBinaryDataValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralBinaryDataValue : public CDataLiteralCompareValue { // public methods public: //! Constructor CDataLiteralBinaryDataValue(CContext* context); virtual CDataLiteralCompareValue* initValue(CDataLiteralCompareValue* value); CDataLiteralBinaryDataValue* initValueFromInfiniteLength(); CDataLiteralBinaryDataValue* initValueFromLength(cuint64 length); CDataLiteralBinaryDataValue* initValueFromData(unsigned char* data, cint64 length); CDataLiteralBinaryDataValue* initValue(CDataLiteralBinaryDataValue* value); CDataLiteralBinaryDataValue* clearValue(); CDataLiteralBinaryDataValue* incrementBinaryData(); cuint64 getBinaryDataID(); bool isInfiniteLength(); cuint64 getLength(); unsigned char* getByteDataArray(); cint64 getByteDataLength(); bool isEqualTo(CDataLiteralValue* value); bool isLessEqualThan(CDataLiteralCompareValue* value); bool isLessThan(CDataLiteralCompareValue* value); bool isEqualTo(CDataLiteralCompareValue* value); bool isGreaterEqualThan(CDataLiteralCompareValue* value); bool isGreaterThan(CDataLiteralCompareValue* value); bool isLessEqualThan(CDataLiteralBinaryDataValue* value); bool isLessThan(CDataLiteralBinaryDataValue* value); bool isEqualTo(CDataLiteralBinaryDataValue* value); bool isGreaterEqualThan(CDataLiteralBinaryDataValue* value); bool isGreaterThan(CDataLiteralBinaryDataValue* value); // protected methods protected: bool isZeroData(); // protected variables protected: CContext* mContext; bool mInfiniteLength; cuint64 mLength; unsigned char* mByteDataArray; cint64 mByteDataArraySize; cint64 mByteDataLength; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATALITERALBINARYDATAVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteral.h0000644000175000017500000000415012520551176024320 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATALITERAL_H #define KONCLUDE_REASONER_ONTOLOGY_CDATALITERAL_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDatatype.h" #include "CDataLiteralValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataLiteral * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteral { // public methods public: //! Constructor CDataLiteral(); CDataLiteral* initDataLiteral(const QString& lexicalDataLiteralValueString, CDatatype* datatype); QString getLexicalDataLiteralValueString(); CDatatype* getDatatype(); CDataLiteralValue* getDataLiteralValue(); CDataLiteral* setDataLiteralValue(CDataLiteralValue* dataValue); // protected methods protected: // protected variables protected: CDatatype* mDatatype; CDataLiteralValue* mDataValue; QString mLexicalDataLiteralValueString; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATALITERAL_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralBooleanValue.cpp0000644000175000017500000001070512520551176027153 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralBooleanValue.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDataLiteralBooleanValue::CDataLiteralBooleanValue() { clearValue(); } CDataLiteralValue::DATA_LITERAL_VALUE_TYPE CDataLiteralBooleanValue::getDataValueType() { return CDataLiteralValue::DLVT_BOOLEAN; } CDataLiteralCompareValue* CDataLiteralBooleanValue::initValue(CDataLiteralCompareValue* value) { clearValue(); CDataLiteralBooleanValue* booleanValue = dynamic_cast(value); if (booleanValue) { mBoolean = booleanValue->mBoolean; } return this; } CDataLiteralBooleanValue* CDataLiteralBooleanValue::initValueFromBoolean(bool boolean) { clearValue(); mBoolean = boolean; return this; } CDataLiteralBooleanValue* CDataLiteralBooleanValue::initValue(CDataLiteralBooleanValue* value) { if (value) { mBoolean = value->mBoolean; } return this; } CDataLiteralBooleanValue* CDataLiteralBooleanValue::clearValue() { mBoolean = false; return this; } bool CDataLiteralBooleanValue::getBoolean() { return mBoolean; } bool CDataLiteralBooleanValue::isEqualTo(CDataLiteralValue* value) { CDataLiteralBooleanValue* booleanValue = dynamic_cast(value); if (booleanValue) { return isEqualTo(booleanValue); } return false; } bool CDataLiteralBooleanValue::isLessEqualThan(CDataLiteralCompareValue* value) { CDataLiteralBooleanValue* booleanValue = dynamic_cast(value); if (booleanValue) { return isEqualTo(booleanValue) || isLessThan(booleanValue); } return false; } bool CDataLiteralBooleanValue::isLessEqualThan(CDataLiteralBooleanValue* booleanValue) { return isEqualTo(booleanValue) || isLessThan(booleanValue); } bool CDataLiteralBooleanValue::isEqualTo(CDataLiteralCompareValue* value) { CDataLiteralBooleanValue* booleanValue = dynamic_cast(value); if (booleanValue) { return isEqualTo(booleanValue); } return false; } bool CDataLiteralBooleanValue::isEqualTo(CDataLiteralBooleanValue* booleanValue) { return mBoolean == booleanValue->mBoolean; } bool CDataLiteralBooleanValue::isGreaterEqualThan(CDataLiteralBooleanValue* booleanValue) { return isEqualTo(booleanValue) || isGreaterThan(booleanValue); } bool CDataLiteralBooleanValue::isGreaterEqualThan(CDataLiteralCompareValue* value) { CDataLiteralBooleanValue* booleanValue = dynamic_cast(value); if (booleanValue) { return isEqualTo(booleanValue) || isGreaterThan(booleanValue); } return false; } bool CDataLiteralBooleanValue::isGreaterThan(CDataLiteralCompareValue* value) { return value->isLessThan(this); } bool CDataLiteralBooleanValue::isGreaterThan(CDataLiteralBooleanValue* booleanValue) { return booleanValue->isLessThan(this); } bool CDataLiteralBooleanValue::isLessThan(CDataLiteralCompareValue* value) { CDataLiteralBooleanValue* booleanValue = dynamic_cast(value); if (booleanValue) { return isLessThan(booleanValue); } return false; } bool CDataLiteralBooleanValue::isLessThan(CDataLiteralBooleanValue* booleanValue) { if (!mBoolean && booleanValue->mBoolean) { return true; } else { return false; } } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceTriggers.h0000644000175000017500000000456112520551204027363 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERS_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CBoxContext.h" #include "CDatatypeValueSpaceConceptTriggeringData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceTriggers * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceTriggers { // public methods public: //! Constructor CDatatypeValueSpaceTriggers(CBoxContext* boxContext); CDatatypeValueSpaceTriggers* initValueSpaceTriggers(CDatatypeValueSpaceTriggers* data); CDatatypeValueSpaceConceptTriggeringData* getValueSpaceConceptTriggeringData(); CDatatypeValueSpaceTriggers* incConceptTriggerCount(cint64 incCount = 1); cint64 getConceptTriggerCount(); CDatatypeValueSpaceTriggers* addValueSpaceConceptTrigger(CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger); // protected methods protected: // protected variables protected: CBoxContext* mBoxContext; cint64 mConceptTriggerCount; CDatatypeValueSpaceConceptTriggeringData mValueSpateTriggerData; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyTextFormater.cpp0000644000175000017500000004355412520551212026646 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyTextFormater.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyTextFormater::COntologyTextFormater() { } COntologyTextFormater::~COntologyTextFormater() { } QString COntologyTextFormater::getConceptString(CConcept *concept, CConcreteOntology* ontology) { QString conceptNameString; if (concept->hasClassName()) { conceptNameString = QString(",%1:").arg(CIRIName::getRecentIRIName(concept->getClassNameLinker())); } QString operandListString; CSortedNegLinker* opLinkerIt = concept->getOperandList(); while (opLinkerIt) { if (!operandListString.isEmpty()) { operandListString += QString(" | "); } operandListString += QString("%1%2").arg((opLinkerIt->isNegated())?"-":"+").arg(opLinkerIt->getData()->getConceptTag()); opLinkerIt = opLinkerIt->getNext(); } QString addOperandListString; if (!operandListString.isEmpty()) { addOperandListString = QString(" (| %1 |)").arg(operandListString); } QString roleString; CRole* role = concept->getRole(); if (role) { roleString = QString("%1").arg(role->getRoleTag()); if (role->hasPropertyName()) { roleString += QString("~%1").arg(CIRIName::getRecentIRIName(role->getPropertyNameLinker())); } } QString addRoleString; if (!roleString.isEmpty()) { addRoleString = QString(" < %1 >").arg(roleString); } QString indiString; CIndividual* indi = concept->getNominalIndividual(); if (indi) { indiString = QString("%1").arg(indi->getIndividualID()); if (indi->hasIndividualName()) { indiString += QString("~%1").arg(CIRIName::getRecentIRIName(indi->getIndividualNameLinker())); } } QString addIndiString; if (!indiString.isEmpty()) { addIndiString = QString(" { %1 }").arg(indiString); } QString addParamString; cint64 param = concept->getParameter(); if (param != 0) { addParamString = QString(" [ %1 ]").arg(param); } QString addReplacementString; CConceptProcessData* conProData = (CConceptProcessData*)concept->getConceptData(); if (conProData) { CReplacementData* repData = conProData->getReplacementData(); if (repData) { QString addCommDisConString; for (CXNegLinker* commDisConLinker = repData->getCommonDisjunctConceptLinker(); commDisConLinker; commDisConLinker = commDisConLinker->getNext()) { CConcept* con = commDisConLinker->getData(); bool neg = commDisConLinker->getNegation(); if (!addCommDisConString.isEmpty()) { addCommDisConString += QString(", "); } if (neg) { addCommDisConString += QString("-%1").arg(con->getConceptTag()); } else { addCommDisConString += QString("%1").arg(con->getConceptTag()); } } if (!addCommDisConString.isEmpty()) { addReplacementString += QString("Common Disjunction Concepts: %1\r\n").arg(addCommDisConString); } } CConceptRoleBranchingTrigger* conRoleBranchTriggers = conProData->getConceptRoleBranchTrigger(); if (conRoleBranchTriggers) { QString addTriggerDisConString; for (CConceptRoleBranchingTrigger* conRoleBranchTriggersIt = conRoleBranchTriggers; conRoleBranchTriggersIt; conRoleBranchTriggersIt = conRoleBranchTriggersIt->getNext()) { if (conRoleBranchTriggersIt->isConceptTrigger()) { CConcept* con = conRoleBranchTriggersIt->getTriggerConcept(); bool neg = conRoleBranchTriggersIt->getTriggerNegation(); if (!addTriggerDisConString.isEmpty()) { addTriggerDisConString += QString(", "); } if (neg) { addTriggerDisConString += QString("Concept -%1").arg(con->getConceptTag()); } else { addTriggerDisConString += QString("Concept %1").arg(con->getConceptTag()); } } else if (conRoleBranchTriggersIt->isRoleTrigger()) { CRole* role = conRoleBranchTriggersIt->getTriggerRole(); if (!addTriggerDisConString.isEmpty()) { addTriggerDisConString += QString(", "); } addTriggerDisConString += QString("Role %1").arg(role->getRoleTag()); } } if (!addTriggerDisConString.isEmpty()) { addReplacementString += QString("Role-Concept-Triggers: %1\r\n").arg(addTriggerDisConString); } } } cint64 opCode = concept->getOperatorCode(); QString opCodeString("CCNONE"); if (opCode == CCTOP) { opCodeString = QString("CCTOP"); } else if (opCode == CCBOTTOM) { opCodeString = QString("CCBOTTOM"); } else if (opCode == CCNOT) { opCodeString = QString("CCNOT"); } else if (opCode == CCAND) { opCodeString = QString("CCAND"); } else if (opCode == CCOR) { opCodeString = QString("CCOR"); } else if (opCode == CCSOME) { opCodeString = QString("CCSOME"); } else if (opCode == CCALL) { opCodeString = QString("CCALL"); } else if (opCode == CCATMOST) { opCodeString = QString("CCATMOST"); } else if (opCode == CCATLEAST) { opCodeString = QString("CCATLEAST"); } else if (opCode == CCSELF) { opCodeString = QString("CCSELF"); } else if (opCode == CCNOMINAL) { opCodeString = QString("CCNOMINAL"); } else if (opCode == CCEQ) { opCodeString = QString("CCEQ"); } else if (opCode == CCSUB) { opCodeString = QString("CCSUB"); } else if (opCode == CCAQCHOOCE) { opCodeString = QString("CCAQCHOOCE"); } else if (opCode == CCAQALL) { opCodeString = QString("CCAQALL"); } else if (opCode == CCIMPLAQALL) { opCodeString = QString("CCIMPLAQALL"); } else if (opCode == CCBRANCHAQALL) { opCodeString = QString("CCBRANCHAQALL"); } else if (opCode == CCAQSOME) { opCodeString = QString("CCAQSOME"); } else if (opCode == CCAQAND) { opCodeString = QString("CCAQAND"); } else if (opCode == CCIMPLAQAND) { opCodeString = QString("CCIMPLAQAND"); } else if (opCode == CCBRANCHAQAND) { opCodeString = QString("CCBRANCHAQAND"); } else if (opCode == CCVALUE) { opCodeString = QString("CCVALUE"); } else if (opCode == CCIMPL) { opCodeString = QString("CCIMPL"); } else if (opCode == CCIMPLTRIG) { opCodeString = QString("CCIMPLTRIG"); } else if (opCode == CCIMPLALL) { opCodeString = QString("CCIMPLALL"); } else if (opCode == CCBRANCHALL) { opCodeString = QString("CCBRANCHALL"); } else if (opCode == CCEQCAND) { opCodeString = QString("CCEQCAND"); } else if (opCode == CCBRANCHTRIG) { opCodeString = QString("CCBRANCHTRIG"); } else if (opCode == CCPBINDTRIG) { opCodeString = QString("CCPBINDTRIG"); } else if (opCode == CCPBINDIMPL) { opCodeString = QString("CCPBINDIMPL"); } else if (opCode == CCPBINDGROUND) { opCodeString = QString("CCPBINDGROUND"); } else if (opCode == CCPBINDALL) { opCodeString = QString("CCPBINDALL"); } else if (opCode == CCPBINDAND) { opCodeString = QString("CCPBINDAND"); } else if (opCode == CCPBINDAQAND) { opCodeString = QString("CCPBINDAQAND"); } else if (opCode == CCPBINDAQALL) { opCodeString = QString("CCPBINDAQALL"); } else if (opCode == CCPBINDVARIABLE) { opCodeString = QString("CCPBINDVARIABLE"); } else if (opCode == CCPBINDCYCLE) { opCodeString = QString("CCPBINDCYCLE"); } else if (opCode == CCNOMTEMPLREF) { opCodeString = QString("CCNOMTEMPLREF"); } else if (opCode == CCNOMVAR) { opCodeString = QString("CCNOMVAR"); } else if (opCode == CCVARBINDTRIG) { opCodeString = QString("CCVARBINDTRIG"); } else if (opCode == CCVARBINDIMPL) { opCodeString = QString("CCVARBINDIMPL"); } else if (opCode == CCVARBINDGROUND) { opCodeString = QString("CCVARBINDGROUND"); } else if (opCode == CCVARBINDALL) { opCodeString = QString("CCVARBINDALL"); } else if (opCode == CCVARBINDAND) { opCodeString = QString("CCVARBINDAND"); } else if (opCode == CCVARBINDAQAND) { opCodeString = QString("CCVARBINDAQAND"); } else if (opCode == CCVARBINDAQALL) { opCodeString = QString("CCVARBINDAQALL"); } else if (opCode == CCVARBINDVARIABLE) { opCodeString = QString("CCVARBINDVARIABLE"); } else if (opCode == CCVARBINDJOIN) { opCodeString = QString("CCVARBINDJOIN"); } else if (opCode == CCVARPBACKTRIG) { opCodeString = QString("CCVARPBACKTRIG"); } else if (opCode == CCVARPBACKALL) { opCodeString = QString("CCVARPBACKALL"); } else if (opCode == CCVARPBACKAQAND) { opCodeString = QString("CCVARPBACKAQAND"); } else if (opCode == CCVARPBACKAQALL) { opCodeString = QString("CCVARPBACKAQALL"); } else if (opCode == CCBACKACTIVTRIG) { opCodeString = QString("CCBACKACTIVTRIG"); } else if (opCode == CCBACKACTIVIMPL) { opCodeString = QString("CCBACKACTIVIMPL"); } else if (opCode == CCDATATYPE) { opCodeString = QString("CCDATATYPE"); } else if (opCode == CCDATALITERAL) { opCodeString = QString("CCDATALITERAL"); } else if (opCode == CCDATARESTRICTION) { opCodeString = QString("CCDATARESTRICTION"); } QString addOpCodeString = QString(" %1").arg(opCodeString); QString conceptString = QString("%1:%2%3%4%5%6\r\n%7\r\n%8").arg(concept->getConceptTag()).arg(conceptNameString) .arg(addOpCodeString).arg(addRoleString).arg(addOperandListString).arg(addIndiString).arg(CConceptTextFormater::getConceptString(concept,false)).arg(addReplacementString); return conceptString; } QString COntologyTextFormater::getTBoxConceptsString(CConcreteOntology* ontology) { QStringList tboxStringList; CTBox* tbox = ontology->getTBox(); CConceptVector* conceptVector = tbox->getConceptVector(); cint64 conceptCount = conceptVector->getItemCount(); for (cint64 i = 0; i < conceptCount; ++i) { CConcept* concept = conceptVector->getData(i); if (concept) { QString conceptString(getConceptString(concept,ontology)); tboxStringList.append(conceptString); } } QString tboxConceptsString = tboxStringList.join("\r\n"); return tboxConceptsString; } QString COntologyTextFormater::getRoleString(CRole* role, CConcreteOntology* ontology) { QString roleNameString; if (role->hasPropertyName()) { roleNameString = QString("%1:,%2:").arg(role->getRoleTag()).arg(CIRIName::getRecentIRIName(role->getPropertyNameLinker())); } else { roleNameString = QString("%1:").arg(role->getRoleTag()); } QString posSuperRoleString; QString negSuperRoleString; QString inverseRoleString; QString domainConRoleString; QString rangeConRoleString; CSortedNegLinker* superRoleLinker = role->getIndirectSuperRoleList(); CSortedNegLinker* superRoleLinkerIt = superRoleLinker; while (superRoleLinkerIt) { QString superRoleString; CRole* superRole = superRoleLinkerIt->getData(); superRoleString = QString("%1").arg(superRole->getRoleTag()); if (superRole->hasPropertyName()) { superRoleString += QString("~%1").arg(CIRIName::getRecentIRIName(superRole->getPropertyNameLinker())); } if (!superRoleLinkerIt->isNegated()) { posSuperRoleString += QString("+%1 ").arg(superRoleString); } else { negSuperRoleString += QString("-%1 ").arg(superRoleString); CSortedNegLinker* superRoleSuperRoleLinkerIt = superRole->getIndirectSuperRoleList(); while (superRoleSuperRoleLinkerIt) { if (superRoleSuperRoleLinkerIt->isNegated() && superRoleSuperRoleLinkerIt->getData() == role) { inverseRoleString += QString("-%1 ").arg(superRoleString); break; } superRoleSuperRoleLinkerIt = superRoleSuperRoleLinkerIt->getNext(); } } superRoleLinkerIt = superRoleLinkerIt->getNext(); } for (CSortedNegLinker* domConLinker = role->getDomainConceptList(); domConLinker; domConLinker = domConLinker->getNext()) { CConcept* domConcept = domConLinker->getData(); bool domNegation = domConLinker->isNegated(); if (!domainConRoleString.isEmpty()) { domainConRoleString += QString(", "); } domainConRoleString += QString("%1%2").arg(domNegation?"-":"+").arg(domConcept->getConceptTag()); } for (CSortedNegLinker* rangConLinker = role->getRangeConceptList(); rangConLinker; rangConLinker = rangConLinker->getNext()) { CConcept* rangConcept = rangConLinker->getData(); bool rangNegation = rangConLinker->isNegated(); if (!rangeConRoleString.isEmpty()) { rangeConRoleString += QString(", "); } rangeConRoleString += QString("%1%2").arg(rangNegation?"-":"+").arg(rangConcept->getConceptTag()); } QString roleString = QString("%1\r\nsuper roles: %2\r\ninverse super roles: %3\r\ninverse roles: %4\r\ndomain concepts: %5\r\nrange concepts: %6\r\n").arg(roleNameString).arg(posSuperRoleString).arg(negSuperRoleString).arg(inverseRoleString).arg(domainConRoleString).arg(rangeConRoleString); return roleString; } QString COntologyTextFormater::getRBoxRolesString(CConcreteOntology* ontology) { QStringList rboxStringList; CRBox* rbox = ontology->getRBox(); CRoleVector* roleVector = rbox->getRoleVector(); cint64 roleCount = roleVector->getItemCount(); for (cint64 i = 0; i < roleCount; ++i) { CRole* role = roleVector->getData(i); if (role) { QString roleString(getRoleString(role,ontology)); rboxStringList.append(roleString); } } QString rboxConceptsString = rboxStringList.join("\r\n"); return rboxConceptsString; } QString COntologyTextFormater::getIndividualString(CIndividual* indi, CConcreteOntology* ontology) { QString indiNameString; if (indi->hasIndividualName()) { indiNameString = QString("%1:,%2:").arg(indi->getIndividualID()).arg(CIRIName::getRecentIRIName(indi->getIndividualNameLinker())); } else { indiNameString = QString("%1:").arg(indi->getIndividualID()); } QString conceptAssertionString; QString roleAssertionString; CRoleAssertionLinker* roleAssertionLinker = indi->getAssertionRoleLinker(); while (roleAssertionLinker) { QString roleAssString; CRole* role = roleAssertionLinker->getRole(); QString roleString; if (role) { roleString = QString("%1").arg(role->getRoleTag()); if (role->hasPropertyName()) { roleString += QString("~%1").arg(CIRIName::getRecentIRIName(role->getPropertyNameLinker())); } } QString addRoleString; if (!roleString.isEmpty()) { addRoleString = QString("< %1 >").arg(roleString); } CIndividual* otherIndi = roleAssertionLinker->getIndividual(); roleAssString += QString("ROLE-ASSERTION %1. %2").arg(addRoleString).arg(otherIndi->getIndividualID()); if (otherIndi->hasIndividualName()) { roleAssString += QString("~%1").arg(CIRIName::getRecentIRIName(otherIndi->getIndividualNameLinker())); } if (!roleAssertionString.isEmpty()) { roleAssertionString += QString(", "); } roleAssertionString += QString("%1").arg(roleAssString); roleAssertionLinker = roleAssertionLinker->getNext(); } for (CConceptAssertionLinker* assConLinker = indi->getAssertionConceptLinker(); assConLinker; assConLinker = assConLinker->getNext()) { CConcept* concept = assConLinker->getData(); bool negation = assConLinker->isNegated(); if (!conceptAssertionString.isEmpty()) { conceptAssertionString += QString(", "); } conceptAssertionString += QString("%1%2").arg(negation?"-":"+").arg(concept->getConceptTag()); } QString indiString = QString("%1\r\nasserted concepts: %2\r\nasserted role connections: %3\r\n").arg(indiNameString).arg(conceptAssertionString).arg(roleAssertionString); return indiString; } QString COntologyTextFormater::getABoxIndividualsString(CConcreteOntology* ontology) { QStringList indiStringList; CABox* abox = ontology->getABox(); CIndividualVector* indiVector = abox->getIndividualVector(); cint64 indiCount = indiVector->getItemCount(); for (cint64 i = 0; i < indiCount; ++i) { CIndividual* indi = indiVector->getData(i); if (indi) { QString indiString(getIndividualString(indi,ontology)); indiStringList.append(indiString); } } QString aboxConceptsString = indiStringList.join("\r\n"); return aboxConceptsString; } QString COntologyTextFormater::getOntologyString(CConcreteOntology* ontology) { QString tBoxString = getTBoxConceptsString(ontology); QString rBoxString = getRBoxRolesString(ontology); QString aBoxString = getABoxIndividualsString(ontology); return QString("TBOX-CONCEPTS:\r\n\r\n%1\r\n\r\n\r\nRBOX-ROLES:\r\n\r\n%2\r\n\r\n\r\nABOX-INDIVIDUALS:\r\n\r\n%3\r\n\r\n\r\n").arg(tBoxString).arg(rBoxString).arg(aBoxString); } bool COntologyTextFormater::writeOntologyToFile(CConcreteOntology* ontology, const QString& filename) { QFile file(filename); if (file.open(QIODevice::WriteOnly)) { QString ontoString = getOntologyString(ontology); file.write(ontoString.toLocal8Bit()); file.close(); return true; } return false; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyBuildConstructFlags.h0000644000175000017500000000611412520551210027575 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYBUILDCONSTRUCTFLAGS_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYBUILDCONSTRUCTFLAGS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyBuildConstructFlags * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyBuildConstructFlags { // public methods public: //! Constructor COntologyBuildConstructFlags(COntologyContext* ontoContext = nullptr); COntologyBuildConstructFlags* resetFlags(); COntologyBuildConstructFlags* referenceBuildConstructFlags(COntologyBuildConstructFlags* buildConstructFlags); bool isBottomObjectRoleUsed(); COntologyBuildConstructFlags* setBottomObjectRoleUsed(bool used = true); bool isTopObjectRoleUsed(); COntologyBuildConstructFlags* setTopObjectRoleUsed(bool used = true); bool isBottomDataRoleUsed(); COntologyBuildConstructFlags* setBottomDataRoleUsed(bool used = true); bool isTopDataRoleUsed(); COntologyBuildConstructFlags* setTopDataRoleUsed(bool used = true); bool isNonELConstructUsed(); COntologyBuildConstructFlags* setNonELConstructUsed(bool used = true); bool isComplexRoleUsed(); COntologyBuildConstructFlags* setComplexRoleUsed(bool used = true); bool isNominalSchemaUsed(); COntologyBuildConstructFlags* setNominalSchemaUsed(bool used = true); bool isRetractionUsed(); COntologyBuildConstructFlags* setRetractionUsed(bool used = true); // protected methods protected: // protected variables protected: COntologyContext* mOntoContext; bool mBottomObjectRoleUsed; bool mTopObjectRoleUsed; bool mBottomDataRoleUsed; bool mTopDataRoleUsed; bool mNonELConstructUsed; bool mNominalSchemaUsed; bool mComplexRoleUsed; bool mRetractionUsed; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYBUILDCONSTRUCTFLAGS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStepRequirement.h0000644000175000017500000000544012520551212031050 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPREQUIREMENT_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPREQUIREMENT_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyProcessingRequirement.h" #include "CConcreteOntology.h" #include "COntologyProcessingStatus.h" #include "COntologyProcessingStepDataVector.h" #include "COntologyProcessingSteps.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyProcessingStepRequirement * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyProcessingStepRequirement : public COntologyProcessingRequirement { // public methods public: //! Constructor COntologyProcessingStepRequirement(COntologyProcessingStep* requiredProcessingStep, cint64 requiredProcessingFlags, cint64 forbiddenProcessingFlags, cint64 requiredErrorFlags, cint64 forbiddenErrorFlags); COntologyProcessingStep* getRequiredProcessingStep(); COntologyProcessingStepRequirement* setRequiredProcessingStep(COntologyProcessingStep* requiredProcessingStep); virtual bool isRequirementSatisfied(COntology* ontology); virtual COntologyProcessingStepRequirement* submitRequirementUpdate(cint64 processingFlags, cint64 errorFlags); virtual const QString getRequirementFailureString(COntology* ontology); // protected methods protected: // protected variables protected: COntologyProcessingStep* mRequiredProcessingStep; cint64 mRequiredProcessingFlags; cint64 mForbiddenProcessingFlags; cint64 mRequiredErrorFlags; cint64 mForbiddenErrorFlags; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPREQUIREMENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStepVector.cpp0000644000175000017500000002012612520551212030343 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyProcessingStepVector.h" #include "COntologyProcessingStepRequirement.h" namespace Konclude { namespace Reasoner { namespace Ontology { QMutex* COntologyProcessingStepVector::mInstanceMutex = new QMutex(); COntologyProcessingStepVector* COntologyProcessingStepVector::mProcStepVectorInstance = nullptr; COntologyProcessingStepVector::COntologyProcessingStepVector() { mPrStCount = 0; } COntologyProcessingStepVector* COntologyProcessingStepVector::initDefaultProcessingSteps() { COntologyProcessingStep* activeBuild = new COntologyProcessingStep(COntologyProcessingStep::OPSACTIVECOUNT,mPrStCount,COntologyProcessingStep::OPPREPROCESSOR); addProcessingSteps(activeBuild); COntologyProcessingStep* stepBuild = new COntologyProcessingStep(COntologyProcessingStep::OPSBUILD,mPrStCount,COntologyProcessingStep::OPPREPROCESSOR); addProcessingSteps(stepBuild); COntologyProcessingStep* stepPreprocess = new COntologyProcessingStep(COntologyProcessingStep::OPSPREPROCESS,mPrStCount,COntologyProcessingStep::OPPREPROCESSOR); stepPreprocess->addProcessingRequirement(new COntologyProcessingStepRequirement(stepBuild, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0)); stepPreprocess->addProcessingRequirement(new COntologyProcessingStepRequirement(activeBuild, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0)); addProcessingSteps(stepPreprocess); COntologyProcessingStep* stepConsistency = new COntologyProcessingStep(COntologyProcessingStep::OPSCONSISTENCY,mPrStCount,COntologyProcessingStep::OPPRECOMPUTER); stepConsistency->addProcessingRequirement(new COntologyProcessingStepRequirement(stepBuild, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0)); stepConsistency->addProcessingRequirement(new COntologyProcessingStepRequirement(stepPreprocess, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0)); addProcessingSteps(stepConsistency); COntologyProcessingStep* stepIndividualComp = new COntologyProcessingStep(COntologyProcessingStep::OPSPRECOMPUTEINDIVIDUAL,mPrStCount,COntologyProcessingStep::OPPRECOMPUTER); stepIndividualComp->addProcessingRequirement(new COntologyProcessingStepRequirement(stepConsistency, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, COntologyProcessingStatus::PSINCONSITENT)); addProcessingSteps(stepIndividualComp); COntologyProcessingStep* stepSaturation = new COntologyProcessingStep(COntologyProcessingStep::OPSPRECOMPUTESATURATION,mPrStCount,COntologyProcessingStep::OPPRECOMPUTER); stepSaturation->addProcessingRequirement(new COntologyProcessingStepRequirement(stepConsistency, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, COntologyProcessingStatus::PSINCONSITENT)); stepSaturation->addProcessingRequirement(new COntologyProcessingStepRequirement(stepIndividualComp, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0)); addProcessingSteps(stepSaturation); COntologyProcessingStep* stepCycles = new COntologyProcessingStep(COntologyProcessingStep::OPSPRECOMPUTECYCLES,mPrStCount,COntologyProcessingStep::OPPRECOMPUTER); stepCycles->addProcessingRequirement(new COntologyProcessingStepRequirement(stepConsistency, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, COntologyProcessingStatus::PSINCONSITENT)); stepCycles->addProcessingRequirement(new COntologyProcessingStepRequirement(stepIndividualComp, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0)); addProcessingSteps(stepCycles); COntologyProcessingStep* stepClassify = new COntologyProcessingStep(COntologyProcessingStep::OPSCLASSCLASSIFY,mPrStCount,COntologyProcessingStep::OPCLASSCLASSIFIER); stepClassify->addProcessingRequirement(new COntologyProcessingStepRequirement(stepConsistency, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, COntologyProcessingStatus::PSINCONSITENT)); stepClassify->addProcessingRequirement(new COntologyProcessingStepRequirement(stepSaturation, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0)); stepClassify->addProcessingRequirement(new COntologyProcessingStepRequirement(stepCycles, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0)); stepClassify->addProcessingRequirement(new COntologyProcessingStepRequirement(stepIndividualComp, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0)); addProcessingSteps(stepClassify); COntologyProcessingStep* stepRealizeConcepts = new COntologyProcessingStep(COntologyProcessingStep::OPSCONCEPTREALIZE,mPrStCount,COntologyProcessingStep::OPREALIZER); stepRealizeConcepts->addProcessingRequirement(new COntologyProcessingStepRequirement(stepClassify, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0)); addProcessingSteps(stepRealizeConcepts); COntologyProcessingStep* stepRealizeRoles = new COntologyProcessingStep(COntologyProcessingStep::OPSROLEREALIZE,mPrStCount,COntologyProcessingStep::OPREALIZER); stepRealizeRoles->addProcessingRequirement(new COntologyProcessingStepRequirement(stepClassify, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0)); addProcessingSteps(stepRealizeRoles); COntologyProcessingStep* stepRealizeSameIndividuals = new COntologyProcessingStep(COntologyProcessingStep::OPSSAMEINDIVIDUALSREALIZE,mPrStCount,COntologyProcessingStep::OPREALIZER); stepRealizeSameIndividuals->addProcessingRequirement(new COntologyProcessingStepRequirement(stepClassify, COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0)); addProcessingSteps(stepRealizeSameIndividuals); return this; } COntologyProcessingStepVector* COntologyProcessingStepVector::addProcessingSteps(COntologyProcessingStep* proStepData) { mPrStepVector.append(proStepData); ++mPrStCount; return this; } COntologyProcessingStep* COntologyProcessingStepVector::getProcessingStep(cint64 stepID) { if (stepID < 0 || stepID >= mPrStCount) { return nullptr; } return mPrStepVector[stepID]; } COntologyProcessingStep* COntologyProcessingStepVector::getProcessingStep(COntologyProcessingStep::PROCESSINGSTEPTYPE stepType) { return getProcessingStep((cint64)stepType); } cint64 COntologyProcessingStepVector::getProcessingStepCount() { return mPrStCount; } COntologyProcessingStepVector* COntologyProcessingStepVector::getProcessingStepVectorInstance() { if (mProcStepVectorInstance == nullptr) { mInstanceMutex->lock(); if (mProcStepVectorInstance == nullptr) { mProcStepVectorInstance = new COntologyProcessingStepVector(); mProcStepVectorInstance->initDefaultProcessingSteps(); } mInstanceMutex->unlock(); } return mProcStepVectorInstance; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividual.h0000644000175000017500000000776412520551206024232 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUAL_H #define KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUAL_H // Libraries includes #include #include // Namespace includes #include "OntologySettings.h" #include "CNamedItem.h" #include "CTagItem.h" #include "CConceptAssertionLinker.h" #include "CRoleAssertionLinker.h" #include "CIndividualData.h" #include "CReverseRoleAssertionLinker.h" // Other includes #include "Utilities/CAllocationObject.h" #include "Utilities/CLinker.hpp" #include "Utilities/Container/CNegLinker.h" #include "Utilities/Memory/CMemoryAllocationManager.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Container; using namespace Utilities::Memory; namespace Reasoner { namespace Ontology { /*! * * \class CIndividual * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividual : public CTagItem, public CNamedItem, public CAllocationObject { // public methods public: //! Constructor CIndividual(qint64 id = 0); bool hasIndividualName(); CIndividual *setIndividualNameLinker(CLinker *individualNameLinker); CIndividual *addIndividualNameLinker(CLinker *individualNameLinker); CLinker *getIndividualNameLinker(); CConcept* getIndividualNominalConcept(); CIndividual* setIndividualNominalConcept(CConcept* nomConcept); CConceptAssertionLinker* getAssertionConceptLinker(); CIndividual* addAssertionConceptLinker(CConceptAssertionLinker* assConLinker); CIndividual* setAssertionConceptLinker(CConceptAssertionLinker* assConLinker); CRoleAssertionLinker* getAssertionRoleLinker(); CIndividual* addAssertionRoleLinker(CRoleAssertionLinker* assConLinker); CIndividual* setAssertionRoleLinker(CRoleAssertionLinker* assConLinker); CReverseRoleAssertionLinker* getReverseAssertionRoleLinker(); CIndividual* addReverseAssertionRoleLinker(CReverseRoleAssertionLinker* revAssRoleLinker); CIndividual* setReverseAssertionRoleLinker(CReverseRoleAssertionLinker* revAssRoleLinker); CIndividual *initIndividual(qint64 indiID = 0); CIndividual *initIndividualCopy(CIndividual* individual, CMemoryAllocationManager* memMan); CIndividual *setIndividualID(qint64 id); qint64 getIndividualID(); bool hasAssertedConcept(CConcept* concept); CIndividual* setAnonymousIndividual(bool anonymous); bool isAnonymousIndividual(); bool hasIndividualData(); CIndividualData* getIndividualData(); CIndividual* setIndividualData(CIndividualData* individualData); // protected methods protected: // protected variables protected: CConceptAssertionLinker* mAssertionConceptLinker; CRoleAssertionLinker* mAssertionRoleLinker; CReverseRoleAssertionLinker* mReverseAssertionRoleLinker; CConcept* mNominalConcept; bool mAnonymousIndividual; CIndividualData* mIndividualData; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUAL_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringMap.h0000644000175000017500000001002112520551204030320 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERINGMAP_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERINGMAP_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CBoxContext.h" #include "CDataLiteralCompareValue.h" #include "CDatatypeValueSpaceTriggeringMapData.h" #include "CDatatypeValueSpaceTriggeringMapArranger.h" #include "CDatatypeValueSpaceTriggeringIterator.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceTriggeringMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceTriggeringMap : public CBOXMAP { // public methods public: //! Constructor CDatatypeValueSpaceTriggeringMap(CBoxContext* boxContext); CDatatypeValueSpaceTriggeringMap* initValueSpaceTriggeringMap(CDatatypeValueSpaceTriggeringMap* map); CDatatypeValueSpaceTriggeringData* getDatatypeValueTriggeringData(CDataLiteralCompareValue* value, bool createOrLocalize = false); CDatatypeValueSpaceTriggeringData* getDatatypeValueTriggeringData(CDataLiteralCompareValue* value, CDatatypeValueSpaceTriggeringMapData& valueMapData, bool createOrLocalize); CDatatypeValueSpaceTriggeringIterator getLeftTriggeringIterator(CDataLiteralCompareValue* value, bool inclusive); CDatatypeValueSpaceTriggeringIterator getRightTriggeringIterator(CDataLiteralCompareValue* value, bool inclusive); CDatatypeValueSpaceTriggeringIterator getTriggeringIterator(CDataLiteralCompareValue* value, bool left, bool inclusive); CDatatypeValueSpaceTriggeringIterator getIntervalTriggeringIterator(CDataLiteralCompareValue* minValue, bool minInclusive, CDataLiteralCompareValue* maxValue, bool maxInclusive, bool fromMinToMax); bool countIntervalMinMaxValueTriggers(CDataLiteralCompareValue* minValue, bool minInclusive, CDataLiteralCompareValue* maxValue, bool maxInclusive, cint64& minTriggerCount, cint64& maxTriggerCount, cint64& valueTriggerCount); bool countIntervalMinMaxValueTriggers(CDatatypeValueSpaceTriggeringIterator iterator, cint64& minTriggerCount, cint64& maxTriggerCount, cint64& valueTriggerCount); bool countIntervalValueTriggers(CDataLiteralCompareValue* minValue, bool minInclusive, CDataLiteralCompareValue* maxValue, bool maxInclusive, cint64& valueTriggerCount); bool getIntervalMinMaxTriggerFreeInterval(CDataLiteralCompareValue* minValue, bool minInclusive, CDataLiteralCompareValue* maxValue, bool maxInclusive, CDataLiteralCompareValue*& freeLeftValue, bool& freeLeftInclusive, CDataLiteralCompareValue*& freeRightValue, bool& freeRightInclusive); // protected methods protected: // protected variables protected: CBoxContext* mBoxContext; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERINGMAP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringMapArranger.h0000644000175000017500000000413412520551204032012 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERINGMAPARRANGER_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERINGMAPARRANGER_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDataLiteralCompareValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceTriggeringMapArranger * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceTriggeringMapArranger { // public methods public: //! Constructor CDatatypeValueSpaceTriggeringMapArranger(CDataLiteralCompareValue* compareableValue); bool operator<(const CDatatypeValueSpaceTriggeringMapArranger& valueData) const; bool operator<=(const CDatatypeValueSpaceTriggeringMapArranger& valueData) const; // protected methods protected: // protected variables protected: CDataLiteralCompareValue* mCompareableValue; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERINGMAPARRANGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyIncrementalRevisionData.cpp0000644000175000017500000001302212520551210030755 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyIncrementalRevisionData.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyIncrementalRevisionData::COntologyIncrementalRevisionData(COntologyContext* ontoContext) { mOntoContext = ontoContext; mBasementOntology = nullptr; mPreviousVersionOntology = nullptr; mLastChangeCountedAxiom = 0; mPreviousConsistentOntology = nullptr; mPreviousClassesClassifiedOntology = nullptr; mPreviousSameIndividualsRealizedOntology = nullptr; mPreviousClassTypesRealizedOntology = nullptr; mPreviousRoleTypesRealizedOntology = nullptr; } COntologyIncrementalRevisionData::~COntologyIncrementalRevisionData() { } COntologyIncrementalRevisionData* COntologyIncrementalRevisionData::referenceIncrementalRevision(COntologyIncrementalRevisionData* incRevData) { mBasementOntology = incRevData->mBasementOntology; mPreviousVersionOntology = incRevData->mPreviousVersionOntology; mLastChangeCountedAxiom = incRevData->mLastChangeCountedAxiom; mPreviousConsistentOntology = incRevData->mPreviousConsistentOntology; mPreviousClassesClassifiedOntology = incRevData->mPreviousClassesClassifiedOntology; mPreviousSameIndividualsRealizedOntology = incRevData->mPreviousSameIndividualsRealizedOntology; mPreviousClassTypesRealizedOntology = incRevData->mPreviousClassTypesRealizedOntology; mPreviousRoleTypesRealizedOntology = incRevData->mPreviousRoleTypesRealizedOntology; return this; } CConcreteOntology* COntologyIncrementalRevisionData::getBasementOntology() { return mBasementOntology; } CConcreteOntology* COntologyIncrementalRevisionData::getPreviousOntologyVersion() { return mPreviousVersionOntology; } COntologyIncrementalRevisionData* COntologyIncrementalRevisionData::setBasementOntology(CConcreteOntology* ontology) { mBasementOntology = ontology; return this; } COntologyIncrementalRevisionData* COntologyIncrementalRevisionData::setPreviousOntologyVersion(CConcreteOntology* ontology) { mPreviousVersionOntology = ontology; return this; } COntologyIncrementalAxiomChangeData* COntologyIncrementalRevisionData::getAxiomChangeData() { return &mAxiomChangeData; } cint64 COntologyIncrementalRevisionData::getLastChangeCountedAxiom() { return mLastChangeCountedAxiom; } COntologyIncrementalRevisionData* COntologyIncrementalRevisionData::setLastChangeCountedAxiom(cint64 lastAxiom) { mLastChangeCountedAxiom = lastAxiom; return this; } bool COntologyIncrementalRevisionData::isBasementOntology() { return !mPreviousVersionOntology; } bool COntologyIncrementalRevisionData::isInitialOntology() { return mPreviousVersionOntology == mBasementOntology; } bool COntologyIncrementalRevisionData::isIncrementalOntology() { return !isInitialOntology() && !isBasementOntology(); } COntologyIncrementalRevisionData* COntologyIncrementalRevisionData::setPreviousConsistentOntology(CConcreteOntology* ontology) { mPreviousConsistentOntology = ontology; return this; } CConcreteOntology* COntologyIncrementalRevisionData::getPreviousConsistentOntology() { return mPreviousConsistentOntology; } COntologyIncrementalRevisionData* COntologyIncrementalRevisionData::setPreviousClassesClassifiedOntology(CConcreteOntology* ontology) { mPreviousClassesClassifiedOntology = ontology; return this; } CConcreteOntology* COntologyIncrementalRevisionData::getPreviousClassesClassifiedOntology() { return mPreviousClassesClassifiedOntology; } COntologyIncrementalRevisionData* COntologyIncrementalRevisionData::setPreviousSameIndividualsRealizedOntology(CConcreteOntology* ontology) { mPreviousSameIndividualsRealizedOntology = ontology; return this; } CConcreteOntology* COntologyIncrementalRevisionData::getPreviousSameIndividualsRealizedOntology() { return mPreviousSameIndividualsRealizedOntology; } COntologyIncrementalRevisionData* COntologyIncrementalRevisionData::setPreviousClassTypesRealizedOntology(CConcreteOntology* ontology) { mPreviousClassTypesRealizedOntology = ontology; return this; } CConcreteOntology* COntologyIncrementalRevisionData::getPreviousClassTypesRealizedOntology() { return mPreviousClassTypesRealizedOntology; } COntologyIncrementalRevisionData* COntologyIncrementalRevisionData::setPreviousRoleTypesRealizedOntology(CConcreteOntology* ontology) { mPreviousRoleTypesRealizedOntology = ontology; return this; } CConcreteOntology* COntologyIncrementalRevisionData::getPreviousRoleTypesRealizedOntology() { return mPreviousRoleTypesRealizedOntology; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceDoubleTriggers.h0000644000175000017500000000407212520551202030511 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEDOUBLETRIGGERS_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEDOUBLETRIGGERS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareTriggers.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceDoubleTriggers * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceDoubleTriggers : public CDatatypeValueSpaceCompareTriggers { // public methods public: //! Constructor CDatatypeValueSpaceDoubleTriggers(CBoxContext* boxContext); CDatatypeValueSpaceDoubleTriggers* initValueSpaceDoubleTriggers(CDatatypeValueSpaceDoubleTriggers* data); CDatatypeValueSpaceConceptTriggeringData* getDoubleConceptTriggeringData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEDOUBLETRIGGERS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptNegationPair.h0000644000175000017500000000362512520551174026032 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTNEGATIONPAIR_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTNEGATIONPAIR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CConcept.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CConceptNegationPair * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptNegationPair : public QPair { // public methods public: //! Constructor CConceptNegationPair(CConcept *concept, bool negation); //! Destructor virtual ~CConceptNegationPair(); CConcept *getConcept(); bool getNegation(); bool isNegation(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTNEGATIONPAIR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptReferenceLinking.cpp0000644000175000017500000000205712520551174027215 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptReferenceLinking.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptReferenceLinking::CConceptReferenceLinking() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptData.cpp0000644000175000017500000000201612520551174024647 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptData::CConceptData() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyInspector.h0000644000175000017500000000632412520551210025625 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYINSPECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYINSPECTOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyStructureSummary.h" #include "CConcreteOntology.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyInspector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyInspector { // public methods public: //! Constructor COntologyInspector(); //! Destructor virtual ~COntologyInspector(); virtual COntologyStructureSummary *inspectConcept(CConcreteOntology *ontology, CConcept* concept, bool negation, COntologyStructureSummary *ontStructSum); virtual COntologyStructureSummary *inspectOntology(CConcreteOntology *ontology); virtual CBOXSET *createConceptContainsSet(CConcept *concept, CTBox *tBox, CBOXSET *containsSet = nullptr); virtual COntologyInspector *createGCIConceptSet(CTBox *tBox); virtual COntologyStructureSummary *createStructureSummary(CConcreteOntology *ontology); bool testOntologyForNonDeterministicConcepts(CConcreteOntology *ontology, COntologyStructureSummary *ontStructSum = nullptr); bool testOntologyForNonELConcepts(CConcreteOntology *ontology, COntologyStructureSummary *ontStructSum = nullptr); bool analyzeOntologyConceptsStructureFlags(CConcreteOntology *ontology, COntologyStructureSummary *ontStructSum = nullptr); // protected methods protected: class CStructureFlags { public: CStructureFlags() { mValidDeterministic = true; mNominalOccurence = false; mUniversalRoleOccurence = false; mValidEL = true; } bool mValidEL; bool mValidDeterministic; bool mNominalOccurence; bool mUniversalRoleOccurence; }; bool analyseConceptStructureFlags(CConcept* concept, bool negated, QSet< QPair >& singleConNegSet, QHash* existRoleHash, CStructureFlags& flags); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYINSPECTOR_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingConceptSaturationRequirement.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingConceptSaturationRequirem0000644000175000017500000000564512520551212032654 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGCONCEPTSATURATIONREQUIREMENT_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGCONCEPTSATURATIONREQUIREMENT_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyProcessingRequirement.h" #include "CConcreteOntology.h" #include "COntologyProcessingStatus.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyProcessingConceptSaturationRequirement * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyProcessingConceptSaturationRequirement : public COntologyProcessingRequirement { // public methods public: //! Constructor COntologyProcessingConceptSaturationRequirement(CConcept* concept, bool conceptNegation, cint64 requiredProcessingFlags = COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, cint64 forbiddenProcessingFlags = 0, cint64 requiredErrorFlags = COntologyProcessingStatus::PSSUCESSFULL, cint64 forbiddenErrorFlags = 0); virtual bool isRequirementSatisfied(COntology* ontology); virtual COntologyProcessingConceptSaturationRequirement* submitRequirementUpdate(cint64 processingFlags, cint64 errorFlags); COntologyProcessingStatus* getProcessingStatus(); CConcept* getConcept(); bool getConceptNegation(); virtual const QString getRequirementFailureString(COntology* ontology); virtual bool isDynamicRequirement(); // protected methods protected: // protected variables protected: COntologyProcessingStatus mProcessingStatus; cint64 mRequiredProcessingFlags; cint64 mForbiddenProcessingFlags; cint64 mRequiredErrorFlags; cint64 mForbiddenErrorFlags; CConcept* mConcept; bool mConceptNegation; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGCONCEPTSATURATIONREQUIREMENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CSatisfiableCachingTags.cpp0000644000175000017500000000206012520551214026776 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSatisfiableCachingTags.h" namespace Konclude { namespace Reasoner { namespace Ontology { CSatisfiableCachingTags::CSatisfiableCachingTags() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CMBox.h0000644000175000017500000001002612520551206022770 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_CMBOX_H #define KONCLUDE_REASONER_CMBOX_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDataBox.h" #include "CConceptDependence.h" #include "CRoleDependence.h" #include "CIndividualDependence.h" #include "CConceptDependenceVector.h" #include "CRoleDependenceVector.h" #include "CIndividualDependenceVector.h" #include "CConcreteOntologyContextBase.h" #include "CConceptDataVector.h" #include "CBranchingTriggerVector.h" #include "CImplicationReplacementVector.h" #include "CNominalSchemaTemplateVector.h" #include "CDatatypeValueSpacesTriggers.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CMBox * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMBox : public CDataBox { // public methods public: //! Constructor CMBox(CBoxContext* boxContext = nullptr); //! Destructor virtual ~CMBox(); CConceptDependenceVector *getConceptDependenceVector(bool create = true); CMBox *setConceptDependenceVector(CConceptDependenceVector *conceptDependenceVector); virtual CMBox *referenceMBox(CMBox *mBox); virtual CMBox *getMBoxReferenceCopy(CBoxContext *boxContext); CRoleDependenceVector *getRoleDependenceVector(bool create = true); CMBox *setRoleDependenceVector(CRoleDependenceVector *roleDependenceVector); CIndividualDependenceVector *getIndividualDependenceVector(bool create = true); CMBox *setIndividualDependenceVector(CIndividualDependenceVector *indiDependenceVector); CConceptDataVector* getConceptDataVector(bool create = true); CMBox *setConceptDataVector(CConceptDataVector* conceptDataVector); CBranchingTriggerVector* getBranchingTriggerVector(bool create = true); CMBox *setBranchingTriggerVector(CBranchingTriggerVector* branchTriggVector); CImplicationReplacementVector* getImplicationReplacementVector(bool create = true); CMBox *setImplicationReplacementVector(CImplicationReplacementVector* impRepVector); CNominalSchemaTemplateVector* getNominalSchemaTemplateVector(bool create = true); CMBox *setNominalSchemaTemplateVector(CNominalSchemaTemplateVector* nomSchTemplVector); CDatatypeValueSpacesTriggers* getValueSpacesTriggers(bool create = true); virtual CBoxContext *getBoxContext(bool create = true); // protected methods protected: // protected variables protected: CConceptDependenceVector *conceptDep; CRoleDependenceVector *roleDep; CIndividualDependenceVector *indiDep; CConceptDataVector* mConDataVector; CBranchingTriggerVector* mBranchTriggVector; CImplicationReplacementVector* mImpRepVector; CNominalSchemaTemplateVector* mNomSchemaTemplVector; CDatatypeValueSpacesTriggers* mValueSpacesTriggers; CBoxContext *mBoxContext; CBoxContext *mDeleteBoxContext; CMemoryAllocationManager* mMemMan; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_CMBOX_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceIRIType.h0000644000175000017500000000442712520551202027061 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEIRITYPE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEIRITYPE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareType.h" #include "CDataLiteralIRIValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceIRIType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceIRIType : public CDatatypeValueSpaceCompareType { // public methods public: //! Constructor CDatatypeValueSpaceIRIType(); CDataLiteralIRIValue* getMinimumDataLiteralIRIValue(); CDataLiteralIRIValue* getMaximumDataLiteralIRIValue(); virtual CDataLiteralCompareValue* getMinimumDataLiteralCompareValue(); virtual CDataLiteralCompareValue* getMaximumDataLiteralCompareValue(); virtual bool hasInfiniteManyValues(); virtual cint64 getMaximumValueCount(); // protected methods protected: // protected variables protected: CDataLiteralIRIValue* mMinValue; CDataLiteralIRIValue* mMaxValue; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDatatypeValueSpaceIRIType_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringData.h0000644000175000017500000000605612520551204030471 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERINGDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERINGDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDataLiteralCompareValue.h" #include "CDatatypeValueSpaceConceptTriggeringData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceTriggeringData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceTriggeringData { // public methods public: //! Constructor CDatatypeValueSpaceTriggeringData(); CDatatypeValueSpaceTriggeringData* initValueTriggeringData(CDatatypeValueSpaceTriggeringData* valueData, CDataLiteralCompareValue* value); CDataLiteralCompareValue* getValue(); CDatatypeValueSpaceTriggeringData* setValue(CDataLiteralCompareValue* value); CDatatypeValueSpaceConceptTriggeringData* getTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* getTriggeringData(bool min, bool inclusive); CDatatypeValueSpaceConceptTriggeringData* getDirectValueTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* getMinInclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* getMinExclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* getMaxInclusiveTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* getMaxExclusiveTriggeringData(); // protected methods protected: // protected variables protected: CDataLiteralCompareValue* mValue; CDatatypeValueSpaceConceptTriggeringData mValueTriggerData; CDatatypeValueSpaceConceptTriggeringData mMinInclusiveTriggerData; CDatatypeValueSpaceConceptTriggeringData mMinExclusiveTriggerData; CDatatypeValueSpaceConceptTriggeringData mMaxInclusiveTriggerData; CDatatypeValueSpaceConceptTriggeringData mMaxExclusiveTriggerData; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERINGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyStructureSummary.h0000644000175000017500000002713512520551212027242 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYSTRUCTURESUMMARY_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYSTRUCTURESUMMARY_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyStructureSummary * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyStructureSummary { // public methods public: //! Constructor COntologyStructureSummary(COntologyContext* ontologyContext = nullptr); //! Destructor virtual ~COntologyStructureSummary(); COntologyStructureSummary* referenceStructureSummary(COntologyStructureSummary* structureSummary); COntologyStructureSummary *clear(); bool hasOnlyDeterministicConceptClasses(); COntologyStructureSummary* setOnlyDeterministicConceptClasses(bool allClassesDeterministic); bool hasOnlyELConceptClasses(); COntologyStructureSummary* setOnlyELConceptClasses(bool allClassesEL); qint64 getClassCount(); qint64 getConceptCount(); qint64 getObjectPropertyCount(); qint64 getDataPropertyCount(); qint64 getGCICount(); qint64 getConceptIntersectionCount(); qint64 getConceptUnionCount(); qint64 getConceptNotCount(); qint64 getConceptSomeCount(); qint64 getConceptOnlyCount(); qint64 getConceptAtmostCount(); qint64 getConceptAtleastCount(); qint64 getConceptQualifiedAtleastCount(); qint64 getConceptQualifiedAtmostCount(); qint64 getConceptNotQualifiedAtleastCount(); qint64 getConceptNotQualifiedAtmostCount(); qint64 getConceptEquivalenceCount(); qint64 getConceptSubclassCount(); bool hasConceptIntersections(); bool hasConceptUnions(); bool hasConceptNots(); bool hasConceptSomes(); bool hasConceptOnlys(); bool hasConceptAtmosts(); bool hasConceptAtleasts(); bool hasConceptQualifiedAtleasts(); bool hasConceptQualifiedAtmosts(); bool hasConceptNotQualifiedAtleasts(); bool hasConceptNotQualifiedAtmosts(); bool hasConceptEquivalences(); bool hasConceptSubclasses(); qint64 getPrimitiveConceptCount(); qint64 getComplexConceptCount(); qint64 getAtomicClassCount(); qint64 getComplexClassCount(); COntologyStructureSummary *incClassCount(qint64 incCount = 1); COntologyStructureSummary *incConceptCount(qint64 incCount = 1); COntologyStructureSummary *incObjectPropertyCount(qint64 incCount = 1); COntologyStructureSummary *incDataPropertyCount(qint64 incCount = 1); COntologyStructureSummary *incGCICount(qint64 incCount = 1); COntologyStructureSummary *incConceptIntersectionCount(qint64 incCount = 1); COntologyStructureSummary *incConceptUnionCount(qint64 incCount = 1); COntologyStructureSummary *incConceptNegCount(qint64 incCount = 1); COntologyStructureSummary *incConceptSomeCount(qint64 incCount = 1); COntologyStructureSummary *incConceptOnlyCount(qint64 incCount = 1); COntologyStructureSummary *incConceptAtmostCount(qint64 incCount = 1); COntologyStructureSummary *incConceptAtleastCount(qint64 incCount = 1); COntologyStructureSummary *incConceptQualifiedAtleastCount(qint64 incCount = 1); COntologyStructureSummary *incConceptQualifiedAtmostCount(qint64 incCount = 1); COntologyStructureSummary *incConceptNotQualifiedAtleastCount(qint64 incCount = 1); COntologyStructureSummary *incConceptNotQualifiedAtmostCount(qint64 incCount = 1); COntologyStructureSummary *incConceptEquivalenceCount(qint64 incCount = 1); COntologyStructureSummary *incConceptSubclassCount(qint64 incCount = 1); COntologyStructureSummary *incPrimitiveConceptCount(qint64 incCount = 1); COntologyStructureSummary *incComplexConceptCount(qint64 incCount = 1); COntologyStructureSummary *incAtomicClassCount(qint64 incCount = 1); COntologyStructureSummary *incComplexClassCount(qint64 incCount = 1); COntologyStructureSummary *incRoleInverseCount(qint64 incCount = 1); COntologyStructureSummary *incRoleEquivalenceCount(qint64 incCount = 1); COntologyStructureSummary *incRoleDisjointCount(qint64 incCount = 1); COntologyStructureSummary *incRoleRangeConceptCount(qint64 incCount = 1); COntologyStructureSummary *incRoleDomainConceptCount(qint64 incCount = 1); COntologyStructureSummary *incRoleAsymmetricCount(qint64 incCount = 1); COntologyStructureSummary *incRoleSymmetricCount(qint64 incCount = 1); COntologyStructureSummary *incRoleFunctionalCount(qint64 incCount = 1); COntologyStructureSummary *incRoleInverseFunctionalCount(qint64 incCount = 1); COntologyStructureSummary *incRoleTransetivCount(qint64 incCount = 1); COntologyStructureSummary *incRoleReflexivityCount(qint64 incCount = 1); COntologyStructureSummary *incRoleIrreflexivityCount(qint64 incCount = 1); COntologyStructureSummary *incConceptFunctionalAtmostCount(qint64 incCount = 1); COntologyStructureSummary *incConceptValueCount(qint64 incCount = 1); COntologyStructureSummary *incConceptNominalIndividualCount(qint64 incCount = 1); COntologyStructureSummary *incConceptSelfCount(qint64 incCount = 1); COntologyStructureSummary *incConceptAutomateChooseCount(qint64 incCount = 1); COntologyStructureSummary *incConceptAutomateStateCount(qint64 incCount = 1); COntologyStructureSummary *incConceptAutomateTransitiveCount(qint64 incCount = 1); qint64 getRoleInverseCount(); qint64 getRoleEquivalenceCount(); qint64 getRoleDisjointCount(); qint64 getRoleRangeConceptCount(); qint64 getRoleDomainConceptCount(); qint64 getRoleAsymmetricCount(); qint64 getRoleSymmetricCount(); qint64 getRoleFunctionalCount(); qint64 getRoleInverseFunctionalCount(); qint64 getRoleTransetivCount(); qint64 getRoleReflexivityCount(); qint64 getRoleIrreflexivityCount(); qint64 getConceptFunctionalAtmostCount(); qint64 getConceptValueCount(); qint64 getConceptIndividualCount(); qint64 getConceptSelfCount(); qint64 getConceptAutomateChooseCount(); qint64 getConceptAutomateStateCount(); qint64 getConceptAutomateTransitiveCount(); bool hasRoleInverses(); bool hasRoleEquivalences(); bool hasRoleDisjoints(); bool hasRoleRangeConcepts(); bool hasRoleDomainConcepts(); bool hasRoleAsymmetrics(); bool hasRoleSymmetrics(); bool hasRoleFunctionals(); bool hasRoleInverseFunctionals(); bool hasRoleTransetivs(); bool hasRoleReflexivitys(); bool hasRoleIrreflexivitys(); bool hasConceptFunctionalAtmosts(); bool hasConceptValues(); bool hasConceptNominalIndividual(); bool hasConceptSelfs(); bool hasConceptAutomateChooses(); bool hasConceptAutomateStates(); bool hasConceptAutomateTransitives(); COntologyStructureSummary *setNegationDisjunctionsOccurrence(bool occured = true); COntologyStructureSummary *setExistensialOccurrence(bool occured = true); COntologyStructureSummary *setCardinalityOccurrence(bool occured = true); COntologyStructureSummary *setQualifiedCardinalityOccurrence(bool occured = true); COntologyStructureSummary *setFunctionalityOccurrence(bool occured = true); COntologyStructureSummary *setTransitivityOccurrence(bool occured = true); COntologyStructureSummary *setRoleHierarchyOccurrence(bool occured = true); COntologyStructureSummary *setComplexSubRoleOccurrence(bool occured = true); COntologyStructureSummary *setUniversalRoleOccurrence(bool occured = true); COntologyStructureSummary *setInverseOccurrence(bool occured = true); COntologyStructureSummary *setNominalIndividualOccurrence(bool occured = true); COntologyStructureSummary *setNominalOccurrence(bool occured = true); COntologyStructureSummary *setGroundingOccurrence(bool occured = true); COntologyStructureSummary *setDatatypeOccurrence(bool occured = true); bool hasNegationDisjunctionsOccurrence(); bool hasCardinalityOccurrence(); bool hasExistensialOccurrence(); bool hasQualifiedCardinalityOccurrence(); bool hasFunctionalityOccurrence(); bool hasTransitivityOccurrence(); bool hasRoleHierarchyOccurrence(); bool hasComplexSubRoleOccurrence(); bool hasUniversalRoleOccurrence(); bool hasInverseOccurrence(); bool hasNominalIndividualOccurrence(); bool hasNominalOccurrence(); bool hasGroundingOccurrence(); bool hasDatatypeOccurrence(); QString getExpressivenessString(); // protected methods protected: COntologyStructureSummary *calculateExpressiveness(); // protected variables protected: bool mAllClassesDeterministic; bool mAllClassesEL; qint64 mConClassCount; qint64 mConCount; qint64 mRoleObPropCount; qint64 mDataPropCount; qint64 mConGCICount; qint64 mConIntersectionCount; qint64 mConUnionCount; qint64 mConNegCount; qint64 mConSomeCount; qint64 mConOnlyCount; qint64 mConAtmostCount; qint64 mConAtleastCount; qint64 mConQualAtleastCount; qint64 mConQualAtmostCount; qint64 mConNonqualAtleastCount; qint64 mConNonqualAtmostCount; qint64 mConSubclassCount; qint64 mConEquivalenceCount; qint64 mConPrimCount; qint64 mConCompCount; qint64 mPrimClassCount; qint64 mCompClassCount; qint64 mConFuncAtmostCount; qint64 mConValueCount; qint64 mConNominalIndividualCount; qint64 mConSelfCount; qint64 mConAutChooceCount; qint64 mConAutStateCount; qint64 mConAutTransCount; qint64 mRoleInvCount; qint64 mRoleEqCount; qint64 mRoleDisjCount; qint64 mRoleRangeConCount; qint64 mRoleDomainConCount; qint64 mRoleAsymmetricCount; qint64 mRoleSymmetricCount; qint64 mRoleFuncCount; qint64 mRoleInvFuncCount; qint64 mRoleTransCount; qint64 mRoleRefCount; qint64 mRoleIrrefCount; qint64 mIndiCount; bool mNegDisOccurrence; bool mExistOccurrence; bool mCardOccurrence; bool mQualCardOccurrence; bool mFunctionalityOccurrence; bool mTransitivityOccurrence; bool mRoleHierarchyOccurrence; bool mComplexSubRoleOccurrence; bool mUniversalRoleOccurrence; bool mInverseOccurrence; bool mNominalIndividualOccurrence; bool mNominalOccurrence; bool mGroundingOccurrence; bool mDatatypeOccurrence; QString expressString; bool mExpressStringCalc; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYSTRUCTURESUMMARY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualData.cpp0000644000175000017500000000202712520551206025342 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CIndividualData::CIndividualData() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptProcessData.h0000644000175000017500000000715312520551174025662 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTPROCESSDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTPROCESSDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CConceptData.h" #include "CUnsatisfiableCachingTags.h" #include "CConceptRoleBranchingTrigger.h" #include "CConceptReferenceLinking.h" #include "CReplacementData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CConceptProcessData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptProcessData : public CConceptData { // public methods public: //! Constructor CConceptProcessData(); CConceptProcessData* initConceptProcessExtensionData(CConceptRoleBranchingTrigger* conceptRoleBranchTrigger, CReplacementData* replacementData); CConceptRoleBranchingTrigger* getConceptRoleBranchTrigger(); bool hasConceptRoleBranchTrigger(); CConceptProcessData* setConceptRoleBranchTrigger(CConceptRoleBranchingTrigger* conceptRoleBranchTrigger); CUnsatisfiableCachingTags* getUnsatisfiableCachingTags(bool conceptNegation); bool hasUnsatisfiableCachingTags(bool conceptNegation); CConceptProcessData* setUnsatisfiableCachingTags(bool conceptNegation, CUnsatisfiableCachingTags* tags); CReplacementData* getReplacementData(); CConceptProcessData* setReplacementData(CReplacementData* replacementData); CConceptReferenceLinking* getConceptReferenceLinking(); CConceptProcessData* setConceptReferenceLinking(CConceptReferenceLinking* refLinking); bool isInvalidatedReferenceLinking(); CConceptProcessData* setInvalidatedReferenceLinking(bool invalidatedReferenceLinking); bool isCoreBlockingConcept(bool negated); CConceptProcessData* setCoreBlockingConcept(bool negated, bool coreBlockingConcept = true); bool hasPropagationIntoCreationDirection(); CConceptProcessData* setPropagationIntoCreationDirection(bool propagationIntoCreationDirection); bool hasInferRelevantFlag(); CConceptProcessData* setInferRelevantFlag(bool flag); // protected methods protected: // protected variables protected: CConceptRoleBranchingTrigger* mConceptRoleBranchTrigger; CReplacementData* mReplacementData; CUnsatisfiableCachingTags* mUnsatCachingTags[2]; CConceptReferenceLinking* mRefLinking; bool mInvalidatedRefLinking; bool mPropagationIntoCreationDirection; bool mInferRelevantFlag; bool mCoreConceptFlags[2]; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTPROCESSDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceTypes.h0000644000175000017500000000753212520551204026702 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETYPES_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETYPES_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceType.h" #include "CDatatypeValueSpaceRealType.h" #include "CDatatypeValueSpaceUnknownType.h" #include "CDatatypeValueSpaceStringType.h" #include "CDatatypeValueSpaceBooleanType.h" #include "CDatatypeValueSpaceDoubleType.h" #include "CDatatypeValueSpaceFloatType.h" #include "CDatatypeValueSpaceIRIType.h" #include "CDatatypeValueSpaceXMLType.h" #include "CDatatypeValueSpaceDateTimeType.h" #include "CDatatypeValueSpaceBinaryHexDataType.h" #include "CDatatypeValueSpaceBinaryBase64DataType.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceTypes * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceTypes { // public methods public: //! Constructor CDatatypeValueSpaceTypes(); static CDatatypeValueSpaceTypes* getValueSpaceTypes(); CDatatypeValueSpaceRealType* getValueSpaceRealType(); CDatatypeValueSpaceUnknownType* getValueSpaceUnkownType(); CDatatypeValueSpaceStringType* getValueSpaceStringType(); CDatatypeValueSpaceBooleanType* getValueSpaceBooleanType(); CDatatypeValueSpaceDoubleType* getValueSpaceDoubleType(); CDatatypeValueSpaceFloatType* getValueSpaceFloatType(); CDatatypeValueSpaceIRIType* getValueSpaceIRIType(); CDatatypeValueSpaceBinaryHexDataType* getValueSpaceBinaryHexDataType(); CDatatypeValueSpaceBinaryBase64DataType* getValueSpaceBinaryBase64DataType(); CDatatypeValueSpaceXMLType* getValueSpaceXMLType(); CDatatypeValueSpaceDateTimeType* getValueSpaceDateTimeType(); CDatatypeValueSpaceType* getValueSpaceTypeLinker(); // protected methods protected: // protected variables protected: static QMutex* mCreationMutex; static CDatatypeValueSpaceTypes* mValueSpaceTypes; CDatatypeValueSpaceRealType* mRealValueSpaceType; CDatatypeValueSpaceUnknownType* mUnknownValueSpaceType; CDatatypeValueSpaceStringType* mStringValueSpaceType; CDatatypeValueSpaceBooleanType* mBooleanValueSpaceType; CDatatypeValueSpaceDoubleType* mDoubleValueSpaceType; CDatatypeValueSpaceFloatType* mFloatValueSpaceType; CDatatypeValueSpaceIRIType* mIRIValueSpaceType; CDatatypeValueSpaceBinaryHexDataType* mBinaryHexValueSpaceType; CDatatypeValueSpaceBinaryBase64DataType* mBinaryBase64ValueSpaceType; CDatatypeValueSpaceXMLType* mXMLValueSpaceType; CDatatypeValueSpaceDateTimeType* mDateTimeValueSpaceType; CDatatypeValueSpaceType* mValueSpaceTypeLinker; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETYPES_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceIRIType.cpp0000644000175000017500000000370012520551202027405 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceIRIType.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceIRIType::CDatatypeValueSpaceIRIType() : CDatatypeValueSpaceCompareType(CDatatypeValueSpaceIRIType::VALUESPACEIRITYPE) { mMinValue = new CDataLiteralIRIValue(); mMinValue->initValueFromLength(0); mMaxValue = new CDataLiteralIRIValue(); mMaxValue->initValueFromInfiniteLength(); } CDataLiteralIRIValue* CDatatypeValueSpaceIRIType::getMinimumDataLiteralIRIValue() { return mMinValue; } CDataLiteralIRIValue* CDatatypeValueSpaceIRIType::getMaximumDataLiteralIRIValue() { return mMaxValue; } CDataLiteralCompareValue* CDatatypeValueSpaceIRIType::getMinimumDataLiteralCompareValue() { return mMinValue; } CDataLiteralCompareValue* CDatatypeValueSpaceIRIType::getMaximumDataLiteralCompareValue() { return mMaxValue; } bool CDatatypeValueSpaceIRIType::hasInfiniteManyValues() { return true; } cint64 CDatatypeValueSpaceIRIType::getMaximumValueCount() { return CINT64_MAX; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStatus.h0000644000175000017500000000503012520551212027172 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_COntologyProcessingStatus_H #define KONCLUDE_REASONER_ONTOLOGY_COntologyProcessingStatus_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyProcessingStatus * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyProcessingStatus { // public methods public: //! Constructor COntologyProcessingStatus(); cint64 getProcessingFlags(); COntologyProcessingStatus* setProcessingFlags(cint64 flags); cint64 getErrorFlags(); COntologyProcessingStatus* setErrorFlags(cint64 flags); bool hasPartialProcessingFlags(cint64 flags); bool hasPartialErrorFlags(cint64 flags); const static cint64 PSUNPROCESSED = 0x0001; const static cint64 PSPARTIALLYPROCESSED = 0x0002; const static cint64 PSCOMPLETELYYPROCESSED = 0x0004; const static cint64 PSSUCESSFULL = 0x0001; const static cint64 PSFAILED = 0x0002; const static cint64 PSFAILEDREQUIREMENT = 0x0004; const static cint64 PSUNSUPPORTED = 0x0008; const static cint64 PSDECIDABILITYVIOLATION = 0x0010; const static cint64 PSINCONSITENT = 0x0020; // protected methods protected: // protected variables protected: cint64 mProcessingFlags; cint64 mErrorFlags; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_COntologyProcessingStatus_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptSatisfiableReferenceLinkingData.cpp0000644000175000017500000000303012520551176032150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptSatisfiableReferenceLinkingData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptSatisfiableReferenceLinkingData::CConceptSatisfiableReferenceLinkingData() { mClassifierReference = nullptr; } CClassificationConceptReferenceLinking* CConceptSatisfiableReferenceLinkingData::getClassifierReferenceLinkingData() { return mClassifierReference; } CConceptSatisfiableReferenceLinkingData* CConceptSatisfiableReferenceLinkingData::setClassifierReferenceLinkingData(CClassificationConceptReferenceLinking* classRefLinkData) { mClassifierReference = classRefLinkData; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleChainVector.h0000644000175000017500000000376112520551214025161 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CROLECHAINVECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CROLECHAINVECTOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CRoleChain.h" #include "CBoxContext.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CRoleChainVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleChainVector : public CDefaultDynamicReferenceVectorBase { // public methods public: //! Constructor CRoleChainVector(CBoxContext* boxContext = nullptr); //! Destructor virtual ~CRoleChainVector(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CROLECHAINVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CActiveEntityCountVector.cpp0000644000175000017500000000666012520551172027275 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CActiveEntityCountVector.h" namespace Konclude { namespace Reasoner { namespace Ontology { CActiveEntityCountVector::CActiveEntityCountVector(CContext* context) { mContext = context; mCountVector = nullptr; mVectorSize = 0; } CActiveEntityCountVector* CActiveEntityCountVector::initActiveEntityCountVector(CActiveEntityCountVector* vector) { mVectorSize = 0; mCountVector = nullptr; if (vector) { increaseVectorSize(vector->getVectorSize()); for (cint64 i = 0; i < vector->mVectorSize; ++i) { mCountVector[i] = vector->mCountVector[i]; } } return this; } CActiveEntityCountVector* CActiveEntityCountVector::incActiveEntityCount(CExpressionEntity* entity, cint64 incCount) { CActiveEntityCountItem* item = getActiveEntityCountItem(entity); if (item) { item->incActiveCount(incCount); } return this; } CActiveEntityCountVector* CActiveEntityCountVector::decActiveEntityCount(CExpressionEntity* entity, cint64 decCount) { CActiveEntityCountItem* item = getActiveEntityCountItem(entity); if (item) { item->decActiveCount(decCount); } return this; } CActiveEntityCountItem* CActiveEntityCountVector::getActiveEntityCountItem(CExpressionEntity* entity) { if (entity) { cint64 itemID = entity->getEntityID(); if (itemID < mVectorSize) { CActiveEntityCountItem* item = &mCountVector[itemID]; item->setEntity(entity); return item; } } return nullptr; } bool CActiveEntityCountVector::increaseVectorSize(cint64 newSize) { if (newSize > mVectorSize) { CActiveEntityCountItem* tmpCountVector = CObjectAllocator::allocateAndConstructArray(mContext->getMemoryAllocationManager(),newSize); if (mCountVector) { for (cint64 i = 0; i < mVectorSize; ++i) { tmpCountVector[i] = mCountVector[i]; } CObjectAllocator::destroyAndReleaseArray(mCountVector,mContext->getMemoryAllocationManager()); } mCountVector = tmpCountVector; mVectorSize = newSize; return true; } return false; } cint64 CActiveEntityCountVector::getVectorSize() { return mVectorSize; } CActiveEntityCountVector* CActiveEntityCountVector::clearActiveEntityCount() { for (cint64 i = 0; i < mVectorSize; ++i) { mCountVector[i].setActiveCount(0); } return this; } CActiveEntityIterator CActiveEntityCountVector::getActiveEntityIterator() { return CActiveEntityIterator(mCountVector,mVectorSize); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralIRIValue.cpp0000644000175000017500000001264112520551200026204 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralIRIValue.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDataLiteralIRIValue::CDataLiteralIRIValue() { clearValue(); } CDataLiteralValue::DATA_LITERAL_VALUE_TYPE CDataLiteralIRIValue::getDataValueType() { return CDataLiteralValue::DLVT_IRI; } CDataLiteralCompareValue* CDataLiteralIRIValue::initValue(CDataLiteralCompareValue* value) { clearValue(); CDataLiteralIRIValue* iriValue = dynamic_cast(value); if (iriValue) { mInfiniteLength = iriValue->mInfiniteLength; mLength = iriValue->mLength; mIRIString = iriValue->mIRIString; } return this; } CDataLiteralIRIValue* CDataLiteralIRIValue::initValueFromInfiniteLength() { clearValue(); mInfiniteLength = true; return this; } CDataLiteralIRIValue* CDataLiteralIRIValue::initValueFromLength(cuint64 length) { clearValue(); mLength = length; return this; } CDataLiteralIRIValue* CDataLiteralIRIValue::initValueFromIRIString(const QString& iriString) { clearValue(); mIRIString = iriString; return this; } CDataLiteralIRIValue* CDataLiteralIRIValue::initValue(CDataLiteralIRIValue* value) { if (value) { mInfiniteLength = value->mInfiniteLength; mLength = value->mLength; mIRIString = value->mIRIString; } return this; } CDataLiteralIRIValue* CDataLiteralIRIValue::clearValue() { mInfiniteLength = false; mLength = 0; mIRIString.clear(); return this; } bool CDataLiteralIRIValue::isInfiniteLength() { return mInfiniteLength; } cuint64 CDataLiteralIRIValue::getLength() { if (mLength > 0) { return mLength; } else { return mIRIString.length(); } } QString CDataLiteralIRIValue::getIRIValue() { return mIRIString; } bool CDataLiteralIRIValue::isEqualTo(CDataLiteralValue* value) { CDataLiteralIRIValue* iriValue = dynamic_cast(value); if (iriValue) { return isEqualTo(iriValue); } return false; } bool CDataLiteralIRIValue::isLessEqualThan(CDataLiteralCompareValue* value) { CDataLiteralIRIValue* iriValue = dynamic_cast(value); if (iriValue) { return isEqualTo(iriValue) || isLessThan(iriValue); } return false; } bool CDataLiteralIRIValue::isLessEqualThan(CDataLiteralIRIValue* iriValue) { return isEqualTo(iriValue) || isLessThan(iriValue); } bool CDataLiteralIRIValue::isEqualTo(CDataLiteralCompareValue* value) { CDataLiteralIRIValue* iriValue = dynamic_cast(value); if (iriValue) { return isEqualTo(iriValue); } return false; } bool CDataLiteralIRIValue::isEqualTo(CDataLiteralIRIValue* iriValue) { if (mInfiniteLength && iriValue->mInfiniteLength) { return true; } if (mInfiniteLength || iriValue->mInfiniteLength) { return false; } if (mLength > 0 && mLength == iriValue->mLength) { return true; } if (mIRIString == iriValue->mIRIString) { return true; } return false; } bool CDataLiteralIRIValue::isGreaterEqualThan(CDataLiteralIRIValue* iriValue) { return isEqualTo(iriValue) || isGreaterThan(iriValue); } bool CDataLiteralIRIValue::isGreaterEqualThan(CDataLiteralCompareValue* value) { CDataLiteralIRIValue* iriValue = dynamic_cast(value); if (iriValue) { return isEqualTo(iriValue) || isGreaterThan(iriValue); } return false; } bool CDataLiteralIRIValue::isGreaterThan(CDataLiteralCompareValue* value) { return value->isLessThan(this); } bool CDataLiteralIRIValue::isGreaterThan(CDataLiteralIRIValue* iriValue) { return iriValue->isLessThan(this); } bool CDataLiteralIRIValue::isLessThan(CDataLiteralCompareValue* value) { CDataLiteralIRIValue* iriValue = dynamic_cast(value); if (iriValue) { return isLessThan(iriValue); } return false; } bool CDataLiteralIRIValue::isLessThan(CDataLiteralIRIValue* iriValue) { if (mInfiniteLength) { return false; } if (!mInfiniteLength && iriValue->mInfiniteLength) { return true; } if (getLength() < iriValue->getLength()) { return true; } else if (getLength() > iriValue->getLength()) { return false; } else { int stringComp = mIRIString.compare(iriValue->mIRIString); if (stringComp < 0) { return true; } else if (stringComp > 0) { return false; } } return false; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceBooleanTriggers.cpp0000644000175000017500000000303512520551200031205 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceBooleanTriggers.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceBooleanTriggers::CDatatypeValueSpaceBooleanTriggers(CBoxContext* boxContext) : CDatatypeValueSpaceCompareTriggers(boxContext) { } CDatatypeValueSpaceBooleanTriggers* CDatatypeValueSpaceBooleanTriggers::initValueSpaceBooleanTriggers(CDatatypeValueSpaceBooleanTriggers* data) { initValueSpaceCompareTriggers(data); return this; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceBooleanTriggers::getBooleanConceptTriggeringData() { return getValueSpaceConceptTriggeringData(); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralDoubleValue.h0000644000175000017500000000564312520551176026460 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATALITERALDOUBLEVALUE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATALITERALDOUBLEVALUE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDataLiteralValue.h" #include "CDataLiteralCompareValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataLiteralDoubleValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralDoubleValue : public CDataLiteralCompareValue { // public methods public: //! Constructor CDataLiteralDoubleValue(); virtual CDataLiteralCompareValue* initValue(CDataLiteralCompareValue* value); CDataLiteralDoubleValue* initValueFromDouble(double doubleValue); CDataLiteralDoubleValue* initValueFromInfinite(bool negative); CDataLiteralDoubleValue* initValue(CDataLiteralDoubleValue* value); CDataLiteralDoubleValue* clearValue(); virtual DATA_LITERAL_VALUE_TYPE getDataValueType(); double getDouble(); bool isInfinite(); bool isNegative(); bool isEqualTo(CDataLiteralValue* value); bool isLessEqualThan(CDataLiteralCompareValue* value); bool isLessThan(CDataLiteralCompareValue* value); bool isEqualTo(CDataLiteralCompareValue* value); bool isGreaterEqualThan(CDataLiteralCompareValue* value); bool isGreaterThan(CDataLiteralCompareValue* value); bool isLessEqualThan(CDataLiteralDoubleValue* value); bool isLessThan(CDataLiteralDoubleValue* value); bool isEqualTo(CDataLiteralDoubleValue* value); bool isGreaterEqualThan(CDataLiteralDoubleValue* value); bool isGreaterThan(CDataLiteralDoubleValue* value); // protected methods protected: // protected variables protected: double mDouble; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATALITERALDOUBLEVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyCoreConceptCyclesData.h0000644000175000017500000000441412520551210030016 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCORECONCEPTCYCLESDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCORECONCEPTCYCLESDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CConceptCycleData.h" #include "COntologyContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyCoreConceptCyclesData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyCoreConceptCyclesData { // public methods public: //! Constructor COntologyCoreConceptCyclesData(COntologyContext* ontoContext = nullptr); ~COntologyCoreConceptCyclesData(); CBOXHASH* getConceptCycleHash(); CBOXLIST* getConceptCycleList(); cint64 getConceptCycleCount(); COntologyCoreConceptCyclesData* installCycle(CConceptCycleData* cycleData); // protected methods protected: // protected variables protected: COntologyContext* mContext; CBOXHASH mConceptCycleHash; CBOXLIST mCycleList; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCORECONCEPTCYCLESDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringData.cpp0000644000175000017500000000733212520551204031022 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceTriggeringData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceTriggeringData::CDatatypeValueSpaceTriggeringData() { mValue = nullptr; } CDatatypeValueSpaceTriggeringData* CDatatypeValueSpaceTriggeringData::initValueTriggeringData(CDatatypeValueSpaceTriggeringData* valueData, CDataLiteralCompareValue* value) { mValue = value; if (valueData) { mValueTriggerData.initConceptTriggeringData(&valueData->mValueTriggerData); mMinInclusiveTriggerData.initConceptTriggeringData(&valueData->mMinInclusiveTriggerData); mMinExclusiveTriggerData.initConceptTriggeringData(&valueData->mMinExclusiveTriggerData); mMaxInclusiveTriggerData.initConceptTriggeringData(&valueData->mMaxInclusiveTriggerData); mMaxExclusiveTriggerData.initConceptTriggeringData(&valueData->mMaxExclusiveTriggerData); } else { mValueTriggerData.initConceptTriggeringData(nullptr); mMinInclusiveTriggerData.initConceptTriggeringData(nullptr); mMinExclusiveTriggerData.initConceptTriggeringData(nullptr); mMaxInclusiveTriggerData.initConceptTriggeringData(nullptr); mMaxExclusiveTriggerData.initConceptTriggeringData(nullptr); } return this; } CDataLiteralCompareValue* CDatatypeValueSpaceTriggeringData::getValue() { return mValue; } CDatatypeValueSpaceTriggeringData* CDatatypeValueSpaceTriggeringData::setValue(CDataLiteralCompareValue* value) { mValue = value; return this; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceTriggeringData::getDirectValueTriggeringData() { return &mValueTriggerData; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceTriggeringData::getMinInclusiveTriggeringData() { return &mMinInclusiveTriggerData; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceTriggeringData::getMinExclusiveTriggeringData() { return &mMinExclusiveTriggerData; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceTriggeringData::getMaxInclusiveTriggeringData() { return &mMaxInclusiveTriggerData; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceTriggeringData::getMaxExclusiveTriggeringData() { return &mMaxExclusiveTriggerData; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceTriggeringData::getTriggeringData(bool min, bool inclusive) { if (min && inclusive) { return getMinInclusiveTriggeringData(); } else if (min && !inclusive) { return getMinExclusiveTriggeringData(); } else if (!min && inclusive) { return getMaxInclusiveTriggeringData(); } else { return getMaxExclusiveTriggeringData(); } } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceTriggeringData::getTriggeringData() { return getDirectValueTriggeringData(); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceDateTimeType.cpp0000644000175000017500000000403112520551202030454 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceDateTimeType.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceDateTimeType::CDatatypeValueSpaceDateTimeType() : CDatatypeValueSpaceCompareType(CDatatypeValueSpaceDateTimeType::VALUESPACEDATETIMETYPE) { mMinValue = new CDataLiteralDateTimeValue(); mMinValue->initValueFromFirstDateTime(); mMaxValue = new CDataLiteralDateTimeValue(); mMaxValue->initValueFromLastDateTime(); } CDataLiteralDateTimeValue* CDatatypeValueSpaceDateTimeType::getMinimumDataLiteralDateTimeValue() { return mMinValue; } CDataLiteralDateTimeValue* CDatatypeValueSpaceDateTimeType::getMaximumDataLiteralDateTimeValue() { return mMaxValue; } CDataLiteralCompareValue* CDatatypeValueSpaceDateTimeType::getMinimumDataLiteralCompareValue() { return mMinValue; } CDataLiteralCompareValue* CDatatypeValueSpaceDateTimeType::getMaximumDataLiteralCompareValue() { return mMaxValue; } bool CDatatypeValueSpaceDateTimeType::hasInfiniteManyValues() { return true; } cint64 CDatatypeValueSpaceDateTimeType::getMaximumValueCount() { return CINT64_MAX; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CActiveEntityCountVector.h0000644000175000017500000000513612520551172026737 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CACTIVEENTITYCOUNTVECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CACTIVEENTITYCOUNTVECTOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CConcept.h" #include "CBoxContext.h" #include "CActiveEntityCountItem.h" #include "CActiveEntityIterator.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CActiveEntityCountVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CActiveEntityCountVector { // public methods public: //! Constructor CActiveEntityCountVector(CContext* context = nullptr); CActiveEntityCountVector* initActiveEntityCountVector(CActiveEntityCountVector* vector); CActiveEntityCountVector* incActiveEntityCount(CExpressionEntity* entity, cint64 incCount = 1); CActiveEntityCountVector* decActiveEntityCount(CExpressionEntity* entity, cint64 decCount = 1); CActiveEntityCountItem* getActiveEntityCountItem(CExpressionEntity* entity); CActiveEntityCountVector* clearActiveEntityCount(); bool increaseVectorSize(cint64 newSize); cint64 getVectorSize(); CActiveEntityIterator getActiveEntityIterator(); // protected methods protected: // protected variables protected: CContext* mContext; CActiveEntityCountItem* mCountVector; cint64 mVectorSize; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CACTIVEENTITYCOUNTVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataBox.cpp0000644000175000017500000000204112520551176024004 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataBox.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDataBox::CDataBox() { } CDataBox::~CDataBox() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CUnsatisfiableCachingTags.cpp0000644000175000017500000000577512520551216027363 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CUnsatisfiableCachingTags.h" namespace Konclude { namespace Reasoner { namespace Ontology { CUnsatisfiableCachingTags::CUnsatisfiableCachingTags() { mMinUnsatCachedSize = CINT64_MAX; } cint64 CUnsatisfiableCachingTags::getMinUnsatisfiableCachedSize() { return mMinUnsatCachedSize; } CCachingTags* CUnsatisfiableCachingTags::setMinUnsatisfiableCachedSize(cint64 size) { mMinUnsatCachedSize = size; return this; } bool CUnsatisfiableCachingTags::setMinUnsatisfiableCachedSizeCandidate(cint64 size) { if (size < mMinUnsatCachedSize) { mMinUnsatCachedSize = size; return true; } return false; } bool CUnsatisfiableCachingTags::updateCachingTags(cint64 cachedTagCandidate, cint64 cachingNumberTag, cint64 sizeCandidate) { bool changed = false; changed |= setMinUnsatisfiableCachedSizeCandidate(sizeCandidate); changed |= setMaxCachedTagCandidate(cachedTagCandidate); changed |= setMinCachedTagCandidate(cachedTagCandidate); setLastCachingTag(cachingNumberTag); return changed; } bool CUnsatisfiableCachingTags::candidateTags(cint64& minMaxCachedTag, cint64& maxMinCachedTag, cint64& minUnsatCachedSize, cint64 requiredLastCachingTag) { if (mLastCachingTag >= requiredLastCachingTag) { minMaxCachedTag = qMin(minMaxCachedTag,mMaxCachedTag); maxMinCachedTag = qMax(maxMinCachedTag,mMinCachedTag); minUnsatCachedSize = qMin(minUnsatCachedSize,mMinUnsatCachedSize); return true; } return false; } bool CUnsatisfiableCachingTags::hasCandidateTags(cint64 minMaxCachedTag, cint64 maxMinCachedTag, cint64 requiredLastCachingTag) { if (mLastCachingTag >= requiredLastCachingTag) { if (minMaxCachedTag == mMaxCachedTag || maxMinCachedTag == mMinCachedTag) { return true; } } return false; } bool CUnsatisfiableCachingTags::candidateMinUnsatisfiableSize(cint64& minUnsatCachedSize, cint64 cachedTag) { if (mMinCachedTag == cachedTag && mMaxCachedTag == cachedTag) { minUnsatCachedSize = qMin(minUnsatCachedSize,mMinUnsatCachedSize); return true; } return false; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingRequirement.cpp0000644000175000017500000000223412520551212030545 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyProcessingRequirement.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyProcessingRequirement::COntologyProcessingRequirement() { } bool COntologyProcessingRequirement::isDynamicRequirement() { return false; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualSaturationReferenceLinkingData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualSaturationReferenceLinkingData.cp0000644000175000017500000000350512520551206032371 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualSaturationReferenceLinkingData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CIndividualSaturationReferenceLinkingData::CIndividualSaturationReferenceLinkingData() { mIndiProcessNodeForIndividual = nullptr; mSaturationID = 0; } CProcessReference* CIndividualSaturationReferenceLinkingData::getIndividualProcessNodeForConcept() { return mIndiProcessNodeForIndividual; } CIndividualSaturationReferenceLinkingData* CIndividualSaturationReferenceLinkingData::setIndividualProcessNodeForIndividual(CProcessReference* indiNode) { mIndiProcessNodeForIndividual = indiNode; return this; } CIndividualSaturationReferenceLinkingData* CIndividualSaturationReferenceLinkingData::setSaturationID(cint64 saturationID) { mSaturationID = saturationID; return this; } cint64 CIndividualSaturationReferenceLinkingData::getSaturationID() { return mSaturationID; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralRealValue.h0000644000175000017500000001057312520551200026113 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATALITERALREALVALUE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATALITERALREALVALUE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDataLiteralValue.h" #include "CDataLiteralCompareValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataLiteralRealValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralRealValue : public CDataLiteralCompareValue { // public methods public: //! Constructor CDataLiteralRealValue(); static const cint64 DLRV_INTEGER_FLAG = 0x01; static const cint64 DLRV_DECIMAL_FLAG = 0x02; static const cint64 DLRV_RATIONAL_FLAG = 0x04; virtual CDataLiteralCompareValue* initValue(CDataLiteralCompareValue* value); CDataLiteralRealValue* initRationalValueFromInfinite(bool negative); CDataLiteralRealValue* initRationalValueFromFraction(cint64 numeratorValue, cint64 denominatorValue); CDataLiteralRealValue* initRationalValueFromFraction(cuint64 numeratorValue, cuint64 denominatorValue, bool negative); CDataLiteralRealValue* initRationalValueFromDecimal(cint64 integerValue, cint64 decimalValue, cint64 precedingZerors = 0); CDataLiteralRealValue* initRationalValueFromDecimal(cuint64 integerValue, cuint64 decimalValue, bool negative, cint64 precedingZerors = 0); CDataLiteralRealValue* initRationalValueFromInteger(cint64 value); CDataLiteralRealValue* initRationalValueFromInteger(cuint64 value, bool negation); CDataLiteralRealValue* initRationalValueFromNextIntegerValue(CDataLiteralRealValue* value); CDataLiteralRealValue* initValue(CDataLiteralRealValue* value); CDataLiteralRealValue* clearValue(); CDataLiteralRealValue* clearFlags(); virtual QString getValueString(); bool hasFlag(cint64 flag); virtual DATA_LITERAL_VALUE_TYPE getDataValueType(); bool isNegative(); bool isInfinite(); cuint64 getInteger(); cuint64 getNumerator(); cuint64 getDenominator(); bool isInfiniteBigNumber(); cint64 getPosNegInteger(); CDataLiteralRealValue* setNegative(bool negative); CDataLiteralRealValue* setInteger(cuint64 integer); CDataLiteralRealValue* setNumerator(cuint64 numerator); CDataLiteralRealValue* setDenominator(cuint64 denominator); bool isEqualTo(CDataLiteralValue* value); bool isLessEqualThan(CDataLiteralCompareValue* value); bool isLessThan(CDataLiteralCompareValue* value); bool isEqualTo(CDataLiteralCompareValue* value); bool isGreaterEqualThan(CDataLiteralCompareValue* value); bool isGreaterThan(CDataLiteralCompareValue* value); bool isLessEqualThan(CDataLiteralRealValue* value); bool isLessThan(CDataLiteralRealValue* value); bool isEqualTo(CDataLiteralRealValue* value); bool isGreaterEqualThan(CDataLiteralRealValue* value); bool isGreaterThan(CDataLiteralRealValue* value); // protected methods protected: CDataLiteralRealValue* identifyFlags(); bool normalize(); // protected variables protected: bool mNegative; bool mInfinite; cuint64 mInteger; cuint64 mNumerator; cuint64 mDenominator; cint64 mFlags; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATALITERALREALVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleAssertionLinker.h0000644000175000017500000000400012520551214026053 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CROLEASSERTIONLINKER_H #define KONCLUDE_REASONER_ONTOLOGY_CROLEASSERTIONLINKER_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CRole.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CRoleAssertionLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleAssertionLinker : public CLinkerBase { // public methods public: //! Constructor CRoleAssertionLinker(); CRoleAssertionLinker* initRoleAssertionLinker(CRole* role, CIndividual* individual); CIndividual* getIndividual(); CRole* getRole(); // protected methods protected: // protected variables protected: CIndividual* mIndividual; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CROLEASSERTIONLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CNamePrefix.h0000644000175000017500000000414312520551206024164 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CNAMEPREFIX_H #define KONCLUDE_REASONER_ONTOLOGY_CNAMEPREFIX_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" // Other includes #include "Utilities/CAllocationObject.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CNamePrefix * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNamePrefix : public CAllocationObject { // public methods public: //! Constructor CNamePrefix(const QString &abbPrefixString = QString(), const QString &fullPrefixString = QString()); //! Destructor virtual ~CNamePrefix(); virtual CNamePrefix *init(const QString &abbPrefixString, const QString &fullPrefixString); virtual QString getAbbreviatedPrefixString(); virtual QString getPrefixString(); // protected methods protected: // protected variables protected: QString abbString; QString totString; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CNAMEPREFIX_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceXMLTriggers.h0000644000175000017500000000403412520551204027737 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEXMLTRIGGERS_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEXMLTRIGGERS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareTriggers.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceXMLTriggers * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceXMLTriggers : public CDatatypeValueSpaceCompareTriggers { // public methods public: //! Constructor CDatatypeValueSpaceXMLTriggers(CBoxContext* boxContext); CDatatypeValueSpaceXMLTriggers* initValueSpaceXMLTriggers(CDatatypeValueSpaceXMLTriggers* data); CDatatypeValueSpaceConceptTriggeringData* getXMLConceptTriggeringData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEXMLTRIGGERS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeVector.h0000644000175000017500000000374012520551204025064 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDatatypeVector_H #define KONCLUDE_REASONER_ONTOLOGY_CDatatypeVector_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatype.h" #include "CBoxContext.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeVector : public CDefaultDynamicReferenceVectorBase { // public methods public: //! Constructor CDatatypeVector(CContext* context = nullptr); //! Destructor virtual ~CDatatypeVector(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDatatypeVector_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntology.h0000644000175000017500000000434312520551210023735 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGY_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGY_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CTerminology.h" #include "COntologyStructureSummary.h" #include "CABox.h" #include "CTBox.h" #include "CRBox.h" // Other includes #include "Reasoner/Taxonomy/CTaxonomy.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Taxonomy; namespace Ontology { /*! * * \class COntology * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntology : public CTerminology { // public methods public: //! Constructor COntology(); //! Destructor virtual ~COntology(); virtual CTaxonomy *getConceptTaxonomy() = 0; virtual bool hasConceptTaxonomy() = 0; virtual COntologyStructureSummary *getStructureSummary() = 0; virtual QString getOntologyName(); virtual COntology *setOntologyName(const QString &name); virtual qint64 getOntologyID() const; virtual COntology *setOntologyID(qint64 id); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingRequirementExpander.cpp0000644000175000017500000002101612520551212032233 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyProcessingRequirementExpander.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyProcessingRequirementExpander::COntologyProcessingRequirementExpander() { COntologyProcessingStepVector* ontProStepVec = COntologyProcessingStepVector::getProcessingStepVectorInstance(); mActiveCountOntProStepReq = new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSACTIVECOUNT), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0); mBuildOntProStepReq = new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSBUILD), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0); mPreprocessOntProStepReq = new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSPREPROCESS), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0); mConsistencyOntProStepReq = new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSCONSISTENCY), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0); mIndividualOntProStepReq = new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSPRECOMPUTEINDIVIDUAL), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0); mSaturationOntProStepReq = new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSPRECOMPUTESATURATION), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0); mPrecomputeOntProStepReq = new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSPRECOMPUTECYCLES), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0); mClassClassifyOntProStepReq = new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSCLASSCLASSIFY), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0); mRequiredConsistencyOntProStepReq = new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSCONSISTENCY), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, COntologyProcessingStatus::PSINCONSITENT); mConceptRealizeOntProStepReq = new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSCONCEPTREALIZE), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0); mSameIndividualsRealizeOntProStepReq = new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSSAMEINDIVIDUALSREALIZE), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0); mRoleRealizeOntProStepReq = new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSROLEREALIZE), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0); } COntologyProcessingRequirementExpander::~COntologyProcessingRequirementExpander() { delete mActiveCountOntProStepReq; delete mBuildOntProStepReq; delete mPreprocessOntProStepReq; delete mConsistencyOntProStepReq; delete mIndividualOntProStepReq; delete mSaturationOntProStepReq; delete mPrecomputeOntProStepReq; delete mClassClassifyOntProStepReq; delete mRequiredConsistencyOntProStepReq; delete mConceptRealizeOntProStepReq; delete mRoleRealizeOntProStepReq; delete mSameIndividualsRealizeOntProStepReq; } const QList COntologyProcessingRequirementExpander::getUnsatisfiedRequirementsExpanded(const QList& requirements, CConcreteOntology* ontology) { QList mActualReqList; QList mCheckReqList; QSet mCheckReqSet; for (QList::const_iterator it = requirements.constBegin(), itEnd = requirements.constEnd(); it != itEnd; ++it) { COntologyProcessingRequirement* requirement = *it; if (!mCheckReqSet.contains(requirement)) { mCheckReqSet.insert(requirement); mCheckReqList.append(requirement); } } while (!mCheckReqList.isEmpty()) { COntologyProcessingRequirement* requirement = mCheckReqList.takeFirst(); if (!requirement->isRequirementSatisfied(ontology)) { COntologyProcessingStepRequirement* reqProStep = dynamic_cast(requirement); if (reqProStep) { COntologyProcessingStep* proStep = reqProStep->getRequiredProcessingStep(); if (proStep) { QList* additionalRequirements = proStep->getProcessingRequirementList(); for (QList::const_iterator it = additionalRequirements->constBegin(), itEnd = additionalRequirements->constEnd(); it != itEnd; ++it) { COntologyProcessingRequirement* additionalRequirement = *it; if (!mCheckReqSet.contains(additionalRequirement)) { mCheckReqSet.insert(additionalRequirement); mCheckReqList.append(additionalRequirement); } } } } mActualReqList.append(requirement); } } return mActualReqList; } COntologyProcessingStepRequirement* COntologyProcessingRequirementExpander::getRequiredConsistencyOntologyProcessingStepRequirement() { return mRequiredConsistencyOntProStepReq; } COntologyProcessingStepRequirement* COntologyProcessingRequirementExpander::getRequiredIndividualPrecomputationOntologyProcessingStepRequirement() { return mIndividualOntProStepReq; } COntologyProcessingStepRequirement* COntologyProcessingRequirementExpander::getCompletedDefaultOntologyProcessingStepRequirement(COntologyProcessingStep::PROCESSINGSTEPTYPE processingStep) { COntologyProcessingStepRequirement* ontProStepReq = nullptr; if (processingStep == COntologyProcessingStep::OPSACTIVECOUNT) { ontProStepReq = mActiveCountOntProStepReq; } else if (processingStep == COntologyProcessingStep::OPSBUILD) { ontProStepReq = mBuildOntProStepReq; } else if (processingStep == COntologyProcessingStep::OPSPREPROCESS) { ontProStepReq = mPreprocessOntProStepReq; } else if (processingStep == COntologyProcessingStep::OPSCONSISTENCY) { ontProStepReq = mConsistencyOntProStepReq; } else if (processingStep == COntologyProcessingStep::OPSPRECOMPUTEINDIVIDUAL) { ontProStepReq = mIndividualOntProStepReq; } else if (processingStep == COntologyProcessingStep::OPSPRECOMPUTESATURATION) { ontProStepReq = mSaturationOntProStepReq; } else if (processingStep == COntologyProcessingStep::OPSPRECOMPUTECYCLES) { ontProStepReq = mPrecomputeOntProStepReq; } else if (processingStep == COntologyProcessingStep::OPSCLASSCLASSIFY) { ontProStepReq = mClassClassifyOntProStepReq; } else if (processingStep == COntologyProcessingStep::OPSCONCEPTREALIZE) { ontProStepReq = mConceptRealizeOntProStepReq; } else if (processingStep == COntologyProcessingStep::OPSROLEREALIZE) { ontProStepReq = mRoleRealizeOntProStepReq; } else if (processingStep == COntologyProcessingStep::OPSSAMEINDIVIDUALSREALIZE) { ontProStepReq = mSameIndividualsRealizeOntProStepReq; } return ontProStepReq; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CNominalSchemaTemplate.cpp0000644000175000017500000000747412520551210026700 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNominalSchemaTemplate.h" namespace Konclude { namespace Reasoner { namespace Ontology { CNominalSchemaTemplate::CNominalSchemaTemplate() { } CNominalSchemaTemplate* CNominalSchemaTemplate::initNominalSchemaTemplate(CBOXSET* nomSchemaConSet, CBOXHASH* conceptNomSchemaConceptsHash, CBOXHASH* absorbableConceptNomSchemaConceptsHash) { mConceptNomSchemaConceptsHash = conceptNomSchemaConceptsHash; mAbsorbableConceptNomSchemaConceptsHash = absorbableConceptNomSchemaConceptsHash; mNomSchemaConSet = nomSchemaConSet; mTerm = nullptr; mTemplConcept = nullptr; mRefConcept = nullptr; mTag = 0; return this; } CNominalSchemaTemplate* CNominalSchemaTemplate::setNominalSchemaTemplateTag(qint64 nomSchemTempTag) { mTag = nomSchemTempTag; return this; } qint64 CNominalSchemaTemplate::getNominalSchemaTemplateTag() { return mTag; } CNominalSchemaTemplate* CNominalSchemaTemplate::setTerminology(CTerminology* ontology) { mTerm = ontology; return this; } CTerminology* CNominalSchemaTemplate::getTerminology() { return mTerm; } qint64 CNominalSchemaTemplate::getTerminologyTag() const { cint64 termTag = 0; if (mTerm) { termTag = mTerm->getTerminologyID(); } return termTag; } CNominalSchemaTemplate* CNominalSchemaTemplate::setTemplateConcept(CConcept* templateConcept) { mTemplConcept = templateConcept; return this; } CConcept* CNominalSchemaTemplate::getTemplateConcept() { return mTemplConcept; } CNominalSchemaTemplate* CNominalSchemaTemplate::setReferenceConcept(CConcept* referenceConcept) { mRefConcept = referenceConcept; return this; } CConcept* CNominalSchemaTemplate::getReferenceConcept() { return mRefConcept; } CBOXSET* CNominalSchemaTemplate::getNominalSchemaConceptSet() { return mNomSchemaConSet; } CNominalSchemaTemplate* CNominalSchemaTemplate::setNominalSchemaConceptSet(CBOXSET* nomSchemaConSet) { mNomSchemaConSet = nomSchemaConSet; return this; } CBOXHASH* CNominalSchemaTemplate::getTemplateConceptNominalSchemaConceptHash() { return mConceptNomSchemaConceptsHash; } CNominalSchemaTemplate* CNominalSchemaTemplate::setTemplateConceptNominalSchemaConceptHash(CBOXHASH* conceptNomSchemaConceptsHash) { mConceptNomSchemaConceptsHash = conceptNomSchemaConceptsHash; return this; } CBOXHASH* CNominalSchemaTemplate::getTemplateAbsorbableConceptNominalSchemaConceptHash() { return mAbsorbableConceptNomSchemaConceptsHash; } CNominalSchemaTemplate* CNominalSchemaTemplate::setTemplateAbsorbableConceptNominalSchemaConceptHash(CBOXHASH* conceptNomSchemaConceptsHash) { mAbsorbableConceptNomSchemaConceptsHash = conceptNomSchemaConceptsHash; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyImportData.cpp0000644000175000017500000000407112520551210026253 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyImportData.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyImportData::COntologyImportData() { } COntologyImportData* COntologyImportData::initOntologyImportData(const QString& ontoIRIString) { mOntoIRIString = ontoIRIString; mOntoLoaded = false; mOntoLoadingTried = false; return this; } QString COntologyImportData::getOntologyIRIString() { return mOntoIRIString; } QString COntologyImportData::getResolvedIRIOntoLoadString() { return mResolvedIRIOntoLoadString; } bool COntologyImportData::getOntologyLoaded() { return mOntoLoaded; } bool COntologyImportData::getOntologyLoadingTried() { return mOntoLoadingTried; } COntologyImportData* COntologyImportData::setOntologyLoaded(bool loaded) { mOntoLoaded = loaded; return this; } COntologyImportData* COntologyImportData::setOntologyLoadingTried(bool tried) { mOntoLoadingTried = tried; return this; } COntologyImportData* COntologyImportData::setResolvedIRIOntoLoadString(const QString& resolvedOntoIRIString) { mResolvedIRIOntoLoadString = resolvedOntoIRIString; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividual.cpp0000644000175000017500000001266612520551206024562 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividual.h" namespace Konclude { namespace Reasoner { namespace Ontology { CIndividual::CIndividual(qint64 id) : CTagItem(id) { mAssertionConceptLinker = nullptr; mAssertionRoleLinker = nullptr; mReverseAssertionRoleLinker = nullptr; mNominalConcept = nullptr; mAnonymousIndividual = false; mIndividualData = nullptr; } bool CIndividual::hasIndividualName() { return hasName(); } CIndividual *CIndividual::setIndividualNameLinker(CLinker *individualNameLinker) { setNameLinker(individualNameLinker); return this; } CIndividual *CIndividual::addIndividualNameLinker(CLinker *individualNameLinker) { addNameLinker(individualNameLinker); return this; } CLinker *CIndividual::getIndividualNameLinker() { return getNameLinker(); } CConcept* CIndividual::getIndividualNominalConcept() { return mNominalConcept; } CIndividual* CIndividual::setIndividualNominalConcept(CConcept* nomConcept) { mNominalConcept = nomConcept; return this; } CConceptAssertionLinker* CIndividual::getAssertionConceptLinker() { return mAssertionConceptLinker; } CIndividual* CIndividual::addAssertionConceptLinker(CConceptAssertionLinker* assConLinker) { mAssertionConceptLinker = assConLinker->append(mAssertionConceptLinker); return this; } CIndividual* CIndividual::setAssertionConceptLinker(CConceptAssertionLinker* assConLinker) { mAssertionConceptLinker = assConLinker; return this; } CRoleAssertionLinker* CIndividual::getAssertionRoleLinker() { return mAssertionRoleLinker; } CIndividual* CIndividual::addAssertionRoleLinker(CRoleAssertionLinker* assRoleLinker) { mAssertionRoleLinker = assRoleLinker->append(mAssertionRoleLinker); return this; } CIndividual* CIndividual::setAssertionRoleLinker(CRoleAssertionLinker* assRoleLinker) { mAssertionRoleLinker = assRoleLinker; return this; } CReverseRoleAssertionLinker* CIndividual::getReverseAssertionRoleLinker() { return mReverseAssertionRoleLinker; } CIndividual* CIndividual::addReverseAssertionRoleLinker(CReverseRoleAssertionLinker* revAssRoleLinker) { mReverseAssertionRoleLinker = revAssRoleLinker->append(mReverseAssertionRoleLinker); return this; } CIndividual* CIndividual::setReverseAssertionRoleLinker(CReverseRoleAssertionLinker* revAssRoleLinker) { mReverseAssertionRoleLinker = revAssRoleLinker; return this; } CIndividual* CIndividual::initIndividual(qint64 indiID) { mTag = indiID; mAssertionConceptLinker = nullptr; mNominalConcept = nullptr; mAnonymousIndividual = false; return this; } CIndividual *CIndividual::initIndividualCopy(CIndividual* individual, CMemoryAllocationManager* memMan) { mNameLinker = individual->getIndividualNameLinker(); mTag = individual->mTag; CConceptAssertionLinker* assConIt = individual->mAssertionConceptLinker; while (assConIt) { CConcept *con = assConIt->getData(); bool negated = assConIt->isNegated(); CConceptAssertionLinker *assLinker = CObjectAllocator< CConceptAssertionLinker >::allocateAndConstruct(memMan); assLinker->initNegLinker(con,negated); addAssertionConceptLinker(assLinker); assConIt = assConIt->getNext(); } mNominalConcept = individual->mNominalConcept; mAnonymousIndividual = individual->mAnonymousIndividual; return this; } CIndividual *CIndividual::setIndividualID(qint64 id) { mTag = id; return this; } qint64 CIndividual::getIndividualID() { return mTag; } bool CIndividual::hasAssertedConcept(CConcept* concept) { CConceptAssertionLinker* assertionConceptLinkerIt = mAssertionConceptLinker; while (assertionConceptLinkerIt) { CConcept* assConcept = assertionConceptLinkerIt->getData(); if (assConcept->getConceptTag() == concept->getConceptTag()) { return true; } assertionConceptLinkerIt = assertionConceptLinkerIt->getNext(); } return false; } CIndividual* CIndividual::setAnonymousIndividual(bool anonymous) { mAnonymousIndividual = anonymous; return this; } bool CIndividual::isAnonymousIndividual() { return mAnonymousIndividual; } bool CIndividual::hasIndividualData() { return mIndividualData != nullptr; } CIndividualData* CIndividual::getIndividualData() { return mIndividualData; } CIndividual* CIndividual::setIndividualData(CIndividualData* individualData) { mIndividualData = individualData; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CReverseRoleAssertionLinker.h0000644000175000017500000000423612520551214027422 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CREVERSEROLEASSERTIONLINKER_H #define KONCLUDE_REASONER_ONTOLOGY_CREVERSEROLEASSERTIONLINKER_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CRoleAssertionLinker.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CReverseRoleAssertionLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReverseRoleAssertionLinker : public CLinkerBase { // public methods public: //! Constructor CReverseRoleAssertionLinker(); CReverseRoleAssertionLinker* initReverseRoleAssertionLinker(CRoleAssertionLinker* roleAss, CIndividual* individual); CIndividual* getIndividual(); CRoleAssertionLinker* getRoleAssertion(); CRole* getRole(); // protected methods protected: // protected variables protected: CIndividual* mIndividual; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CREVERSEROLEASSERTIONLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpacesTriggers.cpp0000644000175000017500000001465412520551202030103 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpacesTriggers.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpacesTriggers::CDatatypeValueSpacesTriggers(CBoxContext* boxContext) : mBoxContext(boxContext), mRealValueSpaceTriggers(boxContext),mStringValueSpaceTriggers(boxContext),mBooleanValueSpaceTriggers(boxContext), mDoubleValueSpaceTriggers(boxContext),mFloatValueSpaceTriggers(boxContext),mIRIValueSpaceTriggers(boxContext), mBinaryHexDataValueSpaceTriggers(boxContext),mBinaryBase64DataValueSpaceTriggers(boxContext), mXMLValueSpaceTriggers(boxContext),mDateTimeValueSpaceTriggers(boxContext) { } CDatatypeValueSpacesTriggers* CDatatypeValueSpacesTriggers::initValueSpacesTriggers(CDatatypeValueSpacesTriggers* data) { if (data) { mRealValueSpaceTriggers.initValueSpaceRealTriggers(&data->mRealValueSpaceTriggers); mStringValueSpaceTriggers.initValueSpaceStringTriggers(&data->mStringValueSpaceTriggers); mBooleanValueSpaceTriggers.initValueSpaceBooleanTriggers(&data->mBooleanValueSpaceTriggers); mDoubleValueSpaceTriggers.initValueSpaceDoubleTriggers(&data->mDoubleValueSpaceTriggers); mFloatValueSpaceTriggers.initValueSpaceFloatTriggers(&data->mFloatValueSpaceTriggers); mIRIValueSpaceTriggers.initValueSpaceIRITriggers(&data->mIRIValueSpaceTriggers); mXMLValueSpaceTriggers.initValueSpaceXMLTriggers(&data->mXMLValueSpaceTriggers); mBinaryHexDataValueSpaceTriggers.initValueSpaceBinaryHexDataTriggers(&data->mBinaryHexDataValueSpaceTriggers); mBinaryBase64DataValueSpaceTriggers.initValueSpaceBinaryBase64DataTriggers(&data->mBinaryBase64DataValueSpaceTriggers); mDateTimeValueSpaceTriggers.initValueSpaceDateTimeTriggers(&data->mDateTimeValueSpaceTriggers); } else { mRealValueSpaceTriggers.initValueSpaceRealTriggers(nullptr); mStringValueSpaceTriggers.initValueSpaceStringTriggers(nullptr); mBooleanValueSpaceTriggers.initValueSpaceBooleanTriggers(nullptr); mDoubleValueSpaceTriggers.initValueSpaceDoubleTriggers(nullptr); mFloatValueSpaceTriggers.initValueSpaceFloatTriggers(nullptr); mIRIValueSpaceTriggers.initValueSpaceIRITriggers(nullptr); mXMLValueSpaceTriggers.initValueSpaceXMLTriggers(nullptr); mBinaryHexDataValueSpaceTriggers.initValueSpaceBinaryHexDataTriggers(nullptr); mBinaryBase64DataValueSpaceTriggers.initValueSpaceBinaryBase64DataTriggers(nullptr); mDateTimeValueSpaceTriggers.initValueSpaceDateTimeTriggers(nullptr); } return this; } CDatatypeValueSpaceRealTriggers* CDatatypeValueSpacesTriggers::getRealValueSpaceTriggers() { return &mRealValueSpaceTriggers; } CDatatypeValueSpaceStringTriggers* CDatatypeValueSpacesTriggers::getStringValueSpaceTriggers() { return &mStringValueSpaceTriggers; } CDatatypeValueSpaceBooleanTriggers* CDatatypeValueSpacesTriggers::getBooleanValueSpaceTriggers() { return &mBooleanValueSpaceTriggers; } CDatatypeValueSpaceDoubleTriggers* CDatatypeValueSpacesTriggers::getDoubleValueSpaceTriggers() { return &mDoubleValueSpaceTriggers; } CDatatypeValueSpaceFloatTriggers* CDatatypeValueSpacesTriggers::getFloatValueSpaceTriggers() { return &mFloatValueSpaceTriggers; } CDatatypeValueSpaceIRITriggers* CDatatypeValueSpacesTriggers::getIRIValueSpaceTriggers() { return &mIRIValueSpaceTriggers; } CDatatypeValueSpaceXMLTriggers* CDatatypeValueSpacesTriggers::getXMLValueSpaceTriggers() { return &mXMLValueSpaceTriggers; } CDatatypeValueSpaceDateTimeTriggers* CDatatypeValueSpacesTriggers::getDateTimeValueSpaceTriggers() { return &mDateTimeValueSpaceTriggers; } CDatatypeValueSpaceBinaryHexDataTriggers* CDatatypeValueSpacesTriggers::getBinaryHexDataValueSpaceTriggers() { return &mBinaryHexDataValueSpaceTriggers; } CDatatypeValueSpaceBinaryBase64DataTriggers* CDatatypeValueSpacesTriggers::getBinaryBase64DataValueSpaceTriggers() { return &mBinaryBase64DataValueSpaceTriggers; } CDatatypeValueSpaceTriggers* CDatatypeValueSpacesTriggers::getValueSpaceTriggers(CDatatypeValueSpaceType* valueSpaceType) { if (valueSpaceType) { if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEREALTYPE) { return &mRealValueSpaceTriggers; } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACESTRINGTYPE) { return &mStringValueSpaceTriggers; } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEBOOLEANTYPE) { return &mBooleanValueSpaceTriggers; } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEDOUBLETYPE) { return &mDoubleValueSpaceTriggers; } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEFLOATTYPE) { return &mFloatValueSpaceTriggers; } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEIRITYPE) { return &mIRIValueSpaceTriggers; } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEXMLTYPE) { return &mXMLValueSpaceTriggers; } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEDATETIMETYPE) { return &mDateTimeValueSpaceTriggers; } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEHEXDATATYPE) { return &mBinaryHexDataValueSpaceTriggers; } else if (valueSpaceType->getValueSpaceType() == CDatatypeValueSpaceType::VALUESPACEBASE64DATATYPE) { return &mBinaryBase64DataValueSpaceTriggers; } } return nullptr; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CBoxContext.h0000644000175000017500000000425612520551174024234 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CBOXCONTEXT_H #define KONCLUDE_REASONER_ONTOLOGY_CBOXCONTEXT_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyContext.h" // Other includes #include "Utilities/CObjectContainer.h" #include "Reasoner/Ontology/Memory/COntologyContextMemoryManager.h" #include "Reasoner/Ontology/Memory/COntologyContextMemoryManagerProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { using namespace Memory; /*! * * \class CBoxContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBoxContext : public COntologyContext { // public methods public: //! Constructor CBoxContext(); //! Destructor virtual ~CBoxContext(); virtual CObjectContainer *getObjectContainer(bool create = true) = 0; virtual COntologyContextMemoryManager *getOnologyMemoryManager(COntologyContextMemoryManagerProvider *provider = nullptr) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CBOXCONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingRequirementExpander.h0000644000175000017500000000651012520551212031702 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGREQUIREMENTEXPANDER_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGREQUIREMENTEXPANDER_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntology.h" #include "COntologyProcessingRequirement.h" #include "COntologyProcessingStepRequirement.h" #include "COntologyProcessingStep.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyProcessingRequirementExpander * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyProcessingRequirementExpander { // public methods public: //! Constructor COntologyProcessingRequirementExpander(); ~COntologyProcessingRequirementExpander(); const QList getUnsatisfiedRequirementsExpanded(const QList& requirements, CConcreteOntology* ontology); COntologyProcessingStepRequirement* getCompletedDefaultOntologyProcessingStepRequirement(COntologyProcessingStep::PROCESSINGSTEPTYPE processingStep); COntologyProcessingStepRequirement* getRequiredConsistencyOntologyProcessingStepRequirement(); COntologyProcessingStepRequirement* getRequiredIndividualPrecomputationOntologyProcessingStepRequirement(); // protected methods protected: // protected variables protected: COntologyProcessingStepRequirement* mActiveCountOntProStepReq; COntologyProcessingStepRequirement* mBuildOntProStepReq; COntologyProcessingStepRequirement* mPreprocessOntProStepReq; COntologyProcessingStepRequirement* mConsistencyOntProStepReq; COntologyProcessingStepRequirement* mIndividualOntProStepReq; COntologyProcessingStepRequirement* mSaturationOntProStepReq; COntologyProcessingStepRequirement* mPrecomputeOntProStepReq; COntologyProcessingStepRequirement* mClassClassifyOntProStepReq; COntologyProcessingStepRequirement* mConceptRealizeOntProStepReq; COntologyProcessingStepRequirement* mRoleRealizeOntProStepReq; COntologyProcessingStepRequirement* mSameIndividualsRealizeOntProStepReq; COntologyProcessingStepRequirement* mRequiredConsistencyOntProStepReq; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGREQUIREMENTEXPANDER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryBase64DataType.cpp0000644000175000017500000000424712520551200031752 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceBinaryBase64DataType.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceBinaryBase64DataType::CDatatypeValueSpaceBinaryBase64DataType() : CDatatypeValueSpaceCompareType(CDatatypeValueSpaceBinaryBase64DataType::VALUESPACEBASE64DATATYPE) { mMinValue = new CDataLiteralBinaryBase64DataValue(nullptr); mMinValue->initValueFromLength(0); mMaxValue = new CDataLiteralBinaryBase64DataValue(nullptr); mMaxValue->initValueFromInfiniteLength(); } CDataLiteralBinaryBase64DataValue* CDatatypeValueSpaceBinaryBase64DataType::getMinimumDataLiteralBinaryBase64DataValue() { return mMinValue; } CDataLiteralBinaryBase64DataValue* CDatatypeValueSpaceBinaryBase64DataType::getMaximumDataLiteralBinaryBase64DataValue() { return mMaxValue; } CDataLiteralCompareValue* CDatatypeValueSpaceBinaryBase64DataType::getMinimumDataLiteralCompareValue() { return mMinValue; } CDataLiteralCompareValue* CDatatypeValueSpaceBinaryBase64DataType::getMaximumDataLiteralCompareValue() { return mMaxValue; } bool CDatatypeValueSpaceBinaryBase64DataType::hasInfiniteManyValues() { return true; } cint64 CDatatypeValueSpaceBinaryBase64DataType::getMaximumValueCount() { return CINT64_MAX; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyContext.h0000644000175000017500000000343312520551210025301 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXT_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXT_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Ontology { /*! * * \class COntologyContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyContext : public CContext { // public methods public: //! Constructor COntologyContext(); //! Destructor virtual ~COntologyContext(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyIncrementalAxiomChangeData.h0000644000175000017500000000652012520551210031014 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYINCREMENTALAXIOMCHANGEDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYINCREMENTALAXIOMCHANGEDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyIncrementalAxiomChangeData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyIncrementalAxiomChangeData { // public methods public: //! Constructor COntologyIncrementalAxiomChangeData(COntologyContext* ontoContext = nullptr); cint64 getAddedABoxAxiomCount(); cint64 getAddedTBoxAxiomCount(); cint64 getAddedRBoxAxiomCount(); cint64 getDeletedABoxAxiomCount(); cint64 getDeletedTBoxAxiomCount(); cint64 getDeletedRBoxAxiomCount(); COntologyIncrementalAxiomChangeData* incAddedABoxAxiomCount(cint64 incCount = 1); COntologyIncrementalAxiomChangeData* incAddedTBoxAxiomCount(cint64 incCount = 1); COntologyIncrementalAxiomChangeData* incAddedRBoxAxiomCount(cint64 incCount = 1); COntologyIncrementalAxiomChangeData* incDeletedABoxAxiomCount(cint64 incCount = 1); COntologyIncrementalAxiomChangeData* incDeletedTBoxAxiomCount(cint64 incCount = 1); COntologyIncrementalAxiomChangeData* incDeletedRBoxAxiomCount(cint64 incCount = 1); bool hasAddedABoxAxioms(); bool hasAddedTBoxAxioms(); bool hasAddedRBoxAxioms(); bool hasDeletedABoxAxioms(); bool hasDeletedTBoxAxioms(); bool hasDeletedRBoxAxioms(); bool hasChangedABoxAxioms(); bool hasChangedTBoxAxioms(); bool hasChangedRBoxAxioms(); bool hasAxiomAdditions(); bool hasAxiomDeletions(); bool hasChangedAxioms(); bool hasOnlyChangedABoxAxioms(); bool hasOnlyChangedTBoxAxioms(); bool hasOnlyChangedRBoxAxioms(); // protected methods protected: // protected variables protected: COntologyContext* mOntoContext; cint64 mAddedABoxAxiomCount; cint64 mAddedTBoxAxiomCount; cint64 mAddedRBoxAxiomCount; cint64 mDeletedABoxAxiomCount; cint64 mDeletedTBoxAxiomCount; cint64 mDeletedRBoxAxiomCount; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYINCREMENTALAXIOMCHANGEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralRealValue.cpp0000644000175000017500000003222612520551200026445 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralRealValue.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDataLiteralRealValue::CDataLiteralRealValue() { clearValue(); } CDataLiteralValue::DATA_LITERAL_VALUE_TYPE CDataLiteralRealValue::getDataValueType() { return CDataLiteralValue::DLVT_REAL; } QString CDataLiteralRealValue::getValueString() { QString valueString; if (mNegative) { valueString += "-"; } valueString += QString::number(mInteger); if (mNumerator != 0) { valueString += " "; valueString += QString::number(mNumerator); valueString += "/"; valueString += QString::number(mDenominator); } return valueString; } CDataLiteralCompareValue* CDataLiteralRealValue::initValue(CDataLiteralCompareValue* value) { clearValue(); CDataLiteralRealValue* realValue = dynamic_cast(value); if (realValue) { mInfinite = realValue->mInfinite; mNegative = realValue->mNegative; mInteger = realValue->mInteger; mNumerator = realValue->mNumerator; mDenominator = realValue->mDenominator; mFlags = realValue->mFlags; } return this; } CDataLiteralRealValue* CDataLiteralRealValue::initRationalValueFromInfinite(bool negative) { clearValue(); mNegative = negative; mInfinite = true; normalize(); mFlags |= DLRV_RATIONAL_FLAG; identifyFlags(); return this; } CDataLiteralRealValue* CDataLiteralRealValue::initRationalValueFromDecimal(cint64 integerValue, cint64 decimalValue, cint64 precedingZerors) { initRationalValueFromInteger(integerValue); clearFlags(); if (decimalValue < 0) { mNegative = !mNegative; decimalValue = -decimalValue; } mNumerator = decimalValue; mDenominator = 1; while (mDenominator < decimalValue) { mDenominator *= 10; } while (precedingZerors > 0) { --precedingZerors; mDenominator *= 10; } normalize(); mFlags |= DLRV_DECIMAL_FLAG | DLRV_RATIONAL_FLAG; identifyFlags(); return this; } CDataLiteralRealValue* CDataLiteralRealValue::initRationalValueFromDecimal(cuint64 integerValue, cuint64 decimalValue, bool negative, cint64 precedingZerors) { initRationalValueFromInteger(integerValue,negative); clearFlags(); mNumerator = decimalValue; mDenominator = 1; while (mDenominator <= decimalValue) { mDenominator *= 10; } while (precedingZerors > 0) { --precedingZerors; mDenominator *= 10; } normalize(); mFlags |= DLRV_DECIMAL_FLAG | DLRV_RATIONAL_FLAG; identifyFlags(); return this; } CDataLiteralRealValue* CDataLiteralRealValue::initRationalValueFromFraction(cint64 numeratorValue, cint64 denominatorValue) { clearValue(); if (numeratorValue < 0 && denominatorValue < 0) { numeratorValue = -numeratorValue; denominatorValue = -denominatorValue; } else if (numeratorValue < 0) { numeratorValue = -numeratorValue; mNegative = true; } else if (denominatorValue < 0) { denominatorValue = -denominatorValue; mNegative = true; } mNumerator = numeratorValue; mDenominator = denominatorValue; normalize(); mFlags |= DLRV_RATIONAL_FLAG; identifyFlags(); return this; } CDataLiteralRealValue* CDataLiteralRealValue::initRationalValueFromFraction(cuint64 numeratorValue, cuint64 denominatorValue, bool negative) { clearValue(); mNumerator = numeratorValue; mDenominator = denominatorValue; mNegative = negative; normalize(); mFlags |= DLRV_RATIONAL_FLAG; identifyFlags(); return this; } CDataLiteralRealValue* CDataLiteralRealValue::initRationalValueFromNextIntegerValue(CDataLiteralRealValue* value) { clearValue(); mNegative = value->mNegative; mInteger = value->mInteger; if (mNegative) { if (mInteger > 0) { --mInteger; } else { mInteger = 0; mNegative = false; } } else { ++mInteger; } normalize(); mFlags |= DLRV_INTEGER_FLAG | DLRV_DECIMAL_FLAG | DLRV_RATIONAL_FLAG; identifyFlags(); return this; } CDataLiteralRealValue* CDataLiteralRealValue::initRationalValueFromInteger(cuint64 value, bool negation) { clearValue(); mNegative = negation; mInteger = value; normalize(); mFlags |= DLRV_INTEGER_FLAG | DLRV_DECIMAL_FLAG | DLRV_RATIONAL_FLAG; identifyFlags(); return this; } CDataLiteralRealValue* CDataLiteralRealValue::initRationalValueFromInteger(cint64 value) { clearValue(); if (value < 0) { mNegative = true; mInteger = -value; } else { mNegative = false; mInteger = value; } normalize(); mFlags |= DLRV_INTEGER_FLAG | DLRV_DECIMAL_FLAG | DLRV_RATIONAL_FLAG; identifyFlags(); return this; } CDataLiteralRealValue* CDataLiteralRealValue::initValue(CDataLiteralRealValue* value) { clearFlags(); if (value) { mInfinite = value->mInfinite; mNegative = value->mNegative; mInteger = value->mInteger; mNumerator = value->mNumerator; mDenominator = value->mDenominator; mFlags = value->mFlags; } return this; } CDataLiteralRealValue* CDataLiteralRealValue::clearValue() { mInfinite = false; mNegative = false; mInteger = 0; mNumerator = 0; mDenominator = 1; clearFlags(); return this; } CDataLiteralRealValue* CDataLiteralRealValue::clearFlags() { mFlags = 0; return this; } CDataLiteralRealValue* CDataLiteralRealValue::identifyFlags() { mFlags |= DLRV_RATIONAL_FLAG; if (mNumerator == 0) { mFlags |= DLRV_INTEGER_FLAG | DLRV_DECIMAL_FLAG; } else { if (!hasFlag(DLRV_DECIMAL_FLAG)) { cuint64 denominatorFac = mDenominator; bool reduced = false; do { reduced = false; while (denominatorFac % 2 == 0) { denominatorFac /= 2; reduced = true; } if (denominatorFac % 5 == 0) { denominatorFac /= 5; reduced = true; } } while (reduced); if (denominatorFac == 2 || denominatorFac == 5 || denominatorFac == 1) { mFlags |= DLRV_DECIMAL_FLAG; } } } return this; } cint64 getGreatestCommonDivisor(cint64 u, cint64 v) { cint64 t; while (v) { t = u; u = v; v = t % v; } return u < 0 ? -u : u; } bool CDataLiteralRealValue::hasFlag(cint64 flag) { return (mFlags & flag) != 0; } bool CDataLiteralRealValue::normalize() { bool reduced = false; if (mInfinite) { mInteger = 0; mNumerator = 0; mDenominator = 1; } if (mNumerator >= mDenominator) { cint64 nonFraction = mNumerator/mDenominator; mNumerator = mNumerator-nonFraction*mDenominator; mInteger += nonFraction; reduced = true; } if (mNumerator == 0) { mDenominator = 1; } else { cint64 gcd = getGreatestCommonDivisor(mNumerator,mDenominator); if (gcd > 1) { mNumerator = mNumerator/gcd; mDenominator = mDenominator/gcd; reduced = true; } } if (mInteger == 0 && mNumerator == 0 && mNegative && !mInfinite) { mNegative = false; } return reduced; } bool CDataLiteralRealValue::isNegative() { return mNegative; } bool CDataLiteralRealValue::isInfinite() { return mInfinite; } bool CDataLiteralRealValue::isInfiniteBigNumber() { if (mInfinite) { return true; } if (mNegative && mInteger > Q_INT64_C(9223372036854775808)) { return true; } else if (!mNegative && mInteger > Q_INT64_C(9223372036854775807)) { return true; } return false; } cuint64 CDataLiteralRealValue::getInteger() { return mInteger; } cuint64 CDataLiteralRealValue::getNumerator() { return mNumerator; } cuint64 CDataLiteralRealValue::getDenominator() { return mDenominator; } cint64 CDataLiteralRealValue::getPosNegInteger() { if (!mNegative) { return mInteger; } else { return -mInteger; } } CDataLiteralRealValue* CDataLiteralRealValue::setNegative(bool negative) { mNegative = negative; return this; } CDataLiteralRealValue* CDataLiteralRealValue::setInteger(cuint64 integer) { mInteger = integer; return this; } CDataLiteralRealValue* CDataLiteralRealValue::setNumerator(cuint64 numerator) { mNumerator = numerator; return this; } CDataLiteralRealValue* CDataLiteralRealValue::setDenominator(cuint64 denominator) { mDenominator = denominator; return this; } bool CDataLiteralRealValue::isEqualTo(CDataLiteralValue* value) { CDataLiteralRealValue* realValue = dynamic_cast(value); if (realValue) { return isEqualTo(realValue); } return false; } bool CDataLiteralRealValue::isLessEqualThan(CDataLiteralCompareValue* value) { CDataLiteralRealValue* realValue = dynamic_cast(value); if (realValue) { return isEqualTo(realValue) || isLessThan(realValue); } return false; } bool CDataLiteralRealValue::isLessEqualThan(CDataLiteralRealValue* realValue) { return isEqualTo(realValue) || isLessThan(realValue); } bool CDataLiteralRealValue::isEqualTo(CDataLiteralCompareValue* value) { CDataLiteralRealValue* realValue = dynamic_cast(value); if (realValue) { return isEqualTo(realValue); } return false; } bool CDataLiteralRealValue::isEqualTo(CDataLiteralRealValue* realValue) { if (mNegative == realValue->mNegative) { if (mInfinite && realValue->mInfinite) { return true; } if (mInteger == realValue->mInteger) { if (mNumerator == realValue->mNumerator) { if (mDenominator == realValue->mDenominator) { return true; } } } } return false; } bool CDataLiteralRealValue::isGreaterEqualThan(CDataLiteralRealValue* realValue) { return isEqualTo(realValue) || isGreaterThan(realValue); } bool CDataLiteralRealValue::isGreaterEqualThan(CDataLiteralCompareValue* value) { CDataLiteralRealValue* realValue = dynamic_cast(value); if (realValue) { return isEqualTo(realValue) || isGreaterThan(realValue); } return false; } bool CDataLiteralRealValue::isGreaterThan(CDataLiteralCompareValue* value) { return value->isLessThan(this); } bool CDataLiteralRealValue::isGreaterThan(CDataLiteralRealValue* realValue) { return realValue->isLessThan(this); } bool CDataLiteralRealValue::isLessThan(CDataLiteralCompareValue* value) { CDataLiteralRealValue* realValue = dynamic_cast(value); if (realValue) { return isLessThan(realValue); } return false; } bool CDataLiteralRealValue::isLessThan(CDataLiteralRealValue* realValue) { if (mNegative == realValue->mNegative && mInfinite && realValue->mInfinite) { return false; } else if (mNegative && mInfinite) { return true; } else if (!mNegative && mInfinite) { return false; } else if (!realValue->mNegative && realValue->mInfinite) { return true; } else if (realValue->mNegative && realValue->mInfinite) { return false; } else if (mNegative && !realValue->mNegative) { return true; } else if (!mNegative && realValue->mNegative) { return false; } if (mNegative) { if (mInteger > realValue->mInteger) { return true; } else if (mInteger < realValue->mInteger) { return false; } else { if (mDenominator == realValue->mDenominator) { if (mNumerator > realValue->mNumerator) { return true; } } else { cint64 ad = mNumerator*realValue->mDenominator; cint64 bc = realValue->mNumerator*mDenominator; if (ad > bc) { return true; } } } } else { if (mInteger < realValue->mInteger) { return true; } else if (mInteger > realValue->mInteger) { return false; } else { if (mDenominator == realValue->mDenominator) { if (mNumerator < realValue->mNumerator) { return true; } } else { cint64 ad = mNumerator*realValue->mDenominator; cint64 bc = realValue->mNumerator*mDenominator; if (ad < bc) { return true; } } } } return false; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIRIName.h0000644000175000017500000000454312520551206023356 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CIRINAME_H #define KONCLUDE_REASONER_ONTOLOGY_CIRINAME_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CConcept.h" #include "CName.h" // Other includes #include "Utilities/CAllocationObject.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CIRIName * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIRIName : public CName, public CAllocationObject { // public methods public: //! Constructor CIRIName(const QString &iriNameString = QString("")); //! Destructor virtual ~CIRIName(); virtual CIRIName *init(const QString &iriNameString); virtual QString getIRIName(); virtual CIRIName *setIRIName(const QString &iriNameString); static QStringList getIRINames(CLinker *nameLinker, qint64 nameVersionDifference = 0); static QString getRecentIRIName(CLinker *nameLinker, qint64 nameVersionDifference = 0); static bool hasIRIName(CLinker *nameLinker, const QString &name, qint64 nameVersionDifference = 0); // protected methods protected: // protected variables protected: QString iriString; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CIRINAME_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CExpressionDataBoxMapping.h0000644000175000017500000003211212520551204027037 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CEXPRESSIONDATABOXMAPPING_H #define KONCLUDE_REASONER_ONTOLOGY_CEXPRESSIONDATABOXMAPPING_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyContext.h" #include "CConcept.h" #include "CIndividual.h" #include "CRole.h" #include "CDatatype.h" #include "COntologyBuildConstructFlags.h" #include "CActiveEntityCountVector.h" // Other includes #include "Utilities/CSortedNegLinker.hpp" #include "Utilities/CMemoryManager.hpp" #include "Utilities/CLinker.hpp" #include "Parser/Expressions/CClassTermExpression.h" #include "Parser/Expressions/CIndividualTermExpression.h" #include "Parser/Expressions/CObjectPropertyTermExpression.h" #include "Parser/Expressions/CClassAxiomExpression.h" #include "Parser/Expressions/CObjectPropertyAxiomExpression.h" #include "Parser/Expressions/CAssertionAxiomExpression.h" #include "Parser/Expressions/CDataPropertyTermExpression.h" #include "Parser/Expressions/CDataRangeTermExpression.h" #include "Parser/Expressions/CDatatypeExpression.h" #include "Parser/Expressions/CDataPropertyAxiomExpression.h" #include "Reasoner/Generator/CExpressionHasher.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Container; using namespace Parser::Expression; namespace Reasoner { using namespace Generator; namespace Ontology { /*! * * \class CExpressionDataBoxMapping * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExpressionDataBoxMapping { // public methods public: //! Constructor CExpressionDataBoxMapping(COntologyContext* ontoContext); virtual ~CExpressionDataBoxMapping(); CExpressionDataBoxMapping* referenceDataBoxMapping(CExpressionDataBoxMapping* dataBoxMapping); COntologyBuildConstructFlags* getBuildConstructFlags(); CActiveEntityCountVector* getActiveEntityVector(); CBUILDHASH* getClassTermConceptMappingHash(); CBUILDHASH* getConceptClassTermMappingHash(); CBUILDHASH* getDataRangeTermConceptMappingHash(); CBUILDHASH* getConceptDataRangeTermMappingHash(); CBUILDHASH* getObjectPropertyTermRoleMappingHash(); CBUILDHASH* getRoleObjectPropertyTermMappingHash(); CBUILDHASH* getDataPropertyTermRoleMappingHash(); CBUILDHASH* getRoleDataPropertyTermMappingHash(); CBUILDHASH* getIndividulTermIndiMappingHash(); CBUILDHASH* getIndiIndividulTermMappingHash(); CBUILDHASH* getDatatypeExpressionDatatypeHash(); CBUILDHASH* getDatatypeDatatypeExpessionHash(); CBUILDHASH* getUpdatedClassAxiomTellOrRetractHash(); CBUILDHASH* getUpdateObjectPropertyAxiomHash(); CBUILDHASH* getUpdateDataPropertyAxiomHash(); CBUILDHASH* getUpdateAssertionAxiomHash(); CBUILDSET< QPair >* getClassTermExpressionClassAxiomExpressionSet(); CBUILDHASH* getClassTermExpressionClassAxiomExpressionHash(); CBUILDSET< QPair >* getObjectPropertyTermObjectPropertyAxiomSet(); CBUILDHASH* getObjectPropertyTermObjectPropertyAxiomHash(); CBUILDSET< QPair >* getDataPropertyTermDataPropertyAxiomSet(); CBUILDHASH* getDataPropertyTermDataPropertyAxiomHash(); CBUILDSET< QPair >* getIndividualTermAssertionAxiomSet(); CBUILDHASH* getIndividualTermAssertionAxiomHash(); CBUILDSET* getTopRebuildClassTermExpressionsSet(); CBUILDSET* getTopRebuildObjectPropertyTermExpressionsSet(); CBUILDHASH* getObjectPropertyTermRoleChainHash(); CBUILDHASH* getRoleChainObjectPropertyTermHash(); CBUILDSET* getBuildedConceptSet(); CBUILDSET* getBuildedObjectRoleSet(); CBUILDSET* getBuildedDataRoleSet(); CBUILDSET* getBuildedDataRangeSet(); CBUILDSET* getBuildedDatatypeSet(); CBUILDSET* getBuildedIndividualSet(); CBUILDLIST* getBuildedConceptList(); CBUILDLIST* getBuildedObjectRoleList(); CBUILDLIST* getBuildedDataRoleList(); CBUILDLIST* getBuildedDataRangeList(); CBUILDLIST* getBuildedDatatypeList(); CBUILDLIST* getBuildedIndividualList(); cint64 getLastActiveCountedEntityAxiom(); CExpressionDataBoxMapping* setLastActiveCountedEntityAxiom(cint64 lastCounted); cint64 getLastProcessedChangedAxiom(); cint64 getLastProcessedBuildIndividual(); cint64 getLastProcessedBuildConcept(); cint64 getLastProcessedBuildObjectRole(); cint64 getLastProcessedBuildDataRole(); cint64 getLastProcessedBuildDataRange(); cint64 getLastProcessedBuildDatatype(); cint64 getLastProcessedInverseProperty(); cint64 getLastProcessedExpression(); cint64 getLastBuildedIndividual(); cint64 getLastBuildedConcept(); cint64 getLastBuildedObjectRole(); cint64 getLastBuildedDataRole(); cint64 getLastBuildedDataRange(); cint64 getLastBuildedDatatype(); CExpressionDataBoxMapping* setLastProcessedChangedAxiom(cint64 lastBuilded); CExpressionDataBoxMapping* setLastProcessedBuildIndividual(cint64 lastBuilded); CExpressionDataBoxMapping* setLastProcessedBuildConcept(cint64 lastBuilded); CExpressionDataBoxMapping* setLastProcessedBuildObjectRole(cint64 lastBuilded); CExpressionDataBoxMapping* setLastProcessedBuildDataRole(cint64 lastBuilded); CExpressionDataBoxMapping* setLastProcessedBuildDataRange(cint64 lastBuilded); CExpressionDataBoxMapping* setLastProcessedBuildDatatype(cint64 lastBuilded); CExpressionDataBoxMapping* setLastProcessedInverseProperty(cint64 lastBuilded); CExpressionDataBoxMapping* setLastProcessedExpression(cint64 lastBuilded); CExpressionDataBoxMapping* setLastBuildedIndividual(cint64 lastBuilded); CExpressionDataBoxMapping* setLastBuildedConcept(cint64 lastBuilded); CExpressionDataBoxMapping* setLastBuildedObjectRole(cint64 lastBuilded); CExpressionDataBoxMapping* setLastBuildedDataRole(cint64 lastBuilded); CExpressionDataBoxMapping* setLastBuildedDataRange(cint64 lastBuilded); CExpressionDataBoxMapping* setLastBuildedDatatype(cint64 lastBuilded); CBUILDHASH* getInverseObjectPropertyHash(); CBUILDHASH* getStructuralExpressionBuildHash(); CBUILDLIST* getExpressionBuildListContainer(); // protected methods protected: // protected variables protected: COntologyContext* mOntoContext; CActiveEntityCountVector* mActiveEntityCountVector; COntologyBuildConstructFlags mConstructFlags; CBUILDHASH* mClassTermConceptHash; CBUILDHASH* mConceptClassTermHash; CBUILDHASH* mDataRangeTermConceptHash; CBUILDHASH* mConceptDataRangeTermHash; CBUILDHASH* mObjPropTermRoleHash; CBUILDHASH* mRoleObjPropTermHash; CBUILDHASH* mDataPropTermRoleHash; CBUILDHASH* mRoleDataPropTermHash; CBUILDHASH* mIndividulTermIndiHash; CBUILDHASH* mIndiIndividulTermHash; CBUILDHASH* mDatatypeExpDatatypeHash; CBUILDHASH* mDatatypeDatatypeExpHash; CBUILDHASH* mUpdateClassAxiomHash; CBUILDHASH* mUpdateObjectPropertyAxiomHash; CBUILDHASH* mUpdateDataPropertyAxiomHash; CBUILDHASH* mUpdateAssertionAxiomHash; // contains also previous ontology data CBUILDSET< QPair >* mClassTermClassAxiomSet; CBUILDHASH* mClassTermClassAxiomHash; CBUILDSET< QPair >* mObjPropTermObjPropAxiomSet; CBUILDHASH* mObjPropTermObjPropAxiomHash; CBUILDSET< QPair >* mDataPropTermDataPropAxiomSet; CBUILDHASH* mDataPropTermDataPropAxiomHash; CBUILDSET< QPair >* mIndiTermAssertionAxiomSet; CBUILDHASH* mIndiTermAssertionAxiomHash; CBUILDSET* mTopRebuildClassTermExpressionsSet; CBUILDSET* mTopRebuildObjectPropertyTermExpressionsSet; CBUILDHASH* mObjPropTermRoleChainHash; CBUILDHASH* mRoleChainObjPropTermHash; cint64 mLastActiveCountedEntityAxiom; cint64 mLastProcessedChangedAxiom; cint64 mLastProcessedBuildIndividual; cint64 mLastProcessedBuildConcept; cint64 mLastProcessedBuildObjectRole; cint64 mLastProcessedBuildDataRole; cint64 mLastProcessedBuildDataRange; cint64 mLastProcessedBuildDatatype; cint64 mLastProcessedInverseProperty; cint64 mLastProcessedExpression; cint64 mLastBuildedIndividual; cint64 mLastBuildedConcept; cint64 mLastBuildedObjectRole; cint64 mLastBuildedDataRole; cint64 mLastBuildedDataRange; cint64 mLastBuildedDatatype; CBUILDSET* mBuildedIndividualSet; CBUILDSET* mBuildedObjectRoleSet; CBUILDSET* mBuildedDataRoleSet; CBUILDSET* mBuildedDataRangeSet; CBUILDSET* mBuildedDatatypeSet; CBUILDSET* mBuildedConceptSet; CBUILDLIST* mBuildedIndividualList; CBUILDLIST* mBuildedObjectRoleList; CBUILDLIST* mBuildedDataRoleList; CBUILDLIST* mBuildedDataRangeList; CBUILDLIST* mBuildedDatatypeList; CBUILDLIST* mBuildedConceptList; CBUILDHASH* mInverseObjectPropertyHash; CBUILDHASH* mExpressionBuildHash; CBUILDLIST* mExpressionBuildListContainer; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CEXPRESSIONDATABOXMAPPING_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceTriggers.cpp0000644000175000017500000000434612520551204027717 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceTriggers.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceTriggers::CDatatypeValueSpaceTriggers(CBoxContext* boxContext) : mBoxContext(boxContext) { } CDatatypeValueSpaceTriggers* CDatatypeValueSpaceTriggers::initValueSpaceTriggers(CDatatypeValueSpaceTriggers* data) { if (data) { mValueSpateTriggerData.initConceptTriggeringData(&data->mValueSpateTriggerData); mConceptTriggerCount = data->mConceptTriggerCount; } else { mValueSpateTriggerData.initConceptTriggeringData(nullptr); mConceptTriggerCount = 0; } return this; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceTriggers::getValueSpaceConceptTriggeringData() { return &mValueSpateTriggerData; } cint64 CDatatypeValueSpaceTriggers::getConceptTriggerCount() { return mConceptTriggerCount; } CDatatypeValueSpaceTriggers* CDatatypeValueSpaceTriggers::incConceptTriggerCount(cint64 incCount) { mConceptTriggerCount += incCount; return this; } CDatatypeValueSpaceTriggers* CDatatypeValueSpaceTriggers::addValueSpaceConceptTrigger(CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger) { incConceptTriggerCount(conceptTrigger->getCount()); mValueSpateTriggerData.appendPartialConceptTriggers(conceptTrigger); return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleChainVector.cpp0000644000175000017500000000231212520551214025503 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleChainVector.h" namespace Konclude { namespace Reasoner { namespace Ontology { CRoleChainVector::CRoleChainVector(CBoxContext* boxContext) : CDefaultDynamicReferenceVectorBase(boxContext) { } CRoleChainVector::~CRoleChainVector() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CCachingTags.h0000644000175000017500000000415712520551174024312 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCACHINGTAGS_H #define KONCLUDE_REASONER_ONTOLOGY_CCACHINGTAGS_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CCachingTags * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCachingTags { // public methods public: //! Constructor CCachingTags(); cint64 getLastCachingTag(); cint64 getMaxCachedTag(); cint64 getMinCachedTag(); CCachingTags* setLastCachingTag(cint64 tag); CCachingTags* setMaxCachedTag(cint64 tag); CCachingTags* setMinCachedTag(cint64 tag); bool setMaxCachedTagCandidate(cint64 tag); bool setMinCachedTagCandidate(cint64 tag); // protected methods protected: // protected variables protected: cint64 mLastCachingTag; cint64 mMaxCachedTag; cint64 mMinCachedTag; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCACHINGTAGS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStepDataVector.h0000644000175000017500000000441412520551212030604 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPDATAVECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPDATAVECTOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyContext.h" #include "COntologyProcessingStep.h" #include "COntologyProcessingStepVector.h" #include "COntologyProcessingStepData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyProcessingStepDataVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyProcessingStepDataVector { // public methods public: //! Constructor COntologyProcessingStepDataVector(COntologyContext* context); COntologyProcessingStepData* getProcessingStepData(cint64 stepID); COntologyProcessingStepData* getProcessingStepData(COntologyProcessingStep::PROCESSINGSTEPTYPE stepType); // protected methods protected: // protected variables protected: COntologyContext* mContext; COntologyProcessingStepVector* mPrStepVector; COntologyProcessingStepData** mPrStepDataVector; cint64 mPrStCount; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPDATAVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConcreteOntology.cpp0000644000175000017500000002555312520551176025774 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteOntology.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConcreteOntology::CConcreteOntology(CConfigurationBase* configuration) { mStructSumm = nullptr; mStringMapping = nullptr; mDataBoxes = nullptr; mBuildData = nullptr; mTax = nullptr; mConsistence = nullptr; mAxiomSet = nullptr; mConceptCyclesData = nullptr; mPrecomputation = nullptr; mProcessingSteps = nullptr; mConfiguration = configuration; mClassification = new CClassification(); mPrecomputation = new CPrecomputation(); mPreprocessing = new CPreprocessing(); mRealization = new CRealization(); mOntConctext = new CConcreteOntologyContextBase(); mDataBoxes = CObjectParameterizingAllocator< COntologyDataBoxes,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntConctext),mOntConctext); mStringMapping = CObjectParameterizingAllocator< COntologyStringMapping,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntConctext),mOntConctext); mStructSumm = CObjectParameterizingAllocator< COntologyStructureSummary,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntConctext),mOntConctext); mBuildData = CObjectParameterizingAllocator< COntologyBuildData,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntConctext),mOntConctext); mConceptCyclesData = CObjectParameterizingAllocator< COntologyCoreConceptCyclesData,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntConctext),mOntConctext); mProcessingSteps = CObjectParameterizingAllocator< COntologyProcessingSteps,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntConctext),mOntConctext); mIncRevisionData = CObjectParameterizingAllocator< COntologyIncrementalRevisionData,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntConctext),mOntConctext); mIncRevisionData->setBasementOntology(this); } CConcreteOntology::CConcreteOntology(CConcreteOntology* refOntology, CConfigurationBase* configuration) { mStructSumm = nullptr; mStringMapping = nullptr; mDataBoxes = nullptr; mBuildData = nullptr; mTax = nullptr; mConsistence = nullptr; mAxiomSet = nullptr; mConceptCyclesData = nullptr; mPrecomputation = nullptr; mProcessingSteps = nullptr; mConfiguration = configuration; mClassification = new CClassification(); mPrecomputation = new CPrecomputation(); mPreprocessing = new CPreprocessing(); mRealization = new CRealization(); mOntConctext = new CConcreteOntologyContextBase(); mDataBoxes = CObjectParameterizingAllocator< COntologyDataBoxes,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntConctext),mOntConctext); mStringMapping = CObjectParameterizingAllocator< COntologyStringMapping,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntConctext),mOntConctext); mStructSumm = CObjectParameterizingAllocator< COntologyStructureSummary,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntConctext),mOntConctext); mBuildData = CObjectParameterizingAllocator< COntologyBuildData,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntConctext),mOntConctext); mConceptCyclesData = CObjectParameterizingAllocator< COntologyCoreConceptCyclesData,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntConctext),mOntConctext); mProcessingSteps = CObjectParameterizingAllocator< COntologyProcessingSteps,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntConctext),mOntConctext); mIncRevisionData = CObjectParameterizingAllocator< COntologyIncrementalRevisionData,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntConctext),mOntConctext); if (refOntology) { referenceOntology(refOntology); } } CConcreteOntology::~CConcreteOntology() { COPADestroyAndRelease(mDataBoxes,CContext::getMemoryAllocationManager(mOntConctext)); COPADestroyAndRelease(mStructSumm,CContext::getMemoryAllocationManager(mOntConctext)); COPADestroyAndRelease(mStringMapping,CContext::getMemoryAllocationManager(mOntConctext)); COPADestroyAndRelease(mBuildData,CContext::getMemoryAllocationManager(mOntConctext)); COPADestroyAndRelease(mConceptCyclesData,CContext::getMemoryAllocationManager(mOntConctext)); COPADestroyAndRelease(mProcessingSteps,CContext::getMemoryAllocationManager(mOntConctext)); COPADestroyAndRelease(mIncRevisionData,CContext::getMemoryAllocationManager(mOntConctext)); delete mOntConctext; delete mConsistence; delete mClassification; delete mPrecomputation; delete mPreprocessing; delete mRealization; } CConfigurationBase* CConcreteOntology::getConfiguration() { return mConfiguration; } CConcreteOntology* CConcreteOntology::referenceOntology(CConcreteOntology* ontology) { mDataBoxes->referenceDataBoxes(ontology->mDataBoxes); mStringMapping->referenceStringMapping(ontology->mStringMapping); mBuildData->referenceBuildData(ontology->mBuildData); mStructSumm->referenceStructureSummary(ontology->mStructSumm); mIncRevisionData->referenceIncrementalRevision(ontology->mIncRevisionData); mIncRevisionData->setPreviousOntologyVersion(ontology); return this; } CABox* CConcreteOntology::getABox() { return mDataBoxes->getABox(); } CTBox* CConcreteOntology::getTBox() { return mDataBoxes->getTBox(); } CRBox* CConcreteOntology::getRBox() { return mDataBoxes->getRBox(); } CConcept* CConcreteOntology::getConcept(const QString& className) { CConcept* concept = nullptr; CMAPPINGHASH* classNameConceptMappingHash = mStringMapping->getClassNameConceptMappingHash(false); if (classNameConceptMappingHash) { concept = classNameConceptMappingHash->value(className,nullptr); } return concept; } CConcreteOntology* CConcreteOntology::setConceptTaxonomy(CTaxonomy *taxonomy) { mTax = taxonomy; return this; } CTaxonomy *CConcreteOntology::getConceptTaxonomy() { return mTax; } bool CConcreteOntology::hasConceptTaxonomy() { return mTax != nullptr; } CConsistence* CConcreteOntology::getConsistence() { return mConsistence; } bool CConcreteOntology::hasConsistence() { return mConsistence != nullptr; } CConcreteOntology *CConcreteOntology::setConsistence(CConsistence *consistence) { mConsistence = consistence; return this; } CClassification* CConcreteOntology::getClassification() { return mClassification; } bool CConcreteOntology::hasClassification() { return mClassification != nullptr; } CConcreteOntology *CConcreteOntology::setClassification(CClassification *classification) { mClassification = classification; return this; } CPrecomputation* CConcreteOntology::getPrecomputation() { return mPrecomputation; } bool CConcreteOntology::hasPrecomputation() { return mPrecomputation != nullptr; } CConcreteOntology* CConcreteOntology::setPrecomputation(CPrecomputation* precomputation) { mPrecomputation = precomputation; return this; } CPreprocessing* CConcreteOntology::getPreprocessing() { return mPreprocessing; } bool CConcreteOntology::hasPreprocessing() { return mPreprocessing != nullptr; } CConcreteOntology* CConcreteOntology::setPreprocessing(CPreprocessing* preprocessing) { mPreprocessing = preprocessing; return this; } CRealization* CConcreteOntology::getRealization() { return mRealization; } bool CConcreteOntology::hasRealization() { return mRealization != nullptr; } CConcreteOntology* CConcreteOntology::setRealization(CRealization* realization) { mRealization = realization; return this; } COntologyStructureSummary *CConcreteOntology::getStructureSummary() { return mStructSumm; } CConcreteOntology *CConcreteOntology::setStructureSummary(COntologyStructureSummary *structureSummary) { mStructSumm = structureSummary; return this; } COntologyDataBoxes *CConcreteOntology::getDataBoxes() { return mDataBoxes; } CConcreteOntology *CConcreteOntology::setDataBoxes(COntologyDataBoxes *dataBoxes) { mDataBoxes = dataBoxes; return this; } COntologyStringMapping *CConcreteOntology::getStringMapping() { return mStringMapping; } CConcreteOntology *CConcreteOntology::setStringMapping(COntologyStringMapping *stringMapping) { mStringMapping = stringMapping; return this; } COntologyContext* CConcreteOntology::getOntologyContext() { return mOntConctext; } COntologyBuildData *CConcreteOntology::getBuildData() { return mBuildData; } CConcreteOntology *CConcreteOntology::setBuildData(COntologyBuildData *buildData) { mBuildData = buildData; return this; } COntologyCoreConceptCyclesData* CConcreteOntology::getCoreConceptCyclesData() { return mConceptCyclesData; } CConcreteOntology* CConcreteOntology::setCoreConceptCyclesData(COntologyCoreConceptCyclesData* cyclesData) { mConceptCyclesData = cyclesData; return this; } COntologyProcessingSteps* CConcreteOntology::getProcessingSteps() { return mProcessingSteps; } CConcreteOntology* CConcreteOntology::setProcessingSteps(COntologyProcessingSteps* stepData) { mProcessingSteps = stepData; return this; } COntologyIncrementalRevisionData* CConcreteOntology::getIncrementalRevisionData() { return mIncRevisionData; } CConcreteOntology* CConcreteOntology::setIncrementalRevisionData(COntologyIncrementalRevisionData* incRevData) { mIncRevisionData = incRevData; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyExpressivity.cpp0000644000175000017500000000750312520551210026730 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyExpressivity.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyExpressivity::COntologyExpressivity() { } COntologyExpressivity::COntologyExpressivity(const QString& string) { initExpressivity(string); } COntologyExpressivity* COntologyExpressivity::initExpressivity(const QString& string) { mExpressivityString = string; mExpressivityFlags = 0; if (mExpressivityString.indexOf("AL") != -1) { mExpressivityFlags |= EXPRESSIVITY_AL; if (mExpressivityString.indexOf("E") != -1) { mExpressivityFlags |= EXPRESSIVITY_E | EXPRESSIVITY_EL; } if (mExpressivityString.indexOf("C") != -1) { mExpressivityFlags |= EXPRESSIVITY_C | EXPRESSIVITY_EL | EXPRESSIVITY_E; if (mExpressivityString.indexOf("+") != -1) { mExpressivityFlags |= EXPRESSIVITY_S; if (mExpressivityString.indexOf("R") != -1) { mExpressivityFlags |= EXPRESSIVITY_EPLUSPLUS; } } } } if (mExpressivityString.indexOf("S") != -1) { mExpressivityFlags |= EXPRESSIVITY_AL | EXPRESSIVITY_EL | EXPRESSIVITY_E | EXPRESSIVITY_C | EXPRESSIVITY_S | EXPRESSIVITY_TRANS; if (mExpressivityString.indexOf("R") != -1) { mExpressivityFlags |= EXPRESSIVITY_EPLUSPLUS; } } if (mExpressivityString.indexOf("EL") != -1) { mExpressivityFlags |= EXPRESSIVITY_EL; if (mExpressivityString.indexOf("++") != -1) { mExpressivityFlags |= EXPRESSIVITY_EPLUSPLUS; } } if (mExpressivityString.indexOf("+") != -1) { mExpressivityFlags |= EXPRESSIVITY_TRANS; } if (mExpressivityString.indexOf("D") != -1) { mExpressivityFlags |= EXPRESSIVITY_D; } if (mExpressivityString.indexOf("H") != -1) { mExpressivityFlags |= EXPRESSIVITY_H; } if (mExpressivityString.indexOf("R") != -1) { mExpressivityFlags |= EXPRESSIVITY_R | EXPRESSIVITY_H | EXPRESSIVITY_TRANS; } if (mExpressivityString.indexOf("F") != -1) { mExpressivityFlags |= EXPRESSIVITY_F; } if (mExpressivityString.indexOf("N") != -1) { mExpressivityFlags |= EXPRESSIVITY_F | EXPRESSIVITY_N; } if (mExpressivityString.indexOf("Q") != -1) { mExpressivityFlags |= EXPRESSIVITY_F | EXPRESSIVITY_N | EXPRESSIVITY_Q; } if (mExpressivityString.indexOf("I") != -1) { mExpressivityFlags |= EXPRESSIVITY_I; } if (mExpressivityString.indexOf("O") != -1) { mExpressivityFlags |= EXPRESSIVITY_O; } return this; } bool COntologyExpressivity::isExpressivityEntailed(COntologyExpressivity* expressivity) { return (expressivity->mExpressivityFlags & mExpressivityFlags) == expressivity->mExpressivityFlags; } bool COntologyExpressivity::isExpressivityEqual(COntologyExpressivity* expressivity) { return expressivity->mExpressivityFlags == mExpressivityFlags; } QString COntologyExpressivity::getExpressivityString() { return mExpressivityString; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptRoleBranchingTrigger.h0000644000175000017500000000506412520551174027512 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTROLEBRANCHINGTRIGGER_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTROLEBRANCHINGTRIGGER_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CConceptRoleBranchingTrigger * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptRoleBranchingTrigger : public CLinkerBase { // public methods public: //! Constructor CConceptRoleBranchingTrigger(); CConceptRoleBranchingTrigger* initConceptBranchingTrigger(CConcept* triggerConcept, bool triggerNegation); CConceptRoleBranchingTrigger* initRoleBranchingTrigger(CRole *triggerRole); CConcept* getTriggerConcept(); CRole* getTriggerRole(); bool getTriggerNegation(); bool isConceptTrigger(); bool isRoleTrigger(); enum BRANCHINGTRIGGERTYPE { BTTCONCEPT, BTTROLE }; BRANCHINGTRIGGERTYPE getBranchingTriggerType(); CConceptRoleBranchingTrigger* getNextBranchingTrigger(); // protected methods protected: // protected variables protected: CRole* mTriggerRole; CConcept* mTriggerConcept; bool mTriggerNegation; bool mUsedConceptTrigger; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTROLEBRANCHINGTRIGGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRole.cpp0000644000175000017500000005211312520551410023357 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRole.h" namespace Konclude { namespace Reasoner { namespace Ontology { CRole::CRole() { initRole(); } CRole::~CRole() { } CRole *CRole::initRole() { superRoles = 0; indirectSuperRoles = 0; mComplexity = false; mFunctional = false; mInvFunctional = false; mTransetive = false; mAsymmetric = false; mSymmetric = false; mReflexive = false; mIrreflexive = false; mDataRole = false; rangeLinker = 0; domainLinker = 0; tax = 0; mInverseEquivalentRoles = 0; mDisjointRoles = 0; mRoleChainSubSharingLinker = nullptr; mRoleChainSuperSharingLinker = nullptr; mInverseRole = nullptr; mRoleData = nullptr; return this; } CRole *CRole::init(qint64 roleTag) { initRole(); mTag = roleTag; return this; } CRole *CRole::init(CRole *role) { mNameLinker = role->getPropertyNameLinker(); mTag = role->mTag; mDataRole = role->mDataRole; superRoles = 0; indirectSuperRoles = 0; rangeLinker = 0; domainLinker = 0; tax = 0; mInverseEquivalentRoles = 0; mDisjointRoles = 0; mInverseRole = nullptr; mComplexity = role->mComplexity; mFunctional = role->mFunctional; mInvFunctional = role->mInvFunctional; mTransetive = role->mTransetive; mAsymmetric = role->mAsymmetric; mSymmetric = role->mSymmetric; mReflexive = role->mReflexive; mIrreflexive = role->mIrreflexive; mRoleChainSubSharingLinker = role->mRoleChainSubSharingLinker; mRoleChainSuperSharingLinker = role->mRoleChainSuperSharingLinker; return this; } CRole *CRole::initRoleCopy(CRole *role, CMemoryAllocationManager* memMan) { mNameLinker = role->getPropertyNameLinker(); mTag = role->mTag; mDataRole = role->mDataRole; superRoles = 0; indirectSuperRoles = 0; rangeLinker = 0; domainLinker = 0; tax = 0; mInverseEquivalentRoles = 0; mDisjointRoles = 0; mComplexity = role->mComplexity; mFunctional = role->mFunctional; mInvFunctional = role->mInvFunctional; mTransetive = role->mTransetive; mAsymmetric = role->mAsymmetric; mSymmetric = role->mSymmetric; mReflexive = role->mReflexive; mIrreflexive = role->mIrreflexive; mRoleChainSubSharingLinker = role->mRoleChainSubSharingLinker; mRoleChainSuperSharingLinker = role->mRoleChainSuperSharingLinker; mInverseRole = role->mInverseRole; CSortedNegLinker *superRoleIt = role->superRoles; while (superRoleIt) { CRole *superRole = superRoleIt->getData(); bool negated = superRoleIt->isNegated(); CSortedNegLinker *superRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); superRoleLinker->init(superRole,negated); addSuperRoleLinker(superRoleLinker); superRoleIt = (CSortedNegLinker *)superRoleIt->getNext(); } CSortedNegLinker *inverseRolesIt = role->getInverseRoleList(); while (inverseRolesIt) { CSortedNegLinker *invRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); invRoleLinker->init(inverseRolesIt->getData(),inverseRolesIt->isNegated()); addInverseRoleLinker(invRoleLinker); inverseRolesIt = (CSortedNegLinker *)inverseRolesIt->getNext(); } CSortedNegLinker *disjointRolesIt = role->getDisjointRoleList(); while (disjointRolesIt) { CSortedNegLinker *disRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); disRoleLinker->init(disjointRolesIt->getData(),disjointRolesIt->isNegated()); addDisjointRoleLinker(disRoleLinker); disjointRolesIt = (CSortedNegLinker *)disjointRolesIt->getNext(); } CSortedNegLinker *rangeLinkerIt = role->getRangeConceptList(); while (rangeLinkerIt) { CSortedNegLinker *rangeConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); rangeConLinker->init(rangeLinkerIt->getData(),rangeLinkerIt->isNegated()); addRangeConceptLinker(rangeConLinker); rangeLinkerIt = (CSortedNegLinker *)rangeLinkerIt->getNext(); } CSortedNegLinker *domainLinkerIt = role->getDomainConceptList(); while (domainLinkerIt) { CSortedNegLinker *domainConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); domainConLinker->init(domainLinkerIt->getData(),domainLinkerIt->isNegated()); addDomainConceptLinker(domainConLinker); domainLinkerIt = (CSortedNegLinker *)domainLinkerIt->getNext(); } return this; } bool CRole::isDataRole() { return mDataRole; } bool CRole::isObjectRole() { return !isDataRole(); } CRole* CRole::setDataRole(bool dataRole) { mDataRole = dataRole; return this; } CRole* CRole::setObjectRole(bool objectRole) { setDataRole(!objectRole); return this; } CRole* CRole::getInverseRole() { return mInverseRole; } CRole* CRole::setInverseRole(CRole* inverseRole) { mInverseRole = inverseRole; return this; } bool CRole::hasInverseRoles() { CSortedNegLinker* inverseEquivalentRolesIt = mInverseEquivalentRoles; while (inverseEquivalentRolesIt) { if (inverseEquivalentRolesIt->isNegated()) { return true; } inverseEquivalentRolesIt = inverseEquivalentRolesIt->getNext(); } return false; } CRole *CRole::addInverseRoleLinker(CSortedNegLinker *inverseRole) { if (mInverseEquivalentRoles) { mInverseEquivalentRoles = mInverseEquivalentRoles->insertSortedNextSorted(inverseRole); } else { mInverseEquivalentRoles = inverseRole; } return this; } CSortedNegLinker *CRole::getInverseRoleList() { return mInverseEquivalentRoles; } CRole *CRole::setInverseEquivalentRoleList(CSortedNegLinker *invEqRoleList) { mInverseEquivalentRoles = invEqRoleList; return this; } CSortedNegLinker *CRole::getInverseEquivalentRoleList() { return mInverseEquivalentRoles; } bool CRole::hasEquivalentRoles() { CSortedNegLinker* inverseEquivalentRolesIt = mInverseEquivalentRoles; while (inverseEquivalentRolesIt) { if (!inverseEquivalentRolesIt->isNegated()) { return true; } inverseEquivalentRolesIt = inverseEquivalentRolesIt->getNext(); } return false; } CRole *CRole::addEquivalentRoleLinker(CSortedNegLinker *equivalentRole) { if (mInverseEquivalentRoles) { mInverseEquivalentRoles = mInverseEquivalentRoles->insertSortedNextSorted(equivalentRole); } else { mInverseEquivalentRoles = equivalentRole; } return this; } bool CRole::hasEquivalentRole(CRole* role) { CSortedNegLinker* inverseEquivalentRolesIt = mInverseEquivalentRoles; while (inverseEquivalentRolesIt) { if (!inverseEquivalentRolesIt->isNegated() && inverseEquivalentRolesIt->getData() == role) { return true; } inverseEquivalentRolesIt = inverseEquivalentRolesIt->getNext(); } return false; } bool CRole::hasInverseRole(CRole* role) { if (mInverseRole == role) { return true; } CSortedNegLinker* inverseEquivalentRolesIt = mInverseEquivalentRoles; while (inverseEquivalentRolesIt) { if (inverseEquivalentRolesIt->isNegated() && inverseEquivalentRolesIt->getData() == role) { return true; } inverseEquivalentRolesIt = inverseEquivalentRolesIt->getNext(); } return false; } bool CRole::hasDisjointRole(CRole* role) { CSortedNegLinker* disjointRolesIt = mDisjointRoles; while (disjointRolesIt) { if (disjointRolesIt->getData() == role) { return true; } disjointRolesIt = disjointRolesIt->getNext(); } return false; } CRole *CRole::setDisjointRoleList(CSortedNegLinker *disRoleList) { mDisjointRoles = disRoleList; return this; } bool CRole::hasDisjointRoles() { return mDisjointRoles != nullptr; } CRole *CRole::addDisjointRoleLinker(CSortedNegLinker *disjointRole) { if (mDisjointRoles) { mDisjointRoles = mDisjointRoles->insertSortedNextSorted(disjointRole); } else { mDisjointRoles = disjointRole; } return this; } CSortedNegLinker *CRole::getDisjointRoleList() { return mDisjointRoles; } CSortedNegLinker *CRole::getEquivalentRoleList() { return mInverseEquivalentRoles; } CRole *CRole::setRoleTag(qint64 roleTag) { mTag = roleTag; return this; } qint64 CRole::getRoleTag() const { return mTag; } CRole *CRole::setTerminology(CTerminology *ontology) { tax = ontology; return this; } CTerminology *CRole::getTerminology() { return tax; } qint64 CRole::getTerminologyTag() const { if (tax) { return tax->getTerminologyID(); } else { return 0; } } CRole *CRole::setRoleComplexity(bool complexRole) { mComplexity = complexRole; return this; } bool CRole::isComplexRole() { return mComplexity; } bool CRole::isSimpleRole() { return !mComplexity; } bool CRole::getRoleComplexity() { return mComplexity; } CRole *CRole::setFunctional(bool functional) { mFunctional = functional; return this; } bool CRole::isFunctional() { return mFunctional; } bool CRole::getFunctional() { return mFunctional; } CRole *CRole::setInverseFunctional(bool invFunctional) { mInvFunctional = invFunctional; return this; } bool CRole::isInverseFunctional() { return mInvFunctional; } bool CRole::getInverseFunctional() { return mInvFunctional; } CRole *CRole::setTransitive(bool transetive) { mTransetive = transetive; return this; } bool CRole::isTransitive() { return mTransetive; } bool CRole::getTransitive() { return isTransitive(); } bool CRole::hasRoleData() { return mRoleData != nullptr; } CRoleData* CRole::getRoleData() { return mRoleData; } CRole* CRole::setRoleData(CRoleData* roleData) { mRoleData = roleData; return this; } CRole *CRole::setAsymmetric(bool asymmetric) { mAsymmetric = asymmetric; return this; } bool CRole::isAsymmetric() { return mAsymmetric; } bool CRole::getAsymmetric() { return mAsymmetric; } CRole *CRole::setSymmetric(bool symmetric) { mSymmetric = symmetric; return this; } bool CRole::isSymmetric() { return mSymmetric; } bool CRole::getSymmetric() { return mSymmetric; } CRole *CRole::setReflexive(bool reflexive) { mReflexive = reflexive; return this; } bool CRole::isReflexive() { return mReflexive; } bool CRole::getReflexive() { return mReflexive; } CRole *CRole::setIrreflexive(bool irreflexive) { mIrreflexive = irreflexive; return this; } bool CRole::isIrreflexive() { return mIrreflexive; } bool CRole::getIrreflexive() { return mIrreflexive; } CSortedNegLinker *CRole::getRangeConceptList() { return rangeLinker; } CSortedNegLinker *CRole::getRelativeRangeConceptList(bool roleInversed) { if (roleInversed) { return domainLinker; } else { return rangeLinker; } } CSortedNegLinker *CRole::getDomainRangeConceptList(bool roleInversed) { if (roleInversed) { return rangeLinker; } else { return domainLinker; } } bool CRole::hasRangeConceptTag(qint64 rangeConceptTag) { CSortedNegLinker *rangeConIt = rangeLinker; while (rangeConIt) { qint64 rangeConTag = rangeConIt->getData()->getConceptTag(); if (rangeConTag == rangeConceptTag) { return true; } else if (rangeConTag > rangeConceptTag) { return false; } rangeConIt = (CSortedNegLinker *)rangeConIt->getNext(); } return false; } bool CRole::hasRangeConcept(CConcept* concept) { CSortedNegLinker *rangeConIt = rangeLinker; while (rangeConIt) { CConcept* rangeConcept = rangeConIt->getData(); if (rangeConcept == concept) { return true; } rangeConIt = (CSortedNegLinker *)rangeConIt->getNext(); } return false; } bool CRole::hasDomainConcept(CConcept* concept) { CSortedNegLinker *domainConIt = domainLinker; while (domainConIt) { CConcept* domainConcept = domainConIt->getData(); if (domainConcept == concept) { return true; } domainConIt = (CSortedNegLinker *)domainConIt->getNext(); } return false; } bool CRole::hasDomainConceptTag(qint64 domainConceptTag) { CSortedNegLinker *domainConIt = domainLinker; while (domainConIt) { qint64 domainConTag = domainConIt->getData()->getConceptTag(); if (domainConTag == domainConceptTag) { return true; } else if (domainConTag > domainConceptTag) { return false; } domainConIt = (CSortedNegLinker *)domainConIt->getNext(); } return false; } bool CRole::hasDomainOrRangeConceptTag(qint64 conceptTag) { return hasRangeConceptTag(conceptTag) || hasDomainConceptTag(conceptTag); } CRole *CRole::setRangeConceptList(CSortedNegLinker *rangeConceptList) { rangeLinker = rangeConceptList; return this; } CRole *CRole::addRangeConceptLinker(CSortedNegLinker *rangeConceptLinker) { if (rangeLinker) { rangeLinker = rangeLinker->insertSortedNextSorted(rangeConceptLinker); } else { rangeLinker = rangeConceptLinker; } return this; } CSortedNegLinker *CRole::getDomainConceptList() { return domainLinker; } CRole *CRole::setDomainConceptList(CSortedNegLinker *domainConceptList) { domainLinker = domainConceptList; return this; } CRole *CRole::addDomainConceptLinker(CSortedNegLinker *domainConceptLinker) { if (domainLinker) { domainLinker = domainLinker->insertSortedNextSorted(domainConceptLinker); } else { domainLinker = domainConceptLinker; } return this; } CRole *CRole::setSuperRoleList(CSortedNegLinker *superRoleList) { superRoles = superRoleList; return this; } CRole *CRole::addSuperRoleLinker(CSortedNegLinker *superRoleLinker) { if (superRoles) { superRoles = superRoles->insertSortedNextSorted(superRoleLinker); } else { superRoles = superRoleLinker; } return this; } CSortedNegLinker *CRole::getSuperRoleList() { return superRoles; } bool CRole::hasSuperRole(CRole* role) { CSortedNegLinker *superRoleIt = superRoles; while (superRoleIt) { CRole *superRole = superRoleIt->getData(); if (superRole == role) { return true; } superRoleIt = (CSortedNegLinker *)superRoleIt->getNext(); } return false; } bool CRole::hasSuperRoleTag(qint64 tag) { CSortedNegLinker *superRoleIt = superRoles; while (superRoleIt) { CRole *superRole = superRoleIt->getData(); qint64 superRoleTag = superRole->getRoleTag(); if (tag == superRoleTag) { return true; } else if (superRoleTag > tag) { return false; } superRoleIt = (CSortedNegLinker *)superRoleIt->getNext(); } return false; } bool CRole::hasSuperRoleTag(qint64 tag, bool negated) { CSortedNegLinker *superRoleIt = superRoles; while (superRoleIt) { CRole *superRole = superRoleIt->getData(); qint64 superRoleTag = superRole->getRoleTag(); if (tag == superRoleTag && superRoleIt->isNegated() == negated) { return true; } else if (superRoleTag > tag) { return false; } superRoleIt = (CSortedNegLinker *)superRoleIt->getNext(); } return false; } CRole *CRole::setIndirectSuperRoleLinker(CSortedNegLinker *subRoleList) { indirectSuperRoles = subRoleList; return this; } CRole *CRole::addIndirectSuperRoleLinker(CSortedNegLinker *subRoleLinker) { if (indirectSuperRoles) { indirectSuperRoles = indirectSuperRoles->insertSortedNextSorted(subRoleLinker); } else { indirectSuperRoles = subRoleLinker; } return this; } CSortedNegLinker *CRole::getIndirectSuperRoleList() { return indirectSuperRoles; } bool CRole::hasIndirectSuperRole(CRole* role) { CSortedNegLinker *superRoleIt = indirectSuperRoles; while (superRoleIt) { CRole *superRole = superRoleIt->getData(); if (superRole == role) { return true; } superRoleIt = (CSortedNegLinker *)superRoleIt->getNext(); } return false; } bool CRole::hasIndirectSuperRoleTag(qint64 tag) { CSortedNegLinker *superRoleIt = indirectSuperRoles; while (superRoleIt) { CRole *superRole = superRoleIt->getData(); qint64 superRoleTag = superRole->getRoleTag(); if (tag == superRoleTag) { return true; } else if (superRoleTag > tag) { return false; } superRoleIt = (CSortedNegLinker *)superRoleIt->getNext(); } return false; } bool CRole::hasIndirectSuperRoleTag(qint64 tag, bool negated) { CSortedNegLinker *superRoleIt = indirectSuperRoles; while (superRoleIt) { CRole *superRole = superRoleIt->getData(); qint64 superRoleTag = superRole->getRoleTag(); if (tag == superRoleTag && superRoleIt->isNegated() == negated) { return true; } else if (superRoleTag > tag) { return false; } superRoleIt = (CSortedNegLinker *)superRoleIt->getNext(); } return false; } bool CRole::operator<=(const CRole &role) { if (mTag < role.mTag) { return true; } else if (mTag > role.mTag) { return false; } else { return getTerminologyTag() <= role.getTerminologyTag(); } } bool CRole::operator==(const CRole &role) { return mTag == role.mTag && tax == role.tax; } bool CRole::hasPropertyName() { return hasName(); } CRole *CRole::setPropertyNameLinker(CLinker *propertyNameLinker) { setNameLinker(propertyNameLinker); return this; } CRole *CRole::addPropertyNameLinker(CLinker *propertyNameLinker) { addNameLinker(propertyNameLinker); return this; } CLinker *CRole::getPropertyNameLinker() { return getNameLinker(); } bool CRole::hasRoleChainSubSharing() { return mRoleChainSubSharingLinker != nullptr; } CRole *CRole::addRoleChainSubSharingLinker(CXLinker* roleChainLinker) { if (roleChainLinker) { if (!mRoleChainSubSharingLinker) { mRoleChainSubSharingLinker = roleChainLinker; } else { mRoleChainSubSharingLinker = roleChainLinker->append(mRoleChainSubSharingLinker); } } return this; } CXLinker* CRole::getRoleChainSubSharingLinker() { return mRoleChainSubSharingLinker; } bool CRole::hasRoleChainSubSharingLinker(CRoleChain* roleChain) { CXLinker* roleChainIt = mRoleChainSubSharingLinker; while (roleChainIt) { if (roleChainIt->getData() == roleChain) { return true; } roleChainIt = roleChainIt->getNext(); } return false; } bool CRole::hasRoleChainSuperSharing() { return mRoleChainSuperSharingLinker != nullptr; } CRole *CRole::addRoleChainSuperSharingLinker(CXLinker* roleChainLinker) { if (roleChainLinker) { if (!mRoleChainSuperSharingLinker) { mRoleChainSuperSharingLinker = roleChainLinker; } else { mRoleChainSuperSharingLinker = roleChainLinker->append(mRoleChainSuperSharingLinker); } } return this; } CXLinker* CRole::getRoleChainSuperSharingLinker() { return mRoleChainSuperSharingLinker; } bool CRole::hasRoleChainSuperSharingLinker(CRoleChain* roleChain) { CXLinker* roleChainIt = mRoleChainSuperSharingLinker; while (roleChainIt) { if (roleChainIt->getData() == roleChain) { return true; } roleChainIt = roleChainIt->getNext(); } return false; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CBranchingTriggerVector.cpp0000644000175000017500000000241512520551174027067 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBranchingTriggerVector.h" namespace Konclude { namespace Reasoner { namespace Ontology { CBranchingTriggerVector::CBranchingTriggerVector(CBoxContext* boxContext) : CDefaultDynamicReferenceVectorBase(boxContext) { } CBranchingTriggerVector::~CBranchingTriggerVector() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatype.h0000644000175000017500000000665212520551200023702 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CTagItem.h" #include "CDatatypeValueSpaceType.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatype * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatype : public CTagItem { // public methods public: enum DATATYPE_BASIC_TYPE { DBT_NON, DBT_REAL, DBT_STRING, DBT_BOOLEAN, DBT_DOUBLE, DBT_FLOAT, DBT_IRI, DBT_HEXBINARY, DBT_BASE64BINARY, DBT_XML, DBT_DATETIME }; enum DATATYPE_TYPE { DT_NON, DT_REAL, DT_DECIMAL, DT_INTEGER, DT_RATIONAL, DT_PLAINLITERAL, DT_STRING, DT_BOOLEAN, DT_DOUBLE, DT_FLOAT, DT_IRI, DT_XML }; //! Constructor CDatatype(); CDatatype* initDatatype(const QString& datatypeIRI, bool basic = false); CDatatype* initDatatype(const QString& datatypeIRI, cint64 datatypeTag, bool basic); CDatatype* setDatatypeTag(qint64 datatypeTag); cint64 getDatatypeTag() const; bool isBasicDatatype(); CDatatype* setBasicDatatype(bool basic); CDatatype* getBasicDatatype(); CDatatype* setBasicDatatype(CDatatype* basicDatatpye); DATATYPE_BASIC_TYPE getBasicDatatypeType(); CDatatype* setBasicDatatypeType(DATATYPE_BASIC_TYPE basicDatatpyeType); DATATYPE_TYPE getDatatypeType(); CDatatype* setDatatypeType(DATATYPE_TYPE datatpyeType); const QString& getDatatypeIRI(); CConcept* getDatatypeConcept(); bool hasDatatypeConcept(); CDatatype* setDatatypeConcept(CConcept* concept); CConcept* getDefinitionConcept(); CDatatype* setDefinitionConcept(CConcept* concept); CDatatypeValueSpaceType* getValueSpaceType(); CDatatype* setValueSpaceType(CDatatypeValueSpaceType* valueSpaceType); bool isNormalized(); CDatatype* setNormalized(bool normalized); // protected methods protected: // protected variables protected: bool mBasicDatatype; bool mNormalized; QString mDatatypeIRI; CConcept* mDatatypeConcept; CConcept* mDefinitionConcept; CDatatypeValueSpaceType* mValueSpaceType; CDatatype* mDatatpyeBasic; DATATYPE_BASIC_TYPE mBasicDatatpyeType; DATATYPE_TYPE mDatatpyeType; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceRealTriggers.cpp0000644000175000017500000000736212520551202030522 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceRealTriggers.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceRealTriggers::CDatatypeValueSpaceRealTriggers(CBoxContext* boxContext) : CDatatypeValueSpaceCompareTriggers(boxContext) { } CDatatypeValueSpaceRealTriggers* CDatatypeValueSpaceRealTriggers::initValueSpaceRealTriggers(CDatatypeValueSpaceRealTriggers* data) { initValueSpaceCompareTriggers(data); if (data) { mValueSpateRationalTriggerData.initConceptTriggeringData(&data->mValueSpateRationalTriggerData); mValueSpateDecimalTriggerData.initConceptTriggeringData(&data->mValueSpateDecimalTriggerData); mValueSpateIntegerTriggerData.initConceptTriggeringData(&data->mValueSpateIntegerTriggerData); } else { mValueSpateRationalTriggerData.initConceptTriggeringData(nullptr); mValueSpateDecimalTriggerData.initConceptTriggeringData(nullptr); mValueSpateIntegerTriggerData.initConceptTriggeringData(nullptr); } return this; } CDatatypeValueSpaceRealTriggers* CDatatypeValueSpaceRealTriggers::addRealConceptTrigger(CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger) { incConceptTriggerCount(conceptTrigger->getCount()); mValueSpateTriggerData.appendPartialConceptTriggers(conceptTrigger); return this; } CDatatypeValueSpaceRealTriggers* CDatatypeValueSpaceRealTriggers::addRationalConceptTrigger(CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger) { incConceptTriggerCount(conceptTrigger->getCount()); mValueSpateRationalTriggerData.appendPartialConceptTriggers(conceptTrigger); return this; } CDatatypeValueSpaceRealTriggers* CDatatypeValueSpaceRealTriggers::addDecimalConceptTrigger(CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger) { incConceptTriggerCount(conceptTrigger->getCount()); mValueSpateDecimalTriggerData.appendPartialConceptTriggers(conceptTrigger); return this; } CDatatypeValueSpaceRealTriggers* CDatatypeValueSpaceRealTriggers::addIntegerConceptTrigger(CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger) { incConceptTriggerCount(conceptTrigger->getCount()); mValueSpateIntegerTriggerData.appendPartialConceptTriggers(conceptTrigger); return this; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceRealTriggers::getRealConceptTriggeringData() { return getValueSpaceConceptTriggeringData(); } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceRealTriggers::getRationalConceptTriggeringData() { return &mValueSpateRationalTriggerData; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceRealTriggers::getDecimalConceptTriggeringData() { return &mValueSpateDecimalTriggerData; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceRealTriggers::getIntegerConceptTriggeringData() { return &mValueSpateIntegerTriggerData; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConcreteOntologyContextBase.h0000644000175000017500000000500212520551176027564 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCRETEONTOLOGYCONTEXTBASE_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCRETEONTOLOGYCONTEXTBASE_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CBoxContext.h" // Other includes #include "Context/CContext.h" #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Reasoner { namespace Ontology { /*! * * \class CConcreteOntologyContextBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteOntologyContextBase : public CBoxContext { // public methods public: //! Constructor CConcreteOntologyContextBase(); //! Destructor virtual ~CConcreteOntologyContextBase(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); virtual CMemoryPoolProvider* getMemoryPoolProvider(); virtual CObjectContainer *getObjectContainer(bool create = true); virtual COntologyContextMemoryManager *getOnologyMemoryManager(COntologyContextMemoryManagerProvider *provider = nullptr); // protected methods protected: // protected variables protected: CMemoryPoolAllocationManager* mMemMan; CNewAllocationMemoryPoolProvider* mPoolProvider; CObjectContainer *mObjCon; COntologyContextMemoryManager *mOntMemMan; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCRETEONTOLOGYCONTEXTBASE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualDependenceTracking.h0000644000175000017500000000446212520551206027660 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALDEPENDENCETRACKING_H #define KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALDEPENDENCETRACKING_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes #include "Reasoner/Consistence/CConsistenceData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Consistence; namespace Ontology { /*! * * \class CIndividualDependenceTracking * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualDependenceTracking { // public methods public: //! Constructor CIndividualDependenceTracking(); virtual ~CIndividualDependenceTracking(); virtual bool mergeGatheredTrackedIndividualDependences(CIndividualDependenceTracking* indiDepTracking) = 0; virtual bool areIndividualsAffected(QSet* indirectlyChangedIndividualSet, QSet* changedCompatibleSet) = 0; virtual bool areIndividualsAffected(CConsistenceData* consData) = 0; virtual CIndividualDependenceTracking* getCopiedIndividualDependencyTracking() = 0; virtual cint64 getDependenceSize() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALDEPENDENCETRACKING_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyIncrementalRevisionData.h0000644000175000017500000000774212520551210030436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYINCREMENTALREVISIONDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYINCREMENTALREVISIONDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyContext.h" #include "COntologyIncrementalAxiomChangeData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyIncrementalRevisionData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyIncrementalRevisionData { // public methods public: //! Constructor COntologyIncrementalRevisionData(COntologyContext* ontoContext = nullptr); //! Destructor virtual ~COntologyIncrementalRevisionData(); COntologyIncrementalRevisionData* referenceIncrementalRevision(COntologyIncrementalRevisionData* incRevData); CConcreteOntology* getBasementOntology(); CConcreteOntology* getPreviousOntologyVersion(); COntologyIncrementalRevisionData* setBasementOntology(CConcreteOntology* ontology); COntologyIncrementalRevisionData* setPreviousOntologyVersion(CConcreteOntology* ontology); COntologyIncrementalAxiomChangeData* getAxiomChangeData(); cint64 getLastChangeCountedAxiom(); COntologyIncrementalRevisionData* setLastChangeCountedAxiom(cint64 lastAxiom); bool isBasementOntology(); bool isInitialOntology(); bool isIncrementalOntology(); COntologyIncrementalRevisionData* setPreviousConsistentOntology(CConcreteOntology* ontology); CConcreteOntology* getPreviousConsistentOntology(); COntologyIncrementalRevisionData* setPreviousClassesClassifiedOntology(CConcreteOntology* ontology); CConcreteOntology* getPreviousClassesClassifiedOntology(); COntologyIncrementalRevisionData* setPreviousSameIndividualsRealizedOntology(CConcreteOntology* ontology); CConcreteOntology* getPreviousSameIndividualsRealizedOntology(); COntologyIncrementalRevisionData* setPreviousClassTypesRealizedOntology(CConcreteOntology* ontology); CConcreteOntology* getPreviousClassTypesRealizedOntology(); COntologyIncrementalRevisionData* setPreviousRoleTypesRealizedOntology(CConcreteOntology* ontology); CConcreteOntology* getPreviousRoleTypesRealizedOntology(); // protected methods protected: // protected variables protected: COntologyContext* mOntoContext; CConcreteOntology* mBasementOntology; CConcreteOntology* mPreviousVersionOntology; CConcreteOntology* mPreviousConsistentOntology; CConcreteOntology* mPreviousClassesClassifiedOntology; CConcreteOntology* mPreviousSameIndividualsRealizedOntology; CConcreteOntology* mPreviousClassTypesRealizedOntology; CConcreteOntology* mPreviousRoleTypesRealizedOntology; COntologyIncrementalAxiomChangeData mAxiomChangeData; cint64 mLastChangeCountedAxiom; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYINCREMENTALREVISIONDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptDataVector.h0000644000175000017500000000400712520551174025501 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDATAVECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDATAVECTOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CBoxContext.h" #include "CConceptData.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CConceptDataVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptDataVector : public CDefaultDynamicReferenceVectorBase { // public methods public: //! Constructor CConceptDataVector(CBoxContext* boxContext = nullptr); //! Destructor virtual ~CConceptDataVector(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDATAVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyImportData.h0000644000175000017500000000437312520551210025725 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYIMPORTDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYIMPORTDATA_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyImportData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyImportData { // public methods public: //! Constructor COntologyImportData(); COntologyImportData* initOntologyImportData(const QString& ontoIRIString); QString getOntologyIRIString(); QString getResolvedIRIOntoLoadString(); bool getOntologyLoaded(); bool getOntologyLoadingTried(); COntologyImportData* setOntologyLoaded(bool loaded); COntologyImportData* setOntologyLoadingTried(bool tried); COntologyImportData* setResolvedIRIOntoLoadString(const QString& resolvedOntoIRIString); // protected methods protected: // protected variables protected: QString mOntoIRIString; QString mResolvedIRIOntoLoadString; bool mOntoLoaded; bool mOntoLoadingTried; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYIMPORTDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceIRITriggers.h0000644000175000017500000000403412520551202027720 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEIRITRIGGERS_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEIRITRIGGERS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareTriggers.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceIRITriggers * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceIRITriggers : public CDatatypeValueSpaceCompareTriggers { // public methods public: //! Constructor CDatatypeValueSpaceIRITriggers(CBoxContext* boxContext); CDatatypeValueSpaceIRITriggers* initValueSpaceIRITriggers(CDatatypeValueSpaceIRITriggers* data); CDatatypeValueSpaceConceptTriggeringData* getIRIConceptTriggeringData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEIRITRIGGERS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualVector.h0000644000175000017500000000377412520551206025412 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALVECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALVECTOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CIndividual.h" #include "CBoxContext.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CIndividualVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualVector : public CDefaultDynamicReferenceVectorBase { // public methods public: //! Constructor CIndividualVector(CBoxContext* boxContext = nullptr); //! Destructor virtual ~CIndividualVector(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryHexDataType.h0000644000175000017500000000460712520551200031117 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBINARYHEXDATATYPE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBINARYHEXDATATYPE_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareType.h" #include "CDataLiteralBinaryHexDataValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceBinaryHexDataType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceBinaryHexDataType : public CDatatypeValueSpaceCompareType { // public methods public: //! Constructor CDatatypeValueSpaceBinaryHexDataType(); CDataLiteralBinaryHexDataValue* getMinimumDataLiteralBinaryHexDataValue(); CDataLiteralBinaryHexDataValue* getMaximumDataLiteralBinaryHexDataValue(); virtual CDataLiteralCompareValue* getMinimumDataLiteralCompareValue(); virtual CDataLiteralCompareValue* getMaximumDataLiteralCompareValue(); virtual bool hasInfiniteManyValues(); virtual cint64 getMaximumValueCount(); // protected methods protected: // protected variables protected: CDataLiteralBinaryHexDataValue* mMinValue; CDataLiteralBinaryHexDataValue* mMaxValue; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBINARYHEXDATATYPE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpacesTriggers.h0000644000175000017500000000754312520551202027547 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACESTRIGGERS_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACESTRIGGERS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CBoxContext.h" #include "CDatatypeValueSpaceRealTriggers.h" #include "CDatatypeValueSpaceStringTriggers.h" #include "CDatatypeValueSpaceBooleanTriggers.h" #include "CDatatypeValueSpaceDoubleTriggers.h" #include "CDatatypeValueSpaceFloatTriggers.h" #include "CDatatypeValueSpaceIRITriggers.h" #include "CDatatypeValueSpaceBinaryHexDataTriggers.h" #include "CDatatypeValueSpaceBinaryBase64DataTriggers.h" #include "CDatatypeValueSpaceXMLTriggers.h" #include "CDatatypeValueSpaceDateTimeTriggers.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpacesTriggers * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpacesTriggers { // public methods public: //! Constructor CDatatypeValueSpacesTriggers(CBoxContext* boxContext); CDatatypeValueSpacesTriggers* initValueSpacesTriggers(CDatatypeValueSpacesTriggers* data); CDatatypeValueSpaceTriggers* getValueSpaceTriggers(CDatatypeValueSpaceType* valueSpaceType); CDatatypeValueSpaceRealTriggers* getRealValueSpaceTriggers(); CDatatypeValueSpaceStringTriggers* getStringValueSpaceTriggers(); CDatatypeValueSpaceBooleanTriggers* getBooleanValueSpaceTriggers(); CDatatypeValueSpaceDoubleTriggers* getDoubleValueSpaceTriggers(); CDatatypeValueSpaceFloatTriggers* getFloatValueSpaceTriggers(); CDatatypeValueSpaceIRITriggers* getIRIValueSpaceTriggers(); CDatatypeValueSpaceBinaryHexDataTriggers* getBinaryHexDataValueSpaceTriggers(); CDatatypeValueSpaceBinaryBase64DataTriggers* getBinaryBase64DataValueSpaceTriggers(); CDatatypeValueSpaceXMLTriggers* getXMLValueSpaceTriggers(); CDatatypeValueSpaceDateTimeTriggers* getDateTimeValueSpaceTriggers(); // protected methods protected: // protected variables protected: CBoxContext* mBoxContext; CDatatypeValueSpaceRealTriggers mRealValueSpaceTriggers; CDatatypeValueSpaceStringTriggers mStringValueSpaceTriggers; CDatatypeValueSpaceBooleanTriggers mBooleanValueSpaceTriggers; CDatatypeValueSpaceDoubleTriggers mDoubleValueSpaceTriggers; CDatatypeValueSpaceFloatTriggers mFloatValueSpaceTriggers; CDatatypeValueSpaceIRITriggers mIRIValueSpaceTriggers; CDatatypeValueSpaceBinaryHexDataTriggers mBinaryHexDataValueSpaceTriggers; CDatatypeValueSpaceBinaryBase64DataTriggers mBinaryBase64DataValueSpaceTriggers; CDatatypeValueSpaceXMLTriggers mXMLValueSpaceTriggers; CDatatypeValueSpaceDateTimeTriggers mDateTimeValueSpaceTriggers; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACESTRIGGERS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleVector.h0000644000175000017500000000367212520551214024217 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CROLEVECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CROLEVECTOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CRole.h" #include "CBoxContext.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CRoleVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleVector : public CDefaultDynamicReferenceVectorBase { // public methods public: //! Constructor CRoleVector(CBoxContext* boxContext = nullptr); //! Destructor virtual ~CRoleVector(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CROLEVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRBox.cpp0000644000175000017500000001372412520551214023337 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRBox.h" namespace Konclude { namespace Reasoner { namespace Ontology { CRBox::CRBox(CBoxContext* boxContext) { mBoxContext = boxContext; mMemMan = CContext::getMemoryAllocationManager(mBoxContext); roles = nullptr; mRoleChainVec = nullptr; mDeleteBoxContext = nullptr; mActiveRoleSet = nullptr; mBottomObjectRoleTag = 0; mTopObjectRoleTag = 1; mBottomDataRoleTag = 2; mTopDataRoleTag = 3; } CRBox::~CRBox() { delete mDeleteBoxContext; COPADestroyAndRelease(roles,mMemMan); COPADestroyAndRelease(mRoleChainVec,mMemMan); COPADestroyAndRelease(mActiveRoleSet,mMemMan); } CRBox *CRBox::setRoleVector(CRoleVector* roleVec) { COPADestroyAndRelease(roles,mMemMan); roles = roleVec; return this; } CRoleVector* CRBox::getRoleVector(bool create) { if (!roles && create) { roles = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return roles; } CRBox *CRBox::setRoleChainVector(CRoleChainVector* roleChainVec) { COPADestroyAndRelease(mRoleChainVec,mMemMan); mRoleChainVec = roleChainVec; return this; } CRoleChainVector* CRBox::getRoleChainVector(bool create) { if (!mRoleChainVec && create) { mRoleChainVec = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mRoleChainVec; } qint64 CRBox::getRoleCount() { cint64 roleCount = 0; if (roles) { roleCount = roles->getItemCount(); } return roleCount; } qint64 CRBox::getRoleChainCount() { cint64 roleChainCount = 0; if (mRoleChainVec) { roleChainCount = mRoleChainVec->getItemCount(); } return roleChainCount; } CRBox *CRBox::getRBoxReferenceCopy(CBoxContext *boxContext) { CRBox *rBox = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(boxContext),boxContext); rBox->referenceRBox(this); return rBox; } CRBox *CRBox::referenceRBox(CRBox *rBox) { if (rBox->roles) { getRoleVector(); roles->referenceVector(rBox->roles); } else if (roles) { roles->clear(); } if (rBox->mRoleChainVec) { getRoleChainVector(); mRoleChainVec->referenceVector(rBox->mRoleChainVec); } else if (mRoleChainVec) { mRoleChainVec->clear(); } if (rBox->mActiveRoleSet) { if (!mActiveRoleSet) { mActiveRoleSet = CObjectParameterizingAllocator< CBOXSET,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } mActiveRoleSet->init(rBox->mActiveRoleSet,mBoxContext); } else if (mActiveRoleSet) { mActiveRoleSet->clear(); } return this; } CBoxContext *CRBox::getBoxContext(bool create) { if (!mBoxContext && create) { mBoxContext = new CConcreteOntologyContextBase(); mDeleteBoxContext = mBoxContext; } return mBoxContext; } CRole* CRBox::getTopObjectRole() { CRole* role = nullptr; if (roles) { role = roles->getData(mTopObjectRoleTag); } return role; } CRBox* CRBox::setTopObjectRole(CRole* role) { getRoleVector()->setData(mTopObjectRoleTag,role); return this; } CRole* CRBox::getBottomObjectRole() { CRole* role = nullptr; if (roles) { role = roles->getData(mBottomObjectRoleTag); } return role; } CRBox* CRBox::setBottomObjectRole(CRole* role) { getRoleVector()->setData(mBottomObjectRoleTag,role); return this; } cint64 CRBox::getTopObjectRoleIndex() { return mTopObjectRoleTag; } cint64 CRBox::getBottomObjectRoleIndex() { return mBottomObjectRoleTag; } CRole* CRBox::getTopDataRole() { CRole* role = nullptr; if (roles) { role = roles->getData(mTopDataRoleTag); } return role; } CRBox* CRBox::setTopDataRole(CRole* role) { getRoleVector()->setData(mTopDataRoleTag,role); return this; } CRole* CRBox::getBottomDataRole() { CRole* role = nullptr; if (roles) { role = roles->getData(mBottomDataRoleTag); } return role; } CRBox* CRBox::setBottomDataRole(CRole* role) { getRoleVector()->setData(mBottomDataRoleTag,role); return this; } cint64 CRBox::getTopDataRoleIndex() { return mTopDataRoleTag; } cint64 CRBox::getBottomDataRoleIndex() { return mBottomDataRoleTag; } CBOXSET* CRBox::getActivePropertyRoleSet(bool create) { if (!mActiveRoleSet && create) { mActiveRoleSet = CObjectParameterizingAllocator< CBOXSET,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mActiveRoleSet; } CRBox* CRBox::setActivePropertyRoleSet(CBOXSET* takeActiveRoleSet) { COPADestroyAndRelease(mActiveRoleSet,mMemMan); mActiveRoleSet = takeActiveRoleSet; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringMapData.h0000644000175000017500000000400712520551204031121 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERINGMAPDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERINGMAPDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceTriggeringData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceTriggeringMapData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceTriggeringMapData { // public methods public: //! Constructor CDatatypeValueSpaceTriggeringMapData(); CDatatypeValueSpaceTriggeringMapData(const CDatatypeValueSpaceTriggeringMapData& data); CDatatypeValueSpaceTriggeringData* mLocValue; CDatatypeValueSpaceTriggeringData* mUseValue; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETRIGGERINGMAPDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceBooleanType.cpp0000644000175000017500000000377612520551200030354 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceBooleanType.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceBooleanType::CDatatypeValueSpaceBooleanType() : CDatatypeValueSpaceCompareType(CDatatypeValueSpaceBooleanType::VALUESPACEBOOLEANTYPE) { mMinValue = new CDataLiteralBooleanValue(); mMinValue->initValueFromBoolean(false); mMaxValue = new CDataLiteralBooleanValue(); mMaxValue->initValueFromBoolean(true); } CDataLiteralBooleanValue* CDatatypeValueSpaceBooleanType::getMinimumDataLiteralBooleanValue() { return mMinValue; } CDataLiteralBooleanValue* CDatatypeValueSpaceBooleanType::getMaximumDataLiteralBooleanValue() { return mMaxValue; } CDataLiteralCompareValue* CDatatypeValueSpaceBooleanType::getMinimumDataLiteralCompareValue() { return mMinValue; } CDataLiteralCompareValue* CDatatypeValueSpaceBooleanType::getMaximumDataLiteralCompareValue() { return mMaxValue; } bool CDatatypeValueSpaceBooleanType::hasInfiniteManyValues() { return false; } cint64 CDatatypeValueSpaceBooleanType::getMaximumValueCount() { return 2; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleTagComparer.cpp0000644000175000017500000000175012520551214025507 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleTagComparer.h" namespace Konclude { namespace Reasoner { namespace Ontology { }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceRealType.h0000644000175000017500000000444412520551202027320 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEREALTYPE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEREALTYPE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareType.h" #include "CDataLiteralRealValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceRealType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceRealType : public CDatatypeValueSpaceCompareType { // public methods public: //! Constructor CDatatypeValueSpaceRealType(); CDataLiteralRealValue* getMinimumDataLiteralRealValue(); CDataLiteralRealValue* getMaximumDataLiteralRealValue(); virtual CDataLiteralCompareValue* getMinimumDataLiteralCompareValue(); virtual CDataLiteralCompareValue* getMaximumDataLiteralCompareValue(); virtual bool hasInfiniteManyValues(); virtual cint64 getMaximumValueCount(); // protected methods protected: // protected variables protected: CDataLiteralRealValue* mMinValue; CDataLiteralRealValue* mMaxValue; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEREALTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceStringType.cpp0000644000175000017500000000376312520551204030243 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceStringType.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceStringType::CDatatypeValueSpaceStringType() : CDatatypeValueSpaceCompareType(CDatatypeValueSpaceStringType::VALUESPACESTRINGTYPE) { mMinValue = new CDataLiteralStringValue(); mMinValue->initValueFromLength(0); mMaxValue = new CDataLiteralStringValue(); mMaxValue->initValueFromInfiniteLength(); } CDataLiteralStringValue* CDatatypeValueSpaceStringType::getMinimumDataLiteralStringValue() { return mMinValue; } CDataLiteralStringValue* CDatatypeValueSpaceStringType::getMaximumDataLiteralStringValue() { return mMaxValue; } CDataLiteralCompareValue* CDatatypeValueSpaceStringType::getMinimumDataLiteralCompareValue() { return mMinValue; } CDataLiteralCompareValue* CDatatypeValueSpaceStringType::getMaximumDataLiteralCompareValue() { return mMaxValue; } bool CDatatypeValueSpaceStringType::hasInfiniteManyValues() { return true; } cint64 CDatatypeValueSpaceStringType::getMaximumValueCount() { return CINT64_MAX; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralStringValue.h0000644000175000017500000000616212520551200026475 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATALITERALSTRINGVALUE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATALITERALSTRINGVALUE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDataLiteralValue.h" #include "CDataLiteralCompareValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataLiteralStringValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralStringValue : public CDataLiteralCompareValue { // public methods public: //! Constructor CDataLiteralStringValue(); virtual CDataLiteralCompareValue* initValue(CDataLiteralCompareValue* value); CDataLiteralStringValue* initValueFromInfiniteLength(); CDataLiteralStringValue* initValueFromLength(cuint64 length); CDataLiteralStringValue* initValueFromString(const QString& string, const QString& langString); CDataLiteralStringValue* initValue(CDataLiteralStringValue* value); CDataLiteralStringValue* clearValue(); virtual DATA_LITERAL_VALUE_TYPE getDataValueType(); bool isInfiniteLength(); bool hasLanguageTag(); cuint64 getLength(); QString getStringValue(); bool isEqualTo(CDataLiteralValue* value); bool isLessEqualThan(CDataLiteralCompareValue* value); bool isLessThan(CDataLiteralCompareValue* value); bool isEqualTo(CDataLiteralCompareValue* value); bool isGreaterEqualThan(CDataLiteralCompareValue* value); bool isGreaterThan(CDataLiteralCompareValue* value); bool isLessEqualThan(CDataLiteralStringValue* value); bool isLessThan(CDataLiteralStringValue* value); bool isEqualTo(CDataLiteralStringValue* value); bool isGreaterEqualThan(CDataLiteralStringValue* value); bool isGreaterThan(CDataLiteralStringValue* value); // protected methods protected: // protected variables protected: bool mInfiniteLength; cuint64 mLength; QString mString; QString mLanguage; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATALITERALSTRINGVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CABox.cpp0000644000175000017500000000737612520551172023327 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CABox.h" namespace Konclude { namespace Reasoner { namespace Ontology { CABox::CABox(CBoxContext* boxContext) { mBoxContext = boxContext; mMemMan = CContext::getMemoryAllocationManager(mBoxContext); mIndiVec = nullptr; mDeleteBoxContext = nullptr; mActiveIndividualSet = nullptr; mUnivConnIndiID = 0; mHasUnivConnIndiID = false; } CABox::~CABox() { delete mDeleteBoxContext; COPADestroyAndRelease(mIndiVec,mMemMan); } CABox *CABox::setIndividualVector(CIndividualVector* roleVec) { COPADestroyAndRelease(mIndiVec,mMemMan); mIndiVec = roleVec; return this; } CIndividualVector* CABox::getIndividualVector(bool create) { if (!mIndiVec && create) { mIndiVec = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mIndiVec; } qint64 CABox::getIndividualCount() { cint64 indiCount = 0; if (mIndiVec) { indiCount = mIndiVec->getItemCount(); } return indiCount; } CABox *CABox::getABoxReferenceCopy(CBoxContext *boxContext) { CABox *aBox = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(boxContext),boxContext); aBox->referenceABox(this); return aBox; } CABox *CABox::referenceABox(CABox *aBox) { mHasUnivConnIndiID = aBox->mHasUnivConnIndiID; mUnivConnIndiID = aBox->mUnivConnIndiID; if (aBox->mIndiVec) { getIndividualVector(); mIndiVec->referenceVector(aBox->mIndiVec); } else if (mIndiVec) { mIndiVec->clear(); } return this; } CBoxContext *CABox::getBoxContext(bool create) { if (!mBoxContext && create) { mBoxContext = new CConcreteOntologyContextBase(); mDeleteBoxContext = mBoxContext; } return mBoxContext; } cint64 CABox::getUniversalConnectionIndividualID() { return mUnivConnIndiID; } CABox* CABox::setUniversalConnectionIndividualID(cint64 univConnIndiID) { mUnivConnIndiID = univConnIndiID; return this; } bool CABox::hasUniversalConnectionIndividual() { return mHasUnivConnIndiID; } CABox* CABox::setHasUniversalConnectionIndividual(bool hasUnivConnIndi) { mHasUnivConnIndiID = hasUnivConnIndi; return this; } CBOXSET* CABox::getActiveIndividualSet(bool create) { if (!mActiveIndividualSet && create) { mActiveIndividualSet = CObjectParameterizingAllocator< CBOXSET ,CBoxContext*>::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mActiveIndividualSet; } CABox* CABox::setActiveIndividualSet(CBOXSET* takeActiveIndividualSet) { mActiveIndividualSet = takeActiveIndividualSet; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStatistics.cpp0000644000175000017500000000353512520551212030404 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyProcessingStatistics.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyProcessingStatistics::COntologyProcessingStatistics() { } QHash* COntologyProcessingStatistics::getProcessingCountStatisticsHash() { return &mProcessingCountStatisticsHash; } cint64 COntologyProcessingStatistics::getProcessingCountStatisticValue(const QString& statisticName) { return mProcessingCountStatisticsHash.value(statisticName); } COntologyProcessingStatistics* COntologyProcessingStatistics::setProcessingCountStatisticValue(const QString& statisticName, cint64 statisticValue) { mProcessingCountStatisticsHash[statisticName] = statisticValue; return this; } COntologyProcessingStatistics* COntologyProcessingStatistics::incProcessingCountStatisticValue(const QString& statisticName, cint64 incValue) { mProcessingCountStatisticsHash[statisticName] += incValue; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralXMLValue.cpp0000644000175000017500000001264112520551200026221 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralXMLValue.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDataLiteralXMLValue::CDataLiteralXMLValue() { clearValue(); } CDataLiteralValue::DATA_LITERAL_VALUE_TYPE CDataLiteralXMLValue::getDataValueType() { return CDataLiteralValue::DLVT_XML; } CDataLiteralCompareValue* CDataLiteralXMLValue::initValue(CDataLiteralCompareValue* value) { clearValue(); CDataLiteralXMLValue* xmlValue = dynamic_cast(value); if (xmlValue) { mInfiniteLength = xmlValue->mInfiniteLength; mLength = xmlValue->mLength; mXMLString = xmlValue->mXMLString; } return this; } CDataLiteralXMLValue* CDataLiteralXMLValue::initValueFromInfiniteLength() { clearValue(); mInfiniteLength = true; return this; } CDataLiteralXMLValue* CDataLiteralXMLValue::initValueFromLength(cuint64 length) { clearValue(); mLength = length; return this; } CDataLiteralXMLValue* CDataLiteralXMLValue::initValueFromXMLString(const QString& xmlString) { clearValue(); mXMLString = xmlString; return this; } CDataLiteralXMLValue* CDataLiteralXMLValue::initValue(CDataLiteralXMLValue* value) { if (value) { mInfiniteLength = value->mInfiniteLength; mLength = value->mLength; mXMLString = value->mXMLString; } return this; } CDataLiteralXMLValue* CDataLiteralXMLValue::clearValue() { mInfiniteLength = false; mLength = 0; mXMLString.clear(); return this; } bool CDataLiteralXMLValue::isInfiniteLength() { return mInfiniteLength; } cuint64 CDataLiteralXMLValue::getLength() { if (mLength > 0) { return mLength; } else { return mXMLString.length(); } } QString CDataLiteralXMLValue::getXMLValue() { return mXMLString; } bool CDataLiteralXMLValue::isEqualTo(CDataLiteralValue* value) { CDataLiteralXMLValue* xmlValue = dynamic_cast(value); if (xmlValue) { return isEqualTo(xmlValue); } return false; } bool CDataLiteralXMLValue::isLessEqualThan(CDataLiteralCompareValue* value) { CDataLiteralXMLValue* xmlValue = dynamic_cast(value); if (xmlValue) { return isEqualTo(xmlValue) || isLessThan(xmlValue); } return false; } bool CDataLiteralXMLValue::isLessEqualThan(CDataLiteralXMLValue* xmlValue) { return isEqualTo(xmlValue) || isLessThan(xmlValue); } bool CDataLiteralXMLValue::isEqualTo(CDataLiteralCompareValue* value) { CDataLiteralXMLValue* xmlValue = dynamic_cast(value); if (xmlValue) { return isEqualTo(xmlValue); } return false; } bool CDataLiteralXMLValue::isEqualTo(CDataLiteralXMLValue* xmlValue) { if (mInfiniteLength && xmlValue->mInfiniteLength) { return true; } if (mInfiniteLength || xmlValue->mInfiniteLength) { return false; } if (mLength > 0 && mLength == xmlValue->mLength) { return true; } if (mXMLString == xmlValue->mXMLString) { return true; } return false; } bool CDataLiteralXMLValue::isGreaterEqualThan(CDataLiteralXMLValue* xmlValue) { return isEqualTo(xmlValue) || isGreaterThan(xmlValue); } bool CDataLiteralXMLValue::isGreaterEqualThan(CDataLiteralCompareValue* value) { CDataLiteralXMLValue* xmlValue = dynamic_cast(value); if (xmlValue) { return isEqualTo(xmlValue) || isGreaterThan(xmlValue); } return false; } bool CDataLiteralXMLValue::isGreaterThan(CDataLiteralCompareValue* value) { return value->isLessThan(this); } bool CDataLiteralXMLValue::isGreaterThan(CDataLiteralXMLValue* xmlValue) { return xmlValue->isLessThan(this); } bool CDataLiteralXMLValue::isLessThan(CDataLiteralCompareValue* value) { CDataLiteralXMLValue* xmlValue = dynamic_cast(value); if (xmlValue) { return isLessThan(xmlValue); } return false; } bool CDataLiteralXMLValue::isLessThan(CDataLiteralXMLValue* xmlValue) { if (!mInfiniteLength && xmlValue->mInfiniteLength) { return true; } if (mInfiniteLength) { return false; } if (getLength() < xmlValue->getLength()) { return true; } else if (getLength() > xmlValue->getLength()) { return false; } else { int stringComp = mXMLString.compare(xmlValue->mXMLString); if (stringComp < 0) { return true; } else if (stringComp > 0) { return false; } } return false; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteral.cpp0000644000175000017500000000333012520551176024652 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteral.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDataLiteral::CDataLiteral() { mDatatype = nullptr; mDataValue = nullptr; } CDataLiteral* CDataLiteral::initDataLiteral(const QString& lexicalDataLiteralValueString, CDatatype* datatype) { mLexicalDataLiteralValueString = lexicalDataLiteralValueString; mDatatype = datatype; mDataValue = nullptr; return this; } QString CDataLiteral::getLexicalDataLiteralValueString() { return mLexicalDataLiteralValueString; } CDatatype* CDataLiteral::getDatatype() { return mDatatype; } CDataLiteralValue* CDataLiteral::getDataLiteralValue() { return mDataValue; } CDataLiteral* CDataLiteral::setDataLiteralValue(CDataLiteralValue* dataValue) { mDataValue = dataValue; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralValue.cpp0000644000175000017500000000214312520551200025634 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralValue.h" namespace Konclude { namespace Reasoner { namespace Ontology { QString CDataLiteralValue::getValueString() { return QString(); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptDependence.h0000644000175000017500000000600112520551174025473 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDEPENDENCE_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDEPENDENCE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CConcept.h" // Other includes #include "Utilities/CSortedNegLinker.hpp" #include "Utilities/CAllocationObject.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CConceptDependence * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptDependence : public CAllocationObject { // public methods public: //! Constructor CConceptDependence(); //! Destructor virtual ~CConceptDependence(); CConceptDependence *init(CConcept *concept); CConceptDependence *init(qint64 conTag, CConceptDependence *conceptDep, CMemoryManager > *linkerMemMan); qint64 getConceptDependenceTag(); CConceptDependence *getConceptDependenceTag(qint64 tag); CConceptDependence *setConceptDependenceList(CSortedNegLinker *conceptList); CConceptDependence *addConceptDependenceLinker(CSortedNegLinker *conceptLinker); CSortedNegLinker *getConceptDependenceList(); CConceptDependence *setRoleDependenceList(CSortedNegLinker *roleList); CConceptDependence *addRoleDependenceLinker(CSortedNegLinker *roleLinker); CSortedNegLinker *getRoleDependenceList(); CConceptDependence *setIndividualDependenceList(CSortedNegLinker *indiList); CConceptDependence *addIndividualDependenceLinker(CSortedNegLinker *indiLinker); CSortedNegLinker *getIndividualDependenceList(); // protected methods protected: // private methods private: // private variables private: qint64 conceptDepTag; CSortedNegLinker *conceptDepsLinker; CSortedNegLinker *roleDepsLinker; CSortedNegLinker *indiDepsLinker; }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDEPENDENCE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CActiveEntityIterator.h0000644000175000017500000000372212520551172026254 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CACTIVEENTITYITERATOR_H #define KONCLUDE_REASONER_ONTOLOGY_CACTIVEENTITYITERATOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CActiveEntityCountItem.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CActiveEntityIterator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CActiveEntityIterator { // public methods public: //! Constructor CActiveEntityIterator(CActiveEntityCountItem* countVector, cint64 vecSize); bool hasNextActiveEntity(); CExpressionEntity* getNextActiveEntity(bool moveNext = true); // protected methods protected: // protected variables protected: CActiveEntityCountItem* mCountVector; cint64 mVectorSize; cint64 mCurrIndex; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CACTIVEENTITYITERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptDependenceVector.h0000644000175000017500000000411112520551174026656 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDEPENDENCEVECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDEPENDENCEVECTOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CConceptDependence.h" #include "CBoxContext.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CConceptDependenceVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptDependenceVector : public CDefaultDynamicReferenceVectorBase { // public methods public: //! Constructor CConceptDependenceVector(CBoxContext* boxContext = nullptr); //! Destructor virtual ~CConceptDependenceVector(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDEPENDENCEVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CName.h0000644000175000017500000000365412520551206023014 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CNAME_H #define KONCLUDE_REASONER_ONTOLOGY_CNAME_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CNamePrefix.h" // Other includes #include "Utilities/CLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CName * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CName { // public methods public: //! Constructor CName(); //! Destructor virtual ~CName(); virtual qint64 getNameVersionID(); virtual CName *setNameVersionID(qint64 versionID); static qint64 getLastNameVersionID(CLinker *nameLinker); // protected methods protected: // protected variables protected: qint64 nameVersion; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CNAME_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringMapArranger.cpp0000644000175000017500000000312212520551204032341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceTriggeringMapArranger.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceTriggeringMapArranger::CDatatypeValueSpaceTriggeringMapArranger(CDataLiteralCompareValue* compareableValue) { mCompareableValue = compareableValue; } bool CDatatypeValueSpaceTriggeringMapArranger::operator<(const CDatatypeValueSpaceTriggeringMapArranger& valueData) const { return mCompareableValue->isLessThan(valueData.mCompareableValue); } bool CDatatypeValueSpaceTriggeringMapArranger::operator<=(const CDatatypeValueSpaceTriggeringMapArranger& valueData) const { return mCompareableValue->isLessEqualThan(valueData.mCompareableValue); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceXMLTriggers.cpp0000644000175000017500000000277112520551204030300 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceXMLTriggers.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceXMLTriggers::CDatatypeValueSpaceXMLTriggers(CBoxContext* boxContext) : CDatatypeValueSpaceCompareTriggers(boxContext) { } CDatatypeValueSpaceXMLTriggers* CDatatypeValueSpaceXMLTriggers::initValueSpaceXMLTriggers(CDatatypeValueSpaceXMLTriggers* data) { initValueSpaceCompareTriggers(data); return this; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceXMLTriggers::getXMLConceptTriggeringData() { return getValueSpaceConceptTriggeringData(); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleData.h0000644000175000017500000000312312520551214023615 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CROLEDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CROLEDATA_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CRoleData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleData { // public methods public: //! Constructor CRoleData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CROLEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CCachingTags.cpp0000644000175000017500000000374712520551174024651 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCachingTags.h" namespace Konclude { namespace Reasoner { namespace Ontology { CCachingTags::CCachingTags() { mLastCachingTag = 0; mMinCachedTag = CINT64_MAX; mMaxCachedTag = CINT64_MIN; } cint64 CCachingTags::getLastCachingTag() { return mLastCachingTag; } cint64 CCachingTags::getMaxCachedTag() { return mMaxCachedTag; } cint64 CCachingTags::getMinCachedTag() { return mMinCachedTag; } CCachingTags* CCachingTags::setLastCachingTag(cint64 tag) { mLastCachingTag = tag; return this; } CCachingTags* CCachingTags::setMaxCachedTag(cint64 tag) { mMaxCachedTag = tag; return this; } CCachingTags* CCachingTags::setMinCachedTag(cint64 tag) { mMinCachedTag = tag; return this; } bool CCachingTags::setMaxCachedTagCandidate(cint64 tag) { if (tag > mMaxCachedTag) { mMaxCachedTag = tag; return true; } return false; } bool CCachingTags::setMinCachedTagCandidate(cint64 tag) { if (tag < mMinCachedTag) { mMinCachedTag = tag; return true; } return false; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptOperator.h0000644000175000017500000002264712520551174025252 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTOPERATOR_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTOPERATOR_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CConceptOperator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptOperator { // public methods public: cint64 getOperatorCode(); static CConceptOperator* getConceptOperator(cint64 opCode); static void generateConceptOperators(); const static cint64 CCF_NONE = Q_UINT64_C(0x0000000000000001); const static cint64 CCF_ATOM = Q_UINT64_C(0x0000000000000001); const static cint64 CCF_TOP = Q_UINT64_C(0x0000000000000002); const static cint64 CCF_BOTTOM = Q_UINT64_C(0x0000000000000004); const static cint64 CCF_NOT = Q_UINT64_C(0x0000000000000008); const static cint64 CCF_AND = Q_UINT64_C(0x0000000000000010); const static cint64 CCF_OR = Q_UINT64_C(0x0000000000000020); const static cint64 CCF_ATMOST = Q_UINT64_C(0x0000000000000040); const static cint64 CCF_ATLEAST = Q_UINT64_C(0x0000000000000080); const static cint64 CCF_ALL = Q_UINT64_C(0x0000000000000100); const static cint64 CCF_SOME = Q_UINT64_C(0x0000000000000200); const static cint64 CCF_EQ = Q_UINT64_C(0x0000000000000400); const static cint64 CCF_SUB = Q_UINT64_C(0x0000000000000800); const static cint64 CCF_NOMINAL = Q_UINT64_C(0x0000000000001000); const static cint64 CCF_SELF = Q_UINT64_C(0x0000000000002000); const static cint64 CCF_AQCHOOCE = Q_UINT64_C(0x0000000000004000); const static cint64 CCF_AQALL = Q_UINT64_C(0x0000000000008000); const static cint64 CCF_AQSOME = Q_UINT64_C(0x0000000000010000); const static cint64 CCF_AQAND = Q_UINT64_C(0x0000000000020000); const static cint64 CCF_VALUE = Q_UINT64_C(0x0000000000040000); const static cint64 CCF_NOMVAR = Q_UINT64_C(0x0000000000080000); const static cint64 CCF_NOMTEMPLREF = Q_UINT64_C(0x0000000000100000); const static cint64 CCF_IMPL = Q_UINT64_C(0x0000000000200000); const static cint64 CCF_IMPLTRIG = Q_UINT64_C(0x0000000000400000); const static cint64 CCF_IMPLALL = Q_UINT64_C(0x0000000000800000); const static cint64 CCF_IMPLAQALL = Q_UINT64_C(0x0000000001000000); const static cint64 CCF_IMPLAQAND = Q_UINT64_C(0x0000000002000000); const static cint64 CCF_BRANCHIMPL = Q_UINT64_C(0x0000000004000000); const static cint64 CCF_BRANCHTRIG = Q_UINT64_C(0x0000000008000000); const static cint64 CCF_BRANCHALL = Q_UINT64_C(0x0000000010000000); const static cint64 CCF_BRANCHAQALL = Q_UINT64_C(0x0000000020000000); const static cint64 CCF_BRANCHAQAND = Q_UINT64_C(0x0000000040000000); const static cint64 CCF_EQCAND = Q_UINT64_C(0x0000000080000000); const static cint64 CCF_PBINDTRIG = Q_UINT64_C(0x0000000100000000); const static cint64 CCF_PBINDIMPL = Q_UINT64_C(0x0000000200000000); const static cint64 CCF_PBINDGROUND = Q_UINT64_C(0x0000000400000000); const static cint64 CCF_PBINDALL = Q_UINT64_C(0x0000000800000000); const static cint64 CCF_PBINDAND = Q_UINT64_C(0x0000001000000000); const static cint64 CCF_PBINDAQAND = Q_UINT64_C(0x0000002000000000); const static cint64 CCF_PBINDAQALL = Q_UINT64_C(0x0000004000000000); const static cint64 CCF_PBINDVARIABLE = Q_UINT64_C(0x0000008000000000); const static cint64 CCF_PBINDCYCLE = Q_UINT64_C(0x0000010000000000); const static cint64 CCF_VARBINDTRIG = Q_UINT64_C(0x0000020000000000); const static cint64 CCF_VARBINDJOIN = Q_UINT64_C(0x0000040000000000); const static cint64 CCF_VARBINDGROUND = Q_UINT64_C(0x0000080000000000); const static cint64 CCF_VARBINDALL = Q_UINT64_C(0x0000100000000000); const static cint64 CCF_VARBINDAND = Q_UINT64_C(0x0000200000000000); const static cint64 CCF_VARBINDAQAND = Q_UINT64_C(0x0000400000000000); const static cint64 CCF_VARBINDAQALL = Q_UINT64_C(0x0000800000000000); const static cint64 CCF_VARBINDVARIABLE = Q_UINT64_C(0x0001000000000000); const static cint64 CCF_VARBINDIMPL = Q_UINT64_C(0x0002000000000000); const static cint64 CCF_VARPBACKTRIG = Q_UINT64_C(0x0004000000000000); const static cint64 CCF_VARPBACKALL = Q_UINT64_C(0x0008000000000000); const static cint64 CCF_VARPBACKAQAND = Q_UINT64_C(0x0010000000000000); const static cint64 CCF_VARPBACKAQALL = Q_UINT64_C(0x0020000000000000); const static cint64 CCF_BACKACTIVTRIG = Q_UINT64_C(0x0040000000000000); const static cint64 CCF_BACKACTIVIMPL = Q_UINT64_C(0x0080000000000000); const static cint64 CCF_DATATYPE = Q_UINT64_C(0x0100000000000000); const static cint64 CCF_DATALITERAL = Q_UINT64_C(0x0200000000000000); const static cint64 CCF_DATARESTRICTION = Q_UINT64_C(0x0400000000000000); const static cint64 CCF_MARKER = Q_UINT64_C(0x0800000000000000); bool hasPartialOperatorCodeFlag(cint64 operatorCodeFlag); bool hasAllOperatorCodeFlags(cint64 operatorCodeFlags); const static cint64 CCFS_AND_TYPE = CCF_AND | CCF_PBINDAND | CCF_VARBINDAND | CCF_TOP; const static cint64 CCFS_TRIG_TYPE = CCF_IMPLTRIG | CCF_BRANCHTRIG | CCF_PBINDTRIG | CCF_VARBINDTRIG | CCF_VARPBACKTRIG; const static cint64 CCFS_ALL_TYPE = CCF_VARPBACKALL | CCF_VARBINDALL | CCF_PBINDALL | CCF_BRANCHALL | CCF_IMPLALL | CCF_ALL; const static cint64 CCFS_AQAND_TYPE = CCF_AQAND | CCF_IMPLAQAND | CCF_BRANCHAQAND | CCF_PBINDAQAND | CCF_VARBINDAQAND | CCF_VARPBACKAQAND; const static cint64 CCFS_AQALL_TYPE = CCF_AQALL | CCF_IMPLAQALL | CCF_BRANCHAQALL | CCF_PBINDAQALL | CCF_VARBINDAQALL | CCF_VARPBACKAQALL; const static cint64 CCFS_AQ_TYPE = CCFS_AQAND_TYPE | CCFS_AQALL_TYPE; const static cint64 CCFS_ALL_AQALL_TYPE = CCFS_ALL_TYPE | CCFS_AQALL_TYPE; const static cint64 CCFS_TRIG_AND_AQAND_TYPE = CCFS_AND_TYPE | CCFS_TRIG_TYPE | CCFS_AQAND_TYPE; const static cint64 CCFS_AND_AQAND_TYPE = CCFS_AND_TYPE | CCFS_AQAND_TYPE; const static cint64 CCFS_AQAND_AQALL_TYPE = CCFS_AQAND_TYPE | CCFS_AQALL_TYPE; const static cint64 CCFS_SOME_TYPE = CCF_SOME | CCF_AQSOME; const static cint64 CCFS_IMPL_TYPE = CCF_VARBINDIMPL | CCF_PBINDIMPL | CCF_BRANCHIMPL | CCF_IMPL | CCF_BACKACTIVIMPL; const static cint64 CCFS_PROPAGATION_BIND_TYPE = CCF_PBINDTRIG | CCF_PBINDIMPL | CCF_PBINDGROUND | CCF_PBINDALL | CCF_PBINDAND | CCF_PBINDAQAND | CCF_PBINDAQALL | CCF_PBINDVARIABLE | CCF_PBINDCYCLE; const static cint64 CCFS_VARIABLE_BIND_TYPE = CCF_VARBINDTRIG | CCF_VARBINDJOIN | CCF_VARBINDGROUND | CCF_VARBINDALL | CCF_VARBINDAND | CCF_VARBINDAQAND | CCF_VARBINDAQALL | CCF_VARBINDVARIABLE | CCF_VARBINDIMPL; const static cint64 CCFS_BACK_PROPAGATION_TYPE = CCF_VARPBACKTRIG | CCF_VARPBACKALL | CCF_VARPBACKAQAND | CCF_VARPBACKAQALL | CCF_BACKACTIVTRIG | CCF_BACKACTIVIMPL; const static cint64 CCFS_PROPAGATION_TYPE = CCFS_PROPAGATION_BIND_TYPE | CCFS_VARIABLE_BIND_TYPE | CCFS_BACK_PROPAGATION_TYPE; const static cint64 CCFS_PROPAGATION_ALL_TYPE = CCF_PBINDALL | CCF_VARBINDALL | CCF_VARPBACKALL | CCF_PBINDAQALL | CCF_VARBINDAQALL | CCF_VARPBACKAQALL; const static cint64 CCFS_PROPAGATION_AND_TYPE = CCF_PBINDTRIG | CCF_VARBINDTRIG | CCF_VARPBACKTRIG | CCF_PBINDAND | CCF_VARBINDAND | CCF_PBINDAQAND | CCF_VARBINDAQAND | CCF_BACKACTIVTRIG; const static cint64 CCFS_POSSIBLE_ROLE_CREATION_TYPE = CCF_SOME | CCF_AQSOME | CCF_ALL | CCF_ATLEAST | CCF_ATMOST; const static cint64 CCFS_ABSORPTION_RELEVANT_TYPE = CCFS_TRIG_TYPE | CCFS_IMPL_TYPE | CCF_IMPLAQALL | CCF_BRANCHAQALL | CCF_PBINDAQALL | CCF_VARBINDAQALL | CCF_VARPBACKAQALL | CCF_IMPLAQAND | CCF_BRANCHAQAND | CCF_PBINDAQAND | CCF_VARBINDAQAND | CCF_VARPBACKAQAND; const static cint64 CCFS_DATATYPE_RELATED_TYPE = CCF_DATATYPE | CCF_DATALITERAL | CCF_DATARESTRICTION; // protected methods protected: //! Constructor CConceptOperator(cint64 opCode); // protected variables protected: cint64 mOperatorCode; cint64 mTypeFlag; static CConceptOperator** mConceptOperatorVector; static QMutex* mCreateLockMutex; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTOPERATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleDependenceVector.cpp0000644000175000017500000000236212520551214026520 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleDependenceVector.h" namespace Konclude { namespace Reasoner { namespace Ontology { CRoleDependenceVector::CRoleDependenceVector(CBoxContext* boxContext) : CDefaultDynamicReferenceVectorBase(boxContext) { } CRoleDependenceVector::~CRoleDependenceVector() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceDoubleType.cpp0000644000175000017500000000377212520551202030205 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceDoubleType.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceDoubleType::CDatatypeValueSpaceDoubleType() : CDatatypeValueSpaceCompareType(CDatatypeValueSpaceDoubleType::VALUESPACEDOUBLETYPE) { mMinValue = new CDataLiteralDoubleValue(); mMinValue->initValueFromInfinite(true); mMaxValue = new CDataLiteralDoubleValue(); mMaxValue->initValueFromInfinite(false); } CDataLiteralDoubleValue* CDatatypeValueSpaceDoubleType::getMinimumDataLiteralDoubleValue() { return mMinValue; } CDataLiteralDoubleValue* CDatatypeValueSpaceDoubleType::getMaximumDataLiteralDoubleValue() { return mMaxValue; } CDataLiteralCompareValue* CDatatypeValueSpaceDoubleType::getMinimumDataLiteralCompareValue() { return mMinValue; } CDataLiteralCompareValue* CDatatypeValueSpaceDoubleType::getMaximumDataLiteralCompareValue() { return mMaxValue; } bool CDatatypeValueSpaceDoubleType::hasInfiniteManyValues() { return false; } cint64 CDatatypeValueSpaceDoubleType::getMaximumValueCount() { return CINT64_MAX-2; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceFloatTriggers.cpp0000644000175000017500000000301312520551202030671 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceFloatTriggers.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceFloatTriggers::CDatatypeValueSpaceFloatTriggers(CBoxContext* boxContext) : CDatatypeValueSpaceCompareTriggers(boxContext) { } CDatatypeValueSpaceFloatTriggers* CDatatypeValueSpaceFloatTriggers::initValueSpaceFloatTriggers(CDatatypeValueSpaceFloatTriggers* data) { initValueSpaceCompareTriggers(data); return this; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceFloatTriggers::getFloatConceptTriggeringData() { return getValueSpaceConceptTriggeringData(); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CUnsatisfiableCachingTags.h0000644000175000017500000000464112520551216027017 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CUNSATISFIABLECACHINGTAGS_H #define KONCLUDE_REASONER_ONTOLOGY_CUNSATISFIABLECACHINGTAGS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CCachingTags.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CUnsatisfiableCachingTags * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CUnsatisfiableCachingTags : public CCachingTags { // public methods public: //! Constructor CUnsatisfiableCachingTags(); cint64 getMinUnsatisfiableCachedSize(); CCachingTags* setMinUnsatisfiableCachedSize(cint64 size); bool setMinUnsatisfiableCachedSizeCandidate(cint64 size); bool updateCachingTags(cint64 cachedTagCandidate, cint64 cachingNumberTag, cint64 sizeCandidate); bool candidateTags(cint64& minMaxCachedTag, cint64& maxMinCachedTag, cint64& minUnsatCachedSize, cint64 requiredLastCachingTag); bool hasCandidateTags(cint64 minMaxCachedTag, cint64 maxMinCachedTag, cint64 requiredLastCachingTag); bool candidateMinUnsatisfiableSize(cint64& minUnsatCachedSize, cint64 cachedTag); // protected methods protected: // protected variables protected: cint64 mMinUnsatCachedSize; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CUNSATISFIABLECACHINGTAGS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CImplicationReplacementVector.cpp0000644000175000017500000000245312520551206030276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CImplicationReplacementVector.h" namespace Konclude { namespace Reasoner { namespace Ontology { CImplicationReplacementVector::CImplicationReplacementVector(CBoxContext* boxContext) : CDefaultDynamicReferenceVectorBase(boxContext) { } CImplicationReplacementVector::~CImplicationReplacementVector() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceConceptTriggeringData.cpp0000644000175000017500000000445112520551202032333 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceConceptTriggeringData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceConceptTriggeringData::CDatatypeValueSpaceConceptTriggeringData() { mPartialTriggerLinker = nullptr; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceConceptTriggeringData::initConceptTriggeringData(CDatatypeValueSpaceConceptTriggeringData* data) { if (data) { mPartialTriggerLinker = data->mPartialTriggerLinker; } else { mPartialTriggerLinker = nullptr; } return this; } bool CDatatypeValueSpaceConceptTriggeringData::hasPartialConceptTriggers() { return mPartialTriggerLinker != nullptr; } CDatatypeValueSpaceConceptTriggerLinker* CDatatypeValueSpaceConceptTriggeringData::getPartialConceptTriggerLinker() { return mPartialTriggerLinker; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceConceptTriggeringData::setPartialConceptTriggerLinker(CDatatypeValueSpaceConceptTriggerLinker* conceptTiggerLinker) { mPartialTriggerLinker = conceptTiggerLinker; return this; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceConceptTriggeringData::appendPartialConceptTriggers(CDatatypeValueSpaceConceptTriggerLinker* conceptTiggerLinker) { if (conceptTiggerLinker) { mPartialTriggerLinker = conceptTiggerLinker->append(mPartialTriggerLinker); } return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStepVector.h0000644000175000017500000000472212520551212030014 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPVECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPVECTOR_H // Libraries includes #include #include // Namespace includes #include "OntologySettings.h" #include "COntologyProcessingStepData.h" #include "COntologyProcessingStep.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyProcessingStepVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyProcessingStepVector { // public methods public: //! Constructor COntologyProcessingStepVector(); COntologyProcessingStep* getProcessingStep(cint64 stepID); COntologyProcessingStep* getProcessingStep(COntologyProcessingStep::PROCESSINGSTEPTYPE stepType); cint64 getProcessingStepCount(); COntologyProcessingStepVector* initDefaultProcessingSteps(); COntologyProcessingStepVector* addProcessingSteps(COntologyProcessingStep* proStepData); static COntologyProcessingStepVector* getProcessingStepVectorInstance(); // protected methods protected: // protected variables protected: QVector mPrStepVector; cint64 mPrStCount; static COntologyProcessingStepVector* mProcStepVectorInstance; static QMutex* mInstanceMutex; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceFloatType.cpp0000644000175000017500000000374712520551202030042 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceFloatType.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceFloatType::CDatatypeValueSpaceFloatType() : CDatatypeValueSpaceCompareType(CDatatypeValueSpaceFloatType::VALUESPACEFLOATTYPE) { mMinValue = new CDataLiteralFloatValue(); mMinValue->initValueFromInfinite(true); mMaxValue = new CDataLiteralFloatValue(); mMaxValue->initValueFromInfinite(false); } CDataLiteralFloatValue* CDatatypeValueSpaceFloatType::getMinimumDataLiteralFloatValue() { return mMinValue; } CDataLiteralFloatValue* CDatatypeValueSpaceFloatType::getMaximumDataLiteralFloatValue() { return mMaxValue; } CDataLiteralCompareValue* CDatatypeValueSpaceFloatType::getMinimumDataLiteralCompareValue() { return mMinValue; } CDataLiteralCompareValue* CDatatypeValueSpaceFloatType::getMaximumDataLiteralCompareValue() { return mMaxValue; } bool CDatatypeValueSpaceFloatType::hasInfiniteManyValues() { return false; } cint64 CDatatypeValueSpaceFloatType::getMaximumValueCount() { return CINT_MAX-2; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleAssertionLinker.cpp0000644000175000017500000000262712520551214026423 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleAssertionLinker.h" namespace Konclude { namespace Reasoner { namespace Ontology { CRoleAssertionLinker::CRoleAssertionLinker() { mIndividual = nullptr; } CRoleAssertionLinker* CRoleAssertionLinker::initRoleAssertionLinker(CRole* role, CIndividual* individual) { setData(role); mIndividual = individual; return this; } CIndividual* CRoleAssertionLinker::getIndividual() { return mIndividual; } CRole* CRoleAssertionLinker::getRole() { return getData(); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CProcessReference.cpp0000644000175000017500000000203512520551212025711 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessReference.h" namespace Konclude { namespace Reasoner { namespace Ontology { CProcessReference::CProcessReference() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConcept.cpp0000644000175000017500000002664212520551174024070 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcept.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConcept::CConcept() { initConcept(); } CConcept* CConcept::initConcept() { mTag = 0; mOperatorCode = CConceptOperator::getConceptOperator(CCNONE); operandCount = 0; operands = 0; opParameter = 0; operatorRole = 0; tax = 0; mNameLinker = 0; mNominalIndiviual = nullptr; mConceptData = nullptr; mVariableLinker = nullptr; mMappingNegated = false; mDataLiteral = nullptr; mDatatype = nullptr; return this; } CConcept *CConcept::init(CConcept *concept) { mNameLinker = concept->getClassNameLinker(); mTag = concept->mTag; mOperatorCode = concept->mOperatorCode; operandCount = concept->operandCount; operands = 0; opParameter = concept->opParameter; operatorRole = concept->operatorRole; tax = 0; mNominalIndiviual = concept->mNominalIndiviual; mVariableLinker = concept->mVariableLinker; mMappingNegated = concept->mMappingNegated; mConceptData = nullptr; mDataLiteral = concept->mDataLiteral; mDatatype = concept->mDatatype; return this; } CConcept *CConcept::init(qint64 conTag) { initTag(conTag); mTag = conTag; mOperatorCode = CConceptOperator::getConceptOperator(CCNONE); operandCount = 0; operands = 0; opParameter = 0; operatorRole = 0; tax = 0; mNominalIndiviual = nullptr; mConceptData = nullptr; mVariableLinker = nullptr; mMappingNegated = false; mDataLiteral = nullptr; mDatatype = nullptr; return this; } CConcept *CConcept::initConceptCopy(CConcept *concept, CMemoryAllocationManager* memMan) { mNameLinker = concept->getClassNameLinker(); mTag = concept->mTag; mOperatorCode = concept->mOperatorCode; operandCount = concept->operandCount; opParameter = concept->opParameter; operatorRole = concept->operatorRole; tax = 0; operands = 0; mNominalIndiviual = concept->mNominalIndiviual; mMappingNegated = concept->mMappingNegated; mDataLiteral = concept->mDataLiteral; mDatatype = concept->mDatatype; mVariableLinker = nullptr; mConceptData = nullptr; CSortedNegLinker *opIt = concept->operands; while (memMan && opIt) { CConcept *con = opIt->getData(); bool negated = opIt->isNegated(); CSortedNegLinker *opLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(memMan); opLinker->init(con,negated); addOperandLinker(opLinker); opIt = (CSortedNegLinker *)opIt->getNext(); } CSortedLinker* varIt = concept->mVariableLinker; while (memMan && varIt) { CVariable* var = varIt->getData(); CSortedLinker* varLinker = CObjectAllocator< CSortedLinker >::allocateAndConstruct(memMan); varLinker->init(var); addVariableLinker(varLinker); varIt = (CSortedLinker *)varIt->getNext(); } return this; } CVariable* CConcept::getVariable() { if (mVariableLinker) { return mVariableLinker->getData(); } return nullptr; } CSortedLinker* CConcept::getVariableLinker() { return mVariableLinker; } CConcept* CConcept::setVariableLinker(CSortedLinker* variableLinker) { mVariableLinker = variableLinker; return this; } CConcept* CConcept::addVariableLinker(CSortedLinker* variableLinker) { mVariableLinker = variableLinker->insertSortedNextSorted(mVariableLinker); return this; } CConcept *CConcept::setConceptTag(qint64 conTag) { mTag = conTag; return this; } qint64 CConcept::getConceptTag() const { return mTag; } CConcept *CConcept::setOperatorCode(qint64 opCode) { mOperatorCode = CConceptOperator::getConceptOperator(opCode); return this; } qint64 CConcept::getOperatorCode() { return mOperatorCode->getOperatorCode(); } CConceptOperator* CConcept::getConceptOperator() { return mOperatorCode; } CConcept *CConcept::setOperatorTag(qint64 opTag) { mOperatorCode = CConceptOperator::getConceptOperator(opTag); return this; } qint64 CConcept::getDefinitionOperatorTag() { return getOperatorCode(); } qint64 CConcept::getProcessingOperatorTag() { qint64 tag = getOperatorCode(); if (tag == CCEQ || tag == CCSUB) { tag = CCAND; } return tag; } CConcept *CConcept::setTerminology(CTerminology *terminology) { tax = terminology; return this; } CTerminology *CConcept::getTerminology() { return tax; } qint64 CConcept::getTerminologyTag() const { qint64 taxTag = 0; if (tax) { taxTag = tax->getTerminologyID(); } return taxTag; } QPair CConcept::getTerminologyConceptTagPair() { return QPair(getTerminologyTag(),mTag); } CConcept *CConcept::setParameter(qint64 parameter) { opParameter = parameter; return this; } qint64 CConcept::getParameter() { return opParameter; } CConcept *CConcept::setOperandCount(qint64 count) { operandCount = count; return this; } CConcept* CConcept::incOperandCount(cint64 incCount) { operandCount += incCount; return this; } qint64 CConcept::getOperandCount() { return operandCount; } CConcept *CConcept::setOperandList(CSortedNegLinker *operandList) { operands = operandList; return this; } CConcept *CConcept::addOperandLinker(CSortedNegLinker *operandLinker) { if (operands) { operands = operands->insertSortedNextSorted(operandLinker); } else { operands = operandLinker; } return this; } CSortedNegLinker *CConcept::getOperandList() { return operands; } bool CConcept::operator<=(const CConcept &concept) { if (mTag < concept.mTag) { return true; } else if (mTag > concept.mTag) { return false; } else { return getTerminologyTag() <= concept.getTerminologyTag(); } } bool CConcept::operator==(const CConcept &concept) { return mTag == concept.mTag && tax == concept.tax; } CConcept *CConcept::setRole(CRole *role) { operatorRole = role; return this; } CRole *CConcept::getRole() { return operatorRole; } CIndividual* CConcept::getNominalIndividual() { return mNominalIndiviual; } bool CConcept::hasNominalIndividual() { return mNominalIndiviual != nullptr; } CConcept* CConcept::setNominalIndividual(CIndividual* nominalIndividual) { mNominalIndiviual = nominalIndividual; return this; } bool CConcept::isGeneratingOperator(bool negated) { cint64 operatorTag = mOperatorCode->getOperatorCode(); if (!negated) { return (operatorTag == CCSOME || operatorTag == CCATLEAST); } else { return (operatorTag == CCALL || operatorTag == CCATMOST); } } bool CConcept::isNegatedGeneratingOperator() { return isGeneratingOperator(true); } bool CConcept::isNonGeneratingOperator() { return !isGeneratingOperator(); } bool CConcept::hasClassName() { return hasName(); } CConcept *CConcept::setClassNameLinker(CLinker *conceptNameLinker) { setNameLinker(conceptNameLinker); return this; } CConcept *CConcept::addClassNameLinker(CLinker *conceptNameLinker) { addNameLinker(conceptNameLinker); return this; } CLinker *CConcept::getClassNameLinker() { return getNameLinker(); } bool CConcept::isEqualsToBOTTOM(bool negated) { cint64 operatorTag = mOperatorCode->getOperatorCode(); return (!negated && operatorTag == CCBOTTOM || negated && operatorTag == CCTOP); } bool CConcept::isEqualsToTOP(bool negated) { cint64 operatorTag = mOperatorCode->getOperatorCode(); return (negated && operatorTag == CCBOTTOM || !negated && operatorTag == CCTOP); } bool CConcept::hasOperandConceptTag(CConcept *concept) { return hasOperandConceptTag(concept->getConceptTag()); } bool CConcept::hasOperandConceptTag(qint64 conTag) { CSortedNegLinker *opIt = operands; while (opIt) { qint64 opConTag = opIt->getData()->getConceptTag(); if (opConTag == conTag) { return true; } else if (opConTag > conTag) { return false; } opIt = (CSortedNegLinker *)opIt->getNext(); } return false; } bool CConcept::hasOperandConceptTag(CConcept *concept, bool negation) { return hasOperandConceptTag(concept->getConceptTag(),negation); } bool CConcept::hasOperandConceptTag(qint64 conTag, bool negation) { CSortedNegLinker *opIt = operands; while (opIt) { qint64 opConTag = opIt->getData()->getConceptTag(); bool opNeg = opIt->isNegated(); if (opConTag == conTag && negation == opNeg) { return true; } else if (opConTag > conTag) { return false; } opIt = (CSortedNegLinker *)opIt->getNext(); } return false; } bool CConcept::hasOperandConcept(CConcept *concept) { CSortedNegLinker *opIt = operands; while (opIt) { CConcept* opConcept = opIt->getData(); if (opConcept == concept) { return true; } opIt = (CSortedNegLinker *)opIt->getNext(); } return false; } bool CConcept::hasOperandConcept(CConcept *concept, bool negation) { CSortedNegLinker *opIt = operands; while (opIt) { CConcept* opConcept = opIt->getData(); bool opNeg = opIt->isNegated(); if (opConcept == concept && negation == opNeg) { return true; } opIt = (CSortedNegLinker *)opIt->getNext(); } return false; } CConceptData* CConcept::getConceptData() { return mConceptData; } CConcept* CConcept::setConceptData(CConceptData* conceptData) { mConceptData = conceptData; return this; } bool CConcept::hasConceptData() { return mConceptData != nullptr; } bool CConcept::hasMappingNegation() { return mMappingNegated; } CConcept* CConcept::setMappingNegation(bool negation) { mMappingNegated = negation; return this; } CDataLiteral* CConcept::getDataLiteral() { return mDataLiteral; } CConcept* CConcept::setDataLiteral(CDataLiteral* dataLiteral) { mDataLiteral = dataLiteral; return this; } CDatatype* CConcept::getDatatype() { return mDatatype; } CConcept* CConcept::setDatatype(CDatatype* datatype) { mDatatype = datatype; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyStructureSummary.cpp0000644000175000017500000006273212520551212027577 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyStructureSummary.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyStructureSummary::COntologyStructureSummary(COntologyContext* ontologyContext) { clear(); } COntologyStructureSummary::~COntologyStructureSummary() { } COntologyStructureSummary *COntologyStructureSummary::clear() { mConClassCount = 0; mConCount = 0; mRoleObPropCount = 0; mDataPropCount = 0; mConGCICount = 0; mConIntersectionCount = 0; mConUnionCount = 0; mConNegCount = 0; mConSomeCount = 0; mConOnlyCount = 0; mConAtmostCount = 0; mConAtleastCount = 0; mConQualAtmostCount = 0; mConQualAtleastCount = 0; mConNonqualAtmostCount = 0; mConNonqualAtleastCount = 0; mConSubclassCount = 0; mConEquivalenceCount = 0; mConPrimCount = 0; mConCompCount = 0; mPrimClassCount = 0; mCompClassCount = 0; mConFuncAtmostCount = 0; mConValueCount = 0; mConNominalIndividualCount = 0; mConSelfCount = 0; mConAutChooceCount = 0; mConAutStateCount = 0; mConAutTransCount = 0; mRoleInvCount = 0; mRoleEqCount = 0; mRoleDisjCount = 0; mRoleRangeConCount = 0; mRoleDomainConCount = 0; mRoleAsymmetricCount = 0; mRoleSymmetricCount = 0; mRoleFuncCount = 0; mRoleInvFuncCount = 0; mRoleTransCount = 0; mRoleRefCount = 0; mRoleIrrefCount = 0; mNegDisOccurrence = false; mCardOccurrence = false; mExistOccurrence = false; mQualCardOccurrence = false; mFunctionalityOccurrence = false; mTransitivityOccurrence = false; mRoleHierarchyOccurrence = false; mComplexSubRoleOccurrence = false; mUniversalRoleOccurrence = false; mInverseOccurrence = false; mNominalIndividualOccurrence = false; mNominalOccurrence = false; mGroundingOccurrence = false; mDatatypeOccurrence = false; mExpressStringCalc = false; mAllClassesDeterministic = false; mAllClassesEL = false; return this; } COntologyStructureSummary* COntologyStructureSummary::referenceStructureSummary(COntologyStructureSummary* structureSummary) { clear(); mAllClassesDeterministic = structureSummary->mAllClassesDeterministic; mAllClassesEL = structureSummary->mAllClassesEL; mConClassCount = structureSummary->mConClassCount; mConCount = structureSummary->mConCount; mRoleObPropCount = structureSummary->mRoleObPropCount; mDataPropCount = structureSummary->mDataPropCount; mConGCICount = structureSummary->mConGCICount; mConIntersectionCount = structureSummary->mConIntersectionCount; mConUnionCount = structureSummary->mConUnionCount; mConNegCount = structureSummary->mConNegCount; mConSomeCount = structureSummary->mConSomeCount; mConOnlyCount = structureSummary->mConOnlyCount; mConAtmostCount = structureSummary->mConAtmostCount; mConAtleastCount = structureSummary->mConAtleastCount; mConQualAtmostCount = structureSummary->mConQualAtmostCount; mConQualAtleastCount = structureSummary->mConQualAtleastCount; mConNonqualAtmostCount = structureSummary->mConNonqualAtmostCount; mConNonqualAtleastCount = structureSummary->mConNonqualAtleastCount; mConSubclassCount = structureSummary->mConSubclassCount; mConEquivalenceCount = structureSummary->mConEquivalenceCount; mConPrimCount = structureSummary->mConPrimCount; mConCompCount = structureSummary->mConCompCount; mPrimClassCount = structureSummary->mPrimClassCount; mCompClassCount = structureSummary->mCompClassCount; mConFuncAtmostCount = structureSummary->mConFuncAtmostCount; mConValueCount = structureSummary->mConValueCount; mConNominalIndividualCount = structureSummary->mConNominalIndividualCount; mConSelfCount = structureSummary->mConSelfCount; mConAutChooceCount = structureSummary->mConAutChooceCount; mConAutStateCount = structureSummary->mConAutStateCount; mConAutTransCount = structureSummary->mConAutTransCount; mRoleInvCount = structureSummary->mRoleInvCount; mRoleEqCount = structureSummary->mRoleEqCount; mRoleDisjCount = structureSummary->mRoleDisjCount; mRoleRangeConCount = structureSummary->mRoleRangeConCount; mRoleDomainConCount = structureSummary->mRoleDomainConCount; mRoleAsymmetricCount = structureSummary->mRoleAsymmetricCount; mRoleSymmetricCount = structureSummary->mRoleSymmetricCount; mRoleFuncCount = structureSummary->mRoleFuncCount; mRoleInvFuncCount = structureSummary->mRoleInvFuncCount; mRoleTransCount = structureSummary->mRoleTransCount; mRoleRefCount = structureSummary->mRoleRefCount; mRoleIrrefCount = structureSummary->mRoleIrrefCount; mNegDisOccurrence = structureSummary->mNegDisOccurrence; mCardOccurrence = structureSummary->mCardOccurrence; mExistOccurrence = structureSummary->mExistOccurrence; mQualCardOccurrence = structureSummary->mQualCardOccurrence; mFunctionalityOccurrence = structureSummary->mFunctionalityOccurrence; mTransitivityOccurrence = structureSummary->mTransitivityOccurrence; mRoleHierarchyOccurrence = structureSummary->mRoleHierarchyOccurrence; mComplexSubRoleOccurrence = structureSummary->mComplexSubRoleOccurrence; mUniversalRoleOccurrence = structureSummary->mUniversalRoleOccurrence; mInverseOccurrence = structureSummary->mInverseOccurrence; mNominalIndividualOccurrence = structureSummary->mNominalIndividualOccurrence; mNominalOccurrence = structureSummary->mNominalOccurrence; mGroundingOccurrence = structureSummary->mGroundingOccurrence; mDatatypeOccurrence = structureSummary->mDatatypeOccurrence; return this; } bool COntologyStructureSummary::hasOnlyDeterministicConceptClasses() { return mAllClassesDeterministic; } COntologyStructureSummary* COntologyStructureSummary::setOnlyDeterministicConceptClasses(bool allClassesDeterministic) { mAllClassesDeterministic = allClassesDeterministic; return this; } bool COntologyStructureSummary::hasOnlyELConceptClasses() { return mAllClassesEL; } COntologyStructureSummary* COntologyStructureSummary::setOnlyELConceptClasses(bool allClassesEL) { mAllClassesEL = allClassesEL; return this; } QString COntologyStructureSummary::getExpressivenessString() { if (!mExpressStringCalc) { calculateExpressiveness(); } return expressString; } COntologyStructureSummary *COntologyStructureSummary::calculateExpressiveness() { QString appendString; expressString.clear(); expressString = "AL"; if (hasNegationDisjunctionsOccurrence()) { expressString = "ALC"; } else if (hasExistensialOccurrence()) { expressString = "ALE"; } if (hasTransitivityOccurrence()) { appendString = "+"; } if (expressString == "ALC" && appendString.contains("+")) { expressString = "S"; appendString = appendString.replace("+",""); } if (hasComplexSubRoleOccurrence()) { expressString = "SR"; } else if (hasRoleHierarchyOccurrence()) { expressString += "H"; } if (hasNominalOccurrence()) { expressString += "O"; } if (hasInverseOccurrence()) { expressString += "I"; } if (hasQualifiedCardinalityOccurrence()) { expressString += "Q"; } else if (hasCardinalityOccurrence()) { expressString += "N"; } else if (hasFunctionalityOccurrence()) { expressString += "F"; } if (hasGroundingOccurrence()) { expressString += "V"; } if (hasDatatypeOccurrence()) { expressString += "(D)"; } expressString += appendString; mExpressStringCalc = true; return this; } COntologyStructureSummary *COntologyStructureSummary::incClassCount(qint64 incCount) { mConClassCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptCount(qint64 incCount) { mConCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incObjectPropertyCount(qint64 incCount) { mRoleObPropCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incDataPropertyCount(qint64 incCount) { mDataPropCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incGCICount(qint64 incCount) { mConGCICount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptIntersectionCount(qint64 incCount) { mConIntersectionCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptUnionCount(qint64 incCount) { mConUnionCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptNegCount(qint64 incCount) { mConNegCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptSomeCount(qint64 incCount) { mConSomeCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptOnlyCount(qint64 incCount) { mConOnlyCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptAtmostCount(qint64 incCount) { mConAtmostCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptAtleastCount(qint64 incCount) { mConAtleastCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptQualifiedAtleastCount(qint64 incCount) { mConQualAtleastCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptQualifiedAtmostCount(qint64 incCount) { mConQualAtmostCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptNotQualifiedAtleastCount(qint64 incCount) { mConNonqualAtleastCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptNotQualifiedAtmostCount(qint64 incCount) { mConNonqualAtmostCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptEquivalenceCount(qint64 incCount) { mConEquivalenceCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptSubclassCount(qint64 incCount) { mConSubclassCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incPrimitiveConceptCount(qint64 incCount) { mConPrimCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incComplexConceptCount(qint64 incCount) { mConCompCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incAtomicClassCount(qint64 incCount) { mPrimClassCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incComplexClassCount(qint64 incCount) { mCompClassCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incRoleInverseCount(qint64 incCount) { mRoleInvCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incRoleEquivalenceCount(qint64 incCount) { mRoleEqCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incRoleDisjointCount(qint64 incCount) { mRoleDisjCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incRoleRangeConceptCount(qint64 incCount) { mRoleRangeConCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incRoleDomainConceptCount(qint64 incCount) { mRoleDomainConCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incRoleAsymmetricCount(qint64 incCount) { mRoleAsymmetricCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incRoleSymmetricCount(qint64 incCount) { mRoleSymmetricCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incRoleFunctionalCount(qint64 incCount) { mRoleFuncCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incRoleInverseFunctionalCount(qint64 incCount) { mRoleInvFuncCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incRoleTransetivCount(qint64 incCount) { mRoleTransCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incRoleReflexivityCount(qint64 incCount) { mRoleRefCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incRoleIrreflexivityCount(qint64 incCount) { mRoleIrrefCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptFunctionalAtmostCount(qint64 incCount) { mConFuncAtmostCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptValueCount(qint64 incCount) { mConValueCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptNominalIndividualCount(qint64 incCount) { mConNominalIndividualCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptSelfCount(qint64 incCount) { mConSelfCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptAutomateChooseCount(qint64 incCount) { mConAutChooceCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptAutomateStateCount(qint64 incCount) { mConAutStateCount += incCount; return this; } COntologyStructureSummary *COntologyStructureSummary::incConceptAutomateTransitiveCount(qint64 incCount) { mConAutTransCount += incCount; return this; } qint64 COntologyStructureSummary::getClassCount() { return mConClassCount; } qint64 COntologyStructureSummary::getConceptCount() { return mConCount; } qint64 COntologyStructureSummary::getObjectPropertyCount() { return mRoleObPropCount; } qint64 COntologyStructureSummary::getDataPropertyCount() { return mDataPropCount; } qint64 COntologyStructureSummary::getGCICount() { return mConGCICount; } qint64 COntologyStructureSummary::getConceptIntersectionCount() { return mConIntersectionCount; } qint64 COntologyStructureSummary::getConceptUnionCount() { return mConUnionCount; } qint64 COntologyStructureSummary::getConceptNotCount() { return mConNegCount; } qint64 COntologyStructureSummary::getConceptSomeCount() { return mConSomeCount; } qint64 COntologyStructureSummary::getConceptOnlyCount() { return mConOnlyCount; } qint64 COntologyStructureSummary::getConceptAtmostCount() { return mConAtmostCount; } qint64 COntologyStructureSummary::getConceptAtleastCount() { return mConAtleastCount; } qint64 COntologyStructureSummary::getConceptQualifiedAtleastCount() { return mConQualAtleastCount; } qint64 COntologyStructureSummary::getConceptQualifiedAtmostCount() { return mConQualAtmostCount; } qint64 COntologyStructureSummary::getConceptNotQualifiedAtleastCount() { return mConNonqualAtleastCount; } qint64 COntologyStructureSummary::getConceptNotQualifiedAtmostCount() { return mConNonqualAtmostCount; } qint64 COntologyStructureSummary::getConceptEquivalenceCount() { return mConEquivalenceCount; } qint64 COntologyStructureSummary::getConceptSubclassCount() { return mConSubclassCount; } bool COntologyStructureSummary::hasConceptIntersections() { return mConIntersectionCount > 0; } bool COntologyStructureSummary::hasConceptUnions() { return mConUnionCount > 0; } bool COntologyStructureSummary::hasConceptNots() { return mConNegCount > 0; } bool COntologyStructureSummary::hasConceptSomes() { return mConSomeCount > 0; } bool COntologyStructureSummary::hasConceptOnlys() { return mConOnlyCount > 0; } bool COntologyStructureSummary::hasConceptAtmosts() { return mConAtmostCount > 0; } bool COntologyStructureSummary::hasConceptAtleasts() { return mConAtleastCount > 0; } bool COntologyStructureSummary::hasConceptQualifiedAtleasts() { return mConQualAtleastCount > 0; } bool COntologyStructureSummary::hasConceptQualifiedAtmosts() { return mConQualAtmostCount > 0; } bool COntologyStructureSummary::hasConceptNotQualifiedAtleasts() { return mConNonqualAtleastCount > 0; } bool COntologyStructureSummary::hasConceptNotQualifiedAtmosts() { return mConNonqualAtmostCount > 0; } bool COntologyStructureSummary::hasConceptEquivalences() { return mConEquivalenceCount > 0; } bool COntologyStructureSummary::hasConceptSubclasses() { return mConSubclassCount > 0; } qint64 COntologyStructureSummary::getPrimitiveConceptCount() { return mConPrimCount; } qint64 COntologyStructureSummary::getComplexConceptCount() { return mConCompCount; } qint64 COntologyStructureSummary::getAtomicClassCount() { return mPrimClassCount; } qint64 COntologyStructureSummary::getComplexClassCount() { return mCompClassCount; } qint64 COntologyStructureSummary::getRoleInverseCount() { return mRoleInvCount; } qint64 COntologyStructureSummary::getRoleEquivalenceCount() { return mRoleEqCount; } qint64 COntologyStructureSummary::getRoleDisjointCount() { return mRoleDisjCount; } qint64 COntologyStructureSummary::getRoleRangeConceptCount() { return mRoleRangeConCount; } qint64 COntologyStructureSummary::getRoleDomainConceptCount() { return mRoleDomainConCount; } qint64 COntologyStructureSummary::getRoleAsymmetricCount() { return mRoleAsymmetricCount; } qint64 COntologyStructureSummary::getRoleSymmetricCount() { return mRoleSymmetricCount; } qint64 COntologyStructureSummary::getRoleFunctionalCount() { return mRoleFuncCount; } qint64 COntologyStructureSummary::getRoleInverseFunctionalCount() { return mRoleInvFuncCount; } qint64 COntologyStructureSummary::getRoleTransetivCount() { return mRoleTransCount; } qint64 COntologyStructureSummary::getRoleReflexivityCount() { return mRoleRefCount; } qint64 COntologyStructureSummary::getRoleIrreflexivityCount() { return mRoleIrrefCount; } qint64 COntologyStructureSummary::getConceptFunctionalAtmostCount() { return mConFuncAtmostCount; } qint64 COntologyStructureSummary::getConceptValueCount() { return mConValueCount; } qint64 COntologyStructureSummary::getConceptIndividualCount() { return mConNominalIndividualCount; } qint64 COntologyStructureSummary::getConceptSelfCount() { return mConSelfCount; } qint64 COntologyStructureSummary::getConceptAutomateChooseCount() { return mConAutChooceCount; } qint64 COntologyStructureSummary::getConceptAutomateStateCount() { return mConAutStateCount; } qint64 COntologyStructureSummary::getConceptAutomateTransitiveCount() { return mConAutTransCount; } bool COntologyStructureSummary::hasRoleInverses() { return mRoleInvCount; } bool COntologyStructureSummary::hasRoleEquivalences() { return mRoleEqCount; } bool COntologyStructureSummary::hasRoleDisjoints() { return mRoleDisjCount; } bool COntologyStructureSummary::hasRoleRangeConcepts() { return mRoleRangeConCount; } bool COntologyStructureSummary::hasRoleDomainConcepts() { return mRoleDomainConCount; } bool COntologyStructureSummary::hasRoleAsymmetrics() { return mRoleAsymmetricCount; } bool COntologyStructureSummary::hasRoleSymmetrics() { return mRoleSymmetricCount; } bool COntologyStructureSummary::hasRoleFunctionals() { return mRoleFuncCount; } bool COntologyStructureSummary::hasRoleInverseFunctionals() { return mRoleInvFuncCount; } bool COntologyStructureSummary::hasRoleTransetivs() { return mRoleTransCount; } bool COntologyStructureSummary::hasRoleReflexivitys() { return mRoleRefCount; } bool COntologyStructureSummary::hasRoleIrreflexivitys() { return mRoleIrrefCount; } bool COntologyStructureSummary::hasConceptFunctionalAtmosts() { return mConFuncAtmostCount; } bool COntologyStructureSummary::hasConceptValues() { return mConValueCount; } bool COntologyStructureSummary::hasConceptNominalIndividual() { return mConNominalIndividualCount; } bool COntologyStructureSummary::hasConceptSelfs() { return mConSelfCount; } bool COntologyStructureSummary::hasConceptAutomateChooses() { return mConAutChooceCount; } bool COntologyStructureSummary::hasConceptAutomateStates() { return mConAutStateCount; } bool COntologyStructureSummary::hasConceptAutomateTransitives() { return mConAutTransCount; } COntologyStructureSummary *COntologyStructureSummary::setNegationDisjunctionsOccurrence(bool occured) { mNegDisOccurrence = occured; return this; } COntologyStructureSummary *COntologyStructureSummary::setCardinalityOccurrence(bool occured) { mCardOccurrence = occured; return this; } COntologyStructureSummary *COntologyStructureSummary::setExistensialOccurrence(bool occured) { mExistOccurrence = occured; return this; } COntologyStructureSummary *COntologyStructureSummary::setQualifiedCardinalityOccurrence(bool occured) { mQualCardOccurrence = occured; return this; } COntologyStructureSummary *COntologyStructureSummary::setFunctionalityOccurrence(bool occured) { mFunctionalityOccurrence = occured; return this; } COntologyStructureSummary *COntologyStructureSummary::setTransitivityOccurrence(bool occured) { mTransitivityOccurrence = occured; return this; } COntologyStructureSummary *COntologyStructureSummary::setRoleHierarchyOccurrence(bool occured) { mRoleHierarchyOccurrence = occured; return this; } COntologyStructureSummary *COntologyStructureSummary::setComplexSubRoleOccurrence(bool occured) { mComplexSubRoleOccurrence = occured; return this; } COntologyStructureSummary *COntologyStructureSummary::setUniversalRoleOccurrence(bool occured) { mUniversalRoleOccurrence = occured; return this; } COntologyStructureSummary *COntologyStructureSummary::setInverseOccurrence(bool occured) { mInverseOccurrence = occured; return this; } COntologyStructureSummary *COntologyStructureSummary::setNominalIndividualOccurrence(bool occured) { mNominalIndividualOccurrence = occured; return this; } COntologyStructureSummary *COntologyStructureSummary::setNominalOccurrence(bool occured) { mNominalOccurrence = occured; return this; } COntologyStructureSummary *COntologyStructureSummary::setGroundingOccurrence(bool occured) { mGroundingOccurrence = occured; return this; } COntologyStructureSummary *COntologyStructureSummary::setDatatypeOccurrence(bool occured) { mDatatypeOccurrence = occured; return this; } bool COntologyStructureSummary::hasNegationDisjunctionsOccurrence() { return mNegDisOccurrence; } bool COntologyStructureSummary::hasCardinalityOccurrence() { return mCardOccurrence; } bool COntologyStructureSummary::hasExistensialOccurrence() { return mExistOccurrence; } bool COntologyStructureSummary::hasQualifiedCardinalityOccurrence() { return mQualCardOccurrence; } bool COntologyStructureSummary::hasFunctionalityOccurrence() { return mFunctionalityOccurrence; } bool COntologyStructureSummary::hasTransitivityOccurrence() { return mTransitivityOccurrence; } bool COntologyStructureSummary::hasRoleHierarchyOccurrence() { return mRoleHierarchyOccurrence; } bool COntologyStructureSummary::hasComplexSubRoleOccurrence() { return mComplexSubRoleOccurrence; } bool COntologyStructureSummary::hasUniversalRoleOccurrence() { return mUniversalRoleOccurrence; } bool COntologyStructureSummary::hasInverseOccurrence() { return mInverseOccurrence; } bool COntologyStructureSummary::hasNominalIndividualOccurrence() { return mNominalIndividualOccurrence; } bool COntologyStructureSummary::hasNominalOccurrence() { return mNominalOccurrence; } bool COntologyStructureSummary::hasGroundingOccurrence() { return mGroundingOccurrence; } bool COntologyStructureSummary::hasDatatypeOccurrence() { return mDatatypeOccurrence; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleDependence.h0000644000175000017500000000713112520551214025001 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CROLEDEPENDENCE_H #define KONCLUDE_REASONER_ONTOLOGY_CROLEDEPENDENCE_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CRole.h" // Other includes #include "Utilities/CSortedNegLinker.hpp" #include "Utilities/CAllocationObject.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CRoleDependence * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleDependence : public CAllocationObject { // public methods public: //! Constructor CRoleDependence(); //! Destructor virtual ~CRoleDependence(); CRoleDependence *init(CRole *role); CRoleDependence *init(qint64 roleTag, CRoleDependence *role, CMemoryManager > *linkerMemMan); CRoleDependence *setRole(CRole *role); CRoleDependence *setRoleTag(CRole *role); qint64 getRoleTag(); CRoleDependence *setIndirectSubRoleList(CSortedNegLinker *indirectDepSubRoleList); CRoleDependence *addIndirectSubRoleLinker(CSortedNegLinker *indirectDepSubRoleLinker); CSortedNegLinker *getIndirectSubRoleList(); CRoleDependence *setSubRoleList(CSortedNegLinker *depSubRoleList); CRoleDependence *addSubRoleLinker(CSortedNegLinker *depSubRoleLinker); CSortedNegLinker *getSubRoleList(); CRoleDependence *setConceptDependenceList(CSortedNegLinker *conceptDependenceList); CRoleDependence *addConceptDependenceLinker(CSortedNegLinker *conceptDependenceLinker); CSortedNegLinker *getConceptDependenceList(); CRoleDependence *setIndividualDependenceList(CSortedNegLinker *indiList); CRoleDependence *addIndividualDependenceLinker(CSortedNegLinker *indiLinker); CSortedNegLinker *getIndividualDependenceList(); CRoleDependence *setIndirectChainedSubRoleList(CSortedNegLinker *indirectChainDepSubRoleList); CRoleDependence *addIndirectChainedSubRoleLinker(CSortedNegLinker *indirectChainDepSubRoleList); CSortedNegLinker *getIndirectChainedSubRoleList(); // protected methods protected: // private methods private: // private variables private: qint64 rolDepTag; CSortedNegLinker *subRoleLinker; CSortedNegLinker *indirectSubRoleLinker; CSortedNegLinker *indirectChainedSubRoleLinker; CSortedNegLinker *conceptDepLinker; CSortedNegLinker *indiDepsLinker; }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CROLEDEPENDENCE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingSteps.h0000644000175000017500000000400012520551212027001 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPS_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyContext.h" #include "COntologyProcessingStepDataVector.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyProcessingSteps * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyProcessingSteps { // public methods public: //! Constructor COntologyProcessingSteps(COntologyContext* context); ~COntologyProcessingSteps(); COntologyProcessingStepDataVector* getOntologyProcessingStepDataVector(); // protected methods protected: // protected variables protected: COntologyContext* mContext; COntologyProcessingStepDataVector* mPrStepDataVector; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CExtendedConceptReferenceLinkingData.cpp0000644000175000017500000000212612520551204031457 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExtendedConceptReferenceLinkingData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CExtendedConceptReferenceLinkingData::CExtendedConceptReferenceLinkingData() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CProcessReference.h0000644000175000017500000000324012520551214025357 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CPROCESSREFERENCE_H #define KONCLUDE_REASONER_ONTOLOGY_CPROCESSREFERENCE_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CProcessReference * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessReference { // public methods public: //! Constructor CProcessReference(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CPROCESSREFERENCE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStep.cpp0000644000175000017500000000704712520551212027167 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyProcessingStep.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyProcessingStep::COntologyProcessingStep(PROCESSINGSTEPTYPE processingType, cint64 id, PROCESSORTYPE processorType) { mProcessingType = processingType; mProcessorType = processorType; mProcessingStepID = id; } COntologyProcessingStep::PROCESSINGSTEPTYPE COntologyProcessingStep::getOntologyProcessingType() { return mProcessingType; } COntologyProcessingStep* COntologyProcessingStep::addProcessingRequirement(COntologyProcessingRequirement* requirement) { mProcessingRequirementList.append(requirement); return this; } cint64 COntologyProcessingStep::getProcessingStepID() { return mProcessingStepID; } COntologyProcessingStep::PROCESSORTYPE COntologyProcessingStep::getProcessorType() { return mProcessorType; } QList* COntologyProcessingStep::getProcessingRequirementList() { return &mProcessingRequirementList; } bool COntologyProcessingStep::areAllRequirementsSatisfied(COntology* ontology) { for (QList::const_iterator it = mProcessingRequirementList.constBegin(), itEnd = mProcessingRequirementList.constEnd(); it != itEnd; ++it) { COntologyProcessingRequirement* ontReq(*it); if (!ontReq->isRequirementSatisfied(ontology)) { return false; } } return true; } const QString COntologyProcessingStep::getProcessingStepName() { QString stepName; if (mProcessingType == OPSACTIVECOUNT) { stepName = QString("Active-Entity-Counting"); } else if (mProcessingType == OPSBUILD) { stepName = QString("Representation-Building"); } else if (mProcessingType == OPSPREPROCESS) { stepName = QString("Preprocessing"); } else if (mProcessingType == OPSCONSISTENCY) { stepName = QString("Consistency-Checking"); } else if (mProcessingType == OPSPRECOMPUTESATURATION) { stepName = QString("Saturation-Precomputing"); } else if (mProcessingType == OPSPRECOMPUTEINDIVIDUAL) { stepName = QString("Individual-Precomputing"); } else if (mProcessingType == OPSPRECOMPUTECYCLES) { stepName = QString("Cycles-Precomputing"); } else if (mProcessingType == OPSCLASSCLASSIFY) { stepName = QString("Classification"); } else if (mProcessingType == OPSCONCEPTREALIZE) { stepName = QString("Types-Realization"); } else if (mProcessingType == OPSSAMEINDIVIDUALSREALIZE) { stepName = QString("Same-Individual-Realization"); } else if (mProcessingType == OPSROLEREALIZE) { stepName = QString("Role-Realization"); } return stepName; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyDataBoxes.h0000644000175000017500000000615112520551210025527 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYDATABOXES_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYDATABOXES_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CExpressionDataBoxMapping.h" #include "COntologyContext.h" #include "CTBox.h" #include "CABox.h" #include "CRBox.h" #include "CMBox.h" #include "CDatatypeValueSpaceTypes.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyDataBoxes * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyDataBoxes { // public methods public: //! Constructor COntologyDataBoxes(CBoxContext* boxContext = nullptr); //! Destructor virtual ~COntologyDataBoxes(); COntologyDataBoxes* referenceDataBoxes(COntologyDataBoxes* dataBoxes); CConcept *getTopConcept(); CConcept *getBottomConcept(); CExpressionDataBoxMapping* getExpressionDataBoxMapping(); COntologyDataBoxes* setExpressionDataBoxMapping(CExpressionDataBoxMapping* expDatBoxMapping); CTBox* getTBox(); CRBox* getRBox(); CABox* getABox(); CMBox* getMBox(); CBoxContext* getBoxContext(); bool isBasicBuild(); bool isInitialBuild(); bool isIterationBuild(); COntologyDataBoxes* setBasicBuild(bool basicBuild); COntologyDataBoxes* setInitialBuild(bool initialBuild); COntologyDataBoxes* setIterationBuild(bool iterationBuild); COntologyDataBoxes* setBuildContinuation(); CDatatypeValueSpaceTypes* getDatatypeValueSpaceTypes(); // protected methods protected: // protected variables protected: CBoxContext* mBoxContext; bool mBasicBuild; bool mInitialBuild; bool mIterationBuild; bool mPrevOntBasicBuild; bool mPrevOntInitialBuild; bool mPrevOntIterationBuild; CTBox* mTBox; CABox* mABox; CRBox* mRBox; CMBox* mMBox; CExpressionDataBoxMapping* mExpDataBoxMapping; CDatatypeValueSpaceTypes* mValueSpaceTypes; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYDATABOXES_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralIRIValue.h0000644000175000017500000000576612520551200025663 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATALITERALIRIVALUE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATALITERALIRIVALUE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDataLiteralValue.h" #include "CDataLiteralCompareValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataLiteralIRIValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralIRIValue : public CDataLiteralCompareValue { // public methods public: //! Constructor CDataLiteralIRIValue(); virtual CDataLiteralCompareValue* initValue(CDataLiteralCompareValue* value); CDataLiteralIRIValue* initValueFromInfiniteLength(); CDataLiteralIRIValue* initValueFromLength(cuint64 length); CDataLiteralIRIValue* initValueFromIRIString(const QString& iriString); CDataLiteralIRIValue* initValue(CDataLiteralIRIValue* value); CDataLiteralIRIValue* clearValue(); virtual DATA_LITERAL_VALUE_TYPE getDataValueType(); bool isInfiniteLength(); cuint64 getLength(); QString getIRIValue(); bool isEqualTo(CDataLiteralValue* value); bool isLessEqualThan(CDataLiteralCompareValue* value); bool isLessThan(CDataLiteralCompareValue* value); bool isEqualTo(CDataLiteralCompareValue* value); bool isGreaterEqualThan(CDataLiteralCompareValue* value); bool isGreaterThan(CDataLiteralCompareValue* value); bool isLessEqualThan(CDataLiteralIRIValue* value); bool isLessThan(CDataLiteralIRIValue* value); bool isEqualTo(CDataLiteralIRIValue* value); bool isGreaterEqualThan(CDataLiteralIRIValue* value); bool isGreaterThan(CDataLiteralIRIValue* value); // protected methods protected: // protected variables protected: bool mInfiniteLength; cuint64 mLength; QString mIRIString; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATALITERALIRIVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleData.cpp0000644000175000017500000000200512520551214024146 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CRoleData::CRoleData() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptDataVector.cpp0000644000175000017500000000233212520551174026033 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptDataVector.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptDataVector::CConceptDataVector(CBoxContext* boxContext) : CDefaultDynamicReferenceVectorBase(boxContext) { } CConceptDataVector::~CConceptDataVector() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyInspector.cpp0000644000175000017500000005515512520551210026166 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyInspector.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyInspector::COntologyInspector() { } COntologyInspector::~COntologyInspector() { } COntologyStructureSummary *COntologyInspector::createStructureSummary(CConcreteOntology *ontology) { COntologyStructureSummary *ontStrSum = inspectOntology(ontology); if (ontStrSum) { ontology->setStructureSummary(ontStrSum); } return ontStrSum; } CBOXSET *COntologyInspector::createConceptContainsSet(CConcept *concept, CTBox *tBox, CBOXSET *containsSet) { if (!containsSet) { containsSet = new CBOXSET(); } QList checkList; checkList.append(concept); CSortedNegLinker *conIt = 0; while (!checkList.isEmpty()) { CConcept *checkConcept = checkList.takeFirst(); if (!containsSet->contains(checkConcept)) { containsSet->insert(checkConcept); // collect new dependencies CRole *role = checkConcept->getRole(); if (role) { CSortedNegLinker *superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { CRole *superRole = superRoleIt->getData(); conIt = superRole->getDomainConceptList(); while (conIt) { CConcept *con = conIt->getData(); checkList.append(con); conIt = conIt->getNext(); } conIt = superRole->getRangeConceptList(); while (conIt) { CConcept *con = conIt->getData(); checkList.append(con); conIt = conIt->getNext(); } superRoleIt = superRoleIt->getNext(); } } conIt = checkConcept->getOperandList(); while (conIt) { CConcept *con = conIt->getData(); checkList.append(con); conIt = conIt->getNext(); } } } return containsSet; } COntologyInspector *COntologyInspector::createGCIConceptSet(CTBox *tBox) { CConceptVector *conVec = tBox->getConceptVector(); qint64 conCount = conVec->getItemCount(); CConcept *topCon = conVec->getData(1); if (topCon) { CContext* tBoxContext = tBox->getBoxContext(); CBOXSET *gciContainsSet = createConceptContainsSet(topCon,tBox,CObjectParameterizingAllocator< CBOXSET,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(tBoxContext),tBoxContext)); tBox->setGCIConceptSet(gciContainsSet); } return this; } COntologyStructureSummary* COntologyInspector::inspectConcept(CConcreteOntology *ontology, CConcept* concept, bool negation, COntologyStructureSummary *ontStructSum) { qint64 conOpTag = concept->getDefinitionOperatorTag(); bool isClass = concept->hasClassName(); bool opCount = concept->getOperandCount() > 0; cint64 parm = concept->getParameter(); CSortedNegLinker* opLinker = concept->getOperandList(); for (CSortedNegLinker* opLinkerIt = opLinker; opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { if (opLinkerIt->isNegated()) { CConcept* opConcept = opLinkerIt->getData(); CConceptOperator* conOperator = opConcept->getConceptOperator(); if (!conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE)) { ontStructSum->setNegationDisjunctionsOccurrence(); } } } CRole* role = concept->getRole(); if (role && role->isDataRole()) { ontStructSum->setDatatypeOccurrence(); } if (isClass) { ontStructSum->incClassCount(); } if (conOpTag == CCATOM) { ontStructSum->incPrimitiveConceptCount(); if (isClass) { ontStructSum->incAtomicClassCount(); } } else { ontStructSum->incComplexConceptCount(); if (isClass) { ontStructSum->incComplexClassCount(); } if (conOpTag == CCPBINDGROUND || conOpTag == CCNOMTEMPLREF || conOpTag == CCVARBINDGROUND) { ontStructSum->setGroundingOccurrence(); } else if (conOpTag == CCNOT) { ontStructSum->incConceptNegCount(); ontStructSum->setNegationDisjunctionsOccurrence(); } else if (conOpTag == CCAND) { ontStructSum->incConceptIntersectionCount(); } else if (conOpTag == CCOR) { ontStructSum->incConceptUnionCount(); ontStructSum->setNegationDisjunctionsOccurrence(); } else if (conOpTag == CCATMOST) { ontStructSum->incConceptAtmostCount(); if (opCount) { ontStructSum->incConceptQualifiedAtmostCount(); } else { ontStructSum->incConceptNotQualifiedAtmostCount(); } if (parm == 1) { ontStructSum->setFunctionalityOccurrence(); ontStructSum->incConceptFunctionalAtmostCount(); } else if (opCount) { ontStructSum->setQualifiedCardinalityOccurrence(); } else { ontStructSum->setCardinalityOccurrence(); } } else if (conOpTag == CCATLEAST) { ontStructSum->setExistensialOccurrence(); ontStructSum->incConceptAtleastCount(); if (opCount) { ontStructSum->incConceptQualifiedAtleastCount(); if (parm != 1) { ontStructSum->setQualifiedCardinalityOccurrence(); } } else { ontStructSum->incConceptNotQualifiedAtleastCount(); if (parm != 1) { ontStructSum->setCardinalityOccurrence(); } } } else if (conOpTag == CCALL) { ontStructSum->incConceptOnlyCount(); ontStructSum->setExistensialOccurrence(); } else if (conOpTag == CCSOME || conOpTag == CCAQSOME) { ontStructSum->incConceptSomeCount(); ontStructSum->setExistensialOccurrence(); } else if (conOpTag == CCEQ) { ontStructSum->setNegationDisjunctionsOccurrence(); ontStructSum->incConceptEquivalenceCount(); } else if (conOpTag == CCSUB) { ontStructSum->incConceptSubclassCount(); } else if (conOpTag == CCVALUE) { ontStructSum->incConceptValueCount(); ontStructSum->setNominalIndividualOccurrence(); } else if (conOpTag == CCNOMINAL) { ontStructSum->incConceptNominalIndividualCount(); ontStructSum->setNominalIndividualOccurrence(); ontStructSum->setNegationDisjunctionsOccurrence(); } else if (conOpTag == CCSELF) { ontStructSum->incConceptSelfCount(); } else if (conOpTag == CCDATATYPE || CCDATALITERAL || CCDATARESTRICTION) { } } return ontStructSum; } COntologyStructureSummary *COntologyInspector::inspectOntology(CConcreteOntology *ontology) { COntologyStructureSummary *ontStructSum = new COntologyStructureSummary(); CRBox *rBox = ontology->getDataBoxes()->getRBox(); CRoleVector *roleVec = rBox->getRoleVector(); qint64 roleCount = roleVec->getItemCount(); for (qint64 index = 0; index < roleCount; ++index) { CRole* role = roleVec->getData(index); if (role) { CSortedNegLinker* invEqRoleLinkerIt = role->getInverseEquivalentRoleList(); while (invEqRoleLinkerIt) { bool neg = invEqRoleLinkerIt->isNegated(); CRole* inEqRole = invEqRoleLinkerIt->getData(); if (neg) { ontStructSum->setInverseOccurrence(); ontStructSum->incRoleInverseCount(); } else { ontStructSum->incRoleEquivalenceCount(); } invEqRoleLinkerIt = invEqRoleLinkerIt->getNext(); } CSortedNegLinker* disRoleLinkerIt = role->getDisjointRoleList(); while (disRoleLinkerIt) { ontStructSum->incRoleDisjointCount(); disRoleLinkerIt = disRoleLinkerIt->getNext(); } CSortedNegLinker* domConLinkerIt = role->getDomainConceptList(); while (domConLinkerIt) { ontStructSum->incRoleDomainConceptCount(); domConLinkerIt = domConLinkerIt->getNext(); } CSortedNegLinker* rangeConLinkerIt = role->getRangeConceptList(); while (rangeConLinkerIt) { ontStructSum->incRoleRangeConceptCount(); rangeConLinkerIt = rangeConLinkerIt->getNext(); } if (role->isAsymmetric()) { ontStructSum->incRoleAsymmetricCount(); } if (role->isSymmetric()) { ontStructSum->incRoleSymmetricCount(); } if (role->isTransitive()) { ontStructSum->setTransitivityOccurrence(); ontStructSum->incRoleTransetivCount(); } if (role->isReflexive()) { ontStructSum->incRoleReflexivityCount(); } if (role->isIrreflexive()) { ontStructSum->incRoleIrreflexivityCount(); } if (role->isFunctional()) { ontStructSum->setFunctionalityOccurrence(); ontStructSum->incRoleFunctionalCount(); } if (role->isInverseFunctional()) { ontStructSum->setFunctionalityOccurrence(); ontStructSum->incRoleInverseFunctionalCount(); } if (role->hasRoleChainSuperSharing()) { bool allTransChaincs = true; CXLinker* roleChainLinkerIt = role->getRoleChainSuperSharingLinker(); while (roleChainLinkerIt && allTransChaincs) { CRoleChain* roleChain = roleChainLinkerIt->getData(); CXLinker* chainRoleLinker = roleChain->getRoleChainLinker(); while (chainRoleLinker) { CRole* chainRole = chainRoleLinker->getData(); if (chainRole != role) { ontStructSum->setComplexSubRoleOccurrence(); allTransChaincs = false; break; } chainRoleLinker = chainRoleLinker->getNext(); } roleChainLinkerIt = roleChainLinkerIt->getNext(); } if (allTransChaincs) { ontStructSum->setTransitivityOccurrence(); } } CSortedNegLinker* superRoleLinkerIt = role->getSuperRoleList(); while (superRoleLinkerIt) { if (!superRoleLinkerIt->isNegated()) { //if (!role->hasEquivalentRole(superRoleLinkerIt->getData())) { //} ontStructSum->setRoleHierarchyOccurrence(); } superRoleLinkerIt = superRoleLinkerIt->getNext(); } } } CABox *aBox = ontology->getDataBoxes()->getABox(); CIndividualVector *indiVec = aBox->getIndividualVector(); qint64 indiCount = indiVec->getItemCount(); CTBox *tBox = ontology->getDataBoxes()->getTBox(); CConceptVector *conVec = tBox->getConceptVector(); qint64 conCount = conVec->getItemCount(); for (qint64 index = 0; index < conCount; ++index) { CConcept *concept = conVec->getData(index); if (concept) { ontStructSum->incConceptCount(); inspectConcept(ontology,concept,false,ontStructSum); } } return ontStructSum; } bool COntologyInspector::testOntologyForNonDeterministicConcepts(CConcreteOntology *ontology, COntologyStructureSummary *ontStructSum) { CStructureFlags structureFlags; CTBox *tBox = ontology->getDataBoxes()->getTBox(); CABox* aBox = ontology->getDataBoxes()->getABox(); CConcept *topConcept = ontology->getDataBoxes()->getTopConcept(); CConcept *bottomConcept = ontology->getDataBoxes()->getBottomConcept(); QSet< QPair > singleConNegSet; CDatatypeValueSpacesTriggers* valueSpaceTriggers = ontology->getDataBoxes()->getMBox()->getValueSpacesTriggers(false); if (valueSpaceTriggers) { structureFlags.mValidDeterministic = false; } CBOXSET *conceptHash = tBox->getActiveClassConceptSet(false); if (conceptHash) { for (CBOXSET::const_iterator it = conceptHash->constBegin(), itEnd = conceptHash->constEnd(); it != itEnd && (structureFlags.mValidDeterministic); ++it) { CConcept *concept = (*it); if (concept) { if (concept->getOperatorCode() == CCEQ) { structureFlags.mValidDeterministic = false; } else { analyseConceptStructureFlags(concept,false,singleConNegSet,nullptr,structureFlags); } } } } if (structureFlags.mValidDeterministic && (structureFlags.mUniversalRoleOccurence || structureFlags.mNominalOccurence)) { CBOXSET* individualSet = aBox->getActiveIndividualSet(false); if (individualSet) { for (CBOXSET::const_iterator it = individualSet->constBegin(), itEnd = individualSet->constEnd(); it != itEnd && (structureFlags.mValidDeterministic); ++it) { CIndividual *indi = (*it); if (indi) { CConceptAssertionLinker* assConIt = indi->getAssertionConceptLinker(); while (assConIt) { CConcept* assCon = assConIt->getData(); bool assConNeg = assConIt->isNegated(); analyseConceptStructureFlags(assCon,assConNeg,singleConNegSet,nullptr,structureFlags); assConIt = assConIt->getNext(); } } } } } if (ontStructSum) { ontStructSum->setOnlyDeterministicConceptClasses(structureFlags.mValidDeterministic); } return structureFlags.mValidDeterministic; } bool COntologyInspector::testOntologyForNonELConcepts(CConcreteOntology *ontology, COntologyStructureSummary *ontStructSum) { CStructureFlags structureFlags; CTBox *tBox = ontology->getDataBoxes()->getTBox(); CConcept *topConcept = ontology->getDataBoxes()->getTopConcept(); CConcept *bottomConcept = ontology->getDataBoxes()->getBottomConcept(); QSet< QPair > singleConNegSet; QHash existRoleHash; CDatatypeValueSpacesTriggers* valueSpaceTriggers = ontology->getDataBoxes()->getMBox()->getValueSpacesTriggers(false); if (valueSpaceTriggers) { structureFlags.mValidEL = false; } CBOXSET *conceptHash = tBox->getActiveClassConceptSet(false); if (conceptHash) { for (CBOXSET::const_iterator it = conceptHash->constBegin(), itEnd = conceptHash->constEnd(); it != itEnd && (structureFlags.mValidEL); ++it) { CConcept *concept = (*it); if (concept) { if (concept->getOperatorCode() == CCEQ) { structureFlags.mValidEL = false; } else { analyseConceptStructureFlags(concept,false,singleConNegSet,&existRoleHash,structureFlags); } } } } if (ontStructSum) { ontStructSum->setOnlyELConceptClasses(structureFlags.mValidEL); } return structureFlags.mValidEL; } bool COntologyInspector::analyzeOntologyConceptsStructureFlags(CConcreteOntology *ontology, COntologyStructureSummary *ontStructSum) { CStructureFlags structureFlags; CTBox* tBox = ontology->getDataBoxes()->getTBox(); CABox* aBox = ontology->getDataBoxes()->getABox(); CConcept *topConcept = ontology->getDataBoxes()->getTopConcept(); CConcept *bottomConcept = ontology->getDataBoxes()->getBottomConcept(); QSet< QPair > singleConNegSet; QHash existRoleHash; CDatatypeValueSpacesTriggers* valueSpaceTriggers = ontology->getDataBoxes()->getMBox()->getValueSpacesTriggers(false); if (valueSpaceTriggers) { structureFlags.mValidEL = false; structureFlags.mValidDeterministic = false; } CBOXSET* conceptSet = tBox->getActiveClassConceptSet(false); if (conceptSet) { for (CBOXSET::const_iterator it = conceptSet->constBegin(), itEnd = conceptSet->constEnd(); it != itEnd && (structureFlags.mValidEL || structureFlags.mValidDeterministic || !structureFlags.mNominalOccurence); ++it) { CConcept *concept = (*it); if (concept) { if (concept->getOperatorCode() == CCEQ) { structureFlags.mValidEL = false; structureFlags.mValidDeterministic = false; } else { analyseConceptStructureFlags(concept,false,singleConNegSet,&existRoleHash,structureFlags); } } } } if (structureFlags.mValidDeterministic && (structureFlags.mUniversalRoleOccurence || structureFlags.mNominalOccurence)) { CBOXSET* individualSet = aBox->getActiveIndividualSet(false); if (individualSet) { for (CBOXSET::const_iterator it = individualSet->constBegin(), itEnd = individualSet->constEnd(); it != itEnd && (structureFlags.mValidEL || structureFlags.mValidDeterministic || !structureFlags.mNominalOccurence); ++it) { CIndividual *indi = (*it); if (indi) { CConceptAssertionLinker* assConIt = indi->getAssertionConceptLinker(); while (assConIt) { CConcept* assCon = assConIt->getData(); bool assConNeg = assConIt->isNegated(); analyseConceptStructureFlags(assCon,assConNeg,singleConNegSet,&existRoleHash,structureFlags); assConIt = assConIt->getNext(); } } } } } if (ontStructSum) { ontStructSum->setNominalOccurrence(structureFlags.mNominalOccurence); ontStructSum->setOnlyELConceptClasses(structureFlags.mValidEL); ontStructSum->setOnlyDeterministicConceptClasses(structureFlags.mValidDeterministic); } return structureFlags.mValidEL || structureFlags.mValidDeterministic; } bool COntologyInspector::analyseConceptStructureFlags(CConcept* concept, bool negated, QSet< QPair >& singleConNegSet, QHash* existRoleHash, CStructureFlags& structureFlags) { singleConNegSet.insert(QPair(concept,negated)); QList< QPair > checkConNegList; checkConNegList.append(QPair(concept,negated)); while (!checkConNegList.isEmpty()) { QPair conNegPair(checkConNegList.takeFirst()); CConcept* con = conNegPair.first; bool conNeg = conNegPair.second; CRole* role = con->getRole(); if (role) { if (role->getRoleTag() == 1) { structureFlags.mUniversalRoleOccurence = true; } CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { CRole* superRole = superRoleIt->getData(); CSortedNegLinker* domConIt = superRole->getDomainConceptList(); while (domConIt) { CConcept* domCon = domConIt->getData(); bool domConNeg = domConIt->isNegated(); if (!singleConNegSet.contains(QPair(domCon,domConNeg))) { singleConNegSet.insert(QPair(domCon,domConNeg)); checkConNegList.append(QPair(domCon,domConNeg)); } domConIt = domConIt->getNext(); } CSortedNegLinker* ranConIt = superRole->getRangeConceptList(); if (ranConIt) { structureFlags.mValidEL = false; while (ranConIt) { CConcept* ranCon = ranConIt->getData(); bool ranConNeg = ranConIt->isNegated(); if (!singleConNegSet.contains(QPair(ranCon,ranConNeg))) { singleConNegSet.insert(QPair(ranCon,ranConNeg)); checkConNegList.append(QPair(ranCon,ranConNeg)); } ranConIt = ranConIt->getNext(); } } superRoleIt = superRoleIt->getNext(); } } CIndividual* indi = con->getNominalIndividual(); if (indi) { structureFlags.mValidEL = false; structureFlags.mNominalOccurence = true; } cint64 opCode = con->getOperatorCode(); CConceptOperator* conOperator = con->getConceptOperator(); cint64 param = con->getParameter(); cint64 opCount = con->getOperandCount(); if (!con->hasClassName()) { if (!conNeg && (opCode == CCOR) && opCount > 1 || conNeg && (opCode == CCAND || opCode == CCEQ) && opCount > 1) { structureFlags.mValidDeterministic = false; structureFlags.mValidEL = false; } else if (!conNeg && (opCode == CCATMOST) || conNeg && (opCode == CCATLEAST)) { structureFlags.mValidEL = false; if (opCount >= 1 || !conNeg && (opCode == CCATMOST) && param > 1 || conNeg && (opCode == CCATLEAST) && param > 2) { structureFlags.mValidDeterministic = false; } } else { if (!existRoleHash) { if (!conNeg && opCode == CCALL) { structureFlags.mValidEL = false; } } // TODO: check el, SOME r. and SOME r^-1 is not allowed // TODO: check el, ALL r. translated into automata concept AQALL also not allowed } } if (existRoleHash) { if (conNeg && (opCode == CCSOME) || !conNeg && (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_AQALL_TYPE))) { if (existRoleHash->contains(role)) { if (existRoleHash->value(role) == true) { structureFlags.mValidEL = false; } } else { existRoleHash->insert(role,false); } } if (conNeg && (opCode == CCALL) || !conNeg && (opCode == CCSOME || opCode == CCAQSOME)) { if (existRoleHash->contains(role)) { if (existRoleHash->value(role) == false) { structureFlags.mValidEL = false; } } else { existRoleHash->insert(role,true); } } } if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_DATATYPE_RELATED_TYPE)) { structureFlags.mValidEL = false; } bool inspectOperandsNegated = false; bool inspectOnlySameNegation = false; if (opCode == CCAQCHOOCE) { inspectOnlySameNegation = true; } if (conNeg && (opCode == CCSOME || opCode == CCALL || opCode == CCAND || opCode == CCEQ || opCode == CCOR)) { inspectOperandsNegated = true; } cint64 inspectOperandCount = opCount; if (opCode == CCVARBINDJOIN || opCode == CCPBINDCYCLE || conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_IMPL_TYPE)) { inspectOperandCount = 1; } CSortedNegLinker* opConIt = con->getOperandList(); while (opConIt) { CConcept* opCon = opConIt->getData(); bool opConNeg = opConIt->isNegated()^inspectOperandsNegated; if (inspectOperandCount-- > 0) { if (!inspectOnlySameNegation || opConNeg == conNeg) { if (!singleConNegSet.contains(QPair(opCon,opConNeg))) { singleConNegSet.insert(QPair(opCon,opConNeg)); checkConNegList.append(QPair(opCon,opConNeg)); } } } opConIt = opConIt->getNext(); } } return false; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyContext.cpp0000644000175000017500000000211412520551210025627 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyContext.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyContext::COntologyContext() { } COntologyContext::~COntologyContext() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualProcessData.cpp0000644000175000017500000000450112520551206026700 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualProcessData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CIndividualProcessData::CIndividualProcessData() { } CIndividualProcessData* CIndividualProcessData::initIndividualProcessExtensionData() { mComputedConsequencesCachingData = nullptr; mSatRefLinkingData = nullptr; mBackendCachingData = nullptr; return this; } CComputedConsequencesCachingData* CIndividualProcessData::getComputedConsequencesCachingData() { return mComputedConsequencesCachingData; } CIndividualProcessData* CIndividualProcessData::setComputedConsequencesCachingData(CComputedConsequencesCachingData* computedConsequencesCachingData) { mComputedConsequencesCachingData = computedConsequencesCachingData; return this; } CIndividualSaturationReferenceLinkingData* CIndividualProcessData::getSaturationReferenceLinkingData() { return mSatRefLinkingData; } CIndividualProcessData* CIndividualProcessData::setSaturationReferenceLinkingData(CIndividualSaturationReferenceLinkingData* refLinkingData) { mSatRefLinkingData = refLinkingData; return this; } CIndividualBackendCachingData* CIndividualProcessData::getBackendCachingData() { return mBackendCachingData; } CIndividualProcessData* CIndividualProcessData::setBackendCachingData(CIndividualBackendCachingData* backendCachingData) { mBackendCachingData = backendCachingData; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleDependenceVector.h0000644000175000017500000000405012520551214026161 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CROLEDEPENDENCEVECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CROLEDEPENDENCEVECTOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CRoleDependence.h" #include "CBoxContext.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CRoleDependenceVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleDependenceVector : public CDefaultDynamicReferenceVectorBase { // public methods public: //! Constructor CRoleDependenceVector(CBoxContext* boxContext = nullptr); //! Destructor virtual ~CRoleDependenceVector(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CROLEDEPENDENCEVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyBuildConstructFlags.cpp0000644000175000017500000001016012520551210030124 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyBuildConstructFlags.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyBuildConstructFlags::COntologyBuildConstructFlags(COntologyContext* ontoContext) { mOntoContext = ontoContext; resetFlags(); } COntologyBuildConstructFlags* COntologyBuildConstructFlags::resetFlags() { mNonELConstructUsed = false; mBottomObjectRoleUsed = false; mTopObjectRoleUsed = false; mBottomDataRoleUsed = false; mTopDataRoleUsed = false; mRetractionUsed = false; mNominalSchemaUsed = false; mComplexRoleUsed = false; return this; } COntologyBuildConstructFlags* COntologyBuildConstructFlags::referenceBuildConstructFlags(COntologyBuildConstructFlags* buildConstructFlags) { mNonELConstructUsed = buildConstructFlags->mNonELConstructUsed; mBottomObjectRoleUsed = buildConstructFlags->mBottomObjectRoleUsed; mTopObjectRoleUsed = buildConstructFlags->mTopObjectRoleUsed; mBottomDataRoleUsed = buildConstructFlags->mBottomDataRoleUsed; mTopDataRoleUsed = buildConstructFlags->mTopDataRoleUsed; mRetractionUsed = buildConstructFlags->mRetractionUsed; mNominalSchemaUsed = buildConstructFlags->mNominalSchemaUsed; mComplexRoleUsed = buildConstructFlags->mComplexRoleUsed; return this; } bool COntologyBuildConstructFlags::isBottomObjectRoleUsed() { return mBottomObjectRoleUsed; } COntologyBuildConstructFlags* COntologyBuildConstructFlags::setBottomObjectRoleUsed(bool used) { mBottomObjectRoleUsed = used; return this; } bool COntologyBuildConstructFlags::isTopObjectRoleUsed() { return mTopObjectRoleUsed; } COntologyBuildConstructFlags* COntologyBuildConstructFlags::setTopObjectRoleUsed(bool used) { mTopObjectRoleUsed = used; return this; } bool COntologyBuildConstructFlags::isBottomDataRoleUsed() { return mBottomDataRoleUsed; } COntologyBuildConstructFlags* COntologyBuildConstructFlags::setBottomDataRoleUsed(bool used) { mBottomDataRoleUsed = used; return this; } bool COntologyBuildConstructFlags::isTopDataRoleUsed() { return mTopDataRoleUsed; } COntologyBuildConstructFlags* COntologyBuildConstructFlags::setTopDataRoleUsed(bool used) { mTopDataRoleUsed = used; return this; } bool COntologyBuildConstructFlags::isNonELConstructUsed() { return mNonELConstructUsed; } COntologyBuildConstructFlags* COntologyBuildConstructFlags::setNonELConstructUsed(bool used) { mNonELConstructUsed = used; return this; } bool COntologyBuildConstructFlags::isComplexRoleUsed() { return mComplexRoleUsed; } COntologyBuildConstructFlags* COntologyBuildConstructFlags::setComplexRoleUsed(bool used) { mComplexRoleUsed = used; return this; } bool COntologyBuildConstructFlags::isNominalSchemaUsed() { return mNominalSchemaUsed; } COntologyBuildConstructFlags* COntologyBuildConstructFlags::setNominalSchemaUsed(bool used) { mNominalSchemaUsed = used; return this; } bool COntologyBuildConstructFlags::isRetractionUsed() { return mRetractionUsed; } COntologyBuildConstructFlags* COntologyBuildConstructFlags::setRetractionUsed(bool used) { mRetractionUsed = used; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptRoleBranchingTrigger.cpp0000644000175000017500000000501312520551174030037 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptRoleBranchingTrigger.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptRoleBranchingTrigger::CConceptRoleBranchingTrigger() : CLinkerBase(this) { mTriggerNegation = false; mTriggerConcept = nullptr; mUsedConceptTrigger = true; mTriggerRole = nullptr; } CConceptRoleBranchingTrigger* CConceptRoleBranchingTrigger::initConceptBranchingTrigger(CConcept* triggerConcept, bool triggerNegation) { mTriggerConcept = triggerConcept; mTriggerNegation = triggerNegation; mUsedConceptTrigger = true; return this; } CConceptRoleBranchingTrigger* CConceptRoleBranchingTrigger::initRoleBranchingTrigger(CRole *triggerRole) { mUsedConceptTrigger = false; mTriggerRole = triggerRole; return this; } CConcept* CConceptRoleBranchingTrigger::getTriggerConcept() { return mTriggerConcept; } CRole* CConceptRoleBranchingTrigger::getTriggerRole() { return mTriggerRole; } bool CConceptRoleBranchingTrigger::getTriggerNegation() { return mTriggerNegation; } bool CConceptRoleBranchingTrigger::isConceptTrigger() { return mUsedConceptTrigger; } bool CConceptRoleBranchingTrigger::isRoleTrigger() { return !mUsedConceptTrigger; } CConceptRoleBranchingTrigger::BRANCHINGTRIGGERTYPE CConceptRoleBranchingTrigger::getBranchingTriggerType() { if (mUsedConceptTrigger) { return BTTCONCEPT; } else { return BTTROLE; } } CConceptRoleBranchingTrigger* CConceptRoleBranchingTrigger::getNextBranchingTrigger() { return getNext(); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CABox.h0000644000175000017500000000556412520551172022771 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CABOX_H #define KONCLUDE_REASONER_ONTOLOGY_CABOX_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CIndividual.h" #include "CBoxContext.h" #include "CConcreteOntologyContextBase.h" #include "CIndividualVector.h" #include "CDataBox.h" // Other includes #include "Utilities/CSortedNegLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CABox * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CABox : public CDataBox { // public methods public: //! Constructor CABox(CBoxContext* boxContext = nullptr); //! Destructor virtual ~CABox(); CABox *setIndividualVector(CIndividualVector* roleVec); CIndividualVector* getIndividualVector(bool create = true); qint64 getIndividualCount(); virtual CABox *referenceABox(CABox *aBox); virtual CABox *getABoxReferenceCopy(CBoxContext *boxContext); virtual CBoxContext *getBoxContext(bool create = true); cint64 getUniversalConnectionIndividualID(); CABox* setUniversalConnectionIndividualID(cint64 univConnIndiID); bool hasUniversalConnectionIndividual(); CABox* setHasUniversalConnectionIndividual(bool hasUnivConnIndi); CBOXSET* getActiveIndividualSet(bool create = true); CABox* setActiveIndividualSet(CBOXSET* takeActiveIndividualSet); // protected methods protected: // protected variables protected: cint64 mUnivConnIndiID; bool mHasUnivConnIndiID; CIndividualVector* mIndiVec; CBOXSET* mActiveIndividualSet; CBoxContext *mBoxContext; CBoxContext *mDeleteBoxContext; CMemoryAllocationManager* mMemMan; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CABOX_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CReplacementData.cpp0000644000175000017500000000457012520551214025515 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReplacementData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CReplacementData::CReplacementData() { mCommDisjConLinker = nullptr; mImplicationReplacementConcept = nullptr; } CConcept* CReplacementData::getImplicationReplacementConcept() { return mImplicationReplacementConcept; } CXNegLinker* CReplacementData::getCommonDisjunctConceptLinker() { return mCommDisjConLinker; } CReplacementData* CReplacementData::setImplicationReplacementConcept(CConcept* implConcept) { mImplicationReplacementConcept = implConcept; return this; } CReplacementData* CReplacementData::setCommonDisjunctConceptLinker(CXNegLinker* conLinker) { mCommDisjConLinker = conLinker; return this; } CReplacementData* CReplacementData::addCommonDisjunctConceptLinker(CXNegLinker* conLinker) { if (conLinker) { mCommDisjConLinker = conLinker->append(mCommDisjConLinker); } return this; } CReplacementData* CReplacementData::initReplacementData(CReplacementData* replData) { if (replData) { mImplicationReplacementConcept = replData->mImplicationReplacementConcept; mCommDisjConLinker = replData->mCommDisjConLinker; } else { mImplicationReplacementConcept = nullptr; mCommDisjConLinker = nullptr; } return this; } CReplacementData* CReplacementData::clearCommonDisjunctConceptLinker() { mCommDisjConLinker = nullptr; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceFloatTriggers.h0000644000175000017500000000406012520551202030341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEFLOATTRIGGERS_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEFLOATTRIGGERS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareTriggers.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceFloatTriggers * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceFloatTriggers : public CDatatypeValueSpaceCompareTriggers { // public methods public: //! Constructor CDatatypeValueSpaceFloatTriggers(CBoxContext* boxContext); CDatatypeValueSpaceFloatTriggers* initValueSpaceFloatTriggers(CDatatypeValueSpaceFloatTriggers* data); CDatatypeValueSpaceConceptTriggeringData* getFloatConceptTriggeringData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEFLOATTRIGGERS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryHexDataType.cpp0000644000175000017500000000416312520551200031447 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceBinaryHexDataType.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceBinaryHexDataType::CDatatypeValueSpaceBinaryHexDataType() : CDatatypeValueSpaceCompareType(CDatatypeValueSpaceBinaryHexDataType::VALUESPACEHEXDATATYPE) { mMinValue = new CDataLiteralBinaryHexDataValue(nullptr); mMinValue->initValueFromLength(0); mMaxValue = new CDataLiteralBinaryHexDataValue(nullptr); mMaxValue->initValueFromInfiniteLength(); } CDataLiteralBinaryHexDataValue* CDatatypeValueSpaceBinaryHexDataType::getMinimumDataLiteralBinaryHexDataValue() { return mMinValue; } CDataLiteralBinaryHexDataValue* CDatatypeValueSpaceBinaryHexDataType::getMaximumDataLiteralBinaryHexDataValue() { return mMaxValue; } CDataLiteralCompareValue* CDatatypeValueSpaceBinaryHexDataType::getMinimumDataLiteralCompareValue() { return mMinValue; } CDataLiteralCompareValue* CDatatypeValueSpaceBinaryHexDataType::getMaximumDataLiteralCompareValue() { return mMaxValue; } bool CDatatypeValueSpaceBinaryHexDataType::hasInfiniteManyValues() { return true; } cint64 CDatatypeValueSpaceBinaryHexDataType::getMaximumValueCount() { return CINT64_MAX; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyStringMapping.h0000644000175000017500000000631012520551212026436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYSTRINGMAPPING_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYSTRINGMAPPING_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyContext.h" // Other includes #include "Reasoner/Generator/CStringRefStringHasher.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Generator; namespace Ontology { /*! * * \class COntologyStringMapping * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyStringMapping { // public methods public: //! Constructor COntologyStringMapping(COntologyContext* ontologyContext = nullptr); //! Destructor virtual ~COntologyStringMapping(); COntologyStringMapping* referenceStringMapping(COntologyStringMapping* stringMapping); CMAPPINGHASH* getClassNameConceptMappingHash(bool create = true); CMAPPINGHASH* getPropertyNameRoleMappingHash(bool create = true); CMAPPINGHASH* getIndividualNameIndividualMappingHash(bool create = true); CMAPPINGHASH* getAbbreviatedNamePrefixHash(bool create = true); CMAPPINGHASH* getNamePrefixHash(bool create = true); CMAPPINGLIST* getPrefixList(bool create = true); CConcept* getConceptFromName(const QString& fullClassName); CRole* getRoleFromName(const QString& fullPropertyName); CIndividual* getIndividualFromName(const QString& fullIndividualName); // protected methods protected: // protected variables protected: COntologyContext* mOntoContext; CMAPPINGHASH* mClassNameConceptMapHash; CMAPPINGHASH* mPropertyNameRoleMapHash; CMAPPINGHASH* mIndividualNameIndividualMapHash; CMAPPINGHASH* mAbbreviatedNamePrefixMapHash; CMAPPINGHASH* mNamePrefixMapHash; CMAPPINGLIST* mPrefixList; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYSTRINGMAPPING_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CActiveEntityCountItem.h0000644000175000017500000000434512520551172026374 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CACTIVEENTITYCOUNTITEM_H #define KONCLUDE_REASONER_ONTOLOGY_CACTIVEENTITYCOUNTITEM_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes #include "Utilities/UtilitiesSettings.h" #include "Parser/Expressions/CExpressionEntity.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Parser::Expression; namespace Reasoner { namespace Ontology { /*! * * \class CActiveEntityCountItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CActiveEntityCountItem { // public methods public: //! Constructor CActiveEntityCountItem(); cint64 getActiveCount(); CActiveEntityCountItem* setActiveCount(cint64 activeCount); CActiveEntityCountItem* incActiveCount(cint64 incCount = 1); CActiveEntityCountItem* decActiveCount(cint64 decCount = 1); CActiveEntityCountItem* setEntity(CExpressionEntity* entity); CExpressionEntity* getEntity(); // protected methods protected: // protected variables protected: cint64 mActiveCount; CExpressionEntity* mEntity; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CACTIVEENTITYCOUNTITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStepRequirement.cpp0000644000175000017500000000700612520551212031403 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyProcessingStepRequirement.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyProcessingStepRequirement::COntologyProcessingStepRequirement(COntologyProcessingStep* requiredProcessingStep, cint64 requiredProcessingFlags, cint64 forbiddenProcessingFlags, cint64 requiredErrorFlags, cint64 forbiddenErrorFlags) { mRequiredProcessingStep = requiredProcessingStep; mRequiredProcessingFlags = requiredProcessingFlags; mForbiddenProcessingFlags = forbiddenProcessingFlags; mRequiredErrorFlags = requiredErrorFlags; mForbiddenErrorFlags = forbiddenErrorFlags; } COntologyProcessingStep* COntologyProcessingStepRequirement::getRequiredProcessingStep() { return mRequiredProcessingStep; } COntologyProcessingStepRequirement* COntologyProcessingStepRequirement::setRequiredProcessingStep(COntologyProcessingStep* requiredProcessingStep) { mRequiredProcessingStep = requiredProcessingStep; return this; } bool COntologyProcessingStepRequirement::isRequirementSatisfied(COntology* ontology) { if (ontology) { CConcreteOntology* conOntology = dynamic_cast(ontology); if (conOntology) { COntologyProcessingSteps* processingSteps = conOntology->getProcessingSteps(); if (processingSteps) { COntologyProcessingStepDataVector* proStepDataVec = processingSteps->getOntologyProcessingStepDataVector(); COntologyProcessingStepData* proStepData = proStepDataVec->getProcessingStepData(mRequiredProcessingStep->getProcessingStepID()); if (proStepData) { COntologyProcessingStatus* proStatus = proStepData->getProcessingStatus(); if (!proStatus->hasPartialProcessingFlags(mRequiredProcessingFlags)) { return false; } if (proStatus->hasPartialProcessingFlags(mForbiddenProcessingFlags)) { return false; } if (!proStatus->hasPartialErrorFlags(mRequiredErrorFlags)) { return false; } if (proStatus->hasPartialErrorFlags(mForbiddenErrorFlags)) { return false; } return true; } } } } return false; } COntologyProcessingStepRequirement* COntologyProcessingStepRequirement::submitRequirementUpdate(cint64 processingFlags, cint64 errorFlags) { return this; } const QString COntologyProcessingStepRequirement::getRequirementFailureString(COntology* ontology) { QString failureString; if (!isRequirementSatisfied(ontology)) { failureString = QString("'%1' processing step failed.").arg(mRequiredProcessingStep->getProcessingStepName()); } return failureString; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CAbbreviatedIRIName.cpp0000644000175000017500000001167212520551172026045 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAbbreviatedIRIName.h" namespace Konclude { namespace Reasoner { namespace Ontology { CAbbreviatedIRIName::CAbbreviatedIRIName(CNamePrefix *namePrefix, const QString &nameString) : CIRIName(nameString) { prefix = namePrefix; } CAbbreviatedIRIName *CAbbreviatedIRIName::init(CNamePrefix *namePrefix, const QString &iriNameString) { CIRIName::init(iriNameString); prefix = namePrefix; return this; } CAbbreviatedIRIName::~CAbbreviatedIRIName() { } QString CAbbreviatedIRIName::getIRIName() { return prefix->getPrefixString()+iriString; } QString CAbbreviatedIRIName::getAbbreviatedIRIName() { return iriString; } QString CAbbreviatedIRIName::getAbbreviatedPrefixWithAbbreviatedIRIName(const QString &joiningString) { return prefix->getAbbreviatedPrefixString()+joiningString+iriString; } CNamePrefix *CAbbreviatedIRIName::getNamePrefix() { return prefix; } QStringList CAbbreviatedIRIName::getAbbreviatedIRINames(CLinker *nameLinker, qint64 nameVersionDifference) { QStringList stringList; qint64 firstNameVersion = -1; while (nameLinker) { CName *name = nameLinker->getData(); qint64 nameVerID = name->getNameVersionID(); if (firstNameVersion <= 0) { firstNameVersion = nameVerID; } if (firstNameVersion - nameVerID > nameVersionDifference && nameVersionDifference != -1) { break; } CAbbreviatedIRIName *iriName = dynamic_cast(name); if (iriName) { stringList.append(iriName->getAbbreviatedIRIName()); } nameLinker = nameLinker->getNext(); } return stringList; } QStringList CAbbreviatedIRIName::getAbbreviatedPrefixWithAbbreviatedIRINames(CLinker *nameLinker, qint64 nameVersionDifference, const QString &joiningString) { QStringList stringList; qint64 firstNameVersion = -1; while (nameLinker) { CName *name = nameLinker->getData(); qint64 nameVerID = name->getNameVersionID(); if (firstNameVersion <= 0) { firstNameVersion = nameVerID; } if (firstNameVersion - nameVerID > nameVersionDifference && nameVersionDifference != -1) { break; } CAbbreviatedIRIName *iriName = dynamic_cast(name); if (iriName) { stringList.append(iriName->getAbbreviatedPrefixWithAbbreviatedIRIName(joiningString)); } nameLinker = nameLinker->getNext(); } return stringList; } QString CAbbreviatedIRIName::getRecentAbbreviatedPrefixWithAbbreviatedIRIName(CLinker *nameLinker, qint64 nameVersionDifference, const QString &joiningString) { QString stringName; qint64 firstNameVersion = -1; while (nameLinker) { CName *name = nameLinker->getData(); qint64 nameVerID = name->getNameVersionID(); if (firstNameVersion <= 0) { firstNameVersion = nameVerID; } if (firstNameVersion - nameVerID > nameVersionDifference && nameVersionDifference != -1) { break; } CAbbreviatedIRIName *iriName = dynamic_cast(name); if (iriName) { stringName = iriName->getAbbreviatedPrefixWithAbbreviatedIRIName(joiningString); break; } nameLinker = nameLinker->getNext(); } return stringName; } bool CAbbreviatedIRIName::hasAbbreviatedIRIName(CLinker *nameLinker, CNamePrefix *namePrefix, const QString &checkName, qint64 nameVersionDifference) { qint64 firstNameVersion = -1; while (nameLinker) { CName *name = nameLinker->getData(); qint64 nameVerID = name->getNameVersionID(); if (firstNameVersion <= 0) { firstNameVersion = nameVerID; } if (firstNameVersion - nameVerID > nameVersionDifference && nameVersionDifference != -1) { break; } CAbbreviatedIRIName *iriName = dynamic_cast(name); if (iriName) { if (iriName->getNamePrefix() == namePrefix && checkName == iriName->getAbbreviatedIRIName()) { return true; } } nameLinker = nameLinker->getNext(); } return false; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceType.h0000644000175000017500000000466312520551204026521 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETYPE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETYPE_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceType : public CLinkerBase { // public methods public: enum VALUESPACETYPE { VALUESPACEUNKNOWNTYPE = 0, VALUESPACEREALTYPE = 1, VALUESPACESTRINGTYPE = 2, VALUESPACEBOOLEANTYPE = 3, VALUESPACEDOUBLETYPE = 4, VALUESPACEFLOATTYPE = 5, VALUESPACEIRITYPE = 6, VALUESPACEHEXDATATYPE = 7, VALUESPACEBASE64DATATYPE = 8, VALUESPACEXMLTYPE = 9, VALUESPACEDATETIMETYPE = 10 }; //! Constructor CDatatypeValueSpaceType(VALUESPACETYPE type); VALUESPACETYPE getValueSpaceType(); CDatatypeValueSpaceType* getNextValueSpaceType(); cint64 getValueSpaceTypeIndex(); static cint64 getValueSpaceTypeCount(); const static cint64 VALUESPACETYPECOUNT = 11; // protected methods protected: // protected variables protected: VALUESPACETYPE mType; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACETYPE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyCoreConceptCyclesData.cpp0000644000175000017500000000407112520551210030350 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyCoreConceptCyclesData.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyCoreConceptCyclesData::COntologyCoreConceptCyclesData(COntologyContext* ontoContext) : mContext(ontoContext),mConceptCycleHash(ontoContext),mCycleList(ontoContext) { } COntologyCoreConceptCyclesData::~COntologyCoreConceptCyclesData() { } CBOXHASH* COntologyCoreConceptCyclesData::getConceptCycleHash() { return &mConceptCycleHash; } CBOXLIST* COntologyCoreConceptCyclesData::getConceptCycleList() { return &mCycleList; } cint64 COntologyCoreConceptCyclesData::getConceptCycleCount() { return mCycleList.count(); } COntologyCoreConceptCyclesData* COntologyCoreConceptCyclesData::installCycle(CConceptCycleData* cycleData) { mCycleList.append(cycleData); CBOXSET* conSet = cycleData->getCycleConceptSet(); for (CBOXSET::const_iterator it = conSet->constBegin(), itEnd = conSet->constEnd(); it != itEnd; ++it) { TConceptNegPair conNegPair(*it); mConceptCycleHash.insert(conNegPair,cycleData); } return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceConceptTriggeringData.h0000644000175000017500000000466612520551202032010 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACECONCEPTTRIGGERINGDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACECONCEPTTRIGGERINGDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceConceptTriggerLinker.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceConceptTriggeringData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceConceptTriggeringData { // public methods public: //! Constructor CDatatypeValueSpaceConceptTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* initConceptTriggeringData(CDatatypeValueSpaceConceptTriggeringData* data); bool hasPartialConceptTriggers(); CDatatypeValueSpaceConceptTriggerLinker* getPartialConceptTriggerLinker(); CDatatypeValueSpaceConceptTriggeringData* setPartialConceptTriggerLinker(CDatatypeValueSpaceConceptTriggerLinker* conceptTiggerLinker); CDatatypeValueSpaceConceptTriggeringData* appendPartialConceptTriggers(CDatatypeValueSpaceConceptTriggerLinker* conceptTiggerLinker); // protected methods protected: // protected variables protected: CDatatypeValueSpaceConceptTriggerLinker* mPartialTriggerLinker; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACECONCEPTTRIGGERINGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringIterator.cpp0000644000175000017500000000524312520551204031741 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceTriggeringIterator.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceTriggeringIterator::CDatatypeValueSpaceTriggeringIterator(const CBOXMAP::const_iterator beginIt, const CBOXMAP::const_iterator endIt, bool upIteration) { mBegIt = beginIt; mCurIt = mBegIt; mEndIt = endIt; mLastIt = endIt; mUpIteration = upIteration; } CDatatypeValueSpaceTriggeringIterator::CDatatypeValueSpaceTriggeringIterator(const CBOXMAP::const_iterator beginIt, const CBOXMAP::const_iterator lastIt, const CBOXMAP::const_iterator endIt, bool upIteration) { mBegIt = beginIt; mCurIt = mBegIt; mEndIt = endIt; mLastIt = lastIt; mUpIteration = upIteration; } bool CDatatypeValueSpaceTriggeringIterator::hasNext() { if (mCurIt != mEndIt) { return true; } return false; } CDatatypeValueSpaceTriggeringData* CDatatypeValueSpaceTriggeringIterator::next(bool moveNext) { CDatatypeValueSpaceTriggeringData* triggerData = nullptr; if (mCurIt != mEndIt) { const CDatatypeValueSpaceTriggeringMapData& mapData = mCurIt.value(); triggerData = mapData.mUseValue; if (moveNext) { if (mCurIt == mLastIt) { mCurIt = mEndIt; } else { if (mUpIteration) { ++mCurIt; } else { --mCurIt; } } } } return triggerData; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceDoubleType.h0000644000175000017500000000447612520551202027654 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEDOUBLETYPE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEDOUBLETYPE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareType.h" #include "CDataLiteralDoubleValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceDoubleType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceDoubleType : public CDatatypeValueSpaceCompareType { // public methods public: //! Constructor CDatatypeValueSpaceDoubleType(); CDataLiteralDoubleValue* getMinimumDataLiteralDoubleValue(); CDataLiteralDoubleValue* getMaximumDataLiteralDoubleValue(); virtual CDataLiteralCompareValue* getMinimumDataLiteralCompareValue(); virtual CDataLiteralCompareValue* getMaximumDataLiteralCompareValue(); virtual bool hasInfiniteManyValues(); virtual cint64 getMaximumValueCount(); // protected methods protected: // protected variables protected: CDataLiteralDoubleValue* mMinValue; CDataLiteralDoubleValue* mMaxValue; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEDOUBLETYPE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceDateTimeType.h0000644000175000017500000000453312520551202030130 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEDATETIMETYPE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEDATETIMETYPE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareType.h" #include "CDataLiteralDateTimeValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceDateTimeType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceDateTimeType : public CDatatypeValueSpaceCompareType { // public methods public: //! Constructor CDatatypeValueSpaceDateTimeType(); CDataLiteralDateTimeValue* getMinimumDataLiteralDateTimeValue(); CDataLiteralDateTimeValue* getMaximumDataLiteralDateTimeValue(); virtual CDataLiteralCompareValue* getMinimumDataLiteralCompareValue(); virtual CDataLiteralCompareValue* getMaximumDataLiteralCompareValue(); virtual bool hasInfiniteManyValues(); virtual cint64 getMaximumValueCount(); // protected methods protected: // protected variables protected: CDataLiteralDateTimeValue* mMinValue; CDataLiteralDateTimeValue* mMaxValue; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEDATETIMETYPE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceConceptTriggerLinker.cpp0000644000175000017500000000320012520551202032177 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceConceptTriggerLinker.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceConceptTriggerLinker::CDatatypeValueSpaceConceptTriggerLinker() : CLinkerBase(nullptr) { } CDatatypeValueSpaceConceptTriggerLinker* CDatatypeValueSpaceConceptTriggerLinker::initConceptTrigger(CConcept* triggerConcept) { setData(triggerConcept); return this; } CDatatypeValueSpaceConceptTriggerLinker* CDatatypeValueSpaceConceptTriggerLinker::setConceptTrigger(CConcept* triggerConcept) { setData(triggerConcept); return this; } CConcept* CDatatypeValueSpaceConceptTriggerLinker::getTriggerConcept() { return getData(); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptAssertionLinker.cpp0000644000175000017500000000205612520551174027116 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptAssertionLinker.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptAssertionLinker::CConceptAssertionLinker() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CActiveEntityIterator.cpp0000644000175000017500000000317012520551172026604 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CActiveEntityIterator.h" namespace Konclude { namespace Reasoner { namespace Ontology { CActiveEntityIterator::CActiveEntityIterator(CActiveEntityCountItem* countVector, cint64 vecSize) { mCountVector = countVector; mVectorSize = vecSize; mCurrIndex = 0; } bool CActiveEntityIterator::hasNextActiveEntity() { if (mCountVector && mCurrIndex < mVectorSize) { return true; } return false; } CExpressionEntity* CActiveEntityIterator::getNextActiveEntity(bool moveNext) { if (mCountVector && mCurrIndex < mVectorSize) { CExpressionEntity* entity = mCountVector[mCurrIndex].getEntity(); if (moveNext) { ++mCurrIndex; } return entity; } return nullptr; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualDependenceVector.h0000644000175000017500000000415212520551206027354 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALDEPENDENCEVECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALDEPENDENCEVECTOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CIndividualDependence.h" #include "CBoxContext.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CIndividualDependenceVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualDependenceVector : public CDefaultDynamicReferenceVectorBase { // public methods public: //! Constructor CIndividualDependenceVector(CBoxContext* boxContext = nullptr); //! Destructor virtual ~CIndividualDependenceVector(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALDEPENDENCEVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CNamedItem.cpp0000644000175000017500000000302612520551206024323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNamedItem.h" namespace Konclude { namespace Reasoner { namespace Ontology { CNamedItem::CNamedItem() { mNameLinker = 0; } CNamedItem::~CNamedItem() { } bool CNamedItem::hasName() { return mNameLinker; } CNamedItem *CNamedItem::setNameLinker(CLinker *nameLinker) { mNameLinker = nameLinker; return this; } CNamedItem *CNamedItem::addNameLinker(CLinker *nameLinker) { if (nameLinker) { nameLinker->append(mNameLinker); mNameLinker = nameLinker; } return this; } CLinker *CNamedItem::getNameLinker() { return mNameLinker; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConcreteOntologyContextBase.cpp0000644000175000017500000000406512520551176030127 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteOntologyContextBase.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConcreteOntologyContextBase::CConcreteOntologyContextBase() { mPoolProvider = new CNewAllocationMemoryPoolProvider(); mMemMan = new CMemoryPoolAllocationManager(mPoolProvider); mOntMemMan = nullptr; mObjCon = nullptr; } CConcreteOntologyContextBase::~CConcreteOntologyContextBase() { delete mMemMan; delete mPoolProvider; delete mOntMemMan; delete mObjCon; } CMemoryAllocationManager* CConcreteOntologyContextBase::getMemoryAllocationManager() { return mMemMan; } CMemoryPoolProvider* CConcreteOntologyContextBase::getMemoryPoolProvider() { return mPoolProvider; } CObjectContainer *CConcreteOntologyContextBase::getObjectContainer(bool create) { if (!mObjCon && create) { mObjCon = new CObjectContainer(); } return mObjCon; } COntologyContextMemoryManager *CConcreteOntologyContextBase::getOnologyMemoryManager(COntologyContextMemoryManagerProvider *provider) { if (!mOntMemMan && provider) { mOntMemMan = provider->getOntologyMemoryManager(); } return mOntMemMan; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyBuildData.h0000644000175000017500000002604212520551210025507 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYBUILDDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYBUILDDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyContext.h" #include "CConcept.h" #include "CRole.h" #include "CIndividual.h" #include "COntologyImportData.h" #include "COntologyBuildExpressionCounter.h" // Other includes #include "Parser/Expressions/CAxiomExpression.h" #include "Parser/Expressions/CClassAxiomExpression.h" #include "Parser/Expressions/CClassTermExpression.h" #include "Parser/Expressions/CClassExpression.h" #include "Parser/Expressions/CObjectPropertyExpression.h" #include "Parser/Expressions/CObjectPropertyExpression.h" #include "Parser/Expressions/CIndividualTermExpression.h" #include "Parser/Expressions/CNamedIndividualExpression.h" #include "Parser/Expressions/CAnonymousIndividualExpression.h" #include "Parser/Expressions/CObjectPropertyAxiomExpression.h" #include "Parser/Expressions/CDeclarationAxiomExpression.h" #include "Parser/Expressions/CAssertionAxiomExpression.h" #include "Parser/Expressions/CObjectIndividualVariableExpression.h" #include "Parser/Expressions/CDataPropertyTermExpression.h" #include "Parser/Expressions/CDataRangeTermExpression.h" #include "Parser/Expressions/CDatatypeExpression.h" #include "Parser/Expressions/CDataLexicalValueExpression.h" #include "Parser/Expressions/CDataPropertyExpression.h" #include "Parser/Expressions/CDataFacetExpression.h" #include "Reasoner/Generator/CExpressionHasher.h" #include "Reasoner/Generator/CStringRefStringHasher.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Parser::Expression; namespace Reasoner { using namespace Generator; namespace Ontology { /*! * * \class COntologyBuildData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyBuildData { // public methods public: //! Constructor COntologyBuildData(COntologyContext* ontoContext = nullptr); //! Destructor virtual ~COntologyBuildData(); COntologyBuildData* referenceBuildData(COntologyBuildData* buildData); CONTOLOGYAXIOMSET* getTellAxiomSet(); CONTOLOGYAXIOMSET* getRetractAxiomSet(); CONTOLOGYAXIOMSET* getUpdatedTellAxiomSet(); CONTOLOGYAXIOMSET* getUpdatedRetractAxiomSet(); CONTOLOGYAXIOMLIST< QPair >* getChangeAxiomList(); CONTOLOGYAXIOMLIST< QPair >* getUpdatedChangeAxiomList(); CClassTermExpression* getTopClassExpression(); CClassTermExpression* getBottomClassExpression(); CDataRangeTermExpression* getTopDataRangeExpression(); CDataRangeTermExpression* getBottomDataRangeExpression(); CBUILDSET* getDeclarationAxiomSet(); CObjectPropertyTermExpression* getTopObjectPropertyExpression(); CObjectPropertyTermExpression* getBottomObjectPropertyExpression(); CDataPropertyTermExpression* getTopDataPropertyExpression(); CDataPropertyTermExpression* getBottomDataPropertyExpression(); COntologyBuildData* setTopClassExpression(CClassTermExpression* topClassExp); COntologyBuildData* setBottomClassExpression(CClassTermExpression* bottomClassExp); COntologyBuildData* setTopDataRangeExpression(CDataRangeTermExpression* dataRangeExp); COntologyBuildData* setBottomDataRangeExpression(CDataRangeTermExpression* dataRangeExp); COntologyBuildData* setTopObjectPropertyExpression(CObjectPropertyTermExpression* topObjectPropertyExp); COntologyBuildData* setBottomObjectPropertyExpression(CObjectPropertyTermExpression* bottomObjectPropertyExp); COntologyBuildData* setTopDataPropertyExpression(CDataPropertyTermExpression* dataPropertyExp); COntologyBuildData* setBottomDataPropertyExpression(CDataPropertyTermExpression* dataPropertyExp); CBUILDHASH* getStructuralExpressionBuildHash(); CBUILDLIST* getExpressionBuildListContainer(); CBUILDHASH* getClassEntityBuildHash(); CBUILDHASH* getObjectPropertyEntityBuildHash(); CBUILDHASH* getIndividualEntityBuildHash(); CBUILDHASH,CAnonymousIndividualExpression*>* getAnonymousIndividualBuildHash(); CBUILDHASH,CObjectIndividualVariableExpression*>* getIndividualVariableBuildHash(); CBUILDHASH* getDatatypeIRIBuildHash(); CBUILDHASH* getFacetIRIBuildHash(); CBUILDHASH* getDataPropertyEntityBuildHash(); CBUILDHASH* getDataLexicalValueBuildHash(); CBUILDHASH* getInverseObjectPropertyHash(); CBUILDLIST< QPair >* getInverseObjectPropertyList(); CBUILDHASH* getIndividualVariableIDHash(); CBUILDSET* getBuildConceptSet(); CBUILDSET* getBuildObjectRoleSet(); CBUILDSET* getBuildIndividualSet(); CBUILDSET* getBuildDataRoleSet(); CBUILDSET* getBuildDataRangeSet(); CBUILDSET* getBuildDatatypeSet(); CBUILDLIST* getBuildConceptList(); CBUILDLIST* getBuildObjectRoleList(); CBUILDLIST* getBuildDataRoleList(); CBUILDLIST* getBuildIndividualList(); CBUILDLIST* getBuildDataRangeList(); CBUILDLIST* getBuildDatatypeList(); cint64 getNextAxiomNumber(bool moveNext = false); COntologyBuildData* setNextAxiomNumber(cint64 axiomNumber); cint64 getNextEntityNumber(bool moveNext = false); COntologyBuildData* setNextEntityNumber(cint64 entityNumber); CBUILDHASH* getImportDataHash(); COntologyBuildExpressionCounter* getBuildExpressionCounter(); // protected methods protected: // protected variables protected: COntologyContext* mOntoContext; COntologyBuildExpressionCounter mExpressionCounter; // contains also previous ontology data CONTOLOGYAXIOMSET* mTellAxiomSet; CONTOLOGYAXIOMSET* mRetractAxiomSet; CONTOLOGYAXIOMLIST< QPair >* mChangeAxiomList; // contains only updated data CONTOLOGYAXIOMSET* mTellUpdatedAxiomSet; CONTOLOGYAXIOMSET* mRetractUpdatedAxiomSet; CONTOLOGYAXIOMLIST< QPair >* mChangeUpdatedAxiomList; cint64 mAxiomNumber; cint64 mEntityNumber; CBUILDSET* mDeclarationAxiomSet; CBUILDHASH* mIndividualVariableIDHash; // contains also previous ontology data, // exact build expression identification CClassTermExpression* mTopClassExpression; CClassTermExpression* mBottomClassExpression; CObjectPropertyTermExpression* mTopObjPropExpression; CObjectPropertyTermExpression* mBottomObjPropExpression; CDataRangeTermExpression* mTopDataRangeExpression; CDataRangeTermExpression* mBottomDataRangeExpression; CDataPropertyTermExpression* mTopDataPropExpression; CDataPropertyTermExpression* mBottomDataPropExpression; CBUILDHASH* mExpressionBuildHash; CBUILDHASH* mClassBuildHash; CBUILDHASH* mObjectPropertyBuildHash; CBUILDHASH* mIndividualBuildHash; CBUILDHASH,CAnonymousIndividualExpression*>* mAnoIndividualBuildHash; CBUILDHASH,CObjectIndividualVariableExpression*>* mIndividualVariableBuildHash; CBUILDHASH* mDatatypeIRIDatatypeBuildHash; CBUILDHASH* mDataPropertyBuildHash; CBUILDHASH* mDataLexicalValueBuildHash; CBUILDHASH* mFacetIRIFacetBuildHash; CBUILDHASH* mImportDataHash; // mapping hashes and container CBUILDLIST* mExpressionBuildListContainer; CBUILDHASH* mInverseObjectPropertyHash; CBUILDLIST< QPair >* mInverseObjectPropertyList; CBUILDSET* mBuildConceptSet; CBUILDSET* mBuildObjectRoleSet; CBUILDSET* mBuildDataRoleSet; CBUILDSET* mBuildIndividualSet; CBUILDSET* mBuildDatatypeSet; CBUILDSET* mBuildDataRangesSet; CBUILDLIST* mBuildIndividualList; CBUILDLIST* mBuildObjectRoleList; CBUILDLIST* mBuildDataRoleList; CBUILDLIST* mBuildConceptList; CBUILDLIST* mBuildDatatypeList; CBUILDLIST* mBuildDataRangesList; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYBUILDDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralValue.h0000644000175000017500000000402612520551200025303 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATALITERALVALUE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATALITERALVALUE_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataLiteralValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralValue { // public methods public: enum DATA_LITERAL_VALUE_TYPE { DLVT_REAL, DLVT_STRING, DLVT_BOOLEAN, DLVT_DOUBLE, DLVT_FLOAT, DLVT_IRI, DLVT_HEXBINARY, DLVT_BASE64BINARY, DLVT_XML, DLVT_DATETIME }; virtual DATA_LITERAL_VALUE_TYPE getDataValueType() = 0; virtual bool isEqualTo(CDataLiteralValue* value) = 0; virtual QString getValueString(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATALITERALVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringMapData.cpp0000644000175000017500000000251112520551204031452 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceTriggeringMapData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceTriggeringMapData::CDatatypeValueSpaceTriggeringMapData() { mLocValue = nullptr; mUseValue = nullptr; } CDatatypeValueSpaceTriggeringMapData::CDatatypeValueSpaceTriggeringMapData(const CDatatypeValueSpaceTriggeringMapData& data) { mUseValue = data.mUseValue; mLocValue = nullptr; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceDateTimeTriggers.cpp0000644000175000017500000000304612520551202031326 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceDateTimeTriggers.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceDateTimeTriggers::CDatatypeValueSpaceDateTimeTriggers(CBoxContext* boxContext) : CDatatypeValueSpaceCompareTriggers(boxContext) { } CDatatypeValueSpaceDateTimeTriggers* CDatatypeValueSpaceDateTimeTriggers::initValueSpaceDateTimeTriggers(CDatatypeValueSpaceDateTimeTriggers* data) { initValueSpaceCompareTriggers(data); return this; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceDateTimeTriggers::getDateTimeConceptTriggeringData() { return getValueSpaceConceptTriggeringData(); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceStringTriggers.h0000644000175000017500000000474512520551202030554 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDatatypeValueSpaceStringTriggers_H #define KONCLUDE_REASONER_ONTOLOGY_CDatatypeValueSpaceStringTriggers_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareTriggers.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceStringTriggers * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceStringTriggers : public CDatatypeValueSpaceCompareTriggers { // public methods public: //! Constructor CDatatypeValueSpaceStringTriggers(CBoxContext* boxContext); CDatatypeValueSpaceStringTriggers* initValueSpaceStringTriggers(CDatatypeValueSpaceStringTriggers* data); CDatatypeValueSpaceConceptTriggeringData* getStringConceptTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* getNonLanguageTagConceptTriggeringData(); CDatatypeValueSpaceStringTriggers* addStringConceptTrigger(CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger); CDatatypeValueSpaceStringTriggers* addNonLanguageTagConceptTrigger(CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger); // protected methods protected: // protected variables protected: CDatatypeValueSpaceConceptTriggeringData mValueSpateNonLanguageTagTriggerData; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDatatypeValueSpaceStringTriggers_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRBox.h0000644000175000017500000000650512520551214023003 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CRBOX_H #define KONCLUDE_REASONER_ONTOLOGY_CRBOX_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CRole.h" #include "CRoleChain.h" #include "CBoxContext.h" #include "CConcreteOntologyContextBase.h" #include "CRoleVector.h" #include "CDataBox.h" #include "CRoleChainVector.h" // Other includes #include "Utilities/CSortedNegLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CRBox * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRBox : public CDataBox { // public methods public: //! Constructor CRBox(CBoxContext* boxContext = nullptr); //! Destructor virtual ~CRBox(); CRBox *setRoleVector(CRoleVector* roleVec); CRoleVector* getRoleVector(bool create = true); CRBox *setRoleChainVector(CRoleChainVector* roleChainVec); CRoleChainVector* getRoleChainVector(bool create = true); qint64 getRoleCount(); qint64 getRoleChainCount(); virtual CRBox *referenceRBox(CRBox *rBox); virtual CRBox *getRBoxReferenceCopy(CBoxContext *boxContext); virtual CBoxContext *getBoxContext(bool create = true); CRole* getTopObjectRole(); CRBox* setTopObjectRole(CRole* role); CRole* getBottomObjectRole(); CRBox* setBottomObjectRole(CRole* role); cint64 getTopObjectRoleIndex(); cint64 getBottomObjectRoleIndex(); CRole* getTopDataRole(); CRBox* setTopDataRole(CRole* role); CRole* getBottomDataRole(); CRBox* setBottomDataRole(CRole* role); cint64 getTopDataRoleIndex(); cint64 getBottomDataRoleIndex(); CBOXSET* getActivePropertyRoleSet(bool create = true); CRBox* setActivePropertyRoleSet(CBOXSET* takeActiveRoleSet); // protected methods protected: // protected variables protected: CRoleVector* roles; CRoleChainVector* mRoleChainVec; CBoxContext* mBoxContext; CBoxContext* mDeleteBoxContext; CMemoryAllocationManager* mMemMan; cint64 mTopObjectRoleTag; cint64 mBottomObjectRoleTag; cint64 mTopDataRoleTag; cint64 mBottomDataRoleTag; CBOXSET* mActiveRoleSet; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CRBOX_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CTBox.cpp0000644000175000017500000004642612520551216023350 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTBox.h" namespace Konclude { namespace Reasoner { namespace Ontology { CTBox::CTBox(CBoxContext* boxContext) { mBoxContext = boxContext; mMemMan = CContext::getMemoryAllocationManager(mBoxContext); concepts = nullptr; mDeleteBoxContext = nullptr; mTriggerImpHash = nullptr; mEquivConCandidateHash = nullptr; mCandidateEquivConHash = nullptr; mEquivConNonCandidateSet = nullptr; mRoleDomainTriggerConceptHash = nullptr; mIndividualTriggerConceptHash = nullptr; mUnivConnNomValueCon = nullptr; gciConceptSet = 0; activeConceptSet = 0; mBottomConceptIndex = 0; mTopConceptIndex = 1; mIndividualTriggerConceptIndex = 2; mTopDataRangeConceptIndex = 3; mDatatypeVector = nullptr; } CTBox::~CTBox() { delete mDeleteBoxContext; COPADestroyAndRelease(gciConceptSet,mMemMan); COPADestroyAndRelease(activeConceptSet,mMemMan); COPADestroyAndRelease(concepts,mMemMan); COPADestroyAndRelease(mTriggerImpHash,mMemMan); COPADestroyAndRelease(mEquivConCandidateHash,mMemMan); COPADestroyAndRelease(mCandidateEquivConHash,mMemMan); COPADestroyAndRelease(mEquivConNonCandidateSet,mMemMan); COPADestroyAndRelease(mRoleDomainTriggerConceptHash,mMemMan); COPADestroyAndRelease(mIndividualTriggerConceptHash,mMemMan); COPADestroyAndRelease(mDatatypeVector,mMemMan); } cint64 CTBox::getTopConceptIndex() { return mTopConceptIndex; } cint64 CTBox::getBottomConceptIndex() { return mBottomConceptIndex; } cint64 CTBox::getIndividualTriggerConceptIndex() { return mIndividualTriggerConceptIndex; } cint64 CTBox::getTopDataRangeConceptIndex() { return mTopDataRangeConceptIndex; } CConcept* CTBox::getTopConcept() { CConcept* concept = nullptr; if (concepts) { concept = concepts->getData(mTopConceptIndex); } return concept; } CConcept* CTBox::getTopDataRangeConcept() { CConcept* concept = nullptr; if (concepts) { concept = concepts->getData(mTopDataRangeConceptIndex); } return concept; } CConcept* CTBox::getIndividualTriggerConcept() { CConcept* concept = nullptr; if (concepts) { concept = concepts->getData(mIndividualTriggerConceptIndex); } return concept; } CConcept* CTBox::getBottomConcept() { CConcept* concept = nullptr; if (concepts) { concept = concepts->getData(mBottomConceptIndex); } return concept; } CTBox* CTBox::setTopConcept(CConcept* topConcept) { getConceptVector(true)->setData(mTopConceptIndex,topConcept); return this; } CTBox* CTBox::setBottomConcept(CConcept* bottomConcept) { getConceptVector(true)->setData(mBottomConceptIndex,bottomConcept); return this; } CTBox* CTBox::setIndividualTriggerConcept(CConcept* indTrigConcept) { getConceptVector(true)->setData(mIndividualTriggerConceptIndex,indTrigConcept); return this; } CTBox* CTBox::setTopDataRangeConcept(CConcept* topDataRangeConcept) { getConceptVector(true)->setData(mTopDataRangeConceptIndex,topDataRangeConcept); return this; } CBOXSET* CTBox::getGCIConceptSet() { return gciConceptSet; } CTBox *CTBox::setGCIConceptSet(CBOXSET* takeContainsSet) { COPADestroyAndRelease(gciConceptSet,mMemMan); gciConceptSet = takeContainsSet; return this; } CBOXSET *CTBox::getActiveClassConceptSet(bool create) { if (!activeConceptSet && create) { activeConceptSet = CObjectParameterizingAllocator< CBOXSET,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return activeConceptSet; } CTBox *CTBox::setActiveClassConceptSet(CBOXSET* takeActiveConceptSet) { COPADestroyAndRelease(activeConceptSet,mMemMan); activeConceptSet = takeActiveConceptSet; return this; } CBOXHASH* CTBox::getTriggerImplicationHash(bool create) { if (!mTriggerImpHash && create) { mTriggerImpHash = CObjectParameterizingAllocator< CBOXHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mTriggerImpHash; } CBOXHASH* CTBox::getEquivalentConceptCandidateHash(bool create) { if (!mEquivConCandidateHash && create) { mEquivConCandidateHash = CObjectParameterizingAllocator< CBOXHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mEquivConCandidateHash; } CBOXHASH* CTBox::getCandidateEquivalentConceptHash(bool create) { if (!mCandidateEquivConHash && create) { mCandidateEquivConHash = CObjectParameterizingAllocator< CBOXHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mCandidateEquivConHash; } CBOXSET* CTBox::getEquivalentConceptNonCandidateSet(bool create) { if (!mEquivConNonCandidateSet && create) { mEquivConNonCandidateSet = CObjectParameterizingAllocator< CBOXSET,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mEquivConNonCandidateSet; } CBOXHASH* CTBox::getRoleDomainTriggerConceptHash(bool create) { if (!mRoleDomainTriggerConceptHash && create) { mRoleDomainTriggerConceptHash = CObjectParameterizingAllocator< CBOXHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mRoleDomainTriggerConceptHash; } CBOXHASH* CTBox::getIndividualTriggerConceptHash(bool create) { if (!mIndividualTriggerConceptHash && create) { mIndividualTriggerConceptHash = CObjectParameterizingAllocator< CBOXHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mIndividualTriggerConceptHash; } CTBox* CTBox::setTriggerImplicationHash(CBOXHASH* takeTriggerImplHash) { COPADestroyAndRelease(mTriggerImpHash,mMemMan); mTriggerImpHash = takeTriggerImplHash; return this; } CTBox *CTBox::setConceptVector(CConceptVector* takeConceptVec) { COPADestroyAndRelease(concepts,mMemMan); concepts = takeConceptVec; return this; } CConceptVector* CTBox::getConceptVector(bool create) { if (!concepts && create) { concepts = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return concepts; } qint64 CTBox::getConceptCount() { cint64 conCount = 0; if (concepts) { conCount = concepts->getItemCount(); } return conCount; } CTBox *CTBox::getTBoxReferenceCopy(CBoxContext* boxContext) { CTBox *tBox = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(boxContext),boxContext); tBox->referenceTBox(this); return tBox; } CDatatypeVector *CTBox::getDatatypeVector(bool create) { if (!mDatatypeVector && create) { mDatatypeVector = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mDatatypeVector; } CTBox *CTBox::setDatatypeVector(CDatatypeVector* datatypeVector) { COPADestroyAndRelease(mDatatypeVector,mMemMan); mDatatypeVector = datatypeVector; return this; } CTBox *CTBox::referenceTBox(CTBox *tBox) { if (tBox->concepts) { getConceptVector(); concepts->referenceVector(tBox->concepts); } else if (concepts) { concepts->clear(); } if (tBox->mDatatypeVector) { getDatatypeVector(); mDatatypeVector->referenceVector(tBox->mDatatypeVector); } else if (mDatatypeVector) { mDatatypeVector->clear(); } if (tBox->gciConceptSet) { if (!gciConceptSet) { gciConceptSet = CObjectParameterizingAllocator< CBOXSET,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } gciConceptSet->init(tBox->gciConceptSet,mBoxContext); } else if (gciConceptSet) { gciConceptSet->clear(); } if (tBox->activeConceptSet) { if (!activeConceptSet) { activeConceptSet = CObjectParameterizingAllocator< CBOXSET,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } activeConceptSet->init(tBox->activeConceptSet,mBoxContext); } else if (activeConceptSet) { activeConceptSet->clear(); } mUnivConnNomValueCon = tBox->mUnivConnNomValueCon; if (tBox->mIndividualTriggerConceptHash) { if (!mIndividualTriggerConceptHash) { mIndividualTriggerConceptHash = CObjectParameterizingAllocator< CBOXHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } mIndividualTriggerConceptHash->init(tBox->mIndividualTriggerConceptHash,mBoxContext); } else if (mIndividualTriggerConceptHash) { mIndividualTriggerConceptHash->clear(); } if (tBox->mEquivConCandidateHash) { if (!mEquivConCandidateHash) { mEquivConCandidateHash = CObjectParameterizingAllocator< CBOXHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } mEquivConCandidateHash->init(tBox->mEquivConCandidateHash,mBoxContext); } else if (mEquivConCandidateHash) { mEquivConCandidateHash->clear(); } if (tBox->mCandidateEquivConHash) { if (!mCandidateEquivConHash) { mCandidateEquivConHash = CObjectParameterizingAllocator< CBOXHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } mCandidateEquivConHash->init(tBox->mCandidateEquivConHash,mBoxContext); } else if (mCandidateEquivConHash) { mCandidateEquivConHash->clear(); } if (tBox->mEquivConNonCandidateSet) { if (!mEquivConNonCandidateSet) { mEquivConNonCandidateSet = CObjectParameterizingAllocator< CBOXSET,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } mEquivConNonCandidateSet->init(tBox->mEquivConNonCandidateSet,mBoxContext); } else if (mEquivConNonCandidateSet) { mEquivConNonCandidateSet->clear(); } return this; } CBoxContext *CTBox::getBoxContext(bool create) { if (!mBoxContext && create) { mBoxContext = new CConcreteOntologyContextBase(); mDeleteBoxContext = mBoxContext; } return mBoxContext; } QString CTBox::getTBoxString() { QString tboxString; if (concepts) { for (qint64 i = 0; i < concepts->getItemCount(); ++i) { CConcept *concept = concepts->getData(i); if (concept) { QString conceptString = QString::number(i); while (conceptString.length() <= 5) { conceptString.insert(0," "); } conceptString += ","; qint64 conOpCode = concept->getOperatorCode(); QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); if (!iriClassNameString.isEmpty()) { conceptString += iriClassNameString + " = "; } else { conceptString += " = "; } CRole *role = concept->getRole(); QString paramString = QString::number(concept->getParameter()); QString roleString; if (role) { roleString = QString::number(role->getRoleTag()); } CIndividual* indi = concept->getNominalIndividual(); QString indiString; if (indi) { indiString = QString::number(indi->getIndividualID()); } if (conOpCode == CCNONE) { conceptString += "( ATOM )"; } else if (conOpCode == CCTOP) { conceptString += "( TOP "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCBOTTOM) { conceptString += "( BOTTOM )"; } else if (conOpCode == CCAND) { conceptString += "( AND "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCAQAND) { conceptString += "( AQAND "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCIMPLAQAND) { conceptString += "( IMPLAQAND "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCBRANCHAQAND) { conceptString += "( BRANCHAQAND "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCPBINDAQAND) { conceptString += "( PBINDAQAND "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCVARBINDAQAND) { conceptString += "( VARBINDAQAND "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCVARPBACKAQAND) { conceptString += "( VARPBACKAQAND "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCEQ) { conceptString += "( EQ "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCSUB) { conceptString += "( SUB "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCIMPLTRIG) { conceptString += "( IMPTRIGGER "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCBRANCHTRIG) { conceptString += "( BRANCHTRIG "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCPBINDTRIG) { conceptString += "( PBINDTRIG "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCVARBINDTRIG) { conceptString += "( VARBINDTRIG "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCVARPBACKTRIG) { conceptString += "( VARPBACKTRIG "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCBACKACTIVTRIG) { conceptString += "( BACKACTIVTRIG "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCOR) { conceptString += "( OR "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCAQCHOOCE) { conceptString += "( AQCHOOCE "+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCSOME) { conceptString += QString("( SOME %1. ").arg(roleString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCSELF) { conceptString += QString("( SELF %1. ").arg(roleString)+")"; } else if (conOpCode == CCNOMINAL) { conceptString += QString("( NOMINAL %1. ").arg(indiString)+")"; } else if (conOpCode == CCAQSOME) { conceptString += QString("( AQSOME %1. ").arg(roleString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCATLEAST) { conceptString += QString("( ATLEAST %1. [%2] ").arg(roleString).arg(paramString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCATMOST) { conceptString += QString("( ATMOST %1. [%2] ").arg(roleString).arg(paramString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCALL) { conceptString += QString("( ALL %1. ").arg(roleString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCIMPLALL) { conceptString += QString("( IMPLALL %1. ").arg(roleString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCBRANCHALL) { conceptString += QString("( BRANCHALL %1. ").arg(roleString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCPBINDALL) { conceptString += QString("( PBINDALL %1. ").arg(roleString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCVARBINDALL) { conceptString += QString("( VARBINDALL %1. ").arg(roleString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCVARPBACKALL) { conceptString += QString("( VARPBACKALL %1. ").arg(roleString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCIMPLAQALL) { conceptString += QString("( IMPLAQALL %1. ").arg(roleString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCAQALL) { conceptString += QString("( AQALL %1. ").arg(roleString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCBRANCHAQALL) { conceptString += QString("( BRANCHAQALL %1. ").arg(roleString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCPBINDAQALL) { conceptString += QString("( PBINDAQALL %1. ").arg(roleString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCVARBINDAQALL) { conceptString += QString("( VARBINDAQALL %1. ").arg(roleString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCVARPBACKAQALL) { conceptString += QString("( VARPBACKAQALL %1. ").arg(roleString)+getConceptOperandString(concept->getOperandList())+")"; } else if (conOpCode == CCNOT) { conceptString += "( NOT "+getConceptOperandString(concept->getOperandList())+")"; } conceptString += "\r\n"; tboxString += conceptString; } } } return tboxString; } QString CTBox::getConceptOperandString(CSortedNegLinker *ops) { QString conceptString; while (ops) { if (ops->isNegated()) { conceptString += "-"; } conceptString += QString::number(ops->getData()->getConceptTag()) + " "; ops = ops->getNext(); } return conceptString; } CConcept* CTBox::getUniversalConnectionNominalValueConcept() { return mUnivConnNomValueCon; } CTBox* CTBox::setUniversalConnectionNominalValueConcept(CConcept* valueCon) { mUnivConnNomValueCon = valueCon; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralFloatValue.h0000644000175000017500000000561412520551200026275 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATALITERALFLOATVALUE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATALITERALFLOATVALUE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDataLiteralValue.h" #include "CDataLiteralCompareValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataLiteralFloatValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralFloatValue : public CDataLiteralCompareValue { // public methods public: //! Constructor CDataLiteralFloatValue(); virtual CDataLiteralCompareValue* initValue(CDataLiteralCompareValue* value); CDataLiteralFloatValue* initValueFromFloat(float floatValue); CDataLiteralFloatValue* initValueFromInfinite(bool negative); CDataLiteralFloatValue* initValue(CDataLiteralFloatValue* value); CDataLiteralFloatValue* clearValue(); virtual DATA_LITERAL_VALUE_TYPE getDataValueType(); float getFloat(); bool isInfinite(); bool isNegative(); bool isEqualTo(CDataLiteralValue* value); bool isLessEqualThan(CDataLiteralCompareValue* value); bool isLessThan(CDataLiteralCompareValue* value); bool isEqualTo(CDataLiteralCompareValue* value); bool isGreaterEqualThan(CDataLiteralCompareValue* value); bool isGreaterThan(CDataLiteralCompareValue* value); bool isLessEqualThan(CDataLiteralFloatValue* value); bool isLessThan(CDataLiteralFloatValue* value); bool isEqualTo(CDataLiteralFloatValue* value); bool isGreaterEqualThan(CDataLiteralFloatValue* value); bool isGreaterThan(CDataLiteralFloatValue* value); // protected methods protected: // protected variables protected: float mFloat; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATALITERALFLOATVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleProcessData.cpp0000644000175000017500000000255712520551214025521 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleProcessData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CRoleProcessData::CRoleProcessData() { mInferRelevantFlag = false; } CRoleProcessData* CRoleProcessData::initRoleProcessExtensionData() { return this; } bool CRoleProcessData::hasInferRelevantFlag() { return mInferRelevantFlag; } CRoleProcessData* CRoleProcessData::setInferRelevantFlag(bool flag) { mInferRelevantFlag = flag; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CReverseRoleAssertionLinker.cpp0000644000175000017500000000320512520551214027750 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReverseRoleAssertionLinker.h" namespace Konclude { namespace Reasoner { namespace Ontology { CReverseRoleAssertionLinker::CReverseRoleAssertionLinker() { mIndividual = nullptr; } CReverseRoleAssertionLinker* CReverseRoleAssertionLinker::initReverseRoleAssertionLinker(CRoleAssertionLinker* roleAss, CIndividual* individual) { setData(roleAss); mIndividual = individual; return this; } CIndividual* CReverseRoleAssertionLinker::getIndividual() { return mIndividual; } CRoleAssertionLinker* CReverseRoleAssertionLinker::getRoleAssertion() { return getData(); } CRole* CReverseRoleAssertionLinker::getRole() { if (getData()) { return getData()->getRole(); } return nullptr; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceRealType.cpp0000644000175000017500000000374512520551202027656 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceRealType.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceRealType::CDatatypeValueSpaceRealType() : CDatatypeValueSpaceCompareType(CDatatypeValueSpaceRealType::VALUESPACEREALTYPE) { mMinValue = new CDataLiteralRealValue(); mMinValue->initRationalValueFromInfinite(true); mMaxValue = new CDataLiteralRealValue(); mMaxValue->initRationalValueFromInfinite(false); } CDataLiteralRealValue* CDatatypeValueSpaceRealType::getMinimumDataLiteralRealValue() { return mMinValue; } CDataLiteralRealValue* CDatatypeValueSpaceRealType::getMaximumDataLiteralRealValue() { return mMaxValue; } CDataLiteralCompareValue* CDatatypeValueSpaceRealType::getMinimumDataLiteralCompareValue() { return mMinValue; } CDataLiteralCompareValue* CDatatypeValueSpaceRealType::getMaximumDataLiteralCompareValue() { return mMaxValue; } bool CDatatypeValueSpaceRealType::hasInfiniteManyValues() { return true; } cint64 CDatatypeValueSpaceRealType::getMaximumValueCount() { return CINT64_MAX; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceType.cpp0000644000175000017500000000312112520551204027040 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceType.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceType::CDatatypeValueSpaceType(CDatatypeValueSpaceType::VALUESPACETYPE type) : CLinkerBase(this) { mType = type; } CDatatypeValueSpaceType::VALUESPACETYPE CDatatypeValueSpaceType::getValueSpaceType() { return mType; } CDatatypeValueSpaceType* CDatatypeValueSpaceType::getNextValueSpaceType() { return getNext(); } cint64 CDatatypeValueSpaceType::getValueSpaceTypeIndex() { return (cint64)mType; } cint64 CDatatypeValueSpaceType::getValueSpaceTypeCount() { return VALUESPACETYPECOUNT; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryHexDataTriggers.h0000644000175000017500000000420012520551200031751 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBINARYHEXDATATRIGGERS_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBINARYHEXDATATRIGGERS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareTriggers.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceBinaryHexDataTriggers * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceBinaryHexDataTriggers : public CDatatypeValueSpaceCompareTriggers { // public methods public: //! Constructor CDatatypeValueSpaceBinaryHexDataTriggers(CBoxContext* boxContext); CDatatypeValueSpaceBinaryHexDataTriggers* initValueSpaceBinaryHexDataTriggers(CDatatypeValueSpaceBinaryHexDataTriggers* data); CDatatypeValueSpaceConceptTriggeringData* getBinaryHexDataConceptTriggeringData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBINARYHEXDATATRIGGERS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/0000755000175000017500000000000012613407256023130 5ustar jonasjonas././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextMemoryManagerProvider.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextMemoryManagerProvider0000644000175000017500000000421312520551172032526 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXTMEMORYMANAGERPROVIDER_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXTMEMORYMANAGERPROVIDER_H // Libraries includes // Namespace includes #include "MemorySettings.h" #include "COntologyContextMemoryManager.h" // Other includes #include "Utilities/CAllocationObject.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { namespace Memory { /*! * * \class COntologyContextMemoryManagerProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyContextMemoryManagerProvider : public CAllocationObject { // public methods public: //! Constructor COntologyContextMemoryManagerProvider(); //! Destructor virtual ~COntologyContextMemoryManagerProvider(); virtual COntologyContextMemoryManager *getOntologyMemoryManager() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXTMEMORYMANAGERPROVIDER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextMemoryManager.cpp0000644000175000017500000000230412520551172031573 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyContextMemoryManager.h" namespace Konclude { namespace Reasoner { namespace Ontology { namespace Memory { COntologyContextMemoryManager::COntologyContextMemoryManager() { } COntologyContextMemoryManager::~COntologyContextMemoryManager() { } }; // end namespace Memory }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextCollectionMemoryManagerSingletonProvider.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextCollectionMemoryManag0000644000175000017500000000502412520551172032501 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXTCOLLECTIONMEMORYMANAGERSINGLETONPROVIDER_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXTCOLLECTIONMEMORYMANAGERSINGLETONPROVIDER_H // Libraries includes // Namespace includes #include "COntologyContextMemoryManager.h" #include "COntologyContextCollectionMemoryManager.h" #include "COntologyContextMemoryManagerProvider.h" // Other includes #include "Utilities/CAllocationObject.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { namespace Memory { /*! * * \class COntologyContextCollectionMemoryManagerSingletonProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyContextCollectionMemoryManagerSingletonProvider : public COntologyContextMemoryManagerProvider { // public methods public: //! Constructor COntologyContextCollectionMemoryManagerSingletonProvider(); //! Destructor virtual ~COntologyContextCollectionMemoryManagerSingletonProvider(); virtual COntologyContextMemoryManager *getOntologyMemoryManager(); static COntologyContextCollectionMemoryManagerSingletonProvider *getInstance(); // protected methods protected: // protected variables protected: static COntologyContextCollectionMemoryManagerSingletonProvider *instance; // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXTCOLLECTIONMEMORYMANAGERSINGLETONPROVIDER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/MemorySettings.h0000644000175000017500000000304512520551172026266 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_MEMORY_MEMORYSETTINGS #define KONCLUDE_REASONER_ONTOLOGY_MEMORY_MEMORYSETTINGS // Libraries includes #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Reasoner { namespace Ontology { namespace Memory { /*! * * \file MemorySettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class COntologyContextMemoryManager; class COntologyContextMemoryManagerProvider; }; // end namespace Memory }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_ONTOLOGY_MEMORY_MEMORYSETTINGS././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextCollectionMemoryManagerSingletonProvider.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextCollectionMemoryManag0000644000175000017500000000402212520551172032476 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyContextCollectionMemoryManagerSingletonProvider.h" namespace Konclude { namespace Reasoner { namespace Ontology { namespace Memory { COntologyContextCollectionMemoryManagerSingletonProvider *COntologyContextCollectionMemoryManagerSingletonProvider::instance = 0; COntologyContextCollectionMemoryManagerSingletonProvider::COntologyContextCollectionMemoryManagerSingletonProvider() { } COntologyContextCollectionMemoryManagerSingletonProvider::~COntologyContextCollectionMemoryManagerSingletonProvider() { } COntologyContextMemoryManager *COntologyContextCollectionMemoryManagerSingletonProvider::getOntologyMemoryManager() { return new COntologyContextCollectionMemoryManager(); } COntologyContextCollectionMemoryManagerSingletonProvider *COntologyContextCollectionMemoryManagerSingletonProvider::getInstance() { if (instance == 0) { // not thread safe, but not really problematic if concurrent threads create more as one instances instance = new COntologyContextCollectionMemoryManagerSingletonProvider(); } return instance; } }; // end namespace Memory }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextMemoryManagerProvider.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextMemoryManagerProvider0000644000175000017500000000235412520551172032532 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyContextMemoryManagerProvider.h" namespace Konclude { namespace Reasoner { namespace Ontology { namespace Memory { COntologyContextMemoryManagerProvider::COntologyContextMemoryManagerProvider() { } COntologyContextMemoryManagerProvider::~COntologyContextMemoryManagerProvider() { } }; // end namespace Memory }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextSingleMemoryManager.h0000644000175000017500000000434712520551172032413 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_MEMORY_CONTOLOGYCONTEXTSINGLEMEMORYMANAGER_H #define KONCLUDE_REASONER_ONTOLOGY_MEMORY_CONTOLOGYCONTEXTSINGLEMEMORYMANAGER_H // Libraries includes // Namespace includes #include "COntologyContextMemoryManager.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Utilities/CObjectContainer.h" #include "Utilities/CSortedLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { namespace Memory { /*! * * \class COntologyContextSingleMemoryManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyContextSingleMemoryManager : public COntologyContextMemoryManager { // public methods public: //! Constructor COntologyContextSingleMemoryManager(); //! Destructor virtual ~COntologyContextSingleMemoryManager(); virtual COntologyContextMemoryManager *addObjectToContainer(CAllocationObject *allocObject, CObjectContainer *container); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_MEMORY_CONTOLOGYCONTEXTSINGLEMEMORYMANAGER_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextSingleMemoryManager.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextSingleMemoryManager.c0000644000175000017500000000310712520551172032377 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyContextSingleMemoryManager.h" namespace Konclude { namespace Reasoner { namespace Ontology { namespace Memory { COntologyContextSingleMemoryManager::COntologyContextSingleMemoryManager() { } COntologyContextSingleMemoryManager::~COntologyContextSingleMemoryManager() { } COntologyContextMemoryManager *COntologyContextSingleMemoryManager::addObjectToContainer(CAllocationObject *allocObject, CObjectContainer *container) { if (container) { CAllocationLinker *allocLinker = new CAllocationLinker(); allocLinker->init(allocObject); container->addObject(allocLinker); } return this; } }; // end namespace Memory }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextSingleMemoryManagerSingletonProvider.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextSingleMemoryManagerSi0000644000175000017500000000374212520551172032457 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyContextSingleMemoryManagerSingletonProvider.h" namespace Konclude { namespace Reasoner { namespace Ontology { namespace Memory { COntologyContextSingleMemoryManagerSingletonProvider *COntologyContextSingleMemoryManagerSingletonProvider::instance = 0; COntologyContextSingleMemoryManagerSingletonProvider::COntologyContextSingleMemoryManagerSingletonProvider() { } COntologyContextSingleMemoryManagerSingletonProvider::~COntologyContextSingleMemoryManagerSingletonProvider() { } COntologyContextMemoryManager *COntologyContextSingleMemoryManagerSingletonProvider::getOntologyMemoryManager() { return new COntologyContextSingleMemoryManager(); } COntologyContextSingleMemoryManagerSingletonProvider *COntologyContextSingleMemoryManagerSingletonProvider::getInstance() { if (instance == 0) { // not thread safe, but not really problematic if concurrent threads create more as one instances instance = new COntologyContextSingleMemoryManagerSingletonProvider(); } return instance; } }; // end namespace Memory }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextMemoryManager.h0000644000175000017500000000440012520551172031237 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXTMEMORYMANAGER_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXTMEMORYMANAGER_H // Libraries includes // Namespace includes #include "MemorySettings.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Utilities/CMemoryManager.hpp" #include "Utilities/CObjectContainer.h" #include "Utilities/CSortedLinker.hpp" #include "Utilities/CAllocationObject.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { namespace Memory { /*! * * \class COntologyContextMemoryManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyContextMemoryManager : public CAllocationObject { // public methods public: //! Constructor COntologyContextMemoryManager(); //! Destructor virtual ~COntologyContextMemoryManager(); virtual COntologyContextMemoryManager *addObjectToContainer(CAllocationObject *allocObject, CObjectContainer *container) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXTMEMORYMANAGER_H ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextSingleMemoryManagerSingletonProvider.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextSingleMemoryManagerSi0000644000175000017500000000475412520551172032463 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXTSINGLEMEMORYMANAGERSINGLETONPROVIDER_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXTSINGLEMEMORYMANAGERSINGLETONPROVIDER_H // Libraries includes // Namespace includes #include "COntologyContextMemoryManager.h" #include "COntologyContextSingleMemoryManager.h" #include "COntologyContextMemoryManagerProvider.h" // Other includes #include "Utilities/CAllocationObject.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { namespace Memory { /*! * * \class COntologyContextSingleMemoryManagerSingletonProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyContextSingleMemoryManagerSingletonProvider : public COntologyContextMemoryManagerProvider { // public methods public: //! Constructor COntologyContextSingleMemoryManagerSingletonProvider(); //! Destructor virtual ~COntologyContextSingleMemoryManagerSingletonProvider(); virtual COntologyContextMemoryManager *getOntologyMemoryManager(); static COntologyContextSingleMemoryManagerSingletonProvider *getInstance(); // protected methods protected: // protected variables protected: static COntologyContextSingleMemoryManagerSingletonProvider *instance; // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYCONTEXTSINGLEMEMORYMANAGERSINGLETONPROVIDER_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextCollectionMemoryManager.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextCollectionMemoryManag0000644000175000017500000000331412520551172032501 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyContextCollectionMemoryManager.h" namespace Konclude { namespace Reasoner { namespace Ontology { namespace Memory { COntologyContextCollectionMemoryManager::COntologyContextCollectionMemoryManager() { allocLinkerMem = new CDynamicExpandingMemoryManager(); } COntologyContextCollectionMemoryManager::~COntologyContextCollectionMemoryManager() { delete allocLinkerMem; } COntologyContextMemoryManager *COntologyContextCollectionMemoryManager::addObjectToContainer(CAllocationObject *allocObject, CObjectContainer *container) { if (container) { CAllocationLinker *allocLinker = allocLinkerMem->allocate(); allocLinker->init(allocObject); container->addObject(allocLinker); } return this; } }; // end namespace Memory }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextCollectionMemoryManager.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/Memory/COntologyContextCollectionMemoryManag0000644000175000017500000000467012520551172032507 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_MEMORY_CONTOLOGYCONTEXTCOLLECTIONMEMORYMANAGER_H #define KONCLUDE_REASONER_ONTOLOGY_MEMORY_CONTOLOGYCONTEXTCOLLECTIONMEMORYMANAGER_H // Libraries includes // Namespace includes #include "COntologyContextMemoryManager.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Utilities/CMemoryManager.hpp" #include "Utilities/CDynamicExpandingMemoryManager.hpp" #include "Utilities/CObjectContainer.h" #include "Utilities/CSortedLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { namespace Memory { /*! * * \class COntologyContextCollectionMemoryManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyContextCollectionMemoryManager : public COntologyContextMemoryManager { // public methods public: //! Constructor COntologyContextCollectionMemoryManager(); //! Destructor virtual ~COntologyContextCollectionMemoryManager(); virtual COntologyContextMemoryManager *addObjectToContainer(CAllocationObject *allocObject, CObjectContainer *container); // protected methods protected: // protected variables protected: CMemoryManager *allocLinkerMem; // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Process }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_MEMORY_CONTOLOGYCONTEXTCOLLECTIONMEMORYMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralBinaryHexDataValue.cpp0000644000175000017500000000242512520551176030257 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralBinaryHexDataValue.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDataLiteralBinaryHexDataValue::CDataLiteralBinaryHexDataValue(CContext* context) : CDataLiteralBinaryDataValue(context) { } CDataLiteralValue::DATA_LITERAL_VALUE_TYPE CDataLiteralBinaryHexDataValue::getDataValueType() { return CDataLiteralValue::DLVT_HEXBINARY; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CBranchingTriggerVector.h0000644000175000017500000000412412520551174026533 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CBRANCHINGTRIGGERVECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CBRANCHINGTRIGGERVECTOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CBoxContext.h" #include "CConceptRoleBranchingTrigger.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CBranchingTriggerVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBranchingTriggerVector : public CDefaultDynamicReferenceVectorBase { // public methods public: //! Constructor CBranchingTriggerVector(CBoxContext* boxContext = nullptr); //! Destructor virtual ~CBranchingTriggerVector(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CBRANCHINGTRIGGERVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralDoubleValue.cpp0000644000175000017500000001146712520551176027014 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralDoubleValue.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDataLiteralDoubleValue::CDataLiteralDoubleValue() { clearValue(); } CDataLiteralValue::DATA_LITERAL_VALUE_TYPE CDataLiteralDoubleValue::getDataValueType() { return CDataLiteralValue::DLVT_DOUBLE; } CDataLiteralCompareValue* CDataLiteralDoubleValue::initValue(CDataLiteralCompareValue* value) { clearValue(); CDataLiteralDoubleValue* doubleValue = dynamic_cast(value); if (doubleValue) { mDouble = doubleValue->mDouble; } return this; } CDataLiteralDoubleValue* CDataLiteralDoubleValue::initValueFromDouble(double doubleValue) { clearValue(); mDouble = doubleValue; return this; } CDataLiteralDoubleValue* CDataLiteralDoubleValue::initValueFromInfinite(bool negative) { clearValue(); if (negative) { mDouble = -std::numeric_limits::infinity(); } else { mDouble = std::numeric_limits::infinity(); } return this; } CDataLiteralDoubleValue* CDataLiteralDoubleValue::initValue(CDataLiteralDoubleValue* value) { if (value) { mDouble = value->mDouble; } return this; } CDataLiteralDoubleValue* CDataLiteralDoubleValue::clearValue() { mDouble = 0.; return this; } double CDataLiteralDoubleValue::getDouble() { return mDouble; } bool CDataLiteralDoubleValue::isInfinite() { if (mDouble >= std::numeric_limits::infinity()) { return true; } if (mDouble <= -std::numeric_limits::infinity()) { return true; } return false; } bool CDataLiteralDoubleValue::isNegative() { return mDouble < 0; } bool CDataLiteralDoubleValue::isEqualTo(CDataLiteralValue* value) { CDataLiteralDoubleValue* doubleValue = dynamic_cast(value); if (doubleValue) { return isEqualTo(doubleValue); } return false; } bool CDataLiteralDoubleValue::isLessEqualThan(CDataLiteralCompareValue* value) { CDataLiteralDoubleValue* doubleValue = dynamic_cast(value); if (doubleValue) { return isEqualTo(doubleValue) || isLessThan(doubleValue); } return false; } bool CDataLiteralDoubleValue::isLessEqualThan(CDataLiteralDoubleValue* doubleValue) { return isEqualTo(doubleValue) || isLessThan(doubleValue); } bool CDataLiteralDoubleValue::isEqualTo(CDataLiteralCompareValue* value) { CDataLiteralDoubleValue* doubleValue = dynamic_cast(value); if (doubleValue) { return isEqualTo(doubleValue); } return false; } bool CDataLiteralDoubleValue::isEqualTo(CDataLiteralDoubleValue* doubleValue) { return mDouble == doubleValue->mDouble; } bool CDataLiteralDoubleValue::isGreaterEqualThan(CDataLiteralDoubleValue* doubleValue) { return isEqualTo(doubleValue) || isGreaterThan(doubleValue); } bool CDataLiteralDoubleValue::isGreaterEqualThan(CDataLiteralCompareValue* value) { CDataLiteralDoubleValue* doubleValue = dynamic_cast(value); if (doubleValue) { return isEqualTo(doubleValue) || isGreaterThan(doubleValue); } return false; } bool CDataLiteralDoubleValue::isGreaterThan(CDataLiteralCompareValue* value) { return value->isLessThan(this); } bool CDataLiteralDoubleValue::isGreaterThan(CDataLiteralDoubleValue* doubleValue) { return doubleValue->isLessThan(this); } bool CDataLiteralDoubleValue::isLessThan(CDataLiteralCompareValue* value) { CDataLiteralDoubleValue* doubleValue = dynamic_cast(value); if (doubleValue) { return isLessThan(doubleValue); } return false; } bool CDataLiteralDoubleValue::isLessThan(CDataLiteralDoubleValue* doubleValue) { if (mDouble < doubleValue->mDouble) { return true; } else { return false; } } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyBuildExpressionCounter.h0000644000175000017500000001041012520551210030325 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYBUILDEXPRESSIONCOUNTER_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYBUILDEXPRESSIONCOUNTER_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyContext.h" // Other includes #include "Parser/Expressions/CBuildExpression.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Parser::Expression; namespace Reasoner { namespace Ontology { /*! * * \class COntologyBuildExpressionCounter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyBuildExpressionCounter { // public methods public: //! Constructor COntologyBuildExpressionCounter(COntologyContext* ontoContext = nullptr); COntologyBuildExpressionCounter* referenceBuildExpressionCounter(COntologyBuildExpressionCounter* buildExpCounter); cint64& getBuildExpressionCount(CBuildExpression::ExpressionType expType); COntologyBuildExpressionCounter* incBuildExpressionCount(CBuildExpression::ExpressionType expType, cint64 incCount = 1); COntologyBuildExpressionCounter* resetBuildExpressionCount(); bool hasBuildExpressions(CBuildExpression::ExpressionType expType); cint64 getMinimumMaxObjectCardinality(); cint64 getMaximumMaxObjectCardinality(); cint64 getMinimumMinObjectCardinality(); cint64 getMaximumMinObjectCardinality(); COntologyBuildExpressionCounter* setMinObjectCardinalityMinimumMaximumCandidate(cint64 cardinality); COntologyBuildExpressionCounter* setMaxObjectCardinalityMinimumMaximumCandidate(cint64 cardinality); cint64 getMinimumMaxDataCardinality(); cint64 getMaximumMaxDataCardinality(); cint64 getMinimumMinDataCardinality(); cint64 getMaximumMinDataCardinality(); COntologyBuildExpressionCounter* setMinDataCardinalityMinimumMaximumCandidate(cint64 cardinality); COntologyBuildExpressionCounter* setMaxDataCardinalityMinimumMaximumCandidate(cint64 cardinality); COntologyBuildExpressionCounter* incRefferedBottomClassCount(cint64 incCount = 1); cint64 getRefferedBottomClassCount(); COntologyBuildExpressionCounter* incRefferedBottomObjectPropertyCount(cint64 incCount = 1); cint64 getRefferedBottomObjectPropertyCount(); COntologyBuildExpressionCounter* incRefferedBottomDataPropertyCount(cint64 incCount = 1); cint64 getRefferedBottomDataPropertyCount(); bool hasConsistencyProblematicExpressions(); // protected methods protected: // protected variables protected: COntologyContext* mOntoContext; const static cint64 mExpTypeCount = 200; cint64* mExpCountVec; cint64 mMinimumMaxObjectCardinality; cint64 mMaximumMaxObjectCardinality; cint64 mMinimumMinObjectCardinality; cint64 mMaximumMinObjectCardinality; cint64 mMinimumMinDataCardinality; cint64 mMaximumMinDataCardinality; cint64 mMinimumMaxDataCardinality; cint64 mMaximumMaxDataCardinality; cint64 mRefferedBottomClassCount; cint64 mRefferedBottomObjectPropertyCount; cint64 mRefferedBottomDataPropertyCount; bool mConsistencyProblematicExpressions; bool mConsistencyProblematicExpressionsChecked; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYBUILDEXPRESSIONCOUNTER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualDependence.h0000644000175000017500000000476012520551206026176 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALDEPENDENCE_H #define KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALDEPENDENCE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CIndividual.h" // Other includes #include "Utilities/CSortedNegLinker.hpp" #include "Utilities/CAllocationObject.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CIndividualDependence * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualDependence : public CAllocationObject { // public methods public: //! Constructor CIndividualDependence(); //! Destructor virtual ~CIndividualDependence(); CIndividualDependence *init(CIndividual *indi); CIndividualDependence *init(qint64 indiTag, CIndividualDependence *indiDep, CMemoryManager > *linkerMemMan); qint64 getIndividualDependenceTag(); CIndividualDependence *setIndividualDependenceTag(qint64 tag); CIndividualDependence *setConceptDependenceList(CSortedNegLinker *conceptList); CIndividualDependence *addConceptDependenceLinker(CSortedNegLinker *conceptLinker); CSortedNegLinker *getConceptDependenceList(); // protected methods protected: // private methods private: // private variables private: qint64 indiDepTag; CSortedNegLinker *conceptDepsLinker; }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALDEPENDENCE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CTBox.h0000644000175000017500000001152212520551216023002 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CTBOX_H #define KONCLUDE_REASONER_ONTOLOGY_CTBOX_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CConcept.h" #include "CBoxContext.h" #include "CConcreteOntologyContextBase.h" #include "CConceptVector.h" #include "CDataBox.h" #include "CIRIName.h" #include "CIndividual.h" #include "CDatatypeVector.h" // Other includes #include "Utilities/CSortedNegLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CTBox * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTBox : public CDataBox { // public methods public: //! Constructor CTBox(CBoxContext* boxContext = nullptr); //! Destructor virtual ~CTBox(); CTBox *setConceptVector(CConceptVector* takeConceptVec); CConceptVector* getConceptVector(bool create = true); qint64 getConceptCount(); CTBox *referenceTBox(CTBox *tBox); CTBox *getTBoxReferenceCopy(CBoxContext* boxContext = nullptr); virtual CBoxContext *getBoxContext(bool create = true); CConcept* getTopDataRangeConcept(); CConcept* getTopConcept(); CConcept* getBottomConcept(); CConcept* getIndividualTriggerConcept(); CTBox* setTopConcept(CConcept* topConcept); CTBox* setBottomConcept(CConcept* bottomConcept); CTBox* setIndividualTriggerConcept(CConcept* indTrigConcept); CTBox* setTopDataRangeConcept(CConcept* topDataRangeConcept); QString getTBoxString(); QString getConceptOperandString(CSortedNegLinker *ops); CBOXSET *getGCIConceptSet(); CTBox *setGCIConceptSet(CBOXSET* takeContainsSet); CBOXSET *getActiveClassConceptSet(bool create = true); CTBox *setActiveClassConceptSet(CBOXSET* takeActiveConceptSet); CBOXHASH* getTriggerImplicationHash(bool create = true); CTBox* setTriggerImplicationHash(CBOXHASH* takeTriggerImplHash); CBOXHASH* getEquivalentConceptCandidateHash(bool create = true); CBOXHASH* getCandidateEquivalentConceptHash(bool create = true); CBOXSET* getEquivalentConceptNonCandidateSet(bool create = true); CBOXHASH* getRoleDomainTriggerConceptHash(bool create = true); CBOXHASH* getIndividualTriggerConceptHash(bool create = true); cint64 getTopConceptIndex(); cint64 getBottomConceptIndex(); cint64 getIndividualTriggerConceptIndex(); cint64 getTopDataRangeConceptIndex(); CConcept* getUniversalConnectionNominalValueConcept(); CTBox* setUniversalConnectionNominalValueConcept(CConcept* valueCon); CDatatypeVector* getDatatypeVector(bool create = true); CTBox* setDatatypeVector(CDatatypeVector* datatypeVector); // protected methods protected: // protected variables protected: CConceptVector* concepts; CConcept* mUnivConnNomValueCon; CBoxContext *mBoxContext; CBoxContext *mDeleteBoxContext; CMemoryAllocationManager* mMemMan; CBOXSET *gciConceptSet; CBOXSET *activeConceptSet; CBOXHASH* mTriggerImpHash; CDatatypeVector* mDatatypeVector; CBOXHASH* mEquivConCandidateHash; CBOXHASH* mCandidateEquivConHash; CBOXSET* mEquivConNonCandidateSet; CBOXHASH* mRoleDomainTriggerConceptHash; CBOXHASH* mIndividualTriggerConceptHash; cint64 mTopConceptIndex; cint64 mBottomConceptIndex; cint64 mIndividualTriggerConceptIndex; cint64 mTopDataRangeConceptIndex; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CTBOX_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceXMLType.cpp0000644000175000017500000000370012520551204027424 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceXMLType.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceXMLType::CDatatypeValueSpaceXMLType() : CDatatypeValueSpaceCompareType(CDatatypeValueSpaceXMLType::VALUESPACEXMLTYPE) { mMinValue = new CDataLiteralXMLValue(); mMinValue->initValueFromLength(0); mMaxValue = new CDataLiteralXMLValue(); mMaxValue->initValueFromInfiniteLength(); } CDataLiteralXMLValue* CDatatypeValueSpaceXMLType::getMinimumDataLiteralXMLValue() { return mMinValue; } CDataLiteralXMLValue* CDatatypeValueSpaceXMLType::getMaximumDataLiteralXMLValue() { return mMaxValue; } CDataLiteralCompareValue* CDatatypeValueSpaceXMLType::getMinimumDataLiteralCompareValue() { return mMinValue; } CDataLiteralCompareValue* CDatatypeValueSpaceXMLType::getMaximumDataLiteralCompareValue() { return mMaxValue; } bool CDatatypeValueSpaceXMLType::hasInfiniteManyValues() { return true; } cint64 CDatatypeValueSpaceXMLType::getMaximumValueCount() { return CINT64_MAX; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptTagComparer.h0000644000175000017500000000450612520551176025657 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTTAGCOMPARER_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTTAGCOMPARER_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CConcept.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CConceptTagComparer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptTagComparer { // public methods public: //! Constructor inline CConceptTagComparer(CConcept* concept) { mConcept = concept; } inline bool operator<(const CConceptTagComparer& conTagComp) const { return mConcept->getConceptTag() < conTagComp.mConcept->getConceptTag(); } inline bool operator<=(const CConceptTagComparer& conTagComp) const { return mConcept->getConceptTag() <= conTagComp.mConcept->getConceptTag(); } inline bool operator==(const CConceptTagComparer& conTagComp) const { return mConcept->getConceptTag() == conTagComp.mConcept->getConceptTag(); } inline CConcept* getConcept() const { return mConcept; } // protected methods protected: // protected variables protected: CConcept* mConcept; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTTAGCOMPARER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CActiveEntityCountItem.cpp0000644000175000017500000000345612520551172026731 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CActiveEntityCountItem.h" namespace Konclude { namespace Reasoner { namespace Ontology { CActiveEntityCountItem::CActiveEntityCountItem() { mActiveCount = 0; mEntity = nullptr; } cint64 CActiveEntityCountItem::getActiveCount() { return mActiveCount; } CActiveEntityCountItem* CActiveEntityCountItem::setActiveCount(cint64 activeCount) { mActiveCount = activeCount; return this; } CActiveEntityCountItem* CActiveEntityCountItem::incActiveCount(cint64 incCount) { mActiveCount += incCount; return this; } CActiveEntityCountItem* CActiveEntityCountItem::decActiveCount(cint64 decCount) { mActiveCount -= decCount; return this; } CActiveEntityCountItem* CActiveEntityCountItem::setEntity(CExpressionEntity* entity) { mEntity = entity; return this; } CExpressionEntity* CActiveEntityCountItem::getEntity() { return mEntity; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptReferenceLinking.h0000644000175000017500000000331612520551174026661 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTREFERENCELINKING_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTREFERENCELINKING_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CConceptReferenceLinking * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptReferenceLinking { // public methods public: //! Constructor CConceptReferenceLinking(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTREFERENCELINKING_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CTagItem.h0000644000175000017500000000341412520551214023457 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CTAGITEM_H #define KONCLUDE_REASONER_ONTOLOGY_CTAGITEM_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CTagItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTagItem { // public methods public: //! Constructor CTagItem(cint64 tag = 0); CTagItem* setTag(cint64 tag); CTagItem* initTag(cint64 tag); cint64 getTag() const; // protected methods protected: // protected variables protected: cint64 mTag; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CTAGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyBuildData.cpp0000644000175000017500000005115012520551210026040 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyBuildData.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyBuildData::COntologyBuildData(COntologyContext* ontoContext) : mExpressionCounter(ontoContext) { mOntoContext = ontoContext; CMemoryAllocationManager* memAllocMan = CContext::getMemoryAllocationManager(mOntoContext); mTellAxiomSet = CObjectParameterizingAllocator< CONTOLOGYAXIOMSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mRetractAxiomSet = CObjectParameterizingAllocator< CONTOLOGYAXIOMSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mTellUpdatedAxiomSet = CObjectParameterizingAllocator< CONTOLOGYAXIOMSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mRetractUpdatedAxiomSet = CObjectParameterizingAllocator< CONTOLOGYAXIOMSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mChangeAxiomList = CObjectParameterizingAllocator< CONTOLOGYAXIOMLIST< QPair >,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mChangeUpdatedAxiomList = CObjectParameterizingAllocator< CONTOLOGYAXIOMLIST< QPair >,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mDeclarationAxiomSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mTopClassExpression = nullptr; mBottomClassExpression = nullptr; mTopDataRangeExpression = nullptr; mBottomDataRangeExpression = nullptr; mTopObjPropExpression = nullptr; mBottomObjPropExpression = nullptr; mTopDataPropExpression = nullptr; mBottomDataPropExpression = nullptr; mExpressionBuildHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mClassBuildHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mObjectPropertyBuildHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mIndividualBuildHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mAnoIndividualBuildHash = CObjectParameterizingAllocator< CBUILDHASH,CAnonymousIndividualExpression*>,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mDatatypeIRIDatatypeBuildHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mDataPropertyBuildHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mDataLexicalValueBuildHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mFacetIRIFacetBuildHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mExpressionBuildListContainer = CObjectParameterizingAllocator< CBUILDLIST,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mInverseObjectPropertyHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mInverseObjectPropertyList = CObjectParameterizingAllocator< CBUILDLIST< QPair >,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mIndividualVariableIDHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mIndividualVariableBuildHash = CObjectParameterizingAllocator< CBUILDHASH,CObjectIndividualVariableExpression*>,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildConceptSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildObjectRoleSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildIndividualSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildDataRoleSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildDatatypeSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildDataRangesSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildConceptList = CObjectParameterizingAllocator< CBUILDLIST,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildObjectRoleList = CObjectParameterizingAllocator< CBUILDLIST,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildIndividualList = CObjectParameterizingAllocator< CBUILDLIST,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildDataRoleList = CObjectParameterizingAllocator< CBUILDLIST,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildDatatypeList = CObjectParameterizingAllocator< CBUILDLIST,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildDataRangesList = CObjectParameterizingAllocator< CBUILDLIST,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mImportDataHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mAxiomNumber = 0; mEntityNumber = 0; } COntologyBuildData::~COntologyBuildData() { CMemoryAllocationManager* memAllocMan = CContext::getMemoryAllocationManager(mOntoContext); // TODO: delete all //cDeleteAll(*mExpressionBuildListContainer); COPADestroyAndRelease(mTellAxiomSet,memAllocMan); COPADestroyAndRelease(mRetractAxiomSet,memAllocMan); COPADestroyAndRelease(mTellUpdatedAxiomSet,memAllocMan); COPADestroyAndRelease(mRetractUpdatedAxiomSet,memAllocMan); COPADestroyAndRelease(mChangeAxiomList,memAllocMan); COPADestroyAndRelease(mChangeUpdatedAxiomList,memAllocMan); COPADestroyAndRelease(mDeclarationAxiomSet,memAllocMan); COPADestroyAndRelease(mExpressionBuildHash,memAllocMan); COPADestroyAndRelease(mClassBuildHash,memAllocMan); COPADestroyAndRelease(mObjectPropertyBuildHash,memAllocMan); COPADestroyAndRelease(mIndividualBuildHash,memAllocMan); COPADestroyAndRelease(mAnoIndividualBuildHash,memAllocMan); COPADestroyAndRelease(mDatatypeIRIDatatypeBuildHash,memAllocMan); COPADestroyAndRelease(mExpressionBuildListContainer,memAllocMan); COPADestroyAndRelease(mDataPropertyBuildHash,memAllocMan); COPADestroyAndRelease(mDataLexicalValueBuildHash,memAllocMan); COPADestroyAndRelease(mFacetIRIFacetBuildHash,memAllocMan); COPADestroyAndRelease(mInverseObjectPropertyHash,memAllocMan); COPADestroyAndRelease(mInverseObjectPropertyList,memAllocMan); COPADestroyAndRelease(mIndividualVariableIDHash,memAllocMan); COPADestroyAndRelease(mIndividualVariableBuildHash,memAllocMan); COPADestroyAndRelease(mBuildConceptSet,memAllocMan); COPADestroyAndRelease(mBuildObjectRoleSet,memAllocMan); COPADestroyAndRelease(mBuildIndividualSet,memAllocMan); COPADestroyAndRelease(mBuildDataRoleSet,memAllocMan); COPADestroyAndRelease(mBuildDatatypeSet,memAllocMan); COPADestroyAndRelease(mBuildDataRangesSet,memAllocMan); COPADestroyAndRelease(mBuildConceptList,memAllocMan); COPADestroyAndRelease(mBuildObjectRoleList,memAllocMan); COPADestroyAndRelease(mBuildDataRoleList,memAllocMan); COPADestroyAndRelease(mBuildIndividualList,memAllocMan); COPADestroyAndRelease(mBuildDatatypeList,memAllocMan); COPADestroyAndRelease(mBuildDataRangesList,memAllocMan); COPADestroyAndRelease(mImportDataHash,memAllocMan); } COntologyBuildData* COntologyBuildData::referenceBuildData(COntologyBuildData* buildData) { *mTellAxiomSet = *buildData->mTellAxiomSet; *mRetractAxiomSet = *buildData->mRetractAxiomSet; mTellUpdatedAxiomSet->clear(); mRetractUpdatedAxiomSet->clear(); *mChangeAxiomList = *buildData->mChangeAxiomList; mChangeUpdatedAxiomList->clear(); //*mTellUpdatedAxiomSet = *buildData->mTellUpdatedAxiomSet; //*mRetractUpdatedAxiomSet = *buildData->mRetractUpdatedAxiomSet; *mDeclarationAxiomSet = *buildData->mDeclarationAxiomSet; mTopClassExpression = buildData->mTopClassExpression; mBottomClassExpression = buildData->mBottomClassExpression; mTopDataRangeExpression = buildData->mTopDataRangeExpression; mBottomDataRangeExpression = buildData->mBottomDataRangeExpression; mTopObjPropExpression = buildData->mTopObjPropExpression; mBottomObjPropExpression = buildData->mBottomObjPropExpression; mTopDataPropExpression = buildData->mTopDataPropExpression; mBottomDataPropExpression = buildData->mBottomDataPropExpression; *mExpressionBuildHash = *buildData->mExpressionBuildHash; *mClassBuildHash = *buildData->mClassBuildHash; *mObjectPropertyBuildHash = *buildData->mObjectPropertyBuildHash; *mIndividualBuildHash = *buildData->mIndividualBuildHash; *mAnoIndividualBuildHash = *buildData->mAnoIndividualBuildHash; *mDatatypeIRIDatatypeBuildHash = *buildData->mDatatypeIRIDatatypeBuildHash; *mDataPropertyBuildHash = *buildData->mDataPropertyBuildHash; *mDataLexicalValueBuildHash = *buildData->mDataLexicalValueBuildHash; *mFacetIRIFacetBuildHash = *buildData->mFacetIRIFacetBuildHash; *mExpressionBuildListContainer = *buildData->mExpressionBuildListContainer; *mInverseObjectPropertyHash = *buildData->mInverseObjectPropertyHash; *mInverseObjectPropertyList = *buildData->mInverseObjectPropertyList; *mIndividualVariableIDHash = *buildData->mIndividualVariableIDHash; *mIndividualVariableBuildHash = *buildData->mIndividualVariableBuildHash; *mBuildIndividualList = *buildData->mBuildIndividualList; *mBuildConceptList = *buildData->mBuildConceptList; *mBuildObjectRoleList = *buildData->mBuildObjectRoleList; *mBuildDataRoleList = *buildData->mBuildDataRoleList; *mBuildDatatypeList = *buildData->mBuildDatatypeList; *mBuildDataRangesList = *buildData->mBuildDataRangesList; *mImportDataHash = *buildData->mImportDataHash; mAxiomNumber = buildData->mAxiomNumber; mEntityNumber = buildData->mEntityNumber; mExpressionCounter.referenceBuildExpressionCounter(&buildData->mExpressionCounter); return this; } CBUILDHASH* COntologyBuildData::getImportDataHash() { return mImportDataHash; } CONTOLOGYAXIOMSET* COntologyBuildData::getTellAxiomSet() { return mTellAxiomSet; } CONTOLOGYAXIOMSET* COntologyBuildData::getRetractAxiomSet() { return mRetractAxiomSet; } CONTOLOGYAXIOMSET* COntologyBuildData::getUpdatedTellAxiomSet() { return mTellUpdatedAxiomSet; } CONTOLOGYAXIOMSET* COntologyBuildData::getUpdatedRetractAxiomSet() { return mRetractUpdatedAxiomSet; } CONTOLOGYAXIOMLIST< QPair >* COntologyBuildData::getChangeAxiomList() { return mChangeAxiomList; } CONTOLOGYAXIOMLIST< QPair >* COntologyBuildData::getUpdatedChangeAxiomList() { return mChangeUpdatedAxiomList; } CBUILDSET* COntologyBuildData::getDeclarationAxiomSet() { return mDeclarationAxiomSet; } CClassTermExpression* COntologyBuildData::getTopClassExpression() { return mTopClassExpression; } CClassTermExpression* COntologyBuildData::getBottomClassExpression() { return mBottomClassExpression; } CDataRangeTermExpression* COntologyBuildData::getTopDataRangeExpression() { return mTopDataRangeExpression; } CDataRangeTermExpression* COntologyBuildData::getBottomDataRangeExpression() { return mBottomDataRangeExpression; } CObjectPropertyTermExpression* COntologyBuildData::getTopObjectPropertyExpression() { return mTopObjPropExpression; } CObjectPropertyTermExpression* COntologyBuildData::getBottomObjectPropertyExpression() { return mBottomObjPropExpression; } CDataPropertyTermExpression* COntologyBuildData::getTopDataPropertyExpression() { return mTopDataPropExpression; } CDataPropertyTermExpression* COntologyBuildData::getBottomDataPropertyExpression() { return mBottomDataPropExpression; } COntologyBuildData* COntologyBuildData::setTopClassExpression(CClassTermExpression* topClassExp) { mTopClassExpression = topClassExp; return this; } COntologyBuildData* COntologyBuildData::setBottomClassExpression(CClassTermExpression* bottomClassExp) { mBottomClassExpression = bottomClassExp; return this; } COntologyBuildData* COntologyBuildData::setTopDataRangeExpression(CDataRangeTermExpression* dataRangeExp) { mTopDataRangeExpression = dataRangeExp; return this; } COntologyBuildData* COntologyBuildData::setBottomDataRangeExpression(CDataRangeTermExpression* dataRangeExp) { mBottomDataRangeExpression = dataRangeExp; return this; } COntologyBuildData* COntologyBuildData::setTopObjectPropertyExpression(CObjectPropertyTermExpression* topObjectPropertyExp) { mTopObjPropExpression = topObjectPropertyExp; return this; } COntologyBuildData* COntologyBuildData::setBottomObjectPropertyExpression(CObjectPropertyTermExpression* bottomObjectPropertyExp) { mBottomObjPropExpression = bottomObjectPropertyExp; return this; } COntologyBuildData* COntologyBuildData::setTopDataPropertyExpression(CDataPropertyTermExpression* dataPropertyExp) { mTopDataPropExpression = dataPropertyExp; return this; } COntologyBuildData* COntologyBuildData::setBottomDataPropertyExpression(CDataPropertyTermExpression* dataPropertyExp) { mBottomDataPropExpression = dataPropertyExp; return this; } CBUILDHASH* COntologyBuildData::getStructuralExpressionBuildHash() { return mExpressionBuildHash; } CBUILDHASH* COntologyBuildData::getClassEntityBuildHash() { return mClassBuildHash; } CBUILDHASH* COntologyBuildData::getObjectPropertyEntityBuildHash() { return mObjectPropertyBuildHash; } CBUILDHASH* COntologyBuildData::getDataPropertyEntityBuildHash() { return mDataPropertyBuildHash; } CBUILDHASH* COntologyBuildData::getDataLexicalValueBuildHash() { return mDataLexicalValueBuildHash; } CBUILDHASH* COntologyBuildData::getIndividualEntityBuildHash() { return mIndividualBuildHash; } CBUILDHASH,CAnonymousIndividualExpression*>* COntologyBuildData::getAnonymousIndividualBuildHash() { return mAnoIndividualBuildHash; } CBUILDHASH* COntologyBuildData::getDatatypeIRIBuildHash() { return mDatatypeIRIDatatypeBuildHash; } CBUILDHASH* COntologyBuildData::getFacetIRIBuildHash() { return mFacetIRIFacetBuildHash; } CBUILDLIST* COntologyBuildData::getExpressionBuildListContainer() { return mExpressionBuildListContainer; } CBUILDHASH* COntologyBuildData::getInverseObjectPropertyHash() { return mInverseObjectPropertyHash; } CBUILDLIST< QPair >* COntologyBuildData::getInverseObjectPropertyList() { return mInverseObjectPropertyList; } CBUILDHASH* COntologyBuildData::getIndividualVariableIDHash() { return mIndividualVariableIDHash; } CBUILDHASH,CObjectIndividualVariableExpression*>* COntologyBuildData::getIndividualVariableBuildHash() { return mIndividualVariableBuildHash; } CBUILDSET* COntologyBuildData::getBuildConceptSet() { return mBuildConceptSet; } CBUILDSET* COntologyBuildData::getBuildObjectRoleSet() { return mBuildObjectRoleSet; } CBUILDSET* COntologyBuildData::getBuildDataRoleSet() { return mBuildDataRoleSet; } CBUILDSET* COntologyBuildData::getBuildDataRangeSet() { return mBuildDataRangesSet; } CBUILDSET* COntologyBuildData::getBuildDatatypeSet() { return mBuildDatatypeSet; } CBUILDSET* COntologyBuildData::getBuildIndividualSet() { return mBuildIndividualSet; } CBUILDLIST* COntologyBuildData::getBuildConceptList() { return mBuildConceptList; } CBUILDLIST* COntologyBuildData::getBuildObjectRoleList() { return mBuildObjectRoleList; } CBUILDLIST* COntologyBuildData::getBuildDataRoleList() { return mBuildDataRoleList; } CBUILDLIST* COntologyBuildData::getBuildIndividualList() { return mBuildIndividualList; } CBUILDLIST* COntologyBuildData::getBuildDataRangeList() { return mBuildDataRangesList; } CBUILDLIST* COntologyBuildData::getBuildDatatypeList() { return mBuildDatatypeList; } cint64 COntologyBuildData::getNextAxiomNumber(bool moveNext) { cint64 nextNumber = mAxiomNumber; if (moveNext) { ++mAxiomNumber; } return nextNumber; } COntologyBuildData* COntologyBuildData::setNextAxiomNumber(cint64 axiomNumber) { mAxiomNumber = axiomNumber; return this; } cint64 COntologyBuildData::getNextEntityNumber(bool moveNext) { cint64 nextNumber = mEntityNumber; if (moveNext) { ++mEntityNumber; } return nextNumber; } COntologyBuildData* COntologyBuildData::setNextEntityNumber(cint64 entityNumber) { mEntityNumber = entityNumber; return this; } COntologyBuildExpressionCounter* COntologyBuildData::getBuildExpressionCounter() { return &mExpressionCounter; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralCompareValue.h0000644000175000017500000000420712520551176026627 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATALITERALCOMPAREVALUE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATALITERALCOMPAREVALUE_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDataLiteralValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataLiteralValueCompare * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralCompareValue : public CDataLiteralValue { // public methods public: virtual CDataLiteralCompareValue* initValue(CDataLiteralCompareValue* value) = 0; virtual bool isLessEqualThan(CDataLiteralCompareValue* value) = 0; virtual bool isLessThan(CDataLiteralCompareValue* value) = 0; virtual bool isEqualTo(CDataLiteralCompareValue* value) = 0; virtual bool isGreaterEqualThan(CDataLiteralCompareValue* value) = 0; virtual bool isGreaterThan(CDataLiteralCompareValue* value) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATALITERALCOMPAREVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CTerminology.h0000644000175000017500000000371012520551216024436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CTERMINOLOGY_H #define KONCLUDE_REASONER_ONTOLOGY_CTERMINOLOGY_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CTerminology * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTerminology { // public methods public: //! Constructor CTerminology(); //! Destructor virtual ~CTerminology(); virtual QString getTerminologyName(); virtual CTerminology *setTerminologyName(const QString &name); virtual qint64 getTerminologyID() const; virtual CTerminology *setTerminologyID(qint64 id); // protected methods protected: // protected variables protected: QString mTerminologyName; qint64 mTerminologyID; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CTERMINOLOGY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceDateTimeTriggers.h0000644000175000017500000000411612520551202030772 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEDATETIMETRIGGERS_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEDATETIMETRIGGERS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareTriggers.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceDateTimeTriggers * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceDateTimeTriggers : public CDatatypeValueSpaceCompareTriggers { // public methods public: //! Constructor CDatatypeValueSpaceDateTimeTriggers(CBoxContext* boxContext); CDatatypeValueSpaceDateTimeTriggers* initValueSpaceDateTimeTriggers(CDatatypeValueSpaceDateTimeTriggers* data); CDatatypeValueSpaceConceptTriggeringData* getDateTimeConceptTriggeringData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEDATETIMETRIGGERS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptData.h0000644000175000017500000000314512520551174024320 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDATA_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CConceptData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptData { // public methods public: //! Constructor CConceptData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualData.h0000644000175000017500000000316712520551206025015 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALDATA_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CIndividualData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualData { // public methods public: //! Constructor CIndividualData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CImplicationReplacementVector.h0000644000175000017500000000421012520551206027734 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CIMPLICATIONREPLACEMENTVECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CIMPLICATIONREPLACEMENTVECTOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CBoxContext.h" #include "CConcept.h" #include "CReplacementData.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CImplicationReplacementVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CImplicationReplacementVector : public CDefaultDynamicReferenceVectorBase { // public methods public: //! Constructor CImplicationReplacementVector(CBoxContext* boxContext = nullptr); //! Destructor virtual ~CImplicationReplacementVector(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CIMPLICATIONREPLACEMENTVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceCompareTriggers.h0000644000175000017500000000657512520551200030675 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACECOMPARETRIGGERS_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACECOMPARETRIGGERS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceTriggers.h" #include "CDatatypeValueSpaceConceptTriggeringData.h" #include "CDatatypeValueSpaceTriggeringMap.h" #include "CDataLiteralCompareValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceCompareTriggers * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceCompareTriggers : public CDatatypeValueSpaceTriggers { // public methods public: //! Constructor CDatatypeValueSpaceCompareTriggers(CBoxContext* boxContext); CDatatypeValueSpaceCompareTriggers* initValueSpaceCompareTriggers(CDatatypeValueSpaceCompareTriggers* data); CDatatypeValueSpaceTriggeringMap* getValueSpaceTriggeringMap(); CDatatypeValueSpaceConceptTriggeringData* getValueConceptTriggeringData(CDataLiteralCompareValue* value, bool createOrLocalize = true); CDatatypeValueSpaceConceptTriggeringData* getMinValueConceptTriggeringData(CDataLiteralCompareValue* value, bool inclusive, bool createOrLocalize = true); CDatatypeValueSpaceConceptTriggeringData* getMaxValueConceptTriggeringData(CDataLiteralCompareValue* value, bool inclusive, bool createOrLocalize = true); CDatatypeValueSpaceCompareTriggers* addValueConceptTrigger(CDataLiteralCompareValue* value, CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger); CDatatypeValueSpaceCompareTriggers* addMinValueConceptTrigger(CDataLiteralCompareValue* value, bool inclusive, CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger); CDatatypeValueSpaceCompareTriggers* addMaxValueConceptTrigger(CDataLiteralCompareValue* value, bool inclusive, CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger); CDatatypeValueSpaceCompareTriggers* addMinMaxValueConceptTrigger(CDataLiteralCompareValue* value, bool minRestriction, bool inclusive, CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger); // protected methods protected: // protected variables protected: CDatatypeValueSpaceTriggeringMap mValueTriggerMap; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACECOMPARETRIGGERS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingSteps.cpp0000644000175000017500000000313212520551212027341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyProcessingSteps.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyProcessingSteps::COntologyProcessingSteps(COntologyContext* context) { mContext = context; mPrStepDataVector = CObjectParameterizingAllocator< COntologyProcessingStepDataVector,COntologyContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mContext),mContext); } COntologyProcessingSteps::~COntologyProcessingSteps() { COPADestroyAndRelease(mPrStepDataVector,CContext::getMemoryAllocationManager(mContext)); } COntologyProcessingStepDataVector* COntologyProcessingSteps::getOntologyProcessingStepDataVector() { return mPrStepDataVector; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CAbbreviatedIRIName.h0000644000175000017500000000554512520551172025514 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CAbbreviatedIRIName_H #define KONCLUDE_REASONER_ONTOLOGY_CAbbreviatedIRIName_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CConcept.h" #include "CName.h" #include "CIRIName.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CAbbreviatedIRIName * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAbbreviatedIRIName : public CIRIName { // public methods public: //! Constructor CAbbreviatedIRIName(CNamePrefix *namePrefix = 0, const QString &iriNameString = QString("")); //! Destructor virtual ~CAbbreviatedIRIName(); virtual CAbbreviatedIRIName *init(CNamePrefix *namePrefix, const QString &iriNameString); virtual QString getIRIName(); virtual QString getAbbreviatedIRIName(); virtual QString getAbbreviatedPrefixWithAbbreviatedIRIName(const QString &joiningString = QString(":")); virtual CNamePrefix *getNamePrefix(); static QStringList getAbbreviatedIRINames(CLinker *nameLinker, qint64 nameVersionDifference = 0); static QStringList getAbbreviatedPrefixWithAbbreviatedIRINames(CLinker *nameLinker, qint64 nameVersionDifference = 0, const QString &joiningString = QString(":")); static QString getRecentAbbreviatedPrefixWithAbbreviatedIRIName(CLinker *nameLinker, qint64 nameVersionDifference = 0, const QString &joiningString = QString(":")); static bool hasAbbreviatedIRIName(CLinker *nameLinker, CNamePrefix *namePrefix, const QString &name, qint64 nameVersionDifference = 0); // protected methods protected: // protected variables protected: CNamePrefix *prefix; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CAbbreviatedIRIName_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceBooleanType.h0000644000175000017500000000451412520551200030010 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBOOLEANTYPE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBOOLEANTYPE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareType.h" #include "CDataLiteralBooleanValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceBooleanType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceBooleanType : public CDatatypeValueSpaceCompareType { // public methods public: //! Constructor CDatatypeValueSpaceBooleanType(); CDataLiteralBooleanValue* getMinimumDataLiteralBooleanValue(); CDataLiteralBooleanValue* getMaximumDataLiteralBooleanValue(); virtual CDataLiteralCompareValue* getMinimumDataLiteralCompareValue(); virtual CDataLiteralCompareValue* getMaximumDataLiteralCompareValue(); virtual bool hasInfiniteManyValues(); virtual cint64 getMaximumValueCount(); // protected methods protected: // protected variables protected: CDataLiteralBooleanValue* mMinValue; CDataLiteralBooleanValue* mMaxValue; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBOOLEANTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptTagComparer.cpp0000644000175000017500000000175312520551176026213 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptTagComparer.h" namespace Konclude { namespace Reasoner { namespace Ontology { }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceIRITriggers.cpp0000644000175000017500000000277112520551202030261 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceIRITriggers.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceIRITriggers::CDatatypeValueSpaceIRITriggers(CBoxContext* boxContext) : CDatatypeValueSpaceCompareTriggers(boxContext) { } CDatatypeValueSpaceIRITriggers* CDatatypeValueSpaceIRITriggers::initValueSpaceIRITriggers(CDatatypeValueSpaceIRITriggers* data) { initValueSpaceCompareTriggers(data); return this; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceIRITriggers::getIRIConceptTriggeringData() { return getValueSpaceConceptTriggeringData(); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CSatisfiableCachingTags.h0000644000175000017500000000342312520551214026447 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CSATISFIABLECACHINGTAGS_H #define KONCLUDE_REASONER_ONTOLOGY_CSATISFIABLECACHINGTAGS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CCachingTags.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CSatisfiableCachingTags * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSatisfiableCachingTags : public CCachingTags { // public methods public: //! Constructor CSatisfiableCachingTags(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CSATISFIABLECACHINGTAGS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStepData.cpp0000644000175000017500000000420512520551212027752 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyProcessingStepData.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyProcessingStepData::COntologyProcessingStepData(COntologyContext* ontContext) { mOntContext = ontContext; mProcessingStep = nullptr; mProcessingStatistics = nullptr; } COntologyProcessingStep* COntologyProcessingStepData::getProcessingStep() { return mProcessingStep; } COntologyProcessingStepData* COntologyProcessingStepData::initProcessingStepData(COntologyProcessingStep* requiredProcessingStep) { mProcessingStep = requiredProcessingStep; return this; } COntologyProcessingStepData* COntologyProcessingStepData::setProcessingStep(COntologyProcessingStep* requiredProcessingStep) { mProcessingStep = requiredProcessingStep; return this; } COntologyProcessingStatus* COntologyProcessingStepData::getProcessingStatus() { return &mProcessingStatus; } COntologyProcessingStatistics* COntologyProcessingStepData::getProcessingStatistics(bool create) { if (create && !mProcessingStatistics) { mProcessingStatistics = CObjectAllocator< COntologyProcessingStatistics >::allocateAndConstruct(mOntContext->getMemoryAllocationManager()); } return mProcessingStatistics; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConcreteOntology.h0000644000175000017500000001324012520551176025427 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCRETEONTOLOGY_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCRETEONTOLOGY_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntology.h" #include "COntologyStructureSummary.h" #include "COntologyStringMapping.h" #include "COntologyDataBoxes.h" #include "COntologyContext.h" #include "CConcreteOntologyContextBase.h" #include "COntologyBuildData.h" #include "COntologyCoreConceptCyclesData.h" #include "CExpressionDataBoxMapping.h" #include "COntologyProcessingSteps.h" #include "COntologyIncrementalRevisionData.h" // Other includes #include "Parser/Expressions/CAxiomExpression.h" #include "Config/CConfigurationBase.h" #include "Reasoner/Taxonomy/CTaxonomy.h" #include "Reasoner/Consistence/CConsistence.h" #include "Reasoner/Consistence/CPrecomputation.h" #include "Reasoner/Classification/CClassification.h" #include "Reasoner/Preprocess/CPreprocessing.h" #include "Reasoner/Realization/CRealization.h" #include "Utilities/Memory/CObjectParameterizingAllocator.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Parser::Expression; using namespace Config; namespace Reasoner { using namespace Taxonomy; using namespace Consistence; using namespace Classification; using namespace Preprocess; using namespace Realization; namespace Ontology { /*! * * \class CConcreteOntology * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteOntology : public COntology { // public methods public: //! Constructor CConcreteOntology(CConfigurationBase* configuration); CConcreteOntology(CConcreteOntology* refOntology, CConfigurationBase* configuration); //! Destructor virtual ~CConcreteOntology(); CConcreteOntology* referenceOntology(CConcreteOntology* ontology); CConfigurationBase* getConfiguration(); CABox* getABox(); CTBox* getTBox(); CRBox* getRBox(); CConcept* getConcept(const QString& className); CConcreteOntology *setConceptTaxonomy(CTaxonomy *taxonomy); virtual CTaxonomy *getConceptTaxonomy(); virtual bool hasConceptTaxonomy(); CPrecomputation* getPrecomputation(); bool hasPrecomputation(); CConcreteOntology* setPrecomputation(CPrecomputation* precomputation); CPreprocessing* getPreprocessing(); bool hasPreprocessing(); CConcreteOntology* setPreprocessing(CPreprocessing* preprocessing); CRealization* getRealization(); bool hasRealization(); CConcreteOntology* setRealization(CRealization* realization); virtual CConsistence* getConsistence(); virtual bool hasConsistence(); CConcreteOntology *setConsistence(CConsistence *consistence); virtual CClassification* getClassification(); virtual bool hasClassification(); CConcreteOntology *setClassification(CClassification *classification); COntologyStructureSummary *getStructureSummary(); CConcreteOntology *setStructureSummary(COntologyStructureSummary *structureSummary); COntologyDataBoxes *getDataBoxes(); CConcreteOntology *setDataBoxes(COntologyDataBoxes *dataBoxes); COntologyStringMapping *getStringMapping(); CConcreteOntology *setStringMapping(COntologyStringMapping *stringMapping); virtual COntologyContext* getOntologyContext(); COntologyBuildData *getBuildData(); CConcreteOntology *setBuildData(COntologyBuildData *buildData); COntologyCoreConceptCyclesData* getCoreConceptCyclesData(); CConcreteOntology* setCoreConceptCyclesData(COntologyCoreConceptCyclesData* cyclesData); COntologyProcessingSteps* getProcessingSteps(); CConcreteOntology* setProcessingSteps(COntologyProcessingSteps* stepDatas); COntologyIncrementalRevisionData* getIncrementalRevisionData(); CConcreteOntology* setIncrementalRevisionData(COntologyIncrementalRevisionData* incRevData); // protected methods protected: // protected variables protected: CTaxonomy *mTax; CConsistence* mConsistence; CClassification* mClassification; CPreprocessing* mPreprocessing; CRealization* mRealization; CConfigurationBase* mConfiguration; COntologyStructureSummary* mStructSumm; COntologyDataBoxes* mDataBoxes; COntologyStringMapping* mStringMapping; COntologyBuildData* mBuildData; COntologyCoreConceptCyclesData* mConceptCyclesData; COntologyProcessingSteps* mProcessingSteps; COntologyIncrementalRevisionData* mIncRevisionData; CPrecomputation* mPrecomputation; CConcreteOntologyContextBase* mOntConctext; CONTOLOGYAXIOMSET* mAxiomSet; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCRETEONTOLOGY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CExtendedConceptReferenceLinkingData.h0000644000175000017500000000346312520551204031131 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CEXTENDEDCONCEPTREFERENCELINKINGDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CEXTENDEDCONCEPTREFERENCELINKINGDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CProcessReference.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CExtendedConceptReferenceLinkingData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExtendedConceptReferenceLinkingData { // public methods public: //! Constructor CExtendedConceptReferenceLinkingData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CEXTENDEDCONCEPTREFERENCELINKINGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CName.cpp0000644000175000017500000000267312520551206023347 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CName.h" namespace Konclude { namespace Reasoner { namespace Ontology { CName::CName() { nameVersion = 0; } CName::~CName() { } qint64 CName::getNameVersionID() { return nameVersion; } CName *CName::setNameVersionID(qint64 versionID) { nameVersion = versionID; return this; } qint64 CName::getLastNameVersionID(CLinker *nameLinker) { qint64 lastVersionID = -1; if (nameLinker) { lastVersionID = nameLinker->getData()->getNameVersionID(); } return lastVersionID; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralStringValue.cpp0000644000175000017500000001376312520551200027035 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralStringValue.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDataLiteralStringValue::CDataLiteralStringValue() { clearValue(); } CDataLiteralValue::DATA_LITERAL_VALUE_TYPE CDataLiteralStringValue::getDataValueType() { return CDataLiteralValue::DLVT_STRING; } CDataLiteralCompareValue* CDataLiteralStringValue::initValue(CDataLiteralCompareValue* value) { clearValue(); CDataLiteralStringValue* stringValue = dynamic_cast(value); if (stringValue) { mInfiniteLength = stringValue->mInfiniteLength; mLength = stringValue->mLength; mString = stringValue->mString; mLanguage = stringValue->mLanguage; } return this; } CDataLiteralStringValue* CDataLiteralStringValue::initValueFromInfiniteLength() { clearValue(); mInfiniteLength = true; return this; } CDataLiteralStringValue* CDataLiteralStringValue::initValueFromLength(cuint64 length) { clearValue(); mLength = length; return this; } CDataLiteralStringValue* CDataLiteralStringValue::initValueFromString(const QString& string, const QString& langString) { clearValue(); mString = string; mLanguage = langString; return this; } CDataLiteralStringValue* CDataLiteralStringValue::initValue(CDataLiteralStringValue* value) { if (value) { mInfiniteLength = value->mInfiniteLength; mLength = value->mLength; mString = value->mString; mLanguage = value->mLanguage; } return this; } CDataLiteralStringValue* CDataLiteralStringValue::clearValue() { mInfiniteLength = false; mLength = 0; mString.clear(); mLanguage.clear(); return this; } bool CDataLiteralStringValue::isInfiniteLength() { return mInfiniteLength; } bool CDataLiteralStringValue::hasLanguageTag() { return !mLanguage.isEmpty(); } cuint64 CDataLiteralStringValue::getLength() { if (mLength > 0) { return mLength; } else { return mString.length(); } } QString CDataLiteralStringValue::getStringValue() { return mString; } bool CDataLiteralStringValue::isEqualTo(CDataLiteralValue* value) { CDataLiteralStringValue* stringValue = dynamic_cast(value); if (stringValue) { return isEqualTo(stringValue); } return false; } bool CDataLiteralStringValue::isLessEqualThan(CDataLiteralCompareValue* value) { CDataLiteralStringValue* stringValue = dynamic_cast(value); if (stringValue) { return isEqualTo(stringValue) || isLessThan(stringValue); } return false; } bool CDataLiteralStringValue::isLessEqualThan(CDataLiteralStringValue* stringValue) { return isEqualTo(stringValue) || isLessThan(stringValue); } bool CDataLiteralStringValue::isEqualTo(CDataLiteralCompareValue* value) { CDataLiteralStringValue* stringValue = dynamic_cast(value); if (stringValue) { return isEqualTo(stringValue); } return false; } bool CDataLiteralStringValue::isEqualTo(CDataLiteralStringValue* stringValue) { if (mInfiniteLength && stringValue->mInfiniteLength) { return true; } if (mInfiniteLength || stringValue->mInfiniteLength) { return false; } if (mLength > 0 && mLength == stringValue->mLength) { return true; } if (mLanguage == stringValue->mLanguage && mString == stringValue->mString) { return true; } return false; } bool CDataLiteralStringValue::isGreaterEqualThan(CDataLiteralStringValue* stringValue) { return isEqualTo(stringValue) || isGreaterThan(stringValue); } bool CDataLiteralStringValue::isGreaterEqualThan(CDataLiteralCompareValue* value) { CDataLiteralStringValue* stringValue = dynamic_cast(value); if (stringValue) { return isEqualTo(stringValue) || isGreaterThan(stringValue); } return false; } bool CDataLiteralStringValue::isGreaterThan(CDataLiteralCompareValue* value) { return value->isLessThan(this); } bool CDataLiteralStringValue::isGreaterThan(CDataLiteralStringValue* stringValue) { return stringValue->isLessThan(this); } bool CDataLiteralStringValue::isLessThan(CDataLiteralCompareValue* value) { CDataLiteralStringValue* stringValue = dynamic_cast(value); if (stringValue) { return isLessThan(stringValue); } return false; } bool CDataLiteralStringValue::isLessThan(CDataLiteralStringValue* stringValue) { if (mInfiniteLength) { return false; } if (!mInfiniteLength && stringValue->mInfiniteLength) { return true; } if (getLength() < stringValue->getLength()) { return true; } else if (getLength() > stringValue->getLength()) { return false; } else { int stringComp = mString.compare(stringValue->mString); if (stringComp < 0) { return true; } else if (stringComp > 0) { return false; } int lanComp = mLanguage.compare(stringValue->mLanguage); return lanComp < 0; } return false; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceUnknownType.cpp0000644000175000017500000000222212520551204030421 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceUnknownType.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceUnknownType::CDatatypeValueSpaceUnknownType() : CDatatypeValueSpaceType(CDatatypeValueSpaceUnknownType::VALUESPACEUNKNOWNTYPE) { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleTagComparer.h0000644000175000017500000000435112520551214025154 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CROLETAGCOMPARER_H #define KONCLUDE_REASONER_ONTOLOGY_CROLETAGCOMPARER_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CRole.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CRoleTagComparer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleTagComparer { // public methods public: //! Constructor inline CRoleTagComparer(CRole* role) { mRole = role; } inline bool operator<(const CRoleTagComparer& conTagComp) const { return mRole->getRoleTag() < conTagComp.mRole->getRoleTag(); } inline bool operator<=(const CRoleTagComparer& conTagComp) const { return mRole->getRoleTag() <= conTagComp.mRole->getRoleTag(); } inline bool operator==(const CRoleTagComparer& conTagComp) const { return mRole->getRoleTag() == conTagComp.mRole->getRoleTag(); } inline CRole* getRole() const { return mRole; } // protected methods protected: // protected variables protected: CRole* mRole; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CROLETAGCOMPARER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptSatisfiableReferenceLinkingData.h0000644000175000017500000000441012520551176031620 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATISFIABLEREFERENCELINKINGDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATISFIABLEREFERENCELINKINGDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CConceptReferenceLinking.h" // Other includes #include "Reasoner/Classifier/CClassificationConceptReferenceLinking.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Classifier; namespace Ontology { /*! * * \class CConceptSatisfiableReferenceLinkingData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptSatisfiableReferenceLinkingData : public CConceptReferenceLinking { // public methods public: //! Constructor CConceptSatisfiableReferenceLinkingData(); CClassificationConceptReferenceLinking* getClassifierReferenceLinkingData(); CConceptSatisfiableReferenceLinkingData* setClassifierReferenceLinkingData(CClassificationConceptReferenceLinking* classRefLinkData); // protected methods protected: // protected variables protected: CClassificationConceptReferenceLinking* mClassifierReference; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CCONCEPTSATISFIABLEREFERENCELINKINGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryBase64DataType.h0000644000175000017500000000465512520551200031422 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBINARYBASE64DATATYPE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBINARYBASE64DATATYPE_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareType.h" #include "CDataLiteralBinaryBase64DataValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceBinaryBase64DataType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceBinaryBase64DataType : public CDatatypeValueSpaceCompareType { // public methods public: //! Constructor CDatatypeValueSpaceBinaryBase64DataType(); CDataLiteralBinaryBase64DataValue* getMinimumDataLiteralBinaryBase64DataValue(); CDataLiteralBinaryBase64DataValue* getMaximumDataLiteralBinaryBase64DataValue(); virtual CDataLiteralCompareValue* getMinimumDataLiteralCompareValue(); virtual CDataLiteralCompareValue* getMaximumDataLiteralCompareValue(); virtual bool hasInfiniteManyValues(); virtual cint64 getMaximumValueCount(); // protected methods protected: // protected variables protected: CDataLiteralBinaryBase64DataValue* mMinValue; CDataLiteralBinaryBase64DataValue* mMaxValue; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBINARYBASE64DATATYPE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptDependenceVector.cpp0000644000175000017500000000241212520551174027213 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptDependenceVector.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptDependenceVector::CConceptDependenceVector(CBoxContext* boxContext) : CDefaultDynamicReferenceVectorBase(boxContext) { } CConceptDependenceVector::~CConceptDependenceVector() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/OntologySettings.h0000644000175000017500000002737712520551216025375 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_ONTOLOGYSETTINGS #define KONCLUDE_REASONER_ONTOLOGY_ONTOLOGYSETTINGS // Libraries includes #include #include // Namespace includes // Other includes #include "Utilities/Container/CQtHash.h" #include "Utilities/Container/CQtList.h" #include "Utilities/Container/CQtSet.h" #include "Utilities/Container/CQtManagedRestrictedModificationMap.h" #include "Utilities/Memory/CObjectAllocator.h" #include "Utilities/Memory/CObjectParameterizingAllocator.h" // Logger includes namespace Konclude { using namespace Utilities; using namespace Utilities::Container; using namespace Utilities::Memory; namespace Reasoner { namespace Ontology { /*! * * \file OntologySettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class COntology; class CConcept; class CVariable; class CRole; class CRoleChain; class CBoxContext; class CIndividual; class CTerminology; class CConcreteOntology; class CTBox; class CABox; class CNamePrefix; class CConceptVector; class CProcessReference; class COntologyProcessingSteps; class COntologyProcessingStepVector; class COntologyProcessingStepData; class COntologyProcessingStep; class COntologyProcessingRequirement; class COntologyProcessingStatus; // Concept Constructor Codes static const qint64 CCNONE = 0; static const qint64 CCATOM = 0; static const qint64 CCTOP = 1; static const qint64 CCBOTTOM = -1; static const qint64 CCNOT = -2; static const qint64 CCAND = 3; static const qint64 CCOR = -3; static const qint64 CCATMOST = 4; static const qint64 CCATLEAST = -4; static const qint64 CCALL = 5; static const qint64 CCSOME = -5; static const qint64 CCEQ = 6; static const qint64 CCSUB = 7; static const qint64 CCNOMINAL = 8; static const qint64 CCSELF = 9; static const qint64 CCAQCHOOCE = 10; static const qint64 CCAQALL = 11; static const qint64 CCAQSOME = -11; static const qint64 CCAQAND = 12; static const qint64 CCVALUE = 13; static const qint64 CCNOMVAR = 14; static const qint64 CCNOMTEMPLREF = 15; static const qint64 CCIMPL = 16; static const qint64 CCIMPLTRIG = 17; static const qint64 CCIMPLALL = 18; static const qint64 CCIMPLAQALL = 19; static const qint64 CCIMPLAQAND = 20; static const qint64 CCBRANCHIMPL = 21; static const qint64 CCBRANCHTRIG = 22; static const qint64 CCBRANCHALL = 23; static const qint64 CCBRANCHAQALL = 24; static const qint64 CCBRANCHAQAND = 25; static const qint64 CCEQCAND = 26; static const qint64 CCPBINDTRIG = 27; static const qint64 CCPBINDIMPL = 28; static const qint64 CCPBINDGROUND = 29; static const qint64 CCPBINDALL = 30; static const qint64 CCPBINDAND = 31; static const qint64 CCPBINDAQAND = 32; static const qint64 CCPBINDAQALL = 33; static const qint64 CCPBINDVARIABLE = 34; static const qint64 CCPBINDCYCLE = 35; static const qint64 CCVARBINDTRIG = 36; static const qint64 CCVARBINDJOIN = 37; static const qint64 CCVARBINDGROUND = 38; static const qint64 CCVARBINDALL = 39; static const qint64 CCVARBINDAND = 40; static const qint64 CCVARBINDAQAND = 41; static const qint64 CCVARBINDAQALL = 42; static const qint64 CCVARBINDVARIABLE = 43; static const qint64 CCVARBINDIMPL = 44; static const qint64 CCVARPBACKTRIG = 45; static const qint64 CCVARPBACKALL = 46; static const qint64 CCVARPBACKAQAND = 47; static const qint64 CCVARPBACKAQALL = 48; static const qint64 CCBACKACTIVTRIG = 49; static const qint64 CCBACKACTIVIMPL = 50; static const qint64 CCDATATYPE = 51; static const qint64 CCDATALITERAL = 52; static const qint64 CCDATARESTRICTION = 53; static const qint64 CCMARKER = 54; // Prefixes #define PREFIX_OWL "http://www.w3.org/2002/07/owl#" #define PREFIX_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#" #define PREFIX_XML "http://www.w3.org/XML/1998/namespace" #define PREFIX_XSD "http://www.w3.org/2001/XMLSchema#" #define PREFIX_RDFS "http://www.w3.org/2000/01/rdf-schema#" #define PREFIX_OWL_THING "http://www.w3.org/2002/07/owl#Thing" #define PREFIX_OWL_NOTHING "http://www.w3.org/2002/07/owl#Nothing" #define PREFIX_OWL_TOPOBJECTPROPERTY "http://www.w3.org/2002/07/owl#topObjectProperty" #define PREFIX_OWL_BOTTOMOBJECTPROPERTY "http://www.w3.org/2002/07/owl#bottomObjectProperty" #define PREFIX_OWL_TOPDATAPROPERTY "http://www.w3.org/2002/07/owl#topDataProperty" #define PREFIX_OWL_BOTTOMDATAPROPERTY "http://www.w3.org/2002/07/owl#bottomDataProperty" #define PREFIX_OWL_TOP_DATATYPE "http://www.w3.org/2002/07/owl#topDatatype" #define PREFIX_OWL_BOTTOM_DATATYPE "http://www.w3.org/2002/07/owl#bottomDatatype" #define PREFIX_OWL_REAL_DATATYPE "http://www.w3.org/2002/07/owl#real" #define PREFIX_OWL_RATIONAL_DATATYPE "http://www.w3.org/2002/07/owl#rational" #define PREFIX_XML_INTEGER_DATATYPE "http://www.w3.org/2001/XMLSchema#integer" #define PREFIX_XML_DECIMAL_DATATYPE "http://www.w3.org/2001/XMLSchema#decimal" #define PREFIX_XML_NONNEGATIVEINTEGER_DATATYPE "http://www.w3.org/2001/XMLSchema#nonNegativeInteger" #define PREFIX_XML_POSITIVEINTEGER_DATATYPE "http://www.w3.org/2001/XMLSchema#positiveInteger" #define PREFIX_XML_NONPOSITIVEINTEGER_DATATYPE "http://www.w3.org/2001/XMLSchema#nonPositiveInteger" #define PREFIX_XML_NEGATIVEINTEGER_DATATYPE "http://www.w3.org/2001/XMLSchema#negativeInteger" #define PREFIX_XML_LONG_DATATYPE "http://www.w3.org/2001/XMLSchema#long" #define PREFIX_XML_INT_DATATYPE "http://www.w3.org/2001/XMLSchema#int" #define PREFIX_XML_SHORT_DATATYPE "http://www.w3.org/2001/XMLSchema#short" #define PREFIX_XML_BYTE_DATATYPE "http://www.w3.org/2001/XMLSchema#byte" #define PREFIX_XML_UNSIGNEDLONG_DATATYPE "http://www.w3.org/2001/XMLSchema#unsignedLong" #define PREFIX_XML_UNSIGNEDINT_DATATYPE "http://www.w3.org/2001/XMLSchema#unsignedInt" #define PREFIX_XML_UNSIGNEDSHORT_DATATYPE "http://www.w3.org/2001/XMLSchema#unsignedShort" #define PREFIX_XML_UNSIGNEDBYTE_DATATYPE "http://www.w3.org/2001/XMLSchema#unsignedByte" #define PREFIX_XML_PLAINLITERAL_DATATYPE "http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral" #define PREFIX_XML_STRING_DATATYPE "http://www.w3.org/2001/XMLSchema#string" #define PREFIX_XML_NORMALIZEDSTRING_DATATYPE "http://www.w3.org/2001/XMLSchema#normalizedString" #define PREFIX_XML_TOKEN_DATATYPE "http://www.w3.org/2001/XMLSchema#token" #define PREFIX_XML_NAME_DATATYPE "http://www.w3.org/2001/XMLSchema#Name" #define PREFIX_XML_NCNAME_DATATYPE "http://www.w3.org/2001/XMLSchema#NCName" #define PREFIX_XML_NMTOKEN_DATATYPE "http://www.w3.org/2001/XMLSchema#NMTOKEN" #define PREFIX_XML_LANGUAGE_DATATYPE "http://www.w3.org/2001/XMLSchema#language" #define PREFIX_XML_BOOLEAN_DATATYPE "http://www.w3.org/2001/XMLSchema#boolean" #define PREFIX_XML_DOUBLE_DATATYPE "http://www.w3.org/2001/XMLSchema#double" #define PREFIX_XML_FLOAT_DATATYPE "http://www.w3.org/2001/XMLSchema#float" #define PREFIX_XML_IRI_DATATYPE "http://www.w3.org/2001/XMLSchema#anyURI" #define PREFIX_XML_BINARYHEX_DATATYPE "http://www.w3.org/2001/XMLSchema#hexBinary" #define PREFIX_XML_BINARYBASE64_DATATYPE "http://www.w3.org/2001/XMLSchema#base64Binary" #define PREFIX_XML_XML_DATATYPE "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral" #define PREFIX_XML_DATETIME_DATATYPE "http://www.w3.org/2001/XMLSchema#dateTime" #define PREFIX_XML_DATETIMESTAMP_DATATYPE "http://www.w3.org/2001/XMLSchema#dateTimeStamp" #define PREFIX_MIN_INCLUSIVE_FACET "http://www.w3.org/2001/XMLSchema#minInclusive" #define PREFIX_MIN_EXCLUSIVE_FACET "http://www.w3.org/2001/XMLSchema#minExclusive" #define PREFIX_MAX_INCLUSIVE_FACET "http://www.w3.org/2001/XMLSchema#maxInclusive" #define PREFIX_MAX_EXCLUSIVE_FACET "http://www.w3.org/2001/XMLSchema#maxExclusive" #define PREFIX_MAX_LENGTH_FACET "http://www.w3.org/2001/XMLSchema#maxLength" #define PREFIX_MIN_LENGTH_FACET "http://www.w3.org/2001/XMLSchema#minLength" #define PREFIX_LENGTH_FACET "http://www.w3.org/2001/XMLSchema#length" #define PREFIX_PATTERN_FACET "http://www.w3.org/2001/XMLSchema#pattern" #define PREFIX_LANGUAGE_RANGE_FACET "http://www.w3.org/2001/XMLSchema#langRange" // Datatype Facet Codes static const qint64 CDFC_RATIONAL = 1; static const qint64 CDFC_DECIMAL = 2; static const qint64 CDFC_INTEGER = 3; static const qint64 CDFC_STRING = 4; static const qint64 CDFC_NORMALIZED_STRING = 5; static const qint64 CDFC_TOKEN = 6; static const qint64 CDFC_NAME = 7; static const qint64 CDFC_NCNAME = 8; static const qint64 CDFC_NMTOKEN = 9; static const qint64 CDFC_LANGUAGE = 10; static const qint64 CDFC_DATETIMESTAMP = 11; static const qint64 CDFC_MIN_EXCLUSIVE = 20; static const qint64 CDFC_MIN_INCLUSIVE = 21; static const qint64 CDFC_MAX_INCLUSIVE = 22; static const qint64 CDFC_MAX_EXCLUSIVE = 23; static const qint64 CDFC_LENGTH = 24; static const qint64 CDFC_MIN_LENGTH_INCLUSIVE = 25; static const qint64 CDFC_MAX_LENGTH_INCLUSIVE = 26; static const qint64 CDFC_PATTERN = 27; static const qint64 CDFC_LANGUAGE_RANGE = 28; #define CMAPPINGHASH CQtHash #define CMAPPINGLIST CQtList #define CBUILDHASH CQtHash #define CBUILDSET CQtSet #define CBUILDLIST CQtList #define CONTOLOGYAXIOMSET CQtSet #define CONTOLOGYAXIOMLIST CQtList #define CBOXSET CQtSet #define CBOXHASH CQtHash #define CBOXLIST CQtList #define CBOXMAP CQtManagedRestrictedModificationMap const cint64 DEFAULTVECTOR2POTSIZE = 9; const cint64 CCONCEPTVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; const cint64 CROLEVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; const cint64 CINDIVIDUALVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; const cint64 CCONCEPTDEPENDENCEVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; const cint64 CROLEDEPENDENCEVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; const cint64 CINDIVIDUALDEPENDENCEVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; const cint64 CPSEUDOMODELVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; const cint64 CROLECHAINVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; const cint64 CCONCEPTDATAVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; const cint64 CBRANCHINGTRIGGERVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; const cint64 CIMPLICATIONREPLACEMENTVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; const cint64 CNOMINALSCHEMATEMPLATEVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; const cint64 CDATATYPEVECTOR2POTSIZE = DEFAULTVECTOR2POTSIZE; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_ONTOLOGY_ONTOLOGYSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIRIName.cpp0000644000175000017500000000661212520551206023710 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIRIName.h" namespace Konclude { namespace Reasoner { namespace Ontology { CIRIName::CIRIName(const QString &nameString) { iriString = nameString; } CIRIName::~CIRIName() { } CIRIName *CIRIName::init(const QString &iriNameString) { iriString = iriNameString; return this; } QString CIRIName::getIRIName() { return iriString; } CIRIName *CIRIName::setIRIName(const QString &iriNameString) { iriString = iriNameString; return this; } QStringList CIRIName::getIRINames(CLinker *nameLinker, qint64 nameVersionDifference) { QStringList stringList; qint64 firstNameVersion = -1; while (nameLinker) { CName *name = nameLinker->getData(); qint64 nameVerID = name->getNameVersionID(); if (firstNameVersion <= 0) { firstNameVersion = nameVerID; } if (firstNameVersion - nameVerID > nameVersionDifference && nameVersionDifference != -1) { break; } CIRIName *iriName = dynamic_cast(name); if (iriName) { stringList.append(iriName->getIRIName()); } nameLinker = nameLinker->getNext(); } return stringList; } QString CIRIName::getRecentIRIName(CLinker *nameLinker, qint64 nameVersionDifference) { QString stringName; qint64 firstNameVersion = -1; while (nameLinker) { CName *name = nameLinker->getData(); qint64 nameVerID = name->getNameVersionID(); if (firstNameVersion <= 0) { firstNameVersion = nameVerID; } if (firstNameVersion - nameVerID > nameVersionDifference && nameVersionDifference != -1) { break; } CIRIName *iriName = dynamic_cast(name); if (iriName) { stringName = iriName->getIRIName(); break; } nameLinker = nameLinker->getNext(); } return stringName; } bool CIRIName::hasIRIName(CLinker *nameLinker, const QString &checkName, qint64 nameVersionDifference) { qint64 firstNameVersion = -1; while (nameLinker) { CName *name = nameLinker->getData(); qint64 nameVerID = name->getNameVersionID(); if (firstNameVersion <= 0) { firstNameVersion = nameVerID; } if (firstNameVersion - nameVerID > nameVersionDifference && nameVersionDifference != -1) { break; } CIRIName *iriName = dynamic_cast(name); if (iriName) { if (checkName == iriName->getIRIName()) { return true; } } nameLinker = nameLinker->getNext(); } return false; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyLoadingData.h0000644000175000017500000000374112520551210026026 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYLOADINGDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYLOADINGDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyLoadingData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyLoadingData { // public methods public: //! Constructor COntologyLoadingData(const QString& ontoIRIString, const QString& loadIRIString); const QString& getOntologyIRIString(); const QString& getLoadIRIString(); bool hasLoaded(); COntologyLoadingData* setLoaded(bool loaded = true); // protected methods protected: // protected variables protected: bool mLoaded; QString mOntoIRIString; QString mLoadIRIString; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYLOADINGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CRoleDependence.cpp0000644000175000017500000001365312520551214025342 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleDependence.h" namespace Konclude { namespace Reasoner { namespace Ontology { CRoleDependence::CRoleDependence() { subRoleLinker = 0; indirectSubRoleLinker = 0; rolDepTag = 0; conceptDepLinker = 0; indiDepsLinker = 0; indirectChainedSubRoleLinker = 0; } CRoleDependence::~CRoleDependence() { } CRoleDependence *CRoleDependence::init(CRole *role) { subRoleLinker = 0; indirectSubRoleLinker = 0; rolDepTag = role->getRoleTag(); conceptDepLinker = 0; return this; } CRoleDependence *CRoleDependence::init(qint64 roleTag, CRoleDependence *roleDep, CMemoryManager > *linkerMemMan) { rolDepTag = roleTag; subRoleLinker = 0; indirectSubRoleLinker = 0; conceptDepLinker = 0; indirectChainedSubRoleLinker = 0; if (linkerMemMan) { CSortedNegLinker *linkIt = 0; if (roleDep) { linkIt = roleDep->subRoleLinker; } while (linkIt) { CSortedNegLinker *roleLink = linkerMemMan->allocate(); roleLink->init(linkIt->getData(),linkIt->isNegated()); addSubRoleLinker(roleLink); linkIt = (CSortedNegLinker *)linkIt->getNext(); } linkIt = 0; if (roleDep) { linkIt = roleDep->conceptDepLinker; } while (linkIt) { CSortedNegLinker *conLink = linkerMemMan->allocate(); conLink->init(linkIt->getData(),linkIt->isNegated()); addConceptDependenceLinker(conLink); linkIt = (CSortedNegLinker *)linkIt->getNext(); } linkIt = 0; if (roleDep) { linkIt = roleDep->indiDepsLinker; } while (linkIt) { CSortedNegLinker *indiLink = linkerMemMan->allocate(); indiLink->init(linkIt->getData(),linkIt->isNegated()); addIndividualDependenceLinker(indiLink); linkIt = (CSortedNegLinker *)linkIt->getNext(); } } return this; } CRoleDependence *CRoleDependence::setRole(CRole *role) { rolDepTag = role->getRoleTag(); return this; } qint64 CRoleDependence::getRoleTag() { return rolDepTag; } CRoleDependence *CRoleDependence::setSubRoleList(CSortedNegLinker *depSubRoleList) { subRoleLinker = depSubRoleList; return this; } CRoleDependence *CRoleDependence::addSubRoleLinker(CSortedNegLinker *depSubRoleLinker) { if (subRoleLinker) { subRoleLinker = subRoleLinker->insertSortedNextSorted(depSubRoleLinker); } else { subRoleLinker = depSubRoleLinker; } return this; } CSortedNegLinker *CRoleDependence::getSubRoleList() { return subRoleLinker; } CRoleDependence *CRoleDependence::setIndirectSubRoleList(CSortedNegLinker *indirectDepSubRoleList) { indirectSubRoleLinker = indirectDepSubRoleList; return this; } CRoleDependence *CRoleDependence::addIndirectSubRoleLinker(CSortedNegLinker *indirectDepSubRoleLinker) { if (indirectSubRoleLinker) { indirectSubRoleLinker = indirectSubRoleLinker->insertSortedNextSorted(indirectDepSubRoleLinker); } else { indirectSubRoleLinker = indirectDepSubRoleLinker; } return this; } CSortedNegLinker *CRoleDependence::getIndirectSubRoleList() { return indirectSubRoleLinker; } CRoleDependence *CRoleDependence::setConceptDependenceList(CSortedNegLinker *conceptDependenceList) { conceptDepLinker = conceptDependenceList; return this; } CRoleDependence *CRoleDependence::addConceptDependenceLinker(CSortedNegLinker *conceptDependenceLinker) { if (conceptDepLinker) { conceptDepLinker = conceptDepLinker->insertSortedNextSorted(conceptDependenceLinker); } else { conceptDepLinker = conceptDependenceLinker; } return this; } CSortedNegLinker *CRoleDependence::getConceptDependenceList() { return conceptDepLinker; } CRoleDependence *CRoleDependence::setIndividualDependenceList(CSortedNegLinker *indiList) { indiDepsLinker = indiList; return this; } CRoleDependence *CRoleDependence::addIndividualDependenceLinker(CSortedNegLinker *indiLinker) { if (indiDepsLinker) { indiDepsLinker = indiDepsLinker->insertSortedNextSorted(indiLinker); } else { indiDepsLinker = indiLinker; } return this; } CSortedNegLinker *CRoleDependence::getIndividualDependenceList() { return indiDepsLinker; } CRoleDependence *CRoleDependence::setIndirectChainedSubRoleList(CSortedNegLinker *indiList) { indirectChainedSubRoleLinker = indiList; return this; } CRoleDependence *CRoleDependence::addIndirectChainedSubRoleLinker(CSortedNegLinker *indiLinker) { if (indirectChainedSubRoleLinker) { indirectChainedSubRoleLinker = indirectChainedSubRoleLinker->insertSortedNextSorted(indiLinker); } else { indirectChainedSubRoleLinker = indiLinker; } return this; } CSortedNegLinker *CRoleDependence::getIndirectChainedSubRoleList() { return indirectChainedSubRoleLinker; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStepData.h0000644000175000017500000000467412520551212027431 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyContext.h" #include "COntologyProcessingStatus.h" #include "COntologyProcessingStatistics.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyProcessingStepData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyProcessingStepData { // public methods public: //! Constructor COntologyProcessingStepData(COntologyContext* ontContext); COntologyProcessingStepData* initProcessingStepData(COntologyProcessingStep* requiredProcessingStep); COntologyProcessingStep* getProcessingStep(); COntologyProcessingStepData* setProcessingStep(COntologyProcessingStep* requiredProcessingStep); COntologyProcessingStatus* getProcessingStatus(); COntologyProcessingStatistics* getProcessingStatistics(bool create = true); // protected methods protected: // protected variables protected: COntologyContext* mOntContext; COntologyProcessingStep* mProcessingStep; COntologyProcessingStatus mProcessingStatus; COntologyProcessingStatistics* mProcessingStatistics; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEPDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CNominalSchemaTemplateVector.cpp0000644000175000017500000000245212520551210030052 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNominalSchemaTemplateVector.h" namespace Konclude { namespace Reasoner { namespace Ontology { CNominalSchemaTemplateVector::CNominalSchemaTemplateVector(CBoxContext* boxContext) : CDefaultDynamicReferenceVectorBase(boxContext) { } CNominalSchemaTemplateVector::~CNominalSchemaTemplateVector() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptDependence.cpp0000644000175000017500000001113412520551174026031 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptDependence.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptDependence::CConceptDependence() { conceptDepTag = 0; conceptDepsLinker = 0; roleDepsLinker = 0; indiDepsLinker = 0; } CConceptDependence::~CConceptDependence() { } CConceptDependence *CConceptDependence::init(qint64 conTag, CConceptDependence *conceptDep, CMemoryManager > *linkerMemMan) { conceptDepTag = conTag; conceptDepsLinker = 0; if (linkerMemMan) { CSortedNegLinker *linkIt = 0; if (conceptDep) { linkIt = conceptDep->conceptDepsLinker; } while (linkIt) { CSortedNegLinker *conLink = linkerMemMan->allocate(); conLink->init(linkIt->getData(),linkIt->isNegated()); addConceptDependenceLinker(conLink); linkIt = (CSortedNegLinker *)linkIt->getNext(); } linkIt = 0; if (conceptDep) { linkIt = conceptDep->roleDepsLinker; } while (linkIt) { CSortedNegLinker *roleLink = linkerMemMan->allocate(); roleLink->init(linkIt->getData(),linkIt->isNegated()); addRoleDependenceLinker(roleLink); linkIt = (CSortedNegLinker *)linkIt->getNext(); } linkIt = 0; if (conceptDep) { linkIt = conceptDep->indiDepsLinker; } while (linkIt) { CSortedNegLinker *indiLink = linkerMemMan->allocate(); indiLink->init(linkIt->getData(),linkIt->isNegated()); addIndividualDependenceLinker(indiLink); linkIt = (CSortedNegLinker *)linkIt->getNext(); } } return this; } CConceptDependence *CConceptDependence::init(CConcept *concept) { conceptDepTag = concept->getConceptTag(); conceptDepsLinker = 0; roleDepsLinker = 0; indiDepsLinker = 0; return this; } CConceptDependence *CConceptDependence::setConceptDependenceList(CSortedNegLinker *conceptList) { conceptDepsLinker = conceptList; return this; } CConceptDependence *CConceptDependence::addConceptDependenceLinker(CSortedNegLinker *conceptLinker) { if (conceptDepsLinker) { conceptDepsLinker = conceptDepsLinker->insertSortedNextSorted(conceptLinker); } else { conceptDepsLinker = conceptLinker; } return this; } CSortedNegLinker *CConceptDependence::getConceptDependenceList() { return conceptDepsLinker; } CConceptDependence *CConceptDependence::setRoleDependenceList(CSortedNegLinker *roleList) { roleDepsLinker = roleList; return this; } CConceptDependence *CConceptDependence::addRoleDependenceLinker(CSortedNegLinker *roleLinker) { if (roleDepsLinker) { roleDepsLinker = roleDepsLinker->insertSortedNextSorted(roleLinker); } else { roleDepsLinker = roleLinker; } return this; } CSortedNegLinker *CConceptDependence::getRoleDependenceList() { return roleDepsLinker; } qint64 CConceptDependence::getConceptDependenceTag() { return conceptDepTag; } CConceptDependence *CConceptDependence::getConceptDependenceTag(qint64 tag) { conceptDepTag = tag; return this; } CConceptDependence *CConceptDependence::setIndividualDependenceList(CSortedNegLinker *indiList) { indiDepsLinker = indiList; return this; } CConceptDependence *CConceptDependence::addIndividualDependenceLinker(CSortedNegLinker *indiLinker) { if (indiDepsLinker) { indiDepsLinker = indiDepsLinker->insertSortedNextSorted(indiLinker); } else { indiDepsLinker = indiLinker; } return this; } CSortedNegLinker *CConceptDependence::getIndividualDependenceList() { return indiDepsLinker; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptNegationPair.cpp0000644000175000017500000000261012520551174026356 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptNegationPair.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptNegationPair::CConceptNegationPair(CConcept *concept, bool negation) : QPair(concept,negation) { } CConceptNegationPair::~CConceptNegationPair() { } CConcept *CConceptNegationPair::getConcept() { return first; } bool CConceptNegationPair::getNegation() { return second; } bool CConceptNegationPair::isNegation() { return second; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralBinaryDataValue.cpp0000644000175000017500000002305712520551176027616 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralBinaryDataValue.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDataLiteralBinaryDataValue::CDataLiteralBinaryDataValue(CContext* context) { mContext = context; mByteDataArray = nullptr; mByteDataArraySize = 0; clearValue(); } CDataLiteralCompareValue* CDataLiteralBinaryDataValue::initValue(CDataLiteralCompareValue* value) { clearValue(); CDataLiteralBinaryDataValue* dataValue = dynamic_cast(value); if (dataValue) { initValue(dataValue); } return this; } CDataLiteralBinaryDataValue* CDataLiteralBinaryDataValue::initValueFromInfiniteLength() { clearValue(); mInfiniteLength = true; return this; } CDataLiteralBinaryDataValue* CDataLiteralBinaryDataValue::initValueFromLength(cuint64 length) { clearValue(); mLength = length; return this; } CDataLiteralBinaryDataValue* CDataLiteralBinaryDataValue::initValueFromData(unsigned char* data, cint64 length) { clearValue(); if (mByteDataArraySize < length) { mByteDataArraySize = length; mByteDataLength = length; mByteDataArray = CObjectAllocator::allocateArray(CContext::getMemoryAllocationManager(mContext),mByteDataArraySize); } for (cint64 i = 0; i < mByteDataLength; ++i) { mByteDataArray[i] = data[i]; } return this; } CDataLiteralBinaryDataValue* CDataLiteralBinaryDataValue::initValue(CDataLiteralBinaryDataValue* value) { clearValue(); if (value) { mInfiniteLength = value->mInfiniteLength; mLength = value->mLength; if (value->mByteDataLength > 0) { if (mByteDataArraySize < value->mByteDataLength) { mByteDataArraySize = value->mByteDataLength; mByteDataLength = value->mByteDataLength; mByteDataArray = CObjectAllocator::allocateArray(CContext::getMemoryAllocationManager(mContext),mByteDataArraySize); } for (cint64 i = 0; i < mByteDataLength; ++i) { mByteDataArray[i] = value->mByteDataArray[i]; } } } return this; } CDataLiteralBinaryDataValue* CDataLiteralBinaryDataValue::clearValue() { mInfiniteLength = false; mLength = 0; mByteDataLength = 0; if (mByteDataArray) { for (cint64 i = 0; i < mByteDataArraySize; ++i) { mByteDataArray[i] = 0; } } return this; } cuint64 CDataLiteralBinaryDataValue::getBinaryDataID() { cuint64 dataID = 0; dataID += 1 << getLength()*8; for (cint64 i = 0; i < mByteDataLength; ++i) { dataID += mByteDataArray[i] << (mByteDataLength-i-1)*8; } return dataID; } CDataLiteralBinaryDataValue* CDataLiteralBinaryDataValue::incrementBinaryData() { if (mLength > 0) { if (mByteDataArraySize < mLength) { mByteDataArraySize = mLength; mByteDataArray = CObjectAllocator::allocateArray(CContext::getMemoryAllocationManager(mContext),mByteDataArraySize); } mByteDataLength = mLength; for (cint64 i = 0; i < mByteDataLength; ++i) { mByteDataArray[i] = 0; } mLength = 0; } bool overflow = true; for (cint64 i = mByteDataLength-1; overflow && i >= 0; --i) { overflow = false; if (mByteDataArray[i] == 255) { mByteDataArray[i] = 0; overflow = true; } else { mByteDataArray[i] = mByteDataArray[i]+1; } } if (overflow) { if (mByteDataArraySize < mLength+1) { mByteDataArraySize = mLength+1; mByteDataArray = CObjectAllocator::allocateArray(CContext::getMemoryAllocationManager(mContext),mByteDataArraySize); } mByteDataLength = mLength+1; for (cint64 i = 0; i < mByteDataLength; ++i) { mByteDataArray[i] = 0; } } return this; } bool CDataLiteralBinaryDataValue::isInfiniteLength() { return mInfiniteLength; } cuint64 CDataLiteralBinaryDataValue::getLength() { if (mLength > 0) { return mLength; } else { return mByteDataLength; } } unsigned char* CDataLiteralBinaryDataValue::getByteDataArray() { return mByteDataArray; } cint64 CDataLiteralBinaryDataValue::getByteDataLength() { return mByteDataLength; } bool CDataLiteralBinaryDataValue::isEqualTo(CDataLiteralValue* value) { CDataLiteralBinaryDataValue* dataValue = dynamic_cast(value); if (dataValue) { return isEqualTo(dataValue); } return false; } bool CDataLiteralBinaryDataValue::isLessEqualThan(CDataLiteralCompareValue* value) { CDataLiteralBinaryDataValue* dataValue = dynamic_cast(value); if (dataValue) { return isEqualTo(dataValue) || isLessThan(dataValue); } return false; } bool CDataLiteralBinaryDataValue::isLessEqualThan(CDataLiteralBinaryDataValue* dataValue) { return isEqualTo(dataValue) || isLessThan(dataValue); } bool CDataLiteralBinaryDataValue::isEqualTo(CDataLiteralCompareValue* value) { CDataLiteralBinaryDataValue* dataValue = dynamic_cast(value); if (dataValue) { return isEqualTo(dataValue); } return false; } bool CDataLiteralBinaryDataValue::isZeroData() { if (mLength > 0) { return true; } for (cint64 i = 0; i < mByteDataLength; ++i) { unsigned char data = mByteDataArray[i]; if (data != 0) { return false; } } return true; } bool CDataLiteralBinaryDataValue::isEqualTo(CDataLiteralBinaryDataValue* dataValue) { if (getDataValueType() != dataValue->getDataValueType()) { return false; } if (mInfiniteLength && dataValue->mInfiniteLength) { return true; } if (mInfiniteLength || dataValue->mInfiniteLength) { return false; } if (getLength() != dataValue->getLength()) { return false; } if (mLength > 0 && mLength == dataValue->mLength) { return true; } bool zD = isZeroData(); bool dataValueZD = dataValue->isZeroData(); if (zD && dataValueZD) { return true; } else if (zD != dataValueZD) { return false; } else { for (cint64 i = 0; i < mByteDataLength; ++i) { if (mByteDataArray[i] != dataValue->mByteDataArray[i]) { return false; } } return true; } return false; } bool CDataLiteralBinaryDataValue::isGreaterEqualThan(CDataLiteralBinaryDataValue* dataValue) { if (getDataValueType() != dataValue->getDataValueType()) { return false; } return isEqualTo(dataValue) || isGreaterThan(dataValue); } bool CDataLiteralBinaryDataValue::isGreaterEqualThan(CDataLiteralCompareValue* value) { CDataLiteralBinaryDataValue* dataValue = dynamic_cast(value); if (dataValue) { return isEqualTo(dataValue) || isGreaterThan(dataValue); } return false; } bool CDataLiteralBinaryDataValue::isGreaterThan(CDataLiteralCompareValue* value) { if (getDataValueType() != value->getDataValueType()) { return false; } return value->isLessThan(this); } bool CDataLiteralBinaryDataValue::isGreaterThan(CDataLiteralBinaryDataValue* dataValue) { if (getDataValueType() != dataValue->getDataValueType()) { return false; } return dataValue->isLessThan(this); } bool CDataLiteralBinaryDataValue::isLessThan(CDataLiteralCompareValue* value) { CDataLiteralBinaryDataValue* dataValue = dynamic_cast(value); if (dataValue) { return isLessThan(dataValue); } return false; } bool CDataLiteralBinaryDataValue::isLessThan(CDataLiteralBinaryDataValue* dataValue) { if (getDataValueType() != dataValue->getDataValueType()) { return false; } if (mInfiniteLength) { return false; } if (!mInfiniteLength && dataValue->mInfiniteLength) { return true; } if (getLength() < dataValue->getLength()) { return true; } else if (getLength() > dataValue->getLength()) { return false; } else { if (dataValue->isZeroData()) { return false; } else if (isZeroData()) { return true; } for (cint64 i = 0; i < mByteDataLength; ++i) { if (mByteDataArray[i] < dataValue->mByteDataArray[i]) { return true; } else if (mByteDataArray[i] > dataValue->mByteDataArray[i]) { return false; } } } return false; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CExpressionDataBoxMapping.cpp0000644000175000017500000007160112520551204027400 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExpressionDataBoxMapping.h" namespace Konclude { namespace Reasoner { namespace Ontology { CExpressionDataBoxMapping::CExpressionDataBoxMapping(COntologyContext* ontoContext) : mConstructFlags(ontoContext) { mOntoContext = ontoContext; CMemoryAllocationManager* memAllocMan = CContext::getMemoryAllocationManager(mOntoContext); mActiveEntityCountVector = CObjectParameterizingAllocator< CActiveEntityCountVector,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mClassTermConceptHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mConceptClassTermHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mDataRangeTermConceptHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mConceptDataRangeTermHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mObjPropTermRoleHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mRoleObjPropTermHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mDataPropTermRoleHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mRoleDataPropTermHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mIndividulTermIndiHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mIndiIndividulTermHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mDatatypeExpDatatypeHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mDatatypeDatatypeExpHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mUpdateClassAxiomHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mUpdateObjectPropertyAxiomHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mUpdateDataPropertyAxiomHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mUpdateAssertionAxiomHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mClassTermClassAxiomSet = CObjectParameterizingAllocator< CBUILDSET< QPair >,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mClassTermClassAxiomHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mObjPropTermObjPropAxiomSet = CObjectParameterizingAllocator< CBUILDSET< QPair >,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mObjPropTermObjPropAxiomHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mDataPropTermDataPropAxiomSet = CObjectParameterizingAllocator< CBUILDSET< QPair >,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mDataPropTermDataPropAxiomHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mIndiTermAssertionAxiomSet = CObjectParameterizingAllocator< CBUILDSET< QPair >,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mIndiTermAssertionAxiomHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mTopRebuildClassTermExpressionsSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mTopRebuildObjectPropertyTermExpressionsSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mObjPropTermRoleChainHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mRoleChainObjPropTermHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildedConceptSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildedObjectRoleSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildedDataRoleSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildedDataRangeSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildedDatatypeSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildedIndividualSet = CObjectParameterizingAllocator< CBUILDSET,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildedConceptList = CObjectParameterizingAllocator< CBUILDLIST,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildedObjectRoleList = CObjectParameterizingAllocator< CBUILDLIST,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildedDataRoleList = CObjectParameterizingAllocator< CBUILDLIST,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildedDataRangeList = CObjectParameterizingAllocator< CBUILDLIST,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildedDatatypeList = CObjectParameterizingAllocator< CBUILDLIST,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mBuildedIndividualList = CObjectParameterizingAllocator< CBUILDLIST,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mExpressionBuildHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mExpressionBuildListContainer = CObjectParameterizingAllocator< CBUILDLIST,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mInverseObjectPropertyHash = CObjectParameterizingAllocator< CBUILDHASH,CContext* >::allocateAndConstructAndParameterize(memAllocMan,mOntoContext); mLastActiveCountedEntityAxiom = 0; mLastProcessedChangedAxiom = 0; mLastProcessedBuildIndividual = 0; mLastProcessedBuildConcept = 0; mLastProcessedBuildObjectRole = 0; mLastProcessedBuildDataRole = 0; mLastProcessedBuildDataRange = 0; mLastProcessedBuildDatatype = 0; mLastProcessedInverseProperty = 0; mLastProcessedExpression = 0; mLastBuildedIndividual = 0; mLastBuildedConcept = 0; mLastBuildedObjectRole = 0; mLastBuildedDataRole = 0; mLastBuildedDataRange = 0; mLastBuildedDatatype = 0; } CExpressionDataBoxMapping::~CExpressionDataBoxMapping() { CMemoryAllocationManager* memAllocMan = CContext::getMemoryAllocationManager(mOntoContext); COPADestroyAndRelease(mClassTermConceptHash,memAllocMan); COPADestroyAndRelease(mConceptClassTermHash,memAllocMan); COPADestroyAndRelease(mDataRangeTermConceptHash,memAllocMan); COPADestroyAndRelease(mConceptDataRangeTermHash,memAllocMan); COPADestroyAndRelease(mObjPropTermRoleHash,memAllocMan); COPADestroyAndRelease(mRoleObjPropTermHash,memAllocMan); COPADestroyAndRelease(mDataPropTermRoleHash,memAllocMan); COPADestroyAndRelease(mRoleDataPropTermHash,memAllocMan); COPADestroyAndRelease(mIndividulTermIndiHash,memAllocMan); COPADestroyAndRelease(mIndiIndividulTermHash,memAllocMan); COPADestroyAndRelease(mDatatypeExpDatatypeHash,memAllocMan); COPADestroyAndRelease(mDatatypeDatatypeExpHash,memAllocMan); COPADestroyAndRelease(mUpdateClassAxiomHash,memAllocMan); COPADestroyAndRelease(mUpdateObjectPropertyAxiomHash,memAllocMan); COPADestroyAndRelease(mUpdateDataPropertyAxiomHash,memAllocMan); COPADestroyAndRelease(mUpdateAssertionAxiomHash,memAllocMan); COPADestroyAndRelease(mObjPropTermObjPropAxiomSet,memAllocMan); COPADestroyAndRelease(mObjPropTermObjPropAxiomHash,memAllocMan); COPADestroyAndRelease(mDataPropTermDataPropAxiomSet,memAllocMan); COPADestroyAndRelease(mDataPropTermDataPropAxiomHash,memAllocMan); COPADestroyAndRelease(mIndiTermAssertionAxiomSet,memAllocMan); COPADestroyAndRelease(mIndiTermAssertionAxiomHash,memAllocMan); COPADestroyAndRelease(mTopRebuildClassTermExpressionsSet,memAllocMan); COPADestroyAndRelease(mTopRebuildObjectPropertyTermExpressionsSet,memAllocMan); COPADestroyAndRelease(mClassTermClassAxiomSet,memAllocMan); COPADestroyAndRelease(mClassTermClassAxiomHash,memAllocMan); COPADestroyAndRelease(mObjPropTermRoleChainHash,memAllocMan); COPADestroyAndRelease(mRoleChainObjPropTermHash,memAllocMan); COPADestroyAndRelease(mBuildedConceptSet,memAllocMan); COPADestroyAndRelease(mBuildedObjectRoleSet,memAllocMan); COPADestroyAndRelease(mBuildedDataRoleSet,memAllocMan); COPADestroyAndRelease(mBuildedDataRangeSet,memAllocMan); COPADestroyAndRelease(mBuildedDatatypeSet,memAllocMan); COPADestroyAndRelease(mBuildedIndividualSet,memAllocMan); COPADestroyAndRelease(mBuildedIndividualList,memAllocMan); COPADestroyAndRelease(mBuildedObjectRoleList,memAllocMan); COPADestroyAndRelease(mBuildedDataRoleList,memAllocMan); COPADestroyAndRelease(mBuildedDataRangeList,memAllocMan); COPADestroyAndRelease(mBuildedDatatypeList,memAllocMan); COPADestroyAndRelease(mBuildedConceptList,memAllocMan); COPADestroyAndRelease(mExpressionBuildHash,memAllocMan); COPADestroyAndRelease(mExpressionBuildListContainer,memAllocMan); COPADestroyAndRelease(mInverseObjectPropertyHash,memAllocMan); } CExpressionDataBoxMapping* CExpressionDataBoxMapping::referenceDataBoxMapping(CExpressionDataBoxMapping* dataBoxMapping) { *mClassTermConceptHash = *dataBoxMapping->mClassTermConceptHash; *mConceptClassTermHash = *dataBoxMapping->mConceptClassTermHash; *mDataRangeTermConceptHash = *dataBoxMapping->mDataRangeTermConceptHash; *mConceptDataRangeTermHash = *dataBoxMapping->mConceptDataRangeTermHash; *mObjPropTermRoleHash = *dataBoxMapping->mObjPropTermRoleHash; *mRoleObjPropTermHash = *dataBoxMapping->mRoleObjPropTermHash; *mDataPropTermRoleHash = *dataBoxMapping->mDataPropTermRoleHash; *mRoleDataPropTermHash = *dataBoxMapping->mRoleDataPropTermHash; *mIndividulTermIndiHash = *dataBoxMapping->mIndividulTermIndiHash; *mIndiIndividulTermHash = *dataBoxMapping->mIndiIndividulTermHash; *mDatatypeExpDatatypeHash = *dataBoxMapping->mDatatypeExpDatatypeHash; *mDatatypeDatatypeExpHash = *dataBoxMapping->mDatatypeDatatypeExpHash; mActiveEntityCountVector->initActiveEntityCountVector(dataBoxMapping->mActiveEntityCountVector); mUpdateClassAxiomHash->clear(); mUpdateObjectPropertyAxiomHash->clear(); mUpdateDataPropertyAxiomHash->clear(); mUpdateAssertionAxiomHash->clear(); //*mUpdateClassAxiomHash = *dataBoxMapping->mUpdateClassAxiomHash; //*mUpdateObjectPropertyAxiomHash = *dataBoxMapping->mUpdateObjectPropertyAxiomHash; *mClassTermClassAxiomSet = *dataBoxMapping->mClassTermClassAxiomSet; *mClassTermClassAxiomHash = *dataBoxMapping->mClassTermClassAxiomHash; *mObjPropTermObjPropAxiomSet = *dataBoxMapping->mObjPropTermObjPropAxiomSet; *mObjPropTermObjPropAxiomHash = *dataBoxMapping->mObjPropTermObjPropAxiomHash; *mDataPropTermDataPropAxiomSet = *dataBoxMapping->mDataPropTermDataPropAxiomSet; *mDataPropTermDataPropAxiomHash = *dataBoxMapping->mDataPropTermDataPropAxiomHash; *mIndiTermAssertionAxiomSet = *dataBoxMapping->mIndiTermAssertionAxiomSet; *mIndiTermAssertionAxiomHash = *dataBoxMapping->mIndiTermAssertionAxiomHash; *mTopRebuildClassTermExpressionsSet = *dataBoxMapping->mTopRebuildClassTermExpressionsSet; *mTopRebuildObjectPropertyTermExpressionsSet = *dataBoxMapping->mTopRebuildObjectPropertyTermExpressionsSet; *mObjPropTermRoleChainHash = *dataBoxMapping->mObjPropTermRoleChainHash; *mRoleChainObjPropTermHash = *dataBoxMapping->mRoleChainObjPropTermHash; mLastActiveCountedEntityAxiom = dataBoxMapping->mLastActiveCountedEntityAxiom; mLastProcessedChangedAxiom = dataBoxMapping->mLastProcessedChangedAxiom; mLastProcessedBuildIndividual = dataBoxMapping->mLastProcessedBuildIndividual; mLastProcessedBuildConcept = dataBoxMapping->mLastProcessedBuildConcept; mLastProcessedBuildObjectRole = dataBoxMapping->mLastProcessedBuildObjectRole; mLastProcessedBuildDataRole = dataBoxMapping->mLastProcessedBuildDataRole; mLastProcessedBuildDataRange = dataBoxMapping->mLastProcessedBuildDataRange; mLastProcessedBuildDatatype = dataBoxMapping->mLastProcessedBuildDatatype; mLastProcessedInverseProperty = dataBoxMapping->mLastProcessedInverseProperty; mLastProcessedExpression = dataBoxMapping->mLastProcessedExpression; mLastBuildedIndividual = dataBoxMapping->mLastBuildedIndividual; mLastBuildedConcept = dataBoxMapping->mLastBuildedConcept; mLastBuildedObjectRole = dataBoxMapping->mLastBuildedObjectRole; mLastBuildedDataRole = dataBoxMapping->mLastBuildedDataRole; mLastBuildedDataRange = dataBoxMapping->mLastBuildedDataRange; mLastBuildedDatatype = dataBoxMapping->mLastBuildedDatatype; *mBuildedIndividualList = *dataBoxMapping->mBuildedIndividualList; *mBuildedConceptList = *dataBoxMapping->mBuildedConceptList; *mBuildedObjectRoleList = *dataBoxMapping->mBuildedObjectRoleList; *mBuildedDataRoleList = *dataBoxMapping->mBuildedDataRoleList; *mBuildedDataRangeList = *dataBoxMapping->mBuildedDataRangeList; *mBuildedDatatypeList = *dataBoxMapping->mBuildedDatatypeList; *mBuildedIndividualSet = *dataBoxMapping->mBuildedIndividualSet; *mBuildedObjectRoleSet = *dataBoxMapping->mBuildedObjectRoleSet; *mBuildedDataRoleSet = *dataBoxMapping->mBuildedDataRoleSet; *mBuildedDatatypeSet = *dataBoxMapping->mBuildedDatatypeSet; *mBuildedDataRangeSet = *dataBoxMapping->mBuildedDataRangeSet; *mBuildedConceptSet = *dataBoxMapping->mBuildedConceptSet; *mInverseObjectPropertyHash = *dataBoxMapping->mInverseObjectPropertyHash; *mExpressionBuildHash = *dataBoxMapping->mExpressionBuildHash; *mExpressionBuildListContainer = *dataBoxMapping->mExpressionBuildListContainer; mConstructFlags.referenceBuildConstructFlags(&dataBoxMapping->mConstructFlags); return this; } CActiveEntityCountVector* CExpressionDataBoxMapping::getActiveEntityVector() { return mActiveEntityCountVector; } COntologyBuildConstructFlags* CExpressionDataBoxMapping::getBuildConstructFlags() { return &mConstructFlags; } CBUILDHASH* CExpressionDataBoxMapping::getClassTermConceptMappingHash() { return mClassTermConceptHash; } CBUILDHASH* CExpressionDataBoxMapping::getConceptClassTermMappingHash() { return mConceptClassTermHash; } CBUILDHASH* CExpressionDataBoxMapping::getDataRangeTermConceptMappingHash() { return mDataRangeTermConceptHash; } CBUILDHASH* CExpressionDataBoxMapping::getConceptDataRangeTermMappingHash() { return mConceptDataRangeTermHash; } CBUILDHASH* CExpressionDataBoxMapping::getObjectPropertyTermRoleMappingHash() { return mObjPropTermRoleHash; } CBUILDHASH* CExpressionDataBoxMapping::getRoleObjectPropertyTermMappingHash() { return mRoleObjPropTermHash; } CBUILDHASH* CExpressionDataBoxMapping::getDataPropertyTermRoleMappingHash() { return mDataPropTermRoleHash; } CBUILDHASH* CExpressionDataBoxMapping::getRoleDataPropertyTermMappingHash() { return mRoleDataPropTermHash; } CBUILDHASH* CExpressionDataBoxMapping::getIndividulTermIndiMappingHash() { return mIndividulTermIndiHash; } CBUILDHASH* CExpressionDataBoxMapping::getIndiIndividulTermMappingHash() { return mIndiIndividulTermHash; } CBUILDHASH* CExpressionDataBoxMapping::getDatatypeExpressionDatatypeHash() { return mDatatypeExpDatatypeHash; } CBUILDHASH* CExpressionDataBoxMapping::getDatatypeDatatypeExpessionHash() { return mDatatypeDatatypeExpHash; } CBUILDHASH* CExpressionDataBoxMapping::getUpdatedClassAxiomTellOrRetractHash() { return mUpdateClassAxiomHash; } CBUILDHASH* CExpressionDataBoxMapping::getUpdateObjectPropertyAxiomHash() { return mUpdateObjectPropertyAxiomHash; } CBUILDHASH* CExpressionDataBoxMapping::getUpdateDataPropertyAxiomHash() { return mUpdateDataPropertyAxiomHash; } CBUILDHASH* CExpressionDataBoxMapping::getUpdateAssertionAxiomHash() { return mUpdateAssertionAxiomHash; } CBUILDSET< QPair >* CExpressionDataBoxMapping::getClassTermExpressionClassAxiomExpressionSet() { return mClassTermClassAxiomSet; } CBUILDHASH* CExpressionDataBoxMapping::getClassTermExpressionClassAxiomExpressionHash() { return mClassTermClassAxiomHash; } CBUILDSET< QPair >* CExpressionDataBoxMapping::getObjectPropertyTermObjectPropertyAxiomSet() { return mObjPropTermObjPropAxiomSet; } CBUILDHASH* CExpressionDataBoxMapping::getObjectPropertyTermObjectPropertyAxiomHash() { return mObjPropTermObjPropAxiomHash; } CBUILDSET< QPair >* CExpressionDataBoxMapping::getDataPropertyTermDataPropertyAxiomSet() { return mDataPropTermDataPropAxiomSet; } CBUILDHASH* CExpressionDataBoxMapping::getDataPropertyTermDataPropertyAxiomHash() { return mDataPropTermDataPropAxiomHash; } CBUILDSET< QPair >* CExpressionDataBoxMapping::getIndividualTermAssertionAxiomSet() { return mIndiTermAssertionAxiomSet; } CBUILDHASH* CExpressionDataBoxMapping::getIndividualTermAssertionAxiomHash() { return mIndiTermAssertionAxiomHash; } CBUILDSET* CExpressionDataBoxMapping::getTopRebuildClassTermExpressionsSet() { return mTopRebuildClassTermExpressionsSet; } CBUILDSET* CExpressionDataBoxMapping::getTopRebuildObjectPropertyTermExpressionsSet() { return mTopRebuildObjectPropertyTermExpressionsSet; } CBUILDHASH* CExpressionDataBoxMapping::getObjectPropertyTermRoleChainHash() { return mObjPropTermRoleChainHash; } CBUILDHASH* CExpressionDataBoxMapping::getRoleChainObjectPropertyTermHash() { return mRoleChainObjPropTermHash; } CBUILDSET* CExpressionDataBoxMapping::getBuildedConceptSet() { return mBuildedConceptSet; } CBUILDSET* CExpressionDataBoxMapping::getBuildedObjectRoleSet() { return mBuildedObjectRoleSet; } CBUILDSET* CExpressionDataBoxMapping::getBuildedDataRoleSet() { return mBuildedDataRoleSet; } CBUILDSET* CExpressionDataBoxMapping::getBuildedDataRangeSet() { return mBuildedDataRangeSet; } CBUILDSET* CExpressionDataBoxMapping::getBuildedDatatypeSet() { return mBuildedDatatypeSet; } CBUILDSET* CExpressionDataBoxMapping::getBuildedIndividualSet() { return mBuildedIndividualSet; } cint64 CExpressionDataBoxMapping::getLastActiveCountedEntityAxiom() { return mLastActiveCountedEntityAxiom; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastActiveCountedEntityAxiom(cint64 lastCounted) { mLastActiveCountedEntityAxiom = lastCounted; return this; } cint64 CExpressionDataBoxMapping::getLastProcessedChangedAxiom() { return mLastProcessedChangedAxiom; } cint64 CExpressionDataBoxMapping::getLastBuildedIndividual() { return mLastBuildedIndividual; } cint64 CExpressionDataBoxMapping::getLastBuildedConcept() { return mLastBuildedConcept; } cint64 CExpressionDataBoxMapping::getLastBuildedObjectRole() { return mLastBuildedObjectRole; } cint64 CExpressionDataBoxMapping::getLastBuildedDataRole() { return mLastBuildedDataRole; } cint64 CExpressionDataBoxMapping::getLastBuildedDataRange() { return mLastBuildedDataRange; } cint64 CExpressionDataBoxMapping::getLastBuildedDatatype() { return mLastBuildedDatatype; } cint64 CExpressionDataBoxMapping::getLastProcessedBuildIndividual() { return mLastProcessedBuildIndividual; } cint64 CExpressionDataBoxMapping::getLastProcessedBuildConcept() { return mLastProcessedBuildConcept; } cint64 CExpressionDataBoxMapping::getLastProcessedBuildObjectRole() { return mLastProcessedBuildObjectRole; } cint64 CExpressionDataBoxMapping::getLastProcessedBuildDataRole() { return mLastProcessedBuildDataRole; } cint64 CExpressionDataBoxMapping::getLastProcessedBuildDatatype() { return mLastProcessedBuildDatatype; } cint64 CExpressionDataBoxMapping::getLastProcessedBuildDataRange() { return mLastProcessedBuildDataRange; } cint64 CExpressionDataBoxMapping::getLastProcessedInverseProperty() { return mLastProcessedInverseProperty; } cint64 CExpressionDataBoxMapping::getLastProcessedExpression() { return mLastProcessedExpression; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastProcessedChangedAxiom(cint64 lastBuilded) { mLastProcessedChangedAxiom = lastBuilded; return this; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastProcessedBuildIndividual(cint64 lastBuilded) { mLastProcessedBuildIndividual = lastBuilded; return this; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastProcessedBuildConcept(cint64 lastBuilded) { mLastProcessedBuildConcept = lastBuilded; return this; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastProcessedBuildObjectRole(cint64 lastBuilded) { mLastProcessedBuildObjectRole = lastBuilded; return this; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastProcessedBuildDataRole(cint64 lastBuilded) { mLastProcessedBuildDataRole = lastBuilded; return this; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastProcessedBuildDatatype(cint64 lastBuilded) { mLastProcessedBuildDatatype = lastBuilded; return this; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastProcessedBuildDataRange(cint64 lastBuilded) { mLastProcessedBuildDataRange = lastBuilded; return this; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastProcessedInverseProperty(cint64 lastBuilded) { mLastProcessedInverseProperty = lastBuilded; return this; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastProcessedExpression(cint64 lastBuilded) { mLastProcessedExpression = lastBuilded; return this; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastBuildedIndividual(cint64 lastBuilded) { mLastBuildedIndividual = lastBuilded; return this; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastBuildedConcept(cint64 lastBuilded) { mLastBuildedConcept = lastBuilded; return this; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastBuildedObjectRole(cint64 lastBuilded) { mLastBuildedObjectRole = lastBuilded; return this; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastBuildedDataRole(cint64 lastBuilded) { mLastBuildedDataRole = lastBuilded; return this; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastBuildedDataRange(cint64 lastBuilded) { mLastBuildedDataRange = lastBuilded; return this; } CExpressionDataBoxMapping* CExpressionDataBoxMapping::setLastBuildedDatatype(cint64 lastBuilded) { mLastBuildedDatatype = lastBuilded; return this; } CBUILDLIST* CExpressionDataBoxMapping::getBuildedConceptList() { return mBuildedConceptList; } CBUILDLIST* CExpressionDataBoxMapping::getBuildedObjectRoleList() { return mBuildedObjectRoleList; } CBUILDLIST* CExpressionDataBoxMapping::getBuildedDataRoleList() { return mBuildedDataRoleList; } CBUILDLIST* CExpressionDataBoxMapping::getBuildedDataRangeList() { return mBuildedDataRangeList; } CBUILDLIST* CExpressionDataBoxMapping::getBuildedDatatypeList() { return mBuildedDatatypeList; } CBUILDLIST* CExpressionDataBoxMapping::getBuildedIndividualList() { return mBuildedIndividualList; } CBUILDHASH* CExpressionDataBoxMapping::getStructuralExpressionBuildHash() { return mExpressionBuildHash; } CBUILDLIST* CExpressionDataBoxMapping::getExpressionBuildListContainer() { return mExpressionBuildListContainer; } CBUILDHASH* CExpressionDataBoxMapping::getInverseObjectPropertyHash() { return mInverseObjectPropertyHash; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptVector.h0000644000175000017500000000372512520551176024717 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTVECTOR_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTVECTOR_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CConcept.h" #include "CBoxContext.h" // Other includes #include "Utilities/Container/CDefaultDynamicReferenceVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CConceptVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptVector : public CDefaultDynamicReferenceVectorBase { // public methods public: //! Constructor CConceptVector(CContext* context = nullptr); //! Destructor virtual ~CConceptVector(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CBoxContext.cpp0000644000175000017500000000206112520551172024555 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBoxContext.h" namespace Konclude { namespace Reasoner { namespace Ontology { CBoxContext::CBoxContext() { } CBoxContext::~CBoxContext() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyDataBoxes.cpp0000644000175000017500000001232612520551210026063 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyDataBoxes.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyDataBoxes::COntologyDataBoxes(CBoxContext* boxContext) { mBoxContext = boxContext; mTBox = CObjectParameterizingAllocator< CTBox,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); mRBox = CObjectParameterizingAllocator< CRBox,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); mABox = CObjectParameterizingAllocator< CABox,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); mMBox = CObjectParameterizingAllocator< CMBox,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); mExpDataBoxMapping = CObjectParameterizingAllocator< CExpressionDataBoxMapping,CBoxContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); mBasicBuild = false; mInitialBuild = false; mIterationBuild = false; mPrevOntBasicBuild = false; mPrevOntInitialBuild = false; mPrevOntIterationBuild = false; mValueSpaceTypes = CDatatypeValueSpaceTypes::getValueSpaceTypes(); } COntologyDataBoxes::~COntologyDataBoxes() { COPADestroyAndRelease(mTBox,CContext::getMemoryAllocationManager(mBoxContext)); COPADestroyAndRelease(mRBox,CContext::getMemoryAllocationManager(mBoxContext)); COPADestroyAndRelease(mABox,CContext::getMemoryAllocationManager(mBoxContext)); COPADestroyAndRelease(mMBox,CContext::getMemoryAllocationManager(mBoxContext)); COPADestroyAndRelease(mExpDataBoxMapping,CContext::getMemoryAllocationManager(mBoxContext)); } COntologyDataBoxes* COntologyDataBoxes::referenceDataBoxes(COntologyDataBoxes* dataBoxes) { mTBox->referenceTBox(dataBoxes->mTBox); mRBox->referenceRBox(dataBoxes->mRBox); mABox->referenceABox(dataBoxes->mABox); mMBox->referenceMBox(dataBoxes->mMBox); mExpDataBoxMapping->referenceDataBoxMapping(dataBoxes->mExpDataBoxMapping); mBasicBuild = dataBoxes->mBasicBuild; mInitialBuild = dataBoxes->mInitialBuild; mIterationBuild = dataBoxes->mIterationBuild; mPrevOntBasicBuild = mBasicBuild; mPrevOntInitialBuild = mInitialBuild; mPrevOntIterationBuild = mIterationBuild; return this; } CConcept *COntologyDataBoxes::getTopConcept() { return mTBox->getTopConcept(); } CConcept *COntologyDataBoxes::getBottomConcept() { return mTBox->getBottomConcept(); } CTBox* COntologyDataBoxes::getTBox() { return mTBox; } CRBox* COntologyDataBoxes::getRBox() { return mRBox; } CABox* COntologyDataBoxes::getABox() { return mABox; } CMBox* COntologyDataBoxes::getMBox() { return mMBox; } CBoxContext* COntologyDataBoxes::getBoxContext() { return mBoxContext; } CExpressionDataBoxMapping* COntologyDataBoxes::getExpressionDataBoxMapping() { return mExpDataBoxMapping; } COntologyDataBoxes* COntologyDataBoxes::setExpressionDataBoxMapping(CExpressionDataBoxMapping* expDatBoxMapping) { mExpDataBoxMapping = expDatBoxMapping; return this; } bool COntologyDataBoxes::isBasicBuild() { return mBasicBuild; } bool COntologyDataBoxes::isInitialBuild() { return mInitialBuild; } bool COntologyDataBoxes::isIterationBuild() { return mIterationBuild; } COntologyDataBoxes* COntologyDataBoxes::setBasicBuild(bool basicBuild) { mBasicBuild = basicBuild; return this; } COntologyDataBoxes* COntologyDataBoxes::setInitialBuild(bool initialBuild) { mInitialBuild = initialBuild; return this; } COntologyDataBoxes* COntologyDataBoxes::setIterationBuild(bool iterationBuild) { mIterationBuild = iterationBuild; return this; } COntologyDataBoxes* COntologyDataBoxes::setBuildContinuation() { mBasicBuild = false; mInitialBuild = false; mIterationBuild = false; if (mPrevOntIterationBuild) { mIterationBuild = true; } else if (mPrevOntInitialBuild) { mIterationBuild = true; } else if (mPrevOntBasicBuild) { mInitialBuild = true; } return this; } CDatatypeValueSpaceTypes* COntologyDataBoxes::getDatatypeValueSpaceTypes() { return mValueSpaceTypes; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralBinaryHexDataValue.h0000644000175000017500000000367412520551176027733 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATALITERALBINARYHEXDATAVALUE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATALITERALBINARYHEXDATAVALUE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDataLiteralValue.h" #include "CDataLiteralBinaryDataValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataLiteralBinaryHexDataValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralBinaryHexDataValue : public CDataLiteralBinaryDataValue { // public methods public: //! Constructor CDataLiteralBinaryHexDataValue(CContext* context); virtual DATA_LITERAL_VALUE_TYPE getDataValueType(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATALITERALBINARYHEXDATAVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CTerminology.cpp0000644000175000017500000000274112520551216024774 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTerminology.h" namespace Konclude { namespace Reasoner { namespace Ontology { CTerminology::CTerminology() { mTerminologyID = 0; } CTerminology::~CTerminology() { } QString CTerminology::getTerminologyName() { return mTerminologyName; } CTerminology *CTerminology::setTerminologyName(const QString &name) { mTerminologyName = name; return this; } qint64 CTerminology::getTerminologyID() const { return mTerminologyID; } CTerminology *CTerminology::setTerminologyID(qint64 id) { mTerminologyID = id; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CNamedItem.h0000644000175000017500000000372612520551206023777 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CNAMEDITEM_H #define KONCLUDE_REASONER_ONTOLOGY_CNAMEDITEM_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CName.h" // Other includes #include "Utilities/CLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CNamedItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNamedItem { // public methods public: //! Constructor CNamedItem(); //! Destructor virtual ~CNamedItem(); bool hasName(); CNamedItem *setNameLinker(CLinker *nameLinker); CNamedItem *addNameLinker(CLinker *nameLinker); CLinker *getNameLinker(); // protected methods protected: // protected variables protected: CLinker* mNameLinker; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CNAMEDITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualDependence.cpp0000644000175000017500000000537612520551206026535 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualDependence.h" namespace Konclude { namespace Reasoner { namespace Ontology { CIndividualDependence::CIndividualDependence() { indiDepTag = 0; conceptDepsLinker = 0; } CIndividualDependence::~CIndividualDependence() { } CIndividualDependence *CIndividualDependence::init(qint64 indiTag, CIndividualDependence *indiDep, CMemoryManager > *linkerMemMan) { indiDepTag = indiTag; conceptDepsLinker = 0; if (linkerMemMan) { CSortedNegLinker *linkIt = 0; if (indiDep) { linkIt = indiDep->conceptDepsLinker; } while (linkIt) { CSortedNegLinker *conLink = linkerMemMan->allocate(); conLink->init(linkIt->getData(),linkIt->isNegated()); addConceptDependenceLinker(conLink); linkIt = (CSortedNegLinker *)linkIt->getNext(); } } return this; } CIndividualDependence *CIndividualDependence::init(CIndividual *indi) { indiDepTag = indi->getIndividualID(); conceptDepsLinker = 0; return this; } qint64 CIndividualDependence::getIndividualDependenceTag() { return indiDepTag; } CIndividualDependence *CIndividualDependence::setIndividualDependenceTag(qint64 tag) { indiDepTag = tag; return this; } CIndividualDependence *CIndividualDependence::setConceptDependenceList(CSortedNegLinker *conceptList) { conceptDepsLinker = conceptList; return this; } CIndividualDependence *CIndividualDependence::addConceptDependenceLinker(CSortedNegLinker *conceptLinker) { if (conceptDepsLinker) { conceptDepsLinker = conceptDepsLinker->insertSortedNextSorted(conceptLinker); } else { conceptDepsLinker = conceptLinker; } return this; } CSortedNegLinker *CIndividualDependence::getConceptDependenceList() { return conceptDepsLinker; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualDependenceVector.cpp0000644000175000017500000000244212520551206027707 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualDependenceVector.h" namespace Konclude { namespace Reasoner { namespace Ontology { CIndividualDependenceVector::CIndividualDependenceVector(CBoxContext* boxContext) : CDefaultDynamicReferenceVectorBase(boxContext) { } CIndividualDependenceVector::~CIndividualDependenceVector() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStage.h0000644000175000017500000000313012405707546026770 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDATA_H // Qt includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CConceptData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptData { // public methods public: //! Constructor CConceptData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStatistics.h0000644000175000017500000000424512520551212030050 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTATISTICS_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTATISTICS_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyProcessingStatistics * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyProcessingStatistics { // public methods public: //! Constructor COntologyProcessingStatistics(); QHash* getProcessingCountStatisticsHash(); cint64 getProcessingCountStatisticValue(const QString& statisticName); COntologyProcessingStatistics* setProcessingCountStatisticValue(const QString& statisticName, cint64 statisticValue); COntologyProcessingStatistics* incProcessingCountStatisticValue(const QString& statisticName, cint64 incValue = 1); // protected methods protected: // protected variables protected: QHash mProcessingCountStatisticsHash; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTATISTICS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualSaturationReferenceLinkingData.h0000644000175000017500000000445512520551206032223 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONREFERENCELINKINGDATA_H #define KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONREFERENCELINKINGDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CProcessReference.h" #include "CConceptReferenceLinking.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CIndividualSaturationReferenceLinkingData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualSaturationReferenceLinkingData : public CConceptReferenceLinking { // public methods public: //! Constructor CIndividualSaturationReferenceLinkingData(); CProcessReference* getIndividualProcessNodeForConcept(); CIndividualSaturationReferenceLinkingData* setIndividualProcessNodeForIndividual(CProcessReference* indiNode); CIndividualSaturationReferenceLinkingData* setSaturationID(cint64 saturationID); cint64 getSaturationID(); // protected methods protected: // protected variables protected: CProcessReference* mIndiProcessNodeForIndividual; cint64 mSaturationID; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_KERNEL_PROCESS_CINDIVIDUALSATURATIONREFERENCELINKINGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceStringTriggers.cpp0000644000175000017500000000473112520551202031102 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceStringTriggers.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceStringTriggers::CDatatypeValueSpaceStringTriggers(CBoxContext* boxContext) : CDatatypeValueSpaceCompareTriggers(boxContext) { } CDatatypeValueSpaceStringTriggers* CDatatypeValueSpaceStringTriggers::initValueSpaceStringTriggers(CDatatypeValueSpaceStringTriggers* data) { initValueSpaceCompareTriggers(data); if (data) { mValueSpateNonLanguageTagTriggerData.initConceptTriggeringData(&data->mValueSpateNonLanguageTagTriggerData); } else { mValueSpateNonLanguageTagTriggerData.initConceptTriggeringData(nullptr); } return this; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceStringTriggers::getStringConceptTriggeringData() { return getValueSpaceConceptTriggeringData(); } CDatatypeValueSpaceStringTriggers* CDatatypeValueSpaceStringTriggers::addNonLanguageTagConceptTrigger(CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger) { incConceptTriggerCount(conceptTrigger->getCount()); mValueSpateNonLanguageTagTriggerData.appendPartialConceptTriggers(conceptTrigger); return this; } CDatatypeValueSpaceStringTriggers* CDatatypeValueSpaceStringTriggers::addStringConceptTrigger(CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger) { addValueSpaceConceptTrigger(conceptTrigger); return this; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceStringTriggers::getNonLanguageTagConceptTriggeringData() { return &mValueSpateNonLanguageTagTriggerData; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceRealTriggers.h0000644000175000017500000000616512520551202030167 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEREALTRIGGERS_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEREALTRIGGERS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareTriggers.h" #include "CDatatypeValueSpaceConceptTriggeringData.h" #include "CDatatypeValueSpaceTriggeringMap.h" #include "CDataLiteralRealValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceRealTriggers * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceRealTriggers : public CDatatypeValueSpaceCompareTriggers { // public methods public: //! Constructor CDatatypeValueSpaceRealTriggers(CBoxContext* boxContext); CDatatypeValueSpaceRealTriggers* initValueSpaceRealTriggers(CDatatypeValueSpaceRealTriggers* data); CDatatypeValueSpaceConceptTriggeringData* getRealConceptTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* getRationalConceptTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* getDecimalConceptTriggeringData(); CDatatypeValueSpaceConceptTriggeringData* getIntegerConceptTriggeringData(); CDatatypeValueSpaceRealTriggers* addRealConceptTrigger(CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger); CDatatypeValueSpaceRealTriggers* addRationalConceptTrigger(CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger); CDatatypeValueSpaceRealTriggers* addDecimalConceptTrigger(CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger); CDatatypeValueSpaceRealTriggers* addIntegerConceptTrigger(CDatatypeValueSpaceConceptTriggerLinker* conceptTrigger); // protected methods protected: // protected variables protected: CDatatypeValueSpaceConceptTriggeringData mValueSpateRationalTriggerData; CDatatypeValueSpaceConceptTriggeringData mValueSpateDecimalTriggerData; CDatatypeValueSpaceConceptTriggeringData mValueSpateIntegerTriggerData; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEREALTRIGGERS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceCompareType.cpp0000644000175000017500000000221512520551202030350 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceCompareType.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceCompareType::CDatatypeValueSpaceCompareType(CDatatypeValueSpaceType::VALUESPACETYPE type) : CDatatypeValueSpaceType(type) { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptAssertionLinker.h0000644000175000017500000000355412520551174026567 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTASSERTIONLINKER_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTASSERTIONLINKER_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CConcept.h" // Other includes #include "Utilities/Container/CNegLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { namespace Ontology { /*! * * \class CConceptAssertionLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptAssertionLinker : public CNegLinkerBase { // public methods public: //! Constructor CConceptAssertionLinker(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTASSERTIONLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceDoubleTriggers.cpp0000644000175000017500000000302412520551202031040 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceDoubleTriggers.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceDoubleTriggers::CDatatypeValueSpaceDoubleTriggers(CBoxContext* boxContext) : CDatatypeValueSpaceCompareTriggers(boxContext) { } CDatatypeValueSpaceDoubleTriggers* CDatatypeValueSpaceDoubleTriggers::initValueSpaceDoubleTriggers(CDatatypeValueSpaceDoubleTriggers* data) { initValueSpaceCompareTriggers(data); return this; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceDoubleTriggers::getDoubleConceptTriggeringData() { return getValueSpaceConceptTriggeringData(); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceBooleanTriggers.h0000644000175000017500000000410412520551200030650 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBOOLEANTRIGGERS_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBOOLEANTRIGGERS_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareTriggers.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceBooleanTriggers * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceBooleanTriggers : public CDatatypeValueSpaceCompareTriggers { // public methods public: //! Constructor CDatatypeValueSpaceBooleanTriggers(CBoxContext* boxContext); CDatatypeValueSpaceBooleanTriggers* initValueSpaceBooleanTriggers(CDatatypeValueSpaceBooleanTriggers* data); CDatatypeValueSpaceConceptTriggeringData* getBooleanConceptTriggeringData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEBOOLEANTRIGGERS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryHexDataTriggers.cpp0000644000175000017500000000312312520551200032307 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceBinaryHexDataTriggers.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceBinaryHexDataTriggers::CDatatypeValueSpaceBinaryHexDataTriggers(CBoxContext* boxContext) : CDatatypeValueSpaceCompareTriggers(boxContext) { } CDatatypeValueSpaceBinaryHexDataTriggers* CDatatypeValueSpaceBinaryHexDataTriggers::initValueSpaceBinaryHexDataTriggers(CDatatypeValueSpaceBinaryHexDataTriggers* data) { initValueSpaceCompareTriggers(data); return this; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceBinaryHexDataTriggers::getBinaryHexDataConceptTriggeringData() { return getValueSpaceConceptTriggeringData(); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyIncrementalAxiomChangeData.cpp0000644000175000017500000001226512520551210031352 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyIncrementalAxiomChangeData.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyIncrementalAxiomChangeData::COntologyIncrementalAxiomChangeData(COntologyContext* ontoContext) { mOntoContext = ontoContext; mAddedABoxAxiomCount = 0; mAddedTBoxAxiomCount = 0; mAddedRBoxAxiomCount = 0; mDeletedABoxAxiomCount = 0; mDeletedTBoxAxiomCount = 0; mDeletedRBoxAxiomCount = 0; } cint64 COntologyIncrementalAxiomChangeData::getAddedABoxAxiomCount() { return mAddedABoxAxiomCount; } cint64 COntologyIncrementalAxiomChangeData::getAddedTBoxAxiomCount() { return mAddedTBoxAxiomCount; } cint64 COntologyIncrementalAxiomChangeData::getAddedRBoxAxiomCount() { return mAddedRBoxAxiomCount; } cint64 COntologyIncrementalAxiomChangeData::getDeletedABoxAxiomCount() { return mDeletedABoxAxiomCount; } cint64 COntologyIncrementalAxiomChangeData::getDeletedTBoxAxiomCount() { return mDeletedTBoxAxiomCount; } cint64 COntologyIncrementalAxiomChangeData::getDeletedRBoxAxiomCount() { return mDeletedRBoxAxiomCount; } COntologyIncrementalAxiomChangeData* COntologyIncrementalAxiomChangeData::incAddedABoxAxiomCount(cint64 incCount) { mAddedABoxAxiomCount += incCount; return this; } COntologyIncrementalAxiomChangeData* COntologyIncrementalAxiomChangeData::incAddedTBoxAxiomCount(cint64 incCount) { mAddedTBoxAxiomCount += incCount; return this; } COntologyIncrementalAxiomChangeData* COntologyIncrementalAxiomChangeData::incAddedRBoxAxiomCount(cint64 incCount) { mAddedRBoxAxiomCount += incCount; return this; } COntologyIncrementalAxiomChangeData* COntologyIncrementalAxiomChangeData::incDeletedABoxAxiomCount(cint64 incCount) { mDeletedABoxAxiomCount += incCount; return this; } COntologyIncrementalAxiomChangeData* COntologyIncrementalAxiomChangeData::incDeletedTBoxAxiomCount(cint64 incCount) { mDeletedTBoxAxiomCount += incCount; return this; } COntologyIncrementalAxiomChangeData* COntologyIncrementalAxiomChangeData::incDeletedRBoxAxiomCount(cint64 incCount) { mDeletedRBoxAxiomCount += incCount; return this; } bool COntologyIncrementalAxiomChangeData::hasAddedABoxAxioms() { return mAddedABoxAxiomCount > 0; } bool COntologyIncrementalAxiomChangeData::hasAddedTBoxAxioms() { return mAddedTBoxAxiomCount > 0; } bool COntologyIncrementalAxiomChangeData::hasAddedRBoxAxioms() { return mAddedRBoxAxiomCount > 0; } bool COntologyIncrementalAxiomChangeData::hasDeletedABoxAxioms() { return mDeletedABoxAxiomCount > 0; } bool COntologyIncrementalAxiomChangeData::hasDeletedTBoxAxioms() { return mDeletedTBoxAxiomCount > 0; } bool COntologyIncrementalAxiomChangeData::hasDeletedRBoxAxioms() { return mDeletedRBoxAxiomCount > 0; } bool COntologyIncrementalAxiomChangeData::hasChangedABoxAxioms() { return hasAddedABoxAxioms() || hasDeletedABoxAxioms(); } bool COntologyIncrementalAxiomChangeData::hasChangedTBoxAxioms() { return hasAddedTBoxAxioms() || hasDeletedTBoxAxioms(); } bool COntologyIncrementalAxiomChangeData::hasChangedRBoxAxioms() { return hasAddedRBoxAxioms() || hasDeletedRBoxAxioms(); } bool COntologyIncrementalAxiomChangeData::hasAxiomAdditions() { return hasAddedABoxAxioms() || hasAddedRBoxAxioms() || hasAddedTBoxAxioms(); } bool COntologyIncrementalAxiomChangeData::hasAxiomDeletions() { return hasDeletedABoxAxioms() || hasDeletedTBoxAxioms() || hasDeletedRBoxAxioms(); } bool COntologyIncrementalAxiomChangeData::hasChangedAxioms() { return hasChangedABoxAxioms() || hasChangedRBoxAxioms() || hasChangedTBoxAxioms(); } bool COntologyIncrementalAxiomChangeData::hasOnlyChangedABoxAxioms() { if (hasChangedRBoxAxioms() || hasChangedTBoxAxioms()) { return false; } return hasChangedABoxAxioms(); } bool COntologyIncrementalAxiomChangeData::hasOnlyChangedTBoxAxioms() { if (hasChangedABoxAxioms() || hasChangedRBoxAxioms()) { return false; } return hasChangedTBoxAxioms(); } bool COntologyIncrementalAxiomChangeData::hasOnlyChangedRBoxAxioms() { if (hasChangedABoxAxioms() || hasChangedTBoxAxioms()) { return false; } return hasChangedRBoxAxioms(); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CMBox.cpp0000644000175000017500000002025212520551206023325 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMBox.h" namespace Konclude { namespace Reasoner { namespace Ontology { CMBox::CMBox(CBoxContext* boxContext) { conceptDep = nullptr; roleDep = nullptr; indiDep = nullptr; mConDataVector = nullptr; mBranchTriggVector = nullptr; mImpRepVector = nullptr; mNomSchemaTemplVector = nullptr; mValueSpacesTriggers = nullptr; mBoxContext = boxContext; mMemMan = CContext::getMemoryAllocationManager(mBoxContext); mDeleteBoxContext = nullptr; } CMBox::~CMBox() { delete mDeleteBoxContext; COPADestroyAndRelease(conceptDep,mMemMan); COPADestroyAndRelease(roleDep,mMemMan); COPADestroyAndRelease(indiDep,mMemMan); COPADestroyAndRelease(mConDataVector,mMemMan); COPADestroyAndRelease(mBranchTriggVector,mMemMan); COPADestroyAndRelease(mImpRepVector,mMemMan); COPADestroyAndRelease(mNomSchemaTemplVector,mMemMan); COPADestroyAndRelease(mValueSpacesTriggers,mMemMan); } CConceptDependenceVector *CMBox::getConceptDependenceVector(bool create) { if (!conceptDep && create) { conceptDep = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return conceptDep; } CMBox *CMBox::setConceptDependenceVector(CConceptDependenceVector *conceptDependenceVector) { COPADestroyAndRelease(conceptDep,mMemMan); conceptDep = conceptDependenceVector; return this; } CRoleDependenceVector *CMBox::getRoleDependenceVector(bool create) { if (!roleDep && create) { roleDep = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return roleDep; } CMBox *CMBox::setRoleDependenceVector(CRoleDependenceVector *roleDependenceVector) { COPADestroyAndRelease(roleDep,mMemMan); roleDep = roleDependenceVector; return this; } CIndividualDependenceVector *CMBox::getIndividualDependenceVector(bool create) { if (!indiDep && create) { indiDep = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return indiDep; } CMBox *CMBox::setIndividualDependenceVector(CIndividualDependenceVector *indiDependenceVector) { COPADestroyAndRelease(indiDep,mMemMan); indiDep = indiDependenceVector; return this; } CMBox *CMBox::getMBoxReferenceCopy(CBoxContext *boxContext) { CMBox *mBox = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(boxContext),boxContext); mBox->referenceMBox(this); return mBox; } CConceptDataVector *CMBox::getConceptDataVector(bool create) { if (!mConDataVector && create) { mConDataVector = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mConDataVector; } CMBox *CMBox::setConceptDataVector(CConceptDataVector *conceptDataVector) { COPADestroyAndRelease(mConDataVector,mMemMan); mConDataVector = conceptDataVector; return this; } CBranchingTriggerVector *CMBox::getBranchingTriggerVector(bool create) { if (!mBranchTriggVector && create) { mBranchTriggVector = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mBranchTriggVector; } CMBox *CMBox::setBranchingTriggerVector(CBranchingTriggerVector *branchTriggVector) { COPADestroyAndRelease(mBranchTriggVector,mMemMan); mBranchTriggVector = branchTriggVector; return this; } CImplicationReplacementVector *CMBox::getImplicationReplacementVector(bool create) { if (!mImpRepVector && create) { mImpRepVector = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mImpRepVector; } CMBox *CMBox::setImplicationReplacementVector(CImplicationReplacementVector* impRepVector) { COPADestroyAndRelease(mImpRepVector,mMemMan); mImpRepVector = impRepVector; return this; } CNominalSchemaTemplateVector *CMBox::getNominalSchemaTemplateVector(bool create) { if (!mNomSchemaTemplVector && create) { mNomSchemaTemplVector = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); } return mNomSchemaTemplVector; } CDatatypeValueSpacesTriggers* CMBox::getValueSpacesTriggers(bool create) { if (!mValueSpacesTriggers && create) { mValueSpacesTriggers = CObjectParameterizingAllocator::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mBoxContext),mBoxContext); mValueSpacesTriggers->initValueSpacesTriggers(nullptr); } return mValueSpacesTriggers; } CMBox *CMBox::setNominalSchemaTemplateVector(CNominalSchemaTemplateVector* nomSchTemplVector) { COPADestroyAndRelease(mNomSchemaTemplVector,mMemMan); mNomSchemaTemplVector = nomSchTemplVector; return this; } CMBox *CMBox::referenceMBox(CMBox *mBox) { if (mBox->conceptDep) { getConceptDependenceVector(); conceptDep->referenceVector(mBox->conceptDep); } else if (conceptDep) { conceptDep->clear(); } if (mBox->roleDep) { getRoleDependenceVector(); roleDep->referenceVector(mBox->roleDep); } else if (roleDep) { roleDep->clear(); } if (mBox->indiDep) { getIndividualDependenceVector(); indiDep->referenceVector(mBox->indiDep); } else if (indiDep) { indiDep->clear(); } if (mBox->mConDataVector) { getConceptDataVector(); mConDataVector->referenceVector(mBox->mConDataVector); } else if (mConDataVector) { mConDataVector->clear(); } if (mBox->mBranchTriggVector) { getBranchingTriggerVector(); mBranchTriggVector->referenceVector(mBox->mBranchTriggVector); } else if (mBranchTriggVector) { mBranchTriggVector->clear(); } if (mBox->mImpRepVector) { getImplicationReplacementVector(); mImpRepVector->referenceVector(mBox->mImpRepVector); } else if (mImpRepVector) { mImpRepVector->clear(); } if (mBox->mNomSchemaTemplVector) { getNominalSchemaTemplateVector(); mNomSchemaTemplVector->referenceVector(mBox->mNomSchemaTemplVector); } else if (mNomSchemaTemplVector) { mNomSchemaTemplVector->clear(); } if (mBox->mValueSpacesTriggers) { getValueSpacesTriggers(); mValueSpacesTriggers->initValueSpacesTriggers(mBox->mValueSpacesTriggers); } else if (mValueSpacesTriggers) { mValueSpacesTriggers->initValueSpacesTriggers(nullptr); } return this; } CBoxContext *CMBox::getBoxContext(bool create) { if (!mBoxContext && create) { mBoxContext = new CConcreteOntologyContextBase(); mDeleteBoxContext = mBoxContext; } return mBoxContext; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptOperator.cpp0000644000175000017500000002624512520551174025603 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptOperator.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptOperator** CConceptOperator::mConceptOperatorVector = nullptr; QMutex* CConceptOperator::mCreateLockMutex = new QMutex(); CConceptOperator::CConceptOperator(cint64 opCode) { mOperatorCode = opCode; if (mOperatorCode == CCNONE) { mTypeFlag = CCF_NONE; } else if (mOperatorCode == CCTOP) { mTypeFlag = CCF_TOP; } else if (mOperatorCode == CCBOTTOM) { mTypeFlag = CCF_BOTTOM; } else if (mOperatorCode == CCNOT) { mTypeFlag = CCF_NOT; } else if (mOperatorCode == CCAND) { mTypeFlag = CCF_AND; } else if (mOperatorCode == CCOR) { mTypeFlag = CCF_OR; } else if (mOperatorCode == CCATMOST) { mTypeFlag = CCF_ATMOST; } else if (mOperatorCode == CCATLEAST) { mTypeFlag = CCF_ATLEAST; } else if (mOperatorCode == CCALL) { mTypeFlag = CCF_ALL; } else if (mOperatorCode == CCSOME) { mTypeFlag = CCF_SOME; } else if (mOperatorCode == CCEQ) { mTypeFlag = CCF_EQ; } else if (mOperatorCode == CCSUB) { mTypeFlag = CCF_SUB; } else if (mOperatorCode == CCNOMINAL) { mTypeFlag = CCF_NOMINAL; } else if (mOperatorCode == CCSELF) { mTypeFlag = CCF_SELF; } else if (mOperatorCode == CCAQCHOOCE) { mTypeFlag = CCF_AQCHOOCE; } else if (mOperatorCode == CCAQALL) { mTypeFlag = CCF_AQALL; } else if (mOperatorCode == CCAQSOME) { mTypeFlag = CCF_AQSOME; } else if (mOperatorCode == CCAQAND) { mTypeFlag = CCF_AQAND; } else if (mOperatorCode == CCVALUE) { mTypeFlag = CCF_VALUE; } else if (mOperatorCode == CCNOMVAR) { mTypeFlag = CCF_NOMVAR; } else if (mOperatorCode == CCNOMTEMPLREF) { mTypeFlag = CCF_NOMTEMPLREF; } else if (mOperatorCode == CCIMPL) { mTypeFlag = CCF_IMPL; } else if (mOperatorCode == CCIMPLTRIG) { mTypeFlag = CCF_IMPLTRIG; } else if (mOperatorCode == CCIMPLALL) { mTypeFlag = CCF_IMPLALL; } else if (mOperatorCode == CCIMPLAQALL) { mTypeFlag = CCF_IMPLAQALL; } else if (mOperatorCode == CCIMPLAQAND) { mTypeFlag = CCF_IMPLAQAND; } else if (mOperatorCode == CCBRANCHIMPL) { mTypeFlag = CCF_BRANCHIMPL; } else if (mOperatorCode == CCBRANCHTRIG) { mTypeFlag = CCF_BRANCHTRIG; } else if (mOperatorCode == CCBRANCHALL) { mTypeFlag = CCF_BRANCHALL; } else if (mOperatorCode == CCBRANCHAQALL) { mTypeFlag = CCF_BRANCHAQALL; } else if (mOperatorCode == CCBRANCHAQAND) { mTypeFlag = CCF_BRANCHAQAND; } else if (mOperatorCode == CCEQCAND) { mTypeFlag = CCF_EQCAND; } else if (mOperatorCode == CCPBINDTRIG) { mTypeFlag = CCF_PBINDTRIG; } else if (mOperatorCode == CCPBINDIMPL) { mTypeFlag = CCF_PBINDIMPL; } else if (mOperatorCode == CCPBINDGROUND) { mTypeFlag = CCF_PBINDGROUND; } else if (mOperatorCode == CCPBINDALL) { mTypeFlag = CCF_PBINDALL; } else if (mOperatorCode == CCPBINDAND) { mTypeFlag = CCF_PBINDAND; } else if (mOperatorCode == CCPBINDAQAND) { mTypeFlag = CCF_PBINDAQAND; } else if (mOperatorCode == CCPBINDAQALL) { mTypeFlag = CCF_PBINDAQALL; } else if (mOperatorCode == CCPBINDVARIABLE) { mTypeFlag = CCF_PBINDVARIABLE; } else if (mOperatorCode == CCPBINDCYCLE) { mTypeFlag = CCF_PBINDCYCLE; } else if (mOperatorCode == CCVARBINDTRIG) { mTypeFlag = CCF_VARBINDTRIG; } else if (mOperatorCode == CCVARBINDJOIN) { mTypeFlag = CCF_VARBINDJOIN; } else if (mOperatorCode == CCVARBINDGROUND) { mTypeFlag = CCF_VARBINDGROUND; } else if (mOperatorCode == CCVARBINDALL) { mTypeFlag = CCF_VARBINDALL; } else if (mOperatorCode == CCVARBINDAND) { mTypeFlag = CCF_VARBINDAND; } else if (mOperatorCode == CCVARBINDAQAND) { mTypeFlag = CCF_VARBINDAQAND; } else if (mOperatorCode == CCVARBINDAQALL) { mTypeFlag = CCF_VARBINDAQALL; } else if (mOperatorCode == CCVARBINDVARIABLE) { mTypeFlag = CCF_VARBINDVARIABLE; } else if (mOperatorCode == CCVARBINDIMPL) { mTypeFlag = CCF_VARBINDIMPL; } else if (mOperatorCode == CCVARPBACKTRIG) { mTypeFlag = CCF_VARPBACKTRIG; } else if (mOperatorCode == CCVARPBACKALL) { mTypeFlag = CCF_VARPBACKALL; } else if (mOperatorCode == CCVARPBACKAQAND) { mTypeFlag = CCF_VARPBACKAQAND; } else if (mOperatorCode == CCVARPBACKAQALL) { mTypeFlag = CCF_VARPBACKAQALL; } else if (mOperatorCode == CCBACKACTIVTRIG) { mTypeFlag = CCF_BACKACTIVTRIG; } else if (mOperatorCode == CCBACKACTIVIMPL) { mTypeFlag = CCF_BACKACTIVIMPL; } else if (mOperatorCode == CCDATATYPE) { mTypeFlag = CCF_DATATYPE; } else if (mOperatorCode == CCDATALITERAL) { mTypeFlag = CCF_DATALITERAL; } else if (mOperatorCode == CCDATARESTRICTION) { mTypeFlag = CCF_DATARESTRICTION; } else if (mOperatorCode == CCMARKER) { mTypeFlag = CCF_MARKER; } } cint64 CConceptOperator::getOperatorCode() { return mOperatorCode; } CConceptOperator* CConceptOperator::getConceptOperator(cint64 opCode) { CConceptOperator* conOp = nullptr; if (!mConceptOperatorVector) { mCreateLockMutex->lock(); if (!mConceptOperatorVector) { generateConceptOperators(); } mCreateLockMutex->unlock(); } conOp = mConceptOperatorVector[opCode]; return conOp; } bool CConceptOperator::hasPartialOperatorCodeFlag(cint64 operatorCodeFlag) { return (mTypeFlag & operatorCodeFlag) != 0; } bool CConceptOperator::hasAllOperatorCodeFlags(cint64 operatorCodeFlags) { return (mTypeFlag & operatorCodeFlags) != operatorCodeFlags; } void CConceptOperator::generateConceptOperators() { cint64 operatorCount = 200; mConceptOperatorVector = new CConceptOperator*[operatorCount]; for (cint64 i = 0; i < operatorCount; ++i) { mConceptOperatorVector[i] = nullptr; } mConceptOperatorVector = &mConceptOperatorVector[operatorCount/2]; mConceptOperatorVector[CCNONE] = new CConceptOperator(CCNONE); mConceptOperatorVector[CCTOP] = new CConceptOperator(CCTOP); mConceptOperatorVector[CCBOTTOM] = new CConceptOperator(CCBOTTOM); mConceptOperatorVector[CCNOT] = new CConceptOperator(CCNOT); mConceptOperatorVector[CCAND] = new CConceptOperator(CCAND); mConceptOperatorVector[CCOR] = new CConceptOperator(CCOR); mConceptOperatorVector[CCATMOST] = new CConceptOperator(CCATMOST); mConceptOperatorVector[CCATLEAST] = new CConceptOperator(CCATLEAST); mConceptOperatorVector[CCALL] = new CConceptOperator(CCALL); mConceptOperatorVector[CCSOME] = new CConceptOperator(CCSOME); mConceptOperatorVector[CCEQ] = new CConceptOperator(CCEQ); mConceptOperatorVector[CCSUB] = new CConceptOperator(CCSUB); mConceptOperatorVector[CCNOMINAL] = new CConceptOperator(CCNOMINAL); mConceptOperatorVector[CCSELF] = new CConceptOperator(CCSELF); mConceptOperatorVector[CCAQCHOOCE] = new CConceptOperator(CCAQCHOOCE); mConceptOperatorVector[CCAQALL] = new CConceptOperator(CCAQALL); mConceptOperatorVector[CCAQSOME] = new CConceptOperator(CCAQSOME); mConceptOperatorVector[CCAQAND] = new CConceptOperator(CCAQAND); mConceptOperatorVector[CCVALUE] = new CConceptOperator(CCVALUE); mConceptOperatorVector[CCNOMVAR] = new CConceptOperator(CCNOMVAR); mConceptOperatorVector[CCNOMTEMPLREF] = new CConceptOperator(CCNOMTEMPLREF); mConceptOperatorVector[CCIMPL] = new CConceptOperator(CCIMPL); mConceptOperatorVector[CCIMPLTRIG] = new CConceptOperator(CCIMPLTRIG); mConceptOperatorVector[CCIMPLALL] = new CConceptOperator(CCIMPLALL); mConceptOperatorVector[CCIMPLAQALL] = new CConceptOperator(CCIMPLAQALL); mConceptOperatorVector[CCIMPLAQAND] = new CConceptOperator(CCIMPLAQAND); mConceptOperatorVector[CCBRANCHIMPL] = new CConceptOperator(CCBRANCHIMPL); mConceptOperatorVector[CCBRANCHTRIG] = new CConceptOperator(CCBRANCHTRIG); mConceptOperatorVector[CCBRANCHALL] = new CConceptOperator(CCBRANCHALL); mConceptOperatorVector[CCBRANCHAQALL] = new CConceptOperator(CCBRANCHAQALL); mConceptOperatorVector[CCBRANCHAQAND] = new CConceptOperator(CCBRANCHAQAND); mConceptOperatorVector[CCEQCAND] = new CConceptOperator(CCEQCAND); mConceptOperatorVector[CCPBINDTRIG] = new CConceptOperator(CCPBINDTRIG); mConceptOperatorVector[CCPBINDIMPL] = new CConceptOperator(CCPBINDIMPL); mConceptOperatorVector[CCPBINDGROUND] = new CConceptOperator(CCPBINDGROUND); mConceptOperatorVector[CCPBINDALL] = new CConceptOperator(CCPBINDALL); mConceptOperatorVector[CCPBINDAND] = new CConceptOperator(CCPBINDAND); mConceptOperatorVector[CCPBINDAQAND] = new CConceptOperator(CCPBINDAQAND); mConceptOperatorVector[CCPBINDAQALL] = new CConceptOperator(CCPBINDAQALL); mConceptOperatorVector[CCPBINDVARIABLE] = new CConceptOperator(CCPBINDVARIABLE); mConceptOperatorVector[CCPBINDCYCLE] = new CConceptOperator(CCPBINDCYCLE); mConceptOperatorVector[CCVARBINDTRIG] = new CConceptOperator(CCVARBINDTRIG); mConceptOperatorVector[CCVARBINDJOIN] = new CConceptOperator(CCVARBINDJOIN); mConceptOperatorVector[CCVARBINDGROUND] = new CConceptOperator(CCVARBINDGROUND); mConceptOperatorVector[CCVARBINDALL] = new CConceptOperator(CCVARBINDALL); mConceptOperatorVector[CCVARBINDAQAND] = new CConceptOperator(CCVARBINDAQAND); mConceptOperatorVector[CCVARBINDAQALL] = new CConceptOperator(CCVARBINDAQALL); mConceptOperatorVector[CCVARBINDVARIABLE] = new CConceptOperator(CCVARBINDVARIABLE); mConceptOperatorVector[CCVARBINDIMPL] = new CConceptOperator(CCVARBINDIMPL); mConceptOperatorVector[CCVARPBACKTRIG] = new CConceptOperator(CCVARPBACKTRIG); mConceptOperatorVector[CCVARPBACKALL] = new CConceptOperator(CCVARPBACKALL); mConceptOperatorVector[CCVARPBACKAQAND] = new CConceptOperator(CCVARPBACKAQAND); mConceptOperatorVector[CCVARPBACKAQALL] = new CConceptOperator(CCVARPBACKAQALL); mConceptOperatorVector[CCBACKACTIVTRIG] = new CConceptOperator(CCBACKACTIVTRIG); mConceptOperatorVector[CCBACKACTIVIMPL] = new CConceptOperator(CCBACKACTIVIMPL); mConceptOperatorVector[CCDATATYPE] = new CConceptOperator(CCDATATYPE); mConceptOperatorVector[CCDATALITERAL] = new CConceptOperator(CCDATALITERAL); mConceptOperatorVector[CCDATARESTRICTION] = new CConceptOperator(CCDATARESTRICTION); mConceptOperatorVector[CCMARKER] = new CConceptOperator(CCMARKER); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceTypes.cpp0000644000175000017500000001063012520551204027226 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceTypes.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceTypes* CDatatypeValueSpaceTypes::mValueSpaceTypes = nullptr; QMutex* CDatatypeValueSpaceTypes::mCreationMutex = new QMutex(); CDatatypeValueSpaceTypes::CDatatypeValueSpaceTypes() { mValueSpaceTypeLinker = nullptr; mRealValueSpaceType = new CDatatypeValueSpaceRealType(); mUnknownValueSpaceType = new CDatatypeValueSpaceUnknownType(); mStringValueSpaceType = new CDatatypeValueSpaceStringType(); mIRIValueSpaceType = new CDatatypeValueSpaceIRIType(); mXMLValueSpaceType = new CDatatypeValueSpaceXMLType(); mBooleanValueSpaceType = new CDatatypeValueSpaceBooleanType(); mDoubleValueSpaceType = new CDatatypeValueSpaceDoubleType(); mFloatValueSpaceType = new CDatatypeValueSpaceFloatType(); mBinaryHexValueSpaceType = new CDatatypeValueSpaceBinaryHexDataType(); mBinaryBase64ValueSpaceType = new CDatatypeValueSpaceBinaryBase64DataType(); mDateTimeValueSpaceType = new CDatatypeValueSpaceDateTimeType(); mBinaryHexValueSpaceType->setNext(mBooleanValueSpaceType); mBinaryBase64ValueSpaceType->setNext(mBinaryHexValueSpaceType); mDateTimeValueSpaceType->setNext(mBinaryBase64ValueSpaceType); mFloatValueSpaceType->setNext(mDateTimeValueSpaceType); mDoubleValueSpaceType->setNext(mFloatValueSpaceType); mRealValueSpaceType->setNext(mDoubleValueSpaceType); mIRIValueSpaceType->setNext(mRealValueSpaceType); mXMLValueSpaceType->setNext(mIRIValueSpaceType); mStringValueSpaceType->setNext(mXMLValueSpaceType); mUnknownValueSpaceType->setNext(mStringValueSpaceType); mValueSpaceTypeLinker = mUnknownValueSpaceType; } CDatatypeValueSpaceTypes* CDatatypeValueSpaceTypes::getValueSpaceTypes() { if (!mValueSpaceTypes) { mCreationMutex->lock(); if (!mValueSpaceTypes) { mValueSpaceTypes = new CDatatypeValueSpaceTypes(); } mCreationMutex->unlock(); } return mValueSpaceTypes; } CDatatypeValueSpaceType* CDatatypeValueSpaceTypes::getValueSpaceTypeLinker() { return mValueSpaceTypeLinker; } CDatatypeValueSpaceRealType* CDatatypeValueSpaceTypes::getValueSpaceRealType() { return mRealValueSpaceType; } CDatatypeValueSpaceUnknownType* CDatatypeValueSpaceTypes::getValueSpaceUnkownType() { return mUnknownValueSpaceType; } CDatatypeValueSpaceStringType* CDatatypeValueSpaceTypes::getValueSpaceStringType() { return mStringValueSpaceType; } CDatatypeValueSpaceBooleanType* CDatatypeValueSpaceTypes::getValueSpaceBooleanType() { return mBooleanValueSpaceType; } CDatatypeValueSpaceDoubleType* CDatatypeValueSpaceTypes::getValueSpaceDoubleType() { return mDoubleValueSpaceType; } CDatatypeValueSpaceFloatType* CDatatypeValueSpaceTypes::getValueSpaceFloatType() { return mFloatValueSpaceType; } CDatatypeValueSpaceIRIType* CDatatypeValueSpaceTypes::getValueSpaceIRIType() { return mIRIValueSpaceType; } CDatatypeValueSpaceXMLType* CDatatypeValueSpaceTypes::getValueSpaceXMLType() { return mXMLValueSpaceType; } CDatatypeValueSpaceDateTimeType* CDatatypeValueSpaceTypes::getValueSpaceDateTimeType() { return mDateTimeValueSpaceType; } CDatatypeValueSpaceBinaryHexDataType* CDatatypeValueSpaceTypes::getValueSpaceBinaryHexDataType() { return mBinaryHexValueSpaceType; } CDatatypeValueSpaceBinaryBase64DataType* CDatatypeValueSpaceTypes::getValueSpaceBinaryBase64DataType() { return mBinaryBase64ValueSpaceType; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptTextFormater.h0000644000175000017500000000367112520551176026101 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCONCEPTTEXTFORMATER_H #define KONCLUDE_REASONER_ONTOLOGY_CCONCEPTTEXTFORMATER_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CRole.h" #include "CConcept.h" #include "CIndividual.h" #include "CTerminology.h" #include "CIRIName.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CConceptTextFormater * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptTextFormater { // public methods public: //! Constructor CConceptTextFormater(); //! Destructor virtual ~CConceptTextFormater(); static QString getConceptString(CConcept *concept, bool negated, bool useTag = true, qint64 defSkipCount = 1); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPTTEXTFORMATER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualDependenceTracking.cpp0000644000175000017500000000221312520551206030203 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualDependenceTracking.h" namespace Konclude { namespace Reasoner { namespace Ontology { CIndividualDependenceTracking::CIndividualDependenceTracking() { } CIndividualDependenceTracking::~CIndividualDependenceTracking() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralXMLValue.h0000644000175000017500000000576612520551200025700 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATALITERALXMLVALUE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATALITERALXMLVALUE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDataLiteralValue.h" #include "CDataLiteralCompareValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataLiteralXMLValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralXMLValue : public CDataLiteralCompareValue { // public methods public: //! Constructor CDataLiteralXMLValue(); virtual CDataLiteralCompareValue* initValue(CDataLiteralCompareValue* value); CDataLiteralXMLValue* initValueFromInfiniteLength(); CDataLiteralXMLValue* initValueFromLength(cuint64 length); CDataLiteralXMLValue* initValueFromXMLString(const QString& xmlString); CDataLiteralXMLValue* initValue(CDataLiteralXMLValue* value); CDataLiteralXMLValue* clearValue(); virtual DATA_LITERAL_VALUE_TYPE getDataValueType(); bool isInfiniteLength(); cuint64 getLength(); QString getXMLValue(); bool isEqualTo(CDataLiteralValue* value); bool isLessEqualThan(CDataLiteralCompareValue* value); bool isLessThan(CDataLiteralCompareValue* value); bool isEqualTo(CDataLiteralCompareValue* value); bool isGreaterEqualThan(CDataLiteralCompareValue* value); bool isGreaterThan(CDataLiteralCompareValue* value); bool isLessEqualThan(CDataLiteralXMLValue* value); bool isLessThan(CDataLiteralXMLValue* value); bool isEqualTo(CDataLiteralXMLValue* value); bool isGreaterEqualThan(CDataLiteralXMLValue* value); bool isGreaterThan(CDataLiteralXMLValue* value); // protected methods protected: // protected variables protected: bool mInfiniteLength; cuint64 mLength; QString mXMLString; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATALITERALXMLVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStep.h0000644000175000017500000000541012520551212026624 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEP_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEP_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "COntologyProcessingRequirement.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyProcessingStep * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyProcessingStep { // public methods public: enum PROCESSINGSTEPTYPE { OPSACTIVECOUNT = 0, OPSBUILD = 1, OPSPREPROCESS = 2, OPSCONSISTENCY = 3, OPSPRECOMPUTEINDIVIDUAL = 4, OPSPRECOMPUTESATURATION = 5, OPSPRECOMPUTECYCLES = 6, OPSCLASSCLASSIFY = 7, OPSCONCEPTREALIZE = 8, OPSROLEREALIZE = 9, OPSSAMEINDIVIDUALSREALIZE = 10 }; enum PROCESSORTYPE { OPPREPROCESSOR, OPPRECOMPUTER, OPCLASSCLASSIFIER, OPREALIZER }; //! Constructor COntologyProcessingStep(PROCESSINGSTEPTYPE processingType, cint64 id, PROCESSORTYPE processorType); PROCESSINGSTEPTYPE getOntologyProcessingType(); cint64 getProcessingStepID(); COntologyProcessingStep* addProcessingRequirement(COntologyProcessingRequirement* requirement); PROCESSORTYPE getProcessorType(); QList* getProcessingRequirementList(); bool areAllRequirementsSatisfied(COntology* ontology); const QString getProcessingStepName(); // protected methods protected: // protected variables protected: PROCESSINGSTEPTYPE mProcessingType; cint64 mProcessingStepID; PROCESSORTYPE mProcessorType; QList mProcessingRequirementList; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYPROCESSINGSTEP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualProcessData.h0000644000175000017500000000533312520551206026351 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALPROCESSDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALPROCESSDATA_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CIndividualData.h" #include "CComputedConsequencesCachingData.h" #include "CIndividualSaturationReferenceLinkingData.h" #include "CIndividualBackendCachingData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CIndividualProcessData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualProcessData : public CIndividualData { // public methods public: //! Constructor CIndividualProcessData(); CIndividualProcessData* initIndividualProcessExtensionData(); CComputedConsequencesCachingData* getComputedConsequencesCachingData(); CIndividualProcessData* setComputedConsequencesCachingData(CComputedConsequencesCachingData* computedConsequencesCachingData); CIndividualSaturationReferenceLinkingData* getSaturationReferenceLinkingData(); CIndividualProcessData* setSaturationReferenceLinkingData(CIndividualSaturationReferenceLinkingData* refLinkingData); CIndividualBackendCachingData* getBackendCachingData(); CIndividualProcessData* setBackendCachingData(CIndividualBackendCachingData* backendCachingData); // protected methods protected: // protected variables protected: CComputedConsequencesCachingData* mComputedConsequencesCachingData; CIndividualSaturationReferenceLinkingData* mSatRefLinkingData; CIndividualBackendCachingData* mBackendCachingData; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CINDIVIDUALPROCESSDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyLoadingData.cpp0000644000175000017500000000306712520551210026362 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyLoadingData.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyLoadingData::COntologyLoadingData(const QString& ontoIRIString, const QString& loadIRIString) { mLoaded = false; mOntoIRIString = ontoIRIString; mLoadIRIString = loadIRIString; } const QString& COntologyLoadingData::getOntologyIRIString() { return mOntoIRIString; } const QString& COntologyLoadingData::getLoadIRIString() { return mLoadIRIString; } bool COntologyLoadingData::hasLoaded() { return mLoaded; } COntologyLoadingData* COntologyLoadingData::setLoaded(bool loaded) { mLoaded = loaded; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptTextFormater.cpp0000644000175000017500000003452212520551176026433 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptTextFormater.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptTextFormater::CConceptTextFormater() { } CConceptTextFormater::~CConceptTextFormater() { } QString CConceptTextFormater::getConceptString(CConcept *concept, bool negated, bool useTag, qint64 defSkipCount) { CConcept *con = concept; QString className; if (concept->hasClassName()) { defSkipCount--; } if (negated) { className += QChar(0x00AC); } if (defSkipCount <= 0 || useTag || concept->getDefinitionOperatorTag() == CCNONE) { className += QString::number(con->getConceptTag()); QString iriClassNameString = CIRIName::getRecentIRIName(con->getClassNameLinker()); if (!iriClassNameString.isEmpty()) { className += "~"; if (iriClassNameString == "http://www.w3.org/2002/07/owl#Thing") { className += QChar(0x22A4); } else { className += iriClassNameString; } } } if (!concept->hasClassName() || defSkipCount > 0) { if (!className.isEmpty()) { className += " := "; } QString conText; qint64 opCode = con->getProcessingOperatorTag(); CConceptOperator* conOperator = con->getConceptOperator(); if (negated) { conText += QChar(0x00AC); } conText += " ("; if (opCode == CCATOM) { conText += QString::number(con->getConceptTag())+QString("~ATOM"); } if (opCode == CCNOMINAL) { conText += QString::number(con->getConceptTag())+QString("~{%1~%2}").arg(con->getNominalIndividual()->getIndividualID()).arg(CIRIName::getRecentIRIName(con->getNominalIndividual()->getIndividualNameLinker())); } if (opCode == CCVALUE) { conText += QString(" VALUE "); if (con->getRole()->hasPropertyName()) { conText += QString(" %1. ").arg(CIRIName::getRecentIRIName(con->getRole()->getPropertyNameLinker())); } else { conText += QString(" %1. ").arg(con->getRole()->getRoleTag()); } conText += QString::number(con->getConceptTag())+QString("~{%1~%2}").arg(con->getNominalIndividual()->getIndividualID()).arg(CIRIName::getRecentIRIName(con->getNominalIndividual()->getIndividualNameLinker())); } if (opCode == CCEQCAND) { conText += QString::number(con->getConceptTag())+QString("~EQCONCAND"); } if (opCode == CCDATATYPE) { conText += QString::number(con->getConceptTag())+QString("~DATATYPE"); CDatatype* datatype = con->getDatatype(); if (datatype) { conText += QString("-%1").arg(datatype->getDatatypeIRI()); } } if (opCode == CCDATARESTRICTION) { conText += QString::number(con->getConceptTag())+QString("~DATARESTRICTION"); cint64 restrictionCode = con->getParameter(); QString restrictionString; if (restrictionCode == CDFC_RATIONAL) { restrictionString = "rationals-only"; } else if (restrictionCode == CDFC_DECIMAL) { restrictionString = "decimals-only"; } else if (restrictionCode == CDFC_INTEGER) { restrictionString = "integers-only"; } else if (restrictionCode == CDFC_MIN_EXCLUSIVE) { restrictionString = "min-exclusive"; } else if (restrictionCode == CDFC_MIN_INCLUSIVE) { restrictionString = "min-inclusive"; } else if (restrictionCode == CDFC_MAX_INCLUSIVE) { restrictionString = "max-inclusive"; } else if (restrictionCode == CDFC_MAX_EXCLUSIVE) { restrictionString = "max-exclusive"; } conText += QString("-%1").arg(restrictionString); CDataLiteral* dataLiteral = con->getDataLiteral(); if (dataLiteral) { conText += QString(":-{%1}").arg(dataLiteral->getLexicalDataLiteralValueString()); } } if (opCode == CCDATALITERAL) { conText += QString::number(con->getConceptTag())+QString("~DATALITERAL"); CDataLiteral* dataLit = con->getDataLiteral(); if (dataLit) { conText += QString("-{%1}").arg(dataLit->getLexicalDataLiteralValueString()); } } if (opCode == CCIMPLTRIG) { conText += QString::number(con->getConceptTag())+QString("~IMPLTRIG"); } if (opCode == CCBRANCHTRIG) { conText += QString::number(con->getConceptTag())+QString("~BRANCHTRIGGER"); } if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AND_AQAND_TYPE)) { bool opInserted = false; CSortedNegLinker *opLinker = con->getOperandList(); while (opLinker) { if (opInserted) { conText += QString(" AND "); } if (opLinker->isNegated()) { conText += QChar(0x00AC); } opInserted = true; //conText += QString::number(opLinker->getData()->getConceptTag()); conText += getConceptString(opLinker->getData(),false,false,defSkipCount); opLinker = opLinker->getNext(); } } if (opCode == CCPBINDTRIG) { conText += QString::number(con->getConceptTag())+QString("~PBINDTRIG"); } if (opCode == CCVARBINDTRIG) { conText += QString::number(con->getConceptTag())+QString("~VARBINDTRIG"); } if (opCode == CCVARPBACKTRIG) { conText += QString::number(con->getConceptTag())+QString("~VARPBACKTRIG"); } if (opCode == CCBACKACTIVTRIG) { conText += QString::number(con->getConceptTag())+QString("~BACKACTIVTRIG"); } if (opCode == CCAQCHOOCE) { bool opInserted = false; CSortedNegLinker *opLinker = con->getOperandList(); while (opLinker) { if (!opLinker->isNegated()) { conText += getConceptString(opLinker->getData(),false,false,defSkipCount); } opLinker = opLinker->getNext(); } } if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_IMPL_TYPE)) { bool opInserted = false; CSortedNegLinker *opLinker = con->getOperandList(); QString impConText = getConceptString(opLinker->getData(),false,false,defSkipCount); opLinker = opLinker->getNext(); while (opLinker) { if (opInserted) { conText += QString(", "); } if (opLinker->isNegated()) { conText += QChar(0x00AC); } opInserted = true; //conText += QString::number(opLinker->getData()->getConceptTag()); conText += getConceptString(opLinker->getData(),false,false,defSkipCount); opLinker = opLinker->getNext(); } conText += QString(" ---->>> ")+impConText; } if (opCode == CCPBINDCYCLE) { bool opInserted = false; CSortedNegLinker *opLinker = con->getOperandList(); QString impConText = getConceptString(opLinker->getData(),false,false,defSkipCount); opLinker = opLinker->getNext(); while (opLinker) { if (opInserted) { conText += QString(", "); } if (opLinker->isNegated()) { conText += QChar(0x00AC); } opInserted = true; //conText += QString::number(opLinker->getData()->getConceptTag()); conText += getConceptString(opLinker->getData(),false,false,defSkipCount); opLinker = opLinker->getNext(); } conText += QString(" @---->>> ")+impConText; } if (opCode == CCVARBINDJOIN) { bool opInserted = false; CSortedNegLinker *opLinker = con->getOperandList(); QString impConText = getConceptString(opLinker->getData(),false,false,defSkipCount); opLinker = opLinker->getNext(); while (opLinker) { if (opInserted) { conText += QString(", "); } if (opLinker->isNegated()) { conText += QChar(0x00AC); } opInserted = true; //conText += QString::number(opLinker->getData()->getConceptTag()); conText += getConceptString(opLinker->getData(),false,false,defSkipCount); opLinker = opLinker->getNext(); } conText += QString(" |><|---->>> ")+impConText; } if (opCode == CCOR) { bool opInserted = false; CSortedNegLinker *opLinker = con->getOperandList(); while (opLinker) { if (opInserted) { conText += QString(" OR "); } if (opLinker->isNegated()) { conText += QChar(0x00AC); } opInserted = true; //conText += QString::number(opLinker->getData()->getConceptTag()); conText += getConceptString(opLinker->getData(),false,false,defSkipCount); opLinker = opLinker->getNext(); } } if (opCode == CCSOME || opCode == CCAQSOME) { bool opInserted = false; CSortedNegLinker *opLinker = con->getOperandList(); conText += QString(" SOME "); if (con->getRole()->hasPropertyName()) { conText += QString(" %1. ").arg(CIRIName::getRecentIRIName(con->getRole()->getPropertyNameLinker())); } else { conText += QString(" %1. ").arg(con->getRole()->getRoleTag()); } while (opLinker) { if (opInserted) { conText += ", "; } if (opLinker->isNegated()) { conText += QChar(0x00AC); } opInserted = true; //conText += QString::number(opLinker->getData()->getConceptTag()); conText += getConceptString(opLinker->getData(),false,false,defSkipCount); opLinker = opLinker->getNext(); } } if (opCode == CCPBINDVARIABLE) { bool opInserted = false; CSortedNegLinker *opLinker = con->getOperandList(); conText += QString(" PBINDVARIABLE "); while (opLinker) { if (opInserted) { conText += ", "; } if (opLinker->isNegated()) { conText += QChar(0x00AC); } opInserted = true; conText += getConceptString(opLinker->getData(),false,false,defSkipCount); opLinker = opLinker->getNext(); } } if (opCode == CCVARBINDVARIABLE) { bool opInserted = false; CSortedNegLinker *opLinker = con->getOperandList(); conText += QString(" VARBINDVARIABLE "); while (opLinker) { if (opInserted) { conText += ", "; } if (opLinker->isNegated()) { conText += QChar(0x00AC); } opInserted = true; conText += getConceptString(opLinker->getData(),false,false,defSkipCount); opLinker = opLinker->getNext(); } } if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AQALL_TYPE)) { conText += QString(" All "); if (con->getRole()->hasPropertyName()) { conText += QString(" %1. ").arg(CIRIName::getRecentIRIName(con->getRole()->getPropertyNameLinker())); } else { conText += QString(" %1. ").arg(con->getRole()->getRoleTag()); } conText += QString::number(con->getOperandList()->getData()->getConceptTag()); } if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_TYPE)) { bool opInserted = false; CSortedNegLinker *opLinker = con->getOperandList(); conText += QString(" ALL "); if (con->getRole()->hasPropertyName()) { conText += QString(" %1. ").arg(CIRIName::getRecentIRIName(con->getRole()->getPropertyNameLinker())); } else { conText += QString(" %1. ").arg(con->getRole()->getRoleTag()); } while (opLinker) { if (opInserted) { conText += ", "; } if (opLinker->isNegated()) { conText += QChar(0x00AC); } opInserted = true; //conText += QString::number(opLinker->getData()->getConceptTag()); conText += getConceptString(opLinker->getData(),false,false,defSkipCount); opLinker = opLinker->getNext(); } } if (opCode == CCATLEAST) { bool opInserted = false; CSortedNegLinker *opLinker = con->getOperandList(); conText += QString(" ATLEAST "); conText += QString(" [%1]").arg(con->getParameter()); if (con->getRole()->hasPropertyName()) { conText += QString(" %1. ").arg(CIRIName::getRecentIRIName(con->getRole()->getPropertyNameLinker())); } else { conText += QString(" %1. ").arg(con->getRole()->getRoleTag()); } while (opLinker) { if (opInserted) { conText += ", "; } if (opLinker->isNegated()) { conText += QChar(0x00AC); } opInserted = true; //conText += QString::number(opLinker->getData()->getConceptTag()); conText += getConceptString(opLinker->getData(),false,false,defSkipCount); opLinker = opLinker->getNext(); } } if (opCode == CCPBINDGROUND || opCode == CCVARBINDGROUND) { conText += QString(" GROUND "); conText += QString(" [%1]").arg(con->getParameter()); } if (opCode == CCATMOST) { bool opInserted = false; CSortedNegLinker *opLinker = con->getOperandList(); conText += QString(" ATMOST "); conText += QString(" [%1]").arg(con->getParameter()); if (con->getRole()->hasPropertyName()) { conText += QString(" %1. ").arg(CIRIName::getRecentIRIName(con->getRole()->getPropertyNameLinker())); } else { conText += QString(" %1. ").arg(con->getRole()->getRoleTag()); } while (opLinker) { if (opInserted) { conText += ", "; } if (opLinker->isNegated()) { conText += QChar(0x00AC); } opInserted = true; //conText += QString::number(opLinker->getData()->getConceptTag()); conText += getConceptString(opLinker->getData(),false,false,defSkipCount); opLinker = opLinker->getNext(); } } conText += ") "; className += conText; } return className; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptProcessData.cpp0000644000175000017500000001042212520551174026206 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptProcessData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptProcessData::CConceptProcessData() { mConceptRoleBranchTrigger = nullptr; mReplacementData = nullptr; mRefLinking = nullptr; mUnsatCachingTags[0] = nullptr; mUnsatCachingTags[1] = nullptr; mInvalidatedRefLinking = false; mCoreConceptFlags[0] = false; mCoreConceptFlags[1] = false; mPropagationIntoCreationDirection = false; mInferRelevantFlag = false; } CConceptProcessData* CConceptProcessData::initConceptProcessExtensionData(CConceptRoleBranchingTrigger* conceptRoleBranchTrigger, CReplacementData* replacementData) { mConceptRoleBranchTrigger = conceptRoleBranchTrigger; mReplacementData = replacementData; return this; } CConceptRoleBranchingTrigger* CConceptProcessData::getConceptRoleBranchTrigger() { return mConceptRoleBranchTrigger; } bool CConceptProcessData::hasConceptRoleBranchTrigger() { return mConceptRoleBranchTrigger != nullptr; } CConceptProcessData* CConceptProcessData::setConceptRoleBranchTrigger(CConceptRoleBranchingTrigger* conceptRoleBranchTrigger) { mConceptRoleBranchTrigger = conceptRoleBranchTrigger; return this; } CUnsatisfiableCachingTags* CConceptProcessData::getUnsatisfiableCachingTags(bool conceptNegation) { return mUnsatCachingTags[conceptNegation]; } CConceptProcessData* CConceptProcessData::setUnsatisfiableCachingTags(bool conceptNegation, CUnsatisfiableCachingTags* tags) { mUnsatCachingTags[conceptNegation] = tags; return this; } bool CConceptProcessData::hasUnsatisfiableCachingTags(bool conceptNegation) { return mUnsatCachingTags[conceptNegation] != nullptr; } CReplacementData* CConceptProcessData::getReplacementData() { return mReplacementData; } CConceptProcessData* CConceptProcessData::setReplacementData(CReplacementData* replacementData) { mReplacementData = replacementData; return this; } CConceptReferenceLinking* CConceptProcessData::getConceptReferenceLinking() { return mRefLinking; } CConceptProcessData* CConceptProcessData::setConceptReferenceLinking(CConceptReferenceLinking* refLinking) { mRefLinking = refLinking; return this; } bool CConceptProcessData::isInvalidatedReferenceLinking() { return mInvalidatedRefLinking; } CConceptProcessData* CConceptProcessData::setInvalidatedReferenceLinking(bool invalidatedReferenceLinking) { mInvalidatedRefLinking = invalidatedReferenceLinking; return this; } bool CConceptProcessData::isCoreBlockingConcept(bool negated) { return mCoreConceptFlags[negated]; } CConceptProcessData* CConceptProcessData::setCoreBlockingConcept(bool negated, bool coreBlockingConcept) { mCoreConceptFlags[negated] = coreBlockingConcept; return this; } bool CConceptProcessData::hasPropagationIntoCreationDirection() { return mPropagationIntoCreationDirection; } CConceptProcessData* CConceptProcessData::setPropagationIntoCreationDirection(bool propagationIntoCreationDirection) { mPropagationIntoCreationDirection = propagationIntoCreationDirection; return this; } bool CConceptProcessData::hasInferRelevantFlag() { return mInferRelevantFlag; } CConceptProcessData* CConceptProcessData::setInferRelevantFlag(bool flag) { mInferRelevantFlag = flag; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceCompareType.h0000644000175000017500000000431212520551202030015 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACECOMPARETYPE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACECOMPARETYPE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceType.h" #include "CDataLiteralCompareValue.h" // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceCompareType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceCompareType : public CDatatypeValueSpaceType { // public methods public: //! Constructor CDatatypeValueSpaceCompareType(VALUESPACETYPE type); virtual CDataLiteralCompareValue* getMinimumDataLiteralCompareValue() = 0; virtual CDataLiteralCompareValue* getMaximumDataLiteralCompareValue() = 0; virtual bool hasInfiniteManyValues() = 0; virtual cint64 getMaximumValueCount() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACECOMPARETYPE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralCompareValue.cpp0000644000175000017500000000176012520551176027163 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralCompareValue.h" namespace Konclude { namespace Reasoner { namespace Ontology { }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingConceptSaturationRequirement.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingConceptSaturationRequirem0000644000175000017500000000602512520551210032643 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyProcessingConceptSaturationRequirement.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyProcessingConceptSaturationRequirement::COntologyProcessingConceptSaturationRequirement(CConcept* concept, bool conceptNegation, cint64 requiredProcessingFlags, cint64 forbiddenProcessingFlags, cint64 requiredErrorFlags, cint64 forbiddenErrorFlags) { mConcept = concept; mConceptNegation = conceptNegation; mRequiredProcessingFlags = requiredProcessingFlags; mForbiddenProcessingFlags = forbiddenProcessingFlags; mRequiredErrorFlags = requiredErrorFlags; mForbiddenErrorFlags = forbiddenErrorFlags; } bool COntologyProcessingConceptSaturationRequirement::isRequirementSatisfied(COntology* ontology) { if (ontology) { if (!mProcessingStatus.hasPartialProcessingFlags(mRequiredProcessingFlags)) { return false; } if (mProcessingStatus.hasPartialProcessingFlags(mForbiddenProcessingFlags)) { return false; } if (!mProcessingStatus.hasPartialErrorFlags(mRequiredErrorFlags)) { return false; } if (mProcessingStatus.hasPartialErrorFlags(mForbiddenErrorFlags)) { return false; } return true; } return false; } bool COntologyProcessingConceptSaturationRequirement::isDynamicRequirement() { return true; } COntologyProcessingConceptSaturationRequirement* COntologyProcessingConceptSaturationRequirement::submitRequirementUpdate(cint64 processingFlags, cint64 errorFlags) { mProcessingStatus.setProcessingFlags(processingFlags); mProcessingStatus.setErrorFlags(errorFlags); return this; } CConcept* COntologyProcessingConceptSaturationRequirement::getConcept() { return mConcept; } bool COntologyProcessingConceptSaturationRequirement::getConceptNegation() { return mConceptNegation; } const QString COntologyProcessingConceptSaturationRequirement::getRequirementFailureString(COntology* ontology) { QString failureString; if (!isRequirementSatisfied(ontology)) { failureString = QString("Saturation of specified concept failed."); } return failureString; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralFloatValue.cpp0000644000175000017500000001132112520551200026620 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralFloatValue.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDataLiteralFloatValue::CDataLiteralFloatValue() { clearValue(); } CDataLiteralValue::DATA_LITERAL_VALUE_TYPE CDataLiteralFloatValue::getDataValueType() { return CDataLiteralValue::DLVT_FLOAT; } CDataLiteralCompareValue* CDataLiteralFloatValue::initValue(CDataLiteralCompareValue* value) { clearValue(); CDataLiteralFloatValue* floatValue = dynamic_cast(value); if (floatValue) { mFloat = floatValue->mFloat; } return this; } CDataLiteralFloatValue* CDataLiteralFloatValue::initValueFromFloat(float floatValue) { clearValue(); mFloat = floatValue; return this; } CDataLiteralFloatValue* CDataLiteralFloatValue::initValueFromInfinite(bool negative) { clearValue(); if (negative) { mFloat = -std::numeric_limits::infinity(); } else { mFloat = std::numeric_limits::infinity(); } return this; } CDataLiteralFloatValue* CDataLiteralFloatValue::initValue(CDataLiteralFloatValue* value) { if (value) { mFloat = value->mFloat; } return this; } CDataLiteralFloatValue* CDataLiteralFloatValue::clearValue() { mFloat = 0.; return this; } float CDataLiteralFloatValue::getFloat() { return mFloat; } bool CDataLiteralFloatValue::isInfinite() { if (mFloat >= std::numeric_limits::infinity()) { return true; } if (mFloat <= -std::numeric_limits::infinity()) { return true; } return false; } bool CDataLiteralFloatValue::isNegative() { return mFloat < 0; } bool CDataLiteralFloatValue::isEqualTo(CDataLiteralValue* value) { CDataLiteralFloatValue* floatValue = dynamic_cast(value); if (floatValue) { return isEqualTo(floatValue); } return false; } bool CDataLiteralFloatValue::isLessEqualThan(CDataLiteralCompareValue* value) { CDataLiteralFloatValue* floatValue = dynamic_cast(value); if (floatValue) { return isEqualTo(floatValue) || isLessThan(floatValue); } return false; } bool CDataLiteralFloatValue::isLessEqualThan(CDataLiteralFloatValue* floatValue) { return isEqualTo(floatValue) || isLessThan(floatValue); } bool CDataLiteralFloatValue::isEqualTo(CDataLiteralCompareValue* value) { CDataLiteralFloatValue* floatValue = dynamic_cast(value); if (floatValue) { return isEqualTo(floatValue); } return false; } bool CDataLiteralFloatValue::isEqualTo(CDataLiteralFloatValue* floatValue) { return mFloat == floatValue->mFloat; } bool CDataLiteralFloatValue::isGreaterEqualThan(CDataLiteralFloatValue* floatValue) { return isEqualTo(floatValue) || isGreaterThan(floatValue); } bool CDataLiteralFloatValue::isGreaterEqualThan(CDataLiteralCompareValue* value) { CDataLiteralFloatValue* floatValue = dynamic_cast(value); if (floatValue) { return isEqualTo(floatValue) || isGreaterThan(floatValue); } return false; } bool CDataLiteralFloatValue::isGreaterThan(CDataLiteralCompareValue* value) { return value->isLessThan(this); } bool CDataLiteralFloatValue::isGreaterThan(CDataLiteralFloatValue* floatValue) { return floatValue->isLessThan(this); } bool CDataLiteralFloatValue::isLessThan(CDataLiteralCompareValue* value) { CDataLiteralFloatValue* floatValue = dynamic_cast(value); if (floatValue) { return isLessThan(floatValue); } return false; } bool CDataLiteralFloatValue::isLessThan(CDataLiteralFloatValue* floatValue) { if (mFloat < floatValue->mFloat) { return true; } else { return false; } } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralDateTimeValue.h0000644000175000017500000000630512520551176026736 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATALITERALDATETIMEVALUE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATALITERALDATETIMEVALUE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDataLiteralValue.h" #include "CDataLiteralCompareValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataLiteralDateTimeValue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralDateTimeValue : public CDataLiteralCompareValue { // public methods public: //! Constructor CDataLiteralDateTimeValue(); virtual CDataLiteralCompareValue* initValue(CDataLiteralCompareValue* value); CDataLiteralDateTimeValue* initValueFromFirstDateTime(); CDataLiteralDateTimeValue* initValueFromLastDateTime(); CDataLiteralDateTimeValue* initValueFromDataTime(const QDateTime& dateTime, cint64 zoneOffset); CDataLiteralDateTimeValue* initValue(CDataLiteralDateTimeValue* value); CDataLiteralDateTimeValue* clearValue(); virtual DATA_LITERAL_VALUE_TYPE getDataValueType(); bool incrementDateTimeValue(); bool isFirstDateTime(); bool isLastDateTime(); QDateTime getDateTimeValue(); cint64 getTimeZoneOffset(); bool isEqualTo(CDataLiteralValue* value); bool isLessEqualThan(CDataLiteralCompareValue* value); bool isLessThan(CDataLiteralCompareValue* value); bool isEqualTo(CDataLiteralCompareValue* value); bool isGreaterEqualThan(CDataLiteralCompareValue* value); bool isGreaterThan(CDataLiteralCompareValue* value); bool isLessEqualThan(CDataLiteralDateTimeValue* value); bool isLessThan(CDataLiteralDateTimeValue* value); bool isEqualTo(CDataLiteralDateTimeValue* value); bool isGreaterEqualThan(CDataLiteralDateTimeValue* value); bool isGreaterThan(CDataLiteralDateTimeValue* value); // protected methods protected: // protected variables protected: bool mFirstDateTime; bool mLastDateTime; QDateTime mDateTimeValue; cint64 mZoneOffset; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATALITERALDATETIMEVALUE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CNominalSchemaTemplate.h0000644000175000017500000000650112520551210026333 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CNOMINALSCHEMATEMPLATE_H #define KONCLUDE_REASONER_ONTOLOGY_CNOMINALSCHEMATEMPLATE_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CTagItem.h" #include "CConcept.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CNominalSchemaTemplate * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNominalSchemaTemplate : public CTagItem { // public methods public: //! Constructor CNominalSchemaTemplate(); CNominalSchemaTemplate* initNominalSchemaTemplate(CBOXSET* nomSchemaConSet, CBOXHASH* conceptNomSchemaConceptsHash, CBOXHASH* absorbableConceptNomSchemaConceptsHash); CNominalSchemaTemplate* setNominalSchemaTemplateTag(qint64 nomSchemTempTag); qint64 getNominalSchemaTemplateTag(); CNominalSchemaTemplate* setTerminology(CTerminology* ontology); CTerminology* getTerminology(); qint64 getTerminologyTag() const; CNominalSchemaTemplate* setTemplateConcept(CConcept* templateConcept); CConcept* getTemplateConcept(); CNominalSchemaTemplate* setReferenceConcept(CConcept* referenceConcept); CConcept* getReferenceConcept(); CBOXSET* getNominalSchemaConceptSet(); CNominalSchemaTemplate* setNominalSchemaConceptSet(CBOXSET* nomSchemaConSet); CBOXHASH* getTemplateConceptNominalSchemaConceptHash(); CNominalSchemaTemplate* setTemplateConceptNominalSchemaConceptHash(CBOXHASH* conceptNomSchemaConceptsHash); CBOXHASH* getTemplateAbsorbableConceptNominalSchemaConceptHash(); CNominalSchemaTemplate* setTemplateAbsorbableConceptNominalSchemaConceptHash(CBOXHASH* conceptNomSchemaConceptsHash); // protected methods protected: // protected variables protected: CTerminology* mTerm; CConcept* mTemplConcept; CConcept* mRefConcept; CBOXSET* mNomSchemaConSet; CBOXHASH* mConceptNomSchemaConceptsHash; CBOXHASH* mAbsorbableConceptNomSchemaConceptsHash; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CNOMINALSCHEMATEMPLATE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceStringType.h0000644000175000017500000000447612520551204027712 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACESTRINGTYPE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACESTRINGTYPE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceCompareType.h" #include "CDataLiteralStringValue.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceStringType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceStringType : public CDatatypeValueSpaceCompareType { // public methods public: //! Constructor CDatatypeValueSpaceStringType(); CDataLiteralStringValue* getMinimumDataLiteralStringValue(); CDataLiteralStringValue* getMaximumDataLiteralStringValue(); virtual CDataLiteralCompareValue* getMinimumDataLiteralCompareValue(); virtual CDataLiteralCompareValue* getMaximumDataLiteralCompareValue(); virtual bool hasInfiniteManyValues(); virtual cint64 getMaximumValueCount(); // protected methods protected: // protected variables protected: CDataLiteralStringValue* mMinValue; CDataLiteralStringValue* mMaxValue; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACESTRINGTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataBox.h0000644000175000017500000000333412520551176023457 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDataBox_H #define KONCLUDE_REASONER_ONTOLOGY_CDataBox_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDataBox * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataBox { // public methods public: //! Constructor CDataBox(); //! Destructor virtual ~CDataBox(); virtual CBoxContext *getBoxContext(bool create = true) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDataBox_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyProcessingStage.cpp0000644000175000017500000000201012405707546027317 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptData::CConceptData() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeVector.cpp0000644000175000017500000000227112520551204025415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeVector.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeVector::CDatatypeVector(CContext* context) : CDefaultDynamicReferenceVectorBase(context) { } CDatatypeVector::~CDatatypeVector() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryBase64DataTriggers.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryBase64DataTriggers.0000644000175000017500000000315612520551200032112 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeValueSpaceBinaryBase64DataTriggers.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatypeValueSpaceBinaryBase64DataTriggers::CDatatypeValueSpaceBinaryBase64DataTriggers(CBoxContext* boxContext) : CDatatypeValueSpaceCompareTriggers(boxContext) { } CDatatypeValueSpaceBinaryBase64DataTriggers* CDatatypeValueSpaceBinaryBase64DataTriggers::initValueSpaceBinaryBase64DataTriggers(CDatatypeValueSpaceBinaryBase64DataTriggers* data) { initValueSpaceCompareTriggers(data); return this; } CDatatypeValueSpaceConceptTriggeringData* CDatatypeValueSpaceBinaryBase64DataTriggers::getBinaryBase64DataConceptTriggeringData() { return getValueSpaceConceptTriggeringData(); } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CVariable.h0000644000175000017500000000372512520551216023661 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CVARIABLE_H #define KONCLUDE_REASONER_ONTOLOGY_CVARIABLE_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CVariable * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CVariable { // public methods public: //! Constructor CVariable(); CVariable* initVariable(CConcept* nominalConcept, cint64 pathVariableID); bool isNominalVariable(); CConcept* getNominalVariableConcept(); cint64 getPathVariableID(); bool operator<=(const CVariable& beforeData); bool operator<=(const CVariable*& beforeData); // protected methods protected: // protected variables protected: CConcept* mNominalConcept; cint64 mPathVariableID; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CVARIABLE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyExpressivity.h0000644000175000017500000000544412520551210026377 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYEXPRESSIVITY_H #define KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYEXPRESSIVITY_H // Libraries includes // Namespace includes #include "OntologySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class COntologyExpressivity * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyExpressivity { // public methods public: //! Constructor COntologyExpressivity(); COntologyExpressivity(const QString& string); COntologyExpressivity* initExpressivity(const QString& string); QString getExpressivityString(); const static cint64 EXPRESSIVITY_AL = 1; const static cint64 EXPRESSIVITY_C = 2; const static cint64 EXPRESSIVITY_D = 4; const static cint64 EXPRESSIVITY_E = 8; const static cint64 EXPRESSIVITY_EL = 16; const static cint64 EXPRESSIVITY_EPLUSPLUS = 32; const static cint64 EXPRESSIVITY_F = 64; const static cint64 EXPRESSIVITY_H = 128; const static cint64 EXPRESSIVITY_I = 256; const static cint64 EXPRESSIVITY_N = 512; const static cint64 EXPRESSIVITY_O = 1024; const static cint64 EXPRESSIVITY_Q = 2048; const static cint64 EXPRESSIVITY_R = 4096; const static cint64 EXPRESSIVITY_S = 8192; const static cint64 EXPRESSIVITY_TRANS = 16384; const static cint64 EXPRESSIVITY_U = 32768; bool isExpressivityEntailed(COntologyExpressivity* expressivity); bool isExpressivityEqual(COntologyExpressivity* expressivity); // protected methods protected: // protected variables protected: cint64 mExpressivityFlags; QString mExpressivityString; // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CONTOLOGYEXPRESSIVITY_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CNamePrefix.cpp0000644000175000017500000000302012520551206024510 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNamePrefix.h" namespace Konclude { namespace Reasoner { namespace Ontology { CNamePrefix::CNamePrefix(const QString &abbPrefixString, const QString &fullPrefixString) { abbString = abbPrefixString; totString = fullPrefixString; } CNamePrefix::~CNamePrefix() { } CNamePrefix *CNamePrefix::init(const QString &abbPrefixString, const QString &fullPrefixString) { abbString = abbPrefixString; totString = fullPrefixString; return this; } QString CNamePrefix::getAbbreviatedPrefixString() { return abbString; } QString CNamePrefix::getPrefixString() { return totString; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CComputedConsequencesCachingData.cpp0000644000175000017500000000211212520551174030662 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CComputedConsequencesCachingData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CComputedConsequencesCachingData::CComputedConsequencesCachingData() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceUnknownType.h0000644000175000017500000000351212520551204030071 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEUNKNOWNTYPE_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEUNKNOWNTYPE_H // Libraries includes #include // Namespace includes #include "OntologySettings.h" #include "CDatatypeValueSpaceType.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceUnknownType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceUnknownType : public CDatatypeValueSpaceType { // public methods public: //! Constructor CDatatypeValueSpaceUnknownType(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACEUNKNOWNTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatype.cpp0000644000175000017500000000753712520551200024240 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatype.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDatatype::CDatatype() { initDatatype(QString(),false); } CDatatype* CDatatype::initDatatype(const QString& datatypeIRI, bool basic) { setDatatypeTag(0); mDatatypeIRI = datatypeIRI; mBasicDatatype = basic; mDatatpyeBasic = nullptr; mDatatypeConcept = nullptr; mDefinitionConcept = nullptr; mValueSpaceType = nullptr; mNormalized = false; mBasicDatatpyeType = DBT_NON; mDatatpyeType = DT_NON; return this; } CDatatype* CDatatype::initDatatype(const QString& datatypeIRI, cint64 datatypeTag, bool basic) { initDatatype(datatypeIRI,basic); setDatatypeTag(datatypeTag); mDatatypeConcept = nullptr; mDefinitionConcept = nullptr; mValueSpaceType = nullptr; mNormalized = false; mBasicDatatpyeType = DBT_NON; mDatatpyeType = DT_NON; return this; } CDatatype::DATATYPE_BASIC_TYPE CDatatype::getBasicDatatypeType() { return mBasicDatatpyeType; } CDatatype* CDatatype::setBasicDatatypeType(CDatatype::DATATYPE_BASIC_TYPE basicDatatpyeType) { mBasicDatatpyeType = basicDatatpyeType; return this; } CDatatype::DATATYPE_TYPE CDatatype::getDatatypeType() { return mDatatpyeType; } CDatatype* CDatatype::setDatatypeType(CDatatype::DATATYPE_TYPE datatpyeType) { mDatatpyeType = datatpyeType; return this; } CDatatype* CDatatype::setDatatypeTag(qint64 datatypeTag) { CTagItem::setTag(datatypeTag); return this; } cint64 CDatatype::getDatatypeTag() const { return CTagItem::getTag(); } bool CDatatype::isBasicDatatype() { return mBasicDatatype; } CDatatype* CDatatype::setBasicDatatype(bool basic) { mBasicDatatype = basic; return this; } CDatatype* CDatatype::getBasicDatatype() { return mDatatpyeBasic; } CDatatype* CDatatype::setBasicDatatype(CDatatype* basicDatatpye) { mDatatpyeBasic = basicDatatpye; return this; } const QString& CDatatype::getDatatypeIRI() { return mDatatypeIRI; } CConcept* CDatatype::getDatatypeConcept() { return mDatatypeConcept; } bool CDatatype::hasDatatypeConcept() { return mDatatypeConcept != nullptr; } CDatatype* CDatatype::setDatatypeConcept(CConcept* concept) { mDatatypeConcept = concept; return this; } CDatatypeValueSpaceType* CDatatype::getValueSpaceType() { return mValueSpaceType; } CDatatype* CDatatype::setValueSpaceType(CDatatypeValueSpaceType* valueSpaceType) { mValueSpaceType = valueSpaceType; return this; } CConcept* CDatatype::getDefinitionConcept() { return mDefinitionConcept; } CDatatype* CDatatype::setDefinitionConcept(CConcept* concept) { mDefinitionConcept = concept; return this; } bool CDatatype::isNormalized() { return mNormalized; } CDatatype* CDatatype::setNormalized(bool normalized) { mNormalized = normalized; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CComputedConsequencesCachingData.h0000644000175000017500000000333512520551174030337 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CCOMPUTEDCONSEQUENCESCACHINGDATA_H #define KONCLUDE_REASONER_ONTOLOGY_CCOMPUTEDCONSEQUENCESCACHINGDATA_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CComputedConsequencesCachingData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CComputedConsequencesCachingData { // public methods public: //! Constructor CComputedConsequencesCachingData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CCOMPUTEDCONSEQUENCESCACHINGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDatatypeValueSpaceConceptTriggerLinker.h0000644000175000017500000000414512520551202031655 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACECONCEPTTRIGGERLINKER_H #define KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACECONCEPTTRIGGERLINKER_H // Libraries includes // Namespace includes #include "OntologySettings.h" #include "CConcept.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Ontology { /*! * * \class CDatatypeValueSpaceConceptTriggerLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeValueSpaceConceptTriggerLinker : public CLinkerBase { // public methods public: //! Constructor CDatatypeValueSpaceConceptTriggerLinker(); CDatatypeValueSpaceConceptTriggerLinker* initConceptTrigger(CConcept* triggerConcept); CDatatypeValueSpaceConceptTriggerLinker* setConceptTrigger(CConcept* triggerConcept); CConcept* getTriggerConcept(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_ONTOLOGY_CDATATYPEVALUESPACECONCEPTTRIGGERLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CVariable.cpp0000644000175000017500000000324212520551216024206 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CVariable.h" namespace Konclude { namespace Reasoner { namespace Ontology { CVariable::CVariable() { mNominalConcept = nullptr; } CVariable* CVariable::initVariable(CConcept* nominalConcept, cint64 pathVariableID) { mNominalConcept = nominalConcept; mPathVariableID = pathVariableID; return this; } bool CVariable::isNominalVariable() { return mNominalConcept != nullptr; } CConcept* CVariable::getNominalVariableConcept() { return mNominalConcept; } cint64 CVariable::getPathVariableID() { return mPathVariableID; } bool CVariable::operator<=(const CVariable& beforeData) { return this <= &beforeData; } bool CVariable::operator<=(const CVariable*& beforeData) { return this <= beforeData; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/COntologyStringMapping.cpp0000644000175000017500000001516412520551212027000 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyStringMapping.h" namespace Konclude { namespace Reasoner { namespace Ontology { COntologyStringMapping::COntologyStringMapping(COntologyContext* ontologyContext) { mOntoContext = ontologyContext; mClassNameConceptMapHash = nullptr; mPropertyNameRoleMapHash = nullptr; mIndividualNameIndividualMapHash = nullptr; mAbbreviatedNamePrefixMapHash = nullptr; mNamePrefixMapHash = nullptr; mPrefixList = nullptr; } COntologyStringMapping::~COntologyStringMapping() { CMemoryAllocationManager* memMan = CContext::getMemoryAllocationManager(mOntoContext); COADestroyAndRelease(mClassNameConceptMapHash,memMan); COADestroyAndRelease(mPropertyNameRoleMapHash,memMan); COADestroyAndRelease(mIndividualNameIndividualMapHash,memMan); COADestroyAndRelease(mAbbreviatedNamePrefixMapHash,memMan); COADestroyAndRelease(mNamePrefixMapHash,memMan); COADestroyAndRelease(mPrefixList,memMan); } COntologyStringMapping* COntologyStringMapping::referenceStringMapping(COntologyStringMapping* stringMapping) { if (stringMapping->mClassNameConceptMapHash) { (*getClassNameConceptMappingHash(true)) = *stringMapping->mClassNameConceptMapHash; } else { if (mClassNameConceptMapHash) { mClassNameConceptMapHash->clear(); } } if (stringMapping->mPropertyNameRoleMapHash) { (*getPropertyNameRoleMappingHash(true)) = *stringMapping->mPropertyNameRoleMapHash; } else { if (mPropertyNameRoleMapHash) { mPropertyNameRoleMapHash->clear(); } } if (stringMapping->mIndividualNameIndividualMapHash) { (*getIndividualNameIndividualMappingHash(true)) = *stringMapping->mIndividualNameIndividualMapHash; } else { if (mIndividualNameIndividualMapHash) { mIndividualNameIndividualMapHash->clear(); } } if (stringMapping->mAbbreviatedNamePrefixMapHash) { (*getAbbreviatedNamePrefixHash(true)) = *stringMapping->mAbbreviatedNamePrefixMapHash; } else { if (mAbbreviatedNamePrefixMapHash) { mAbbreviatedNamePrefixMapHash->clear(); } } if (stringMapping->mNamePrefixMapHash) { (*getNamePrefixHash(true)) = *stringMapping->mNamePrefixMapHash; } else { if (mNamePrefixMapHash) { mNamePrefixMapHash->clear(); } } if (stringMapping->mPrefixList) { (*getPrefixList(true)) = *stringMapping->mPrefixList; } else { if (mPrefixList) { mPrefixList->clear(); } } return this; } CMAPPINGHASH* COntologyStringMapping::getClassNameConceptMappingHash(bool create) { if (!mClassNameConceptMapHash && create) { mClassNameConceptMapHash = CObjectParameterizingAllocator< CMAPPINGHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntoContext),mOntoContext); } return mClassNameConceptMapHash; } CMAPPINGHASH* COntologyStringMapping::getPropertyNameRoleMappingHash(bool create) { if (!mPropertyNameRoleMapHash && create) { mPropertyNameRoleMapHash = CObjectParameterizingAllocator< CMAPPINGHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntoContext),mOntoContext); } return mPropertyNameRoleMapHash; } CMAPPINGHASH* COntologyStringMapping::getIndividualNameIndividualMappingHash(bool create) { if (!mIndividualNameIndividualMapHash && create) { mIndividualNameIndividualMapHash = CObjectParameterizingAllocator< CMAPPINGHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntoContext),mOntoContext); } return mIndividualNameIndividualMapHash; } CMAPPINGHASH* COntologyStringMapping::getAbbreviatedNamePrefixHash(bool create) { if (!mAbbreviatedNamePrefixMapHash && create) { mAbbreviatedNamePrefixMapHash = CObjectParameterizingAllocator< CMAPPINGHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntoContext),mOntoContext); } return mAbbreviatedNamePrefixMapHash; } CMAPPINGHASH* COntologyStringMapping::getNamePrefixHash(bool create) { if (!mNamePrefixMapHash && create) { mNamePrefixMapHash = CObjectParameterizingAllocator< CMAPPINGHASH,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntoContext),mOntoContext); } return mNamePrefixMapHash; } CMAPPINGLIST* COntologyStringMapping::getPrefixList(bool create) { if (!mPrefixList && create) { mPrefixList = CObjectParameterizingAllocator< CMAPPINGLIST,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mOntoContext),mOntoContext); } return mPrefixList; } CConcept* COntologyStringMapping::getConceptFromName(const QString& fullClassName) { CConcept* concept = nullptr; if (mClassNameConceptMapHash) { concept = mClassNameConceptMapHash->value(fullClassName,nullptr); } return concept; } CRole* COntologyStringMapping::getRoleFromName(const QString& fullPropertyName) { CRole* role = nullptr; if (mPropertyNameRoleMapHash) { role = mPropertyNameRoleMapHash->value(fullPropertyName,nullptr); } return role; } CIndividual* COntologyStringMapping::getIndividualFromName(const QString& fullIndividualName) { CIndividual* individual = nullptr; if (mIndividualNameIndividualMapHash) { individual = mIndividualNameIndividualMapHash->value(fullIndividualName,nullptr); } return individual; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptVector.cpp0000644000175000017500000000226112520551176025244 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptVector.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptVector::CConceptVector(CContext* context) : CDefaultDynamicReferenceVectorBase(context) { } CConceptVector::~CConceptVector() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CConceptSaturationReferenceLinkingData.cpp0000644000175000017500000000620512520551176032062 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptSaturationReferenceLinkingData.h" namespace Konclude { namespace Reasoner { namespace Ontology { CConceptSaturationReferenceLinkingData::CConceptSaturationReferenceLinkingData() { mPositiveSatConRefLinking = nullptr; mNegativeSatConRefLinking = nullptr; mExistentialSuccessorSatConRefLinking = nullptr; } CSaturationConceptReferenceLinking* CConceptSaturationReferenceLinkingData::getPositiveConceptSaturationReferenceLinkingData() { return mPositiveSatConRefLinking; } CConceptSaturationReferenceLinkingData* CConceptSaturationReferenceLinkingData::setPositiveSaturationReferenceLinkingData(CSaturationConceptReferenceLinking* satConRefLinking) { mPositiveSatConRefLinking = satConRefLinking; return this; } CSaturationConceptReferenceLinking* CConceptSaturationReferenceLinkingData::getNegativeConceptSaturationReferenceLinkingData() { return mNegativeSatConRefLinking; } CConceptSaturationReferenceLinkingData* CConceptSaturationReferenceLinkingData::setNegativeSaturationReferenceLinkingData(CSaturationConceptReferenceLinking* satConRefLinking) { mNegativeSatConRefLinking = satConRefLinking; return this; } CConceptSaturationReferenceLinkingData* CConceptSaturationReferenceLinkingData::setSaturationReferenceLinkingData(CSaturationConceptReferenceLinking* satConRefLinking, bool negated) { if (!negated) { mPositiveSatConRefLinking = satConRefLinking; } else { mNegativeSatConRefLinking = satConRefLinking; } return this; } CSaturationConceptReferenceLinking* CConceptSaturationReferenceLinkingData::getConceptSaturationReferenceLinkingData(bool negated) { if (!negated) { return mPositiveSatConRefLinking; } else { return mNegativeSatConRefLinking; } } CSaturationConceptReferenceLinking* CConceptSaturationReferenceLinkingData::getExistentialSuccessorConceptSaturationReferenceLinkingData() { return mExistentialSuccessorSatConRefLinking; } CConceptSaturationReferenceLinkingData* CConceptSaturationReferenceLinkingData::setExistentialSuccessorConceptSaturationReferenceLinkingData(CSaturationConceptReferenceLinking* satConRefLinking) { mExistentialSuccessorSatConRefLinking = satConRefLinking; return this; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CIndividualVector.cpp0000644000175000017500000000232212520551206025731 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualVector.h" namespace Konclude { namespace Reasoner { namespace Ontology { CIndividualVector::CIndividualVector(CBoxContext* boxContext) : CDefaultDynamicReferenceVectorBase(boxContext) { } CIndividualVector::~CIndividualVector() { } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Ontology/CDataLiteralBinaryBase64DataValue.cpp0000644000175000017500000000244412520551176030560 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralBinaryBase64DataValue.h" namespace Konclude { namespace Reasoner { namespace Ontology { CDataLiteralBinaryBase64DataValue::CDataLiteralBinaryBase64DataValue(CContext* context) : CDataLiteralBinaryDataValue(context) { } CDataLiteralValue::DATA_LITERAL_VALUE_TYPE CDataLiteralBinaryBase64DataValue::getDataValueType() { return CDataLiteralValue::DLVT_BASE64BINARY; } }; // end namespace Ontology }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/0000755000175000017500000000000012613407256022173 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/COntologyPreProcess.cpp0000644000175000017500000000213612520551224026614 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { COntologyPreProcess::COntologyPreProcess() { } COntologyPreProcess::~COntologyPreProcess() { } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CConcreteOntologyPreProcess.h0000644000175000017500000000417412520551220027744 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CCONCRETEONTOLOGYPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CCONCRETEONTOLOGYPREPROCESS_H // Libraries includes // Namespace includes #include "COntologyPreProcess.h" // Other includes #include "Reasoner/Ontology/COntology.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CConcreteOntologyPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteOntologyPreProcess : public COntologyPreProcess { // public methods public: //! Constructor CConcreteOntologyPreProcess(); //! Destructor virtual ~CConcreteOntologyPreProcess(); virtual COntology *preprocess(COntology *ontology); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context) = 0; // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CCONCRETEONTOLOGYPREPROCESS_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CReverseRoleAssertionGeneratorPreProcess.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CReverseRoleAssertionGeneratorPreProcess.c0000644000175000017500000002120312520551230032427 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReverseRoleAssertionGeneratorPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CReverseRoleAssertionGeneratorPreProcess::CReverseRoleAssertionGeneratorPreProcess() { } CReverseRoleAssertionGeneratorPreProcess::~CReverseRoleAssertionGeneratorPreProcess() { } bool CReverseRoleAssertionGeneratorPreProcess::isAssertionChanged(CIndividual* indi, CIndividual* prevIndi, CRoleAssertionLinker* roleAssLinker, CPreProcessContext* context) { if (!prevIndi) { return true; } else { CIndividual* destIndi = roleAssLinker->getIndividual(); CRole* role = roleAssLinker->getRole(); for (CRoleAssertionLinker* prevRoleAssLinkerIt = prevIndi->getAssertionRoleLinker(); prevRoleAssLinkerIt; prevRoleAssLinkerIt = prevRoleAssLinkerIt->getNext()) { if (prevRoleAssLinkerIt->getIndividual()->getIndividualID() == destIndi->getIndividualID() && prevRoleAssLinkerIt->getRole() == role) { return false; } } return true; } } CConcreteOntology *CReverseRoleAssertionGeneratorPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { CTBox* tbox = ontology->getDataBoxes()->getTBox(); CABox *abox = ontology->getDataBoxes()->getABox(); CRBox *rbox = ontology->getDataBoxes()->getRBox(); CMBox *mbox = ontology->getDataBoxes()->getMBox(); mBoxMemMan = CContext::getMemoryAllocationManager(ontology->getDataBoxes()->getBoxContext()); mConVec = tbox->getConceptVector(); cint64 conceptCount = mConVec->getItemCount(); mRoleVec = rbox->getRoleVector(); cint64 roleCount = rbox->getRoleCount(); mIndiVec = abox->getIndividualVector(false); if (mIndiVec) { cint64 indiCount = mIndiVec->getItemCount(); if (indiCount > 0) { if (ontology->getDataBoxes()->isInitialBuild()) { for (qint64 i = 0; i < indiCount; ++i) { CIndividual* indi = mIndiVec->getLocalData(i); if (indi) { for (CRoleAssertionLinker* roleAssLinkerIt = indi->getAssertionRoleLinker(); roleAssLinkerIt; roleAssLinkerIt = roleAssLinkerIt->getNext()) { CIndividual* otherIndi = roleAssLinkerIt->getIndividual(); CReverseRoleAssertionLinker* revAssLinker = CObjectAllocator::allocateAndConstruct(mBoxMemMan); revAssLinker->initReverseRoleAssertionLinker(roleAssLinkerIt,indi); otherIndi->addReverseAssertionRoleLinker(revAssLinker); } } } } else { bool deletedABoxAssertions = ontology->getIncrementalRevisionData()->getAxiomChangeData()->hasDeletedABoxAxioms(); QSet directUpdateIndividualSet; QSet reverseAssUpdateIndividualSet; QSet validAssIndividualSet; for (qint64 i = 0; i < indiCount; ++i) { CIndividual* indi = mIndiVec->getLocalData(i); if (indi) { directUpdateIndividualSet.insert(i); if (deletedABoxAssertions) { CIndividual* prevIndividual = mIndiVec->getReferenceData(i); for (CRoleAssertionLinker* roleAssLinkerIt = indi->getAssertionRoleLinker(); roleAssLinkerIt; roleAssLinkerIt = roleAssLinkerIt->getNext()) { CIndividual* otherIndi = roleAssLinkerIt->getIndividual(); if (isAssertionChanged(indi,prevIndividual,roleAssLinkerIt,context)) { reverseAssUpdateIndividualSet.insert(otherIndi->getIndividualID()); } } if (prevIndividual) { for (CRoleAssertionLinker* prevRoleAssLinkerIt = prevIndividual->getAssertionRoleLinker(); prevRoleAssLinkerIt; prevRoleAssLinkerIt = prevRoleAssLinkerIt->getNext()) { CIndividual* otherIndi = prevRoleAssLinkerIt->getIndividual(); if (isAssertionChanged(prevIndividual,indi,prevRoleAssLinkerIt,context)) { reverseAssUpdateIndividualSet.insert(otherIndi->getIndividualID()); } } } if (!indi->getIndividualNominalConcept() && prevIndividual->getIndividualNominalConcept()) { indi->setIndividualNominalConcept(prevIndividual->getIndividualNominalConcept()); } } } } for (QSet::const_iterator indiIt = directUpdateIndividualSet.constBegin(), indiItEnd = directUpdateIndividualSet.constEnd(); indiIt != indiItEnd; ++indiIt) { cint64 indiID = *indiIt; CIndividual* individual = mIndiVec->getLocalData(indiID); CIndividual* prevIndividual = mIndiVec->getReferenceData(individual->getIndividualID()); if (prevIndividual) { for (CReverseRoleAssertionLinker* prevRevRoleAssLinkerIt = prevIndividual->getReverseAssertionRoleLinker(); prevRevRoleAssLinkerIt; prevRevRoleAssLinkerIt = prevRevRoleAssLinkerIt->getNext()) { CIndividual* otherIndi = prevRevRoleAssLinkerIt->getIndividual(); if (!directUpdateIndividualSet.contains(otherIndi->getIndividualID())) { CReverseRoleAssertionLinker* revAssLinker = CObjectAllocator::allocateAndConstruct(mBoxMemMan); revAssLinker->initReverseRoleAssertionLinker(prevRevRoleAssLinkerIt->getRoleAssertion(),otherIndi); individual->addReverseAssertionRoleLinker(revAssLinker); } } } } for (QSet::const_iterator indiIt = reverseAssUpdateIndividualSet.constBegin(), indiItEnd = reverseAssUpdateIndividualSet.constEnd(); indiIt != indiItEnd; ++indiIt) { cint64 indiID = *indiIt; bool local = false; CIndividual* individual = mIndiVec->getData(indiID,&local); if (!local) { CIndividual* locIndividual = CConceptRoleIndividualLocator::getLocatedIndividual(individual,ontology); locIndividual->setAssertionRoleLinker(individual->getAssertionRoleLinker()); for (CReverseRoleAssertionLinker* prevRevRoleAssLinkerIt = individual->getReverseAssertionRoleLinker(); prevRevRoleAssLinkerIt; prevRevRoleAssLinkerIt = prevRevRoleAssLinkerIt->getNext()) { CIndividual* otherIndi = prevRevRoleAssLinkerIt->getIndividual(); if (!directUpdateIndividualSet.contains(otherIndi->getIndividualID())) { CReverseRoleAssertionLinker* revAssLinker = CObjectAllocator::allocateAndConstruct(mBoxMemMan); revAssLinker->initReverseRoleAssertionLinker(prevRevRoleAssLinkerIt->getRoleAssertion(),otherIndi); locIndividual->addReverseAssertionRoleLinker(revAssLinker); } } } } for (QSet::const_iterator indiIt = directUpdateIndividualSet.constBegin(), indiItEnd = directUpdateIndividualSet.constEnd(); indiIt != indiItEnd; ++indiIt) { cint64 indiID = *indiIt; CIndividual* individual = mIndiVec->getLocalData(indiID); CIndividual* prevIndividual = mIndiVec->getReferenceData(indiID); for (CRoleAssertionLinker* roleAssLinkerIt = individual->getAssertionRoleLinker(); roleAssLinkerIt; roleAssLinkerIt = roleAssLinkerIt->getNext()) { CIndividual* otherIndi = roleAssLinkerIt->getIndividual(); if (directUpdateIndividualSet.contains(otherIndi->getIndividualID()) || reverseAssUpdateIndividualSet.contains(otherIndi->getIndividualID())) { //CIndividual* locOtherIndi = mIndiVec->getLocalData(otherIndi->getIndividualID()); CIndividual* locOtherIndi = CConceptRoleIndividualLocator::getLocatedIndividual(otherIndi,ontology); CReverseRoleAssertionLinker* revAssLinker = CObjectAllocator::allocateAndConstruct(mBoxMemMan); revAssLinker->initReverseRoleAssertionLinker(roleAssLinkerIt,individual); locOtherIndi->addReverseAssertionRoleLinker(revAssLinker); } } } } } } return ontology; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreprocessingTestingStep.h0000644000175000017500000000627612520551226027471 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGTESTINGSTEP_H #define KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGTESTINGSTEP_H // Libraries includes // Namespace includes #include "PreprocessSettings.h" // Other includes #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Reasoner/Ontology/COntologyProcessingStepData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CPreprocessingTestingStep * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPreprocessingTestingStep { // public methods public: enum TESTINGSTEPTYPE { BUILDPREPROCESSINGSTEP, PREPROCESSPREPROCESSINGSTEP, ACTIVECOUNTINGPREPROCESSINGSTEP }; //! Constructor CPreprocessingTestingStep(TESTINGSTEPTYPE testingStepType, COntologyProcessingStepData* ontProcStepData, COntologyPreprocessingItem* preproItem); COntologyPreprocessingItem* getOntologyPreprocessingItem(); CPreprocessingTestingStep* setOntologyPreprocessingItem(COntologyPreprocessingItem* preproItem); bool hasRequirements(); bool isStepFinished(); bool areStepProcessingRequirementSatisfied(); CPreprocessingTestingStep* setStepFinished(bool finished); QList* getRequirementList(); COntologyProcessingStepData* getProcessingStepData(); CPreprocessingTestingStep* setProcessingStepData(COntologyProcessingStepData* processingData); CPreprocessingTestingStep* addProcessingRequirement(COntologyProcessingRequirement* processingRequirement); CPreprocessingTestingStep* submitRequirementsUpdate(cint64 flags = COntologyProcessingStatus::PSSUCESSFULL, bool clearRequirements = true); TESTINGSTEPTYPE getPreprocessingTestingType(); // protected methods protected: // protected variables protected: TESTINGSTEPTYPE mTestingStepType; COntologyPreprocessingItem* mOntologyPreproItem; COntologyProcessingStepData* mProcessingStepData; QList mRequirementStepDataList; bool mStepFinished; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGTESTINGSTEP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CNominalSchemaAbsorptionBranchLinker.h0000644000175000017500000000610612520551222031502 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CNOMINALSCHEMAABSORPTIONBRANCHLINKER_H #define KONCLUDE_REASONER_PREPROCESS_CNOMINALSCHEMAABSORPTIONBRANCHLINKER_H // Libraries includes // Namespace includes #include "Reasoner/Ontology/CConcept.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CNominalSchemaAbsorptionBranchLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNominalSchemaAbsorptionBranchLinker : public CLinkerBase { // public methods public: //! Constructor CNominalSchemaAbsorptionBranchLinker(); CNominalSchemaAbsorptionBranchLinker* initNominalSchemaAbsorptionPathLinker(CNominalSchemaAbsorptionBranchLinker* nomSchAbsorpPathLinker); CNominalSchemaAbsorptionBranchLinker* joinNominalSchemaAbsorptionPathLinker(CNominalSchemaAbsorptionBranchLinker* nomSchAbsorpPathLinker1, CNominalSchemaAbsorptionBranchLinker* nomSchAbsorpPathLinker2); QHash* getNominalSchemaBindedConceptTriggerHash(); QSet* getVariableSet(); bool hasVariables(); CConcept* getLastBranchTriggerConcept(); CNominalSchemaAbsorptionBranchLinker* setLastBranchTriggerConcept(CConcept* lastBranchTriggerConcept); CConcept* getBackPropagationBranchTriggerConcept(); CNominalSchemaAbsorptionBranchLinker* setBackPropagationBranchTriggerConcept(CConcept* backPropagationBranchTriggerConcept); CNominalSchemaAbsorptionBranchLinker* addVariable(CVariable* variable); // protected methods protected: // private methods private: QHash mNomSchBindConceptHash; QList mAncestorList; QSet mVariableSet; CConcept* mLastBranchTriggerConcept; CConcept* mBackPropagationBranchTriggerConcept; // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CNOMINALSCHEMAABSORPTIONBRANCHLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CMappingUpdaterPreProcess.h0000644000175000017500000000736612520551222027377 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CMAPPINGUPDATERPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CMAPPINGUPDATERPREPROCESS_H // Libraries includes #include // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" // Other includes #include "Reasoner/Ontology/CBoxContext.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CRoleDependence.h" #include "Reasoner/Ontology/CMBox.h" #include "Utilities/CDynamicExpandingMemoryManager.hpp" #include "Utilities/CSortedNegLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CMappingUpdaterPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMappingUpdaterPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CMappingUpdaterPreProcess(); //! Destructor virtual ~CMappingUpdaterPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: bool collectActiveOntologyItemsFromActiveEntities(); bool collectActiveOntologyItems(); // private methods private: // private variables private: CTBox* tbox; CABox* abox; CRBox* rbox; CMBox* mBox; CRoleVector *mRoleVec; CConceptVector *mConceptVec; COntologyBuildConstructFlags* mBuildConstructFlags; CActiveEntityCountVector* mActiveEntityVector; QSet mUpdateConceptSet; QList mUpdateConceptList; QSet mUpdateRoleSet; QList mUpdateRoleList; QSet mUpdateIndividualSet; QList mUpdateIndividualList; CBUILDHASH* mRoleObjPropTermHash; CBUILDHASH* mObjPropTermRoleHash; CBUILDHASH* mRoleDataPropTermHash; CBUILDHASH* mDataPropTermRoleHash; CBUILDHASH* mClassTermConceptHash; CBUILDHASH* mConceptClassTermHash; CBUILDHASH* mIndiTermIndiHash; CBUILDHASH* mIndiIndiTermHash; CBUILDSET* mDeclarationAxiomSet; CBUILDHASH* mClassTermClassAxiomHash; CBUILDHASH* mObjPropTermObjPropAxiomHash; CMAPPINGHASH* mNameConceptHash; }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CMAPPINGUPDATERPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreprocessingTestingStep.cpp0000644000175000017500000000740212520551226030014 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreprocessingTestingStep.h" #include "COntologyPreprocessingItem.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CPreprocessingTestingStep::CPreprocessingTestingStep(TESTINGSTEPTYPE testingStepType, COntologyProcessingStepData* ontProcStepData, COntologyPreprocessingItem* preproItem) { mTestingStepType = testingStepType; mOntologyPreproItem = preproItem; mProcessingStepData = ontProcStepData; mStepFinished = false; } COntologyPreprocessingItem* CPreprocessingTestingStep::getOntologyPreprocessingItem() { return mOntologyPreproItem; } CPreprocessingTestingStep* CPreprocessingTestingStep::setOntologyPreprocessingItem(COntologyPreprocessingItem* preproItem) { mOntologyPreproItem = preproItem; return this; } bool CPreprocessingTestingStep::isStepFinished() { return mStepFinished; } bool CPreprocessingTestingStep::areStepProcessingRequirementSatisfied() { return mProcessingStepData->getProcessingStep()->areAllRequirementsSatisfied(mOntologyPreproItem->getOntology()); } bool CPreprocessingTestingStep::hasRequirements() { return !mRequirementStepDataList.isEmpty(); } CPreprocessingTestingStep* CPreprocessingTestingStep::setStepFinished(bool finished) { mStepFinished = finished; cint64 installFlags = COntologyProcessingStatus::PSCOMPLETELYYPROCESSED; mProcessingStepData->getProcessingStatus()->setProcessingFlags(installFlags); return this; } QList* CPreprocessingTestingStep::getRequirementList() { return &mRequirementStepDataList; } COntologyProcessingStepData* CPreprocessingTestingStep::getProcessingStepData() { return mProcessingStepData; } CPreprocessingTestingStep::TESTINGSTEPTYPE CPreprocessingTestingStep::getPreprocessingTestingType() { return mTestingStepType; } CPreprocessingTestingStep* CPreprocessingTestingStep::setProcessingStepData(COntologyProcessingStepData* processingData) { mProcessingStepData = processingData; return this; } CPreprocessingTestingStep* CPreprocessingTestingStep::addProcessingRequirement(COntologyProcessingRequirement* processingRequirement) { mRequirementStepDataList.append(processingRequirement); return this; } CPreprocessingTestingStep* CPreprocessingTestingStep::submitRequirementsUpdate(cint64 flags, bool clearRequirements) { mProcessingStepData->getProcessingStatus()->setErrorFlags(flags); for (QList::const_iterator it = mRequirementStepDataList.constBegin(), itEnd = mRequirementStepDataList.constEnd(); it != itEnd; ++it) { COntologyProcessingRequirement* requirement(*it); requirement->submitRequirementUpdate(COntologyProcessingStatus::PSCOMPLETELYYPROCESSED,flags); } if (clearRequirements) { mRequirementStepDataList.clear(); } return this; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/COntologyConfigDependedPreProcesser.h0000644000175000017500000000737412520551224031400 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CONTOLOGYCONFIGDEPENDEDPREPROCESSER_H #define KONCLUDE_REASONER_PREPROCESS_CONTOLOGYCONFIGDEPENDEDPREPROCESSER_H // Libraries includes // Namespace includes #include "COntologyPreProcesser.h" #include "CLexicalNormalisationPreProcess.h" #include "CNegationTransformationPreProcess.h" #include "CSubroleTransformationPreProcess.h" #include "COntologyAssignmentTransformationPreProcess.h" #include "COntologyStructureInspectionPreProcess.h" #include "CRoleChainAutomataTransformationPreProcess.h" #include "CMappingUpdaterPreProcess.h" #include "CBranchTriggerPreProcess.h" #include "COntologyPreProcess.h" #include "CDataExtenderPreProcess.h" #include "CConsistenceCheckerPreProcess.h" #include "CTriggeredImplicationBinaryAbsorberPreProcess.h" #include "CCommonDisjunctConceptExtractionPreProcess.h" #include "CCoreOntologyCyclesExtractorPreProcess.h" #include "CCoreBlockingConceptMarkerPreProcess.h" #include "CFullNominalSchemaGroundingPreProcess.h" #include "CNominalSchemaTemplateExtractionPreProcess.h" #include "CPrecomputationPreProcess.h" #include "CPreProcessContextBase.h" #include "CExtractPropagationIntoCreationDirectionPreProcess.h" #include "CExtractRelevantConceptRolePreProcess.h" #include "CDisjunctSortingPreProcess.h" #include "CDataLiteralNormalizerPreProcess.h" #include "CDatatypeNormalizerPreProcess.h" #include "CReverseRoleAssertionGeneratorPreProcess.h" // Other includes #include "Config/CConfigDataReader.h" #include "Reasoner/Ontology/COntologyTextFormater.h" #include "Control/Command/CCommandRecordRouter.h" #include "Control/Command/Records/CUnspecifiedMessageInformationRecord.h" #include "Logger/CLogIdentifier.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Control::Command; using namespace Control::Command::Records; using namespace Logger; namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class COntologyConfigDependedPreProcesser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyConfigDependedPreProcesser : public COntologyPreProcesser, public CLogIdentifier { // public methods public: //! Constructor COntologyConfigDependedPreProcesser(CCommandRecordRouter &commandRecRouter); COntologyConfigDependedPreProcesser(); //! Destructor virtual ~COntologyConfigDependedPreProcesser(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CConfiguration *config); // protected methods protected: virtual COntologyConfigDependedPreProcesser* reportLog(const QString& string); // protected variables private: CCommandRecordRouter* commandRecordRouter; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CONTOLOGYCONFIGDEPENDEDPREPROCESSER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CConceptUnambiguousHasher.cpp0000644000175000017500000000747512520551220027750 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptUnambiguousHasher.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CConceptUnambiguousHasher::CConceptUnambiguousHasher(CConcept* concept, bool tagRequired) : mConcept(concept),mTagRequired(tagRequired) { mHashValue = calculateHashValue(); } cint64 CConceptUnambiguousHasher::calculateHashValue() { cint64 hashValue = mConcept->getOperatorCode() << 50; if (mTagRequired) { hashValue += mConcept->getConceptTag(); } else { cint64 hashValueExt = ((cint64)mConcept->getRole() << 3)*7; hashValueExt += ((cint64)mConcept->getNominalIndividual())*13; hashValueExt += mConcept->getParameter()*23; hashValue += hashValueExt; cint64 hashValueOps1 = 0; cint64 hashValueOps2 = 1; CSortedNegLinker* opLinkerIt = mConcept->getOperandList(); while (opLinkerIt) { hashValueOps1 += ((cint64)opLinkerIt->getData()) << (opLinkerIt->isNegated()+3); hashValueOps2 *= ((cint64)opLinkerIt->getData()) << (opLinkerIt->isNegated()+3); opLinkerIt = opLinkerIt->getNext(); } hashValue += hashValueOps1+hashValueOps2; } return hashValue; } cint64 CConceptUnambiguousHasher::getConceptHashValue() const { return mHashValue; } bool CConceptUnambiguousHasher::operator==(const CConceptUnambiguousHasher& expressionHasher) const { if (mHashValue != expressionHasher.getConceptHashValue()) { return false; } else { if (mTagRequired != expressionHasher.mTagRequired) { return false; } if (mConcept->getOperatorCode() != expressionHasher.mConcept->getOperatorCode()) { return false; } if (mTagRequired) { if (mConcept->getConceptTag() != expressionHasher.mConcept->getConceptTag()) { return false; } } else { if (mConcept->getRole() != expressionHasher.mConcept->getRole()) { return false; } if (mConcept->getNominalIndividual() != expressionHasher.mConcept->getNominalIndividual()) { return false; } if (mConcept->getParameter() != expressionHasher.mConcept->getParameter()) { return false; } CSortedNegLinker* opLinker1It = mConcept->getOperandList(); CSortedNegLinker* opLinker2 = expressionHasher.mConcept->getOperandList(); while (opLinker1It) { bool foundConcept = false; CSortedNegLinker* opLinker2It = opLinker2; while (opLinker2It && !foundConcept) { if (opLinker1It->getData() == opLinker2It->getData() && opLinker1It->isNegated() == opLinker2It->isNegated()) { foundConcept = true; } else { opLinker2It = opLinker2It->getNext(); } } if (foundConcept) { if (opLinker2 == opLinker2It) { opLinker2 = opLinker2->getNext(); } } else { return false; } opLinker1It = opLinker1It->getNext(); } } } return true; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/COntologyPreProcesser.cpp0000644000175000017500000000215012520551224027137 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyPreProcesser.h" namespace Konclude { namespace Reasoner { namespace Preprocess { COntologyPreProcesser::COntologyPreProcesser() { } COntologyPreProcesser::~COntologyPreProcesser() { } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CRoleChainAutomataTransformationPreProcess.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CRoleChainAutomataTransformationPreProcess0000644000175000017500000020254012577014110032511 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRoleChainAutomataTransformationPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CRoleChainAutomataTransformationPreProcess::CRoleChainAutomataTransformationPreProcess() { mConfSaveTransitiveTransitions = true; } CRoleChainAutomataTransformationPreProcess::~CRoleChainAutomataTransformationPreProcess() { } CConcreteOntology *CRoleChainAutomataTransformationPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { bool complexRoleConstructsUsed = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags()->isComplexRoleUsed(); if (complexRoleConstructsUsed) { mOntology = ontology; CTBox* tbox = ontology->getDataBoxes()->getTBox(); CABox *abox = ontology->getDataBoxes()->getABox(); CRBox *rbox = ontology->getDataBoxes()->getRBox(); CMBox* mBox = ontology->getDataBoxes()->getMBox(); mStatAutomateTransitionConceptCount = 0; mStatAutomateStateConceptCount = 0; mStatAutomateTransformedConceptCount = 0; mStatAutomateTransitiveSavedCount = 0; mStatCreatedDomainPropagationCount = 0; mStatCreatedRangePropagationCount = 0; mStatPropagatedAlreadyInDomainRangeCount = 0; mStatPropagationAlreadyInDomainRangeCount = 0; mStatDomainPropagationCount = 0; mStatRangePropagationCount = 0; mRoleVec = rbox->getRoleVector(); mConVec = tbox->getConceptVector(); mNextConceptTag = mConVec->getItemCount(); mMemMan = ontology->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); mRoleObjPropTermHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getRoleObjectPropertyTermMappingHash(); mObjPropTermRoleHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getObjectPropertyTermRoleMappingHash(); mExpressionBuildContainerList = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getExpressionBuildListContainer(); mInverseObjectPropertyHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getInverseObjectPropertyHash(); mExpressionBuildHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getStructuralExpressionBuildHash(); collectSubRoleChains(); createMissingInverseChainedRoles(); createInverseRoleChainLinkers(); transformVALUERestrictions(); createDomainRangePropagations(); createRecursiveTraversalData(); cint64 conCount = mConVec->getItemCount(); for (qint64 i = 0; i < conCount; ++i) { CConcept *concept = mConVec->getData(i); if (concept) { cint64 opCode = concept->getOperatorCode(); if (opCode == CCALL || opCode == CCSOME || opCode == CCIMPLALL || opCode == CCBRANCHALL || opCode == CCVARBINDALL || opCode == CCPBINDALL || opCode == CCVARPBACKALL) { CRole* role = concept->getRole(); role = mRoleVec->getData(role->getRoleTag()); if (role->isComplexRole()) { concept = CConceptRoleIndividualLocator::getLocatedConcept(concept,ontology); // translate into concept role automate ++mStatAutomateTransformedConceptCount; convertAutomatConcept(concept); } } } } if (mStatAutomateTransformedConceptCount > 0) { LOG(INFO,"::Konclude::Reasoner::Preprocess::RoleChainAutomataTransformation",logTr("Transformed %1 concepts to automate.").arg(mStatAutomateTransformedConceptCount),this); LOG(INFO,"::Konclude::Reasoner::Preprocess::RoleChainAutomataTransformation",logTr("Generated %1 automate state and %2 automate transaction concepts.").arg(mStatAutomateStateConceptCount).arg(mStatAutomateTransitionConceptCount),this); } } return ontology; } CConcreteOntology* CRoleChainAutomataTransformationPreProcess::preprocess(CConcreteOntology *ontology, QSet* transformConceptSet, CPreProcessContext* context) { mOntology = ontology; CTBox* tbox = ontology->getDataBoxes()->getTBox(); CABox *abox = ontology->getDataBoxes()->getABox(); CRBox *rbox = ontology->getDataBoxes()->getRBox(); CMBox* mBox = ontology->getDataBoxes()->getMBox(); mStatAutomateTransitionConceptCount = 0; mStatAutomateStateConceptCount = 0; mStatAutomateTransformedConceptCount = 0; mStatAutomateTransitiveSavedCount = 0; mStatCreatedDomainPropagationCount = 0; mStatCreatedRangePropagationCount = 0; mStatPropagatedAlreadyInDomainRangeCount = 0; mStatPropagationAlreadyInDomainRangeCount = 0; mStatDomainPropagationCount = 0; mStatRangePropagationCount = 0; mRoleVec = rbox->getRoleVector(); mConVec = tbox->getConceptVector(); mNextConceptTag = mConVec->getItemCount(); mMemMan = ontology->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); mRoleObjPropTermHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getRoleObjectPropertyTermMappingHash(); mObjPropTermRoleHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getObjectPropertyTermRoleMappingHash(); mExpressionBuildContainerList = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getExpressionBuildListContainer(); mInverseObjectPropertyHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getInverseObjectPropertyHash(); mExpressionBuildHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getStructuralExpressionBuildHash(); collectSubRoleChains(); createRecursiveTraversalData(); for (QSet::const_iterator conIt = transformConceptSet->constBegin(), conItEnd = transformConceptSet->constEnd(); conIt != conItEnd; ++conIt) { CConcept *concept(*conIt); if (concept) { cint64 opCode = concept->getOperatorCode(); if (opCode == CCALL || opCode == CCSOME || opCode == CCIMPLALL || opCode == CCBRANCHALL || opCode == CCVARBINDALL || opCode == CCPBINDALL || opCode == CCVARPBACKALL) { CRole* role = concept->getRole(); role = mRoleVec->getData(role->getRoleTag()); if (role->isComplexRole()) { concept = CConceptRoleIndividualLocator::getLocatedConcept(concept,ontology); // translate into concept role automate ++mStatAutomateTransformedConceptCount; convertAutomatConcept(concept); } } } } return mOntology; } CRoleChainAutomataTransformationPreProcess* CRoleChainAutomataTransformationPreProcess::transformVALUERestrictions() { cint64 conCount = mConVec->getItemCount(); for (qint64 i = 0; i < conCount; ++i) { bool localFlag = false; CConcept *concept = mConVec->getData(i,&localFlag); if (concept) { bool transformToExistentialNominal = false; cint64 opCode = concept->getOperatorCode(); if (opCode == CCVALUE) { CRole* role = concept->getRole(); role = mRoleVec->getData(role->getRoleTag()); if (role->isComplexRole()) { transformToExistentialNominal = true; } } if (transformToExistentialNominal) { if (!localFlag) { concept = CConceptRoleIndividualLocator::getLocatedConcept(concept,mOntology); } CIndividual* nomIndividual = concept->getNominalIndividual(); concept->setOperatorCode(CCSOME); concept->setNominalIndividual(nullptr); CConcept* nomIndividualConcept = nomIndividual->getIndividualNominalConcept(); if (!nomIndividualConcept) { nomIndividualConcept = createNominalConcept(nomIndividual); } CSortedNegLinker* opLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); opLinker->init(nomIndividualConcept,false); concept->setOperandList(opLinker); } } } return this; } CRoleChainAutomataTransformationPreProcess* CRoleChainAutomataTransformationPreProcess::createDomainRangePropagations() { QSet domRangePropCocneptSet; qint64 itemCounts = mRoleVec->getItemCount(); for (qint64 i = 0; i < itemCounts; ++i) { CRole *role = mRoleVec->getData(i); if (role && role->isComplexRole()) { CRole* inverseRole = nullptr; for (CSortedNegLinker* domainConLinker = role->getDomainConceptList(); domainConLinker; domainConLinker = domainConLinker->getNext()) { CConcept* domCon = domainConLinker->getData(); bool domConNeg = domainConLinker->isNegated(); if (domConNeg || !domRangePropCocneptSet.contains(domCon)) { ++mStatRangePropagationCount; if (!inverseRole) { inverseRole = getInverseRole(role); } QList subRoleItemList; foreach (CRoleSubRoleChainData data, mRoleSubRoleChainDataHash.values(role)) { subRoleItemList.append(CRoleSubRoleChainDataItem(data)); } CConcept* propConcept = nullptr; while (!subRoleItemList.isEmpty()) { CRoleSubRoleChainData subRoleData = nullptr; bool allowPropagatedConcept = true; bool inversedToOrginal = false; CRoleSubRoleChainDataItem dataItem(subRoleItemList.takeFirst()); subRoleData = dataItem.mChainData; allowPropagatedConcept = dataItem.mAllowPropagated; inversedToOrginal = dataItem.mNegated ^ subRoleData.mInverse; CRoleChain* roleChain = subRoleData.mRoleChain; CRole* firstSubRole = nullptr; CRole* lastSubRole = nullptr; if (inversedToOrginal) { firstSubRole = getInverseRole(roleChain->getInverseRoleChainLinker()->getData()); lastSubRole = getInverseRole(roleChain->getInverseRoleChainLinker()->getLastListLink()->getData()); } else { firstSubRole = roleChain->getRoleChainLinker()->getData(); lastSubRole = roleChain->getRoleChainLinker()->getLastListLink()->getData(); } if (!hasPropagationConcept(domConNeg,domCon,inverseRole,lastSubRole->getIndirectSuperRoleList(),true) && (!allowPropagatedConcept || !hasPropagatedConcept(domConNeg,domCon,firstSubRole->getIndirectSuperRoleList(),true))) { if (!propConcept) { propConcept = createTransitionConcept(inverseRole,TTNORMAL); propConcept->setOperatorCode(CCALL); appendTransitionOperandConceptLinker(propConcept,createTransitionOperandConceptLinker(domCon,domConNeg)); } domRangePropCocneptSet.insert(propConcept); CSortedNegLinker* newConLinker = createTransitionOperandConceptLinker(propConcept,false); lastSubRole->addRangeConceptLinker(newConLinker); ++mStatCreatedDomainPropagationCount; foreach (CRoleSubRoleChainData data, mRoleSubRoleChainDataHash.values(lastSubRole)) { subRoleItemList.append(CRoleSubRoleChainDataItem(data,false)); } } } } } for (CSortedNegLinker* rangeConLinker = role->getRangeConceptList(); rangeConLinker; rangeConLinker = rangeConLinker->getNext()) { CConcept* rangeCon = rangeConLinker->getData(); bool rangeConNeg = rangeConLinker->isNegated(); if (rangeConNeg || !domRangePropCocneptSet.contains(rangeCon)) { ++mStatDomainPropagationCount; QList subRoleItemList; foreach (CRoleSubRoleChainData data, mRoleSubRoleChainDataHash.values(role)) { subRoleItemList.append(CRoleSubRoleChainDataItem(data)); } CConcept* propConcept = nullptr; while (!subRoleItemList.isEmpty()) { CRoleSubRoleChainData subRoleData = nullptr; bool allowPropagatedConcept = true; bool inversedToOrginal = false; CRoleSubRoleChainDataItem dataItem(subRoleItemList.takeFirst()); subRoleData = dataItem.mChainData; allowPropagatedConcept = dataItem.mAllowPropagated; inversedToOrginal = dataItem.mNegated ^ subRoleData.mInverse; CRoleChain* roleChain = subRoleData.mRoleChain; CRole* firstSubRole = nullptr; CRole* lastSubRole = nullptr; if (inversedToOrginal) { firstSubRole = getInverseRole(roleChain->getInverseRoleChainLinker()->getData()); lastSubRole = getInverseRole(roleChain->getInverseRoleChainLinker()->getLastListLink()->getData()); } else { firstSubRole = roleChain->getRoleChainLinker()->getData(); lastSubRole = roleChain->getRoleChainLinker()->getLastListLink()->getData(); } if (!hasPropagationConcept(rangeConNeg,rangeCon,role,firstSubRole->getIndirectSuperRoleList(),false) && (!allowPropagatedConcept || !hasPropagatedConcept(rangeConNeg,rangeCon,lastSubRole->getIndirectSuperRoleList(),false))) { if (!propConcept) { propConcept = createTransitionConcept(role,TTNORMAL); propConcept->setOperatorCode(CCALL); appendTransitionOperandConceptLinker(propConcept,createTransitionOperandConceptLinker(rangeCon,rangeConNeg)); } domRangePropCocneptSet.insert(propConcept); CSortedNegLinker* newConLinker = createTransitionOperandConceptLinker(propConcept,false); firstSubRole->addDomainConceptLinker(newConLinker); ++mStatCreatedRangePropagationCount; foreach (CRoleSubRoleChainData data, mRoleSubRoleChainDataHash.values(firstSubRole)) { subRoleItemList.append(CRoleSubRoleChainDataItem(data,false)); } } } } } } } return this; } bool CRoleChainAutomataTransformationPreProcess::hasPropagatedConcept(bool negated, CConcept* concept, CSortedNegLinker* roleList, bool inverseDomRange) { for (CSortedNegLinker* roleListLinker = roleList; roleListLinker; roleListLinker = roleListLinker->getNext()) { CRole* superRole = roleListLinker->getData(); bool superRoleNeg = roleListLinker->isNegated(); bool switchDomainRange = inverseDomRange ^ superRoleNeg; CSortedNegLinker* conList = superRole->getDomainRangeConceptList(!switchDomainRange); for (CSortedNegLinker* conListLinker = conList; conListLinker; conListLinker = conListLinker->getNext()) { CConcept* con = conListLinker->getData(); bool conNeg = conListLinker->isNegated(); cint64 conCode = con->getOperatorCode(); if (con == concept && conNeg == negated) { ++mStatPropagatedAlreadyInDomainRangeCount; return true; } } } return false; } bool CRoleChainAutomataTransformationPreProcess::hasPropagationConcept(bool negated, CConcept* concept, CRole* role, CSortedNegLinker* roleList, bool inverseDomRange) { for (CSortedNegLinker* roleListLinker = roleList; roleListLinker; roleListLinker = roleListLinker->getNext()) { CRole* superRole = roleListLinker->getData(); bool superRoleNeg = roleListLinker->isNegated(); bool switchDomainRange = inverseDomRange ^ superRoleNeg; CSortedNegLinker* conList = superRole->getDomainRangeConceptList(switchDomainRange); for (CSortedNegLinker* conListLinker = conList; conListLinker; conListLinker = conListLinker->getNext()) { CConcept* con = conListLinker->getData(); bool conNeg = conListLinker->isNegated(); if (con->getRole() == role) { cint64 conCode = con->getOperatorCode(); if ((conCode == CCALL || conCode == CCAQALL || conCode == CCIMPLALL) && !conNeg || conNeg && (conCode == CCSOME)) { for (CSortedNegLinker* opListLinker = con->getOperandList(); opListLinker; opListLinker = opListLinker->getNext()) { if (opListLinker->getData() == concept && opListLinker->isNegated()^conNeg == negated) { ++mStatPropagationAlreadyInDomainRangeCount; return true; } } } } } } return false; } CRoleChainAutomataTransformationPreProcess* CRoleChainAutomataTransformationPreProcess::convertAutomatConcept(CConcept* concept) { CSortedNegLinker* opConLinker = concept->getOperandList(); cint64 opCount = concept->getOperandCount(); CRole* role = concept->getRole(); role = mRoleVec->getData(role->getRoleTag()); bool existNegation = false; if (concept->getOperatorCode() == CCSOME) { existNegation = true; } //if (CIRIName::getRecentIRIName(role->getPropertyNameLinker()) == "#LocativeAttribute") { // if (CIRIName::getRecentIRIName(concept->getOperandList()->getData()->getClassNameLinker()) == "#Heart") { // bool bug = true; // } //} // transformation into automat concept bool implTransisition = false; TRANSLATIONTYPE transType = TTNORMAL; cint64 opCode = concept->getOperatorCode(); if (opCode == CCIMPLALL) { // implication transition is never negated transType = TTIMPL; } else if (opCode == CCBRANCHALL) { transType = TTBRANCH; } else if (opCode == CCPBINDALL) { transType = TTPROPBIND; } else if (opCode == CCVARPBACKALL) { transType = TTBACKPROP; } else if (opCode == CCVARBINDALL) { transType = TTVARBIND; } CConcept* generatingConcept = nullptr; CConcept* beginState = nullptr; CConcept* propCon = nullptr; CConcept* endState = nullptr; if (transType == TTNORMAL) { concept->setOperatorCode(CCAQCHOOCE); generatingConcept = createAutomatGeneratingConcept(opConLinker,!existNegation,role); beginState = createStateConcept(transType); } else { beginState = concept; cint64 opCode = CCAQAND; if (transType == TTIMPL) { opCode = CCIMPLAQAND; } else if (transType == TTBRANCH) { opCode = CCBRANCHAQAND; } else if (transType == TTPROPBIND) { opCode = CCPBINDAQAND; } else if (transType == TTBACKPROP) { opCode = CCVARPBACKAQAND; } else if (transType == TTVARBIND) { opCode = CCVARBINDAQAND; } beginState->setOperatorCode(opCode); beginState->setRole(nullptr); } concept->setOperandList(nullptr); concept->setOperandCount(0); propCon = createTransitionConcept(role,transType); endState = createStateConcept(transType); CSortedNegLinker* opLinkerIt = opConLinker; while (opLinkerIt) { CConcept* opConcept = opLinkerIt->getData(); bool opNegation = opLinkerIt->isNegated() ^ existNegation; appendTransitionOperandConceptLinker(endState,createTransitionOperandConceptLinker(opConcept,opNegation)); opLinkerIt = opLinkerIt->getNext(); } if (transType == TTNORMAL) { appendTransitionOperandConceptLinker(concept,createTransitionOperandConceptLinker(generatingConcept,!existNegation)); appendTransitionOperandConceptLinker(concept,createTransitionOperandConceptLinker(beginState,existNegation)); } appendTransitionOperandConceptLinker(beginState,createTransitionOperandConceptLinker(propCon,false)); appendTransitionOperandConceptLinker(propCon,createTransitionOperandConceptLinker(endState,false)); //if (CIRIName::getRecentIRIName(role->getPropertyNameLinker()) == "#isInLawOf") { // bool bug = true; //} //const QList subRoleChainDataList(mRoleSubRoleChainDataHash.values(role)); const CRecTravSubRoleChainDataItem& recTravSubRoleChainDataItem(mRoleRecTravSubRoleChainDataHash.value(role)); QSet locUnfoldRoleSet; generateRoleChainAutomatConcept(role,recTravSubRoleChainDataItem,locUnfoldRoleSet,beginState,endState,transType); // search fitting sub role chains //bool hasFittingSubRole = false; //QList subRoleChainDataList(mRoleSubRoleChainDataHash.values(role)); //hasFittingSubRole = !subRoleChainDataList.isEmpty(); //if (hasFittingSubRole) { // bool transitiveRole = true; // for (QList::const_iterator it = subRoleChainDataList.constBegin(), itEnd = subRoleChainDataList.constEnd(); it != itEnd; ++it) { // CRoleSubRoleChainData subRoleChainData(*it); // CRoleChain* subRoleChain = subRoleChainData.mRoleChain; // bool subRoleNegation = subRoleChainData.mInverse; // CRole* superRole = subRoleChainData.mRole; // CXLinker* roleChainLinkerIt = subRoleChain->getRoleChainLinker(); // while (roleChainLinkerIt) { // CRole* chainRole = roleChainLinkerIt->getData(); // if (chainRole != superRole) { // transitiveRole = false; // break; // } // roleChainLinkerIt = roleChainLinkerIt->getNext(); // } // } // if (transitiveRole && subRoleChainDataList.count() > 1) { // QHash roleCountHash; // QHash roleChainDataHash; // for (QList::const_iterator it = subRoleChainDataList.constBegin(), itEnd = subRoleChainDataList.constEnd(); it != itEnd; ++it) { // CRoleSubRoleChainData subRoleChainData(*it); // CRole* superRole = subRoleChainData.mRole; // roleCountHash.insert(superRole,0); // roleChainDataHash.insert(superRole,subRoleChainData); // } // for (QList::const_iterator it = subRoleChainDataList.constBegin(), itEnd = subRoleChainDataList.constEnd(); it != itEnd; ++it) { // CRoleSubRoleChainData subRoleChainData(*it); // CRole* superRole = subRoleChainData.mRole; // CSortedNegLinker* superSuperLinkerIt = superRole->getIndirectSuperRoleList(); // while (superSuperLinkerIt) { // CRole* superSuperRole = superSuperLinkerIt->getData(); // cint64 count = roleCountHash.value(superSuperRole,-1); // if (count >= 0) { // roleCountHash.insert(superSuperRole,count+1); // } // superSuperLinkerIt = superSuperLinkerIt->getNext(); // } // } // QMap countRoleMap; // for (QHash::const_iterator it = roleCountHash.constBegin(), itEnd = roleCountHash.constEnd(); it != itEnd; ++it) { // CRole* role = it.key(); // cint64 count = it.value(); // countRoleMap.insertMulti(-count,role); // } // QSet locUnfoldRoleSet; // for (QMap::const_iterator it = countRoleMap.constBegin(), itEnd = countRoleMap.constEnd(); it != itEnd; ++it) { // CRole* superRole = it.value(); // CRoleSubRoleChainData subRoleChainData(roleChainDataHash.value(superRole)); // CRoleChain* subRoleChain = subRoleChainData.mRoleChain; // bool subRoleNegation = subRoleChainData.mInverse; // bool requiresAutomatGeneration = true; // CSortedNegLinker* superSuperLinkerIt = superRole->getIndirectSuperRoleList(); // while (superSuperLinkerIt) { // CRole* superSuperRole = superSuperLinkerIt->getData(); // if (locUnfoldRoleSet.contains(superSuperRole)) { // requiresAutomatGeneration = false; // break; // } // superSuperLinkerIt = superSuperLinkerIt->getNext(); // } // if (requiresAutomatGeneration) { // locUnfoldRoleSet.insert(superRole); // generateRoleChainAutomatConcept(role,superRole,subRoleChain,subRoleNegation,locUnfoldRoleSet,beginState,endState,transType); // } else { // ++mStatAutomateTransitiveSavedCount; // } // } // } else { // for (QList::const_iterator it = subRoleChainDataList.constBegin(), itEnd = subRoleChainDataList.constEnd(); it != itEnd; ++it) { // CRoleSubRoleChainData subRoleChainData(*it); // CRoleChain* subRoleChain = subRoleChainData.mRoleChain; // bool subRoleNegation = subRoleChainData.mInverse; // CRole* superRole = subRoleChainData.mRole; // CSortedNegLinker* superSuperLinkerIt = superRole->getIndirectSuperRoleList(); // QSet locUnfoldRoleSet; // locUnfoldRoleSet.insert(role); // while (superSuperLinkerIt) { // CRole* superSuperRole = superSuperLinkerIt->getData(); // locUnfoldRoleSet.insert(superSuperRole); // superSuperLinkerIt = superSuperLinkerIt->getNext(); // } // generateRoleChainAutomatConcept(role,superRole,subRoleChain,subRoleNegation,locUnfoldRoleSet,beginState,endState,transType); // } // } //} return this; } CConcept* CRoleChainAutomataTransformationPreProcess::createAutomatGeneratingConcept(CSortedNegLinker* opLinker, bool negate, CRole* role) { CConcept* concept = nullptr; concept = CObjectAllocator::allocateAndConstruct(mMemMan); concept->initConcept(); cint64 conTag = mNextConceptTag++; concept->setConceptTag(conTag); mConVec->setData(conTag,concept); concept->setOperatorCode(CCAQSOME); concept->setRole(role); CSortedNegLinker* opLinkerIt = opLinker; while (opLinkerIt) { CConcept* opConcept = opLinkerIt->getData(); bool opNegation = opLinkerIt->isNegated() ^ negate; appendTransitionOperandConceptLinker(concept,createTransitionOperandConceptLinker(opConcept,opNegation)); opLinkerIt = opLinkerIt->getNext(); } return concept; } CRoleChainAutomataTransformationPreProcess* CRoleChainAutomataTransformationPreProcess::createInverseRoleChainLinkers() { FOREACHIT (CRoleChain* roleChain, mInverseUpdateRoleChainSet) { if (!roleChain->getInverseRoleChainLinker()) { CXLinker* roleLinkerIt = roleChain->getRoleChainLinker(); while (roleLinkerIt) { CRole* chainedRole = roleLinkerIt->getData(); CXLinker* invRoleLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(mMemMan); invRoleLinker->initLinker(chainedRole); roleChain->prependInverseRoleChainLinker(invRoleLinker); roleLinkerIt = roleLinkerIt->getNext(); } } } return this; } CRoleChainAutomataTransformationPreProcess* CRoleChainAutomataTransformationPreProcess::createMissingInverseChainedRoles() { // collect direct and indirect sub roles QHash > roleTagIndirectSubRoleTagNegationHash; QHash > roleTagSubRoleTagNegationHash; qint64 itemCounts = mRoleVec->getItemCount(); for (qint64 i = 0; i < itemCounts; ++i) { CRole *role = mRoleVec->getData(i); if (role) { cint64 roleTag = role->getRoleTag(); CSortedNegLinker* inSuperRoleLinkerIt = role->getIndirectSuperRoleList(); while (inSuperRoleLinkerIt) { CRole* superRole = inSuperRoleLinkerIt->getData(); cint64 superRoleTag = superRole->getRoleTag(); bool superRoleNeg = inSuperRoleLinkerIt->isNegated(); roleTagIndirectSubRoleTagNegationHash.insertMulti(superRoleTag,QPair(roleTag,superRoleNeg)); inSuperRoleLinkerIt = inSuperRoleLinkerIt->getNext(); } CSortedNegLinker* superRoleLinkerIt = role->getSuperRoleList(); while (superRoleLinkerIt) { CRole* superRole = superRoleLinkerIt->getData(); cint64 superRoleTag = superRole->getRoleTag(); bool superRoleNeg = superRoleLinkerIt->isNegated(); roleTagSubRoleTagNegationHash.insertMulti(superRoleTag,QPair(roleTag,superRoleNeg)); superRoleLinkerIt = superRoleLinkerIt->getNext(); } } } // build missing inverse roles QSet needsInverseRoleSet; for (qint64 i = 0; i < itemCounts; ++i) { CRole *role = mRoleVec->getLocalData(i); if (role) { if (role->isComplexRole()) { if (role->getDomainConceptList()) { needsInverseRoleSet.insert(role); } if (hasInverseRole(role) || role->getDomainConceptList() || role->getRangeConceptList()) { // check whether it is necessary to build additional inverse roles QList subRoleInvSearchList; QSet subRoleInvSearchSet; subRoleInvSearchList.append(role); subRoleInvSearchSet.insert(role); while (!subRoleInvSearchList.isEmpty()) { CRole* subRoleInvSearchRole = subRoleInvSearchList.takeFirst(); QList subRoleChainDataList(mRoleSubRoleChainDataHash.values(subRoleInvSearchRole)); for (QList::const_iterator it = subRoleChainDataList.constBegin(), itEnd = subRoleChainDataList.constEnd(); it != itEnd; ++it) { CRoleSubRoleChainData subRoleChainData(*it); CRoleChain* subRoleChain = subRoleChainData.mRoleChain; bool subRoleNegation = subRoleChainData.mInverse; CRole* superRole = subRoleChainData.mRole; needsInverseRoleSet.insert(superRole); CXLinker* chainedSubRoleLinkerIt = subRoleChain->getRoleChainLinker(); while (chainedSubRoleLinkerIt) { CRole* subRole = chainedSubRoleLinkerIt->getData(); needsInverseRoleSet.insert(subRole); if (!subRoleInvSearchSet.contains(subRole)) { subRoleInvSearchSet.insert(subRole); subRoleInvSearchList.append(subRole); } chainedSubRoleLinkerIt = chainedSubRoleLinkerIt->getNext(); } } } } } } } bool updatedInverseRoles = false; FOREACHIT (CRole* role, needsInverseRoleSet) { if (!hasInverseRole(role)) { // build additional inverse role role = getLocalizedRole(role); updatedInverseRoles = true; CRole* inverseRole = CObjectAllocator< CRole >::allocateAndConstruct(mMemMan); inverseRole->initRole(); cint64 inverseRoleTag = mRoleVec->getItemCount(); inverseRole->setRoleTag(inverseRoleTag); inverseRole->setRoleComplexity(role->getRoleComplexity()); mRoleVec->setData(inverseRole->getRoleTag(),inverseRole); CSortedNegLinker* invRoleLinker1 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); invRoleLinker1->init(role,true); inverseRole->addSuperRoleLinker(invRoleLinker1); CSortedNegLinker* invRoleLinker2 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); invRoleLinker2->init(inverseRole,true); role->addSuperRoleLinker(invRoleLinker2); CObjectPropertyTermExpression* buildExpression = mRoleObjPropTermHash->value(role); CInverseObjectPropertyOfExpression* expression = nullptr; expression = new CInverseObjectPropertyOfExpression(buildExpression); mExpressionBuildHash->insert(CExpressionHasher(expression),expression); mInverseObjectPropertyHash->insert(buildExpression,expression); mInverseObjectPropertyHash->insert(expression,buildExpression); mExpressionBuildContainerList->append(expression); mRoleObjPropTermHash->insert(role,expression); mObjPropTermRoleHash->insert(expression,role); QList< QPair > subRoleTagList(roleTagSubRoleTagNegationHash.values(role->getRoleTag())); for (QList< QPair >::const_iterator it = subRoleTagList.constBegin(), itEnd = subRoleTagList.constEnd(); it != itEnd; ++it) { cint64 subRoleTag = it->first; CRole* subRole = getLocalizedRole(subRoleTag); // add new inverse super role CSortedNegLinker* superRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); superRoleLinker->init(inverseRole,!it->second); subRole->addSuperRoleLinker(superRoleLinker); } QList< QPair > indSubRoleTagList(roleTagIndirectSubRoleTagNegationHash.values(role->getRoleTag())); for (QList< QPair >::const_iterator it = indSubRoleTagList.constBegin(), itEnd = indSubRoleTagList.constEnd(); it != itEnd; ++it) { cint64 subRoleTag = it->first; CRole* subRole = getLocalizedRole(subRoleTag); // add new inverse super role CSortedNegLinker* superRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); superRoleLinker->init(inverseRole,!it->second); subRole->addIndirectSuperRoleLinker(superRoleLinker); } // copy indirect super role linker to new inverse role CSortedNegLinker* inSuperRoleLinkerIt = role->getIndirectSuperRoleList(); while (inSuperRoleLinkerIt) { CRole* superRole = inSuperRoleLinkerIt->getData(); cint64 superRoleTag = superRole->getRoleTag(); bool superRoleNeg = inSuperRoleLinkerIt->isNegated(); CSortedNegLinker* invSuperRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); invSuperRoleLinker->init(superRole,!superRoleNeg); inverseRole->addIndirectSuperRoleLinker(invSuperRoleLinker); roleTagIndirectSubRoleTagNegationHash.insertMulti(superRoleTag,QPair(inverseRoleTag,!superRoleNeg)); inSuperRoleLinkerIt = inSuperRoleLinkerIt->getNext(); } // copy super role linker to new inverse role CSortedNegLinker* superRoleLinkerIt = role->getSuperRoleList(); while (superRoleLinkerIt) { CRole* superRole = superRoleLinkerIt->getData(); cint64 superRoleTag = superRole->getRoleTag(); bool superRoleNeg = superRoleLinkerIt->isNegated(); CSortedNegLinker* invSuperRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); invSuperRoleLinker->init(superRole,!superRoleNeg); inverseRole->addSuperRoleLinker(invSuperRoleLinker); roleTagSubRoleTagNegationHash.insertMulti(superRoleTag,QPair(inverseRoleTag,!superRoleNeg)); superRoleLinkerIt = superRoleLinkerIt->getNext(); } } } if (updatedInverseRoles) { mRoleSubRoleChainDataHash.clear(); collectSubRoleChains(); } return this; } bool CRoleChainAutomataTransformationPreProcess::hasInverseRole(CRole* role, bool searchInverseEquivalent) { return getInverseRole(role,searchInverseEquivalent) != nullptr; } CRole* CRoleChainAutomataTransformationPreProcess::getInverseRole(CRole* role, bool searchInverseEquivalent) { CRole* inverseRole = role->getInverseRole(); if (inverseRole) { return inverseRole; } CSortedNegLinker< CRole* >* inEqRoleLinkerIt = role->getInverseEquivalentRoleList(); while (inEqRoleLinkerIt) { CRole* invEqRole = inEqRoleLinkerIt->getData(); bool invEqRoleNeg = inEqRoleLinkerIt->isNegated(); if (invEqRoleNeg) { return invEqRole; } inEqRoleLinkerIt = inEqRoleLinkerIt->getNext(); } CSortedNegLinker< CRole* >* suberRoleLinkerIt = role->getSuperRoleList(); while (suberRoleLinkerIt) { CRole* superRole = suberRoleLinkerIt->getData(); bool superRoleNeg = suberRoleLinkerIt->isNegated(); if (superRoleNeg) { if (!searchInverseEquivalent) { return superRole; } else { CSortedNegLinker< CRole* >* invSuberRoleLinkerIt = superRole->getSuperRoleList(); while (invSuberRoleLinkerIt) { if (invSuberRoleLinkerIt->getData()->getRoleTag() == role->getRoleTag()) { return superRole; } invSuberRoleLinkerIt = invSuberRoleLinkerIt->getNext(); } } } suberRoleLinkerIt = suberRoleLinkerIt->getNext(); } return nullptr; } bool CRoleChainAutomataTransformationPreProcess::hasInversedOrNonInversedSuperRole(CRole* role, CRole* testingSuperRole) { return hasSuperRole(role,testingSuperRole,false,false); } bool CRoleChainAutomataTransformationPreProcess::hasInversedSuperRole(CRole* role, CRole* testingSuperRole) { return hasSuperRole(role,testingSuperRole,true,true); } bool CRoleChainAutomataTransformationPreProcess::hasNonInversedSuperRole(CRole* role, CRole* testingSuperRole) { return hasSuperRole(role,testingSuperRole,true,false); } bool CRoleChainAutomataTransformationPreProcess::hasSuperRole(CRole* role, CRole* testingSuperRole, bool superRoleInversedRequired) { return hasSuperRole(role,testingSuperRole,true,superRoleInversedRequired); } bool CRoleChainAutomataTransformationPreProcess::hasSuperRole(CRole* role, CRole* testingSuperRole, bool testInversed, bool superRoleInversedRequired) { for (CSortedNegLinker* superRoleLinkerIt = role->getIndirectSuperRoleList(); superRoleLinkerIt; superRoleLinkerIt = superRoleLinkerIt->getNext()) { CRole* superRole = superRoleLinkerIt->getData(); if (superRole == testingSuperRole) { if (testInversed) { if (superRoleLinkerIt->isNegated() == superRoleInversedRequired) { return true; } } else { return true; } } } return false; } bool CRoleChainAutomataTransformationPreProcess::isChainLinkerImplicit(CXLinker* testingImplicitChainLinker, CXLinker* chainLinker, bool inversedTesting) { CXLinker* testingChainLinkerIt = testingImplicitChainLinker; CXLinker* chainLinkerIt = chainLinker; for (; testingChainLinkerIt && chainLinkerIt; testingChainLinkerIt = testingChainLinkerIt->getNext(), chainLinkerIt = chainLinkerIt->getNext()) { CRole* testingChainRole = testingChainLinkerIt->getData(); CRole* chainRole = chainLinkerIt->getData(); if (!hasSuperRole(testingChainRole,chainRole,inversedTesting)) { return false; } } if (testingChainLinkerIt || chainLinkerIt) { return false; } return true; } bool CRoleChainAutomataTransformationPreProcess::isTransitiveChainData(const CRoleSubRoleChainData& chainData) { cint64 transChainedRoleCount = 0; CRole* chainSuperRole = chainData.mRole; for (CXLinker* chainLinkerIt = chainData.mRoleChain->getRoleChainLinker(); chainLinkerIt ; chainLinkerIt = chainLinkerIt->getNext()) { CRole* chainedRole = chainLinkerIt->getData(); if (chainedRole != chainSuperRole) { return false; } ++transChainedRoleCount; } if (transChainedRoleCount == 2) { return true; } return false; } bool CRoleChainAutomataTransformationPreProcess::isChainDataImplicit(const CRoleSubRoleChainData& testingImplicitChainData, const CRoleSubRoleChainData& chainData) { // the testingImplicitChainData is implicit if every used role is a subrole of the corresponding role in chainData CRole* testingChainSuperRole = testingImplicitChainData.mRole; CRole* chainSuperRole = chainData.mRole; bool inversedTesting = chainData.mInverse ^ testingImplicitChainData.mInverse; if (hasInversedOrNonInversedSuperRole(testingChainSuperRole,chainSuperRole)) { if (!inversedTesting && hasNonInversedSuperRole(testingChainSuperRole,chainSuperRole)) { CXLinker* testingChainLinker = testingImplicitChainData.mRoleChain->getRoleChainLinker(); CXLinker* chainLinker = chainData.mRoleChain->getRoleChainLinker(); if (isChainLinkerImplicit(testingChainLinker,chainLinker,false)) { return true; } } if (inversedTesting && hasInversedSuperRole(testingChainSuperRole,chainSuperRole)) { CXLinker* testingChainLinker = testingImplicitChainData.mRoleChain->getRoleChainLinker(); CXLinker* chainLinker = chainData.mRoleChain->getInverseRoleChainLinker(); if (isChainLinkerImplicit(testingChainLinker,chainLinker,true)) { return true; } } } return false; } bool CRoleChainAutomataTransformationPreProcess::isChainDataRecursiveTraversalCritical(CRole* role, const CRoleSubRoleChainData& chainData) { // test first and last chain linker CRole* chainSuperRole = chainData.mRole; if (chainSuperRole != role) { if (!hasInversedOrNonInversedSuperRole(role,chainSuperRole)) { CXLinker* chainLinkerIt = chainData.mRoleChain->getRoleChainLinker(); if (chainLinkerIt->getData() == chainSuperRole) { return true; } if (chainLinkerIt->getLastListLink()->getData() == chainSuperRole) { return true; } } } return false; } QList CRoleChainAutomataTransformationPreProcess::getRelevantChainDataList(CRole* role, const QList& roleSubChainDataList) { QList relevantChainDataList; for (QList::const_iterator it = roleSubChainDataList.constBegin(), itEnd = roleSubChainDataList.constEnd(); it != itEnd; ++it) { const CRoleSubRoleChainData& roleChainData(*it); bool hasImplicitRoleChainData = false; QList::const_iterator it2 = it; for (++it2; it2 != itEnd && !hasImplicitRoleChainData; ++it2) { const CRoleSubRoleChainData& roleChainData2(*it2); if (isChainDataImplicit(roleChainData,roleChainData2)) { hasImplicitRoleChainData = true; } } for (QList::const_iterator it2 = relevantChainDataList.constBegin(), it2End = relevantChainDataList.constEnd(); it2 != it2End && !hasImplicitRoleChainData; ++it2) { const CRoleSubRoleChainData& roleChainData2(*it2); if (isChainDataImplicit(roleChainData,roleChainData2)) { hasImplicitRoleChainData = true; } } if (!hasImplicitRoleChainData) { relevantChainDataList.append(roleChainData); } } return relevantChainDataList; } QHash CRoleChainAutomataTransformationPreProcess::getRelevantRecursiveTraversalCriticalRoles(QHash* criticalRoleNegationHash) { // return the most general roles QHash criticalGeneralRoleNegationHash; for (QHash::const_iterator it = criticalRoleNegationHash->constBegin(), itEnd = criticalRoleNegationHash->constEnd(); it != itEnd; ++it) { CRole* role = it.key(); bool roleInversed = it.value(); bool hasCriticalSuperRole = false; QHash::const_iterator it2 = it; for (++it2; it2 != itEnd && !hasCriticalSuperRole; ++it2) { CRole* role2 = it2.key(); bool role2Inversed = it2.value(); if (role != role2) { if (hasInversedOrNonInversedSuperRole(role,role2)) { hasCriticalSuperRole = true; } } } for (QHash::const_iterator it2 = criticalGeneralRoleNegationHash.constBegin(), it2End = criticalGeneralRoleNegationHash.constEnd(); it2 != it2End && !hasCriticalSuperRole; ++it2) { CRole* role2 = it2.key(); bool role2Inversed = it2.value(); if (role != role2) { if (hasInversedOrNonInversedSuperRole(role,role2)) { hasCriticalSuperRole = true; } } } if (!hasCriticalSuperRole) { criticalGeneralRoleNegationHash.insert(role,roleInversed); } } return criticalGeneralRoleNegationHash; } bool CRoleChainAutomataTransformationPreProcess::collectRecursiveTraversalCriticalRoles(CRole* role, const CRoleSubRoleChainData& chainData, QHash* criticalRoleNegationHash) { if (isChainDataRecursiveTraversalCritical(role,chainData)) { CRole* chainSuperRole = chainData.mRole; bool negatedSuperRole = chainData.mInverse; criticalRoleNegationHash->insert(chainSuperRole,negatedSuperRole); return true; } return false; } bool CRoleChainAutomataTransformationPreProcess::requiresRecursiveTraversalForRole(CRole* role, const CRoleSubRoleChainData& chainData, QHash* criticalRoleNegationHash) { CRole* chainSuperRole = chainData.mRole; for (CSortedNegLinker* superRoleIt = chainSuperRole->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { CRole* superRole = superRoleIt->getData(); bool superRoleNeg = superRoleIt->isNegated() ^ chainData.mInverse; if (criticalRoleNegationHash->contains(superRole)) { return true; } } return false; } CRoleChainAutomataTransformationPreProcess* CRoleChainAutomataTransformationPreProcess::collectSubRoleChains() { qint64 itemCounts = mRoleVec->getItemCount(); for (qint64 i = 0; i < itemCounts; ++i) { CRole *role = mRoleVec->getData(i); if (role) { if (role->isComplexRole()) { CXLinker* roleChainLinkerIt = role->getRoleChainSuperSharingLinker(); while (roleChainLinkerIt) { CRoleChain* roleChain = roleChainLinkerIt->getData(); if (!roleChain->getInverseRoleChainLinker()) { mInverseUpdateRoleChainSet.insert(roleChain); } CSortedNegLinker< CRole* >* suberRoleLinkerIt = role->getIndirectSuperRoleList(); while (suberRoleLinkerIt) { CRole* superRole = suberRoleLinkerIt->getData(); bool superRoleNeg = suberRoleLinkerIt->isNegated(); superRole = mRoleVec->getData(superRole->getRoleTag()); mRoleSubRoleChainDataHash.insertMulti(superRole,CRoleSubRoleChainData(role,roleChain,superRoleNeg)); suberRoleLinkerIt = suberRoleLinkerIt->getNext(); } roleChainLinkerIt = roleChainLinkerIt->getNext(); } } } } return this; } CRoleChainAutomataTransformationPreProcess* CRoleChainAutomataTransformationPreProcess::createRecursiveTraversalData() { CRole* currentRole = nullptr; QList roleSubChainDataList; for (QHash::const_iterator it = mRoleSubRoleChainDataHash.constBegin(), itEnd = mRoleSubRoleChainDataHash.constEnd(); it != itEnd; ++it) { CRole* role(it.key()); const CRoleSubRoleChainData& roleSubChainData(it.value()); if (currentRole != role) { if (currentRole) { addRecursiveTraversalData(currentRole,roleSubChainDataList); currentRole = nullptr; roleSubChainDataList.clear(); } currentRole = role; } roleSubChainDataList.append(roleSubChainData); } if (currentRole) { addRecursiveTraversalData(currentRole,roleSubChainDataList); } return this; } CRoleChainAutomataTransformationPreProcess* CRoleChainAutomataTransformationPreProcess::addRecursiveTraversalData(CRole* role, const QList& roleSubChainDataList) { //if (CIRIName::getRecentIRIName(role->getPropertyNameLinker()) == "#isInLawOf") { // bool debug = true; //} QList relevantChainDataList(getRelevantChainDataList(role,roleSubChainDataList)); CRecTravSubRoleChainDataItem& recTravSubRoleChainData = mRoleRecTravSubRoleChainDataHash[role]; recTravSubRoleChainData.mRole = role; QHash criticalRoleNegationHash; bool criticalRecursiveTraversalRoles = false; for (QList::const_iterator it = relevantChainDataList.constBegin(), itEnd = relevantChainDataList.constEnd(); it != itEnd; ++it) { const CRoleSubRoleChainData& chainData(*it); criticalRecursiveTraversalRoles |= collectRecursiveTraversalCriticalRoles(role,chainData,&criticalRoleNegationHash); } if (!criticalRecursiveTraversalRoles) { recTravSubRoleChainData.mDirectSubRoleChainDataList = relevantChainDataList; } else { QHash relevantCriticalRoleNegationHash(getRelevantRecursiveTraversalCriticalRoles(&criticalRoleNegationHash)); for (QList::const_iterator it = relevantChainDataList.constBegin(), itEnd = relevantChainDataList.constEnd(); it != itEnd; ++it) { const CRoleSubRoleChainData& chainData(*it); if (!requiresRecursiveTraversalForRole(role,chainData,&relevantCriticalRoleNegationHash)) { recTravSubRoleChainData.mDirectSubRoleChainDataList.append(chainData); } } for (QHash::const_iterator it = relevantCriticalRoleNegationHash.constBegin(), itEnd = relevantCriticalRoleNegationHash.constEnd(); it != itEnd; ++it) { CRole* role(it.key()); bool inversed(it.value()); if (recTravSubRoleChainData.mRole->isSymmetric() && recTravSubRoleChainData.mRole->getInverseRole() == recTravSubRoleChainData.mRole) { recTravSubRoleChainData.mRecTraversalSubRoleList.append(TRoleNegationPair(role,!inversed)); } recTravSubRoleChainData.mRecTraversalSubRoleList.append(TRoleNegationPair(role,inversed)); } } return this; } CConcept* CRoleChainAutomataTransformationPreProcess::createTransitionConcept(CRole* role, TRANSLATIONTYPE transType) { CConcept* concept = nullptr; concept = CObjectAllocator::allocateAndConstruct(mMemMan); concept->initConcept(); cint64 conTag = mNextConceptTag++; concept->setConceptTag(conTag); mConVec->setData(conTag,concept); concept->setRole(role); cint64 opCode = CCAQALL; if (transType == TTNORMAL) { opCode = CCAQALL; } else if (transType == TTIMPL) { opCode = CCIMPLAQALL; } else if (transType == TTBRANCH) { opCode = CCBRANCHAQALL; } else if (transType == TTPROPBIND) { opCode = CCPBINDAQALL; } else if (transType == TTBACKPROP) { opCode = CCVARPBACKAQALL; } else if (transType == TTVARBIND) { opCode = CCVARBINDAQALL; } concept->setOperatorCode(opCode); ++mStatAutomateTransitionConceptCount; return concept; } CConcept* CRoleChainAutomataTransformationPreProcess::createNominalConcept(CIndividual* individual) { individual = CConceptRoleIndividualLocator::getLocatedIndividual(individual,mOntology); CConcept* concept = individual->getIndividualNominalConcept(); if (!concept) { concept = CObjectAllocator::allocateAndConstruct(mMemMan); concept->initConcept(); cint64 conTag = mNextConceptTag++; concept->setConceptTag(conTag); mConVec->setData(conTag,concept); concept->setOperatorCode(CCNOMINAL); concept->setNominalIndividual(individual); individual->setIndividualNominalConcept(concept); } return concept; } CConcept* CRoleChainAutomataTransformationPreProcess::createStateConcept(TRANSLATIONTYPE transType) { CConcept* concept = nullptr; concept = CObjectAllocator::allocateAndConstruct(mMemMan); concept->initConcept(); cint64 conTag = mNextConceptTag++; concept->setConceptTag(conTag); mConVec->setData(conTag,concept); cint64 opCode = CCAQAND; if (transType == TTNORMAL) { opCode = CCAQAND; } else if (transType == TTIMPL) { opCode = CCIMPLAQAND; } else if (transType == TTBRANCH) { opCode = CCBRANCHAQAND; } else if (transType == TTPROPBIND) { opCode = CCPBINDAQAND; } else if (transType == TTBACKPROP) { opCode = CCVARPBACKAQAND; } else if (transType == TTVARBIND) { opCode = CCVARBINDAQAND; } concept->setOperatorCode(opCode); ++mStatAutomateStateConceptCount; return concept; } CSortedNegLinker* CRoleChainAutomataTransformationPreProcess::createTransitionOperandConceptLinker(CConcept* operandConcept, bool negation) { CSortedNegLinker* opConceptLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); opConceptLinker->init(operandConcept,negation); return opConceptLinker; } CConcept* CRoleChainAutomataTransformationPreProcess::appendTransitionOperandConceptLinker(CConcept* concept, CSortedNegLinker* opLinker) { //for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { // CConcept* opCon = opLinkerIt->getData(); // if (opCon == opLinker->getData()) { // if (opLinkerIt->isNegated() == opLinker->isNegated()) { // bool bug = true; // } // } //} concept->addOperandLinker(opLinker); concept->incOperandCount(); return concept; } bool CRoleChainAutomataTransformationPreProcess::generateRoleChainAutomatConcept(CRole* lastRole, const CRecTravSubRoleChainDataItem& recTravSubRoleChainDataItem, QSet& alreadyUnfoldRoleSet, CConcept* beginConcept, CConcept* endConcept, TRANSLATIONTYPE transType) { const QList& subRoleChainDataList(recTravSubRoleChainDataItem.mDirectSubRoleChainDataList); generateRoleChainAutomatConcept(lastRole,subRoleChainDataList,alreadyUnfoldRoleSet,beginConcept,endConcept,transType); const QList& recTravSubRoleList(recTravSubRoleChainDataItem.mRecTraversalSubRoleList); for (QList::const_iterator it = recTravSubRoleList.constBegin(), itEnd = recTravSubRoleList.constEnd(); it != itEnd; ++it) { TRoleNegationPair recTravSubRoleNegPair(*it); CRole* recTravSubRole(recTravSubRoleNegPair.first); if (!alreadyUnfoldRoleSet.contains(recTravSubRole)) { bool recTravSubRoleInversed(recTravSubRoleNegPair.second); if (recTravSubRoleInversed) { recTravSubRole = getInverseRole(recTravSubRole); } QSet locUnfoldRoleSet(alreadyUnfoldRoleSet); locUnfoldRoleSet.insert(recTravSubRole); CSortedNegLinker* superSuperLinkerIt = recTravSubRole->getIndirectSuperRoleList(); while (superSuperLinkerIt) { CRole* superSuperRole = superSuperLinkerIt->getData(); locUnfoldRoleSet.insert(superSuperRole); superSuperLinkerIt = superSuperLinkerIt->getNext(); } CConcept* recTravSubBeginConcept = createStateConcept(transType); CConcept* recTravSubEndConcept = createStateConcept(transType); appendTransitionOperandConceptLinker(beginConcept,createTransitionOperandConceptLinker(recTravSubBeginConcept,false)); appendTransitionOperandConceptLinker(recTravSubEndConcept,createTransitionOperandConceptLinker(endConcept,false)); CConcept* recTravPropCon = createTransitionConcept(recTravSubRole,transType); appendTransitionOperandConceptLinker(recTravSubBeginConcept,createTransitionOperandConceptLinker(recTravPropCon,false)); appendTransitionOperandConceptLinker(recTravPropCon,createTransitionOperandConceptLinker(recTravSubEndConcept,false)); const CRecTravSubRoleChainDataItem& nextRecTravSubRoleChainDataItem(mRoleRecTravSubRoleChainDataHash.value(recTravSubRole)); generateRoleChainAutomatConcept(recTravSubRole,nextRecTravSubRoleChainDataItem,locUnfoldRoleSet,recTravSubBeginConcept,recTravSubEndConcept,transType); } } return true; } bool CRoleChainAutomataTransformationPreProcess::generateRoleChainAutomatConcept(CRole* lastRole, const QList& subRoleChainDataList, QSet& alreadyUnfoldRoleSet, CConcept* beginConcept, CConcept* endConcept, TRANSLATIONTYPE transType) { for (QList::const_iterator it = subRoleChainDataList.constBegin(), itEnd = subRoleChainDataList.constEnd(); it != itEnd; ++it) { CRoleSubRoleChainData subRoleChainData(*it); CRoleChain* subRoleChain = subRoleChainData.mRoleChain; bool subRoleNegation = subRoleChainData.mInverse; CRole* superRoleChain = subRoleChainData.mRole; QSet locUnfoldRoleSet(alreadyUnfoldRoleSet); locUnfoldRoleSet.insert(lastRole); CSortedNegLinker* superSuperLinkerIt = superRoleChain->getIndirectSuperRoleList(); while (superSuperLinkerIt) { CRole* superSuperRole = superSuperLinkerIt->getData(); locUnfoldRoleSet.insert(superSuperRole); superSuperLinkerIt = superSuperLinkerIt->getNext(); } generateRoleChainAutomatConcept(lastRole,superRoleChain,subRoleChain,subRoleNegation,locUnfoldRoleSet,beginConcept,endConcept,transType); } return true; } bool CRoleChainAutomataTransformationPreProcess::generateRoleChainAutomatConcept(CRole* lastRole, CRole* superRole, CRoleChain* descendingRoleChain, bool negatedChain, QSet& alreadyUnfoldRoleSet, CConcept* beginConcept, CConcept* endConcept, TRANSLATIONTYPE transType) { // TODO: // generate for each role in the role chain a concept // connect all concepts with each other, // append the first connected concept to the appending list // return later the last connected concept // for each generated concept in the role chain // check whether related role is complex and is not already used above (hash) // recursive call to generate concepts for each role chain and sub role CXLinker* chainedRoleLinker = nullptr; CXLinker* inverseChainedRoleLinker = nullptr; bool useInverseRoles = negatedChain; if (!negatedChain) { chainedRoleLinker = descendingRoleChain->getRoleChainLinker(); inverseChainedRoleLinker = descendingRoleChain->getInverseRoleChainLinker(); } else { chainedRoleLinker = descendingRoleChain->getInverseRoleChainLinker(); inverseChainedRoleLinker = descendingRoleChain->getRoleChainLinker(); } CConcept* connectBeginCon = nullptr; CConcept* connectEndCon = nullptr; CConcept* firstConcept = nullptr; CConcept* lastConcept = nullptr; bool transStart = false; bool transEnd = false; CRole* testRole = superRole; if (useInverseRoles && lastRole != superRole) { testRole = getInverseRole(superRole); } while (chainedRoleLinker) { CRole* subRole = chainedRoleLinker->getData(); if (useInverseRoles) { // search inverse role subRole = getInverseRole(subRole); } subRole = mRoleVec->getData(subRole->getRoleTag()); if (!firstConcept && subRole == testRole && !transStart) { // transitive start transStart = true; } else if (!chainedRoleLinker->hasNext() && subRole == testRole) { // transitive end transEnd = true; } else if (!alreadyUnfoldRoleSet.contains(subRole)) { // test recursive call CConcept* subBeginConcept = createStateConcept(transType); CConcept* propCon = createTransitionConcept(subRole,transType); CConcept* subEndConcept = createStateConcept(transType); if (!connectBeginCon) { connectBeginCon = subBeginConcept; } if (connectEndCon) { appendTransitionOperandConceptLinker(connectEndCon,createTransitionOperandConceptLinker(subBeginConcept,false)); } connectEndCon = subEndConcept; if (!firstConcept) { firstConcept = propCon; } appendTransitionOperandConceptLinker(subBeginConcept,createTransitionOperandConceptLinker(propCon,false)); appendTransitionOperandConceptLinker(propCon,createTransitionOperandConceptLinker(subEndConcept,false)); const CRecTravSubRoleChainDataItem& recTravSubRoleChainDataItem(mRoleRecTravSubRoleChainDataHash.value(subRole)); generateRoleChainAutomatConcept(subRole,recTravSubRoleChainDataItem,alreadyUnfoldRoleSet,subBeginConcept,subEndConcept,transType); //const QList& subRoleChainDataList(recTravSubRoleChainDataItem.mDirectSubRoleChainDataList); //generateRoleChainAutomatConcept(subRole,subRoleChainDataList,alreadyUnfoldRoleSet,subBeginConcept,subEndConcept,transType); ////for (QList::const_iterator it = subRoleChainDataList.constBegin(), itEnd = subRoleChainDataList.constEnd(); it != itEnd; ++it) { //// CRoleSubRoleChainData subRoleChainData(*it); //// CRoleChain* subRoleChain = subRoleChainData.mRoleChain; //// bool subRoleNegation = subRoleChainData.mInverse; //// CRole* superRoleChain = subRoleChainData.mRole; //// QSet locUnfoldRoleSet(alreadyUnfoldRoleSet); //// locUnfoldRoleSet.insert(subRole); //// CSortedNegLinker* superSuperLinkerIt = superRoleChain->getIndirectSuperRoleList(); //// while (superSuperLinkerIt) { //// CRole* superSuperRole = superSuperLinkerIt->getData(); //// locUnfoldRoleSet.insert(superSuperRole); //// superSuperLinkerIt = superSuperLinkerIt->getNext(); //// } //// generateRoleChainAutomatConcept(subRole,superRoleChain,subRoleChain,subRoleNegation,locUnfoldRoleSet,subBeginConcept,subEndConcept,transType); ////} //const QList& recTravSubRoleList(recTravSubRoleChainDataItem.mRecTraversalSubRoleList); //for (QList::const_iterator it = recTravSubRoleList.constBegin(), itEnd = recTravSubRoleList.constEnd(); it != itEnd; ++it) { // TRoleNegationPair recTravSubRoleNegPair(*it); // CRole* recTravSubRole(recTravSubRoleNegPair.first); // bool recTravSubRoleInversed(recTravSubRoleNegPair.second); // if (recTravSubRoleInversed) { // recTravSubRole = getInverseRole(recTravSubRole); // } // CConcept* recTravSubBeginConcept = createStateConcept(transType); // CConcept* recTravSubEndConcept = createStateConcept(transType); // appendTransitionOperandConceptLinker(subBeginConcept,createTransitionOperandConceptLinker(recTravSubBeginConcept,false)); // appendTransitionOperandConceptLinker(recTravSubEndConcept,createTransitionOperandConceptLinker(subEndConcept,false)); // CConcept* recTravPropCon = createTransitionConcept(recTravSubRole,transType); // appendTransitionOperandConceptLinker(recTravSubBeginConcept,createTransitionOperandConceptLinker(recTravPropCon,false)); // appendTransitionOperandConceptLinker(recTravPropCon,createTransitionOperandConceptLinker(recTravSubEndConcept,false)); // generateRoleChainAutomatConcept(recTravSubRole,subRoleChainDataList,alreadyUnfoldRoleSet,recTravSubBeginConcept,recTravSubEndConcept,transType); //} //// search fitting sub role chains ////bool hasFittingSubRole = false; ////QList subRoleChainDataList(mRoleSubRoleChainDataHash.values(subRole)); ////hasFittingSubRole = !subRoleChainDataList.isEmpty(); ////if (hasFittingSubRole) { //// for (QList::const_iterator it = subRoleChainDataList.constBegin(), itEnd = subRoleChainDataList.constEnd(); it != itEnd; ++it) { //// CRoleSubRoleChainData subRoleChainData(*it); //// CRoleChain* subRoleChain = subRoleChainData.mRoleChain; //// bool subRoleNegation = subRoleChainData.mInverse; //// CRole* superRoleChain = subRoleChainData.mRole; //// QSet locUnfoldRoleSet(alreadyUnfoldRoleSet); //// locUnfoldRoleSet.insert(subRole); //// CSortedNegLinker* superSuperLinkerIt = superRoleChain->getIndirectSuperRoleList(); //// while (superSuperLinkerIt) { //// CRole* superSuperRole = superSuperLinkerIt->getData(); //// locUnfoldRoleSet.insert(superSuperRole); //// superSuperLinkerIt = superSuperLinkerIt->getNext(); //// } //// generateRoleChainAutomatConcept(subRole,superRoleChain,subRoleChain,subRoleNegation,locUnfoldRoleSet,subBeginConcept,subEndConcept,transType); //// } ////} lastConcept = propCon; } else { // error, not allowed construct bool bug = true; } chainedRoleLinker = chainedRoleLinker->getNext(); } if (transStart && !transEnd) { //if (lastRole != testRole) { // CConcept* tmpEndConcept = createStateConcept(transType); // appendTransitionOperandConceptLinker(tmpEndConcept,createTransitionOperandConceptLinker(endConcept,false)); // endConcept = tmpEndConcept; //} appendTransitionOperandConceptLinker(endConcept,createTransitionOperandConceptLinker(connectBeginCon,false)); appendTransitionOperandConceptLinker(connectEndCon,createTransitionOperandConceptLinker(endConcept,false)); } else if (transEnd && !transStart) { //if (lastRole != testRole) { // CConcept* tmpBeginConcept = createStateConcept(transType); // appendTransitionOperandConceptLinker(beginConcept,createTransitionOperandConceptLinker(tmpBeginConcept,false)); // beginConcept = tmpBeginConcept; //} appendTransitionOperandConceptLinker(connectEndCon,createTransitionOperandConceptLinker(beginConcept,false)); appendTransitionOperandConceptLinker(beginConcept,createTransitionOperandConceptLinker(connectBeginCon,false)); } else if (transStart && transEnd && !firstConcept) { //if (lastRole != testRole) { // CConcept* tmpBeginConcept = createStateConcept(transType); // appendTransitionOperandConceptLinker(beginConcept,createTransitionOperandConceptLinker(tmpBeginConcept,false)); // beginConcept = tmpBeginConcept; // CConcept* tmpEndConcept = createStateConcept(transType); // appendTransitionOperandConceptLinker(tmpEndConcept,createTransitionOperandConceptLinker(endConcept,false)); // endConcept = tmpEndConcept; // CConcept* propCon = createTransitionConcept(testRole,transType); // appendTransitionOperandConceptLinker(tmpBeginConcept,createTransitionOperandConceptLinker(propCon,false)); // appendTransitionOperandConceptLinker(propCon,createTransitionOperandConceptLinker(tmpEndConcept,false)); //} appendTransitionOperandConceptLinker(endConcept,createTransitionOperandConceptLinker(beginConcept,false)); } else if (!transStart && !transEnd) { if (connectBeginCon && connectEndCon) { appendTransitionOperandConceptLinker(beginConcept,createTransitionOperandConceptLinker(connectBeginCon,false)); appendTransitionOperandConceptLinker(connectEndCon,createTransitionOperandConceptLinker(endConcept,false)); } } else { // error, not allowed construct } return true; } CRole* CRoleChainAutomataTransformationPreProcess::getLocalizedRole(CRole* role) { return getLocalizedRole(role->getRoleTag()); } CRole* CRoleChainAutomataTransformationPreProcess::getLocalizedRole(cint64 roleTag) { CRole* role = mRoleVec->getData(roleTag); if (!mRoleVec->hasLocalData(roleTag)) { role = CConceptRoleIndividualLocator::getLocatedRole(role,mOntology); } return role; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CCoreBlockingConceptMarkerPreProcess.h0000644000175000017500000000412412520551220031461 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CCOREBLOCKINGCONCEPTMARKERPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CCOREBLOCKINGCONCEPTMARKERPREPROCESS_H // Libraries includes // Namespace includes #include "CConcreteOntologyPreProcess.h" // Other includes #include "Reasoner/Ontology/CConceptProcessData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CCoreBlockingConceptMarkerPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCoreBlockingConceptMarkerPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CCoreBlockingConceptMarkerPreProcess(); //! Destructor virtual ~CCoreBlockingConceptMarkerPreProcess(); virtual CConcreteOntology* preprocess(CConcreteOntology* ontology, CPreProcessContext* context); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CCOREBLOCKINGCONCEPTMARKERPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreProcessContext.h0000644000175000017500000000374212520551224026077 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CPREPROCESSCONTEXT_H #define KONCLUDE_REASONER_PREPROCESS_CPREPROCESSCONTEXT_H // Libraries includes // Namespace includes // Other includes #include "Context/CContext.h" #include "Config/CConfiguration.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; using namespace Config; namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CPreProcessContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPreProcessContext : public CContext { // public methods public: //! Constructor CPreProcessContext(); //! Destructor virtual ~CPreProcessContext(); virtual CConfiguration* getConfiguration() = 0; virtual CConcreteOntology* getOntology() = 0; // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CPREPROCESSCONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CLexicalNormalisationPreProcess.cpp0000644000175000017500000003672012520551222031127 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLexicalNormalisationPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CLexicalNormalisationPreProcess::CLexicalNormalisationPreProcess() { } CLexicalNormalisationPreProcess::~CLexicalNormalisationPreProcess() { } void CLexicalNormalisationPreProcess::negateOperandConcepts(CConcept *concept, int firstNegationOperand) { CSortedNegLinker *operands = concept->getOperandList(); int operand = 0; while (operands) { if (operand++ >= firstNegationOperand) { operands->setNegated(!operands->isNegated()); } operands = operands->getNext(); } } CConcreteOntology *CLexicalNormalisationPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { bool skipForELOntologies = CConfigDataReader::readConfigBoolean(context->getConfiguration(),"Konclude.Calculation.Preprocessing.LexicalNormalization.SkipForELFragment",true); bool nonELConstructsUsed = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags()->isNonELConstructUsed(); if (nonELConstructsUsed || !skipForELOntologies) { CTBox* tbox = ontology->getDataBoxes()->getTBox(); CABox *abox = ontology->getDataBoxes()->getABox(); CRBox *rbox = ontology->getDataBoxes()->getRBox(); CMBox *mbox = ontology->getDataBoxes()->getMBox(); mBoxMemMan = CContext::getMemoryAllocationManager(ontology->getDataBoxes()->getBoxContext()); CNominalSchemaTemplateVector* nomSchTemplVector = mbox->getNominalSchemaTemplateVector(false); concepts = tbox->getConceptVector(); qint64 conceptCount = concepts->getItemCount(); roles = rbox->getRoleVector(); qint64 roleCount = rbox->getRoleCount(); for (qint64 i = 0; i < conceptCount; ++i) { CConcept *concept = concepts->getLocalData(i); if (concept) { qint64 cOpCode = concept->getDefinitionOperatorTag(); if (cOpCode == CCOR) { concept->setMappingNegation(true); concept->setOperatorTag(CCAND); negateOperandConcepts(concept,0); } else if (cOpCode == CCSOME) { concept->setMappingNegation(true); concept->setOperatorTag(CCALL); negateOperandConcepts(concept,0); } } } topConcept = concepts->getData(1); for (qint64 i = 0; i < conceptCount; ++i) { CConcept *concept = concepts->getLocalData(i); if (concept) { CSortedNegLinker *operands = concept->getOperandList(); while (operands) { CConcept *opConcept = operands->getData(); if (opConcept->hasMappingNegation()) { operands->setNegated(!operands->isNegated()); } if (opConcept->getDefinitionOperatorTag() == CCBOTTOM) { operands->setData(topConcept); operands->setNegated(!operands->isNegated()); } if (nomSchTemplVector) { if (opConcept->getOperatorCode() == CCNOMTEMPLREF || opConcept->getOperatorCode() == CCPBINDGROUND || opConcept->getOperatorCode() == CCVARBINDGROUND) { CNominalSchemaTemplate* nsTemplate = nomSchTemplVector->getData(opConcept->getParameter()); if (nsTemplate) { if (nsTemplate->getTemplateConcept()->hasMappingNegation()) { operands->setNegated(!operands->isNegated()); } } } } operands = operands->getNext(); } } } for (qint64 i = 0; i < roleCount; ++i) { CRole *role = roles->getLocalData(i); if (role) { CSortedNegLinker *domainConIt = role->getDomainConceptList(); while (domainConIt) { CConcept *domainConcept = domainConIt->getData(); if (domainConcept->hasMappingNegation()) { domainConIt->setNegated(!domainConIt->isNegated()); } domainConIt = domainConIt->getNext(); } CSortedNegLinker *rangeConIt = role->getRangeConceptList(); while (rangeConIt) { CConcept *rangeConcept = rangeConIt->getData(); if (rangeConcept->hasMappingNegation()) { rangeConIt->setNegated(!rangeConIt->isNegated()); } rangeConIt = rangeConIt->getNext(); } } } if (abox) { individuals = abox->getIndividualVector(); qint64 individualCount = abox->getIndividualCount(); for (qint64 i = 0; i < individualCount; ++i) { CIndividual *indi = individuals->getLocalData(i); if (indi) { CConceptAssertionLinker* assertionConLinker = indi->getAssertionConceptLinker(); while (assertionConLinker) { if (assertionConLinker->getData()->hasMappingNegation()) { assertionConLinker->setNegation(!assertionConLinker->isNegated()); } assertionConLinker = assertionConLinker->getNext(); } } } } replacementHash = new QHash(); processedSet = new QSet(); conceptReplaceHash = new QHash >(); processingList = new QList(); for (qint64 i = 0; i < conceptCount; ++i) { CConcept *concept = concepts->getLocalData(i); if (concept) { if (!processedSet->contains(concept)) { //QString iriClassNameString2 = CIRIName::getRecentIRIName(concept->getClassNameLinker()); //if (iriClassNameString2 == "http://www.owllink.org/testsuite/particle-D#Proton") { // bool bug = true; //} addNormalizeConcept(concept); processedSet->insert(concept); normalizeListedConcepts(); } } } for (qint64 i = 0; i < roleCount; ++i) { CRole *role = roles->getLocalData(i); if (role) { CSortedNegLinker *domainConIt = role->getDomainConceptList(); bool domainModified = false; while (domainConIt) { CConcept *domainConcept = domainConIt->getData(); if (conceptReplaceHash->contains(domainConcept)) { QPair negRepConcept(conceptReplaceHash->value(domainConcept)); domainConcept = negRepConcept.second; if (negRepConcept.first) { domainConIt->setNegated(!domainConIt->isNegated()); } domainConIt->setData(domainConcept); domainModified = true; } domainConIt = domainConIt->getNext(); } if (domainModified) { domainConIt = role->getDomainConceptList(); domainConIt->resortLinkerData(); } CSortedNegLinker *rangeConIt = role->getRangeConceptList(); bool rangeModified = false; while (rangeConIt) { CConcept *rangeConcept = rangeConIt->getData(); if (conceptReplaceHash->contains(rangeConcept)) { QPair negRepConcept(conceptReplaceHash->value(rangeConcept)); rangeConcept = negRepConcept.second; if (negRepConcept.first) { rangeConIt->setNegated(!rangeConIt->isNegated()); } rangeConIt->setData(rangeConcept); domainModified = true; } rangeConIt = rangeConIt->getNext(); } if (rangeModified) { rangeConIt = role->getRangeConceptList(); rangeConIt->resortLinkerData(); } } } if (abox) { individuals = abox->getIndividualVector(); qint64 individualCount = abox->getIndividualCount(); for (qint64 i = 0; i < individualCount; ++i) { CIndividual *indi = individuals->getLocalData(i); if (indi) { CConceptAssertionLinker* assertionConLinker = indi->getAssertionConceptLinker(); while (assertionConLinker) { if (conceptReplaceHash->contains(assertionConLinker->getData())) { QPair negRepConcept(conceptReplaceHash->value(assertionConLinker->getData())); assertionConLinker->setData(negRepConcept.second); assertionConLinker->setNegation(negRepConcept.first); } assertionConLinker = assertionConLinker->getNext(); } } } } delete replacementHash; delete processedSet; delete conceptReplaceHash; delete processingList; } return ontology; } CSortedNegLinker* CLexicalNormalisationPreProcess::resortConceptLinkersByTagging(CSortedNegLinker* conceptLinkers) { CSortedNegLinker* newConceptLinkers = nullptr; while (conceptLinkers) { CSortedNegLinker* tmpConceptLinker = conceptLinkers; conceptLinkers = conceptLinkers->getNext(); tmpConceptLinker->setNext(nullptr); if (!newConceptLinkers) { newConceptLinkers = tmpConceptLinker; } else { newConceptLinkers = newConceptLinkers->insertSortedNextSorted(tmpConceptLinker); } } return newConceptLinkers; } void CLexicalNormalisationPreProcess::addNormalizeConcept(CConcept *concept) { processingList->prepend(concept); } void CLexicalNormalisationPreProcess::normalizeListedConcepts() { while (!processingList->isEmpty()) { CConcept* concept = processingList->first(); cint64 conceptTag = concept->getConceptTag(); bool isLocal = concepts->hasLocalData(conceptTag); bool conceptNormalizationAdded = false; CSortedNegLinker* opLinkerIt = concept->getOperandList(); if (isLocal) { while (opLinkerIt) { CConcept* opConcept = concepts->getData(opLinkerIt->getData()->getConceptTag()); if (!processedSet->contains(opConcept)) { conceptNormalizationAdded = true; addNormalizeConcept(opConcept); processedSet->insert(opConcept); } opLinkerIt = opLinkerIt->getNext(); } } if (!conceptNormalizationAdded) { processingList->removeFirst(); normalizeConcept(concept,isLocal); } } } void CLexicalNormalisationPreProcess::normalizeConcept(CConcept *concept, bool isLocal) { CSortedNegLinker *opList = 0; cint64 conceptTag = concept->getConceptTag(); bool implicTriggers = concept->getOperatorCode() == CCIMPL || concept->getOperatorCode() == CCIMPLALL; bool nonReplace = false; if (implicTriggers) { nonReplace = true; } if (isLocal) { CSortedNegLinker *conceptAddList = 0; CSortedNegLinker *lastOpList = 0; bool opConTagsModified = false; opList = concept->getOperandList(); while (opList) { CConcept *opConcept = concepts->getData(opList->getData()->getConceptTag()); if (!nonReplace && conceptReplaceHash->contains(opConcept)) { QPair negRepConcept(conceptReplaceHash->value(opConcept)); opConcept = negRepConcept.second; if (negRepConcept.first) { opList->setNegated(!opList->isNegated()); } opList->setData(opConcept); opConTagsModified = true; } bool removeThisOp = false; cint64 opCode = concept->getOperatorCode(); if (opCode == CCAND) { cint64 operandOpCode = opConcept->getOperatorCode(); if ((operandOpCode == CCAND) && !opList->isNegated()) { // remove concept from operand list and copy operand concepts from removed concept to this concept as operands CSortedNegLinker *opOpList = opConcept->getOperandList(); while (opOpList) { concept->incOperandCount(); conceptAddList = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mBoxMemMan)->init(opOpList->getData(),opOpList->isNegated())->insertSortedNextSorted(conceptAddList); opOpList = opOpList->getNext(); } removeThisOp = true; } else if (opConcept->getDefinitionOperatorTag() == CCTOP && !opList->isNegated()) { removeThisOp = true; } } if (removeThisOp) { concept->incOperandCount(-1); if (!lastOpList) { concept->setOperandList(opList->getNext()); opList = opList->getNext(); } else { opList = opList->getNext(); lastOpList->removeNext(); } } else { lastOpList = opList; opList = opList->getNext(); } } if (conceptAddList) { concept->setOperandList(conceptAddList->insertSortedNextSorted(concept->getOperandList())); } if (opConTagsModified) { concept->setOperandList(resortConceptLinkersByTagging(concept->getOperandList())); } } bool isClash = false; CSortedNegLinker *lastOpList = 0; opList = concept->getOperandList(); while (opList) { CConcept *opConcept = concepts->getData(opList->getData()->getConceptTag()); if (isLocal) { if (!nonReplace && conceptReplaceHash->contains(opConcept)) { QPair negRepConcept(conceptReplaceHash->value(opConcept)); opConcept = negRepConcept.second; if (negRepConcept.first) { opList->setNegated(!opList->isNegated()); } opList->setData(opConcept); } } qint64 opCCode = opConcept->getDefinitionOperatorTag(); if (concept->getProcessingOperatorTag() == CCAND && opCCode == CCTOP && opList->isNegated()) { isClash = true; } if (concept->getProcessingOperatorTag() == CCSOME && opCCode == CCTOP && opList->isNegated()) { isClash = true; } if (concept->getProcessingOperatorTag() == CCATLEAST && opCCode == CCTOP && opList->isNegated()) { isClash = true; } if (concept->getProcessingOperatorTag() == CCAND && lastOpList && lastOpList->getData()->getConceptTag() == opList->getData()->getConceptTag()) { if (lastOpList->isNegated() != opList->isNegated()) { isClash = true; } } lastOpList = opList; opList = opList->getNext(); } if (isClash) { conceptReplaceHash->insert(concept,QPair(true,topConcept)); } else { CConceptUnambiguousHasher conUnHasher(getConceptHasher(concept)); if (!replacementHash->contains(conUnHasher)) { replacementHash->insert(conUnHasher,concept); } else { conceptReplaceHash->insert(concept,QPair(false,replacementHash->value(conUnHasher))); } } } CConceptUnambiguousHasher CLexicalNormalisationPreProcess::getConceptHasher(CConcept *concept) { cint64 opCode = concept->getOperatorCode(); CConceptOperator* conOperator = concept->getConceptOperator(); if (opCode == CCATOM || opCode == CCSUB || opCode == CCEQ || opCode == CCDATATYPE || opCode == CCDATALITERAL || opCode == CCDATARESTRICTION || conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE)) { return CConceptUnambiguousHasher(concept,true); } else { return CConceptUnambiguousHasher(concept,false); } } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CFullNominalSchemaGroundingPreProcess.h0000644000175000017500000001017212520551222031662 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CFULLNOMINALSCHEMAGROUNDINGPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CFULLNOMINALSCHEMAGROUNDINGPREPROCESS_H // Libraries includes #include // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" #include "CConceptTriggerLinker.h" // Other includes #include "Utilities/Container/CNegLinker.h" #include "Config/CConfigDataReader.h" #include "Reasoner/Generator/CConcreteOntologyInverseRoleBuilder.h" #include "Reasoner/Ontology/CConceptTextFormater.h" #include "Reasoner/Ontology/COntologyTextFormater.h" #include "Reasoner/Ontology/CNominalSchemaTemplateVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Utilities::Container; namespace Reasoner { using namespace Generator; using namespace Ontology; namespace Preprocess { /*! * * \class CFullNominalSchemaGroundingPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CFullNominalSchemaGroundingPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CFullNominalSchemaGroundingPreProcess(); //! Destructor virtual ~CFullNominalSchemaGroundingPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: CConcept* createNominalSchemaAxiomCollectionConcept(CConcept* concept, bool negated, CNominalSchemaTemplate* nsTemplate); void addConceptOperand(CConcept* concept, CConcept* opConcept, bool negated); CConcept* createGroundedNominalSchemaConcept(CConcept* concept, CBOXHASH* templConNomSchConHash, QHash::const_iterator >* nomSchConIndividualItHash); CConcept* createNominalSchemaConceptCopy(CConcept* concept); bool requiresGCIGrounding(CNominalSchemaTemplate* nsTemplate, bool negated); bool findAbsorbableNominalSchemas(CConcept* concept, bool negation, QSet* absorbableNominalVariableSet); // protected variables protected: CMemoryAllocationManager* mMemMan; CConceptVector* mConceptVec; CRoleVector* mRolesVec; CConcept* mBottomConcept; CConcept* mTopConcept; cint64 mConceptCount; cint64 mRoleCount; CIndividualVector* mIndividualVector; cint64 mIndividualCount; CConcreteOntology* mOnto; CMBox* mMBox; CNominalSchemaTemplateVector* mNomSchTemplVec; QSet mNominalConceptSet; QHash< QPair, CConcept*> mCollConHash; QHash< QPair, bool> mReqGroundConHash; QHash mConceptNomSchemIndiReplaceHash; bool mConfReuseGroundedNominalSchemaConcepts; bool mConfGroundNominalSchemaAbsorbableConcepts; bool mConfFullyGroundNominalSchemaConcepts; cint64 mStatGroundedTemplateCount; cint64 mStatCreatedConceptCount; cint64 mStatReplacedConceptCount; cint64 mStatInstantiatedAxiomsCount; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CFULLNOMINALSCHEMAGROUNDINGPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/Events/0000755000175000017500000000000012613407256023437 5ustar jonasjonas././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/Events/CCallbackPreprocessedOntologyEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/Events/CCallbackPreprocessedOntologyEvent.0000644000175000017500000000520512520551216032346 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_EVENTS_CCALLBACKPREPROCESSEDONTOLOGYEVENT_H #define KONCLUDE_REASONER_PREPROCESS_EVENTS_CCALLBACKPREPROCESSEDONTOLOGYEVENT_H // Libraries includes // Namespace includes #include "../PreprocessSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; namespace Preprocess { namespace Events { /*! * \class CCallbackPreprocessedOntologyEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CCallbackPreprocessedOntologyEvent : public CCustomEvent { // public methods public: //! Constructor CCallbackPreprocessedOntologyEvent(CConcreteOntology* ontology, CCallbackData* callbackPossibleCallbackData, CCallbackData* preprocessedCallbackData); //! Destructor virtual ~CCallbackPreprocessedOntologyEvent(); CConcreteOntology* getOntology(); CCallbackData* getPreprocessedCallbackData(); CCallbackData* getCallbackPossibleCallbackData(); static const QEvent::Type EVENTTYPE = EVENTCALLBACKPREPROCESSEDONTOLOGY; // protected methods protected: // protected variables protected: CConcreteOntology* onto; CCallbackData* preprocessedCallback; CCallbackData* possibleCallback; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_EVENTS_CCALLBACKPREPROCESSEDONTOLOGYEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/Events/CPreprocessOntologyEvent.h0000644000175000017500000000571312520551216030574 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_EVENTS_CPREPROCESSONTOLOGYEVENT_H #define KONCLUDE_REASONER_PREPROCESS_EVENTS_CPREPROCESSONTOLOGYEVENT_H // Libraries includes // Namespace includes #include "../PreprocessSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; using namespace Config; namespace Reasoner { using namespace Ontology; namespace Preprocess { namespace Events { /*! * \class CPreprocessOntologyEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CPreprocessOntologyEvent : public CCustomEvent { // public methods public: //! Constructor CPreprocessOntologyEvent(CConcreteOntology* ontology, CConfigurationBase* configuration, const QList& requirementList, CCallbackData* callbackData = 0); CPreprocessOntologyEvent(CConcreteOntology* ontology, CConfigurationBase* configuration, CCallbackData* callbackData = 0); //! Destructor virtual ~CPreprocessOntologyEvent(); CConcreteOntology* getOntology(); CCallbackData* getCallbackData(); CConfigurationBase* getConfiguration(); QList* getPreprocessingRequirementList(); static const QEvent::Type EVENTTYPE = EVENTPPREPROCESSONTOLOGY; // protected methods protected: // protected variables protected: CConcreteOntology* onto; CConfigurationBase* config; CCallbackData* callback; QList mRequirementList; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_EVENTS_CPREPROCESSONTOLOGYEVENT_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/Events/CPreprocessingCalculatedCallbackEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/Events/CPreprocessingCalculatedCallbackEve0000644000175000017500000000404712520551216032345 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreprocessingCalculatedCallbackEvent.h" namespace Konclude { namespace Reasoner { namespace Preprocess { namespace Events { CPreprocessingCalculatedCallbackEvent::CPreprocessingCalculatedCallbackEvent(CThread *receiverThread, CSatisfiableCalculationJob *satCalcJob, CPreprocessingTestingItem* testingItem) : CCustomEvent(EVENTTYPE),CJobSatisfiableCallbackContextData(satCalcJob) { mRecThread = receiverThread; mSatCalcJob = satCalcJob; mTestingItem = testingItem; setCallbackDataContext(this); } CPreprocessingCalculatedCallbackEvent::~CPreprocessingCalculatedCallbackEvent() { takeCallbackDataContext(); } void CPreprocessingCalculatedCallbackEvent::doCallback() { mRecThread->postEvent(this); } bool CPreprocessingCalculatedCallbackEvent::getTestResultSatisfiable() { return mSatisfiable; } CSatisfiableCalculationJob *CPreprocessingCalculatedCallbackEvent::getSatisfiableCalculationJob() { return mSatCalcJob; } CPreprocessingTestingItem* CPreprocessingCalculatedCallbackEvent::getTestingItem() { return mTestingItem; } }; // end namespace Events }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/Events/CPreprocessingCalculatedCallbackEvent.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/Events/CPreprocessingCalculatedCallbackEve0000644000175000017500000000571612520551216032351 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_EVENTS_CPREPROCESSINGCALCULATEDCALLBACKEVENT_H #define KONCLUDE_REASONER_PREPROCESS_EVENTS_CPREPROCESSINGCALCULATEDCALLBACKEVENT_H // Libraries includes // Namespace includes #include "../PreprocessSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Concurrent/Callback/CCallbackData.h" #include "Reasoner/Query/CSatisfiableCalculationJob.h" #include "Reasoner/Query/CJobSatisfiableCallbackContextData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Reasoner { using namespace Query; using namespace Ontology; using namespace Kernel::Task; namespace Preprocess { namespace Events { /*! * \class CPreprocessingCalculatedCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CPreprocessingCalculatedCallbackEvent : public CCustomEvent, public CJobSatisfiableCallbackContextData, public CCallbackData { // public methods public: //! Constructor CPreprocessingCalculatedCallbackEvent(CThread* receiverThread, CSatisfiableCalculationJob* satCalcJob, CPreprocessingTestingItem* testingItem); //! Destructor virtual ~CPreprocessingCalculatedCallbackEvent(); static const QEvent::Type EVENTTYPE = EVENTPREPROCESSINGCALCULATEDCALLBACK; virtual void doCallback(); virtual bool getTestResultSatisfiable(); virtual CSatisfiableCalculationJob* getSatisfiableCalculationJob(); virtual CPreprocessingTestingItem* getTestingItem(); // protected methods protected: // protected variables protected: CThread* mRecThread; CSatisfiableCalculationJob* mSatCalcJob; CPreprocessingTestingItem* mTestingItem; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_EVENTS_CPREPROCESSINGCALCULATEDCALLBACKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/Events/CPreprocessOntologyEvent.cpp0000644000175000017500000000423112520551216031121 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreprocessOntologyEvent.h" namespace Konclude { namespace Reasoner { namespace Preprocess { namespace Events { CPreprocessOntologyEvent::CPreprocessOntologyEvent(CConcreteOntology* ontology, CConfigurationBase* configuration, const QList& requirementList, CCallbackData* callbackData) : CCustomEvent(EVENTTYPE),mRequirementList(requirementList) { onto = ontology; callback = callbackData; config = configuration; } CPreprocessOntologyEvent::CPreprocessOntologyEvent(CConcreteOntology* ontology, CConfigurationBase* configuration, CCallbackData* callbackData) : CCustomEvent(EVENTTYPE) { onto = ontology; callback = callbackData; config = configuration; } CPreprocessOntologyEvent::~CPreprocessOntologyEvent() { } CConcreteOntology* CPreprocessOntologyEvent::getOntology() { return onto; } CCallbackData* CPreprocessOntologyEvent::getCallbackData() { return callback; } CConfigurationBase* CPreprocessOntologyEvent::getConfiguration() { return config; } QList* CPreprocessOntologyEvent::getPreprocessingRequirementList() { return &mRequirementList; } }; // end namespace Events }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/Events/CCallbackPreprocessedOntologyEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/Events/CCallbackPreprocessedOntologyEvent.0000644000175000017500000000350612520551216032350 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCallbackPreprocessedOntologyEvent.h" namespace Konclude { namespace Reasoner { namespace Preprocess { namespace Events { CCallbackPreprocessedOntologyEvent::CCallbackPreprocessedOntologyEvent(CConcreteOntology *ontology, CCallbackData *callbackPossibleCallbackData, CCallbackData *callbackData) : CCustomEvent(EVENTTYPE) { onto = ontology; preprocessedCallback = callbackData; possibleCallback = callbackPossibleCallbackData; } CCallbackPreprocessedOntologyEvent::~CCallbackPreprocessedOntologyEvent() { } CConcreteOntology *CCallbackPreprocessedOntologyEvent::getOntology() { return onto; } CCallbackData *CCallbackPreprocessedOntologyEvent::getPreprocessedCallbackData() { return preprocessedCallback; } CCallbackData *CCallbackPreprocessedOntologyEvent::getCallbackPossibleCallbackData() { return possibleCallback; } }; // end namespace Events }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/COntologyAssignmentTransformationPreProcess.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/COntologyAssignmentTransformationPreProces0000644000175000017500000000466112520551224032635 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CONTOLOGYASSIGNMENTTRANSFORMATIONPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CONTOLOGYASSIGNMENTTRANSFORMATIONPREPROCESS_H // Libraries includes #include // Namespace includes #include "CConcreteOntologyPreProcess.h" // Other includes #include "Reasoner/Ontology/CBoxContext.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/CMBox.h" #include "Utilities/CDynamicExpandingMemoryManager.hpp" #include "Utilities/CSortedNegLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class COntologyAssignmentTransformationPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyAssignmentTransformationPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor COntologyAssignmentTransformationPreProcess(CConcreteOntology *ontologyAssignment); //! Destructor virtual ~COntologyAssignmentTransformationPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: // protected variables protected: CConcreteOntology *ontology; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CONTOLOGYASSIGNMENTTRANSFORMATIONPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CBranchTriggerPreProcess.h0000644000175000017500000000515112520551216027171 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CBRANCHTRIGGERPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CBRANCHTRIGGERPREPROCESS_H // Libraries includes // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" // Other includes #include "Reasoner/Ontology/CConceptRoleBranchingTrigger.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CBranchTriggerPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBranchTriggerPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CBranchTriggerPreProcess(); //! Destructor virtual ~CBranchTriggerPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: CConceptRoleBranchingTrigger *createBranchingTriggers(CConcept* concept, bool negated); bool addRoleDomainConcept(CRole* role, CConcept* addedConcept, bool negated); CConcept* getRoleDomainTriggerConcept(CRole* role); CConcept* createTriggerConcept(); // protected variables protected: CMemoryAllocationManager* mMemMan; cint64 mStatConceptBranchTriggers; cint64 mStatRoleBranchTriggers; cint64 mStatBranchTriggers; CConcreteOntology* mOnto; CConceptVector* mConceptVec; CTBox* mTBox; QHash* mRoleDomainTriggerConceptHash; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CBRANCHTRIGGERPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CNominalSchemaAbsorptionBranchLinker.cpp0000644000175000017500000001001012520551222032022 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNominalSchemaAbsorptionBranchLinker.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CNominalSchemaAbsorptionBranchLinker::CNominalSchemaAbsorptionBranchLinker() : CLinkerBase(this) { } CNominalSchemaAbsorptionBranchLinker* CNominalSchemaAbsorptionBranchLinker::initNominalSchemaAbsorptionPathLinker(CNominalSchemaAbsorptionBranchLinker* nomSchAbsorpPathLinker) { if (nomSchAbsorpPathLinker) { mNomSchBindConceptHash = nomSchAbsorpPathLinker->mNomSchBindConceptHash; mVariableSet = nomSchAbsorpPathLinker->mVariableSet; mLastBranchTriggerConcept = nomSchAbsorpPathLinker->mLastBranchTriggerConcept; mBackPropagationBranchTriggerConcept = nomSchAbsorpPathLinker->mBackPropagationBranchTriggerConcept; } else { mBackPropagationBranchTriggerConcept = nullptr; mLastBranchTriggerConcept = nullptr; mNomSchBindConceptHash.clear(); mVariableSet.clear(); } return this; } CNominalSchemaAbsorptionBranchLinker* CNominalSchemaAbsorptionBranchLinker::joinNominalSchemaAbsorptionPathLinker(CNominalSchemaAbsorptionBranchLinker* nomSchAbsorpPathLinker1, CNominalSchemaAbsorptionBranchLinker* nomSchAbsorpPathLinker2) { mNomSchBindConceptHash = nomSchAbsorpPathLinker1->mNomSchBindConceptHash; for (QHash::const_iterator it = nomSchAbsorpPathLinker2->mNomSchBindConceptHash.constBegin(), itEnd = nomSchAbsorpPathLinker2->mNomSchBindConceptHash.constEnd(); it != itEnd; ++it) { mNomSchBindConceptHash.insertMulti(it.key(),it.value()); } mVariableSet = nomSchAbsorpPathLinker1->mVariableSet; mVariableSet += nomSchAbsorpPathLinker2->mVariableSet; mLastBranchTriggerConcept = nullptr; mBackPropagationBranchTriggerConcept = nullptr; return this; } QHash* CNominalSchemaAbsorptionBranchLinker::getNominalSchemaBindedConceptTriggerHash() { return &mNomSchBindConceptHash; } QSet* CNominalSchemaAbsorptionBranchLinker::getVariableSet() { return &mVariableSet; } bool CNominalSchemaAbsorptionBranchLinker::hasVariables() { return !mVariableSet.isEmpty(); } CNominalSchemaAbsorptionBranchLinker* CNominalSchemaAbsorptionBranchLinker::addVariable(CVariable* variable) { mVariableSet.insert(variable); return this; } CConcept* CNominalSchemaAbsorptionBranchLinker::getLastBranchTriggerConcept() { return mLastBranchTriggerConcept; } CNominalSchemaAbsorptionBranchLinker* CNominalSchemaAbsorptionBranchLinker::setLastBranchTriggerConcept(CConcept* lastBranchTriggerConcept) { mLastBranchTriggerConcept = lastBranchTriggerConcept; return this; } CConcept* CNominalSchemaAbsorptionBranchLinker::getBackPropagationBranchTriggerConcept() { return mBackPropagationBranchTriggerConcept; } CNominalSchemaAbsorptionBranchLinker* CNominalSchemaAbsorptionBranchLinker::setBackPropagationBranchTriggerConcept(CConcept* backPropagationBranchTriggerConcept) { mBackPropagationBranchTriggerConcept = backPropagationBranchTriggerConcept; return this; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CFullNominalSchemaGroundingPreProcess.cpp0000644000175000017500000004353412520551222032225 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CFullNominalSchemaGroundingPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CFullNominalSchemaGroundingPreProcess::CFullNominalSchemaGroundingPreProcess() { mConfReuseGroundedNominalSchemaConcepts = true; mConfGroundNominalSchemaAbsorbableConcepts = false; mConfFullyGroundNominalSchemaConcepts = false; } CFullNominalSchemaGroundingPreProcess::~CFullNominalSchemaGroundingPreProcess() { } CConcreteOntology *CFullNominalSchemaGroundingPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { bool nominalSchemaConstructsUsed = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags()->isNominalSchemaUsed(); if (nominalSchemaConstructsUsed) { mStatReplacedConceptCount = 0; mStatCreatedConceptCount = 0; mStatGroundedTemplateCount = 0; mStatInstantiatedAxiomsCount = 0; CTBox *tBox = ontology->getDataBoxes()->getTBox(); CRBox *rBox = ontology->getDataBoxes()->getRBox(); CABox *aBox = ontology->getDataBoxes()->getABox(); mMBox = ontology->getDataBoxes()->getMBox(); CConfiguration* config = context->getConfiguration(); mConfGroundNominalSchemaAbsorbableConcepts = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.AbsorbableNominalSchemaGrounding",false); mConfFullyGroundNominalSchemaConcepts = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.FullNominalSchemaGrounding",false); mConfGroundNominalSchemaAbsorbableConcepts |= mConfFullyGroundNominalSchemaConcepts; mConceptVec = tBox->getConceptVector(); mConceptCount = mConceptVec->getItemCount(); mRolesVec = rBox->getRoleVector(); mRoleCount = mRolesVec->getItemCount(); mTopConcept = tBox->getTopConcept(); mBottomConcept = tBox->getBottomConcept(); mMemMan = ontology->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); mOnto = ontology; mNomSchTemplVec = mMBox->getNominalSchemaTemplateVector(false); mIndividualVector = aBox->getIndividualVector(false); mIndividualCount = 0; if (mIndividualVector) { mIndividualCount = mIndividualVector->getItemCount(); // TODO: only active individuals for (cint64 i = 0; i < mIndividualCount; ++i) { CIndividual* individual = mIndividualVector->getData(i); for (CConceptAssertionLinker* assConLinkerIt = individual->getAssertionConceptLinker(); assConLinkerIt; assConLinkerIt = assConLinkerIt->getNext()) { CConcept* assCon = assConLinkerIt->getData(); bool assConNegation = assConLinkerIt->isNegated(); cint64 assConOpCode = assCon->getOperatorCode(); if (!assConNegation && assConOpCode == CCNOMINAL) { mNominalConceptSet.insert(assCon); } } } } if (mNomSchTemplVec) { for (cint64 i = 0; i < mConceptCount; ++i) { CConcept* concept = mConceptVec->getLocalData(i); if (concept) { cint64 conOpCode = concept->getOperatorCode(); if (conOpCode == CCSUB) { for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opConNegation = opConLinkerIt->isNegated(); cint64 opConOpCode = opConcept->getOperatorCode(); if (opConOpCode == CCNOMTEMPLREF) { cint64 templNumber = opConcept->getParameter(); CNominalSchemaTemplate* nsTemplate = mNomSchTemplVec->getData(templNumber); if (nsTemplate) { CConcept* nomSchAxiomCollConcept = createNominalSchemaAxiomCollectionConcept(opConcept,opConNegation,nsTemplate); opConLinkerIt->setData(nomSchAxiomCollConcept); opConLinkerIt->setNegated(false); } } } } } } for (cint64 i = 0; i < mRoleCount; ++i) { CRole* role = mRolesVec->getLocalData(i); if (role) { for (CSortedNegLinker* domConLinkerIt = role->getDomainConceptList(); domConLinkerIt; domConLinkerIt = domConLinkerIt->getNext()) { CConcept* opConcept = domConLinkerIt->getData(); bool opConNegation = domConLinkerIt->isNegated(); cint64 opConOpCode = opConcept->getOperatorCode(); if (opConOpCode == CCNOMTEMPLREF) { cint64 templNumber = opConcept->getParameter(); CNominalSchemaTemplate* nsTemplate = mNomSchTemplVec->getData(templNumber); if (nsTemplate) { CConcept* nomSchAxiomCollConcept = createNominalSchemaAxiomCollectionConcept(opConcept,opConNegation,nsTemplate); domConLinkerIt->setData(nomSchAxiomCollConcept); domConLinkerIt->setNegated(false); } } } for (CSortedNegLinker* rangConLinkerIt = role->getRangeConceptList(); rangConLinkerIt; rangConLinkerIt = rangConLinkerIt->getNext()) { CConcept* opConcept = rangConLinkerIt->getData(); bool opConNegation = rangConLinkerIt->isNegated(); cint64 opConOpCode = opConcept->getOperatorCode(); if (opConOpCode == CCNOMTEMPLREF) { cint64 templNumber = opConcept->getParameter(); CNominalSchemaTemplate* nsTemplate = mNomSchTemplVec->getData(templNumber); if (nsTemplate) { CConcept* nomSchAxiomCollConcept = createNominalSchemaAxiomCollectionConcept(opConcept,opConNegation,nsTemplate); rangConLinkerIt->setData(nomSchAxiomCollConcept); rangConLinkerIt->setNegated(false); } } } } } for (CSortedNegLinker* gciConLinkerIt = mTopConcept->getOperandList(); gciConLinkerIt; gciConLinkerIt = gciConLinkerIt->getNext()) { CConcept* opConcept = gciConLinkerIt->getData(); bool opConNegation = gciConLinkerIt->isNegated(); cint64 opConOpCode = opConcept->getOperatorCode(); if (opConOpCode == CCNOMTEMPLREF) { cint64 templNumber = opConcept->getParameter(); CNominalSchemaTemplate* nsTemplate = mNomSchTemplVec->getData(templNumber); if (nsTemplate && requiresGCIGrounding(nsTemplate,opConNegation)) { CConcept* nomSchAxiomCollConcept = createNominalSchemaAxiomCollectionConcept(opConcept,opConNegation,nsTemplate); gciConLinkerIt->setData(nomSchAxiomCollConcept); gciConLinkerIt->setNegated(false); } } } if (mIndividualVector) { for (cint64 i = 0; i < mIndividualCount; ++i) { CIndividual* individual = mIndividualVector->getLocalData(i); if (individual) { for (CConceptAssertionLinker* assConLinkerIt = individual->getAssertionConceptLinker(); assConLinkerIt; assConLinkerIt = assConLinkerIt->getNext()) { CConcept* assCon = assConLinkerIt->getData(); bool assConNegation = assConLinkerIt->isNegated(); cint64 opConOpCode = assCon->getOperatorCode(); if (opConOpCode == CCNOMTEMPLREF) { cint64 templNumber = assCon->getParameter(); CNominalSchemaTemplate* nsTemplate = mNomSchTemplVec->getData(templNumber); if (nsTemplate) { CConcept* nomSchAxiomCollConcept = createNominalSchemaAxiomCollectionConcept(assCon,assConNegation,nsTemplate); assConLinkerIt->setData(nomSchAxiomCollConcept); assConLinkerIt->setNegation(false); } } } } } } } LOG(INFO,"::Konclude::Reasoner::Preprocess::FullNominalSchemaGrounder",logTr("Grounded %1 nominal schema templates, added %2 axioms with %3 created concepts.").arg(mStatGroundedTemplateCount).arg(mStatInstantiatedAxiomsCount).arg(mStatCreatedConceptCount),this); } return ontology; } bool CFullNominalSchemaGroundingPreProcess::requiresGCIGrounding(CNominalSchemaTemplate* nsTemplate, bool negated) { CConcept* templConcept = nsTemplate->getTemplateConcept(); if (mReqGroundConHash.contains(QPair(templConcept,negated))) { return mReqGroundConHash.value(QPair(templConcept,negated)); } bool requiresGrounding = true; if (!mConfGroundNominalSchemaAbsorbableConcepts) { cint64 opCode = templConcept->getOperatorCode(); if (!negated && opCode == CCOR || negated && opCode == CCAND) { QSet absorbableNominalVariableSet; for (CSortedNegLinker* opLinkerIt = templConcept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConNegation = opLinkerIt->isNegated() ^ negated; findAbsorbableNominalSchemas(opConcept,opConNegation,&absorbableNominalVariableSet); } bool absorbable = absorbableNominalVariableSet.count() > 0; requiresGrounding = !absorbable; } } mReqGroundConHash.insert(QPair(templConcept,negated),requiresGrounding); return requiresGrounding; } bool CFullNominalSchemaGroundingPreProcess::findAbsorbableNominalSchemas(CConcept* concept, bool negation, QSet* absorbableNominalVariableSet) { cint64 opCode = concept->getOperatorCode(); cint64 param = concept->getParameter(); if (negation && (opCode == CCSOME || opCode == CCAND) || !negation && (opCode == CCALL || opCode == CCSOME)) { bool oneAbsorbable = false; for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConNegation = opLinkerIt->isNegated() ^ negation; oneAbsorbable |= findAbsorbableNominalSchemas(opConcept,opConNegation,absorbableNominalVariableSet); } return oneAbsorbable; } else if (negation && (opCode == CCOR) || !negation && (opCode == CCAND)) { QSet allAbsorbableNominalVariableSet; bool allAbsorbableNominalVariableSetInitialized = false; bool allAbsorbable = true; for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConNegation = opLinkerIt->isNegated() ^ negation; QSet tmpAbsorbableNominalVariableSet; allAbsorbable &= findAbsorbableNominalSchemas(opConcept,opConNegation,&tmpAbsorbableNominalVariableSet); if (!allAbsorbableNominalVariableSetInitialized) { allAbsorbableNominalVariableSetInitialized = true; allAbsorbableNominalVariableSet = tmpAbsorbableNominalVariableSet; } else { QSet::iterator it = allAbsorbableNominalVariableSet.begin(); while (it != allAbsorbableNominalVariableSet.end()) { if (tmpAbsorbableNominalVariableSet.contains(*it)) { ++it; } else { it = allAbsorbableNominalVariableSet.erase(it); } } } } *absorbableNominalVariableSet += allAbsorbableNominalVariableSet; return allAbsorbable; } else if (negation && (opCode == CCATLEAST && param > 0) || !negation && (opCode == CCATMOST && param >= 0)) { bool oneAbsorbable = false; for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConNegation = opLinkerIt->isNegated(); oneAbsorbable |= findAbsorbableNominalSchemas(opConcept,opConNegation,absorbableNominalVariableSet); } return oneAbsorbable; } else if (negation && (opCode == CCNOMVAR)) { absorbableNominalVariableSet->insert(concept); return true; } return false; } void CFullNominalSchemaGroundingPreProcess::addConceptOperand(CConcept* concept, CConcept* opConcept, bool negated) { CSortedNegLinker* opConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); opConLinker->init(opConcept,negated); concept->addOperandLinker(opConLinker); concept->incOperandCount(); } CConcept* CFullNominalSchemaGroundingPreProcess::createNominalSchemaConceptCopy(CConcept* concept) { CConcept* conceptCopy = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); conceptCopy->initConceptCopy(concept); conceptCopy->setOperandCount(0); conceptCopy->setConceptTag(mConceptVec->getItemCount()); mConceptVec->setData(conceptCopy->getConceptTag(),conceptCopy); ++mStatCreatedConceptCount; return conceptCopy; } CConcept* CFullNominalSchemaGroundingPreProcess::createGroundedNominalSchemaConcept(CConcept* concept, CBOXHASH* templConNomSchConHash, QHash::const_iterator >* nomSchConIndividualItHash) { if (templConNomSchConHash->contains(concept)) { cint64 opCode = concept->getOperatorCode(); if (opCode == CCNOMVAR) { QSet::const_iterator nomVarIt = nomSchConIndividualItHash->value(concept); CConcept* nominalConcept = *nomVarIt; return nominalConcept; } QByteArray conceptNomSchemIndiConceptByteArray; if (mConfReuseGroundedNominalSchemaConcepts) { conceptNomSchemIndiConceptByteArray.append(QByteArray::number((cint64)concept)); FOREACHIT (CConcept* nomSchemConcept, templConNomSchConHash->values(concept)) { QSet::const_iterator nomVarIt = nomSchConIndividualItHash->value(nomSchemConcept); CConcept* indiConcept = *nomVarIt; conceptNomSchemIndiConceptByteArray.append(QByteArray::number((cint64)indiConcept)); } CConcept* replaceCon = mConceptNomSchemIndiReplaceHash.value(conceptNomSchemIndiConceptByteArray,nullptr); if (replaceCon) { return replaceCon; } } CConcept* copiedConcept = createNominalSchemaConceptCopy(concept); for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opConNegation = opConLinkerIt->isNegated(); CConcept* newOpConcept = createGroundedNominalSchemaConcept(opConcept,templConNomSchConHash,nomSchConIndividualItHash); addConceptOperand(copiedConcept,newOpConcept,opConNegation); } if (mConfReuseGroundedNominalSchemaConcepts) { mConceptNomSchemIndiReplaceHash.insert(conceptNomSchemIndiConceptByteArray,copiedConcept); } return copiedConcept; } else { return concept; } } CConcept* CFullNominalSchemaGroundingPreProcess::createNominalSchemaAxiomCollectionConcept(CConcept* concept, bool negated, CNominalSchemaTemplate* nsTemplate) { ++mStatReplacedConceptCount; if (mCollConHash.contains(QPair(concept,negated))) { return mCollConHash.value(QPair(concept,negated)); } ++mStatGroundedTemplateCount; CConcept* collConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); collConcept->initConcept(); collConcept->setConceptTag(mConceptVec->getItemCount()); collConcept->setOperatorCode(CCAND); mConceptVec->setData(collConcept->getConceptTag(),collConcept); CBOXHASH* templConNomSchConHash = nsTemplate->getTemplateConceptNominalSchemaConceptHash(); CBOXSET* nomSchConSet = nsTemplate->getNominalSchemaConceptSet(); QHash::const_iterator > nomSchConIndividualItHash; QSet::const_iterator indiIt = mNominalConceptSet.constBegin(); QSet::const_iterator indiItEnd = mNominalConceptSet.constEnd(); FOREACHIT (CConcept* nomSchCon, *nomSchConSet) { nomSchConIndividualItHash.insert(nomSchCon,indiIt); } bool conVarItFinished = false; while (!conVarItFinished) { ++mStatInstantiatedAxiomsCount; CConcept* templateConcept = nsTemplate->getTemplateConcept(); CConcept* groundedConcept = createGroundedNominalSchemaConcept(templateConcept,templConNomSchConHash,&nomSchConIndividualItHash); addConceptOperand(collConcept,groundedConcept,negated); QHash::const_iterator >::const_iterator variableIt = nomSchConIndividualItHash.constBegin(); QHash::const_iterator >::const_iterator variableItEnd = nomSchConIndividualItHash.constEnd(); QSet::const_iterator varIndiIt = variableIt.value(); CConcept* varConcept = variableIt.key(); ++varIndiIt; bool conVarIteration = true; while (varIndiIt == indiItEnd && conVarIteration) { conVarIteration = false; nomSchConIndividualItHash.insert(varConcept,indiIt); ++variableIt; if (variableIt == variableItEnd) { conVarItFinished = true; } else { varIndiIt = variableIt.value(); varConcept = variableIt.key(); ++varIndiIt; if (varIndiIt == indiItEnd) { conVarIteration = true; } } } nomSchConIndividualItHash.insert(varConcept,varIndiIt); } mCollConHash.insert(QPair(concept,negated),collConcept); return collConcept; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CConcreteOntologyPreProcess.cpp0000644000175000017500000000302712520551220030273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteOntologyPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CConcreteOntologyPreProcess::CConcreteOntologyPreProcess() { } CConcreteOntologyPreProcess::~CConcreteOntologyPreProcess() { } COntology *CConcreteOntologyPreProcess::preprocess(COntology *ontology) { CConcreteOntology* concreteOntology = dynamic_cast(ontology); if (!concreteOntology) { LOG(INFO,"::Konclude::Reasoner::Preprocess::ConcreteOntologyPreprocess",logTr("Not supported ontology format."),this); } else { preprocess(concreteOntology); } return ontology; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CConceptRoleIndividualLocator.cpp0000644000175000017500000001045512520551216030552 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptRoleIndividualLocator.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CConceptRoleIndividualLocator::CConceptRoleIndividualLocator() { } CConceptRoleIndividualLocator::~CConceptRoleIndividualLocator() { } CConcept* CConceptRoleIndividualLocator::getLocatedConcept(CConcept* concept, CConcreteOntology* ontology) { CTBox* tbox = ontology->getDataBoxes()->getTBox(); CConceptVector* conceptVector = tbox->getConceptVector(); cint64 conceptTag = concept->getConceptTag(); if (!conceptVector->hasLocalData(concept->getConceptTag())) { CMemoryAllocationManager* memMan = tbox->getBoxContext()->getMemoryAllocationManager(); CBUILDHASH* conceptClassTermHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getConceptClassTermMappingHash(); CConcept* prevConcept = concept; concept = CObjectAllocator::allocateAndConstruct(memMan)->initConceptCopy(prevConcept,memMan); conceptVector->setLocalData(conceptTag,concept); CClassTermExpression* classTerm = conceptClassTermHash->value(prevConcept); if (classTerm) { conceptClassTermHash->insert(concept,classTerm); } } return concept; } CRole* CConceptRoleIndividualLocator::getLocatedRole(CRole* role, CConcreteOntology* ontology) { CRBox* rbox = ontology->getDataBoxes()->getRBox(); CRoleVector* roleVector = rbox->getRoleVector(); cint64 roleTag = role->getRoleTag(); if (!roleVector->hasLocalData(role->getRoleTag())) { CMemoryAllocationManager* memMan = rbox->getBoxContext()->getMemoryAllocationManager(); CBUILDHASH* roleObjectPropertyTermHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getRoleObjectPropertyTermMappingHash(); CRole *roleRef = role; role = CObjectAllocator::allocateAndConstruct(memMan)->initRoleCopy(roleRef,memMan); roleVector->setData(roleTag,role); CObjectPropertyTermExpression* objPropTerm = roleObjectPropertyTermHash->value(role); if (objPropTerm) { roleObjectPropertyTermHash->insert(role,objPropTerm); } } return role; } CIndividual* CConceptRoleIndividualLocator::getLocatedIndividual(CIndividual* individual, CConcreteOntology* ontology) { CABox* abox = ontology->getDataBoxes()->getABox(); CIndividualVector* indiVector = abox->getIndividualVector(); cint64 indiTag = individual->getIndividualID(); CIndividual* localIndi = indiVector->getLocalData(indiTag); if (!localIndi) { CMemoryAllocationManager* memMan = abox->getBoxContext()->getMemoryAllocationManager(); CBUILDHASH* indiIndividualTermHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getIndiIndividulTermMappingHash(); CBUILDHASH* individualTermIndiHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getIndividulTermIndiMappingHash(); localIndi = CObjectAllocator::allocateAndConstruct(memMan)->initIndividualCopy(individual,memMan); indiVector->setLocalData(indiTag,localIndi); CIndividualTermExpression* indiTerm = indiIndividualTermHash->value(individual); if (indiTerm) { indiIndividualTermHash->insert(localIndi,indiTerm); individualTermIndiHash->insert(indiTerm,localIndi); } } return localIndi; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CBranchTriggerPreProcess.cpp0000644000175000017500000001707212520551216027531 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBranchTriggerPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CBranchTriggerPreProcess::CBranchTriggerPreProcess() { } CBranchTriggerPreProcess::~CBranchTriggerPreProcess() { } CConcreteOntology *CBranchTriggerPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { bool skipForELOntologies = CConfigDataReader::readConfigBoolean(context->getConfiguration(),"Konclude.Calculation.Preprocessing.BranchTriggerExtraction.SkipForELFragment",true); bool nonELConstructsUsed = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags()->isNonELConstructUsed(); if (nonELConstructsUsed || !skipForELOntologies) { CMBox *mBox = ontology->getDataBoxes()->getMBox(); CTBox *tBox = ontology->getDataBoxes()->getTBox(); CRBox *rBox = ontology->getDataBoxes()->getRBox(); CABox *aBox = ontology->getDataBoxes()->getABox(); mConceptVec = tBox->getConceptVector(); CBranchingTriggerVector* branchTriggVec = mBox->getBranchingTriggerVector(); CRoleVector *roles = rBox->getRoleVector(); CConcept *topConcept = mConceptVec->getLocalData(1); mMemMan = ontology->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); mOnto = ontology; mTBox = tBox; mRoleDomainTriggerConceptHash = nullptr; mStatConceptBranchTriggers = 0; mStatRoleBranchTriggers = 0; mStatBranchTriggers = 0; cint64 conCount = tBox->getConceptCount(); for (cint64 conIdx = 0; conIdx < conCount; ++conIdx) { CConcept* concept = mConceptVec->getLocalData(conIdx); if (concept) { cint64 conOpCode = concept->getOperatorCode(); cint64 opCount = concept->getOperandCount(); CConceptRoleBranchingTrigger* branchingTriggers = nullptr; bool negConTriggers = false; if (!branchTriggVec->hasData(conIdx)) { if (opCount > 1) { if (conOpCode == CCAND || conOpCode == CCEQ) { negConTriggers = true; branchingTriggers = createBranchingTriggers(concept,negConTriggers); } else if (conOpCode == CCOR) { branchingTriggers = createBranchingTriggers(concept,negConTriggers); } } if (branchingTriggers) { ++mStatBranchTriggers; branchTriggVec->setData(conIdx,branchingTriggers); } } } } LOG(INFO,"::Konclude::Reasoner::Preprocess::BranchTriggerExtractor",logTr("Extracted %1 concept and %2 role branch triggers for %3 concepts.").arg(mStatConceptBranchTriggers).arg(mStatRoleBranchTriggers).arg(mStatBranchTriggers),this); } return ontology; } CConceptRoleBranchingTrigger *CBranchTriggerPreProcess::createBranchingTriggers(CConcept* concept, bool negated) { typedef QPair TConNegPair; CConceptRoleBranchingTrigger* branchingTriggerList = nullptr; QSet branchingTriggerSet; QList disjList; QList disjInitList; disjInitList.append(TConNegPair(concept,negated)); while (!disjInitList.isEmpty()) { TConNegPair disConNegPair(disjInitList.takeFirst()); CConcept *disCon = disConNegPair.first; bool disNeg = disConNegPair.second; qint64 disConOpCode = disCon->getOperatorCode(); if (!disNeg && (disConOpCode == CCOR) || disNeg && (disConOpCode == CCAND || disConOpCode == CCEQ)) { CSortedNegLinker *splitOrOpIt = disCon->getOperandList(); while (splitOrOpIt) { CConcept *splitCon = splitOrOpIt->getData(); bool splitConNeg = splitOrOpIt->isNegated(); disjInitList.append(TConNegPair(splitCon,splitConNeg^disNeg)); splitOrOpIt = splitOrOpIt->getNext(); } } else { disjList.append(TConNegPair(disCon,disNeg)); } } while (!disjList.isEmpty()) { TConNegPair disConNegPair(disjList.takeFirst()); CConcept *disCon = disConNegPair.first; bool disNeg = disConNegPair.second; cint64 conOpCount = disCon->getOperandCount(); CConceptRoleBranchingTrigger* branchingTrigger = nullptr; qint64 disConOpCode = disCon->getDefinitionOperatorTag(); if (disNeg && (disConOpCode == CCSUB || disConOpCode == CCATOM)) { if (!branchingTriggerSet.contains(TConNegPair(disCon,!disNeg))) { branchingTriggerSet.insert(TConNegPair(disCon,!disNeg)); branchingTrigger = CObjectAllocator< CConceptRoleBranchingTrigger >::allocateAndConstruct(mMemMan); branchingTrigger->initConceptBranchingTrigger(disCon,!disNeg); ++mStatConceptBranchTriggers; } } else if (disConOpCode == CCALL && !disNeg || disConOpCode == CCSOME && disNeg || disConOpCode == CCATMOST && !disNeg || disConOpCode == CCATLEAST && disNeg && conOpCount > 0) { CRole* role = disCon->getRole(); CRole* locatedRole = CConceptRoleIndividualLocator::getLocatedRole(role,mOnto); CConcept* triggerDomConcept = getRoleDomainTriggerConcept(locatedRole); if (!branchingTriggerSet.contains(TConNegPair(triggerDomConcept,false))) { branchingTriggerSet.insert(TConNegPair(triggerDomConcept,false)); branchingTrigger = CObjectAllocator< CConceptRoleBranchingTrigger >::allocateAndConstruct(mMemMan); branchingTrigger->initConceptBranchingTrigger(triggerDomConcept,false); ++mStatRoleBranchTriggers; } } if (branchingTrigger) { branchingTriggerList = branchingTrigger->append(branchingTriggerList); } } return branchingTriggerList; } bool CBranchTriggerPreProcess::addRoleDomainConcept(CRole* role, CConcept* addedConcept, bool negated) { CSortedNegLinker* newBaseOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon->init(addedConcept,negated,role->getDomainConceptList()); role->setDomainConceptList(newBaseOpCon); return true; } CConcept* CBranchTriggerPreProcess::getRoleDomainTriggerConcept(CRole* role) { if (!mRoleDomainTriggerConceptHash) { mRoleDomainTriggerConceptHash = mTBox->getRoleDomainTriggerConceptHash(true); } CConcept*& triggerConcept = (*mRoleDomainTriggerConceptHash)[role]; if (!triggerConcept) { triggerConcept = createTriggerConcept(); addRoleDomainConcept(role,triggerConcept,false); } return triggerConcept; } CConcept* CBranchTriggerPreProcess::createTriggerConcept() { CConcept* triggerConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); triggerConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); triggerConcept->initTag(nextConTag); triggerConcept->setOperatorCode(CCIMPLTRIG); mConceptVec->setLocalData(nextConTag,triggerConcept); return triggerConcept; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CCommonDisjunctConceptExtractionPreProcess.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CCommonDisjunctConceptExtractionPreProcess0000644000175000017500000000540212520551216032532 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CCOMMONDISJUNCTCONCEPTEXTRACTIONPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CCOMMONDISJUNCTCONCEPTEXTRACTIONPREPROCESS_H // Libraries includes // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" // Other includes #include "Reasoner/Ontology/CConceptRoleBranchingTrigger.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { typedef QPair TConNegPair; /*! * * \class CCommonDisjunctConceptExtractionPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommonDisjunctConceptExtractionPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CCommonDisjunctConceptExtractionPreProcess(); //! Destructor virtual ~CCommonDisjunctConceptExtractionPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: CConceptRoleBranchingTrigger *createBranchingTriggers(CConcept* concept, bool negated); bool getDisjunctConcepts(CConcept* concept, bool negated, QSet* collectConSet, QSet* consideredConSet); // protected variables protected: CMemoryAllocationManager* mMemMan; QHash* > mDisjunctionCommDisConHash; QList< QSet* > mSetContainer; CConceptVector* mConceptVector; CConcept* mTopConcept; cint64 mStatExtractedCommDisCon; cint64 mStatExtractedConceptForDisjunctionCount; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CCOMMONDISJUNCTCONCEPTEXTRACTIONPREPROCESS_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CRoleChainAutomataTransformationPreProcess.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CRoleChainAutomataTransformationPreProcess0000644000175000017500000002204112520551230032502 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CROLECHAINAUTOMATATRANSFORMATIONPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CROLECHAINAUTOMATATRANSFORMATIONPREPROCESS_H // Libraries includes #include // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" // Other includes #include "Reasoner/Ontology/CBoxContext.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CRoleDependence.h" #include "Reasoner/Ontology/CMBox.h" #include "Utilities/CDynamicExpandingMemoryManager.hpp" #include "Utilities/CSortedNegLinker.hpp" #include "Parser/Expressions/CInverseObjectPropertyOfExpression.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Parser::Expression; namespace Reasoner { using namespace Ontology; namespace Preprocess { typedef QPair TRoleNegationPair; class CRoleSubRoleChainData { public: CRole* mRole; CRoleChain* mRoleChain; bool mInverse; CRoleSubRoleChainData(CRole* role = nullptr, CRoleChain* roleChain = nullptr, bool inverse = nullptr) { mRole = role; mRoleChain = roleChain; mInverse = inverse; } }; class CRoleSubRoleChainDataItem { public: CRoleSubRoleChainDataItem(CRoleSubRoleChainData& roleChain) { mChainData = roleChain; mNegated = false; mAllowPropagated = true; } CRoleSubRoleChainDataItem(CRoleSubRoleChainData& roleChain, bool negated) { mChainData = roleChain; mNegated = negated; mAllowPropagated = false; } public: CRoleSubRoleChainData mChainData; bool mNegated; bool mAllowPropagated; }; class CRecTravSubRoleChainDataItem { public: CRecTravSubRoleChainDataItem() { mRole = nullptr; } public: CRole* mRole; QList mDirectSubRoleChainDataList; QList mRecTraversalSubRoleList; }; /*! * * \class CRoleChainAutomataTransformationPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRoleChainAutomataTransformationPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CRoleChainAutomataTransformationPreProcess(); //! Destructor virtual ~CRoleChainAutomataTransformationPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, QSet* trasformConceptSet, CPreProcessContext* context); // protected methods protected: // private methods private: enum TRANSLATIONTYPE { TTNORMAL, TTIMPL, TTBRANCH, TTPROPBIND, TTBACKPROP, TTVARBIND }; CRole* getLocalizedRole(CRole* role); CRole* getLocalizedRole(cint64 roleTag); bool hasInverseRole(CRole* role, bool searchInverseEquivalent = true); CRole* getInverseRole(CRole* role, bool searchInverseEquivalent = true); bool hasSuperRole(CRole* role, CRole* testingSuperRole, bool testInversed, bool superRoleInversedRequired); bool hasSuperRole(CRole* role, CRole* testingSuperRole, bool superRoleInversedRequired); bool hasInversedSuperRole(CRole* role, CRole* testingSuperRole); bool hasNonInversedSuperRole(CRole* role, CRole* testingSuperRole); bool hasInversedOrNonInversedSuperRole(CRole* role, CRole* testingSuperRole); CRoleChainAutomataTransformationPreProcess* convertAutomatConcept(CConcept* concept); CConcept* createAutomatGeneratingConcept(CSortedNegLinker* opLinker, bool negate, CRole* role); CRoleChainAutomataTransformationPreProcess* collectSubRoleChains(); CRoleChainAutomataTransformationPreProcess* createMissingInverseChainedRoles(); CRoleChainAutomataTransformationPreProcess* createInverseRoleChainLinkers(); CRoleChainAutomataTransformationPreProcess* createRecursiveTraversalData(); QList getRelevantChainDataList(CRole* role, const QList& roleSubChainDataList); CRoleChainAutomataTransformationPreProcess* addRecursiveTraversalData(CRole* role, const QList& roleSubChainDataList); bool isChainDataImplicit(const CRoleSubRoleChainData& testingImplicitChainData, const CRoleSubRoleChainData& chainData); bool isChainLinkerImplicit(CXLinker* testingImplicitChainLinker, CXLinker* chainLinker, bool inversedTesting); bool isTransitiveChainData(const CRoleSubRoleChainData& chainData); bool isChainDataRecursiveTraversalCritical(CRole* role, const CRoleSubRoleChainData& chainData); bool collectRecursiveTraversalCriticalRoles(CRole* role, const CRoleSubRoleChainData& chainData, QHash* criticalRoleNegationHash); QHash getRelevantRecursiveTraversalCriticalRoles(QHash* criticalRoleNegationHash); bool requiresRecursiveTraversalForRole(CRole* role, const CRoleSubRoleChainData& chainData, QHash* criticalRoleNegationHash); bool generateRoleChainAutomatConcept(CRole* lastRole, const CRecTravSubRoleChainDataItem& recTravSubRoleChainDataItem, QSet& alreadyUnfoldRoleSet, CConcept* beginConcept, CConcept* endConcept, TRANSLATIONTYPE transType); bool generateRoleChainAutomatConcept(CRole* lastRole, const QList& subRoleChainDataList, QSet& alreadyUnfoldRoleSet, CConcept* beginConcept, CConcept* endConcept, TRANSLATIONTYPE transType); bool generateRoleChainAutomatConcept(CRole* lastRole, CRole* superRole, CRoleChain* descendingRoleChain, bool negatedChain, QSet& alreadyUnfoldRoleSet, CConcept* beginConcept, CConcept* endConcept, TRANSLATIONTYPE transType); CConcept* createTransitionConcept(CRole* role, TRANSLATIONTYPE transType); CSortedNegLinker* createTransitionOperandConceptLinker(CConcept* operandConcept, bool negation); CConcept* appendTransitionOperandConceptLinker(CConcept* concept, CSortedNegLinker* opLinker); CConcept* createStateConcept(TRANSLATIONTYPE transType); bool hasPropagationConcept(bool negated, CConcept* concept, CRole* role, CSortedNegLinker* roleList, bool inverseDomRange); bool hasPropagatedConcept(bool negated, CConcept* concept, CSortedNegLinker* roleList, bool inverseDomRange); CRoleChainAutomataTransformationPreProcess* createDomainRangePropagations(); CRoleChainAutomataTransformationPreProcess* transformVALUERestrictions(); CConcept* createNominalConcept(CIndividual* individual); // private variables private: CConcreteOntology* mOntology; CRoleVector *mRoleVec; CConceptVector *mConVec; cint64 mNextConceptTag; CMemoryAllocationManager* mMemMan; typedef QPair TConceptNegPair; QHash mRoleRecTravSubRoleChainDataHash; QHash mRoleSubRoleChainDataHash; QSet mInverseUpdateRoleChainSet; QHash mDomConPropConceptHash; QHash mRanConPropConceptHash; CBUILDHASH* mRoleObjPropTermHash; CBUILDHASH* mObjPropTermRoleHash; CBUILDLIST* mExpressionBuildContainerList; CBUILDHASH* mInverseObjectPropertyHash; CBUILDHASH* mExpressionBuildHash; cint64 mStatAutomateStateConceptCount; cint64 mStatAutomateTransitionConceptCount; cint64 mStatAutomateTransformedConceptCount; cint64 mStatAutomateTransitiveSavedCount; cint64 mStatRangePropagationCount; cint64 mStatDomainPropagationCount; cint64 mStatCreatedRangePropagationCount; cint64 mStatCreatedDomainPropagationCount; cint64 mStatPropagationAlreadyInDomainRangeCount; cint64 mStatPropagatedAlreadyInDomainRangeCount; bool mConfSaveTransitiveTransitions; }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CROLECHAINAUTOMATATRANSFORMATIONPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CSubroleTransformationPreProcess.h0000644000175000017500000000677712520551230031025 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CSUBROLETRANSFORMATIONPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CSUBROLETRANSFORMATIONPREPROCESS_H // Libraries includes #include // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" // Other includes #include "Reasoner/Ontology/CBoxContext.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CRoleDependence.h" #include "Reasoner/Ontology/CMBox.h" #include "Utilities/CSortedNegLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CSubroleTransformationPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSubroleTransformationPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CSubroleTransformationPreProcess(); //! Destructor virtual ~CSubroleTransformationPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: void addIndirectSuperRoles(bool inverse, CRole *modifingSubRole, CSortedNegLinker *superRoleLinker, QSet< QPair > *singleSuperRoleAddSet); void makeUniversalSuperRole(); void makeUniversalConnectionIndividual(); void makeDataSuperRole(); void makeBottomObjectRoleDomain(); void makeBottomDataRoleDomain(); void makeBottomRoleDomain(CRole* role); bool hasUniversalRolePropagation(); // private methods private: CSubroleTransformationPreProcess* collectInverseEquivalentRoles(CRole* role, bool negated, QSet< QPair >* roleSet); CSubroleTransformationPreProcess* updateDirectSuperRoles(CRole* role, bool negated, QSet< QPair >* roleSet); CRole* getLocalizedRole(CRole* role); CIndividual* getLocalizedIndividual(CIndividual* individual); // private variables private: CABox* mABox; CTBox* mTBox; CRBox* mRBox; CMBox* mMBox; CIndividualVector* mIndiVec; CRoleVector* mRolesVector; CConceptVector* mConceptVector; CRoleChainVector* mRoleChainVector; CConcreteOntology* mOntology; CRole* mBottomObjectRole; CRole* mTopObjectRole; CRole* mBottomDataRole; CRole* mTopDataRole; CBUILDHASH* roleObjPropTermHash; CMemoryAllocationManager* mMemMan; }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CSUBROLETRANSFORMATIONPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CConceptTriggerLinker.h0000644000175000017500000000434212520551220026522 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CCONCEPTTRIGGERLINKER_H #define KONCLUDE_REASONER_PREPROCESS_CCONCEPTTRIGGERLINKER_H // Libraries includes // Namespace includes #include "Reasoner/Ontology/CConcept.h" // Other includes #include "Utilities/Container/CSortedLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CConceptTriggerLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptTriggerLinker : public CSortedLinkerBase { // public methods public: //! Constructor CConceptTriggerLinker(); CConceptTriggerLinker* initConceptTriggerLinker(CConcept* triggerConcept, cint64 triggerComplexity); CConcept* getTriggerConcept(); cint64 getTriggerComplexity(); CConceptTriggerLinker* setTriggerComplexity(cint64 complexity); bool operator<=(const CConceptTriggerLinker& conceptTriggerLinker); // protected methods protected: // private methods private: CConcept* mTriggerConcept; cint64 mTriggerComplexity; // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CCONCEPTTRIGGERLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreProcessContextBase.cpp0000644000175000017500000000310012520551224027211 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreProcessContextBase.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CPreProcessContextBase::CPreProcessContextBase(CConcreteOntology *ontology, CConfiguration *config) { mOntology = ontology; mConfig = config; mMemMan = mOntology->getOntologyContext()->getMemoryAllocationManager(); } CPreProcessContextBase::~CPreProcessContextBase() { } CMemoryAllocationManager* CPreProcessContextBase::getMemoryAllocationManager() { return mMemMan; } CConfiguration* CPreProcessContextBase::getConfiguration() { return mConfig; } CConcreteOntology* CPreProcessContextBase::getOntology() { return mOntology; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CConceptRoleIndividualLocator.h0000644000175000017500000000411412520551216030212 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CCONCEPTROLEINDIVIDUALLOCATOR_H #define KONCLUDE_REASONER_PREPROCESS_CCONCEPTROLEINDIVIDUALLOCATOR_H // Libraries includes // Namespace includes // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CConceptRoleIndividualLocator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptRoleIndividualLocator { // public methods public: //! Constructor CConceptRoleIndividualLocator(); //! Destructor virtual ~CConceptRoleIndividualLocator(); static CConcept* getLocatedConcept(CConcept* concept, CConcreteOntology* ontology); static CRole* getLocatedRole(CRole* role, CConcreteOntology* ontology); static CIndividual* getLocatedIndividual(CIndividual* individual, CConcreteOntology* ontology); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CCONCEPTROLEINDIVIDUALLOCATOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CCoreBlockingConceptMarkerPreProcess.cpp0000644000175000017500000000674612520551220032030 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCoreBlockingConceptMarkerPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CCoreBlockingConceptMarkerPreProcess::CCoreBlockingConceptMarkerPreProcess() { } CCoreBlockingConceptMarkerPreProcess::~CCoreBlockingConceptMarkerPreProcess() { } CConcreteOntology* CCoreBlockingConceptMarkerPreProcess::preprocess(CConcreteOntology* ontology, CPreProcessContext* context) { bool skipForELOntologies = CConfigDataReader::readConfigBoolean(context->getConfiguration(),"Konclude.Calculation.Preprocessing.CoreBlockingConceptMarking.SkipForELFragment",true); bool nonELConstructsUsed = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags()->isNonELConstructUsed(); if (nonELConstructsUsed || !skipForELOntologies) { CTBox* tbox = ontology->getDataBoxes()->getTBox(); CABox* abox = ontology->getDataBoxes()->getABox(); CRBox* rbox = ontology->getDataBoxes()->getRBox(); CConceptVector* conVec = tbox->getConceptVector(); qint64 itemConCounts = conVec->getItemCount(); QSet visitedConceptSet; COntologyContext* ontoContext = ontology->getOntologyContext(); CMemoryAllocationManager* mMemMan = ontoContext->getMemoryAllocationManager(); COntologyCoreConceptCyclesData* coreConCyclesData = ontology->getCoreConceptCyclesData(); cint64 statMarkedCoreBlockingConceptsCount = 0; cint64 nextCycleID = 0; for (qint64 i = 0; i < itemConCounts; ++i) { CConcept* concept = conVec->getLocalData(i); if (concept) { cint64 opCode = concept->getOperatorCode(); if (opCode == CCSOME || opCode == CCALL || opCode == CCATLEAST || opCode == CCAQSOME || opCode == CCATMOST) { bool opNegated = opCode == CCALL; CSortedNegLinker* opLinkerIt = concept->getOperandList(); while (opLinkerIt) { CConcept* opConcept = concept; bool opNegate = opNegated^opLinkerIt->isNegated(); CConceptProcessData* conProDes = (CConceptProcessData*)opConcept->getConceptData(); if (conProDes) { bool negated = opNegated^opNegate; if (!conProDes->isCoreBlockingConcept(negated)) { ++statMarkedCoreBlockingConceptsCount; conProDes->setCoreBlockingConcept(negated); } } opLinkerIt = opLinkerIt->getNext(); } } } } LOG(INFO,"::Konclude::Reasoner::Preprocess::CoreBlockingConceptMarker",logTr("Marked %1 concept as core blocking concepts.").arg(statMarkedCoreBlockingConceptsCount),this); } return ontology; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CTriggeredImplicationGCIAbsorberPreProcess.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CTriggeredImplicationGCIAbsorberPreProcess0000644000175000017500000014276512405707546032362 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTriggeredImplicationGCIAbsorberPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { #ifdef KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED #define KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(a) #else //#define KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(a) a #define KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(a) #endif CTriggeredImplicationGCIAbsorberPreProcess::CTriggeredImplicationGCIAbsorberPreProcess() { mConfRequiresExistingInverseRole = false; mConfAbsorbEqClassDefinitions = true; mConfAbsorbDisjunctions = true; mConfAbsorbSimpleDisjunctions = true; mConfPartialGCIAbsorption = true; } CTriggeredImplicationGCIAbsorberPreProcess::~CTriggeredImplicationGCIAbsorberPreProcess() { } CConcreteOntology *CTriggeredImplicationGCIAbsorberPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { CMBox *mBox = ontology->getDataBoxes()->getMBox(); CTBox *tBox = ontology->getDataBoxes()->getTBox(); CRBox *rBox = ontology->getDataBoxes()->getRBox(); CABox *aBox = ontology->getDataBoxes()->getABox(); mConceptVec = tBox->getConceptVector(); cint64 conceptCount = mConceptVec->getItemCount(); CRoleVector *roles = rBox->getRoleVector(); CConcept *topConcept = tBox->getTopConcept(); mBottomConcept = tBox->getBottomConcept(); mMemMan = ontology->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); mOnto = ontology; CConfiguration* config = context->getConfiguration(); mConfAbsorbDisjunctions = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.DisjunctionToImplicationAbsorption",true); mConfAbsorbSimpleDisjunctions = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.DisjunctionToImplicationAbsorptionByExistingTriggers",true); mConfAbsorbEqClassDefinitions = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.EquivalentDefinitionToSubclassImplicationAbsorption",true); mConfPartialGCIAbsorption = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.PartialGCIImplicationAbsorption",true); CImplicationReplacementVector* impRepVec = nullptr; if (mConfAbsorbDisjunctions || mConfAbsorbSimpleDisjunctions) { impRepVec = mBox->getImplicationReplacementVector(true); } mTriggerImplHash = tBox->getTriggerImplicationHash(true); mStatInvRolesGenerated = 0; mStatGCIAbsorbed = 0; mStatGCINormalAbsorbed = 0; mStatGCITotal = 0; mStatEqAbsorbed = 0; mStatEqTotal = 0; mStatImplConceptsGenerated = 0; mStatGCIAbsorptionPartialExtended = 0; mStatGCIPartialAbsorbed = 0; if (mConfAbsorbEqClassDefinitions) { QList equivConceptAbsorbList; // try to absorb equivalent classes expressions for (cint64 conIdx = 0; conIdx < conceptCount; conIdx++) { CConcept* concept = mConceptVec->getLocalData(conIdx); if (concept) { cint64 opCode = concept->getOperatorCode(); if (opCode == CCEQ) { ++mStatEqTotal; if (isEquivalenceConceptTriggeredImplicationAbsorbable(concept,false)) { // absorb to subclass and implication trigger concept->setOperatorCode(CCSUB); equivConceptAbsorbList.append(concept); ++mStatEqAbsorbed; } } } } foreach (CConcept* concept, equivConceptAbsorbList) { createEquivalenceAbsorbedTriggeredImplication(concept,false); } } mFirstNewConceptTag = mConceptVec->getItemCount(); mLastNewConceptTag = mFirstNewConceptTag; if (topConcept) { CSortedNegLinker* lastgciConLinker = nullptr; CSortedNegLinker* gciConLinker = topConcept->getOperandList(); CSortedNegLinker* gciConLinkerIt = gciConLinker; while (gciConLinkerIt) { CConcept* opCon = gciConLinkerIt->getData(); bool opNegation = gciConLinkerIt->isNegated(); ++mStatGCITotal; bool absorbed = false; mFirstNewConceptTag = mLastNewConceptTag; KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(mDebugLastGCIString = generateDebugGCIConceptString(opCon,opNegation)); if (absorbGCIConceptsToTriggeredImplications(opCon,opNegation)) { ++mStatGCINormalAbsorbed; KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(mDebugLastAbsorbedGCITechniqueString = QString("implication absorbed")); absorbed = true; } if (!absorbed && mConfPartialGCIAbsorption) { if (absorbPartialGCIConceptsToTriggeredImplications(opCon,opNegation)) { ++mStatGCIPartialAbsorbed; KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(mDebugLastAbsorbedGCITechniqueString = QString("partial implication absorbed")); absorbed = true; } } if (absorbed) { ++mStatGCIAbsorbed; mLastNewConceptTag = mConceptVec->getItemCount(); KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(mDebugLastAbsorbedGCIConceptString = generateDebugGeneratedAbsorbedImplicationString(mFirstNewConceptTag,mLastNewConceptTag)); KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(mDebugLastAbsorbedGCIString = QString("GCI:
\r\n
\r\n%1
\r\n%2 to
\r\n
\r\n%3

\r\n\r\n").arg(mDebugLastGCIString).arg(mDebugLastAbsorbedGCITechniqueString).arg(mDebugLastAbsorbedGCIConceptString)); KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(mDebugTotalAbsorbedGCIString += mDebugLastAbsorbedGCIString); if (lastgciConLinker) { lastgciConLinker->setNext(gciConLinkerIt->getNext()); } else { topConcept->setOperandList(gciConLinkerIt->getNext()); } topConcept->incOperandCount(-1); } else { lastgciConLinker = gciConLinkerIt; } gciConLinkerIt = gciConLinkerIt->getNext(); } } if (mConfAbsorbDisjunctions || mConfAbsorbSimpleDisjunctions) { for (cint64 conIdx = 0; conIdx < conceptCount; conIdx++) { CConcept* concept = mConceptVec->getLocalData(conIdx); bool localRepData = false; CReplacementData* prevReplData = impRepVec->getData(conIdx,&localRepData); if (concept && (!prevReplData || !localRepData)) { cint64 opCode = concept->getOperatorCode(); bool absorbable = false; bool absorbNeg = false; bool absorbPos = false; cint64 opCount = concept->getOperandCount(); if (opCount > 1) { if (opCode == CCAND) { absorbNeg = true; absorbPos = true; } else if (opCode == CCOR) { absorbNeg = false; absorbPos = true; } if (absorbPos) { if (mConfAbsorbSimpleDisjunctions && isDisjunctionConceptSimpleTriggeredImplicationAbsorbable(concept,absorbNeg)) { absorbable = true; } else if (mConfAbsorbDisjunctions && isDisjunctionConceptTriggeredImplicationAbsorbable(concept,absorbNeg)) { // add implication trigger absorption absorbable = true; } } if (absorbable) { CConcept* absorbedImpCon = createDisjunctionAbsorbedTriggeredImplication(concept,absorbNeg); CReplacementData* replData = prevReplData; if (!localRepData) { replData = CObjectAllocator::allocateAndConstruct(mMemMan); replData->initReplacementData(prevReplData); impRepVec->setData(concept->getConceptTag(),replData); } replData->setImplicationReplacementConcept(absorbedImpCon); } } } } } LOG(INFO,"::Konclude::Reasoner::Preprocess::TriggeredImplicationAbsorber",logTr("Absorbed %1 of %2 equivalence class definitions.").arg(mStatEqAbsorbed).arg(mStatEqTotal),this); LOG(INFO,"::Konclude::Reasoner::Preprocess::TriggeredImplicationAbsorber",logTr("Absorbed %1 of %2 GCI definitions.").arg(mStatGCIAbsorbed).arg(mStatGCITotal),this); if (mStatGCITotal > 0) { LOG(INFO,"::Konclude::Reasoner::Preprocess::TriggeredImplicationAbsorber",logTr("Absorbed %1 GCI definitions only partially and extended %2 absorptions partially.").arg(mStatGCIPartialAbsorbed).arg(mStatGCIAbsorptionPartialExtended),this); } LOG(INFO,"::Konclude::Reasoner::Preprocess::TriggeredImplicationAbsorber",logTr("Generated %1 triggered implication concepts and %2 additional inverse roles.").arg(mStatImplConceptsGenerated).arg(mStatInvRolesGenerated),this); return ontology; } QString CTriggeredImplicationGCIAbsorberPreProcess::generateDebugGCIConceptString(CConcept* concept, bool conceptNegation) { mDebugGCIString = CConceptTextFormater::getConceptString(concept,conceptNegation); return mDebugGCIString; } QString CTriggeredImplicationGCIAbsorberPreProcess::generateDebugGeneratedAbsorbedImplicationString(cint64 minNewConceptTag, cint64 lastNewConceptTag) { QString absorbedString; for (cint64 tag = minNewConceptTag; tag <= lastNewConceptTag; ++tag) { CConcept* concept = mConceptVec->getData(tag); if (concept) { QString tmpString = CConceptTextFormater::getConceptString(concept,false); absorbedString += QString("%1
\r\n").arg(tmpString); } } mDebugAbsorbedString = absorbedString; return absorbedString; } CConcept* CTriggeredImplicationGCIAbsorberPreProcess::createImpliedConcept() { CConcept* concept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); concept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); concept->initTag(nextConTag); concept->setOperatorCode(CCAND); mConceptVec->setLocalData(nextConTag,concept); return concept; } bool CTriggeredImplicationGCIAbsorberPreProcess::addConceptToImplied(CConcept* impliedConcept, CConcept* concept, bool negated) { CSortedNegLinker* newBaseOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon->init(concept,negated,impliedConcept->getOperandList()); impliedConcept->setOperandList(newBaseOpCon); impliedConcept->incOperandCount(); return true; } bool CTriggeredImplicationGCIAbsorberPreProcess::addSubClassConcept(CConcept* subclassConcept, CConcept* addedConcept, bool negated) { CSortedNegLinker* newBaseOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon->init(addedConcept,negated,subclassConcept->getOperandList()); subclassConcept->setOperandList(newBaseOpCon); subclassConcept->incOperandCount(); subclassConcept->setOperatorCode(CCSUB); return true; } bool CTriggeredImplicationGCIAbsorberPreProcess::addRoleDomainConcept(CRole* role, CConcept* addedConcept, bool negated) { CSortedNegLinker* newBaseOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon->init(addedConcept,negated,role->getDomainConceptList()); role->setDomainConceptList(newBaseOpCon); return true; } CConcept* CTriggeredImplicationGCIAbsorberPreProcess::createImplicationConcept(CConcept* impliedConcept, bool negated) { CConcept* concept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); concept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); concept->initTag(nextConTag); concept->setOperatorCode(CCIMPL); CSortedNegLinker* newBaseOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon->init(impliedConcept,negated); concept->setOperandList(newBaseOpCon); concept->incOperandCount(); mConceptVec->setLocalData(nextConTag,concept); ++mStatImplConceptsGenerated; return concept; } CConcept* CTriggeredImplicationGCIAbsorberPreProcess::createImplicationTriggerConcept(CConcept* impConcept, bool negated) { CConcept* concept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); concept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); concept->initTag(nextConTag); concept->setOperatorCode(CCIMPLTRIG); mConceptVec->setLocalData(nextConTag,concept); if (impConcept) { addConceptToImplied(concept,impConcept,negated); } return concept; } bool CTriggeredImplicationGCIAbsorberPreProcess::addImplicationTrigger(CConcept* implConcept, CConcept* triggerConcept, bool negated) { CSortedNegLinker* newTriggerOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newTriggerOpCon->init(triggerConcept,negated,implConcept->getOperandList()->getNext()); implConcept->getOperandList()->setNext(newTriggerOpCon); implConcept->incOperandCount(); mTriggerImplHash->insertMulti(triggerConcept,implConcept); return true; } CConcept* CTriggeredImplicationGCIAbsorberPreProcess::createTriggerPropagationConcept(CConcept* destConcept, CRole* backwardPropRole) { CConcept* concept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); CRole* invRole = getInverseRole(backwardPropRole); concept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); concept->initTag(nextConTag); concept->setOperatorCode(CCIMPLALL); concept->setRole(invRole); CSortedNegLinker* newTriggerOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newTriggerOpCon->init(destConcept,false); concept->setOperandList(newTriggerOpCon); concept->incOperandCount(); mConceptVec->setLocalData(nextConTag,concept); return concept; } CRole* CTriggeredImplicationGCIAbsorberPreProcess::getInverseRole(CRole* role) { CSortedNegLinker* eqInvRoleIt = role->getInverseEquivalentRoleList(); while (eqInvRoleIt) { if (eqInvRoleIt->isNegated()) { return eqInvRoleIt->getData(); } eqInvRoleIt = eqInvRoleIt->getNext(); } CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { if (superRoleIt->isNegated()) { CRole* superRole = superRoleIt->getData(); CSortedNegLinker* superRoleSuperRoleIt = superRole->getIndirectSuperRoleList(); while (superRoleSuperRoleIt) { if (superRoleSuperRoleIt->isNegated() && superRoleSuperRoleIt->getData() == role) { return superRole; } superRoleSuperRoleIt = superRoleSuperRoleIt->getNext(); } } superRoleIt = superRoleIt->getNext(); } // create inverse role CRole* invRole = CConcreteOntologyInverseRoleBuilder::createInverseRole(role,mOnto); ++mStatInvRolesGenerated; return invRole; } CConcept* CTriggeredImplicationGCIAbsorberPreProcess::createEquivalenceAbsorbedTriggeredImplication(CConcept* eqConcept, bool negated) { CConcept* impliedConcept = eqConcept; CConcept* implicationConcept = createImplicationConcept(impliedConcept,false); //if (eqConcept->hasClassName()) { // QString iriClassNameString = CIRIName::getRecentIRIName(eqConcept->getClassNameLinker()); // if (iriClassNameString == QString("http://www.owllink.org/testsuite/galen#LungPathology")) { // bool bug = true; // } //} CSortedNegLinker* opConLinkerIt = eqConcept->getOperandList(); while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); createImplicationAddedToTrigger(implicationConcept,nullptr,opConcept,opNegated); opConLinkerIt = opConLinkerIt->getNext(); } return implicationConcept; } CConcept* CTriggeredImplicationGCIAbsorberPreProcess::createDisjunctionAbsorbedTriggeredImplication(CConcept* orConcept, bool negated) { CConcept* impliedConcept = createImpliedConcept(); CConcept* implicationConcept = createImplicationConcept(impliedConcept,false); bool oneNotTriggered = false; CSortedNegLinker* opConLinkerIt = orConcept->getOperandList(); while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); if (!oneNotTriggered && !opConLinkerIt->hasNext() || !isConceptImplicationTriggerable(opConcept,!(negated^opNegated))) { oneNotTriggered = true; addConceptToImplied(impliedConcept,opConcept,negated^opNegated); } else { createTrigger(implicationConcept,nullptr,opConcept,!(negated^opNegated),nullptr,nullptr); } opConLinkerIt = opConLinkerIt->getNext(); } if (impliedConcept->getOperandCount() >= 1) { impliedConcept->setOperatorCode(CCOR); } else { impliedConcept->setOperatorCode(CCAND); } return implicationConcept; } cint64 CTriggeredImplicationGCIAbsorberPreProcess::createImplicationAddedToTrigger(CConcept* implicationConcept, CConcept* triggerConcept, CConcept* concept, bool negated) { cint64 triggerCount = 0; cint64 maxImpAddTriggerCount = 0; CConcept* maxImpAddTriggerConcept = nullptr; if (!implicationConcept) { implicationConcept = createImplicationConcept(triggerConcept,false); triggerConcept = nullptr; } triggerCount = createTrigger(implicationConcept,triggerConcept,concept,negated,&maxImpAddTriggerCount,&maxImpAddTriggerConcept); if (maxImpAddTriggerConcept) { cint64 opCode = maxImpAddTriggerConcept->getOperatorCode(); if (opCode != CCNONE) { addConceptToImplied(maxImpAddTriggerConcept,implicationConcept,false); } else { addSubClassConcept(maxImpAddTriggerConcept,implicationConcept,false); } } return triggerCount; } cint64 CTriggeredImplicationGCIAbsorberPreProcess::createTrigger(CConcept* implicationConcept, CConcept* triggerConcept, CConcept* concept, bool negated, cint64* impAddTriggerCount, CConcept** impAddTriggerConcept) { cint64 triggerCount = 0; cint64 triggerForAddingImpCount = 0; CConcept* triggerForAddingImpConcept = nullptr; cint64 opCode = concept->getOperatorCode(); cint64 parm = concept->getParameter(); cint64 opCount = concept->getOperandCount(); CRole* role = concept->getRole(); CSortedNegLinker* opConLinker = concept->getOperandList(); if (!negated && (opCode == CCIMPLALL || opCode == CCIMPL || opCode == CCIMPLTRIG)) { // nothing to do } else if (!negated && (opCode == CCATOM || opCode == CCSUB)) { CConcept* locatedConcept = CConceptRoleIndividualLocator::getLocatedConcept(concept,mOnto); //if (concept->hasClassName()) { // QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); // if (iriClassNameString == QString("http://www.owllink.org/testsuite/galen#nonNormal")) { // bool bug = true; // } //} ++triggerForAddingImpCount; ++triggerCount; triggerForAddingImpConcept = locatedConcept; if (implicationConcept) { addImplicationTrigger(implicationConcept,concept,!negated); } else { addSubClassConcept(locatedConcept,triggerConcept,false); } } else if (!negated && (opCode == CCAND || opCode == CCEQ) || negated && (opCode == CCOR)) { // and trigger if (triggerConcept) { return createImplicationAddedToTrigger(implicationConcept,triggerConcept,concept,negated); } CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; cint64 tmpImpAddTriggerCount = 0; CConcept* tmpImpAddTriggerConcept = nullptr; triggerCount += createTrigger(implicationConcept,triggerConcept,opConcept,opNegated,&tmpImpAddTriggerCount,&tmpImpAddTriggerConcept); if (triggerForAddingImpConcept == nullptr || tmpImpAddTriggerCount > triggerForAddingImpCount) { triggerForAddingImpCount = tmpImpAddTriggerCount; triggerForAddingImpConcept = tmpImpAddTriggerConcept; } opConLinkerIt = opConLinkerIt->getNext(); } } else { CConcept* conTriggerConcept = mConceptTriggerHash.value(QPair(concept,negated)); if (implicationConcept && conTriggerConcept) { addImplicationTrigger(implicationConcept,conTriggerConcept,true); triggerForAddingImpCount += mTriggerCountHash.value(conTriggerConcept,0); triggerCount += triggerForAddingImpCount; triggerForAddingImpConcept = conTriggerConcept; } else { if (implicationConcept) { triggerConcept = createImplicationTriggerConcept(nullptr,false); addImplicationTrigger(implicationConcept,triggerConcept,true); mConceptTriggerHash.insert(QPair(concept,negated),triggerConcept); implicationConcept = nullptr; } if (!negated && (opCode == CCNOMINAL)) { CIndividual* individual = concept->getNominalIndividual(); CIndividual* locatedIndividual = CConceptRoleIndividualLocator::getLocatedIndividual(individual,mOnto); triggerCount += 2; CConceptAssertionLinker* assLinker = CObjectAllocator< CConceptAssertionLinker >::allocateAndConstruct(mMemMan); assLinker->initNegLinker(triggerConcept,false); locatedIndividual->addAssertionConceptLinker(assLinker); } else if (!negated && (opCode == CCOR) || negated && (opCode == CCAND || opCode == CCEQ)) { // or trigger cint64 minTriggerCount = 0; CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; cint64 tmpTriggerCount = 0; tmpTriggerCount = createTrigger(implicationConcept,triggerConcept,opConcept,opNegated,nullptr,nullptr); if (minTriggerCount == 0 || tmpTriggerCount > 0 && tmpTriggerCount < minTriggerCount) { minTriggerCount = tmpTriggerCount; } opConLinkerIt = opConLinkerIt->getNext(); } triggerCount += minTriggerCount; } else if (!negated && (opCode == CCSOME || opCode == CCSELF) || negated && (opCode == CCALL)) { if (opConLinker) { CConcept* nextLevelTrigger = createTriggerPropagationConcept(triggerConcept,role); CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; triggerCount += createTrigger(implicationConcept,nextLevelTrigger,opConcept,opNegated,nullptr,nullptr); opConLinkerIt = opConLinkerIt->getNext(); } } else { CRole* locatedRole = CConceptRoleIndividualLocator::getLocatedRole(role,mOnto); addRoleDomainConcept(locatedRole,triggerConcept,false); } // add one for role triggerCount += 1; } else if (!negated && (opCode == CCVALUE)) { CConcept* nextLevelTrigger = createTriggerPropagationConcept(triggerConcept,role); CIndividual* individual = concept->getNominalIndividual(); CIndividual* locatedIndividual = CConceptRoleIndividualLocator::getLocatedIndividual(individual,mOnto); triggerCount += 2; CConceptAssertionLinker* assLinker = CObjectAllocator< CConceptAssertionLinker >::allocateAndConstruct(mMemMan); assLinker->initNegLinker(nextLevelTrigger,false); locatedIndividual->addAssertionConceptLinker(assLinker); // add one for role triggerCount += 1; } else if (!negated && (opCode == CCATLEAST && parm == 1) || negated && (opCode == CCATMOST && parm == 2)) { if (opConLinker) { CConcept* nextLevelTrigger = createTriggerPropagationConcept(triggerConcept,role); CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); triggerCount += createTrigger(implicationConcept,nextLevelTrigger,opConcept,opNegated,nullptr,nullptr); opConLinkerIt = opConLinkerIt->getNext(); } } else { CRole* locatedRole = CConceptRoleIndividualLocator::getLocatedRole(role,mOnto); addRoleDomainConcept(locatedRole,triggerConcept,false); } triggerCount += 1; } mTriggerCountHash.insert(triggerConcept,triggerCount); triggerForAddingImpConcept = triggerConcept; triggerForAddingImpCount = triggerCount; } } if (impAddTriggerConcept && impAddTriggerCount) { if (*impAddTriggerCount < triggerForAddingImpCount) { *impAddTriggerCount = triggerForAddingImpCount; *impAddTriggerConcept = triggerForAddingImpConcept; } } return triggerCount; } bool CTriggeredImplicationGCIAbsorberPreProcess::isDisjunctionConceptSimpleTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated) { cint64 notAbsorbableCount = 0; cint64 absorbableCount = 0; CSortedNegLinker* opConLinkerIt = orConcept->getOperandList(); while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); if (isConceptSimpleImplicationTriggerable(opConcept,!opNegated^negated)) { absorbableCount++; } else { notAbsorbableCount++; } opConLinkerIt = opConLinkerIt->getNext(); } if (notAbsorbableCount <= 1) { return true; } return false; } bool CTriggeredImplicationGCIAbsorberPreProcess::isDisjunctionConceptTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated) { cint64 notAbsorbableCount = 0; cint64 absorbableCount = 0; CSortedNegLinker* opConLinkerIt = orConcept->getOperandList(); while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); if (isConceptImplicationTriggerable(opConcept,!opNegated^negated)) { absorbableCount++; } else { notAbsorbableCount++; } opConLinkerIt = opConLinkerIt->getNext(); } if (notAbsorbableCount <= 1) { return true; } return false; } bool CTriggeredImplicationGCIAbsorberPreProcess::isEquivalenceConceptTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated, cint64* notAbsorbableOperandsCount) { cint64 notAbsorbableCount = 0; cint64 opCode = orConcept->getOperatorCode(); if (!negated && opCode == CCEQ) { CSortedNegLinker* opConLinkerIt = orConcept->getOperandList(); while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); if (!isConceptImplicationTriggerable(opConcept,opNegated)) { return false; } opConLinkerIt = opConLinkerIt->getNext(); } } return true; } bool CTriggeredImplicationGCIAbsorberPreProcess::isGCIConceptTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated, cint64* notAbsorbableOperandsCount) { bool absorbable = false; cint64 notAbsorbableCount = 0; cint64 opCode = orConcept->getOperatorCode(); if (!negated && opCode == CCOR || negated && opCode == CCAND) { CSortedNegLinker* opConLinkerIt = orConcept->getOperandList(); while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); if (isConceptImplicationTriggerable(opConcept,!opNegated)) { absorbable = true; } else { notAbsorbableCount++; } opConLinkerIt = opConLinkerIt->getNext(); } } if (notAbsorbableOperandsCount) { *notAbsorbableOperandsCount = notAbsorbableCount; } return absorbable; } bool CTriggeredImplicationGCIAbsorberPreProcess::isConceptSimpleImplicationTriggerable(CConcept* concept, bool negated) { cint64 opCode = concept->getOperatorCode(); cint64 parm = concept->getParameter(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opConLinker = concept->getOperandList(); if (!negated && (opCode == CCSUB || opCode == CCATOM)) { return true; } else if (!negated && (opCode == CCAND || opCode == CCEQ) || negated && opCode == CCOR) { if (opCount >= 1) { bool allOpsTriggerable = true; CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt && allOpsTriggerable) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; allOpsTriggerable &= isConceptSimpleImplicationTriggerable(opConcept,opNegated); opConLinkerIt = opConLinkerIt->getNext(); } return allOpsTriggerable; } } else { CConcept* conTriggerConcept = mConceptTriggerHash.value(QPair(concept,negated)); if (conTriggerConcept) { return true; } } return false; } bool CTriggeredImplicationGCIAbsorberPreProcess::isConceptImplicationTriggerable(CConcept* concept, bool negated) { cint64 opCode = concept->getOperatorCode(); cint64 parm = concept->getParameter(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opConLinker = concept->getOperandList(); if (!negated && (opCode == CCSUB || opCode == CCATOM)) { return true; } else if (!negated && (opCode == CCNOMINAL)) { return true; } else if (!negated && (opCode == CCVALUE)) { return true; } else if (!negated && (opCode == CCSOME || opCode == CCSELF) || negated && (opCode == CCALL)) { if (!opConLinker) { return true; } else { bool allOpsTriggerable = true; CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt && allOpsTriggerable) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; allOpsTriggerable &= isConceptImplicationTriggerable(opConcept,opNegated); opConLinkerIt = opConLinkerIt->getNext(); } return allOpsTriggerable; } } else if (!negated && (opCode == CCATLEAST && parm == 1) || negated && (opCode == CCATMOST && parm == 0)) { if (!opConLinker) { return true; } else { bool allOpsTriggerable = true; CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt && allOpsTriggerable) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); allOpsTriggerable &= isConceptImplicationTriggerable(opConcept,opNegated); opConLinkerIt = opConLinkerIt->getNext(); } return allOpsTriggerable; } } else if (opCode == CCAND || opCode == CCEQ || opCode == CCOR) { if (opCount >= 1) { bool allOpsTriggerable = true; CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt && allOpsTriggerable) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; allOpsTriggerable &= isConceptImplicationTriggerable(opConcept,opNegated); opConLinkerIt = opConLinkerIt->getNext(); } return allOpsTriggerable; } } return false; } bool CTriggeredImplicationGCIAbsorberPreProcess::absorbGCIConceptsToTriggeredImplications(CConcept* orConcept, bool negated) { cint64 opCode = orConcept->getOperatorCode(); if (!negated && opCode == CCOR || negated && opCode == CCAND) { QList< QPair > candList; if (addAbsorbableDisjunctCandidates(orConcept,negated,candList)) { if (candList.count() >= 1) { QList< QPair > absorbList(splitAbsorbableDisjuncts(candList)); if (!absorbList.isEmpty()) { createGCIAbsorbedTriggeredImplication(orConcept,negated,absorbList,candList); return true; } } } } return false; } bool CTriggeredImplicationGCIAbsorberPreProcess::isConceptPartialImplicationTriggerable(CConcept* concept, bool negated) { cint64 opCode = concept->getOperatorCode(); cint64 parm = concept->getParameter(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opConLinker = concept->getOperandList(); if (!negated && (opCode == CCSUB || opCode == CCATOM)) { return true; } else if (!negated && (opCode == CCNOMINAL)) { return true; } else if (!negated && (opCode == CCVALUE)) { return true; } else if (!negated && (opCode == CCSOME || opCode == CCSELF) || negated && (opCode == CCALL)) { return true; } else if (!negated && (opCode == CCATLEAST && parm >= 1) || negated && (opCode == CCATMOST && parm >= 0)) { return true; } else if (!negated && (opCode == CCAND || opCode == CCEQ) || negated && opCode == CCOR) { // OR, at least one operand has to be triggerable if (opCount >= 1) { CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; if (isConceptPartialImplicationTriggerable(opConcept,opNegated)) { return true; } opConLinkerIt = opConLinkerIt->getNext(); } } } else if (negated && (opCode == CCAND || opCode == CCEQ) || !negated && opCode == CCOR) { // OR, all operands have to be triggerable if (opCount >= 1) { bool allOpsTriggerable = true; CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt && allOpsTriggerable) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; allOpsTriggerable &= isConceptPartialImplicationTriggerable(opConcept,opNegated); opConLinkerIt = opConLinkerIt->getNext(); } return allOpsTriggerable; } } return false; } bool CTriggeredImplicationGCIAbsorberPreProcess::absorbPartialGCIConceptsToTriggeredImplications(CConcept* orConcept, bool negated) { cint64 opCode = orConcept->getOperatorCode(); if (!negated && opCode == CCOR || negated && opCode == CCAND) { QList< QPair > candList; if (addAbsorbableDisjunctCandidates(orConcept,negated,candList)) { if (candList.count() >= 1) { QList< QPair > absorbList(getPartialAbsorbableDisjuncts(candList)); if (!absorbList.isEmpty()) { createGCIPartialAbsorbedTriggeredImplication(orConcept,negated,absorbList); return true; } } } } return false; } CConcept* CTriggeredImplicationGCIAbsorberPreProcess::createGCIPartialAbsorbedTriggeredImplication(CConcept* orConcept, bool negated, const QList< QPair >& absorbList) { CConcept* implicationConcept = createImplicationConcept(orConcept,negated); for (QList< QPair >::const_iterator it = absorbList.constBegin(), itEnd = absorbList.constEnd(); it != itEnd; ++it) { QPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; createPartialImplicationAddedToTrigger(implicationConcept,nullptr,concept,!negated); } return implicationConcept; } CConcept* CTriggeredImplicationGCIAbsorberPreProcess::createPartialExtendedGCIAbsorbedTriggeredImplication(CConcept* implicationConcept, const QList< QPair >& absorbList) { cint64 maxImpAddTriggerCount = 0; CConcept* maxImpAddTriggerConcept = nullptr; for (QList< QPair >::const_iterator it = absorbList.constBegin(), itEnd = absorbList.constEnd(); it != itEnd; ++it) { QPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; createPartialTrigger(implicationConcept,nullptr,concept,!negated,&maxImpAddTriggerCount,&maxImpAddTriggerConcept); } return implicationConcept; } CConcept* CTriggeredImplicationGCIAbsorberPreProcess::createGCIAbsorbedTriggeredImplication(CConcept* orConcept, bool negated, QList< QPair >& absorbList, QList< QPair >& candList) { CConcept* impliedConcept = nullptr; bool impliedNegation = false; QList< QPair > partialAbsorbableList; if (candList.isEmpty()) { //candList.append(mBottomConcept); candList.append(absorbList.takeFirst()); } if (candList.count() > 1) { impliedConcept = createImpliedConcept(); for (QList< QPair >::const_iterator it = candList.constBegin(), itEnd = candList.constEnd(); it != itEnd; ++it) { QPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; addConceptToImplied(impliedConcept,concept,negated); } impliedConcept->setOperatorCode(CCOR); if (mConfPartialGCIAbsorption) { partialAbsorbableList = getPartialAbsorbableDisjuncts(candList); } } else { QPair conNegPair(candList.takeFirst()); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; impliedNegation = negated; impliedConcept = concept; } CConcept* implicationConcept = createImplicationConcept(impliedConcept,impliedNegation); if (!partialAbsorbableList.isEmpty()) { createPartialExtendedGCIAbsorbedTriggeredImplication(implicationConcept,partialAbsorbableList); ++mStatGCIAbsorptionPartialExtended; } for (QList< QPair >::const_iterator it = absorbList.constBegin(), itEnd = absorbList.constEnd(); it != itEnd; ++it) { QPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; createImplicationAddedToTrigger(implicationConcept,nullptr,concept,!negated); } return implicationConcept; } cint64 CTriggeredImplicationGCIAbsorberPreProcess::createPartialImplicationAddedToTrigger(CConcept* implicationConcept, CConcept* triggerConcept, CConcept* concept, bool negated) { cint64 triggerCount = 0; cint64 maxImpAddTriggerCount = 0; CConcept* maxImpAddTriggerConcept = nullptr; if (!implicationConcept) { implicationConcept = createImplicationConcept(triggerConcept,false); triggerConcept = nullptr; } triggerCount = createPartialTrigger(implicationConcept,triggerConcept,concept,negated,&maxImpAddTriggerCount,&maxImpAddTriggerConcept); if (maxImpAddTriggerConcept) { cint64 opCode = maxImpAddTriggerConcept->getOperatorCode(); if (opCode != CCNONE) { addConceptToImplied(maxImpAddTriggerConcept,implicationConcept,false); } else { addSubClassConcept(maxImpAddTriggerConcept,implicationConcept,false); } } return triggerCount; } cint64 CTriggeredImplicationGCIAbsorberPreProcess::createPartialTrigger(CConcept* implicationConcept, CConcept* triggerConcept, CConcept* concept, bool negated, cint64* impAddTriggerCount, CConcept** impAddTriggerConcept) { cint64 triggerCount = 0; cint64 triggerForAddingImpCount = 0; CConcept* triggerForAddingImpConcept = nullptr; cint64 opCode = concept->getOperatorCode(); cint64 parm = concept->getParameter(); cint64 opCount = concept->getOperandCount(); CRole* role = concept->getRole(); CSortedNegLinker* opConLinker = concept->getOperandList(); if (!negated && (opCode == CCIMPLALL || opCode == CCIMPL || opCode == CCIMPLTRIG)) { // nothing to do } else if (!negated && (opCode == CCATOM || opCode == CCSUB)) { CConcept* locatedConcept = CConceptRoleIndividualLocator::getLocatedConcept(concept,mOnto); //if (concept->hasClassName()) { // QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); // if (iriClassNameString == QString("http://www.owllink.org/testsuite/galen#nonNormal")) { // bool bug = true; // } //} ++triggerForAddingImpCount; ++triggerCount; triggerForAddingImpConcept = locatedConcept; if (implicationConcept) { addImplicationTrigger(implicationConcept,concept,!negated); } else { addSubClassConcept(locatedConcept,triggerConcept,false); } } else if (!negated && (opCode == CCAND || opCode == CCEQ) || negated && (opCode == CCOR)) { // and trigger if (triggerConcept) { return createPartialImplicationAddedToTrigger(implicationConcept,triggerConcept,concept,negated); } CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; if (isConceptPartialImplicationTriggerable(opConcept,opNegated)) { cint64 tmpImpAddTriggerCount = 0; CConcept* tmpImpAddTriggerConcept = nullptr; triggerCount += createPartialTrigger(implicationConcept,triggerConcept,opConcept,opNegated,&tmpImpAddTriggerCount,&tmpImpAddTriggerConcept); if (triggerForAddingImpConcept == nullptr || tmpImpAddTriggerCount > triggerForAddingImpCount) { triggerForAddingImpCount = tmpImpAddTriggerCount; triggerForAddingImpConcept = tmpImpAddTriggerConcept; } } opConLinkerIt = opConLinkerIt->getNext(); } } else { CConcept* conTriggerConcept = mConceptTriggerHash.value(QPair(concept,negated)); if (implicationConcept && conTriggerConcept) { addImplicationTrigger(implicationConcept,conTriggerConcept,true); triggerForAddingImpCount += mTriggerCountHash.value(conTriggerConcept,0); triggerCount += triggerForAddingImpCount; triggerForAddingImpConcept = conTriggerConcept; } else { if (implicationConcept) { triggerConcept = createImplicationTriggerConcept(nullptr,false); addImplicationTrigger(implicationConcept,triggerConcept,true); mConceptTriggerHash.insert(QPair(concept,negated),triggerConcept); implicationConcept = nullptr; } if (!negated && (opCode == CCNOMINAL)) { CIndividual* individual = concept->getNominalIndividual(); CIndividual* locatedIndividual = CConceptRoleIndividualLocator::getLocatedIndividual(individual,mOnto); triggerCount += 2; CConceptAssertionLinker* assLinker = CObjectAllocator< CConceptAssertionLinker >::allocateAndConstruct(mMemMan); assLinker->initNegLinker(triggerConcept,false); locatedIndividual->addAssertionConceptLinker(assLinker); } else if (!negated && (opCode == CCOR) || negated && (opCode == CCAND || opCode == CCEQ)) { // or trigger cint64 minTriggerCount = 0; CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; cint64 tmpTriggerCount = 0; tmpTriggerCount = createPartialTrigger(implicationConcept,triggerConcept,opConcept,opNegated,nullptr,nullptr); if (minTriggerCount == 0 || tmpTriggerCount > 0 && tmpTriggerCount < minTriggerCount) { minTriggerCount = tmpTriggerCount; } opConLinkerIt = opConLinkerIt->getNext(); } triggerCount += minTriggerCount; } else if (!negated && (opCode == CCSOME || opCode == CCSELF) || negated && (opCode == CCALL)) { bool absorbOperands = true; if (opConLinker) { CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; if (!isConceptPartialImplicationTriggerable(opConcept,opNegated)) { absorbOperands = false; } opConLinkerIt = opConLinkerIt->getNext(); } } else { absorbOperands = false; } if (absorbOperands) { CConcept* nextLevelTrigger = createTriggerPropagationConcept(triggerConcept,role); CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; triggerCount += createPartialTrigger(implicationConcept,nextLevelTrigger,opConcept,opNegated,nullptr,nullptr); opConLinkerIt = opConLinkerIt->getNext(); } } else { CRole* locatedRole = CConceptRoleIndividualLocator::getLocatedRole(role,mOnto); addRoleDomainConcept(locatedRole,triggerConcept,false); } // add one for role triggerCount += 1; } else if (!negated && (opCode == CCVALUE)) { CConcept* nextLevelTrigger = createTriggerPropagationConcept(triggerConcept,role); CIndividual* individual = concept->getNominalIndividual(); CIndividual* locatedIndividual = CConceptRoleIndividualLocator::getLocatedIndividual(individual,mOnto); triggerCount += 2; CConceptAssertionLinker* assLinker = CObjectAllocator< CConceptAssertionLinker >::allocateAndConstruct(mMemMan); assLinker->initNegLinker(nextLevelTrigger,false); locatedIndividual->addAssertionConceptLinker(assLinker); // add one for role triggerCount += 1; } else if (!negated && (opCode == CCATLEAST && parm >= 1) || negated && (opCode == CCATMOST && parm >= 2)) { bool absorbOperands = true; if (opConLinker) { CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); if (!isConceptPartialImplicationTriggerable(opConcept,opNegated)) { absorbOperands = false; } opConLinkerIt = opConLinkerIt->getNext(); } } else { absorbOperands = false; } if (absorbOperands) { CConcept* nextLevelTrigger = createTriggerPropagationConcept(triggerConcept,role); CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); triggerCount += createPartialTrigger(implicationConcept,nextLevelTrigger,opConcept,opNegated,nullptr,nullptr); opConLinkerIt = opConLinkerIt->getNext(); } } else { CRole* locatedRole = CConceptRoleIndividualLocator::getLocatedRole(role,mOnto); addRoleDomainConcept(locatedRole,triggerConcept,false); } triggerCount += 1; } mTriggerCountHash.insert(triggerConcept,triggerCount); triggerForAddingImpConcept = triggerConcept; triggerForAddingImpCount = triggerCount; } } if (impAddTriggerConcept && impAddTriggerCount) { if (*impAddTriggerCount < triggerForAddingImpCount) { *impAddTriggerCount = triggerForAddingImpCount; *impAddTriggerConcept = triggerForAddingImpConcept; } } return triggerCount; } bool CTriggeredImplicationGCIAbsorberPreProcess::addAbsorbableDisjunctCandidates(CConcept* orConcept, bool negated, QList< QPair >& list) { bool absorbableDisjuncts = false; cint64 opCode = orConcept->getOperatorCode(); if (!negated && opCode == CCOR || negated && opCode == CCAND) { CSortedNegLinker* opConLinkerIt = orConcept->getOperandList(); while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; cint64 opOpCode = opConcept->getOperatorCode(); if (!opNegated && opOpCode == CCOR || opNegated && opOpCode == CCAND) { absorbableDisjuncts |= addAbsorbableDisjunctCandidates(opConcept,opNegated,list); } else { list.append(QPair(opConcept,opNegated)); absorbableDisjuncts = true; } opConLinkerIt = opConLinkerIt->getNext(); } } return absorbableDisjuncts; } QList< QPair > CTriggeredImplicationGCIAbsorberPreProcess::splitAbsorbableDisjuncts(QList< QPair >& list) { QList< QPair > absorbableList; cint64 count = list.count(); for (cint64 nr = 0; nr < count; ++nr) { QPair conNegPair(list.takeFirst()); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; if (isConceptImplicationTriggerable(concept,!negated)) { absorbableList.append(conNegPair); } else { list.append(conNegPair); } } return absorbableList; } QList< QPair > CTriggeredImplicationGCIAbsorberPreProcess::getPartialAbsorbableDisjuncts(QList< QPair >& list) { QList< QPair > absorbableList; cint64 count = list.count(); for (QList< QPair >::const_iterator it = list.constBegin(), itEnd = list.constEnd(); it != itEnd; ++it) { QPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; if (isConceptPartialImplicationTriggerable(concept,!negated)) { absorbableList.append(conNegPair); } } return absorbableList; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreprocessing.h0000644000175000017500000000341212520551226025264 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CPREPROCESSING_H #define KONCLUDE_REASONER_PREPROCESS_CPREPROCESSING_H // Libraries includes // Namespace includes #include "PreprocessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Preprocess { /*! * * \class CPreprocessing * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPreprocessing { // public methods public: //! Constructor CPreprocessing(); bool isPreprocessed(); CPreprocessing* setPreprocessed(bool preprocessed); // protected methods protected: // protected variables protected: bool mPreprocessed; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CPREPROCESSING_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CExtractPropagationIntoCreationDirectionPreProcess.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CExtractPropagationIntoCreationDirectionPr0000644000175000017500000001017212520551222032510 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExtractPropagationIntoCreationDirectionPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CExtractPropagationIntoCreationDirectionPreProcess::CExtractPropagationIntoCreationDirectionPreProcess() { } CExtractPropagationIntoCreationDirectionPreProcess::~CExtractPropagationIntoCreationDirectionPreProcess() { } CConcreteOntology* CExtractPropagationIntoCreationDirectionPreProcess::preprocess(CConcreteOntology* ontology, CPreProcessContext* context) { bool skipForELOntologies = CConfigDataReader::readConfigBoolean(context->getConfiguration(),"Konclude.Calculation.Preprocessing.ExtractPropagationIntoCreationDirection.SkipForELFragment",true); bool nonELConstructsUsed = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags()->isNonELConstructUsed(); if (nonELConstructsUsed || !skipForELOntologies) { CMBox* mBox = ontology->getDataBoxes()->getMBox(); CTBox* tBox = ontology->getDataBoxes()->getTBox(); CRBox* rBox = ontology->getDataBoxes()->getRBox(); CABox* aBox = ontology->getDataBoxes()->getABox(); CConceptVector* conceptVec = tBox->getConceptVector(); cint64 conceptCount = tBox->getConceptCount(); CRoleVector* roleVec = rBox->getRoleVector(); cint64 markedPropagationIntoCreationDirectionConceptCount = 0; QHash creationRoleHash; for (cint64 conIdx = 0; conIdx < conceptCount; ++conIdx) { CConcept* concept = conceptVec->getData(conIdx); if (concept) { CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_POSSIBLE_ROLE_CREATION_TYPE)) { CRole* role = concept->getRole(); if (!creationRoleHash.contains(role)) { for (CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); superRoleIt; superRoleIt = superRoleIt->getNext()) { bool superRoleNegation = superRoleIt->isNegated(); CRole* superRole = superRoleIt->getData(); if (!superRoleNegation) { bool& roleInserted = creationRoleHash[superRole]; if (!roleInserted) { roleInserted = true; } } } } } } } for (cint64 conIdx = 0; conIdx < conceptCount; ++conIdx) { CConcept* concept = conceptVec->getData(conIdx); if (concept) { CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_AQALL_TYPE | CConceptOperator::CCFS_POSSIBLE_ROLE_CREATION_TYPE)) { CRole* role = concept->getRole(); if (creationRoleHash.contains(role)) { CConceptProcessData* conProData = (CConceptProcessData*)concept->getConceptData(); if (conProData) { ++markedPropagationIntoCreationDirectionConceptCount; conProData->setPropagationIntoCreationDirection(true); } } } } } LOG(INFO,"::Konclude::Reasoner::Preprocess::PropagationIntoCreationDirectionExtractor",logTr("Marked %1 concepts with possible propagation into creation direction.").arg(markedPropagationIntoCreationDirectionConceptCount),this); } return ontology; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/COntologyPreprocessingItem.cpp0000644000175000017500000000552312520551224030174 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyPreprocessingItem.h" namespace Konclude { namespace Reasoner { namespace Preprocess { COntologyPreprocessingItem::COntologyPreprocessingItem() { } COntologyPreprocessingItem* COntologyPreprocessingItem::initPreprocessingItem(CConcreteOntology* ontology, CConfigurationBase* config) { mOntology = ontology; mConfig = config; mPreprocessingFinishedFlag = false; return this; } COntologyPreprocessingItem* COntologyPreprocessingItem::addProcessingRequirement(COntologyProcessingRequirement* ontoRequirement) { ontoRequirement->submitRequirementUpdate(COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSUNSUPPORTED); return this; } bool COntologyPreprocessingItem::isPreprocessingFinished() { return mPreprocessingFinishedFlag; } COntologyPreprocessingItem* COntologyPreprocessingItem::setPreprocessingFinished(bool finished) { mPreprocessingFinishedFlag = finished; return this; } COntologyPreprocessingItem* COntologyPreprocessingItem::doPreprocessingFinishedCallback(bool doCallbacks) { if (doCallbacks) { mCallbackExecuter.doCallback(); } return this; } COntologyPreprocessingItem* COntologyPreprocessingItem::addPreprocessingFinishedCallback(CCallbackData* callback) { mCallbackExecuter.addCallbackData(callback); return this; } CConcreteOntology* COntologyPreprocessingItem::getOntology() { return mOntology; } CConfigurationBase* COntologyPreprocessingItem::getConfiguration() { return mConfig; } QSet* COntologyPreprocessingItem::getPreprocessingTestingItemSet() { return &mTestItemSet; } cint64 COntologyPreprocessingItem::getCurrentPreprocessingTestingCount() { return mTestItemSet.count(); } bool COntologyPreprocessingItem::hasCurrentPreprocessingTestingCount() { return mTestItemSet.count() > 0; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreProcessContextBase.h0000644000175000017500000000407412520551226026673 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CPREPROCESSCONTEXTBASE_H #define KONCLUDE_REASONER_PREPROCESS_CPREPROCESSCONTEXTBASE_H // Libraries includes // Namespace includes #include "CPreProcessContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Preprocess { /*! * * \class CPreProcessContextBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPreProcessContextBase : public CPreProcessContext { // public methods public: //! Constructor CPreProcessContextBase(CConcreteOntology *ontology, CConfiguration *config); //! Destructor virtual ~CPreProcessContextBase(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); virtual CConfiguration* getConfiguration(); virtual CConcreteOntology* getOntology(); // protected methods protected: // private methods private: CConcreteOntology* mOntology; CConfiguration* mConfig; CMemoryAllocationManager* mMemMan; // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CPREPROCESSCONTEXTBASE_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CSubroleTransformationPreProcess.cpp0000644000175000017500000004400112603302214031334 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSubroleTransformationPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CSubroleTransformationPreProcess::CSubroleTransformationPreProcess() { } CSubroleTransformationPreProcess::~CSubroleTransformationPreProcess() { } CConcreteOntology *CSubroleTransformationPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { if (ontology) { mTBox = ontology->getDataBoxes()->getTBox(); mABox = ontology->getDataBoxes()->getABox(); mRBox = ontology->getDataBoxes()->getRBox(); mMBox = ontology->getDataBoxes()->getMBox(); mRolesVector = mRBox->getRoleVector(); mConceptVector = mTBox->getConceptVector(); mIndiVec = mABox->getIndividualVector(); mMemMan = ontology->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); mOntology = ontology; mTopObjectRole = nullptr; mBottomObjectRole = nullptr; mTopDataRole = nullptr; mBottomDataRole = nullptr; QSet mProcessedRoleSet; QSet locRoleTagSet; QList subRoleUpdateTagList; COntologyBuildConstructFlags* construcFlags = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags(); bool topObjectRuleUsed = construcFlags->isTopObjectRoleUsed(); bool bottomObjectRuleUsed = construcFlags->isBottomObjectRoleUsed(); if (topObjectRuleUsed) { mRoleChainVector = mRBox->getRoleChainVector(); makeUniversalSuperRole(); } if (bottomObjectRuleUsed) { makeBottomObjectRoleDomain(); } bool topDataRuleUsed = construcFlags->isTopDataRoleUsed(); bool bottomDataRuleUsed = construcFlags->isBottomDataRoleUsed(); if (topDataRuleUsed) { makeDataSuperRole(); } if (bottomDataRuleUsed) { makeBottomDataRoleDomain(); } qint64 itemCounts = mRolesVector->getItemCount(); for (qint64 i = 0; i < itemCounts; ++i) { CRole *role = mRolesVector->getLocalData(i); if (role) { locRoleTagSet.insert(role->getRoleTag()); subRoleUpdateTagList.append(role->getRoleTag()); if (!mProcessedRoleSet.contains(role)) { // update all direct super roles QSet< QPair > inEqRoleSet; collectInverseEquivalentRoles(role,false,&inEqRoleSet); for (QSet< QPair >::const_iterator it = inEqRoleSet.constBegin(), itEnd = inEqRoleSet.constEnd(); it != itEnd; ++it) { QPair roleNegPair(*it); CRole* upRole = roleNegPair.first; bool upNeg = roleNegPair.second; if (!mProcessedRoleSet.contains(upRole)) { mProcessedRoleSet.insert(upRole); updateDirectSuperRoles(upRole,upNeg,&inEqRoleSet); } } } } } QHash roleTagSubRoleTagHash; for (qint64 i = 0; i < itemCounts; ++i) { CRole *role = mRolesVector->getData(i); if (role) { cint64 roleTag = role->getRoleTag(); CSortedNegLinker* superRoleLinkerIt = role->getSuperRoleList(); while (superRoleLinkerIt) { CRole* superRole = superRoleLinkerIt->getData(); cint64 superRoleTag = superRole->getRoleTag(); roleTagSubRoleTagHash.insertMulti(superRoleTag,roleTag); superRoleLinkerIt = superRoleLinkerIt->getNext(); } } } FOREACHIT (cint64 locRoleTag, locRoleTagSet) { if (!locRoleTagSet.contains(locRoleTag)) { locRoleTagSet.insert(locRoleTag); subRoleUpdateTagList.append(locRoleTag); } FOREACHIT (cint64 subRoleTag, roleTagSubRoleTagHash.values(locRoleTag)) { if (!locRoleTagSet.contains(subRoleTag)) { locRoleTagSet.insert(subRoleTag); subRoleUpdateTagList.append(subRoleTag); } } } while (!subRoleUpdateTagList.isEmpty()) { cint64 updateTag = subRoleUpdateTagList.takeFirst(); CRole *role = mRolesVector->getData(updateTag); role = getLocalizedRole(role); if (role) { // update indirect super role list QSet< QPair > singleSuperRoleAddSet; singleSuperRoleAddSet.insert(QPair(role,false)); CSortedNegLinker *superRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); superRoleLinker->init(role,false); role->setIndirectSuperRoleLinker(superRoleLinker); addIndirectSuperRoles(false,role,role->getSuperRoleList(),&singleSuperRoleAddSet); FOREACHIT (cint64 subRoleTag, roleTagSubRoleTagHash.values(updateTag)) { if (!locRoleTagSet.contains(subRoleTag)) { locRoleTagSet.insert(subRoleTag); subRoleUpdateTagList.append(subRoleTag); } } } } for (qint64 i = 0; i < itemCounts; ++i) { CRole *role = mRolesVector->getLocalData(i); if (role) { if (role->getRoleChainSuperSharingLinker() != nullptr) { role->setRoleComplexity(true); // all super roles must be complex, too CSortedNegLinker* superRoleLinkerIt = role->getIndirectSuperRoleList(); while (superRoleLinkerIt) { CRole* superRole = superRoleLinkerIt->getData(); superRole = getLocalizedRole(superRole); superRole->setRoleComplexity(true); superRoleLinkerIt = superRoleLinkerIt->getNext(); } } } } if (topObjectRuleUsed && mABox->getIndividualCount() > 0 && hasUniversalRolePropagation()) { makeUniversalConnectionIndividual(); } } return ontology; } void CSubroleTransformationPreProcess::makeUniversalConnectionIndividual() { cint64 univConnIndiID = 0; CIndividual* universalConnIndi = nullptr; CConcept* universalConnNominalValueCon = nullptr; CConcept* universalConnNominalCon = nullptr; if (!mABox->hasUniversalConnectionIndividual()) { univConnIndiID = mIndiVec->getItemCount(); mABox->setUniversalConnectionIndividualID(univConnIndiID); mABox->setHasUniversalConnectionIndividual(true); universalConnIndi = CObjectAllocator< CIndividual >::allocateAndConstruct(mMemMan); universalConnIndi->initIndividual(univConnIndiID); mIndiVec->setData(univConnIndiID,universalConnIndi); cint64 valueConTag = mConceptVector->getItemCount(); universalConnNominalValueCon = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); universalConnNominalValueCon->initConcept(); universalConnNominalValueCon->setConceptTag(valueConTag); universalConnNominalValueCon->setOperatorCode(CCVALUE); universalConnNominalValueCon->setNominalIndividual(universalConnIndi); universalConnNominalValueCon->setRole(mRolesVector->getData(1)); mConceptVector->setData(valueConTag,universalConnNominalValueCon); mTBox->setUniversalConnectionNominalValueConcept(universalConnNominalValueCon); cint64 nominalConTag = mConceptVector->getItemCount(); universalConnNominalCon = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); universalConnNominalCon->initConcept(); universalConnNominalCon->setConceptTag(nominalConTag); universalConnNominalCon->setOperatorCode(CCNOMINAL); universalConnNominalCon->setNominalIndividual(universalConnIndi); mConceptVector->setData(nominalConTag,universalConnNominalCon); universalConnIndi->setIndividualNominalConcept(universalConnNominalCon); } } void CSubroleTransformationPreProcess::makeBottomObjectRoleDomain() { mBottomObjectRole = mRolesVector->getData(mRBox->getBottomObjectRoleIndex()); makeBottomRoleDomain(mBottomObjectRole); } void CSubroleTransformationPreProcess::makeBottomDataRoleDomain() { mBottomDataRole = mRolesVector->getData(mRBox->getBottomDataRoleIndex()); makeBottomRoleDomain(mBottomDataRole); } void CSubroleTransformationPreProcess::makeBottomRoleDomain(CRole* role) { bool foundBottom = false; for (CSortedNegLinker* domainConIt = role->getDomainConceptList(); !foundBottom && domainConIt; domainConIt = domainConIt->getNext()) { CConcept* domainConcept = domainConIt->getData(); bool domainConNegation = domainConIt->isNegated(); if (domainConNegation && domainConcept->getOperatorCode() == CCTOP) { foundBottom = true; } else if (!domainConNegation && domainConcept->getOperatorCode() == CCBOTTOM) { foundBottom = true; } } if (!foundBottom) { role = getLocalizedRole(role); CSortedNegLinker* domainConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); domainConLinker->init(mTBox->getTopConcept(),true); role->addDomainConceptLinker(domainConLinker); } } void CSubroleTransformationPreProcess::makeUniversalSuperRole() { mOntology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags()->setComplexRoleUsed(); mTopObjectRole = getLocalizedRole(mRolesVector->getData(mRBox->getTopObjectRoleIndex())); if (!mTopObjectRole->isTransitive()) { mTopObjectRole->setTransitive(true); cint64 roleChainCount = mRoleChainVector->getItemCount(); CRoleChain* roleChain = CObjectAllocator< CRoleChain >::allocateAndConstruct(mMemMan); roleChain->initRoleChain(); CXLinker* roleLinker1 = CObjectAllocator< CXLinker >::allocateAndConstruct(mMemMan); CXLinker* roleLinker2 = CObjectAllocator< CXLinker >::allocateAndConstruct(mMemMan); roleLinker1->initLinker(mTopObjectRole); roleLinker2->initLinker(mTopObjectRole); roleChain->appendRoleChainLinker(roleLinker1); roleChain->appendRoleChainLinker(roleLinker2); roleChain->initTag(roleChainCount); mRoleChainVector->setData(roleChainCount,roleChain); CXLinker* superRoleChainLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(mMemMan); superRoleChainLinker->initLinker(roleChain); mTopObjectRole->addRoleChainSuperSharingLinker(superRoleChainLinker); CXLinker* subRoleChainLinker = CObjectAllocator< CXLinker >::allocateAndConstruct(mMemMan); subRoleChainLinker->initLinker(roleChain); mTopObjectRole->addRoleChainSubSharingLinker(subRoleChainLinker); } if (!mTopObjectRole->isSymmetric()) { mTopObjectRole->setSymmetric(true); CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); roleLinker->init(mTopObjectRole,true); mTopObjectRole->addInverseRoleLinker(roleLinker); } cint64 roleCount = mRolesVector->getItemCount(); for (cint64 roleIdx = 1; roleIdx < roleCount; ++roleIdx) { CRole* role = mRolesVector->getData(roleIdx); if (role && role->isObjectRole() && !role->hasSuperRoleTag(mTopObjectRole->getRoleTag())) { role = getLocalizedRole(role); CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); roleLinker->init(mTopObjectRole,true); mTopObjectRole->addSuperRoleLinker(roleLinker); } } // make reflexive -> add \exists u.SELF to TOP bool topConLocal = false; CConcept* topConcept = mConceptVector->getData(1,&topConLocal); if (!topConLocal) { topConcept = CConceptRoleIndividualLocator::getLocatedConcept(topConcept,mOntology); } bool hasTopExistsUniversalSelf = false; for (CSortedNegLinker* opLinker = topConcept->getOperandList(); !hasTopExistsUniversalSelf && opLinker; opLinker = opLinker->getNext()) { if (!opLinker->isNegated()) { CConcept* opConcept = opLinker->getData(); if (opConcept->getOperatorCode() == CCSELF && opConcept->getRole()->getRoleTag() == mTopObjectRole->getRoleTag()) { hasTopExistsUniversalSelf = true; } } } if (!hasTopExistsUniversalSelf) { CConcept* univSelfCon = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); cint64 conCount = mConceptVector->getItemCount(); univSelfCon->initConcept(); univSelfCon->setConceptTag(conCount); univSelfCon->setRole(mTopObjectRole); univSelfCon->setOperatorCode(CCSELF); mConceptVector->setData(conCount,univSelfCon); CSortedNegLinker* topOpLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); topOpLinker->init(univSelfCon,false); topConcept->addOperandLinker(topOpLinker); topConcept->incOperandCount(1); } } void CSubroleTransformationPreProcess::makeDataSuperRole() { mTopDataRole = getLocalizedRole(mRolesVector->getData(mRBox->getTopDataRoleIndex())); cint64 roleCount = mRolesVector->getItemCount(); for (cint64 roleIdx = 0; roleIdx < roleCount; ++roleIdx) { CRole* role = mRolesVector->getData(roleIdx); if (role && role->isDataRole() && !role->hasSuperRoleTag(mTopDataRole->getRoleTag())) { role = getLocalizedRole(role); CSortedNegLinker* roleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); roleLinker->init(mTopDataRole,true); mTopDataRole->addSuperRoleLinker(roleLinker); } } } CIndividual* CSubroleTransformationPreProcess::getLocalizedIndividual(CIndividual* individual) { cint64 indiID = individual->getIndividualID(); if (!mIndiVec->hasLocalData(indiID)) { individual = CConceptRoleIndividualLocator::getLocatedIndividual(mIndiVec->getLocalData(indiID),mOntology); } else { individual = mIndiVec->getLocalData(indiID); } return individual; } CRole* CSubroleTransformationPreProcess::getLocalizedRole(CRole* role) { cint64 roleTag = role->getRoleTag(); if (!mRolesVector->hasLocalData(roleTag)) { role = CConceptRoleIndividualLocator::getLocatedRole(role,mOntology); } else { role = mRolesVector->getLocalData(roleTag); } return role; } CSubroleTransformationPreProcess* CSubroleTransformationPreProcess::updateDirectSuperRoles(CRole* role, bool negated, QSet< QPair >* roleSet) { role = getLocalizedRole(role); for (QSet< QPair >::const_iterator it = roleSet->constBegin(), itEnd = roleSet->constEnd(); it != itEnd; ++it) { QPair roleNegPair(*it); CRole* upRole = roleNegPair.first; bool upNeg = roleNegPair.second^negated; cint64 upRoleTag = upRole->getRoleTag(); if (upRole != role || upNeg) { if (!role->hasSuperRoleTag(upRoleTag,upNeg)) { CSortedNegLinker* superRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); superRoleLinker->init(upRole,upNeg); role->addSuperRoleLinker(superRoleLinker); } } } return this; } CSubroleTransformationPreProcess* CSubroleTransformationPreProcess::collectInverseEquivalentRoles(CRole* role, bool negated, QSet< QPair >* roleSet) { if (!roleSet->contains(QPair(role,negated))) { roleSet->insert(QPair(role,negated)); CSortedNegLinker* inEqRoleLinker = role->getInverseEquivalentRoleList(); while (inEqRoleLinker) { CRole* inEqRole = inEqRoleLinker->getData(); inEqRole = mRolesVector->getData(inEqRole->getRoleTag()); bool inEqRoleNeg = inEqRoleLinker->isNegated(); collectInverseEquivalentRoles(inEqRole,inEqRoleNeg^negated,roleSet); inEqRoleLinker = inEqRoleLinker->getNext(); } } return this; } bool CSubroleTransformationPreProcess::hasUniversalRolePropagation() { QSet topSuperRoleSet; topSuperRoleSet.insert(mTopObjectRole); for (CSortedNegLinker* topSuperRoleIt = mTopObjectRole->getIndirectSuperRoleList(); topSuperRoleIt; topSuperRoleIt = topSuperRoleIt->getNext()) { CRole* topSuperRole = topSuperRoleIt->getData(); topSuperRoleSet.insert(topSuperRole); } cint64 conCount = mConceptVector->getItemCount(); for (cint64 conIdx = 0; conIdx < conCount; ++conIdx) { CConcept* concept = mConceptVector->getData(conIdx); if (concept && concept->getOperatorCode() != CCSELF) { CRole* role = concept->getRole(); if (role && topSuperRoleSet.contains(role)) { return true; } } } return false; } void CSubroleTransformationPreProcess::addIndirectSuperRoles(bool inverse, CRole *modifingSubRole, CSortedNegLinker *superRoleLinker, QSet< QPair > *singleSuperRoleAddSet) { CSortedNegLinker *superRoleIt = superRoleLinker; while (superRoleIt) { CRole *superRole = superRoleIt->getData(); superRole = mRolesVector->getData(superRole->getRoleTag()); bool inversed = superRoleIt->isNegated()^inverse; if (!singleSuperRoleAddSet->contains(QPair(superRole,inversed))) { singleSuperRoleAddSet->insert(QPair(superRole,inversed)); CSortedNegLinker *nextSuperRoleLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); nextSuperRoleLinker->init(superRole,inversed); modifingSubRole->addIndirectSuperRoleLinker(nextSuperRoleLinker); addIndirectSuperRoles(inversed,modifingSubRole,superRole->getSuperRoleList(),singleSuperRoleAddSet); } superRoleIt = (CSortedNegLinker *)superRoleIt->getNext(); } } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CRequirementConfigPreprocessingItem.cpp0000644000175000017500000001617212520551226032014 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRequirementConfigPreprocessingItem.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CRequirementConfigPreprocessingItem::CRequirementConfigPreprocessingItem() { } CRequirementConfigPreprocessingItem* CRequirementConfigPreprocessingItem::initRequirementConfigPreprocessingItem(CConcreteOntology* ontology, CConfigurationBase* config) { COntologyPreprocessingItem::initPreprocessingItem(ontology,config); mPreprocessing = nullptr; mCalculationConfig = new CCalculationConfigurationExtension(config,0); COntologyProcessingStepDataVector* ontProStepDataVec = mOntology->getProcessingSteps()->getOntologyProcessingStepDataVector(); mActiveCountingProcessingStep = new CPreprocessingTestingStep(CPreprocessingTestingStep::ACTIVECOUNTINGPREPROCESSINGSTEP,ontProStepDataVec->getProcessingStepData(COntologyProcessingStep::OPSACTIVECOUNT),this); mBuildProcessingStep = new CPreprocessingTestingStep(CPreprocessingTestingStep::BUILDPREPROCESSINGSTEP,ontProStepDataVec->getProcessingStepData(COntologyProcessingStep::OPSBUILD),this); mPreprocessProcessingStep = new CPreprocessingTestingStep(CPreprocessingTestingStep::PREPROCESSPREPROCESSINGSTEP,ontProStepDataVec->getProcessingStepData(COntologyProcessingStep::OPSPREPROCESS),this); mProcessingSteps.append(mPreprocessProcessingStep); mProcessingSteps.append(mBuildProcessingStep); mProcessingSteps.append(mActiveCountingProcessingStep); mFailAfterPreprocessing = CConfigDataReader::readConfigBoolean(config,"Konclude.Debug.FailAfterPreprocessing",false); mFailAfterBuilt = CConfigDataReader::readConfigBoolean(config,"Konclude.Debug.FailAfterBuilt",false); return this; } CRequirementConfigPreprocessingItem::~CRequirementConfigPreprocessingItem() { delete mCalculationConfig; delete mActiveCountingProcessingStep; delete mBuildProcessingStep; delete mPreprocessProcessingStep; } bool CRequirementConfigPreprocessingItem::failAfterPreprocessing() { return mFailAfterPreprocessing; } bool CRequirementConfigPreprocessingItem::failAfterBuilt() { return mFailAfterBuilt; } COntologyPreprocessingItem* CRequirementConfigPreprocessingItem::addProcessingRequirement(COntologyProcessingRequirement* ontoRequirement) { bool supportRequirement = false; COntologyProcessingStepRequirement* stepProcRequirement = dynamic_cast(ontoRequirement); if (stepProcRequirement) { if (stepProcRequirement->getRequiredProcessingStep()->getOntologyProcessingType() == COntologyProcessingStep::OPSBUILD) { mBuildProcessingStep->addProcessingRequirement(stepProcRequirement); supportRequirement = true; } if (stepProcRequirement->getRequiredProcessingStep()->getOntologyProcessingType() == COntologyProcessingStep::OPSACTIVECOUNT) { mActiveCountingProcessingStep->addProcessingRequirement(stepProcRequirement); supportRequirement = true; } if (stepProcRequirement->getRequiredProcessingStep()->getOntologyProcessingType() == COntologyProcessingStep::OPSPREPROCESS) { mPreprocessProcessingStep->addProcessingRequirement(stepProcRequirement); supportRequirement = true; } } if (!supportRequirement) { stepProcRequirement->submitRequirementUpdate(COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSUNSUPPORTED); } return this; } CCalculationConfigurationExtension* CRequirementConfigPreprocessingItem::getCalculationConfiguration() { return mCalculationConfig; } CRequirementConfigPreprocessingItem* CRequirementConfigPreprocessingItem::setPreprocessing(CPreprocessing* preprocessing) { mPreprocessing = preprocessing; return this; } CPreprocessing* CRequirementConfigPreprocessingItem::getPreprocessing() { return mPreprocessing; } CPreprocessingTestingStep* CRequirementConfigPreprocessingItem::getBuildProcessingStep() { return mBuildProcessingStep; } CPreprocessingTestingStep* CRequirementConfigPreprocessingItem::getActiveCountingProcessingStep() { return mActiveCountingProcessingStep; } CPreprocessingTestingStep* CRequirementConfigPreprocessingItem::getPreprocessProcessingStep() { return mPreprocessProcessingStep; } bool CRequirementConfigPreprocessingItem::isBuildStepFinished() { return mBuildProcessingStep->isStepFinished(); } bool CRequirementConfigPreprocessingItem::isBuildStepRequired() { return mBuildProcessingStep->hasRequirements(); } bool CRequirementConfigPreprocessingItem::isActiveCountingStepFinished() { return mActiveCountingProcessingStep->isStepFinished(); } bool CRequirementConfigPreprocessingItem::isActiveCountingStepRequired() { return mActiveCountingProcessingStep->hasRequirements(); } bool CRequirementConfigPreprocessingItem::isPreprocessStepFinished() { return mPreprocessProcessingStep->isStepFinished(); } bool CRequirementConfigPreprocessingItem::isPreprocessStepRequired() { return mPreprocessProcessingStep->hasRequirements(); } bool CRequirementConfigPreprocessingItem::areBuildStepProcessingRequirementSatisfied() { return mBuildProcessingStep->areStepProcessingRequirementSatisfied(); } bool CRequirementConfigPreprocessingItem::areActiveCountingStepProcessingRequirementSatisfied() { return mActiveCountingProcessingStep->areStepProcessingRequirementSatisfied(); } bool CRequirementConfigPreprocessingItem::arePreprocessStepProcessingRequirementSatisfied() { return mPreprocessProcessingStep->areStepProcessingRequirementSatisfied(); } bool CRequirementConfigPreprocessingItem::areAllStepFinished() { for (QList::const_iterator it = mProcessingSteps.constBegin(), itEnd = mProcessingSteps.constEnd(); it != itEnd; ++it) { if (!(*it)->isStepFinished()) { return false; } } return true; } bool CRequirementConfigPreprocessingItem::hasRemainingProcessingRequirements() { for (QList::const_iterator it = mProcessingSteps.constBegin(), itEnd = mProcessingSteps.constEnd(); it != itEnd; ++it) { if ((*it)->hasRequirements()) { return true; } } return false; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CConsistenceCheckerPreProcess.h0000644000175000017500000000410012520551220030176 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CCONSISTENCECHECKERPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CCONSISTENCECHECKERPREPROCESS_H // Libraries includes // Namespace includes #include "CConcreteOntologyPreProcess.h" // Other includes #include "Reasoner/Consistiser/CDirectBlockedProcessingConsistiser.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Consistiser; namespace Preprocess { /*! * * \class CConsistenceCheckerPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConsistenceCheckerPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CConsistenceCheckerPreProcess(CConfiguration* config); //! Destructor virtual ~CConsistenceCheckerPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected variables protected: CConfiguration* mConfig; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CCONSISTENCECHECKERPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreProcess.h0000644000175000017500000000316212520551224024526 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CPREPROCESS_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Preprocess { /*! * * \class CPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPreProcess { // public methods public: //! Constructor CPreProcess(); //! Destructor virtual ~CPreProcess(); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CRequirementConfigPreprocessingItem.h0000644000175000017500000000741412520551226031460 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CREQUIREMENTCONFIGPREPROCESSINGITEM_H #define KONCLUDE_REASONER_PREPROCESS_CREQUIREMENTCONFIGPREPROCESSINGITEM_H // Libraries includes #include // Namespace includes #include "PreprocessSettings.h" #include "CPreprocessingTestingItem.h" #include "COntologyPreprocessingItem.h" #include "CPreprocessingTestingStep.h" // Other includes #include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h" #include "Reasoner/Ontology/COntologyProcessingStepRequirement.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; using namespace Ontology; namespace Preprocess { /*! * * \class CRequirementConfigPreprocessingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRequirementConfigPreprocessingItem : public COntologyPreprocessingItem { // public methods public: //! Constructor CRequirementConfigPreprocessingItem(); ~CRequirementConfigPreprocessingItem(); CRequirementConfigPreprocessingItem* initRequirementConfigPreprocessingItem(CConcreteOntology* ontology, CConfigurationBase* config); virtual COntologyPreprocessingItem* addProcessingRequirement(COntologyProcessingRequirement* ontoRequirement); CCalculationConfigurationExtension* getCalculationConfiguration(); CPreprocessingTestingStep* getActiveCountingProcessingStep(); bool isActiveCountingStepFinished(); bool isActiveCountingStepRequired(); bool areActiveCountingStepProcessingRequirementSatisfied(); CPreprocessingTestingStep* getBuildProcessingStep(); bool isBuildStepFinished(); bool isBuildStepRequired(); bool areBuildStepProcessingRequirementSatisfied(); CPreprocessingTestingStep* getPreprocessProcessingStep(); bool isPreprocessStepFinished(); bool isPreprocessStepRequired(); bool arePreprocessStepProcessingRequirementSatisfied(); bool areAllStepFinished(); bool hasRemainingProcessingRequirements(); CRequirementConfigPreprocessingItem* setPreprocessing(CPreprocessing* preprocessing); CPreprocessing* getPreprocessing(); bool failAfterPreprocessing(); bool failAfterBuilt(); // protected methods protected: // protected variables protected: CPreprocessingTestingStep* mActiveCountingProcessingStep; CPreprocessingTestingStep* mBuildProcessingStep; CPreprocessingTestingStep* mPreprocessProcessingStep; CPreprocessing* mPreprocessing; bool mFailAfterPreprocessing; bool mFailAfterBuilt; QList mProcessingSteps; CCalculationConfigurationExtension* mCalculationConfig; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CREQUIREMENTCONFIGPREPROCESSINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CMappingUpdaterPreProcess.cpp0000644000175000017500000003564512520551222027733 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMappingUpdaterPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CMappingUpdaterPreProcess::CMappingUpdaterPreProcess() { } CMappingUpdaterPreProcess::~CMappingUpdaterPreProcess() { } CConcreteOntology *CMappingUpdaterPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { if (ontology) { tbox = ontology->getDataBoxes()->getTBox(); abox = ontology->getDataBoxes()->getABox(); rbox = ontology->getDataBoxes()->getRBox(); mBox = ontology->getDataBoxes()->getMBox(); mBuildConstructFlags = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags(); mRoleVec = rbox->getRoleVector(); mConceptVec = tbox->getConceptVector(); mRoleObjPropTermHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getRoleObjectPropertyTermMappingHash(); mObjPropTermRoleHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getObjectPropertyTermRoleMappingHash(); mRoleDataPropTermHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getRoleDataPropertyTermMappingHash(); mDataPropTermRoleHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getDataPropertyTermRoleMappingHash(); mClassTermConceptHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getClassTermConceptMappingHash(); mConceptClassTermHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getConceptClassTermMappingHash(); mIndiTermIndiHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getIndividulTermIndiMappingHash(); mIndiIndiTermHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getIndiIndividulTermMappingHash(); mDeclarationAxiomSet = ontology->getBuildData()->getDeclarationAxiomSet(); mClassTermClassAxiomHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getClassTermExpressionClassAxiomExpressionHash(); mObjPropTermObjPropAxiomHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getObjectPropertyTermObjectPropertyAxiomHash(); mNameConceptHash = ontology->getStringMapping()->getClassNameConceptMappingHash(); mActiveEntityVector = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getActiveEntityVector(); qint64 rolesStartUpdateInd = mRoleVec->getReferencedItemCount(); qint64 rolesCounts = mRoleVec->getItemCount(); for (qint64 i = rolesStartUpdateInd; i < rolesCounts; ++i) { CRole *role = mRoleVec->getLocalData(i); if (role) { CObjectPropertyTermExpression* objPropTerm = mRoleObjPropTermHash->value(role,nullptr); if (objPropTerm) { CRole* prevRole = mRoleVec->getReferenceData(i); if (prevRole) { objPropTerm = mRoleObjPropTermHash->value(prevRole,nullptr); } if (objPropTerm) { mRoleObjPropTermHash->insert(role,objPropTerm); mObjPropTermRoleHash->insert(objPropTerm,role); } } } } qint64 conStartUpdateInd = mConceptVec->getReferencedItemCount(); qint64 conCounts = mConceptVec->getItemCount(); for (qint64 i = 0; i < conCounts; ++i) { CConcept *concept = mConceptVec->getLocalData(i); if (concept) { if (concept->hasClassName()) { mNameConceptHash->insert(CIRIName::getRecentIRIName(concept->getClassNameLinker()),concept); } if (i < conStartUpdateInd) { CClassTermExpression* classTerm = mConceptClassTermHash->value(concept,nullptr); if (classTerm) { CConcept* prevConcept = mConceptVec->getReferenceData(i); if (prevConcept) { classTerm = mConceptClassTermHash->value(prevConcept,nullptr); } if (classTerm) { mConceptClassTermHash->insert(concept,classTerm); mClassTermConceptHash->insert(classTerm,concept); } } } } } } collectActiveOntologyItemsFromActiveEntities(); return ontology; } bool CMappingUpdaterPreProcess::collectActiveOntologyItemsFromActiveEntities() { CBOXSET* activeClassConceptSet = tbox->getActiveClassConceptSet(); activeClassConceptSet->clear(); CBOXSET* activeIndividualSet = abox->getActiveIndividualSet(); activeIndividualSet->clear(); CBOXSET* activeRoleSet = rbox->getActivePropertyRoleSet(); activeRoleSet->clear(); CActiveEntityIterator activeEntityIterator(mActiveEntityVector->getActiveEntityIterator()); while (activeEntityIterator.hasNextActiveEntity()) { CExpressionEntity* expressionEntity = activeEntityIterator.getNextActiveEntity(true); if (expressionEntity) { CClassExpression* classExpression = dynamic_cast(expressionEntity); if (classExpression) { CConcept* concept = mClassTermConceptHash->value(classExpression); if (concept) { activeClassConceptSet->insert(concept); } } else { CNamedIndividualExpression* namedIndiExpression = dynamic_cast(expressionEntity); if (namedIndiExpression) { CIndividual* individual = mIndiTermIndiHash->value(namedIndiExpression); if (individual) { activeIndividualSet->insert(individual); } } else { CAnonymousIndividualExpression* anoIndiExpression = dynamic_cast(expressionEntity); if (anoIndiExpression) { CIndividual* individual = mIndiTermIndiHash->value(anoIndiExpression); if (individual) { activeIndividualSet->insert(individual); } } else { CObjectPropertyExpression* objPropertyExpression = dynamic_cast(expressionEntity); if (objPropertyExpression) { CRole* role = mObjPropTermRoleHash->value(objPropertyExpression); if (role) { activeRoleSet->insert(role); } } else { CDataPropertyExpression* dataPropertyExpression = dynamic_cast(expressionEntity); if (dataPropertyExpression) { CRole* role = mDataPropTermRoleHash->value(dataPropertyExpression); if (role) { activeRoleSet->insert(role); } } } } } } } } return true; } bool CMappingUpdaterPreProcess::collectActiveOntologyItems() { mUpdateConceptSet.insert(tbox->getTopConcept()); mUpdateConceptList.append(tbox->getTopConcept()); mUpdateConceptSet.insert(tbox->getBottomConcept()); mUpdateConceptList.append(tbox->getBottomConcept()); mUpdateRoleSet.insert(rbox->getTopObjectRole()); mUpdateRoleList.append(rbox->getTopObjectRole()); mUpdateRoleSet.insert(rbox->getBottomObjectRole()); mUpdateRoleList.append(rbox->getBottomObjectRole()); if (!mBuildConstructFlags->isRetractionUsed()) { qint64 conCounts = mConceptVec->getItemCount(); for (qint64 i = 2; i < conCounts; ++i) { CConcept *concept = mConceptVec->getLocalData(i); if (concept) { if (concept->hasClassName()) { if (!mUpdateConceptSet.contains(concept)) { mUpdateConceptSet.insert(concept); mUpdateConceptList.append(concept); } } } } } else { FOREACHIT (CDeclarationAxiomExpression* declAxiom, *mDeclarationAxiomSet) { CExpressionEntity* entity = declAxiom->getEntity(); CClassExpression* classExp = dynamic_cast(entity); if (classExp) { CConcept* concept = mClassTermConceptHash->value(classExp,nullptr); if (concept) { if (!mUpdateConceptSet.contains(concept)) { mUpdateConceptSet.insert(concept); mUpdateConceptList.append(concept); } } } CObjectPropertyExpression* objPropExp = dynamic_cast(entity); if (objPropExp) { CRole* role = mObjPropTermRoleHash->value(objPropExp,nullptr); if (role) { if (!mUpdateRoleSet.contains(role)) { mUpdateRoleSet.insert(role); mUpdateRoleList.append(role); } } } //CIndividualTermExpression* indiExp = dynamic_cast(entity); //if (indiExp) { // CIndividual* individual = mIndiTermIndiHash->value(indiExp); // if (individual) { // if (!mUpdateIndividualSet.contains(individual)) { // mUpdateIndividualSet.insert(individual); // mUpdateIndividualList.append(individual); // } // } //} } // consider all Abox individual, not only those which are referenced by definitions // if an individual is removed from the KB, then there are no asserted concepts cint64 indiCount = abox->getIndividualCount(); CIndividualVector* indiVec = abox->getIndividualVector(false); if (indiVec) { for (cint64 indiID = 0; indiID < indiCount; ++indiID) { CIndividual* individual = indiVec->getData(indiID); if (individual) { for (CConceptAssertionLinker* conAssIt = individual->getAssertionConceptLinker(); conAssIt; conAssIt = conAssIt->getNext()) { CConcept* concept = conAssIt->getData(); if (!mUpdateConceptSet.contains(concept)) { mUpdateConceptSet.insert(concept); mUpdateConceptList.append(concept); } } } } } FOREACHIT (CClassTermExpression* classTermExp, mClassTermClassAxiomHash->keys()) { if (mClassTermClassAxiomHash->value(classTermExp) != nullptr) { CConcept* concept = mClassTermConceptHash->value(classTermExp,nullptr); if (concept) { if (!mUpdateConceptSet.contains(concept)) { mUpdateConceptSet.insert(concept); mUpdateConceptList.append(concept); } } } } FOREACHIT (CObjectPropertyTermExpression* objPropTermExp, mObjPropTermObjPropAxiomHash->keys()) { if (mObjPropTermObjPropAxiomHash->value(objPropTermExp) != nullptr) { CRole* role = mObjPropTermRoleHash->value(objPropTermExp,nullptr); if (role) { if (!mUpdateRoleSet.contains(role)) { mUpdateRoleSet.insert(role); mUpdateRoleList.append(role); } } } } while (!mUpdateConceptList.isEmpty() || !mUpdateRoleList.isEmpty() || !mUpdateIndividualList.isEmpty()) { while (!mUpdateConceptList.isEmpty()) { CConcept* concept = mUpdateConceptList.takeFirst(); CSortedNegLinker* opLinkerIt = concept->getOperandList(); while (opLinkerIt) { CConcept* opCon = opLinkerIt->getData(); if (!mUpdateConceptSet.contains(opCon)) { mUpdateConceptSet.insert(opCon); mUpdateConceptList.append(opCon); } opLinkerIt = opLinkerIt->getNext(); } CRole* role = concept->getRole(); if (role && !mUpdateRoleSet.contains(role)) { mUpdateRoleSet.insert(role); mUpdateRoleList.append(role); } //CIndividual* individual = concept->getNominalIndividual(); //if (individual && !mUpdateIndividualSet.contains(individual)) { // mUpdateIndividualSet.insert(individual); // mUpdateIndividualList.append(individual); //} } //while (!mUpdateIndividualList.isEmpty()) { // CIndividual* individual = mUpdateIndividualList.takeFirst(); // for (CConceptAssertionLinker* conAssIt = individual->getAssertionConceptLinker(); conAssIt; conAssIt = conAssIt->getNext()) { // CConcept* concept = conAssIt->getData(); // if (!mUpdateConceptSet.contains(concept)) { // mUpdateConceptSet.insert(concept); // mUpdateConceptList.append(concept); // } // } // for (CRoleAssertionLinker* roleAssIt = individual->getAssertionRoleLinker(); roleAssIt; roleAssIt = roleAssIt->getNext()) { // CRole* role = roleAssIt->getRole(); // if (!mUpdateRoleSet.contains(role)) { // mUpdateRoleSet.insert(role); // mUpdateRoleList.append(role); // } // CIndividual* individual2 = roleAssIt->getIndividual(); // if (!mUpdateIndividualSet.contains(individual2)) { // mUpdateIndividualSet.insert(individual2); // mUpdateIndividualList.append(individual2); // } // } //} while (!mUpdateRoleList.isEmpty()) { CRole* role = mUpdateRoleList.takeFirst(); CSortedNegLinker* roleLinkerIt = role->getIndirectSuperRoleList(); while (roleLinkerIt) { CRole* superRole = roleLinkerIt->getData(); if (!mUpdateRoleSet.contains(superRole)) { mUpdateRoleSet.insert(superRole); mUpdateRoleList.append(superRole); } roleLinkerIt = roleLinkerIt->getNext(); } CSortedNegLinker* disRoleLinkerIt = role->getDisjointRoleList(); while (disRoleLinkerIt) { CRole* disRole = disRoleLinkerIt->getData(); if (!mUpdateRoleSet.contains(disRole)) { mUpdateRoleSet.insert(disRole); mUpdateRoleList.append(disRole); } disRoleLinkerIt = disRoleLinkerIt->getNext(); } CSortedNegLinker* domainConLinkerIt = role->getDomainConceptList(); while (domainConLinkerIt) { CConcept* opCon = domainConLinkerIt->getData(); if (!mUpdateConceptSet.contains(opCon)) { mUpdateConceptSet.insert(opCon); mUpdateConceptList.append(opCon); } domainConLinkerIt = domainConLinkerIt->getNext(); } CSortedNegLinker* rangeConLinkerIt = role->getRangeConceptList(); while (rangeConLinkerIt) { CConcept* opCon = rangeConLinkerIt->getData(); if (!mUpdateConceptSet.contains(opCon)) { mUpdateConceptSet.insert(opCon); mUpdateConceptList.append(opCon); } rangeConLinkerIt = rangeConLinkerIt->getNext(); } } } } CBOXSET* activeClassConceptSet = tbox->getActiveClassConceptSet(); activeClassConceptSet->clear(); FOREACHIT (CConcept* concept, mUpdateConceptSet) { if (concept->hasClassName()) { activeClassConceptSet->insert(concept); } } return true; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CTriggeredImplicationBinaryAbsorberPreProcess.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CTriggeredImplicationBinaryAbsorberPreProc0000644000175000017500000004404212520551230032437 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CTRIGGEREDIMPLICATIONBINARYABSORBERPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CTRIGGEREDIMPLICATIONBINARYABSORBERPREPROCESS_H // Libraries includes #include // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" #include "CConceptTriggerLinker.h" #include "CConceptRoleIndividualLocator.h" #include "CNominalSchemaAbsorptionPathLinker.h" #include "CNominalSchemaAbsorptionBranchLinker.h" // Other includes #include "Utilities/CDynamicExpandingMemoryManager.hpp" #include "Utilities/CSortedNegLinker.hpp" #include "Config/CConfigDataReader.h" #include "Reasoner/Generator/CConcreteOntologyInverseRoleBuilder.h" #include "Reasoner/Ontology/CConceptTextFormater.h" #include "Reasoner/Ontology/COntologyTextFormater.h" #include "Reasoner/Ontology/CNominalSchemaTemplate.h" #include "Reasoner/Ontology/CNominalSchemaTemplateVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Generator; using namespace Ontology; namespace Preprocess { /*! * * \class CTriggeredImplicationBinaryAbsorberPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTriggeredImplicationBinaryAbsorberPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CTriggeredImplicationBinaryAbsorberPreProcess(); //! Destructor virtual ~CTriggeredImplicationBinaryAbsorberPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: typedef QPair TConceptNegationPair; typedef QPair TOccuredAbsorbablePair; typedef QPair TConceptPair; typedef QPair TAbsorptionBranchPair; void asorbForallsToRanges(CConcept* topConcept); bool collectConjunctions(CConcept* concept, bool negated, QList< TConceptNegationPair >& conjList); void collectPositiveConcepts(CConcept* concept, bool negated, QSet* positiveConceptSet); CConcept* getRoleDomainTriggerConcept(CRole* role); bool addConceptToImplied(CConcept* impliedConcept, CConcept* concept, bool negated); bool addSubClassConcept(CConcept* subclassConcept, CConcept* addedConcept, bool negated); bool addRoleDomainConcept(CRole* role, CConcept* addedConcept, bool negated); bool addRoleRangeConcept(CRole* role, CConcept* addedConcept, bool negated); CConcept* createCandidateEquivalentConcept(CConcept* eqConcept); CConcept* createImpliedConcept(); CConcept* createImplicationConcept(CConcept* impliedConcept, bool negated); CConcept* createImplicationTriggerConcept(CConcept* impConcept, bool negated); bool addImplicationTrigger(CConcept* implConcept, CConcept* triggerConcept, bool negated); CConcept* createTriggerPropagationConcept(CConcept* destConcept, CRole* backwardPropRole); bool isEquivalenceConceptTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated, cint64* notAbsorbableOperandsCount = nullptr); bool isEquivalenceConceptCandidateExtractable(CConcept* orConcept, bool negated); CConcept* getEquivalenceConceptCandidateTriggeredImplication(CConcept* eqConcept, bool negated); bool isGCIConceptTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated, cint64* notAbsorbableOperandsCount = nullptr); bool isConceptImplicationTriggerable(CConcept* concept, bool negated, QHash* conceptEqConAbsorbed); bool isConceptImplicationTriggerable(CConcept* concept, bool negated, QHash* conceptEqConAbsorbed, cint64* openMultipleOccurCount, QList** dependingCacheList); bool isConceptSimpleImplicationTriggerable(CConcept* concept, bool negated); void createEquivalenceAbsorbedTriggeredImplication(CConcept* eqConcept, bool negated, CSortedNegLinker* absorpOpLinker); CConcept* createDisjunctionAbsorbedTriggeredImplication(CConcept* orConcept, bool negated); CConcept* createDisjunctionAbsorbedTriggeredImplication(CConcept* orConcept, bool negated, QList& absorbList, QList& candList); void mergeDependingCacheList(QList** dependingCacheList, QList** subDependingCacheList); CConceptTriggerLinker* getTriggersForConcept(CConcept* concept, bool negated); CConceptTriggerLinker* createTriggerLinker(); CConceptTriggerLinker* copyTriggerLinkers(CConceptTriggerLinker* triggers); void releaseTriggerLinkers(CConceptTriggerLinker* triggers); CDatatypeValueSpaceConceptTriggerLinker* createValueSpaceConceptTriggerLinker(); CConcept* getImplicationImpliedConcept(CConcept* implicationConcept); CConceptTriggerLinker* getImplicationTriggeredConceptForTriggers(CConceptTriggerLinker* triggers, CConcept** firstImplicationConcept); CConceptTriggerLinker* getUpdatedTriggerComplexities(CConceptTriggerLinker* triggers); bool findAndReplaceImplicationFromTriggers(CConceptTriggerLinker* trigger, CConceptTriggerLinker*& otherTriggers); CConcept* createTriggerConcept(bool branchTrigger = false); void addUnfoldingConceptForConcept(CConcept* concept, CConcept* addingUnfoldingConcept, bool addingNegation); void addUnfoldingConceptForImplicationConcept(CConcept* implicationConcept, CConcept* addingUnfoldingConcept, bool addingNegation); CConceptTriggerLinker* getPartialTriggersForConcept(CConcept* concept, bool negated); CConceptRoleBranchingTrigger* getSimpleBranchTriggersForConcept(CConcept* concept, bool negated); CConceptRoleBranchingTrigger* getBranchTiggers(CConceptTriggerLinker* triggers); CRole* getInverseRole(CRole* role); bool isDisjunctionConceptTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated); bool isDisjunctionConceptSimpleTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated); bool isDisjunctionConceptPartialTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated); bool isConceptPartialImplicationTriggerable(CConcept* concept, bool negated, QSet* conceptEqConAbsorbed); bool absorbGCIConceptsToTriggeredImplications(CConcept* orConcept, bool negated); void createGCIAbsorbedTriggeredImplication(CConcept* orConcept, bool negated, QList& absorbList, QList& candList); bool absorbPartialGCIConceptsToTriggeredImplications(CConcept* orConcept, bool negated); void createGCIPartialAbsorbedTriggeredImplication(CConcept* orConcept, bool negated, const QList& absorbList); CConceptRoleBranchingTrigger* createDisjunctionPartialAbsorbedBranchTriggers(CConcept* orConcept, bool negated); CConceptRoleBranchingTrigger* createDisjunctionPartialAbsorbedBranchTriggers(CConcept* orConcept, bool negated, const QList& absorbList); CConcept* createPartialExtendedAbsorbedTriggeredImplication(CConcept* impliedConcept, bool impliedNegation, const QList& absorbList); CConcept* createPartialExtendedAbsorbedImpliedTriggerCocnept(const QList& absorbList); CConceptTriggerLinker* createPartialExtendedAbsorbedImpliedTrigger(const QList& absorbList); bool addAbsorbableDisjunctCandidates(CConcept* orConcept, bool negated, QList& list); QList splitAbsorbableDisjuncts(QList& list); QList getPartialAbsorbableDisjuncts(QList& list); QString generateDebugGCIConceptString(CConcept* concept, bool conceptNegation); QString generateDebugGeneratedAbsorbedImplicationString(cint64 minNewConceptTag, cint64 lastNewConceptTag); void optimizeTriggerStructure(); void replaceTrigger(CConcept* baseConcept, CConcept* replaceConcept, bool negated); void replaceOneTrigger(CConcept* baseConcept, CConcept* replaceConcept, bool negated); bool absorbNominalSchemaGCIConceptsToTriggeredImplications(CConcept* concept, bool negated); void createGCINominalSchemaAbsorbedTriggeredImplication(CConcept* orConcept, bool negated, QList& absorbList, QList& partialAbsorbList, QList& candList, CNominalSchemaTemplate* nsTemplate); CNominalSchemaAbsorptionPathLinker* getAbsorbedNominalSchemaPaths(const QSet& conceptSet, CNominalSchemaAbsorptionPathLinker* absorptionPathLinker, QHash* nomSchConceptVariableHash, CNominalSchemaTemplate* nsTemplate); void collectNominalSchemaRelatedConcepts(CConcept* concept, bool negated, QSet& conceptSet, CNominalSchemaTemplate* nsTemplate); void sortNominalSchemaRelatedConcepts(QSet& conceptSet, CNominalSchemaTemplate* nsTemplate, QList& nomSchConList, QList& otherConList, QList& orConList); CConcept* createBindingImplicationTriggeredConcept(CConcept* triggeredConcept, CConcept* impliedConcept); CConcept* createBindingCycleCloseConcept(CConcept* cycleCloseTriggerConcept, CConcept* impliedTriggerConcept); CConcept* createBindingTriggerConcept(); CConcept* createBindingVariableConcept(CConcept* followingConcept, CVariable* variable); CConcept* createBindingToSuccessorPropagationConcept(CConcept* followingConcept, CRole* role); CConcept* createBindingFromSuccessorPropagationConcept(CConcept* followingConcept, CRole* role); CConcept* createBindingGroundingConcept(CNominalSchemaTemplate* nsTemplate, cint64 groundOpCode); void createBindingGroundConcept(CConcept*& groundingConcept, bool& groundingConNegation, const QList& groundConceptList, CNominalSchemaTemplate* nsTemplate, cint64 groundOpCode); CNominalSchemaAbsorptionPathLinker* duplicateNominalSchemaAbsorptionPaths(CNominalSchemaAbsorptionPathLinker* abPathLinker, cint64 duplicateCount); CNominalSchemaAbsorptionBranchLinker* getAbsorbedJoinedNominalSchemaBranchLinker(CConcept* absorbingConcept, bool absorbingNegation, CConcept* backPropConTrigger, QHash* nomSchConceptVariableHash, CNominalSchemaTemplate* nsTemplate); CNominalSchemaAbsorptionBranchLinker* getAbsorbedJoinedNominalSchemaBranchLinker(const QSet& conceptSet, CConcept* backPropConTrigger, QHash* nomSchConceptVariableHash, CNominalSchemaTemplate* nsTemplate); CNominalSchemaAbsorptionBranchLinker* getAbsorbedNominalSchemaBranchLinker(CConcept* absorbingConcept, bool absorbingNegation, CConcept* backPropConTrigger, QHash* nomSchConceptVariableHash, CNominalSchemaTemplate* nsTemplate); CConcept* createBindingBackPropagationActivationTriggerConcept(); CConcept* createBindingBackPropagationTriggerConcept(); CConcept* createBindingBackPropagationImplicationTriggeredConcept(CConcept* triggeredConcept, CConcept* impliedConcept); bool addBindingBackPropagationTriggeredToImplicationConcept(CConcept* implicationConcept, CConcept* triggeredConcept); CConcept* createBindingBackPropagationToSuccessorConcept(CConcept* followingConcept, CRole* role); CConcept* createVariableBindingPropagationFromSuccessorConcept(CConcept* followingConcept, CRole* role); CConcept* createVariableBindingPropagationTriggerConcept(); CConcept* createVariableBindingPropagationJoiningConcept(CConcept* joinConcept1, CConcept* joinConcept2, CConcept* impliedConcept); CConcept* createVariableBindingPropagationBindVariableConcept(CConcept* followingConcept, CVariable* variable); CConcept* createVariableBindingPropagationImplicationTriggeredConcept(CConcept* triggeredConcept, CConcept* impliedConcept); void createJoiningConceptVariableList(CConcept* joiningConcept, CNominalSchemaAbsorptionBranchLinker* abLinker1, CNominalSchemaAbsorptionBranchLinker* abLinker2); void addConceptOperand(CConcept* concept, CConcept* operandConcept, bool operandNegation); bool hasNominalSchemaAbsorbableConceptFillHash(CConcept* concept, bool negation, CBOXHASH* absorbableConceptNominalSchemaConceptHash, CConcept* nominalSchemaConcept, QSet* testedConceptSet); bool hasNominalSchemaConceptFillHash(CConcept* concept, CBOXHASH* conceptNominalSchemaConceptHash, CConcept* nominalSchemaConcept, QSet* testedConceptSet); void collectNominalSchemaConcepts(CConcept* concept, CBOXSET* nominalSchemaConceptSet); // protected variables protected: class CAbsorpEquivalentClassItem { public: CAbsorpEquivalentClassItem(CConcept* eqConcept, CSortedNegLinker* absorpOpLinker) { mEqConcept = eqConcept; mAbsorpOpLinker = absorpOpLinker; } CConcept* mEqConcept; CSortedNegLinker* mAbsorpOpLinker; }; CMemoryAllocationManager* mMemMan; CMBox* mMBox; CTBox* mTBox; QHash mConceptImplicationImpliedHash; QHash mConceptTriggerLinkerHash; CConceptTriggerLinker* mTmpTriggerLinker; QList mTriggerContainer; QList*> mLaterTopConceptTriggerAddList; QHash mConceptTriggerHash; QHash mTriggerCountHash; CConceptVector* mConceptVec; CConcept* mBottomConcept; CConcept* mTopConcept; CConcreteOntology* mOnto; CBranchingTriggerVector* mBranchTriggVec; CNominalSchemaTemplateVector* mNomSchemaTemplVec; CBOXHASH* mTriggerImplHash; QHash mConceptTotalAbsorbableHash; QHash mConceptPartialAbsorbableHash; QSet mEQNotConceptPartialAbsorbableSet; CBOXHASH* mEquivConCandidateHash; CBOXHASH* mCandidateEquivConHash; CBOXSET* mEquivConNonCandidateSet; QHash* mRoleDomainTriggerConceptHash; QHash mConceptNomSchAbsorpBranchLinkerHash; QHash mAbsorptionBranchPairAbsorptionBranchHash; QHash mRoleInverseRoleCreateHash; CBOXHASH* mIndividualTriggerConceptHash; cint64 mNextVariableID; bool mConfRequiresExistingInverseRole; bool mConfAbsorbEqClassDefinitions; bool mConfPartialAbsorbEqClassDefinitions; bool mConfPartialGCIAbsorption; bool mConfAbsorbDisjunctions; bool mConfAbsorbSimpleDisjunctions; bool mConfPartialDisjunctionsAbsorption; bool mConfOnlyPositiveDisjunctionsAbsorption; bool mConfNominalSchemaPathPreabsorption; bool mConfVariableMultipleTriggeredBackwardChainingAbsorption; bool mConfNominalSchemaBackPropagation; bool mConfNominalSchemaBackPropagationMultiTrigger; bool mConfImplicationsForTriggerReusue; bool mConfPunishOftenSameTriggerUse; cint64 mConfOftenTriggerUseCountPunishment; bool mConfDatatypeAbsorption; class CTriggCount { public: inline CTriggCount() { mCount = 0; } inline void incCount(cint64 count = 1) { mCount += count; } cint64 mCount; }; QHash mTriggCountHash; class CBackPropTrigHashData { public: inline CBackPropTrigHashData(CConcept* activationTriggerConcept, CConcept* implicationConcept) { mActivationTriggerConcept = activationTriggerConcept; mImplicationConcept = implicationConcept; } CConcept* mActivationTriggerConcept; CConcept* mImplicationConcept; }; QHash mVarBackPropTrigHash; QList mVarBackPropTrigContainer; cint64 mStatInvRolesGenerated; cint64 mStatGCIAbsorbed; cint64 mStatGCINormalAbsorbed; cint64 mStatGCIPartialAbsorbed; cint64 mStatGCIAbsorptionPartialExtended; cint64 mStatGCITotal; cint64 mStatEqAbsorbed; cint64 mStatEqTotal; cint64 mStatImplConceptsGenerated; cint64 mStatReusedImplications; cint64 mStatOptimizedRemovedTriggers; cint64 mStatGCINormalSchemaAbsorbed; QString mDebugGCIString; QString mDebugAbsorbedString; QString mDebugLastGCIString; QString mDebugLastAbsorbedGCIConceptString; QString mDebugLastAbsorbedGCITechniqueString; QString mDebugLastAbsorbedGCIString; QString mDebugTotalAbsorbedGCIString; cint64 mLastNewConceptTag; cint64 mFirstNewConceptTag; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CTRIGGEREDIMPLICATIONBINARYABSORBERPREPROCESS_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CExtractPropagationIntoCreationDirectionPreProcess.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CExtractPropagationIntoCreationDirectionPr0000644000175000017500000000441412520551222032512 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CEXTRACTPROPAGATIONINTOCREATIONDIRECTIONPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CEXTRACTPROPAGATIONINTOCREATIONDIRECTIONPREPROCESS_H // Libraries includes // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" // Other includes #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptOperator.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CExtractPropagationIntoCreationDirectionPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExtractPropagationIntoCreationDirectionPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CExtractPropagationIntoCreationDirectionPreProcess(); //! Destructor virtual ~CExtractPropagationIntoCreationDirectionPreProcess(); virtual CConcreteOntology* preprocess(CConcreteOntology* ontology, CPreProcessContext* context); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CEXTRACTPROPAGATIONINTOCREATIONDIRECTIONPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreProcessContext.cpp0000644000175000017500000000213112520551224026421 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreProcessContext.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CPreProcessContext::CPreProcessContext() { } CPreProcessContext::~CPreProcessContext() { } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreprocessingCallbackDataContext.h0000644000175000017500000000422612520551226031044 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGCALLBACKDATACONTEXT_H #define KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGCALLBACKDATACONTEXT_H // Libraries includes // Namespace includes #include "PreprocessSettings.h" // Other includes #include "Concurrent/Callback/CCallbackDataContext.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CPreprocessingCallbackDataContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPreprocessingCallbackDataContext : public CCallbackDataContext { // public methods public: //! Constructor CPreprocessingCallbackDataContext(bool preprocessed, CConcreteOntology* ontology); virtual CConcreteOntology *getOntology(); virtual bool isPreprocessed(); // protected methods protected: // protected variables protected: CConcreteOntology* mOntology; bool mPreprocessed; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGCALLBACKDATACONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CCoreOntologyCyclesExtractorPreProcess.h0000644000175000017500000000623612520551220032132 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CCOREONTOLOGYCYCLESEXTRACTORPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CCOREONTOLOGYCYCLESEXTRACTORPREPROCESS_H // Libraries includes // Namespace includes #include "CConcreteOntologyPreProcess.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Preprocess { typedef QPair TConceptNegPair; /*! * * \class CCoreOntologyCyclesExtractorPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCoreOntologyCyclesExtractorPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CCoreOntologyCyclesExtractorPreProcess(); //! Destructor virtual ~CCoreOntologyCyclesExtractorPreProcess(); virtual CConcreteOntology* preprocess(CConcreteOntology* ontology, CPreProcessContext* context); // protected methods protected: bool hasConceptCycle(CConcept* concept, bool negated, QSet* visitedConceptSet, QSet* cylceConceptSet); bool addConceptsToList(CSortedNegLinker* opLinker, bool negated, QList& nextTestingConceptList); bool getConceptCycle(QSet* visitedConceptSet, QSet* cylceConceptSet, bool* cycleNominalConnection); // protected variables protected: class CTestingItem { public: CTestingItem(CConcept* concept = nullptr, bool negated = false, cint64 searchingDepth = 0, CTestingItem* prevItem = nullptr) : mConNegPair(concept,negated),mSearchingDepth(searchingDepth),mPrevItem(prevItem) { } CTestingItem(const TConceptNegPair& conNegPair, cint64 searchingDepth = 0, CTestingItem* prevItem = nullptr) : mConNegPair(conNegPair),mSearchingDepth(searchingDepth),mPrevItem(prevItem) { } TConceptNegPair mConNegPair; cint64 mSearchingDepth; CTestingItem* mPrevItem; }; cint64 mStatExtractedCyclesCount; cint64 mStatCyclicConceptsCount; QSet mCycleConceptSet; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CCOREONTOLOGYCYCLESEXTRACTORPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/COntologyPreProcesser.h0000644000175000017500000000365512520551224026617 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CONTOLOGYPREPROCESSER_H #define KONCLUDE_REASONER_PREPROCESS_CONTOLOGYPREPROCESSER_H // Libraries includes // Namespace includes // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class COntologyPreProcesser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyPreProcesser { // public methods public: //! Constructor COntologyPreProcesser(); //! Destructor virtual ~COntologyPreProcesser(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CConfiguration *config) = 0; // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CONTOLOGYPREPROCESSER_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CTriggeredImplicationGCIAbsorberPreProcess.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CTriggeredImplicationGCIAbsorberPreProcess0000644000175000017500000001566412405707546032357 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CTRIGGEREDIMPLICATIONGCIABSORBERPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CTRIGGEREDIMPLICATIONGCIABSORBERPREPROCESS_H // Libraries includes #include // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" // Other includes #include "Utilities/CDynamicExpandingMemoryManager.hpp" #include "Utilities/CSortedNegLinker.hpp" #include "Config/CConfigDataReader.h" #include "Reasoner/Generator/CConcreteOntologyInverseRoleBuilder.h" #include "Reasoner/Ontology/CConceptTextFormater.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Reasoner { using namespace Generator; using namespace Ontology; namespace Preprocess { /*! * * \class CTriggeredImplicationGCIAbsorberPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTriggeredImplicationGCIAbsorberPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CTriggeredImplicationGCIAbsorberPreProcess(); //! Destructor virtual ~CTriggeredImplicationGCIAbsorberPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: bool addConceptToImplied(CConcept* impliedConcept, CConcept* concept, bool negated); bool addSubClassConcept(CConcept* subclassConcept, CConcept* addedConcept, bool negated); bool addRoleDomainConcept(CRole* role, CConcept* addedConcept, bool negated); CConcept* createImpliedConcept(); CConcept* createImplicationConcept(CConcept* impliedConcept, bool negated); CConcept* createImplicationTriggerConcept(CConcept* impConcept, bool negated); bool addImplicationTrigger(CConcept* implConcept, CConcept* triggerConcept, bool negated); CConcept* createTriggerPropagationConcept(CConcept* destConcept, CRole* backwardPropRole); bool isEquivalenceConceptTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated, cint64* notAbsorbableOperandsCount = nullptr); bool isGCIConceptTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated, cint64* notAbsorbableOperandsCount = nullptr); bool isConceptImplicationTriggerable(CConcept* concept, bool negated); bool isConceptSimpleImplicationTriggerable(CConcept* concept, bool negated); CConcept* createEquivalenceAbsorbedTriggeredImplication(CConcept* eqConcept, bool negated); CConcept* createDisjunctionAbsorbedTriggeredImplication(CConcept* orConcept, bool negated); cint64 createImplicationAddedToTrigger(CConcept* implicationConcept, CConcept* triggerConcept, CConcept* concept, bool negated); cint64 createTrigger(CConcept* implicationConcept, CConcept* triggerConcept, CConcept* concept, bool negated, cint64* impAddTriggerCount, CConcept** impAddTrigger); CRole* getInverseRole(CRole* role); bool isDisjunctionConceptTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated); bool isDisjunctionConceptSimpleTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated); bool isConceptPartialImplicationTriggerable(CConcept* concept, bool negated); bool absorbGCIConceptsToTriggeredImplications(CConcept* orConcept, bool negated); CConcept* createGCIAbsorbedTriggeredImplication(CConcept* orConcept, bool negated, QList< QPair >& absorbList, QList< QPair >& candList); cint64 createPartialImplicationAddedToTrigger(CConcept* implicationConcept, CConcept* triggerConcept, CConcept* concept, bool negated); cint64 createPartialTrigger(CConcept* implicationConcept, CConcept* triggerConcept, CConcept* concept, bool negated, cint64* impAddTriggerCount, CConcept** impAddTrigger); bool absorbPartialGCIConceptsToTriggeredImplications(CConcept* orConcept, bool negated); CConcept* createGCIPartialAbsorbedTriggeredImplication(CConcept* orConcept, bool negated, const QList< QPair >& absorbList); CConcept* createPartialExtendedGCIAbsorbedTriggeredImplication(CConcept* implicationConcept, const QList< QPair >& absorbList); bool addAbsorbableDisjunctCandidates(CConcept* orConcept, bool negated, QList< QPair >& list); QList< QPair > splitAbsorbableDisjuncts(QList< QPair >& list); QList< QPair > getPartialAbsorbableDisjuncts(QList< QPair >& list); QString generateDebugGCIConceptString(CConcept* concept, bool conceptNegation); QString generateDebugGeneratedAbsorbedImplicationString(cint64 minNewConceptTag, cint64 lastNewConceptTag); // protected variables protected: CMemoryAllocationManager* mMemMan; QHash< QPair ,CConcept*> mConceptTriggerHash; QHash mTriggerCountHash; CConceptVector* mConceptVec; CConcept* mBottomConcept; CConcreteOntology* mOnto; CBOXHASH* mTriggerImplHash; bool mConfRequiresExistingInverseRole; bool mConfAbsorbEqClassDefinitions; bool mConfPartialGCIAbsorption; bool mConfAbsorbDisjunctions; bool mConfAbsorbSimpleDisjunctions; cint64 mStatInvRolesGenerated; cint64 mStatGCIAbsorbed; cint64 mStatGCINormalAbsorbed; cint64 mStatGCIPartialAbsorbed; cint64 mStatGCIAbsorptionPartialExtended; cint64 mStatGCITotal; cint64 mStatEqAbsorbed; cint64 mStatEqTotal; cint64 mStatImplConceptsGenerated; QString mDebugGCIString; QString mDebugAbsorbedString; QString mDebugLastGCIString; QString mDebugLastAbsorbedGCIConceptString; QString mDebugLastAbsorbedGCITechniqueString; QString mDebugLastAbsorbedGCIString; QString mDebugTotalAbsorbedGCIString; cint64 mLastNewConceptTag; cint64 mFirstNewConceptTag; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CTRIGGEREDIMPLICATIONGCIABSORBERPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CReverseRoleAssertionGeneratorPreProcess.h0000644000175000017500000000472012520551230032441 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CREVERSEROLEASSERTIONGENERATORPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CREVERSEROLEASSERTIONGENERATORPREPROCESS_H // Libraries includes // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" // Other includes #include "Utilities/CHashableIntConvertedNTuble.hpp" #include "Utilities/CMemoryManager.hpp" #include "Utilities/CDynamicExpandingMemoryManager.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Preprocess { /*! * * \class CReverseRoleAssertionGeneratorPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief Not thread safe * */ class CReverseRoleAssertionGeneratorPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CReverseRoleAssertionGeneratorPreProcess(); //! Destructor virtual ~CReverseRoleAssertionGeneratorPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: // private methods private: bool isAssertionChanged(CIndividual* indi, CIndividual* prevIndi, CRoleAssertionLinker* roleAssLinker, CPreProcessContext* context); // private variables private: CMemoryAllocationManager* mBoxMemMan; CConceptVector* mConVec; CRoleVector* mRoleVec; CIndividualVector* mIndiVec; }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CREVERSEROLEASSERTIONGENERATORPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CDisjunctSortingPreProcess.h0000644000175000017500000000626112520551222027601 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CDISJUNCTSORTINGPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CDISJUNCTSORTINGPREPROCESS_H // Libraries includes // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" // Other includes #include "Reasoner/Ontology/CConceptRoleBranchingTrigger.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CDisjunctSortingPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDisjunctSortingPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CDisjunctSortingPreProcess(); //! Destructor virtual ~CDisjunctSortingPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: void sortDisjuncts(CConcept* concept, bool negated); void addDisjunctFromList(QList< CSortedNegLinker* >& disjunctList, CSortedNegLinker*& newOperandLinker, CSortedNegLinker*& lastNewOperandLinker); void addDisjunctToSort(CSortedNegLinker* conLinker, bool negated); // protected variables protected: CMemoryAllocationManager* mMemMan; cint64 mSortedDisjunctCount; cint64 mPotentialDisjunctionCount; CConcreteOntology* mOnto; CConceptVector* mConceptVec; CTBox* mTBox; QList< CSortedNegLinker* > mAtomicDisjList; QList< CSortedNegLinker* > mPrimNegDisjList; QList< CSortedNegLinker* > mSimpleExistDisjList; QList< CSortedNegLinker* > mExistDisjList; QList< CSortedNegLinker* > mNegNominalDisjList; QList< CSortedNegLinker* > mPosNominalDisjList; QList< CSortedNegLinker* > mPropDisjList; QList< CSortedNegLinker* > mTriggerDisjList; QList< CSortedNegLinker* > mImplDisjList; QList< CSortedNegLinker* > mOtherDisjList; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CDISJUNCTSORTINGPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreprocessingThread.cpp0000644000175000017500000002005312520551226026747 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreprocessingThread.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CPreprocessingThread::CPreprocessingThread(CReasonerManager *reasonerManager) : CThread("Preprocessing-Thread") { mReasoner = reasonerManager; mCalculationManager = 0; mCurrRunningTestParallelCount = 0; mConfMaxTestParallelCount = 1; mStatCalculatingJobs = 0; startThread(QThread::HighPriority); } CPreprocessingThread::~CPreprocessingThread() { stopThread(); } bool CPreprocessingThread::preprocess(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList, CCallbackData* callback) { postEvent(new CPreprocessOntologyEvent(ontology,config,requirementList,callback)); return true; } bool CPreprocessingThread::preprocess(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList) { CBlockingCallbackData callback; postEvent(new CPreprocessOntologyEvent(ontology,config,requirementList,&callback)); callback.waitForCallback(); return true; } bool CPreprocessingThread::callbackPreprocessed(CConcreteOntology* ontology, CCallbackData* callback) { bool callbackPreprocessedOnto = false; CPreprocessing* preprocessing = ontology->getPreprocessing(); if (preprocessing && preprocessing->isPreprocessed()) { callbackPreprocessedOnto = true; if (callback) { callback->doCallback(); } } else { CBlockingCallbackData callbackBlock; postEvent(new CCallbackPreprocessedOntologyEvent(ontology,&callbackBlock,callback)); callbackBlock.waitForCallback(); CCallbackDataContext* callbackContext = callbackBlock.getCallbackDataContext(); if (callbackContext) { CPreprocessingCallbackDataContext* possCallbackContext = dynamic_cast(callbackContext); callbackPreprocessedOnto = possCallbackContext->isPreprocessed(); } } return callbackPreprocessedOnto; } bool CPreprocessingThread::canProcessMoreTests() { return mCurrRunningTestParallelCount < mConfMaxTestParallelCount; } bool CPreprocessingThread::doNextPendingTests() { bool createdNewTests = false; bool nextTestCreated = true; while (canProcessMoreTests() && nextTestCreated) { nextTestCreated = false; bool workCreated = createNextTest(); if (workCreated) { nextTestCreated = true; createdNewTests = true; } else { nextTestCreated = false; } } return createdNewTests; } CPreprocessingThread* CPreprocessingThread::processCalculationJob(CSatisfiableCalculationJob* job, COntologyPreprocessingItem* preCompItem, CPreprocessingTestingItem* preTestItem) { CPreprocessingCalculatedCallbackEvent* callbackEvent = new CPreprocessingCalculatedCallbackEvent(this,job,preTestItem); preCompItem->getPreprocessingTestingItemSet()->insert(preTestItem); mCurrRunningTestParallelCount++; ++mStatCalculatingJobs; if (!mCalculationManager) { mCalculationManager = mReasoner->getCalculationManager(); } if (mCalculationManager) { mCalculationManager->calculateJob(job,callbackEvent); } else { mReasoner->reasoningSatisfiableCalcualtionJob(job,callbackEvent); } return this; } COntologyPreprocessingItem* CPreprocessingThread::initializeOntologyPreprocessingItem(CConcreteOntology* ontology, CConfigurationBase* config) { COntologyPreprocessingItem* item = new COntologyPreprocessingItem(); item->initPreprocessingItem(ontology,config); return item; } bool CPreprocessingThread::addOntologyPreprocessingCallback(COntologyPreprocessingItem* item, CCallbackData* callback) { item->addPreprocessingFinishedCallback(callback); return true; } bool CPreprocessingThread::addOntologyPreprocessingRequirements(COntologyPreprocessingItem* item, COntologyProcessingRequirement* requirement) { item->addProcessingRequirement(requirement); return true; } bool CPreprocessingThread::processCustomsEvents(QEvent::Type type, CCustomEvent* event) { if (CThread::processCustomsEvents(type,event)) { return true; } else if (type == CPreprocessOntologyEvent::EVENTTYPE) { CPreprocessOntologyEvent* poe = (CPreprocessOntologyEvent*)event; CCallbackData* callbackData = poe->getCallbackData(); CConfigurationBase* configBase = poe->getConfiguration(); CConcreteOntology* ontology = poe->getOntology(); QList* requirementList = poe->getPreprocessingRequirementList(); COntologyPreprocessingItem* item = mOntItemHash.value(ontology); if (!item) { item = initializeOntologyPreprocessingItem(ontology,configBase); mOntItemHash.insert(ontology,item); mActiveOntItemSet.insert(item); mProcessingOntItemList.append(item); } else { if (!mActiveOntItemSet.contains(item)) { mInactiveOntItemSet.remove(item); mActiveOntItemSet.insert(item); mProcessingOntItemList.append(item); } } for (QList::const_iterator it = requirementList->constBegin(), itEnd = requirementList->constEnd(); it != itEnd; ++it) { COntologyProcessingRequirement* requ(*it); addOntologyPreprocessingRequirements(item,requ); } if (callbackData) { addOntologyPreprocessingCallback(item,callbackData); } doNextPendingTests(); return true; } else if (type == CCallbackPreprocessedOntologyEvent::EVENTTYPE) { CCallbackPreprocessedOntologyEvent* cpoe = (CCallbackPreprocessedOntologyEvent*)event; CConcreteOntology* ontology = cpoe->getOntology(); CCallbackData* preprocessedCallbackData = cpoe->getPreprocessedCallbackData(); CCallbackData* installedCallbackData = cpoe->getCallbackPossibleCallbackData(); COntologyPreprocessingItem* item = mOntItemHash.value(ontology); if (item) { addOntologyPreprocessingCallback(item,preprocessedCallbackData); if (installedCallbackData) { CPreprocessingCallbackDataContext* callbackDataContext = new CPreprocessingCallbackDataContext(true,ontology); installedCallbackData->setCallbackDataContext(callbackDataContext); installedCallbackData->doCallback(); } } else { if (installedCallbackData) { CPreprocessingCallbackDataContext* callbackDataContext = new CPreprocessingCallbackDataContext(false,ontology); installedCallbackData->setCallbackDataContext(callbackDataContext); installedCallbackData->doCallback(); } } return true; } else if (type == CPreprocessingCalculatedCallbackEvent::EVENTTYPE) { CPreprocessingCalculatedCallbackEvent* pcce = (CPreprocessingCalculatedCallbackEvent*)event; --mCurrRunningTestParallelCount; CPreprocessingTestingItem* testingItem = pcce->getTestingItem(); COntologyPreprocessingItem* ontPreproItem = testingItem->getOntologyPreprocessingItem(); ontPreproItem->getPreprocessingTestingItemSet()->remove(testingItem); preprocessingTested(ontPreproItem,testingItem,pcce); doNextPendingTests(); return true; } return false; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/COntologyConfigDependedPreProcesser.cpp0000644000175000017500000003244512520551224031730 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyConfigDependedPreProcesser.h" namespace Konclude { namespace Reasoner { namespace Preprocess { COntologyConfigDependedPreProcesser::COntologyConfigDependedPreProcesser(CCommandRecordRouter &commandRecRouter) : CLogIdentifier("::Konclude::Preprocess::Preprocessor",this) { commandRecordRouter = new CCommandRecordRouter(commandRecRouter,this); } COntologyConfigDependedPreProcesser::COntologyConfigDependedPreProcesser() : CLogIdentifier("::Konclude::Preprocess::Preprocessor",this) { commandRecordRouter = nullptr; } COntologyConfigDependedPreProcesser::~COntologyConfigDependedPreProcesser() { delete commandRecordRouter; } COntologyConfigDependedPreProcesser* COntologyConfigDependedPreProcesser::reportLog(const QString& string) { if (commandRecordRouter) { CUnspecifiedMessageInformationRecord::makeRecord(string,commandRecordRouter); } else { LOG(INFO,getLogDomain(),string,this); } return this; } CConcreteOntology *COntologyConfigDependedPreProcesser::preprocess(CConcreteOntology *ontology, CConfiguration *config) { CPreProcessContextBase preprocessingContext(ontology,config); if (CConfigDataReader::readConfigBoolean(config,"Konclude.Debugging.WriteDebuggingData",false)) { COntologyTextFormater::writeOntologyToFile(ontology,"buildedTBox.txt"); } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing",true)) { if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.NegationNormalization",true)) { COntologyPreProcess *negNorm = new CNegationTransformationPreProcess(); reportLog("Starting negation transformation preprocessing."); negNorm->preprocess(ontology,&preprocessingContext); reportLog("Stopped negation transformation preprocessing."); delete negNorm; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.SubroleTransformation",true)) { COntologyPreProcess *subRoleNorm = new CSubroleTransformationPreProcess(); reportLog("Starting subrole transformation preprocessing."); subRoleNorm->preprocess(ontology,&preprocessingContext); reportLog("Stopped subrole transformation preprocessing."); delete subRoleNorm; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.DatatypeNormalizer",true)) { COntologyPreProcess* datatypeNorm = new CDatatypeNormalizerPreProcess(); reportLog("Starting datatype normalization preprocessing."); datatypeNorm->preprocess(ontology,&preprocessingContext); reportLog("Stopped datatype normalization preprocessing."); delete datatypeNorm; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.DataLiteralValueNormalizer",true)) { COntologyPreProcess* dataLitNorm = new CDataLiteralNormalizerPreProcess(); reportLog("Starting data literal values normalization preprocessing."); dataLitNorm->preprocess(ontology,&preprocessingContext); reportLog("Stopped data literal values normalization preprocessing."); delete dataLitNorm; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Debugging.WriteDebuggingData",false)) { COntologyTextFormater::writeOntologyToFile(ontology,"unprocessedTBox.txt"); } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.NominalSchemaTemplateExtraction",true)) { COntologyPreProcess *onPreProc = new CNominalSchemaTemplateExtractionPreProcess(); reportLog("Starting nominal schema template extraction preprocessing."); onPreProc->preprocess(ontology,&preprocessingContext); reportLog("Stopped nominal schema template extraction preprocessing."); delete onPreProc; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.NominalSchemaGrounding",true)) { COntologyPreProcess *onPreProc = new CFullNominalSchemaGroundingPreProcess(); reportLog("Starting full nominal schema grounding preprocessing."); onPreProc->preprocess(ontology,&preprocessingContext); reportLog("Stopped full nominal schema grounding preprocessing."); delete onPreProc; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Debugging.WriteDebuggingData",false)) { COntologyTextFormater::writeOntologyToFile(ontology,"groundedTBox.txt"); } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.GCIAbsorption.TriggeredImplicationBinaryGCIAbsorption",true)) { COntologyPreProcess *triggImplNorm = new CTriggeredImplicationBinaryAbsorberPreProcess(); reportLog("Starting triggered implication binary GCI absorption preprocessing."); triggImplNorm->preprocess(ontology,&preprocessingContext); reportLog("Stopped triggered implication binary GCI absorption preprocessing."); delete triggImplNorm; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Debugging.WriteDebuggingData",false)) { COntologyTextFormater::writeOntologyToFile(ontology,"partialProcessedTBox.txt"); } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.RoleChainAutomataTransformation",true)) { COntologyPreProcess *onPreProc = new CRoleChainAutomataTransformationPreProcess(); reportLog("Starting role chain automata transformation preprocessing."); onPreProc->preprocess(ontology,&preprocessingContext); reportLog("Stopped role chain automata transformation preprocessing."); delete onPreProc; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.LexicalNormalization",true)) { COntologyPreProcess *legNorm = new CLexicalNormalisationPreProcess(); reportLog("Starting lexical normalization preprocessing."); legNorm->preprocess(ontology,&preprocessingContext); reportLog("Stopped lexical normalization preprocessing."); delete legNorm; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.BranchTriggerExtraction",true)) { COntologyPreProcess *braTrigTran = new CBranchTriggerPreProcess(); reportLog("Starting branch trigger generation preprocessing."); braTrigTran->preprocess(ontology,&preprocessingContext); reportLog("Stopped branch trigger generation preprocessing."); delete braTrigTran; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.CommonDisjunctConceptExtraction",true)) { COntologyPreProcess *commDisConExt = new CCommonDisjunctConceptExtractionPreProcess(); reportLog("Starting common disjunct concept extraction preprocessing."); commDisConExt->preprocess(ontology,&preprocessingContext); reportLog("Stopped common disjunct concept extraction preprocessing."); delete commDisConExt; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.DisjunctSorting",true)) { COntologyPreProcess *sortDisjPre = new CDisjunctSortingPreProcess(); reportLog("Starting disjunct sorting preprocessing."); sortDisjPre->preprocess(ontology,&preprocessingContext); reportLog("Stopped disjunct sorting preprocessing."); delete sortDisjPre; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.OntologyAssignmentTransformation",true)) { COntologyPreProcess *ontAssignNorm = new COntologyAssignmentTransformationPreProcess(ontology); reportLog("Starting ontology revision assignment preprocessing."); ontAssignNorm->preprocess(ontology,&preprocessingContext); reportLog("Stopped ontology revision assignment preprocessing."); delete ontAssignNorm; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.OntologyMappingUpdate",true)) { COntologyPreProcess *onPreProc = new CMappingUpdaterPreProcess(); reportLog("Starting ontology mapping update preprocessing."); onPreProc->preprocess(ontology,&preprocessingContext); reportLog("Stopped ontology mapping update preprocessing."); delete onPreProc; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.ProcessingDataExtender",true)) { COntologyPreProcess *onPreProc = new CDataExtenderPreProcess(); reportLog("Starting processing data extender preprocessing."); onPreProc->preprocess(ontology,&preprocessingContext); reportLog("Stopped processing data extender preprocessing."); delete onPreProc; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.ReverseRoleAssertionGeneration",true)) { COntologyPreProcess *onPreProc = new CReverseRoleAssertionGeneratorPreProcess(); reportLog("Starting reverse role assertion generation."); onPreProc->preprocess(ontology,&preprocessingContext); reportLog("Stopped reverse role assertion generation."); delete onPreProc; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.OntologyStructureInspection",true)) { COntologyPreProcess *onPreProc = new COntologyStructureInspectionPreProcess(); reportLog("Starting ontology structure inspection preprocessing."); onPreProc->preprocess(ontology,&preprocessingContext); reportLog("Stopped ontology structure inspection preprocessing."); delete onPreProc; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.ExtractPropagationIntoCreationDirection",true)) { COntologyPreProcess *onPreProc = new CExtractPropagationIntoCreationDirectionPreProcess(); reportLog("Starting extraction for propagations into creation direction preprocessing."); onPreProc->preprocess(ontology,&preprocessingContext); reportLog("Stopped extraction for propagations into creation direction preprocessing."); delete onPreProc; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.CoreBlockingConceptMarking",true)) { COntologyPreProcess *onPreProc = new CCoreBlockingConceptMarkerPreProcess(); reportLog("Starting marking core blocking concept preprocessing."); onPreProc->preprocess(ontology,&preprocessingContext); reportLog("Stopped marking core blocking concept preprocessing."); delete onPreProc; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.RelevantConceptRoleMarker",false)) { COntologyPreProcess *onPreProc = new CExtractRelevantConceptRolePreProcess(); reportLog("Starting marking relevant concepts and roles preprocessing."); onPreProc->preprocess(ontology,&preprocessingContext); reportLog("Stopped marking relevant concepts and roles preprocessing."); delete onPreProc; } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.CoreConceptCyclesExtraction",true)) { COntologyPreProcess *onPreProc = new CCoreOntologyCyclesExtractorPreProcess(); reportLog("Starting extracting core concept cycles preprocessing."); onPreProc->preprocess(ontology,&preprocessingContext); reportLog("Stopped extracting core concept cycles preprocessing."); delete onPreProc; } //if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.CheckingOntologyConsistency",true)) { // COntologyPreProcess *onPreProc = new CConsistenceCheckerPreProcess(config); // reportLog("Starting checking ontology consistency preprocessing."); // onPreProc->preprocess(ontology,&preprocessingContext); // reportLog("Stopped checking ontology consistency preprocessing."); // delete onPreProc; //} //} if (CConfigDataReader::readConfigBoolean(config,"Konclude.Debugging.WriteDebuggingData",false)) { COntologyTextFormater::writeOntologyToFile(ontology,"preprocessedTBox.txt"); } //if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.OntologyPrecomputation",true)) { // COntologyPreProcess *onPreProc = new CPrecomputationPreProcess(); // reportLog("Starting ontology preprocessing precomputation."); // onPreProc->preprocess(ontology,&preprocessingContext); // reportLog("Stopped ontology preprocessing precomputation."); // delete onPreProc; //} } return ontology; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CDatatypeNormalizerPreProcess.h0000644000175000017500000001024712520551220030263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CDATATYPENORMALIZERPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CDATATYPENORMALIZERPREPROCESS_H // Libraries includes #include // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" // Other includes #include "Reasoner/Ontology/CBoxContext.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CMBox.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CDatatypeNormalizerPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeNormalizerPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CDatatypeNormalizerPreProcess(); //! Destructor virtual ~CDatatypeNormalizerPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: CDatatypeNormalizerPreProcess* normalizeDatatype(CDatatype* datatype, CPreProcessContext* context); CConcept* createDatatypeConcept(CDatatype* datatype); CConcept* createConcept(); CConcept* addConceptOperand(CConcept* concept, CConcept* operand, bool negated); CDatatype* getDatatype(const QString& datatypeIRI); CConcept* getNumberRestrictionConcept(cint64 restrictionCode, const QString& value); CConcept* getIntegerRestrictionConcept(); CConcept* getStringRestrictionConcept(); CConcept* getNormalizedStringRestrictionConcept(); CConcept* getTokenRestrictionConcept(); CConcept* getNMTokenRestrictionConcept(); CConcept* getNameRestrictionConcept(); CConcept* getNCNameRestrictionConcept(); CConcept* getLanguageRestrictionConcept(); CConcept* getDateTimeStampRestrictionConcept(); // private methods private: // private variables private: CABox* mABox; CTBox* mTBox; CRBox* mRBox; CMBox* mMBox; CIndividualVector* mIndiVec; CRoleVector* mRolesVector; CConceptVector* mConceptVector; CConcreteOntology* mOntology; CConcept* mTopDataRangeConcept; CDatatypeVector* mDatatypeVector; CDatatypeValueSpaceTypes* mValueSpaceTypes; QHash mIRIDatatypeHash; CBUILDHASH* mDataRangeConceptHash; CBUILDHASH* mConceptDataRangeHash; CBUILDHASH* mDatatypeExpressionDatatpyeHash; CBUILDHASH* mDatatpyeDatatypeExpressionHash; CMemoryAllocationManager* mMemMan; QHash< QPair,CConcept* > mNumberRestrictionConceptHash; CConcept* mIntegerRestrictionConcept; CConcept* mStringRestrictionConcept; CConcept* mNormalizedStringRestrictionConcept; CConcept* mTokenRestrictionConcept; CConcept* mNMTokenRestrictionConcept; CConcept* mNameRestrictionConcept; CConcept* mNCNameRestrictionConcept; CConcept* mLanguageRestrictionConcept; CConcept* mDatetimeStampRestrictionConcept; }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CDATATYPENORMALIZERPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CLexicalNormalisationPreProcess.h0000644000175000017500000000561212520551222030570 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CLEXICALNORMALISATIONPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CLEXICALNORMALISATIONPREPROCESS_H // Libraries includes // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptUnambiguousHasher.h" // Other includes #include "Utilities/CHashableIntConvertedNTuble.hpp" #include "Utilities/CMemoryManager.hpp" #include "Utilities/CDynamicExpandingMemoryManager.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Preprocess { /*! * * \class CLexicalNormalisationPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief Not thread safe * */ class CLexicalNormalisationPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CLexicalNormalisationPreProcess(); //! Destructor virtual ~CLexicalNormalisationPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: void negateOperandConcepts(CConcept *concept, int firstNegationOperand = 0); void addNormalizeConcept(CConcept *concept); void normalizeListedConcepts(); void normalizeConcept(CConcept *concept, bool isLocal); CConceptUnambiguousHasher getConceptHasher(CConcept *concept); CSortedNegLinker* resortConceptLinkersByTagging(CSortedNegLinker* conceptLinkers); // private methods private: // private variables private: CConcept *topConcept; QHash* replacementHash; QHash< CConcept*,QPair >* conceptReplaceHash; QSet* processedSet; QList* processingList; CMemoryAllocationManager* mBoxMemMan; CConceptVector *concepts; CRoleVector *roles; CIndividualVector *individuals; }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CLEXICALNORMALISATIONPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CExtractRelevantConceptRolePreProcess.cpp0000644000175000017500000001020712520551222032247 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExtractRelevantConceptRolePreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CExtractRelevantConceptRolePreProcess::CExtractRelevantConceptRolePreProcess() { } CExtractRelevantConceptRolePreProcess::~CExtractRelevantConceptRolePreProcess() { } CConcreteOntology* CExtractRelevantConceptRolePreProcess::preprocess(CConcreteOntology* ontology, CPreProcessContext* context) { bool nonELConstructsUsed = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags()->isNonELConstructUsed(); if (!nonELConstructsUsed) { CMBox* mBox = ontology->getDataBoxes()->getMBox(); CTBox* tBox = ontology->getDataBoxes()->getTBox(); CRBox* rBox = ontology->getDataBoxes()->getRBox(); CABox* aBox = ontology->getDataBoxes()->getABox(); CConceptVector* conceptVec = tBox->getConceptVector(); cint64 conceptCount = tBox->getConceptCount(); CRoleVector* roleVec = rBox->getRoleVector(); cint64 markedPropagationIntoCreationDirectionConceptCount = 0; QHash creationRoleHash; for (cint64 conIdx = 0; conIdx < conceptCount; ++conIdx) { CConcept* concept = conceptVec->getData(conIdx); if (concept) { CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_AQALL_TYPE)) { CRole* role = concept->getRole(); CRoleProcessData* roleData = (CRoleProcessData*)role->getRoleData(); if (roleData) { roleData->setInferRelevantFlag(true); } } if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ABSORPTION_RELEVANT_TYPE)) { CConceptProcessData* conceptData = (CConceptProcessData*)concept->getConceptData(); if (conceptData) { conceptData->setInferRelevantFlag(true); } for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); CConceptProcessData* opConceptData = (CConceptProcessData*)opConcept->getConceptData(); if (opConceptData) { opConceptData->setInferRelevantFlag(true); } } } } } for (cint64 conIdx = 0; conIdx < conceptCount; ++conIdx) { CConcept* concept = conceptVec->getData(conIdx); if (concept) { CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_AQALL_TYPE | CConceptOperator::CCFS_POSSIBLE_ROLE_CREATION_TYPE)) { CRole* role = concept->getRole(); if (creationRoleHash.contains(role)) { CConceptProcessData* conProData = (CConceptProcessData*)concept->getConceptData(); if (conProData) { ++markedPropagationIntoCreationDirectionConceptCount; conProData->setPropagationIntoCreationDirection(true); } } } } } LOG(INFO,"::Konclude::Reasoner::Preprocess::PropagationIntoCreationDirectionExtractor",logTr("Marked %1 concepts with possibly propagation into creation direction.").arg(markedPropagationIntoCreationDirectionConceptCount),this); } return ontology; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CTriggeredImplicationBinaryAbsorberPreProcess.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CTriggeredImplicationBinaryAbsorberPreProc0000644000175000017500000052025612600441664032455 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTriggeredImplicationBinaryAbsorberPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { #ifdef KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED #define KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(a) #else //#define KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(a) a #define KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(a) #endif CTriggeredImplicationBinaryAbsorberPreProcess::CTriggeredImplicationBinaryAbsorberPreProcess() { mConfRequiresExistingInverseRole = false; mConfAbsorbEqClassDefinitions = true; mConfAbsorbDisjunctions = true; mConfAbsorbSimpleDisjunctions = true; mConfPartialGCIAbsorption = true; mConfPartialAbsorbEqClassDefinitions = true; mConfPartialDisjunctionsAbsorption = true; mConfOnlyPositiveDisjunctionsAbsorption = true; mConfNominalSchemaPathPreabsorption = true; mConfNominalSchemaBackPropagation = true; mConfNominalSchemaBackPropagationMultiTrigger = true; mConfImplicationsForTriggerReusue = true; mConfOftenTriggerUseCountPunishment = 20; mConfPunishOftenSameTriggerUse = true; mConfDatatypeAbsorption = true; } CTriggeredImplicationBinaryAbsorberPreProcess::~CTriggeredImplicationBinaryAbsorberPreProcess() { } CConcreteOntology *CTriggeredImplicationBinaryAbsorberPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { CMBox *mBox = ontology->getDataBoxes()->getMBox(); CTBox *tBox = ontology->getDataBoxes()->getTBox(); CRBox *rBox = ontology->getDataBoxes()->getRBox(); CABox *aBox = ontology->getDataBoxes()->getABox(); mMBox = mBox; mTBox = tBox; mTmpTriggerLinker = nullptr; mConceptVec = tBox->getConceptVector(); cint64 conceptCount = mConceptVec->getItemCount(); CRoleVector *roles = rBox->getRoleVector(); CConcept *topConcept = tBox->getTopConcept(); mBottomConcept = tBox->getBottomConcept(); mTopConcept = tBox->getTopConcept(); mMemMan = ontology->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); mOnto = ontology; CConfiguration* config = context->getConfiguration(); mConfAbsorbDisjunctions = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.DisjunctionToImplicationAbsorption",true); mConfAbsorbSimpleDisjunctions = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.DisjunctionToImplicationAbsorptionByExistingTriggers",true); mConfAbsorbEqClassDefinitions = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.EquivalentDefinitionToSubclassImplicationAbsorption",true); mConfPartialGCIAbsorption = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.PartialGCIImplicationAbsorption",true); mConfPartialAbsorbEqClassDefinitions = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.PartialEquivalentDefinitionToCandidatesAbsorption",true); mConfPartialDisjunctionsAbsorption = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.PartialDisjunctionAbsorption",true); mConfNominalSchemaBackPropagation = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.NominalSchemaBackPropagation",true); mConfNominalSchemaPathPreabsorption = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.NominalSchemaPathPreabsorption",true); mConfDatatypeAbsorption = CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Preprocessing.DatatypeAbsorption",true); mConfNominalSchemaPathPreabsorption = false; CImplicationReplacementVector* impRepVec = nullptr; if (mConfAbsorbDisjunctions || mConfAbsorbSimpleDisjunctions) { impRepVec = mBox->getImplicationReplacementVector(true); } mTriggerImplHash = tBox->getTriggerImplicationHash(true); mEquivConCandidateHash = tBox->getEquivalentConceptCandidateHash(true); mCandidateEquivConHash = tBox->getCandidateEquivalentConceptHash(true); mEquivConNonCandidateSet = tBox->getEquivalentConceptNonCandidateSet(true); mRoleDomainTriggerConceptHash = tBox->getRoleDomainTriggerConceptHash(false); mIndividualTriggerConceptHash = tBox->getIndividualTriggerConceptHash(false); mBranchTriggVec = mBox->getBranchingTriggerVector(); mNomSchemaTemplVec = mBox->getNominalSchemaTemplateVector(false); mNextVariableID = 0; mStatInvRolesGenerated = 0; mStatGCIAbsorbed = 0; mStatGCINormalAbsorbed = 0; mStatGCINormalSchemaAbsorbed = 0; mStatGCITotal = 0; mStatEqAbsorbed = 0; mStatEqTotal = 0; mStatImplConceptsGenerated = 0; mStatGCIAbsorptionPartialExtended = 0; mStatGCIPartialAbsorbed = 0; mStatReusedImplications = 0; mStatOptimizedRemovedTriggers = 0; if (ontology->getIncrementalRevisionData()->isIncrementalOntology()) { if (ontology->getIncrementalRevisionData()->getAxiomChangeData()->hasChangedABoxAxioms()) { CIndividualVector* indiVec = aBox->getIndividualVector(false); if (indiVec && mIndividualTriggerConceptHash) { for (CBOXHASH::const_iterator it = mIndividualTriggerConceptHash->constBegin(), itEnd = mIndividualTriggerConceptHash->constEnd(); it != itEnd; ++it) { cint64 indiID = it.key(); CConcept* triggerConcept = it.value(); CIndividual* locIndi = indiVec->getLocalData(indiID); if (locIndi) { CConceptAssertionLinker* assLinker = CObjectAllocator< CConceptAssertionLinker >::allocateAndConstruct(mMemMan); assLinker->initNegLinker(triggerConcept,false); locIndi->addAssertionConceptLinker(assLinker); } } } } } if (mConfAbsorbEqClassDefinitions) { QList equivConceptAbsorbItemList; QList equivConceptNotAbsorbList; // try to absorb equivalent classes expressions for (cint64 conIdx = 0; conIdx < conceptCount; conIdx++) { CConcept* concept = mConceptVec->getLocalData(conIdx); if (concept) { cint64 opCode = concept->getOperatorCode(); if (opCode == CCEQ) { ++mStatEqTotal; if (isEquivalenceConceptTriggeredImplicationAbsorbable(concept,false)) { // absorb to subclass and implication trigger concept->setOperatorCode(CCSUB); equivConceptAbsorbItemList.append(CAbsorpEquivalentClassItem(concept,concept->getOperandList())); ++mStatEqAbsorbed; } else { equivConceptNotAbsorbList.append(concept); } } } } //foreach (CConcept* concept, equivConceptAbsorbList) { // createEquivalenceAbsorbedTriggeredImplication(concept,false); //} foreach (const CAbsorpEquivalentClassItem& eqConceptAbsItem, equivConceptAbsorbItemList) { createEquivalenceAbsorbedTriggeredImplication(eqConceptAbsItem.mEqConcept,false,eqConceptAbsItem.mAbsorpOpLinker); } foreach (CConcept* concept, equivConceptNotAbsorbList) { //QString iriClassNameString = CIRIName::getRecentIRIName(concept->getClassNameLinker()); //if (iriClassNameString == "http://rewerse.net/I5/NS/2006/r3#LanguageResource") { // COntologyTextFormater::writeOntologyToFile(ontology,"xyztTBox.txt"); // bool bug = true; //} if (mConfPartialAbsorbEqClassDefinitions && isEquivalenceConceptCandidateExtractable(concept,false)) { CConcept* candidateTriggerConcept = getEquivalenceConceptCandidateTriggeredImplication(concept,false); CConcept* eqConCand = createCandidateEquivalentConcept(concept); addUnfoldingConceptForConcept(candidateTriggerConcept,eqConCand,false); mEquivConCandidateHash->insert(concept,eqConCand); mCandidateEquivConHash->insert(eqConCand,concept); } else { mEquivConNonCandidateSet->insert(concept); } } } mFirstNewConceptTag = mConceptVec->getItemCount(); mLastNewConceptTag = mFirstNewConceptTag; if (topConcept) { CSortedNegLinker* gciConLinker = topConcept->getOperandList(); QList< TConceptNegationPair > replaceConceptList; CSortedNegLinker* lastgciConLinker = nullptr; CSortedNegLinker* gciConLinkerIt = gciConLinker; while (gciConLinkerIt) { CConcept* opCon = gciConLinkerIt->getData(); bool opNegation = gciConLinkerIt->isNegated(); bool removed = false; cint64 opCode = opCon->getOperatorCode(); if (!opNegation && opCode == CCAND || opNegation && opCode == CCOR) { collectConjunctions(opCon,opNegation,replaceConceptList); removed = true; } if (removed) { if (lastgciConLinker) { lastgciConLinker->setNext(gciConLinkerIt->getNext()); } else { topConcept->setOperandList(gciConLinkerIt->getNext()); } topConcept->incOperandCount(-1); } else { lastgciConLinker = gciConLinkerIt; } gciConLinkerIt = gciConLinkerIt->getNext(); } for (QList< TConceptNegationPair >::const_iterator it = replaceConceptList.constBegin(), itEnd = replaceConceptList.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); addConceptToImplied(topConcept,conNegPair.first,conNegPair.second); } lastgciConLinker = nullptr; gciConLinker = topConcept->getOperandList(); gciConLinkerIt = gciConLinker; while (gciConLinkerIt) { CConcept* opCon = gciConLinkerIt->getData(); bool opNegation = gciConLinkerIt->isNegated(); ++mStatGCITotal; bool absorbed = false; mFirstNewConceptTag = mLastNewConceptTag; //QString iriClassNameString = CIRIName::getRecentIRIName(opCon->getOperandList()->getData()->getClassNameLinker()); //if (iriClassNameString == "http://purl.org/imbi/dco/dco#BacterialInfectiousPathologicalProcess") { // COntologyTextFormater::writeOntologyToFile(ontology,"xyztTBox.txt"); // bool bug = true; //} KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(mDebugLastGCIString = generateDebugGCIConceptString(opCon,opNegation)); if (absorbNominalSchemaGCIConceptsToTriggeredImplications(opCon,opNegation)) { ++mStatGCINormalSchemaAbsorbed; absorbed = true; } if (!absorbed && absorbGCIConceptsToTriggeredImplications(opCon,opNegation)) { ++mStatGCINormalAbsorbed; KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(mDebugLastAbsorbedGCITechniqueString = QString("implication absorbed")); absorbed = true; } if (!absorbed && mConfPartialGCIAbsorption) { if (absorbPartialGCIConceptsToTriggeredImplications(opCon,opNegation)) { ++mStatGCIPartialAbsorbed; KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(mDebugLastAbsorbedGCITechniqueString = QString("partial implication absorbed")); absorbed = true; } } if (absorbed) { ++mStatGCIAbsorbed; mLastNewConceptTag = mConceptVec->getItemCount(); KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(mDebugLastAbsorbedGCIConceptString = generateDebugGeneratedAbsorbedImplicationString(mFirstNewConceptTag,mLastNewConceptTag)); KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(mDebugLastAbsorbedGCIString = QString("GCI:
\r\n
\r\n%1
\r\n%2 to
\r\n
\r\n%3

\r\n\r\n").arg(mDebugLastGCIString).arg(mDebugLastAbsorbedGCITechniqueString).arg(mDebugLastAbsorbedGCIConceptString)); KONCLUCE_PREPROCESSING_TRIGGERED_IMPLICATION_STRING_INSTRUCTION(mDebugTotalAbsorbedGCIString += mDebugLastAbsorbedGCIString); if (lastgciConLinker) { lastgciConLinker->setNext(gciConLinkerIt->getNext()); } else { topConcept->setOperandList(gciConLinkerIt->getNext()); } topConcept->incOperandCount(-1); } else { lastgciConLinker = gciConLinkerIt; } gciConLinkerIt = gciConLinkerIt->getNext(); } } QSet positiveConceptReferencedSet; if (mConfOnlyPositiveDisjunctionsAbsorption) { for (cint64 conIdx = 0; conIdx < conceptCount; conIdx++) { CConcept* concept = mConceptVec->getData(conIdx); if (concept && concept->hasClassName()) { collectPositiveConcepts(concept,false,&positiveConceptReferencedSet); } } } if (mConfAbsorbDisjunctions || mConfPartialDisjunctionsAbsorption || mConfAbsorbSimpleDisjunctions) { for (cint64 conIdx = 0; conIdx < conceptCount; conIdx++) { bool localRepData = false; CReplacementData* prevReplData = impRepVec->getData(conIdx,&localRepData); CConcept* concept = mConceptVec->getLocalData(conIdx); if (concept && (!prevReplData || !localRepData)) { cint64 opCode = concept->getOperatorCode(); bool absorbable = false; bool absorbNeg = false; bool absorbPos = false; bool partialAbsorbable = false; cint64 opCount = concept->getOperandCount(); if (opCount > 1) { if (opCode == CCAND) { absorbNeg = true; absorbPos = true; } else if (opCode == CCOR) { absorbNeg = false; absorbPos = true; } if (absorbPos) { if (!mConfOnlyPositiveDisjunctionsAbsorption || positiveConceptReferencedSet.contains(TConceptNegationPair(concept,absorbNeg))) { if (mConfAbsorbSimpleDisjunctions && isDisjunctionConceptSimpleTriggeredImplicationAbsorbable(concept,absorbNeg)) { absorbable = true; } else if (mConfAbsorbDisjunctions && isDisjunctionConceptTriggeredImplicationAbsorbable(concept,absorbNeg)) { // add implication trigger absorption absorbable = true; } else if (mConfPartialDisjunctionsAbsorption && isDisjunctionConceptPartialTriggeredImplicationAbsorbable(concept,absorbNeg)) { partialAbsorbable = true; } } } CConcept* absorbedImpCon = nullptr; if (absorbable) { absorbedImpCon = createDisjunctionAbsorbedTriggeredImplication(concept,absorbNeg); } if (absorbedImpCon) { CReplacementData* replData = prevReplData; if (!localRepData) { replData = CObjectAllocator::allocateAndConstruct(mMemMan); replData->initReplacementData(prevReplData); impRepVec->setData(concept->getConceptTag(),replData); } replData->setImplicationReplacementConcept(absorbedImpCon); } else if (partialAbsorbable) { CConceptRoleBranchingTrigger* branchingTriggers = createDisjunctionPartialAbsorbedBranchTriggers(concept,absorbNeg); mBranchTriggVec->setData(conIdx,branchingTriggers); } } } } } for (QList*>::const_iterator it = mLaterTopConceptTriggerAddList.constBegin(), itEnd = mLaterTopConceptTriggerAddList.constEnd(); it != itEnd; ++it) { CSortedNegLinker* newOpLinker = *it; topConcept->addOperandLinker(newOpLinker); topConcept->incOperandCount(); } asorbForallsToRanges(topConcept); mStatInvRolesGenerated = mRoleInverseRoleCreateHash.count(); CConcreteOntologyInverseRoleBuilder::createDelayedInverseRoles(&mRoleInverseRoleCreateHash,mOnto); optimizeTriggerStructure(); qDeleteAll(mTriggerContainer); mTriggerContainer.clear(); LOG(INFO,"::Konclude::Reasoner::Preprocess::TriggeredImplicationAbsorber",logTr("Absorbed %1 of %2 equivalence class definitions.").arg(mStatEqAbsorbed).arg(mStatEqTotal),this); LOG(INFO,"::Konclude::Reasoner::Preprocess::TriggeredImplicationAbsorber",logTr("Absorbed %1 of %2 GCI definitions.").arg(mStatGCIAbsorbed).arg(mStatGCITotal),this); if (mStatGCITotal > 0) { LOG(INFO,"::Konclude::Reasoner::Preprocess::TriggeredImplicationAbsorber",logTr("Absorbed %1 GCI definitions only partially and extended %2 absorptions partially.").arg(mStatGCIPartialAbsorbed).arg(mStatGCIAbsorptionPartialExtended),this); } if (mStatGCINormalSchemaAbsorbed > 0) { LOG(INFO,"::Konclude::Reasoner::Preprocess::TriggeredImplicationAbsorber",logTr("Absorbed %1 GCI with nominal schemas.").arg(mStatGCINormalSchemaAbsorbed),this); } LOG(INFO,"::Konclude::Reasoner::Preprocess::TriggeredImplicationAbsorber",logTr("Generated %1 triggered implication concepts and %2 additional inverse roles.").arg(mStatImplConceptsGenerated).arg(mStatInvRolesGenerated),this); return ontology; } void CTriggeredImplicationBinaryAbsorberPreProcess::asorbForallsToRanges(CConcept* topConcept) { CSortedNegLinker* gciConLinker = topConcept->getOperandList(); CSortedNegLinker* lastgciConLinker = nullptr; CSortedNegLinker* gciConLinkerIt = gciConLinker; while (gciConLinkerIt) { CConcept* opCon = gciConLinkerIt->getData(); bool opNegation = gciConLinkerIt->isNegated(); bool removed = false; cint64 opCode = opCon->getOperatorCode(); if (!opNegation && (opCode == CCALL || opCode == CCIMPLALL) || opNegation && (opCode == CCSOME)) { CRole* role = opCon->getRole(); CRole* locatedRole = CConceptRoleIndividualLocator::getLocatedRole(role,mOnto); for (CSortedNegLinker* opLinkerIt = opCon->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { addRoleRangeConcept(locatedRole,opLinkerIt->getData(),opLinkerIt->isNegated()^opNegation); } removed = true; } if (removed) { if (lastgciConLinker) { lastgciConLinker->setNext(gciConLinkerIt->getNext()); } else { topConcept->setOperandList(gciConLinkerIt->getNext()); } topConcept->incOperandCount(-1); } else { lastgciConLinker = gciConLinkerIt; } gciConLinkerIt = gciConLinkerIt->getNext(); } } bool CTriggeredImplicationBinaryAbsorberPreProcess::collectConjunctions(CConcept* concept, bool negated, QList< TConceptNegationPair >& conjList) { cint64 opCode = concept->getOperatorCode(); if (!negated && opCode == CCAND || negated && opCode == CCOR) { for (CSortedNegLinker* opLinkIt = concept->getOperandList(); opLinkIt; opLinkIt = opLinkIt->getNext()) { CConcept* opConcept = opLinkIt->getData(); bool opNegation = opLinkIt->isNegated()^negated; collectConjunctions(opConcept,opNegation,conjList); } } else { conjList.append(TConceptNegationPair(concept,negated)); } return true; } void CTriggeredImplicationBinaryAbsorberPreProcess::replaceTrigger(CConcept* baseConcept, CConcept* replaceConcept, bool negated) { for (CSortedNegLinker* opLinker = replaceConcept->getOperandList(); opLinker; opLinker = opLinker->getNext()) { CConcept* opConcept = opLinker->getData(); bool replaceOperand = true; bool negatedReplacement = opLinker->isNegated() ^ negated; if (opConcept->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE)/* == CCIMPLTRIG*/) { if (mTriggCountHash[opConcept].mCount <= 1) { replaceOperand = false; replaceTrigger(baseConcept,opConcept,negatedReplacement); } } if (replaceOperand) { ++mStatOptimizedRemovedTriggers; addUnfoldingConceptForConcept(baseConcept,opConcept,negatedReplacement); } } } void CTriggeredImplicationBinaryAbsorberPreProcess::replaceOneTrigger(CConcept* baseConcept, CConcept* replaceConcept, bool negated) { for (CSortedNegLinker* opLinker = replaceConcept->getOperandList(); opLinker; opLinker = opLinker->getNext()) { CConcept* opConcept = opLinker->getData(); bool replaceOperand = true; bool negatedReplacement = opLinker->isNegated() ^ negated; if (opConcept->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE)/* == CCIMPLTRIG*/) { if (mTriggCountHash[opConcept].mCount <= 1) { CSortedNegLinker* opOpLinker = opConcept->getOperandList(); if (opOpLinker && !opOpLinker->getNext() && !opOpLinker->getData()->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_IMPL_TYPE | CConceptOperator::CCF_VARBINDJOIN)/* != CCIMPL*/) { replaceOperand = false; replaceTrigger(baseConcept,opConcept,negatedReplacement); } } } if (replaceOperand) { ++mStatOptimizedRemovedTriggers; addUnfoldingConceptForConcept(baseConcept,opConcept,negatedReplacement); } } } void CTriggeredImplicationBinaryAbsorberPreProcess::optimizeTriggerStructure() { cint64 optimisingRemovedTrigger = 0; cint64 conceptCount = mConceptVec->getItemCount(); for (cint64 conIdx = 0; conIdx < conceptCount; conIdx++) { CConcept* concept = mConceptVec->getData(conIdx); if (concept) { for (CSortedNegLinker* opLinker = concept->getOperandList(); opLinker; opLinker = opLinker->getNext()) { CConcept* opConcept = opLinker->getData(); if (opConcept->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE)/* == CCIMPLTRIG*/) { mTriggCountHash[opConcept].incCount(1); } } } } cint64 brCount = mBranchTriggVec->getItemCount(); for (cint64 brIdx = 0; brIdx < brCount; ++brIdx) { CConceptRoleBranchingTrigger* brTrigger = mBranchTriggVec->getData(brIdx); if (brTrigger) { if (brTrigger->isConceptTrigger()) { CConcept* concept = brTrigger->getTriggerConcept(); if (concept->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE)/* == CCIMPLTRIG*/) { mTriggCountHash[concept].incCount(2); } } } } for (cint64 conIdx = 0; conIdx < conceptCount; conIdx++) { CConcept* concept = mConceptVec->getLocalData(conIdx); if (concept) { cint64 opCode = concept->getOperatorCode(); if (opCode == CCSUB || opCode == CCAND || concept->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE)/*opCode == CCIMPLTRIG*/) { CSortedNegLinker* lastLinker = nullptr; for (CSortedNegLinker* opLinker = concept->getOperandList(); opLinker; opLinker = opLinker->getNext()) { CConcept* opConcept = opLinker->getData(); bool opNegated = opLinker->isNegated(); if (opConcept->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE)/* == CCIMPLTRIG*/) { if (mTriggCountHash[opConcept].mCount <= 1) { ++optimisingRemovedTrigger; concept->incOperandCount(-1); if (lastLinker) { lastLinker->setNext(opLinker->getNext()); replaceTrigger(concept,opConcept,opNegated); } else { replaceTrigger(concept,opConcept,opNegated); CSortedNegLinker* opLinkerIt = concept->getOperandList(); while (opLinkerIt && opLinkerIt->getNext() != opLinker) { opLinkerIt = opLinkerIt->getNext(); } opLinkerIt->setNext(opLinker->getNext()); lastLinker = opLinkerIt; } } else { lastLinker = opLinker; } } } } else if (concept->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_IMPL_TYPE | CConceptOperator::CCF_VARBINDJOIN | CConceptOperator::CCF_VARBINDGROUND)/*opCode == CCIMPL*/) { CSortedNegLinker* opLinker = concept->getOperandList(); if (opLinker) { CConcept* opConcept = opLinker->getData(); bool opNegated = opLinker->isNegated(); if (opConcept->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE)/* == CCIMPLTRIG*/) { if (mTriggCountHash[opConcept].mCount <= 1) { CSortedNegLinker* opOpLinker = opConcept->getOperandList(); if (opOpLinker && !opOpLinker->getNext() && !opOpLinker->getData()->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_IMPL_TYPE | CConceptOperator::CCF_VARBINDJOIN)/* != CCIMPL*/) { ++optimisingRemovedTrigger; concept->setOperandList(opLinker->getNext()); concept->incOperandCount(-1); replaceOneTrigger(concept,opConcept,opNegated); } } } } } else { if (concept->getOperandCount() == 1) { CSortedNegLinker* opLinker = concept->getOperandList(); CConcept* opConcept = opLinker->getData(); bool opNegated = opLinker->isNegated(); if (opConcept->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE)/* == CCIMPLTRIG*/) { if (mTriggCountHash[opConcept].mCount <= 1) { CSortedNegLinker* opOpLinker = opConcept->getOperandList(); if (opOpLinker && !opOpLinker->getNext() && !opOpLinker->getData()->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_IMPL_TYPE | CConceptOperator::CCF_VARBINDJOIN)/* != CCIMPL*/) { ++optimisingRemovedTrigger; concept->setOperandList(nullptr); concept->incOperandCount(-1); replaceOneTrigger(concept,opConcept,opNegated); } } } } } } } } void CTriggeredImplicationBinaryAbsorberPreProcess::collectPositiveConcepts(CConcept* initalConcept, bool initalNegated, QSet* positiveConceptSet) { TConceptNegationPair processConNegPair(initalConcept,initalNegated); if (!positiveConceptSet->contains(processConNegPair)) { positiveConceptSet->insert(processConNegPair); QList processConceptList; processConceptList.append(processConNegPair); while (!processConceptList.isEmpty()) { TConceptNegationPair conNegPair(processConceptList.takeFirst()); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; cint64 opCode = concept->getOperatorCode(); CConceptOperator* conOperator = concept->getConceptOperator(); CSortedNegLinker* opConLinker = concept->getOperandList(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_AND_AQAND_TYPE) || conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_AQALL_TYPE) || opCode == CCEQ || !negated && opCode == CCSUB || opCode == CCAQSOME || opCode == CCSOME) { CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegation = opConLinkerIt->isNegated()^negated; TConceptNegationPair opConNegPair(opConcept,opNegation); if (!positiveConceptSet->contains(opConNegPair)) { positiveConceptSet->insert(opConNegPair); processConceptList.append(opConNegPair); } opConLinkerIt = opConLinkerIt->getNext(); } } else if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_IMPL_TYPE)) { CSortedNegLinker* firstOpConLinker = opConLinker; if (firstOpConLinker) { CConcept* opConcept = firstOpConLinker->getData(); TConceptNegationPair opConNegPair(opConcept,false); if (!positiveConceptSet->contains(opConNegPair)) { positiveConceptSet->insert(opConNegPair); processConceptList.append(opConNegPair); } } } else if (opCode == CCAQCHOOCE) { CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); if (opConLinkerIt->isNegated() == negated) { TConceptNegationPair opConNegPair(opConcept,false); if (!positiveConceptSet->contains(opConNegPair)) { positiveConceptSet->insert(opConNegPair); processConceptList.append(opConNegPair); } } opConLinkerIt = opConLinkerIt->getNext(); } } else if (opCode == CCATMOST || opCode == CCATLEAST) { CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); TConceptNegationPair opConNegPair(opConcept,opConLinkerIt->isNegated()); if (!positiveConceptSet->contains(opConNegPair)) { positiveConceptSet->insert(opConNegPair); processConceptList.append(opConNegPair); } opConLinkerIt = opConLinkerIt->getNext(); } } else if (!negated && (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE))) { CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); TConceptNegationPair opConNegPair(opConcept,opConLinkerIt->isNegated()); if (!positiveConceptSet->contains(opConNegPair)) { positiveConceptSet->insert(opConNegPair); processConceptList.append(opConNegPair); } opConLinkerIt = opConLinkerIt->getNext(); } } } } } QString CTriggeredImplicationBinaryAbsorberPreProcess::generateDebugGCIConceptString(CConcept* concept, bool conceptNegation) { mDebugGCIString = CConceptTextFormater::getConceptString(concept,conceptNegation); return mDebugGCIString; } QString CTriggeredImplicationBinaryAbsorberPreProcess::generateDebugGeneratedAbsorbedImplicationString(cint64 minNewConceptTag, cint64 lastNewConceptTag) { QString absorbedString; for (cint64 tag = minNewConceptTag; tag <= lastNewConceptTag; ++tag) { CConcept* concept = mConceptVec->getData(tag); if (concept) { QString tmpString = CConceptTextFormater::getConceptString(concept,false); absorbedString += QString("%1
\r\n").arg(tmpString); } } mDebugAbsorbedString = absorbedString; return absorbedString; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createImpliedConcept() { CConcept* concept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); concept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); concept->initTag(nextConTag); concept->setOperatorCode(CCAND); mConceptVec->setLocalData(nextConTag,concept); return concept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createCandidateEquivalentConcept(CConcept* eqConcept) { CConcept* concept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); concept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); concept->initTag(nextConTag); mConceptVec->setLocalData(nextConTag,concept); addUnfoldingConceptForConcept(concept,eqConcept,false); concept->setOperatorCode(CCEQCAND); return concept; } bool CTriggeredImplicationBinaryAbsorberPreProcess::addConceptToImplied(CConcept* impliedConcept, CConcept* concept, bool negated) { CSortedNegLinker* newBaseOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon->init(concept,negated,impliedConcept->getOperandList()); impliedConcept->setOperandList(newBaseOpCon); impliedConcept->incOperandCount(); return true; } bool CTriggeredImplicationBinaryAbsorberPreProcess::addSubClassConcept(CConcept* subclassConcept, CConcept* addedConcept, bool negated) { CSortedNegLinker* newBaseOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon->init(addedConcept,negated,subclassConcept->getOperandList()); subclassConcept->setOperandList(newBaseOpCon); subclassConcept->incOperandCount(); subclassConcept->setOperatorCode(CCSUB); return true; } bool CTriggeredImplicationBinaryAbsorberPreProcess::addRoleDomainConcept(CRole* role, CConcept* addedConcept, bool negated) { CSortedNegLinker* newBaseOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon->init(addedConcept,negated,role->getDomainConceptList()); role->setDomainConceptList(newBaseOpCon); return true; } bool CTriggeredImplicationBinaryAbsorberPreProcess::addRoleRangeConcept(CRole* role, CConcept* addedConcept, bool negated) { CSortedNegLinker* newBaseOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon->init(addedConcept,negated,role->getRangeConceptList()); role->setRangeConceptList(newBaseOpCon); return true; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createImplicationConcept(CConcept* impliedConcept, bool negated) { CConcept* concept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); concept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); concept->initTag(nextConTag); concept->setOperatorCode(CCIMPL); CSortedNegLinker* newBaseOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon->init(impliedConcept,negated); concept->setOperandList(newBaseOpCon); concept->incOperandCount(); mConceptVec->setLocalData(nextConTag,concept); ++mStatImplConceptsGenerated; return concept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createImplicationTriggerConcept(CConcept* impConcept, bool negated) { CConcept* concept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); concept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); concept->initTag(nextConTag); concept->setOperatorCode(CCIMPLTRIG); mConceptVec->setLocalData(nextConTag,concept); if (impConcept) { addConceptToImplied(concept,impConcept,negated); } return concept; } bool CTriggeredImplicationBinaryAbsorberPreProcess::addImplicationTrigger(CConcept* implConcept, CConcept* triggerConcept, bool negated) { CSortedNegLinker* newTriggerOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newTriggerOpCon->init(triggerConcept,negated,implConcept->getOperandList()->getNext()); implConcept->getOperandList()->setNext(newTriggerOpCon); implConcept->incOperandCount(); mTriggerImplHash->insertMulti(triggerConcept,implConcept); return true; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createTriggerPropagationConcept(CConcept* destConcept, CRole* backwardPropRole) { CConcept* concept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); CRole* invRole = getInverseRole(backwardPropRole); concept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); concept->initTag(nextConTag); concept->setOperatorCode(CCIMPLALL); concept->setRole(invRole); CSortedNegLinker* newTriggerOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newTriggerOpCon->init(destConcept,false); concept->setOperandList(newTriggerOpCon); concept->incOperandCount(); mConceptVec->setLocalData(nextConTag,concept); return concept; } CRole* CTriggeredImplicationBinaryAbsorberPreProcess::getInverseRole(CRole* role) { CSortedNegLinker* eqInvRoleIt = role->getInverseEquivalentRoleList(); while (eqInvRoleIt) { if (eqInvRoleIt->isNegated()) { return eqInvRoleIt->getData(); } eqInvRoleIt = eqInvRoleIt->getNext(); } CSortedNegLinker* superRoleIt = role->getIndirectSuperRoleList(); while (superRoleIt) { if (superRoleIt->isNegated()) { CRole* superRole = superRoleIt->getData(); CSortedNegLinker* superRoleSuperRoleIt = superRole->getIndirectSuperRoleList(); while (superRoleSuperRoleIt) { if (superRoleSuperRoleIt->isNegated() && superRoleSuperRoleIt->getData() == role) { return superRole; } superRoleSuperRoleIt = superRoleSuperRoleIt->getNext(); } } superRoleIt = superRoleIt->getNext(); } // create inverse role CRole* invRole = CConcreteOntologyInverseRoleBuilder::createInverseRoleDelayed(role,&mRoleInverseRoleCreateHash,mOnto); ++mStatInvRolesGenerated; return invRole; } void CTriggeredImplicationBinaryAbsorberPreProcess::createEquivalenceAbsorbedTriggeredImplication(CConcept* eqConcept, bool negated, CSortedNegLinker* absorpOpLinker) { CConceptTriggerLinker* triggers = nullptr; for (CSortedNegLinker* opConLinkerIt = absorpOpLinker; opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* concept = opConLinkerIt->getData(); bool negated = opConLinkerIt->isNegated(); CConceptTriggerLinker* tmpTriggers = copyTriggerLinkers(getTriggersForConcept(concept,negated)); if (tmpTriggers) { triggers = tmpTriggers->append(triggers); } } CConceptTriggerLinker* impliedConceptTrigger = getImplicationTriggeredConceptForTriggers(triggers,nullptr); addUnfoldingConceptForConcept(impliedConceptTrigger->getTriggerConcept(),eqConcept,false); } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::getEquivalenceConceptCandidateTriggeredImplication(CConcept* eqConcept, bool negated) { CConcept* triggeredConcept = nullptr; cint64 opCode = eqConcept->getOperatorCode(); if (!negated && opCode == CCEQ) { QList candList; if (addAbsorbableDisjunctCandidates(eqConcept,!negated,candList)) { if (candList.count() >= 1) { QList absorbList(getPartialAbsorbableDisjuncts(candList)); if (!absorbList.isEmpty()) { triggeredConcept = createPartialExtendedAbsorbedImpliedTriggerCocnept(absorbList); } } } } return triggeredConcept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createDisjunctionAbsorbedTriggeredImplication(CConcept* orConcept, bool negated) { CConcept* implicationConcept = nullptr; cint64 opCode = orConcept->getOperatorCode(); if (!negated && opCode == CCOR || negated && opCode == CCAND) { QList candList; if (addAbsorbableDisjunctCandidates(orConcept,negated,candList)) { if (candList.count() >= 1) { QList absorbList(splitAbsorbableDisjuncts(candList)); if (!absorbList.isEmpty()) { implicationConcept = createDisjunctionAbsorbedTriggeredImplication(orConcept,negated,absorbList,candList); } } } } return implicationConcept; } CConceptRoleBranchingTrigger* CTriggeredImplicationBinaryAbsorberPreProcess::createDisjunctionPartialAbsorbedBranchTriggers(CConcept* orConcept, bool negated) { CConceptRoleBranchingTrigger* branchTriggers = nullptr; cint64 opCode = orConcept->getOperatorCode(); if (!negated && opCode == CCOR || negated && (opCode == CCAND)) { QList candList; if (addAbsorbableDisjunctCandidates(orConcept,negated,candList)) { if (candList.count() >= 1) { QList absorbList(getPartialAbsorbableDisjuncts(candList)); if (!absorbList.isEmpty()) { branchTriggers = createDisjunctionPartialAbsorbedBranchTriggers(orConcept,negated,absorbList); } } } } return branchTriggers; } CConceptRoleBranchingTrigger* CTriggeredImplicationBinaryAbsorberPreProcess::createDisjunctionPartialAbsorbedBranchTriggers(CConcept* orConcept, bool negated, const QList& absorbList) { CConceptRoleBranchingTrigger* branchTriggers = nullptr; for (QList::const_iterator it = absorbList.constBegin(), itEnd = absorbList.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; CConceptRoleBranchingTrigger* tmpBranchTrigger = getSimpleBranchTriggersForConcept(concept,!negated); if (tmpBranchTrigger) { branchTriggers = tmpBranchTrigger->append(branchTriggers); } else { CConceptRoleBranchingTrigger* tmpBranchTrigger = getBranchTiggers(getPartialTriggersForConcept(concept,!negated)); branchTriggers = tmpBranchTrigger->append(branchTriggers); } } return branchTriggers; } bool CTriggeredImplicationBinaryAbsorberPreProcess::absorbPartialGCIConceptsToTriggeredImplications(CConcept* orConcept, bool negated) { cint64 opCode = orConcept->getOperatorCode(); if (!negated && opCode == CCOR || negated && opCode == CCAND) { QList candList; if (addAbsorbableDisjunctCandidates(orConcept,negated,candList)) { if (candList.count() >= 1) { QList absorbList(getPartialAbsorbableDisjuncts(candList)); if (!absorbList.isEmpty()) { createGCIPartialAbsorbedTriggeredImplication(orConcept,negated,absorbList); return true; } } } } return false; } bool CTriggeredImplicationBinaryAbsorberPreProcess::absorbNominalSchemaGCIConceptsToTriggeredImplications(CConcept* concept, bool negated) { if (concept->getOperatorCode() == CCNOMTEMPLREF) { cint64 nomSchTemplIndex = concept->getParameter(); CNominalSchemaTemplate* nsTemplate = mNomSchemaTemplVec->getData(nomSchTemplIndex); if (nsTemplate) { CConcept* templConcept = nsTemplate->getTemplateConcept(); cint64 opCode = templConcept->getOperatorCode(); if (!negated && opCode == CCOR || negated && opCode == CCAND) { QList candList; if (addAbsorbableDisjunctCandidates(templConcept,negated,candList)) { if (candList.count() >= 1) { QList absorbList(splitAbsorbableDisjuncts(candList)); QList partialAbsorbList(getPartialAbsorbableDisjuncts(candList)); if (!absorbList.isEmpty() || !partialAbsorbList.isEmpty()) { createGCINominalSchemaAbsorbedTriggeredImplication(templConcept,negated,absorbList,partialAbsorbList,candList,nsTemplate); return true; } } } } } } return false; } void CTriggeredImplicationBinaryAbsorberPreProcess::createGCINominalSchemaAbsorbedTriggeredImplication(CConcept* orConcept, bool negated, QList& absorbList, QList& partialAbsorbList, QList& candList, CNominalSchemaTemplate* nsTemplate) { CConcept* impliedConcept = nullptr; bool impliedNegation = false; QList partialAbsorbableList; CConceptTriggerLinker* triggers = nullptr; for (QList::const_iterator it = absorbList.constBegin(), itEnd = absorbList.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; CConceptTriggerLinker* tmpTriggers = copyTriggerLinkers(getPartialTriggersForConcept(concept,!negated)); triggers = tmpTriggers->append(triggers); } for (QList::const_iterator it = partialAbsorbList.constBegin(), itEnd = partialAbsorbList.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; CConceptTriggerLinker* tmpTriggers = copyTriggerLinkers(getPartialTriggersForConcept(concept,!negated)); triggers = tmpTriggers->append(triggers); } CConceptTriggerLinker* impliedConceptTrigger = getImplicationTriggeredConceptForTriggers(triggers,nullptr); impliedConcept = impliedConceptTrigger->getTriggerConcept(); QList absorpConceptList(absorbList); absorpConceptList.append(partialAbsorbList); QSet conceptSet; for (QList::const_iterator it = absorpConceptList.constBegin(), itEnd = absorpConceptList.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* operandConcept = conNegPair.first; bool operandConceptNegation = conNegPair.second; conceptSet.insert(TConceptNegationPair(operandConcept,!operandConceptNegation)); } QHash nomSchConceptVariableHash; CBOXSET* nominalSchemasSet = nsTemplate->getNominalSchemaConceptSet(); for (CBOXSET::const_iterator it = nominalSchemasSet->constBegin(), itEnd = nominalSchemasSet->constEnd(); it != itEnd; ++it) { CConcept* nominalSchemaConcept = *it; CVariable* variable = CObjectAllocator< CVariable >::allocateAndConstruct(mMemMan); variable->initVariable(nominalSchemaConcept,mNextVariableID++); nomSchConceptVariableHash.insert(nominalSchemaConcept,variable); } QList groundConceptList(candList); CConcept* nextAbsorptionConcept = impliedConcept; bool pathPreabsorption = false; if (mConfNominalSchemaPathPreabsorption) { if (nominalSchemasSet->count() >= 3) { pathPreabsorption = true; } } if (pathPreabsorption) { // create nominal schema absorption path CNominalSchemaAbsorptionPathLinker* absorptionPathLinker = new CNominalSchemaAbsorptionPathLinker(); absorptionPathLinker->initNominalSchemaAbsorptionPathLinker(nullptr); absorptionPathLinker->setLastPathTriggerConcept(nextAbsorptionConcept); absorptionPathLinker = getAbsorbedNominalSchemaPaths(conceptSet,absorptionPathLinker,&nomSchConceptVariableHash,nsTemplate); nextAbsorptionConcept = createBindingBackPropagationTriggerConcept(); for (CNominalSchemaAbsorptionPathLinker* absorptionPathLinkerIt = absorptionPathLinker; absorptionPathLinkerIt; absorptionPathLinkerIt = absorptionPathLinkerIt->getNext()) { CConcept* groundingConcept = nullptr; bool groundingConNegation = false; CNominalSchemaTemplate* grNSTemplate = nsTemplate; createBindingGroundConcept(groundingConcept,groundingConNegation,groundConceptList,grNSTemplate,CCPBINDGROUND); CConcept* lastPathTriggerConcept = absorptionPathLinkerIt->getLastPathTriggerConcept(); addConceptOperand(lastPathTriggerConcept,groundingConcept,groundingConNegation); addConceptOperand(groundingConcept,nextAbsorptionConcept,false); } } else { CConcept* tmpNextAbsorptionConcept = createBindingBackPropagationActivationTriggerConcept(); addConceptOperand(nextAbsorptionConcept,tmpNextAbsorptionConcept,false); nextAbsorptionConcept = tmpNextAbsorptionConcept; } CNominalSchemaAbsorptionBranchLinker* absorptionBranchLinker = getAbsorbedJoinedNominalSchemaBranchLinker(conceptSet,nextAbsorptionConcept,&nomSchConceptVariableHash,nsTemplate); for (CNominalSchemaAbsorptionBranchLinker* absorptionBranchLinkerIt = absorptionBranchLinker; absorptionBranchLinkerIt; absorptionBranchLinkerIt = absorptionBranchLinkerIt->getNext()) { CConcept* groundingConcept = nullptr; bool groundingConNegation = false; CNominalSchemaTemplate* grNSTemplate = nsTemplate; createBindingGroundConcept(groundingConcept,groundingConNegation,groundConceptList,grNSTemplate,CCVARBINDGROUND); CConcept* lastPathTriggerConcept = absorptionBranchLinkerIt->getLastBranchTriggerConcept(); addConceptOperand(lastPathTriggerConcept,groundingConcept,groundingConNegation); } } void CTriggeredImplicationBinaryAbsorberPreProcess::createBindingGroundConcept(CConcept*& groundingConcept, bool& groundingConNegation, const QList& groundConceptList, CNominalSchemaTemplate* nsTemplate, cint64 groundOpCode) { CConcept* groundConcept = nullptr; bool groundConNegation = false; bool createNewTemplate = false; if (groundConceptList.count() > 1) { CConcept* orConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); orConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); orConcept->initTag(nextConTag); orConcept->setOperatorCode(CCOR); mConceptVec->setLocalData(nextConTag,orConcept); for (QList::const_iterator it = groundConceptList.constBegin(), itEnd = groundConceptList.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* operandConcept = conNegPair.first; bool operandConceptNegation = conNegPair.second; addConceptOperand(orConcept,operandConcept,operandConceptNegation); } groundConcept = orConcept; groundConNegation = false; createNewTemplate = true; } else if (groundConceptList.count() == 1) { TConceptNegationPair conNegPair(groundConceptList.first()); groundConcept = conNegPair.first; groundConNegation = conNegPair.second; createNewTemplate = true; } else { groundConcept = mTopConcept; groundConNegation = true; } if (createNewTemplate) { nsTemplate = CObjectAllocator< CNominalSchemaTemplate >::allocateAndConstruct(mMemMan); CBOXSET* nominalSchemaConceptSet = CObjectAllocator< CBOXSET >::allocateAndConstruct(mMemMan); CBOXHASH* conceptNominalSchemaConceptHash = CObjectAllocator< CBOXHASH >::allocateAndConstruct(mMemMan); CBOXHASH* absorbableConceptNominalSchemaConceptHash = CObjectAllocator< CBOXHASH >::allocateAndConstruct(mMemMan); nsTemplate->initNominalSchemaTemplate(nominalSchemaConceptSet,conceptNominalSchemaConceptHash,absorbableConceptNominalSchemaConceptHash); if (!mNomSchemaTemplVec) { mNomSchemaTemplVec = mMBox->getNominalSchemaTemplateVector(); } cint64 nextNomSchTemplID = mNomSchemaTemplVec->getItemCount(); nsTemplate->setNominalSchemaTemplateTag(nextNomSchTemplID); mNomSchemaTemplVec->setData(nextNomSchTemplID,nsTemplate); nsTemplate->setTemplateConcept(groundConcept); collectNominalSchemaConcepts(groundConcept,nominalSchemaConceptSet); FOREACHIT (CConcept* nomSchConcept, *nominalSchemaConceptSet) { QSet testedNomSchemConSet; hasNominalSchemaConceptFillHash(groundConcept,conceptNominalSchemaConceptHash,nomSchConcept,&testedNomSchemConSet); QSet testedNomSchemAbsorbedConSet; hasNominalSchemaAbsorbableConceptFillHash(groundConcept,groundingConNegation,absorbableConceptNominalSchemaConceptHash,nomSchConcept,&testedNomSchemAbsorbedConSet); } groundingConcept = createBindingGroundingConcept(nsTemplate,groundOpCode); } else { groundingConcept = groundConcept; } groundingConNegation = groundConNegation; } bool CTriggeredImplicationBinaryAbsorberPreProcess::hasNominalSchemaAbsorbableConceptFillHash(CConcept* concept, bool negation, CBOXHASH* absorbableConceptNominalSchemaConceptHash, CConcept* nominalSchemaConcept, QSet* testedConceptSet) { cint64 conOpCode = concept->getOperatorCode(); if (conOpCode == CCSUB || conOpCode == CCEQ || conOpCode == CCTOP || conOpCode == CCBOTTOM || concept->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE)) { return false; } bool foundAbsorbableNominalSchemaConcept = false; if (negation && concept == nominalSchemaConcept) { foundAbsorbableNominalSchemaConcept = true; } else { cint64 conCode = concept->getOperatorCode(); if (negation && (conCode == CCSOME) || !negation && (conCode == CCALL)) { for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); foundAbsorbableNominalSchemaConcept |= hasNominalSchemaAbsorbableConceptFillHash(opConcept,negation^opConLinkerIt->isNegated(),absorbableConceptNominalSchemaConceptHash,nominalSchemaConcept,testedConceptSet); } } else if (!negation && (conCode == CCAND || conCode == CCOR) || negation && (conCode == CCOR || conCode == CCAND)) { for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); foundAbsorbableNominalSchemaConcept |= hasNominalSchemaAbsorbableConceptFillHash(opConcept,negation^opConLinkerIt->isNegated(),absorbableConceptNominalSchemaConceptHash,nominalSchemaConcept,testedConceptSet); } } } if (foundAbsorbableNominalSchemaConcept) { if (!testedConceptSet->contains(concept)) { testedConceptSet->insert(concept); absorbableConceptNominalSchemaConceptHash->insertMulti(concept,nominalSchemaConcept); } } return foundAbsorbableNominalSchemaConcept; } bool CTriggeredImplicationBinaryAbsorberPreProcess::hasNominalSchemaConceptFillHash(CConcept* concept, CBOXHASH* conceptNominalSchemaConceptHash, CConcept* nominalSchemaConcept, QSet* testedConceptSet) { cint64 conOpCode = concept->getOperatorCode(); if (conOpCode == CCSUB || conOpCode == CCEQ || conOpCode == CCTOP || conOpCode == CCBOTTOM || concept->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE)) { return false; } bool foundNominalSchemaConcept = false; if (concept == nominalSchemaConcept) { foundNominalSchemaConcept = true; } else { for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); foundNominalSchemaConcept |= hasNominalSchemaConceptFillHash(opConcept,conceptNominalSchemaConceptHash,nominalSchemaConcept,testedConceptSet); } } if (foundNominalSchemaConcept) { if (!testedConceptSet->contains(concept)) { testedConceptSet->insert(concept); conceptNominalSchemaConceptHash->insertMulti(concept,nominalSchemaConcept); } } return foundNominalSchemaConcept; } void CTriggeredImplicationBinaryAbsorberPreProcess::collectNominalSchemaConcepts(CConcept* concept, CBOXSET* nominalSchemaConceptSet) { cint64 conOpCode = concept->getOperatorCode(); if (conOpCode == CCSUB || conOpCode == CCEQ || conOpCode == CCTOP || conOpCode == CCBOTTOM || concept->getConceptOperator()->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_TYPE)) { } else if (conOpCode == CCNOMVAR) { nominalSchemaConceptSet->insert(concept); } else { for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); collectNominalSchemaConcepts(opConcept,nominalSchemaConceptSet); } } } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createBindingGroundingConcept(CNominalSchemaTemplate* nsTemplate, cint64 groundOpCode) { CConcept* groundingConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); groundingConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); groundingConcept->initTag(nextConTag); groundingConcept->setOperatorCode(groundOpCode); groundingConcept->setParameter(nsTemplate->getNominalSchemaTemplateTag()); mConceptVec->setLocalData(nextConTag,groundingConcept); return groundingConcept; } CNominalSchemaAbsorptionPathLinker* CTriggeredImplicationBinaryAbsorberPreProcess::getAbsorbedNominalSchemaPaths(const QSet& conceptSet, CNominalSchemaAbsorptionPathLinker* absorptionPathLinker, QHash* nomSchConceptVariableHash, CNominalSchemaTemplate* nsTemplate) { CConceptTriggerLinker* triggers = nullptr; QSet conceptEqConAbsorbed; QSet relatedConceptSet; for (QSet::const_iterator it = conceptSet.constBegin(), itEnd = conceptSet.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; collectNominalSchemaRelatedConcepts(concept,negated,relatedConceptSet,nsTemplate); isConceptPartialImplicationTriggerable(concept,negated,&conceptEqConAbsorbed); CConceptTriggerLinker* tmpTriggers = copyTriggerLinkers(getPartialTriggersForConcept(concept,negated)); if (tmpTriggers) { triggers = tmpTriggers->append(triggers); } } QList nomSchConList; QList otherConList; QList orConList; sortNominalSchemaRelatedConcepts(relatedConceptSet,nsTemplate,nomSchConList,otherConList,orConList); CConceptTriggerLinker* impliedConceptTrigger = getImplicationTriggeredConceptForTriggers(triggers,nullptr); CConcept* triggerConcept = impliedConceptTrigger->getTriggerConcept(); CNominalSchemaAbsorptionPathLinker* newAbsorptionPathLinker = nullptr; CNominalSchemaAbsorptionPathLinker* absorptionPathLinkerIt = absorptionPathLinker; while (absorptionPathLinkerIt) { CNominalSchemaAbsorptionPathLinker* absorptionPath = absorptionPathLinkerIt; absorptionPathLinkerIt = absorptionPathLinkerIt->getNext(); absorptionPath->clearNext(); CConcept* lastPathTriggerConcept = absorptionPath->getLastPathTriggerConcept(); QList initNomSchConList; CConcept* levelTriggerConcept = nullptr; if (triggerConcept != lastPathTriggerConcept) { CConcept* nextPathTriggerConcept = createBindingTriggerConcept(); CConcept* implicationConcept = createBindingImplicationTriggeredConcept(triggerConcept,nextPathTriggerConcept); addConceptOperand(lastPathTriggerConcept,implicationConcept,false); lastPathTriggerConcept = nextPathTriggerConcept; } // find already binded nominal schema variables QHash* nomSchConTrigHash = absorptionPath->getNominalSchemaBindedConceptTriggerHash(); for (QList::const_iterator it = nomSchConList.constBegin(), itEnd = nomSchConList.constEnd(); it != itEnd; ++it) { TConceptNegationPair nomSchConNegPair(*it); CConcept* nomSchConcept = nomSchConNegPair.first; CConcept* nominalBindConceptTrigger = nomSchConTrigHash->value(nomSchConcept,nullptr); if (nominalBindConceptTrigger) { CConcept* nextPathTriggerConcept = createBindingTriggerConcept(); if (!levelTriggerConcept) { levelTriggerConcept = nominalBindConceptTrigger; } CConcept* cycleCloseConcept = createBindingCycleCloseConcept(nominalBindConceptTrigger,nextPathTriggerConcept); addConceptOperand(lastPathTriggerConcept,cycleCloseConcept,false); lastPathTriggerConcept = nextPathTriggerConcept; } else { initNomSchConList.append(nomSchConNegPair); } } //if (!levelTriggerConcept) { // levelTriggerConcept = createBindingTriggerConcept(); // cint64 nextVariableID = 0; // if (absorptionPath->hasVariables()) { // nextVariableID = absorptionPath->getLastVariable()->getPathVariableID()+1; // } // CConcept* nominalConcept = nullptr; // if (!initNomSchConList.isEmpty()) { // TConceptNegationPair nomSchConNegPair(initNomSchConList.first()); // CConcept* nomSchConcept = nomSchConNegPair.first; // nominalConcept = nomSchConcept; // } // CVariable* variable = CObjectAllocator< CVariable >::allocateAndConstruct(mMemMan); // variable->initVariable(nominalConcept,nextVariableID); // absorptionPath->addVariable(variable); // CConcept* varBindConcept = createBindingVariableConcept(levelTriggerConcept,variable); // addConceptOperand(lastPathTriggerConcept,varBindConcept,false); // lastPathTriggerConcept = levelTriggerConcept; //} for (QList::const_iterator it = initNomSchConList.constBegin(), itEnd = initNomSchConList.constEnd(); it != itEnd; ++it) { TConceptNegationPair nomSchConNegPair(*it); CConcept* nomSchConcept = nomSchConNegPair.first; CConcept* nextTriggerConcept = createBindingTriggerConcept(); CVariable* variable = nomSchConceptVariableHash->value(nomSchConcept); absorptionPath->addVariable(variable); CConcept* varBindConcept = createBindingVariableConcept(nextTriggerConcept,variable); addConceptOperand(lastPathTriggerConcept,varBindConcept,false); nomSchConTrigHash->insert(nomSchConcept,nextTriggerConcept); lastPathTriggerConcept = nextTriggerConcept; if (!levelTriggerConcept) { levelTriggerConcept = nextTriggerConcept; } } absorptionPath->setLastPathTriggerConcept(lastPathTriggerConcept); // build absorption path recursive CNominalSchemaAbsorptionPathLinker* nextAbsorptionPathLinker = absorptionPath; for (QList::const_iterator itRec = otherConList.constBegin(), itRecEnd = otherConList.constEnd(); itRec != itRecEnd; ++itRec) { TConceptNegationPair succConNegPair(*itRec); CConcept* succConcept = succConNegPair.first; bool succConNegation = succConNegPair.second; cint64 succConOpCode = succConcept->getOperatorCode(); cint64 param = succConcept->getParameter(); if (!succConNegation && (succConOpCode == CCSOME || succConOpCode == CCATLEAST && param == 1) || succConNegation && (succConOpCode == CCALL || succConOpCode == CCATMOST && param == 0)) { CRole* role = succConcept->getRole(); bool succOpNegate = succConOpCode == CCALL; if (succConcept->getOperandList()) { for (CNominalSchemaAbsorptionPathLinker* nextAbsorptionPathLinkerIt = nextAbsorptionPathLinker; nextAbsorptionPathLinkerIt; nextAbsorptionPathLinkerIt = nextAbsorptionPathLinkerIt->getNext()) { CConcept* nextAbsorptionPathTriggerConcept = createBindingTriggerConcept(); CConcept* lastAbsorptionPathTriggerConcept = nextAbsorptionPathLinkerIt->getLastPathTriggerConcept(); CConcept* propagationPathTriggerConcept = createBindingToSuccessorPropagationConcept(nextAbsorptionPathTriggerConcept,role); addConceptOperand(lastAbsorptionPathTriggerConcept,propagationPathTriggerConcept,false); nextAbsorptionPathLinkerIt->setLastPathTriggerConcept(nextAbsorptionPathTriggerConcept); } QSet operandConceptSet; for (CSortedNegLinker* succOpConLinkerIt = succConcept->getOperandList(); succOpConLinkerIt; succOpConLinkerIt = succOpConLinkerIt->getNext()) { CConcept* succOpCon = succOpConLinkerIt->getData(); bool succOpConNeg = succOpConLinkerIt->isNegated() ^ succOpNegate; operandConceptSet.insert(TConceptNegationPair(succOpCon,succOpConNeg)); } nextAbsorptionPathLinker = getAbsorbedNominalSchemaPaths(operandConceptSet,nextAbsorptionPathLinker,nomSchConceptVariableHash,nsTemplate); for (CNominalSchemaAbsorptionPathLinker* nextAbsorptionPathLinkerIt = nextAbsorptionPathLinker; nextAbsorptionPathLinkerIt; nextAbsorptionPathLinkerIt = nextAbsorptionPathLinkerIt->getNext()) { CConcept* propNextAbsorptionPathTriggerConcept = createBindingTriggerConcept(); CConcept* lastAbsorptionPathTriggerConcept = nextAbsorptionPathLinkerIt->getLastPathTriggerConcept(); CConcept* propagationPathTriggerConcept = createBindingFromSuccessorPropagationConcept(propNextAbsorptionPathTriggerConcept,role); addConceptOperand(lastAbsorptionPathTriggerConcept,propagationPathTriggerConcept,false); if (levelTriggerConcept) { CConcept* cylceNextAbsorptionPathTriggerConcept = createBindingTriggerConcept(); CConcept* cycleCloseConcept = createBindingCycleCloseConcept(levelTriggerConcept,cylceNextAbsorptionPathTriggerConcept); addConceptOperand(propNextAbsorptionPathTriggerConcept,cycleCloseConcept,false); nextAbsorptionPathLinkerIt->setLastPathTriggerConcept(cylceNextAbsorptionPathTriggerConcept); } else { nextAbsorptionPathLinkerIt->setLastPathTriggerConcept(propNextAbsorptionPathTriggerConcept); } } } } } for (QList::const_iterator itOr = orConList.constBegin(), itOrEnd = orConList.constEnd(); itOr != itOrEnd; ++itOr) { TConceptNegationPair orConNegPair(*itOr); CConcept* orConcept = orConNegPair.first; bool orConNegation = orConNegPair.second; cint64 orConOpCode = orConcept->getOperatorCode(); if (!orConNegation && (orConOpCode == CCOR) || orConNegation && (orConOpCode == CCAND)) { cint64 opCount = orConcept->getOperandCount(); if (opCount > 1) { CNominalSchemaAbsorptionPathLinker* newNextAbsorptionPathLinker = nullptr; CNominalSchemaAbsorptionPathLinker* nextAbsorptionPathLinkerIt = nextAbsorptionPathLinker; while (nextAbsorptionPathLinkerIt) { nextAbsorptionPathLinker = nextAbsorptionPathLinkerIt; nextAbsorptionPathLinkerIt = nextAbsorptionPathLinkerIt->getNext(); nextAbsorptionPathLinker->clearNext(); CNominalSchemaAbsorptionPathLinker* dublicateAbsorptionPathLinkerIt = duplicateNominalSchemaAbsorptionPaths(nextAbsorptionPathLinker,opCount); for (CSortedNegLinker* orOpConLinkerIt = orConcept->getOperandList(); orOpConLinkerIt; orOpConLinkerIt = orOpConLinkerIt->getNext()) { CNominalSchemaAbsorptionPathLinker* dublicateAbsorptionPathLinker = dublicateAbsorptionPathLinkerIt; dublicateAbsorptionPathLinkerIt = dublicateAbsorptionPathLinkerIt->getNext(); dublicateAbsorptionPathLinker->clearNext(); CConcept* orOpCon = orOpConLinkerIt->getData(); bool orOpConNeg = orOpConLinkerIt->isNegated(); QSet operandConceptSet; operandConceptSet.insert(TConceptNegationPair(orOpCon,orOpConNeg)); dublicateAbsorptionPathLinker = getAbsorbedNominalSchemaPaths(operandConceptSet,dublicateAbsorptionPathLinker,nomSchConceptVariableHash,nsTemplate); newNextAbsorptionPathLinker = dublicateAbsorptionPathLinker->append(newNextAbsorptionPathLinker); } } nextAbsorptionPathLinker = newNextAbsorptionPathLinker; } } } newAbsorptionPathLinker = nextAbsorptionPathLinker->append(newAbsorptionPathLinker); } return newAbsorptionPathLinker; } CNominalSchemaAbsorptionPathLinker* CTriggeredImplicationBinaryAbsorberPreProcess::duplicateNominalSchemaAbsorptionPaths(CNominalSchemaAbsorptionPathLinker* abPathLinker, cint64 duplicateCount) { CNominalSchemaAbsorptionPathLinker* duplicateLinker = abPathLinker; for (cint64 i = 1; i < duplicateCount; ++i) { CNominalSchemaAbsorptionPathLinker* linker = new CNominalSchemaAbsorptionPathLinker(); linker->initNominalSchemaAbsorptionPathLinker(abPathLinker); duplicateLinker = linker->append(duplicateLinker); } return duplicateLinker; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createBindingToSuccessorPropagationConcept(CConcept* followingConcept, CRole* role) { CConcept* succPropConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); succPropConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); succPropConcept->initTag(nextConTag); succPropConcept->setOperatorCode(CCPBINDALL); succPropConcept->setRole(role); mConceptVec->setLocalData(nextConTag,succPropConcept); addConceptOperand(succPropConcept,followingConcept,false); return succPropConcept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createBindingFromSuccessorPropagationConcept(CConcept* followingConcept, CRole* role) { CRole* inverseRole = getInverseRole(role); CConcept* succPropConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); succPropConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); succPropConcept->initTag(nextConTag); succPropConcept->setOperatorCode(CCPBINDALL); succPropConcept->setRole(inverseRole); mConceptVec->setLocalData(nextConTag,succPropConcept); addConceptOperand(succPropConcept,followingConcept,false); return succPropConcept; } void CTriggeredImplicationBinaryAbsorberPreProcess::addConceptOperand(CConcept* concept, CConcept* operandConcept, bool operandNegation) { CSortedNegLinker* newBaseOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon->init(operandConcept,operandNegation,concept->getOperandList()); concept->setOperandList(newBaseOpCon); concept->incOperandCount(); } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createBindingTriggerConcept() { CConcept* triggConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); triggConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); triggConcept->initTag(nextConTag); triggConcept->setOperatorCode(CCPBINDTRIG); mConceptVec->setLocalData(nextConTag,triggConcept); return triggConcept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createBindingImplicationTriggeredConcept(CConcept* triggeredConcept, CConcept* impliedConcept) { CConcept* implicationConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); implicationConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); implicationConcept->initTag(nextConTag); implicationConcept->setOperatorCode(CCPBINDIMPL); CSortedNegLinker* newBaseOpCon1 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon1->init(triggeredConcept,true); CSortedNegLinker* newBaseOpCon2 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon2->init(impliedConcept,false,newBaseOpCon1); implicationConcept->setOperandList(newBaseOpCon2); implicationConcept->incOperandCount(2); mConceptVec->setLocalData(nextConTag,implicationConcept); return implicationConcept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createBindingCycleCloseConcept(CConcept* cycleCloseTriggerConcept, CConcept* impliedTriggerConcept) { CConcept* cycleConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); cycleConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); cycleConcept->initTag(nextConTag); cycleConcept->setOperatorCode(CCPBINDCYCLE); CSortedNegLinker* newBaseOpCon1 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon1->init(cycleCloseTriggerConcept,true); CSortedNegLinker* newBaseOpCon2 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon2->init(impliedTriggerConcept,false,newBaseOpCon1); cycleConcept->setOperandList(newBaseOpCon2); cycleConcept->incOperandCount(2); mConceptVec->setLocalData(nextConTag,cycleConcept); return cycleConcept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createBindingVariableConcept(CConcept* followingConcept, CVariable* variable) { CConcept* bindConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); bindConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); bindConcept->initTag(nextConTag); bindConcept->setOperatorCode(CCPBINDVARIABLE); bindConcept->setVariableLinker(CObjectAllocator< CSortedLinker >::allocateAndConstruct(mMemMan)->init(variable)); addConceptOperand(bindConcept,followingConcept,false); mConceptVec->setLocalData(nextConTag,bindConcept); return bindConcept; } void CTriggeredImplicationBinaryAbsorberPreProcess::sortNominalSchemaRelatedConcepts(QSet& conceptSet, CNominalSchemaTemplate* nsTemplate, QList& nomSchConList, QList& otherConList, QList& orConList) { for (QSet::const_iterator it = conceptSet.constBegin(), itEnd = conceptSet.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* concept = conNegPair.first; bool conNegation = conNegPair.second; cint64 opCode = concept->getOperatorCode(); if (conNegation && (opCode == CCAND) || !conNegation && (opCode == CCOR)) { orConList.append(conNegPair); } else if (!conNegation && (opCode == CCNOMVAR)) { nomSchConList.append(conNegPair); } else { otherConList.append(conNegPair); } } } void CTriggeredImplicationBinaryAbsorberPreProcess::collectNominalSchemaRelatedConcepts(CConcept* concept, bool negated, QSet& conceptSet, CNominalSchemaTemplate* nsTemplate) { CBOXHASH* conceptNomSchemaAbsorbableConceptsHash = nsTemplate->getTemplateAbsorbableConceptNominalSchemaConceptHash(); if (conceptNomSchemaAbsorbableConceptsHash->contains(concept)) { cint64 opCode = concept->getOperatorCode(); if (!negated && (opCode == CCAND) || negated && (opCode == CCOR)) { for (CSortedNegLinker* opLinkIt = concept->getOperandList(); opLinkIt; opLinkIt = opLinkIt->getNext()) { CConcept* opConcept = opLinkIt->getData(); bool opConNegation = opLinkIt->isNegated() ^ negated; collectNominalSchemaRelatedConcepts(opConcept,opConNegation,conceptSet,nsTemplate); } } else { conceptSet.insert(TConceptNegationPair(concept,negated)); } } } CNominalSchemaAbsorptionBranchLinker* CTriggeredImplicationBinaryAbsorberPreProcess::getAbsorbedJoinedNominalSchemaBranchLinker(CConcept* absorbingConcept, bool absorbingNegation, CConcept* backPropConTrigger, QHash* nomSchConceptVariableHash, CNominalSchemaTemplate* nsTemplate) { TConceptNegationPair absConNegPair(absorbingConcept,absorbingNegation); CNominalSchemaAbsorptionBranchLinker* abBranchLinker = mConceptNomSchAbsorpBranchLinkerHash.value(absConNegPair); if (!abBranchLinker) { QSet relatedConceptSet; relatedConceptSet.insert(TConceptNegationPair(absorbingConcept,absorbingNegation)); abBranchLinker = getAbsorbedJoinedNominalSchemaBranchLinker(relatedConceptSet,backPropConTrigger,nomSchConceptVariableHash,nsTemplate); mConceptNomSchAbsorpBranchLinkerHash.insert(absConNegPair,abBranchLinker); } return abBranchLinker; } CNominalSchemaAbsorptionBranchLinker* CTriggeredImplicationBinaryAbsorberPreProcess::getAbsorbedJoinedNominalSchemaBranchLinker(const QSet& conceptSet, CConcept* backPropConTrigger, QHash* nomSchConceptVariableHash, CNominalSchemaTemplate* nsTemplate) { CNominalSchemaAbsorptionBranchLinker* newAbLinker = nullptr; CConceptTriggerLinker* triggers = nullptr; QSet relatedConceptSet; for (QSet::const_iterator it = conceptSet.constBegin(), itEnd = conceptSet.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; collectNominalSchemaRelatedConcepts(concept,negated,relatedConceptSet,nsTemplate); CConceptTriggerLinker* tmpTriggers = copyTriggerLinkers(getPartialTriggersForConcept(concept,negated)); if (tmpTriggers) { triggers = tmpTriggers->append(triggers); } } QList nomSchConList; QList otherConList; QList orConList; sortNominalSchemaRelatedConcepts(relatedConceptSet,nsTemplate,nomSchConList,otherConList,orConList); QList allConList(otherConList); allConList += nomSchConList; allConList += orConList; CConcept* triggerConcept = nullptr; if (triggers) { CConceptTriggerLinker* impliedConceptTrigger = getImplicationTriggeredConceptForTriggers(triggers,nullptr); triggerConcept = impliedConceptTrigger->getTriggerConcept(); } CConcept* activationTriggerConcept = nullptr; if (!activationTriggerConcept && mConfNominalSchemaBackPropagationMultiTrigger && mConfNominalSchemaBackPropagation) { CBackPropTrigHashData* backPropTrigHashData = nullptr; for (QList::const_iterator nomSchIt = nomSchConList.constBegin(), nomSchItEnd = nomSchConList.constEnd(); nomSchIt != nomSchItEnd && !backPropTrigHashData; ++nomSchIt) { CConcept* nomSchCon = nomSchIt->first; backPropTrigHashData = mVarBackPropTrigHash.value(nomSchCon); } if (backPropTrigHashData) { activationTriggerConcept = backPropTrigHashData->mActivationTriggerConcept; if (triggerConcept) { addBindingBackPropagationTriggeredToImplicationConcept(backPropTrigHashData->mImplicationConcept,triggerConcept); } addBindingBackPropagationTriggeredToImplicationConcept(backPropTrigHashData->mImplicationConcept,backPropConTrigger); } } if (!activationTriggerConcept) { activationTriggerConcept = createBindingBackPropagationTriggerConcept(); if (!mConfNominalSchemaBackPropagation && triggerConcept) { CConcept* tmpNextAbsorptionConcept = createBindingBackPropagationActivationTriggerConcept(); addConceptOperand(triggerConcept,tmpNextAbsorptionConcept,false); addConceptOperand(tmpNextAbsorptionConcept,activationTriggerConcept,false); } else { if (!triggerConcept) { addConceptOperand(backPropConTrigger,activationTriggerConcept,false); } else { CConcept* implBindBackPropTrigCon = createBindingBackPropagationImplicationTriggeredConcept(triggerConcept,activationTriggerConcept); addConceptOperand(backPropConTrigger,implBindBackPropTrigCon,false); if (!nomSchConList.isEmpty() && mConfNominalSchemaBackPropagationMultiTrigger) { CBackPropTrigHashData* backPropTrigHashData = new CBackPropTrigHashData(activationTriggerConcept,implBindBackPropTrigCon); mVarBackPropTrigContainer.append(backPropTrigHashData); foreach (TConceptNegationPair conNegPair, nomSchConList) { CConcept* nomSchCon = conNegPair.first; mVarBackPropTrigHash.insert(nomSchCon,backPropTrigHashData); } } } } } QList newBranchConList; QList newMultiBranchConList; QList newSingleBranchConList; for (QList::const_iterator itRec = allConList.constBegin(), itRecEnd = allConList.constEnd(); itRec != itRecEnd; ++itRec) { TConceptNegationPair succConNegPair(*itRec); CConcept* succConcept = succConNegPair.first; bool succConNegation = succConNegPair.second; CNominalSchemaAbsorptionBranchLinker* newBranchLinker = getAbsorbedNominalSchemaBranchLinker(succConcept,succConNegation,activationTriggerConcept,nomSchConceptVariableHash,nsTemplate); if (newBranchLinker && newBranchLinker->hasNext()) { newMultiBranchConList.append(newBranchLinker); } else if (newBranchLinker) { newSingleBranchConList.append(newBranchLinker); } } newBranchConList.append(newSingleBranchConList); newBranchConList.append(newMultiBranchConList); QList newBranchConItList; for (QList::const_iterator it = newBranchConList.constBegin(), branchConListItEnd = newBranchConList.constEnd(); it != branchConListItEnd; ++it) { newBranchConItList.append(*it); } QList orNewBranchConItList(newBranchConItList); QList< CNominalSchemaAbsorptionBranchLinker* >::iterator nextChangeEndIt = newBranchConItList.end(); bool iterationFinished = false; while (!iterationFinished) { QList aborpBranchList; for (QList::const_iterator it = newBranchConItList.constBegin(), itEnd = newBranchConItList.constEnd(); it != itEnd; ++it) { aborpBranchList.append(*it); } bool removedOne = true; while (removedOne) { removedOne = false; QList::iterator it1 = aborpBranchList.begin(); QList::iterator it2 = it1; QList::iterator itEnd = aborpBranchList.end(); for (; it1 != itEnd && !removedOne; ++it1) { it2 = it1; for (++it2; it2 != itEnd && !removedOne; ++it2) { CNominalSchemaAbsorptionBranchLinker* abLinker1 = qMin(*it1,*it2);; CNominalSchemaAbsorptionBranchLinker* abLinker2 = qMax(*it1,*it2);; TAbsorptionBranchPair absBranchPair(abLinker1,abLinker2); CNominalSchemaAbsorptionBranchLinker* newAbsBranchLinker = mAbsorptionBranchPairAbsorptionBranchHash.value(absBranchPair,nullptr); if (newAbsBranchLinker) { removedOne = true; aborpBranchList.removeOne(abLinker1); aborpBranchList.removeOne(abLinker2); aborpBranchList.append(newAbsBranchLinker); CConcept* joiningConcept = newAbsBranchLinker->getBackPropagationBranchTriggerConcept(); addConceptOperand(activationTriggerConcept,joiningConcept,false); } } } } CNominalSchemaAbsorptionBranchLinker* nextAbLinker = aborpBranchList.takeFirst(); while (!aborpBranchList.isEmpty()) { CNominalSchemaAbsorptionBranchLinker* abLinker = aborpBranchList.takeFirst(); CConcept* branchTrigger1 = nextAbLinker->getLastBranchTriggerConcept(); CConcept* branchTrigger2 = abLinker->getLastBranchTriggerConcept(); CConcept* newImpliedBranchTrigger = createVariableBindingPropagationTriggerConcept(); CConcept* joiningConcept = createVariableBindingPropagationJoiningConcept(branchTrigger1,branchTrigger2,newImpliedBranchTrigger); addConceptOperand(activationTriggerConcept,joiningConcept,false); CNominalSchemaAbsorptionBranchLinker* newTmpAbLinker = new CNominalSchemaAbsorptionBranchLinker(); newTmpAbLinker->joinNominalSchemaAbsorptionPathLinker(nextAbLinker,abLinker); newTmpAbLinker->setLastBranchTriggerConcept(newImpliedBranchTrigger); newTmpAbLinker->setBackPropagationBranchTriggerConcept(joiningConcept); createJoiningConceptVariableList(joiningConcept,nextAbLinker,abLinker); TAbsorptionBranchPair absBranchPair(qMin(nextAbLinker,abLinker),qMax(nextAbLinker,abLinker)); mAbsorptionBranchPairAbsorptionBranchHash.insert(absBranchPair,newTmpAbLinker); nextAbLinker = newTmpAbLinker; } if (triggerConcept) { CConcept* nextVariableBindTrigger = createVariableBindingPropagationTriggerConcept(); CConcept* varImplConcept = createVariableBindingPropagationImplicationTriggeredConcept(triggerConcept,nextVariableBindTrigger); CNominalSchemaAbsorptionBranchLinker* newTmpAbLinker = new CNominalSchemaAbsorptionBranchLinker(); newTmpAbLinker->initNominalSchemaAbsorptionPathLinker(nextAbLinker); addConceptOperand(nextAbLinker->getLastBranchTriggerConcept(),varImplConcept,false); newTmpAbLinker->setLastBranchTriggerConcept(nextVariableBindTrigger); newTmpAbLinker->setBackPropagationBranchTriggerConcept(activationTriggerConcept); nextAbLinker = newTmpAbLinker; } newAbLinker = nextAbLinker->append(newAbLinker); QList< CNominalSchemaAbsorptionBranchLinker* >::iterator nextChangeIt = newBranchConItList.begin(); QList< CNominalSchemaAbsorptionBranchLinker* >::iterator nextOriginalIt = orNewBranchConItList.begin(); CNominalSchemaAbsorptionBranchLinker* nomSchAbsBranchLinkerIt = *nextChangeIt; nomSchAbsBranchLinkerIt = nomSchAbsBranchLinkerIt->getNext(); bool continueIteration = true; while (!nomSchAbsBranchLinkerIt && !iterationFinished) { continueIteration = false; *nextChangeIt = *nextOriginalIt; ++nextChangeIt; ++nextOriginalIt; if (nextChangeIt == nextChangeEndIt) { iterationFinished = true; } else { nomSchAbsBranchLinkerIt = *nextChangeIt; nomSchAbsBranchLinkerIt = nomSchAbsBranchLinkerIt->getNext(); if (!nomSchAbsBranchLinkerIt) { continueIteration = true; } } } if (!iterationFinished) { *nextChangeIt = nomSchAbsBranchLinkerIt; } } return newAbLinker; } CNominalSchemaAbsorptionBranchLinker* CTriggeredImplicationBinaryAbsorberPreProcess::getAbsorbedNominalSchemaBranchLinker(CConcept* absorbingConcept, bool absorbingNegation, CConcept* backPropConTrigger, QHash* nomSchConceptVariableHash, CNominalSchemaTemplate* nsTemplate) { CNominalSchemaAbsorptionBranchLinker* newBranchLinker = nullptr; TConceptNegationPair absConNegPair(absorbingConcept,absorbingNegation); newBranchLinker = mConceptNomSchAbsorpBranchLinkerHash.value(absConNegPair); if (!newBranchLinker) { cint64 absConOpCode = absorbingConcept->getOperatorCode(); cint64 param = absorbingConcept->getParameter(); if (!absorbingNegation && (absConOpCode == CCSOME || absConOpCode == CCATLEAST && param == 1) || absorbingNegation && (absConOpCode == CCALL || absConOpCode == CCATMOST && param == 0)) { CRole* role = absorbingConcept->getRole(); bool succOpNegate = absConOpCode == CCALL; if (absorbingConcept->getOperandList()) { CConcept* nextAbsorptionBranchTriggerConcept = createBindingBackPropagationTriggerConcept(); CConcept* propagationPathTriggerConcept = createBindingBackPropagationToSuccessorConcept(nextAbsorptionBranchTriggerConcept,role); addConceptOperand(backPropConTrigger,propagationPathTriggerConcept,false); QSet operandConceptSet; for (CSortedNegLinker* succOpConLinkerIt = absorbingConcept->getOperandList(); succOpConLinkerIt; succOpConLinkerIt = succOpConLinkerIt->getNext()) { CConcept* succOpCon = succOpConLinkerIt->getData(); bool succOpConNeg = succOpConLinkerIt->isNegated() ^ succOpNegate; operandConceptSet.insert(TConceptNegationPair(succOpCon,succOpConNeg)); } CNominalSchemaAbsorptionBranchLinker* nextAbsorptionBranchLinker = getAbsorbedJoinedNominalSchemaBranchLinker(operandConceptSet,nextAbsorptionBranchTriggerConcept,nomSchConceptVariableHash,nsTemplate); for (CNominalSchemaAbsorptionBranchLinker* nextAbsorptionBranchLinkerIt = nextAbsorptionBranchLinker; nextAbsorptionBranchLinkerIt; nextAbsorptionBranchLinkerIt = nextAbsorptionBranchLinkerIt->getNext()) { CNominalSchemaAbsorptionBranchLinker* tmpNewAbsBranchLinker = new CNominalSchemaAbsorptionBranchLinker(); tmpNewAbsBranchLinker->initNominalSchemaAbsorptionPathLinker(nextAbsorptionBranchLinkerIt); tmpNewAbsBranchLinker->setBackPropagationBranchTriggerConcept(propagationPathTriggerConcept); CConcept* nextVariableBindPropTriggerConcept = createVariableBindingPropagationTriggerConcept(); CConcept* propagationVariableBindPropConcept = createVariableBindingPropagationFromSuccessorConcept(nextVariableBindPropTriggerConcept,role); CConcept* lastVariableBindPropTriggerConcept = tmpNewAbsBranchLinker->getLastBranchTriggerConcept(); addConceptOperand(lastVariableBindPropTriggerConcept,propagationVariableBindPropConcept,false); tmpNewAbsBranchLinker->setLastBranchTriggerConcept(nextVariableBindPropTriggerConcept); newBranchLinker = tmpNewAbsBranchLinker->append(newBranchLinker); } } } else if (!absorbingNegation && (absConOpCode == CCOR) || absorbingNegation && (absConOpCode == CCAND)) { for (CSortedNegLinker* opConLinkerIt = absorbingConcept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opCon = opConLinkerIt->getData(); bool opConNeg = opConLinkerIt->isNegated() ^ absorbingNegation; CNominalSchemaAbsorptionBranchLinker* tmpNewAbsBranchLinker = getAbsorbedJoinedNominalSchemaBranchLinker(opCon,opConNeg,backPropConTrigger,nomSchConceptVariableHash,nsTemplate); newBranchLinker = tmpNewAbsBranchLinker->append(newBranchLinker); } } else if (!absorbingNegation && (absConOpCode == CCNOMVAR)) { CVariable* variable = nomSchConceptVariableHash->value(absorbingConcept,nullptr); if (!variable) { variable = CObjectAllocator< CVariable >::allocateAndConstruct(mMemMan); variable->initVariable(absorbingConcept,mNextVariableID++); nomSchConceptVariableHash->insert(absorbingConcept,variable); } CConcept* varBindTriggerConcept = createVariableBindingPropagationTriggerConcept(); CConcept* bindVarConcept = createVariableBindingPropagationBindVariableConcept(varBindTriggerConcept,variable); CNominalSchemaAbsorptionBranchLinker* newAbsBranchLinker = new CNominalSchemaAbsorptionBranchLinker(); newAbsBranchLinker->initNominalSchemaAbsorptionPathLinker(nullptr); newAbsBranchLinker->setLastBranchTriggerConcept(varBindTriggerConcept); newAbsBranchLinker->setBackPropagationBranchTriggerConcept(bindVarConcept); newAbsBranchLinker->addVariable(variable); if (!mConfNominalSchemaBackPropagation) { CConcept* nominalTriggerConcept = mTBox->getIndividualTriggerConcept(); CConcept* tmpNextAbsorptionConcept = createBindingBackPropagationActivationTriggerConcept(); addConceptOperand(nominalTriggerConcept,tmpNextAbsorptionConcept,false); addConceptOperand(tmpNextAbsorptionConcept,bindVarConcept,false); } else { addConceptOperand(backPropConTrigger,bindVarConcept,false); } newBranchLinker = newAbsBranchLinker; } mConceptNomSchAbsorpBranchLinkerHash.insert(absConNegPair,newBranchLinker); } else { for (CNominalSchemaAbsorptionBranchLinker* nextAbsorptionBranchLinkerIt = newBranchLinker; nextAbsorptionBranchLinkerIt; nextAbsorptionBranchLinkerIt = nextAbsorptionBranchLinkerIt->getNext()) { addConceptOperand(backPropConTrigger,nextAbsorptionBranchLinkerIt->getBackPropagationBranchTriggerConcept(),false); } } return newBranchLinker; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createVariableBindingPropagationBindVariableConcept(CConcept* followingConcept, CVariable* variable) { CConcept* bindConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); bindConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); bindConcept->initTag(nextConTag); bindConcept->setOperatorCode(CCVARBINDVARIABLE); bindConcept->setVariableLinker(CObjectAllocator< CSortedLinker >::allocateAndConstruct(mMemMan)->init(variable)); addConceptOperand(bindConcept,followingConcept,false); mConceptVec->setLocalData(nextConTag,bindConcept); return bindConcept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createBindingBackPropagationActivationTriggerConcept() { CConcept* triggConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); triggConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); triggConcept->initTag(nextConTag); triggConcept->setOperatorCode(CCBACKACTIVTRIG); mConceptVec->setLocalData(nextConTag,triggConcept); return triggConcept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createBindingBackPropagationTriggerConcept() { CConcept* triggConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); triggConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); triggConcept->initTag(nextConTag); triggConcept->setOperatorCode(CCVARPBACKTRIG); mConceptVec->setLocalData(nextConTag,triggConcept); return triggConcept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createBindingBackPropagationToSuccessorConcept(CConcept* followingConcept, CRole* role) { CConcept* succPropConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); succPropConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); succPropConcept->initTag(nextConTag); succPropConcept->setOperatorCode(CCVARPBACKALL); succPropConcept->setRole(role); mConceptVec->setLocalData(nextConTag,succPropConcept); addConceptOperand(succPropConcept,followingConcept,false); return succPropConcept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createVariableBindingPropagationFromSuccessorConcept(CConcept* followingConcept, CRole* role) { CRole* inverseRole = getInverseRole(role); CConcept* succPropConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); succPropConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); succPropConcept->initTag(nextConTag); succPropConcept->setOperatorCode(CCVARBINDALL); succPropConcept->setRole(inverseRole); mConceptVec->setLocalData(nextConTag,succPropConcept); addConceptOperand(succPropConcept,followingConcept,false); return succPropConcept; } bool CTriggeredImplicationBinaryAbsorberPreProcess::addBindingBackPropagationTriggeredToImplicationConcept(CConcept* implicationConcept, CConcept* triggeredConcept) { CSortedNegLinker* lastOpConLinker = nullptr; for (CSortedNegLinker* opConLinker = implicationConcept->getOperandList(); opConLinker; opConLinker = opConLinker->getNext()) { lastOpConLinker = opConLinker; if (lastOpConLinker->getData() == triggeredConcept) { return false; } } CSortedNegLinker* newBaseOpCon1 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon1->init(triggeredConcept,true); lastOpConLinker->setNext(newBaseOpCon1); implicationConcept->incOperandCount(); return true; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createBindingBackPropagationImplicationTriggeredConcept(CConcept* triggeredConcept, CConcept* impliedConcept) { CConcept* implicationConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); implicationConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); implicationConcept->initTag(nextConTag); implicationConcept->setOperatorCode(CCBACKACTIVIMPL); CSortedNegLinker* newBaseOpCon1 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon1->init(triggeredConcept,true); CSortedNegLinker* newBaseOpCon2 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon2->init(impliedConcept,false,newBaseOpCon1); implicationConcept->setOperandList(newBaseOpCon2); implicationConcept->incOperandCount(2); mConceptVec->setLocalData(nextConTag,implicationConcept); return implicationConcept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createVariableBindingPropagationImplicationTriggeredConcept(CConcept* triggeredConcept, CConcept* impliedConcept) { CConcept* implicationConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); implicationConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); implicationConcept->initTag(nextConTag); implicationConcept->setOperatorCode(CCVARBINDIMPL); CSortedNegLinker* newBaseOpCon1 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon1->init(triggeredConcept,true); CSortedNegLinker* newBaseOpCon2 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon2->init(impliedConcept,false,newBaseOpCon1); implicationConcept->setOperandList(newBaseOpCon2); implicationConcept->incOperandCount(2); mConceptVec->setLocalData(nextConTag,implicationConcept); return implicationConcept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createVariableBindingPropagationTriggerConcept() { CConcept* triggConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); triggConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); triggConcept->initTag(nextConTag); triggConcept->setOperatorCode(CCVARBINDTRIG); mConceptVec->setLocalData(nextConTag,triggConcept); return triggConcept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createVariableBindingPropagationJoiningConcept(CConcept* joinConcept1, CConcept* joinConcept2, CConcept* impliedConcept) { CConcept* joiningConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); joiningConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); joiningConcept->initTag(nextConTag); joiningConcept->setOperatorCode(CCVARBINDJOIN); CSortedNegLinker* newBaseOpCon1 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon1->init(joinConcept2,true); CSortedNegLinker* newBaseOpCon2 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon2->init(joinConcept1,true,newBaseOpCon1); CSortedNegLinker* newBaseOpCon3 = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newBaseOpCon3->init(impliedConcept,false,newBaseOpCon2); joiningConcept->setOperandList(newBaseOpCon3); joiningConcept->incOperandCount(3); mConceptVec->setLocalData(nextConTag,joiningConcept); return joiningConcept; } void CTriggeredImplicationBinaryAbsorberPreProcess::createJoiningConceptVariableList(CConcept* joiningConcept, CNominalSchemaAbsorptionBranchLinker* abLinker1, CNominalSchemaAbsorptionBranchLinker* abLinker2) { QSet* varSet1 = abLinker1->getVariableSet(); QSet* varSet2 = abLinker2->getVariableSet(); CSortedLinker* varLinker = nullptr; for (QSet::const_iterator it = varSet1->constBegin(), itEnd = varSet1->constEnd(); it != itEnd; ++it) { if (varSet2->contains(*it)) { CVariable* variable = *it; CSortedLinker* tmpVarLinker = CObjectAllocator< CSortedLinker >::allocateAndConstruct(mMemMan); tmpVarLinker->init(variable); if (varLinker) { varLinker = varLinker->insertNextSorted(tmpVarLinker); } else { varLinker = tmpVarLinker; } } } joiningConcept->setVariableLinker(varLinker); } void CTriggeredImplicationBinaryAbsorberPreProcess::createGCIPartialAbsorbedTriggeredImplication(CConcept* orConcept, bool negated, const QList& absorbList) { //CConceptRoleBranchingTrigger* branchTriggers = nullptr; //for (QList::const_iterator it = absorbList.constBegin(), itEnd = absorbList.constEnd(); it != itEnd; ++it) { // TConceptNegationPair conNegPair(*it); // CConcept* concept = conNegPair.first; // bool negated = conNegPair.second; // CConceptRoleBranchingTrigger* tmpBranchTrigger = getSimpleBranchTriggersForConcept(concept,!negated); // if (tmpBranchTrigger) { // branchTriggers = tmpBranchTrigger->append(branchTriggers); // } else { // CConceptRoleBranchingTrigger* tmpBranchTrigger = getBranchTiggers(getPartialTriggersForConcept(concept,!negated)); // branchTriggers = tmpBranchTrigger->append(branchTriggers); // } //} CConceptTriggerLinker* partialImpliedTrigger = createPartialExtendedAbsorbedImpliedTrigger(absorbList); CConcept* partialImpliedTriggerConcept = partialImpliedTrigger->getTriggerConcept(); addUnfoldingConceptForConcept(partialImpliedTriggerConcept,orConcept,negated); CConceptRoleBranchingTrigger* branchTriggers = getSimpleBranchTriggersForConcept(partialImpliedTriggerConcept,true); mBranchTriggVec->setData(orConcept->getConceptTag(),branchTriggers); } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createDisjunctionAbsorbedTriggeredImplication(CConcept* orConcept, bool negated, QList& absorbList, QList& candList) { CConcept* impliedConcept = nullptr; CConcept* implicationConcept = nullptr; bool impliedNegation = false; if (candList.isEmpty()) { candList.append(absorbList.takeFirst()); } CConceptTriggerLinker* triggers = nullptr; for (QList::const_iterator it = absorbList.constBegin(), itEnd = absorbList.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; CConceptTriggerLinker* tmpTriggers = copyTriggerLinkers(getTriggersForConcept(concept,!negated)); triggers = tmpTriggers->append(triggers); } CConceptTriggerLinker* impliedConceptTrigger = getImplicationTriggeredConceptForTriggers(triggers,&implicationConcept); impliedConcept = impliedConceptTrigger->getTriggerConcept(); if (candList.count() > 1) { CConcept* orImpliedConcept = createImpliedConcept(); for (QList::const_iterator it = candList.constBegin(), itEnd = candList.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; addConceptToImplied(orImpliedConcept,concept,negated); } orImpliedConcept->setOperatorCode(CCOR); addUnfoldingConceptForConcept(impliedConcept,orImpliedConcept,false); if (mConfPartialDisjunctionsAbsorption) { QList partialAbsorbableList; partialAbsorbableList = getPartialAbsorbableDisjuncts(candList); if (!partialAbsorbableList.isEmpty()) { CConcept* partialImpliedTriggerConcept = createPartialExtendedAbsorbedImpliedTriggerCocnept(partialAbsorbableList); CConceptRoleBranchingTrigger* branchTriggers = getSimpleBranchTriggersForConcept(partialImpliedTriggerConcept,true); mBranchTriggVec->setData(impliedConcept->getConceptTag(),branchTriggers); ++mStatGCIAbsorptionPartialExtended; } } } else { TConceptNegationPair conNegPair(candList.first()); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; addUnfoldingConceptForConcept(impliedConcept,concept,negated); } return implicationConcept; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::getRoleDomainTriggerConcept(CRole* role) { if (!mRoleDomainTriggerConceptHash) { mRoleDomainTriggerConceptHash = mTBox->getRoleDomainTriggerConceptHash(true); } CConcept*& triggerConcept = (*mRoleDomainTriggerConceptHash)[role]; if (!triggerConcept) { triggerConcept = createTriggerConcept(); addRoleDomainConcept(role,triggerConcept,false); } return triggerConcept; } CConceptTriggerLinker* CTriggeredImplicationBinaryAbsorberPreProcess::getTriggersForConcept(CConcept* concept, bool negated) { CConceptTriggerLinker* triggers = nullptr; TConceptNegationPair conNegPair(concept,negated); triggers = mConceptTriggerLinkerHash.value(conNegPair); if (!triggers) { cint64 opCode = concept->getOperatorCode(); cint64 parm = concept->getParameter(); cint64 opCount = concept->getOperandCount(); CRole* role = concept->getRole(); CSortedNegLinker* opConLinker = concept->getOperandList(); if (!negated && (opCode == CCATOM || opCode == CCSUB || opCode == CCTOP || opCode == CCIMPLTRIG)) { CConceptTriggerLinker* newTrigger = createTriggerLinker(); newTrigger->initConceptTriggerLinker(concept,1); triggers = newTrigger->append(triggers); } else if (negated && (opCode == CCOR) || !negated && (opCode == CCAND || opCode == CCEQ)) { // AND, collect triggers from operands CConceptTriggerLinker* andTriggers = nullptr; for (CSortedNegLinker* opConLinkerIt = opConLinker; opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; CConceptTriggerLinker* newTriggers = copyTriggerLinkers(getTriggersForConcept(opConcept,opNegated)); andTriggers = newTriggers->append(andTriggers); } triggers = andTriggers->append(triggers); } else if (!negated && (opCode == CCOR) || negated && (opCode == CCAND || opCode == CCEQ)) { // or trigger CConceptTriggerLinker* orTriggers = nullptr; for (CSortedNegLinker* opConLinkerIt = opConLinker; opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; CConceptTriggerLinker* newTriggers = copyTriggerLinkers(getTriggersForConcept(opConcept,opNegated)); CConceptTriggerLinker* implTriggeredConcept = getImplicationTriggeredConceptForTriggers(newTriggers,nullptr); orTriggers = implTriggeredConcept->append(orTriggers); } if (orTriggers) { if (orTriggers->hasNext()) { // more than one trigger cint64 triggerComplexity = 0; cint64 triggerCount = 0; CConcept* triggerConcept = createTriggerConcept(); for (CConceptTriggerLinker* orTriggerIt = orTriggers; orTriggerIt; orTriggerIt = orTriggerIt->getNext()) { triggerComplexity += orTriggerIt->getTriggerComplexity(); triggerCount++; addUnfoldingConceptForConcept(orTriggerIt->getTriggerConcept(),triggerConcept,false); } CConceptTriggerLinker* newTrigger = createTriggerLinker(); newTrigger->initConceptTriggerLinker(triggerConcept,(triggerComplexity+1)/triggerCount); triggers = newTrigger->append(triggers); //releaseTriggerLinkers(orTriggers); } else { // only one trigger, add simply to other triggers triggers = orTriggers->append(triggers); } } } else if (!negated && (opCode == CCSOME || opCode == CCSELF) || negated && (opCode == CCALL) || !negated && (opCode == CCATLEAST && parm == 1) || negated && (opCode == CCATMOST && parm == 0)) { CConcept* propagatedTriggerConcept = nullptr; cint64 triggerComplexity = 1; bool negateOperands = negated && (opCode == CCSOME || opCode == CCSELF || opCode == CCALL); CConceptTriggerLinker* allTriggers = nullptr; for (CSortedNegLinker* opConLinkerIt = opConLinker; opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negateOperands; if (!(!opNegated && opConcept == mTopConcept || opNegated && opConcept == mBottomConcept)) { CConceptTriggerLinker* newTrigger = copyTriggerLinkers(getTriggersForConcept(opConcept,opNegated)); allTriggers = newTrigger->append(allTriggers); } } if (allTriggers) { propagatedTriggerConcept = createTriggerConcept(); CConcept* nextLevelTriggerConcept = createTriggerPropagationConcept(propagatedTriggerConcept,role); if (allTriggers->hasNext()) { // requires a generation of an implication concept CConceptTriggerLinker* implTriggeredConcept = getImplicationTriggeredConceptForTriggers(allTriggers,nullptr); triggerComplexity += implTriggeredConcept->getTriggerComplexity(); addUnfoldingConceptForConcept(implTriggeredConcept->getTriggerConcept(),nextLevelTriggerConcept,false); } else { triggerComplexity += allTriggers->getTriggerComplexity(); addUnfoldingConceptForConcept(allTriggers->getTriggerConcept(),nextLevelTriggerConcept,false); releaseTriggerLinkers(allTriggers); } } else { CRole* locatedRole = CConceptRoleIndividualLocator::getLocatedRole(role,mOnto); propagatedTriggerConcept = getRoleDomainTriggerConcept(locatedRole); } CConceptTriggerLinker* newTrigger = createTriggerLinker(); newTrigger->initConceptTriggerLinker(propagatedTriggerConcept,triggerComplexity); triggers = newTrigger->append(triggers); } else if (!negated && (opCode == CCVALUE)) { CConcept* propagatedTriggerConcept = createTriggerConcept(); CConcept* nextLevelTriggerConcept = createTriggerPropagationConcept(propagatedTriggerConcept,role); cint64 triggerComplexity = 2; CIndividual* individual = concept->getNominalIndividual(); CIndividual* locatedIndividual = CConceptRoleIndividualLocator::getLocatedIndividual(individual,mOnto); CConceptAssertionLinker* assLinker = CObjectAllocator< CConceptAssertionLinker >::allocateAndConstruct(mMemMan); assLinker->initNegLinker(nextLevelTriggerConcept,false); locatedIndividual->addAssertionConceptLinker(assLinker); if (!mIndividualTriggerConceptHash) { mIndividualTriggerConceptHash = mTBox->getIndividualTriggerConceptHash(true); } mIndividualTriggerConceptHash->insertMulti(individual->getIndividualID(),nextLevelTriggerConcept); CConceptTriggerLinker* newTrigger = createTriggerLinker(); newTrigger->initConceptTriggerLinker(propagatedTriggerConcept,triggerComplexity); triggers = newTrigger->append(triggers); } else if (!negated && (opCode == CCNOMVAR)) { cint64 triggerComplexity = 1; CConcept* nominalTriggerConcept = mTBox->getIndividualTriggerConcept(); CConceptTriggerLinker* newTrigger = createTriggerLinker(); newTrigger->initConceptTriggerLinker(nominalTriggerConcept,triggerComplexity); triggers = newTrigger->append(triggers); } else if (!negated && (opCode == CCNOMINAL)) { CConcept* nominalTriggerConcept = createTriggerConcept(); cint64 triggerComplexity = 1; CIndividual* individual = concept->getNominalIndividual(); CIndividual* locatedIndividual = CConceptRoleIndividualLocator::getLocatedIndividual(individual,mOnto); CConceptAssertionLinker* assLinker = CObjectAllocator< CConceptAssertionLinker >::allocateAndConstruct(mMemMan); assLinker->initNegLinker(nominalTriggerConcept,false); locatedIndividual->addAssertionConceptLinker(assLinker); if (!mIndividualTriggerConceptHash) { mIndividualTriggerConceptHash = mTBox->getIndividualTriggerConceptHash(true); } mIndividualTriggerConceptHash->insertMulti(individual->getIndividualID(),nominalTriggerConcept); CConceptTriggerLinker* newTrigger = createTriggerLinker(); newTrigger->initConceptTriggerLinker(nominalTriggerConcept,triggerComplexity); triggers = newTrigger->append(triggers); } mConceptTriggerLinkerHash.insert(conNegPair,triggers); } return triggers; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::getImplicationImpliedConcept(CConcept* implicationConcept) { CConcept* impliedConcept = nullptr; cint64 param = implicationConcept->getParameter(); if (param >= 1) { CSortedNegLinker* opConLinkerIt = implicationConcept->getOperandList(); while (opConLinkerIt && param-- >= 0 && !impliedConcept) { if (!opConLinkerIt->isNegated()) { CConcept* concept = opConLinkerIt->getData(); if (concept->getOperatorCode() == CCIMPLTRIG) { impliedConcept = concept; } } opConLinkerIt = opConLinkerIt->getNext(); } } return impliedConcept; } bool CTriggeredImplicationBinaryAbsorberPreProcess::findAndReplaceImplicationFromTriggers(CConceptTriggerLinker* trigger, CConceptTriggerLinker*& otherTriggers) { if (!mConfImplicationsForTriggerReusue) { return false; } if (otherTriggers) { CConcept* concept1 = trigger->getTriggerConcept(); CConceptTriggerLinker* triggerIt = otherTriggers; CConceptTriggerLinker* lastTriggerIt = nullptr; while (triggerIt) { CConcept* concept2 = triggerIt->getTriggerConcept(); CConcept* minConcept1 = qMin(concept1,concept2); CConcept* maxConcept1 = qMax(concept1,concept2); TConceptPair conceptPair(minConcept1,maxConcept1); CConceptTriggerLinker* impliedConceptTrigger = mConceptImplicationImpliedHash.value(conceptPair); if (impliedConceptTrigger) { CConceptTriggerLinker* relTrigger = triggerIt; triggerIt = triggerIt->getNext(); relTrigger->clearNext(); *trigger = *impliedConceptTrigger; if (lastTriggerIt) { lastTriggerIt->setNext(triggerIt); } else { otherTriggers = triggerIt; } releaseTriggerLinkers(relTrigger); return true; } else { lastTriggerIt = triggerIt; triggerIt = triggerIt->getNext(); } } } return false; } CConceptTriggerLinker* CTriggeredImplicationBinaryAbsorberPreProcess::getUpdatedTriggerComplexities(CConceptTriggerLinker* triggers) { if (mConfPunishOftenSameTriggerUse) { for (CConceptTriggerLinker* triggerIt = triggers; triggerIt; triggerIt = triggerIt->getNext()) { cint64 triggerOpCount = triggerIt->getTriggerConcept()->getOperandCount(); if (triggerOpCount > mConfOftenTriggerUseCountPunishment) { cint64 triggerComplexityPunishment = triggerOpCount / mConfOftenTriggerUseCountPunishment; triggerIt->setTriggerComplexity(triggerIt->getTriggerComplexity()-triggerComplexityPunishment); } } } return triggers; } CConceptTriggerLinker* CTriggeredImplicationBinaryAbsorberPreProcess::getImplicationTriggeredConceptForTriggers(CConceptTriggerLinker* triggers, CConcept** firstImplicationConcept) { CConceptTriggerLinker* implicationTriggeredConcept = nullptr; CConceptTriggerLinker* sortedTriggers = nullptr; CConceptTriggerLinker* triggerIt = getUpdatedTriggerComplexities(triggers); while (triggerIt) { CConceptTriggerLinker* trigger = triggerIt; triggerIt = triggerIt->getNext(); trigger->clearNext(); if ((triggerIt || sortedTriggers) && trigger->getTriggerConcept() == mTopConcept) { // ignore trigger } else { bool replaced = true; bool checkSorted = false; while (replaced) { replaced = false; if (findAndReplaceImplicationFromTriggers(trigger,triggerIt)) { ++mStatReusedImplications; replaced = true; checkSorted = true; } else { if (checkSorted) { if (findAndReplaceImplicationFromTriggers(trigger,sortedTriggers)) { ++mStatReusedImplications; replaced = true; } } } } if (sortedTriggers) { sortedTriggers = sortedTriggers->insertNextSorted(trigger); } else { sortedTriggers = trigger; } } } if (firstImplicationConcept) { *firstImplicationConcept = nullptr; if (sortedTriggers) { CConceptTriggerLinker* trigger1 = sortedTriggers; CConcept* newImpliedTriggerConcept = createTriggerConcept(firstImplicationConcept != nullptr); CConcept* newImplicationConcept = createImplicationConcept(newImpliedTriggerConcept,false); addImplicationTrigger(newImplicationConcept,trigger1->getTriggerConcept(),true); trigger1->initConceptTriggerLinker(newImpliedTriggerConcept,trigger1->getTriggerComplexity()); *firstImplicationConcept = newImplicationConcept; implicationTriggeredConcept = trigger1; } } if (sortedTriggers) { if (!sortedTriggers->hasNext()) { implicationTriggeredConcept = sortedTriggers; } else { CConceptTriggerLinker* trigger1 = sortedTriggers; sortedTriggers = sortedTriggers->getNext(); triggerIt = sortedTriggers; trigger1->clearNext(); while (triggerIt) { CConceptTriggerLinker* trigger2 = triggerIt; triggerIt = triggerIt->getNext(); trigger2->clearNext(); CConcept* newImpliedTriggerConcept = createTriggerConcept(firstImplicationConcept != nullptr); CConcept* newImplicationConcept = createImplicationConcept(newImpliedTriggerConcept,false); CConcept* concept1 = trigger1->getTriggerConcept(); CConcept* concept2 = trigger2->getTriggerConcept(); addImplicationTrigger(newImplicationConcept,concept2,true); addUnfoldingConceptForConcept(concept1,newImplicationConcept,false); cint64 newTriggerComplexity = trigger1->getTriggerComplexity()+trigger2->getTriggerComplexity(); CConcept* minConcept1 = qMin(concept1,concept2); CConcept* maxConcept1 = qMax(concept1,concept2); TConceptPair conceptPair(minConcept1,maxConcept1); trigger2->initConceptTriggerLinker(newImpliedTriggerConcept,newTriggerComplexity); mConceptImplicationImpliedHash.insert(conceptPair,trigger2); trigger1->initConceptTriggerLinker(newImpliedTriggerConcept,newTriggerComplexity); } implicationTriggeredConcept = trigger1; } if (!mTriggerImplHash->contains(implicationTriggeredConcept->getTriggerConcept())) { mTriggerImplHash->insertMulti(implicationTriggeredConcept->getTriggerConcept(),nullptr); } } return implicationTriggeredConcept; } void CTriggeredImplicationBinaryAbsorberPreProcess::addUnfoldingConceptForConcept(CConcept* concept, CConcept* addingUnfoldingConcept, bool addingNegation) { cint64 opCode = concept->getOperatorCode(); if (opCode == CCTOP) { CSortedNegLinker* newOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newOpCon->init(addingUnfoldingConcept,addingNegation); mLaterTopConceptTriggerAddList.append(newOpCon); } else { CSortedNegLinker* newOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newOpCon->init(addingUnfoldingConcept,addingNegation,concept->getOperandList()); concept->setOperandList(newOpCon); concept->incOperandCount(); if (opCode == CCATOM) { concept->setOperatorCode(CCSUB); } } } void CTriggeredImplicationBinaryAbsorberPreProcess::addUnfoldingConceptForImplicationConcept(CConcept* implicationConcept, CConcept* addingUnfoldingConcept, bool addingNegation) { CSortedNegLinker* newOpCon = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); newOpCon->init(addingUnfoldingConcept,addingNegation,implicationConcept->getOperandList()); implicationConcept->setOperandList(newOpCon); implicationConcept->incOperandCount(); implicationConcept->setParameter(implicationConcept->getParameter()+1); } CConceptTriggerLinker* CTriggeredImplicationBinaryAbsorberPreProcess::createTriggerLinker() { CConceptTriggerLinker* newTrigger = mTmpTriggerLinker; if (newTrigger) { mTmpTriggerLinker = mTmpTriggerLinker->getNext(); } else { newTrigger = new CConceptTriggerLinker(); mTriggerContainer.append(newTrigger); } newTrigger->clearNext(); return newTrigger; } void CTriggeredImplicationBinaryAbsorberPreProcess::releaseTriggerLinkers(CConceptTriggerLinker* triggers) { if (triggers) { mTmpTriggerLinker = triggers->append(mTmpTriggerLinker); } } CConceptTriggerLinker* CTriggeredImplicationBinaryAbsorberPreProcess::copyTriggerLinkers(CConceptTriggerLinker* triggers) { CConceptTriggerLinker* newTriggers = nullptr; for (CConceptTriggerLinker* triggerIt = triggers; triggerIt; triggerIt = triggerIt->getNext()) { CConceptTriggerLinker* newTrigger = createTriggerLinker()->initConceptTriggerLinker(triggerIt->getTriggerConcept(),triggerIt->getTriggerComplexity()); newTriggers = newTrigger->append(newTriggers); } return newTriggers; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createTriggerConcept(bool branchTrigger) { CConcept* triggerConcept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); triggerConcept->initConcept(); cint64 nextConTag = mConceptVec->getItemCount(); triggerConcept->initTag(nextConTag); if (branchTrigger) { triggerConcept->setOperatorCode(CCBRANCHTRIG); } else { triggerConcept->setOperatorCode(CCIMPLTRIG); } mConceptVec->setLocalData(nextConTag,triggerConcept); return triggerConcept; } bool CTriggeredImplicationBinaryAbsorberPreProcess::isDisjunctionConceptSimpleTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated) { cint64 notAbsorbableCount = 0; cint64 absorbableCount = 0; CSortedNegLinker* opConLinkerIt = orConcept->getOperandList(); while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); if (isConceptSimpleImplicationTriggerable(opConcept,!opNegated^negated)) { absorbableCount++; } else { notAbsorbableCount++; } opConLinkerIt = opConLinkerIt->getNext(); } if (notAbsorbableCount <= 1) { return true; } return false; } bool CTriggeredImplicationBinaryAbsorberPreProcess::isDisjunctionConceptTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated) { cint64 notAbsorbableCount = 0; cint64 absorbableCount = 0; QHash conceptEqConAbsorbed; CSortedNegLinker* opConLinkerIt = orConcept->getOperandList(); while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); if (isConceptImplicationTriggerable(opConcept,!opNegated^negated,&conceptEqConAbsorbed)) { absorbableCount++; } else { notAbsorbableCount++; } opConLinkerIt = opConLinkerIt->getNext(); } if (notAbsorbableCount <= 1) { return true; } return false; } bool CTriggeredImplicationBinaryAbsorberPreProcess::isDisjunctionConceptPartialTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated) { CSortedNegLinker* opConLinkerIt = orConcept->getOperandList(); QSet conceptEqConAbsorbed; bool partialTriggerable = false; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); if (isConceptPartialImplicationTriggerable(opConcept,!opNegated^negated,&conceptEqConAbsorbed)) { partialTriggerable = true; } opConLinkerIt = opConLinkerIt->getNext(); } return partialTriggerable; } bool CTriggeredImplicationBinaryAbsorberPreProcess::isEquivalenceConceptTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated, cint64* notAbsorbableOperandsCount) { cint64 notAbsorbableCount = 0; cint64 opCode = orConcept->getOperatorCode(); QHash conceptEqConAbsorbed; if (!negated && opCode == CCEQ) { CSortedNegLinker* opConLinkerIt = orConcept->getOperandList(); while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); if (!isConceptImplicationTriggerable(opConcept,opNegated,&conceptEqConAbsorbed)) { return false; } opConLinkerIt = opConLinkerIt->getNext(); } } return true; } bool CTriggeredImplicationBinaryAbsorberPreProcess::isEquivalenceConceptCandidateExtractable(CConcept* orConcept, bool negated) { cint64 notAbsorbableCount = 0; cint64 opCode = orConcept->getOperatorCode(); QSet conceptEqConAbsorbed; bool partialTriggerable = false; if (!negated && opCode == CCEQ) { CSortedNegLinker* opConLinkerIt = orConcept->getOperandList(); while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); if (isConceptPartialImplicationTriggerable(opConcept,opNegated,&conceptEqConAbsorbed)) { partialTriggerable = true; } opConLinkerIt = opConLinkerIt->getNext(); } } return partialTriggerable; } bool CTriggeredImplicationBinaryAbsorberPreProcess::isGCIConceptTriggeredImplicationAbsorbable(CConcept* orConcept, bool negated, cint64* notAbsorbableOperandsCount) { bool absorbable = false; cint64 notAbsorbableCount = 0; cint64 opCode = orConcept->getOperatorCode(); QHash conceptEqConAbsorbed; if (!negated && opCode == CCOR || negated && opCode == CCAND) { CSortedNegLinker* opConLinkerIt = orConcept->getOperandList(); while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); if (isConceptImplicationTriggerable(opConcept,!opNegated,&conceptEqConAbsorbed)) { absorbable = true; } else { notAbsorbableCount++; } opConLinkerIt = opConLinkerIt->getNext(); } } if (notAbsorbableOperandsCount) { *notAbsorbableOperandsCount = notAbsorbableCount; } return absorbable; } bool CTriggeredImplicationBinaryAbsorberPreProcess::isConceptSimpleImplicationTriggerable(CConcept* concept, bool negated) { cint64 opCode = concept->getOperatorCode(); cint64 parm = concept->getParameter(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opConLinker = concept->getOperandList(); if (!negated && (opCode == CCSUB || opCode == CCATOM || opCode == CCIMPLTRIG)) { return true; } else if (!negated && (opCode == CCAND || opCode == CCEQ) || negated && opCode == CCOR) { if (opCount >= 1) { bool allOpsTriggerable = true; CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt && allOpsTriggerable) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; allOpsTriggerable &= isConceptSimpleImplicationTriggerable(opConcept,opNegated); opConLinkerIt = opConLinkerIt->getNext(); } return allOpsTriggerable; } } else { if (mConceptTriggerLinkerHash.contains(TConceptNegationPair(concept,negated))) { return true; } } return false; } void CTriggeredImplicationBinaryAbsorberPreProcess::mergeDependingCacheList(QList** dependingCacheList, QList** subDependingCacheList) { if (*subDependingCacheList) { if (!*dependingCacheList) { *dependingCacheList = *subDependingCacheList; } else { (*dependingCacheList)->append(**subDependingCacheList); delete *subDependingCacheList; } *subDependingCacheList = nullptr; } } bool CTriggeredImplicationBinaryAbsorberPreProcess::isConceptImplicationTriggerable(CConcept* concept, bool negated, QHash* conceptEqConAbsorbed) { cint64 openMultipleOccurCount = 0; QList* dependingCacheList = nullptr; return isConceptImplicationTriggerable(concept,negated,conceptEqConAbsorbed,&openMultipleOccurCount,&dependingCacheList); } bool CTriggeredImplicationBinaryAbsorberPreProcess::isConceptImplicationTriggerable(CConcept* concept, bool negated, QHash* conceptEqConAbsorbed, cint64* openMultipleOccurCount, QList** dependingCacheList) { TConceptNegationPair conNegPair(concept,negated); if (mConceptTotalAbsorbableHash.contains(conNegPair)) { return mConceptTotalAbsorbableHash.value(conNegPair); } cint64 opCode = concept->getOperatorCode(); cint64 parm = concept->getParameter(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opConLinker = concept->getOperandList(); bool absorbable = false; QList* subDependingCacheList = nullptr; if (!negated && (opCode == CCSUB || opCode == CCATOM || opCode == CCTOP || opCode == CCIMPLTRIG)) { absorbable = true; } else if (!negated && (opCode == CCNOMINAL)) { absorbable = true; } else if (!negated && (opCode == CCNOMVAR)) { absorbable = true; } else if (!negated && (opCode == CCVALUE)) { absorbable = true; } else if (!negated && (opCode == CCSOME) || negated && (opCode == CCALL)) { if (!opConLinker) { absorbable = true; } else { bool allOpsTriggerable = true; CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt && allOpsTriggerable) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; allOpsTriggerable &= isConceptImplicationTriggerable(opConcept,opNegated,conceptEqConAbsorbed,openMultipleOccurCount,&subDependingCacheList); mergeDependingCacheList(dependingCacheList,&subDependingCacheList); opConLinkerIt = opConLinkerIt->getNext(); } absorbable = allOpsTriggerable; } } else if (!negated && (opCode == CCATLEAST && parm == 1) || negated && (opCode == CCATMOST && parm == 0)) { if (!opConLinker) { absorbable = true; } else { bool allOpsTriggerable = true; CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt && allOpsTriggerable) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated(); allOpsTriggerable &= isConceptImplicationTriggerable(opConcept,opNegated,conceptEqConAbsorbed,openMultipleOccurCount,&subDependingCacheList); mergeDependingCacheList(dependingCacheList,&subDependingCacheList); opConLinkerIt = opConLinkerIt->getNext(); } absorbable = allOpsTriggerable; } } else if (opCode == CCAND || opCode == CCOR) { bool allOpsTriggerable = true; CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt && allOpsTriggerable) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; allOpsTriggerable &= isConceptImplicationTriggerable(opConcept,opNegated,conceptEqConAbsorbed,openMultipleOccurCount,&subDependingCacheList); mergeDependingCacheList(dependingCacheList,&subDependingCacheList); opConLinkerIt = opConLinkerIt->getNext(); } absorbable = allOpsTriggerable; } else if (opCode == CCEQ) { if (negated) { absorbable = false; } else { TOccuredAbsorbablePair& occAbsPair = (*conceptEqConAbsorbed)[concept]; if (occAbsPair.first) { if (!occAbsPair.second) { occAbsPair.second = true; ++(*openMultipleOccurCount); } if (!*dependingCacheList) { *dependingCacheList = new QList(); } absorbable = true; } else { occAbsPair.first = true; bool allOpsTriggerable = true; CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt && allOpsTriggerable) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; allOpsTriggerable &= isConceptImplicationTriggerable(opConcept,opNegated,conceptEqConAbsorbed,openMultipleOccurCount,&subDependingCacheList); mergeDependingCacheList(dependingCacheList,&subDependingCacheList); opConLinkerIt = opConLinkerIt->getNext(); } if (*dependingCacheList) { if (!allOpsTriggerable) { for (QList::const_iterator it = (*dependingCacheList)->constBegin(), itEnd = (*dependingCacheList)->constEnd(); it != itEnd; ++it) { TConceptNegationPair upConNegPair(*it); mConceptTotalAbsorbableHash.insert(upConNegPair,false); } delete *dependingCacheList; *dependingCacheList = nullptr; } } if (occAbsPair.second) { if (--(*openMultipleOccurCount) <= 0) { if (*dependingCacheList && allOpsTriggerable) { for (QList::const_iterator it = (*dependingCacheList)->constBegin(), itEnd = (*dependingCacheList)->constEnd(); it != itEnd; ++it) { TConceptNegationPair upConNegPair(*it); mConceptTotalAbsorbableHash.insert(upConNegPair,true); } delete *dependingCacheList; *dependingCacheList = nullptr; } } } absorbable = allOpsTriggerable; } } } else { absorbable = false; } if (absorbable) { if (*dependingCacheList) { (*dependingCacheList)->append(conNegPair); } else { mConceptTotalAbsorbableHash.insert(conNegPair,absorbable); } } else { mConceptTotalAbsorbableHash.insert(conNegPair,absorbable); } return absorbable; } bool CTriggeredImplicationBinaryAbsorberPreProcess::absorbGCIConceptsToTriggeredImplications(CConcept* orConcept, bool negated) { cint64 opCode = orConcept->getOperatorCode(); if (!negated && opCode == CCOR || negated && opCode == CCAND) { QList candList; if (addAbsorbableDisjunctCandidates(orConcept,negated,candList)) { if (candList.count() >= 1) { QList absorbList(splitAbsorbableDisjuncts(candList)); if (!absorbList.isEmpty()) { createGCIAbsorbedTriggeredImplication(orConcept,negated,absorbList,candList); return true; } } } } return false; } bool CTriggeredImplicationBinaryAbsorberPreProcess::isConceptPartialImplicationTriggerable(CConcept* concept, bool negated, QSet* conceptEqConAbsorbed) { TConceptNegationPair conNegPair(concept,negated); if (mConceptPartialAbsorbableHash.contains(conNegPair)) { return mConceptPartialAbsorbableHash.value(conNegPair); } cint64 opCode = concept->getOperatorCode(); cint64 parm = concept->getParameter(); cint64 opCount = concept->getOperandCount(); CSortedNegLinker* opConLinker = concept->getOperandList(); bool absorbable = false; if (!negated && (opCode == CCSUB || opCode == CCATOM || opCode == CCTOP || opCode == CCIMPLTRIG)) { absorbable = true; } else if (!negated && (opCode == CCNOMINAL)) { absorbable = true; } else if (!negated && (opCode == CCNOMVAR)) { absorbable = true; } else if (!negated && (opCode == CCVALUE)) { absorbable = true; } else if (!negated && (opCode == CCSELF)) { absorbable = true; } else if (!negated && (opCode == CCSOME) || negated && (opCode == CCALL)) { CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; isConceptPartialImplicationTriggerable(opConcept,opNegated,conceptEqConAbsorbed); opConLinkerIt = opConLinkerIt->getNext(); } absorbable = true; } else if (!negated && (opCode == CCATLEAST && parm >= 1) || negated && (opCode == CCATMOST && parm >= 0)) { CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; isConceptPartialImplicationTriggerable(opConcept,opNegated,conceptEqConAbsorbed); opConLinkerIt = opConLinkerIt->getNext(); } absorbable = true; } else if (!negated && (opCode == CCAND) || negated && opCode == CCOR) { // AND, at least one operand has to be triggerable if (opCount >= 1) { CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; if (isConceptPartialImplicationTriggerable(opConcept,opNegated,conceptEqConAbsorbed)) { absorbable = true; } opConLinkerIt = opConLinkerIt->getNext(); } } } else if (negated && (opCode == CCAND) || !negated && opCode == CCOR) { // OR, all operands have to be triggerable if (opCount >= 1) { bool allOpsTriggerable = true; CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt && allOpsTriggerable) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; allOpsTriggerable &= isConceptPartialImplicationTriggerable(opConcept,opNegated,conceptEqConAbsorbed); opConLinkerIt = opConLinkerIt->getNext(); } absorbable = allOpsTriggerable; } } else if (opCode == CCEQ) { if (negated) { absorbable = false; } else { if (conceptEqConAbsorbed->contains(concept)) { mEQNotConceptPartialAbsorbableSet.insert(concept); return false; } else { // AND, at least one operand has to be triggerable if (opCount >= 1) { conceptEqConAbsorbed->insert(concept); CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; if (isConceptPartialImplicationTriggerable(opConcept,opNegated,conceptEqConAbsorbed)) { absorbable = true; } opConLinkerIt = opConLinkerIt->getNext(); } } if (mEQNotConceptPartialAbsorbableSet.contains(concept)) { absorbable = false; } } } } else if (!negated && (opCode == CCDATALITERAL)) { if (mConfDatatypeAbsorption) { CDataLiteral* dataLiteral = concept->getDataLiteral(); if (dataLiteral) { CDataLiteralValue* dataLitValue = dataLiteral->getDataLiteralValue(); if (dataLitValue) { if (dataLitValue->getDataValueType() == CDataLiteralValue::DLVT_REAL) { absorbable = true; } if (dataLitValue->getDataValueType() == CDataLiteralValue::DLVT_STRING) { absorbable = true; } if (dataLitValue->getDataValueType() == CDataLiteralValue::DLVT_BOOLEAN) { absorbable = true; } if (dataLitValue->getDataValueType() == CDataLiteralValue::DLVT_DOUBLE) { absorbable = true; } if (dataLitValue->getDataValueType() == CDataLiteralValue::DLVT_FLOAT) { absorbable = true; } if (dataLitValue->getDataValueType() == CDataLiteralValue::DLVT_IRI) { absorbable = true; } if (dataLitValue->getDataValueType() == CDataLiteralValue::DLVT_XML) { absorbable = true; } if (dataLitValue->getDataValueType() == CDataLiteralValue::DLVT_HEXBINARY) { absorbable = true; } if (dataLitValue->getDataValueType() == CDataLiteralValue::DLVT_BASE64BINARY) { absorbable = true; } if (dataLitValue->getDataValueType() == CDataLiteralValue::DLVT_DATETIME) { absorbable = true; } } } } } else if (!negated && (opCode == CCDATARESTRICTION)) { if (mConfDatatypeAbsorption) { cint64 dataRestrictionType = parm; CDatatype* datatype = concept->getDatatype(); if (datatype->isBasicDatatype()) { CDatatype::DATATYPE_BASIC_TYPE datatypeType = datatype->getBasicDatatypeType(); if (datatypeType == CDatatype::DBT_REAL) { if (dataRestrictionType == CDFC_RATIONAL) { absorbable = true; } else if (dataRestrictionType == CDFC_DECIMAL) { absorbable = true; } else if (dataRestrictionType == CDFC_INTEGER) { absorbable = true; } } if (datatypeType == CDatatype::DBT_STRING) { if (dataRestrictionType == CDFC_STRING) { absorbable = true; } } if (datatypeType == CDatatype::DBT_REAL || datatypeType == CDatatype::DBT_STRING || datatypeType == CDatatype::DBT_BOOLEAN || datatypeType == CDatatype::DBT_DOUBLE || datatypeType == CDatatype::DBT_DATETIME || datatypeType == CDatatype::DBT_FLOAT || datatypeType == CDatatype::DBT_IRI || datatypeType == CDatatype::DBT_XML || datatypeType == CDatatype::DBT_HEXBINARY || datatypeType == CDatatype::DBT_BASE64BINARY) { CDataLiteral* dataLiteral = concept->getDataLiteral(); if (!dataLiteral || !dataLiteral->getDatatype() || !dataLiteral->getDataLiteralValue() || dataLiteral->getDatatype()->getValueSpaceType() != datatype->getValueSpaceType()) { absorbable = false; } else { if (dataRestrictionType == CDFC_MIN_EXCLUSIVE) { absorbable = true; } else if (dataRestrictionType == CDFC_MIN_INCLUSIVE) { absorbable = true; } else if (dataRestrictionType == CDFC_MAX_INCLUSIVE) { absorbable = true; } else if (dataRestrictionType == CDFC_MAX_EXCLUSIVE) { absorbable = true; } } } } } } else if (!negated && (opCode == CCDATATYPE)) { if (mConfDatatypeAbsorption) { CDatatype* datatype = concept->getDatatype(); if (datatype->isBasicDatatype()) { CDatatype::DATATYPE_BASIC_TYPE datatypeType = datatype->getBasicDatatypeType(); if (datatypeType == CDatatype::DBT_REAL || datatypeType == CDatatype::DBT_STRING || datatypeType == CDatatype::DBT_BOOLEAN || datatypeType == CDatatype::DBT_DOUBLE || datatypeType == CDatatype::DBT_DATETIME || datatypeType == CDatatype::DBT_FLOAT || datatypeType == CDatatype::DBT_IRI || datatypeType == CDatatype::DBT_XML || datatypeType == CDatatype::DBT_HEXBINARY || datatypeType == CDatatype::DBT_BASE64BINARY) { absorbable = true; } } else { if (opCount >= 1) { CSortedNegLinker* opConLinkerIt = opConLinker; while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; if (isConceptPartialImplicationTriggerable(opConcept,opNegated,conceptEqConAbsorbed)) { absorbable = true; } opConLinkerIt = opConLinkerIt->getNext(); } } } } } else { absorbable = false; } mConceptPartialAbsorbableHash.insert(conNegPair,absorbable); return absorbable; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createPartialExtendedAbsorbedImpliedTriggerCocnept(const QList& absorbList) { CConceptTriggerLinker* trigger = createPartialExtendedAbsorbedImpliedTrigger(absorbList); if (trigger) { return trigger->getTriggerConcept(); } return nullptr; } CConceptTriggerLinker* CTriggeredImplicationBinaryAbsorberPreProcess::createPartialExtendedAbsorbedImpliedTrigger(const QList& absorbList) { CConceptTriggerLinker* triggers = nullptr; for (QList::const_iterator it = absorbList.constBegin(), itEnd = absorbList.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; CConceptTriggerLinker* tmpTriggers = copyTriggerLinkers(getPartialTriggersForConcept(concept,!negated)); triggers = tmpTriggers->append(triggers); } CConceptTriggerLinker* impliedConceptTrigger = getImplicationTriggeredConceptForTriggers(triggers,nullptr); return impliedConceptTrigger; } CConcept* CTriggeredImplicationBinaryAbsorberPreProcess::createPartialExtendedAbsorbedTriggeredImplication(CConcept* impliedConcept, bool impliedNegation, const QList& absorbList) { CConcept* implicationConcept = nullptr; CConceptTriggerLinker* triggers = nullptr; for (QList::const_iterator it = absorbList.constBegin(), itEnd = absorbList.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; CConceptTriggerLinker* tmpTriggers = copyTriggerLinkers(getPartialTriggersForConcept(concept,!negated)); triggers = tmpTriggers->append(triggers); } CConceptTriggerLinker* impliedConceptTrigger = getImplicationTriggeredConceptForTriggers(triggers,&implicationConcept); addUnfoldingConceptForConcept(impliedConceptTrigger->getTriggerConcept(),impliedConcept,impliedNegation); return implicationConcept; } void CTriggeredImplicationBinaryAbsorberPreProcess::createGCIAbsorbedTriggeredImplication(CConcept* orConcept, bool negated, QList& absorbList, QList& candList) { CConcept* impliedConcept = nullptr; bool impliedNegation = false; if (candList.isEmpty()) { candList.append(TConceptNegationPair(mTopConcept,true)); } CConceptTriggerLinker* triggers = nullptr; for (QList::const_iterator it = absorbList.constBegin(), itEnd = absorbList.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; CConceptTriggerLinker* tmpTriggers = copyTriggerLinkers(getTriggersForConcept(concept,!negated)); triggers = tmpTriggers->append(triggers); } CConcept* partialImpliedTriggerConcept = nullptr; if (candList.count() > 1) { QList partialAbsorbableList; if (mConfPartialGCIAbsorption) { partialAbsorbableList = getPartialAbsorbableDisjuncts(candList); if (!partialAbsorbableList.isEmpty()) { CConceptTriggerLinker* partialImpliedTrigger = createPartialExtendedAbsorbedImpliedTrigger(partialAbsorbableList); partialImpliedTriggerConcept = partialImpliedTrigger->getTriggerConcept(); triggers = partialImpliedTrigger->append(triggers); } } } CConceptTriggerLinker* impliedConceptTrigger = getImplicationTriggeredConceptForTriggers(triggers,nullptr); impliedConcept = impliedConceptTrigger->getTriggerConcept(); if (candList.count() > 1) { CConcept* orImpliedConcept = createImpliedConcept(); for (QList::const_iterator it = candList.constBegin(), itEnd = candList.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; addConceptToImplied(orImpliedConcept,concept,negated); } orImpliedConcept->setOperatorCode(CCOR); addUnfoldingConceptForConcept(impliedConcept,orImpliedConcept,false); if (partialImpliedTriggerConcept) { CConceptRoleBranchingTrigger* branchTriggers = getSimpleBranchTriggersForConcept(partialImpliedTriggerConcept,true); mBranchTriggVec->setData(impliedConcept->getConceptTag(),branchTriggers); ++mStatGCIAbsorptionPartialExtended; } } else { TConceptNegationPair conNegPair(candList.first()); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; addUnfoldingConceptForConcept(impliedConcept,concept,negated); } } CConceptRoleBranchingTrigger* CTriggeredImplicationBinaryAbsorberPreProcess::getBranchTiggers(CConceptTriggerLinker* triggers) { CConceptRoleBranchingTrigger* branchingTriggerLinker = nullptr; for (CConceptTriggerLinker* triggerIt = triggers; triggerIt; triggerIt = triggerIt->getNext()) { CConceptRoleBranchingTrigger* branchingTrigger = nullptr; branchingTrigger = CObjectAllocator< CConceptRoleBranchingTrigger >::allocateAndConstruct(mMemMan); branchingTrigger->initConceptBranchingTrigger(triggerIt->getTriggerConcept(),false); branchingTriggerLinker = branchingTrigger->append(branchingTriggerLinker); } return branchingTriggerLinker; } CConceptRoleBranchingTrigger* CTriggeredImplicationBinaryAbsorberPreProcess::getSimpleBranchTriggersForConcept(CConcept* concept, bool negated) { CConceptRoleBranchingTrigger* branchingTrigger = nullptr; cint64 conOpCount = concept->getOperandCount(); qint64 conOpCode = concept->getOperatorCode(); if ((conOpCode == CCSUB || conOpCode == CCATOM || conOpCode == CCIMPLTRIG) && !negated) { branchingTrigger = CObjectAllocator< CConceptRoleBranchingTrigger >::allocateAndConstruct(mMemMan); branchingTrigger->initConceptBranchingTrigger(concept,false); } else if (conOpCode == CCALL && !negated || conOpCode == CCSOME && negated || conOpCode == CCATMOST && !negated || conOpCode == CCATLEAST && negated && conOpCount > 0) { CRole* role = concept->getRole(); CRole* locatedRole = CConceptRoleIndividualLocator::getLocatedRole(role,mOnto); CConcept* triggerConcept = getRoleDomainTriggerConcept(locatedRole); branchingTrigger = CObjectAllocator< CConceptRoleBranchingTrigger >::allocateAndConstruct(mMemMan); branchingTrigger->initConceptBranchingTrigger(triggerConcept,false); } return branchingTrigger; } CConceptTriggerLinker* CTriggeredImplicationBinaryAbsorberPreProcess::getPartialTriggersForConcept(CConcept* concept, bool negated) { CConceptTriggerLinker* triggers = nullptr; TConceptNegationPair conNegPair(concept,negated); triggers = mConceptTriggerLinkerHash.value(conNegPair); if (!triggers) { cint64 opCode = concept->getOperatorCode(); cint64 parm = concept->getParameter(); cint64 opCount = concept->getOperandCount(); CRole* role = concept->getRole(); CSortedNegLinker* opConLinker = concept->getOperandList(); if (!negated && (opCode == CCATOM || opCode == CCSUB|| opCode == CCTOP || opCode == CCIMPLTRIG)) { CConceptTriggerLinker* newTrigger = createTriggerLinker(); newTrigger->initConceptTriggerLinker(concept,1); triggers = newTrigger->append(triggers); } else if (negated && (opCode == CCOR) || !negated && (opCode == CCAND || opCode == CCEQ)) { // AND, collect triggers from operands if (opCode != CCEQ || !mEQNotConceptPartialAbsorbableSet.contains(concept)) { CConceptTriggerLinker* andTriggers = nullptr; for (CSortedNegLinker* opConLinkerIt = opConLinker; opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; if (mConceptPartialAbsorbableHash.value(TConceptNegationPair(opConcept,opNegated),false) || mConceptTotalAbsorbableHash.value(TConceptNegationPair(opConcept,opNegated),false)) { CConceptTriggerLinker* newTriggers = copyTriggerLinkers(getPartialTriggersForConcept(opConcept,opNegated)); if (newTriggers) { andTriggers = newTriggers->append(andTriggers); } } } if (opCode == CCEQ) { CConceptTriggerLinker* implTriggers = getImplicationTriggeredConceptForTriggers(andTriggers,nullptr); andTriggers = implTriggers; } if (andTriggers) { triggers = andTriggers->append(triggers); } } } else if (!negated && (opCode == CCOR) || negated && (opCode == CCAND || opCode == CCEQ)) { // or trigger CConceptTriggerLinker* orTriggers = nullptr; for (CSortedNegLinker* opConLinkerIt = opConLinker; opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; CConceptTriggerLinker* newTriggers = copyTriggerLinkers(getPartialTriggersForConcept(opConcept,opNegated)); if (newTriggers) { CConceptTriggerLinker* implTriggeredConcept = getImplicationTriggeredConceptForTriggers(newTriggers,nullptr); orTriggers = implTriggeredConcept->append(orTriggers); } } if (orTriggers) { if (orTriggers->hasNext()) { // more than one trigger cint64 minTriggerComplexity = 0; CConcept* triggerConcept = createTriggerConcept(); for (CConceptTriggerLinker* orTriggerIt = orTriggers; orTriggerIt; orTriggerIt = orTriggerIt->getNext()) { minTriggerComplexity = qMin(orTriggerIt->getTriggerComplexity(),minTriggerComplexity); addUnfoldingConceptForConcept(orTriggerIt->getTriggerConcept(),triggerConcept,false); } CConceptTriggerLinker* newTrigger = createTriggerLinker(); newTrigger->initConceptTriggerLinker(triggerConcept,minTriggerComplexity); triggers = newTrigger->append(triggers); //releaseTriggerLinkers(orTriggers); } else { // only one trigger, add simply to other triggers triggers = orTriggers->append(triggers); } } } else if (!negated && (opCode == CCSOME || opCode == CCSELF) || negated && (opCode == CCALL) || !negated && (opCode == CCATLEAST) || negated && (opCode == CCATMOST)) { CConcept* propagatedTriggerConcept = nullptr; cint64 triggerComplexity = 1; bool negateOperands = negated && (opCode == CCSOME || opCode == CCSELF || opCode == CCALL); CConceptTriggerLinker* allTriggers = nullptr; for (CSortedNegLinker* opConLinkerIt = opConLinker; opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negateOperands; if (!(!opNegated && opConcept == mTopConcept || opNegated && opConcept == mBottomConcept)) { if (mConceptPartialAbsorbableHash.value(TConceptNegationPair(opConcept,opNegated),false) || mConceptTotalAbsorbableHash.value(TConceptNegationPair(opConcept,opNegated),false)) { CConceptTriggerLinker* newTrigger = copyTriggerLinkers(getPartialTriggersForConcept(opConcept,opNegated)); if (newTrigger) { allTriggers = newTrigger->append(allTriggers); } } } } if (allTriggers) { propagatedTriggerConcept = createTriggerConcept(); CConcept* nextLevelTriggerConcept = createTriggerPropagationConcept(propagatedTriggerConcept,role); if (allTriggers->hasNext()) { // requires a generation of an implication concept CConceptTriggerLinker* implTriggeredConcept = getImplicationTriggeredConceptForTriggers(allTriggers,nullptr); triggerComplexity += implTriggeredConcept->getTriggerComplexity(); addUnfoldingConceptForConcept(implTriggeredConcept->getTriggerConcept(),nextLevelTriggerConcept,false); } else { triggerComplexity += allTriggers->getTriggerComplexity(); addUnfoldingConceptForConcept(allTriggers->getTriggerConcept(),nextLevelTriggerConcept,false); releaseTriggerLinkers(allTriggers); } } else { CRole* locatedRole = CConceptRoleIndividualLocator::getLocatedRole(role,mOnto); propagatedTriggerConcept = getRoleDomainTriggerConcept(locatedRole); } CConceptTriggerLinker* newTrigger = createTriggerLinker(); newTrigger->initConceptTriggerLinker(propagatedTriggerConcept,triggerComplexity); triggers = newTrigger->append(triggers); } else if (!negated && (opCode == CCVALUE)) { CConcept* propagatedTriggerConcept = createTriggerConcept(); CConcept* nextLevelTriggerConcept = createTriggerPropagationConcept(propagatedTriggerConcept,role); cint64 triggerComplexity = 2; CIndividual* individual = concept->getNominalIndividual(); CIndividual* locatedIndividual = CConceptRoleIndividualLocator::getLocatedIndividual(individual,mOnto); CConceptAssertionLinker* assLinker = CObjectAllocator< CConceptAssertionLinker >::allocateAndConstruct(mMemMan); assLinker->initNegLinker(nextLevelTriggerConcept,false); locatedIndividual->addAssertionConceptLinker(assLinker); if (!mIndividualTriggerConceptHash) { mIndividualTriggerConceptHash = mTBox->getIndividualTriggerConceptHash(true); } mIndividualTriggerConceptHash->insertMulti(individual->getIndividualID(),nextLevelTriggerConcept); CConceptTriggerLinker* newTrigger = createTriggerLinker(); newTrigger->initConceptTriggerLinker(propagatedTriggerConcept,triggerComplexity); triggers = newTrigger->append(triggers); } else if (!negated && (opCode == CCNOMVAR)) { cint64 triggerComplexity = 1; CConcept* nominalTriggerConcept = mTBox->getIndividualTriggerConcept(); CConceptTriggerLinker* newTrigger = createTriggerLinker(); newTrigger->initConceptTriggerLinker(nominalTriggerConcept,triggerComplexity); triggers = newTrigger->append(triggers); } else if (!negated && (opCode == CCNOMINAL)) { CConcept* nominalTriggerConcept = createTriggerConcept(); cint64 triggerComplexity = 1; CIndividual* individual = concept->getNominalIndividual(); CIndividual* locatedIndividual = CConceptRoleIndividualLocator::getLocatedIndividual(individual,mOnto); CConceptAssertionLinker* assLinker = CObjectAllocator< CConceptAssertionLinker >::allocateAndConstruct(mMemMan); assLinker->initNegLinker(nominalTriggerConcept,false); locatedIndividual->addAssertionConceptLinker(assLinker); if (!mIndividualTriggerConceptHash) { mIndividualTriggerConceptHash = mTBox->getIndividualTriggerConceptHash(true); } mIndividualTriggerConceptHash->insertMulti(individual->getIndividualID(),nominalTriggerConcept); CConceptTriggerLinker* newTrigger = createTriggerLinker(); newTrigger->initConceptTriggerLinker(nominalTriggerConcept,triggerComplexity); triggers = newTrigger->append(triggers); } else if (!negated && (opCode == CCDATALITERAL)) { if (mConfDatatypeAbsorption) { CDataLiteral* dataLiteral = concept->getDataLiteral(); if (dataLiteral) { CDataLiteralValue* dataLitValue = dataLiteral->getDataLiteralValue(); if (dataLitValue) { cint64 triggerComplexity = 2; CConcept* valueTriggerConcept = createTriggerConcept(); CConceptTriggerLinker* valueTrigger = createTriggerLinker(); valueTrigger->initConceptTriggerLinker(valueTriggerConcept,triggerComplexity); CDatatypeValueSpaceConceptTriggerLinker* valueSpaceConceptTriggerLinker = createValueSpaceConceptTriggerLinker(); valueSpaceConceptTriggerLinker->initConceptTrigger(valueTriggerConcept); CDatatypeValueSpaceTriggers* valueSpaceTrigger = nullptr; CDataLiteral* dataLiteral = concept->getDataLiteral(); if (dataLiteral) { CDataLiteralValue* dataLitValue = dataLiteral->getDataLiteralValue(); if (dataLitValue) { CDataLiteralCompareValue* compareDataLitValue = dynamic_cast(dataLitValue); if (compareDataLitValue) { CDatatypeValueSpaceType* valueSpaceType = nullptr; CDataLiteralValue::DATA_LITERAL_VALUE_TYPE dataLiteralValueType = compareDataLitValue->getDataValueType(); CDatatypeValueSpaceTypes* valueSpaceTypes = CDatatypeValueSpaceTypes::getValueSpaceTypes(); if (dataLiteralValueType == CDataLiteralValue::DLVT_REAL) { valueSpaceType = valueSpaceTypes->getValueSpaceRealType(); } else if (dataLiteralValueType == CDataLiteralValue::DLVT_STRING) { valueSpaceType = valueSpaceTypes->getValueSpaceStringType(); } else if (dataLiteralValueType == CDataLiteralValue::DLVT_BOOLEAN) { valueSpaceType = valueSpaceTypes->getValueSpaceBooleanType(); } else if (dataLiteralValueType == CDataLiteralValue::DLVT_DOUBLE) { valueSpaceType = valueSpaceTypes->getValueSpaceDoubleType(); } else if (dataLiteralValueType == CDataLiteralValue::DLVT_FLOAT) { valueSpaceType = valueSpaceTypes->getValueSpaceFloatType(); } else if (dataLiteralValueType == CDataLiteralValue::DLVT_IRI) { valueSpaceType = valueSpaceTypes->getValueSpaceIRIType(); } else if (dataLiteralValueType == CDataLiteralValue::DLVT_XML) { valueSpaceType = valueSpaceTypes->getValueSpaceXMLType(); } else if (dataLiteralValueType == CDataLiteralValue::DLVT_HEXBINARY) { valueSpaceType = valueSpaceTypes->getValueSpaceBinaryHexDataType(); } else if (dataLiteralValueType == CDataLiteralValue::DLVT_BASE64BINARY) { valueSpaceType = valueSpaceTypes->getValueSpaceBinaryBase64DataType(); } else if (dataLiteralValueType == CDataLiteralValue::DLVT_DATETIME) { valueSpaceType = valueSpaceTypes->getValueSpaceDateTimeType(); } if (valueSpaceType) { CDatatypeValueSpacesTriggers* valueSpacesTriggers = mMBox->getValueSpacesTriggers(true); CDatatypeValueSpaceCompareTriggers* compareValueSpaceConceptTrigger = (CDatatypeValueSpaceCompareTriggers*)valueSpacesTriggers->getValueSpaceTriggers(valueSpaceType); if (compareValueSpaceConceptTrigger) { compareValueSpaceConceptTrigger->addValueConceptTrigger(compareDataLitValue,valueSpaceConceptTriggerLinker); } } } } } triggers = valueTrigger->append(triggers); } } } } else if (!negated && (opCode == CCDATATYPE)) { if (mConfDatatypeAbsorption) { CDatatype* datatype = concept->getDatatype(); if (datatype && datatype->isBasicDatatype()) { cint64 triggerComplexity = 1; CConcept* valueTriggerConcept = createTriggerConcept(); CConceptTriggerLinker* valueTrigger = createTriggerLinker(); valueTrigger->initConceptTriggerLinker(valueTriggerConcept,triggerComplexity); CDatatypeValueSpaceConceptTriggerLinker* valueSpaceConceptTriggerLinker = createValueSpaceConceptTriggerLinker(); valueSpaceConceptTriggerLinker->initConceptTrigger(valueTriggerConcept); CDatatypeValueSpaceTriggers* valueSpaceTrigger = nullptr; CDatatypeValueSpaceType* valueSpaceType = datatype->getValueSpaceType(); if (valueSpaceType) { CDatatypeValueSpacesTriggers* valueSpacesTriggers = mMBox->getValueSpacesTriggers(true); CDatatypeValueSpaceCompareTriggers* compareValueSpaceConceptTrigger = (CDatatypeValueSpaceCompareTriggers*)valueSpacesTriggers->getValueSpaceTriggers(valueSpaceType); if (compareValueSpaceConceptTrigger) { compareValueSpaceConceptTrigger->addValueSpaceConceptTrigger(valueSpaceConceptTriggerLinker); } } triggers = valueTrigger->append(triggers); } else { CConceptTriggerLinker* andTriggers = nullptr; for (CSortedNegLinker* opConLinkerIt = opConLinker; opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; if (mConceptPartialAbsorbableHash.value(TConceptNegationPair(opConcept,opNegated),false) || mConceptTotalAbsorbableHash.value(TConceptNegationPair(opConcept,opNegated),false)) { CConceptTriggerLinker* newTriggers = copyTriggerLinkers(getPartialTriggersForConcept(opConcept,opNegated)); if (newTriggers) { andTriggers = newTriggers->append(andTriggers); } } } if (andTriggers) { triggers = andTriggers->append(triggers); } } } } else if (!negated && (opCode == CCDATARESTRICTION)) { if (mConfDatatypeAbsorption) { CDatatype* datatype = concept->getDatatype(); if (datatype && datatype->isBasicDatatype()) { cint64 dataRestrictionCode = parm; cint64 triggerComplexity = 1; CConcept* valueTriggerConcept = createTriggerConcept(); CConceptTriggerLinker* valueTrigger = createTriggerLinker(); valueTrigger->initConceptTriggerLinker(valueTriggerConcept,triggerComplexity); CDatatypeValueSpaceConceptTriggerLinker* valueSpaceConceptTriggerLinker = createValueSpaceConceptTriggerLinker(); valueSpaceConceptTriggerLinker->initConceptTrigger(valueTriggerConcept); CDatatypeValueSpacesTriggers* valueSpacesTriggers = mMBox->getValueSpacesTriggers(true); CDatatype::DATATYPE_BASIC_TYPE basicDatatype = datatype->getBasicDatatypeType(); if (basicDatatype == CDatatype::DBT_REAL) { CDatatypeValueSpaceRealTriggers* realValueSpaceConceptTrigger = valueSpacesTriggers->getRealValueSpaceTriggers(); if (dataRestrictionCode == CDFC_RATIONAL) { realValueSpaceConceptTrigger->addRationalConceptTrigger(valueSpaceConceptTriggerLinker); } else if (dataRestrictionCode == CDFC_DECIMAL) { realValueSpaceConceptTrigger->addDecimalConceptTrigger(valueSpaceConceptTriggerLinker); } else if (dataRestrictionCode == CDFC_INTEGER) { realValueSpaceConceptTrigger->addIntegerConceptTrigger(valueSpaceConceptTriggerLinker); } } if (basicDatatype == CDatatype::DBT_STRING) { CDatatypeValueSpaceStringTriggers* stringValueSpaceConceptTrigger = valueSpacesTriggers->getStringValueSpaceTriggers(); if (dataRestrictionCode == CDFC_STRING) { stringValueSpaceConceptTrigger->addNonLanguageTagConceptTrigger(valueSpaceConceptTriggerLinker); } } CDataLiteral* dataLiteral = concept->getDataLiteral(); if (dataLiteral) { CDataLiteralValue* dataLitValue = dataLiteral->getDataLiteralValue(); if (dataLitValue) { CDataLiteralCompareValue* compareDataLitValue = dynamic_cast(dataLitValue); if (compareDataLitValue) { CDatatypeValueSpaceType* valueSpaceType = datatype->getValueSpaceType(); if (valueSpaceType) { CDatatypeValueSpaceCompareTriggers* compareValueSpaceConceptTrigger = (CDatatypeValueSpaceCompareTriggers*)valueSpacesTriggers->getValueSpaceTriggers(valueSpaceType); if (compareValueSpaceConceptTrigger) { bool minRestriction = false; bool inclusive = false; if (dataRestrictionCode == CDFC_MIN_EXCLUSIVE) { minRestriction = true; inclusive = false; } else if (dataRestrictionCode == CDFC_MIN_INCLUSIVE) { minRestriction = true; inclusive = true; } else if (dataRestrictionCode == CDFC_MAX_EXCLUSIVE) { minRestriction = false; inclusive = false; } else if (dataRestrictionCode == CDFC_MAX_INCLUSIVE) { minRestriction = false; inclusive = true; } compareValueSpaceConceptTrigger->addMinMaxValueConceptTrigger(compareDataLitValue,minRestriction,inclusive,valueSpaceConceptTriggerLinker); } } } } } triggers = valueTrigger->append(triggers); } } } mConceptTriggerLinkerHash.insert(conNegPair,triggers); } return triggers; } CDatatypeValueSpaceConceptTriggerLinker* CTriggeredImplicationBinaryAbsorberPreProcess::createValueSpaceConceptTriggerLinker() { CDatatypeValueSpaceConceptTriggerLinker* valueSpaceConceptTriggerLinker = CObjectAllocator::allocateAndConstruct(mMemMan); return valueSpaceConceptTriggerLinker; } bool CTriggeredImplicationBinaryAbsorberPreProcess::addAbsorbableDisjunctCandidates(CConcept* orConcept, bool negated, QList& list) { bool absorbableDisjuncts = false; cint64 opCode = orConcept->getOperatorCode(); if (!negated && opCode == CCOR || negated && (opCode == CCAND || opCode == CCEQ)) { CSortedNegLinker* opConLinkerIt = orConcept->getOperandList(); while (opConLinkerIt) { CConcept* opConcept = opConLinkerIt->getData(); bool opNegated = opConLinkerIt->isNegated()^negated; cint64 opOpCode = opConcept->getOperatorCode(); if (!opNegated && opOpCode == CCOR || opNegated && (opOpCode == CCAND)) { absorbableDisjuncts |= addAbsorbableDisjunctCandidates(opConcept,opNegated,list); } else { list.append(TConceptNegationPair(opConcept,opNegated)); absorbableDisjuncts = true; } opConLinkerIt = opConLinkerIt->getNext(); } } return absorbableDisjuncts; } QList CTriggeredImplicationBinaryAbsorberPreProcess::splitAbsorbableDisjuncts(QList& list) { QList absorbableList; cint64 count = list.count(); QHash conceptEqConAbsorbed; for (cint64 nr = 0; nr < count; ++nr) { TConceptNegationPair conNegPair(list.takeFirst()); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; if (isConceptImplicationTriggerable(concept,!negated,&conceptEqConAbsorbed)) { absorbableList.append(conNegPair); } else { list.append(conNegPair); } } return absorbableList; } QList CTriggeredImplicationBinaryAbsorberPreProcess::getPartialAbsorbableDisjuncts(QList& list) { QList absorbableList; cint64 count = list.count(); QSet conceptEqConAbsorbed; for (QList::const_iterator it = list.constBegin(), itEnd = list.constEnd(); it != itEnd; ++it) { TConceptNegationPair conNegPair(*it); CConcept* concept = conNegPair.first; bool negated = conNegPair.second; if (isConceptPartialImplicationTriggerable(concept,!negated,&conceptEqConAbsorbed)) { absorbableList.append(conNegPair); } } return absorbableList; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/PreprocessSettings.h0000644000175000017500000000336312520551230026204 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_PREPROCESSSETTINGS #define KONCLUDE_REASONER_PREPROCESS_PREPROCESSSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Reasoner { namespace Preprocess { /*! * * \file PreprocessSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CPreprocessingTestingItem; class COntologyPreprocessingItem; // Custom Events >= 2000 const QEvent::Type EVENTPPREPROCESSONTOLOGY = (QEvent::Type)2000; const QEvent::Type EVENTCALLBACKPREPROCESSEDONTOLOGY = (QEvent::Type)2001; const QEvent::Type EVENTPREPROCESSINGCALCULATEDCALLBACK = (QEvent::Type)2002; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_PREPROCESS_PREPROCESSSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CDataExtenderPreProcess.h0000644000175000017500000000443212520551220027014 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CDATAEXTENDERPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CDATAEXTENDERPREPROCESS_H // Libraries includes // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" // Other includes #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CRoleProcessData.h" #include "Reasoner/Ontology/CIndividualProcessData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CDataExtenderPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataExtenderPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CDataExtenderPreProcess(); //! Destructor virtual ~CDataExtenderPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: // protected variables protected: CMemoryAllocationManager* mMemMan; cint64 mStatConceptDataExtended; cint64 mStatRoleDataExtended; cint64 mStatIndiDataExtended; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CDATAEXTENDERPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreprocessor.h0000644000175000017500000000455312520551226025136 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CPREPROCESSOR_H #define KONCLUDE_REASONER_PREPROCESS_CPREPROCESSOR_H // Libraries includes // Namespace includes #include "PreprocessSettings.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Concurrent/Callback/CCallbackData.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; using namespace Config; namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CPreprocessor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPreprocessor { // public methods public: //! Constructor CPreprocessor(); virtual bool preprocess(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList, CCallbackData* callback) = 0; virtual bool preprocess(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList) = 0; virtual bool callbackPreprocessed(CConcreteOntology* ontology, CCallbackData* callback) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CPREPROCESSOR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CDatatypeNormalizerPreProcess.cpp0000644000175000017500000007533612520551220030630 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeNormalizerPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CDatatypeNormalizerPreProcess::CDatatypeNormalizerPreProcess() { } CDatatypeNormalizerPreProcess::~CDatatypeNormalizerPreProcess() { } CConcreteOntology *CDatatypeNormalizerPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { if (ontology) { mTBox = ontology->getDataBoxes()->getTBox(); mABox = ontology->getDataBoxes()->getABox(); mRBox = ontology->getDataBoxes()->getRBox(); mMBox = ontology->getDataBoxes()->getMBox(); mIntegerRestrictionConcept = nullptr; mStringRestrictionConcept = nullptr; mNormalizedStringRestrictionConcept = nullptr; mTokenRestrictionConcept = nullptr; mNMTokenRestrictionConcept = nullptr; mNameRestrictionConcept = nullptr; mNCNameRestrictionConcept = nullptr; mLanguageRestrictionConcept = nullptr; mDatetimeStampRestrictionConcept = nullptr; mTopDataRangeConcept = mTBox->getTopDataRangeConcept(); mRolesVector = mRBox->getRoleVector(); mConceptVector = mTBox->getConceptVector(); mIndiVec = mABox->getIndividualVector(); mDataRangeConceptHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getDataRangeTermConceptMappingHash(); mConceptDataRangeHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getConceptDataRangeTermMappingHash(); mDatatypeExpressionDatatpyeHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getDatatypeExpressionDatatypeHash(); mDatatpyeDatatypeExpressionHash = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getDatatypeDatatypeExpessionHash(); mMemMan = ontology->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); mOntology = ontology; mValueSpaceTypes = ontology->getDataBoxes()->getDatatypeValueSpaceTypes(); mDatatypeVector = mTBox->getDatatypeVector(false); QList datatypeNormalisationList; if (mDatatypeVector) { cint64 datatypeCount = mDatatypeVector->getItemCount(); for (cint64 i = 0; i < datatypeCount; ++i) { CDatatype* datatype = mDatatypeVector->getData(i); if (datatype) { QString datatypeIRI = datatype->getDatatypeIRI(); mIRIDatatypeHash.insert(datatypeIRI,datatype); } } for (cint64 i = 0; i < datatypeCount; ++i) { CDatatype* datatype = mDatatypeVector->getLocalData(i); if (datatype) { if (!datatype->hasDatatypeConcept()) { CConcept* datatypeConcept = nullptr; CDatatypeExpression* datatypeExpression = mDatatpyeDatatypeExpressionHash->value(datatype); if (datatypeExpression) { datatypeConcept = mDataRangeConceptHash->value(datatypeExpression); } if (!datatypeConcept) { datatypeConcept = createDatatypeConcept(datatype); if (datatypeExpression) { mDataRangeConceptHash->insert(datatypeExpression,datatypeConcept); mConceptDataRangeHash->insert(datatypeConcept,datatypeExpression); } datatypeConcept->setDatatype(datatype); } datatype->setDatatypeConcept(datatypeConcept); } if (!datatype->isNormalized()) { datatypeNormalisationList.append(datatype); } } } foreach (CDatatype* datatype, datatypeNormalisationList) { normalizeDatatype(datatype,context); datatype->setNormalized(true); } } } return ontology; } CConcept* CDatatypeNormalizerPreProcess::createConcept() { CConcept* concept = CObjectAllocator::allocateAndConstruct(mMemMan); cint64 nextConTag = mConceptVector->getItemCount(); concept->initConcept(); concept->setTag(nextConTag); mConceptVector->setData(nextConTag,concept); return concept; } CConcept* CDatatypeNormalizerPreProcess::createDatatypeConcept(CDatatype* datatype) { CConcept* datatypeConcept = createConcept(); datatypeConcept->setOperatorCode(CCDATATYPE); return datatypeConcept; } CConcept* CDatatypeNormalizerPreProcess::addConceptOperand(CConcept* concept, CConcept* operand, bool negated) { CSortedNegLinker* opConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); opConLinker->init(operand,negated); concept->addOperandLinker(opConLinker); concept->incOperandCount(); return concept; } CConcept* CDatatypeNormalizerPreProcess::getNumberRestrictionConcept(cint64 restrictionCode, const QString& value) { CConcept* restrictionConcept = mNumberRestrictionConceptHash.value(QPair(restrictionCode,value)); if (!restrictionConcept) { restrictionConcept = createConcept(); restrictionConcept->setParameter(restrictionCode); restrictionConcept->setOperatorCode(CCDATARESTRICTION); CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); restrictionConcept->setDatatype(realDatatype); CDataLiteral* dataLiteral = CObjectAllocator::allocateAndConstruct(mMemMan); dataLiteral->initDataLiteral(value,realDatatype); restrictionConcept->setDataLiteral(dataLiteral); mNumberRestrictionConceptHash.insert(QPair(restrictionCode,value),restrictionConcept); } return restrictionConcept; } CDatatype* CDatatypeNormalizerPreProcess::getDatatype(const QString& datatypeIRI) { return mIRIDatatypeHash.value(datatypeIRI,nullptr); } CConcept* CDatatypeNormalizerPreProcess::getIntegerRestrictionConcept() { if (!mIntegerRestrictionConcept) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); mIntegerRestrictionConcept = createConcept(); mIntegerRestrictionConcept->setOperatorCode(CCDATARESTRICTION); mIntegerRestrictionConcept->setDatatype(realDatatype); mIntegerRestrictionConcept->setParameter(CDFC_INTEGER); } return mIntegerRestrictionConcept; } CConcept* CDatatypeNormalizerPreProcess::getStringRestrictionConcept() { if (!mStringRestrictionConcept) { CDatatype* plainLiteralDatatype = getDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); mStringRestrictionConcept = createConcept(); mStringRestrictionConcept->setOperatorCode(CCDATARESTRICTION); mStringRestrictionConcept->setDatatype(plainLiteralDatatype); mStringRestrictionConcept->setParameter(CDFC_STRING); } return mStringRestrictionConcept; } CConcept* CDatatypeNormalizerPreProcess::getNormalizedStringRestrictionConcept() { if (!mNormalizedStringRestrictionConcept) { CDatatype* plainLiteralDatatype = getDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); mNormalizedStringRestrictionConcept = createConcept(); mNormalizedStringRestrictionConcept->setOperatorCode(CCDATARESTRICTION); mNormalizedStringRestrictionConcept->setDatatype(plainLiteralDatatype); mNormalizedStringRestrictionConcept->setParameter(CDFC_NORMALIZED_STRING); } return mNormalizedStringRestrictionConcept; } CConcept* CDatatypeNormalizerPreProcess::getTokenRestrictionConcept() { if (!mTokenRestrictionConcept) { CDatatype* plainLiteralDatatype = getDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); mTokenRestrictionConcept = createConcept(); mTokenRestrictionConcept->setOperatorCode(CCDATARESTRICTION); mTokenRestrictionConcept->setDatatype(plainLiteralDatatype); mTokenRestrictionConcept->setParameter(CDFC_TOKEN); } return mTokenRestrictionConcept; } CConcept* CDatatypeNormalizerPreProcess::getNMTokenRestrictionConcept() { if (!mNMTokenRestrictionConcept) { CDatatype* plainLiteralDatatype = getDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); mNMTokenRestrictionConcept = createConcept(); mNMTokenRestrictionConcept->setOperatorCode(CCDATARESTRICTION); mNMTokenRestrictionConcept->setDatatype(plainLiteralDatatype); mNMTokenRestrictionConcept->setParameter(CDFC_NMTOKEN); } return mNMTokenRestrictionConcept; } CConcept* CDatatypeNormalizerPreProcess::getNameRestrictionConcept() { if (!mNameRestrictionConcept) { CDatatype* plainLiteralDatatype = getDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); mNameRestrictionConcept = createConcept(); mNameRestrictionConcept->setOperatorCode(CCDATARESTRICTION); mNameRestrictionConcept->setDatatype(plainLiteralDatatype); mNameRestrictionConcept->setParameter(CDFC_NAME); } return mNameRestrictionConcept; } CConcept* CDatatypeNormalizerPreProcess::getNCNameRestrictionConcept() { if (!mNCNameRestrictionConcept) { CDatatype* plainLiteralDatatype = getDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); mNCNameRestrictionConcept = createConcept(); mNCNameRestrictionConcept->setOperatorCode(CCDATARESTRICTION); mNCNameRestrictionConcept->setDatatype(plainLiteralDatatype); mNCNameRestrictionConcept->setParameter(CDFC_NCNAME); } return mNCNameRestrictionConcept; } CConcept* CDatatypeNormalizerPreProcess::getLanguageRestrictionConcept() { if (!mLanguageRestrictionConcept) { CDatatype* plainLiteralDatatype = getDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); mLanguageRestrictionConcept = createConcept(); mLanguageRestrictionConcept->setOperatorCode(CCDATARESTRICTION); mLanguageRestrictionConcept->setDatatype(plainLiteralDatatype); mLanguageRestrictionConcept->setParameter(CDFC_LANGUAGE); } return mLanguageRestrictionConcept; } CConcept* CDatatypeNormalizerPreProcess::getDateTimeStampRestrictionConcept() { if (!mDatetimeStampRestrictionConcept) { CDatatype* dateTimeDatatype = getDatatype(PREFIX_XML_DATETIMESTAMP_DATATYPE); mDatetimeStampRestrictionConcept = createConcept(); mDatetimeStampRestrictionConcept->setOperatorCode(CCDATARESTRICTION); mDatetimeStampRestrictionConcept->setDatatype(dateTimeDatatype); mDatetimeStampRestrictionConcept->setParameter(CDFC_DATETIMESTAMP); } return mDatetimeStampRestrictionConcept; } CDatatypeNormalizerPreProcess* CDatatypeNormalizerPreProcess::normalizeDatatype(CDatatype* datatype, CPreProcessContext* context) { QString datatypeIRI = datatype->getDatatypeIRI(); CConcept* datatypeConcept = datatype->getDatatypeConcept(); if (datatypeIRI == PREFIX_XML_INTEGER_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* integerRestrictionConcept = getIntegerRestrictionConcept(); addConceptOperand(datatypeConcept,integerRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); datatype->setDatatypeType(CDatatype::DT_INTEGER); } else if (datatypeIRI == PREFIX_XML_DECIMAL_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* decimalRestrictionConcept = createConcept(); decimalRestrictionConcept->setOperatorCode(CCDATARESTRICTION); decimalRestrictionConcept->setDatatype(realDatatype); decimalRestrictionConcept->setParameter(CDFC_DECIMAL); addConceptOperand(datatypeConcept,decimalRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); datatype->setDatatypeType(CDatatype::DT_DECIMAL); } else if (datatypeIRI == PREFIX_OWL_RATIONAL_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* rationalRestrictionConcept = createConcept(); rationalRestrictionConcept->setOperatorCode(CCDATARESTRICTION); rationalRestrictionConcept->setDatatype(realDatatype); rationalRestrictionConcept->setParameter(CDFC_RATIONAL); addConceptOperand(datatypeConcept,rationalRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); datatype->setDatatypeType(CDatatype::DT_RATIONAL); } else if (datatypeIRI == PREFIX_OWL_REAL_DATATYPE) { datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(true); datatype->setBasicDatatype(datatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); datatype->setDatatypeType(CDatatype::DT_REAL); } else if (datatypeIRI == PREFIX_OWL_TOP_DATATYPE) { if (mTopDataRangeConcept) { addConceptOperand(datatypeConcept,mTopDataRangeConcept,false); } } else if (datatypeIRI == PREFIX_OWL_BOTTOM_DATATYPE) { if (mTopDataRangeConcept) { addConceptOperand(datatypeConcept,mTopDataRangeConcept,true); } } else if (datatypeIRI == PREFIX_XML_NONNEGATIVEINTEGER_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* integerRestrictionConcept = getIntegerRestrictionConcept(); addConceptOperand(datatypeConcept,integerRestrictionConcept,false); CConcept* minInclusiveZeroRestrictionConcept = getNumberRestrictionConcept(CDFC_MIN_INCLUSIVE,"0"); addConceptOperand(datatypeConcept,minInclusiveZeroRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); } else if (datatypeIRI == PREFIX_XML_POSITIVEINTEGER_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* integerRestrictionConcept = getIntegerRestrictionConcept(); addConceptOperand(datatypeConcept,integerRestrictionConcept,false); CConcept* minExclusiveZeroRestrictionConcept = getNumberRestrictionConcept(CDFC_MIN_EXCLUSIVE,"0"); addConceptOperand(datatypeConcept,minExclusiveZeroRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); } else if (datatypeIRI == PREFIX_XML_NONPOSITIVEINTEGER_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* integerRestrictionConcept = getIntegerRestrictionConcept(); addConceptOperand(datatypeConcept,integerRestrictionConcept,false); CConcept* maxInclusiveZeroRestrictionConcept = getNumberRestrictionConcept(CDFC_MAX_INCLUSIVE,"0"); addConceptOperand(datatypeConcept,maxInclusiveZeroRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); } else if (datatypeIRI == PREFIX_XML_NEGATIVEINTEGER_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* integerRestrictionConcept = getIntegerRestrictionConcept(); addConceptOperand(datatypeConcept,integerRestrictionConcept,false); CConcept* maxExclusiveZeroRestrictionConcept = getNumberRestrictionConcept(CDFC_MAX_EXCLUSIVE,"0"); addConceptOperand(datatypeConcept,maxExclusiveZeroRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); } else if (datatypeIRI == PREFIX_XML_LONG_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* integerRestrictionConcept = getIntegerRestrictionConcept(); addConceptOperand(datatypeConcept,integerRestrictionConcept,false); CConcept* minInclusiveLongRestrictionConcept = getNumberRestrictionConcept(CDFC_MIN_INCLUSIVE,"-9223372036854775808"); addConceptOperand(datatypeConcept,minInclusiveLongRestrictionConcept,false); CConcept* maxInclusiveLongRestrictionConcept = getNumberRestrictionConcept(CDFC_MAX_INCLUSIVE,"9223372036854775807"); addConceptOperand(datatypeConcept,maxInclusiveLongRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); } else if (datatypeIRI == PREFIX_XML_INT_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* integerRestrictionConcept = getIntegerRestrictionConcept(); addConceptOperand(datatypeConcept,integerRestrictionConcept,false); CConcept* minInclusiveIntRestrictionConcept = getNumberRestrictionConcept(CDFC_MIN_INCLUSIVE,"-2147483647"); addConceptOperand(datatypeConcept,minInclusiveIntRestrictionConcept,false); CConcept* maxInclusiveIntRestrictionConcept = getNumberRestrictionConcept(CDFC_MAX_INCLUSIVE,"2147483647"); addConceptOperand(datatypeConcept,maxInclusiveIntRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); } else if (datatypeIRI == PREFIX_XML_SHORT_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* integerRestrictionConcept = getIntegerRestrictionConcept(); addConceptOperand(datatypeConcept,integerRestrictionConcept,false); CConcept* minInclusiveShortRestrictionConcept = getNumberRestrictionConcept(CDFC_MIN_INCLUSIVE,"-32767"); addConceptOperand(datatypeConcept,minInclusiveShortRestrictionConcept,false); CConcept* maxInclusiveShortRestrictionConcept = getNumberRestrictionConcept(CDFC_MAX_INCLUSIVE,"32767"); addConceptOperand(datatypeConcept,maxInclusiveShortRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); } else if (datatypeIRI == PREFIX_XML_BYTE_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* integerRestrictionConcept = getIntegerRestrictionConcept(); addConceptOperand(datatypeConcept,integerRestrictionConcept,false); CConcept* minInclusiveByteRestrictionConcept = getNumberRestrictionConcept(CDFC_MIN_INCLUSIVE,"-127"); addConceptOperand(datatypeConcept,minInclusiveByteRestrictionConcept,false); CConcept* maxInclusiveByteRestrictionConcept = getNumberRestrictionConcept(CDFC_MAX_INCLUSIVE,"127"); addConceptOperand(datatypeConcept,maxInclusiveByteRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); } else if (datatypeIRI == PREFIX_XML_UNSIGNEDLONG_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* integerRestrictionConcept = getIntegerRestrictionConcept(); addConceptOperand(datatypeConcept,integerRestrictionConcept,false); CConcept* minInclusiveZeroRestrictionConcept = getNumberRestrictionConcept(CDFC_MIN_INCLUSIVE,"0"); addConceptOperand(datatypeConcept,minInclusiveZeroRestrictionConcept,false); CConcept* maxInclusiveULongRestrictionConcept = getNumberRestrictionConcept(CDFC_MAX_INCLUSIVE,"18446744073709551615"); addConceptOperand(datatypeConcept,maxInclusiveULongRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); } else if (datatypeIRI == PREFIX_XML_UNSIGNEDINT_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* integerRestrictionConcept = getIntegerRestrictionConcept(); addConceptOperand(datatypeConcept,integerRestrictionConcept,false); CConcept* minInclusiveZeroRestrictionConcept = getNumberRestrictionConcept(CDFC_MIN_INCLUSIVE,"0"); addConceptOperand(datatypeConcept,minInclusiveZeroRestrictionConcept,false); CConcept* maxInclusiveUIntRestrictionConcept = getNumberRestrictionConcept(CDFC_MAX_INCLUSIVE,"4294967295"); addConceptOperand(datatypeConcept,maxInclusiveUIntRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); } else if (datatypeIRI == PREFIX_XML_UNSIGNEDSHORT_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* integerRestrictionConcept = getIntegerRestrictionConcept(); addConceptOperand(datatypeConcept,integerRestrictionConcept,false); CConcept* minInclusiveZeroRestrictionConcept = getNumberRestrictionConcept(CDFC_MIN_INCLUSIVE,"0"); addConceptOperand(datatypeConcept,minInclusiveZeroRestrictionConcept,false); CConcept* maxInclusiveUShortRestrictionConcept = getNumberRestrictionConcept(CDFC_MAX_INCLUSIVE,"65535"); addConceptOperand(datatypeConcept,maxInclusiveUShortRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); } else if (datatypeIRI == PREFIX_XML_UNSIGNEDBYTE_DATATYPE) { CDatatype* realDatatype = getDatatype(PREFIX_OWL_REAL_DATATYPE); CConcept* integerRestrictionConcept = getIntegerRestrictionConcept(); addConceptOperand(datatypeConcept,integerRestrictionConcept,false); CConcept* minInclusiveZeroRestrictionConcept = getNumberRestrictionConcept(CDFC_MIN_INCLUSIVE,"0"); addConceptOperand(datatypeConcept,minInclusiveZeroRestrictionConcept,false); CConcept* maxInclusiveUByteRestrictionConcept = getNumberRestrictionConcept(CDFC_MAX_INCLUSIVE,"255"); addConceptOperand(datatypeConcept,maxInclusiveUByteRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceRealType()); datatype->setBasicDatatype(realDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_REAL); } else if (datatypeIRI == PREFIX_XML_PLAINLITERAL_DATATYPE) { datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceStringType()); datatype->setBasicDatatype(datatype); datatype->setBasicDatatype(true); datatype->setBasicDatatypeType(CDatatype::DBT_STRING); datatype->setDatatypeType(CDatatype::DT_PLAINLITERAL); } else if (datatypeIRI == PREFIX_XML_STRING_DATATYPE) { CDatatype* plainLiteralDatatype = getDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); addConceptOperand(datatypeConcept,plainLiteralDatatype->getDatatypeConcept(),false); CConcept* stringRestrictionConcept = getStringRestrictionConcept(); addConceptOperand(datatypeConcept,stringRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceStringType()); datatype->setBasicDatatype(plainLiteralDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_STRING); datatype->setDatatypeType(CDatatype::DT_STRING); } else if (datatypeIRI == PREFIX_XML_NORMALIZEDSTRING_DATATYPE) { CDatatype* stringDatatype = getDatatype(PREFIX_XML_STRING_DATATYPE); addConceptOperand(datatypeConcept,stringDatatype->getDatatypeConcept(),false); CConcept* normalizedStringRestrictionConcept = getStringRestrictionConcept(); addConceptOperand(datatypeConcept,normalizedStringRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceStringType()); CDatatype* plainLiteralDatatype = getDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); datatype->setBasicDatatype(plainLiteralDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_STRING); } else if (datatypeIRI == PREFIX_XML_TOKEN_DATATYPE) { CDatatype* normalizedStringDatatype = getDatatype(PREFIX_XML_NORMALIZEDSTRING_DATATYPE); addConceptOperand(datatypeConcept,normalizedStringDatatype->getDatatypeConcept(),false); CConcept* tokenRestrictionConcept = getTokenRestrictionConcept(); addConceptOperand(datatypeConcept,tokenRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceStringType()); CDatatype* plainLiteralDatatype = getDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); datatype->setBasicDatatype(plainLiteralDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_STRING); } else if (datatypeIRI == PREFIX_XML_NAME_DATATYPE) { CDatatype* tokenDatatype = getDatatype(PREFIX_XML_TOKEN_DATATYPE); addConceptOperand(datatypeConcept,tokenDatatype->getDatatypeConcept(),false); CConcept* nameRestrictionConcept = getNameRestrictionConcept(); addConceptOperand(datatypeConcept,nameRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceStringType()); CDatatype* plainLiteralDatatype = getDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); datatype->setBasicDatatype(plainLiteralDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_STRING); } else if (datatypeIRI == PREFIX_XML_NCNAME_DATATYPE) { CDatatype* nameDatatype = getDatatype(PREFIX_XML_NAME_DATATYPE); addConceptOperand(datatypeConcept,nameDatatype->getDatatypeConcept(),false); CConcept* ncnameRestrictionConcept = getNCNameRestrictionConcept(); addConceptOperand(datatypeConcept,ncnameRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceStringType()); CDatatype* plainLiteralDatatype = getDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); datatype->setBasicDatatype(plainLiteralDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_STRING); } else if (datatypeIRI == PREFIX_XML_NMTOKEN_DATATYPE) { CDatatype* tokenDatatype = getDatatype(PREFIX_XML_TOKEN_DATATYPE); addConceptOperand(datatypeConcept,tokenDatatype->getDatatypeConcept(),false); CConcept* nmTokenRestrictionConcept = getNMTokenRestrictionConcept(); addConceptOperand(datatypeConcept,nmTokenRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceStringType()); CDatatype* plainLiteralDatatype = getDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); datatype->setBasicDatatype(plainLiteralDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_STRING); } else if (datatypeIRI == PREFIX_XML_LANGUAGE_DATATYPE) { CDatatype* plainLiteralDatatype = getDatatype(PREFIX_XML_PLAINLITERAL_DATATYPE); addConceptOperand(datatypeConcept,plainLiteralDatatype->getDatatypeConcept(),false); CConcept* languageRestrictionConcept = getLanguageRestrictionConcept(); addConceptOperand(datatypeConcept,languageRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceStringType()); datatype->setBasicDatatype(plainLiteralDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_STRING); } else if (datatypeIRI == PREFIX_XML_BOOLEAN_DATATYPE) { datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceBooleanType()); datatype->setBasicDatatype(datatype); datatype->setBasicDatatype(true); datatype->setBasicDatatypeType(CDatatype::DBT_BOOLEAN); datatype->setDatatypeType(CDatatype::DT_BOOLEAN); } else if (datatypeIRI == PREFIX_XML_DOUBLE_DATATYPE) { datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceDoubleType()); datatype->setBasicDatatype(datatype); datatype->setBasicDatatype(true); datatype->setBasicDatatypeType(CDatatype::DBT_DOUBLE); datatype->setDatatypeType(CDatatype::DT_DOUBLE); } else if (datatypeIRI == PREFIX_XML_FLOAT_DATATYPE) { datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceFloatType()); datatype->setBasicDatatype(datatype); datatype->setBasicDatatype(true); datatype->setBasicDatatypeType(CDatatype::DBT_FLOAT); datatype->setDatatypeType(CDatatype::DT_FLOAT); } else if (datatypeIRI == PREFIX_XML_IRI_DATATYPE) { datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceIRIType()); datatype->setBasicDatatype(datatype); datatype->setBasicDatatype(true); datatype->setBasicDatatypeType(CDatatype::DBT_IRI); datatype->setDatatypeType(CDatatype::DT_IRI); } else if (datatypeIRI == PREFIX_XML_XML_DATATYPE) { datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceXMLType()); datatype->setBasicDatatype(datatype); datatype->setBasicDatatype(true); datatype->setBasicDatatypeType(CDatatype::DBT_XML); datatype->setDatatypeType(CDatatype::DT_XML); } else if (datatypeIRI == PREFIX_XML_BINARYHEX_DATATYPE) { datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceBinaryHexDataType()); datatype->setBasicDatatype(datatype); datatype->setBasicDatatype(true); datatype->setBasicDatatypeType(CDatatype::DBT_HEXBINARY); } else if (datatypeIRI == PREFIX_XML_BINARYBASE64_DATATYPE) { datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceBinaryBase64DataType()); datatype->setBasicDatatype(datatype); datatype->setBasicDatatype(true); datatype->setBasicDatatypeType(CDatatype::DBT_BASE64BINARY); } else if (datatypeIRI == PREFIX_XML_DATETIME_DATATYPE) { datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceDateTimeType()); datatype->setBasicDatatype(datatype); datatype->setBasicDatatype(true); datatype->setBasicDatatypeType(CDatatype::DBT_DATETIME); } else if (datatypeIRI == PREFIX_XML_DATETIMESTAMP_DATATYPE) { CDatatype* dateTimeDatatype = getDatatype(PREFIX_XML_DATETIME_DATATYPE); addConceptOperand(datatypeConcept,dateTimeDatatype->getDatatypeConcept(),false); CConcept* dateTimeStampRestrictionConcept = getDateTimeStampRestrictionConcept(); addConceptOperand(datatypeConcept,dateTimeStampRestrictionConcept,false); datatype->setValueSpaceType(mValueSpaceTypes->getValueSpaceDateTimeType()); datatype->setBasicDatatype(dateTimeDatatype); datatype->setBasicDatatypeType(CDatatype::DBT_DATETIME); } return this; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreprocessingTestingItem.cpp0000644000175000017500000000270212520551226027775 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreprocessingTestingItem.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CPreprocessingTestingItem::CPreprocessingTestingItem(COntologyPreprocessingItem* preproItem) { mOntologyPreproItem = preproItem; } COntologyPreprocessingItem* CPreprocessingTestingItem::getOntologyPreprocessingItem() { return mOntologyPreproItem; } CPreprocessingTestingItem* CPreprocessingTestingItem::setOntologyPreprocessingItem(COntologyPreprocessingItem* preproItem) { mOntologyPreproItem = preproItem; return this; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CConsistenceCheckerPreProcess.cpp0000644000175000017500000000332512520551220030541 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConsistenceCheckerPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CConsistenceCheckerPreProcess::CConsistenceCheckerPreProcess(CConfiguration* config) { mConfig = config; } CConsistenceCheckerPreProcess::~CConsistenceCheckerPreProcess() { } CConcreteOntology *CConsistenceCheckerPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { if (ontology) { CDirectBlockedProcessingConsistiser consistiser; bool consistent = consistiser.determineConsistency(ontology,mConfig); QString consString("inconsistent"); if (consistent) { consString = "consistent"; } LOG(INFO,"::Konclude::Reasoner::Preprocess::OntologyConsistencyChecking",logTr("Ontology is %1.").arg(consString),this); } return ontology; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreProcess.cpp0000644000175000017500000000206612520551224025063 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CPreProcess::CPreProcess() { } CPreProcess::~CPreProcess() { } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreprocessingThread.h0000644000175000017500000001104112520551226026411 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGTHREAD_H #define KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGTHREAD_H // Libraries includes // Namespace includes #include "PreprocessSettings.h" #include "CPreprocessor.h" #include "CPreprocessingContext.h" #include "COntologyPreprocessingItem.h" #include "CPreprocessingCallbackDataContext.h" #include "CPreprocessingTestingItem.h" // Other includes #include "Reasoner/Preprocess/Events/CCallbackPreprocessedOntologyEvent.h" #include "Reasoner/Preprocess/Events/CPreprocessOntologyEvent.h" #include "Reasoner/Preprocess/Events/CPreprocessingCalculatedCallbackEvent.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Reasoner/Kernel/Manager/CReasonerManager.h" #include "Concurrent/CThread.h" #include "Concurrent/Callback/CBlockingCallbackData.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogDomain.h" namespace Konclude { using namespace Logger; using namespace Concurrent; using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; using namespace Kernel::Manager; using namespace Kernel::Calculation; namespace Preprocess { using namespace Events; /*! * * \class CPreprocessingThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPreprocessingThread : public CPreprocessor, public CThread { // public methods public: //! Constructor CPreprocessingThread(CReasonerManager* reasonerManager); //! Destructor virtual ~CPreprocessingThread(); virtual bool preprocess(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList, CCallbackData* callback); virtual bool preprocess(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList); virtual bool callbackPreprocessed(CConcreteOntology* ontology, CCallbackData* callback); // protected methods protected: virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); virtual bool createNextTest() = 0; virtual bool canProcessMoreTests(); virtual bool doNextPendingTests(); virtual COntologyPreprocessingItem* initializeOntologyPreprocessingItem(CConcreteOntology* ontology, CConfigurationBase* config); virtual bool addOntologyPreprocessingCallback(COntologyPreprocessingItem* item, CCallbackData* callback); virtual bool addOntologyPreprocessingRequirements(COntologyPreprocessingItem* item, COntologyProcessingRequirement* requirement); CPreprocessingThread* processCalculationJob(CSatisfiableCalculationJob* job, COntologyPreprocessingItem* preCompItem, CPreprocessingTestingItem* preTestItem); virtual bool preprocessingTested(COntologyPreprocessingItem* ontPreCompItem, CPreprocessingTestingItem* preTestItem, CPreprocessingCalculatedCallbackEvent* pcce) = 0; // protected variables protected: qint64 mConfMaxTestParallelCount; qint64 mCurrRunningTestParallelCount; QSet mActiveOntItemSet; QSet mInactiveOntItemSet; QList mProcessingOntItemList; QHash mOntItemHash; cint64 mPreprocessingCount; CReasonerManager* mReasoner; CCalculationManager* mCalculationManager; cint64 mStatCalculatingJobs; CPreprocessingContext mContext; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/COntologyPreProcess.h0000644000175000017500000000366112520551224026265 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CONTOLOGYPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CONTOLOGYPREPROCESS_H // Libraries includes // Namespace includes #include "CPreProcess.h" #include "CPreProcessContext.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class COntologyPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyPreProcess : public CPreProcess { // public methods public: //! Constructor COntologyPreProcess(); //! Destructor virtual ~COntologyPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context) = 0; // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CONTOLOGYPREPROCESS_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CNominalSchemaTemplateExtractionPreProcess.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CNominalSchemaTemplateExtractionPreProcess0000644000175000017500000005031712520551224032500 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNominalSchemaTemplateExtractionPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CNominalSchemaTemplateExtractionPreProcess::CNominalSchemaTemplateExtractionPreProcess() { } CNominalSchemaTemplateExtractionPreProcess::~CNominalSchemaTemplateExtractionPreProcess() { } CConcreteOntology *CNominalSchemaTemplateExtractionPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { bool nominalSchemaConstructsUsed = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags()->isNominalSchemaUsed(); if (nominalSchemaConstructsUsed) { mStatCreatedTemplateCount = 0; mStatReplacedConceptCount = 0; mNomSchTemplVec = nullptr; mTBox = ontology->getDataBoxes()->getTBox(); CRBox *rBox = ontology->getDataBoxes()->getRBox(); CABox *aBox = ontology->getDataBoxes()->getABox(); mMBox = ontology->getDataBoxes()->getMBox(); mConceptVec = mTBox->getConceptVector(); mConceptCount = mConceptVec->getItemCount(); mRolesVec = rBox->getRoleVector(); mRoleCount = mRolesVec->getItemCount(); mTopConcept = mTBox->getTopConcept(); mBottomConcept = mTBox->getBottomConcept(); mMemMan = ontology->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); mOnto = ontology; mIndividualVector = aBox->getIndividualVector(false); mIndividualCount = 0; if (mIndividualVector) { mIndividualCount = mIndividualVector->getItemCount(); } bool nominalSchemaConcepts = false; for (cint64 i = 0; !nominalSchemaConcepts && i < mConceptCount; ++i) { CConcept* concept = mConceptVec->getData(i); if (concept) { cint64 conOpCode = concept->getOperatorCode(); if (conOpCode == CCNOMVAR) { nominalSchemaConcepts = true; } } } if (nominalSchemaConcepts) { for (cint64 i = 0; i < mConceptCount; ++i) { CConcept* concept = mConceptVec->getLocalData(i); if (concept) { cint64 conOpCode = concept->getOperatorCode(); if (conOpCode == CCEQ) { bool foundNominalSchemaConcept = false; for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt && !foundNominalSchemaConcept; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opConNegation = opConLinkerIt->isNegated(); foundNominalSchemaConcept = hasNominalSchemaConcept(opConcept); } if (foundNominalSchemaConcept) { transformEquivalentConceptToGCI(concept); } } } } for (cint64 i = 0; i < mConceptCount; ++i) { CConcept* concept = mConceptVec->getLocalData(i); if (concept) { cint64 conOpCode = concept->getOperatorCode(); if (conOpCode == CCSUB) { for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opConNegation = opConLinkerIt->isNegated(); if (hasNominalSchemaConcept(opConcept)) { ++mStatReplacedConceptCount; CNominalSchemaTemplate* nomSchTempl = getNominalSchemaTemplate(opConcept,opConNegation); CConcept* templRefConcept = nomSchTempl->getReferenceConcept(); opConLinkerIt->setData(templRefConcept); } } } } } for (cint64 i = 0; i < mRoleCount; ++i) { CRole* role = mRolesVec->getLocalData(i); if (role) { for (CSortedNegLinker* domConLinkerIt = role->getDomainConceptList(); domConLinkerIt; domConLinkerIt = domConLinkerIt->getNext()) { CConcept* opConcept = domConLinkerIt->getData(); bool opConNegation = domConLinkerIt->isNegated(); if (hasNominalSchemaConcept(opConcept)) { ++mStatReplacedConceptCount; CNominalSchemaTemplate* nomSchTempl = getNominalSchemaTemplate(opConcept,opConNegation); CConcept* templRefConcept = nomSchTempl->getReferenceConcept(); domConLinkerIt->setData(templRefConcept); } } for (CSortedNegLinker* rangConLinkerIt = role->getRangeConceptList(); rangConLinkerIt; rangConLinkerIt = rangConLinkerIt->getNext()) { CConcept* opConcept = rangConLinkerIt->getData(); bool opConNegation = rangConLinkerIt->isNegated(); if (hasNominalSchemaConcept(opConcept)) { ++mStatReplacedConceptCount; CNominalSchemaTemplate* nomSchTempl = getNominalSchemaTemplate(opConcept,opConNegation); CConcept* templRefConcept = nomSchTempl->getReferenceConcept(); rangConLinkerIt->setData(templRefConcept); } } } } for (CSortedNegLinker* gciConLinkerIt = mTopConcept->getOperandList(); gciConLinkerIt; gciConLinkerIt = gciConLinkerIt->getNext()) { CConcept* opConcept = gciConLinkerIt->getData(); bool opConNegation = gciConLinkerIt->isNegated(); if (hasNominalSchemaConcept(opConcept)) { if (!removeSingleAbsorbableNominalSchemaConcepts(opConcept,opConNegation)) { ++mStatReplacedConceptCount; CNominalSchemaTemplate* nomSchTempl = getNominalSchemaTemplate(opConcept,opConNegation); CConcept* templRefConcept = nomSchTempl->getReferenceConcept(); gciConLinkerIt->setData(templRefConcept); } } } if (mIndividualVector) { for (cint64 i = 0; i < mIndividualCount; ++i) { CIndividual* individual = mIndividualVector->getLocalData(i); if (individual) { for (CConceptAssertionLinker* assConLinkerIt = individual->getAssertionConceptLinker(); assConLinkerIt; assConLinkerIt = assConLinkerIt->getNext()) { CConcept* assCon = assConLinkerIt->getData(); bool assConNegation = assConLinkerIt->isNegated(); if (hasNominalSchemaConcept(assCon)) { ++mStatReplacedConceptCount; CNominalSchemaTemplate* nomSchTempl = getNominalSchemaTemplate(assCon,assConNegation); CConcept* templRefConcept = nomSchTempl->getReferenceConcept(); assConLinkerIt->setData(templRefConcept); } } } } } } LOG(INFO,"::Konclude::Reasoner::Preprocess::NominalSchemaTemplateExtractor",logTr("Extracted %1 nominal schema templates, replaced %2 concepts.").arg(mStatCreatedTemplateCount).arg(mStatReplacedConceptCount),this); } return ontology; } bool CNominalSchemaTemplateExtractionPreProcess::removeSingleAbsorbableNominalSchemaConcepts(CConcept* concept, bool negation) { bool allRemoved = true; QHash nominalSchemaConceptCountHash; countNominalSchemaConcepts(concept,&nominalSchemaConceptCountHash); QSet absorbableNominalVariableSet; if (findAbsorbableNominalSchemas(concept,negation,&absorbableNominalVariableSet)) { QSet removeNominalVariableSet; for (QHash::const_iterator it = nominalSchemaConceptCountHash.constBegin(), itEnd = nominalSchemaConceptCountHash.constEnd(); it != itEnd; ++it) { cint64 nomSchCount = it.value(); CConcept* concept = it.key(); if (nomSchCount <= 1 && absorbableNominalVariableSet.contains(concept)) { removeNominalVariableSet.insert(concept); } else { allRemoved = false; } } if (!removeNominalVariableSet.isEmpty()) { CConcept* replaceConcept = mTBox->getIndividualTriggerConcept(); replaceNominalSchemasConcepts(concept,replaceConcept,removeNominalVariableSet); } } else { allRemoved = false; } return allRemoved; } void CNominalSchemaTemplateExtractionPreProcess::replaceNominalSchemasConcepts(CConcept* concept, CConcept* replacingConcept, const QSet& removeNominalVariableSet) { cint64 conOpCode = concept->getOperatorCode(); if ((conOpCode == CCSUB || conOpCode == CCEQ || conOpCode == CCTOP || conOpCode == CCBOTTOM)) { } else { for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); if (removeNominalVariableSet.contains(opConcept)) { opConLinkerIt->setData(replacingConcept); } else { replaceNominalSchemasConcepts(opConcept,replacingConcept,removeNominalVariableSet); } } } } void CNominalSchemaTemplateExtractionPreProcess::countNominalSchemaConcepts(CConcept* concept, QHash* nominalSchemaConceptCountHash) { cint64 conOpCode = concept->getOperatorCode(); if ((conOpCode == CCSUB || conOpCode == CCEQ || conOpCode == CCTOP || conOpCode == CCBOTTOM)) { } else if (conOpCode == CCNOMVAR) { cint64 prevCount = nominalSchemaConceptCountHash->value(concept,0); nominalSchemaConceptCountHash->insert(concept,prevCount+1); } else { for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); countNominalSchemaConcepts(opConcept,nominalSchemaConceptCountHash); } } } bool CNominalSchemaTemplateExtractionPreProcess::findAbsorbableNominalSchemas(CConcept* concept, bool negation, QSet* absorbableNominalVariableSet) { cint64 opCode = concept->getOperatorCode(); cint64 param = concept->getParameter(); if (negation && (opCode == CCSOME) || !negation && (opCode == CCALL || opCode == CCSOME)) { bool oneAbsorbable = false; for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConNegation = opLinkerIt->isNegated() ^ negation; oneAbsorbable |= findAbsorbableNominalSchemas(opConcept,opConNegation,absorbableNominalVariableSet); } return oneAbsorbable; } else if (negation && (opCode == CCOR || opCode == CCAND) || !negation && (opCode == CCAND || opCode == CCOR)) { bool oneAbsorbable = true; for (CSortedNegLinker* opLinkerIt = concept->getOperandList(); opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConNegation = opLinkerIt->isNegated() ^ negation; oneAbsorbable |= findAbsorbableNominalSchemas(opConcept,opConNegation,absorbableNominalVariableSet); } return oneAbsorbable; } else if (negation && (opCode == CCNOMVAR)) { absorbableNominalVariableSet->insert(concept); return true; } return false; } void CNominalSchemaTemplateExtractionPreProcess::addConceptOperand(CConcept* concept, CConcept* opConcept, bool negated) { CSortedNegLinker* opConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); opConLinker->init(opConcept,negated); concept->addOperandLinker(opConLinker); concept->incOperandCount(); } CConcept* CNominalSchemaTemplateExtractionPreProcess::transformEquivalentConceptToGCI(CConcept* eqConcept) { eqConcept->setOperatorCode(CCSUB); CConcept* concept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); concept->initConcept(); concept->setConceptTag(mConceptVec->getItemCount()); concept->setOperatorCode(CCOR); mConceptVec->setData(concept->getConceptTag(),concept); addConceptOperand(eqConcept,concept,false); for (CSortedNegLinker* opConLinkerIt = eqConcept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); bool opConNegation = opConLinkerIt->isNegated(); addConceptOperand(eqConcept,opConcept,!opConNegation); } mTopConcept = CConceptRoleIndividualLocator::getLocatedConcept(mTopConcept,mOnto); addConceptOperand(mTopConcept,concept,false); return concept; } CConcept* CNominalSchemaTemplateExtractionPreProcess::createNominalSchemaTemplateReferenceConcept(CNominalSchemaTemplate* nsTemplate) { CConcept* concept = CObjectAllocator< CConcept >::allocateAndConstruct(mMemMan); concept->initConcept(); concept->setConceptTag(mConceptVec->getItemCount()); concept->setOperatorCode(CCNOMTEMPLREF); concept->setParameter(nsTemplate->getNominalSchemaTemplateTag()); mConceptVec->setData(concept->getConceptTag(),concept); nsTemplate->setReferenceConcept(concept); return concept; } CNominalSchemaTemplate* CNominalSchemaTemplateExtractionPreProcess::getNominalSchemaTemplate(CConcept* concept, bool negation) { CNominalSchemaTemplate* nsTemplate = mConceptNominalSchemaTemplateHash.value(concept); if (!nsTemplate) { ++mStatCreatedTemplateCount; nsTemplate = CObjectAllocator< CNominalSchemaTemplate >::allocateAndConstruct(mMemMan); CBOXSET* nominalSchemaConceptSet = CObjectAllocator< CBOXSET >::allocateAndConstruct(mMemMan); CBOXHASH* conceptNominalSchemaConceptHash = CObjectAllocator< CBOXHASH >::allocateAndConstruct(mMemMan); CBOXHASH* absorbableConceptNominalSchemaConceptHash = CObjectAllocator< CBOXHASH >::allocateAndConstruct(mMemMan); nsTemplate->initNominalSchemaTemplate(nominalSchemaConceptSet,conceptNominalSchemaConceptHash,absorbableConceptNominalSchemaConceptHash); if (!mNomSchTemplVec) { mNomSchTemplVec = mMBox->getNominalSchemaTemplateVector(); } cint64 nextNomSchTemplID = mNomSchTemplVec->getItemCount(); nsTemplate->setNominalSchemaTemplateTag(nextNomSchTemplID); mNomSchTemplVec->setData(nextNomSchTemplID,nsTemplate); nsTemplate->setTemplateConcept(concept); collectNominalSchemaConcepts(concept,nominalSchemaConceptSet); createNominalSchemaTemplateReferenceConcept(nsTemplate); FOREACHIT (CConcept* nomSchConcept, *nominalSchemaConceptSet) { QSet testedNomSchemConSet; hasNominalSchemaConceptFillHash(concept,conceptNominalSchemaConceptHash,nomSchConcept,&testedNomSchemConSet); QSet testedNomSchemAbsorbedConSet; hasNominalSchemaAbsorbableConceptFillHash(concept,negation,absorbableConceptNominalSchemaConceptHash,nomSchConcept,&testedNomSchemAbsorbedConSet); } mConceptNominalSchemaTemplateHash.insert(concept,nsTemplate); } return nsTemplate; } bool CNominalSchemaTemplateExtractionPreProcess::hasNominalSchemaAbsorbableConceptFillHash(CConcept* concept, bool negation, CBOXHASH* absorbableConceptNominalSchemaConceptHash, CConcept* nominalSchemaConcept, QSet* testedConceptSet) { cint64 conOpCode = concept->getOperatorCode(); if ((conOpCode == CCSUB || conOpCode == CCEQ || conOpCode == CCTOP || conOpCode == CCBOTTOM)) { return false; } bool foundAbsorbableNominalSchemaConcept = false; if (negation && concept == nominalSchemaConcept) { foundAbsorbableNominalSchemaConcept = true; } else { cint64 conCode = concept->getOperatorCode(); if (negation && (conCode == CCSOME) || !negation && (conCode == CCALL)) { for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); foundAbsorbableNominalSchemaConcept |= hasNominalSchemaAbsorbableConceptFillHash(opConcept,negation^opConLinkerIt->isNegated(),absorbableConceptNominalSchemaConceptHash,nominalSchemaConcept,testedConceptSet); } } else if (!negation && (conCode == CCAND || conCode == CCOR) || negation && (conCode == CCOR || conCode == CCAND)) { for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); foundAbsorbableNominalSchemaConcept |= hasNominalSchemaAbsorbableConceptFillHash(opConcept,negation^opConLinkerIt->isNegated(),absorbableConceptNominalSchemaConceptHash,nominalSchemaConcept,testedConceptSet); } } } if (foundAbsorbableNominalSchemaConcept) { if (!testedConceptSet->contains(concept)) { testedConceptSet->insert(concept); absorbableConceptNominalSchemaConceptHash->insertMulti(concept,nominalSchemaConcept); } } return foundAbsorbableNominalSchemaConcept; } bool CNominalSchemaTemplateExtractionPreProcess::hasNominalSchemaConceptFillHash(CConcept* concept, CBOXHASH* conceptNominalSchemaConceptHash, CConcept* nominalSchemaConcept, QSet* testedConceptSet) { cint64 conOpCode = concept->getOperatorCode(); if ((conOpCode == CCSUB || conOpCode == CCEQ || conOpCode == CCTOP || conOpCode == CCBOTTOM)) { return false; } bool foundNominalSchemaConcept = false; if (concept == nominalSchemaConcept) { foundNominalSchemaConcept = true; } else { for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); foundNominalSchemaConcept |= hasNominalSchemaConceptFillHash(opConcept,conceptNominalSchemaConceptHash,nominalSchemaConcept,testedConceptSet); } } if (foundNominalSchemaConcept) { if (!testedConceptSet->contains(concept)) { testedConceptSet->insert(concept); conceptNominalSchemaConceptHash->insertMulti(concept,nominalSchemaConcept); } } return foundNominalSchemaConcept; } void CNominalSchemaTemplateExtractionPreProcess::collectNominalSchemaConcepts(CConcept* concept, CBOXSET* nominalSchemaConceptSet) { cint64 conOpCode = concept->getOperatorCode(); if ((conOpCode == CCSUB || conOpCode == CCEQ || conOpCode == CCTOP || conOpCode == CCBOTTOM)) { } else if (conOpCode == CCNOMVAR) { nominalSchemaConceptSet->insert(concept); } else { for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); collectNominalSchemaConcepts(opConcept,nominalSchemaConceptSet); } } } bool CNominalSchemaTemplateExtractionPreProcess::hasNominalSchemaConcept(CConcept* concept) { QSet testedConceptSet; return hasNominalSchemaConcept(concept,&testedConceptSet); } bool CNominalSchemaTemplateExtractionPreProcess::hasNominalSchemaConcept(CConcept* concept, QSet* testedConceptSet) { cint64 conOpCode = concept->getOperatorCode(); if ((conOpCode == CCSUB || conOpCode == CCEQ || conOpCode == CCTOP || conOpCode == CCBOTTOM)) { return false; } else if (conOpCode == CCNOMVAR) { return true; } if (mConceptNominalSchemaHash.contains(concept)) { return mConceptNominalSchemaHash.value(concept); } bool foundNominalSchemaConcept = false; for (CSortedNegLinker* opConLinkerIt = concept->getOperandList(); opConLinkerIt && !foundNominalSchemaConcept; opConLinkerIt = opConLinkerIt->getNext()) { CConcept* opConcept = opConLinkerIt->getData(); foundNominalSchemaConcept = hasNominalSchemaConcept(opConcept); } mConceptNominalSchemaHash.insert(concept,foundNominalSchemaConcept); return foundNominalSchemaConcept; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CRequirementConfigPreprocessingThread.cpp0000644000175000017500000004303712520551226032325 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRequirementConfigPreprocessingThread.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CRequirementConfigPreprocessingThread::CRequirementConfigPreprocessingThread(CReasonerManager *reasonerManager) : CPreprocessingThread(reasonerManager),CLogDomain("::Konclude::Reasoner::Kernel::Preprocessor") { } CRequirementConfigPreprocessingThread::~CRequirementConfigPreprocessingThread() { } COntologyPreprocessingItem* CRequirementConfigPreprocessingThread::initializeOntologyPreprocessingItem(CConcreteOntology* ontology, CConfigurationBase* config) { CRequirementConfigPreprocessingItem* item = new CRequirementConfigPreprocessingItem(); item->initRequirementConfigPreprocessingItem(ontology,config); return item; } bool CRequirementConfigPreprocessingThread::createNextTest() { COntologyPreprocessingItem* loopOntPreCompItem = 0; bool workTestCreated = false; while (!workTestCreated && !mProcessingOntItemList.isEmpty()) { COntologyPreprocessingItem* ontPreCompItem = mProcessingOntItemList.first(); if (ontPreCompItem == loopOntPreCompItem) { // don't run into infinite loop without doing something break; } CRequirementConfigPreprocessingItem* reqConfPreCompItem = (CRequirementConfigPreprocessingItem*)ontPreCompItem; bool failDebug = false; if (!workTestCreated && reqConfPreCompItem->isActiveCountingStepRequired()) { if (!reqConfPreCompItem->isActiveCountingStepFinished()) { if (reqConfPreCompItem->areActiveCountingStepProcessingRequirementSatisfied()) { LOG(INFO,getDomain(),logTr("Counting active entities."),this); countActiveEntites(reqConfPreCompItem); reqConfPreCompItem->getActiveCountingProcessingStep()->setStepFinished(true); reqConfPreCompItem->getActiveCountingProcessingStep()->submitRequirementsUpdate(); } else { reqConfPreCompItem->getActiveCountingProcessingStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); } } else { reqConfPreCompItem->getActiveCountingProcessingStep()->submitRequirementsUpdate(); } } if (!workTestCreated && reqConfPreCompItem->isBuildStepRequired()) { if (!reqConfPreCompItem->isBuildStepFinished()) { if (reqConfPreCompItem->areBuildStepProcessingRequirementSatisfied()) { LOG(INFO,getDomain(),logTr("Build intern ontology representation."),this); createBuild(reqConfPreCompItem); if (reqConfPreCompItem->failAfterBuilt()) { failDebug = true; reqConfPreCompItem->getBuildProcessingStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED); } else { reqConfPreCompItem->getBuildProcessingStep()->setStepFinished(true); reqConfPreCompItem->getBuildProcessingStep()->submitRequirementsUpdate(); } } else { reqConfPreCompItem->getBuildProcessingStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); } } else { reqConfPreCompItem->getBuildProcessingStep()->submitRequirementsUpdate(); } } if (!workTestCreated && reqConfPreCompItem->isPreprocessStepRequired()) { if (!reqConfPreCompItem->isPreprocessStepFinished()) { if (reqConfPreCompItem->arePreprocessStepProcessingRequirementSatisfied()) { LOG(INFO,getDomain(),logTr("Preprocess ontology."),this); createPreprocess(reqConfPreCompItem); if (reqConfPreCompItem->failAfterPreprocessing()) { failDebug = true; reqConfPreCompItem->getPreprocessProcessingStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED); } else { reqConfPreCompItem->getPreprocessProcessingStep()->setStepFinished(true); reqConfPreCompItem->getPreprocessProcessingStep()->submitRequirementsUpdate(); } } else { reqConfPreCompItem->getPreprocessProcessingStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); } } else { reqConfPreCompItem->getPreprocessProcessingStep()->submitRequirementsUpdate(); } } if (!workTestCreated) { if (!reqConfPreCompItem->hasRemainingProcessingRequirements()) { finishOntologyPreprocessing(reqConfPreCompItem); mProcessingOntItemList.removeFirst(); } else { mProcessingOntItemList.removeFirst(); mProcessingOntItemList.append(reqConfPreCompItem); loopOntPreCompItem = ontPreCompItem; } } } return workTestCreated; } bool CRequirementConfigPreprocessingThread::countActiveEntites(CRequirementConfigPreprocessingItem* reqConfPreCompItem) { CConcreteOntology* ontology = reqConfPreCompItem->getOntology(); CConfiguration* ontConfig = ontology->getConfiguration(); CONTOLOGYAXIOMLIST< QPair >* changeAxiomList = ontology->getBuildData()->getChangeAxiomList(); cint64 newAxiomCount = changeAxiomList->size(); COntologyIncrementalRevisionData* incRevData = ontology->getIncrementalRevisionData(); cint64 lastChangeCountedAxiom = incRevData->getLastChangeCountedAxiom(); COntologyIncrementalAxiomChangeData* incAxChangeData = incRevData->getAxiomChangeData(); bool axiomsChanged = false; for (cint64 currAxiom = lastChangeCountedAxiom; currAxiom < newAxiomCount; ++currAxiom) { const QPair& axiomChangePair((*changeAxiomList)[currAxiom]); bool axiomAdded = axiomChangePair.second; CAxiomExpression* axiom = axiomChangePair.first; CBuildExpression::ExpressionType axiomType = axiom->getType(); if (axiomType == CBuildExpression::BETDECLARATION) { CDeclarationAxiomExpression* decAxiomExp = dynamic_cast(axiom); if (decAxiomExp) { CExpressionEntity* entityExp = decAxiomExp->getEntity(); CClassExpression* classExp = dynamic_cast(entityExp); if (classExp) { if (axiomAdded) { incAxChangeData->incAddedTBoxAxiomCount(); } else { incAxChangeData->incDeletedTBoxAxiomCount(); } } else { CObjectPropertyExpression* objPropExp = dynamic_cast(entityExp); if (objPropExp) { if (axiomAdded) { incAxChangeData->incAddedRBoxAxiomCount(); } else { incAxChangeData->incDeletedRBoxAxiomCount(); } } else { CDataPropertyExpression* dataPropExp = dynamic_cast(entityExp); if (dataPropExp) { if (axiomAdded) { incAxChangeData->incAddedRBoxAxiomCount(); } else { incAxChangeData->incDeletedRBoxAxiomCount(); } } else { CNamedIndividualExpression* namedIndiExp = dynamic_cast(entityExp); if (namedIndiExp) { if (axiomAdded) { incAxChangeData->incAddedABoxAxiomCount(); } else { incAxChangeData->incDeletedABoxAxiomCount(); } } else { CAnonymousIndividualExpression* anonyIndiExp = dynamic_cast(entityExp); if (anonyIndiExp) { if (axiomAdded) { incAxChangeData->incAddedABoxAxiomCount(); } else { incAxChangeData->incDeletedABoxAxiomCount(); } } } } } } } } else if (axiomType == CBuildExpression::BETEQUIVALENTCLASSES || axiomType == CBuildExpression::BETESUBCLASSOF || axiomType == CBuildExpression::BETDISJOINTUNION || axiomType == CBuildExpression::BETDISJOINTCLASSES) { if (axiomAdded) { incAxChangeData->incAddedTBoxAxiomCount(); } else { incAxChangeData->incDeletedTBoxAxiomCount(); } } else if (axiomType == CBuildExpression::BETCLASSASSERTION || axiomType == CBuildExpression::BETOBJECTPROPERTYASSERTION || axiomType == CBuildExpression::BETSAMEINDIVIDUAL || axiomType == CBuildExpression::BETDIFFERENTINDIVIDUAL || axiomType == CBuildExpression::BETNEGATIVEOBJECTPROPERTYASSERTION || axiomType == CBuildExpression::BETDATAPROPERTYASSERTION || axiomType == CBuildExpression::BETNEGATIVEDATAPROPERTYASSERTION) { if (axiomAdded) { incAxChangeData->incAddedABoxAxiomCount(); } else { incAxChangeData->incDeletedABoxAxiomCount(); } } else if (axiomType == CBuildExpression::BETSUBOBJECTPROPERTYOF || axiomType == CBuildExpression::BETTRANSETIVEPROPERTYOF || axiomType == CBuildExpression::BETINVERSEOBJECTPROPERTYOF || axiomType == CBuildExpression::BETFUNCTIONALPROPERTYOF || axiomType == CBuildExpression::BETOBJECTPROPERTYDOMAIN || axiomType == CBuildExpression::BETOBJECTPROPERTYRANGE || axiomType == CBuildExpression::BETFUNCTIONALOBJECTPROPERTY || axiomType == CBuildExpression::BETTRANSITIVEOBJECTPROPERTY || axiomType == CBuildExpression::BETINVERSEOBJECTPROPERTIES || axiomType == CBuildExpression::BETEQUIVALENTOBJECTPROPERTIES || axiomType == CBuildExpression::BETSYMMETRICPROPERTY || axiomType == CBuildExpression::BETASYMMETRICPROPERTY || axiomType == CBuildExpression::BETREFLEXIVEPROPERTY || axiomType == CBuildExpression::BETIRREFLEXIVEPROPERTY || axiomType == CBuildExpression::BETOBJECTPROPERTYCHAIN || axiomType == CBuildExpression::BETDISJOINTOBJECTPROPERTIES || axiomType == CBuildExpression::BETINVERSEFUNCTIONALPROPERTY) { if (axiomAdded) { incAxChangeData->incAddedRBoxAxiomCount(); } else { incAxChangeData->incDeletedRBoxAxiomCount(); } } else if (axiomType == CBuildExpression::BETDATAPROPERTYDOMAIN || axiomType == CBuildExpression::BETDATAPROPERTYRANGE || axiomType == CBuildExpression::BETSUBDATAPROPERTYOF || axiomType == CBuildExpression::BETDISJOINTDATAPROPERTIES || axiomType == CBuildExpression::BETEQUIVALENTDATAPROPERTIES || axiomType == CBuildExpression::BETFUNCTIONALDATAPROPERTY || axiomType == CBuildExpression::BETDATAPROPERTYASSERTION || axiomType == CBuildExpression::BETNEGATIVEDATAPROPERTYASSERTION) { if (axiomAdded) { incAxChangeData->incAddedRBoxAxiomCount(); } else { incAxChangeData->incDeletedRBoxAxiomCount(); } } axiomsChanged = true; } incRevData->setLastChangeCountedAxiom(newAxiomCount); bool incRebuild = CConfigDataReader::readConfigBoolean(ontConfig,"Konclude.Ontology.Revision.IncrementalRebuild"); if (!incRebuild && ontology->getIncrementalRevisionData()->getBasementOntology() != ontology) { COntologyIncrementalRevisionData* incRevData = ontology->getIncrementalRevisionData(); ontology->getDataBoxes()->referenceDataBoxes(incRevData->getBasementOntology()->getDataBoxes()); } else { incRevData->setPreviousConsistentOntology(searchPreviousConsistentOntologyVersion(incRevData,reqConfPreCompItem)); incRevData->setPreviousClassesClassifiedOntology(searchPreviousClassesClassifiedOntologyVersion(incRevData,reqConfPreCompItem)); incRevData->setPreviousClassTypesRealizedOntology(searchPreviousClassRealizedOntologyVersion(incRevData,reqConfPreCompItem)); } bool newAxiomsCounted = false; CExpressionDataBoxMapping* expDataBoxMapping = ontology->getDataBoxes()->getExpressionDataBoxMapping(); CActiveEntityCountVector* activeEntityCountVector = expDataBoxMapping->getActiveEntityVector(); activeEntityCountVector->increaseVectorSize(ontology->getBuildData()->getNextEntityNumber(false)); CActiveEntitySubExpressionVisitorUpdater* activeEntityCountUpdater = new CActiveEntitySubExpressionVisitorUpdater(activeEntityCountVector); cint64 lastCountedAxiom = expDataBoxMapping->getLastActiveCountedEntityAxiom(); for (cint64 currAxiom = lastCountedAxiom; currAxiom < newAxiomCount; ++currAxiom) { const QPair& axiomChangePair((*changeAxiomList)[currAxiom]); bool axiomAdded = axiomChangePair.second; CAxiomExpression* axiom = axiomChangePair.first; activeEntityCountUpdater->updateEntitiesForAxioms(axiom,axiomAdded); newAxiomsCounted = true; } expDataBoxMapping->setLastActiveCountedEntityAxiom(newAxiomCount); delete activeEntityCountUpdater; return newAxiomsCounted; } CConcreteOntology* CRequirementConfigPreprocessingThread::searchPreviousClassRealizedOntologyVersion(COntologyIncrementalRevisionData* incRevData, CRequirementConfigPreprocessingItem* reqConfPreCompItem) { CConcreteOntology* lastRealizedOntology = nullptr; CConcreteOntology* prevOntology = incRevData->getPreviousOntologyVersion(); while (prevOntology && !lastRealizedOntology) { CRealization* prevRealizedData = prevOntology->getRealization(); if (prevRealizedData && prevRealizedData->hasConceptRealization()) { lastRealizedOntology = prevOntology; } if (!lastRealizedOntology) { prevOntology = prevOntology->getIncrementalRevisionData()->getPreviousOntologyVersion(); } } return lastRealizedOntology; } CConcreteOntology* CRequirementConfigPreprocessingThread::searchPreviousClassesClassifiedOntologyVersion(COntologyIncrementalRevisionData* incRevData, CRequirementConfigPreprocessingItem* reqConfPreCompItem) { CConcreteOntology* lastClassifiedOntology = nullptr; CConcreteOntology* prevOntology = incRevData->getPreviousOntologyVersion(); while (prevOntology && !lastClassifiedOntology) { CClassification* prevClassifiedData = prevOntology->getClassification(); if (prevClassifiedData && prevClassifiedData->hasClassConceptClassification()) { lastClassifiedOntology = prevOntology; } if (!lastClassifiedOntology) { prevOntology = prevOntology->getIncrementalRevisionData()->getPreviousOntologyVersion(); } } return lastClassifiedOntology; } CConcreteOntology* CRequirementConfigPreprocessingThread::searchPreviousConsistentOntologyVersion(COntologyIncrementalRevisionData* incRevData, CRequirementConfigPreprocessingItem* reqConfPreCompItem) { CConcreteOntology* lastConsOntology = nullptr; CConcreteOntology* prevOntology = incRevData->getPreviousOntologyVersion(); while (prevOntology && !lastConsOntology) { CConsistence* prevConsistenceData = prevOntology->getConsistence(); if (prevConsistenceData && prevConsistenceData->isOntologyConsistent()) { if (prevConsistenceData->areAllIndividualsRepresentativelyStored() || prevConsistenceData->hasConsistenceModelData()) { lastConsOntology = prevOntology; } } if (!lastConsOntology) { prevOntology = prevOntology->getIncrementalRevisionData()->getPreviousOntologyVersion(); } } return lastConsOntology; } bool CRequirementConfigPreprocessingThread::createBuild(CRequirementConfigPreprocessingItem* reqConfPreCompItem) { CConcreteOntology* ontology = reqConfPreCompItem->getOntology(); ontology->getDataBoxes()->setBuildContinuation(); CConcreteOntologyUpdateBuilder upBuilder(ontology); upBuilder.initializeBuilding(); upBuilder.completeBuilding(); return false; } bool CRequirementConfigPreprocessingThread::createPreprocess(CRequirementConfigPreprocessingItem* reqConfPreCompItem) { CConcreteOntology* ontology = reqConfPreCompItem->getOntology(); CConfiguration* config = reqConfPreCompItem->getCalculationConfiguration(); COntologyConfigDependedPreProcesser ontConDepPreProcessor; ontConDepPreProcessor.preprocess(ontology,config); return false; } bool CRequirementConfigPreprocessingThread::preprocessingTested(COntologyPreprocessingItem* ontPreCompItem, CPreprocessingTestingItem* preTestItem, CPreprocessingCalculatedCallbackEvent* pcce) { return false; } bool CRequirementConfigPreprocessingThread::finishOntologyPreprocessing(CRequirementConfigPreprocessingItem* reqConfPreCompItem) { if (reqConfPreCompItem->areAllStepFinished()) { reqConfPreCompItem->setPreprocessingFinished(true); CConcreteOntology* ontology = reqConfPreCompItem->getOntology(); CPreprocessing* preprocessing = ontology->getPreprocessing(); preprocessing->setPreprocessed(true); } mActiveOntItemSet.remove(reqConfPreCompItem); mInactiveOntItemSet.insert(reqConfPreCompItem); reqConfPreCompItem->doPreprocessingFinishedCallback(true); return true; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CCoreOntologyCyclesExtractorPreProcess.cpp0000644000175000017500000003352212520551220032463 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCoreOntologyCyclesExtractorPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CCoreOntologyCyclesExtractorPreProcess::CCoreOntologyCyclesExtractorPreProcess() { } CCoreOntologyCyclesExtractorPreProcess::~CCoreOntologyCyclesExtractorPreProcess() { } bool CCoreOntologyCyclesExtractorPreProcess::addConceptsToList(CSortedNegLinker* opLinker, bool negated, QList& nextTestingConceptList) { for (CSortedNegLinker* opLinkerIt = opLinker; opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConNeg = opLinkerIt->isNegated()^negated; nextTestingConceptList.append(TConceptNegPair(opConcept,opConNeg)); } return true; } bool CCoreOntologyCyclesExtractorPreProcess::getConceptCycle(QSet* visitedConceptSet, QSet* cylceConceptSet, bool* cycleNominalConnection) { bool cycleClosed = false; bool nominalConn = false; QHash testedConceptHash; QList itemContainer; QList testingConceptList; QList nextTestingConceptList; for (QSet::const_iterator it = cylceConceptSet->constBegin(), itEnd = cylceConceptSet->constEnd(); it != itEnd; ++it) { TConceptNegPair testConNegPair(*it); CConcept* testingConcept = testConNegPair.first; bool testConNegation = testConNegPair.second; CSortedNegLinker* opConLinker = testingConcept->getOperandList(); cint64 testOpCode = testingConcept->getOperatorCode(); if (!testConNegation && (testOpCode == CCEQ || testOpCode == CCSUB || testOpCode == CCAND || testOpCode == CCSOME || testOpCode == CCATLEAST || testOpCode == CCAQSOME) || testConNegation && (testOpCode == CCOR || testOpCode == CCALL)) { addConceptsToList(opConLinker,testConNegation,nextTestingConceptList); CRole* role = testingConcept->getRole(); if (role) { addConceptsToList(role->getDomainConceptList(),false,nextTestingConceptList); addConceptsToList(role->getRangeConceptList(),false,nextTestingConceptList); } } else if (testOpCode == CCAQCHOOCE) { for (CSortedNegLinker* opLinkerIt = opConLinker; opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConNeg = opLinkerIt->isNegated(); if (opConNeg == testConNegation) { nextTestingConceptList.append(TConceptNegPair(opConcept,false)); } } } while (!nextTestingConceptList.isEmpty()) { TConceptNegPair nextConNegPair(nextTestingConceptList.takeFirst()); if (!cylceConceptSet->contains(nextConNegPair)) { CTestingItem* nextTestingItem = new CTestingItem(nextConNegPair); itemContainer.append(nextTestingItem); // depth first search testingConceptList.prepend(nextTestingItem); } } } while (!testingConceptList.isEmpty()) { CTestingItem* testingItem = testingConceptList.takeFirst(); TConceptNegPair testConNegPair(testingItem->mConNegPair); CConcept* testingConcept = testConNegPair.first; bool testConNegation = testConNegPair.second; if (cylceConceptSet->contains(testConNegPair)) { QList backtrackingItemList; backtrackingItemList.append(testingItem->mPrevItem); while (!backtrackingItemList.isEmpty()) { CTestingItem* testedItem = backtrackingItemList.takeFirst(); if (testedItem && !cylceConceptSet->contains(testedItem->mConNegPair)) { cylceConceptSet->insert(testedItem->mConNegPair); QList depList(testedConceptHash.values(testedItem->mConNegPair)); foreach (CTestingItem* depTestedItem, depList) { if (depTestedItem) { backtrackingItemList.append(depTestedItem); } } } } } if (!testedConceptHash.contains(testConNegPair)) { CSortedNegLinker* opConLinker = testingConcept->getOperandList(); cint64 testOpCode = testingConcept->getOperatorCode(); if (!testConNegation && (testOpCode == CCEQ || testOpCode == CCSUB || testOpCode == CCAND || testOpCode == CCSOME || testOpCode == CCATLEAST || testOpCode == CCAQSOME) || testConNegation && (testOpCode == CCOR || testOpCode == CCALL)) { addConceptsToList(opConLinker,testConNegation,nextTestingConceptList); CRole* role = testingConcept->getRole(); if (role) { addConceptsToList(role->getDomainConceptList(),false,nextTestingConceptList); addConceptsToList(role->getRangeConceptList(),false,nextTestingConceptList); } } else if (testOpCode == CCAQCHOOCE) { for (CSortedNegLinker* opLinkerIt = opConLinker; opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConNeg = opLinkerIt->isNegated(); if (opConNeg == testConNegation) { nextTestingConceptList.append(TConceptNegPair(opConcept,false)); } } } else if (testOpCode == CCNOMINAL || testOpCode == CCVALUE) { nominalConn = true; } while (!nextTestingConceptList.isEmpty()) { TConceptNegPair nextConNegPair(nextTestingConceptList.takeFirst()); CTestingItem* nextTestingItem = new CTestingItem(nextConNegPair,testingItem->mSearchingDepth+1,testingItem); itemContainer.append(nextTestingItem); // depth first search testingConceptList.prepend(nextTestingItem); } } testedConceptHash.insertMulti(testConNegPair,testingItem->mPrevItem); } cDeleteAll(itemContainer); for (QSet::const_iterator it = cylceConceptSet->constBegin(), itEnd = cylceConceptSet->constEnd(); it != itEnd; ++it) { TConceptNegPair testConNegPair(*it); visitedConceptSet->insert(testConNegPair); } if (cycleNominalConnection) { *cycleNominalConnection = nominalConn; } return true; } bool CCoreOntologyCyclesExtractorPreProcess::hasConceptCycle(CConcept* concept, bool negated, QSet* visitedConceptSet, QSet* cylceConceptSet) { TConceptNegPair conNegPair(concept,negated); if (!visitedConceptSet->contains(conNegPair)) { bool cycleClosed = false; QHash testedConceptDepHash; QList itemContainer; QList testingConceptList; CTestingItem* firstTestingItem = new CTestingItem(conNegPair); itemContainer.append(firstTestingItem); testingConceptList.append(firstTestingItem); QList nextTestingConceptList; while (!testingConceptList.isEmpty() && !cycleClosed) { CTestingItem* testingItem = testingConceptList.takeFirst(); TConceptNegPair testConNegPair(testingItem->mConNegPair); CConcept* testingConcept = testConNegPair.first; bool testConNegation = testConNegPair.second; CTestingItem* alreadyTestedItem = testedConceptDepHash.value(testConNegPair,nullptr); if (alreadyTestedItem) { if (alreadyTestedItem->mSearchingDepth < testingItem->mSearchingDepth) { // test for real cycle bool foundCycle = false; CTestingItem* prevTestedItemIt = testingItem->mPrevItem; while (prevTestedItemIt && !foundCycle) { if (testConNegPair == prevTestedItemIt->mConNegPair) { foundCycle = true; } prevTestedItemIt = prevTestedItemIt->mPrevItem; } if (foundCycle) { CTestingItem* prevTestedItemIt = testingItem->mPrevItem; while (prevTestedItemIt && !cycleClosed) { cylceConceptSet->insert(prevTestedItemIt->mConNegPair); if (testConNegPair == prevTestedItemIt->mConNegPair) { cycleClosed = true; } prevTestedItemIt = prevTestedItemIt->mPrevItem; } } } // concept is already examined, no cycle for this concept } else { if (!visitedConceptSet->contains(testConNegPair)) { visitedConceptSet->insert(testConNegPair); // examine concept and sub concepts testedConceptDepHash.insert(testConNegPair,testingItem); CSortedNegLinker* opConLinker = testingConcept->getOperandList(); cint64 testOpCode = testingConcept->getOperatorCode(); if (!testConNegation && (testOpCode == CCEQ || testOpCode == CCSUB || testOpCode == CCAND || testOpCode == CCSOME || testOpCode == CCATLEAST || testOpCode == CCAQSOME) || testConNegation && (testOpCode == CCOR || testOpCode == CCALL)) { addConceptsToList(opConLinker,testConNegation,nextTestingConceptList); CRole* role = testingConcept->getRole(); if (role) { addConceptsToList(role->getDomainConceptList(),false,nextTestingConceptList); addConceptsToList(role->getRangeConceptList(),false,nextTestingConceptList); } } else if (testOpCode == CCAQCHOOCE) { for (CSortedNegLinker* opLinkerIt = opConLinker; opLinkerIt; opLinkerIt = opLinkerIt->getNext()) { CConcept* opConcept = opLinkerIt->getData(); bool opConNeg = opLinkerIt->isNegated(); if (opConNeg == testConNegation) { nextTestingConceptList.append(TConceptNegPair(opConcept,false)); } } } while (!nextTestingConceptList.isEmpty()) { TConceptNegPair nextConNegPair(nextTestingConceptList.takeFirst()); CTestingItem* nextTestingItem = new CTestingItem(nextConNegPair,testingItem->mSearchingDepth+1,testingItem); itemContainer.append(nextTestingItem); // depth first search testingConceptList.prepend(nextTestingItem); } } } } cDeleteAll(itemContainer); return cycleClosed; } return false; } CConcreteOntology* CCoreOntologyCyclesExtractorPreProcess::preprocess(CConcreteOntology* ontology, CPreProcessContext* context) { bool skipForELOntologies = CConfigDataReader::readConfigBoolean(context->getConfiguration(),"Konclude.Calculation.Preprocessing.CoreConceptCyclesExtraction.SkipForELFragment",true); bool nonELConstructsUsed = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags()->isNonELConstructUsed(); bool nominalsUsed = ontology->getStructureSummary()->hasNominalOccurrence(); if (nominalsUsed && (nonELConstructsUsed || !skipForELOntologies)) { CTBox* tbox = ontology->getDataBoxes()->getTBox(); CABox* abox = ontology->getDataBoxes()->getABox(); CRBox* rbox = ontology->getDataBoxes()->getRBox(); CConceptVector* conVec = tbox->getConceptVector(); qint64 itemConCounts = conVec->getItemCount(); QSet visitedConceptSet; COntologyContext* ontoContext = ontology->getOntologyContext(); CMemoryAllocationManager* mMemMan = ontoContext->getMemoryAllocationManager(); COntologyCoreConceptCyclesData* coreConCyclesData = ontology->getCoreConceptCyclesData(); mStatExtractedCyclesCount = 0; mStatCyclicConceptsCount = 0; cint64 nextCycleID = 0; for (qint64 i = 0; i < itemConCounts; ++i) { CConcept* concept = conVec->getData(i); if (concept) { cint64 opCode = concept->getOperatorCode(); if (opCode == CCSOME || opCode == CCALL || opCode == CCATLEAST || opCode == CCAQSOME || opCode == CCSOME || opCode == CCSUB || opCode == CCEQ) { bool negated = opCode == CCALL || opCode == CCATMOST; bool opNegated = opCode == CCALL; CSortedNegLinker* opLinkerIt = concept->getOperandList(); while (opLinkerIt) { CConcept* opConcept = concept; bool opNegate = opNegated^opLinkerIt->isNegated(); QSet cylceConceptSet; if (hasConceptCycle(opConcept,opNegate,&visitedConceptSet,&cylceConceptSet)) { bool cycleNominalConnection = false; if (getConceptCycle(&visitedConceptSet,&cylceConceptSet,&cycleNominalConnection)) { ++mStatExtractedCyclesCount; cint64 cycleConceptCount = cylceConceptSet.count(); mStatCyclicConceptsCount += cycleConceptCount; CConceptCycleData* conCycleData = CObjectParameterizingAllocator< CConceptCycleData,CContext* >::allocateAndConstructAndParameterize(mMemMan,ontoContext); conCycleData->initConceptCycleData(); conCycleData->addCycleConcepts(cylceConceptSet); conCycleData->setNominalConnection(cycleNominalConnection); conCycleData->setCycleID(nextCycleID++); coreConCyclesData->installCycle(conCycleData); } } opLinkerIt = opLinkerIt->getNext(); } } } } LOG(INFO,"::Konclude::Reasoner::Preprocess::CoreConceptCycleExtractor",logTr("Found %1 concept cycles with %2 cyclic concepts.").arg(mStatExtractedCyclesCount).arg(mStatCyclicConceptsCount),this); } return ontology; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreprocessingContext.h0000644000175000017500000000470512520551226026637 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGCONTEXT_H #define KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGCONTEXT_H // Libraries includes // Namespace includes #include "PreprocessSettings.h" // Other includes #include "Context/CContext.h" #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" #include "Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Preprocess { /*! * * \class CPreprocessingContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPreprocessingContext : public CContext { // public methods public: //! Constructor CPreprocessingContext(); virtual ~CPreprocessingContext(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); virtual CMemoryPoolAllocationManager* getMemoryPoolAllocationManager(); virtual CMemoryPoolProvider* getMemoryPoolProvider(); // protected methods protected: // protected variables protected: CMemoryPoolAllocationManager* mMemMan; CMemoryPoolProvider* mMemoryPoolProvider; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGCONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CDataLiteralNormalizerPreProcess.h0000644000175000017500000001103712520551220030674 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CDATALITERALNORMALIZERPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CDATALITERALNORMALIZERPREPROCESS_H // Libraries includes #include #include // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" // Other includes #include "Reasoner/Ontology/CBoxContext.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CMBox.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CDataLiteralNormalizerPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralNormalizerPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CDataLiteralNormalizerPreProcess(); //! Destructor virtual ~CDataLiteralNormalizerPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: CDataLiteralValue* createDataLiteralValue(CDataLiteral* dataLiteral, CPreProcessContext* context); bool normalizeDataLiteral(CConcept* dataLiteralConcept, CPreProcessContext* context); bool normalizeDatatypeRestriction(CConcept* datatypeRestrictionConcept, CPreProcessContext* context); CDataLiteral* getNormalizedDataLiteralForLengthRestriction(CDatatype* datatype, CDataLiteral* dataLiteral, bool roundUp, CPreProcessContext* context); CConcept* createConcept(); CConcept* addConceptOperand(CConcept* concept, CConcept* operand, bool negated); CDataLiteralValue* parseIntegerValue(const QString& valueString, CPreProcessContext* context); CDataLiteralValue* parseDecimalValue(const QString& valueString, CPreProcessContext* context); CDataLiteralValue* parseRationalValue(const QString& valueString, CPreProcessContext* context); CDataLiteralValue* parseRealValue(const QString& valueString, CPreProcessContext* context); CDataLiteralValue* parseStringValue(const QString& valueString, bool parseLanguageString, CPreProcessContext* context); CDataLiteralValue* parseDateTimeValue(const QString& valueString, CPreProcessContext* context); CDataLiteralValue* parseBooleanValue(const QString& valueString, CPreProcessContext* context); CDataLiteralValue* parseDoubleValue(const QString& valueString, CPreProcessContext* context); CDataLiteralValue* parseFloatValue(const QString& valueString, CPreProcessContext* context); CDataLiteralValue* parseIRIValue(const QString& valueString, CPreProcessContext* context); CDataLiteralValue* parseXMLValue(const QString& valueString, CPreProcessContext* context); CDataLiteralValue* parseBinaryHexValue(const QString& valueString, CPreProcessContext* context); CDataLiteralValue* parseBinaryBase64Value(const QString& valueString, CPreProcessContext* context); cint64 getBinaryFromHex(QChar character); cint64 getBinaryFromBase64(QChar character); // private methods private: // private variables private: CABox* mABox; CTBox* mTBox; CRBox* mRBox; CMBox* mMBox; CContext* mBoxContext; CIndividualVector* mIndiVec; CRoleVector* mRolesVector; CConceptVector* mConceptVector; CConcreteOntology* mOntology; CMemoryAllocationManager* mMemMan; static bool mConvArraysInitialized; static cint64* mHexStringBinaryDataConvArray; static cint64* mBase64StringBinaryDataConvArray; }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CDATALITERALNORMALIZERPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPrecomputationPreProcess.cpp0000644000175000017500000000463412520551224030020 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecomputationPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CPrecomputationPreProcess::CPrecomputationPreProcess() { } CPrecomputationPreProcess::~CPrecomputationPreProcess() { } CConcreteOntology *CPrecomputationPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { CConfiguration* config = context->getConfiguration(); if (ontology && config) { CReasonerManager* reasonerManager = CConfigManagerReader::readReasonerManagerConfig(config); if (reasonerManager) { CConfigurationBase* configBase = dynamic_cast(config); if (configBase) { bool precomputed = false; CPrecomputationManager* precomputationManager = reasonerManager->getPrecomputationManager(); CPrecomputator* precomputator = precomputationManager->getPrecomputator(ontology,configBase); if (precomputator) { precomputed = precomputator->precompute(ontology,configBase,QList()); } bool consistent = false; CConsistence* consistence = ontology->getConsistence(); if (consistence) { consistent = consistence->isOntologyConsistent(); QString consString("inconsistent"); if (consistent) { consString = "consistent"; } LOG(INFO,"::Konclude::Reasoner::Preprocess::OntologyConsistencyChecking",logTr("Ontology is %1.").arg(consString),this); } } } } return ontology; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/COntologyAssignmentTransformationPreProcess.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/COntologyAssignmentTransformationPreProces0000644000175000017500000000447412520551224032637 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyAssignmentTransformationPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { COntologyAssignmentTransformationPreProcess::COntologyAssignmentTransformationPreProcess(CConcreteOntology *ontologyAssignment) { ontology = ontologyAssignment; } COntologyAssignmentTransformationPreProcess::~COntologyAssignmentTransformationPreProcess() { } CConcreteOntology *COntologyAssignmentTransformationPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { CMBox *mBox = ontology->getDataBoxes()->getMBox(); CTBox *tBox = ontology->getDataBoxes()->getTBox(); CRBox *rBox = ontology->getDataBoxes()->getRBox(); CABox *aBox = ontology->getDataBoxes()->getABox(); if (mBox) { if (ontology) { qint64 ontID = ontology->getTerminologyID(); CConceptVector *concepts = tBox->getConceptVector(); qint64 conceptCount = tBox->getConceptCount(); for (qint64 i = 0; i < conceptCount; ++i) { CConcept *concept = concepts->getLocalData(i); if (concept) { concept->setTerminology(ontology); } } CRoleVector *roles = rBox->getRoleVector(); qint64 roleCount = rBox->getRoleCount(); for (qint64 i = 0; i < roleCount; ++i) { CRole *role = roles->getLocalData(i); if (role) { role->setTerminology(ontology); } } } } return ontology; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CExtractRelevantConceptRolePreProcess.h0000644000175000017500000000434112520551222031716 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CEXTRACTRELEVANTCONCEPTROLEPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CEXTRACTRELEVANTCONCEPTROLEPREPROCESS_H // Libraries includes // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" // Other includes #include "Reasoner/Ontology/CConceptProcessData.h" #include "Reasoner/Ontology/CConceptOperator.h" #include "Reasoner/Ontology/CRoleProcessData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CExtractRelevantConceptRolePreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExtractRelevantConceptRolePreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CExtractRelevantConceptRolePreProcess(); //! Destructor virtual ~CExtractRelevantConceptRolePreProcess(); virtual CConcreteOntology* preprocess(CConcreteOntology* ontology, CPreProcessContext* context); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CEXTRACTRELEVANTCONCEPTROLEPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CConceptTriggerLinker.cpp0000644000175000017500000000403312520551216027057 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConceptTriggerLinker.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CConceptTriggerLinker::CConceptTriggerLinker() : CSortedLinkerBase(this) { } CConceptTriggerLinker* CConceptTriggerLinker::initConceptTriggerLinker(CConcept* triggerConcept, cint64 triggerComplexity) { mTriggerConcept = triggerConcept; mTriggerComplexity = triggerComplexity; return this; } CConcept* CConceptTriggerLinker::getTriggerConcept() { return mTriggerConcept; } cint64 CConceptTriggerLinker::getTriggerComplexity() { return mTriggerComplexity; } CConceptTriggerLinker* CConceptTriggerLinker::setTriggerComplexity(cint64 complexity) { mTriggerComplexity = complexity; return this; } bool CConceptTriggerLinker::operator<=(const CConceptTriggerLinker& conceptTriggerLinker) { if (mTriggerComplexity > conceptTriggerLinker.mTriggerComplexity) { return true; } else if (mTriggerComplexity < conceptTriggerLinker.mTriggerComplexity) { return false; } return mTriggerConcept >= conceptTriggerLinker.mTriggerConcept; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CRequirementConfigPreprocessingThread.h0000644000175000017500000000756312520551226031776 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CREQUIREMENTCONFIGPREPROCESSINGTHREAD_H #define KONCLUDE_REASONER_PREPROCESS_CREQUIREMENTCONFIGPREPROCESSINGTHREAD_H // Libraries includes // Namespace includes #include "PreprocessSettings.h" #include "CPreprocessingThread.h" #include "CPreprocessingTestingItem.h" #include "CRequirementConfigPreprocessingItem.h" #include "COntologyConfigDependedPreProcesser.h" // Other includes #include "Reasoner/Kernel/Manager/CReasonerManager.h" #include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h" #include "Reasoner/Generator/CSatisfiableCalculationJobGenerator.h" #include "Reasoner/Generator/CConcreteOntologyUpdateBuilder.h" #include "Reasoner/Generator/CActiveEntitySubExpressionVisitorUpdater.h" #include "Utilities/Memory/CTempMemoryPoolContainerAllocationManager.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { using namespace Kernel::Task; using namespace Kernel::Manager; using namespace Generator; namespace Preprocess { using namespace Events; /*! * * \class CRequirementConfigPreprocessingThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRequirementConfigPreprocessingThread : public CPreprocessingThread, public CLogDomain { // public methods public: //! Constructor CRequirementConfigPreprocessingThread(CReasonerManager* reasonerManager); //! Destructor ~CRequirementConfigPreprocessingThread(); // protected methods protected: virtual COntologyPreprocessingItem* initializeOntologyPreprocessingItem(CConcreteOntology* ontology, CConfigurationBase* config); virtual bool createNextTest(); virtual bool finishOntologyPreprocessing(CRequirementConfigPreprocessingItem* totallyPreCompItem); virtual bool preprocessingTested(COntologyPreprocessingItem* ontPreCompItem, CPreprocessingTestingItem* preTestItem, CPreprocessingCalculatedCallbackEvent* pcce); CConcreteOntology* searchPreviousConsistentOntologyVersion(COntologyIncrementalRevisionData* incRevData, CRequirementConfigPreprocessingItem* reqConfPreCompItem); CConcreteOntology* searchPreviousClassesClassifiedOntologyVersion(COntologyIncrementalRevisionData* incRevData, CRequirementConfigPreprocessingItem* reqConfPreCompItem); CConcreteOntology* searchPreviousClassRealizedOntologyVersion(COntologyIncrementalRevisionData* incRevData, CRequirementConfigPreprocessingItem* reqConfPreCompItem); virtual bool createBuild(CRequirementConfigPreprocessingItem* reqConfPreCompItem); virtual bool createPreprocess(CRequirementConfigPreprocessingItem* reqConfPreCompItem); virtual bool countActiveEntites(CRequirementConfigPreprocessingItem* reqConfPreCompItem); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CREQUIREMENTCONFIGPREPROCESSINGTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreprocessing.cpp0000644000175000017500000000237612520551226025627 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreprocessing.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CPreprocessing::CPreprocessing() { mPreprocessed = false; } bool CPreprocessing::isPreprocessed() { return mPreprocessed; } CPreprocessing* CPreprocessing::setPreprocessed(bool preprocessed) { mPreprocessed = preprocessed; return this; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPrecomputationPreProcess.h0000644000175000017500000000407312520551224027462 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CPRECOMPUTATIONPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CPRECOMPUTATIONPREPROCESS_H // Libraries includes // Namespace includes #include "CConcreteOntologyPreProcess.h" // Other includes #include "Reasoner/Consistiser/CPrecomputator.h" #include "Reasoner/Kernel/Manager/CPrecomputationManager.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Consistiser; using namespace Kernel::Manager; namespace Preprocess { /*! * * \class CPrecomputationPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPrecomputationPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CPrecomputationPreProcess(); //! Destructor virtual ~CPrecomputationPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CPRECOMPUTATIONPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CConceptUnambiguousHasher.h0000644000175000017500000000450212520551220027401 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CCONCEPTUNAMBIGUOUSHASHER_H #define KONCLUDE_REASONER_PREPROCESS_CCONCEPTUNAMBIGUOUSHASHER_H // Libraries includes #include // Namespace includes // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CConceptUnambiguousHasher * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConceptUnambiguousHasher { // public methods public: //! Constructor CConceptUnambiguousHasher(CConcept* concept, bool tagRequired); cint64 getConceptHashValue() const; bool operator==(const CConceptUnambiguousHasher& expressionHasher) const; // protected methods protected: cint64 calculateHashValue(); // protected variables protected: CConcept* mConcept; cint64 mHashValue; bool mTagRequired; // private methods private: // private variables private: }; inline uint qHash(const CConceptUnambiguousHasher& expressionHasher) { qint64 key = (qint64)expressionHasher.getConceptHashValue(); if (sizeof(quint64) > sizeof(uint)) { return uint((key >> (8 * sizeof(uint) - 1)) ^ key); } else { return uint(key); } } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_PREPROCESS_CCONCEPTUNAMBIGUOUSHASHER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreprocessingCallbackDataContext.cpp0000644000175000017500000000257612520551226031405 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreprocessingCallbackDataContext.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CPreprocessingCallbackDataContext::CPreprocessingCallbackDataContext(bool preprocessed, CConcreteOntology *ontology) { mOntology = ontology; mPreprocessed = preprocessed; } CConcreteOntology *CPreprocessingCallbackDataContext::getOntology() { return mOntology; } bool CPreprocessingCallbackDataContext::isPreprocessed() { return mPreprocessed; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CNominalSchemaTemplateExtractionPreProcess.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CNominalSchemaTemplateExtractionPreProcess0000644000175000017500000001143712520551224032500 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CNominalSchemaTemplateExtractionPreProcess_H #define KONCLUDE_REASONER_PREPROCESS_CNominalSchemaTemplateExtractionPreProcess_H // Libraries includes #include // Namespace includes #include "CConcreteOntologyPreProcess.h" #include "CConceptRoleIndividualLocator.h" #include "CConceptTriggerLinker.h" // Other includes #include "Utilities/Container/CNegLinker.h" #include "Config/CConfigDataReader.h" #include "Reasoner/Generator/CConcreteOntologyInverseRoleBuilder.h" #include "Reasoner/Ontology/CConceptTextFormater.h" #include "Reasoner/Ontology/COntologyTextFormater.h" #include "Reasoner/Ontology/CNominalSchemaTemplateVector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Utilities::Container; namespace Reasoner { using namespace Generator; using namespace Ontology; namespace Preprocess { /*! * * \class CNominalSchemaTemplateExtractionPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNominalSchemaTemplateExtractionPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CNominalSchemaTemplateExtractionPreProcess(); //! Destructor virtual ~CNominalSchemaTemplateExtractionPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: bool findAbsorbableNominalSchemas(CConcept* concept, bool negation, QSet* absorbableNominalVariableSet); void countNominalSchemaConcepts(CConcept* concept, QHash* nominalSchemaConceptCountHash); void replaceNominalSchemasConcepts(CConcept* concept, CConcept* replacingConcept, const QSet& removeNominalVariableSet); bool removeSingleAbsorbableNominalSchemaConcepts(CConcept* concept, bool negation); bool hasNominalSchemaConcept(CConcept* concept); bool hasNominalSchemaConcept(CConcept* concept, QSet* testedConceptSet); bool hasNominalSchemaConceptFillHash(CConcept* concept, CBOXHASH* conceptNominalSchemaConceptHash, CConcept* nominalSchemaConcept, QSet* testedConceptSet); bool hasNominalSchemaAbsorbableConceptFillHash(CConcept* concept, bool negation, CBOXHASH* absorbableConceptNominalSchemaConceptHash, CConcept* nominalSchemaConcept, QSet* testedConceptSet); void collectNominalSchemaConcepts(CConcept* concept, CBOXSET* nominalSchemaConceptSet); void createTemplateConceptNominalSchemaConceptMap(CConcept* concept, CBOXHASH* conceptNominalSchemaConceptHash, CConcept* nominalSchemaConcept); CNominalSchemaTemplate* getNominalSchemaTemplate(CConcept* concept, bool negation); CConcept* createNominalSchemaTemplateReferenceConcept(CNominalSchemaTemplate* nsTemplate); CConcept* transformEquivalentConceptToGCI(CConcept* eqConcept); void addConceptOperand(CConcept* concept, CConcept* opConcept, bool negated); // protected variables protected: CMemoryAllocationManager* mMemMan; CConceptVector* mConceptVec; CRoleVector* mRolesVec; CConcept* mBottomConcept; CConcept* mTopConcept; cint64 mConceptCount; cint64 mRoleCount; CConcreteOntology* mOnto; CMBox* mMBox; CTBox* mTBox; CIndividualVector* mIndividualVector; cint64 mIndividualCount; CNominalSchemaTemplateVector* mNomSchTemplVec; QHash mConceptNominalSchemaHash; QHash mConceptNominalSchemaTemplateHash; cint64 mStatCreatedTemplateCount; cint64 mStatReplacedConceptCount; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CNominalSchemaTemplateExtractionPreProcess_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreprocessingContext.cpp0000644000175000017500000000320412520551226027163 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreprocessingContext.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CPreprocessingContext::CPreprocessingContext() { mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); mMemMan = new CLimitedReserveMemoryPoolAllocationManager(mMemoryPoolProvider); } CPreprocessingContext::~CPreprocessingContext() { delete mMemMan; delete mMemoryPoolProvider; } CMemoryPoolAllocationManager* CPreprocessingContext::getMemoryPoolAllocationManager() { return mMemMan; } CMemoryAllocationManager* CPreprocessingContext::getMemoryAllocationManager() { return mMemMan; } CMemoryPoolProvider* CPreprocessingContext::getMemoryPoolProvider() { return mMemoryPoolProvider; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/COntologyStructureInspectionPreProcess.h0000644000175000017500000000406312520551224032237 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CONTOLOGYSTRUCTUREINSPECTIONPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CONTOLOGYSTRUCTUREINSPECTIONPREPROCESS_H // Libraries includes // Namespace includes #include "CConcreteOntologyPreProcess.h" // Other includes #include "Reasoner/Ontology/COntologyInspector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class COntologyStructureInspectionPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyStructureInspectionPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor COntologyStructureInspectionPreProcess(); //! Destructor virtual ~COntologyStructureInspectionPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CONTOLOGYSTRUCTUREINSPECTIONPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreprocessingTestingItem.h0000644000175000017500000000417212520551226027445 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGTESTINGITEM_H #define KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGTESTINGITEM_H // Libraries includes // Namespace includes #include "PreprocessSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Preprocess { /*! * * \class CPreprocessingTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPreprocessingTestingItem { // public methods public: //! Constructor CPreprocessingTestingItem(COntologyPreprocessingItem* preproItem); enum PreprocessingTYPE { BUILDPREPROCESSINGTYPE, PREPROCESSPREPROCESSINGTYPE }; COntologyPreprocessingItem* getOntologyPreprocessingItem(); CPreprocessingTestingItem* setOntologyPreprocessingItem(COntologyPreprocessingItem* preproItem); virtual PreprocessingTYPE getPreprocessingTestingType() = 0; // protected methods protected: // protected variables protected: COntologyPreprocessingItem* mOntologyPreproItem; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CPREPROCESSINGTESTINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/COntologyPreprocessingItem.h0000644000175000017500000000604312520551224027637 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CONTOLOGYPREPROCESSINGITEM_H #define KONCLUDE_REASONER_PREPROCESS_CONTOLOGYPREPROCESSINGITEM_H // Libraries includes // Namespace includes #include "PreprocessSettings.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Concurrent/Callback/CCallbackListExecuter.h" #include "Concurrent/Callback/CCallbackData.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; using namespace Config; namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class COntologyPreprocessingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyPreprocessingItem { // public methods public: //! Constructor COntologyPreprocessingItem(); COntologyPreprocessingItem* initPreprocessingItem(CConcreteOntology* ontology, CConfigurationBase* config); virtual COntologyPreprocessingItem* addProcessingRequirement(COntologyProcessingRequirement* ontoRequirement); bool isPreprocessingFinished(); COntologyPreprocessingItem* setPreprocessingFinished(bool finished); COntologyPreprocessingItem* doPreprocessingFinishedCallback(bool doCallbacks = true); COntologyPreprocessingItem* addPreprocessingFinishedCallback(CCallbackData* callback); CConfigurationBase* getConfiguration(); CConcreteOntology* getOntology(); QSet* getPreprocessingTestingItemSet(); cint64 getCurrentPreprocessingTestingCount(); bool hasCurrentPreprocessingTestingCount(); // protected methods protected: // protected variables protected: CConcreteOntology* mOntology; CConfigurationBase* mConfig; bool mPreprocessingFinishedFlag; CCallbackListExecuter mCallbackExecuter; QSet mTestItemSet; // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CONTOLOGYPREPROCESSINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/COntologyStructureInspectionPreProcess.cpp0000644000175000017500000000420512520551224032570 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyStructureInspectionPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { COntologyStructureInspectionPreProcess::COntologyStructureInspectionPreProcess() { } COntologyStructureInspectionPreProcess::~COntologyStructureInspectionPreProcess() { } CConcreteOntology *COntologyStructureInspectionPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { COntologyInspector ontIns; ontIns.createGCIConceptSet(ontology->getDataBoxes()->getTBox()); COntologyStructureSummary* ontStructSum = ontIns.createStructureSummary(ontology); bool nonELConstructsUsed = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags()->isNonELConstructUsed(); if (nonELConstructsUsed) { ontIns.analyzeOntologyConceptsStructureFlags(ontology,ontStructSum); } else { ontStructSum->setNominalOccurrence(false); ontStructSum->setOnlyELConceptClasses(true); ontStructSum->setOnlyDeterministicConceptClasses(true); } LOG(INFO,"::Konclude::Reasoner::Kernel::Preprocess::StructureInspection",logTr("Detected Ontology Expressiveness: '%1'.").arg(ontology->getStructureSummary()->getExpressivenessString()),this); return ontology; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CNominalSchemaAbsorptionPathLinker.h0000644000175000017500000000527612520551224031212 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CNOMINALSCHEMAABSORPTIONPATHLINKER_H #define KONCLUDE_REASONER_PREPROCESS_CNOMINALSCHEMAABSORPTIONPATHLINKER_H // Libraries includes // Namespace includes #include "Reasoner/Ontology/CConcept.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Reasoner { using namespace Ontology; namespace Preprocess { /*! * * \class CNominalSchemaAbsorptionPathLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNominalSchemaAbsorptionPathLinker : public CLinkerBase { // public methods public: //! Constructor CNominalSchemaAbsorptionPathLinker(); CNominalSchemaAbsorptionPathLinker* initNominalSchemaAbsorptionPathLinker(CNominalSchemaAbsorptionPathLinker* nomSchAbsorpPathLinker); QHash* getNominalSchemaBindedConceptTriggerHash(); QList* getAncestorConceptTriggerList(); QList* getVariableList(); CVariable* getLastVariable(); bool hasVariables(); CConcept* getLastPathTriggerConcept(); CNominalSchemaAbsorptionPathLinker* setLastPathTriggerConcept(CConcept* lastPathTriggerConcept); CNominalSchemaAbsorptionPathLinker* addVariable(CVariable* variable); // protected methods protected: // private methods private: QHash mNomSchBindConceptHash; QList mAncestorList; QList mVariableList; CConcept* mLastPathConcept; // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CNOMINALSCHEMAABSORPTIONPATHLINKER_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CCommonDisjunctConceptExtractionPreProcess.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CCommonDisjunctConceptExtractionPreProcess0000644000175000017500000001711312520551216032534 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommonDisjunctConceptExtractionPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CCommonDisjunctConceptExtractionPreProcess::CCommonDisjunctConceptExtractionPreProcess() { } CCommonDisjunctConceptExtractionPreProcess::~CCommonDisjunctConceptExtractionPreProcess() { } CConcreteOntology *CCommonDisjunctConceptExtractionPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { bool skipForELOntologies = CConfigDataReader::readConfigBoolean(context->getConfiguration(),"Konclude.Calculation.Preprocessing.CommonDisjunctConceptExtraction.SkipForELFragment",true); bool nonELConstructsUsed = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags()->isNonELConstructUsed(); if (nonELConstructsUsed || !skipForELOntologies) { CMBox *mBox = ontology->getDataBoxes()->getMBox(); CTBox *tBox = ontology->getDataBoxes()->getTBox(); CRBox *rBox = ontology->getDataBoxes()->getRBox(); CABox *aBox = ontology->getDataBoxes()->getABox(); mConceptVector = tBox->getConceptVector(); mTopConcept = mConceptVector->getLocalData(1); mMemMan = ontology->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); CImplicationReplacementVector* repVector = mBox->getImplicationReplacementVector(true); mMemMan = ontology->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); mDisjunctionCommDisConHash.clear(); mStatExtractedCommDisCon = 0; mStatExtractedConceptForDisjunctionCount = 0; cint64 conCount = mConceptVector->getItemCount(); for (cint64 conIdx = 0; conIdx < conCount; ++conIdx) { CConcept* concept = mConceptVector->getData(conIdx); if (concept) { cint64 conOpCode = concept->getOperatorCode(); cint64 opCount = concept->getOperandCount(); if (concept->getOperandCount() >= 1 && (conOpCode == CCAND || conOpCode == CCEQ || conOpCode == CCOR)) { bool negateConcept = conOpCode == CCAND || conOpCode == CCEQ; QSet consideredDisConConceptSet; QSet disConConceptSet; getDisjunctConcepts(concept,negateConcept,&disConConceptSet,&consideredDisConConceptSet); disConConceptSet.remove(TConNegPair(concept,negateConcept)); bool localRepData = false; CReplacementData* prevReplData = repVector->getData(conIdx,&localRepData); if (!disConConceptSet.isEmpty() || prevReplData) { CReplacementData* replData = prevReplData; if (!localRepData) { replData = CObjectAllocator::allocateAndConstruct(mMemMan); repVector->setData(conIdx,replData); replData->initReplacementData(prevReplData); } ++mStatExtractedConceptForDisjunctionCount; replData->clearCommonDisjunctConceptLinker(); for (QSet::const_iterator it = disConConceptSet.constBegin(), itEnd = disConConceptSet.constEnd(); it != itEnd; ++it) { TConNegPair conNegPair(*it); CConcept* commCon = conNegPair.first; bool commNeg = conNegPair.second; if (commCon != concept || negateConcept != commNeg) { CXNegLinker* commNegConLinker = CObjectAllocator< CXNegLinker >::allocateAndConstruct(mMemMan); commNegConLinker->initNegLinker(commCon,commNeg); replData->addCommonDisjunctConceptLinker(commNegConLinker); ++mStatExtractedCommDisCon; } } } } } } cDeleteAll(mSetContainer); LOG(INFO,"::Konclude::Reasoner::Preprocess::CommonDisjunctConceptExtractor",logTr("Extracted %1 concepts for %2 disjunctions.").arg(mStatExtractedCommDisCon).arg(mStatExtractedConceptForDisjunctionCount),this); } return ontology; } bool CCommonDisjunctConceptExtractionPreProcess::getDisjunctConcepts(CConcept* concept, bool negated, QSet* collectConSet, QSet* consideredConSet) { if (!consideredConSet->contains(TConNegPair(concept,negated))) { consideredConSet->insert(TConNegPair(concept,negated)); collectConSet->insert(TConNegPair(concept,negated)); cint64 opCode = concept->getOperatorCode(); if (!negated && (opCode == CCSUB || opCode == CCEQ || opCode == CCAND || (concept->getOperandCount() == 1 && opCode == CCOR)) || negated && (opCode == CCOR || (concept->getOperandCount() == 1 && (opCode == CCAND || opCode == CCEQ)))) { for (CSortedNegLinker* opLinker = concept->getOperandList(); opLinker; opLinker = opLinker->getNext()) { CConcept* opConcept = opLinker->getData(); bool opConNegation = opLinker->isNegated() ^ negated; getDisjunctConcepts(opConcept,opConNegation,collectConSet,consideredConSet); } } else if (!negated && (opCode == CCOR) || negated && (opCode == CCAND || opCode == CCEQ)) { QSet* firstDisjunctConSet = mDisjunctionCommDisConHash.value(TConNegPair(concept,negated)); if (!firstDisjunctConSet) { firstDisjunctConSet = new QSet(); QSet nextDisjunctConSet; CSortedNegLinker* opLinker = concept->getOperandList(); if (opLinker) { CConcept* firstDisjunctConcept = opLinker->getData(); bool firstDisConNegation = opLinker->isNegated() ^ negated; opLinker = opLinker->getNext(); QSet consideredConSet1(*consideredConSet); getDisjunctConcepts(firstDisjunctConcept,firstDisConNegation,firstDisjunctConSet,&consideredConSet1); while (opLinker && !firstDisjunctConSet->isEmpty()) { CConcept* nextDisjunctConcept = opLinker->getData(); bool nextDisConNegation = opLinker->isNegated() ^ negated; nextDisjunctConSet.clear(); QSet consideredConSet2(*consideredConSet); getDisjunctConcepts(nextDisjunctConcept,nextDisConNegation,&nextDisjunctConSet,&consideredConSet2); QSet::iterator it = firstDisjunctConSet->begin(); while (it != firstDisjunctConSet->end()) { TConNegPair conNegPair(*it); if (!nextDisjunctConSet.contains(conNegPair)) { it = firstDisjunctConSet->erase(it); } else { ++it; } } opLinker = opLinker->getNext(); } } mSetContainer.append(firstDisjunctConSet); mDisjunctionCommDisConHash.insert(TConNegPair(concept,negated),firstDisjunctConSet); } for (QSet::iterator it = firstDisjunctConSet->begin(); it != firstDisjunctConSet->end(); ++it) { TConNegPair conNegPair(*it); collectConSet->insert(conNegPair); } } return true; } return false; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CNegationTransformationPreProcess.cpp0000644000175000017500000000640412520551222031475 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNegationTransformationPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CNegationTransformationPreProcess::CNegationTransformationPreProcess() { } CNegationTransformationPreProcess::~CNegationTransformationPreProcess() { } CConcreteOntology *CNegationTransformationPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { CTBox* tbox = ontology->getDataBoxes()->getTBox(); CABox *abox = ontology->getDataBoxes()->getABox(); CRBox *rbox = ontology->getDataBoxes()->getRBox(); CConceptVector *concepts = tbox->getConceptVector(); qint64 itemConCounts = concepts->getItemCount(); for (qint64 i = 0; i < itemConCounts; ++i) { CConcept *concept = concepts->getLocalData(i); if (concept && concept->getOperatorCode() != CCNOT) { CSortedNegLinker *operands = concept->getOperandList(); while (operands) { while (operands->getData()->getDefinitionOperatorTag() == CCNOT) { CConcept *compConcept = operands->getData()->getOperandList()->getData(); operands->setData(compConcept); operands->setNegated(!operands->isNegated()); } operands = operands->getNext(); } } } CRoleVector *roles = rbox->getRoleVector(); qint64 itemRolCounts = roles->getItemCount(); for (qint64 i = 0; i < itemRolCounts; ++i) { CRole *role = roles->getLocalData(i); if (role) { CSortedNegLinker *operandsDomIt = role->getDomainConceptList(); while (operandsDomIt) { while (operandsDomIt->getData()->getDefinitionOperatorTag() == CCNOT) { CConcept *compConcept = operandsDomIt->getData()->getOperandList()->getData(); operandsDomIt->setData(compConcept); operandsDomIt->setNegated(!operandsDomIt->isNegated()); } operandsDomIt = operandsDomIt->getNext(); } CSortedNegLinker *operandsRanIt = role->getRangeConceptList(); while (operandsRanIt) { while (operandsRanIt->getData()->getDefinitionOperatorTag() == CCNOT) { CConcept *compConcept = operandsRanIt->getData()->getOperandList()->getData(); operandsRanIt->setData(compConcept); operandsRanIt->setNegated(!operandsRanIt->isNegated()); } operandsRanIt = operandsRanIt->getNext(); } } } return ontology; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CNegationTransformationPreProcess.h0000644000175000017500000000370112520551222031137 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_PREPROCESS_CNEGATIONTRANSFORMATIONPREPROCESS_H #define KONCLUDE_REASONER_PREPROCESS_CNEGATIONTRANSFORMATIONPREPROCESS_H // Libraries includes // Namespace includes #include "CConcreteOntologyPreProcess.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Preprocess { /*! * * \class CNegationTransformationPreProcess * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNegationTransformationPreProcess : public CConcreteOntologyPreProcess { // public methods public: //! Constructor CNegationTransformationPreProcess(); //! Destructor virtual ~CNegationTransformationPreProcess(); virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_PREPROCESS_CNEGATIONTRANSFORMATIONPREPROCESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CDataLiteralNormalizerPreProcess.cpp0000644000175000017500000010157512520551220031236 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralNormalizerPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { bool CDataLiteralNormalizerPreProcess::mConvArraysInitialized = false; cint64* CDataLiteralNormalizerPreProcess::mHexStringBinaryDataConvArray = nullptr; cint64* CDataLiteralNormalizerPreProcess::mBase64StringBinaryDataConvArray = nullptr; CDataLiteralNormalizerPreProcess::CDataLiteralNormalizerPreProcess() { if (!mConvArraysInitialized) { cint64* tmpHexStringBinaryDataConvArray = new cint64[127]; for (cint64 i = 0; i < 127; ++i) { tmpHexStringBinaryDataConvArray[i] = -1; } for (cint64 i = '0'; i <= '9'; ++i) { tmpHexStringBinaryDataConvArray[i] = i - '0'; } for (cint64 i = 'A'; i <= 'F'; ++i) { tmpHexStringBinaryDataConvArray[i] = i - 'A' + 10; } for (cint64 i = 'a'; i <= 'f'; ++i) { tmpHexStringBinaryDataConvArray[i] = i - 'a' + 10; } mHexStringBinaryDataConvArray = tmpHexStringBinaryDataConvArray; cint64* tmpBase64StringBinaryDataConvArray = new cint64[127]; for (cint64 i = 0; i < 127; ++i) { tmpBase64StringBinaryDataConvArray[i] = -1; } for (cint64 i = 'A'; i <= 'Z'; ++i) { tmpBase64StringBinaryDataConvArray[i] = i - 'A'; } for (cint64 i = 'a'; i <= 'z'; ++i) { tmpBase64StringBinaryDataConvArray[i] = i - 'a' + 26; } for (cint64 i = '0'; i <= '9'; ++i) { tmpBase64StringBinaryDataConvArray[i] = i - '0' + 52; } tmpBase64StringBinaryDataConvArray['+'] = 62; tmpBase64StringBinaryDataConvArray['/'] = 63; tmpBase64StringBinaryDataConvArray['-'] = 62; tmpBase64StringBinaryDataConvArray['_'] = 63; mBase64StringBinaryDataConvArray = tmpBase64StringBinaryDataConvArray; mConvArraysInitialized = true; } } CDataLiteralNormalizerPreProcess::~CDataLiteralNormalizerPreProcess() { } CConcreteOntology *CDataLiteralNormalizerPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { if (ontology) { mTBox = ontology->getDataBoxes()->getTBox(); mABox = ontology->getDataBoxes()->getABox(); mRBox = ontology->getDataBoxes()->getRBox(); mMBox = ontology->getDataBoxes()->getMBox(); mRolesVector = mRBox->getRoleVector(); mConceptVector = mTBox->getConceptVector(); mIndiVec = mABox->getIndividualVector(); mOntology = ontology; mBoxContext = mOntology->getDataBoxes()->getBoxContext(); mMemMan = mBoxContext->getMemoryAllocationManager(); cint64 conceptCount = mConceptVector->getItemCount(); for (cint64 i = 0; i < conceptCount; ++i) { CConcept* concept = mConceptVector->getLocalData(i); if (concept) { CDataLiteral* dataLiteral = concept->getDataLiteral(); if (dataLiteral) { CDataLiteralValue* dataLiteralValue = dataLiteral->getDataLiteralValue(); if (!dataLiteralValue) { dataLiteralValue = createDataLiteralValue(dataLiteral,context); dataLiteral->setDataLiteralValue(dataLiteralValue); } } if (concept->getOperatorCode() == CCDATARESTRICTION) { if (normalizeDatatypeRestriction(concept,context)) { conceptCount = mConceptVector->getItemCount(); } } else if (concept->getOperatorCode() == CCDATALITERAL) { normalizeDataLiteral(concept,context); } } } } return ontology; } bool CDataLiteralNormalizerPreProcess::normalizeDataLiteral(CConcept* dataLiteralConcept, CPreProcessContext* context) { bool dataLiteralNormalized = false; CDatatype* datatype = dataLiteralConcept->getDatatype(); if (!datatype) { } return dataLiteralNormalized; } bool CDataLiteralNormalizerPreProcess::normalizeDatatypeRestriction(CConcept* datatypeRestrictionConcept, CPreProcessContext* context) { bool datatypeRestrictionNormalized = false; cint64 restrictionCode = datatypeRestrictionConcept->getParameter(); CDatatype* datatype = datatypeRestrictionConcept->getDatatype(); if (datatype && !datatype->isBasicDatatype()) { CDatatype* basicDatatype = datatype->getBasicDatatype(); CConcept* datatypeConcept = datatype->getDatatypeConcept(); if (datatypeConcept && basicDatatype) { CDataLiteral* dataLiteral = datatypeRestrictionConcept->getDataLiteral(); datatypeRestrictionConcept->setDatatype(nullptr); datatypeRestrictionConcept->setOperatorCode(CCAND); datatypeRestrictionConcept->setDataLiteral(nullptr); datatypeRestrictionConcept->setParameter(0); datatypeRestrictionConcept->setOperandCount(0); CConcept* newRestrictionConcept = createConcept(); newRestrictionConcept->setDataLiteral(dataLiteral); newRestrictionConcept->setOperatorCode(CCDATARESTRICTION); newRestrictionConcept->setParameter(restrictionCode); newRestrictionConcept->setDatatype(basicDatatype); addConceptOperand(datatypeRestrictionConcept,newRestrictionConcept,false); addConceptOperand(datatypeRestrictionConcept,datatypeConcept,false); datatypeRestrictionNormalized = true; } } else { if (restrictionCode == CDFC_LENGTH) { CConcept* datatypeConcept = datatype->getDatatypeConcept(); CDataLiteral* dataLiteral = datatypeRestrictionConcept->getDataLiteral(); datatypeRestrictionConcept->setDatatype(nullptr); datatypeRestrictionConcept->setOperatorCode(CCAND); datatypeRestrictionConcept->setDataLiteral(nullptr); datatypeRestrictionConcept->setParameter(0); datatypeRestrictionConcept->setOperandCount(0); CConcept* minLengthRestrictionConcept = createConcept(); minLengthRestrictionConcept->setDataLiteral(dataLiteral); minLengthRestrictionConcept->setOperatorCode(CCDATARESTRICTION); minLengthRestrictionConcept->setParameter(CDFC_MIN_LENGTH_INCLUSIVE); minLengthRestrictionConcept->setDatatype(datatype); addConceptOperand(datatypeRestrictionConcept,minLengthRestrictionConcept,false); CConcept* maxLengthRestrictionConcept = createConcept(); maxLengthRestrictionConcept->setDataLiteral(dataLiteral); maxLengthRestrictionConcept->setOperatorCode(CCDATARESTRICTION); maxLengthRestrictionConcept->setParameter(CDFC_MAX_LENGTH_INCLUSIVE); maxLengthRestrictionConcept->setDatatype(datatype); addConceptOperand(datatypeRestrictionConcept,maxLengthRestrictionConcept,false); datatypeRestrictionNormalized = true; } else if (restrictionCode == CDFC_MIN_LENGTH_INCLUSIVE) { CDataLiteral* dataLiteral = datatypeRestrictionConcept->getDataLiteral(); dataLiteral = getNormalizedDataLiteralForLengthRestriction(datatype,dataLiteral,true,context); datatypeRestrictionConcept->setParameter(CDFC_MIN_INCLUSIVE); datatypeRestrictionConcept->setDataLiteral(dataLiteral); datatypeRestrictionNormalized = true; } else if (restrictionCode == CDFC_MAX_LENGTH_INCLUSIVE) { CDataLiteral* dataLiteral = datatypeRestrictionConcept->getDataLiteral(); dataLiteral = getNormalizedDataLiteralForLengthRestriction(datatype,dataLiteral,false,context); datatypeRestrictionConcept->setParameter(CDFC_MAX_EXCLUSIVE); datatypeRestrictionConcept->setDataLiteral(dataLiteral); datatypeRestrictionNormalized = true; } } return datatypeRestrictionNormalized; } CDataLiteral* CDataLiteralNormalizerPreProcess::getNormalizedDataLiteralForLengthRestriction(CDatatype* datatype, CDataLiteral* dataLiteral, bool roundUp, CPreProcessContext* context) { CDataLiteral* adaptedDataLiteral = dataLiteral; if (dataLiteral->getDatatype() != datatype) { adaptedDataLiteral = nullptr; CDataLiteralValue* dataLiteralValue = dataLiteral->getDataLiteralValue(); if (!dataLiteralValue) { dataLiteralValue = createDataLiteralValue(dataLiteral,context); dataLiteral->setDataLiteralValue(dataLiteralValue); } bool lengthParsed = false; bool infinite = false; cint64 length = 0; CDataLiteralRealValue* realDataLiteralValue = dynamic_cast(dataLiteralValue); if (realDataLiteralValue && !realDataLiteralValue->isNegative()) { if (realDataLiteralValue->isInfinite()) { infinite = true; lengthParsed = true; } else { length = realDataLiteralValue->getInteger(); lengthParsed = true; if (roundUp && realDataLiteralValue->getNumerator() != 0) { ++length; } if (!roundUp) { ++length; } } } if (lengthParsed) { if (datatype->getBasicDatatypeType() == CDatatype::DBT_STRING) { CDataLiteralStringValue* dataLitStringValue = CObjectAllocator::allocateAndConstruct(mMemMan); if (infinite) { dataLitStringValue->initValueFromInfiniteLength(); } else { dataLitStringValue->initValueFromLength(length); } CDataLiteral* dataLitString = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitString->initDataLiteral("",datatype); dataLitString->setDataLiteralValue(dataLitStringValue); adaptedDataLiteral = dataLitString; } else if (datatype->getBasicDatatypeType() == CDatatype::DBT_IRI) { CDataLiteralIRIValue* dataLitIRIValue = CObjectAllocator::allocateAndConstruct(mMemMan); if (infinite) { dataLitIRIValue->initValueFromInfiniteLength(); } else { dataLitIRIValue->initValueFromLength(length); } CDataLiteral* dataLitIRI = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitIRI->initDataLiteral("",datatype); dataLitIRI->setDataLiteralValue(dataLitIRIValue); adaptedDataLiteral = dataLitIRI; } else if (datatype->getBasicDatatypeType() == CDatatype::DBT_HEXBINARY) { CDataLiteralBinaryHexDataValue* dataLitHexBinaryValue = CObjectParameterizingAllocator< CDataLiteralBinaryHexDataValue,CContext* >::allocateAndConstructAndParameterize(mMemMan,nullptr); if (infinite) { dataLitHexBinaryValue->initValueFromInfiniteLength(); } else { dataLitHexBinaryValue->initValueFromLength(length); } CDataLiteral* dataLitIRI = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitIRI->initDataLiteral("",datatype); dataLitIRI->setDataLiteralValue(dataLitHexBinaryValue); adaptedDataLiteral = dataLitIRI; } else if (datatype->getBasicDatatypeType() == CDatatype::DBT_BASE64BINARY) { CDataLiteralBinaryBase64DataValue* dataLitBase64BinaryValue = CObjectParameterizingAllocator< CDataLiteralBinaryBase64DataValue,CContext* >::allocateAndConstructAndParameterize(mMemMan,nullptr); if (infinite) { dataLitBase64BinaryValue->initValueFromInfiniteLength(); } else { dataLitBase64BinaryValue->initValueFromLength(length); } CDataLiteral* dataLitIRI = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitIRI->initDataLiteral("",datatype); dataLitIRI->setDataLiteralValue(dataLitBase64BinaryValue); adaptedDataLiteral = dataLitIRI; } } } return adaptedDataLiteral; } CConcept* CDataLiteralNormalizerPreProcess::createConcept() { CConcept* concept = CObjectAllocator::allocateAndConstruct(mMemMan); cint64 nextConTag = mConceptVector->getItemCount(); concept->initConcept(); concept->setTag(nextConTag); mConceptVector->setData(nextConTag,concept); return concept; } CConcept* CDataLiteralNormalizerPreProcess::addConceptOperand(CConcept* concept, CConcept* operand, bool negated) { CSortedNegLinker* opConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(mMemMan); opConLinker->init(operand,negated); concept->addOperandLinker(opConLinker); concept->incOperandCount(); return concept; } CDataLiteralValue* CDataLiteralNormalizerPreProcess::parseBooleanValue(const QString& valueString, CPreProcessContext* context) { CDataLiteralValue* dataLiteralValue = nullptr; bool parsingSuccessfull = false; bool booleanValue = false; if (valueString.toUpper().contains("TRUE")) { booleanValue = true; parsingSuccessfull = true; } else if (valueString.toUpper().contains("FALSE")) { booleanValue = false; parsingSuccessfull = true; } if (parsingSuccessfull) { CDataLiteralBooleanValue* dataLitBooleanValue = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitBooleanValue->initValueFromBoolean(booleanValue); dataLiteralValue = dataLitBooleanValue; } return dataLiteralValue; } CDataLiteralValue* CDataLiteralNormalizerPreProcess::parseDoubleValue(const QString& valueString, CPreProcessContext* context) { CDataLiteralValue* dataLiteralValue = nullptr; bool parsingSuccessfull = false; double doubleDataValue = valueString.toDouble(&parsingSuccessfull); if (parsingSuccessfull) { CDataLiteralDoubleValue* dataLitDoubleValue = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitDoubleValue->initValueFromDouble(doubleDataValue); dataLiteralValue = dataLitDoubleValue; } return dataLiteralValue; } CDataLiteralValue* CDataLiteralNormalizerPreProcess::parseFloatValue(const QString& valueString, CPreProcessContext* context) { CDataLiteralValue* dataLiteralValue = nullptr; bool parsingSuccessfull = false; float floatDataValue = valueString.toFloat(&parsingSuccessfull); if (parsingSuccessfull) { CDataLiteralFloatValue* dataLitFloatValue = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitFloatValue->initValueFromFloat(floatDataValue); dataLiteralValue = dataLitFloatValue; } return dataLiteralValue; } CDataLiteralValue* CDataLiteralNormalizerPreProcess::parseIntegerValue(const QString& valueString, CPreProcessContext* context) { CDataLiteralValue* dataLiteralValue = nullptr; bool parsingSuccessfull = false; QString tmpValueString(valueString); bool negative = tmpValueString.contains("-"); tmpValueString = tmpValueString.replace("-",""); cuint64 integerDataValue = tmpValueString.toULongLong(&parsingSuccessfull); if (parsingSuccessfull) { CDataLiteralRealValue* dataLitRatValue = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitRatValue->initRationalValueFromInteger(integerDataValue,negative); dataLiteralValue = dataLitRatValue; } else { if (tmpValueString.toUpper().contains("INF")) { CDataLiteralRealValue* dataLitRatValue = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitRatValue->initRationalValueFromInfinite(negative); dataLiteralValue = dataLitRatValue; } } return dataLiteralValue; } CDataLiteralValue* CDataLiteralNormalizerPreProcess::parseDecimalValue(const QString& valueString, CPreProcessContext* context) { CDataLiteralValue* dataLiteralValue = nullptr; bool parsingSuccessfull = false; cuint64 integerValue = 0; cuint64 decimalValue = 0; QString tmpValueString(valueString); bool negative = tmpValueString.contains("-"); tmpValueString = tmpValueString.replace("-",""); QStringList dataValueStringList = tmpValueString.split("."); if (dataValueStringList.size() < 2) { dataValueStringList = tmpValueString.split(","); } int precedingZerors = 0; if (dataValueStringList.size() >= 2) { bool integerParsingSuccessfull = false; bool decimalParsingSuccessfull = false; QString firstDataValueString = dataValueStringList.takeFirst().trimmed(); QString secondDataValueString = dataValueStringList.takeFirst().trimmed(); if (firstDataValueString.isEmpty()) { integerValue = 0; integerParsingSuccessfull = true; } else { integerValue = firstDataValueString.toULongLong(&integerParsingSuccessfull); } if (secondDataValueString.isEmpty()) { decimalValue = 0; decimalParsingSuccessfull = true; } else { decimalValue = secondDataValueString.toULongLong(&decimalParsingSuccessfull); if (secondDataValueString.startsWith("0") && secondDataValueString.size() > 1) { ++precedingZerors; while (secondDataValueString.size() > precedingZerors && secondDataValueString.at(precedingZerors) == '0') { ++precedingZerors; } } } parsingSuccessfull = integerParsingSuccessfull & decimalParsingSuccessfull; } if (parsingSuccessfull) { CDataLiteralRealValue* dataLitRatValue = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitRatValue->initRationalValueFromDecimal(integerValue,decimalValue,negative,precedingZerors); dataLiteralValue = dataLitRatValue; } if (!dataLiteralValue) { dataLiteralValue = parseIntegerValue(valueString,context); } return dataLiteralValue; } CDataLiteralValue* CDataLiteralNormalizerPreProcess::parseRationalValue(const QString& valueString, CPreProcessContext* context) { CDataLiteralValue* dataLiteralValue = nullptr; bool parsingSuccessfull = false; cuint64 numeratorValue = 0; cuint64 denominatorValue = 0; QString tmpValueString(valueString); bool negative = tmpValueString.contains("-"); tmpValueString = tmpValueString.replace("-",""); QStringList dataValueStringList = tmpValueString.split("/"); if (dataValueStringList.size() >= 2) { bool numeratorParsingSuccessfull = false; bool denominatorParsingSuccessfull = false; QString firstDataValueString = dataValueStringList.takeFirst().trimmed(); QString secondDataValueString = dataValueStringList.takeFirst().trimmed(); numeratorValue = firstDataValueString.toULongLong(&numeratorParsingSuccessfull); denominatorValue = secondDataValueString.toULongLong(&denominatorParsingSuccessfull); parsingSuccessfull = numeratorParsingSuccessfull & denominatorParsingSuccessfull; } if (parsingSuccessfull) { CDataLiteralRealValue* dataLitRatValue = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitRatValue->initRationalValueFromFraction(numeratorValue,denominatorValue,negative); dataLiteralValue = dataLitRatValue; } if (!dataLiteralValue) { dataLiteralValue = parseDecimalValue(valueString,context); } return dataLiteralValue; } CDataLiteralValue* CDataLiteralNormalizerPreProcess::parseRealValue(const QString& valueString, CPreProcessContext* context) { CDataLiteralValue* dataLiteralValue = nullptr; if (!dataLiteralValue) { dataLiteralValue = parseRationalValue(valueString,context); } return dataLiteralValue; } CDataLiteralValue* CDataLiteralNormalizerPreProcess::parseStringValue(const QString& valueString, bool parseLanguageString, CPreProcessContext* context) { CDataLiteralValue* dataLiteralValue = nullptr; if (!dataLiteralValue) { QString stringValueString = valueString; QString languageValueString; if (parseLanguageString) { cint64 lastLanguageSep = valueString.lastIndexOf("@"); if (lastLanguageSep > -1) { stringValueString = valueString.mid(0,lastLanguageSep); languageValueString = valueString.mid(lastLanguageSep+1); } } languageValueString = languageValueString.toLower(); CDataLiteralStringValue* dataLitStringValue = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitStringValue->initValueFromString(stringValueString,languageValueString); dataLiteralValue = dataLitStringValue; } return dataLiteralValue; } CDataLiteralValue* CDataLiteralNormalizerPreProcess::parseDateTimeValue(const QString& valueString, CPreProcessContext* context) { CDataLiteralValue* dataLiteralValue = nullptr; if (!dataLiteralValue) { QString dateTimeValueString = valueString; QString timeZoneOffsetValueString; if (valueString.contains("-") || valueString.contains("+")) { cint64 lastZoneMinusSep = valueString.lastIndexOf("-"); cint64 lastZonePlusSep = valueString.lastIndexOf("+"); cint64 lastZoneSep = qMax(lastZonePlusSep,lastZoneMinusSep); if (lastZoneSep >= 12) { dateTimeValueString = valueString.mid(0,lastZoneSep); timeZoneOffsetValueString = valueString.mid(lastZoneSep+1); } } QDateTime dateTime = QDateTime::fromString(dateTimeValueString,Qt::ISODate); if (dateTime.isValid()) { QDate tmpDate(dateTime.date()); QTime tmpTime(dateTime.time()); QDateTime tmpDateTime(tmpDate,tmpTime,Qt::UTC); if (dateTime.timeSpec() == Qt::LocalTime) { dateTime = tmpDateTime; } cuint64 timeZoneOffset = 0; if (dateTime.timeSpec() == Qt::OffsetFromUTC) { QDateTime utcDateTime = dateTime.toUTC(); timeZoneOffset = utcDateTime.secsTo(tmpDateTime); dateTime = utcDateTime; } CDataLiteralDateTimeValue* dataLitDateTimeValue = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitDateTimeValue->initValueFromDataTime(dateTime,timeZoneOffset); dataLiteralValue = dataLitDateTimeValue; } } return dataLiteralValue; } CDataLiteralValue* CDataLiteralNormalizerPreProcess::parseIRIValue(const QString& valueString, CPreProcessContext* context) { CDataLiteralValue* dataLiteralValue = nullptr; if (!dataLiteralValue) { CDataLiteralIRIValue* dataLitIRIValue = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitIRIValue->initValueFromIRIString(valueString.trimmed()); dataLiteralValue = dataLitIRIValue; } return dataLiteralValue; } CDataLiteralValue* CDataLiteralNormalizerPreProcess::parseXMLValue(const QString& valueString, CPreProcessContext* context) { CDataLiteralValue* dataLiteralValue = nullptr; if (!dataLiteralValue) { QDomDocument domDocument; if (domDocument.setContent(valueString,true)) { QString xmlValueString = domDocument.toString(); if (!xmlValueString.isEmpty()) { CDataLiteralXMLValue* dataLitXMLValue = CObjectAllocator::allocateAndConstruct(mMemMan); dataLitXMLValue->initValueFromXMLString(valueString.trimmed()); dataLiteralValue = dataLitXMLValue; } } } return dataLiteralValue; } cint64 CDataLiteralNormalizerPreProcess::getBinaryFromHex(QChar character) { cint64 unicode = character.unicode(); if (unicode > 127) { return -1; } return mHexStringBinaryDataConvArray[unicode]; } cint64 CDataLiteralNormalizerPreProcess::getBinaryFromBase64(QChar character) { cint64 unicode = character.unicode(); if (unicode > 127) { return -1; } return mBase64StringBinaryDataConvArray[unicode]; } CDataLiteralValue* CDataLiteralNormalizerPreProcess::parseBinaryHexValue(const QString& valueString, CPreProcessContext* context) { CDataLiteralValue* dataLiteralValue = nullptr; if (!dataLiteralValue) { QString dataValueString(valueString); int dataValueStringLength = dataValueString.length(); unsigned char* tmpByteData = new unsigned char[dataValueStringLength/2+1]; cint64 byteDataLength = 0; cint64 byteParts[2]; cint64 currentBytePart = 0; for (int i = 0; i < dataValueStringLength; ++i) { QChar dataChar = dataValueString[i]; cint64 dataBytePart = getBinaryFromHex(dataChar); if (dataBytePart != -1) { byteParts[currentBytePart++] = dataBytePart; if (currentBytePart >= 2) { currentBytePart = 0; cint64 nextDataByte = byteParts[0]<<4 + byteParts[1]; tmpByteData[byteDataLength++] = (unsigned char)nextDataByte; } } } if (currentBytePart == 1) { cint64 nextDataByte = byteParts[0]<<4; tmpByteData[byteDataLength++] = (unsigned char)nextDataByte; } CDataLiteralBinaryHexDataValue* dataLitHexBinaryValue = CObjectParameterizingAllocator< CDataLiteralBinaryHexDataValue,CContext* >::allocateAndConstructAndParameterize(mMemMan,mBoxContext); dataLitHexBinaryValue->initValueFromData(tmpByteData,byteDataLength); delete [] tmpByteData; dataLiteralValue = dataLitHexBinaryValue; } return dataLiteralValue; } CDataLiteralValue* CDataLiteralNormalizerPreProcess::parseBinaryBase64Value(const QString& valueString, CPreProcessContext* context) { CDataLiteralValue* dataLiteralValue = nullptr; if (!dataLiteralValue) { QString dataValueString(valueString); int dataValueStringLength = dataValueString.length(); unsigned char* tmpByteData = new unsigned char[dataValueStringLength*3/4+1]; cint64 byteDataLength = 0; cint64 byteParts[4]; cint64 currentBytePart = 0; for (int i = 0; i < dataValueStringLength; ++i) { QChar dataChar = dataValueString[i]; cint64 dataBytePart = getBinaryFromBase64(dataChar); if (dataBytePart != -1) { byteParts[currentBytePart++] = dataBytePart; if (currentBytePart >= 4) { currentBytePart = 0; cint64 nextDataByte1 = byteParts[0]<<2 + byteParts[1]>>4; tmpByteData[byteDataLength++] = (unsigned char)nextDataByte1; cint64 nextDataByte2 = byteParts[1]<<4 + byteParts[2]>>2; tmpByteData[byteDataLength++] = (unsigned char)nextDataByte2; cint64 nextDataByte3 = byteParts[2]<<6 + byteParts[3]; tmpByteData[byteDataLength++] = (unsigned char)nextDataByte3; } } } if (currentBytePart == 3) { cint64 nextDataByte1 = byteParts[0]<<2 + byteParts[1]>>4; tmpByteData[byteDataLength++] = (unsigned char)nextDataByte1; cint64 nextDataByte2 = byteParts[1]<<4 + byteParts[2]>>2; tmpByteData[byteDataLength++] = (unsigned char)nextDataByte2; cint64 nextDataByte3 = byteParts[2]<<6; tmpByteData[byteDataLength++] = (unsigned char)nextDataByte3; } if (currentBytePart == 2) { cint64 nextDataByte1 = byteParts[0]<<2 + byteParts[1]>>4; tmpByteData[byteDataLength++] = (unsigned char)nextDataByte1; cint64 nextDataByte2 = byteParts[1]<<4; tmpByteData[byteDataLength++] = (unsigned char)nextDataByte2; } if (currentBytePart == 1) { cint64 nextDataByte1 = byteParts[0]<<2; tmpByteData[byteDataLength++] = (unsigned char)nextDataByte1; } CDataLiteralBinaryBase64DataValue* dataLitBase64BinaryValue = CObjectParameterizingAllocator< CDataLiteralBinaryBase64DataValue,CContext* >::allocateAndConstructAndParameterize(mMemMan,mBoxContext); dataLitBase64BinaryValue->initValueFromData(tmpByteData,byteDataLength); delete [] tmpByteData; dataLiteralValue = dataLitBase64BinaryValue; } return dataLiteralValue; } CDataLiteralValue* CDataLiteralNormalizerPreProcess::createDataLiteralValue(CDataLiteral* dataLiteral, CPreProcessContext* context) { CDataLiteralValue* dataLiteralValue = nullptr; CDatatype* datatype = dataLiteral->getDatatype(); if (datatype) { QString dataLexicalValueString = dataLiteral->getLexicalDataLiteralValueString(); QString datatypeIRI = datatype->getDatatypeIRI(); if (datatypeIRI == PREFIX_XML_INTEGER_DATATYPE) { dataLiteralValue = parseIntegerValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_DECIMAL_DATATYPE) { dataLiteralValue = parseDecimalValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_OWL_RATIONAL_DATATYPE) { dataLiteralValue = parseRationalValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_OWL_REAL_DATATYPE) { dataLiteralValue = parseRealValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_NONNEGATIVEINTEGER_DATATYPE) { dataLiteralValue = parseIntegerValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_POSITIVEINTEGER_DATATYPE) { dataLiteralValue = parseIntegerValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_NONPOSITIVEINTEGER_DATATYPE) { dataLiteralValue = parseIntegerValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_NEGATIVEINTEGER_DATATYPE) { dataLiteralValue = parseIntegerValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_LONG_DATATYPE) { dataLiteralValue = parseIntegerValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_INT_DATATYPE) { dataLiteralValue = parseIntegerValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_SHORT_DATATYPE) { dataLiteralValue = parseIntegerValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_BYTE_DATATYPE) { dataLiteralValue = parseIntegerValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_UNSIGNEDLONG_DATATYPE) { dataLiteralValue = parseIntegerValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_UNSIGNEDINT_DATATYPE) { dataLiteralValue = parseIntegerValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_UNSIGNEDSHORT_DATATYPE) { dataLiteralValue = parseIntegerValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_UNSIGNEDBYTE_DATATYPE) { dataLiteralValue = parseIntegerValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_PLAINLITERAL_DATATYPE) { dataLiteralValue = parseStringValue(dataLexicalValueString,true,context); } else if (datatypeIRI == PREFIX_XML_STRING_DATATYPE) { dataLiteralValue = parseStringValue(dataLexicalValueString,false,context); } else if (datatypeIRI == PREFIX_XML_NORMALIZEDSTRING_DATATYPE) { dataLiteralValue = parseStringValue(dataLexicalValueString,false,context); } else if (datatypeIRI == PREFIX_XML_TOKEN_DATATYPE) { dataLiteralValue = parseStringValue(dataLexicalValueString,false,context); } else if (datatypeIRI == PREFIX_XML_NAME_DATATYPE) { dataLiteralValue = parseStringValue(dataLexicalValueString,false,context); } else if (datatypeIRI == PREFIX_XML_NCNAME_DATATYPE) { dataLiteralValue = parseStringValue(dataLexicalValueString,false,context); } else if (datatypeIRI == PREFIX_XML_NMTOKEN_DATATYPE) { dataLiteralValue = parseStringValue(dataLexicalValueString,false,context); } else if (datatypeIRI == PREFIX_XML_LANGUAGE_DATATYPE) { dataLiteralValue = parseStringValue(dataLexicalValueString,false,context); } else if (datatypeIRI == PREFIX_XML_BOOLEAN_DATATYPE) { dataLiteralValue = parseBooleanValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_DOUBLE_DATATYPE) { dataLiteralValue = parseDoubleValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_FLOAT_DATATYPE) { dataLiteralValue = parseFloatValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_IRI_DATATYPE) { dataLiteralValue = parseIRIValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_XML_DATATYPE) { dataLiteralValue = parseXMLValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_BINARYHEX_DATATYPE) { dataLiteralValue = parseBinaryHexValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_BINARYBASE64_DATATYPE) { dataLiteralValue = parseBinaryBase64Value(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_DATETIME_DATATYPE) { dataLiteralValue = parseDateTimeValue(dataLexicalValueString,context); } else if (datatypeIRI == PREFIX_XML_DATETIMESTAMP_DATATYPE) { dataLiteralValue = parseDateTimeValue(dataLexicalValueString,context); } else { LOG(WARNING,"::Konclude::Reasoner::Preprocess::DataLiteralNormaliser",logTr("Unknown or not supported datatype '%1', cannot parse '%2'.").arg(datatypeIRI).arg(dataLexicalValueString),this); } if (!dataLiteralValue) { LOG(WARNING,"::Konclude::Reasoner::Preprocess::DataLiteralNormaliser",logTr("Failed to parse literal '%1' for datatype '%2'.").arg(dataLexicalValueString).arg(datatypeIRI),this); } } return dataLiteralValue; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CNominalSchemaAbsorptionPathLinker.cpp0000644000175000017500000000566712520551224031551 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNominalSchemaAbsorptionPathLinker.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CNominalSchemaAbsorptionPathLinker::CNominalSchemaAbsorptionPathLinker() : CLinkerBase(this) { } CNominalSchemaAbsorptionPathLinker* CNominalSchemaAbsorptionPathLinker::initNominalSchemaAbsorptionPathLinker(CNominalSchemaAbsorptionPathLinker* nomSchAbsorpPathLinker) { if (nomSchAbsorpPathLinker) { mNomSchBindConceptHash = nomSchAbsorpPathLinker->mNomSchBindConceptHash; mAncestorList = nomSchAbsorpPathLinker->mAncestorList; mVariableList = nomSchAbsorpPathLinker->mVariableList; mLastPathConcept = nomSchAbsorpPathLinker->mLastPathConcept; } else { mLastPathConcept = nullptr; mNomSchBindConceptHash.clear(); mAncestorList.clear(); mVariableList.clear(); } return this; } QHash* CNominalSchemaAbsorptionPathLinker::getNominalSchemaBindedConceptTriggerHash() { return &mNomSchBindConceptHash; } QList* CNominalSchemaAbsorptionPathLinker::getAncestorConceptTriggerList() { return &mAncestorList; } QList* CNominalSchemaAbsorptionPathLinker::getVariableList() { return &mVariableList; } bool CNominalSchemaAbsorptionPathLinker::hasVariables() { return !mVariableList.isEmpty(); } CNominalSchemaAbsorptionPathLinker* CNominalSchemaAbsorptionPathLinker::addVariable(CVariable* variable) { mVariableList.append(variable); return this; } CVariable* CNominalSchemaAbsorptionPathLinker::getLastVariable() { if (hasVariables()) { return mVariableList.last(); } else { return nullptr; } } CConcept* CNominalSchemaAbsorptionPathLinker::getLastPathTriggerConcept() { return mLastPathConcept; } CNominalSchemaAbsorptionPathLinker* CNominalSchemaAbsorptionPathLinker::setLastPathTriggerConcept(CConcept* lastPathTriggerConcept) { mLastPathConcept = lastPathTriggerConcept; return this; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CDisjunctSortingPreProcess.cpp0000644000175000017500000001544512520551222030140 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDisjunctSortingPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CDisjunctSortingPreProcess::CDisjunctSortingPreProcess() { } CDisjunctSortingPreProcess::~CDisjunctSortingPreProcess() { } CConcreteOntology *CDisjunctSortingPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { bool skipForELOntologies = CConfigDataReader::readConfigBoolean(context->getConfiguration(),"Konclude.Calculation.Preprocessing.DisjunctSorting.SkipForELFragment",true); bool nonELConstructsUsed = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags()->isNonELConstructUsed(); if (nonELConstructsUsed || !skipForELOntologies) { mTBox = ontology->getDataBoxes()->getTBox(); mConceptVec = mTBox->getConceptVector(); mMemMan = ontology->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); mOnto = ontology; mSortedDisjunctCount = 0; mPotentialDisjunctionCount = 0; cint64 conCount = mTBox->getConceptCount(); for (cint64 conIdx = 0; conIdx < conCount; ++conIdx) { CConcept* concept = mConceptVec->getLocalData(conIdx); if (concept) { cint64 conOpCode = concept->getOperatorCode(); cint64 opCount = concept->getOperandCount(); if (opCount != 1) { bool sortOperands = false; bool disjunctionNegation = false; if (conOpCode == CCAND || conOpCode == CCEQ) { sortOperands = true; disjunctionNegation = true; } else if (conOpCode == CCOR) { sortOperands = true; } if (sortOperands) { ++mPotentialDisjunctionCount; sortDisjuncts(concept,disjunctionNegation); } } } } LOG(INFO,"::Konclude::Reasoner::Preprocess::DisjunctSorting",logTr("Sorted %1 disjuncts for %2 possible disjunctions.").arg(mSortedDisjunctCount).arg(mPotentialDisjunctionCount),this); } return ontology; } void CDisjunctSortingPreProcess::addDisjunctToSort(CSortedNegLinker* conLinker, bool negated) { CConcept* concept = conLinker->getData(); bool conNegation = conLinker->isNegated() ^ negated; cint64 conCode = concept->getOperatorCode(); CConceptOperator* conceptOperator = concept->getConceptOperator(); if (conCode == CCATOM) { mAtomicDisjList.append(conLinker); } else if (conNegation && conCode == CCSUB) { mPrimNegDisjList.append(conLinker); } else if (!conNegation && (conCode == CCSELF || conCode == CCVALUE)) { mSimpleExistDisjList.append(conLinker); } else if (!conNegation && (conCode == CCSOME || conCode == CCAQSOME || conCode == CCAQCHOOCE || conCode == CCATLEAST) || conNegation && (conCode == CCALL || conCode == CCATMOST)) { mExistDisjList.append(conLinker); } else if (!conNegation && conCode == CCNOMINAL) { mPosNominalDisjList.append(conLinker); } else if (conNegation && conCode == CCNOMINAL) { mNegNominalDisjList.append(conLinker); } else { if (!conNegation && conceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_ALL_AQALL_TYPE) || conNegation && conceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_SOME_TYPE)) { mPropDisjList.append(conLinker); } else if (!conNegation && conceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_TRIG_AND_AQAND_TYPE)) { mTriggerDisjList.append(conLinker); } else if (!conNegation && conceptOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCFS_IMPL_TYPE)) { mImplDisjList.append(conLinker); } else { mOtherDisjList.append(conLinker); } } } void CDisjunctSortingPreProcess::sortDisjuncts(CConcept* concept, bool negated) { CSortedNegLinker* opConcepts = concept->getOperandList(); mAtomicDisjList.clear(); mExistDisjList.clear(); mNegNominalDisjList.clear(); mPosNominalDisjList.clear(); mPrimNegDisjList.clear(); mSimpleExistDisjList.clear(); mPropDisjList.clear(); mTriggerDisjList.clear(); mImplDisjList.clear(); mOtherDisjList.clear(); for (CSortedNegLinker* opConceptIt = concept->getOperandList(); opConceptIt; opConceptIt = opConceptIt->getNext()) { CSortedNegLinker* opConcept = opConceptIt; addDisjunctToSort(opConcept,negated); ++mSortedDisjunctCount; } CSortedNegLinker* newOperandLinker = nullptr; CSortedNegLinker* lastNewOperandLinker = nullptr; addDisjunctFromList(mAtomicDisjList,newOperandLinker,lastNewOperandLinker); addDisjunctFromList(mPrimNegDisjList,newOperandLinker,lastNewOperandLinker); addDisjunctFromList(mSimpleExistDisjList,newOperandLinker,lastNewOperandLinker); addDisjunctFromList(mNegNominalDisjList,newOperandLinker,lastNewOperandLinker); addDisjunctFromList(mImplDisjList,newOperandLinker,lastNewOperandLinker); addDisjunctFromList(mTriggerDisjList,newOperandLinker,lastNewOperandLinker); addDisjunctFromList(mPropDisjList,newOperandLinker,lastNewOperandLinker); addDisjunctFromList(mOtherDisjList,newOperandLinker,lastNewOperandLinker); addDisjunctFromList(mExistDisjList,newOperandLinker,lastNewOperandLinker); addDisjunctFromList(mPosNominalDisjList,newOperandLinker,lastNewOperandLinker); concept->setOperandList(newOperandLinker); } void CDisjunctSortingPreProcess::addDisjunctFromList(QList< CSortedNegLinker* >& disjunctList, CSortedNegLinker*& newOperandLinker, CSortedNegLinker*& lastNewOperandLinker) { for (QList< CSortedNegLinker* >::const_iterator it = disjunctList.constBegin(), itEnd = disjunctList.constEnd(); it != itEnd; ++it) { CSortedNegLinker* opConLinker(*it); opConLinker->setNext(nullptr); if (!newOperandLinker) { newOperandLinker = opConLinker; } else { lastNewOperandLinker->setNext(opConLinker); } lastNewOperandLinker = opConLinker; } } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CPreprocessor.cpp0000644000175000017500000000202412520551226025460 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreprocessor.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CPreprocessor::CPreprocessor() { } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Preprocess/CDataExtenderPreProcess.cpp0000644000175000017500000001035512520551220027350 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataExtenderPreProcess.h" namespace Konclude { namespace Reasoner { namespace Preprocess { CDataExtenderPreProcess::CDataExtenderPreProcess() { } CDataExtenderPreProcess::~CDataExtenderPreProcess() { } CConcreteOntology *CDataExtenderPreProcess::preprocess(CConcreteOntology *ontology, CPreProcessContext* context) { bool skipForELOntologies = CConfigDataReader::readConfigBoolean(context->getConfiguration(),"Konclude.Calculation.Preprocessing.ProcessingDataExtender.SkipForELFragment",true); bool nonELConstructsUsed = ontology->getDataBoxes()->getExpressionDataBoxMapping()->getBuildConstructFlags()->isNonELConstructUsed(); CMBox *mBox = ontology->getDataBoxes()->getMBox(); CTBox *tBox = ontology->getDataBoxes()->getTBox(); CRBox *rBox = ontology->getDataBoxes()->getRBox(); CABox *aBox = ontology->getDataBoxes()->getABox(); CConceptVector* conceptVector = tBox->getConceptVector(); CRoleVector* roleVector = rBox->getRoleVector(); CIndividualVector* indiVector = aBox->getIndividualVector(); CBranchingTriggerVector* branchTriggVec = mBox->getBranchingTriggerVector(); CImplicationReplacementVector* impRepVec = mBox->getImplicationReplacementVector(); CRoleVector *roles = rBox->getRoleVector(); CConcept *topConcept = conceptVector->getLocalData(1); mMemMan = ontology->getDataBoxes()->getBoxContext()->getMemoryAllocationManager(); mStatConceptDataExtended = 0; mStatRoleDataExtended = 0; mStatIndiDataExtended = 0; cint64 roleCount = rBox->getRoleCount(); for (cint64 roleIdx = 0; roleIdx < roleCount; ++roleIdx) { CRole* role = roleVector->getLocalData(roleIdx); if (role) { if (!role->hasRoleData()) { CRoleProcessData* roleData = CObjectAllocator< CRoleProcessData >::allocateAndConstruct(mMemMan); roleData->initRoleProcessExtensionData(); role->setRoleData(roleData); ++mStatRoleDataExtended; } } } cint64 indiCount = aBox->getIndividualCount(); for (cint64 indiIdx = 0; indiIdx < indiCount; ++indiIdx) { CIndividual* indi = indiVector->getLocalData(indiIdx); if (indi) { if (!indi->hasIndividualData()) { CIndividualProcessData* indiData = CObjectAllocator< CIndividualProcessData >::allocateAndConstruct(mMemMan); indiData->initIndividualProcessExtensionData(); indi->setIndividualData(indiData); ++mStatIndiDataExtended; } } } cint64 conCount = tBox->getConceptCount(); for (cint64 conIdx = 0; conIdx < conCount; ++conIdx) { CConcept* concept = conceptVector->getLocalData(conIdx); if (concept) { if (!concept->hasConceptData()) { CConceptProcessData* conceptData = CObjectAllocator< CConceptProcessData >::allocateAndConstruct(mMemMan); if (nonELConstructsUsed || !skipForELOntologies) { conceptData->initConceptProcessExtensionData(branchTriggVec->getData(conIdx),impRepVec->getData(conIdx)); } else { conceptData->initConceptProcessExtensionData(nullptr,nullptr); } concept->setConceptData(conceptData); ++mStatConceptDataExtended; } } } LOG(INFO,"::Konclude::Reasoner::Preprocess::ProcessDataExtender",logTr("Extended %1 concepts and %2 roles for processing.").arg(mStatConceptDataExtended).arg(mStatRoleDataExtended),this); return ontology; } }; // end namespace Preprocess }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/0000755000175000017500000000000012613407260021616 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesHashData.cpp0000644000175000017500000000216612520551256031377 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetRoleInstancesHashData.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetRoleInstancesHashData::COptimizedKPSetRoleInstancesHashData() { mInstanceItemData = nullptr; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizingContext.cpp0000644000175000017500000000314012520551260025711 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizingContext.h" namespace Konclude { namespace Reasoner { namespace Realizer { CRealizingContext::CRealizingContext() { mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); mMemMan = new CLimitedReserveMemoryPoolAllocationManager(mMemoryPoolProvider); } CRealizingContext::~CRealizingContext() { delete mMemMan; delete mMemoryPoolProvider; } CMemoryPoolAllocationManager* CRealizingContext::getMemoryPoolAllocationManager() { return mMemMan; } CMemoryAllocationManager* CRealizingContext::getMemoryAllocationManager() { return mMemMan; } CMemoryPoolProvider* CRealizingContext::getMemoryPoolProvider() { return mMemoryPoolProvider; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizationMessageData.h0000644000175000017500000000413612520551260026453 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CREALIZATIONMESSAGEDATA_H #define KONCLUDE_REASONER_REALIZER_CREALIZATIONMESSAGEDATA_H // Libraries includes // Namespace includes #include "RealizerSettings.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Realizer { /*! * * \class CRealizationMessageData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealizationMessageData : public CLinkerBase { // public methods public: //! Constructor CRealizationMessageData(); enum REALIZATIONMESSAGEDATA { TELLREALIZATIONMARKERCANDIDATES }; REALIZATIONMESSAGEDATA getRealizationMessageDataType(); // protected methods protected: // protected variables protected: REALIZATIONMESSAGEDATA mMessageDataType; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CREALIZATIONMESSAGEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizerThread.cpp0000644000175000017500000002116512520551260025334 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizerThread.h" namespace Konclude { namespace Reasoner { namespace Realizer { CRealizerThread::CRealizerThread(CReasonerManager *reasonerManager) : CThread("Realizer-Thread") { mReasoner = reasonerManager; mCalculationManager = 0; mCurrRunningTestParallelCount = 0; mConfMaxTestParallelCount = 1; mStatCalculatingJobs = 0; startThread(QThread::HighPriority); } CRealizerThread::~CRealizerThread() { stopThread(); } bool CRealizerThread::realize(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList, CCallbackData* callback) { postEvent(new CRealizeOntologyEvent(ontology,config,requirementList,callback)); return true; } bool CRealizerThread::realize(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList) { CBlockingCallbackData callback; postEvent(new CRealizeOntologyEvent(ontology,config,requirementList,&callback)); callback.waitForCallback(); return true; } bool CRealizerThread::callbackRealized(CConcreteOntology* ontology, CCallbackData* callback) { bool callbackRealizedOnto = false; CRealization* realization = ontology->getRealization(); if (realization && realization->isRealized()) { callbackRealizedOnto = true; if (callback) { callback->doCallback(); } } else { CBlockingCallbackData callbackBlock; postEvent(new CCallbackRealizedOntologyEvent(ontology,&callbackBlock,callback)); callbackBlock.waitForCallback(); CCallbackDataContext* callbackContext = callbackBlock.getCallbackDataContext(); if (callbackContext) { CRealizingCallbackDataContext* possCallbackContext = dynamic_cast(callbackContext); callbackRealizedOnto = possCallbackContext->isRealized(); } } return callbackRealizedOnto; } bool CRealizerThread::canProcessMoreTests() { return mCurrRunningTestParallelCount < mConfMaxTestParallelCount; } bool CRealizerThread::doNextPendingTests() { bool createdNewTests = false; bool nextTestCreated = true; while (canProcessMoreTests() && nextTestCreated) { nextTestCreated = false; bool workCreated = createNextTest(); if (workCreated) { nextTestCreated = true; createdNewTests = true; } else { nextTestCreated = false; } } return createdNewTests; } CRealizerThread* CRealizerThread::processCalculationJob(CSatisfiableCalculationJob* job, COntologyRealizingItem* preCompItem, CRealizingTestingItem* preTestItem) { CRealizingCalculatedCallbackEvent* callbackEvent = new CRealizingCalculatedCallbackEvent(this,job,preTestItem); preCompItem->getRealizingTestingItemSet()->insert(preTestItem); mCurrRunningTestParallelCount++; ++mStatCalculatingJobs; if (!mCalculationManager) { mCalculationManager = mReasoner->getCalculationManager(); } if (mCalculationManager) { mCalculationManager->calculateJob(job,callbackEvent); } else { mReasoner->reasoningSatisfiableCalcualtionJob(job,callbackEvent); } return this; } COntologyRealizingItem* CRealizerThread::initializeOntologyRealizingItem(CConcreteOntology* ontology, CConfigurationBase* config) { COntologyRealizingItem* item = new COntologyRealizingItem(); item->initRealizingItem(ontology,config); return item; } bool CRealizerThread::addOntologyRealizingCallback(COntologyRealizingItem* item, CCallbackData* callback) { item->addRealizingFinishedCallback(callback); return true; } bool CRealizerThread::addOntologyRealizingRequirements(COntologyRealizingItem* item, COntologyProcessingRequirement* requirement) { item->addProcessingRequirement(requirement); return true; } CRealizationMessageObserver* CRealizerThread::tellRealizationMessage(CConcreteOntology *ontology, CRealizationMessageData* messageData, CMemoryPool* memoryPool) { postEvent(new CRealizationMessageEvent(ontology,messageData,memoryPool)); return this; } bool CRealizerThread::processCustomsEvents(QEvent::Type type, CCustomEvent* event) { if (CThread::processCustomsEvents(type,event)) { return true; } else if (type == CRealizationMessageEvent::EVENTTYPE) { CRealizationMessageEvent* otcme = (CRealizationMessageEvent *)event; CConcreteOntology* ontology = otcme->getOntology(); COntologyRealizingItem* ontRealItem = mOntItemHash.value(ontology,0); if (ontRealItem) { CRealizationMessageData* messageData = otcme->getMessageData(); CMemoryPool* memoryPools = otcme->getMemoryPool(); processRealizationMessage(ontRealItem,messageData,memoryPools); mContext.getMemoryPoolAllocationManager()->releaseTemporaryMemoryPools(memoryPools); } doNextPendingTests(); return true; } else if (type == CRealizeOntologyEvent::EVENTTYPE) { CRealizeOntologyEvent* poe = (CRealizeOntologyEvent*)event; CCallbackData* callbackData = poe->getCallbackData(); CConfigurationBase* configBase = poe->getConfiguration(); CConcreteOntology* ontology = poe->getOntology(); QList* requirementList = poe->getRealizingRequirementList(); COntologyRealizingItem* item = mOntItemHash.value(ontology); if (!item) { item = initializeOntologyRealizingItem(ontology,configBase); mOntItemHash.insert(ontology,item); mActiveOntItemSet.insert(item); mProcessingOntItemList.append(item); } else { if (!mActiveOntItemSet.contains(item)) { mInactiveOntItemSet.remove(item); mActiveOntItemSet.insert(item); mProcessingOntItemList.append(item); } } for (QList::const_iterator it = requirementList->constBegin(), itEnd = requirementList->constEnd(); it != itEnd; ++it) { COntologyProcessingRequirement* requ(*it); addOntologyRealizingRequirements(item,requ); } if (callbackData) { addOntologyRealizingCallback(item,callbackData); } doNextPendingTests(); return true; } else if (type == CCallbackRealizedOntologyEvent::EVENTTYPE) { CCallbackRealizedOntologyEvent* cpoe = (CCallbackRealizedOntologyEvent*)event; CConcreteOntology* ontology = cpoe->getOntology(); CCallbackData* realizeedCallbackData = cpoe->getRealizedCallbackData(); CCallbackData* installedCallbackData = cpoe->getCallbackPossibleCallbackData(); COntologyRealizingItem* item = mOntItemHash.value(ontology); if (item) { addOntologyRealizingCallback(item,realizeedCallbackData); if (installedCallbackData) { CRealizingCallbackDataContext* callbackDataContext = new CRealizingCallbackDataContext(true,ontology); installedCallbackData->setCallbackDataContext(callbackDataContext); installedCallbackData->doCallback(); } } else { if (installedCallbackData) { CRealizingCallbackDataContext* callbackDataContext = new CRealizingCallbackDataContext(false,ontology); installedCallbackData->setCallbackDataContext(callbackDataContext); installedCallbackData->doCallback(); } } return true; } else if (type == CRealizingCalculatedCallbackEvent::EVENTTYPE) { CRealizingCalculatedCallbackEvent* pcce = (CRealizingCalculatedCallbackEvent*)event; --mCurrRunningTestParallelCount; CRealizingTestingItem* testingItem = pcce->getTestingItem(); COntologyRealizingItem* ontPreproItem = testingItem->getOntologyRealizingItem(); ontPreproItem->getRealizingTestingItemSet()->remove(testingItem); realizingTested(ontPreproItem,testingItem,pcce); doNextPendingTests(); return true; } return false; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleNeighbourInstancesHashData.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleNeighbourInstancesHashDat0000644000175000017500000000514712520551256032322 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLENEIGHBOURINSTANCESHASHDATA_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLENEIGHBOURINSTANCESHASHDATA_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "COptimizedKPSetRoleInstancesHash.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realizer { /*! * * \class COptimizedKPSetRoleNeighbourInstancesHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetRoleNeighbourInstancesHashData { // public methods public: //! Constructor COptimizedKPSetRoleNeighbourInstancesHashData(); COptimizedKPSetRoleInstancesData* getRoleSuccessorInstanceItemData(COptimizedKPSetIndividualItem* item); COptimizedKPSetRoleInstancesData* getRolePredecessorInstanceItemData(COptimizedKPSetIndividualItem* item); COptimizedKPSetRoleInstancesHash* getRoleSuccessorInstancesHash(bool forceCreated = true); COptimizedKPSetRoleInstancesHash* getRolePredecessorInstancesHash(bool forceCreated = true); COptimizedKPSetRoleInstancesHash* mRoleSuccessorInstancesHash; COptimizedKPSetRoleInstancesHash* mRolePredecessorInstancesHash; bool mRoleSuccessorInstancesInitialized; bool mRolePredecessorInstancesInitialized; bool mRoleSuccessorInstancesInitializing; bool mRolePredecessorInstancesInitializing; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLENEIGHBOURINSTANCESHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizationMarkerCandidatesMessageData.cpp0000644000175000017500000000403512520551256032133 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizationMarkerCandidatesMessageData.h" namespace Konclude { namespace Reasoner { namespace Realizer { CRealizationMarkerCandidatesMessageData::CRealizationMarkerCandidatesMessageData() { mMessageDataType = TELLREALIZATIONMARKERCANDIDATES; } CRealizationMarkerCandidatesMessageData* CRealizationMarkerCandidatesMessageData::initRealizationMarkerCandidatesMessageData(CIndividual* individual, CConcept* markerConcept, CXLinker* detIndiLinker, CXLinker* ndetIndiLinker) { mIndiviual = individual; mConcept = markerConcept; mDetIndiLinker = detIndiLinker; mNdetIndiLinker = ndetIndiLinker; return this; } CConcept* CRealizationMarkerCandidatesMessageData::getMarkerConcept() { return mConcept; } CIndividual* CRealizationMarkerCandidatesMessageData::getIndividual() { return mIndiviual; } CXLinker* CRealizationMarkerCandidatesMessageData::getDeterministicIndividualLinker() { return mDetIndiLinker; } CXLinker* CRealizationMarkerCandidatesMessageData::getNondeterministicIndividualLinker() { return mNdetIndiLinker; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/Events/0000755000175000017500000000000012613407260023062 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/Events/CCallbackRealizedOntologyEvent.h0000644000175000017500000000500612520551250031244 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_EVENTS_CCALLBACKREALIZEDONTOLOGYEVENT_H #define KONCLUDE_REASONER_REALIZER_EVENTS_CCALLBACKREALIZEDONTOLOGYEVENT_H // Libraries includes // Namespace includes #include "../RealizerSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; namespace Realizer { namespace Events { /*! * \class CCallbackRealizedOntologyEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CCallbackRealizedOntologyEvent : public CCustomEvent { // public methods public: //! Constructor CCallbackRealizedOntologyEvent(CConcreteOntology* ontology, CCallbackData* callbackPossibleCallbackData, CCallbackData* RealizedCallbackData); CConcreteOntology* getOntology(); CCallbackData* getRealizedCallbackData(); CCallbackData* getCallbackPossibleCallbackData(); static const QEvent::Type EVENTTYPE = EVENTCALLBACKREALIZEDONTOLOGY; // protected methods protected: // protected variables protected: CConcreteOntology* onto; CCallbackData* realizedCallback; CCallbackData* possibleCallback; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_EVENTS_CCALLBACKREALIZEDONTOLOGYEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/Events/CRealizationMessageEvent.cpp0000644000175000017500000000315312520551250030457 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizationMessageEvent.h" namespace Konclude { namespace Reasoner { namespace Realizer { namespace Events { CRealizationMessageEvent::CRealizationMessageEvent(CConcreteOntology *ontology, CRealizationMessageData* messageData, CMemoryPool* memoryPool) : CCustomEvent(EVENTTYPE) { mOntology = ontology; mMessageData = messageData; mMemoryPool = memoryPool; } CConcreteOntology *CRealizationMessageEvent::getOntology() { return mOntology; } CRealizationMessageData* CRealizationMessageEvent::getMessageData() { return mMessageData; } CMemoryPool* CRealizationMessageEvent::getMemoryPool() { return mMemoryPool; } }; // end namespace Events }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/Events/CRealizingCalculatedCallbackEvent.cpp0000644000175000017500000000376712520551252032231 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizingCalculatedCallbackEvent.h" namespace Konclude { namespace Reasoner { namespace Realizer { namespace Events { CRealizingCalculatedCallbackEvent::CRealizingCalculatedCallbackEvent(CThread *receiverThread, CSatisfiableCalculationJob *satCalcJob, CRealizingTestingItem* testingItem) : CCustomEvent(EVENTTYPE),CJobSatisfiableCallbackContextData(satCalcJob) { mRecThread = receiverThread; mSatCalcJob = satCalcJob; mTestingItem = testingItem; setCallbackDataContext(this); } CRealizingCalculatedCallbackEvent::~CRealizingCalculatedCallbackEvent() { takeCallbackDataContext(); } void CRealizingCalculatedCallbackEvent::doCallback() { mRecThread->postEvent(this); } bool CRealizingCalculatedCallbackEvent::getTestResultSatisfiable() { return mSatisfiable; } CSatisfiableCalculationJob *CRealizingCalculatedCallbackEvent::getSatisfiableCalculationJob() { return mSatCalcJob; } CRealizingTestingItem* CRealizingCalculatedCallbackEvent::getTestingItem() { return mTestingItem; } }; // end namespace Events }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/Events/CRealizeOntologyEvent.cpp0000644000175000017500000000406212520551252030021 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizeOntologyEvent.h" namespace Konclude { namespace Reasoner { namespace Realizer { namespace Events { CRealizeOntologyEvent::CRealizeOntologyEvent(CConcreteOntology* ontology, CConfigurationBase* configuration, const QList& requirementList, CCallbackData* callbackData) : CCustomEvent(EVENTTYPE),mRequirementList(requirementList) { onto = ontology; callback = callbackData; config = configuration; } CRealizeOntologyEvent::CRealizeOntologyEvent(CConcreteOntology* ontology, CConfigurationBase* configuration, CCallbackData* callbackData) : CCustomEvent(EVENTTYPE) { onto = ontology; callback = callbackData; config = configuration; } CConcreteOntology* CRealizeOntologyEvent::getOntology() { return onto; } CCallbackData* CRealizeOntologyEvent::getCallbackData() { return callback; } CConfigurationBase* CRealizeOntologyEvent::getConfiguration() { return config; } QList* CRealizeOntologyEvent::getRealizingRequirementList() { return &mRequirementList; } }; // end namespace Events }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/Events/CCallbackRealizedOntologyEvent.cpp0000644000175000017500000000330512520551250031577 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCallbackRealizedOntologyEvent.h" namespace Konclude { namespace Reasoner { namespace Realizer { namespace Events { CCallbackRealizedOntologyEvent::CCallbackRealizedOntologyEvent(CConcreteOntology *ontology, CCallbackData *callbackPossibleCallbackData, CCallbackData *callbackData) : CCustomEvent(EVENTTYPE) { onto = ontology; realizedCallback = callbackData; possibleCallback = callbackPossibleCallbackData; } CConcreteOntology *CCallbackRealizedOntologyEvent::getOntology() { return onto; } CCallbackData *CCallbackRealizedOntologyEvent::getRealizedCallbackData() { return realizedCallback; } CCallbackData *CCallbackRealizedOntologyEvent::getCallbackPossibleCallbackData() { return possibleCallback; } }; // end namespace Events }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/Events/CRealizingCalculatedCallbackEvent.h0000644000175000017500000000562612520551252031672 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_EVENTS_CREALIZINGCALCULATEDCALLBACKEVENT_H #define KONCLUDE_REASONER_REALIZER_EVENTS_CREALIZINGCALCULATEDCALLBACKEVENT_H // Libraries includes // Namespace includes #include "../RealizerSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Concurrent/Callback/CCallbackData.h" #include "Reasoner/Query/CSatisfiableCalculationJob.h" #include "Reasoner/Query/CJobSatisfiableCallbackContextData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Reasoner { using namespace Query; using namespace Ontology; using namespace Kernel::Task; namespace Realizer { namespace Events { /*! * \class CRealizingCalculatedCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CRealizingCalculatedCallbackEvent : public CCustomEvent, public CJobSatisfiableCallbackContextData, public CCallbackData { // public methods public: //! Constructor CRealizingCalculatedCallbackEvent(CThread* receiverThread, CSatisfiableCalculationJob* satCalcJob, CRealizingTestingItem* testingItem); //! Destructor virtual ~CRealizingCalculatedCallbackEvent(); static const QEvent::Type EVENTTYPE = EVENTREALIZINGCALCULATEDCALLBACK; virtual void doCallback(); virtual bool getTestResultSatisfiable(); virtual CSatisfiableCalculationJob* getSatisfiableCalculationJob(); virtual CRealizingTestingItem* getTestingItem(); // protected methods protected: // protected variables protected: CThread* mRecThread; CSatisfiableCalculationJob* mSatCalcJob; CRealizingTestingItem* mTestingItem; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_EVENTS_CREALIZINGCALCULATEDCALLBACKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/Events/CRealizationMessageEvent.h0000644000175000017500000000473312520551252030133 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_EVENTS_CREALIZATIONMESSAGEEVENT_H #define KONCLUDE_REASONER_REALIZER_EVENTS_CREALIZATIONMESSAGEEVENT_H // Libraries includes // Namespace includes #include "../RealizerSettings.h" #include "../CRealizationMessageData.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Utilities/Memory/CMemoryPool.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Utilities::Memory; namespace Reasoner { using namespace Ontology; namespace Realizer { namespace Events { /*! * \class CRealizationMessageEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CRealizationMessageEvent : public CCustomEvent { // public methods public: //! Constructor CRealizationMessageEvent(CConcreteOntology *ontology, CRealizationMessageData* messageData, CMemoryPool* memoryPool); CConcreteOntology* getOntology(); CRealizationMessageData* getMessageData(); CMemoryPool* getMemoryPool(); static const QEvent::Type EVENTTYPE = EVENTREALIZATIONMESSAGE; // protected methods protected: // protected variables protected: CConcreteOntology* mOntology; CRealizationMessageData* mMessageData; CMemoryPool* mMemoryPool; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_EVENTS_CREALIZATIONMESSAGEEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/Events/CRealizeOntologyEvent.h0000644000175000017500000000554212520551252027472 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_EVENTS_CREALIZEONTOLOGYEVENT_H #define KONCLUDE_REASONER_REALIZER_EVENTS_CREALIZEONTOLOGYEVENT_H // Libraries includes // Namespace includes #include "../RealizerSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; using namespace Config; namespace Reasoner { using namespace Ontology; namespace Realizer { namespace Events { /*! * \class CRealizeOntologyEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CRealizeOntologyEvent : public CCustomEvent { // public methods public: //! Constructor CRealizeOntologyEvent(CConcreteOntology* ontology, CConfigurationBase* configuration, const QList& requirementList, CCallbackData* callbackData = 0); CRealizeOntologyEvent(CConcreteOntology* ontology, CConfigurationBase* configuration, CCallbackData* callbackData = 0); CConcreteOntology* getOntology(); CCallbackData* getCallbackData(); CConfigurationBase* getConfiguration(); QList* getRealizingRequirementList(); static const QEvent::Type EVENTTYPE = EVENTPREALIZEONTOLOGY; // protected methods protected: // protected variables protected: CConcreteOntology* onto; CConfigurationBase* config; CCallbackData* callback; QList mRequirementList; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_EVENTS_CREALIZEONTOLOGYEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleNeighbourInstancesHash.h0000644000175000017500000000442112520551256032111 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLENEIGHBOURINSTANCESHASH_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLENEIGHBOURINSTANCESHASH_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "COptimizedKPSetRoleNeighbourInstancesHashData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realizer { /*! * * \class COptimizedKPSetRoleNeighbourInstancesHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetRoleNeighbourInstancesHash : public QHash { // public methods public: //! Constructor COptimizedKPSetRoleNeighbourInstancesHash(); COptimizedKPSetRoleInstancesData* getRoleSuccessorInstanceItemData(COptimizedKPSetRoleInstancesItem* item, COptimizedKPSetIndividualItem* successorItem); COptimizedKPSetRoleInstancesData* getRolePredecessorInstanceItemData(COptimizedKPSetRoleInstancesItem* item, COptimizedKPSetIndividualItem* predecessorItem); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLENEIGHBOURINSTANCESHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/RealizerSettings.h0000644000175000017500000000412412520551260025263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_REALIZERSETTINGS #define KONCLUDE_REASONER_REALIZER_REALIZERSETTINGS // Libraries includes #include #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Reasoner { namespace Realizer { /*! * * \file RealizerSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CRealizingTestingItem; class COntologyRealizingItem; class COptimizedKPSetConceptInstancesItem; class COptimizedKPSetIndividualItem; class COptimizedKPSetConceptInstancesData; class COptimizedKPSetRoleInstancesData; class COptimizedKPSetRoleInstancesItem; typedef QPair TRoleItemInversionPair; // Custom Events >= 2000 const QEvent::Type EVENTPREALIZEONTOLOGY = (QEvent::Type)2000; const QEvent::Type EVENTCALLBACKREALIZEDONTOLOGY = (QEvent::Type)2001; const QEvent::Type EVENTREALIZINGCALCULATEDCALLBACK = (QEvent::Type)2002; const QEvent::Type EVENTREALIZATIONMESSAGE = (QEvent::Type)2003; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // end KONCLUDE_REASONER_REALIZER_REALIZERSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizationMarkerCandidatesMessageData.h0000644000175000017500000000475112520551260031600 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CREALIZATIONMARKERCANDIDATESMESSAGEDATA_H #define KONCLUDE_REASONER_REALIZER_CREALIZATIONMARKERCANDIDATESMESSAGEDATA_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "CRealizationMessageData.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Realizer { /*! * * \class CRealizationMarkerCandidatesMessageData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealizationMarkerCandidatesMessageData : public CRealizationMessageData { // public methods public: //! Constructor CRealizationMarkerCandidatesMessageData(); CRealizationMarkerCandidatesMessageData* initRealizationMarkerCandidatesMessageData(CIndividual* individual, CConcept* markerConcept, CXLinker* detIndiLinker, CXLinker* ndetIndiLinker); CIndividual* getIndividual(); CConcept* getMarkerConcept(); CXLinker* getDeterministicIndividualLinker(); CXLinker* getNondeterministicIndividualLinker(); // protected methods protected: // protected variables protected: CIndividual* mIndiviual; CConcept* mConcept; CXLinker* mDetIndiLinker; CXLinker* mNdetIndiLinker; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CREALIZATIONMARKERCANDIDATESMESSAGEDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizer.h0000644000175000017500000000465412520551260023655 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CREALIZER_H #define KONCLUDE_REASONER_REALIZER_CREALIZER_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "CRealizationProgress.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Concurrent/Callback/CCallbackData.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; using namespace Config; namespace Reasoner { using namespace Ontology; namespace Realizer { /*! * * \class CRealizer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealizer { // public methods public: //! Constructor CRealizer(); virtual bool realize(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList, CCallbackData* callback) = 0; virtual bool realize(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList) = 0; virtual bool callbackRealized(CConcreteOntology* ontology, CCallbackData* callback) = 0; virtual CRealizationProgress* getRealizationProgress() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CREALIZER_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetOntologyConceptRealizingThread.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetOntologyConceptRealizingThrea0000644000175000017500000036630312574274526032447 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetOntologyConceptRealizingThread.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetOntologyConceptRealizingThread::COptimizedKPSetOntologyConceptRealizingThread(CReasonerManager *reasonerManager) : CRealizerThread(reasonerManager),CLogDomain("::Konclude::Reasoner::Kernel::Realizeror") { mTestedPossibleInstancesCount = 0; mOpenPossibleInstancesCount = 0; mRealizingCount = 0; mBackendAssocCache = nullptr; CBackendCache* backendCache = reasonerManager->getBackendAssociationCache(); if (backendCache) { mBackendAssocCache = dynamic_cast(backendCache); if (mBackendAssocCache) { mBackendAssocCacheReader = mBackendAssocCache->createCacheReader(); } } } COptimizedKPSetOntologyConceptRealizingThread::~COptimizedKPSetOntologyConceptRealizingThread() { } COntologyRealizingItem* COptimizedKPSetOntologyConceptRealizingThread::initializeOntologyRealizingItem(CConcreteOntology* ontology, CConfigurationBase* config) { COptimizedKPSetOntologyConceptRealizingItem* item = new COptimizedKPSetOntologyConceptRealizingItem(); item->initRequirementConfigRealizingItem(ontology,config); if (mTestedPossibleInstancesCount == mOpenPossibleInstancesCount) { mTestedPossibleInstancesCount = 0; mOpenPossibleInstancesCount = 0; mRealStartTime.start(); } initializeItems(item); ++mRealizingCount; return item; } void COptimizedKPSetOntologyConceptRealizingThread::readCalculationConfig(CConfigurationBase *config) { if (config) { bool configErrorFlag = false; cint64 processorCount = 1; QString processorCountString = CConfigDataReader::readConfigString(config,"Konclude.Calculation.ProcessorCount",QString(),&configErrorFlag); if (!configErrorFlag) { if (processorCountString == "AUTO") { processorCount = CThread::idealThreadCount(); } else { qint64 convertedWorkerCount = processorCountString.toInt(&configErrorFlag); if (configErrorFlag) { processorCount = convertedWorkerCount; } } } bool mulConfigErrorFlag = false; cint64 multiplicator = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Realization.COptimizedKPSetOntologyConceptRealizer.MultipliedUnitsParallelTestingCalculationCount",1,&mulConfigErrorFlag); mConfMaxTestParallelCount = processorCount*multiplicator; bool maxConfigErrorFlag = false; cint64 maxParallel = CConfigDataReader::readConfigInteger(config,"Konclude.Calculation.Realization.COptimizedKPSetOntologyConceptRealizer.MaximumParallelTestingCalculationCount",1,&maxConfigErrorFlag); if (!maxConfigErrorFlag) { if (!mulConfigErrorFlag) { mConfMaxTestParallelCount = qMin(mConfMaxTestParallelCount,maxParallel); } else { mConfMaxTestParallelCount = maxParallel; } } } else { mConfMaxTestParallelCount = 1; } } bool COptimizedKPSetOntologyConceptRealizingThread::initializeItems(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { if (!reqConfPreCompItem->hasItemsInitialized()) { reqConfPreCompItem->initConceptItemsFromHierarchy(); reqConfPreCompItem->initRoleItemsFromHierarchy(); reqConfPreCompItem->initComplexRolesStarterCandidates(); readCalculationConfig(reqConfPreCompItem->getCalculationConfiguration()); initializeKPSetsFromConsistencyData(reqConfPreCompItem); reqConfPreCompItem->setItemsInitialized(true); QList* itemInstancesList = reqConfPreCompItem->getProcessingPossibleConceptInstancesItemList(); for (QList::const_iterator it = itemInstancesList->constBegin(), itEnd = itemInstancesList->constEnd(); it != itEnd; ++it) { COptimizedKPSetConceptInstancesItem* item(*it); if (item->hasAllSuccessorProcessedFlag() && !item->hasPossibleInstances() && !item->hasTestingPossibleInstances()) { updateParentItemsSuccessorProcessed(item); } } } return true; } CIndividualProcessNode* COptimizedKPSetOntologyConceptRealizingThread::getMergeCorrectedIndividualProcessNode(CIndividualProcessNode* indiProcNode, CIndividualProcessNodeVector* indiProcVector, bool* nonDeterministicallyMergedFlag, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { bool nonDeterministicMerged = false; while (indiProcNode && indiProcNode->getMergedIntoIndividualNodeID() != indiProcNode->getIndividualID()) { cint64 mergeID = indiProcNode->getMergedIntoIndividualNodeID(); CDependencyTrackPoint* mergedDepTrackPoint = indiProcNode->getMergedDependencyTrackPoint(); indiProcNode = indiProcVector->getData(mergeID); if (!mergedDepTrackPoint || mergedDepTrackPoint->getBranchingTag() > 0) { nonDeterministicMerged = true; } } if (nonDeterministicallyMergedFlag) { *nonDeterministicallyMergedFlag = nonDeterministicMerged; } return indiProcNode; } bool itemSortLessThan(COptimizedKPSetConceptInstancesItem* item1, COptimizedKPSetConceptInstancesItem* item2) { return item1->getHierarchyNode()->getParentNodeSet()->count() > item2->getHierarchyNode()->getParentNodeSet()->count(); } bool COptimizedKPSetOntologyConceptRealizingThread::addKPSetDirectSuperInstances(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetConceptInstancesHash* knownPossibleInstancesHash, COptimizedKPSetConceptInstancesItem* instanceItem, bool knownInstance) { QList tmpInstancesList; COptimizedKPSetConceptInstancesHashData& hashData = (*knownPossibleInstancesHash)[instanceItem]; if (hashData.mInstanceItemData == nullptr) { COptimizedKPSetConceptInstancesData* data = new COptimizedKPSetConceptInstancesData(); hashData.mInstanceItemData = data; data->mInstanceItem = instanceItem; data->mKnownInstance = knownInstance; data->mPossibleInstance = !knownInstance; data->mMostSpecific = true; tmpInstancesList.append(*instanceItem->getParentItemList()); while (!tmpInstancesList.isEmpty()) { COptimizedKPSetConceptInstancesItem* superInstanceItem = tmpInstancesList.takeFirst(); COptimizedKPSetConceptInstancesHashData& superHashData = (*knownPossibleInstancesHash)[superInstanceItem]; if (superHashData.mInstanceItemData == nullptr) { COptimizedKPSetConceptInstancesData* superData = new COptimizedKPSetConceptInstancesData(); superHashData.mInstanceItemData = superData; superData->mInstanceItem = superInstanceItem; superData->mKnownInstance = knownInstance; superData->mPossibleInstance = !knownInstance; superData->mMostSpecific = false; tmpInstancesList.append(*superInstanceItem->getParentItemList()); } else { if (knownInstance && superHashData.mInstanceItemData->mKnownInstance && superHashData.mInstanceItemData->mMostSpecific) { superHashData.mInstanceItemData->mMostSpecific = false; } if (!knownInstance && superHashData.mInstanceItemData->mPossibleInstance && superHashData.mInstanceItemData->mMostSpecific) { superHashData.mInstanceItemData->mMostSpecific = false; } } } } return true; } bool COptimizedKPSetOntologyConceptRealizingThread::initializeKPSetsForIndividual(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, CIndividual* individual, QList& knownInstancesList, QList& possibleInstancesList, QList& knownSameIndividualList) { COptimizedKPSetIndividualItem* instantiatedItem = reqConfPreCompItem->getIndividualInstantiatedItem(individual,true); qSort(knownInstancesList.begin(),knownInstancesList.end(),itemSortLessThan); qSort(possibleInstancesList.begin(),possibleInstancesList.end(),itemSortLessThan); COptimizedKPSetConceptInstancesHash* knownPossibleInstancesHash = instantiatedItem->getKnownPossibleInstancesHash(); for (QList::const_iterator it = knownInstancesList.constBegin(), itEnd = knownInstancesList.constEnd(); it != itEnd; ++it) { COptimizedKPSetConceptInstancesItem* instanceItem(*it); addKPSetDirectSuperInstances(reqConfPreCompItem,knownPossibleInstancesHash,instanceItem,true); } for (QList::const_iterator it = possibleInstancesList.constBegin(), itEnd = possibleInstancesList.constEnd(); it != itEnd; ++it) { COptimizedKPSetConceptInstancesItem* instanceItem(*it); addKPSetDirectSuperInstances(reqConfPreCompItem,knownPossibleInstancesHash,instanceItem,false); } for (COptimizedKPSetConceptInstancesHash::const_iterator it = knownPossibleInstancesHash->constBegin(), itEnd = knownPossibleInstancesHash->constEnd(); it != itEnd; ++it) { const COptimizedKPSetConceptInstancesHashData& hashData = it.value(); if (hashData.mInstanceItemData->mMostSpecific) { COptimizedKPSetConceptInstancesItem* instanceItem = hashData.mInstanceItemData->mInstanceItem; if (hashData.mInstanceItemData->mKnownInstance) { instanceItem->addKnownInstance(instantiatedItem); } else { incOpenPossibleConceptInstancesCount(reqConfPreCompItem); instantiatedItem->incPossibleInstantiatedCount(); instanceItem->addPossibleInstance(instantiatedItem); } } } if (!knownSameIndividualList.isEmpty()) { for (QList::const_iterator it = knownSameIndividualList.constBegin(), itEnd = knownSameIndividualList.constEnd(); it != itEnd; ++it) { CIndividual* sameIndividual(*it); instantiatedItem->addKnownSameIndividual(sameIndividual); reqConfPreCompItem->getIndividualInstantiatedItemHash()->insert(sameIndividual,instantiatedItem); } } return true; } bool COptimizedKPSetOntologyConceptRealizingThread::initializeEquivalentClassList(QList* equivClassList, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { CTBox* tBox = reqConfPreCompItem->getOntology()->getTBox(); CBOXHASH* eqCandHash = tBox->getEquivalentConceptCandidateHash(false); QHash* hierItemHash = reqConfPreCompItem->getHierarchyNodeInstancesItemHash(); QHash* conInstItemHash = reqConfPreCompItem->getConceptInstancesItemHash(); for (QHash::const_iterator it = hierItemHash->constBegin(), itEnd = hierItemHash->constEnd(); it != itEnd; ++it) { COptimizedKPSetConceptInstancesItem* item = it.value(); CHierarchyNode* hierNode = item->getHierarchyNode(); QList* eqConList = hierNode->getEquivalentConceptList(); bool hasEqConCand = false; for (QList::const_iterator itCon = eqConList->constBegin(), itConEnd = eqConList->constEnd(); !hasEqConCand && itCon != itConEnd; ++itCon) { CConcept* eqConcept(*itCon); if (eqConcept->getOperatorCode() == CCSUB || eqConcept->getOperatorCode() == CCATOM || eqConcept->getOperatorCode() == CCTOP || eqConcept->getOperatorCode() == CCBOTTOM) { hasEqConCand = true; } else if (eqConcept->getOperatorCode() == CCEQ) { if (eqCandHash->contains(eqConcept)) { hasEqConCand = true; } } } if (!hasEqConCand) { COptimizedKPSetConceptInstancesItem* instantiatedItem = conInstItemHash->value(eqConList->first()); equivClassList->append(instantiatedItem); } } return true; } bool COptimizedKPSetOntologyConceptRealizingThread::extractKnownPossibleIndividualDataFromConsistencyData(CIndividual* individual, QList* knownInstancesList, QList* possibleInstancesList, QList* knownSameIndividualList, QList* possibleSameIndividualList, CIndividualProcessNodeVector* indiProcVector, const QList& equivClassList, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { QHash* conInstItemHash = reqConfPreCompItem->getConceptInstancesItemHash(); cint64 indiID = individual->getIndividualID(); bool indiInitialized = false; if (!indiInitialized) { if (indiProcVector) { CIndividualProcessNode* baseIndiProcNode = indiProcVector->getData(indiID); CIndividualProcessNode* indiProcNode = baseIndiProcNode; if (indiProcNode) { bool nondeterministicallyMergedFlag = false; indiProcNode = getMergeCorrectedIndividualProcessNode(indiProcNode,indiProcVector,&nondeterministicallyMergedFlag,reqConfPreCompItem); CReapplyConceptLabelSet* conLabelSet = indiProcNode->getReapplyConceptLabelSet(false); if (conLabelSet) { CConceptDescriptor* conDesLinker = conLabelSet->getAddingSortedConceptDescriptionLinker(); while (conDesLinker) { CConcept* concept = conDesLinker->getConcept(); bool negated = conDesLinker->getNegation(); CDependencyTrackPoint* depTrackPoint = conDesLinker->getDependencyTrackPoint(); bool deterministicTrackPoint = false; if (depTrackPoint) { if (depTrackPoint->getBranchingTag() <= 0) { deterministicTrackPoint = true; } } if (!negated) { CConcept* resolvedConcept = concept; bool resolved = false; CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCF_ATOM | CConceptOperator::CCF_SUB | CConceptOperator::CCF_TOP | CConceptOperator::CCF_EQ | CConceptOperator::CCF_EQCAND)) { cint64 opCode = conOperator->getOperatorCode(); if (opCode == CCEQCAND) { resolvedConcept = concept->getOperandList()->getData(); resolved = true; } COptimizedKPSetConceptInstancesItem* instantiatedItem = conInstItemHash->value(resolvedConcept); if (instantiatedItem) { if (deterministicTrackPoint && !resolved) { knownInstancesList->append(instantiatedItem); } else { possibleInstancesList->append(instantiatedItem); } } } } conDesLinker = conDesLinker->getNextConceptDesciptor(); } } CIndividualMergingHash* indiMergingHash = indiProcNode->getIndividualMergingHash(false); if (indiMergingHash) { for (CIndividualMergingHash::const_iterator it = indiMergingHash->constBegin(), itEnd = indiMergingHash->constEnd(); it != itEnd; ++it) { CIndividual* mergedIndi = it.key(); CDependencyTrackPoint* mergedDepTrackPoint = it.value(); bool nondeterministicallyMerged = false; if (!mergedDepTrackPoint || mergedDepTrackPoint->getBranchingTag() > 0) { nondeterministicallyMerged = true; } if (mergedIndi != individual && !mergedIndi->isAnonymousIndividual()) { if (nondeterministicallyMerged) { possibleSameIndividualList->append(mergedIndi); } else { knownSameIndividualList->append(mergedIndi); } } } } if (indiProcNode != baseIndiProcNode) { if (nondeterministicallyMergedFlag) { possibleSameIndividualList->append(indiProcNode->getNominalIndividual()); } else { knownSameIndividualList->append(indiProcNode->getNominalIndividual()); } } if (nondeterministicallyMergedFlag) { possibleInstancesList->append(*knownInstancesList); knownInstancesList->clear(); possibleSameIndividualList->append(*knownSameIndividualList); knownSameIndividualList->clear(); QSet knownConceptSet; QSet knownSameIndividualSet; CIndividualProcessNode* detIndiProcNode = baseIndiProcNode; bool stillDeterministicllyMerged = true; while (stillDeterministicllyMerged && detIndiProcNode) { CReapplyConceptLabelSet* detConLabelSet = detIndiProcNode->getReapplyConceptLabelSet(false); if (detConLabelSet) { CIndividualMergingHash* detIndiMergingHash = detIndiProcNode->getIndividualMergingHash(false); if (detIndiMergingHash) { for (CIndividualMergingHash::const_iterator it = detIndiMergingHash->constBegin(), itEnd = detIndiMergingHash->constEnd(); it != itEnd; ++it) { CIndividual* mergedIndi = it.key(); CDependencyTrackPoint* mergedDepTrackPoint = it.value(); bool nondeterministicallyMerged = false; if (!mergedDepTrackPoint || mergedDepTrackPoint->getBranchingTag() > 0) { nondeterministicallyMerged = true; } if (mergedIndi != individual && !mergedIndi->isAnonymousIndividual()) { if (!nondeterministicallyMerged) { knownSameIndividualSet.insert(mergedIndi); } } } } if (stillDeterministicllyMerged) { CConceptDescriptor* conDesLinker = detConLabelSet->getAddingSortedConceptDescriptionLinker(); for (CConceptDescriptor* conDesLinkerIt = conDesLinker; conDesLinkerIt; conDesLinkerIt = conDesLinkerIt->getNext()) { CConcept* concept = conDesLinkerIt->getConcept(); bool negated = conDesLinkerIt->getNegation(); CDependencyTrackPoint* depTrackPoint = conDesLinkerIt->getDependencyTrackPoint(); bool deterministicTrackPoint = false; if (depTrackPoint) { if (depTrackPoint->getBranchingTag() <= 0) { deterministicTrackPoint = true; } } if (!negated) { CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCF_ATOM | CConceptOperator::CCF_SUB | CConceptOperator::CCF_TOP | CConceptOperator::CCF_EQ)) { cint64 opCode = conOperator->getOperatorCode(); if (deterministicTrackPoint) { knownConceptSet.insert(concept); } } } } } } if (stillDeterministicllyMerged) { detIndiProcNode = indiProcVector->getData(detIndiProcNode->getMergedIntoIndividualNodeID()); CDependencyTrackPoint* mergedDepTrackPoint = detIndiProcNode->getMergedDependencyTrackPoint(); if (!mergedDepTrackPoint || mergedDepTrackPoint->getBranchingTag() > 0) { stillDeterministicllyMerged = false; } } } for (QSet::const_iterator it = knownConceptSet.constBegin(), itEnd = knownConceptSet.constEnd(); it != itEnd; ++it) { CConcept* concept(*it); COptimizedKPSetConceptInstancesItem* instantiatedItem = conInstItemHash->value(concept); knownInstancesList->append(instantiatedItem); } for (QSet::const_iterator it = knownSameIndividualSet.constBegin(), itEnd = knownSameIndividualSet.constEnd(); it != itEnd; ++it) { CIndividual* sameIndividual(*it); knownSameIndividualList->append(sameIndividual); } QList tmpPossibleSameIndividualList(*possibleSameIndividualList); possibleSameIndividualList->clear(); while (!tmpPossibleSameIndividualList.isEmpty()) { CIndividual* possSameIndividual = tmpPossibleSameIndividualList.takeFirst(); if (!knownSameIndividualSet.contains(possSameIndividual)) { possibleSameIndividualList->append(possSameIndividual); } } } indiInitialized = true; } } } if (!indiInitialized) { CBackendRepresentativeMemoryCacheIndividualAssociationData* assData = mBackendAssocCacheReader->getIndividualAssociation(individual); if (assData) { CBackendRepresentativeMemoryLabelCacheItem* labelDataItem = assData->getBackendLabelCacheEntry(); if (labelDataItem) { for (CBackendRepresentativeMemoryLabelValueLinker* valueLinker = labelDataItem->getDeterministicCacheValueLinker(); valueLinker; valueLinker = valueLinker->getNext()) { CCacheValue& cacheValue = valueLinker->getCacheValue(); CConcept* concept = (CConcept*)cacheValue.getIdentification(); bool negation = cacheValue.getCacheValueIdentifier() == CCacheValue::CACHEVALTAGANDNEGATEDCONCEPT; if (!negation) { CConceptOperator* conOperator = concept->getConceptOperator(); if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCF_NOMINAL)) { CIndividual* nominalIndividual = concept->getNominalIndividual(); if (nominalIndividual != individual) { knownSameIndividualList->append(nominalIndividual); } } if (conOperator->hasPartialOperatorCodeFlag(CConceptOperator::CCF_ATOM | CConceptOperator::CCF_SUB | CConceptOperator::CCF_TOP | CConceptOperator::CCF_EQ | CConceptOperator::CCF_EQCAND)) { cint64 opCode = conOperator->getOperatorCode(); CConcept* resolvedConcept = concept; bool resolved = false; if (opCode == CCEQCAND) { resolved = true; resolvedConcept = concept->getOperandList()->getData(); } COptimizedKPSetConceptInstancesItem* instantiatedItem = conInstItemHash->value(resolvedConcept); if (!resolved) { knownInstancesList->append(instantiatedItem); } else { possibleInstancesList->append(instantiatedItem); } } } } indiInitialized = true; } } } if (!equivClassList.isEmpty()) { possibleInstancesList->append(equivClassList); } return true; } bool COptimizedKPSetOntologyConceptRealizingThread::initializeKPSetsFromConsistencyData(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { CIndividualVector* indiVec = reqConfPreCompItem->getOntology()->getABox()->getIndividualVector(false); if (indiVec) { CIndividualProcessNodeVector* indiProcVector = nullptr; CConsistence* consistence = reqConfPreCompItem->getOntology()->getConsistence(); if (consistence) { CConsistenceData* consData = consistence->getConsistenceModelData(); if (consData) { CConsistenceTaskData* consTaskData = dynamic_cast(consData); CSatisfiableCalculationTask* satConsTask = consTaskData->getCompletionGraphCachedSatisfiableTask(); if (!satConsTask) { satConsTask = consTaskData->getDeterministicSatisfiableTask(); } if (satConsTask) { CProcessingDataBox* procDataBox = satConsTask->getProcessingDataBox(); if (procDataBox) { indiProcVector = procDataBox->getIndividualProcessNodeVector(); } } } } QList equivClassList; initializeEquivalentClassList(&equivClassList,reqConfPreCompItem); QHash* conInstItemHash = reqConfPreCompItem->getConceptInstancesItemHash(); QHash > individualPossibleSameIndividualListHash; CBOXSET* activeIndividualSet = reqConfPreCompItem->getOntology()->getABox()->getActiveIndividualSet(false); cint64 indiCount = indiVec->getItemCount(); for (cint64 indiID = 0; indiID < indiCount; ++indiID) { CIndividual* individual = indiVec->getData(indiID); if (individual && !individual->isAnonymousIndividual() && !reqConfPreCompItem->hasIndividualInstantiatedItem(individual) && activeIndividualSet->contains(individual)) { QList knownInstancesList; QList possibleInstancesList; QList knownSameIndividualList; QList possibleSameIndividualList; extractKnownPossibleIndividualDataFromConsistencyData(individual,&knownInstancesList,&possibleInstancesList,&knownSameIndividualList,&possibleSameIndividualList,indiProcVector,equivClassList,reqConfPreCompItem); initializeKPSetsForIndividual(reqConfPreCompItem,individual,knownInstancesList,possibleInstancesList,knownSameIndividualList); if (!possibleSameIndividualList.isEmpty()) { individualPossibleSameIndividualListHash.insert(individual,possibleSameIndividualList); } } } if (!individualPossibleSameIndividualListHash.isEmpty()) { QSet singleIndividualSet; for (QHash >::const_iterator it = individualPossibleSameIndividualListHash.constBegin(), itEnd = individualPossibleSameIndividualListHash.constEnd(); it != itEnd; ++it) { CIndividual* individual = it.key(); COptimizedKPSetIndividualItem* individualItem = reqConfPreCompItem->getIndividualInstantiatedItem(individual,false); if (!singleIndividualSet.contains(individualItem)) { singleIndividualSet.insert(individualItem); const QList possibleSameIndividualList = it.value(); initializeSamePossibleIndividuals(reqConfPreCompItem,individualItem,possibleSameIndividualList); } } } } return true; } bool COptimizedKPSetOntologyConceptRealizingThread::initializeSamePossibleIndividuals(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetIndividualItem* individualItem, const QList& possibleSameIndividualList) { reqConfPreCompItem->addPossibleSameIndividualsItem(individualItem); for (QList::const_iterator it = possibleSameIndividualList.constBegin(), itEnd = possibleSameIndividualList.constEnd(); it != itEnd; ++it) { CIndividual* possSameIndividual(*it); COptimizedKPSetIndividualItem* possSameIndividualItem = reqConfPreCompItem->getIndividualInstantiatedItem(possSameIndividual,false); individualItem->addPossibleSameIndividualItem(possSameIndividualItem); possSameIndividualItem->addPossibleSameIndividualItem(individualItem); incOpenPossibleSameIndividualsCount(reqConfPreCompItem); } return true; } bool COptimizedKPSetOntologyConceptRealizingThread::createNextConceptInstantiationTest(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetConceptInstancesItem* instancesItem, COptimizedKPSetIndividualItem* instantiatedItem) { instancesItem->incTestingPossibleInstancesCount(); instantiatedItem->incTestingPossibleInstantiatedCount(); instantiatedItem->decPossibleInstantiatedCount(); instantiatedItem->setTestingPossibleInstantiated(instancesItem); CConcept* concept = instancesItem->getHierarchyNode()->getOneEquivalentConcept(); CIndividual* individual = instantiatedItem->getIndividual(); CSatisfiableCalculationJob* satCalcJob = nullptr; CSatisfiableCalculationJobGenerator satCalcJobGen(reqConfPreCompItem->getOntology()); satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(concept,true,individual); satCalcJob->setCalculationConfiguration(reqConfPreCompItem->getCalculationConfiguration()); if (reqConfPreCompItem->getPossibleAssertionCollectionSet()) { satCalcJob->setPossibleAssertionCollectionAdapter(new CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter(reqConfPreCompItem->getOntology(),reqConfPreCompItem->getPossibleAssertionCollectionSet())); } if (reqConfPreCompItem->requiresIndividualDependenceTracking()) { if (!instantiatedItem->getIndividualDependenceTrackingCollector()) { instantiatedItem->setIndividualDependenceTrackingCollector(new CIndividualDependenceTrackingCollector()); } } if (instantiatedItem->getIndividualDependenceTrackingCollector()) { satCalcJob->setSatisfiableTaskIndividualDependenceTrackingAdapter(new CSatisfiableTaskIndividualDependenceTrackingAdapter(instantiatedItem->getIndividualDependenceTrackingCollector())); } CIndividualConceptInstanceTestingItem* testItem = new CIndividualConceptInstanceTestingItem(reqConfPreCompItem,instancesItem,instantiatedItem); reqConfPreCompItem->incTestingPossibleConceptInstanceCount(); processCalculationJob(satCalcJob,reqConfPreCompItem,testItem); return true; } bool COptimizedKPSetOntologyConceptRealizingThread::createNextRoleInstantiationTest(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetRoleInstancesItem* instancesItem, COptimizedKPSetIndividualItemPair itemPair) { instancesItem->incTestingPossibleInstancesCount(); COptimizedKPSetIndividualItem* indItem1 = itemPair.first; COptimizedKPSetIndividualItem* indItem2 = itemPair.second; indItem1->incTestingPossibleRoleInstantiatedCount(); indItem1->decPossibleRoleInstantiatedCount(); indItem1->setTestingPossibleInstantiated(instancesItem,indItem2); CConcept* propConcept = instancesItem->getTemporaryPropagationConcept(); CConcept* markConcept = instancesItem->getTemporaryMarkerConcept(); CIndividual* indi1 = indItem1->getIndividual(); CIndividual* indi2 = indItem2->getIndividual(); CSatisfiableCalculationJob* satCalcJob = nullptr; CSatisfiableCalculationJobGenerator satCalcJobGen(reqConfPreCompItem->getTemporaryRoleRealizationOntology()); satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(propConcept,false,indi1); satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(markConcept,true,indi2,satCalcJob); satCalcJob->setCalculationConfiguration(reqConfPreCompItem->getCalculationConfiguration()); if (reqConfPreCompItem->requiresIndividualDependenceTracking()) { if (!indItem1->getIndividualDependenceTrackingCollector()) { indItem1->setIndividualDependenceTrackingCollector(new CIndividualDependenceTrackingCollector()); } } if (indItem1->getIndividualDependenceTrackingCollector()) { satCalcJob->setSatisfiableTaskIndividualDependenceTrackingAdapter(new CSatisfiableTaskIndividualDependenceTrackingAdapter(indItem1->getIndividualDependenceTrackingCollector())); } CIndividualPairRoleInstanceTestingItem* testItem = new CIndividualPairRoleInstanceTestingItem(reqConfPreCompItem,instancesItem,itemPair); reqConfPreCompItem->incTestingPossibleRoleInstanceCount(); processCalculationJob(satCalcJob,reqConfPreCompItem,testItem); return true; } CIndividualProcessNode* COptimizedKPSetOntologyConceptRealizingThread::getCompletionGraphCachedIndividualProcessNode(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetIndividualItem* indiItem, bool* nondeterministicNodeFlag) { CIndividual* individual = indiItem->getIndividual(); cint64 indiID = individual->getIndividualID(); CIndividualProcessNodeVector* indiProcVector = nullptr; CConsistence* consistence = reqConfPreCompItem->getOntology()->getConsistence(); if (consistence) { CConsistenceData* consData = consistence->getConsistenceModelData(); if (consData) { CConsistenceTaskData* consTaskData = dynamic_cast(consData); CSatisfiableCalculationTask* satConsTask = consTaskData->getCompletionGraphCachedSatisfiableTask(); if (!satConsTask) { satConsTask = consTaskData->getDeterministicSatisfiableTask(); } if (satConsTask) { CProcessingDataBox* procDataBox = satConsTask->getProcessingDataBox(); if (procDataBox) { indiProcVector = procDataBox->getIndividualProcessNodeVector(); } } } } if (indiProcVector) { CIndividualProcessNode* baseIndiProcNode = indiProcVector->getData(indiID); CIndividualProcessNode* indiProcNode = baseIndiProcNode; bool nondeterministicallyMergedFlag = false; if (indiProcNode) { indiProcNode = getMergeCorrectedIndividualProcessNode(indiProcNode,indiProcVector,&nondeterministicallyMergedFlag,reqConfPreCompItem); } if (nondeterministicNodeFlag) { *nondeterministicNodeFlag = nondeterministicallyMergedFlag; } return indiProcNode; } return nullptr; } bool COptimizedKPSetOntologyConceptRealizingThread::createNextRoleInitializingTest(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetIndividualItem* individualItem) { bool nondeterministicIndividual = false; CIndividualProcessNode* indiNode = getCompletionGraphCachedIndividualProcessNode(reqConfPreCompItem,individualItem,&nondeterministicIndividual); individualItem->setAllRoleCandidatesInitializedFlag(true); //QString indiString = CIRIName::getRecentIRIName(individualItem->getIndividual()->getIndividualNameLinker()); //if (indiString == "http://www.co-ode.org/roberts/family-tree.owl#john_archer_1804") { // bool bug = true; //} QList propConceptList; QList markerConceptList; QList* roleInstItemList = reqConfPreCompItem->getRoleInstancesItemList(); for (QList::const_iterator it = roleInstItemList->constBegin(), itEnd = roleInstItemList->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleInstancesItem* roleInstItem(*it); //QString roleString = CIRIName::getRecentIRIName(roleInstItem->getRole()->getPropertyNameLinker()); //QString inverseRoleString = CIRIName::getRecentIRIName(roleInstItem->getInverseRole()->getPropertyNameLinker()); //if (roleString == "http://www.co-ode.org/roberts/family-tree.owl#isFatherOf" || inverseRoleString == "http://www.co-ode.org/roberts/family-tree.owl#isFatherOf") { // bool bug = true; //} COptimizedKPSetRoleNeighbourInstancesHashData& roleNeighbourHashData = individualItem->getKnownPossibleRoleNeighboursInstancesHash()->operator[](roleInstItem); if (!roleNeighbourHashData.mRoleSuccessorInstancesInitializing) { roleNeighbourHashData.mRoleSuccessorInstancesInitializing = true; if (roleInstItem == reqConfPreCompItem->getTopRoleInstancesItem()) { roleNeighbourHashData.mRoleSuccessorInstancesInitialized = true; } else { CRole* role = roleInstItem->getRole(); if (!role->isComplexRole()) { if (indiNode) { CRoleSuccessorLinkIterator roleSuccIt = indiNode->getRoleSuccessorLinkIterator(role); while (roleSuccIt.hasNext()) { CIndividualLinkEdge* succLink = roleSuccIt.next(); CIndividualProcessNode* succIndiNode = succLink->getOppositeIndividual(indiNode); CIndividual* succIndi = succIndiNode->getNominalIndividual(); if (succIndi) { bool nondet = true; CDependencyTrackPoint* linkDepTrackPoint = succLink->getDependencyTrackPoint(); if (!nondeterministicIndividual && linkDepTrackPoint && linkDepTrackPoint->getBranchingTag() <= 0) { nondet = false; } COptimizedKPSetIndividualItem* succIndiItem = reqConfPreCompItem->getIndividualInstantiatedItem(succIndi,false); if (succIndiItem) { addKPSetDirectSuperInstances(reqConfPreCompItem,roleInstItem,false,individualItem,succIndiItem,!nondet); } } } } else { CIndividual* individual = individualItem->getIndividual(); for (CRoleAssertionLinker* roleAssLinkerIt = individual->getAssertionRoleLinker(); roleAssLinkerIt; roleAssLinkerIt = roleAssLinkerIt->getNext()) { CRole* assRole = roleAssLinkerIt->getRole(); for (CSortedNegLinker* assSuperRoleIt = assRole->getIndirectSuperRoleList(); assSuperRoleIt; assSuperRoleIt = assSuperRoleIt->getNext()) { CRole* assSuperRole = assSuperRoleIt->getData(); bool assSuperRoleInversed = assSuperRoleIt->isNegated(); if (assSuperRole == role && !assSuperRoleInversed) { CIndividual* succIndi = roleAssLinkerIt->getIndividual(); COptimizedKPSetIndividualItem* succIndiItem = reqConfPreCompItem->getIndividualInstantiatedItem(succIndi,false); if (succIndiItem) { addKPSetDirectSuperInstances(reqConfPreCompItem,roleInstItem,false,individualItem,succIndiItem,false); break; } } } } } roleNeighbourHashData.mRoleSuccessorInstancesInitialized = true; } else { bool foundStarterCandidate = false; if (indiNode) { CReapplyRoleSuccessorHash* roleSuccHash = indiNode->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { CRoleSuccessorIterator roleSuccIt = roleSuccHash->getRoleIterator(); while (roleSuccIt.hasNext() && !foundStarterCandidate) { CRole* candRole = roleSuccIt.next(); if (roleInstItem->hasComplexRoleStarterCandidate(candRole)) { foundStarterCandidate = true; } } } } else { CIndividual* individual = individualItem->getIndividual(); for (CRoleAssertionLinker* roleAssLinkerIt = individual->getAssertionRoleLinker(); roleAssLinkerIt && !foundStarterCandidate; roleAssLinkerIt = roleAssLinkerIt->getNext()) { CRole* assRole = roleAssLinkerIt->getRole(); for (CSortedNegLinker* assSuperRoleIt = assRole->getIndirectSuperRoleList(); assSuperRoleIt && !foundStarterCandidate; assSuperRoleIt = assSuperRoleIt->getNext()) { CRole* assSuperRole = assSuperRoleIt->getData(); bool assSuperRoleInversed = assSuperRoleIt->isNegated(); if (!assSuperRoleInversed) { if (roleInstItem->hasComplexRoleStarterCandidate(assSuperRole)) { foundStarterCandidate = true; } } } } } if (foundStarterCandidate) { CConcept* propConcept = roleInstItem->getTemporaryPropagationConcept(); CConcept* markerConcept = roleInstItem->getTemporaryMarkerConcept(); propConceptList.append(propConcept); markerConceptList.append(markerConcept); } else { roleNeighbourHashData.mRoleSuccessorInstancesInitialized = true; } } } reqConfPreCompItem->incInitializedRoleInstancesCount(); } if (!roleNeighbourHashData.mRolePredecessorInstancesInitializing && roleInstItem->hasInverseRole()) { roleNeighbourHashData.mRolePredecessorInstancesInitializing = true; if (roleInstItem == reqConfPreCompItem->getTopRoleInstancesItem()) { roleNeighbourHashData.mRolePredecessorInstancesInitialized = true; } else { CRole* invRole = roleInstItem->getInverseRole(); if (invRole) { if (!invRole->isComplexRole()) { if (indiNode) { CRoleSuccessorLinkIterator roleSuccIt = indiNode->getRoleSuccessorLinkIterator(invRole); while (roleSuccIt.hasNext()) { CIndividualLinkEdge* succLink = roleSuccIt.next(); CIndividualProcessNode* succIndiNode = succLink->getOppositeIndividual(indiNode); CIndividual* succIndi = succIndiNode->getNominalIndividual(); if (succIndi) { bool nondet = true; CDependencyTrackPoint* linkDepTrackPoint = succLink->getDependencyTrackPoint(); if (!nondeterministicIndividual && linkDepTrackPoint && linkDepTrackPoint->getBranchingTag() <= 0) { nondet = false; } COptimizedKPSetIndividualItem* succIndiItem = reqConfPreCompItem->getIndividualInstantiatedItem(succIndi,false); if (succIndiItem) { addKPSetDirectSuperInstances(reqConfPreCompItem,roleInstItem,true,individualItem,succIndiItem,!nondet); } } } } else { CIndividual* individual = individualItem->getIndividual(); for (CReverseRoleAssertionLinker* reverseRoleAssLinkerIt = individual->getReverseAssertionRoleLinker(); reverseRoleAssLinkerIt; reverseRoleAssLinkerIt = reverseRoleAssLinkerIt->getNext()) { CRole* assRole = reverseRoleAssLinkerIt->getRole(); for (CSortedNegLinker* assSuperRoleIt = assRole->getIndirectSuperRoleList(); assSuperRoleIt; assSuperRoleIt = assSuperRoleIt->getNext()) { CRole* assSuperRole = assSuperRoleIt->getData(); bool assSuperRoleInversed = assSuperRoleIt->isNegated(); if (assSuperRole == invRole && assSuperRoleInversed) { CIndividual* succIndi = reverseRoleAssLinkerIt->getIndividual(); COptimizedKPSetIndividualItem* succIndiItem = reqConfPreCompItem->getIndividualInstantiatedItem(succIndi,false); if (succIndiItem) { addKPSetDirectSuperInstances(reqConfPreCompItem,roleInstItem,true,individualItem,succIndiItem,false); break; } } } } } roleNeighbourHashData.mRolePredecessorInstancesInitialized = true; } else { bool foundStarterCandidate = false; if (indiNode) { CReapplyRoleSuccessorHash* roleSuccHash = indiNode->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { CRoleSuccessorIterator roleSuccIt = roleSuccHash->getRoleIterator(); while (roleSuccIt.hasNext() && !foundStarterCandidate) { CRole* candRole = roleSuccIt.next(); if (roleInstItem->hasComplexInverseRoleStarterCandidate(candRole)) { foundStarterCandidate = true; } } } } else { CIndividual* individual = individualItem->getIndividual(); for (CReverseRoleAssertionLinker* reverseRoleAssLinkerIt = individual->getReverseAssertionRoleLinker(); reverseRoleAssLinkerIt; reverseRoleAssLinkerIt = reverseRoleAssLinkerIt->getNext()) { CRole* assRole = reverseRoleAssLinkerIt->getRole(); for (CSortedNegLinker* assSuperRoleIt = assRole->getIndirectSuperRoleList(); assSuperRoleIt && !foundStarterCandidate; assSuperRoleIt = assSuperRoleIt->getNext()) { CRole* assSuperRole = assSuperRoleIt->getData(); bool assSuperRoleInversed = assSuperRoleIt->isNegated(); if (assSuperRoleInversed) { if (roleInstItem->hasComplexInverseRoleStarterCandidate(assSuperRole)) { foundStarterCandidate = true; } } } } } if (foundStarterCandidate) { CConcept* propConcept = roleInstItem->getTemporaryInversePropagationConcept(); CConcept* markerConcept = roleInstItem->getTemporaryInverseMarkerConcept(); propConceptList.append(propConcept); markerConceptList.append(markerConcept); } else { roleNeighbourHashData.mRolePredecessorInstancesInitialized = true; } } } else { roleNeighbourHashData.mRolePredecessorInstancesInitialized = true; } } } } if (!propConceptList.isEmpty()) { reqConfPreCompItem->incTestingRoleInstanceCandidatesCount(); individualItem->incInitializingRoleCandidateCount(); CIndividual* indi = individualItem->getIndividual(); QList markerConceptList; CSatisfiableCalculationJob* satCalcJob = nullptr; CSatisfiableCalculationJobGenerator satCalcJobGen(reqConfPreCompItem->getTemporaryRoleRealizationOntology()); for (QList::const_iterator it = propConceptList.constBegin(), itEnd = propConceptList.constEnd(); it != itEnd; ++it) { CConcept* propConcept(*it); satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(propConcept,false,indi,satCalcJob); } CIndividualRoleCandidateTestingItem* testItem = new CIndividualRoleCandidateTestingItem(reqConfPreCompItem,individualItem,markerConceptList); satCalcJob->setRealizationMarkedCandidatesMessageAdapter(new CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter(indi,reqConfPreCompItem->getOntology(),this)); satCalcJob->setCalculationConfiguration(reqConfPreCompItem->getCalculationConfiguration()); if (reqConfPreCompItem->requiresIndividualDependenceTracking()) { if (!individualItem->getIndividualDependenceTrackingCollector()) { individualItem->setIndividualDependenceTrackingCollector(new CIndividualDependenceTrackingCollector()); } } if (individualItem->getIndividualDependenceTrackingCollector()) { satCalcJob->setSatisfiableTaskIndividualDependenceTrackingAdapter(new CSatisfiableTaskIndividualDependenceTrackingAdapter(individualItem->getIndividualDependenceTrackingCollector())); } processCalculationJob(satCalcJob,reqConfPreCompItem,testItem); return true; } return false; } bool COptimizedKPSetOntologyConceptRealizingThread::createNextRoleInitializingTest(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetRoleInstancesItem* instancesItem, COptimizedKPSetIndividualItem* individualItem) { instancesItem->decUninitializedSuccessorItemCount(); //QString indiString = CIRIName::getRecentIRIName(individualItem->getIndividual()->getIndividualNameLinker()); //QString roleString = CIRIName::getRecentIRIName(instancesItem->getRole()->getPropertyNameLinker()); //QString inverseRoleString; //if (instancesItem->getInverseRole()) { // inverseRoleString = CIRIName::getRecentIRIName(instancesItem->getInverseRole()->getPropertyNameLinker()); //} //if (indiString == "file:/Users/liebig/Ontologien/reasoner-eval/30.owl#Act5" && (roleString == "file:/Users/liebig/Ontologien/reasoner-eval/30.owl#first")) { // bool bug = true; //} //if (indiString == "file:/Users/liebig/Ontologien/reasoner-eval/30.owl#Madonna" && (roleString == "file:/Users/liebig/Ontologien/reasoner-eval/30.owl#inv-first")) { // bool bug = true; //} COptimizedKPSetRoleNeighbourInstancesHashData& roleNeighbourHashData = individualItem->getKnownPossibleRoleNeighboursInstancesHash()->operator[](instancesItem); if (!roleNeighbourHashData.mRoleSuccessorInstancesInitializing) { roleNeighbourHashData.mRoleSuccessorInstancesInitializing = true; if (instancesItem == reqConfPreCompItem->getTopRoleInstancesItem()) { roleNeighbourHashData.mRoleSuccessorInstancesInitialized = true; } else { CRole* role = instancesItem->getRole(); bool nondeterministicIndividual = false; CIndividualProcessNode* indiNode = getCompletionGraphCachedIndividualProcessNode(reqConfPreCompItem,individualItem,&nondeterministicIndividual); if (!role->isComplexRole()) { if (indiNode) { CRoleSuccessorLinkIterator roleSuccIt = indiNode->getRoleSuccessorLinkIterator(role); while (roleSuccIt.hasNext()) { CIndividualLinkEdge* succLink = roleSuccIt.next(); CIndividualProcessNode* succIndiNode = succLink->getOppositeIndividual(indiNode); CIndividual* succIndi = succIndiNode->getNominalIndividual(); if (succIndi) { bool nondet = true; CDependencyTrackPoint* linkDepTrackPoint = succLink->getDependencyTrackPoint(); if (!nondeterministicIndividual && linkDepTrackPoint && linkDepTrackPoint->getBranchingTag() <= 0) { nondet = false; } COptimizedKPSetIndividualItem* succIndiItem = reqConfPreCompItem->getIndividualInstantiatedItem(succIndi,false); if (succIndiItem) { addKPSetDirectSuperInstances(reqConfPreCompItem,instancesItem,false,individualItem,succIndiItem,!nondet); } } } } else { CIndividual* individual = individualItem->getIndividual(); for (CRoleAssertionLinker* roleAssLinkerIt = individual->getAssertionRoleLinker(); roleAssLinkerIt; roleAssLinkerIt = roleAssLinkerIt->getNext()) { CRole* assRole = roleAssLinkerIt->getRole(); for (CSortedNegLinker* assSuperRoleIt = assRole->getIndirectSuperRoleList(); assSuperRoleIt; assSuperRoleIt = assSuperRoleIt->getNext()) { CRole* assSuperRole = assSuperRoleIt->getData(); bool assSuperRoleInversed = assSuperRoleIt->isNegated(); if (assSuperRole == role && !assSuperRoleInversed) { CIndividual* succIndi = roleAssLinkerIt->getIndividual(); COptimizedKPSetIndividualItem* succIndiItem = reqConfPreCompItem->getIndividualInstantiatedItem(succIndi,false); if (succIndiItem) { addKPSetDirectSuperInstances(reqConfPreCompItem,instancesItem,false,individualItem,succIndiItem,false); break; } } } } roleNeighbourHashData.mRoleSuccessorInstancesInitialized = true; } roleNeighbourHashData.mRoleSuccessorInstancesInitialized = true; reqConfPreCompItem->incInitializedRoleInstancesCount(); } else { //QStringList compRoleNameList; //QStringList invCompRoleNameList; //QStringList markingCompRoleNameList; //QStringList invMarkingCompRoleNameList; //QString roleString = CIRIName::getRecentIRIName(instancesItem->getRole()->getPropertyNameLinker()); //QString inverseRoleString; //if (instancesItem->getInverseRole()) { // inverseRoleString = CIRIName::getRecentIRIName(instancesItem->getInverseRole()->getPropertyNameLinker()); //} //if (indiString == "http://www.co-ode.org/roberts/family-tree.owl#john_archer_1804" && (roleString == "http://www.co-ode.org/roberts/family-tree.owl#isRelationOf" || inverseRoleString == "http://www.co-ode.org/roberts/family-tree.owl#isRelationOf")) { // bool bug = true; //} //compRoleNameList.append(roleString); //invCompRoleNameList.append(inverseRoleString); bool foundStarterCandidate = false; if (indiNode) { CReapplyRoleSuccessorHash* roleSuccHash = indiNode->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { CRoleSuccessorIterator roleSuccIt = roleSuccHash->getRoleIterator(); while (roleSuccIt.hasNext() && !foundStarterCandidate) { CRole* candRole = roleSuccIt.next(); if (instancesItem->hasComplexRoleStarterCandidate(candRole)) { foundStarterCandidate = true; } } } } else { CIndividual* individual = individualItem->getIndividual(); for (CRoleAssertionLinker* roleAssLinkerIt = individual->getAssertionRoleLinker(); roleAssLinkerIt && !foundStarterCandidate; roleAssLinkerIt = roleAssLinkerIt->getNext()) { CRole* assRole = roleAssLinkerIt->getRole(); for (CSortedNegLinker* assSuperRoleIt = assRole->getIndirectSuperRoleList(); assSuperRoleIt && !foundStarterCandidate; assSuperRoleIt = assSuperRoleIt->getNext()) { CRole* assSuperRole = assSuperRoleIt->getData(); bool assSuperRoleInversed = assSuperRoleIt->isNegated(); if (!assSuperRoleInversed) { if (instancesItem->hasComplexRoleStarterCandidate(assSuperRole)) { foundStarterCandidate = true; } } } } } if (!foundStarterCandidate) { roleNeighbourHashData.mRoleSuccessorInstancesInitialized = true; reqConfPreCompItem->incInitializedRoleInstancesCount(); } else { individualItem->incInitializingRoleCandidateCount(); reqConfPreCompItem->incTestingRoleInstanceCandidatesCount(); QList markerConceptList; CConcept* propConcept = instancesItem->getTemporaryPropagationConcept(); CIndividual* indi = individualItem->getIndividual(); markerConceptList.append(instancesItem->getTemporaryMarkerConcept()); //markingCompRoleNameList.append(roleString+QString("- P:%1 - M:%2").arg(propConcept->getConceptTag()).arg(instancesItem->getTemporaryMarkerConcept()->getConceptTag())); //invMarkingCompRoleNameList.append(inverseRoleString); CSatisfiableCalculationJob* satCalcJob = nullptr; CSatisfiableCalculationJobGenerator satCalcJobGen(reqConfPreCompItem->getTemporaryRoleRealizationOntology()); satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(propConcept,false,indi); QList* compRoleInstItemList = reqConfPreCompItem->getComplexRoleInstancesItemList(); for (QList::const_iterator it = compRoleInstItemList->constBegin(), itEnd = compRoleInstItemList->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleInstancesItem* compRoleInstItem(*it); if (compRoleInstItem != instancesItem && compRoleInstItem->hasToProcessPossibleInstancesFlag()) { COptimizedKPSetRoleNeighbourInstancesHashData& compRoleNeighbourHashData = individualItem->getKnownPossibleRoleNeighboursInstancesHash()->operator[](compRoleInstItem); if (!compRoleNeighbourHashData.mRoleSuccessorInstancesInitializing) { compRoleNeighbourHashData.mRoleSuccessorInstancesInitializing = true; //QString compRoleString = CIRIName::getRecentIRIName(compRoleInstItem->getRole()->getPropertyNameLinker()); //QString complInverseRoleString; //if (compRoleInstItem->getInverseRole()) { // complInverseRoleString = CIRIName::getRecentIRIName(compRoleInstItem->getInverseRole()->getPropertyNameLinker()); //} //if (indiString == "http://www.co-ode.org/roberts/family-tree.owl#john_archer_1804" && (compRoleString == "http://www.co-ode.org/roberts/family-tree.owl#isRelationOf" || complInverseRoleString == "http://www.co-ode.org/roberts/family-tree.owl#isRelationOf")) { // bool bug = true; //} //compRoleNameList.append(compRoleString); //invCompRoleNameList.append(complInverseRoleString); if (compRoleInstItem == reqConfPreCompItem->getTopRoleInstancesItem()) { compRoleNeighbourHashData.mRoleSuccessorInstancesInitialized = true; } else { bool compRoleFoundStarterCandidate = false; if (indiNode) { CReapplyRoleSuccessorHash* roleSuccHash = indiNode->getReapplyRoleSuccessorHash(false); if (roleSuccHash) { CRoleSuccessorIterator roleSuccIt = roleSuccHash->getRoleIterator(); while (roleSuccIt.hasNext() && !compRoleFoundStarterCandidate) { CRole* compCandRole = roleSuccIt.next(); if (compRoleInstItem->hasComplexInverseRoleStarterCandidate(compCandRole)) { compRoleFoundStarterCandidate = true; } } } } else { CIndividual* individual = individualItem->getIndividual(); for (CRoleAssertionLinker* roleAssLinkerIt = individual->getAssertionRoleLinker(); roleAssLinkerIt && !foundStarterCandidate; roleAssLinkerIt = roleAssLinkerIt->getNext()) { CRole* assRole = roleAssLinkerIt->getRole(); for (CSortedNegLinker* assSuperRoleIt = assRole->getIndirectSuperRoleList(); assSuperRoleIt && !foundStarterCandidate; assSuperRoleIt = assSuperRoleIt->getNext()) { CRole* assSuperRole = assSuperRoleIt->getData(); bool assSuperRoleInversed = assSuperRoleIt->isNegated(); if (!assSuperRoleInversed) { if (compRoleInstItem->hasComplexRoleStarterCandidate(assSuperRole)) { compRoleFoundStarterCandidate = true; } } } } } if (compRoleFoundStarterCandidate) { //markingCompRoleNameList.append(compRoleString+QString("- P:%1 - M:%2").arg(compRoleInstItem->getTemporaryPropagationConcept()->getConceptTag()).arg(compRoleInstItem->getTemporaryMarkerConcept()->getConceptTag())); //invMarkingCompRoleNameList.append(complInverseRoleString); CConcept* compPropConcept = compRoleInstItem->getTemporaryPropagationConcept(); markerConceptList.append(compRoleInstItem->getTemporaryMarkerConcept()); satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(compPropConcept,false,indi,satCalcJob); } else { compRoleNeighbourHashData.mRoleSuccessorInstancesInitialized = true; } } } } } //QString compRoleNameListString = compRoleNameList.join("\r\n"); //QString invCompRoleNameListString = invCompRoleNameList.join("\r\n"); //QString markingCompRoleNameListString = markingCompRoleNameList.join("\r\n"); //QString invMarkingCompRoleNameListString = invMarkingCompRoleNameList.join("\r\n"); CIndividualRoleCandidateTestingItem* testItem = new CIndividualRoleCandidateTestingItem(reqConfPreCompItem,individualItem,markerConceptList); satCalcJob->setRealizationMarkedCandidatesMessageAdapter(new CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter(indi,reqConfPreCompItem->getOntology(),this)); satCalcJob->setCalculationConfiguration(reqConfPreCompItem->getCalculationConfiguration()); if (reqConfPreCompItem->requiresIndividualDependenceTracking()) { if (!individualItem->getIndividualDependenceTrackingCollector()) { individualItem->setIndividualDependenceTrackingCollector(new CIndividualDependenceTrackingCollector()); } } if (individualItem->getIndividualDependenceTrackingCollector()) { satCalcJob->setSatisfiableTaskIndividualDependenceTrackingAdapter(new CSatisfiableTaskIndividualDependenceTrackingAdapter(individualItem->getIndividualDependenceTrackingCollector())); } processCalculationJob(satCalcJob,reqConfPreCompItem,testItem); return true; } } } } return false; } bool COptimizedKPSetOntologyConceptRealizingThread::createIndividualsConsistencyTest(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { CSatisfiableCalculationJob* satCalcJob = nullptr; CSatisfiableCalculationJobGenerator satCalcJobGen(reqConfPreCompItem->getOntology()); CIndividualVector* indiVec = reqConfPreCompItem->getOntology()->getABox()->getIndividualVector(false); cint64 indiCount = 0; if (indiVec) { indiCount = indiVec->getItemCount(); QList indiList; for (cint64 idx = 0; idx < indiCount; ++idx) { CIndividual* indi = indiVec->getData(idx); indiList.append(indi); } CSatisfiableCalculationJobGenerator satCalcJobGen(reqConfPreCompItem->getOntology()); if (!indiList.isEmpty()) { satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(indiList); satCalcJob->setCalculationConfiguration(reqConfPreCompItem->getCalculationConfiguration()); if (reqConfPreCompItem->getPossibleAssertionCollectionSet()) { satCalcJob->setPossibleAssertionCollectionAdapter(new CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter(reqConfPreCompItem->getOntology(),reqConfPreCompItem->getPossibleAssertionCollectionSet())); } CIndividualsConsistencyTestingItem* testItem = new CIndividualsConsistencyTestingItem(reqConfPreCompItem); processCalculationJob(satCalcJob,reqConfPreCompItem,testItem); return true; } } return false; } bool COptimizedKPSetOntologyConceptRealizingThread::createNextSameIndividualsTest(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetIndividualItem* instantiatedItem1, COptimizedKPSetIndividualItem* instantiatedItem2) { instantiatedItem1->incTestingPossibleSameIndividualCount(); instantiatedItem2->incTestingPossibleSameIndividualCount(); bool temporaryNominalConcept = false; CIndividual* individual1 = instantiatedItem1->getIndividual(); CIndividual* individual2 = instantiatedItem2->getIndividual(); CConcept* nominalConcept2 = individual2->getIndividualNominalConcept(); if (!nominalConcept2) { nominalConcept2 = instantiatedItem2->getTemporaryIndividualNominalConcept(); temporaryNominalConcept = true; } CConcept* testingNominalConcept = nominalConcept2; CIndividual* testingIndividual = individual1; CIndividual* otherTestringIndividual = individual2; if (!testingNominalConcept) { testingIndividual = individual2; otherTestringIndividual = individual1; temporaryNominalConcept = false; testingNominalConcept = individual1->getIndividualNominalConcept(); if (!testingNominalConcept) { temporaryNominalConcept = true; testingNominalConcept = instantiatedItem1->getTemporaryIndividualNominalConcept(); } } if (testingNominalConcept) { CSatisfiableCalculationJob* satCalcJob = nullptr; CSatisfiableCalculationJobGenerator satCalcJobGen(reqConfPreCompItem->getOntology()); satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(testingNominalConcept,true,testingIndividual); if (temporaryNominalConcept) { satCalcJob = satCalcJobGen.getSatisfiableCalculationJob(testingNominalConcept,false,otherTestringIndividual); } satCalcJob->setCalculationConfiguration(reqConfPreCompItem->getCalculationConfiguration()); if (reqConfPreCompItem->getPossibleAssertionCollectionSet()) { satCalcJob->setPossibleAssertionCollectionAdapter(new CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter(reqConfPreCompItem->getOntology(),reqConfPreCompItem->getPossibleAssertionCollectionSet())); } if (reqConfPreCompItem->requiresIndividualDependenceTracking()) { if (!instantiatedItem1->getIndividualDependenceTrackingCollector()) { instantiatedItem1->setIndividualDependenceTrackingCollector(new CIndividualDependenceTrackingCollector()); } } if (instantiatedItem1->getIndividualDependenceTrackingCollector()) { satCalcJob->setSatisfiableTaskIndividualDependenceTrackingAdapter(new CSatisfiableTaskIndividualDependenceTrackingAdapter(instantiatedItem1->getIndividualDependenceTrackingCollector())); } CIndividualSameTestingItem* testItem = new CIndividualSameTestingItem(reqConfPreCompItem,instantiatedItem1,instantiatedItem2); reqConfPreCompItem->incTestingPossibleSameIndividualCount(); processCalculationJob(satCalcJob,reqConfPreCompItem,testItem); return true; } else { LOG(ERROR,getDomain(),logTr("Failed testing whether '%1' and '%2' are the same individuals, nominal concepts are not available.").arg(CIRIName::getRecentIRIName(individual1->getIndividualNameLinker())).arg(CIRIName::getRecentIRIName(individual2->getIndividualNameLinker())),this); return false; } } bool COptimizedKPSetOntologyConceptRealizingThread::createNextTest() { COntologyRealizingItem* loopOntPreCompItem = 0; bool workTestCreated = false; while (!workTestCreated && !mProcessingOntItemList.isEmpty()) { COntologyRealizingItem* ontPreCompItem = mProcessingOntItemList.first(); if (ontPreCompItem == loopOntPreCompItem) { // don't run into infinite loop without doing something break; } COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem = (COptimizedKPSetOntologyConceptRealizingItem*)ontPreCompItem; if (!workTestCreated && reqConfPreCompItem->isExtraConsistencyTestingStepRequired()) { if (!reqConfPreCompItem->isExtraConsistencyTesting() && !reqConfPreCompItem->isExtraConsistencyTested()) { // create consistency test if (createIndividualsConsistencyTest(reqConfPreCompItem)) { reqConfPreCompItem->setExtraConsistencyTesting(true); workTestCreated = true; } else { reqConfPreCompItem->setExtraConsistencyTested(true); } } } if (!workTestCreated && reqConfPreCompItem->isRealizeSameIndividualsStepRequired() && !reqConfPreCompItem->isExtraConsistencyTesting()) { if (!reqConfPreCompItem->isRealizeSameIndividualsStepFinished()) { if (reqConfPreCompItem->areRealizeSameIndividualsStepProcessingRequirementSatisfied()) { if (!reqConfPreCompItem->hasRealizationSameIndividualsInitialized()) { createTemporarySameRealizationOntology(reqConfPreCompItem); reqConfPreCompItem->setRealizationSameIndividualsInitialized(true); LOG(INFO,getDomain(),logTr("Realize same individuals for ontology."),this); } if (reqConfPreCompItem->hasRemainingProcessingSameIndividualsItems()) { QList* processingSameIndividualItemList = reqConfPreCompItem->getProcessingPossibleSameIndividualsItemList(); while (!workTestCreated && !processingSameIndividualItemList->isEmpty()) { COptimizedKPSetIndividualItem* nextProcessingItem = processingSameIndividualItemList->first(); if (!nextProcessingItem->isItemSameIndividualMerged()) { COptimizedKPSetIndividualItem* nextPossibleSameIndividualTestItem = nextProcessingItem->takeTestingPossibleSameIndividualItem(); if (nextPossibleSameIndividualTestItem) { nextPossibleSameIndividualTestItem->removePossibleSameIndividualItem(nextProcessingItem); if (!nextPossibleSameIndividualTestItem->isItemSameIndividualMerged()) { workTestCreated = createNextSameIndividualsTest(reqConfPreCompItem,nextProcessingItem,nextPossibleSameIndividualTestItem); } } } if (nextProcessingItem->isItemSameIndividualMerged() || !nextProcessingItem->hasPossibleSameIndividuals()) { processingSameIndividualItemList->removeFirst(); nextProcessingItem->setPossibleSameIndividualsProcessingQueuedFlag(false); } } } if (!workTestCreated && !reqConfPreCompItem->hasRemainingProcessingSameIndividualsItems()) { if (!reqConfPreCompItem->hasTestingPossibleSameIndividual()) { if (!reqConfPreCompItem->isSameRealizationInstalled()) { reqConfPreCompItem->setSameRealizationInstalled(true); CConcreteOntology* ontology = reqConfPreCompItem->getOntology(); CRealizingTestingStep* ontProcStep = reqConfPreCompItem->getRealizeSameIndividualsProcessingStep(); addRealizationStatistics(reqConfPreCompItem,ontProcStep); CRealization* realization = ontology->getRealization(); realization->setSameRealization(reqConfPreCompItem); LOG(INFO,getDomain(),logTr("Same individual realization finished for ontology."),this); } reqConfPreCompItem->getRealizeSameIndividualsProcessingStep()->setStepFinished(true); reqConfPreCompItem->getRealizeSameIndividualsProcessingStep()->submitRequirementsUpdate(); } } } else { reqConfPreCompItem->getRealizeSameIndividualsProcessingStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); } } else { reqConfPreCompItem->getRealizeSameIndividualsProcessingStep()->submitRequirementsUpdate(); } } if (!workTestCreated && reqConfPreCompItem->isRealizeConceptStepRequired() && !reqConfPreCompItem->isExtraConsistencyTesting()) { if (!reqConfPreCompItem->isRealizeConceptStepFinished()) { if (reqConfPreCompItem->areRealizeConceptStepProcessingRequirementSatisfied()) { if (!reqConfPreCompItem->hasRealizationConceptsInitialized()) { if (!reqConfPreCompItem->isCountingPossibleConceptInstancesTesting()) { mOpenPossibleInstancesCount += reqConfPreCompItem->getOpenPossibleConceptInstancesCount(); mTestedPossibleInstancesCount += reqConfPreCompItem->getTestedPossibleConceptInstancesCount(); reqConfPreCompItem->setCountingPossibleConceptInstancesTesting(true); } reqConfPreCompItem->setRealizationConceptsInitialized(true); LOG(INFO,getDomain(),logTr("Realize individual types for ontology."),this); } if (reqConfPreCompItem->hasRemainingProcessingConceptInstanceItems()) { QList* processingInstancesItemList = reqConfPreCompItem->getProcessingPossibleConceptInstancesItemList(); while (!workTestCreated && !processingInstancesItemList->isEmpty()) { COptimizedKPSetConceptInstancesItem* nextProcessingItem = processingInstancesItemList->first(); if (nextProcessingItem->hasPossibleInstances()) { COptimizedKPSetIndividualItem* nextInstantiatedTestItem = nextProcessingItem->takeNextTestingPossibleInstance(); if (!nextInstantiatedTestItem->isItemSameIndividualMerged()) { workTestCreated = createNextConceptInstantiationTest(reqConfPreCompItem,nextProcessingItem,nextInstantiatedTestItem); } else { incTestedPossibleConceptInstancesCount(reqConfPreCompItem); } } if (!nextProcessingItem->hasPossibleInstances()) { processingInstancesItemList->removeFirst(); nextProcessingItem->setPossibleInstancesProcessingQueuedFlag(false); } } } if (!workTestCreated && !reqConfPreCompItem->hasRemainingProcessingConceptInstanceItems()) { if (!reqConfPreCompItem->hasTestingPossibleConceptInstances()) { if (!reqConfPreCompItem->isConceptRealizationInstalled()) { reqConfPreCompItem->setConceptRealizationInstalled(true); CConcreteOntology* ontology = reqConfPreCompItem->getOntology(); CRealizingTestingStep* ontProcStep = reqConfPreCompItem->getRealizeConceptProcessingStep(); addRealizationStatistics(reqConfPreCompItem,ontProcStep); CRealization* realization = ontology->getRealization(); realization->setConceptRealization(reqConfPreCompItem); LOG(INFO,getDomain(),logTr("Concept realization finished for ontology."),this); } reqConfPreCompItem->getRealizeConceptProcessingStep()->setStepFinished(true); reqConfPreCompItem->getRealizeConceptProcessingStep()->submitRequirementsUpdate(); } } } else { reqConfPreCompItem->getRealizeConceptProcessingStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); } } else { reqConfPreCompItem->getRealizeConceptProcessingStep()->submitRequirementsUpdate(); } } if (!workTestCreated && reqConfPreCompItem->isRealizeRoleStepRequired() && !reqConfPreCompItem->isExtraConsistencyTesting()) { if (!reqConfPreCompItem->isRealizeRoleStepFinished()) { if (reqConfPreCompItem->areRealizeRoleStepProcessingRequirementSatisfied()) { if (!reqConfPreCompItem->hasRealizationRolesInitialized()) { LOG(INFO,getDomain(),logTr("Create temporary ontology extension for role realization."),this); createTemporaryRoleRealizationOntology(reqConfPreCompItem); reqConfPreCompItem->initRoleCandidateInitializingIndividualItems(); reqConfPreCompItem->setRealizationRolesInitialized(true); if (!reqConfPreCompItem->isCountingPossibleRoleInstancesTesting()) { mOpenPossibleInstancesCount += reqConfPreCompItem->getOpenPossibleRoleInstancesCount(); mTestedPossibleInstancesCount += reqConfPreCompItem->getTestedPossibleRoleInstancesCount(); reqConfPreCompItem->setCountingPossibleRoleInstancesTesting(true); } LOG(INFO,getDomain(),logTr("Realizing role instances for ontology."),this); } if (reqConfPreCompItem->hasRemainingInitializingRoleInstanceItems()) { QList* initializingInstancesItemList = reqConfPreCompItem->getInitializingRoleInstancesItemList(); while (!workTestCreated && !initializingInstancesItemList->isEmpty()) { COptimizedKPSetRoleInstancesItem* nextInitializingItem = initializingInstancesItemList->first(); if (!nextInitializingItem->isCandidateSuccessorInitializationCompleted()) { if (!nextInitializingItem->isCandidateSuccessorInitializationStarted()) { nextInitializingItem->addRemainingCandidateInitializationSuccessors(reqConfPreCompItem->getRoleCandidateInitalizingIndividualsItemList()); nextInitializingItem->setUninitializedSuccessorItemCount(reqConfPreCompItem->getRoleCandidateInitalizingIndividualsItemList()->count()); nextInitializingItem->setCandidateSuccessorInitializationStarted(true); } COptimizedKPSetIndividualItem* indiItem = nextInitializingItem->takeNextRemainingCandidateInitializationSuccessor(); if (!indiItem->isItemSameIndividualMerged()) { workTestCreated = createNextRoleInitializingTest(reqConfPreCompItem,nextInitializingItem,indiItem); } } if (nextInitializingItem->isCandidateSuccessorInitializationCompleted()) { initializingInstancesItemList->removeFirst(); } } } if (reqConfPreCompItem->hasRemainingInitializingRoleInstanceIndividualItems()) { QList* initializingIndividualItemList = reqConfPreCompItem->getInitializingRoleInstancesIndividualItemList(); while (!workTestCreated && !initializingIndividualItemList->isEmpty()) { COptimizedKPSetIndividualItem* nextInitializingItem = initializingIndividualItemList->first(); if (!nextInitializingItem->hasAllRoleCandidatesInitializedFlag()) { if (!nextInitializingItem->isItemSameIndividualMerged()) { workTestCreated = createNextRoleInitializingTest(reqConfPreCompItem,nextInitializingItem); } } if (nextInitializingItem->hasAllRoleCandidatesInitializedFlag()) { initializingIndividualItemList->removeFirst(); } } } if (reqConfPreCompItem->hasRemainingProcessingRoleInstanceItems()) { QList* processingInstancesItemList = reqConfPreCompItem->getProcessingPossibleRoleInstancesItemList(); while (!workTestCreated && !processingInstancesItemList->isEmpty()) { COptimizedKPSetRoleInstancesItem* nextProcessingItem = processingInstancesItemList->first(); if (nextProcessingItem->hasPossibleInstances()) { COptimizedKPSetIndividualItemPair nextTestItemPair = nextProcessingItem->takeNextTestingPossibleInstance(); COptimizedKPSetIndividualItem* firstIndiItem = nextTestItemPair.first; COptimizedKPSetIndividualItem* secondIndiItem = nextTestItemPair.second; if (!firstIndiItem->isItemSameIndividualMerged()) { workTestCreated = createNextRoleInstantiationTest(reqConfPreCompItem,nextProcessingItem,nextTestItemPair); } else { incTestedPossibleRoleInstancesCount(reqConfPreCompItem); } } if (!nextProcessingItem->hasPossibleInstances()) { processingInstancesItemList->removeFirst(); nextProcessingItem->setPossibleInstancesProcessingQueuedFlag(false); } } } if (!workTestCreated && !reqConfPreCompItem->hasRemainingInitializingRoleInstanceItems() && !reqConfPreCompItem->hasRemainingProcessingRoleInstanceItems() && !reqConfPreCompItem->hasRemainingInitializingRoleInstanceIndividualItems()) { if (!reqConfPreCompItem->hasTestingPossibleRoleInstances() && !reqConfPreCompItem->hasTestingRoleInstanceCandidates()) { if (!reqConfPreCompItem->isRoleRealizationInstalled()) { reqConfPreCompItem->setRoleRealizationInstalled(true); CConcreteOntology* ontology = reqConfPreCompItem->getOntology(); CRealization* realization = ontology->getRealization(); realization->setRoleRealization(reqConfPreCompItem); LOG(INFO,getDomain(),logTr("Role realization finished for ontology."),this); } reqConfPreCompItem->getRealizeRoleProcessingStep()->setStepFinished(true); reqConfPreCompItem->getRealizeRoleProcessingStep()->submitRequirementsUpdate(); } } } else { reqConfPreCompItem->getRealizeRoleProcessingStep()->submitRequirementsUpdate(COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSFAILEDREQUIREMENT); } } else { reqConfPreCompItem->getRealizeRoleProcessingStep()->submitRequirementsUpdate(); } } if (!workTestCreated) { if (!reqConfPreCompItem->hasRemainingProcessingRequirements()) { finishOntologyRealizing(reqConfPreCompItem); mProcessingOntItemList.removeFirst(); } else { mProcessingOntItemList.removeFirst(); mProcessingOntItemList.append(reqConfPreCompItem); loopOntPreCompItem = ontPreCompItem; } } } return workTestCreated; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::addRealizationStatistics(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, CRealizingTestingStep* ontProcStep) { COntologyProcessingStatistics* ontProcStats = ontProcStep->getProcessingStepData()->getProcessingStatistics(true); ontProcStats->setProcessingCountStatisticValue("realization-time",reqConfPreCompItem->getInitializationTime()->elapsed()); if (reqConfPreCompItem->getRealizeConceptProcessingStep() == ontProcStep) { ontProcStats->setProcessingCountStatisticValue("realization-concept-instances-possible-testing-count",reqConfPreCompItem->getTestedPossibleConceptInstancesCount()); addIndividualDependencyTrackingStatistics(reqConfPreCompItem,ontProcStep,"realization-concept-instances"); ontProcStats->setProcessingCountStatisticValue("realization-concept-instances-time",reqConfPreCompItem->getInitializationTime()->elapsed()); } else if (reqConfPreCompItem->getRealizeSameIndividualsProcessingStep() == ontProcStep) { addIndividualDependencyTrackingStatistics(reqConfPreCompItem,ontProcStep,"realization-same-individuals"); ontProcStats->setProcessingCountStatisticValue("realization-same-individuals-possible-testing-count",reqConfPreCompItem->getTestedPossibleSameIndividualsCount()); } return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::addIndividualDependencyTrackingStatistics(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, CRealizingTestingStep* ontProcStep, const QString& realizationTypeString) { if (reqConfPreCompItem->requiresIndividualDependenceTracking()) { COntologyProcessingStatistics* ontProcStats = ontProcStep->getProcessingStepData()->getProcessingStatistics(true); cint64 dependencyCount = 0; cint64 dependencySize = 0; for (QList::const_iterator indiItemIt = reqConfPreCompItem->getInstantiatedItemList()->constBegin(), indiItemItEnd = reqConfPreCompItem->getInstantiatedItemList()->constEnd(); indiItemIt != indiItemItEnd; ++indiItemIt) { COptimizedKPSetIndividualItem* indiItem = (*indiItemIt); if (indiItem->getIndividualDependenceTrackingCollector()) { CIndividualDependenceTracking* indiDepTack = indiItem->getIndividualDependenceTrackingCollector()->getExtendingIndividualDependenceTracking(); if (indiDepTack) { dependencySize += indiDepTack->getDependenceSize(); ++dependencyCount; } } } ontProcStats->setProcessingCountStatisticValue(QString("%1-tracked-node-dependency-size").arg(realizationTypeString),dependencySize); ontProcStats->setProcessingCountStatisticValue(QString("%1-tracked-node-dependency-count").arg(realizationTypeString),dependencyCount); } return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::createTemporarySameRealizationOntology(COptimizedKPSetOntologyConceptRealizingItem* item) { CConcreteOntology* ontology = item->getOntology(); CConcreteOntology* tmpSameRealOntology = item->getTemporarySameRealizationOntology(); if (!tmpSameRealOntology) { QList indiItemNominalCreationList; QList* possibleSameIndiItemList = item->getPossibleSameIndividualsItemList(); if (possibleSameIndiItemList && !possibleSameIndiItemList->isEmpty()) { for (QList::const_iterator it = possibleSameIndiItemList->constBegin(), itEnd = possibleSameIndiItemList->constEnd(); it != itEnd; ++it) { COptimizedKPSetIndividualItem* indiItem(*it); CIndividual* indi = indiItem->getIndividual(); if (indi->getIndividualNominalConcept() == nullptr) { indiItemNominalCreationList.append(indiItem); } } } if (!indiItemNominalCreationList.isEmpty()) { tmpSameRealOntology = new CConcreteOntology(ontology,ontology->getConfiguration()); tmpSameRealOntology->setConsistence(ontology->getConsistence()); item->setTemporarySameRealizationOntology(tmpSameRealOntology); for (QList::const_iterator it = indiItemNominalCreationList.constBegin(), itEnd = indiItemNominalCreationList.constEnd(); it != itEnd; ++it) { COptimizedKPSetIndividualItem* indiItem(*it); CIndividual* indi = indiItem->getIndividual(); CConcept* nominalConcept = createTemporaryConcept(item,tmpSameRealOntology); nominalConcept->setNominalIndividual(indi); nominalConcept->setOperatorCode(CCNOMINAL); indiItem->setTemporaryIndividualNominalConcept(nominalConcept); } } else { item->setTemporarySameRealizationOntology(ontology); } } return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::createTemporaryRoleRealizationOntology(COptimizedKPSetOntologyConceptRealizingItem* item) { CConcreteOntology* ontology = item->getOntology(); CConcreteOntology* tmpRoleRealOntology = item->getTemporaryRoleRealizationOntology(); if (!tmpRoleRealOntology) { tmpRoleRealOntology = new CConcreteOntology(ontology,ontology->getConfiguration()); QSet compTransformConceptSet; QHash* markerConRolInsItemHash = item->getMarkerConceptInstancesItemHash(); COptimizedKPSetRoleInstancesItem* topRoleInstItem = item->getTopRoleInstancesItem(); QList* roleItemList = item->getRoleInstancesItemList(); for (QList::const_iterator itemIt = roleItemList->constBegin(), itemItEnd = roleItemList->constEnd(); itemIt != itemItEnd; ++itemIt) { COptimizedKPSetRoleInstancesItem* roleItem(*itemIt); if (roleItem != topRoleInstItem) { CRole* role = roleItem->getRole(); CConcept* markerConcept = createTemporaryConcept(item,tmpRoleRealOntology); markerConcept->setOperatorCode(CCMARKER); CConcept* propConcept = createTemporaryConcept(item,tmpRoleRealOntology); propConcept->setOperatorCode(CCALL); propConcept->setRole(role); addTemporaryConceptOperand(propConcept,markerConcept,false,item,tmpRoleRealOntology); roleItem->setTemporaryMarkerConcept(markerConcept); markerConRolInsItemHash->insert(markerConcept,roleItem); roleItem->setTemporaryPropagationConcept(propConcept); if (role->isComplexRole()) { compTransformConceptSet.insert(propConcept); } if (roleItem->hasInverseRole()) { CRole* invRole = roleItem->getInverseRole(); CConcept* invMarkerConcept = createTemporaryConcept(item,tmpRoleRealOntology); invMarkerConcept->setOperatorCode(CCMARKER); CConcept* invPropConcept = createTemporaryConcept(item,tmpRoleRealOntology); invPropConcept->setOperatorCode(CCALL); invPropConcept->setRole(role); addTemporaryConceptOperand(invPropConcept,invMarkerConcept,false,item,tmpRoleRealOntology); markerConRolInsItemHash->insert(invMarkerConcept,roleItem); roleItem->setTemporaryInverseMarkerConcept(invMarkerConcept); roleItem->setTemporaryInversePropagationConcept(invPropConcept); if (invRole->isComplexRole()) { compTransformConceptSet.insert(invPropConcept); } } } } if (!compTransformConceptSet.isEmpty()) { CPreProcessContextBase* preprocessContext = new CPreProcessContextBase(tmpRoleRealOntology,ontology->getConfiguration()); CRoleChainAutomataTransformationPreProcess* roleChainAutomataTransformPreprocessor = new CRoleChainAutomataTransformationPreProcess(); roleChainAutomataTransformPreprocessor->preprocess(tmpRoleRealOntology,&compTransformConceptSet,preprocessContext); delete preprocessContext; delete roleChainAutomataTransformPreprocessor; } tmpRoleRealOntology->setConsistence(ontology->getConsistence()); item->setTemporaryRoleRealizationOntology(tmpRoleRealOntology); } return this; } CConcept* COptimizedKPSetOntologyConceptRealizingThread::createTemporaryConcept(COptimizedKPSetOntologyConceptRealizingItem* item, CConcreteOntology* tmpRoleRealOntology) { CConceptVector* conVec = tmpRoleRealOntology->getTBox()->getConceptVector(); CConcept* concept = CObjectAllocator< CConcept >::allocateAndConstruct(tmpRoleRealOntology->getOntologyContext()->getMemoryAllocationManager()); concept->initConcept(); concept->setConceptTag(conVec->getItemCount()); conVec->setData(concept->getConceptTag(),concept); return concept; } void COptimizedKPSetOntologyConceptRealizingThread::addTemporaryConceptOperand(CConcept* concept, CConcept* opConcept, bool negated, COptimizedKPSetOntologyConceptRealizingItem* item, CConcreteOntology* tmpRoleRealOntology) { CSortedNegLinker* opConLinker = CObjectAllocator< CSortedNegLinker >::allocateAndConstruct(tmpRoleRealOntology->getOntologyContext()->getMemoryAllocationManager()); opConLinker->init(opConcept,negated); concept->addOperandLinker(opConLinker); concept->incOperandCount(); } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::updateCalculatedKnownConceptInstance(COptimizedKPSetIndividualItem* instantiatedItem, COptimizedKPSetConceptInstancesItem* instancesItem, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { COptimizedKPSetConceptInstancesHash* knownPossibleInstancesHash = instantiatedItem->getKnownPossibleInstancesHash(); COptimizedKPSetConceptInstancesData* instanceItemData = knownPossibleInstancesHash->getInstanceItemData(instancesItem); QList updateItemList; if (!instanceItemData->mKnownInstance) { instancesItem->addKnownInstance(instantiatedItem); instanceItemData->mKnownInstance = true; instanceItemData->mPossibleInstance = false; instanceItemData->mMostSpecific = true; instanceItemData->mTestedInstance = true; updateItemList.append(*instancesItem->getParentItemList()); } while (!updateItemList.isEmpty()) { COptimizedKPSetConceptInstancesItem* updateInstanceItem = updateItemList.takeFirst(); COptimizedKPSetConceptInstancesData* updateInstanceItemData = knownPossibleInstancesHash->getInstanceItemData(updateInstanceItem); if (!updateInstanceItemData->mKnownInstance) { updateInstanceItemData->mKnownInstance = true; updateInstanceItemData->mPossibleInstance = false; updateInstanceItemData->mMostSpecific = false; updateInstanceItemData->mDerived = true; updateItemList.append(*updateInstanceItem->getParentItemList()); } else if (updateInstanceItemData->mMostSpecific) { updateInstanceItem->removeKnownInstance(instantiatedItem); updateInstanceItemData->mMostSpecific = false; } } return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::updateCalculatedNonConceptInstance(COptimizedKPSetIndividualItem* instantiatedItem, COptimizedKPSetConceptInstancesItem* instancesItem, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { COptimizedKPSetConceptInstancesHash* knownPossibleInstancesHash = instantiatedItem->getKnownPossibleInstancesHash(); COptimizedKPSetConceptInstancesData* instanceItemData = knownPossibleInstancesHash->getInstanceItemData(instancesItem); QList updateItemList; if (!instanceItemData->mKnownInstance) { if (instanceItemData->mPossibleInstance) { instanceItemData->mPossibleInstance = false; instanceItemData->mTestedInstance = true; updateItemList.append(*instancesItem->getParentItemList()); } } while (!updateItemList.isEmpty()) { COptimizedKPSetConceptInstancesItem* updateInstanceItem = updateItemList.takeFirst(); COptimizedKPSetConceptInstancesData* updateInstanceItemData = knownPossibleInstancesHash->getInstanceItemData(updateInstanceItem); if (!updateInstanceItemData->mKnownInstance) { if (updateInstanceItemData->mPossibleInstance) { if (!updateInstanceItemData->mMostSpecific && !updateInstanceItemData->mTestingInstance) { updateInstanceItemData->mMostSpecific = true; incOpenPossibleConceptInstancesCount(reqConfPreCompItem); instantiatedItem->incPossibleInstantiatedCount(); updateInstanceItem->addPossibleInstance(instantiatedItem); if (updateInstanceItem->hasToProcessPossibleInstancesFlag()) { reqConfPreCompItem->addConceptInstanceItemToProcessPossibleInstances(updateInstanceItem); } } } } } return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::updateCalculatedKnownRoleInstance(COptimizedKPSetIndividualItemPair individualItemPair, COptimizedKPSetRoleInstancesItem* instancesItem, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { COptimizedKPSetIndividualItem* indiItem1 = individualItemPair.first; COptimizedKPSetIndividualItem* indiItem2 = individualItemPair.second; COptimizedKPSetRoleNeighbourInstancesHash* knownPossibleRoleNeighbourInstancesHash = indiItem1->getKnownPossibleRoleNeighboursInstancesHash(); COptimizedKPSetRoleInstancesData* instanceItemData = knownPossibleRoleNeighbourInstancesHash->getRoleSuccessorInstanceItemData(instancesItem,indiItem2); QList updateItemList; if (!instanceItemData->mKnownInstance) { instancesItem->addKnownInstance(COptimizedKPSetIndividualItemPair(indiItem1,indiItem2)); instanceItemData->mKnownInstance = true; instanceItemData->mPossibleInstance = false; instanceItemData->mMostSpecific = true; instanceItemData->mTestedInstance = true; updateItemList.append(*instancesItem->getParentItemList()); } while (!updateItemList.isEmpty()) { TRoleItemInversionPair updateInstanceItemInversionPair = updateItemList.takeFirst(); COptimizedKPSetRoleInstancesItem* updateInstanceItem = updateInstanceItemInversionPair.first; if (updateInstanceItem != reqConfPreCompItem->getTopRoleInstancesItem()) { bool updateInstanceItemInversion = updateInstanceItemInversionPair.second; COptimizedKPSetRoleInstancesData* updateInstanceItemData = nullptr; if (!updateInstanceItemInversion) { updateInstanceItemData = knownPossibleRoleNeighbourInstancesHash->getRoleSuccessorInstanceItemData(updateInstanceItem,indiItem2); } else { updateInstanceItemData = knownPossibleRoleNeighbourInstancesHash->getRolePredecessorInstanceItemData(updateInstanceItem,indiItem2); } if (!updateInstanceItemData->mKnownInstance) { updateInstanceItemData->mKnownInstance = true; updateInstanceItemData->mPossibleInstance = false; updateInstanceItemData->mMostSpecific = false; updateInstanceItemData->mDerived = true; updateItemList.append(*updateInstanceItem->getParentItemList()); } else if (updateInstanceItemData->mMostSpecific) { updateInstanceItem->removeKnownInstance(COptimizedKPSetIndividualItemPair(indiItem1,indiItem2)); updateInstanceItemData->mMostSpecific = false; } } } return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::updateCalculatedNonRoleInstance(COptimizedKPSetIndividualItemPair individualItemPair, COptimizedKPSetRoleInstancesItem* instancesItem, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { COptimizedKPSetIndividualItem* indiItem1 = individualItemPair.first; COptimizedKPSetIndividualItem* indiItem2 = individualItemPair.second; COptimizedKPSetRoleNeighbourInstancesHash* knownPossibleRoleNeighbourInstancesHash = indiItem1->getKnownPossibleRoleNeighboursInstancesHash(); COptimizedKPSetRoleInstancesData* instanceItemData = knownPossibleRoleNeighbourInstancesHash->getRoleSuccessorInstanceItemData(instancesItem,indiItem2); QList updateItemList; if (!instanceItemData->mKnownInstance) { if (instanceItemData->mPossibleInstance) { instanceItemData->mPossibleInstance = false; instanceItemData->mTestedInstance = true; updateItemList.append(*instancesItem->getParentItemList()); } } while (!updateItemList.isEmpty()) { TRoleItemInversionPair updateInstanceItemInversionPair = updateItemList.takeFirst(); COptimizedKPSetRoleInstancesItem* updateInstanceItem = updateInstanceItemInversionPair.first; if (updateInstanceItem != reqConfPreCompItem->getTopRoleInstancesItem()) { bool updateInstanceItemInversion = updateInstanceItemInversionPair.second; COptimizedKPSetRoleInstancesData* updateInstanceItemData = nullptr; if (!updateInstanceItemInversion) { updateInstanceItemData = knownPossibleRoleNeighbourInstancesHash->getRoleSuccessorInstanceItemData(updateInstanceItem,indiItem2); } else { updateInstanceItemData = knownPossibleRoleNeighbourInstancesHash->getRolePredecessorInstanceItemData(updateInstanceItem,indiItem2); } if (!updateInstanceItemData->mKnownInstance) { if (updateInstanceItemData->mPossibleInstance) { if (!updateInstanceItemData->mMostSpecific && !updateInstanceItemData->mTestingInstance) { updateInstanceItemData->mMostSpecific = true; incOpenPossibleRoleInstancesCount(reqConfPreCompItem); indiItem1->incPossibleRoleInstantiatedCount(); indiItem2->incPossibleRoleInstantiatedCount(); if (!updateInstanceItemInversion) { updateInstanceItem->addPossibleInstance(COptimizedKPSetIndividualItemPair(indiItem1,indiItem2)); } else { updateInstanceItem->addPossibleInstance(COptimizedKPSetIndividualItemPair(indiItem2,indiItem1)); } if (updateInstanceItem->hasToProcessPossibleInstancesFlag()) { reqConfPreCompItem->addRoleInstanceItemToProcessPossibleInstances(updateInstanceItem); } } } } } } return this; } bool COptimizedKPSetOntologyConceptRealizingThread::realizingTested(COntologyRealizingItem* ontPreCompItem, CRealizingTestingItem* preTestItem, CRealizingCalculatedCallbackEvent* pcce) { COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem = (COptimizedKPSetOntologyConceptRealizingItem*)ontPreCompItem; CIndividualRoleCandidateTestingItem* indiRoleCandTestItem = dynamic_cast(preTestItem); if (indiRoleCandTestItem) { reqConfPreCompItem->decTestingRoleInstanceCandidatesCount(); COptimizedKPSetIndividualItem* individualItem = indiRoleCandTestItem->getInstantiatedItem(); QList* markerConceptList = indiRoleCandTestItem->getMarkerConceptList(); QHash* markerConRolInsItemHash = reqConfPreCompItem->getMarkerConceptInstancesItemHash(); for (QList::const_iterator markerIt = markerConceptList->constBegin(), markerItEnd = markerConceptList->constEnd(); markerIt != markerItEnd; ++markerIt) { CConcept* markerConcept(*markerIt); COptimizedKPSetRoleInstancesItem* roleInstItem = markerConRolInsItemHash->value(markerConcept); bool inversed = false; if (roleInstItem->getTemporaryInverseMarkerConcept() == markerConcept) { inversed = true; } COptimizedKPSetRoleNeighbourInstancesHashData& roleNeighbourHashData = individualItem->getKnownPossibleRoleNeighboursInstancesHash()->operator[](roleInstItem); if (inversed) { roleNeighbourHashData.mRolePredecessorInstancesInitialized = true; } else { roleNeighbourHashData.mRoleSuccessorInstancesInitialized = true; } } individualItem->decInitializingRoleCandidateCount(); return true; } CIndividualConceptInstanceTestingItem* indiConInstTestItem = dynamic_cast(preTestItem); if (indiConInstTestItem) { bool isIndividualInstance = !pcce->getTestResultSatisfiable(); COptimizedKPSetConceptInstancesItem* instancesItem = indiConInstTestItem->getInstancesItem(); COptimizedKPSetIndividualItem* instantiatedItem = indiConInstTestItem->getInstantiatedItem(); instancesItem->decTestingPossibleInstancesCount(); instantiatedItem->decTestingPossibleInstantiatedCount(); reqConfPreCompItem->decTestingPossibleConceptInstanceCount(); incTestedPossibleConceptInstancesCount(reqConfPreCompItem); if (!instantiatedItem->isItemSameIndividualMerged()) { if (isIndividualInstance) { updateCalculatedKnownConceptInstance(instantiatedItem,instancesItem,reqConfPreCompItem); } else { updateCalculatedNonConceptInstance(instantiatedItem,instancesItem,reqConfPreCompItem); } } if (!instancesItem->hasTestingPossibleInstances() && !instancesItem->hasPossibleInstances()) { if (instancesItem->hasAllSuccessorProcessedFlag()) { instancesItem->setSelfSuccessorProcessedFlag(true); updateParentItemsSuccessorProcessed(instancesItem); } } delete indiConInstTestItem; return true; } CIndividualPairRoleInstanceTestingItem* indiPairRoleInstTestItem = dynamic_cast(preTestItem); if (indiPairRoleInstTestItem) { bool isIndividualPairInstance = !pcce->getTestResultSatisfiable(); COptimizedKPSetRoleInstancesItem* instancesItem = indiPairRoleInstTestItem->getInstancesItem(); COptimizedKPSetIndividualItemPair indiItemPair = indiPairRoleInstTestItem->getIndividualItemPair(); COptimizedKPSetIndividualItem* indiItem1 = indiItemPair.first; COptimizedKPSetIndividualItem* indiItem2 = indiItemPair.second; instancesItem->decTestingPossibleInstancesCount(); indiItem1->decTestingPossibleRoleInstantiatedCount(); indiItem2->decTestingPossibleRoleInstantiatedCount(); reqConfPreCompItem->decTestingPossibleRoleInstanceCount(); incTestedPossibleRoleInstancesCount(reqConfPreCompItem); if (!indiItem1->isItemSameIndividualMerged() && !indiItem2->isItemSameIndividualMerged()) { if (isIndividualPairInstance) { updateCalculatedKnownRoleInstance(indiItemPair,instancesItem,reqConfPreCompItem); } else { updateCalculatedNonRoleInstance(indiItemPair,instancesItem,reqConfPreCompItem); } } if (!instancesItem->hasTestingPossibleInstances() && !instancesItem->hasPossibleInstances()) { if (instancesItem->hasAllSuccessorProcessedFlag()) { instancesItem->setSelfSuccessorProcessedFlag(true); updateParentItemsSuccessorProcessed(instancesItem); } } delete indiPairRoleInstTestItem; return true; } CIndividualSameTestingItem* indiSameTestItem = dynamic_cast(preTestItem); if (indiSameTestItem) { bool isIndividualSame = !pcce->getTestResultSatisfiable(); COptimizedKPSetIndividualItem* instantiatedItem1 = indiSameTestItem->getInstantiatedItem1(); COptimizedKPSetIndividualItem* instantiatedItem2 = indiSameTestItem->getInstantiatedItem2(); incTestedPossibleSameIndividualsCount(reqConfPreCompItem); instantiatedItem1->decTestingPossibleSameIndividualCount(); instantiatedItem2->decTestingPossibleSameIndividualCount(); reqConfPreCompItem->decTestingPossibleSameIndividualCount(); if (isIndividualSame) { if (!instantiatedItem1->isItemSameIndividualMerged() && !instantiatedItem2->isItemSameIndividualMerged()) { mergeSameIndividualItems(instantiatedItem1,instantiatedItem2,reqConfPreCompItem); } } delete indiSameTestItem; return true; } CIndividualsConsistencyTestingItem* indiConsTest = dynamic_cast(preTestItem); if (indiConsTest) { reqConfPreCompItem->setExtraConsistencyTested(true); reqConfPreCompItem->setExtraConsistencyTesting(false); } return false; } bool COptimizedKPSetOntologyConceptRealizingThread::processRealizationMessage(COntologyRealizingItem* ontRealItem, CRealizationMessageData* messageData, CMemoryPool* memoryPools) { COptimizedKPSetOntologyConceptRealizingItem* realItem = (COptimizedKPSetOntologyConceptRealizingItem*)ontRealItem; for (CRealizationMessageData* messageDataIt = messageData; messageDataIt; messageDataIt = messageDataIt->getNext()) { if (messageDataIt->getRealizationMessageDataType() == CRealizationMessageData::TELLREALIZATIONMARKERCANDIDATES) { CRealizationMarkerCandidatesMessageData* rmcmd = (CRealizationMarkerCandidatesMessageData*)messageDataIt; CIndividual* individual = rmcmd->getIndividual(); CConcept* markerConcept = rmcmd->getMarkerConcept(); QHash* markerConRolInsItemHash = realItem->getMarkerConceptInstancesItemHash(); COptimizedKPSetRoleInstancesItem* roleInstItem = markerConRolInsItemHash->value(markerConcept); bool inversed = false; if (roleInstItem->getTemporaryInverseMarkerConcept() == markerConcept) { inversed = true; } COptimizedKPSetIndividualItem* individualItem = realItem->getIndividualInstantiatedItem(individual,false); CXLinker* detIndiLinker = rmcmd->getDeterministicIndividualLinker(); for (CXLinker* detIndiLinkerIt = detIndiLinker; detIndiLinkerIt; detIndiLinkerIt = detIndiLinkerIt->getNext()) { CIndividual* candIndi = detIndiLinkerIt->getData(); COptimizedKPSetIndividualItem* candIndividualItem = realItem->getIndividualInstantiatedItem(candIndi,false); addKPSetDirectSuperInstances(realItem,roleInstItem,inversed,individualItem,candIndividualItem,true); } CXLinker* ndetIndiLinker = rmcmd->getNondeterministicIndividualLinker(); for (CXLinker* ndetIndiLinkerIt = ndetIndiLinker; ndetIndiLinkerIt; ndetIndiLinkerIt = ndetIndiLinkerIt->getNext()) { CIndividual* candIndi = ndetIndiLinkerIt->getData(); COptimizedKPSetIndividualItem* candIndividualItem = realItem->getIndividualInstantiatedItem(candIndi,false); addKPSetDirectSuperInstances(realItem,roleInstItem,inversed,individualItem,candIndividualItem,false); } COptimizedKPSetRoleNeighbourInstancesHashData& roleNeighbourHashData = individualItem->getKnownPossibleRoleNeighboursInstancesHash()->operator[](roleInstItem); if (inversed) { roleNeighbourHashData.mRolePredecessorInstancesInitialized = true; } else { roleNeighbourHashData.mRoleSuccessorInstancesInitialized = true; } realItem->incInitializedRoleInstancesCount(); } } return true; } bool COptimizedKPSetOntologyConceptRealizingThread::addKPSetDirectSuperInstances(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetRoleInstancesItem* roleInstItem, bool inversed, COptimizedKPSetIndividualItem* indiItem1, COptimizedKPSetIndividualItem* indiItem2, bool knownInstance) { QList tmpInstancesList; COptimizedKPSetIndividualItem* succIndiItem = indiItem1; COptimizedKPSetIndividualItem* precIndiItem = indiItem2; COptimizedKPSetRoleInstancesHash* succNeighbourHash = nullptr; COptimizedKPSetRoleInstancesHash* precNeighbourHash = nullptr; if (inversed) { succIndiItem = indiItem2; precIndiItem = indiItem1; } //QString indi1String = CIRIName::getRecentIRIName(indiItem1->getIndividual()->getIndividualNameLinker()); //QString indi2String = CIRIName::getRecentIRIName(indiItem2->getIndividual()->getIndividualNameLinker()); //QString roleString = CIRIName::getRecentIRIName(roleInstItem->getRole()->getPropertyNameLinker()); //QString inverseRoleString; //if (roleInstItem->getInverseRole()) { // inverseRoleString = CIRIName::getRecentIRIName(roleInstItem->getInverseRole()->getPropertyNameLinker()); //} //if (indi2String == "file:/Users/liebig/Ontologien/reasoner-eval/30.owl#Act5") { // if ((roleString == "file:/Users/liebig/Ontologien/reasoner-eval/30.owl#inv-first")) { // bool bug = true; // } //} //if (indi2String == "http://www.co-ode.org/roberts/family-tree.owl#john_archer_1804" && indi1String == "http://www.co-ode.org/roberts/family-tree.owl#john_archer_1804") { // if ((roleString == "http://www.co-ode.org/roberts/family-tree.owl#isFatherOf" || inverseRoleString == "http://www.co-ode.org/roberts/family-tree.owl#isFatherOf")) { // bool bug = true; // } //} COptimizedKPSetRoleNeighbourInstancesHashData& succRoleNeighbourData = succIndiItem->getKnownPossibleRoleNeighboursInstancesHash()->operator[](roleInstItem); succNeighbourHash = succRoleNeighbourData.getRoleSuccessorInstancesHash(true); COptimizedKPSetRoleInstancesHashData& succHashData = (*succNeighbourHash)[precIndiItem]; //if (indi1String == "http://www.co-ode.org/roberts/family-tree.owl#john_archer_1804") { // if ((roleString == "http://www.co-ode.org/roberts/family-tree.owl#isFatherOf" || inverseRoleString == "http://www.co-ode.org/roberts/family-tree.owl#isFatherOf")) { // if (succNeighbourHash->size() >= 10) { // bool bug = true; // } // } //} if (succHashData.mInstanceItemData == nullptr) { COptimizedKPSetRoleNeighbourInstancesHashData& precRoleNeighbourData = precIndiItem->getKnownPossibleRoleNeighboursInstancesHash()->operator[](roleInstItem); precNeighbourHash = precRoleNeighbourData.getRolePredecessorInstancesHash(true); COptimizedKPSetRoleInstancesHashData& precHashData = (*precNeighbourHash)[succIndiItem]; COptimizedKPSetRoleInstancesData* data = new COptimizedKPSetRoleInstancesData(); succHashData.mInstanceItemData = data; precHashData.mInstanceItemData = data; data->mInstanceItem = roleInstItem; data->mKnownInstance = knownInstance; data->mPossibleInstance = !knownInstance; data->mMostSpecific = true; if (knownInstance) { roleInstItem->addKnownInstance(COptimizedKPSetIndividualItemPair(succIndiItem,precIndiItem),inversed); } else { roleInstItem->addPossibleInstance(COptimizedKPSetIndividualItemPair(succIndiItem,precIndiItem),inversed); incOpenPossibleRoleInstancesCount(reqConfPreCompItem); succIndiItem->incPossibleRoleInstantiatedCount(); precIndiItem->incPossibleRoleInstantiatedCount(); if (roleInstItem->hasToProcessPossibleInstancesFlag()) { reqConfPreCompItem->addRoleInstanceItemToProcessPossibleInstances(roleInstItem); } } tmpInstancesList.append(*roleInstItem->getParentItemList()); } if (succHashData.mInstanceItemData->mPossibleInstance && knownInstance) { if (succHashData.mInstanceItemData->mMostSpecific) { decOpenPossibleRoleInstancesCount(reqConfPreCompItem); succIndiItem->decPossibleRoleInstantiatedCount(); precIndiItem->decPossibleRoleInstantiatedCount(); roleInstItem->removePossibleInstance(COptimizedKPSetIndividualItemPair(succIndiItem,precIndiItem),inversed); } roleInstItem->addKnownInstance(COptimizedKPSetIndividualItemPair(succIndiItem,precIndiItem),inversed); succHashData.mInstanceItemData->mKnownInstance = true; succHashData.mInstanceItemData->mPossibleInstance = false; tmpInstancesList.append(*roleInstItem->getParentItemList()); } while (!tmpInstancesList.isEmpty()) { TRoleItemInversionPair superRoleItemInvPair = tmpInstancesList.takeFirst(); bool superRoleItemInversed = superRoleItemInvPair.second; COptimizedKPSetRoleInstancesItem* superRoleInstanceItem = superRoleItemInvPair.first; if (superRoleInstanceItem != reqConfPreCompItem->getTopRoleInstancesItem()) { COptimizedKPSetIndividualItem* superSuccIndiItem = indiItem1; COptimizedKPSetIndividualItem* superPrecIndiItem = indiItem2; COptimizedKPSetRoleInstancesHash* superSuccNeighbourHash = nullptr; COptimizedKPSetRoleInstancesHash* superPrecNeighbourHash = nullptr; if (superRoleItemInversed ^ inversed) { superSuccIndiItem = indiItem2; superPrecIndiItem = indiItem1; } COptimizedKPSetRoleNeighbourInstancesHashData& superSuccRoleNeighbourData = superSuccIndiItem->getKnownPossibleRoleNeighboursInstancesHash()->operator[](superRoleInstanceItem); superSuccNeighbourHash = superSuccRoleNeighbourData.getRoleSuccessorInstancesHash(true); COptimizedKPSetRoleInstancesHashData& superSuccHashData = (*superSuccNeighbourHash)[superPrecIndiItem]; //QString superRoleString = CIRIName::getRecentIRIName(superRoleInstanceItem->getRole()->getPropertyNameLinker()); //QString superInverseRoleString; //if (superRoleInstanceItem->getInverseRole()) { // superInverseRoleString = CIRIName::getRecentIRIName(superRoleInstanceItem->getInverseRole()->getPropertyNameLinker()); //} //if (indi2String == "http://www.co-ode.org/roberts/family-tree.owl#john_archer_1804" && indi1String == "http://www.co-ode.org/roberts/family-tree.owl#john_archer_1804" && (superRoleString == "http://www.co-ode.org/roberts/family-tree.owl#isFatherOf" || superInverseRoleString == "http://www.co-ode.org/roberts/family-tree.owl#isFatherOf")) { // bool bug = true; //} if (superSuccHashData.mInstanceItemData == nullptr) { COptimizedKPSetRoleNeighbourInstancesHashData& superPrecRoleNeighbourData = superPrecIndiItem->getKnownPossibleRoleNeighboursInstancesHash()->operator[](superRoleInstanceItem); superPrecNeighbourHash = superPrecRoleNeighbourData.getRolePredecessorInstancesHash(true); COptimizedKPSetRoleInstancesHashData& superPrecHashData = (*superPrecNeighbourHash)[superSuccIndiItem]; COptimizedKPSetRoleInstancesData* superData = new COptimizedKPSetRoleInstancesData(); superSuccHashData.mInstanceItemData = superData; superPrecHashData.mInstanceItemData = superData; superData->mInstanceItem = superRoleInstanceItem; superData->mKnownInstance = knownInstance; superData->mPossibleInstance = !knownInstance; superData->mMostSpecific = false; tmpInstancesList.append(*superRoleInstanceItem->getParentItemList()); } else { if (knownInstance) { if (superSuccHashData.mInstanceItemData->mPossibleInstance) { superSuccHashData.mInstanceItemData->mPossibleInstance = false; superSuccHashData.mInstanceItemData->mKnownInstance = true; if (superSuccHashData.mInstanceItemData->mMostSpecific) { decOpenPossibleRoleInstancesCount(reqConfPreCompItem); superSuccIndiItem->decPossibleRoleInstantiatedCount(); superPrecIndiItem->decPossibleRoleInstantiatedCount(); superRoleInstanceItem->removePossibleInstance(COptimizedKPSetIndividualItemPair(superSuccIndiItem,superPrecIndiItem),inversed); superSuccHashData.mInstanceItemData->mMostSpecific = false; } tmpInstancesList.append(*superRoleInstanceItem->getParentItemList()); } else if (superSuccHashData.mInstanceItemData->mKnownInstance && superSuccHashData.mInstanceItemData->mMostSpecific) { superSuccHashData.mInstanceItemData->mMostSpecific = false; superRoleInstanceItem->removeKnownInstance(COptimizedKPSetIndividualItemPair(superSuccIndiItem,superPrecIndiItem),superRoleItemInversed); } } else { if (superSuccHashData.mInstanceItemData->mPossibleInstance && superSuccHashData.mInstanceItemData->mMostSpecific) { superRoleInstanceItem->removePossibleInstance(COptimizedKPSetIndividualItemPair(superSuccIndiItem,superPrecIndiItem),inversed); superSuccHashData.mInstanceItemData->mMostSpecific = false; } } } } } return true; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::mergeSameIndividualItems(COptimizedKPSetIndividualItem* instantiatedItem1, COptimizedKPSetIndividualItem* instantiatedItem2, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { COptimizedKPSetIndividualItem* mergedIntoInstantiatedItem = instantiatedItem1; COptimizedKPSetIndividualItem* mergingInstantiatedItem = instantiatedItem2; if (instantiatedItem2->getPossibleInstantiatedCount() + instantiatedItem2->getPossibleSameInstantiatedItemSet() < instantiatedItem1->getPossibleInstantiatedCount() + instantiatedItem1->getPossibleSameInstantiatedItemSet()) { mergedIntoInstantiatedItem = instantiatedItem2; mergingInstantiatedItem = instantiatedItem1; } mergingInstantiatedItem->setItemSameIndividualMerged(true); QHash* indiInstantiatedItemHash = reqConfPreCompItem->getIndividualInstantiatedItemHash(); QSet* individualSet = mergingInstantiatedItem->getKnownSameIndividualSet(); for (QSet::const_iterator it = individualSet->constBegin(), itEnd = individualSet->constEnd(); it != itEnd; ++it) { CIndividual* sameIndividual(*it); mergedIntoInstantiatedItem->addKnownSameIndividual(sameIndividual); indiInstantiatedItemHash->insert(sameIndividual,mergedIntoInstantiatedItem); } return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::updateParentItemsSuccessorProcessed(COptimizedKPSetConceptInstancesItem* item) { QList updateList; QList* parentItemList = item->getParentItemList(); for (QList::const_iterator it = parentItemList->constBegin(), itEnd = parentItemList->constEnd(); it != itEnd; ++it) { COptimizedKPSetConceptInstancesItem* parentItem = *it; updateList.append(parentItem); } while (!updateList.isEmpty()) { COptimizedKPSetConceptInstancesItem* parentItem = updateList.takeFirst(); parentItem->decUnprocessedSuccessorItemCount(); if (parentItem->getUnprocessedSuccessorItemCount() <= 0) { parentItem->setAllSuccessorProcessedFlag(true); if (!parentItem->hasPossibleInstances() && !parentItem->hasTestingPossibleInstances()) { parentItem->setSelfSuccessorProcessedFlag(true); QList* parentParentItemList = parentItem->getParentItemList(); for (QList::const_iterator it = parentParentItemList->constBegin(), itEnd = parentParentItemList->constEnd(); it != itEnd; ++it) { COptimizedKPSetConceptInstancesItem* parentParentItem = *it; updateList.append(parentParentItem); } } } } return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::updateParentItemsSuccessorProcessed(COptimizedKPSetRoleInstancesItem* item) { QList updateList; QList* parentItemList = item->getParentItemList(); for (QList::const_iterator it = parentItemList->constBegin(), itEnd = parentItemList->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleInstancesItem* parentItem = it->first; updateList.append(parentItem); } while (!updateList.isEmpty()) { COptimizedKPSetRoleInstancesItem* parentItem = updateList.takeFirst(); parentItem->decUnprocessedSuccessorItemCount(); if (parentItem->getUnprocessedSuccessorItemCount() <= 0) { parentItem->setAllSuccessorProcessedFlag(true); if (!parentItem->hasPossibleInstances() && !parentItem->hasTestingPossibleInstances()) { parentItem->setSelfSuccessorProcessedFlag(true); QList* parentParentItemList = parentItem->getParentItemList(); for (QList::const_iterator it = parentParentItemList->constBegin(), itEnd = parentParentItemList->constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleInstancesItem* parentParentItem = it->first; updateList.append(parentParentItem); } } } } return this; } bool COptimizedKPSetOntologyConceptRealizingThread::finishOntologyRealizing(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { if (reqConfPreCompItem->areAllStepFinished()) { if (reqConfPreCompItem->isRealizingFinished()) { reqConfPreCompItem->setRealizingFinished(true); CConcreteOntology* ontology = reqConfPreCompItem->getOntology(); CRealization* realization = ontology->getRealization(); realization->setRealized(true); } } mActiveOntItemSet.remove(reqConfPreCompItem); mInactiveOntItemSet.insert(reqConfPreCompItem); reqConfPreCompItem->doRealizingFinishedCallback(true); return true; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::incTestedPossibleConceptInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 incCount) { if (item->isCountingPossibleConceptInstancesTesting()) { mTestedPossibleInstancesCount += incCount; } item->incTestedPossibleConceptInstancesCount(incCount); return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::incOpenPossibleConceptInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 incCount) { if (item->isCountingPossibleConceptInstancesTesting()) { mOpenPossibleInstancesCount += incCount; } item->incOpenPossibleConceptInstancesCount(incCount); return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::decTestedPossibleConceptInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 decCount) { if (item->isCountingPossibleConceptInstancesTesting()) { mTestedPossibleInstancesCount -= decCount; } item->decTestedPossibleConceptInstancesCount(decCount); return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::decOpenPossibleConceptInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 decCount) { if (item->isCountingPossibleConceptInstancesTesting()) { mOpenPossibleInstancesCount -= decCount; } item->decOpenPossibleConceptInstancesCount(decCount); return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::incTestedPossibleRoleInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 incCount) { if (item->isCountingPossibleRoleInstancesTesting()) { mTestedPossibleInstancesCount += incCount; } item->incTestedPossibleRoleInstancesCount(incCount); return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::incOpenPossibleRoleInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 incCount) { if (item->isCountingPossibleRoleInstancesTesting()) { mOpenPossibleInstancesCount += incCount; } item->incOpenPossibleRoleInstancesCount(incCount); return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::decTestedPossibleRoleInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 decCount) { if (item->isCountingPossibleRoleInstancesTesting()) { mTestedPossibleInstancesCount -= decCount; } item->decTestedPossibleRoleInstancesCount(decCount); return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::decOpenPossibleRoleInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 decCount) { if (item->isCountingPossibleRoleInstancesTesting()) { mOpenPossibleInstancesCount -= decCount; } item->decOpenPossibleRoleInstancesCount(decCount); return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::incTestedPossibleSameIndividualsCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 incCount) { if (item->isCountingPossibleSameInstancesTesting()) { mTestedPossibleInstancesCount += incCount; } item->incTestedPossibleSameIndividualsCount(incCount); return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::incOpenPossibleSameIndividualsCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 incCount) { if (item->isCountingPossibleSameInstancesTesting()) { mOpenPossibleInstancesCount += incCount; } item->incOpenPossibleSameIndividualsCount(incCount); return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::decTestedPossibleSameIndividualsCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 decCount) { if (item->isCountingPossibleSameInstancesTesting()) { mTestedPossibleInstancesCount -= decCount; } item->decTestedPossibleSameIndividualsCount(decCount); return this; } COptimizedKPSetOntologyConceptRealizingThread* COptimizedKPSetOntologyConceptRealizingThread::decOpenPossibleSameIndividualsCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 decCount) { if (item->isCountingPossibleSameInstancesTesting()) { mOpenPossibleInstancesCount -= decCount; } item->decOpenPossibleSameIndividualsCount(decCount); return this; } CRealizationProgress* COptimizedKPSetOntologyConceptRealizingThread::getRealizationProgress() { if (mOpenPossibleInstancesCount != mTestedPossibleInstancesCount) { cint64 tested = mTestedPossibleInstancesCount; cint64 total = mOpenPossibleInstancesCount; cint64 elapsedTime = mRealStartTime.elapsed(); double remainingMilliSeconds = 0.; double progessPercent = 0.; if (elapsedTime <= 0 && total > 0) { remainingMilliSeconds = 0.; } else { remainingMilliSeconds = ((double)elapsedTime / (double)tested) * (total-tested); } if (total <= 0) { progessPercent = 0.; } else { progessPercent = ((double)tested / (double)total) * 100.; } cint64 classificCount = mRealizingCount; mRealProgress.setRealizationCount(classificCount); mRealProgress.setProgessPercent(progessPercent); mRealProgress.setRemainingMilliSeconds(remainingMilliSeconds); mRealProgress.setTestedClasses(tested); mRealProgress.setTotalClasses(total); } else { mRealProgress.setProgessPercent(0.); mRealProgress.setRemainingMilliSeconds(0.); mRealProgress.setTestedClasses(mTestedPossibleInstancesCount); mRealProgress.setTotalClasses(mOpenPossibleInstancesCount); } return &mRealProgress; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetOntologyConceptRealizingItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetOntologyConceptRealizingItem.0000644000175000017500000004527312520551254032343 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETONTOLOGYCONCEPTREALIZINGITEM_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETONTOLOGYCONCEPTREALIZINGITEM_H // Libraries includes #include // Namespace includes #include "RealizerSettings.h" #include "CRealizingTestingItem.h" #include "COntologyRealizingItem.h" #include "CRealizingTestingStep.h" #include "COptimizedKPSetRoleInstancesItem.h" #include "COptimizedKPSetRoleInstancesRedirectionItem.h" // Other includes #include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h" #include "Reasoner/Ontology/COntologyProcessingStepRequirement.h" #include "Reasoner/Realization/CRoleRealizationInstanceVisitor.h" #include "Reasoner/Realization/CRoleRealizationIndividualVisitor.h" #include "Reasoner/Realization/CRoleRealization.h" #include "Reasoner/Realization/CConceptRealization.h" #include "Reasoner/Realization/CSameRealization.h" #include "Reasoner/Realization/CPossibleAssertionsCollectionSet.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; using namespace Ontology; using namespace Realization; namespace Realizer { /*! * * \class COptimizedKPSetOntologyConceptRealizingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetOntologyConceptRealizingItem : public COntologyRealizingItem, public CRoleRealization, public CConceptRealization, public CSameRealization { // public methods public: //! Constructor COptimizedKPSetOntologyConceptRealizingItem(); ~COptimizedKPSetOntologyConceptRealizingItem(); virtual COptimizedKPSetOntologyConceptRealizingItem* initRequirementConfigRealizingItem(CConcreteOntology* ontology, CConfigurationBase* config); COptimizedKPSetOntologyConceptRealizingItem* initConceptItemsFromHierarchy(); COptimizedKPSetOntologyConceptRealizingItem* initRoleItemsFromHierarchy(); COptimizedKPSetOntologyConceptRealizingItem* initRoleCandidateInitializingIndividualItems(); COptimizedKPSetOntologyConceptRealizingItem* initComplexRolesStarterCandidates(); bool hasItemsInitialized(); COptimizedKPSetOntologyConceptRealizingItem* setItemsInitialized(bool initialized); bool hasRealizationSameIndividualsInitialized(); COptimizedKPSetOntologyConceptRealizingItem* setRealizationSameIndividualsInitialized(bool initialized); bool hasRealizationConceptsInitialized(); COptimizedKPSetOntologyConceptRealizingItem* setRealizationConceptsInitialized(bool initialized); bool hasRealizationRolesInitialized(); COptimizedKPSetOntologyConceptRealizingItem* setRealizationRolesInitialized(bool initialized); COptimizedKPSetOntologyConceptRealizingItem* setTemporaryRoleRealizationOntology(CConcreteOntology* tmpOntology); CConcreteOntology* getTemporaryRoleRealizationOntology(); virtual COntologyRealizingItem* addProcessingRequirement(COntologyProcessingRequirement* ontoRequirement); CCalculationConfigurationExtension* getCalculationConfiguration(); COptimizedKPSetOntologyConceptRealizingItem* markIntanceItemForConceptRealization(CConcept* concept, bool subconceptRealizationRequired = true); COptimizedKPSetOntologyConceptRealizingItem* addConceptInstanceItemToProcessPossibleInstances(COptimizedKPSetConceptInstancesItem* instanceItem); COptimizedKPSetOntologyConceptRealizingItem* markInstantiatedItemForSameIndividualsRealization(); COptimizedKPSetOntologyConceptRealizingItem* addInstantiatedItemToProcessPossibleSameIndividuals(COptimizedKPSetIndividualItem* instantiatedItem); COptimizedKPSetOntologyConceptRealizingItem* markIntanceItemForRoleRealization(CRole* role, bool subroleRealizationRequired = true); COptimizedKPSetOntologyConceptRealizingItem* addRoleInstanceItemToProcessPossibleInstances(COptimizedKPSetRoleInstancesItem* instanceItem); COptimizedKPSetOntologyConceptRealizingItem* addRoleInstanceItemToInitializeCandidates(COptimizedKPSetRoleInstancesItem* instanceItem); COptimizedKPSetOntologyConceptRealizingItem* addRoleInstanceIndividualItemToInitializeCandidates(COptimizedKPSetIndividualItem* indiItem); QHash* getMarkerConceptInstancesItemHash(); bool isExtraConsistencyTestingStepRequired(); COptimizedKPSetOntologyConceptRealizingItem* setExtraConsistencyTestingStepRequired(bool required); bool isExtraConsistencyTesting(); COptimizedKPSetOntologyConceptRealizingItem* setExtraConsistencyTesting(bool testing); bool isExtraConsistencyTested(); COptimizedKPSetOntologyConceptRealizingItem* setExtraConsistencyTested(bool tested); CRealizingTestingStep* getRealizeConceptProcessingStep(); bool isRealizeConceptStepFinished(); bool isRealizeConceptStepRequired(); bool areRealizeConceptStepProcessingRequirementSatisfied(); CRealizingTestingStep* getRealizeRoleProcessingStep(); bool isRealizeRoleStepFinished(); bool isRealizeRoleStepRequired(); bool areRealizeRoleStepProcessingRequirementSatisfied(); CRealizingTestingStep* getRealizeSameIndividualsProcessingStep(); bool isRealizeSameIndividualsStepFinished(); bool isRealizeSameIndividualsStepRequired(); bool areRealizeSameIndividualsStepProcessingRequirementSatisfied(); bool areAllStepFinished(); bool hasRemainingProcessingRequirements(); COptimizedKPSetOntologyConceptRealizingItem* setRealization(CRealization* realization); CRealization* getRealization(); bool hasRemainingInitializingRoleInstanceItems(); bool hasRemainingProcessingRoleInstanceItems(); bool hasRemainingInitializingRoleInstanceIndividualItems(); bool hasRemainingProcessingConceptInstanceItems(); bool hasRemainingProcessingSameIndividualsItems(); COptimizedKPSetOntologyConceptRealizingItem* addRoleCandidateInitalizingIndividualsItem(COptimizedKPSetIndividualItem* indiItem); QList* getRoleCandidateInitalizingIndividualsItemList(); QHash* getHierarchyNodeInstancesItemHash(); QHash* getConceptInstancesItemHash(); QHash* getRoleInstancesItemHash(); QList* getRoleInstancesItemList(); QList* getComplexRoleInstancesItemList(); QHash* getIndividualInstantiatedItemHash(); COptimizedKPSetIndividualItem* getIndividualInstantiatedItem(CIndividual* individual, bool directCreate = true); bool hasIndividualInstantiatedItem(CIndividual* individual); QList* getProcessingPossibleConceptInstancesItemList(); QList* getProcessingPossibleRoleInstancesItemList(); QList* getInitializingRoleInstancesItemList(); QList* getProcessingPossibleSameIndividualsItemList(); QList* getInitializingRoleInstancesIndividualItemList(); cint64 getTestedPossibleConceptInstancesCount(); cint64 getOpenPossibleConceptInstancesCount(); COptimizedKPSetOntologyConceptRealizingItem* incTestedPossibleConceptInstancesCount(cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingItem* incOpenPossibleConceptInstancesCount(cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingItem* decTestedPossibleConceptInstancesCount(cint64 decCount = 1); COptimizedKPSetOntologyConceptRealizingItem* decOpenPossibleConceptInstancesCount(cint64 decCount = 1); cint64 getTestedPossibleSameIndividualsCount(); cint64 getOpenPossibleSameIndividualsCount(); COptimizedKPSetOntologyConceptRealizingItem* incTestedPossibleSameIndividualsCount(cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingItem* incOpenPossibleSameIndividualsCount(cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingItem* decTestedPossibleSameIndividualsCount(cint64 decCount = 1); COptimizedKPSetOntologyConceptRealizingItem* decOpenPossibleSameIndividualsCount(cint64 decCount = 1); virtual bool visitDirectInstances(CConceptInstantiatedItem* item, CConceptRealizationInstanceVisitor* visitor); virtual bool visitInstances(CConceptInstantiatedItem* item, CConceptRealizationInstanceVisitor* visitor); virtual bool visitDirectTypes(CConceptInstanceItem* item, CConceptRealizationInstantiatedVisitor* visitor); virtual bool visitTypes(CConceptInstanceItem* item, CConceptRealizationInstantiatedVisitor* visitor); virtual bool visitIndividuals(CConceptInstanceItem* item, CConceptRealizationIndividualVisitor* visitor); virtual bool visitConcepts(CConceptInstantiatedItem* item, CConceptRealizationConceptVisitor* visitor); virtual CConceptInstantiatedItem* getInstantiatedItem(CConcept* concept); virtual CConceptInstanceItem* getInstanceItem(CIndividual* individual); virtual bool visitSameIndividuals(CSameInstanceItem* item, CSameRealizationIndividualVisitor* visitor); virtual CSameInstanceItem* getSameInstanceItem(CIndividual* individual); virtual bool visitTargetIndividuals(CRoleInstanceItem* individualItem, CRoleInstantiatedItem* roleItem, CRoleRealizationInstanceVisitor* visitor); virtual bool visitIndividuals(CRoleInstanceItem* item, CRoleRealizationIndividualVisitor* visitor); virtual CRoleInstantiatedItem* getRoleInstantiatedItem(CRole* role); virtual CRoleInstanceItem* getRoleInstanceItem(CIndividual* individual); COptimizedKPSetConceptInstancesItem* getTopInstancesItem(); COptimizedKPSetConceptInstancesItem* getBottomInstancesItem(); cint64 getTestingPossibleSameIndividualCount(); cint64 getTestingPossibleConceptInstanceCount(); bool hasTestingPossibleSameIndividual(); bool hasTestingPossibleConceptInstances(); COptimizedKPSetOntologyConceptRealizingItem* setTestingPossibleSameIndividualCount(cint64 testCount); COptimizedKPSetOntologyConceptRealizingItem* setTestingPossibleConceptInstanceCount(cint64 testCount); COptimizedKPSetOntologyConceptRealizingItem* incTestingPossibleSameIndividualCount(cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingItem* decTestingPossibleSameIndividualCount(cint64 decCount = 1); COptimizedKPSetOntologyConceptRealizingItem* incTestingPossibleConceptInstanceCount(cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingItem* decTestingPossibleConceptInstanceCount(cint64 decCount = 1); COptimizedKPSetRoleInstancesItem* getTopRoleInstancesItem(); COptimizedKPSetRoleInstancesItem* getBottomRoleInstancesItem(); bool hasTestingPossibleRoleInstances(); cint64 getTestingPossibleRoleInstanceCount(); cint64 getTestedPossibleRoleInstancesCount(); cint64 getInitializedRoleInstancesCount(); cint64 getOpenPossibleRoleInstancesCount(); cint64 getRemaningInitalizingRoleInstancesCount(); COptimizedKPSetOntologyConceptRealizingItem* setTestingPossibleRoleInstanceCount(cint64 testCount); COptimizedKPSetOntologyConceptRealizingItem* incTestingPossibleRoleInstanceCount(cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingItem* decTestingPossibleRoleInstanceCount(cint64 decCount = 1); COptimizedKPSetOntologyConceptRealizingItem* incTestedPossibleRoleInstancesCount(cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingItem* decTestedPossibleRoleInstancesCount(cint64 decCount = 1); COptimizedKPSetOntologyConceptRealizingItem* incOpenPossibleRoleInstancesCount(cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingItem* decOpenPossibleRoleInstancesCount(cint64 decCount = 1); COptimizedKPSetOntologyConceptRealizingItem* incInitializedRoleInstancesCount(cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingItem* decInitializedRoleInstancesCount(cint64 decCount = 1); COptimizedKPSetOntologyConceptRealizingItem* incRemaningInitalizingInstancesCount(cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingItem* decRemaningInitalizingInstancesCount(cint64 decCount = 1); bool hasTestingRoleInstanceCandidates(); cint64 getTestingRoleInstanceCandidatesCount(); COptimizedKPSetOntologyConceptRealizingItem* setTestingRoleInstanceCandidatesCount(cint64 testCount); COptimizedKPSetOntologyConceptRealizingItem* incTestingRoleInstanceCandidatesCount(cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingItem* decTestingRoleInstanceCandidatesCount(cint64 decCount = 1); bool isConceptRealizationInstalled(); COptimizedKPSetOntologyConceptRealizingItem* setConceptRealizationInstalled(bool installed); bool isRoleRealizationInstalled(); COptimizedKPSetOntologyConceptRealizingItem* setRoleRealizationInstalled(bool installed); bool isSameRealizationInstalled(); COptimizedKPSetOntologyConceptRealizingItem* setSameRealizationInstalled(bool installed); bool isCountingPossibleConceptInstancesTesting(); bool isCountingPossibleRoleInstancesTesting(); bool isCountingPossibleSameInstancesTesting(); COptimizedKPSetOntologyConceptRealizingItem* setCountingPossibleConceptInstancesTesting(bool counting); COptimizedKPSetOntologyConceptRealizingItem* setCountingPossibleRoleInstancesTesting(bool counting); COptimizedKPSetOntologyConceptRealizingItem* setCountingPossibleSameInstancesTesting(bool counting); COptimizedKPSetOntologyConceptRealizingItem* setTemporarySameRealizationOntology(CConcreteOntology* tmpOntology); CConcreteOntology* getTemporarySameRealizationOntology(); QList* getPossibleSameIndividualsItemList(); COptimizedKPSetOntologyConceptRealizingItem* addPossibleSameIndividualsItem(COptimizedKPSetIndividualItem* indiItem); virtual CPossibleAssertionsCollectionSet* getPossibleAssertionCollectionSet(); bool requiresIndividualDependenceTracking(); COptimizedKPSetOntologyConceptRealizingItem* setIndividualDependenceTrackingRequired(bool indiDepTrackingRequired); QList* getInstantiatedItemList(); QTime* getInitializationTime(); // protected methods protected: // protected variables protected: CRealizingTestingStep* mRealizeConceptProcessingStep; CRealizingTestingStep* mRealizeRoleProcessingStep; CRealizingTestingStep* mRealizeSameIndividualsProcessingStep; CRealization* mRealization; QList mProcessingSteps; CCalculationConfigurationExtension* mCalculationConfig; bool mItemsInitialized; bool mRealizationSameIndividualsInitialized; bool mRealizationConceptsInitialized; bool mRealizationRolesInitialized; QHash mHierNodeInstancesItemHash; QHash mConceptInstancesItemHash; QList mConceptInstancesItemContainer; QHash mRoleInstancesItemHash; QHash mRedirectedRoleInstancesItemHash; QList mRoleInstancesItemContainer; QList mComplexRoleInstancesItemContainer; QHash mMarkerConceptInstancesItemHash; QHash mIndividualInstantiatedItemHash; QList mInstantiatedItemContainer; QList mProcessingConceptInstancesItemList; QList mProcessingSameIndividualsItemList; cint64 mTestedPossibleConceptInstancesCount; cint64 mOpenPossibleConceptInstancesCount; COptimizedKPSetConceptInstancesItem* mTopConceptInstancesItem; COptimizedKPSetConceptInstancesItem* mBottomConceptInstancesItem; cint64 mTestingPossibleSameIndividualCount; cint64 mTestingPossibleConceptInstanceCount; cint64 mTestingPossibleRoleInstanceCount; cint64 mTestingRoleInstanceCandidateCount; CConcreteOntology* mTempRoleRealizationOntology; CConcreteOntology* mTempSameRealizationOntology; QList mRoleCandidateInitalizingIndividualsItemList; QList mInitializingRoleInstancesItemList; QList mProcessingRoleInstancesItemList; QList mInitializingRoleInstancesIndividualItemList; COptimizedKPSetRoleInstancesItem* mTopRoleInstancesItem; COptimizedKPSetRoleInstancesItem* mBottomRoleInstancesItem; cint64 mTestedPossibleRoleInstancesCount; cint64 mInitializedRoleInstancesCount; cint64 mOpenPossibleRoleInstancesCount; cint64 mRemainingInitalizingRoleInstancesCount; bool mConceptRealizationInstalled; bool mRoleRealizationInstalled; bool mSameRealizationInstalled; bool mCountingPossibleConceptInstancesTesting; bool mCountingPossibleRoleInstancesTesting; bool mCountingPossibleSameInstancesTesting; QList mPossibleSameIndiItemList; cint64 mTestedPossibleSameIndividualsCount; cint64 mOpenPossibleSameIndividualsCount; CPossibleAssertionsCollectionSet* mPossAssCollSet; bool mIndiDepTrackReq; bool mExtraConsistencyTestingRequired; bool mExtraConsistencyTesting; bool mExtraConsistencyTested; QTime mInitTime; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETONTOLOGYCONCEPTREALIZINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COntologyRealizingItem.h0000644000175000017500000000570412520551254026376 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CONTOLOGYREALIZINGITEM_H #define KONCLUDE_REASONER_REALIZER_CONTOLOGYREALIZINGITEM_H // Libraries includes // Namespace includes #include "RealizerSettings.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Concurrent/Callback/CCallbackListExecuter.h" #include "Concurrent/Callback/CCallbackData.h" #include "Config/CConfigurationBase.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; using namespace Config; namespace Reasoner { using namespace Ontology; namespace Realizer { /*! * * \class COntologyRealizingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyRealizingItem { // public methods public: //! Constructor COntologyRealizingItem(); COntologyRealizingItem* initRealizingItem(CConcreteOntology* ontology, CConfigurationBase* config); virtual COntologyRealizingItem* addProcessingRequirement(COntologyProcessingRequirement* ontoRequirement); bool isRealizingFinished(); COntologyRealizingItem* setRealizingFinished(bool finished); COntologyRealizingItem* doRealizingFinishedCallback(bool doCallbacks = true); COntologyRealizingItem* addRealizingFinishedCallback(CCallbackData* callback); CConfigurationBase* getConfiguration(); CConcreteOntology* getOntology(); QSet* getRealizingTestingItemSet(); cint64 getCurrentRealizingTestingCount(); bool hasCurrentRealizingTestingCount(); // protected methods protected: // protected variables protected: CConcreteOntology* mOntology; CConfigurationBase* mConfig; bool mRealizingFinishedFlag; CCallbackListExecuter mCallbackExecuter; QSet mTestItemSet; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CONTOLOGYREALIZINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizer.cpp0000644000175000017500000000200412520551260024173 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizer.h" namespace Konclude { namespace Reasoner { namespace Realizer { CRealizer::CRealizer() { } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIncrementalKPSetOntologyConceptRealizingThread.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIncrementalKPSetOntologyConceptRealizingThr0000644000175000017500000000574412520551252032416 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CINCREMENTALKPSETONTOLOGYCONCEPTREALIZINGTHREAD_H #define KONCLUDE_REASONER_REALIZER_CINCREMENTALKPSETONTOLOGYCONCEPTREALIZINGTHREAD_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "COptimizedKPSetOntologyConceptRealizingThread.h" // Other includes #include "Reasoner/Kernel/Task/CIncrementalConsistenceTaskData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; namespace Realizer { using namespace Events; /*! * * \class CIncrementalKPSetOntologyConceptRealizingThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIncrementalKPSetOntologyConceptRealizingThread : public COptimizedKPSetOntologyConceptRealizingThread { // public methods public: //! Constructor CIncrementalKPSetOntologyConceptRealizingThread(CReasonerManager* reasonerManager); //! Destructor ~CIncrementalKPSetOntologyConceptRealizingThread(); virtual COntologyRealizingItem* initializeOntologyRealizingItem(CConcreteOntology* ontology, CConfigurationBase* config); virtual void readCalculationConfig(CConfigurationBase *config); virtual bool initializeKPSetsFromConsistencyData(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem); bool isIndividualAffectedByIncrementalChanges(CIndividual* individual, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem); bool isIndividualItemAffectedByIncrementalChanges(COptimizedKPSetIndividualItem* indiItem, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem); virtual COptimizedKPSetOntologyConceptRealizingThread* addRealizationStatistics(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, CRealizingTestingStep* ontProcStep); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CINCREMENTALKPSETONTOLOGYCONCEPTREALIZINGTHREAD_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetOntologyConceptRealizingThread.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetOntologyConceptRealizingThrea0000644000175000017500000003147412520551256032432 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETONTOLOGYCONCEPTREALIZINGTHREAD_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETONTOLOGYCONCEPTREALIZINGTHREAD_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "CRealizerThread.h" #include "CRealizingTestingItem.h" #include "CIndividualConceptInstanceTestingItem.h" #include "CIndividualPairRoleInstanceTestingItem.h" #include "CIndividualSameTestingItem.h" #include "COptimizedKPSetOntologyConceptRealizingItem.h" #include "COptimizedKPSetIndividualItem.h" #include "COptimizedKPSetConceptInstancesItem.h" #include "COptimizedKPSetConceptInstancesData.h" #include "CRealizationMarkerCandidatesMessageData.h" #include "CIndividualRoleCandidateTestingItem.h" #include "CIndividualsConsistencyTestingItem.h" // Other includes #include "Reasoner/Kernel/Manager/CReasonerManager.h" #include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h" #include "Reasoner/Kernel/Task/CConsistenceTaskData.h" #include "Reasoner/Kernel/Task/CSatisfiableTaskIndividualDependenceTrackingAdapter.h" #include "Reasoner/Kernel/Process/CIndividualProcessNode.h" #include "Reasoner/Kernel/Process/CIndividualProcessNodeVector.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCache.h" #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheReader.h" #include "Reasoner/Generator/CSatisfiableCalculationJobGenerator.h" #include "Reasoner/Generator/CConcreteOntologyUpdateBuilder.h" #include "Reasoner/Preprocess/CRoleChainAutomataTransformationPreProcess.h" #include "Reasoner/Preprocess/CPreProcessContextBase.h" #include "Utilities/Memory/CTempMemoryPoolContainerAllocationManager.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Reasoner { using namespace Kernel::Task; using namespace Kernel::Process; using namespace Kernel::Manager; using namespace Kernel::Cache; using namespace Generator; using namespace Preprocess; namespace Realizer { using namespace Events; /*! * * \class COptimizedKPSetOntologyConceptRealizingThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetOntologyConceptRealizingThread : public CRealizerThread, public CLogDomain { // public methods public: //! Constructor COptimizedKPSetOntologyConceptRealizingThread(CReasonerManager* reasonerManager); //! Destructor ~COptimizedKPSetOntologyConceptRealizingThread(); // protected methods protected: class CKnownPossibleInstanceHashingData { public: CKnownPossibleInstanceHashingData() { mKnownInstance = false; mDirectInserted = false; mMostSpecialRetest = false; mInstanceItem = nullptr; } bool mKnownInstance; bool mDirectInserted; bool mMostSpecialRetest; COptimizedKPSetConceptInstancesItem* mInstanceItem; }; virtual COntologyRealizingItem* initializeOntologyRealizingItem(CConcreteOntology* ontology, CConfigurationBase* config); virtual void readCalculationConfig(CConfigurationBase *config); virtual bool createNextTest(); virtual bool finishOntologyRealizing(COptimizedKPSetOntologyConceptRealizingItem* totallyPreCompItem); virtual bool realizingTested(COntologyRealizingItem* ontPreCompItem, CRealizingTestingItem* preTestItem, CRealizingCalculatedCallbackEvent* pcce); bool createNextConceptInstantiationTest(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetConceptInstancesItem* instancesItem, COptimizedKPSetIndividualItem* instantiatedItem); bool createNextRoleInstantiationTest(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetRoleInstancesItem* instancesItem, COptimizedKPSetIndividualItemPair itemPair); bool createNextSameIndividualsTest(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetIndividualItem* instantiatedItem1, COptimizedKPSetIndividualItem* instantiatedItem2); bool createIndividualsConsistencyTest(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem); bool createNextRoleInitializingTest(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetRoleInstancesItem* instancesItem, COptimizedKPSetIndividualItem* individualItem); bool createNextRoleInitializingTest(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetIndividualItem* individualItem); bool initializeSamePossibleIndividuals(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetIndividualItem* individualItem, const QList& possibleSameIndividualList); bool initializeItems(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem); virtual bool initializeKPSetsFromConsistencyData(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem); bool extractKnownPossibleIndividualDataFromConsistencyData(CIndividual* individual, QList* knownInstancesList, QList* possibleInstancesList, QList* knownSameIndividualList, QList* possibleSameIndividualList, CIndividualProcessNodeVector* indiProcVector, const QList& equivClassList, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem); bool initializeEquivalentClassList(QList* equivClassList, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem); bool initializeKPSetsForIndividual(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, CIndividual* individual, QList& knownInstancesList, QList& possibleInstancesList, QList& knownSameIndividualList); bool addKPSetDirectSuperInstances(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetConceptInstancesHash* knownPossibleInstancesHash, COptimizedKPSetConceptInstancesItem* instanceItem, bool knownInstance); CIndividualProcessNode* getMergeCorrectedIndividualProcessNode(CIndividualProcessNode* indiProcNode, CIndividualProcessNodeVector* indiProcVector, bool* nonDeterministicallyMergedFlag, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem); COptimizedKPSetOntologyConceptRealizingThread* incTestedPossibleConceptInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingThread* incOpenPossibleConceptInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingThread* decTestedPossibleConceptInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 decCount = 1); COptimizedKPSetOntologyConceptRealizingThread* decOpenPossibleConceptInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 decCount = 1); COptimizedKPSetOntologyConceptRealizingThread* incTestedPossibleRoleInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingThread* incOpenPossibleRoleInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingThread* decTestedPossibleRoleInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 decCount = 1); COptimizedKPSetOntologyConceptRealizingThread* decOpenPossibleRoleInstancesCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 decCount = 1); COptimizedKPSetOntologyConceptRealizingThread* incTestedPossibleSameIndividualsCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingThread* incOpenPossibleSameIndividualsCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 incCount = 1); COptimizedKPSetOntologyConceptRealizingThread* decTestedPossibleSameIndividualsCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 decCount = 1); COptimizedKPSetOntologyConceptRealizingThread* decOpenPossibleSameIndividualsCount(COptimizedKPSetOntologyConceptRealizingItem* item, cint64 decCount = 1); virtual COptimizedKPSetOntologyConceptRealizingThread* addRealizationStatistics(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, CRealizingTestingStep* ontProcStep); virtual COptimizedKPSetOntologyConceptRealizingThread* addIndividualDependencyTrackingStatistics(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, CRealizingTestingStep* ontProcStep, const QString& realizationTypeString); COptimizedKPSetOntologyConceptRealizingThread* updateParentItemsSuccessorProcessed(COptimizedKPSetConceptInstancesItem* item); COptimizedKPSetOntologyConceptRealizingThread* updateParentItemsSuccessorProcessed(COptimizedKPSetRoleInstancesItem* item); virtual CRealizationProgress* getRealizationProgress(); COptimizedKPSetOntologyConceptRealizingThread* updateCalculatedKnownConceptInstance(COptimizedKPSetIndividualItem* instantiatedItem, COptimizedKPSetConceptInstancesItem* instancesItem, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem); COptimizedKPSetOntologyConceptRealizingThread* updateCalculatedNonConceptInstance(COptimizedKPSetIndividualItem* instantiatedItem, COptimizedKPSetConceptInstancesItem* instancesItem, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem); COptimizedKPSetOntologyConceptRealizingThread* mergeSameIndividualItems(COptimizedKPSetIndividualItem* instantiatedItem1, COptimizedKPSetIndividualItem* instantiatedItem2, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem); COptimizedKPSetOntologyConceptRealizingThread* createTemporarySameRealizationOntology(COptimizedKPSetOntologyConceptRealizingItem* item); COptimizedKPSetOntologyConceptRealizingThread* createTemporaryRoleRealizationOntology(COptimizedKPSetOntologyConceptRealizingItem* item); CConcept* createTemporaryConcept(COptimizedKPSetOntologyConceptRealizingItem* item, CConcreteOntology* tmpRoleRealOntology); void addTemporaryConceptOperand(CConcept* concept, CConcept* opConcept, bool negated, COptimizedKPSetOntologyConceptRealizingItem* item, CConcreteOntology* tmpRoleRealOntology); COptimizedKPSetOntologyConceptRealizingThread* updateCalculatedKnownRoleInstance(COptimizedKPSetIndividualItemPair individualItemPair, COptimizedKPSetRoleInstancesItem* instancesItem, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem); COptimizedKPSetOntologyConceptRealizingThread* updateCalculatedNonRoleInstance(COptimizedKPSetIndividualItemPair individualItemPair, COptimizedKPSetRoleInstancesItem* instancesItem, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem); virtual bool processRealizationMessage(COntologyRealizingItem* ontRealItem, CRealizationMessageData* messageData, CMemoryPool* memoryPools); bool addKPSetDirectSuperInstances(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetRoleInstancesItem* roleInstItem, bool inversed, COptimizedKPSetIndividualItem* indiItem1, COptimizedKPSetIndividualItem* indiItem2, bool knownInstance); CIndividualProcessNode* getCompletionGraphCachedIndividualProcessNode(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, COptimizedKPSetIndividualItem* indiItem, bool* nondeterministicNodeFlag = nullptr); // protected variables protected: cint64 mTestedPossibleInstancesCount; cint64 mOpenPossibleInstancesCount; CRealizationProgress mRealProgress; QTime mRealStartTime; CBackendRepresentativeMemoryCache* mBackendAssocCache; CBackendRepresentativeMemoryCacheReader* mBackendAssocCacheReader; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETONTOLOGYCONCEPTREALIZINGTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesItem.cpp0000644000175000017500000004167112520551256030624 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetRoleInstancesItem.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetRoleInstancesItem::COptimizedKPSetRoleInstancesItem() : COptimizedKPSetRoleInstancesRedirectionItem(this,nullptr,false) { } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::initInstancesItem(CRole* role) { mRole = role; mUnprocessedSuccItemCount = 0; mTestingPossInstanceCount = 0; mAllSuccProcessedFlag = false; mToProcessFlag = false; mProcessingQueuedFlag = false; mSelfSuccsCompletedFlag = false; mRequiresCandidateInitializationFlag = true; mUninitializedSuccItemCount = 0; mAllSuccInitializedFlag = false; mInitializingQueuedFlag = false; mInitializationStartedFlag = false; mToInitializeFlag = false; mTmpPropagationConcept = nullptr; mTmpMarkerConcept = nullptr; mTmpInversePropagationConcept = nullptr; mTmpInverseMarkerConcept = nullptr; mInvRole = nullptr; return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setInitialUnprocessedSuccessorItemCount() { mUnprocessedSuccItemCount = mSuccessorItemList.count(); return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setInitialUninitializedSuccessorItemCount() { mUninitializedSuccItemCount = mSuccessorItemList.count(); return this; } CRole* COptimizedKPSetRoleInstancesItem::getRole() { return mRole; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setRole(CRole* role) { mRole = role; return this; } QSet* COptimizedKPSetRoleInstancesItem::getKnownInstancesSet() { return &mKnownInstancesSet; } QSet* COptimizedKPSetRoleInstancesItem::getPossibleInstancesSet() { return &mPossibleInstancesSet; } QList* COptimizedKPSetRoleInstancesItem::getParentItemList() { return &mParentItemList; } QList* COptimizedKPSetRoleInstancesItem::getSuccessorItemList() { return &mSuccessorItemList; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::addKnownInstance(const COptimizedKPSetIndividualItemPair& itemPair) { mKnownInstancesSet.insert(itemPair); return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::removeKnownInstance(const COptimizedKPSetIndividualItemPair& itemPair) { mKnownInstancesSet.remove(itemPair); return this; } bool COptimizedKPSetRoleInstancesItem::hasKnownInstance(const COptimizedKPSetIndividualItemPair& itemPair) { return mKnownInstancesSet.contains(itemPair); } bool COptimizedKPSetRoleInstancesItem::hasPossibleInstance(const COptimizedKPSetIndividualItemPair& itemPair) { return mPossibleInstancesSet.contains(itemPair); } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::addPossibleInstance(const COptimizedKPSetIndividualItemPair& itemPair) { mPossibleInstancesSet.insert(itemPair); return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::removePossibleInstance(const COptimizedKPSetIndividualItemPair& itemPair) { mPossibleInstancesSet.remove(itemPair); return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::addParentItem(COptimizedKPSetRoleInstancesItem* item, bool inversed) { mParentItemList.append(TRoleItemInversionPair(item,inversed)); return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::addSuccessorItem(COptimizedKPSetRoleInstancesItem* item, bool inversed) { mSuccessorItemList.append(TRoleItemInversionPair(item,inversed)); return this; } cint64 COptimizedKPSetRoleInstancesItem::getUnprocessedSuccessorItemCount() { return mUnprocessedSuccItemCount; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setUnprocessedSuccessorItemCount(cint64 unpSuccCount) { mUnprocessedSuccItemCount = unpSuccCount; return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::incUnprocessedSuccessorItemCount(cint64 incCount) { mUnprocessedSuccItemCount += incCount; return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::decUnprocessedSuccessorItemCount(cint64 decCount) { mUnprocessedSuccItemCount -= decCount; return this; } cint64 COptimizedKPSetRoleInstancesItem::getTestingPossibleInstancesCount() { return mTestingPossInstanceCount; } bool COptimizedKPSetRoleInstancesItem::hasTestingPossibleInstances() { return mTestingPossInstanceCount > 0; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setTestingPossibleInstancesCount(cint64 testPossIntCount) { mTestingPossInstanceCount = testPossIntCount; return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::incTestingPossibleInstancesCount(cint64 incCount) { mTestingPossInstanceCount += incCount; return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::decTestingPossibleInstancesCount(cint64 decCount) { mTestingPossInstanceCount -= decCount; return this; } bool COptimizedKPSetRoleInstancesItem::hasAllSuccessorProcessedFlag() { return mAllSuccProcessedFlag; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setAllSuccessorProcessedFlag(bool allSuccProcessed) { mAllSuccProcessedFlag = allSuccProcessed; return this; } bool COptimizedKPSetRoleInstancesItem::hasToProcessPossibleInstancesFlag() { return mToProcessFlag; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setToProcessPossibleInstancesFlag(bool toProcess) { mToProcessFlag = toProcess; return this; } bool COptimizedKPSetRoleInstancesItem::hasPossibleInstancesProcessingQueuedFlag() { return mProcessingQueuedFlag; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setPossibleInstancesProcessingQueuedFlag(bool processingQueued) { mProcessingQueuedFlag = processingQueued; return this; } bool COptimizedKPSetRoleInstancesItem::hasSelfSuccessorProcessedFlag() { return mSelfSuccsCompletedFlag; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setSelfSuccessorProcessedFlag(bool selfSuccProcessed) { mSelfSuccsCompletedFlag = selfSuccProcessed; return this; } bool COptimizedKPSetRoleInstancesItem::hasPossibleInstances() { return !mPossibleInstancesSet.isEmpty(); } COptimizedKPSetIndividualItemPair COptimizedKPSetRoleInstancesItem::takeNextTestingPossibleInstance() { COptimizedKPSetIndividualItemPair nextItem(nullptr,nullptr); if (hasPossibleInstances()) { QSet::iterator it = mPossibleInstancesSet.begin(); nextItem = *it; mPossibleInstancesSet.erase(it); } return nextItem; } bool COptimizedKPSetRoleInstancesItem::requiresCandidateInitialization() { return mRequiresCandidateInitializationFlag; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setRequiresCandidateInitialization(bool requiresInit) { mRequiresCandidateInitializationFlag = requiresInit; return this; } bool COptimizedKPSetRoleInstancesItem::hasRemainingCandidateInitializationSuccessors() { return !mRemainingCandidateInitializationSuccessorList.isEmpty(); } QList* COptimizedKPSetRoleInstancesItem::getRemainingCandidateInitializationSuccessorList() { return &mRemainingCandidateInitializationSuccessorList; } COptimizedKPSetIndividualItem* COptimizedKPSetRoleInstancesItem::takeNextRemainingCandidateInitializationSuccessor() { if (!mRemainingCandidateInitializationSuccessorList.isEmpty()) { return mRemainingCandidateInitializationSuccessorList.takeFirst(); } return nullptr; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::addRemainingCandidateInitializationSuccessor(COptimizedKPSetIndividualItem* item) { mRemainingCandidateInitializationSuccessorList.append(item); return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::addRemainingCandidateInitializationSuccessors(QList* itemList) { mRemainingCandidateInitializationSuccessorList.append(*itemList); return this; } bool COptimizedKPSetRoleInstancesItem::isCandidateSuccessorInitializationCompleted() { return mInitializationStartedFlag && mRemainingCandidateInitializationSuccessorList.isEmpty(); } bool COptimizedKPSetRoleInstancesItem::isCandidateSuccessorInitializationStarted() { return mInitializationStartedFlag; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setCandidateSuccessorInitializationStarted(bool initStarted) { mInitializationStartedFlag = initStarted; return this; } cint64 COptimizedKPSetRoleInstancesItem::getUninitializedSuccessorItemCount() { return mUninitializedSuccItemCount; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setUninitializedSuccessorItemCount(cint64 unintSuccCount) { mUninitializedSuccItemCount = unintSuccCount; return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::incUninitializedSuccessorItemCount(cint64 incCount) { mUninitializedSuccItemCount += incCount; return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::decUninitializedSuccessorItemCount(cint64 decCount) { mUninitializedSuccItemCount -= decCount; return this; } bool COptimizedKPSetRoleInstancesItem::hasAllSuccessorInitializedFlag() { return mAllSuccInitializedFlag; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setAllSuccessorInitializedFlag(bool allSuccInitialized) { mAllSuccInitializedFlag = allSuccInitialized; return this; } bool COptimizedKPSetRoleInstancesItem::hasInitializingQueuedFlag() { return mInitializingQueuedFlag; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setInitializingQueuedFlag(bool initializingQueued) { mInitializingQueuedFlag = initializingQueued; return this; } bool COptimizedKPSetRoleInstancesItem::hasToInitializeCandidatesFlag() { return mToInitializeFlag; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setToInitializeCandidatesFlag(bool toInitialize) { mToInitializeFlag = toInitialize; return this; } CConcept* COptimizedKPSetRoleInstancesItem::getTemporaryPropagationConcept() { return mTmpPropagationConcept; } CConcept* COptimizedKPSetRoleInstancesItem::getTemporaryMarkerConcept() { return mTmpMarkerConcept; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setTemporaryPropagationConcept(CConcept* propagationConcept) { mTmpPropagationConcept = propagationConcept; return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setTemporaryMarkerConcept(CConcept* markerConcept) { mTmpMarkerConcept = markerConcept; return this; } CConcept* COptimizedKPSetRoleInstancesItem::getTemporaryInversePropagationConcept() { return mTmpInversePropagationConcept; } CConcept* COptimizedKPSetRoleInstancesItem::getTemporaryInverseMarkerConcept() { return mTmpInverseMarkerConcept; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setTemporaryInversePropagationConcept(CConcept* propagationConcept) { mTmpInversePropagationConcept = propagationConcept; return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setTemporaryInverseMarkerConcept(CConcept* markerConcept) { mTmpInverseMarkerConcept = markerConcept; return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::addKnownInverseInstance(const COptimizedKPSetIndividualItemPair& itemPair) { mKnownInverseInstancesSet.insert(itemPair); return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::removeKnownInverseInstance(const COptimizedKPSetIndividualItemPair& itemPair) { mKnownInverseInstancesSet.remove(itemPair); return this; } bool COptimizedKPSetRoleInstancesItem::hasKnownInverseInstance(const COptimizedKPSetIndividualItemPair& itemPair) { return mKnownInverseInstancesSet.contains(itemPair); } bool COptimizedKPSetRoleInstancesItem::hasPossibleInverseInstance(const COptimizedKPSetIndividualItemPair& itemPair) { return mPossibleInverseInstancesSet.contains(itemPair); } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::addPossibleInverseInstance(const COptimizedKPSetIndividualItemPair& itemPair) { mPossibleInverseInstancesSet.insert(itemPair); return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::removePossibleInverseInstance(const COptimizedKPSetIndividualItemPair& itemPair) { mPossibleInverseInstancesSet.remove(itemPair); return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::addKnownInstance(const COptimizedKPSetIndividualItemPair& itemPair, bool inverse) { if (inverse) { addKnownInverseInstance(itemPair); } else { addKnownInstance(itemPair); } return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::removeKnownInstance(const COptimizedKPSetIndividualItemPair& itemPair, bool inverse) { if (inverse) { removeKnownInverseInstance(itemPair); } else { removeKnownInstance(itemPair); } return this; } bool COptimizedKPSetRoleInstancesItem::hasKnownInstance(const COptimizedKPSetIndividualItemPair& itemPair, bool inverse) { if (inverse) { return hasKnownInverseInstance(itemPair); } else { return hasKnownInstance(itemPair); } } bool COptimizedKPSetRoleInstancesItem::hasPossibleInstance(const COptimizedKPSetIndividualItemPair& itemPair, bool inverse) { if (inverse) { return hasPossibleInverseInstance(itemPair); } else { return hasPossibleInstance(itemPair); } } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::addPossibleInstance(const COptimizedKPSetIndividualItemPair& itemPair, bool inverse) { if (inverse) { addPossibleInverseInstance(itemPair); } else { addPossibleInstance(itemPair); } return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::removePossibleInstance(const COptimizedKPSetIndividualItemPair& itemPair, bool inverse) { if (inverse) { removePossibleInverseInstance(itemPair); } else { removePossibleInstance(itemPair); } return this; } bool COptimizedKPSetRoleInstancesItem::hasInverseRole() { return mInvRole; } CRole* COptimizedKPSetRoleInstancesItem::getInverseRole() { return mInvRole; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::setInverseRole(CRole* role) { mInvRole = role; return this; } QSet* COptimizedKPSetRoleInstancesItem::getComplexRoleStarterCandidateSet() { return &mComplexRoleStarterCandidateSet; } QSet* COptimizedKPSetRoleInstancesItem::getComplexInverseRoleStarterCandidateSet() { return &mComplexInverseRoleStarterCandidateSet; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::addComplexRoleStarterCandidate(CRole* role) { mComplexRoleStarterCandidateSet.insert(role); return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesItem::addComplexInverseRoleStarterCandidate(CRole* role) { mComplexInverseRoleStarterCandidateSet.insert(role); return this; } bool COptimizedKPSetRoleInstancesItem::hasComplexRoleStarterCandidate(CRole* role) { return mComplexRoleStarterCandidateSet.contains(role); } bool COptimizedKPSetRoleInstancesItem::hasComplexInverseRoleStarterCandidate(CRole* role) { return mComplexInverseRoleStarterCandidateSet.contains(role); } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesItem.h0000644000175000017500000002372312520551256030267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESITEM_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESITEM_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "COptimizedKPSetIndividualItem.h" #include "COptimizedKPSetIndividualItemPair.h" #include "COptimizedKPSetRoleInstancesRedirectionItem.h" // Other includes #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Realization; namespace Realizer { /*! * * \class COptimizedKPSetRoleInstancesItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetRoleInstancesItem : public COptimizedKPSetRoleInstancesRedirectionItem { // public methods public: //! Constructor COptimizedKPSetRoleInstancesItem(); COptimizedKPSetRoleInstancesItem* initInstancesItem(CRole* role); COptimizedKPSetRoleInstancesItem* setInitialUnprocessedSuccessorItemCount(); COptimizedKPSetRoleInstancesItem* setInitialUninitializedSuccessorItemCount(); CRole* getRole(); COptimizedKPSetRoleInstancesItem* setRole(CRole* role); QSet* getKnownInstancesSet(); QSet* getPossibleInstancesSet(); QList* getParentItemList(); QList* getSuccessorItemList(); bool hasKnownInstance(const COptimizedKPSetIndividualItemPair& itemPair); bool hasPossibleInstance(const COptimizedKPSetIndividualItemPair& itemPair); COptimizedKPSetRoleInstancesItem* addKnownInstance(const COptimizedKPSetIndividualItemPair& itemPair); COptimizedKPSetRoleInstancesItem* removeKnownInstance(const COptimizedKPSetIndividualItemPair& itemPair); COptimizedKPSetRoleInstancesItem* addPossibleInstance(const COptimizedKPSetIndividualItemPair& itemPair); COptimizedKPSetRoleInstancesItem* removePossibleInstance(const COptimizedKPSetIndividualItemPair& itemPair); bool hasKnownInverseInstance(const COptimizedKPSetIndividualItemPair& itemPair); bool hasPossibleInverseInstance(const COptimizedKPSetIndividualItemPair& itemPair); COptimizedKPSetRoleInstancesItem* addKnownInverseInstance(const COptimizedKPSetIndividualItemPair& itemPair); COptimizedKPSetRoleInstancesItem* removeKnownInverseInstance(const COptimizedKPSetIndividualItemPair& itemPair); COptimizedKPSetRoleInstancesItem* addPossibleInverseInstance(const COptimizedKPSetIndividualItemPair& itemPair); COptimizedKPSetRoleInstancesItem* removePossibleInverseInstance(const COptimizedKPSetIndividualItemPair& itemPair); bool hasKnownInstance(const COptimizedKPSetIndividualItemPair& itemPair, bool inverse); bool hasPossibleInstance(const COptimizedKPSetIndividualItemPair& itemPair, bool inverse); COptimizedKPSetRoleInstancesItem* addKnownInstance(const COptimizedKPSetIndividualItemPair& itemPair, bool inverse); COptimizedKPSetRoleInstancesItem* removeKnownInstance(const COptimizedKPSetIndividualItemPair& itemPair, bool inverse); COptimizedKPSetRoleInstancesItem* addPossibleInstance(const COptimizedKPSetIndividualItemPair& itemPair, bool inverse); COptimizedKPSetRoleInstancesItem* removePossibleInstance(const COptimizedKPSetIndividualItemPair& itemPair, bool inverse); COptimizedKPSetRoleInstancesItem* addParentItem(COptimizedKPSetRoleInstancesItem* item, bool inversed); COptimizedKPSetRoleInstancesItem* addSuccessorItem(COptimizedKPSetRoleInstancesItem* item, bool inversed); cint64 getUnprocessedSuccessorItemCount(); COptimizedKPSetRoleInstancesItem* setUnprocessedSuccessorItemCount(cint64 unpSuccCount); COptimizedKPSetRoleInstancesItem* incUnprocessedSuccessorItemCount(cint64 incCount = 1); COptimizedKPSetRoleInstancesItem* decUnprocessedSuccessorItemCount(cint64 decCount = 1); cint64 getTestingPossibleInstancesCount(); bool hasTestingPossibleInstances(); COptimizedKPSetRoleInstancesItem* setTestingPossibleInstancesCount(cint64 testPossIntCount); COptimizedKPSetRoleInstancesItem* incTestingPossibleInstancesCount(cint64 incCount = 1); COptimizedKPSetRoleInstancesItem* decTestingPossibleInstancesCount(cint64 decCount = 1); bool hasAllSuccessorProcessedFlag(); COptimizedKPSetRoleInstancesItem* setAllSuccessorProcessedFlag(bool allSuccProcessed); bool hasToProcessPossibleInstancesFlag(); COptimizedKPSetRoleInstancesItem* setToProcessPossibleInstancesFlag(bool toProcess); bool hasPossibleInstancesProcessingQueuedFlag(); COptimizedKPSetRoleInstancesItem* setPossibleInstancesProcessingQueuedFlag(bool processingQueued); bool hasSelfSuccessorProcessedFlag(); COptimizedKPSetRoleInstancesItem* setSelfSuccessorProcessedFlag(bool selfSuccProcessed); bool hasPossibleInstances(); COptimizedKPSetIndividualItemPair takeNextTestingPossibleInstance(); bool requiresCandidateInitialization(); COptimizedKPSetRoleInstancesItem* setRequiresCandidateInitialization(bool requiresInit); bool hasRemainingCandidateInitializationSuccessors(); QList* getRemainingCandidateInitializationSuccessorList(); COptimizedKPSetIndividualItem* takeNextRemainingCandidateInitializationSuccessor(); COptimizedKPSetRoleInstancesItem* addRemainingCandidateInitializationSuccessor(COptimizedKPSetIndividualItem* item); COptimizedKPSetRoleInstancesItem* addRemainingCandidateInitializationSuccessors(QList* itemList); bool isCandidateSuccessorInitializationCompleted(); bool isCandidateSuccessorInitializationStarted(); COptimizedKPSetRoleInstancesItem* setCandidateSuccessorInitializationStarted(bool initStarted); cint64 getUninitializedSuccessorItemCount(); COptimizedKPSetRoleInstancesItem* setUninitializedSuccessorItemCount(cint64 unintSuccCount); COptimizedKPSetRoleInstancesItem* incUninitializedSuccessorItemCount(cint64 incCount = 1); COptimizedKPSetRoleInstancesItem* decUninitializedSuccessorItemCount(cint64 decCount = 1); bool hasAllSuccessorInitializedFlag(); COptimizedKPSetRoleInstancesItem* setAllSuccessorInitializedFlag(bool allSuccInitialized); bool hasInitializingQueuedFlag(); COptimizedKPSetRoleInstancesItem* setInitializingQueuedFlag(bool initializingQueued); bool hasToInitializeCandidatesFlag(); COptimizedKPSetRoleInstancesItem* setToInitializeCandidatesFlag(bool toInitialize); CConcept* getTemporaryPropagationConcept(); CConcept* getTemporaryMarkerConcept(); COptimizedKPSetRoleInstancesItem* setTemporaryPropagationConcept(CConcept* propagationConcept); COptimizedKPSetRoleInstancesItem* setTemporaryMarkerConcept(CConcept* markerConcept); CConcept* getTemporaryInversePropagationConcept(); CConcept* getTemporaryInverseMarkerConcept(); COptimizedKPSetRoleInstancesItem* setTemporaryInversePropagationConcept(CConcept* propagationConcept); COptimizedKPSetRoleInstancesItem* setTemporaryInverseMarkerConcept(CConcept* markerConcept); bool hasInverseRole(); CRole* getInverseRole(); COptimizedKPSetRoleInstancesItem* setInverseRole(CRole* role); QSet* getComplexRoleStarterCandidateSet(); COptimizedKPSetRoleInstancesItem* addComplexRoleStarterCandidate(CRole* role); bool hasComplexRoleStarterCandidate(CRole* role); QSet* getComplexInverseRoleStarterCandidateSet(); COptimizedKPSetRoleInstancesItem* addComplexInverseRoleStarterCandidate(CRole* role); bool hasComplexInverseRoleStarterCandidate(CRole* role); // protected methods protected: // protected variables protected: CRole* mInvRole; CConcept* mTmpPropagationConcept; CConcept* mTmpMarkerConcept; QSet mKnownInstancesSet; QSet mPossibleInstancesSet; CConcept* mTmpInversePropagationConcept; CConcept* mTmpInverseMarkerConcept; QSet mKnownInverseInstancesSet; QSet mPossibleInverseInstancesSet; QList mParentItemList; QList mSuccessorItemList; cint64 mUnprocessedSuccItemCount; cint64 mTestingPossInstanceCount; bool mAllSuccProcessedFlag; bool mToProcessFlag; bool mProcessingQueuedFlag; bool mSelfSuccsCompletedFlag; bool mRequiresCandidateInitializationFlag; QList mRemainingCandidateInitializationSuccessorList; bool mInitializationStartedFlag; cint64 mUninitializedSuccItemCount; bool mAllSuccInitializedFlag; bool mInitializingQueuedFlag; bool mToInitializeFlag; QSet mComplexRoleStarterCandidateSet; QSet mComplexInverseRoleStarterCandidateSet; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesItem.h0000644000175000017500000001210112520551254030743 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANCESITEM_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANCESITEM_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "COptimizedKPSetIndividualItem.h" // Other includes #include "Reasoner/Taxonomy/CHierarchyNode.h" #include "Reasoner/Realization/CConceptInstantiatedItem.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Taxonomy; using namespace Realization; namespace Realizer { /*! * * \class COptimizedKPSetConceptInstancesItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetConceptInstancesItem : public CConceptInstantiatedItem { // public methods public: //! Constructor COptimizedKPSetConceptInstancesItem(); COptimizedKPSetConceptInstancesItem* initInstancesItem(CHierarchyNode* hierNode); COptimizedKPSetConceptInstancesItem* setInitialUnprocessedSuccessorItemCount(); CHierarchyNode* getHierarchyNode(); COptimizedKPSetConceptInstancesItem* setHierarchyNode(CHierarchyNode* hierNode); QSet* getKnownInstancesSet(); QSet* getPossibleInstancesSet(); QList* getParentItemList(); QList* getSuccessorItemList(); bool hasKnownInstance(COptimizedKPSetIndividualItem* item); bool hasPossibleInstance(COptimizedKPSetIndividualItem* item); COptimizedKPSetConceptInstancesItem* addKnownInstance(COptimizedKPSetIndividualItem* item); COptimizedKPSetConceptInstancesItem* removeKnownInstance(COptimizedKPSetIndividualItem* item); COptimizedKPSetConceptInstancesItem* addPossibleInstance(COptimizedKPSetIndividualItem* item); COptimizedKPSetConceptInstancesItem* addParentItem(COptimizedKPSetConceptInstancesItem* item); COptimizedKPSetConceptInstancesItem* addSuccessorItem(COptimizedKPSetConceptInstancesItem* item); cint64 getUnprocessedSuccessorItemCount(); COptimizedKPSetConceptInstancesItem* setUnprocessedSuccessorItemCount(cint64 unpSuccCount); COptimizedKPSetConceptInstancesItem* incUnprocessedSuccessorItemCount(cint64 incCount = 1); COptimizedKPSetConceptInstancesItem* decUnprocessedSuccessorItemCount(cint64 decCount = 1); cint64 getTestingPossibleInstancesCount(); bool hasTestingPossibleInstances(); COptimizedKPSetConceptInstancesItem* setTestingPossibleInstancesCount(cint64 testPossIntCount); COptimizedKPSetConceptInstancesItem* incTestingPossibleInstancesCount(cint64 incCount = 1); COptimizedKPSetConceptInstancesItem* decTestingPossibleInstancesCount(cint64 decCount = 1); bool hasAllSuccessorProcessedFlag(); COptimizedKPSetConceptInstancesItem* setAllSuccessorProcessedFlag(bool allSuccProcessed); bool hasToProcessPossibleInstancesFlag(); COptimizedKPSetConceptInstancesItem* setToProcessPossibleInstancesFlag(bool toProcess); bool hasPossibleInstancesProcessingQueuedFlag(); COptimizedKPSetConceptInstancesItem* setPossibleInstancesProcessingQueuedFlag(bool processingQueued); bool hasSelfSuccessorProcessedFlag(); COptimizedKPSetConceptInstancesItem* setSelfSuccessorProcessedFlag(bool selfSuccProcessed); bool hasPossibleInstances(); COptimizedKPSetIndividualItem* takeNextTestingPossibleInstance(); // protected methods protected: // protected variables protected: CHierarchyNode* mHierNode; QSet mKnownInstancesSet; QSet mPossibleInstancesSet; QList mParentItemList; QList mSuccessorItemList; cint64 mUnprocessedSuccItemCount; cint64 mTestingPossInstanceCount; bool mAllSuccProcessedFlag; bool mToProcessFlag; bool mProcessingQueuedFlag; bool mSelfSuccsCompletedFlag; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANCESITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesItem.cpp0000644000175000017500000001602712520551254031311 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetConceptInstancesItem.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetConceptInstancesItem::COptimizedKPSetConceptInstancesItem() { } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::initInstancesItem(CHierarchyNode* hierNode) { mUnprocessedSuccItemCount = 0; mTestingPossInstanceCount = 0; mAllSuccProcessedFlag = false; mToProcessFlag = false; mProcessingQueuedFlag = false; mSelfSuccsCompletedFlag = false; mHierNode = hierNode; return this; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::setInitialUnprocessedSuccessorItemCount() { mUnprocessedSuccItemCount = mSuccessorItemList.count(); return this; } CHierarchyNode* COptimizedKPSetConceptInstancesItem::getHierarchyNode() { return mHierNode; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::setHierarchyNode(CHierarchyNode* hierNode) { mHierNode = hierNode; return this; } QSet* COptimizedKPSetConceptInstancesItem::getKnownInstancesSet() { return &mKnownInstancesSet; } QSet* COptimizedKPSetConceptInstancesItem::getPossibleInstancesSet() { return &mPossibleInstancesSet; } QList* COptimizedKPSetConceptInstancesItem::getParentItemList() { return &mParentItemList; } QList* COptimizedKPSetConceptInstancesItem::getSuccessorItemList() { return &mSuccessorItemList; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::addKnownInstance(COptimizedKPSetIndividualItem* item) { mKnownInstancesSet.insert(item); return this; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::removeKnownInstance(COptimizedKPSetIndividualItem* item) { mKnownInstancesSet.remove(item); return this; } bool COptimizedKPSetConceptInstancesItem::hasKnownInstance(COptimizedKPSetIndividualItem* item) { return mKnownInstancesSet.contains(item); } bool COptimizedKPSetConceptInstancesItem::hasPossibleInstance(COptimizedKPSetIndividualItem* item) { return mPossibleInstancesSet.contains(item); } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::addPossibleInstance(COptimizedKPSetIndividualItem* item) { mPossibleInstancesSet.insert(item); return this; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::addParentItem(COptimizedKPSetConceptInstancesItem* item) { mParentItemList.append(item); return this; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::addSuccessorItem(COptimizedKPSetConceptInstancesItem* item) { mSuccessorItemList.append(item); return this; } cint64 COptimizedKPSetConceptInstancesItem::getUnprocessedSuccessorItemCount() { return mUnprocessedSuccItemCount; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::setUnprocessedSuccessorItemCount(cint64 unpSuccCount) { mUnprocessedSuccItemCount = unpSuccCount; return this; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::incUnprocessedSuccessorItemCount(cint64 incCount) { mUnprocessedSuccItemCount += incCount; return this; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::decUnprocessedSuccessorItemCount(cint64 decCount) { mUnprocessedSuccItemCount -= decCount; return this; } cint64 COptimizedKPSetConceptInstancesItem::getTestingPossibleInstancesCount() { return mTestingPossInstanceCount; } bool COptimizedKPSetConceptInstancesItem::hasTestingPossibleInstances() { return mTestingPossInstanceCount > 0; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::setTestingPossibleInstancesCount(cint64 testPossIntCount) { mTestingPossInstanceCount = testPossIntCount; return this; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::incTestingPossibleInstancesCount(cint64 incCount) { mTestingPossInstanceCount += incCount; return this; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::decTestingPossibleInstancesCount(cint64 decCount) { mTestingPossInstanceCount -= decCount; return this; } bool COptimizedKPSetConceptInstancesItem::hasAllSuccessorProcessedFlag() { return mAllSuccProcessedFlag; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::setAllSuccessorProcessedFlag(bool allSuccProcessed) { mAllSuccProcessedFlag = allSuccProcessed; return this; } bool COptimizedKPSetConceptInstancesItem::hasToProcessPossibleInstancesFlag() { return mToProcessFlag; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::setToProcessPossibleInstancesFlag(bool toProcess) { mToProcessFlag = toProcess; return this; } bool COptimizedKPSetConceptInstancesItem::hasPossibleInstancesProcessingQueuedFlag() { return mProcessingQueuedFlag; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::setPossibleInstancesProcessingQueuedFlag(bool processingQueued) { mProcessingQueuedFlag = processingQueued; return this; } bool COptimizedKPSetConceptInstancesItem::hasSelfSuccessorProcessedFlag() { return mSelfSuccsCompletedFlag; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetConceptInstancesItem::setSelfSuccessorProcessedFlag(bool selfSuccProcessed) { mSelfSuccsCompletedFlag = selfSuccProcessed; return this; } bool COptimizedKPSetConceptInstancesItem::hasPossibleInstances() { return !mPossibleInstancesSet.isEmpty(); } COptimizedKPSetIndividualItem* COptimizedKPSetConceptInstancesItem::takeNextTestingPossibleInstance() { COptimizedKPSetIndividualItem* nextItem = nullptr; if (hasPossibleInstances()) { QSet::iterator it = mPossibleInstancesSet.begin(); nextItem = *it; mPossibleInstancesSet.erase(it); } return nextItem; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesData.cpp0000644000175000017500000000242612520551254031262 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetConceptInstancesData.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetConceptInstancesData::COptimizedKPSetConceptInstancesData() { mInstanceItem = nullptr; mKnownInstance = false; mPossibleInstance = false; mMostSpecific = false; mTestingInstance = false; mTestedInstance = false; mDerived = false; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIndividualSameTestingItem.h0000644000175000017500000000437012520551252027147 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CINDIVIDUALSAMETESTINGITEM_H #define KONCLUDE_REASONER_REALIZER_CINDIVIDUALSAMETESTINGITEM_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "CRealizingTestingItem.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realizer { /*! * * \class CIndividualSameTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualSameTestingItem : public CRealizingTestingItem { // public methods public: //! Constructor CIndividualSameTestingItem(COntologyRealizingItem* preproItem, COptimizedKPSetIndividualItem* instantiatedItem1, COptimizedKPSetIndividualItem* instantiatedItem2); virtual REALIZINGTESTINGTYPE getRealizingTestingType(); COptimizedKPSetIndividualItem* getInstantiatedItem1(); COptimizedKPSetIndividualItem* getInstantiatedItem2(); // protected methods protected: // protected variables protected: COntologyRealizingItem* mOntologyPreproItem; COptimizedKPSetIndividualItem* mInstantiatedItem1; COptimizedKPSetIndividualItem* mInstantiatedItem2; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CINDIVIDUALSAMETESTINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesHashData.h0000644000175000017500000000354412520551254031535 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANCESHASHDATA_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANCESHASHDATA_H // Libraries includes // Namespace includes #include "RealizerSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realizer { /*! * * \class COptimizedKPSetConceptInstancesHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetConceptInstancesHashData { // public methods public: //! Constructor COptimizedKPSetConceptInstancesHashData(); COptimizedKPSetConceptInstancesData* mInstanceItemData; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANCESHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizingTestingItem.cpp0000644000175000017500000000262212520551260026525 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizingTestingItem.h" namespace Konclude { namespace Reasoner { namespace Realizer { CRealizingTestingItem::CRealizingTestingItem(COntologyRealizingItem* preproItem) { mOntologyPreproItem = preproItem; } COntologyRealizingItem* CRealizingTestingItem::getOntologyRealizingItem() { return mOntologyPreproItem; } CRealizingTestingItem* CRealizingTestingItem::setOntologyRealizingItem(COntologyRealizingItem* preproItem) { mOntologyPreproItem = preproItem; return this; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COntologyRealizingItem.cpp0000644000175000017500000000532312520551254026726 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyRealizingItem.h" namespace Konclude { namespace Reasoner { namespace Realizer { COntologyRealizingItem::COntologyRealizingItem() { } COntologyRealizingItem* COntologyRealizingItem::initRealizingItem(CConcreteOntology* ontology, CConfigurationBase* config) { mOntology = ontology; mConfig = config; mRealizingFinishedFlag = false; return this; } COntologyRealizingItem* COntologyRealizingItem::addProcessingRequirement(COntologyProcessingRequirement* ontoRequirement) { ontoRequirement->submitRequirementUpdate(COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSUNSUPPORTED); return this; } bool COntologyRealizingItem::isRealizingFinished() { return mRealizingFinishedFlag; } COntologyRealizingItem* COntologyRealizingItem::setRealizingFinished(bool finished) { mRealizingFinishedFlag = finished; return this; } COntologyRealizingItem* COntologyRealizingItem::doRealizingFinishedCallback(bool doCallbacks) { if (doCallbacks) { mCallbackExecuter.doCallback(); } return this; } COntologyRealizingItem* COntologyRealizingItem::addRealizingFinishedCallback(CCallbackData* callback) { mCallbackExecuter.addCallbackData(callback); return this; } CConcreteOntology* COntologyRealizingItem::getOntology() { return mOntology; } CConfigurationBase* COntologyRealizingItem::getConfiguration() { return mConfig; } QSet* COntologyRealizingItem::getRealizingTestingItemSet() { return &mTestItemSet; } cint64 COntologyRealizingItem::getCurrentRealizingTestingCount() { return mTestItemSet.count(); } bool COntologyRealizingItem::hasCurrentRealizingTestingCount() { return mTestItemSet.count() > 0; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIndividualsConsistencyTestingItem.cpp0000644000175000017500000000256512520551252031305 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualsConsistencyTestingItem.h" namespace Konclude { namespace Reasoner { namespace Realizer { CIndividualsConsistencyTestingItem::CIndividualsConsistencyTestingItem(COntologyRealizingItem* preproItem) : CRealizingTestingItem(preproItem) { mOntologyPreproItem = preproItem; } CRealizingTestingItem::REALIZINGTESTINGTYPE CIndividualsConsistencyTestingItem::getRealizingTestingType() { return CRealizingTestingItem::INDIVIDUALSCONSISTENCYTESTINGTYPE; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetIndividualItemPair.cpp0000644000175000017500000000262212520551254030746 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetIndividualItemPair.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetIndividualItemPair::COptimizedKPSetIndividualItemPair(COptimizedKPSetIndividualItem* item1, COptimizedKPSetIndividualItem* item2) : QPair(item1,item2) { } COptimizedKPSetIndividualItemPair::COptimizedKPSetIndividualItemPair() : QPair(nullptr,nullptr) { } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetIndividualItem.h0000644000175000017500000001751612520551254027607 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANTIATEDITEM_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANTIATEDITEM_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "COptimizedKPSetConceptInstancesHash.h" #include "COptimizedKPSetConceptInstancesData.h" #include "COptimizedKPSetRoleNeighbourInstancesHash.h" #include "COptimizedKPSetRoleInstancesData.h" // Other includes #include "Reasoner/Ontology/CIndividual.h" #include "Reasoner/Realization/CConceptInstanceItem.h" #include "Reasoner/Realization/CRoleInstanceItem.h" #include "Reasoner/Realization/CSameInstanceItem.h" #include "Reasoner/Consistiser/CIndividualDependenceTrackingCollector.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Realization; using namespace Consistiser; namespace Realizer { /*! * * \class COptimizedKPSetConceptInstantiatedItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetIndividualItem : public CConceptInstanceItem, public CRoleInstanceItem, public CSameInstanceItem { // public methods public: //! Constructor COptimizedKPSetIndividualItem(); COptimizedKPSetIndividualItem* initInstantiatedItem(CIndividual* individual); CIndividual* getIndividual(); COptimizedKPSetConceptInstancesHash* getKnownPossibleInstancesHash(); COptimizedKPSetRoleNeighbourInstancesHash* getKnownPossibleRoleNeighboursInstancesHash(); COptimizedKPSetIndividualItem* addKnownSameIndividual(CIndividual* individual); bool hasKnownSameIndividual(CIndividual* individual); COptimizedKPSetIndividualItem* addPossibleSameIndividualItem(COptimizedKPSetIndividualItem* individualItem); COptimizedKPSetIndividualItem* removePossibleSameIndividualItem(COptimizedKPSetIndividualItem* individualItem); bool hasPossibleSameIndividualItem(COptimizedKPSetIndividualItem* individualItem); QSet* getKnownSameIndividualSet(); QSet* getPossibleSameInstantiatedItemSet(); cint64 getPossibleSameInstantiatedItemCount(); cint64 getTestingPossibleInstantiatedCount(); COptimizedKPSetIndividualItem* setTestingPossibleInstantiatedCount(cint64 testCount); COptimizedKPSetIndividualItem* incTestingPossibleInstantiatedCount(cint64 incCount = 1); COptimizedKPSetIndividualItem* decTestingPossibleInstantiatedCount(cint64 decCount = 1); COptimizedKPSetIndividualItem* setTestingPossibleInstantiated(COptimizedKPSetConceptInstancesItem* item); COptimizedKPSetIndividualItem* setTestingPossibleInstantiated(COptimizedKPSetRoleInstancesItem* roleItem, COptimizedKPSetIndividualItem* successorItem); cint64 getPossibleInstantiatedCount(); COptimizedKPSetIndividualItem* setPossibleInstantiatedCount(cint64 testCount); COptimizedKPSetIndividualItem* incPossibleInstantiatedCount(cint64 incCount = 1); COptimizedKPSetIndividualItem* decPossibleInstantiatedCount(cint64 decCount = 1); cint64 getTestingPossibleRoleInstantiatedCount(); COptimizedKPSetIndividualItem* setTestingPossibleRoleInstantiatedCount(cint64 testCount); COptimizedKPSetIndividualItem* incTestingPossibleRoleInstantiatedCount(cint64 incCount = 1); COptimizedKPSetIndividualItem* decTestingPossibleRoleInstantiatedCount(cint64 decCount = 1); cint64 getPossibleRoleInstantiatedCount(); COptimizedKPSetIndividualItem* setPossibleRoleInstantiatedCount(cint64 testCount); COptimizedKPSetIndividualItem* incPossibleRoleInstantiatedCount(cint64 incCount = 1); COptimizedKPSetIndividualItem* decPossibleRoleInstantiatedCount(cint64 decCount = 1); cint64 getTestingPossibleSameIndividualCount(); COptimizedKPSetIndividualItem* setTestingPossibleSameIndividualCount(cint64 testCount); COptimizedKPSetIndividualItem* incTestingPossibleSameIndividualCount(cint64 incCount = 1); COptimizedKPSetIndividualItem* decTestingPossibleSameIndividualCount(cint64 decCount = 1); bool hasPossibleInstantiatedTesting(); bool hasPossibleInstantiated(); bool hasPossibleRoleInstantiatedTesting(); bool hasPossibleRoleInstantiated(); bool hasPossibleSameIndividuals(); bool hasPossibleSameIndividualsTesting(); COptimizedKPSetIndividualItem* takeTestingPossibleSameIndividualItem(); bool hasToProcessPossibleSameIndividualsFlag(); COptimizedKPSetIndividualItem* setToProcessPossibleSameIndividualsFlag(bool toProcess); bool hasPossibleSameIndividualsProcessingQueuedFlag(); COptimizedKPSetIndividualItem* setPossibleSameIndividualsProcessingQueuedFlag(bool processingQueued); bool isItemSameIndividualMerged(); COptimizedKPSetIndividualItem* setItemSameIndividualMerged(bool merged); cint64 getInitializingRoleCandidateCount(); COptimizedKPSetIndividualItem* setInitializingRoleCandidateCount(cint64 testCount); COptimizedKPSetIndividualItem* incInitializingRoleCandidateCount(cint64 incCount = 1); COptimizedKPSetIndividualItem* decInitializingRoleCandidateCount(cint64 decCount = 1); bool hasInitializingRoleCandidatesQueuedFlag(); COptimizedKPSetIndividualItem* setInitializingRoleCandidatesQueuedFlag(bool initializingQueued); bool hasAllRoleCandidatesInitializedFlag(); COptimizedKPSetIndividualItem* setAllRoleCandidatesInitializedFlag(bool allInitalized); CConcept* getTemporaryIndividualNominalConcept(); COptimizedKPSetIndividualItem* setTemporaryIndividualNominalConcept(CConcept* concept); CIndividualDependenceTrackingCollector* getIndividualDependenceTrackingCollector(); COptimizedKPSetIndividualItem* setIndividualDependenceTrackingCollector(CIndividualDependenceTrackingCollector* indiDepTrackColl); // protected methods protected: // protected variables protected: CIndividual* mIndividual; COptimizedKPSetConceptInstancesHash mKnownPossibleInstancesHash; COptimizedKPSetRoleNeighbourInstancesHash mKnownPossibleRoleNeigbourInstancesHash; QSet mKnownSameIndividualSet; QSet mPossibleSameInstantiatedItemSet; cint64 mTestingPossibleInstantiatedCount; cint64 mPossibleInstantiatedCount; cint64 mTestingPossibleRoleInstantiatedCount; cint64 mPossibleRoleInstantiatedCount; cint64 mPossibleSameIndividualCount; bool mItemSameIndividualMerged; bool mToProcessPossibleSameIndividualsFlag; bool mPossibleSameIndividualsProcessingQueuedFlag; cint64 mInitializingRoleCandidateCount; bool mInitializingRoleCandidatesQueuedFlag; bool mAllRoleCandidatesInitializedFlag; CConcept* mTmpNominalConcept; CIndividualDependenceTrackingCollector* mIndiDepTrackingCollector; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANTIATEDITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizationMessageObserver.cpp0000644000175000017500000000207212520551260027721 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizationMessageObserver.h" namespace Konclude { namespace Reasoner { namespace Realizer { CRealizationMessageObserver::CRealizationMessageObserver() { } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesRedirectionItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesRedirectionItem.0000644000175000017500000000311612520551256032301 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetRoleInstancesRedirectionItem.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetRoleInstancesRedirectionItem::COptimizedKPSetRoleInstancesRedirectionItem(COptimizedKPSetRoleInstancesItem* redirectedItem, CRole* role, bool inversed) { mRole = role; mInversed = inversed; mRedirectedItem = redirectedItem; } CRole* COptimizedKPSetRoleInstancesRedirectionItem::getRole() { return mRole; } bool COptimizedKPSetRoleInstancesRedirectionItem::isInversed() { return mInversed; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetRoleInstancesRedirectionItem::getRedirectedItem() { return mRedirectedItem; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIndividualRoleCandidateTestingItem.h0000644000175000017500000000451112520551252030755 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CINDIVIDUALROLECANDIDATETESTINGITEM_H #define KONCLUDE_REASONER_REALIZER_CINDIVIDUALROLECANDIDATETESTINGITEM_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "CRealizingTestingItem.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Realizer { /*! * * \class CIndividualInstanceTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualRoleCandidateTestingItem : public CRealizingTestingItem { // public methods public: //! Constructor CIndividualRoleCandidateTestingItem(COntologyRealizingItem* preproItem, COptimizedKPSetIndividualItem* instantiatedItem, const QList& markerConceptList); virtual REALIZINGTESTINGTYPE getRealizingTestingType(); COptimizedKPSetIndividualItem* getInstantiatedItem(); QList* getMarkerConceptList(); // protected methods protected: // protected variables protected: COntologyRealizingItem* mOntologyPreproItem; COptimizedKPSetIndividualItem* mInstantiatedItem; QList mMarkerConceptList; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CINDIVIDUALROLECANDIDATETESTINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizingTestingStep.cpp0000644000175000017500000000721612520551260026546 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizingTestingStep.h" #include "COntologyRealizingItem.h" namespace Konclude { namespace Reasoner { namespace Realizer { CRealizingTestingStep::CRealizingTestingStep(TESTINGSTEPTYPE testingStepType, COntologyProcessingStepData* ontProcStepData, COntologyRealizingItem* preproItem) { mTestingStepType = testingStepType; mOntologyPreproItem = preproItem; mProcessingStepData = ontProcStepData; mStepFinished = false; } COntologyRealizingItem* CRealizingTestingStep::getOntologyRealizingItem() { return mOntologyPreproItem; } CRealizingTestingStep* CRealizingTestingStep::setOntologyRealizingItem(COntologyRealizingItem* preproItem) { mOntologyPreproItem = preproItem; return this; } bool CRealizingTestingStep::isStepFinished() { return mStepFinished; } bool CRealizingTestingStep::areStepProcessingRequirementSatisfied() { return mProcessingStepData->getProcessingStep()->areAllRequirementsSatisfied(mOntologyPreproItem->getOntology()); } bool CRealizingTestingStep::hasRequirements() { return !mRequirementStepDataList.isEmpty(); } CRealizingTestingStep* CRealizingTestingStep::setStepFinished(bool finished) { mStepFinished = finished; cint64 installFlags = COntologyProcessingStatus::PSCOMPLETELYYPROCESSED; mProcessingStepData->getProcessingStatus()->setProcessingFlags(installFlags); return this; } QList* CRealizingTestingStep::getRequirementList() { return &mRequirementStepDataList; } COntologyProcessingStepData* CRealizingTestingStep::getProcessingStepData() { return mProcessingStepData; } CRealizingTestingStep::TESTINGSTEPTYPE CRealizingTestingStep::getRealizingTestingType() { return mTestingStepType; } CRealizingTestingStep* CRealizingTestingStep::setProcessingStepData(COntologyProcessingStepData* processingData) { mProcessingStepData = processingData; return this; } CRealizingTestingStep* CRealizingTestingStep::addProcessingRequirement(COntologyProcessingRequirement* processingRequirement) { mRequirementStepDataList.append(processingRequirement); return this; } CRealizingTestingStep* CRealizingTestingStep::submitRequirementsUpdate(cint64 flags, bool clearRequirements) { mProcessingStepData->getProcessingStatus()->setErrorFlags(flags); for (QList::const_iterator it = mRequirementStepDataList.constBegin(), itEnd = mRequirementStepDataList.constEnd(); it != itEnd; ++it) { COntologyProcessingRequirement* requirement(*it); requirement->submitRequirementUpdate(COntologyProcessingStatus::PSCOMPLETELYYPROCESSED,flags); } if (clearRequirements) { mRequirementStepDataList.clear(); } return this; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesRedirectionItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesRedirectionItem.0000644000175000017500000000441612520551256032305 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESREDIRECTIONITEM_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESREDIRECTIONITEM_H // Libraries includes // Namespace includes #include "RealizerSettings.h" // Other includes #include "Reasoner/Ontology/CRole.h" #include "Reasoner/Realization/CRoleInstantiatedItem.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Realization; namespace Realizer { /*! * * \class COptimizedKPSetRoleInstancesRedirectionItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetRoleInstancesRedirectionItem : public CRoleInstantiatedItem { // public methods public: //! Constructor COptimizedKPSetRoleInstancesRedirectionItem(COptimizedKPSetRoleInstancesItem* redirectedItem, CRole* role, bool inversed); CRole* getRole(); bool isInversed(); COptimizedKPSetRoleInstancesItem* getRedirectedItem(); // protected methods protected: // protected variables protected: CRole* mRole; bool mInversed; COptimizedKPSetRoleInstancesItem* mRedirectedItem; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESREDIRECTIONITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizingCallbackDataContext.cpp0000644000175000017500000000252612520551260030127 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizingCallbackDataContext.h" namespace Konclude { namespace Reasoner { namespace Realizer { CRealizingCallbackDataContext::CRealizingCallbackDataContext(bool realized, CConcreteOntology *ontology) { mOntology = ontology; mRealizered = realized; } CConcreteOntology *CRealizingCallbackDataContext::getOntology() { return mOntology; } bool CRealizingCallbackDataContext::isRealized() { return mRealizered; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleNeighbourInstancesHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleNeighbourInstancesHashDat0000644000175000017500000000515112520551256032315 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetRoleNeighbourInstancesHashData.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetRoleNeighbourInstancesHashData::COptimizedKPSetRoleNeighbourInstancesHashData() { mRoleSuccessorInstancesHash = nullptr; mRolePredecessorInstancesHash = nullptr; mRoleSuccessorInstancesInitialized = false; mRolePredecessorInstancesInitialized = false; mRoleSuccessorInstancesInitializing = false; mRolePredecessorInstancesInitializing = false; } COptimizedKPSetRoleInstancesHash* COptimizedKPSetRoleNeighbourInstancesHashData::getRoleSuccessorInstancesHash(bool forceCreated) { if (forceCreated && !mRoleSuccessorInstancesHash) { mRoleSuccessorInstancesHash = new COptimizedKPSetRoleInstancesHash(); } return mRoleSuccessorInstancesHash; } COptimizedKPSetRoleInstancesHash* COptimizedKPSetRoleNeighbourInstancesHashData::getRolePredecessorInstancesHash(bool forceCreated) { if (forceCreated && !mRolePredecessorInstancesHash) { mRolePredecessorInstancesHash = new COptimizedKPSetRoleInstancesHash(); } return mRolePredecessorInstancesHash; } COptimizedKPSetRoleInstancesData* COptimizedKPSetRoleNeighbourInstancesHashData::getRoleSuccessorInstanceItemData(COptimizedKPSetIndividualItem* item) { if (mRoleSuccessorInstancesHash) { return mRoleSuccessorInstancesHash->getInstanceItemData(item); } return nullptr; } COptimizedKPSetRoleInstancesData* COptimizedKPSetRoleNeighbourInstancesHashData::getRolePredecessorInstanceItemData(COptimizedKPSetIndividualItem* item) { if (mRolePredecessorInstancesHash) { return mRolePredecessorInstancesHash->getInstanceItemData(item); } return nullptr; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizationMessageObserver.h0000644000175000017500000000401512520551260027365 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CREALIZATIONMARKERCANDIDATESOBSERVER_H #define KONCLUDE_REASONER_REALIZER_CREALIZATIONMARKERCANDIDATESOBSERVER_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "CRealizationMessageData.h" // Other includes #include "Reasoner/Ontology/CConcept.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Realizer { /*! * * \class CRealizationMarkerCandidatesObserver * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealizationMessageObserver { // public methods public: //! Constructor CRealizationMessageObserver(); virtual CRealizationMessageObserver* tellRealizationMessage(CConcreteOntology *ontology, CRealizationMessageData* messageData, CMemoryPool* memoryPool) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CREALIZATIONMARKERCANDIDATESOBSERVER_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizingTestingStep.h0000644000175000017500000000616312520551260026213 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CREALIZINGTESTINGSTEP_H #define KONCLUDE_REASONER_REALIZER_CREALIZINGTESTINGSTEP_H // Libraries includes // Namespace includes #include "RealizerSettings.h" // Other includes #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Reasoner/Ontology/COntologyProcessingStepData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Realizer { /*! * * \class CRealizingTestingStep * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealizingTestingStep { // public methods public: enum TESTINGSTEPTYPE { REALIZECONCEPTPROCESSINGSTEP, REALIZEROLEPROCESSINGSTEP, REALIZESAMEINDIVIDUALSPROCESSINGSTEP }; //! Constructor CRealizingTestingStep(TESTINGSTEPTYPE testingStepType, COntologyProcessingStepData* ontProcStepData, COntologyRealizingItem* preproItem); COntologyRealizingItem* getOntologyRealizingItem(); CRealizingTestingStep* setOntologyRealizingItem(COntologyRealizingItem* preproItem); bool hasRequirements(); bool isStepFinished(); bool areStepProcessingRequirementSatisfied(); CRealizingTestingStep* setStepFinished(bool finished); QList* getRequirementList(); COntologyProcessingStepData* getProcessingStepData(); CRealizingTestingStep* setProcessingStepData(COntologyProcessingStepData* processingData); CRealizingTestingStep* addProcessingRequirement(COntologyProcessingRequirement* processingRequirement); CRealizingTestingStep* submitRequirementsUpdate(cint64 flags = COntologyProcessingStatus::PSSUCESSFULL, bool clearRequirements = true); TESTINGSTEPTYPE getRealizingTestingType(); // protected methods protected: // protected variables protected: TESTINGSTEPTYPE mTestingStepType; COntologyRealizingItem* mOntologyPreproItem; COntologyProcessingStepData* mProcessingStepData; QList mRequirementStepDataList; bool mStepFinished; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CREALIZINGTESTINGSTEP_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizingContext.h0000644000175000017500000000463512520551260025370 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CREALIZINGCONTEXT_H #define KONCLUDE_REASONER_REALIZER_CREALIZINGCONTEXT_H // Libraries includes // Namespace includes #include "RealizerSettings.h" // Other includes #include "Context/CContext.h" #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" #include "Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; using namespace Utilities::Memory; using namespace Utilities::Container; namespace Reasoner { namespace Realizer { /*! * * \class CRealizingContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealizingContext : public CContext { // public methods public: //! Constructor CRealizingContext(); virtual ~CRealizingContext(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); virtual CMemoryPoolAllocationManager* getMemoryPoolAllocationManager(); virtual CMemoryPoolProvider* getMemoryPoolProvider(); // protected methods protected: // protected variables protected: CMemoryPoolAllocationManager* mMemMan; CMemoryPoolProvider* mMemoryPoolProvider; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CREALIZINGCONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesHash.h0000644000175000017500000000402312520551256030244 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESHASH_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESHASH_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "COptimizedKPSetRoleInstancesHashData.h" #include "COptimizedKPSetRoleInstancesData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realizer { /*! * * \class COptimizedKPSetRoleInstancesHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetRoleInstancesHash : public QHash { // public methods public: //! Constructor COptimizedKPSetRoleInstancesHash(); COptimizedKPSetRoleInstancesData* getInstanceItemData(COptimizedKPSetIndividualItem* item); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESHASH_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIncrementalKPSetOntologyConceptRealizingThread.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIncrementalKPSetOntologyConceptRealizingThr0000644000175000017500000003061512520551252032411 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIncrementalKPSetOntologyConceptRealizingThread.h" namespace Konclude { namespace Reasoner { namespace Realizer { CIncrementalKPSetOntologyConceptRealizingThread::CIncrementalKPSetOntologyConceptRealizingThread(CReasonerManager *reasonerManager) : COptimizedKPSetOntologyConceptRealizingThread(reasonerManager) { } CIncrementalKPSetOntologyConceptRealizingThread::~CIncrementalKPSetOntologyConceptRealizingThread() { } COntologyRealizingItem* CIncrementalKPSetOntologyConceptRealizingThread::initializeOntologyRealizingItem(CConcreteOntology* ontology, CConfigurationBase* config) { return COptimizedKPSetOntologyConceptRealizingThread::initializeOntologyRealizingItem(ontology,config); } void CIncrementalKPSetOntologyConceptRealizingThread::readCalculationConfig(CConfigurationBase *config) { COptimizedKPSetOntologyConceptRealizingThread::readCalculationConfig(config); } bool CIncrementalKPSetOntologyConceptRealizingThread::isIndividualAffectedByIncrementalChanges(CIndividual* individual, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { CConcreteOntology* ontology = reqConfPreCompItem->getOntology(); cint64 indiID = individual->getIndividualID(); CConcreteOntology* prevRealizedOntology = ontology->getIncrementalRevisionData()->getPreviousClassTypesRealizedOntology(); CConcreteOntology* prevConsOntology = ontology; do { CConsistence* prevCons = prevConsOntology->getConsistence(); CIncrementalConsistenceTaskData* incConsTaskData = dynamic_cast(prevCons->getConsistenceModelData()); if (incConsTaskData) { if (incConsTaskData->getIndirectlyChangedNodeSet()->contains(indiID)) { return true; } } else { return true; } if (prevConsOntology != prevRealizedOntology) { prevConsOntology = prevConsOntology->getIncrementalRevisionData()->getPreviousConsistentOntology(); } } while (prevConsOntology && prevConsOntology != prevRealizedOntology); return false; } bool CIncrementalKPSetOntologyConceptRealizingThread::isIndividualItemAffectedByIncrementalChanges(COptimizedKPSetIndividualItem* indiItem, COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { CIndividualDependenceTrackingCollector* indDepTrackingCollector = indiItem->getIndividualDependenceTrackingCollector(); if (indDepTrackingCollector) { CIndividualDependenceTracking* indiDepTracking = indDepTrackingCollector->getExtendingIndividualDependenceTracking(); CConcreteOntology* ontology = reqConfPreCompItem->getOntology(); CConcreteOntology* prevRealizedOntology = ontology->getIncrementalRevisionData()->getPreviousClassTypesRealizedOntology(); CConcreteOntology* prevConsOntology = ontology; do { CConsistence* prevCons = prevConsOntology->getConsistence(); CIncrementalConsistenceTaskData* incConsTaskData = dynamic_cast(prevCons->getConsistenceModelData()); if (incConsTaskData) { if (indiDepTracking && indiDepTracking->areIndividualsAffected(incConsTaskData)) { return true; } } else { return true; } if (prevConsOntology != prevRealizedOntology) { prevConsOntology = prevConsOntology->getIncrementalRevisionData()->getPreviousConsistentOntology(); } } while (prevConsOntology && prevConsOntology != prevRealizedOntology); } return false; } bool CIncrementalKPSetOntologyConceptRealizingThread::initializeKPSetsFromConsistencyData(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem) { CConcreteOntology* ontology = reqConfPreCompItem->getOntology(); CConcreteOntology* prevRealizedOntology = ontology->getIncrementalRevisionData()->getPreviousClassTypesRealizedOntology(); CRealization* prevRealization = prevRealizedOntology->getRealization(); COptimizedKPSetOntologyConceptRealizingItem* prevConRealItem = (COptimizedKPSetOntologyConceptRealizingItem*)prevRealization->getConceptRealization(); CConcreteOntology* prevConsOntology = ontology->getIncrementalRevisionData()->getPreviousConsistentOntology(); cint64 previousReusedIndiCalculationsCount = 0; cint64 newInitializedIndiCalculationsCount = 0; CIndividualVector* indiVec = ontology->getABox()->getIndividualVector(false); if (indiVec) { CIndividualProcessNodeVector* indiProcVector = nullptr; CConsistence* consistence = reqConfPreCompItem->getOntology()->getConsistence(); if (consistence) { CConsistenceData* consData = consistence->getConsistenceModelData(); if (consData) { CConsistenceTaskData* consTaskData = dynamic_cast(consData); CSatisfiableCalculationTask* satConsTask = consTaskData->getCompletionGraphCachedSatisfiableTask(); if (!satConsTask) { satConsTask = consTaskData->getDeterministicSatisfiableTask(); } if (satConsTask) { CProcessingDataBox* procDataBox = satConsTask->getProcessingDataBox(); if (procDataBox) { indiProcVector = procDataBox->getIndividualProcessNodeVector(); } } } } CIndividualVector* prevIndiVec = prevRealizedOntology->getABox()->getIndividualVector(false); QList equivClassList; initializeEquivalentClassList(&equivClassList,reqConfPreCompItem); QHash* conInstItemHash = reqConfPreCompItem->getConceptInstancesItemHash(); QHash > individualPossibleSameIndividualListHash; CBOXSET* activeIndividualSet = reqConfPreCompItem->getOntology()->getABox()->getActiveIndividualSet(false); cint64 indiCount = indiVec->getItemCount(); for (cint64 indiID = 0; indiID < indiCount; ++indiID) { CIndividual* individual = indiVec->getData(indiID); if (individual && !individual->isAnonymousIndividual() && !reqConfPreCompItem->hasIndividualInstantiatedItem(individual) && activeIndividualSet->contains(individual)) { QList knownInstancesList; QList possibleInstancesList; QList knownSameIndividualList; QList possibleSameIndividualList; COptimizedKPSetIndividualItem* prevIndiItem = prevConRealItem->getIndividualInstantiatedItem(individual,false); if (!prevIndiItem) { CIndividual* prevIndi = prevIndiVec->getData(indiID); prevIndiItem = prevConRealItem->getIndividualInstantiatedItem(prevIndi,false); } bool newRealisationRequired = false; if (!prevIndiItem) { newRealisationRequired = true; } else { if (isIndividualAffectedByIncrementalChanges(individual,reqConfPreCompItem)) { newRealisationRequired = true; } else { if (isIndividualItemAffectedByIncrementalChanges(prevIndiItem,reqConfPreCompItem)) { newRealisationRequired = true; } } } if (newRealisationRequired) { ++newInitializedIndiCalculationsCount; extractKnownPossibleIndividualDataFromConsistencyData(individual,&knownInstancesList,&possibleInstancesList,&knownSameIndividualList,&possibleSameIndividualList,indiProcVector,equivClassList,reqConfPreCompItem); } else { ++previousReusedIndiCalculationsCount; QSet* prevKnownSameIndiSet = prevIndiItem->getKnownSameIndividualSet(); for (QSet::const_iterator it = prevKnownSameIndiSet->constBegin(), itEnd = prevKnownSameIndiSet->constEnd(); it != itEnd; ++it) { CIndividual* prevKnownSameIndi = *it; knownSameIndividualList.append(prevKnownSameIndi); } COptimizedKPSetConceptInstancesHash* prevKnownPossConInstHash = prevIndiItem->getKnownPossibleInstancesHash(); for (COptimizedKPSetConceptInstancesHash::const_iterator it = prevKnownPossConInstHash->constBegin(), itEnd = prevKnownPossConInstHash->constEnd(); it != itEnd; ++it) { COptimizedKPSetConceptInstancesItem* instItem = it.key(); const COptimizedKPSetConceptInstancesHashData& instItemData = it.value(); if (instItemData.mInstanceItemData->mKnownInstance) { COptimizedKPSetConceptInstancesItem* instantiatedItem = conInstItemHash->value(instItem->getHierarchyNode()->getOneEquivalentConcept()); knownInstancesList.append(instantiatedItem); } } } initializeKPSetsForIndividual(reqConfPreCompItem,individual,knownInstancesList,possibleInstancesList,knownSameIndividualList); if (!possibleSameIndividualList.isEmpty()) { individualPossibleSameIndividualListHash.insert(individual,possibleSameIndividualList); } } } if (!individualPossibleSameIndividualListHash.isEmpty()) { QSet singleIndividualSet; for (QHash >::const_iterator it = individualPossibleSameIndividualListHash.constBegin(), itEnd = individualPossibleSameIndividualListHash.constEnd(); it != itEnd; ++it) { CIndividual* individual = it.key(); COptimizedKPSetIndividualItem* individualItem = reqConfPreCompItem->getIndividualInstantiatedItem(individual,false); if (!singleIndividualSet.contains(individualItem)) { singleIndividualSet.insert(individualItem); const QList possibleSameIndividualList = it.value(); initializeSamePossibleIndividuals(reqConfPreCompItem,individualItem,possibleSameIndividualList); } } } } COntologyProcessingStatistics* ontProcStats = reqConfPreCompItem->getRealizeSameIndividualsProcessingStep()->getProcessingStepData()->getProcessingStatistics(true); ontProcStats->setProcessingCountStatisticValue("incremental-realization-previously-reused-individual-calculations-count",previousReusedIndiCalculationsCount); ontProcStats->setProcessingCountStatisticValue("incremental-realization-newly-initialized-individual-calculations-count",newInitializedIndiCalculationsCount); return true; } COptimizedKPSetOntologyConceptRealizingThread* CIncrementalKPSetOntologyConceptRealizingThread::addRealizationStatistics(COptimizedKPSetOntologyConceptRealizingItem* reqConfPreCompItem, CRealizingTestingStep* ontProcStep) { COntologyProcessingStatistics* ontProcStats = ontProcStep->getProcessingStepData()->getProcessingStatistics(true); ontProcStats->setProcessingCountStatisticValue("incremental-realization-time",reqConfPreCompItem->getInitializationTime()->elapsed()); if (reqConfPreCompItem->getRealizeConceptProcessingStep() == ontProcStep) { ontProcStats->setProcessingCountStatisticValue("incremental-realization-concept-instances-possible-testing-count",reqConfPreCompItem->getTestedPossibleConceptInstancesCount()); ontProcStats->setProcessingCountStatisticValue("incremental-realization-concept-instances-time",reqConfPreCompItem->getInitializationTime()->elapsed()); addIndividualDependencyTrackingStatistics(reqConfPreCompItem,ontProcStep,"incremental-realization-concept-instances"); } else if (reqConfPreCompItem->getRealizeSameIndividualsProcessingStep() == ontProcStep) { ontProcStats->setProcessingCountStatisticValue("incremental-realization-same-individuals-possible-testing-count",reqConfPreCompItem->getTestedPossibleSameIndividualsCount()); addIndividualDependencyTrackingStatistics(reqConfPreCompItem,ontProcStep,"incremental-realization-same-individuals"); } return this; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIndividualRoleCandidateTestingItem.cpp0000644000175000017500000000345212520551252031313 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualRoleCandidateTestingItem.h" namespace Konclude { namespace Reasoner { namespace Realizer { CIndividualRoleCandidateTestingItem::CIndividualRoleCandidateTestingItem(COntologyRealizingItem* preproItem, COptimizedKPSetIndividualItem* instantiatedItem, const QList& markerConceptList) : CRealizingTestingItem(preproItem) { mOntologyPreproItem = preproItem; mInstantiatedItem = instantiatedItem; mMarkerConceptList = markerConceptList; } CRealizingTestingItem::REALIZINGTESTINGTYPE CIndividualRoleCandidateTestingItem::getRealizingTestingType() { return CRealizingTestingItem::INDIVIDUALROLECANDIDATETESTINGTYPE; } COptimizedKPSetIndividualItem* CIndividualRoleCandidateTestingItem::getInstantiatedItem() { return mInstantiatedItem; } QList* CIndividualRoleCandidateTestingItem::getMarkerConceptList() { return &mMarkerConceptList; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetIndividualItem.cpp0000644000175000017500000003012312520551254030127 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetIndividualItem.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetIndividualItem::COptimizedKPSetIndividualItem() { } CIndividual* COptimizedKPSetIndividualItem::getIndividual() { return mIndividual; } COptimizedKPSetConceptInstancesHash* COptimizedKPSetIndividualItem::getKnownPossibleInstancesHash() { return &mKnownPossibleInstancesHash; } COptimizedKPSetRoleNeighbourInstancesHash* COptimizedKPSetIndividualItem::getKnownPossibleRoleNeighboursInstancesHash() { return &mKnownPossibleRoleNeigbourInstancesHash; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::addKnownSameIndividual(CIndividual* individual) { mKnownSameIndividualSet.insert(individual); return this; } bool COptimizedKPSetIndividualItem::hasKnownSameIndividual(CIndividual* individual) { return mKnownSameIndividualSet.contains(individual); } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::addPossibleSameIndividualItem(COptimizedKPSetIndividualItem* individualItem) { mPossibleSameInstantiatedItemSet.insert(individualItem); return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::removePossibleSameIndividualItem(COptimizedKPSetIndividualItem* individualItem) { mPossibleSameInstantiatedItemSet.remove(individualItem); return this; } bool COptimizedKPSetIndividualItem::hasPossibleSameIndividualItem(COptimizedKPSetIndividualItem* individualItem) { return mPossibleSameInstantiatedItemSet.contains(individualItem); } QSet* COptimizedKPSetIndividualItem::getKnownSameIndividualSet() { return &mKnownSameIndividualSet; } QSet* COptimizedKPSetIndividualItem::getPossibleSameInstantiatedItemSet() { return &mPossibleSameInstantiatedItemSet; } cint64 COptimizedKPSetIndividualItem::getPossibleSameInstantiatedItemCount() { return mPossibleSameInstantiatedItemSet.count(); } cint64 COptimizedKPSetIndividualItem::getTestingPossibleInstantiatedCount() { return mTestingPossibleInstantiatedCount; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setTestingPossibleInstantiatedCount(cint64 testCount) { mTestingPossibleInstantiatedCount = testCount; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::incTestingPossibleInstantiatedCount(cint64 incCount) { mTestingPossibleInstantiatedCount += incCount; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::decTestingPossibleInstantiatedCount(cint64 decCount) { mTestingPossibleInstantiatedCount -= decCount; return this; } cint64 COptimizedKPSetIndividualItem::getTestingPossibleRoleInstantiatedCount() { return mTestingPossibleRoleInstantiatedCount; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setTestingPossibleRoleInstantiatedCount(cint64 testCount) { mTestingPossibleRoleInstantiatedCount = testCount; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::incTestingPossibleRoleInstantiatedCount(cint64 incCount) { mTestingPossibleRoleInstantiatedCount += incCount; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::decTestingPossibleRoleInstantiatedCount(cint64 decCount) { mTestingPossibleRoleInstantiatedCount -= decCount; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::initInstantiatedItem(CIndividual* individual) { mIndividual = individual; mKnownSameIndividualSet.insert(mIndividual); mTestingPossibleInstantiatedCount = 0; mTestingPossibleRoleInstantiatedCount = 0; mPossibleInstantiatedCount = 0; mPossibleRoleInstantiatedCount = 0; mPossibleSameIndividualCount = 0; mToProcessPossibleSameIndividualsFlag = false; mPossibleSameIndividualsProcessingQueuedFlag = false; mItemSameIndividualMerged = false; mInitializingRoleCandidateCount = 0; mInitializingRoleCandidatesQueuedFlag = false; mAllRoleCandidatesInitializedFlag = false; mTmpNominalConcept = nullptr; mIndiDepTrackingCollector = nullptr; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setTestingPossibleInstantiated(COptimizedKPSetConceptInstancesItem* item) { COptimizedKPSetConceptInstancesHashData& hashData = mKnownPossibleInstancesHash[item]; hashData.mInstanceItemData->mTestingInstance = true; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setTestingPossibleInstantiated(COptimizedKPSetRoleInstancesItem* roleItem, COptimizedKPSetIndividualItem* successorItem) { COptimizedKPSetRoleInstancesData* instanceItem = mKnownPossibleRoleNeigbourInstancesHash.getRoleSuccessorInstanceItemData(roleItem,successorItem); if (instanceItem) { instanceItem->mTestingInstance = true; } return this; } bool COptimizedKPSetIndividualItem::hasPossibleInstantiatedTesting() { return mTestingPossibleInstantiatedCount > 0; } bool COptimizedKPSetIndividualItem::hasPossibleRoleInstantiatedTesting() { return mTestingPossibleRoleInstantiatedCount > 0; } cint64 COptimizedKPSetIndividualItem::getPossibleInstantiatedCount() { return mPossibleInstantiatedCount; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setPossibleInstantiatedCount(cint64 testCount) { mPossibleInstantiatedCount = testCount; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::incPossibleInstantiatedCount(cint64 incCount) { mPossibleInstantiatedCount += incCount; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::decPossibleInstantiatedCount(cint64 decCount) { mPossibleInstantiatedCount -= decCount; return this; } bool COptimizedKPSetIndividualItem::hasPossibleInstantiated() { return mPossibleInstantiatedCount > 0; } cint64 COptimizedKPSetIndividualItem::getPossibleRoleInstantiatedCount() { return mPossibleRoleInstantiatedCount; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setPossibleRoleInstantiatedCount(cint64 testCount) { mPossibleRoleInstantiatedCount = testCount; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::incPossibleRoleInstantiatedCount(cint64 incCount) { mPossibleRoleInstantiatedCount += incCount; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::decPossibleRoleInstantiatedCount(cint64 decCount) { mPossibleRoleInstantiatedCount -= decCount; return this; } bool COptimizedKPSetIndividualItem::hasPossibleRoleInstantiated() { return mPossibleRoleInstantiatedCount > 0; } cint64 COptimizedKPSetIndividualItem::getTestingPossibleSameIndividualCount() { return mPossibleSameIndividualCount; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setTestingPossibleSameIndividualCount(cint64 testCount) { mPossibleSameIndividualCount = testCount; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::incTestingPossibleSameIndividualCount(cint64 incCount) { mPossibleSameIndividualCount += incCount; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::decTestingPossibleSameIndividualCount(cint64 decCount) { mPossibleSameIndividualCount -= decCount; return this; } bool COptimizedKPSetIndividualItem::hasPossibleSameIndividuals() { return !mPossibleSameInstantiatedItemSet.isEmpty(); } bool COptimizedKPSetIndividualItem::hasPossibleSameIndividualsTesting() { return mPossibleSameIndividualCount >= 0; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::takeTestingPossibleSameIndividualItem() { COptimizedKPSetIndividualItem* possibleSameIndividualTestingItem = nullptr; if (!mPossibleSameInstantiatedItemSet.isEmpty()) { QSet::iterator it = mPossibleSameInstantiatedItemSet.begin(); possibleSameIndividualTestingItem = *it; mPossibleSameInstantiatedItemSet.erase(it); } return possibleSameIndividualTestingItem; } bool COptimizedKPSetIndividualItem::hasToProcessPossibleSameIndividualsFlag() { return mToProcessPossibleSameIndividualsFlag; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setToProcessPossibleSameIndividualsFlag(bool toProcess) { mToProcessPossibleSameIndividualsFlag = toProcess; return this; } bool COptimizedKPSetIndividualItem::hasPossibleSameIndividualsProcessingQueuedFlag() { return mPossibleSameIndividualsProcessingQueuedFlag; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setPossibleSameIndividualsProcessingQueuedFlag(bool processingQueued) { mPossibleSameIndividualsProcessingQueuedFlag = processingQueued; return this; } bool COptimizedKPSetIndividualItem::isItemSameIndividualMerged() { return mItemSameIndividualMerged; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setItemSameIndividualMerged(bool merged) { mItemSameIndividualMerged = merged; return this; } cint64 COptimizedKPSetIndividualItem::getInitializingRoleCandidateCount() { return mInitializingRoleCandidateCount; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setInitializingRoleCandidateCount(cint64 testCount) { mInitializingRoleCandidateCount = testCount; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::incInitializingRoleCandidateCount(cint64 incCount) { mInitializingRoleCandidateCount += incCount; return this; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::decInitializingRoleCandidateCount(cint64 decCount) { mInitializingRoleCandidateCount -= decCount; return this; } bool COptimizedKPSetIndividualItem::hasInitializingRoleCandidatesQueuedFlag() { return mInitializingRoleCandidatesQueuedFlag; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setInitializingRoleCandidatesQueuedFlag(bool initializingQueued) { mInitializingRoleCandidatesQueuedFlag = initializingQueued; return this; } bool COptimizedKPSetIndividualItem::hasAllRoleCandidatesInitializedFlag() { return mAllRoleCandidatesInitializedFlag; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setAllRoleCandidatesInitializedFlag(bool allInitalized) { mAllRoleCandidatesInitializedFlag = allInitalized; return this; } CConcept* COptimizedKPSetIndividualItem::getTemporaryIndividualNominalConcept() { return mTmpNominalConcept; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setTemporaryIndividualNominalConcept(CConcept* concept) { mTmpNominalConcept = concept; return this; } CIndividualDependenceTrackingCollector* COptimizedKPSetIndividualItem::getIndividualDependenceTrackingCollector() { return mIndiDepTrackingCollector; } COptimizedKPSetIndividualItem* COptimizedKPSetIndividualItem::setIndividualDependenceTrackingCollector(CIndividualDependenceTrackingCollector* indiDepTrackColl) { mIndiDepTrackingCollector = indiDepTrackColl; return this; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizingTestingItem.h0000644000175000017500000000427012520551260026173 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CREALIZINGTESTINGITEM_H #define KONCLUDE_REASONER_REALIZER_CREALIZINGTESTINGITEM_H // Libraries includes // Namespace includes #include "RealizerSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realizer { /*! * * \class CRealizingTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealizingTestingItem { // public methods public: //! Constructor CRealizingTestingItem(COntologyRealizingItem* preproItem); enum REALIZINGTESTINGTYPE { INDIVIDUALCONCEPTINCSTANCETESTINGTYPE, INDIVIDUALPAIRROLEINCSTANCETESTINGTYPE, INDIVIDUALSAMETESTINGTYPE, INDIVIDUALROLECANDIDATETESTINGTYPE, INDIVIDUALSCONSISTENCYTESTINGTYPE }; COntologyRealizingItem* getOntologyRealizingItem(); CRealizingTestingItem* setOntologyRealizingItem(COntologyRealizingItem* preproItem); virtual REALIZINGTESTINGTYPE getRealizingTestingType() = 0; // protected methods protected: // protected variables protected: COntologyRealizingItem* mOntologyPreproItem; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CREALIZINGTESTINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIndividualsConsistencyTestingItem.h0000644000175000017500000000373412520551252030751 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CINDIVIDUALSCONSISTENCYTESTINGITEM_H #define KONCLUDE_REASONER_REALIZER_CINDIVIDUALSCONSISTENCYTESTINGITEM_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "CRealizingTestingItem.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realizer { /*! * * \class CIndividualsConsistencyTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualsConsistencyTestingItem : public CRealizingTestingItem { // public methods public: //! Constructor CIndividualsConsistencyTestingItem(COntologyRealizingItem* preproItem); virtual REALIZINGTESTINGTYPE getRealizingTestingType(); // protected methods protected: // protected variables protected: COntologyRealizingItem* mOntologyPreproItem; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CINDIVIDUALSCONSISTENCYTESTINGITEM_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleNeighbourInstancesHash.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleNeighbourInstancesHash.cp0000644000175000017500000000374312520551256032272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetRoleNeighbourInstancesHash.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetRoleNeighbourInstancesHash::COptimizedKPSetRoleNeighbourInstancesHash() { } COptimizedKPSetRoleInstancesData* COptimizedKPSetRoleNeighbourInstancesHash::getRoleSuccessorInstanceItemData(COptimizedKPSetRoleInstancesItem* item, COptimizedKPSetIndividualItem* successorItem) { COptimizedKPSetRoleNeighbourInstancesHashData& hashData = QHash::operator[](item); return hashData.getRoleSuccessorInstanceItemData(successorItem); } COptimizedKPSetRoleInstancesData* COptimizedKPSetRoleNeighbourInstancesHash::getRolePredecessorInstanceItemData(COptimizedKPSetRoleInstancesItem* item, COptimizedKPSetIndividualItem* predecessorItem) { COptimizedKPSetRoleNeighbourInstancesHashData& hashData = QHash::operator[](item); return hashData.getRolePredecessorInstanceItemData(predecessorItem); } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizationProgress.h0000644000175000017500000000461112520551260026077 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CREALIZATIONPROGRESS_H #define KONCLUDE_REASONER_REALIZER_CREALIZATIONPROGRESS_H // Libraries includes // Namespace includes #include "RealizerSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realizer { /*! * * \class CRealizationProgress * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealizationProgress { // public methods public: //! Constructor CRealizationProgress(); qint64 getRealizationCount(); qint64 getTestedClasses(); qint64 getTotalClasses(); double getRemainingMilliSeconds(); double getProgessPercent(); CRealizationProgress *setRealizationCount(qint64 classificationCount); CRealizationProgress *setTestedClasses(qint64 testedClasses); CRealizationProgress *setTotalClasses(qint64 totalClasses); CRealizationProgress *setRemainingMilliSeconds(double remainingMilliSeconds); CRealizationProgress *setProgessPercent(double progessPercent); CRealizationProgress *resetValues(); // protected methods protected: // protected variables protected: qint64 mRealizationCount; qint64 mTestedClasses; qint64 mTotalClasses; double mRemainingMilliSeconds; double mProgessPercent; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CREALIZATIONPROGRESS_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesHash.cpp0000644000175000017500000000261312520551256030602 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetRoleInstancesHash.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetRoleInstancesHash::COptimizedKPSetRoleInstancesHash() { } COptimizedKPSetRoleInstancesData* COptimizedKPSetRoleInstancesHash::getInstanceItemData(COptimizedKPSetIndividualItem* item) { COptimizedKPSetRoleInstancesHashData& hashData = QHash::operator[](item); return hashData.mInstanceItemData; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetOntologyConceptRealizingItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetOntologyConceptRealizingItem.0000644000175000017500000015776112605012416032345 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetOntologyConceptRealizingItem.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetOntologyConceptRealizingItem::COptimizedKPSetOntologyConceptRealizingItem() { } COptimizedKPSetOntologyConceptRealizingItem::~COptimizedKPSetOntologyConceptRealizingItem() { delete mCalculationConfig; delete mRealizeConceptProcessingStep; delete mRealizeRoleProcessingStep; if (mTempRoleRealizationOntology != mOntology) { mTempRoleRealizationOntology->setConsistence(nullptr); delete mTempRoleRealizationOntology; } if (mTempSameRealizationOntology != mOntology) { mTempSameRealizationOntology->setConsistence(nullptr); delete mTempSameRealizationOntology; } if (mPossAssCollSet) { delete mPossAssCollSet; } } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::initRequirementConfigRealizingItem(CConcreteOntology* ontology, CConfigurationBase* config) { COntologyRealizingItem::initRealizingItem(ontology,config); mRealization = nullptr; mCalculationConfig = new CCalculationConfigurationExtension(config,0); COntologyProcessingStepDataVector* ontProStepDataVec = mOntology->getProcessingSteps()->getOntologyProcessingStepDataVector(); mRealizeConceptProcessingStep = new CRealizingTestingStep(CRealizingTestingStep::REALIZECONCEPTPROCESSINGSTEP,ontProStepDataVec->getProcessingStepData(COntologyProcessingStep::OPSCONCEPTREALIZE),this); mProcessingSteps.append(mRealizeConceptProcessingStep); mRealizeRoleProcessingStep = new CRealizingTestingStep(CRealizingTestingStep::REALIZEROLEPROCESSINGSTEP,ontProStepDataVec->getProcessingStepData(COntologyProcessingStep::OPSROLEREALIZE),this); mProcessingSteps.append(mRealizeRoleProcessingStep); mRealizeSameIndividualsProcessingStep = new CRealizingTestingStep(CRealizingTestingStep::REALIZESAMEINDIVIDUALSPROCESSINGSTEP,ontProStepDataVec->getProcessingStepData(COntologyProcessingStep::OPSSAMEINDIVIDUALSREALIZE),this); mProcessingSteps.append(mRealizeSameIndividualsProcessingStep); mItemsInitialized = false; mRealizationSameIndividualsInitialized = false; mRealizationConceptsInitialized = false; mTestedPossibleConceptInstancesCount = 0; mOpenPossibleConceptInstancesCount = 0; mTestedPossibleSameIndividualsCount = 0; mOpenPossibleSameIndividualsCount = 0; mTopConceptInstancesItem = nullptr; mBottomConceptInstancesItem = nullptr; mTestingPossibleSameIndividualCount = 0; mTestingPossibleConceptInstanceCount = 0; mTestingPossibleRoleInstanceCount = 0; mTestingRoleInstanceCandidateCount = 0; mTestedPossibleRoleInstancesCount = 0; mOpenPossibleRoleInstancesCount = 0; mInitializedRoleInstancesCount = 0; mRemainingInitalizingRoleInstancesCount = 0; mTopRoleInstancesItem = nullptr; mBottomRoleInstancesItem = nullptr; mRealizationRolesInitialized = false; mTempRoleRealizationOntology = nullptr; mTempSameRealizationOntology = nullptr; mRoleRealizationInstalled = false; mConceptRealizationInstalled = false; mSameRealizationInstalled = false; mCountingPossibleConceptInstancesTesting = false; mCountingPossibleRoleInstancesTesting = false; mCountingPossibleSameInstancesTesting = false; mExtraConsistencyTestingRequired = false; mExtraConsistencyTesting = false; mExtraConsistencyTested = false; mIndiDepTrackReq = false; if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Realization.IndividualDependenceTracking",true)) { mIndiDepTrackReq = true; } mPossAssCollSet = nullptr; if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Realization.PossibleAssertionsCollecting",false)) { mPossAssCollSet = new CPossibleAssertionsCollectionSet(); } if (CConfigDataReader::readConfigBoolean(config,"Konclude.Calculation.Realization.ExtraConsistencyTesting",true)) { mExtraConsistencyTestingRequired = true; } mInitTime.start(); return this; } CPossibleAssertionsCollectionSet* COptimizedKPSetOntologyConceptRealizingItem::getPossibleAssertionCollectionSet() { return mPossAssCollSet; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::initConceptItemsFromHierarchy() { CClassification* classification = mOntology->getClassification(); if (classification->hasClassConceptClassification()) { CClassConceptClassification* classConClass = classification->getClassConceptClassification(); if (classConClass) { CTaxonomy* taxonomy = classConClass->getClassConceptTaxonomy(); if (taxonomy) { QHash* conHierNodeHash = taxonomy->getConceptHierarchyNodeHash(); for (QHash::const_iterator it = conHierNodeHash->constBegin(), itEnd = conHierNodeHash->constEnd(); it != itEnd; ++it) { CConcept* concept(it.key()); CHierarchyNode* hierNode(it.value()); COptimizedKPSetConceptInstancesItem* instancesItem = mHierNodeInstancesItemHash.value(hierNode,nullptr); if (!instancesItem) { instancesItem = new COptimizedKPSetConceptInstancesItem(); mConceptInstancesItemContainer.append(instancesItem); mHierNodeInstancesItemHash.insert(hierNode,instancesItem); instancesItem->initInstancesItem(hierNode); } mConceptInstancesItemHash.insert(concept,instancesItem); } for (QList::const_iterator it = mConceptInstancesItemContainer.constBegin(), itEnd = mConceptInstancesItemContainer.constEnd(); it != itEnd; ++it) { COptimizedKPSetConceptInstancesItem* item(*it); CHierarchyNode* node = item->getHierarchyNode(); QSet* parentNodeSet = node->getParentNodeSet(); if (parentNodeSet) { for (QSet::const_iterator parentIt = parentNodeSet->constBegin(), parentItEnd = parentNodeSet->constEnd(); parentIt != parentItEnd; ++parentIt) { CHierarchyNode* parentHierNode(*parentIt); COptimizedKPSetConceptInstancesItem* parentItem = mHierNodeInstancesItemHash.value(parentHierNode); item->addParentItem(parentItem); parentItem->addSuccessorItem(item); } } } for (QList::const_iterator it = mConceptInstancesItemContainer.constBegin(), itEnd = mConceptInstancesItemContainer.constEnd(); it != itEnd; ++it) { COptimizedKPSetConceptInstancesItem* item(*it); item->setInitialUnprocessedSuccessorItemCount(); if (item->getUnprocessedSuccessorItemCount() <= 0) { item->setAllSuccessorProcessedFlag(true); } } mTopConceptInstancesItem = mHierNodeInstancesItemHash.value(taxonomy->getTopHierarchyNode()); mBottomConceptInstancesItem = mHierNodeInstancesItemHash.value(taxonomy->getBottomHierarchyNode()); } } } return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::initRoleCandidateInitializingIndividualItems() { for (QList::const_iterator it = mInstantiatedItemContainer.constBegin(), itEnd = mInstantiatedItemContainer.constEnd(); it != itEnd; ++it) { COptimizedKPSetIndividualItem* indiItem(*it); if (!indiItem->isItemSameIndividualMerged()) { addRoleCandidateInitalizingIndividualsItem(indiItem); } } return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::initComplexRolesStarterCandidates() { CRBox* rbox = mOntology->getRBox(); CRoleVector* roleVector = rbox->getRoleVector(false); CBOXSET* activeRoleSet = rbox->getActivePropertyRoleSet(false); if (roleVector && activeRoleSet) { for (CBOXSET::const_iterator roleIt = activeRoleSet->constBegin(), roleItEnd = activeRoleSet->constEnd(); roleIt != roleItEnd; ++roleIt) { CRole* role(*roleIt); if (!role->isDataRole() && role->isComplexRole()) { for (CXLinker* chainLinkerIt = role->getRoleChainSuperSharingLinker(); chainLinkerIt; chainLinkerIt = chainLinkerIt->getNext()) { CRoleChain* roleChain = chainLinkerIt->getData(); CRole* firstRole = roleChain->getRoleChainLinker()->getData(); CRole* firstInverseRole = nullptr; if (roleChain->getInverseRoleChainLinker()) { firstInverseRole = roleChain->getInverseRoleChainLinker()->getData(); } for (CSortedNegLinker* indSuperRoleLinker = role->getIndirectSuperRoleList(); indSuperRoleLinker; indSuperRoleLinker = indSuperRoleLinker->getNext()) { CRole* superRole = indSuperRoleLinker->getData(); bool superRoleInversed = indSuperRoleLinker->isNegated(); COptimizedKPSetRoleInstancesItem* superRoleItem = mRoleInstancesItemHash.value(superRole); if (superRoleItem && superRoleItem != mTopRoleInstancesItem) { if (superRoleInversed) { if (firstInverseRole) { superRoleItem->addComplexRoleStarterCandidate(firstInverseRole); } if (superRoleItem->hasInverseRole()) { superRoleItem->addComplexInverseRoleStarterCandidate(firstRole); } } else { superRoleItem->addComplexRoleStarterCandidate(firstRole); if (firstInverseRole && superRoleItem->hasInverseRole()) { superRoleItem->addComplexInverseRoleStarterCandidate(firstInverseRole); } } } } } } } } return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::initRoleItemsFromHierarchy() { CRBox* rbox = mOntology->getRBox(); CRoleVector* roleVector = rbox->getRoleVector(false); CBOXSET* activeRoleSet = rbox->getActivePropertyRoleSet(false); if (roleVector && activeRoleSet) { for (CBOXSET::const_iterator roleIt = activeRoleSet->constBegin(), roleItEnd = activeRoleSet->constEnd(); roleIt != roleItEnd; ++roleIt) { CRole* role(*roleIt); if (!role->isDataRole() && role->hasPropertyName() && !mRedirectedRoleInstancesItemHash.contains(role)) { COptimizedKPSetRoleInstancesItem* instancesItem = new COptimizedKPSetRoleInstancesItem(); mRoleInstancesItemContainer.append(instancesItem); mRoleInstancesItemHash.insert(role,instancesItem); mRedirectedRoleInstancesItemHash.insert(role,new COptimizedKPSetRoleInstancesRedirectionItem(instancesItem,role,false)); instancesItem->initInstancesItem(role); CRole* inverseRole = nullptr; for (CSortedNegLinker* eqInvRoleIt = role->getInverseEquivalentRoleList(); eqInvRoleIt; eqInvRoleIt = eqInvRoleIt->getNext()) { CRole* eqInvRole = eqInvRoleIt->getData(); mRedirectedRoleInstancesItemHash.insert(eqInvRole,new COptimizedKPSetRoleInstancesRedirectionItem(instancesItem,eqInvRole,eqInvRoleIt->isNegated())); if (eqInvRoleIt->isNegated()) { inverseRole = eqInvRole; } } for (CSortedNegLinker* indSupRoleIt = role->getIndirectSuperRoleList(); indSupRoleIt; indSupRoleIt = indSupRoleIt->getNext()) { CRole* superRole = indSupRoleIt->getData(); bool superRoleInversed = indSupRoleIt->isNegated(); if (!mRedirectedRoleInstancesItemHash.contains(superRole)) { for (CSortedNegLinker* supIndSupRoleIt = superRole->getIndirectSuperRoleList(); supIndSupRoleIt; supIndSupRoleIt = supIndSupRoleIt->getNext()) { CRole* superSuperRole = supIndSupRoleIt->getData(); if (role == superSuperRole) { mRedirectedRoleInstancesItemHash.insert(superRole,new COptimizedKPSetRoleInstancesRedirectionItem(instancesItem,superSuperRole,superRoleInversed)); if (superRoleInversed) { inverseRole = superRole; } } } } } if (inverseRole) { if (!instancesItem->hasInverseRole()) { instancesItem->setInverseRole(inverseRole); } } if (role->isComplexRole()) { mComplexRoleInstancesItemContainer.append(instancesItem); } } } CRole* topRole = rbox->getTopObjectRole(); CRole* bottomRole = rbox->getBottomObjectRole(); mTopRoleInstancesItem = mRedirectedRoleInstancesItemHash.value(rbox->getTopObjectRole())->getRedirectedItem(); mBottomRoleInstancesItem = mRedirectedRoleInstancesItemHash.value(rbox->getBottomObjectRole())->getRedirectedItem(); for (QList::const_iterator it = mRoleInstancesItemContainer.constBegin(), itEnd = mRoleInstancesItemContainer.constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleInstancesItem* roleItem(*it); CRole* role = roleItem->getRole(); for (CSortedNegLinker* eqInvRoleIt = role->getInverseEquivalentRoleList(); eqInvRoleIt; eqInvRoleIt = eqInvRoleIt->getNext()) { CRole* eqInvRole = eqInvRoleIt->getData(); bool inversed = eqInvRoleIt->isNegated(); for (CSortedNegLinker* eqInvSupRoleIt = eqInvRole->getSuperRoleList(); eqInvSupRoleIt; eqInvSupRoleIt = eqInvSupRoleIt->getNext()) { CRole* superRole = eqInvSupRoleIt->getData(); bool superRoleInversed = eqInvSupRoleIt->isNegated() ^ inversed; COptimizedKPSetRoleInstancesRedirectionItem* redRoleRedirectionItem = mRedirectedRoleInstancesItemHash.value(superRole); COptimizedKPSetRoleInstancesItem* superRoleRedirectedItem = redRoleRedirectionItem->getRedirectedItem(); bool superRoleRedirectionInversed = redRoleRedirectionItem->isInversed() ^ superRoleInversed; if (superRoleRedirectedItem != roleItem) { roleItem->addParentItem(superRoleRedirectedItem,superRoleRedirectionInversed); superRoleRedirectedItem->addSuccessorItem(roleItem,superRoleRedirectionInversed); } } } if (roleItem->getParentItemList()->isEmpty() && roleItem != mTopRoleInstancesItem) { roleItem->addParentItem(mTopRoleInstancesItem,false); mTopRoleInstancesItem->addSuccessorItem(roleItem,false); } } for (QList::const_iterator it = mRoleInstancesItemContainer.constBegin(), itEnd = mRoleInstancesItemContainer.constEnd(); it != itEnd; ++it) { COptimizedKPSetRoleInstancesItem* item(*it); item->setInitialUnprocessedSuccessorItemCount(); if (item->getUnprocessedSuccessorItemCount() <= 0) { item->setAllSuccessorProcessedFlag(true); } item->setInitialUninitializedSuccessorItemCount(); if (item->getUninitializedSuccessorItemCount() <= 0) { item->setAllSuccessorInitializedFlag(true); } } } return this; } bool COptimizedKPSetOntologyConceptRealizingItem::hasItemsInitialized() { return mItemsInitialized; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setItemsInitialized(bool initialized) { mItemsInitialized = initialized; return this; } bool COptimizedKPSetOntologyConceptRealizingItem::hasRealizationSameIndividualsInitialized() { return mRealizationSameIndividualsInitialized; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setRealizationSameIndividualsInitialized(bool initialized) { mRealizationSameIndividualsInitialized = initialized; return this; } bool COptimizedKPSetOntologyConceptRealizingItem::hasRealizationConceptsInitialized() { return mRealizationConceptsInitialized; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setRealizationConceptsInitialized(bool initialized) { mRealizationConceptsInitialized = initialized; return this; } bool COptimizedKPSetOntologyConceptRealizingItem::hasRealizationRolesInitialized() { return mRealizationRolesInitialized; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setRealizationRolesInitialized(bool initialized) { mRealizationRolesInitialized = initialized; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setTemporaryRoleRealizationOntology(CConcreteOntology* tmpOntology) { mTempRoleRealizationOntology = tmpOntology; return this; } CConcreteOntology* COptimizedKPSetOntologyConceptRealizingItem::getTemporaryRoleRealizationOntology() { return mTempRoleRealizationOntology; } COntologyRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::addProcessingRequirement(COntologyProcessingRequirement* ontoRequirement) { bool supportRequirement = false; COntologyProcessingStepRequirement* stepProcRequirement = dynamic_cast(ontoRequirement); if (stepProcRequirement) { if (stepProcRequirement->getRequiredProcessingStep()->getOntologyProcessingType() == COntologyProcessingStep::OPSCONCEPTREALIZE) { mRealizeConceptProcessingStep->addProcessingRequirement(stepProcRequirement); supportRequirement = true; markIntanceItemForConceptRealization(mOntology->getTBox()->getTopConcept()); } else if (stepProcRequirement->getRequiredProcessingStep()->getOntologyProcessingType() == COntologyProcessingStep::OPSROLEREALIZE) { mRealizeRoleProcessingStep->addProcessingRequirement(stepProcRequirement); supportRequirement = true; markIntanceItemForRoleRealization(mOntology->getRBox()->getTopObjectRole()); } else if (stepProcRequirement->getRequiredProcessingStep()->getOntologyProcessingType() == COntologyProcessingStep::OPSSAMEINDIVIDUALSREALIZE) { mRealizeSameIndividualsProcessingStep->addProcessingRequirement(stepProcRequirement); supportRequirement = true; markInstantiatedItemForSameIndividualsRealization(); } } if (!supportRequirement) { stepProcRequirement->submitRequirementUpdate(COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, COntologyProcessingStatus::PSFAILED | COntologyProcessingStatus::PSUNSUPPORTED); } return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::addRoleInstanceItemToProcessPossibleInstances(COptimizedKPSetRoleInstancesItem* instanceItem) { if (!instanceItem->hasPossibleInstancesProcessingQueuedFlag()) { if (instanceItem->hasPossibleInstances()) { mProcessingRoleInstancesItemList.append(instanceItem); instanceItem->setPossibleInstancesProcessingQueuedFlag(true); } } return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::addConceptInstanceItemToProcessPossibleInstances(COptimizedKPSetConceptInstancesItem* instanceItem) { if (!instanceItem->hasPossibleInstancesProcessingQueuedFlag()) { if (instanceItem->hasPossibleInstances()) { mProcessingConceptInstancesItemList.append(instanceItem); instanceItem->setPossibleInstancesProcessingQueuedFlag(true); } } return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::addRoleInstanceItemToInitializeCandidates(COptimizedKPSetRoleInstancesItem* instanceItem) { if (!instanceItem->hasInitializingQueuedFlag()) { if (instanceItem->requiresCandidateInitialization()) { mInitializingRoleInstancesItemList.append(instanceItem); instanceItem->setInitializingQueuedFlag(true); } } return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::addRoleInstanceIndividualItemToInitializeCandidates(COptimizedKPSetIndividualItem* indiItem) { if (!indiItem->hasInitializingRoleCandidatesQueuedFlag()) { mInitializingRoleInstancesIndividualItemList.append(indiItem); indiItem->setInitializingRoleCandidatesQueuedFlag(true); } return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::addInstantiatedItemToProcessPossibleSameIndividuals(COptimizedKPSetIndividualItem* instantiatedItem) { if (!instantiatedItem->hasPossibleSameIndividualsProcessingQueuedFlag()) { if (instantiatedItem->hasPossibleSameIndividuals()) { mProcessingSameIndividualsItemList.append(instantiatedItem); instantiatedItem->setPossibleSameIndividualsProcessingQueuedFlag(true); } } return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::markIntanceItemForRoleRealization(CRole* role, bool subroleRealizationRequired) { COptimizedKPSetRoleInstancesRedirectionItem* initialRedirectionItem = mRedirectedRoleInstancesItemHash.value(role); QList itemList; QSet itemSet; itemList.append(initialRedirectionItem->getRedirectedItem()); itemSet.insert(initialRedirectionItem->getRedirectedItem()); while (!itemList.isEmpty()) { COptimizedKPSetRoleInstancesItem* item = itemList.takeFirst(); if (!item->hasToProcessPossibleInstancesFlag() || !item->hasToInitializeCandidatesFlag()) { item->setToProcessPossibleInstancesFlag(true); item->setToInitializeCandidatesFlag(true); addRoleInstanceItemToInitializeCandidates(item); addRoleInstanceItemToProcessPossibleInstances(item); if (subroleRealizationRequired) { QList* succItemList = item->getSuccessorItemList(); for (QList::const_iterator it = succItemList->constBegin(), itEnd = succItemList->constEnd(); it != itEnd; ++it) { TRoleItemInversionPair succItemPair(*it); if (!itemSet.contains(succItemPair.first)) { itemSet.insert(succItemPair.first); itemList.append(succItemPair.first); } } } } } return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::markIntanceItemForConceptRealization(CConcept* concept, bool subconceptRealizationRequired) { COptimizedKPSetConceptInstancesItem* initialItem = mConceptInstancesItemHash.value(concept); QList itemList; QSet itemSet; itemList.append(initialItem); itemSet.insert(initialItem); while (!itemList.isEmpty()) { COptimizedKPSetConceptInstancesItem* item = itemList.takeFirst(); if (!item->hasToProcessPossibleInstancesFlag()) { item->setToProcessPossibleInstancesFlag(true); addConceptInstanceItemToProcessPossibleInstances(item); if (subconceptRealizationRequired) { QList* succItemList = item->getSuccessorItemList(); for (QList::const_iterator it = succItemList->constBegin(), itEnd = succItemList->constEnd(); it != itEnd; ++it) { COptimizedKPSetConceptInstancesItem* succItem(*it); if (!itemSet.contains(succItem)) { itemSet.insert(succItem); itemList.append(succItem); } } } } } return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::markInstantiatedItemForSameIndividualsRealization() { for (QHash::const_iterator it = mIndividualInstantiatedItemHash.constBegin(), itEnd = mIndividualInstantiatedItemHash.constEnd(); it != itEnd; ++it) { CIndividual* individual = it.key(); COptimizedKPSetIndividualItem* indiItem = it.value(); if (!indiItem->hasToProcessPossibleSameIndividualsFlag()) { indiItem->setToProcessPossibleSameIndividualsFlag(true); addInstantiatedItemToProcessPossibleSameIndividuals(indiItem); } } return this; } CCalculationConfigurationExtension* COptimizedKPSetOntologyConceptRealizingItem::getCalculationConfiguration() { return mCalculationConfig; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setRealization(CRealization* realization) { mRealization = realization; return this; } CRealization* COptimizedKPSetOntologyConceptRealizingItem::getRealization() { return mRealization; } CRealizingTestingStep* COptimizedKPSetOntologyConceptRealizingItem::getRealizeConceptProcessingStep() { return mRealizeConceptProcessingStep; } bool COptimizedKPSetOntologyConceptRealizingItem::isRealizeConceptStepFinished() { return mRealizeConceptProcessingStep->isStepFinished(); } bool COptimizedKPSetOntologyConceptRealizingItem::isRealizeConceptStepRequired() { return mRealizeConceptProcessingStep->hasRequirements(); } bool COptimizedKPSetOntologyConceptRealizingItem::areRealizeConceptStepProcessingRequirementSatisfied() { return mRealizeConceptProcessingStep->areStepProcessingRequirementSatisfied(); } CRealizingTestingStep* COptimizedKPSetOntologyConceptRealizingItem::getRealizeRoleProcessingStep() { return mRealizeRoleProcessingStep; } bool COptimizedKPSetOntologyConceptRealizingItem::isRealizeRoleStepFinished() { return mRealizeRoleProcessingStep->isStepFinished(); } bool COptimizedKPSetOntologyConceptRealizingItem::isRealizeRoleStepRequired() { return mRealizeRoleProcessingStep->hasRequirements(); } bool COptimizedKPSetOntologyConceptRealizingItem::areRealizeRoleStepProcessingRequirementSatisfied() { return mRealizeRoleProcessingStep->areStepProcessingRequirementSatisfied(); } CRealizingTestingStep* COptimizedKPSetOntologyConceptRealizingItem::getRealizeSameIndividualsProcessingStep() { return mRealizeSameIndividualsProcessingStep; } bool COptimizedKPSetOntologyConceptRealizingItem::isRealizeSameIndividualsStepFinished() { return mRealizeSameIndividualsProcessingStep->isStepFinished(); } bool COptimizedKPSetOntologyConceptRealizingItem::isRealizeSameIndividualsStepRequired() { return mRealizeSameIndividualsProcessingStep->hasRequirements(); } bool COptimizedKPSetOntologyConceptRealizingItem::areRealizeSameIndividualsStepProcessingRequirementSatisfied() { return mRealizeSameIndividualsProcessingStep->areStepProcessingRequirementSatisfied(); } bool COptimizedKPSetOntologyConceptRealizingItem::areAllStepFinished() { for (QList::const_iterator it = mProcessingSteps.constBegin(), itEnd = mProcessingSteps.constEnd(); it != itEnd; ++it) { if (!(*it)->isStepFinished()) { return false; } } return true; } bool COptimizedKPSetOntologyConceptRealizingItem::hasRemainingProcessingRequirements() { for (QList::const_iterator it = mProcessingSteps.constBegin(), itEnd = mProcessingSteps.constEnd(); it != itEnd; ++it) { if ((*it)->hasRequirements()) { return true; } } return false; } bool COptimizedKPSetOntologyConceptRealizingItem::hasRemainingInitializingRoleInstanceItems() { return !mInitializingRoleInstancesItemList.isEmpty(); } bool COptimizedKPSetOntologyConceptRealizingItem::hasRemainingInitializingRoleInstanceIndividualItems() { return !mInitializingRoleInstancesIndividualItemList.isEmpty(); } bool COptimizedKPSetOntologyConceptRealizingItem::hasRemainingProcessingRoleInstanceItems() { return !mProcessingRoleInstancesItemList.isEmpty(); } bool COptimizedKPSetOntologyConceptRealizingItem::hasRemainingProcessingConceptInstanceItems() { return !mProcessingConceptInstancesItemList.isEmpty(); } bool COptimizedKPSetOntologyConceptRealizingItem::hasRemainingProcessingSameIndividualsItems() { return !mProcessingSameIndividualsItemList.isEmpty(); } QHash* COptimizedKPSetOntologyConceptRealizingItem::getHierarchyNodeInstancesItemHash() { return &mHierNodeInstancesItemHash; } QHash* COptimizedKPSetOntologyConceptRealizingItem::getConceptInstancesItemHash() { return &mConceptInstancesItemHash; } QHash* COptimizedKPSetOntologyConceptRealizingItem::getRoleInstancesItemHash() { return &mRoleInstancesItemHash; } QList* COptimizedKPSetOntologyConceptRealizingItem::getRoleInstancesItemList() { return &mRoleInstancesItemContainer; } QList* COptimizedKPSetOntologyConceptRealizingItem::getComplexRoleInstancesItemList() { return &mComplexRoleInstancesItemContainer; } QHash* COptimizedKPSetOntologyConceptRealizingItem::getIndividualInstantiatedItemHash() { return &mIndividualInstantiatedItemHash; } COptimizedKPSetIndividualItem* COptimizedKPSetOntologyConceptRealizingItem::getIndividualInstantiatedItem(CIndividual* individual, bool directCreate) { COptimizedKPSetIndividualItem* instantiatedItem = nullptr; if (directCreate) { instantiatedItem = new COptimizedKPSetIndividualItem(); instantiatedItem->initInstantiatedItem(individual); mInstantiatedItemContainer.append(instantiatedItem); mIndividualInstantiatedItemHash.insert(individual,instantiatedItem); } else { instantiatedItem = mIndividualInstantiatedItemHash.value(individual); } return instantiatedItem; } bool COptimizedKPSetOntologyConceptRealizingItem::hasIndividualInstantiatedItem(CIndividual* individual) { return mIndividualInstantiatedItemHash.contains(individual); } QList* COptimizedKPSetOntologyConceptRealizingItem::getProcessingPossibleConceptInstancesItemList() { return &mProcessingConceptInstancesItemList; } QList* COptimizedKPSetOntologyConceptRealizingItem::getProcessingPossibleRoleInstancesItemList() { return &mProcessingRoleInstancesItemList; } QList* COptimizedKPSetOntologyConceptRealizingItem::getInitializingRoleInstancesItemList() { return &mInitializingRoleInstancesItemList; } QList* COptimizedKPSetOntologyConceptRealizingItem::getInitializingRoleInstancesIndividualItemList() { return &mInitializingRoleInstancesIndividualItemList; } QList* COptimizedKPSetOntologyConceptRealizingItem::getProcessingPossibleSameIndividualsItemList() { return &mProcessingSameIndividualsItemList; } cint64 COptimizedKPSetOntologyConceptRealizingItem::getTestedPossibleConceptInstancesCount() { return mTestedPossibleConceptInstancesCount; } cint64 COptimizedKPSetOntologyConceptRealizingItem::getOpenPossibleConceptInstancesCount() { return mOpenPossibleConceptInstancesCount; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::incTestedPossibleConceptInstancesCount(cint64 incCount) { mTestedPossibleConceptInstancesCount += incCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::incOpenPossibleConceptInstancesCount(cint64 incCount) { mOpenPossibleConceptInstancesCount += incCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::decTestedPossibleConceptInstancesCount(cint64 decCount) { mTestedPossibleConceptInstancesCount -= decCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::decOpenPossibleConceptInstancesCount(cint64 decCount) { mOpenPossibleConceptInstancesCount -= decCount; return this; } cint64 COptimizedKPSetOntologyConceptRealizingItem::getTestedPossibleSameIndividualsCount() { return mTestedPossibleSameIndividualsCount; } cint64 COptimizedKPSetOntologyConceptRealizingItem::getOpenPossibleSameIndividualsCount() { return mOpenPossibleSameIndividualsCount; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::incTestedPossibleSameIndividualsCount(cint64 incCount) { mTestedPossibleSameIndividualsCount += incCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::incOpenPossibleSameIndividualsCount(cint64 incCount) { mOpenPossibleSameIndividualsCount += incCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::decTestedPossibleSameIndividualsCount(cint64 decCount) { mTestedPossibleSameIndividualsCount -= decCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::decOpenPossibleSameIndividualsCount(cint64 decCount) { mOpenPossibleSameIndividualsCount -= decCount; return this; } bool COptimizedKPSetOntologyConceptRealizingItem::visitDirectInstances(CConceptInstantiatedItem* item, CConceptRealizationInstanceVisitor* visitor) { COptimizedKPSetConceptInstancesItem* conceptItem = (COptimizedKPSetConceptInstancesItem*)item; if (conceptItem) { QSet* individualSet = conceptItem->getKnownInstancesSet(); if (individualSet) { for (QSet::const_iterator it = individualSet->constBegin(), itEnd = individualSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetIndividualItem* individualItem(*it); if (!individualItem->isItemSameIndividualMerged()) { visitor->visitInstance(individualItem,this); } } } } return true; } bool COptimizedKPSetOntologyConceptRealizingItem::visitInstances(CConceptInstantiatedItem* item, CConceptRealizationInstanceVisitor* visitor) { COptimizedKPSetConceptInstancesItem* conceptItem = (COptimizedKPSetConceptInstancesItem*)item; if (conceptItem) { QList conceptItemList; QSet conceptItemSet; conceptItemList.append(conceptItem); conceptItemSet.insert(conceptItem); while (!conceptItemList.isEmpty()) { COptimizedKPSetConceptInstancesItem* procConceptItem = conceptItemList.takeFirst(); QSet* individualSet = procConceptItem->getKnownInstancesSet(); if (individualSet) { for (QSet::const_iterator it = individualSet->constBegin(), itEnd = individualSet->constEnd(); it != itEnd; ++it) { COptimizedKPSetIndividualItem* individualItem(*it); if (!individualItem->isItemSameIndividualMerged()) { visitor->visitInstance(individualItem,this); } } } QList* succConceptItemList = procConceptItem->getSuccessorItemList(); for (QList::const_iterator it = succConceptItemList->constBegin(), itEnd = succConceptItemList->constEnd(); it != itEnd; ++it) { COptimizedKPSetConceptInstancesItem* succConceptItem(*it); if (!conceptItemSet.contains(succConceptItem)) { conceptItemList.append(succConceptItem); conceptItemSet.insert(succConceptItem); } } } } return true; } bool COptimizedKPSetOntologyConceptRealizingItem::visitDirectTypes(CConceptInstanceItem* item, CConceptRealizationInstantiatedVisitor* visitor) { COptimizedKPSetIndividualItem* individualItem = (COptimizedKPSetIndividualItem*)item; if (individualItem) { COptimizedKPSetConceptInstancesHash* knownPossibleInstancesHash = individualItem->getKnownPossibleInstancesHash(); if (knownPossibleInstancesHash) { for (COptimizedKPSetConceptInstancesHash::const_iterator it = knownPossibleInstancesHash->constBegin(), itEnd = knownPossibleInstancesHash->constEnd(); it != itEnd; ++it) { const COptimizedKPSetConceptInstancesHashData& hashData(it.value()); COptimizedKPSetConceptInstancesData* instanceItemData = hashData.mInstanceItemData; if (instanceItemData->mKnownInstance && instanceItemData->mMostSpecific) { COptimizedKPSetConceptInstancesItem* conceptItem(instanceItemData->mInstanceItem); visitor->visitType(conceptItem,this); } } } } return true; } bool COptimizedKPSetOntologyConceptRealizingItem::visitTypes(CConceptInstanceItem* item, CConceptRealizationInstantiatedVisitor* visitor) { COptimizedKPSetIndividualItem* individualItem = (COptimizedKPSetIndividualItem*)item; if (individualItem) { COptimizedKPSetConceptInstancesHash* knownPossibleInstancesHash = individualItem->getKnownPossibleInstancesHash(); if (knownPossibleInstancesHash) { QList conceptItemList; QSet conceptItemSet; for (COptimizedKPSetConceptInstancesHash::const_iterator it = knownPossibleInstancesHash->constBegin(), itEnd = knownPossibleInstancesHash->constEnd(); it != itEnd; ++it) { const COptimizedKPSetConceptInstancesHashData& hashData(it.value()); COptimizedKPSetConceptInstancesData* instanceItemData = hashData.mInstanceItemData; if (instanceItemData->mKnownInstance && instanceItemData->mMostSpecific) { COptimizedKPSetConceptInstancesItem* conceptItem(instanceItemData->mInstanceItem); conceptItemList.append(conceptItem); conceptItemSet.insert(conceptItem); } } while (!conceptItemList.isEmpty()) { COptimizedKPSetConceptInstancesItem* conceptItem = conceptItemList.takeFirst(); visitor->visitType(conceptItem,this); QList* parentConceptItemList = conceptItem->getParentItemList(); for (QList::const_iterator it = parentConceptItemList->constBegin(), itEnd = parentConceptItemList->constEnd(); it != itEnd; ++it) { COptimizedKPSetConceptInstancesItem* parentConceptItem(*it); if (!conceptItemSet.contains(parentConceptItem)) { conceptItemList.append(parentConceptItem); conceptItemSet.insert(parentConceptItem); } } } } } return true; } bool COptimizedKPSetOntologyConceptRealizingItem::visitIndividuals(CConceptInstanceItem* item, CConceptRealizationIndividualVisitor* visitor) { COptimizedKPSetIndividualItem* individualItem = (COptimizedKPSetIndividualItem*)item; QSet* individualSet = individualItem->getKnownSameIndividualSet(); for (QSet::const_iterator it = individualSet->constBegin(), itEnd = individualSet->constEnd(); it != itEnd; ++it) { CIndividual* individual(*it); visitor->visitIndividual(individual,this); } return true; } bool COptimizedKPSetOntologyConceptRealizingItem::visitConcepts(CConceptInstantiatedItem* item, CConceptRealizationConceptVisitor* visitor) { COptimizedKPSetConceptInstancesItem* conceptItem = (COptimizedKPSetConceptInstancesItem*)item; CHierarchyNode* hierNode = conceptItem->getHierarchyNode(); if (hierNode) { QList* conList = hierNode->getEquivalentConceptList(); for (QList::const_iterator it = conList->constBegin(), itEnd = conList->constEnd(); it != itEnd; ++it) { CConcept* concept(*it); visitor->visitConcept(concept,this); } } return true; } CConceptInstantiatedItem* COptimizedKPSetOntologyConceptRealizingItem::getInstantiatedItem(CConcept* concept) { return mConceptInstancesItemHash.value(concept); } CConceptInstanceItem* COptimizedKPSetOntologyConceptRealizingItem::getInstanceItem(CIndividual* individual) { return mIndividualInstantiatedItemHash.value(individual); } CRoleInstantiatedItem* COptimizedKPSetOntologyConceptRealizingItem::getRoleInstantiatedItem(CRole* role) { return mRedirectedRoleInstancesItemHash.value(role); } CRoleInstanceItem* COptimizedKPSetOntologyConceptRealizingItem::getRoleInstanceItem(CIndividual* individual) { return mIndividualInstantiatedItemHash.value(individual); } CSameInstanceItem* COptimizedKPSetOntologyConceptRealizingItem::getSameInstanceItem(CIndividual* individual) { return mIndividualInstantiatedItemHash.value(individual); } bool COptimizedKPSetOntologyConceptRealizingItem::visitSameIndividuals(CSameInstanceItem* item, CSameRealizationIndividualVisitor* visitor) { COptimizedKPSetIndividualItem* individualItem = (COptimizedKPSetIndividualItem*)item; QSet* individualSet = individualItem->getKnownSameIndividualSet(); for (QSet::const_iterator it = individualSet->constBegin(), itEnd = individualSet->constEnd(); it != itEnd; ++it) { CIndividual* individual(*it); visitor->visitIndividual(individual,this); } return true; } bool COptimizedKPSetOntologyConceptRealizingItem::visitTargetIndividuals(CRoleInstanceItem* individualItem, CRoleInstantiatedItem* roleItem, CRoleRealizationInstanceVisitor* visitor) { COptimizedKPSetRoleInstancesRedirectionItem* roleRedirectionItem = (COptimizedKPSetRoleInstancesRedirectionItem*)roleItem; COptimizedKPSetRoleInstancesItem* roleInstItem = roleRedirectionItem->getRedirectedItem(); bool roleItemInversed = roleRedirectionItem->isInversed(); if (roleInstItem == mTopRoleInstancesItem) { for (QList::const_iterator it = mInstantiatedItemContainer.constBegin(), itEnd = mInstantiatedItemContainer.constEnd(); it != itEnd; ++it) { COptimizedKPSetIndividualItem* neighbourItem(*it); if (!neighbourItem->isItemSameIndividualMerged()) { visitor->visitRoleInstance(neighbourItem,this); } } return true; } else { COptimizedKPSetIndividualItem* indiItem = (COptimizedKPSetIndividualItem*)individualItem; COptimizedKPSetRoleNeighbourInstancesHash* roleNeighbourHash = indiItem->getKnownPossibleRoleNeighboursInstancesHash(); const COptimizedKPSetRoleNeighbourInstancesHashData& roleNeighbourHashData = roleNeighbourHash->value(roleInstItem); COptimizedKPSetRoleInstancesHash* neighbourHash = nullptr; if (roleItemInversed) { neighbourHash = roleNeighbourHashData.mRolePredecessorInstancesHash; } else { neighbourHash = roleNeighbourHashData.mRoleSuccessorInstancesHash; } if (neighbourHash) { for (COptimizedKPSetRoleInstancesHash::const_iterator it = neighbourHash->constBegin(), itEnd = neighbourHash->constEnd(); it != itEnd; ++it) { const COptimizedKPSetRoleInstancesHashData& neighbourData = it.value(); COptimizedKPSetIndividualItem* neighbourItem = it.key(); if (!neighbourItem->isItemSameIndividualMerged()) { COptimizedKPSetRoleInstancesData* roleInstData = neighbourData.mInstanceItemData; if (roleInstData && roleInstData->mKnownInstance) { visitor->visitRoleInstance(neighbourItem,this); } } } } return true; } } bool COptimizedKPSetOntologyConceptRealizingItem::visitIndividuals(CRoleInstanceItem* item, CRoleRealizationIndividualVisitor* visitor) { COptimizedKPSetIndividualItem* individualItem = (COptimizedKPSetIndividualItem*)item; QSet* individualSet = individualItem->getKnownSameIndividualSet(); for (QSet::const_iterator it = individualSet->constBegin(), itEnd = individualSet->constEnd(); it != itEnd; ++it) { CIndividual* individual(*it); visitor->visitIndividual(individual,this); } return true; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetOntologyConceptRealizingItem::getTopInstancesItem() { return mTopConceptInstancesItem; } COptimizedKPSetConceptInstancesItem* COptimizedKPSetOntologyConceptRealizingItem::getBottomInstancesItem() { return mBottomConceptInstancesItem; } cint64 COptimizedKPSetOntologyConceptRealizingItem::getTestingPossibleSameIndividualCount() { return mTestingPossibleSameIndividualCount; } cint64 COptimizedKPSetOntologyConceptRealizingItem::getTestingPossibleConceptInstanceCount() { return mTestingPossibleConceptInstanceCount; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setTestingPossibleSameIndividualCount(cint64 testCount) { mTestingPossibleSameIndividualCount = testCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setTestingPossibleConceptInstanceCount(cint64 testCount) { mTestingPossibleConceptInstanceCount = testCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::incTestingPossibleSameIndividualCount(cint64 incCount) { mTestingPossibleSameIndividualCount += incCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::decTestingPossibleSameIndividualCount(cint64 decCount) { mTestingPossibleSameIndividualCount -= decCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::incTestingPossibleConceptInstanceCount(cint64 incCount) { mTestingPossibleConceptInstanceCount += incCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::decTestingPossibleConceptInstanceCount(cint64 decCount) { mTestingPossibleConceptInstanceCount -= decCount; return this; } bool COptimizedKPSetOntologyConceptRealizingItem::hasTestingPossibleSameIndividual() { return mTestingPossibleSameIndividualCount > 0; } bool COptimizedKPSetOntologyConceptRealizingItem::hasTestingPossibleConceptInstances() { return mTestingPossibleConceptInstanceCount > 0; } cint64 COptimizedKPSetOntologyConceptRealizingItem::getTestingPossibleRoleInstanceCount() { return mTestingPossibleRoleInstanceCount; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setTestingPossibleRoleInstanceCount(cint64 testCount) { mTestingPossibleRoleInstanceCount = testCount; return this; } bool COptimizedKPSetOntologyConceptRealizingItem::hasTestingPossibleRoleInstances() { return mTestingPossibleRoleInstanceCount > 0; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::incTestingPossibleRoleInstanceCount(cint64 incCount) { mTestingPossibleRoleInstanceCount += incCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::decTestingPossibleRoleInstanceCount(cint64 decCount) { mTestingPossibleRoleInstanceCount -= decCount; return this; } cint64 COptimizedKPSetOntologyConceptRealizingItem::getTestedPossibleRoleInstancesCount() { return mTestedPossibleRoleInstancesCount; } cint64 COptimizedKPSetOntologyConceptRealizingItem::getOpenPossibleRoleInstancesCount() { return mOpenPossibleRoleInstancesCount; } cint64 COptimizedKPSetOntologyConceptRealizingItem::getInitializedRoleInstancesCount() { return mInitializedRoleInstancesCount; } cint64 COptimizedKPSetOntologyConceptRealizingItem::getRemaningInitalizingRoleInstancesCount() { return mRemainingInitalizingRoleInstancesCount; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::incTestedPossibleRoleInstancesCount(cint64 incCount) { mTestedPossibleRoleInstancesCount += incCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::incOpenPossibleRoleInstancesCount(cint64 incCount) { mOpenPossibleRoleInstancesCount += incCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::decTestedPossibleRoleInstancesCount(cint64 decCount) { mTestedPossibleRoleInstancesCount -= decCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::decOpenPossibleRoleInstancesCount(cint64 decCount) { mOpenPossibleRoleInstancesCount -= decCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::incInitializedRoleInstancesCount(cint64 incCount) { mInitializedRoleInstancesCount += incCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::decInitializedRoleInstancesCount(cint64 decCount) { mInitializedRoleInstancesCount -= decCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::incRemaningInitalizingInstancesCount(cint64 incCount) { mRemainingInitalizingRoleInstancesCount += incCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::decRemaningInitalizingInstancesCount(cint64 decCount) { mRemainingInitalizingRoleInstancesCount -= decCount; return this; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetOntologyConceptRealizingItem::getTopRoleInstancesItem() { return mTopRoleInstancesItem; } COptimizedKPSetRoleInstancesItem* COptimizedKPSetOntologyConceptRealizingItem::getBottomRoleInstancesItem() { return mBottomRoleInstancesItem; } QHash* COptimizedKPSetOntologyConceptRealizingItem::getMarkerConceptInstancesItemHash() { return &mMarkerConceptInstancesItemHash; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::addRoleCandidateInitalizingIndividualsItem(COptimizedKPSetIndividualItem* indiItem) { mRoleCandidateInitalizingIndividualsItemList.append(indiItem); return this; } QList* COptimizedKPSetOntologyConceptRealizingItem::getRoleCandidateInitalizingIndividualsItemList() { return &mRoleCandidateInitalizingIndividualsItemList; } bool COptimizedKPSetOntologyConceptRealizingItem::isConceptRealizationInstalled() { return mConceptRealizationInstalled; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setConceptRealizationInstalled(bool installed) { mConceptRealizationInstalled = installed;; return this; } bool COptimizedKPSetOntologyConceptRealizingItem::isRoleRealizationInstalled() { return mRoleRealizationInstalled; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setRoleRealizationInstalled(bool installed) { mRoleRealizationInstalled = installed; return this; } bool COptimizedKPSetOntologyConceptRealizingItem::isSameRealizationInstalled() { return mSameRealizationInstalled; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setSameRealizationInstalled(bool installed) { mSameRealizationInstalled = installed;; return this; } cint64 COptimizedKPSetOntologyConceptRealizingItem::getTestingRoleInstanceCandidatesCount() { return mTestingRoleInstanceCandidateCount; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setTestingRoleInstanceCandidatesCount(cint64 testCount) { mTestingRoleInstanceCandidateCount = testCount; return this; } bool COptimizedKPSetOntologyConceptRealizingItem::hasTestingRoleInstanceCandidates() { return mTestingRoleInstanceCandidateCount > 0; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::incTestingRoleInstanceCandidatesCount(cint64 incCount) { mTestingRoleInstanceCandidateCount += incCount; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::decTestingRoleInstanceCandidatesCount(cint64 decCount) { mTestingRoleInstanceCandidateCount -= decCount; return this; } bool COptimizedKPSetOntologyConceptRealizingItem::isCountingPossibleConceptInstancesTesting() { return mCountingPossibleConceptInstancesTesting; } bool COptimizedKPSetOntologyConceptRealizingItem::isCountingPossibleRoleInstancesTesting() { return mCountingPossibleRoleInstancesTesting; } bool COptimizedKPSetOntologyConceptRealizingItem::isCountingPossibleSameInstancesTesting() { return mCountingPossibleSameInstancesTesting; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setCountingPossibleConceptInstancesTesting(bool counting) { mCountingPossibleConceptInstancesTesting = counting; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setCountingPossibleRoleInstancesTesting(bool counting) { mCountingPossibleRoleInstancesTesting = counting; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setCountingPossibleSameInstancesTesting(bool counting) { mCountingPossibleSameInstancesTesting = counting; return this; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setTemporarySameRealizationOntology(CConcreteOntology* tmpOntology) { mTempSameRealizationOntology = tmpOntology; return this; } CConcreteOntology* COptimizedKPSetOntologyConceptRealizingItem::getTemporarySameRealizationOntology() { return mTempSameRealizationOntology; } QList* COptimizedKPSetOntologyConceptRealizingItem::getPossibleSameIndividualsItemList() { return &mPossibleSameIndiItemList; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::addPossibleSameIndividualsItem(COptimizedKPSetIndividualItem* indiItem) { mPossibleSameIndiItemList.append(indiItem); return this; } bool COptimizedKPSetOntologyConceptRealizingItem::requiresIndividualDependenceTracking() { return mIndiDepTrackReq; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setIndividualDependenceTrackingRequired(bool indiDepTrackingRequired) { mIndiDepTrackReq = indiDepTrackingRequired; return this; } bool COptimizedKPSetOntologyConceptRealizingItem::isExtraConsistencyTestingStepRequired() { return mExtraConsistencyTestingRequired; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setExtraConsistencyTestingStepRequired(bool required) { mExtraConsistencyTestingRequired = required; return this; } bool COptimizedKPSetOntologyConceptRealizingItem::isExtraConsistencyTesting() { return mExtraConsistencyTesting; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setExtraConsistencyTesting(bool testing) { mExtraConsistencyTesting = testing; return this; } bool COptimizedKPSetOntologyConceptRealizingItem::isExtraConsistencyTested() { return mExtraConsistencyTested; } COptimizedKPSetOntologyConceptRealizingItem* COptimizedKPSetOntologyConceptRealizingItem::setExtraConsistencyTested(bool tested) { mExtraConsistencyTested = tested; return this; } QList* COptimizedKPSetOntologyConceptRealizingItem::getInstantiatedItemList() { return &mInstantiatedItemContainer; } QTime* COptimizedKPSetOntologyConceptRealizingItem::getInitializationTime() { return &mInitTime; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesData.h0000644000175000017500000000402412520551254030723 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANCESDATA_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANCESDATA_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "COptimizedKPSetConceptInstancesItem.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realizer { /*! * * \class COptimizedKPSetConceptInstancesData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetConceptInstancesData { // public methods public: //! Constructor COptimizedKPSetConceptInstancesData(); COptimizedKPSetConceptInstancesItem* mInstanceItem; bool mKnownInstance; bool mPossibleInstance; bool mMostSpecific; bool mTestingInstance; bool mTestedInstance; bool mDerived; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANCESDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizerThread.h0000644000175000017500000001146212520551260025000 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_Realizer_CREALIZERTHREAD_H #define KONCLUDE_REASONER_Realizer_CREALIZERTHREAD_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "CRealizer.h" #include "CRealizingContext.h" #include "COntologyRealizingItem.h" #include "CRealizingCallbackDataContext.h" #include "CRealizingTestingItem.h" #include "CRealizationMessageObserver.h" // Other includes #include "Reasoner/Realizer/Events/CCallbackRealizedOntologyEvent.h" #include "Reasoner/Realizer/Events/CRealizeOntologyEvent.h" #include "Reasoner/Realizer/Events/CRealizingCalculatedCallbackEvent.h" #include "Reasoner/Realizer/Events/CRealizationMessageEvent.h" #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Reasoner/Kernel/Manager/CReasonerManager.h" #include "Concurrent/CThread.h" #include "Concurrent/Callback/CBlockingCallbackData.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogDomain.h" namespace Konclude { using namespace Logger; using namespace Concurrent; using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; using namespace Kernel::Manager; using namespace Kernel::Calculation; namespace Realizer { using namespace Events; /*! * * \class CRealizerThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealizerThread : public CRealizer, public CThread, public CRealizationMessageObserver { // public methods public: //! Constructor CRealizerThread(CReasonerManager* reasonerManager); //! Destructor virtual ~CRealizerThread(); virtual bool realize(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList, CCallbackData* callback); virtual bool realize(CConcreteOntology* ontology, CConfigurationBase* config, const QList& requirementList); virtual bool callbackRealized(CConcreteOntology* ontology, CCallbackData* callback); virtual CRealizationMessageObserver* tellRealizationMessage(CConcreteOntology *ontology, CRealizationMessageData* messageData, CMemoryPool* memoryPool); // protected methods protected: virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); virtual bool createNextTest() = 0; virtual bool canProcessMoreTests(); virtual bool doNextPendingTests(); virtual COntologyRealizingItem* initializeOntologyRealizingItem(CConcreteOntology* ontology, CConfigurationBase* config); virtual bool addOntologyRealizingCallback(COntologyRealizingItem* item, CCallbackData* callback); virtual bool addOntologyRealizingRequirements(COntologyRealizingItem* item, COntologyProcessingRequirement* requirement); CRealizerThread* processCalculationJob(CSatisfiableCalculationJob* job, COntologyRealizingItem* preCompItem, CRealizingTestingItem* preTestItem); virtual bool realizingTested(COntologyRealizingItem* ontPreCompItem, CRealizingTestingItem* preTestItem, CRealizingCalculatedCallbackEvent* pcce) = 0; virtual bool processRealizationMessage(COntologyRealizingItem* ontRealItem, CRealizationMessageData* messageData, CMemoryPool* memoryPools) = 0; // protected variables protected: qint64 mConfMaxTestParallelCount; qint64 mCurrRunningTestParallelCount; QSet mActiveOntItemSet; QSet mInactiveOntItemSet; QList mProcessingOntItemList; QHash mOntItemHash; cint64 mRealizingCount; CReasonerManager* mReasoner; CCalculationManager* mCalculationManager; cint64 mStatCalculatingJobs; CRealizingContext mContext; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_Realizer_CREALIZERTHREAD_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIncrementalKPSetOntologyConceptRealizingItem.cppKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIncrementalKPSetOntologyConceptRealizingIte0000644000175000017500000000303012520551252032364 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIncrementalKPSetOntologyConceptRealizingItem.h" namespace Konclude { namespace Reasoner { namespace Realizer { CIncrementalKPSetOntologyConceptRealizingItem::CIncrementalKPSetOntologyConceptRealizingItem() { } CIncrementalKPSetOntologyConceptRealizingItem::~CIncrementalKPSetOntologyConceptRealizingItem() { } CIncrementalKPSetOntologyConceptRealizingItem* CIncrementalKPSetOntologyConceptRealizingItem::initRequirementConfigRealizingItem(CConcreteOntology* ontology, CConfigurationBase* config) { COptimizedKPSetOntologyConceptRealizingItem::initRequirementConfigRealizingItem(ontology,config); return this; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIndividualPairRoleInstanceTestingItem.cpp0000644000175000017500000000352312520551252032016 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualPairRoleInstanceTestingItem.h" namespace Konclude { namespace Reasoner { namespace Realizer { CIndividualPairRoleInstanceTestingItem::CIndividualPairRoleInstanceTestingItem(COntologyRealizingItem* preproItem, COptimizedKPSetRoleInstancesItem* instancesItem, COptimizedKPSetIndividualItemPair individualItemPair) : CRealizingTestingItem(preproItem) { mOntologyPreproItem = preproItem; mInstancesItem = instancesItem; mIndividualItemPair = individualItemPair; } CRealizingTestingItem::REALIZINGTESTINGTYPE CIndividualPairRoleInstanceTestingItem::getRealizingTestingType() { return CRealizingTestingItem::INDIVIDUALPAIRROLEINCSTANCETESTINGTYPE; } COptimizedKPSetRoleInstancesItem* CIndividualPairRoleInstanceTestingItem::getInstancesItem() { return mInstancesItem; } COptimizedKPSetIndividualItemPair CIndividualPairRoleInstanceTestingItem::getIndividualItemPair() { return mIndividualItemPair; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesHashData.h0000644000175000017500000000351712520551256031045 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESHASHDATA_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESHASHDATA_H // Libraries includes // Namespace includes #include "RealizerSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realizer { /*! * * \class COptimizedKPSetRoleInstancesHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetRoleInstancesHashData { // public methods public: //! Constructor COptimizedKPSetRoleInstancesHashData(); COptimizedKPSetRoleInstancesData* mInstanceItemData; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIndividualPairRoleInstanceTestingItem.h0000644000175000017500000000463612520551252031471 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CINDIVIDUALPAIRROLEINSTANCETESTINGITEM_H #define KONCLUDE_REASONER_REALIZER_CINDIVIDUALPAIRROLEINSTANCETESTINGITEM_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "CRealizingTestingItem.h" #include "COptimizedKPSetIndividualItemPair.h" #include "COptimizedKPSetRoleInstancesItem.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realizer { /*! * * \class CIndividualInstanceTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualPairRoleInstanceTestingItem : public CRealizingTestingItem { // public methods public: //! Constructor CIndividualPairRoleInstanceTestingItem(COntologyRealizingItem* preproItem, COptimizedKPSetRoleInstancesItem* instancesItem, COptimizedKPSetIndividualItemPair individualItemPair); virtual REALIZINGTESTINGTYPE getRealizingTestingType(); COptimizedKPSetRoleInstancesItem* getInstancesItem(); COptimizedKPSetIndividualItemPair getIndividualItemPair(); // protected methods protected: // protected variables protected: COntologyRealizingItem* mOntologyPreproItem; COptimizedKPSetRoleInstancesItem* mInstancesItem; COptimizedKPSetIndividualItemPair mIndividualItemPair; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CINDIVIDUALPAIRROLEINSTANCETESTINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesHash.h0000644000175000017500000000425312520551254030741 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANCESHASH_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANCESHASH_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "COptimizedKPSetConceptInstancesHashData.h" // Other includes #include "Reasoner/Ontology/CIndividual.h" #include "Reasoner/Realization/CConceptInstanceItem.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; using namespace Realization; namespace Realizer { /*! * * \class COptimizedKPSetConceptInstancesHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetConceptInstancesHash : public QHash { // public methods public: //! Constructor COptimizedKPSetConceptInstancesHash(); COptimizedKPSetConceptInstancesData* getInstanceItemData(COptimizedKPSetConceptInstancesItem* item); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETCONCEPTINSTANCESHASH_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIndividualSameTestingItem.cpp0000644000175000017500000000340112520551252027474 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualSameTestingItem.h" namespace Konclude { namespace Reasoner { namespace Realizer { CIndividualSameTestingItem::CIndividualSameTestingItem(COntologyRealizingItem* preproItem, COptimizedKPSetIndividualItem* instantiatedItem1, COptimizedKPSetIndividualItem* instantiatedItem2) : CRealizingTestingItem(preproItem) { mOntologyPreproItem = preproItem; mInstantiatedItem1 = instantiatedItem1; mInstantiatedItem2 = instantiatedItem2; } CRealizingTestingItem::REALIZINGTESTINGTYPE CIndividualSameTestingItem::getRealizingTestingType() { return CRealizingTestingItem::INDIVIDUALSAMETESTINGTYPE; } COptimizedKPSetIndividualItem* CIndividualSameTestingItem::getInstantiatedItem1() { return mInstantiatedItem1; } COptimizedKPSetIndividualItem* CIndividualSameTestingItem::getInstantiatedItem2() { return mInstantiatedItem2; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesHashData.cpp0000644000175000017500000000217712520551254032071 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetConceptInstancesHashData.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetConceptInstancesHashData::COptimizedKPSetConceptInstancesHashData() { mInstanceItemData = nullptr; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesData.cpp0000644000175000017500000000241512520551256030570 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetRoleInstancesData.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetRoleInstancesData::COptimizedKPSetRoleInstancesData() { mInstanceItem = nullptr; mKnownInstance = false; mPossibleInstance = false; mMostSpecific = false; mTestingInstance = false; mTestedInstance = false; mDerived = false; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIncrementalKPSetOntologyConceptRealizingItem.hKonclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIncrementalKPSetOntologyConceptRealizingIte0000644000175000017500000000435512520551252032377 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CIncrementalKPSetOntologyConceptRealizingItem_H #define KONCLUDE_REASONER_REALIZER_CIncrementalKPSetOntologyConceptRealizingItem_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "COptimizedKPSetOntologyConceptRealizingItem.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Kernel::Task; using namespace Ontology; using namespace Realization; namespace Realizer { /*! * * \class CIncrementalKPSetOntologyConceptRealizingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIncrementalKPSetOntologyConceptRealizingItem : public COptimizedKPSetOntologyConceptRealizingItem { // public methods public: //! Constructor CIncrementalKPSetOntologyConceptRealizingItem(); ~CIncrementalKPSetOntologyConceptRealizingItem(); virtual CIncrementalKPSetOntologyConceptRealizingItem* initRequirementConfigRealizingItem(CConcreteOntology* ontology, CConfigurationBase* config); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CIncrementalKPSetOntologyConceptRealizingItem_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetIndividualItemPair.h0000644000175000017500000000376712520551254030426 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETINDIVIDUALITEMPAIR_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETINDIVIDUALITEMPAIR_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "COptimizedKPSetIndividualItem.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { using namespace Ontology; namespace Realizer { /*! * * \class COptimizedKPSetIndividualItemPair * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetIndividualItemPair : public QPair { // public methods public: COptimizedKPSetIndividualItemPair(COptimizedKPSetIndividualItem* item1, COptimizedKPSetIndividualItem* item2); COptimizedKPSetIndividualItemPair(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETINDIVIDUALITEMPAIR_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizationMessageData.cpp0000644000175000017500000000240612520551260027004 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizationMessageData.h" namespace Konclude { namespace Reasoner { namespace Realizer { CRealizationMessageData::CRealizationMessageData() : CLinkerBase(this) { } CRealizationMessageData::REALIZATIONMESSAGEDATA CRealizationMessageData::getRealizationMessageDataType() { return mMessageDataType; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesHash.cpp0000644000175000017500000000265412520551254031277 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COptimizedKPSetConceptInstancesHash.h" namespace Konclude { namespace Reasoner { namespace Realizer { COptimizedKPSetConceptInstancesHash::COptimizedKPSetConceptInstancesHash() { } COptimizedKPSetConceptInstancesData* COptimizedKPSetConceptInstancesHash::getInstanceItemData(COptimizedKPSetConceptInstancesItem* item) { COptimizedKPSetConceptInstancesHashData& hashData = QHash::operator[](item); return hashData.mInstanceItemData; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIndividualConceptInstanceTestingItem.cpp0000644000175000017500000000350212520551252031671 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualConceptInstanceTestingItem.h" namespace Konclude { namespace Reasoner { namespace Realizer { CIndividualConceptInstanceTestingItem::CIndividualConceptInstanceTestingItem(COntologyRealizingItem* preproItem, COptimizedKPSetConceptInstancesItem* instancesItem, COptimizedKPSetIndividualItem* instantiatedItem) : CRealizingTestingItem(preproItem) { mOntologyPreproItem = preproItem; mInstancesItem = instancesItem; mInstantiatedItem = instantiatedItem; } CRealizingTestingItem::REALIZINGTESTINGTYPE CIndividualConceptInstanceTestingItem::getRealizingTestingType() { return CRealizingTestingItem::INDIVIDUALCONCEPTINCSTANCETESTINGTYPE; } COptimizedKPSetConceptInstancesItem* CIndividualConceptInstanceTestingItem::getInstancesItem() { return mInstancesItem; } COptimizedKPSetIndividualItem* CIndividualConceptInstanceTestingItem::getInstantiatedItem() { return mInstantiatedItem; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesData.h0000644000175000017500000000371612520551256030242 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESDATA_H #define KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESDATA_H // Libraries includes // Namespace includes #include "RealizerSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realizer { /*! * * \class COptimizedKPSetRoleInstancesData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COptimizedKPSetRoleInstancesData { // public methods public: //! Constructor COptimizedKPSetRoleInstancesData(); COptimizedKPSetRoleInstancesItem* mInstanceItem; bool mKnownInstance; bool mPossibleInstance; bool mMostSpecific; bool mTestingInstance; bool mTestedInstance; bool mDerived; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_COPTIMIZEDKPSETROLEINSTANCESDATA_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizationProgress.cpp0000644000175000017500000000475212520551260026440 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizationProgress.h" namespace Konclude { namespace Reasoner { namespace Realizer { CRealizationProgress::CRealizationProgress() { resetValues(); } qint64 CRealizationProgress::getRealizationCount() { return mRealizationCount; } qint64 CRealizationProgress::getTestedClasses() { return mTestedClasses; } qint64 CRealizationProgress::getTotalClasses() { return mTotalClasses; } double CRealizationProgress::getRemainingMilliSeconds() { return mRemainingMilliSeconds; } double CRealizationProgress::getProgessPercent() { return mProgessPercent; } CRealizationProgress *CRealizationProgress::setRealizationCount(qint64 classificationCount) { mRealizationCount = classificationCount; return this; } CRealizationProgress *CRealizationProgress::setTestedClasses(qint64 testedClasses) { mTestedClasses = testedClasses; return this; } CRealizationProgress *CRealizationProgress::setTotalClasses(qint64 totalClasses) { mTotalClasses = totalClasses; return this; } CRealizationProgress *CRealizationProgress::setRemainingMilliSeconds(double remainingMilliSeconds) { mRemainingMilliSeconds = remainingMilliSeconds; return this; } CRealizationProgress *CRealizationProgress::setProgessPercent(double progessPercent) { mProgessPercent = progessPercent; return this; } CRealizationProgress *CRealizationProgress::resetValues() { mRealizationCount = 0; mTestedClasses = 0; mTotalClasses = 0; mRemainingMilliSeconds = 0.; mProgessPercent = 0.; return this; } }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CIndividualConceptInstanceTestingItem.h0000644000175000017500000000446612520551252031350 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CINDIVIDUALCONCEPTINSTANCETESTINGITEM_H #define KONCLUDE_REASONER_REALIZER_CINDIVIDUALCONCEPTINSTANCETESTINGITEM_H // Libraries includes // Namespace includes #include "RealizerSettings.h" #include "CRealizingTestingItem.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Reasoner { namespace Realizer { /*! * * \class CIndividualInstanceTestingItem * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualConceptInstanceTestingItem : public CRealizingTestingItem { // public methods public: //! Constructor CIndividualConceptInstanceTestingItem(COntologyRealizingItem* preproItem, COptimizedKPSetConceptInstancesItem* instancesItem, COptimizedKPSetIndividualItem* instantiatedItem); virtual REALIZINGTESTINGTYPE getRealizingTestingType(); COptimizedKPSetConceptInstancesItem* getInstancesItem(); COptimizedKPSetIndividualItem* getInstantiatedItem(); // protected methods protected: // protected variables protected: COntologyRealizingItem* mOntologyPreproItem; COptimizedKPSetConceptInstancesItem* mInstancesItem; COptimizedKPSetIndividualItem* mInstantiatedItem; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CINDIVIDUALCONCEPTINSTANCETESTINGITEM_H Konclude-v0.6.2-544-SourceCode/Source/Reasoner/Realizer/CRealizingCallbackDataContext.h0000644000175000017500000000415012520551260027567 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_REALIZER_CREALIZINGCALLBACKDATACONTEXT_H #define KONCLUDE_REASONER_REALIZER_CREALIZINGCALLBACKDATACONTEXT_H // Libraries includes // Namespace includes #include "RealizerSettings.h" // Other includes #include "Concurrent/Callback/CCallbackDataContext.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; namespace Reasoner { using namespace Ontology; namespace Realizer { /*! * * \class CRealizingCallbackDataContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealizingCallbackDataContext : public CCallbackDataContext { // public methods public: //! Constructor CRealizingCallbackDataContext(bool realized, CConcreteOntology* ontology); virtual CConcreteOntology *getOntology(); virtual bool isRealized(); // protected methods protected: // protected variables protected: CConcreteOntology* mOntology; bool mRealizered; // private methods private: // private variables private: }; }; // end namespace Realizer }; // end namespace Reasoner }; // end namespace Konclude #endif // KONCLUDE_REASONER_REALIZER_CREALIZINGCALLBACKDATACONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/0000755000175000017500000000000012613407250020404 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Concurrent/CWatchDogThread.cpp0000644000175000017500000001522312520756330024051 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWatchDogThread.h" #include "Events/CWatchDogFeedbackEvent.h" #include "Events/CRequestFeedbackEvent.h" namespace Konclude { namespace Concurrent { CWatchDogThread * CWatchDogThread::watchDogInstance = 0; QSemaphore * CWatchDogThread::syncSemaphore = new QSemaphore(1); CWatchDogThread::CWatchDogThread() : CIntervalThread("WatchDog") { startThread(); currentUpdateNumber = 0; } CWatchDogThread::~CWatchDogThread() { stopThread(); } CWatchDogThread *CWatchDogThread::getInstance() { if (watchDogInstance == 0) { syncSemaphore->acquire(); if (watchDogInstance == 0) { watchDogInstance = new CWatchDogThread(); } syncSemaphore->release(); } return watchDogInstance; } bool CWatchDogThread::registerThread(CThread *thread) { regSync.lockForWrite(); qint64 threadID = thread->getThreadID(); CWatchDogThreadData *data = 0; if (threadWatch.contains(threadID)) { data = threadWatch.value(threadID); } else { data = new CWatchDogThreadData(); threadWatch.insert(threadID,data); data->setRegisterThread(true); data->setThreadID(threadID); data->setThreadName(thread->getThreadName()); data->setThread(thread); } data->setThreadActive(true); data->setRunTime(thread->getRunTimeSecs()); data->setWaitTime(thread->getWaitTimeSecs()); data->setTaskDescription(thread->getTaskDescription()); regSync.unlock(); return true; } void CWatchDogThread::feedbackThread(CThread *thread, qint64 updateNumber) { CWatchDogFeedbackEvent *wdFEvent = new CWatchDogFeedbackEvent(thread->getThreadID(),updateNumber); postEvent(wdFEvent); } void CWatchDogThread::checkoutThread(CThread *thread) { regSync.lockForWrite(); qint64 threadID = thread->getThreadID(); CWatchDogThreadData *data = 0; if (threadWatch.contains(threadID)) { data = threadWatch.value(threadID); } else { data = new CWatchDogThreadData(); threadWatch.insert(threadID,data); data->setRegisterThread(true); data->setThreadID(threadID); data->setThreadName(thread->getThreadName()); data->setThread(thread); } data->setThreadActive(false); data->setThreadError(false); data->setRunTime(thread->getRunTimeSecs()); data->setWaitTime(thread->getWaitTimeSecs()); data->setTaskDescription(thread->getTaskDescription()); regSync.unlock(); } void CWatchDogThread::crashedThread(CThread *thread) { regSync.lockForWrite(); qint64 threadID = thread->getThreadID(); CWatchDogThreadData *data = 0; if (threadWatch.contains(threadID)) { data = threadWatch.value(threadID); } else { data = new CWatchDogThreadData(); threadWatch.insert(threadID,data); data->setRegisterThread(true); data->setThreadID(threadID); data->setThreadName(thread->getThreadName()); data->setThread(thread); } data->setThreadActive(false); data->setThreadError(true); data->setRunTime(thread->getRunTimeSecs()); data->setWaitTime(thread->getWaitTimeSecs()); data->setTaskDescription(thread->getTaskDescription()); regSync.unlock(); } QLinkedList CWatchDogThread::getActiveThreadList() { QLinkedList retDataList; regSync.lockForRead(); QList threadList = threadWatch.values(); foreach (CWatchDogThreadData *threadData, threadList) { if (threadData->isThreadActive()) { retDataList.append(*threadData); } } regSync.unlock(); return retDataList; } // Thread functions void CWatchDogThread::threadStarted() { CIntervalThread::threadStarted(); startTimerWithInterval(REQUESTFEEDBACKTIMERID,1000); startTimerWithInterval(UPDATETHREADINFOTIMERID,500); } bool CWatchDogThread::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CIntervalThread::processCustomsEvents(type,event)) { return true; } if (type == EVENTFEEDBACKTHREADWATCHDOG) { SETTASKDESCRIPTION("Process Thread Feedback"); CWatchDogFeedbackEvent *wdfe = (CWatchDogFeedbackEvent *)event; regSync.lockForWrite(); qint64 threadID = wdfe->getThreadID(); qint64 uNr = wdfe->getUpdateNumber(); CWatchDogThreadData *data = 0; if (threadWatch.contains(threadID)) { data = threadWatch.value(threadID); } if (data) { data->setUpdateNumber(uNr,QDateTime::currentDateTime()); } regSync.unlock(); return true; } return false; } bool CWatchDogThread::processTimer(qint64 timerID) { if (timerID == REQUESTFEEDBACKTIMERID) { SETTASKDESCRIPTION("Request Thread Feedbacks"); regSync.lockForRead(); QList threadList = threadWatch.values(); foreach (CWatchDogThreadData *threadData, threadList) { if (threadData->isThreadActive()) { CThread *thread = threadData->getThread(); sendRequestFeedbackEvent(thread,currentUpdateNumber); } } regSync.unlock(); currentUpdateNumber++; return true; } else if (timerID == UPDATETHREADINFOTIMERID) { SETTASKDESCRIPTION("Update Thread Informations"); regSync.lockForWrite(); QList threadList = threadWatch.values(); foreach (CWatchDogThreadData *threadData, threadList) { if (threadData->isThreadActive()) { CThread *thread = threadData->getThread(); updateThreadData(thread,threadData); } } regSync.unlock(); return true; } return false; } void CWatchDogThread::sendRequestFeedbackEvent(CThread *thread, qint64 uNr) { thread->postEvent(new CRequestFeedbackEvent(this,uNr)); } void CWatchDogThread::updateThreadData(CThread *thread, CWatchDogThreadData *threadData) { threadData->setTaskDescription(thread->getTaskDescription()); threadData->setRunTime(thread->getRunTimeSecs()); threadData->setWaitTime(thread->getWaitTimeSecs()); } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventAllocator.h0000644000175000017500000000457312520756324023621 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CEVENTALLOCATOR_H #define KONCLUDE_CONCURRENT_CEVENTALLOCATOR_H // Library includes // Namespace includes #include "ConcurrentSettings.h" // Other includes #include "Utilities/Memory/CObjectMemoryPoolAllocator.h" #include "Utilities/Memory/CMemoryTemporaryAllocationManager.h" #include "Utilities/Memory/CMemoryPool.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Memory; namespace Concurrent { /*! * * \class CEventAllocator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CEventAllocator : public CObjectMemoryPoolAllocator { // public methods public: //! Constructor CEventAllocator() { } //! Destructor virtual ~CEventAllocator() { } static inline T* allocateAndConstructEvent(CMemoryTemporaryAllocationManager* memoryTmpAllocatorManager) { T* object = 0; object = CObjectMemoryPoolAllocator::allocateAndConstructWithMemroyPool(memoryTmpAllocatorManager); return object; } static inline T* allocateAndConstructEvent(CMemoryPool* memoryPool) { T* object = 0; object = CObjectMemoryPoolAllocator::allocateAndConstructWithMemroyPool(memoryPool); return object; } // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #include "CEventAllocator.cpp" #endif // KONCLUDE_CONCURRENT_CEVENTALLOCATOR_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventLinker.h0000644000175000017500000000362212520756326023121 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CEVENTLINKER_H #define KONCLUDE_CONCURRENT_CEVENTLINKER_H // Library includes // Namespace includes #include "ConcurrentSettings.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Concurrent { /*! * * \class CEventLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEventLinker : public CLinkerBase { // public methods public: //! Constructor CEventLinker(); //! Destructor ~CEventLinker(); CEventLinker* getNextEventLinker(); CEventLinker* initEventLinker(CEvent* event = 0, CEventLinker* nextEventLinker = 0); CEventLinker* setNextEventLinker(CEventLinker* nextEventLinker = 0); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CEVENTLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventAllocator.cpp0000644000175000017500000000210612520756324024142 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CEVENTALLOCATOR_CPP #define KONCLUDE_CONCURRENT_CEVENTALLOCATOR_CPP #include "CEventAllocator.h" namespace Konclude { namespace Concurrent { }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CEVENTALLOCATOR_CPP Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventChannelLinker.h0000644000175000017500000000413612520756324024411 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CEVENTCHANNELLINKER_H #define KONCLUDE_CONCURRENT_CEVENTCHANNELLINKER_H // Library includes // Namespace includes #include "ConcurrentSettings.h" #include "CEventChannel.h" // Other includes #include "Utilities/Container/CSortedLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Concurrent { /*! * * \class CEventChannelLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEventChannelLinker : public CSortedLinkerBase { // public methods public: //! Constructor CEventChannelLinker(CEventChannel* eventChannel = 0, CEventChannelLinker* eventChannelLinker = 0); //! Destructor virtual ~CEventChannelLinker(); static inline bool sortedLinkerDataCompare(CEventChannel* const & beforeData1, CEventChannel* const & data2) { return beforeData1->getChannelPriority() > data2->getChannelPriority(); } // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CEVENTCHANNELLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/0000755000175000017500000000000012613407250021650 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CWatchDogFeedbackEvent.cpp0000644000175000017500000000307012520756324026574 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWatchDogFeedbackEvent.h" namespace Konclude { namespace Concurrent { namespace Events { CWatchDogFeedbackEvent::CWatchDogFeedbackEvent(qint64 threadID, qint64 updateNumber) : CControlEvent(EVENTFEEDBACKTHREADWATCHDOG) { id = threadID; uNr = updateNumber; } CWatchDogFeedbackEvent::~CWatchDogFeedbackEvent() { } qint64 CWatchDogFeedbackEvent::getThreadID() { return id; } void CWatchDogFeedbackEvent::seThreadID(qint64 threadID) { id = threadID; } void CWatchDogFeedbackEvent::setUpdateNumber(qint64 updateNumber) { uNr = updateNumber; } qint64 CWatchDogFeedbackEvent::getUpdateNumber() { return uNr; } }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CControlEvent.h0000644000175000017500000000274712520756324024566 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CCONTROLEVENT_H #define KONCLUDE_CONCURRENT_CCONTROLEVENT_H #include namespace Konclude { namespace Concurrent { namespace Events { /*! * \class CControlEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CControlEvent : public QEvent { // public methods public: //! Constructor CControlEvent(QEvent::Type type); //! Destructor virtual ~CControlEvent(); // protected methods protected: // private members private: }; }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CCONTROLEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CTimerIntervalEvent.cpp0000644000175000017500000000421612520756324026257 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTimerIntervalEvent.h" namespace Konclude { namespace Concurrent { namespace Events { CTimerIntervalEvent::CTimerIntervalEvent(qint64 timerID, qint64 interval, bool active, bool deactive, qint64 remInvocs) : CControlEvent(EVENTTIMERINTERVAL) { id = timerID; tInt = interval; tActive = active; tDeactive = deactive; remCall = remInvocs; } CTimerIntervalEvent::~CTimerIntervalEvent() { } qint64 CTimerIntervalEvent::getTimerID() { return id; } void CTimerIntervalEvent::setTimerID(qint64 timerID) { id = timerID; } void CTimerIntervalEvent::setTimerInterval(qint64 interval) { tInt = interval; } qint64 CTimerIntervalEvent::getTimerInterval() { return tInt; } void CTimerIntervalEvent::setTimerActive(bool active) { tActive = active; } bool CTimerIntervalEvent::getTimerActive() { return tActive; } void CTimerIntervalEvent::setTimerDeactive(bool deactive) { tDeactive = deactive; } bool CTimerIntervalEvent::getTimerDeactive() { return tDeactive; } void CTimerIntervalEvent::setRemainingTimerInvocations(qint64 remInvoc) { remCall = remInvoc; } qint64 CTimerIntervalEvent::getRemainingTimerInvocations() { return remCall; } }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CWaitSynchronizationEvent.h0000644000175000017500000000337712520756324027174 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_EVENTS_CWAITSYNCHRONIZATIONEVENT_H #define KONCLUDE_CONCURRENT_EVENTS_CWAITSYNCHRONIZATIONEVENT_H #include #include #include "../ConcurrentSettings.h" #include "CControlEvent.h" namespace Konclude { namespace Concurrent { namespace Events { /*! * \class CWaitSynchronizationEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CWaitSynchronizationEvent : public CControlEvent { // public methods public: //! Constructor CWaitSynchronizationEvent(QSemaphore *synchronizationSemaphore); //! Destructor virtual ~CWaitSynchronizationEvent(); virtual void synchronize(); // protected methods protected: // private members private: QSemaphore *semSync; }; }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_EVENTS_CWAITSYNCHRONIZATIONEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CRequestFeedbackEvent.cpp0000644000175000017500000000341712520756324026531 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRequestFeedbackEvent.h" namespace Konclude { namespace Concurrent { namespace Events { CRequestFeedbackEvent::CRequestFeedbackEvent() : CControlEvent(EVENTREQUESTFEEDBACKWATCHDOG) { watchDog = 0; updateNumber = 0; } CRequestFeedbackEvent::CRequestFeedbackEvent(CWatchDog *watchDogThread, qint64 number) : CControlEvent(EVENTREQUESTFEEDBACKWATCHDOG) { watchDog = watchDogThread; updateNumber = number; } CRequestFeedbackEvent::~CRequestFeedbackEvent() { } CWatchDog *CRequestFeedbackEvent::getWatchDogThread() { return watchDog; } void CRequestFeedbackEvent::setWatchDogThread(CWatchDog *watchDogThread) { watchDog = watchDogThread; } qint64 CRequestFeedbackEvent::getUpdateNumber() { return updateNumber; } void CRequestFeedbackEvent::setUpdateNumber(qint64 number) { updateNumber = number; } }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CHandleEventsEvent.cpp0000644000175000017500000000216712520756324026055 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CHandleEventsEvent.h" namespace Konclude { namespace Concurrent { namespace Events { CHandleEventsEvent::CHandleEventsEvent() : CControlEvent(EVENTTYPE) { } CHandleEventsEvent::~CHandleEventsEvent() { } }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CCustomCallbackEvent.cpp0000644000175000017500000000307412520756324026362 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCustomCallbackEvent.h" namespace Konclude { namespace Concurrent { namespace Events { CCustomCallbackEvent::CCustomCallbackEvent(QEvent::Type type, CCallbackData *callback, void *object) : CCustomEvent(type,object) { cbData = callback; } CCustomCallbackEvent::~CCustomCallbackEvent() { } CCustomCallbackEvent *CCustomCallbackEvent::setCallback(CCallbackData *callback) { cbData = callback; return this; } CCallbackData *CCustomCallbackEvent::getCallback() { return cbData; } bool CCustomCallbackEvent::sendCallback() { if (cbData) { cbData->doCallback(); return true; } else { return false; } } }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CControlEvent.cpp0000644000175000017500000000213312520756324025106 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CControlEvent.h" namespace Konclude { namespace Concurrent { namespace Events { CControlEvent::CControlEvent(QEvent::Type type) : QEvent(type) { } CControlEvent::~CControlEvent() { } }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CRequestFeedbackEvent.h0000644000175000017500000000367412520756324026203 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_EVENTS_CREQUESTFEEDBACKEVENT_H #define KONCLUDE_CONCURRENT_EVENTS_CREQUESTFEEDBACKEVENT_H #include #include #include "../ConcurrentSettings.h" #include "../CWatchDog.h" #include "CControlEvent.h" namespace Konclude { namespace Concurrent { namespace Events { /*! * \class CRequestFeedbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CRequestFeedbackEvent : public CControlEvent { // public methods public: //! Constructor CRequestFeedbackEvent(); CRequestFeedbackEvent(CWatchDog *watchDogThread, qint64 number); //! Destructor virtual ~CRequestFeedbackEvent(); CWatchDog *getWatchDogThread(); void setWatchDogThread(CWatchDog *watchDogThread); qint64 getUpdateNumber(); void setUpdateNumber(qint64 number); // protected methods protected: // private members private: CWatchDog *watchDog; qint64 updateNumber; }; }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_EVENTS_CREQUESTFEEDBACKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CCustomCallbackEvent.h0000644000175000017500000000351612520756324026030 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CCustomCallbackEvent_H #define KONCLUDE_CONCURRENT_CCustomCallbackEvent_H #include #include "CCustomEvent.h" #include "../Callback/CCallbackData.h" namespace Konclude { namespace Concurrent { using namespace Callback; namespace Events { /*! * \class CCustomCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CCustomCallbackEvent : public CCustomEvent { // public methods public: //! Constructor CCustomCallbackEvent(QEvent::Type type, CCallbackData *callback = 0, void *object = 0); //! Destructor virtual ~CCustomCallbackEvent(); CCustomCallbackEvent *setCallback(CCallbackData *callback); CCallbackData *getCallback(); bool sendCallback(); // protected methods protected: // private members private: CCallbackData *cbData; }; }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CCustomCallbackEvent_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CTimerIntervalEvent.h0000644000175000017500000000427512520756324025731 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_EVENTS_CTIMERINTERVALEVENT_H #define KONCLUDE_CONCURRENT_EVENTS_CTIMERINTERVALEVENT_H #include #include #include "CControlEvent.h" #include "../ConcurrentSettings.h" namespace Konclude { namespace Concurrent { namespace Events { /*! * \class CTimerIntervalEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CTimerIntervalEvent : public CControlEvent { // public methods public: //! Constructor CTimerIntervalEvent(qint64 timerID = 0, qint64 interval = -1, bool active = false, bool deactive = false, qint64 remInvocs = -1); //! Destructor virtual ~CTimerIntervalEvent(); qint64 getTimerID(); void setTimerID(qint64 timerID); void setTimerInterval(qint64 interval); qint64 getTimerInterval(); void setTimerActive(bool active); bool getTimerActive(); void setTimerDeactive(bool deactive); bool getTimerDeactive(); void setRemainingTimerInvocations(qint64 remInvoc); qint64 getRemainingTimerInvocations(); // protected methods protected: // private members private: qint64 id; qint64 tInt; qint64 remCall; bool tActive; bool tDeactive; }; }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_EVENTS_CTIMERINTERVALEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CWaitSynchronizationEvent.cpp0000644000175000017500000000254212520756324027520 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWaitSynchronizationEvent.h" namespace Konclude { namespace Concurrent { namespace Events { CWaitSynchronizationEvent::CWaitSynchronizationEvent(QSemaphore *synchronizationSemaphore) : CControlEvent(EVENTWAITSYNCHRONIZATION) { semSync = synchronizationSemaphore; } CWaitSynchronizationEvent::~CWaitSynchronizationEvent() { } void CWaitSynchronizationEvent::synchronize() { if (semSync) { semSync->release(); } } }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CHandleEventsEvent.h0000644000175000017500000000352712520756324025523 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_EVENTS_CHANDLEEVENTSEVENT_H #define KONCLUDE_CONCURRENT_EVENTS_CHANDLEEVENTSEVENT_H // Library includes // Namespace includes #include "CControlEvent.h" // Other includes #include "../ConcurrentSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Concurrent { namespace Events { /*! * * \class CHandleEventsEvent * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CHandleEventsEvent : public CControlEvent { // public methods public: //! Constructor CHandleEventsEvent(); //! Destructor virtual ~CHandleEventsEvent(); static const QEvent::Type EVENTTYPE = EVENTHANDLEEVENTS; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_EVENTS_CHANDLEEVENTSEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CCustomEvent.cpp0000644000175000017500000000242212520756324024741 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCustomEvent.h" namespace Konclude { namespace Concurrent { namespace Events { CCustomEvent::CCustomEvent(QEvent::Type type, void *object) : QEvent(type) { obj = object; } CCustomEvent::~CCustomEvent() { } CCustomEvent *CCustomEvent::setObject(void *object) { obj = object; return this; } void *CCustomEvent::getObject() { return obj; } }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CCustomEvent.h0000644000175000017500000000310712520756324024407 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CCUSTOMEVENT_H #define KONCLUDE_CONCURRENT_CCUSTOMEVENT_H #include namespace Konclude { namespace Concurrent { namespace Events { /*! * \class CCustomEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CCustomEvent : public QEvent { // public methods public: //! Constructor CCustomEvent(QEvent::Type type, void *object = 0); //! Destructor virtual ~CCustomEvent(); CCustomEvent *setObject(void *object); void *getObject(); // protected methods protected: // private members private: void *obj; }; }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CCUSTOMEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Events/CWatchDogFeedbackEvent.h0000644000175000017500000000351712520756324026247 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_EVENTS_CWATCHDOGFEEDBACKEVENT_H #define KONCLUDE_CONCURRENT_EVENTS_CWATCHDOGFEEDBACKEVENT_H #include #include "CControlEvent.h" #include "../ConcurrentSettings.h" namespace Konclude { namespace Concurrent { namespace Events { /*! * \class CWatchDogFeedbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CWatchDogFeedbackEvent : public CControlEvent { // public methods public: //! Constructor CWatchDogFeedbackEvent(qint64 threadID = 0, qint64 updateNumber = 0); //! Destructor virtual ~CWatchDogFeedbackEvent(); qint64 getThreadID(); void seThreadID(qint64 threadID); void setUpdateNumber(qint64 updateNumber); qint64 getUpdateNumber(); // protected methods protected: // private members private: qint64 id; qint64 uNr; }; }; // end namespace Events }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_EVENTS_CWATCHDOGFEEDBACKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CThread.h0000644000175000017500000001026512520756330022076 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CTHREAD_H #define KONCLUDE_CONCURRENT_CTHREAD_H #include #include #include #include #include "CWatchDog.h" #include "ConcurrentSettings.h" #include "Events/CCustomEvent.h" #include "Events/CControlEvent.h" #include "Events/CWaitSynchronizationEvent.h" namespace Konclude { namespace Concurrent { using namespace Events; //#define THREADTIMEMEASURE #ifdef DEBUG_THREADS #define SETTASKDESCRIPTION(a) setTaskDescription(a) #else #define SETTASKDESCRIPTION(a) #endif #ifdef THREADTIMEMEASURE #define TIMEMEASUREMENTBEGINWAITING() prepareWaiting() #define TIMEMEASUREMENTENDWAITING() concludeWaiting() #define TIMEMEASUREMENTBEGINEXECUTION() prepareExecution() #define TIMEMEASUREMENTENDEXECUTION() concludeExecution() #define TIMEMEASUREMENTBEGINBLOCKING() prepareBlocking() #define TIMEMEASUREMENTENDBLOCKING() concludeBlocking() #else #define TIMEMEASUREMENTBEGINWAITING() #define TIMEMEASUREMENTENDWAITING() #define TIMEMEASUREMENTBEGINEXECUTION() #define TIMEMEASUREMENTENDEXECUTION() #define TIMEMEASUREMENTBEGINBLOCKING() #define TIMEMEASUREMENTENDBLOCKING() #endif class CWatchDog; /*! * \class CThread * \author Andreas Steigmiller * \version 0.1 * \brief */ class CThread : public QThread { // public methods public: //! Constructor CThread(QString threadIdentifierName, CWatchDog *watchDogThread = 0); //! Destructor virtual ~CThread(); void startThread(Priority priority = InheritPriority); void stopThread(bool waitStopped = true); void waitSynchronization(); QString getThreadName(); QString getLastTaskDescription(); QString getTaskDescription(); qint64 getWaitTimeSecs(); qint64 getRunTimeSecs(); qint64 getBlockTimeSecs(); qint64 getThreadID(); //! Terminates and restarts the thread. NOTE: because of semaphores, mutex, ... this function is very critical void restartThread(); void postEvent(QEvent *event, int priority = Qt::NormalEventPriority); bool isThreadRunning(); // protected methods protected: virtual void run(); virtual bool event(QEvent *event); virtual void prepareBlocking(); virtual void concludeBlocking(); virtual void prepareExecution(); virtual void concludeExecution(); virtual void prepareWaiting(); virtual void concludeWaiting(); virtual void threadStarted(); virtual void threadStopped(); virtual bool processEvents(QEvent *event); virtual bool processControlEvents(QEvent::Type type, CControlEvent *event); virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); void setTaskDescription(QString description); bool isThreadProcessingEvents(); // protected methods protected: bool mActiveEventProcessing; // private methods private: // private variables private: QString threadName; QString taskDescription; QString lastTaskDescription; qint64 threadID; bool threadRuns; // workload measurement qint64 waitTimeSecs; qint64 runTimeSecs; qint64 blockTimeSecs; QTime runTimer; QTime waitTimer; QTime blockTimer; static qint64 nextThreadID; static QSemaphore *syncThreadID; CWatchDog *mWatchDog; }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventChannelLinker.cpp0000644000175000017500000000233012520756324024736 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEventChannelLinker.h" namespace Konclude { namespace Concurrent { CEventChannelLinker::CEventChannelLinker(CEventChannel* eventChannel, CEventChannelLinker* eventChannelLinker) : CSortedLinkerBase(eventChannel,eventChannelLinker) { } CEventChannelLinker::~CEventChannelLinker() { } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventThread.cpp0000644000175000017500000001016512520756326023437 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEventThread.h" namespace Konclude { namespace Concurrent { CEventThread::CEventThread() : CThread("EventThread") { mHandleEventsCountPerStep = 10; mHandleEventStopped = false; mEventSignalized = false; mLastProcessingStartedTag = 0; mLastProcessingStartRequestTag = 0; mEventProcessingStopped = true; threadContext = nullptr; } CEventThread::~CEventThread() { } CEventHandler* CEventThread::createInstalledEventHandler(CEventProcessor* eventProcessor) { CQueuedLinkedEventHandler* eventHandler = new CQueuedLinkedEventHandler(eventProcessor,this); mAddEventHandlerSyncMutex.lock(); CXLinker* eventHandlerLinker = new CXLinker(eventHandler,mEventHandlerLinker); mEventHandlerLinker = eventHandlerLinker; mAddEventHandlerSyncMutex.unlock(); return eventHandler; } CThreadActivator* CEventThread::signalizeEvent() { mEventSignalized = true; if (mEventProcessingStopped) { // post processing event if (mLastProcessingStartedTag == mLastProcessingStartRequestTag) { ++mLastProcessingStartRequestTag; postEvent(new CHandleEventsEvent()); } } return this; } bool CEventThread::processControlEvents(QEvent::Type type, CControlEvent *event) { if (CThread::processControlEvents(type,event)) { return true; } else { if (type == CHandleEventsEvent::EVENTTYPE) { mLastProcessingStartedTag = mLastProcessingStartRequestTag; handleEvents(); return true; } } return false; } bool CEventThread::handleEvents(double minEventPriority, cint64 maxHandleEventCount) { bool handleNextRound = true; mEventProcessingStopped = false; bool roundEventProcessed = false; while (handleNextRound && !mHandleEventStopped) { roundEventProcessed = false; CXLinker* eventHandlerLinkerIt = mEventHandlerLinker; if (eventHandlerLinkerIt) { while (maxHandleEventCount != 0 && !mHandleEventStopped) { CEventHandler* eventHandler = eventHandlerLinkerIt->getData(); if (eventHandler->needEventProcessing(minEventPriority)) { cint64 maxHandleEventCountStep = mHandleEventsCountPerStep; if (maxHandleEventCount > 0) { if (maxHandleEventCountStep > maxHandleEventCount) { maxHandleEventCountStep = maxHandleEventCount; } } cint64 handledEventCount = eventHandler->handleEvents(threadContext,minEventPriority,maxHandleEventCountStep); if (maxHandleEventCount > 0) { maxHandleEventCount -= handledEventCount; } roundEventProcessed = handledEventCount > 0; } if (roundEventProcessed) { mEventProcessingStopped = false; } // round robin eventHandlerLinkerIt = eventHandlerLinkerIt->getNext(); if (!eventHandlerLinkerIt) { if (mEventSignalized || roundEventProcessed) { handleNextRound = true; mEventSignalized = false; } else { if (!mEventProcessingStopped) { handleNextRound = true; mEventProcessingStopped = true; mEventSignalized = false; } else { handleNextRound = false; } } eventHandlerLinkerIt = mEventHandlerLinker; } } } else { handleNextRound = false; } } return true; } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventLinkerChannel.cpp0000644000175000017500000000712312520756326024745 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEventLinkerChannel.h" namespace Konclude { namespace Concurrent { CEventLinkerChannel::CEventLinkerChannel(CThreadActivator* threadActivator, double channelPriority) { mThreadActivator = threadActivator; mPostedEventLinker = nullptr; mLastTakedPostEventLinker = nullptr; mLastPostedEventLinker = nullptr; mLastTakedDuplicatedPostEventLinker = nullptr; acquiredLinkerCount = 0; fetchedLinkerCount = 0; postedLinkerCount = 0; mChannelPriority = channelPriority; } CEventLinkerChannel::~CEventLinkerChannel() { } bool CEventLinkerChannel::checkPostEvent(CEvent* processingEvent) { return processingEvent != mLastTakedPostEventLinker; } CEventChannel* CEventLinkerChannel::postEvent(CEvent* processingEvent) { mLastPostedEventLinker = mPostedEventLinker; CEventLinker* newEventPostLinker = processingEvent; processingEvent->setEventChannelPriority(mChannelPriority); //if (newEventPostLinker == mLastTakedPostEventLinker) { // mLastTakedDuplicatedPostEventLinker = newEventPostLinker; //} if (mPostedEventLinker != newEventPostLinker) { newEventPostLinker->initEventLinker(processingEvent,mPostedEventLinker); mPostedEventLinker = newEventPostLinker; } else { // write access to mLastTakedPostEventLinker is safe only in this case newEventPostLinker->initEventLinker(processingEvent,nullptr); mPostedEventLinker = newEventPostLinker; mLastTakedPostEventLinker = nullptr; } ++postedLinkerCount; mThreadActivator->signalizeEvent(); return this; } CEventLinker* CEventLinkerChannel::takeEvents(CEventLinker* addEventLinker) { // reverse stored event order, take all events CEventLinker* tmpEventPostLinker = mPostedEventLinker; //bool duplicatedStopp = tmpEventPostLinker == mLastTakedDuplicatedPostEventLinker; //mLastTakedDuplicatedPostEventLinker = nullptr; CEventLinker* tmpNextLastPostEventLinker = tmpEventPostLinker; CEventLinker* tmpAddEventLinker = nullptr; while (tmpEventPostLinker && (tmpEventPostLinker != mLastTakedPostEventLinker /*|| duplicatedStopp*/)) { //if (tmpEventPostLinker == mLastTakedPostEventLinker) { // duplicatedStopp = false; //} tmpAddEventLinker = tmpEventPostLinker; tmpEventPostLinker = tmpEventPostLinker->getNextEventLinker(); addEventLinker = tmpAddEventLinker->setNextEventLinker(addEventLinker); ++fetchedLinkerCount; } if (tmpNextLastPostEventLinker != mLastTakedPostEventLinker) { mLastTakedPostEventLinker = tmpNextLastPostEventLinker; } return addEventLinker; } bool CEventLinkerChannel::hasEvents() { return mLastTakedPostEventLinker != mPostedEventLinker; } double CEventLinkerChannel::getChannelPriority() { return mChannelPriority; } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CThread.cpp0000644000175000017500000001331212520756330022425 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CThread.h" #include "Events/CRequestFeedbackEvent.h" #include "Logger/CLogger.h" namespace Konclude { namespace Concurrent { qint64 CThread::nextThreadID = 1; QSemaphore *CThread::syncThreadID = new QSemaphore(1); CThread::CThread(QString threadIdentifierName, CWatchDog *watchDogThread) { threadName = threadIdentifierName; waitTimeSecs = 0; blockTimeSecs = 0; runTimeSecs = 0; threadID = 0; mWatchDog = watchDogThread; threadRuns = false; mActiveEventProcessing = false; } CThread::~CThread() { stopThread(true); } void CThread::setTaskDescription(QString description) { lastTaskDescription = taskDescription; taskDescription = description; } QString CThread::getLastTaskDescription() { return lastTaskDescription; } QString CThread::getTaskDescription() { return taskDescription; } QString CThread::getThreadName() { return threadName; } qint64 CThread::getWaitTimeSecs() { return waitTimeSecs; } qint64 CThread::getRunTimeSecs() { return runTimeSecs; } qint64 CThread::getBlockTimeSecs() { return blockTimeSecs; } qint64 CThread::getThreadID() { return threadID; } void CThread::postEvent(QEvent *event, int priority) { QCoreApplication::postEvent(this,event,priority); } void CThread::waitSynchronization() { QSemaphore syncSemaphore(0); postEvent(new CWaitSynchronizationEvent(&syncSemaphore)); syncSemaphore.acquire(); } bool CThread::isThreadRunning() { return threadRuns; } void CThread::restartThread() { terminate(); wait(); startThread(); } void CThread::run() { bool registerd = false; try { // get thread id syncThreadID->acquire(); threadID = nextThreadID++; syncThreadID->release(); // register thread to watchdog if (mWatchDog) { registerd = mWatchDog->registerThread(this); } // workload measurement TIMEMEASUREMENTBEGINWAITING(); threadStarted(); threadRuns = true; exec(); threadRuns = false; threadStopped(); // workload measurement TIMEMEASUREMENTENDWAITING(); if (mWatchDog) { mWatchDog->checkoutThread(this); } } catch (...) { if (mWatchDog) { mWatchDog->crashedThread(this); } } } void CThread::prepareExecution() { runTimer.start(); } void CThread::concludeExecution() { runTimeSecs += runTimer.elapsed(); } void CThread::prepareWaiting() { waitTimer.start(); } void CThread::concludeWaiting() { waitTimeSecs += waitTimer.elapsed(); } bool CThread::event(QEvent *event) { try { // workload measurement TIMEMEASUREMENTENDWAITING(); TIMEMEASUREMENTBEGINEXECUTION(); SETTASKDESCRIPTION("Start Processing Events"); mActiveEventProcessing = true; bool processed = processEvents(event); if (!processed) { // event processing QEvent::Type type = event->type(); if (type >= 1200 && type < 2000) { processControlEvents(type,(CControlEvent *)event); processed = true; } else if (type >= 2000) { processCustomsEvents(type,(CCustomEvent *)event); processed = true; } } mActiveEventProcessing = false; // workload measurement TIMEMEASUREMENTENDEXECUTION(); TIMEMEASUREMENTBEGINWAITING(); SETTASKDESCRIPTION("Wait for Events"); return processed; } catch (...) { LOG(ERROR,"::Konclude::Thread",logTr("Unhandled exception, thread %1 stopped.").arg(threadName),this); return false; } } bool CThread::isThreadProcessingEvents() { return mActiveEventProcessing; } void CThread::prepareBlocking() { runTimeSecs += runTimer.elapsed(); blockTimer.start(); } void CThread::concludeBlocking() { blockTimeSecs += blockTimer.elapsed(); runTimer.start(); } void CThread::threadStarted() { } void CThread::threadStopped() { } void CThread::startThread(Priority priority) { start(priority); moveToThread(this); } void CThread::stopThread(bool waitStopped) { quit(); if (waitStopped) { wait(); } } bool CThread::processEvents(QEvent *event) { return false; } bool CThread::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { return false; } bool CThread::processControlEvents(QEvent::Type type, CControlEvent *event) { if (type == EVENTREQUESTFEEDBACKWATCHDOG) { SETTASKDESCRIPTION("Send WatchDog Feedback"); CRequestFeedbackEvent *rfe = (CRequestFeedbackEvent *)event; CWatchDog *watchDog = (CWatchDog *)rfe->getWatchDogThread(); qint64 updateNumber = rfe->getUpdateNumber(); watchDog->feedbackThread(this,updateNumber); return true; } else if (type == EVENTWAITSYNCHRONIZATION) { SETTASKDESCRIPTION("Synchronize"); CWaitSynchronizationEvent *wse = (CWaitSynchronizationEvent *)event; wse->synchronize(); return true; } return false; } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CSyncedFreeEventChannel.h0000644000175000017500000000343712520756330025214 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CSYNCEDFREEEVENTCHANNEL_H #define KONCLUDE_CONCURRENT_CSYNCEDFREEEVENTCHANNEL_H // Library includes // Namespace includes #include "ConcurrentSettings.h" #include "CEventLinkerChannel.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Concurrent { /*! * * \class CSyncedFreeEventChannel * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSyncedFreeEventChannel : public CEventLinkerChannel { // public methods public: //! Constructor CSyncedFreeEventChannel(CThreadActivator* threadActivator, double channelPriority = 0.); //! Destructor virtual ~CSyncedFreeEventChannel(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CSYNCEDFREEEVENTCHANNEL_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventQueue.h0000644000175000017500000000366712520756326022772 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CEVENTQUEUE_H #define KONCLUDE_CONCURRENT_CEVENTQUEUE_H // Library includes // Namespace includes #include "ConcurrentSettings.h" #include "CEventChannel.h" #include "CSyncedEventChannel.h" #include "CSyncedFreeEventChannel.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Concurrent { /*! * * \class CEventQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEventQueue { // public methods public: //! Constructor CEventQueue(); //! Destructor virtual ~CEventQueue(); virtual CSyncedEventChannel* getDefaultSyncedEventChannel(double channelPriority = 0.) = 0; virtual CSyncedFreeEventChannel* createSyncedFreeEventChannel(double channelPriority = 0.) = 0; virtual bool hasEvents(double minEventPriority = 0.) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CEVENTQUEUE_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CIntervalThread.h0000644000175000017500000000456212520756326023613 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CINTERVALTHREAD_H #define KONCLUDE_CONCURRENT_CINTERVALTHREAD_H #include #include #include #include #include #include #include "CIntervalThreadData.h" #include "CThread.h" #include "Events/CTimerIntervalEvent.h" namespace Konclude { namespace Concurrent { /*! * \class CIntervalThread * \author Andreas Steigmiller * \version 0.1 * \brief */ class CIntervalThread : public CThread { // public methods public: //! Constructor CIntervalThread(QString threadIdentifierName, CWatchDog *watchDog = 0); //! Destructor virtual ~CIntervalThread(); void setTimerInterval(qint64 timerID, qint64 timerIntervalMilliSecs); void startTimerWithInterval(qint64 timerID, qint64 timerIntervalMilliSecs); void startTimerWithIntervalLimited(qint64 timerID, qint64 timerIntervalMilliSecs, qint64 remainingCallCount); void startTimer(qint64 timerID); void stopTimer(qint64 timerID); // protected methods protected: virtual bool processTimer(qint64 timerID) = 0; bool processEvents(QEvent *event); virtual bool processControlEvents(QEvent::Type type, CControlEvent *event); virtual void threadStarted(); virtual void threadStopped(); // private methods private: // private variables private: QMutex mSyncTimerMutex; QHash timers; QHash timerMapping; }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CINTERVALTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CQueuedLinkedEventHandler.h0000644000175000017500000000421512520756326025551 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CQUEUEDLINKEDEVENTHANDLER_H #define KONCLUDE_CONCURRENT_CQUEUEDLINKEDEVENTHANDLER_H // Library includes // Namespace includes #include "ConcurrentSettings.h" #include "CEventLinkerQueue.h" #include "CEventHandler.h" #include "CEventProcessor.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Concurrent { /*! * * \class CQueuedLinkedEventHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQueuedLinkedEventHandler : public CEventLinkerQueue, virtual public CEventHandler { // public methods public: //! Constructor CQueuedLinkedEventHandler(CEventProcessor* eventProcessor, CThreadActivator* threadActivator); //! Destructor virtual ~CQueuedLinkedEventHandler(); virtual cint64 handleEvents(CContext* handlerContext, double minEventPriority = 0., cint64 maxProcessingCount = -1); virtual bool needEventProcessing(double minEventPriority = 0.); // protected methods protected: // protected variables protected: CEventLinker* mUnprocessedEvents; CEventProcessor* mEventProcessor; // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CQUEUEDLINKEDEVENTHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CThreadActivator.cpp0000644000175000017500000000202312520756330024277 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CThreadActivator.h" namespace Konclude { namespace Concurrent { CThreadActivator::CThreadActivator() { } CThreadActivator::~CThreadActivator() { } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventQueue.cpp0000644000175000017500000000177212520756326023320 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEventQueue.h" namespace Konclude { namespace Concurrent { CEventQueue::CEventQueue() { } CEventQueue::~CEventQueue() { } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEvent.cpp0000644000175000017500000000277112520756324022311 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEvent.h" namespace Konclude { namespace Concurrent { CEvent::CEvent(cint64 eventTypeID, CMemoryPool* memoryPool) : CMemoryPoolContainer(memoryPool) { mEventPriority = 0.; mEventTypeID = eventTypeID; initEventLinker(this,nullptr); } CEvent::~CEvent() { } double CEvent::getEventChannelPriority() { return mEventPriority; } CEvent* CEvent::setEventChannelPriority(double eventPriority) { mEventPriority = eventPriority; return this; } cint64 CEvent::getEventTypeID() { return mEventTypeID; } CEvent* CEvent::setEventTypeID(cint64 eventTypeID) { mEventTypeID = eventTypeID; return this; } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventProcessor.h0000644000175000017500000000340312520756326023651 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CEVENTPROCESSOR_H #define KONCLUDE_CONCURRENT_CEVENTPROCESSOR_H // Library includes // Namespace includes #include "ConcurrentSettings.h" #include "CEvent.h" // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Concurrent { /*! * * \class CEventProcessor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEventProcessor { // public methods public: //! Constructor CEventProcessor(); //! Destructor virtual ~CEventProcessor(); virtual bool processEvent(CEvent* event, CContext* handlerContext) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CEVENTPROCESSOR_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CSyncedFreeEventChannel.cpp0000644000175000017500000000224612520756326025551 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSyncedFreeEventChannel.h" namespace Konclude { namespace Concurrent { CSyncedFreeEventChannel::CSyncedFreeEventChannel(CThreadActivator* threadActivator, double channelPriority) : CEventLinkerChannel(threadActivator,channelPriority) { } CSyncedFreeEventChannel::~CSyncedFreeEventChannel() { } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/0000755000175000017500000000000012613407250022100 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CSynchronizedCallbackListExecuter.h0000644000175000017500000000420412520756324031017 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CALLBACK_CSYNCHRONIZEDCALLBACKLISTEXECUTER_H #define KONCLUDE_CONCURRENT_CALLBACK_CSYNCHRONIZEDCALLBACKLISTEXECUTER_H // Libraries includes #include #include // Namespace includes #include "CCallbackListExecuter.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Concurrent { namespace Callback { /*! * * \class CSynchronizedCallbackListExecuter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSynchronizedCallbackListExecuter : public CCallbackListExecuter { // public methods public: //! Constructor CSynchronizedCallbackListExecuter(); //! Destructor virtual ~CSynchronizedCallbackListExecuter(); virtual void doCallback(); virtual CCallbackListExecuter *addCallbackData(CCallbackData *callbackData); virtual CCallbackListExecuter *removeCallbackData(CCallbackData *callbackData); // protected methods protected: // protected variables protected: QMutex syncMutex; // private methods private: // private variables private: }; }; // end namespace Callback }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CALLBACK_CSYNCHRONIZEDCALLBACKLISTEXECUTER_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CCallbackRememberLinkedExecuter.cpp0000644000175000017500000000540412520756324030727 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCallbackRememberLinkedExecuter.h" namespace Konclude { namespace Concurrent { namespace Callback { CCallbackRememberLinkedExecuter::CCallbackRememberLinkedExecuter() { mCallbackLinker = nullptr; mCalledCallbackStop = nullptr; mCallbackExecuted = false; } CCallbackRememberLinkedExecuter::~CCallbackRememberLinkedExecuter() { } void CCallbackRememberLinkedExecuter::doCallback() { mCallbackExecuted = true; CCallbackData* callbackStop = mCalledCallbackStop; CCallbackData* newCallbackStop = mCallbackLinker; mCalledCallbackStop = newCallbackStop; CCallbackData* callbackIt = newCallbackStop; while (callbackIt && callbackIt != callbackStop) { CCallbackData* callback = callbackIt; callbackIt = callbackIt->getNext(); callback->doCallback(); } } qint64 CCallbackRememberLinkedExecuter::getCallbackCount() { cint64 count = 0; if (mCallbackLinker) { count = mCallbackLinker->getCount(); } return count; } CCallbackRememberLinkedExecuter* CCallbackRememberLinkedExecuter::addCallbacks(CCallbackData* callbackData) { if (mCallbackExecuted) { CCallbackData* callbackIt = callbackData; while (callbackIt) { CCallbackData* callback = callbackIt; callbackIt = callbackIt->getNext(); callback->doCallback(); } } else { if (callbackData) { mCallbackLinker = callbackData->append(mCallbackLinker); } if (mCallbackExecuted) { doCallback(); } } return this; } CCallbackRememberLinkedExecuter* CCallbackRememberLinkedExecuter::removeCallbacks(CCallbackData* callbackData) { CCallbackData* callbackIt = callbackData; while (callbackIt) { if (mCallbackLinker) { mCallbackLinker = mCallbackLinker->removeOne(callbackData); } callbackIt = callbackIt->getNext(); } return this; } }; // end namespace Callback }; // end namespace Concurrent }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CCallbackDataContext.h0000644000175000017500000000263512520756322026221 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CALLBACK_CCALLBACKDATACONTEXT_H #define KONCLUDE_CONCURRENT_CALLBACK_CCALLBACKDATACONTEXT_H namespace Konclude { namespace Concurrent { namespace Callback { /*! * * \class CCallbackDataContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCallbackDataContext { public: CCallbackDataContext(); virtual ~CCallbackDataContext(); protected: }; }; // end namespace Callback }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CALLBACK_CCALLBACKDATACONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CCallbackRememberLinkedExecuter.h0000644000175000017500000000433712520756324030400 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CALLBACK_CCALLBACKREMEMBERLINKEDEXECUTER_H #define KONCLUDE_CONCURRENT_CALLBACK_CCALLBACKREMEMBERLINKEDEXECUTER_H // Libraries includes // Namespace includes // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Concurrent { namespace Callback { /*! * * \class CCallbackRememberLinkedExecuter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCallbackRememberLinkedExecuter { // public methods public: //! Constructor CCallbackRememberLinkedExecuter(); //! Destructor virtual ~CCallbackRememberLinkedExecuter(); virtual void doCallback(); virtual CCallbackRememberLinkedExecuter* addCallbacks(CCallbackData* callbackData); virtual CCallbackRememberLinkedExecuter* removeCallbacks(CCallbackData* callbackData); virtual qint64 getCallbackCount(); // protected methods protected: CCallbackData* mCallbackLinker; CCallbackData* mCalledCallbackStop; bool mCallbackExecuted; // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Callback }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CALLBACK_CCALLBACKREMEMBERLINKEDEXECUTER_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CCallbackDataContext.cpp0000644000175000017500000000214512520756322026550 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCallbackDataContext.h" namespace Konclude { namespace Concurrent { namespace Callback { CCallbackDataContext::CCallbackDataContext() { } CCallbackDataContext::~CCallbackDataContext() { } }; // end namespace Callback }; // end namespace Concurrent }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CBlockingCallbackData.h0000644000175000017500000000326412520756322026324 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CALLBACK_CBlockingCallbackData_H #define KONCLUDE_CONCURRENT_CALLBACK_CBlockingCallbackData_H #include #include "CCallbackData.h" namespace Konclude { namespace Concurrent { namespace Callback { /*! * * \class CBlockingCallbackData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBlockingCallbackData : public CCallbackData { public: CBlockingCallbackData(int idNumber = 0); virtual ~CBlockingCallbackData(); virtual void doCallback(); int getIdNumber(); int setIdNumber(int idNumber); bool waitForCallback(int timeout = -1); protected: int id; QSemaphore semaphore; }; }; // end namespace Callback }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CALLBACK_CBlockingCallbackData_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CBlockingCallbackData.cpp0000644000175000017500000000276112520756322026660 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBlockingCallbackData.h" namespace Konclude { namespace Concurrent { namespace Callback { CBlockingCallbackData::CBlockingCallbackData(int idNumber) : semaphore(0) { id = idNumber; } CBlockingCallbackData::~CBlockingCallbackData() { } void CBlockingCallbackData::doCallback() { semaphore.release(); } int CBlockingCallbackData::getIdNumber() { return id; } int CBlockingCallbackData::setIdNumber(int idNumber) { return id = idNumber; } bool CBlockingCallbackData::waitForCallback(int timeout) { return semaphore.tryAcquire(1,timeout); } }; // end namespace Callback }; // end namespace Concurrent }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CallbackSettings.h0000644000175000017500000000261712520756322025500 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CALLBACK_CALLBACKSETTINGS #define KONCLUDE_CONCURRENT_CALLBACK_CALLBACKSETTINGS // Library includes // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Concurrent { namespace Callback { /*! * * \file CallbackSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations // Konclude code configs }; // end namespace Callback }; // end namespace Concurrent }; // end namespace Konclude #endif // end KONCLUDE_CONCURRENT_CALLBACK_CALLBACKSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CSignalSlotCallbackData.h0000644000175000017500000000345312405707536026660 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ /* * * Author: Andreas Steigmiller * Copyright: 2009 Andreas Steigmiller * Project: UUPR * */ #ifndef UUPR_CONCURRENT_CALLBACK_CSIGNALSLOTCALLBACKDATA_H #define UUPR_CONCURRENT_CALLBACK_CSIGNALSLOTCALLBACKDATA_H #include #include "CCallbackData.h" namespace UUPR { namespace Concurrent { namespace Callback { /*! * * \class CSignalSlotCallbackData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSignalSlotCallbackData : public QObject, public CCallbackData { Q_OBJECT public: CSignalSlotCallbackData(int idNumber = 0); virtual ~CSignalSlotCallbackData(); virtual void doCallback(); int getIdNumber(); int setIdNumber(int idNumber); signals: void callback(CSignalSlotCallbackData *callbackData); protected: int id; }; }; // end namespace Callback }; // end namespace Concurrent }; // end namespace UUPR #endif // UUPR_CONCURRENT_CALLBACK_CSIGNALSLOTCALLBACKDATA_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CSignalSlotCallbackData.cpp0000644000175000017500000000273312405707536027213 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ /* * * Author: Andreas Steigmiller * Copyright: 2009 Andreas Steigmiller * Project: UUPR * */ #include "CSignalSlotCallbackData.h" namespace UUPR { namespace Concurrent { namespace Callback { CSignalSlotCallbackData::CSignalSlotCallbackData(int idNumber) { id = idNumber; } CSignalSlotCallbackData::~CSignalSlotCallbackData() { } void CSignalSlotCallbackData::doCallback() { emit callback(this); } int CSignalSlotCallbackData::getIdNumber() { return id; } int CSignalSlotCallbackData::setIdNumber(int idNumber) { return id = idNumber; } }; // end namespace Callback }; // end namespace Concurrent }; // end namespace UUPRKonclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CCallbackData.cpp0000644000175000017500000000327412520756322025207 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCallbackData.h" namespace Konclude { namespace Concurrent { namespace Callback { CCallbackData::CCallbackData(CCallbackDataContext* callbackContext) : CLinkerBase(this,nullptr) { mContext = callbackContext; } CCallbackData::~CCallbackData() { if (mContext) { delete mContext; } } void CCallbackData::setCallbackDataContext(CCallbackDataContext* callbackContext) { if (mContext && mContext != callbackContext) { delete mContext; } mContext = callbackContext; } CCallbackDataContext* CCallbackData::getCallbackDataContext() { return mContext; } CCallbackDataContext* CCallbackData::takeCallbackDataContext() { CCallbackDataContext* context = mContext; mContext = nullptr; return context; } }; // end namespace Callback }; // end namespace Concurrent }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CCallbackListExecuter.h0000644000175000017500000000401212520756322026412 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CALLBACK_CCALLBACKLISTEXECUTER_H #define KONCLUDE_CONCURRENT_CALLBACK_CCALLBACKLISTEXECUTER_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Concurrent { namespace Callback { /*! * * \class CCallbackListExecuter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCallbackListExecuter { // public methods public: //! Constructor CCallbackListExecuter(); //! Destructor virtual ~CCallbackListExecuter(); virtual void doCallback(); virtual CCallbackListExecuter *addCallbackData(CCallbackData *callbackData); virtual CCallbackListExecuter *removeCallbackData(CCallbackData *callbackData); virtual qint64 getCallbackCount(); // protected methods protected: QLinkedList callbackList; // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Callback }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CALLBACK_CCALLBACKLISTEXECUTER_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CCallbackData.h0000644000175000017500000000417212520756322024652 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CALLBACK_CCALLBACKDATA_H #define KONCLUDE_CONCURRENT_CALLBACK_CCALLBACKDATA_H // Namespace includes #include "CallbackSettings.h" #include "CCallbackDataContext.h" // Library includes // Other includes #include "Utilities/Container/CLinker.h" // Logger includes namespace Konclude { using namespace Utilities::Container; namespace Concurrent { namespace Callback { /*! * * \class CCallbackData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCallbackData : public CLinkerBase { // public methods public: //! Constructor CCallbackData(CCallbackDataContext* callbackContext = nullptr); //! Destructor virtual ~CCallbackData(); virtual void doCallback() = 0; void setCallbackDataContext(CCallbackDataContext* callbackContext); CCallbackDataContext* getCallbackDataContext(); CCallbackDataContext* takeCallbackDataContext(); // protected methods protected: // protected variables protected: CCallbackDataContext* mContext; // private methods private: // private variables private: }; }; // end namespace Callback }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CALLBACK_CCALLBACKDATA_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CSynchronizedCallbackListExecuter.cpp0000644000175000017500000000406512520756324031357 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSynchronizedCallbackListExecuter.h" namespace Konclude { namespace Concurrent { namespace Callback { CSynchronizedCallbackListExecuter::CSynchronizedCallbackListExecuter() { } CSynchronizedCallbackListExecuter::~CSynchronizedCallbackListExecuter() { } void CSynchronizedCallbackListExecuter::doCallback() { QLinkedList callBackLocalCopyList; syncMutex.lock(); // make local copy foreach (CCallbackData *callbackData, callbackList) { callBackLocalCopyList.append(callbackData); } callbackList.clear(); syncMutex.unlock(); foreach (CCallbackData *callbackData, callBackLocalCopyList) { callbackData->doCallback(); } } CCallbackListExecuter *CSynchronizedCallbackListExecuter::addCallbackData(CCallbackData *callbackData) { syncMutex.lock(); CCallbackListExecuter::addCallbackData(callbackData); syncMutex.unlock(); return this; } CCallbackListExecuter *CSynchronizedCallbackListExecuter::removeCallbackData(CCallbackData *callbackData) { syncMutex.lock(); CCallbackListExecuter::removeCallbackData(callbackData); syncMutex.unlock(); return this; } }; // end namespace Callback }; // end namespace Concurrent }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Concurrent/Callback/CCallbackListExecuter.cpp0000644000175000017500000000337512520756322026760 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCallbackListExecuter.h" namespace Konclude { namespace Concurrent { namespace Callback { CCallbackListExecuter::CCallbackListExecuter() { } CCallbackListExecuter::~CCallbackListExecuter() { callbackList.clear(); } void CCallbackListExecuter::doCallback() { foreach (CCallbackData *callbackData, callbackList) { callbackData->doCallback(); } callbackList.clear(); } qint64 CCallbackListExecuter::getCallbackCount() { return callbackList.count(); } CCallbackListExecuter *CCallbackListExecuter::addCallbackData(CCallbackData *callbackData) { callbackList.removeAll(callbackData); callbackList.append(callbackData); return this; } CCallbackListExecuter *CCallbackListExecuter::removeCallbackData(CCallbackData *callbackData) { callbackList.removeAll(callbackData); return this; } }; // end namespace Callback }; // end namespace Concurrent }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Concurrent/CIntervalThread.cpp0000644000175000017500000001327712520756326024151 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIntervalThread.h" namespace Konclude { namespace Concurrent { CIntervalThread::CIntervalThread(QString threadIdentifierName, CWatchDog *watchDog) : CThread(threadIdentifierName,watchDog),mSyncTimerMutex(QMutex::Recursive) { } CIntervalThread::~CIntervalThread() { } void CIntervalThread::setTimerInterval(qint64 timerID, qint64 timerIntervalMilliSecs) { postEvent(new CTimerIntervalEvent(timerID,timerIntervalMilliSecs)); } void CIntervalThread::startTimerWithInterval(qint64 timerID, qint64 timerIntervalMilliSecs) { postEvent(new CTimerIntervalEvent(timerID,timerIntervalMilliSecs,true)); } void CIntervalThread::startTimerWithIntervalLimited(qint64 timerID, qint64 timerIntervalMilliSecs, qint64 remainingCallCount) { postEvent(new CTimerIntervalEvent(timerID,timerIntervalMilliSecs,true,false,remainingCallCount)); } void CIntervalThread::startTimer(qint64 timerID) { postEvent(new CTimerIntervalEvent(timerID,-1,true)); } void CIntervalThread::stopTimer(qint64 timerID) { mSyncTimerMutex.lock(); if (timers.contains(timerID)) { CIntervalThreadData *timerData = timers.value(timerID); timerData->incDeactivateCount(); } mSyncTimerMutex.unlock(); postEvent(new CTimerIntervalEvent(timerID,-1,false,true)); } void CIntervalThread::threadStarted() { } void CIntervalThread::threadStopped() { mSyncTimerMutex.lock(); QList timerList = timers.values(); foreach (CIntervalThreadData *timerData, timerList) { bool isActive = timerData->isTimerActive(); if (isActive) { int timerThreadID = timerData->getTimerThreadID(); QObject::killTimer(timerThreadID); } timerData->setTimerActive(false); } mSyncTimerMutex.unlock(); } bool CIntervalThread::processEvents(QEvent *event) { QEvent *ev = event; if (CThread::processEvents(event)) { return true; } else if (event->type() == QEvent::Timer) { SETTASKDESCRIPTION("Process Timer Timeout"); QTimerEvent *te = (QTimerEvent *)event; int timerThreadID = te->timerId(); mSyncTimerMutex.lock(); if (timerMapping.contains(timerThreadID)) { qint64 timerID = timerMapping.value(timerThreadID); if (timers.contains(timerID)) { CIntervalThreadData *timerData = timers.value(timerID); if (timerData->isTimerActive() && timerData->getDeactivateCount() <= 0) { if (timerData->hasRemainingTimerInvocations()) { timerData->decRemainingTimerInvocations(1); processTimer(timerID); } else { int timerThreadID = timerData->getTimerThreadID(); QObject::killTimer(timerThreadID); timerData->setTimerActive(false); } } } } mSyncTimerMutex.unlock(); return true; } return false; } bool CIntervalThread::processControlEvents(QEvent::Type type, CControlEvent *event) { if (CThread::processControlEvents(type,event)) { return true; } else if (type == EVENTTIMERINTERVAL) { SETTASKDESCRIPTION("Configure Timer Settings"); CTimerIntervalEvent *tie = (CTimerIntervalEvent *)event; qint64 timerID = tie->getTimerID(); qint64 timerInterval = tie->getTimerInterval(); bool activateTimer = tie->getTimerActive(); bool deactivateTimer = tie->getTimerDeactive(); qint64 remTimerInvocs = tie->getRemainingTimerInvocations(); CIntervalThreadData *timerData = 0; mSyncTimerMutex.lock(); bool isNew = false; if (timers.contains(timerID)) { timerData = timers.value(timerID); } else { timerData = new CIntervalThreadData(); timers.insert(timerID,timerData); isNew = true; } if (deactivateTimer) { timerData->decDeactivateCount(); } bool reactivateTimer = false; if (timerInterval >= 0) { timerData->setInterval(timerInterval); bool isActive = timerData->isTimerActive(); if (isActive) { reactivateTimer = true; } } timerData->setRemainingTimerInvocations(remTimerInvocs); if (deactivateTimer) { reactivateTimer = false; int timerThreadID = timerData->getTimerThreadID(); bool isActive = timerData->isTimerActive(); if (isActive) { QObject::killTimer(timerThreadID); } timerData->setTimerActive(false); } if (activateTimer || reactivateTimer) { qint64 deactivateCount = timerData->getDeactivateCount(); if (deactivateCount <= 0) { bool isActive = timerData->isTimerActive(); int timerThreadID = timerData->getTimerThreadID(); if (isActive) { QObject::killTimer(timerThreadID); } timerThreadID = QObject::startTimer(timerData->getInterval()); timerData->setTimerThreadID(timerThreadID); timerData->setTimerActive(true); timerMapping.insert(timerThreadID,timerID); } } mSyncTimerMutex.unlock(); return true; } return false; } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventChannel.cpp0000644000175000017500000000200412520756324023567 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEventChannel.h" namespace Konclude { namespace Concurrent { CEventChannel::CEventChannel() { } CEventChannel::~CEventChannel() { } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventHandler.h0000644000175000017500000000362012520756326023250 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CEVENTHANDLER_H #define KONCLUDE_CONCURRENT_CEVENTHANDLER_H // Library includes // Namespace includes #include "ConcurrentSettings.h" #include "CEventQueue.h" // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Concurrent { /*! * * \class CEventHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEventHandler : virtual public CEventQueue { // public methods public: //! Constructor CEventHandler(); //! Destructor virtual ~CEventHandler(); virtual cint64 handleEvents(CContext* handlerContext, double minEventPriority = 0., cint64 maxProcessingCount = -1) = 0; virtual bool needEventProcessing(double minEventPriority = 0.) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CEVENTHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventLinkerQueue.cpp0000644000175000017500000000720712520756326024464 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEventLinkerQueue.h" namespace Konclude { namespace Concurrent { CEventLinkerQueue::CEventLinkerQueue(CThreadActivator* threadActivator) { mThreadActivator = threadActivator; mDefaultEventChannel = new CSyncedEventChannel(this); mReverseSortedChannelLinker = new CEventChannelLinker(mDefaultEventChannel); mActivatorThreshold = 1; mInexactEventSingnals = 0; mThreadActivated = false; } CEventLinkerQueue::~CEventLinkerQueue() { while (mReverseSortedChannelLinker) { CEventChannelLinker* tmpDeleteChannel = mReverseSortedChannelLinker; mReverseSortedChannelLinker = mReverseSortedChannelLinker->getNext(); delete tmpDeleteChannel->getData(); delete tmpDeleteChannel; } } CSyncedEventChannel* CEventLinkerQueue::getDefaultSyncedEventChannel(double channelPriority) { return mDefaultEventChannel; } CSyncedFreeEventChannel* CEventLinkerQueue::createSyncedFreeEventChannel(double channelPriority) { mCreateChannelSyncMutex.lock(); CSyncedFreeEventChannel* tmpChannel = new CSyncedFreeEventChannel(this); CEventChannelLinker* tmpChannelLinker = new CEventChannelLinker(tmpChannel); mReverseSortedChannelLinker = mReverseSortedChannelLinker->insertSortedNextSorted(tmpChannelLinker); mCreateChannelSyncMutex.unlock(); return tmpChannel; } CThreadActivator* CEventLinkerQueue::signalizeEvent() { mInexactEventSingnals = mInexactEventSingnals+1; if (mInexactEventSingnals >= mActivatorThreshold) { if (true || !mThreadActivated) { // may called multiple times mThreadActivated = true; if (mThreadActivator) { mThreadActivator->signalizeEvent(); } } } return this; } CEventLinker* CEventLinkerQueue::takeEvents(CEventLinker* addEventLinker, double minEventPriority) { mThreadActivated = false; mInexactEventSingnals = 0; CEventChannelLinker* channelLinkerIt = mReverseSortedChannelLinker; while (channelLinkerIt) { CEventChannel *channel = channelLinkerIt->getData(); if (channel->getChannelPriority() >= minEventPriority) { CEventLinkerChannel* linkerChannel = dynamic_cast(channel); if (linkerChannel) { addEventLinker = linkerChannel->takeEvents(addEventLinker); } else { // take events step for step, currently not supported } } channelLinkerIt = channelLinkerIt->getNext(); } return addEventLinker; } bool CEventLinkerQueue::hasEvents(double minEventPriority) { CEventChannelLinker* channelLinkerIt = mReverseSortedChannelLinker; while (channelLinkerIt) { CEventChannel *channel = channelLinkerIt->getData(); if (channel->getChannelPriority() >= minEventPriority && channel->hasEvents()) { return true; } channelLinkerIt = channelLinkerIt->getNext(); } return false; } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventCommunicator.cpp0000644000175000017500000000373112520756326024671 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEventCommunicator.h" namespace Konclude { namespace Concurrent { CEventCommunicator::CEventCommunicator(CEventHandler* eventHandler) { mEventHandler = eventHandler; mEventChannel = nullptr; } CEventCommunicator::~CEventCommunicator() { } CEventCommunicator* CEventCommunicator::postEvent(CEvent* event) { if (!mEventChannel) { mEventChannel = mEventHandler->createSyncedFreeEventChannel(); } mEventChannel->postEvent(event); return this; } bool CEventCommunicator::checkPostEvent(CEvent* event) { if (!mEventChannel) { mEventChannel = mEventHandler->createSyncedFreeEventChannel(); } return mEventChannel->checkPostEvent(event); } bool CEventCommunicator::postEvent(CEventHandler* eventHandler, CEvent* event) { CEventChannel* eventChannel = eventHandler->getDefaultSyncedEventChannel(); eventChannel->postEvent(event); return true; } bool CEventCommunicator::checkPostEvent(CEventHandler* eventHandler, CEvent* event) { CEventChannel* eventChannel = eventHandler->getDefaultSyncedEventChannel(); return eventChannel->checkPostEvent(event); } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventProcessor.cpp0000644000175000017500000000201612520756326024203 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEventProcessor.h" namespace Konclude { namespace Concurrent { CEventProcessor::CEventProcessor() { } CEventProcessor::~CEventProcessor() { } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CIntervalThreadData.h0000644000175000017500000000423612520756326024403 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CINTERVALTHREADDATA_H #define KONCLUDE_CONCURRENT_CINTERVALTHREADDATA_H #include namespace Konclude { namespace Concurrent { /*! * \class CIntervalThreadData * \author Andreas Steigmiller * \version 0.1 * \brief */ class CIntervalThreadData { // public methods public: //! Constructor CIntervalThreadData(); //! Destructor virtual ~CIntervalThreadData(); void setTimerID(qint64 timerID); qint64 getTimerID(); void setInterval(qint64 threadInterval); qint64 getInterval(); void setTimerActive(bool threadIsActive); bool isTimerActive(); void setTimerThreadID(qint64 timerThreadID); qint64 getTimerThreadID(); void incDeactivateCount(); void decDeactivateCount(); qint64 getDeactivateCount(); void setRemainingTimerInvocations(qint64 remInvoc); qint64 getRemainingTimerInvocations(); bool hasRemainingTimerInvocations(); void decRemainingTimerInvocations(qint64 decCount = 1); // protected methods protected: // private methods private: // private variables private: qint64 interval; bool active; qint64 id; qint64 timerID; qint64 deactivateCount; qint64 remInvocations; }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CINTERVALTHREADDATA_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventLinkerProvider.cpp0000644000175000017500000000204712520756326025167 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEventLinkerProvider.h" namespace Konclude { namespace Concurrent { CEventLinkerProvider::CEventLinkerProvider() { } CEventLinkerProvider::~CEventLinkerProvider() { } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CQueuedLinkedEventHandler.cpp0000644000175000017500000000454112520756326026106 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueuedLinkedEventHandler.h" namespace Konclude { namespace Concurrent { CQueuedLinkedEventHandler::CQueuedLinkedEventHandler(CEventProcessor* eventProcessor, CThreadActivator* threadActivator) : CEventLinkerQueue(threadActivator) { mUnprocessedEvents = nullptr; mEventProcessor = eventProcessor; } CQueuedLinkedEventHandler::~CQueuedLinkedEventHandler() { } cint64 CQueuedLinkedEventHandler::handleEvents(CContext* handlerContext, double minEventPriority, cint64 maxProcessingCount) { cint64 handledEvents = 0; CEventLinker* tmpEventLinker = nullptr; for (cint64 processedCount = 0; processedCount < maxProcessingCount || maxProcessingCount == -1; ++processedCount) { if (!mUnprocessedEvents || mUnprocessedEvents->getData()->getEventChannelPriority() < minEventPriority) { mUnprocessedEvents = takeEvents(mUnprocessedEvents,minEventPriority); } if (!mUnprocessedEvents || mUnprocessedEvents->getData()->getEventChannelPriority() < minEventPriority) { break; } tmpEventLinker = mUnprocessedEvents; mUnprocessedEvents = mUnprocessedEvents->getNextEventLinker(); CEvent* eventX = tmpEventLinker->getData(); mEventProcessor->processEvent(eventX,handlerContext); ++handledEvents; } return handledEvents; } bool CQueuedLinkedEventHandler::needEventProcessing(double minEventPriority) { return (mUnprocessedEvents && mUnprocessedEvents->getData()->getEventChannelPriority() > minEventPriority) || hasEvents(minEventPriority); } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventLinkerProvider.h0000644000175000017500000000346312520756326024637 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CEVENTLINKERPROVIDER_H #define KONCLUDE_CONCURRENT_CEVENTLINKERPROVIDER_H // Library includes // Namespace includes #include "ConcurrentSettings.h" #include "CEventLinker.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Concurrent { /*! * * \class CEventLinkerProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEventLinkerProvider { // public methods public: //! Constructor CEventLinkerProvider(); //! Destructor virtual ~CEventLinkerProvider(); virtual CEventLinker* allocateEventLinker() = 0; virtual CEventLinkerProvider* releaseEventLinker(CEventLinker* eventLinker) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CEVENTLINKERPROVIDER_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CSyncedEventChannel.h0000644000175000017500000000354112520756326024413 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CSYNCEDEVENTCHANNEL_H #define KONCLUDE_CONCURRENT_CSYNCEDEVENTCHANNEL_H // Library includes // Namespace includes #include "ConcurrentSettings.h" #include "CEventLinkerChannel.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Concurrent { /*! * * \class CSyncedEventChannel * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSyncedEventChannel : public CEventLinkerChannel { // public methods public: //! Constructor CSyncedEventChannel(CThreadActivator* threadActivator, double channelPriority = 0.); //! Destructor virtual ~CSyncedEventChannel(); virtual CEventChannel* postEvent(CEvent* processingEvent); // protected methods protected: // protected variables protected: QMutex syncPostEventMutex; // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CSYNCEDEVENTCHANNEL_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventChannel.h0000644000175000017500000000362312520756324023244 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CEVENTCHANNEL_H #define KONCLUDE_CONCURRENT_CEVENTCHANNEL_H // Library includes // Namespace includes #include "ConcurrentSettings.h" #include "Concurrent/CEvent.h" // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Concurrent { /*! * * \class CEventChannel * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEventChannel { // public methods public: //! Constructor CEventChannel(); //! Destructor virtual ~CEventChannel(); virtual bool hasEvents() = 0; virtual CEventChannel* postEvent(CEvent* processingEvent) = 0; virtual bool checkPostEvent(CEvent* processingEvent) = 0; virtual double getChannelPriority() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CEVENTCHANNEL_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CWatchDogThread.h0000644000175000017500000000525712520756330023524 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CWATCHDOGTHREAD_H #define KONCLUDE_CONCURRENT_CWATCHDOGTHREAD_H #include #include #include #include #include #include "CThread.h" #include "CIntervalThread.h" #include "CWatchDogThreadData.h" #include "CWatchDog.h" #include "ConcurrentSettings.h" #include "Events/CCustomEvent.h" #include "Events/CControlEvent.h" namespace Konclude { namespace Concurrent { using namespace Events; /*! * \class CWatchDogThread * \author Andreas Steigmiller * \version 0.1 * \brief */ class CWatchDogThread : public CIntervalThread, public CWatchDog { // public methods public: //! Constructor CWatchDogThread(); //! Destructor virtual ~CWatchDogThread(); static CWatchDogThread *getInstance(); bool registerThread(CThread *thread); void feedbackThread(CThread *thread, qint64 updateNumber); void checkoutThread(CThread *thread); void crashedThread(CThread *thread); QLinkedList getActiveThreadList(); // protected methods protected: virtual void threadStarted(); virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); virtual bool processTimer(qint64 timerID); // private methods private: void sendRequestFeedbackEvent(CThread *thread, qint64 uNr); void updateThreadData(CThread *thread, CWatchDogThreadData *threadData); // private variables private: static const qint64 REQUESTFEEDBACKTIMERID = 1; static const qint64 UPDATETHREADINFOTIMERID = 2; static CWatchDogThread *watchDogInstance; static QSemaphore *syncSemaphore; QReadWriteLock regSync; QHash threadWatch; qint64 currentUpdateNumber; }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CWATCHDOGTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventThread.h0000644000175000017500000000506312520756326023105 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CEVENTTHREAD_H #define KONCLUDE_CONCURRENT_CEVENTTHREAD_H // Library includes // Namespace includes #include "ConcurrentSettings.h" #include "CThread.h" #include "CEventHandler.h" #include "CQueuedLinkedEventHandler.h" #include "CThreadActivator.h" #include "CEventProcessor.h" // Other includes #include "Concurrent/Events/CHandleEventsEvent.h" #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Concurrent { using namespace Events; /*! * * \class CEventThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEventThread : public CThread, public CThreadActivator { // public methods public: //! Constructor CEventThread(); //! Destructor virtual ~CEventThread(); virtual CEventHandler* createInstalledEventHandler(CEventProcessor* eventProcessor); virtual CThreadActivator* signalizeEvent(); // protected methods protected: virtual bool processControlEvents(QEvent::Type type, CControlEvent *event); virtual bool handleEvents(double minEventPriority = 0., cint64 maxHandleEventCount = -1); // protected variables protected: QMutex mAddEventHandlerSyncMutex; CXLinker* mEventHandlerLinker; CContext* threadContext; bool mHandleEventStopped; cint64 mHandleEventsCountPerStep; bool mEventSignalized; bool mEventProcessingStopped; cint64 mLastProcessingStartRequestTag; cint64 mLastProcessingStartedTag; // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CEVENTTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventLinker.cpp0000644000175000017500000000270312520756326023453 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEventLinker.h" namespace Konclude { namespace Concurrent { CEventLinker::CEventLinker() { } CEventLinker::~CEventLinker() { } CEventLinker* CEventLinker::getNextEventLinker() { return (CEventLinker*)CEventLinker::getNext(); } CEventLinker* CEventLinker::initEventLinker(CEvent* event, CEventLinker* nextEventLinker) { CLinkerBase::initLinker(event,nextEventLinker); return this; } CEventLinker* CEventLinker::setNextEventLinker(CEventLinker* nextEventLinker) { CLinkerBase::setNext(nextEventLinker); return this; } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventCommunicator.h0000644000175000017500000000411212520756326024330 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CEVENTCOMMUNICATOR_H #define KONCLUDE_CONCURRENT_CEVENTCOMMUNICATOR_H // Library includes // Namespace includes #include "ConcurrentSettings.h" #include "CEventChannel.h" #include "CSyncedEventChannel.h" #include "CSyncedFreeEventChannel.h" #include "CEventHandler.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Concurrent { /*! * * \class CEventCommunicator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEventCommunicator { // public methods public: //! Constructor CEventCommunicator(CEventHandler* eventHandler); //! Destructor virtual ~CEventCommunicator(); bool checkPostEvent(CEvent* event); CEventCommunicator* postEvent(CEvent* event); static bool postEvent(CEventHandler* eventHandler, CEvent* event); static bool checkPostEvent(CEventHandler* eventHandler, CEvent* event); // protected methods protected: // protected variables protected: CEventHandler* mEventHandler; CEventChannel* mEventChannel; // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CEVENTCOMMUNICATOR_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CThreadActivator.h0000644000175000017500000000324712520756330023755 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CTHREADACTIVATOR_H #define KONCLUDE_CONCURRENT_CTHREADACTIVATOR_H // Library includes // Namespace includes #include "ConcurrentSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Concurrent { /*! * * \class CThreadActivator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CThreadActivator { // public methods public: //! Constructor CThreadActivator(); //! Destructor virtual ~CThreadActivator(); virtual CThreadActivator* signalizeEvent() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CTHREADACTIVATOR_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CWatchDog.h0000644000175000017500000000315612520756330022370 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CWATCHDOG_H #define KONCLUDE_CONCURRENT_CWATCHDOG_H #include "CThread.h" namespace Konclude { namespace Concurrent { class CThread; /*! * \class CWatchDog * \author Andreas Steigmiller * \version 0.1 * \brief */ class CWatchDog { // public methods public: //! Constructor CWatchDog(); //! Destructor virtual ~CWatchDog(); virtual bool registerThread(CThread *thread) = 0; virtual void feedbackThread(CThread *thread, qint64 updateNumber) = 0; virtual void checkoutThread(CThread *thread) = 0; virtual void crashedThread(CThread *thread) = 0; // protected methods protected: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CWATCHDOG_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CWatchDogThreadData.h0000644000175000017500000000467212520756330024316 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CWATCHDOGTHREADDATA_H #define KONCLUDE_CONCURRENT_CWATCHDOGTHREADDATA_H #include #include "CThread.h" namespace Konclude { namespace Concurrent { /*! * \class CWatchDogThreadData * \author Andreas Steigmiller * \version 0.1 * \brief */ class CWatchDogThreadData { // public methods public: //! Constructor CWatchDogThreadData(); //! Destructor virtual ~CWatchDogThreadData(); bool isRegisterThread(); void setRegisterThread(bool isRegister); void setThreadName(QString threadName); QString getThreadName(); void setThreadID(qint64 threadID); qint64 getThreadID(); void setWaitTime(qint64 threadWaitTime); qint64 getWaitTime(); void setRunTime(qint64 threadRunTime); qint64 getRunTime(); CThread *getThread(); void setThread(CThread *threadObject); void setThreadActive(bool threadIsActive); bool isThreadActive(); void setUpdateNumber(qint64 number, QDateTime updateTime); qint64 getUpdateNumber(); void setTaskDescription(QString description); QString getTaskDescription(); void setThreadError(bool threadHasError); bool isThreadError(); // protected methods protected: // private methods private: // private variables private: bool reg; QString name; qint64 id; qint64 waitTime; qint64 runTime; CThread *thread; bool active; bool error; qint64 updateNumber; QString taskDescription; QDateTime upTime; }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CWATCHDOGTHREADDATA_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/ConcurrentSettings.h0000644000175000017500000000314412520756326024432 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef LOGGER_SETTINGS_H #define LOGGER_SETTINGS_H #include namespace Konclude { namespace Concurrent { /*! * \file * \version 0.1 * \author Andreas Steigmiller * \brief Event Types for CThreads */ // forward declarations class CEvent; #ifdef _DEBUG #define DEBUG_THREADS #endif // Control Events >= 1200 && < 2000 const QEvent::Type EVENTREQUESTFEEDBACKWATCHDOG = (QEvent::Type)1231; const QEvent::Type EVENTWAITSYNCHRONIZATION = (QEvent::Type)1232; const QEvent::Type EVENTTIMERINTERVAL = (QEvent::Type)1233; const QEvent::Type EVENTFEEDBACKTHREADWATCHDOG = (QEvent::Type)1234; const QEvent::Type EVENTHANDLEEVENTS = (QEvent::Type)1235; // Custom Events >= 2000 }; // end namespace Concurrent }; // end namespace Konclude #endif // LOGGER_SETTINGS_HKonclude-v0.6.2-544-SourceCode/Source/Concurrent/CWatchDogThreadData.cpp0000644000175000017500000000553412520756330024647 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWatchDogThreadData.h" namespace Konclude { namespace Concurrent { CWatchDogThreadData::CWatchDogThreadData() { reg = false; id = 0; waitTime = 0; runTime = 0; thread = 0; active = false; updateNumber = 0; error = false; } CWatchDogThreadData::~CWatchDogThreadData() { } bool CWatchDogThreadData::isRegisterThread() { return reg; } void CWatchDogThreadData::setRegisterThread(bool isRegister) { reg = isRegister; } void CWatchDogThreadData::setThreadName(QString threadName) { name = threadName; } QString CWatchDogThreadData::getThreadName() { return name; } void CWatchDogThreadData::setThreadID(qint64 threadID) { id = threadID; } qint64 CWatchDogThreadData::getThreadID() { return id; } void CWatchDogThreadData::setWaitTime(qint64 threadWaitTime) { waitTime = threadWaitTime; } qint64 CWatchDogThreadData::getWaitTime() { return waitTime; } void CWatchDogThreadData::setRunTime(qint64 threadRunTime) { runTime = threadRunTime; } qint64 CWatchDogThreadData::getRunTime() { return runTime; } CThread *CWatchDogThreadData::getThread() { return thread; } void CWatchDogThreadData::setThread(CThread *threadObject) { thread = threadObject; } void CWatchDogThreadData::setThreadActive(bool threadIsActive) { active = threadIsActive; } bool CWatchDogThreadData::isThreadActive() { return active; } void CWatchDogThreadData::setThreadError(bool threadHasError) { error = threadHasError; } bool CWatchDogThreadData::isThreadError() { return error; } void CWatchDogThreadData::setUpdateNumber(qint64 number, QDateTime updateTime) { updateNumber = number; upTime = updateTime; } qint64 CWatchDogThreadData::getUpdateNumber() { return updateNumber; } void CWatchDogThreadData::setTaskDescription(QString description) { taskDescription = description; } QString CWatchDogThreadData::getTaskDescription() { return taskDescription; } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CIntervalThreadData.cpp0000644000175000017500000000514112520756326024732 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIntervalThreadData.h" namespace Konclude { namespace Concurrent { CIntervalThreadData::CIntervalThreadData() { id = 0; timerID = 0; interval = 0; active = false; deactivateCount = 0; remInvocations = 0; } CIntervalThreadData::~CIntervalThreadData() { } void CIntervalThreadData::setTimerID(qint64 timerID) { id = timerID; } qint64 CIntervalThreadData::getTimerID() { return id; } void CIntervalThreadData::setInterval(qint64 timerInterval) { interval = timerInterval; } qint64 CIntervalThreadData::getInterval() { return interval; } void CIntervalThreadData::setTimerActive(bool timerIsActive) { active = timerIsActive; } bool CIntervalThreadData::isTimerActive() { return active; } void CIntervalThreadData::setTimerThreadID(qint64 timerThreadID) { timerID = timerThreadID; } qint64 CIntervalThreadData::getTimerThreadID() { return timerID; } void CIntervalThreadData::incDeactivateCount() { deactivateCount++; } void CIntervalThreadData::decDeactivateCount() { deactivateCount--; if (deactivateCount < 0) { deactivateCount = 0; } } qint64 CIntervalThreadData::getDeactivateCount() { return deactivateCount; } void CIntervalThreadData::setRemainingTimerInvocations(qint64 remInvoc) { remInvocations = remInvoc; } qint64 CIntervalThreadData::getRemainingTimerInvocations() { return remInvocations; } bool CIntervalThreadData::hasRemainingTimerInvocations() { return remInvocations > 0 || remInvocations == -1; } void CIntervalThreadData::decRemainingTimerInvocations(qint64 decCount) { if (remInvocations > 0) { remInvocations -= decCount; if (remInvocations < 0) { remInvocations = 0; } } } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventLinkerQueue.h0000644000175000017500000000513612520756326024130 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CEVENTLINKERQUEUE_H #define KONCLUDE_CONCURRENT_CEVENTLINKERQUEUE_H // Library includes // Namespace includes #include "ConcurrentSettings.h" #include "CEventQueue.h" #include "CEventChannel.h" #include "CSyncedEventChannel.h" #include "CSyncedFreeEventChannel.h" #include "CEventChannelLinker.h" // Other includes #include "Utilities/Container/CSortedLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities::Container; namespace Concurrent { /*! * * \class CEventLinkerQueue * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEventLinkerQueue : public CThreadActivator, virtual public CEventQueue { // public methods public: //! Constructor CEventLinkerQueue(CThreadActivator* threadActivator); //! Destructor virtual ~CEventLinkerQueue(); virtual CSyncedEventChannel* getDefaultSyncedEventChannel(double channelPriority = 0.); virtual CSyncedFreeEventChannel* createSyncedFreeEventChannel(double channelPriority = 0.); virtual CThreadActivator* signalizeEvent(); virtual CEventLinker* takeEvents(CEventLinker* addEventLinker, double minEventPriority = 0.); virtual bool hasEvents(double minEventPriority = 0.); // protected methods protected: // protected variables protected: CEventChannelLinker* mReverseSortedChannelLinker; CSyncedEventChannel* mDefaultEventChannel; CThreadActivator* mThreadActivator; QMutex mCreateChannelSyncMutex; cint64 mActivatorThreshold; cint64 mInexactEventSingnals; bool mThreadActivated; // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CEVENTLINKERQUEUE_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventHandler.cpp0000644000175000017500000000200412520756326023576 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEventHandler.h" namespace Konclude { namespace Concurrent { CEventHandler::CEventHandler() { } CEventHandler::~CEventHandler() { } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEvent.h0000644000175000017500000000404612520756324021753 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CEVENT_H #define KONCLUDE_CONCURRENT_CEVENT_H // Library includes // Namespace includes #include "ConcurrentSettings.h" #include "CEventLinker.h" // Other includes #include "Utilities/Memory/CMemoryPool.h" #include "Utilities/Memory/CMemoryPoolContainer.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Utilities::Memory; namespace Concurrent { /*! * * \class CEvent * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEvent : public CEventLinker, public CMemoryPoolContainer { // public methods public: //! Constructor CEvent(cint64 eventTypeID = 0, CMemoryPool* memoryPool = 0); //! Destructor ~CEvent(); double getEventChannelPriority(); CEvent* setEventChannelPriority(double eventPriority); cint64 getEventTypeID(); CEvent* setEventTypeID(cint64 eventTypeID); // protected methods protected: // protected variables protected: double mEventPriority; cint64 mEventTypeID; // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CWatchDog.cpp0000644000175000017500000000175412520756330022725 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWatchDog.h" namespace Konclude { namespace Concurrent { CWatchDog::CWatchDog() { } CWatchDog::~CWatchDog() { } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CSyncedEventChannel.cpp0000644000175000017500000000254412520756326024750 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSyncedEventChannel.h" namespace Konclude { namespace Concurrent { CSyncedEventChannel::CSyncedEventChannel(CThreadActivator* threadActivator, double channelPriority) : CEventLinkerChannel(threadActivator,channelPriority) { } CSyncedEventChannel::~CSyncedEventChannel() { } CEventChannel* CSyncedEventChannel::postEvent(CEvent* processingEvent) { syncPostEventMutex.lock(); CEventLinkerChannel::postEvent(processingEvent); syncPostEventMutex.unlock(); return this; } }; // end namespace Concurrent }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Concurrent/CEventLinkerChannel.h0000644000175000017500000000461712520756326024417 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONCURRENT_CEVENTLINKERCHANNEL_H #define KONCLUDE_CONCURRENT_CEVENTLINKERCHANNEL_H // Library includes // Namespace includes #include "ConcurrentSettings.h" #include "CEventChannel.h" #include "CEventLinker.h" #include "CThreadActivator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Concurrent { /*! * * \class CEventLinkerChannel * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEventLinkerChannel : public CEventChannel { // public methods public: //! Constructor CEventLinkerChannel(CThreadActivator* threadActivator, double channelPriority = 0.); //! Destructor virtual ~CEventLinkerChannel(); virtual bool hasEvents(); virtual CEventChannel* postEvent(CEvent* processingEvent); virtual bool checkPostEvent(CEvent* processingEvent); virtual CEventLinker* takeEvents(CEventLinker* addEventLinker); virtual double getChannelPriority(); // protected methods protected: // protected variables protected: CEventLinker* mLastPostedEventLinker; CEventLinker* mLastTakedDuplicatedPostEventLinker; CEventLinker* mPostedEventLinker; CEventLinker* mLastTakedPostEventLinker; CThreadActivator* mThreadActivator; cint64 acquiredLinkerCount; cint64 fetchedLinkerCount; cint64 postedLinkerCount; double mChannelPriority; // private methods private: // private variables private: }; }; // end namespace Concurrent }; // end namespace Konclude #endif // KONCLUDE_CONCURRENT_CEVENTLINKERCHANNEL_H Konclude-v0.6.2-544-SourceCode/Source/Control/0000755000175000017500000000000012613407250017702 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/0000755000175000017500000000000012613407250021602 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/OWLlink/0000755000175000017500000000000012613407250023121 5ustar jonasjonas././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/OWLlink/COWLlinkHttpConnectionHandlerProcessor.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/OWLlink/COWLlinkHttpConnectionHandlerProcess0000644000175000017500000002272012565307546032223 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLlinkHttpConnectionHandlerProcessor.h" namespace Konclude { namespace Control { namespace Interface { namespace OWLlink { COWLlinkHttpConnectionHandlerProcessor::COWLlinkHttpConnectionHandlerProcessor(CConfiguration* loaderConfig, CQtHttpConnectionHandlerReleaser* releaser) : COWLlinkProcessor(false) { mReleaser = releaser; mLoaderConfig = loaderConfig; reasonerCommander = CConfigManagerReader::readCommanderManagerConfig(mLoaderConfig); mSocket = nullptr; mQueued = false; mProcessingCommand = nullptr; startThread(); mThreadStartedSemaphore.acquire(1); } COWLlinkHttpConnectionHandlerProcessor::~COWLlinkHttpConnectionHandlerProcessor() { } void COWLlinkHttpConnectionHandlerProcessor::threadStarted() { COWLlinkProcessor::threadStarted(); mParser = new CQtHttpRequestBodyOnlyParser(); mSocket = new QTcpSocket(); mSocket->moveToThread(this); mProcessingRequest = false; mProcessMoreRead = false; connect(mSocket,SIGNAL(readyRead()),this,SLOT(connectionRead())); connect(mSocket,SIGNAL(disconnected()),this,SLOT(connectionDisconnect())); mThreadStartedSemaphore.release(1); } void COWLlinkHttpConnectionHandlerProcessor::threadStopped() { COWLlinkProcessor::threadStopped(); mSocket->close(); delete mSocket; delete mParser; } bool COWLlinkHttpConnectionHandlerProcessor::handleIncomingConnection(int socketDescriptor) { postEvent(new CHandleIncomingHttpConnectionEvent(socketDescriptor)); return true; } bool COWLlinkHttpConnectionHandlerProcessor::isHandlerQueued() { return mQueued; } COWLlinkHttpConnectionHandlerProcessor* COWLlinkHttpConnectionHandlerProcessor::setHandlerQueued(bool queued) { mQueued = queued; return this; } bool COWLlinkHttpConnectionHandlerProcessor::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (COWLlinkProcessor::processCustomsEvents(type,event)) { return true; } else { if (type == CConnectionReadyReadEvent::EVENTTYPE) { CConnectionReadyReadEvent* crre = (CConnectionReadyReadEvent*)event; if (!mProcessingRequest) { if (!mParser->readFromDevice(mSocket)) { // error QString errorString = QString("HTTP/1.1 400 error parsing request\r\nConnection: close\r\n\r\n400 Parsing error: %1\r\n").arg(mParser->getHttpRequestParsingErrorString()); LOG(INFO,"::Konclude::Control::Interface::OWLlink::OWLlinkHTTPConnectionProcessor",logTr("Error parsing HTTP request, '%1'.").arg(mParser->getHttpRequestParsingErrorString()),this); mSocket->write(errorString.toLocal8Bit()); mSocket->disconnectFromHost(); } if (mParser->hasHttpRequestParsingCompleted()) { mProcessingRequest = true; mProcessingByteArray = mParser->takeBodyData(); if (mProcessingByteArray != 0) { LOG(INFO,"::Konclude::Control::Interface::OWLlink::OWLlinkHTTPConnectionProcessor",logTr("HTTP request successfully parsed, %1 Bytes received.").arg(mProcessingByteArray->count()),this); COWLlinkQtXMLCommandParser *owllinkCommandParser = new COWLlinkQtXMLCommandParser(); mOwllinkInterpreter = new COWLLinkRecordInterpreter(preSynchronizer,mLoaderConfig); defaultCommandDelegater = mOwllinkInterpreter; CParseOWLlinkCommandsCommand *parseCommand = new CParseOWLlinkCommandsCommand(mProcessingByteArray,mSocket->peerAddress().toString()); parseCommand->setRecorder(mOwllinkInterpreter); parseCommand->setReportErrorFromSubCommands(false); CCommandProcessedCallbackEvent *proComm = new CCommandProcessedCallbackEvent(this,parseCommand); parseCommand->addProcessedCallback(proComm); owllinkCommandParser->realizeCommand(parseCommand,mOwllinkInterpreter); mProcessingCommand = parseCommand; delete owllinkCommandParser; delete mProcessingByteArray; } else { // invalid request QString koncludeString = QString("%1 %2").arg(CKoncludeInfo::getKoncludeName()).arg(CKoncludeInfo::getKoncludeVersionString()); sendData(QString("

%1 OWLlink Sever

This response is generated from Konclude's OWLlink server for invalid OWLlink requests. Please make sure that the OWLlink request is appended in OWL 2 XML serialisation as content (with correct Content-Length) of your HTTP request. See konclude.com for help and further information.

").arg(koncludeString).toLocal8Bit()); mProcessingRequest = false; if (mParser->hasRequestedCloseConnection()) { mSocket->disconnectFromHost(); } else if (mProcessMoreRead) { mProcessMoreRead = false; connectionRead(); } mParser->reset(); } } } return true; } else if (type == CConnectionDisconnectedEvent::EVENTTYPE) { CConnectionDisconnectedEvent* cde = (CConnectionDisconnectedEvent*)event; mParser->reset(); mProcessMoreRead = false; if (!mProcessingRequest) { mHandlerBusy = false; } mReleaser->releaseConnectionHandler(this); return true; } else if (type == CHandleIncomingHttpConnectionEvent::EVENTTYPE) { CHandleIncomingHttpConnectionEvent* hihc = (CHandleIncomingHttpConnectionEvent*)event; cint64 socketDescriptor = hihc->getSocketDescriptor(); LOG(INFO,"::Konclude::Control::Interface::OWLlink::OWLlinkHTTPConnectionProcessor",logTr("Start processing new incoming connection."),this); mSocket->setSocketDescriptor(socketDescriptor); mHandlerBusy = true; return true; } } return false; } COWLlinkProcessor* COWLlinkHttpConnectionHandlerProcessor::initializeOWLlinkContent() { return this; } COWLlinkProcessor* COWLlinkHttpConnectionHandlerProcessor::sendData(const QByteArray& dataArray) { if (mSocket->state() == QTcpSocket::ConnectedState) { QString connectionString = QString("Connection: "); if (mParser->hasRequestedCloseConnection()) { connectionString += QString("close"); } else { connectionString += QString("keep-alive"); } QString serverString = QString("Server: %1 %2").arg(CKoncludeInfo::getKoncludeName()).arg(CKoncludeInfo::getKoncludeVersionString()); QString responseHeadString = QString("HTTP/1.1 200 OK\r\n%1\r\n%2\r\nContent-Length: %3\r\n\r\n").arg(serverString).arg(connectionString).arg(dataArray.length()); mSocket->write(responseHeadString.toLocal8Bit()); mSocket->write(dataArray); LOG(INFO,"::Konclude::Control::Interface::OWLlink::OWLlinkHTTPConnectionProcessor",logTr("HTTP request successfully processed, %1 Bytes sent.").arg(dataArray.count()),this); } else { LOG(INFO,"::Konclude::Control::Interface::OWLlink::OWLlinkHTTPConnectionProcessor",logTr("HTTP request successfully processed, but connection already closed."),this); } return this; } COWLlinkProcessor* COWLlinkHttpConnectionHandlerProcessor::concludeOWLlinkContent() { sendData(mOwllinkInterpreter->getByteArray()); delete mOwllinkInterpreter; delete mProcessingCommand; mProcessingCommand = nullptr; mOwllinkInterpreter = nullptr; mProcessingRequest = false; if (mParser->hasRequestedCloseConnection()) { mSocket->disconnectFromHost(); } else if (mProcessMoreRead) { mProcessMoreRead = false; connectionRead(); } mParser->reset(); return this; } void COWLlinkHttpConnectionHandlerProcessor::connectionRead() { postEvent(new CConnectionReadyReadEvent()); } void COWLlinkHttpConnectionHandlerProcessor::connectionDisconnect() { postEvent(new CConnectionDisconnectedEvent()); } CConfiguration* COWLlinkHttpConnectionHandlerProcessor::getConfiguration() { if (!reasonerCommander) { return mLoaderConfig; } else { CGetDescriptionCommand *getDesComm = new CGetDescriptionCommand(); reasonerCommander->delegateCommand(getDesComm); CCommandExecutedBlocker commExeBlocker; commExeBlocker.waitExecutedCommand(getDesComm); CConfiguration *config = getDesComm->getConfiguration(); return config; } } }; // end namespace OWLlink }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/OWLlink/COWLlinkHttpConnectionHandlerProcessorFactory.hKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/OWLlink/COWLlinkHttpConnectionHandlerProcess0000644000175000017500000000556512520756356032231 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_INTERFACE_OWLLINK_COWLLINKHTTPCONNECTIONHANDLERPROCESSORFACTORY_H #define KONCLUDE_CONTROL_INTERFACE_OWLLINK_COWLLINKHTTPCONNECTIONHANDLERPROCESSORFACTORY_H // Libraries includes #include #include // Namespace includes #include "OWLlinkSettings.h" #include "COWLlinkHttpConnectionHandlerProcessor.h" // Other includes #include "Network/HTTP/CQtHttpConnectionHandlerFactory.h" #include "Network/HTTP/CQtHttpConnectionHandlerReleaser.h" #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Config; using namespace Network::HTTP; using namespace Network::HTTP::Events; namespace Control { namespace Interface { namespace OWLlink { /*! * * \class COWLlinkHttpConnectionHandlerProcessorFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLlinkHttpConnectionHandlerProcessorFactory : public CQtHttpConnectionHandlerFactory, public CQtHttpConnectionHandlerReleaser { // public methods public: //! Constructor COWLlinkHttpConnectionHandlerProcessorFactory(CConfiguration* loaderConfig); //! Destructor virtual ~COWLlinkHttpConnectionHandlerProcessorFactory(); virtual CQtHttpConnectionHandler* getConnectionHandler(); virtual CQtHttpConnectionHandlerReleaser* releaseConnectionHandler(CQtHttpConnectionHandler* connectionHandler); // protected methods protected: // protected variables protected: CConfiguration* mLoaderConfig; QList mContainerList; QList mFreeHandlerList; bool mHandlerReleased; // private methods private: // private variables private: }; }; // end namespace OWLlink }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_INTERFACE_OWLLINK_COWLLINKHTTPCONNECTIONHANDLERPROCESSORFACTORY_H Konclude-v0.6.2-544-SourceCode/Source/Control/Interface/OWLlink/COWLlinkProcessor.cpp0000644000175000017500000030132512520756356027166 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLlinkProcessor.h" namespace Konclude { namespace Control { namespace Interface { namespace OWLlink { COWLlinkProcessor::COWLlinkProcessor(bool immediatelyStartThread) : CThread("OWLlinkProcessor"), CLogIdentifier("::Konclude::Control::Interface::OWLlink::OWLlinkProcessor",this) { preSynchronizer = new CPreconditionSynchronizer(this); reasonerCommander = 0; mConfLoadOntologiesSAXParsing = true; mConfLoadOntologiesStreamParsing = true; defaultCommandDelegater = preSynchronizer; mConfLogProcessingTimes = false; mNetworkManager = nullptr; if (immediatelyStartThread) { startThread(); } } COWLlinkProcessor::~COWLlinkProcessor() { stopThread(); delete preSynchronizer; } COWLlinkProcessor *COWLlinkProcessor::startProcessing() { postEvent(new CInitializeEvent()); return this; } CCommandDelegater *COWLlinkProcessor::delegateCommand(CCommand *command) { postEvent(new CRealizeCommandEvent(command)); return this; } QStringList COWLlinkProcessor::getParserOrderFromFileName(const QString& fileName) { QStringList parserList; bool owl2FunctionalParserAdded = false; bool owl2XMLParserAdded = false; QString upperFileString = fileName.toUpper(); if (!owl2XMLParserAdded && (upperFileString.endsWith(".OWL.XML") || upperFileString.endsWith(".XML.OWL"))) { owl2XMLParserAdded = true; parserList.append(QString("OWL2XML")); } if (!owl2FunctionalParserAdded && (upperFileString.endsWith(".OWL.FSS") || upperFileString.endsWith(".FSS.OWL"))) { owl2FunctionalParserAdded = true; parserList.append(QString("OWL2Functional")); } if (!owl2XMLParserAdded && (upperFileString.endsWith(".XML"))) { owl2XMLParserAdded = true; parserList.append(QString("OWL2XML")); } if (!owl2FunctionalParserAdded && (upperFileString.endsWith(".FSS"))) { owl2FunctionalParserAdded = true; parserList.append(QString("OWL2Functional")); } if (!owl2XMLParserAdded && (upperFileString.contains(".XML"))) { owl2XMLParserAdded = true; parserList.append(QString("OWL2XML")); } if (!owl2FunctionalParserAdded && (upperFileString.contains(".FSS"))) { owl2FunctionalParserAdded = true; parserList.append(QString("OWL2Functional")); } if (!owl2XMLParserAdded && (upperFileString.contains("XML"))) { owl2XMLParserAdded = true; parserList.append(QString("OWL2XML")); } if (!owl2FunctionalParserAdded && (upperFileString.contains("FSS"))) { owl2FunctionalParserAdded = true; parserList.append(QString("OWL2Functional")); } if (!owl2FunctionalParserAdded) { owl2FunctionalParserAdded = true; parserList.append(QString("OWL2Functional")); } if (!owl2XMLParserAdded) { owl2XMLParserAdded = true; parserList.append(QString("OWL2XML")); } return parserList; } CQtHttpTransactionManager* COWLlinkProcessor::getNetworkTransactionManager() { if (!mNetworkManager) { mNetworkManager = new CQtHttpTransactionManager(30*60*1000); } return mNetworkManager; } bool COWLlinkProcessor::createDownloadParseCommands(const QString& knowledgeBaseNameString, CCommand* parentCommand, CKnowledgeBaseRevisionCommandProvider* kbProviderCommand, const QMap& ontoIRIMapping, const QStringList& ontoIRIStringList, CCommandRecordRouter& commandRecordRouter) { QList loadDataList; QList preconditionsList; cint64 downloadRequiredCount = 0; foreach (const QString& ontoIRIString, ontoIRIStringList) { QString resolvedString = ontoIRIString; for (QMap::const_iterator resolveIRIIt = ontoIRIMapping.constBegin(), resolveIRIItEnd = ontoIRIMapping.constEnd(); resolveIRIIt != resolveIRIItEnd; ++resolveIRIIt) { QString identifyIRI(resolveIRIIt.key()); QString resolvingIRI(resolveIRIIt.value()); if (resolvedString.startsWith(identifyIRI)) { resolvedString = resolvedString.mid(identifyIRI.length()); resolvedString = resolvingIRI + resolvedString; } } if (resolvedString != ontoIRIString) { CUnspecifiedMessageInformationRecord::makeRecord(QString("Redirecting '%1' to '%2'.").arg(ontoIRIString).arg(resolvedString),&commandRecordRouter); } if (resolvedString.startsWith("http:") || resolvedString.startsWith("https:") || resolvedString.startsWith("ftp:")) { QBuffer* tmpBuffer = new QBuffer(); CLoadKnowledgeBaseFinishDownloadCommand* finishDownloadCommand = new CLoadKnowledgeBaseFinishDownloadCommand(resolvedString,tmpBuffer,preSynchronizer); parentCommand->makeToSubCommand(finishDownloadCommand); CLoadKnowledgeBaseStartDownloadCommand* startDownloadCommand = new CLoadKnowledgeBaseStartDownloadCommand(resolvedString,finishDownloadCommand); parentCommand->makeToSubCommand(startDownloadCommand); preSynchronizer->delegateCommand(startDownloadCommand); preconditionsList.append(startDownloadCommand); preconditionsList.append(finishDownloadCommand); ++downloadRequiredCount; CLoadKnowledgeBaseData* loadData = new CLoadKnowledgeBaseData(tmpBuffer,ontoIRIString,resolvedString); loadDataList.append(loadData); } else { QString iriFileString = resolvedString; if (iriFileString.startsWith("file:")) { iriFileString.replace("file:",""); } while (!QFile::exists(iriFileString) && iriFileString.startsWith("/")) { iriFileString = iriFileString.remove(0,1); } if (!QFile::exists(iriFileString)) { CUnspecifiedMessageErrorRecord::makeRecord(QString("File '%1' not found.").arg(resolvedString),&commandRecordRouter); } else { QFile* file = new QFile(iriFileString); CLoadKnowledgeBaseData* loadData = new CLoadKnowledgeBaseData(file,ontoIRIString,resolvedString); loadDataList.append(loadData); } } } CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand* chPaInKBOntComm = new CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand(knowledgeBaseNameString,loadDataList,ontoIRIMapping,kbProviderCommand); parentCommand->makeToSubCommand(chPaInKBOntComm); for (QList::const_iterator it = preconditionsList.constBegin(), itEnd = preconditionsList.constEnd(); it != itEnd; ++it) { CCommand* preconditionCommand = *it; chPaInKBOntComm->addCommandPrecondition(new CCommandProcessedPrecondition(preconditionCommand)); } if (kbProviderCommand->getCommand() != parentCommand) { chPaInKBOntComm->addCommandPrecondition(new CCommandProcessedPrecondition(kbProviderCommand->getCommand())); } preSynchronizer->delegateCommand(chPaInKBOntComm); return true; } bool COWLlinkProcessor::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (!CThread::processCustomsEvents(type,event)) { if (type == EVENTREALIZECOMMAND) { CRealizeCommandEvent *commandEvent = (CRealizeCommandEvent *)event; if (commandEvent) { CCommand *command = commandEvent->getCommand(); if (command) { if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(command->getRecorder(),getLogDomain(),command); CTellKnowledgeBaseOWL2XMLNodeCommand *tellKBC = (CTellKnowledgeBaseOWL2XMLNodeCommand *)command; CCreateKnowledgeBaseRevisionUpdateCommand *crKBRevUpC = new CCreateKnowledgeBaseRevisionUpdateCommand(tellKBC->getKnowledgeBaseName()); tellKBC->makeToSubCommand(crKBRevUpC); preSynchronizer->delegateCommand(crKBRevUpC); CParseOWL2XMLOntologyCommand *pOWLOntC = new CParseOWL2XMLOntologyCommand(tellKBC->getOWL2Node(),crKBRevUpC); tellKBC->makeToSubCommand(pOWLOntC); preSynchronizer->delegateCommand(pOWLOntC); CInstallKnowledgeBaseRevisionUpdateCommand *inKBRevUpC = new CInstallKnowledgeBaseRevisionUpdateCommand(tellKBC->getKnowledgeBaseName(),pOWLOntC); inKBRevUpC->addCommandPrecondition(new CCommandProcessedPrecondition(pOWLOntC)); tellKBC->makeToSubCommand(inKBRevUpC); preSynchronizer->delegateCommand(inKBRevUpC); CPrepareKnowledgeBaseForRevisionCommand* prepareKBC = new CPrepareKnowledgeBaseForRevisionCommand(crKBRevUpC); tellKBC->makeToSubCommand(prepareKBC); prepareKBC->addCommandPrecondition(new CCommandProcessedPrecondition(inKBRevUpC)); preSynchronizer->delegateCommand(prepareKBC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(command->getRecorder(),getLogDomain(),command); CLoadKnowledgeBaseKRSSTestConceptCommand *loadKBC = (CLoadKnowledgeBaseKRSSTestConceptCommand *)command; CCreateKnowledgeBaseRevisionUpdateCommand *crKBRevUpC = new CCreateKnowledgeBaseRevisionUpdateCommand(loadKBC->getKnowledgeBaseName()); loadKBC->makeToSubCommand(crKBRevUpC); preSynchronizer->delegateCommand(crKBRevUpC); CReadTextCommand *readTextC = new CReadTextCommand(loadKBC->getLoadIRIString()); loadKBC->makeToSubCommand(readTextC); preSynchronizer->delegateCommand(readTextC); CParseKRSSTestConceptOntologyCommand *pOWLOntC = new CParseKRSSTestConceptOntologyCommand(readTextC,crKBRevUpC,loadKBC->getTestConceptNameString()); loadKBC->makeToSubCommand(pOWLOntC); preSynchronizer->delegateCommand(pOWLOntC); CInstallKnowledgeBaseRevisionUpdateCommand *inKBRevUpC = new CInstallKnowledgeBaseRevisionUpdateCommand(loadKBC->getKnowledgeBaseName(),pOWLOntC); inKBRevUpC->addCommandPrecondition(new CCommandProcessedPrecondition(pOWLOntC)); loadKBC->makeToSubCommand(inKBRevUpC); preSynchronizer->delegateCommand(inKBRevUpC); CPrepareKnowledgeBaseForRevisionCommand* prepareKBC = new CPrepareKnowledgeBaseForRevisionCommand(crKBRevUpC); loadKBC->makeToSubCommand(prepareKBC); prepareKBC->addCommandPrecondition(new CCommandProcessedPrecondition(inKBRevUpC)); preSynchronizer->delegateCommand(prepareKBC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(command->getRecorder(),getLogDomain(),command); CPrepareKnowledgeBaseForRevisionCommand *prepareKBC = (CPrepareKnowledgeBaseForRevisionCommand *)command; COntologyRevision* ontoRev = prepareKBC->getOntologyRevision(); bool preparingOntology = false; if (ontoRev) { CConfigurationBase* config = ontoRev->getOntologyConfiguration(); COntologyProcessingStepVector* ontProStepVec = COntologyProcessingStepVector::getProcessingStepVectorInstance(); bool build = CConfigDataReader::readConfigBoolean(config,"Konclude.Ontology.Revision.BuildAfterModification"); if (build) { prepareKBC->addOntologyProcessingStepRequirement( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSBUILD), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) ); } bool preprocess = CConfigDataReader::readConfigBoolean(config,"Konclude.Ontology.Revision.PreprocessAfterModification"); if (preprocess) { prepareKBC->addOntologyProcessingStepRequirement( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSPREPROCESS), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) ); } bool consistency = CConfigDataReader::readConfigBoolean(config,"Konclude.Ontology.Revision.ConsistencyPrecomputationAfterModification"); if (consistency) { prepareKBC->addOntologyProcessingStepRequirement( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSCONSISTENCY), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) ); } bool cycles = CConfigDataReader::readConfigBoolean(config,"Konclude.Ontology.Revision.CyclesPrecomputationAfterModification"); if (cycles) { prepareKBC->addOntologyProcessingStepRequirement( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSPRECOMPUTECYCLES), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) ); } bool classify = CConfigDataReader::readConfigBoolean(config,"Konclude.Ontology.Revision.ClassifyAfterModification"); if (classify) { prepareKBC->addOntologyProcessingStepRequirement( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSCLASSCLASSIFY), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) ); } if (!prepareKBC->getOntologyProcessingRequirementList()->isEmpty() && reasonerCommander) { CStopProcessCommandRecord::makeRecord(&commandRecordRouter); preparingOntology = true; reasonerCommander->realizeCommand(command); } } if (!preparingOntology) { CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(command->getRecorder(),getLogDomain(),command); CLoadKnowledgeBaseOWLFunctionalOntologyCommand *loadKBOWLXMLOnto = (CLoadKnowledgeBaseOWLFunctionalOntologyCommand *)command; CCreateKnowledgeBaseRevisionUpdateCommand *crKBRevUpC = new CCreateKnowledgeBaseRevisionUpdateCommand(loadKBOWLXMLOnto->getKnowledgeBaseName()); loadKBOWLXMLOnto->makeToSubCommand(crKBRevUpC); preSynchronizer->delegateCommand(crKBRevUpC); CCommand* lastWaitCommand = crKBRevUpC; CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand = nullptr; QStringList ontoIRIs(loadKBOWLXMLOnto->getLoadIRIStrings()); foreach (QString ontoIRI, ontoIRIs) { CStreamParseOWL2FunctionalOntologyCommand *pOWLOntC = new CStreamParseOWL2FunctionalOntologyCommand(ontoIRI,crKBRevUpC); if (lastWaitCommand) { pOWLOntC->addCommandPrecondition(new CCommandProcessedPrecondition(lastWaitCommand)); } loadKBOWLXMLOnto->makeToSubCommand(pOWLOntC); preSynchronizer->delegateCommand(pOWLOntC); ontologyRevisionProviderCommand = pOWLOntC; lastWaitCommand = pOWLOntC; } CInstallKnowledgeBaseRevisionUpdateCommand *inKBRevUpC = new CInstallKnowledgeBaseRevisionUpdateCommand(loadKBOWLXMLOnto->getKnowledgeBaseName(),ontologyRevisionProviderCommand); inKBRevUpC->addCommandPrecondition(new CCommandProcessedPrecondition(lastWaitCommand)); loadKBOWLXMLOnto->makeToSubCommand(inKBRevUpC); preSynchronizer->delegateCommand(inKBRevUpC); CPrepareKnowledgeBaseForRevisionCommand* prepareKBC = new CPrepareKnowledgeBaseForRevisionCommand(ontologyRevisionProviderCommand); loadKBOWLXMLOnto->makeToSubCommand(prepareKBC); prepareKBC->addCommandPrecondition(new CCommandProcessedPrecondition(inKBRevUpC)); preSynchronizer->delegateCommand(prepareKBC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(command->getRecorder(),getLogDomain(),command); CLoadKnowledgeBaseOWLXMLOntologyCommand *loadKBOWLXMLOnto = (CLoadKnowledgeBaseOWLXMLOntologyCommand *)command; CCreateKnowledgeBaseRevisionUpdateCommand *crKBRevUpC = new CCreateKnowledgeBaseRevisionUpdateCommand(loadKBOWLXMLOnto->getKnowledgeBaseName()); loadKBOWLXMLOnto->makeToSubCommand(crKBRevUpC); preSynchronizer->delegateCommand(crKBRevUpC); QStringList ontoIRIs(loadKBOWLXMLOnto->getLoadIRIStrings()); CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand* chPaInKBOntComm = new CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand(loadKBOWLXMLOnto->getKnowledgeBaseName(),ontoIRIs,crKBRevUpC); loadKBOWLXMLOnto->makeToSubCommand(chPaInKBOntComm); preSynchronizer->delegateCommand(chPaInKBOntComm); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(command->getRecorder(),getLogDomain(),command); CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand* chPaInKBOntComm = (CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand *)command; CConfigData* data = nullptr; COntologyRevision* ontoRev = chPaInKBOntComm->getOntologyRevision(); if (ontoRev) { COntologyConfigurationExtension* ontoConfExt = chPaInKBOntComm->getOntologyRevision()->getOntologyConfiguration(); bool confLoadOntologiesStreamParsing = mConfLoadOntologiesStreamParsing; bool confLoadOntologiesSAXParsing = mConfLoadOntologiesSAXParsing; data = ontoConfExt->getRelatedConfigChange("Konclude.OWLlink.StreamBasedLoadOntologiesParsing"); if (data) { confLoadOntologiesStreamParsing = data->getBoolean(); } data = ontoConfExt->getRelatedConfigChange("Konclude.OWLlink.SAXBasedLoadOntologiesParsing"); if (data) { confLoadOntologiesSAXParsing = data->getBoolean(); } QStringList ontoIRIs(chPaInKBOntComm->getLoadIRIStrings()); CCommand* lastWaitCommand = nullptr; CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand = nullptr; foreach (QString ontoIRI, ontoIRIs) { if (confLoadOntologiesStreamParsing) { CStreamParseOWL2XMLOntologyCommand *pOWLOntC = new CStreamParseOWL2XMLOntologyCommand(ontoIRI,chPaInKBOntComm); if (lastWaitCommand) { pOWLOntC->addCommandPrecondition(new CCommandProcessedPrecondition(lastWaitCommand)); } chPaInKBOntComm->makeToSubCommand(pOWLOntC); preSynchronizer->delegateCommand(pOWLOntC); ontologyRevisionProviderCommand = pOWLOntC; lastWaitCommand = pOWLOntC; } else if (confLoadOntologiesSAXParsing) { CSAXParseOWL2XMLOntologyCommand *pOWLOntC = new CSAXParseOWL2XMLOntologyCommand(ontoIRI,chPaInKBOntComm); if (lastWaitCommand) { pOWLOntC->addCommandPrecondition(new CCommandProcessedPrecondition(lastWaitCommand)); } chPaInKBOntComm->makeToSubCommand(pOWLOntC); preSynchronizer->delegateCommand(pOWLOntC); ontologyRevisionProviderCommand = pOWLOntC; lastWaitCommand = pOWLOntC; } else { CReadXMLCommand *readXMLC = new CReadXMLCommand(ontoIRI); chPaInKBOntComm->makeToSubCommand(readXMLC); preSynchronizer->delegateCommand(readXMLC); CParseOWL2XMLOntologyCommand *pOWLOntC = new CParseOWL2XMLOntologyCommand(readXMLC,chPaInKBOntComm); if (lastWaitCommand) { pOWLOntC->addCommandPrecondition(new CCommandProcessedPrecondition(lastWaitCommand)); } chPaInKBOntComm->makeToSubCommand(pOWLOntC); preSynchronizer->delegateCommand(pOWLOntC); ontologyRevisionProviderCommand = pOWLOntC; lastWaitCommand = pOWLOntC; } } CInstallKnowledgeBaseRevisionUpdateCommand *inKBRevUpC = new CInstallKnowledgeBaseRevisionUpdateCommand(chPaInKBOntComm->getKnowledgeBaseName(),ontologyRevisionProviderCommand); inKBRevUpC->addCommandPrecondition(new CCommandProcessedPrecondition(lastWaitCommand)); chPaInKBOntComm->makeToSubCommand(inKBRevUpC); preSynchronizer->delegateCommand(inKBRevUpC); CPrepareKnowledgeBaseForRevisionCommand* prepareKBC = new CPrepareKnowledgeBaseForRevisionCommand(ontologyRevisionProviderCommand); chPaInKBOntComm->makeToSubCommand(prepareKBC); prepareKBC->addCommandPrecondition(new CCommandProcessedPrecondition(inKBRevUpC)); preSynchronizer->delegateCommand(prepareKBC); } else { CUnspecifiedMessageErrorRecord::makeRecord("Ontology revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(command->getRecorder(),getLogDomain(),command); CLoadKnowledgeBaseStartDownloadCommand* loadKBStartDownload = (CLoadKnowledgeBaseStartDownloadCommand *)command; CLoadKnowledgeBaseFinishDownloadCommand* finishCommand = loadKBStartDownload->getFinishCommand(); QByteArray* destinationDataArray = new QByteArray(); CQtHttpTransactionManager* transMan = getNetworkTransactionManager(); CHttpRequest* request = transMan->createRequest(loadKBStartDownload->getDownloadIRIString()); CHttpResponse* response = transMan->getResponse(request); transMan->callbackResponseData(response,destinationDataArray,finishCommand); finishCommand->setTemporaryDataPointer(destinationDataArray); finishCommand->setResponse(response); LOG(INFO,getLogDomain(),logTr("Downloading '%1'.").arg(loadKBStartDownload->getDownloadIRIString()),this); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(command->getRecorder(),getLogDomain(),command); CLoadKnowledgeBaseFinishDownloadCommand* loadKBFinishDownload = (CLoadKnowledgeBaseFinishDownloadCommand *)command; CQtHttpTransactionManager* transMan = getNetworkTransactionManager(); CHttpResponse* response = loadKBFinishDownload->getResponse(); QString iriString = loadKBFinishDownload->getDownloadString(); QByteArray* dataArray = loadKBFinishDownload->getTemporaryDataPointer(true); if (!transMan->hasFinishedSucecssfully(response)) { CUnspecifiedMessageErrorRecord::makeRecord(QString("Download of '%1' has failed.").arg(iriString),&commandRecordRouter); } else { cint64 downloadSize = dataArray->count(); QString unitString = "Bytes"; if (downloadSize > 10000) { downloadSize /= 1024; unitString = "KBytes"; } if (downloadSize > 10000) { downloadSize /= 1024; unitString = "MBytes"; } LOG(INFO,getLogDomain(),logTr("Successfully downloaded '%1', received %2 %3.").arg(iriString).arg(downloadSize).arg(unitString),this); //CUnspecifiedMessageInformationRecord::makeRecord(QString("Successfully downloaded '%1', received %2 MBytes.").arg(iriString).arg(downloadSize),&commandRecordRouter); QIODevice* writeDevice = loadKBFinishDownload->getWriteIODevice(); if (writeDevice) { if (writeDevice->open(QIODevice::WriteOnly)) { writeDevice->write(*dataArray); writeDevice->close(); } } } delete dataArray; transMan->releaseResponse(response); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(command->getRecorder(),getLogDomain(),command); CLoadKnowledgeBaseOWLAutoOntologyCommand *loadKBOWLAutoOnto = (CLoadKnowledgeBaseOWLAutoOntologyCommand *)command; CCreateKnowledgeBaseRevisionUpdateCommand *crKBRevUpC = new CCreateKnowledgeBaseRevisionUpdateCommand(loadKBOWLAutoOnto->getKnowledgeBaseName()); loadKBOWLAutoOnto->makeToSubCommand(crKBRevUpC); preSynchronizer->delegateCommand(crKBRevUpC); QMap ontoIRIMapping = loadKBOWLAutoOnto->getOntologieIRIMappings(); QStringList ontoIRIStringList(loadKBOWLAutoOnto->getLoadIRIStrings()); createDownloadParseCommands(loadKBOWLAutoOnto->getKnowledgeBaseName(),loadKBOWLAutoOnto,crKBRevUpC,ontoIRIMapping,ontoIRIStringList,commandRecordRouter); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(command->getRecorder(),getLogDomain(),command); CImportKnowledgeBaseOWLAutoOntologyCommand *importKBOWLAutoOnto = (CImportKnowledgeBaseOWLAutoOntologyCommand *)command; QMap ontoIRIMapping = importKBOWLAutoOnto->getOntologieIRIMappings(); QStringList ontoIRIStringList(importKBOWLAutoOnto->getLoadIRIStrings()); createDownloadParseCommands(importKBOWLAutoOnto->getKnowledgeBaseName(),importKBOWLAutoOnto,importKBOWLAutoOnto,ontoIRIMapping,ontoIRIStringList,commandRecordRouter); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(command->getRecorder(),getLogDomain(),command); CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand* chPaInKBOntComm = (CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand *)command; CConfigData* data = nullptr; COntologyRevision* ontoRev = chPaInKBOntComm->getOntologyRevision(); if (ontoRev) { COntologyConfigurationExtension* ontoConfExt = chPaInKBOntComm->getOntologyRevision()->getOntologyConfiguration(); COntologyConfigurationExtension *ontConfig = ontoRev->getOntologyConfiguration(); CConcreteOntology *ont = ontoRev->getOntology(); QList importOntologiesList; QList loadDataList(chPaInKBOntComm->getLoadDataList()); bool allParsingSucceeded = true; for (QList::const_iterator loadDataIt = loadDataList.constBegin(), loadDataItEnd = loadDataList.constEnd(); loadDataIt != loadDataItEnd; ++loadDataIt) { CLoadKnowledgeBaseData* loadData = *loadDataIt; QIODevice* device = loadData->getLoadDevice(); QString ontoIRI = loadData->getOriginalDataName(); QString resolvedIRI = loadData->getResolvedDataName(); QString iriFileString = resolvedIRI; QStringList parserList = getParserOrderFromFileName(iriFileString); QStringList parserErrorList; QTime parsingTime; if (mConfLogProcessingTimes) { parsingTime.start(); } CConcreteOntologyUpdateCollectorBuilder *builder = new CConcreteOntologyUpdateCollectorBuilder(ont); builder->initializeBuilding(); bool parsingSucceeded = false; for (QStringList::const_iterator parserIt = parserList.constBegin(), parserItEnd = parserList.constEnd(); !parsingSucceeded && parserIt != parserItEnd; ++parserIt) { QString parserString(*parserIt); QString parsingTryLogString; if (parserString == "OWL2Functional") { COWL2FunctionalJAVACCOntologyStreamParser *owl2Parser = new COWL2FunctionalJAVACCOntologyStreamParser(builder); parsingTryLogString = QString("Trying stream-based OWL2/Functional ontology parsing for '%1'.").arg(iriFileString); LOG(INFO,getLogDomain(),parsingTryLogString,this); if (device->open(QIODevice::ReadOnly)) { device->reset(); if (owl2Parser->parseOntology(device)) { builder->completeBuilding(); parsingSucceeded = true; LOG(INFO,getLogDomain(),logTr("Finished stream-based OWL2/Functional ontology parsing for '%1'.").arg(iriFileString),this); } else { if (owl2Parser->hasError()) { parserErrorList.append(QString("Stream-based OWL2/Functional ontology parsing error: %1").arg(owl2Parser->getErrorString())); } parserErrorList.append(QString("Stream-based OWL2/Functional ontology parsing for '%1' failed.").arg(iriFileString)); } device->close(); } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Data for '%1' cannot be read.").arg(resolvedIRI),&commandRecordRouter); } delete owl2Parser; } else if (parserString == "OWL2XML") { bool enforceUTF8ConvertingParsing = CConfigDataReader::readConfigBoolean(ontConfig,"Konclude.Parser.UTF8CompatibilityEnforcedXMLStreamParsing"); COWL2QtXMLOntologyStreamParser *owl2Parser = nullptr; if (enforceUTF8ConvertingParsing) { owl2Parser = new COWL2QtXMLOntologyStableStreamParser(builder); } else { owl2Parser = new COWL2QtXMLOntologyStreamParser(builder); } parsingTryLogString = QString("Trying stream-based OWL2/XML ontology parsing for '%1'.").arg(iriFileString); LOG(INFO,getLogDomain(),parsingTryLogString,this); if (device->open(QIODevice::ReadOnly)) { device->reset(); if (owl2Parser->parseOntology(device)) { builder->completeBuilding(); parsingSucceeded = true; LOG(INFO,getLogDomain(),logTr("Finished stream-based OWL2/XML ontology parsing for '%1'.").arg(iriFileString),this); } else { if (owl2Parser->hasError()) { parserErrorList.append(QString("Stream-based OWL2/XML ontology parsing error: %1").arg(owl2Parser->getErrorString())); } parserErrorList.append(QString("Stream-based OWL2/XML ontology parsing for '%1' failed.").arg(iriFileString)); } device->close(); } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Data for '%1' cannot be read.").arg(resolvedIRI),&commandRecordRouter); } delete owl2Parser; } } importOntologiesList = builder->takeAddedImportOntologyList(); delete builder; if (!parsingSucceeded) { allParsingSucceeded = false; parserErrorList.append(QString("All parsers failed for '%1'.").arg(iriFileString)); for (QStringList::const_iterator errorIt = parserErrorList.constBegin(), errorItEnd = parserErrorList.constEnd(); errorIt != errorItEnd; ++errorIt) { CUnspecifiedMessageErrorRecord::makeRecord(*errorIt,&commandRecordRouter); } } if (mConfLogProcessingTimes) { cint64 parsingMilliSeconds = parsingTime.elapsed(); QString ontologieCountString = "Ontology"; if (loadDataList.count() > 1) { ontologieCountString = "Ontologies"; } LOG(INFO,getLogDomain(),logTr("%1 parsed in %2 ms.").arg(ontologieCountString).arg(parsingMilliSeconds),this); } } if (importOntologiesList.isEmpty()) { CInstallKnowledgeBaseRevisionUpdateCommand *inKBRevUpC = new CInstallKnowledgeBaseRevisionUpdateCommand(chPaInKBOntComm->getKnowledgeBaseName(),chPaInKBOntComm); chPaInKBOntComm->makeToSubCommand(inKBRevUpC); preSynchronizer->delegateCommand(inKBRevUpC); CPrepareKnowledgeBaseForRevisionCommand* prepareKBC = new CPrepareKnowledgeBaseForRevisionCommand(chPaInKBOntComm); chPaInKBOntComm->makeToSubCommand(prepareKBC); prepareKBC->addCommandPrecondition(new CCommandProcessedPrecondition(inKBRevUpC)); preSynchronizer->delegateCommand(prepareKBC); } else { if (importOntologiesList.count() > 1) { LOG(INFO,getLogDomain(),logTr("Scheduling the import of %1 ontologies.").arg(importOntologiesList.count()),this); } else { LOG(INFO,getLogDomain(),logTr("Scheduling the import of '%1'.").arg(importOntologiesList.first()),this); } CImportKnowledgeBaseOWLAutoOntologyCommand* importKBsCommand = new CImportKnowledgeBaseOWLAutoOntologyCommand(chPaInKBOntComm->getKnowledgeBaseName(),importOntologiesList,chPaInKBOntComm->getOntologieIRIMappings(),chPaInKBOntComm); chPaInKBOntComm->makeToSubCommand(importKBsCommand); preSynchronizer->delegateCommand(importKBsCommand); } } else { CUnspecifiedMessageErrorRecord::makeRecord("Ontology revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(command->getRecorder(),getLogDomain(),command); CSaveOWL2XMLExtractedKnowledgeBaseCommand *saveKBC = (CSaveOWL2XMLExtractedKnowledgeBaseCommand *)command; CGetCurrentKnowledgeBaseRevisionCommand *gcKBRevUpC = new CGetCurrentKnowledgeBaseRevisionCommand(saveKBC->getKnowledgeBaseName()); saveKBC->makeToSubCommand(gcKBRevUpC); preSynchronizer->delegateCommand(gcKBRevUpC); COntologyOWL2QtXMLRenderer* renderer = new COntologyOWL2QtXMLRenderer(); CExtractToldExpressionsOntologyCommand *extTEOC = new CExtractToldExpressionsOntologyCommand(renderer,gcKBRevUpC,saveKBC->getExtractEntitiyList()); saveKBC->makeToSubCommand(extTEOC); preSynchronizer->delegateCommand(extTEOC); CWriteOWL2XMLOntologyCommand *writeOntC = new CWriteOWL2XMLOntologyCommand(renderer,saveKBC->getSaveIRIString()); writeOntC->addCommandPrecondition(new CCommandProcessedPrecondition(extTEOC)); saveKBC->makeToSubCommand(writeOntC); preSynchronizer->delegateCommand(writeOntC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(command->getRecorder(),getLogDomain(),command); CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand *saveKBC = (CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand *)command; CGetCurrentKnowledgeBaseRevisionCommand *gcKBRevUpC = new CGetCurrentKnowledgeBaseRevisionCommand(saveKBC->getKnowledgeBaseName()); saveKBC->makeToSubCommand(gcKBRevUpC); preSynchronizer->delegateCommand(gcKBRevUpC); COntologyOWL2QtXMLRenderer* renderer = new COntologyOWL2QtXMLRenderer(); CExtractToldExpressionsOntologyCommand *extTEOC = new CExtractToldExpressionsOntologyCommand(renderer,gcKBRevUpC,saveKBC->getExtractEntitiyList()); saveKBC->makeToSubCommand(extTEOC); preSynchronizer->delegateCommand(extTEOC); CWriteOWLlinkOWL2XMLSatisfiableTestCommand *writeOntC = new CWriteOWLlinkOWL2XMLSatisfiableTestCommand(renderer,saveKBC->getSaveIRIString(),saveKBC->getExtractEntitiyList(),saveKBC->getTestKBName()); writeOntC->addCommandPrecondition(new CCommandProcessedPrecondition(extTEOC)); saveKBC->makeToSubCommand(writeOntC); preSynchronizer->delegateCommand(writeOntC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { COntologyExtractionManager exMan; exMan.realizeCommand(command); } else if (dynamic_cast(command)) { CRenderWriteManager writeMan; writeMan.realizeCommand(command); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CReadTextCommand* readTextC = (CReadTextCommand *)command; QString iriString = readTextC->getIRIString(); QFile file(iriString); if (file.open(QIODevice::ReadOnly)) { CUnspecifiedMessageInformationRecord::makeRecord(QString("Read file '%1'.").arg(iriString),&commandRecordRouter); readTextC->setReadText(file.readAll()); file.close(); } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("File '%1' not found.").arg(iriString),&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CReadXMLCommand* readXMLC = (CReadXMLCommand *)command; QString iriString = readXMLC->getIRIString(); if (iriString.startsWith("file:")) { iriString.replace("file:",""); } while (!QFile::exists(iriString) && iriString.startsWith("/")) { iriString = iriString.remove(0,1); } QFile file(iriString); if (file.open(QIODevice::ReadOnly)) { CUnspecifiedMessageInformationRecord::makeRecord(QString("Read file '%1'.").arg(iriString),&commandRecordRouter); QDomDocument document; QString errorMessage; int errorLine = 0, errorColumn = 0; if (document.setContent(file.readAll(),true,&errorMessage,&errorLine,&errorColumn)) { readXMLC->setReadXMLNode(document.documentElement()); } file.close(); } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("File '%1' not found.").arg(iriString),&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CParseKRSSTestConceptOntologyCommand *krssTCOntC = (CParseKRSSTestConceptOntologyCommand *)command; COntologyRevision *ontRev = krssTCOntC->getOntologyRevision(); if (ontRev) { CConcreteOntology *ont = ontRev->getOntology(); QTime parsingTime; if (mConfLogProcessingTimes) { parsingTime.start(); } COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CConcreteOntologyUpdateCollectorBuilder *builder = new CConcreteOntologyUpdateCollectorBuilder(ont); CKRSSOntologyParser *krssParser = new CKRSSOntologyParser(builder,krssTCOntC->getTestConceptNameString(),&commandRecordRouter); QString krssText = krssTCOntC->getOntologyKRSSText(); builder->initializeBuilding(); krssParser->parseOntologyText(krssText); builder->completeBuilding(); delete builder; delete krssParser; //COntologyConfigDependedPreProcesser *ontConDepPreProcessor = new COntologyConfigDependedPreProcesser(commandRecordRouter); //ontConDepPreProcessor->preprocess(ont,ontConfig); //delete ontConDepPreProcessor; if (mConfLogProcessingTimes) { cint64 parsingMilliSeconds = parsingTime.elapsed(); LOG(INFO,getLogDomain(),logTr("Ontology parsed in %1 ms.").arg(parsingMilliSeconds),this); } } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Knowledge base revision not available."),&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CParseOWL2XMLOntologyCommand *pOWLOntC = (CParseOWL2XMLOntologyCommand *)command; COntologyRevision *ontRev = pOWLOntC->getOntologyRevision(); if (ontRev) { CConcreteOntology *ont = ontRev->getOntology(); QTime parsingTime; if (mConfLogProcessingTimes) { parsingTime.start(); } COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CConcreteOntologyUpdateCollectorBuilder *builder = new CConcreteOntologyUpdateCollectorBuilder(ont); COWL2QtXMLOntologyParser *owl2Parser = new COWL2QtXMLOntologyParser(builder,&commandRecordRouter); QDomElement domEl = pOWLOntC->getOntologyNode(); builder->initializeBuilding(); owl2Parser->parseOntologyNode(&domEl); builder->completeBuilding(); delete builder; delete owl2Parser; if (mConfLogProcessingTimes) { cint64 parsingMilliSeconds = parsingTime.elapsed(); LOG(INFO,getLogDomain(),logTr("Ontology parsed in %1 ms.").arg(parsingMilliSeconds),this); } } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Knowledge base revision not available."),&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CSAXParseOWL2XMLOntologyCommand *pOWLOntC = (CSAXParseOWL2XMLOntologyCommand *)command; QString iriString = pOWLOntC->getSourceString(); if (iriString.startsWith("file:")) { iriString.replace("file:",""); } while (!QFile::exists(iriString) && iriString.startsWith("/")) { iriString = iriString.remove(0,1); } COntologyRevision *ontRev = pOWLOntC->getOntologyRevision(); if (ontRev) { CConcreteOntology *ont = ontRev->getOntology(); QTime parsingTime; if (mConfLogProcessingTimes) { parsingTime.start(); } COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CConcreteOntologyUpdateCollectorBuilder *builder = new CConcreteOntologyUpdateCollectorBuilder(ont); COWL2QtXMLOntologySAXParser *owl2Parser = new COWL2QtXMLOntologySAXParser(builder); builder->initializeBuilding(); LOG(INFO,getLogDomain(),logTr("Starting SAX-based ontology parsing for '%1'.").arg(iriString),this); owl2Parser->parseOntology(iriString); LOG(INFO,getLogDomain(),logTr("Finished SAX-based ontology parsing for '%1'.").arg(iriString),this); builder->completeBuilding(); delete builder; delete owl2Parser; if (mConfLogProcessingTimes) { cint64 parsingMilliSeconds = parsingTime.elapsed(); LOG(INFO,getLogDomain(),logTr("Ontology parsed in %1 ms.").arg(parsingMilliSeconds),this); } } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Knowledge base revision not available."),&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CStreamParseOWL2XMLOntologyCommand *pOWLOntC = (CStreamParseOWL2XMLOntologyCommand *)command; QString iriString = pOWLOntC->getSourceString(); if (iriString.startsWith("file:")) { iriString.replace("file:",""); } while (!QFile::exists(iriString) && iriString.startsWith("/")) { iriString = iriString.remove(0,1); } COntologyRevision *ontRev = pOWLOntC->getOntologyRevision(); if (ontRev) { CConcreteOntology *ont = ontRev->getOntology(); QTime parsingTime; if (mConfLogProcessingTimes) { parsingTime.start(); } COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CConcreteOntologyUpdateCollectorBuilder *builder = new CConcreteOntologyUpdateCollectorBuilder(ont); bool enforceUTF8ConvertingParsing = CConfigDataReader::readConfigBoolean(ontConfig,"Konclude.Parser.UTF8CompatibilityEnforcedXMLStreamParsing"); COWL2QtXMLOntologyStreamParser *owl2Parser = nullptr; if (enforceUTF8ConvertingParsing) { owl2Parser = new COWL2QtXMLOntologyStableStreamParser(builder); } else { owl2Parser = new COWL2QtXMLOntologyStreamParser(builder); } builder->initializeBuilding(); LOG(INFO,getLogDomain(),logTr("Starting stream-based OWL2/XML ontology parsing for '%1'.").arg(iriString),this); if (owl2Parser->parseOntology(iriString)) { LOG(INFO,getLogDomain(),logTr("Finished stream-based OWL2/XML ontology parsing for '%1'.").arg(iriString),this); builder->completeBuilding(); } else { if (owl2Parser->hasError()) { CUnspecifiedMessageErrorRecord::makeRecord(QString("Stream-based OWL2/XML ontology parsing error: '%1'.").arg(owl2Parser->getErrorString()),&commandRecordRouter); } CUnspecifiedMessageErrorRecord::makeRecord(QString("Stream-based OWL2/XML ontology parsing for '%1' failed.").arg(iriString),&commandRecordRouter); } delete builder; delete owl2Parser; if (mConfLogProcessingTimes) { cint64 parsingMilliSeconds = parsingTime.elapsed(); LOG(INFO,getLogDomain(),logTr("Ontology parsed in %1 ms.").arg(parsingMilliSeconds),this); } } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Knowledge base revision not available."),&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CStreamParseOWL2FunctionalOntologyCommand *pOWLOntC = (CStreamParseOWL2FunctionalOntologyCommand *)command; QString iriString = pOWLOntC->getSourceString(); if (iriString.startsWith("file:")) { iriString.replace("file:",""); } while (!QFile::exists(iriString) && iriString.startsWith("/")) { iriString = iriString.remove(0,1); } COntologyRevision *ontRev = pOWLOntC->getOntologyRevision(); if (ontRev) { CConcreteOntology *ont = ontRev->getOntology(); QTime parsingTime; if (mConfLogProcessingTimes) { parsingTime.start(); } COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CConcreteOntologyUpdateCollectorBuilder *builder = new CConcreteOntologyUpdateCollectorBuilder(ont); COWL2FunctionalJAVACCOntologyStreamParser *owl2Parser = new COWL2FunctionalJAVACCOntologyStreamParser(builder); builder->initializeBuilding(); LOG(INFO,getLogDomain(),logTr("Starting stream-based OWL2/Functional ontology parsing for '%1'.").arg(iriString),this); if (owl2Parser->parseOntology(iriString)) { LOG(INFO,getLogDomain(),logTr("Finished stream-based OWL2/Functional ontology parsing for '%1'.").arg(iriString),this); builder->completeBuilding(); } else { if (owl2Parser->hasError()) { CUnspecifiedMessageErrorRecord::makeRecord(QString("Stream-based OWL2/Functional ontology parsing error: '%1'.").arg(owl2Parser->getErrorString()),&commandRecordRouter); } CUnspecifiedMessageErrorRecord::makeRecord(QString("Stream-based OWL2/Functional ontology parsing for '%1' failed.").arg(iriString),&commandRecordRouter); } delete builder; delete owl2Parser; if (mConfLogProcessingTimes) { cint64 parsingMilliSeconds = parsingTime.elapsed(); LOG(INFO,getLogDomain(),logTr("Ontology parsed in %1 ms.").arg(parsingMilliSeconds),this); } } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Knowledge base revision not available."),&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CProcessQueryOWL2XMLNodeCommand *pqOWLC = (CProcessQueryOWL2XMLNodeCommand *)command; CBuildQueryCommand *buildQC = pqOWLC->getBuildQueryCommand(); CKnowledgeBaseRevisionCommandProvider* cKBRevCP = nullptr; bool complexQuery = pqOWLC->isComplexQuery(); if (complexQuery) { CCreateKnowledgeBaseRevisionUpdateCommand *crKBRevUpC = new CCreateKnowledgeBaseRevisionUpdateCommand(pqOWLC->getKnowledgeBaseName()); buildQC->makeToSubCommand(crKBRevUpC); cKBRevCP = crKBRevUpC; } else { CGetCurrentKnowledgeBaseRevisionCommand *crKBRevGet = new CGetCurrentKnowledgeBaseRevisionCommand(pqOWLC->getKnowledgeBaseName()); buildQC->makeToSubCommand(crKBRevGet); cKBRevCP = crKBRevGet; } CParseOWL2XMLQueryCommand *pOWLQC = new CParseOWL2XMLQueryCommand(pqOWLC->getQueryNode(),cKBRevCP); buildQC->makeToSubCommand(pOWLQC); pOWLQC->setQueryComplexity(complexQuery); CPrepareKnowledgeBaseForQueryCommand* prepKBForQueryC = new CPrepareKnowledgeBaseForQueryCommand(cKBRevCP); buildQC->makeToSubCommand(prepKBForQueryC); prepKBForQueryC->addCommandPrecondition(new CCommandProcessedPrecondition(pOWLQC)); CGenerateQueryCommand* genQC = new CGenerateQueryCommand(pOWLQC); buildQC->makeToSubCommand(genQC); buildQC->setQueryCommandProvider(genQC); genQC->addCommandPrecondition(new CCommandProcessedPrecondition(prepKBForQueryC)); CCalculateQueryCommand *calcQC = pqOWLC->getCalculateQueryCommand(); preSynchronizer->delegateCommand(buildQC); preSynchronizer->delegateCommand(calcQC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CProcessClassNameSatisfiableQueryCommand *pqOWLC = (CProcessClassNameSatisfiableQueryCommand *)command; CBuildQueryCommand *buildQC = pqOWLC->getBuildQueryCommand(); if (!buildQC) { buildQC = new CBuildQueryCommand(0,pqOWLC); pqOWLC->setBuildQueryCommand(buildQC); } CCalculateQueryCommand *calcQC = pqOWLC->getCalculateQueryCommand(); if (!calcQC) { calcQC = new CCalculateQueryCommand(buildQC,pqOWLC); pqOWLC->setCalculateQueryCommand(calcQC); } CGetCurrentKnowledgeBaseRevisionCommand *crKBRevGet = new CGetCurrentKnowledgeBaseRevisionCommand(pqOWLC->getKnowledgeBaseName()); buildQC->makeToSubCommand(crKBRevGet); CPrepareKnowledgeBaseForQueryCommand* prepKBForQueryC = new CPrepareKnowledgeBaseForQueryCommand(crKBRevGet); buildQC->makeToSubCommand(prepKBForQueryC); prepKBForQueryC->addCommandPrecondition(new CCommandProcessedPrecondition(crKBRevGet)); CConstructClassSatisfiableQueryCommand *pOWLQC = new CConstructClassSatisfiableQueryCommand(pqOWLC->getClassName(),crKBRevGet); buildQC->makeToSubCommand(pOWLQC); buildQC->setQueryCommandProvider(pOWLQC); pOWLQC->addCommandPrecondition(new CCommandProcessedPrecondition(prepKBForQueryC)); preSynchronizer->delegateCommand(buildQC); preSynchronizer->delegateCommand(calcQC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CLinker *subComIt = command->getSubCommandLinker(); while (subComIt) { CCommand *supCommand = subComIt->getData(); preSynchronizer->delegateCommand(supCommand); subComIt = subComIt->getNext(); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CParseTestsuiteXMLNodeCommand *parseTestsuiteComm = (CParseTestsuiteXMLNodeCommand *)command; CXMLTestsuiteCommandParser *testsuiteParser = new CXMLTestsuiteCommandParser(); testsuiteParser->realizeCommand(parseTestsuiteComm,preSynchronizer); delete testsuiteParser; } else if (dynamic_cast(command)) { CTestTestsuiteCommand *testTestsuiteComm = (CTestTestsuiteCommand *)command; CConfiguration *config = getConfiguration(); CReasonerTestsuiteTester *testsuiteTester = new CReasonerTestsuiteTester(config); testsuiteTester->realizeTestCommand(testTestsuiteComm); delete testsuiteTester; } else if (dynamic_cast(command)) { CEvaluateTestsuiteCommand* evalTestsuiteComm = (CEvaluateTestsuiteCommand*)command; CConfiguration *config = getConfiguration(); CReasonerEvaluationManagerThread* evalManager = new CReasonerEvaluationManagerThread(config);; evalManager->realizeEvaluationCommand(evalTestsuiteComm); evalManager->waitSynchronization(); delete evalManager; } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CWriteFunctionalSubClassHierarchyQueryCommand *wFSCHC = (CWriteFunctionalSubClassHierarchyQueryCommand *)command; CBuildQueryCommand *buildQC = wFSCHC->getBuildQueryCommand(); if (!buildQC) { buildQC = new CBuildQueryCommand(0,wFSCHC); wFSCHC->setBuildQueryCommand(buildQC); } CCalculateQueryCommand *calcQC = wFSCHC->getCalculateQueryCommand(); if (!calcQC) { calcQC = new CCalculateQueryCommand(buildQC,wFSCHC); wFSCHC->setCalculateQueryCommand(calcQC); } CGetCurrentKnowledgeBaseRevisionCommand *getCKBRC = new CGetCurrentKnowledgeBaseRevisionCommand(wFSCHC->getKnowledgeBaseName()); buildQC->makeToSubCommand(getCKBRC); CConstructWriteFunctionalSubClassHirarchyQueryCommand *pOWLQC = new CConstructWriteFunctionalSubClassHirarchyQueryCommand(getCKBRC,wFSCHC->getOutputFileString()); buildQC->makeToSubCommand(pOWLQC); buildQC->setQueryCommandProvider(pOWLQC); preSynchronizer->delegateCommand(buildQC); preSynchronizer->delegateCommand(calcQC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CWriteXMLSubClassHierarchyQueryCommand *wFSCHC = (CWriteXMLSubClassHierarchyQueryCommand *)command; CBuildQueryCommand *buildQC = wFSCHC->getBuildQueryCommand(); if (!buildQC) { buildQC = new CBuildQueryCommand(0,wFSCHC); wFSCHC->setBuildQueryCommand(buildQC); } CCalculateQueryCommand *calcQC = wFSCHC->getCalculateQueryCommand(); if (!calcQC) { calcQC = new CCalculateQueryCommand(buildQC,wFSCHC); wFSCHC->setCalculateQueryCommand(calcQC); } CGetCurrentKnowledgeBaseRevisionCommand *getCKBRC = new CGetCurrentKnowledgeBaseRevisionCommand(wFSCHC->getKnowledgeBaseName()); buildQC->makeToSubCommand(getCKBRC); CConstructWriteXMLSubClassHirarchyQueryCommand *pOWLQC = new CConstructWriteXMLSubClassHirarchyQueryCommand(getCKBRC,wFSCHC->getOutputFileString()); buildQC->makeToSubCommand(pOWLQC); buildQC->setQueryCommandProvider(pOWLQC); preSynchronizer->delegateCommand(buildQC); preSynchronizer->delegateCommand(calcQC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CWriteXMLIndividualTypesQueryCommand *wXITC = (CWriteXMLIndividualTypesQueryCommand *)command; CBuildQueryCommand *buildQC = wXITC->getBuildQueryCommand(); if (!buildQC) { buildQC = new CBuildQueryCommand(0,wXITC); wXITC->setBuildQueryCommand(buildQC); } CCalculateQueryCommand *calcQC = wXITC->getCalculateQueryCommand(); if (!calcQC) { calcQC = new CCalculateQueryCommand(buildQC,wXITC); wXITC->setCalculateQueryCommand(calcQC); } CGetCurrentKnowledgeBaseRevisionCommand *getCKBRC = new CGetCurrentKnowledgeBaseRevisionCommand(wXITC->getKnowledgeBaseName()); buildQC->makeToSubCommand(getCKBRC); CConstructWriteXMLIndividualTypesQueryCommand *pOWLQC = new CConstructWriteXMLIndividualTypesQueryCommand(getCKBRC,wXITC->getOutputFileString(),wXITC->getIndividualName()); buildQC->makeToSubCommand(pOWLQC); buildQC->setQueryCommandProvider(pOWLQC); preSynchronizer->delegateCommand(buildQC); preSynchronizer->delegateCommand(calcQC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CWriteFunctionalIndividualTypesQueryCommand *wFITC = (CWriteFunctionalIndividualTypesQueryCommand *)command; CBuildQueryCommand *buildQC = wFITC->getBuildQueryCommand(); if (!buildQC) { buildQC = new CBuildQueryCommand(0,wFITC); wFITC->setBuildQueryCommand(buildQC); } CCalculateQueryCommand *calcQC = wFITC->getCalculateQueryCommand(); if (!calcQC) { calcQC = new CCalculateQueryCommand(buildQC,wFITC); wFITC->setCalculateQueryCommand(calcQC); } CGetCurrentKnowledgeBaseRevisionCommand *getCKBRC = new CGetCurrentKnowledgeBaseRevisionCommand(wFITC->getKnowledgeBaseName()); buildQC->makeToSubCommand(getCKBRC); CConstructWriteFunctionalIndividualTypesQueryCommand *pOWLQC = new CConstructWriteFunctionalIndividualTypesQueryCommand(getCKBRC,wFITC->getOutputFileString(),wFITC->getIndividualName()); buildQC->makeToSubCommand(pOWLQC); buildQC->setQueryCommandProvider(pOWLQC); preSynchronizer->delegateCommand(buildQC); preSynchronizer->delegateCommand(calcQC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CClassifyQueryCommand* cqC = (CClassifyQueryCommand*)command; CBuildQueryCommand *buildQC = cqC->getBuildQueryCommand(); if (!buildQC) { buildQC = new CBuildQueryCommand(0,cqC); cqC->setBuildQueryCommand(buildQC); } CCalculateQueryCommand *calcQC = cqC->getCalculateQueryCommand(); if (!calcQC) { calcQC = new CCalculateQueryCommand(buildQC,cqC); cqC->setCalculateQueryCommand(calcQC); } CGetCurrentKnowledgeBaseRevisionCommand *getCKBRC = new CGetCurrentKnowledgeBaseRevisionCommand(cqC->getKnowledgeBaseName()); buildQC->makeToSubCommand(getCKBRC); CConstructClassifyQueryCommand *pOWLQC = new CConstructClassifyQueryCommand(getCKBRC); buildQC->makeToSubCommand(pOWLQC); buildQC->setQueryCommandProvider(pOWLQC); preSynchronizer->delegateCommand(buildQC); preSynchronizer->delegateCommand(calcQC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CRealizeQueryCommand* rqC = (CRealizeQueryCommand*)command; CBuildQueryCommand *buildQC = rqC->getBuildQueryCommand(); if (!buildQC) { buildQC = new CBuildQueryCommand(0,rqC); rqC->setBuildQueryCommand(buildQC); } CCalculateQueryCommand *calcQC = rqC->getCalculateQueryCommand(); if (!calcQC) { calcQC = new CCalculateQueryCommand(buildQC,rqC); rqC->setCalculateQueryCommand(calcQC); } CGetCurrentKnowledgeBaseRevisionCommand *getCKBRC = new CGetCurrentKnowledgeBaseRevisionCommand(rqC->getKnowledgeBaseName()); buildQC->makeToSubCommand(getCKBRC); CConstructRealizeQueryCommand *pOWLQC = new CConstructRealizeQueryCommand(getCKBRC); buildQC->makeToSubCommand(pOWLQC); buildQC->setQueryCommandProvider(pOWLQC); preSynchronizer->delegateCommand(buildQC); preSynchronizer->delegateCommand(calcQC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CGetKnowledgeBaseEntitiesCommand* gKBEC = (CGetKnowledgeBaseEntitiesCommand*)command; if (!gKBEC->getExtractedEntityContainer()) { gKBEC->setExtractedEntityContainer(new CExtractedKnowledgeBaseEntitiesContainer()); } CGetCurrentKnowledgeBaseRevisionCommand *getCKBRC = new CGetCurrentKnowledgeBaseRevisionCommand(gKBEC->getKnowledgeBaseName()); gKBEC->makeToSubCommand(getCKBRC); CPrepareKnowledgeBaseCommand* prepKBC = new CPrepareKnowledgeBaseCommand(getCKBRC); prepKBC->addCommandPrecondition(new CCommandProcessedPrecondition(getCKBRC)); gKBEC->makeToSubCommand(prepKBC); COntologyProcessingStepVector* ontProStepVec = COntologyProcessingStepVector::getProcessingStepVectorInstance(); prepKBC->addRequirement( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSACTIVECOUNT), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) ); preSynchronizer->delegateCommand(prepKBC); CExtractKnowledgeBaseEntitiesCommand *eKBEC = new CExtractKnowledgeBaseEntitiesCommand(gKBEC->getExtractedEntityContainer(),gKBEC->getEntityExtractionSpecification(),getCKBRC); eKBEC->addCommandPrecondition(new CCommandProcessedPrecondition(prepKBC)); gKBEC->makeToSubCommand(eKBEC); preSynchronizer->delegateCommand(getCKBRC); preSynchronizer->delegateCommand(eKBEC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CGetKnowledgeBaseLanguageCommand* gKBLC = (CGetKnowledgeBaseLanguageCommand*)command; CGetCurrentKnowledgeBaseRevisionCommand *getCKBRC = new CGetCurrentKnowledgeBaseRevisionCommand(gKBLC->getKnowledgeBaseName()); gKBLC->makeToSubCommand(getCKBRC); CPrepareKnowledgeBaseCommand* prepKBC = new CPrepareKnowledgeBaseCommand(getCKBRC); prepKBC->addCommandPrecondition(new CCommandProcessedPrecondition(getCKBRC)); gKBLC->makeToSubCommand(prepKBC); COntologyProcessingStepVector* ontProStepVec = COntologyProcessingStepVector::getProcessingStepVectorInstance(); prepKBC->addRequirement( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSPREPROCESS), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) ); preSynchronizer->delegateCommand(prepKBC); CExtractKnowledgeBaseLanguageCommand *eKBEC = new CExtractKnowledgeBaseLanguageCommand(gKBLC->getLanguageStringPointer(),getCKBRC); eKBEC->addCommandPrecondition(new CCommandProcessedPrecondition(prepKBC)); gKBLC->makeToSubCommand(eKBEC); preSynchronizer->delegateCommand(getCKBRC); preSynchronizer->delegateCommand(eKBEC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CGetSubClassHierarchyQueryOWL2XMLNodeCommand *gSCHOWLC = (CGetSubClassHierarchyQueryOWL2XMLNodeCommand *)command; CBuildQueryCommand *buildQC = gSCHOWLC->getBuildQueryCommand(); CGetCurrentKnowledgeBaseRevisionCommand *getCKBRC = new CGetCurrentKnowledgeBaseRevisionCommand(gSCHOWLC->getKnowledgeBaseName()); buildQC->makeToSubCommand(getCKBRC); CConstructSubClassHirarchyQueryCommand *pOWLQC = new CConstructSubClassHirarchyQueryCommand(getCKBRC,gSCHOWLC->getQueryNode()); buildQC->makeToSubCommand(pOWLQC); buildQC->setQueryCommandProvider(pOWLQC); CCalculateQueryCommand *calcQC = gSCHOWLC->getCalculateQueryCommand(); preSynchronizer->delegateCommand(buildQC); preSynchronizer->delegateCommand(calcQC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CIsConsistentQueryCommand* iCQC = (CIsConsistentQueryCommand*)command; CBuildQueryCommand *buildQC = iCQC->getBuildQueryCommand(); if (!buildQC) { buildQC = new CBuildQueryCommand(0,iCQC); iCQC->setBuildQueryCommand(buildQC); } CCalculateQueryCommand *calcQC = iCQC->getCalculateQueryCommand(); if (!calcQC) { calcQC = new CCalculateQueryCommand(buildQC,iCQC); iCQC->setCalculateQueryCommand(calcQC); } CGetCurrentKnowledgeBaseRevisionCommand *getCKBRC = new CGetCurrentKnowledgeBaseRevisionCommand(iCQC->getKnowledgeBaseName()); buildQC->makeToSubCommand(getCKBRC); CConstructIsConsistentQueryCommand *pOWLQC = new CConstructIsConsistentQueryCommand(getCKBRC); buildQC->makeToSubCommand(pOWLQC); buildQC->setQueryCommandProvider(pOWLQC); preSynchronizer->delegateCommand(buildQC); preSynchronizer->delegateCommand(calcQC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CIsTriviallyConsistentQueryCommand* iCQC = (CIsTriviallyConsistentQueryCommand*)command; CBuildQueryCommand *buildQC = iCQC->getBuildQueryCommand(); if (!buildQC) { buildQC = new CBuildQueryCommand(0,iCQC); iCQC->setBuildQueryCommand(buildQC); } CCalculateQueryCommand *calcQC = iCQC->getCalculateQueryCommand(); if (!calcQC) { calcQC = new CCalculateQueryCommand(buildQC,iCQC); iCQC->setCalculateQueryCommand(calcQC); } CGetCurrentKnowledgeBaseRevisionCommand *getCKBRC = new CGetCurrentKnowledgeBaseRevisionCommand(iCQC->getKnowledgeBaseName()); buildQC->makeToSubCommand(getCKBRC); CConstructIsTriviallyConsistentQueryCommand *pOWLQC = new CConstructIsTriviallyConsistentQueryCommand(getCKBRC); buildQC->makeToSubCommand(pOWLQC); buildQC->setQueryCommandProvider(pOWLQC); preSynchronizer->delegateCommand(buildQC); preSynchronizer->delegateCommand(calcQC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CKnowledgeBaseProcessCommand* kbPC = (CKnowledgeBaseProcessCommand *)command; CGetCurrentKnowledgeBaseRevisionCommand *getCKBRC = new CGetCurrentKnowledgeBaseRevisionCommand(kbPC->getKnowledgeBaseName()); kbPC->makeToSubCommand(getCKBRC); CPrepareKnowledgeBaseCommand* prepKBC = new CPrepareKnowledgeBaseCommand(getCKBRC); prepKBC->addCommandPrecondition(new CCommandProcessedPrecondition(getCKBRC)); kbPC->makeToSubCommand(prepKBC); COntologyProcessingStepVector* ontProStepVec = COntologyProcessingStepVector::getProcessingStepVectorInstance(); prepKBC->addRequirement( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSPREPROCESS), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) ); if (dynamic_cast(kbPC) != nullptr) { prepKBC->addRequirement( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSCLASSCLASSIFY), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) ); } if (dynamic_cast(kbPC) != nullptr) { prepKBC->addRequirement( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSCONCEPTREALIZE), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) ); prepKBC->addRequirement( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSSAMEINDIVIDUALSREALIZE), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) ); } preSynchronizer->delegateCommand(getCKBRC); preSynchronizer->delegateCommand(prepKBC); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CConstructSubClassHirarchyQueryCommand *cSCHQC = (CConstructSubClassHirarchyQueryCommand *)command; COntologyRevision *ontRev = cSCHQC->getOntologyRevision(); if (ontRev) { COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); COWLlinkQueryExtensionParser quExtParser; CSubClassHierarchyQuery *query = new CSubClassHierarchyQuery(ontRev->getOntology(),nullptr,ontConfig); if (CConfigDataReader::readConfigBoolean(ontConfig,"Konclude.Query.Statistics.CollectStatistics",false)) { query->setQueryStatistics(new CQueryStatisticsCollectionStrings()); } cSCHQC->setQuery(query); } else { CUnspecifiedMessageErrorRecord::makeRecord("Knowledge base revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CExtractKnowledgeBaseEntitiesCommand* eKBEC = (CExtractKnowledgeBaseEntitiesCommand*)command; COntologyRevision *ontRev = eKBEC->getOntologyRevision(); if (ontRev) { COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CConcreteOntology* onto = ontRev->getOntology(); CKnowledgeBaseEntitiesExtractionSpecification* extractSpec = eKBEC->getEntitiesExtractionSpecification(); CExtractedKnowledgeBaseEntitiesContainer* extractionContainer = eKBEC->getExtractionContainer(); CActiveEntityCountVector* activeEntityVector = onto->getDataBoxes()->getExpressionDataBoxMapping()->getActiveEntityVector(); if (activeEntityVector) { CActiveEntityIterator activeEntityIterator(activeEntityVector->getActiveEntityIterator()); while (activeEntityIterator.hasNextActiveEntity()) { CExpressionEntity* entity = activeEntityIterator.getNextActiveEntity(); if (extractSpec->hasPartialEntityExtractionFlags(CKnowledgeBaseEntitiesExtractionSpecification::EXTRACTCLASSENTITIES)) { CClassExpression* classEntity = dynamic_cast(entity); if (classEntity) { extractionContainer->addExtractedEntity(classEntity->getName()); } } if (extractSpec->hasPartialEntityExtractionFlags(CKnowledgeBaseEntitiesExtractionSpecification::EXTRACTOBJECTPROPERTYENTITIES)) { CObjectPropertyExpression* propertyEntity = dynamic_cast(entity); if (propertyEntity) { extractionContainer->addExtractedEntity(propertyEntity->getName()); } } if (extractSpec->hasPartialEntityExtractionFlags(CKnowledgeBaseEntitiesExtractionSpecification::EXTRACTINDIVIDUALSENTITIES)) { CNamedIndividualExpression* individualEntity = dynamic_cast(entity); if (individualEntity) { extractionContainer->addExtractedEntity(individualEntity->getName()); } } } } } else { CUnspecifiedMessageErrorRecord::makeRecord("Knowledge base revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CExtractKnowledgeBaseLanguageCommand* eKBLC = (CExtractKnowledgeBaseLanguageCommand*)command; COntologyRevision *ontRev = eKBLC->getOntologyRevision(); if (ontRev) { COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CConcreteOntology* onto = ontRev->getOntology(); if (onto) { eKBLC->setKBLanguageString(onto->getStructureSummary()->getExpressivenessString()); } } else { CUnspecifiedMessageErrorRecord::makeRecord("Knowledge base revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CConstructIsConsistentQueryCommand *cICQC = (CConstructIsConsistentQueryCommand *)command; COntologyRevision *ontRev = cICQC->getOntologyRevision(); if (ontRev) { COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CIsConsistentQuery *query = new CIsConsistentQuery(ontRev->getOntology(),ontConfig); if (CConfigDataReader::readConfigBoolean(ontConfig,"Konclude.Query.Statistics.CollectStatistics",false)) { query->setQueryStatistics(new CQueryStatisticsCollectionStrings()); } cICQC->setQuery(query); } else { CUnspecifiedMessageErrorRecord::makeRecord("Knowledge base revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CConstructIsTriviallyConsistentQueryCommand *cITCQC = (CConstructIsTriviallyConsistentQueryCommand *)command; COntologyRevision *ontRev = cITCQC->getOntologyRevision(); if (ontRev) { COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CIsTriviallyConsistentQuery *query = new CIsTriviallyConsistentQuery(ontRev->getOntology(),ontConfig); if (CConfigDataReader::readConfigBoolean(ontConfig,"Konclude.Query.Statistics.CollectStatistics",false)) { query->setQueryStatistics(new CQueryStatisticsCollectionStrings()); } cITCQC->setQuery(query); } else { CUnspecifiedMessageErrorRecord::makeRecord("Knowledge base revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CConstructClassSatisfiableQueryCommand *cCSQC = (CConstructClassSatisfiableQueryCommand *)command; COntologyRevision *ontRev = cCSQC->getOntologyRevision(); if (ontRev) { COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CIsClassSatisfiableQuery *query = new CIsClassSatisfiableQuery(cCSQC->getClassName()); CCalculationConfigurationExtension *calcConfig = new CCalculationConfigurationExtension(ontConfig,0); CConcept* concept = ontRev->getOntology()->getStringMapping()->getClassNameConceptMappingHash()->value(cCSQC->getClassName(),nullptr); if (concept) { CSatisfiableCalculationJobGenerator* satCalcJobGenerator = new CSatisfiableCalculationJobGenerator(ontRev->getOntology()); CSatisfiableCalculationJob* satCalcJob = satCalcJobGenerator->getSatisfiableCalculationJob(concept,false); //CQueryStatisticsCollectionStrings* queryStats = nullptr; //if (true) { // queryStats = new CQueryStatisticsCollectionStrings(); // satCalcJob->setCalclulationStatisticsCollector(queryStats->createCalculationStatisticsCollection()); //} //query->setQueryStatistics(queryStats); satCalcJob->setCalculationConfiguration(calcConfig); query->setCalculationConfiguration(calcConfig); query->addTestSatisfiableCalculationJob(satCalcJob,true); cCSQC->setQuery(query); } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Concept '%1' cannot be resolved in ontology '%2'.").arg(cCSQC->getClassName()).arg(ontRev->getOntology()->getOntologyName()),&commandRecordRouter); } } else { CUnspecifiedMessageErrorRecord::makeRecord("Knowledge base revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CConstructWriteFunctionalSubClassHirarchyQueryCommand *cWFSCHQC = (CConstructWriteFunctionalSubClassHirarchyQueryCommand *)command; COntologyRevision *ontRev = cWFSCHQC->getOntologyRevision(); if (ontRev) { COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CWriteFunctionalClassSubsumptionsHierarchyQuery *query = new CWriteFunctionalClassSubsumptionsHierarchyQuery(ontRev->getOntology(),ontConfig,cWFSCHQC->getOutputFileName()); cWFSCHQC->setQuery(query); } else { CUnspecifiedMessageErrorRecord::makeRecord("Knowledge base revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CConstructWriteXMLSubClassHirarchyQueryCommand *cWXSCHQC = (CConstructWriteXMLSubClassHirarchyQueryCommand *)command; COntologyRevision *ontRev = cWXSCHQC->getOntologyRevision(); if (ontRev) { COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CWriteOWLXMLClassSubsumptionsHierarchyQuery *query = new CWriteOWLXMLClassSubsumptionsHierarchyQuery(ontRev->getOntology(),ontConfig,cWXSCHQC->getOutputFileName()); cWXSCHQC->setQuery(query); } else { CUnspecifiedMessageErrorRecord::makeRecord("Knowledge base revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CConstructWriteXMLIndividualTypesQueryCommand *cWXITQC = (CConstructWriteXMLIndividualTypesQueryCommand *)command; COntologyRevision *ontRev = cWXITQC->getOntologyRevision(); if (ontRev) { COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CWriteOWLXMLIndividualFlattenedTypesQuery *query = new CWriteOWLXMLIndividualFlattenedTypesQuery(ontRev->getOntology(),ontConfig,cWXITQC->getOutputFileName(),cWXITQC->getIndividualName()); cWXITQC->setQuery(query); } else { CUnspecifiedMessageErrorRecord::makeRecord("Knowledge base revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CConstructWriteFunctionalIndividualTypesQueryCommand *cWFITQC = (CConstructWriteFunctionalIndividualTypesQueryCommand *)command; COntologyRevision *ontRev = cWFITQC->getOntologyRevision(); if (ontRev) { COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CWriteFunctionalIndividualFlattenedTypesQuery *query = new CWriteFunctionalIndividualFlattenedTypesQuery(ontRev->getOntology(),ontConfig,cWFITQC->getOutputFileName(),cWFITQC->getIndividualName()); cWFITQC->setQuery(query); } else { CUnspecifiedMessageErrorRecord::makeRecord("Knowledge base revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CConstructClassifyQueryCommand *cCQC = (CConstructClassifyQueryCommand*)command; COntologyRevision *ontRev = cCQC->getOntologyRevision(); if (ontRev) { COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CClassifyQuery *query = new CClassifyQuery(ontRev->getOntology(),ontConfig); if (CConfigDataReader::readConfigBoolean(ontConfig,"Konclude.Query.Statistics.CollectStatistics",false)) { query->setQueryStatistics(new CQueryStatisticsCollectionStrings()); } cCQC->setQuery(query); } else { CUnspecifiedMessageErrorRecord::makeRecord("Knowledge base revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CConstructRealizeQueryCommand *cRQC = (CConstructRealizeQueryCommand*)command; COntologyRevision *ontRev = cRQC->getOntologyRevision(); if (ontRev) { COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CRealizeQuery *query = new CRealizeQuery(ontRev->getOntology(),ontConfig); if (CConfigDataReader::readConfigBoolean(ontConfig,"Konclude.Query.Statistics.CollectStatistics",false)) { query->setQueryStatistics(new CQueryStatisticsCollectionStrings()); } cRQC->setQuery(query); } else { CUnspecifiedMessageErrorRecord::makeRecord("Knowledge base revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CGenerateQueryCommand* gQC = (CGenerateQueryCommand *)command; CQueryBuilderGenerator* queryGenerator = gQC->getQueryGenerator(); QList queryList; if (queryGenerator) { queryList = queryGenerator->generateQuerys(); } else { CUnspecifiedMessageErrorRecord::makeRecord("No query generated.",&commandRecordRouter); } CQuery *query = 0; if (queryList.count() > 0) { query = queryList.first(); } else { CUnspecifiedMessageErrorRecord::makeRecord("Query couldn't be parsed.",&commandRecordRouter); } gQC->setQuery(query); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CParseOWL2XMLQueryCommand *pOWLQC = (CParseOWL2XMLQueryCommand *)command; QDomElement queryNode = pOWLQC->getQueryNode(); COntologyRevision *ontRev = pOWLQC->getOntologyRevision(); if (ontRev) { bool complex = pOWLQC->isComplexQuery(); CConcreteOntology* onto = ontRev->getOntology(); COntologyConfigurationExtension *ontConfig = ontRev->getOntologyConfiguration(); CQueryBuilderGenerator* queryBuilderGen = nullptr; QList queryList; if (complex) { COWLlinkQueryParser *queryParser = nullptr; CConcreteOntologyUpdateCollectorBuilder *ontoBuilder = new CConcreteOntologyUpdateCollectorBuilder(onto); queryBuilderGen = new CConcreteOntologyQueryExtendedBuilder(onto,ontConfig,ontoBuilder); COWL2QtXMLOntologyParser *owl2Parser = new COWL2QtXMLOntologyParser(ontoBuilder,&commandRecordRouter); queryParser = new COWLlinkQtXMLComplexQueryParser(queryBuilderGen,owl2Parser); ontoBuilder->initializeBuilding(); queryParser->parseQueryNode(&queryNode); ontoBuilder->completeBuilding(); //COntologyConfigDependedPreProcesser *ontConDepPreProcessor = new COntologyConfigDependedPreProcesser(commandRecordRouter); //ontConDepPreProcessor->preprocess(onto,ontConfig); //delete ontConDepPreProcessor; delete ontoBuilder; delete queryParser; } else { COWLlinkQueryParser *queryParser = nullptr; queryBuilderGen = new CConcreteOntologyQuerySimpleBuilder(onto,ontConfig); queryParser = new COWLlinkQtXMLSimpleQueryParser(queryBuilderGen,onto); queryParser->parseQueryNode(&queryNode); delete queryParser; } pOWLQC->setQueryGenerator(queryBuilderGen); } else { CUnspecifiedMessageErrorRecord::makeRecord("Knowledge base revision not available.",&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else { if (reasonerCommander) { reasonerCommander->realizeCommand(command); } else { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CUnspecifiedMessageErrorRecord::makeRecord("Reasoner Commander missing.",&commandRecordRouter); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); LOG(ERROR,getLogDomain(),logTr("Reasoner Commander missing."),this); } } } } return true; } else if (type == EVENTINITIALIZE) { initializeOWLlinkContent(); return true; } else if (type == EVENTCOMMANDPROCESSEDCALLBACK) { CCommandProcessedCallbackEvent *commProCallbackEvent = (CCommandProcessedCallbackEvent *)event; concludeOWLlinkContent(); return true; } } else { return true; } return false; } }; // end namespace OWLlink }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/OWLlink/COWLlinkHttpConnectionHandlerProcessorFactory.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/OWLlink/COWLlinkHttpConnectionHandlerProcess0000644000175000017500000000531012520756356032215 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLlinkHttpConnectionHandlerProcessorFactory.h" namespace Konclude { namespace Control { namespace Interface { namespace OWLlink { COWLlinkHttpConnectionHandlerProcessorFactory::COWLlinkHttpConnectionHandlerProcessorFactory(CConfiguration* loaderConfig) { mLoaderConfig = loaderConfig; mHandlerReleased = false; } COWLlinkHttpConnectionHandlerProcessorFactory::~COWLlinkHttpConnectionHandlerProcessorFactory() { qDeleteAll(mContainerList); } CQtHttpConnectionHandler* COWLlinkHttpConnectionHandlerProcessorFactory::getConnectionHandler() { COWLlinkHttpConnectionHandlerProcessor* connHandler = nullptr; if (mHandlerReleased && mFreeHandlerList.isEmpty()) { for (QList::const_iterator it = mContainerList.constBegin(); it != mContainerList.constEnd(); ++it) { COWLlinkHttpConnectionHandlerProcessor* handler(*it); if (!handler->isHandlerBusy()) { if (!handler->isHandlerQueued()) { handler->setHandlerQueued(true); mFreeHandlerList.append(handler); } } } mHandlerReleased = false; } if (!connHandler && !mFreeHandlerList.isEmpty()) { connHandler = mFreeHandlerList.takeFirst(); connHandler->setHandlerQueued(false); } if (!connHandler) { connHandler = new COWLlinkHttpConnectionHandlerProcessor(mLoaderConfig,this); connHandler->waitSynchronization(); connHandler->setHandlerQueued(false); mContainerList.append(connHandler); } return connHandler; } CQtHttpConnectionHandlerReleaser* COWLlinkHttpConnectionHandlerProcessorFactory::releaseConnectionHandler(CQtHttpConnectionHandler* connectionHandler) { mHandlerReleased = true; return this; } }; // end namespace OWLlink }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Interface/OWLlink/COWLLinkRecordInterpreter.h0000644000175000017500000001472412520756356030262 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_Interface_OWLLINK_COWLLINKRECORDINTERPRETER_H #define KONCLUDE_Control_Interface_OWLLINK_COWLLINKRECORDINTERPRETER_H // Libraries includes #include #include #include // Namespace includes #include "Control/Command/CCommandRecorder.h" #include "Control/Command/CCommandDelegater.h" #include "Control/Command/Records/CClosureProcessCommandRecord.h" #include "Control/Command/Instructions/CGetDescriptionCommand.h" #include "Control/Command/Instructions/CTellKnowledgeBaseOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CCreateKnowledgeBaseCommand.h" #include "Control/Command/Instructions/CIsSatisfiableQueryOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CSkipUnsupportedCommandCommand.h" #include "Control/Command/Instructions/CReleaseKnowledgeBaseCommand.h" #include "Control/Command/Instructions/CTestExtendedCalculateQueryCommand.h" #include "Control/Command/Instructions/CParseTestsuiteXMLNodeCommand.h" #include "Control/Command/Instructions/CTestTestsuiteCommand.h" #include "Control/Command/Instructions/CInsertResponseCommentCommand.h" #include "Control/Command/Instructions/CSetConfigCommand.h" #include "Control/Command/Instructions/CGetConfigCommand.h" #include "Control/Command/Instructions/CGetSettingsCommand.h" #include "Control/Command/Instructions/CLoadKnowledgeBaseKRSSTestConceptCommand.h" #include "Control/Command/Instructions/CKnowledgeBaseProcessCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseClassEntitiesCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseObjectPropertyEntitiesCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseNamedIndividualEntitiesCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseLanguageCommand.h" #include "Reasoner/Query/CClassHierarchyResult.h" #include "Reasoner/Query/CClassesResult.h" #include "Reasoner/Query/CIndividualsResult.h" #include "Reasoner/Query/CClassSynsetsResult.h" #include "Reasoner/Query/CIndividualSynsetsResult.h" #include "Reasoner/Query/CQueryInconsitentOntologyError.h" #include "Reasoner/Query/CSucceedQueryResult.h" #include "Reasoner/Query/CClassSetResult.h" #include "Reasoner/Query/CIndividualClassAssertionsResult.h" #include "Reasoner/Query/CIndividualSynonymsResult.h" #include "Reasoner/Kernel/Process/CProcessingStatistics.h" #include "Config/CConfiguration.h" #include "Config/CConfigDataReader.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Config; using namespace Reasoner::Query; using namespace Reasoner::Kernel::Process; namespace Control { using namespace Command; using namespace Instructions; using namespace Records; namespace Interface { namespace OWLlink { /*! * * \class COWLLinkRecordInterpreter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLLinkRecordInterpreter : public CCommandDelegater, public CCommandRecorder { // public methods public: //! Constructor COWLLinkRecordInterpreter(CCommandDelegater *commandDelegater, CConfiguration* config); //! Destructor virtual ~COWLLinkRecordInterpreter(); virtual CCommandDelegater *delegateCommand(CCommand *command); virtual CCommandRecorder *recordData(CCommandRecordData *recData); virtual QByteArray getByteArray(); virtual QDomElement getErrorNode(CCommandRecordData *recData, const QString &nodeString = "Error"); virtual QDomElement getErrorNode(const QString &errorText, const QString &nodeString = "Error"); virtual QString getErrorString(CCommandRecordData *recData, const QString &nodeString); QString getErrorLevelString(double level); virtual QDomElement getOneOfStringConfigNode(const QString &keyString, const QString &oneOfOptions, const QString &defaultOption, const QString &nodeString = "Property"); virtual QDomElement getBooleanConfigNode(const QString &keyString, const QString &defaultValue, const QString &nodeString = "Property"); virtual QDomElement getStringConfigNode(const QString &keyString, const QString &defaultValue, const QString &nodeString = "Property"); virtual QDomElement getIntegerConfigNode(const QString &keyString, qint64 defaultValue, const QString &nodeString = "Property"); virtual QString getOWLLinkMappedConfigString(const QString &keyName); virtual bool hasReasonerCalculatedWrongResult(); virtual QDomElement getEntitiesSetNode(const QString &nodeString, const QString &entityString, CExtractedKnowledgeBaseEntitiesContainer* entityContainer); // protected methods protected: // protected variables protected: QHash commandSequenceHash; CCommandDelegater *delegater; qint64 nextSeqNumber; qint64 recNextSeqNumber; QHash seqNodeHash; QMutex seqSyncMutex; QDomDocument document; QDomElement rootNode; QString owllinkNS; QString owlNS; bool mConfFileAppendSimpleStats; QString mStatFileString; QString mStatKBString; QString mStatLoadString; QString mStatQueryString; QStringList mStatStringList; QVector mStatVector; bool mCalculatedWrongResult; bool mRespondQueryStatistics; CConfiguration* mConfig; bool mConfExtendedErrorReporting; // private methods private: // private variables private: }; }; // end namespace OWLlink }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_Interface_OWLLINK_COWLLINKRECORDINTERPRETER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Interface/OWLlink/COWLlinkProcessor.h0000644000175000017500000002602412520756356026633 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_INTERFACE_OWLLINK_COWLLINKPROCESSOR_H #define KONCLUDE_CONTROL_INTERFACE_OWLLINK_COWLLINKPROCESSOR_H // Libraries includes #include #include #include #include #include // Namespace includes // Other includes #include "Reasoner/Preprocess/CLexicalNormalisationPreProcess.h" #include "Reasoner/Preprocess/CNegationTransformationPreProcess.h" #include "Reasoner/Preprocess/CSubroleTransformationPreProcess.h" #include "Reasoner/Preprocess/COntologyAssignmentTransformationPreProcess.h" #include "Reasoner/Preprocess/COntologyConfigDependedPreProcesser.h" #include "Concurrent/CThread.h" #include "Utilities/CSingletonProvider.hpp" #include "Control/Command/CCommanderManager.h" #include "Control/Command/CCommanderManagerConfigType.h" #include "Control/Command/CCommandDelegater.h" #include "Control/Command/CPreconditionSynchronizer.h" #include "Control/Command/CConfigManagerReader.h" #include "Control/Command/Records/CUnspecifiedMessageErrorRecord.h" #include "Control/Command/Events/CRealizeCommandEvent.h" #include "Control/Command/Events/CCommandProcessedCallbackEvent.h" #include "Control/Command/Events/CInitializeEvent.h" #include "Control/Command/Instructions/CInitializeConfigurationCommand.h" #include "Control/Command/Instructions/CInitializeReasonerCommand.h" #include "Control/Command/Instructions/CCreateKnowledgeBaseRevisionUpdateCommand.h" #include "Control/Command/Instructions/CParseOWL2XMLOntologyCommand.h" #include "Control/Command/Instructions/CSAXParseOWL2XMLOntologyCommand.h" #include "Control/Command/Instructions/CStreamParseOWL2XMLOntologyCommand.h" #include "Control/Command/Instructions/CInstallKnowledgeBaseRevisionUpdateCommand.h" #include "Control/Command/Instructions/CIsSatisfiableQueryOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CParseOWL2XMLQueryCommand.h" #include "Control/Command/Instructions/CCalculateQueryCommand.h" #include "Control/Command/Instructions/CGetCurrentKnowledgeBaseRevisionCommand.h" #include "Control/Command/Instructions/CParseTestsuiteCommandsCommand.h" #include "Control/Command/Instructions/CParseTestsuiteXMLNodeCommand.h" #include "Control/Command/Instructions/CTestTestsuiteCommand.h" #include "Control/Command/Instructions/CInsertResponseCommentCommand.h" #include "Control/Command/Instructions/CConstructSubClassHirarchyQueryCommand.h" #include "Control/Command/Instructions/CGetSubClassHierarchyQueryOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CReadTextCommand.h" #include "Control/Command/Instructions/CReadXMLCommand.h" #include "Control/Command/Instructions/CParseKRSSTestConceptOntologyCommand.h" #include "Control/Command/Instructions/CWriteOWL2XMLOntologyCommand.h" #include "Control/Command/Instructions/CExtractToldExpressionsOntologyCommand.h" #include "Control/Command/Instructions/CWriteOWLlinkOWL2XMLSatisfiableTestCommand.h" #include "Control/Command/Instructions/CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand.h" #include "Control/Command/Instructions/CLoadKnowledgeBaseOWLXMLOntologyCommand.h" #include "Control/Command/Instructions/CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand.h" #include "Control/Command/Instructions/CPrepareKnowledgeBaseForQueryCommand.h" #include "Control/Command/Instructions/CGenerateQueryCommand.h" #include "Control/Command/Instructions/CPrepareKnowledgeBaseForRevisionCommand.h" #include "Control/Command/Instructions/CConstructFlattenedTypesQueryCommand.h" #include "Control/Command/Instructions/CGetFlattenedTypesOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CProcessQueryOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CEvaluateTestsuiteCommand.h" #include "Control/Command/Instructions/CConstructWriteFunctionalSubClassHirarchyQueryCommand.h" #include "Control/Command/Instructions/CWriteFunctionalSubClassHierarchyQueryCommand.h" #include "Control/Command/Instructions/CConstructIsConsistentQueryCommand.h" #include "Control/Command/Instructions/CIsConsistentQueryOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CConstructClassSatisfiableQueryCommand.h" #include "Control/Command/Instructions/CProcessClassNameSatisfiableQueryCommand.h" #include "Control/Command/Instructions/CConstructClassifyQueryCommand.h" #include "Control/Command/Instructions/CClassifyQueryCommand.h" #include "Control/Command/Instructions/CConstructRealizeQueryCommand.h" #include "Control/Command/Instructions/CRealizeQueryCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseEntitiesCommand.h" #include "Control/Command/Instructions/CExtractKnowledgeBaseEntitiesCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseLanguageCommand.h" #include "Control/Command/Instructions/CExtractKnowledgeBaseLanguageCommand.h" #include "Control/Command/Instructions/CWriteXMLSubClassHierarchyQueryCommand.h" #include "Control/Command/Instructions/CConstructWriteXMLSubClassHirarchyQueryCommand.h" #include "Control/Command/Instructions/CWriteXMLIndividualTypesQueryCommand.h" #include "Control/Command/Instructions/CConstructWriteXMLIndividualTypesQueryCommand.h" #include "Control/Command/Instructions/CStreamParseOWL2FunctionalOntologyCommand.h" #include "Control/Command/Instructions/CLoadKnowledgeBaseOWLFunctionalOntologyCommand.h" #include "Control/Command/Instructions/CLoadKnowledgeBaseOWLAutoOntologyCommand.h" #include "Control/Command/Instructions/CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand.h" #include "Control/Command/Instructions/CLoadKnowledgeBaseStartDownloadCommand.h" #include "Control/Command/Instructions/CLoadKnowledgeBaseFinishDownloadCommand.h" #include "Control/Command/Instructions/CLoadKnowledgeBaseAllDownloadedContinuer.h" #include "Control/Command/Instructions/CImportKnowledgeBaseOWLAutoOntologyCommand.h" #include "Control/Command/Instructions/CWriteFunctionalIndividualTypesQueryCommand.h" #include "Control/Command/Instructions/CConstructWriteFunctionalIndividualTypesQueryCommand.h" #include "Control/Command/Instructions/CIsTriviallyConsistentQueryCommand.h" #include "Control/Command/Instructions/CConstructIsTriviallyConsistentQueryCommand.h" #include "Reasoner/Query/CWriteFunctionalIndividualFlattenedTypesQuery.h" #include "Reasoner/Query/CWriteFunctionalClassSubsumptionsHierarchyQuery.h" #include "Reasoner/Query/CWriteOWLXMLIndividualFlattenedTypesQuery.h" #include "Reasoner/Query/CWriteOWLXMLClassSubsumptionsHierarchyQuery.h" #include "Reasoner/Query/CIsConsistentQuery.h" #include "Reasoner/Query/CIsTriviallyConsistentQuery.h" #include "Reasoner/Query/CRealizeQuery.h" #include "Reasoner/Query/CClassifyQuery.h" #include "Parser/COWLlinkQtXMLCommandParser.h" #include "Parser/COWL2QtXMLOntologyParser.h" #include "Parser/COWLlinkQueryParser.h" #include "Parser/CXMLTestsuiteCommandParser.h" #include "Parser/COWLlinkQueryExtensionParser.h" #include "Parser/COWLlinkQtXMLComplexQueryParser.h" #include "Parser/COWLlinkQtXMLSimpleQueryParser.h" #include "Parser/CKRSSOntologyParser.h" #include "Parser/COWL2QtXMLOntologySAXParser.h" #include "Parser/COWL2QtXMLOntologyStreamParser.h" #include "Parser/COWL2QtXMLOntologyStableStreamParser.h" #include "Parser/FunctionalJAVACC/COWL2FunctionalJAVACCOntologyStreamParser.h" #include "Renderer/CRenderWriteManager.h" #include "Renderer/COntologyExtractionManager.h" #include "Network/HTTP/CQtHttpTransactionManager.h" #include "Reasoner/Generator/CConcreteOntologyUpdateBuilder.h" #include "Reasoner/Generator/CConcreteOntologyUpdateCollectorBuilder.h" #include "Reasoner/Generator/CConcreteOntologyQueryExtendedBuilder.h" #include "Reasoner/Generator/CConcreteOntologyQuerySimpleBuilder.h" #include "Test/CReasonerTestsuiteTester.h" #include "Test/Evaluation/CReasonerEvaluationManagerThread.h" #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Logger; using namespace Concurrent; using namespace Utilities; using namespace Parser; using namespace FunctionalJAVACC; using namespace Reasoner; using namespace Generator; using namespace Preprocess; using namespace Config; using namespace Renderer; using namespace Query; using namespace Network; using namespace HTTP; //using namespace Test::Evaluation; namespace Control { using namespace Command; using namespace Instructions; using namespace Events; using namespace Records; namespace Interface { namespace OWLlink { /*! * * \class COWLlinkProcessor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLlinkProcessor : public CThread, public CCommandDelegater, public CLogIdentifier { // public methods public: //! Constructor COWLlinkProcessor(bool immediatelyStartThread = true); //! Destructor virtual ~COWLlinkProcessor(); virtual COWLlinkProcessor *startProcessing(); virtual CCommandDelegater *delegateCommand(CCommand *command); // protected methods protected: bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); virtual COWLlinkProcessor *initializeOWLlinkContent() = 0; virtual COWLlinkProcessor *concludeOWLlinkContent() = 0; virtual CConfiguration *getConfiguration() = 0; QStringList getParserOrderFromFileName(const QString& fileName); CQtHttpTransactionManager* getNetworkTransactionManager(); bool createDownloadParseCommands(const QString& knowledgeBaseNameString, CCommand* parentCommand, CKnowledgeBaseRevisionCommandProvider* kbProviderCommand, const QMap& ontoIRIMapping, const QStringList& ontoIRIStringList, CCommandRecordRouter& commandRecordRouter); // protected variables protected: bool mConfLoadOntologiesSAXParsing; bool mConfLoadOntologiesStreamParsing; CPreconditionSynchronizer *preSynchronizer; QByteArray fileContent; CCommanderManager *reasonerCommander; CCommandDelegater *defaultCommandDelegater; bool mConfLogProcessingTimes; CQtHttpTransactionManager* mNetworkManager; // private methods private: // private variables private: }; }; // end namespace OWLlink }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_INTERFACE_OWLLINK_COWLLINKPROCESSOR_H Konclude-v0.6.2-544-SourceCode/Source/Control/Interface/OWLlink/OWLlinkSettings.h0000644000175000017500000000301212520756356026341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_INTERFACE_OWLLINK_COMMANDSETTINGS #define KONCLUDE_CONTROL_INTERFACE_OWLLINK_COMMANDSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Control { namespace Interface { namespace OWLlink { /*! * * \file CommandSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations // Custom Events >= 2000 }; // end namespace OWLlink }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude #endif // end KONCLUDE_CONTROL_INTERFACE_OWLLINK_COMMANDSETTINGS ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/OWLlink/COWLlinkHttpConnectionHandlerProcessor.hKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/OWLlink/COWLlinkHttpConnectionHandlerProcess0000644000175000017500000000751012565304606032215 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_INTERFACE_OWLLINK_COWLLINKHTTPCONNECTIONHANDLERPROCESSOR_H #define KONCLUDE_CONTROL_INTERFACE_OWLLINK_COWLLINKHTTPCONNECTIONHANDLERPROCESSOR_H // Libraries includes #include #include // Namespace includes #include "OWLlinkSettings.h" #include "COWLlinkProcessor.h" #include "COWLLinkRecordInterpreter.h" // Other includes #include "Network/HTTP/CQtHttpPooledConnectionHandler.h" #include "Network/HTTP/CQtHttpRequestBodyOnlyParser.h" #include "Network/HTTP/CQtHttpConnectionHandlerReleaser.h" #include "Network/HTTP/Events/CHandleIncomingHttpConnectionEvent.h" #include "Network/HTTP/Events/CConnectionReadyReadEvent.h" #include "Network/HTTP/Events/CConnectionDisconnectedEvent.h" #include "Control/Command/CConfigManagerReader.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" namespace Konclude { using namespace Network::HTTP; using namespace Network::HTTP::Events; namespace Control { using namespace Command; namespace Interface { namespace OWLlink { /*! * * \class COWLlinkHttpConnectionHandlerProcessor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLlinkHttpConnectionHandlerProcessor : public COWLlinkProcessor, public CQtHttpPooledConnectionHandler { Q_OBJECT // public methods public: //! Constructor COWLlinkHttpConnectionHandlerProcessor(CConfiguration* loaderConfig, CQtHttpConnectionHandlerReleaser* releaser); //! Destructor virtual ~COWLlinkHttpConnectionHandlerProcessor(); virtual bool handleIncomingConnection(int socketDescriptor); bool isHandlerQueued(); COWLlinkHttpConnectionHandlerProcessor* setHandlerQueued(bool queued); // protected methods protected: virtual void threadStarted(); virtual void threadStopped(); bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); virtual COWLlinkProcessor* initializeOWLlinkContent(); virtual COWLlinkProcessor* concludeOWLlinkContent(); virtual COWLlinkProcessor* sendData(const QByteArray& dataString); virtual CConfiguration *getConfiguration(); // protected variables protected: // private methods private: QTcpSocket* mSocket; CQtHttpRequestBodyOnlyParser* mParser; bool mProcessingRequest; bool mProcessMoreRead; QByteArray* mProcessingByteArray; COWLLinkRecordInterpreter* mOwllinkInterpreter; CCommand* mProcessingCommand; CConfiguration* mLoaderConfig; QSemaphore mThreadStartedSemaphore; CQtHttpConnectionHandlerReleaser* mReleaser; bool mQueued; // private slots private slots: void connectionRead(); void connectionDisconnect(); // private variables private: }; }; // end namespace OWLlink }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_INTERFACE_OWLLINK_COWLLINKHTTPCONNECTIONHANDLERPROCESSOR_H Konclude-v0.6.2-544-SourceCode/Source/Control/Interface/OWLlink/COWLLinkRecordInterpreter.cpp0000644000175000017500000013254012520756356030612 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLLinkRecordInterpreter.h" namespace Konclude { namespace Control { namespace Interface { namespace OWLlink { COWLLinkRecordInterpreter::COWLLinkRecordInterpreter(CCommandDelegater *commandDelegater, CConfiguration* config) : CCommandRecorder(),document("ResponseMessage") { delegater = commandDelegater; nextSeqNumber = 0; recNextSeqNumber = 0; owllinkNS = "http://www.owllink.org/owllink#"; owlNS = "http://www.w3.org/2002/07/owl#"; QDomProcessingInstruction procInstHeader = document.createProcessingInstruction("xml","version=\"1.0\" encoding=\"utf-8\""); document.appendChild(procInstHeader); rootNode = document.createElementNS(owllinkNS,"ResponseMessage"); //rootNode.setAttributeNS("xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); //rootNode.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.owllink.org/owllink# http://www.owllink.org/owllink-20091116.xsd"); rootNode.setAttribute("xmlns:owl",owlNS); rootNode.setAttribute("xml:base",owlNS); rootNode.setAttribute("xmlns:xsd","http://www.w3.org/2001/XMLSchema#"); document.appendChild(rootNode); mConfFileAppendSimpleStats = false; mStatFileString = "reasoning-statistics.txt"; mStatStringList.append("calculation-reasoning-time"); mStatStringList.append("task-process-change-count"); mStatStringList.append("calculation-memory-consumption"); mStatStringList.append("individual-node-switch-count"); mStatStringList.append("unsatisfiable-cache-used-count"); mStatStringList.append("created-successor-individual-node-count"); mStatVector.resize(mStatStringList.count()); mCalculatedWrongResult = false; mRespondQueryStatistics = true; mConfig = config; mConfExtendedErrorReporting = CConfigDataReader::readConfigBoolean(mConfig,"Konclude.OWLlink.ExtendedErrorReporting",false); } COWLLinkRecordInterpreter::~COWLLinkRecordInterpreter() { } CCommandDelegater *COWLLinkRecordInterpreter::delegateCommand(CCommand *command) { seqSyncMutex.lock(); commandSequenceHash.insert(command,nextSeqNumber++); seqSyncMutex.unlock(); if (delegater) { delegater->delegateCommand(command); } return this; } bool COWLLinkRecordInterpreter::hasReasonerCalculatedWrongResult() { return mCalculatedWrongResult; } CCommandRecorder *COWLLinkRecordInterpreter::recordData(CCommandRecordData *recData) { CCommandRecorder::recordData(recData); if (dynamic_cast(recData)) { if (recData) { CCommand *command = recData->getCommand(); if (command) { if (commandSequenceHash.contains(command)) { QDomNode domEl; if (dynamic_cast(command)) { CGetDescriptionCommand *desCommand = dynamic_cast(command); if (desCommand) { if (command->getMaxErrorLevel() <= 0) { CConfigurationBase *config = desCommand->getConfiguration(); if (config) { domEl = document.createElement("Description"); domEl.toElement().setAttribute("name",config->getRelatedConfigChange("Konclude.Name")->getString()); QDomElement protVerNode = document.createElement("ProtocolVersion"); protVerNode.setAttribute("major",config->getRelatedConfigChange("Konclude.OWLlink.Version.Major")->getString()); protVerNode.setAttribute("minor",config->getRelatedConfigChange("Konclude.OWLlink.Version.Minor")->getString()); domEl.appendChild(protVerNode); QDomElement reasVerNode = document.createElement("ReasonerVersion"); reasVerNode.setAttribute("major",config->getRelatedConfigChange("Konclude.Version.Major")->getString()); reasVerNode.setAttribute("minor",config->getRelatedConfigChange("Konclude.Version.Minor")->getString()); reasVerNode.setAttribute("build",config->getRelatedConfigChange("Konclude.Version.Build")->getString()); domEl.appendChild(reasVerNode); domEl.appendChild(getOneOfStringConfigNode("selectedProfile","SROIQV(D)","SROIQV(D)","Property")); domEl.appendChild(getOneOfStringConfigNode("appliedSemantics","direct","direct","Property")); domEl.appendChild(getBooleanConfigNode("abbreviatesIRIs",config->getRelatedConfigChange("Konclude.OWLlink.AbbreviatedIRIs")->getString(),"Setting")); domEl.appendChild(getBooleanConfigNode("ignoresAnnotations","true","Property")); domEl.appendChild(getBooleanConfigNode("ignoresDeclarations","true","Property")); domEl.appendChild(getBooleanConfigNode("uniqueNameAssumption","false","Property")); QDomElement supDatatypesNode = document.createElement("Property"); supDatatypesNode.setAttribute("key","supportedDatatypes"); QDomElement supDatatypesListNode = document.createElement("List"); supDatatypesListNode.setAttribute("abbreviatedIRI","xsd:anyURI"); supDatatypesNode.appendChild(supDatatypesListNode); domEl.appendChild(supDatatypesNode); } } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CCreateKnowledgeBaseCommand *createKBCommand = dynamic_cast(command); if (createKBCommand) { if (command->getMaxErrorLevel() <= 0) { domEl = document.createElement("KB"); domEl.toElement().setAttribute("kb",createKBCommand->getKnowledgeBaseName()); } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CKnowledgeBaseProcessCommand *kbProcessCommand = dynamic_cast(command); if (kbProcessCommand) { if (command->getMaxErrorLevel() <= 0) { domEl = document.createElement("OK"); } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CLoadKnowledgeBaseKRSSTestConceptCommand *loadCommand = dynamic_cast(command); if (loadCommand) { mStatLoadString = loadCommand->getLoadIRIString(); if (command->getMaxErrorLevel() <= 0) { domEl = document.createElement("OK"); } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CSetConfigCommand *setConfigCommand = dynamic_cast(command); if (setConfigCommand) { if (command->getMaxErrorLevel() <= 0) { domEl = document.createElement("OK"); } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CGetConfigCommand *getConfigCommand = dynamic_cast(command); if (getConfigCommand) { if (command->getMaxErrorLevel() <= 0) { QString configName = getConfigCommand->getConfigNameString(); CConfigData *configData = getConfigCommand->getConfigData(); if (configData->supportsBooleanConvertion()) { bool configVal = configData->getBoolean(); QString configValString("false"); if (configVal) { configValString = "true"; } domEl = getBooleanConfigNode(configName,configValString,"Setting"); } else if (configData->supportsIntegerConvertion()) { qint64 integer = configData->getInteger(); domEl = getIntegerConfigNode(configName,integer,"Setting"); } else if (configData->supportsStringConvertion()) { domEl = getStringConfigNode(configName,configData->getString(),"Setting"); } else { domEl = document.createElement("Error"); domEl.toElement().setAttribute("error",QString("Convertion from config value to string not possible.")); } } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CGetSettingsCommand *getConfigCommand = dynamic_cast(command); if (getConfigCommand) { if (command->getMaxErrorLevel() <= 0) { domEl = document.createElement("Settings"); CConfigurationBase *configuration = getConfigCommand->getConfiguration(); CConfigurationGroup *configGroup = configuration->getConfigurationGroup(); qint64 configCount = configGroup->getConfigPropertyCount(); for (qint64 configIdx = 0; configIdx < configCount; ++configIdx) { CConfigDescription *configDes = configGroup->getConfigDescription(configIdx); QString configName = configDes->getConfigName(); QDomElement settEl; if (configName.startsWith("Konclude.") || configName.startsWith("Konclude.OWLlink.")) { CConfigData *configData = configuration->getRelatedConfigChange(configIdx,true); if (configData) { if (configData->supportsBooleanConvertion()) { bool configVal = configData->getBoolean(); QString configValString("false"); if (configVal) { configValString = "true"; } settEl = getBooleanConfigNode(configName,configValString,"Setting"); } else if (configData->supportsIntegerConvertion()) { qint64 integer = configData->getInteger(); settEl = getIntegerConfigNode(configName,integer,"Setting"); } else if (configData->supportsStringConvertion()) { settEl = getStringConfigNode(configName,configData->getString(),"Setting"); } } } if (!settEl.isNull()) { domEl.appendChild(settEl); } } } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CInsertResponseCommentCommand *commentCommand = dynamic_cast(command); if (commentCommand) { if (command->getMaxErrorLevel() <= 0) { domEl = document.createComment(commentCommand->getResponseComment()); } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CTellKnowledgeBaseCommand *tellKBCommand = dynamic_cast(command); if (tellKBCommand) { if (command->getMaxErrorLevel() <= 0) { domEl = document.createElement("OK"); } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CLoadKnowledgeBaseCommand *loadKBCommand = dynamic_cast(command); if (loadKBCommand) { if (command->getMaxErrorLevel() <= 0) { domEl = document.createElement("OK"); } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CGetKnowledgeBaseLanguageCommand *getKBLanguageCommand = dynamic_cast(command); if (getKBLanguageCommand) { if (command->getMaxErrorLevel() <= 0) { QDomElement langEl = document.createElement("StringResponse"); langEl.setAttribute("result",getKBLanguageCommand->getLanguageString()); domEl = langEl; } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CGetKnowledgeBaseClassEntitiesCommand *getClassEntitiesCommand = dynamic_cast(command); if (getClassEntitiesCommand) { if (command->getMaxErrorLevel() <= 0) { CExtractedKnowledgeBaseEntitiesContainer* entityContainer = getClassEntitiesCommand->getExtractedEntityContainer(); domEl = getEntitiesSetNode("SetOfClasses","owl:Class",entityContainer); } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CGetKnowledgeBaseObjectPropertyEntitiesCommand *getObjectPropertyEntitiesCommand = dynamic_cast(command); if (getObjectPropertyEntitiesCommand) { if (command->getMaxErrorLevel() <= 0) { CExtractedKnowledgeBaseEntitiesContainer* entityContainer = getObjectPropertyEntitiesCommand->getExtractedEntityContainer(); domEl = getEntitiesSetNode("SetOfObjectProperties","owl:ObjectProperty",entityContainer); } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CGetKnowledgeBaseNamedIndividualEntitiesCommand *getIndividualEntitiesCommand = dynamic_cast(command); if (getIndividualEntitiesCommand) { if (command->getMaxErrorLevel() <= 0) { CExtractedKnowledgeBaseEntitiesContainer* entityContainer = getIndividualEntitiesCommand->getExtractedEntityContainer(); domEl = getEntitiesSetNode("SetOfIndividuals","owl:NamedIndividual",entityContainer); } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CKnowledgeBaseQueryCommand *queryCommand = dynamic_cast(command); if (queryCommand) { if (command->getMaxErrorLevel() <= 0) { bool wrongResult = false; CCalculateQueryCommand *calcQueryCommand = queryCommand->getCalculateQueryCommand(); CTestExtendedCalculateQueryCommand *testExtCalcQueryCommand = dynamic_cast(calcQueryCommand); CQuery *query = calcQueryCommand->getQuery(); CQueryResult *queryResult = 0; CQueryResult *expectedQueryResult = 0; QDomElement queryErrorNode; if (query) { QDomElement queryResultNode; queryResult = query->getQueryResult(); if (queryResult) { CBooleanQueryResult *boolQueryResult = dynamic_cast(queryResult); if (boolQueryResult) { bool result = false; result = boolQueryResult->getResult(); queryResultNode = document.createElement("BooleanResponse"); if (result) { queryResultNode.setAttribute("result","true"); } else { queryResultNode.setAttribute("result","false"); } domEl = queryResultNode; } CClassHierarchyResult *subClassHierarchyResult = dynamic_cast(queryResult); if (subClassHierarchyResult) { queryResultNode = document.createElement("ClassHierarchy"); CClassSynsetResult *bottomClassSynsetResult = subClassHierarchyResult->getBottomClassSynset(); QDomElement classSynsetNode = document.createElement("ClassSynset"); foreach (QString className, bottomClassSynsetResult->getEquivalentClassNameList()) { QDomElement classNameNode = document.createElement("owl:Class"); classNameNode.setAttribute("IRI",className); classSynsetNode.appendChild(classNameNode); } queryResultNode.appendChild(classSynsetNode); QList procList; QSet procSet; CClassSynsetResult *topClassSynsetResult = subClassHierarchyResult->getTopClassSynset(); procList.append(topClassSynsetResult); while (!procList.isEmpty()) { CClassSynsetResult *classSynsetResult = procList.takeFirst(); CClassSubClassesRelationResult *subClassRelationResult = subClassHierarchyResult->getSubClassRelation(classSynsetResult,false); if (subClassRelationResult) { QDomElement classSubClassPairNode = document.createElement("ClassSubClassesPair"); // super class serialization QDomElement superClassSynsetNode = document.createElement("ClassSynset"); foreach (QString className, classSynsetResult->getEquivalentClassNameList()) { QDomElement classNameNode = document.createElement("owl:Class"); classNameNode.setAttribute("IRI",className); superClassSynsetNode.appendChild(classNameNode); } classSubClassPairNode.appendChild(superClassSynsetNode); QDomElement subClassSynsetsNode = document.createElement("SubClassSynsets"); // sub classes serialization foreach (CClassSynsetResult *subClassSynsetResult, subClassRelationResult->getSubClassesSynsetList()) { QDomElement subClassSynsetNode = document.createElement("ClassSynset"); foreach (QString className, subClassSynsetResult->getEquivalentClassNameList()) { QDomElement classNameNode = document.createElement("owl:Class"); classNameNode.setAttribute("IRI",className); subClassSynsetNode.appendChild(classNameNode); } subClassSynsetsNode.appendChild(subClassSynsetNode); if (!procSet.contains(subClassSynsetResult)) { procSet.insert(subClassSynsetResult); procList.append(subClassSynsetResult); } } classSubClassPairNode.appendChild(subClassSynsetsNode); queryResultNode.appendChild(classSubClassPairNode); } } domEl = queryResultNode; } CClassesResult* classesResult = dynamic_cast(queryResult); if (classesResult) { queryResultNode = document.createElement("Classes"); QSet* classesSet = classesResult->getClassesSet(); for (QSet::const_iterator it = classesSet->constBegin(), itEnd = classesSet->constEnd(); it != itEnd; ++it) { const QString& className(*it); QDomElement classNameNode = document.createElement("owl:Class"); classNameNode.setAttribute("IRI",className); queryResultNode.appendChild(classNameNode); } domEl = queryResultNode; } CClassSetResult* classSetResult = dynamic_cast(queryResult); if (classSetResult) { queryResultNode = document.createElement("SetOfClasses"); QSet* classesSet = classSetResult->getClassesSet(); for (QSet::const_iterator it = classesSet->constBegin(), itEnd = classesSet->constEnd(); it != itEnd; ++it) { const QString& className(*it); QDomElement classNameNode = document.createElement("owl:Class"); classNameNode.setAttribute("IRI",className); queryResultNode.appendChild(classNameNode); } domEl = queryResultNode; } CIndividualSynonymsResult* individualSynonymsResult = dynamic_cast(queryResult); if (individualSynonymsResult) { queryResultNode = document.createElement("IndividualSynonyms"); QSet* individualsSet = individualSynonymsResult->getIndividualsSet(); for (QSet::const_iterator it = individualsSet->constBegin(), itEnd = individualsSet->constEnd(); it != itEnd; ++it) { const QString& indiName(*it); QDomElement indiNameNode = document.createElement("owl:NamedIndividual"); indiNameNode.setAttribute("IRI",indiName); queryResultNode.appendChild(indiNameNode); } domEl = queryResultNode; } else { CIndividualsResult* individualResult = dynamic_cast(queryResult); if (individualResult) { queryResultNode = document.createElement("SetOfIndividuals"); QSet* individualsSet = individualResult->getIndividualsSet(); for (QSet::const_iterator it = individualsSet->constBegin(), itEnd = individualsSet->constEnd(); it != itEnd; ++it) { const QString& indiName(*it); QDomElement indiNameNode = document.createElement("owl:NamedIndividual"); indiNameNode.setAttribute("IRI",indiName); queryResultNode.appendChild(indiNameNode); } domEl = queryResultNode; } } CIndividualClassAssertionsResult* classAssertionResult = dynamic_cast(queryResult); if (classAssertionResult) { queryResultNode = document.createElement("SetOfClassAssertions"); QSet< QPair >* individualClassAssSet = classAssertionResult->getIndividualConceptAssertionSet(); for (QSet< QPair >::const_iterator it = individualClassAssSet->constBegin(), itEnd = individualClassAssSet->constEnd(); it != itEnd; ++it) { const QPair& indiClassNamePair(*it); QDomElement classAssNode = document.createElement("owl:ClassAssertion"); QDomElement indiNameNode = document.createElement("owl:NamedIndividual"); QDomElement classNode = document.createElement("owl:Class"); indiNameNode.setAttribute("IRI",indiClassNamePair.first); classNode.setAttribute("IRI",indiClassNamePair.second); classAssNode.appendChild(classNode); classAssNode.appendChild(indiNameNode); queryResultNode.appendChild(classAssNode); } domEl = queryResultNode; } CClassSynsetsResult* classSynsetsResult = dynamic_cast(queryResult); if (classSynsetsResult) { queryResultNode = document.createElement("SetOfClassSynsets"); QList* classSynsetList = classSynsetsResult->getClassSynsetList(); for (QList::const_iterator it = classSynsetList->constBegin(), itEnd = classSynsetList->constEnd(); it != itEnd; ++it) { CClassSynsetResult* classSynset(*it); QDomElement superClassSynsetNode = document.createElement("ClassSynset"); foreach (QString className, classSynset->getEquivalentClassNameList()) { QDomElement classNameNode = document.createElement("owl:Class"); classNameNode.setAttribute("IRI",className); superClassSynsetNode.appendChild(classNameNode); } queryResultNode.appendChild(superClassSynsetNode); } domEl = queryResultNode; } CIndividualSynsetsResult* individualSynsetsResult = dynamic_cast(queryResult); if (individualSynsetsResult) { queryResultNode = document.createElement("SetOfIndividualSynsets"); QList* individualSynsetList = individualSynsetsResult->getIndividualSynsetList(); for (QList::const_iterator it = individualSynsetList->constBegin(), itEnd = individualSynsetList->constEnd(); it != itEnd; ++it) { CIndividualSynsetResult* individualSynset(*it); QDomElement superIndividualSynsetNode = document.createElement("IndividualSynset"); foreach (QString individualName, individualSynset->getEquivalentIndividualNameList()) { QDomElement individualNameNode = document.createElement("owl:NamedIndividual"); individualNameNode.setAttribute("IRI",individualName); superIndividualSynsetNode.appendChild(individualNameNode); } queryResultNode.appendChild(superIndividualSynsetNode); } domEl = queryResultNode; } CSucceedQueryResult* succeedResult = dynamic_cast(queryResult); if (succeedResult) { queryResultNode = document.createElement("OK"); domEl = queryResultNode; } if (testExtCalcQueryCommand) { expectedQueryResult = testExtCalcQueryCommand->getExpectedQueryResult(); if (expectedQueryResult) { if (!expectedQueryResult->isResultEquivalentTo(queryResult)) { wrongResult = true; } } if (testExtCalcQueryCommand->getTimingReportLevel() > 0) { queryResultNode.setAttribute("response-time",QString::number(testExtCalcQueryCommand->getCreationElapsedMilliSeconds())); } } } if (query->hasError()) { CQueryInconsitentOntologyError* inOnEr = CQueryInconsitentOntologyError::getInconsistentOntologyError(query->getQueryErrorLinker()); if (inOnEr) { QDomElement erDomEl = getErrorNode(inOnEr->getErrorString(),"UnsatisfiableKBError"); queryErrorNode = erDomEl; } else { QString errorString = query->getErrorStringList().join(" "); if (errorString.isEmpty()) { errorString = QString("Unknown error."); } QDomElement erDomEl = getErrorNode(errorString); queryErrorNode = erDomEl; } } #ifndef KONCLUDE_FORCE_STATISTIC_DEACTIVATED CQueryStatistics* queryStats = query->getQueryStatistics(); if (queryStats && mRespondQueryStatistics) { QList statStrings(queryStats->getStatisticsNameStringList()); if (statStrings.count() >= 1) { QVector statNodeVec(statStrings.count()+1); QList statMoreNodeList; QList statClassNodeList; QDomElement statNode = document.createElement("ResponseStatistics"); foreach (QString statName, statStrings) { if (mConfFileAppendSimpleStats) { for (cint64 i = 0; i < mStatStringList.count(); ++i) { if (statName == mStatStringList[i]) { cint64 statValue = queryStats->getStatisticIntegerValue(statName); mStatVector[i] = statValue; break; } } } cint64 index = CProcessingStatistics::getIndexFromProcessingStatisticDescriptionName(statName); if (index >= 0) { QDomElement statValueNode = document.createElement("CountedProcessStatistic"); statValueNode.setAttribute("statistic-name",statName); statValueNode.setAttribute("statistic-value",queryStats->getStatisticIntegerValue(statName)); statNodeVec[index] = statValueNode; } else { if (statName.startsWith("class-classification")) { QDomElement statValueNode = document.createElement("ClassClassificationStatistic"); statValueNode.setAttribute("statistic-name",statName); statValueNode.setAttribute("statistic-value",queryStats->getStatisticIntegerValue(statName)); statClassNodeList.append(statValueNode); } else { QDomElement statValueNode = document.createElement("CalculationStatistic"); statValueNode.setAttribute("statistic-name",statName); statValueNode.setAttribute("statistic-value",queryStats->getStatisticIntegerValue(statName)); statMoreNodeList.append(statValueNode); } } } foreach (QDomElement statValueNode, statMoreNodeList) { statNode.appendChild(statValueNode); } foreach (QDomElement statValueNode, statClassNodeList) { statNode.appendChild(statValueNode); } for (cint64 index = 0; index < statNodeVec.count(); ++index) { QDomElement statValueNode = statNodeVec[index]; if (!statValueNode.isNull()) { statNode.appendChild(statValueNode); } } if (!queryResultNode.isNull()) { queryResultNode.appendChild(statNode); } else if (!queryErrorNode.isNull()) { queryErrorNode.appendChild(statNode); } } } #endif } else { domEl = getErrorNode(recData); } if (wrongResult) { mCalculatedWrongResult = true; LOG(WARNING,"::Konclude::Control::Interface::OWLlink::OWLlinkRecordInterpreter",logTr("Reasoner calculated unexpected result on query %1.").arg(query->getQueryString()),this); QDomElement errorMistakeNode = getErrorNode(QString("Reasoner calculated unexpected result")); QDomNode prevDomEl = domEl; errorMistakeNode.appendChild(prevDomEl); QDomElement expQueryResultNode = document.createElement("ExpectedResponse"); CBooleanQueryResult *boolExpecQueRes = dynamic_cast(expectedQueryResult); if (boolExpecQueRes) { QDomElement expBoolQueryResultNode = document.createElement("BooleanResponse"); bool expecQueRes = boolExpecQueRes->getResult(); if (expecQueRes) { expBoolQueryResultNode.setAttribute("result","true"); } else { expBoolQueryResultNode.setAttribute("result","false"); } expQueryResultNode.appendChild(expBoolQueryResultNode); } errorMistakeNode.appendChild(expQueryResultNode); domEl = errorMistakeNode; } else if (mConfFileAppendSimpleStats) { CIsClassSatisfiableQuery* satQuery = dynamic_cast(query); if (satQuery) { mStatQueryString = satQuery->getClassStringName(); } //QFile mStatFile(mStatFileString); //if (!mStatFile.exists()) { // if (mStatFile.open(QIODevice::WriteOnly)) { // mStatFile.write((QString("test-name ")+mStatStringList.join(" ").append("\r\n")).toLocal8Bit()); // mStatFile.close(); // } //} //if (mStatFile.open(QIODevice::Append)) { // mStatKBString = queryCommand->getKnowledgeBaseName(); // QString appendString = QString("%1#%2#%3").arg(mStatKBString).arg(mStatLoadString).arg(mStatQueryString); // mStatKBString = ""; // mStatLoadString = ""; // mStatQueryString = ""; // for (cint64 i = 0; i < mStatVector.count(); ++i) { // cint64 statValue = mStatVector[i]; // if (!appendString.isEmpty()) { // appendString.append(" "); // } // appendString.append(QString("%1").arg(statValue)); // } // appendString.append(QString("\r\n")); // mStatFile.write(appendString.toLocal8Bit()); // mStatFile.close(); //} } if (!queryErrorNode.isNull()) { if (!domEl.isNull()) { queryErrorNode.appendChild(domEl); } domEl = queryErrorNode; } } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CSkipUnsupportedCommandCommand *skipUnsCommand = dynamic_cast(command); if (skipUnsCommand) { if (command->getMaxErrorLevel() <= 0) { QDomElement errorNode = getErrorNode(QString("Instruction '%1' is currently not supported.").arg(skipUnsCommand->getSkippedCommandString()),"Error"); domEl = errorNode; } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CReleaseKnowledgeBaseCommand *relCommand = dynamic_cast(command); if (relCommand) { if (command->getMaxErrorLevel() <= 0) { QDomElement releasedNode = document.createElement("OK"); domEl = releasedNode; } else { domEl = getErrorNode(recData); } } } else if (dynamic_cast(command)) { CParseTestsuiteXMLNodeCommand *parseTestCommand = dynamic_cast(command); CTestTestsuiteCommand *testsuiteCommand = 0; CLinker *subCommIt = parseTestCommand->getSubCommandLinker(); while (subCommIt && !testsuiteCommand) { testsuiteCommand = dynamic_cast(subCommIt->getData()); subCommIt = subCommIt->getNext(); } if (testsuiteCommand && testsuiteCommand->getMaxErrorLevel() <= 0) { CReasonerTestsuiteTest *testsuiteTest = testsuiteCommand->getTestsuiteTest(); QLinkedList testfileTestList = testsuiteTest->getTestfileTestList(); QDomElement resultNode = document.createElement("TestsuiteResult"); resultNode.setAttribute("totalTestingTime",testsuiteTest->getTestsuiteResult()->getTotalTestingTime()); foreach (CReasonerTestfileTest *testfileTest, testfileTestList) { CReasonerTestfileTestResult *testfileTestResult = testfileTest->getTestResults(); QDomElement testfileResultNode = document.createElement("TestfileResult"); testfileResultNode.setAttribute("testSource",testfileTest->getTestRequestFile()); testfileResultNode.setAttribute("testLoopCount",testfileTestResult->getTotalTestCount()); if (testfileTestResult->getFailedCount() > 0) { testfileResultNode.setAttribute("failedCount",testfileTestResult->getFailedCount()); } if (testfileTestResult->getCrashCount() > 0) { testfileResultNode.setAttribute("crashCount",testfileTestResult->getCrashCount()); } if (testfileTestResult->getErrorCount() > 0) { testfileResultNode.setAttribute("errorCount",testfileTestResult->getErrorCount()); } if (testfileTestResult->getWrongResponseCount() > 0) { testfileResultNode.setAttribute("wrongCount",testfileTestResult->getWrongResponseCount()); } if (testfileTestResult->getTimeoutCount() > 0) { testfileResultNode.setAttribute("timeoutCount",testfileTestResult->getTimeoutCount()); } testfileResultNode.setAttribute("correctCount",testfileTestResult->getCorrectResponseCount()); if (testfileTestResult->getAverageCorrectResponseTime() > 0) { testfileResultNode.setAttribute("averageCorrectResponseTime",testfileTestResult->getAverageCorrectResponseTime()); } resultNode.appendChild(testfileResultNode); } domEl = resultNode; } else { domEl = getErrorNode(recData); } } if (domEl.isNull()) { domEl = getErrorNode(QString("No handler for '%1' command ").arg(command->getBriefCommandDescription())); } if (!domEl.isNull()) { seqSyncMutex.lock(); qint64 seqNumber = commandSequenceHash.value(command); seqNodeHash.insert(seqNumber,domEl); seqSyncMutex.unlock(); } while (seqNodeHash.contains(recNextSeqNumber)) { seqSyncMutex.lock(); if (seqNodeHash.contains(recNextSeqNumber)) { rootNode.appendChild(seqNodeHash.value(recNextSeqNumber)); recNextSeqNumber++; } seqSyncMutex.unlock(); } } } } } return this; } QDomElement COWLLinkRecordInterpreter::getEntitiesSetNode(const QString &nodeString, const QString &entityString, CExtractedKnowledgeBaseEntitiesContainer* entityContainer) { QDomElement entitySetNode = document.createElement(nodeString); QStringList* entitySet = entityContainer->getExtractedEntityList(); for (QStringList::const_iterator it = entitySet->constBegin(), itEnd = entitySet->constEnd(); it != itEnd; ++it) { const QString& entityName(*it); QDomElement entityNameNode = document.createElement(entityString); entityNameNode.setAttribute("IRI",entityName); entitySetNode.appendChild(entityNameNode); } return entitySetNode; } QDomElement COWLLinkRecordInterpreter::getErrorNode(CCommandRecordData *recData, const QString &nodeString) { QDomElement errorNode = document.createElement(nodeString); QDomElement errorTextNodePa = document.createElement(QString("%1Text").arg(nodeString)); QString errorText = getErrorString(recData,nodeString); QDomText errorTextNode = document.createTextNode(errorText); errorNode.setAttribute("error",errorText); errorTextNodePa.appendChild(errorTextNode); errorNode.appendChild(errorTextNodePa); return errorNode; } QDomElement COWLLinkRecordInterpreter::getErrorNode(const QString& errorText, const QString &nodeString) { QDomElement errorNode = document.createElement(nodeString); QDomElement errorTextNodePa = document.createElement(QString("%1Text").arg(nodeString)); QDomText errorTextNode = document.createTextNode(errorText); errorNode.setAttribute("error",errorText); errorTextNodePa.appendChild(errorTextNode); errorNode.appendChild(errorTextNodePa); return errorNode; } QString COWLLinkRecordInterpreter::getErrorLevelString(double level) { QString logLevelString; if (level >= 90) { logLevelString = "catastrophic error"; } else if (level >= 80) { logLevelString = "exception error"; } else if (level >= 70) { logLevelString = "error"; } else if (level >= 60) { logLevelString = "warning"; } else if (level >= 30) { logLevelString = "info"; } else { logLevelString = "notice"; } return logLevelString; } QString COWLLinkRecordInterpreter::getErrorString(CCommandRecordData *recData, const QString &nodeString) { QString errorText; if (recData) { errorText = QString("An error has occurred while processing '%1',\n%2 process protocol:\n").arg(recData->getCommand()->getBriefCommandDescription()).arg(nodeString); CCommandRecordData *nextRecData = recData; while (nextRecData) { errorText += QString("{%3}, [%1]:%2\n").arg(nextRecData->getRecordDomain()).arg(nextRecData->getRecordMessage()).arg(getErrorLevelString(nextRecData->getRecordErrorLevel())); nextRecData = nextRecData->getNextCommandRecordData(); } CCommand *command = recData->getCommand(); CLinker *subCommIt = command->getSubCommandLinker(); QString subNodeString = QString("Sub-%1").arg(nodeString); while (subCommIt) { CCommand *subCommand = subCommIt->getData(); if (subCommand->getMaxErrorLevel() > 0) { CCommandRecordData *subCommandRecData = subCommand->getRecordData(); if (subCommandRecData) { QString subErrorString = QString("{%1}, %2").arg(getErrorLevelString(subCommand->getMaxErrorLevel())).arg(getErrorString(subCommandRecData,subNodeString)); errorText += subErrorString; } } subCommIt = subCommIt->getNext(); } } else { errorText = QString("An error has occurred while processing, process Interface not available"); } return errorText; } QDomElement COWLLinkRecordInterpreter::getOneOfStringConfigNode(const QString &keyString, const QString &oneOfOptions, const QString &defaultOption, const QString &nodeString) { QDomElement configNode = document.createElement(nodeString); configNode.setAttribute("key",getOWLLinkMappedConfigString(keyString)); QDomElement oneOfNode = document.createElement("OneOf"); oneOfNode.setAttribute("abbreviatedIRI","xsd:string"); configNode.appendChild(oneOfNode); QStringList optionsList(oneOfOptions); foreach (QString optionString, optionsList) { QDomElement litNode = document.createElement("Literal"); QDomText optTextNode = document.createTextNode(optionString); litNode.appendChild(optTextNode); oneOfNode.appendChild(litNode); } QDomElement litNode = document.createElement("Literal"); QDomText optTextNode = document.createTextNode(defaultOption); litNode.appendChild(optTextNode); configNode.appendChild(litNode); return configNode; } QDomElement COWLLinkRecordInterpreter::getBooleanConfigNode(const QString &keyString, const QString &defaultValue, const QString &nodeString) { QDomElement configNode = document.createElement(nodeString); configNode.setAttribute("key",getOWLLinkMappedConfigString(keyString)); QDomElement datatypeNode = document.createElement("Datatype"); datatypeNode.setAttribute("abbreviatedIRI","xsd:boolean"); configNode.appendChild(datatypeNode); QDomElement litNode = document.createElement("Literal"); QDomText optTextNode = document.createTextNode(defaultValue); litNode.appendChild(optTextNode); configNode.appendChild(litNode); return configNode; } QDomElement COWLLinkRecordInterpreter::getIntegerConfigNode(const QString &keyString, qint64 integer, const QString &nodeString) { QDomElement configNode = document.createElement(nodeString); configNode.setAttribute("key",getOWLLinkMappedConfigString(keyString)); QDomElement datatypeNode = document.createElement("Datatype"); datatypeNode.setAttribute("abbreviatedIRI","xsd:integer"); configNode.appendChild(datatypeNode); QDomElement litNode = document.createElement("Literal"); QDomText optTextNode = document.createTextNode(QString::number(integer)); litNode.appendChild(optTextNode); configNode.appendChild(litNode); return configNode; } QDomElement COWLLinkRecordInterpreter::getStringConfigNode(const QString &keyString, const QString &defaultValue, const QString &nodeString) { QDomElement configNode = document.createElement(nodeString); configNode.setAttribute("key",getOWLLinkMappedConfigString(keyString)); QDomElement datatypeNode = document.createElement("Datatype"); datatypeNode.setAttribute("abbreviatedIRI","xsd:string"); configNode.appendChild(datatypeNode); QDomElement litNode = document.createElement("Literal"); QDomText optTextNode = document.createTextNode(defaultValue); litNode.appendChild(optTextNode); configNode.appendChild(litNode); return configNode; } QByteArray COWLLinkRecordInterpreter::getByteArray() { return document.toString().toUtf8(); } QString COWLLinkRecordInterpreter::getOWLLinkMappedConfigString(const QString &keyName) { if (keyName == "Konclude.OWLlink.AbbreviatedIRIs") { return QString("abbreviatesIRIs"); } return keyName; } }; // end namespace OWLlink }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/0000755000175000017500000000000012613407250023770 5ustar jonasjonas././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIRealizationComandLinePreparationTranslator.hKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIRealizationComandLinePrepara0000644000175000017500000000500312520756354032103 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLIREALIZATIONCOMANDLINEPREPARATIONTRANSLATOR_H #define KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLIREALIZATIONCOMANDLINEPREPARATIONTRANSLATOR_H // Libraries includes #include #include #include // Namespace includes #include "CCLIComandLinePreparationTranslator.h" // Other includes #include "Control/Loader/CLoaderFactory.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { using namespace Loader; namespace Interface { namespace CommandLine { /*! * * \class CCLIRealizationComandLinePreparationTranslator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCLIRealizationComandLinePreparationTranslator : public CCLIComandLinePreparationTranslator { // public methods public: //! Constructor CCLIRealizationComandLinePreparationTranslator(CLoaderFactory *loaderFactory); //! Destructor virtual ~CCLIRealizationComandLinePreparationTranslator(); virtual bool canTranslate(const QString& string); virtual bool hasNeccessaryParameters(); // protected methods protected: virtual bool translate(const QString& argumentText, QStringList& remainingArgList); // protected variables protected: CLoaderFactory *loaderFac; // private methods private: // private variables private: }; }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLIREALIZATIONCOMANDLINEPREPARATIONTRANSLATOR_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/COWLLinkFileComandLinePreparationTranslator.hKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/COWLLinkFileComandLinePreparatio0000644000175000017500000000507512520756354032076 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_COWLLINKFILECOMANDLINEPREPARATIONTRANSLATOR_H #define KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_COWLLINKFILECOMANDLINEPREPARATIONTRANSLATOR_H // Libraries includes #include #include #include // Namespace includes #include "CCommandLinePreparationTranslator.h" // Other includes #include "Control/Loader/CLoaderFactory.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { using namespace Loader; namespace Interface { namespace CommandLine { /*! * * \class COWLLinkFileComandLinePreparationTranslator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLLinkFileComandLinePreparationTranslator : public CCommandLinePreparationTranslator { // public methods public: //! Constructor COWLLinkFileComandLinePreparationTranslator(CLoaderFactory *loaderFactory); //! Destructor virtual ~COWLLinkFileComandLinePreparationTranslator(); virtual QStringList combineTranslatedArguments(); virtual bool canTranslate(const QString& string); // protected methods protected: virtual bool translate(const QString& argumentText, QStringList& remainingArgList); // protected variables protected: CLoaderFactory *loaderFac; bool mMinNecessaryArguments; bool mFirstArgumentTranslation; // private methods private: // private variables private: }; }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_COWLLINKFILECOMANDLINEPREPARATIONTRANSLATOR_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIComandLinePreparationTranslator.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIComandLinePreparationTransla0000644000175000017500000000662712520756354032135 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCLIComandLinePreparationTranslator.h" namespace Konclude { namespace Control { namespace Interface { namespace CommandLine { CCLIComandLinePreparationTranslator::CCLIComandLinePreparationTranslator(CLoaderFactory *loaderFactory) : CCommandLinePreparationTranslator(loaderFactory) { mInterfaceTypeString = QString("CLI"); mMinNecessaryArguments = false; mFirstArgumentTranslation = false; } CCLIComandLinePreparationTranslator::~CCLIComandLinePreparationTranslator() { } QStringList CCLIComandLinePreparationTranslator::combineTranslatedArguments() { QStringList translatedArgList; if (!hasNeccessaryParameters()) { mMinNecessaryArguments = false; } if (!mMinNecessaryArguments) { LOG(ERROR,getLogDomain(),logTr("Execution with inadequate command line arguments."),this); mHelpRequested = true; } if (!mHelpRequested) { if (mLogConfList.isEmpty()) { mLogConfList.append(QString("-ConfigurableCoutLogObserverLoader -LoggerConfigurationLoader")); } translatedArgList += mLogConfList; translatedArgList += mGeneralConfList; translatedArgList += QString("-DefaultReasonerLoader "); translatedArgList += mReasonerConfList; translatedArgList += mGeneralConfList; if (!mConfigConfList.isEmpty()) { translatedArgList += QString("-OWLlinkBatchFileLoader +=Konclude.OWLlink.CloseAfterProcessedRequest=false +=Konclude.OWLlink.BlockUntilProcessedRequest=true"); translatedArgList += mConfigConfList; } translatedArgList += mLoaderTypeString; if (mExtendendLogging) { translatedArgList += QString("+=Konclude.OWLlink.LoggingExtendedProcessingTimes=true"); } translatedArgList += mRequestConfList; translatedArgList += mMiscellaneousList; } else { translatedArgList += QString("-ConfigurableCoutLogObserverLoader -CommandLineTranlatorHelpLoader"); } return translatedArgList; } bool CCLIComandLinePreparationTranslator::translate(const QString& argumentText, QStringList& remainingArgList) { bool argumentTranslated = false; QString modArgText = argumentText.trimmed(); if (!mSkipTranslation) { if (CCommandLinePreparationTranslator::translate(argumentText,remainingArgList)) { argumentTranslated = true; } } return argumentTranslated; } bool CCLIComandLinePreparationTranslator::canTranslate(const QString& string) { return false; } }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/COWLLinkServerComandLinePreparationTranslator.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/COWLLinkServerComandLinePreparat0000644000175000017500000001040012520756354032121 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLLinkServerComandLinePreparationTranslator.h" namespace Konclude { namespace Control { namespace Interface { namespace CommandLine { COWLLinkServerComandLinePreparationTranslator::COWLLinkServerComandLinePreparationTranslator(CLoaderFactory *loaderFactory) : CCommandLinePreparationTranslator(loaderFactory) { mInterfaceTypeString = QString("OWLlink"); mMinNecessaryArguments = true; mFirstArgumentTranslation = false; } COWLLinkServerComandLinePreparationTranslator::~COWLLinkServerComandLinePreparationTranslator() { } bool COWLLinkServerComandLinePreparationTranslator::translate(const QString& argumentText, QStringList& remainingArgList) { bool argumentTranslated = false; QString modArgText = argumentText.trimmed(); if (!mSkipTranslation) { if (CCommandLinePreparationTranslator::translate(argumentText,remainingArgList)) { argumentTranslated = true; } else { if (modArgText.indexOf("-") == 0) { while (modArgText.startsWith("-")) { modArgText.remove(0,1); modArgText = modArgText.trimmed(); } if (modArgText.indexOf("p") == 0 || modArgText.indexOf("P") == 0) { argumentTranslated = true; QString portVal = ""; if (remainingArgList.count() > 0) { portVal = remainingArgList.takeFirst(); } mRequestConfList.append(QString("+Konclude.OWLlink.Server.Port=%2").arg(portVal.trimmed())); } } else if (modArgText == "owllinkserver" || modArgText == "server") { argumentTranslated = true; mFirstArgumentTranslation = true; } } } return argumentTranslated; } bool COWLLinkServerComandLinePreparationTranslator::canTranslate(const QString& string) { if (QString::compare(string,"owllinkserver",Qt::CaseInsensitive) == 0 || QString::compare(string,"server",Qt::CaseInsensitive) == 0) { return true; } return false; } QStringList COWLLinkServerComandLinePreparationTranslator::combineTranslatedArguments() { QStringList translatedArgList; if (!mFirstArgumentTranslation) { mMinNecessaryArguments = false; } if (!mMinNecessaryArguments) { LOG(ERROR,getLogDomain(),logTr("Execution with inadequate command line arguments."),this); mHelpRequested = true; } if (!mHelpRequested) { if (mLogConfList.isEmpty()) { mLogConfList.append(QString("-ConfigurableCoutLogObserverLoader -LoggerConfigurationLoader")); } translatedArgList += mLogConfList; translatedArgList += mGeneralConfList; translatedArgList += QString("-DefaultReasonerLoader "); translatedArgList += mReasonerConfList; translatedArgList += mGeneralConfList; if (!mConfigConfList.isEmpty()) { translatedArgList += QString("-%1BatchFileLoader +=Konclude.%1.CloseAfterProcessedRequest=false +=Konclude.%1.BlockUntilProcessedRequest=true").arg(mInterfaceTypeString); translatedArgList += mConfigConfList; } translatedArgList += QString("-OWLlinkHttpServerLoader"); translatedArgList += mRequestConfList; translatedArgList += mMiscellaneousList; } else { translatedArgList += QString("-ConfigurableCoutLogObserverLoader -CommandLineTranlatorHelpLoader"); } return translatedArgList; } }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCommandLinePreparationTranslator.hKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCommandLinePreparationTranslato0000644000175000017500000000615212520756354032316 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCOMMANDLINEPREPARATIONTRANSLATOR_H #define KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCOMMANDLINEPREPARATIONTRANSLATOR_H // Libraries includes #include #include #include // Namespace includes // Other includes #include "Control/Loader/CLoaderFactory.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { using namespace Loader; namespace Interface { namespace CommandLine { /*! * * \class CCommandLinePreparationTranslator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommandLinePreparationTranslator : public CLogIdentifier { // public methods public: //! Constructor CCommandLinePreparationTranslator(CLoaderFactory *loaderFactory); //! Destructor virtual ~CCommandLinePreparationTranslator(); virtual QStringList translateArguments(int argc, char *argv[]); virtual QStringList translateArguments(const QStringList& argList); virtual QStringList combineTranslatedArguments(); virtual bool canTranslate(const QString& string) = 0; // protected methods protected: virtual bool translate(const QString& argumentText, QStringList& remainingArgList); // protected variables protected: QString mInterfaceTypeString; QString mLoaderTypeString; CLoaderFactory* mLoaderFac; bool mSkipTranslation; bool mHelpRequested; QStringList mLogConfList; QStringList mConfigConfList; QStringList mRequestConfList; QStringList mMiscellaneousList; QString mRequestFileName; bool mGenerateAutoResponseFile; bool mRequestFileTranslated; bool mResponseFileTranslated; bool mConfigFileTranslated; bool mIRITranslated; bool mExtendendLogging; QStringList mGeneralConfList; QStringList mReasonerConfList; // private methods private: // private variables private: }; }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCOMMANDLINEPREPARATIONTRANSLATOR_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/COWLLinkFileComandLinePreparationTranslator.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/COWLLinkFileComandLinePreparatio0000644000175000017500000001015612520756354032072 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLLinkFileComandLinePreparationTranslator.h" namespace Konclude { namespace Control { namespace Interface { namespace CommandLine { COWLLinkFileComandLinePreparationTranslator::COWLLinkFileComandLinePreparationTranslator(CLoaderFactory *loaderFactory) : CCommandLinePreparationTranslator(loaderFactory) { mInterfaceTypeString = QString("OWLlink"); mMinNecessaryArguments = true; mFirstArgumentTranslation = false; } COWLLinkFileComandLinePreparationTranslator::~COWLLinkFileComandLinePreparationTranslator() { } QStringList COWLLinkFileComandLinePreparationTranslator::combineTranslatedArguments() { QStringList translatedArgList; if (!mFirstArgumentTranslation) { mMinNecessaryArguments = false; } if (!mRequestFileTranslated) { LOG(ERROR,getLogDomain(),logTr("OWLlink request file not specified."),this); mMinNecessaryArguments = false; } if (!mMinNecessaryArguments) { LOG(ERROR,getLogDomain(),logTr("Execution with inadequate command line arguments."),this); mHelpRequested = true; } if (!mHelpRequested) { if (mLogConfList.isEmpty()) { mLogConfList.append(QString("-ConfigurableCoutLogObserverLoader -LoggerConfigurationLoader")); } translatedArgList += mLogConfList; translatedArgList += mGeneralConfList; translatedArgList += QString("-DefaultReasonerLoader "); translatedArgList += mReasonerConfList; translatedArgList += mGeneralConfList; if (!mConfigConfList.isEmpty()) { translatedArgList += QString("-%1BatchFileLoader +=Konclude.%1.CloseAfterProcessedRequest=false +=Konclude.%1.BlockUntilProcessedRequest=true").arg(mInterfaceTypeString); translatedArgList += mConfigConfList; } translatedArgList += QString("-%1BatchFileLoader +=Konclude.%1.CloseAfterProcessedRequest=true").arg(mInterfaceTypeString); if (mExtendendLogging) { translatedArgList += QString("+=Konclude.%1.LoggingExtendedProcessingTimes=true").arg(mInterfaceTypeString); } translatedArgList += mRequestConfList; translatedArgList += mMiscellaneousList; } else { translatedArgList += QString("-ConfigurableCoutLogObserverLoader -CommandLineTranlatorHelpLoader"); } return translatedArgList; } bool COWLLinkFileComandLinePreparationTranslator::translate(const QString& argumentText, QStringList& remainingArgList) { bool argumentTranslated = false; QString modArgText = argumentText.trimmed(); if (!mSkipTranslation) { if (CCommandLinePreparationTranslator::translate(argumentText,remainingArgList)) { argumentTranslated = true; } else { if (modArgText.indexOf("-") == 0) { } else if (modArgText == "owllinkfile" || modArgText == "file") { argumentTranslated = true; mFirstArgumentTranslation = true; } } } return argumentTranslated; } bool COWLLinkFileComandLinePreparationTranslator::canTranslate(const QString& string) { if (QString::compare(string,"owllinkfile",Qt::CaseInsensitive) == 0 || QString::compare(string,"file",Qt::CaseInsensitive) == 0) { return true; } return false; } }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIConsistencyComandLinePreparationTranslator.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIConsistencyComandLinePrepara0000644000175000017500000000562112520756354032131 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCLIConsistencyComandLinePreparationTranslator.h" namespace Konclude { namespace Control { namespace Interface { namespace CommandLine { CCLIConsistencyComandLinePreparationTranslator::CCLIConsistencyComandLinePreparationTranslator(CLoaderFactory *loaderFactory) : CCLIComandLinePreparationTranslator(loaderFactory) { mOperationTypeString = QString("Consistency"); mMinNecessaryArguments = true; mFirstArgumentTranslation = false; mLoaderTypeString = QString("-CLIConsistencyBatchProcessingLoader"); } CCLIConsistencyComandLinePreparationTranslator::~CCLIConsistencyComandLinePreparationTranslator() { } bool CCLIConsistencyComandLinePreparationTranslator::hasNeccessaryParameters() { bool minNecessaryArguments = true; if (!mFirstArgumentTranslation) { minNecessaryArguments = false; } if (!mRequestFileTranslated) { LOG(ERROR,getLogDomain(),logTr("%1 request file not specified.").arg(mOperationTypeString),this); minNecessaryArguments = false; } return minNecessaryArguments; } bool CCLIConsistencyComandLinePreparationTranslator::translate(const QString& argumentText, QStringList& remainingArgList) { bool argumentTranslated = false; QString modArgText = argumentText.trimmed(); if (!mSkipTranslation) { if (CCommandLinePreparationTranslator::translate(argumentText,remainingArgList)) { argumentTranslated = true; } else { if (modArgText.indexOf("-") == 0) { } else if (modArgText == "consistency" || modArgText == "cons") { argumentTranslated = true; mFirstArgumentTranslation = true; } } } return argumentTranslated; } bool CCLIConsistencyComandLinePreparationTranslator::canTranslate(const QString& string) { if (QString::compare(string,"consistency",Qt::CaseInsensitive) == 0 || QString::compare(string,"cons",Qt::CaseInsensitive) == 0) { return true; } return false; } }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIConsistencyComandLinePreparationTranslator.hKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIConsistencyComandLinePrepara0000644000175000017500000000500312520756354032123 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLICONSISTENCYCOMANDLINEPREPARATIONTRANSLATOR_H #define KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLICONSISTENCYCOMANDLINEPREPARATIONTRANSLATOR_H // Libraries includes #include #include #include // Namespace includes #include "CCLIComandLinePreparationTranslator.h" // Other includes #include "Control/Loader/CLoaderFactory.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { using namespace Loader; namespace Interface { namespace CommandLine { /*! * * \class CCLIConsistencyComandLinePreparationTranslator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCLIConsistencyComandLinePreparationTranslator : public CCLIComandLinePreparationTranslator { // public methods public: //! Constructor CCLIConsistencyComandLinePreparationTranslator(CLoaderFactory *loaderFactory); //! Destructor virtual ~CCLIConsistencyComandLinePreparationTranslator(); virtual bool canTranslate(const QString& string); virtual bool hasNeccessaryParameters(); // protected methods protected: virtual bool translate(const QString& argumentText, QStringList& remainingArgList); // protected variables protected: CLoaderFactory *loaderFac; // private methods private: // private variables private: }; }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLICONSISTENCYCOMANDLINEPREPARATIONTRANSLATOR_H ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLISatisfiabilityComandLinePreparationTranslator.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLISatisfiabilityComandLinePrep0000644000175000017500000000613712520756354032127 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCLISatisfiabilityComandLinePreparationTranslator.h" namespace Konclude { namespace Control { namespace Interface { namespace CommandLine { CCLISatisfiabilityComandLinePreparationTranslator::CCLISatisfiabilityComandLinePreparationTranslator(CLoaderFactory *loaderFactory) : CCLIComandLinePreparationTranslator(loaderFactory) { mOperationTypeString = QString("Satisfiability"); mMinNecessaryArguments = true; mFirstArgumentTranslation = false; mLoaderTypeString = QString("-CLISatisfiabilityBatchProcessingLoader"); } CCLISatisfiabilityComandLinePreparationTranslator::~CCLISatisfiabilityComandLinePreparationTranslator() { } bool CCLISatisfiabilityComandLinePreparationTranslator::hasNeccessaryParameters() { bool minNecessaryArguments = true; if (!mFirstArgumentTranslation) { minNecessaryArguments = false; } if (!mRequestFileTranslated) { LOG(ERROR,getLogDomain(),logTr("%1 request file not specified.").arg(mOperationTypeString),this); minNecessaryArguments = false; } if (!mIRITranslated) { LOG(ERROR,getLogDomain(),logTr("Class IRI not specified for satisfiability checking."),this); minNecessaryArguments = false; } return minNecessaryArguments; } bool CCLISatisfiabilityComandLinePreparationTranslator::translate(const QString& argumentText, QStringList& remainingArgList) { bool argumentTranslated = false; QString modArgText = argumentText.trimmed(); if (!mSkipTranslation) { if (CCommandLinePreparationTranslator::translate(argumentText,remainingArgList)) { argumentTranslated = true; } else { if (modArgText.indexOf("-") == 0) { } else if (modArgText == "satisfiability" || modArgText == "sat") { argumentTranslated = true; mFirstArgumentTranslation = true; } } } return argumentTranslated; } bool CCLISatisfiabilityComandLinePreparationTranslator::canTranslate(const QString& string) { if (QString::compare(string,"satisfiability",Qt::CaseInsensitive) == 0 || QString::compare(string,"sat",Qt::CaseInsensitive) == 0) { return true; } return false; } }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLISatisfiabilityComandLinePreparationTranslator.hKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLISatisfiabilityComandLinePrep0000644000175000017500000000503012520756354032116 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLISATISFIABILITYCOMANDLINEPREPARATIONTRANSLATOR_H #define KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLISATISFIABILITYCOMANDLINEPREPARATIONTRANSLATOR_H // Libraries includes #include #include #include // Namespace includes #include "CCLIComandLinePreparationTranslator.h" // Other includes #include "Control/Loader/CLoaderFactory.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { using namespace Loader; namespace Interface { namespace CommandLine { /*! * * \class CCLISatisfiabilityComandLinePreparationTranslator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCLISatisfiabilityComandLinePreparationTranslator : public CCLIComandLinePreparationTranslator { // public methods public: //! Constructor CCLISatisfiabilityComandLinePreparationTranslator(CLoaderFactory *loaderFactory); //! Destructor virtual ~CCLISatisfiabilityComandLinePreparationTranslator(); virtual bool canTranslate(const QString& string); virtual bool hasNeccessaryParameters(); // protected methods protected: virtual bool translate(const QString& argumentText, QStringList& remainingArgList); // protected variables protected: CLoaderFactory *loaderFac; // private methods private: // private variables private: }; }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLISATISFIABILITYCOMANDLINEPREPARATIONTRANSLATOR_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/COWLLinkServerComandLinePreparationTranslator.hKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/COWLLinkServerComandLinePreparat0000644000175000017500000000505212520756354032130 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_COWLLINKSERVERCOMANDLINEPREPARATIONTRANSLATOR_H #define KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_COWLLINKSERVERCOMANDLINEPREPARATIONTRANSLATOR_H // Libraries includes #include #include #include // Namespace includes #include "CCommandLinePreparationTranslator.h" // Other includes #include "Control/Loader/CLoaderFactory.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { using namespace Loader; namespace Interface { namespace CommandLine { /*! * * \class COWLLinkServerComandLinePreparationTranslator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLLinkServerComandLinePreparationTranslator : public CCommandLinePreparationTranslator { // public methods public: //! Constructor COWLLinkServerComandLinePreparationTranslator(CLoaderFactory *loaderFactory); //! Destructor virtual ~COWLLinkServerComandLinePreparationTranslator(); virtual QStringList combineTranslatedArguments(); virtual bool canTranslate(const QString& string); // protected methods protected: virtual bool translate(const QString& argumentText, QStringList& remainingArgList); // protected variables protected: bool mMinNecessaryArguments; bool mFirstArgumentTranslation; // private methods private: // private variables private: }; }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_COWLLINKSERVERCOMANDLINEPREPARATIONTRANSLATOR_H ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIRealizationComandLinePreparationTranslator.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIRealizationComandLinePrepara0000644000175000017500000000616612520756354032116 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCLIRealizationComandLinePreparationTranslator.h" namespace Konclude { namespace Control { namespace Interface { namespace CommandLine { CCLIRealizationComandLinePreparationTranslator::CCLIRealizationComandLinePreparationTranslator(CLoaderFactory *loaderFactory) : CCLIComandLinePreparationTranslator(loaderFactory) { mOperationTypeString = QString("Realization"); mMinNecessaryArguments = true; mFirstArgumentTranslation = false; mLoaderTypeString = QString("-CLIRealizationBatchProcessingLoader"); } CCLIRealizationComandLinePreparationTranslator::~CCLIRealizationComandLinePreparationTranslator() { } bool CCLIRealizationComandLinePreparationTranslator::hasNeccessaryParameters() { bool minNecessaryArguments = true; if (!mFirstArgumentTranslation) { minNecessaryArguments = false; } if (!mRequestFileTranslated) { LOG(ERROR,getLogDomain(),logTr("%1 request file not specified.").arg(mOperationTypeString),this); minNecessaryArguments = false; } return minNecessaryArguments; } bool CCLIRealizationComandLinePreparationTranslator::translate(const QString& argumentText, QStringList& remainingArgList) { bool argumentTranslated = false; QString modArgText = argumentText.trimmed(); if (!mSkipTranslation) { if (CCommandLinePreparationTranslator::translate(argumentText,remainingArgList)) { argumentTranslated = true; } else { if (modArgText.indexOf("-") == 0) { } else if (modArgText == "realisation" || modArgText == "realise" || modArgText == "realization" || modArgText == "realize") { argumentTranslated = true; mFirstArgumentTranslation = true; } } } return argumentTranslated; } bool CCLIRealizationComandLinePreparationTranslator::canTranslate(const QString& string) { if (QString::compare(string,"realization",Qt::CaseInsensitive) == 0 || QString::compare(string,"realize",Qt::CaseInsensitive) == 0) { return true; } if (QString::compare(string,"realisation",Qt::CaseInsensitive) == 0 || QString::compare(string,"realise",Qt::CaseInsensitive) == 0) { return true; } return false; } }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCommandLinePreparationTranslator.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCommandLinePreparationTranslato0000644000175000017500000002215312520756354032315 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandLinePreparationTranslator.h" namespace Konclude { namespace Control { namespace Interface { namespace CommandLine { CCommandLinePreparationTranslator::CCommandLinePreparationTranslator(CLoaderFactory *loaderFactory) : CLogIdentifier("::Konclude::Loader::CommandLineTranslator",this) { mSkipTranslation = false; mGenerateAutoResponseFile = false; mLoaderFac = loaderFactory; mHelpRequested = false; mExtendendLogging = false; mInterfaceTypeString = QString("CLI"); mRequestFileTranslated = false; mResponseFileTranslated = false; mConfigFileTranslated = false; mIRITranslated = false; } CCommandLinePreparationTranslator::~CCommandLinePreparationTranslator() { } QStringList CCommandLinePreparationTranslator::translateArguments(int argc, char *argv[]) { QStringList argList; for (int i = 0; i < argc; ++i) { QString argumentText = QString(argv[i]); argList.append(argumentText); } return translateArguments(argList); } QStringList CCommandLinePreparationTranslator::combineTranslatedArguments() { QStringList translatedArgList; if (!mHelpRequested) { if (mLogConfList.isEmpty()) { mLogConfList.append(QString("-ConfigurableCoutLogObserverLoader -LoggerConfigurationLoader")); } translatedArgList += mLogConfList; translatedArgList += mGeneralConfList; translatedArgList += QString("-DefaultReasonerLoader "); translatedArgList += mReasonerConfList; translatedArgList += mGeneralConfList; if (!mConfigConfList.isEmpty()) { translatedArgList += QString("-%1BatchFileLoader +=Konclude.%1.CloseAfterProcessedRequest=false +=Konclude.%1.BlockUntilProcessedRequest=true").arg(mInterfaceTypeString); translatedArgList += mConfigConfList; } translatedArgList += QString("-%1 +=Konclude.%2.CloseAfterProcessedRequest=true").arg(mLoaderTypeString).arg(mInterfaceTypeString); if (mExtendendLogging) { translatedArgList += QString("+=Konclude.OWLlink.LoggingExtendedProcessingTimes=true").arg(mInterfaceTypeString); } translatedArgList += mRequestConfList; translatedArgList += mMiscellaneousList; } else { translatedArgList += QString("-ConfigurableCoutLogObserverLoader -CommandLineTranlatorHelpLoader"); } return translatedArgList; } QStringList CCommandLinePreparationTranslator::translateArguments(const QStringList& argList) { QStringList processList(argList); if (processList.count() <= 0) { mHelpRequested = true; } while (processList.count() > 0) { QString arg = processList.takeFirst(); translate(arg,processList); } if (mGenerateAutoResponseFile) { QString responseFile = mRequestFileName; if (responseFile.indexOf("request.xml") >= 0) { responseFile.replace("request.xml","response.xml"); } else if (responseFile.indexOf(".xml") >= 0) { responseFile.replace(".xml","-response.xml"); } else { responseFile.append("-response.xml"); } mRequestConfList.append(QString("+Load.%1.ResponseFile=%2").arg(mInterfaceTypeString).arg(responseFile)); } QStringList translatedArgList; if (!mSkipTranslation) { translatedArgList = combineTranslatedArguments(); } else { translatedArgList = argList; } return translatedArgList; } bool CCommandLinePreparationTranslator::translate(const QString& argumentText, QStringList& remainingArgList) { bool argumentTranslated = false; QString modArgText = argumentText.trimmed(); if (!mSkipTranslation) { if (modArgText.indexOf("-") == 0) { while (modArgText.startsWith("-")) { modArgText.remove(0,1); modArgText = modArgText.trimmed(); } if (mLoaderFac->canCreateLoaderFromName(modArgText)) { argumentTranslated = true; } else if (modArgText.indexOf("s") == 0 || modArgText.indexOf("S") == 0) { mSkipTranslation = true; argumentTranslated = true; } else if (modArgText.indexOf("v") == 0 || modArgText.indexOf("V") == 0) { mExtendendLogging = true; argumentTranslated = true; } else if (modArgText.indexOf("u") == 0 || modArgText.indexOf("U") == 0) { mExtendendLogging = true; argumentTranslated = true; mLogConfList += QString("-CoutLogObserverLoader -LoggerConfigurationLoader"); } else if (modArgText.indexOf("h") == 0 || modArgText.indexOf("H") == 0) { mHelpRequested = true; argumentTranslated = true; } else if (modArgText.indexOf("e") == 0 || modArgText.indexOf("E") == 0) { mReasonerConfList.append(QString("+Konclude.Execution.DefaultReasonerManager=ASExperimentalReasonerManager")); argumentTranslated = true; } else if (modArgText.indexOf("a") == 0 || modArgText.indexOf("A") == 0) { mReasonerConfList.append(QString("+Konclude.Execution.DefaultReasonerManager=ASAnalyseReasonerManager")); argumentTranslated = true; } else if (modArgText.indexOf("w") == 0 || modArgText.indexOf("W") == 0) { // worker count QString configVal = "AUTO"; if (remainingArgList.count() > 0) { configVal = remainingArgList.first(); if (configVal.trimmed().indexOf("-") == 0 || configVal.trimmed().indexOf("+") == 0) { configVal = "AUTO"; } else { remainingArgList.removeFirst(); } } mReasonerConfList.append(QString("+Konclude.Calculation.ProcessorCount=%1").arg(configVal)); argumentTranslated = true; } else if (modArgText.indexOf("q") == 0 || modArgText.indexOf("Q") == 0 || modArgText.indexOf("i") == 0 || modArgText.indexOf("I") == 0) { // query/input file QString configVal = "request.xml"; if (remainingArgList.count() > 0) { configVal = remainingArgList.takeFirst(); } mRequestFileName = configVal.trimmed(); mRequestConfList.append(QString("+Konclude.%1.RequestFile=%2").arg(mInterfaceTypeString).arg(configVal.trimmed())); argumentTranslated = true; mRequestFileTranslated = true; } else if (modArgText.indexOf("c") == 0 || modArgText.indexOf("C") == 0) { // owllink query file QString configVal = "config.xml"; if (remainingArgList.count() > 0) { configVal = remainingArgList.takeFirst(); } mConfigConfList.append(QString("+Konclude.OWLlink.RequestFile=%1").arg(configVal.trimmed())); argumentTranslated = true; mConfigFileTranslated = true; } else if (modArgText.indexOf("r") == 0 || modArgText.indexOf("R") == 0 || modArgText.indexOf("o") == 0 || modArgText.indexOf("O") == 0) { // response/output file argumentTranslated = true; QString configVal = "response.xml"; if (remainingArgList.count() > 0) { configVal = remainingArgList.first(); if (configVal.trimmed().indexOf("-") == 0 || configVal.trimmed().indexOf("+") == 0) { mGenerateAutoResponseFile = true; } else { mGenerateAutoResponseFile = false; } } else { mGenerateAutoResponseFile = true; } if (!mGenerateAutoResponseFile) { mRequestConfList.append(QString("+Konclude.%1.ResponseFile=%2").arg(mInterfaceTypeString).arg(configVal.trimmed())); } mResponseFileTranslated = true; } else if (modArgText.indexOf("x") == 0 || modArgText.indexOf("X") == 0) { // port QString iriVal = ""; if (remainingArgList.count() > 0) { iriVal = remainingArgList.takeFirst(); } mRequestConfList.append(QString("+Konclude.%1.IRIName=%2").arg(mInterfaceTypeString).arg(iriVal.trimmed())); argumentTranslated = true; mIRITranslated = true; } } else if (modArgText.indexOf("+") == 0) { mGeneralConfList.append(modArgText); while (!remainingArgList.isEmpty() && !remainingArgList.first().startsWith("+") && !remainingArgList.first().startsWith("-")) { mGeneralConfList.append(remainingArgList.takeFirst()); } argumentTranslated = true; } } return argumentTranslated; } }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIClassificationComandLinePreparationTranslator.hKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIClassificationComandLinePrep0000644000175000017500000000503012520756354032071 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLICLASSIFICATIONCOMANDLINEPREPARATIONTRANSLATOR_H #define KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLICLASSIFICATIONCOMANDLINEPREPARATIONTRANSLATOR_H // Libraries includes #include #include #include // Namespace includes #include "CCLIComandLinePreparationTranslator.h" // Other includes #include "Control/Loader/CLoaderFactory.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { using namespace Loader; namespace Interface { namespace CommandLine { /*! * * \class CCLIClassificationComandLinePreparationTranslator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCLIClassificationComandLinePreparationTranslator : public CCLIComandLinePreparationTranslator { // public methods public: //! Constructor CCLIClassificationComandLinePreparationTranslator(CLoaderFactory *loaderFactory); //! Destructor virtual ~CCLIClassificationComandLinePreparationTranslator(); virtual bool canTranslate(const QString& string); virtual bool hasNeccessaryParameters(); // protected methods protected: virtual bool translate(const QString& argumentText, QStringList& remainingArgList); // protected variables protected: CLoaderFactory *loaderFac; // private methods private: // private variables private: }; }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLICLASSIFICATIONCOMANDLINEPREPARATIONTRANSLATOR_H ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIClassificationComandLinePreparationTranslator.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIClassificationComandLinePrep0000644000175000017500000000567512520756354032110 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCLIClassificationComandLinePreparationTranslator.h" namespace Konclude { namespace Control { namespace Interface { namespace CommandLine { CCLIClassificationComandLinePreparationTranslator::CCLIClassificationComandLinePreparationTranslator(CLoaderFactory *loaderFactory) : CCLIComandLinePreparationTranslator(loaderFactory) { mOperationTypeString = QString("Classification"); mMinNecessaryArguments = true; mFirstArgumentTranslation = false; mLoaderTypeString = QString("-CLIClassificationBatchProcessingLoader"); } CCLIClassificationComandLinePreparationTranslator::~CCLIClassificationComandLinePreparationTranslator() { } bool CCLIClassificationComandLinePreparationTranslator::hasNeccessaryParameters() { bool minNecessaryArguments = true; if (!mFirstArgumentTranslation) { minNecessaryArguments = false; } if (!mRequestFileTranslated) { LOG(ERROR,getLogDomain(),logTr("%1 request file not specified.").arg(mOperationTypeString),this); minNecessaryArguments = false; } return minNecessaryArguments; } bool CCLIClassificationComandLinePreparationTranslator::translate(const QString& argumentText, QStringList& remainingArgList) { bool argumentTranslated = false; QString modArgText = argumentText.trimmed(); if (!mSkipTranslation) { if (CCommandLinePreparationTranslator::translate(argumentText,remainingArgList)) { argumentTranslated = true; } else { if (modArgText.indexOf("-") == 0) { } else if (modArgText == "classification" || modArgText == "classify") { argumentTranslated = true; mFirstArgumentTranslation = true; } } } return argumentTranslated; } bool CCLIClassificationComandLinePreparationTranslator::canTranslate(const QString& string) { if (QString::compare(string,"classification",Qt::CaseInsensitive) == 0 || QString::compare(string,"classify",Qt::CaseInsensitive) == 0) { return true; } return false; } }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIComandLinePreparationTranslator.hKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCLIComandLinePreparationTransla0000644000175000017500000000517712520756354032134 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLICOMANDLINEPREPARATIONTRANSLATOR_H #define KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLICOMANDLINEPREPARATIONTRANSLATOR_H // Libraries includes #include #include #include // Namespace includes #include "CCommandLinePreparationTranslator.h" // Other includes #include "Control/Loader/CLoaderFactory.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { using namespace Loader; namespace Interface { namespace CommandLine { /*! * * \class CCLIComandLinePreparationTranslator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCLIComandLinePreparationTranslator : public CCommandLinePreparationTranslator { // public methods public: //! Constructor CCLIComandLinePreparationTranslator(CLoaderFactory *loaderFactory); //! Destructor virtual ~CCLIComandLinePreparationTranslator(); virtual QStringList combineTranslatedArguments(); virtual bool canTranslate(const QString& string); virtual bool hasNeccessaryParameters() = 0; // protected methods protected: virtual bool translate(const QString& argumentText, QStringList& remainingArgList); // protected variables protected: CLoaderFactory *loaderFac; bool mMinNecessaryArguments; bool mFirstArgumentTranslation; QString mOperationTypeString; QString mLoaderTypeString; // private methods private: // private variables private: }; }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCLICOMANDLINEPREPARATIONTRANSLATOR_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCommandLinePreparationTranslatorSelector.hKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCommandLinePreparationTranslato0000644000175000017500000000564112520756354032320 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCOMMANDLINEPREPARATIONTRANSLATORSELECTOR_H #define KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCOMMANDLINEPREPARATIONTRANSLATORSELECTOR_H // Libraries includes #include #include #include // Namespace includes #include "CCommandLinePreparationTranslator.h" #include "COWLLinkServerComandLinePreparationTranslator.h" #include "COWLLinkFileComandLinePreparationTranslator.h" #include "CCLIClassificationComandLinePreparationTranslator.h" #include "CCLIConsistencyComandLinePreparationTranslator.h" #include "CCLISatisfiabilityComandLinePreparationTranslator.h" #include "CCLIRealizationComandLinePreparationTranslator.h" // Other includes #include "Control/Loader/CLoaderFactory.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { using namespace Loader; namespace Interface { namespace CommandLine { /*! * * \class CCommandLinePreparationTranslatorSelector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommandLinePreparationTranslatorSelector : public CLogIdentifier { // public methods public: //! Constructor CCommandLinePreparationTranslatorSelector(CLoaderFactory *loaderFactory); //! Destructor virtual ~CCommandLinePreparationTranslatorSelector(); virtual QStringList translateArguments(const QStringList& argList); virtual CCommandLinePreparationTranslator* getCommandLinePreparationTranslator(const QString& commandString); // protected methods protected: // protected variables protected: CLoaderFactory* mLoaderFactory; QList mTranslatorList; // private methods private: // private variables private: }; }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_INTERFACE_COMMANDLINE_CCOMMANDLINEPREPARATIONTRANSLATORSELECTOR_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCommandLinePreparationTranslatorSelector.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Interface/CommandLine/CCommandLinePreparationTranslato0000644000175000017500000000721112520756354032313 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandLinePreparationTranslatorSelector.h" namespace Konclude { namespace Control { namespace Interface { namespace CommandLine { CCommandLinePreparationTranslatorSelector::CCommandLinePreparationTranslatorSelector(CLoaderFactory *loaderFactory) : CLogIdentifier("::Konclude::Loader::CommandLineTranslatorSelector",this) { mLoaderFactory = loaderFactory; mTranslatorList.append(new COWLLinkServerComandLinePreparationTranslator(loaderFactory)); mTranslatorList.append(new COWLLinkFileComandLinePreparationTranslator(loaderFactory)); mTranslatorList.append(new CCLIClassificationComandLinePreparationTranslator(loaderFactory)); mTranslatorList.append(new CCLIConsistencyComandLinePreparationTranslator(loaderFactory)); mTranslatorList.append(new CCLISatisfiabilityComandLinePreparationTranslator(loaderFactory)); mTranslatorList.append(new CCLIRealizationComandLinePreparationTranslator(loaderFactory)); } CCommandLinePreparationTranslatorSelector::~CCommandLinePreparationTranslatorSelector() { } QStringList CCommandLinePreparationTranslatorSelector::translateArguments(const QStringList& argList) { QStringList processList(argList); QStringList translatedArgList; if (!processList.isEmpty()) { QString commandString = processList.first(); CCommandLinePreparationTranslator* translator = getCommandLinePreparationTranslator(commandString); if (translator) { translatedArgList = translator->translateArguments(processList); } else { QString loaderString = commandString.replace("-",""); if (mLoaderFactory->canCreateLoaderFromName(loaderString)) { translatedArgList = argList; } else { translatedArgList += QString("-ConfigurableCoutLogObserverLoader"); translatedArgList += QString("-CommandLineTranlatorHelpLoader"); } } } if (translatedArgList.isEmpty()) { translatedArgList += QString("-ConfigurableCoutLogObserverLoader"); translatedArgList += QString("-CommandLineTranlatorHelpLoader"); } return translatedArgList; } CCommandLinePreparationTranslator* CCommandLinePreparationTranslatorSelector::getCommandLinePreparationTranslator(const QString& commandString) { CCommandLinePreparationTranslator* selectedTranslator = nullptr; for (QList::const_iterator it = mTranslatorList.constBegin(), itEnd = mTranslatorList.constEnd(); !selectedTranslator && it != itEnd; ++it) { CCommandLinePreparationTranslator* translator = (*it); if (translator && translator->canTranslate(commandString)) { selectedTranslator = translator; } } return selectedTranslator; } }; // end namespace CommandLine }; // end namespace Interface }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/0000755000175000017500000000000012613407250021110 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCommandLineLoader.cpp0000644000175000017500000002571712520756356025263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandLineLoader.h" namespace Konclude { namespace Control { namespace Loader { CCommandLineLoader::CCommandLineLoader() : CThread("CommandLineLoader") { } QStringList CCommandLineLoader::getEncodedArguments(int argc, char *argv[], bool skipFirst, bool encodeSpaces) { QString argString; int startArg = 0; if (skipFirst) { startArg = 1; } for (int i = startArg; i < argc; ++i) { if (!argString.isEmpty()) { argString += QString(" "); } QString translatedArgString = QString::fromUtf8(argv[i]); //QString translatedArgString = QString::fromLocal8Bit(argv[i]).trimmed(); if (translatedArgString.contains(" ") && encodeSpaces) { argString += QString("\"%1\"").arg(translatedArgString); } else { argString += QString("%1").arg(translatedArgString); } } QString encodedString; bool encodeModus = false; for (QString::const_iterator it = argString.constBegin(), itEnd = argString.constEnd(); it != itEnd; ++it) { QChar character(*it); if (character == QChar('"')) { encodeModus = !encodeModus; } else if (character == QChar(' ') && encodeModus) { encodedString += QString("?_"); //} else if (character == QChar('=') && encodeModus) { // encodedString += QString("?~"); } else if (character == QChar('?')) { encodedString += QString("??"); } else { encodedString += character; } } while (encodedString.contains(" ")) { encodedString.replace(" "," "); } QStringList encodedList; if (!encodedString.isEmpty()) { encodedList = encodedString.split(" "); } return encodedList; } QString CCommandLineLoader::getDecodedArgument(const QString& string) { QString decodedString; for (QString::const_iterator it = string.constBegin(), itEnd = string.constEnd(); it != itEnd; ++it) { QChar character(*it); if (character == QChar('?')) { ++it; QChar nextCharacter(*it); if (nextCharacter == QChar('?')) { decodedString += QString("?"); } else if (nextCharacter == QChar('_')) { decodedString += QString(" "); //} else if (nextCharacter == QChar('~')) { // decodedString += QString("="); } } else { decodedString += character; } } return decodedString; } CCommandLineLoader::CCommandLineLoader(int argc, char *argv[], bool qtGUIApplication) : CThread("CommandLineLoader") { for (int i = 0; i < argc; ++i) { commandLineParameters.append(argv[i]); } qtGuiUsable = qtGUIApplication; } CCommandLineLoader::CCommandLineLoader(const QStringList &argList, bool qtGUIApplication) : CThread("CommandLineLoader") { foreach (QString arg, argList) { commandLineParameters.append(arg); } qtGuiUsable = qtGUIApplication; } CCommandLineLoader::~CCommandLineLoader() { qDeleteAll(loaderContainer); qDeleteAll(configContainer); } CLoader *CCommandLineLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { configuration = config; lFactory = loaderFactory; qint64 paramCount = commandLineParameters.count(); CConfigurationGroup *reasonerConfigGroup = 0; if (configuration) { reasonerConfigGroup = configuration->getConfigurationGroup(); } else { reasonerConfigGroup = CSingletonProvider::getInstance()->getReferencedConfigurationGroup(); configuration = new CConfiguration(reasonerConfigGroup); } reasonerConfigGroup->addConfigProperty(new CConfigDescription("Konclude.Execution.CommandLine.ParameterCount","",new CIntegerConfigType(paramCount))); QString text; QStringList::const_iterator it = commandLineParameters.constBegin(); for (qint64 i = 0; i < paramCount && it != commandLineParameters.constEnd(); ++i,++it) { text += (*it) + " "; reasonerConfigGroup->addConfigProperty(new CConfigDescription(QString("Konclude.Execution.CommandLine.Parameter%1").arg(i),"",new CStringConfigType(getDecodedArgument(*it)))); } reasonerConfigGroup->addConfigProperty(new CConfigDescription("Konclude.Execution.CommandLine.Text","",new CStringConfigType(getDecodedArgument(text)))); configuration->extendConfigurationGroup(reasonerConfigGroup); qint64 nextPos = getFirstTextOccur(text,"-"); QStringList matchesList(getMatchesFromPattern("(\\+\\=\\s*(\\w+\\.?)+\\s*\\=\\s*\\S+)",text,nextPos)); foreach (QString configString, matchesList) { setConfiguration(configString,configuration,true); } loadingText = text.mid(nextPos); QString nextLoadingText = loadingText; bool oneLoadingSuccess = false; while (!nextLoadingText.isEmpty()) { qint64 nextLoadingPos = getFirstTextOccur(nextLoadingText," -",1); qint64 nextConfigPos = qMin(getFirstTextOccur(nextLoadingText,"+",1),nextLoadingPos-1); QStringList loadStringList = getMatchesFromPattern("(-\\s*\\w+\\s+)",nextLoadingText,nextConfigPos); QString loadString; if (loadStringList.count() > 0) { loadString = loadStringList.first(); } QStringList matchesList(getMatchesFromPattern("(\\+\\=\\s*(\\w+\\.?)+\\s*\\=\\s*\\S+)",nextLoadingText,nextLoadingPos)); foreach (QString configString, matchesList) { setConfiguration(configString,configuration,true); } if (!loadString.isEmpty()) { loadString = loadString.remove("-"); loadString = loadString.trimmed(); CLoader *loader = lFactory->createLoaderFromName(loadString); if (loader) { oneLoadingSuccess = true; CConfiguration *loadConfiguration = new CConfiguration(configuration); configContainer.append(loadConfiguration); loaderContainer.append(loader); QStringList matchesList(getMatchesFromPattern("(\\+\\s*(\\w+\\.?)+\\s*\\=\\s*\\S+)",nextLoadingText,nextLoadingPos)); foreach (QString configString, matchesList) { setConfiguration(configString,loadConfiguration); } loader->init(lFactory,loadConfiguration); } else { LOG(ERROR,"::Konclude::Loader::CommandLineLoader",logTr("No Loader for '%1' available.").arg(loadString),0); } } nextLoadingText = nextLoadingText.mid(nextLoadingPos); } if (!oneLoadingSuccess) { LOG(ERROR,"::Konclude::Loader::CommandLineLoader",logTr("No loader specified for '%1'.").arg(commandLineParameters.join(", ")),0); CLoader *loader1 = lFactory->createLoaderFromName("ConfigurableCoutLogObserverLoader"); CLoader *loader2 = lFactory->createLoaderFromName("CommandLineTranlatorHelpLoader"); loaderContainer.append(loader1); loaderContainer.append(loader2); } return this; } QStringList CCommandLineLoader::getMatchesFromPattern(const QString &pattern, const QString &text, qint64 maxPosition) { QStringList list; QRegExp configExp(pattern); int pos = 0; while ((pos = configExp.indexIn(text,pos)) != -1 && pos <= maxPosition) { list << configExp.cap(1); pos += configExp.matchedLength(); } return list; } qint64 CCommandLineLoader::getFirstTextOccur(const QString &text, const QString &textOccur, qint64 beginSearchPos) { qint64 pos = text.indexOf(textOccur,beginSearchPos); if (pos == -1) { pos = text.length(); } return pos; } QStringList CCommandLineLoader::getMatchesFromPattern(const QString &pattern, const QString &text) { return getMatchesFromPattern(pattern,text,text.length()); } CCommandLineLoader *CCommandLineLoader::setConfiguration(const QString &configString, CConfiguration *configuration, bool equalsConfSet) { QRegExp probNameRegExp; if (equalsConfSet) { probNameRegExp = QRegExp("(\\+\\=\\s*(\\w+\\.?)+\\s*\\=\\s*)"); } else { probNameRegExp = QRegExp("(\\+\\s*(\\w+\\.?)+\\s*\\=\\s*)"); } probNameRegExp.indexIn(configString); QString name = probNameRegExp.cap(1); name = name.remove("+"); name = name.remove("="); name = name.trimmed(); qint64 lastEqIdx = configString.lastIndexOf("="); QString dat = configString.mid(lastEqIdx); dat = dat.remove("="); dat = dat.trimmed(); CConfigurationGroup *configGroup = configuration->getConfigurationGroup(); QString decodedConfigName = getDecodedArgument(name); QString decodedConfigData = getDecodedArgument(dat); if (!decodedConfigName.isEmpty()) { if (!configGroup->getConfigDescription(decodedConfigName) && decodedConfigName.startsWith("Load.")) { configGroup = configGroup->getReferencedConfigurationGroup(); CConfigType *configType = new CStringConfigType(); CConfigDescription *configDes = new CConfigDescription(decodedConfigName,"",configType); CConfigData *confData = new CConfigData(configDes,configType->getTypeCopy()); confData->readFromString(decodedConfigData); configGroup->addConfigProperty(configDes,confData); configuration->extendConfigurationGroup(configGroup); } else { CConfigDescription *conDes = configGroup->getConfigDescription(decodedConfigName); if (conDes) { if (conDes->supportsStringConvertion()) { CConfigData *confData = configuration->createAndSetConfig(decodedConfigName); if (confData) { confData->readFromString(decodedConfigData); } } else { LOG(ERROR,"::Konclude::Loader::CommandLineLoader",logTr("Configuration '%1' couldn't parsed from string.").arg(decodedConfigName),0); } } else { LOG(ERROR,"::Konclude::Loader::CommandLineLoader",logTr("Configuration '%1' not supported.").arg(decodedConfigName),0); } } } return this; } CLoader *CCommandLineLoader::load() { startThread(); return this; } CLoader *CCommandLineLoader::exit() { stopThread(); return this; } void CCommandLineLoader::threadStarted() { containerSync.lock(); foreach (CLoader *loader, loaderContainer) { loader->load(); } containerSync.unlock(); } void CCommandLineLoader::threadStopped() { containerSync.lock(); foreach (CLoader *loader, loaderContainer) { loader->exit(); } containerSync.unlock(); } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CTransitiveConnectedELClassesTestDataGeneratorLoader.hKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CTransitiveConnectedELClassesTestDataGeneratorL0000644000175000017500000000464712520756362032310 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CTRANSITIVECONNECTEDELCLASSESTESTDATAGENERATORLOADER_H #define KONCLUDE_CONTROL_LOADER_CTRANSITIVECONNECTEDELCLASSESTESTDATAGENERATORLOADER_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" // Other includes #include "Test/COWLTransitiveConnectedELClassesTestDataGenerator.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Test; using namespace Concurrent; namespace Control { namespace Loader { /*! * * \class CTransitiveConnectedELClassesTestDataGeneratorLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTransitiveConnectedELClassesTestDataGeneratorLoader : public CLoader { // public methods public: //! Constructor CTransitiveConnectedELClassesTestDataGeneratorLoader(); //! Destructor virtual ~CTransitiveConnectedELClassesTestDataGeneratorLoader(); virtual CLoader* init(CLoaderFactory* loaderFactory = 0, CConfiguration* config = 0); virtual CLoader* load(); virtual CLoader* exit(); // protected methods protected: // protected variables protected: CConfiguration* mConfiguration; COWLTransitiveConnectedELClassesTestDataGenerator* generator; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CTRANSITIVECONNECTEDELCLASSESTESTDATAGENERATORLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CORECoutLogObserverLoader.h0000644000175000017500000000425212520756360026156 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CORECOUTLOGOBSERVERLOADER_H #define KONCLUDE_CONTROL_LOADER_CORECOUTLOGOBSERVERLOADER_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" // Other includes #include "Utilities/CSingletonProvider.hpp" // Logger includes #include "Logger/CLogger.h" #include "Logger/CConsolePrintConfigurableLogObserver.h" namespace Konclude { using namespace Logger; using namespace Utilities; namespace Control { namespace Loader { /*! * * \class CORECoutLogObserverLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CORECoutLogObserverLoader : public CLoader { // public methods public: //! Constructor CORECoutLogObserverLoader(); //! Destructor virtual ~CORECoutLogObserverLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: // protected variables protected: CConsolePrintConfigurableLogObserver *consoleSingletonLogObserver; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CORECOUTLOGOBSERVERLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCLISatisfiabilityBatchProcessingLoader.cpp0000644000175000017500000000771212520756356031377 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCLISatisfiabilityBatchProcessingLoader.h" namespace Konclude { namespace Control { namespace Loader { CCLISatisfiabilityBatchProcessingLoader::CCLISatisfiabilityBatchProcessingLoader() { } CCLISatisfiabilityBatchProcessingLoader::~CCLISatisfiabilityBatchProcessingLoader() { } void CCLISatisfiabilityBatchProcessingLoader::createTestingCommands() { createSatisfiabilityTesingCommands(); } void CCLISatisfiabilityBatchProcessingLoader::createSatisfiabilityTesingCommands() { logOutputMessage(QString("Starting satisfiability checking for '%1'.").arg(mRequestFileString)); QString testKB = QString("http://konclude.com/test/kb"); CCreateKnowledgeBaseCommand* createKBCommand = new CCreateKnowledgeBaseCommand(testKB); QStringList ontoIRIList; ontoIRIList.append(mRequestFileString); //CLoadKnowledgeBaseOWLXMLOntologyCommand* loadKBCommand = new CLoadKnowledgeBaseOWLXMLOntologyCommand(testKB,ontoIRIList); CLoadKnowledgeBaseOWLAutoOntologyCommand* loadKBCommand = new CLoadKnowledgeBaseOWLAutoOntologyCommand(testKB,ontoIRIList); CProcessClassNameSatisfiableQueryCommand* consistencyKBCommand = new CProcessClassNameSatisfiableQueryCommand(testKB,mIRINameString); addProcessingCommand(createKBCommand); addProcessingCommand(loadKBCommand); addProcessingCommand(consistencyKBCommand,false,"",true,mResponseFileString); processNextCommand(); } void CCLISatisfiabilityBatchProcessingLoader::writeCommandOutput(const QString& outputFileName, CCommand* processedCommand) { bool outputWritten = false; CKnowledgeBaseQueryCommand* kbQueryCommand = dynamic_cast(processedCommand); if (kbQueryCommand) { CQuery* query = kbQueryCommand->getCalculateQueryCommand()->getQuery(); if (query) { CQueryResult* queryResult = query->getQueryResult(); if (queryResult) { CBooleanQueryResult* boolQueryResult = dynamic_cast(queryResult); if (boolQueryResult) { outputWritten = true; if (boolQueryResult->getResult() == true) { logOutputMessage(QString("Class '%1' for ontology '%2' is satisfiable.").arg(mIRINameString).arg(mRequestFileString)); } else { logOutputMessage(QString("Class '%1' for ontology '%2' is not satisfiable.").arg(mIRINameString).arg(mRequestFileString)); } if (!outputFileName.isEmpty()) { forcedPathCreated(outputFileName); QFile outputFile(outputFileName); if (outputFile.open(QIODevice::WriteOnly)) { QString outputData; if (boolQueryResult->getResult() == true) { outputData = QString("true\n"); } else { outputData = QString("false\n"); } outputFile.write(outputData.toUtf8()); outputFile.close(); } else { logOutputError(QString("Failed writing output to file '%1'.").arg(outputFileName)); } } } } } } if (!outputWritten) { logOutputError("Satisfiability checking failed."); } } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/COWLlinkBatchFileLoader.h0000644000175000017500000000555512520756360025614 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_COWLLINKBATCHFILELOADER_H #define KONCLUDE_Control_LOADER_COWLLINKBATCHFILELOADER_H // Libraries includes #include #include #include //#include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CLoaderFactory.h" // Other includes #include "Control/Interface/OWLlink/COWLlinkProcessor.h" #include "Control/Interface/OWLlink/COWLLinkRecordInterpreter.h" #include "Control/Command/CConfigManagerReader.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; namespace Control { using namespace Interface::OWLlink; using namespace Command; namespace Loader { /*! * * \class COWLlinkBatchFileLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLlinkBatchFileLoader : public CLoader, public COWLlinkProcessor { // public methods public: //! Constructor COWLlinkBatchFileLoader(); //! Destructor virtual ~COWLlinkBatchFileLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: virtual COWLlinkProcessor *initializeOWLlinkContent(); virtual COWLlinkProcessor *concludeOWLlinkContent(); virtual CConfiguration *getConfiguration(); // protected variables protected: QString reqFileString; QString resFileString; bool directConsoleOutput; bool directErrorOutput; bool closeAfterOutput; bool blockUntilProcessed; QTime mResponseTime; QSemaphore blockingSem; COWLLinkRecordInterpreter *owllinkInterpreter; CConfiguration *loaderConfig; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_COWLLINKBATCHFILELOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CPigenholePrincipleGeneratorLoader.cpp0000644000175000017500000000371312520756360030507 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPigenholePrincipleGeneratorLoader.h" namespace Konclude { namespace Control { namespace Loader { CPigenholePrincipleGeneratorLoader::CPigenholePrincipleGeneratorLoader() { mConfiguration = 0; generator = 0; } CPigenholePrincipleGeneratorLoader::~CPigenholePrincipleGeneratorLoader() { } CLoader* CPigenholePrincipleGeneratorLoader::init(CLoaderFactory* loaderFactory, CConfiguration* config) { mConfiguration = config; return this; } CLoader *CPigenholePrincipleGeneratorLoader::load() { generator = new COWLPigeonholePrincipleGenerator(); QString filename = CConfigDataReader::readConfigString(mConfiguration,"Konclude.Test.PigeonholePrincipleGenerator.OWLlinkOutputFile","PHP-request-file.xml"); cint64 probSize = CConfigDataReader::readConfigInteger(mConfiguration,"Konclude.Test.PigeonholePrincipleGenerator.ProblemSize",2); generator->generatePigeonholePrinciple(probSize,filename); delete generator; return this; } CLoader* CPigenholePrincipleGeneratorLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CTestTaskThroughputLoader.cpp0000644000175000017500000000331112520756362026710 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTestTaskThroughputLoader.h" namespace Konclude { namespace Control { namespace Loader { CTestTaskThroughputLoader::CTestTaskThroughputLoader() { mConfiguration = 0; tester = 0; } CTestTaskThroughputLoader::~CTestTaskThroughputLoader() { } CLoader* CTestTaskThroughputLoader::init(CLoaderFactory* loaderFactory, CConfiguration* config) { mConfiguration = config; return this; } CLoader *CTestTaskThroughputLoader::load() { tester = new CConcurrentThroughputTestTaskTester(); tester->generateTestingStructure(20,2); cout<<"Starting concurrent Task-Throughput Test.\n"; tester->startTesting(); return this; } CLoader* CTestTaskThroughputLoader::exit() { tester->stopTesting(); if (tester) { delete tester; } return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CLoggerConfigurationLoader.h0000644000175000017500000000404012520756360026466 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CLOGGERCONFIGURATIONLOADER_H #define KONCLUDE_CONTROL_LOADER_CLOGGERCONFIGURATIONLOADER_H // Libraries includes #include // Namespace includes #include "CLoader.h" // Other includes #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Control { namespace Loader { /*! * * \class CLoggerConfigurationLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLoggerConfigurationLoader : public CLoader { // public methods public: //! Constructor CLoggerConfigurationLoader(); //! Destructor virtual ~CLoggerConfigurationLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: // protected variables protected: CConfiguration* mLoaderConfig; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CLOGGERCONFIGURATIONLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/COWLFilesOWLlinkTestcaseGeneratorLoader.cpp0000644000175000017500000003571412573743334031322 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLFilesOWLlinkTestcaseGeneratorLoader.h" namespace Konclude { namespace Control { namespace Loader { COWLFilesOWLlinkTestcaseGeneratorLoader::COWLFilesOWLlinkTestcaseGeneratorLoader() { loaderConfig = nullptr; } COWLFilesOWLlinkTestcaseGeneratorLoader::~COWLFilesOWLlinkTestcaseGeneratorLoader() { } CLoader *COWLFilesOWLlinkTestcaseGeneratorLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { loaderConfig = config; mInputDir = CConfigDataReader::readConfigString(config,"Konclude.Test.Generator.InputDirectory"); mOutputDir = CConfigDataReader::readConfigString(config,"Konclude.Test.Generator.OutputDirectory"); mFilterDir = CConfigDataReader::readConfigString(config,"Konclude.Test.Generator.FilterDirectory"); mConfCreateClassifyTests = CConfigDataReader::readConfigBoolean(config,"Konclude.Test.Generator.GenerateClassifyTests",false); mConfCreateConsistencyTests = CConfigDataReader::readConfigBoolean(config,"Konclude.Test.Generator.GenerateConsistencyTests",false); mConfCreateSatisfiabilityTests = CConfigDataReader::readConfigBoolean(config,"Konclude.Test.Generator.GenerateSatisfiabilityTests",false); mConfCreateTypeTests = CConfigDataReader::readConfigBoolean(config,"Konclude.Test.Generator.GenerateTypeTests",false); mConfCreateRealizeTests = CConfigDataReader::readConfigBoolean(config,"Konclude.Test.Generator.GenerateRealizeTests",false); mOutputDirClassify = mOutputDir+"Classification/"; mOutputDirConsistency = mOutputDir+"Consistency/"; mOutputDirSatisfiability = mOutputDir+"Satisfiability/"; mOutputDirTypes = mOutputDir+"Types/"; mOutputDirRealize = mOutputDir+"Realization/"; mConfCreateIncAssConsistencyTests = CConfigDataReader::readConfigBoolean(config,"Konclude.Test.Generator.GenerateIncrementalAssertionConsistencyTests",false); mIncAssConsistencyAdditionCount = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionConsistencyTestsGeneration.AssertionAdditionCount",10); mIncAssConsistencyRemovalCount = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionConsistencyTestsGeneration.AssertionRemovalCount",10); mIncAssConsTestCount = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionConsistencyTestsGeneration.TestCount",10); mConfCreateIncAssConsistencyByRatio = CConfigDataReader::readConfigBoolean(config,"Konclude.Test.Generator.IncrementalAssertionConsistencyTestsGeneration.RatioAdditionRemoval",false); mIncAssConsistencyAdditionCountRatioDenominator = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionConsistencyTestsGeneration.AssertionAdditionRatioDenominator",1000); mIncAssConsistencyRemovalCountRatioDenominator = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionConsistencyTestsGeneration.AssertionRemovalRatioDenominator",1000); mOutputDirIncAssConsistency = mOutputDir+QString("Incremental/NumberAssertionsAddedRemoved/Consistency/#A%1/#R%2/").arg(mIncAssConsistencyAdditionCount).arg(mIncAssConsistencyRemovalCount); if (mConfCreateIncAssConsistencyByRatio) { mOutputDirIncAssConsistency = mOutputDir+QString("Incremental/RatioAssertionsAddedRemoved/Consistency/A%1of%2/R%3of%4/").arg(mIncAssConsistencyAdditionCount).arg(mIncAssConsistencyAdditionCountRatioDenominator).arg(mIncAssConsistencyRemovalCount).arg(mIncAssConsistencyRemovalCountRatioDenominator); } mConfCreateIncAssClassificationTests = CConfigDataReader::readConfigBoolean(config,"Konclude.Test.Generator.GenerateIncrementalAssertionClassificationTests",false); mIncAssClassificationAdditionCount = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionClassificationTestsGeneration.AssertionAdditionCount",10); mIncAssClassificationRemovalCount = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionClassificationTestsGeneration.AssertionRemovalCount",10); mIncAssClassificationTestCount = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionClassificationTestsGeneration.TestCount",10); mConfCreateIncAssClassificationByRatio = CConfigDataReader::readConfigBoolean(config,"Konclude.Test.Generator.IncrementalAssertionClassificationTestsGeneration.RatioAdditionRemoval",false); mIncAssClassificationAdditionCountRatioDenominator = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionClassificationTestsGeneration.AssertionAdditionRatioDenominator",1000); mIncAssClassificationRemovalCountRatioDenominator = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionClassificationTestsGeneration.AssertionRemovalRatioDenominator",1000); mOutputDirIncAssClassification = mOutputDir+QString("Incremental/NumberAssertionsAddedRemoved/Classification/#A%1/#R%2/").arg(mIncAssClassificationAdditionCount).arg(mIncAssClassificationRemovalCount); if (mConfCreateIncAssClassificationByRatio) { mOutputDirIncAssClassification = mOutputDir+QString("Incremental/RatioAssertionsAddedRemoved/Classification/A%1of%2/R%3of%4/").arg(mIncAssClassificationAdditionCount).arg(mIncAssClassificationAdditionCountRatioDenominator).arg(mIncAssClassificationRemovalCount).arg(mIncAssClassificationRemovalCountRatioDenominator); } mConfCreateIncAssRealizationTests = CConfigDataReader::readConfigBoolean(config,"Konclude.Test.Generator.GenerateIncrementalAssertionRealizationTests",false); mIncAssRealizationAdditionCount = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionRealizationTestsGeneration.AssertionAdditionCount",10); mIncAssRealizationRemovalCount = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionRealizationTestsGeneration.AssertionRemovalCount",10); mIncAssRealizationTestCount = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionRealizationTestsGeneration.TestCount",10); mConfCreateIncAssRealizationByRatio = CConfigDataReader::readConfigBoolean(config,"Konclude.Test.Generator.IncrementalAssertionRealizationTestsGeneration.RatioAdditionRemoval",false); mIncAssRealizationAdditionCountRatioDenominator = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionRealizationTestsGeneration.AssertionAdditionRatioDenominator",1000); mIncAssRealizationRemovalCountRatioDenominator = CConfigDataReader::readConfigInteger(config,"Konclude.Test.Generator.IncrementalAssertionRealizationTestsGeneration.AssertionRemovalRatioDenominator",1000); mOutputDirIncAssRealization = mOutputDir+QString("Incremental/NumberAssertionsAddedRemoved/Realization/#A%1/#R%2/").arg(mIncAssRealizationAdditionCount).arg(mIncAssRealizationRemovalCount); if (mConfCreateIncAssRealizationByRatio) { mOutputDirIncAssRealization = mOutputDir+QString("Incremental/RatioAssertionsAddedRemoved/Realization/A%1of%2/R%3of%4/").arg(mIncAssRealizationAdditionCount).arg(mIncAssRealizationAdditionCountRatioDenominator).arg(mIncAssRealizationRemovalCount).arg(mIncAssRealizationRemovalCountRatioDenominator); } mSatisfiabilityTestCount = 3; mTypesTestCount = 3; return this; } CLoader* COWLFilesOWLlinkTestcaseGeneratorLoader::generateTestcasesForDirectory(const QString& dirString, const QString& subDirPathString) { QDir inputDir(dirString); foreach (const QString& subDirString, inputDir.entryList(QDir::Dirs)) { if (subDirString != ".." && subDirString != ".") { generateTestcasesForDirectory(dirString+subDirString+"/",subDirPathString+subDirString+"/"); } } if (mFilterDir.isEmpty() || subDirPathString == mFilterDir || subDirPathString.startsWith(mFilterDir)) { foreach (const QString& fileString, inputDir.entryList(QDir::Files)) { QString outFileString = fileString; QDir classifyOutputDir(mOutputDirClassify); QDir consistencyOutputDir(mOutputDirConsistency); QDir satisfiabilityOutputDir(mOutputDirSatisfiability); QDir typeOutputDir(mOutputDirTypes); QDir realizeOutputDir(mOutputDirRealize); QDir consIncAssConsDir(mOutputDirIncAssConsistency); QDir consIncAssClassificationDir(mOutputDirIncAssClassification); QDir consIncAssRealizationDir(mOutputDirIncAssRealization); outFileString = outFileString.replace(".owl.xml",""); QString classifyOutFileString = outFileString+"-classify-request.xml"; QString consistencyOutFileString = outFileString+"-consistency-request.xml"; QString satisfiabilityOutFileString = outFileString+"-satisfiability-%1-request.xml"; QString typeOutFileString = outFileString+"-type-%1-request.xml"; QString realizeOutFileString = outFileString+"-realize-request.xml"; QString incAssConsFileString = outFileString+"-inc-ass-consistency-%1-request.xml"; QString incAssClassificationFileString = outFileString+"-inc-ass-classification-%1-request.xml"; QString incAssRealizationFileString = outFileString+"-inc-ass-realization-%1-request.xml"; if (mConfCreateClassifyTests) { classifyOutputDir.mkpath(subDirPathString); mClassifyGen->generateOWLlinkClassifyRequest(dirString+fileString,mOutputDirClassify+subDirPathString+classifyOutFileString); } if (mConfCreateRealizeTests) { realizeOutputDir.mkpath(subDirPathString); mRealizeGen->generateOWLlinkRealizeRequest(dirString+fileString,mOutputDirRealize+subDirPathString+realizeOutFileString); } if (mConfCreateConsistencyTests) { consistencyOutputDir.mkpath(subDirPathString); mConsistencyGen->generateOWLlinkConsistencyRequest(dirString+fileString,mOutputDirConsistency+subDirPathString+consistencyOutFileString); } if (mConfCreateSatisfiabilityTests) { satisfiabilityOutputDir.mkpath(subDirPathString); mSatisfiabilityGen->generateOWLlinkSatisfiabilityRequests(dirString+fileString,mOutputDirSatisfiability+subDirPathString+satisfiabilityOutFileString,mSatisfiabilityTestCount); } if (mConfCreateTypeTests) { typeOutputDir.mkpath(subDirPathString); mTypesGen->generateOWLlinkTypesRequests(dirString+fileString,mOutputDirTypes+subDirPathString+typeOutFileString,mTypesTestCount); } if (mConfCreateIncAssConsistencyTests) { consIncAssConsDir.mkpath(subDirPathString); if (mConfCreateIncAssConsistencyByRatio) { mIncAssConsistencyGen->generateOWLlinkIncrementalAssertionRequests(dirString+fileString,mOutputDirIncAssConsistency+subDirPathString+incAssConsFileString,(double)mIncAssConsistencyRemovalCount/(double)mIncAssConsistencyRemovalCountRatioDenominator,(double)mIncAssConsistencyAdditionCount/(double)mIncAssConsistencyAdditionCountRatioDenominator,mIncAssConsTestCount); } else { mIncAssConsistencyGen->generateOWLlinkIncrementalAssertionRequests(dirString+fileString,mOutputDirIncAssConsistency+subDirPathString+incAssConsFileString,mIncAssConsistencyRemovalCount,mIncAssConsistencyAdditionCount,mIncAssConsTestCount); } } if (mConfCreateIncAssClassificationTests) { consIncAssClassificationDir.mkpath(subDirPathString); if (mConfCreateIncAssClassificationByRatio) { mIncAssClassificationGen->generateOWLlinkIncrementalAssertionRequests(dirString+fileString,mOutputDirIncAssClassification+subDirPathString+incAssClassificationFileString,(double)mIncAssClassificationRemovalCount/(double)mIncAssClassificationRemovalCountRatioDenominator,(double)mIncAssClassificationAdditionCount/(double)mIncAssClassificationAdditionCountRatioDenominator,mIncAssClassificationTestCount); } else { mIncAssClassificationGen->generateOWLlinkIncrementalAssertionRequests(dirString+fileString,mOutputDirIncAssClassification+subDirPathString+incAssClassificationFileString,mIncAssClassificationRemovalCount,mIncAssClassificationAdditionCount,mIncAssConsTestCount); } } if (mConfCreateIncAssRealizationTests) { consIncAssRealizationDir.mkpath(subDirPathString); if (mConfCreateIncAssRealizationByRatio) { mIncAssRealizationGen->generateOWLlinkIncrementalAssertionRequests(dirString+fileString,mOutputDirIncAssRealization+subDirPathString+incAssRealizationFileString,(double)mIncAssRealizationRemovalCount/(double)mIncAssRealizationRemovalCountRatioDenominator,(double)mIncAssRealizationAdditionCount/(double)mIncAssRealizationAdditionCountRatioDenominator,mIncAssRealizationTestCount); } else { mIncAssRealizationGen->generateOWLlinkIncrementalAssertionRequests(dirString+fileString,mOutputDirIncAssRealization+subDirPathString+incAssRealizationFileString,mIncAssRealizationRemovalCount,mIncAssRealizationAdditionCount,mIncAssConsTestCount); } } } LOG(INFO,"::Konclude::Generator::TestCaseGenerator",logTr("Generated test cases for all files in %1.").arg(dirString),this); } return this; } CLoader *COWLFilesOWLlinkTestcaseGeneratorLoader::load() { mRealizeGen = new COWLFileOWLlinkRealizeRequestGenerator(loaderConfig); mClassifyGen = new COWLFileOWLlinkClassifyRequestGenerator(loaderConfig); mConsistencyGen = new COWLFileOWLlinkConsistencyRequestGenerator(loaderConfig); mSatisfiabilityGen = new COWLFileOWLlinkSatisfiabilityRequestGenerator(loaderConfig); mTypesGen = new COWLFileOWLlinkTypesRequestGenerator(loaderConfig); mIncAssConsistencyGen = new COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator(loaderConfig); mIncAssClassificationGen = new COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator(loaderConfig); mIncAssRealizationGen = new COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator(loaderConfig); generateTestcasesForDirectory(mInputDir,""); delete mClassifyGen; delete mRealizeGen; delete mConsistencyGen; delete mSatisfiabilityGen; delete mTypesGen; delete mIncAssConsistencyGen; delete mIncAssClassificationGen; delete mIncAssRealizationGen; return this; } CLoader *COWLFilesOWLlinkTestcaseGeneratorLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCLIClassificationBatchProcessingLoader.cpp0000644000175000017500000000511112520756356031341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCLIClassificationBatchProcessingLoader.h" namespace Konclude { namespace Control { namespace Loader { CCLIClassificationBatchProcessingLoader::CCLIClassificationBatchProcessingLoader() { } CCLIClassificationBatchProcessingLoader::~CCLIClassificationBatchProcessingLoader() { } void CCLIClassificationBatchProcessingLoader::createTestingCommands() { createClassificationTestingCommands(); } void CCLIClassificationBatchProcessingLoader::createClassificationTestingCommands() { logOutputMessage(QString("Starting classification for '%1'.").arg(mRequestFileString)); QString testKB = QString("http://konclude.com/test/kb"); CCreateKnowledgeBaseCommand* createKBCommand = new CCreateKnowledgeBaseCommand(testKB); QStringList ontoIRIList; ontoIRIList.append(mRequestFileString); //CLoadKnowledgeBaseOWLXMLOntologyCommand* loadKBCommand = new CLoadKnowledgeBaseOWLXMLOntologyCommand(testKB,ontoIRIList); //CLoadKnowledgeBaseOWLFunctionalOntologyCommand* loadKBCommand = new CLoadKnowledgeBaseOWLFunctionalOntologyCommand(testKB,ontoIRIList); CLoadKnowledgeBaseOWLAutoOntologyCommand* loadKBCommand = new CLoadKnowledgeBaseOWLAutoOntologyCommand(testKB,ontoIRIList); CClassifyQueryCommand* classifyKBCommand = new CClassifyQueryCommand(testKB); addProcessingCommand(createKBCommand); addProcessingCommand(loadKBCommand); addProcessingCommand(classifyKBCommand); if (!mResponseFileString.isEmpty()) { CWriteXMLSubClassHierarchyQueryCommand* writeHierarchyCommand = new CWriteXMLSubClassHierarchyQueryCommand(testKB,mResponseFileString); addProcessingCommand(writeHierarchyCommand); } processNextCommand(); } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CPigenholePrincipleGeneratorLoader.h0000644000175000017500000000440712520756360030155 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CPIGENHOLEPRINCIPLEGENERATORLOADER_H #define KONCLUDE_CONTROL_LOADER_CPIGENHOLEPRINCIPLEGENERATORLOADER_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" // Other includes #include "Test/COWLPigeonholePrincipleGenerator.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Test; using namespace Concurrent; namespace Control { namespace Loader { /*! * * \class CPigenholePrincipleGeneratorLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPigenholePrincipleGeneratorLoader : public CLoader { // public methods public: //! Constructor CPigenholePrincipleGeneratorLoader(); //! Destructor virtual ~CPigenholePrincipleGeneratorLoader(); virtual CLoader* init(CLoaderFactory* loaderFactory = 0, CConfiguration* config = 0); virtual CLoader* load(); virtual CLoader* exit(); // protected methods protected: // protected variables protected: CConfiguration* mConfiguration; COWLPigeonholePrincipleGenerator* generator; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CPIGENHOLEPRINCIPLEGENERATORLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CTestQHashVsQMapLoader.cpp0000644000175000017500000000305512520756362026015 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTestQHashVsQMapLoader.h" namespace Konclude { namespace Control { namespace Loader { CTestQHashVsQMapLoader::CTestQHashVsQMapLoader() { mConfiguration = 0; tester = 0; } CTestQHashVsQMapLoader::~CTestQHashVsQMapLoader() { } CLoader* CTestQHashVsQMapLoader::init(CLoaderFactory* loaderFactory, CConfiguration* config) { mConfiguration = config; return this; } CLoader *CTestQHashVsQMapLoader::load() { tester = new CQHashVsQMapTester(); cout<<"Starting Modifcation Test.\n"; tester->startModificationTest(100000); return this; } CLoader* CTestQHashVsQMapLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CDefaultLoaderFactory.h0000644000175000017500000000724212520756356025447 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_CDEFAULTLOADERFACTORY_H #define KONCLUDE_Control_LOADER_CDEFAULTLOADERFACTORY_H // Libraries includes #include #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CCommandLineLoader.h" #include "CCoutLogObserverLoader.h" #include "CDefaultReasonerLoader.h" #include "COWLlinkBatchFileLoader.h" #include "CAnalyseReasonerLoader.h" #include "CExperimentalReasonerLoader.h" #include "CCommandLineTranlatorHelpLoader.h" #include "CConfigurableCoutLogObserverLoader.h" #include "CTestHashModificationLoader.h" #include "CTestTaskThroughputLoader.h" #include "CTestQHashVsQMapLoader.h" #include "CPigenholePrincipleGeneratorLoader.h" #include "CTestOWLlinkAPIBatchFileLoader.h" #include "CTestMemoryAccessLoader.h" #include "COWLFilesIncompatibleAxiomChangerLoader.h" #include "CReasonerEvaluationLoader.h" #include "COWLFilesOWLlinkTestcaseGeneratorLoader.h" #include "CReasonerEvaluationClassificationTimesComparerLoader.h" #include "COWLlinkHttpServerLoader.h" #include "CReasonerEvaluationLoadingTimesComparerLoader.h" #include "CRecursionTestDataGeneratorLoader.h" #include "CLargeJoinTestDataGeneratorLoader.h" #include "CTransitiveConnectedELClassesTestDataGeneratorLoader.h" #include "CReasonerEvaluationProgramLoader.h" #include "COREBatchProcessingLoader.h" #include "CORECoutLogObserverLoader.h" #include "CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader.h" #include "CReasonerEvaluationOntologyExtractionLoader.h" #include "CCLIClassificationBatchProcessingLoader.h" #include "CCLIConsistencyBatchProcessingLoader.h" #include "CCLISatisfiabilityBatchProcessingLoader.h" #include "CCLIRealizationBatchProcessingLoader.h" #include "CLoggerConfigurationLoader.h" // Other includes #include "Config/CConfiguration.h" #include "Control/Command/CReasonerConfigurationGroup.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Config; namespace Control { using namespace Command; namespace Loader { /*! * * \class CDefaultLoaderFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDefaultLoaderFactory : public CLoaderFactory { // public methods public: //! Constructor CDefaultLoaderFactory(); //! Destructor virtual ~CDefaultLoaderFactory(); virtual CLoader *createLoaderFromName(const QString &loaderName, CConfiguration *config = 0); virtual bool canCreateLoaderFromName(const QString &loaderName, CConfiguration *config = 0); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_CDEFAULTLOADERFACTORY_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCommandLineTranlatorHelpLoader.cpp0000644000175000017500000000743712520756356027762 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandLineTranlatorHelpLoader.h" namespace Konclude { namespace Control { namespace Loader { CCommandLineTranlatorHelpLoader::CCommandLineTranlatorHelpLoader() { } CCommandLineTranlatorHelpLoader::~CCommandLineTranlatorHelpLoader() { } CLoader *CCommandLineTranlatorHelpLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { return this; } CLoader *CCommandLineTranlatorHelpLoader::load() { LOG(INFO,"::Konclude::Loader::OWLlinkTranslationHelpLoader",logTr( "Usage: 'Konclude' [parameters]\n" "\n" "Available commands:\n" "\towllinkfile : Processes an OWLlink request file, which has to be specified with the parameter -i.\n" "\towllinkserver : Listening on the specified port (default 8080) for OWLlink requests sent over HTTP.\n" "\tclassification : Classifies the ontology that is specified with the parameter -i.\n" "\tconsistency : Checks the consistency of the ontology that is specified with the parameter -i.\n" "\tsatisfiability : Checks the satisfiability of the class that is specified with -x for the ontology specified with -i.\n" "\trealization : Realizes the ontology that is specified with -i (or only a certain individual that is specified with -x).\n" "\n" "Configurable parameter:\n" "\t-w X : Configures the number of processing threads. X has to be an integer greater than 0 or 'AUTO' for\n" "\t\tscaling the number of processing threads to the number of computer cores.\n" "\t-c FILEPATH : Path and file name of the config file.\n" "\t-i FILEPATH : Path and file name of the input file / OWLlink request file.\n" "\t-o FILEPATH : Path and file name of the output file / OWLlink response file.\n" "\t-x IRI : IRI of the input entity.\n" "\t-p PORT: Specifies PORT as the listening port for the OWLlink server.\n" "\t-a : Periodically prints the progress of the current activities.\n" "\t-v : Shows more detailed loading and processing times.\n" "\t-h : Shows this help (dominates all previous parameters).\n" "\n" "Examples:\n" "\tKonclude owllinkfile -i Tests/test-request.xml -o test-response.xml\n" "\tKonclude owllinkfile -c Configs/default-config.xml -i Tests/test-request.xml -o test-response.xml\n" "\tKonclude owllinkserver -w 2 -c Configs/default-config.xml -p 8080\n" "\tKonclude satisfiability -i Tests/galen.owl.xml -x http://ex.test/galen#ExternalIliacVein\n" "\tKonclude classification -w AUTO -i Tests/roberts-family-full-D.owl.xml -o Tests/roberts-family-full-D-class.owl.xml\n" "\tKonclude realization -w AUTO -i Tests/roberts-family-full-D.owl.xml -o Tests/roberts-family-full-D-real.owl.xml\n" "\n" ),this); QCoreApplication::exit(); return this; } CLoader *CCommandLineTranlatorHelpLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CTestQHashVsQMapLoader.h0000644000175000017500000000412012520756362025454 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CTESTQHASHVSQMAPLOADER_H #define KONCLUDE_CONTROL_LOADER_CTESTQHASHVSQMAPLOADER_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" // Other includes #include "Test/CQHashVsQMapTester.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Test; namespace Control { namespace Loader { /*! * * \class CTestQHashVsQMapLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTestQHashVsQMapLoader : public CLoader { // public methods public: //! Constructor CTestQHashVsQMapLoader(); //! Destructor virtual ~CTestQHashVsQMapLoader(); virtual CLoader* init(CLoaderFactory* loaderFactory = 0, CConfiguration* config = 0); virtual CLoader* load(); virtual CLoader* exit(); // protected methods protected: // protected variables protected: CConfiguration* mConfiguration; CQHashVsQMapTester* tester; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CTESTQHASHVSQMAPLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CExperimentalReasonerLoader.cpp0000644000175000017500000000305612520756360027214 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExperimentalReasonerLoader.h" namespace Konclude { namespace Control { namespace Loader { CExperimentalReasonerLoader::CExperimentalReasonerLoader() { } CExperimentalReasonerLoader::~CExperimentalReasonerLoader() { } CLoader *CExperimentalReasonerLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { CConfigurationGroup *group = config->getConfigurationGroup(); CConfigData *data = config->createAndSetConfig("Konclude.Execution.DefaultReasonerManager"); if (data) { data->readFromString("ASExperimentalReasonerManager"); } CDefaultReasonerLoader::init(loaderFactory,config); return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCLIConsistencyBatchProcessingLoader.h0000644000175000017500000000460012520756356030356 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CCLICONSISTENCYBATCHPROCESSINGLOADER_H #define KONCLUDE_CONTROL_LOADER_CCLICONSISTENCYBATCHPROCESSINGLOADER_H // Libraries includes #include #include #include #include // Namespace includes #include "LoaderSettings.h" #include "CCLIBatchProcessingLoader.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; namespace Control { namespace Loader { /*! * * \class CCLIConsistencyBatchProcessingLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCLIConsistencyBatchProcessingLoader : public CCLIBatchProcessingLoader { // public methods public: //! Constructor CCLIConsistencyBatchProcessingLoader(); //! Destructor virtual ~CCLIConsistencyBatchProcessingLoader(); // protected methods protected: void createConsistencyTestingCommands(); virtual void createTestingCommands(); virtual void writeCommandOutput(const QString& outputFileName, CCommand* processedCommand); // protected variables protected: // private methods private: CIsConsistentQueryCommand* mConsistencyKBCommand; CIsTriviallyConsistentQueryCommand* mTriviallyConsistencyKBCommand; // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CCLICONSISTENCYBATCHPROCESSINGLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationProgramLoader.h0000644000175000017500000000617412520756362027671 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONPROGRAMLOADER_H #define KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONPROGRAMLOADER_H // Libraries includes #include #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CLoaderFactory.h" // Other includes #include "Test/Evaluation/CReasonerEvaluationExecutorThread.h" #include "Test/Evaluation/CReasonerEvaluationTestsuite.h" #include "Control/Command/CCommanderManagerThread.h" #include "Control/Command/CCommanderManagerConfigType.h" #include "Control/Command/Instructions/CInitializeConfigurationCommand.h" #include "Config/CConfigDataReader.h" #include "Control/Interface/OWLlink/COWLlinkProcessor.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; using namespace Config; using namespace Test::Evaluation; namespace Control { using namespace Command; using namespace Instructions; using namespace Interface::OWLlink; namespace Loader { /*! * * \class CReasonerEvaluationProgramLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationProgramLoader : public CLoader, public COWLlinkProcessor { // public methods public: //! Constructor CReasonerEvaluationProgramLoader(); //! Destructor virtual ~CReasonerEvaluationProgramLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: virtual COWLlinkProcessor *initializeOWLlinkContent(); virtual COWLlinkProcessor *concludeOWLlinkContent(); virtual CConfiguration *getConfiguration(); // protected variables protected: QString mProgramFileString; CConfiguration* mLoaderConfig; CCommanderManagerThread* mReasonerCommander; CCommanderManagerThread* mDeleteReasonerCommander; QSemaphore mBlockingSem; bool mCloseAfterOutput; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONPROGRAMLOADER_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationClassificationTimesComparerLoader.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationClassificationTimesComparerL0000644000175000017500000001643712520756360032450 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationClassificationTimesComparerLoader.h" namespace Konclude { namespace Control { namespace Loader { CReasonerEvaluationClassificationTimesComparerLoader::CReasonerEvaluationClassificationTimesComparerLoader() { loaderConfig = nullptr; } CReasonerEvaluationClassificationTimesComparerLoader::~CReasonerEvaluationClassificationTimesComparerLoader() { } CLoader *CReasonerEvaluationClassificationTimesComparerLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { loaderConfig = config; CConfigData *data = config->getLastConfigChange("Konclude.Test.Generator.InputDirectory"); if (data) { mInputDir = data->getString(); } if (!mInputDir.endsWith("/")) { mInputDir += QString("/"); } data = config->getLastConfigChange("Konclude.Test.Generator.OutputDirectory"); if (data) { mOutputDir = data->getString(); } if (!mOutputDir.endsWith("/")) { mOutputDir += QString("/"); } mOutputDirClassify = mOutputDir+"Classification/"; return this; } CLoader *CReasonerEvaluationClassificationTimesComparerLoader::load() { CReasonerEvaluationClassificationTimeExtractor* classTimeExtractor = new CReasonerEvaluationClassificationTimeExtractor(60000); CReasonerEvaluationAvaragerSummarizer* avarageSummarize = new CReasonerEvaluationAvaragerSummarizer(); QStringList reasonerNameStringList = QStringList() <<"HermiT 1.3.6" <<"FaCT++ 1.5.3" <<"Pellet 2.3.0" <<"Konclude 0.3.7-620"; QStringList reasonerPathStringList = QStringList() <getGNUPlotPlotter()->createReasonerOverviewPlot("Evaluation/Analyse/R-000/A-003/ReasonerClassificationComparison/TONES Repository/Incompatible Axioms Removed/Classification/classification-time-separate-sorted-descending-table.dat","xyz",QStringList()<<"Min"<<"Max","Evaluation/Analyse/R-000/A-003/ReasonerComparison/TONES Repository/Incompatible Axioms Removed/Classification/xyz"); //reasonerEvaluationContext->getHighchartPlotter()->createReasonerComparisonPlot("Evaluation/Analyses/R-000/A-004/ReasonerClassificationComparison/TONES Repository/Incompatible Axioms Removed/Classification/classification-time-sorted-descending-by-Average-split-from-0-to-16-table.csv","xyz",QStringList()<<"Min"<<"Max","Evaluation/Analyses/R-000/A-004/ReasonerClassificationComparison/TONES Repository/Incompatible Axioms Removed/Classification/xyz"); CReasonerEvaluationCollector* collector = new CReasonerEvaluationCollector(classTimeExtractor,avarageSummarize); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* reasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(reasonerNameStringList); for (QStringList::const_iterator it1 = reasonerNameStringList.constBegin(), it2 = reasonerPathStringList.constBegin(), it1End = reasonerNameStringList.constEnd(), it2End = reasonerPathStringList.constEnd(); it1 != it1End && it2 != it2End; ++it1, ++it2) { QString reasonerName(*it1); QString reasonerPath(*it2); LOG(INFO,"::Konclude::Test::Evaluation::ReasonerClassificationTimeComparer",logTr("Extracting classification times for '%1' reasoner from responses in directory '%2'.").arg(reasonerName).arg(reasonerPath),this); collector->collectReasonerEvaluationDataValues(reasonerComp,reasonerName,reasonerPath); } LOG(INFO,"::Konclude::Test::Evaluation::ReasonerClassificationTimeComparer",logTr("Comparing classification times for '%1'.").arg(reasonerNameStringList.join(", ")),this); CReasonerEvaluationGroupRequestSelector* selectors = nullptr; CReasonerEvaluationExpressivitySelectorFactory expEvalSelFactory("Expressivity Grouped","Expressivity Grouped/","Evaluation/Infos/Expressivity/"); selectors = expEvalSelFactory.getSelectors(selectors); CReasonerEvaluationDirectoryStructureSelectorFactory dirEvalSelFactory("Evaluation/Requests/","Evaluation/Requests/Classification/","Directory Grouped","Directory Grouped/"); selectors = dirEvalSelFactory.getSelectors(selectors); CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser* analyser1 = new CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser(); analyser1->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser* analyser2 = new CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser(); analyser2->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser* analyser3 = new CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser(); analyser3->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors); LOG(INFO,"::Konclude::Test::Evaluation::ReasonerClassificationTimeComparer",logTr("Classification times for '%1' compared to '%2'.").arg(reasonerNameStringList.join(", ")).arg(outputDirectory),this); return this; } CLoader *CReasonerEvaluationClassificationTimesComparerLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCommandLineTranlatorHelpLoader.h0000644000175000017500000000407312520756356027420 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_COWLLINKTRANLATORHELPLOADER_H #define KONCLUDE_Control_LOADER_COWLLINKTRANLATORHELPLOADER_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" #include "CCoutLogObserverLoader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Utilities; namespace Control { namespace Loader { /*! * * \class COWLlinkTranlatorHelpLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommandLineTranlatorHelpLoader : public CLoader { // public methods public: //! Constructor CCommandLineTranlatorHelpLoader(); //! Destructor virtual ~CCommandLineTranlatorHelpLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_COWLLINKTRANLATORHELPLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CTestOWLlinkAPIBatchFileLoader.cpp0000644000175000017500000000365512520756362027342 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTestOWLlinkAPIBatchFileLoader.h" namespace Konclude { namespace Control { namespace Loader { CTestOWLlinkAPIBatchFileLoader::CTestOWLlinkAPIBatchFileLoader() { loaderConfig = 0; } CTestOWLlinkAPIBatchFileLoader::~CTestOWLlinkAPIBatchFileLoader() { } CLoader *CTestOWLlinkAPIBatchFileLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { loaderConfig = config; CConfigData *data = config->getLastConfigChange("Konclude.OWLlink.RequestFile"); if (data) { reqFileString = data->getString(); } data = config->getLastConfigChange("Konclude.OWLlink.ResponseFile"); if (data) { resFileString = data->getString(); } return this; } CLoader *CTestOWLlinkAPIBatchFileLoader::load() { COWLlinkAPIReasonerTestfileTester* tester = new COWLlinkAPIReasonerTestfileTester(loaderConfig); tester->startTestfileTest(reqFileString,resFileString); delete tester; return this; } CLoader *CTestOWLlinkAPIBatchFileLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CLoader.cpp0000644000175000017500000000203012520756360023126 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLoader.h" namespace Konclude { namespace Control { namespace Loader { CLoader::CLoader() { } CLoader::~CLoader() { } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/COWLlinkBatchFileLoader.cpp0000644000175000017500000001401612520756360026137 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLlinkBatchFileLoader.h" namespace Konclude { namespace Control { namespace Loader { COWLlinkBatchFileLoader::COWLlinkBatchFileLoader() { owllinkInterpreter = 0; loaderConfig = 0; mConfLogProcessingTimes = false; } COWLlinkBatchFileLoader::~COWLlinkBatchFileLoader() { } CLoader *COWLlinkBatchFileLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { loaderConfig = config; CConfigData *data = config->getLastConfigChange("Konclude.OWLlink.RequestFile"); if (data) { reqFileString = data->getString(); } data = config->getLastConfigChange("Konclude.OWLlink.ResponseFile"); if (data) { resFileString = data->getString(); } directConsoleOutput = false; data = config->getLastConfigChange("Konclude.OWLlink.WriteResponseToStandardOutput"); if (data) { directConsoleOutput = data->getBoolean(); } directErrorOutput = false; data = config->getLastConfigChange("Konclude.OWLlink.WriteResponseToStandardError"); if (data) { directErrorOutput = data->getBoolean(); } closeAfterOutput = false; data = config->getLastConfigChange("Konclude.OWLlink.CloseAfterProcessedRequest"); if (data) { closeAfterOutput = data->getBoolean(); } blockUntilProcessed = false; data = config->getLastConfigChange("Konclude.OWLlink.BlockUntilProcessedRequest"); if (data) { blockUntilProcessed = data->getBoolean(); } mConfLogProcessingTimes = false; data = config->getLastConfigChange("Konclude.OWLlink.LoggingExtendedProcessingTimes"); if (data) { mConfLogProcessingTimes = data->getBoolean(); } data = config->getLastConfigChange("Konclude.OWLlink.SAXBasedLoadOntologiesParsing"); if (data) { mConfLoadOntologiesSAXParsing = data->getBoolean(); } reasonerCommander = CConfigManagerReader::readCommanderManagerConfig(config); return this; } CLoader *COWLlinkBatchFileLoader::load() { startProcessing(); if (blockUntilProcessed) { blockingSem.acquire(); } return this; } CConfiguration *COWLlinkBatchFileLoader::getConfiguration() { if (!reasonerCommander) { return loaderConfig; } else { CGetDescriptionCommand *getDesComm = new CGetDescriptionCommand(); reasonerCommander->delegateCommand(getDesComm); CCommandExecutedBlocker commExeBlocker; commExeBlocker.waitExecutedCommand(getDesComm); CConfiguration *config = getDesComm->getConfiguration(); return config; } } COWLlinkProcessor *COWLlinkBatchFileLoader::initializeOWLlinkContent() { mResponseTime.start(); if (!reqFileString.isEmpty()) { QFile file(reqFileString); LOG(INFO,getLogDomain(),logTr("Processing OWLlink request from file '%1'.").arg(reqFileString),this); if (file.open(QIODevice::ReadOnly)) { fileContent = file.readAll(); COWLlinkQtXMLCommandParser *owllinkCommandParser = new COWLlinkQtXMLCommandParser(); owllinkInterpreter = nullptr; if (!resFileString.isEmpty()) { owllinkInterpreter = new COWLLinkRecordInterpreter(preSynchronizer,loaderConfig); defaultCommandDelegater = owllinkInterpreter; } else { defaultCommandDelegater = preSynchronizer; } CParseOWLlinkCommandsCommand *parseCommand = new CParseOWLlinkCommandsCommand(&fileContent,reqFileString); parseCommand->setRecorder(owllinkInterpreter); parseCommand->setReportErrorFromSubCommands(false); CCommandProcessedCallbackEvent *proComm = new CCommandProcessedCallbackEvent(this,parseCommand); parseCommand->addProcessedCallback(proComm); owllinkCommandParser->realizeCommand(parseCommand,defaultCommandDelegater); delete owllinkCommandParser; if (mConfLogProcessingTimes) { cint64 readMilliSeconds = mResponseTime.elapsed(); LOG(INFO,getLogDomain(),logTr("Read XML content in %1 ms.").arg(readMilliSeconds),this); } } else { LOG(ERROR,getLogDomain(),logTr("OWLlink request file '%1' not found.").arg(reqFileString),this); concludeOWLlinkContent(); } } return this; } COWLlinkProcessor *COWLlinkBatchFileLoader::concludeOWLlinkContent() { if (owllinkInterpreter) { QByteArray fileContent(owllinkInterpreter->getByteArray()); if (!resFileString.isEmpty()) { QFile file(resFileString); if (file.open(QIODevice::WriteOnly)) { file.write(fileContent); file.close(); } } if (directConsoleOutput) { std::cout<waitSynchronization(); //qSleep(10); //qWait(); QCoreApplication::exit(); } return this; } CLoader *COWLlinkBatchFileLoader::exit() { stopThread(); return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CLargeJoinTestDataGeneratorLoader.cpp0000644000175000017500000000421012520756360030224 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLargeJoinTestDataGeneratorLoader.h" namespace Konclude { namespace Control { namespace Loader { CLargeJoinTestDataGeneratorLoader::CLargeJoinTestDataGeneratorLoader() { mConfiguration = 0; generator = 0; } CLargeJoinTestDataGeneratorLoader::~CLargeJoinTestDataGeneratorLoader() { } CLoader* CLargeJoinTestDataGeneratorLoader::init(CLoaderFactory* loaderFactory, CConfiguration* config) { mConfiguration = config; return this; } CLoader *CLargeJoinTestDataGeneratorLoader::load() { generator = new COWLLargeJoinTestDataGenerator(); QString filename = CConfigDataReader::readConfigString(mConfiguration,"Konclude.Test.LargeJoinTestDataGenerator.OWLlinkOutputFile","LargeJoinTestData.owl.xml"); cint64 indiSize = CConfigDataReader::readConfigInteger(mConfiguration,"Konclude.Test.LargeJoinTestDataGenerator.IndividualCount",1000); cint64 probSize = CConfigDataReader::readConfigInteger(mConfiguration,"Konclude.Test.LargeJoinTestDataGenerator.PropertyAssertionCount",200); double ratio = (double)probSize/(double)indiSize; generator->generateData(indiSize,ratio,filename); delete generator; return this; } CLoader* CLargeJoinTestDataGeneratorLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CDefaultReasonerLoader.h0000644000175000017500000000502612520756360025607 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_CDEFAULTREASONERLOADER_H #define KONCLUDE_Control_LOADER_CDEFAULTREASONERLOADER_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" // Other includes #include "Utilities/CSingletonProvider.hpp" #include "Control/Command/CCommanderManagerThread.h" #include "Control/Command/CCommanderManagerConfigType.h" #include "Control/Command/CDefaultCommanderInitializationFactory.h" #include "Control/Command/Instructions/CInitializeConfigurationCommand.h" #include "Control/Command/Instructions/CInitializeReasonerCommand.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CConsolePrintLogObserver.h" namespace Konclude { using namespace Logger; using namespace Utilities; namespace Control { using namespace Command; using namespace Instructions; namespace Loader { /*! * * \class CDefaultReasonerLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDefaultReasonerLoader : public CLoader { // public methods public: //! Constructor CDefaultReasonerLoader(); //! Destructor virtual ~CDefaultReasonerLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: // protected variables protected: CConfiguration *configuration; CCommanderManagerThread *reasonerCommander; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_CDEFAULTREASONERLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/COREBatchProcessingLoader.h0000644000175000017500000001421312520756360026146 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_COREBATCHPROCESSINGLOADER_H #define KONCLUDE_CONTROL_LOADER_COREBATCHPROCESSINGLOADER_H // Libraries includes #include #include #include #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CLoaderFactory.h" // Other includes #include "Control/Interface/OWLlink/COWLlinkProcessor.h" #include "Control/Interface/OWLlink/COWLLinkRecordInterpreter.h" #include "Control/Command/CConfigManagerReader.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include "Logger/COREConsolePrintLogObserver.h" #include "Logger/COREFilePrintLogObserver.h" #include #include namespace Konclude { using namespace Logger; namespace Control { using namespace Interface::OWLlink; using namespace Command; namespace Loader { /*! * * \class COREBatchProcessingLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COREBatchProcessingLoader : public CLoader, public COWLlinkProcessor, public CCommandRecorder { // public methods public: //! Constructor COREBatchProcessingLoader(); //! Destructor virtual ~COREBatchProcessingLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); virtual CCommandRecorder *recordData(CCommandRecordData *recData); // protected methods protected: class CCommandProcessData { public: CCommandProcessData(CCommand* command){ mCommand = command; mMeasureTime = false; mWriteSatisfiableOutput = false; } CCommandProcessData(CCommand* command, bool measureTime, const QString& measuredOutputString) { mCommand = command; mMeasureTime = measureTime; mMeasuredOutputString = measuredOutputString; mWriteSatisfiableOutput = false; } CCommandProcessData(CCommand* command, bool measureTime, const QString& measuredOutputString, bool writeSatisfiabilityOutput, const QString& outputFileName) { mCommand = command; mMeasureTime = measureTime; mMeasuredOutputString = measuredOutputString; mWriteSatisfiableOutput = writeSatisfiabilityOutput; mWriteOutputFile = outputFileName; } public: CCommand* mCommand; bool mMeasureTime; QString mMeasuredOutputString; bool mWriteSatisfiableOutput; QString mWriteOutputFile; }; virtual COWLlinkProcessor* initializeOWLlinkContent(); virtual COWLlinkProcessor* concludeOWLlinkContent(); virtual CConfiguration* getConfiguration(); void createClassificationTestingCommands(); void createConsistencyTestingCommands(); void createRealisationTestingCommands(); void createSatisfiabilityTesingCommands(); void addProcessingCommand(CCommand* command); void addProcessingCommand(CCommand* command, bool measureTime, const QString& measuredOutputString); void addProcessingCommand(CCommand* command, bool measureTime, const QString& measuredOutputString, bool writeSatisfiabilityOutput, const QString& outputFileName); bool hasMoreProcessingCommands(); void terminateProcessing(); void processNextCommand(); void finishCommandProcessing(); void logOutputNotice(const QString& outputString); void logOutputMessage(const QString& outputString); void logOutputError(const QString& errorString); void writeSatisfiabilityResult(const QString& outputFileName, CCommand* processedCommand); void forcedPathCreated(const QString& filePath); // protected variables protected: QString mOperationTaskString; QString mIRINameString; QString mOntologyFileString; QString mResponseFileString; QString mWriteSatisfiabilityPrefixString; CLogIdentifier mORELogIdentifier; QList mProcessCommandList; CCommandProcessData* mProcessingCommandData; bool mCloseAfterOutput; bool mOutputMeasuredTimeInSeconds; bool mBlockUntilProcessed; QTime mMeasurementTime; QSemaphore mBlockingSemaphore; COWLLinkRecordInterpreter* mOWLLinkInterpreter; bool mReportParsingTimeForConsistency; bool mReportParsingTimeForClassification; bool mReportParsingTimeForRealisation; bool mReportParsingTimeForSatisfiability; bool mReportAllTime; CConfiguration* mLoaderConfig; QString mOperationTimeOutputString; QString mProcessingOperationString; QString mSatOperationString; QString mSatisfiabilityOperationString; QString mQueryOperationString; QString mClassificationOperationString; QString mConsistencyOperationString; QString mRealisationOperationString; QString mRealizationOperationString; COREConsolePrintLogObserver* mInfoConsoleObserver; COREFilePrintLogObserver* mErrorFileObserver; CIsConsistentQueryCommand* mConsistencyKBCommand; CIsTriviallyConsistentQueryCommand* mTriviallyConsistencyKBCommand; cint64 mAdditionalCheckingTime; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_COREBATCHPROCESSINGLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCloser.cpp0000644000175000017500000000203012520756356023154 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCloser.h" namespace Konclude { namespace Control { namespace Loader { CCloser::CCloser() { } CCloser::~CCloser() { } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/COWLFilesIncompatibleAxiomChangerLoader.h0000644000175000017500000000454412520756360030771 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_COWLFILESINCOMPATIBLEAXIOMCHANGERLOADER_H #define KONCLUDE_CONTROL_LOADER_COWLFILESINCOMPATIBLEAXIOMCHANGERLOADER_H // Libraries includes #include #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CLoaderFactory.h" // Other includes #include "Test/COWLFileAxiomRemover.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; using namespace Test; namespace Control { namespace Loader { /*! * * \class COWLFilesIncompatibleAxiomChangerLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLFilesIncompatibleAxiomChangerLoader : public CLoader { // public methods public: //! Constructor COWLFilesIncompatibleAxiomChangerLoader(); //! Destructor virtual ~COWLFilesIncompatibleAxiomChangerLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: // protected variables protected: QString mInputDir; QString mOutputDir; CConfiguration *loaderConfig; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_COWLFILESINCOMPATIBLEAXIOMCHANGERLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/COWLFilesOWLlinkTestcaseGeneratorLoader.h0000644000175000017500000001217112573742026030754 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_COWLFILESOWLLINKTESTCASEGENERATORLOADER_H #define KONCLUDE_CONTROL_LOADER_COWLFILESOWLLINKTESTCASEGENERATORLOADER_H // Libraries includes #include #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CLoaderFactory.h" // Other includes #include "Test/COWLFileOWLlinkClassifyRequestGenerator.h" #include "Test/COWLFileOWLlinkConsistencyRequestGenerator.h" #include "Test/COWLFileOWLlinkSatisfiabilityRequestGenerator.h" #include "Test/COWLFileOWLlinkTypesRequestGenerator.h" #include "Test/COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator.h" #include "Test/COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator.h" #include "Test/COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator.h" #include "Test/COWLFileOWLlinkRealizeRequestGenerator.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; using namespace Test; namespace Control { namespace Loader { /*! * * \class COWLFilesOWLlinkTestcaseGeneratorLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLFilesOWLlinkTestcaseGeneratorLoader : public CLoader { // public methods public: //! Constructor COWLFilesOWLlinkTestcaseGeneratorLoader(); //! Destructor virtual ~COWLFilesOWLlinkTestcaseGeneratorLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: virtual CLoader *generateTestcasesForDirectory(const QString& dirString, const QString& subDirPathString); // protected variables protected: QString mInputDir; QString mOutputDir; QString mFilterDir; QString mOutputDirClassify; QString mOutputDirConsistency; QString mOutputDirSatisfiability; QString mOutputDirTypes; QString mOutputDirRealize; cint64 mSatisfiabilityTestCount; cint64 mTypesTestCount; cint64 mIncAssConsTestCount; cint64 mIncAssConsistencyAdditionCount; cint64 mIncAssConsistencyRemovalCount; cint64 mIncAssConsistencyAdditionCountRatioDenominator; cint64 mIncAssConsistencyRemovalCountRatioDenominator; bool mConfCreateIncAssConsistencyTests; bool mConfCreateIncAssConsistencyByRatio; QString mOutputDirIncAssConsistency; cint64 mIncAssClassificationTestCount; cint64 mIncAssClassificationAdditionCount; cint64 mIncAssClassificationRemovalCount; cint64 mIncAssClassificationAdditionCountRatioDenominator; cint64 mIncAssClassificationRemovalCountRatioDenominator; bool mConfCreateIncAssClassificationTests; bool mConfCreateIncAssClassificationByRatio; QString mOutputDirIncAssClassification; cint64 mIncAssRealizationTestCount; cint64 mIncAssRealizationAdditionCount; cint64 mIncAssRealizationRemovalCount; cint64 mIncAssRealizationAdditionCountRatioDenominator; cint64 mIncAssRealizationRemovalCountRatioDenominator; bool mConfCreateIncAssRealizationTests; bool mConfCreateIncAssRealizationByRatio; QString mOutputDirIncAssRealization; bool mConfCreateClassifyTests; bool mConfCreateConsistencyTests; bool mConfCreateSatisfiabilityTests; bool mConfCreateTypeTests; bool mConfCreateRealizeTests; CConfiguration *loaderConfig; COWLFileOWLlinkClassifyRequestGenerator* mClassifyGen; COWLFileOWLlinkConsistencyRequestGenerator* mConsistencyGen; COWLFileOWLlinkSatisfiabilityRequestGenerator* mSatisfiabilityGen; COWLFileOWLlinkTypesRequestGenerator* mTypesGen; COWLFileOWLlinkRealizeRequestGenerator* mRealizeGen; COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator* mIncAssConsistencyGen; COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator* mIncAssClassificationGen; COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator* mIncAssRealizationGen; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_COWLFILESOWLLINKTESTCASEGENERATORLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CTestTaskThroughputLoader.h0000644000175000017500000000426212520756362026363 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_CTESTTASKTHROUGHPUTLOADER_H #define KONCLUDE_Control_LOADER_CTESTTASKTHROUGHPUTLOADER_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" // Other includes #include "Test/CConcurrentThroughputTestTaskTester.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Test; namespace Control { namespace Loader { /*! * * \class CTestTaskThroughputLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTestTaskThroughputLoader : public CLoader { // public methods public: //! Constructor CTestTaskThroughputLoader(); //! Destructor virtual ~CTestTaskThroughputLoader(); virtual CLoader* init(CLoaderFactory* loaderFactory = 0, CConfiguration* config = 0); virtual CLoader* load(); virtual CLoader* exit(); // protected methods protected: // protected variables protected: CConfiguration* mConfiguration; CConcurrentThroughputTestTaskTester* tester; static const cint64 TESTTIMERID = 1; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_CTESTTASKTHROUGHPUTLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CTestMemoryAccessLoader.h0000644000175000017500000000533212520756362025760 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_CTestMemoryAccessLoader_H #define KONCLUDE_Control_LOADER_CTestMemoryAccessLoader_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" // Other includes #include "Test/CConcurrentMemoryAccessTester.h" #include "Concurrent/CIntervalThread.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Test; using namespace Concurrent; namespace Control { namespace Loader { /*! * * \class CTestMemoryAccessLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTestMemoryAccessLoader : public CIntervalThread, public CLoader { // public methods public: //! Constructor CTestMemoryAccessLoader(); //! Destructor virtual ~CTestMemoryAccessLoader(); virtual CLoader* init(CLoaderFactory* loaderFactory = 0, CConfiguration* config = 0); virtual CLoader* load(); virtual CLoader* exit(); // protected methods protected: virtual bool processTimer(qint64 timerID); // protected variables protected: cint64 mRemainingSteps; cint64 mSwitchRemainingSteps; CConfiguration* mConfiguration; cint64 mThreadCount; cint64 mMaxThreadCount; cint64 mReadWriteRatio; cint64 mReadWriteRatioStepMultiplier; cint64 mReadWriteRatioMax; cint64 mReadWriteRatioInit; cint64 mArraySize; cint64 mArraySizeStepMultiplier; cint64 mArraySizeMax; cint64 mArraySizeInit; bool mAtomicOperations; cint64 mOneThreadScore; CConcurrentMemoryAccessTester* tester; static const cint64 TESTTIMERID = 1; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_CTestMemoryAccessLoader_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationOntologyExtractionLoader.h0000644000175000017500000000744712520756362032141 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONONTOLOGYEXTRACTIONLOADER_H #define KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONONTOLOGYEXTRACTIONLOADER_H // Libraries includes #include #include #include #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CLoaderFactory.h" // Other includes #include "Config/CConfigDataReader.h" #include "Test/Evaluation/CReasonerEvaluationFiltering.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; using namespace Config; using namespace Test; using namespace Evaluation; namespace Control { namespace Loader { /*! * * \class CReasonerEvaluationOntologyExtractionLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationOntologyExtractionLoader : public CLoader { // public methods public: //! Constructor CReasonerEvaluationOntologyExtractionLoader(); //! Destructor virtual ~CReasonerEvaluationOntologyExtractionLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: CLoader* extractOntologiesForDirectory(const QString& dirString, const QString& subDirPathString); CLoader* extractOntologiesForTestcase(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString); bool satisfiesExtractionCondition(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString, const QStringList& statisticList); bool loadFilterConditions(const QString& fileNameString); CLoader* addExtractedOntologyStatistics(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString, const QStringList& statisticList); CLoader* copyExtractedOntology(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString); CLoader* saveExtractedOntologyStatistics(const QString& fileNameString); // protected variables protected: QString mInputDir; QString mOutputDir; QString mExtractedOntStatOutputFileString; QString mOntologyStatisticsDir; QString mFilterFile; CReasonerEvaluationFiltering* mFiltering; bool mCopyExtractedOntologyToOutput; bool mCollectExtractedOntologyStatistics; QList< QHash* > mExtractedOntStatHashList; QSet mExtractedStatsSet; QList mExtractedStatsList; CConfiguration *loaderConfig; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONONTOLOGYEXTRACTIONLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CRecursionTestDataGeneratorLoader.cpp0000644000175000017500000000421012520756362030325 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRecursionTestDataGeneratorLoader.h" namespace Konclude { namespace Control { namespace Loader { CRecursionTestDataGeneratorLoader::CRecursionTestDataGeneratorLoader() { mConfiguration = 0; generator = 0; } CRecursionTestDataGeneratorLoader::~CRecursionTestDataGeneratorLoader() { } CLoader* CRecursionTestDataGeneratorLoader::init(CLoaderFactory* loaderFactory, CConfiguration* config) { mConfiguration = config; return this; } CLoader *CRecursionTestDataGeneratorLoader::load() { generator = new COWLRecursionTestDataGenerator(); QString filename = CConfigDataReader::readConfigString(mConfiguration,"Konclude.Test.RecursionTestDataGenerator.OWLlinkOutputFile","RecursionTestData.owl.xml"); cint64 indiSize = CConfigDataReader::readConfigInteger(mConfiguration,"Konclude.Test.RecursionTestDataGenerator.IndividualCount",1000); cint64 probSize = CConfigDataReader::readConfigInteger(mConfiguration,"Konclude.Test.RecursionTestDataGenerator.PropertyAssertionCount",200); double ratio = (double)probSize/(double)indiSize; generator->generateData(indiSize,ratio,filename); delete generator; return this; } CLoader* CRecursionTestDataGeneratorLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationLoader.cpp0000644000175000017500000000673412520756360026674 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationLoader.h" namespace Konclude { namespace Control { namespace Loader { CReasonerEvaluationLoader::CReasonerEvaluationLoader() { mReasonerCommander = nullptr; mDeleteReasonerCommander = nullptr; mLoaderConfig = nullptr; } CReasonerEvaluationLoader::~CReasonerEvaluationLoader() { } CLoader *CReasonerEvaluationLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { mLoaderConfig = config; CConfigurationGroup* group = mLoaderConfig->getConfigurationGroup(); CConfigData* data = mLoaderConfig->createConfig("Konclude.Execution.CommanderManager"); CCommanderManagerConfigType* rCConfig = dynamic_cast(data->getConfigType()); if (rCConfig) { mReasonerCommander = dynamic_cast(rCConfig->getCommanderManager()); } if (!mReasonerCommander) { mDeleteReasonerCommander = mReasonerCommander = new CCommanderManagerThread(); rCConfig->setCommanderManager(mReasonerCommander); } group->setConfigDefaultData(group->getConfigIndex("Konclude.Execution.CommanderManager"),data); return this; } CLoader *CReasonerEvaluationLoader::load() { if (mDeleteReasonerCommander) { mDeleteReasonerCommander->realizeCommand(new CInitializeConfigurationCommand(mLoaderConfig)); } QString globalConfig = CConfigDataReader::readConfigString(mLoaderConfig,"Konclude.Evaluation.ConfigFile"); QString reasonerConfig = CConfigDataReader::readConfigString(mLoaderConfig,"Konclude.Evaluation.Reasoner.ConfigFile"); QString testInputDirectory = CConfigDataReader::readConfigString(mLoaderConfig,"Konclude.Evaluation.InputDirectory"); QString testOutputDirectory = CConfigDataReader::readConfigString(mLoaderConfig,"Konclude.Evaluation.OutputDirectory"); QString plattform = CConfigDataReader::readConfigString(mLoaderConfig,"Konclude.Evaluation.Platform"); CReasonerEvaluationTestsuite* reasonerEvalTestsuite = new CReasonerEvaluationTestsuite(); reasonerEvalTestsuite->initEvaluationTestsuite(globalConfig,reasonerConfig,testInputDirectory,testOutputDirectory,plattform,nullptr); CBlockingCallbackData blockCallData; CReasonerEvaluationExecutorThread* reasonerExecutorThread = new CReasonerEvaluationExecutorThread(mLoaderConfig); reasonerExecutorThread->executeEvaluation(reasonerEvalTestsuite,&blockCallData); blockCallData.waitForCallback(); delete reasonerExecutorThread; return this; } CLoader *CReasonerEvaluationLoader::exit() { delete mDeleteReasonerCommander; return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCLIClassificationBatchProcessingLoader.h0000644000175000017500000000472412520756356031017 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CCLICLASSIFICATIONBATCHPROCESSINGLOADER_H #define KONCLUDE_CONTROL_LOADER_CCLICLASSIFICATIONBATCHPROCESSINGLOADER_H // Libraries includes #include #include #include #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CLoaderFactory.h" #include "CCLIBatchProcessingLoader.h" // Other includes #include "Control/Interface/OWLlink/COWLlinkProcessor.h" #include "Control/Interface/OWLlink/COWLLinkRecordInterpreter.h" #include "Control/Command/CConfigManagerReader.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; namespace Control { using namespace Interface::OWLlink; using namespace Command; namespace Loader { /*! * * \class CCLIClassificationBatchProcessingLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCLIClassificationBatchProcessingLoader : public CCLIBatchProcessingLoader { // public methods public: //! Constructor CCLIClassificationBatchProcessingLoader(); //! Destructor virtual ~CCLIClassificationBatchProcessingLoader(); // protected methods protected: void createClassificationTestingCommands(); virtual void createTestingCommands(); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CCLICLASSIFICATIONBATCHPROCESSINGLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCoutLogObserverLoader.cpp0000644000175000017500000000333412520756356026150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCoutLogObserverLoader.h" namespace Konclude { namespace Control { namespace Loader { CCoutLogObserverLoader::CCoutLogObserverLoader() { } CCoutLogObserverLoader::~CCoutLogObserverLoader() { } CLoader *CCoutLogObserverLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { return this; } CLoader *CCoutLogObserverLoader::load() { if (!CSingletonProvider::hasInstance()) { CConsolePrintLogObserver *consoleSingletonLogObserver = CSingletonProvider::getInstance(); CLogger::getInstance()->removeObserverFromAllDomains(consoleSingletonLogObserver); CLogger::getInstance()->addLogObserver(consoleSingletonLogObserver); } return this; } CLoader *CCoutLogObserverLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CAnalyseReasonerLoader.h0000644000175000017500000000513212520756356025622 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_CANALYSEREASONERLOADER_H #define KONCLUDE_Control_LOADER_CANALYSEREASONERLOADER_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" #include "CDefaultReasonerLoader.h" // Other includes #include "Utilities/CSingletonProvider.hpp" #include "Control/Command/CCommanderManagerThread.h" #include "Control/Command/CCommanderManagerConfigType.h" #include "Control/Command/Instructions/CInitializeConfigurationCommand.h" #include "Control/Command/Instructions/CInitializeReasonerCommand.h" #include "Reasoner/Kernel/Manager/CAnalyseReasonerManager.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CConsolePrintLogObserver.h" namespace Konclude { using namespace Logger; using namespace Utilities; using namespace Reasoner::Kernel; using namespace Reasoner::Kernel::Algorithm; using namespace Reasoner::Kernel::Manager; namespace Control { using namespace Command; using namespace Instructions; namespace Loader { /*! * * \class CAnalyseReasonerLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAnalyseReasonerLoader : public CDefaultReasonerLoader { // public methods public: //! Constructor CAnalyseReasonerLoader(); //! Destructor virtual ~CAnalyseReasonerLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); // protected methods protected: // protected variables protected: CAnalyseReasonerManager *reasoner; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_CANALYSEREASONERLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCLIRealizationBatchProcessingLoader.cpp0000644000175000017500000000517112520756356030675 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCLIRealizationBatchProcessingLoader.h" namespace Konclude { namespace Control { namespace Loader { CCLIRealizationBatchProcessingLoader::CCLIRealizationBatchProcessingLoader() { } CCLIRealizationBatchProcessingLoader::~CCLIRealizationBatchProcessingLoader() { } void CCLIRealizationBatchProcessingLoader::createTestingCommands() { createRealizationTesingCommands(); } void CCLIRealizationBatchProcessingLoader::createRealizationTesingCommands() { if (mIRINameString.isEmpty()) { logOutputMessage(QString("Starting realization processing for ontology '%1'.").arg(mRequestFileString)); } else { logOutputMessage(QString("Starting realization processing of individual '%1' for ontology '%2'.").arg(mIRINameString).arg(mRequestFileString)); } QString testKB = QString("http://konclude.com/test/kb"); CCreateKnowledgeBaseCommand* createKBCommand = new CCreateKnowledgeBaseCommand(testKB); QStringList ontoIRIList; ontoIRIList.append(mRequestFileString); //CLoadKnowledgeBaseOWLXMLOntologyCommand* loadKBCommand = new CLoadKnowledgeBaseOWLXMLOntologyCommand(testKB,ontoIRIList); CLoadKnowledgeBaseOWLAutoOntologyCommand* loadKBCommand = new CLoadKnowledgeBaseOWLAutoOntologyCommand(testKB,ontoIRIList); CRealizeQueryCommand* realizeKBCommand = new CRealizeQueryCommand(testKB); addProcessingCommand(createKBCommand); addProcessingCommand(loadKBCommand); addProcessingCommand(realizeKBCommand); if (!mResponseFileString.isEmpty()) { CWriteXMLIndividualTypesQueryCommand* realizeKBCommand = new CWriteXMLIndividualTypesQueryCommand(testKB,mResponseFileString,mIRINameString); addProcessingCommand(realizeKBCommand); } processNextCommand(); } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader.hKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationTestcaseStatisticCollectionG0000644000175000017500000000576712520756362032502 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader_H #define KONCLUDE_CONTROL_LOADER_CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader_H // Libraries includes #include #include #include #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CLoaderFactory.h" // Other includes #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; using namespace Config; namespace Control { namespace Loader { /*! * * \class CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader : public CLoader { // public methods public: //! Constructor CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader(); //! Destructor virtual ~CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: CLoader *collectTestcasesStatisticsForDirectory(const QString& dirString, const QString& subDirPathString); CLoader *collectTestcasesStatisticsForTestcase(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString); QStringList collectOntologyIRIs(const QDomElement& element); QStringList collectOntologyIRIsStatistics(const QStringList& ontoIRIList); // protected variables protected: QString mInputDir; QString mOntologyStatisticsDir; QString mResponseStatisticsOutputDir; CConfiguration *loaderConfig; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CDefaultReasonerLoader.cpp0000644000175000017500000000420012520756360026133 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDefaultReasonerLoader.h" namespace Konclude { namespace Control { namespace Loader { CDefaultReasonerLoader::CDefaultReasonerLoader() { } CDefaultReasonerLoader::~CDefaultReasonerLoader() { } CLoader *CDefaultReasonerLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { reasonerCommander = new CCommanderManagerThread(); configuration = config; CConfigurationGroup *group = configuration->getConfigurationGroup(); CConfigData *data = configuration->createConfig("Konclude.Execution.CommanderManager"); CCommanderManagerConfigType *rCConfig = dynamic_cast(data->getConfigType()); if (rCConfig) { rCConfig->setCommanderManager(reasonerCommander); } group->setConfigDefaultData(group->getConfigIndex("Konclude.Execution.CommanderManager"),data); return this; } CLoader *CDefaultReasonerLoader::load() { reasonerCommander->realizeCommand(new CInitializeConfigurationCommand(configuration)); reasonerCommander->realizeCommand(new CInitializeReasonerCommand(new CDefaultCommanderInitializationFactory())); return this; } CLoader *CDefaultReasonerLoader::exit() { delete reasonerCommander; return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/COWLlinkHttpServerLoader.cpp0000644000175000017500000000350512520756360026425 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLlinkHttpServerLoader.h" namespace Konclude { namespace Control { namespace Loader { COWLlinkHttpServerLoader::COWLlinkHttpServerLoader() { loaderConfig = 0; } COWLlinkHttpServerLoader::~COWLlinkHttpServerLoader() { } CLoader *COWLlinkHttpServerLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { loaderConfig = config; mPort = CConfigDataReader::readConfigInteger(loaderConfig,"Konclude.OWLlink.Server.Port",8080); return this; } CLoader *COWLlinkHttpServerLoader::load() { mHanlderFactory = new COWLlinkHttpConnectionHandlerProcessorFactory(loaderConfig); mHandlerPool = new CQtHttpConnectionHandlerPooledFactory(mHanlderFactory); mHttpListner = new CQtHttpListner(mHanlderFactory,mPort); return this; } CLoader *COWLlinkHttpServerLoader::exit() { delete mHttpListner; delete mHandlerPool; delete mHanlderFactory; return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CConfigurableCoutLogObserverLoader.cpp0000644000175000017500000000555512520756356030500 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfigurableCoutLogObserverLoader.h" namespace Konclude { namespace Control { namespace Loader { CConfigurableCoutLogObserverLoader::CConfigurableCoutLogObserverLoader() { consoleSingletonLogObserver = 0; } CConfigurableCoutLogObserverLoader::~CConfigurableCoutLogObserverLoader() { } CLoader *CConfigurableCoutLogObserverLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { return this; } CLoader *CConfigurableCoutLogObserverLoader::load() { QStringList infoDomainList; infoDomainList<addLogObserver(consoleSingletonLogObserver); return this; } CLoader *CConfigurableCoutLogObserverLoader::exit() { CLogger::getInstance()->removeObserverFromAllDomains(consoleSingletonLogObserver); delete consoleSingletonLogObserver; return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCLIConsistencyBatchProcessingLoader.cpp0000644000175000017500000001057312520756356030717 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCLIConsistencyBatchProcessingLoader.h" namespace Konclude { namespace Control { namespace Loader { CCLIConsistencyBatchProcessingLoader::CCLIConsistencyBatchProcessingLoader() { } CCLIConsistencyBatchProcessingLoader::~CCLIConsistencyBatchProcessingLoader() { } void CCLIConsistencyBatchProcessingLoader::createTestingCommands() { createConsistencyTestingCommands(); } void CCLIConsistencyBatchProcessingLoader::createConsistencyTestingCommands() { logOutputMessage(QString("Starting consistency checking for '%1'.").arg(mRequestFileString)); QString testKB = QString("http://konclude.com/test/kb"); CCreateKnowledgeBaseCommand* createKBCommand = new CCreateKnowledgeBaseCommand(testKB); QStringList ontoIRIList; ontoIRIList.append(mRequestFileString); //CLoadKnowledgeBaseOWLXMLOntologyCommand* loadKBCommand = new CLoadKnowledgeBaseOWLXMLOntologyCommand(testKB,ontoIRIList); CLoadKnowledgeBaseOWLAutoOntologyCommand* loadKBCommand = new CLoadKnowledgeBaseOWLAutoOntologyCommand(testKB,ontoIRIList); mConsistencyKBCommand = new CIsConsistentQueryCommand(testKB); mTriviallyConsistencyKBCommand = new CIsTriviallyConsistentQueryCommand(testKB); addProcessingCommand(createKBCommand); addProcessingCommand(loadKBCommand); addProcessingCommand(mTriviallyConsistencyKBCommand,false,"",true,mResponseFileString); processNextCommand(); } void CCLIConsistencyBatchProcessingLoader::writeCommandOutput(const QString& outputFileName, CCommand* processedCommand) { bool outputWritten = false; bool requiresDetailedConsistencyChecking = true; CKnowledgeBaseQueryCommand* kbQueryCommand = dynamic_cast(processedCommand); if (kbQueryCommand) { CQuery* query = kbQueryCommand->getCalculateQueryCommand()->getQuery(); if (query) { CQueryResult* queryResult = query->getQueryResult(); if (queryResult) { CBooleanQueryResult* boolQueryResult = dynamic_cast(queryResult); if (boolQueryResult) { bool writeOutput = false; if (boolQueryResult->getResult() == true) { requiresDetailedConsistencyChecking = false; writeOutput = true; logOutputMessage(QString("Ontology '%1' is consistent.").arg(mRequestFileString)); } else { if (processedCommand == mConsistencyKBCommand) { requiresDetailedConsistencyChecking = false; writeOutput = true; logOutputMessage(QString("Ontology '%1' is inconsistent.").arg(mRequestFileString)); } } if (writeOutput) { outputWritten = true; if (!outputFileName.isEmpty()) { forcedPathCreated(outputFileName); QFile outputFile(outputFileName); if (outputFile.open(QIODevice::WriteOnly)) { QString outputData; if (boolQueryResult->getResult() == true) { outputData = QString("true\n"); } else { outputData = QString("false\n"); } outputFile.write(outputData.toUtf8()); outputFile.close(); } else { logOutputError(QString("Failed writing output to file '%1'.").arg(outputFileName)); } } } } } } } if (requiresDetailedConsistencyChecking) { addProcessingCommand(mConsistencyKBCommand,false,"",true,mResponseFileString); } else if (!outputWritten) { logOutputError("Consistency checking failed."); } } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationClassificationTimesComparerLoader.hKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationClassificationTimesComparerL0000644000175000017500000000644212520756360032443 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONCLASSIFICATIONTIMESCOMPARERLOADER_H #define KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONCLASSIFICATIONTIMESCOMPARERLOADER_H // Libraries includes #include #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CLoaderFactory.h" // Other includes #include "Test/Evaluation/CReasonerEvaluationCollector.h" #include "Test/Evaluation/CReasonerEvaluationClassificationTimeExtractor.h" #include "Test/Evaluation/CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" #include "Test/Evaluation/CReasonerEvaluationAvaragerSummarizer.h" #include "Test/Evaluation/CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser.h" #include "Test/Evaluation/CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser.h" #include "Test/Evaluation/CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser.h" #include "Test/Evaluation/CReasonerEvaluationHighchartPlotter.h" #include "Test/Evaluation/CReasonerEvaluationPathConverter.h" #include "Test/Evaluation/CReasonerEvaluationExpressivitySelectorFactory.h" #include "Test/Evaluation/CReasonerEvaluationDirectoryStructureSelectorFactory.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; using namespace Test::Evaluation; namespace Control { namespace Loader { /*! * * \class CReasonerEvaluationClassificationTimesComparerLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationClassificationTimesComparerLoader : public CLoader { // public methods public: //! Constructor CReasonerEvaluationClassificationTimesComparerLoader(); //! Destructor virtual ~CReasonerEvaluationClassificationTimesComparerLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: // protected variables protected: QString mInputDir; QString mOutputDir; QString mOutputDirClassify; CConfiguration *loaderConfig; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONCLASSIFICATIONTIMESCOMPARERLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCloser.h0000644000175000017500000000337012520756356022631 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_CCLOSER_H #define KONCLUDE_Control_LOADER_CCLOSER_H // Libraries includes #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Control { namespace Loader { /*! * * \class CCloser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCloser { // public methods public: //! Constructor CCloser(); //! Destructor virtual ~CCloser(); virtual CCloser *conclude(CLoader *loader) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_CCLOSER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CLoaderFactory.h0000644000175000017500000000415312520756360024133 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_CLOADERFACTORY_H #define KONCLUDE_Control_LOADER_CLOADERFACTORY_H // Libraries includes #include #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" // Other includes #include "Config/CConfiguration.h" #include "Control/Command/CReasonerConfigurationGroup.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Config; namespace Control { using namespace Command; namespace Loader { /*! * * \class CLoaderFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLoaderFactory { // public methods public: //! Constructor CLoaderFactory(); //! Destructor virtual ~CLoaderFactory(); virtual CLoader *createLoaderFromName(const QString &loaderName, CConfiguration *config = 0) = 0; virtual bool canCreateLoaderFromName(const QString &loaderName, CConfiguration *config = 0) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_CLOADERFACTORY_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CTestHashModificationLoader.cpp0000644000175000017500000000767312520756362027144 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTestHashModificationLoader.h" namespace Konclude { namespace Control { namespace Loader { CTestHashModificationLoader::CTestHashModificationLoader() : CIntervalThread("TestHashModificationThread") { mConfiguration = 0; tester = 0; startThread(); } CTestHashModificationLoader::~CTestHashModificationLoader() { } CLoader* CTestHashModificationLoader::init(CLoaderFactory* loaderFactory, CConfiguration* config) { mConfiguration = config; return this; } CLoader *CTestHashModificationLoader::load() { tester = new CConcurrentHashModificationTester(); mRemainingSteps = 1; mThreadCount = 1; mMaxThreadCount = 10; mUseModificatedHashes = false; mExtendBaseHashes = false; mHashModCountPerStep = 4; mMaxHashModCountPerStep = 16384; tester->generateTestingStructure(mThreadCount,mHashModCountPerStep,mUseModificatedHashes,mExtendBaseHashes); tester->startHashModificationTest(); startTimerWithInterval(TESTTIMERID,10000); cout<<"Starting concurrent hash modification performance test.\n"; cout<<"----------------------\n"; return this; } bool CTestHashModificationLoader::processTimer(qint64 timerID) { if (timerID == TESTTIMERID) { if (mRemainingSteps > 0) { cint64 modSteps = tester->getModificationStepsCount(); tester->stopHashModificationTest(); tester->destroyTestingStructure(); if (mThreadCount == 1) { mOneThreadScore = modSteps; } cout<<""<> "<<"Hash Modification Score: \t"< 0) { tester->generateTestingStructure(mThreadCount,mHashModCountPerStep,mUseModificatedHashes,mExtendBaseHashes); tester->startHashModificationTest(); } } else { cout<<"Test finished.\n"; stopThread(false); } return true; } return false; } CLoader* CTestHashModificationLoader::exit() { if (tester) { delete tester; } return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CORECoutLogObserverLoader.cpp0000644000175000017500000000351412520756360026511 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CORECoutLogObserverLoader.h" namespace Konclude { namespace Control { namespace Loader { CORECoutLogObserverLoader::CORECoutLogObserverLoader() { consoleSingletonLogObserver = 0; } CORECoutLogObserverLoader::~CORECoutLogObserverLoader() { } CLoader *CORECoutLogObserverLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { return this; } CLoader *CORECoutLogObserverLoader::load() { QStringList infoDomainList; infoDomainList<addLogObserver(consoleSingletonLogObserver); return this; } CLoader *CORECoutLogObserverLoader::exit() { CLogger::getInstance()->removeObserverFromAllDomains(consoleSingletonLogObserver); delete consoleSingletonLogObserver; return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/COWLFilesIncompatibleAxiomChangerLoader.cpp0000644000175000017500000000606212520756360031321 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLFilesIncompatibleAxiomChangerLoader.h" namespace Konclude { namespace Control { namespace Loader { COWLFilesIncompatibleAxiomChangerLoader::COWLFilesIncompatibleAxiomChangerLoader() { loaderConfig = nullptr; } COWLFilesIncompatibleAxiomChangerLoader::~COWLFilesIncompatibleAxiomChangerLoader() { } CLoader *COWLFilesIncompatibleAxiomChangerLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { loaderConfig = config; CConfigData *data = config->getLastConfigChange("Konclude.Test.Converter.InputDirectory"); if (data) { mInputDir = data->getString(); } data = config->getLastConfigChange("Konclude.Test.Converter.OutputDirectory"); if (data) { mOutputDir = data->getString(); } return this; } CLoader *COWLFilesIncompatibleAxiomChangerLoader::load() { COWLFileAxiomRemover* changer = new COWLFileAxiomRemover(loaderConfig); QDir inputDir(mInputDir); QDir outputDir(mOutputDir); outputDir.mkpath("."); foreach (QString fileString, inputDir.entryList(QDir::Files)) { QString absoluteFileString = inputDir.absoluteFilePath(fileString); QString outFileString = fileString; cint64 fiIn = outFileString.lastIndexOf(".owl.xml"); if (fiIn == -1) { fiIn = outFileString.lastIndexOf(".xml"); } if (fiIn == -1) { fiIn = outFileString.lastIndexOf(".owl"); } if (fiIn == -1) { fiIn = outFileString.lastIndexOf("."); } if (fiIn != -1) { outFileString.replace(fiIn,1,"-A."); } if (mOutputDir.endsWith("/")) { outFileString = mOutputDir+outFileString; } else { outFileString = mOutputDir+"/"+outFileString; } outFileString.replace(".obo",""); if (!outFileString.contains(".owl.xml")) { outFileString.replace(".owl",".owl.xml"); } changer->loadRemoveAxiomsAndSave(absoluteFileString,outFileString); } LOG(INFO,"::Konclude::Converter::FileAxiomChanger",logTr("Converted all files in %1 to %2.").arg(mInputDir).arg(mOutputDir),this); delete changer; return this; } CLoader *COWLFilesIncompatibleAxiomChangerLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationProgramLoader.cpp0000644000175000017500000001100012520756362030204 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationProgramLoader.h" namespace Konclude { namespace Control { namespace Loader { CReasonerEvaluationProgramLoader::CReasonerEvaluationProgramLoader() { mReasonerCommander = nullptr; mDeleteReasonerCommander = nullptr; mLoaderConfig = nullptr; } CReasonerEvaluationProgramLoader::~CReasonerEvaluationProgramLoader() { } CLoader *CReasonerEvaluationProgramLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { mLoaderConfig = config; CConfigurationGroup* group = mLoaderConfig->getConfigurationGroup(); CConfigData* data = mLoaderConfig->createConfig("Konclude.Execution.CommanderManager"); CCommanderManagerConfigType* rCConfig = dynamic_cast(data->getConfigType()); if (rCConfig) { mReasonerCommander = dynamic_cast(rCConfig->getCommanderManager()); } if (!mReasonerCommander) { mDeleteReasonerCommander = mReasonerCommander = new CCommanderManagerThread(); rCConfig->setCommanderManager(mReasonerCommander); } group->setConfigDefaultData(group->getConfigIndex("Konclude.Execution.CommanderManager"),data); data = config->getLastConfigChange("Konclude.Evaluation.ProgramFile"); if (data) { mProgramFileString = data->getString(); } mCloseAfterOutput = true; return this; } CLoader *CReasonerEvaluationProgramLoader::load() { if (mReasonerCommander) { mReasonerCommander->realizeCommand(new CInitializeConfigurationCommand(mLoaderConfig)); } startProcessing(); mBlockingSem.acquire(); return this; } COWLlinkProcessor *CReasonerEvaluationProgramLoader::initializeOWLlinkContent() { if (!mProgramFileString.isEmpty()) { QFile file(mProgramFileString); LOG(INFO,getLogDomain(),logTr("Processing evaluation program from file '%1'.").arg(mProgramFileString),this); if (file.open(QIODevice::ReadOnly)) { fileContent = file.readAll(); COWLlinkQtXMLCommandParser *owllinkCommandParser = new COWLlinkQtXMLCommandParser(); defaultCommandDelegater = preSynchronizer; CParseOWLlinkCommandsCommand *parseCommand = new CParseOWLlinkCommandsCommand(&fileContent,mProgramFileString); parseCommand->setReportErrorFromSubCommands(false); CCommandProcessedCallbackEvent *proComm = new CCommandProcessedCallbackEvent(this,parseCommand); parseCommand->addProcessedCallback(proComm); owllinkCommandParser->realizeCommand(parseCommand,defaultCommandDelegater); delete owllinkCommandParser; } else { LOG(ERROR,getLogDomain(),logTr("Evaluation program file '%1' not found.").arg(mProgramFileString),this); concludeOWLlinkContent(); } } return this; } CConfiguration *CReasonerEvaluationProgramLoader::getConfiguration() { if (!mReasonerCommander) { return mLoaderConfig; } else { CGetDescriptionCommand *getDesComm = new CGetDescriptionCommand(); mReasonerCommander->delegateCommand(getDesComm); CCommandExecutedBlocker commExeBlocker; commExeBlocker.waitExecutedCommand(getDesComm); CConfiguration *config = getDesComm->getConfiguration(); return config; } } COWLlinkProcessor *CReasonerEvaluationProgramLoader::concludeOWLlinkContent() { mBlockingSem.release(); if (mCloseAfterOutput) { CLogger::getInstance()->waitSynchronization(); //qSleep(10); //qWait(); QCoreApplication::exit(); } return this; } CLoader *CReasonerEvaluationProgramLoader::exit() { stopThread(); delete mDeleteReasonerCommander; return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCLIBatchProcessingLoader.h0000644000175000017500000001214012520756356026132 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CCLIBATCHPROCESSINGLOADER_H #define KONCLUDE_CONTROL_LOADER_CCLIBATCHPROCESSINGLOADER_H // Libraries includes #include #include #include #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CLoaderFactory.h" // Other includes #include "Control/Interface/OWLlink/COWLlinkProcessor.h" #include "Control/Interface/OWLlink/COWLLinkRecordInterpreter.h" #include "Control/Command/CConfigManagerReader.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include "Logger/COREConsolePrintLogObserver.h" #include "Logger/COREFilePrintLogObserver.h" #include #include namespace Konclude { using namespace Logger; namespace Control { using namespace Interface::OWLlink; using namespace Command; namespace Loader { /*! * * \class CCLIBatchProcessingLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCLIBatchProcessingLoader : public CLoader, public COWLlinkProcessor, public CCommandRecorder { // public methods public: //! Constructor CCLIBatchProcessingLoader(); //! Destructor virtual ~CCLIBatchProcessingLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); virtual CCommandRecorder *recordData(CCommandRecordData *recData); // protected methods protected: class CCommandProcessData { public: CCommandProcessData(CCommand* command){ mCommand = command; mMeasureTime = false; mWriteOutput = false; } CCommandProcessData(CCommand* command, bool measureTime, const QString& measuredOutputString) { mCommand = command; mMeasureTime = measureTime; mMeasuredOutputString = measuredOutputString; mWriteOutput = false; } CCommandProcessData(CCommand* command, bool measureTime, const QString& measuredOutputString, bool writeOutput, const QString& outputFileName) { mCommand = command; mMeasureTime = measureTime; mMeasuredOutputString = measuredOutputString; mWriteOutput = writeOutput; mWriteOutputFile = outputFileName; } public: CCommand* mCommand; bool mMeasureTime; QString mMeasuredOutputString; bool mWriteOutput; QString mWriteOutputFile; }; virtual COWLlinkProcessor* initializeOWLlinkContent(); virtual COWLlinkProcessor* concludeOWLlinkContent(); virtual CConfiguration* getConfiguration(); virtual void createTestingCommands(); void addProcessingCommand(CCommand* command); void addProcessingCommand(CCommand* command, bool measureTime, const QString& measuredOutputString); void addProcessingCommand(CCommand* command, bool measureTime, const QString& measuredOutputString, bool writeSatisfiabilityOutput, const QString& outputFileName); bool hasMoreProcessingCommands(); void terminateProcessing(); void processNextCommand(); void finishCommandProcessing(); virtual void finishProcessing(); void logOutputNotice(const QString& outputString); void logOutputMessage(const QString& outputString); void logOutputError(const QString& errorString); void forcedPathCreated(const QString& filePath); virtual void writeCommandOutput(const QString& outputFileName, CCommand* processedCommand); // protected variables protected: QString mIRINameString; QString mRequestFileString; QString mResponseFileString; CLogIdentifier mLogIdentifier; QList mProcessCommandList; CCommandProcessData* mProcessingCommandData; QTime mTotalTime; bool mLogTotalProcessingTime; bool mCloseAfterOutput; bool mOutputMeasuredTimeInSeconds; bool mBlockUntilProcessed; QTime mMeasurementTime; QSemaphore mBlockingSemaphore; COWLLinkRecordInterpreter* mOWLLinkInterpreter; CConfiguration* mLoaderConfig; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CCLIBATCHPROCESSINGLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CAnalyseReasonerLoader.cpp0000644000175000017500000000301312520756356026151 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnalyseReasonerLoader.h" namespace Konclude { namespace Control { namespace Loader { CAnalyseReasonerLoader::CAnalyseReasonerLoader() { } CAnalyseReasonerLoader::~CAnalyseReasonerLoader() { } CLoader *CAnalyseReasonerLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { CConfigurationGroup *group = config->getConfigurationGroup(); CConfigData *data = config->createAndSetConfig("Konclude.Execution.DefaultReasonerManager"); if (data) { data->readFromString("ASAnalyseReasonerManager"); } CDefaultReasonerLoader::init(loaderFactory,config); return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCLIBatchProcessingLoader.cpp0000644000175000017500000001614212605000760026454 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCLIBatchProcessingLoader.h" namespace Konclude { namespace Control { namespace Loader { CCLIBatchProcessingLoader::CCLIBatchProcessingLoader() : mLogIdentifier("::Konclude::CLIBatchProcessor",this) { mOWLLinkInterpreter = nullptr; mLoaderConfig = nullptr; mConfLogProcessingTimes = false; mProcessingCommandData = nullptr; mLogTotalProcessingTime = false; mCloseAfterOutput = true; mBlockUntilProcessed = true; } CCLIBatchProcessingLoader::~CCLIBatchProcessingLoader() { } CCommandRecorder* CCLIBatchProcessingLoader::recordData(CCommandRecordData *recData) { LOGC(recData->getRecordErrorLevel(),recData->getRecordDomain(),recData->getRecordMessage(),recData->getCommand()); return this; } CLoader *CCLIBatchProcessingLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { mLoaderConfig = config; reasonerCommander = CConfigManagerReader::readCommanderManagerConfig(config); mRequestFileString = CConfigDataReader::readConfigString(config,"Konclude.CLI.RequestFile"); mResponseFileString = CConfigDataReader::readConfigString(config,"Konclude.CLI.ResponseFile"); mIRINameString = CConfigDataReader::readConfigString(config,"Konclude.CLI.IRIName"); mConfLogProcessingTimes = mLogTotalProcessingTime = CConfigDataReader::readConfigBoolean(config,"Konclude.OWLlink.LoggingExtendedProcessingTimes"); return this; } CLoader *CCLIBatchProcessingLoader::load() { startProcessing(); if (mBlockUntilProcessed) { mBlockingSemaphore.acquire(); } return this; } CConfiguration *CCLIBatchProcessingLoader::getConfiguration() { if (!reasonerCommander) { return mLoaderConfig; } else { CGetDescriptionCommand* getDesComm = new CGetDescriptionCommand(); reasonerCommander->delegateCommand(getDesComm); CCommandExecutedBlocker commExeBlocker; commExeBlocker.waitExecutedCommand(getDesComm); CConfiguration* config = getDesComm->getConfiguration(); return config; } } void CCLIBatchProcessingLoader::createTestingCommands() { } void CCLIBatchProcessingLoader::addProcessingCommand(CCommand* command) { mProcessCommandList.append(new CCommandProcessData(command)); } void CCLIBatchProcessingLoader::addProcessingCommand(CCommand* command, bool measureTime, const QString& measuredOutputString) { mProcessCommandList.append(new CCommandProcessData(command,measureTime,measuredOutputString)); } void CCLIBatchProcessingLoader::addProcessingCommand(CCommand* command, bool measureTime, const QString& measuredOutputString, bool writeSatisfiabilityOutput, const QString& outputFileName) { mProcessCommandList.append(new CCommandProcessData(command,measureTime,measuredOutputString,writeSatisfiabilityOutput,outputFileName)); } COWLlinkProcessor *CCLIBatchProcessingLoader::initializeOWLlinkContent() { if (mLogTotalProcessingTime) { mTotalTime.start(); } createTestingCommands(); return this; } COWLlinkProcessor *CCLIBatchProcessingLoader::concludeOWLlinkContent() { finishCommandProcessing(); if (hasMoreProcessingCommands()) { processNextCommand(); } else { finishProcessing(); terminateProcessing(); } return this; } void CCLIBatchProcessingLoader::logOutputError(const QString& errorString) { LOG(ERROR,mLogIdentifier.getLogDomain(),errorString,this); } void CCLIBatchProcessingLoader::logOutputNotice(const QString& outputString) { LOG(NOTICE,mLogIdentifier.getLogDomain(),outputString,this); } void CCLIBatchProcessingLoader::logOutputMessage(const QString& outputString) { LOG(INFO,mLogIdentifier.getLogDomain(),outputString,this); } void CCLIBatchProcessingLoader::forcedPathCreated(const QString& filePath) { QString path = filePath; if (path.contains("/") || path.contains("\\")) { int lastSlash = path.lastIndexOf("/"); int lastBackSlash = path.lastIndexOf("\\"); int lastSeparator = qMax(lastBackSlash,lastSlash); path = path.mid(0,lastSeparator); if (!path.isEmpty()) { QDir dir; dir.mkpath(path); } } } void CCLIBatchProcessingLoader::writeCommandOutput(const QString& outputFileName, CCommand* processedCommand) { } void CCLIBatchProcessingLoader::finishCommandProcessing() { if (mProcessingCommandData) { if (mProcessingCommandData->mMeasureTime) { QString outputString = mProcessingCommandData->mMeasuredOutputString; cint64 timeElapsed = mMeasurementTime.elapsed(); if (mOutputMeasuredTimeInSeconds) { logOutputMessage(outputString.arg(timeElapsed/1000.)); } else { logOutputMessage(outputString.arg(timeElapsed)); } } if (mProcessingCommandData->mWriteOutput) { QString outputFile = mProcessingCommandData->mWriteOutputFile; writeCommandOutput(outputFile,mProcessingCommandData->mCommand); } mProcessingCommandData = nullptr; } } void CCLIBatchProcessingLoader::processNextCommand() { mProcessingCommandData = mProcessCommandList.takeFirst(); CCommand* command = mProcessingCommandData->mCommand; logOutputNotice(QString("Starting '%1' command").arg(command->getBriefCommandDescription())); command->setRecorder(this); command->setReportErrorFromSubCommands(false); CCommandProcessedCallbackEvent *proComm = new CCommandProcessedCallbackEvent(this,command); command->addProcessedCallback(proComm); mMeasurementTime.start(); preSynchronizer->delegateCommand(command); } bool CCLIBatchProcessingLoader::hasMoreProcessingCommands() { return !mProcessCommandList.isEmpty(); } void CCLIBatchProcessingLoader::finishProcessing() { } void CCLIBatchProcessingLoader::terminateProcessing() { if (mLogTotalProcessingTime) { cint64 timeElapsed = mTotalTime.elapsed(); logOutputMessage(QString("Total processing time: %1 ms.").arg(timeElapsed)); } if (mBlockUntilProcessed) { mBlockingSemaphore.release(); } if (mCloseAfterOutput) { CLogger::getInstance()->waitSynchronization(); QCoreApplication::exit(); } } CLoader *CCLIBatchProcessingLoader::exit() { stopThread(); return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCLIRealizationBatchProcessingLoader.h0000644000175000017500000000423412520756356030341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CCLIREALIZATIONBATCHPROCESSINGLOADER_H #define KONCLUDE_CONTROL_LOADER_CCLIREALIZATIONBATCHPROCESSINGLOADER_H // Libraries includes #include #include #include #include // Namespace includes #include "LoaderSettings.h" #include "CCLIBatchProcessingLoader.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; namespace Control { namespace Loader { /*! * * \class CCLIRealizationBatchProcessingLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCLIRealizationBatchProcessingLoader : public CCLIBatchProcessingLoader { // public methods public: //! Constructor CCLIRealizationBatchProcessingLoader(); //! Destructor virtual ~CCLIRealizationBatchProcessingLoader(); // protected methods protected: void createRealizationTesingCommands(); virtual void createTestingCommands(); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CCLIREALIZATIONBATCHPROCESSINGLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CTestMemoryAccessLoader.cpp0000644000175000017500000001015212520756362026307 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTestMemoryAccessLoader.h" namespace Konclude { namespace Control { namespace Loader { CTestMemoryAccessLoader::CTestMemoryAccessLoader() : CIntervalThread("TestMemoryAccessThread") { mConfiguration = 0; tester = 0; startThread(); } CTestMemoryAccessLoader::~CTestMemoryAccessLoader() { } CLoader* CTestMemoryAccessLoader::init(CLoaderFactory* loaderFactory, CConfiguration* config) { mConfiguration = config; return this; } CLoader *CTestMemoryAccessLoader::load() { tester = new CConcurrentMemoryAccessTester(); mRemainingSteps = 1; mThreadCount = 1; mMaxThreadCount = 10; mReadWriteRatioInit = mReadWriteRatio = 1; mReadWriteRatioMax = 256; mReadWriteRatioStepMultiplier = 4; mAtomicOperations = false; mArraySizeInit = mArraySize = 2621440; mArraySizeStepMultiplier = 4; mArraySizeMax = Q_INT64_C(671088640); mArraySizeInit = mArraySize = 1310720; mArraySizeStepMultiplier = 4; mArraySizeMax = Q_INT64_C(335544320); startTimerWithInterval(TESTTIMERID,5000); tester->generateTestingStructure(mArraySize,mReadWriteRatio,mAtomicOperations,mThreadCount); tester->startHashModificationTest(); cout<<"Starting concurrent memory access performance test.\n"; cout<<"----------------------\n"; return this; } bool CTestMemoryAccessLoader::processTimer(qint64 timerID) { if (timerID == TESTTIMERID) { if (mRemainingSteps > 0) { cint64 modSteps = tester->getModificationStepsCount(); tester->stopHashModificationTest(); tester->destroyTestingStructure(); if (mThreadCount == 1) { mOneThreadScore = modSteps; } cout<<""<> Modification Score: \t"< 0) { tester->generateTestingStructure(mArraySize,mReadWriteRatio,mAtomicOperations,mThreadCount); tester->startHashModificationTest(); } } else { cout<<"Test finished.\n"; stopThread(false); } return true; } return false; } CLoader* CTestMemoryAccessLoader::exit() { if (tester) { delete tester; } return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CExperimentalReasonerLoader.h0000644000175000017500000000513112520756360026655 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_CEXPERIMENTALREASONERLOADER_H #define KONCLUDE_Control_LOADER_CEXPERIMENTALREASONERLOADER_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" #include "CDefaultReasonerLoader.h" // Other includes #include "Utilities/CSingletonProvider.hpp" #include "Control/Command/CCommanderManagerThread.h" #include "Control/Command/CCommanderManagerConfigType.h" #include "Control/Command/Instructions/CInitializeConfigurationCommand.h" #include "Control/Command/Instructions/CInitializeReasonerCommand.h" #include "Reasoner/Kernel/Manager/CExperimentalReasonerManager.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CConsolePrintLogObserver.h" namespace Konclude { using namespace Logger; using namespace Utilities; using namespace Reasoner::Kernel; using namespace Reasoner::Kernel::Algorithm; using namespace Reasoner::Kernel::Manager; namespace Control { using namespace Command; using namespace Instructions; namespace Loader { /*! * * \class CExperimentalReasonerLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExperimentalReasonerLoader : public CDefaultReasonerLoader { // public methods public: //! Constructor CExperimentalReasonerLoader(); //! Destructor virtual ~CExperimentalReasonerLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_CEXPERIMENTALREASONERLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/LoaderSettings.h0000644000175000017500000000266612520756362024232 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_LOADERSETTINGS #define KONCLUDE_Control_LOADER_LOADERSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Control { namespace Loader { /*! * * \file LoaderSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CLoaderFactory; class CLoader; class CCloser; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // end KONCLUDE_Control_LOADER_LOADERSETTINGS Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CTestHashModificationLoader.h0000644000175000017500000000514512520756362026601 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_CTESTHASHMODIFICATIONLOADER_H #define KONCLUDE_Control_LOADER_CTESTHASHMODIFICATIONLOADER_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" // Other includes #include "Test/CConcurrentHashModificationTester.h" #include "Concurrent/CIntervalThread.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Test; using namespace Concurrent; namespace Control { namespace Loader { /*! * * \class CTestHashModificationLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTestHashModificationLoader : public CIntervalThread, public CLoader { // public methods public: //! Constructor CTestHashModificationLoader(); //! Destructor virtual ~CTestHashModificationLoader(); virtual CLoader* init(CLoaderFactory* loaderFactory = 0, CConfiguration* config = 0); virtual CLoader* load(); virtual CLoader* exit(); // protected methods protected: virtual bool processTimer(qint64 timerID); // protected variables protected: cint64 mRemainingSteps; cint64 mSwitchRemainingSteps; CConfiguration* mConfiguration; cint64 mThreadCount; cint64 mMaxThreadCount; cint64 mHashModCountPerStep; cint64 mMaxHashModCountPerStep; bool mUseModificatedHashes; bool mExtendBaseHashes; cint64 mOneThreadScore; CConcurrentHashModificationTester* tester; static const cint64 TESTTIMERID = 1; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_CTESTHASHMODIFICATIONLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CLoggerConfigurationLoader.cpp0000644000175000017500000000334412520756360027027 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLoggerConfigurationLoader.h" namespace Konclude { namespace Control { namespace Loader { CLoggerConfigurationLoader::CLoggerConfigurationLoader() { } CLoggerConfigurationLoader::~CLoggerConfigurationLoader() { } CLoader *CLoggerConfigurationLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { mLoaderConfig = config; return this; } CLoader *CLoggerConfigurationLoader::load() { cint64 minLoggingLevel = CConfigDataReader::readConfigInteger(mLoaderConfig,"Konclude.Logging.MinLoggingLevel"); cint64 maxMessageCount = CConfigDataReader::readConfigInteger(mLoaderConfig,"Konclude.Logging.MaxLogMessageCount"); CLogger::getInstance()->configureLogger(maxMessageCount,minLoggingLevel); return this; } CLoader *CLoggerConfigurationLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationLoadingTimesComparerLoader.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationLoadingTimesComparerLoader.c0000644000175000017500000001533312520756362032322 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationLoadingTimesComparerLoader.h" namespace Konclude { namespace Control { namespace Loader { CReasonerEvaluationLoadingTimesComparerLoader::CReasonerEvaluationLoadingTimesComparerLoader() { loaderConfig = nullptr; } CReasonerEvaluationLoadingTimesComparerLoader::~CReasonerEvaluationLoadingTimesComparerLoader() { } CLoader *CReasonerEvaluationLoadingTimesComparerLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { loaderConfig = config; CConfigData *data = config->getLastConfigChange("Konclude.Test.Generator.InputDirectory"); if (data) { mInputDir = data->getString(); } if (!mInputDir.endsWith("/")) { mInputDir += QString("/"); } data = config->getLastConfigChange("Konclude.Test.Generator.OutputDirectory"); if (data) { mOutputDir = data->getString(); } if (!mOutputDir.endsWith("/")) { mOutputDir += QString("/"); } mOutputDirClassify = mOutputDir+"Classification/"; return this; } CLoader *CReasonerEvaluationLoadingTimesComparerLoader::load() { CReasonerEvaluationLoadingTimeExtractor* loadTimeExtractor = new CReasonerEvaluationLoadingTimeExtractor(60000); CReasonerEvaluationAvaragerSummarizer* avarageSummarize = new CReasonerEvaluationAvaragerSummarizer(); QStringList reasonerNameStringList = QStringList() <<"HermiT 1.3.6" <<"FaCT++ 1.5.3" <<"Pellet 2.3.0" <<"Konclude 0.3.7-620"; QStringList reasonerPathStringList = QStringList() <getGNUPlotPlotter()->createReasonerOverviewPlot("Evaluation/Analyse/R-000/A-003/ReasonerClassificationComparison/TONES Repository/Incompatible Axioms Removed/Classification/classification-time-separate-sorted-descending-table.dat","xyz",QStringList()<<"Min"<<"Max","Evaluation/Analyse/R-000/A-003/ReasonerComparison/TONES Repository/Incompatible Axioms Removed/Classification/xyz"); //reasonerEvaluationContext->getHighchartPlotter()->createReasonerComparisonPlot("Evaluation/Analyses/R-000/A-004/ReasonerClassificationComparison/TONES Repository/Incompatible Axioms Removed/Classification/classification-time-sorted-descending-by-Average-split-from-0-to-16-table.csv","xyz",QStringList()<<"Min"<<"Max","Evaluation/Analyses/R-000/A-004/ReasonerClassificationComparison/TONES Repository/Incompatible Axioms Removed/Classification/xyz"); CReasonerEvaluationCollector* collector = new CReasonerEvaluationCollector(loadTimeExtractor,avarageSummarize); CReasonerEvaluationDataValueGroupCollectionReasonerComparison* reasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(reasonerNameStringList); for (QStringList::const_iterator it1 = reasonerNameStringList.constBegin(), it2 = reasonerPathStringList.constBegin(), it1End = reasonerNameStringList.constEnd(), it2End = reasonerPathStringList.constEnd(); it1 != it1End && it2 != it2End; ++it1, ++it2) { QString reasonerName(*it1); QString reasonerPath(*it2); LOG(INFO,"::Konclude::Test::Evaluation::ReasonerLoadingTimeComparer",logTr("Extracting loading times for '%1' reasoner from responses in directory '%2'.").arg(reasonerName).arg(reasonerPath),this); collector->collectReasonerEvaluationDataValues(reasonerComp,reasonerName,reasonerPath); } LOG(INFO,"::Konclude::Test::Evaluation::ReasonerLoadingTimeComparer",logTr("Comparing loading times for '%1'.").arg(reasonerNameStringList.join(", ")),this); CReasonerEvaluationGroupRequestSelector* selectors = nullptr; CReasonerEvaluationExpressivitySelectorFactory expEvalSelFactory("Expressivity Grouped","Expressivity Grouped/","Evaluation/Infos/Expressivity/"); selectors = expEvalSelFactory.getSelectors(selectors); CReasonerEvaluationDirectoryStructureSelectorFactory dirEvalSelFactory("Evaluation/Requests/","Evaluation/Requests/","Directory Grouped","Directory Grouped/"); selectors = dirEvalSelFactory.getSelectors(selectors); CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser* analyser1 = new CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser(); analyser1->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser* analyser2 = new CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser(); analyser2->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors); CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser* analyser3 = new CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser(); analyser3->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors); LOG(INFO,"::Konclude::Test::Evaluation::ReasonerLoadingTimeComparer",logTr("Loading times for '%1' compared to '%2'.").arg(reasonerNameStringList.join(", ")).arg(outputDirectory),this); return this; } CLoader *CReasonerEvaluationLoadingTimesComparerLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CLoader.h0000644000175000017500000000365012520756360022604 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_CLOADER_H #define KONCLUDE_Control_LOADER_CLOADER_H // Libraries includes #include // Namespace includes #include "LoaderSettings.h" #include "CLoaderFactory.h" // Other includes #include "Config/CConfiguration.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Config; namespace Control { namespace Loader { /*! * * \class CLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLoader { // public methods public: //! Constructor CLoader(); //! Destructor virtual ~CLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0) = 0; virtual CLoader *load() = 0; virtual CLoader *exit() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_CLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CConfigurableCoutLogObserverLoader.h0000644000175000017500000000435112520756356030136 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_CCONFIGURABLECOUTLOGOBSERVERLOADER_H #define KONCLUDE_Control_LOADER_CCONFIGURABLECOUTLOGOBSERVERLOADER_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" // Other includes #include "Utilities/CSingletonProvider.hpp" // Logger includes #include "Logger/CLogger.h" #include "Logger/CConsolePrintConfigurableLogObserver.h" namespace Konclude { using namespace Logger; using namespace Utilities; namespace Control { namespace Loader { /*! * * \class CConfigurableCoutLogObserverLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConfigurableCoutLogObserverLoader : public CLoader { // public methods public: //! Constructor CConfigurableCoutLogObserverLoader(); //! Destructor virtual ~CConfigurableCoutLogObserverLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: // protected variables protected: CConsolePrintConfigurableLogObserver *consoleSingletonLogObserver; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_CCONFIGURABLECOUTLOGOBSERVERLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CTestOWLlinkAPIBatchFileLoader.h0000644000175000017500000000447112520756362027004 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CTESTOWLLINKAPIBATCHFILELOADER_H #define KONCLUDE_CONTROL_LOADER_CTESTOWLLINKAPIBATCHFILELOADER_H // Libraries includes #include #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CLoaderFactory.h" // Other includes #include "Test/COWLlinkAPIReasonerTestfileTester.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; using namespace Test; namespace Control { namespace Loader { /*! * * \class CTestOWLlinkAPIBatchFileLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTestOWLlinkAPIBatchFileLoader : public CLoader { // public methods public: //! Constructor CTestOWLlinkAPIBatchFileLoader(); //! Destructor virtual ~CTestOWLlinkAPIBatchFileLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: // protected variables protected: QString reqFileString; QString resFileString; CConfiguration *loaderConfig; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CTESTOWLLINKAPIBATCHFILELOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CLoaderFactory.cpp0000644000175000017500000000207312520756360024465 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLoaderFactory.h" namespace Konclude { namespace Control { namespace Loader { CLoaderFactory::CLoaderFactory() { } CLoaderFactory::~CLoaderFactory() { } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationLoader.h0000644000175000017500000000531612520756362026336 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONLOADER_H #define KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONLOADER_H // Libraries includes #include #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CLoaderFactory.h" // Other includes #include "Test/Evaluation/CReasonerEvaluationExecutorThread.h" #include "Test/Evaluation/CReasonerEvaluationTestsuite.h" #include "Control/Command/CCommanderManagerThread.h" #include "Control/Command/CCommanderManagerConfigType.h" #include "Control/Command/Instructions/CInitializeConfigurationCommand.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; using namespace Config; using namespace Test::Evaluation; namespace Control { using namespace Command; using namespace Instructions; namespace Loader { /*! * * \class CReasonerEvaluationLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationLoader : public CLoader { // public methods public: //! Constructor CReasonerEvaluationLoader(); //! Destructor virtual ~CReasonerEvaluationLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: // protected variables protected: CConfiguration* mLoaderConfig; CCommanderManagerThread* mReasonerCommander; CCommanderManagerThread* mDeleteReasonerCommander; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONLOADER_H ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationTestcaseStatisticCollectionG0000644000175000017500000001335112520756362032466 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader.h" namespace Konclude { namespace Control { namespace Loader { CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader::CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader() { loaderConfig = nullptr; } CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader::~CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader() { } CLoader *CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { loaderConfig = config; mInputDir = CConfigDataReader::readConfigString(config,"Konclude.Test.Generator.InputDirectory"); if (!mInputDir.endsWith("/")) { mInputDir += QString("/"); } mResponseStatisticsOutputDir = CConfigDataReader::readConfigString(config,"Konclude.Test.Generator.OutputDirectory"); if (!mResponseStatisticsOutputDir.endsWith("/")) { mResponseStatisticsOutputDir += QString("/"); } mOntologyStatisticsDir = CConfigDataReader::readConfigString(config,"Konclude.Test.Generator.OntologyStatisticsDirectory"); if (!mOntologyStatisticsDir.endsWith("/")) { mOntologyStatisticsDir += QString("/"); } return this; } QStringList CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader::collectOntologyIRIs(const QDomElement& element) { QStringList iriList; if (element.tagName() == "OntologyIRI") { QString iri = element.attribute("IRI"); if (!iri.isEmpty()) { iriList.append(iri); } } QDomElement childElement = element.firstChildElement(); while (!childElement.isNull()) { iriList += collectOntologyIRIs(childElement); childElement = childElement.nextSiblingElement(); } return iriList; } QStringList CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader::collectOntologyIRIsStatistics(const QStringList& ontoIRIList) { QStringList statisticList; if (ontoIRIList.size() == 1) { QString ontologyIRI = ontoIRIList.first(); if (ontologyIRI.startsWith("file:")) { ontologyIRI.replace(0,5,""); } if (ontologyIRI.startsWith("Evaluation/")) { ontologyIRI.replace(0,11,""); } if (ontologyIRI.startsWith("Ontologies/")) { ontologyIRI.replace(0,11,""); } QString ontoStatFileString = mOntologyStatisticsDir+ontologyIRI+".txt"; QFile ontoStatFile(ontoStatFileString); if (ontoStatFile.open(QIODevice::ReadOnly)) { while (!ontoStatFile.atEnd()) { QByteArray statDataLine(ontoStatFile.readLine()); statisticList.append(statDataLine.trimmed()); } ontoStatFile.close(); } } return statisticList; } CLoader* CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader::collectTestcasesStatisticsForTestcase(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString) { QFile testcasteFile(testFilePathString+testFileNameString); if (testcasteFile.open(QIODevice::ReadOnly)) { QDomDocument document; document.setContent(&testcasteFile,true); QDomElement documentElement(document.documentElement()); QStringList ontologyIRIs = collectOntologyIRIs(documentElement); testcasteFile.close(); QStringList statList = collectOntologyIRIsStatistics(ontologyIRIs); if (!statList.isEmpty()) { QDir outputDir(mResponseStatisticsOutputDir); outputDir.mkpath(subDirPathString); QString responseStatFileString(mResponseStatisticsOutputDir+subDirPathString+testFileNameString+".txt"); QFile responseStatFile(responseStatFileString); if (responseStatFile.open(QIODevice::WriteOnly)) { responseStatFile.write(statList.join("\r\n").toLocal8Bit()); responseStatFile.close(); } } } return this; } CLoader* CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader::collectTestcasesStatisticsForDirectory(const QString& dirString, const QString& subDirPathString) { QDir inputDir(dirString); foreach (const QString& subDirString, inputDir.entryList(QDir::Dirs)) { if (subDirString != ".." && subDirString != ".") { collectTestcasesStatisticsForDirectory(dirString+subDirString+"/",subDirPathString+subDirString+"/"); } } foreach (const QString& fileString, inputDir.entryList(QDir::Files)) { collectTestcasesStatisticsForTestcase(fileString,dirString,subDirPathString); } LOG(INFO,"::Konclude::Generator::TestCaseGenerator",logTr("Generated test cases for all files in %1.").arg(dirString),this); return this; } CLoader *CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader::load() { collectTestcasesStatisticsForDirectory(mInputDir,""); return this; } CLoader *CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCoutLogObserverLoader.h0000644000175000017500000000410212520756356025607 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_CCoutLogObserverLoader_H #define KONCLUDE_Control_LOADER_CCoutLogObserverLoader_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" // Other includes #include "Utilities/CSingletonProvider.hpp" // Logger includes #include "Logger/CLogger.h" #include "Logger/CConsolePrintLogObserver.h" namespace Konclude { using namespace Logger; using namespace Utilities; namespace Control { namespace Loader { /*! * * \class CCoutLogObserverLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCoutLogObserverLoader : public CLoader { // public methods public: //! Constructor CCoutLogObserverLoader(); //! Destructor virtual ~CCoutLogObserverLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_CCoutLogObserverLoader_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/COREBatchProcessingLoader.cpp0000644000175000017500000004104012520756472026503 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COREBatchProcessingLoader.h" namespace Konclude { namespace Control { namespace Loader { COREBatchProcessingLoader::COREBatchProcessingLoader() : mORELogIdentifier("::Konclude::OREBatchProcessor",this) { mOWLLinkInterpreter = nullptr; mLoaderConfig = nullptr; mConfLogProcessingTimes = false; mProcessingCommandData = nullptr; mCloseAfterOutput = true; mBlockUntilProcessed = true; mSatOperationString = QString("sat").toLower(); mSatisfiabilityOperationString = QString("satisfiability").toLower(); mQueryOperationString = QString("query").toLower(); mClassificationOperationString = QString("classification").toLower(); mConsistencyOperationString = QString("consistency").toLower(); mRealisationOperationString = QString("realisation").toLower(); mRealizationOperationString = QString("realization").toLower(); mOperationTimeOutputString = QString("Operation time: "); mInfoConsoleObserver = nullptr; mErrorFileObserver = nullptr; mConsistencyKBCommand = nullptr; mTriviallyConsistencyKBCommand = nullptr; mAdditionalCheckingTime = nullptr; mReportAllTime = false; } COREBatchProcessingLoader::~COREBatchProcessingLoader() { } CCommandRecorder* COREBatchProcessingLoader::recordData(CCommandRecordData *recData) { LOGC(recData->getRecordErrorLevel(),recData->getRecordDomain(),recData->getRecordMessage(),recData->getCommand()); return this; } CLoader *COREBatchProcessingLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { mLoaderConfig = config; reasonerCommander = CConfigManagerReader::readCommanderManagerConfig(config); mOperationTaskString = CConfigDataReader::readConfigString(config,"Konclude.ORE.OperationTask"); mOntologyFileString = CConfigDataReader::readConfigString(config,"Konclude.ORE.OntologyFile"); mResponseFileString = CConfigDataReader::readConfigString(config,"Konclude.ORE.ResponseFile"); mIRINameString = CConfigDataReader::readConfigString(config,"Konclude.ORE.IRIName"); mCloseAfterOutput = CConfigDataReader::readConfigBoolean(config,"Konclude.ORE.CloseAfterProcessed"); mOutputMeasuredTimeInSeconds = CConfigDataReader::readConfigBoolean(config,"Konclude.ORE.OutputTimeMeasurementInSeconds"); mReportParsingTimeForConsistency = CConfigDataReader::readConfigBoolean(config,"Konclude.ORE.ReportParsingTimeForConsistency"); mReportParsingTimeForSatisfiability = CConfigDataReader::readConfigBoolean(config,"Konclude.ORE.ReportParsingTimeForSatisfiability"); mReportParsingTimeForRealisation = CConfigDataReader::readConfigBoolean(config,"Konclude.ORE.ReportParsingTimeForRealization"); mReportParsingTimeForClassification = CConfigDataReader::readConfigBoolean(config,"Konclude.ORE.ReportParsingTimeForClassification"); mInfoConsoleObserver = new COREConsolePrintLogObserver(QStringList()<addLogObserver(mInfoConsoleObserver); CLogger::getInstance()->addLogObserver(mErrorFileObserver); return this; } CLoader *COREBatchProcessingLoader::load() { startProcessing(); if (mBlockUntilProcessed) { mBlockingSemaphore.acquire(); } return this; } CConfiguration *COREBatchProcessingLoader::getConfiguration() { if (!reasonerCommander) { return mLoaderConfig; } else { CGetDescriptionCommand* getDesComm = new CGetDescriptionCommand(); reasonerCommander->delegateCommand(getDesComm); CCommandExecutedBlocker commExeBlocker; commExeBlocker.waitExecutedCommand(getDesComm); CConfiguration* config = getDesComm->getConfiguration(); return config; } } void COREBatchProcessingLoader::createClassificationTestingCommands() { logOutputMessage(QString("Started %1 on %2").arg(mProcessingOperationString).arg(mOntologyFileString)); QString oreTestKB = QString("http://konclude.com/ore/test/kb"); CCreateKnowledgeBaseCommand* createKBCommand = new CCreateKnowledgeBaseCommand(oreTestKB); QStringList ontoIRIList; ontoIRIList.append(mOntologyFileString); CLoadKnowledgeBaseOWLAutoOntologyCommand* loadKBCommand = new CLoadKnowledgeBaseOWLAutoOntologyCommand(oreTestKB,ontoIRIList); CKnowledgeBaseClassifyCommand* classifyKBCommand = new CKnowledgeBaseClassifyCommand(oreTestKB); CWriteFunctionalSubClassHierarchyQueryCommand* writeHierarchyCommand = new CWriteFunctionalSubClassHierarchyQueryCommand(oreTestKB,mResponseFileString); if (mReportParsingTimeForClassification) { mReportAllTime = true; } addProcessingCommand(createKBCommand); addProcessingCommand(loadKBCommand); addProcessingCommand(classifyKBCommand,true,mOperationTimeOutputString); addProcessingCommand(writeHierarchyCommand); processNextCommand(); } void COREBatchProcessingLoader::createRealisationTestingCommands() { logOutputMessage(QString("Started %1 on %2").arg(mProcessingOperationString).arg(mOntologyFileString)); QString oreTestKB = QString("http://konclude.com/ore/test/kb"); CCreateKnowledgeBaseCommand* createKBCommand = new CCreateKnowledgeBaseCommand(oreTestKB); QStringList ontoIRIList; ontoIRIList.append(mOntologyFileString); CLoadKnowledgeBaseOWLAutoOntologyCommand* loadKBCommand = new CLoadKnowledgeBaseOWLAutoOntologyCommand(oreTestKB,ontoIRIList); CKnowledgeBaseRealizeCommand* realizeKBCommand = new CKnowledgeBaseRealizeCommand(oreTestKB); CWriteFunctionalIndividualTypesQueryCommand* writeIndividualTypesCommand = new CWriteFunctionalIndividualTypesQueryCommand(oreTestKB,mResponseFileString); if (mReportParsingTimeForRealisation) { mReportAllTime = true; } addProcessingCommand(createKBCommand); addProcessingCommand(loadKBCommand); addProcessingCommand(realizeKBCommand,true,mOperationTimeOutputString); addProcessingCommand(writeIndividualTypesCommand); processNextCommand(); } void COREBatchProcessingLoader::createConsistencyTestingCommands() { logOutputMessage(QString("Started %1 on %2").arg(mProcessingOperationString).arg(mOntologyFileString)); QString oreTestKB = QString("http://konclude.com/ore/test/kb"); CCreateKnowledgeBaseCommand* createKBCommand = new CCreateKnowledgeBaseCommand(oreTestKB); QStringList ontoIRIList; ontoIRIList.append(mOntologyFileString); CLoadKnowledgeBaseOWLAutoOntologyCommand* loadKBCommand = new CLoadKnowledgeBaseOWLAutoOntologyCommand(oreTestKB,ontoIRIList); mConsistencyKBCommand = new CIsConsistentQueryCommand(oreTestKB); mTriviallyConsistencyKBCommand = new CIsTriviallyConsistentQueryCommand(oreTestKB); if (mReportParsingTimeForConsistency) { mReportAllTime = true; } addProcessingCommand(createKBCommand); addProcessingCommand(loadKBCommand); addProcessingCommand(mTriviallyConsistencyKBCommand,true,mOperationTimeOutputString,true,mResponseFileString); processNextCommand(); } void COREBatchProcessingLoader::createSatisfiabilityTesingCommands() { logOutputMessage(QString("Started %1 on %2").arg(mProcessingOperationString).arg(mOntologyFileString)); QString oreTestKB = QString("http://konclude.com/ore/test/kb"); CCreateKnowledgeBaseCommand* createKBCommand = new CCreateKnowledgeBaseCommand(oreTestKB); QStringList ontoIRIList; ontoIRIList.append(mOntologyFileString); mWriteSatisfiabilityPrefixString = mIRINameString+QString(","); CLoadKnowledgeBaseOWLAutoOntologyCommand* loadKBCommand = new CLoadKnowledgeBaseOWLAutoOntologyCommand(oreTestKB,ontoIRIList); CProcessClassNameSatisfiableQueryCommand* consistencyKBCommand = new CProcessClassNameSatisfiableQueryCommand(oreTestKB,mIRINameString); if (mReportParsingTimeForSatisfiability) { mReportAllTime = true; } addProcessingCommand(createKBCommand); addProcessingCommand(loadKBCommand); addProcessingCommand(consistencyKBCommand,true,mOperationTimeOutputString,true,mResponseFileString); processNextCommand(); } void COREBatchProcessingLoader::addProcessingCommand(CCommand* command) { mProcessCommandList.append(new CCommandProcessData(command)); } void COREBatchProcessingLoader::addProcessingCommand(CCommand* command, bool measureTime, const QString& measuredOutputString) { mProcessCommandList.append(new CCommandProcessData(command,measureTime,measuredOutputString)); } void COREBatchProcessingLoader::addProcessingCommand(CCommand* command, bool measureTime, const QString& measuredOutputString, bool writeSatisfiabilityOutput, const QString& outputFileName) { mProcessCommandList.append(new CCommandProcessData(command,measureTime,measuredOutputString,writeSatisfiabilityOutput,outputFileName)); } COWLlinkProcessor *COREBatchProcessingLoader::initializeOWLlinkContent() { QString operationTaskString = mOperationTaskString; operationTaskString = operationTaskString.toLower(); if (operationTaskString == mSatOperationString) { mProcessingOperationString = mSatOperationString; createSatisfiabilityTesingCommands(); } else if (operationTaskString == mSatisfiabilityOperationString) { mProcessingOperationString = mSatisfiabilityOperationString; createSatisfiabilityTesingCommands(); } else if (operationTaskString == mClassificationOperationString) { mProcessingOperationString = mClassificationOperationString; createClassificationTestingCommands(); } else if (operationTaskString == mConsistencyOperationString) { mProcessingOperationString = mConsistencyOperationString; createConsistencyTestingCommands(); } else if (operationTaskString == mRealisationOperationString) { mProcessingOperationString = mRealisationOperationString; createRealisationTestingCommands(); } else if (operationTaskString == mRealizationOperationString) { mProcessingOperationString = mRealizationOperationString; createRealisationTestingCommands(); } else { logOutputError(QString("Operation %1 not supported").arg(mOperationTaskString)); terminateProcessing(); } return this; } COWLlinkProcessor *COREBatchProcessingLoader::concludeOWLlinkContent() { finishCommandProcessing(); if (hasMoreProcessingCommands()) { processNextCommand(); } else { logOutputMessage(QString("Completed %1 on %2").arg(mProcessingOperationString).arg(mOntologyFileString)); terminateProcessing(); } return this; } void COREBatchProcessingLoader::logOutputError(const QString& errorString) { LOG(ERROR,mORELogIdentifier.getLogDomain(),logTr("Error: %1").arg(errorString),this); } void COREBatchProcessingLoader::logOutputNotice(const QString& outputString) { LOG(NOTICE,mORELogIdentifier.getLogDomain(),logTr("%1").arg(outputString),this); } void COREBatchProcessingLoader::logOutputMessage(const QString& outputString) { LOG(INFO,mORELogIdentifier.getLogDomain(),logTr("%1").arg(outputString),this); } void COREBatchProcessingLoader::forcedPathCreated(const QString& filePath) { QString path = filePath; if (path.contains("/") || path.contains("\\")) { int lastSlash = path.lastIndexOf("/"); int lastBackSlash = path.lastIndexOf("\\"); int lastSeparator = qMax(lastBackSlash,lastSlash); path = path.mid(0,lastSeparator); if (!path.isEmpty()) { QDir dir; dir.mkpath(path); } } } void COREBatchProcessingLoader::writeSatisfiabilityResult(const QString& outputFileName, CCommand* processedCommand) { bool outputWritten = false; bool calculationCompleted = false; CKnowledgeBaseQueryCommand* kbQueryCommand = dynamic_cast(processedCommand); if (kbQueryCommand) { CQuery* query = kbQueryCommand->getCalculateQueryCommand()->getQuery(); if (query) { CQueryResult* queryResult = query->getQueryResult(); if (queryResult) { CBooleanQueryResult* boolQueryResult = dynamic_cast(queryResult); if (boolQueryResult) { calculationCompleted = true; forcedPathCreated(outputFileName); QFile outputFile(outputFileName); if (outputFile.open(QIODevice::Append)) { QString outputData; if (boolQueryResult->getResult() == true) { outputData = mWriteSatisfiabilityPrefixString+QString("true\n"); } else { outputData = mWriteSatisfiabilityPrefixString+QString("false\n"); } outputFile.write(outputData.toUtf8()); outputFile.close(); outputWritten = true; } else { logOutputError(QString("Failed writing output to file '%1'").arg(outputFileName)); } } } } } if (!calculationCompleted) { logOutputError("Calculation failed"); } } void COREBatchProcessingLoader::finishCommandProcessing() { if (mProcessingCommandData) { bool writeResults = true; if (mProcessingCommandData->mCommand == mTriviallyConsistencyKBCommand) { CKnowledgeBaseQueryCommand* kbQueryCommand = dynamic_cast(mProcessingCommandData->mCommand); if (kbQueryCommand) { CQuery* query = kbQueryCommand->getCalculateQueryCommand()->getQuery(); if (query) { CQueryResult* queryResult = query->getQueryResult(); if (queryResult) { CBooleanQueryResult* boolQueryResult = dynamic_cast(queryResult); if (boolQueryResult) { if (!boolQueryResult->getResult()) { writeResults = false; mAdditionalCheckingTime += mMeasurementTime.elapsed(); addProcessingCommand(mConsistencyKBCommand,true,mOperationTimeOutputString,true,mResponseFileString); } } } } } } if (writeResults) { if (mProcessingCommandData->mMeasureTime) { QString outputString = mProcessingCommandData->mMeasuredOutputString; cint64 timeElapsed = mMeasurementTime.elapsed(); timeElapsed += mAdditionalCheckingTime; if (mOutputMeasuredTimeInSeconds) { logOutputMessage(outputString+QString("%1").arg(timeElapsed/1000.)); } else { logOutputMessage(outputString+QString("%1").arg(timeElapsed)); } } else { if (mReportAllTime) { mAdditionalCheckingTime += mMeasurementTime.elapsed(); } } if (mProcessingCommandData->mWriteSatisfiableOutput) { QString outputFile = mProcessingCommandData->mWriteOutputFile; writeSatisfiabilityResult(outputFile,mProcessingCommandData->mCommand); } } mProcessingCommandData = nullptr; } } void COREBatchProcessingLoader::processNextCommand() { mProcessingCommandData = mProcessCommandList.takeFirst(); CCommand* command = mProcessingCommandData->mCommand; logOutputNotice(QString("Starting '%1' command").arg(command->getBriefCommandDescription())); command->setRecorder(this); command->setReportErrorFromSubCommands(false); CCommandProcessedCallbackEvent *proComm = new CCommandProcessedCallbackEvent(this,command); command->addProcessedCallback(proComm); mMeasurementTime.start(); preSynchronizer->delegateCommand(command); } bool COREBatchProcessingLoader::hasMoreProcessingCommands() { return !mProcessCommandList.isEmpty(); } void COREBatchProcessingLoader::terminateProcessing() { mInfoConsoleObserver->flushLogging(); mErrorFileObserver->flushLogging(); if (mBlockUntilProcessed) { mBlockingSemaphore.release(); } if (mCloseAfterOutput) { CLogger::getInstance()->waitSynchronization(); QCoreApplication::exit(); } } CLoader *COREBatchProcessingLoader::exit() { stopThread(); return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CTransitiveConnectedELClassesTestDataGeneratorLoader.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Loader/CTransitiveConnectedELClassesTestDataGeneratorL0000644000175000017500000000421012520756362032272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTransitiveConnectedELClassesTestDataGeneratorLoader.h" namespace Konclude { namespace Control { namespace Loader { CTransitiveConnectedELClassesTestDataGeneratorLoader::CTransitiveConnectedELClassesTestDataGeneratorLoader() { mConfiguration = 0; generator = 0; } CTransitiveConnectedELClassesTestDataGeneratorLoader::~CTransitiveConnectedELClassesTestDataGeneratorLoader() { } CLoader* CTransitiveConnectedELClassesTestDataGeneratorLoader::init(CLoaderFactory* loaderFactory, CConfiguration* config) { mConfiguration = config; return this; } CLoader *CTransitiveConnectedELClassesTestDataGeneratorLoader::load() { generator = new COWLTransitiveConnectedELClassesTestDataGenerator(); QString filename = CConfigDataReader::readConfigString(mConfiguration,"Konclude.Test.TransitiveConnectedELClassesTestDataGenerator.OWLlinkOutputFile","RecursionTestData.owl.xml"); cint64 indiSize = CConfigDataReader::readConfigInteger(mConfiguration,"Konclude.Test.TransitiveConnectedELClassesTestDataGenerator.ClassesCount",1000); generator->generateData(indiSize,filename); delete generator; return this; } CLoader* CTransitiveConnectedELClassesTestDataGeneratorLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCLISatisfiabilityBatchProcessingLoader.h0000644000175000017500000000442612520756356031043 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CCLISATISFIABILITYBATCHPROCESSINGLOADER_H #define KONCLUDE_CONTROL_LOADER_CCLISATISFIABILITYBATCHPROCESSINGLOADER_H // Libraries includes #include #include #include #include // Namespace includes #include "LoaderSettings.h" #include "CCLIBatchProcessingLoader.h" // Other includes // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; namespace Control { namespace Loader { /*! * * \class CCLISatisfiabilityBatchProcessingLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCLISatisfiabilityBatchProcessingLoader : public CCLIBatchProcessingLoader { // public methods public: //! Constructor CCLISatisfiabilityBatchProcessingLoader(); //! Destructor virtual ~CCLISatisfiabilityBatchProcessingLoader(); // protected methods protected: void createSatisfiabilityTesingCommands(); virtual void createTestingCommands(); virtual void writeCommandOutput(const QString& outputFileName, CCommand* processedCommand); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CCLISATISFIABILITYBATCHPROCESSINGLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CRecursionTestDataGeneratorLoader.h0000644000175000017500000000437412520756362030005 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CRECURSIONTESTDATAGENERATORLOADER_H #define KONCLUDE_CONTROL_LOADER_CRECURSIONTESTDATAGENERATORLOADER_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" // Other includes #include "Test/COWLRecursionTestDataGenerator.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Test; using namespace Concurrent; namespace Control { namespace Loader { /*! * * \class CRecursionTestDataGeneratorLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRecursionTestDataGeneratorLoader : public CLoader { // public methods public: //! Constructor CRecursionTestDataGeneratorLoader(); //! Destructor virtual ~CRecursionTestDataGeneratorLoader(); virtual CLoader* init(CLoaderFactory* loaderFactory = 0, CConfiguration* config = 0); virtual CLoader* load(); virtual CLoader* exit(); // protected methods protected: // protected variables protected: CConfiguration* mConfiguration; COWLRecursionTestDataGenerator* generator; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CRECURSIONTESTDATAGENERATORLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CCommandLineLoader.h0000644000175000017500000000630212520756356024715 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_LOADER_CCOMMANDLINELOADER_H #define KONCLUDE_Control_LOADER_CCOMMANDLINELOADER_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" // Other includes #include "Concurrent/CThread.h" #include "Utilities/CSingletonProvider.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Concurrent; using namespace Utilities; namespace Control { namespace Loader { /*! * * \class CCommandLineLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommandLineLoader : public CLoader, public CThread { // public methods public: //! Constructor CCommandLineLoader(const QStringList &argList, bool qtGUIApplication); CCommandLineLoader(int argc, char *argv[], bool qtGUIApplication); CCommandLineLoader(); //! Destructor virtual ~CCommandLineLoader(); static QStringList getEncodedArguments(int argc, char *argv[], bool skipFirst = true, bool encodeSpaces = true); static QString getDecodedArgument(const QString& string); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: virtual CCommandLineLoader *setConfiguration(const QString &configString, CConfiguration *configuration, bool equalsConfSet = false); virtual void threadStarted(); virtual void threadStopped(); virtual QStringList getMatchesFromPattern(const QString &pattern, const QString &text); virtual QStringList getMatchesFromPattern(const QString &pattern, const QString &text, qint64 maxPosition); virtual qint64 getFirstTextOccur(const QString &text, const QString &textOccur, qint64 beginSearchPos = 0); // protected variables protected: QStringList commandLineParameters; CConfiguration *configuration; bool qtGuiUsable; QString loadingText; CLoaderFactory *lFactory; QLinkedList loaderContainer; QLinkedList configContainer; QMutex containerSync; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_CCOMMANDLINELOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CDefaultLoaderFactory.cpp0000644000175000017500000002014312520756356025775 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDefaultLoaderFactory.h" namespace Konclude { namespace Control { namespace Loader { CDefaultLoaderFactory::CDefaultLoaderFactory() { } CDefaultLoaderFactory::~CDefaultLoaderFactory() { } CLoader *CDefaultLoaderFactory::createLoaderFromName(const QString &loaderName, CConfiguration *config) { CLoader *loader = 0; if (loaderName == "CommandLineLoader") { loader = new CCommandLineLoader(); } else if (loaderName == "CoutLogObserverLoader") { loader = new CCoutLogObserverLoader(); } else if (loaderName == "DefaultReasonerLoader") { loader = new CDefaultReasonerLoader(); } else if (loaderName == "OWLlinkBatchFileLoader") { loader = new COWLlinkBatchFileLoader(); } else if (loaderName == "AnalyseReasonerLoader") { loader = new CAnalyseReasonerLoader(); } else if (loaderName == "ExperimentalReasonerLoader") { loader = new CExperimentalReasonerLoader(); } else if (loaderName == "CommandLineTranlatorHelpLoader") { loader = new CCommandLineTranlatorHelpLoader(); } else if (loaderName == "ConfigurableCoutLogObserverLoader") { loader = new CConfigurableCoutLogObserverLoader(); } else if (loaderName == "TestHashModificationLoader") { loader = new CTestHashModificationLoader(); } else if (loaderName == "TestTaskThroughputLoader") { loader = new CTestTaskThroughputLoader(); } else if (loaderName == "TestQHashVsQMapLoader") { loader = new CTestQHashVsQMapLoader(); } else if (loaderName == "PigenholePrincipleGeneratorLoader") { loader = new CPigenholePrincipleGeneratorLoader(); } else if (loaderName == "TestOWLlinkAPIBatchFileLoader") { loader = new CTestOWLlinkAPIBatchFileLoader(); } else if (loaderName == "TestMemoryAccessLoader") { loader = new CTestMemoryAccessLoader(); } else if (loaderName == "OWLFilesIncompatibleAxiomChangerLoader") { loader = new COWLFilesIncompatibleAxiomChangerLoader(); } else if (loaderName == "ReasonerEvaluationLoader") { loader = new CReasonerEvaluationLoader(); } else if (loaderName == "OWLFilesOWLlinkTestcaseGeneratorLoader") { loader = new COWLFilesOWLlinkTestcaseGeneratorLoader(); } else if (loaderName == "ReasonerEvaluationClassificationTimesComparerLoader") { loader = new CReasonerEvaluationClassificationTimesComparerLoader(); } else if (loaderName == "OWLlinkHttpServerLoader") { loader = new COWLlinkHttpServerLoader(); } else if (loaderName == "ReasonerEvaluationLoadingTimesComparerLoader") { loader = new CReasonerEvaluationLoadingTimesComparerLoader(); } else if (loaderName == "RecursionTestDataGeneratorLoader") { loader = new CRecursionTestDataGeneratorLoader(); } else if (loaderName == "LargeJoinTestDataGeneratorLoader") { loader = new CLargeJoinTestDataGeneratorLoader(); } else if (loaderName == "TransitiveConnectedELClassesTestDataGeneratorLoader") { loader = new CTransitiveConnectedELClassesTestDataGeneratorLoader(); } else if (loaderName == "ReasonerEvaluationProgramLoader") { loader = new CReasonerEvaluationProgramLoader(); } else if (loaderName == "OREBatchProcessingLoader") { loader = new COREBatchProcessingLoader(); } else if (loaderName == "ORECoutLogObserverLoader") { loader = new CORECoutLogObserverLoader(); } else if (loaderName == "ReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader") { loader = new CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader(); } else if (loaderName == "ReasonerEvaluationOntologyExtractionLoader") { loader = new CReasonerEvaluationOntologyExtractionLoader(); } else if (loaderName == "CLIClassificationBatchProcessingLoader") { loader = new CCLIClassificationBatchProcessingLoader(); } else if (loaderName == "CLIConsistencyBatchProcessingLoader") { loader = new CCLIConsistencyBatchProcessingLoader(); } else if (loaderName == "CLISatisfiabilityBatchProcessingLoader") { loader = new CCLISatisfiabilityBatchProcessingLoader(); } else if (loaderName == "CLIRealizationBatchProcessingLoader") { loader = new CCLIRealizationBatchProcessingLoader(); } else if (loaderName == "LoggerConfigurationLoader") { loader = new CLoggerConfigurationLoader(); } return loader; } bool CDefaultLoaderFactory::canCreateLoaderFromName(const QString &loaderName, CConfiguration *config) { bool canLoad = false; if (loaderName == "CommandLineLoader") { canLoad = true; } else if (loaderName == "CoutLogObserverLoader") { canLoad = true; } else if (loaderName == "DefaultReasonerLoader") { canLoad = true; } else if (loaderName == "OWLlinkBatchFileLoader") { canLoad = true; } else if (loaderName == "AnalyseReasonerLoader") { canLoad = true; } else if (loaderName == "ExperimentalReasonerLoader") { canLoad = true; } else if (loaderName == "CommandLineTranlatorHelpLoader") { canLoad = true; } else if (loaderName == "ConfigurableCoutLogObserverLoader") { canLoad = true; } else if (loaderName == "TestHashModificationLoader") { canLoad = true; } else if (loaderName == "TestTaskThroughputLoader") { canLoad = true; } else if (loaderName == "TestQHashVsQMapLoader") { canLoad = true; } else if (loaderName == "PigenholePrincipleGeneratorLoader") { canLoad = true; } else if (loaderName == "TestOWLlinkAPIBatchFileLoader") { canLoad = true; } else if (loaderName == "TestMemoryAccessLoader") { canLoad = true; } else if (loaderName == "OWLFilesIncompatibleAxiomChangerLoader") { canLoad = true; } else if (loaderName == "ReasonerEvaluationLoader") { canLoad = true; } else if (loaderName == "OWLFilesOWLlinkTestcaseGeneratorLoader") { canLoad = true; } else if (loaderName == "ReasonerEvaluationClassificationTimesComparerLoader") { canLoad = true; } else if (loaderName == "OWLlinkHttpServerLoader") { canLoad = true; } else if (loaderName == "ReasonerEvaluationLoadingTimesComparerLoader") { canLoad = true; } else if (loaderName == "RecursionTestDataGeneratorLoader") { canLoad = true; } else if (loaderName == "LargeJoinTestDataGeneratorLoader") { canLoad = true; } else if (loaderName == "TransitiveConnectedELClassesTestDataGeneratorLoader") { canLoad = true; } else if (loaderName == "ReasonerEvaluationProgramLoader") { canLoad = true; } else if (loaderName == "OREBatchProcessingLoader") { canLoad = true; } else if (loaderName == "ORECoutLogObserverLoader") { canLoad = true; } else if (loaderName == "ReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader") { canLoad = true; } else if (loaderName == "ReasonerEvaluationOntologyExtractionLoader") { canLoad = true; } else if (loaderName == "CLIClassificationBatchProcessingLoader") { canLoad = true; } else if (loaderName == "CLIConsistencyBatchProcessingLoader") { canLoad = true; } else if (loaderName == "CLISatisfiabilityBatchProcessingLoader") { canLoad = true; } else if (loaderName == "CLIRealizationBatchProcessingLoader") { canLoad = true; } else if (loaderName == "LoggerConfigurationLoader") { canLoad = true; } return canLoad; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CLargeJoinTestDataGeneratorLoader.h0000644000175000017500000000437412520756360027704 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CLARGEJOINTESTDATAGENERATORLOADER_H #define KONCLUDE_CONTROL_LOADER_CLARGEJOINTESTDATAGENERATORLOADER_H // Libraries includes #include #include // Namespace includes #include "CLoader.h" // Other includes #include "Test/COWLLargeJoinTestDataGenerator.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Test; using namespace Concurrent; namespace Control { namespace Loader { /*! * * \class CLargeJoinTestDataGeneratorLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLargeJoinTestDataGeneratorLoader : public CLoader { // public methods public: //! Constructor CLargeJoinTestDataGeneratorLoader(); //! Destructor virtual ~CLargeJoinTestDataGeneratorLoader(); virtual CLoader* init(CLoaderFactory* loaderFactory = 0, CConfiguration* config = 0); virtual CLoader* load(); virtual CLoader* exit(); // protected methods protected: // protected variables protected: CConfiguration* mConfiguration; COWLLargeJoinTestDataGenerator* generator; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CLARGEJOINTESTDATAGENERATORLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationOntologyExtractionLoader.cpp0000644000175000017500000002042112520756362032457 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerEvaluationOntologyExtractionLoader.h" namespace Konclude { namespace Control { namespace Loader { CReasonerEvaluationOntologyExtractionLoader::CReasonerEvaluationOntologyExtractionLoader() { loaderConfig = nullptr; } CReasonerEvaluationOntologyExtractionLoader::~CReasonerEvaluationOntologyExtractionLoader() { } CLoader *CReasonerEvaluationOntologyExtractionLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) { loaderConfig = config; mInputDir = CConfigDataReader::readConfigString(config,"Konclude.Test.Generator.InputDirectory"); if (!mInputDir.endsWith("/")) { mInputDir += QString("/"); } mOutputDir = CConfigDataReader::readConfigString(config,"Konclude.Test.Generator.OutputDirectory"); if (!mOutputDir.endsWith("/")) { mOutputDir += QString("/"); } mOntologyStatisticsDir = CConfigDataReader::readConfigString(config,"Konclude.Test.Generator.OntologyStatisticsDirectory"); if (!mOntologyStatisticsDir.endsWith("/")) { mOntologyStatisticsDir += QString("/"); } mFiltering = new CReasonerEvaluationFiltering(mOntologyStatisticsDir); mFilterFile = CConfigDataReader::readConfigString(config,"Konclude.Test.Generator.FilterFile"); loadFilterConditions(mFilterFile); QDir newOntoFileDir("."); newOntoFileDir.mkpath(mOutputDir); mExtractedOntStatOutputFileString = mOutputDir+"ExtractedOntologies.csv"; mCollectExtractedOntologyStatistics = true; mCopyExtractedOntologyToOutput = true; return this; } bool CReasonerEvaluationOntologyExtractionLoader::loadFilterConditions(const QString& fileNameString) { return mFiltering->loadFilterFromFile(fileNameString); } bool CReasonerEvaluationOntologyExtractionLoader::satisfiesExtractionCondition(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString, const QStringList& statisticList) { return mFiltering->testSatisfiesFilter(testFileNameString,testFilePathString,subDirPathString,statisticList); } CLoader* CReasonerEvaluationOntologyExtractionLoader::addExtractedOntologyStatistics(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString, const QStringList& statisticList) { QHash* ontStatHash = new QHash(); ontStatHash->insert("Path",subDirPathString); ontStatHash->insert("Ontology",testFileNameString); foreach (const QString& statisticString, statisticList) { QStringList statDataList(statisticString.split("\t")); if (statDataList.count() == 2) { QString statNameString = statDataList.takeFirst().replace(":","").trimmed(); QString statValueString = statDataList.takeFirst().trimmed(); ontStatHash->insert(statNameString,statValueString); if (!mExtractedStatsSet.contains(statNameString)) { mExtractedStatsSet.insert(statNameString); mExtractedStatsList.append(statNameString); } } } mExtractedOntStatHashList.append(ontStatHash); return this; } CLoader* CReasonerEvaluationOntologyExtractionLoader::saveExtractedOntologyStatistics(const QString& fileNameString) { mExtractedStatsList.prepend("Ontology"); mExtractedStatsList.prepend("Path"); QString outFileString = fileNameString; QFile outFile(outFileString); if (outFile.open(QIODevice::WriteOnly)) { QString titleString; for (QList::const_iterator itVal = mExtractedStatsList.constBegin(), itValEnd = mExtractedStatsList.constEnd(); itVal != itValEnd; ++itVal) { QString valString(*itVal); if (!titleString.isEmpty()) { titleString.append("\t"); } titleString += valString; } outFile.write(QString("%1\r\n").arg(titleString).toLocal8Bit()); for (QList< QHash* >::const_iterator it = mExtractedOntStatHashList.constBegin(), itEnd = mExtractedOntStatHashList.constEnd(); it != itEnd; ++it) { QHash* ontStatHash(*it); QString dataString; for (QList::const_iterator itVal = mExtractedStatsList.constBegin(), itValEnd = mExtractedStatsList.constEnd(); itVal != itValEnd; ++itVal) { QString valString(*itVal); QString valDataString(ontStatHash->value(valString)); if (!dataString.isEmpty()) { dataString.append("\t"); } dataString += valDataString; } outFile.write(QString("%1\r\n").arg(dataString).toLocal8Bit()); } outFile.close(); } return this; } CLoader* CReasonerEvaluationOntologyExtractionLoader::copyExtractedOntology(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString) { QString ontoFileString = testFilePathString+testFileNameString; QFile ontoFile(ontoFileString); if (ontoFile.open(QIODevice::ReadOnly)) { QDir newOntoFileDir(mOutputDir); newOntoFileDir.mkpath(subDirPathString); QString newOntoFileString = mOutputDir+subDirPathString+testFileNameString; QFile newOntoFile(newOntoFileString); if (newOntoFile.open(QIODevice::WriteOnly)) { while (!ontoFile.atEnd()) { QByteArray ontoData(ontoFile.read(1000000)); newOntoFile.write(ontoData); } newOntoFile.close(); ontoFile.close(); } } return this; } CLoader* CReasonerEvaluationOntologyExtractionLoader::extractOntologiesForTestcase(const QString& testFileNameString, const QString& testFilePathString, const QString& subDirPathString) { QStringList statisticList; QString ontoStatFileString = mOntologyStatisticsDir+subDirPathString+testFileNameString+".txt"; QFile ontoStatFile(ontoStatFileString); if (ontoStatFile.open(QIODevice::ReadOnly)) { while (!ontoStatFile.atEnd()) { QByteArray statDataLine(ontoStatFile.readLine()); statisticList.append(statDataLine.trimmed()); } ontoStatFile.close(); if (!statisticList.isEmpty()) { if (satisfiesExtractionCondition(testFileNameString,testFilePathString,subDirPathString,statisticList)) { // extract ontology if (mCollectExtractedOntologyStatistics) { addExtractedOntologyStatistics(testFileNameString,testFilePathString,subDirPathString,statisticList); } if (mCopyExtractedOntologyToOutput) { copyExtractedOntology(testFileNameString,testFilePathString,subDirPathString); } } } } return this; } CLoader* CReasonerEvaluationOntologyExtractionLoader::extractOntologiesForDirectory(const QString& dirString, const QString& subDirPathString) { QDir inputDir(dirString); foreach (const QString& subDirString, inputDir.entryList(QDir::Dirs)) { if (subDirString != ".." && subDirString != ".") { extractOntologiesForDirectory(dirString+subDirString+"/",subDirPathString+subDirString+"/"); } } foreach (const QString& fileString, inputDir.entryList(QDir::Files)) { extractOntologiesForTestcase(fileString,dirString,subDirPathString); } LOG(INFO,"::Konclude::Generator::TestCaseGenerator",logTr("Extracted ontologies in %1.").arg(dirString),this); return this; } CLoader *CReasonerEvaluationOntologyExtractionLoader::load() { extractOntologiesForDirectory(mInputDir,""); saveExtractedOntologyStatistics(mExtractedOntStatOutputFileString); return this; } CLoader *CReasonerEvaluationOntologyExtractionLoader::exit() { return this; } }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/CReasonerEvaluationLoadingTimesComparerLoader.h0000644000175000017500000000650412520756362032327 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONLOADINGTIMESCOMPARERLOADER_H #define KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONLOADINGTIMESCOMPARERLOADER_H // Libraries includes #include #include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CLoaderFactory.h" // Other includes #include "Test/Evaluation/CReasonerEvaluationCollector.h" #include "Test/Evaluation/CReasonerEvaluationLoadingTimeExtractor.h" #include "Test/Evaluation/CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h" #include "Test/Evaluation/CReasonerEvaluationAvaragerSummarizer.h" #include "Test/Evaluation/CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser.h" #include "Test/Evaluation/CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser.h" #include "Test/Evaluation/CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser.h" #include "Test/Evaluation/CReasonerEvaluationHighchartPlotter.h" #include "Test/Evaluation/CReasonerEvaluationPathConverter.h" #include "Test/Evaluation/CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser.h" #include "Test/Evaluation/CReasonerEvaluationDirectoryStructureSelectorFactory.h" #include "Test/Evaluation/CReasonerEvaluationExpressivitySelectorFactory.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; using namespace Test::Evaluation; namespace Control { namespace Loader { /*! * * \class CReasonerEvaluationLoadingTimesComparerLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerEvaluationLoadingTimesComparerLoader : public CLoader { // public methods public: //! Constructor CReasonerEvaluationLoadingTimesComparerLoader(); //! Destructor virtual ~CReasonerEvaluationLoadingTimesComparerLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: // protected variables protected: QString mInputDir; QString mOutputDir; QString mOutputDirClassify; CConfiguration *loaderConfig; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_LOADER_CREASONEREVALUATIONLOADINGTIMESCOMPARERLOADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Loader/COWLlinkHttpServerLoader.h0000644000175000017500000000547212520756360026077 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_LOADER_COWLLINKHTTPSERVERLOADER_H #define KONCLUDE_CONTROL_LOADER_COWLLINKHTTPSERVERLOADER_H // Libraries includes #include #include #include //#include // Namespace includes #include "LoaderSettings.h" #include "CLoader.h" #include "CLoaderFactory.h" // Other includes #include "Control/Interface/OWLlink/COWLlinkProcessor.h" #include "Control/Interface/OWLlink/COWLlinkHttpConnectionHandlerProcessor.h" #include "Control/Interface/OWLlink/COWLlinkHttpConnectionHandlerProcessorFactory.h" #include "Control/Command/CConfigManagerReader.h" #include "Network/HTTP/CQtHttpConnectionHandlerPooledFactory.h" #include "Network/HTTP/CQtHttpListner.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" #include #include namespace Konclude { using namespace Logger; using namespace Network::HTTP; namespace Control { using namespace Interface::OWLlink; using namespace Command; namespace Loader { /*! * * \class COWLlinkHttpServerLoader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLlinkHttpServerLoader : public CLoader { // public methods public: //! Constructor COWLlinkHttpServerLoader(); //! Destructor virtual ~COWLlinkHttpServerLoader(); virtual CLoader *init(CLoaderFactory *loaderFactory = 0, CConfiguration *config = 0); virtual CLoader *load(); virtual CLoader *exit(); // protected methods protected: // protected variables protected: CConfiguration *loaderConfig; cint64 mPort; COWLlinkHttpConnectionHandlerProcessorFactory* mHanlderFactory; CQtHttpConnectionHandlerPooledFactory* mHandlerPool; CQtHttpListner* mHttpListner; // private methods private: // private variables private: }; }; // end namespace Loader }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_LOADER_COWLlinkHttpServerLoader_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/0000755000175000017500000000000012613407250021260 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommanderManagerThread.cpp0000644000175000017500000004172412520756352026436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommanderManagerThread.h" namespace Konclude { namespace Control { namespace Command { CCommanderManagerThread::CCommanderManagerThread() : CThread("ReasonderCommander"), CLogIdentifier("::Konclude::Command::ReasonerCommanderThread",this) { configurationProvider = 0; reasonerManager = 0; kbCommandsDelegater = 0; classificationMan = 0; ontoRevMan = 0; startThread(); } CCommanderManagerThread::~CCommanderManagerThread() { if (reasonerManager) { delete reasonerManager; } if (configurationProvider) { delete configurationProvider; } if (classificationMan) { delete classificationMan; } if (ontoRevMan) { delete ontoRevMan; } } CCommanderManagerThread *CCommanderManagerThread::realizeCommand(CCommand *command) { postEvent(new CRealizeCommandEvent(command)); return this; } bool CCommanderManagerThread::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (!CThread::processCustomsEvents(type,event)) { if (type == EVENTREALIZECOMMAND) { CRealizeCommandEvent *commandEvent = (CRealizeCommandEvent *)event; if (commandEvent) { CCommand *command = commandEvent->getCommand(); if (command) { if (command->getCommandTag() == INITIALIZECONFIGURATIONCOMMAND) { CInitializeConfigurationCommand *initializeConfigCommand = (CInitializeConfigurationCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); initializeConfiguration(initializeConfigCommand->getInitialConfiguration(),&commandRecordRouter); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (command->getCommandTag() == INITIALIZEREASONERCOMMAND) { CInitializeReasonerCommand *initializeReasonerCommand = (CInitializeReasonerCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CCommanderInitializationFactory *initFact = initializeReasonerCommand->getInitializationFactory(); initializeCommander(initFact,&commandRecordRouter); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (command->getCommandTag() == GETKNOWLEGEBASECONFIGURATIONCOMMAND) { CGetKnowledgeBaseConfigCommand *getConfigCommand = (CGetKnowledgeBaseConfigCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); kbCommandsDelegater->delegateCommand(getConfigCommand); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (command->getCommandTag() == SETKNOWLEDGEBASECONFIGURATIONCOMMAND) { CSetKnowledgeBaseConfigCommand *setConfigCommand = (CSetKnowledgeBaseConfigCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); kbCommandsDelegater->delegateCommand(setConfigCommand); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (command->getCommandTag() == GETCONFIGURATIONCOMMAND) { CGetConfigCommand *getConfigCommand = (CGetConfigCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CConfigurationBase *config = configurationProvider->getCurrentConfiguration(); CConfigData *data = config->getRelatedConfigChange(getConfigCommand->getConfigNameString(),true); if (!data) { CUnspecifiedMessageErrorRecord::makeRecord(QString("Configuration property '%1' not available.").arg(getConfigCommand->getConfigNameString()),&commandRecordRouter); } getConfigCommand->setConfigData(data); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (command->getCommandTag() == SETCONFIGURATIONCOMMAND) { CSetConfigCommand *setConfigCommand = (CSetConfigCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CGlobalConfigurationBase *config = configurationProvider->createNextGlobalConfiguration(); if (!config->isConfigLevelLocked(setConfigCommand->getConfigNameString())) { CConfigData *configData = config->createAndSetConfig(setConfigCommand->getConfigNameString()); if (configData) { if (configData->supportsStringConvertion()) { if (configData->readFromString(setConfigCommand->getConfigValueString())) { CUnspecifiedMessageInformationRecord::makeRecord(QString("Setting configuration for '%1' to value '%2'.").arg(setConfigCommand->getConfigNameString()).arg(setConfigCommand->getConfigValueString()),&commandRecordRouter); configurationProvider->installGlobalConfiguration(config); } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Value for configuration property '%1' cannot be read from string '%2'.").arg(setConfigCommand->getConfigNameString()).arg(setConfigCommand->getConfigValueString()),&commandRecordRouter); } } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Value for configuration property '%1' cannot be from string '%2'.").arg(setConfigCommand->getConfigNameString()).arg(setConfigCommand->getConfigValueString()),&commandRecordRouter); } } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Configuration property '%1' not available.").arg(setConfigCommand->getConfigNameString()),&commandRecordRouter); } } else { CUnspecifiedMessageErrorRecord::makeRecord(QString("Configuration property '%1' is locked.").arg(setConfigCommand->getConfigNameString()),&commandRecordRouter); } CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (command->getCommandTag() == GETDESCRIPTIONCOMMAND) { CGetDescriptionCommand *getDesCommand = (CGetDescriptionCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); getDesCommand->setConfiguration(configurationProvider->getCurrentConfiguration()); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (command->getCommandTag() == GETSETTINGSCOMMAND) { CGetSettingsCommand *getDesCommand = (CGetSettingsCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); getDesCommand->setConfiguration(configurationProvider->getCurrentConfiguration()); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (command->getCommandTag() == GETREASONERCOMMAND) { CGetReasonerCommand *getReasonerCommand = (CGetReasonerCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); getReasonerCommand->setReasonerManager(reasonerManager); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (command->getCommandTag() == GETCLASSIFICATIONMANAGERCOMMAND) { CGetClassificationManagerCommand *getClassificationManCommand = (CGetClassificationManagerCommand *)command; CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); getClassificationManCommand->setClassificationManager(classificationMan); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); if (kbCommandsDelegater) { kbCommandsDelegater->delegateCommand(command); } else { CUnspecifiedMessageErrorRecord::makeRecord("Missing ontology manager.",&commandRecordRouter); } } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CCalculateQueryCommand *calcQueryCommand = (CCalculateQueryCommand *)command; CQuery *query = calcQueryCommand->getQuery(); if (reasonerManager) { if (query) { CUnspecifiedMessageInformationRecord::makeRecord("Sending query to reasoner manager.",&commandRecordRouter); CCommandCalculatedQueryCallbackEvent *calculatedQueryCE = new CCommandCalculatedQueryCallbackEvent(this,calcQueryCommand); reasonerManager->reasoningQuery(query,calculatedQueryCE); } else { CUnspecifiedMessageErrorRecord::makeRecord("Query cannot be be resolved.",&commandRecordRouter); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } } else { CUnspecifiedMessageErrorRecord::makeRecord("Missing Reasoner Manager.",&commandRecordRouter); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CPrepareKnowledgeBaseCommand* prepareKBCommand = (CPrepareKnowledgeBaseCommand*)command; if (reasonerManager) { CUnspecifiedMessageInformationRecord::makeRecord("Preparing ontology.",&commandRecordRouter); CConcreteOntology* ontology = prepareKBCommand->getOntology(); if (ontology) { COntologyPreparedCallbackEvent *ontPrepQueryCE = new COntologyPreparedCallbackEvent(this,prepareKBCommand); reasonerManager->prepareOntology(ontology,*prepareKBCommand->getOntologyProcessingRequirementList(),ontPrepQueryCE); } else { CUnspecifiedMessageErrorRecord::makeRecord("Ontology not specified.",&commandRecordRouter); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } } else { CUnspecifiedMessageErrorRecord::makeRecord("Missing reasoner manager.",&commandRecordRouter); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } } else if (dynamic_cast(command)) { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } else { CCommandRecordRouter commandRecordRouter(command,this); CStartProcessCommandRecord::makeRecord(&commandRecordRouter); CUnspecifiedMessageErrorRecord::makeRecord("Unsupported Command.",&commandRecordRouter); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } } } return true; } else if (type == EVENTCOMMANDCALCULATEDQUERYCALLBACK) { CCommandCalculatedQueryCallbackEvent *commCalQueryCallbackEv = (CCommandCalculatedQueryCallbackEvent *)event; CCalculateQueryCommand *command = dynamic_cast(commCalQueryCallbackEv->getCommand()); if (command) { CCommandRecordRouter commandRecordRouter(command,this); CUnspecifiedMessageInformationRecord::makeRecord("Query by reasoner manager calculated.",&commandRecordRouter); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } return true; } else if (type == EVENTONTOLOGYPREPAREDCALLBACK) { COntologyPreparedCallbackEvent* ontPreparedCallbackEv = (COntologyPreparedCallbackEvent*)event; CPrepareKnowledgeBaseCommand* command = dynamic_cast(ontPreparedCallbackEv->getCommand()); if (command) { CCommandRecordRouter commandRecordRouter(command,this); CUnspecifiedMessageInformationRecord::makeRecord("Ontology for reasoner manager prepared.",&commandRecordRouter); CStopProcessCommandRecord::makeRecord(&commandRecordRouter); CFinishProcessCommandRecord::makeRecord(&commandRecordRouter); } return true; } } else { return true; } return false; } void CCommanderManagerThread::initializeConfiguration(CConfiguration *initConfig, CCommandRecordRouter *commandRecordRouter) { if (configurationProvider) { CUnspecifiedMessageErrorRecord::makeRecord("Initial configuration already exists.",commandRecordRouter); } else { configurationProvider = new CReasonerCommanderGlobalConfiguration(initConfig); } } void CCommanderManagerThread::initializeCommander(CCommanderInitializationFactory *initializationFactory, CCommandRecordRouter *commandRecordRouter) { if (!configurationProvider) { CUnspecifiedMessageErrorRecord::makeRecord("Missing initial configuration.",commandRecordRouter); } else { CGlobalConfigurationBase *config = 0; config = configurationProvider->createNextGlobalConfiguration(); if (reasonerManager) { CUnspecifiedMessageErrorRecord::makeRecord("Reasoner manager already exists.",commandRecordRouter); } else { reasonerManager = initializationFactory->createReasonerManager(configurationProvider); ((CReasonerManagerConfigType *)(config->createAndSetConfig("Konclude.Execution.ReasonerManager"))->getConfigType())->setReasonerManager(reasonerManager); } if (classificationMan) { CUnspecifiedMessageErrorRecord::makeRecord("Classification manager already exists.",commandRecordRouter); } else { classificationMan = initializationFactory->createClassificationManager(configurationProvider); ((CClassificationManagerConfigType *)config->createAndSetConfig("Konclude.Execution.ClassificationManager")->getConfigType())->setClassificationManager(classificationMan); } if (ontoRevMan) { CUnspecifiedMessageErrorRecord::makeRecord("Ontology revision manager already exists.",commandRecordRouter); } else { ontoRevMan = initializationFactory->createOntologyRevisionManager(configurationProvider); ((COntologyRevisionManagerConfigType *)config->createAndSetConfig("Konclude.Execution.OntologyRevisionManager")->getConfigType())->setOntologyRevisionManager(ontoRevMan); } configurationProvider->installGlobalConfiguration(config); initializationFactory->initializeReasonerManager(reasonerManager,configurationProvider); initializationFactory->initializeClassificationManager(classificationMan,configurationProvider); initializationFactory->initializeOntologyRevisionManager(ontoRevMan,configurationProvider); kbCommandsDelegater = dynamic_cast(ontoRevMan); } } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandRecorder.cpp0000644000175000017500000000432512520756352025146 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandRecorder.h" namespace Konclude { namespace Control { namespace Command { CCommandRecorder::CCommandRecorder() { } CCommandRecorder::~CCommandRecorder() { } CContextRecorder *CCommandRecorder::recordData(CContextRecordData *recData) { if (recData) { CCommandRecordData *commRecData = dynamic_cast(recData); if (commRecData) { recordData(commRecData); } else { delete recData; } } return this; } CCommandRecorder *CCommandRecorder::recordData(CCommandRecordData *recData) { if (recData) { LOGC(recData->getRecordErrorLevel(),recData->getRecordDomain(),recData->getRecordMessage(),recData->getCommand()); CCommand *command = recData->getCommand(); if (command) { command->reportError(recData->getReflexiveTransetiveMaximumRecordErrorLevel()); command->appendRecordData(recData); } } return this; } void CCommandRecorder::recordToCommand(CCommand *command, CCommandRecordData *recData) { if (recData) { LOGC(recData->getRecordErrorLevel(),recData->getRecordDomain(),recData->getRecordMessage(),recData->getCommand()); if (command) { command->reportError(recData->getReflexiveTransetiveMaximumRecordErrorLevel()); command->appendRecordData(recData); } } } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandExecutedBlocker.h0000644000175000017500000000373412520756352026121 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCOMMANDEXECUTEDBLOCKER_H #define KONCLUDE_Control_COMMAND_CCOMMANDEXECUTEDBLOCKER_H // Libraries includes #include // Namespace includes #include "CCommand.h" // Other includes #include "Concurrent/Callback/CBlockingCallbackData.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Concurrent; using namespace Callback; namespace Control { namespace Command { /*! * * \class CCommandExecutedBlocker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommandExecutedBlocker { // public methods public: //! Constructor CCommandExecutedBlocker(); //! Destructor virtual ~CCommandExecutedBlocker(); static bool waitExecutedCommand(CCommand *blockingCommand); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCOMMANDEXECUTEDBLOCKER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommanderManagerThread.h0000644000175000017500000001135712520756352026102 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCOMMANDERMANAGERTHREAD_H #define KONCLUDE_Control_COMMAND_CCOMMANDERMANAGERTHREAD_H // Libraries includes #include // Namespace includes #include "CCommand.h" #include "CCommandRecordRouter.h" #include "CCommanderManager.h" #include "CReasonerCommanderGlobalConfiguration.h" // Other includes #include "Control/Command/Records/CStartProcessCommandRecord.h" #include "Control/Command/Records/CStopProcessCommandRecord.h" #include "Control/Command/Records/CFinishProcessCommandRecord.h" #include "Control/Command/Records/CUnspecifiedMessageErrorRecord.h" #include "Control/Command/Records/CUnspecifiedMessageInformationRecord.h" #include "Reasoner/Kernel/Manager/CReasonerManager.h" #include "Reasoner/Kernel/Manager/CAnalyseReasonerManager.h" #include "Reasoner/Kernel/Manager/CExperimentalReasonerManager.h" #include "Reasoner/Revision/CSPOntologyRevisionManager.h" #include "Control/Command/Instructions/CInitializeConfigurationCommand.h" #include "Control/Command/Instructions/CInitializeReasonerCommand.h" #include "Control/Command/Instructions/CGetDescriptionCommand.h" #include "Control/Command/Instructions/CSkipUnsupportedCommandCommand.h" #include "Control/Command/Instructions/CKnowledgeBaseCommand.h" #include "Control/Command/Instructions/CCalculateQueryCommand.h" #include "Control/Command/Instructions/CGetReasonerCommand.h" #include "Control/Command/Instructions/CGetClassificationManagerCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseConfigCommand.h" #include "Control/Command/Instructions/CSetKnowledgeBaseConfigCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseSettingsCommand.h" #include "Control/Command/Instructions/CPrepareKnowledgeBaseForQueryCommand.h" #include "Control/Command/Events/CCommandCalculatedQueryCallbackEvent.h" #include "Control/Command/Events/COntologyPreparedCallbackEvent.h" #include "Events/CRealizeCommandEvent.h" #include "Config/CConfiguration.h" #include "Concurrent/CThread.h" #include "Logger/Record/CContextRecorder.h" #include "Logger/CLogIdentifier.h" #include "Reasoner/Classifier/CClassificationManager.h" #include "Reasoner/Classifier/CSubsumptionClassifierFactory.h" #include "Reasoner/Classifier/CConfigDependedSubsumptionClassifierFactory.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Reasoner; using namespace Kernel::Manager; using namespace Revision; using namespace Concurrent; using namespace Logger; using namespace Logger::Record; using namespace Config; namespace Control { namespace Command { using namespace Events; using namespace Records; /*! * * \class CCommanderManagerThread * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommanderManagerThread : public CCommanderManager, public CThread, public CLogIdentifier { // public methods public: //! Constructor CCommanderManagerThread(); //! Destructor virtual ~CCommanderManagerThread(); virtual CCommanderManagerThread *realizeCommand(CCommand *command); // protected methods protected: bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); virtual void initializeConfiguration(CConfiguration *initConfig, CCommandRecordRouter *commandRecordRouter); virtual void initializeCommander(CCommanderInitializationFactory *initializationFactory, CCommandRecordRouter *commandRecordRouter); // protected variables protected: CReasonerCommanderGlobalConfiguration *configurationProvider; CReasonerManager *reasonerManager; CCommandDelegater *kbCommandsDelegater; CClassificationManager *classificationMan; COntologyRevisionManager *ontoRevMan; // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCOMMANDERMANAGERTHREAD_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CReasonerManagerConfigType.h0000644000175000017500000000467112520756354026616 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CREASONERMANAGERCONFIGTYPE_H #define KONCLUDE_Control_COMMAND_CREASONERMANAGERCONFIGTYPE_H // Libraries includes #include #include // Namespace includes // Other includes #include "Reasoner/Kernel/Manager/CReasonerManager.h" #include "Config/CObjectConfigType.h" #include "Instructions/CInitializeConfigurationCommand.h" #include "Instructions/CInitializeReasonerCommand.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Reasoner::Kernel::Manager; namespace Control { namespace Command { using namespace Instructions; /*! * * \class CReasonerManagerConfigType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerManagerConfigType : public CObjectConfigType { // public methods public: //! Constructor CReasonerManagerConfigType(CReasonerManager *reasonerManager = 0); //! Destructor virtual ~CReasonerManagerConfigType(); virtual CReasonerManagerConfigType *getTypeCopy(); virtual CReasonerManager *getReasonerManager(); virtual CReasonerManagerConfigType *setReasonerManager(CReasonerManager *reasonerManager); virtual bool equals(CConfigType *dataType); // protected methods protected: // protected variables protected: CReasonerManager *rManager; // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CREASONERMANAGERCONFIGTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/0000755000175000017500000000000012613407250023764 5ustar jonasjonas././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CChooseParseInstallKnowledgeBaseO0000644000175000017500000000544312520756334032343 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand::CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand(const QString &knowledgeBaseNameString, const QStringList& loadIRIs, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CLoadKnowledgeBaseCommand(knowledgeBaseNameString,parentSuperCommand) { mLoadIRIs = loadIRIs; mOntologyRevisionProviderCommand = ontologyRevisionProviderCommand; addCommandPrecondition(new CCommandProcessedPrecondition(mOntologyRevisionProviderCommand->getCommand())); } CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand::~CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand() { } qint64 CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand::getCommandTag() { return CHOOSEPARSEINSTALLKNOWLEDGEBASEOWLXMLONTOLOGYCOMMAND; } COntologyRevision* CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand::getOntologyRevision() { return mOntologyRevisionProviderCommand->getOntologyRevision(); } QString CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand::getBriefCommandDescription() { return QString("Choose-Parse-Install-'%1'-Knowledge-Base-OWL-XML-Ontology Command").arg(kbString); } QStringList CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand::getLoadIRIStrings() { return mLoadIRIs; } bool CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand::getLoadImports() { return mLoadImports; } QMap CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand::getOntologieIRIMappings() { return mOntoIRIMapping; } CCommand* CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand::getCommand() { return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructSubClassHirarchyQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructSubClassHirarchyQueryCo0000644000175000017500000000511212520756336032450 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConstructSubClassHirarchyQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CConstructSubClassHirarchyQueryCommand::CConstructSubClassHirarchyQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, const QDomElement &queryNode, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { node = queryNode; revProvider = ontologyRevisionProviderCommand; query = 0; addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CConstructSubClassHirarchyQueryCommand::~CConstructSubClassHirarchyQueryCommand() { delete query; } qint64 CConstructSubClassHirarchyQueryCommand::getCommandTag() { return CONSTRUCTSUBCLASSHIERARCHYQUERYCOMMAND; } QString CConstructSubClassHirarchyQueryCommand::getBriefCommandDescription() { return QString("Construct-SubClassHierarchy-Query Command"); } CQuery *CConstructSubClassHirarchyQueryCommand::getQuery() { return query; } CCommand *CConstructSubClassHirarchyQueryCommand::getCommand() { return this; } CConstructSubClassHirarchyQueryCommand *CConstructSubClassHirarchyQueryCommand::setQuery(CQuery *knowledgeBaseQuery) { query = knowledgeBaseQuery; return this; } COntologyRevision *CConstructSubClassHirarchyQueryCommand::getOntologyRevision() { COntologyRevision *rev = 0; if (revProvider) { rev = revProvider->getOntologyRevision(); } return rev; } QDomElement *CConstructSubClassHirarchyQueryCommand::getQueryNode() { return &node; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetSettingsCommand.h0000644000175000017500000000465412520756340030014 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CGETSETTINGSCOMMAND_H #define KONCLUDE_Control_COMMAND_CGETSETTINGSCOMMAND_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Other includes #include "Config/CConfigData.h" #include "Config/CConfigurationBase.h" #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Config; namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetSettingsCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetSettingsCommand : public CPreconditionCommand { // public methods public: //! Constructor CGetSettingsCommand(CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetSettingsCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CGetSettingsCommand *setConfiguration(CConfigurationBase *configuration); virtual CConfigurationBase *getConfiguration(); // protected methods protected: // protected variables protected: CConfigurationBase *config; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CGETSETTINGSCOMMAND_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CPrepareKnowledgeBaseForRevisionCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CPrepareKnowledgeBaseForRevisionC0000644000175000017500000000376412520756344032356 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrepareKnowledgeBaseForRevisionCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CPrepareKnowledgeBaseForRevisionCommand::CPrepareKnowledgeBaseForRevisionCommand(CKnowledgeBaseRevisionCommandProvider* ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CPrepareKnowledgeBaseCommand(ontologyRevisionProviderCommand,parentSuperCommand) { mOntProReqList.clear(); } CPrepareKnowledgeBaseForRevisionCommand::~CPrepareKnowledgeBaseForRevisionCommand() { } qint64 CPrepareKnowledgeBaseForRevisionCommand::getCommandTag() { return PREPAREKNOWLEDGEBASEFORREVISIONCOMMANDCOMMAND; } QString CPrepareKnowledgeBaseForRevisionCommand::getBriefCommandDescription() { return QString("Prepare-Knowledge-Base-For-Revision Command"); } CPrepareKnowledgeBaseForRevisionCommand* CPrepareKnowledgeBaseForRevisionCommand::addOntologyProcessingStepRequirement(COntologyProcessingStepRequirement* requirement) { mOntProReqList.append(requirement); return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLXMLOntologyCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLXMLOntologyC0000644000175000017500000000413212520756342032133 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLoadKnowledgeBaseOWLXMLOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CLoadKnowledgeBaseOWLXMLOntologyCommand::CLoadKnowledgeBaseOWLXMLOntologyCommand(const QString &knowledgeBaseNameString, const QStringList& loadIRIs, CCommand *parentSuperCommand) : CLoadKnowledgeBaseCommand(knowledgeBaseNameString,parentSuperCommand) { mLoadIRIs = loadIRIs; } CLoadKnowledgeBaseOWLXMLOntologyCommand::~CLoadKnowledgeBaseOWLXMLOntologyCommand() { } qint64 CLoadKnowledgeBaseOWLXMLOntologyCommand::getCommandTag() { return LOADKNOWLEDGEBASEOWLXMLONTOLOGYCOMMAND; } QString CLoadKnowledgeBaseOWLXMLOntologyCommand::getBriefCommandDescription() { return QString("Load-'%1'-Knowledge-Base-OWL-XML-Ontology Command").arg(kbString); } QStringList CLoadKnowledgeBaseOWLXMLOntologyCommand::getLoadIRIStrings() { return mLoadIRIs; } bool CLoadKnowledgeBaseOWLXMLOntologyCommand::getLoadImports() { return mLoadImports; } QMap CLoadKnowledgeBaseOWLXMLOntologyCommand::getOntologieIRIMappings() { return mOntoIRIMapping; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseRealizeCommand.cpp0000644000175000017500000000315312520756342032130 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CKnowledgeBaseRealizeCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CKnowledgeBaseRealizeCommand::CKnowledgeBaseRealizeCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseProcessCommand(knowledgeBaseNameString,parentSuperCommand) { } CKnowledgeBaseRealizeCommand::~CKnowledgeBaseRealizeCommand() { } QString CKnowledgeBaseRealizeCommand::getBriefCommandDescription() { return QString("Knowledge-Base-'%1'-Realize Command").arg(kbString); } qint64 CKnowledgeBaseRealizeCommand::getCommandTag() { return PROCESSKNOWLEDGEBASEREALIZECOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CReadXMLCommandProvider.h0000644000175000017500000000427112520756346030524 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CREADXMLCOMMANDPROVIDER_H #define KONCLUDE_CONTROL_COMMAND_CREADXMLCOMMANDPROVIDER_H // Libraries includes #include #include // Namespace includes // Other includes #include "Reasoner/Revision/COntologyRevision.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Revision; namespace Control { namespace Command { namespace Instructions { /*! * * \class CReadXMLCommandProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReadXMLCommandProvider { // public methods public: //! Constructor CReadXMLCommandProvider(); //! Destructor virtual ~CReadXMLCommandProvider(); virtual QDomElement getReadXMLNode() = 0; virtual CCommand *getCommand() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CREADXMLCOMMANDPROVIDER_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteOWLlinkOWL2XMLSatisfiableTestCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteOWLlinkOWL2XMLSatisfiableTe0000644000175000017500000000560712520756350032046 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CWRITEOWLLINKOWL2XMLSATISFIABLETESTCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CWRITEOWLLINKOWL2XMLSATISFIABLETESTCOMMAND_H // Libraries includes #include // Namespace includes #include "CWriteOntologyCommand.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Other includes #include "Renderer/COntologyOWL2QtXMLRenderer.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Renderer; namespace Control { namespace Command { namespace Instructions { /*! * * \class CWriteOWLlinkOWL2XMLSatisfiableTestCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteOWLlinkOWL2XMLSatisfiableTestCommand : public CWriteOntologyCommand { // public methods public: //! Constructor CWriteOWLlinkOWL2XMLSatisfiableTestCommand(COntologyOWL2QtXMLRenderer* renderer, const QString& fileName, const QStringList& satTestClasses, const QString& testKBName, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CWriteOWLlinkOWL2XMLSatisfiableTestCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual COntologyRenderer* getRenderer(); virtual CCommand *getCommand(); COntologyOWL2QtXMLRenderer* getOWL2XMLRenderer(); QString getWriteFileName(); QStringList getSatisfiableTestClassesList(); QString getTestKBName(); // protected methods protected: // protected variables protected: QString mWriteFileName; QString mTestKBName; COntologyOWL2QtXMLRenderer* mRenderer; QStringList mSatTestClasses; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CWRITEOWLLINKOWL2XMLSATISFIABLETESTCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsSatisfiableQueryCommand.cpp0000644000175000017500000000274212520756342031655 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIsSatisfiableQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CIsSatisfiableQueryCommand::CIsSatisfiableQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { } CIsSatisfiableQueryCommand::~CIsSatisfiableQueryCommand() { } QString CIsSatisfiableQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-SatisfiableQuery Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSAXParseOWL2XMLOntologyCommand.h0000644000175000017500000000553512520756346031767 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CSAXPARSEOWL2XMLONTOLOGYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CSAXPARSEOWL2XMLONTOLOGYCOMMAND_H // Libraries includes #include // Namespace includes #include "CParseOntologyCommand.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CReadXMLCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CSAXParseOWL2XMLOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSAXParseOWL2XMLOntologyCommand : public CParseOntologyCommand, public CKnowledgeBaseRevisionCommandProvider { // public methods public: //! Constructor CSAXParseOWL2XMLOntologyCommand(const QString& sourceStringName, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CSAXParseOWL2XMLOntologyCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual COntologyRevision *getOntologyRevision(); virtual CCommand *getCommand(); virtual const QString& getSourceString(); // protected methods protected: // protected variables protected: CKnowledgeBaseRevisionCommandProvider *revProvider; CReadXMLCommandProvider* mXmlCommandProvider; QString mSourceString; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CSAXPARSEOWL2XMLONTOLOGYCOMMAND_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLXMLOntologyCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLXMLOntologyC0000644000175000017500000000521112520756344032134 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CLoadKnowledgeBaseOWLXMLOntologyCommand_H #define KONCLUDE_CONTROL_COMMAND_CLoadKnowledgeBaseOWLXMLOntologyCommand_H // Libraries includes #include #include #include // Namespace includes #include "CLoadKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CLoadKnowledgeBaseOWLXMLOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLoadKnowledgeBaseOWLXMLOntologyCommand : public CLoadKnowledgeBaseCommand { // public methods public: //! Constructor CLoadKnowledgeBaseOWLXMLOntologyCommand(const QString &knowledgeBaseNameString, const QStringList& loadIRIs, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CLoadKnowledgeBaseOWLXMLOntologyCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QStringList getLoadIRIStrings(); virtual bool getLoadImports(); virtual QMap getOntologieIRIMappings(); // protected methods protected: // protected variables protected: QStringList mLoadIRIs; bool mLoadImports; QMap mOntoIRIMapping; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CLoadKnowledgeBaseOWLXMLOntologyCommand_H ././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CChooseParseInstallKnowledgeBaseO0000644000175000017500000000640612520756334032343 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CCHOOSEPARSEINSTALLKNOWLEDGEBASEOWLAUTOONTOLOGYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CCHOOSEPARSEINSTALLKNOWLEDGEBASEOWLAUTOONTOLOGYCOMMAND_H // Libraries includes #include #include #include // Namespace includes #include "CLoadKnowledgeBaseCommand.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CLoadKnowledgeBaseData.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand : public CLoadKnowledgeBaseCommand, public CKnowledgeBaseRevisionCommandProvider { // public methods public: //! Constructor CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand(const QString &knowledgeBaseNameString, const QList& loadDataList, QMap ontoIRIMapping, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual COntologyRevision* getOntologyRevision(); virtual bool getLoadImports(); QList getLoadDataList(); virtual QMap getOntologieIRIMappings(); virtual CCommand* getCommand(); // protected methods protected: // protected variables protected: QList mLoadDataList; QMap mOntoIRIMapping; bool mLoadImports; CKnowledgeBaseRevisionCommandProvider* mOntologyRevisionProviderCommand; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CCHOOSEPARSEINSTALLKNOWLEDGEBASEOWLAUTOONTOLOGYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsConsistentQueryCommand.h0000644000175000017500000000444612520756340031226 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CISCONSISTENTQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CISCONSISTENTQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CIsConsistentQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIsConsistentQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CIsConsistentQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CIsConsistentQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CISCONSISTENTQUERYCOMMAND_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseLanguageCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseLanguageCommand.0000644000175000017500000000474012520756340032216 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CGETKNOWLEDGEBASELANGUAGECOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CGETKNOWLEDGEBASELANGUAGECOMMAND_H // Libraries includes #include // Namespace includes #include "CKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetKnowledgeBaseLanguageCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetKnowledgeBaseLanguageCommand : public CKnowledgeBaseCommand { // public methods public: //! Constructor CGetKnowledgeBaseLanguageCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetKnowledgeBaseLanguageCommand(); virtual QString getBriefCommandDescription(); virtual QString getKnowledgeBaseName(); virtual QString* getLanguageStringPointer(); virtual const QString& getLanguageString(); virtual qint64 getCommandTag(); // protected methods protected: // protected variables protected: QString mLanguageString; QString kbString; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CGetKnowledgeBaseLanguageCommand_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsClassSubsumedByQueryOWL2XMLNodeCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsClassSubsumedByQueryOWL2XMLNod0000644000175000017500000000504212520756340032077 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CISCLASSSUBSUMEDBYQUERYOWL2XMLNODECOMMAND_H #define KONCLUDE_Control_COMMAND_CISCLASSSUBSUMEDBYQUERYOWL2XMLNODECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CIsClassSubsumedByQueryCommand.h" #include "CCalculateQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CIsClassSubsumedByQueryOWL2XMLNodeCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIsClassSubsumedByQueryOWL2XMLNodeCommand : public CIsClassSubsumedByQueryCommand { // public methods public: //! Constructor CIsClassSubsumedByQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CIsClassSubsumedByQueryOWL2XMLNodeCommand(); virtual QString getBriefCommandDescription(); virtual qint64 getCommandTag(); virtual QDomElement getQueryNode(); // protected methods protected: // protected variables protected: QDomElement node; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CISCLASSSUBSUMEDBYQUERYOWL2XMLNODECOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CReadTextCommandProvider.cpp0000644000175000017500000000226612520756344031343 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReadTextCommandProvider.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CReadTextCommandProvider::CReadTextCommandProvider() { } CReadTextCommandProvider::~CReadTextCommandProvider() { } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CTestExtendedCalculateQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CTestExtendedCalculateQueryComman0000644000175000017500000000616012520756346032426 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CTESTEXTENDEDCALCULATEQUERYCOMMAND_H #define KONCLUDE_Control_COMMAND_CTESTEXTENDEDCALCULATEQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CCalculateQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" #include "Reasoner/Query/CQueryResult.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CTestExtendedCalculateQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTestExtendedCalculateQueryCommand : public CCalculateQueryCommand { // public methods public: //! Constructor CTestExtendedCalculateQueryCommand(CQueryCommandProvider *queryCommandProvider, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CTestExtendedCalculateQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual qint64 getTimingReportLevel(); virtual CTestExtendedCalculateQueryCommand *setTimingReportLevel(qint64 timingReportLevel); virtual qint64 getCalculationTime(); virtual bool hasCalculationTime(); virtual CTestExtendedCalculateQueryCommand *setCalculationTime(qint64 calculationTime); virtual qint64 getCreationElapsedMilliSeconds(); virtual CTestExtendedCalculateQueryCommand *setExpectedQueryResult(CQueryResult *expectedQueryResult); virtual CQueryResult *getExpectedQueryResult(); // protected methods protected: // protected variables protected: qint64 timingLevel; qint64 calcTime; bool hasCalcTime; QTime creationTime; CQueryResult *expectedResult; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CTESTEXTENDEDCALCULATEQUERYCOMMAND_H ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSaveOWL2XMLExtractedKnowledgeBaseCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSaveOWL2XMLExtractedKnowledgeBas0000644000175000017500000000510712520756346032104 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CSAVEOWL2XMLEXTRACTEDKNOWLEDGEBASECOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CSAVEOWL2XMLEXTRACTEDKNOWLEDGEBASECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CSaveKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CSaveOWL2XMLExtractedKnowledgeBaseCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaveOWL2XMLExtractedKnowledgeBaseCommand : public CSaveKnowledgeBaseCommand { // public methods public: //! Constructor CSaveOWL2XMLExtractedKnowledgeBaseCommand(const QString &knowledgeBaseNameString, const QString& loadIRI, const QStringList& extractEntityNames, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CSaveOWL2XMLExtractedKnowledgeBaseCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QString getSaveIRIString(); virtual QStringList getExtractEntitiyList(); // protected methods protected: // protected variables protected: QString mSaveIRI; QStringList mEntityNames; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CSAVEOWL2XMLEXTRACTEDKNOWLEDGEBASECOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CRealizeQueryCommand.cpp0000644000175000017500000000302512520756346030525 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizeQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CRealizeQueryCommand::CRealizeQueryCommand(const QString& knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { } CRealizeQueryCommand::~CRealizeQueryCommand() { } qint64 CRealizeQueryCommand::getCommandTag() { return REALIZEQUERYCOMMAND; } QString CRealizeQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-Realize Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetCurrentKnowledgeBaseRevisionCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetCurrentKnowledgeBaseRevisionC0000644000175000017500000000435512520756336032371 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetCurrentKnowledgeBaseRevisionCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetCurrentKnowledgeBaseRevisionCommand::CGetCurrentKnowledgeBaseRevisionCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseCommand(parentSuperCommand) { kbString = knowledgeBaseNameString; onRev = 0; } CGetCurrentKnowledgeBaseRevisionCommand::~CGetCurrentKnowledgeBaseRevisionCommand() { } qint64 CGetCurrentKnowledgeBaseRevisionCommand::getCommandTag() { return GETCURRENTKNOWLEDGEBASEREVISIONCOMMAND; } QString CGetCurrentKnowledgeBaseRevisionCommand::getKnowledgeBaseName() { return kbString; } QString CGetCurrentKnowledgeBaseRevisionCommand::getBriefCommandDescription() { return QString("Get-Current-'%1'-Knowledge-Base-Revision Command").arg(kbString); } COntologyRevision *CGetCurrentKnowledgeBaseRevisionCommand::getOntologyRevision() { return onRev; } CGetCurrentKnowledgeBaseRevisionCommand *CGetCurrentKnowledgeBaseRevisionCommand::setOntologyRevision(COntologyRevision *ontologyRevision) { onRev = ontologyRevision; return this; } CCommand *CGetCurrentKnowledgeBaseRevisionCommand::getCommand() { return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetSettingsCommand.cpp0000644000175000017500000000330212520756340030334 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetSettingsCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetSettingsCommand::CGetSettingsCommand(CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { config = 0; } CGetSettingsCommand::~CGetSettingsCommand() { } qint64 CGetSettingsCommand::getCommandTag() { return GETSETTINGSCOMMAND; } QString CGetSettingsCommand::getBriefCommandDescription() { return QString("Get-Settings Command"); } CGetSettingsCommand *CGetSettingsCommand::setConfiguration(CConfigurationBase *configuration) { config = configuration; return this; } CConfigurationBase *CGetSettingsCommand::getConfiguration() { return config; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000020700000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSaveOWLlinkOWL2XMLSatisfiableTes0000644000175000017500000000472112520756346032036 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand::CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand(const QString &knowledgeBaseNameString, const QString& loadIRI, const QStringList& extractEntityNames, const QString& testKBName, CCommand *parentSuperCommand) : CSaveKnowledgeBaseCommand(knowledgeBaseNameString,parentSuperCommand) { mEntityNames = extractEntityNames; mSaveIRI = loadIRI; mTestKBName = testKBName; } CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand::~CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand() { } qint64 CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand::getCommandTag() { return SAVEOWLLINKOWL2XMLSATTESTKBCOMMAND; } QString CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand::getBriefCommandDescription() { return QString("Save-'%1'-Extracted-Knowledge-Base-OWLlink-OWL-2-XML-Satisfiable-Test Command").arg(kbString); } QString CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand::getSaveIRIString() { return mSaveIRI; } QStringList CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand::getExtractEntitiyList() { return mEntityNames; } QString CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand::getTestKBName() { return mTestKBName; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractKnowledgeBaseLanguageCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractKnowledgeBaseLanguageComm0000644000175000017500000000547312520756336032361 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CEXTRACTKNOWLEDGEBASELANGUAGECOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CEXTRACTKNOWLEDGEBASELANGUAGECOMMAND_H // Libraries includes // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CKnowledgeBaseEntitiesExtractionSpecification.h" #include "CExtractedKnowledgeBaseEntitiesContainer.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CExtractKnowledgeBaseLanguageCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExtractKnowledgeBaseLanguageCommand : public CPreconditionCommand { // public methods public: //! Constructor CExtractKnowledgeBaseLanguageCommand(QString* languageStringPointer, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CExtractKnowledgeBaseLanguageCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual COntologyRevision *getOntologyRevision(); CExtractKnowledgeBaseLanguageCommand* setKBLanguageString(const QString& languageString); // protected methods protected: // protected variables protected: CKnowledgeBaseRevisionCommandProvider *revProvider; QString* mLanguageStringPointer; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CEXTRACTKNOWLEDGEBASELANGUAGECOMMAND_H ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseObjectPropertyEntitiesCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseObjectPropertyEn0000644000175000017500000000376112520756340032356 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetKnowledgeBaseObjectPropertyEntitiesCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetKnowledgeBaseObjectPropertyEntitiesCommand::CGetKnowledgeBaseObjectPropertyEntitiesCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CGetKnowledgeBaseEntitiesCommand(knowledgeBaseNameString,parentSuperCommand) { mExtractSpec.setEntityExtractionFlags(CKnowledgeBaseEntitiesExtractionSpecification::EXTRACTOBJECTPROPERTYENTITIES); mExtractedEntityContainer = new CExtractedKnowledgeBaseEntitiesContainer(); } CGetKnowledgeBaseObjectPropertyEntitiesCommand::~CGetKnowledgeBaseObjectPropertyEntitiesCommand() { delete mExtractedEntityContainer; } qint64 CGetKnowledgeBaseObjectPropertyEntitiesCommand::getCommandTag() { return EXTRACTKNOWLEDGEBASEOBJECTPROPERTYENTITIESCOMMAND; } QString CGetKnowledgeBaseObjectPropertyEntitiesCommand::getBriefCommandDescription() { return QString("Get-Knowledge-Base-ObjectProperty-Entities Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CProcessQueryOWL2XMLNodeCommand.h0000644000175000017500000000471112520756344032051 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CPROCESSQUERYOWL2XMLNODECOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CPROCESSQUERYOWL2XMLNODECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CProcessQueryCommand.h" #include "CCalculateQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CProcessQueryOWL2XMLNodeCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessQueryOWL2XMLNodeCommand : public CProcessQueryCommand { // public methods public: //! Constructor CProcessQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CProcessQueryOWL2XMLNodeCommand(); virtual QString getBriefCommandDescription(); virtual qint64 getCommandTag(); virtual QDomElement getQueryNode(); // protected methods protected: // protected variables protected: QDomElement node; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CPROCESSQUERYOWL2XMLNODECOMMAND_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteXMLSubClassHierarchyQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteXMLSubClassHierarchyQueryCo0000644000175000017500000000356512520756350032312 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteXMLSubClassHierarchyQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CWriteXMLSubClassHierarchyQueryCommand::CWriteXMLSubClassHierarchyQueryCommand(const QString& knowledgeBaseNameString, const QString& outputFileString, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { mOutputFileString = outputFileString; } CWriteXMLSubClassHierarchyQueryCommand::~CWriteXMLSubClassHierarchyQueryCommand() { } qint64 CWriteXMLSubClassHierarchyQueryCommand::getCommandTag() { return WRITEXMLSUBCLASSHIERARCHYQUERYCOMMAND; } QString CWriteXMLSubClassHierarchyQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-WriteXMLSubClassHierachry Command"); } QString CWriteXMLSubClassHierarchyQueryCommand::getOutputFileString() { return mOutputFileString; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteXMLSubClassHirarchyQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteXMLSubClassHirarch0000644000175000017500000000572112520756336032351 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CCONSTRUCTWRITEXMLSUBCLASSHIRARCHYQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CCONSTRUCTWRITEXMLSUBCLASSHIRARCHYQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CQueryCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CConstructWriteXMLSubClassHirarchyQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConstructWriteXMLSubClassHirarchyQueryCommand : public CPreconditionCommand, public CQueryCommandProvider { // public methods public: //! Constructor CConstructWriteXMLSubClassHirarchyQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, const QString& outputFileString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CConstructWriteXMLSubClassHirarchyQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual CQuery *getQuery(); virtual CConstructWriteXMLSubClassHirarchyQueryCommand *setQuery(CQuery *knowledgeBaseQuery); virtual COntologyRevision *getOntologyRevision(); QString getOutputFileName(); // protected methods protected: // protected variables protected: QString mOutputFileName; CKnowledgeBaseRevisionCommandProvider *revProvider; CQuery *query; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CCONSTRUCTWRITEXMLSUBCLASSHIRARCHYQUERYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseOntologyCommand.h0000644000175000017500000000412512520756344030356 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CPARSEONTOLOGYCOMMAND_H #define KONCLUDE_Control_COMMAND_CPARSEONTOLOGYCOMMAND_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CParseOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CParseOntologyCommand : public CPreconditionCommand { // public methods public: //! Constructor CParseOntologyCommand(CCommand *parentSuperCommand = 0); //! Destructor virtual ~CParseOntologyCommand(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CPARSEONTOLOGYCOMMAND_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructClassSatisfiableQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructClassSatisfiableQueryCo0000644000175000017500000000513112520756334032452 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConstructClassSatisfiableQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CConstructClassSatisfiableQueryCommand::CConstructClassSatisfiableQueryCommand(const QString& className, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { mQuery = nullptr; mClassName = className; revProvider = ontologyRevisionProviderCommand; addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CConstructClassSatisfiableQueryCommand::~CConstructClassSatisfiableQueryCommand() { delete mQuery; } qint64 CConstructClassSatisfiableQueryCommand::getCommandTag() { return CONSTRUCTCLASSSATISFIABLEQUERYCOMMAND; } QString CConstructClassSatisfiableQueryCommand::getBriefCommandDescription() { return QString("Construct-Class-Satisfiable-Query Command"); } CCommand *CConstructClassSatisfiableQueryCommand::getCommand() { return this; } COntologyRevision *CConstructClassSatisfiableQueryCommand::getOntologyRevision() { COntologyRevision *rev = 0; if (revProvider) { rev = revProvider->getOntologyRevision(); } return rev; } const QString& CConstructClassSatisfiableQueryCommand::getClassName() { return mClassName; } CQuery* CConstructClassSatisfiableQueryCommand::getQuery() { return mQuery; } CConstructClassSatisfiableQueryCommand* CConstructClassSatisfiableQueryCommand::setQuery(CQuery *knowledgeBaseQuery) { mQuery = knowledgeBaseQuery; return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteOWL2XMLOntologyCommand.cpp0000644000175000017500000000404712520756350031756 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteOWL2XMLOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CWriteOWL2XMLOntologyCommand::CWriteOWL2XMLOntologyCommand(COntologyOWL2QtXMLRenderer* renderer, const QString& fileName, CCommand *parentSuperCommand) : CWriteOntologyCommand(parentSuperCommand) { mRenderer = renderer; mWriteFileName = fileName; } CWriteOWL2XMLOntologyCommand::~CWriteOWL2XMLOntologyCommand() { delete mRenderer; } QString CWriteOWL2XMLOntologyCommand::getBriefCommandDescription() { return QString("Write-OWL-2-XML-Ontology Command"); } qint64 CWriteOWL2XMLOntologyCommand::getCommandTag() { return WRITEOWL2XMLONTOLOGYCOMMAND; } COntologyRenderer* CWriteOWL2XMLOntologyCommand::getRenderer() { return mRenderer; } QString CWriteOWL2XMLOntologyCommand::getWriteFileName() { return mWriteFileName; } CCommand* CWriteOWL2XMLOntologyCommand::getCommand() { return this; } COntologyOWL2QtXMLRenderer* CWriteOWL2XMLOntologyCommand::getOWL2XMLRenderer() { return mRenderer; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CInsertResponseCommentCommand.h0000644000175000017500000000447612520756340032064 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_INSTRUCTIONS_CINSERTRESPONSECOMMENTCOMMAND_H #define KONCLUDE_Control_COMMAND_INSTRUCTIONS_CINSERTRESPONSECOMMENTCOMMAND_H // Libraries includes #include // Namespace includes // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CInsertResponseCommentCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CInsertResponseCommentCommand : public CPreconditionCommand { // public methods public: //! Constructor CInsertResponseCommentCommand(const QString &responseComment, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CInsertResponseCommentCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QString getResponseComment(); // protected methods protected: // protected variables protected: QString comment; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_INSTRUCTIONS_CINSERTRESPONSECOMMENTCOMMAND_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CPrepareKnowledgeBaseForQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CPrepareKnowledgeBaseForQueryComm0000644000175000017500000000534612520756344032374 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CPREPAREKNOWLEDGEBASEFORQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CPREPAREKNOWLEDGEBASEFORQUERYCOMMAND_H // Libraries includes #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CPrepareKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Reasoner/Ontology/COntologyProcessingStepVector.h" #include "Reasoner/Ontology/COntologyProcessingRequirementExpander.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Ontology; namespace Control { namespace Command { namespace Instructions { /*! * * \class CPrepareKnowledgeBaseForQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPrepareKnowledgeBaseForQueryCommand : public CPrepareKnowledgeBaseCommand { // public methods public: //! Constructor CPrepareKnowledgeBaseForQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CPrepareKnowledgeBaseForQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CPREPAREKNOWLEDGEBASEFORQUERYCOMMAND_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseRevisionCommandProvider.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseRevisionCommandProv0000644000175000017500000000442012520756342032417 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CKNOWLEDGEBASEREVISIONPROVIDERCOMMAND_H #define KONCLUDE_Control_COMMAND_CKNOWLEDGEBASEREVISIONPROVIDERCOMMAND_H // Libraries includes #include // Namespace includes // Other includes #include "Reasoner/Revision/COntologyRevision.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Revision; namespace Control { namespace Command { namespace Instructions { /*! * * \class CKnowledgeBaseRevisionCommandProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CKnowledgeBaseRevisionCommandProvider { // public methods public: //! Constructor CKnowledgeBaseRevisionCommandProvider(); //! Destructor virtual ~CKnowledgeBaseRevisionCommandProvider(); virtual COntologyRevision *getOntologyRevision() = 0; virtual CCommand *getCommand() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CKNOWLEDGEBASEREVISIONPROVIDERCOMMAND_H ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseNamedIndividualEntitiesCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseNamedIndividualE0000644000175000017500000000445212520756340032260 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CGETKNOWLEDGEBASENAMEDINDIVIDUALENTITIESCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CGETKNOWLEDGEBASENAMEDINDIVIDUALENTITIESCOMMAND_H // Libraries includes // Namespace includes #include "CGetKnowledgeBaseEntitiesCommand.h" // Other includes #include "Control/Command/CommandSettings.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetKnowledgeBaseNamedIndividualEntitiesCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetKnowledgeBaseNamedIndividualEntitiesCommand : public CGetKnowledgeBaseEntitiesCommand { // public methods public: //! Constructor CGetKnowledgeBaseNamedIndividualEntitiesCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetKnowledgeBaseNamedIndividualEntitiesCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CGETKNOWLEDGEBASENAMEDINDIVIDUALENTITIESCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CTellKnowledgeBaseCommand.h0000644000175000017500000000443212520756346031107 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CTELLKNOWLEDGEBASECOMMAND_H #define KONCLUDE_Control_COMMAND_CTELLKNOWLEDGEBASECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CTellKnowledgeBaseCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTellKnowledgeBaseCommand : public CKnowledgeBaseCommand { // public methods public: //! Constructor CTellKnowledgeBaseCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CTellKnowledgeBaseCommand(); virtual QString getBriefCommandDescription(); virtual QString getKnowledgeBaseName(); // protected methods protected: // protected variables protected: QString kbString; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CTELLKNOWLEDGEBASECOMMAND_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSkipUnsupportedCommandCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSkipUnsupportedCommandCommand.cp0000644000175000017500000000327612520756346032412 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSkipUnsupportedCommandCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CSkipUnsupportedCommandCommand::CSkipUnsupportedCommandCommand(QString &skippedCommand, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { sComm = skippedCommand; } CSkipUnsupportedCommandCommand::~CSkipUnsupportedCommandCommand() { } qint64 CSkipUnsupportedCommandCommand::getCommandTag() { return SKIPUNSUPPORTEDCOMMANDCOMMAND; } QString CSkipUnsupportedCommandCommand::getBriefCommandDescription() { return QString("Skip-Unsupported-Command Command"); } QString CSkipUnsupportedCommandCommand::getSkippedCommandString() { return sComm; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsSatisfiableQueryCommand.h0000644000175000017500000000447412520756342031326 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CISSATISFIABLEQUERYCOMMAND_H #define KONCLUDE_Control_COMMAND_CISSATISFIABLEQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Reasoner/Query/CIsClassSatisfiableQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CIsSatisfiableQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIsSatisfiableQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CIsSatisfiableQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CIsSatisfiableQueryCommand(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CISSATISFIABLEQUERYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CReadTextCommand.h0000644000175000017500000000466312520756344027300 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CREADTEXTCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CREADTEXTCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CReadTextCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CReadTextCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReadTextCommand : public CPreconditionCommand, public CReadTextCommandProvider { // public methods public: //! Constructor CReadTextCommand(const QString& iriString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CReadTextCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QString getIRIString(); virtual QString getReadText(); virtual CCommand *getCommand(); virtual CReadTextCommand* setReadText(const QString& text); // protected methods protected: // protected variables protected: QString mIRIString; QString mText; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CREADTEXTCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseCommandsCommand.h0000644000175000017500000000473312520756344030312 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CPARSECOMMANDSCOMMAND_H #define KONCLUDE_Control_COMMAND_CPARSECOMMANDSCOMMAND_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Other includes #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CParseCommandsCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CParseCommandsCommand : public CPreconditionCommand { // public methods public: //! Constructor CParseCommandsCommand(QByteArray *array, const QString &arraySourcePath = QString(), CCommand *parentSuperCommand = 0); //! Destructor virtual ~CParseCommandsCommand(); virtual CParseCommandsCommand *setByteArray(QByteArray *array); virtual QByteArray *getByteArray(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QString getSourcePath(); virtual bool hasSourcePath(); // protected methods protected: // protected variables protected: QByteArray *byteArray; QString sourcePath; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CPARSECOMMANDSCOMMAND_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseStartDownloadCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseStartDownloadCo0000644000175000017500000000523412520756344032330 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASESTARTDOWNLOADCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASESTARTDOWNLOADCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CLoadKnowledgeBaseFinishDownloadCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CLoadKnowledgeBaseStartDownloadCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLoadKnowledgeBaseStartDownloadCommand : public CPreconditionCommand { // public methods public: //! Constructor CLoadKnowledgeBaseStartDownloadCommand(const QString& downloadIRIString, CLoadKnowledgeBaseFinishDownloadCommand* finishCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CLoadKnowledgeBaseStartDownloadCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); QString getDownloadIRIString(); CLoadKnowledgeBaseFinishDownloadCommand* getFinishCommand(); // protected methods protected: // protected variables protected: QString mDownloadIRI; CLoadKnowledgeBaseFinishDownloadCommand* mFinishCommand; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASESTARTDOWNLOADCOMMAND_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseClassEntitiesCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseClassEntitiesCom0000644000175000017500000000362712520756340032332 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetKnowledgeBaseClassEntitiesCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetKnowledgeBaseClassEntitiesCommand::CGetKnowledgeBaseClassEntitiesCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CGetKnowledgeBaseEntitiesCommand(knowledgeBaseNameString,parentSuperCommand) { mExtractSpec.setEntityExtractionFlags(CKnowledgeBaseEntitiesExtractionSpecification::EXTRACTCLASSENTITIES); mExtractedEntityContainer = new CExtractedKnowledgeBaseEntitiesContainer(); } CGetKnowledgeBaseClassEntitiesCommand::~CGetKnowledgeBaseClassEntitiesCommand() { delete mExtractedEntityContainer; } qint64 CGetKnowledgeBaseClassEntitiesCommand::getCommandTag() { return EXTRACTKNOWLEDGEBASECLASSENTITIESCOMMAND; } QString CGetKnowledgeBaseClassEntitiesCommand::getBriefCommandDescription() { return QString("Get-Knowledge-Base-Class-Entities Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CStreamParseOWL2FunctionalOntologyCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CStreamParseOWL2FunctionalOntolog0000644000175000017500000000441412520756346032306 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CStreamParseOWL2FunctionalOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CStreamParseOWL2FunctionalOntologyCommand::CStreamParseOWL2FunctionalOntologyCommand(const QString& sourceStringName, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CParseOntologyCommand(parentSuperCommand) { mSourceString = sourceStringName; revProvider = ontologyRevisionProviderCommand; //addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CStreamParseOWL2FunctionalOntologyCommand::~CStreamParseOWL2FunctionalOntologyCommand() { } qint64 CStreamParseOWL2FunctionalOntologyCommand::getCommandTag() { return STREAMPARSEOWL2FUNCTIONALONTOLOGYCOMMAND; } QString CStreamParseOWL2FunctionalOntologyCommand::getBriefCommandDescription() { return QString("Stream-Parse-OWL2-Functional-Ontology Command"); } const QString& CStreamParseOWL2FunctionalOntologyCommand::getSourceString() { return mSourceString; } COntologyRevision* CStreamParseOWL2FunctionalOntologyCommand::getOntologyRevision() { return revProvider->getOntologyRevision(); } CCommand *CStreamParseOWL2FunctionalOntologyCommand::getCommand() { return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CRendererCommandProvider.h0000644000175000017500000000404712520756346031037 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CRENDERERCOMMANDPROVIDER_H #define KONCLUDE_CONTROL_COMMAND_CRENDERERCOMMANDPROVIDER_H // Libraries includes #include // Namespace includes // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Renderer/COntologyRenderer.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Renderer; namespace Control { namespace Command { namespace Instructions { /*! * * \class CRendererCommandProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRendererCommandProvider { // public methods public: //! Constructor CRendererCommandProvider(); virtual COntologyRenderer* getRenderer() = 0; virtual CCommand *getCommand() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CRENDERERCOMMANDPROVIDER_H ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteFunctionalSubClassHierarchyQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteFunctionalSubClassHierarchy0000644000175000017500000000367312520756346032451 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteFunctionalSubClassHierarchyQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CWriteFunctionalSubClassHierarchyQueryCommand::CWriteFunctionalSubClassHierarchyQueryCommand(const QString& knowledgeBaseNameString, const QString& outputFileString, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { mOutputFileString = outputFileString; } CWriteFunctionalSubClassHierarchyQueryCommand::~CWriteFunctionalSubClassHierarchyQueryCommand() { } qint64 CWriteFunctionalSubClassHierarchyQueryCommand::getCommandTag() { return WRITEFUNCTIONALSUBCLASSHIERARCHYQUERYCOMMAND; } QString CWriteFunctionalSubClassHierarchyQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-WriteFunctionalSubClassHierachry Command"); } QString CWriteFunctionalSubClassHierarchyQueryCommand::getOutputFileString() { return mOutputFileString; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CChooseParseInstallKnowledgeBaseO0000644000175000017500000000617612520756334032347 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CCHOOSEPARSEINSTALLKNOWLEDGEBASEOWLXMLONTOLOGYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CCHOOSEPARSEINSTALLKNOWLEDGEBASEOWLXMLONTOLOGYCOMMAND_H // Libraries includes #include #include #include // Namespace includes #include "CLoadKnowledgeBaseCommand.h" #include "CKnowledgeBaseRevisionCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand : public CLoadKnowledgeBaseCommand, public CKnowledgeBaseRevisionCommandProvider { // public methods public: //! Constructor CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand(const QString &knowledgeBaseNameString, const QStringList& loadIRIs, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual COntologyRevision* getOntologyRevision(); virtual QStringList getLoadIRIStrings(); virtual bool getLoadImports(); virtual QMap getOntologieIRIMappings(); virtual CCommand* getCommand(); // protected methods protected: // protected variables protected: QStringList mLoadIRIs; bool mLoadImports; QMap mOntoIRIMapping; CKnowledgeBaseRevisionCommandProvider* mOntologyRevisionProviderCommand; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CCHOOSEPARSEINSTALLKNOWLEDGEBASEOWLXMLONTOLOGYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseQueryCommand.cpp0000644000175000017500000000475612520756342031654 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CKnowledgeBaseQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CKnowledgeBaseQueryCommand::CKnowledgeBaseQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseCommand(parentSuperCommand) { kbString = knowledgeBaseNameString; buildCommand = 0; calcQueryCommand = 0; mComplex = false; } CKnowledgeBaseQueryCommand::~CKnowledgeBaseQueryCommand() { } QString CKnowledgeBaseQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-Query Command").arg(kbString); } QString CKnowledgeBaseQueryCommand::getKnowledgeBaseName() { return kbString; } CCalculateQueryCommand *CKnowledgeBaseQueryCommand::getCalculateQueryCommand() { return calcQueryCommand; } CKnowledgeBaseQueryCommand *CKnowledgeBaseQueryCommand::setCalculateQueryCommand(CCalculateQueryCommand *calculateQueryCommand) { calcQueryCommand = calculateQueryCommand; return this; } CBuildQueryCommand *CKnowledgeBaseQueryCommand::getBuildQueryCommand() { return buildCommand; } CKnowledgeBaseQueryCommand *CKnowledgeBaseQueryCommand::setBuildQueryCommand(CBuildQueryCommand *buildQueryCommand) { buildCommand = buildQueryCommand; return this; } bool CKnowledgeBaseQueryCommand::isComplexQuery() { return mComplex; } CKnowledgeBaseQueryCommand* CKnowledgeBaseQueryCommand::setQueryComplexity(bool complex) { mComplex = complex; return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetReasonerCommand.cpp0000644000175000017500000000331612520756340030317 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetReasonerCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetReasonerCommand::CGetReasonerCommand(CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { reasoner = 0; } CGetReasonerCommand::~CGetReasonerCommand() { } qint64 CGetReasonerCommand::getCommandTag() { return GETREASONERCOMMAND; } QString CGetReasonerCommand::getBriefCommandDescription() { return QString("Get-Reasoner Command"); } CReasonerManager *CGetReasonerCommand::getReasonerManager() { return reasoner; } CGetReasonerCommand *CGetReasonerCommand::setReasonerManager(CReasonerManager *reasonerManager) { reasoner = reasonerManager; return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteXMLIndividualTypesQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteXMLIndividualTypes0000644000175000017500000000561112520756336032444 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConstructWriteXMLIndividualTypesQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CConstructWriteXMLIndividualTypesQueryCommand::CConstructWriteXMLIndividualTypesQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, const QString& outputFileString, const QString& individualName, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { mOutputFileName = outputFileString; mIndividualName = individualName; revProvider = ontologyRevisionProviderCommand; query = 0; addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CConstructWriteXMLIndividualTypesQueryCommand::~CConstructWriteXMLIndividualTypesQueryCommand() { delete query; } qint64 CConstructWriteXMLIndividualTypesQueryCommand::getCommandTag() { return CONSTRUCTWRITEXMLINDIVIDUALTYPESQUERYCOMMAND; } QString CConstructWriteXMLIndividualTypesQueryCommand::getBriefCommandDescription() { return QString("Construct-WriteXMLIndividualTypes-Query Command"); } CQuery *CConstructWriteXMLIndividualTypesQueryCommand::getQuery() { return query; } CCommand *CConstructWriteXMLIndividualTypesQueryCommand::getCommand() { return this; } CConstructWriteXMLIndividualTypesQueryCommand *CConstructWriteXMLIndividualTypesQueryCommand::setQuery(CQuery *knowledgeBaseQuery) { query = knowledgeBaseQuery; return this; } COntologyRevision *CConstructWriteXMLIndividualTypesQueryCommand::getOntologyRevision() { COntologyRevision *rev = 0; if (revProvider) { rev = revProvider->getOntologyRevision(); } return rev; } QString CConstructWriteXMLIndividualTypesQueryCommand::getOutputFileName() { return mOutputFileName; } QString CConstructWriteXMLIndividualTypesQueryCommand::getIndividualName() { return mIndividualName; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetDescriptionCommand.h0000644000175000017500000000456712520756336030507 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CGETDESCRIPTIONCOMMAND_H #define KONCLUDE_Control_COMMAND_CGETDESCRIPTIONCOMMAND_H // Libraries includes #include // Namespace includes // Other includes #include "Config/CConfigurationBase.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Config; namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetDescriptionCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetDescriptionCommand : public CPreconditionCommand { // public methods public: //! Constructor CGetDescriptionCommand(CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetDescriptionCommand(); virtual qint64 getCommandTag(); virtual CGetDescriptionCommand *setConfiguration(CConfigurationBase *config); virtual CConfigurationBase *getConfiguration(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: CConfigurationBase *configuaration; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CGETDESCRIPTIONCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CProcessQueryCommand.cpp0000644000175000017500000000267312520756344030556 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CProcessQueryCommand::CProcessQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { } CProcessQueryCommand::~CProcessQueryCommand() { } QString CProcessQueryCommand::getBriefCommandDescription() { return QString("Process-Knowledge-Base-Query Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSetKnowledgeBaseConfigCommand.h0000644000175000017500000000473612520756346032077 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CSetKnowlegeBaseConfigCommand_H #define KONCLUDE_Control_COMMAND_CSetKnowlegeBaseConfigCommand_H // Libraries includes #include // Namespace includes #include "CSetConfigCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CSetKnowledgeBaseConfigCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSetKnowledgeBaseConfigCommand : public CSetConfigCommand { // public methods public: //! Constructor CSetKnowledgeBaseConfigCommand(const QString &propertyName, const QString &propertyValue, const QString &knowlegdeBaseName = QString(), CCommand *parentSuperCommand = 0); //! Destructor virtual ~CSetKnowledgeBaseConfigCommand(); virtual qint64 getCommandTag(); virtual CSetKnowledgeBaseConfigCommand *setKnowlegeBaseName(const QString &knowlegdeBaseName); virtual QString getKnowlegeBaseString(); // protected methods protected: // protected variables protected: QString kbName; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CSetKnowlegeBaseConfigCommand_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetConfigCommand.cpp0000644000175000017500000000370112520756336027751 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetConfigCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetConfigCommand::CGetConfigCommand(const QString &propertyName, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { propName = propertyName; data = 0; } CGetConfigCommand::~CGetConfigCommand() { } CGetConfigCommand *CGetConfigCommand::setConfigName(const QString &propertyName) { propName = propertyName; return this; } QString CGetConfigCommand::getConfigNameString() { return propName; } qint64 CGetConfigCommand::getCommandTag() { return GETCONFIGURATIONCOMMAND; } QString CGetConfigCommand::getBriefCommandDescription() { return QString("Get-'%1'-Config Command").arg(propName); } CGetConfigCommand *CGetConfigCommand::setConfigData(CConfigData *configData) { data = configData; return this; } CConfigData *CGetConfigCommand::getConfigData() { return data; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseOWL2XMLQueryCommand.h0000644000175000017500000000605212520756344030677 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CPARSEOWL2XMLQUERYCOMMAND_H #define KONCLUDE_Control_COMMAND_CPARSEOWL2XMLQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CParseOntologyCommand.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CQueryGeneratorCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CParseOWL2XMLQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CParseOWL2XMLQueryCommand : public CParseOntologyCommand, public CQueryGeneratorCommandProvider { // public methods public: //! Constructor CParseOWL2XMLQueryCommand(const QDomElement &queryNode, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CParseOWL2XMLQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QDomElement getQueryNode(); virtual CCommand *getCommand(); virtual CQueryBuilderGenerator* getQueryGenerator(); virtual CParseOWL2XMLQueryCommand* setQueryGenerator(CQueryBuilderGenerator* queryGenerator); virtual COntologyRevision *getOntologyRevision(); virtual bool isComplexQuery(); virtual CParseOWL2XMLQueryCommand* setQueryComplexity(bool complex); // protected methods protected: // protected variables protected: QDomElement node; CKnowledgeBaseRevisionCommandProvider *revProvider; CQueryBuilderGenerator* mQueryGenerator; bool mComplex; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CPARSEOWL2XMLQUERYCOMMAND_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractToldExpressionsOntologyCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractToldExpressionsOntologyCo0000644000175000017500000000454312520756336032546 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExtractToldExpressionsOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CExtractToldExpressionsOntologyCommand::CExtractToldExpressionsOntologyCommand(COntologyRenderer* renderer, CKnowledgeBaseRevisionCommandProvider* kbRevProvider, const QStringList& entityList, CCommand *parentSuperCommand) : CExtractOntologyCommand(parentSuperCommand) { mRenderer = renderer; mKbRevProvider = kbRevProvider; mEntityList = entityList; addCommandPrecondition(new CCommandProcessedPrecondition(mKbRevProvider->getCommand())); } CExtractToldExpressionsOntologyCommand::~CExtractToldExpressionsOntologyCommand() { } QString CExtractToldExpressionsOntologyCommand::getBriefCommandDescription() { return QString("Extract-Told-Expressions-Ontology Command"); } COntologyRenderer* CExtractToldExpressionsOntologyCommand::getRenderer() { return mRenderer; } CCommand* CExtractToldExpressionsOntologyCommand::getCommand() { return this; } qint64 CExtractToldExpressionsOntologyCommand::getCommandTag() { return EXTRACTTOLDEXPRESSIONONTOLOGYCOMMAND; } COntologyRevision* CExtractToldExpressionsOntologyCommand::getOntologyRevision() { return mKbRevProvider->getOntologyRevision(); } QStringList CExtractToldExpressionsOntologyCommand::getExtractionEntityList() { return mEntityList; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteFunctionalSubClassHirarchyQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteFunctionalSubClass0000644000175000017500000000601112520756336032503 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CCONSTRUCTWRITEFUNCTIONALSUBCLASSHIRARCHYQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CCONSTRUCTWRITEFUNCTIONALSUBCLASSHIRARCHYQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CQueryCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CConstructWriteFunctionalSubClassHirarchyQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConstructWriteFunctionalSubClassHirarchyQueryCommand : public CPreconditionCommand, public CQueryCommandProvider { // public methods public: //! Constructor CConstructWriteFunctionalSubClassHirarchyQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, const QString& outputFileString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CConstructWriteFunctionalSubClassHirarchyQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual CQuery *getQuery(); virtual CConstructWriteFunctionalSubClassHirarchyQueryCommand *setQuery(CQuery *knowledgeBaseQuery); virtual COntologyRevision *getOntologyRevision(); QString getOutputFileName(); // protected methods protected: // protected variables protected: QString mOutputFileName; CKnowledgeBaseRevisionCommandProvider *revProvider; CQuery *query; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CCONSTRUCTWRITEFUNCTIONALSUBCLASSHIRARCHYQUERYCOMMAND_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseAllDownloadedContinuer.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseAllDownloadedCo0000644000175000017500000000456212520756342032255 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEALLDOWNLOADEDCONTINUER_H #define KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEALLDOWNLOADEDCONTINUER_H // Libraries includes #include // Namespace includes // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CCommandDelegater.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CLoadKnowledgeBaseAllDownloadedContinuer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLoadKnowledgeBaseAllDownloadedContinuer { // public methods public: //! Constructor CLoadKnowledgeBaseAllDownloadedContinuer(CCommandDelegater* commDelegater); CLoadKnowledgeBaseAllDownloadedContinuer* setDelegateCommand(CCommand* delegateCommand); CLoadKnowledgeBaseAllDownloadedContinuer* setDownloadRequiredCount(cint64 count); bool nextDownloadCompleted(); // protected methods protected: // protected variables protected: CCommand* mDelegateCommand; CCommandDelegater* mCommDelegater; cint64 mCount; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEALLDOWNLOADEDCONTINUER_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteXMLIndividualTypesQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteXMLIndividualTypesQueryComm0000644000175000017500000000516112520756350032375 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CWRITEXMLINDIVIDUALTYPESQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CWRITEXMLINDIVIDUALTYPESQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Reasoner/Query/CSubClassHierarchyQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CWriteXMLIndividualTypesQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteXMLIndividualTypesQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CWriteXMLIndividualTypesQueryCommand(const QString& knowledgeBaseNameString, const QString& outputFileString, const QString& individualName, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CWriteXMLIndividualTypesQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); QString getOutputFileString(); QString getIndividualName(); // protected methods protected: // protected variables protected: QString mOutputFileString; QString mIndividualName; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CWRITEXMLINDIVIDUALTYPESQUERYCOMMAND_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseTestsuiteCommandsCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseTestsuiteCommandsCommand.cp0000644000175000017500000000316612520756344032376 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CParseTestsuiteCommandsCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CParseTestsuiteCommandsCommand::CParseTestsuiteCommandsCommand(QByteArray *array, const QString &arraySourcePath, CCommand *parentSuperCommand) : CParseCommandsCommand(array,arraySourcePath,parentSuperCommand) { } CParseTestsuiteCommandsCommand::~CParseTestsuiteCommandsCommand() { } qint64 CParseTestsuiteCommandsCommand::getCommandTag() { return PARSETESTSUITECOMMANDSCOMMAND; } QString CParseTestsuiteCommandsCommand::getBriefCommandDescription() { return QString("Parse-Testsuite-Commands Command").arg(testsName); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CImportKnowledgeBaseOWLAutoOntologyCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CImportKnowledgeBaseOWLAutoOntolo0000644000175000017500000000617612520756340032343 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CImportKnowledgeBaseOWLAutoOntologyCommand_H #define KONCLUDE_CONTROL_COMMAND_CImportKnowledgeBaseOWLAutoOntologyCommand_H // Libraries includes #include #include #include // Namespace includes #include "CLoadKnowledgeBaseCommand.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CLoadKnowledgeBaseData.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CImportKnowledgeBaseOWLAutoOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CImportKnowledgeBaseOWLAutoOntologyCommand : public CLoadKnowledgeBaseCommand, public CKnowledgeBaseRevisionCommandProvider { // public methods public: //! Constructor CImportKnowledgeBaseOWLAutoOntologyCommand(const QString &knowledgeBaseNameString, const QStringList& loadIRIs, const QMap& ontoIRIMap, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CImportKnowledgeBaseOWLAutoOntologyCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual COntologyRevision* getOntologyRevision(); virtual bool getLoadImports(); virtual QStringList getLoadIRIStrings(); virtual QMap getOntologieIRIMappings(); virtual CCommand* getCommand(); // protected methods protected: // protected variables protected: QStringList mLoadIRIs; QMap mOntoIRIMapping; bool mLoadImports; CKnowledgeBaseRevisionCommandProvider* mOntologyRevisionProviderCommand; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CImportKnowledgeBaseOWLAutoOntologyCommand_H ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructIsTriviallyConsistentQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructIsTriviallyConsistentQu0000644000175000017500000000476612520756334032576 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConstructIsTriviallyConsistentQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CConstructIsTriviallyConsistentQueryCommand::CConstructIsTriviallyConsistentQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { revProvider = ontologyRevisionProviderCommand; query = 0; addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CConstructIsTriviallyConsistentQueryCommand::~CConstructIsTriviallyConsistentQueryCommand() { delete query; } qint64 CConstructIsTriviallyConsistentQueryCommand::getCommandTag() { return CONSTRUCTISTRIVIALLYCONSISTENTQUERYCOMMAND; } QString CConstructIsTriviallyConsistentQueryCommand::getBriefCommandDescription() { return QString("Construct-IsTriviallyConsistent-Query Command"); } CQuery *CConstructIsTriviallyConsistentQueryCommand::getQuery() { return query; } CCommand *CConstructIsTriviallyConsistentQueryCommand::getCommand() { return this; } CConstructIsTriviallyConsistentQueryCommand *CConstructIsTriviallyConsistentQueryCommand::setQuery(CQuery *knowledgeBaseQuery) { query = knowledgeBaseQuery; return this; } COntologyRevision *CConstructIsTriviallyConsistentQueryCommand::getOntologyRevision() { COntologyRevision *rev = 0; if (revProvider) { rev = revProvider->getOntologyRevision(); } return rev; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsClassSubsumedByQueryCommand.h0000644000175000017500000000452712520756340032145 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CISCLASSSUBSUMEDBYQUERYCOMMAND_H #define KONCLUDE_Control_COMMAND_CISCLASSSUBSUMEDBYQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Reasoner/Query/CIsClassSubsumedByQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CIsClassSubsumedByQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIsClassSubsumedByQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CIsClassSubsumedByQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CIsClassSubsumedByQueryCommand(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CIsClassSubsumedByQueryCommand_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CQueryCommandProvider.h0000644000175000017500000000417112520756344030372 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CQUERYCOMMANDPROVIDER_H #define KONCLUDE_Control_COMMAND_CQUERYCOMMANDPROVIDER_H // Libraries includes #include // Namespace includes // Other includes #include "Reasoner/Query/CQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CQueryCommandProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQueryCommandProvider { // public methods public: //! Constructor CQueryCommandProvider(); //! Destructor virtual ~CQueryCommandProvider(); virtual CQuery *getQuery() = 0; virtual CCommand *getCommand() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CQUERYCOMMANDPROVIDER_H ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLFunctionalOntologyCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLFunctionalOn0000644000175000017500000000425612520756342032243 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLoadKnowledgeBaseOWLFunctionalOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CLoadKnowledgeBaseOWLFunctionalOntologyCommand::CLoadKnowledgeBaseOWLFunctionalOntologyCommand(const QString &knowledgeBaseNameString, const QStringList& loadIRIs, CCommand *parentSuperCommand) : CLoadKnowledgeBaseCommand(knowledgeBaseNameString,parentSuperCommand) { mLoadIRIs = loadIRIs; } CLoadKnowledgeBaseOWLFunctionalOntologyCommand::~CLoadKnowledgeBaseOWLFunctionalOntologyCommand() { } qint64 CLoadKnowledgeBaseOWLFunctionalOntologyCommand::getCommandTag() { return LOADKNOWLEDGEBASEOWLFUNCTIONALONTOLOGYCOMMAND; } QString CLoadKnowledgeBaseOWLFunctionalOntologyCommand::getBriefCommandDescription() { return QString("Load-'%1'-Knowledge-Base-OWL-Functional-Ontology Command").arg(kbString); } QStringList CLoadKnowledgeBaseOWLFunctionalOntologyCommand::getLoadIRIStrings() { return mLoadIRIs; } bool CLoadKnowledgeBaseOWLFunctionalOntologyCommand::getLoadImports() { return mLoadImports; } QMap CLoadKnowledgeBaseOWLFunctionalOntologyCommand::getOntologieIRIMappings() { return mOntoIRIMapping; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetFlattenedTypesQueryCommand.h0000644000175000017500000000452712520756336032201 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CGETFLATTENEDTYPESQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CGETFLATTENEDTYPESQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Reasoner/Query/CSubClassHierarchyQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetFlattenedTypesQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetFlattenedTypesQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CGetFlattenedTypesQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetFlattenedTypesQueryCommand(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CGETFLATTENEDTYPESQUERYCOMMAND_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetClassificationManagerCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetClassificationManagerCommand.0000644000175000017500000000506712520756336032276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CGETCLASSIFICATIONMANAGERCOMMAND_H #define KONCLUDE_Control_COMMAND_CGETCLASSIFICATIONMANAGERCOMMAND_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Reasoner/Classifier/CClassificationManager.h" // Other includes #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Classifier; namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetClassificationManagerCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetClassificationManagerCommand : public CPreconditionCommand { // public methods public: //! Constructor CGetClassificationManagerCommand(CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetClassificationManagerCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CClassificationManager *getClassificationManager(); virtual CGetClassificationManagerCommand *setClassificationManager(CClassificationManager *classificationManager); // protected methods protected: // protected variables protected: CClassificationManager *classMan; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CGETCLASSIFICATIONMANAGERCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CQueryCommandProvider.cpp0000644000175000017500000000224712520756344030727 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryCommandProvider.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CQueryCommandProvider::CQueryCommandProvider() { } CQueryCommandProvider::~CQueryCommandProvider() { } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseData.h0000644000175000017500000000413712520756342030357 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEDATA_H #define KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEDATA_H // Libraries includes #include #include // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CLoadKnowledgeBaseData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLoadKnowledgeBaseData { // public methods public: //! Constructor CLoadKnowledgeBaseData(QIODevice* loadDevice, const QString& originalDataName, const QString& resolvedDataName); QIODevice* getLoadDevice(); QString getOriginalDataName(); QString getResolvedDataName(); // protected methods protected: // protected variables protected: QIODevice* mLoadDevice; QString mOriginalDataName; QString mResolvedDataName; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEDATA_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesDisjointQueryOWL2XMLNodeCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesDisjointQueryOWL2XMLNo0000644000175000017500000000361512520756334032127 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAreClassesDisjointQueryOWL2XMLNodeCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CAreClassesDisjointQueryOWL2XMLNodeCommand::CAreClassesDisjointQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand) : CAreClassesDisjointQueryCommand(knowledgeBaseNameString,parentSuperCommand) { node = queryNode; calcQueryCommand = 0; } CAreClassesDisjointQueryOWL2XMLNodeCommand::~CAreClassesDisjointQueryOWL2XMLNodeCommand() { } QString CAreClassesDisjointQueryOWL2XMLNodeCommand::getBriefCommandDescription() { return QString("Knowledge-Base-ClassesDisjointQuery Command"); } QDomElement CAreClassesDisjointQueryOWL2XMLNodeCommand::getQueryNode() { return node; } qint64 CAreClassesDisjointQueryOWL2XMLNodeCommand::getCommandTag() { return DISJOINTQUERYKNOWLEDGEBASEOWL2XMLCOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CRealizeQueryCommand.h0000644000175000017500000000446712520756346030205 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CREALIZEQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CREALIZEQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Reasoner/Query/CSubClassHierarchyQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CRealizeQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRealizeQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CRealizeQueryCommand(const QString& knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CRealizeQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CREALIZEQUERYCOMMAND_H././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructSubClassHirarchyQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructSubClassHirarchyQueryCo0000644000175000017500000000561712520756336032462 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCONSTRUCTSUBCLASSHIRARCHYQUERYCOMMAND_H #define KONCLUDE_Control_COMMAND_CCONSTRUCTSUBCLASSHIRARCHYQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CQueryCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CConstructSubClassHirarchyQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConstructSubClassHirarchyQueryCommand : public CPreconditionCommand, public CQueryCommandProvider { // public methods public: //! Constructor CConstructSubClassHirarchyQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, const QDomElement &queryNode, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CConstructSubClassHirarchyQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual CQuery *getQuery(); virtual CConstructSubClassHirarchyQueryCommand *setQuery(CQuery *knowledgeBaseQuery); virtual COntologyRevision *getOntologyRevision(); virtual QDomElement *getQueryNode(); // protected methods protected: // protected variables protected: CKnowledgeBaseRevisionCommandProvider *revProvider; CQuery *query; QDomElement node; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCONSTRUCTSUBCLASSHIRARCHYQUERYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CQueryGeneratorCommandProvider.h0000644000175000017500000000445612520756344032247 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CQUERYGENERATORCOMMANDPROVIDER_H #define KONCLUDE_CONTROL_COMMAND_CQUERYGENERATORCOMMANDPROVIDER_H // Libraries includes #include // Namespace includes // Other includes #include "Reasoner/Query/CQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Reasoner/Generator/CQueryBuilderGenerator.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; using namespace Reasoner::Generator; namespace Control { namespace Command { namespace Instructions { /*! * * \class CQueryGeneratorCommandProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQueryGeneratorCommandProvider { // public methods public: //! Constructor CQueryGeneratorCommandProvider(); //! Destructor virtual ~CQueryGeneratorCommandProvider(); virtual CQueryBuilderGenerator* getQueryGenerator() = 0; virtual CCommand* getCommand() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CQUERYGENERATORCOMMANDPROVIDER_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CInitializeConfigurationCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CInitializeConfigurationCommand.c0000644000175000017500000000334112520756340032370 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CInitializeConfigurationCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CInitializeConfigurationCommand::CInitializeConfigurationCommand(CConfiguration *initialConfiguration, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { initConfig = initialConfiguration; } CInitializeConfigurationCommand::~CInitializeConfigurationCommand() { } CConfiguration *CInitializeConfigurationCommand::getInitialConfiguration() { return initConfig; } qint64 CInitializeConfigurationCommand::getCommandTag() { return INITIALIZECONFIGURATIONCOMMAND; } QString CInitializeConfigurationCommand::getBriefCommandDescription() { return QString("Initialize-Configuration Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructIsTriviallyConsistentQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructIsTriviallyConsistentQu0000644000175000017500000000552512520756334032570 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CCONSTRUCTISTRIVIALLYCONSISTENTQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CCONSTRUCTISTRIVIALLYCONSISTENTQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CQueryCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CConstructIsTriviallyConsistentQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConstructIsTriviallyConsistentQueryCommand : public CPreconditionCommand, public CQueryCommandProvider { // public methods public: //! Constructor CConstructIsTriviallyConsistentQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CConstructIsTriviallyConsistentQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual CQuery *getQuery(); virtual CConstructIsTriviallyConsistentQueryCommand *setQuery(CQuery *knowledgeBaseQuery); virtual COntologyRevision *getOntologyRevision(); // protected methods protected: // protected variables protected: CKnowledgeBaseRevisionCommandProvider *revProvider; CQuery *query; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CCONSTRUCTISTRIVIALLYCONSISTENTQUERYCOMMAND_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetSubClassHierarchyQueryOWL2XMLNodeCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetSubClassHierarchyQueryOWL2XML0000644000175000017500000000360512520756340032113 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetSubClassHierarchyQueryOWL2XMLNodeCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetSubClassHierarchyQueryOWL2XMLNodeCommand::CGetSubClassHierarchyQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand) : CGetSubClassHierarchyQueryCommand(knowledgeBaseNameString,parentSuperCommand) { node = queryNode; } CGetSubClassHierarchyQueryOWL2XMLNodeCommand::~CGetSubClassHierarchyQueryOWL2XMLNodeCommand() { } QString CGetSubClassHierarchyQueryOWL2XMLNodeCommand::getBriefCommandDescription() { return QString("Knowledge-Base-GetSubClassHierachry Command"); } QDomElement CGetSubClassHierarchyQueryOWL2XMLNodeCommand::getQueryNode() { return node; } qint64 CGetSubClassHierarchyQueryOWL2XMLNodeCommand::getCommandTag() { return SCHIERARCHYQUERYKNOWLEDGEBASEOWL2XMLCOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CCreateKnowledgeBaseCommand.h0000644000175000017500000000522412520756336031411 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCREATEKNOWLEDGEBASECOMMAND_H #define KONCLUDE_Control_COMMAND_CCREATEKNOWLEDGEBASECOMMAND_H // Libraries includes #include // Namespace includes #include "CKnowledgeBaseCommand.h" // Other includes #include "Reasoner/Ontology/CNamePrefix.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Ontology; namespace Control { namespace Command { namespace Instructions { /*! * * \class CCreateKnowledgeBaseCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCreateKnowledgeBaseCommand : public CKnowledgeBaseCommand { // public methods public: //! Constructor CCreateKnowledgeBaseCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CCreateKnowledgeBaseCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QString getKnowledgeBaseName(); QList* getPrefixList(); CCreateKnowledgeBaseCommand* addNamePrefix(CNamePrefix* prefix); bool hasPrefixes(); CCreateKnowledgeBaseCommand* setKnowledgeBaseName(const QString& kbNameString); // protected methods protected: // protected variables protected: QString kbString; QList mPrefixList; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCREATEKNOWLEDGEBASECOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CRendererCommandProvider.cpp0000644000175000017500000000215712520756346031372 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRendererCommandProvider.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CRendererCommandProvider::CRendererCommandProvider() { } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseOntologyCommand.cpp0000644000175000017500000000256312520756344030715 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CParseOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CParseOntologyCommand::CParseOntologyCommand(CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { } CParseOntologyCommand::~CParseOntologyCommand() { } QString CParseOntologyCommand::getBriefCommandDescription() { return QString("Unknown-Parse-Ontology Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CInitializeReasonerCommand.h0000644000175000017500000000504512520756340031347 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CINITIALIZEREASONERCOMMAND_H #define KONCLUDE_Control_COMMAND_CINITIALIZEREASONERCOMMAND_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommanderInitializationFactory.h" #include "Reasoner/Kernel/Manager/CReasonerManager.h" // Other includes #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Kernel::Manager; namespace Control { namespace Command { namespace Instructions { /*! * * \class CInitializeReasonerCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CInitializeReasonerCommand : public CPreconditionCommand { // public methods public: //! Constructor CInitializeReasonerCommand(CCommanderInitializationFactory *initializationFactory = 0, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CInitializeReasonerCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommanderInitializationFactory *getInitializationFactory(); // protected methods protected: // protected variables protected: CCommanderInitializationFactory *initFactory; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CINITIALIZEREASONERCOMMAND_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseKRSSTestConceptOntologyCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseKRSSTestConceptOntologyComm0000644000175000017500000000500712520756344032324 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CParseKRSSTestConceptOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CParseKRSSTestConceptOntologyCommand::CParseKRSSTestConceptOntologyCommand(CReadTextCommandProvider* textCommandProvider, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, const QString& testConName, CCommand *parentSuperCommand) : CParseOntologyCommand(parentSuperCommand) { mTestConName = testConName; mTextCommandProvider = textCommandProvider; revProvider = ontologyRevisionProviderCommand; addCommandPrecondition(new CCommandProcessedPrecondition(mTextCommandProvider->getCommand())); addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CParseKRSSTestConceptOntologyCommand::~CParseKRSSTestConceptOntologyCommand() { } qint64 CParseKRSSTestConceptOntologyCommand::getCommandTag() { return READPARSEKRSSTESTCONCEPTONTOLOGYCOMMAND; } QString CParseKRSSTestConceptOntologyCommand::getBriefCommandDescription() { return QString("Parse-KRSS-Test-Ontology Command"); } QString CParseKRSSTestConceptOntologyCommand::getOntologyKRSSText() { return mTextCommandProvider->getReadText(); } QString CParseKRSSTestConceptOntologyCommand::getTestConceptNameString() { return mTestConName; } COntologyRevision *CParseKRSSTestConceptOntologyCommand::getOntologyRevision() { return revProvider->getOntologyRevision(); } CCommand *CParseKRSSTestConceptOntologyCommand::getCommand() { return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteFunctionalIndividualTypesQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteFunctionalIndividualTypesQu0000644000175000017500000000525612520756346032515 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CWRITEFUNCTIONALINDIVIDUALTYPESQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CWRITEFUNCTIONALINDIVIDUALTYPESQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Reasoner/Query/CSubClassHierarchyQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CWriteFunctionalIndividualTypesQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteFunctionalIndividualTypesQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CWriteFunctionalIndividualTypesQueryCommand(const QString& knowledgeBaseNameString, const QString& outputFileString, const QString& individualName = QString(), CCommand *parentSuperCommand = 0); //! Destructor virtual ~CWriteFunctionalIndividualTypesQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); QString getOutputFileString(); QString getIndividualName(); // protected methods protected: // protected variables protected: QString mOutputFileString; QString mIndividualName; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CWRITEFUNCTIONALINDIVIDUALTYPESQUERYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CReadTextCommand.cpp0000644000175000017500000000347412520756344027632 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReadTextCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CReadTextCommand::CReadTextCommand(const QString &iriString, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { mIRIString = iriString; } CReadTextCommand::~CReadTextCommand() { } qint64 CReadTextCommand::getCommandTag() { return READTEXTCOMMAND; } QString CReadTextCommand::getBriefCommandDescription() { return QString("Read-%1-Text Command").arg(mIRIString); } QString CReadTextCommand::getIRIString() { return mIRIString; } QString CReadTextCommand::getReadText() { return mText; } CReadTextCommand* CReadTextCommand::setReadText(const QString& text) { mText = text; return this; } CCommand* CReadTextCommand::getCommand() { return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CInstallKnowledgeBaseRevisionUpdateCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CInstallKnowledgeBaseRevisionUpda0000644000175000017500000000431312520756340032411 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CInstallKnowledgeBaseRevisionUpdateCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CInstallKnowledgeBaseRevisionUpdateCommand::CInstallKnowledgeBaseRevisionUpdateCommand(const QString &knowledgeBaseNameString, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CKnowledgeBaseCommand(parentSuperCommand) { kbString = knowledgeBaseNameString; onRevProvider = ontologyRevisionProviderCommand; //addCommandPrecondition(new CCommandProcessedPrecondition(onRevProvider->getCommand())); } CInstallKnowledgeBaseRevisionUpdateCommand::~CInstallKnowledgeBaseRevisionUpdateCommand() { } qint64 CInstallKnowledgeBaseRevisionUpdateCommand::getCommandTag() { return INSTALLKNOWLEDGEBASEREVISIONCOMMAND; } QString CInstallKnowledgeBaseRevisionUpdateCommand::getKnowledgeBaseName() { return kbString; } QString CInstallKnowledgeBaseRevisionUpdateCommand::getBriefCommandDescription() { return QString("Install-'%1'-Knowledge-Base-Revision-Update Command").arg(kbString); } COntologyRevision *CInstallKnowledgeBaseRevisionUpdateCommand::getOntologyRevision() { return onRevProvider->getOntologyRevision(); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractOntologyCommand.cpp0000644000175000017500000000260112520756336031247 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExtractOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CExtractOntologyCommand::CExtractOntologyCommand(CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { } CExtractOntologyCommand::~CExtractOntologyCommand() { } QString CExtractOntologyCommand::getBriefCommandDescription() { return QString("Unknown-Extract-Ontology Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseFinishDownloadCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseFinishDownloadC0000644000175000017500000000570712520756342032277 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLoadKnowledgeBaseFinishDownloadCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CLoadKnowledgeBaseFinishDownloadCommand::CLoadKnowledgeBaseFinishDownloadCommand(const QString& downloadString, QIODevice* writeDevice, CPreconditionSynchronizer *preSynchronizer, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { mDownloadString = downloadString; mResponse = nullptr; mTmpDataPointer = new QByteArray();; mWriteDevice = writeDevice; mPreSynchronizer = preSynchronizer; } CLoadKnowledgeBaseFinishDownloadCommand::~CLoadKnowledgeBaseFinishDownloadCommand() { double mTmpDataPointer; } qint64 CLoadKnowledgeBaseFinishDownloadCommand::getCommandTag() { return LOADKNOWLEDGEBASEFINISHDOWNLOADCOMMAND; } QString CLoadKnowledgeBaseFinishDownloadCommand::getBriefCommandDescription() { return QString("Load-Knowledge-Base-Finish-Download Command"); } void CLoadKnowledgeBaseFinishDownloadCommand::doCallback() { mPreSynchronizer->delegateCommand(this); } QString CLoadKnowledgeBaseFinishDownloadCommand::getDownloadString() { return mDownloadString; } CLoadKnowledgeBaseFinishDownloadCommand* CLoadKnowledgeBaseFinishDownloadCommand::setTemporaryDataPointer(QByteArray* dataPointer) { mTmpDataPointer = dataPointer; return this; } CLoadKnowledgeBaseFinishDownloadCommand* CLoadKnowledgeBaseFinishDownloadCommand::setResponse(CHttpResponse* response) { mResponse = response; return this; } QByteArray* CLoadKnowledgeBaseFinishDownloadCommand::getTemporaryDataPointer(bool take) { QByteArray* tmpDataPoint = mTmpDataPointer; if (take) { mTmpDataPointer = nullptr; } return tmpDataPoint; } QIODevice* CLoadKnowledgeBaseFinishDownloadCommand::getWriteIODevice() { return mWriteDevice; } CHttpResponse* CLoadKnowledgeBaseFinishDownloadCommand::getResponse() { return mResponse; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CTellKnowledgeBaseOWL2XMLNodeCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CTellKnowledgeBaseOWL2XMLNodeComm0000644000175000017500000000352012520756346032026 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTellKnowledgeBaseOWL2XMLNodeCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CTellKnowledgeBaseOWL2XMLNodeCommand::CTellKnowledgeBaseOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &owl2XMLNode, CCommand *parentSuperCommand) : CTellKnowledgeBaseCommand(knowledgeBaseNameString,parentSuperCommand) { owl2Node = owl2XMLNode; } CTellKnowledgeBaseOWL2XMLNodeCommand::~CTellKnowledgeBaseOWL2XMLNodeCommand() { } qint64 CTellKnowledgeBaseOWL2XMLNodeCommand::getCommandTag() { return TELLKNOWLEDGEBASEOWL2XMLCOMMAND; } QString CTellKnowledgeBaseOWL2XMLNodeCommand::getBriefCommandDescription() { return QString("Tell-'%1'-Knowledge-Base-OWL2-XML-Axioms Command").arg(kbString); } QDomElement CTellKnowledgeBaseOWL2XMLNodeCommand::getOWL2Node() { return owl2Node; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseFinishDownloadCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseFinishDownloadC0000644000175000017500000000650412520756342032273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEFINISHDOWNLOADCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEFINISHDOWNLOADCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CLoadKnowledgeBaseAllDownloadedContinuer.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" #include "Control/Command/CPreconditionSynchronizer.h" #include "Concurrent/Callback/CCallbackData.h" #include "Network/HTTP/CHttpResponse.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Concurrent::Callback; using namespace Network::HTTP; namespace Control { namespace Command { namespace Instructions { /*! * * \class CLoadKnowledgeBaseFinishDownloadCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLoadKnowledgeBaseFinishDownloadCommand : public CPreconditionCommand, public CCallbackData { // public methods public: //! Constructor CLoadKnowledgeBaseFinishDownloadCommand(const QString& downloadString, QIODevice* writeDevice, CPreconditionSynchronizer *preSynchronizer, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CLoadKnowledgeBaseFinishDownloadCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual void doCallback(); CLoadKnowledgeBaseFinishDownloadCommand* setTemporaryDataPointer(QByteArray* dataPointer); CLoadKnowledgeBaseFinishDownloadCommand* setResponse(CHttpResponse* response); QByteArray* getTemporaryDataPointer(bool take = false); QIODevice* getWriteIODevice(); CHttpResponse* getResponse(); QString getDownloadString(); // protected methods protected: // protected variables protected: QString mDownloadString; CHttpResponse* mResponse; QByteArray* mTmpDataPointer; QIODevice* mWriteDevice; CPreconditionSynchronizer* mPreSynchronizer; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEFINISHDOWNLOADCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetConfigCommand.h0000644000175000017500000000500512520756336027415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CGETCONFIGCOMMAND_H #define KONCLUDE_Control_COMMAND_CGETCONFIGCOMMAND_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Other includes #include "Config/CConfigData.h" #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Config; namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetConfigCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetConfigCommand : public CPreconditionCommand { // public methods public: //! Constructor CGetConfigCommand(const QString &propertyName, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetConfigCommand(); virtual CGetConfigCommand *setConfigName(const QString &propertyName); virtual QString getConfigNameString(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CGetConfigCommand *setConfigData(CConfigData *configData); virtual CConfigData *getConfigData(); // protected methods protected: // protected variables protected: QString propName; CConfigData *data; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CGETCONFIGCOMMAND_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetSubClassHierarchyQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetSubClassHierarchyQueryCommand0000644000175000017500000000302012520756340032354 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetSubClassHierarchyQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetSubClassHierarchyQueryCommand::CGetSubClassHierarchyQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { } CGetSubClassHierarchyQueryCommand::~CGetSubClassHierarchyQueryCommand() { } QString CGetSubClassHierarchyQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-GetSubClassHierachry Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseEntitiesExtractionSpecification.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseEntitiesExtractionS0000644000175000017500000000475612520756342032437 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CKNOWLEDGEBASEENTITIESEXTRACTIONSPECIFICATION_H #define KONCLUDE_CONTROL_COMMAND_CKNOWLEDGEBASEENTITIESEXTRACTIONSPECIFICATION_H // Libraries includes // Namespace includes // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Utilities; namespace Control { namespace Command { namespace Instructions { /*! * * \class CKnowledgeBaseEntitiesExtractionSpecification * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CKnowledgeBaseEntitiesExtractionSpecification { // public methods public: //! Constructor CKnowledgeBaseEntitiesExtractionSpecification(cint64 flags = 0); const static cint64 EXTRACTCLASSENTITIES = 0x01; const static cint64 EXTRACTOBJECTPROPERTYENTITIES = 0x02; const static cint64 EXTRACTINDIVIDUALSENTITIES = 0x04; bool hasPartialEntityExtractionFlags(cint64 extractionFlag); cint64 getEntityExtractionFlags(); CKnowledgeBaseEntitiesExtractionSpecification* setEntityExtractionFlags(cint64 flags); CKnowledgeBaseEntitiesExtractionSpecification* clearEntityExtractionFlags(); // protected methods protected: // protected variables protected: cint64 mEntityExtractionFlags; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CKNOWLEDGEBASEENTITIESEXTRACTIONSPECIFICATION_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsInstanceOfQueryOWL2XMLNodeCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsInstanceOfQueryOWL2XMLNodeComm0000644000175000017500000000347112520756342032047 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIsInstanceOfQueryOWL2XMLNodeCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CIsInstanceOfQueryOWL2XMLNodeCommand::CIsInstanceOfQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand) : CIsInstanceOfQueryCommand(knowledgeBaseNameString,parentSuperCommand) { node = queryNode; } CIsInstanceOfQueryOWL2XMLNodeCommand::~CIsInstanceOfQueryOWL2XMLNodeCommand() { } QString CIsInstanceOfQueryOWL2XMLNodeCommand::getBriefCommandDescription() { return QString("Knowledge-Base-ClassSubsumtionQuery Command"); } QDomElement CIsInstanceOfQueryOWL2XMLNodeCommand::getQueryNode() { return node; } qint64 CIsInstanceOfQueryOWL2XMLNodeCommand::getCommandTag() { return INSTANCEQUERYKNOWLEDGEBASEOWL2XMLCOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteOWL2XMLOntologyCommand.h0000644000175000017500000000512712520756350031423 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CWRITEOWL2XMLONTOLOGYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CWRITEOWL2XMLONTOLOGYCOMMAND_H // Libraries includes #include // Namespace includes #include "CWriteOntologyCommand.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Other includes #include "Renderer/COntologyOWL2QtXMLRenderer.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Renderer; namespace Control { namespace Command { namespace Instructions { /*! * * \class CWriteOWL2XMLOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteOWL2XMLOntologyCommand : public CWriteOntologyCommand { // public methods public: //! Constructor CWriteOWL2XMLOntologyCommand(COntologyOWL2QtXMLRenderer* renderer, const QString& fileName, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CWriteOWL2XMLOntologyCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual COntologyRenderer* getRenderer(); virtual CCommand *getCommand(); COntologyOWL2QtXMLRenderer* getOWL2XMLRenderer(); QString getWriteFileName(); // protected methods protected: // protected variables protected: QString mWriteFileName; COntologyOWL2QtXMLRenderer* mRenderer; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CWRITEOWL2XMLONTOLOGYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CBuildQueryCommand.cpp0000644000175000017500000000365412520756334030176 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBuildQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CBuildQueryCommand::CBuildQueryCommand(CQueryCommandProvider *queryCommandProvider, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { queryProvider = queryCommandProvider; query = 0; } CBuildQueryCommand::~CBuildQueryCommand() { } qint64 CBuildQueryCommand::getCommandTag() { return BUILDQUERYCOMMAND; } QString CBuildQueryCommand::getBriefCommandDescription() { return QString("Build-Query Command"); } CBuildQueryCommand *CBuildQueryCommand::setQueryCommandProvider(CQueryCommandProvider *queryCommandProvider) { queryProvider = queryCommandProvider; return this; } CCommand *CBuildQueryCommand::getCommand() { return this; } CQuery *CBuildQueryCommand::getQuery() { if (queryProvider) { return queryProvider->getQuery(); } return query; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseCommandsCommand.cpp0000644000175000017500000000371012520756344030637 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CParseCommandsCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CParseCommandsCommand::CParseCommandsCommand(QByteArray *array, const QString &arraySourcePath, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { byteArray = array; sourcePath = arraySourcePath; } CParseCommandsCommand::~CParseCommandsCommand() { } CParseCommandsCommand *CParseCommandsCommand::setByteArray(QByteArray *array) { byteArray = array; return this; } QByteArray *CParseCommandsCommand::getByteArray() { return byteArray; } qint64 CParseCommandsCommand::getCommandTag() { return PARSECOMMANDSCOMMAND; } QString CParseCommandsCommand::getBriefCommandDescription() { return QString("Parse-Commands Command"); } QString CParseCommandsCommand::getSourcePath() { return sourcePath; } bool CParseCommandsCommand::hasSourcePath() { return !sourcePath.isEmpty(); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CTellKnowledgeBaseOWL2XMLNodeCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CTellKnowledgeBaseOWL2XMLNodeComm0000644000175000017500000000466512520756346032041 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CTELLKNOWLEDGEBASEOWL2XMLNODECOMMAND_H #define KONCLUDE_Control_COMMAND_CTELLKNOWLEDGEBASEOWL2XMLNODECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CTellKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CTellKnowledgeBaseOWL2XMLNodeCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTellKnowledgeBaseOWL2XMLNodeCommand : public CTellKnowledgeBaseCommand { // public methods public: //! Constructor CTellKnowledgeBaseOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &owl2XMLNode, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CTellKnowledgeBaseOWL2XMLNodeCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QDomElement getOWL2Node(); // protected methods protected: // protected variables protected: QDomElement owl2Node; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CTELLKNOWLEDGEBASEOWL2XMLNODECOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseTestsuiteXMLNodeCommand.h0000644000175000017500000000500112520756344031716 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CPARSETESTSUITEXMLNODECOMMAND_H #define KONCLUDE_Control_COMMAND_CPARSETESTSUITEXMLNODECOMMAND_H // Libraries includes #include #include // Namespace includes // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CParseTestsuiteXMLNodeCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CParseTestsuiteXMLNodeCommand : public CPreconditionCommand { // public methods public: //! Constructor CParseTestsuiteXMLNodeCommand(const QDomElement &testsuiteNode, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CParseTestsuiteXMLNodeCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QDomElement getTestsuiteNode(); virtual CParseTestsuiteXMLNodeCommand *setSourcePath(const QString &path); virtual QString getSourcePath(); // protected methods protected: // protected variables protected: QDomElement node; QString sourcePath; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CPARSETESTSUITEXMLNODECOMMAND_H ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteXMLSubClassHirarchyQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteXMLSubClassHirarch0000644000175000017500000000534012520756336032346 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConstructWriteXMLSubClassHirarchyQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CConstructWriteXMLSubClassHirarchyQueryCommand::CConstructWriteXMLSubClassHirarchyQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, const QString& outputFileString, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { mOutputFileName = outputFileString; revProvider = ontologyRevisionProviderCommand; query = 0; addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CConstructWriteXMLSubClassHirarchyQueryCommand::~CConstructWriteXMLSubClassHirarchyQueryCommand() { delete query; } qint64 CConstructWriteXMLSubClassHirarchyQueryCommand::getCommandTag() { return CONSTRUCTWRITEXMLSUBCLASSHIERARCHYQUERYCOMMAND; } QString CConstructWriteXMLSubClassHirarchyQueryCommand::getBriefCommandDescription() { return QString("Construct-WriteXMLSubClassHierarchy-Query Command"); } CQuery *CConstructWriteXMLSubClassHirarchyQueryCommand::getQuery() { return query; } CCommand *CConstructWriteXMLSubClassHirarchyQueryCommand::getCommand() { return this; } CConstructWriteXMLSubClassHirarchyQueryCommand *CConstructWriteXMLSubClassHirarchyQueryCommand::setQuery(CQuery *knowledgeBaseQuery) { query = knowledgeBaseQuery; return this; } COntologyRevision *CConstructWriteXMLSubClassHirarchyQueryCommand::getOntologyRevision() { COntologyRevision *rev = 0; if (revProvider) { rev = revProvider->getOntologyRevision(); } return rev; } QString CConstructWriteXMLSubClassHirarchyQueryCommand::getOutputFileName() { return mOutputFileName; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseEntitiesExtractionSpecification.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseEntitiesExtractionS0000644000175000017500000000363512520756342032432 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CKnowledgeBaseEntitiesExtractionSpecification.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CKnowledgeBaseEntitiesExtractionSpecification::CKnowledgeBaseEntitiesExtractionSpecification(cint64 flags) { mEntityExtractionFlags = flags; } cint64 CKnowledgeBaseEntitiesExtractionSpecification::getEntityExtractionFlags() { return mEntityExtractionFlags; } CKnowledgeBaseEntitiesExtractionSpecification* CKnowledgeBaseEntitiesExtractionSpecification::setEntityExtractionFlags(cint64 flags) { mEntityExtractionFlags = flags; return this; } CKnowledgeBaseEntitiesExtractionSpecification* CKnowledgeBaseEntitiesExtractionSpecification::clearEntityExtractionFlags() { mEntityExtractionFlags = 0; return this; } bool CKnowledgeBaseEntitiesExtractionSpecification::hasPartialEntityExtractionFlags(cint64 extractionFlag) { return (mEntityExtractionFlags & extractionFlag) != 0; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructFlattenedTypesQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructFlattenedTypesQueryComm0000644000175000017500000000505212520756334032525 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConstructFlattenedTypesQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CConstructFlattenedTypesQueryCommand::CConstructFlattenedTypesQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, const QDomElement &queryNode, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { node = queryNode; revProvider = ontologyRevisionProviderCommand; query = 0; addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CConstructFlattenedTypesQueryCommand::~CConstructFlattenedTypesQueryCommand() { delete query; } qint64 CConstructFlattenedTypesQueryCommand::getCommandTag() { return CONSTRUCTFLATTENEDTYPESQUERYCOMMAND; } QString CConstructFlattenedTypesQueryCommand::getBriefCommandDescription() { return QString("Construct-FlattenedTypes-Query Command"); } CQuery *CConstructFlattenedTypesQueryCommand::getQuery() { return query; } CCommand *CConstructFlattenedTypesQueryCommand::getCommand() { return this; } CConstructFlattenedTypesQueryCommand *CConstructFlattenedTypesQueryCommand::setQuery(CQuery *knowledgeBaseQuery) { query = knowledgeBaseQuery; return this; } COntologyRevision *CConstructFlattenedTypesQueryCommand::getOntologyRevision() { COntologyRevision *rev = 0; if (revProvider) { rev = revProvider->getOntologyRevision(); } return rev; } QDomElement *CConstructFlattenedTypesQueryCommand::getQueryNode() { return &node; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsClassSubsumedByQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsClassSubsumedByQueryCommand.cp0000644000175000017500000000277612520756340032324 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIsClassSubsumedByQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CIsClassSubsumedByQueryCommand::CIsClassSubsumedByQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { } CIsClassSubsumedByQueryCommand::~CIsClassSubsumedByQueryCommand() { } QString CIsClassSubsumedByQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-ClassSubsumtionQuery Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CInsertResponseCommentCommand.cpp0000644000175000017500000000325312520756340032407 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CInsertResponseCommentCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CInsertResponseCommentCommand::CInsertResponseCommentCommand(const QString &responseComment, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { comment = responseComment; } CInsertResponseCommentCommand::~CInsertResponseCommentCommand() { } qint64 CInsertResponseCommentCommand::getCommandTag() { return INSERTRESPONSECOMMENT; } QString CInsertResponseCommentCommand::getResponseComment() { return comment; } QString CInsertResponseCommentCommand::getBriefCommandDescription() { return QString("Insert-Response-Comment Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CReleaseKnowledgeBaseCommand.h0000644000175000017500000000447612520756346031577 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CRELEASEKNOWLEDGEBASECOMMAND_H #define KONCLUDE_Control_COMMAND_CRELEASEKNOWLEDGEBASECOMMAND_H // Libraries includes #include // Namespace includes #include "CKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CReleaseKnowledgeBaseCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReleaseKnowledgeBaseCommand : public CKnowledgeBaseCommand { // public methods public: //! Constructor CReleaseKnowledgeBaseCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CReleaseKnowledgeBaseCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QString getKnowledgeBaseName(); // protected methods protected: // protected variables protected: QString kbString; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CRELEASEKNOWLEDGEBASECOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CInitializeReasonerCommand.cpp0000644000175000017500000000333312520756340031700 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CInitializeReasonerCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CInitializeReasonerCommand::CInitializeReasonerCommand(CCommanderInitializationFactory *initializationFactory, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { initFactory = initializationFactory; } CInitializeReasonerCommand::~CInitializeReasonerCommand() { } qint64 CInitializeReasonerCommand::getCommandTag() { return INITIALIZEREASONERCOMMAND; } QString CInitializeReasonerCommand::getBriefCommandDescription() { return QString("Initialize-Reasoner Command"); } CCommanderInitializationFactory *CInitializeReasonerCommand::getInitializationFactory() { return initFactory; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLAutoOntologyCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLAutoOntology0000644000175000017500000000517112520756342032304 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEOWLAUTOONTOLOGYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEOWLAUTOONTOLOGYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CLoadKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CLoadKnowledgeBaseOWLAutoOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLoadKnowledgeBaseOWLAutoOntologyCommand : public CLoadKnowledgeBaseCommand { // public methods public: //! Constructor CLoadKnowledgeBaseOWLAutoOntologyCommand(const QString &knowledgeBaseNameString, const QStringList& loadIRIs, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CLoadKnowledgeBaseOWLAutoOntologyCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QStringList getLoadIRIStrings(); virtual bool getLoadImports(); virtual QMap getOntologieIRIMappings(); // protected methods protected: // protected variables protected: QStringList mLoadIRIs; bool mLoadImports; QMap mOntoIRIMapping; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEOWLAUTOONTOLOGYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractOntologyCommand.h0000644000175000017500000000425012520756336030716 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CEXTRACTONTOLOGYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CEXTRACTONTOLOGYCOMMAND_H // Libraries includes #include // Namespace includes #include "CRendererCommandProvider.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CExtractOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExtractOntologyCommand : public CPreconditionCommand, public CRendererCommandProvider { // public methods public: //! Constructor CExtractOntologyCommand(CCommand *parentSuperCommand = 0); //! Destructor virtual ~CExtractOntologyCommand(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CEXTRACTONTOLOGYCOMMAND_H ././@LongLink0000644000000000000000000000020500000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSaveOWLlinkOWL2XMLSatisfiableTes0000644000175000017500000000544612520756346032043 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CSAVEOWLLINKOWL2XMLSATISFIABLETESTEXTRACTEDKNOWLEDGEBASECOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CSAVEOWLLINKOWL2XMLSATISFIABLETESTEXTRACTEDKNOWLEDGEBASECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CSaveKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand : public CSaveKnowledgeBaseCommand { // public methods public: //! Constructor CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand(const QString &knowledgeBaseNameString, const QString& loadIRI, const QStringList& extractEntityNames, const QString& testKBName, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); QString getSaveIRIString(); QStringList getExtractEntitiyList(); QString getTestKBName(); // protected methods protected: // protected variables protected: QString mSaveIRI; QStringList mEntityNames; QString mTestKBName; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CSAVEOWLLINKOWL2XMLSATISFIABLETESTEXTRACTEDKNOWLEDGEBASECOMMAND_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CQueryGeneratorCommandProvider.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CQueryGeneratorCommandProvider.cp0000644000175000017500000000232412520756344032412 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGeneratorCommandProvider.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CQueryGeneratorCommandProvider::CQueryGeneratorCommandProvider() { } CQueryGeneratorCommandProvider::~CQueryGeneratorCommandProvider() { } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesEquivalentQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesEquivalentQueryCommand0000644000175000017500000000302212520756334032426 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAreClassesEquivalentQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CAreClassesEquivalentQueryCommand::CAreClassesEquivalentQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { } CAreClassesEquivalentQueryCommand::~CAreClassesEquivalentQueryCommand() { } QString CAreClassesEquivalentQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-ClassesEquivalentQuery Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CReadXMLCommand.cpp0000644000175000017500000000351112520756344027336 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReadXMLCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CReadXMLCommand::CReadXMLCommand(const QString &iriString, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { mIRIString = iriString; } CReadXMLCommand::~CReadXMLCommand() { } qint64 CReadXMLCommand::getCommandTag() { return READTEXTCOMMAND; } QString CReadXMLCommand::getBriefCommandDescription() { return QString("Read-%1-XML Command").arg(mIRIString); } QString CReadXMLCommand::getIRIString() { return mIRIString; } QDomElement CReadXMLCommand::getReadXMLNode() { return mElement; } CReadXMLCommand* CReadXMLCommand::setReadXMLNode(const QDomElement& xmlNode) { mElement = xmlNode; return this; } CCommand* CReadXMLCommand::getCommand() { return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseOWLlinkCommandsCommand.h0000644000175000017500000000450112520756344031543 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CParseOWLlinkCommandsCommand_H #define KONCLUDE_Control_COMMAND_CParseOWLlinkCommandsCommand_H // Libraries includes #include // Namespace includes #include "CParseCommandsCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CParseOWLlinkCommandsCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CParseOWLlinkCommandsCommand : public CParseCommandsCommand { // public methods public: //! Constructor CParseOWLlinkCommandsCommand(QByteArray *array, const QString &arraySourcePath = QString(), CCommand *parentSuperCommand = 0); //! Destructor virtual ~CParseOWLlinkCommandsCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CParseOWLlinkCommandsCommand_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructClassifyQueryCommand.h0000644000175000017500000000535512520756334032266 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CCONSTRUCTCLASSIFYQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CCONSTRUCTCLASSIFYQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CQueryCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CConstructClassifyQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConstructClassifyQueryCommand : public CPreconditionCommand, public CQueryCommandProvider { // public methods public: //! Constructor CConstructClassifyQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CConstructClassifyQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual CQuery *getQuery(); virtual CConstructClassifyQueryCommand *setQuery(CQuery *knowledgeBaseQuery); virtual COntologyRevision *getOntologyRevision(); // protected methods protected: // protected variables protected: CKnowledgeBaseRevisionCommandProvider *revProvider; CQuery *query; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CCONSTRUCTCLASSIFYQUERYCOMMAND_H ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteFunctionalIndividualTypesQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteFunctionalIndividualTypesQu0000644000175000017500000000414012520756346032504 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteFunctionalIndividualTypesQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CWriteFunctionalIndividualTypesQueryCommand::CWriteFunctionalIndividualTypesQueryCommand(const QString& knowledgeBaseNameString, const QString& outputFileString, const QString& individualName, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { mIndividualName = individualName; mOutputFileString = outputFileString; } CWriteFunctionalIndividualTypesQueryCommand::~CWriteFunctionalIndividualTypesQueryCommand() { } qint64 CWriteFunctionalIndividualTypesQueryCommand::getCommandTag() { return WRITEFUNCTIONALINDIVIDUALTYPESQUERYCOMMAND; } QString CWriteFunctionalIndividualTypesQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-WriteFunctionalIndividualTypes Command"); } QString CWriteFunctionalIndividualTypesQueryCommand::getOutputFileString() { return mOutputFileString; } QString CWriteFunctionalIndividualTypesQueryCommand::getIndividualName() { return mIndividualName; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CCreateKnowledgeBaseRevisionUpdateCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CCreateKnowledgeBaseRevisionUpdat0000644000175000017500000000535212520756336032403 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCREATEKNOWLEDGEBASEREVISIONUPDATECOMMAND_H #define KONCLUDE_Control_COMMAND_CCREATEKNOWLEDGEBASEREVISIONUPDATECOMMAND_H // Libraries includes #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CCreateKnowledgeBaseRevisionUpdateCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCreateKnowledgeBaseRevisionUpdateCommand : public CKnowledgeBaseCommand, public CKnowledgeBaseRevisionCommandProvider { // public methods public: //! Constructor CCreateKnowledgeBaseRevisionUpdateCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CCreateKnowledgeBaseRevisionUpdateCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QString getKnowledgeBaseName(); virtual COntologyRevision *getOntologyRevision(); virtual CCreateKnowledgeBaseRevisionUpdateCommand *setOntologyRevision(COntologyRevision *ontologyRevision); virtual CCommand *getCommand(); // protected methods protected: // protected variables protected: QString kbString; COntologyRevision *onRev; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCREATEKNOWLEDGEBASEREVISIONUPDATECOMMAND_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseStartDownloadCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseStartDownloadCo0000644000175000017500000000401012520756344032317 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLoadKnowledgeBaseStartDownloadCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CLoadKnowledgeBaseStartDownloadCommand::CLoadKnowledgeBaseStartDownloadCommand(const QString& downloadIRIString, CLoadKnowledgeBaseFinishDownloadCommand* finishCommand, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { mDownloadIRI = downloadIRIString; mFinishCommand = finishCommand; } CLoadKnowledgeBaseStartDownloadCommand::~CLoadKnowledgeBaseStartDownloadCommand() { } qint64 CLoadKnowledgeBaseStartDownloadCommand::getCommandTag() { return LOADKNOWLEDGEBASESTARTDOWNLOADCOMMAND; } QString CLoadKnowledgeBaseStartDownloadCommand::getBriefCommandDescription() { return QString("Load-Knowledge-Base-Start-Download Command"); } QString CLoadKnowledgeBaseStartDownloadCommand::getDownloadIRIString() { return mDownloadIRI; } CLoadKnowledgeBaseFinishDownloadCommand* CLoadKnowledgeBaseStartDownloadCommand::getFinishCommand() { return mFinishCommand; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CInitializeConfigurationCommand.h0000644000175000017500000000465712520756340032410 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CINITIALIZECOFIGURATIONCOMMAND_H #define KONCLUDE_Control_COMMAND_CINITIALIZECOFIGURATIONCOMMAND_H // Libraries includes #include // Namespace includes #include "Config/CConfiguration.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Other includes #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Config; namespace Control { namespace Command { namespace Instructions { /*! * * \class CInitializeConfigurationCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CInitializeConfigurationCommand : public CPreconditionCommand { // public methods public: //! Constructor CInitializeConfigurationCommand(CConfiguration *initialConfiguration = 0, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CInitializeConfigurationCommand(); virtual CConfiguration *getInitialConfiguration(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); // protected methods protected: CConfiguration *initConfig; // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CINITIALIZECOFIGURATIONCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CCalculateQueryCommand.cpp0000644000175000017500000000357412520756334031035 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCalculateQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CCalculateQueryCommand::CCalculateQueryCommand(CQueryCommandProvider *queryCommandProvider, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { queryProvider = queryCommandProvider; query = 0; addCommandPrecondition(new CCommandProcessedPrecondition(queryProvider->getCommand())); } CCalculateQueryCommand::~CCalculateQueryCommand() { } qint64 CCalculateQueryCommand::getCommandTag() { return CALCULATEQUERYCOMMAND; } QString CCalculateQueryCommand::getBriefCommandDescription() { return QString("Calculate-Query Command"); } CCommand *CCalculateQueryCommand::getCommand() { return this; } CQuery *CCalculateQueryCommand::getQuery() { if (queryProvider) { return queryProvider->getQuery(); } return query; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseConfigCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseConfigCommand.cp0000644000175000017500000000367112520756340032225 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetKnowledgeBaseConfigCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetKnowledgeBaseConfigCommand::CGetKnowledgeBaseConfigCommand(const QString &propertyName, const QString &knowlegdeBaseName, CCommand *parentSuperCommand) : CGetConfigCommand(propertyName,parentSuperCommand) { kbName = knowlegdeBaseName; } CGetKnowledgeBaseConfigCommand::~CGetKnowledgeBaseConfigCommand() { } qint64 CGetKnowledgeBaseConfigCommand::getCommandTag() { return GETKNOWLEGEBASECONFIGURATIONCOMMAND; } QString CGetKnowledgeBaseConfigCommand::getBriefCommandDescription() { return QString("Get-KnowlegeBase-'%1'-Config Command").arg(propName); } CGetKnowledgeBaseConfigCommand *CGetKnowledgeBaseConfigCommand::setKnowlegeBaseName(const QString &knowlegdeBaseName) { kbName = knowlegdeBaseName; return this; } QString CGetKnowledgeBaseConfigCommand::getKnowlegeBaseString() { return kbName; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CImportKnowledgeBaseOWLAutoOntologyCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CImportKnowledgeBaseOWLAutoOntolo0000644000175000017500000000515112520756340032333 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CImportKnowledgeBaseOWLAutoOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CImportKnowledgeBaseOWLAutoOntologyCommand::CImportKnowledgeBaseOWLAutoOntologyCommand(const QString &knowledgeBaseNameString, const QStringList& loadIRIs, const QMap& ontoIRIMap, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CLoadKnowledgeBaseCommand(knowledgeBaseNameString,parentSuperCommand) { mOntoIRIMapping = ontoIRIMap; mLoadIRIs = loadIRIs; mOntologyRevisionProviderCommand = ontologyRevisionProviderCommand; } CImportKnowledgeBaseOWLAutoOntologyCommand::~CImportKnowledgeBaseOWLAutoOntologyCommand() { } qint64 CImportKnowledgeBaseOWLAutoOntologyCommand::getCommandTag() { return IMPORTKNOWLEDGEBASEOWLAUTOONTOLOGYCOMMAND; } COntologyRevision* CImportKnowledgeBaseOWLAutoOntologyCommand::getOntologyRevision() { return mOntologyRevisionProviderCommand->getOntologyRevision(); } QString CImportKnowledgeBaseOWLAutoOntologyCommand::getBriefCommandDescription() { return QString("Load-'%1'-Knowledge-Base-Imports-OWL-Auto-Ontology Command").arg(kbString); } bool CImportKnowledgeBaseOWLAutoOntologyCommand::getLoadImports() { return mLoadImports; } CCommand* CImportKnowledgeBaseOWLAutoOntologyCommand::getCommand() { return this; } QStringList CImportKnowledgeBaseOWLAutoOntologyCommand::getLoadIRIStrings() { return mLoadIRIs; } QMap CImportKnowledgeBaseOWLAutoOntologyCommand::getOntologieIRIMappings() { return mOntoIRIMapping; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseRealizeCommand.h0000644000175000017500000000443512520756342031601 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CKNOWLEDGEBASEREALIZECOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CKNOWLEDGEBASEREALIZECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseProcessCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CKnowledgeBaseRealizeCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CKnowledgeBaseRealizeCommand : public CKnowledgeBaseProcessCommand { // public methods public: //! Constructor CKnowledgeBaseRealizeCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CKnowledgeBaseRealizeCommand(); virtual QString getBriefCommandDescription(); virtual qint64 getCommandTag(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CKNOWLEDGEBASEREALIZECOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructRealizeQueryCommand.cpp0000644000175000017500000000446012520756336032435 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConstructRealizeQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CConstructRealizeQueryCommand::CConstructRealizeQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { revProvider = ontologyRevisionProviderCommand; query = 0; addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CConstructRealizeQueryCommand::~CConstructRealizeQueryCommand() { delete query; } qint64 CConstructRealizeQueryCommand::getCommandTag() { return CCONSTRUCTREALIZEQUERYCOMMAND; } QString CConstructRealizeQueryCommand::getBriefCommandDescription() { return QString("Construct-Realize-Query Command"); } CQuery *CConstructRealizeQueryCommand::getQuery() { return query; } CCommand *CConstructRealizeQueryCommand::getCommand() { return this; } CConstructRealizeQueryCommand *CConstructRealizeQueryCommand::setQuery(CQuery *knowledgeBaseQuery) { query = knowledgeBaseQuery; return this; } COntologyRevision *CConstructRealizeQueryCommand::getOntologyRevision() { COntologyRevision *rev = 0; if (revProvider) { rev = revProvider->getOntologyRevision(); } return rev; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CTellKnowledgeBaseCommand.cpp0000644000175000017500000000310612520756346031437 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTellKnowledgeBaseCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CTellKnowledgeBaseCommand::CTellKnowledgeBaseCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseCommand(parentSuperCommand) { kbString = knowledgeBaseNameString; } CTellKnowledgeBaseCommand::~CTellKnowledgeBaseCommand() { } QString CTellKnowledgeBaseCommand::getBriefCommandDescription() { return QString("Tell-Knowledge-Base Command").arg(kbString); } QString CTellKnowledgeBaseCommand::getKnowledgeBaseName() { return kbString; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CClassifyQueryCommand.h0000644000175000017500000000447712520756334030365 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CCLASSIFYQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CCLASSIFYQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Reasoner/Query/CSubClassHierarchyQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CClassifyQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassifyQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CClassifyQueryCommand(const QString& knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CClassifyQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CCLASSIFYQUERYCOMMAND_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructIsConsistentQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructIsConsistentQueryComman0000644000175000017500000000541512520756334032541 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CCONSTRUCTISCONSISTENTQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CCONSTRUCTISCONSISTENTQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CQueryCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CConstructIsConsistentQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConstructIsConsistentQueryCommand : public CPreconditionCommand, public CQueryCommandProvider { // public methods public: //! Constructor CConstructIsConsistentQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CConstructIsConsistentQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual CQuery *getQuery(); virtual CConstructIsConsistentQueryCommand *setQuery(CQuery *knowledgeBaseQuery); virtual COntologyRevision *getOntologyRevision(); // protected methods protected: // protected variables protected: CKnowledgeBaseRevisionCommandProvider *revProvider; CQuery *query; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CCONSTRUCTISCONSISTENTQUERYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseOWL2XMLOntologyCommand.h0000644000175000017500000000602212520756344031401 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CPARSEOWL2XMLONTOLOGYCOMMAND_H #define KONCLUDE_Control_COMMAND_CPARSEOWL2XMLONTOLOGYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CParseOntologyCommand.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CReadXMLCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CParseOWL2XMLOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CParseOWL2XMLOntologyCommand : public CParseOntologyCommand, public CKnowledgeBaseRevisionCommandProvider { // public methods public: //! Constructor CParseOWL2XMLOntologyCommand(const QDomElement &ontologyNode, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); CParseOWL2XMLOntologyCommand(CReadXMLCommandProvider* xmlCommandProvider, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CParseOWL2XMLOntologyCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QDomElement getOntologyNode(); virtual COntologyRevision *getOntologyRevision(); virtual CCommand *getCommand(); // protected methods protected: // protected variables protected: QDomElement node; CKnowledgeBaseRevisionCommandProvider *revProvider; CReadXMLCommandProvider* mXmlCommandProvider; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CPARSEOWL2XMLONTOLOGYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CTestTestsuiteCommand.h0000644000175000017500000000474612520756346030415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CTESTTESTSUITECOMMAND_H #define KONCLUDE_Control_COMMAND_CTESTTESTSUITECOMMAND_H // Libraries includes #include // Namespace includes // Other includes #include "Test/CReasonerTestsuiteTest.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Test; namespace Control { namespace Command { namespace Instructions { /*! * * \class CTestTestsuiteCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTestTestsuiteCommand : public CPreconditionCommand { // public methods public: //! Constructor CTestTestsuiteCommand(const QString &testsuiteNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CTestTestsuiteCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QString getTestsuiteName(); virtual CReasonerTestsuiteTest *getTestsuiteTest(); virtual CTestTestsuiteCommand *setTestsuiteTest(CReasonerTestsuiteTest *testsuiteTest); // protected methods protected: // protected variables protected: QString testsName; CReasonerTestsuiteTest *testsuite; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CTESTTESTSUITECOMMAND_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseRevisionCommandProvider.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseRevisionCommandProv0000644000175000017500000000236712520756342032427 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CKnowledgeBaseRevisionCommandProvider.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CKnowledgeBaseRevisionCommandProvider::CKnowledgeBaseRevisionCommandProvider() { } CKnowledgeBaseRevisionCommandProvider::~CKnowledgeBaseRevisionCommandProvider() { } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CPrepareKnowledgeBaseCommand.h0000644000175000017500000000610412520756344031601 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CPREPAREKNOWLEDGEBASECOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CPREPAREKNOWLEDGEBASECOMMAND_H // Libraries includes #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Reasoner/Ontology/COntologyProcessingStepVector.h" #include "Reasoner/Ontology/COntologyProcessingRequirementExpander.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Ontology; namespace Control { namespace Command { namespace Instructions { /*! * * \class CPrepareKnowledgeBaseCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPrepareKnowledgeBaseCommand : public CPreconditionCommand { // public methods public: //! Constructor CPrepareKnowledgeBaseCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CPrepareKnowledgeBaseCommand(); virtual QString getBriefCommandDescription(); virtual qint64 getCommandTag(); virtual COntologyRevision* getOntologyRevision(); virtual CConcreteOntology* getOntology(); virtual QList* getOntologyProcessingRequirementList(); CPrepareKnowledgeBaseCommand* addRequirement(COntologyProcessingStepRequirement* requirement); // protected methods protected: // protected variables protected: CKnowledgeBaseRevisionCommandProvider* mRevProvider; QList mOntProReqList; CConcreteOntology* mOntology; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CPREPAREKNOWLEDGEBASECOMMAND_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractedKnowledgeBaseEntitiesContainer.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractedKnowledgeBaseEntitiesCo0000644000175000017500000000276012520756336032375 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExtractedKnowledgeBaseEntitiesContainer.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CExtractedKnowledgeBaseEntitiesContainer::CExtractedKnowledgeBaseEntitiesContainer() { } QStringList* CExtractedKnowledgeBaseEntitiesContainer::getExtractedEntityList() { return &mExtractedEntityList; } CExtractedKnowledgeBaseEntitiesContainer* CExtractedKnowledgeBaseEntitiesContainer::addExtractedEntity(const QString& entityName) { mExtractedEntityList.append(entityName); return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructIsConsistentQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructIsConsistentQueryComman0000644000175000017500000000457012520756334032542 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConstructIsConsistentQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CConstructIsConsistentQueryCommand::CConstructIsConsistentQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { revProvider = ontologyRevisionProviderCommand; query = 0; addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CConstructIsConsistentQueryCommand::~CConstructIsConsistentQueryCommand() { delete query; } qint64 CConstructIsConsistentQueryCommand::getCommandTag() { return CONSTRUCTISCONSISTENTQUERYCOMMAND; } QString CConstructIsConsistentQueryCommand::getBriefCommandDescription() { return QString("Construct-IsConsistent-Query Command"); } CQuery *CConstructIsConsistentQueryCommand::getQuery() { return query; } CCommand *CConstructIsConsistentQueryCommand::getCommand() { return this; } CConstructIsConsistentQueryCommand *CConstructIsConsistentQueryCommand::setQuery(CQuery *knowledgeBaseQuery) { query = knowledgeBaseQuery; return this; } COntologyRevision *CConstructIsConsistentQueryCommand::getOntologyRevision() { COntologyRevision *rev = 0; if (revProvider) { rev = revProvider->getOntologyRevision(); } return rev; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseClassifyCommand.h0000644000175000017500000000444412520756342031763 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CKnowledgeBaseClassifyCommand_H #define KONCLUDE_CONTROL_COMMAND_CKnowledgeBaseClassifyCommand_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseProcessCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CKnowledgeBaseClassifyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CKnowledgeBaseClassifyCommand : public CKnowledgeBaseProcessCommand { // public methods public: //! Constructor CKnowledgeBaseClassifyCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CKnowledgeBaseClassifyCommand(); virtual QString getBriefCommandDescription(); virtual qint64 getCommandTag(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CKnowledgeBaseClassifyCommand_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetFlattenedTypesOWL2XMLNodeCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetFlattenedTypesOWL2XMLNodeComm0000644000175000017500000000350212520756336032065 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetFlattenedTypesOWL2XMLNodeCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetFlattenedTypesOWL2XMLNodeCommand::CGetFlattenedTypesOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand) : CGetFlattenedTypesQueryCommand(knowledgeBaseNameString,parentSuperCommand) { node = queryNode; } CGetFlattenedTypesOWL2XMLNodeCommand::~CGetFlattenedTypesOWL2XMLNodeCommand() { } QString CGetFlattenedTypesOWL2XMLNodeCommand::getBriefCommandDescription() { return QString("Knowledge-Base-GetFlattenedTypes Command"); } QDomElement CGetFlattenedTypesOWL2XMLNodeCommand::getQueryNode() { return node; } qint64 CGetFlattenedTypesOWL2XMLNodeCommand::getCommandTag() { return FLATTENEDTYPESQUERYKNOWLEDGEBASEOWL2XMLCOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseOWLlinkCommandsCommand.cpp0000644000175000017500000000313312520756344032076 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CParseOWLlinkCommandsCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CParseOWLlinkCommandsCommand::CParseOWLlinkCommandsCommand(QByteArray *array, const QString &arraySourcePath, CCommand *parentSuperCommand) : CParseCommandsCommand(array,arraySourcePath,parentSuperCommand) { } CParseOWLlinkCommandsCommand::~CParseOWLlinkCommandsCommand() { } qint64 CParseOWLlinkCommandsCommand::getCommandTag() { return PARSEOWLLINKCOMMANDSCOMMAND; } QString CParseOWLlinkCommandsCommand::getBriefCommandDescription() { return QString("Parse-OWLlink-Commands Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CReadXMLCommandProvider.cpp0000644000175000017500000000225712520756346031061 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReadXMLCommandProvider.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CReadXMLCommandProvider::CReadXMLCommandProvider() { } CReadXMLCommandProvider::~CReadXMLCommandProvider() { } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetCurrentKnowledgeBaseRevisionCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetCurrentKnowledgeBaseRevisionC0000644000175000017500000000533212520756336032365 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CGETCURRENTKNOWLEDGEBASEREVISIONCOMMAND_H #define KONCLUDE_Control_COMMAND_CGETCURRENTKNOWLEDGEBASEREVISIONCOMMAND_H // Libraries includes #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetCurrentKnowledgeBaseRevisionCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetCurrentKnowledgeBaseRevisionCommand : public CKnowledgeBaseCommand, public CKnowledgeBaseRevisionCommandProvider { // public methods public: //! Constructor CGetCurrentKnowledgeBaseRevisionCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetCurrentKnowledgeBaseRevisionCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QString getKnowledgeBaseName(); virtual COntologyRevision *getOntologyRevision(); virtual CGetCurrentKnowledgeBaseRevisionCommand *setOntologyRevision(COntologyRevision *ontologyRevision); virtual CCommand *getCommand(); // protected methods protected: // protected variables protected: QString kbString; COntologyRevision *onRev; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CGETCURRENTKNOWLEDGEBASEREVISIONCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CCalculateQueryCommand.h0000644000175000017500000000504212520756334030472 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCALCULATEQUERYCOMMAND_H #define KONCLUDE_Control_COMMAND_CCALCULATEQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CParseOntologyCommand.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CQueryCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CCalculateQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCalculateQueryCommand : public CPreconditionCommand, public CQueryCommandProvider { // public methods public: //! Constructor CCalculateQueryCommand(CQueryCommandProvider *queryCommandProvider, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CCalculateQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual CQuery *getQuery(); // protected methods protected: // protected variables protected: CQueryCommandProvider *queryProvider; CQuery *query; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCALCULATEQUERYCOMMAND_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetClassificationManagerCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetClassificationManagerCommand.0000644000175000017500000000362412520756336032273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetClassificationManagerCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetClassificationManagerCommand::CGetClassificationManagerCommand(CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { classMan = 0; } CGetClassificationManagerCommand::~CGetClassificationManagerCommand() { } qint64 CGetClassificationManagerCommand::getCommandTag() { return GETCLASSIFICATIONMANAGERCOMMAND; } QString CGetClassificationManagerCommand::getBriefCommandDescription() { return QString("Get-Classification-Manager Command"); } CClassificationManager *CGetClassificationManagerCommand::getClassificationManager() { return classMan; } CGetClassificationManagerCommand *CGetClassificationManagerCommand::setClassificationManager(CClassificationManager *classificationManager) { classMan = classificationManager; return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructFlattenedTypesQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructFlattenedTypesQueryComm0000644000175000017500000000557712520756334032541 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CCONSTRUCTFLATTENEDTYPESQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CCONSTRUCTFLATTENEDTYPESQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CQueryCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CConstructFlattenedTypesQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConstructFlattenedTypesQueryCommand : public CPreconditionCommand, public CQueryCommandProvider { // public methods public: //! Constructor CConstructFlattenedTypesQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, const QDomElement &queryNode, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CConstructFlattenedTypesQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual CQuery *getQuery(); virtual CConstructFlattenedTypesQueryCommand *setQuery(CQuery *knowledgeBaseQuery); virtual COntologyRevision *getOntologyRevision(); virtual QDomElement *getQueryNode(); // protected methods protected: // protected variables protected: CKnowledgeBaseRevisionCommandProvider *revProvider; CQuery *query; QDomElement node; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CCONSTRUCTFLATTENEDTYPESQUERYCOMMAND_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractKnowledgeBaseLanguageCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractKnowledgeBaseLanguageComm0000644000175000017500000000472412520756336032357 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExtractKnowledgeBaseLanguageCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CExtractKnowledgeBaseLanguageCommand::CExtractKnowledgeBaseLanguageCommand(QString* languageStringPointer, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { revProvider = ontologyRevisionProviderCommand; if (revProvider) { addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } mLanguageStringPointer = languageStringPointer; } CExtractKnowledgeBaseLanguageCommand::~CExtractKnowledgeBaseLanguageCommand() { } qint64 CExtractKnowledgeBaseLanguageCommand::getCommandTag() { return EXTRACTKNOWLEDGEBASELANGUAGECOMMAND; } QString CExtractKnowledgeBaseLanguageCommand::getBriefCommandDescription() { return QString("Extract-Knowledge-Base-Language Command"); } CCommand *CExtractKnowledgeBaseLanguageCommand::getCommand() { return this; } COntologyRevision *CExtractKnowledgeBaseLanguageCommand::getOntologyRevision() { COntologyRevision *rev = 0; if (revProvider) { rev = revProvider->getOntologyRevision(); } return rev; } CExtractKnowledgeBaseLanguageCommand* CExtractKnowledgeBaseLanguageCommand::setKBLanguageString(const QString& languageString) { if (mLanguageStringPointer) { *mLanguageStringPointer = languageString; } return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteOntologyCommand.h0000644000175000017500000000423312520756350030373 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CWRITEONTOLOGYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CWRITEONTOLOGYCOMMAND_H // Libraries includes #include // Namespace includes #include "CRendererCommandProvider.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CWriteOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteOntologyCommand : public CPreconditionCommand, public CRendererCommandProvider { // public methods public: //! Constructor CWriteOntologyCommand(CCommand *parentSuperCommand = 0); //! Destructor virtual ~CWriteOntologyCommand(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CWRITEONTOLOGYCOMMAND_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsConsistentQueryOWL2XMLNodeCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsConsistentQueryOWL2XMLNodeComm0000644000175000017500000000347312520756340032147 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIsConsistentQueryOWL2XMLNodeCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CIsConsistentQueryOWL2XMLNodeCommand::CIsConsistentQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand) : CIsConsistentQueryCommand(knowledgeBaseNameString,parentSuperCommand) { mQueryNode = queryNode; } CIsConsistentQueryOWL2XMLNodeCommand::~CIsConsistentQueryOWL2XMLNodeCommand() { } QString CIsConsistentQueryOWL2XMLNodeCommand::getBriefCommandDescription() { return QString("Knowledge-Base-IsConsistent Command"); } QDomElement CIsConsistentQueryOWL2XMLNodeCommand::getQueryNode() { return mQueryNode; } qint64 CIsConsistentQueryOWL2XMLNodeCommand::getCommandTag() { return ISCONSISTENTKNOWLEDGEBASEOWL2XMLCOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CStreamParseOWL2XMLOntologyCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CStreamParseOWL2XMLOntologyComman0000644000175000017500000000427012520756346032170 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CStreamParseOWL2XMLOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CStreamParseOWL2XMLOntologyCommand::CStreamParseOWL2XMLOntologyCommand(const QString& sourceStringName, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CParseOntologyCommand(parentSuperCommand) { mSourceString = sourceStringName; revProvider = ontologyRevisionProviderCommand; //addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CStreamParseOWL2XMLOntologyCommand::~CStreamParseOWL2XMLOntologyCommand() { } qint64 CStreamParseOWL2XMLOntologyCommand::getCommandTag() { return STREAMPARSEOWL2XMLONTOLOGYCOMMAND; } QString CStreamParseOWL2XMLOntologyCommand::getBriefCommandDescription() { return QString("Stream-Parse-OWL2-XML-Ontology Command"); } const QString& CStreamParseOWL2XMLOntologyCommand::getSourceString() { return mSourceString; } COntologyRevision* CStreamParseOWL2XMLOntologyCommand::getOntologyRevision() { return revProvider->getOntologyRevision(); } CCommand *CStreamParseOWL2XMLOntologyCommand::getCommand() { return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CTestTestfileCommand.cpp0000644000175000017500000000314712520756346030530 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTestTestfileCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CTestTestfileCommand::CTestTestfileCommand(CReasonerTestfileTest *reasonerTest, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { test = reasonerTest; } CTestTestfileCommand::~CTestTestfileCommand() { } qint64 CTestTestfileCommand::getCommandTag() { return TESTTESTFILECOMMAND; } CReasonerTestfileTest *CTestTestfileCommand::getReasonerTestfileTest() { return test; } QString CTestTestfileCommand::getBriefCommandDescription() { return QString("Test-Testfile Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteXMLIndividualTypesQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteXMLIndividualTypes0000644000175000017500000000605212520756336032444 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CCONSTRUCTWRITEXMLINDIVIDUALTYPESQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CCONSTRUCTWRITEXMLINDIVIDUALTYPESQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CQueryCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CConstructWriteXMLIndividualTypesQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConstructWriteXMLIndividualTypesQueryCommand : public CPreconditionCommand, public CQueryCommandProvider { // public methods public: //! Constructor CConstructWriteXMLIndividualTypesQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, const QString& outputFileString, const QString& individualName, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CConstructWriteXMLIndividualTypesQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual CQuery *getQuery(); virtual CConstructWriteXMLIndividualTypesQueryCommand *setQuery(CQuery *knowledgeBaseQuery); virtual COntologyRevision *getOntologyRevision(); QString getOutputFileName(); QString getIndividualName(); // protected methods protected: // protected variables protected: QString mOutputFileName; QString mIndividualName; CKnowledgeBaseRevisionCommandProvider *revProvider; CQuery *query; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CCONSTRUCTWRITEXMLINDIVIDUALTYPESQUERYCOMMAND_H ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesEquivalentQueryOWL2XMLNodeCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesEquivalentQueryOWL2XML0000644000175000017500000000360312520756334032161 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAreClassesEquivalentQueryOWL2XMLNodeCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CAreClassesEquivalentQueryOWL2XMLNodeCommand::CAreClassesEquivalentQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand) : CAreClassesEquivalentQueryCommand(knowledgeBaseNameString,parentSuperCommand) { node = queryNode; } CAreClassesEquivalentQueryOWL2XMLNodeCommand::~CAreClassesEquivalentQueryOWL2XMLNodeCommand() { } QString CAreClassesEquivalentQueryOWL2XMLNodeCommand::getBriefCommandDescription() { return QString("Knowledge-Base-ClassesEquivalentQuery Command"); } qint64 CAreClassesEquivalentQueryOWL2XMLNodeCommand::getCommandTag() { return EQUIVALENCEQUERYKNOWLEDGEBASEOWL2XMLCOMMAND; } QDomElement CAreClassesEquivalentQueryOWL2XMLNodeCommand::getQueryNode() { return node; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseTestsuiteXMLNodeCommand.cpp0000644000175000017500000000363112520756344032260 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CParseTestsuiteXMLNodeCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CParseTestsuiteXMLNodeCommand::CParseTestsuiteXMLNodeCommand(const QDomElement &testsuiteNode, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { node = testsuiteNode; } CParseTestsuiteXMLNodeCommand::~CParseTestsuiteXMLNodeCommand() { } qint64 CParseTestsuiteXMLNodeCommand::getCommandTag() { return PARSETESTSUITEXMLCOMMAND; } QString CParseTestsuiteXMLNodeCommand::getBriefCommandDescription() { return QString("Parse-Testsuite-XML Command"); } QDomElement CParseTestsuiteXMLNodeCommand::getTestsuiteNode() { return node; } CParseTestsuiteXMLNodeCommand *CParseTestsuiteXMLNodeCommand::setSourcePath(const QString &path) { sourcePath = path; return this; } QString CParseTestsuiteXMLNodeCommand::getSourcePath() { return sourcePath; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructClassifyQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructClassifyQueryCommand.cp0000644000175000017500000000447612520756334032444 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConstructClassifyQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CConstructClassifyQueryCommand::CConstructClassifyQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { revProvider = ontologyRevisionProviderCommand; query = 0; addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CConstructClassifyQueryCommand::~CConstructClassifyQueryCommand() { delete query; } qint64 CConstructClassifyQueryCommand::getCommandTag() { return CCONSTRUCTCLASSIFYQUERYCOMMAND; } QString CConstructClassifyQueryCommand::getBriefCommandDescription() { return QString("Construct-Classify-Query Command"); } CQuery *CConstructClassifyQueryCommand::getQuery() { return query; } CCommand *CConstructClassifyQueryCommand::getCommand() { return this; } CConstructClassifyQueryCommand *CConstructClassifyQueryCommand::setQuery(CQuery *knowledgeBaseQuery) { query = knowledgeBaseQuery; return this; } COntologyRevision *CConstructClassifyQueryCommand::getOntologyRevision() { COntologyRevision *rev = 0; if (revProvider) { rev = revProvider->getOntologyRevision(); } return rev; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CProcessQueryCommand.h0000644000175000017500000000433412520756344030217 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CPROCESSQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CPROCESSQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CProcessQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CProcessQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CProcessQueryCommand(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CPROCESSQUERYCOMMAND_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CPrepareKnowledgeBaseForQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CPrepareKnowledgeBaseForQueryComm0000644000175000017500000000407212520756344032367 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrepareKnowledgeBaseForQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CPrepareKnowledgeBaseForQueryCommand::CPrepareKnowledgeBaseForQueryCommand(CKnowledgeBaseRevisionCommandProvider* ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CPrepareKnowledgeBaseCommand(ontologyRevisionProviderCommand,parentSuperCommand) { COntologyProcessingStepVector* ontProStepVec = COntologyProcessingStepVector::getProcessingStepVectorInstance(); mOntProReqList.append( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSPREPROCESS), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) ); } CPrepareKnowledgeBaseForQueryCommand::~CPrepareKnowledgeBaseForQueryCommand() { } qint64 CPrepareKnowledgeBaseForQueryCommand::getCommandTag() { return PREPAREKNOWLEDGEBASEFORQUERYCOMMANDCOMMAND; } QString CPrepareKnowledgeBaseForQueryCommand::getBriefCommandDescription() { return QString("Prepare-Knowledge-Base-For-Query Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetDescriptionCommand.cpp0000644000175000017500000000337112520756336031032 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetDescriptionCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetDescriptionCommand::CGetDescriptionCommand(CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { configuaration = 0; } CGetDescriptionCommand::~CGetDescriptionCommand() { } qint64 CGetDescriptionCommand::getCommandTag() { return GETDESCRIPTIONCOMMAND; } CGetDescriptionCommand *CGetDescriptionCommand::setConfiguration(CConfigurationBase *config) { configuaration = config; return this; } CConfigurationBase *CGetDescriptionCommand::getConfiguration() { return configuaration; } QString CGetDescriptionCommand::getBriefCommandDescription() { return QString("Get-Reasoner-Description Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSaveKnowledgeBaseCommand.h0000644000175000017500000000443212520756346031105 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CSAVEKNOWLEDGEBASECOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CSAVEKNOWLEDGEBASECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CSaveKnowledgeBaseCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSaveKnowledgeBaseCommand : public CKnowledgeBaseCommand { // public methods public: //! Constructor CSaveKnowledgeBaseCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CSaveKnowledgeBaseCommand(); virtual QString getBriefCommandDescription(); virtual QString getKnowledgeBaseName(); // protected methods protected: // protected variables protected: QString kbString; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CSAVEKNOWLEDGEBASECOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseConfigCommand.h0000644000175000017500000000506412520756340032050 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CGETKNOWLEDGEBASECONFIGCOMMAND_H #define KONCLUDE_Control_COMMAND_CGETKNOWLEDGEBASECONFIGCOMMAND_H // Libraries includes #include // Namespace includes #include "CGetConfigCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Config/CConfigData.h" #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Config; namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetKnowledgeBaseConfigCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetKnowledgeBaseConfigCommand : public CGetConfigCommand { // public methods public: //! Constructor CGetKnowledgeBaseConfigCommand(const QString &propertyName, const QString &knowlegdeBaseName = QString(), CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetKnowledgeBaseConfigCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CGetKnowledgeBaseConfigCommand *setKnowlegeBaseName(const QString &knowlegdeBaseName); virtual QString getKnowlegeBaseString(); // protected methods protected: // protected variables protected: QString kbName; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CGETKNOWLEDGEBASECONFIGCOMMAND_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesDisjointQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesDisjointQueryCommand.c0000644000175000017500000000300612520756334032317 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAreClassesDisjointQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CAreClassesDisjointQueryCommand::CAreClassesDisjointQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { } CAreClassesDisjointQueryCommand::~CAreClassesDisjointQueryCommand() { } QString CAreClassesDisjointQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-ClassesDisjointQuery Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsSatisfiableQueryOWL2XMLNodeCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsSatisfiableQueryOWL2XMLNodeCom0000644000175000017500000000477712520756342032101 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CISSATISFIABLEQUERYOWL2XMLNODECOMMAND_H #define KONCLUDE_Control_COMMAND_CISSATISFIABLEQUERYOWL2XMLNODECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CIsSatisfiableQueryCommand.h" #include "CCalculateQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CIsSatisfiableQueryOWL2XMLNodeCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIsSatisfiableQueryOWL2XMLNodeCommand : public CIsSatisfiableQueryCommand { // public methods public: //! Constructor CIsSatisfiableQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CIsSatisfiableQueryOWL2XMLNodeCommand(); virtual QString getBriefCommandDescription(); virtual qint64 getCommandTag(); virtual QDomElement getQueryNode(); // protected methods protected: // protected variables protected: QDomElement node; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CISSATISFIABLEQUERYOWL2XMLNODECOMMAND_H ././@LongLink0000644000000000000000000000017600000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CChooseParseInstallKnowledgeBaseO0000644000175000017500000000550312520756334032340 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand::CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand(const QString &knowledgeBaseNameString, const QList& loadDataList, QMap ontoIRIMapping, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CLoadKnowledgeBaseCommand(knowledgeBaseNameString,parentSuperCommand) { mLoadDataList = loadDataList; mOntoIRIMapping = ontoIRIMapping; mOntologyRevisionProviderCommand = ontologyRevisionProviderCommand; } CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand::~CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand() { } qint64 CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand::getCommandTag() { return CHOOSEPARSEINSTALLKNOWLEDGEBASEOWLAUTOONTOLOGYCOMMAND; } COntologyRevision* CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand::getOntologyRevision() { return mOntologyRevisionProviderCommand->getOntologyRevision(); } QString CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand::getBriefCommandDescription() { return QString("Choose-Parse-Install-'%1'-Knowledge-Base-OWL-Auto-Ontology Command").arg(kbString); } bool CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand::getLoadImports() { return mLoadImports; } CCommand* CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand::getCommand() { return this; } QList CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand::getLoadDataList() { return mLoadDataList; } QMap CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand::getOntologieIRIMappings() { return mOntoIRIMapping; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseSettingsCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseSettingsCommand.0000644000175000017500000000505312520756340032271 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CGETKNOWLEDGEBASESETTINGSCOMMAND_H #define KONCLUDE_Control_COMMAND_CGETKNOWLEDGEBASESETTINGSCOMMAND_H // Libraries includes #include // Namespace includes #include "CGetSettingsCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Config/CConfigData.h" #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Config; namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetKnowledgeBaseSettingsCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetKnowledgeBaseSettingsCommand : public CGetSettingsCommand { // public methods public: //! Constructor CGetKnowledgeBaseSettingsCommand(const QString &knowlegdeBaseName = QString(), CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetKnowledgeBaseSettingsCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CGetKnowledgeBaseSettingsCommand *setKnowlegeBaseName(const QString &knowlegdeBaseName); virtual QString getKnowlegeBaseString(); // protected methods protected: // protected variables protected: QString kbName; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CGETKNOWLEDGEBASESETTINGSCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseCommand.h0000644000175000017500000000443212520756342031062 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASECOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CLoadKnowledgeBaseCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLoadKnowledgeBaseCommand : public CKnowledgeBaseCommand { // public methods public: //! Constructor CLoadKnowledgeBaseCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CLoadKnowledgeBaseCommand(); virtual QString getBriefCommandDescription(); virtual QString getKnowledgeBaseName(); // protected methods protected: // protected variables protected: QString kbString; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASECOMMAND_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseKRSSTestConceptOntologyCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseKRSSTestConceptOntologyComm0000644000175000017500000000567712520756344032341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CParseKRSSTestConceptOntologyCommand_H #define KONCLUDE_CONTROL_COMMAND_CParseKRSSTestConceptOntologyCommand_H // Libraries includes #include #include // Namespace includes #include "CParseOntologyCommand.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CReadTextCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CParseKRSSTestConceptOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CParseKRSSTestConceptOntologyCommand : public CParseOntologyCommand, public CKnowledgeBaseRevisionCommandProvider { // public methods public: //! Constructor CParseKRSSTestConceptOntologyCommand(CReadTextCommandProvider* textCommandProvider, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, const QString& testConName, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CParseKRSSTestConceptOntologyCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QString getOntologyKRSSText(); virtual QString getTestConceptNameString(); virtual COntologyRevision *getOntologyRevision(); virtual CCommand *getCommand(); // protected methods protected: // protected variables protected: QString mTestConName; CKnowledgeBaseRevisionCommandProvider *revProvider; CReadTextCommandProvider* mTextCommandProvider; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CParseKRSSTestConceptOntologyCommand_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseEntitiesCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseEntitiesCommand.0000644000175000017500000000557612520756340032267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CGETKNOWLEDGEBASEENTITIESCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CGETKNOWLEDGEBASEENTITIESCOMMAND_H // Libraries includes #include // Namespace includes #include "CKnowledgeBaseCommand.h" #include "CExtractedKnowledgeBaseEntitiesContainer.h" #include "CKnowledgeBaseEntitiesExtractionSpecification.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetKnowledgeBaseEntitiesCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetKnowledgeBaseEntitiesCommand : public CKnowledgeBaseCommand { // public methods public: //! Constructor CGetKnowledgeBaseEntitiesCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetKnowledgeBaseEntitiesCommand(); virtual QString getBriefCommandDescription(); virtual QString getKnowledgeBaseName(); virtual CExtractedKnowledgeBaseEntitiesContainer* getExtractedEntityContainer(); virtual CGetKnowledgeBaseEntitiesCommand* setExtractedEntityContainer(CExtractedKnowledgeBaseEntitiesContainer* extractedEntityContainer); virtual CKnowledgeBaseEntitiesExtractionSpecification* getEntityExtractionSpecification(); // protected methods protected: // protected variables protected: CExtractedKnowledgeBaseEntitiesContainer* mExtractedEntityContainer; QString kbString; CKnowledgeBaseEntitiesExtractionSpecification mExtractSpec; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CGETKNOWLEDGEBASEENTITIESCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CClassifyQueryCommand.cpp0000644000175000017500000000303612520756334030706 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassifyQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CClassifyQueryCommand::CClassifyQueryCommand(const QString& knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { } CClassifyQueryCommand::~CClassifyQueryCommand() { } qint64 CClassifyQueryCommand::getCommandTag() { return CLASSIFYQUERYCOMMAND; } QString CClassifyQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-Classify Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesDisjointQueryCommand.h0000644000175000017500000000454012520756334032330 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CARECLASSESDISJOINTQUERYCOMMAND_H #define KONCLUDE_Control_COMMAND_CARECLASSESDISJOINTQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Reasoner/Query/CAreClassesDisjointQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CAreClassesDisjointQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAreClassesDisjointQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CAreClassesDisjointQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CAreClassesDisjointQueryCommand(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CARECLASSESDISJOINTQUERYCOMMAND_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseKRSSTestConceptCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseKRSSTestConcept0000644000175000017500000000405312520756342032213 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLoadKnowledgeBaseKRSSTestConceptCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CLoadKnowledgeBaseKRSSTestConceptCommand::CLoadKnowledgeBaseKRSSTestConceptCommand(const QString &knowledgeBaseNameString, const QString& loadIRI, const QString& testConceptNames, CCommand *parentSuperCommand) : CLoadKnowledgeBaseCommand(knowledgeBaseNameString,parentSuperCommand) { mTestConcept = testConceptNames; mLoadIRI = loadIRI; } CLoadKnowledgeBaseKRSSTestConceptCommand::~CLoadKnowledgeBaseKRSSTestConceptCommand() { } qint64 CLoadKnowledgeBaseKRSSTestConceptCommand::getCommandTag() { return LOADKNOWLEDGEBASEKRSSTESTCONCEPTCOMMAND; } QString CLoadKnowledgeBaseKRSSTestConceptCommand::getBriefCommandDescription() { return QString("Load-'%1'-Knowledge-Base-KRSS-Test-Concept Command").arg(kbString); } QString CLoadKnowledgeBaseKRSSTestConceptCommand::getLoadIRIString() { return mLoadIRI; } QString CLoadKnowledgeBaseKRSSTestConceptCommand::getTestConceptNameString() { return mTestConcept; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSetKnowledgeBaseConfigCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSetKnowledgeBaseConfigCommand.cp0000644000175000017500000000350312520756346032241 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSetKnowledgeBaseConfigCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CSetKnowledgeBaseConfigCommand::CSetKnowledgeBaseConfigCommand(const QString &propertyName, const QString &propertyValue, const QString &knowlegdeBaseName, CCommand *parentSuperCommand) : CSetConfigCommand(propertyName,propertyValue,parentSuperCommand) { kbName = knowlegdeBaseName; } CSetKnowledgeBaseConfigCommand::~CSetKnowledgeBaseConfigCommand() { } qint64 CSetKnowledgeBaseConfigCommand::getCommandTag() { return SETKNOWLEDGEBASECONFIGURATIONCOMMAND; } CSetKnowledgeBaseConfigCommand *CSetKnowledgeBaseConfigCommand::setKnowlegeBaseName(const QString &knowlegdeBaseName) { kbName = knowlegdeBaseName; return this; } QString CSetKnowledgeBaseConfigCommand::getKnowlegeBaseString() { return kbName; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGenerateQueryCommand.h0000644000175000017500000000576312520756336030343 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CGENERATEQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CGENERATEQUERYCOMMAND_H // Libraries includes #include // Namespace includes #include "CQueryCommandProvider.h" #include "CQueryGeneratorCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Reasoner/Ontology/COntologyProcessingStepVector.h" #include "Reasoner/Ontology/COntologyProcessingRequirementExpander.h" #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Generator/CQueryBuilderGenerator.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Ontology; using namespace Reasoner::Generator; namespace Control { namespace Command { namespace Instructions { /*! * * \class CGenerateQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGenerateQueryCommand : public CPreconditionCommand, public CQueryCommandProvider { // public methods public: //! Constructor CGenerateQueryCommand(CQueryGeneratorCommandProvider* queryCommandProvider, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGenerateQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CQueryBuilderGenerator* getQueryGenerator(); virtual CCommand* getCommand(); virtual CQuery *getQuery(); virtual CGenerateQueryCommand *setQuery(CQuery *knowledgeBaseQuery); // protected methods protected: // protected variables protected: CQueryGeneratorCommandProvider* mQueryCommandProvider; CQuery* mQuery; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CGENERATEQUERYCOMMAND_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSaveOWL2XMLExtractedKnowledgeBaseCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSaveOWL2XMLExtractedKnowledgeBas0000644000175000017500000000406712520756346032110 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaveOWL2XMLExtractedKnowledgeBaseCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CSaveOWL2XMLExtractedKnowledgeBaseCommand::CSaveOWL2XMLExtractedKnowledgeBaseCommand(const QString &knowledgeBaseNameString, const QString& loadIRI, const QStringList& extractEntityNames, CCommand *parentSuperCommand) : CSaveKnowledgeBaseCommand(knowledgeBaseNameString,parentSuperCommand) { mEntityNames = extractEntityNames; mSaveIRI = loadIRI; } CSaveOWL2XMLExtractedKnowledgeBaseCommand::~CSaveOWL2XMLExtractedKnowledgeBaseCommand() { } qint64 CSaveOWL2XMLExtractedKnowledgeBaseCommand::getCommandTag() { return SAVEOWL2XMLKNOWLEDGEBASECOMMAND; } QString CSaveOWL2XMLExtractedKnowledgeBaseCommand::getBriefCommandDescription() { return QString("Save-'%1'-Extracted-Knowledge-Base-OWL-2-XML Command").arg(kbString); } QString CSaveOWL2XMLExtractedKnowledgeBaseCommand::getSaveIRIString() { return mSaveIRI; } QStringList CSaveOWL2XMLExtractedKnowledgeBaseCommand::getExtractEntitiyList() { return mEntityNames; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseOWL2XMLQueryCommand.cpp0000644000175000017500000000534512520756344031236 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CParseOWL2XMLQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CParseOWL2XMLQueryCommand::CParseOWL2XMLQueryCommand(const QDomElement &queryNode, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CParseOntologyCommand(parentSuperCommand) { node = queryNode; revProvider = ontologyRevisionProviderCommand; mQueryGenerator = 0; // default complex mComplex = true; addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CParseOWL2XMLQueryCommand::~CParseOWL2XMLQueryCommand() { delete mQueryGenerator; } qint64 CParseOWL2XMLQueryCommand::getCommandTag() { return PARSEOWL2XMLQUERYCOMMAND; } QString CParseOWL2XMLQueryCommand::getBriefCommandDescription() { return QString("Parse-OWL2-XML-Query Command"); } QDomElement CParseOWL2XMLQueryCommand::getQueryNode() { return node; } CCommand *CParseOWL2XMLQueryCommand::getCommand() { return this; } COntologyRevision *CParseOWL2XMLQueryCommand::getOntologyRevision() { COntologyRevision *rev = 0; if (revProvider) { rev = revProvider->getOntologyRevision(); } return rev; } bool CParseOWL2XMLQueryCommand::isComplexQuery() { return mComplex; } CParseOWL2XMLQueryCommand* CParseOWL2XMLQueryCommand::setQueryComplexity(bool complex) { mComplex = complex; return this; } CQueryBuilderGenerator* CParseOWL2XMLQueryCommand::getQueryGenerator() { return mQueryGenerator; } CParseOWL2XMLQueryCommand* CParseOWL2XMLQueryCommand::setQueryGenerator(CQueryBuilderGenerator* queryGenerator) { mQueryGenerator = queryGenerator; return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CReleaseKnowledgeBaseCommand.cpp0000644000175000017500000000332012520756346032115 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReleaseKnowledgeBaseCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CReleaseKnowledgeBaseCommand::CReleaseKnowledgeBaseCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseCommand(parentSuperCommand) { kbString = knowledgeBaseNameString; } CReleaseKnowledgeBaseCommand::~CReleaseKnowledgeBaseCommand() { } qint64 CReleaseKnowledgeBaseCommand::getCommandTag() { return RELEASEKNOWLEDGEBASECOMMAND; } QString CReleaseKnowledgeBaseCommand::getKnowledgeBaseName() { return kbString; } QString CReleaseKnowledgeBaseCommand::getBriefCommandDescription() { return QString("Release-'%1'-Knowledge-Base Command").arg(kbString); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsSatisfiableQueryOWL2XMLNodeCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsSatisfiableQueryOWL2XMLNodeCom0000644000175000017500000000350212520756342032062 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIsSatisfiableQueryOWL2XMLNodeCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CIsSatisfiableQueryOWL2XMLNodeCommand::CIsSatisfiableQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand) : CIsSatisfiableQueryCommand(knowledgeBaseNameString,parentSuperCommand) { node = queryNode; } CIsSatisfiableQueryOWL2XMLNodeCommand::~CIsSatisfiableQueryOWL2XMLNodeCommand() { } QString CIsSatisfiableQueryOWL2XMLNodeCommand::getBriefCommandDescription() { return QString("Knowledge-Base-SatisfiableQuery Command"); } QDomElement CIsSatisfiableQueryOWL2XMLNodeCommand::getQueryNode() { return node; } qint64 CIsSatisfiableQueryOWL2XMLNodeCommand::getCommandTag() { return SATISFIABLEQUERYKNOWLEDGEBASEOWL2XMLCOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteFunctionalSubClassHierarchyQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteFunctionalSubClassHierarchy0000644000175000017500000000511712520756346032444 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CWRITEFUNCTIONALSUBCLASSHIERARCHYQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CWRITEFUNCTIONALSUBCLASSHIERARCHYQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Reasoner/Query/CSubClassHierarchyQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CWriteFunctionalSubClassHierarchyQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteFunctionalSubClassHierarchyQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CWriteFunctionalSubClassHierarchyQueryCommand(const QString& knowledgeBaseNameString, const QString& outputFileString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CWriteFunctionalSubClassHierarchyQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); QString getOutputFileString(); // protected methods protected: // protected variables protected: QString mOutputFileString; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CWRITEFUNCTIONALSUBCLASSHIERARCHYQUERYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsInstanceOfQueryCommand.h0000644000175000017500000000446412520756342031130 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CISINSTANCEOFQUERYCOMMAND_H #define KONCLUDE_Control_COMMAND_CISINSTANCEOFQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Reasoner/Query/CIsClassSubsumedByQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CIsInstanceOfQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIsInstanceOfQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CIsInstanceOfQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CIsInstanceOfQueryCommand(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CISINSTANCEOFQUERYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSkipUnsupportedCommandCommand.h0000644000175000017500000000450312520756346032231 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CSKIPUNSUPPORTEDCOMMANDCOMMAND_H #define KONCLUDE_Control_COMMAND_CSKIPUNSUPPORTEDCOMMANDCOMMAND_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Other includes #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CSkipUnsupportedCommandCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSkipUnsupportedCommandCommand : public CPreconditionCommand { // public methods public: //! Constructor CSkipUnsupportedCommandCommand(QString &skippedCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CSkipUnsupportedCommandCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QString getSkippedCommandString(); // protected methods protected: // protected variables protected: QString sComm; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CSKIPUNSUPPORTEDCOMMANDCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseTestsuiteCommandsCommand.h0000644000175000017500000000446612520756344032227 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CPARSETESTSUITECOMMANDSCOMMAND_H #define KONCLUDE_Control_COMMAND_CPARSETESTSUITECOMMANDSCOMMAND_H // Libraries includes #include // Namespace includes #include "CParseCommandsCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CParseTestsuiteCommandsCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CParseTestsuiteCommandsCommand : public CParseCommandsCommand { // public methods public: //! Constructor CParseTestsuiteCommandsCommand(QByteArray *array, const QString &arraySourcePath = QString(), CCommand *parentSuperCommand = 0); //! Destructor virtual ~CParseTestsuiteCommandsCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: QString testsName; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CPARSETESTSUITECOMMANDSCOMMAND_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesEquivalentQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesEquivalentQueryCommand0000644000175000017500000000455712520756334032444 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CARECLASSESEQUIVALENTQUERYCOMMAND_H #define KONCLUDE_Control_COMMAND_CARECLASSESEQUIVALENTQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Reasoner/Query/CAreClassesEquivalentQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CAreClassesEquivalentQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAreClassesEquivalentQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CAreClassesEquivalentQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CAreClassesEquivalentQueryCommand(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CARECLASSESEQUIVALENTQUERYCOMMAND_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractToldExpressionsOntologyCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractToldExpressionsOntologyCo0000644000175000017500000000546512520756336032552 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CEXTRACTTOLDEXPRESSIONSONTOLOGYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CEXTRACTTOLDEXPRESSIONSONTOLOGYCOMMAND_H // Libraries includes #include // Namespace includes #include "CExtractOntologyCommand.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CExtractToldExpressionsOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExtractToldExpressionsOntologyCommand : public CExtractOntologyCommand { // public methods public: //! Constructor CExtractToldExpressionsOntologyCommand(COntologyRenderer* renderer, CKnowledgeBaseRevisionCommandProvider* kbRevProvider, const QStringList& entityList, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CExtractToldExpressionsOntologyCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual COntologyRenderer* getRenderer(); virtual CCommand *getCommand(); virtual COntologyRevision *getOntologyRevision(); QStringList getExtractionEntityList(); // protected methods protected: // protected variables protected: QStringList mEntityList; COntologyRenderer* mRenderer; CKnowledgeBaseRevisionCommandProvider* mKbRevProvider; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CEXTRACTTOLDEXPRESSIONSONTOLOGYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGenerateQueryCommand.cpp0000644000175000017500000000450012520756336030662 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGenerateQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGenerateQueryCommand::CGenerateQueryCommand(CQueryGeneratorCommandProvider* queryCommandProvider, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { mQuery = nullptr; mQueryCommandProvider = queryCommandProvider; if (queryCommandProvider) { addCommandPrecondition(new CCommandProcessedPrecondition(queryCommandProvider->getCommand())); } } CGenerateQueryCommand::~CGenerateQueryCommand() { delete mQuery; } qint64 CGenerateQueryCommand::getCommandTag() { return GENERATEQUERYCOMMANDCOMMAND; } QString CGenerateQueryCommand::getBriefCommandDescription() { return QString("Prepare-Knowledge-Base-For-Query Command"); } CQueryBuilderGenerator* CGenerateQueryCommand::getQueryGenerator() { CQueryBuilderGenerator* queryGenerator = nullptr; if (mQueryCommandProvider) { queryGenerator = mQueryCommandProvider->getQueryGenerator(); } return queryGenerator; } CQuery* CGenerateQueryCommand::getQuery() { return mQuery; } CCommand* CGenerateQueryCommand::getCommand() { return this; } CGenerateQueryCommand* CGenerateQueryCommand::setQuery(CQuery *knowledgeBaseQuery) { mQuery = knowledgeBaseQuery; return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CStreamParseOWL2FunctionalOntologyCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CStreamParseOWL2FunctionalOntolog0000644000175000017500000000564312520756346032313 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CSTREAMPARSEOWL2FUNCTIONALONTOLOGYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CSTREAMPARSEOWL2FUNCTIONALONTOLOGYCOMMAND_H // Libraries includes #include // Namespace includes #include "CParseOntologyCommand.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CReadXMLCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CStreamParseOWL2FunctionalOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CStreamParseOWL2FunctionalOntologyCommand : public CParseOntologyCommand, public CKnowledgeBaseRevisionCommandProvider { // public methods public: //! Constructor CStreamParseOWL2FunctionalOntologyCommand(const QString& sourceStringName, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CStreamParseOWL2FunctionalOntologyCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual COntologyRevision *getOntologyRevision(); virtual CCommand *getCommand(); virtual const QString& getSourceString(); // protected methods protected: // protected variables protected: CKnowledgeBaseRevisionCommandProvider *revProvider; CReadXMLCommandProvider* mXmlCommandProvider; QString mSourceString; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CSTREAMPARSEOWL2FUNCTIONALONTOLOGYCOMMAND_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseSettingsCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseSettingsCommand.0000644000175000017500000000361712520756340032275 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetKnowledgeBaseSettingsCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetKnowledgeBaseSettingsCommand::CGetKnowledgeBaseSettingsCommand(const QString &knowlegdeBaseName, CCommand *parentSuperCommand) : CGetSettingsCommand(parentSuperCommand) { kbName = knowlegdeBaseName; } CGetKnowledgeBaseSettingsCommand::~CGetKnowledgeBaseSettingsCommand() { } qint64 CGetKnowledgeBaseSettingsCommand::getCommandTag() { return GETKNOWLEGEBASESETTINGSCOMMAND; } QString CGetKnowledgeBaseSettingsCommand::getBriefCommandDescription() { return QString("Get-KnowlegeBase-Settings Command"); } CGetKnowledgeBaseSettingsCommand *CGetKnowledgeBaseSettingsCommand::setKnowlegeBaseName(const QString &knowlegdeBaseName) { kbName = knowlegdeBaseName; return this; } QString CGetKnowledgeBaseSettingsCommand::getKnowlegeBaseString() { return kbName; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSetConfigCommand.cpp0000644000175000017500000000365512520756346027776 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSetConfigCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CSetConfigCommand::CSetConfigCommand(const QString &propertyName, const QString &propertyValue, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { propName = propertyName; propValue = propertyValue; } CSetConfigCommand::~CSetConfigCommand() { } CSetConfigCommand *CSetConfigCommand::setConfig(const QString &propertyName, const QString &propertyValue) { propName = propertyName; propValue = propertyValue; return this; } QString CSetConfigCommand::getConfigNameString() { return propName; } QString CSetConfigCommand::getConfigValueString() { return propValue; } qint64 CSetConfigCommand::getCommandTag() { return SETCONFIGURATIONCOMMAND; } QString CSetConfigCommand::getBriefCommandDescription() { return QString("Set-'%1'-Config Command").arg(propName); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CCreateKnowledgeBaseRevisionUpdateCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CCreateKnowledgeBaseRevisionUpdat0000644000175000017500000000440312520756336032377 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCreateKnowledgeBaseRevisionUpdateCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CCreateKnowledgeBaseRevisionUpdateCommand::CCreateKnowledgeBaseRevisionUpdateCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseCommand(parentSuperCommand) { kbString = knowledgeBaseNameString; onRev = 0; } CCreateKnowledgeBaseRevisionUpdateCommand::~CCreateKnowledgeBaseRevisionUpdateCommand() { } qint64 CCreateKnowledgeBaseRevisionUpdateCommand::getCommandTag() { return CREATEKNOWLEDGEBASEREVISIONCOMMAND; } QString CCreateKnowledgeBaseRevisionUpdateCommand::getKnowledgeBaseName() { return kbString; } QString CCreateKnowledgeBaseRevisionUpdateCommand::getBriefCommandDescription() { return QString("Create-'%1'-Knowledge-Base-Revision-Update Command").arg(kbString); } COntologyRevision *CCreateKnowledgeBaseRevisionUpdateCommand::getOntologyRevision() { return onRev; } CCreateKnowledgeBaseRevisionUpdateCommand *CCreateKnowledgeBaseRevisionUpdateCommand::setOntologyRevision(COntologyRevision *ontologyRevision) { onRev = ontologyRevision; return this; } CCommand *CCreateKnowledgeBaseRevisionUpdateCommand::getCommand() { return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteFunctionalIndividualTypesQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteFunctionalIndividu0000644000175000017500000000614212520756336032544 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CCONSTRUCTWRITEFUNCTIONALINDIVIDUALTYPESQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CCONSTRUCTWRITEFUNCTIONALINDIVIDUALTYPESQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CQueryCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CConstructWriteFunctionalIndividualTypesQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConstructWriteFunctionalIndividualTypesQueryCommand : public CPreconditionCommand, public CQueryCommandProvider { // public methods public: //! Constructor CConstructWriteFunctionalIndividualTypesQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, const QString& outputFileString, const QString& individualName, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CConstructWriteFunctionalIndividualTypesQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual CQuery *getQuery(); virtual CConstructWriteFunctionalIndividualTypesQueryCommand *setQuery(CQuery *knowledgeBaseQuery); virtual COntologyRevision *getOntologyRevision(); QString getOutputFileName(); QString getIndividualName(); // protected methods protected: // protected variables protected: QString mOutputFileName; QString mIndividualName; CKnowledgeBaseRevisionCommandProvider *revProvider; CQuery *query; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CCONSTRUCTWRITEFUNCTIONALINDIVIDUALTYPESQUERYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseCommand.cpp0000644000175000017500000000310612520756342031412 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLoadKnowledgeBaseCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CLoadKnowledgeBaseCommand::CLoadKnowledgeBaseCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseCommand(parentSuperCommand) { kbString = knowledgeBaseNameString; } CLoadKnowledgeBaseCommand::~CLoadKnowledgeBaseCommand() { } QString CLoadKnowledgeBaseCommand::getBriefCommandDescription() { return QString("Load-Knowledge-Base Command").arg(kbString); } QString CLoadKnowledgeBaseCommand::getKnowledgeBaseName() { return kbString; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsTriviallyConsistentQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsTriviallyConsistentQueryComman0000644000175000017500000000322512520756342032530 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIsTriviallyConsistentQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CIsTriviallyConsistentQueryCommand::CIsTriviallyConsistentQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { } CIsTriviallyConsistentQueryCommand::~CIsTriviallyConsistentQueryCommand() { } QString CIsTriviallyConsistentQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-IsTriviallyConsistent Command"); } qint64 CIsTriviallyConsistentQueryCommand::getCommandTag() { return ISTRIVIALLYCONSISTENTKNOWLEDGEBASECOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CEvaluateTestsuiteCommand.h0000644000175000017500000000503312520756336031231 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CEVALUATETESTSUITECOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CEVALUATETESTSUITECOMMAND_H // Libraries includes #include // Namespace includes // Other includes #include "Test/Evaluation/CReasonerEvaluationProgram.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Test::Evaluation; namespace Control { namespace Command { namespace Instructions { /*! * * \class CEvaluateTestsuiteCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEvaluateTestsuiteCommand : public CPreconditionCommand { // public methods public: //! Constructor CEvaluateTestsuiteCommand(const QString& testName, CReasonerEvaluationProgram* evalProg, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CEvaluateTestsuiteCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); CReasonerEvaluationProgram* getEvaluationTestsuite(); CEvaluateTestsuiteCommand* setEvaluationTestsuite(CReasonerEvaluationProgram* testsuiteTest); // protected methods protected: // protected variables protected: QString mTestsName; CReasonerEvaluationProgram* mTestsuite; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CEVALUATETESTSUITECOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseClassifyCommand.cpp0000644000175000017500000000316412520756342032314 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CKnowledgeBaseClassifyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CKnowledgeBaseClassifyCommand::CKnowledgeBaseClassifyCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseProcessCommand(knowledgeBaseNameString,parentSuperCommand) { } CKnowledgeBaseClassifyCommand::~CKnowledgeBaseClassifyCommand() { } QString CKnowledgeBaseClassifyCommand::getBriefCommandDescription() { return QString("Knowledge-Base-'%1'-Classify Command").arg(kbString); } qint64 CKnowledgeBaseClassifyCommand::getCommandTag() { return PROCESSKNOWLEDGEBASECLASSIFYCOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLFunctionalOntologyCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLFunctionalOn0000644000175000017500000000527212520756342032242 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEOWLFUNCTIONALONTOLOGYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEOWLFUNCTIONALONTOLOGYCOMMAND_H // Libraries includes #include #include #include // Namespace includes #include "CLoadKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CLoadKnowledgeBaseOWLFunctionalOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLoadKnowledgeBaseOWLFunctionalOntologyCommand : public CLoadKnowledgeBaseCommand { // public methods public: //! Constructor CLoadKnowledgeBaseOWLFunctionalOntologyCommand(const QString &knowledgeBaseNameString, const QStringList& loadIRIs, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CLoadKnowledgeBaseOWLFunctionalOntologyCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QStringList getLoadIRIStrings(); virtual bool getLoadImports(); virtual QMap getOntologieIRIMappings(); // protected methods protected: // protected variables protected: QStringList mLoadIRIs; bool mLoadImports; QMap mOntoIRIMapping; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEOWLFUNCTIONALONTOLOGYCOMMAND_H ././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteFunctionalIndividualTypesQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteFunctionalIndividu0000644000175000017500000000577112520756336032553 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConstructWriteFunctionalIndividualTypesQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CConstructWriteFunctionalIndividualTypesQueryCommand::CConstructWriteFunctionalIndividualTypesQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, const QString& outputFileString, const QString& individualName, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { mOutputFileName = outputFileString; mIndividualName = individualName; revProvider = ontologyRevisionProviderCommand; query = 0; addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CConstructWriteFunctionalIndividualTypesQueryCommand::~CConstructWriteFunctionalIndividualTypesQueryCommand() { delete query; } qint64 CConstructWriteFunctionalIndividualTypesQueryCommand::getCommandTag() { return CONSTRUCTWRITEFUNCTIONALINDIVIDUALTYPESQUERYCOMMAND; } QString CConstructWriteFunctionalIndividualTypesQueryCommand::getBriefCommandDescription() { return QString("Construct-WriteFunctionalIndividualTypes-Query Command"); } CQuery *CConstructWriteFunctionalIndividualTypesQueryCommand::getQuery() { return query; } CCommand *CConstructWriteFunctionalIndividualTypesQueryCommand::getCommand() { return this; } CConstructWriteFunctionalIndividualTypesQueryCommand *CConstructWriteFunctionalIndividualTypesQueryCommand::setQuery(CQuery *knowledgeBaseQuery) { query = knowledgeBaseQuery; return this; } COntologyRevision *CConstructWriteFunctionalIndividualTypesQueryCommand::getOntologyRevision() { COntologyRevision *rev = 0; if (revProvider) { rev = revProvider->getOntologyRevision(); } return rev; } QString CConstructWriteFunctionalIndividualTypesQueryCommand::getOutputFileName() { return mOutputFileName; } QString CConstructWriteFunctionalIndividualTypesQueryCommand::getIndividualName() { return mIndividualName; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetReasonerCommand.h0000644000175000017500000000465612520756340027774 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CGETREASONERCOMMAND_H #define KONCLUDE_Control_COMMAND_CGETREASONERCOMMAND_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Reasoner/Kernel/Manager/CReasonerManager.h" // Other includes #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Kernel::Manager; namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetReasonerCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetReasonerCommand : public CPreconditionCommand { // public methods public: //! Constructor CGetReasonerCommand(CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetReasonerCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CReasonerManager *getReasonerManager(); virtual CGetReasonerCommand *setReasonerManager(CReasonerManager *reasonerManager); // protected methods protected: // protected variables protected: CReasonerManager *reasoner; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CGETREASONERCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseProcessCommand.cpp0000644000175000017500000000313712520756342032155 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CKnowledgeBaseProcessCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CKnowledgeBaseProcessCommand::CKnowledgeBaseProcessCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseCommand(parentSuperCommand) { kbString = knowledgeBaseNameString; } CKnowledgeBaseProcessCommand::~CKnowledgeBaseProcessCommand() { } QString CKnowledgeBaseProcessCommand::getBriefCommandDescription() { return QString("Knowledge-Base-Process Command").arg(kbString); } QString CKnowledgeBaseProcessCommand::getKnowledgeBaseName() { return kbString; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CPrepareKnowledgeBaseCommand.cpp0000644000175000017500000000611312520756344032134 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrepareKnowledgeBaseCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CPrepareKnowledgeBaseCommand::CPrepareKnowledgeBaseCommand(CKnowledgeBaseRevisionCommandProvider* ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { //COntologyProcessingStepVector* ontProStepVec = COntologyProcessingStepVector::getProcessingStepVectorInstance(); //mOntProReqList.append( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSBUILD), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) ); //mOntProReqList.append( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSPREPROCESS), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) ); mRevProvider = ontologyRevisionProviderCommand; } CPrepareKnowledgeBaseCommand::~CPrepareKnowledgeBaseCommand() { qDeleteAll(mOntProReqList); } QString CPrepareKnowledgeBaseCommand::getBriefCommandDescription() { return QString("Prepare-Knowledge-Base Command"); } QList* CPrepareKnowledgeBaseCommand::getOntologyProcessingRequirementList() { return &mOntProReqList; } CConcreteOntology* CPrepareKnowledgeBaseCommand::getOntology() { CConcreteOntology* ontology = nullptr; COntologyRevision* ontoRev = nullptr; if (mRevProvider) { ontoRev = mRevProvider->getOntologyRevision(); } if (ontoRev) { ontology = ontoRev->getOntology(); } return ontology; } COntologyRevision* CPrepareKnowledgeBaseCommand::getOntologyRevision() { return mRevProvider->getOntologyRevision(); } CPrepareKnowledgeBaseCommand* CPrepareKnowledgeBaseCommand::addRequirement(COntologyProcessingStepRequirement* requirement) { mOntProReqList.append(requirement); return this; } qint64 CPrepareKnowledgeBaseCommand::getCommandTag() { return PREPAREKNOWLEDGEBASEFORQUERYCOMMANDCOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CProcessQueryOWL2XMLNodeCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CProcessQueryOWL2XMLNodeCommand.c0000644000175000017500000000340512520756344032043 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessQueryOWL2XMLNodeCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CProcessQueryOWL2XMLNodeCommand::CProcessQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand) : CProcessQueryCommand(knowledgeBaseNameString,parentSuperCommand) { node = queryNode; } CProcessQueryOWL2XMLNodeCommand::~CProcessQueryOWL2XMLNodeCommand() { } QString CProcessQueryOWL2XMLNodeCommand::getBriefCommandDescription() { return QString("Process-Knowledge-Base-Query Command"); } QDomElement CProcessQueryOWL2XMLNodeCommand::getQueryNode() { return node; } qint64 CProcessQueryOWL2XMLNodeCommand::getCommandTag() { return PROCESSQUERYKNOWLEDGEBASEOWL2XMLCOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructRealizeQueryCommand.h0000644000175000017500000000534512520756336032105 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CCONSTRUCTREALIZEQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CCONSTRUCTREALIZEQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CQueryCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CConstructRealizeQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConstructRealizeQueryCommand : public CPreconditionCommand, public CQueryCommandProvider { // public methods public: //! Constructor CConstructRealizeQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CConstructRealizeQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual CQuery *getQuery(); virtual CConstructRealizeQueryCommand *setQuery(CQuery *knowledgeBaseQuery); virtual COntologyRevision *getOntologyRevision(); // protected methods protected: // protected variables protected: CKnowledgeBaseRevisionCommandProvider *revProvider; CQuery *query; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CCONSTRUCTREALIZEQUERYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CParseOWL2XMLOntologyCommand.cpp0000644000175000017500000000536012520756344031740 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CParseOWL2XMLOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CParseOWL2XMLOntologyCommand::CParseOWL2XMLOntologyCommand(const QDomElement &ontologyNode, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CParseOntologyCommand(parentSuperCommand) { node = ontologyNode; revProvider = ontologyRevisionProviderCommand; addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CParseOWL2XMLOntologyCommand::CParseOWL2XMLOntologyCommand(CReadXMLCommandProvider* xmlCommandProvider, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CParseOntologyCommand(parentSuperCommand) { mXmlCommandProvider = xmlCommandProvider; revProvider = ontologyRevisionProviderCommand; //addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); addCommandPrecondition(new CCommandProcessedPrecondition(xmlCommandProvider->getCommand())); } CParseOWL2XMLOntologyCommand::~CParseOWL2XMLOntologyCommand() { } qint64 CParseOWL2XMLOntologyCommand::getCommandTag() { return PARSEOWL2XMLONTOLOGYCOMMAND; } QString CParseOWL2XMLOntologyCommand::getBriefCommandDescription() { return QString("Parse-OWL2-XML-Ontology Command"); } QDomElement CParseOWL2XMLOntologyCommand::getOntologyNode() { if (node.isNull() && mXmlCommandProvider) { node = mXmlCommandProvider->getReadXMLNode(); } return node; } COntologyRevision *CParseOWL2XMLOntologyCommand::getOntologyRevision() { return revProvider->getOntologyRevision(); } CCommand *CParseOWL2XMLOntologyCommand::getCommand() { return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSetConfigCommand.h0000644000175000017500000000467112520756346027442 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CSETCONFIGCOMMAND_H #define KONCLUDE_Control_COMMAND_CSETCONFIGCOMMAND_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Other includes #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CSetConfigCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSetConfigCommand : public CPreconditionCommand { // public methods public: //! Constructor CSetConfigCommand(const QString &propertyName, const QString &propertyValue, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CSetConfigCommand(); virtual CSetConfigCommand *setConfig(const QString &propertyName, const QString &propertyValue); virtual QString getConfigNameString(); virtual QString getConfigValueString(); virtual QString getBriefCommandDescription(); virtual qint64 getCommandTag(); // protected methods protected: // protected variables protected: QString propName; QString propValue; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CSETCONFIGCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsInstanceOfQueryCommand.cpp0000644000175000017500000000273212520756340031455 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIsInstanceOfQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CIsInstanceOfQueryCommand::CIsInstanceOfQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { } CIsInstanceOfQueryCommand::~CIsInstanceOfQueryCommand() { } QString CIsInstanceOfQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-Instance Query Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CReadTextCommandProvider.h0000644000175000017500000000424212520756344031004 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CREADTEXTCOMMANDPROVIDER_H #define KONCLUDE_CONTROL_COMMAND_CREADTEXTCOMMANDPROVIDER_H // Libraries includes #include // Namespace includes // Other includes #include "Reasoner/Revision/COntologyRevision.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Revision; namespace Control { namespace Command { namespace Instructions { /*! * * \class CReadTextCommandProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReadTextCommandProvider { // public methods public: //! Constructor CReadTextCommandProvider(); //! Destructor virtual ~CReadTextCommandProvider(); virtual QString getReadText() = 0; virtual CCommand *getCommand() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CREADTEXTCOMMANDPROVIDER_H ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseNamedIndividualEntitiesCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseNamedIndividualE0000644000175000017500000000376612520756340032267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetKnowledgeBaseNamedIndividualEntitiesCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetKnowledgeBaseNamedIndividualEntitiesCommand::CGetKnowledgeBaseNamedIndividualEntitiesCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CGetKnowledgeBaseEntitiesCommand(knowledgeBaseNameString,parentSuperCommand) { mExtractSpec.setEntityExtractionFlags(CKnowledgeBaseEntitiesExtractionSpecification::EXTRACTINDIVIDUALSENTITIES); mExtractedEntityContainer = new CExtractedKnowledgeBaseEntitiesContainer(); } CGetKnowledgeBaseNamedIndividualEntitiesCommand::~CGetKnowledgeBaseNamedIndividualEntitiesCommand() { delete mExtractedEntityContainer; } qint64 CGetKnowledgeBaseNamedIndividualEntitiesCommand::getCommandTag() { return EXTRACTKNOWLEDGEBASENAMEDINDIVIDUALENTITIESCOMMAND; } QString CGetKnowledgeBaseNamedIndividualEntitiesCommand::getBriefCommandDescription() { return QString("Get-Knowledge-Base-NamedIndiviual-Entities Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseCommand.cpp0000644000175000017500000000256512520756342030622 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CKnowledgeBaseCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CKnowledgeBaseCommand::CKnowledgeBaseCommand(CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { } CKnowledgeBaseCommand::~CKnowledgeBaseCommand() { } QString CKnowledgeBaseCommand::getBriefCommandDescription() { return QString("Unknown-Knowledge-Base Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSAXParseOWL2XMLOntologyCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSAXParseOWL2XMLOntologyCommand.c0000644000175000017500000000422412520756346031754 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSAXParseOWL2XMLOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CSAXParseOWL2XMLOntologyCommand::CSAXParseOWL2XMLOntologyCommand(const QString& sourceStringName, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CParseOntologyCommand(parentSuperCommand) { mSourceString = sourceStringName; revProvider = ontologyRevisionProviderCommand; //addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CSAXParseOWL2XMLOntologyCommand::~CSAXParseOWL2XMLOntologyCommand() { } qint64 CSAXParseOWL2XMLOntologyCommand::getCommandTag() { return SAXPARSEOWL2XMLONTOLOGYCOMMAND; } QString CSAXParseOWL2XMLOntologyCommand::getBriefCommandDescription() { return QString("SAX-Parse-OWL2-XML-Ontology Command"); } const QString& CSAXParseOWL2XMLOntologyCommand::getSourceString() { return mSourceString; } COntologyRevision* CSAXParseOWL2XMLOntologyCommand::getOntologyRevision() { return revProvider->getOntologyRevision(); } CCommand *CSAXParseOWL2XMLOntologyCommand::getCommand() { return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CTestTestfileCommand.h0000644000175000017500000000447412520756346030201 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CTESTTESTFILECOMMAND_H #define KONCLUDE_Control_COMMAND_CTESTTESTFILECOMMAND_H // Libraries includes #include // Namespace includes // Other includes #include "Test/CReasonerTestfileTest.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Test; namespace Control { namespace Command { namespace Instructions { /*! * * \class CTestTestfileCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTestTestfileCommand : public CPreconditionCommand { // public methods public: //! Constructor CTestTestfileCommand(CReasonerTestfileTest *reasonerTest, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CTestTestfileCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CReasonerTestfileTest *getReasonerTestfileTest(); // protected methods protected: // protected variables protected: CReasonerTestfileTest *test; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CTESTTESTFILECOMMAND_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractKnowledgeBaseEntitiesCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractKnowledgeBaseEntitiesComm0000644000175000017500000000521612520756336032415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExtractKnowledgeBaseEntitiesCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CExtractKnowledgeBaseEntitiesCommand::CExtractKnowledgeBaseEntitiesCommand(CExtractedKnowledgeBaseEntitiesContainer* extractionContainer, CKnowledgeBaseEntitiesExtractionSpecification* extractSpec, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { revProvider = ontologyRevisionProviderCommand; if (revProvider) { addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } mExtractSpec = extractSpec; mExtractionContainer = extractionContainer; } CExtractKnowledgeBaseEntitiesCommand::~CExtractKnowledgeBaseEntitiesCommand() { } qint64 CExtractKnowledgeBaseEntitiesCommand::getCommandTag() { return EXTRACTKNOWLEDGEBASEENTITIESCOMMAND; } QString CExtractKnowledgeBaseEntitiesCommand::getBriefCommandDescription() { return QString("Extract-Knowledge-Base-Entities Command"); } CCommand *CExtractKnowledgeBaseEntitiesCommand::getCommand() { return this; } COntologyRevision *CExtractKnowledgeBaseEntitiesCommand::getOntologyRevision() { COntologyRevision *rev = 0; if (revProvider) { rev = revProvider->getOntologyRevision(); } return rev; } CKnowledgeBaseEntitiesExtractionSpecification* CExtractKnowledgeBaseEntitiesCommand::getEntitiesExtractionSpecification() { return mExtractSpec; } CExtractedKnowledgeBaseEntitiesContainer* CExtractKnowledgeBaseEntitiesCommand::getExtractionContainer() { return mExtractionContainer; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseAllDownloadedContinuer.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseAllDownloadedCo0000644000175000017500000000355012520756342032251 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLoadKnowledgeBaseAllDownloadedContinuer.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CLoadKnowledgeBaseAllDownloadedContinuer::CLoadKnowledgeBaseAllDownloadedContinuer(CCommandDelegater* commDelegater) { mDelegateCommand = nullptr; mCommDelegater = commDelegater; } CLoadKnowledgeBaseAllDownloadedContinuer* CLoadKnowledgeBaseAllDownloadedContinuer::setDelegateCommand(CCommand* delegateCommand) { mDelegateCommand = delegateCommand; return this; } CLoadKnowledgeBaseAllDownloadedContinuer* CLoadKnowledgeBaseAllDownloadedContinuer::setDownloadRequiredCount(cint64 count) { mCount = count; return this; } bool CLoadKnowledgeBaseAllDownloadedContinuer::nextDownloadCompleted() { if (--mCount == 0) { mCommDelegater->delegateCommand(mDelegateCommand); delete this; return true; } return false; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CReadXMLCommand.h0000644000175000017500000000470112520756344027005 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CREADXMLCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CREADXMLCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CReadXMLCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CReadXMLCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReadXMLCommand : public CPreconditionCommand, public CReadXMLCommandProvider { // public methods public: //! Constructor CReadXMLCommand(const QString& iriString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CReadXMLCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QString getIRIString(); virtual QDomElement getReadXMLNode(); virtual CCommand *getCommand(); virtual CReadXMLCommand* setReadXMLNode(const QDomElement& xmlNode); // protected methods protected: // protected variables protected: QString mIRIString; QDomElement mElement; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CREADXMLCOMMAND_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesEquivalentQueryOWL2XMLNodeCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesEquivalentQueryOWL2XML0000644000175000017500000000507612520756334032167 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CARECLASSESEQUIVALENTQUERYOWL2XMLNODECOMMAND_H #define KONCLUDE_Control_COMMAND_CARECLASSESEQUIVALENTQUERYOWL2XMLNODECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CAreClassesEquivalentQueryCommand.h" #include "CCalculateQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CAreClassesEquivalentQueryOWL2XMLNodeCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAreClassesEquivalentQueryOWL2XMLNodeCommand : public CAreClassesEquivalentQueryCommand { // public methods public: //! Constructor CAreClassesEquivalentQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CAreClassesEquivalentQueryOWL2XMLNodeCommand(); virtual QString getBriefCommandDescription(); virtual qint64 getCommandTag(); virtual QDomElement getQueryNode(); // protected methods protected: // protected variables protected: QDomElement node; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CARECLASSESEQUIVALENTQUERYOWL2XMLNODECOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CSaveKnowledgeBaseCommand.cpp0000644000175000017500000000310612520756346031435 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSaveKnowledgeBaseCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CSaveKnowledgeBaseCommand::CSaveKnowledgeBaseCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseCommand(parentSuperCommand) { kbString = knowledgeBaseNameString; } CSaveKnowledgeBaseCommand::~CSaveKnowledgeBaseCommand() { } QString CSaveKnowledgeBaseCommand::getBriefCommandDescription() { return QString("Save-Knowledge-Base Command").arg(kbString); } QString CSaveKnowledgeBaseCommand::getKnowledgeBaseName() { return kbString; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractedKnowledgeBaseEntitiesContainer.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractedKnowledgeBaseEntitiesCo0000644000175000017500000000433512520756336032375 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CEXTRACTEDKNOWLEDGEBASEENTITIESCONTAINER_H #define KONCLUDE_CONTROL_COMMAND_CEXTRACTEDKNOWLEDGEBASEENTITIESCONTAINER_H // Libraries includes #include // Namespace includes // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Renderer/COntologyRenderer.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Renderer; namespace Control { namespace Command { namespace Instructions { /*! * * \class CExtractedKnowledgeBaseEntitiesContainer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExtractedKnowledgeBaseEntitiesContainer { // public methods public: //! Constructor CExtractedKnowledgeBaseEntitiesContainer(); QStringList* getExtractedEntityList(); CExtractedKnowledgeBaseEntitiesContainer* addExtractedEntity(const QString& entityName); // protected methods protected: // protected variables protected: QStringList mExtractedEntityList; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CEXTRACTEDKNOWLEDGEBASEENTITIESCONTAINER_H ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteFunctionalSubClassHirarchyQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructWriteFunctionalSubClass0000644000175000017500000000551112520756336032507 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConstructWriteFunctionalSubClassHirarchyQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CConstructWriteFunctionalSubClassHirarchyQueryCommand::CConstructWriteFunctionalSubClassHirarchyQueryCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, const QString& outputFileString, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { mOutputFileName = outputFileString; revProvider = ontologyRevisionProviderCommand; query = 0; addCommandPrecondition(new CCommandProcessedPrecondition(revProvider->getCommand())); } CConstructWriteFunctionalSubClassHirarchyQueryCommand::~CConstructWriteFunctionalSubClassHirarchyQueryCommand() { delete query; } qint64 CConstructWriteFunctionalSubClassHirarchyQueryCommand::getCommandTag() { return CONSTRUCTWRITEFUNCTIONALSUBCLASSHIERARCHYQUERYCOMMAND; } QString CConstructWriteFunctionalSubClassHirarchyQueryCommand::getBriefCommandDescription() { return QString("Construct-WriteFunctionalSubClassHierarchy-Query Command"); } CQuery *CConstructWriteFunctionalSubClassHirarchyQueryCommand::getQuery() { return query; } CCommand *CConstructWriteFunctionalSubClassHirarchyQueryCommand::getCommand() { return this; } CConstructWriteFunctionalSubClassHirarchyQueryCommand *CConstructWriteFunctionalSubClassHirarchyQueryCommand::setQuery(CQuery *knowledgeBaseQuery) { query = knowledgeBaseQuery; return this; } COntologyRevision *CConstructWriteFunctionalSubClassHirarchyQueryCommand::getOntologyRevision() { COntologyRevision *rev = 0; if (revProvider) { rev = revProvider->getOntologyRevision(); } return rev; } QString CConstructWriteFunctionalSubClassHirarchyQueryCommand::getOutputFileName() { return mOutputFileName; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsTriviallyConsistentQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsTriviallyConsistentQueryComman0000644000175000017500000000454512520756342032536 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CISTRIVIALLYCONSISTENTQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CISTRIVIALLYCONSISTENTQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CIsTriviallyConsistentQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIsTriviallyConsistentQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CIsTriviallyConsistentQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CIsTriviallyConsistentQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CISTRIVIALLYCONSISTENTQUERYCOMMAND_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CProcessClassNameSatisfiableQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CProcessClassNameSatisfiableQuery0000644000175000017500000000360012520756344032423 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessClassNameSatisfiableQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CProcessClassNameSatisfiableQueryCommand::CProcessClassNameSatisfiableQueryCommand(const QString &knowledgeBaseNameString, const QString& className, CCommand *parentSuperCommand) : CProcessQueryCommand(knowledgeBaseNameString,parentSuperCommand) { mClassNameString = className; } CProcessClassNameSatisfiableQueryCommand::~CProcessClassNameSatisfiableQueryCommand() { } QString CProcessClassNameSatisfiableQueryCommand::getBriefCommandDescription() { return QString("Process-Knowledge-Base-Class-Name-Satisfiable-Query Command"); } QString CProcessClassNameSatisfiableQueryCommand::getClassName() { return mClassNameString; } qint64 CProcessClassNameSatisfiableQueryCommand::getCommandTag() { return PROCESSCLASSNAMESATISFIABLEQUERYKNOWLEDGEBASECOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseClassEntitiesCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseClassEntitiesCom0000644000175000017500000000434412520756340032327 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CGETKNOWLEDGEBASECLASSENTITIESCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CGETKNOWLEDGEBASECLASSENTITIESCOMMAND_H // Libraries includes // Namespace includes #include "CGetKnowledgeBaseEntitiesCommand.h" // Other includes #include "Control/Command/CommandSettings.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetKnowledgeBaseClassEntitiesCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetKnowledgeBaseClassEntitiesCommand : public CGetKnowledgeBaseEntitiesCommand { // public methods public: //! Constructor CGetKnowledgeBaseClassEntitiesCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetKnowledgeBaseClassEntitiesCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CGETKNOWLEDGEBASECLASSENTITIESCOMMAND_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLAutoOntologyCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLAutoOntology0000644000175000017500000000417112520756342032303 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLoadKnowledgeBaseOWLAutoOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CLoadKnowledgeBaseOWLAutoOntologyCommand::CLoadKnowledgeBaseOWLAutoOntologyCommand(const QString &knowledgeBaseNameString, const QStringList& loadIRIs, CCommand *parentSuperCommand) : CLoadKnowledgeBaseCommand(knowledgeBaseNameString,parentSuperCommand) { mLoadIRIs = loadIRIs; } CLoadKnowledgeBaseOWLAutoOntologyCommand::~CLoadKnowledgeBaseOWLAutoOntologyCommand() { } qint64 CLoadKnowledgeBaseOWLAutoOntologyCommand::getCommandTag() { return LOADKNOWLEDGEBASEOWLAUTOSELECTIONONTOLOGYCOMMAND; } QString CLoadKnowledgeBaseOWLAutoOntologyCommand::getBriefCommandDescription() { return QString("Load-'%1'-Knowledge-Base-OWL-Auto-Selection-Ontology Command").arg(kbString); } QStringList CLoadKnowledgeBaseOWLAutoOntologyCommand::getLoadIRIStrings() { return mLoadIRIs; } bool CLoadKnowledgeBaseOWLAutoOntologyCommand::getLoadImports() { return mLoadImports; } QMap CLoadKnowledgeBaseOWLAutoOntologyCommand::getOntologieIRIMappings() { return mOntoIRIMapping; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseObjectPropertyEntitiesCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseObjectPropertyEn0000644000175000017500000000444312520756340032354 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CGETKNOWLEDGEBASEOBJECTPROPERTYENTITIESCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CGETKNOWLEDGEBASEOBJECTPROPERTYENTITIESCOMMAND_H // Libraries includes // Namespace includes #include "CGetKnowledgeBaseEntitiesCommand.h" // Other includes #include "Control/Command/CommandSettings.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetKnowledgeBaseObjectPropertyEntitiesCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetKnowledgeBaseObjectPropertyEntitiesCommand : public CGetKnowledgeBaseEntitiesCommand { // public methods public: //! Constructor CGetKnowledgeBaseObjectPropertyEntitiesCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetKnowledgeBaseObjectPropertyEntitiesCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CGETKNOWLEDGEBASEOBJECTPROPERTYENTITIESCOMMAND_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CProcessClassNameSatisfiableQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CProcessClassNameSatisfiableQuery0000644000175000017500000000474412520756344032435 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CPROCESSCLASSNAMESATISFIABLEQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CPROCESSCLASSNAMESATISFIABLEQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CProcessQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CProcessClassNameSatisfiableQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessClassNameSatisfiableQueryCommand : public CProcessQueryCommand { // public methods public: //! Constructor CProcessClassNameSatisfiableQueryCommand(const QString &knowledgeBaseNameString, const QString& className, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CProcessClassNameSatisfiableQueryCommand(); virtual QString getBriefCommandDescription(); virtual qint64 getCommandTag(); virtual QString getClassName(); // protected methods protected: // protected variables protected: QString mClassNameString; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CPROCESSCLASSNAMESATISFIABLEQUERYCOMMAND_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseKRSSTestConceptCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseKRSSTestConcept0000644000175000017500000000506512520756342032217 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEKRSSTESTCONCEPTCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEKRSSTESTCONCEPTCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CLoadKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CLoadKnowledgeBaseKRSSTestConceptCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLoadKnowledgeBaseKRSSTestConceptCommand : public CLoadKnowledgeBaseCommand { // public methods public: //! Constructor CLoadKnowledgeBaseKRSSTestConceptCommand(const QString &knowledgeBaseNameString, const QString& loadIRI, const QString& testConceptNames, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CLoadKnowledgeBaseKRSSTestConceptCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QString getLoadIRIString(); virtual QString getTestConceptNameString(); // protected methods protected: // protected variables protected: QString mLoadIRI; QString mTestConcept; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CLOADKNOWLEDGEBASEKRSSTESTCONCEPTCOMMAND_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetSubClassHierarchyQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetSubClassHierarchyQueryCommand0000644000175000017500000000455412520756340032371 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CGETSUBCLASSHIERARCHYQUERYCOMMAND_H #define KONCLUDE_Control_COMMAND_CGETSUBCLASSHIERARCHYQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Reasoner/Query/CSubClassHierarchyQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetSubClassHierarchyQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetSubClassHierarchyQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CGetSubClassHierarchyQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetSubClassHierarchyQueryCommand(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CGETSUBCLASSHIERARCHYQUERYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CBuildQueryCommand.h0000644000175000017500000000516412520756334027641 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CBuildQueryCommand_H #define KONCLUDE_Control_COMMAND_CBuildQueryCommand_H // Libraries includes #include #include // Namespace includes #include "CParseOntologyCommand.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CQueryCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CBuildQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBuildQueryCommand : public CPreconditionCommand, public CQueryCommandProvider { // public methods public: //! Constructor CBuildQueryCommand(CQueryCommandProvider *queryCommandProvider = 0, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CBuildQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual CQuery *getQuery(); virtual CBuildQueryCommand *setQueryCommandProvider(CQueryCommandProvider *queryCommandProvider); // protected methods protected: // protected variables protected: CQueryCommandProvider *queryProvider; CQuery *query; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CBuildQueryCommand_H ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CPrepareKnowledgeBaseForRevisionCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CPrepareKnowledgeBaseForRevisionC0000644000175000017500000000561112520756344032347 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CPREPAREKNOWLEDGEBASEFORREVISIONCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CPREPAREKNOWLEDGEBASEFORREVISIONCOMMAND_H // Libraries includes #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CPrepareKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" #include "Reasoner/Ontology/COntologyProcessingRequirement.h" #include "Reasoner/Ontology/COntologyProcessingStepVector.h" #include "Reasoner/Ontology/COntologyProcessingRequirementExpander.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Ontology; namespace Control { namespace Command { namespace Instructions { /*! * * \class CPrepareKnowledgeBaseForRevisionCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPrepareKnowledgeBaseForRevisionCommand : public CPrepareKnowledgeBaseCommand { // public methods public: //! Constructor CPrepareKnowledgeBaseForRevisionCommand(CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CPrepareKnowledgeBaseForRevisionCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CPrepareKnowledgeBaseForRevisionCommand* addOntologyProcessingStepRequirement(COntologyProcessingStepRequirement* requirement); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CPREPAREKNOWLEDGEBASEFORREVISIONCOMMAND_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetSubClassHierarchyQueryOWL2XMLNodeCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetSubClassHierarchyQueryOWL2XML0000644000175000017500000000507612520756340032117 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CGETSUBCLASSHIERARCHYQUERYOWL2XMLNODECOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CGETSUBCLASSHIERARCHYQUERYOWL2XMLNODECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CGetSubClassHierarchyQueryCommand.h" #include "CCalculateQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetSubClassHierarchyQueryOWL2XMLNodeCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetSubClassHierarchyQueryOWL2XMLNodeCommand : public CGetSubClassHierarchyQueryCommand { // public methods public: //! Constructor CGetSubClassHierarchyQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetSubClassHierarchyQueryOWL2XMLNodeCommand(); virtual QString getBriefCommandDescription(); virtual qint64 getCommandTag(); virtual QDomElement getQueryNode(); // protected methods protected: // protected variables protected: QDomElement node; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CGETSUBCLASSHIERARCHYQUERYOWL2XMLNODECOMMAND_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseLanguageCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseLanguageCommand.0000644000175000017500000000370712520756340032220 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetKnowledgeBaseLanguageCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetKnowledgeBaseLanguageCommand::CGetKnowledgeBaseLanguageCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseCommand(parentSuperCommand) { kbString = knowledgeBaseNameString; } CGetKnowledgeBaseLanguageCommand::~CGetKnowledgeBaseLanguageCommand() { } QString CGetKnowledgeBaseLanguageCommand::getBriefCommandDescription() { return QString("Get-Knowledge-Base-Language Command"); } QString CGetKnowledgeBaseLanguageCommand::getKnowledgeBaseName() { return kbString; } QString* CGetKnowledgeBaseLanguageCommand::getLanguageStringPointer() { return &mLanguageString; } const QString& CGetKnowledgeBaseLanguageCommand::getLanguageString() { return mLanguageString; } qint64 CGetKnowledgeBaseLanguageCommand::getCommandTag() { return GETKNOWLEDGEBASELANGUAGECOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsConsistentQueryCommand.cpp0000644000175000017500000000310412520756340031547 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIsConsistentQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CIsConsistentQueryCommand::CIsConsistentQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { } CIsConsistentQueryCommand::~CIsConsistentQueryCommand() { } QString CIsConsistentQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-IsConsistent Command"); } qint64 CIsConsistentQueryCommand::getCommandTag() { return ISCONSISTENTKNOWLEDGEBASECOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CEvaluateTestsuiteCommand.cpp0000644000175000017500000000364612520756336031574 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEvaluateTestsuiteCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CEvaluateTestsuiteCommand::CEvaluateTestsuiteCommand(const QString& testName, CReasonerEvaluationProgram* evalProg, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { mTestsuite = evalProg; mTestsName = testName; } CEvaluateTestsuiteCommand::~CEvaluateTestsuiteCommand() { } qint64 CEvaluateTestsuiteCommand::getCommandTag() { return EVALUATETESTSUITECOMMAND; } QString CEvaluateTestsuiteCommand::getBriefCommandDescription() { return QString("Evaluate-'%1'-Testsuite Command").arg(mTestsName); } CReasonerEvaluationProgram* CEvaluateTestsuiteCommand::getEvaluationTestsuite() { return mTestsuite; } CEvaluateTestsuiteCommand* CEvaluateTestsuiteCommand::setEvaluationTestsuite(CReasonerEvaluationProgram* testsuiteTest) { mTestsuite = testsuiteTest; return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseEntitiesCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetKnowledgeBaseEntitiesCommand.0000644000175000017500000000432712520756340032260 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetKnowledgeBaseEntitiesCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetKnowledgeBaseEntitiesCommand::CGetKnowledgeBaseEntitiesCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseCommand(parentSuperCommand) { kbString = knowledgeBaseNameString; mExtractedEntityContainer = nullptr; } CGetKnowledgeBaseEntitiesCommand::~CGetKnowledgeBaseEntitiesCommand() { } QString CGetKnowledgeBaseEntitiesCommand::getBriefCommandDescription() { return QString("Get-Knowledge-Base-Entities Command"); } QString CGetKnowledgeBaseEntitiesCommand::getKnowledgeBaseName() { return kbString; } CExtractedKnowledgeBaseEntitiesContainer* CGetKnowledgeBaseEntitiesCommand::getExtractedEntityContainer() { return mExtractedEntityContainer; } CGetKnowledgeBaseEntitiesCommand* CGetKnowledgeBaseEntitiesCommand::setExtractedEntityContainer(CExtractedKnowledgeBaseEntitiesContainer* extractedEntityContainer) { mExtractedEntityContainer = extractedEntityContainer; return this; } CKnowledgeBaseEntitiesExtractionSpecification* CGetKnowledgeBaseEntitiesCommand::getEntityExtractionSpecification() { return &mExtractSpec; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CTestTestsuiteCommand.cpp0000644000175000017500000000372112520756346030740 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTestTestsuiteCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CTestTestsuiteCommand::CTestTestsuiteCommand(const QString &testsuiteNameString, CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { testsName = testsuiteNameString; testsuite = 0; } CTestTestsuiteCommand::~CTestTestsuiteCommand() { if (testsuite) { delete testsuite; } } qint64 CTestTestsuiteCommand::getCommandTag() { return TESTTESTSUITECOMMAND; } QString CTestTestsuiteCommand::getTestsuiteName() { return testsName; } QString CTestTestsuiteCommand::getBriefCommandDescription() { return QString("Test-'%1'-Testsuite Command").arg(testsName); } CReasonerTestsuiteTest *CTestTestsuiteCommand::getTestsuiteTest() { return testsuite; } CTestTestsuiteCommand *CTestTestsuiteCommand::setTestsuiteTest(CReasonerTestsuiteTest *testsuiteTest) { testsuite = testsuiteTest; return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseQueryCommand.h0000644000175000017500000000563512520756342031316 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CKNOWLEDGEBASEQUERYCOMMAND_H #define KONCLUDE_Control_COMMAND_CKNOWLEDGEBASEQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseCommand.h" #include "CCalculateQueryCommand.h" #include "CBuildQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CKnowledgeBaseQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CKnowledgeBaseQueryCommand : public CKnowledgeBaseCommand { // public methods public: //! Constructor CKnowledgeBaseQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CKnowledgeBaseQueryCommand(); virtual QString getBriefCommandDescription(); virtual QString getKnowledgeBaseName(); virtual CCalculateQueryCommand *getCalculateQueryCommand(); virtual CKnowledgeBaseQueryCommand *setCalculateQueryCommand(CCalculateQueryCommand *calculateQueryCommand); virtual bool isComplexQuery(); virtual CKnowledgeBaseQueryCommand* setQueryComplexity(bool complex); virtual CBuildQueryCommand *getBuildQueryCommand(); virtual CKnowledgeBaseQueryCommand *setBuildQueryCommand(CBuildQueryCommand *buildQueryCommand); // protected methods protected: // protected variables protected: CCalculateQueryCommand *calcQueryCommand; CBuildQueryCommand *buildCommand; QString kbString; bool mComplex; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CKNOWLEDGEBASEQUERYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseCommand.h0000644000175000017500000000405612520756342030264 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CKNOWLEDGEBASECOMMAND_H #define KONCLUDE_Control_COMMAND_CKNOWLEDGEBASECOMMAND_H // Libraries includes #include // Namespace includes // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CKnowledgeBaseCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CKnowledgeBaseCommand : public CPreconditionCommand { // public methods public: //! Constructor CKnowledgeBaseCommand(CCommand *parentSuperCommand = 0); //! Destructor virtual ~CKnowledgeBaseCommand(); virtual QString getBriefCommandDescription(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CKNOWLEDGEBASECOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CLoadKnowledgeBaseData.cpp0000644000175000017500000000312412520756342030705 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLoadKnowledgeBaseData.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CLoadKnowledgeBaseData::CLoadKnowledgeBaseData(QIODevice* loadDevice, const QString& originalDataName, const QString& resolvedDataName) { mLoadDevice = loadDevice; mOriginalDataName = originalDataName; mResolvedDataName = resolvedDataName; } QIODevice* CLoadKnowledgeBaseData::getLoadDevice() { return mLoadDevice; } QString CLoadKnowledgeBaseData::getOriginalDataName() { return mOriginalDataName; } QString CLoadKnowledgeBaseData::getResolvedDataName() { return mResolvedDataName; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CStreamParseOWL2XMLOntologyCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CStreamParseOWL2XMLOntologyComman0000644000175000017500000000556212520756346032175 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CSTREAMPARSEOWL2XMLONTOLOGYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CSTREAMPARSEOWL2XMLONTOLOGYCOMMAND_H // Libraries includes #include // Namespace includes #include "CParseOntologyCommand.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CReadXMLCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CStreamParseOWL2XMLOntologyCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CStreamParseOWL2XMLOntologyCommand : public CParseOntologyCommand, public CKnowledgeBaseRevisionCommandProvider { // public methods public: //! Constructor CStreamParseOWL2XMLOntologyCommand(const QString& sourceStringName, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CStreamParseOWL2XMLOntologyCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual COntologyRevision *getOntologyRevision(); virtual CCommand *getCommand(); virtual const QString& getSourceString(); // protected methods protected: // protected variables protected: CKnowledgeBaseRevisionCommandProvider *revProvider; CReadXMLCommandProvider* mXmlCommandProvider; QString mSourceString; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CSTREAMPARSEOWL2XMLONTOLOGYCOMMAND_H ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsClassSubsumedByQueryOWL2XMLNodeCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsClassSubsumedByQueryOWL2XMLNod0000644000175000017500000000354612520756340032106 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIsClassSubsumedByQueryOWL2XMLNodeCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CIsClassSubsumedByQueryOWL2XMLNodeCommand::CIsClassSubsumedByQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand) : CIsClassSubsumedByQueryCommand(knowledgeBaseNameString,parentSuperCommand) { node = queryNode; } CIsClassSubsumedByQueryOWL2XMLNodeCommand::~CIsClassSubsumedByQueryOWL2XMLNodeCommand() { } QString CIsClassSubsumedByQueryOWL2XMLNodeCommand::getBriefCommandDescription() { return QString("Knowledge-Base-ClassSubsumtionQuery Command"); } QDomElement CIsClassSubsumedByQueryOWL2XMLNodeCommand::getQueryNode() { return node; } qint64 CIsClassSubsumedByQueryOWL2XMLNodeCommand::getCommandTag() { return SUBSUMEDQUERYKNOWLEDGEBASEOWL2XMLCOMMAND; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CCreateKnowledgeBaseCommand.cpp0000644000175000017500000000436612520756336031752 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCreateKnowledgeBaseCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CCreateKnowledgeBaseCommand::CCreateKnowledgeBaseCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseCommand(parentSuperCommand) { kbString = knowledgeBaseNameString; } CCreateKnowledgeBaseCommand::~CCreateKnowledgeBaseCommand() { cDeleteAll(mPrefixList); } qint64 CCreateKnowledgeBaseCommand::getCommandTag() { return CREATEKNOWLEDGEBASECOMMAND; } QString CCreateKnowledgeBaseCommand::getKnowledgeBaseName() { return kbString; } QString CCreateKnowledgeBaseCommand::getBriefCommandDescription() { return QString("Create-'%1'-Knowledge-Base Command").arg(kbString); } QList* CCreateKnowledgeBaseCommand::getPrefixList() { return &mPrefixList; } CCreateKnowledgeBaseCommand* CCreateKnowledgeBaseCommand::addNamePrefix(CNamePrefix* prefix) { mPrefixList.append(prefix); return this; } bool CCreateKnowledgeBaseCommand::hasPrefixes() { return !mPrefixList.isEmpty(); } CCreateKnowledgeBaseCommand* CCreateKnowledgeBaseCommand::setKnowledgeBaseName(const QString& kbNameString) { kbString = kbNameString; return this; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsInstanceOfQueryOWL2XMLNodeCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsInstanceOfQueryOWL2XMLNodeComm0000644000175000017500000000477312520756342032055 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CISINSTANCEOFQUERYOWL2XMLNODECOMMAND_H #define KONCLUDE_Control_COMMAND_CISINSTANCEOFQUERYOWL2XMLNODECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CIsInstanceOfQueryCommand.h" #include "CCalculateQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CIsInstanceOfQueryOWL2XMLNodeCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIsInstanceOfQueryOWL2XMLNodeCommand : public CIsInstanceOfQueryCommand { // public methods public: //! Constructor CIsInstanceOfQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CIsInstanceOfQueryOWL2XMLNodeCommand(); virtual QString getBriefCommandDescription(); virtual qint64 getCommandTag(); virtual QDomElement getQueryNode(); // protected methods protected: // protected variables protected: QDomElement node; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CISINSTANCEOFQUERYOWL2XMLNODECOMMAND_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsConsistentQueryOWL2XMLNodeCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CIsConsistentQueryOWL2XMLNodeComm0000644000175000017500000000473012520756340032144 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CISCONSISTENTQUERYOWL2XMLNODECOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CISCONSISTENTQUERYOWL2XMLNODECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CIsConsistentQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CIsConsistentQueryOWL2XMLNodeCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIsConsistentQueryOWL2XMLNodeCommand : public CIsConsistentQueryCommand { // public methods public: //! Constructor CIsConsistentQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CIsConsistentQueryOWL2XMLNodeCommand(); virtual QString getBriefCommandDescription(); virtual qint64 getCommandTag(); virtual QDomElement getQueryNode(); // protected methods protected: // protected variables protected: QDomElement mQueryNode; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CISCONSISTENTQUERYOWL2XMLNODECOMMAND_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteXMLIndividualTypesQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteXMLIndividualTypesQueryComm0000644000175000017500000000402312520756350032371 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteXMLIndividualTypesQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CWriteXMLIndividualTypesQueryCommand::CWriteXMLIndividualTypesQueryCommand(const QString& knowledgeBaseNameString, const QString& outputFileString, const QString& individualName, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { mIndividualName = individualName; mOutputFileString = outputFileString; } CWriteXMLIndividualTypesQueryCommand::~CWriteXMLIndividualTypesQueryCommand() { } qint64 CWriteXMLIndividualTypesQueryCommand::getCommandTag() { return WRITEXMLINDIVIDUALTYPESQUERYCOMMAND; } QString CWriteXMLIndividualTypesQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-WriteXMLIndividualTypes Command"); } QString CWriteXMLIndividualTypesQueryCommand::getOutputFileString() { return mOutputFileString; } QString CWriteXMLIndividualTypesQueryCommand::getIndividualName() { return mIndividualName; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetFlattenedTypesQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetFlattenedTypesQueryCommand.cp0000644000175000017500000000277312520756336032355 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGetFlattenedTypesQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CGetFlattenedTypesQueryCommand::CGetFlattenedTypesQueryCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand) : CKnowledgeBaseQueryCommand(knowledgeBaseNameString,parentSuperCommand) { } CGetFlattenedTypesQueryCommand::~CGetFlattenedTypesQueryCommand() { } QString CGetFlattenedTypesQueryCommand::getBriefCommandDescription() { return QString("Knowledge-Base-GetFlattenedTypes Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractKnowledgeBaseEntitiesCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CExtractKnowledgeBaseEntitiesComm0000644000175000017500000000607412520756336032420 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CEXTRACTKNOWLEDGEBASEENTITIESCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CEXTRACTKNOWLEDGEBASEENTITIESCOMMAND_H // Libraries includes // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CKnowledgeBaseEntitiesExtractionSpecification.h" #include "CExtractedKnowledgeBaseEntitiesContainer.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CExtractKnowledgeBaseEntitiesCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExtractKnowledgeBaseEntitiesCommand : public CPreconditionCommand { // public methods public: //! Constructor CExtractKnowledgeBaseEntitiesCommand(CExtractedKnowledgeBaseEntitiesContainer* extractionContainer, CKnowledgeBaseEntitiesExtractionSpecification* extractSpec, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CExtractKnowledgeBaseEntitiesCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual COntologyRevision *getOntologyRevision(); CKnowledgeBaseEntitiesExtractionSpecification* getEntitiesExtractionSpecification(); CExtractedKnowledgeBaseEntitiesContainer* getExtractionContainer(); // protected methods protected: // protected variables protected: CKnowledgeBaseRevisionCommandProvider *revProvider; CKnowledgeBaseEntitiesExtractionSpecification* mExtractSpec; CExtractedKnowledgeBaseEntitiesContainer* mExtractionContainer; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CEXTRACTKNOWLEDGEBASEENTITIESCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteOntologyCommand.cpp0000644000175000017500000000256312520756346030737 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteOntologyCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CWriteOntologyCommand::CWriteOntologyCommand(CCommand *parentSuperCommand) : CPreconditionCommand(parentSuperCommand) { } CWriteOntologyCommand::~CWriteOntologyCommand() { } QString CWriteOntologyCommand::getBriefCommandDescription() { return QString("Unknown-Write-Ontology Command"); } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructClassSatisfiableQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CConstructClassSatisfiableQueryCo0000644000175000017500000000561012520756334032454 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CConstructClassSatisfiableQueryCommand_H #define KONCLUDE_Control_COMMAND_CConstructClassSatisfiableQueryCommand_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseRevisionCommandProvider.h" #include "CQueryCommandProvider.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CConstructClassSatisfiableQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConstructClassSatisfiableQueryCommand : public CPreconditionCommand, public CQueryCommandProvider { // public methods public: //! Constructor CConstructClassSatisfiableQueryCommand(const QString& className, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CConstructClassSatisfiableQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual CCommand *getCommand(); virtual COntologyRevision *getOntologyRevision(); const QString& getClassName(); virtual CQuery *getQuery(); virtual CConstructClassSatisfiableQueryCommand *setQuery(CQuery *knowledgeBaseQuery); // protected methods protected: // protected variables protected: CQuery* mQuery; QString mClassName; CKnowledgeBaseRevisionCommandProvider *revProvider; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CConstructClassSatisfiableQueryCommand_H ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteOWLlinkOWL2XMLSatisfiableTestCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteOWLlinkOWL2XMLSatisfiableTe0000644000175000017500000000512012520756350032034 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CWriteOWLlinkOWL2XMLSatisfiableTestCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CWriteOWLlinkOWL2XMLSatisfiableTestCommand::CWriteOWLlinkOWL2XMLSatisfiableTestCommand(COntologyOWL2QtXMLRenderer* renderer, const QString& fileName, const QStringList& satTestClasses, const QString& testKBName, CCommand *parentSuperCommand) : CWriteOntologyCommand(parentSuperCommand) { mRenderer = renderer; mWriteFileName = fileName; mSatTestClasses = satTestClasses; mTestKBName = testKBName; } CWriteOWLlinkOWL2XMLSatisfiableTestCommand::~CWriteOWLlinkOWL2XMLSatisfiableTestCommand() { delete mRenderer; } QString CWriteOWLlinkOWL2XMLSatisfiableTestCommand::getBriefCommandDescription() { return QString("Write-OWLlink-OWL-2-XML-Satisfiable-Test Command"); } qint64 CWriteOWLlinkOWL2XMLSatisfiableTestCommand::getCommandTag() { return WRITEOWLLINKOWL2XMLSATISFIABLETESTCOMMAND; } COntologyRenderer* CWriteOWLlinkOWL2XMLSatisfiableTestCommand::getRenderer() { return mRenderer; } QString CWriteOWLlinkOWL2XMLSatisfiableTestCommand::getWriteFileName() { return mWriteFileName; } CCommand* CWriteOWLlinkOWL2XMLSatisfiableTestCommand::getCommand() { return this; } COntologyOWL2QtXMLRenderer* CWriteOWLlinkOWL2XMLSatisfiableTestCommand::getOWL2XMLRenderer() { return mRenderer; } QStringList CWriteOWLlinkOWL2XMLSatisfiableTestCommand::getSatisfiableTestClassesList() { return mSatTestClasses; } QString CWriteOWLlinkOWL2XMLSatisfiableTestCommand::getTestKBName() { return mTestKBName; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CKnowledgeBaseProcessCommand.h0000644000175000017500000000445712520756342031630 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CKNOWLEDGEBASEPROCESSCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CKNOWLEDGEBASEPROCESSCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Instructions { /*! * * \class CKnowledgeBaseProcessCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CKnowledgeBaseProcessCommand : public CKnowledgeBaseCommand { // public methods public: //! Constructor CKnowledgeBaseProcessCommand(const QString &knowledgeBaseNameString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CKnowledgeBaseProcessCommand(); virtual QString getBriefCommandDescription(); virtual QString getKnowledgeBaseName(); // protected methods protected: // protected variables protected: QString kbString; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CKNOWLEDGEBASEPROCESSCOMMAND_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetFlattenedTypesOWL2XMLNodeCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CGetFlattenedTypesOWL2XMLNodeComm0000644000175000017500000000500012520756336032060 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CGETFLATTENEDTYPESOWL2XMLNODECOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CGETFLATTENEDTYPESOWL2XMLNODECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CGetFlattenedTypesQueryCommand.h" #include "CCalculateQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CGetFlattenedTypesOWL2XMLNodeCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGetFlattenedTypesOWL2XMLNodeCommand : public CGetFlattenedTypesQueryCommand { // public methods public: //! Constructor CGetFlattenedTypesOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CGetFlattenedTypesOWL2XMLNodeCommand(); virtual QString getBriefCommandDescription(); virtual qint64 getCommandTag(); virtual QDomElement getQueryNode(); // protected methods protected: // protected variables protected: QDomElement node; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CGETFLATTENEDTYPESOWL2XMLNODECOMMAND_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesDisjointQueryOWL2XMLNodeCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CAreClassesDisjointQueryOWL2XMLNo0000644000175000017500000000505312520756334032125 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CARECLASSESDISJOINTQUERYOWL2XMLNODECOMMAND_H #define KONCLUDE_Control_COMMAND_CARECLASSESDISJOINTQUERYOWL2XMLNODECOMMAND_H // Libraries includes #include #include // Namespace includes #include "CAreClassesDisjointQueryCommand.h" #include "CCalculateQueryCommand.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CAreClassesDisjointQueryOWL2XMLNodeCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAreClassesDisjointQueryOWL2XMLNodeCommand : public CAreClassesDisjointQueryCommand { // public methods public: //! Constructor CAreClassesDisjointQueryOWL2XMLNodeCommand(const QString &knowledgeBaseNameString, const QDomElement &queryNode, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CAreClassesDisjointQueryOWL2XMLNodeCommand(); virtual QString getBriefCommandDescription(); virtual qint64 getCommandTag(); virtual QDomElement getQueryNode(); // protected methods protected: // protected variables protected: QDomElement node; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CARECLASSESDISJOINTQUERYOWL2XMLNODECOMMAND_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CTestExtendedCalculateQueryCommand.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CTestExtendedCalculateQueryComman0000644000175000017500000000556712520756346032440 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTestExtendedCalculateQueryCommand.h" namespace Konclude { namespace Control { namespace Command { namespace Instructions { CTestExtendedCalculateQueryCommand::CTestExtendedCalculateQueryCommand(CQueryCommandProvider *queryCommandProvider, CCommand *parentSuperCommand) : CCalculateQueryCommand(queryCommandProvider,parentSuperCommand) { timingLevel = 0; calcTime = 0; hasCalcTime = false; expectedResult = 0; creationTime.start(); } CTestExtendedCalculateQueryCommand::~CTestExtendedCalculateQueryCommand() { } qint64 CTestExtendedCalculateQueryCommand::getCommandTag() { return TESTEXTENDEDCALCULATEQUERYCOMMAND; } QString CTestExtendedCalculateQueryCommand::getBriefCommandDescription() { return QString("Calculate-Test-Query Command"); } qint64 CTestExtendedCalculateQueryCommand::getTimingReportLevel() { return timingLevel; } CTestExtendedCalculateQueryCommand *CTestExtendedCalculateQueryCommand::setTimingReportLevel(qint64 timingReportLevel) { timingLevel = timingReportLevel; return this; } qint64 CTestExtendedCalculateQueryCommand::getCalculationTime() { return calcTime; } CTestExtendedCalculateQueryCommand *CTestExtendedCalculateQueryCommand::setCalculationTime(qint64 calculationTime) { calcTime = calculationTime; hasCalcTime = true; return this; } bool CTestExtendedCalculateQueryCommand::hasCalculationTime() { return hasCalcTime; } qint64 CTestExtendedCalculateQueryCommand::getCreationElapsedMilliSeconds() { return creationTime.elapsed(); } CTestExtendedCalculateQueryCommand *CTestExtendedCalculateQueryCommand::setExpectedQueryResult(CQueryResult *expectedQueryResult) { expectedResult = expectedQueryResult; return this; } CQueryResult *CTestExtendedCalculateQueryCommand::getExpectedQueryResult() { return expectedResult; } }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CInstallKnowledgeBaseRevisionUpdateCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CInstallKnowledgeBaseRevisionUpda0000644000175000017500000000544112520756340032414 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CINSTALLKNOWLEDGEBASEREVISIONUPDATECOMMAND_H #define KONCLUDE_Control_COMMAND_CINSTALLKNOWLEDGEBASEREVISIONUPDATECOMMAND_H // Libraries includes #include // Namespace includes #include "CKnowledgeBaseCommand.h" #include "CKnowledgeBaseRevisionCommandProvider.h" // Other includes #include "Reasoner/Revision/COntologyRevision.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" #include "Control/Command/CCommandProcessedPrecondition.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Revision; namespace Control { namespace Command { namespace Instructions { /*! * * \class CInstallKnowledgeBaseRevisionUpdateCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CInstallKnowledgeBaseRevisionUpdateCommand : public CKnowledgeBaseCommand { // public methods public: //! Constructor CInstallKnowledgeBaseRevisionUpdateCommand(const QString &knowledgeBaseNameString, CKnowledgeBaseRevisionCommandProvider *ontologyRevisionProviderCommand, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CInstallKnowledgeBaseRevisionUpdateCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); virtual QString getKnowledgeBaseName(); virtual COntologyRevision *getOntologyRevision(); // protected methods protected: // protected variables protected: QString kbString; CKnowledgeBaseRevisionCommandProvider *onRevProvider; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CINSTALLKNOWLEDGEBASEREVISIONUPDATECOMMAND_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteXMLSubClassHierarchyQueryCommand.hKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Instructions/CWriteXMLSubClassHierarchyQueryCo0000644000175000017500000000503612520756350032305 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CWRITEXMLSUBCLASSHIERARCHYQUERYCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CWRITEXMLSUBCLASSHIERARCHYQUERYCOMMAND_H // Libraries includes #include #include // Namespace includes #include "CKnowledgeBaseQueryCommand.h" // Other includes #include "Reasoner/Query/CSubClassHierarchyQuery.h" #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CPreconditionCommand.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Query; namespace Control { namespace Command { namespace Instructions { /*! * * \class CWriteXMLSubClassHierarchyQueryCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CWriteXMLSubClassHierarchyQueryCommand : public CKnowledgeBaseQueryCommand { // public methods public: //! Constructor CWriteXMLSubClassHierarchyQueryCommand(const QString& knowledgeBaseNameString, const QString& outputFileString, CCommand *parentSuperCommand = 0); //! Destructor virtual ~CWriteXMLSubClassHierarchyQueryCommand(); virtual qint64 getCommandTag(); virtual QString getBriefCommandDescription(); QString getOutputFileString(); // protected methods protected: // protected variables protected: QString mOutputFileString; // private methods private: // private variables private: }; }; // end namespace Instructions }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CWRITEXMLSUBCLASSHIERARCHYQUERYCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CReasonerConfigurationGroup.cpp0000644000175000017500000026645012574305476027444 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerConfigurationGroup.h" namespace Konclude { namespace Control { namespace Command { CReasonerConfigurationGroup::CReasonerConfigurationGroup() { // Konclude reasoner configurations addConfigProperty(new CConfigDescription("Konclude.Version.Major", "Major version of Konclude.", new CIntegerConfigType(CKoncludeInfo::getKoncludeMajorVersionNumber())), new CIntegerConfigType(CKoncludeInfo::getKoncludeMajorVersionNumber())); addConfigProperty(new CConfigDescription("Konclude.Version.Minor", "Minor version of Konclude.", new CIntegerConfigType(CKoncludeInfo::getKoncludeMinorVersionNumber())), new CIntegerConfigType(CKoncludeInfo::getKoncludeMinorVersionNumber())); addConfigProperty(new CConfigDescription("Konclude.Version.Build", "Build of Konclude.", new CIntegerConfigType(CKoncludeInfo::getKoncludeBuildVersionNumber())), new CIntegerConfigType(CKoncludeInfo::getKoncludeBuildVersionNumber())); addConfigProperty(new CConfigDescription("Konclude.Name", "Name of Konclude.", new CStringConfigType(CKoncludeInfo::getKoncludeName())), new CStringConfigType(CKoncludeInfo::getKoncludeName())); addConfigProperty(new CConfigDescription("Konclude.Description", "Description of Konclude.", new CStringConfigType(CKoncludeInfo::getKoncludeDescription())), new CStringConfigType(CKoncludeInfo::getKoncludeDescription())); addConfigProperty(new CConfigDescription("Konclude.Execution.CommanderManager", "Commander Manager.", new CCommanderManagerConfigType(0))); addConfigProperty(new CConfigDescription("Konclude.Execution.ReasonerManager", "Reasoner Manager.", new CReasonerManagerConfigType(0))); addConfigProperty(new CConfigDescription("Konclude.Execution.ClassificationManager", "Classification Manager.", new CClassificationManagerConfigType(0))); addConfigProperty(new CConfigDescription("Konclude.Execution.OntologyRevisionManager", "Ontology Revision Manager.", new COntologyRevisionManagerConfigType(0))); addConfigProperty(new CConfigDescription("Konclude.Execution.DefaultReasonerManager", "The Reasoner Manager that is loaded by default.", new CStringConfigType(KONCLUDE_DEFAULTREASONERMANAGER)), new CStringConfigType(KONCLUDE_DEFAULTREASONERMANAGER)); addConfigProperty(new CConfigDescription("Konclude.Execution.CalculationManager", "Determines which Calculation Manager will be used for calculation. Value can be 'Konclude.Calculation.Calculator.ConcurrentTaskCalculationManager'.", new CStringConfigType(KONCLUDE_DEFAULTCALCULATIONMANAGER)), new CStringConfigType(KONCLUDE_DEFAULTCALCULATIONMANAGER)); addConfigProperty(new CConfigDescription("Konclude.Logging.MinLoggingLevel", "Minimum logging level.", new CIntegerConfigType(0)), new CIntegerConfigType(0)); addConfigProperty(new CConfigDescription("Konclude.Logging.MaxLogMessageCount", "Maximum number of log messages that are kept by the logger.", new CIntegerConfigType(-1)), new CIntegerConfigType(-1)); // Parallelisation configurations addConfigProperty(new CConfigDescription("Konclude.Calculation.ProcessorCount", "Number of Processor-Threads that are used for task based reasoning.", new CStringConfigType("1")), new CStringConfigType("1")); addConfigProperty(new CConfigDescription("Konclude.Calculation.UniqueNameAssumption", "Determines whether the reasoner treats each individual with distinct name as different of each other.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Memory.AllocationLimitation", "Determines whether the reasoner uses memory limits for the calculation process.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Memory.MaximumAllocationSize", "Configures the memory limit for the calculation.", new CIntegerConfigType(1024*1024*1800)), new CIntegerConfigType(1024*1024*1800)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Memory.CriticalAllocationSize", "Configures the critical memory limit for the calculation.", new CIntegerConfigType(1024*1024*1200)), new CIntegerConfigType(1024*1024*1200)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Memory.IncreaseAllocationSize", "Sets the memory allocation increasing size for the calculation.", new CIntegerConfigType(1024*1024*512)), new CIntegerConfigType(1024*1024*512)); addConfigProperty(new CConfigDescription("Konclude.Calculation.DatatypeReasoning", "Determines whether datatype reasoning is activated.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.MaximumRecursiveProcessingConceptCount", "Determines the maximum recursion for the processing of added concepts in completion graphs with tableau expansion rules.", new CIntegerConfigType(300)), new CIntegerConfigType(300)); // Processing configurations addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.Backjumping", "Determines whether the reasoner performs dependency directed backjumping/cancellation.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.UnsatisfiableCacheRetrieval", "Determines whether the reasoner uses unsatisfiable cache retrievals for calculation.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SatisfiableCacheRetrieval", "Determines whether the reasoner uses satisfiable cache retrievals for calculation.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.UnsatisfiableCacheSingleLevelWriting", "Determines whether the reasoner writes single individual level clashes to unsatisfiable cache.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.UnsatisfiableCacheTestingConceptWriting", "Determines whether the reasoner writes unsatisfiability tested concepts to unsatisfiable cache.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SatisfiableCacheSingleLevelWriting", "Determines whether the reasoner writes single individual level satisfiable to satisfiable cache.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.DependencyTracking", "Determines whether the reasoner performs dependency tracking.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.ProxyIndividuals", "Determines whether the reasoner uses proxy individuals.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.MinimizedMergingBranches", "Determines whether the reasoner minimizes merging branches.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.ProcessedIndividualNodePropagation", "Determines whether the reasoner propagates the individual node complete processed flags to successors.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.IndividualNodeIDPriorization", "Determines whether the reasoner uses the individual node IDs to prioritize the individual node processing queue.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.StrictIndividualNodeProcessingOrder", "Determines whether the reasoner processes only one individual node at one time.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.BranchTriggering", "Determines whether the reasoner uses triggers to delay and avoid branches.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SemanticBranching", "Determines whether the reasoner uses semantic branching.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.AtomicSemanticBranching", "Determines whether the reasoner uses semantic branching for atomic concepts that has no additional effort.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.AnywhereCoreConceptCandidateHashBlockingSearch", "Determines whether the reasoner assists the anywhere blocking search with a candidate hash for marked core concepts.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.AnywhereCandidateHashBlockingSearch", "Determines whether the reasoner assists the anywhere blocking search with a candidate hash.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.AnywhereBlockingSearch", "Determines whether the reasoner uses an anywhere blocking search.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.AncestorBlockingSearch", "Determines whether the reasoner uses an ancestor blocking search.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.PairwiseEqualSetBlockingTest", "Determines whether the reasoner checks blocking with pairwise equal concept set tests.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.EqualSetBlockingTest", "Determines whether the reasoner checks blocking with equal concept set tests.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SubSetBlockingTest", "Determines whether the reasoner checks blocking with sub concept set tests.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.OptimizedBlockingTest", "Determines whether the reasoner checks blocking with optimized blocking tests.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.DirectRulePreprocessing", "Determines whether the reasoner is direct preprocessing some rules.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.LazyNewMergingNominalCreation", "Determines whether the reasoner generates new nominals with the NN-rule as late as possible to avoid superfluous branches.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.ConsistenceRestrictedNonStrictProcessing", "Determines whether the reasoner generates the deterministic part of the consistence model with non strict individual node processing order.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SatisfiableExpansionCacheRetrieval", "Determines whether the reasoner checks for cached nodes in the satisfiable expansion cache.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SatisfiableExpansionCacheConceptExpansion", "Determines whether the reasoner is expanding nodes with the satisfiable expansion cache.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SatisfiableExpansionCacheSatisfiableBlocking", "Determines whether the reasoner blocks processing for satisfiable cached nodes and successor nodes.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SatisfiableExpansionCacheWriting", "Determines whether the reasoner writes satisfiable nodes to satisfiable expansion cache.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SignatureMirroringBlocking", "Determines whether the reasoner can block nodes by mirroring other nodes.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SignatureSaving", "Determines whether the reasoner writes nodes concept set signatures into hash.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.ANDConceptSkipping", "Determines whether the reasoner can skip adding AND concepts to individual nodes.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.CompletionGraphCaching", "Determines whether the reasoner can use the generated completion graph in the persistence check to block unnecessary individual node processing.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.DelayedCompletionGraphCachingReactivation", "Determines whether the reactivation of completion graph cached nodes is delayed.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.AvoidRepeatedIndividualProcessing", "Determines whether the reprocessing of nodes for individuals is avoided if nominals do not occur in the ontology and tests do not directly refers to individuals.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.ForceNodesRecreationForRepeatedIndividualProcessing", "Determines whether for the repeated reprocessing of individuals new nodes are created.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.CompletionGraphReuseCachingRetrieval", "Determines whether the reasoner queries the completion graph reuse cache for compatible entries.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.CompletionGraphDeterministicReuse", "Determines whether the reasoner is allowed to reuse deterministic completion graph reuse cache entries.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.CompletionGraphNonDeterministicReuse", "Determines whether the reasoner is allowed to reuse non-deterministic completion graph reuse cache entries.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.UnsatisfiableCachingFullDependency", "Determines whether the reasoner experimentally uses for the unsatisfiable caching additional all dependencies of all constructs of the unsatisfiable node.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.UnsatisfiableCachingFullSignature", "Determines whether the reasoner experimentally uses for the unsatisfiable caching additional the unsatisfiable node signatures for retrieval.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.PairwiseMerging", "Determines whether the reasoner experimentally uses the naive pairwise merging approach.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SaturationPiling", "Determines whether the reasoner experimentally uses piling individual nodes for saturation.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.RepresentativePropagation", "Determines whether the reasoner propagates representatives instead of sets of variable mappings.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.IndividualsBackendCacheLoading", "Determines whether the reasoner loads data for individuals from backend cache.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SuccessorConceptSaturationExpansion", "Determines whether the reasoner using saturated concepts for expanding newly created successor nodes.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SaturationCaching", "Determines whether the reasoner using saturated concepts for caching.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SaturationCriticalConceptTesting", "Determines whether the reasoner tests critical concepts after the saturation.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SaturationDirectCriticalToInsufficient", "Determines whether the reasoner directly marks nodes with critical concepts as insufficiently saturated.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SaturationSuccessorExtension", "Determines whether successors are extended in the saturation with concepts that are propagated into successor directions.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SaturationReferredNodeManyConceptCount", "The number of concepts for which referred nodes are identified to have many concepts.", new CIntegerConfigType(500)), new CIntegerConfigType(500)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SaturationManyConceptReferredNodeCountProcessLimit", "The number of referred nodes with many concept for which saturation is not performed.", new CIntegerConfigType(2)), new CIntegerConfigType(2)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SaturationReferredNodeConceptCountProcessLimit", "The number of concepts of the referred nodes for which saturation is not performed.", new CIntegerConfigType(1500)), new CIntegerConfigType(1500)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SaturationReferredNodeUnprocessedCountProcessLimit", "The number of unprocessed referred nodes for which saturation is not performed.", new CIntegerConfigType(1)), new CIntegerConfigType(1)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SaturationReferredNodeCheckingDepth", "The recursive checking depth for referred nodes for saturation.", new CIntegerConfigType(5)), new CIntegerConfigType(5)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.ForceManyConceptNodeSaturation", "Determines whether saturation is enforced even if there are many concepts.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.NominalSaturationCachingByNodeReactivation", "Determines whether the reasoner using saturated concepts with connections to nominals for caching with reactivation.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.NominalSaturation", "Determines whether the reasoner uses the completion graph from the consistency test to improve the saturation of concept that have a connection to nominals.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SaturationExpansionSatisfiabilityCacheWriting", "Determines whether the reasoner caches expansions and satisfiability for saturated nodes.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SaturationExpansionSatisfiabilityCacheCount", "Determines how many expansions are cached by the reasoner for each saturated nodes.", new CIntegerConfigType(1)), new CIntegerConfigType(1)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.SaturationUnsatisfiabilityCacheWriting", "Determines whether the reasoner caches and propagates unsatisfiability for saturated nodes.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.EquivalentAlternativesSaturationMerging", "Determinses whether model merging with the saturation for alternatives of equivalent candidate concepts is used to prune possible subsumers.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.ConceptSaturation", "Determinses whether concepts are saturated for the assisting of the tableau algorithm.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.IndividualSaturation", "Determines whether individual are saturated.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.ComputedTypesCaching", "Determines whether computed types are cached for reusing in other tests.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Optimization.ConstructionIndividualNodeMerging", "Determines whether constructed individual nodes are merged into nominal nodes.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Cache.SatisfiableExpander.InitialMemoryLevelForIncreaseRequiredSignatureReferenceCount", "Specifies the initial memory level for which the required signature references for the creation of cache entries is increased.", new CIntegerConfigType(200*1024*1024)), new CIntegerConfigType(200*1024*1024)); addConfigProperty(new CConfigDescription("Konclude.Cache.SatisfiableExpander.NextMemoryLevelIncreaseForIncreaseRequiredSignatureReferenceCount", "Specifies the increase for the next memory level for which the required signature references is increased.", new CIntegerConfigType(100*1024*1024)), new CIntegerConfigType(100*1024*1024)); addConfigProperty(new CConfigDescription("Konclude.Cache.SatisfiableExpander.InitialRequiredSignatureReferenceCount", "Specifies the initial required signature references count.", new CIntegerConfigType(1)), new CIntegerConfigType(1)); addConfigProperty(new CConfigDescription("Konclude.Cache.SatisfiableExpander.RequiredSignatureReferenceCountIncrease", "Specifies the increase for the required signature references count.", new CIntegerConfigType(1)), new CIntegerConfigType(1)); // Preprocessing configurations addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing", "Determines whether the ontology is preprocessed. Will disable all preprocessing steps.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.NegationNormalization", "Determines whether the ontology is preprocessed with the essential negation normalization.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.BranchTriggerExtraction", "Determines whether the branch triggers are generated in preprocessing phase.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.LexicalNormalization", "Determines whether the ontology is preprocessed with lexical normalization.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.RoleChainAutomataTransformation", "Determines whether the ontology is preprocessed with role chain automata transformation.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.GCIAbsorption.TriggeredImplicationBinaryGCIAbsorption", "Determines whether the ontology is preprocessed with general concept axioms (GCI) absorption into triggered binary implications.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.SubroleTransformation", "Determines whether the ontology is preprocessed with subrole transformation.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.DatatypeNormalizer", "Determines whether the ontology is preprocessed with datatype normalization.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.DataLiteralValueNormalizer", "Determines whether the ontology is preprocessed with data literal value normalization.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.OntologyAssignmentTransformation", "Determines whether the ontology is preprocessed with ontology assignment transformation.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.OntologyMappingUpdate", "Determines whether the ontology is preprocessed with ontology mapping update.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.ProcessingDataExtender", "Determines whether the ontology is extended with processing data.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.ReverseRoleAssertionGeneration", "Determines whether reverse role assertions are generated.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.OntologyStructureInspection", "Determines whether the ontology is preprocessed with ontology structure inspection.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.CheckingOntologyConsistency", "Determines whether in the preprocessing phase the ontology consistency is checked.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.OntologyPrecomputation", "Determines whether in the preprocessing phase the ontology consistency is checked and starts some other precomputations.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.CoreConceptCyclesPrecomputation", "Determines whether in the preprocessing phase the core concept cycles are precomputated.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.CoreConceptCyclesExtraction", "Determines whether in the preprocessing phase the core concept cycles are extracted from the ontology.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.CoreBlockingConceptMarking", "Determines whether in the preprocessing phase some concepts are marked as core blocking concepts.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.DisjunctionToImplicationAbsorption", "Determines whether in the preprocessing phase disjunctions are absorbed to implications.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.DisjunctionToImplicationAbsorptionByExistingTriggers", "Determines whether in the preprocessing phase disjunctions are absorbed to implications with existing triggers.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.EquivalentDefinitionToSubclassImplicationAbsorption", "Determines whether in the preprocessing phase equivalent defined concepts are absorbed to subclasses and implications.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.PartialEquivalentDefinitionToCandidatesAbsorption", "Determines whether in the preprocessing phase equivalent defined concepts are partially absorbed to candidates.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.PartialDisjunctionAbsorption", "Determines whether in the preprocessing phase disjunctions are partially.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.PartialGCIImplicationAbsorption", "Determines whether in the preprocessing phase GCIs are partially absorbed.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.CommonDisjunctConceptExtraction", "Determines whether in the preprocessing phase common disjunct concepts are extracted, so they can be added before branching.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.DisjunctSorting", "Determines whether the disjuncts in disjunctions are sorted.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.NominalSchemaTemplateExtraction", "Determines whether in the preprocessing phase nominal schema templates are extracted.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.NominalSchemaGrounding", "Determines whether in the preprocessing phase axioms with nominal schemas are grounded.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.FullNominalSchemaGrounding", "Determines whether in the preprocessing phase axioms with nominal schemas are fully grounded.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.AbsorbableNominalSchemaGrounding", "Determines whether in the preprocessing phase axioms with absorbable nominal schemas are grounded.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.NominalSchemaPathPreabsorption", "Determines whether in the preprocessing phase absorbed axioms with nominal schemas are extended by backward chaining with the propagation of binding candidates.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.NominalSchemaBackPropagation", "Determines whether in the preprocessing phase absorbed axioms with nominal schemas are extended by basic backward chaining.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.ExtractPropagationIntoCreationDirection", "Determines whether in the preprocessing phase all concepts with a possibly propagation into the creation direction are identified.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.RelevantConceptRoleMarker", "Determines whether in the preprocessing phase all concepts and roles that are relevant for inferences are marked.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.DatatypeAbsorption", "Determines whether datatypes are absorbed.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.CoreConceptCyclesExtraction.SkipForELFragment", "Determines whether the extraction of core concept cycles is skipped for EL ontologies.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.ExtractPropagationIntoCreationDirection.SkipForELFragment", "Determines whether the extraction of propagation in creation direction is skipped for EL ontologies.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.CoreBlockingConceptMarking.SkipForELFragment", "Determines whether the marking of core concepts is skipped for EL ontologies.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.ProcessingDataExtender.SkipForELFragment", "Determines whether the extension with processing data is skipped for EL ontologies.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.CommonDisjunctConceptExtraction.SkipForELFragment", "Determines whether the extraction of common disjunct concepts is skipped for EL ontologies.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.LexicalNormalization.SkipForELFragment", "Determines whether the lexical normalization is skipped for EL ontologies.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Preprocessing.BranchTriggerExtraction.SkipForELFragment", "Determines whether the extraction of branch triggers is skipped for EL ontologies.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); // Precomputation configurations addConfigProperty(new CConfigDescription("Konclude.Calculation.Precomputation.TotalPrecomputor.MaximumParallelCalculationCount", "Determines the maximum number of calculation jobs that are created at the same time.", new CIntegerConfigType(1)), ((CConfigData*)nullptr)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Precomputation.TotalPrecomputor.MultipliedUnitsParallelCalculationCount", "Determines how many calculation jobs are created.", new CIntegerConfigType(2)), new CIntegerConfigType(2)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Precomputation.TotalPrecomputor.IndividualsSaturationSize", "Determines how many individuals are saturated together.", new CIntegerConfigType(1000)), new CIntegerConfigType(1000)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Precomputation.ForceFullCompletionGraphConstruction", "Determines whether the construction of a completion graph is enforced for the consistency check.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); // Classification configurations addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.Classifier", "Determines which subsumption classifier is used for classification. Value can be 'Konclude.Calculation.Classification.Classifier.BruteForceClassifier' or 'Konclude.Calculation.Classification.Classifier.EnhancedTraversalClassifier' or 'Konclude.Calculation.Classification.Classifier.OptimizedSubClassClassifier' or 'Konclude.Calculation.Classification.Classifier.ExperimentalEnhancedTraversalClassifier' or 'Konclude.Calculation.Classification.Classifier.OptimizedKPSetClassClassifier'.", new CStringConfigType("Konclude.Calculation.Classification.Classifier.OptimizedKPSetClassClassifier")), new CStringConfigType("Konclude.Calculation.Classification.Classifier.OptimizedKPSetClassClassifier")); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.PruneSubsumptionRelations", "Determines whether unnecessary calculations for ontology classification are pruned.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.TransitiveReduction.AddAllPredecessors", "Determines whether all predecessors are added to the hierarchy nodes in the transitive reduction.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.DerivateSubsumptionRelations", "Determines whether unnecessary calculations for ontology classification are derrived.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.PseudoModelSubsumptionMerging", "Determines whether subsumption relations are calculated with pseudo model merging for classification.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.PseudoModelSubsumptionMerging.MaximumFastPseudoModelMergingDepth", "Determines how depth the pseudo models are merged for a fast foregoing subsumption check.", new CIntegerConfigType(-1)), new CIntegerConfigType(-1)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.MaximumParallelSubsumptionCalculationCount", "Determines how many subsumption calculation jobs are created per classifier.", new CIntegerConfigType(1)), new CIntegerConfigType(1)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.PseudoModelSubsumptionMerging.DirectMerging", "Determines whether subsumption relations are calculated with direct pseudo model merging for classification. The config 'Konclude.Calculation.Classification.PseudoModelSubsumptionMerging' must be also activated.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.PseudoModelSubsumptionMerging.ProofMerging", "Determines whether subsumption relations are calculated with proof pseudo model merging for classification. The config 'Konclude.Calculation.Classification.PseudoModelSubsumptionMerging' must be also activated.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.ObviousSubsumptionCalculation", "Determines whether obvious subsumption relations are calculated.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.SatisfiableSubsumptionExtraction", "Determines whether subsumption relations are extracted while satisfiable tests.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.AutomatedOptimizedClassifierSelection", "Determines whether an optimized classifier is choosen automatically when possible.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.ForceCompleteSatisfiableTest", "Determines whether satisfiable tests are executed for each concept independent from the result of other satisfiable tests.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.TaxonomySubsumptionCalculationSponsor", "Determines whether the subsumption calculation sponsor is checked for each subsumption calculation.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.TaxonomySatisfiableCalculationSponsor", "Determines whether the satisfiable calculation sponsor is checked for each satisfiable calculation.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.ConsecutivelyConstructedSatisfiableTests", "Determines whether for the satisfiable calculation a previous satisfiable calculation is extended.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.SubclassConsideration", "Determines whether any subclass optimization is used.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.SubclassConsideration.SubclassSubsummingCheck", "Determines whether subclass relations are considered.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.SubclassConsideration.SubclassSubsummingCheck.PseudoModelGenerationSupport", "Determines whether pseudo models are inspected for generating possible subclass relations. Requires the config 'Konclude.Calculation.Classification.SubclassConsideration' for the possible subclass generation.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.SubclassConsideration.SubclassIdentifierPossiblePredecessorOccurCheck", "Determines whether deterministic subclass occurrences in satisfiable classes are used to derivate non subsumptions.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.SubclassConsideration.PossibleSubclassSubsummingOccurCheck", "Uses non-deterministic occured identifier in satisfiable tests for restricting possible subsumptions.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.CollectProcessStatistics", "Determines whether the statistics for building the model are collected for the classification.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.OptimizedSubClassSubsumptionClassifier.MaximumParallelSatisfiableCalculationCount", "Determines how many satisfiable calculation jobs are created per classifier at one time.", new CIntegerConfigType(1)), ((CConfigData*)nullptr)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.OptimizedSubClassSubsumptionClassifier.MultipliedUnitsParallelSatisfiableCalculationCount", "Determines how many subsumption calculation jobs are created per classifier.", new CIntegerConfigType(8)), new CIntegerConfigType(8)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.OptimizedKPSetClassSubsumptionClassifier.MaximumParallelSatisfiableCalculationCount", "Determines how many satisfiable calculation jobs are created per classifier at one time.", new CIntegerConfigType(1)), ((CConfigData*)nullptr)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.OptimizedKPSetClassSubsumptionClassifier.MultipliedUnitsParallelSatisfiableCalculationCount", "Determines how many subsumption calculation jobs are created per classifier.", new CIntegerConfigType(8)), new CIntegerConfigType(8)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.OptimizedKPSetClassSubsumptionClassifier.ParallelSatisfiableCalculationCreationFactor", "Determines the factor where the classifier starts to create new calculation jobs.", new CIntegerConfigType(600)), new CIntegerConfigType(600)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.SaturationSubsumerExtraction", "Determines whether the subsumption relations are extracted from the saturation.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Classification.IndividualDependenceTracking", "Determines whether dependent individuals are tracked for classification.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Realization.COptimizedKPSetOntologyConceptRealizer.MaximumParallelTestingCalculationCount", "Determines how many calculation jobs are maximally created per realizer at one time.", new CIntegerConfigType(1)), ((CConfigData*)nullptr)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Realization.COptimizedKPSetOntologyConceptRealizer.MultipliedUnitsParallelTestingCalculationCount", "Determines how many calculation jobs are created per realizer.", new CIntegerConfigType(8)), new CIntegerConfigType(8)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Realization.RealizePrecomputation.SameIndividuals", "Determines whether same individuals are precomputed if realization is requested.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Realization.RealizePrecomputation.ConceptInstances", "Determines whether concept instances are precomputed if realization is requested.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Realization.RealizePrecomputation.RoleInstances", "Determines whether role instances are precomputed if realization is requested.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Realization.IndividualDependenceTracking", "Determines whether dependent individuals are tracked for realization.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Realization.PossibleAssertionsCollecting", "Determines whether possible assertions are collected for realization.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Calculation.Realization.ExtraConsistencyTesting", "Determines whether a separate consistency test is performed for realization.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Ontology.Revision.BuildAfterModification", "Determines whether an ontology is automatically build after modification.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Ontology.Revision.PreprocessAfterModification", "Determines whether an ontology is automatically preprocess after modification.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Ontology.Revision.ConsistencyPrecomputationAfterModification", "Determines whether an ontology is automatically test consistency after modification.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Ontology.Revision.CyclesPrecomputationAfterModification", "Determines whether an ontology is automatically test consistency after modification.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Ontology.Revision.ClassifyAfterModification", "Determines whether an ontology is automatically classified after modification.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Ontology.Revision.IncrementalRebuild", "Determines whether an ontology is incrementally rebuild.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Ontology.Revision.BasementResolveKBName", "Determines which knowledge bases is used as basement for the creation of new knowledge bases.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.Query.Statistics.CollectStatistics", "Determines whether statistics are collected for queries.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Query.Statistics.CollectCalculationStatistics", "Determines whether statistics about calculations are collected.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Query.Statistics.CollectProcessingStepsStatistics", "Determines whether statistics about processing steps are collected.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); // Testing/Debugging configurations // Evaluation configurations addConfigProperty(new CConfigDescription("Konclude.Debugging.WriteDebuggingData", "If enabled (true) the reasoner writes some debugging data to standard files.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Analyse.UpdateInterval", "Update interval for reading analyse data.", new CIntegerConfigType(100)), new CIntegerConfigType(100)); addConfigProperty(new CConfigDescription("Konclude.Analyse.DelayedStartTime", "Wait time before start analyse data.", new CIntegerConfigType(0)), new CIntegerConfigType(0)); addConfigProperty(new CConfigDescription("Konclude.Analyse.CommonScale", "Plot analyse data with a common scale.", new CStringConfigType("AUTO")), new CStringConfigType("AUTO")); addConfigProperty(new CConfigDescription("Konclude.Analyse.PlotDifference", "Plot the difference of succeeding analyse data.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Analyse.LimitThreadCount", "Limits the threads for reading analyse data.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Analyse.FirstThreadNumber", "The first thread number that is used to read analyse data.", new CIntegerConfigType(0)), new CIntegerConfigType(0)); addConfigProperty(new CConfigDescription("Konclude.Analyse.LastThreadNumber", "The last thread number that is used to read analyse data.", new CIntegerConfigType(1000)), new CIntegerConfigType(1000)); addConfigProperty(new CConfigDescription("Konclude.Analyse.Classification.StatusText", "Read Status text from specified Classifier for analyse data.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Analyse.ReasonerManager.QueryTotalWorkCount", "Read QueryTotalWorkCount from Reasoner-Manager for analyse data.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Analyse.ReasonerManager.QueryCalcedWorkCount", "Read QueryCalcedWorkCount from Reasoner-Manager for analyse data.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Analyse.ReasonerManager.QueryProgress", "Read QueryProgress from Reasoner-Manager for analyse data.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Test.PigeonholePrincipleGenerator.ProblemSize", "Generating problem size of the pigeonhole principle.", new CIntegerConfigType(2)), new CIntegerConfigType(2)); addConfigProperty(new CConfigDescription("Konclude.Test.PigeonholePrincipleGenerator.OWLlinkOutputFile", "Output file for the generated pigeonhole principle.", new CStringConfigType("PHP-request-file.xml")), new CStringConfigType("PHP-request-file.xml")); addConfigProperty(new CConfigDescription("Konclude.Test.RecursionTestDataGenerator.IndividualCount", "Number of individual for the recursion test data.", new CIntegerConfigType(1000)), new CIntegerConfigType(1000)); addConfigProperty(new CConfigDescription("Konclude.Test.RecursionTestDataGenerator.PropertyAssertionCount", "Number of the property assertions for the recursion test data.", new CIntegerConfigType(200)), new CIntegerConfigType(200)); addConfigProperty(new CConfigDescription("Konclude.Test.RecursionTestDataGenerator.OWLlinkOutputFile", "Output file for the generated recursion test data.", new CStringConfigType("RecursionTestData.owl.xml")), new CStringConfigType("RecursionTestData.owl.xml")); addConfigProperty(new CConfigDescription("Konclude.Test.LargeJoinTestDataGenerator.IndividualCount", "Number of individual for the large join test data.", new CIntegerConfigType(1000)), new CIntegerConfigType(1000)); addConfigProperty(new CConfigDescription("Konclude.Test.LargeJoinTestDataGenerator.PropertyAssertionCount", "Number of the property assertions for the large join test data.", new CIntegerConfigType(200)), new CIntegerConfigType(200)); addConfigProperty(new CConfigDescription("Konclude.Test.LargeJoinTestDataGenerator.OWLlinkOutputFile", "Output file for the generated large join test data.", new CStringConfigType("LargeJoinTestData.owl.xml")), new CStringConfigType("LargeJoinTestData.owl.xml")); addConfigProperty(new CConfigDescription("Konclude.Test.TransitiveConnectedELClassesTestDataGenerator.ClassesCount", "Number of classes for the transitive connected EL classes test data.", new CIntegerConfigType(1000)), new CIntegerConfigType(1000)); addConfigProperty(new CConfigDescription("Konclude.Test.TransitiveConnectedELClassesTestDataGenerator.OWLlinkOutputFile", "Output file for the generated transitive connected EL classes test data.", new CStringConfigType("TransitivityConnectedELClassesTestData.owl.xml")), new CStringConfigType("TransitivityConnectedELClassesTestData.owl.xml")); addConfigProperty(new CConfigDescription("Konclude.Test.Converter.InputDirectory", "Input directory for converter.", new CStringConfigType("Tests/Converter/Input")), new CStringConfigType("Tests/Converter/Input")); addConfigProperty(new CConfigDescription("Konclude.Test.Converter.OutputDirectory", "Output directory for converter.", new CStringConfigType("Tests/Converter/Output")), new CStringConfigType("Tests/Converter/Output")); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.InputDirectory", "Input directory for converter.", new CStringConfigType("Evaluation/Generator/Input")), new CStringConfigType("Evaluation/Generator/Input")); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.OutputDirectory", "Output directory for converter.", new CStringConfigType("Tests/Generator/Output")), new CStringConfigType("Tests/Generator/Output")); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.FilterDirectory", "Filter directory for converter.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.OntologyStatisticsDirectory", "Output directory for tested evaluation tests.", new CStringConfigType("Evaluation/Infos/Statistics/Ontologies/")), new CStringConfigType("Evaluation/Infos/Statistics/Ontologies/")); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.FilterFile", "Path to filter file.", new CStringConfigType("Evaluation/Filters/ABoxFilter.txt")), new CStringConfigType("Evaluation/Filters/ABoxFilter.txt")); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.GenerateClassifyTests", "Determines whether classification tests are generated.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.GenerateConsistencyTests", "Determines whether consistency tests are generated.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.GenerateSatisfiabilityTests", "Determines whether satisfiability tests are generated.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.GenerateTypeTests", "Determines whether type tests are generated.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.GenerateRealizeTests", "Determines whether realization tests are generated.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.GenerateIncrementalAssertionConsistencyTests", "Determines whether incremental assertion consistency tests are generated.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionConsistencyTestsGeneration.AssertionAdditionCount", "Determines the number of assertion that are added for incremental consistency tests.", new CIntegerConfigType(10)), new CIntegerConfigType(10)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionConsistencyTestsGeneration.TestCount", "Determines the number incremental consistency tests.", new CIntegerConfigType(10)), new CIntegerConfigType(10)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionConsistencyTestsGeneration.AssertionRemovalCount", "Determines the number of assertion that are removed for incremental consistency tests.", new CIntegerConfigType(10)), new CIntegerConfigType(10)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionConsistencyTestsGeneration.RatioAdditionRemoval", "Determines whether the incremental changed assertion count for incremental consistency tests is determined by the ontology size ratio.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionConsistencyTestsGeneration.AssertionAdditionRatioDenominator", "Determines the denominator for the assertion ratio that are added for incremental consistency tests.", new CIntegerConfigType(1000)), new CIntegerConfigType(1000)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionConsistencyTestsGeneration.AssertionRemovalRatioDenominator", "Determines the denominator for the assertion ratio that are removed for incremental consistency tests.", new CIntegerConfigType(1000)), new CIntegerConfigType(1000)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.GenerateIncrementalAssertionClassificationTests", "Determines whether incremental assertion classification tests are generated.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionClassificationTestsGeneration.AssertionAdditionCount", "Determines the number of assertion that are added for incremental classification tests.", new CIntegerConfigType(10)), new CIntegerConfigType(10)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionClassificationTestsGeneration.TestCount", "Determines the number incremental classification tests.", new CIntegerConfigType(10)), new CIntegerConfigType(10)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionClassificationTestsGeneration.AssertionRemovalCount", "Determines the number of assertion that are removed for incremental classification tests.", new CIntegerConfigType(10)), new CIntegerConfigType(10)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionClassificationTestsGeneration.RatioAdditionRemoval", "Determines whether the incremental changed assertion count for incremental classification tests is determined by the ontology size ratio.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionClassificationTestsGeneration.AssertionAdditionRatioDenominator", "Determines the denominator for the assertion ratio that are added for incremental classification tests.", new CIntegerConfigType(1000)), new CIntegerConfigType(1000)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionClassificationTestsGeneration.AssertionRemovalRatioDenominator", "Determines the denominator for the assertion ratio that are removed for incremental classification tests.", new CIntegerConfigType(1000)), new CIntegerConfigType(1000)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.GenerateIncrementalAssertionRealizationTests", "Determines whether incremental assertion realization tests are generated.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionRealizationTestsGeneration.AssertionAdditionCount", "Determines the number of assertion that are added for incremental realization tests.", new CIntegerConfigType(10)), new CIntegerConfigType(10)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionRealizationTestsGeneration.TestCount", "Determines the number incremental realization tests.", new CIntegerConfigType(10)), new CIntegerConfigType(10)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionRealizationTestsGeneration.AssertionRemovalCount", "Determines the number of assertion that are removed for incremental realization tests.", new CIntegerConfigType(10)), new CIntegerConfigType(10)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionRealizationTestsGeneration.RatioAdditionRemoval", "Determines whether the incremental changed assertion count for incremental realization tests is determined by the ontology size ratio.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionRealizationTestsGeneration.AssertionAdditionRatioDenominator", "Determines the denominator for the assertion ratio that are added for incremental realization tests.", new CIntegerConfigType(1000)), new CIntegerConfigType(1000)); addConfigProperty(new CConfigDescription("Konclude.Test.Generator.IncrementalAssertionRealizationTestsGeneration.AssertionRemovalRatioDenominator", "Determines the denominator for the assertion ratio that are removed for incremental realization tests.", new CIntegerConfigType(1000)), new CIntegerConfigType(1000)); addConfigProperty(new CConfigDescription("Konclude.Debug.PrecheckReasoning", "Prechecking Query with Default Reasoner before Debugging.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Debug.FailAfterConsistencyConceptSaturation", "Fail after the saturation of concepts required for the consistency test for debugging.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Debug.FailAfterConsistencyCheck", "Fail after the consistency test for debugging.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Debug.FailAfterConceptSaturation", "Fail after the saturation of concepts for debugging.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Debug.FailAfterPreprocessing", "Fail after the preprocessing for debugging.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Debug.FailAfterBuilt", "Fail after the built for debugging.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Parser.UTF8CompatibilityEnforcedXMLStreamParsing", "Determines whether UTF-8 compatibility is enforced for stream-based XML parsing.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); // OWLLink configurations addConfigProperty(new CConfigDescription("Konclude.OWLlink.Version.Major", "Major version of OWLlink Interface implementation.", new CIntegerConfigType(KONCLUDE_OWLLINK_VERSION_MAJOR)), new CIntegerConfigType(KONCLUDE_OWLLINK_VERSION_MAJOR)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.Version.Minor", "Minor version of OWLlink Interface implementation.", new CIntegerConfigType(KONCLUDE_OWLLINK_VERSION_MINOR)), new CIntegerConfigType(KONCLUDE_OWLLINK_VERSION_MINOR)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.WriteResponseToStandardOutput", "Write OWLlink response direct to program standard output channel.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.WriteResponseToStandardError", "Write OWLlink response direct to program standard error output channel.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.CloseAfterProcessedRequest", "Close program after the OWLlink response has processed.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.BlockUntilProcessedRequest", "Blocks afterwards processing until request has finished.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.LoggingExtendedProcessingTimes", "Extended processing time logging.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.SAXBasedLoadOntologiesParsing", "SAX-based parsing for ontologies with load ontologies command.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.StreamBasedLoadOntologiesParsing", "Stream-based parsing for ontologies with load ontologies command.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.ExtendedErrorReporting", "Determines whether more detailed error messages are reported via OWLlink.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.AbbreviatedIRIs", "Using abbreviated IRIs.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.RequestFile", "Filepath for OWLlink request file loader.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.OWLlink.ResponseFile", "Filepath for writing OWLlink response file.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.OWLlink.IRIName", "IRI name for OWLlink.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.OWLlink.Test.RunTimeout", "Timeout for tests.", new CIntegerConfigType(60000)), new CIntegerConfigType(60000)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.Test.CloseTimeout", "Timeout for closing running tests.", new CIntegerConfigType(1000)), new CIntegerConfigType(1000)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.Test.KillTimeout", "Timeout for killing running tests.", new CIntegerConfigType(1000)), new CIntegerConfigType(1000)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.OWLlinkAPI.Address", "Address of the OWLlinkAPI based reasoner server.", new CStringConfigType("http://127.0.0.1:8080")), new CStringConfigType("http://127.0.0.1:8080")); addConfigProperty(new CConfigDescription("Konclude.OWLlink.OWLlinkAPI.RequestFileCompatibleModification", "Modifies the request file for OWLlinkAPI compatibility.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.OWLlinkAPI.ResponseFileTimeExtension", "Modifies the response file with response times.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.OWLlinkAPI.RequestFileAbsolutePathsModification", "Rewrites relative filepaths to absolute filepaths in request file.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.OWLlink.Server.Port", "Port of the OWLlink server.", new CIntegerConfigType(8080)), new CIntegerConfigType(8080)); addConfigProperty(new CConfigDescription("Konclude.CLI.RequestFile", "Filepath of request file for command line interface.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.CLI.ResponseFile", "Filepath of response file for command line interface.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.CLI.IRIName", "IRI name for command line interface.", new CStringConfigType("")), new CStringConfigType("")); // Evaluation configurations addConfigProperty(new CConfigDescription("Konclude.Evaluation.ProgramFile", "Evaluation program.", new CStringConfigType("Evaluation/EvaluationProgram.xml")), new CStringConfigType("Evaluation/EvaluationProgram.xml")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.ConfigFile", "Evaluation config.", new CStringConfigType("Evaluation/Configs/ExampleConfigFile.xml")), new CStringConfigType("Evaluation/Configs/ExampleConfigFile.xml")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Config.Name", "Evaluation config name.", new CStringConfigType("ExampleConfigName")), new CStringConfigType("ExampleConfigName")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Platform", "Platform for the Reasoners.", new CStringConfigType("UNSPECIFIED")), new CStringConfigType("UNSPECIFIED")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.Directory", "Reasoner directory.", new CStringConfigType("Evaluation/Reasoners/ExampleReasoner/v1.0/")), new CStringConfigType("Evaluation/Reasoners/ExampleReasoner/v1.0/")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.Name", "Name of the reasoner that is evaluated.", new CStringConfigType("ExampleReasoner v1.0")), new CStringConfigType("ExampleReasoner v1.0")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.OutputDirectory", "Output directory for the reasoner.", new CStringConfigType("ExampleReasoner/v1.0/")), new CStringConfigType("ExampleReasoner/v1.0/")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.ConfigFile", "Config file of the reasoner.", new CStringConfigType("Evaluation/Reasoners/ExampleReasoner/v1.0/reasonerConfig.xml")), new CStringConfigType("Evaluation/Reasoners/ExampleReasoner/v1.0/reasonerConfig.xml")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.InitializationFile", "Initialization file of the reasoner.", new CStringConfigType("Evaluation/Reasoners/ExampleReasoner/v1.0/reasonerInit.xml")), new CStringConfigType("Evaluation/Reasoners/ExampleReasoner/v1.0/reasonerInit.xml")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.ExecutionType", "How the reasoner is executed.", new CStringConfigType("Binary")), new CStringConfigType("Binary")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.Execution.Binary.File", "File of the binary.", new CStringConfigType("ExampleReasoner")), new CStringConfigType("ExampleReasoner")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.Execution.Binary.Arguments", "Arguments for the execution.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.Execution.OWLlinkOWLAPIServerAdapter.ClassPathLibraries", "ClassPath libraries for the execution.", new CStringConfigType("Evaluation/Reasoners/ExampleReasoner/v1.0/libs")), new CStringConfigType("Evaluation/Reasoners/ExampleReasoner/v1.0/libs")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.Execution.OWLlinkOWLAPIServerAdapter.ClassPathLibrariesSeparator", "Separater for class path libraries, usually ';' for Windows and ':' for Linux.", new CStringConfigType(";")), new CStringConfigType(";")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.Execution.OWLlinkOWLAPIServerAdapter.MainClass", "MainClass for the execution.", new CStringConfigType("com.examplereasoner.main")), new CStringConfigType("com.examplereasoner.main")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.Execution.OWLlinkOWLAPIServerAdapter.AdditionalParameters", "Additional parameters for the execution.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.Execution.OWLlinkOWLAPIServerAdapter.AdditionalProcess", "Additional process that has to be executed.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.Address.Port", "The port address of the reasoner for requests.", new CIntegerConfigType(8080)), new CIntegerConfigType(8080)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Reasoner.Address.IP", "The IP address of the reasoner for requests.", new CStringConfigType("127.0.0.1")), new CStringConfigType("127.0.0.1")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.InputDirectory", "Input directory for tested evaluation tests.", new CStringConfigType("Evaluation/Requests/")), new CStringConfigType("Evaluation/Requests/")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.OutputDirectory", "Output directory for tested evaluation tests.", new CStringConfigType("Evaluation/Responses/R-000/")), new CStringConfigType("Evaluation/Responses/R-000/")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.TestingCount", "The number how many times the same test is executed.", new CIntegerConfigType(10)), new CIntegerConfigType(10)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.TestingTimeout", "The time limit for the reasoner to complete a test.", new CIntegerConfigType(2*1000*60)), new CIntegerConfigType(2*1000*60)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.RequestTimeout", "The time limit for the reasoner to complete a single request.", new CIntegerConfigType(1000*60)), new CIntegerConfigType(1000*60)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.MemoryLimit", "The memory limit for the reasoner in bytes.", new CIntegerConfigType(1024*1024*1024*10)), new CIntegerConfigType(1024*1024*1024*10)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Analyser.CreateGNUPlots", "Determines whether the analysers create plots with GNU plot.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.Analyser.CreateHighchartsPlots", "Determines whether the analysers create plots with Highcharts.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.RequestFileAbsolutePathsModification", "Rewrites relative filepaths to absolute filepaths in request file.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.RequestReplaceLoadOntologiesWithTell", "Directly replaces load ontologies commands with tell commands in request files.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.ResolveAppreviatedIRIsForReplacedTells", "Directly resolves abbreviated IRIs for load ontologies commands that are replaced by tell commands in request files.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.CancelReasonerErrorCount", "After how many errors the evaluation for a reasoner is canceled.", new CIntegerConfigType(2)), new CIntegerConfigType(2)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.WaitingTimeBetweenTests", "Waiting time between tests in milliseconds.", new CIntegerConfigType(0)), new CIntegerConfigType(0)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.FirstTestsWarmingUp", "Determines whether the first test case in the evaluation is additionally executed at first without measurement.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.AllTestsWarmingUp", "Determines whether all test cases in the evaluation are additionally executed at first without measurement.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.WaitingTimeAfterReasonerCreation", "Waiting time after reasoner has created in milliseconds.", new CIntegerConfigType(false)), new CIntegerConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.SystemReadyRetestTimeForTests", "Waiting time for retest whether system is ready for next evaluation test in milliseconds.", new CIntegerConfigType(false)), new CIntegerConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.Evaluation.CriticalSystemProcessTesterProgram", "Program/Script/Command Line that returns 1 if there are running critical processes on the system.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.Evaluation.TerminateAssistProgram", "Program/Script/Command Line that is called with the process id to assist termination.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.CLI.Output.WriteDeclarations", "Determines whether declarations are also written to the output file.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.CLI.Output.AbbreviatedIRIs", "Determines whether abbreviated IRIs are used to write the output.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.CLI.Output.WriteOnlyDirectTypes", "Determines whether only direct types are written to the output file for realization tasks.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.CLI.Output.WriteReducedInconsistency", "Determines whether for inconsistent ontologies only SubclassOf(Top,Bottom) is written to the output.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.ORE.OperationTask", "Operation task that has to be tested.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.ORE.OntologyFile", "Ontologie file name.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.ORE.ResponseFile", "Response file name.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.ORE.IRIName", "IRI name for testing.", new CStringConfigType("")), new CStringConfigType("")); addConfigProperty(new CConfigDescription("Konclude.ORE.CloseAfterProcessed", "Determines whether the program is closed after the processing has finished.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.ORE.OutputTimeMeasurementInSeconds", "Determines the measured time is printed in seconds instead of milliseconds.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.ORE.ClassHierarchyResult.WriteDeclarations", "Determines whether declarations are also written to the output file for the class hierarchy.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.ORE.ClassHierarchyResult.AbbreviatedIRIs", "Determines whether abbreviated IRIs are used for the classes.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.ORE.ClassHierarchyResult.WriteDirectEquivalences", "Determines whether equivalences are directly written with equivalent classes axioms instead of several subclass axioms.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.ORE.ClassHierarchyResult.WriteReducedTopSubclasses", "Determines whether only SubclassOf(Top,A) axioms are written for all classes A that are semantically equivalent to Top.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.ORE.ClassHierarchyResult.WriteReducedBottomSubclasses", "Determines whether only SubclassOf(A,Bottom) axioms are written for all classes A that are semantically equivalent to Bottom.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.ORE.ClassHierarchyResult.WriteReducedInconsistency", "Determines whether only SubclassOf(Top,Bottom) is written for inconsistent ontologies.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.ORE.RealizationResult.WriteDeclarations", "Determines whether declarations are also written to the realization output file.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.ORE.RealizationResult.AbbreviatedIRIs", "Determines whether abbreviated IRIs are used for the individuals and classes.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.ORE.RealizationResult.WriteReducedInconsistency", "Determines whether only SubclassOf(Top,Bottom) is written for inconsistent ontologies.", new CBooleanConfigType(true)), new CBooleanConfigType(true)); addConfigProperty(new CConfigDescription("Konclude.ORE.RealizationResult.WriteOnlyDirectTypes", "Determines whether only direct types are written to the output file for realization tasks.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.ORE.ReportParsingTimeForConsistency", "Determines whether the parsing time is reported for the consistency checking reasoning task.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.ORE.ReportParsingTimeForSatisfiability", "Determines whether the parsing time is reported for the satisfiability checking reasoning task.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.ORE.ReportParsingTimeForRealization", "Determines whether the parsing time is reported for the realization reasoning task.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); addConfigProperty(new CConfigDescription("Konclude.ORE.ReportParsingTimeForClassification", "Determines whether the parsing time is reported for the classification reasoning task.", new CBooleanConfigType(false)), new CBooleanConfigType(false)); } CReasonerConfigurationGroup::~CReasonerConfigurationGroup() { } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Events/0000755000175000017500000000000012613407250022524 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Events/CCommandProcessedCallbackEvent.cpp0000644000175000017500000000303512520756332031206 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandProcessedCallbackEvent.h" namespace Konclude { namespace Control { namespace Command { namespace Events { CCommandProcessedCallbackEvent::CCommandProcessedCallbackEvent(CThread *eventReceiver, CCommand *command) : CCustomEvent(EVENTTYPE) { comm = command; receiver = eventReceiver; } CCommandProcessedCallbackEvent::~CCommandProcessedCallbackEvent() { } CCommand *CCommandProcessedCallbackEvent::getCommand() { return comm; } void CCommandProcessedCallbackEvent::doCallback() { if (receiver) { receiver->postEvent(this); } } }; // end namespace Events }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Events/CRealizeCommandEvent.h0000644000175000017500000000401012520756334026676 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_EVENTS_CREALIZECOMMANDEVENT_H #define KONCLUDE_Control_COMMAND_EVENTS_CREALIZECOMMANDEVENT_H // Libraries includes // Namespace includes #include "../CommandSettings.h" #include "../CCommand.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Control { namespace Command { namespace Events { /*! * \class CRealizeCommandEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CRealizeCommandEvent : public CCustomEvent { // public methods public: //! Constructor CRealizeCommandEvent(CCommand *command); //! Destructor virtual ~CRealizeCommandEvent(); virtual CCommand *getCommand(); // protected methods protected: // protected variables protected: CCommand *comm; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_EVENTS_CREALIZECOMMANDEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Events/CInitializeEvent.cpp0000644000175000017500000000225212520756334026446 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CInitializeEvent.h" namespace Konclude { namespace Control { namespace Command { namespace Events { CInitializeEvent::CInitializeEvent() : CCustomEvent(EVENTINITIALIZE) { } CInitializeEvent::~CInitializeEvent() { } }; // end namespace Events }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Events/COntologyPreparedCallbackEvent.h0000644000175000017500000000441412520756334030726 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_EVENTS_CONTOLOGYPREPAREDCALLBACKEVENT_H #define KONCLUDE_CONTROL_COMMAND_EVENTS_CONTOLOGYPREPAREDCALLBACKEVENT_H // Libraries includes // Namespace includes #include "../CommandSettings.h" #include "../CCommand.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Control { namespace Command { namespace Events { /*! * \class COntologyPreparedCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class COntologyPreparedCallbackEvent : public CCustomEvent, public CCallbackData { // public methods public: //! Constructor COntologyPreparedCallbackEvent(CThread *eventReceiver, CCommand *command); //! Destructor virtual ~COntologyPreparedCallbackEvent(); virtual CCommand *getCommand(); virtual void doCallback(); // protected methods protected: // protected variables protected: CCommand *comm; CThread *receiver; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_EVENTS_CONTOLOGYPREPAREDCALLBACKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Events/CCommandPreconditionChangeEvent.h0000644000175000017500000000442312520756332031054 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_EVENTS_CCOMMANDPRECONDITIONCHANGEEVENT_H #define KONCLUDE_Control_COMMAND_EVENTS_CCOMMANDPRECONDITIONCHANGEEVENT_H // Libraries includes // Namespace includes #include "../CommandSettings.h" #include "../CCommand.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Control { namespace Command { namespace Events { /*! * \class CCommandPreconditionChangeEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CCommandPreconditionChangeEvent : public CCustomEvent, public CCallbackData { // public methods public: //! Constructor CCommandPreconditionChangeEvent(CThread *eventReceiver, CCommand *command); //! Destructor virtual ~CCommandPreconditionChangeEvent(); virtual CCommand *getCommand(); virtual void doCallback(); // protected methods protected: // protected variables protected: CCommand *comm; CThread *receiver; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_EVENTS_CCOMMANDPRECONDITIONCHANGEEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Events/CCommandProcessedCallbackEvent.h0000644000175000017500000000453012520756334030656 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_EVENTS_CCOMMANDPROCESSEDCALLBACKEVENT_H #define KONCLUDE_Control_COMMAND_EVENTS_CCOMMANDPROCESSEDCALLBACKEVENT_H // Libraries includes // Namespace includes #include "../CommandSettings.h" #include "../CCommand.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Control { namespace Command { namespace Events { /*! * \class CCommandProcessedCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CCommandProcessedCallbackEvent : public CCustomEvent, public CCallbackData { // public methods public: //! Constructor CCommandProcessedCallbackEvent(CThread *eventReceiver, CCommand *command); //! Destructor virtual ~CCommandProcessedCallbackEvent(); static const QEvent::Type EVENTTYPE = EVENTCOMMANDPROCESSEDCALLBACK; virtual CCommand *getCommand(); virtual void doCallback(); // protected methods protected: // protected variables protected: CCommand *comm; CThread *receiver; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_EVENTS_CCOMMANDPROCESSEDCALLBACKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Events/CCommandCalculatedQueryCallbackEvent.h0000644000175000017500000000446612520756332032024 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_EVENTS_CCOMMANDCALCULATEDQUERYCALLBACKEVENT_H #define KONCLUDE_Control_COMMAND_EVENTS_CCOMMANDCALCULATEDQUERYCALLBACKEVENT_H // Libraries includes // Namespace includes #include "../CommandSettings.h" #include "../CCommand.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Control { namespace Command { namespace Events { /*! * \class CCommandCalculatedQueryCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CCommandCalculatedQueryCallbackEvent : public CCustomEvent, public CCallbackData { // public methods public: //! Constructor CCommandCalculatedQueryCallbackEvent(CThread *eventReceiver, CCommand *command); //! Destructor virtual ~CCommandCalculatedQueryCallbackEvent(); virtual CCommand *getCommand(); virtual void doCallback(); // protected methods protected: // protected variables protected: CCommand *comm; CThread *receiver; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_EVENTS_CCOMMANDCALCULATEDQUERYCALLBACKEVENT_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Events/CCommandCalculatedQueryCallbackEvent.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Events/CCommandCalculatedQueryCallbackEvent.cp0000644000175000017500000000314712520756332032172 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandCalculatedQueryCallbackEvent.h" namespace Konclude { namespace Control { namespace Command { namespace Events { CCommandCalculatedQueryCallbackEvent::CCommandCalculatedQueryCallbackEvent(CThread *eventReceiver, CCommand *command) : CCustomEvent(EVENTCOMMANDCALCULATEDQUERYCALLBACK) { comm = command; receiver = eventReceiver; } CCommandCalculatedQueryCallbackEvent::~CCommandCalculatedQueryCallbackEvent() { } CCommand *CCommandCalculatedQueryCallbackEvent::getCommand() { return comm; } void CCommandCalculatedQueryCallbackEvent::doCallback() { if (receiver) { receiver->postEvent(this); } } }; // end namespace Events }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Events/CCommandPreconditionChangeEvent.cpp0000644000175000017500000000306712520756332031412 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandPreconditionChangeEvent.h" namespace Konclude { namespace Control { namespace Command { namespace Events { CCommandPreconditionChangeEvent::CCommandPreconditionChangeEvent(CThread *eventReceiver, CCommand *command) : CCustomEvent(EVENTCOMMANDPRECONDITIONCHANGE) { comm = command; receiver = eventReceiver; } CCommandPreconditionChangeEvent::~CCommandPreconditionChangeEvent() { } CCommand *CCommandPreconditionChangeEvent::getCommand() { return comm; } void CCommandPreconditionChangeEvent::doCallback() { if (receiver) { receiver->postEvent(this); } } }; // end namespace Events }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Events/COntologyPreparedCallbackEvent.cpp0000644000175000017500000000306712520756334031264 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyPreparedCallbackEvent.h" namespace Konclude { namespace Control { namespace Command { namespace Events { COntologyPreparedCallbackEvent::COntologyPreparedCallbackEvent(CThread *eventReceiver, CCommand *command) : CCustomEvent(EVENTONTOLOGYPREPAREDCALLBACK) { comm = command; receiver = eventReceiver; } COntologyPreparedCallbackEvent::~COntologyPreparedCallbackEvent() { } CCommand *COntologyPreparedCallbackEvent::getCommand() { return comm; } void COntologyPreparedCallbackEvent::doCallback() { if (receiver) { receiver->postEvent(this); } } }; // end namespace Events }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Events/CRealizeCommandEvent.cpp0000644000175000017500000000246612520756334027246 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRealizeCommandEvent.h" namespace Konclude { namespace Control { namespace Command { namespace Events { CRealizeCommandEvent::CRealizeCommandEvent(CCommand *command) : CCustomEvent(EVENTREALIZECOMMAND) { comm = command; } CRealizeCommandEvent::~CRealizeCommandEvent() { } CCommand *CRealizeCommandEvent::getCommand() { return comm; } }; // end namespace Events }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Events/CInitializeEvent.h0000644000175000017500000000363612520756334026122 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_EVENTS_CINITIALIZEEVENT_H #define KONCLUDE_Control_COMMAND_EVENTS_CINITIALIZEEVENT_H // Libraries includes // Namespace includes #include "../CommandSettings.h" #include "../CCommand.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Control { namespace Command { namespace Events { /*! * \class CInitializeEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CInitializeEvent : public CCustomEvent { // public methods public: //! Constructor CInitializeEvent(); //! Destructor virtual ~CInitializeEvent(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_EVENTS_CINITIALIZEEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CDefaultCommanderInitializationFactory.h0000644000175000017500000000710312520756352031216 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CDEFAULTCOMMANDERINITIALIZATIONFACTORY_H #define KONCLUDE_Control_COMMAND_CDEFAULTCOMMANDERINITIALIZATIONFACTORY_H // Libraries includes // Namespace includes #include "CCommand.h" #include "CCommanderInitializationFactory.h" #include "CConfigManagerReader.h" // Other includes #include "Reasoner/Kernel/Manager/CAnalyseReasonerManager.h" #include "Reasoner/Kernel/Manager/CExperimentalReasonerManager.h" #include "Reasoner/Kernel/Manager/CReasonerManagerThread.h" #include "Reasoner/Classifier/CClassificationManager.h" #include "Reasoner/Classifier/CConfigDependedSubsumptionClassifierFactory.h" #include "Reasoner/Revision/CSPOntologyRevisionManager.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Reasoner::Kernel; using namespace Reasoner::Classifier; using namespace Reasoner::Revision; using namespace Reasoner::Kernel::Manager; namespace Control { namespace Command { /*! * * \class CDefaultCommanderInitializationFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDefaultCommanderInitializationFactory : public CCommanderInitializationFactory { // public methods public: //! Constructor CDefaultCommanderInitializationFactory(CReasonerManager *useReasonerManager = 0, CClassificationManager *useClassificationManager = 0, COntologyRevisionManager *useOntologyRevisionManager = 0); //! Destructor virtual ~CDefaultCommanderInitializationFactory(); virtual CReasonerManager *createReasonerManager(CConfigurationProvider *configProvider); virtual CClassificationManager *createClassificationManager(CConfigurationProvider *configProvider); virtual COntologyRevisionManager *createOntologyRevisionManager(CConfigurationProvider *configProvider); virtual CCommanderInitializationFactory *initializeReasonerManager(CReasonerManager *reasonerManager, CConfigurationProvider *configProvider); virtual CCommanderInitializationFactory *initializeClassificationManager(CClassificationManager *classificationManager, CConfigurationProvider *configProvider); virtual CCommanderInitializationFactory *initializeOntologyRevisionManager(COntologyRevisionManager *ontologyRevisionManager, CConfigurationProvider *configProvider); // protected methods protected: // protected variables protected: CReasonerManager *useReasonerMan; CClassificationManager *useClassificationMan; COntologyRevisionManager *useOntRevMan; // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CDEFAULTCOMMANDERINITIALIZATIONFACTORY_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CReasonerCommanderGlobalConfiguration.h0000644000175000017500000000552312520756354031027 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CREASONERCOMMANDERGLOBALCONFIGURATION_H #define KONCLUDE_Control_COMMAND_CREASONERCOMMANDERGLOBALCONFIGURATION_H // Libraries includes #include // Namespace includes #include "CReasonerConfigurationGroup.h" // Other includes #include "Config/CConfiguration.h" #include "Config/CGlobalConfigurationBase.h" #include "Config/CGlobalConfigurationProvider.h" #include "Utilities/CSingletonProvider.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Utilities; namespace Control { namespace Command { /*! * * \class CReasonerCommanderGlobalConfiguration * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerCommanderGlobalConfiguration : public CGlobalConfigurationProvider { // public methods public: //! Constructor CReasonerCommanderGlobalConfiguration(CConfiguration *initialConfiguration = 0); //! Destructor virtual ~CReasonerCommanderGlobalConfiguration(); virtual CGlobalConfigurationBase *getCurrentGlobalConfiguration(); virtual qint64 getNextUniqueConfigID(); virtual bool installGlobalConfiguration(CGlobalConfigurationBase *configuration); virtual CGlobalConfigurationBase *createNextGlobalConfiguration(); // protected methods protected: virtual CGlobalConfigurationBase *loadGlobalReasonerConfiguration(); virtual CReasonerCommanderGlobalConfiguration *saveGlobalReasonerConfiguration(CGlobalConfigurationBase *configuration); // protected variables protected: CConfigurationBase *initConf; CGlobalConfigurationBase *lastPersConf; QLinkedList configContainer; qint64 nextUniqueConfigID; QMutex idSyncMutex; // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CREASONERCOMMANDERGLOBALCONFIGURATION_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CPreconditionCommand.cpp0000644000175000017500000000471212520756354026040 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreconditionCommand.h" namespace Konclude { namespace Control { namespace Command { CPreconditionCommand::CPreconditionCommand(CCommand *parentSuperCommand) : CCommand(parentSuperCommand) { commandPreconditionLinker = 0; } CPreconditionCommand::~CPreconditionCommand() { } CLinker *CPreconditionCommand::getCommandPreconditionLinker() { return commandPreconditionLinker; } CPreconditionCommand *CPreconditionCommand::addCommandPrecondition(CCommandPrecondition *takeCommandPrecondition) { commandPreconditionLinker = new CLinker(takeCommandPrecondition,commandPreconditionLinker); return this; } bool CPreconditionCommand::isProcessable() { if (isProcessed()) { return false; } CLinker *preconIt = commandPreconditionLinker; while (preconIt) { if (!preconIt->getData()->isPreconditionFullfilled()) { return false; } preconIt = preconIt->getNext(); } return true; } CCommand *CPreconditionCommand::deleteDependencies() { deletePreconditions(); return this; } CPreconditionCommand *CPreconditionCommand::deletePreconditions() { while (commandPreconditionLinker) { CCommandPrecondition *pre = commandPreconditionLinker->getData(); delete pre; CLinker *tmpPreIt = commandPreconditionLinker; commandPreconditionLinker = (CLinker *)commandPreconditionLinker->getNext(); delete tmpPreIt; } return this; } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommanderInitializationFactory.h0000644000175000017500000000573212520756352027717 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCOMMANDERINITIALIZATIONFACTORY_H #define KONCLUDE_Control_COMMAND_CCOMMANDERINITIALIZATIONFACTORY_H // Libraries includes // Namespace includes #include "CCommand.h" // Other includes #include "Config/CConfiguration.h" #include "Reasoner/Kernel/Manager/CReasonerManager.h" #include "Reasoner/Classifier/CClassificationManager.h" #include "Reasoner/Revision/COntologyRevisionManager.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Config; using namespace Reasoner::Kernel::Manager; using namespace Reasoner::Classifier; using namespace Reasoner::Revision; namespace Control { namespace Command { /*! * * \class CCommanderInitializationFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommanderInitializationFactory { // public methods public: //! Constructor CCommanderInitializationFactory(); //! Destructor virtual ~CCommanderInitializationFactory(); virtual CReasonerManager *createReasonerManager(CConfigurationProvider *configProvider) = 0; virtual CClassificationManager *createClassificationManager(CConfigurationProvider *configProvider) = 0; virtual COntologyRevisionManager *createOntologyRevisionManager(CConfigurationProvider *configProvider) = 0; virtual CCommanderInitializationFactory *initializeReasonerManager(CReasonerManager *reasonerManager, CConfigurationProvider *configProvider) = 0; virtual CCommanderInitializationFactory *initializeClassificationManager(CClassificationManager *classificationManager, CConfigurationProvider *configProvider) = 0; virtual CCommanderInitializationFactory *initializeOntologyRevisionManager(COntologyRevisionManager *ontologyRevisionManager, CConfigurationProvider *configProvider) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCOMMANDERINITIALIZATIONFACTORY_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandRecordRouter.h0000644000175000017500000000430612520756352025464 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCOMMANDRECORDROUTER_H #define KONCLUDE_Control_COMMAND_CCOMMANDRECORDROUTER_H // Libraries includes #include // Namespace includes #include "CommandSettings.h" #include "CCommandRecordData.h" // Other includes #include "Logger/CLogIdentifier.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Control { namespace Command { /*! * * \class CCommandRecordRouter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommandRecordRouter { // public methods public: //! Constructor CCommandRecordRouter(CCommand *command, CLogIdentifier *logIdentifier); CCommandRecordRouter(CCommandRecordRouter &commandRecordRouter, CLogIdentifier *logIdentifier); //! Destructor virtual ~CCommandRecordRouter(); virtual CCommand *getCommand(); virtual CCommandRecorder *getCommandRecorder(); virtual QString getLogDomain(); // protected methods protected: // protected variables protected: CCommandRecorder *commRecorder; CCommand *comm; CLogIdentifier *identifier; // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCOMMANDRECORDROUTER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CPreconditionCommand.h0000644000175000017500000000442112520756354025502 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CPRECONDITIONCOMMAND_H #define KONCLUDE_Control_COMMAND_CPRECONDITIONCOMMAND_H // Libraries includes #include // Namespace includes #include "CCommand.h" #include "CCommandPrecondition.h" // Other includes #include "Utilities/CLinker.hpp" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { /*! * * \class CPreconditionCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPreconditionCommand : public CCommand { // public methods public: //! Constructor CPreconditionCommand(CCommand *parentSuperCommand = 0); //! Destructor virtual ~CPreconditionCommand(); virtual CLinker *getCommandPreconditionLinker(); virtual CPreconditionCommand *addCommandPrecondition(CCommandPrecondition *takeCommandPrecondition); virtual bool isProcessable(); virtual CCommand *deleteDependencies(); virtual CPreconditionCommand *deletePreconditions(); // protected methods protected: // protected variables protected: CLinker *commandPreconditionLinker; // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CPRECONDITIONCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandRecordRouter.cpp0000644000175000017500000000360212520756352026015 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandRecordRouter.h" namespace Konclude { namespace Control { namespace Command { CCommandRecordRouter::CCommandRecordRouter(CCommand *command, CLogIdentifier *logIdentifier) { comm = command; commRecorder = nullptr; if (comm) { commRecorder = comm->getRecorder(); } identifier = logIdentifier; } CCommandRecordRouter::CCommandRecordRouter(CCommandRecordRouter &commandRecordRouter, CLogIdentifier *logIdentifier) { comm = commandRecordRouter.getCommand(); commRecorder = commandRecordRouter.getCommandRecorder(); identifier = logIdentifier; } CCommandRecordRouter::~CCommandRecordRouter() { } CCommand *CCommandRecordRouter::getCommand() { return comm; } CCommandRecorder *CCommandRecordRouter::getCommandRecorder() { return commRecorder; } QString CCommandRecordRouter::getLogDomain() { QString logDomain; if (identifier) { logDomain = identifier->getLogDomain(); } return logDomain; } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CPreconditionSynchronizer.h0000644000175000017500000000452012520756354026621 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CPRECONDITIONSYNCHRONIZER_H #define KONCLUDE_Control_COMMAND_CPRECONDITIONSYNCHRONIZER_H // Libraries includes #include // Namespace includes #include "CCommandDelegater.h" #include "CPreconditionCommand.h" // Other includes #include "Control/Command/Events/CCommandPreconditionChangeEvent.h" #include "Concurrent/Callback/CCallbackData.h" #include "Concurrent/CThread.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Concurrent; using namespace Callback; namespace Control { namespace Command { using namespace Events; /*! * * \class CPreconditionSynchronizer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPreconditionSynchronizer : public CThread, public CCommandDelegater { // public methods public: //! Constructor CPreconditionSynchronizer(CCommandDelegater *commandDelegater); //! Destructor virtual ~CPreconditionSynchronizer(); virtual CCommandDelegater *delegateCommand(CCommand *command); // protected methods protected: virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); // protected variables protected: CCommandDelegater *delegater; // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CPRECONDITIONSYNCHRONIZER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandRecordData.cpp0000644000175000017500000000426012520756352025407 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandRecordData.h" namespace Konclude { namespace Control { namespace Command { CCommandRecordData::CCommandRecordData(CCommand *command, const QString &recordDomain, double recordErrorLevel, CCommandRecordData *nextRecordData) : CContextRecordData(recordErrorLevel,nextRecordData) { comm = command; recDomain = recordDomain; prevCommandRecordData = nextRecordData; } CCommandRecordData::~CCommandRecordData() { } CCommand *CCommandRecordData::getCommand() { return comm; } CCommandRecordData *CCommandRecordData::setCommand(CCommand *command) { comm = command; return this; } QString CCommandRecordData::getRecordDomain() { return recDomain; } CCommandRecordData *CCommandRecordData::setRecordDomain(const QString &recordDomain) { recDomain = recordDomain; return this; } CCommandRecordData *CCommandRecordData::getNextCommandRecordData() { return prevCommandRecordData; } CContextRecordData *CCommandRecordData::setNextRecordData(CContextRecordData *recordData) { CContextRecordData::setNextRecordData(recordData); CCommandRecordData *commRecData = dynamic_cast(recordData); if (commRecData) { prevCommandRecordData = commRecData; } return this; } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandExecutedBlocker.cpp0000644000175000017500000000270212520756352026446 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandExecutedBlocker.h" namespace Konclude { namespace Control { namespace Command { CCommandExecutedBlocker::CCommandExecutedBlocker() { } CCommandExecutedBlocker::~CCommandExecutedBlocker() { } bool CCommandExecutedBlocker::waitExecutedCommand(CCommand *blockingCommand) { bool processed = false; CBlockingCallbackData blockingCallback; if (blockingCommand) { blockingCommand->addProcessedCallback(&blockingCallback); blockingCallback.waitForCallback(); processed = true; } return processed; } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandPrecondition.h0000644000175000017500000000375712520756352025513 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCOMMANDPRECONDITION_H #define KONCLUDE_Control_COMMAND_CCOMMANDPRECONDITION_H // Libraries includes #include // Namespace includes // Other includes #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Concurrent; using namespace Callback; namespace Control { namespace Command { /*! * * \class CCommandPrecondition * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommandPrecondition { // public methods public: //! Constructor CCommandPrecondition(); //! Destructor virtual ~CCommandPrecondition(); virtual bool isPreconditionFullfilled() = 0; virtual CCommandPrecondition *addFullfilledCallback(CCallbackData *callback) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCOMMANDPRECONDITION_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CReasonerCommandBuilder.cpp0000644000175000017500000000312512520756354026465 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerCommandBuilder.h" namespace Konclude { namespace Control { namespace Command { CReasonerCommandBuilder::CReasonerCommandBuilder() { } CReasonerCommandBuilder::~CReasonerCommandBuilder() { } CSetConfigCommand *CReasonerCommandBuilder::createSetConfigCommand(const QString &configName, const QString &configValue, CContextRecorder *record) { CSetConfigCommand *setCommand = new CSetConfigCommand(configName,configValue); return setCommand; } CGetConfigCommand *CReasonerCommandBuilder::createGetConfigCommand(const QString &configName, CContextRecorder *record) { CGetConfigCommand *getCommand = new CGetConfigCommand(configName); return getCommand; } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CReasonerConfigurationGroup.h0000644000175000017500000000436212520756354027075 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CREASONERCONFIGURATIONGROUP_H #define KONCLUDE_Control_COMMAND_CREASONERCONFIGURATIONGROUP_H // Libraries includes #include // Namespace includes #include "CCommanderManagerConfigType.h" #include "CReasonerManagerConfigType.h" #include "CClassificationManagerConfigType.h" #include "COntologyRevisionManagerConfigType.h" // Other includes #include "Config/CConfigurationGroup.h" #include "Config/CIntegerConfigType.h" #include "Config/CStringConfigType.h" #include "Config/CBooleanConfigType.h" #include "Config/CConfigDescription.h" #include "KoncludeSettings.h" #include "CKoncludeInfo.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Control { namespace Command { /*! * * \class CReasonerConfigurationGroup * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerConfigurationGroup : public CConfigurationGroup { // public methods public: //! Constructor CReasonerConfigurationGroup(); //! Destructor virtual ~CReasonerConfigurationGroup(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CREASONERCONFIGURATIONGROUP_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommand.cpp0000644000175000017500000001552112520756350023456 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommand.h" #include "Records/CClosureProcessCommandRecord.h" namespace Konclude { namespace Control { namespace Command { using namespace Records; CCommand::CCommand(CCommand *parentSuperCommand) { subCommandLinker = 0; superCommand = parentSuperCommand; processed = false; processing = false; recordData = 0; recorder = 0; closured = false; errorLevel = 0; mUnclosedCommandCount = 1; if (parentSuperCommand) { parentSuperCommand->makeToSubCommand(this); } reportErrorFromSubCommands = true; } CCommand::~CCommand() { deleteDependencies(); } bool CCommand::hasReportErrorFromSubCommands() { return reportErrorFromSubCommands; } CCommand *CCommand::setReportErrorFromSubCommands(bool reportSubCommandErrors) { reportErrorFromSubCommands = reportSubCommandErrors; return this; } double CCommand::getMaxErrorLevel() { return errorLevel; } CCommand *CCommand::reportError(double errorLevelReport) { if (errorLevelReport > errorLevel) { errorSyncMutex.lock(); errorLevel = qMax(errorLevel,errorLevelReport); errorSyncMutex.unlock(); if (superCommand && superCommand->hasReportErrorFromSubCommands()) { superCommand->reportError(errorLevelReport); } } return this; } CLinker *CCommand::getSubCommandLinker() { return subCommandLinker; } CCommand *CCommand::addSubCommand(CCommand *subCommand) { subCommandLinker = new CLinker(subCommand,subCommandLinker); return this; } CCommand *CCommand::makeToSubCommand(CCommand *subCommand) { ++mUnclosedCommandCount; addSubCommand(subCommand); subCommand->setSuperCommand(this); subCommand->setRecorder(recorder); return this; } CCommand *CCommand::getSuperCommand() { return superCommand; } CCommand *CCommand::setSuperCommand(CCommand *parentSuperCommand) { superCommand = parentSuperCommand; return this; } CCommand *CCommand::setProcessed(bool processedCommand) { if (processed) { closureSyncMutex.lock(); mUnclosedCommandCount++; processed = processedCommand; closureSyncMutex.unlock(); } else { processed = processedCommand; reduceUnclosedCheckCallback(); } return this; } bool CCommand::areAllSubCommandsProcessed() { bool allSubCommPro = true; CLinker *subCommIt = subCommandLinker; while (subCommIt) { CCommand *subCommand = subCommIt->getData(); if (!subCommand->isProcessed()) { allSubCommPro = false; break; } subCommIt = (CLinker *)subCommIt->getNext(); } return allSubCommPro; } bool CCommand::isProcessed() { return mUnclosedCommandCount <= 0; } bool CCommand::isThisCommandProcessed() { return processed; } CCommand *CCommand::getNextProcessableSubCommand() { CLinker *subCommandIt = subCommandLinker; while (subCommandIt) { CCommand *subCommand = subCommandIt->getData(); if (subCommand && subCommand->isProcessable() && !subCommand->isProcessing()) { return subCommand; } } return 0; } QString CCommand::getBriefCommandDescription() { return QString("Undefined Command"); } CCommand *CCommand::setProcessing(bool processingCommand) { processing = processingCommand; return this; } bool CCommand::isProcessing() { return processing; } CCommandRecordData *CCommand::getRecordData() { return recordData; } CCommand *CCommand::setRecordData(CCommandRecordData *takeRecordData) { if (recordData) { delete recordData; } recordData = takeRecordData; return this; } CCommand *CCommand::overwriteRecordData(CCommandRecordData *takeRecordData) { recordData = takeRecordData; return this; } CCommand *CCommand::appendRecordData(CCommandRecordData *takeRecordData) { takeRecordData->setNextRecordData(recordData); recordData = takeRecordData; return this; } CCommandRecorder *CCommand::getRecorder() { return recorder; } CCommand *CCommand::setRecorder(CCommandRecorder *useCommandRecorder) { recorder = useCommandRecorder; return this; } CCommand *CCommand::deleteDependencies() { deleteSubCommands(); deleteRecordData(); return this; } CCommand *CCommand::deleteSubCommands() { CLinker *subCommandIt = subCommandLinker; while (subCommandIt) { CCommand *subCommand = subCommandIt->getData(); subCommand->deleteDependencies(); delete subCommand; CLinker *tmpSubCommIt = subCommandIt; subCommandIt = (CLinker *)subCommandIt->getNext(); delete tmpSubCommIt; } return this; } CCommand *CCommand::deleteRecordData() { CCommandRecordData *recordIt = recordData; while (recordIt) { CCommandRecordData *tmpRecordData = recordIt; recordIt = recordIt->getNextCommandRecordData(); delete tmpRecordData; } return this; } CCommand *CCommand::addProcessedCallback(CCallbackData *callback) { if (isProcessed()) { callback->doCallback(); } else { processedCallbackExecuter.addCallbackData(callback); } return this; } CCommand* CCommand::closedSubCommand() { reduceUnclosedCheckCallback(); return this; } CCommand *CCommand::reduceUnclosedCheckCallback() { closureSyncMutex.lock(); mUnclosedCommandCount--; bool closeCommand = false; if (mUnclosedCommandCount == 0) { closeCommand = true; } closureSyncMutex.unlock(); if (!closured && closeCommand) { CClosureProcessCommandRecord::makeRecord(recorder,"::Konclude::Command::Command",this); closured = true; CCommand* tmpSuperCommand = superCommand; processedCallbackExecuter.doCallback(); if (tmpSuperCommand) { tmpSuperCommand->closedSubCommand(); } } return this; } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandDelegater.cpp0000644000175000017500000000211612520756350025267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandDelegater.h" namespace Konclude { namespace Control { namespace Command { CCommandDelegater::CCommandDelegater() { } CCommandDelegater::~CCommandDelegater() { } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CReasonerManagerConfigType.cpp0000644000175000017500000000355112520756354027145 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerManagerConfigType.h" namespace Konclude { namespace Control { namespace Command { CReasonerManagerConfigType::CReasonerManagerConfigType(CReasonerManager *reasonerManager) { rManager = reasonerManager; } CReasonerManagerConfigType::~CReasonerManagerConfigType() { } CReasonerManagerConfigType *CReasonerManagerConfigType::getTypeCopy() { return new CReasonerManagerConfigType(rManager); } CReasonerManager *CReasonerManagerConfigType::getReasonerManager() { return rManager; } CReasonerManagerConfigType *CReasonerManagerConfigType::setReasonerManager(CReasonerManager *reasonerManager) { rManager = reasonerManager; return this; } bool CReasonerManagerConfigType::equals(CConfigType *dataType) { CReasonerManagerConfigType *rCommanderType = dynamic_cast(dataType); if (rCommanderType) { return (rManager == rCommanderType->rManager); } return false; } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CommandSettings.h0000644000175000017500000001725112520756352024545 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_COMMANDSETTINGS #define KONCLUDE_Control_COMMAND_COMMANDSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Control { namespace Command { /*! * * \file CommandSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CCommandRecorder; class CCommandRecordData; class CCommand; class CCommandRecordRouter; // Command Tags const qint64 INITIALIZECONFIGURATIONCOMMAND = 2001; const qint64 INITIALIZEREASONERCOMMAND = 2002; const qint64 GETCONFIGURATIONCOMMAND = 2003; const qint64 SETCONFIGURATIONCOMMAND = 2004; const qint64 GETDESCRIPTIONCOMMAND = 2005; const qint64 PARSECOMMANDSCOMMAND = 2006; const qint64 PARSEOWLLINKCOMMANDSCOMMAND = 2007; const qint64 CREATEKNOWLEDGEBASECOMMAND = 2008; const qint64 TELLKNOWLEDGEBASEOWL2XMLCOMMAND = 2009; const qint64 CREATEKNOWLEDGEBASEREVISIONCOMMAND = 2010; const qint64 PARSEOWL2XMLONTOLOGYCOMMAND = 2011; const qint64 INSTALLKNOWLEDGEBASEREVISIONCOMMAND = 2012; const qint64 PARSEOWL2XMLQUERYCOMMAND = 2013; const qint64 CALCULATEQUERYCOMMAND = 2014; const qint64 GETCURRENTKNOWLEDGEBASEREVISIONCOMMAND = 2015; const qint64 SATISFIABLEQUERYKNOWLEDGEBASEOWL2XMLCOMMAND = 2016; const qint64 SKIPUNSUPPORTEDCOMMANDCOMMAND = 2017; const qint64 RELEASEKNOWLEDGEBASECOMMAND = 2018; const qint64 GETREASONERCOMMAND = 2019; const qint64 EQUIVALENCEQUERYKNOWLEDGEBASEOWL2XMLCOMMAND = 2020; const qint64 SUBSUMEDQUERYKNOWLEDGEBASEOWL2XMLCOMMAND = 2021; const qint64 DISJOINTQUERYKNOWLEDGEBASEOWL2XMLCOMMAND = 2022; const qint64 INSTANCEQUERYKNOWLEDGEBASEOWL2XMLCOMMAND = 2023; const qint64 BUILDQUERYCOMMAND = 2024; const qint64 TESTEXTENDEDCALCULATEQUERYCOMMAND = 2025; const qint64 TESTTESTSUITECOMMAND = 2026; const qint64 PARSETESTSUITECOMMANDSCOMMAND = 2027; const qint64 TESTTESTFILECOMMAND = 2028; const qint64 PARSETESTSUITEXMLCOMMAND = 2029; const qint64 INSERTRESPONSECOMMENT = 2030; const qint64 GETKNOWLEGEBASECONFIGURATIONCOMMAND = 2031; const qint64 SETKNOWLEDGEBASECONFIGURATIONCOMMAND = 2032; const qint64 GETSETTINGSCOMMAND = 2033; const qint64 GETKNOWLEGEBASESETTINGSCOMMAND = 2034; const qint64 SCHIERARCHYQUERYKNOWLEDGEBASEOWL2XMLCOMMAND = 2035; const qint64 CONSTRUCTSUBCLASSHIERARCHYQUERYCOMMAND = 2036; const qint64 GETCLASSIFICATIONMANAGERCOMMAND = 2037; const qint64 LOADKNOWLEDGEBASEKRSSTESTCONCEPTCOMMAND = 2038; const qint64 READPARSEKRSSTESTCONCEPTONTOLOGYCOMMAND = 2039; const qint64 READTEXTCOMMAND = 2040; const qint64 SAVEOWL2XMLKNOWLEDGEBASECOMMAND = 2041; const qint64 WRITEOWL2XMLONTOLOGYCOMMAND = 2042; const qint64 EXTRACTTOLDEXPRESSIONONTOLOGYCOMMAND = 2043; const qint64 WRITEOWLLINKOWL2XMLSATISFIABLETESTCOMMAND = 2044; const qint64 SAVEOWLLINKOWL2XMLSATTESTKBCOMMAND = 2045; const qint64 LOADKNOWLEDGEBASEOWLXMLONTOLOGYCOMMAND = 2046; const qint64 SAXPARSEOWL2XMLONTOLOGYCOMMAND = 2047; const qint64 STREAMPARSEOWL2XMLONTOLOGYCOMMAND = 2048; const qint64 CHOOSEPARSEINSTALLKNOWLEDGEBASEOWLXMLONTOLOGYCOMMAND = 2049; const qint64 PREPAREKNOWLEDGEBASEFORQUERYCOMMANDCOMMAND = 2050; const qint64 GENERATEQUERYCOMMANDCOMMAND = 2051; const qint64 PREPAREKNOWLEDGEBASEFORREVISIONCOMMANDCOMMAND = 2052; const qint64 FLATTENEDTYPESQUERYKNOWLEDGEBASEOWL2XMLCOMMAND = 2053; const qint64 CONSTRUCTFLATTENEDTYPESQUERYCOMMAND = 2054; const qint64 PROCESSQUERYKNOWLEDGEBASEOWL2XMLCOMMAND = 2055; const qint64 PROCESSKNOWLEDGEBASECLASSIFYCOMMAND = 2056; const qint64 PROCESSKNOWLEDGEBASEREALIZECOMMAND = 2057; const qint64 PREPAREKNOWLEDGEBASECOMMANDCOMMAND = 2058; const qint64 EVALUATETESTSUITECOMMAND = 2059; const qint64 CONSTRUCTWRITEFUNCTIONALSUBCLASSHIERARCHYQUERYCOMMAND = 2060; const qint64 WRITEFUNCTIONALSUBCLASSHIERARCHYQUERYCOMMAND = 2061; const qint64 ISCONSISTENTKNOWLEDGEBASEOWL2XMLCOMMAND = 2062; const qint64 CONSTRUCTISCONSISTENTQUERYCOMMAND = 2063; const qint64 PROCESSCLASSNAMESATISFIABLEQUERYKNOWLEDGEBASECOMMAND = 2064; const qint64 CONSTRUCTCLASSSATISFIABLEQUERYCOMMAND = 2065; const qint64 ISCONSISTENTKNOWLEDGEBASECOMMAND = 2066; const qint64 CLASSIFYQUERYCOMMAND = 2067; const qint64 CCONSTRUCTCLASSIFYQUERYCOMMAND = 2068; const qint64 REALIZEQUERYCOMMAND = 2069; const qint64 CCONSTRUCTREALIZEQUERYCOMMAND = 2070; const qint64 EXTRACTKNOWLEDGEBASEENTITIESCOMMAND = 2071; const qint64 EXTRACTKNOWLEDGEBASECLASSENTITIESCOMMAND = 2072; const qint64 EXTRACTKNOWLEDGEBASEOBJECTPROPERTYENTITIESCOMMAND = 2073; const qint64 EXTRACTKNOWLEDGEBASENAMEDINDIVIDUALENTITIESCOMMAND = 2074; const qint64 EXTRACTKNOWLEDGEBASELANGUAGECOMMAND = 2075; const qint64 GETKNOWLEDGEBASELANGUAGECOMMAND = 2076; const qint64 WRITEXMLSUBCLASSHIERARCHYQUERYCOMMAND = 2077; const qint64 CONSTRUCTWRITEXMLSUBCLASSHIERARCHYQUERYCOMMAND = 2078; const qint64 CONSTRUCTWRITEXMLINDIVIDUALTYPESQUERYCOMMAND = 2079; const qint64 WRITEXMLINDIVIDUALTYPESQUERYCOMMAND = 2080; const qint64 LOADKNOWLEDGEBASEOWLFUNCTIONALONTOLOGYCOMMAND = 2081; const qint64 STREAMPARSEOWL2FUNCTIONALONTOLOGYCOMMAND = 2082; const qint64 LOADKNOWLEDGEBASEOWLAUTOSELECTIONONTOLOGYCOMMAND = 2083; const qint64 CHOOSEPARSEINSTALLKNOWLEDGEBASEOWLAUTOONTOLOGYCOMMAND = 2084; const qint64 LOADKNOWLEDGEBASESTARTDOWNLOADCOMMAND = 2085; const qint64 LOADKNOWLEDGEBASEFINISHDOWNLOADCOMMAND = 2086; const qint64 IMPORTKNOWLEDGEBASEOWLAUTOONTOLOGYCOMMAND = 2087; const qint64 WRITEFUNCTIONALINDIVIDUALTYPESQUERYCOMMAND = 2088; const qint64 CONSTRUCTWRITEFUNCTIONALINDIVIDUALTYPESQUERYCOMMAND = 2089; const qint64 CONSTRUCTISTRIVIALLYCONSISTENTQUERYCOMMAND = 2090; const qint64 ISTRIVIALLYCONSISTENTKNOWLEDGEBASECOMMAND = 2091; // Custom Events >= 2000 const QEvent::Type EVENTREALIZECOMMAND = (QEvent::Type)2000; const QEvent::Type EVENTCOMMANDPRECONDITIONCHANGE = (QEvent::Type)2001; const QEvent::Type EVENTCOMMANDPROCESSEDCALLBACK = (QEvent::Type)2002; const QEvent::Type EVENTINITIALIZE = (QEvent::Type)2003; const QEvent::Type EVENTCOMMANDCALCULATEDQUERYCALLBACK = (QEvent::Type)2004; const QEvent::Type EVENTONTOLOGYPREPAREDCALLBACK = (QEvent::Type)2005; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // end KONCLUDE_Control_COMMAND_COMMANDSETTINGS Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CConfigManagerReader.h0000644000175000017500000000753412520756352025377 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCONFIGMANAGERREADER_H #define KONCLUDE_Control_COMMAND_CCONFIGMANAGERREADER_H // Libraries includes #include // Namespace includes #include "CCommanderManagerConfigType.h" #include "CReasonerManagerConfigType.h" #include "CClassificationManagerConfigType.h" #include "COntologyRevisionManagerConfigType.h" // Other includes #include "Config/CConfigDataReader.h" #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Logger::Record; using namespace Config; namespace Control { namespace Command { /*! * * \class CConfigManagerReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConfigManagerReader : public CConfigDataReader { // public methods public: //! Constructor CConfigManagerReader(); //! Destructor virtual ~CConfigManagerReader(); static CCommanderManager *readCommanderManagerConfig(CConfiguration *config, bool *errorFlag = 0, CCommanderManager *defaultValue = 0, const QString &configString = "Konclude.Execution.CommanderManager"); static CCommanderManager *readCommanderManagerConfig(CConfigurationProvider *configProv, bool *errorFlag = 0, CCommanderManager *defaultValue = 0, const QString &configString = "Konclude.Execution.CommanderManager"); static CReasonerManager *readReasonerManagerConfig(CConfiguration *config, bool *errorFlag = 0, CReasonerManager *defaultValue = 0, const QString &configString = "Konclude.Execution.ReasonerManager"); static CReasonerManager *readReasonerManagerConfig(CConfigurationProvider *configProv, bool *errorFlag = 0, CReasonerManager *defaultValue = 0, const QString &configString = "Konclude.Execution.ReasonerManager"); static CClassificationManager *readClassificationManagerConfig(CConfiguration *config, bool *errorFlag = 0, CClassificationManager *defaultValue = 0, const QString &configString = "Konclude.Execution.ClassificationManager"); static CClassificationManager *readClassificationManagerConfig(CConfigurationProvider *configProv, bool *errorFlag = 0, CClassificationManager *defaultValue = 0, const QString &configString = "Konclude.Execution.ClassificationManager"); static COntologyRevisionManager *readOntologyRevisionConfig(CConfiguration *config, bool *errorFlag = 0, COntologyRevisionManager *defaultValue = 0, const QString &configString = "Konclude.Execution.OntologyRevisionManager"); static COntologyRevisionManager *readOntologyRevisionConfig(CConfigurationProvider *configProv, bool *errorFlag = 0, COntologyRevisionManager *defaultValue = 0, const QString &configString = "Konclude.Execution.OntologyRevisionManager"); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCONFIGMANAGERREADER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommanderManagerConfigType.h0000644000175000017500000000461312520756352026737 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCOMMANDERMANAGERCONFIGTYPE_H #define KONCLUDE_Control_COMMAND_CCOMMANDERMANAGERCONFIGTYPE_H // Libraries includes #include #include // Namespace includes #include "CCommanderManager.h" // Other includes #include "Config/CObjectConfigType.h" #include "Instructions/CInitializeConfigurationCommand.h" #include "Instructions/CInitializeReasonerCommand.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Control { namespace Command { using namespace Instructions; /*! * * \class CCommanderManagerConfigType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommanderManagerConfigType : public CObjectConfigType { // public methods public: //! Constructor CCommanderManagerConfigType(CCommanderManager *reasonerCommander = 0); //! Destructor virtual ~CCommanderManagerConfigType(); virtual CCommanderManagerConfigType *getTypeCopy(); virtual CCommanderManager *getCommanderManager(); virtual CCommanderManagerConfigType *setCommanderManager(CCommanderManager *reasonerCommander); virtual bool equals(CConfigType *dataType); // protected methods protected: // protected variables protected: CCommanderManager *rCommander; // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCOMMANDERMANAGERCONFIGTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/0000755000175000017500000000000012613407250022661 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CStopProcessCommandRecord.h0000644000175000017500000000460012520756350030064 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_RECORDS_CSTOPPROCESSCOMMANDRECORD_H #define KONCLUDE_Control_COMMAND_RECORDS_CSTOPPROCESSCOMMANDRECORD_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CCommandRecordData.h" // Other includes #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Records { /*! * * \class CStopProcessCommandRecord * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CStopProcessCommandRecord : public CCommandRecordData { // public methods public: //! Constructor CStopProcessCommandRecord(CCommand *command, const QString &recordDomain, CCommandRecordData *nextRecordData = 0); //! Destructor virtual ~CStopProcessCommandRecord(); virtual QString getRecordMessage(); static void makeRecord(CCommandRecorder *recorder, const QString &domain, CCommand *command); static void makeRecord(CCommandRecordRouter *commandRecordRouter); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_RECORDS_CSTOPPROCESSCOMMANDRECORD_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CStopProcessCommandRecord.cpp0000644000175000017500000000417612520756350030427 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CStopProcessCommandRecord.h" namespace Konclude { namespace Control { namespace Command { namespace Records { CStopProcessCommandRecord::CStopProcessCommandRecord(CCommand *command, const QString &recordDomain, CCommandRecordData *recordData) : CCommandRecordData(command,recordDomain,0,recordData) { } CStopProcessCommandRecord::~CStopProcessCommandRecord() { } QString CStopProcessCommandRecord::getRecordMessage() { return QString("Stop processing '%1'.").arg(comm->getBriefCommandDescription()); } void CStopProcessCommandRecord::makeRecord(CCommandRecorder *recorder, const QString &domain, CCommand *command) { CStopProcessCommandRecord *record = new CStopProcessCommandRecord(command,domain,command->getRecordData()); command->setProcessing(false); if (recorder) { recorder->recordData(record); } else { CCommandRecorder::recordToCommand(command,record); } } void CStopProcessCommandRecord::makeRecord(CCommandRecordRouter *commandRecordRouter) { if (commandRecordRouter) { makeRecord(commandRecordRouter->getCommandRecorder(),commandRecordRouter->getLogDomain(),commandRecordRouter->getCommand()); } } }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CProcessErrorRecord.h0000644000175000017500000000422712520756350026736 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_RECORDS_CPROCESSERRORRECORD_H #define KONCLUDE_Control_COMMAND_RECORDS_CPROCESSERRORRECORD_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CCommandRecordData.h" // Other includes #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Records { /*! * * \class CProcessErrorRecord * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CProcessErrorRecord : public CCommandRecordData { // public methods public: //! Constructor CProcessErrorRecord(CCommand *command, const QString &recordDomain, double recordErrorLevel, CCommandRecordData *nextRecordData = 0); //! Destructor virtual ~CProcessErrorRecord(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_RECORDS_CPROCESSERRORRECORD_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CUnspecifiedMessageErrorRecord.cpp0000644000175000017500000000503112520756350031410 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CUnspecifiedMessageErrorRecord.h" namespace Konclude { namespace Control { namespace Command { namespace Records { CUnspecifiedMessageErrorRecord::CUnspecifiedMessageErrorRecord(CCommand *command, const QString &errorMessage, const QString &recordDomain, double recordErrorLevel, CCommandRecordData *recordData) : CProcessErrorRecord(command,recordDomain,recordErrorLevel,recordData) { message = errorMessage; } CUnspecifiedMessageErrorRecord::~CUnspecifiedMessageErrorRecord() { } QString CUnspecifiedMessageErrorRecord::getRecordMessage() { return message; } void CUnspecifiedMessageErrorRecord::makeRecord(CCommandRecorder *recorder, const QString &message, const QString &domain, CCommand *command) { CUnspecifiedMessageErrorRecord *record = new CUnspecifiedMessageErrorRecord(command,message,domain,70,command->getRecordData()); if (recorder) { recorder->recordData(record); } else { CCommandRecorder::recordToCommand(command,record); } } void CUnspecifiedMessageErrorRecord::makeRecord(const QString &message, CLogIdentifier *logIdentifier, CCommand *command) { if (logIdentifier && command && command->getRecorder()) { makeRecord(command->getRecorder(),message,logIdentifier->getLogDomain(),command); } } void CUnspecifiedMessageErrorRecord::makeRecord(const QString &message, CCommandRecordRouter *commandRecordRouter) { if (commandRecordRouter) { makeRecord(commandRecordRouter->getCommandRecorder(),message,commandRecordRouter->getLogDomain(),commandRecordRouter->getCommand()); } } }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CParseSyntaxErrorRecord.cpp0000644000175000017500000000253312520756350030132 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CParseSyntaxErrorRecord.h" namespace Konclude { namespace Control { namespace Command { namespace Records { CParseSyntaxErrorRecord::CParseSyntaxErrorRecord(CCommand *command, const QString &recordDomain, double recordErrorLevel, CCommandRecordData *recordData) : CProcessErrorRecord(command,recordDomain,recordErrorLevel,recordData) { } CParseSyntaxErrorRecord::~CParseSyntaxErrorRecord() { } }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CStartProcessCommandRecord.h0000644000175000017500000000460712520756350030243 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_RECORDS_CSTARTPROCESSCOMMANDRECORD_H #define KONCLUDE_Control_COMMAND_RECORDS_CSTARTPROCESSCOMMANDRECORD_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CCommandRecordData.h" // Other includes #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Records { /*! * * \class CStartProcessCommandRecord * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CStartProcessCommandRecord : public CCommandRecordData { // public methods public: //! Constructor CStartProcessCommandRecord(CCommand *command, const QString &recordDomain, CCommandRecordData *nextRecordData = 0); //! Destructor virtual ~CStartProcessCommandRecord(); virtual QString getRecordMessage(); static void makeRecord(CCommandRecorder *recorder, const QString &domain, CCommand *command); static void makeRecord(CCommandRecordRouter *commandRecordRouter); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_RECORDS_CSTARTPROCESSCOMMANDRECORD_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CClosureProcessCommandRecord.h0000644000175000017500000000472212520756350030560 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_RECORDS_CCLOSUREPROCESSCOMMANDRECORD_H #define KONCLUDE_Control_COMMAND_RECORDS_CCLOSUREPROCESSCOMMANDRECORD_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CCommandRecordData.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Records { /*! * * \class CClosureProcessCommandRecord * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClosureProcessCommandRecord : public CCommandRecordData { // public methods public: //! Constructor CClosureProcessCommandRecord(CCommand *command, const QString &recordDomain, CCommandRecordData *nextRecordData = 0, double subCommandsErrorLevel = 0.); //! Destructor virtual ~CClosureProcessCommandRecord(); virtual QString getRecordMessage(); static void makeRecord(CCommandRecorder *recorder, const QString &domain, CCommand *command, double subCommandsErrorLevel = 0.); static void makeRecord(CCommandRecordRouter *commandRecordRouter, double subCommandsErrorLevel = 0.); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_RECORDS_CCLOSUREPROCESSCOMMANDRECORD_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CFinishProcessCommandRecord.h0000644000175000017500000000461612520756350030366 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_RECORDS_CFINISHPROCESSCOMMANDRECORD_H #define KONCLUDE_Control_COMMAND_RECORDS_CFINISHPROCESSCOMMANDRECORD_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CCommandRecordData.h" // Other includes #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Records { /*! * * \class CFinishProcessCommandRecord * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CFinishProcessCommandRecord : public CCommandRecordData { // public methods public: //! Constructor CFinishProcessCommandRecord(CCommand *command, const QString &recordDomain, CCommandRecordData *nextRecordData = 0); //! Destructor virtual ~CFinishProcessCommandRecord(); virtual QString getRecordMessage(); static void makeRecord(CCommandRecorder *recorder, const QString &domain, CCommand *command); static void makeRecord(CCommandRecordRouter *commandRecordRouter); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_RECORDS_CFINISHPROCESSCOMMANDRECORD_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CClosureProcessCommandRecord.cpp0000644000175000017500000000447212520756350031115 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClosureProcessCommandRecord.h" namespace Konclude { namespace Control { namespace Command { namespace Records { CClosureProcessCommandRecord::CClosureProcessCommandRecord(CCommand *command, const QString &recordDomain, CCommandRecordData *recordData, double subCommandsErrorLevel) : CCommandRecordData(command,recordDomain,subCommandsErrorLevel,recordData) { } CClosureProcessCommandRecord::~CClosureProcessCommandRecord() { } QString CClosureProcessCommandRecord::getRecordMessage() { return QString("Finish processing '%1' with all sub commands. Command closed.").arg(comm->getBriefCommandDescription()); } void CClosureProcessCommandRecord::makeRecord(CCommandRecorder *recorder, const QString &domain, CCommand *command, double subCommandsErrorLevel) { CClosureProcessCommandRecord *record = new CClosureProcessCommandRecord(command,domain,command->getRecordData(),subCommandsErrorLevel); if (recorder) { recorder->recordData(record); } else { CCommandRecorder::recordToCommand(command,record); } } void CClosureProcessCommandRecord::makeRecord(CCommandRecordRouter *commandRecordRouter, double subCommandsErrorLevel) { if (commandRecordRouter) { makeRecord(commandRecordRouter->getCommandRecorder(),commandRecordRouter->getLogDomain(),commandRecordRouter->getCommand(),subCommandsErrorLevel); } } }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CUnspecifiedMessageErrorRecord.h0000644000175000017500000000524212520756350031061 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_RECORDS_CUNSPECIFIEDMESSAGEERRORRECORD_H #define KONCLUDE_Control_COMMAND_RECORDS_CUNSPECIFIEDMESSAGEERRORRECORD_H // Libraries includes #include // Namespace includes #include "CProcessErrorRecord.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CCommandRecordData.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Records { /*! * * \class CUnspecifiedMessageErrorRecord * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CUnspecifiedMessageErrorRecord : public CProcessErrorRecord { // public methods public: //! Constructor CUnspecifiedMessageErrorRecord(CCommand *command, const QString &errorMessage, const QString &recordDomain, double recordErrorLevel, CCommandRecordData *nextRecordData = 0); //! Destructor virtual ~CUnspecifiedMessageErrorRecord(); virtual QString getRecordMessage(); static void makeRecord(CCommandRecorder *recorder, const QString &message, const QString &domain, CCommand *command); static void makeRecord(const QString &message, CLogIdentifier *logIdentifier, CCommand *command); static void makeRecord(const QString &message, CCommandRecordRouter *commandRecordRouter); // protected methods protected: // protected variables protected: QString message; // private methods private: // private variables private: }; }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_RECORDS_CUNSPECIFIEDMESSAGEERRORRECORD_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CUnspecifiedMessageInformationRecord.cppKonclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CUnspecifiedMessageInformationRecord.c0000644000175000017500000000507412520756350032253 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CUnspecifiedMessageInformationRecord.h" namespace Konclude { namespace Control { namespace Command { namespace Records { CUnspecifiedMessageInformationRecord::CUnspecifiedMessageInformationRecord(CCommand *command, const QString &informationMessage, const QString &recordDomain, CCommandRecordData *recordData) : CCommandRecordData(command,recordDomain,0,recordData) { message = informationMessage; } CUnspecifiedMessageInformationRecord::~CUnspecifiedMessageInformationRecord() { } QString CUnspecifiedMessageInformationRecord::getRecordMessage() { return message; } void CUnspecifiedMessageInformationRecord::makeRecord(CCommandRecorder *recorder, const QString &message, const QString &domain, CCommand *command) { CUnspecifiedMessageInformationRecord *record = new CUnspecifiedMessageInformationRecord(command,message,domain,command->getRecordData()); if (recorder) { recorder->recordData(record); } else { CCommandRecorder::recordToCommand(command,record); } } void CUnspecifiedMessageInformationRecord::makeRecord(const QString &message, CLogIdentifier *logIdentifier, CCommand *command) { if (logIdentifier && command && command->getRecorder()) { makeRecord(command->getRecorder(),message,logIdentifier->getLogDomain(),command); } } void CUnspecifiedMessageInformationRecord::makeRecord(const QString &message, CCommandRecordRouter *commandRecordRouter) { if (commandRecordRouter) { makeRecord(commandRecordRouter->getCommandRecorder(),message,commandRecordRouter->getLogDomain(),commandRecordRouter->getCommand()); } } }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CProcessErrorRecord.cpp0000644000175000017500000000250612520756350027267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CProcessErrorRecord.h" namespace Konclude { namespace Control { namespace Command { namespace Records { CProcessErrorRecord::CProcessErrorRecord(CCommand *command, const QString &recordDomain, double recordErrorLevel, CCommandRecordData *recordData) : CCommandRecordData(command,recordDomain,recordErrorLevel,recordData) { } CProcessErrorRecord::~CProcessErrorRecord() { } }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CUnspecifiedMessageInformationRecord.h0000644000175000017500000000527012520756350032256 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_RECORDS_CUNSPECIFIEDMESSAGEINFORMATIONRECORD_H #define KONCLUDE_Control_COMMAND_RECORDS_CUNSPECIFIEDMESSAGEINFORMATIONRECORD_H // Libraries includes #include // Namespace includes #include "CProcessErrorRecord.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CCommandRecordData.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/CLogIdentifier.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Records { /*! * * \class CUnspecifiedMessageInformationRecord * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CUnspecifiedMessageInformationRecord : public CCommandRecordData { // public methods public: //! Constructor CUnspecifiedMessageInformationRecord(CCommand *command, const QString &informationMessage, const QString &recordDomain, CCommandRecordData *nextRecordData = 0); //! Destructor virtual ~CUnspecifiedMessageInformationRecord(); virtual QString getRecordMessage(); static void makeRecord(CCommandRecorder *recorder, const QString &message, const QString &domain, CCommand *command); static void makeRecord(const QString &message, CLogIdentifier *logIdentifier, CCommand *command); static void makeRecord(const QString &message, CCommandRecordRouter *commandRecordRouter); // protected methods protected: // protected variables protected: QString message; // private methods private: // private variables private: }; }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_RECORDS_CUNSPECIFIEDMESSAGEINFORMATIONRECORD_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CBuildSubCommandRecord.h0000644000175000017500000000502312520756350027311 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_RECORDS_CBUILDSUBCOMMANDRECORD_H #define KONCLUDE_Control_COMMAND_RECORDS_CBUILDSUBCOMMANDRECORD_H // Libraries includes #include // Namespace includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CCommandRecordData.h" #include "Control/Command/CCommandRecorder.h" // Other includes #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Records { /*! * * \class CBuildSubCommandRecord * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBuildSubCommandRecord : public CCommandRecordData { // public methods public: //! Constructor CBuildSubCommandRecord(CCommand *subCommand, CCommand *command, const QString &recordDomain, CCommandRecordData *nextRecordData = 0); //! Destructor virtual ~CBuildSubCommandRecord(); virtual CCommand *getBuildSubCommand(); virtual CBuildSubCommandRecord *setBuildSubCommand(CCommand *subCommand); virtual QString getRecordMessage(); static void makeRecord(CCommandRecorder *recorder, const QString &domain, CCommand *command, CCommand *subCommand); // protected methods protected: // protected variables protected: CCommand *subComm; // private methods private: // private variables private: }; }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_RECORDS_CBUILDSUBCOMMANDRECORD_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CNotSupportedNodeErrorRecord.cpp0000644000175000017500000000451612520756350031130 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNotSupportedNodeErrorRecord.h" namespace Konclude { namespace Control { namespace Command { namespace Records { CNotSupportedNodeErrorRecord::CNotSupportedNodeErrorRecord(const QString &node, CCommand *command, const QString &recordDomain, CCommandRecordData *recordData) : CParseSyntaxErrorRecord(command,recordDomain,70,recordData) { nodeString = node; } CNotSupportedNodeErrorRecord::~CNotSupportedNodeErrorRecord() { } QString CNotSupportedNodeErrorRecord::getRecordMessage() { return QString("Node '%1' is not supported and could not be processed.").arg(nodeString); } void CNotSupportedNodeErrorRecord::makeRecord(const QString &node, CCommandRecorder *recorder, const QString &domain, CCommand *command) { CCommandRecordData *recordData = 0; if (command) { recordData = command->getRecordData(); } CNotSupportedNodeErrorRecord *record = new CNotSupportedNodeErrorRecord(node,command,domain,recordData); if (recorder) { recorder->recordData(record); } else { CCommandRecorder::recordToCommand(command,record); } } void CNotSupportedNodeErrorRecord::makeRecord(const QString &node, CCommandRecordRouter *commandRecordRouter) { if (commandRecordRouter) { makeRecord(node,commandRecordRouter->getCommandRecorder(),commandRecordRouter->getLogDomain(),commandRecordRouter->getCommand()); } } }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CStartProcessCommandRecord.cpp0000644000175000017500000000421012520756350030564 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CStartProcessCommandRecord.h" namespace Konclude { namespace Control { namespace Command { namespace Records { CStartProcessCommandRecord::CStartProcessCommandRecord(CCommand *command, const QString &recordDomain, CCommandRecordData *recordData) : CCommandRecordData(command,recordDomain,0,recordData) { } CStartProcessCommandRecord::~CStartProcessCommandRecord() { } QString CStartProcessCommandRecord::getRecordMessage() { return QString("Start processing '%1'.").arg(comm->getBriefCommandDescription()); } void CStartProcessCommandRecord::makeRecord(CCommandRecorder *recorder, const QString &domain, CCommand *command) { CStartProcessCommandRecord *record = new CStartProcessCommandRecord(command,domain,command->getRecordData()); command->setProcessing(true); if (recorder) { recorder->recordData(record); } else { CCommandRecorder::recordToCommand(command,record); } } void CStartProcessCommandRecord::makeRecord(CCommandRecordRouter *commandRecordRouter) { if (commandRecordRouter) { makeRecord(commandRecordRouter->getCommandRecorder(),commandRecordRouter->getLogDomain(),commandRecordRouter->getCommand()); } } }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CFinishProcessCommandRecord.cpp0000644000175000017500000000430412520756350030713 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CFinishProcessCommandRecord.h" namespace Konclude { namespace Control { namespace Command { namespace Records { CFinishProcessCommandRecord::CFinishProcessCommandRecord(CCommand *command, const QString &recordDomain, CCommandRecordData *recordData) : CCommandRecordData(command,recordDomain,0,recordData) { } CFinishProcessCommandRecord::~CFinishProcessCommandRecord() { } QString CFinishProcessCommandRecord::getRecordMessage() { return QString("Finish processing '%1'.").arg(comm->getBriefCommandDescription()); } void CFinishProcessCommandRecord::makeRecord(CCommandRecorder *recorder, const QString &domain, CCommand *command) { if (!command->isProcessed()) { CFinishProcessCommandRecord *record = new CFinishProcessCommandRecord(command,domain,command->getRecordData()); if (recorder) { recorder->recordData(record); } else { CCommandRecorder::recordToCommand(command,record); } command->setProcessed(true); } } void CFinishProcessCommandRecord::makeRecord(CCommandRecordRouter *commandRecordRouter) { if (commandRecordRouter) { makeRecord(commandRecordRouter->getCommandRecorder(),commandRecordRouter->getLogDomain(),commandRecordRouter->getCommand()); } } }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CBuildSubCommandRecord.cpp0000644000175000017500000000426312520756350027651 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBuildSubCommandRecord.h" namespace Konclude { namespace Control { namespace Command { namespace Records { CBuildSubCommandRecord::CBuildSubCommandRecord(CCommand *subCommand, CCommand *command, const QString &recordDomain, CCommandRecordData *nextRecordData) : CCommandRecordData(command,recordDomain,0,nextRecordData) { subComm = subCommand; } CBuildSubCommandRecord::~CBuildSubCommandRecord() { } CCommand *CBuildSubCommandRecord::getBuildSubCommand() { return subComm; } CBuildSubCommandRecord *CBuildSubCommandRecord::setBuildSubCommand(CCommand *subCommand) { subComm = subCommand; return this; } QString CBuildSubCommandRecord::getRecordMessage() { return QString("Build '%1' as Sub-Command from '%2'.").arg(comm->getBriefCommandDescription()).arg(subComm->getBriefCommandDescription()); } void CBuildSubCommandRecord::makeRecord(CCommandRecorder *recorder, const QString &domain, CCommand *command, CCommand *subCommand) { CBuildSubCommandRecord *record = new CBuildSubCommandRecord(subCommand,command,domain,command->getRecordData()); if (recorder) { recorder->recordData(record); } else { CCommandRecorder::recordToCommand(command,record); } } }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CParseSyntaxErrorRecord.h0000644000175000017500000000432512520756350027600 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_RECORDS_CPARSESYNTAXERRORRECORD_H #define KONCLUDE_Control_COMMAND_RECORDS_CPARSESYNTAXERRORRECORD_H // Libraries includes #include // Namespace includes #include "CProcessErrorRecord.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CCommandRecordData.h" #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Records { /*! * * \class CParseSyntaxErrorRecord * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CParseSyntaxErrorRecord : public CProcessErrorRecord { // public methods public: //! Constructor CParseSyntaxErrorRecord(CCommand *command, const QString &recordDomain, double recordErrorLevel, CCommandRecordData *nextRecordData = 0); //! Destructor virtual ~CParseSyntaxErrorRecord(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_RECORDS_CPARSESYNTAXERRORRECORD_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/Records/CNotSupportedNodeErrorRecord.h0000644000175000017500000000475512520756350030602 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_RECORDS_CNOTSUPPORTEDNODEERRORRECORD_H #define KONCLUDE_Control_COMMAND_RECORDS_CNOTSUPPORTEDNODEERRORRECORD_H // Libraries includes #include // Namespace includes #include "CParseSyntaxErrorRecord.h" // Other includes #include "Control/Command/CommandSettings.h" #include "Control/Command/CCommand.h" #include "Control/Command/CCommandRecordData.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Control { namespace Command { namespace Records { /*! * * \class CNotSupportedNodeErrorRecord * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNotSupportedNodeErrorRecord : public CParseSyntaxErrorRecord { // public methods public: //! Constructor CNotSupportedNodeErrorRecord(const QString &node, CCommand *command, const QString &recordDomain, CCommandRecordData *nextRecordData = 0); //! Destructor virtual ~CNotSupportedNodeErrorRecord(); virtual QString getRecordMessage(); static void makeRecord(const QString &node, CCommandRecorder *recorder, const QString &domain, CCommand *command); static void makeRecord(const QString &node, CCommandRecordRouter *commandRecordRouter); // protected methods protected: // protected variables protected: QString nodeString; // private methods private: // private variables private: }; }; // end namespace Records }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_RECORDS_CNOTSUPPORTEDNODEERRORRECORD_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommanderManager.cpp0000644000175000017500000000231112520756352025273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommanderManager.h" namespace Konclude { namespace Control { namespace Command { CCommanderManager::CCommanderManager() { } CCommanderManager::~CCommanderManager() { } CCommandDelegater *CCommanderManager::delegateCommand(CCommand *command) { return realizeCommand(command); } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CClassificationManagerConfigType.cpp0000644000175000017500000000376312520756350030323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassificationManagerConfigType.h" namespace Konclude { namespace Control { namespace Command { CClassificationManagerConfigType::CClassificationManagerConfigType(CClassificationManager *classificationManager) { cManager = classificationManager; } CClassificationManagerConfigType::~CClassificationManagerConfigType() { } CClassificationManagerConfigType *CClassificationManagerConfigType::getTypeCopy() { return new CClassificationManagerConfigType(cManager); } CClassificationManager *CClassificationManagerConfigType::getClassificationManager() { return cManager; } CClassificationManagerConfigType *CClassificationManagerConfigType::setClassificationManager(CClassificationManager *classificationManager) { cManager = classificationManager; return this; } bool CClassificationManagerConfigType::equals(CConfigType *dataType) { CClassificationManagerConfigType *rCommanderType = dynamic_cast(dataType); if (rCommanderType) { return (cManager == rCommanderType->cManager); } return false; } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommanderManagerConfigType.cpp0000644000175000017500000000362012520756352027267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommanderManagerConfigType.h" namespace Konclude { namespace Control { namespace Command { CCommanderManagerConfigType::CCommanderManagerConfigType(CCommanderManager *reasonerCommander) { rCommander = reasonerCommander; } CCommanderManagerConfigType::~CCommanderManagerConfigType() { } CCommanderManagerConfigType *CCommanderManagerConfigType::getTypeCopy() { return new CCommanderManagerConfigType(rCommander); } CCommanderManager *CCommanderManagerConfigType::getCommanderManager() { return rCommander; } CCommanderManagerConfigType *CCommanderManagerConfigType::setCommanderManager(CCommanderManager *reasonerCommander) { rCommander = reasonerCommander; return this; } bool CCommanderManagerConfigType::equals(CConfigType *dataType) { CCommanderManagerConfigType *rCommanderType = dynamic_cast(dataType); if (rCommanderType) { return (rCommander == rCommanderType->rCommander); } return false; } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandProcessedPrecondition.h0000644000175000017500000000443712520756352027357 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCOMMANDPROCESSEDPRECONDITION_H #define KONCLUDE_Control_COMMAND_CCOMMANDPROCESSEDPRECONDITION_H // Libraries includes #include // Namespace includes #include "CCommand.h" #include "CCommandPrecondition.h" // Other includes #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Concurrent; using namespace Callback; namespace Control { namespace Command { /*! * * \class CCommandProcessedPrecondition * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommandProcessedPrecondition : public CCommandPrecondition { // public methods public: //! Constructor CCommandProcessedPrecondition(CCommand *command = 0); //! Destructor virtual ~CCommandProcessedPrecondition(); virtual bool isPreconditionFullfilled(); virtual CCommandProcessedPrecondition *addFullfilledCallback(CCallbackData *callback); virtual CCommand *getCommand(); virtual CCommandProcessedPrecondition *setCommand(CCommand *command); // protected methods protected: // protected variables protected: CCommand *comm; // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCOMMANDPROCESSEDPRECONDITION_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/COntologyRevisionManagerConfigType.h0000644000175000017500000000507512520756352030366 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CONTOLOGYREVISIONMANAGERCONFIGTYPE_H #define KONCLUDE_Control_COMMAND_CONTOLOGYREVISIONMANAGERCONFIGTYPE_H // Libraries includes #include #include // Namespace includes // Other includes #include "Reasoner/Revision/COntologyRevisionManager.h" #include "Config/CObjectConfigType.h" #include "Instructions/CInitializeConfigurationCommand.h" #include "Instructions/CInitializeReasonerCommand.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Reasoner::Revision; namespace Control { namespace Command { using namespace Instructions; /*! * * \class COntologyRevisionManagerConfigType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyRevisionManagerConfigType : public CObjectConfigType { // public methods public: //! Constructor COntologyRevisionManagerConfigType(COntologyRevisionManager *ontologyRevisionManager = 0); //! Destructor virtual ~COntologyRevisionManagerConfigType(); virtual COntologyRevisionManagerConfigType *getTypeCopy(); virtual COntologyRevisionManager *getOntologyRevisionManager(); virtual COntologyRevisionManagerConfigType *setOntologyRevisionManager(COntologyRevisionManager *ontologyRevisionManager); virtual bool equals(CConfigType *dataType); // protected methods protected: // protected variables protected: COntologyRevisionManager *orManager; // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CONTOLOGYREVISIONMANAGERCONFIGTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/COntologyRevisionManagerConfigType.cpp0000644000175000017500000000404512520756352030715 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyRevisionManagerConfigType.h" namespace Konclude { namespace Control { namespace Command { COntologyRevisionManagerConfigType::COntologyRevisionManagerConfigType(COntologyRevisionManager *ontologyRevisionManager) { orManager = ontologyRevisionManager; } COntologyRevisionManagerConfigType::~COntologyRevisionManagerConfigType() { } COntologyRevisionManagerConfigType *COntologyRevisionManagerConfigType::getTypeCopy() { return new COntologyRevisionManagerConfigType(orManager); } COntologyRevisionManager *COntologyRevisionManagerConfigType::getOntologyRevisionManager() { return orManager; } COntologyRevisionManagerConfigType *COntologyRevisionManagerConfigType::setOntologyRevisionManager(COntologyRevisionManager *ontologyRevisionManager) { orManager = ontologyRevisionManager; return this; } bool COntologyRevisionManagerConfigType::equals(CConfigType *dataType) { COntologyRevisionManagerConfigType *rCommanderType = dynamic_cast(dataType); if (rCommanderType) { return (orManager == rCommanderType->orManager); } return false; } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommanderManager.h0000644000175000017500000000411112520756352024740 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCOMMANDERMANAGER_H #define KONCLUDE_Control_COMMAND_CCOMMANDERMANAGER_H // Libraries includes #include // Namespace includes #include "CCommand.h" #include "CCommandDelegater.h" // Other includes #include "Config/CConfiguration.h" #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Logger::Record; using namespace Config; namespace Control { namespace Command { /*! * * \class CCommanderManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommanderManager : public CCommandDelegater { // public methods public: //! Constructor CCommanderManager(); //! Destructor virtual ~CCommanderManager(); virtual CCommanderManager *realizeCommand(CCommand *command) = 0; virtual CCommandDelegater *delegateCommand(CCommand *command); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCOMMANDERMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandBuilder.cpp0000644000175000017500000000210412520756350024756 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandBuilder.h" namespace Konclude { namespace Control { namespace Command { CCommandBuilder::CCommandBuilder() { } CCommandBuilder::~CCommandBuilder() { } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CConfigManagerReader.cpp0000644000175000017500000001314312520756352025723 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfigManagerReader.h" namespace Konclude { namespace Control { namespace Command { CConfigManagerReader::CConfigManagerReader() { } CConfigManagerReader::~CConfigManagerReader() { } CCommanderManager *CConfigManagerReader::readCommanderManagerConfig(CConfiguration *config, bool *errorFlag, CCommanderManager *defaultValue, const QString &configString) { CCommanderManager *manager = defaultValue; if (config) { CConfigData *configData = config->getRelatedConfigChange(configString,true); if (configData) { CCommanderManagerConfigType *managerConfig = dynamic_cast(configData->getConfigType()); if (managerConfig) { manager = managerConfig->getCommanderManager(); } } else { if (errorFlag) { *errorFlag = true; } } } else { if (errorFlag) { *errorFlag = true; } } return manager; } CCommanderManager *CConfigManagerReader::readCommanderManagerConfig(CConfigurationProvider *configProv, bool *errorFlag, CCommanderManager *defaultValue, const QString &configString) { CConfiguration *config = 0; if (configProv) { config = configProv->getCurrentConfiguration(); } return readCommanderManagerConfig(config,errorFlag,defaultValue,configString); } CReasonerManager *CConfigManagerReader::readReasonerManagerConfig(CConfiguration *config, bool *errorFlag, CReasonerManager *defaultValue, const QString &configString) { CReasonerManager *manager = defaultValue; if (config) { CConfigData *configData = config->getRelatedConfigChange(configString,true); if (configData) { CReasonerManagerConfigType *managerConfig = dynamic_cast(configData->getConfigType()); if (managerConfig) { manager = managerConfig->getReasonerManager(); } } else { if (errorFlag) { *errorFlag = true; } } } else { if (errorFlag) { *errorFlag = true; } } return manager; } CReasonerManager *CConfigManagerReader::readReasonerManagerConfig(CConfigurationProvider *configProv, bool *errorFlag, CReasonerManager *defaultValue, const QString &configString) { CConfiguration *config = 0; if (configProv) { config = configProv->getCurrentConfiguration(); } return readReasonerManagerConfig(config,errorFlag,defaultValue,configString); } CClassificationManager *CConfigManagerReader::readClassificationManagerConfig(CConfiguration *config, bool *errorFlag, CClassificationManager *defaultValue, const QString &configString) { CClassificationManager *manager = defaultValue; if (config) { CConfigData *configData = config->getRelatedConfigChange(configString,true); if (configData) { CClassificationManagerConfigType *managerConfig = dynamic_cast(configData->getConfigType()); if (managerConfig) { manager = managerConfig->getClassificationManager(); } } else { if (errorFlag) { *errorFlag = true; } } } else { if (errorFlag) { *errorFlag = true; } } return manager; } CClassificationManager *CConfigManagerReader::readClassificationManagerConfig(CConfigurationProvider *configProv, bool *errorFlag, CClassificationManager *defaultValue, const QString &configString) { CConfiguration *config = 0; if (configProv) { config = configProv->getCurrentConfiguration(); } return readClassificationManagerConfig(config,errorFlag,defaultValue,configString); } COntologyRevisionManager *CConfigManagerReader::readOntologyRevisionConfig(CConfiguration *config, bool *errorFlag, COntologyRevisionManager *defaultValue, const QString &configString) { COntologyRevisionManager *manager = defaultValue; if (config) { CConfigData *configData = config->getRelatedConfigChange(configString,true); if (configData) { COntologyRevisionManagerConfigType *managerConfig = dynamic_cast(configData->getConfigType()); if (managerConfig) { manager = managerConfig->getOntologyRevisionManager(); } } else { if (errorFlag) { *errorFlag = true; } } } else { if (errorFlag) { *errorFlag = true; } } return manager; } COntologyRevisionManager *CConfigManagerReader::readOntologyRevisionConfig(CConfigurationProvider *configProv, bool *errorFlag, COntologyRevisionManager *defaultValue, const QString &configString) { CConfiguration *config = 0; if (configProv) { config = configProv->getCurrentConfiguration(); } return readOntologyRevisionConfig(config,errorFlag,defaultValue,configString); } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CClassificationManagerConfigType.h0000644000175000017500000000503412520756350027761 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCLASSIFICATIONMANAGERCONFIGTYPE_H #define KONCLUDE_Control_COMMAND_CCLASSIFICATIONMANAGERCONFIGTYPE_H // Libraries includes #include #include // Namespace includes // Other includes #include "Reasoner/Classifier/CClassificationManager.h" #include "Config/CObjectConfigType.h" #include "Instructions/CInitializeConfigurationCommand.h" #include "Instructions/CInitializeReasonerCommand.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; using namespace Reasoner::Classifier; namespace Control { namespace Command { using namespace Instructions; /*! * * \class CClassificationManagerConfigType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassificationManagerConfigType : public CObjectConfigType { // public methods public: //! Constructor CClassificationManagerConfigType(CClassificationManager *classificationManager = 0); //! Destructor virtual ~CClassificationManagerConfigType(); virtual CClassificationManagerConfigType *getTypeCopy(); virtual CClassificationManager *getClassificationManager(); virtual CClassificationManagerConfigType *setClassificationManager(CClassificationManager *classificationManager); virtual bool equals(CConfigType *dataType); // protected methods protected: // protected variables protected: CClassificationManager *cManager; // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCLASSIFICATIONMANAGERCONFIGTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CPreconditionSynchronizer.cpp0000644000175000017500000000611312520756354027154 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPreconditionSynchronizer.h" namespace Konclude { namespace Control { namespace Command { CPreconditionSynchronizer::CPreconditionSynchronizer(CCommandDelegater *commandDelegater) : CThread("CommandPreconditionSynchronizer") { delegater = commandDelegater; startThread(); } CPreconditionSynchronizer::~CPreconditionSynchronizer() { } CCommandDelegater *CPreconditionSynchronizer::delegateCommand(CCommand *command) { postEvent(new CCommandPreconditionChangeEvent(0,command)); return this; } bool CPreconditionSynchronizer::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (!CThread::processCustomsEvents(type,event)) { if (type == EVENTCOMMANDPRECONDITIONCHANGE) { CCommandPreconditionChangeEvent *commandEvent = (CCommandPreconditionChangeEvent *)event; if (commandEvent) { CCommand *command = commandEvent->getCommand(); if (command) { CPreconditionCommand *preComm = dynamic_cast(command); if (preComm) { bool processable = false; if (preComm->isProcessable()) { processable = true; } if (processable) { delegater->delegateCommand(command); } else { bool connCallback = false; CLinker *preIt = preComm->getCommandPreconditionLinker(); while (preIt) { CCommandPrecondition *pre = preIt->getData(); if (pre && !pre->isPreconditionFullfilled()) { pre->addFullfilledCallback(new CCommandPreconditionChangeEvent(this,preComm)); connCallback = true; break; } preIt = (CLinker *)preIt->getNext(); } if (!connCallback) { LOG(ERROR,"::Konclude::Command::PreconditionSynchronizer",logTr("Unprocessable commands which are not depending on their preconditions are not supported."),this); delegater->delegateCommand(command); } } } else { delegater->delegateCommand(command); } } } return true; } } else { return true; } return false; } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CReasonerCommanderGlobalConfiguration.cpp0000644000175000017500000000605512520756354031363 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReasonerCommanderGlobalConfiguration.h" namespace Konclude { namespace Control { namespace Command { CReasonerCommanderGlobalConfiguration::CReasonerCommanderGlobalConfiguration(CConfiguration *initialConfiguration) { nextUniqueConfigID = 0; if (!initialConfiguration) { initConf = new CConfigurationBase(CSingletonProvider::getInstance(),getNextUniqueConfigID()); } else { initConf = new CConfigurationBase(initialConfiguration,getNextUniqueConfigID()); } configContainer.append(initConf); lastPersConf = loadGlobalReasonerConfiguration(); configContainer.append(lastPersConf); } CReasonerCommanderGlobalConfiguration::~CReasonerCommanderGlobalConfiguration() { } qint64 CReasonerCommanderGlobalConfiguration::getNextUniqueConfigID() { qint64 nextConfID = 0; idSyncMutex.lock(); nextConfID = nextUniqueConfigID++; idSyncMutex.unlock(); return nextConfID; } CGlobalConfigurationBase *CReasonerCommanderGlobalConfiguration::getCurrentGlobalConfiguration() { return lastPersConf; } CGlobalConfigurationBase *CReasonerCommanderGlobalConfiguration::loadGlobalReasonerConfiguration() { if (initConf) { return new CGlobalConfigurationBase(initConf,getNextUniqueConfigID()); } else { return new CGlobalConfigurationBase(CSingletonProvider::getInstance(),getNextUniqueConfigID()); } } CReasonerCommanderGlobalConfiguration *CReasonerCommanderGlobalConfiguration::saveGlobalReasonerConfiguration(CGlobalConfigurationBase *configuration) { return this; } bool CReasonerCommanderGlobalConfiguration::installGlobalConfiguration(CGlobalConfigurationBase *configuration) { if (configuration->getConfigurationID() > lastPersConf->getConfigurationID()) { configContainer.append(configuration); lastPersConf = configuration; } return true; } CGlobalConfigurationBase *CReasonerCommanderGlobalConfiguration::createNextGlobalConfiguration() { CGlobalConfigurationBase *nextConfig = new CGlobalConfigurationBase(lastPersConf,getNextUniqueConfigID()); return nextConfig; } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommand.h0000644000175000017500000001005312520756350023116 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONTROL_COMMAND_CCOMMAND_H #define KONCLUDE_CONTROL_COMMAND_CCOMMAND_H // Libraries includes #include // Namespace includes #include "CommandSettings.h" #include "CCommandRecorder.h" #include "CCommandRecordData.h" // Other includes #include "Concurrent/Callback/CSynchronizedCallbackListExecuter.h" #include "Utilities/CLinker.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Concurrent::Callback; using namespace Utilities; namespace Control { namespace Command { /*! * * \class CCommand * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommand { // public methods public: //! Constructor CCommand(CCommand *parentSuperCommand = 0); //! Destructor virtual ~CCommand(); virtual CLinker *getSubCommandLinker(); virtual CCommand *addSubCommand(CCommand *subCommand); virtual CCommand *makeToSubCommand(CCommand *subCommand); virtual CCommand *getSuperCommand(); virtual CCommand *setSuperCommand(CCommand *parentSuperCommand); virtual qint64 getCommandTag() = 0; virtual bool isProcessable() = 0; virtual QString getBriefCommandDescription(); virtual CCommand *getNextProcessableSubCommand(); virtual CCommand *setProcessed(bool processedCommand = true); virtual bool isProcessed(); virtual bool areAllSubCommandsProcessed(); virtual bool isThisCommandProcessed(); virtual CCommand *setProcessing(bool processingCommand = true); virtual bool isProcessing(); virtual CCommandRecordData *getRecordData(); virtual CCommand *setRecordData(CCommandRecordData *takeRecordData); virtual CCommand *overwriteRecordData(CCommandRecordData *takeRecordData); virtual CCommand *appendRecordData(CCommandRecordData *takeRecordData); virtual CCommandRecorder *getRecorder(); virtual CCommand *setRecorder(CCommandRecorder *useCommandRecorder); virtual CCommand *deleteDependencies(); virtual CCommand *deleteSubCommands(); virtual CCommand *deleteRecordData(); virtual CCommand *addProcessedCallback(CCallbackData *callback); virtual CCommand *reduceUnclosedCheckCallback(); virtual double getMaxErrorLevel(); virtual CCommand *reportError(double errorLevelReport); virtual bool hasReportErrorFromSubCommands(); virtual CCommand *setReportErrorFromSubCommands(bool reportSubCommandErrors); // protected methods protected: virtual CCommand* closedSubCommand(); // protected variables protected: CLinker *subCommandLinker; CCommand *superCommand; CCommandRecordData *recordData; CCommandRecorder *recorder; QMutex closureSyncMutex; QMutex errorSyncMutex; bool processed; bool processing; bool closured; bool reportErrorFromSubCommands; cint64 mUnclosedCommandCount; CSynchronizedCallbackListExecuter processedCallbackExecuter; double errorLevel; // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_CONTROL_COMMAND_CCOMMAND_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommanderInitializationFactory.cpp0000644000175000017500000000222212520756352030241 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommanderInitializationFactory.h" namespace Konclude { namespace Control { namespace Command { CCommanderInitializationFactory::CCommanderInitializationFactory() { } CCommanderInitializationFactory::~CCommanderInitializationFactory() { } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CReasonerCommandBuilder.h0000644000175000017500000000441012520756354026130 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CReasonerCommandBuilder_H #define KONCLUDE_Control_COMMAND_CReasonerCommandBuilder_H // Libraries includes #include // Namespace includes #include "CCommandBuilder.h" // Other includes #include "Instructions/CSetConfigCommand.h" #include "Instructions/CGetConfigCommand.h" // Logger includes #include "Logger/CLogger.h" #include "Logger/Record/CContextRecorder.h" namespace Konclude { using namespace Logger; using namespace Logger::Record; namespace Control { namespace Command { using namespace Instructions; /*! * * \class CReasonerCommandBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReasonerCommandBuilder : public CCommandBuilder { // public methods public: //! Constructor CReasonerCommandBuilder(); //! Destructor virtual ~CReasonerCommandBuilder(); virtual CSetConfigCommand *createSetConfigCommand(const QString &configName, const QString &configValue, CContextRecorder *record = 0); virtual CGetConfigCommand *createGetConfigCommand(const QString &configName, CContextRecorder *record = 0); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CReasonerCommandBuilder_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandBuilder.h0000644000175000017500000000332712520756350024433 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCOMMANDBUILDER_H #define KONCLUDE_Control_COMMAND_CCOMMANDBUILDER_H // Libraries includes #include // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Control { namespace Command { /*! * * \class CCommandBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommandBuilder { // public methods public: //! Constructor CCommandBuilder(); //! Destructor virtual ~CCommandBuilder(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCOMMANDBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandRecordData.h0000644000175000017500000000506712520756352025062 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCOMMANDRECORDDATA_H #define KONCLUDE_Control_COMMAND_CCOMMANDRECORDDATA_H // Libraries includes #include // Namespace includes #include "CommandSettings.h" #include "CCommand.h" #include "CCommandRecorder.h" #include "CCommandRecordRouter.h" // Other includes #include "Logger/Record/CContextRecordData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Logger::Record; namespace Control { namespace Command { /*! * * \class CCommandRecordData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommandRecordData : public CContextRecordData { // public methods public: //! Constructor CCommandRecordData(CCommand *command, const QString &recordDomain, double recordErrorLevel = 0., CCommandRecordData *nextRecordData = 0); //! Destructor virtual ~CCommandRecordData(); virtual CCommand *getCommand(); virtual CCommandRecordData *setCommand(CCommand *command); virtual QString getRecordDomain(); virtual CCommandRecordData *setRecordDomain(const QString &recordDomain); virtual QString getRecordMessage() = 0; virtual CContextRecordData *setNextRecordData(CContextRecordData *recordData); virtual CCommandRecordData *getNextCommandRecordData(); // protected methods protected: // protected variables protected: CCommand *comm; QString recDomain; CCommandRecordData *prevCommandRecordData; // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCOMMANDRECORDDATA_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CDefaultCommanderInitializationFactory.cpp0000644000175000017500000001206212520756352031551 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDefaultCommanderInitializationFactory.h" namespace Konclude { namespace Control { namespace Command { CDefaultCommanderInitializationFactory::CDefaultCommanderInitializationFactory(CReasonerManager *useReasonerManager, CClassificationManager *useClassificationManager, COntologyRevisionManager *useOntologyRevisionManager) { useReasonerMan = useReasonerManager; useClassificationMan = useClassificationManager; useOntRevMan = useOntologyRevisionManager; } CDefaultCommanderInitializationFactory::~CDefaultCommanderInitializationFactory() { } CReasonerManager *CDefaultCommanderInitializationFactory::createReasonerManager(CConfigurationProvider *configProvider) { CReasonerManager *reasonerManager = 0; bool generatedReasoner = false; if (useReasonerMan) { reasonerManager = useReasonerMan; generatedReasoner = true; } CConfigurationBase *config = 0; if (configProvider) { config = configProvider->getCurrentConfiguration(); } if (config) { CConfigData *confData = 0; if (!generatedReasoner) { confData = config->getRelatedConfigChange("Konclude.Execution.DefaultReasonerManager"); if (confData) { QString reasonerString = confData->getString(); if (reasonerString == "ReasonerManager") { reasonerManager = new CReasonerManagerThread(); generatedReasoner = true; } else if (reasonerString == "ASAnalyseReasonerManager") { reasonerManager = new CAnalyseReasonerManager(); generatedReasoner = true; } else if (reasonerString == "ASExperimentalReasonerManager") { reasonerManager = new CExperimentalReasonerManager(); generatedReasoner = true; } } } } if (!generatedReasoner) { reasonerManager = new CReasonerManagerThread(); generatedReasoner = true; } return reasonerManager; } CClassificationManager *CDefaultCommanderInitializationFactory::createClassificationManager(CConfigurationProvider *configProvider) { CClassificationManager *classificationManager = 0; bool generatedClassification = false; if (useClassificationMan) { classificationManager = useClassificationMan; generatedClassification = true; } CConfigurationBase *config = 0; if (configProvider) { config = configProvider->getCurrentConfiguration(); } if (!generatedClassification) { classificationManager = new CClassificationManager(); generatedClassification = true; } return classificationManager; } COntologyRevisionManager *CDefaultCommanderInitializationFactory::createOntologyRevisionManager(CConfigurationProvider *configProvider) { COntologyRevisionManager *ontRevManager = 0; bool generatedOntRevMan = false; if (useOntRevMan) { ontRevManager = useOntRevMan; generatedOntRevMan = true; } CConfigurationBase *config = 0; if (configProvider) { config = configProvider->getCurrentConfiguration(); } if (!generatedOntRevMan) { ontRevManager = new CSPOntologyRevisionManager(); generatedOntRevMan = true; } return ontRevManager; } CCommanderInitializationFactory *CDefaultCommanderInitializationFactory::initializeReasonerManager(CReasonerManager *reasonerManager, CConfigurationProvider *configProvider) { reasonerManager->initializeManager(configProvider); return this; } CCommanderInitializationFactory *CDefaultCommanderInitializationFactory::initializeClassificationManager(CClassificationManager *classificationManager, CConfigurationProvider *configProvider) { CReasonerManager *reasonerManager = CConfigManagerReader::readReasonerManagerConfig(configProvider); CSubsumptionClassifierFactory *subsumpFactory = new CConfigDependedSubsumptionClassifierFactory(reasonerManager); classificationManager->initializeManager(subsumpFactory,configProvider); return this; } CCommanderInitializationFactory *CDefaultCommanderInitializationFactory::initializeOntologyRevisionManager(COntologyRevisionManager *ontologyRevisionManager, CConfigurationProvider *configProvider) { ontologyRevisionManager->initializeManager(configProvider); return this; } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandPrecondition.cpp0000644000175000017500000000213312520756352026031 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandPrecondition.h" namespace Konclude { namespace Control { namespace Command { CCommandPrecondition::CCommandPrecondition() { } CCommandPrecondition::~CCommandPrecondition() { } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandRecorder.h0000644000175000017500000000414212520756352024610 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCOMMANDRECORDER_H #define KONCLUDE_Control_COMMAND_CCOMMANDRECORDER_H // Libraries includes #include // Namespace includes #include "CommandSettings.h" #include "CCommandRecordData.h" // Other includes #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; using namespace Logger::Record; namespace Control { namespace Command { /*! * * \class CCommandRecorder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommandRecorder : public CContextRecorder { // public methods public: //! Constructor CCommandRecorder(); //! Destructor virtual ~CCommandRecorder(); virtual CCommandRecorder *recordData(CCommandRecordData *recData); virtual CContextRecorder *recordData(CContextRecordData *recData); static void recordToCommand(CCommand *command, CCommandRecordData *recData); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCOMMANDRECORDER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandDelegater.h0000644000175000017500000000347512520756350024745 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_Control_COMMAND_CCOMMANDDELEGATER_H #define KONCLUDE_Control_COMMAND_CCOMMANDDELEGATER_H // Libraries includes #include // Namespace includes #include "CCommand.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Logger; namespace Control { namespace Command { /*! * * \class CCommandDelegater * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCommandDelegater { // public methods public: //! Constructor CCommandDelegater(); //! Destructor virtual ~CCommandDelegater(); virtual CCommandDelegater *delegateCommand(CCommand *command) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Command }; // end namespace Control }; // end namespace Konclude #endif // KONCLUDE_Control_COMMAND_CCOMMANDDELEGATER_H Konclude-v0.6.2-544-SourceCode/Source/Control/Command/CCommandProcessedPrecondition.cpp0000644000175000017500000000336412520756352027710 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandProcessedPrecondition.h" namespace Konclude { namespace Control { namespace Command { CCommandProcessedPrecondition::CCommandProcessedPrecondition(CCommand *command) { comm = command; } CCommandProcessedPrecondition::~CCommandProcessedPrecondition() { } bool CCommandProcessedPrecondition::isPreconditionFullfilled() { return !comm || comm->isProcessed(); } CCommandProcessedPrecondition *CCommandProcessedPrecondition::addFullfilledCallback(CCallbackData *callback) { if (comm) { comm->addProcessedCallback(callback); } else { callback->doCallback(); } return this; } CCommand *CCommandProcessedPrecondition::getCommand() { return comm; } CCommandProcessedPrecondition *CCommandProcessedPrecondition::setCommand(CCommand *command) { comm = command; return this; } }; // end namespace Command }; // end namespace Control }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/0000755000175000017500000000000012613407250017467 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Config/CGlobalConfigurationBase.h0000644000175000017500000000347412520756332024503 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CGLOBALCONFIGURATIONBASE_H #define KONCLUDE_CONFIG_CGLOBALCONFIGURATIONBASE_H // Libraries includes // Namespace includes #include "CConfigurationBase.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CGlobalConfigurationBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGlobalConfigurationBase : public CConfigurationBase { // public methods public: //! Constructor CGlobalConfigurationBase(CConfigurationBase *previousConfiguration, qint64 configID); CGlobalConfigurationBase(CConfigurationGroup *confGroup, qint64 configID); //! Destructor virtual ~CGlobalConfigurationBase(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CGLOBALCONFIGURATIONBASE_H Konclude-v0.6.2-544-SourceCode/Source/Config/CStringConfigType.h0000644000175000017500000000432012520756332023205 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CSTRINGCONFIGTYPE_H #define KONCLUDE_CONFIG_CSTRINGCONFIGTYPE_H // Libraries includes #include #include // Namespace includes #include "CConfigType.h" #include "CConvertStringConfigType.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CStringConfigType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CStringConfigType : virtual public CConvertStringConfigType, virtual public CConfigType { // public methods public: //! Constructor CStringConfigType(const QString &value = QString("")); //! Destructor virtual ~CStringConfigType(); virtual CStringConfigType *getTypeCopy(); virtual bool supportsVariant(); virtual CStringConfigType *readFrom(const QVariant &var); virtual QVariant getVariant(); virtual CStringConfigType *setValue(QString value); virtual QString getValue(); virtual bool readFromString(const QString &string); virtual QString getString(); virtual bool equals(CConfigType *dataType); // protected methods protected: // protected variables protected: QString stringValue; // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CSTRINGCONFIGTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Config/CLocalConfigurationExtension.h0000644000175000017500000000430612520756332025432 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CLOCALCONFIGURATIONEXTENSION_H #define KONCLUDE_CONFIG_CLOCALCONFIGURATIONEXTENSION_H // Libraries includes // Namespace includes #include "CConfigurationProvider.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CLocalConfigurationExtension * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLocalConfigurationExtension : public CConfigurationBase { // public methods public: //! Constructor CLocalConfigurationExtension(CConfigurationBase *previousConfiguration, qint64 configID); //! Destructor virtual ~CLocalConfigurationExtension(); virtual CLocalConfigurationExtension *addConfigurationProvider(CConfigurationProvider *configurationProvider); virtual CConfigData *getRelatedConfigChange(qint64 configIndex, bool defaultCompensation = true); virtual qint64 getConfigurationLevel(); virtual CConfigurationBase *appendConfigurationsToList(QLinkedList *configurationList); // protected methods protected: // protected variables protected: QLinkedList remConfigList; // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CLOCALCONFIGURATIONEXTENSION_H Konclude-v0.6.2-544-SourceCode/Source/Config/CObjectConfigType.h0000644000175000017500000000323512520756332023151 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_COBJECTCONFIGTYPE_H #define KONCLUDE_CONFIG_COBJECTCONFIGTYPE_H // Libraries includes #include #include // Namespace includes #include "CConfigType.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CObjectConfigType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CObjectConfigType : public CConfigType { // public methods public: //! Constructor CObjectConfigType(); //! Destructor virtual ~CObjectConfigType(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_COBJECTCONFIGTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Config/CLocalConfigurationFixedExtension.cpp0000644000175000017500000000654212520756332026751 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLocalConfigurationFixedExtension.h" namespace Konclude { namespace Config { CLocalConfigurationFixedExtension::CLocalConfigurationFixedExtension(CConfigurationGroup *configGroup, qint64 configID) : CConfigurationBase(configGroup,configID) { } CLocalConfigurationFixedExtension::CLocalConfigurationFixedExtension(CConfigurationBase *previousConfiguration, qint64 configID) : CConfigurationBase(previousConfiguration,configID) { } CLocalConfigurationFixedExtension::~CLocalConfigurationFixedExtension() { } CLocalConfigurationFixedExtension *CLocalConfigurationFixedExtension::addConfiguration(CConfigurationBase *configuration) { remConfigList.append(configuration); return this; } CLocalConfigurationFixedExtension *CLocalConfigurationFixedExtension::addConfigurationList(const QLinkedList &configList) { remConfigList += configList; return this; } CLocalConfigurationFixedExtension *CLocalConfigurationFixedExtension::addCollectedConfigurations(CConfigurationBase *collectFromConfiguration) { if (collectFromConfiguration) { collectFromConfiguration->appendConfigurationsToList(&remConfigList); } return this; } qint64 CLocalConfigurationFixedExtension::getConfigurationLevel() { return remConfigList.count(); } CConfigData *CLocalConfigurationFixedExtension::getRelatedConfigChange(const QString &configName, bool defaultCompensation) { return CConfigurationBase::getRelatedConfigChange(configName,defaultCompensation); } CConfigData *CLocalConfigurationFixedExtension::getRelatedConfigChange(qint64 configIndex, bool defaultCompensation) { CConfigData *data = 0; data = getLastConfigChange(configIndex,false); for (QLinkedList::const_iterator it = remConfigList.constBegin(); it != remConfigList.constEnd() && !data; ++it) { CConfigurationBase *nextConf = (*it); data = nextConf->getLastConfigChange(configIndex,false); } if (!data) { if (conGroup) { data = conGroup->getConfigDefaultData(configIndex); } } return data; } QLinkedList CLocalConfigurationFixedExtension::getAdditionalConfigurationList() { return remConfigList; } CConfigurationBase *CLocalConfigurationFixedExtension::appendConfigurationsToList(QLinkedList *configurationList) { CConfigurationBase::appendConfigurationsToList(configurationList); if (configurationList) { *configurationList += remConfigList; } return this; } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CConfigDescription.h0000644000175000017500000000513612520756330023364 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CCONFIGDESCRIPTION_H #define KONCLUDE_CONFIG_CCONFIGDESCRIPTION_H // Libraries includes #include #include // Namespace includes #include "CConfigType.h" #include "CConvertStringConfigType.h" #include "CConvertIntegerConfigType.h" #include "CConvertBooleanConfigType.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CConfigDescription * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConfigDescription { // public methods public: //! Constructor CConfigDescription(const QString &name, const QString &description, CConfigType *takeConfigType); //! Destructor virtual ~CConfigDescription(); virtual CConfigType *getConfigType(); virtual CConfigDescription *setConfigType(CConfigType *takeConfigType); virtual CConfigDescription *setConfigName(const QString &name); virtual CConfigDescription *setConfigDescription(const QString &description); virtual CConfigDescription *setConfigID(qint64 id); virtual QString getConfigName(); virtual QString getConfigDescription(); virtual qint64 getConfigID(); virtual bool supportsStringConvertion(); virtual bool supportsIntegerConvertion(); virtual bool supportsBooleanConvertion(); // protected methods protected: // protected variables protected: QString configProperty; QString propertyDescription; qint64 configPropertyID; CConfigType *type; bool stringConvertable; bool integerConvertable; bool booleanConvertable; // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CCONFIGDESCRIPTION_H Konclude-v0.6.2-544-SourceCode/Source/Config/CIntegerConfigType.h0000644000175000017500000000455012520756332023341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CINTEGERCONFIGTYPE_H #define KONCLUDE_CONFIG_CINTEGERCONFIGTYPE_H // Libraries includes #include #include // Namespace includes #include "CConfigType.h" #include "CConvertStringConfigType.h" #include "CConvertIntegerConfigType.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CIntegerConfigType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIntegerConfigType : virtual public CConvertIntegerConfigType, virtual public CConvertStringConfigType, virtual public CConfigType { // public methods public: //! Constructor CIntegerConfigType(qint64 value = 0); //! Destructor virtual ~CIntegerConfigType(); virtual CIntegerConfigType *getTypeCopy(); virtual bool supportsVariant(); virtual CIntegerConfigType *setValue(qint64 value); virtual qint64 getValue(); virtual CIntegerConfigType *readFrom(const QVariant &var); virtual QVariant getVariant(); virtual bool readFromString(const QString &string); virtual QString getString(); virtual bool readFromInteger(qint64 integer); virtual qint64 getInteger(); virtual bool equals(CConfigType *dataType); // protected methods protected: // protected variables protected: qint64 intValue; // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CINTEGERCONFIGTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Config/CConfigurationBase.h0000644000175000017500000000532312520756330023353 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CCONFIGURATIONBASE_H #define KONCLUDE_CONFIG_CCONFIGURATIONBASE_H // Libraries includes // Namespace includes #include "CConfiguration.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CConfigurationBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConfigurationBase : public CConfiguration { // public methods public: //! Constructor CConfigurationBase(CConfiguration *previousConfiguration, qint64 configurationID); CConfigurationBase(CConfigurationBase *previousConfiguration, qint64 configurationID); CConfigurationBase(CConfigurationGroup *configGroup, qint64 configurationID); //! Destructor virtual ~CConfigurationBase(); virtual CConfigData *getRelatedConfigChange(const QString &configName, bool defaultCompensation = true); virtual CConfigData *getRelatedConfigChange(qint64 configIndex, bool defaultCompensation = true); virtual bool hasConfigChange(qint64 configIndex, qint64 prevConfID, CConfigData *configData = 0); virtual bool isSuccessor(qint64 configID); virtual qint64 getConfigurationLevel(); virtual qint64 getConfigurationID(); virtual CConfigurationBase *appendConfigurationsToList(QLinkedList *configurationList); virtual bool isConfigLevelLocked(CConfigData *data); virtual bool isConfigLevelLocked(qint64 configIndex, bool defaultCompensation = true); virtual bool isConfigLevelLocked(const QString &configName, bool defaultCompensation = true); // protected methods protected: // protected variables protected: CConfigurationBase *prevConfBase; qint64 confID; // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CCONFIGURATIONBASE_H Konclude-v0.6.2-544-SourceCode/Source/Config/CConfigDataReader.cpp0000644000175000017500000000717712520756330023437 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfigDataReader.h" namespace Konclude { namespace Config { CConfigDataReader::CConfigDataReader() { } CConfigDataReader::~CConfigDataReader() { } QString CConfigDataReader::readConfigString(CConfiguration *config, const QString &configString, const QString &defaultValue, bool *errorFlag) { QString stringValue = defaultValue; if (config) { CConfigData *configData = config->getRelatedConfigChange(configString,true); if (configData && configData->supportsStringConvertion()) { stringValue = configData->getString(); } else { if (errorFlag) { *errorFlag = true; } } } else { if (errorFlag) { *errorFlag = true; } } return stringValue; } qint64 CConfigDataReader::readConfigInteger(CConfiguration *config, const QString &configString, qint64 defaultValue, bool *errorFlag) { qint64 intValue = defaultValue; if (config) { CConfigData *configData = config->getRelatedConfigChange(configString,true); if (configData && configData->supportsIntegerConvertion()) { intValue = configData->getInteger(); } else { if (errorFlag) { *errorFlag = true; } } } else { if (errorFlag) { *errorFlag = true; } } return intValue; } bool CConfigDataReader::readConfigBoolean(CConfiguration *config, const QString &configString, bool defaultValue, bool *errorFlag) { qint64 boolValue = defaultValue; if (config) { CConfigData *configData = config->getRelatedConfigChange(configString,true); if (configData && configData->supportsBooleanConvertion()) { boolValue = configData->getBoolean(); } else { if (errorFlag) { *errorFlag = true; } } } else { if (errorFlag) { *errorFlag = true; } } return boolValue; } QString CConfigDataReader::readConfigString(CConfigurationProvider *configProv, const QString &configString, const QString &defaultValue, bool *errorFlag) { CConfiguration *config = 0; if (configProv) { config = configProv->getCurrentConfiguration(); } return readConfigString(config,configString,defaultValue,errorFlag); } qint64 CConfigDataReader::readConfigInteger(CConfigurationProvider *configProv, const QString &configString, qint64 defaultValue, bool *errorFlag) { CConfiguration *config = 0; if (configProv) { config = configProv->getCurrentConfiguration(); } return readConfigInteger(config,configString,defaultValue,errorFlag); } bool CConfigDataReader::readConfigBoolean(CConfigurationProvider *configProv, const QString &configString, bool defaultValue, bool *errorFlag) { CConfiguration *config = 0; if (configProv) { config = configProv->getCurrentConfiguration(); } return readConfigBoolean(config,configString,defaultValue,errorFlag); } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CConfigType.h0000644000175000017500000000325612520756330022023 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CCONFIGTYPE_H #define KONCLUDE_CONFIG_CCONFIGTYPE_H // Libraries includes #include #include // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CConfigType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConfigType { // public methods public: //! Constructor CConfigType(); //! Destructor virtual ~CConfigType(); virtual CConfigType *getTypeCopy() = 0; virtual bool equals(CConfigType *dataType) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CCONFIGTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Config/CConfigurationProvider.cpp0000644000175000017500000000205112520756330024621 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfigurationProvider.h" namespace Konclude { namespace Config { CConfigurationProvider::CConfigurationProvider() { } CConfigurationProvider::~CConfigurationProvider() { } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CConvertStringConfigType.cpp0000644000175000017500000000220612520756332025102 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConvertStringConfigType.h" namespace Konclude { namespace Config { CConvertStringConfigType::CConvertStringConfigType() { } CConvertStringConfigType::~CConvertStringConfigType() { } bool CConvertStringConfigType::supportsStringConvertion() { return true; } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CConvertBooleanConfigType.h0000644000175000017500000000355112520756332024664 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CCONVERTBOOLEANCONFIGTYPE_H #define KONCLUDE_CONFIG_CCONVERTBOOLEANCONFIGTYPE_H // Libraries includes #include #include // Namespace includes #include "CConfigType.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CConvertBooleanConfigType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConvertBooleanConfigType : virtual public CConfigType { // public methods public: //! Constructor CConvertBooleanConfigType(); //! Destructor virtual ~CConvertBooleanConfigType(); virtual bool supportsBooleanConvertion(); virtual bool readFromBoolean(bool boolean) = 0; virtual bool getBoolean() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CCONVERTBOOLEANCONFIGTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Config/CConfiguration.h0000644000175000017500000000541212520756330022557 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CCONFIGURATION_H #define KONCLUDE_CONFIG_CCONFIGURATION_H // Libraries includes // Namespace includes #include "CConfigurationGroup.h" #include "CConfigData.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CConfiguration * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConfiguration { // public methods public: //! Constructor CConfiguration(CConfigurationGroup *configGroup); CConfiguration(CConfiguration *previousConfiguration); //! Destructor virtual ~CConfiguration(); virtual bool setConfig(qint64 configIndex, CConfigData *takeData); virtual bool setConfig(const QString &configName, CConfigData *takeData); virtual CConfigData *createConfig(const QString &configName); virtual CConfigData *createAndSetConfig(const QString &configName); virtual CConfigData *getLastConfigChange(const QString &configName, bool defaultCompensation = true); virtual CConfigData *getLastConfigChange(qint64 configIndex, bool defaultCompensation = true); virtual CConfigData *getRelatedConfigChange(const QString &configName, bool defaultCompensation = true); virtual CConfigData *getRelatedConfigChange(qint64 configIndex, bool defaultCompensation = true); virtual CConfigurationGroup *getConfigurationGroup(); virtual CConfiguration *extendConfigurationGroup(CConfigurationGroup *referencedConfigGroup); // protected methods protected: // protected variables protected: CConfigurationGroup *conGroup; QVector *conData; QVector *hasRefConData; QVector *checkedRefConData; QLinkedList conDataContainer; CConfiguration *prevConf; // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CCONFIGURATION_H Konclude-v0.6.2-544-SourceCode/Source/Config/CConfigurationProvider.h0000644000175000017500000000331012520756330024265 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CCONFIGURATIONPROVIDER_H #define KONCLUDE_CONFIG_CCONFIGURATIONPROVIDER_H // Libraries includes // Namespace includes #include "CConfigurationBase.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CConfigurationProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConfigurationProvider { // public methods public: //! Constructor CConfigurationProvider(); //! Destructor virtual ~CConfigurationProvider(); virtual CConfigurationBase *getCurrentConfiguration() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CCONFIGURATIONPROVIDER_H Konclude-v0.6.2-544-SourceCode/Source/Config/CConfigDescription.cpp0000644000175000017500000000527712520756330023725 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfigDescription.h" namespace Konclude { namespace Config { CConfigDescription::CConfigDescription(const QString &name, const QString &description, CConfigType *takeConfigType) { type = takeConfigType; configProperty = name; propertyDescription = description; configPropertyID = 0; stringConvertable = false; integerConvertable = false; booleanConvertable = false; if (dynamic_cast(type)) { stringConvertable = true; } if (dynamic_cast(type)) { integerConvertable = true; } if (dynamic_cast(type)) { booleanConvertable = true; } } CConfigDescription::~CConfigDescription() { delete type; } bool CConfigDescription::supportsStringConvertion() { return stringConvertable; } bool CConfigDescription::supportsIntegerConvertion() { return integerConvertable; } bool CConfigDescription::supportsBooleanConvertion() { return booleanConvertable; } CConfigType *CConfigDescription::getConfigType() { return type; } CConfigDescription *CConfigDescription::setConfigType(CConfigType *takeConfigType) { type = takeConfigType; return this; } CConfigDescription *CConfigDescription::setConfigName(const QString &name) { configProperty = name; return this; } CConfigDescription *CConfigDescription::setConfigDescription(const QString &description) { propertyDescription = description; return this; } CConfigDescription *CConfigDescription::setConfigID(qint64 id) { configPropertyID = id; return this; } QString CConfigDescription::getConfigName() { return configProperty; } QString CConfigDescription::getConfigDescription() { return propertyDescription; } qint64 CConfigDescription::getConfigID() { return configPropertyID; } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CConfigType.cpp0000644000175000017500000000176112520756330022355 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfigType.h" namespace Konclude { namespace Config { CConfigType::CConfigType() { } CConfigType::~CConfigType() { } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CConvertStringConfigType.h0000644000175000017500000000355412520756332024556 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CCONVERTSTRINGCONFIGTYPE_H #define KONCLUDE_CONFIG_CCONVERTSTRINGCONFIGTYPE_H // Libraries includes #include #include // Namespace includes #include "CConfigType.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CConvertStringConfigType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConvertStringConfigType : virtual public CConfigType { // public methods public: //! Constructor CConvertStringConfigType(); //! Destructor virtual ~CConvertStringConfigType(); virtual bool supportsStringConvertion(); virtual bool readFromString(const QString &string) = 0; virtual QString getString() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CCONVERTSTRINGCONFIGTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Config/CConfigData.cpp0000644000175000017500000000722312520756330022304 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfigData.h" namespace Konclude { namespace Config { CConfigData::CConfigData(CConfigDescription *configDesciption, CConfigType *takeConfigValue) { configDes = configDesciption; configVal = takeConfigValue; lockLevel = -1; } CConfigData::CConfigData(CConfigDescription *configDesciption) { configDes = configDesciption; configVal = configDes->getConfigType()->getTypeCopy(); } CConfigData::~CConfigData() { delete configVal; } bool CConfigData::equals(CConfigData *data) { return (configDes == data->configDes && configVal->equals(data->configVal)); } bool CConfigData::readFromString(const QString &string) { CConvertStringConfigType *conStringData = dynamic_cast(configVal); if (conStringData) { return conStringData->readFromString(string); } return false; } QString CConfigData::getString() { QString string; CConvertStringConfigType *conStringData = dynamic_cast(configVal); if (conStringData) { string = conStringData->getString(); } return string; } bool CConfigData::readFromInteger(qint64 integer) { CConvertIntegerConfigType *conIntegerData = dynamic_cast(configVal); if (conIntegerData) { return conIntegerData->readFromInteger(integer); } return false; } qint64 CConfigData::getInteger() { qint64 integer = 0; CConvertIntegerConfigType *conIntegerData = dynamic_cast(configVal); if (conIntegerData) { integer = conIntegerData->getInteger(); } return integer; } bool CConfigData::readFromBoolean(bool boolean) { CConvertBooleanConfigType *conBooleanData = dynamic_cast(configVal); if (conBooleanData) { return conBooleanData->readFromBoolean(boolean); } return false; } bool CConfigData::getBoolean() { bool boolean = 0; CConvertBooleanConfigType *conBooleanData = dynamic_cast(configVal); if (conBooleanData) { boolean = conBooleanData->getBoolean(); } return boolean; } CConfigDescription *CConfigData::getConfigDescription() { return configDes; } CConfigType *CConfigData::getConfigType() { return configVal; } bool CConfigData::supportsStringConvertion() { return configDes->supportsStringConvertion(); } bool CConfigData::supportsIntegerConvertion() { return configDes->supportsIntegerConvertion(); } bool CConfigData::supportsBooleanConvertion() { return configDes->supportsBooleanConvertion(); } qint64 CConfigData::getLevelLock() { return lockLevel; } bool CConfigData::hasLock() { return lockLevel >= 0; } CConfigData *CConfigData::setLevelLock(qint64 levelLock) { lockLevel = levelLock; return this; } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CIntegerConfigType.cpp0000644000175000017500000000437712520756332023703 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIntegerConfigType.h" namespace Konclude { namespace Config { CIntegerConfigType::CIntegerConfigType(qint64 value) { intValue = value; } CIntegerConfigType::~CIntegerConfigType() { } CIntegerConfigType *CIntegerConfigType::getTypeCopy() { return new CIntegerConfigType(intValue); } bool CIntegerConfigType::supportsVariant() { return true; } CIntegerConfigType *CIntegerConfigType::readFrom(const QVariant &var) { intValue = var.toInt(); return this; } QVariant CIntegerConfigType::getVariant() { return QVariant(intValue); } CIntegerConfigType *CIntegerConfigType::setValue(qint64 value) { intValue = value; return this; } qint64 CIntegerConfigType::getValue() { return intValue; } bool CIntegerConfigType::equals(CConfigType *dataType) { CIntegerConfigType *intType = dynamic_cast(dataType); if (intType) { return (intValue == intType->intValue); } return false; } bool CIntegerConfigType::readFromString(const QString &string) { bool ok = true; qint64 tmp = string.toLongLong(&ok); if (ok) { intValue = tmp; } return ok; } QString CIntegerConfigType::getString() { return QString::number(intValue); } bool CIntegerConfigType::readFromInteger(qint64 integer) { intValue = integer; return true; } qint64 CIntegerConfigType::getInteger() { return intValue; } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CGlobalConfigurationBase.cpp0000644000175000017500000000250312520756332025026 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGlobalConfigurationBase.h" namespace Konclude { namespace Config { CGlobalConfigurationBase::CGlobalConfigurationBase(CConfigurationBase *previousConfiguration, qint64 configID) : CConfigurationBase(previousConfiguration,configID) { } CGlobalConfigurationBase::CGlobalConfigurationBase(CConfigurationGroup *confGroup, qint64 configID) : CConfigurationBase(confGroup,configID) { } CGlobalConfigurationBase::~CGlobalConfigurationBase() { } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CLocalCalculationConfigurationExtension.cpp0000644000175000017500000000446612405707536030157 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ /* * * Author: Andreas Steigmiller * Copyright: 2009 Andreas Steigmiller * Project: UUPR * */ #include "CLocalConfigurationExtension.h" namespace UUPR { namespace Config { CLocalConfigurationExtension::CLocalConfigurationExtension(CConfigurationBase *previousConfiguration, qint64 configID) : CConfigurationBase(previousConfiguration,configID) { } CLocalConfigurationExtension::~CLocalConfigurationExtension() { } CLocalConfigurationExtension *CLocalConfigurationExtension::addConfiguration(CConfigurationBase *configuration) { remConfigList.append(configuration); return this; } CConfigData *CLocalConfigurationExtension::getRelatedConfigChange(const QString &configName, bool defaultCompensatory) { CConfigData *data = 0; if (conGroup) { qint64 index = conGroup->getConfigIndex(configName,defaultCompensatory); data = getRelatedConfigChange(index); } return data; } CConfigData *CLocalConfigurationExtension::getRelatedConfigChange(qint64 configIndex, bool defaultCompensatory) { CConfigData *data = 0; data = getLastConfigChange(configIndex,false); for (QLinkedList::const_iterator it = remConfigList.constBegin(); it != remConfigList.constEnd() && !data; ++it) { CConfigurationBase *nextConf = (*it); data = nextConf->getLastConfigChange(configIndex,false); } if (!data) { if (conGroup) { data = conGroup->getConfigDefaultData(configIndex); } } return data; } }; // end namespace Config }; // end namespace UUPR Konclude-v0.6.2-544-SourceCode/Source/Config/CConvertIntegerConfigType.cpp0000644000175000017500000000221512520756332025231 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConvertIntegerConfigType.h" namespace Konclude { namespace Config { CConvertIntegerConfigType::CConvertIntegerConfigType() { } CConvertIntegerConfigType::~CConvertIntegerConfigType() { } bool CConvertIntegerConfigType::supportsIntegerConvertion() { return true; } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CConvertIntegerConfigType.h0000644000175000017500000000355512520756332024706 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CCONVERTINTEGERCONFIGTYPE_H #define KONCLUDE_CONFIG_CCONVERTINTEGERCONFIGTYPE_H // Libraries includes #include #include // Namespace includes #include "CConfigType.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CConvertIntegerConfigType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConvertIntegerConfigType : virtual public CConfigType { // public methods public: //! Constructor CConvertIntegerConfigType(); //! Destructor virtual ~CConvertIntegerConfigType(); virtual bool supportsIntegerConvertion(); virtual bool readFromInteger(qint64 integer) = 0; virtual qint64 getInteger() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CConvertIntegerConfigType_H Konclude-v0.6.2-544-SourceCode/Source/Config/CGlobalConfigurationProvider.h0000644000175000017500000000360312520756332025415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CGLOBALCONFIGURATIONPROVIDER_H #define KONCLUDE_CONFIG_CGLOBALCONFIGURATIONPROVIDER_H // Libraries includes // Namespace includes #include "CConfigurationProvider.h" #include "CGlobalConfigurationBase.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CGlobalConfigurationProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CGlobalConfigurationProvider : public CConfigurationProvider { // public methods public: //! Constructor CGlobalConfigurationProvider(); //! Destructor virtual ~CGlobalConfigurationProvider(); virtual CGlobalConfigurationBase *getCurrentGlobalConfiguration() = 0; virtual CConfigurationBase *getCurrentConfiguration(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CGLOBALCONFIGURATIONPROVIDER_H Konclude-v0.6.2-544-SourceCode/Source/Config/CBooleanConfigType.cpp0000644000175000017500000000523312520756330023653 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBooleanConfigType.h" namespace Konclude { namespace Config { CBooleanConfigType::CBooleanConfigType(bool value) { boolValue = value; } CBooleanConfigType::~CBooleanConfigType() { } CBooleanConfigType *CBooleanConfigType::getTypeCopy() { return new CBooleanConfigType(boolValue); } bool CBooleanConfigType::supportsVariant() { return true; } CBooleanConfigType *CBooleanConfigType::readFrom(const QVariant &var) { boolValue = var.toBool(); return this; } QVariant CBooleanConfigType::getVariant() { return QVariant(boolValue); } CBooleanConfigType *CBooleanConfigType::setValue(bool value) { boolValue = value; return this; } bool CBooleanConfigType::getValue() { return boolValue; } bool CBooleanConfigType::equals(CConfigType *dataType) { CBooleanConfigType *boolType = dynamic_cast(dataType); if (boolType) { return (boolValue == boolType->boolValue); } return false; } bool CBooleanConfigType::readFromString(const QString &string) { bool ok = true; qint64 tmp = string.toInt(&ok); if (ok) { boolValue = tmp; } else { if (string.toUpper() == "TRUE") { boolValue = true; ok = true; } if (string.toUpper() == "FALSE") { boolValue = false; ok = true; } } return ok; } QString CBooleanConfigType::getString() { if (boolValue) { return QString("TRUE"); } else { return QString("FALSE"); } } bool CBooleanConfigType::readFromInteger(qint64 integer) { boolValue = integer; return true; } qint64 CBooleanConfigType::getInteger() { return boolValue; } bool CBooleanConfigType::readFromBoolean(bool boolean) { boolValue = boolean; return true; } bool CBooleanConfigType::getBoolean() { return boolValue; } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CBooleanConfigType.h0000644000175000017500000000500512520756330023315 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CBOOLEANCONFIGTYPE_H #define KONCLUDE_CONFIG_CBOOLEANCONFIGTYPE_H // Libraries includes #include #include // Namespace includes #include "CConfigType.h" #include "CConvertStringConfigType.h" #include "CConvertIntegerConfigType.h" #include "CConvertBooleanConfigType.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CBooleanConfigType * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CBooleanConfigType : virtual public CConvertBooleanConfigType, virtual public CConvertIntegerConfigType, virtual public CConvertStringConfigType, virtual public CConfigType { // public methods public: //! Constructor CBooleanConfigType(bool value = false); //! Destructor virtual ~CBooleanConfigType(); virtual CBooleanConfigType *getTypeCopy(); virtual bool supportsVariant(); virtual CBooleanConfigType *setValue(bool value); virtual bool getValue(); virtual CBooleanConfigType *readFrom(const QVariant &var); virtual QVariant getVariant(); virtual bool readFromString(const QString &string); virtual QString getString(); virtual bool readFromInteger(qint64 integer); virtual qint64 getInteger(); virtual bool readFromBoolean(bool boolean); virtual bool getBoolean(); virtual bool equals(CConfigType *dataType); // protected methods protected: // protected variables protected: bool boolValue; // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CBOOLEANCONFIGTYPE_H Konclude-v0.6.2-544-SourceCode/Source/Config/CConfiguration.cpp0000644000175000017500000001122012520756330023104 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfiguration.h" namespace Konclude { namespace Config { CConfiguration::CConfiguration(CConfigurationGroup *configGroup) { conGroup = configGroup; qint64 conCount = 0; if (conGroup) { conCount = conGroup->getConfigPropertyCount(); } conData = new QVector(conCount,0); checkedRefConData = new QVector(conCount,false); hasRefConData = new QVector(conCount,false); prevConf = 0; } CConfiguration::CConfiguration(CConfiguration *previousConfiguration) { prevConf = previousConfiguration; conGroup = 0; if (prevConf) { conGroup = prevConf->conGroup; } qint64 conCount = 0; if (conGroup) { conCount = conGroup->getConfigPropertyCount(); } conData = new QVector(conCount,0); checkedRefConData = new QVector(conCount,false); hasRefConData = new QVector(conCount,false); } CConfiguration::~CConfiguration() { delete conData; delete checkedRefConData; delete hasRefConData; qDeleteAll(conDataContainer); } bool CConfiguration::setConfig(qint64 configIndex, CConfigData *takeData) { if (configIndex >= 0 && configIndex < conData->count()) { conDataContainer.append(takeData); (*conData)[configIndex] = takeData; return true; } return false; } bool CConfiguration::setConfig(const QString &configName, CConfigData *takeData) { if (conGroup) { qint64 index = conGroup->getConfigIndex(configName); return setConfig(index,takeData); } return false; } CConfigData *CConfiguration::createAndSetConfig(const QString &configName) { CConfigData *confData = createConfig(configName); if (confData) { setConfig(configName,confData); } return confData; } CConfigData *CConfiguration::createConfig(const QString &configName) { CConfigData *data = 0; if (conGroup) { CConfigDescription *conDes = conGroup->getConfigDescription(configName); if (conDes) { data = new CConfigData(conDes,conDes->getConfigType()->getTypeCopy()); } } return data; } CConfigData *CConfiguration::getRelatedConfigChange(const QString &configName, bool defaultCompensation) { return getLastConfigChange(configName,defaultCompensation); } CConfigData *CConfiguration::getRelatedConfigChange(qint64 configIndex, bool defaultCompensation) { return getLastConfigChange(configIndex,defaultCompensation); } CConfigData *CConfiguration::getLastConfigChange(const QString &configName, bool defaultCompensation) { CConfigData *data = 0; if (conGroup) { qint64 index = conGroup->getConfigIndex(configName); data = getLastConfigChange(index,defaultCompensation); } return data; } CConfigData *CConfiguration::getLastConfigChange(qint64 configIndex, bool defaultCompensation) { CConfigData *data = 0; if (configIndex >= 0 && configIndex < conData->count()) { data = (*conData)[configIndex]; if (!data) { if (!(*checkedRefConData)[configIndex]) { if (prevConf) { data = prevConf->getLastConfigChange(configIndex,defaultCompensation); } if (!data && conGroup && defaultCompensation) { data = conGroup->getConfigDefaultData(configIndex); } (*checkedRefConData)[configIndex] = true; if (data) { (*conData)[configIndex] = data; (*hasRefConData)[configIndex] = true; } } } } return data; } CConfigurationGroup *CConfiguration::getConfigurationGroup() { return conGroup; } CConfiguration *CConfiguration::extendConfigurationGroup(CConfigurationGroup *referencedConfigGroup) { qint64 conCount = referencedConfigGroup->getConfigPropertyCount(); conData->resize(conCount); checkedRefConData->resize(conCount); hasRefConData->resize(conCount); conGroup = referencedConfigGroup; return this; } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CConfigurationGroup.h0000644000175000017500000000576312520756330023605 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CCONFIGURATIONGROUP_H #define KONCLUDE_CONFIG_CCONFIGURATIONGROUP_H // Libraries includes #include #include // Namespace includes #include "CConfigDescription.h" #include "CConfigData.h" #include "CConfigType.h" // Other includes #include "Utilities/CDynRefVector.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Config { /*! * * \class CConfigurationGroup * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConfigurationGroup { // public methods public: //! Constructor CConfigurationGroup(); //! Destructor virtual ~CConfigurationGroup(); virtual qint64 addConfigProperty(CConfigDescription *takeConfigDescription, CConfigData *takeDefaultConfigValue); virtual qint64 addConfigProperty(CConfigDescription *takeConfigDescription, CConfigType *takeDefaultConfigType); virtual qint64 addConfigProperty(CConfigDescription *takeConfigDescription); virtual CConfigDescription *getConfigDescription(qint64 index); virtual CConfigDescription *getConfigDescription(const QString &name); virtual CConfigData *getConfigDefaultData(qint64 index); virtual CConfigData *getConfigDefaultData(const QString &name); virtual CConfigurationGroup *setConfigDefaultData(qint64 index, CConfigData *takeDefaultConfigValue); virtual qint64 getConfigPropertyCount(); virtual qint64 getConfigIndex(const QString &name); virtual CConfigurationGroup* getReferencedConfigurationGroup(); virtual QList getConfigDescriptonList(); // protected methods protected: // protected variables protected: CDynRefVector configDesVector; CDynRefVector configDataVector; QLinkedList configDesContainer; QLinkedList configDataContainer; QHash propertyNameIndexHash; QReadWriteLock readWriteSync; // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CCONFIGURATIONGROUP_H Konclude-v0.6.2-544-SourceCode/Source/Config/CConvertBooleanConfigType.cpp0000644000175000017500000000221512520756332025213 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConvertBooleanConfigType.h" namespace Konclude { namespace Config { CConvertBooleanConfigType::CConvertBooleanConfigType() { } CConvertBooleanConfigType::~CConvertBooleanConfigType() { } bool CConvertBooleanConfigType::supportsBooleanConvertion() { return true; } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/ConfigSettings.h0000644000175000017500000000255012520756332022575 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CONFIGSETTINGS #define KONCLUDE_CONFIG_CONFIGSETTINGS // Libraries includes #include #include // Namespace includes // Other includes // Logger includes namespace Konclude { namespace Config { /*! * * \file ConfigSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CConfigData; class CConfigDescription; class CConfigType; }; // end namespace Config }; // end namespace Konclude #endif // end KONCLUDE_CONFIG_CONFIGSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Config/CConfigData.h0000644000175000017500000000510012520756330021741 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CCONFIGDATA_H #define KONCLUDE_CONFIG_CCONFIGDATA_H // Libraries includes #include #include // Namespace includes #include "ConfigSettings.h" #include "CConfigDescription.h" #include "CConfigType.h" #include "CIntegerConfigType.h" #include "CStringConfigType.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CConfigData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConfigData { // public methods public: //! Constructor CConfigData(CConfigDescription *configDesciption, CConfigType *takeConfigValue); CConfigData(CConfigDescription *configDesciption); //! Destructor virtual ~CConfigData(); virtual bool equals(CConfigData *data); virtual bool supportsStringConvertion(); virtual bool readFromString(const QString &string); virtual QString getString(); virtual bool supportsIntegerConvertion(); virtual bool readFromInteger(qint64 integer); virtual qint64 getInteger(); virtual bool supportsBooleanConvertion(); virtual bool readFromBoolean(bool boolean); virtual bool getBoolean(); virtual CConfigDescription *getConfigDescription(); virtual CConfigType *getConfigType(); virtual qint64 getLevelLock(); virtual bool hasLock(); virtual CConfigData *setLevelLock(qint64 levelLock = -1); // protected methods protected: // protected variables protected: CConfigDescription *configDes; CConfigType *configVal; qint64 lockLevel; // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CCONFIGDATA_H Konclude-v0.6.2-544-SourceCode/Source/Config/CObjectConfigType.cpp0000644000175000017500000000201712520756332023501 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectConfigType.h" namespace Konclude { namespace Config { CObjectConfigType::CObjectConfigType() { } CObjectConfigType::~CObjectConfigType() { } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CGlobalConfigurationProvider.cpp0000644000175000017500000000231012520756332025742 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CGlobalConfigurationProvider.h" namespace Konclude { namespace Config { CGlobalConfigurationProvider::CGlobalConfigurationProvider() { } CGlobalConfigurationProvider::~CGlobalConfigurationProvider() { } CConfigurationBase *CGlobalConfigurationProvider::getCurrentConfiguration() { return getCurrentGlobalConfiguration(); } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CConfigurationGroup.cpp0000644000175000017500000001133212520756330024125 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfigurationGroup.h" namespace Konclude { namespace Config { CConfigurationGroup::CConfigurationGroup() { } CConfigurationGroup::~CConfigurationGroup() { qDeleteAll(configDesContainer); qDeleteAll(configDataContainer); } qint64 CConfigurationGroup::addConfigProperty(CConfigDescription *takeConfigDescription, CConfigData *takeDefaultConfigValue) { readWriteSync.lockForWrite(); if (takeConfigDescription){ configDesContainer.append(takeConfigDescription); } if (takeDefaultConfigValue){ configDataContainer.append(takeDefaultConfigValue); } qint64 configIdx = 0; if (!propertyNameIndexHash.contains(takeConfigDescription->getConfigName())) { configIdx = configDesVector.getItemCount(); propertyNameIndexHash.insert(takeConfigDescription->getConfigName(),configIdx); } else { configIdx = propertyNameIndexHash.value(takeConfigDescription->getConfigName()); } configDesVector.setData(configIdx,takeConfigDescription); configDataVector.setData(configIdx,takeDefaultConfigValue); takeConfigDescription->setConfigID(configIdx); readWriteSync.unlock(); return configIdx; } CConfigurationGroup *CConfigurationGroup::setConfigDefaultData(qint64 index, CConfigData *takeDefaultConfigValue) { readWriteSync.lockForWrite(); if (takeDefaultConfigValue){ configDataVector.setData(index,takeDefaultConfigValue); configDataContainer.append(takeDefaultConfigValue); } readWriteSync.unlock(); return this; } qint64 CConfigurationGroup::addConfigProperty(CConfigDescription *takeConfigDescription) { CConfigData *takeDefaultConfigValue = new CConfigData(takeConfigDescription,takeConfigDescription->getConfigType()->getTypeCopy()); return addConfigProperty(takeConfigDescription,takeDefaultConfigValue); } qint64 CConfigurationGroup::addConfigProperty(CConfigDescription *takeConfigDescription, CConfigType *takeDefaultConfigType) { CConfigData *takeDefaultConfigValue = new CConfigData(takeConfigDescription,takeDefaultConfigType); return addConfigProperty(takeConfigDescription,takeDefaultConfigValue); } CConfigDescription *CConfigurationGroup::getConfigDescription(qint64 index) { readWriteSync.lockForRead(); CConfigDescription *des = 0; if (index >= 0 && index < configDesVector.getItemCount()) { des = configDesVector.getData(index); } readWriteSync.unlock(); return des; } CConfigData *CConfigurationGroup::getConfigDefaultData(qint64 index) { readWriteSync.lockForRead(); CConfigData *dat = 0; if (index >= 0 && index < configDataVector.getItemCount()) { dat = configDataVector.getData(index); } readWriteSync.unlock(); return dat; } CConfigDescription *CConfigurationGroup::getConfigDescription(const QString &name) { qint64 index = getConfigIndex(name); return getConfigDescription(index); } CConfigData *CConfigurationGroup::getConfigDefaultData(const QString &name) { qint64 index = getConfigIndex(name); return getConfigDefaultData(index); } qint64 CConfigurationGroup::getConfigPropertyCount() { return configDesVector.getItemCount(); } qint64 CConfigurationGroup::getConfigIndex(const QString &name) { qint64 index = propertyNameIndexHash.value(name,-1); return index; } CConfigurationGroup* CConfigurationGroup::getReferencedConfigurationGroup() { CConfigurationGroup *refConfGroup = new CConfigurationGroup(); refConfGroup->propertyNameIndexHash = propertyNameIndexHash; refConfGroup->configDesVector.reference(&configDesVector); refConfGroup->configDataVector.reference(&configDataVector); return refConfGroup; } QList CConfigurationGroup::getConfigDescriptonList() { QList desList; for (cint64 i = configDesVector.getItemCount()-1; i >= 0; --i) { desList.append(configDesVector.getData(i)); } return desList; } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CLocalConfigurationExtension.cpp0000644000175000017500000000541312520756332025765 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLocalConfigurationExtension.h" namespace Konclude { namespace Config { CLocalConfigurationExtension::CLocalConfigurationExtension(CConfigurationBase *previousConfiguration, qint64 configID) : CConfigurationBase(previousConfiguration,configID) { } CLocalConfigurationExtension::~CLocalConfigurationExtension() { } CLocalConfigurationExtension *CLocalConfigurationExtension::addConfigurationProvider(CConfigurationProvider *configurationProvider) { remConfigList.append(configurationProvider); return this; } qint64 CLocalConfigurationExtension::getConfigurationLevel() { return remConfigList.count(); } CConfigData *CLocalConfigurationExtension::getRelatedConfigChange(qint64 configIndex, bool defaultCompensation) { CConfigData *data = 0; data = getLastConfigChange(configIndex,false); for (QLinkedList::const_iterator it = remConfigList.constBegin(); it != remConfigList.constEnd() && !data; ++it) { CConfigurationProvider *nextConfProv = (*it); CConfigurationBase *nextConf = nextConfProv->getCurrentConfiguration(); if (nextConf) { data = nextConf->getRelatedConfigChange(configIndex,false); } } if (!data) { if (conGroup) { data = conGroup->getConfigDefaultData(configIndex); } } return data; } CConfigurationBase *CLocalConfigurationExtension::appendConfigurationsToList(QLinkedList *configurationList) { CConfigurationBase::appendConfigurationsToList(configurationList); if (configurationList) { for (QLinkedList::const_iterator it = remConfigList.constBegin(); it != remConfigList.constEnd(); ++it) { CConfigurationProvider *nextConfProv = (*it); CConfigurationBase *nextConf = nextConfProv->getCurrentConfiguration(); if (nextConf) { nextConf->appendConfigurationsToList(configurationList); } } } return this; } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CStringConfigType.cpp0000644000175000017500000000402712520756332023544 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CStringConfigType.h" namespace Konclude { namespace Config { CStringConfigType::CStringConfigType(const QString &value) { stringValue = value; } CStringConfigType::~CStringConfigType() { } CStringConfigType *CStringConfigType::getTypeCopy() { return new CStringConfigType(stringValue); } bool CStringConfigType::supportsVariant() { return true; } CStringConfigType *CStringConfigType::readFrom(const QVariant &var) { stringValue = var.toString(); return this; } QVariant CStringConfigType::getVariant() { return QVariant(stringValue); } CStringConfigType *CStringConfigType::setValue(QString value) { stringValue = value; return this; } QString CStringConfigType::getValue() { return stringValue; } bool CStringConfigType::equals(CConfigType *dataType) { CStringConfigType *stringType = dynamic_cast(dataType); if (stringType) { return (stringValue == stringType->stringValue); } return false; } bool CStringConfigType::readFromString(const QString &string) { stringValue = string; return true; } QString CStringConfigType::getString() { return stringValue; } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Config/CLocalCalculationConfigurationExtension.h0000644000175000017500000000430012405707536027607 0ustar jonasjonas/* * Copyright (C) 2013, 2014 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ /* * * Author: Andreas Steigmiller * Copyright: 2009 Andreas Steigmiller * Project: UUPR * */ #ifndef UUPR_CONFIG_CLOCALCONFIGURATIONEXTENSION_H #define UUPR_CONFIG_CLOCALCONFIGURATIONEXTENSION_H // Qt includes // Namespace includes #include "CConfigurationBase.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace UUPR { namespace Config { /*! * * \class CLocalConfigurationExtension * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLocalConfigurationExtension : public CConfigurationBase { // public methods public: //! Constructor CLocalConfigurationExtension(CConfigurationBase *previousConfiguration, qint64 configID); //! Deconstructor virtual ~CLocalConfigurationExtension(); virtual CLocalConfigurationExtension *addConfiguration(CConfigurationBase *configuration); virtual CConfigData *getRelatedConfigChange(const QString &configName, bool defaultCompensatory = true); virtual CConfigData *getRelatedConfigChange(qint64 configIndex, bool defaultCompensatory = true); // protected methods protected: // protected variables protected: QLinkedList remConfigList; // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace UUPR #endif // UUPR_CONFIG_CLOCALCONFIGURATIONEXTENSION_H Konclude-v0.6.2-544-SourceCode/Source/Config/CLocalConfigurationFixedExtension.h0000644000175000017500000000533712520756332026417 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CLOCALCONFIGURATIONFIXEDEXTENSION_H #define KONCLUDE_CONFIG_CLOCALCONFIGURATIONFIXEDEXTENSION_H // Libraries includes // Namespace includes #include "CConfigurationBase.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CLocalConfigurationFixedExtension * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLocalConfigurationFixedExtension : public CConfigurationBase { // public methods public: //! Constructor CLocalConfigurationFixedExtension(CConfigurationGroup *configGroup, qint64 configID); CLocalConfigurationFixedExtension(CConfigurationBase *previousConfiguration, qint64 configID); //! Destructor virtual ~CLocalConfigurationFixedExtension(); virtual CLocalConfigurationFixedExtension *addConfiguration(CConfigurationBase *configuration); virtual CLocalConfigurationFixedExtension *addCollectedConfigurations(CConfigurationBase *collectFromConfiguration); virtual CLocalConfigurationFixedExtension *addConfigurationList(const QLinkedList &configList); virtual QLinkedList getAdditionalConfigurationList(); virtual CConfigData *getRelatedConfigChange(qint64 configIndex, bool defaultCompensation = true); virtual CConfigData *getRelatedConfigChange(const QString &configName, bool defaultCompensation = true); virtual qint64 getConfigurationLevel(); virtual CConfigurationBase *appendConfigurationsToList(QLinkedList *configurationList); // protected methods protected: // protected variables protected: QLinkedList remConfigList; // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CLOCALCONFIGURATIONFIXEDEXTENSION_H Konclude-v0.6.2-544-SourceCode/Source/Config/CConfigDataReader.h0000644000175000017500000000511012520756330023065 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_CONFIG_CCONFIGDATAREADER_H #define KONCLUDE_CONFIG_CCONFIGDATAREADER_H // Libraries includes #include // Namespace includes #include "ConfigSettings.h" #include "CConfiguration.h" #include "CConfigData.h" #include "CConfigurationProvider.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Config { /*! * * \class CConfigDataReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConfigDataReader { // public methods public: //! Constructor CConfigDataReader(); //! Destructor virtual ~CConfigDataReader(); static QString readConfigString(CConfiguration *config, const QString &configString, const QString &defaultValue = QString(), bool *errorFlag = 0); static qint64 readConfigInteger(CConfiguration *config, const QString &configString, qint64 defaultValue = 0, bool *errorFlag = 0); static bool readConfigBoolean(CConfiguration *config, const QString &configString, bool defaultValue = false, bool *errorFlag = 0); static QString readConfigString(CConfigurationProvider *configProv, const QString &configString, const QString &defaultValue = QString(), bool *errorFlag = 0); static qint64 readConfigInteger(CConfigurationProvider *configProv, const QString &configString, qint64 defaultValue = 0, bool *errorFlag = 0); static bool readConfigBoolean(CConfigurationProvider *configProv, const QString &configString, bool defaultValue = false, bool *errorFlag = 0); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Config }; // end namespace Konclude #endif // KONCLUDE_CONFIG_CCONFIGDATAREADER_H Konclude-v0.6.2-544-SourceCode/Source/Config/CConfigurationBase.cpp0000644000175000017500000001007412520756330023705 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConfigurationBase.h" namespace Konclude { namespace Config { CConfigurationBase::CConfigurationBase(CConfiguration *previousConfiguration, qint64 configurationID) : CConfiguration(previousConfiguration) { confID = configurationID; } CConfigurationBase::CConfigurationBase(CConfigurationBase *previousConfiguration, qint64 configurationID) : CConfiguration(previousConfiguration) { confID = configurationID; prevConfBase = previousConfiguration; } CConfigurationBase::CConfigurationBase(CConfigurationGroup *configGroup, qint64 configurationID) : CConfiguration(configGroup) { confID = configurationID; prevConfBase = 0; } CConfigurationBase::~CConfigurationBase() { } qint64 CConfigurationBase::getConfigurationLevel() { return 0; } bool CConfigurationBase::isConfigLevelLocked(CConfigData *data) { if (data) { return data->getLevelLock() >= getConfigurationLevel(); } return false; } bool CConfigurationBase::isConfigLevelLocked(const QString &configName, bool defaultCompensation) { CConfigData *configData = getRelatedConfigChange(configName,defaultCompensation); return isConfigLevelLocked(configData); } bool CConfigurationBase::isConfigLevelLocked(qint64 configIndex, bool defaultCompensation) { CConfigData *configData = getRelatedConfigChange(configIndex,defaultCompensation); return isConfigLevelLocked(configData); } qint64 CConfigurationBase::getConfigurationID() { return confID; } bool CConfigurationBase::isSuccessor(qint64 configID) { return (confID == configID || (prevConfBase && prevConfBase->isSuccessor(configID))); } bool CConfigurationBase::hasConfigChange(qint64 configIndex, qint64 prevConfID, CConfigData *configData) { if (configIndex >= 0 && configIndex < conData->count()) { if (confID >= prevConfID) { CConfigData *data = (*conData)[configIndex]; if (configData && data) { if (!configData->equals(data)) { return true; } } if (configData) { data = configData; } if (prevConfBase) { return prevConfBase->hasConfigChange(configIndex,prevConfID,data); } else if (prevConfID <= 0) { data = 0; if (prevConf) { data = prevConf->getLastConfigChange(configIndex); } else if (conGroup) { data = conGroup->getConfigDefaultData(configIndex); } if (configData && data) { if (!configData->equals(data)) { return true; } } } } } return false; } CConfigData *CConfigurationBase::getRelatedConfigChange(const QString &configName, bool defaultCompensation) { CConfigData *data = 0; if (conGroup) { qint64 index = conGroup->getConfigIndex(configName); data = getRelatedConfigChange(index,defaultCompensation); } return data; } CConfigData *CConfigurationBase::getRelatedConfigChange(qint64 configIndex, bool defaultCompensation) { CConfigData *data = getLastConfigChange(configIndex,defaultCompensation); return data; } CConfigurationBase *CConfigurationBase::appendConfigurationsToList(QLinkedList *configurationList) { if (configurationList) { configurationList->append(this); } return this; } }; // end namespace Config }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/0000755000175000017500000000000012613407262020240 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Utilities/CStaticExpandingMemoryManager.hpp0000644000175000017500000001247512520551364026636 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CSTATICEXPANDINGMEMORYMANAGER_H #define KONCLUDE_UTILITIES_CSTATICEXPANDINGMEMORYMANAGER_H // Libraries includes #include // Namespace includes #include "CAllocationObject.h" #include "UtilitiesSettings.h" #include "CMemoryReleaser.h" #include "CMemoryManager.hpp" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Utilities { /*! * * \class CStaticExpandingMemoryManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CStaticExpandingMemoryManager : public CMemoryManager { // public methods public: //! Constructor CStaticExpandingMemoryManager(qint64 extensionSize = 100, qint64 beginAllocationSize = 0); //! Destructor virtual ~CStaticExpandingMemoryManager(); virtual T *allocate(); virtual void release(T *&mem); virtual void release(CAllocationObject *object); void clear(); // protected methods protected: // private methods private: void extendMemory(); // private variables private: qint64 totalElements; qint64 freeElements; qint64 nextMemVecIndex; qint64 releaseMemVecIndex; qint64 vecSize; QLinkedList memory; QLinkedList free; QLinkedList memoryPtr; QLinkedList freeMemPtr; T **releaseMemVec; T **nextMemVec; bool hasAllocationContextChecked; bool hasAllocationContext; }; template CStaticExpandingMemoryManager::CStaticExpandingMemoryManager(qint64 extensionSize, qint64 beginAllocationSize) { vecSize = extensionSize; releaseMemVec = 0; nextMemVec = 0; nextMemVecIndex = 0; releaseMemVecIndex = 0; freeElements = 0; totalElements = 0; hasAllocationContextChecked = false; hasAllocationContext = false; for (qint64 i = 0; i < beginAllocationSize; i += vecSize) { extendMemory(); } } template CStaticExpandingMemoryManager::~CStaticExpandingMemoryManager() { clear(); } template void CStaticExpandingMemoryManager::clear() { releaseMemVec = 0; nextMemVec = 0; nextMemVecIndex = 0; releaseMemVecIndex = 0; freeElements = 0; totalElements = 0; foreach (T *mem, memory) { delete [] mem; } foreach (T **memPtr, memoryPtr) { delete [] memPtr; } memory.clear(); free.clear(); memoryPtr.clear(); freeMemPtr.clear(); } template void CStaticExpandingMemoryManager::extendMemory() { T *newMem = new T[vecSize]; if (!hasAllocationContextChecked) { CAllocationObject *allCon = dynamic_cast(&newMem[0]); if (allCon == 0) { hasAllocationContext = false; } else { hasAllocationContext = true; } hasAllocationContextChecked = true; } freeElements += vecSize; totalElements += vecSize; memory.append(newMem); T **newMemPtr = new T *[vecSize]; memoryPtr.append(newMemPtr); for (int i = 0; i < vecSize; ++i) { newMemPtr[i] = &(newMem[i]); } free.append(newMemPtr); } template T *CStaticExpandingMemoryManager::allocate() { if (nextMemVec == 0) { if (free.count() <= 0) { extendMemory(); } nextMemVec = free.first(); free.removeFirst(); nextMemVecIndex = 0; } T *memElement = nextMemVec[nextMemVecIndex++]; if (nextMemVecIndex >= vecSize) { freeMemPtr.append(nextMemVec); nextMemVec = 0; } freeElements--; if (hasAllocationContext) { CAllocationObject *allCon = (CAllocationObject *)(memElement); allCon->setContainered(); allCon->setMemoryReleaser(this); } return memElement; } template void CStaticExpandingMemoryManager::release(T *&mem) { if (releaseMemVec == 0) { if (freeMemPtr.count() > 0) { releaseMemVec = freeMemPtr.first(); freeMemPtr.removeFirst(); } else { releaseMemVec = new T *[vecSize]; memoryPtr.append(releaseMemVec); } } freeElements++; releaseMemVec[releaseMemVecIndex++] = mem; mem = 0; if (releaseMemVecIndex >= vecSize) { releaseMemVecIndex = 0; if (releaseMemVec != 0) { free.append(releaseMemVec); releaseMemVec = 0; } } } template void CStaticExpandingMemoryManager::release(CAllocationObject *object) { T *mem = (T*)object; release(mem); } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CSTATICEXPANDINGMEMORYMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/UtilitiesSettings.h0000644000175000017500000000345212520551364024111 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_UTILITIESSETTINGS #define KONCLUDE_UTILITIES_UTILITIESSETTINGS // Libraries includes #include // Namespace includes // Other includes #include // Logger includes using namespace std; namespace Konclude { namespace Utilities { #define nullptr 0 typedef qint64 cint64; typedef quint64 cuint64; typedef int cint; #define CINT_MAX std::numeric_limits::max(); #define CINT_MIN std::numeric_limits::min(); #define CINT64_MAX std::numeric_limits::max(); #define CINT64_MIN std::numeric_limits::min(); #define DOUBLE_MAX std::numeric_limits::max(); #define DOUBLE_MIN std::numeric_limits::min(); // forward declarations class CAllocationObject; class CMemoryReleaser; /*! * * \file UtilitiesSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ }; // end namespace Utilities }; // end namespace Konclude #endif // end KONCLUDE_UTILITIES_UTILITIESSETTINGS Konclude-v0.6.2-544-SourceCode/Source/Utilities/CObjectContainer.h0000644000175000017500000000406312520551362023566 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CMEMORYCONTAINER_H #define KONCLUDE_UTILITIES_CMEMORYCONTAINER_H // Libraries includes #include // Namespace includes // Other includes #include "Utilities/CAllocationObject.h" #include "Utilities/CAllocationLinker.h" #include "Utilities/CDynamicExpandingMemoryManager.hpp" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { /*! * * \class CObjectContainer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CObjectContainer : public CAllocationObject { // public methods public: //! Constructor CObjectContainer(); //! Destructor virtual ~CObjectContainer(); CObjectContainer *addObject(CAllocationLinker *linkerObject); CObjectContainer *addObject(CAllocationObject *allocationObject); void clear(); // protected methods protected: // protected variables protected: CAllocationLinker *linker; CAllocationLinker *sLinker; CDynamicExpandingMemoryManager *allocLinkerMemMan; // private methods private: // private variables private: }; }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CMEMORYCONTAINER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CDynamicExpandingMemoryManager.hpp0000644000175000017500000001374612520551362026773 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CDYNAMICEXPANDINGMEMORYMANAGER_H #define KONCLUDE_UTILITIES_CDYNAMICEXPANDINGMEMORYMANAGER_H // Libraries includes #include // Namespace includes #include "CAllocationObject.h" #include "UtilitiesSettings.h" #include "CMemoryReleaser.h" #include "CMemoryManager.hpp" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Utilities { /*! * * \class CDynamicExpandingMemoryManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CDynamicExpandingMemoryManager : public CMemoryManager { // public methods public: //! Constructor CDynamicExpandingMemoryManager(qreal expansionFactor = 10., qint64 beginExtensionSize = 8, qint64 maxExtensionSize = 2040, qint64 beginAllocationSize = 0); //! Destructor virtual ~CDynamicExpandingMemoryManager(); virtual T *allocate(); virtual void release(T *&mem); virtual void release(CAllocationObject *object); void clear(); // protected methods protected: // private methods private: void extendMemory(); // private variables private: qint64 totalElements; qint64 freeElements; qint64 nextMemVecIndex; qint64 releaseMemVecIndex; qint64 vecSize; qreal extendFac; qint64 minExtSize; qint64 maxExtSize; qint64 currExtSizeInt; qreal currExtSizeReal; QList memory; QList free; QList memoryPtr; QList freeMemPtr; T **releaseMemVec; T **nextMemVec; bool hasAllocationContextChecked; bool hasAllocationContext; }; template CDynamicExpandingMemoryManager::CDynamicExpandingMemoryManager(qreal expansionFactor, qint64 beginExtensionSize, qint64 maxExtensionSize, qint64 beginAllocationSize) { vecSize = maxExtensionSize; extendFac = expansionFactor; minExtSize = beginExtensionSize; maxExtSize = maxExtensionSize; currExtSizeInt = minExtSize; currExtSizeReal = minExtSize; releaseMemVec = 0; nextMemVec = 0; nextMemVecIndex = 0; releaseMemVecIndex = 0; freeElements = 0; totalElements = 0; hasAllocationContextChecked = false; hasAllocationContext = false; for (qint64 i = 0; i < beginAllocationSize; i += vecSize) { extendMemory(); } } template CDynamicExpandingMemoryManager::~CDynamicExpandingMemoryManager() { clear(); } template void CDynamicExpandingMemoryManager::clear() { releaseMemVec = 0; nextMemVec = 0; nextMemVecIndex = 0; releaseMemVecIndex = 0; freeElements = 0; totalElements = 0; foreach (T *mem, memory) { delete [] mem; } foreach (T **memPtr, memoryPtr) { delete [] memPtr; } memory.clear(); free.clear(); memoryPtr.clear(); freeMemPtr.clear(); } template void CDynamicExpandingMemoryManager::extendMemory() { T *newMem = new T[currExtSizeInt]; if (!hasAllocationContextChecked) { CAllocationObject *allCon = dynamic_cast(&newMem[0]); if (allCon == 0) { hasAllocationContext = false; } else { hasAllocationContext = true; } hasAllocationContextChecked = true; } freeElements += currExtSizeInt; totalElements += currExtSizeInt; memory.append(newMem); T **newMemPtr = new T *[vecSize]; memoryPtr.append(newMemPtr); for (int i = 0; i < currExtSizeInt; ++i) { newMemPtr[i] = &(newMem[i]); } for (int i = currExtSizeInt; i < vecSize; ++i) { newMemPtr[i] = 0; } free.append(newMemPtr); currExtSizeReal *= extendFac; if (currExtSizeReal > maxExtSize) { currExtSizeReal = maxExtSize; } currExtSizeInt = (qint64)currExtSizeReal; } template T *CDynamicExpandingMemoryManager::allocate() { T *memElement = 0; while (!memElement) { if (nextMemVec) { memElement = nextMemVec[nextMemVecIndex++]; if (nextMemVecIndex >= vecSize) { freeMemPtr.append(nextMemVec); nextMemVec = 0; } } if (memElement == 0) { if (free.isEmpty()) { extendMemory(); } nextMemVec = free.takeFirst(); nextMemVecIndex = 0; } } freeElements--; if (hasAllocationContext) { CAllocationObject *allCon = (CAllocationObject *)(memElement); allCon->setMemoryReleaser(this); } return memElement; } template void CDynamicExpandingMemoryManager::release(T *&mem) { if (releaseMemVec == 0) { if (!freeMemPtr.isEmpty()) { releaseMemVec = freeMemPtr.takeFirst(); } else { releaseMemVec = new T *[vecSize]; memoryPtr.append(releaseMemVec); } } freeElements++; releaseMemVec[releaseMemVecIndex++] = mem; mem = 0; if (releaseMemVecIndex >= vecSize) { releaseMemVecIndex = 0; if (releaseMemVec != 0) { free.append(releaseMemVec); releaseMemVec = 0; } } } template void CDynamicExpandingMemoryManager::release(CAllocationObject *object) { T *mem = (T*)object; release(mem); } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CDYNAMICEXPANDINGMEMORYMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CReverseSort.hpp0000644000175000017500000000751312520551362023343 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CREVERSESORT_H #define KONCLUDE_UTILITIES_CREVERSESORT_H // Libraries includes #include // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Utilities { template class CReverseSort; /*! * * \class CReverseSort * \author Andreas Steigmiller * \version 0.1 * \brief Spezialised Pointer Version to avoid comparison between addresses * */ template class CReverseSort { // public Functions public: //! Constructor CReverseSort(); CReverseSort(T *&sortObject); //! Destructor virtual ~CReverseSort(); T*& getData(); bool operator==(const CReverseSort &comparisonObject); bool operator<=(const CReverseSort &comparisonObject); bool operator>=(const CReverseSort &comparisonObject); // private Functions private: T *object; // private Variables private: }; template CReverseSort::CReverseSort() { } template CReverseSort::CReverseSort(T *&sortObject) { object = sortObject; } template T*& CReverseSort::getData() { return object; } template bool CReverseSort::operator==(const CReverseSort &comparisonObject) { return *object == *comparisonObject; } template bool CReverseSort::operator<=(const CReverseSort &comparisonObject) { return *object >= *comparisonObject; } template bool CReverseSort::operator>=(const CReverseSort &comparisonObject) { return *object <= *comparisonObject; } /*! * * \class CReverseSort * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CReverseSort { // public Functions public: //! Constructor CReverseSort(); CReverseSort(T &sortObject); //! Destructor virtual ~CReverseSort(); T& getData(); bool operator==(const CReverseSort &comparisonObject); bool operator<=(const CReverseSort &comparisonObject); bool operator>=(const CReverseSort &comparisonObject); // private Functions private: T object; // private Variables private: }; template CReverseSort::CReverseSort() { } template CReverseSort::CReverseSort(T &sortObject) { object = sortObject; } template T& CReverseSort::getData() { return object; } template bool CReverseSort::operator==(const CReverseSort &comparisonObject) { return object == comparisonObject; } template bool CReverseSort::operator<=(const CReverseSort &comparisonObject) { return object >= comparisonObject; } template bool CReverseSort::operator>=(const CReverseSort &comparisonObject) { return object <= comparisonObject; } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CREVERSESORT_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CNegLinker.hpp0000644000175000017500000001034712520551362022735 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CNEGLINKER_H #define KONCLUDE_UTILITIES_CNEGLINKER_H // Libraries includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Utilities { /*! * * \class CNegLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CNegLinker { // public methods public: //! Constructor CNegLinker(); CNegLinker(T dataElement, bool isNegated = false, CNegLinker *nextLink = 0); //! Destructor virtual ~CNegLinker(); CNegLinker *init(T dataElement, bool isNegated = false, CNegLinker *nextLink = 0); bool hasNext(); CNegLinker *setNext(CNegLinker *nextLink); CNegLinker *getNext(); T getData(); CNegLinker *setData(T dataElement); bool isNegated(); CNegLinker *setNegated(bool isNegated); CNegLinker *prepend(CNegLinker *prependingList); CNegLinker *append(CNegLinker *appendingList); CNegLinker *removeNext(); CNegLinker *getLastListLink(); // protected methods protected: // private methods private: // private variables private: CNegLinker *next; T data; bool negated; }; template CNegLinker::CNegLinker() { next = 0; negated = false; } template CNegLinker::CNegLinker(T dataElement, bool isNegated, CNegLinker *nextLink) { next = nextLink; negated = isNegated; data = dataElement; } template CNegLinker *CNegLinker::init(T dataElement, bool isNegated, CNegLinker *nextLink) { next = nextLink; negated = isNegated; data = dataElement; } template CNegLinker::~CNegLinker() { } template bool CNegLinker::hasNext() { return next != 0; } template CNegLinker *CNegLinker::setNext(CNegLinker *nextLink) { next = nextLink; return this; } template CNegLinker *CNegLinker::getNext() { return next; } template T CNegLinker::getData() { return data; } template CNegLinker *CNegLinker::setData(T dataElement) { data = dataElement; return this; } template bool CNegLinker::isNegated() { return negated; } template CNegLinker *CNegLinker::setNegated(bool isNegated) { negated = isNegated; return this; } template CNegLinker *CNegLinker::prepend(CNegLinker *prependingList) { CNegLinker *last = prependingList->getLastListLink(); last->setNext(this); return prependingList; } template CNegLinker *CNegLinker::append(CNegLinker *appendingList) { CNegLinker *last = getLastListLink(); last->setNext(appendingList); return this; } template CNegLinker *CNegLinker::removeNext() { CNegLinker *tmpNext = next; if (next) { CNegLinker *tmpNextNext = next->next; next->next = 0; setNext(tmpNextNext); } return tmpNext; } template CNegLinker *CNegLinker::getLastListLink() { CNegLinker *lastListLink = this; while (lastListLink->hasNext()) { lastListLink = lastListLink->getNext(); } return lastListLink; } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CNEGLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CDblNegLinker.hpp0000644000175000017500000001470112520551362023355 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CDBLNEGLINKER_H #define KONCLUDE_UTILITIES_CDBLNEGLINKER_H // Libraries includes // Namespace includes #include // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { /*! * * \class CDblNegLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CDblNegLinker { // public methods public: //! Constructor CDblNegLinker(); CDblNegLinker(T dataElement, bool isNegated = false, CDblNegLinker *nextLink = 0); //! Destructor virtual ~CDblNegLinker(); CDblNegLinker *init(T dataElement, bool isNegated = false, CDblNegLinker *nextLink = 0); bool hasNext(); bool hasPrev(); CDblNegLinker *insertNext(CDblNegLinker *nextLink); CDblNegLinker *getNext(); CDblNegLinker *insertPrev(CDblNegLinker *prevLink); CDblNegLinker *getPrev(); CDblNegLinker *setNext(CDblNegLinker *prevLink); CDblNegLinker *setPrev(CDblNegLinker *prevLink); T getData(); CDblNegLinker *setData(T dataElement); bool isNegated(); CDblNegLinker *setNegated(bool isNegated); CDblNegLinker *prepend(CDblNegLinker *prependingList); CDblNegLinker *append(CDblNegLinker *appendingList); CDblNegLinker *removeNext(); CDblNegLinker *removePrev(); CDblNegLinker *getLastListLink(); CDblNegLinker *getFirstListLink(); // protected methods protected: // private methods private: // private variables private: CDblNegLinker *next; CDblNegLinker *prev; T data; bool negated; }; template CDblNegLinker::CDblNegLinker() { next = 0; prev = 0; negated = false; } template CDblNegLinker::CDblNegLinker(T dataElement, bool isNegated, CDblNegLinker *nextLink) { next = 0; prev = 0; setNext(nextLink); data = dataElement; negated = isNegated; } template CDblNegLinker *CDblNegLinker::init(T dataElement, bool isNegated, CDblNegLinker *nextLink) { next = 0; prev = 0; setNext(nextLink); data = dataElement; negated = isNegated; return this; } template CDblNegLinker::~CDblNegLinker() { } template bool CDblNegLinker::hasNext() { return next != 0; } template bool CDblNegLinker::hasPrev() { return prev != 0; } template CDblNegLinker *CDblNegLinker::insertNext(CDblNegLinker *nextLink) { if (nextLink) { CDblNegLinker *tmpNext = next; next = nextLink; nextLink->prev = this; if (tmpNext) { nextLink->append(tmpNext); } } return this; } template CDblNegLinker *CDblNegLinker::insertPrev(CDblNegLinker *prevLink) { if (prevLink) { CDblNegLinker *pLlast = prevLink->getLastListLink(); CDblNegLinker *tmpPrev = prev; prev = pLlast; pLlast->next = this; if (tmpPrev) { tmpPrev->next = 0; prevLink->prepend(tmpPrev); } return prevLink; } else { return this; } } template CDblNegLinker *CDblNegLinker::setNext(CDblNegLinker *nextLink) { next = nextLink; if (nextLink) { nextLink->prev = this; } return this; } template CDblNegLinker *CDblNegLinker::setPrev(CDblNegLinker *prevLink) { if (prevLink) { CDblNegLinker *pLlast = prevLink->getLastListLink(); pLlast->next = this; prev = pLlast; return prevLink; } else { prev = 0; return this; } } template CDblNegLinker *CDblNegLinker::getNext() { return next; } template CDblNegLinker *CDblNegLinker::getPrev() { return prev; } template T CDblNegLinker::getData() { return data; } template CDblNegLinker *CDblNegLinker::setData(T dataElement) { data = dataElment; return this; } template bool CDblNegLinker::isNegated() { return negated; } template CDblNegLinker *CDblNegLinker::setNegated(bool isNegated) { negated = isNegated; return this; } template CDblNegLinker *CDblNegLinker::prepend(CDblNegLinker *prependingList) { CDblNegLinker *last = prependingList->getLastListLink(); last->insertNext(this); return prependingList; } template CDblNegLinker *CDblNegLinker::append(CDblNegLinker *appendingList) { CDblNegLinker *last = getLastListLink(); last->insertNext(appendingList); return this; } template CDblNegLinker *CDblNegLinker::removeNext() { CDblNegLinker *next = getNext(); if (next) { next->next = 0; next->prev = 0; setNext(next->getNext()); } return next; } template CDblNegLinker *CDblNegLinker::removePrev() { CDblNegLinker *prev = getPrev(); if (prev) { prev->next = 0; prev->prev = 0; setPrev(prev->getPrev()); } return prev; } template CDblNegLinker *CDblNegLinker::getLastListLink() { CDblNegLinker *lastListLink = this; while (lastListLink->hasNext()) { lastListLink = lastListLink->getNext(); } return lastListLink; } template CDblNegLinker *CDblNegLinker::getFirstListLink() { CDblNegLinker *firstListLink = this; while (firstListLink->hasPrev()) { firstListLink = firstListLink->getPrev(); } return firstListLink; } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CDBLNEGLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CMemoryManager.hpp0000644000175000017500000000377212520551362023626 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CMEMORYMANAGER_H #define KONCLUDE_UTILITIES_CMEMORYMANAGER_H // Libraries includes #include // Namespace includes #include "CAllocationObject.h" #include "UtilitiesSettings.h" #include "CMemoryReleaser.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Utilities { /*! * * \class CMemoryManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CMemoryManager : public CMemoryReleaser, public CAllocationObject { // public methods public: //! Constructor CMemoryManager(); //! Destructor virtual ~CMemoryManager(); virtual T *allocate() = 0; virtual void release(T *&mem) = 0; virtual void release(CAllocationObject *object) = 0; // protected methods protected: // private methods private: // private variables private: }; template CMemoryManager::CMemoryManager() { } template CMemoryManager::~CMemoryManager() { } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CMEMORYMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CDblLinker.hpp0000644000175000017500000001336712520551362022732 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CDBLLINKER_H #define KONCLUDE_UTILITIES_CDBLLINKER_H // Libraries includes // Namespace includes #include // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { /*! * * \class CDblLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CDblLinker { // public methods public: //! Constructor CDblLinker(); CDblLinker(T dataElement, CDblLinker *nextLink = 0); //! Destructor virtual ~CDblLinker(); CDblLinker *init(T dataElement, CDblLinker *nextLink = 0); bool hasNext(); bool hasPrev(); CDblLinker *insertNext(CDblLinker *nextLink); CDblLinker *getNext(); CDblLinker *insertPrev(CDblLinker *prevLink); CDblLinker *getPrev(); CDblLinker *setNext(CDblLinker *prevLink); CDblLinker *setPrev(CDblLinker *prevLink); T getData(); CDblLinker *setData(T dataElement); CDblLinker *prepend(CDblLinker *prependingList); CDblLinker *append(CDblLinker *appendingList); CDblLinker *removeNext(); CDblLinker *removePrev(); CDblLinker *getLastListLink(); CDblLinker *getFirstListLink(); // protected methods protected: // private methods private: // private variables private: CDblLinker *next; CDblLinker *prev; T data; }; template CDblLinker::CDblLinker() { next = 0; prev = 0; } template CDblLinker::CDblLinker(T dataElement, CDblLinker *nextLink) { next = 0; prev = 0; setNext(nextLink); data = dataElement; } template CDblLinker *CDblLinker::init(T dataElement, CDblLinker *nextLink) { next = 0; prev = 0; setNext(nextLink); data = dataElement; return this; } template CDblLinker::~CDblLinker() { } template bool CDblLinker::hasNext() { return next != 0; } template bool CDblLinker::hasPrev() { return prev != 0; } template CDblLinker *CDblLinker::insertNext(CDblLinker *nextLink) { if (nextLink) { CDblLinker *tmpNext = next; next = nextLink; nextLink->prev = this; if (tmpNext) { nextLink->append(tmpNext); } } return this; } template CDblLinker *CDblLinker::insertPrev(CDblLinker *prevLink) { if (prevLink) { CDblLinker *pLlast = prevLink->getLastListLink(); CDblLinker *tmpPrev = prev; prev = pLlast; pLlast->next = this; if (tmpPrev) { tmpPrev->next = 0; prevLink->prepend(tmpPrev); } return prevLink; } else { return this; } } template CDblLinker *CDblLinker::setNext(CDblLinker *nextLink) { next = nextLink; if (nextLink) { nextLink->prev = this; } return this; } template CDblLinker *CDblLinker::setPrev(CDblLinker *prevLink) { if (prevLink) { CDblLinker *pLlast = prevLink->getLastListLink(); pLlast->next = this; prev = pLlast; return prevLink; } else { prev = 0; return this; } } template CDblLinker *CDblLinker::getNext() { return next; } template CDblLinker *CDblLinker::getPrev() { return prev; } template T CDblLinker::getData() { return data; } template CDblLinker *CDblLinker::setData(T dataElement) { data = dataElement; return this; } template CDblLinker *CDblLinker::prepend(CDblLinker *prependingList) { CDblLinker *last = prependingList->getLastListLink(); last->insertNext(this); return prependingList; } template CDblLinker *CDblLinker::append(CDblLinker *appendingList) { CDblLinker *last = getLastListLink(); last->insertNext(appendingList); return this; } template CDblLinker *CDblLinker::removeNext() { CDblLinker *next = getNext(); if (next) { next->next = 0; next->prev = 0; setNext(next->getNext()); } return next; } template CDblLinker *CDblLinker::removePrev() { CDblLinker *prev = getPrev(); if (prev) { prev->next = 0; prev->prev = 0; setPrev(prev->getPrev()); } return prev; } template CDblLinker *CDblLinker::getLastListLink() { CDblLinker *lastListLink = this; while (lastListLink->hasNext()) { lastListLink = lastListLink->getNext(); } return lastListLink; } template CDblLinker *CDblLinker::getFirstListLink() { CDblLinker *firstListLink = this; while (firstListLink->hasPrev()) { firstListLink = firstListLink->getPrev(); } return firstListLink; } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CDBLLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CHashableIntConvertedNTuble.hpp0000644000175000017500000000420612520551362026222 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CNTUBLE_H #define KONCLUDE_UTILITIES_CNTUBLE_H // Libraries includes #include // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { /*! * * \class CNTuble * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CHashableIntConvertedNTuble : public QByteArray { // public Functions public: //! Constructor CHashableIntConvertedNTuble(); //! Destructor virtual ~CHashableIntConvertedNTuble(); CHashableIntConvertedNTuble& addValue(T value); // private Functions private: // private Variables private: }; template CHashableIntConvertedNTuble::CHashableIntConvertedNTuble() { } template CHashableIntConvertedNTuble::~CHashableIntConvertedNTuble() { } template CHashableIntConvertedNTuble& CHashableIntConvertedNTuble::addValue(T value) { //QByteArray newValByteArray; //newValByteArray.append(QString::number((qint64)value)); //newValByteArray.append(':'); //append(newValByteArray); append(QByteArray().setNum((qint64)value)); return *this; } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CNTUBLE_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CMath.h0000644000175000017500000000314412520551362021405 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CMATH_H #define KONCLUDE_UTILITIES_CMATH_H // Libraries includes // Namespace includes #include "CMemoryReleaser.h" #include "UtilitiesSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { /*! * * \class CMath * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMath { // public methods public: //! Constructor CMath(); //! Destructor virtual ~CMath(); static qint64 log2(qint64 x); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CMATH_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CAllocationObject.h0000644000175000017500000000350512520551362023731 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CALLOCATIONCONTEXT_H #define KONCLUDE_UTILITIES_CALLOCATIONCONTEXT_H // Libraries includes // Namespace includes #include "CMemoryReleaser.h" #include "UtilitiesSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { /*! * * \class CAllocationObject * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAllocationObject { // public methods public: //! Constructor CAllocationObject(); //! Destructor virtual ~CAllocationObject(); void setMemoryReleaser(CMemoryReleaser *memoryReleaser); static void release(CAllocationObject *object); virtual void release(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: CMemoryReleaser *releaser; }; }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CALLOCATIONCONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CSingletonProvider.hpp0000644000175000017500000000446112520551362024534 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CSINGLETONPROVIDER_H #define KONCLUDE_UTILITIES_CSINGLETONPROVIDER_H // Libraries includes #include // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Utilities { /*! * * \class CSingletonProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CSingletonProvider { // public Functions public: //! Constructor CSingletonProvider(); //! Destructor virtual ~CSingletonProvider(); static T *getInstance(); static bool hasInstance(); // private Functions private: // private Variables private: static QMutex *syncMutex; static T *instance; }; template T *CSingletonProvider::instance = 0; template QMutex *CSingletonProvider::syncMutex = new QMutex(); template CSingletonProvider::CSingletonProvider() { } template CSingletonProvider::~CSingletonProvider() { } template T *CSingletonProvider::getInstance() { if (instance == 0) { syncMutex->lock(); if (instance == 0) { instance = new T(); } syncMutex->unlock(); } return instance; } template bool CSingletonProvider::hasInstance() { return instance != 0; } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CSINGLETONPROVIDER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CAllocationLinker.cpp0000644000175000017500000000203012520551362024272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAllocationLinker.h" namespace Konclude { namespace Utilities { CAllocationLinker::CAllocationLinker() { } CAllocationLinker::~CAllocationLinker() { } }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/CMemoryReleaser.h0000644000175000017500000000331712520551362023451 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CMEMORYRELEASEABLE_H #define KONCLUDE_UTILITIES_CMEMORYRELEASEABLE_H // Libraries includes // Namespace includes #include "CAllocationObject.h" #include "UtilitiesSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { /*! * * \class CMemoryReleaser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMemoryReleaser { // public methods public: //! Constructor CMemoryReleaser(); //! Destructor virtual ~CMemoryReleaser(); virtual void release(CAllocationObject *object) = 0; // protected methodsUU protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CMEMORYRELEASEABLE_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CObjectContainer.cpp0000644000175000017500000000407112520551362024120 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectContainer.h" namespace Konclude { namespace Utilities { CObjectContainer::CObjectContainer() { linker = 0; sLinker = 0; allocLinkerMemMan = 0; } CObjectContainer::~CObjectContainer() { clear(); } CObjectContainer *CObjectContainer::addObject(CAllocationLinker *linkerObject) { sLinker = (CAllocationLinker *)linkerObject->insertNext(sLinker); return this; } void CObjectContainer::clear() { while (sLinker) { CAllocationObject::release(sLinker->getData()); CAllocationLinker *tmpLinker = sLinker; sLinker = (CAllocationLinker *)sLinker->getNext(); CAllocationObject::release(tmpLinker); } while (linker) { CAllocationObject::release(linker->getData()); linker = (CAllocationLinker *)linker->getNext(); } delete allocLinkerMemMan; allocLinkerMemMan = 0; } CObjectContainer *CObjectContainer::addObject(CAllocationObject *allocationObject) { if (!allocLinkerMemMan) { allocLinkerMemMan = new CDynamicExpandingMemoryManager(); } CAllocationLinker *linkerObject = allocLinkerMemMan->allocate(); linker = (CAllocationLinker *)linkerObject->init(allocationObject,linker); return this; } }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/CAllocationLinker.h0000644000175000017500000000331012520551362023741 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CALLOCATIONLINKER_H #define KONCLUDE_UTILITIES_CALLOCATIONLINKER_H // Libraries includes // Namespace includes #include "Utilities/CAllocationObject.h" #include "Utilities/CLinker.hpp" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { /*! * * \class CAllocationLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAllocationLinker : public CLinker { // public methods public: //! Constructor CAllocationLinker(); //! Destructor virtual ~CAllocationLinker(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CALLOCATIONLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CAllocationObject.cpp0000644000175000017500000000264612520551362024271 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAllocationObject.h" namespace Konclude { namespace Utilities { CAllocationObject::CAllocationObject() { releaser = 0; } CAllocationObject::~CAllocationObject() { } void CAllocationObject::release(CAllocationObject *object) { if (object) { object->release(); if (object->releaser) { object->releaser->release(object); } else { delete object; } } } void CAllocationObject::setMemoryReleaser(CMemoryReleaser *memoryReleaser) { releaser = memoryReleaser; } void CAllocationObject::release() { } }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/CLinker.hpp0000644000175000017500000000743412520551362022306 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CLINKER_H #define KONCLUDE_UTILITIES_CLINKER_H // Libraries includes #include // Namespace includes #include "CAllocationObject.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { /*! * * \class CLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CLinker : public CAllocationObject { // public methods public: //! Constructor CLinker(); CLinker(T dataElement, CLinker *nextLink = 0); //! Destructor virtual ~CLinker(); CLinker *init(T dataElement, CLinker *nextLink = 0); bool hasNext(); CLinker *insertNext(CLinker *nextLink); CLinker *getNext(); CLinker *setNext(CLinker *nextLink); T getData(); CLinker *setData(T dataElement); CLinker *append(CLinker *appendingList); CLinker *removeNext(); CLinker *getLastListLink(); // protected methods protected: // private methods private: // private variables private: CLinker *next; T data; }; template CLinker::CLinker() { next = 0; } template CLinker::CLinker(T dataElement, CLinker *nextLink) { next = 0; setNext(nextLink); data = dataElement; } template CLinker *CLinker::init(T dataElement, CLinker *nextLink) { next = 0; setNext(nextLink); data = dataElement; return this; } template CLinker::~CLinker() { } template bool CLinker::hasNext() { return next != 0; } template CLinker *CLinker::insertNext(CLinker *nextLink) { if (nextLink) { CLinker *tmpNext = next; next = nextLink; if (tmpNext) { nextLink->append(tmpNext); } } return this; } template CLinker *CLinker::setNext(CLinker *nextLink) { next = nextLink; return this; } template CLinker *CLinker::getNext() { return next; } template T CLinker::getData() { return data; } template CLinker *CLinker::setData(T dataElement) { data = dataElement; return this; } template CLinker *CLinker::append(CLinker *appendingList) { CLinker *last = getLastListLink(); last->insertNext(appendingList); return this; } template CLinker *CLinker::removeNext() { CLinker *tmpNext = next; if (next) { CLinker *tmpNextNext = next->next; next->next = 0; setNext(tmpNextNext); } return tmpNext; } template CLinker *CLinker::getLastListLink() { CLinker *lastListLink = this; while (lastListLink->hasNext()) { lastListLink = lastListLink->getNext(); } return lastListLink; } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/0000755000175000017500000000000012613407262021510 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryPool.h0000644000175000017500000000460512520551360024067 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOL_H #define KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOL_H // Library includes // Namespace includes #include "MemorySettings.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { using namespace Container; namespace Memory { /*! * * \class CMemoryPool * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMemoryPool : public CLinkerBase { // public methods public: //! Constructor CMemoryPool(); //! Destructor virtual ~CMemoryPool(); char* getMemoryBlockData(); cint64 getMemoryBlockSize(); char* getMemoryBlockPointer(); char* getMemoryBlockEnd(); CMemoryPool* setMemoryBlockData(char* memoryBlock, cint64 memoryBlockSize); CMemoryPool* setMemoryBlockPointer(char* memoryBlockPointer); CMemoryPool* incMemoryBlockPointer(cint64 pointerInc); CMemoryPool* resetMemoryBlockPointer(); CMemoryPool* getNextMemoryPool(); CMemoryPool* setNextMemoryPool(CMemoryPool* nextMemoryPool); // protected methods protected: // protected variables protected: char* mMemoryBlockBegin; char* mMemoryBlockEnd; cint64 mMemoryBlockSize; char* mMemoryBlockPointer; // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOL_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CAllocationLimitator.cpp0000644000175000017500000000213512520551356026273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAllocationLimitator.h" namespace Konclude { namespace Utilities { namespace Memory { CAllocationLimitator::CAllocationLimitator() { } CAllocationLimitator::~CAllocationLimitator() { } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CObjectMemoryPoolAllocator.cpp0000644000175000017500000000226612520551362027415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_COBJECTMEMORYPOOLALLOCATOR_CPP #define KONCLUDE_UTILITIES_MEMORY_COBJECTMEMORYPOOLALLOCATOR_CPP #include "CObjectMemoryPoolAllocator.h" namespace Konclude { namespace Utilities { namespace Memory { }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_COBJECTMEMORYPOOLALLOCATOR_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryPool.cpp0000644000175000017500000000473612520551360024427 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMemoryPool.h" namespace Konclude { namespace Utilities { namespace Memory { CMemoryPool::CMemoryPool() : CLinkerBase(this,nullptr) { mMemoryBlockBegin = 0; mMemoryBlockSize = 0; mMemoryBlockPointer = 0; } CMemoryPool::~CMemoryPool() { } char* CMemoryPool::getMemoryBlockData() { return mMemoryBlockBegin; } cint64 CMemoryPool::getMemoryBlockSize() { return mMemoryBlockSize; } char* CMemoryPool::getMemoryBlockPointer() { return mMemoryBlockPointer; } char* CMemoryPool::getMemoryBlockEnd() { return mMemoryBlockEnd; } CMemoryPool* CMemoryPool::setMemoryBlockData(char* memoryBlock, cint64 memoryBlockSize) { mMemoryBlockBegin = memoryBlock; mMemoryBlockSize = memoryBlockSize; mMemoryBlockEnd = mMemoryBlockBegin + mMemoryBlockSize; mMemoryBlockPointer = mMemoryBlockBegin; return this; } CMemoryPool* CMemoryPool::setMemoryBlockPointer(char* memoryBlockPointer) { mMemoryBlockPointer = memoryBlockPointer; return this; } CMemoryPool* CMemoryPool::incMemoryBlockPointer(cint64 pointerInc) { mMemoryBlockPointer = (char*)((cint64)mMemoryBlockPointer + pointerInc); return this; } CMemoryPool* CMemoryPool::resetMemoryBlockPointer() { mMemoryBlockPointer = mMemoryBlockBegin; return this; } CMemoryPool* CMemoryPool::getNextMemoryPool() { return getNext(); } CMemoryPool* CMemoryPool::setNextMemoryPool(CMemoryPool* nextMemoryPool) { CLinkerBase::setNext(nextMemoryPool); return this; } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryPoolContainerAllocationManager.h0000644000175000017500000000536712520551360031241 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOLCONTAINERALLOCATIONMANAGER_H #define KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOLCONTAINERALLOCATIONMANAGER_H // Libraries includes // Namespace includes #include "MemorySettings.h" #include "CMemoryAllocationManager.h" // Other includes #include "Utilities/Memory/CMemoryPoolContainer.h" #include "Utilities/Memory/CMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CMemoryPoolContainerAllocationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMemoryPoolContainerAllocationManager : public CMemoryAllocationManager { // public methods public: //! Constructor CMemoryPoolContainerAllocationManager(CMemoryPoolContainer* memoryPoolContainer, CMemoryPoolProvider* memoryPoolProvider); //! Destructor virtual ~CMemoryPoolContainerAllocationManager(); virtual CMemoryAllocationManager* release(void* address); virtual void* allocate(size_t size); virtual void* allocateAligned(size_t size, int alignment); virtual cint64 getOptimizedMoreAllocationSize(cint64 size); static void* allocateMemoryToContainer(size_t size, CMemoryPoolContainer* memoryPoolContainer, CMemoryPoolProvider* memoryPoolProvider); // protected methods protected: char* getMemoryBlock(cint64 memoryBlockSize); char* getMemoryBlock(cint64 memoryBlockSize, cint64 alignment); // protected variables protected: CMemoryPoolProvider* mMemoryPoolProvider; CMemoryPoolContainer* mMemoryPoolContainer; cint64 mStatPoolAllocCount; cint64 mStatAllocPoolSize; // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOLCONTAINERALLOCATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CObjectAllocator.h0000644000175000017500000001236612520551362025041 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_COBJECTALLOCATOR_H #define KONCLUDE_UTILITIES_MEMORY_COBJECTALLOCATOR_H // Library includes // Namespace includes #include "MemorySettings.h" #include "CMemoryAllocationManager.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace std; namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CObjectAllocator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CObjectAllocator { // public methods public: //! Constructor CObjectAllocator() { } //! Destructor virtual ~CObjectAllocator() { } static inline T* allocateAndConstruct(CMemoryAllocationManager* memoryAllocatorManager) { T* object = 0; if (memoryAllocatorManager) { void* memAddr = memoryAllocatorManager->allocate(sizeof(T)); object = (T*)memAddr; new (object) T(); } else { object = new T(); } return object; } static inline T* allocate(CMemoryAllocationManager* memoryAllocatorManager) { T* object = 0; if (memoryAllocatorManager) { void* memAddr = memoryAllocatorManager->allocate(sizeof(T)); object = (T*)memAddr; } else { object = new T(); } return object; } static inline T* allocateMemory(CMemoryAllocationManager* memoryAllocatorManager) { T* object = 0; if (memoryAllocatorManager) { void* memAddr = memoryAllocatorManager->allocate(sizeof(T)); object = (T*)memAddr; } else { object = new T(); } return object; } static inline T* allocateAndConstructArray(CMemoryAllocationManager* memoryAllocatorManager, cint arrayCount) { T* objectArray = 0; if (memoryAllocatorManager) { void* memAddr = memoryAllocatorManager->allocate(sizeof(T)*arrayCount); objectArray = (T*)memAddr; T* nextObject = objectArray; for (cint idx = 0; idx < arrayCount; ++idx) { new (nextObject) T(); nextObject += 1; } } else { objectArray = new T[arrayCount]; T* nextObject = objectArray; for (cint idx = 0; idx < arrayCount; ++idx) { new (nextObject) T(); nextObject += 1; } } return objectArray; } static inline T* allocateArray(CMemoryAllocationManager* memoryAllocatorManager, cint arrayCount) { T* objectArray = 0; if (memoryAllocatorManager) { void* memAddr = memoryAllocatorManager->allocate(sizeof(T)*arrayCount); objectArray = (T*)memAddr; } else { objectArray = new T[arrayCount]; } return objectArray; } static inline void release(T* object, CMemoryAllocationManager* memoryAllocatorManager) { if (object) { if (memoryAllocatorManager) { memoryAllocatorManager->release(object); } else { ::operator delete (object); } } } static inline void destroyAndRelease(T* object, CMemoryAllocationManager* memoryAllocatorManager) { if (object) { if (memoryAllocatorManager) { object->T::~T(); memoryAllocatorManager->release(object); } else { object->~T(); ::operator delete (object); } } } static inline void destroyAndReleaseArray(T* object, CMemoryAllocationManager* memoryAllocatorManager) { // TODO: destroy object in array somehow if (object) { if (memoryAllocatorManager) { memoryAllocatorManager->release(object); } else { ::operator delete [] (object); } } } static inline void releaseArray(T* object, CMemoryAllocationManager* memoryAllocatorManager) { if (object) { if (memoryAllocatorManager) { memoryAllocatorManager->release(object); } else { ::operator delete [] (object); } } } // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; template inline void COADestroyAndRelease(T* object, CMemoryAllocationManager* memoryAllocatorManager) { CObjectAllocator::destroyAndRelease(object,memoryAllocatorManager); } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #include "CObjectAllocator.cpp" #endif // KONCLUDE_UTILITIES_MEMORY_COBJECTALLOCATOR_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryPoolAllocationManager.h0000644000175000017500000000574112520551360027372 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOLALLOCATIONMANAGER_H #define KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOLALLOCATIONMANAGER_H // Library includes // Namespace includes #include "MemorySettings.h" #include "CMemoryPoolProvider.h" #include "CMemoryPoolContainer.h" #include "CMemoryTemporaryAllocationManager.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CMemoryPoolAllocationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMemoryPoolAllocationManager : public CMemoryTemporaryAllocationManager { // public methods public: //! Constructor CMemoryPoolAllocationManager(CMemoryPoolProvider* memoryPoolProvider); //! Destructor virtual ~CMemoryPoolAllocationManager(); virtual void* allocate(size_t size); virtual CMemoryAllocationManager* release(void* address); virtual void* allocateAligned(size_t size, int alignment); virtual CMemoryTemporaryAllocationManager* releaseAllMemory(); virtual CMemoryPool* acqireTemporaryMemoryPool(size_t size); virtual CMemoryTemporaryAllocationManager* releaseTemporaryMemoryPool(CMemoryPool* memoryPool); virtual cint64 getOptimizedMoreAllocationSize(cint64 size); virtual CMemoryTemporaryAllocationManager* releaseMemoryPoolContainer(CMemoryPoolContainer* memoryPoolContainer); virtual cint64 getFreeMemoryPoolCount(); // protected methods protected: char* getMemoryBlock(cint64 memoryBlockSize); char* getMemoryBlock(cint64 memoryBlockSize, cint64 alignment); // protected variables protected: CMemoryPoolProvider* mMemoryPoolProvider; CMemoryPool* mFreeMemoryPoolList; CMemoryPool* mUsedMemoryPoolList; CMemoryPool* mUsingMemoryPool; cint64 mFreeMemoryPoolCount; cint64 mStatMemToUsingCount; cint64 mStatMemToFreeCount; // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOLALLOCATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryPoolContainer.cpp0000644000175000017500000000313712520551360026264 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMemoryPoolContainer.h" namespace Konclude { namespace Utilities { namespace Memory { CMemoryPoolContainer::CMemoryPoolContainer(CMemoryPool* memoryPool) { mMemoryPool = memoryPool; } CMemoryPoolContainer::~CMemoryPoolContainer() { } CMemoryPoolContainer* CMemoryPoolContainer::appendMemoryPool(CMemoryPool* memoryPool) { memoryPool->getLastListLink()->setNextMemoryPool(mMemoryPool); mMemoryPool = memoryPool; return this; } CMemoryPool* CMemoryPoolContainer::getMemoryPools() { return mMemoryPool; } CMemoryPool* CMemoryPoolContainer::takeMemoryPools() { CMemoryPool* tmpMemoryPool = mMemoryPool; mMemoryPool = nullptr; return tmpMemoryPool; } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryAllocationManager.h0000644000175000017500000000404312520551360026532 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CMEMORYALLOCATIONMANAGER_H #define KONCLUDE_UTILITIES_MEMORY_CMEMORYALLOCATIONMANAGER_H // Library includes // Namespace includes #include "MemorySettings.h" // Other includes #include // Logger includes #include "Logger/CLogger.h" using namespace std; namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CMemoryAllocationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMemoryAllocationManager { // public methods public: //! Constructor CMemoryAllocationManager(); //! Destructor virtual ~CMemoryAllocationManager(); virtual void* allocate(size_t size) = 0; virtual CMemoryAllocationManager* release(void* address) = 0; virtual void* allocateAligned(size_t size, int alignment) = 0; virtual cint64 getOptimizedMoreAllocationSize(cint64 size); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CMEMORYALLOCATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryTemporaryAllocationManager.h0000644000175000017500000000516112520551360030437 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CMEMORYTEMPORARYALLOCATIONMANAGER_H #define KONCLUDE_UTILITIES_MEMORY_CMEMORYTEMPORARYALLOCATIONMANAGER_H // Library includes // Namespace includes #include "MemorySettings.h" #include "CMemoryPool.h" #include "CMemoryAllocationManager.h" #include "CMemoryPoolProvider.h" #include "CMemoryPoolContainer.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CMemoryTemporaryAllocationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMemoryTemporaryAllocationManager : virtual public CMemoryAllocationManager, virtual public CMemoryPoolProvider { // public methods public: //! Constructor CMemoryTemporaryAllocationManager(); //! Destructor virtual ~CMemoryTemporaryAllocationManager(); virtual CMemoryAllocationManager* releaseAllMemory() = 0; virtual CMemoryPool* acqireTemporaryMemoryPool(size_t size) = 0; virtual CMemoryTemporaryAllocationManager* releaseTemporaryMemoryPool(CMemoryPool* memoryPool) = 0; virtual CMemoryTemporaryAllocationManager* releaseMemoryPoolContainer(CMemoryPoolContainer* memoryPoolContainer) = 0; virtual CMemoryTemporaryAllocationManager* releaseTemporaryMemoryPools(CMemoryPool* memoryPools); virtual CMemoryPool* acquireMemoryPool(cint64 minPoolSize); virtual CMemoryPoolProvider* releaseMemoryPool(CMemoryPool* memoryPool); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CMEMORYTEMPORARYALLOCATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/MemorySettings.h0000644000175000017500000000310212520551362024644 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_MEMORYSETTINGS #define KONCLUDE_UTILITIES_MEMORY_MEMORYSETTINGS // Library includes // Namespace includes // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes namespace Konclude { namespace Utilities { namespace Memory { /*! * * \file MemorySettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations // Konclude code configs const static cint64 DEFAULTMEMORYPOOLSIZE = 20000; #ifdef KONCLUDE_FORCE_STATISTIC_DEACTIVATED #define KONCLUDE_FORCE_MEMORY_STATISTIC_DEACTIVATED #endif }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // end KONCLUDE_UTILITIES_MEMORY_MEMORYSETTINGS././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CCentralizedAllocationConfigProvidedDependendLimitation.hKonclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CCentralizedAllocationConfigProvidedDependend0000644000175000017500000000615212520551356032447 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CCENTRALIZEDALLOCATIONCONFIGPROVIDEDDEPENDENDLIMITATION_H #define KONCLUDE_UTILITIES_MEMORY_CCENTRALIZEDALLOCATIONCONFIGPROVIDEDDEPENDENDLIMITATION_H // Library includes #include #include #include #include // Namespace includes #include "MemorySettings.h" #include "CCentralizedAllocationLimitation.h" #include "CCentralizedAllocationLimitator.h" // Other includes #include "Config/CConfigurationProvider.h" #include "Config/CConfigDataReader.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Config; namespace Utilities { namespace Memory { /*! * * \class CCentralizedAllocationConfigProvidedDependendLimitation * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCentralizedAllocationConfigProvidedDependendLimitation : public CCentralizedAllocationLimitation { // public methods public: //! Constructor CCentralizedAllocationConfigProvidedDependendLimitation(CConfigurationProvider* configProvider, const QString& configString); //! Destructor virtual ~CCentralizedAllocationConfigProvidedDependendLimitation(); CCentralizedAllocationLimitator* getLimitator(); virtual cint64 getUpdatedMemoryAllocationLimit(CAllocationLimitator* limitator); virtual cint64 getAllocatedMemorySize(); virtual cint64 getAllocatedMemorySizeMaximum(); virtual cint64 getReservedMemorySizeMaximum(); // protected methods protected: bool updateMaxMemoryAllocationSize(); bool requestLimitatorMemoryAllocationSizeUpdate(); // protected variables protected: CConfigurationProvider* mConfigProvider; QString mConfigString; bool mMemAllocLimited; cint64 mMaxMemAllocSize; cint64 mAddMemAllocSize; cint64 mCurrMemAllocSize; cint64 mCriticalMemAllocSize; CConfiguration* mLastConfig; QMutex mSyncMutex; CCentralizedAllocationLimitator* mLimitatorLinker; cint64 mStatMaxAllocatedMemSize; // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CCENTRALIZEDALLOCATIONCONFIGPROVIDEDDEPENDENDLIMITATION_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryPoolContainerAllocationManager.cpp0000644000175000017500000001367112520551360031571 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMemoryPoolContainerAllocationManager.h" namespace Konclude { namespace Utilities { namespace Memory { CMemoryPoolContainerAllocationManager::CMemoryPoolContainerAllocationManager(CMemoryPoolContainer* memoryPoolContainer, CMemoryPoolProvider* memoryPoolProvider) { mMemoryPoolContainer = memoryPoolContainer; mMemoryPoolProvider = memoryPoolProvider; mStatPoolAllocCount = 0; mStatAllocPoolSize = 0; } CMemoryPoolContainerAllocationManager::~CMemoryPoolContainerAllocationManager() { } void* CMemoryPoolContainerAllocationManager::allocate(size_t size) { void* memPtr = 0; char* memBlock = 0; if (size >= 8) { memBlock = getMemoryBlock(size*sizeof(char),8); } else if (size >= 4) { memBlock = getMemoryBlock(size*sizeof(char),4); } else if (size >= 2) { memBlock = getMemoryBlock(size*sizeof(char),2); } else { memBlock = getMemoryBlock(size*sizeof(char)); } memPtr = memBlock; return memPtr; } CMemoryAllocationManager* CMemoryPoolContainerAllocationManager::release(void* address) { // not supported by this pool memory manager, stored all memory in memory pool container return this; } void* CMemoryPoolContainerAllocationManager::allocateAligned(size_t size, int alignment) { void* memPtr = 0; char* memBlock = getMemoryBlock(size*sizeof(char),alignment); memPtr = memBlock; return memPtr; } char* CMemoryPoolContainerAllocationManager::getMemoryBlock(cint64 memoryBlockSize) { char* memBlock = 0; bool allocated = false; CMemoryPool* memoryPool = mMemoryPoolContainer->getMemoryPools(); while (!allocated) { if (!memoryPool) { memoryPool = mMemoryPoolProvider->acquireMemoryPool(memoryBlockSize); ++mStatPoolAllocCount; if (memoryPool) { mStatAllocPoolSize += memoryPool->getMemoryBlockSize(); mMemoryPoolContainer->appendMemoryPool(memoryPool); } } if (memoryPool) { char* memBlockEnd = memoryPool->getMemoryBlockEnd(); char* memBlockPointer = memoryPool->getMemoryBlockPointer(); if (memBlockPointer+memoryBlockSize <= memBlockEnd) { memBlock = memBlockPointer; memoryPool->setMemoryBlockPointer(memBlockPointer+memoryBlockSize); allocated = true; } else { memoryPool = nullptr; } } } return memBlock; } cint64 CMemoryPoolContainerAllocationManager::getOptimizedMoreAllocationSize(cint64 size) { CMemoryPool* memoryPool = mMemoryPoolContainer->getMemoryPools(); if (memoryPool) { cint64 availableSizeThisPool = memoryPool->getMemoryBlockEnd() - memoryPool->getMemoryBlockData(); if (availableSizeThisPool >= size) { return qMax(availableSizeThisPool,size<<2); } else if (memoryPool->getMemoryBlockSize() >= size) { return qMax(memoryPool->getMemoryBlockSize(),size<<2); } } return size; } char* CMemoryPoolContainerAllocationManager::getMemoryBlock(cint64 memoryBlockSize, cint64 alignment) { char* memBlock = 0; bool allocated = false; CMemoryPool* memoryPool = mMemoryPoolContainer->getMemoryPools(); while (!allocated) { if (!memoryPool) { memoryPool = mMemoryPoolProvider->acquireMemoryPool(memoryBlockSize+alignment); ++mStatPoolAllocCount; if (memoryPool) { mStatAllocPoolSize += memoryPool->getMemoryBlockSize(); mMemoryPoolContainer->appendMemoryPool(memoryPool); } } if (memoryPool) { char* memBlockEnd = memoryPool->getMemoryBlockEnd(); char* memBlockPointer = memoryPool->getMemoryBlockPointer(); cint64 maxBlockAlloc = (cint64)(memBlockPointer)+(cint64)(memoryBlockSize+alignment); if (maxBlockAlloc <= (cint64)memBlockEnd) { // alignment is 2^N cint64 alignmentMask = alignment-1; memBlock = memBlockPointer; if (alignmentMask & cint64(memBlock)) { memBlock = (char*)((cint64(memBlock) & ~alignmentMask) + alignment); } memoryPool->setMemoryBlockPointer(memBlock+memoryBlockSize); allocated = true; } else { memoryPool = nullptr; } } } return memBlock; } void* CMemoryPoolContainerAllocationManager::allocateMemoryToContainer(size_t size, CMemoryPoolContainer* memoryPoolContainer, CMemoryPoolProvider* memoryPoolProvider) { cint64 memoryBlockSize = size; char* memBlock = 0; bool allocated = false; CMemoryPool* memoryPool = memoryPoolContainer->getMemoryPools(); while (!allocated) { if (!memoryPool) { memoryPool = memoryPoolProvider->acquireMemoryPool(memoryBlockSize); memoryPoolContainer->appendMemoryPool(memoryPool); } if (memoryPool) { char* memBlockEnd = memoryPool->getMemoryBlockEnd(); char* memBlockPointer = memoryPool->getMemoryBlockPointer(); if (memBlockPointer+memoryBlockSize <= memBlockEnd) { memBlock = memBlockPointer; memoryPool->setMemoryBlockPointer(memBlockPointer+memoryBlockSize); allocated = true; } else { memoryPool = nullptr; } } } return memBlock; } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CObjectAllocator.cpp0000644000175000017500000000221612520551362025365 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_COBJECTALLOCATOR_CPP #define KONCLUDE_UTILITIES_MEMORY_COBJECTALLOCATOR_CPP #include "CObjectAllocator.h" namespace Konclude { namespace Utilities { namespace Memory { }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_COBJECTALLOCATOR_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryPoolProvider.cpp0000644000175000017500000000213012520551360026124 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMemoryPoolProvider.h" namespace Konclude { namespace Utilities { namespace Memory { CMemoryPoolProvider::CMemoryPoolProvider() { } CMemoryPoolProvider::~CMemoryPoolProvider() { } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryAllocationException.cpp0000644000175000017500000000206612520551360027454 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMemoryAllocationException.h" namespace Konclude { namespace Utilities { namespace Memory { CMemoryAllocationException::CMemoryAllocationException() { } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CCentralizedAllocationLimitator.h0000644000175000017500000000524012520551360030120 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CCENTRALIZEDALLOCATIONLIMITATOR_H #define KONCLUDE_UTILITIES_MEMORY_CCENTRALIZEDALLOCATIONLIMITATOR_H // Library includes #include // Namespace includes #include "MemorySettings.h" #include "CAllocationLimitator.h" #include "CCentralizedAllocationLimitation.h" // Other includes #include "Utilities/Container/CLinker.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { using namespace Container; namespace Memory { /*! * * \class CCentralizedAllocationLimitator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCentralizedAllocationLimitator : public CAllocationLimitator, public CLinkerBase { // public methods public: //! Constructor CCentralizedAllocationLimitator(CCentralizedAllocationLimitation* limitation); //! Destructor virtual ~CCentralizedAllocationLimitator(); virtual cint64 getMemoryAllocatedSize(); virtual cint64 getMaximumMemoryAllocationSize(); virtual cint64 getRemainingMemoryAllocationSize(); virtual bool addAllocatingMemorySize(cint64 allocatedMemorySize); virtual CCentralizedAllocationLimitator* addReleasedMemorySize(cint64 allocatedMemorySize); virtual CCentralizedAllocationLimitator* notifyRequireUpdateLimit(); // protected methods protected: // protected variables protected: bool mReqUpdateFlag; cint64 mMemAllocated; cint64 mMaxMemAllocSize; CCentralizedAllocationLimitation* mAllocLimitation; // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CCENTRALIZEDALLOCATIONLIMITATOR_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CObjectParameterizingAllocator.cpp0000644000175000017500000000230612520551362030267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_COBJECTPARAMETERIZINGALLOCATOR_CPP #define KONCLUDE_UTILITIES_MEMORY_COBJECTPARAMETERIZINGALLOCATOR_CPP #include "CObjectParameterizingAllocator.h" namespace Konclude { namespace Utilities { namespace Memory { }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_COBJECTPARAMETERIZINGALLOCATOR_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.h0000644000175000017500000000433512520551360032234 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CLIMITEDRESERVEMEMORYPOOLALLOCATIONMANAGER_H #define KONCLUDE_UTILITIES_MEMORY_CLIMITEDRESERVEMEMORYPOOLALLOCATIONMANAGER_H // Library includes // Namespace includes #include "MemorySettings.h" #include "CMemoryPoolAllocationManager.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CLimitedReserveMemoryPoolAllocationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CLimitedReserveMemoryPoolAllocationManager : public CMemoryPoolAllocationManager { // public methods public: //! Constructor CLimitedReserveMemoryPoolAllocationManager(CMemoryPoolProvider* memoryPoolProvider, cint64 freeReserveLimit = 20, cint64 freeReleaseBlockSize = 5); //! Destructor virtual ~CLimitedReserveMemoryPoolAllocationManager(); virtual CMemoryTemporaryAllocationManager* releaseTemporaryMemoryPool(CMemoryPool* memoryPool); // protected methods protected: // protected variables protected: cint64 mFreeReserveLimit; cint64 mFreeReleaseBlockSize; // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CLIMITEDRESERVEMEMORYPOOLALLOCATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CCentralizedAllocationLimitator.cpp0000644000175000017500000000560712520551360030462 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCentralizedAllocationLimitator.h" namespace Konclude { namespace Utilities { namespace Memory { CCentralizedAllocationLimitator::CCentralizedAllocationLimitator(CCentralizedAllocationLimitation* limitation) : CLinkerBase(this) { mMaxMemAllocSize = 0; mMemAllocated = 0; mReqUpdateFlag = true; mAllocLimitation = limitation; } CCentralizedAllocationLimitator::~CCentralizedAllocationLimitator() { } cint64 CCentralizedAllocationLimitator::getRemainingMemoryAllocationSize() { return mMaxMemAllocSize-mMemAllocated; } cint64 CCentralizedAllocationLimitator::getMaximumMemoryAllocationSize() { return mMaxMemAllocSize; } cint64 CCentralizedAllocationLimitator::getMemoryAllocatedSize() { return mMemAllocated; } bool CCentralizedAllocationLimitator::addAllocatingMemorySize(cint64 allocatedMemorySize) { if (mReqUpdateFlag) { mReqUpdateFlag = false; mMaxMemAllocSize = mAllocLimitation->getUpdatedMemoryAllocationLimit(this); } if (getRemainingMemoryAllocationSize() >= allocatedMemorySize) { mMemAllocated += allocatedMemorySize; return true; } else { while (allocatedMemorySize > 0) { mMaxMemAllocSize = mAllocLimitation->getUpdatedMemoryAllocationLimit(this); if (getRemainingMemoryAllocationSize() >= allocatedMemorySize) { mMemAllocated += allocatedMemorySize; return true; } else { cint64 tmpMemAllocSize = getRemainingMemoryAllocationSize(); mMemAllocated += tmpMemAllocSize; allocatedMemorySize -= tmpMemAllocSize; } } } return false; } CCentralizedAllocationLimitator* CCentralizedAllocationLimitator::addReleasedMemorySize(cint64 allocatedMemorySize) { mMemAllocated -= allocatedMemorySize; return this; } CCentralizedAllocationLimitator* CCentralizedAllocationLimitator::notifyRequireUpdateLimit() { mReqUpdateFlag = true; return this; } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CCentralizedAllocationLimitation.h0000644000175000017500000000415712520551360030273 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CCENTRALIZEDALLOCATIONLIMITATION_H #define KONCLUDE_UTILITIES_MEMORY_CCENTRALIZEDALLOCATIONLIMITATION_H // Library includes #include // Namespace includes #include "MemorySettings.h" #include "CAllocationLimitator.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CCentralizedAllocationLimitation * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CCentralizedAllocationLimitation { // public methods public: //! Constructor CCentralizedAllocationLimitation(); //! Destructor virtual ~CCentralizedAllocationLimitation(); virtual cint64 getUpdatedMemoryAllocationLimit(CAllocationLimitator* limitator) = 0; virtual cint64 getAllocatedMemorySize() = 0; virtual cint64 getAllocatedMemorySizeMaximum() = 0; virtual cint64 getReservedMemorySizeMaximum() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CCENTRALIZEDALLOCATIONLIMITATION_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CAllocationLimitationProvider.h0000644000175000017500000000347312520551356027626 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CALLOCATIONLIMITATIONPROVIDER_H #define KONCLUDE_UTILITIES_MEMORY_CALLOCATIONLIMITATIONPROVIDER_H // Library includes #include // Namespace includes #include "MemorySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CAllocationLimitationProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAllocationLimitationProvider { // public methods public: //! Constructor CAllocationLimitationProvider(); //! Destructor virtual ~CAllocationLimitationProvider(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CALLOCATIONLIMITATIONPROVIDER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CNewAllocationMemoryPoolProvider.h0000644000175000017500000000501112520551360030252 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CNEWALLOCATIONMEMORYPOOLPROVIDER_H #define KONCLUDE_UTILITIES_MEMORY_CNEWALLOCATIONMEMORYPOOLPROVIDER_H // Library includes #include // Namespace includes #include "MemorySettings.h" #include "CConsiderateMemoryPoolProvider.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CNewAllocationMemoryPoolProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNewAllocationMemoryPoolProvider : public CConsiderateMemoryPoolProvider { // public methods public: //! Constructor CNewAllocationMemoryPoolProvider(cint64 defaultPoolSize = DEFAULTMEMORYPOOLSIZE); //! Destructor virtual ~CNewAllocationMemoryPoolProvider(); virtual CMemoryPool* acquireMemoryPool(cint64 minPoolSize); virtual CMemoryPoolProvider* releaseMemoryPool(CMemoryPool* memoryPool); virtual CMemoryPool* acquireMemoryPoolConsiderated(cint64 minPoolSize); cint64 getAllocatedReleaseDifferencePoolCount(); cint64 getAllocatedReleaseDifferencePoolSize(); // protected methods protected: // protected variables protected: cint64 mDefaultPoolSize; cint64 mStatAllocatedPoolSize; cint64 mStatAllocatedPoolCount; cint64 mStatReleasedPoolSize; cint64 mStatReleasedPoolCount; cint64 mStatDiffPoolSize; cint64 mStatDiffPoolCount; // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CNEWALLOCATIONMEMORYPOOLPROVIDER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CTempMemoryPoolContainerAllocationManager.cpp0000644000175000017500000001604012520551362032412 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTempMemoryPoolContainerAllocationManager.h" namespace Konclude { namespace Utilities { namespace Memory { CTempMemoryPoolContainerAllocationManager::CTempMemoryPoolContainerAllocationManager(CMemoryPoolContainer* memoryPoolContainer, CMemoryPoolProvider* memoryPoolProvider) { initTempMemoryPoolContainerAllocationManager(memoryPoolContainer,memoryPoolProvider); } CTempMemoryPoolContainerAllocationManager::CTempMemoryPoolContainerAllocationManager(CMemoryPoolProvider* memoryPoolProvider) { initTempMemoryPoolContainerAllocationManager(nullptr,memoryPoolProvider); } CTempMemoryPoolContainerAllocationManager::CTempMemoryPoolContainerAllocationManager() { initTempMemoryPoolContainerAllocationManager(nullptr,nullptr); } CTempMemoryPoolContainerAllocationManager::~CTempMemoryPoolContainerAllocationManager() { } CMemoryPool* CTempMemoryPoolContainerAllocationManager::getMemoryPools() { return mMemoryPoolContainer->getMemoryPools(); } CMemoryPool* CTempMemoryPoolContainerAllocationManager::takeMemoryPools() { return mMemoryPoolContainer->takeMemoryPools(); } CTempMemoryPoolContainerAllocationManager* CTempMemoryPoolContainerAllocationManager::initTempMemoryPoolContainerAllocationManager(CMemoryPoolContainer* memoryPoolContainer, CMemoryPoolProvider* memoryPoolProvider) { mMemoryPoolContainer = memoryPoolContainer; mMemoryPoolProvider = memoryPoolProvider; mStatPoolAllocCount = 0; mStatAllocPoolSize = 0; if (!mMemoryPoolContainer) { mMemoryPoolContainer = &mTmpMemoryPoolContainer; } return this; } void* CTempMemoryPoolContainerAllocationManager::allocate(size_t size) { void* memPtr = 0; char* memBlock = 0; if (size >= 8) { memBlock = getMemoryBlock(size*sizeof(char),8); } else if (size >= 4) { memBlock = getMemoryBlock(size*sizeof(char),4); } else if (size >= 2) { memBlock = getMemoryBlock(size*sizeof(char),2); } else { memBlock = getMemoryBlock(size*sizeof(char)); } memPtr = memBlock; return memPtr; } CMemoryAllocationManager* CTempMemoryPoolContainerAllocationManager::release(void* address) { // not supported by this pool memory manager, stored all memory in memory pool container return this; } void* CTempMemoryPoolContainerAllocationManager::allocateAligned(size_t size, int alignment) { void* memPtr = 0; char* memBlock = getMemoryBlock(size*sizeof(char),alignment); memPtr = memBlock; return memPtr; } char* CTempMemoryPoolContainerAllocationManager::getMemoryBlock(cint64 memoryBlockSize) { char* memBlock = 0; bool allocated = false; CMemoryPool* memoryPool = mMemoryPoolContainer->getMemoryPools(); while (!allocated) { if (!memoryPool) { memoryPool = mMemoryPoolProvider->acquireMemoryPool(memoryBlockSize); ++mStatPoolAllocCount; if (memoryPool) { mStatAllocPoolSize += memoryPool->getMemoryBlockSize(); mMemoryPoolContainer->appendMemoryPool(memoryPool); } } if (memoryPool) { char* memBlockEnd = memoryPool->getMemoryBlockEnd(); char* memBlockPointer = memoryPool->getMemoryBlockPointer(); if (memBlockPointer+memoryBlockSize <= memBlockEnd) { memBlock = memBlockPointer; memoryPool->setMemoryBlockPointer(memBlockPointer+memoryBlockSize); allocated = true; } else { memoryPool = nullptr; } } } return memBlock; } cint64 CTempMemoryPoolContainerAllocationManager::getOptimizedMoreAllocationSize(cint64 size) { CMemoryPool* memoryPool = mMemoryPoolContainer->getMemoryPools(); if (memoryPool) { cint64 availableSizeThisPool = memoryPool->getMemoryBlockEnd() - memoryPool->getMemoryBlockData(); if (availableSizeThisPool >= size) { return qMax(availableSizeThisPool,size<<2); } else if (memoryPool->getMemoryBlockSize() >= size) { return qMax(memoryPool->getMemoryBlockSize(),size<<2); } } return size; } char* CTempMemoryPoolContainerAllocationManager::getMemoryBlock(cint64 memoryBlockSize, cint64 alignment) { char* memBlock = 0; bool allocated = false; CMemoryPool* memoryPool = mMemoryPoolContainer->getMemoryPools(); while (!allocated) { if (!memoryPool) { memoryPool = mMemoryPoolProvider->acquireMemoryPool(memoryBlockSize+alignment); ++mStatPoolAllocCount; if (memoryPool) { mStatAllocPoolSize += memoryPool->getMemoryBlockSize(); mMemoryPoolContainer->appendMemoryPool(memoryPool); } } if (memoryPool) { char* memBlockEnd = memoryPool->getMemoryBlockEnd(); char* memBlockPointer = memoryPool->getMemoryBlockPointer(); cint64 maxBlockAlloc = (cint64)(memBlockPointer)+(cint64)(memoryBlockSize+alignment); if (maxBlockAlloc <= (cint64)memBlockEnd) { // alignment is 2^N cint64 alignmentMask = alignment-1; memBlock = memBlockPointer; if (alignmentMask & cint64(memBlock)) { memBlock = (char*)((cint64(memBlock) & ~alignmentMask) + alignment); } memoryPool->setMemoryBlockPointer(memBlock+memoryBlockSize); allocated = true; } else { memoryPool = nullptr; } } } return memBlock; } void* CTempMemoryPoolContainerAllocationManager::allocateMemoryToContainer(size_t size, CMemoryPoolContainer* memoryPoolContainer, CMemoryPoolProvider* memoryPoolProvider) { cint64 memoryBlockSize = size; char* memBlock = 0; bool allocated = false; CMemoryPool* memoryPool = memoryPoolContainer->getMemoryPools(); while (!allocated) { if (!memoryPool) { memoryPool = memoryPoolProvider->acquireMemoryPool(memoryBlockSize); memoryPoolContainer->appendMemoryPool(memoryPool); } if (memoryPool) { char* memBlockEnd = memoryPool->getMemoryBlockEnd(); char* memBlockPointer = memoryPool->getMemoryBlockPointer(); if (memBlockPointer+memoryBlockSize <= memBlockEnd) { memBlock = memBlockPointer; memoryPool->setMemoryBlockPointer(memBlockPointer+memoryBlockSize); allocated = true; } else { memoryPool = nullptr; } } } return memBlock; } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CObjectMemoryPoolAllocator.h0000644000175000017500000000605112520551362027056 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_COBJECTMEMORYPOOLALLOCATOR_H #define KONCLUDE_UTILITIES_MEMORY_COBJECTMEMORYPOOLALLOCATOR_H // Library includes // Namespace includes #include "MemorySettings.h" #include "CMemoryPoolProvider.h" #include "CMemoryPool.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace std; namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CObjectMemoryPoolAllocator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CObjectMemoryPoolAllocator { // public methods public: //! Constructor CObjectMemoryPoolAllocator() { } //! Destructor virtual ~CObjectMemoryPoolAllocator() { } static inline T* allocateAndConstructWithMemroyPool(CMemoryPoolProvider* memoryPoolProvider = nullptr) { T* object = 0; CMemoryPool* memoryPool = nullptr; if (memoryPoolProvider) { memoryPool = memoryPoolProvider->acquireMemoryPool(sizeof(T)); } else { memoryPool = new CMemoryPool(); cint64 memorySize = qMax((cint64)sizeof(T),DEFAULTMEMORYPOOLSIZE); char* memoryPoolMemory = new char[memorySize]; memoryPool->setMemoryBlockData(memoryPoolMemory,memorySize); } if (memoryPool) { cint64 memorySize = (cint64)sizeof(T); object = (T*)(memoryPool->getMemoryBlockPointer()); memoryPool->incMemoryBlockPointer(sizeof(T)); new (object) T(memoryPool); } return object; } static inline T* allocateAndConstructWithMemroyPool(CMemoryPool* memoryPool) { T* object = 0; if (memoryPool) { cint64 memorySize = (cint64)sizeof(T); object = (T*)(memoryPool->getMemoryBlockPointer()); memoryPool->incMemoryBlockPointer(sizeof(T)); new (object) T(memoryPool); } return object; } // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #include "CObjectMemoryPoolAllocator.cpp" #endif // KONCLUDE_UTILITIES_MEMORY_COBJECTMEMORYPOOLALLOCATOR_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CAllocationLimitationProvider.cpp0000644000175000017500000000221212520551356030147 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAllocationLimitationProvider.h" namespace Konclude { namespace Utilities { namespace Memory { CAllocationLimitationProvider::CAllocationLimitationProvider() { } CAllocationLimitationProvider::~CAllocationLimitationProvider() { } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryAllocator.cpp0000644000175000017500000000174712520551360025435 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMemoryAllocator.h" namespace Konclude { namespace Utilities { namespace Memory { }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryPoolContainer.h0000644000175000017500000000372112520551360025730 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOLCONTAINER_H #define KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOLCONTAINER_H // Library includes // Namespace includes #include "MemorySettings.h" #include "CMemoryPool.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CMemoryPoolContainer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMemoryPoolContainer { // public methods public: //! Constructor CMemoryPoolContainer(CMemoryPool* memoryPool = nullptr); //! Destructor virtual ~CMemoryPoolContainer(); CMemoryPoolContainer* appendMemoryPool(CMemoryPool* memoryPool); CMemoryPool* getMemoryPools(); CMemoryPool* takeMemoryPools(); // protected methods protected: // protected variables protected: CMemoryPool* mMemoryPool; // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOLCONTAINER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryAllocationException.h0000644000175000017500000000334612520551360027123 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CMEMORYALLOCATIONEXCEPTION_H #define KONCLUDE_UTILITIES_MEMORY_CMEMORYALLOCATIONEXCEPTION_H // Library includes #include // Namespace includes #include "MemorySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CMemoryAllocationException * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMemoryAllocationException { // public methods public: //! Constructor CMemoryAllocationException(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CMEMORYALLOCATIONEXCEPTION_H ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CCentralizedAllocationConfigProvidedDependendLimitation.cppKonclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CCentralizedAllocationConfigProvidedDependend0000644000175000017500000001321212520551356032442 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCentralizedAllocationConfigProvidedDependendLimitation.h" namespace Konclude { namespace Utilities { namespace Memory { CCentralizedAllocationConfigProvidedDependendLimitation::CCentralizedAllocationConfigProvidedDependendLimitation(CConfigurationProvider* configProvider, const QString& configString) { mConfigString = configString; mConfigProvider = configProvider; mMaxMemAllocSize = 0; mCurrMemAllocSize = 0; mAddMemAllocSize = 1024*1024*512; mCriticalMemAllocSize = 1024*1024*1024; mMemAllocLimited = false; mLimitatorLinker = nullptr; mLastConfig = nullptr; mStatMaxAllocatedMemSize = 0; } CCentralizedAllocationConfigProvidedDependendLimitation::~CCentralizedAllocationConfigProvidedDependendLimitation() { } CCentralizedAllocationLimitator* CCentralizedAllocationConfigProvidedDependendLimitation::getLimitator() { QMutexLocker locker(&mSyncMutex); CCentralizedAllocationLimitator* limitator = new CCentralizedAllocationLimitator(this); mLimitatorLinker = limitator->append(mLimitatorLinker); return limitator; } cint64 CCentralizedAllocationConfigProvidedDependendLimitation::getAllocatedMemorySize() { cint64 allocatedMemSize = 0; CCentralizedAllocationLimitator* limIt = mLimitatorLinker; while (limIt) { allocatedMemSize += limIt->getMemoryAllocatedSize(); limIt = limIt->getNext(); } return allocatedMemSize; } cint64 CCentralizedAllocationConfigProvidedDependendLimitation::getAllocatedMemorySizeMaximum() { mStatMaxAllocatedMemSize = qMax(mStatMaxAllocatedMemSize,getAllocatedMemorySize()); return mStatMaxAllocatedMemSize; } cint64 CCentralizedAllocationConfigProvidedDependendLimitation::getReservedMemorySizeMaximum() { return mCurrMemAllocSize; } bool CCentralizedAllocationConfigProvidedDependendLimitation::updateMaxMemoryAllocationSize() { CConfiguration* currConfig = mConfigProvider->getCurrentConfiguration(); if (mLastConfig != currConfig) { QMutexLocker locker(&mSyncMutex); if (mLastConfig != currConfig) { mLastConfig = currConfig; mAddMemAllocSize = CConfigDataReader::readConfigInteger(currConfig,mConfigString+".IncreaseAllocationSize",1024*1024*512 /*512 MByte*/); bool configReadError = false; bool limited = CConfigDataReader::readConfigBoolean(currConfig,mConfigString+".AllocationLimitation",false,&configReadError); if (!configReadError && limited) { configReadError = false; mCriticalMemAllocSize = CConfigDataReader::readConfigInteger(currConfig,mConfigString+".CriticalAllocationSize",1024*1024*1024 /*1 GByte*/); cint64 configMaxMemAllocSize = CConfigDataReader::readConfigInteger(currConfig,mConfigString+".MaximumAllocationSize",0,&configReadError); if (configReadError) { mMemAllocLimited = false; } else { mMemAllocLimited = true; mMaxMemAllocSize = configMaxMemAllocSize; return true; } } else { mMemAllocLimited = false; } } } return false; } bool CCentralizedAllocationConfigProvidedDependendLimitation::requestLimitatorMemoryAllocationSizeUpdate() { CCentralizedAllocationLimitator* limIt = mLimitatorLinker; while (limIt) { if (limIt->getRemainingMemoryAllocationSize() > 2*mAddMemAllocSize) { limIt->notifyRequireUpdateLimit(); } limIt = limIt->getNext(); } return true; } cint64 CCentralizedAllocationConfigProvidedDependendLimitation::getUpdatedMemoryAllocationLimit(CAllocationLimitator* limitator) { mStatMaxAllocatedMemSize = qMax(mStatMaxAllocatedMemSize,getAllocatedMemorySize()); bool updated = updateMaxMemoryAllocationSize(); cint64 remSize = limitator->getRemainingMemoryAllocationSize(); if (remSize < mAddMemAllocSize) { // add some memory QMutexLocker locker(&mSyncMutex); if (!mMemAllocLimited) { mCurrMemAllocSize += mAddMemAllocSize; return limitator->getMaximumMemoryAllocationSize() + mAddMemAllocSize; } else { cint64 tmpAlloc = mMaxMemAllocSize-mCurrMemAllocSize; tmpAlloc = qMin(tmpAlloc,mAddMemAllocSize); tmpAlloc = qMax(tmpAlloc,(cint64)0); mCurrMemAllocSize += tmpAlloc; if (mCurrMemAllocSize > mCriticalMemAllocSize || tmpAlloc != mAddMemAllocSize) { requestLimitatorMemoryAllocationSizeUpdate(); } return limitator->getMaximumMemoryAllocationSize() + tmpAlloc; } } else if (remSize > 2*mAddMemAllocSize) { // get some memory QMutexLocker locker(&mSyncMutex); cint64 tmpAllocGet = remSize-mAddMemAllocSize; mCurrMemAllocSize -= tmpAllocGet; return limitator->getMaximumMemoryAllocationSize() - tmpAllocGet; } return limitator->getMaximumMemoryAllocationSize(); } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryTemporaryAllocationManager.cpp0000644000175000017500000000355112520551360030773 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMemoryTemporaryAllocationManager.h" namespace Konclude { namespace Utilities { namespace Memory { CMemoryTemporaryAllocationManager::CMemoryTemporaryAllocationManager() { } CMemoryTemporaryAllocationManager::~CMemoryTemporaryAllocationManager() { } CMemoryTemporaryAllocationManager* CMemoryTemporaryAllocationManager::releaseTemporaryMemoryPools(CMemoryPool* memoryPools) { CMemoryPool* memoryPoolIt = memoryPools; while (memoryPoolIt) { CMemoryPool* memoryPool = memoryPoolIt; memoryPoolIt = memoryPoolIt->getNext(); memoryPool->clearNext(); releaseTemporaryMemoryPool(memoryPool); } return this; } CMemoryPool* CMemoryTemporaryAllocationManager::acquireMemoryPool(cint64 minPoolSize) { return acqireTemporaryMemoryPool(minPoolSize); } CMemoryPoolProvider* CMemoryTemporaryAllocationManager::releaseMemoryPool(CMemoryPool* memoryPool) { releaseTemporaryMemoryPool(memoryPool); return this; } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CObjectParameterizingAllocator.h0000644000175000017500000000510712520551362027736 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_COBJECTPARAMETERIZINGALLOCATOR_H #define KONCLUDE_UTILITIES_MEMORY_COBJECTPARAMETERIZINGALLOCATOR_H // Library includes // Namespace includes #include "MemorySettings.h" #include "CMemoryAllocationManager.h" #include "CObjectAllocator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace std; namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CObjectParameterizingAllocator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CObjectParameterizingAllocator : public CObjectAllocator { // public methods public: //! Constructor CObjectParameterizingAllocator() { } //! Destructor virtual ~CObjectParameterizingAllocator() { } static inline T* allocateAndConstructAndParameterize(CMemoryAllocationManager* memoryAllocatorManager, P parameter) { T* object = 0; if (memoryAllocatorManager) { void* memAddr = memoryAllocatorManager->allocate(sizeof(T)); object = (T*)memAddr; new (object) T(parameter); } else { object = new T(parameter); } return object; } // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; template inline void COPADestroyAndRelease(T* object, CMemoryAllocationManager* memoryAllocatorManager) { COADestroyAndRelease(object,memoryAllocatorManager); } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #include "CObjectParameterizingAllocator.cpp" #endif // KONCLUDE_UTILITIES_MEMORY_COBJECTPARAMETERIZINGALLOCATOR_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CNewAllocationMemoryPoolProvider.cpp0000644000175000017500000000617412520551360030620 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNewAllocationMemoryPoolProvider.h" namespace Konclude { namespace Utilities { namespace Memory { CNewAllocationMemoryPoolProvider::CNewAllocationMemoryPoolProvider(cint64 defaultPoolSize) { mDefaultPoolSize = defaultPoolSize; mStatAllocatedPoolSize = 0; mStatAllocatedPoolCount = 0; mStatReleasedPoolSize = 0; mStatReleasedPoolCount = 0; mStatDiffPoolSize = 0; mStatDiffPoolCount = 0; } CNewAllocationMemoryPoolProvider::~CNewAllocationMemoryPoolProvider() { } CMemoryPool* CNewAllocationMemoryPoolProvider::acquireMemoryPoolConsiderated(cint64 minPoolSize) { return acquireMemoryPool(minPoolSize); } CMemoryPool* CNewAllocationMemoryPoolProvider::acquireMemoryPool(cint64 minPoolSize) { CMemoryPool* memoryPool = new CMemoryPool(); if (!memoryPool) { // not enough memory even for the log message //LOG(CATASTROPHIC,"::Konclude::Utilities::NewAllocationMemoryPoolProvider",logTr("Memory allocation failed."),this); } cint64 memoryBlockSize = qMax(mDefaultPoolSize,minPoolSize); char* memoryBlock = new char[memoryBlockSize]; if (!memoryBlock) { LOG(CATASTROPHIC,"::Konclude::Utilities::NewAllocationMemoryPoolProvider",logTr("Memory allocation failed."),this); } mStatAllocatedPoolSize += memoryBlockSize; mStatDiffPoolSize += memoryBlockSize; ++mStatAllocatedPoolCount; ++mStatDiffPoolCount; memoryPool->setMemoryBlockData(memoryBlock,memoryBlockSize); return memoryPool; } CMemoryPoolProvider* CNewAllocationMemoryPoolProvider::releaseMemoryPool(CMemoryPool* memoryPool) { while (memoryPool) { CMemoryPool* tmpMemoryPool = memoryPool; memoryPool = memoryPool->getNext(); mStatReleasedPoolSize += tmpMemoryPool->getMemoryBlockSize(); mStatDiffPoolSize -= tmpMemoryPool->getMemoryBlockSize(); ++mStatReleasedPoolCount; char* memoryBlock = tmpMemoryPool->getMemoryBlockData(); delete [] memoryBlock; delete tmpMemoryPool; } return this; } cint64 CNewAllocationMemoryPoolProvider::getAllocatedReleaseDifferencePoolCount() { return mStatDiffPoolCount; } cint64 CNewAllocationMemoryPoolProvider::getAllocatedReleaseDifferencePoolSize() { return mStatDiffPoolSize; } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryAllocator.h0000644000175000017500000000707312520551360025100 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CMEMORYALLOCATOR_H #define KONCLUDE_UTILITIES_MEMORY_CMEMORYALLOCATOR_H // Library includes #include // Namespace includes #include "MemorySettings.h" #include "CMemoryAllocationManager.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace std; namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CMemoryAllocator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMemoryAllocator { // public methods public: //! Constructor CMemoryAllocator() { } //! Destructor virtual ~CMemoryAllocator() { } static inline void* allocateMemory(CMemoryAllocationManager* memoryAllocatorManager, size_t memorySize) { void* memAddr = 0; if (memoryAllocatorManager) { memAddr = memoryAllocatorManager->allocate(memorySize); } else { memAddr = qMallocAligned(memorySize,0); } return memAddr; } static inline void* reallocateMemory(void* memAddr, CMemoryAllocationManager* memoryAllocatorManager, size_t prevMemorySize, size_t newMemorySize) { void* newMemAddr = 0; if (memoryAllocatorManager) { newMemAddr = memoryAllocatorManager->allocate(newMemorySize); ::memcpy(newMemAddr,memAddr,prevMemorySize); memoryAllocatorManager->release(memAddr); } else { newMemAddr = qReallocAligned(memAddr,newMemorySize,prevMemorySize,0); } return newMemAddr; } static inline void* allocateAlignedMemory(CMemoryAllocationManager* memoryAllocatorManager, size_t memorySize, cint alignment) { void* memAddr = 0; if (memoryAllocatorManager) { memAddr = memoryAllocatorManager->allocateAligned(memorySize,alignment); } else { memAddr = qMallocAligned(memorySize,alignment); } return memAddr; } static inline void releaseMemory(void* memAddr, CMemoryAllocationManager* memoryAllocatorManager) { if (memoryAllocatorManager) { memoryAllocatorManager->release(memAddr); } else { qFreeAligned(memAddr); } } static inline void releaseAlignedMemory(void* memAddr, CMemoryAllocationManager* memoryAllocatorManager) { if (memoryAllocatorManager) { memoryAllocatorManager->release(memAddr); } else { qFreeAligned(memAddr); } } // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CMEMORYALLOCATOR_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CCentralizedAllocationLimitation.cpp0000644000175000017500000000223312520551360030617 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCentralizedAllocationLimitation.h" namespace Konclude { namespace Utilities { namespace Memory { CCentralizedAllocationLimitation::CCentralizedAllocationLimitation() { } CCentralizedAllocationLimitation::~CCentralizedAllocationLimitation() { } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryPoolAllocationManager.cpp0000644000175000017500000002070112520551360027716 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMemoryPoolAllocationManager.h" namespace Konclude { namespace Utilities { namespace Memory { CMemoryPoolAllocationManager::CMemoryPoolAllocationManager(CMemoryPoolProvider* memoryPoolProvider) { mMemoryPoolProvider = memoryPoolProvider; mFreeMemoryPoolList = nullptr; mUsedMemoryPoolList = nullptr; mUsingMemoryPool = nullptr; mFreeMemoryPoolCount = 0; mStatMemToUsingCount = 0; mStatMemToFreeCount = 0; } CMemoryPoolAllocationManager::~CMemoryPoolAllocationManager() { // release all memory blocks while (mFreeMemoryPoolList) { CMemoryPool* tmpMemPool = mFreeMemoryPoolList; mFreeMemoryPoolList = mFreeMemoryPoolList->getNextMemoryPool(); tmpMemPool->clearNext(); mMemoryPoolProvider->releaseMemoryPool(tmpMemPool); } while (mUsedMemoryPoolList) { CMemoryPool* tmpMemPool = mUsedMemoryPoolList; mUsedMemoryPoolList = mUsedMemoryPoolList->getNextMemoryPool(); tmpMemPool->clearNext(); mMemoryPoolProvider->releaseMemoryPool(tmpMemPool); } if (mUsingMemoryPool) { mMemoryPoolProvider->releaseMemoryPool(mUsingMemoryPool); } mFreeMemoryPoolCount = 0; } void* CMemoryPoolAllocationManager::allocate(size_t size) { void* memPtr = 0; char* memBlock = 0; if (size >= 8) { memBlock = getMemoryBlock(size*sizeof(char),8); } else if (size >= 4) { memBlock = getMemoryBlock(size*sizeof(char),4); } else if (size >= 2) { memBlock = getMemoryBlock(size*sizeof(char),2); } else { memBlock = getMemoryBlock(size*sizeof(char)); } memPtr = memBlock; return memPtr; } CMemoryAllocationManager* CMemoryPoolAllocationManager::release(void* address) { // not supported by this pool memory manager, use releaseAllMemory() return this; } void* CMemoryPoolAllocationManager::allocateAligned(size_t size, int alignment) { void* memPtr = 0; char* memBlock = getMemoryBlock(size*sizeof(char),alignment); memPtr = memBlock; return memPtr; } char* CMemoryPoolAllocationManager::getMemoryBlock(cint64 memoryBlockSize) { char* memBlock = 0; bool allocated = false; while (!allocated) { if (!mUsingMemoryPool) { if (!mFreeMemoryPoolList) { mFreeMemoryPoolList = mMemoryPoolProvider->acquireMemoryPool(memoryBlockSize); ++mFreeMemoryPoolCount; } mUsingMemoryPool = mFreeMemoryPoolList; mFreeMemoryPoolList = mFreeMemoryPoolList->getNextMemoryPool(); mUsingMemoryPool->clearNext(); --mFreeMemoryPoolCount; ++mStatMemToUsingCount; } if (mUsingMemoryPool) { char* memBlockEnd = mUsingMemoryPool->getMemoryBlockEnd(); char* memBlockPointer = mUsingMemoryPool->getMemoryBlockPointer(); if (memBlockPointer+memoryBlockSize <= memBlockEnd) { memBlock = memBlockPointer; mUsingMemoryPool->setMemoryBlockPointer(memBlockPointer+memoryBlockSize); allocated = true; } else { // move pool to used CMemoryPool* tmpMemPool = mUsingMemoryPool; mUsedMemoryPoolList = tmpMemPool->setNextMemoryPool(mUsedMemoryPoolList); mUsingMemoryPool = nullptr; } } } return memBlock; } char* CMemoryPoolAllocationManager::getMemoryBlock(cint64 memoryBlockSize, cint64 alignment) { char* memBlock = 0; bool allocated = false; while (!allocated) { if (!mUsingMemoryPool) { if (!mFreeMemoryPoolList) { mFreeMemoryPoolList = mMemoryPoolProvider->acquireMemoryPool(memoryBlockSize+alignment); ++mFreeMemoryPoolCount; } mUsingMemoryPool = mFreeMemoryPoolList; mFreeMemoryPoolList = mFreeMemoryPoolList->getNextMemoryPool(); mUsingMemoryPool->clearNext(); --mFreeMemoryPoolCount; ++mStatMemToUsingCount; } if (mUsingMemoryPool) { char* memBlockEnd = mUsingMemoryPool->getMemoryBlockEnd(); char* memBlockPointer = mUsingMemoryPool->getMemoryBlockPointer(); cint64 maxBlockAlloc = (cint64)memBlockPointer+(cint64)memoryBlockSize+alignment; if (maxBlockAlloc <= (cint64)memBlockEnd) { // alignment is 2^N cint64 alignmentMask = alignment-1; memBlock = memBlockPointer; if (alignmentMask & cint64(memBlock)) { memBlock = (char*)((cint64(memBlock) & ~alignmentMask) + alignment); } mUsingMemoryPool->setMemoryBlockPointer(memBlock+memoryBlockSize); allocated = true; } else { // move pool to used CMemoryPool* tmpMemPool = mUsingMemoryPool; mUsedMemoryPoolList = tmpMemPool->setNextMemoryPool(mUsedMemoryPoolList); mUsingMemoryPool = nullptr; } } } return memBlock; } CMemoryTemporaryAllocationManager* CMemoryPoolAllocationManager::releaseAllMemory() { // move all used memory pools to free list CMemoryPool* tmpMemPool = nullptr; while (mUsedMemoryPoolList) { tmpMemPool = mUsedMemoryPoolList; tmpMemPool->resetMemoryBlockPointer(); mUsedMemoryPoolList = mUsedMemoryPoolList->getNextMemoryPool(); mFreeMemoryPoolList = tmpMemPool->setNextMemoryPool(mFreeMemoryPoolList); ++mFreeMemoryPoolCount; ++mStatMemToFreeCount; } if (mUsingMemoryPool) { mUsingMemoryPool->resetMemoryBlockPointer(); mFreeMemoryPoolList = mUsingMemoryPool->setNextMemoryPool(mFreeMemoryPoolList); ++mFreeMemoryPoolCount; ++mStatMemToFreeCount; mUsingMemoryPool = nullptr; } return this; } CMemoryPool* CMemoryPoolAllocationManager::acqireTemporaryMemoryPool(size_t size) { CMemoryPool* tmpMemoryPool = nullptr; if (mFreeMemoryPoolList) { if (mFreeMemoryPoolList->getMemoryBlockSize() >= size) { tmpMemoryPool = mFreeMemoryPoolList; mFreeMemoryPoolList = mFreeMemoryPoolList->getNextMemoryPool(); --mFreeMemoryPoolCount; } } if (!tmpMemoryPool) { tmpMemoryPool = mMemoryPoolProvider->acquireMemoryPool(size); } if (tmpMemoryPool) { ++mStatMemToUsingCount; tmpMemoryPool->clearNext(); } return tmpMemoryPool; } CMemoryTemporaryAllocationManager* CMemoryPoolAllocationManager::releaseTemporaryMemoryPool(CMemoryPool* memoryPool) { memoryPool->resetMemoryBlockPointer(); memoryPool->setNextMemoryPool(mFreeMemoryPoolList); mFreeMemoryPoolList = memoryPool; ++mFreeMemoryPoolCount; ++mStatMemToFreeCount; return this; } cint64 CMemoryPoolAllocationManager::getOptimizedMoreAllocationSize(cint64 size) { if (mUsingMemoryPool) { cint64 availableSizeThisPool = mUsingMemoryPool->getMemoryBlockEnd() - mUsingMemoryPool->getMemoryBlockData(); if (availableSizeThisPool >= size) { return qMax(availableSizeThisPool,size<<2); } else if (mUsingMemoryPool->getMemoryBlockSize() >= size) { return qMax(mUsingMemoryPool->getMemoryBlockSize(),size<<2); } } else if (mFreeMemoryPoolList) { cint64 availableSizeThisPool = mFreeMemoryPoolList->getMemoryBlockEnd() - mFreeMemoryPoolList->getMemoryBlockData(); if (availableSizeThisPool >= size) { return qMax(availableSizeThisPool,size<<2); } else if (mUsingMemoryPool->getMemoryBlockSize() >= size) { return qMax(mUsingMemoryPool->getMemoryBlockSize(),size<<2); } } return size; } CMemoryTemporaryAllocationManager* CMemoryPoolAllocationManager::releaseMemoryPoolContainer(CMemoryPoolContainer* memoryPoolContainer) { CMemoryPool* memoryPoolLinker = memoryPoolContainer->takeMemoryPools(); return releaseTemporaryMemoryPools(memoryPoolLinker); } cint64 CMemoryPoolAllocationManager::getFreeMemoryPoolCount() { return mFreeMemoryPoolCount; } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CAllocationLimitator.h0000644000175000017500000000411412520551356025737 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CALLOCATIONLIMITATOR_H #define KONCLUDE_UTILITIES_MEMORY_CALLOCATIONLIMITATOR_H // Library includes #include // Namespace includes #include "MemorySettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CAllocationLimitator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAllocationLimitator { // public methods public: //! Constructor CAllocationLimitator(); //! Destructor virtual ~CAllocationLimitator(); virtual cint64 getMemoryAllocatedSize() = 0; virtual cint64 getMaximumMemoryAllocationSize() = 0; virtual cint64 getRemainingMemoryAllocationSize() = 0; virtual bool addAllocatingMemorySize(cint64 allocatedMemorySize) = 0; virtual CAllocationLimitator* addReleasedMemorySize(cint64 allocatedMemorySize) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CALLOCATIONLIMITATOR_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CConsiderateMemoryPoolProvider.cpp0000644000175000017500000000221712520551360030313 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConsiderateMemoryPoolProvider.h" namespace Konclude { namespace Utilities { namespace Memory { CConsiderateMemoryPoolProvider::CConsiderateMemoryPoolProvider() { } CConsiderateMemoryPoolProvider::~CConsiderateMemoryPoolProvider() { } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CNewCentralizedLimitedAllocationMemoryPoolProvider.cppKonclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CNewCentralizedLimitedAllocationMemoryPoolPro0000644000175000017500000000740712520551360032502 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNewCentralizedLimitedAllocationMemoryPoolProvider.h" namespace Konclude { namespace Utilities { namespace Memory { CNewCentralizedLimitedAllocationMemoryPoolProvider::CNewCentralizedLimitedAllocationMemoryPoolProvider(CAllocationLimitator* allocLimitator, cint64 defaultPoolSize) { mDefaultPoolSize = defaultPoolSize; mStatAllocatedPoolSize = 0; mStatAllocatedPoolCount = 0; mStatReleasedPoolSize = 0; mStatReleasedPoolCount = 0; mStatDiffPoolSize = 0; mStatDiffPoolCount = 0; mAllocLimitator = allocLimitator; } CNewCentralizedLimitedAllocationMemoryPoolProvider::~CNewCentralizedLimitedAllocationMemoryPoolProvider() { } CMemoryPool* CNewCentralizedLimitedAllocationMemoryPoolProvider::acquireMemoryPool(cint64 minPoolSize) { cint64 memoryBlockSize = qMax(mDefaultPoolSize,minPoolSize); mAllocLimitator->addAllocatingMemorySize(memoryBlockSize+sizeof(CMemoryPool)); CMemoryPool* memoryPool = new CMemoryPool(); char* memoryBlock = new char[memoryBlockSize]; mStatAllocatedPoolSize += memoryBlockSize; mStatDiffPoolSize += memoryBlockSize; ++mStatAllocatedPoolCount; ++mStatDiffPoolCount; memoryPool->setMemoryBlockData(memoryBlock,memoryBlockSize); return memoryPool; } CMemoryPool* CNewCentralizedLimitedAllocationMemoryPoolProvider::acquireMemoryPoolConsiderated(cint64 minPoolSize) { cint64 memoryBlockSize = qMax(mDefaultPoolSize,minPoolSize); if (mAllocLimitator->addAllocatingMemorySize(memoryBlockSize+sizeof(CMemoryPool))) { CMemoryPool* memoryPool = new CMemoryPool(); char* memoryBlock = new char[memoryBlockSize]; mStatAllocatedPoolSize += memoryBlockSize; mStatDiffPoolSize += memoryBlockSize; ++mStatAllocatedPoolCount; ++mStatDiffPoolCount; memoryPool->setMemoryBlockData(memoryBlock,memoryBlockSize); return memoryPool; } else { throw CMemoryAllocationException(); } return nullptr; } CMemoryPoolProvider* CNewCentralizedLimitedAllocationMemoryPoolProvider::releaseMemoryPool(CMemoryPool* memoryPool) { while (memoryPool) { CMemoryPool* tmpMemoryPool = memoryPool; memoryPool = memoryPool->getNext(); mStatReleasedPoolSize += tmpMemoryPool->getMemoryBlockSize(); mStatDiffPoolSize -= tmpMemoryPool->getMemoryBlockSize(); mAllocLimitator->addReleasedMemorySize(tmpMemoryPool->getMemoryBlockSize()+sizeof(CMemoryPool)); ++mStatReleasedPoolCount; --mStatDiffPoolCount; char* memoryBlock = tmpMemoryPool->getMemoryBlockData(); delete [] memoryBlock; delete tmpMemoryPool; } return this; } cint64 CNewCentralizedLimitedAllocationMemoryPoolProvider::getAllocatedReleaseDifferencePoolCount() { return mStatDiffPoolCount; } cint64 CNewCentralizedLimitedAllocationMemoryPoolProvider::getAllocatedReleaseDifferencePoolSize() { return mStatDiffPoolSize; } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CTempMemoryPoolContainerAllocationManager.h0000644000175000017500000000625612520551362032067 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CTEMPMEMORYPOOLCONTAINERALLOCATIONMANAGER_H #define KONCLUDE_UTILITIES_MEMORY_CTEMPMEMORYPOOLCONTAINERALLOCATIONMANAGER_H // Libraries includes // Namespace includes #include "MemorySettings.h" #include "CMemoryAllocationManager.h" #include "CMemoryPoolContainer.h" #include "CMemoryPoolProvider.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CTempMemoryPoolContainerAllocationManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTempMemoryPoolContainerAllocationManager : public CMemoryAllocationManager { // public methods public: //! Constructor CTempMemoryPoolContainerAllocationManager(CMemoryPoolContainer* memoryPoolContainer, CMemoryPoolProvider* memoryPoolProvider); CTempMemoryPoolContainerAllocationManager(CMemoryPoolProvider* memoryPoolProvider); CTempMemoryPoolContainerAllocationManager(); //! Destructor virtual ~CTempMemoryPoolContainerAllocationManager(); CTempMemoryPoolContainerAllocationManager* initTempMemoryPoolContainerAllocationManager(CMemoryPoolContainer* memoryPoolContainer, CMemoryPoolProvider* memoryPoolProvider); virtual CMemoryAllocationManager* release(void* address); virtual void* allocate(size_t size); virtual void* allocateAligned(size_t size, int alignment); virtual cint64 getOptimizedMoreAllocationSize(cint64 size); static void* allocateMemoryToContainer(size_t size, CMemoryPoolContainer* memoryPoolContainer, CMemoryPoolProvider* memoryPoolProvider); CMemoryPool* getMemoryPools(); CMemoryPool* takeMemoryPools(); // protected methods protected: char* getMemoryBlock(cint64 memoryBlockSize); char* getMemoryBlock(cint64 memoryBlockSize, cint64 alignment); // protected variables protected: CMemoryPoolProvider* mMemoryPoolProvider; CMemoryPoolContainer* mMemoryPoolContainer; CMemoryPoolContainer mTmpMemoryPoolContainer; cint64 mStatPoolAllocCount; cint64 mStatAllocPoolSize; // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CTEMPMEMORYPOOLCONTAINERALLOCATIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryPoolProvider.h0000644000175000017500000000361712520551360025604 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOLPROVIDER_H #define KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOLPROVIDER_H // Library includes // Namespace includes #include "MemorySettings.h" #include "CMemoryPool.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CMemoryPoolProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CMemoryPoolProvider { // public methods public: //! Constructor CMemoryPoolProvider(); //! Destructor virtual ~CMemoryPoolProvider(); virtual CMemoryPool* acquireMemoryPool(cint64 minPoolSize) = 0; virtual CMemoryPoolProvider* releaseMemoryPool(CMemoryPool* memoryPool) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CMEMORYPOOLPROVIDER_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.cppKonclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.cp0000644000175000017500000000446412520551360032412 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CLimitedReserveMemoryPoolAllocationManager.h" namespace Konclude { namespace Utilities { namespace Memory { CLimitedReserveMemoryPoolAllocationManager::CLimitedReserveMemoryPoolAllocationManager(CMemoryPoolProvider* memoryPoolProvider, cint64 freeReserveLimit, cint64 freeReleaseBlockSize) : CMemoryPoolAllocationManager(memoryPoolProvider) { mFreeReserveLimit = freeReserveLimit; mFreeReleaseBlockSize = freeReleaseBlockSize; } CLimitedReserveMemoryPoolAllocationManager::~CLimitedReserveMemoryPoolAllocationManager() { } CMemoryTemporaryAllocationManager* CLimitedReserveMemoryPoolAllocationManager::releaseTemporaryMemoryPool(CMemoryPool* memoryPool) { memoryPool->resetMemoryBlockPointer(); memoryPool->setNextMemoryPool(mFreeMemoryPoolList); mFreeMemoryPoolList = memoryPool; ++mStatMemToFreeCount; ++mFreeMemoryPoolCount; if (mFreeMemoryPoolCount > mFreeReserveLimit) { CMemoryPool* tmpMemoryPoolIt = mFreeMemoryPoolList; CMemoryPool* releaseMemoryPool = mFreeMemoryPoolList; for (cint64 cnt = 0; cnt < mFreeReleaseBlockSize && tmpMemoryPoolIt->hasNext(); ++cnt) { tmpMemoryPoolIt = tmpMemoryPoolIt->getNext(); --mFreeMemoryPoolCount; } --mFreeMemoryPoolCount; mFreeMemoryPoolList = tmpMemoryPoolIt->getNext(); tmpMemoryPoolIt->clearNext(); mMemoryPoolProvider->releaseMemoryPool(releaseMemoryPool); } return this; } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CConsiderateMemoryPoolProvider.h0000644000175000017500000000370412520551360027762 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CCONSIDERATEMEMORYPOOLPROVIDER_H #define KONCLUDE_UTILITIES_MEMORY_CCONSIDERATEMEMORYPOOLPROVIDER_H // Library includes // Namespace includes #include "MemorySettings.h" #include "CMemoryPoolProvider.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CConsiderateMemoryPoolProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConsiderateMemoryPoolProvider : virtual public CMemoryPoolProvider { // public methods public: //! Constructor CConsiderateMemoryPoolProvider(); //! Destructor virtual ~CConsiderateMemoryPoolProvider(); virtual CMemoryPool* acquireMemoryPoolConsiderated(cint64 minPoolSize) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CCONSIDERATEMEMORYPOOLPROVIDER_H ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CNewCentralizedLimitedAllocationMemoryPoolProvider.hKonclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CNewCentralizedLimitedAllocationMemoryPoolPro0000644000175000017500000000550612520551362032502 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_MEMORY_CNEWCENTRALIZEDLIMITEDALLOCATIONMEMORYPOOLPROVIDER_H #define KONCLUDE_UTILITIES_MEMORY_CNEWCENTRALIZEDLIMITEDALLOCATIONMEMORYPOOLPROVIDER_H // Library includes #include // Namespace includes #include "MemorySettings.h" #include "CMemoryPoolProvider.h" #include "CAllocationLimitator.h" #include "CMemoryAllocationException.h" #include "CConsiderateMemoryPoolProvider.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Memory { /*! * * \class CNewCentralizedLimitedAllocationMemoryPoolProvider * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNewCentralizedLimitedAllocationMemoryPoolProvider : public CConsiderateMemoryPoolProvider { // public methods public: //! Constructor CNewCentralizedLimitedAllocationMemoryPoolProvider(CAllocationLimitator* allocLimitator, cint64 defaultPoolSize = DEFAULTMEMORYPOOLSIZE); //! Destructor virtual ~CNewCentralizedLimitedAllocationMemoryPoolProvider(); virtual CMemoryPool* acquireMemoryPool(cint64 minPoolSize); virtual CMemoryPoolProvider* releaseMemoryPool(CMemoryPool* memoryPool); virtual CMemoryPool* acquireMemoryPoolConsiderated(cint64 minPoolSize); cint64 getAllocatedReleaseDifferencePoolCount(); cint64 getAllocatedReleaseDifferencePoolSize(); // protected methods protected: // protected variables protected: CAllocationLimitator* mAllocLimitator; cint64 mDefaultPoolSize; cint64 mStatAllocatedPoolSize; cint64 mStatAllocatedPoolCount; cint64 mStatReleasedPoolSize; cint64 mStatReleasedPoolCount; cint64 mStatDiffPoolSize; cint64 mStatDiffPoolCount; // private methods private: // private variables private: }; }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_MEMORY_CNEWCENTRALIZEDLIMITEDALLOCATIONMEMORYPOOLPROVIDER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Memory/CMemoryAllocationManager.cpp0000644000175000017500000000233412520551360027066 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMemoryAllocationManager.h" namespace Konclude { namespace Utilities { namespace Memory { CMemoryAllocationManager::CMemoryAllocationManager() { } CMemoryAllocationManager::~CMemoryAllocationManager() { } cint64 CMemoryAllocationManager::getOptimizedMoreAllocationSize(cint64 size) { return size; } }; // end namespace Memory }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/CMath.cpp0000644000175000017500000000641412520551362021743 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMath.h" namespace Konclude { namespace Utilities { CMath::CMath() { } CMath::~CMath() { } qint64 CMath::log2(qint64 x) { if(x>32)+32; } } }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/CSortedDblNegLinker.hpp0000644000175000017500000004105612520551364024543 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CSORTEDDBLNEGLINKER_H #define KONCLUDE_UTILITIES_CSORTEDDBLNEGLINKER_H // Libraries includes // Namespace includes #include // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { template class CSortedDblNegLinker; /*! * * \class CSortedDblNegLinker * \author Andreas Steigmiller * \version 0.1 * \brief Spezialised Pointer Version to avoid comparison between addresses * */ template class CSortedDblNegLinker { // public methods public: //! Constructor CSortedDblNegLinker(); CSortedDblNegLinker(T* dataElement, bool isNegated = false, CSortedDblNegLinker *nextLink = 0); //! Destructor virtual ~CSortedDblNegLinker(); CSortedDblNegLinker *init(T* dataElement, bool isNegated = false, CSortedDblNegLinker *nextLink = 0); bool hasNext(); bool hasPrev(); CSortedDblNegLinker *insertSortedNextSorted(CSortedDblNegLinker *nextLink); CSortedDblNegLinker *insertNextSorted(CSortedDblNegLinker *nextLink); CSortedDblNegLinker *insertNext(CSortedDblNegLinker *nextLink); CSortedDblNegLinker *getNext(); CSortedDblNegLinker *insertPrev(CSortedDblNegLinker *prevLink); CSortedDblNegLinker *getPrev(); CSortedDblNegLinker *setNext(CSortedDblNegLinker *prevLink); CSortedDblNegLinker *setPrev(CSortedDblNegLinker *prevLink); T* getData(); CSortedDblNegLinker *setData(T* dataElement); bool isNegated(); CSortedDblNegLinker *setNegated(bool isNegated); CSortedDblNegLinker *prepend(CSortedDblNegLinker *prependingList); CSortedDblNegLinker *append(CSortedDblNegLinker *appendingList); CSortedDblNegLinker *removeNext(); CSortedDblNegLinker *removePrev(); CSortedDblNegLinker *getLastListLink(); CSortedDblNegLinker *getFirstListLink(); // protected methods protected: // private methods private: // private variables private: CSortedDblNegLinker *next; CSortedDblNegLinker *prev; T* data; bool negated; }; template CSortedDblNegLinker::CSortedDblNegLinker() { next = 0; prev = 0; negated = false; } template CSortedDblNegLinker::CSortedDblNegLinker(T* dataElement, bool isNegated, CSortedDblNegLinker *nextLink) { next = 0; prev = 0; setNext(nextLink); data = dataElement; negated = isNegated; } template CSortedDblNegLinker *CSortedDblNegLinker::init(T* dataElement, bool isNegated, CSortedDblNegLinker *nextLink) { next = 0; prev = 0; setNext(nextLink); data = dataElement; negated = isNegated; return this; } template CSortedDblNegLinker::~CSortedDblNegLinker() { } template bool CSortedDblNegLinker::hasNext() { return next != 0; } template bool CSortedDblNegLinker::hasPrev() { return prev != 0; } template CSortedDblNegLinker *CSortedDblNegLinker::insertNext(CSortedDblNegLinker *nextLink) { if (nextLink) { CSortedDblNegLinker *tmpNext = next; next = nextLink; nextLink->prev = this; if (tmpNext) { nextLink->append(tmpNext); } } return this; } template CSortedDblNegLinker *CSortedDblNegLinker::insertNextSorted(CSortedDblNegLinker *nextLink) { while (nextLink) { CSortedDblNegLinker *nIns = nextLink; if (nextLink->hasNext()) { nextLink = nextLink->getNext(); nextLink->removePrev(); } else { nextLink = 0; } CSortedDblNegLinker *list = this; CSortedDblNegLinker *lastList = list; bool inserted = false; T* dataIns = nIns->getData(); while (list) { T* dataList = list->getData(); if (*dataIns <= *dataList) { list->insertPrev(nIns); inserted = true; break; } lastList = list; list = list->next; } if (!inserted) { lastList->insertNext(nIns); } } return getFirstListLink(); } template CSortedDblNegLinker *CSortedDblNegLinker::insertSortedNextSorted(CSortedDblNegLinker *nextLink) { // items from nextLink are already sorted! CSortedDblNegLinker *list = this; while (nextLink) { CSortedDblNegLinker *nIns = nextLink; if (nextLink->hasNext()) { nextLink = nextLink->getNext(); nextLink->removePrev(); } else { nextLink = 0; } CSortedDblNegLinker *lastList = list; bool inserted = false; T* dataIns = nIns->getData(); while (list) { T* dataList = list->getData(); if (*dataIns <= *dataList) { list = list->insertPrev(nIns); inserted = true; break; } lastList = list; list = list->next; } if (!inserted) { lastList->insertNext(nIns); list = lastList; } } return getFirstListLink(); } template CSortedDblNegLinker *CSortedDblNegLinker::insertPrev(CSortedDblNegLinker *prevLink) { if (prevLink) { CSortedDblNegLinker *pLlast = prevLink->getLastListLink(); CSortedDblNegLinker *tmpPrev = prev; prev = pLlast; pLlast->next = this; if (tmpPrev) { tmpPrev->next = 0; prevLink->prepend(tmpPrev); } return prevLink; } else { return this; } } template CSortedDblNegLinker *CSortedDblNegLinker::setNext(CSortedDblNegLinker *nextLink) { next = nextLink; if (nextLink) { nextLink->prev = this; } return this; } template CSortedDblNegLinker *CSortedDblNegLinker::setPrev(CSortedDblNegLinker *prevLink) { if (prevLink) { CSortedDblNegLinker *pLlast = prevLink->getLastListLink(); pLlast->next = this; prev = pLlast; return prevLink; } else { prev = 0; return this; } } template CSortedDblNegLinker *CSortedDblNegLinker::getNext() { return next; } template CSortedDblNegLinker *CSortedDblNegLinker::getPrev() { return prev; } template T* CSortedDblNegLinker::getData() { return data; } template CSortedDblNegLinker *CSortedDblNegLinker::setData(T* dataElement) { data = dataElement; return this; } template bool CSortedDblNegLinker::isNegated() { return negated; } template CSortedDblNegLinker *CSortedDblNegLinker::setNegated(bool isNegated) { negated = isNegated; return this; } template CSortedDblNegLinker *CSortedDblNegLinker::prepend(CSortedDblNegLinker *prependingList) { CSortedDblNegLinker *last = prependingList->getLastListLink(); last->insertNext(this); return prependingList; } template CSortedDblNegLinker *CSortedDblNegLinker::append(CSortedDblNegLinker *appendingList) { CSortedDblNegLinker *last = getLastListLink(); last->insertNext(appendingList); return this; } template CSortedDblNegLinker *CSortedDblNegLinker::removeNext() { CSortedDblNegLinker *next = getNext(); if (next) { next->next = 0; next->prev = 0; setNext(next->getNext()); } return next; } template CSortedDblNegLinker *CSortedDblNegLinker::removePrev() { CSortedDblNegLinker *prev = getPrev(); if (prev) { prev->next = 0; prev->prev = 0; setPrev(prev->getPrev()); } return prev; } template CSortedDblNegLinker *CSortedDblNegLinker::getLastListLink() { CSortedDblNegLinker *lastListLink = this; while (lastListLink->hasNext()) { lastListLink = lastListLink->getNext(); } return lastListLink; } template CSortedDblNegLinker *CSortedDblNegLinker::getFirstListLink() { CSortedDblNegLinker *firstListLink = this; while (firstListLink->hasPrev()) { firstListLink = firstListLink->getPrev(); } return firstListLink; } /*! * * \class CSortedDblNegLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CSortedDblNegLinker { // public methods public: //! Constructor CSortedDblNegLinker(); CSortedDblNegLinker(T dataElement, bool isNegated = false, CSortedDblNegLinker *nextLink = 0); //! Destructor virtual ~CSortedDblNegLinker(); CSortedDblNegLinker *init(T dataElement, bool isNegated = false, CSortedDblNegLinker *nextLink = 0); bool hasNext(); bool hasPrev(); CSortedDblNegLinker *insertSortedNextSorted(CSortedDblNegLinker *nextLink); CSortedDblNegLinker *insertNextSorted(CSortedDblNegLinker *nextLink); CSortedDblNegLinker *insertNext(CSortedDblNegLinker *nextLink); CSortedDblNegLinker *getNext(); CSortedDblNegLinker *insertPrev(CSortedDblNegLinker *prevLink); CSortedDblNegLinker *getPrev(); CSortedDblNegLinker *setNext(CSortedDblNegLinker *prevLink); CSortedDblNegLinker *setPrev(CSortedDblNegLinker *prevLink); T getData(); CSortedDblNegLinker *setData(T dataElement); bool isNegated(); CSortedDblNegLinker *setNegated(bool isNegated); CSortedDblNegLinker *prepend(CSortedDblNegLinker *prependingList); CSortedDblNegLinker *append(CSortedDblNegLinker *appendingList); CSortedDblNegLinker *removeNext(); CSortedDblNegLinker *removePrev(); CSortedDblNegLinker *getLastListLink(); CSortedDblNegLinker *getFirstListLink(); // protected methods protected: // private methods private: // private variables private: CSortedDblNegLinker *next; CSortedDblNegLinker *prev; T data; bool negated; }; template CSortedDblNegLinker::CSortedDblNegLinker() { next = 0; prev = 0; negated = false; } template CSortedDblNegLinker::CSortedDblNegLinker(T dataElement, bool isNegated, CSortedDblNegLinker *nextLink) { next = 0; prev = 0; setNext(nextLink); data = dataElement; negated = isNegated; } template CSortedDblNegLinker *CSortedDblNegLinker::init(T dataElement, bool isNegated, CSortedDblNegLinker *nextLink) { next = 0; prev = 0; setNext(nextLink); data = dataElement; negated = isNegated; return this; } template CSortedDblNegLinker::~CSortedDblNegLinker() { } template bool CSortedDblNegLinker::hasNext() { return next != 0; } template bool CSortedDblNegLinker::hasPrev() { return prev != 0; } template CSortedDblNegLinker *CSortedDblNegLinker::insertNext(CSortedDblNegLinker *nextLink) { if (nextLink) { CSortedDblNegLinker *tmpNext = next; next = nextLink; nextLink->prev = this; if (tmpNext) { nextLink->append(tmpNext); } } return this; } template CSortedDblNegLinker *CSortedDblNegLinker::insertNextSorted(CSortedDblNegLinker *nextLink) { while (nextLink) { CSortedDblNegLinker *nIns = nextLink; if (nextLink->hasNext()) { nextLink = nextLink->getNext(); nextLink->removePrev(); } else { nextLink = 0; } CSortedDblNegLinker *list = this; CSortedDblNegLinker *lastList = list; bool inserted = false; T dataIns = nIns->getData(); while (list) { T dataList = list->getData(); if (dataIns <= dataList) { list->insertPrev(nIns); inserted = true; break; } lastList = list; list = list->next; } if (!inserted) { lastList->insertNext(nIns); } } return getFirstListLink(); } template CSortedDblNegLinker *CSortedDblNegLinker::insertSortedNextSorted(CSortedDblNegLinker *nextLink) { // items from nextLink are already sorted! CSortedDblNegLinker *list = this; while (nextLink) { CSortedDblNegLinker *nIns = nextLink; if (nextLink->hasNext()) { nextLink = nextLink->getNext(); nextLink->removePrev(); } else { nextLink = 0; } CSortedDblNegLinker *lastList = list; bool inserted = false; T dataIns = nIns->getData(); while (list) { T dataList = list->getData(); if (dataIns <= dataList) { list = list->insertPrev(nIns); inserted = true; break; } lastList = list; list = list->next; } if (!inserted) { lastList->insertNext(nIns); list = lastList; } } return getFirstListLink(); } template CSortedDblNegLinker *CSortedDblNegLinker::insertPrev(CSortedDblNegLinker *prevLink) { if (prevLink) { CSortedDblNegLinker *pLlast = prevLink->getLastListLink(); CSortedDblNegLinker *tmpPrev = prev; prev = pLlast; pLlast->next = this; if (tmpPrev) { tmpPrev->next = 0; prevLink->prepend(tmpPrev); } return prevLink; } else { return this; } } template CSortedDblNegLinker *CSortedDblNegLinker::setNext(CSortedDblNegLinker *nextLink) { next = nextLink; if (nextLink) { nextLink->prev = this; } return this; } template CSortedDblNegLinker *CSortedDblNegLinker::setPrev(CSortedDblNegLinker *prevLink) { if (prevLink) { CSortedDblNegLinker *pLlast = prevLink->getLastListLink(); pLlast->next = this; prev = pLlast; return prevLink; } else { prev = 0; return this; } } template CSortedDblNegLinker *CSortedDblNegLinker::getNext() { return next; } template CSortedDblNegLinker *CSortedDblNegLinker::getPrev() { return prev; } template T CSortedDblNegLinker::getData() { return data; } template CSortedDblNegLinker *CSortedDblNegLinker::setData(T dataElement) { data = dataElement; return this; } template bool CSortedDblNegLinker::isNegated() { return negated; } template CSortedDblNegLinker *CSortedDblNegLinker::setNegated(bool isNegated) { negated = isNegated; return this; } template CSortedDblNegLinker *CSortedDblNegLinker::prepend(CSortedDblNegLinker *prependingList) { CSortedDblNegLinker *last = prependingList->getLastListLink(); last->insertNext(this); return prependingList; } template CSortedDblNegLinker *CSortedDblNegLinker::append(CSortedDblNegLinker *appendingList) { CSortedDblNegLinker *last = getLastListLink(); last->insertNext(appendingList); return this; } template CSortedDblNegLinker *CSortedDblNegLinker::removeNext() { CSortedDblNegLinker *next = getNext(); if (next) { next->next = 0; next->prev = 0; setNext(next->getNext()); } return next; } template CSortedDblNegLinker *CSortedDblNegLinker::removePrev() { CSortedDblNegLinker *prev = getPrev(); if (prev) { prev->next = 0; prev->prev = 0; setPrev(prev->getPrev()); } return prev; } template CSortedDblNegLinker *CSortedDblNegLinker::getLastListLink() { CSortedDblNegLinker *lastListLink = this; while (lastListLink->hasNext()) { lastListLink = lastListLink->getNext(); } return lastListLink; } template CSortedDblNegLinker *CSortedDblNegLinker::getFirstListLink() { CSortedDblNegLinker *firstListLink = this; while (firstListLink->hasPrev()) { firstListLink = firstListLink->getPrev(); } return firstListLink; } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CSORTEDDBLNEGLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CDynRefBucket.hpp0000644000175000017500000001547012520551362023406 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CDYNREFBUCKET_H #define KONCLUDE_UTILITIES_CDYNREFBUCKET_H // Libraries includes #include // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Utilities { /*! * * \class CDynRefBucket * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CDynRefBucket { // public methods public: //! Constructor CDynRefBucket(qint64 setBucketSize = 32, qint64 setItemSize = 1); //! Destructor virtual ~CDynRefBucket(); bool isLocal(qint64 index); bool isReference(qint64 index); void reference(CDynRefBucket *ref); void clear(); T *getData(qint64 index); T *getLocalData(qint64 index); T *getReferenceData(qint64 index); void setLocalData(qint64 index, T *data); void setData(qint64 index, T *data); // protected methods protected: // private methods private: // private variables private: CDynRefBucket *refBucket; QPair *refDataVec; qint64 itemSize; qint64 bucketSize; }; template CDynRefBucket::CDynRefBucket(qint64 setBucketSize, qint64 setItemSize) { refBucket = 0; refDataVec = 0; itemSize = setItemSize; bucketSize = setBucketSize; } template CDynRefBucket::~CDynRefBucket() { clear(); } template void CDynRefBucket::clear() { refBucket = 0; if (refDataVec) { delete refDataVec; refDataVec = 0; } } template void CDynRefBucket::setData(qint64 index, T *data) { // writing is allways local setLocalData(index,data); } template void CDynRefBucket::setLocalData(qint64 index, T *data) { if (!refDataVec) { refDataVec = new QPair[bucketSize]; if (refBucket) { // init whole vector as referenced for (qint64 i = 0; i < bucketSize; ++i) { refDataVec[i].first = false; refDataVec[i].second = refBucket->refDataVec[i].second; } } else { // init whole vector as not referenced for (qint64 i = 0; i < bucketSize; ++i) { refDataVec[i].first = true; refDataVec[i].second = 0; } } } qint64 itemIndex = index / itemSize; if (itemIndex < bucketSize) { refDataVec[itemIndex].first = true; refDataVec[itemIndex].second = data; } } template T *CDynRefBucket::getData(qint64 index) { T *val = 0; QPair *lookupRefDataVec = refDataVec; if (!lookupRefDataVec) { // there is no local data if (refBucket) { // use the referenced data, if there is one lookupRefDataVec = refBucket->refDataVec; } } if (lookupRefDataVec) { qint64 itemIndex = index / itemSize; if (itemIndex < bucketSize) { // index must be in vector size QPair *refDataPair = lookupRefDataVec + itemIndex; // data is local available or is referenced, in both case it has to be returned val = refDataPair->second; } } return val; } template T *CDynRefBucket::getLocalData(qint64 index) { T *val = 0; QPair *lookupRefDataVec = refDataVec; if (lookupRefDataVec) { qint64 itemIndex = index / itemSize; if (itemIndex < bucketSize) { // index must be in vector size QPair *refDataPair = lookupRefDataVec + itemIndex; if (refDataPair->first == true) { // data is local available and has to be returned val = refDataPair->second; } } } return val; } template T *CDynRefBucket::getReferenceData(qint64 index) { T *val = 0; QPair *lookupRefDataVec = refDataVec; bool referenced = false; if (!lookupRefDataVec) { // there is no local data if (refBucket) { // use the referenced data, if there is one lookupRefDataVec = refBucket->refDataVec; referenced = true; } } if (lookupRefDataVec) { qint64 itemIndex = index / itemSize; if (itemIndex < bucketSize) { // index must be in vector size QPair *refDataPair = lookupRefDataVec + itemIndex; if (refDataPair->first == false || referenced) { // data is referenced available and has to be returned val = refDataPair->second; } } } return val; } template bool CDynRefBucket::isLocal(qint64 index) { QPair *lookupRefDataVec = refDataVec; if (lookupRefDataVec) { qint64 itemIndex = index / itemSize; if (itemIndex < bucketSize) { // index must be in vector size QPair *refDataPair = lookupRefDataVec + itemIndex; if (refDataPair->first == true) { // test whether data is local available return refDataPair->second != 0; } } } return false; } template bool CDynRefBucket::isReference(qint64 index) { QPair *lookupRefDataVec = refDataVec; bool referenced = false; if (!lookupRefDataVec) { // there is no local data if (refBucket) { // use the referenced data, if there is one lookupRefDataVec = refBucket->refDataVec; referenced = true; } } if (lookupRefDataVec) { qint64 itemIndex = index / itemSize; if (itemIndex < bucketSize) { // index must be in vector size QPair *refDataPair = lookupRefDataVec + itemIndex; if (refDataPair->first == false || referenced) { // test whether data is referenced available return refDataPair->second != 0; } } } return false; } template void CDynRefBucket::reference(CDynRefBucket *ref) { clear(); refBucket = ref; while (refBucket != 0 && refBucket->refDataVec == 0) { refBucket = refBucket->refBucket; } if (refBucket) { itemSize = refBucket->itemSize; bucketSize = refBucket->bucketSize; } } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CDYNREFBUCKET_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CMemoryReleaser.cpp0000644000175000017500000000201512520551362023776 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CMemoryReleaser.h" namespace Konclude { namespace Utilities { CMemoryReleaser::CMemoryReleaser() { } CMemoryReleaser::~CMemoryReleaser() { } }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/0000755000175000017500000000000012613407262022162 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtList.cpp0000644000175000017500000000232212520551354024207 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTLIST_CPP #define KONCLUDE_UTILITIES_CONTAINER_CQTLIST_CPP #include "CQtList.h" namespace Konclude { namespace Utilities { namespace Container { #ifdef KONCLUDE_EMPLOY_QT_LIST_CONTAINER #endif // KONCLUDE_EMPLOY_QT_LIST_CONTAINER }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CQTLIST_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtHash.cpp0000644000175000017500000000231712520551354024163 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQHASH_CPP #define KONCLUDE_UTILITIES_CONTAINER_CQHASH_CPP #include "CQtHash.h" namespace Konclude { namespace Utilities { namespace Container { #ifdef KONCLUDE_EMPLOY_QT_HASH_CONTAINER #endif // KONCLUDE_EMPLOY_QT_HASH_CONTAINER }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CQHASH_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/ContainerSettings.h0000644000175000017500000001140212520551354025773 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CONTAINERSETTINGS #define KONCLUDE_UTILITIES_CONTAINER_CONTAINERSETTINGS // Library includes // Namespace includes // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes namespace Konclude { namespace Utilities { namespace Container { /*! * * \file ContainerSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CModelDataArray; class CModelDataLevelArray; // Konclude code configs #define KONCLUDE_CONTAINER_VECTOR_USE_QT_VECTOR_FOR_DEFAULT #define KONCLUDE_CONTAINER_LIST_USE_QT_LIST_FOR_DEFAULT #define KONCLUDE_CONTAINER_HASH_USE_QT_HASH_FOR_DEFAULT #define KONCLUDE_CONTAINER_SET_USE_QT_SET_FOR_DEFAULT #ifdef KONCLUDE_CONTAINER_VECTOR_USE_QT_VECTOR_FOR_DEFAULT #define KONCLUDE_EMPLOY_QT_VECTOR_CONTAINER #endif // KONCLUDE_CONTAINER_VECTOR_USE_QT_VECTOR_FOR_DEFAULT #ifdef KONCLUDE_CONTAINER_LIST_USE_QT_LIST_FOR_DEFAULT #define KONCLUDE_EMPLOY_QT_LIST_CONTAINER #endif // KONCLUDE_CONTAINER_LIST_USE_QT_LIST_FOR_DEFAULT #ifdef KONCLUDE_CONTAINER_SET_USE_QT_SET_FOR_DEFAULT #define KONCLUDE_EMPLOY_QT_SET_CONTAINER #endif // KONCLUDE_CONTAINER_SET_USE_QT_SET_FOR_DEFAULT #ifdef KONCLUDE_CONTAINER_HASH_USE_QT_HASH_FOR_DEFAULT #define KONCLUDE_EMPLOY_QT_HASH_CONTAINER #endif // KONCLUDE_CONTAINER_HASH_USE_QT_HASH_FOR_DEFAULT #define KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_HASH_CONTAINER #define KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_SET_CONTAINER #define KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_LIST_CONTAINER #define KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_MAP_CONTAINER // foreach macro definition analog to the foreach macro of qt class CForeachContainerIt {}; template class CForeachContainerItTemplate : public CForeachContainerIt { public: CForeachContainerItTemplate(const T& container) : it(container.begin()),itEnd(container.end()),breakCnt(0) { } mutable class T::const_iterator it, itEnd; mutable int breakCnt; inline bool condition() const { return !breakCnt++ && it != itEnd; } }; template inline CForeachContainerItTemplate createContainerItTemplate(const T& container) { return CForeachContainerItTemplate(container); } template inline const CForeachContainerItTemplate* getContainerItTemplate(const CForeachContainerIt* conItTemplate, const T& convertT) { return static_cast*>(conItTemplate); } #define FOREACHIT(variable, container) foreach(variable, container) /* #define FOREACHIT(variable, container) \ for (const CForeachContainerIt& conItTemplate(createContainerItTemplate(container)); \ getContainerItTemplate(&conItTemplate,container)->condition(); \ ++(getContainerItTemplate(&conItTemplate,container)->it)) \ for (variable = *((getContainerItTemplate(&conItTemplate,container)->it)); \ getContainerItTemplate(&conItTemplate,container)->breakCnt; \ --getContainerItTemplate(&conItTemplate,container)->breakCnt) */ #define FOREACHHASHIT(keyVariable, valueVariable, container) \ for (const CForeachContainerIt& conItTemplate(createContainerItTemplate(container)); \ getContainerItTemplate(&conItTemplate,container)->condition(); \ ++(getContainerItTemplate(&conItTemplate,container)->it)) \ for (keyVariable = ((getContainerItTemplate(&conItTemplate,container)->it)).key(); \ getContainerItTemplate(&conItTemplate,container)->breakCnt == 1; \ ++getContainerItTemplate(&conItTemplate,container)->breakCnt) \ for (valueVariable = ((getContainerItTemplate(&conItTemplate,container)->it)).value(); \ getContainerItTemplate(&conItTemplate,container)->breakCnt == 1; \ getContainerItTemplate(&conItTemplate,container)->breakCnt-=2) #define cForeach FOREACHIT #define cDeleteAll qDeleteAll }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // end KONCLUDE_UTILITIES_CONTAINER_CONTAINERSETTINGS Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CVector.h0000644000175000017500000000345712520551356023712 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CVECTOR_H #define KONCLUDE_UTILITIES_CONTAINER_CVECTOR_H // Library includes // Namespace includes #include "ContainerSettings.h" #ifdef KONCLUDE_CONTAINER_VECTOR_USE_QT_VECTOR_FOR_DEFAULT #include "CQtVector.h" #endif // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CVector #ifdef KONCLUDE_CONTAINER_VECTOR_USE_QT_VECTOR_FOR_DEFAULT : public CQtVector #endif { // public methods public: // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CVector.cpp" #endif // KONCLUDE_UTILITIES_CONTAINER_CVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CModelDataLevelArray.cpp0000644000175000017500000007404212520551354026620 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CModelDataLevelArray.h" namespace Konclude { namespace Utilities { namespace Container { CModelDataLevelArray::CModelDataLevelArray() : CModelDataArray() { for (qint64 i = 0; i < dataSize; ++i) { modelArray[i] = 0; } level = 0; } CModelDataLevelArray::CModelDataLevelArray(qint64 tagBegin, qint64 tagBegEndSize) : CModelDataArray(tagBegin,tagBegEndSize) { for (qint64 i = 0; i < dataSize; ++i) { modelArray[i] = 0; } } CModelDataLevelArray::~CModelDataLevelArray() { } CModelDataArray *CModelDataLevelArray::init(qint64 tagBegin, qint64 tagBegEndSize) { CModelDataArray::init(tagBegin,tagBegEndSize); for (qint64 i = 0; i < dataSize; ++i) { modelArray[i] = 0; } return this; } bool CModelDataLevelArray::isBaseLevel() { return tagSize == dataSize; } qint64 CModelDataLevelArray::getModelLevel() { return level; } CModelDataLevelArray *CModelDataLevelArray::setBounds(qint64 tagBegin, qint64 tagBegEndSize) { CModelDataArray::setBounds(tagBegin,tagBegEndSize); level = bitIndShift / log2DataSize; return this; } CModelDataArray **CModelDataLevelArray::getModelArray() { return modelArray; } CModelDataArray *CModelDataLevelArray::getNextModelArray(qint64 index) { return modelArray[index]; } CModelDataArray *CModelDataLevelArray::getBaseModel(qint64 beginTag) { CModelDataArray *modelData = getNextModelArray(getArrayIndex(beginTag)); if (modelData) { return modelData->getBaseModel(beginTag); } else { return 0; } } qint64 CModelDataLevelArray::getFirstFlagTag() { for (qint64 mask = 0x1, idx = 0; idx < dataSize; mask<<=1,++idx) { if ((mask & dataArray) != 0) { CModelDataArray *model = modelArray[idx]; return model->getFirstFlagTag(); } } return endTag; } qint64 CModelDataLevelArray::getLastFlagTag() { for (qint64 mask = Q_INT64_C(0x8000000000000000), idx = dataSize-1; idx >= 0; mask>>=1,--idx) { if ((mask & dataArray) != 0) { CModelDataArray *model = modelArray[idx]; return model->getLastFlagTag(); } } return begTag; } CModelDataArray *CModelDataLevelArray::setNextModelArray(qint64 index, CModelDataArray *nextModelDataArray) { modelArray[index] = nextModelDataArray; if (nextModelDataArray && nextModelDataArray->getDataArray() != 0) { setLevelFlagIndex(index,true); } else { setLevelFlagIndex(index,false); } return this; } CModelDataLevelArray *CModelDataLevelArray::setData(bool value) { CModelDataArray::setData(value); for (qint64 i = 0; i < dataSize; ++i) { CModelDataArray *modelData = modelArray[i]; if (modelData) { modelData->setData(value); } } return this; } CModelDataArray *CModelDataLevelArray::createNextModelArray(qint64 index, CDataArrayMemoryManager *modelMemMan) { CModelDataArray *modelData = modelArray[index]; if (!modelData && modelMemMan) { if (level <= 1) { modelData = modelMemMan->allocateModelDataArray(); } else { modelData = modelMemMan->allocateModelDataLevelArray(); } qint64 nextTagSize = tagSize/dataSize; qint64 nextBegTag = begTag + index*nextTagSize; modelData->init(nextBegTag,nextTagSize); modelArray[index] = modelData; } return modelData; } bool CModelDataLevelArray::setFlag(qint64 tag, bool flag, CDataArrayMemoryManager *modelMemMan) { if (flag) { CModelDataArray::setFlag(tag,flag); } if (begTag >= tag && tag < endTag) { qint64 index = (tag-begTag) >> bitIndShift; qint64 arrayIndex = index & bitIndMask; CModelDataArray *modelData = createNextModelArray(arrayIndex,modelMemMan); if (modelData->setFlag(tag,flag)) { if (modelData->getDataArray() == 0) { CModelDataArray::setLevelFlagIndex(arrayIndex,false); } return true; } } return false; } bool CModelDataLevelArray::setFlag(qint64 tag, bool flag) { if (begTag >= tag && tag < endTag) { if (flag) { CModelDataArray::setFlag(tag,flag); } qint64 index = (tag-begTag) >> bitIndShift; qint64 arrayIndex = index & bitIndMask; CModelDataArray *modelData = modelArray[arrayIndex]; if (modelData) { if (modelData->setFlag(tag,flag)) { if (modelData->getDataArray() == 0) { CModelDataArray::setFlag(tag,false); } return true; } } } return false; } bool CModelDataLevelArray::getFlag(qint64 tag) { if (begTag >= tag && tag < endTag) { qint64 index = (tag-begTag) >> bitIndShift; qint64 arrayIndex = index & bitIndMask; CModelDataArray *modelData = modelArray[arrayIndex]; if (modelData) { return modelData->getFlag(tag); } } return 0; } qint64 CModelDataLevelArray::getArrayIndex(qint64 tag) { qint64 index = (tag-begTag) >> bitIndShift; qint64 arrayIndex = index & bitIndMask; return arrayIndex; } CModelDataArray *CModelDataLevelArray::intersectWith(CModelDataArray *modelData, bool *flagModification) { return intersectWith(modelData,0,flagModification); } CModelDataArray *CModelDataLevelArray::unionWith(CModelDataArray *modelData, bool *flagModification) { return unionWith(modelData,0,flagModification); } bool CModelDataLevelArray::testHasIntersectBetween(CModelDataArray *modelData1, CModelDataArray *modelData2) { if (!modelData1 || !modelData2) { return false; } else { CModelDataLevelArray *modelDataLevel = dynamic_cast(modelData1); if (modelDataLevel) { modelData1->hasIntersectionWith(modelData2); } return modelData2->hasIntersectionWith(modelData1); } } bool CModelDataLevelArray::testIsSubsetBetween(CModelDataArray *modelData1, CModelDataArray *modelData2) { if (!modelData1) { return true; } else if (!modelData2) { return false; } else { CModelDataLevelArray *modelDataLevel = dynamic_cast(modelData1); if (modelDataLevel) { return modelData1->isSubsetFrom(modelData2); } else { return modelData2->isSuperSetTo(modelData1); } } } bool CModelDataLevelArray::isSubsetFrom(CModelDataArray *modelData) { if (dataArray == 0) { return true; } if (modelData) { qint64 modelDataArray = modelData->getDataArray(); if (modelDataArray == 0 && dataArray != 0) { return false; } qint64 modelDataBegTag = modelData->getBeginTag(); qint64 modelDataEndTag = modelData->getEndTag(); if (begTag <= modelDataBegTag && modelDataEndTag <= endTag) { qint64 modelDataTagSize = modelData->getTagSize(); if (tagSize == modelDataTagSize) { // modelData has the same interval as this qint64 dataArrayIntersection = dataArray & modelDataArray; if (dataArrayIntersection != dataArray) { return false; } else { // test possible subset if (isBaseLevel()) { return true; } else { CModelDataLevelArray *modelDataLevelArray = (CModelDataLevelArray *)modelData; for (qint64 i = 0, mask = 0x1; i < 64 && mask <= dataArrayIntersection; ++i,mask <<= 1) { if ((dataArrayIntersection & mask) != 0) { CModelDataArray *nextLevelModel = modelArray[i]; if (!nextLevelModel->isSubsetFrom(modelDataLevelArray->getNextModelArray(i))) { return false; } } } return true; } } } else { // modelData has a smaller interval than this if (modelDataArray != 0 && getLevelFlag(modelDataBegTag)) { qint64 arrayIndex = getArrayIndex(modelDataBegTag); if ((1<isSubsetFrom(modelData); } } } } else if (begTag >= modelDataBegTag && modelDataEndTag >= endTag) { // modelData has a larger interval than this CModelDataLevelArray *modelDataLevelArray = (CModelDataLevelArray *)modelData; qint64 arrayIndex = modelDataLevelArray->getArrayIndex(begTag); return isSubsetFrom(modelDataLevelArray->getNextModelArray(arrayIndex)); } } return false; } bool CModelDataLevelArray::isSuperSetTo(CModelDataArray *modelData) { if (modelData == 0) { return true; } if (modelData) { qint64 modelDataArray = modelData->getDataArray(); if (modelDataArray != 0 && dataArray == 0) { return false; } qint64 modelDataBegTag = modelData->getBeginTag(); qint64 modelDataEndTag = modelData->getEndTag(); if (begTag <= modelDataBegTag && modelDataEndTag <= endTag) { qint64 modelDataTagSize = modelData->getTagSize(); if (tagSize == modelDataTagSize) { // modelData has the same interval as this qint64 dataArrayIntersection = dataArray & modelDataArray; if (dataArrayIntersection != modelDataArray) { return false; } else { // test possible subset if (isBaseLevel()) { return true; } else { CModelDataLevelArray *modelDataLevelArray = (CModelDataLevelArray *)modelData; for (qint64 i = 0, mask = 0x1; i < 64 && mask <= dataArrayIntersection; ++i,mask <<= 1) { if ((dataArrayIntersection & mask) != 0) { CModelDataArray *nextLevelModel = modelArray[i]; if (!nextLevelModel->isSuperSetTo(modelDataLevelArray->getNextModelArray(i))) { return false; } } } return true; } } } else { // modelData has a smaller interval than this if (getLevelFlag(modelDataBegTag)) { qint64 arrayIndex = getArrayIndex(modelDataBegTag); // test modelData subset with next level CModelDataArray *nextLevelModel = modelArray[arrayIndex]; return nextLevelModel->isSuperSetTo(modelData); } } } else if (begTag >= modelDataBegTag && modelDataEndTag >= endTag) { // modelData has a larger interval than this CModelDataLevelArray *modelDataLevelArray = (CModelDataLevelArray *)modelData; qint64 arrayIndex = modelDataLevelArray->getArrayIndex(begTag); if ((1<getNextModelArray(arrayIndex)); } } } return false; } bool CModelDataLevelArray::hasIntersectionWith(CModelDataArray *modelData) { if (modelData) { qint64 modelDataBegTag = modelData->getBeginTag(); qint64 modelDataEndTag = modelData->getEndTag(); if (begTag <= modelDataBegTag && modelDataEndTag <= endTag) { qint64 modelDataTagSize = modelData->getTagSize(); if (tagSize == modelDataTagSize) { // modelData has the same interval as this qint64 modelDataArray = modelData->getDataArray(); qint64 dataArrayIntersection = dataArray & modelDataArray; if (dataArrayIntersection != 0) { // test possible intersections if (isBaseLevel()) { return true; } else { CModelDataLevelArray *modelDataLevelArray = (CModelDataLevelArray *)modelData; for (qint64 i = 0, mask = 0x1; i < 64 && mask <= dataArrayIntersection; ++i,mask <<= 1) { if ((dataArrayIntersection & mask) != 0) { CModelDataArray *nextLevelModel = modelArray[i]; if (nextLevelModel && nextLevelModel->hasIntersectionWith(modelDataLevelArray->getNextModelArray(i))) { return true; } } } } } } else { // modelData has a smaller interval than this qint64 modelDataArray = modelData->getDataArray(); if (modelDataArray != 0 && getLevelFlag(modelDataBegTag)) { qint64 arrayIndex = getArrayIndex(modelDataBegTag); // test modelData intersection with next level CModelDataArray *nextLevelModel = modelArray[arrayIndex]; if (nextLevelModel && nextLevelModel->hasIntersectionWith(modelData)) { return true; } } } } else if (begTag >= modelDataBegTag && modelDataEndTag >= endTag) { // modelData has a larger interval than this if (dataArray != 0) { CModelDataLevelArray *modelDataLevelArray = (CModelDataLevelArray *)modelData; qint64 arrayIndex = modelDataLevelArray->getArrayIndex(begTag); if (hasIntersectionWith(modelDataLevelArray->getNextModelArray(arrayIndex))) { return true; } } } } return false; } qint64 CModelDataLevelArray::countIntersectionWith(CModelDataArray *modelData) { qint64 inCount = 0; if (modelData) { qint64 modelDataBegTag = modelData->getBeginTag(); qint64 modelDataEndTag = modelData->getEndTag(); if (begTag <= modelDataBegTag && modelDataEndTag <= endTag) { qint64 modelDataTagSize = modelData->getTagSize(); if (tagSize == modelDataTagSize) { // modelData has the same interval as this qint64 modelDataArray = modelData->getDataArray(); qint64 dataArrayIntersection = dataArray & modelDataArray; if (dataArrayIntersection != 0) { // test possible intersections if (isBaseLevel()) { inCount = CModelDataArray::countIntersectionWith(modelData); } else { CModelDataLevelArray *modelDataLevelArray = (CModelDataLevelArray *)modelData; for (qint64 i = 0, mask = 0x1; i < 64 && mask <= dataArrayIntersection; ++i,mask <<= 1) { if ((dataArrayIntersection & mask) != 0) { CModelDataArray *nextLevelModel = modelArray[i]; if (nextLevelModel) { inCount += nextLevelModel->countIntersectionWith(modelDataLevelArray->getNextModelArray(i)); } } } } } } else { // modelData has a smaller interval than this qint64 modelDataArray = modelData->getDataArray(); if (modelDataArray != 0 && getLevelFlag(modelDataBegTag)) { qint64 arrayIndex = getArrayIndex(modelDataBegTag); // test modelData intersection with next level CModelDataArray *nextLevelModel = modelArray[arrayIndex]; if (nextLevelModel) { inCount += nextLevelModel->countIntersectionWith(modelData); } } } } else if (begTag >= modelDataBegTag && modelDataEndTag >= endTag) { // modelData has a larger interval than this if (dataArray != 0) { CModelDataLevelArray *modelDataLevelArray = (CModelDataLevelArray *)modelData; qint64 arrayIndex = modelDataLevelArray->getArrayIndex(begTag); inCount += countIntersectionWith(modelDataLevelArray->getNextModelArray(arrayIndex)); } } } return inCount; } qint64 CModelDataLevelArray::countFlags() { qint64 count = 0; if (!isBaseLevel()) { for (qint64 i = 0, mask = 0x1; i < 64; ++i,mask <<= 1) { if ((dataArray & mask) != 0) { CModelDataArray *modelArray = getNextModelArray(i); if (modelArray) { count += modelArray->countFlags(); } } } } else { count = CModelDataArray::countFlags(); } return count; } CModelDataArray *CModelDataLevelArray::intersectWith(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification) { if (modelData) { qint64 modelDataBegTag = modelData->getBeginTag(); qint64 modelDataEndTag = modelData->getEndTag(); if (begTag <= modelDataBegTag && modelDataEndTag <= endTag) { qint64 modelDataTagSize = modelData->getTagSize(); if (tagSize == modelDataTagSize) { // modelData has the same interval as this CModelDataArray::intersectWith(modelData,flagModification); if (!isBaseLevel()) { CModelDataLevelArray *modelDataLevelArray = (CModelDataLevelArray *)modelData; for (qint64 i = 0, mask = 0x1; i < 64; ++i,mask <<= 1) { CModelDataArray *nextLevelModel = modelArray[i]; if (nextLevelModel) { if ((dataArray & mask) != 0) { nextLevelModel->intersectWith(modelDataLevelArray->getNextModelArray(i),modelMemMan,flagModification); } else { // alternative is to remove next level data nextLevelModel->setData(false); } if (nextLevelModel->getDataArray() == 0) { setLevelFlagIndex(i,false); } } } } } else { // modelData has a smaller interval than this qint64 modelDataArray = modelData->getDataArray(); if (modelDataArray != 0) { if (getLevelFlag(modelDataBegTag)) { qint64 arrayIndex = getArrayIndex(modelDataBegTag); // intersect modelData with next level for (qint64 i = 0; i < 64; ++i) { if (i != arrayIndex) { CModelDataArray *nextLevelModel = modelArray[i]; // alternative is to remove next level data if (nextLevelModel) { nextLevelModel->setData(false); } } } CModelDataArray *nextLevelModel = modelArray[arrayIndex]; if (nextLevelModel) { nextLevelModel->intersectWith(modelData,modelMemMan,flagModification); setLevelData(false); setLevelFlagIndex(arrayIndex,nextLevelModel->getDataArray() != 0); } else { setLevelData(false); } } else { setData(false); } } } } else if (begTag >= modelDataBegTag && modelDataEndTag >= endTag) { // modelData has a larger interval than this CModelDataLevelArray *modelDataLevelArray = (CModelDataLevelArray *)modelData; qint64 arrayIndex = modelDataLevelArray->getArrayIndex(begTag); intersectWith(modelDataLevelArray->getNextModelArray(arrayIndex),modelMemMan,flagModification); } else { // modelData has another range than this // resulting in no intersection setData(false); } } else { setData(false); } return this; } CModelDataArray *CModelDataLevelArray::unionWith(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification) { if (modelData) { qint64 modelDataBegTag = modelData->getBeginTag(); qint64 modelDataEndTag = modelData->getEndTag(); if (begTag <= modelDataBegTag && modelDataEndTag <= endTag) { qint64 modelDataTagSize = modelData->getTagSize(); if (tagSize == modelDataTagSize) { // modelData has the same interval as this CModelDataArray::unionWith(modelData,flagModification); if (!isBaseLevel()) { CModelDataLevelArray *modelDataLevelArray = (CModelDataLevelArray *)modelData; for (qint64 i = 0, mask = 0x1; i < 64 && mask <= dataArray; ++i,mask <<= 1) { qint64 modelDataArray = modelDataLevelArray->getDataArray(); if ((modelDataArray & mask) != 0) { CModelDataArray *nextLevelModel = createNextModelArray(i,modelMemMan); if (nextLevelModel) { nextLevelModel->unionWith(modelDataLevelArray->getNextModelArray(i),modelMemMan,flagModification); } } } } } else { // modelData has a smaller interval than this qint64 modelDataArray = modelData->getDataArray(); if (modelDataArray != 0) { // intersect modelData with next level qint64 arrayIndex = getArrayIndex(modelDataBegTag); setLevelFlagIndex(arrayIndex,true); CModelDataArray *nextLevelModel = createNextModelArray(arrayIndex,modelMemMan); if (nextLevelModel) { nextLevelModel->unionWith(modelData,modelMemMan,flagModification); } } } } else if (begTag >= modelDataBegTag && modelDataEndTag >= endTag) { // modelData has a larger interval than this // executing this block produces mistakes, call extendModel before CModelDataLevelArray *modelDataLevelArray = (CModelDataLevelArray *)modelData; qint64 arrayIndex = modelDataLevelArray->getArrayIndex(begTag); this->unionWith(modelDataLevelArray->getNextModelArray(arrayIndex),modelMemMan,flagModification); } } return this; } CModelDataArray *CModelDataLevelArray::copyFrom(CModelDataArray *modelData, bool *flagModification) { return copyFrom(modelData,0,flagModification); } CModelDataArray *CModelDataLevelArray::copyFrom(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification) { if (modelData) { qint64 modelDataBegTag = modelData->getBeginTag(); qint64 modelDataEndTag = modelData->getEndTag(); if (begTag <= modelDataBegTag && modelDataEndTag <= endTag) { qint64 modelDataTagSize = modelData->getTagSize(); if (tagSize == modelDataTagSize) { // modelData has the same interval as this CModelDataArray::copyFrom(modelData,flagModification); if (!isBaseLevel()) { CModelDataLevelArray *modelDataLevelArray = (CModelDataLevelArray *)modelData; for (qint64 i = 0, mask = 0x1; i < 64 && mask <= dataArray; ++i,mask <<= 1) { CModelDataArray *nextLevelModel = modelArray[i]; if ((dataArray & mask) != 0) { nextLevelModel = createNextModelArray(i,modelMemMan); } if (nextLevelModel) { if ((dataArray & mask) != 0) { nextLevelModel->copyFrom(modelDataLevelArray->getNextModelArray(i),modelMemMan,flagModification); } else { // alternative is to remove next level data nextLevelModel->setData(false); } } } } } else { // modelData has a smaller interval than this qint64 modelDataArray = modelData->getDataArray(); setLevelData(false); if (modelDataArray != 0) { qint64 arrayIndex = getArrayIndex(modelDataBegTag); // intersect modelData with next level for (qint64 i = 0; i < 64; ++i) { if (i != arrayIndex) { CModelDataArray *nextLevelModel = modelArray[i]; // alternative is to remove next level data if (nextLevelModel) { nextLevelModel->setData(false); } } } CModelDataArray *nextLevelModel = createNextModelArray(arrayIndex,modelMemMan); nextLevelModel->copyFrom(modelData,modelMemMan,flagModification); if (nextLevelModel->getDataArray() != 0) { setLevelFlagIndex(arrayIndex,true); } } } } else if (begTag >= modelDataBegTag && modelDataEndTag >= endTag) { // modelData has a larger interval than this // executing this block produces mistakes, call extendModel before CModelDataLevelArray *modelDataLevelArray = (CModelDataLevelArray *)modelData; qint64 arrayIndex = modelDataLevelArray->getArrayIndex(begTag); copyFrom(modelDataLevelArray->getNextModelArray(arrayIndex),modelMemMan,flagModification); } else { // modelData has another range than this // executing this block produces mistakes, call extendModel before setData(false); } } else { setData(false); } return this; } bool CModelDataLevelArray::isFullConstructed() { for (qint64 i = 0; i < dataSize; ++i) { if (modelArray[i] == 0) { return false; } } for (qint64 i = 0; i < dataSize; ++i) { if (!modelArray[i]->isFullConstructed()) { return false; } } return true; } CModelDataArray *CModelDataLevelArray::extendModel(CModelDataArray *modelData, qint64 minTag, CDataArrayMemoryManager *modelMemMan) { if (!modelData) { modelData = modelMemMan->allocateModelDataArray(); qint64 extTagSize = dataSize; qint64 extBegTagDiff = minTag % extTagSize; qint64 extBegTag = minTag - extBegTagDiff; modelData->setBounds(extBegTag,extTagSize); } return extendModel(modelData,minTag,minTag,modelMemMan); } CModelDataArray *CModelDataLevelArray::extendModel(CModelDataArray *modelData, CModelDataArray *minModelDataExt, CDataArrayMemoryManager *modelMemMan) { if (minModelDataExt) { if (!modelData) { if (minModelDataExt->isBaseLevel()) { modelData = modelMemMan->allocateModelDataArray(); } else { modelData = modelMemMan->allocateModelDataLevelArray(); } modelData->init(minModelDataExt->getBeginTag(),minModelDataExt->getTagSize()); } return extendModel(modelData,minModelDataExt->getBeginTag(),minModelDataExt->getEndTag(),modelMemMan); } else { return modelData; } } CModelDataArray *CModelDataLevelArray::extendModel(CModelDataArray *modelData, qint64 minBegTag, qint64 minEndTag, CDataArrayMemoryManager *modelMemMan) { CModelDataArray *extendedModel = modelData; //for (qint64 i = 0; i < 64; ++i) { // if (!extendedModel->isBaseLevel()) { // if (((CModelDataLevelArray *)extendedModel)->getNextModelArray(i) == extendedModel) { // bool bug = true; // } // } //} qint64 nBegTag = extendedModel->getBeginTag(); while (minBegTag < nBegTag) { CModelDataLevelArray *nextModelExtension = modelMemMan->allocateModelDataLevelArray(); //if (nextModelExtension == extendedModel) { // bool bug = true; //} qint64 extTagSize = extendedModel->getTagSize() * dataSize; qint64 extBegTagDiff = nBegTag % extTagSize; qint64 extBegTag = nBegTag - extBegTagDiff; nextModelExtension->init(extBegTag,extTagSize); qint64 arrayIndex = nextModelExtension->getArrayIndex(nBegTag); nextModelExtension->setNextModelArray(arrayIndex,extendedModel); extendedModel = nextModelExtension; nBegTag = extendedModel->getBeginTag(); } //for (qint64 i = 0; i < 64; ++i) { // if (!extendedModel->isBaseLevel()) { // if (((CModelDataLevelArray *)extendedModel)->getNextModelArray(i) == extendedModel) { // bool bug = true; // } // } //} nBegTag = extendedModel->getBeginTag(); qint64 nEndTag = extendedModel->getEndTag(); while (minEndTag > nEndTag) { CModelDataLevelArray *nextModelExtension = modelMemMan->allocateModelDataLevelArray(); //if (nextModelExtension == extendedModel) { // bool bug = true; //} qint64 extTagSize = extendedModel->getTagSize() * dataSize; qint64 extBegTagDiff = nBegTag % extTagSize; qint64 extBegTag = nBegTag - extBegTagDiff; nextModelExtension->init(extBegTag,extTagSize); qint64 arrayIndex = nextModelExtension->getArrayIndex(nBegTag); nextModelExtension->setNextModelArray(arrayIndex,extendedModel); extendedModel = nextModelExtension; nBegTag = extendedModel->getBeginTag(); nEndTag = extendedModel->getEndTag(); } //for (qint64 i = 0; i < 64; ++i) { // if (!extendedModel->isBaseLevel()) { // if (((CModelDataLevelArray *)extendedModel)->getNextModelArray(i) == extendedModel) { // bool bug = true; // } // } //} return extendedModel; } CModelDataArray *CModelDataLevelArray::reduceModel(CModelDataArray *modelData) { if (modelData) { qint64 modelDataArray = modelData->getDataArray(); if (modelDataArray == 0) { return 0; } else { if (modelData->isBaseLevel()) { return modelData; } qint64 onlyInd = -1; for (qint64 i = 0, mask = 0x1; i < 64; ++i,mask <<= 1) { if ((modelDataArray & mask) != 0) { if (onlyInd != -1) { return modelData; } else { onlyInd = i; } } } CModelDataArray *reducedModelData = ((CModelDataLevelArray *)modelData)->getNextModelArray(onlyInd); reducedModelData = reduceModel(reducedModelData); return reducedModelData; } } return 0; } CModelDataArray *CModelDataLevelArray::extendAndUnionModelWith(CModelDataArray *modelData, CModelDataArray *minModelDataExt, CDataArrayMemoryManager *modelMemMan, bool *flagModification) { modelData = extendModel(modelData,minModelDataExt,modelMemMan); if (modelData) { modelData->unionWith(minModelDataExt,modelMemMan,flagModification); } return modelData; } CModelDataArray *CModelDataLevelArray::extendAndCopyModelFrom(CModelDataArray *modelData, CModelDataArray *minModelDataExt, CDataArrayMemoryManager *modelMemMan, bool *flagModification) { modelData = extendModel(modelData,minModelDataExt,modelMemMan); if (modelData) { modelData->copyFrom(minModelDataExt,modelMemMan,flagModification); modelData = reduceModel(modelData); } return modelData; } CModelDataArray *CModelDataLevelArray::reduceAndIntersecModelWith(CModelDataArray *modelData, CModelDataArray *minModelDataExt, CDataArrayMemoryManager *modelMemMan, bool *flagModification) { if (modelData) { modelData->intersectWith(minModelDataExt,modelMemMan,flagModification); modelData = reduceModel(modelData); } return modelData; } CModelDataArray *CModelDataLevelArray::extendAndSetFlag(CModelDataArray *modelData, qint64 tag, CDataArrayMemoryManager *modelMemMan, bool *flagModification) { modelData = extendModel(modelData,tag,modelMemMan); if (!modelData->getFlag(tag)) { modelData->setFlag(tag,true,modelMemMan); if (flagModification) { *flagModification = true; } } return modelData; } }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationList.cpp0000644000175000017500000005473312520551354032060 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONLIST_CPP #define KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONLIST_CPP #include "CQtManagedRestrictedModificationList.h" namespace Konclude { namespace Utilities { namespace Container { #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_LIST_CONTAINER #if defined(Q_CC_BOR) template Q_INLINE_TEMPLATE T &CQtManagedRestrictedModificationList::Node::t() { return QTypeInfo::isLarge || QTypeInfo::isStatic ? *(T*)v:*(T*)this; } #endif template Q_INLINE_TEMPLATE void CQtManagedRestrictedModificationList::node_construct(Node *n, const T &t) { //if (QTypeInfo::isLarge || QTypeInfo::isStatic) n->v = new T(t); //else if (QTypeInfo::isComplex) new (n) T(t); if (QTypeInfo::isLarge || QTypeInfo::isStatic) { n->v = CObjectAllocator::allocate(mMemMan); new (n->v) T(t); } else if (QTypeInfo::isComplex) new (n) T(t); #if (defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__IBMCPP__)) && !defined(__OPTIMIZE__) // This violates pointer aliasing rules, but it is known to be safe (and silent) // in unoptimized GCC builds (-fno-strict-aliasing). The other compilers which // set the same define are assumed to be safe. else *reinterpret_cast(n) = t; #else // This is always safe, but penaltizes unoptimized builds a lot. else ::memcpy(n, &t, sizeof(T)); #endif } template Q_INLINE_TEMPLATE void CQtManagedRestrictedModificationList::node_destruct(Node *n) { if (QTypeInfo::isLarge || QTypeInfo::isStatic) { //delete reinterpret_cast(n->v); T* ob = reinterpret_cast(n->v); CObjectAllocator::destroyAndRelease(ob,mMemMan); } else if (QTypeInfo::isComplex) reinterpret_cast(n)->~T(); } template Q_INLINE_TEMPLATE void CQtManagedRestrictedModificationList::node_copy(Node *from, Node *to, Node *src) { Node *current = from; if (QTypeInfo::isLarge || QTypeInfo::isStatic) { QT_TRY { while(current != to) { //current->v = new T(*reinterpret_cast(src->v)); current->v = CObjectAllocator::allocate(mMemMan); new (current->v) T(*reinterpret_cast(src->v)); ++current; ++src; } } QT_CATCH(...) { while (current-- != from) { //delete reinterpret_cast(current->v); T* ob = reinterpret_cast(current->v); CObjectAllocator::destroyAndRelease(ob,mMemMan); } QT_RETHROW; } } else if (QTypeInfo::isComplex) { QT_TRY { while(current != to) { new (current) T(*reinterpret_cast(src)); ++current; ++src; } } QT_CATCH(...) { while (current-- != from) (reinterpret_cast(current))->~T(); QT_RETHROW; } } else { if (src != from && to - from > 0) memcpy(from, src, (to - from) * sizeof(Node *)); } } template Q_INLINE_TEMPLATE void CQtManagedRestrictedModificationList::node_destruct(Node *from, Node *to) { if (QTypeInfo::isLarge || QTypeInfo::isStatic) while(from != to) { --to; //delete reinterpret_cast(to->v); T* ob = reinterpret_cast(to->v); CObjectAllocator::destroyAndRelease(ob,mMemMan); } else if (QTypeInfo::isComplex) while (from != to) --to, reinterpret_cast(to)->~T(); } template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationList &CQtManagedRestrictedModificationList::operator=(const CQtManagedRestrictedModificationList &l) { if (d != l.d) { //l.d->ref.ref(); //if (!d->ref.deref()) // free(d); //d = l.d; //if (!d->sharable) // detach_helper(); if (d->refList == this) free(d); d = l.d; if (!d->sharable) detach_helper(); } return *this; } template CQtManagedRestrictedModificationList* CQtManagedRestrictedModificationList::init(CContext* context) { clear(); mContext = context; mMemMan = CContext::getMemoryAllocationManager(mContext); return this; } template CQtManagedRestrictedModificationList* CQtManagedRestrictedModificationList::init(const CQtManagedRestrictedModificationList &other, CContext* context) { if (d != other.d) { if (d->refList == this) free(d); mContext = context; mMemMan = CContext::getMemoryAllocationManager(mContext); d = other.d; if (!d->sharable) detach_helper(); } mContext = context; mMemMan = CContext::getMemoryAllocationManager(mContext); return this; } template CQtManagedRestrictedModificationList* CQtManagedRestrictedModificationList::init(const CQtManagedRestrictedModificationList *other, CContext* context) { if (!other) { if (d != other->d) { if (d->refList == this) free(d); mContext = context; mMemMan = CContext::getMemoryAllocationManager(mContext); if (other) { d = other->d; if (!d->sharable) detach_helper(); } } } else { if (d->refList == this) free(d); d = &CQtManagedRestrictedModificationListData::shared_null; } mContext = context; mMemMan = CContext::getMemoryAllocationManager(mContext); return this; } template inline typename CQtManagedRestrictedModificationList::iterator CQtManagedRestrictedModificationList::insert(iterator before, const T &t) { int iBefore = int(before.i - reinterpret_cast(p.begin())); Node *n = reinterpret_cast(p.insert(iBefore,mMemMan)); QT_TRY { node_construct(n, t); } QT_CATCH(...) { p.remove(iBefore); QT_RETHROW; } return n; } template inline typename CQtManagedRestrictedModificationList::iterator CQtManagedRestrictedModificationList::erase(iterator it) { node_destruct(it.i); return reinterpret_cast(p.erase(reinterpret_cast(it.i))); } template inline const T &CQtManagedRestrictedModificationList::at(int i) const { Q_ASSERT_X(i >= 0 && i < p.size(), "CQtManagedRestrictedModificationList::at", "index out of range"); return reinterpret_cast(p.at(i))->t(); } template inline const T &CQtManagedRestrictedModificationList::operator[](int i) const { Q_ASSERT_X(i >= 0 && i < p.size(), "CQtManagedRestrictedModificationList::operator[]", "index out of range"); return reinterpret_cast(p.at(i))->t(); } template inline T &CQtManagedRestrictedModificationList::operator[](int i) { Q_ASSERT_X(i >= 0 && i < p.size(), "CQtManagedRestrictedModificationList::operator[]", "index out of range"); detach(); return reinterpret_cast(p.at(i))->t(); } template inline void CQtManagedRestrictedModificationList::removeAt(int i) { if(i >= 0 && i < p.size()) { detach(); node_destruct(reinterpret_cast(p.at(i))); p.remove(i); } } template inline T CQtManagedRestrictedModificationList::takeAt(int i) { Q_ASSERT_X(i >= 0 && i < p.size(), "CQtManagedRestrictedModificationList::take", "index out of range"); detach(); Node *n = reinterpret_cast(p.at(i)); T t = n->t(); node_destruct(n); p.remove(i); return t; } template inline T CQtManagedRestrictedModificationList::takeFirst() { T t = first(); removeFirst(); return t; } template inline T CQtManagedRestrictedModificationList::takeLast() { T t = last(); removeLast(); return t; } template Q_OUTOFLINE_TEMPLATE void CQtManagedRestrictedModificationList::reserve(int alloc) { if (d->alloc < alloc) { //if (d->ref != 1) if (d->refList != this) detach_helper(alloc); else p.realloc(alloc,mMemMan); } } template Q_OUTOFLINE_TEMPLATE void CQtManagedRestrictedModificationList::append(const T &t) { //if (d->ref != 1) { if (d->refList != this) { Node *n = detach_helper_grow(INT_MAX, 1); QT_TRY { node_construct(n, t); } QT_CATCH(...) { --d->end; QT_RETHROW; } } else { if (QTypeInfo::isLarge || QTypeInfo::isStatic) { Node *n = reinterpret_cast(p.append(mMemMan)); QT_TRY { node_construct(n, t); } QT_CATCH(...) { --d->end; QT_RETHROW; } } else { Node *n, copy; node_construct(©, t); // t might be a reference to an object in the array QT_TRY { n = reinterpret_cast(p.append(mMemMan));; } QT_CATCH(...) { node_destruct(©); QT_RETHROW; } *n = copy; } } } template inline void CQtManagedRestrictedModificationList::prepend(const T &t) { //if (d->ref != 1) { if (d->refList != this) { Node *n = detach_helper_grow(0, 1); QT_TRY { node_construct(n, t); } QT_CATCH(...) { ++d->begin; QT_RETHROW; } } else { if (QTypeInfo::isLarge || QTypeInfo::isStatic) { Node *n = reinterpret_cast(p.prepend(mMemMan)); QT_TRY { node_construct(n, t); } QT_CATCH(...) { ++d->begin; QT_RETHROW; } } else { Node *n, copy; node_construct(©, t); // t might be a reference to an object in the array QT_TRY { n = reinterpret_cast(p.prepend(mMemMan));; } QT_CATCH(...) { node_destruct(©); QT_RETHROW; } *n = copy; } } } template inline void CQtManagedRestrictedModificationList::insert(int i, const T &t) { //if (d->ref != 1) { if (d->refList != this) { Node *n = detach_helper_grow(i, 1); QT_TRY { node_construct(n, t); } QT_CATCH(...) { p.remove(i); QT_RETHROW; } } else { if (QTypeInfo::isLarge || QTypeInfo::isStatic) { Node *n = reinterpret_cast(p.insert(i,mMemMan)); QT_TRY { node_construct(n, t); } QT_CATCH(...) { p.remove(i); QT_RETHROW; } } else { Node *n, copy; node_construct(©, t); // t might be a reference to an object in the array QT_TRY { n = reinterpret_cast(p.insert(i,mMemMan));; } QT_CATCH(...) { node_destruct(©); QT_RETHROW; } *n = copy; } } } template inline void CQtManagedRestrictedModificationList::replace(int i, const T &t) { Q_ASSERT_X(i >= 0 && i < p.size(), "CQtManagedRestrictedModificationList::replace", "index out of range"); detach(); reinterpret_cast(p.at(i))->t() = t; } template inline void CQtManagedRestrictedModificationList::swap(int i, int j) { Q_ASSERT_X(i >= 0 && i < p.size() && j >= 0 && j < p.size(), "CQtManagedRestrictedModificationList::swap", "index out of range"); detach(); void *t = d->array[d->begin + i]; d->array[d->begin + i] = d->array[d->begin + j]; d->array[d->begin + j] = t; } template inline void CQtManagedRestrictedModificationList::move(int from, int to) { Q_ASSERT_X(from >= 0 && from < p.size() && to >= 0 && to < p.size(), "CQtManagedRestrictedModificationList::move", "index out of range"); detach(); p.move(from, to); } template Q_OUTOFLINE_TEMPLATE CQtManagedRestrictedModificationList CQtManagedRestrictedModificationList::mid(int pos, int alength) const { if (alength < 0 || pos + alength > size()) alength = size() - pos; if (pos == 0 && alength == size()) return *this; CQtManagedRestrictedModificationList cpy; cpy.reserve(alength); cpy.d->end = alength; QT_TRY { cpy.node_copy(reinterpret_cast(cpy.p.begin()), reinterpret_cast(cpy.p.end()), reinterpret_cast(p.begin() + pos)); } QT_CATCH(...) { // restore the old end cpy.d->end = 0; QT_RETHROW; } return cpy; } template Q_OUTOFLINE_TEMPLATE T CQtManagedRestrictedModificationList::value(int i) const { if (i < 0 || i >= p.size()) { return T(); } return reinterpret_cast(p.at(i))->t(); } template Q_OUTOFLINE_TEMPLATE T CQtManagedRestrictedModificationList::value(int i, const T& defaultValue) const { return ((i < 0 || i >= p.size()) ? defaultValue : reinterpret_cast(p.at(i))->t()); } template Q_OUTOFLINE_TEMPLATE typename CQtManagedRestrictedModificationList::Node *CQtManagedRestrictedModificationList::detach_helper_grow(int i, int c) { Node *n = reinterpret_cast(p.begin()); CQtManagedRestrictedModificationListData::Data *x = p.detach_grow(&i, c,mMemMan,this); QT_TRY { node_copy(reinterpret_cast(p.begin()), reinterpret_cast(p.begin() + i), n); } QT_CATCH(...) { //qFree(d); CObjectAllocator::destroyAndRelease(d,mMemMan); d = x; QT_RETHROW; } QT_TRY { node_copy(reinterpret_cast(p.begin() + i + c), reinterpret_cast(p.end()), n + i); } QT_CATCH(...) { node_destruct(reinterpret_cast(p.begin()), reinterpret_cast(p.begin() + i)); //qFree(d); CObjectAllocator::destroyAndRelease(d,mMemMan); d = x; QT_RETHROW; } //if (!x->ref.deref()) if (d->refList == this) { free(x); } return reinterpret_cast(p.begin() + i); } template Q_OUTOFLINE_TEMPLATE void CQtManagedRestrictedModificationList::detach_helper(int alloc) { Node *n = reinterpret_cast(p.begin()); CQtManagedRestrictedModificationListData::Data *x = p.detach(alloc,mMemMan,this); QT_TRY { node_copy(reinterpret_cast(p.begin()), reinterpret_cast(p.end()), n); } QT_CATCH(...) { //qFree(d); CObjectAllocator::destroyAndRelease(d,mMemMan); d = x; QT_RETHROW; } //if (!x->ref.deref()) if (d->refList == this) { free(x); } } template Q_OUTOFLINE_TEMPLATE void CQtManagedRestrictedModificationList::detach_helper() { detach_helper(d->alloc); } template Q_OUTOFLINE_TEMPLATE CQtManagedRestrictedModificationList::~CQtManagedRestrictedModificationList() { //if (d && !d->ref.deref()) if (d && d->refList == this) free(d); } template Q_OUTOFLINE_TEMPLATE bool CQtManagedRestrictedModificationList::operator==(const CQtManagedRestrictedModificationList &l) const { if (p.size() != l.p.size()) return false; if (d == l.d) return true; Node *i = reinterpret_cast(p.end()); Node *b = reinterpret_cast(p.begin()); Node *li = reinterpret_cast(l.p.end()); while (i != b) { --i; --li; if (!(i->t() == li->t())) return false; } return true; } // ### Qt 5: rename freeData() to avoid confusion with std::free() template Q_OUTOFLINE_TEMPLATE void CQtManagedRestrictedModificationList::free(CQtManagedRestrictedModificationListData::Data *data) { node_destruct(reinterpret_cast(data->array + data->begin), reinterpret_cast(data->array + data->end)); //if (data->ref == 0) if (data->refList == this) //qFree(data); CObjectAllocator::destroyAndRelease(data,mMemMan); } template Q_OUTOFLINE_TEMPLATE void CQtManagedRestrictedModificationList::clear() { *this = CQtManagedRestrictedModificationList(mContext); } template Q_OUTOFLINE_TEMPLATE int CQtManagedRestrictedModificationList::removeAll(const T &_t) { detachShared(); const T t = _t; int removedCount=0, i=0; Node *n; while (i < p.size()) if ((n = reinterpret_cast(p.at(i)))->t() == t) { node_destruct(n); p.remove(i); ++removedCount; } else { ++i; } return removedCount; } template Q_OUTOFLINE_TEMPLATE bool CQtManagedRestrictedModificationList::removeOne(const T &_t) { detachShared(); int index = indexOf(_t); if (index != -1) { removeAt(index); return true; } return false; } template Q_OUTOFLINE_TEMPLATE typename CQtManagedRestrictedModificationList::iterator CQtManagedRestrictedModificationList::erase(typename CQtManagedRestrictedModificationList::iterator afirst, typename CQtManagedRestrictedModificationList::iterator alast) { for (Node *n = afirst.i; n < alast.i; ++n) node_destruct(n); int idx = afirst - begin(); p.remove(idx, alast - afirst); return begin() + idx; } template Q_OUTOFLINE_TEMPLATE CQtManagedRestrictedModificationList &CQtManagedRestrictedModificationList::operator+=(const CQtManagedRestrictedModificationList &l) { if (!l.isEmpty()) { if (isEmpty()) { *this = l; } else { //Node *n = (d->ref != 1) Node *n = (d->refList != this) ? detach_helper_grow(INT_MAX, l.size()) : reinterpret_cast(p.append2(l.p,mMemMan)); QT_TRY { node_copy(n, reinterpret_cast(p.end()), reinterpret_cast(l.p.begin())); } QT_CATCH(...) { // restore the old end d->end -= int(reinterpret_cast(p.end()) - n); QT_RETHROW; } } } return *this; } template inline void CQtManagedRestrictedModificationList::append(const CQtManagedRestrictedModificationList &t) { *this += t; } template Q_OUTOFLINE_TEMPLATE int CQtManagedRestrictedModificationList::indexOf(const T &t, int from) const { if (from < 0) from = qMax(from + p.size(), 0); if (from < p.size()) { Node *n = reinterpret_cast(p.at(from -1)); Node *e = reinterpret_cast(p.end()); while (++n != e) if (n->t() == t) return int(n - reinterpret_cast(p.begin())); } return -1; } template Q_OUTOFLINE_TEMPLATE int CQtManagedRestrictedModificationList::lastIndexOf(const T &t, int from) const { if (from < 0) from += p.size(); else if (from >= p.size()) from = p.size()-1; if (from >= 0) { Node *b = reinterpret_cast(p.begin()); Node *n = reinterpret_cast(p.at(from + 1)); while (n-- != b) { if (n->t() == t) return n - b; } } return -1; } template Q_OUTOFLINE_TEMPLATE bool CQtManagedRestrictedModificationList::contains(const T &t) const { Node *b = reinterpret_cast(p.begin()); Node *i = reinterpret_cast(p.end()); while (i-- != b) if (i->t() == t) return true; return false; } template Q_OUTOFLINE_TEMPLATE int CQtManagedRestrictedModificationList::count(const T &t) const { int c = 0; Node *b = reinterpret_cast(p.begin()); Node *i = reinterpret_cast(p.end()); while (i-- != b) if (i->t() == t) ++c; return c; } #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_LIST_CONTAINER }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONLIST_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationHash.cpp0000644000175000017500000005146012520551354032022 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONHASH_CPP #define KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONHASH_CPP #include "CQtManagedRestrictedModificationHash.h" namespace Konclude { namespace Utilities { namespace Container { #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_HASH_CONTAINER template Q_INLINE_TEMPLATE void CQtManagedRestrictedModificationHash::deleteNode(Node *node) { deleteNode2(reinterpret_cast(node)); d->freeNode(node,mMemMan); } template Q_INLINE_TEMPLATE void CQtManagedRestrictedModificationHash::deleteNode2(CQtManagedRestrictedModificationHashData::Node *node) { #ifdef Q_CC_BOR concrete(node)->~CQtManagedRestrictedModificationHashNode(); #elif defined(QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION) concrete(node)->~CQtManagedRestrictedModificationHashNode(); #else concrete(node)->~Node(); #endif } template Q_INLINE_TEMPLATE void CQtManagedRestrictedModificationHash::duplicateNode(CQtManagedRestrictedModificationHashData::Node *node, void *newNode) { Node *concreteNode = concrete(node); if (QTypeInfo::isDummy) { (void) new (newNode) DummyNode(concreteNode->key); } else { (void) new (newNode) Node(concreteNode->key, concreteNode->value); } } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationHash::Node * CQtManagedRestrictedModificationHash::createNode(uint ah, const Key &akey, const T &avalue, Node **anextNode) { Node *node; if (QTypeInfo::isDummy) { node = reinterpret_cast(new (d->allocateNode(alignOfDummyNode(),mMemMan)) DummyNode(akey)); } else { node = new (d->allocateNode(alignOfNode(),mMemMan)) Node(akey, avalue); } node->h = ah; node->next = *anextNode; *anextNode = node; ++d->size; return node; } template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationHash &CQtManagedRestrictedModificationHash::unite(const CQtManagedRestrictedModificationHash &other) { CQtManagedRestrictedModificationHash copy(other); const_iterator it = copy.constEnd(); while (it != copy.constBegin()) { --it; insertMulti(it.key(), it.value()); } return *this; } template Q_OUTOFLINE_TEMPLATE void CQtManagedRestrictedModificationHash::freeData(CQtManagedRestrictedModificationHashData *x) { x->free_helper(deleteNode2,mMemMan); } template Q_INLINE_TEMPLATE void CQtManagedRestrictedModificationHash::clear() { *this = CQtManagedRestrictedModificationHash(mContext); } template Q_OUTOFLINE_TEMPLATE void CQtManagedRestrictedModificationHash::detach_helper() { CQtManagedRestrictedModificationHashData *x = d->detach_helper2(duplicateNode, deleteNode2, QTypeInfo::isDummy ? sizeof(DummyNode) : sizeof(Node), QTypeInfo::isDummy ? alignOfDummyNode() : alignOfNode(),this,mMemMan); //if (!d->ref.deref()) if (d->refHash == this) freeData(d); d = x; } template Q_INLINE_TEMPLATE bool CQtManagedRestrictedModificationHash::copyRestricted_helper(CQtManagedRestrictedModificationHashData::Node *node, void* assistValue) { Node *concreteNode = concrete(node); return concreteNode->value.restrictedCopy(assistValue); } template Q_INLINE_TEMPLATE void CQtManagedRestrictedModificationHash::detach_helper_RestrictedCopy(void* assistValue) { CQtManagedRestrictedModificationHashData *x = d->restricted_detach_helper2(copyRestricted_helper,assistValue,duplicateNode, deleteNode2, QTypeInfo::isDummy ? sizeof(DummyNode) : sizeof(Node), QTypeInfo::isDummy ? alignOfDummyNode() : alignOfNode(),this,mMemMan); //if (!d->ref.deref()) if (d->refHash == this) freeData(d); d = x; } template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationHash &CQtManagedRestrictedModificationHash::operator=(const CQtManagedRestrictedModificationHash &other) { if (d != other.d) { //other.d->ref.ref(); //if (!d->ref.deref()) if (d->refHash == this) freeData(d); d = other.d; if (!d->sharable) detach_helper(); } return *this; } template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationHash* CQtManagedRestrictedModificationHash::init(const CQtManagedRestrictedModificationHash& other, CContext* context) { if (d != other.d) { if (d->refHash == this) freeData(d); mContext = context; mMemMan = CContext::getMemoryAllocationManager(mContext); d = other.d; if (!d->sharable) detach_helper(); } mContext = context; mMemMan = CContext::getMemoryAllocationManager(mContext); return this; } template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationHash* CQtManagedRestrictedModificationHash::init(CContext* context) { if (d->refHash == this) freeData(d); mContext = context; mMemMan = CContext::getMemoryAllocationManager(mContext); d = &CQtManagedRestrictedModificationHashData::shared_null; return this; } template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationHash* CQtManagedRestrictedModificationHash::init(CQtManagedRestrictedModificationHash* other, CContext* context) { if (other) { if (d != other->d) { if (d->refHash == this) freeData(d); mContext = context; mMemMan = CContext::getMemoryAllocationManager(mContext); if (other) { d = other->d; if (!d->sharable) detach_helper(); } } } else { if (d->refHash == this) freeData(d); d = &CQtManagedRestrictedModificationHashData::shared_null; } mContext = context; mMemMan = CContext::getMemoryAllocationManager(mContext); return this; } template Q_INLINE_TEMPLATE const T CQtManagedRestrictedModificationHash::value(const Key &akey) const { Node *node; if (d->size == 0 || (node = *findNode(akey)) == e) { return T(); } else { return node->value; } } template Q_INLINE_TEMPLATE T* CQtManagedRestrictedModificationHash::valuePointer(const Key& akey) const { Node *node; if (d->size == 0 || (node = *findNode(akey)) == e) { return nullptr; } else { return &node->value; } } template Q_INLINE_TEMPLATE const T CQtManagedRestrictedModificationHash::value(const Key &akey, const T &adefaultValue) const { Node *node; if (d->size == 0 || (node = *findNode(akey)) == e) { return adefaultValue; } else { return node->value; } } template Q_OUTOFLINE_TEMPLATE bool CQtManagedRestrictedModificationHash::tryGetValuePointer(const Key& akey, T*& valuePointer) const { Node *node; if (d->size == 0 || (node = *findNode(akey)) == e) { return false; } else { valuePointer = &node->value; return true; } } template Q_OUTOFLINE_TEMPLATE bool CQtManagedRestrictedModificationHash::tryGetValue(const Key& akey, T* value) const { Node *node; if (d->size == 0 || (node = *findNode(akey)) == e) { return false; } else { *value = node->value; return true; } } template Q_OUTOFLINE_TEMPLATE QList CQtManagedRestrictedModificationHash::uniqueKeys() const { QList res; const_iterator i = begin(); if (i != end()) { for (;;) { const Key &aKey = i.key(); res.append(aKey); do { if (++i == end()) goto break_out_of_outer_loop; } while (aKey == i.key()); } } break_out_of_outer_loop: return res; } template Q_OUTOFLINE_TEMPLATE QList CQtManagedRestrictedModificationHash::keys() const { QList res; const_iterator i = begin(); while (i != end()) { res.append(i.key()); ++i; } return res; } template Q_OUTOFLINE_TEMPLATE QList CQtManagedRestrictedModificationHash::keys(const T &avalue) const { QList res; const_iterator i = begin(); while (i != end()) { if (i.value() == avalue) res.append(i.key()); ++i; } return res; } template Q_OUTOFLINE_TEMPLATE const Key CQtManagedRestrictedModificationHash::key(const T &avalue) const { return key(avalue, Key()); } template Q_OUTOFLINE_TEMPLATE const Key CQtManagedRestrictedModificationHash::key(const T &avalue, const Key &defaultValue) const { const_iterator i = begin(); while (i != end()) { if (i.value() == avalue) return i.key(); ++i; } return defaultValue; } template Q_OUTOFLINE_TEMPLATE QList CQtManagedRestrictedModificationHash::values() const { QList res; const_iterator i = begin(); while (i != end()) { res.append(i.value()); ++i; } return res; } template Q_OUTOFLINE_TEMPLATE QList CQtManagedRestrictedModificationHash::values(const Key &akey) const { QList res; Node *node = *findNode(akey); if (node != e) { do { res.append(node->value); } while ((node = node->next) != e && node->key == akey); } return res; } template Q_OUTOFLINE_TEMPLATE CQtManagedRestrictedModificationList CQtManagedRestrictedModificationHash::uniqueKeysInManagedRestrictedModificationList(CContext* context) const { CQtManagedRestrictedModificationList res(context); const_iterator i = begin(); if (i != end()) { for (;;) { const Key &aKey = i.key(); res.append(aKey); do { if (++i == end()) goto break_out_of_outer_loop; } while (aKey == i.key()); } } break_out_of_outer_loop: return res; } template Q_OUTOFLINE_TEMPLATE CQtManagedRestrictedModificationList CQtManagedRestrictedModificationHash::keysInManagedRestrictedModificationList(CContext* context) const { CQtManagedRestrictedModificationList res(context); const_iterator i = begin(); while (i != end()) { res.append(i.key()); ++i; } return res; } template Q_OUTOFLINE_TEMPLATE CQtManagedRestrictedModificationList CQtManagedRestrictedModificationHash::keysInManagedRestrictedModificationList(const T &avalue, CContext* context) const { CQtManagedRestrictedModificationList res(context); const_iterator i = begin(); while (i != end()) { if (i.value() == avalue) res.append(i.key()); ++i; } return res; } template Q_OUTOFLINE_TEMPLATE CQtManagedRestrictedModificationList CQtManagedRestrictedModificationHash::valuesInManagedRestrictedModificationList(CContext* context) const { CQtManagedRestrictedModificationList res(context); const_iterator i = begin(); while (i != end()) { res.append(i.value()); ++i; } return res; } template Q_OUTOFLINE_TEMPLATE CQtManagedRestrictedModificationList CQtManagedRestrictedModificationHash::valuesInManagedRestrictedModificationList(const Key &akey, CContext* context) const { CQtManagedRestrictedModificationList res(context); Node *node = *findNode(akey); if (node != e) { do { res.append(node->value); } while ((node = node->next) != e && node->key == akey); } return res; } template Q_OUTOFLINE_TEMPLATE int CQtManagedRestrictedModificationHash::count(const Key &akey) const { int cnt = 0; Node *node = *findNode(akey); if (node != e) { do { ++cnt; } while ((node = node->next) != e && node->key == akey); } return cnt; } template Q_INLINE_TEMPLATE const T CQtManagedRestrictedModificationHash::operator[](const Key &akey) const { return value(akey); } template Q_INLINE_TEMPLATE T &CQtManagedRestrictedModificationHash::operator[](const Key &akey) { detach(); uint h; Node **node = findNode(akey, &h); if (*node == e) { if (d->willGrow(mMemMan)) node = findNode(akey, &h); return createNode(h, akey, T(), node)->value; } return (*node)->value; } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationHash::iterator CQtManagedRestrictedModificationHash::insert(const Key &akey, const T &avalue) { detach(); uint h; Node **node = findNode(akey, &h); if (*node == e) { if (d->willGrow(mMemMan)) node = findNode(akey, &h); return iterator(createNode(h, akey, avalue, node)); } if (!QTypeInfo::isDummy) (*node)->value = avalue; return iterator(*node); } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationHash::iterator CQtManagedRestrictedModificationHash::insertMulti(const Key &akey, const T &avalue) { detach(); d->willGrow(mMemMan); uint h; Node **nextNode = findNode(akey, &h); return iterator(createNode(h, akey, avalue, nextNode)); } template Q_OUTOFLINE_TEMPLATE int CQtManagedRestrictedModificationHash::remove(const Key &akey) { if (isEmpty()) // prevents detaching shared null return 0; detach(); int oldSize = d->size; Node **node = findNode(akey); if (*node != e) { bool deleteNext = true; do { Node *next = (*node)->next; deleteNext = (next != e && next->key == (*node)->key); deleteNode(*node); *node = next; --d->size; } while (deleteNext); d->hasShrunk(mMemMan); } return oldSize - d->size; } template Q_OUTOFLINE_TEMPLATE T CQtManagedRestrictedModificationHash::take(const Key &akey) { if (isEmpty()) // prevents detaching shared null return T(); detach(); Node **node = findNode(akey); if (*node != e) { T t = (*node)->value; Node *next = (*node)->next; deleteNode(*node); *node = next; --d->size; d->hasShrunk(mMemMan); return t; } return T(); } template Q_OUTOFLINE_TEMPLATE typename CQtManagedRestrictedModificationHash::iterator CQtManagedRestrictedModificationHash::erase(iterator it) { if (it == iterator(e)) return it; iterator ret = it; ++ret; Node *node = it; Node **node_ptr = reinterpret_cast(&d->buckets[node->h % d->numBuckets]); while (*node_ptr != node) node_ptr = &(*node_ptr)->next; *node_ptr = node->next; deleteNode(node); --d->size; return ret; } template Q_INLINE_TEMPLATE void CQtManagedRestrictedModificationHash::reserve(int asize) { detach(); d->rehash(-qMax(asize, 1),mMemMan); } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationHash::const_iterator CQtManagedRestrictedModificationHash::find(const Key &akey) const { return const_iterator(*findNode(akey)); } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationHash::const_iterator CQtManagedRestrictedModificationHash::constFind(const Key &akey) const { return const_iterator(*findNode(akey)); } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationHash::iterator CQtManagedRestrictedModificationHash::find(const Key &akey) { detach(); return iterator(*findNode(akey)); } template Q_INLINE_TEMPLATE bool CQtManagedRestrictedModificationHash::contains(const Key &akey) const { return *findNode(akey) != e; } template Q_OUTOFLINE_TEMPLATE typename CQtManagedRestrictedModificationHash::Node **CQtManagedRestrictedModificationHash::findNode(const Key &akey, uint *ahp) const { Node **node; uint h = qHash(akey); if (d->numBuckets) { node = reinterpret_cast(&d->buckets[h % d->numBuckets]); Q_ASSERT(*node == e || (*node)->next); while (*node != e && !(*node)->same_key(h, akey)) node = &(*node)->next; } else { node = const_cast(reinterpret_cast(&e)); } if (ahp) *ahp = h; return node; } template Q_OUTOFLINE_TEMPLATE bool CQtManagedRestrictedModificationHash::operator==(const CQtManagedRestrictedModificationHash &other) const { if (size() != other.size()) return false; if (d == other.d) return true; const_iterator it = begin(); while (it != end()) { const Key &akey = it.key(); const_iterator it2 = other.find(akey); do { if (it2 == other.end() || !(it2.key() == akey)) return false; if (!QTypeInfo::isDummy && !(it.value() == it2.value())) return false; ++it; ++it2; } while (it != end() && it.key() == akey); } return true; } #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_HASH_CONTAINER }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONHASH_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationMapBase.h0000644000175000017500000000724112520551356032114 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONMAPBASE_H #define KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONMAPBASE_H // Namespace includes #include "ContainerSettings.h" #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_MAP_CONTAINER // Library includes #include // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CQtManagedRestrictedModificationMapBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtManagedRestrictedModificationMapBase { }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_MAP_CONTAINER #endif // KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONMAPBASE_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtHash.h0000644000175000017500000000532412520551354023631 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTHASH_H #define KONCLUDE_UTILITIES_CONTAINER_CQTHASH_H // Namespace includes #include "ContainerSettings.h" #ifdef KONCLUDE_EMPLOY_QT_HASH_CONTAINER // Library includes #include // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Utilities { namespace Container { /*! * * \class CQtHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CQtHash : public QHash { // public methods public: inline CQtHash() : QHash() {} inline CQtHash(CContext* context) : QHash() {} inline CQtHash(const CQtHash &other) : QHash(other) {} inline CQtHash(const CQtHash &other, CContext* context) : QHash(other) {} inline CQtHash(const QHash &other) : QHash(other) {} inline CQtHash(const QHash &other, CContext* context) : QHash(other) {} inline CQtHash* init(CContext* context = 0) { QHash::clear(); return this; } inline CQtHash* init(const CQtHash &other, CContext* context = 0) { this->operator =(other); return this; } inline CQtHash* init(const CQtHash *other, CContext* context = 0) { if (other) { this->operator =(*other); } else { QHash::clear(); } return this; } // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CQtHash.cpp" #endif // KONCLUDE_EMPLOY_QT_HASH_CONTAINER #endif // KONCLUDE_UTILITIES_CONTAINER_CQTHASH_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CNegLinker.h0000644000175000017500000000515612520551354024322 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CNEGLINKER_H #define KONCLUDE_UTILITIES_CONTAINER_CNEGLINKER_H // Namespace includes #include "ContainerSettings.h" #include "CLinker.h" #include "CNegator.h" // Library includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CNegLinkerBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CNegLinkerBase : public CLinkerBase, public CNegator { // public methods public: // Constructor inline CNegLinkerBase(); inline CNegLinkerBase(const T& dataElement, bool negation = false, CNegLinkerBase* nextLink = nullptr); //! Destructor inline ~CNegLinkerBase(); inline S* initNegLinker(const T& dataElement, bool negation = false, CNegLinkerBase* nextLink = nullptr); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; /*! * * \class CNegLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CXNegLinker : public CNegLinkerBase > { // public methods public: // Constructor inline CXNegLinker() : CNegLinkerBase >() {} inline CXNegLinker(const T& dataElement, bool negation = false, CXNegLinker* nextLink = nullptr) : CNegLinkerBase >(dataElement,negation,nextLink) {} //! Destructor inline ~CXNegLinker() {} }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CNegLinker.cpp" #endif // KONCLUDE_UTILITIES_CONTAINER_CNEGLINKER_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationMapData.cppKonclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationMapData.cp0000644000175000017500000002332112520551356032263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #include "CQtManagedRestrictedModificationMapData.h" namespace Konclude { namespace Utilities { namespace Container { #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_MAP_CONTAINER CQtManagedRestrictedModificationMapData CQtManagedRestrictedModificationMapData::shared_null = { &shared_null, { &shared_null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*Q_BASIC_ATOMIC_INITIALIZER(1)*/nullptr, 0, 0, 0, false, true, false, 0 }; CQtManagedRestrictedModificationMapData *CQtManagedRestrictedModificationMapData::createData(CQtManagedRestrictedModificationMapBase* referenceMap, CMemoryAllocationManager* memMan) { return createData(0,referenceMap,memMan); } CQtManagedRestrictedModificationMapData *CQtManagedRestrictedModificationMapData::createData(int alignment, CQtManagedRestrictedModificationMapBase* referenceMap, CMemoryAllocationManager* memMan) { CQtManagedRestrictedModificationMapData *d = CObjectAllocator::allocateAndConstruct(memMan); //CMemoryAllocator::allocateMemory(memMan,sizeof(CQtManagedRestrictedModificationMapData)); //CQtManagedRestrictedModificationMapData *d = CMemoryAllocator::allocateMemory(memMan,sizeof(CQtManagedRestrictedModificationMapData)); //CQtManagedRestrictedModificationMapData *d = new CQtManagedRestrictedModificationMapData; Q_CHECK_PTR(d); Node *e = reinterpret_cast(d); e->backward = e; e->forward[0] = e; //d->ref = 1; d->refMap = referenceMap; d->topLevel = 0; d->size = 0; d->randomBits = 0; d->insertInOrder = false; d->sharable = true; d->strictAlignment = alignment > 8; d->reserved = 0; return d; } void CQtManagedRestrictedModificationMapData::continueFreeData(int offset, CMemoryAllocationManager* memMan) { Node *e = reinterpret_cast(this); Node *cur = e->forward[0]; Node *prev; while (cur != e) { prev = cur; cur = cur->forward[0]; if (strictAlignment) //qFreeAligned(reinterpret_cast(prev) - offset); CMemoryAllocator::releaseAlignedMemory(reinterpret_cast(prev) - offset,memMan); else //qFree(reinterpret_cast(prev) - offset); CMemoryAllocator::releaseMemory(reinterpret_cast(prev) - offset,memMan); } CObjectAllocator::release(this,memMan); //delete this; } CQtManagedRestrictedModificationMapData::Node *CQtManagedRestrictedModificationMapData::node_create(Node *update[], int offset, CMemoryAllocationManager* memMan) { return node_create(update, offset, 0, memMan); } /*! Creates a new node inside the data structure. \a update is an array with pointers to the node after which the new node should be inserted. Because of the strange skip list data structure there could be several pointers to this node on different levels. \a offset is an amount of bytes that needs to reserved just before the CQtManagedRestrictedModificationMapData::Node structure. \a alignment dictates the alignment for the data. \internal \since 4.6 */ CQtManagedRestrictedModificationMapData::Node *CQtManagedRestrictedModificationMapData::node_create(Node *update[], int offset, int alignment, CMemoryAllocationManager* memMan) { int level = 0; uint mask = (1 << Sparseness) - 1; while ((randomBits & mask) == mask && level < LastLevel) { ++level; mask <<= Sparseness; } if (level > topLevel) { Node *e = reinterpret_cast(this); level = ++topLevel; e->forward[level] = e; update[level] = e; } ++randomBits; if (level == 3 && !insertInOrder) randomBits = qrand(); //void *concreteNode = strictAlignment ? // qMallocAligned(offset + sizeof(Node) + level * sizeof(Node *), alignment) : // qMalloc(offset + sizeof(Node) + level * sizeof(Node *)); void *concreteNode = strictAlignment ? CMemoryAllocator::allocateAlignedMemory(memMan,offset + sizeof(Node) + level * sizeof(Node *), alignment) : CMemoryAllocator::allocateMemory(memMan,offset + sizeof(Node) + level * sizeof(Node *)); Q_CHECK_PTR(concreteNode); Node *abstractNode = reinterpret_cast(reinterpret_cast(concreteNode) + offset); abstractNode->backward = update[0]; update[0]->forward[0]->backward = abstractNode; for (int i = level; i >= 0; i--) { abstractNode->forward[i] = update[i]->forward[i]; update[i]->forward[i] = abstractNode; update[i] = abstractNode; } ++size; return abstractNode; } void CQtManagedRestrictedModificationMapData::node_delete(Node *update[], int offset, Node *node, CMemoryAllocationManager* memMan) { node->forward[0]->backward = node->backward; for (int i = 0; i <= topLevel; ++i) { if (update[i]->forward[i] != node) break; update[i]->forward[i] = node->forward[i]; } --size; if (strictAlignment) //qFreeAligned(reinterpret_cast(node) - offset); CMemoryAllocator::releaseAlignedMemory(reinterpret_cast(node) - offset,memMan); else //qFree(reinterpret_cast(node) - offset); CMemoryAllocator::releaseMemory(reinterpret_cast(node) - offset,memMan); } #ifdef KONCLUDE_CQTMANAGEDRESTRICTEDMODIFICATIONMAP_DEBUG uint CQtManagedRestrictedModificationMapData::adjust_ptr(Node *node) { if (node == reinterpret_cast(this)) { return (uint)0xDEADBEEF; } else { return (uint)node; } } void CQtManagedRestrictedModificationMapData::dump() { qDebug("Map data (ref = %d, size = %d, randomBits = %#.8x)", int(ref), size, randomBits); QString preOutput; QVector output(topLevel + 1); Node *e = reinterpret_cast(this); QString str; str.sprintf(" %.8x", adjust_ptr(reinterpret_cast(this))); preOutput += str; Node *update[LastLevel + 1]; for (int i = 0; i <= topLevel; ++i) { str.sprintf("%d: [%.8x] -", i, adjust_ptr(reinterpret_cast(forward[i]))); output[i] += str; update[i] = reinterpret_cast(forward[i]); } Node *node = reinterpret_cast(forward[0]); while (node != e) { int level = 0; while (level < topLevel && update[level + 1] == node) ++level; str.sprintf(" %.8x", adjust_ptr(node)); preOutput += str; for (int i = 0; i <= level; ++i) { str.sprintf("-> [%.8x] -", adjust_ptr(node->forward[i])); output[i] += str; update[i] = node->forward[i]; } for (int j = level + 1; j <= topLevel; ++j) output[j] += QLatin1String("---------------"); node = node->forward[0]; } qDebug("%s", preOutput.ascii()); for (int i = 0; i <= topLevel; ++i) qDebug("%s", output[i].ascii()); } #endif #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_MAP_CONTAINER }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationHashBase.h0000644000175000017500000000725112520551354032261 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONHASHBASE_H #define KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONHASHBASE_H // Namespace includes #include "ContainerSettings.h" #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_HASH_CONTAINER // Library includes #include // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CQtManagedRestrictedModificationHashBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtManagedRestrictedModificationHashBase { }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_HASH_CONTAINER #endif // KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONHASHBASE_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CNegLinker.cpp0000644000175000017500000000341612520551354024652 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CNEGLINKER_CPP #define KONCLUDE_UTILITIES_CONTAINER_CNEGLINKER_CPP #include "CNegLinker.h" namespace Konclude { namespace Utilities { namespace Container { template CNegLinkerBase::CNegLinkerBase() : CLinkerBase() { } template CNegLinkerBase::CNegLinkerBase(const T& dataElement, bool negation, CNegLinkerBase* nextLink) : CLinkerBase(dataElement,nextLink),CNegator(negation) { } template CNegLinkerBase::~CNegLinkerBase() { } template S* CNegLinkerBase::initNegLinker(const T& dataElement, bool negation, CNegLinkerBase* nextLink) { CLinkerBase::initLinker(dataElement,nextLink); CNegator::initNeg(negation); return (S*)this; } }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CNEGLINKER_CPP ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationMapBase.cppKonclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationMapBase.cp0000644000175000017500000000573212520551356032272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #include "CQtManagedRestrictedModificationMapBase.h" namespace Konclude { namespace Utilities { namespace Container { }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CDataArrayMemoryManager.h0000644000175000017500000000362212520551352026772 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CDATAARRAYMEMORYMANAGER_H #define KONCLUDE_UTILITIES_CONTAINER_CDATAARRAYMEMORYMANAGER_H // Libraries includes // Namespace includes #include "ContainerSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CDataArrayMemoryManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataArrayMemoryManager { // public methods public: //! Constructor CDataArrayMemoryManager(); //! Destructor virtual ~CDataArrayMemoryManager(); virtual CModelDataArray *allocateModelDataArray() = 0; virtual CModelDataLevelArray *allocateModelDataLevelArray() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CDATAARRAYMEMORYMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CDynamicReferenceBucket.h0000644000175000017500000001204312520551352026774 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CDYNAMICREFERENCEBUCKET_H #define KONCLUDE_UTILITIES_CONTAINER_CDYNAMICREFERENCEBUCKET_H // Namespace includes #include "ContainerSettings.h" // Library includes // Other includes #include "Context/CContext.h" // Logger includes namespace Konclude { using namespace Context; namespace Utilities { namespace Container { /*! * * \class CDynamicReferenceBucketBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CDynamicReferenceBucketBase { // public methods public: //! Constructor inline CDynamicReferenceBucketBase(CContext* context = nullptr); //! Destructor inline ~CDynamicReferenceBucketBase(); inline void initBucket(cint64 bucketDepth, CDynamicReferenceBucketBase* referenceBucket = nullptr); inline const T getData(cint64 index, const T& defaultValue); inline const T getData(cint64 index, const T& defaultValue, bool* localFlag); inline const T getLocalData(cint64 index, const T& defaultValue); inline const T getReferenceData(cint64 index, const T& defaultValue); inline void setLocalData(cint64 index, const T& data); inline void setData(cint64 index, const T& data); inline bool hasLocalData(cint64 index); inline bool hasReferencedData(cint64 index); inline bool hasData(cint64 index); inline void installBucket(cint64 index, CDynamicReferenceBucketBase* bucket); // protected variables protected: union CBucketDataPair { T mData; CDynamicReferenceBucketBase* mBucket; }; struct CReferenceBucketDataPair { bool mReferenced; bool mUninitialized; CBucketDataPair mBucketData; }; // protected methods protected: inline cint64 getBucketIndex(cint64 index); inline cint64 getBucketIndex(cint64 index, CDynamicReferenceBucketBase* bucket); inline CDynamicReferenceBucketBase* getRelevantReferenceBucket(CDynamicReferenceBucketBase* bucket); inline CDynamicReferenceBucketBase* getUpdatedRelevantReferenceBucket(CDynamicReferenceBucketBase* bucket); inline CReferenceBucketDataPair* createBucketVector(CDynamicReferenceBucketBase* bucket, bool baseVector) { CReferenceBucketDataPair* refVector = nullptr; if (bucket) { refVector = bucket->mVec; } CReferenceBucketDataPair* vector = CObjectAllocator::allocateArray(mMemMan,BUCKETSIZE); for (cint64 ind = 0; ind < BUCKETSIZE; ++ind) { CReferenceBucketDataPair* refBucketDataPair = &vector[ind]; if (refVector) { if (baseVector) { refBucketDataPair->mReferenced = true; refBucketDataPair->mUninitialized = refVector[ind].mUninitialized; refBucketDataPair->mBucketData.mData = refVector[ind].mBucketData.mData; } else { refBucketDataPair->mReferenced = true; refBucketDataPair->mUninitialized = false; refBucketDataPair->mBucketData.mBucket = refVector[ind].mBucketData.mBucket; } } else { refBucketDataPair->mReferenced = false; refBucketDataPair->mUninitialized = true; refBucketDataPair->mBucketData.mBucket = nullptr; } } return vector; } inline CDynamicReferenceBucketBase* createBucket(cint64 bucketDepth, CReferenceBucketDataPair* bucketPos); // protected variables protected: CDynamicReferenceBucketBase* mReferenceBucket; CReferenceBucketDataPair* mVec; cint64 mBucketDepth; CContext* mContext; CMemoryAllocationManager* mMemMan; static const cint64 BUCKETSIZE = 2< { }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CDynamicReferenceBucket.cpp" #endif // KONCLUDE_UTILITIES_CONTAINER_CDYNAMICREFERENCEBUCKET_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CLinker.h0000644000175000017500000000604112520551354023662 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CLINKER_H #define KONCLUDE_UTILITIES_CONTAINER_CLINKER_H // Namespace includes #include "ContainerSettings.h" // Library includes // Other includes // Logger includes namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CLinkerBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CLinkerBase { // public methods public: //! Constructor inline CLinkerBase(); inline CLinkerBase(const T& dataElement, CLinkerBase* nextLink = nullptr); //! Destructor inline ~CLinkerBase(); inline S* initLinker(const T& dataElement, CLinkerBase* nextLink = nullptr); inline bool hasNext() const; inline S* insertNext(CLinkerBase* nextLink); inline S* getNext() const; inline S* clearNext(); inline S* setNext(CLinkerBase* nextLink); inline T& getData(); inline S* setData(const T& dataElement); inline S* append(CLinkerBase* appendingList); inline S* getRemovedNext(); inline S* getLastListLink() const; inline cint64 getCount() const; inline cint64 size() const; inline bool contains(const T& dataElement) const; inline S* removeOne(const T& dataElement); inline S* removeAll(const T& dataElement); // protected methods protected: // protected variables protected: CLinkerBase* next; T data; // private methods private: // private variables private: }; /*! * * \class CLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CXLinker : public CLinkerBase > { // public methods public: // Constructor inline CXLinker() : CLinkerBase >() {}; inline CXLinker(const T& dataElement, CLinkerBase >* nextLink = nullptr) : CLinkerBase >(dataElement,nextLink) {}; //! Destructor inline ~CXLinker() {}; }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CLinker.cpp" #endif // KONCLUDE_UTILITIES_CONTAINER_CLINKER_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationMap.cpp0000644000175000017500000006246212520551356031662 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONMAP_CPP #define KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONMAP_CPP #include "CQtManagedRestrictedModificationMap.h" namespace Konclude { namespace Utilities { namespace Container { #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_MAP_CONTAINER template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationMap &CQtManagedRestrictedModificationMap::operator=(const CQtManagedRestrictedModificationMap &other) { if (d != other.d) { //other.d->ref.ref(); //if (!d->ref.deref()) if (d->refMap == this) freeData(d); d = other.d; if (!d->sharable) detach_helper(); } return *this; } template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationMap* CQtManagedRestrictedModificationMap::init(const CQtManagedRestrictedModificationMap &other, CContext* context) { if (d != other.d) { //other.d->ref.ref(); //if (!d->ref.deref()) if (d->refMap == this) freeData(d); d = other.d; if (!d->sharable) detach_helper(); } mContext = context; mMemMan = CContext::getMemoryAllocationManager(mContext); return this; } template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationMap* CQtManagedRestrictedModificationMap::init(const CQtManagedRestrictedModificationMap* other, CContext* context) { if (other) { if (d != other->d) { //other.d->ref.ref(); //if (!d->ref.deref()) if (d->refMap == this) freeData(d); d = other->d; if (!d->sharable) detach_helper(); } } else { clear(); } mContext = context; mMemMan = CContext::getMemoryAllocationManager(mContext); return this; } template Q_INLINE_TEMPLATE bool CQtManagedRestrictedModificationMap::isKeySubSetOf(const CQtManagedRestrictedModificationMap* other, cint64 testDirectSubSetFactorCount) { if (count() > other->count()) { return false; } if (count() * testDirectSubSetFactorCount < other->count()) { for (const_iterator it = constBegin(),itEnd = constEnd(); it != itEnd; ++it) { const Key& key = it.key(); if (!other->contains(key)) { return false; } } } else { const_iterator itSub = constBegin(),itSubEnd = constEnd(); const_iterator itSuper = other->constBegin(),itSuperEnd = other->constEnd(); while (itSub != itSubEnd) { const Key& subKey = itSub.key(); if (itSuper == itSuperEnd) { return false; } const Key& superKey = itSuper.key(); if (superKey < subKey) { ++itSuper; } else if (subKey < superKey) { return false; } else { ++itSub; ++itSuper; } } } return true; } template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationMap* CQtManagedRestrictedModificationMap::init(CContext* context) { clear(); mContext = context; mMemMan = CContext::getMemoryAllocationManager(mContext); return this; } template Q_INLINE_TEMPLATE void CQtManagedRestrictedModificationMap::clear() { *this = CQtManagedRestrictedModificationMap(mContext); } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationMapData::Node * CQtManagedRestrictedModificationMap::node_create(CQtManagedRestrictedModificationMapData *adt, CQtManagedRestrictedModificationMapData::Node *aupdate[], const Key &akey, const T &avalue) { CQtManagedRestrictedModificationMapData::Node *abstractNode = adt->node_create(aupdate, payload(), alignment(), mMemMan); QT_TRY { Node *concreteNode = concrete(abstractNode); new (&concreteNode->key) Key(akey); QT_TRY { new (&concreteNode->value) T(avalue); } QT_CATCH(...) { concreteNode->key.~Key(); QT_RETHROW; } } QT_CATCH(...) { adt->node_delete(aupdate, payload(), abstractNode, mMemMan); QT_RETHROW; } // clean up the update array for further insertions /* for (int i = 0; i <= d->topLevel; ++i) { if ( aupdate[i]==reinterpret_cast(adt) || aupdate[i]->forward[i] != abstractNode) break; aupdate[i] = abstractNode; } */ return abstractNode; } template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationMapData::Node *CQtManagedRestrictedModificationMap::findNode(const Key &akey) const { CQtManagedRestrictedModificationMapData::Node *cur = e; CQtManagedRestrictedModificationMapData::Node *next = e; for (int i = d->topLevel; i >= 0; i--) { while ((next = cur->forward[i]) != e && cMapLessThanKey(concrete(next)->key, akey)) cur = next; } if (next != e && !cMapLessThanKey(akey, concrete(next)->key)) { return next; } else { return e; } } template Q_INLINE_TEMPLATE const T CQtManagedRestrictedModificationMap::value(const Key &akey) const { CQtManagedRestrictedModificationMapData::Node *node; if (d->size == 0 || (node = findNode(akey)) == e) { return T(); } else { return concrete(node)->value; } } template Q_INLINE_TEMPLATE const T CQtManagedRestrictedModificationMap::value(const Key &akey, const T &adefaultValue) const { CQtManagedRestrictedModificationMapData::Node *node; if (d->size == 0 || (node = findNode(akey)) == e) { return adefaultValue; } else { return concrete(node)->value; } } template Q_INLINE_TEMPLATE bool CQtManagedRestrictedModificationMap::tryGetValue(const Key &akey, T* value) const { CQtManagedRestrictedModificationMapData::Node *node; if (d->size == 0 || (node = findNode(akey)) == e) { return false; } else { *value = concrete(node)->value; return true; } } template Q_INLINE_TEMPLATE bool CQtManagedRestrictedModificationMap::tryGetValuePointer(const Key &akey, T*& valuePointer) const { CQtManagedRestrictedModificationMapData::Node *node; if (d->size == 0 || (node = findNode(akey)) == e) { return false; } else { valuePointer = &(concrete(node)->value); return true; } } template Q_INLINE_TEMPLATE const T CQtManagedRestrictedModificationMap::operator[](const Key &akey) const { return value(akey); } template Q_INLINE_TEMPLATE T &CQtManagedRestrictedModificationMap::operator[](const Key &akey) { detach(); CQtManagedRestrictedModificationMapData::Node *update[CQtManagedRestrictedModificationMapData::LastLevel + 1]; CQtManagedRestrictedModificationMapData::Node *node = mutableFindNode(update, akey); if (node == e) node = node_create(d, update, akey, T()); return concrete(node)->value; } template Q_INLINE_TEMPLATE int CQtManagedRestrictedModificationMap::count(const Key &akey) const { int cnt = 0; CQtManagedRestrictedModificationMapData::Node *node = findNode(akey); if (node != e) { do { ++cnt; node = node->forward[0]; } while (node != e && !cMapLessThanKey(akey, concrete(node)->key)); } return cnt; } template Q_INLINE_TEMPLATE bool CQtManagedRestrictedModificationMap::contains(const Key &akey) const { return findNode(akey) != e; } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationMap::iterator CQtManagedRestrictedModificationMap::insert(const Key &akey, const T &avalue) { detach(); CQtManagedRestrictedModificationMapData::Node *update[CQtManagedRestrictedModificationMapData::LastLevel + 1]; CQtManagedRestrictedModificationMapData::Node *node = mutableFindNode(update, akey); if (node == e) { node = node_create(d, update, akey, avalue); } else { concrete(node)->value = avalue; } return iterator(node); } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationMap::iterator CQtManagedRestrictedModificationMap::tryInsert(const Key &akey, const T &avalue, bool* containsAlready) { detach(); CQtManagedRestrictedModificationMapData::Node *update[CQtManagedRestrictedModificationMapData::LastLevel + 1]; CQtManagedRestrictedModificationMapData::Node *node = mutableFindNode(update, akey); if (node == e) { node = node_create(d, update, akey, avalue); if (containsAlready) { *containsAlready = false; } } else { if (containsAlready) { *containsAlready = true; } //concrete(node)->value = avalue; } return iterator(node); } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationMap::iterator CQtManagedRestrictedModificationMap::tryInsert(const Key &akey, const T &avalue, bool* containsAlready, T** containedValue) { detach(); CQtManagedRestrictedModificationMapData::Node *update[CQtManagedRestrictedModificationMapData::LastLevel + 1]; CQtManagedRestrictedModificationMapData::Node *node = mutableFindNode(update, akey); if (node == e) { node = node_create(d, update, akey, avalue); if (containsAlready) { *containsAlready = false; } } else { if (containsAlready) { *containsAlready = true; } //concrete(node)->value = avalue; } if (containedValue) { *containedValue = &concrete(node)->value; } return iterator(node); } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationMap::iterator CQtManagedRestrictedModificationMap::insertMulti(const Key &akey, const T &avalue) { detach(); CQtManagedRestrictedModificationMapData::Node *update[CQtManagedRestrictedModificationMapData::LastLevel + 1]; mutableFindNode(update, akey); return iterator(node_create(d, update, akey, avalue)); } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationMap::const_iterator CQtManagedRestrictedModificationMap::find(const Key &akey) const { return const_iterator(findNode(akey)); } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationMap::const_iterator CQtManagedRestrictedModificationMap::constFind(const Key &akey) const { return const_iterator(findNode(akey)); } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationMap::iterator CQtManagedRestrictedModificationMap::find(const Key &akey) { detach(); return iterator(findNode(akey)); } template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationMap &CQtManagedRestrictedModificationMap::unite(const CQtManagedRestrictedModificationMap &other) { CQtManagedRestrictedModificationMap copy(other); const_iterator it = copy.constEnd(); const const_iterator b = copy.constBegin(); while (it != b) { --it; insertMulti(it.key(), it.value()); } return *this; } template Q_OUTOFLINE_TEMPLATE void CQtManagedRestrictedModificationMap::freeData(CQtManagedRestrictedModificationMapData *x) { if (QTypeInfo::isComplex || QTypeInfo::isComplex) { CQtManagedRestrictedModificationMapData *cur = x; CQtManagedRestrictedModificationMapData *next = cur->forward[0]; while (next != x) { cur = next; next = cur->forward[0]; #if defined(_MSC_VER) && (_MSC_VER >= 1300) #pragma warning(disable:4189) #endif Node *concreteNode = concrete(reinterpret_cast(cur)); concreteNode->key.~Key(); concreteNode->value.~T(); #if defined(_MSC_VER) && (_MSC_VER >= 1300) #pragma warning(default:4189) #endif } } x->continueFreeData(payload(), mMemMan); } template Q_OUTOFLINE_TEMPLATE int CQtManagedRestrictedModificationMap::remove(const Key &akey) { detach(); CQtManagedRestrictedModificationMapData::Node *update[CQtManagedRestrictedModificationMapData::LastLevel + 1]; CQtManagedRestrictedModificationMapData::Node *cur = e; CQtManagedRestrictedModificationMapData::Node *next = e; int oldSize = d->size; for (int i = d->topLevel; i >= 0; i--) { while ((next = cur->forward[i]) != e && cMapLessThanKey(concrete(next)->key, akey)) cur = next; update[i] = cur; } if (next != e && !cMapLessThanKey(akey, concrete(next)->key)) { bool deleteNext = true; do { cur = next; next = cur->forward[0]; deleteNext = (next != e && !cMapLessThanKey(concrete(cur)->key, concrete(next)->key)); concrete(cur)->key.~Key(); concrete(cur)->value.~T(); d->node_delete(update, payload(), cur, mMemMan); } while (deleteNext); } return oldSize - d->size; } template Q_OUTOFLINE_TEMPLATE T CQtManagedRestrictedModificationMap::take(const Key &akey) { detach(); CQtManagedRestrictedModificationMapData::Node *update[CQtManagedRestrictedModificationMapData::LastLevel + 1]; CQtManagedRestrictedModificationMapData::Node *cur = e; CQtManagedRestrictedModificationMapData::Node *next = e; for (int i = d->topLevel; i >= 0; i--) { while ((next = cur->forward[i]) != e && cMapLessThanKey(concrete(next)->key, akey)) cur = next; update[i] = cur; } if (next != e && !cMapLessThanKey(akey, concrete(next)->key)) { T t = concrete(next)->value; concrete(next)->key.~Key(); concrete(next)->value.~T(); d->node_delete(update, payload(), next, mMemMan); return t; } return T(); } template Q_OUTOFLINE_TEMPLATE typename CQtManagedRestrictedModificationMap::iterator CQtManagedRestrictedModificationMap::erase(iterator it) { CQtManagedRestrictedModificationMapData::Node *update[CQtManagedRestrictedModificationMapData::LastLevel + 1]; CQtManagedRestrictedModificationMapData::Node *cur = e; CQtManagedRestrictedModificationMapData::Node *next = e; if (it == iterator(e)) return it; for (int i = d->topLevel; i >= 0; i--) { while ((next = cur->forward[i]) != e && cMapLessThanKey(concrete(next)->key, it.key())) cur = next; update[i] = cur; } while (next != e) { cur = next; next = cur->forward[0]; if (cur == it) { concrete(cur)->key.~Key(); concrete(cur)->value.~T(); d->node_delete(update, payload(), cur, mMemMan); return iterator(next); } for (int i = 0; i <= d->topLevel; ++i) { if (update[i]->forward[i] != cur) break; update[i] = cur; } } return end(); } template Q_OUTOFLINE_TEMPLATE void CQtManagedRestrictedModificationMap::detach_helper() { union { CQtManagedRestrictedModificationMapData *d; CQtManagedRestrictedModificationMapData::Node *e; } x; x.d = CQtManagedRestrictedModificationMapData::createData(alignment(), this, mMemMan); if (d->size) { x.d->insertInOrder = true; CQtManagedRestrictedModificationMapData::Node *update[CQtManagedRestrictedModificationMapData::LastLevel + 1]; CQtManagedRestrictedModificationMapData::Node *cur = e->forward[0]; update[0] = x.e; while (cur != e) { QT_TRY { Node *concreteNode = concrete(cur); node_create(x.d, update, concreteNode->key, concreteNode->value); } QT_CATCH(...) { freeData(x.d); QT_RETHROW; } cur = cur->forward[0]; } x.d->insertInOrder = false; } if (/*!d->ref.deref()*/ d->refMap == this) freeData(d); d = x.d; } template Q_OUTOFLINE_TEMPLATE CQtManagedRestrictedModificationMapData::Node *CQtManagedRestrictedModificationMap::mutableFindNode(CQtManagedRestrictedModificationMapData::Node *aupdate[], const Key &akey) const { CQtManagedRestrictedModificationMapData::Node *cur = e; CQtManagedRestrictedModificationMapData::Node *next = e; for (int i = d->topLevel; i >= 0; i--) { while ((next = cur->forward[i]) != e && cMapLessThanKey(concrete(next)->key, akey)) cur = next; aupdate[i] = cur; } if (next != e && !cMapLessThanKey(akey, concrete(next)->key)) { return next; } else { return e; } } template Q_OUTOFLINE_TEMPLATE QList CQtManagedRestrictedModificationMap::uniqueKeys() const { QList res; res.reserve(size()); // May be too much, but assume short lifetime const_iterator i = begin(); if (i != end()) { for (;;) { const Key &aKey = i.key(); res.append(aKey); do { if (++i == end()) goto break_out_of_outer_loop; } while (!(aKey < i.key())); // loop while (key == i.key()) } } break_out_of_outer_loop: return res; } template Q_OUTOFLINE_TEMPLATE QList CQtManagedRestrictedModificationMap::keys() const { QList res; res.reserve(size()); const_iterator i = begin(); while (i != end()) { res.append(i.key()); ++i; } return res; } template Q_OUTOFLINE_TEMPLATE QList CQtManagedRestrictedModificationMap::keys(const T &avalue) const { QList res; const_iterator i = begin(); while (i != end()) { if (i.value() == avalue) res.append(i.key()); ++i; } return res; } template Q_OUTOFLINE_TEMPLATE const Key CQtManagedRestrictedModificationMap::key(const T &avalue) const { return key(avalue, Key()); } template Q_OUTOFLINE_TEMPLATE const Key CQtManagedRestrictedModificationMap::key(const T &avalue, const Key &defaultKey) const { const_iterator i = begin(); while (i != end()) { if (i.value() == avalue) return i.key(); ++i; } return defaultKey; } template Q_OUTOFLINE_TEMPLATE QList CQtManagedRestrictedModificationMap::values() const { QList res; res.reserve(size()); const_iterator i = begin(); while (i != end()) { res.append(i.value()); ++i; } return res; } template Q_OUTOFLINE_TEMPLATE QList CQtManagedRestrictedModificationMap::values(const Key &akey) const { QList res; CQtManagedRestrictedModificationMapData::Node *node = findNode(akey); if (node != e) { do { res.append(concrete(node)->value); node = node->forward[0]; } while (node != e && !cMapLessThanKey(akey, concrete(node)->key)); } return res; } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationMap::const_iterator CQtManagedRestrictedModificationMap::lowerBound(const Key &akey) const { CQtManagedRestrictedModificationMapData::Node *update[CQtManagedRestrictedModificationMapData::LastLevel + 1]; mutableFindNode(update, akey); return const_iterator(update[0]->forward[0]); } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationMap::iterator CQtManagedRestrictedModificationMap::lowerBound(const Key &akey) { detach(); return static_cast(const_cast(this)->lowerBound(akey)); } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationMap::const_iterator CQtManagedRestrictedModificationMap::upperBound(const Key &akey) const { CQtManagedRestrictedModificationMapData::Node *update[CQtManagedRestrictedModificationMapData::LastLevel + 1]; mutableFindNode(update, akey); CQtManagedRestrictedModificationMapData::Node *node = update[0]->forward[0]; while (node != e && !cMapLessThanKey(akey, concrete(node)->key)) node = node->forward[0]; return const_iterator(node); } template Q_INLINE_TEMPLATE typename CQtManagedRestrictedModificationMap::iterator CQtManagedRestrictedModificationMap::upperBound(const Key &akey) { detach(); return static_cast(const_cast(this)->upperBound(akey)); } template Q_OUTOFLINE_TEMPLATE bool CQtManagedRestrictedModificationMap::operator==(const CQtManagedRestrictedModificationMap &other) const { if (size() != other.size()) return false; if (d == other.d) return true; const_iterator it1 = begin(); const_iterator it2 = other.begin(); while (it1 != end()) { if (!(it1.value() == it2.value()) || cMapLessThanKey(it1.key(), it2.key()) || cMapLessThanKey(it2.key(), it1.key())) return false; ++it2; ++it1; } return true; } #ifndef QT_NO_STL template Q_OUTOFLINE_TEMPLATE CQtManagedRestrictedModificationMap::CQtManagedRestrictedModificationMap(const std::map &other) { d = CQtManagedRestrictedModificationMapData::createData(alignment(), this, mMemMan); d->insertInOrder = true; typename std::map::const_iterator it = other.end(); while (it != other.begin()) { --it; insert((*it).first, (*it).second); } d->insertInOrder = false; } template Q_OUTOFLINE_TEMPLATE std::map CQtManagedRestrictedModificationMap::toStdMap() const { std::map map; const_iterator it = end(); while (it != begin()) { --it; map.insert(std::pair(it.key(), it.value())); } return map; } #endif // QT_NO_STL #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_MAP_CONTAINER }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONMAP_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtVector.cpp0000644000175000017500000000233612520551356024545 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTVECTOR_CPP #define KONCLUDE_UTILITIES_CONTAINER_CQTVECTOR_CPP #include "CQtVector.h" namespace Konclude { namespace Utilities { namespace Container { #ifdef KONCLUDE_EMPLOY_QT_VECTOR_CONTAINER #endif // KONCLUDE_EMPLOY_QT_VECTOR_CONTAINER }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CQTVECTOR_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CHash.h0000644000175000017500000000344212520551354023323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CHASH_H #define KONCLUDE_UTILITIES_CONTAINER_CHASH_H // Library includes // Namespace includes #include "ContainerSettings.h" #ifdef KONCLUDE_CONTAINER_HASH_USE_QT_HASH_FOR_DEFAULT #include "CQtHash.h" #endif // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CHash #ifdef KONCLUDE_CONTAINER_HASH_USE_QT_HASH_FOR_DEFAULT : public CQtHash #endif { // public methods public: // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CHash.cpp" #endif // KONCLUDE_UTILITIES_CONTAINER_CHASH_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CSortedLinker.cpp0000644000175000017500000000773212520551356025410 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CSORTEDLINKER_CPP #define KONCLUDE_UTILITIES_CONTAINER_CSORTEDLINKER_CPP #include "CSortedLinker.h" namespace Konclude { namespace Utilities { namespace Container { template CSortedLinkerBase::CSortedLinkerBase() : CLinkerBase() { } template CSortedLinkerBase::CSortedLinkerBase(const T& dataElement, CSortedLinkerBase* nextLink) : CLinkerBase(dataElement,nextLink) { } template CSortedLinkerBase::~CSortedLinkerBase() { } template S* CSortedLinkerBase::insertNextSorted(CSortedLinkerBase* nextLink) { CSortedLinkerBase* firstLinker = this; while (nextLink) { CSortedLinkerBase* nIns = nextLink; nextLink = nextLink->getNext(); nIns->setNext(nullptr); CSortedLinkerBase* list = firstLinker; CSortedLinkerBase* lastList = nullptr; bool inserted = false; const T& dataIns = nIns->getData(); while (list) { const T& dataList = list->getData(); // compare items if (isSortedBeforeCompare(dataIns,dataList)) { if (lastList == nullptr){ firstLinker = nIns->insertNext(firstLinker); } else { lastList->insertNext(nIns); } inserted = true; break; } lastList = list; list = (CSortedLinkerBase*)list->next; } if (!inserted) { lastList->insertNext(nIns); } } return (S*)firstLinker; } template S* CSortedLinkerBase::insertSortedNextSorted(CSortedLinkerBase* nextLink) { // items from nextLink are already sorted! CSortedLinkerBase* firstLinker = this; CSortedLinkerBase* list = firstLinker; CSortedLinkerBase* lastList = nullptr; while (nextLink) { CSortedLinkerBase* nIns = nextLink; nextLink = nextLink->getNext(); nIns->setNext(nullptr); bool inserted = false; const T& dataIns = nIns->getData(); while (list) { const T& dataList = list->getData(); if (isSortedBeforeCompare(dataIns,dataList)) { if (lastList == 0){ firstLinker = nIns->insertNext(firstLinker); list = (CSortedLinkerBase*)firstLinker->next; lastList = firstLinker; } else { lastList->insertNext(nIns); lastList = (CSortedLinkerBase*)lastList->next; // list is already on the correct position } inserted = true; break; } lastList = list; list = (CSortedLinkerBase*)list->next; } if (!inserted) { lastList->insertNext(nIns); lastList = nIns; } } return (S*)firstLinker; } template bool CSortedLinkerBase::isSortedBeforeCompare(const T& checkData, const T& linkedData) const { return C::sortedLinkerDataCompare(checkData,linkedData); } }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CSORTEDLINKER_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CTemporaryDataArrayMemoryStorer.h0000644000175000017500000000461512520551356030610 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CTEMPORARYDATAARRAYMEMORYSTORER_H #define KONCLUDE_UTILITIES_CONTAINER_CTEMPORARYDATAARRAYMEMORYSTORER_H // Libraries includes // Namespace includes #include "ContainerSettings.h" #include "CDataArrayMemoryManager.h" #include "CModelDataArray.h" #include "CModelDataLevelArray.h" // Other includes #include "Utilities/CDynamicExpandingMemoryManager.hpp" #include "Utilities/CAllocationObject.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CTemporaryDataArrayMemoryStorer * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTemporaryDataArrayMemoryStorer : public CDataArrayMemoryManager, public CAllocationObject { // public methods public: //! Constructor CTemporaryDataArrayMemoryStorer(CDataArrayMemoryManager *modelMemoryManager); //! Destructor virtual ~CTemporaryDataArrayMemoryStorer(); virtual CModelDataArray *allocateModelDataArray(); virtual CModelDataLevelArray *allocateModelDataLevelArray(); virtual CTemporaryDataArrayMemoryStorer *releaseTemporaryMemory(); // protected methods protected: // protected variables protected: CDataArrayMemoryManager *modelMemMan; QList tmpMemList; // private methods private: // private variables private: }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CTemporaryDataArrayMemoryStorer_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationMap.h0000644000175000017500000004334212520551356031323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONMAP_H #define KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONMAP_H // Namespace includes #include "ContainerSettings.h" #include "CQtManagedRestrictedModificationMapBase.h" #include "CQtManagedRestrictedModificationMapData.h" #include "CQtManagedRestrictedModificationList.h" #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_MAP_CONTAINER // Library includes #include #include // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Utilities { namespace Container { /*! * * \class CQtManagedRestrictedModificationMap * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ /* CQtManagedRestrictedModificationMap uses cMapLessThanKey() to compare keys. The default implementation uses operator<(). For pointer types, cMapLessThanKey() casts the pointers to integers before it compares them, because operator<() is undefined on pointers that come from different memory blocks. (In practice, this is only a problem when running a program such as BoundsChecker.) */ template inline bool cMapLessThanKey(const Key &key1, const Key &key2) { return key1 < key2; } #ifndef QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION template inline bool cMapLessThanKey(Ptr *key1, Ptr *key2) { Q_ASSERT(sizeof(quintptr) == sizeof(Ptr *)); return quintptr(key1) < quintptr(key2); } template inline bool cMapLessThanKey(const Ptr *key1, const Ptr *key2) { Q_ASSERT(sizeof(quintptr) == sizeof(const Ptr *)); return quintptr(key1) < quintptr(key2); } #endif // QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION template struct CQtManagedRestrictedModificationMapNode { Key key; T value; private: // never access these members through this structure. // see below CQtManagedRestrictedModificationMapData::Node *backward; CQtManagedRestrictedModificationMapData::Node *forward[1]; }; template struct CQtManagedRestrictedModificationMapPayloadNode { Key key; T value; private: // CQtManagedRestrictedModificationMap::e is a pointer to CQtManagedRestrictedModificationMapData::Node, which matches the member // below. However, the memory allocation node in CQtManagedRestrictedModificationMapData::node_create // allocates sizeof(CQtManagedRestrictedModificationMapPayloNode) and incorrectly calculates the offset // of 'backward' below. If the alignment of CQtManagedRestrictedModificationMapPayloadNode is larger // than the alignment of a pointer, the 'backward' member is aligned to // the end of this structure, not to 'value' above, and will occupy the // tail-padding area. // // e.g., on a 32-bit archictecture with Key = int and // sizeof(T) = alignof(T) = 8 // 0 4 8 12 16 20 24 byte // | key | PAD | value |backward| PAD | correct layout // | key | PAD | value | |backward| how it's actually used // |<----- value of CQtManagedRestrictedModificationMap::payload() = 20 ----->| CQtManagedRestrictedModificationMapData::Node *backward; }; template class CQtManagedRestrictedModificationMap : public CQtManagedRestrictedModificationMapBase { typedef CQtManagedRestrictedModificationMapNode Node; typedef CQtManagedRestrictedModificationMapPayloadNode PayloadNode; union { CQtManagedRestrictedModificationMapData *d; CQtManagedRestrictedModificationMapData::Node *e; }; CContext* mContext; CMemoryAllocationManager* mMemMan; static inline int payload() { return sizeof(PayloadNode) - sizeof(CQtManagedRestrictedModificationMapData::Node *); } static inline int alignment() { #ifdef Q_ALIGNOF return int(qMax(sizeof(void*), Q_ALIGNOF(Node))); #else return 0; #endif } static inline Node *concrete(CQtManagedRestrictedModificationMapData::Node *node) { return reinterpret_cast(reinterpret_cast(node) - payload()); } public: inline CQtManagedRestrictedModificationMap() : d(&CQtManagedRestrictedModificationMapData::shared_null),mContext(nullptr) { mMemMan = CContext::getMemoryAllocationManager(mContext); /*d->ref.ref();*/ } inline CQtManagedRestrictedModificationMap(CContext* context) : d(&CQtManagedRestrictedModificationMapData::shared_null),mContext(context) { mMemMan = CContext::getMemoryAllocationManager(mContext); /*d->ref.ref();*/ } inline CQtManagedRestrictedModificationMap(const CQtManagedRestrictedModificationMap &other) : d(other.d),mContext(nullptr) { mMemMan = CContext::getMemoryAllocationManager(mContext); /*d->ref.ref();*/ if (!d->sharable) detach(); } inline CQtManagedRestrictedModificationMap(const CQtManagedRestrictedModificationMap &other, CContext* context) : d(other.d),mContext(context) { mMemMan = CContext::getMemoryAllocationManager(mContext); /*d->ref.ref();*/ if (!d->sharable) detach(); } inline ~CQtManagedRestrictedModificationMap() { if (!d) return; if (/*!d->ref.deref()*/ d->refMap == this) freeData(d); } CQtManagedRestrictedModificationMap &operator=(const CQtManagedRestrictedModificationMap &other); CQtManagedRestrictedModificationMap* init(CContext* context = nullptr); CQtManagedRestrictedModificationMap* init(const CQtManagedRestrictedModificationMap &other, CContext* context = nullptr); CQtManagedRestrictedModificationMap* init(const CQtManagedRestrictedModificationMap* other, CContext* context = nullptr); bool isKeySubSetOf(const CQtManagedRestrictedModificationMap* other, cint64 testDirectSubSetFactorCount = 20); #ifndef QT_NO_STL explicit CQtManagedRestrictedModificationMap(const typename std::map &other); std::map toStdMap() const; #endif bool operator==(const CQtManagedRestrictedModificationMap &other) const; inline bool operator!=(const CQtManagedRestrictedModificationMap &other) const { return !(*this == other); } inline int size() const { return d->size; } inline bool isEmpty() const { return d->size == 0; } inline void detach() { if (/*d->ref != 1*/ d->refMap != this) detach_helper(); } inline bool isDetached() const { return /*d->ref == 1*/ d->refMap == this; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } inline bool isSharedWith(const CQtManagedRestrictedModificationMap &other) const { return d == other.d; } inline void setInsertInOrder(bool ordered) { d->insertInOrder = ordered; } void clear(); int remove(const Key &key); T take(const Key &key); bool contains(const Key &key) const; const Key key(const T &value) const; const Key key(const T &value, const Key &defaultKey) const; const T value(const Key &key) const; const T value(const Key &key, const T &defaultValue) const; T &operator[](const Key &key); const T operator[](const Key &key) const; bool tryGetValue(const Key &key, T* value = nullptr) const; bool tryGetValuePointer(const Key &key, T*& valuePointer) const; QList uniqueKeys() const; QList keys() const; QList keys(const T &value) const; QList values() const; QList values(const Key &key) const; int count(const Key &key) const; class const_iterator; class iterator { friend class const_iterator; CQtManagedRestrictedModificationMapData::Node *i; public: typedef std::bidirectional_iterator_tag iterator_category; typedef qptrdiff difference_type; typedef T value_type; typedef T *pointer; typedef T &reference; // ### Qt 5: get rid of 'operator Node *' inline operator CQtManagedRestrictedModificationMapData::Node *() const { return i; } inline iterator() : i(0) { } inline iterator(CQtManagedRestrictedModificationMapData::Node *node) : i(node) { } inline const Key &key() const { return concrete(i)->key; } inline T &value() const { return concrete(i)->value; } inline T &operator*() const { return concrete(i)->value; } inline T *operator->() const { return &concrete(i)->value; } inline bool operator==(const iterator &o) const { return i == o.i; } inline bool operator!=(const iterator &o) const { return i != o.i; } inline iterator &operator++() { i = i->forward[0]; return *this; } inline iterator operator++(int) { iterator r = *this; i = i->forward[0]; return r; } inline iterator &operator--() { i = i->backward; return *this; } inline iterator operator--(int) { iterator r = *this; i = i->backward; return r; } inline iterator operator+(int j) const { iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; } inline iterator operator-(int j) const { return operator+(-j); } inline iterator &operator+=(int j) { return *this = *this + j; } inline iterator &operator-=(int j) { return *this = *this - j; } // ### Qt 5: not sure this is necessary anymore #ifdef QT_STRICT_ITERATORS private: #else public: #endif inline bool operator==(const const_iterator &o) const { return i == o.i; } inline bool operator!=(const const_iterator &o) const { return i != o.i; } private: // ### Qt 5: remove inline operator bool() const { return false; } }; friend class iterator; class const_iterator { friend class iterator; CQtManagedRestrictedModificationMapData::Node *i; public: typedef std::bidirectional_iterator_tag iterator_category; typedef qptrdiff difference_type; typedef T value_type; typedef const T *pointer; typedef const T &reference; // ### Qt 5: get rid of 'operator Node *' inline operator CQtManagedRestrictedModificationMapData::Node *() const { return i; } inline const_iterator() : i(0) { } inline const_iterator(CQtManagedRestrictedModificationMapData::Node *node) : i(node) { } #ifdef QT_STRICT_ITERATORS explicit inline const_iterator(const iterator &o) #else inline const_iterator(const iterator &o) #endif { i = o.i; } inline const Key &key() const { return concrete(i)->key; } inline const T &value() const { return concrete(i)->value; } inline const T &operator*() const { return concrete(i)->value; } inline const T *operator->() const { return &concrete(i)->value; } inline bool operator==(const const_iterator &o) const { return i == o.i; } inline bool operator!=(const const_iterator &o) const { return i != o.i; } inline const_iterator &operator++() { i = i->forward[0]; return *this; } inline const_iterator operator++(int) { const_iterator r = *this; i = i->forward[0]; return r; } inline const_iterator &operator--() { i = i->backward; return *this; } inline const_iterator operator--(int) { const_iterator r = *this; i = i->backward; return r; } inline const_iterator operator+(int j) const { const_iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; } inline const_iterator operator-(int j) const { return operator+(-j); } inline const_iterator &operator+=(int j) { return *this = *this + j; } inline const_iterator &operator-=(int j) { return *this = *this - j; } // ### Qt 5: not sure this is necessary anymore #ifdef QT_STRICT_ITERATORS private: inline bool operator==(const iterator &o) { return operator==(const_iterator(o)); } inline bool operator!=(const iterator &o) { return operator!=(const_iterator(o)); } #endif private: // ### Qt 5: remove inline operator bool() const { return false; } }; friend class const_iterator; // STL style inline iterator begin() { detach(); return iterator(e->forward[0]); } inline iterator beginNoDetach() { return iterator(e->forward[0]); } inline const_iterator begin() const { return const_iterator(e->forward[0]); } inline const_iterator constBegin() const { return const_iterator(e->forward[0]); } inline iterator end() { detach(); return iterator(e); } inline iterator endNoDetach() { return iterator(e); } inline const_iterator end() const { return const_iterator(e); } inline const_iterator constEnd() const { return const_iterator(e); } iterator erase(iterator it); // more Qt typedef iterator Iterator; typedef const_iterator ConstIterator; inline int count() const { return d->size; } iterator find(const Key &key); const_iterator find(const Key &key) const; const_iterator constFind(const Key &key) const; iterator lowerBound(const Key &key); const_iterator lowerBound(const Key &key) const; iterator upperBound(const Key &key); const_iterator upperBound(const Key &key) const; iterator insert(const Key &key, const T &value); iterator tryInsert(const Key &key, const T &value, bool* containsAlready = nullptr); iterator tryInsert(const Key &key, const T &value, bool* containsAlready, T** containedValue); iterator insertMulti(const Key &key, const T &value); CQtManagedRestrictedModificationMap &unite(const CQtManagedRestrictedModificationMap &other); // STL compatibility typedef Key key_type; typedef T mapped_type; typedef qptrdiff difference_type; typedef int size_type; inline bool empty() const { return isEmpty(); } #ifdef KONCLUDE_CQTMANAGEDRESTRICTEDMODIFICATIONMAP_DEBUG inline void dump() const { d->dump(); } #endif private: void detach_helper(); void freeData(CQtManagedRestrictedModificationMapData *d); CQtManagedRestrictedModificationMapData::Node *findNode(const Key &key) const; CQtManagedRestrictedModificationMapData::Node *mutableFindNode(CQtManagedRestrictedModificationMapData::Node *update[], const Key &key) const; CQtManagedRestrictedModificationMapData::Node *node_create(CQtManagedRestrictedModificationMapData *d, CQtManagedRestrictedModificationMapData::Node *update[], const Key &key, const T &value); }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CQtManagedRestrictedModificationMap.cpp" #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_MAP_CONTAINER #endif // KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONMAP_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationHashData.h0000644000175000017500000001367112520551354032263 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONHASHDATA_H #define KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONHASHDATA_H // Namespace includes #include "ContainerSettings.h" #include "CQtManagedRestrictedModificationHashBase.h" #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_HASH_CONTAINER // Library includes #include // Other includes #include "Utilities/Memory/CMemoryAllocationManager.h" #include "Utilities/Memory/CObjectAllocator.h" #include "Utilities/Memory/CMemoryAllocator.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { using namespace Memory; namespace Container { /*! * * \class CQtManagedRestrictedModificationHashData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ struct CQtManagedRestrictedModificationHashData { struct Node { Node *next; uint h; }; Node *fakeNext; Node **buckets; //QBasicAtomicInt ref; CQtManagedRestrictedModificationHashBase *refHash; int size; int nodeSize; short userNumBits; short numBits; int numBuckets; uint sharable : 1; uint strictAlignment : 1; uint reserved : 30; void *allocateNode(CMemoryAllocationManager* memMan); // ### Qt5 remove me void *allocateNode(int nodeAlign, CMemoryAllocationManager* memMan); void freeNode(void *node, CMemoryAllocationManager* memMan); CQtManagedRestrictedModificationHashData *detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize); // ### Qt5 remove me CQtManagedRestrictedModificationHashData *detach_helper2(void (*node_duplicate)(Node *, void *), void (*node_delete)(Node *), int nodeSize, int nodeAlign, CQtManagedRestrictedModificationHashBase* referencedHash, CMemoryAllocationManager* memMan); CQtManagedRestrictedModificationHashData *restricted_detach_helper2(bool (*copy_restricted)(Node *, void *), void* assistValue, void (*node_duplicate)(Node *, void *), void (*node_delete)(Node *), int nodeSize, int nodeAlign, CQtManagedRestrictedModificationHashBase* referencedHash, CMemoryAllocationManager* memMan); void mightGrow(CMemoryAllocationManager* memMan); bool willGrow(CMemoryAllocationManager* memMan) { if (size >= numBuckets) { rehash(numBits + 1,memMan); return true; } else { return false; } } void hasShrunk(CMemoryAllocationManager* memMan); void rehash(int hint, CMemoryAllocationManager* memMan); void free_helper(void (*node_delete)(Node *), CMemoryAllocationManager* memMan); void destroyAndFree(CMemoryAllocationManager* memMan); // ### Qt5 remove me Node *firstNode(); #ifdef KONCLUDE_CQTMANAGEDRESTRICTEDMODIFICATIONHASH_DEBUG void dump(); void checkSanity(); #endif static Node *nextNode(Node *node); static Node *previousNode(Node *node); static CQtManagedRestrictedModificationHashData shared_null; }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_HASH_CONTAINER #endif // KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONHASHDATA_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CDefaultDynamicReferenceVector.cpp0000644000175000017500000000510712520551352030664 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CDEFAULTDYNAMICREFERENCEVECTOR_CPP #define KONCLUDE_UTILITIES_CONTAINER_CDEFAULTDYNAMICREFERENCEVECTOR_CPP #include "CDefaultDynamicReferenceVector.h" namespace Konclude { namespace Utilities { namespace Container { template CDefaultDynamicReferenceVectorBase::CDefaultDynamicReferenceVectorBase(CContext* context) : CDynamicReferenceVectorBase(context) { CDynamicReferenceVectorBase::clear(); } template CDefaultDynamicReferenceVectorBase::~CDefaultDynamicReferenceVectorBase() { } template const T CDefaultDynamicReferenceVectorBase::getData(cint64 index) { return CDynamicReferenceVectorBase::getData(index,nullptr); } template const T CDefaultDynamicReferenceVectorBase::getData(cint64 index, bool* localFlag) { return CDynamicReferenceVectorBase::getData(index,nullptr,localFlag); } template const T CDefaultDynamicReferenceVectorBase::getLocalData(cint64 index) { return CDynamicReferenceVectorBase::getLocalData(index,nullptr); } template const T CDefaultDynamicReferenceVectorBase::getReferenceData(cint64 index) { return CDynamicReferenceVectorBase::getReferenceData(index,nullptr); } }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CDEFAULTDYNAMICREFERENCEVECTOR_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CTemporaryDataArrayMemoryStorer.cpp0000644000175000017500000000371412520551356031142 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTemporaryDataArrayMemoryStorer.h" namespace Konclude { namespace Utilities { namespace Container { CTemporaryDataArrayMemoryStorer::CTemporaryDataArrayMemoryStorer(CDataArrayMemoryManager *modelMemoryManager) { modelMemMan = modelMemoryManager; } CTemporaryDataArrayMemoryStorer::~CTemporaryDataArrayMemoryStorer() { releaseTemporaryMemory(); } CTemporaryDataArrayMemoryStorer *CTemporaryDataArrayMemoryStorer::releaseTemporaryMemory() { foreach (CAllocationObject *tmpObj, tmpMemList) { CAllocationObject::release(tmpObj); } tmpMemList.clear(); return this; } CModelDataArray *CTemporaryDataArrayMemoryStorer::allocateModelDataArray() { CModelDataArray *modelData = modelMemMan->allocateModelDataArray(); tmpMemList.append(modelData); return modelData; } CModelDataLevelArray *CTemporaryDataArrayMemoryStorer::allocateModelDataLevelArray() { CModelDataLevelArray *modelDataLevel = modelMemMan->allocateModelDataLevelArray(); tmpMemList.append(modelDataLevel); return modelDataLevel; } }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CModelDataArray.cpp0000644000175000017500000002620112520551354025622 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CModelDataArray.h" namespace Konclude { namespace Utilities { namespace Container { CModelDataArray::CModelDataArray() { bitIndMask = dataSize-1; begTag = 0; tagSize = endTag = dataSize; bitIndShift = 0; dataArray = 0; } CModelDataArray::CModelDataArray(qint64 tagBegin, qint64 tagBegEndSize) { setBounds(tagBegin,tagBegEndSize); dataArray = 0; } CModelDataArray::~CModelDataArray() { } CModelDataArray *CModelDataArray::init(qint64 tagBegin, qint64 tagBegEndSize) { setBounds(tagBegin,tagBegEndSize); dataArray = 0; return this; } CModelDataArray *CModelDataArray::setBounds(qint64 tagBegin, qint64 tagBegEndSize) { begTag = tagBegin; tagSize = tagBegEndSize; endTag = begTag + tagSize; bitIndShift = CMath::log2(tagSize>>log2DataSize); bitIndMask = dataSize-1; return this; } bool CModelDataArray::isBaseLevel() { return true; } qint64 CModelDataArray::getModelLevel() { return 0; } qint64 CModelDataArray::getBeginTag() { return begTag; } qint64 CModelDataArray::getEndTag() { return endTag; } qint64 CModelDataArray::getTagSize() { return tagSize; } qint64 CModelDataArray::getDataArray() { return dataArray; } CModelDataArray *CModelDataArray::setData(bool value) { if (value == false) { dataArray = 0; } else { dataArray = Q_INT64_C(0xffffffffffffffff); } return this; } CModelDataArray *CModelDataArray::setLevelData(bool value) { if (value == false) { dataArray = 0; } else { dataArray = Q_INT64_C(0xffffffffffffffff); } return this; } bool CModelDataArray::setFlag(qint64 tag, bool flag, CDataArrayMemoryManager *modelMemMan) { return setFlag(tag,flag);; } CModelDataArray *CModelDataArray::getBaseModel(qint64 beginTag) { if (begTag != beginTag) { return 0; } else { return this; } } bool CModelDataArray::setFlag(qint64 tag, bool flag) { if (begTag <= tag && tag < endTag) { qint64 index = (tag-begTag) >> bitIndShift; qint64 bitIndex = index & bitIndMask; if (flag) { dataArray |= qint64(1)<> bitIndShift; qint64 bitIndex = index & bitIndMask; return (dataArray & qint64(1)<= 0 && index < dataSize) { qint64 bitIndex = index; if (flag) { dataArray |= qint64(1)<= 0 && index < dataSize) { qint64 bitIndex = index; return (dataArray & qint64(1)<>=1,++cn,--flagTag) { if ((mask & dataArray) != 0) { break; } } return flagTag; } CModelDataArray *CModelDataArray::intersectWith(CModelDataArray *modelData, bool *flagModification) { if (modelData) { CModelDataArray *testModelData = 0; if (isBaseLevel()) { testModelData = modelData->getBaseModel(begTag); } else { testModelData = modelData; } if (testModelData && begTag == testModelData->getBeginTag() && tagSize == testModelData->getTagSize()) { qint64 dataArrayBackup = dataArray; dataArray &= testModelData->dataArray; if (dataArrayBackup != dataArray && flagModification) { *flagModification = true; } } else { if (0 != dataArray && flagModification) { *flagModification = true; } dataArray = 0; } } else { if (0 != dataArray && flagModification) { *flagModification = true; } dataArray = 0; } return this; } CModelDataArray *CModelDataArray::unionWith(CModelDataArray *modelData, bool *flagModification) { if (modelData) { if (begTag == modelData->getBeginTag() && tagSize == modelData->getTagSize()) { qint64 dataArrayBackup = dataArray; dataArray |= modelData->dataArray; if (dataArrayBackup != dataArray && flagModification) { *flagModification = true; } } } return this; } CModelDataArray *CModelDataArray::intersectWith(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification) { if (modelData) { CModelDataArray *testModelData = 0; if (isBaseLevel()) { testModelData = modelData->getBaseModel(begTag); } else { testModelData = modelData; } if (testModelData && begTag == testModelData->getBeginTag() && tagSize == testModelData->getTagSize()) { qint64 dataArrayBackup = dataArray; dataArray &= testModelData->dataArray; if (dataArrayBackup != dataArray && flagModification) { *flagModification = true; } } else { if (0 != dataArray && flagModification) { *flagModification = true; } dataArray = 0; } } else { if (0 != dataArray && flagModification) { *flagModification = true; } dataArray = 0; } return this; } CModelDataArray *CModelDataArray::unionWith(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification) { if (modelData) { if (begTag == modelData->getBeginTag() && tagSize == modelData->getTagSize()) { qint64 dataArrayBackup = dataArray; dataArray |= modelData->dataArray; if (dataArrayBackup != dataArray && flagModification) { *flagModification = true; } } } return this; } bool CModelDataArray::needsExtension(qint64 minBegTag, qint64 minEndTag) { if (minBegTag < begTag || endTag > minEndTag) { return true; } else { return false; } } bool CModelDataArray::needsExtension(qint64 tag) { if (tag < begTag || endTag > tag) { return true; } else { return false; } } CModelDataArray *CModelDataArray::copyFrom(CModelDataArray *modelData, bool *flagModification) { if (modelData) { if (begTag == modelData->getBeginTag() && tagSize == modelData->getTagSize()) { qint64 dataArrayBackup = dataArray; dataArray = modelData->getDataArray(); if (dataArrayBackup != dataArray && flagModification) { *flagModification = true; } } } else { setData(false); } return this; } CModelDataArray *CModelDataArray::copyFrom(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification) { if (modelData) { if (begTag == modelData->getBeginTag() && tagSize == modelData->getTagSize()) { qint64 dataArrayBackup = dataArray; dataArray = modelData->getDataArray(); if (dataArrayBackup != dataArray && flagModification) { *flagModification = true; } } } else { setData(false); } return this; } bool CModelDataArray::hasIntersectionWith(CModelDataArray *modelData) { if (modelData) { CModelDataArray *baseModelTag = modelData->getBaseModel(begTag); if (baseModelTag && begTag == baseModelTag->getBeginTag() && tagSize == baseModelTag->getTagSize()) { return (dataArray & baseModelTag->getDataArray()) != 0; } } return false; } qint64 CModelDataArray::countIntersectionWith(CModelDataArray *modelData) { qint64 inCount = 0; if (modelData) { CModelDataArray *baseModelTag = modelData->getBaseModel(begTag); if (baseModelTag && begTag == baseModelTag->getBeginTag() && tagSize == baseModelTag->getTagSize()) { qint64 otherBaseDataArray = baseModelTag->getDataArray(); qint64 intersectDataArray = dataArray & otherBaseDataArray; if ((intersectDataArray) != 0) { for (qint64 mask = 0x1, cn = 0; cn < dataSize; mask<<=1,++cn) { if ((mask & intersectDataArray) != 0) { inCount++; } } } } } return inCount; } bool CModelDataArray::isSuperSetTo(CModelDataArray *modelData) { if (!modelData || modelData->isEmpty()) { return true; } if (modelData->getFirstFlagTag() < begTag) { return false; } if (modelData->getLastFlagTag() < endTag) { return false; } CModelDataArray *testModelData = modelData; if (isBaseLevel()) { testModelData = modelData->getBaseModel(begTag); } qint64 modelDataArray = testModelData->getDataArray(); return (dataArray & modelDataArray) == modelDataArray; } bool CModelDataArray::isSubsetFrom(CModelDataArray *modelData) { if (isEmpty()) { return true; } if (modelData) { CModelDataArray *testModelData = modelData; if (isBaseLevel()) { testModelData = modelData->getBaseModel(begTag); } if (!testModelData) { return false; } return (dataArray & testModelData->getDataArray()) == dataArray; } return false; } bool CModelDataArray::needsExtension(CModelDataArray *otherModelData) { if (otherModelData) { return needsExtension(otherModelData->getBeginTag(),otherModelData->getEndTag()); } return false; } bool CModelDataArray::isFullConstructed() { return true; } }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CSortedLinker.h0000644000175000017500000000640112520551356025045 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CSORTEDLINKER_H #define KONCLUDE_UTILITIES_CONTAINER_CSORTEDLINKER_H // Namespace includes #include "ContainerSettings.h" #include "CLinker.h" // Library includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { template class CLinkerOperatorCompareFunctor; template class CLinkerOperatorCompareFunctor { public: static inline bool sortedLinkerDataCompare(T* const & beforeData1, T* const & data2) { return *beforeData1 <= *data2; } }; template class CLinkerOperatorCompareFunctor { public: static inline bool sortedLinkerDataCompare(const T& beforeData1, const T& data2) { return beforeData1 <= data2; } }; /*! * * \class CSortedLinkerBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template > class CSortedLinkerBase : public CLinkerBase { // public methods public: // Constructor inline CSortedLinkerBase(); inline CSortedLinkerBase(const T& dataElement, CSortedLinkerBase* nextLink = nullptr); //! Destructor inline ~CSortedLinkerBase(); S* insertSortedNextSorted(CSortedLinkerBase* nextLink); S* insertNextSorted(CSortedLinkerBase* nextLink); // protected methods protected: bool isSortedBeforeCompare(const T& checkData, const T& linkedData) const; // protected variables protected: // private methods private: // private variables private: }; /*! * * \class CSortedLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template > class CXSortedLinker : public CSortedLinkerBase,C> { // public methods public: // Constructor inline CXSortedLinker() : CSortedLinkerBase,C>() {}; inline CXSortedLinker(const T& dataElement, CXSortedLinker* nextLink = nullptr) : CSortedLinkerBase,C>(dataElement,nextLink) {}; //! Destructor inline ~CXSortedLinker() {}; }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CSortedLinker.cpp" #endif // KONCLUDE_UTILITIES_CONTAINER_CSORTEDLINKER_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationHashBase.cppKonclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationHashBase.c0000644000175000017500000000573312520551354032257 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #include "CQtManagedRestrictedModificationHashBase.h" namespace Konclude { namespace Utilities { namespace Container { }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CList.cpp0000644000175000017500000000216412520551354023706 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CLIST_CPP #define KONCLUDE_UTILITIES_CONTAINER_CLIST_CPP #include "CList.h" namespace Konclude { namespace Utilities { namespace Container { }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CLIST_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CSortedNegLinker.cpp0000644000175000017500000001063512520551356026036 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CSORTEDNEGLINKER_CPP #define KONCLUDE_UTILITIES_CONTAINER_CSORTEDNEGLINKER_CPP #include "CSortedNegLinker.h" namespace Konclude { namespace Utilities { namespace Container { template CSortedNegLinkerBase::CSortedNegLinkerBase() : CNegLinkerBase() { } template CSortedNegLinkerBase::CSortedNegLinkerBase(const T& dataElement, bool negation, CSortedNegLinkerBase* nextLink) : CNegLinkerBase(dataElement,negation,nextLink) { } template CSortedNegLinkerBase::~CSortedNegLinkerBase() { } template S* CSortedNegLinkerBase::insertNextSorted(CSortedNegLinkerBase* nextLink) { CSortedNegLinkerBase* firstLinker = this; while (nextLink) { CSortedNegLinkerBase* nIns = nextLink; nextLink = nextLink->getNext(); nIns->setNext(nullptr); CSortedNegLinkerBase* list = firstLinker; CSortedNegLinkerBase* lastList = nullptr; bool inserted = false; const T& dataIns = nIns->getData(); bool dataInsNegated = nIns->isNegated(); while (list) { const T& dataList = list->getData(); bool dataListNegated = list->isNegated(); // compare items if (isSortedBeforeCompare(dataIns,dataInsNegated,dataList,dataListNegated)) { if (lastList == nullptr){ firstLinker = nIns->insertNext(firstLinker); } else { lastList->insertNext(nIns); } inserted = true; break; } lastList = list; list = (CSortedNegLinkerBase*)list->next; } if (!inserted) { lastList->insertNext(nIns); } } return (S*)firstLinker; } template S* CSortedNegLinkerBase::insertSortedNextSorted(CSortedNegLinkerBase* nextLink) { // items from nextLink are already sorted! CSortedNegLinkerBase* firstLinker = this; CSortedNegLinkerBase* list = firstLinker; CSortedNegLinkerBase* lastList = nullptr; while (nextLink) { CSortedNegLinkerBase* nIns = nextLink; nextLink = nextLink->getNext(); nIns->setNext(nullptr); bool inserted = false; const T& dataIns = nIns->getData(); bool dataInsNegated = nIns->isNegated(); while (list) { const T& dataList = list->getData(); bool dataListNegated = list->isNegated(); if (isSortedBeforeCompare(dataIns,dataInsNegated,dataList,dataListNegated)) { if (lastList == 0){ firstLinker = nIns->insertNext(firstLinker); list = (CSortedNegLinkerBase*)firstLinker->next; lastList = firstLinker; } else { lastList->insertNext(nIns); lastList = (CSortedNegLinkerBase*)lastList->next; // list is already on the correct position } inserted = true; break; } lastList = list; list = (CSortedNegLinkerBase*)list->next; } if (!inserted) { lastList->insertNext(nIns); lastList = nIns; } } return (S*)firstLinker; } template bool CSortedNegLinkerBase::isSortedBeforeCompare(const T& checkData, const bool& checkNegation, const T& linkedData, const bool& linkedNegation) const { return C::sortedNegLinkerDataCompare(checkData,checkNegation,linkedData,linkedNegation); } }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CSORTEDNEGLINKER_CPP ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationListData.cppKonclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationListData.c0000644000175000017500000003163412520551356032307 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #include "CQtManagedRestrictedModificationListData.h" namespace Konclude { namespace Utilities { namespace Container { #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_LIST_CONTAINER CQtManagedRestrictedModificationListData::Data CQtManagedRestrictedModificationListData::shared_null = { nullptr, 0, 0, 0, true, { 0 } }; int cAllocMore(int alloc, int extra) { if (alloc == 0 && extra == 0) return 0; const int page = 1 << 12; int nalloc; alloc += extra; if (alloc < 1<<6) { nalloc = (1<<3) + ((alloc >>3) << 3); } else { // don't do anything if the loop will overflow signed int. if (alloc >= INT_MAX/2) return INT_MAX; nalloc = (alloc < page) ? 1 << 3 : page; while (nalloc < alloc) { if (nalloc <= 0) return INT_MAX; nalloc *= 2; } } return nalloc - extra; } static int grow(int size, CMemoryAllocationManager* memMan) { // dear compiler: don't optimize me out. //if (!memMan) { volatile int x = cAllocMore(size * sizeof(void *), CQtManagedRestrictedModificationListData::DataHeaderSize) / sizeof(void *); return x; /*} else { return memMan->getOptimizedMoreAllocationSize(size * sizeof(void *)+ CQtManagedRestrictedModificationListData::DataHeaderSize) / sizeof(void *); }*/ } /*! * Detaches the CQtManagedRestrictedModificationListData by allocating new memory for a list which will be bigger * than the copied one and is expected to grow further. * *idx is the desired insertion point and is clamped to the actual size of the list. * num is the number of new elements to insert at the insertion point. * Returns the old (shared) data, it is up to the caller to deref() and free(). * For the new data node_copy needs to be called. * * \internal */ CQtManagedRestrictedModificationListData::Data *CQtManagedRestrictedModificationListData::detach_grow(int *idx, int num, CMemoryAllocationManager* memMan, CQtManagedRestrictedModificationListBase* listBase) { Data *x = d; int l = x->end - x->begin; int nl = l + num; int alloc = grow(nl,memMan); Data* t = static_cast(CMemoryAllocator::allocateMemory(memMan,DataHeaderSize + alloc * sizeof(void *))); Q_CHECK_PTR(t); //t->ref = 1; t->refList = listBase; t->sharable = true; t->alloc = alloc; // The space reservation algorithm's optimization is biased towards appending: // Something which looks like an append will put the data at the beginning, // while something which looks like a prepend will put it in the middle // instead of at the end. That's based on the assumption that prepending // is uncommon and even an initial prepend will eventually be followed by // at least some appends. int bg; if (*idx < 0) { *idx = 0; bg = (alloc - nl) >> 1; } else if (*idx > l) { *idx = l; bg = 0; } else if (*idx < (l >> 1)) { bg = (alloc - nl) >> 1; } else { bg = 0; } t->begin = bg; t->end = bg + nl; d = t; return x; } /*! * Detaches the CQtManagedRestrictedModificationListData by allocating new memory for a list which possibly * has a different size than the copied one. * Returns the old (shared) data, it is up to the caller to deref() and free() * For the new data node_copy needs to be called. * * \internal */ CQtManagedRestrictedModificationListData::Data *CQtManagedRestrictedModificationListData::detach(int alloc, CMemoryAllocationManager* memMan, CQtManagedRestrictedModificationListBase* listBase) { Data *x = d; Data* t = nullptr; //t = static_cast(qMalloc(DataHeaderSize + alloc * sizeof(void *))); t = static_cast(CMemoryAllocator::allocateMemory(memMan,DataHeaderSize + alloc * sizeof(void *))); Q_CHECK_PTR(t); //t->ref = 1; t->refList = listBase; t->sharable = true; t->alloc = alloc; if (!alloc) { t->begin = 0; t->end = 0; } else { t->begin = x->begin; t->end = x->end; } d = t; return x; } // ensures that enough space is available to append n elements void **CQtManagedRestrictedModificationListData::append(int n, CMemoryAllocationManager* memMan) { //Q_ASSERT(d->ref == 1); int e = d->end; if (e + n > d->alloc) { int b = d->begin; if (b - n >= 2 * d->alloc / 3) { // we have enough space. Just not at the end -> move it. e -= b; ::memcpy(d->array, d->array + b, e * sizeof(void *)); d->begin = 0; } else { realloc(grow(d->alloc + n,memMan),memMan); } } d->end = e + n; return d->array + e; } // ensures that enough space is available to append one element void **CQtManagedRestrictedModificationListData::append(CMemoryAllocationManager* memMan) { return append(1,memMan); } // ensures that enough space is available to append the list void **CQtManagedRestrictedModificationListData::append2(const CQtManagedRestrictedModificationListData& l, CMemoryAllocationManager* memMan) { return append(l.d->end - l.d->begin,memMan); } void **CQtManagedRestrictedModificationListData::append(const CQtManagedRestrictedModificationListData& l, CMemoryAllocationManager* memMan) { //Q_ASSERT(d->ref == 1); int e = d->end; int n = l.d->end - l.d->begin; if (n) { if (e + n > d->alloc) realloc(grow(e + n,memMan),memMan); ::memcpy(d->array + d->end, l.d->array + l.d->begin, n*sizeof(void*)); d->end += n; } return d->array + e; } void **CQtManagedRestrictedModificationListData::prepend(CMemoryAllocationManager* memMan) { //Q_ASSERT(d->ref == 1); if (d->begin == 0) { if (d->end >= d->alloc / 3) realloc(grow(d->alloc + 1,memMan),memMan); if (d->end < d->alloc / 3) d->begin = d->alloc - 2 * d->end; else d->begin = d->alloc - d->end; ::memmove(d->array + d->begin, d->array, d->end * sizeof(void *)); d->end += d->begin; } return d->array + --d->begin; } void **CQtManagedRestrictedModificationListData::insert(int i, CMemoryAllocationManager* memMan) { //Q_ASSERT(d->ref == 1); if (i <= 0) return prepend(memMan); int size = d->end - d->begin; if (i >= size) return append(memMan); bool leftward = false; if (d->begin == 0) { if (d->end == d->alloc) { // If the array is full, we expand it and move some items rightward realloc(grow(d->alloc + 1,memMan),memMan); } else { // If there is free space at the end of the array, we move some items rightward } } else { if (d->end == d->alloc) { // If there is free space at the beginning of the array, we move some items leftward leftward = true; } else { // If there is free space at both ends, we move as few items as possible leftward = (i < size - i); } } if (leftward) { --d->begin; ::memmove(d->array + d->begin, d->array + d->begin + 1, i * sizeof(void *)); } else { ::memmove(d->array + d->begin + i + 1, d->array + d->begin + i, (size - i) * sizeof(void *)); ++d->end; } return d->array + d->begin + i; } void CQtManagedRestrictedModificationListData::remove(int i) { //Q_ASSERT(d->ref == 1); i += d->begin; if (i - d->begin < d->end - i) { if (int offset = i - d->begin) ::memmove(d->array + d->begin + 1, d->array + d->begin, offset * sizeof(void *)); d->begin++; } else { if (int offset = d->end - i - 1) ::memmove(d->array + i, d->array + i + 1, offset * sizeof(void *)); d->end--; } } void CQtManagedRestrictedModificationListData::remove(int i, int n) { //Q_ASSERT(d->ref == 1); i += d->begin; int middle = i + n/2; if (middle - d->begin < d->end - middle) { ::memmove(d->array + d->begin + n, d->array + d->begin, (i - d->begin) * sizeof(void*)); d->begin += n; } else { ::memmove(d->array + i, d->array + i + n, (d->end - i - n) * sizeof(void*)); d->end -= n; } } void CQtManagedRestrictedModificationListData::move(int from, int to) { //Q_ASSERT(d->ref == 1); if (from == to) return; from += d->begin; to += d->begin; void *t = d->array[from]; if (from < to) { if (d->end == d->alloc || 3 * (to - from) < 2 * (d->end - d->begin)) { ::memmove(d->array + from, d->array + from + 1, (to - from) * sizeof(void *)); } else { // optimization if (int offset = from - d->begin) ::memmove(d->array + d->begin + 1, d->array + d->begin, offset * sizeof(void *)); if (int offset = d->end - (to + 1)) ::memmove(d->array + to + 2, d->array + to + 1, offset * sizeof(void *)); ++d->begin; ++d->end; ++to; } } else { if (d->begin == 0 || 3 * (from - to) < 2 * (d->end - d->begin)) { ::memmove(d->array + to + 1, d->array + to, (from - to) * sizeof(void *)); } else { // optimization if (int offset = to - d->begin) ::memmove(d->array + d->begin - 1, d->array + d->begin, offset * sizeof(void *)); if (int offset = d->end - (from + 1)) ::memmove(d->array + from, d->array + from + 1, offset * sizeof(void *)); --d->begin; --d->end; --to; } } d->array[to] = t; } void **CQtManagedRestrictedModificationListData::erase(void **xi) { //Q_ASSERT(d->ref == 1); int i = xi - (d->array + d->begin); remove(i); return d->array + d->begin + i; } void CQtManagedRestrictedModificationListData::realloc(int alloc, CMemoryAllocationManager* memMan) { //Q_ASSERT(d->ref == 1); //Data *x = static_cast(qRealloc(d, DataHeaderSize + alloc * sizeof(void *))); Data *x = nullptr; x = static_cast(CMemoryAllocator::reallocateMemory(d,memMan, DataHeaderSize + d->alloc * sizeof(void *), DataHeaderSize + alloc * sizeof(void *))); Q_CHECK_PTR(x); d = x; d->alloc = alloc; if (!alloc) d->begin = d->end = 0; } #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_LIST_CONTAINER }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CDynamicReferenceVector.h0000644000175000017500000000713212520551352027024 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CDYNAMICREFERENCEVECTOR_H #define KONCLUDE_UTILITIES_CONTAINER_CDYNAMICREFERENCEVECTOR_H // Namespace includes #include "ContainerSettings.h" // Library includes // Other includes #include "CDynamicReferenceBucket.h" // Logger includes namespace Konclude { using namespace Context; namespace Utilities { namespace Container { /*! * * \class CDynamicReferenceVectorBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CDynamicReferenceVectorBase { // public methods public: //! Constructor inline CDynamicReferenceVectorBase(CContext* context = nullptr); //! Destructor inline ~CDynamicReferenceVectorBase(); inline const T getData(cint64 index, const T& defaultValue); inline const T getData(cint64 index, const T& defaultValue, bool* localFlag); inline const T getLocalData(cint64 index, const T& defaultValue); inline const T getReferenceData(cint64 index, const T& defaultValue); inline S* setLocalData(cint64 index, const T& data); inline S* setData(cint64 index, const T& data); inline bool hasLocalData(cint64 index); inline bool hasData(cint64 index); inline bool hasReferencedData(cint64 index); inline S* clear(); inline S* referenceVector(CDynamicReferenceVectorBase* refVector); inline cint64 getItemCount(); inline cint64 getItemMaxIndex(); inline cint64 getReferencedItemCount(); inline cint64 getReferencedItemMaxIndex(); // protected methods protected: // protected variables protected: CContext* mContext; cint64 mMaxIndex; cint64 mRootBucketDepth; cint64 mMaxItem; cint64 mReferencedMaxItem; CDynamicReferenceVectorBase* mReferenceVector; CDynamicReferenceBucketBase* mRootBucket; // private methods private: // private variables private: }; /*! * * \class CDynamicReferenceVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CDynamicReferenceVector : public CDynamicReferenceVectorBase,bucket2Size> { // public methods public: // Constructor inline CDynamicReferenceVector(CContext* context = nullptr) : CDynamicReferenceVectorBase,bucket2Size>(context) {}; //! Destructor inline ~CDynamicReferenceVector() {}; }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CDynamicReferenceVector.cpp" #endif // KONCLUDE_UTILITIES_CONTAINER_CDYNAMICREFERENCEVECTOR_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationHashData.cppKonclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationHashData.c0000644000175000017500000003673012520756426032266 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #include "CQtManagedRestrictedModificationHashData.h" namespace Konclude { namespace Utilities { namespace Container { #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_HASH_CONTAINER static const uchar prime_deltas[] = { 0, 0, 1, 3, 1, 5, 3, 3, 1, 9, 7, 5, 3, 9, 25, 3, 1, 21, 3, 21, 7, 15, 9, 5, 3, 29, 15, 0, 0, 0, 0, 0 }; static inline int primeForNumBits(int numBits) { return (1 << numBits) + prime_deltas[numBits]; } /* Returns the smallest integer n such that primeForNumBits(n) >= hint. */ static int countBits(int hint) { int numBits = 0; int bits = hint; while (bits > 1) { bits >>= 1; numBits++; } if (numBits >= (int)sizeof(prime_deltas)) { numBits = sizeof(prime_deltas) - 1; } else if (primeForNumBits(numBits) < hint) { ++numBits; } return numBits; } const int MinNumBits = 4; CQtManagedRestrictedModificationHashData CQtManagedRestrictedModificationHashData::shared_null = { 0, 0, /*Q_BASIC_ATOMIC_INITIALIZER(1)*/0, 0, 0, MinNumBits, 0, 0, true, false, 0 }; void *CQtManagedRestrictedModificationHashData::allocateNode(CMemoryAllocationManager* memMan) { return allocateNode(0,memMan); } void *CQtManagedRestrictedModificationHashData::allocateNode(int nodeAlign, CMemoryAllocationManager* memMan) { //void *ptr = strictAlignment ? qMallocAligned(nodeSize, nodeAlign) : qMalloc(nodeSize); //void *ptr = strictAlignment ? memMan->allocateAligned(nodeSize,nodeAlign) : memMan->allocate(nodeSize); void *ptr = strictAlignment ? CMemoryAllocator::allocateAlignedMemory(memMan,nodeSize,nodeAlign) : CMemoryAllocator::allocateMemory(memMan,nodeSize); Q_CHECK_PTR(ptr); return ptr; } void CQtManagedRestrictedModificationHashData::freeNode(void *node, CMemoryAllocationManager* memMan) { if (strictAlignment) //qFreeAligned(node); CMemoryAllocator::releaseAlignedMemory(node,memMan); else //qFree(node); CMemoryAllocator::releaseMemory(node,memMan); } CQtManagedRestrictedModificationHashData *CQtManagedRestrictedModificationHashData::detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize) { return detach_helper2( node_duplicate, 0, nodeSize, 0, 0, 0); } CQtManagedRestrictedModificationHashData *CQtManagedRestrictedModificationHashData::detach_helper2(void (*node_duplicate)(Node *, void *), void (*node_delete)(Node *), int nodeSize, int nodeAlign, CQtManagedRestrictedModificationHashBase* referencedHash, CMemoryAllocationManager* memMan) { union { CQtManagedRestrictedModificationHashData *d; Node *e; }; //d = new CQtManagedRestrictedModificationHashData; d = CObjectAllocator::allocate(memMan); d->fakeNext = 0; d->buckets = 0; //d->ref = 1; d->refHash = referencedHash; d->size = size; d->nodeSize = nodeSize; d->userNumBits = userNumBits; d->numBits = numBits; d->numBuckets = numBuckets; d->sharable = true; d->strictAlignment = nodeAlign > 8; d->reserved = 0; if (numBuckets) { QT_TRY { //d->buckets = new Node *[numBuckets]; d->buckets = CObjectAllocator::allocateArray(memMan,numBuckets); } QT_CATCH(...) { // restore a consistent state for d d->numBuckets = 0; // roll back d->free_helper(node_delete,memMan); QT_RETHROW; } Node *this_e = reinterpret_cast(this); for (int i = 0; i < numBuckets; ++i) { Node **nextNode = &d->buckets[i]; Node *oldNode = buckets[i]; while (oldNode != this_e) { QT_TRY { Node *dup = static_cast(allocateNode(nodeAlign,memMan)); QT_TRY { node_duplicate(oldNode, dup); } QT_CATCH(...) { freeNode(dup,memMan); QT_RETHROW; } dup->h = oldNode->h; *nextNode = dup; nextNode = &dup->next; oldNode = oldNode->next; } QT_CATCH(...) { // restore a consistent state for d *nextNode = e; d->numBuckets = i+1; // roll back d->free_helper(node_delete,memMan); QT_RETHROW; } } *nextNode = e; } } return d; } CQtManagedRestrictedModificationHashData *CQtManagedRestrictedModificationHashData::restricted_detach_helper2(bool (*copy_restricted)(Node *, void *), void *assistValue, void (*node_duplicate)(Node *, void *), void (*node_delete)(Node *), int nodeSize, int nodeAlign, CQtManagedRestrictedModificationHashBase* referencedHash, CMemoryAllocationManager* memMan) { union { CQtManagedRestrictedModificationHashData *d; Node *e; }; //d = new CQtManagedRestrictedModificationHashData; d = CObjectAllocator::allocate(memMan); d->fakeNext = 0; d->buckets = 0; //d->ref = 1; d->refHash = referencedHash; d->size = size; d->nodeSize = nodeSize; d->userNumBits = userNumBits; d->numBits = numBits; d->numBuckets = numBuckets; d->sharable = true; d->strictAlignment = nodeAlign > 8; d->reserved = 0; if (numBuckets) { QT_TRY { //d->buckets = new Node *[numBuckets]; d->buckets = CObjectAllocator::allocateArray(memMan,numBuckets); } QT_CATCH(...) { // restore a consistent state for d d->numBuckets = 0; // roll back d->free_helper(node_delete,memMan); QT_RETHROW; } Node *this_e = reinterpret_cast(this); for (int i = 0; i < numBuckets; ++i) { Node **nextNode = &d->buckets[i]; Node *oldNode = buckets[i]; while (oldNode != this_e) { if (copy_restricted(oldNode,assistValue)) { QT_TRY { Node *dup = static_cast(allocateNode(nodeAlign,memMan)); QT_TRY { node_duplicate(oldNode, dup); } QT_CATCH(...) { freeNode(dup,memMan); QT_RETHROW; } dup->h = oldNode->h; *nextNode = dup; nextNode = &dup->next; oldNode = oldNode->next; } QT_CATCH(...) { // restore a consistent state for d *nextNode = e; d->numBuckets = i+1; // roll back d->free_helper(node_delete,memMan); QT_RETHROW; } } else { d->size = d->size - 1; oldNode = oldNode->next; } } *nextNode = e; } } return d; } void CQtManagedRestrictedModificationHashData::free_helper(void (*node_delete)(Node *), CMemoryAllocationManager* memMan) { if (node_delete) { Node *this_e = reinterpret_cast(this); Node **bucket = reinterpret_cast(this->buckets); int n = numBuckets; while (n--) { Node *cur = *bucket++; while (cur != this_e) { Node *next = cur->next; node_delete(cur); freeNode(cur,memMan); cur = next; } } } //delete [] buckets; CObjectAllocator::releaseArray(buckets,memMan); //delete this; CObjectAllocator::release(this,memMan); } CQtManagedRestrictedModificationHashData::Node *CQtManagedRestrictedModificationHashData::nextNode(Node *node) { union { Node *next; Node *e; CQtManagedRestrictedModificationHashData *d; }; next = node->next; Q_ASSERT_X(next, "QHash", "Iterating beyond end()"); if (next->next) return next; int start = (node->h % d->numBuckets) + 1; Node **bucket = d->buckets + start; int n = d->numBuckets - start; while (n--) { if (*bucket != e) return *bucket; ++bucket; } return e; } CQtManagedRestrictedModificationHashData::Node *CQtManagedRestrictedModificationHashData::previousNode(Node *node) { union { Node *e; CQtManagedRestrictedModificationHashData *d; }; e = node; while (e->next) e = e->next; int start; if (node == e) start = d->numBuckets - 1; else start = node->h % d->numBuckets; Node *sentinel = node; Node **bucket = d->buckets + start; while (start >= 0) { if (*bucket != sentinel) { Node *prev = *bucket; while (prev->next != sentinel) prev = prev->next; return prev; } sentinel = e; --bucket; --start; } Q_ASSERT_X(start >= 0, "QHash", "Iterating backward beyond begin()"); return e; } /* If hint is negative, -hint gives the approximate number of buckets that should be used for the hash table. If hint is nonnegative, (1 << hint) gives the approximate number of buckets that should be used. */ void CQtManagedRestrictedModificationHashData::rehash(int hint, CMemoryAllocationManager* memMan) { if (hint < 0) { hint = countBits(-hint); if (hint < MinNumBits) hint = MinNumBits; userNumBits = hint; while (primeForNumBits(hint) < (size >> 1)) ++hint; } else if (hint < MinNumBits) { hint = MinNumBits; } if (numBits != hint) { Node *e = reinterpret_cast(this); Node **oldBuckets = buckets; int oldNumBuckets = numBuckets; int nb = primeForNumBits(hint); //buckets = new Node *[nb]; buckets = CObjectAllocator::allocateArray(memMan,nb); numBits = hint; numBuckets = nb; for (int i = 0; i < numBuckets; ++i) buckets[i] = e; for (int i = 0; i < oldNumBuckets; ++i) { Node *firstNode = oldBuckets[i]; while (firstNode != e) { uint h = firstNode->h; Node *lastNode = firstNode; while (lastNode->next != e && lastNode->next->h == h) lastNode = lastNode->next; Node *afterLastNode = lastNode->next; Node **beforeFirstNode = &buckets[h % numBuckets]; while (*beforeFirstNode != e) beforeFirstNode = &(*beforeFirstNode)->next; lastNode->next = *beforeFirstNode; *beforeFirstNode = firstNode; firstNode = afterLastNode; } } //delete [] oldBuckets; CObjectAllocator::releaseArray(oldBuckets,memMan); } } void CQtManagedRestrictedModificationHashData::destroyAndFree(CMemoryAllocationManager* memMan) { free_helper(0,memMan); } #ifdef KONCLUDE_CQTMANAGEDRESTRICTEDMODIFICATIONHASH_DEBUG void CQtManagedRestrictedModificationHashData::dump() { qDebug("Hash data (ref = %d, size = %d, nodeSize = %d, userNumBits = %d, numBits = %d, numBuckets = %d)", /*int(ref)*/(int)refHash, size, nodeSize, userNumBits, numBits, numBuckets); qDebug(" %p (fakeNode = %p)", this, fakeNext); for (int i = 0; i < numBuckets; ++i) { QString line; Node *n = buckets[i]; if (n != reinterpret_cast(this)) { line.sprintf("%d:", i); while (n != reinterpret_cast(this)) { line += QString().sprintf(" -> [%p]", n); if (!n) { line += " (CORRUPT)"; break; } n = n->next; } qDebug(qPrintable(line)); } } } void CQtManagedRestrictedModificationHashData::checkSanity() { if (fakeNext) qFatal("Fake next isn't 0"); for (int i = 0; i < numBuckets; ++i) { Node *n = buckets[i]; Node *p = n; if (!n) qFatal("%d: Bucket entry is 0", i); if (n != reinterpret_cast(this)) { while (n != reinterpret_cast(this)) { if (!n->next) qFatal("%d: Next of %p is 0, should be %p", i, n, this); n = n->next; } } } } #endif void CQtManagedRestrictedModificationHashData::mightGrow(CMemoryAllocationManager* memMan) // ### Qt 5: eliminate { if (size >= numBuckets) rehash(numBits + 1,memMan); } //inline bool CQtManagedRestrictedModificationHashData::willGrow() //{ // if (size >= numBuckets) { // rehash(numBits + 1); // return true; // } else { // return false; // } //} void CQtManagedRestrictedModificationHashData::hasShrunk(CMemoryAllocationManager* memMan) { if (size <= (numBuckets >> 3) && numBits > userNumBits) { QT_TRY { rehash(qMax(int(numBits) - 2, int(userNumBits)),memMan); } QT_CATCH(const std::bad_alloc &) { // ignore bad allocs - shrinking shouldn't throw. rehash is exception safe. } } } CQtManagedRestrictedModificationHashData::Node *CQtManagedRestrictedModificationHashData::firstNode() { Node *e = reinterpret_cast(this); Node **bucket = buckets; int n = numBuckets; while (n--) { if (*bucket != e) return *bucket; ++bucket; } return e; } #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_HASH_CONTAINER }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CDataArrayMemoryManager.cpp0000644000175000017500000000216212520551352027323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataArrayMemoryManager.h" namespace Konclude { namespace Utilities { namespace Container { CDataArrayMemoryManager::CDataArrayMemoryManager() { } CDataArrayMemoryManager::~CDataArrayMemoryManager() { } }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CModelData.cpp0000644000175000017500000000206112520551354024621 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CModelData.h" namespace Konclude { namespace Utilities { namespace Container { CModelData::CModelData() { } CModelData::~CModelData() { } }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CVector.cpp0000644000175000017500000000217412520551356024240 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CVECTOR_CPP #define KONCLUDE_UTILITIES_CONTAINER_CVECTOR_CPP #include "CVector.h" namespace Konclude { namespace Utilities { namespace Container { }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CVECTOR_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CModelData.h0000644000175000017500000000337012520551354024272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CMODELDATA_H #define KONCLUDE_UTILITIES_CONTAINER_CMODELDATA_H // Libraries includes // Namespace includes #include "ContainerSettings.h" // Other includes #include "Utilities/CAllocationObject.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CModelData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CModelData : public CAllocationObject { // public methods public: //! Constructor CModelData(); //! Destructor virtual ~CModelData(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CMODELDATA_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtSet.h0000644000175000017500000000514212520551356023501 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTSET_H #define KONCLUDE_UTILITIES_CONTAINER_CQTSET_H // Namespace includes #include "ContainerSettings.h" #ifdef KONCLUDE_EMPLOY_QT_SET_CONTAINER // Library includes #include // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Utilities { namespace Container { /*! * * \class CQtSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CQtSet : public QSet { // public methods public: inline CQtSet() : QSet() {} inline CQtSet(CContext* context) : QSet() {} inline CQtSet(const CQtSet& other) : QSet(other) {} inline CQtSet(const CQtSet& other, CContext* context) : QSet(other) {} inline CQtSet(const QSet& other) : QSet(other) {} inline CQtSet(const QSet& other, CContext* context) : QSet(other) {} inline CQtSet* init(CContext* context = nullptr) { QSet::clear(); return this; } inline CQtSet* init(const CQtSet& other, CContext* context = nullptr) { this->operator =(other); return this; } inline CQtSet* init(const CQtSet* other, CContext* context = nullptr) { if (other) { this->operator =(*other); } else { QSet::clear(); } return this; } // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CQtSet.cpp" #endif // KONCLUDE_EMPLOY_QT_SET_CONTAINER #endif // KONCLUDE_UTILITIES_CONTAINER_CQTSET_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CModelDataLevelArray.h0000644000175000017500000001260712520551354026264 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CMODELDATALEVELARRAY_H #define KONCLUDE_UTILITIES_CONTAINER_CMODELDATALEVELARRAY_H // Libraries includes // Namespace includes #include "ContainerSettings.h" #include "CModelData.h" #include "CModelDataArray.h" #include "CDataArrayMemoryManager.h" // Other includes #include "Utilities/CMath.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; namespace Utilities { namespace Container { /*! * * \class CModelDataLevelArray * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CModelDataLevelArray : public CModelDataArray { // public methods public: //! Constructor CModelDataLevelArray(); CModelDataLevelArray(qint64 tagBegin, qint64 tagBegEndSize); //! Destructor virtual ~CModelDataLevelArray(); virtual CModelDataArray *init(qint64 tagBegin = 0, qint64 tagBegEndSize = 64); virtual bool isBaseLevel(); virtual qint64 getModelLevel(); virtual CModelDataArray **getModelArray(); virtual CModelDataArray *getNextModelArray(qint64 index); virtual CModelDataArray *setNextModelArray(qint64 index, CModelDataArray *nextModelDataArray); virtual CModelDataArray *createNextModelArray(qint64 index, CDataArrayMemoryManager *modelMemMan); virtual CModelDataLevelArray *setBounds(qint64 tagBegin = 0, qint64 tagBegEndSize = 64); virtual CModelDataLevelArray *setData(bool value = false); virtual bool setFlag(qint64 tag, bool flag, CDataArrayMemoryManager *modelMemMan); virtual bool setFlag(qint64 tag, bool flag = true); virtual bool getFlag(qint64 tag); virtual CModelDataArray *getBaseModel(qint64 beginTag); virtual qint64 countFlags(); virtual qint64 getFirstFlagTag(); virtual qint64 getLastFlagTag(); virtual CModelDataArray *intersectWith(CModelDataArray *modelData, bool *flagModification = 0); virtual CModelDataArray *unionWith(CModelDataArray *modelData, bool *flagModification = 0); virtual CModelDataArray *intersectWith(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification = 0); virtual CModelDataArray *unionWith(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification = 0); virtual CModelDataArray *copyFrom(CModelDataArray *modelData, bool *flagModification = 0); virtual CModelDataArray *copyFrom(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification = 0); virtual qint64 getArrayIndex(qint64 tag); virtual bool isFullConstructed(); static CModelDataArray *extendModel(CModelDataArray *modelData, qint64 minBegTag, qint64 minEndTag, CDataArrayMemoryManager *modelMemMan); static CModelDataArray *extendModel(CModelDataArray *modelData, qint64 minTag, CDataArrayMemoryManager *modelMemMan); static CModelDataArray *extendModel(CModelDataArray *modelData, CModelDataArray *minModelDataExt, CDataArrayMemoryManager *modelMemMan); static CModelDataArray *extendAndUnionModelWith(CModelDataArray *modelData, CModelDataArray *minModelDataExt, CDataArrayMemoryManager *modelMemMan, bool *flagModification = 0); static CModelDataArray *extendAndCopyModelFrom(CModelDataArray *modelData, CModelDataArray *minModelDataExt, CDataArrayMemoryManager *modelMemMan, bool *flagModification = 0); static CModelDataArray *reduceAndIntersecModelWith(CModelDataArray *modelData, CModelDataArray *minModelDataExt, CDataArrayMemoryManager *modelMemMan, bool *flagModification = 0); static CModelDataArray *extendAndSetFlag(CModelDataArray *modelData, qint64 tag, CDataArrayMemoryManager *modelMemMan, bool *flagModification = 0); static CModelDataArray *reduceModel(CModelDataArray *modelData); static bool testHasIntersectBetween(CModelDataArray *modelData1, CModelDataArray *modelData2); static bool testIsSubsetBetween(CModelDataArray *modelData1, CModelDataArray *modelData2); virtual bool hasIntersectionWith(CModelDataArray *modelData); virtual qint64 countIntersectionWith(CModelDataArray *modelData); virtual bool isSubsetFrom(CModelDataArray *modelData); virtual bool isSuperSetTo(CModelDataArray *modelData); // protected methods protected: // protected variables protected: CModelDataArray *modelArray[dataSize]; qint64 level; // private methods private: // private variables private: }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CMODELDATALEVELARRAY_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtVector.h0000644000175000017500000000340212520551356024205 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTVECTOR_H #define KONCLUDE_UTILITIES_CONTAINER_CQTVECTOR_H // Namespace includes #include "ContainerSettings.h" #ifdef KONCLUDE_EMPLOY_QT_VECTOR_CONTAINER // Library includes #include // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CQtVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CQtVector : public QVector { // public methods public: // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CQtVector.cpp" #endif // KONCLUDE_EMPLOY_QT_VECTOR_CONTAINER #endif // KONCLUDE_UTILITIES_CONTAINER_CQTVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CSet.cpp0000644000175000017500000000216012520551356023524 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CSET_CPP #define KONCLUDE_UTILITIES_CONTAINER_CSET_CPP #include "CSet.h" namespace Konclude { namespace Utilities { namespace Container { }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CSET_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CList.h0000644000175000017500000000342712520551354023356 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CLIST_H #define KONCLUDE_UTILITIES_CONTAINER_CLIST_H // Library includes // Namespace includes #include "ContainerSettings.h" #ifdef KONCLUDE_CONTAINER_LIST_USE_QT_LIST_FOR_DEFAULT #include "CQtList.h" #endif // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CList * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CList #ifdef KONCLUDE_CONTAINER_LIST_USE_QT_LIST_FOR_DEFAULT : public CQtList #endif { // public methods public: // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CList.cpp" #endif // KONCLUDE_UTILITIES_CONTAINER_CLIST_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CDynamicReferenceBucket.cpp0000644000175000017500000003436312520551352027340 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CDYNAMICREFERENCEBUCKET_CPP #define KONCLUDE_UTILITIES_CONTAINER_CDYNAMICREFERENCEBUCKET_CPP #include "CDynamicReferenceBucket.h" namespace Konclude { namespace Utilities { namespace Container { template CDynamicReferenceBucketBase::CDynamicReferenceBucketBase(CContext* context) : mContext(context) { mMemMan = CContext::getMemoryAllocationManager(mContext); } template CDynamicReferenceBucketBase::~CDynamicReferenceBucketBase() { } template CDynamicReferenceBucketBase* CDynamicReferenceBucketBase::getRelevantReferenceBucket(CDynamicReferenceBucketBase* bucket) { CDynamicReferenceBucketBase* relevantBucket = bucket; while (relevantBucket->mVec == nullptr) { relevantBucket = relevantBucket->mReferenceBucket; } return relevantBucket; } template CDynamicReferenceBucketBase* CDynamicReferenceBucketBase::getUpdatedRelevantReferenceBucket(CDynamicReferenceBucketBase* bucket) { CDynamicReferenceBucketBase* relevantBucket = bucket; if (bucket) { while (relevantBucket && relevantBucket->mVec == nullptr) { relevantBucket = relevantBucket->mReferenceBucket; } bucket->mReferenceBucket = relevantBucket; } return relevantBucket; } template void CDynamicReferenceBucketBase::installBucket(cint64 index, CDynamicReferenceBucketBase* bucket) { cint64 bucketIndex = getBucketIndex(index,this); if (mVec == nullptr) { bool isBaseBucket = mBucketDepth == 0; CDynamicReferenceBucketBase* refBucket = nullptr; refBucket = getUpdatedRelevantReferenceBucket(this); mVec = createBucketVector(refBucket,isBaseBucket); } CReferenceBucketDataPair* referenceBucketPair = &mVec[bucketIndex]; referenceBucketPair->mReferenced = false; referenceBucketPair->mUninitialized = false; referenceBucketPair->mBucketData.mBucket = bucket; } template bool CDynamicReferenceBucketBase::hasLocalData(cint64 index) { CDynamicReferenceBucketBase* nextBucket = this; while (nextBucket) { if (nextBucket->mVec == nullptr) { return false; } cint64 bucketIndex = getBucketIndex(index,nextBucket); CReferenceBucketDataPair* referenceBucketPair = &nextBucket->mVec[bucketIndex]; if (referenceBucketPair->mReferenced) { return false; } bool isBaseBucket = nextBucket->mBucketDepth == 0; if (isBaseBucket) { return !referenceBucketPair->mUninitialized; } nextBucket = referenceBucketPair->mBucketData.mBucket; } return false; } template bool CDynamicReferenceBucketBase::hasReferencedData(cint64 index) { CDynamicReferenceBucketBase* nextBucket = this; bool isReferenced = false; while (nextBucket) { if (nextBucket->mVec == nullptr) { nextBucket = getUpdatedRelevantReferenceBucket(nextBucket); if (nextBucket == nullptr) { return false; } isReferenced = true; } cint64 bucketIndex = getBucketIndex(index,nextBucket); CReferenceBucketDataPair* referenceBucketPair = &nextBucket->mVec[bucketIndex]; bool isBaseBucket = nextBucket->mBucketDepth == 0; if (isBaseBucket) { isReferenced |= referenceBucketPair->mReferenced; if (isReferenced) { return !referenceBucketPair->mUninitialized; } else { return false; } } if (referenceBucketPair->mReferenced) { // bucket is referenced isReferenced = true; // update reference nextBucket = referenceBucketPair->mBucketData.mBucket; nextBucket = getUpdatedRelevantReferenceBucket(nextBucket); referenceBucketPair->mBucketData.mBucket = nextBucket; } else { nextBucket = referenceBucketPair->mBucketData.mBucket; } } return false; } template const T CDynamicReferenceBucketBase::getData(cint64 index, const T& defaultValue, bool* localFlag) { CDynamicReferenceBucketBase* nextBucket = this; bool isReferenced = false; while (nextBucket) { if (nextBucket->mVec == nullptr) { nextBucket = getUpdatedRelevantReferenceBucket(nextBucket); if (nextBucket == nullptr) { return defaultValue; } isReferenced = true; } cint64 bucketIndex = getBucketIndex(index,nextBucket); CReferenceBucketDataPair* referenceBucketPair = &nextBucket->mVec[bucketIndex]; bool isBaseBucket = nextBucket->mBucketDepth == 0; if (isBaseBucket) { isReferenced |= referenceBucketPair->mReferenced; if (referenceBucketPair->mUninitialized) { return defaultValue; } else { if (localFlag) { *localFlag = !isReferenced; } return referenceBucketPair->mBucketData.mData; } } if (referenceBucketPair->mReferenced) { // bucket is referenced isReferenced = true; // update reference nextBucket = referenceBucketPair->mBucketData.mBucket; nextBucket = getUpdatedRelevantReferenceBucket(nextBucket); referenceBucketPair->mBucketData.mBucket = nextBucket; } else { nextBucket = referenceBucketPair->mBucketData.mBucket; } } return defaultValue; } template bool CDynamicReferenceBucketBase::hasData(cint64 index) { CDynamicReferenceBucketBase* nextBucket = this; while (nextBucket) { if (nextBucket->mVec == nullptr) { nextBucket = getUpdatedRelevantReferenceBucket(nextBucket); if (nextBucket == nullptr) { return false; } } cint64 bucketIndex = getBucketIndex(index,nextBucket); CReferenceBucketDataPair* referenceBucketPair = &nextBucket->mVec[bucketIndex]; bool isBaseBucket = nextBucket->mBucketDepth == 0; if (isBaseBucket) { return !referenceBucketPair->mUninitialized; } if (referenceBucketPair->mReferenced) { // bucket is referenced // update reference nextBucket = referenceBucketPair->mBucketData.mBucket; nextBucket = getUpdatedRelevantReferenceBucket(nextBucket); referenceBucketPair->mBucketData.mBucket = nextBucket; } else { nextBucket = referenceBucketPair->mBucketData.mBucket; } } return false; } template const T CDynamicReferenceBucketBase::getData(cint64 index, const T& defaultValue) { CDynamicReferenceBucketBase* nextBucket = this; while (nextBucket) { if (nextBucket->mVec == nullptr) { nextBucket = getUpdatedRelevantReferenceBucket(nextBucket); if (nextBucket == nullptr) { return defaultValue; } } cint64 bucketIndex = getBucketIndex(index,nextBucket); CReferenceBucketDataPair* referenceBucketPair = &nextBucket->mVec[bucketIndex]; bool isBaseBucket = nextBucket->mBucketDepth == 0; if (isBaseBucket) { if (referenceBucketPair->mUninitialized) { return defaultValue; } else { return referenceBucketPair->mBucketData.mData; } } if (referenceBucketPair->mReferenced) { // bucket is referenced // update reference nextBucket = referenceBucketPair->mBucketData.mBucket; nextBucket = getUpdatedRelevantReferenceBucket(nextBucket); referenceBucketPair->mBucketData.mBucket = nextBucket; } else { nextBucket = referenceBucketPair->mBucketData.mBucket; } } return defaultValue; } template cint64 CDynamicReferenceBucketBase::getBucketIndex(cint64 index) { cint64 bucketIndex = (index & (BUCKETINDEXMASK << mBucketDepth)) >> mBucketDepth; return bucketIndex; } template cint64 CDynamicReferenceBucketBase::getBucketIndex(cint64 index, CDynamicReferenceBucketBase* bucket) { cint64 bucketDepth = bucket->mBucketDepth; cint64 bucketIndex = (index & (BUCKETINDEXMASK << bucketDepth)) >> bucketDepth; return bucketIndex; } template const T CDynamicReferenceBucketBase::getLocalData(cint64 index, const T& defaultValue) { CDynamicReferenceBucketBase* nextBucket = this; while (nextBucket) { if (nextBucket->mVec == nullptr) { return defaultValue; } cint64 bucketIndex = getBucketIndex(index,nextBucket); CReferenceBucketDataPair* referenceBucketPair = &nextBucket->mVec[bucketIndex]; if (referenceBucketPair->mReferenced) { return defaultValue; } bool isBaseBucket = nextBucket->mBucketDepth == 0; if (isBaseBucket) { if (!referenceBucketPair->mUninitialized) { return referenceBucketPair->mBucketData.mData; } else { return defaultValue; } } nextBucket = referenceBucketPair->mBucketData.mBucket; } return defaultValue; } template const T CDynamicReferenceBucketBase::getReferenceData(cint64 index, const T& defaultValue) { CDynamicReferenceBucketBase* nextBucket = this; bool isReferenced = false; while (nextBucket) { if (!isReferenced && nextBucket->mReferenceBucket) { nextBucket = nextBucket->mReferenceBucket; isReferenced = true; } if (nextBucket->mVec == nullptr) { nextBucket = getUpdatedRelevantReferenceBucket(nextBucket); if (nextBucket == nullptr) { return defaultValue; } isReferenced = true; } cint64 bucketIndex = getBucketIndex(index,nextBucket); CReferenceBucketDataPair* referenceBucketPair = &nextBucket->mVec[bucketIndex]; bool isBaseBucket = nextBucket->mBucketDepth == 0; if (isBaseBucket) { isReferenced |= referenceBucketPair->mReferenced; if (isReferenced && !referenceBucketPair->mUninitialized) { return referenceBucketPair->mBucketData.mData; } else { return defaultValue; } } if (referenceBucketPair->mReferenced) { // bucket is referenced isReferenced = true; // update reference nextBucket = referenceBucketPair->mBucketData.mBucket; nextBucket = getUpdatedRelevantReferenceBucket(nextBucket); referenceBucketPair->mBucketData.mBucket = nextBucket; } else { nextBucket = referenceBucketPair->mBucketData.mBucket; } } return defaultValue; } template void CDynamicReferenceBucketBase::setLocalData(cint64 index, const T& data) { CDynamicReferenceBucketBase* nextBucket = this; while (nextBucket) { bool isBaseBucket = nextBucket->mBucketDepth == 0; if (nextBucket->mVec == nullptr) { CDynamicReferenceBucketBase* refBucket = nullptr; refBucket = getUpdatedRelevantReferenceBucket(nextBucket); nextBucket->mVec = createBucketVector(refBucket,isBaseBucket); } cint64 bucketIndex = getBucketIndex(index,nextBucket); CReferenceBucketDataPair* referenceBucketPair = &nextBucket->mVec[bucketIndex]; if (isBaseBucket) { referenceBucketPair->mBucketData.mData = data; referenceBucketPair->mReferenced = false; referenceBucketPair->mUninitialized = false; return; } if (referenceBucketPair->mReferenced || !referenceBucketPair->mBucketData.mBucket) { nextBucket = createBucket(nextBucket->mBucketDepth-(bucket2Size+1),referenceBucketPair); } CDynamicReferenceBucketBase* possNextBucket = referenceBucketPair->mBucketData.mBucket; if (!possNextBucket) { possNextBucket = createBucket(nextBucket->mBucketDepth-bucket2Size,referenceBucketPair); } nextBucket = possNextBucket; } } template void CDynamicReferenceBucketBase::setData(cint64 index, const T& data) { setLocalData(index,data); } template void CDynamicReferenceBucketBase::initBucket(cint64 bucketDepth, CDynamicReferenceBucketBase* referenceBucket) { mBucketDepth = bucketDepth; mReferenceBucket = referenceBucket; mVec = nullptr; } template CDynamicReferenceBucketBase* CDynamicReferenceBucketBase::createBucket(cint64 bucketDepth, CReferenceBucketDataPair* bucketPos) { CDynamicReferenceBucketBase* refBucket = nullptr; if (bucketPos && bucketPos->mReferenced) { refBucket = bucketPos->mBucketData.mBucket; } CDynamicReferenceBucketBase* bucket = CObjectParameterizingAllocator< CDynamicReferenceBucketBase,CContext* >::allocateAndConstructAndParameterize(mMemMan,mContext); bucket->initBucket(bucketDepth,refBucket); bucketPos->mReferenced = false; bucketPos->mUninitialized = false; bucketPos->mBucketData.mBucket = bucket; return bucket; } }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CDYNAMICREFERENCEBUCKET_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CDefaultDynamicReferenceVector.h0000644000175000017500000000556012520551352030334 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CDEFAULTDYNAMICREFERENCEVECTOR_H #define KONCLUDE_UTILITIES_CONTAINER_CDEFAULTDYNAMICREFERENCEVECTOR_H // Namespace includes #include "ContainerSettings.h" // Library includes // Other includes #include "CDynamicReferenceVector.h" // Logger includes namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CDefaultDynamicReferenceVectorBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CDefaultDynamicReferenceVectorBase : public CDynamicReferenceVectorBase { // public methods public: //! Constructor inline CDefaultDynamicReferenceVectorBase(CContext* context = nullptr); //! Destructor inline ~CDefaultDynamicReferenceVectorBase(); inline const T getData(cint64 index); inline const T getData(cint64 index, bool* localFlag); inline const T getLocalData(cint64 index); inline const T getReferenceData(cint64 index); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; /*! * * \class CDefaultDynamicReferenceVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CDefaultDynamicReferenceVector : public CDefaultDynamicReferenceVectorBase,bucket2Size> { // public methods public: // Constructor inline CDefaultDynamicReferenceVector(CContext* context = nullptr) : CDefaultDynamicReferenceVectorBase,bucket2Size>(context) {}; //! Destructor inline ~CDefaultDynamicReferenceVector() {}; }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CDefaultDynamicReferenceVector.cpp" #endif // KONCLUDE_UTILITIES_CONTAINER_CDEFAULTDYNAMICREFERENCEVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationHash.h0000644000175000017500000004062412520551354031467 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONHASH_H #define KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONHASH_H // Namespace includes #include "ContainerSettings.h" #include "CQtManagedRestrictedModificationHashBase.h" #include "CQtManagedRestrictedModificationHashData.h" #include "CQtManagedRestrictedModificationList.h" #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_HASH_CONTAINER // Library includes #include // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Utilities { namespace Container { /*! * * \class CQtManagedRestrictedModificationHash * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template struct CQtManagedRestrictedModificationHashNode { CQtManagedRestrictedModificationHashNode *next; uint h; Key key; T value; inline CQtManagedRestrictedModificationHashNode(const Key &key0) : key(key0) {} // ### remove in 5.0 inline CQtManagedRestrictedModificationHashNode(const Key &key0, const T &value0) : key(key0), value(value0) {} inline bool same_key(uint h0, const Key &key0) { return h0 == h && key0 == key; } }; template struct CQtManagedRestrictedModificationHashDummyNode { CQtManagedRestrictedModificationHashDummyNode *next; uint h; Key key; inline CQtManagedRestrictedModificationHashDummyNode(const Key &key0) : key(key0) {} }; struct CQtManagedRestrictedModificationHashDummyValue { }; inline bool operator==(const CQtManagedRestrictedModificationHashDummyValue & /* v1 */, const CQtManagedRestrictedModificationHashDummyValue & /* v2 */) { return true; } template class CQtManagedRestrictedModificationHash : public CQtManagedRestrictedModificationHashBase { typedef CQtManagedRestrictedModificationHashDummyNode DummyNode; typedef CQtManagedRestrictedModificationHashNode Node; union { CQtManagedRestrictedModificationHashData *d; CQtManagedRestrictedModificationHashNode *e; }; CContext* mContext; CMemoryAllocationManager* mMemMan; static inline Node *concrete(CQtManagedRestrictedModificationHashData::Node *node) { return reinterpret_cast(node); } #ifdef Q_ALIGNOF static inline int alignOfNode() { return qMax(sizeof(void*), Q_ALIGNOF(Node)); } static inline int alignOfDummyNode() { return qMax(sizeof(void*), Q_ALIGNOF(DummyNode)); } #else static inline int alignOfNode() { return 0; } static inline int alignOfDummyNode() { return 0; } #endif public: inline CQtManagedRestrictedModificationHash() : d(&CQtManagedRestrictedModificationHashData::shared_null),mContext(nullptr) { mMemMan = CContext::getMemoryAllocationManager(mContext); /*d->ref.ref();*/ } inline CQtManagedRestrictedModificationHash(CContext* context) : d(&CQtManagedRestrictedModificationHashData::shared_null),mContext(context) { mMemMan = CContext::getMemoryAllocationManager(mContext); /*d->ref.ref();*/ } inline CQtManagedRestrictedModificationHash(const CQtManagedRestrictedModificationHash &other) : d(other.d),mContext(nullptr) { mMemMan = CContext::getMemoryAllocationManager(mContext); /* d->ref.ref();*/ if (!d->sharable) detach(); } inline CQtManagedRestrictedModificationHash(const CQtManagedRestrictedModificationHash &other, CContext* context) : d(other.d),mContext(context) { mMemMan = CContext::getMemoryAllocationManager(mContext); /* d->ref.ref();*/ if (!d->sharable) detach(); } inline ~CQtManagedRestrictedModificationHash() { if (/*!d->ref.deref()*/ d->refHash == this) freeData(d); } CQtManagedRestrictedModificationHash* init(CContext* context = nullptr); CQtManagedRestrictedModificationHash* init(const CQtManagedRestrictedModificationHash &other, CContext* context = nullptr); CQtManagedRestrictedModificationHash* init(CQtManagedRestrictedModificationHash *other, CContext* context = nullptr); CQtManagedRestrictedModificationHash &operator=(const CQtManagedRestrictedModificationHash &other); bool operator==(const CQtManagedRestrictedModificationHash &other) const; inline bool operator!=(const CQtManagedRestrictedModificationHash &other) const { return !(*this == other); } inline int size() const { return d->size; } inline bool isEmpty() const { return d->size == 0; } inline int capacity() const { return d->numBuckets; } void reserve(int size); inline void squeeze() { reserve(1); } inline void detach() { if (/*d->ref != 1*/d->refHash != this) detach_helper(); } inline void detachRestrictedCopy(void* assistValue) { if (/*d->ref != 1*/d->refHash != this) detach_helper_RestrictedCopy(assistValue); } inline bool isDetached() const { return /*d->ref == 1;*/ d->refHash == this; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } void clear(); int remove(const Key &key); T take(const Key &key); bool contains(const Key &key) const; const Key key(const T &value) const; const Key key(const T &value, const Key &defaultKey) const; const T value(const Key &key) const; const T value(const Key &key, const T &defaultValue) const; T &operator[](const Key &key); const T operator[](const Key &key) const; bool tryGetValuePointer(const Key& key, T*& valuePointer) const; bool tryGetValue(const Key& key, T* value = nullptr) const; T* valuePointer(const Key& key) const; QList uniqueKeys() const; QList keys() const; QList keys(const T &value) const; QList values() const; QList values(const Key &key) const; CQtManagedRestrictedModificationList uniqueKeysInManagedRestrictedModificationList(CContext* context = nullptr) const; CQtManagedRestrictedModificationList keysInManagedRestrictedModificationList(CContext* context = nullptr) const; CQtManagedRestrictedModificationList keysInManagedRestrictedModificationList(const T &value, CContext* context = nullptr) const; CQtManagedRestrictedModificationList valuesInManagedRestrictedModificationList(CContext* context = nullptr) const; CQtManagedRestrictedModificationList valuesInManagedRestrictedModificationList(const Key &key, CContext* context = nullptr) const; int count(const Key &key) const; class const_iterator; class iterator { friend class const_iterator; CQtManagedRestrictedModificationHashData::Node *i; public: typedef std::bidirectional_iterator_tag iterator_category; typedef ptrdiff_t difference_type; typedef T value_type; typedef T *pointer; typedef T &reference; // ### Qt 5: get rid of 'operator Node *' inline operator Node *() const { return concrete(i); } inline iterator() : i(0) { } explicit inline iterator(void *node) : i(reinterpret_cast(node)) { } inline const Key &key() const { return concrete(i)->key; } inline T &value() const { return concrete(i)->value; } inline T &operator*() const { return concrete(i)->value; } inline T *operator->() const { return &concrete(i)->value; } inline bool operator==(const iterator &o) const { return i == o.i; } inline bool operator!=(const iterator &o) const { return i != o.i; } inline iterator &operator++() { i = CQtManagedRestrictedModificationHashData::nextNode(i); return *this; } inline iterator operator++(int) { iterator r = *this; i = CQtManagedRestrictedModificationHashData::nextNode(i); return r; } inline iterator &operator--() { i = CQtManagedRestrictedModificationHashData::previousNode(i); return *this; } inline iterator operator--(int) { iterator r = *this; i = CQtManagedRestrictedModificationHashData::previousNode(i); return r; } inline iterator operator+(int j) const { iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; } inline iterator operator-(int j) const { return operator+(-j); } inline iterator &operator+=(int j) { return *this = *this + j; } inline iterator &operator-=(int j) { return *this = *this - j; } // ### Qt 5: not sure this is necessary anymore #ifdef QT_STRICT_ITERATORS private: #else public: #endif inline bool operator==(const const_iterator &o) const { return i == o.i; } inline bool operator!=(const const_iterator &o) const { return i != o.i; } private: // ### Qt 5: remove inline operator bool() const { return false; } }; friend class iterator; class const_iterator { friend class iterator; CQtManagedRestrictedModificationHashData::Node *i; public: typedef std::bidirectional_iterator_tag iterator_category; typedef ptrdiff_t difference_type; typedef T value_type; typedef const T *pointer; typedef const T &reference; // ### Qt 5: get rid of 'operator Node *' inline operator Node *() const { return concrete(i); } inline const_iterator() : i(0) { } explicit inline const_iterator(void *node) : i(reinterpret_cast(node)) { } #ifdef QT_STRICT_ITERATORS explicit inline const_iterator(const iterator &o) #else inline const_iterator(const iterator &o) #endif { i = o.i; } inline const Key &key() const { return concrete(i)->key; } inline const T &value() const { return concrete(i)->value; } inline const T &operator*() const { return concrete(i)->value; } inline const T *operator->() const { return &concrete(i)->value; } inline bool operator==(const const_iterator &o) const { return i == o.i; } inline bool operator!=(const const_iterator &o) const { return i != o.i; } inline const_iterator &operator++() { i = CQtManagedRestrictedModificationHashData::nextNode(i); return *this; } inline const_iterator operator++(int) { const_iterator r = *this; i = CQtManagedRestrictedModificationHashData::nextNode(i); return r; } inline const_iterator &operator--() { i = CQtManagedRestrictedModificationHashData::previousNode(i); return *this; } inline const_iterator operator--(int) { const_iterator r = *this; i = CQtManagedRestrictedModificationHashData::previousNode(i); return r; } inline const_iterator operator+(int j) const { const_iterator r = *this; if (j > 0) while (j--) ++r; else while (j++) --r; return r; } inline const_iterator operator-(int j) const { return operator+(-j); } inline const_iterator &operator+=(int j) { return *this = *this + j; } inline const_iterator &operator-=(int j) { return *this = *this - j; } // ### Qt 5: not sure this is necessary anymore #ifdef QT_STRICT_ITERATORS private: inline bool operator==(const iterator &o) const { return operator==(const_iterator(o)); } inline bool operator!=(const iterator &o) const { return operator!=(const_iterator(o)); } #endif private: // ### Qt 5: remove inline operator bool() const { return false; } }; friend class const_iterator; // STL style inline iterator begin() { detach(); return iterator(d->firstNode()); } inline const_iterator begin() const { return const_iterator(d->firstNode()); } inline const_iterator constBegin() const { return const_iterator(d->firstNode()); } inline iterator end() { detach(); return iterator(e); } inline const_iterator end() const { return const_iterator(e); } inline const_iterator constEnd() const { return const_iterator(e); } iterator erase(iterator it); // more Qt typedef iterator Iterator; typedef const_iterator ConstIterator; inline int count() const { return d->size; } iterator find(const Key &key); const_iterator find(const Key &key) const; const_iterator constFind(const Key &key) const; iterator insert(const Key &key, const T &value); iterator insertMulti(const Key &key, const T &value); CQtManagedRestrictedModificationHash &unite(const CQtManagedRestrictedModificationHash &other); // STL compatibility typedef T mapped_type; typedef Key key_type; typedef ptrdiff_t difference_type; typedef int size_type; inline bool empty() const { return isEmpty(); } #ifdef QT_CQTMANAGEDONEWAYMUTATIONHASH_DEBUG inline void dump() const { d->dump(); } inline void checkSanity() const { d->checkSanity(); } #endif private: void detach_helper(); void detach_helper_RestrictedCopy(void* assistValue); void freeData(CQtManagedRestrictedModificationHashData *d); Node **findNode(const Key &key, uint *hp = 0) const; Node *createNode(uint h, const Key &key, const T &value, Node **nextNode); void deleteNode(Node *node); static void deleteNode2(CQtManagedRestrictedModificationHashData::Node *node); static void duplicateNode(CQtManagedRestrictedModificationHashData::Node *originalNode, void *newNode); static bool copyRestricted_helper(CQtManagedRestrictedModificationHashData::Node *originalNode, void* assistValue); }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CQtManagedRestrictedModificationHash.cpp" #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_HASH_CONTAINER #endif // KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONHASH_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationSet.h0000644000175000017500000003353412520551356031343 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONSET_H #define KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONSET_H // Namespace includes #include "ContainerSettings.h" #include "CQtManagedRestrictedModificationHash.h" #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_SET_CONTAINER // Library includes #include #include // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Utilities { namespace Container { /*! * * \class CQtManagedRestrictedModificationSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CQtManagedRestrictedModificationSet { typedef CQtManagedRestrictedModificationHash Hash; public: inline CQtManagedRestrictedModificationSet(CContext* context = nullptr) : mContext(context),mHash(context) {} inline CQtManagedRestrictedModificationSet(const CQtManagedRestrictedModificationSet &other) : mHash(other.mHash,nullptr),mContext(nullptr) {} inline CQtManagedRestrictedModificationSet(const CQtManagedRestrictedModificationSet &other, CContext* context) : mContext(context),mHash(other.mHash,context) {} CQtManagedRestrictedModificationSet* init(CContext* context = nullptr); CQtManagedRestrictedModificationSet* init(const CQtManagedRestrictedModificationSet &other, CContext* context = nullptr); CQtManagedRestrictedModificationSet* init(CQtManagedRestrictedModificationSet *other, CContext* context = nullptr); inline CQtManagedRestrictedModificationSet &operator=(const CQtManagedRestrictedModificationSet &other) { mHash.init(other.mHash,mContext); return *this; } inline bool operator==(const CQtManagedRestrictedModificationSet &other) const { return mHash == other.mHash; } inline bool operator!=(const CQtManagedRestrictedModificationSet &other) const { return mHash != other.mHash; } inline int size() const { return mHash.size(); } inline bool isEmpty() const { return mHash.isEmpty(); } inline int capacity() const { return mHash.capacity(); } inline void reserve(int size); inline void squeeze() { mHash.squeeze(); } inline void detach() { mHash.detach(); } inline bool isDetached() const { return mHash.isDetached(); } inline void setSharable(bool sharable) { mHash.setSharable(sharable); } inline void clear() { mHash.clear(); } inline bool remove(const T &value) { return mHash.remove(value) != 0; } inline bool contains(const T &value) const { return mHash.contains(value); } bool contains(const CQtManagedRestrictedModificationSet &set) const; class const_iterator; class iterator { typedef CQtManagedRestrictedModificationHash Hash; typename Hash::iterator i; friend class const_iterator; public: typedef std::bidirectional_iterator_tag iterator_category; typedef qptrdiff difference_type; typedef T value_type; typedef const T *pointer; typedef const T &reference; inline iterator() {} inline iterator(typename Hash::iterator o) : i(o) {} inline iterator(const iterator &o) : i(o.i) {} inline iterator &operator=(const iterator &o) { i = o.i; return *this; } inline const T &operator*() const { return i.key(); } inline const T *operator->() const { return &i.key(); } inline bool operator==(const iterator &o) const { return i == o.i; } inline bool operator!=(const iterator &o) const { return i != o.i; } inline bool operator==(const const_iterator &o) const { return i == o.i; } inline bool operator!=(const const_iterator &o) const { return i != o.i; } inline iterator &operator++() { ++i; return *this; } inline iterator operator++(int) { iterator r = *this; ++i; return r; } inline iterator &operator--() { --i; return *this; } inline iterator operator--(int) { iterator r = *this; --i; return r; } inline iterator operator+(int j) const { return i + j; } inline iterator operator-(int j) const { return i - j; } inline iterator &operator+=(int j) { i += j; return *this; } inline iterator &operator-=(int j) { i -= j; return *this; } }; class const_iterator { typedef CQtManagedRestrictedModificationHash Hash; typename Hash::const_iterator i; friend class iterator; public: typedef std::bidirectional_iterator_tag iterator_category; typedef qptrdiff difference_type; typedef T value_type; typedef const T *pointer; typedef const T &reference; inline const_iterator() {} inline const_iterator(typename Hash::const_iterator o) : i(o) {} inline const_iterator(const const_iterator &o) : i(o.i) {} inline const_iterator(const iterator &o) : i(o.i) {} inline const_iterator &operator=(const const_iterator &o) { i = o.i; return *this; } inline const T &operator*() const { return i.key(); } inline const T *operator->() const { return &i.key(); } inline bool operator==(const const_iterator &o) const { return i == o.i; } inline bool operator!=(const const_iterator &o) const { return i != o.i; } inline const_iterator &operator++() { ++i; return *this; } inline const_iterator operator++(int) { const_iterator r = *this; ++i; return r; } inline const_iterator &operator--() { --i; return *this; } inline const_iterator operator--(int) { const_iterator r = *this; --i; return r; } inline const_iterator operator+(int j) const { return i + j; } inline const_iterator operator-(int j) const { return i - j; } inline const_iterator &operator+=(int j) { i += j; return *this; } inline const_iterator &operator-=(int j) { i -= j; return *this; } }; // STL style inline iterator begin() { return mHash.begin(); } inline const_iterator begin() const { return mHash.begin(); } inline const_iterator constBegin() const { return mHash.constBegin(); } inline iterator end() { return mHash.end(); } inline const_iterator end() const { return mHash.end(); } inline const_iterator constEnd() const { return mHash.constEnd(); } iterator erase(iterator i) { return mHash.erase(reinterpret_cast(i)); } // more Qt typedef iterator Iterator; typedef const_iterator ConstIterator; inline int count() const { return mHash.count(); } inline const_iterator insert(const T &value) // ### Qt 5: should return an 'iterator' { return static_cast(mHash.insert(value, CQtManagedRestrictedModificationHashDummyValue())); } iterator find(const T &value) { return mHash.find(value); } const_iterator find(const T &value) const { return mHash.find(value); } inline const_iterator constFind(const T &value) const { return find(value); } CQtManagedRestrictedModificationSet &unite(const CQtManagedRestrictedModificationSet &other); CQtManagedRestrictedModificationSet &intersect(const CQtManagedRestrictedModificationSet &other); CQtManagedRestrictedModificationSet &subtract(const CQtManagedRestrictedModificationSet &other); // STL compatibility typedef T key_type; typedef T value_type; typedef value_type *pointer; typedef const value_type *const_pointer; typedef value_type &reference; typedef const value_type &const_reference; typedef qptrdiff difference_type; typedef int size_type; inline bool empty() const { return isEmpty(); } // comfort inline CQtManagedRestrictedModificationSet &operator<<(const T &value) { insert(value); return *this; } inline CQtManagedRestrictedModificationSet &operator|=(const CQtManagedRestrictedModificationSet &other) { unite(other); return *this; } inline CQtManagedRestrictedModificationSet &operator|=(const T &value) { insert(value); return *this; } inline CQtManagedRestrictedModificationSet &operator&=(const CQtManagedRestrictedModificationSet &other) { intersect(other); return *this; } inline CQtManagedRestrictedModificationSet &operator&=(const T &value) { CQtManagedRestrictedModificationSet result; if (contains(value)) result.insert(value); return (*this = result); } inline CQtManagedRestrictedModificationSet &operator+=(const CQtManagedRestrictedModificationSet &other) { unite(other); return *this; } inline CQtManagedRestrictedModificationSet &operator+=(const T &value) { insert(value); return *this; } inline CQtManagedRestrictedModificationSet &operator-=(const CQtManagedRestrictedModificationSet &other) { subtract(other); return *this; } inline CQtManagedRestrictedModificationSet &operator-=(const T &value) { remove(value); return *this; } inline CQtManagedRestrictedModificationSet operator|(const CQtManagedRestrictedModificationSet &other) const { CQtManagedRestrictedModificationSet result = *this; result |= other; return result; } inline CQtManagedRestrictedModificationSet operator&(const CQtManagedRestrictedModificationSet &other) const { CQtManagedRestrictedModificationSet result = *this; result &= other; return result; } inline CQtManagedRestrictedModificationSet operator+(const CQtManagedRestrictedModificationSet &other) const { CQtManagedRestrictedModificationSet result = *this; result += other; return result; } inline CQtManagedRestrictedModificationSet operator-(const CQtManagedRestrictedModificationSet &other) const { CQtManagedRestrictedModificationSet result = *this; result -= other; return result; } #if QT_VERSION < 0x050000 // ### Qt 5: remove inline CQtManagedRestrictedModificationSet operator|(const CQtManagedRestrictedModificationSet &other) { CQtManagedRestrictedModificationSet result = *this; result |= other; return result; } inline CQtManagedRestrictedModificationSet operator&(const CQtManagedRestrictedModificationSet &other) { CQtManagedRestrictedModificationSet result = *this; result &= other; return result; } inline CQtManagedRestrictedModificationSet operator+(const CQtManagedRestrictedModificationSet &other) { CQtManagedRestrictedModificationSet result = *this; result += other; return result; } inline CQtManagedRestrictedModificationSet operator-(const CQtManagedRestrictedModificationSet &other) { CQtManagedRestrictedModificationSet result = *this; result -= other; return result; } #endif QList toList() const; inline QList values() const { return toList(); } static CQtManagedRestrictedModificationSet fromList(const QList &list); private: Hash mHash; CContext* mContext; }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CQtManagedRestrictedModificationSet.cpp" #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_SET_CONTAINER #endif // KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONSET_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtSet.cpp0000644000175000017500000000231412520551356024032 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTSET_CPP #define KONCLUDE_UTILITIES_CONTAINER_CQTSET_CPP #include "CQtSet.h" namespace Konclude { namespace Utilities { namespace Container { #ifdef KONCLUDE_EMPLOY_QT_SET_CONTAINER #endif // KONCLUDE_EMPLOY_QT_SET_CONTAINER }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CQTSET_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationSet.cpp0000644000175000017500000001601012520551356031664 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONSET_CPP #define KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONSET_CPP #include "CQtManagedRestrictedModificationSet.h" namespace Konclude { namespace Utilities { namespace Container { #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_SET_CONTAINER template Q_INLINE_TEMPLATE void CQtManagedRestrictedModificationSet::reserve(int asize) { mHash.reserve(asize); } template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationSet &CQtManagedRestrictedModificationSet::unite(const CQtManagedRestrictedModificationSet &other) { CQtManagedRestrictedModificationSet copy(other); typename CQtManagedRestrictedModificationSet::const_iterator i = copy.constEnd(); while (i != copy.constBegin()) { --i; insert(*i); } return *this; } template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationSet &CQtManagedRestrictedModificationSet::intersect(const CQtManagedRestrictedModificationSet &other) { CQtManagedRestrictedModificationSet copy1(*this); CQtManagedRestrictedModificationSet copy2(other); typename CQtManagedRestrictedModificationSet::const_iterator i = copy1.constEnd(); while (i != copy1.constBegin()) { --i; if (!copy2.contains(*i)) remove(*i); } return *this; } template Q_INLINE_TEMPLATE CQtManagedRestrictedModificationSet &CQtManagedRestrictedModificationSet::subtract(const CQtManagedRestrictedModificationSet &other) { CQtManagedRestrictedModificationSet copy1(*this); CQtManagedRestrictedModificationSet copy2(other); typename CQtManagedRestrictedModificationSet::const_iterator i = copy1.constEnd(); while (i != copy1.constBegin()) { --i; if (copy2.contains(*i)) remove(*i); } return *this; } template Q_INLINE_TEMPLATE bool CQtManagedRestrictedModificationSet::contains(const CQtManagedRestrictedModificationSet &other) const { typename CQtManagedRestrictedModificationSet::const_iterator i = other.constBegin(); while (i != other.constEnd()) { if (!contains(*i)) return false; ++i; } return true; } template Q_OUTOFLINE_TEMPLATE QList CQtManagedRestrictedModificationSet::toList() const { QList result; result.reserve(size()); typename CQtManagedRestrictedModificationSet::const_iterator i = constBegin(); while (i != constEnd()) { result.append(*i); ++i; } return result; } //template //Q_OUTOFLINE_TEMPLATE CQtManagedRestrictedModificationSet QList::toSet() const //{ // CQtManagedRestrictedModificationSet result; // result.reserve(size()); // for (int i = 0; i < size(); ++i) // result.insert(at(i)); // return result; //} template CQtManagedRestrictedModificationSet CQtManagedRestrictedModificationSet::fromList(const QList &list) { return list.toSet(); } //template //QList QList::fromSet(const CQtManagedRestrictedModificationSet &set) //{ // return set.toList(); //} template CQtManagedRestrictedModificationSet* CQtManagedRestrictedModificationSet::init(CContext* context) { mHash.init(mContext); mContext = context; return this; } template CQtManagedRestrictedModificationSet* CQtManagedRestrictedModificationSet::init(const CQtManagedRestrictedModificationSet &other, CContext* context) { mHash.init(other.mHash,mContext); mContext = context; return this; } template CQtManagedRestrictedModificationSet* CQtManagedRestrictedModificationSet::init(CQtManagedRestrictedModificationSet *other, CContext* context) { if (other) { mHash.init(other->mHash,mContext); } else { mHash.init(mContext); } mContext = context; return this; } #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_SET_CONTAINER }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONSET_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationListData.h0000644000175000017500000001250212520551356032305 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONLISTDATA_H #define KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONLISTDATA_H // Namespace includes #include "ContainerSettings.h" #include "CQtManagedRestrictedModificationListBase.h" #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_LIST_CONTAINER // Library includes #include // Other includes #include "Utilities/Memory/CMemoryAllocationManager.h" #include "Utilities/Memory/CObjectAllocator.h" #include "Utilities/Memory/CMemoryAllocator.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { using namespace Memory; namespace Container { /*! * * \class CQtManagedRestrictedModificationListData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ struct CQtManagedRestrictedModificationListData { struct Data { //QBasicAtomicInt ref; CQtManagedRestrictedModificationListBase* refList; int alloc, begin, end; uint sharable : 1; void *array[1]; }; enum { DataHeaderSize = sizeof(Data) - sizeof(void *) }; Data *detach(int alloc, CMemoryAllocationManager* memMan, CQtManagedRestrictedModificationListBase* listBase); Data *detach_grow(int *i, int n, CMemoryAllocationManager* memMan, CQtManagedRestrictedModificationListBase* listBase); void realloc(int alloc, CMemoryAllocationManager* memMan); static Data shared_null; Data *d; void **erase(void **xi); void **append(int n, CMemoryAllocationManager* memMan); void **append(CMemoryAllocationManager* memMan); void **append(const CQtManagedRestrictedModificationListData &l, CMemoryAllocationManager* memMan); void **append2(const CQtManagedRestrictedModificationListData &l, CMemoryAllocationManager* memMan); void **prepend(CMemoryAllocationManager* memMan); void **insert(int i, CMemoryAllocationManager* memMan); void remove(int i); void remove(int i, int n); void move(int from, int to); inline int size() const { return d->end - d->begin; } inline bool isEmpty() const { return d->end == d->begin; } inline void **at(int i) const { return d->array + d->begin + i; } inline void **begin() const { return d->array + d->begin; } inline void **end() const { return d->array + d->end; } }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_LIST_CONTAINER #endif // KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONLISTDATA_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CModelDataArray.h0000644000175000017500000001054412520551354025272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CMODELDATAARRAY_H #define KONCLUDE_UTILITIES_CONTAINER_CMODELDATAARRAY_H // Libraries includes // Namespace includes #include "ContainerSettings.h" #include "CModelData.h" #include "CDataArrayMemoryManager.h" // Other includes #include "Utilities/CMath.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CModelDataArray * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CModelDataArray : public CModelData { // public methods public: //! Constructor CModelDataArray(); CModelDataArray(qint64 tagBegin, qint64 tagBegEndSize); //! Destructor virtual ~CModelDataArray(); virtual CModelDataArray *init(qint64 tagBegin = 0, qint64 tagBegEndSize = 64); virtual qint64 getBeginTag(); virtual qint64 getEndTag(); virtual qint64 getTagSize(); virtual qint64 getDataArray(); virtual bool isBaseLevel(); virtual qint64 getModelLevel(); virtual CModelDataArray *setBounds(qint64 tagBegin = 0, qint64 tagBegEndSize = 64); virtual CModelDataArray *setData(bool value = false); virtual CModelDataArray *setLevelData(bool value = false); virtual CModelDataArray *getBaseModel(qint64 beginTag); virtual bool setFlag(qint64 tag, bool flag, CDataArrayMemoryManager *modelMemMan); virtual bool setFlag(qint64 tag, bool flag = true); virtual bool getFlag(qint64 tag); virtual bool setLevelFlag(qint64 tag, bool flag = true); virtual bool getLevelFlag(qint64 tag); virtual bool setLevelFlagIndex(qint64 index, bool flag = true); virtual bool getLevelFlagIndex(qint64 index); virtual qint64 getFirstFlagTag(); virtual qint64 getLastFlagTag(); virtual bool isEmpty(); virtual CModelDataArray *intersectWith(CModelDataArray *modelData, bool *flagModification = 0); virtual CModelDataArray *unionWith(CModelDataArray *modelData, bool *flagModification = 0); virtual CModelDataArray *intersectWith(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification = 0); virtual CModelDataArray *unionWith(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification = 0); virtual CModelDataArray *copyFrom(CModelDataArray *modelData, bool *flagModification = 0); virtual CModelDataArray *copyFrom(CModelDataArray *modelData, CDataArrayMemoryManager *modelMemMan, bool *flagModification = 0); virtual qint64 countFlags(); virtual bool hasIntersectionWith(CModelDataArray *modelData); virtual qint64 countIntersectionWith(CModelDataArray *modelData); virtual bool isSubsetFrom(CModelDataArray *modelData); virtual bool isSuperSetTo(CModelDataArray *modelData); virtual bool needsExtension(qint64 minBegTag, qint64 minEndTag); virtual bool needsExtension(qint64 tag); virtual bool needsExtension(CModelDataArray *otherModelData); virtual bool isFullConstructed(); // protected methods protected: // protected variables protected: static const qint64 dataSize = 64; static const qint64 log2DataSize = 6; qint64 dataArray; qint64 begTag; qint64 endTag; qint64 tagSize; qint64 bitIndMask; qint64 bitIndShift; // private methods private: // private variables private: }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CMODELDATAARRAY_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CLinker.cpp0000644000175000017500000001171012520551354024214 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CLINKER_CPP #define KONCLUDE_UTILITIES_CONTAINER_CLINKER_CPP #include "CLinker.h" namespace Konclude { namespace Utilities { namespace Container { template CLinkerBase::CLinkerBase() { next = 0; } template CLinkerBase::CLinkerBase(const T& dataElement, CLinkerBase* nextLink) { next = 0; setNext(nextLink); data = dataElement; } template CLinkerBase::~CLinkerBase() { } template S* CLinkerBase::initLinker(const T& dataElement, CLinkerBase* nextLink) { next = 0; setNext(nextLink); data = dataElement; return (S*)this; } template bool CLinkerBase::hasNext() const { return next != 0; } template S* CLinkerBase::insertNext(CLinkerBase* nextLink) { if (nextLink) { CLinkerBase *tmpNext = next; next = nextLink; if (tmpNext) { nextLink->append(tmpNext); } } return (S*)this; } template inline S* CLinkerBase::clearNext() { next = nullptr; return (S*)this; } template S* CLinkerBase::getNext() const { return (S*)next; } template S* CLinkerBase::setNext(CLinkerBase* nextLink) { next = nextLink; return (S*)this; } template T& CLinkerBase::getData() { return data; } template S* CLinkerBase::setData(const T& dataElement) { data = dataElement; return (S*)this; } template S* CLinkerBase::append(CLinkerBase* appendingList) { CLinkerBase* last = getLastListLink(); last->setNext(appendingList); return (S*)this; } template S* CLinkerBase::getRemovedNext() { CLinkerBase* tmpNext = next; if (next) { CLinkerBase* tmpNextNext = next->next; next->next = 0; setNext(tmpNextNext); } return (S*)tmpNext; } template S* CLinkerBase::getLastListLink() const { const CLinkerBase* lastListLink = this; while (lastListLink->hasNext()) { lastListLink = lastListLink->getNext(); } return (S*)lastListLink; } template cint64 CLinkerBase::getCount() const { int linkerCount = 0; const CLinkerBase* itemLinker = this; while (itemLinker != nullptr) { ++linkerCount; itemLinker = itemLinker->getNext(); } return linkerCount; } template cint64 CLinkerBase::size() const { return getCount(); } template bool CLinkerBase::contains(const T& dataElement) const { CLinkerBase* itemLinker = this; while (itemLinker != nullptr) { if (itemLinker->getData() == dataElement) { return true; } itemLinker = itemLinker->getNext(); } return false; } template S* CLinkerBase::removeOne(const T& dataElement) { CLinkerBase* loc = this; if (loc->getData() == dataElement) { loc = loc->getNext(); return (S*)loc; } else { while (loc) { CLinkerBase* nxt = loc->getNext(); if (nxt) { if (nxt->getData() == dataElement) { loc->setNext(nxt->getNext()); return (S*)this; } } loc = loc->getNext(); } } return (S*)this; } template S* CLinkerBase::removeAll(const T& dataElement) { CLinkerBase* first = this; CLinkerBase* loc = this; while (loc->getData() == dataElement) { loc = loc->getNext(); first = loc; } while (loc) { CLinkerBase* nxt = loc->getNext(); if (nxt) { if (nxt->getData() == dataElement) { loc->setNext(nxt->getNext()); } } loc = loc->getNext(); } return (S*)this; } }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CLINKER_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CDynamicReferenceVector.cpp0000644000175000017500000001506212520551352027360 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CDYNAMICREFERENCEVECTOR_CPP #define KONCLUDE_UTILITIES_CONTAINER_CDYNAMICREFERENCEVECTOR_CPP #include "CDynamicReferenceVector.h" namespace Konclude { namespace Utilities { namespace Container { template CDynamicReferenceVectorBase::CDynamicReferenceVectorBase(CContext* context) : mContext(context) { clear(); } template CDynamicReferenceVectorBase::~CDynamicReferenceVectorBase() { } template const T CDynamicReferenceVectorBase::getData(cint64 index, const T& defaultValue) { if (mRootBucket && index >= 0 && index < mMaxIndex) { return mRootBucket->getData(index,defaultValue); } return defaultValue; } template const T CDynamicReferenceVectorBase::getData(cint64 index, const T& defaultValue, bool* localFlag) { if (mRootBucket && index >= 0 && index < mMaxIndex) { return mRootBucket->getData(index,defaultValue,localFlag); } return defaultValue; } template const T CDynamicReferenceVectorBase::getLocalData(cint64 index, const T& defaultValue) { if (mRootBucket && index >= 0 && index < mMaxIndex) { return mRootBucket->getLocalData(index,defaultValue); } return defaultValue; } template const T CDynamicReferenceVectorBase::getReferenceData(cint64 index, const T& defaultValue) { if (mRootBucket && index >= 0 && index < mMaxIndex) { return mRootBucket->getReferenceData(index,defaultValue); } return defaultValue; } template S* CDynamicReferenceVectorBase::setLocalData(cint64 index, const T& data) { mMaxItem = qMax(index,mMaxItem); if (!mRootBucket) { mRootBucket = CObjectParameterizingAllocator< CDynamicReferenceBucketBase,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mContext),mContext); mRootBucket->initBucket(0,nullptr); mRootBucketDepth = 0; mMaxIndex = 2<= mMaxIndex) { CDynamicReferenceBucketBase* newRootBucket = CObjectParameterizingAllocator< CDynamicReferenceBucketBase,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mContext),mContext); mRootBucketDepth += bucket2Size+1; newRootBucket->initBucket(mRootBucketDepth,nullptr); newRootBucket->installBucket(0,mRootBucket); mRootBucket = newRootBucket; if (mMaxIndex == 0) { mMaxIndex = 2<setLocalData(index,data); return (S*)this; } template S* CDynamicReferenceVectorBase::setData(cint64 index, const T& data) { setLocalData(index,data); return (S*)this; } template bool CDynamicReferenceVectorBase::hasLocalData(cint64 index) { if (mRootBucket && index >= 0 && index < mMaxIndex) { return mRootBucket->hasLocalData(index); } return false; } template bool CDynamicReferenceVectorBase::hasData(cint64 index) { if (mRootBucket && index >= 0 && index < mMaxIndex) { return mRootBucket->hasData(index); } return false; } template bool CDynamicReferenceVectorBase::hasReferencedData(cint64 index) { if (mRootBucket && index >= 0 && index < mMaxIndex) { return mRootBucket->hasReferencedData(index); } return false; } template S* CDynamicReferenceVectorBase::clear() { mMaxIndex = 0; mRootBucketDepth = 0; mMaxItem = -1; mRootBucket = nullptr; mReferenceVector = nullptr; mReferencedMaxItem = -1; return (S*)this; } template S* CDynamicReferenceVectorBase::referenceVector(CDynamicReferenceVectorBase* refVector) { clear(); mReferenceVector = refVector; if (mReferenceVector && mReferenceVector->mMaxIndex > 0) { mRootBucket = CObjectParameterizingAllocator< CDynamicReferenceBucketBase,CContext* >::allocateAndConstructAndParameterize(CContext::getMemoryAllocationManager(mContext),mContext); mRootBucket->initBucket(refVector->mRootBucketDepth,mReferenceVector->mRootBucket); mRootBucketDepth = refVector->mRootBucketDepth; mMaxIndex = refVector->mMaxIndex; mMaxItem = refVector->mMaxItem; mReferencedMaxItem = refVector->mMaxItem; } return (S*)this; } template cint64 CDynamicReferenceVectorBase::getItemCount() { return mMaxItem+1; } template cint64 CDynamicReferenceVectorBase::getItemMaxIndex() { return mMaxItem; } template cint64 CDynamicReferenceVectorBase::getReferencedItemCount() { return mReferencedMaxItem+1; } template cint64 CDynamicReferenceVectorBase::getReferencedItemMaxIndex() { return mReferencedMaxItem; } }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CDYNAMICREFERENCEVECTOR_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtList.h0000644000175000017500000000535712520551354023667 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTLIST_H #define KONCLUDE_UTILITIES_CONTAINER_CQTLIST_H // Namespace includes #include "ContainerSettings.h" #ifdef KONCLUDE_EMPLOY_QT_LIST_CONTAINER // Library includes #include // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Utilities { namespace Container { /*! * * \class CQtList * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CQtList : public QList { // public methods public: inline CQtList() : QList() {} inline CQtList(CContext* context) : QList() {} inline CQtList(const CQtList &l) : QList(l) {} inline CQtList(const CQtList &l, CContext* context) : QList(l) {} inline CQtList(const QList &l) : QList(l) {} inline CQtList(const QList &l, CContext* context) : QList(l) {} inline CQtList(const T &t) : QList() { append(t); } inline CQtList(const T &t, CContext* context) : QList() { append(t); } inline CQtList* init(CContext* context = nullptr) { QList::clear(); return this; } inline CQtList* init(const CQtList& other, CContext* context = nullptr) { this->operator =(other); return this; } inline CQtList* init(const CQtList* other, CContext* context = nullptr) { if (other) { this->operator =(*other); } else { QList::clear(); } return this; } // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CQtList.cpp" #endif // KONCLUDE_EMPLOY_QT_LIST_CONTAINER #endif // KONCLUDE_UTILITIES_CONTAINER_CQTLIST_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationListBase.h0000644000175000017500000000723012520551354032306 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONLISTBASE_H #define KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONLISTBASE_H // Namespace includes #include "ContainerSettings.h" #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_LIST_CONTAINER // Library includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CQtManagedRestrictedModificationListBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtManagedRestrictedModificationListBase { }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_LIST_CONTAINER #endif // KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONLISTBASE_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CSortedNegLinker.h0000644000175000017500000000710112520551356025475 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CSORTEDNEGLINKER_H #define KONCLUDE_UTILITIES_CONTAINER_CSORTEDNEGLINKER_H // Namespace includes #include "ContainerSettings.h" #include "CSortedLinker.h" #include "CNegLinker.h" // Library includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { template class CNegLinkerOperatorCompareFunctor; template class CNegLinkerOperatorCompareFunctor { public: static inline bool sortedNegLinkerDataCompare(T* const & beforeData1, const bool& negation1, T* const & data2, const bool& negation2) { return *beforeData1 <= *data2; } }; template class CNegLinkerOperatorCompareFunctor { public: static inline bool sortedNegLinkerDataCompare(const T& beforeData1, const bool& negation1, const T& data2, const bool& negation2) { return beforeData1 <= data2; } }; /*! * * \class CSortedNegLinkerBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template > class CSortedNegLinkerBase : public CNegLinkerBase { // public methods public: // Constructor inline CSortedNegLinkerBase(); inline CSortedNegLinkerBase(const T& dataElement, bool negation = false, CSortedNegLinkerBase* nextLink = nullptr); //! Destructor inline ~CSortedNegLinkerBase(); S* insertSortedNextSorted(CSortedNegLinkerBase* nextLink); S* insertNextSorted(CSortedNegLinkerBase* nextLink); // protected methods protected: bool isSortedBeforeCompare(const T& checkData, const bool& checkNegation, const T& linkedData, const bool& linkedNegation) const; // protected variables protected: // private methods private: // private variables private: }; /*! * * \class CSortedNegLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template > class CXSortedNegLinker : public CSortedNegLinkerBase,C> { // public methods public: // Constructor inline CXSortedNegLinker() : CSortedNegLinkerBase,C>() {}; inline CXSortedNegLinker(const T& dataElement, bool negation = false, CXSortedNegLinker* nextLink = nullptr) : CSortedNegLinkerBase,C>(dataElement,negation,nextLink) {}; //! Destructor inline ~CXSortedNegLinker() {}; }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CSortedNegLinker.cpp" #endif // KONCLUDE_UTILITIES_CONTAINER_CSORTEDNEGLINKER_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationListBase.cppKonclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationListBase.c0000644000175000017500000000573212520551354032306 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #include "CQtManagedRestrictedModificationListBase.h" namespace Konclude { namespace Utilities { namespace Container { }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CNegator.cpp0000644000175000017500000000174612520551354024377 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNegator.h" namespace Konclude { namespace Utilities { namespace Container { }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationList.h0000644000175000017500000004024712520551354031520 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONLIST_H #define KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONLIST_H // Namespace includes #include "ContainerSettings.h" #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_LIST_CONTAINER #include "CQtManagedRestrictedModificationListData.h" #include "CQtManagedRestrictedModificationListBase.h" // Library includes #include // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Context; namespace Utilities { namespace Container { /*! * * \class CQtManagedRestrictedModificationList * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CQtManagedRestrictedModificationList : public CQtManagedRestrictedModificationListBase { struct Node { void *v; #if defined(Q_CC_BOR) Q_INLINE_TEMPLATE T &t(); #else Q_INLINE_TEMPLATE T &t() { return *reinterpret_cast(QTypeInfo::isLarge || QTypeInfo::isStatic ? v : this); } #endif }; union { CQtManagedRestrictedModificationListData p; CQtManagedRestrictedModificationListData::Data *d; }; CContext* mContext; CMemoryAllocationManager* mMemMan; public: inline CQtManagedRestrictedModificationList() : d(&CQtManagedRestrictedModificationListData::shared_null),mContext(nullptr) { mMemMan = CContext::getMemoryAllocationManager(mContext); /*d->ref.ref();*/ } inline CQtManagedRestrictedModificationList(CContext* context) : d(&CQtManagedRestrictedModificationListData::shared_null),mContext(context) { mMemMan = CContext::getMemoryAllocationManager(mContext); /*d->ref.ref();*/ } inline CQtManagedRestrictedModificationList(const CQtManagedRestrictedModificationList &l) : d(l.d),mContext(nullptr) { mMemMan = CContext::getMemoryAllocationManager(mContext); /*d->ref.ref();*/ if (!d->sharable) detach_helper(); } inline CQtManagedRestrictedModificationList(const CQtManagedRestrictedModificationList &l, CContext* context) : d(l.d),mContext(context) { mMemMan = CContext::getMemoryAllocationManager(mContext); /*d->ref.ref();*/ if (!d->sharable) detach_helper(); } ~CQtManagedRestrictedModificationList(); CQtManagedRestrictedModificationList* init(CContext* context = nullptr); CQtManagedRestrictedModificationList* init(const CQtManagedRestrictedModificationList &other, CContext* context = nullptr); CQtManagedRestrictedModificationList* init(const CQtManagedRestrictedModificationList *other, CContext* context = nullptr); CQtManagedRestrictedModificationList &operator=(const CQtManagedRestrictedModificationList &l); bool operator==(const CQtManagedRestrictedModificationList &l) const; inline bool operator!=(const CQtManagedRestrictedModificationList &l) const { return !(*this == l); } inline int size() const { return p.size(); } inline void detach() { if (d->refList != this/*d->ref != 1*/) detach_helper(); } inline void detachShared() { // The "this->" qualification is needed for GCCE. if (d->refList != this/*d->ref != 1*/ && this->d != &CQtManagedRestrictedModificationListData::shared_null) detach_helper(); } inline bool isDetached() const { return /*d->ref == 1*/d->refList == this; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } inline bool isSharedWith(const CQtManagedRestrictedModificationList &other) const { return d == other.d; } inline bool isEmpty() const { return p.isEmpty(); } void clear(); const T &at(int i) const; const T &operator[](int i) const; T &operator[](int i); void reserve(int size); void append(const T &t); void append(const CQtManagedRestrictedModificationList &t); void prepend(const T &t); void insert(int i, const T &t); void replace(int i, const T &t); void removeAt(int i); int removeAll(const T &t); bool removeOne(const T &t); T takeAt(int i); T takeFirst(); T takeLast(); void move(int from, int to); void swap(int i, int j); int indexOf(const T &t, int from = 0) const; int lastIndexOf(const T &t, int from = -1) const; bool contains(const T &t) const; int count(const T &t) const; class const_iterator; class iterator { public: Node *i; typedef std::random_access_iterator_tag iterator_category; typedef qptrdiff difference_type; typedef T value_type; typedef T *pointer; typedef T &reference; inline iterator() : i(0) {} inline iterator(Node *n) : i(n) {} inline iterator(const iterator &o): i(o.i){} inline T &operator*() const { return i->t(); } inline T *operator->() const { return &i->t(); } inline T &operator[](int j) const { return i[j].t(); } inline bool operator==(const iterator &o) const { return i == o.i; } inline bool operator!=(const iterator &o) const { return i != o.i; } inline bool operator<(const iterator& other) const { return i < other.i; } inline bool operator<=(const iterator& other) const { return i <= other.i; } inline bool operator>(const iterator& other) const { return i > other.i; } inline bool operator>=(const iterator& other) const { return i >= other.i; } #ifndef QT_STRICT_ITERATORS inline bool operator==(const const_iterator &o) const { return i == o.i; } inline bool operator!=(const const_iterator &o) const { return i != o.i; } inline bool operator<(const const_iterator& other) const { return i < other.i; } inline bool operator<=(const const_iterator& other) const { return i <= other.i; } inline bool operator>(const const_iterator& other) const { return i > other.i; } inline bool operator>=(const const_iterator& other) const { return i >= other.i; } #endif inline iterator &operator++() { ++i; return *this; } inline iterator operator++(int) { Node *n = i; ++i; return n; } inline iterator &operator--() { i--; return *this; } inline iterator operator--(int) { Node *n = i; i--; return n; } inline iterator &operator+=(int j) { i+=j; return *this; } inline iterator &operator-=(int j) { i-=j; return *this; } inline iterator operator+(int j) const { return iterator(i+j); } inline iterator operator-(int j) const { return iterator(i-j); } inline int operator-(iterator j) const { return int(i - j.i); } }; friend class iterator; class const_iterator { public: Node *i; typedef std::random_access_iterator_tag iterator_category; typedef qptrdiff difference_type; typedef T value_type; typedef const T *pointer; typedef const T &reference; inline const_iterator() : i(0) {} inline const_iterator(Node *n) : i(n) {} inline const_iterator(const const_iterator &o): i(o.i) {} #ifdef QT_STRICT_ITERATORS inline explicit const_iterator(const iterator &o): i(o.i) {} #else inline const_iterator(const iterator &o): i(o.i) {} #endif inline const T &operator*() const { return i->t(); } inline const T *operator->() const { return &i->t(); } inline const T &operator[](int j) const { return i[j].t(); } inline bool operator==(const const_iterator &o) const { return i == o.i; } inline bool operator!=(const const_iterator &o) const { return i != o.i; } inline bool operator<(const const_iterator& other) const { return i < other.i; } inline bool operator<=(const const_iterator& other) const { return i <= other.i; } inline bool operator>(const const_iterator& other) const { return i > other.i; } inline bool operator>=(const const_iterator& other) const { return i >= other.i; } inline const_iterator &operator++() { ++i; return *this; } inline const_iterator operator++(int) { Node *n = i; ++i; return n; } inline const_iterator &operator--() { i--; return *this; } inline const_iterator operator--(int) { Node *n = i; i--; return n; } inline const_iterator &operator+=(int j) { i+=j; return *this; } inline const_iterator &operator-=(int j) { i-=j; return *this; } inline const_iterator operator+(int j) const { return const_iterator(i+j); } inline const_iterator operator-(int j) const { return const_iterator(i-j); } inline int operator-(const_iterator j) const { return i - j.i; } }; friend class const_iterator; // stl style inline iterator begin() { detach(); return reinterpret_cast(p.begin()); } inline const_iterator begin() const { return reinterpret_cast(p.begin()); } inline const_iterator constBegin() const { return reinterpret_cast(p.begin()); } inline iterator end() { detach(); return reinterpret_cast(p.end()); } inline const_iterator end() const { return reinterpret_cast(p.end()); } inline const_iterator constEnd() const { return reinterpret_cast(p.end()); } iterator insert(iterator before, const T &t); iterator erase(iterator pos); iterator erase(iterator first, iterator last); // more Qt typedef iterator Iterator; typedef const_iterator ConstIterator; inline int count() const { return p.size(); } inline int length() const { return p.size(); } // Same as count() inline T& first() { Q_ASSERT(!isEmpty()); return *begin(); } inline const T& first() const { Q_ASSERT(!isEmpty()); return at(0); } T& last() { Q_ASSERT(!isEmpty()); return *(--end()); } const T& last() const { Q_ASSERT(!isEmpty()); return at(count() - 1); } inline void removeFirst() { Q_ASSERT(!isEmpty()); erase(begin()); } inline void removeLast() { Q_ASSERT(!isEmpty()); erase(--end()); } inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; } inline bool endsWith(const T &t) const { return !isEmpty() && last() == t; } CQtManagedRestrictedModificationList mid(int pos, int length = -1) const; T value(int i) const; T value(int i, const T &defaultValue) const; // stl compatibility inline void push_back(const T &t) { append(t); } inline void push_front(const T &t) { prepend(t); } inline T& front() { return first(); } inline const T& front() const { return first(); } inline T& back() { return last(); } inline const T& back() const { return last(); } inline void pop_front() { removeFirst(); } inline void pop_back() { removeLast(); } inline bool empty() const { return isEmpty(); } typedef int size_type; typedef T value_type; typedef value_type *pointer; typedef const value_type *const_pointer; typedef value_type &reference; typedef const value_type &const_reference; typedef qptrdiff difference_type; #ifdef QT3_SUPPORT inline QT3_SUPPORT iterator remove(iterator pos) { return erase(pos); } inline QT3_SUPPORT int remove(const T &t) { return removeAll(t); } inline QT3_SUPPORT int findIndex(const T& t) const { return indexOf(t); } inline QT3_SUPPORT iterator find(const T& t) { int i = indexOf(t); return (i == -1 ? end() : (begin()+i)); } inline QT3_SUPPORT const_iterator find (const T& t) const { int i = indexOf(t); return (i == -1 ? end() : (begin()+i)); } inline QT3_SUPPORT iterator find(iterator from, const T& t) { int i = indexOf(t, from - begin()); return i == -1 ? end() : begin()+i; } inline QT3_SUPPORT const_iterator find(const_iterator from, const T& t) const { int i = indexOf(t, from - begin()); return i == -1 ? end() : begin()+i; } #endif // comfort CQtManagedRestrictedModificationList &operator+=(const CQtManagedRestrictedModificationList &l); inline CQtManagedRestrictedModificationList operator+(const CQtManagedRestrictedModificationList &l) const { CQtManagedRestrictedModificationList n = *this; n += l; return n; } inline CQtManagedRestrictedModificationList &operator+=(const T &t) { append(t); return *this; } inline CQtManagedRestrictedModificationList &operator<< (const T &t) { append(t); return *this; } inline CQtManagedRestrictedModificationList &operator<<(const CQtManagedRestrictedModificationList &l) { *this += l; return *this; } QVector toVector() const; QSet toSet() const; static CQtManagedRestrictedModificationList fromVector(const QVector &vector); static CQtManagedRestrictedModificationList fromSet(const QSet &set); #ifndef QT_NO_STL static inline CQtManagedRestrictedModificationList fromStdList(const std::list &list) { CQtManagedRestrictedModificationList tmp; qCopy(list.begin(), list.end(), std::back_inserter(tmp)); return tmp; } inline std::list toStdList() const { std::list tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; } #endif private: Node *detach_helper_grow(int i, int n); void detach_helper(int alloc); void detach_helper(); void free(CQtManagedRestrictedModificationListData::Data *d); void node_construct(Node *n, const T &t); void node_destruct(Node *n); void node_copy(Node *from, Node *to, Node *src); void node_destruct(Node *from, Node *to); }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CQtManagedRestrictedModificationList.cpp" #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_LIST_CONTAINER #endif // KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONLIST_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CHash.cpp0000644000175000017500000000216412520551352023654 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CHASH_CPP #define KONCLUDE_UTILITIES_CONTAINER_CHASH_CPP #include "CHash.h" namespace Konclude { namespace Utilities { namespace Container { }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CHASH_CPP Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CNegator.h0000644000175000017500000000450012520551354024033 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CNEGATOR_H #define KONCLUDE_UTILITIES_CONTAINER_CNEGATOR_H // Namespace includes #include "ContainerSettings.h" // Library includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CNegator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNegator { // public methods public: //! Constructor inline CNegator() : mNegation(false) {} inline CNegator(const CNegator& negator) { mNegation = negator.mNegation; } inline CNegator(const bool& negated) { mNegation = negated; } //! Destructor inline ~CNegator() {} inline bool isNegated() const { return mNegation; } inline CNegator* initNeg(bool negation) { mNegation = negation; return this; } inline bool getNegation() const { return isNegated(); } inline CNegator* setNegation(bool negated) { mNegation = negated; return this; } inline bool toggleNegation(bool toggle = true) { return mNegation = mNegation^toggle; } // protected methods protected: // protected variables protected: bool mNegation; // private methods private: // private variables private: }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CONTAINER_CNEGATOR_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CQtManagedRestrictedModificationMapData.h0000644000175000017500000001242312520551356032111 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * * This file incorporates work covered by the following copyright and * permission notice: * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * Contact: http://www.qt-project.org/legal * * This file is part of the QtCore module of the Qt Toolkit. * * $QT_BEGIN_LICENSE:LGPL$ * Commercial License Usage * Licensees holding valid commercial Qt licenses may use this file in * accordance with the commercial license agreement provided with the * Software or, alternatively, in accordance with the terms contained in * a written agreement between you and Digia. For licensing terms and * conditions see http://qt.digia.com/licensing. For further information * use the contact form at http://qt.digia.com/contact-us. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 2.1 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPL included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 2.1 requirements * will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. * * In addition, as a special exception, Digia gives you certain additional * rights. These rights are described in the Digia Qt LGPL Exception * version 1.1, included in the file LGPL_EXCEPTION.txt in this package. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 3.0 as published by the Free Software * Foundation and appearing in the file LICENSE.GPL included in the * packaging of this file. Please review the following information to * ensure the GNU General Public License version 3.0 requirements will be * met: http://www.gnu.org/copyleft/gpl.html. * * * $QT_END_LICENSE$ * * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONMAPDATA_H #define KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONMAPDATA_H // Namespace includes #include "ContainerSettings.h" #include "CQtManagedRestrictedModificationMapBase.h" #ifdef KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_MAP_CONTAINER // Library includes #include // Other includes #include "Utilities/Memory/CMemoryAllocationManager.h" #include "Utilities/Memory/CObjectAllocator.h" #include "Utilities/Memory/CMemoryAllocator.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { using namespace Memory; namespace Container { /*! * * \class CQtManagedRestrictedModificationMapData * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ struct CQtManagedRestrictedModificationMapData { struct Node { Node *backward; Node *forward[1]; }; enum { LastLevel = 11, Sparseness = 3 }; CQtManagedRestrictedModificationMapData *backward; CQtManagedRestrictedModificationMapData *forward[CQtManagedRestrictedModificationMapData::LastLevel + 1]; //QBasicAtomicInt ref; CQtManagedRestrictedModificationMapBase *refMap; int topLevel; int size; uint randomBits; uint insertInOrder : 1; uint sharable : 1; uint strictAlignment : 1; uint reserved : 29; static CQtManagedRestrictedModificationMapData *createData(CQtManagedRestrictedModificationMapBase* referenceMap, CMemoryAllocationManager* memMan); // ### Qt5 remove me static CQtManagedRestrictedModificationMapData *createData(int alignment, CQtManagedRestrictedModificationMapBase* referenceMap, CMemoryAllocationManager* memMan); void continueFreeData(int offset, CMemoryAllocationManager* memMan); Node *node_create(Node *update[], int offset, CMemoryAllocationManager* memMan); // ### Qt5 remove me Node *node_create(Node *update[], int offset, int alignment, CMemoryAllocationManager* memMan); void node_delete(Node *update[], int offset, Node *node, CMemoryAllocationManager* memMan); #ifdef KONCLUDE_CQTMANAGEDRESTRICTEDMODIFICATIONMAP_DEBUG uint adjust_ptr(Node *node); void dump(); #endif static CQtManagedRestrictedModificationMapData shared_null; }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_EMPLOY_QT_MANAGED_RESTRICTED_MODIFICATION_MAP_CONTAINER #endif // KONCLUDE_UTILITIES_CONTAINER_CQTMANAGEDRESTRICTEDMODIFICATIONMAPDATA_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/Container/CSet.h0000644000175000017500000000341312520551356023173 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CONTAINER_CSET_H #define KONCLUDE_UTILITIES_CONTAINER_CSET_H // Library includes // Namespace includes #include "ContainerSettings.h" #ifdef KONCLUDE_CONTAINER_SET_USE_QT_SET_FOR_DEFAULT #include "CQtSet.h" #endif // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { namespace Container { /*! * * \class CSet * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CSet #ifdef KONCLUDE_CONTAINER_SET_USE_QT_SET_FOR_DEFAULT : public CQtSet #endif { // public methods public: // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Container }; // end namespace Utilities }; // end namespace Konclude #include "CSet.cpp" #endif // KONCLUDE_UTILITIES_CONTAINER_CSET_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CTrible.hpp0000644000175000017500000000536212520551364022303 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CTRIBLE_H #define KONCLUDE_UTILITIES_CTRIBLE_H // Libraries includes #include // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Utilities { /*! * * \class CTrible * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CTrible : public QPair,T> { // public Functions public: //! Constructor CTrible(const T &first, const T &second, const T &third); T getFirst(); T getSecond(); T getThird(); CTrible *setFirst(const T &first); CTrible *setSecond(const T &second); CTrible *setThird(const T &third); CTrible *set(const T &first, const T &second, const T &third); // private Functions private: // private Variables private: }; template CTrible::CTrible(const T &first, const T &second, const T &third) { this->first.first = first; this->first.second = second; this->second = third; } template CTrible *CTrible::setFirst(const T &first) { this->first.first = first; } template CTrible *CTrible::setSecond(const T &second) { this->first.second = second; } template CTrible *CTrible::setThird(const T &third) { this->second = third; } template CTrible *CTrible::set(const T &first, const T &second, const T &third) { this->first.first = first; this->first.second = second; this->second = third; return this; } template T CTrible::getFirst() { return this->first.first; } template T CTrible::getSecond() { return this->first.second; } template T CTrible::getThird() { return this->second; } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CTRIBLE_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CDynRefVector.hpp0000644000175000017500000001642012520551362023427 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CDYNREFVECTOR_H #define KONCLUDE_UTILITIES_CDYNREFVECTOR_H // Libraries includes #include #include // Namespace includes #include "CDynRefBucket.hpp" #include "CAllocationObject.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Utilities { /*! * * \class CDynRefVector * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CDynRefVector : public CAllocationObject { // public methods public: //! Constructor CDynRefVector(); //! Destructor virtual ~CDynRefVector(); void reference(CDynRefVector *vec); void clear(); bool isExtendingReference(); bool isLocal(qint64 index); bool isReference(qint64 index); T *getData(qint64 index); T *getLocalData(qint64 index); T *getReferenceData(qint64 index); void setLocalData(qint64 index, T *data); void setData(qint64 index, T *data); qint64 getItemCount(); // protected methods protected: // private methods private: // private variables private: QVector *> *refDataVec; CDynRefVector *refVec; qint64 bucketSize; qint64 bucketCount; qint64 itemCount; qint64 extendSize; }; template CDynRefVector::CDynRefVector() { refVec = 0; refDataVec = 0; bucketSize = 32; bucketCount = 0; itemCount = 0; extendSize = 8; } template CDynRefVector::~CDynRefVector() { clear(); } template qint64 CDynRefVector::getItemCount() { return itemCount; } template void CDynRefVector::setData(qint64 index, T *data) { // writing is always local setLocalData(index,data); } template void CDynRefVector::setLocalData(qint64 index, T *data) { itemCount = qMax(index+1,itemCount); if (!refDataVec) { qint64 initialSize = bucketCount; if (initialSize < extendSize) { initialSize = extendSize; } refDataVec = new QVector *>(bucketCount); for (qint64 i = 0; i < bucketCount; ++i) { (*refDataVec)[i] = new CDynRefBucket(bucketSize); if (refVec) { (*refDataVec)[i]->reference((*refVec->refDataVec)[i]); } } } qint64 bucketIndex = index / bucketSize; if (bucketIndex >= bucketCount) { if (bucketIndex >= refDataVec->size()) { qint64 newVecSize = (bucketIndex / extendSize + 1) * extendSize; refDataVec->resize(newVecSize); } bucketCount = bucketIndex+1; } if (refDataVec) { if (!(*refDataVec)[bucketIndex]) { (*refDataVec)[bucketIndex] = new CDynRefBucket; } qint64 bucketItemIndex = index % bucketSize; (*refDataVec)[bucketIndex]->setLocalData(bucketItemIndex,data); } } template T *CDynRefVector::getData(qint64 index) { T *val = 0; CDynRefBucket *bucket = 0; qint64 bucketIndex = index / bucketSize; if (!refDataVec) { if (refVec) { if (bucketIndex < bucketCount) { bucket = (*refVec->refDataVec)[bucketIndex]; } } } else { if (bucketIndex < bucketCount) { bucket = (*refDataVec)[bucketIndex]; } } if (bucket) { qint64 bucketItemIndex = index % bucketSize; val = bucket->getData(bucketItemIndex); } return val; } template T *CDynRefVector::getLocalData(qint64 index){ T *val = 0; CDynRefBucket *bucket = 0; qint64 bucketIndex = index / bucketSize; if (refDataVec) { if (bucketIndex < bucketCount) { bucket = (*refDataVec)[bucketIndex]; } } if (bucket) { qint64 bucketItemIndex = index % bucketSize; val = bucket->getLocalData(bucketItemIndex); } return val; } template bool CDynRefVector::isLocal(qint64 index) { CDynRefBucket *bucket = 0; qint64 bucketIndex = index / bucketSize; if (refDataVec) { if (bucketIndex < bucketCount) { bucket = (*refDataVec)[bucketIndex]; } } if (bucket) { qint64 bucketItemIndex = index % bucketSize; return bucket->isLocal(bucketItemIndex); } return false; } template bool CDynRefVector::isReference(qint64 index) { CDynRefBucket *bucket = 0; qint64 bucketIndex = index / bucketSize; bool referenced = false; if (!refDataVec) { if (refVec) { if (bucketIndex < bucketCount) { bucket = (*refVec->refDataVec)[bucketIndex]; referenced = true; } } } else { if (bucketIndex < bucketCount) { bucket = (*refDataVec)[bucketIndex]; } } if (bucket) { qint64 bucketItemIndex = index % bucketSize; if (referenced) { return bucket->isLocal(bucketItemIndex); } return bucket->isReference(bucketItemIndex); } return false; } template T *CDynRefVector::getReferenceData(qint64 index){ T *val = 0; CDynRefBucket *bucket = 0; qint64 bucketIndex = index / bucketSize; bool referenced = false; if (!refDataVec) { if (refVec) { if (bucketIndex < bucketCount) { bucket = (*refVec->refDataVec)[bucketIndex]; referenced = true; } } } else { if (bucketIndex < bucketCount) { bucket = (*refDataVec)[bucketIndex]; } } if (bucket) { qint64 bucketItemIndex = index % bucketSize; if (referenced) { val = bucket->getData(bucketItemIndex); } else { val = bucket->getReferenceData(bucketItemIndex); } } return val; } template void CDynRefVector::reference(CDynRefVector *vec) { clear(); CDynRefVector *refVector = vec; // search the first vector which has in fact data while (refVector != 0 && refVector->refDataVec == 0) { refVector = refVector->refVec; } refVec = refVector; if (refVec) { itemCount = refVec->itemCount; bucketCount = refVec->bucketCount; bucketSize = refVec->bucketSize; } } template void CDynRefVector::clear() { if (refDataVec) { for (qint64 i = 0; i < bucketCount; ++i) { if ((*refDataVec)[i] != 0) { delete (*refDataVec)[i]; } } delete refDataVec; refDataVec = 0; } bucketCount = 0; itemCount = 0; } template bool CDynRefVector::isExtendingReference() { if (refDataVec) { return true; } return false; } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CDYNREFVECTOR_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CSortedNegLinker.hpp0000644000175000017500000003444412520551364024124 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CSortedNegLinker_H #define KONCLUDE_UTILITIES_CSortedNegLinker_H // Libraries includes // Namespace includes #include #include "CAllocationObject.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { template class CSortedNegLinker; /*! * * \class CSortedNegLinker * \author Andreas Steigmiller * \version 0.1 * \brief Spezialised Pointer Version to avoid comparison between addresses * */ template class CSortedNegLinker : public CAllocationObject { // public methods public: //! Constructor CSortedNegLinker(); CSortedNegLinker(T* dataElement, bool isNegated = false, CSortedNegLinker *nextLink = 0); //! Destructor virtual ~CSortedNegLinker(); CSortedNegLinker *init(T* dataElement, bool isNegated = false, CSortedNegLinker *nextLink = 0); bool hasNext(); CSortedNegLinker *insertSortedNextSorted(CSortedNegLinker *nextLink); CSortedNegLinker *insertNextSorted(CSortedNegLinker *nextLink); CSortedNegLinker *insertNext(CSortedNegLinker *nextLink); CSortedNegLinker *getNext(); CSortedNegLinker *setNext(CSortedNegLinker *nextLink); T* getData(); CSortedNegLinker *setData(T* dataElement); bool isNegated(); CSortedNegLinker *setNegated(bool isNegated); CSortedNegLinker *append(CSortedNegLinker *appendingList); CSortedNegLinker *removeNext(); CSortedNegLinker *getLastListLink(); qint64 getCount(); bool resortLinkerData(); // protected methods protected: // private methods private: // private variables private: CSortedNegLinker *next; T* data; bool negated; }; template CSortedNegLinker::CSortedNegLinker() { next = 0; negated = false; } template CSortedNegLinker::CSortedNegLinker(T* dataElement, bool isNegated, CSortedNegLinker *nextLink) { next = 0; setNext(nextLink); data = dataElement; negated = isNegated; } template CSortedNegLinker *CSortedNegLinker::init(T* dataElement, bool isNegated, CSortedNegLinker *nextLink) { next = 0; setNext(nextLink); data = dataElement; negated = isNegated; return this; } template CSortedNegLinker::~CSortedNegLinker() { } template bool CSortedNegLinker::resortLinkerData() { bool hasResorted = false; if (next) { bool nextHasResorted = true; while (nextHasResorted) { nextHasResorted = next->resortLinkerData(); } if (next->getData() > data) { T *tmpData = data; bool tmpNeg = negated; data = next->getData(); negated = next->isNegated(); next->setData(tmpData); next->setNegated(tmpNeg); hasResorted = true; } } return hasResorted; } template bool CSortedNegLinker::hasNext() { return next != 0; } template CSortedNegLinker *CSortedNegLinker::insertNext(CSortedNegLinker *nextLink) { if (nextLink) { CSortedNegLinker *tmpNext = next; next = nextLink; if (tmpNext) { nextLink->append(tmpNext); } } return this; } template CSortedNegLinker *CSortedNegLinker::insertNextSorted(CSortedNegLinker *nextLink) { CSortedNegLinker *firstLinker = this; while (nextLink) { CSortedNegLinker *nIns = nextLink; if (nextLink->hasNext()) { nextLink = nextLink->getNext(); } else { nextLink = 0; } nIns->setNext(0); CSortedNegLinker *list = firstLinker; CSortedNegLinker *lastList = 0; bool inserted = false; T* dataIns = nIns->getData(); while (list) { T* dataList = list->getData(); if (*dataIns <= *dataList) { if (lastList == 0){ firstLinker = nIns->insertNext(firstLinker); } else { lastList->insertNext(nIns); } inserted = true; break; } lastList = list; list = list->next; } if (!inserted) { lastList->insertNext(nIns); } } return firstLinker; } template CSortedNegLinker *CSortedNegLinker::insertSortedNextSorted(CSortedNegLinker *nextLink) { // items from nextLink are already sorted! CSortedNegLinker *firstLinker = this; CSortedNegLinker *list = firstLinker; CSortedNegLinker *lastList = 0; while (nextLink) { CSortedNegLinker *nIns = nextLink; if (nextLink->hasNext()) { nextLink = nextLink->getNext(); } else { nextLink = 0; } nIns->setNext(0); bool inserted = false; T* dataIns = nIns->getData(); while (list) { T* dataList = list->getData(); if (*dataIns <= *dataList) { if (lastList == 0){ firstLinker = nIns->insertNext(firstLinker); list = firstLinker->next; lastList = firstLinker; } else { lastList->insertNext(nIns); lastList = lastList->next; // list is already on the correct position } inserted = true; break; } lastList = list; list = list->next; } if (!inserted) { lastList->insertNext(nIns); lastList = nIns; } } return firstLinker; } template CSortedNegLinker *CSortedNegLinker::setNext(CSortedNegLinker *nextLink) { next = nextLink; return this; } template CSortedNegLinker *CSortedNegLinker::getNext() { return next; } template T* CSortedNegLinker::getData() { return data; } template CSortedNegLinker *CSortedNegLinker::setData(T* dataElement) { data = dataElement; return this; } template bool CSortedNegLinker::isNegated() { return negated; } template CSortedNegLinker *CSortedNegLinker::setNegated(bool isNegated) { negated = isNegated; return this; } template CSortedNegLinker *CSortedNegLinker::append(CSortedNegLinker *appendingList) { CSortedNegLinker *last = getLastListLink(); last->insertNext(appendingList); return this; } template CSortedNegLinker *CSortedNegLinker::removeNext() { CSortedNegLinker *tmpNext = next; if (next) { CSortedNegLinker *tmpNextNext = next->next; next->next = 0; setNext(tmpNextNext); } return tmpNext; } template CSortedNegLinker *CSortedNegLinker::getLastListLink() { CSortedNegLinker *lastListLink = this; while (lastListLink->hasNext()) { lastListLink = lastListLink->getNext(); } return lastListLink; } template qint64 CSortedNegLinker::getCount() { qint64 count = 0; CSortedNegLinker *linkIt = this; while (linkIt) { ++count; linkIt = linkIt->getNext(); } return count; } /*! * * \class CSortedNegLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CSortedNegLinker : public CAllocationObject { // public methods public: //! Constructor CSortedNegLinker(); CSortedNegLinker(T dataElement, bool isNegated = false, CSortedNegLinker *nextLink = 0); //! Destructor virtual ~CSortedNegLinker(); CSortedNegLinker *init(T dataElement, bool isNegated = false, CSortedNegLinker *nextLink = 0); bool hasNext(); CSortedNegLinker *insertSortedNextSorted(CSortedNegLinker *nextLink); CSortedNegLinker *insertNextSorted(CSortedNegLinker *nextLink); CSortedNegLinker *insertNext(CSortedNegLinker *nextLink); CSortedNegLinker *getNext(); CSortedNegLinker *setNext(CSortedNegLinker *nextLink); T getData(); CSortedNegLinker *setData(T dataElement); bool isNegated(); CSortedNegLinker *setNegated(bool isNegated); CSortedNegLinker *append(CSortedNegLinker *appendingList); CSortedNegLinker *removeNext(); CSortedNegLinker *getLastListLink(); qint64 getCount(); bool resortLinkerData(); // protected methods protected: // protected variables protected: CSortedNegLinker *next; T data; bool negated; // private methods private: // private variables private: }; template CSortedNegLinker::CSortedNegLinker() { next = 0; negated = false; } template CSortedNegLinker::CSortedNegLinker(T dataElement, bool isNegated, CSortedNegLinker *nextLink) { next = 0; setNext(nextLink); data = dataElement; negated = isNegated; } template CSortedNegLinker *CSortedNegLinker::init(T dataElement, bool isNegated, CSortedNegLinker *nextLink) { next = 0; setNext(nextLink); data = dataElement; negated = isNegated; return this; } template CSortedNegLinker::~CSortedNegLinker() { } template bool CSortedNegLinker::resortLinkerData() { bool hasResorted = false; if (next) { bool nextHasResorted = true; while (nextHasResorted) { nextHasResorted = next->resortLinkerData(); } if (next->getData() > data) { T tmpData = data; bool tmpNeg = negated; data = next->getData(); negated = next->isNegated(); next->setData(tmpData); next->setNegated(tmpNeg); hasResorted = true; } } return hasResorted; } template bool CSortedNegLinker::hasNext() { return next != 0; } template CSortedNegLinker *CSortedNegLinker::insertNext(CSortedNegLinker *nextLink) { if (nextLink) { CSortedNegLinker *tmpNext = next; next = nextLink; if (tmpNext) { nextLink->append(tmpNext); } } return this; } template CSortedNegLinker *CSortedNegLinker::insertNextSorted(CSortedNegLinker *nextLink) { CSortedNegLinker *firstLinker = this; while (nextLink) { CSortedNegLinker *nIns = nextLink; if (nextLink->hasNext()) { nextLink = nextLink->getNext(); } else { nextLink = 0; } nIns->setNext(0); CSortedNegLinker *list = firstLinker; CSortedNegLinker *lastList = 0; bool inserted = false; T dataIns = nIns->getData(); while (list) { T dataList = list->getData(); if (dataIns <= dataList) { if (lastList == 0){ firstLinker = nIns->insertNext(firstLinker); } else { lastList->insertNext(nIns); } inserted = true; break; } lastList = list; list = list->next; } if (!inserted) { lastList->insertNext(nIns); } } return firstLinker; } template CSortedNegLinker *CSortedNegLinker::insertSortedNextSorted(CSortedNegLinker *nextLink) { // items from nextLink are already sorted! CSortedNegLinker *firstLinker = this; CSortedNegLinker *list = firstLinker; CSortedNegLinker *lastList = 0; while (nextLink) { CSortedNegLinker *nIns = nextLink; if (nextLink->hasNext()) { nextLink = nextLink->getNext(); } else { nextLink = 0; } nIns->setNext(0); bool inserted = false; T dataIns = nIns->getData(); while (list) { T dataList = list->getData(); if (dataIns <= dataList) { if (lastList == 0){ firstLinker = nIns->insertNext(firstLinker); list = firstLinker->next; lastList = firstLinker; } else { lastList->insertNext(nIns); lastList = lastList->next; // list is already on the correct position } inserted = true; break; } lastList = list; list = list->next; } if (!inserted) { lastList->insertNext(nIns); lastList = nIns; } } return firstLinker; } template CSortedNegLinker *CSortedNegLinker::setNext(CSortedNegLinker *nextLink) { next = nextLink; return this; } template CSortedNegLinker *CSortedNegLinker::getNext() { return next; } template T CSortedNegLinker::getData() { return data; } template CSortedNegLinker *CSortedNegLinker::setData(T dataElement) { data = dataElement; return this; } template bool CSortedNegLinker::isNegated() { return negated; } template CSortedNegLinker *CSortedNegLinker::setNegated(bool isNegated) { negated = isNegated; return this; } template CSortedNegLinker *CSortedNegLinker::append(CSortedNegLinker *appendingList) { CSortedNegLinker *last = getLastListLink(); last->insertNext(appendingList); return this; } template CSortedNegLinker *CSortedNegLinker::removeNext() { CSortedNegLinker *tmpNext = next; if (next) { CSortedNegLinker *tmpNextNext = next->next; next->next = 0; setNext(tmpNextNext); } return tmpNext; } template CSortedNegLinker *CSortedNegLinker::getLastListLink() { CSortedNegLinker *lastListLink = this; while (lastListLink->hasNext()) { lastListLink = lastListLink->getNext(); } return lastListLink; } template qint64 CSortedNegLinker::getCount() { qint64 count = 0; CSortedNegLinker *linkIt = this; while (linkIt) { ++count; linkIt = linkIt->getNext(); } return count; } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CSortedNegLinker_H Konclude-v0.6.2-544-SourceCode/Source/Utilities/CSortedLinker.hpp0000644000175000017500000003252112520551364023464 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_UTILITIES_CSORTEDLINKER_H #define KONCLUDE_UTILITIES_CSORTEDLINKER_H // Libraries includes #include // Namespace includes #include "CAllocationObject.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Utilities { template class CSortedLinker; /*! * * \class CSortedLinker * \author Andreas Steigmiller * \version 0.1 * \brief Spezialised Pointer Version to avoid comparison between addresses * */ template class CSortedLinker : public CAllocationObject { // public methods public: //! Constructor CSortedLinker(); CSortedLinker(T* dataElement, CSortedLinker *nextLink = 0); //! Destructor virtual ~CSortedLinker(); CSortedLinker *init(T* dataElement, CSortedLinker *nextLink = 0); bool hasNext(); CSortedLinker *insertSortedNextSorted(CSortedLinker *nextLink); CSortedLinker *insertNextSorted(CSortedLinker *nextLink); CSortedLinker *insertNext(CSortedLinker *nextLink); CSortedLinker *getNext(); CSortedLinker *setNext(CSortedLinker *nextLink); T* getData(); CSortedLinker *setData(T* dataElement); CSortedLinker *append(CSortedLinker *appendingList); CSortedLinker *removeNext(); CSortedLinker *removeOne(T* dataElement); CSortedLinker *removeAll(T* dataElement); CSortedLinker *getLastListLink(); // protected methods protected: // private methods private: // private variables private: CSortedLinker *next; T* data; }; template CSortedLinker::CSortedLinker() { next = 0; } template CSortedLinker::CSortedLinker(T* dataElement, CSortedLinker *nextLink) { next = 0; setNext(nextLink); data = dataElement; } template CSortedLinker *CSortedLinker::init(T* dataElement, CSortedLinker *nextLink) { next = 0; setNext(nextLink); data = dataElement; return this; } template CSortedLinker::~CSortedLinker() { } template bool CSortedLinker::hasNext() { return next != 0; } template CSortedLinker *CSortedLinker::insertNext(CSortedLinker *nextLink) { if (nextLink) { CSortedLinker *tmpNext = next; next = nextLink; if (tmpNext) { nextLink->append(tmpNext); } } return this; } template CSortedLinker *CSortedLinker::insertNextSorted(CSortedLinker *nextLink) { CSortedLinker *firstLinker = this; while (nextLink) { CSortedLinker *nIns = nextLink; if (nextLink->hasNext()) { nextLink = nextLink->getNext(); } else { nextLink = 0; } nIns->setNext(0); CSortedLinker *list = firstLinker; CSortedLinker *lastList = 0; bool inserted = false; T* dataIns = nIns->getData(); while (list) { T* dataList = list->getData(); if (*dataIns <= *dataList) { if (lastList == 0){ firstLinker = nIns->insertNext(firstLinker); } else { lastList->insertNext(nIns); } inserted = true; break; } lastList = list; list = list->next; } if (!inserted) { lastList->insertNext(nIns); } } return firstLinker; } template CSortedLinker *CSortedLinker::insertSortedNextSorted(CSortedLinker *nextLink) { // items from nextLink are already sorted! CSortedLinker *firstLinker = this; CSortedLinker *list = firstLinker; CSortedLinker *lastList = 0; while (nextLink) { CSortedLinker *nIns = nextLink; if (nextLink->hasNext()) { nextLink = nextLink->getNext(); } else { nextLink = 0; } nIns->setNext(0); bool inserted = false; T* dataIns = nIns->getData(); while (list) { T* dataList = list->getData(); if (*dataIns <= *dataList) { if (lastList == 0){ firstLinker = nIns->insertNext(firstLinker); list = firstLinker->next; lastList = firstLinker; } else { lastList->insertNext(nIns); lastList = lastList->next; // list is already on the correct position } inserted = true; break; } lastList = list; list = list->next; } if (!inserted) { lastList->insertNext(nIns); } } return firstLinker; } template CSortedLinker *CSortedLinker::setNext(CSortedLinker *nextLink) { next = nextLink; return this; } template CSortedLinker *CSortedLinker::getNext() { return next; } template T* CSortedLinker::getData() { return data; } template CSortedLinker *CSortedLinker::setData(T* dataElement) { data = dataElement; return this; } template CSortedLinker *CSortedLinker::append(CSortedLinker *appendingList) { CSortedLinker *last = getLastListLink(); last->insertNext(appendingList); return this; } template CSortedLinker *CSortedLinker::removeNext() { CSortedLinker *tmpNext = next; if (next) { CSortedLinker *tmpNextNext = next->next; next->next = 0; setNext(tmpNextNext); } return tmpNext; } template CSortedLinker *CSortedLinker::removeOne(T* dataElement) { CSortedLinker *loc = this; if (loc->getData() == dataElement) { loc = loc->getNext(); return loc; } else { while (loc) { CSortedLinker *nxt = loc->getNext(); if (nxt) { if (nxt->getData() == dataElement) { loc->setNext(nxt->getNext()); return this; } } loc = loc->getNext(); } } return this; } template CSortedLinker *CSortedLinker::removeAll(T* dataElement) { CSortedLinker *loc = this; if (loc->getData() == dataElement) { loc = loc->getNext(); return loc; } else { while (loc) { CSortedLinker *nxt = loc->getNext(); if (nxt) { if (nxt->getData() == dataElement) { loc->setNext(nxt->getNext()); } } loc = loc->getNext(); } } return this; } template CSortedLinker *CSortedLinker::getLastListLink() { CSortedLinker *lastListLink = this; while (lastListLink->hasNext()) { lastListLink = lastListLink->getNext(); } return lastListLink; } /*! * * \class CSortedLinker * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ template class CSortedLinker : public CAllocationObject { // public methods public: //! Constructor CSortedLinker(); CSortedLinker(T dataElement, CSortedLinker *nextLink = 0); //! Destructor virtual ~CSortedLinker(); CSortedLinker *init(T dataElement, CSortedLinker *nextLink = 0); bool hasNext(); CSortedLinker *insertSortedNextSorted(CSortedLinker *nextLink); CSortedLinker *insertNextSorted(CSortedLinker *nextLink); CSortedLinker *insertNext(CSortedLinker *nextLink); CSortedLinker *getNext(); CSortedLinker *setNext(CSortedLinker *nextLink); T getData(); CSortedLinker *setData(T dataElement); CSortedLinker *append(CSortedLinker *appendingList); CSortedLinker *removeNext(); CSortedLinker *getLastListLink(); CSortedLinker *removeOne(T dataElement); CSortedLinker *removeAll(T dataElement); // protected methods protected: // private methods private: // private variables private: CSortedLinker *next; T data; }; template CSortedLinker::CSortedLinker() { next = 0; } template CSortedLinker::CSortedLinker(T dataElement, CSortedLinker *nextLink) { next = 0; setNext(nextLink); data = dataElement; } template CSortedLinker *CSortedLinker::init(T dataElement, CSortedLinker *nextLink) { next = 0; setNext(nextLink); data = dataElement; return this; } template CSortedLinker::~CSortedLinker() { } template bool CSortedLinker::hasNext() { return next != 0; } template CSortedLinker *CSortedLinker::insertNext(CSortedLinker *nextLink) { if (nextLink) { CSortedLinker *tmpNext = next; next = nextLink; if (tmpNext) { nextLink->append(tmpNext); } } return this; } template CSortedLinker *CSortedLinker::insertNextSorted(CSortedLinker *nextLink) { CSortedLinker *firstLinker = this; while (nextLink) { CSortedLinker *nIns = nextLink; if (nextLink->hasNext()) { nextLink = nextLink->getNext(); } else { nextLink = 0; } nIns->setNext(0); CSortedLinker *list = firstLinker; CSortedLinker *lastList = 0; bool inserted = false; T dataIns = nIns->getData(); while (list) { T dataList = list->getData(); if (dataIns <= dataList) { if (lastList == 0){ firstLinker = nIns->insertNext(firstLinker); } else { lastList->insertNext(nIns); } inserted = true; break; } lastList = list; list = list->next; } if (!inserted) { lastList->insertNext(nIns); } } return firstLinker; } template CSortedLinker *CSortedLinker::insertSortedNextSorted(CSortedLinker *nextLink) { // items from nextLink are already sorted! CSortedLinker *firstLinker = this; CSortedLinker *list = firstLinker; CSortedLinker *lastList = 0; while (nextLink) { CSortedLinker *nIns = nextLink; if (nextLink->hasNext()) { nextLink = nextLink->getNext(); } else { nextLink = 0; } nIns->setNext(0); bool inserted = false; T dataIns = nIns->getData(); while (list) { T dataList = list->getData(); if (dataIns <= dataList) { if (lastList == 0){ firstLinker = nIns->insertNext(firstLinker); list = firstLinker->next; lastList = firstLinker; } else { lastList->insertNext(nIns); lastList = lastList->next; // list is already on the correct position } inserted = true; break; } lastList = list; list = list->next; } if (!inserted) { lastList->insertNext(nIns); } } return firstLinker; } template CSortedLinker *CSortedLinker::setNext(CSortedLinker *nextLink) { next = nextLink; return this; } template CSortedLinker *CSortedLinker::getNext() { return next; } template T CSortedLinker::getData() { return data; } template CSortedLinker *CSortedLinker::setData(T dataElement) { data = dataElement; return this; } template CSortedLinker *CSortedLinker::append(CSortedLinker *appendingList) { CSortedLinker *last = getLastListLink(); last->insertNext(appendingList); return this; } template CSortedLinker *CSortedLinker::removeNext() { CSortedLinker *tmpNext = next; if (next) { CSortedLinker *tmpNextNext = next->next; next->next = 0; setNext(tmpNextNext); } return tmpNext; } template CSortedLinker *CSortedLinker::removeOne(T dataElement) { CSortedLinker *loc = this; if (loc->getData() == dataElement) { loc = loc->getNext(); return loc; } else { while (loc) { CSortedLinker *nxt = loc->getNext(); if (nxt) { if (nxt->getData() == dataElement) { loc->setNext(nxt->getNext()); return this; } } loc = loc->getNext(); } } return this; } template CSortedLinker *CSortedLinker::removeAll(T dataElement) { CSortedLinker *loc = this; if (loc->getData() == dataElement) { loc = loc->getNext(); return loc; } else { while (loc) { CSortedLinker *nxt = loc->getNext(); if (nxt) { if (nxt->getData() == dataElement) { loc->setNext(nxt->getNext()); } } loc = loc->getNext(); } } return this; } template CSortedLinker *CSortedLinker::getLastListLink() { CSortedLinker *lastListLink = this; while (lastListLink->hasNext()) { lastListLink = lastListLink->getNext(); } return lastListLink; } }; // end namespace Utilities }; // end namespace Konclude #endif // KONCLUDE_UTILITIES_CSortedLinker_H Konclude-v0.6.2-544-SourceCode/Source/Network/0000755000175000017500000000000012613407250017713 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Network/CNetworkResponse.cpp0000644000175000017500000000201512520550702023666 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNetworkResponse.h" namespace Konclude { namespace Network { CNetworkResponse::CNetworkResponse() { } CNetworkResponse::~CNetworkResponse() { } }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/CNetworkResponse.h0000644000175000017500000000310312520550702023332 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_CNETWORKRESPONSE_H #define KONCLUDE_NETWORK_CNETWORKRESPONSE_H // Library includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { /*! * * \class CNetworkResponse * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNetworkResponse { // public methods public: //! Constructor CNetworkResponse(); //! Destructor virtual ~CNetworkResponse(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_CNETWORKRESPONSE_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/0000755000175000017500000000000012613407250020472 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpConnectionHandlerFactory.cpp0000644000175000017500000000207312520550700027371 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQtHttpConnectionHandlerFactory.h" namespace Konclude { namespace Network { namespace HTTP { CQtHttpConnectionHandlerFactory::CQtHttpConnectionHandlerFactory() { } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpConnectionHandlerReleaser.cpp0000644000175000017500000000207612520550700027527 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQtHttpConnectionHandlerReleaser.h" namespace Konclude { namespace Network { namespace HTTP { CQtHttpConnectionHandlerReleaser::CQtHttpConnectionHandlerReleaser() { } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/0000755000175000017500000000000012613407250021736 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CExtractResponseDataCallbackEvent.h0000644000175000017500000000503012520550674030560 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_EVENTS_CEXTRACTRESPONSEDATACALLBACKEVENT_H #define KONCLUDE_NETWORK_HTTP_EVENTS_CEXTRACTRESPONSEDATACALLBACKEVENT_H // Libraries includes // Namespace includes #include "../HttpSettings.h" #include "../CQtHttpResponse.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Network { namespace HTTP { namespace Events { /*! * \class CExtractResponseDataCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CExtractResponseDataCallbackEvent : public CCustomEvent, public CCallbackData { // public methods public: //! Constructor CExtractResponseDataCallbackEvent(CThread* thread, CQtHttpResponse* response, QByteArray* data, CCallbackData* callbacks); //! Destructor virtual ~CExtractResponseDataCallbackEvent(); CQtHttpResponse* getResponse(); QByteArray* getDataPointer(); CCallbackData* getCallbacks(); virtual void doCallback(); static const QEvent::Type EVENTTYPE = EVENTEXTRACTDATACALLBACK; // protected methods protected: // protected variables protected: CQtHttpResponse* mResponse; QByteArray* mData; CCallbackData* mCallbacks; CThread* mThread; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_EVENTS_CEXTRACTRESPONSEDATACALLBACKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CConnectionReadyReadEvent.h0000644000175000017500000000402712520550674027105 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_EVENTS_CCONNECTIONREADYREADEVENT_H #define KONCLUDE_NETWORK_HTTP_EVENTS_CCONNECTIONREADYREADEVENT_H // Libraries includes // Namespace includes #include "../HttpSettings.h" #include "../CHttpResponse.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Network { namespace HTTP { namespace Events { /*! * \class CConnectionReadyReadEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CConnectionReadyReadEvent : public CCustomEvent { // public methods public: //! Constructor CConnectionReadyReadEvent(); //! Destructor virtual ~CConnectionReadyReadEvent(); static const QEvent::Type EVENTTYPE = EVENTCONNECTIONREADYREAD; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_EVENTS_CCONNECTIONREADYREADEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CAddResponseFinishedCallbackEvent.h0000644000175000017500000000442712520550674030527 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_EVENTS_CADDRESPONSEFINISHEDCALLBACKEVENT_H #define KONCLUDE_NETWORK_HTTP_EVENTS_CADDRESPONSEFINISHEDCALLBACKEVENT_H // Libraries includes // Namespace includes #include "../HttpSettings.h" #include "../CQtHttpResponse.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Network { namespace HTTP { namespace Events { /*! * \class CAddResponseFinishedCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CAddResponseFinishedCallbackEvent : public CCustomEvent { // public methods public: //! Constructor CAddResponseFinishedCallbackEvent(CQtHttpResponse* response, CCallbackData* callbacks); //! Destructor virtual ~CAddResponseFinishedCallbackEvent(); CQtHttpResponse* getResponse(); CCallbackData* getCallbacks(); static const QEvent::Type EVENTTYPE = EVENTADDRESPONSEFINISHEDTEXT; // protected methods protected: // protected variables protected: CQtHttpResponse* mResponse; CCallbackData* mCallbacks; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_EVENTS_CADDRESPONSEFINISHEDCALLBACKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CReleaseResponseEvent.cpp0000644000175000017500000000277112520550676026665 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReleaseResponseEvent.h" namespace Konclude { namespace Network { namespace HTTP { namespace Events { CReleaseResponseEvent::CReleaseResponseEvent(CHttpResponse* response, bool releaseAlsoAccordingRequest) : CCustomEvent(EVENTTYPE) { mResponse = response; mReleaseRequest = releaseAlsoAccordingRequest; } CReleaseResponseEvent::~CReleaseResponseEvent() { } bool CReleaseResponseEvent::getReleaseAccordingRequest() { return mReleaseRequest; } CHttpResponse* CReleaseResponseEvent::getResponse() { return mResponse; } }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CConnectionReadyReadEvent.cpp0000644000175000017500000000231112520550674027432 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConnectionReadyReadEvent.h" namespace Konclude { namespace Network { namespace HTTP { namespace Events { CConnectionReadyReadEvent::CConnectionReadyReadEvent() : CCustomEvent(EVENTTYPE) { } CConnectionReadyReadEvent::~CConnectionReadyReadEvent() { } }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CAddResponseFinishedCallbackEvent.cpp0000644000175000017500000000305012520550674031051 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAddResponseFinishedCallbackEvent.h" namespace Konclude { namespace Network { namespace HTTP { namespace Events { CAddResponseFinishedCallbackEvent::CAddResponseFinishedCallbackEvent(CQtHttpResponse* response, CCallbackData* callbacks) : CCustomEvent(EVENTTYPE) { mResponse = response; mCallbacks = callbacks; } CAddResponseFinishedCallbackEvent::~CAddResponseFinishedCallbackEvent() { } CQtHttpResponse* CAddResponseFinishedCallbackEvent::getResponse() { return mResponse; } CCallbackData* CAddResponseFinishedCallbackEvent::getCallbacks() { return mCallbacks; } }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CExtractResponseDataEvent.cpp0000644000175000017500000000315512520550674027504 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExtractResponseDataEvent.h" namespace Konclude { namespace Network { namespace HTTP { namespace Events { CExtractResponseDataEvent::CExtractResponseDataEvent(CQtHttpResponse* response, QByteArray* data, CCallbackData* callbacks) : CCustomEvent(EVENTTYPE) { mResponse = response; mData = data; mCallbacks = callbacks; } CExtractResponseDataEvent::~CExtractResponseDataEvent() { } CQtHttpResponse* CExtractResponseDataEvent::getResponse() { return mResponse; } QByteArray* CExtractResponseDataEvent::getDataPointer() { return mData; } CCallbackData* CExtractResponseDataEvent::getCallbacks() { return mCallbacks; } }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CHandleIncomingHttpConnectionEvent.h0000644000175000017500000000427312520550674030767 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_EVENTS_CHANDLEINCOMINGHTTPCONNECTIONEVENT_H #define KONCLUDE_NETWORK_HTTP_EVENTS_CHANDLEINCOMINGHTTPCONNECTIONEVENT_H // Libraries includes // Namespace includes #include "../HttpSettings.h" #include "../CHttpResponse.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Network { namespace HTTP { namespace Events { /*! * \class CHandleIncomingHttpConnectionEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CHandleIncomingHttpConnectionEvent : public CCustomEvent { // public methods public: //! Constructor CHandleIncomingHttpConnectionEvent(cint64 socketDescriptor); //! Destructor virtual ~CHandleIncomingHttpConnectionEvent(); cint64 getSocketDescriptor(); static const QEvent::Type EVENTTYPE = EVENTHANDLEINCOMINGHTTPCONNECTION; // protected methods protected: // protected variables protected: cint64 mSocketDescriptor; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_EVENTS_CHANDLEINCOMINGHTTPCONNECTIONEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CHttpRequstEvent.h0000644000175000017500000000430012520550676025344 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_EVENTS_CHTTPREQUSTEVENT_H #define KONCLUDE_NETWORK_HTTP_EVENTS_CHTTPREQUSTEVENT_H // Libraries includes // Namespace includes #include "../HttpSettings.h" #include "../CQtHttpResponse.h" #include "../CQtHttpRequest.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Network { namespace HTTP { namespace Events { /*! * \class CHttpRequstEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CHttpRequstEvent : public CCustomEvent { // public methods public: //! Constructor CHttpRequstEvent(CQtHttpRequest* request, CQtHttpResponse* response); //! Destructor virtual ~CHttpRequstEvent(); virtual CQtHttpRequest* getRequest(); virtual CQtHttpResponse* getResponse(); static const QEvent::Type EVENTTYPE = EVENTHTTPREQUEST; // protected methods protected: // protected variables protected: CQtHttpRequest* mRequest; CQtHttpResponse* mResponse; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_EVENTS_CHTTPREQUSTEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CHttpRequstEvent.cpp0000644000175000017500000000265312520550676025710 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CHttpRequstEvent.h" namespace Konclude { namespace Network { namespace HTTP { namespace Events { CHttpRequstEvent::CHttpRequstEvent(CQtHttpRequest* request, CQtHttpResponse* response) : CCustomEvent(EVENTTYPE) { mRequest = request; mResponse = response; } CHttpRequstEvent::~CHttpRequstEvent() { } CQtHttpRequest* CHttpRequstEvent::getRequest() { return mRequest; } CQtHttpResponse* CHttpRequstEvent::getResponse() { return mResponse; } }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CConnectionDisconnectedEvent.h0000644000175000017500000000405712520550674027652 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_EVENTS_CCONNECTIONDISCONNECTEDEVENT_H #define KONCLUDE_NETWORK_HTTP_EVENTS_CCONNECTIONDISCONNECTEDEVENT_H // Libraries includes // Namespace includes #include "../HttpSettings.h" #include "../CHttpResponse.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Network { namespace HTTP { namespace Events { /*! * \class CConnectionDisconnectedEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CConnectionDisconnectedEvent : public CCustomEvent { // public methods public: //! Constructor CConnectionDisconnectedEvent(); //! Destructor virtual ~CConnectionDisconnectedEvent(); static const QEvent::Type EVENTTYPE = EVENTCONNECTIONDISCONNECTED; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_EVENTS_CCONNECTIONDISCONNECTEDEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CReleaseResponseEvent.h0000644000175000017500000000432112520550676026323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_EVENTS_CRELEASERESPONSEEVENT_H #define KONCLUDE_NETWORK_HTTP_EVENTS_CRELEASERESPONSEEVENT_H // Libraries includes // Namespace includes #include "../HttpSettings.h" #include "../CHttpResponse.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Network { namespace HTTP { namespace Events { /*! * \class CReleaseResponseEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CReleaseResponseEvent : public CCustomEvent { // public methods public: //! Constructor CReleaseResponseEvent(CHttpResponse* response, bool releaseAlsoAccordingRequest = true); //! Destructor virtual ~CReleaseResponseEvent(); virtual CHttpResponse* getResponse(); virtual bool getReleaseAccordingRequest(); static const QEvent::Type EVENTTYPE = EVENTRELEASERESPONSE; // protected methods protected: // protected variables protected: CHttpResponse* mResponse; bool mReleaseRequest; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_EVENTS_CRELEASERESPONSEEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CConnectionDisconnectedEvent.cpp0000644000175000017500000000233012520550674030175 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConnectionDisconnectedEvent.h" namespace Konclude { namespace Network { namespace HTTP { namespace Events { CConnectionDisconnectedEvent::CConnectionDisconnectedEvent() : CCustomEvent(EVENTTYPE) { } CConnectionDisconnectedEvent::~CConnectionDisconnectedEvent() { } }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CInstallRequestFinishedCallbackEvent.cpp0000644000175000017500000000307512520550676031632 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CInstallRequestFinishedCallbackEvent.h" namespace Konclude { namespace Network { namespace HTTP { namespace Events { CInstallRequestFinishedCallbackEvent::CInstallRequestFinishedCallbackEvent(CQtHttpResponse* response, CCallbackData* callbacks) : CCustomEvent(EVENTTYPE) { mResponse = response; mCallbacks = callbacks; } CInstallRequestFinishedCallbackEvent::~CInstallRequestFinishedCallbackEvent() { } CQtHttpResponse* CInstallRequestFinishedCallbackEvent::getResponse() { return mResponse; } CCallbackData* CInstallRequestFinishedCallbackEvent::getCallbacks() { return mCallbacks; } }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CExtractResponseDataEvent.h0000644000175000017500000000445012520550674027150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_EVENTS_CEXTRACTRESPONSEDATAEVENT_H #define KONCLUDE_NETWORK_HTTP_EVENTS_CEXTRACTRESPONSEDATAEVENT_H // Libraries includes // Namespace includes #include "../HttpSettings.h" #include "../CQtHttpResponse.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Network { namespace HTTP { namespace Events { /*! * \class CExtractResponseDataEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CExtractResponseDataEvent : public CCustomEvent { // public methods public: //! Constructor CExtractResponseDataEvent(CQtHttpResponse* response, QByteArray* data, CCallbackData* callbacks); //! Destructor virtual ~CExtractResponseDataEvent(); CQtHttpResponse* getResponse(); QByteArray* getDataPointer(); CCallbackData* getCallbacks(); static const QEvent::Type EVENTTYPE = EVENTERACTRESPONSEDATA; // protected methods protected: // protected variables protected: CQtHttpResponse* mResponse; QByteArray* mData; CCallbackData* mCallbacks; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_EVENTS_CEXTRACTRESPONSEDATAEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CHttpReplyFinishedEvent.cpp0000644000175000017500000000247612520550674027173 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CHttpReplyFinishedEvent.h" namespace Konclude { namespace Network { namespace HTTP { namespace Events { CHttpReplyFinishedEvent::CHttpReplyFinishedEvent(QNetworkReply* reply) : CCustomEvent(EVENTTYPE) { mReply = reply; } CHttpReplyFinishedEvent::~CHttpReplyFinishedEvent() { } QNetworkReply* CHttpReplyFinishedEvent::getReply() { return mReply; } }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CExtractResponseDataCallbackEvent.cpp0000644000175000017500000000347012520550674031121 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExtractResponseDataCallbackEvent.h" namespace Konclude { namespace Network { namespace HTTP { namespace Events { CExtractResponseDataCallbackEvent::CExtractResponseDataCallbackEvent(CThread* thread, CQtHttpResponse* response, QByteArray* data, CCallbackData* callbacks) : CCustomEvent(EVENTTYPE) { mResponse = response; mData = data; mCallbacks = callbacks; mThread = thread; } CExtractResponseDataCallbackEvent::~CExtractResponseDataCallbackEvent() { } CQtHttpResponse* CExtractResponseDataCallbackEvent::getResponse() { return mResponse; } QByteArray* CExtractResponseDataCallbackEvent::getDataPointer() { return mData; } CCallbackData* CExtractResponseDataCallbackEvent::getCallbacks() { return mCallbacks; } void CExtractResponseDataCallbackEvent::doCallback() { mThread->postEvent(this); } }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CInstallRequestFinishedCallbackEvent.h0000644000175000017500000000461112520550676031274 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_EVENTS_CINSTALLREQUESTFINISHEDCALLBACKEVENT_H #define KONCLUDE_NETWORK_HTTP_EVENTS_CINSTALLREQUESTFINISHEDCALLBACKEVENT_H // Libraries includes // Namespace includes #include "../HttpSettings.h" #include "../CQtHttpResponse.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" #include "Concurrent/Callback/CCallbackData.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; using namespace Concurrent::Callback; namespace Network { namespace HTTP { namespace Events { /*! * \class CInstallRequestFinishedCallbackEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CInstallRequestFinishedCallbackEvent : public CCustomEvent { // public methods public: //! Constructor CInstallRequestFinishedCallbackEvent(CQtHttpResponse* response, CCallbackData* callbacks); //! Destructor virtual ~CInstallRequestFinishedCallbackEvent(); CQtHttpResponse* getResponse(); CCallbackData* getCallbacks(); static const QEvent::Type EVENTTYPE = EVENTINSTALLREQUESTFINISHEDCALLBACK; // protected methods protected: // protected variables protected: CQtHttpResponse* mResponse; CCallbackData* mCallbacks; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_EVENTS_CINSTALLREQUESTFINISHEDCALLBACKEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CHttpReplyFinishedEvent.h0000644000175000017500000000412012520550674026624 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_EVENTS_CHTTPREPLYFINISHEDEVENT_H #define KONCLUDE_NETWORK_HTTP_EVENTS_CHTTPREPLYFINISHEDEVENT_H // Libraries includes #include // Namespace includes #include "../HttpSettings.h" // Other includes #include "Concurrent/Events/CCustomEvent.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Events; namespace Network { namespace HTTP { namespace Events { /*! * \class CHttpReplyFinishedEvent * \author Andreas Steigmiller * \version 0.1 * \brief */ class CHttpReplyFinishedEvent : public CCustomEvent { // public methods public: //! Constructor CHttpReplyFinishedEvent(QNetworkReply* reply); //! Destructor virtual ~CHttpReplyFinishedEvent(); QNetworkReply* getReply(); static const QEvent::Type EVENTTYPE = EVENTREPLYFINISHED; // protected methods protected: // protected variables protected: QNetworkReply* mReply; // private methods private: // private variables private: }; }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_EVENTS_CHTTPREPLYFINISHEDEVENT_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/Events/CHandleIncomingHttpConnectionEvent.cpp0000644000175000017500000000264712520550674031325 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CHandleIncomingHttpConnectionEvent.h" namespace Konclude { namespace Network { namespace HTTP { namespace Events { CHandleIncomingHttpConnectionEvent::CHandleIncomingHttpConnectionEvent(cint64 socketDescriptor) : CCustomEvent(EVENTTYPE) { mSocketDescriptor = socketDescriptor; } CHandleIncomingHttpConnectionEvent::~CHandleIncomingHttpConnectionEvent() { } cint64 CHandleIncomingHttpConnectionEvent::getSocketDescriptor() { return mSocketDescriptor; } }; // end namespace Events }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpRequestParser.h0000644000175000017500000000342312520550702024720 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CQTHTTPREQUESTPARSER_H #define KONCLUDE_NETWORK_HTTP_CQTHTTPREQUESTPARSER_H // Namespace includes #include "HttpSettings.h" // Library includes #include // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { /*! * * \class CQtHttpRequestParser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtHttpRequestParser { // public methods public: //! Constructor CQtHttpRequestParser(); virtual CQtHttpRequestParser* reset() = 0; virtual bool readFromDevice(QIODevice* readDevice) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CQTHTTPREQUESTPARSER_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CHttpResponseExtractor.h0000644000175000017500000000333012520550676025307 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CHTTPRESPONSEEXTRACTOR_H #define KONCLUDE_NETWORK_HTTP_CHTTPRESPONSEEXTRACTOR_H // Namespace includes #include "HttpSettings.h" // Library includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { /*! * * \class CHttpResponseExtractor * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CHttpResponseExtractor { // public methods public: //! Constructor CHttpResponseExtractor(); //! Destructor virtual ~CHttpResponseExtractor(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CHTTPRESPONSEEXTRACTOR_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpConnectionHandler.h0000644000175000017500000000336012520550700025506 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CQTHTTPCONNECTIONHANDLER_H #define KONCLUDE_NETWORK_HTTP_CQTHTTPCONNECTIONHANDLER_H // Namespace includes #include "HttpSettings.h" // Library includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { /*! * * \class CQtHttpConnectionHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtHttpConnectionHandler { // public methods public: //! Constructor CQtHttpConnectionHandler(); virtual bool handleIncomingConnection(int socketDescriptor) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CQTHTTPCONNECTIONHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpPooledConnectionHandler.cpp0000644000175000017500000000246112520550700027205 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQtHttpPooledConnectionHandler.h" namespace Konclude { namespace Network { namespace HTTP { CQtHttpPooledConnectionHandler::CQtHttpPooledConnectionHandler() { mHandlerBusy = false; } bool CQtHttpPooledConnectionHandler::isHandlerBusy() { return mHandlerBusy; } CQtHttpPooledConnectionHandler* CQtHttpPooledConnectionHandler::setHandlerBusy() { mHandlerBusy = true; return this; } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpConnectionHandlerFactory.h0000644000175000017500000000347512520550700027045 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CQTHTTPCONNECTIONHANDLERFACTORY_H #define KONCLUDE_NETWORK_HTTP_CQTHTTPCONNECTIONHANDLERFACTORY_H // Namespace includes #include "HttpSettings.h" #include "CQtHttpConnectionHandler.h" // Library includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { /*! * * \class CQtHttpConnectionHandlerFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtHttpConnectionHandlerFactory { // public methods public: //! Constructor CQtHttpConnectionHandlerFactory(); virtual CQtHttpConnectionHandler* getConnectionHandler() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CQTHTTPCONNECTIONHANDLERFACTORY_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpRequest.h0000644000175000017500000000371512520550700023545 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CQtHttpRequest_H #define KONCLUDE_NETWORK_HTTP_CQtHttpRequest_H // Namespace includes #include "HttpSettings.h" #include "CHttpRequest.h" // Library includes #include // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { /*! * * \class CQtHttpRequest * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtHttpRequest : public CHttpRequest { // public methods public: //! Constructor CQtHttpRequest(const QUrl &url); CQtHttpRequest(const QUrl &url, QByteArray* data); //! Destructor virtual ~CQtHttpRequest(); QNetworkRequest* getQNetworkRequest(); QByteArray* getByteArrayData(); // protected methods protected: // protected variables protected: QNetworkRequest mQNetworkRequest; QByteArray* mByteArrayData; // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CQtHttpRequest_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/HttpSettings.h0000644000175000017500000000432612520550702023306 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_HTTPSETTINGS #define KONCLUDE_NETWORK_HTTP_HTTPSETTINGS // Library includes #include // Namespace includes // Other includes #include "Network/NetworkSettings.h" // Logger includes namespace Konclude { namespace Network { namespace HTTP { /*! * * \file HTTPSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // Custom Events >= 2000 const QEvent::Type EVENTHTTPREQUEST = (QEvent::Type)3000; const QEvent::Type EVENTREPLYFINISHED = (QEvent::Type)3001; const QEvent::Type EVENTERACTRESPONSEDATA = (QEvent::Type)3002; const QEvent::Type EVENTEXTRACTDATACALLBACK = (QEvent::Type)3003; const QEvent::Type EVENTRELEASERESPONSE = (QEvent::Type)3004; const QEvent::Type EVENTINSTALLREQUESTFINISHEDCALLBACK = (QEvent::Type)3005; const QEvent::Type EVENTHANDLEINCOMINGHTTPCONNECTION = (QEvent::Type)3006; const QEvent::Type EVENTCONNECTIONREADYREAD = (QEvent::Type)3007; const QEvent::Type EVENTCONNECTIONDISCONNECTED = (QEvent::Type)3008; const QEvent::Type EVENTADDRESPONSEFINISHEDTEXT = (QEvent::Type)3009; const QEvent::Type EVENTRESPONSEFINISHEDCALLBACK = (QEvent::Type)3010; // forward declarations // Konclude code configs }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // end KONCLUDE_NETWORK_HTTP_HTTPSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpConnectionHandlerReleaser.h0000644000175000017500000000357212520550700027176 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CQTHTTPCONNECTIONHANDLERRELEASER_H #define KONCLUDE_NETWORK_HTTP_CQTHTTPCONNECTIONHANDLERRELEASER_H // Namespace includes #include "HttpSettings.h" #include "CQtHttpConnectionHandler.h" // Library includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { /*! * * \class CQtHttpConnectionHandlerReleaser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtHttpConnectionHandlerReleaser { // public methods public: //! Constructor CQtHttpConnectionHandlerReleaser(); virtual CQtHttpConnectionHandlerReleaser* releaseConnectionHandler(CQtHttpConnectionHandler* connectionHandler) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CQTHTTPCONNECTIONHANDLERRELEASER_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CHttpRequest.h0000644000175000017500000000332012520550676023244 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CHTTPREQUEST_H #define KONCLUDE_NETWORK_HTTP_CHTTPREQUEST_H // Namespace includes #include "HttpSettings.h" // Library includes #include "Network/CNetworkRequest.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { /*! * * \class CHttpRequest * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CHttpRequest : public CNetworkRequest { // public methods public: //! Constructor CHttpRequest(); //! Destructor virtual ~CHttpRequest(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CHTTPREQUEST_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CHttpRequestFactory.h0000644000175000017500000000344112520550676024600 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CHTTPREQUESTFACTORY_H #define KONCLUDE_NETWORK_HTTP_CHTTPREQUESTFACTORY_H // Namespace includes #include "HttpSettings.h" #include "CHttpRequest.h" // Library includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { /*! * * \class CHttpRequestFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CHttpRequestFactory { // public methods public: //! Constructor CHttpRequestFactory(); //! Destructor virtual ~CHttpRequestFactory(); virtual CHttpRequest* createRequest(const QString& url) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CHTTPREQUESTFACTORY_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CHttpRequestFactory.cpp0000644000175000017500000000211612520550676025131 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CHttpRequestFactory.h" namespace Konclude { namespace Network { namespace HTTP { CHttpRequestFactory::CHttpRequestFactory() { } CHttpRequestFactory::~CHttpRequestFactory() { } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CHttpRequest.cpp0000644000175000017500000000205312520550676023601 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CHttpRequest.h" namespace Konclude { namespace Network { namespace HTTP { CHttpRequest::CHttpRequest() { } CHttpRequest::~CHttpRequest() { } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpRequestBodyOnlyParser.cpp0000644000175000017500000002147312574544600026751 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQtHttpRequestBodyOnlyParser.h" namespace Konclude { namespace Network { namespace HTTP { CQtHttpRequestBodyOnlyParser::CQtHttpRequestBodyOnlyParser() { mHeaderLineReadBufferSize = 20000; // maximum header size 10 KByte mMaxHeaderDataSize = 1024*10; mHeaderLineReadBuffer = new char[mHeaderLineReadBufferSize+1]; mHeaderLineReadBuffer[mHeaderLineReadBufferSize] = '\0'; // maximum body size 2 GByte mMaxBodyDataSize = Q_INT64_C(1024*1024*1024*2); mBodyData = nullptr; mHeaderContentLengthString = QString("Content-Length").toUpper(); mHeaderConnectionString = QString("Connection").toUpper(); mHeaderConnectionCloseString = QString("close").toUpper(); reset(); } CQtHttpRequestBodyOnlyParser::~CQtHttpRequestBodyOnlyParser() { delete mBodyData; } CQtHttpRequestParser* CQtHttpRequestBodyOnlyParser::reset() { mHeaderLineReadBufferPosition = 0; mReadBodyDataSize = 0; mErrorString.clear(); mHeaderData.clear(); delete mBodyData; mBodyData = nullptr; mRequestError = false; mRequestCompleted = false; mHeaderCompleted = false; mHeaderMethodProtocolURIParsed = false; mAfterwardsCloseConnection = false; mReadHeaderDataSize = 0; mExpectedBodyLength = 0; return this; } QByteArray* CQtHttpRequestBodyOnlyParser::takeBodyData() { QByteArray* bodyData = mBodyData; mBodyData = nullptr; return bodyData; } bool CQtHttpRequestBodyOnlyParser::readFromDevice(QIODevice* readDevice) { cint64 availableBytesCount = readDevice->bytesAvailable(); while (availableBytesCount > 1 && !mRequestError && !mRequestCompleted) { if (!mHeaderCompleted) { if (mHeaderLineReadBufferSize - mHeaderLineReadBufferPosition <= 0) { mRequestError = true; mErrorString = QString("Line in header is longer than allowed, '%1' is longer than %2").arg(QString::fromUtf8(mHeaderLineReadBuffer)).arg(mHeaderLineReadBufferSize); } else if (mMaxHeaderDataSize - mReadHeaderDataSize <= 0) { mRequestError = true; mErrorString = QString("Header is longer than allowed"); } else { cint64 maxToReadLine = mHeaderLineReadBufferSize - mHeaderLineReadBufferPosition + 1; bool lineCompleted = false; cint64 maxToAvailableRead = qMin(readDevice->bytesAvailable(),maxToReadLine); maxToAvailableRead = qMin(maxToAvailableRead,mMaxHeaderDataSize-mReadHeaderDataSize+1); cint64 read = readDevice->readLine(&mHeaderLineReadBuffer[mHeaderLineReadBufferPosition],maxToAvailableRead); cint64 newPos = mHeaderLineReadBufferPosition+read; if (mHeaderLineReadBuffer[newPos-1] == '\n') { lineCompleted = true; } //if (newPos == 1 && mHeaderLineReadBuffer[newPos-1] == 13) { // lineCompleted = true; // if (mExpectedBodyLength == 0) { // mRequestCompleted = true; // } //} mHeaderLineReadBufferPosition = newPos; mReadHeaderDataSize += mHeaderLineReadBufferPosition; if (lineCompleted) { if (!mHeaderMethodProtocolURIParsed) { mHeaderMethodProtocolURIParsed = true; parseHttpMethodProtocolURI(); } else { parseHttpRequestHeader(); } mHeaderLineReadBufferPosition = 0; } } } else { if (mExpectedBodyLength <= 0) { mRequestCompleted = true; } else { if (mExpectedBodyLength > mMaxBodyDataSize) { mRequestError = true; mErrorString = QString("Expected body '%1' is longer than allowed '%2'").arg(mExpectedBodyLength).arg(mMaxBodyDataSize); } else { if (mBodyData == nullptr) { mBodyData = new QByteArray(); mBodyData->resize(mExpectedBodyLength); } cint64 maxReadBodyData = mExpectedBodyLength - mReadBodyDataSize; maxReadBodyData = qMin(maxReadBodyData,mHeaderLineReadBufferSize); qint64 read = readDevice->read(mHeaderLineReadBuffer,maxReadBodyData); mBodyData->replace(mReadBodyDataSize,read,mHeaderLineReadBuffer); mReadBodyDataSize += read; if (mReadBodyDataSize >= mExpectedBodyLength) { mRequestCompleted = true; } } } } availableBytesCount = readDevice->bytesAvailable(); } return !mRequestError; } cint64 CQtHttpRequestBodyOnlyParser::getNextCharacterPosition(char character, cint64 searchStartPos) { for (cint64 i = searchStartPos; i < mHeaderLineReadBufferSize; ++i) { if (mHeaderLineReadBuffer[i] == character) { return i; } } return mHeaderLineReadBufferSize; } void CQtHttpRequestBodyOnlyParser::parseHttpMethodProtocolURI() { cint64 currSpacePos = 0; cint64 nextSpacePos = getNextCharacterPosition(' ',currSpacePos); bool methodProtocolURIParseError = false; if (nextSpacePos == mHeaderLineReadBufferSize) { methodProtocolURIParseError = true; } else { mRequestMethod = QString::fromUtf8(&mHeaderLineReadBuffer[currSpacePos],nextSpacePos-currSpacePos); currSpacePos = nextSpacePos+1; nextSpacePos = getNextCharacterPosition(' ',currSpacePos); if (nextSpacePos == mHeaderLineReadBufferSize) { methodProtocolURIParseError = true; } else { mRequestURIString = QString::fromUtf8(&mHeaderLineReadBuffer[currSpacePos],nextSpacePos-currSpacePos); currSpacePos = nextSpacePos+1; nextSpacePos = mHeaderLineReadBufferPosition-2; mRequestProtocol = QString::fromUtf8(&mHeaderLineReadBuffer[currSpacePos],nextSpacePos-currSpacePos); } } if (methodProtocolURIParseError) { mRequestError = true; mErrorString = QString("Could not parse method, protocol and uri from request '%1'").arg(QString::fromUtf8(mHeaderLineReadBuffer)); } } void CQtHttpRequestBodyOnlyParser::parseHttpRequestHeader() { if (mHeaderLineReadBufferPosition == 2) { // empty new line, end of header mHeaderCompleted = true; } else { cint64 doublePointPos = getNextCharacterPosition(':',0); QString headerKey = QString::fromUtf8(mHeaderLineReadBuffer,doublePointPos); if (QString::compare(headerKey.trimmed(),mHeaderContentLengthString,Qt::CaseInsensitive) == 0) { QString contentLengthValueString = QString::fromUtf8(&mHeaderLineReadBuffer[doublePointPos+1],mHeaderLineReadBufferPosition-3-doublePointPos); bool successfulParsedExpectedContentLength = false; QString trimmedContentLengthValueString = contentLengthValueString.trimmed(); mExpectedBodyLength = trimmedContentLengthValueString.toLong(&successfulParsedExpectedContentLength); if (!successfulParsedExpectedContentLength) { mRequestError = true; mErrorString = QString("Could not parse content length value from '%1'").arg(QString::fromUtf8(mHeaderLineReadBuffer)); } } else { if (QString::compare(headerKey.trimmed(),mHeaderConnectionString,Qt::CaseInsensitive) == 0) { QString connectionValueString = QString::fromUtf8(&mHeaderLineReadBuffer[doublePointPos+1],mHeaderLineReadBufferPosition-3-doublePointPos); if (QString::compare(connectionValueString,mHeaderConnectionString,Qt::CaseInsensitive) == 0) { mAfterwardsCloseConnection = true; } } } } } CHttpRequest* CQtHttpRequestBodyOnlyParser::takeParsedHttpRequest() { CQtHttpRequest* request = new CQtHttpRequest(mRequestURIString,mBodyData); return request; } bool CQtHttpRequestBodyOnlyParser::hasHttpRequestParsingError() { return mRequestError; } bool CQtHttpRequestBodyOnlyParser::hasHttpRequestParsingCompleted() { return mRequestCompleted; } QString CQtHttpRequestBodyOnlyParser::getHttpRequestParsingErrorString() { return mErrorString; } bool CQtHttpRequestBodyOnlyParser::hasRequestedCloseConnection() { return mAfterwardsCloseConnection; } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CHttpResponse.cpp0000644000175000017500000000206012520550676023745 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CHttpResponse.h" namespace Konclude { namespace Network { namespace HTTP { CHttpResponse::CHttpResponse() { } CHttpResponse::~CHttpResponse() { } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpRequestParser.cpp0000644000175000017500000000203212520550702025246 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQtHttpRequestParser.h" namespace Konclude { namespace Network { namespace HTTP { CQtHttpRequestParser::CQtHttpRequestParser() { } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CHttpResponseExtractor.cpp0000644000175000017500000000213512520550676025644 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CHttpResponseExtractor.h" namespace Konclude { namespace Network { namespace HTTP { CHttpResponseExtractor::CHttpResponseExtractor() { } CHttpResponseExtractor::~CHttpResponseExtractor() { } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpResponse.h0000644000175000017500000000453612520550702023717 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CQTHTTPRESPONSE_H #define KONCLUDE_NETWORK_HTTP_CQTHTTPRESPONSE_H // Namespace includes #include "HttpSettings.h" #include "CHttpResponse.h" #include "CQtHttpRequest.h" // Library includes #include // Other includes #include "Network/CNetworkResponse.h" #include "Concurrent/Callback/CCallbackData.h" #include "Concurrent/Callback/CCallbackRememberLinkedExecuter.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent::Callback; namespace Network { namespace HTTP { /*! * * \class CQtHttpResponse * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtHttpResponse : public CHttpResponse { // public methods public: //! Constructor CQtHttpResponse(CQtHttpRequest* request, QNetworkReply* qNetworkReply = nullptr); //! Destructor virtual ~CQtHttpResponse(); QNetworkReply* getQNetworkReply(); CQtHttpRequest* getHttpRequest(); CQtHttpResponse* setQNetworkReply(QNetworkReply* qNetworkReply); CCallbackRememberLinkedExecuter* getFinishedCallbackList(); // protected methods protected: // protected variables protected: QNetworkReply* mQNetworkReply; CCallbackRememberLinkedExecuter finishCallbackList; CQtHttpRequest* mRequest; // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CQTHTTPRESPONSE_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpRequest.cpp0000644000175000017500000000305112520550700024071 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQtHttpRequest.h" namespace Konclude { namespace Network { namespace HTTP { CQtHttpRequest::CQtHttpRequest(const QUrl &url) : mQNetworkRequest(url),mByteArrayData(nullptr) { } CQtHttpRequest::CQtHttpRequest(const QUrl &url, QByteArray* data) : mQNetworkRequest(url),mByteArrayData(data) { mQNetworkRequest.setHeader(QNetworkRequest::ContentTypeHeader,QVariant("application/octet-stream")); } CQtHttpRequest::~CQtHttpRequest() { delete mByteArrayData; } QNetworkRequest* CQtHttpRequest::getQNetworkRequest() { return &mQNetworkRequest; } QByteArray* CQtHttpRequest::getByteArrayData() { return mByteArrayData; } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpListner.h0000644000175000017500000000404412520550700023531 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CQTHTTPLISTNER_H #define KONCLUDE_NETWORK_HTTP_CQTHTTPLISTNER_H // Namespace includes #include "HttpSettings.h" #include "CQtHttpConnectionHandlerFactory.h" // Library includes #include #include // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { using namespace Events; #ifndef qintptr #define qintptr int #endif /*! * * \class CQtHttpListner * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtHttpListner : public QTcpServer { // public methods public: //! Constructor CQtHttpListner(CQtHttpConnectionHandlerFactory* handlerFactory, cint64 port); //! Destructor virtual ~CQtHttpListner(); // protected methods protected: virtual void incomingConnection(qintptr socketDescriptor); // protected variables protected: CQtHttpConnectionHandlerFactory* mHandlerFactory; cint64 mPort; // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CQTHTTPLISTNER_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CHttpTransactionManager.h0000644000175000017500000000353112520550676025400 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CHTTPTRANSACTIONMANAGER_H #define KONCLUDE_NETWORK_HTTP_CHTTPTRANSACTIONMANAGER_H // Namespace includes #include "HttpSettings.h" #include "CHttpRequest.h" #include "CHttpResponse.h" // Library includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { /*! * * \class CHttpTransactionManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CHttpTransactionManager { // public methods public: //! Constructor CHttpTransactionManager(); //! Destructor virtual ~CHttpTransactionManager(); virtual CHttpResponse* getResponse(CHttpRequest* request) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CHTTPTRANSACTIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpListner.cpp0000644000175000017500000000457312520550700024073 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQtHttpListner.h" namespace Konclude { namespace Network { namespace HTTP { CQtHttpListner::CQtHttpListner(CQtHttpConnectionHandlerFactory* handlerFactory, cint64 port) { mPort = port; mHandlerFactory = handlerFactory; listen(QHostAddress::Any,port); if (isListening()) { LOG(INFO,"::Konclude::Network::HTTP::HttpListner",logTr("Listening on port '%1'").arg(port),this); } else { LOG(WARNING,"::Konclude::Network::HTTP::HttpListner",logTr("Cannot bind to port '%1', because: '%2'.").arg(port).arg(errorString()),this); } } CQtHttpListner::~CQtHttpListner() { } void CQtHttpListner::incomingConnection(qintptr socketDescriptor) { CQtHttpConnectionHandler* handler = mHandlerFactory->getConnectionHandler(); if (handler) { handler->handleIncomingConnection(socketDescriptor); } else { QTcpSocket* socket=new QTcpSocket(this); if (socket->setSocketDescriptor(socketDescriptor)) { connect(socket, SIGNAL(disconnected()), socket, SLOT(deleteLater())); socket->write("HTTP/1.1 503 too many connections\r\nConnection: close\r\n\r\nToo many connections\r\n"); LOG(WARNING,"::Konclude::Network::HTTP::HttpListner",logTr("Too many connections on port '%1'.").arg(mPort),this); socket->disconnectFromHost(); } else { connect(socket, SIGNAL(disconnected()), socket, SLOT(deleteLater())); LOG(WARNING,"::Konclude::Network::HTTP::HttpListner",logTr("Set socket description error."),this); } } } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpConnectionHandlerPooledFactory.h0000644000175000017500000000426112520550700030202 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CQTHTTPCONNECTIONHANDLERPOOLEDFACTORY_H #define KONCLUDE_NETWORK_HTTP_CQTHTTPCONNECTIONHANDLERPOOLEDFACTORY_H // Namespace includes #include "HttpSettings.h" #include "CQtHttpConnectionHandler.h" #include "CQtHttpConnectionHandlerFactory.h" #include "CQtHttpPooledConnectionHandler.h" // Library includes #include // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { /*! * * \class CQtHttpConnectionHandlerPooledFactory * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtHttpConnectionHandlerPooledFactory : public CQtHttpConnectionHandlerFactory { // public methods public: //! Constructor CQtHttpConnectionHandlerPooledFactory(CQtHttpConnectionHandlerFactory* factory); virtual CQtHttpConnectionHandler* getConnectionHandler(); // protected methods protected: // protected variables protected: QList mFreeHandlerList; QList mBusyHandlerList; cint64 mMaxHandlerCount; // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CQTHTTPCONNECTIONHANDLERPOOLEDFACTORY_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpDownloadFileRequest.h0000644000175000017500000000373412520550700026036 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CQTHTTPDOWNLOADFILEREQUEST_H #define KONCLUDE_NETWORK_HTTP_CQTHTTPDOWNLOADFILEREQUEST_H // Namespace includes #include "HttpSettings.h" #include "CHttpRequest.h" #include "CQtHttpRequest.h" // Library includes #include // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { /*! * * \class CQtHttpDownloadFileRequest * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtHttpDownloadFileRequest : public CQtHttpRequest { // public methods public: //! Constructor CQtHttpDownloadFileRequest(const QUrl &url, QIODevice* device); CQtHttpDownloadFileRequest(const QUrl &url, QByteArray* data, QIODevice* device); QIODevice* getWriteDownloadDataDevice(); // protected methods protected: // protected variables protected: QIODevice* mDevice; // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CQTHTTPDOWNLOADFILEREQUEST_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpPooledConnectionHandler.h0000644000175000017500000000370712520550700026656 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CQTHTTPPOOLEDCONNECTIONHANDLER_H #define KONCLUDE_NETWORK_HTTP_CQTHTTPPOOLEDCONNECTIONHANDLER_H // Namespace includes #include "HttpSettings.h" #include "CQtHttpConnectionHandler.h" // Library includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { /*! * * \class CQtHttpPooledConnectionHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtHttpPooledConnectionHandler : public CQtHttpConnectionHandler { // public methods public: //! Constructor CQtHttpPooledConnectionHandler(); virtual bool handleIncomingConnection(int socketDescriptor) = 0; bool isHandlerBusy(); CQtHttpPooledConnectionHandler* setHandlerBusy(); // protected methods protected: // protected variables protected: bool mHandlerBusy; // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CQTHTTPPOOLEDCONNECTIONHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpConnectionHandler.cpp0000644000175000017500000000204612520550676026055 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQtHttpConnectionHandler.h" namespace Konclude { namespace Network { namespace HTTP { CQtHttpConnectionHandler::CQtHttpConnectionHandler() { } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpResponse.cpp0000644000175000017500000000322712520550702024246 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQtHttpResponse.h" namespace Konclude { namespace Network { namespace HTTP { CQtHttpResponse::CQtHttpResponse(CQtHttpRequest* request, QNetworkReply* qNetworkReply) : mQNetworkReply(qNetworkReply) { mRequest = request; } CQtHttpResponse::~CQtHttpResponse() { } QNetworkReply* CQtHttpResponse::getQNetworkReply() { return mQNetworkReply; } CQtHttpRequest* CQtHttpResponse::getHttpRequest() { return mRequest; } CQtHttpResponse* CQtHttpResponse::setQNetworkReply(QNetworkReply* qNetworkReply) { if (mQNetworkReply) { delete mQNetworkReply; } mQNetworkReply = qNetworkReply; return this; } CCallbackRememberLinkedExecuter* CQtHttpResponse::getFinishedCallbackList() { return &finishCallbackList; } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CHttpTransactionManager.cpp0000644000175000017500000000214212520550676025730 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CHttpTransactionManager.h" namespace Konclude { namespace Network { namespace HTTP { CHttpTransactionManager::CHttpTransactionManager() { } CHttpTransactionManager::~CHttpTransactionManager() { } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpRequestBodyOnlyParser.h0000644000175000017500000000621112520550702026376 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CQTHTTPREQUESTBODYONLYPARSER_H #define KONCLUDE_NETWORK_HTTP_CQTHTTPREQUESTBODYONLYPARSER_H // Namespace includes #include "HttpSettings.h" #include "CHttpRequest.h" #include "CQtHttpRequest.h" #include "CQtHttpRequestParser.h" // Library includes #include // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { /*! * * \class CQtHttpRequestBodyOnlyParser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtHttpRequestBodyOnlyParser : public CQtHttpRequestParser { // public methods public: //! Constructor CQtHttpRequestBodyOnlyParser(); ~CQtHttpRequestBodyOnlyParser(); virtual CQtHttpRequestParser* reset(); virtual bool readFromDevice(QIODevice* readDevice); virtual CHttpRequest* takeParsedHttpRequest(); virtual bool hasHttpRequestParsingError(); virtual bool hasHttpRequestParsingCompleted(); virtual bool hasRequestedCloseConnection(); virtual QString getHttpRequestParsingErrorString(); virtual QByteArray* takeBodyData(); // protected methods protected: void parseHttpRequestHeader(); void parseHttpMethodProtocolURI(); cint64 getNextCharacterPosition(char character, cint64 searchStartPos); // protected variables protected: char* mHeaderLineReadBuffer; cint64 mHeaderLineReadBufferSize; cint64 mHeaderLineReadBufferPosition; QByteArray mHeaderData; cint64 mReadHeaderDataSize; cint64 mMaxHeaderDataSize; QString mRequestURIString; QString mRequestMethod; QString mRequestProtocol; bool mHeaderMethodProtocolURIParsed; bool mHeaderCompleted; cint64 mExpectedBodyLength; QByteArray* mBodyData; cint64 mMaxBodyDataSize; cint64 mReadBodyDataSize; bool mRequestCompleted; bool mRequestError; QString mErrorString; QString mHeaderContentLengthString; QString mHeaderConnectionString; QString mHeaderConnectionCloseString; bool mAfterwardsCloseConnection; // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CQTHTTPREQUESTBODYONLYPARSER_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CHttpResponse.h0000644000175000017500000000333212520550676023415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_HTTP_CHTTPRESPONSE_H #define KONCLUDE_NETWORK_HTTP_CHTTPRESPONSE_H // Namespace includes #include "HttpSettings.h" // Library includes #include "Network/CNetworkResponse.h" // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { namespace HTTP { /*! * * \class CHttpResponse * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CHttpResponse : public CNetworkResponse { // public methods public: //! Constructor CHttpResponse(); //! Destructor virtual ~CHttpResponse(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CHTTPRESPONSE_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpConnectionHandlerPooledFactory.cpp0000644000175000017500000000374112520550700030537 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQtHttpConnectionHandlerPooledFactory.h" namespace Konclude { namespace Network { namespace HTTP { CQtHttpConnectionHandlerPooledFactory::CQtHttpConnectionHandlerPooledFactory(CQtHttpConnectionHandlerFactory* factory) { mMaxHandlerCount = -1; } CQtHttpConnectionHandler* CQtHttpConnectionHandlerPooledFactory::getConnectionHandler() { CQtHttpPooledConnectionHandler* handler = nullptr; if (!mFreeHandlerList.isEmpty()) { handler = mFreeHandlerList.takeFirst(); mBusyHandlerList.append(handler); } else { cint64 busyHandlerCount = mBusyHandlerList.count(); for (cint64 i = 0; i < busyHandlerCount; ++i) { CQtHttpPooledConnectionHandler* tmpHandler = mBusyHandlerList.takeFirst(); if (tmpHandler->isHandlerBusy()) { mBusyHandlerList.append(tmpHandler); } else { if (!handler) { mBusyHandlerList.append(tmpHandler); handler = tmpHandler; } else { mFreeHandlerList.append(tmpHandler); } } } } if (handler) { handler->setHandlerBusy(); } return handler; } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpTransactionManager.cpp0000644000175000017500000002343612321644624026242 0ustar jonasjonas/* * * Author: Andreas Steigmiller * Copyright: 2009 Andreas Steigmiller * Project: Konclude * */ #include "CQtHttpTransactionManager.h" namespace Konclude { namespace Network { namespace HTTP { CQtHttpTransactionManager::CQtHttpTransactionManager(cint64 timeoutInterval) : CIntervalThread("HttpTransactionManagerThread") { mQNAM = nullptr; startThread(); mTimeoutInterval = timeoutInterval; } CQtHttpTransactionManager::~CQtHttpTransactionManager() { } CHttpRequest* CQtHttpTransactionManager::createRequest(const QString& url) { CQtHttpRequest* httpRequest = new CQtHttpRequest(url); return httpRequest; } //CHttpRequest* CQtHttpTransactionManager::createFileDownloadRequest(const QString& url, QIODevice* openWriteFile) { // CQtHttpDownloadFileRequest* httpRequest = new CQtHttpDownloadFileRequest(url); // return httpRequest; //} CHttpRequest* CQtHttpTransactionManager::createRequest(const QString& url, const QByteArray& byteArray) { CQtHttpRequest* httpRequest = new CQtHttpRequest(url,new QByteArray(byteArray)); return httpRequest; } bool CQtHttpTransactionManager::releaseResponse(CHttpResponse* response, bool releaseAlsoRequest) { CQtHttpResponse* qtResponse = dynamic_cast(response); if (qtResponse) { CReleaseResponseEvent* responseEvent = new CReleaseResponseEvent(qtResponse,releaseAlsoRequest); postEvent(responseEvent); return true; } return false; } CHttpResponse* CQtHttpTransactionManager::getResponse(CHttpRequest* request) { if (request) { CQtHttpRequest* qtRequest = dynamic_cast(request); return getResponse(qtRequest); } return nullptr; } CQtHttpResponse* CQtHttpTransactionManager::getResponse(CQtHttpRequest* request) { if (request) { CQtHttpResponse* response = new CQtHttpResponse(request); postEvent(new CHttpRequstEvent(request,response)); return response; } return nullptr; } bool CQtHttpTransactionManager::callbackFinishedRequest(CHttpResponse* response, CCallbackData* callbackData) { return callbackFinished(response,callbackData); } bool CQtHttpTransactionManager::callbackFinished(CHttpResponse* response, CCallbackData* callback) { if (response) { CQtHttpResponse* qtResponse = dynamic_cast(response); return callbackFinished(qtResponse,callback); } return false; } bool CQtHttpTransactionManager::callbackFinished(CQtHttpResponse* response, CCallbackData* callback) { postEvent(new CAddResponseFinishedCallbackEvent(response,callback)); return true; } void CQtHttpTransactionManager::finishedNetworkReply(QNetworkReply* reply) { QNetworkReply::NetworkError error = reply->error(); if (error) { QString errorString = reply->errorString(); LOG(WARNING,"::Konclude::Network::HTTP::QtHttpTransactionManager",logTr("HTTP-Error: %1").arg(errorString),this); } postEvent(new CHttpReplyFinishedEvent(reply)); } QString* CQtHttpTransactionManager::getExtractedText(CHttpResponse *response) { QString* text = nullptr; CQtHttpResponse* qtResponse = dynamic_cast(response); if (qtResponse) { QByteArray data; CBlockingCallbackData blockCallback; postEvent(new CExtractResponseDataEvent(qtResponse,&data,&blockCallback)); blockCallback.waitForCallback(); text = new QString(data); } return text; } QByteArray* CQtHttpTransactionManager::getResponseData(CHttpResponse* response) { QByteArray* data = nullptr; CQtHttpResponse* qtResponse = dynamic_cast(response); if (qtResponse) { data = new QByteArray(); CBlockingCallbackData blockCallback; postEvent(new CExtractResponseDataEvent(qtResponse,data,&blockCallback)); blockCallback.waitForCallback(); } return data; } bool CQtHttpTransactionManager::callbackResponseData(CHttpResponse* response, QByteArray* dataArray, CCallbackData* callback) { CQtHttpResponse* qtResponse = dynamic_cast(response); if (qtResponse) { postEvent(new CExtractResponseDataEvent(qtResponse,dataArray,callback)); return true; } return false; } bool CQtHttpTransactionManager::hasFinishedSucecssfully(CHttpResponse* response) { CQtHttpResponse* qtResponse = dynamic_cast(response); if (qtResponse) { QNetworkReply* reply = qtResponse->getQNetworkReply(); if (reply) { //QString errorString = reply->errorString(); if (reply->isFinished() && reply->error() == QNetworkReply::NoError) { return true; } } } return false; } void CQtHttpTransactionManager::threadStarted() { CThread::threadStarted(); mQNAM = new QNetworkAccessManager(); connect(mQNAM,SIGNAL(finished(QNetworkReply*)),this,SLOT(finishedNetworkReply(QNetworkReply*))); // default is 5 minutes timeout startTimerWithInterval(TIMEOUTCHECKTIMER,mTimeoutInterval); } void CQtHttpTransactionManager::threadStopped() { CThread::threadStopped(); disconnect(mQNAM); delete mQNAM; } bool CQtHttpTransactionManager::processTimer(qint64 timerID) { if (timerID == TIMEOUTCHECKTIMER) { // timeouts foreach (CQtHttpResponse* response, mCriticalTimeoutSet) { response->getFinishedCallbackList()->doCallback(); mTimeoutSet.insert(response); mReplyResponseHash.remove(response->getQNetworkReply()); } mCriticalTimeoutSet.clear(); mCriticalTimeoutSet = mNextTimeoutSet; mNextTimeoutSet.clear(); return true; } return false; } bool CQtHttpTransactionManager::processCustomsEvents(QEvent::Type type, CCustomEvent *event) { if (CThread::processCustomsEvents(type,event)) { return true; } else if (type == CHttpRequstEvent::EVENTTYPE) { CHttpRequstEvent* hre = (CHttpRequstEvent*)event; CQtHttpRequest* request = hre->getRequest(); QByteArray* byteArray = request->getByteArrayData(); CQtHttpResponse* response = hre->getResponse(); QNetworkReply* reply = nullptr; if (!byteArray) { reply = mQNAM->get(*request->getQNetworkRequest()); } else { reply = mQNAM->post(*request->getQNetworkRequest(),*byteArray); } mReplyResponseHash.insert(reply,response); mNextTimeoutSet.insert(response); response->setQNetworkReply(reply); return true; } else if (type == CHttpReplyFinishedEvent::EVENTTYPE) { CHttpReplyFinishedEvent* hrfe = (CHttpReplyFinishedEvent*)event; QNetworkReply* reply = hrfe->getReply(); CQtHttpResponse* response = mReplyResponseHash.value(reply); bool tryAgain = false; if (response) { //if (reply->error() == QNetworkReply::ProtocolUnknownError) { // tryAgain = true; //} if (tryAgain) { CQtHttpRequest* request = response->getHttpRequest(); QByteArray* byteArray = request->getByteArrayData(); QNetworkReply* reply = nullptr; if (!byteArray) { reply = mQNAM->get(*request->getQNetworkRequest()); } else { reply = mQNAM->post(*request->getQNetworkRequest(),*byteArray); } mReplyResponseHash.insert(reply,response); response->setQNetworkReply(reply); } else { response->getFinishedCallbackList()->doCallback(); mCriticalTimeoutSet.remove(response); mNextTimeoutSet.remove(response); mReplyResponseHash.remove(reply); } } return true; } else if (type == CExtractResponseDataEvent::EVENTTYPE) { CExtractResponseDataEvent* erte = (CExtractResponseDataEvent*)event; CQtHttpResponse* response = erte->getResponse(); CExtractResponseDataCallbackEvent* ertce = new CExtractResponseDataCallbackEvent(this,response,erte->getDataPointer(),erte->getCallbacks()); response->getFinishedCallbackList()->addCallbacks(ertce); return true; } else if (type == CAddResponseFinishedCallbackEvent::EVENTTYPE) { CAddResponseFinishedCallbackEvent* erte = (CAddResponseFinishedCallbackEvent*)event; CQtHttpResponse* response = erte->getResponse(); response->getFinishedCallbackList()->addCallbacks(erte->getCallbacks()); return true; } else if (type == CExtractResponseDataCallbackEvent::EVENTTYPE) { CExtractResponseDataCallbackEvent* ertce = (CExtractResponseDataCallbackEvent*)event; CQtHttpResponse* response = ertce->getResponse(); QByteArray* dataArray = ertce->getDataPointer(); if (response && dataArray && hasFinishedSucecssfully(response)) { QNetworkReply* reply = response->getQNetworkReply(); *dataArray = reply->readAll(); } CCallbackData* callbackIt = ertce->getCallbacks(); while (callbackIt) { CCallbackData* callback = callbackIt; callbackIt = callbackIt->getNext(); callback->doCallback(); } return true; } else if (type == CReleaseResponseEvent::EVENTTYPE) { CReleaseResponseEvent* rre = (CReleaseResponseEvent*)event; bool releaseAlsoRequest = rre->getReleaseAccordingRequest(); CQtHttpResponse* response = (CQtHttpResponse*)rre->getResponse(); response->getQNetworkReply()->deleteLater(); mReplyResponseHash.remove(response->getQNetworkReply()); mCriticalTimeoutSet.remove(response); mNextTimeoutSet.remove(response); if (releaseAlsoRequest) { delete response->getHttpRequest(); } delete response; return true; } return false; } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpTransactionManager.h0000644000175000017500000000727612270210560025702 0ustar jonasjonas/* * * Author: Andreas Steigmiller * Copyright: 2009 Andreas Steigmiller * Project: Konclude * */ #ifndef KONCLUDE_NETWORK_HTTP_CQTHTTPTRANSACTIONMANAGER_H #define KONCLUDE_NETWORK_HTTP_CQTHTTPTRANSACTIONMANAGER_H // Namespace includes #include "HttpSettings.h" #include "CHttpTransactionManager.h" #include "CHttpResponseExtractor.h" #include "CHttpRequestFactory.h" #include "CQtHttpRequest.h" #include "CQtHttpResponse.h" // Library includes #include #include // Other includes #include "Network/HTTP/Events/CHttpRequstEvent.h" #include "Network/HTTP/Events/CHttpReplyFinishedEvent.h" #include "Network/HTTP/Events/CExtractResponseDataEvent.h" #include "Network/HTTP/Events/CExtractResponseDataCallbackEvent.h" #include "Network/HTTP/Events/CReleaseResponseEvent.h" #include "Network/HTTP/Events/CAddResponseFinishedCallbackEvent.h" #include "Network/HTTP/Events/CInstallRequestFinishedCallbackEvent.h" #include "Concurrent/CIntervalThread.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Concurrent; namespace Network { namespace HTTP { using namespace Events; /*! * * \class CQtHttpTransactionManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtHttpTransactionManager : public CIntervalThread, public CHttpTransactionManager, public CHttpRequestFactory, public CHttpResponseExtractor { Q_OBJECT // public methods public: //! Constructor CQtHttpTransactionManager(cint64 timeoutInterval = 5*60*1000); //! Destructor virtual ~CQtHttpTransactionManager(); virtual CHttpRequest* createRequest(const QString& url); CHttpRequest* createRequest(const QString& url, const QByteArray& byteArray); //virtual CHttpRequest* createFileDownloadRequest(const QString& url, QIODevice* openWriteFile); virtual bool releaseResponse(CHttpResponse* response, bool releaseAlsoRequest = true); virtual CHttpResponse* getResponse(CHttpRequest* request); virtual CQtHttpResponse* getResponse(CQtHttpRequest* request); virtual bool callbackFinished(CHttpResponse* response, CCallbackData* callback); virtual bool callbackFinished(CQtHttpResponse* response, CCallbackData* callback); virtual bool callbackFinishedRequest(CHttpResponse* response, CCallbackData* callbackData); virtual QString* getExtractedText(CHttpResponse* response); virtual bool callbackResponseData(CHttpResponse* response, QByteArray* dataArray, CCallbackData* callback); virtual QByteArray* getResponseData(CHttpResponse* response); virtual bool hasFinishedSucecssfully(CHttpResponse* response); // protected slots protected slots: void finishedNetworkReply(QNetworkReply* reply); virtual void threadStarted(); virtual void threadStopped(); virtual bool processCustomsEvents(QEvent::Type type, CCustomEvent *event); virtual bool processTimer(qint64 timerID); // protected methods protected: // protected variables protected: cint64 mTimeoutInterval; QNetworkAccessManager* mQNAM; QHash mReplyResponseHash; QSet mCriticalTimeoutSet; QSet mNextTimeoutSet; QSet mTimeoutSet; const static qint64 TIMEOUTCHECKTIMER = 1; // private methods private: // private variables private: }; }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_HTTP_CQTHTTPTRANSACTIONMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Network/HTTP/CQtHttpDownloadFileRequest.cpp0000644000175000017500000000257512520550700026373 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQtHttpDownloadFileRequest.h" namespace Konclude { namespace Network { namespace HTTP { CQtHttpDownloadFileRequest::CQtHttpDownloadFileRequest(const QUrl &url, QIODevice* device) : CQtHttpRequest(url),mDevice(device) { } CQtHttpDownloadFileRequest::CQtHttpDownloadFileRequest(const QUrl &url, QByteArray* data, QIODevice* device) : CQtHttpRequest(url,data),mDevice(device) { } QIODevice* CQtHttpDownloadFileRequest::getWriteDownloadDataDevice() { return mDevice; } }; // end namespace HTTP }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/NetworkSettings.h0000644000175000017500000000254312520550702023240 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_NETWORKSETTINGS #define KONCLUDE_NETWORK_NETWORKSETTINGS // Library includes // Namespace includes // Other includes #include "Utilities/UtilitiesSettings.h" // Logger includes namespace Konclude { using namespace Utilities; namespace Network { /*! * * \file NetworkSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations // Konclude code configs }; // end namespace Network }; // end namespace Konclude #endif // end KONCLUDE_NETWORK_NETWORKSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Network/CNetworkRequest.cpp0000644000175000017500000000201012520550702023513 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNetworkRequest.h" namespace Konclude { namespace Network { CNetworkRequest::CNetworkRequest() { } CNetworkRequest::~CNetworkRequest() { } }; // end namespace Network }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Network/CNetworkRequest.h0000644000175000017500000000307412520550702023173 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_NETWORK_CNETWORKREQUEST_H #define KONCLUDE_NETWORK_CNETWORKREQUEST_H // Library includes // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" namespace Konclude { namespace Network { /*! * * \class CNetworkRequest * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNetworkRequest { // public methods public: //! Constructor CNetworkRequest(); //! Destructor virtual ~CNetworkRequest(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Network }; // end namespace Konclude #endif // KONCLUDE_NETWORK_CNETWORKREQUEST_H Konclude-v0.6.2-544-SourceCode/Source/Parser/0000755000175000017500000000000012613407252017520 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Parser/CParsingHandlingContext.h0000644000175000017500000000325612520550740024415 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CPARSINGHANDLINGCONTEXT_H #define KONCLUDE_PARSER_CPARSINGHANDLINGCONTEXT_H // Libraries includes // Namespace includes #include "ParserSettings.h" // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class CXMLHandlingContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CParsingHandlingContext : public CContext { // public methods public: //! Constructor CParsingHandlingContext(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CPARSINGHANDLINGCONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CParsingProgressionRecording.cpp0000644000175000017500000000211312520550740026015 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CParsingProgressionRecording.h" namespace Konclude { namespace Parser { CParsingProgressionRecording::CParsingProgressionRecording() { } CParsingProgressionRecording::~CParsingProgressionRecording() { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CParsingProgressionRecording.h0000644000175000017500000000350312520550740025466 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CPARSINGPROGRESSIONRECORDING_H #define KONCLUDE_PARSER_CPARSINGPROGRESSIONRECORDING_H // Libraries includes #include // Namespace includes // Other includes #include "Logger/Record/CContextRecorder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Konclude::Logger::Record; namespace Parser { /*! * * \class CParsingProgressionRecording * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CParsingProgressionRecording : public CContextRecorder { // public methods public: //! Constructor CParsingProgressionRecording(); //! Destructor virtual ~CParsingProgressionRecording(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CPARSINGPROGRESSIONRECORDING_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLHandlerStack.cpp0000644000175000017500000000173412520550740023256 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CXMLHandlerStack.h" namespace Konclude { namespace Parser { CXMLHandlerStack::CXMLHandlerStack() { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/COntologyBuilder.h0000644000175000017500000000351112520550736023120 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CONTOLOGYBUILDER_H #define KONCLUDE_PARSER_CONTOLOGYBUILDER_H // Libraries includes // Namespace includes #include "CTBoxAxiomBuilder.h" #include "CABoxAxiomBuilder.h" #include "CRBoxAxiomBuilder.h" #include "CAxiomOntologyBuilder.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class COntologyBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COntologyBuilder : public CTBoxAxiomBuilder, public CRBoxAxiomBuilder, public CABoxAxiomBuilder, public CAxiomOntologyBuilder { // public methods public: //! Constructor COntologyBuilder(); //! Destructor virtual ~COntologyBuilder(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CONTOLOGYBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/COWLlinkQtXMLComplexQueryParser.cpp0000644000175000017500000000340312520550736026272 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLlinkQtXMLComplexQueryParser.h" namespace Konclude { namespace Parser { COWLlinkQtXMLComplexQueryParser::COWLlinkQtXMLComplexQueryParser(CQueryBuilder *queryBuilder, COntologyParser* ontoParser) : COWLlinkQueryParser(queryBuilder) { mOntoParser = ontoParser; LOG(INFO,"::Konclude::Parser::OWLlinkQtXMLComplexQueryParser",logTr("OWLlink Query Parser initialized."),this); } COWLlinkQtXMLComplexQueryParser::~COWLlinkQtXMLComplexQueryParser() { } QList COWLlinkQtXMLComplexQueryParser::parseOntologyChildNodes(QDomElement *node) { QList builds; QDomElement childNode = node->firstChildElement(); while (!childNode.isNull()) { CBuildExpression *expression = mOntoParser->getParsedBuildNode(&childNode); if (expression) { builds.append(expression); } childNode = childNode.nextSiblingElement(); } return builds; } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLHandlerStackBase.cpp0000644000175000017500000000703012520550740024044 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CXMLHandlerStackBase.h" namespace Konclude { namespace Parser { CXMLHandlerStackBase::CXMLHandlerStackBase() : CLogIdentifier("::Konclude::Parser::XMLHandlerStackBase",this) { mCurrentHandlerData = nullptr; mParseElementLevel = 0; } bool CXMLHandlerStackBase::pushStackedHandler(CXMLHandler* handler, bool automaticallyPop, CParsingHandlingContext* handlingContext) { if (handler) { CXMLHandlerData* newHandlerData = new CXMLHandlerData(handler,automaticallyPop,mParseElementLevel); mHandlerDataStack.push(newHandlerData); mCurrentHandlerData = newHandlerData; return true; } return false; } bool CXMLHandlerStackBase::popStackedHandler(CXMLHandler* handler, CParsingHandlingContext* handlingContext) { if (!mCurrentHandlerData || mCurrentHandlerData->mHandler != handler) { return false; } mHandlerDataStack.pop(); mCurrentHandlerData = nullptr; if (mHandlerDataStack.count() > 0) { mCurrentHandlerData = mHandlerDataStack.top(); } return true; } bool CXMLHandlerStackBase::startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts, CParsingHandlingContext* handlingContext) { ++mParseElementLevel; if (mCurrentHandlerData) { if (!mCurrentHandlerData->mStartDocumentCalled) { mCurrentHandlerData->mStartDocumentCalled = true; mCurrentHandlerData->mHandler->startDocument(handlingContext); } return mCurrentHandlerData->mHandler->startElement(namespaceURI,localName,qName,atts,handlingContext); } return false; } bool CXMLHandlerStackBase::endElement(const QString& namespaceURI, const QString& localName, const QString& qName, CParsingHandlingContext* handlingContext) { --mParseElementLevel; if (mCurrentHandlerData) { if (mCurrentHandlerData->mParseElementLevel > mParseElementLevel) { bool autoPop = mCurrentHandlerData->mAutoPop; mCurrentHandlerData->mHandler->endDocument(handlingContext); if (autoPop) { popStackedHandler(mCurrentHandlerData->mHandler,handlingContext); } } } if (mCurrentHandlerData) { return mCurrentHandlerData->mHandler->endElement(namespaceURI,localName,qName,handlingContext); } return false; } bool CXMLHandlerStackBase::startDocument(CParsingHandlingContext* handlingContext) { return true; } bool CXMLHandlerStackBase::endDocument(CParsingHandlingContext* handlingContext) { while (mCurrentHandlerData) { bool autoPop = mCurrentHandlerData->mAutoPop; mCurrentHandlerData->mHandler->endDocument(handlingContext); if (autoPop) { popStackedHandler(mCurrentHandlerData->mHandler,handlingContext); } } return true; } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/COWLlinkQtXMLComplexQueryParser.h0000644000175000017500000000377112520550736025747 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_COWLLINKQTXMLCOMPLEXQUERYPARSER_H #define KONCLUDE_PARSER_COWLLINKQTXMLCOMPLEXQUERYPARSER_H // Libraries includes #include #include // Namespace includes #include "CQueryParser.h" #include "COntologyParser.h" #include "COWLlinkQueryParser.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class COWLlinkQtXMLComplexQueryParser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLlinkQtXMLComplexQueryParser : public COWLlinkQueryParser { // public methods public: //! Constructor COWLlinkQtXMLComplexQueryParser(CQueryBuilder *queryBuilder, COntologyParser* ontoParser); //! Destructor virtual ~COWLlinkQtXMLComplexQueryParser(); // protected methods protected: virtual QList parseOntologyChildNodes(QDomElement *node); // private methods private: COntologyParser* mOntoParser; // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_COWLLINKQTXMLCOMPLEXQUERYPARSER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CParseRuleAtom.h0000644000175000017500000000401112520550736022516 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CPARSERULEATOM_H #define KONCLUDE_PARSER_CPARSERULEATOM_H // Libraries includes #include #include // Namespace includes #include "Expressions/CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { using namespace Expression; /*! * * \class CParseRuleAtom * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CParseRuleAtom { // public methods public: enum ATOMTYPE { PROPERTYATOM, CLASSATOM, DIFFERENTINDIVIDUALSATOM }; //! Constructor CParseRuleAtom(ATOMTYPE atomType); CParseRuleAtom* addVariableString(const QString& variableString); const QString getOtherVariable(const QString& variableString, bool& inversed); QString mVariableName1; QString mVariableName2; ATOMTYPE mAtomType; CBuildExpression* mAtomExpression; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CPARSERULEATOM_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CStringPrimitiveConverter.cpp0000644000175000017500000000411312520550740025353 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CStringPrimitiveConverter.h" namespace Konclude { namespace Parser { CStringPrimitiveConverter::CStringPrimitiveConverter() { } CStringPrimitiveConverter::~CStringPrimitiveConverter() { } qint64 CStringPrimitiveConverter::convertStringToInteger(const QString &integerString, qint64 defaultValue, bool *parseErrorFlag) { bool integerParseSuccFlag = false; qint64 integer = integerString.toLongLong(&integerParseSuccFlag); if (!integerParseSuccFlag) { if (parseErrorFlag) { *parseErrorFlag = true; } integer = defaultValue; } return integer; } bool CStringPrimitiveConverter::convertStringToBoolean(const QString &booleanString, bool defaultValue, bool *parseErrorFlag) { if (parseErrorFlag) { *parseErrorFlag = false; } bool integerConvertErrorFlag = false; qint64 integer = convertStringToInteger(booleanString,0,&integerConvertErrorFlag); if (!integerConvertErrorFlag) { return integer != 0; } else { if (booleanString.toUpper() == "TRUE") { return true; } else if (booleanString.toUpper() == "FALSE") { return false; } else { if (parseErrorFlag) { *parseErrorFlag = true; } return defaultValue; } } } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CQueryParser.cpp0000644000175000017500000000177312520550740022617 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryParser.h" namespace Konclude { namespace Parser { CQueryParser::CQueryParser() { } CQueryParser::~CQueryParser() { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CQueryParser.h0000644000175000017500000000350012520550740022252 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CQUERYPARSER_H #define KONCLUDE_PARSER_CQUERYPARSER_H // Libraries includes #include // Namespace includes #include "CQueryBuilder.h" // Other includes #include "Expressions/CQueryIsClassSatisfiableExpression.h" #include "Expressions/CQueryAreClassesEquivalentExpression.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class CQueryParser * \author Andreas Steigmiller * \version 0.1 * \brief Parser for OWL/XML Files * */ class CQueryParser { // public methods public: //! Constructor CQueryParser(); //! Destructor virtual ~CQueryParser(); virtual bool parseQueryFile(QString filename) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CQueryParser_H Konclude-v0.6.2-544-SourceCode/Source/Parser/COWLlinkQtXMLSimpleQueryParser.h0000644000175000017500000000437512520550736025572 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_COWLLINKQTXMLSIMPLEQUERYPARSER_H #define KONCLUDE_PARSER_COWLLINKQTXMLSIMPLEQUERYPARSER_H // Libraries includes #include #include // Namespace includes #include "CQueryParser.h" #include "COWLlinkQueryParser.h" // Other includes #include "Reasoner/Ontology/CConcreteOntology.h" #include "Reasoner/Generator/CStringRefStringHasher.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Ontology; using namespace Reasoner::Generator; namespace Parser { /*! * * \class COWLlinkQtXMLSimpleQueryParser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLlinkQtXMLSimpleQueryParser : public COWLlinkQueryParser { // public methods public: //! Constructor COWLlinkQtXMLSimpleQueryParser(CQueryBuilder *queryBuilder, CConcreteOntology* conOntology); //! Destructor virtual ~COWLlinkQtXMLSimpleQueryParser(); // protected methods protected: virtual QList parseOntologyChildNodes(QDomElement *node); QString getEntityStringName(QDomElement *node); QString resolveAbbreviationName(const QString& name); // private methods private: CConcreteOntology* mConOntology; // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_COWLLINKQTXMLSIMPLEQUERYPARSER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/COWLlinkQtXMLCommandParser.h0000644000175000017500000002002212520550736024654 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_COWLLINKQTXMLCOMMANDPARSER_H #define KONCLUDE_PARSER_COWLLINKQTXMLCOMMANDPARSER_H // Libraries includes #include #include // Namespace includes #include "CCommandParser.h" #include "CStringPrimitiveConverter.h" #include "COWLlinkQtXMLResultParser.h" // Other includes #include "Control/Command/Instructions/CGetDescriptionCommand.h" #include "Control/Command/Instructions/CParseOWLlinkCommandsCommand.h" #include "Control/Command/Instructions/CTellKnowledgeBaseOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CCreateKnowledgeBaseCommand.h" #include "Control/Command/Instructions/CIsSatisfiableQueryOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CAreClassesEquivalentQueryOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CSkipUnsupportedCommandCommand.h" #include "Control/Command/Instructions/CReleaseKnowledgeBaseCommand.h" #include "Control/Command/Instructions/CAreClassesDisjointQueryOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CIsClassSubsumedByQueryOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CIsInstanceOfQueryOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CGetFlattenedTypesOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CTestExtendedCalculateQueryCommand.h" #include "Control/Command/Instructions/CParseTestsuiteXMLNodeCommand.h" #include "Control/Command/Instructions/CInsertResponseCommentCommand.h" #include "Control/Command/Instructions/CSetKnowledgeBaseConfigCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseConfigCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseSettingsCommand.h" #include "Control/Command/Instructions/CGetSubClassHierarchyQueryOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CLoadKnowledgeBaseKRSSTestConceptCommand.h" #include "Control/Command/Instructions/CSaveOWL2XMLExtractedKnowledgeBaseCommand.h" #include "Control/Command/Instructions/CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand.h" #include "Control/Command/Instructions/CLoadKnowledgeBaseOWLXMLOntologyCommand.h" #include "Control/Command/Instructions/CProcessQueryOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CKnowledgeBaseClassifyCommand.h" #include "Control/Command/Instructions/CKnowledgeBaseRealizeCommand.h" #include "Control/Command/Instructions/CEvaluateTestsuiteCommand.h" #include "Control/Command/Instructions/CIsConsistentQueryOWL2XMLNodeCommand.h" #include "Control/Command/Instructions/CClassifyQueryCommand.h" #include "Control/Command/Instructions/CRealizeQueryCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseClassEntitiesCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseObjectPropertyEntitiesCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseNamedIndividualEntitiesCommand.h" #include "Control/Command/Instructions/CGetKnowledgeBaseLanguageCommand.h" #include "Control/Command/Instructions/CLoadKnowledgeBaseOWLAutoOntologyCommand.h" #include "Control/Command/Records/CFinishProcessCommandRecord.h" #include "Control/Command/Records/CStartProcessCommandRecord.h" #include "Control/Command/Records/CStopProcessCommandRecord.h" #include "Control/Command/Records/CNotSupportedNodeErrorRecord.h" #include "Control/Command/CCommandDelegater.h" #include "Control/Command/CCommandProcessedPrecondition.h" #include "Reasoner/Query/CBooleanQueryResult.h" #include "Reasoner/Query/CQueryResult.h" #include "Logger/CLogIdentifier.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; using namespace std; namespace Konclude { using namespace Reasoner::Query; using namespace Control::Command; using namespace Instructions; using namespace Records; namespace Parser { /*! * * \class COWLlinkQtXMLCommandParser * \author Andreas Steigmiller * \version 0.1 * \brief Parser for OWL/XML Files * */ class COWLlinkQtXMLCommandParser : public CCommandParser, public CLogIdentifier { // public methods public: //! Constructor COWLlinkQtXMLCommandParser(); //! Destructor virtual ~COWLlinkQtXMLCommandParser(); virtual bool realizeCommand(CParseOWLlinkCommandsCommand *command, CCommandDelegater *commandDelegater); virtual bool parse(const QByteArray &content); virtual bool parse(QDomElement *node); // protected methods protected: void parseOWLlinkRequestNode(QDomElement *requestNode); CGetDescriptionCommand *parseGetDescriptionNode(QDomElement *descriptionNode); CCreateKnowledgeBaseCommand *parseCreateKnowledgeBaseNode(QDomElement *createKBNode); CTellKnowledgeBaseOWL2XMLNodeCommand *parseTellKnowledgeBaseNode(QDomElement *node); CTellKnowledgeBaseOWL2XMLNodeCommand *parseRectractKnowledgeBaseNode(QDomElement *node); CLoadKnowledgeBaseKRSSTestConceptCommand* parseLoadKnowledgeBaseKRSSTestConceptNode(QDomElement *node); CLoadKnowledgeBaseOWLAutoOntologyCommand* parseLoadKnowledgeBaseOntologyNode(QDomElement *node); CSaveOWL2XMLExtractedKnowledgeBaseCommand* parseSaveExtractedKnowledgeBaseNode(QDomElement *node); CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand* parseSaveExtractedOWLlinkTestCaseKnowledgeBaseNode(QDomElement *node); CProcessQueryOWL2XMLNodeCommand *parseProcessQueryNode(QDomElement *node); CGetSubClassHierarchyQueryOWL2XMLNodeCommand *parseGetSubClassHierarchyNode(QDomElement *node); CIsConsistentQueryOWL2XMLNodeCommand *parseIsConsistentNode(QDomElement *node); CClassifyQueryCommand* parseKnowledgeBaseClassifyNode(QDomElement *node); CRealizeQueryCommand* parseKnowledgeBaseRealizeNode(QDomElement *node); CReleaseKnowledgeBaseCommand *parseReleaseKnowledgeBaseNode(QDomElement *node); CParseTestsuiteXMLNodeCommand *parseTestTestsuiteNode(QDomElement *node); CEvaluateTestsuiteCommand* parseEvaluateTestsuiteNode(QDomElement* node); CInsertResponseCommentCommand *parseInsertResponseCommentNode(QDomElement *node); CGetKnowledgeBaseLanguageCommand *parseGetKnowledgeBaseLanguageNode(QDomElement *node); CGetKnowledgeBaseClassEntitiesCommand *parseGetKnowledgeBaseClassEntitiesNode(QDomElement *node); CGetKnowledgeBaseObjectPropertyEntitiesCommand *parseGetKnowledgeBaseObjectPropertyEntitiesNode(QDomElement *node); CGetKnowledgeBaseNamedIndividualEntitiesCommand *parseGetKnowledgeBaseIndividualEntitiesNode(QDomElement *node); CGetConfigCommand *parseGetSettingNode(QDomElement *node); CSetConfigCommand *parseSetSettingNode(QDomElement *node); CGetSettingsCommand *parseGetSettingsNode(QDomElement *node); void parseQueryExtensions(QDomElement *node, CKnowledgeBaseQueryCommand *queryCommand); void parseQueryExpectedResult(QDomElement *node, CKnowledgeBaseQueryCommand *queryCommand); CQueryResult *parseQueryResult(QDomElement *node); QString getOWLLinkMappedConfigString(const QString &keyName); bool requiresComplexQuery(QDomElement *node); // protected variables protected: CParseOWLlinkCommandsCommand *command; CCommandRecorder *recorder; CCommandDelegater *delegater; // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_COWLLINKQTXMLCOMMANDPARSER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CKRSSOntologyParser.h0000644000175000017500000001101512520550734023465 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CKRSSONTOLOGYPARSER_H #define KONCLUDE_PARSER_CKRSSONTOLOGYPARSER_H // Libraries includes #include #include // Namespace includes #include "COntologyParser.h" #include "COntologyBuilder.h" // Other includes #include "Control/Command/CCommandRecordRouter.h" #include "Control/Command/Records/CNotSupportedNodeErrorRecord.h" #include "Logger/CLogIdentifier.h" #include "Utilities/Container/CQtHash.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; using namespace std; namespace Konclude { using namespace Utilities::Container; using namespace Control::Command; using namespace Control::Command::Records; namespace Parser { #define KONCLUDE_PARSER_USEPARSEJUMPFUNCTIONHASH /*! * * \class CKRSSOntologyParser * \author Andreas Steigmiller * \version 0.1 * \brief Parser for KRSS Text * */ class CKRSSOntologyParser : public CLogIdentifier { // public methods public: //! Constructor CKRSSOntologyParser(COntologyBuilder* ontoBuilder); CKRSSOntologyParser(COntologyBuilder* ontoBuilder, const QString& defNameString, CCommandRecordRouter* commandRecordRouter); //! Destructor virtual ~CKRSSOntologyParser(); virtual bool parseOntologyFile(const QString& filename); virtual bool parseOntologyText(const QString& text); virtual CBuildExpression* parseKRSSLine(const QString& line); // protected methods protected: bool initializeParseFunctionJumpHash(); CBuildExpression* parseKRSSExpression(const QString& text, cint64& index); QList parseClassChildNodes(const QString& text, cint64& index); QList parseSpecialClassChildNodes(const QString& text, const QString& identicalChild, cint64& index); QList parsePropertyClassChildNodes(const QString& text, cint64& index); QString parseIdentifierNode(const QString& text, cint64& index); bool checkIdentifierNode(const QString& text, const QString& expectedString, cint64& index); CClassTermExpression* parseClassNode(const QString& text, cint64& index); CObjectPropertyExpression* parseObjectPropertyNode(const QString& text, cint64& index); CDeclarationAxiomExpression* parseDeclarationNode(CBuildExpression* expression); CBuildExpression* parseObjectIntersectionOfNode(const QString& text, cint64& index); CBuildExpression* parseObjectUnionOfNode(const QString& text, cint64& index); CBuildExpression* parseObjectSomeValuesFromNode(const QString& text, cint64& index); CBuildExpression* parseObjectAllValuesFromNode(const QString& text, cint64& index); CBuildExpression* parseObjectComplementOfNode(const QString& text, cint64& index); CBuildExpression* jumpFunctionParseObjectIntersectionOfNode(const QString& text, cint64& index); CBuildExpression* jumpFunctionParseObjectUnionOfNode(const QString& text, cint64& index); CBuildExpression* jumpFunctionParseObjectSomeValuesFromNode(const QString& text, cint64& index); CBuildExpression* jumpFunctionParseObjectAllValuesFromNode(const QString& text, cint64& index); CBuildExpression* jumpFunctionParseObjectComplementOfNode(const QString& text, cint64& index); // protected variables protected: CCommandRecordRouter recordRouter; COntologyBuilder* mOntoBuilder; typedef CBuildExpression* (CKRSSOntologyParser::*ParseFunction) (const QString& text, cint64& index); CQtHash mParseFunctionJumpHash; QString mDefName; cint64 mDefNumber; // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CKRSSONTOLOGYPARSER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/COWL2QtXMLOntologyStableStreamParser.h0000644000175000017500000000412612520550736026632 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_COWL2QtXMLOntologyStableStreamParser_H #define KONCLUDE_PARSER_COWL2QtXMLOntologyStableStreamParser_H // Libraries includes #include #include #include // Namespace includes #include "ParserSettings.h" #include "COWL2QtXMLOntologyStreamParser.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class COWL2QtXMLOntologyStableStreamParser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWL2QtXMLOntologyStableStreamParser : public COWL2QtXMLOntologyStreamParser { // public methods public: //! Constructor COWL2QtXMLOntologyStableStreamParser(COntologyBuilder* ontologyBuilder); virtual ~COWL2QtXMLOntologyStableStreamParser(); virtual bool parseOntology(QIODevice* ioDevice); bool addMoreDataToXMLReader(QXmlStreamReader* xmlReader, QIODevice* ioDevice); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_COWL2QtXMLOntologyStableStreamParser_H Konclude-v0.6.2-544-SourceCode/Source/Parser/COntologyBuilder.cpp0000644000175000017500000000201212520550736023446 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyBuilder.h" namespace Konclude { namespace Parser { COntologyBuilder::COntologyBuilder() { } COntologyBuilder::~COntologyBuilder() { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/COWL2QtXMLOntologyParser.cpp0000644000175000017500000024425312520550736024665 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWL2QtXMLOntologyParser.h" namespace Konclude { namespace Parser { COWL2QtXMLOntologyParser::COWL2QtXMLOntologyParser(COntologyBuilder* ontoBuilder) : CLogIdentifier("::Konclude::Parser::OWL2QtXMLOntologyParser",this),recordRouter(0,this) { mOntoBuilder = ontoBuilder; mAxiomNumber = 0; mReportErrorCount = 100; LOG(INFO,getLogDomain(),logTr("Created OWL 2.0 Qt XML Parser."),this); #ifdef KONCLUDE_PARSER_USEPARSEJUMPFUNCTIONHASH initializeParseFunctionJumpHash(); #endif } COWL2QtXMLOntologyParser::COWL2QtXMLOntologyParser(COntologyBuilder* ontoBuilder, CCommandRecordRouter *commandRecordRouter) : CLogIdentifier("::Konclude::Parser::OWL2QtXMLOntologyParser",this),recordRouter(*commandRecordRouter,this) { mOntoBuilder = ontoBuilder; mAxiomNumber = 0; mReportErrorCount = 100; LOG(INFO,getLogDomain(),logTr("Created OWL 2.0 Qt XML Parser."),this); #ifdef KONCLUDE_PARSER_USEPARSEJUMPFUNCTIONHASH initializeParseFunctionJumpHash(); #endif } COWL2QtXMLOntologyParser::~COWL2QtXMLOntologyParser() { } bool COWL2QtXMLOntologyParser::parseOntologyFile(const QString& filename) { LOG(INFO,getLogDomain(),logTr("Loading XML File: '%1'.").arg(filename),this); bool successfullParsed = true; // parse file QFile file(filename); if (file.open(QIODevice::ReadOnly)) { QDomDocument document; QString errorMessage; int errorLine = 0, errorColumn = 0; if (document.setContent(file.readAll(),true,&errorMessage,&errorLine,&errorColumn)) { QDomElement documentElement(document.documentElement()); QString docElemName = documentElement.tagName(); if (docElemName == "Ontology" || docElemName == "owl:Ontology") { LOG(INFO,getLogDomain(),logTr("Found OWL-Ontology Node."),this); parseTellOntologyAxiomNode(&documentElement); } else if (docElemName == "Tell" || docElemName == "owl:Tell") { LOG(INFO,getLogDomain(),logTr("Found Ontology-Tell Node."),this); parseTellOntologyAxiomNode(&documentElement); } else { successfullParsed = false; LOG(ERROR,getLogDomain(),logTr("Not supported node '%1'.").arg(docElemName),this); } LOG(INFO,getLogDomain(),logTr("Parsing of '%1' completed.").arg(filename),this); } else { LOG(ERROR,getLogDomain(),logTr("XML error: %1, file: %2, line: %3, column %4.").arg(errorMessage).arg(filename).arg(errorLine).arg(errorColumn),this); } file.close(); } else { successfullParsed = false; LOG(ERROR,getLogDomain(),logTr("File '%1' not found or couldn't be opened.").arg(filename),this); } return successfullParsed; } bool COWL2QtXMLOntologyParser::parseTellOntologyAxiomNode(QDomElement *ontologyNode) { QDomElement node = ontologyNode->firstChildElement(); while (!node.isNull()) { // build for each node an expression CBuildExpression* expression = parseBuildNode(&node); if (expression) { CAxiomExpression* axiomExpression = dynamic_cast(expression); if (axiomExpression) { mOntoBuilder->tellOntologyAxiom(axiomExpression); } } else { QList expressionList(parseRuleNode(&node)); foreach (CBuildExpression* expression, expressionList) { CAxiomExpression* axiomExpression = dynamic_cast(expression); if (axiomExpression) { mOntoBuilder->tellOntologyAxiom(axiomExpression); } } } node = node.nextSiblingElement(); } return true; } bool COWL2QtXMLOntologyParser::parseOntologyNode(QDomElement* ontologyNode) { mOntologyName = ontologyNode->attribute("ontologyIRI"); QString addDelSring = ontologyNode->localName(); if (addDelSring.isEmpty()) { addDelSring = ontologyNode->tagName(); } if (addDelSring == "Retract") { parseRetractOntologyAxiomNode(ontologyNode); } else { parseTellOntologyAxiomNode(ontologyNode); } return true; } bool COWL2QtXMLOntologyParser::parseRetractOntologyAxiomNode(QDomElement *ontologyNode) { QDomElement node = ontologyNode->firstChildElement(); while (!node.isNull()) { // build for each node an expression CBuildExpression* expression = parseBuildNode(&node); if (expression) { CAxiomExpression* axiomExpression = dynamic_cast(expression); if (axiomExpression) { mOntoBuilder->retractOntologyAxiom(axiomExpression); } } else { QList expressionList(parseRuleNode(&node)); foreach (CBuildExpression* expression, expressionList) { CAxiomExpression* axiomExpression = dynamic_cast(expression); if (axiomExpression) { mOntoBuilder->retractOntologyAxiom(axiomExpression); } } } node = node.nextSiblingElement(); } return true; } CBuildExpression *COWL2QtXMLOntologyParser::getParsedBuildNode(QDomElement *node) { return parseBuildNode(node); } bool COWL2QtXMLOntologyParser::parsePrefixNode(QDomElement* node) { QString abbName = node->attribute(QString("name")); QString totalIRIName = node->attribute(QString("IRI")); if (!totalIRIName.isEmpty()) { mOntoBuilder->addNameAbbreviation(totalIRIName,abbName); return true; } return false; } QString COWL2QtXMLOntologyParser::getEntityName(QDomElement* node) { QString entityName; bool abbreviated = false; QString attrName = node->attribute(QString("IRI")); if (attrName.isEmpty()) { attrName = node->attribute(QString("abbreviatedIRI")); abbreviated = true; } if (attrName.isEmpty()) { attrName = node->attribute(QString("owl:IRI")); } if (attrName.isEmpty()) { attrName = node->attribute(QString("owl:abbreviatedIRI")); abbreviated = true; } if (attrName.isEmpty()) { attrName = node->attribute(QString("URI")); } if (attrName.isEmpty()) { attrName = node->attribute(QString("owl:URI")); } if (abbreviated) { entityName = mOntoBuilder->resolveAbbreviationName(attrName); } else { entityName = attrName; } return entityName; } bool COWL2QtXMLOntologyParser::initializeParseFunctionJumpHash() { mParseFunctionJumpHash.insert("Prefix",&COWL2QtXMLOntologyParser::jumpFunctionParsePrefixNode); mParseFunctionJumpHash.insert("owl:Prefix",&COWL2QtXMLOntologyParser::jumpFunctionParsePrefixNode); mParseFunctionJumpHash.insert("Class",&COWL2QtXMLOntologyParser::jumpFunctionParseClassNode); mParseFunctionJumpHash.insert("owl:Class",&COWL2QtXMLOntologyParser::jumpFunctionParseClassNode); mParseFunctionJumpHash.insert("OWLClass",&COWL2QtXMLOntologyParser::jumpFunctionParseClassNode); mParseFunctionJumpHash.insert("owl:OWLClass",&COWL2QtXMLOntologyParser::jumpFunctionParseClassNode); mParseFunctionJumpHash.insert("ObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyNode); mParseFunctionJumpHash.insert("owl:ObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyNode); mParseFunctionJumpHash.insert("IndividualVariable",&COWL2QtXMLOntologyParser::jumpFunctionParseIndividualVariable); mParseFunctionJumpHash.insert("owl:IndividualVariable",&COWL2QtXMLOntologyParser::jumpFunctionParseIndividualVariable); mParseFunctionJumpHash.insert("Declaration",&COWL2QtXMLOntologyParser::jumpFunctionParseDeclarationNode); mParseFunctionJumpHash.insert("owl:Declaration",&COWL2QtXMLOntologyParser::jumpFunctionParseDeclarationNode); mParseFunctionJumpHash.insert("SubClassOf",&COWL2QtXMLOntologyParser::jumpFunctionParseSubClassOfNode); mParseFunctionJumpHash.insert("owl:SubClassOf",&COWL2QtXMLOntologyParser::jumpFunctionParseSubClassOfNode); mParseFunctionJumpHash.insert("EquivalentClasses",&COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentClassesNode); mParseFunctionJumpHash.insert("owl:EquivalentClasses",&COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentClassesNode); mParseFunctionJumpHash.insert("DisjointClasses",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjontClassesNode); mParseFunctionJumpHash.insert("owl:DisjointClasses",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjontClassesNode); mParseFunctionJumpHash.insert("DisjointUnion",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjontUnionNode); mParseFunctionJumpHash.insert("owl:DisjointUnion",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjontUnionNode); mParseFunctionJumpHash.insert("SubObjectPropertyOf",&COWL2QtXMLOntologyParser::jumpFunctionParseSubObjectPropertyOfNode); mParseFunctionJumpHash.insert("owl:SubObjectPropertyOf",&COWL2QtXMLOntologyParser::jumpFunctionParseSubObjectPropertyOfNode); mParseFunctionJumpHash.insert("ObjectPropertyChain",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyChainNode); mParseFunctionJumpHash.insert("owl:ObjectPropertyChain",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyChainNode); mParseFunctionJumpHash.insert("EquivalentObjectProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentObjectPropertiesNode); mParseFunctionJumpHash.insert("owl:EquivalentObjectProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentObjectPropertiesNode); mParseFunctionJumpHash.insert("DisjointObjectProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjointObjectPropertiesNode); mParseFunctionJumpHash.insert("owl:DisjointObjectProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjointObjectPropertiesNode); mParseFunctionJumpHash.insert("ObjectInverseOf",&COWL2QtXMLOntologyParser::jumpFunctionParseInverseObjectPropertyOfNode); mParseFunctionJumpHash.insert("owl:ObjectInverseOf",&COWL2QtXMLOntologyParser::jumpFunctionParseInverseObjectPropertyOfNode); mParseFunctionJumpHash.insert("InverseObjectProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseInverseObjectPropertiesNode); mParseFunctionJumpHash.insert("owl:InverseObjectProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseInverseObjectPropertiesNode); mParseFunctionJumpHash.insert("ObjectPropertyRange",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyRangeNode); mParseFunctionJumpHash.insert("owl:ObjectPropertyRange",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyRangeNode); mParseFunctionJumpHash.insert("ObjectPropertyDomain",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyDomainNode); mParseFunctionJumpHash.insert("owl:ObjectPropertyDomain",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyDomainNode); mParseFunctionJumpHash.insert("TransitiveObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseTransetiveObjectPropertyNode); mParseFunctionJumpHash.insert("owl:TransitiveObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseTransetiveObjectPropertyNode); mParseFunctionJumpHash.insert("FunctionalObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseFunctionalObjectPropertyNode); mParseFunctionJumpHash.insert("owl:FunctionalObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseFunctionalObjectPropertyNode); mParseFunctionJumpHash.insert("SymmetricObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseSymmetricObjectPropertyNode); mParseFunctionJumpHash.insert("owl:SymmetricObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseSymmetricObjectPropertyNode); mParseFunctionJumpHash.insert("AsymmetricObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseAsymmetricObjectPropertyNode); mParseFunctionJumpHash.insert("owl:AsymmetricObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseAsymmetricObjectPropertyNode); mParseFunctionJumpHash.insert("ReflexiveObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseReflexiveObjectPropertyNode); mParseFunctionJumpHash.insert("owl:ReflexiveObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseReflexiveObjectPropertyNode); mParseFunctionJumpHash.insert("IrreflexiveObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseIrreflexiveObjectPropertyNode); mParseFunctionJumpHash.insert("owl:IrreflexiveObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseIrreflexiveObjectPropertyNode); mParseFunctionJumpHash.insert("InverseFunctionalObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseInverseFunctionalObjectPropertyNode); mParseFunctionJumpHash.insert("owl:InverseFunctionalObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseInverseFunctionalObjectPropertyNode); mParseFunctionJumpHash.insert("ObjectIntersectionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectIntersectionOfNode); mParseFunctionJumpHash.insert("owl:ObjectIntersectionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectIntersectionOfNode); mParseFunctionJumpHash.insert("ObjectUnionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectUnionOfNode); mParseFunctionJumpHash.insert("owl:ObjectUnionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectUnionOfNode); mParseFunctionJumpHash.insert("ObjectMaxCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectMaxCardinalityNode); mParseFunctionJumpHash.insert("owl:ObjectMaxCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectMaxCardinalityNode); mParseFunctionJumpHash.insert("ObjectMinCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectMinCardinalityNode); mParseFunctionJumpHash.insert("owl:ObjectMinCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectMinCardinalityNode); mParseFunctionJumpHash.insert("ObjectExactCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectExactlyCardinalityNode); mParseFunctionJumpHash.insert("owl:ObjectExactCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectExactlyCardinalityNode); mParseFunctionJumpHash.insert("ObjectSomeValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectSomeValuesFromNode); mParseFunctionJumpHash.insert("owl:ObjectSomeValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectSomeValuesFromNode); mParseFunctionJumpHash.insert("ObjectAllValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectAllValuesFromNode); mParseFunctionJumpHash.insert("owl:ObjectAllValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectAllValuesFromNode); mParseFunctionJumpHash.insert("ObjectComplementOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectComplementOfNode); mParseFunctionJumpHash.insert("owl:ObjectComplementOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectComplementOfNode); mParseFunctionJumpHash.insert("ObjectOneOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectOneOfNode); mParseFunctionJumpHash.insert("owl:ObjectOneOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectOneOfNode); mParseFunctionJumpHash.insert("ObjectHasValue",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectHasValueNode); mParseFunctionJumpHash.insert("owl:ObjectHasValue",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectHasValueNode); mParseFunctionJumpHash.insert("ObjectHasSelf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectHasSelfNode); mParseFunctionJumpHash.insert("owl:ObjectHasSelf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectHasSelfNode); mParseFunctionJumpHash.insert("Datatype",&COWL2QtXMLOntologyParser::jumpFunctionParseDatatypeNode); mParseFunctionJumpHash.insert("owl:Datatype",&COWL2QtXMLOntologyParser::jumpFunctionParseDatatypeNode); mParseFunctionJumpHash.insert("DataProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyNode); mParseFunctionJumpHash.insert("owl:DataProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyNode); mParseFunctionJumpHash.insert("DataSomeValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseDataSomeValuesFromNode); mParseFunctionJumpHash.insert("owl:DataSomeValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseDataSomeValuesFromNode); mParseFunctionJumpHash.insert("Literal",&COWL2QtXMLOntologyParser::jumpFunctionParseDataLiteralNode); mParseFunctionJumpHash.insert("owl:Literal",&COWL2QtXMLOntologyParser::jumpFunctionParseDataLiteralNode); mParseFunctionJumpHash.insert("DataAllValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseDataAllValuesFromNode); mParseFunctionJumpHash.insert("owl:DataAllValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseDataAllValuesFromNode); mParseFunctionJumpHash.insert("DataHasValue",&COWL2QtXMLOntologyParser::jumpFunctionParseDataHasValueNode); mParseFunctionJumpHash.insert("owl:DataHasValue",&COWL2QtXMLOntologyParser::jumpFunctionParseDataHasValueNode); mParseFunctionJumpHash.insert("DataIntersectionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataIntersectionOfNode); mParseFunctionJumpHash.insert("owl:DataIntersectionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataIntersectionOfNode); mParseFunctionJumpHash.insert("DataOneOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataOneOfNode); mParseFunctionJumpHash.insert("owl:DataOneOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataOneOfNode); mParseFunctionJumpHash.insert("DataUnionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataUnionOfNode); mParseFunctionJumpHash.insert("owl:DataUnionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataUnionOfNode); mParseFunctionJumpHash.insert("DataComplementOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataComplementOfNode); mParseFunctionJumpHash.insert("owl:DataComplementOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataComplementOfNode); mParseFunctionJumpHash.insert("DatatypeRestriction",&COWL2QtXMLOntologyParser::jumpFunctionParseDatatypeRestrictionNode); mParseFunctionJumpHash.insert("owl:DatatypeRestriction",&COWL2QtXMLOntologyParser::jumpFunctionParseDatatypeRestrictionNode); mParseFunctionJumpHash.insert("DataMaxCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseDataMaxCardinalityNode); mParseFunctionJumpHash.insert("owl:DataMaxCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseDataMaxCardinalityNode); mParseFunctionJumpHash.insert("DataMinCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseDataMinCardinalityNode); mParseFunctionJumpHash.insert("owl:DataMinCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseDataMinCardinalityNode); mParseFunctionJumpHash.insert("DataExactCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseDataExactCardinalityNode); mParseFunctionJumpHash.insert("owl:DataExactCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseDataExactCardinalityNode); mParseFunctionJumpHash.insert("DataPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyAssertionNode); mParseFunctionJumpHash.insert("owl:DataPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyAssertionNode); mParseFunctionJumpHash.insert("NegativeDataPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseNegativeDataPropertyAssertionNode); mParseFunctionJumpHash.insert("owl:NegativeDataPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseNegativeDataPropertyAssertionNode); mParseFunctionJumpHash.insert("SubDataPropertyOf",&COWL2QtXMLOntologyParser::jumpFunctionParseSubDataPropertyOfNode); mParseFunctionJumpHash.insert("owl:SubDataPropertyOf",&COWL2QtXMLOntologyParser::jumpFunctionParseSubDataPropertyOfNode); mParseFunctionJumpHash.insert("EquivalentDataProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentDataPropertiesNode); mParseFunctionJumpHash.insert("owl:EquivalentDataProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentDataPropertiesNode); mParseFunctionJumpHash.insert("DisjointDataProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjointDataPropertiesNode); mParseFunctionJumpHash.insert("owl:DisjointDataProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjointDataPropertiesNode); mParseFunctionJumpHash.insert("DataPropertyDomain",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyDomainNode); mParseFunctionJumpHash.insert("owl:DataPropertyDomain",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyDomainNode); mParseFunctionJumpHash.insert("DataPropertyRange",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyRangeNode); mParseFunctionJumpHash.insert("owl:DataPropertyRange",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyRangeNode); mParseFunctionJumpHash.insert("FunctionalDataProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseFunctionalDataPropertyNode); mParseFunctionJumpHash.insert("owl:FunctionalDataProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseFunctionalDataPropertyNode); mParseFunctionJumpHash.insert("FacetRestriction",&COWL2QtXMLOntologyParser::jumpFunctionParseDataFacetRestrictionNode); mParseFunctionJumpHash.insert("owl:FacetRestriction",&COWL2QtXMLOntologyParser::jumpFunctionParseDataFacetRestrictionNode); mParseFunctionJumpHash.insert("NamedIndividual",&COWL2QtXMLOntologyParser::jumpFunctionParseNamedIndividualNode); mParseFunctionJumpHash.insert("owl:NamedIndividual",&COWL2QtXMLOntologyParser::jumpFunctionParseNamedIndividualNode); mParseFunctionJumpHash.insert("AnonymousIndividual",&COWL2QtXMLOntologyParser::jumpFunctionParseAnonymousIndividualNode); mParseFunctionJumpHash.insert("owl:AnonymousIndividual",&COWL2QtXMLOntologyParser::jumpFunctionParseAnonymousIndividualNode); mParseFunctionJumpHash.insert("ClassAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseClassAssertionNode); mParseFunctionJumpHash.insert("owl:ClassAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseClassAssertionNode); mParseFunctionJumpHash.insert("ObjectPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyAssertionNode); mParseFunctionJumpHash.insert("owl:ObjectPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyAssertionNode); mParseFunctionJumpHash.insert("NegativeObjectPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseNegativeObjectPropertyAssertionNode); mParseFunctionJumpHash.insert("owl:NegativeObjectPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseNegativeObjectPropertyAssertionNode); mParseFunctionJumpHash.insert("SameIndividual",&COWL2QtXMLOntologyParser::jumpFunctionParseSameIndividualNode); mParseFunctionJumpHash.insert("owl:SameIndividual",&COWL2QtXMLOntologyParser::jumpFunctionParseSameIndividualNode); mParseFunctionJumpHash.insert("DifferentIndividuals",&COWL2QtXMLOntologyParser::jumpFunctionParseDifferentIndividualsNode); mParseFunctionJumpHash.insert("owl:DifferentIndividuals",&COWL2QtXMLOntologyParser::jumpFunctionParseDifferentIndividualsNode); mParseFunctionJumpHash.insert("#text",&COWL2QtXMLOntologyParser::jumpFunctionParseIgnoredNode); mParseFunctionJumpHash.insert("#comment",&COWL2QtXMLOntologyParser::jumpFunctionParseIgnoredNode); mParseFunctionJumpHash.insert("ExpectedResult",&COWL2QtXMLOntologyParser::jumpFunctionParseIgnoredNode); mParseFunctionJumpHash.insert("Ontology",&COWL2QtXMLOntologyParser::jumpFunctionTellOntologyAxiomNode); mParseFunctionJumpHash.insert("Tell",&COWL2QtXMLOntologyParser::jumpFunctionTellOntologyAxiomNode); mParseFunctionJumpHash.insert("Whereby",&COWL2QtXMLOntologyParser::jumpFunctionTellOntologyAxiomNode); mParseFunctionJumpHash.insert("Where",&COWL2QtXMLOntologyParser::jumpFunctionTellOntologyAxiomNode); mParseFunctionJumpHash.insert("Retract",&COWL2QtXMLOntologyParser::jumpFunctionRetractOntologyAxiomNode); mParseFunctionJumpHash.insert("rec:Retract",&COWL2QtXMLOntologyParser::jumpFunctionRetractOntologyAxiomNode); mParseFunctionJumpHash.insert("Import",&COWL2QtXMLOntologyParser::jumpFunctionParseImportNode); mParseFunctionJumpHash.insert("owl:Import",&COWL2QtXMLOntologyParser::jumpFunctionParseImportNode); mParseFunctionJumpHash.insert("DLSafeRule",&COWL2QtXMLOntologyParser::jumpFunctionParseIgnoredNode); mParseFunctionJumpHash.insert("owl:DLSafeRule",&COWL2QtXMLOntologyParser::jumpFunctionParseIgnoredNode); return true; } QList COWL2QtXMLOntologyParser::parseRuleAtomNodes(const QString& ruleNodePrefix, const QDomElement& node) { QList atomList; QDomElement ruleAtomNode = node.firstChildElement(); while (!ruleAtomNode.isNull()) { QString nodeString(ruleAtomNode.tagName()); CParseRuleAtom* ruleAtom = nullptr; if (nodeString == ruleNodePrefix+"ObjectPropertyAtom") { ruleAtom = new CParseRuleAtom(CParseRuleAtom::PROPERTYATOM); } else if (nodeString == ruleNodePrefix+"ClassAtom") { ruleAtom = new CParseRuleAtom(CParseRuleAtom::CLASSATOM); } if (ruleAtom) { QDomElement elemNode = ruleAtomNode.firstChildElement(); while (!elemNode.isNull()) { QString elemNodeString(elemNode.tagName()); if (elemNodeString == ruleNodePrefix+"Variable" || elemNodeString == ruleNodePrefix+"IndividualVariable" || elemNodeString == ruleNodePrefix+"ObjectVariable") { QString variableName = getEntityName(&elemNode); ruleAtom->addVariableString(variableName); } else { CBuildExpression* exp = parseBuildNode(&elemNode); ruleAtom->mAtomExpression = exp; } elemNode = elemNode.nextSiblingElement(); } atomList.append(ruleAtom); } ruleAtomNode = ruleAtomNode.nextSiblingElement(); } return atomList; } QHash COWL2QtXMLOntologyParser::createVariableAtomHash(const QList& atomList) { QHash variableAtomHash; foreach (CParseRuleAtom* atom, atomList) { if (!atom->mVariableName1.isEmpty()) { variableAtomHash.insertMulti(atom->mVariableName1,atom); } if (!atom->mVariableName2.isEmpty()) { variableAtomHash.insertMulti(atom->mVariableName2,atom); } } return variableAtomHash; } QMap COWL2QtXMLOntologyParser::createVariableCountMap(const QList& atomList) { QHash variableCountHash; foreach (CParseRuleAtom* atom, atomList) { if (!atom->mVariableName1.isEmpty()) { cint64 prevCount = variableCountHash.value(atom->mVariableName1,0); variableCountHash.insert(atom->mVariableName1,prevCount+1); } if (!atom->mVariableName2.isEmpty()) { cint64 prevCount = variableCountHash.value(atom->mVariableName2,0); variableCountHash.insert(atom->mVariableName2,prevCount+1); } } QMap countVariableMap; for (QHash::const_iterator it = variableCountHash.constBegin(), itEnd = variableCountHash.constEnd(); it != itEnd; ++it) { const QString& variableName = it.key(); cint64 variableAtomCount = it.value(); countVariableMap.insertMulti(variableAtomCount,variableName); } return countVariableMap; } QList COWL2QtXMLOntologyParser::parseRuleNode(QDomElement* node) { QString nodeString(node->tagName()); QList expressionList; QHash bodyVariableAtomHash; QHash headVariableAtomHash; QList bodyVariableAtomList; QList headVariableAtomList; if (nodeString == "DLSafeRule" || nodeString == "owl:DLSafeRule") { QString ruleNodePrefix = ""; if (nodeString == "owl:DLSafeRule") { ruleNodePrefix = "owl:"; } QDomElement bodyElement = node->firstChildElement(ruleNodePrefix+"Body"); bodyVariableAtomList = parseRuleAtomNodes(ruleNodePrefix,bodyElement); QDomElement headElement = node->firstChildElement(ruleNodePrefix+"Head"); headVariableAtomList = parseRuleAtomNodes(ruleNodePrefix,headElement); bodyVariableAtomHash = createVariableAtomHash(bodyVariableAtomList); headVariableAtomHash = createVariableAtomHash(headVariableAtomList); QMap headCountVariableMap = createVariableCountMap(headVariableAtomList); QSet headProcessedAtomSet; QList reversHeadCountVariableList; for (QMap::const_iterator it = headCountVariableMap.constBegin(), itEnd = headCountVariableMap.constEnd(); it != itEnd; ++it) { const QString& varString = it.value(); reversHeadCountVariableList.prepend(varString); } for (QList::const_iterator it = reversHeadCountVariableList.constBegin(), itEnd = reversHeadCountVariableList.constEnd(); it != itEnd; ++it) { const QString& varString = *it; QSet processedBodyAtoms; QList headAtomList = headVariableAtomHash.values(varString); QList headExpressionList; foreach (CParseRuleAtom* headAtom, headAtomList) { if (!headProcessedAtomSet.contains(headAtom)) { headProcessedAtomSet.insert(headAtom); if (headAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) { bool inversed = false; QString otherVarString = headAtom->getOtherVariable(varString,inversed); CBuildExpression* otherVarExp = mOntoBuilder->getIndividualVariable(otherVarString,mAxiomNumber); CBuildExpression* someExp = mOntoBuilder->getObjectSomeValuesFrom(getNeighbourAtomObjectPropertyExpression(headAtom,inversed),otherVarExp); headExpressionList.append(someExp); } else if (headAtom->mAtomType == CParseRuleAtom::CLASSATOM) { headExpressionList.append(headAtom->mAtomExpression); } } } if (!headExpressionList.isEmpty()) { CBuildExpression* headExp = nullptr; if (headExpressionList.count() >= 2) { headExp = mOntoBuilder->getObjectIntersectionOf(headExpressionList); } else { headExp = headExpressionList.first(); } CBuildExpression* bodyExp = createBodyExpresions(varString,bodyVariableAtomHash,headVariableAtomHash); CBuildExpression* axiomExp = mOntoBuilder->getSubClassOf(bodyExp,headExp); expressionList.append(axiomExp); } ++mAxiomNumber; } } return expressionList; } CBuildExpression* COWL2QtXMLOntologyParser::createBodyExpresions(const QString& varString, QHash& bodyVariableAtomHash, QHash& headVariableAtomHash) { QSet processedVarSet; QSet processedAtomSet; QList expList; CBuildExpression* mainExp = createBodyExpresions(varString,true,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash); expList.append(mainExp); for (QHash::const_iterator it = bodyVariableAtomHash.constBegin(), itEnd = bodyVariableAtomHash.constEnd(); it != itEnd; ++it) { QString nextVarString = it.key(); if (!processedVarSet.contains(nextVarString)) { CBuildExpression* topPropExp = mOntoBuilder->getTopObjectProberty(); CBuildExpression* succExp = createBodyExpresions(nextVarString,true,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash); CBuildExpression* someExp = mOntoBuilder->getObjectSomeValuesFrom(topPropExp,succExp); expList.append(someExp); } } if (expList.count() >= 2) { return mOntoBuilder->getObjectIntersectionOf(expList); } return expList.first(); } CBuildExpression* COWL2QtXMLOntologyParser::getNeighbourAtomObjectPropertyExpression(CParseRuleAtom* ruleAtom, bool inversed) { if (!inversed) { return ruleAtom->mAtomExpression; } else { return mOntoBuilder->getInverseObjectPropertyOf(ruleAtom->mAtomExpression); } } bool COWL2QtXMLOntologyParser::hasBackExpressionLinks(const QString& varString, CParseRuleAtom* notRuleAtom, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash) { QSet backTestProcessedVarSet; QSet backTestProcessedAtomSet; return hasBackExpressionLinks(varString,notRuleAtom,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash,backTestProcessedVarSet,backTestProcessedAtomSet); } bool COWL2QtXMLOntologyParser::hasBackExpressionLinks(const QString& varString, CParseRuleAtom* notRuleAtom, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash, QSet& backTestProcessedVarSet, QSet& backTestProcessedAtomSet) { if (processedVarSet.contains(varString)) { return false; } if (!backTestProcessedVarSet.contains(varString)) { backTestProcessedVarSet.insert(varString); QList atomList = bodyVariableAtomHash.values(varString); foreach (CParseRuleAtom* ruleAtom, atomList) { if (ruleAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) { if (ruleAtom != notRuleAtom) { if (processedAtomSet.contains(ruleAtom)) { return true; } if (!backTestProcessedAtomSet.contains(ruleAtom)) { backTestProcessedAtomSet.insert(ruleAtom); bool inversed = false; QString otherVarString = ruleAtom->getOtherVariable(varString,inversed); if (hasBackExpressionLinks(otherVarString,ruleAtom,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash,backTestProcessedVarSet,backTestProcessedAtomSet)) { return true; } } } } } } return false; } CBuildExpression* COWL2QtXMLOntologyParser::createBodyExpresions(const QString& varString, bool direct, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash) { QList expList; expList.append(mOntoBuilder->getIndividualVariable(varString,mAxiomNumber)); if (!processedVarSet.contains(varString)) { processedVarSet.insert(varString); QList atomList = bodyVariableAtomHash.values(varString); QList processList; foreach (CParseRuleAtom* ruleAtom, atomList) { if (ruleAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) { if (!processedAtomSet.contains(ruleAtom)) { bool inversed = false; QString otherVarString = ruleAtom->getOtherVariable(varString,inversed); if (direct || !headVariableAtomHash.contains(varString) || !hasBackExpressionLinks(otherVarString,ruleAtom,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash)) { processedAtomSet.insert(ruleAtom); processList.append(ruleAtom); } } } else if (ruleAtom->mAtomType == CParseRuleAtom::CLASSATOM) { processList.append(ruleAtom); } } foreach (CParseRuleAtom* ruleAtom, processList) { if (ruleAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) { bool inversed = false; QString otherVarString = ruleAtom->getOtherVariable(varString,inversed); CBuildExpression* succExp = createBodyExpresions(otherVarString,false,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash); CBuildExpression* someExp = mOntoBuilder->getObjectSomeValuesFrom(getNeighbourAtomObjectPropertyExpression(ruleAtom,inversed),succExp); expList.append(someExp); } else if (ruleAtom->mAtomType == CParseRuleAtom::CLASSATOM) { expList.append(ruleAtom->mAtomExpression); } } } if (expList.count() >= 2) { return mOntoBuilder->getObjectIntersectionOf(expList); } return expList.first(); } CBuildExpression *COWL2QtXMLOntologyParser::parseBuildNode(QDomElement *node) { CBuildExpression *expression = 0; QString nodeString(node->tagName()); #ifdef KONCLUDE_PARSER_USEPARSEJUMPFUNCTIONHASH ParseFunction function = mParseFunctionJumpHash.value(nodeString); if (function) { expression = (this->*function)(node); } else { QString notSupportedNodeString(nodeString); CNotSupportedNodeErrorRecord::makeRecord(notSupportedNodeString,&recordRouter); } #else if (nodeString == "Class" || nodeString == "owl:Class" || nodeString == "OWLClass" || nodeString == "owl:OWLClass") { expression = parseClassNode(node); } else if (nodeString == "ObjectProperty" || nodeString == "owl:ObjectProperty") { expression = parseObjectPropertyNode(node); } else if (nodeString == "IndividualVariable" || nodeString == "owl:IndividualVariable") { expression = parseIndividualVariableNode(node); } else if (nodeString == "Declaration" || nodeString == "owl:Declaration") { expression = parseDeclarationNode(node); } else if (nodeString == "SubClassOf" || nodeString == "owl:SubClassOf") { expression = parseSubClassOfNode(node); } else if (nodeString == "EquivalentClasses" || nodeString == "owl:EquivalentClasses") { expression = parseEquivalentClassesNode(node); } else if (nodeString == "DisjointClasses" || nodeString == "owl:DisjointClasses") { expression = parseDisjontClassesNode(node); } else if (nodeString == "DisjointUnion" || nodeString == "owl:DisjointUnion") { expression = parseDisjontUnionNode(node); } else if (nodeString == "SubObjectPropertyOf" || nodeString == "owl:SubObjectPropertyOf") { expression = parseSubObjectPropertyOfNode(node); } else if (nodeString == "ObjectPropertyChain" || nodeString == "owl:ObjectPropertyChain") { expression = parseObjectPropertyChainNode(node); } else if (nodeString == "EquivalentObjectProperties" || nodeString == "owl:EquivalentObjectProperties") { expression = parseEquivalentObjectPropertiesNode(node); } else if (nodeString == "DisjointObjectProperties" || nodeString == "owl:DisjointObjectProperties") { expression = parseDisjointObjectPropertiesNode(node); } else if (nodeString == "ObjectInverseOf" || nodeString == "owl:ObjectInverseOf") { expression = parseInverseObjectPropertyOfNode(node); } else if (nodeString == "InverseObjectProperties" || nodeString == "owl:InverseObjectProperties") { expression = parseInverseObjectPropertiesNode(node); } else if (nodeString == "ObjectPropertyRange" || nodeString == "owl:ObjectPropertyRange") { expression = parseObjectPropertyRangeNode(node); } else if (nodeString == "ObjectPropertyDomain" || nodeString == "owl:ObjectPropertyDomain") { expression = parseObjectPropertyDomainNode(node); } else if (nodeString == "TransitiveObjectProperty" || nodeString == "owl:TransitiveObjectProperty") { expression = parseTransetiveObjectPropertyNode(node); } else if (nodeString == "FunctionalObjectProperty" || nodeString == "owl:FunctionalObjectProperty") { expression = parseFunctionalObjectPropertyNode(node); } else if (nodeString == "SymmetricObjectProperty" || nodeString == "owl:SymmetricObjectProperty") { expression = parseSymmetricObjectPropertyNode(node); } else if (nodeString == "AsymmetricObjectProperty" || nodeString == "owl:AsymmetricObjectProperty") { expression = parseAsymmetricObjectPropertyNode(node); } else if (nodeString == "ReflexiveObjectProperty" || nodeString == "owl:ReflexiveObjectProperty") { expression = parseReflexiveObjectPropertyNode(node); } else if (nodeString == "IrreflexiveObjectProperty" || nodeString == "owl:IrreflexiveObjectProperty") { expression = parseIrreflexiveObjectPropertyNode(node); } else if (nodeString == "InverseFunctionalObjectProperty" || nodeString == "owl:InverseFunctionalObjectProperty") { expression = parseInverseFunctionalObjectPropertyNode(node); } else if (nodeString == "ObjectIntersectionOf" || nodeString == "owl:ObjectIntersectionOf") { expression = parseObjectIntersectionOfNode(node); } else if (nodeString == "ObjectComplementOf" || nodeString == "owl:ObjectComplementOf") { expression = parseObjectComplementOfNode(node); } else if (nodeString == "ObjectUnionOf" || nodeString == "owl:ObjectUnionOf") { expression = parseObjectUnionOfNode(node); } else if (nodeString == "ObjectMaxCardinality" || nodeString == "owl:ObjectMaxCardinality") { expression = parseObjectMaxCardinalityNode(node); } else if (nodeString == "ObjectMinCardinality" || nodeString == "owl:ObjectMinCardinality") { expression = parseObjectMinCardinalityNode(node); } else if (nodeString == "ObjectExactCardinality" || nodeString == "owl:ObjectExactCardinality") { expression = parseObjectExactlyCardinalityNode(node); } else if (nodeString == "ObjectSomeValuesFrom" || nodeString == "owl:ObjectSomeValuesFrom") { expression = parseObjectSomeValuesFromNode(node); } else if (nodeString == "ObjectAllValuesFrom" || nodeString == "owl:ObjectAllValuesFrom") { expression = parseObjectAllValuesFromNode(node); } else if (nodeString == "ObjectOneOf" || nodeString == "owl:ObjectOneOf") { expression = parseObjectOneOfNode(node); } else if (nodeString == "ObjectHasValue" || nodeString == "owl:ObjectHasValue") { expression = parseObjectHasValueNode(node); } else if (nodeString == "ObjectHasSelf" || nodeString == "owl:ObjectHasSelf") { expression = parseObjectHasSelfNode(node); } else if (nodeString == "ClassAssertion" || nodeString == "owl:ClassAssertion") { expression = parseClassAssertionNode(node); } else if (nodeString == "NamedIndividual" || nodeString == "owl:NamedIndividual") { expression = parseNamedIndividualNode(node); } else if (nodeString == "ObjectPropertyAssertion" || nodeString == "owl:ObjectPropertyAssertion") { expression = parseObjectPropertyAssertionNode(node); } else if (nodeString == "NegativeObjectPropertyAssertion" || nodeString == "owl:NegativeObjectPropertyAssertion") { expression = parseNegativeObjectPropertyAssertionNode(node); } else if (nodeString == "SameIndividual" || nodeString == "owl:SameIndividual") { expression = parseSameIndividualNode(node); } else if (nodeString == "DifferentIndividuals" || nodeString == "owl:DifferentIndividuals") { expression = parseDifferentIndividualsNode(node); } else if (nodeString == "Datatype" || nodeString == "owl:Datatype") { expression = jumpFunctionParseDatatypeNode(node); } else if (nodeString == "DataProperty" || nodeString == "owl:DataProperty") { expression = jumpFunctionParseDataPropertyNode(node); } else if (nodeString == "DataSomeValuesFrom" || nodeString == "owl:DataSomeValuesFrom") { expression = jumpFunctionParseDataSomeValuesFromNode(node); } else if (nodeString == "Literal" || nodeString == "owl:Literal") { expression = jumpFunctionParseDataLiteralNode(node); } else if (nodeString == "DataAllValuesFrom" || nodeString == "owl:DataAllValuesFrom") { expression = jumpFunctionParseDataAllValuesFromNode(node); } else if (nodeString == "DataHasValue" || nodeString == "owl:DataHasValue") { expression = jumpFunctionParseDataHasValueNode(node); } else if (nodeString == "DataIntersectionOf" || nodeString == "owl:DataIntersectionOf") { expression = jumpFunctionParseDataIntersectionOfNode(node); } else if (nodeString == "DataOneOf" || nodeString == "owl:DataOneOf") { expression = jumpFunctionParseDataOneOfNode(node); } else if (nodeString == "DataUnionOf" || nodeString == "owl:DataUnionOf") { expression = jumpFunctionParseDataUnionOfNode(node); } else if (nodeString == "DataComplementOf" || nodeString == "owl:DataComplementOf") { expression = jumpFunctionParseDataComplementOfNode(node); } else if (nodeString == "DatatypeRestriction" || nodeString == "owl:DatatypeRestriction") { expression = jumpFunctionParseDatatypeRestrictionNode(node); } else if (nodeString == "DataMaxCardinality" || nodeString == "owl:DataMaxCardinality") { expression = jumpFunctionParseDataMaxCardinalityNode(node); } else if (nodeString == "DataMinCardinality" || nodeString == "owl:DataMinCardinality") { expression = jumpFunctionParseDataMinCardinalityNode(node); } else if (nodeString == "DataExactCardinality" || nodeString == "owl:DataExactCardinality") { expression = jumpFunctionParseDataExactCardinalityNode(node); } else if (nodeString == "DataPropertyAssertion" || nodeString == "owl:DataPropertyAssertion") { expression = jumpFunctionParseDataPropertyAssertionNode(node); } else if (nodeString == "NegativeDataPropertyAssertion" || nodeString == "owl:NegativeDataPropertyAssertion") { expression = jumpFunctionParseNegativeDataPropertyAssertionNode(node); } else if (nodeString == "SubDataPropertyOf" || nodeString == "owl:SubDataPropertyOf") { expression = jumpFunctionParseSubDataPropertyOfNode(node); } else if (nodeString == "EquivalentDataProperties" || nodeString == "owl:EquivalentDataProperties") { expression = jumpFunctionParseEquivalentDataPropertiesNode(node); } else if (nodeString == "DisjointDataProperties" || nodeString == "owl:DisjointDataProperties") { expression = jumpFunctionParseDisjointDataPropertiesNode(node); } else if (nodeString == "DataPropertyDomain" || nodeString == "owl:DataPropertyDomain") { expression = jumpFunctionParseDataPropertyDomainNode(node); } else if (nodeString == "DataPropertyRange" || nodeString == "owl:DataPropertyRange") { expression = jumpFunctionParseDataPropertyRangeNode(node); } else if (nodeString == "FunctionalDataProperty" || nodeString == "owl:FunctionalDataProperty") { expression = jumpFunctionParseFunctionalDataPropertyNode(node); } else if (nodeString == "#text") { // ignoring text nodes } else if (nodeString == "#comment") { // ignoring comment nodes } else if (nodeString == "ExpectedResult") { // ignoring expected results nodes } else if (nodeString == "Retract") { parseRetractOntologyAxiomNode(node); } else if (nodeString == "Tell" || nodeString == "Whereby" || nodeString == "Ontology") { parseTellOntologyAxiomNode(node); } else if (nodeString == "Import" || nodeString == "owl:Import") { expression = jumpFunctionParseImportNode(node); } else { if (mReportErrorCount > 0) { --mReportErrorCount; QString notSupportedNodeString(nodeString); CNotSupportedNodeErrorRecord::makeRecord(notSupportedNodeString,&recordRouter); } else if (mReportErrorCount == 0) { --mReportErrorCount; CUnspecifiedMessageErrorRecord::makeRecord(QString("Remaining not supported expressions are ignored"),&recordRouter); } //LOG(WARNING,getLogDomain(),logTr("Not supported XML node: '%1'. Continue with next/child node.").arg(notSupportedNodeString),this); } #endif return expression; } CDeclarationAxiomExpression* COWL2QtXMLOntologyParser::parseDeclarationNode(QDomElement* node) { QList builds = parseChildNodes(node); CDeclarationAxiomExpression* declarationExpression = nullptr; declarationExpression = mOntoBuilder->getDeclaration(builds); ++mAxiomNumber; return declarationExpression; } CObjectPropertyExpression *COWL2QtXMLOntologyParser::parseObjectPropertyNode(QDomElement *node) { // parse QString probName = getEntityName(node); CObjectPropertyExpression *objectExpression = 0; if (!probName.isEmpty()) { objectExpression = mOntoBuilder->getObjectProberty(probName); } return objectExpression; } CClassExpression *COWL2QtXMLOntologyParser::parseClassNode(QDomElement *node) { // parse QString className = getEntityName(node); CClassExpression *classExpression = 0; if (!className.isEmpty()) { classExpression = mOntoBuilder->getClass(className); } return classExpression; } CObjectIndividualVariableExpression* COWL2QtXMLOntologyParser::parseIndividualVariableNode(QDomElement* node) { // parse QString indiVarName = getEntityName(node); CObjectIndividualVariableExpression *indiVarExpression = 0; if (!indiVarName.isEmpty()) { indiVarExpression = mOntoBuilder->getIndividualVariable(indiVarName,mAxiomNumber); } return indiVarExpression; } QList COWL2QtXMLOntologyParser::parseChildNodes(QDomElement *node) { QList builds; QDomElement childNode = node->firstChildElement(); while (!childNode.isNull()) { CBuildExpression *expression = parseBuildNode(&childNode); if (expression) { builds.append(expression); } childNode = childNode.nextSiblingElement(); } return builds; } CEquivalentClassesExpression *COWL2QtXMLOntologyParser::parseEquivalentClassesNode(QDomElement *node) { // parse <...> <...> QList builds = parseChildNodes(node); CEquivalentClassesExpression *ecExp = 0; ecExp = mOntoBuilder->getEquivalentClasses(builds); ++mAxiomNumber; return ecExp; } CSubClassOfExpression *COWL2QtXMLOntologyParser::parseSubClassOfNode(QDomElement *node) { // parse <...> <...> QList builds = parseChildNodes(node); CSubClassOfExpression *scoExp = 0; scoExp = mOntoBuilder->getSubClassOf(builds); ++mAxiomNumber; return scoExp; } CObjectPropertyDomainExpression *COWL2QtXMLOntologyParser::parseObjectPropertyDomainNode(QDomElement *node) { // parse <...> <...> QList builds = parseChildNodes(node); CObjectPropertyDomainExpression *obPrDoExp = 0; obPrDoExp = mOntoBuilder->getObjectPropertyDomainExpression(builds); ++mAxiomNumber; return obPrDoExp; } CObjectPropertyRangeExpression *COWL2QtXMLOntologyParser::parseObjectPropertyRangeNode(QDomElement *node) { // parse <...> <...> QList builds = parseChildNodes(node); CObjectPropertyRangeExpression *obPrRaExp = 0; obPrRaExp = mOntoBuilder->getObjectPropertyRangeExpression(builds); ++mAxiomNumber; return obPrRaExp; } CSubObjectPropertyOfExpression *COWL2QtXMLOntologyParser::parseSubObjectPropertyOfNode(QDomElement *node) { // parse <...> <...> QList builds = parseChildNodes(node); CSubObjectPropertyOfExpression *sopoExp = 0; sopoExp = mOntoBuilder->getSubObjectPropertyOf(builds); ++mAxiomNumber; return sopoExp; } CObjectPropertyChainExpression *COWL2QtXMLOntologyParser::parseObjectPropertyChainNode(QDomElement *node) { // parse <...> <...> QList builds = parseChildNodes(node); CObjectPropertyChainExpression *sopoExp = 0; sopoExp = mOntoBuilder->getObjectPropertyChain(builds); return sopoExp; } CEquivalentObjectPropertiesExpression *COWL2QtXMLOntologyParser::parseEquivalentObjectPropertiesNode(QDomElement *node) { // parse <...> <...> QList builds = parseChildNodes(node); CEquivalentObjectPropertiesExpression *sopoExp = 0; sopoExp = mOntoBuilder->getEquivalentObjectProperties(builds); ++mAxiomNumber; return sopoExp; } CDisjointObjectPropertiesExpression *COWL2QtXMLOntologyParser::parseDisjointObjectPropertiesNode(QDomElement *node) { // parse <...> <...> QList builds = parseChildNodes(node); CDisjointObjectPropertiesExpression *sopoExp = 0; sopoExp = mOntoBuilder->getDisjointObjectProperties(builds); ++mAxiomNumber; return sopoExp; } CInverseObjectPropertyOfExpression *COWL2QtXMLOntologyParser::parseInverseObjectPropertyOfNode(QDomElement *node) { // parse <...> <...> QList builds = parseChildNodes(node); CInverseObjectPropertyOfExpression *iopoExp = 0; iopoExp = mOntoBuilder->getInverseObjectPropertyOf(builds); return iopoExp; } CInverseObjectPropertiesExpression *COWL2QtXMLOntologyParser::parseInverseObjectPropertiesNode(QDomElement *node) { // parse <...> <...> QList builds = parseChildNodes(node); CInverseObjectPropertiesExpression *iopoExp = 0; iopoExp = mOntoBuilder->getInverseObjectProperties(builds); ++mAxiomNumber; return iopoExp; } CDisjointClassesExpression *COWL2QtXMLOntologyParser::parseDisjontClassesNode(QDomElement *node) { // parse <...> <...> QList builds = parseChildNodes(node); CDisjointClassesExpression *disClassExp = 0; disClassExp = mOntoBuilder->getDisjointClasses(builds); ++mAxiomNumber; return disClassExp; } CDisjointUnionExpression *COWL2QtXMLOntologyParser::parseDisjontUnionNode(QDomElement *node) { // parse <...> <...> QList builds = parseChildNodes(node); CDisjointUnionExpression *disClassExp = 0; disClassExp = mOntoBuilder->getDisjointUnion(builds); return disClassExp; } CObjectIntersectionOfExpression *COWL2QtXMLOntologyParser::parseObjectIntersectionOfNode(QDomElement *node) { // parse <...> <...> <...> ... QList builds = parseChildNodes(node); CObjectIntersectionOfExpression* exp = nullptr; exp = mOntoBuilder->getObjectIntersectionOf(builds); return exp; } CObjectUnionOfExpression *COWL2QtXMLOntologyParser::parseObjectUnionOfNode(QDomElement *node) { // parse <...> <...> <...> ... QList builds = parseChildNodes(node); CObjectUnionOfExpression* exp = nullptr; exp = mOntoBuilder->getObjectUnionOf(builds); return exp; } cint64 COWL2QtXMLOntologyParser::parseCardinality(QDomElement* node) { cint64 cardinality = 0; QString cardinalityString = node->attribute(QString("cardinality")); if (cardinalityString.isEmpty()) { cardinalityString = node->attribute(QString("owl:cardinality")); } if (!cardinalityString.isEmpty()) { cardinality = cardinalityString.toLongLong(); } return cardinality; } CObjectMaxCardinalityExpression *COWL2QtXMLOntologyParser::parseObjectMaxCardinalityNode(QDomElement *node) { // parse <...> <...> <...> ... CObjectMaxCardinalityExpression* exp = nullptr; cint64 cardinality = parseCardinality(node); if (mOntoBuilder) { QList builds = parseChildNodes(node); exp = mOntoBuilder->getObjectMaxCardinality(builds,cardinality); } return exp; } CObjectMinCardinalityExpression *COWL2QtXMLOntologyParser::parseObjectMinCardinalityNode(QDomElement *node) { // parse <...> <...> <...> ... CObjectMinCardinalityExpression* exp = nullptr; cint64 cardinality = parseCardinality(node); if (mOntoBuilder) { QList builds = parseChildNodes(node); exp = mOntoBuilder->getObjectMinCardinality(builds,cardinality); } return exp; } CObjectExactlyCardinalityExpression *COWL2QtXMLOntologyParser::parseObjectExactlyCardinalityNode(QDomElement *node) { // parse <...> <...> <...> ... CObjectExactlyCardinalityExpression* exp = nullptr; cint64 cardinality = parseCardinality(node); if (mOntoBuilder) { QList builds = parseChildNodes(node); exp = mOntoBuilder->getObjectExactlyCardinality(builds,cardinality); } return exp; } CObjectSomeValuesFromExpression *COWL2QtXMLOntologyParser::parseObjectSomeValuesFromNode(QDomElement *node) { // parse <...> <...> <...> ... QList builds = parseChildNodes(node); CObjectSomeValuesFromExpression* exp = nullptr; exp = mOntoBuilder->getObjectSomeValuesFrom(builds); return exp; } CObjectHasValueExpression* COWL2QtXMLOntologyParser::parseObjectHasValueNode(QDomElement* node) { // parse <...> <...> <...> ... QList builds = parseChildNodes(node); CObjectHasValueExpression* exp = nullptr; exp = mOntoBuilder->getObjectHasValue(builds); return exp; } CObjectHasSelfExpression* COWL2QtXMLOntologyParser::parseObjectHasSelfNode(QDomElement* node) { // parse <...> <...> <...> ... QList builds = parseChildNodes(node); CObjectHasSelfExpression* exp = nullptr; exp = mOntoBuilder->getObjectHasSelf(builds); return exp; } CObjectAllValuesFromExpression *COWL2QtXMLOntologyParser::parseObjectAllValuesFromNode(QDomElement *node) { // parse <...> <...> <...> ... QList builds = parseChildNodes(node); CObjectAllValuesFromExpression* exp = nullptr; exp = mOntoBuilder->getObjectAllValuesFrom(builds); return exp; } CObjectComplementOfExpression *COWL2QtXMLOntologyParser::parseObjectComplementOfNode(QDomElement *node) { // parse <...> QList builds = parseChildNodes(node); CObjectComplementOfExpression* exp = nullptr; exp = mOntoBuilder->getObjectComplementOf(builds); return exp; } CObjectOneOfExpression *COWL2QtXMLOntologyParser::parseObjectOneOfNode(QDomElement *node) { // parse <...> QList builds = parseChildNodes(node); CObjectOneOfExpression* exp = nullptr; exp = mOntoBuilder->getObjectOneOf(builds); return exp; } CTransetiveObjectPropertyExpression *COWL2QtXMLOntologyParser::parseTransetiveObjectPropertyNode(QDomElement *node) { QList builds = parseChildNodes(node); CTransetiveObjectPropertyExpression* exp = nullptr; exp = mOntoBuilder->getTransetiveObjectProperty(builds); ++mAxiomNumber; return exp; } CFunctionalObjectPropertyExpression *COWL2QtXMLOntologyParser::parseFunctionalObjectPropertyNode(QDomElement *node) { QList builds = parseChildNodes(node); CFunctionalObjectPropertyExpression* exp = nullptr; exp = mOntoBuilder->getFunctionalObjectProperty(builds); ++mAxiomNumber; return exp; } CSymmetricObjectPropertyExpression* COWL2QtXMLOntologyParser::parseSymmetricObjectPropertyNode(QDomElement* node) { QList builds = parseChildNodes(node); CSymmetricObjectPropertyExpression* exp = nullptr; exp = mOntoBuilder->getSymmetricObjectProperty(builds); ++mAxiomNumber; return exp; } CAsymmetricObjectPropertyExpression* COWL2QtXMLOntologyParser::parseAsymmetricObjectPropertyNode(QDomElement* node) { QList builds = parseChildNodes(node); CAsymmetricObjectPropertyExpression* exp = nullptr; exp = mOntoBuilder->getAsymmetricObjectProperty(builds); ++mAxiomNumber; return exp; } CReflexiveObjectPropertyExpression* COWL2QtXMLOntologyParser::parseReflexiveObjectPropertyNode(QDomElement* node) { QList builds = parseChildNodes(node); CReflexiveObjectPropertyExpression* exp = nullptr; exp = mOntoBuilder->getReflexiveObjectProperty(builds); ++mAxiomNumber; return exp; } CIrreflexiveObjectPropertyExpression* COWL2QtXMLOntologyParser::parseIrreflexiveObjectPropertyNode(QDomElement* node) { QList builds = parseChildNodes(node); CIrreflexiveObjectPropertyExpression* exp = nullptr; exp = mOntoBuilder->getIrreflexiveObjectProperty(builds); ++mAxiomNumber; return exp; } CInverseFunctionalObjectPropertyExpression* COWL2QtXMLOntologyParser::parseInverseFunctionalObjectPropertyNode(QDomElement* node) { QList builds = parseChildNodes(node); CInverseFunctionalObjectPropertyExpression* exp = nullptr; exp = mOntoBuilder->getInverseFunctionalObjectProperty(builds); ++mAxiomNumber; return exp; } CClassAssertionExpression *COWL2QtXMLOntologyParser::parseClassAssertionNode(QDomElement *node) { // parse <...> QList builds = parseChildNodes(node); CClassAssertionExpression* exp = nullptr; if (mOntoBuilder) { exp = mOntoBuilder->getClassAssertion(builds); } ++mAxiomNumber; return exp; } CSameIndividualExpression *COWL2QtXMLOntologyParser::parseSameIndividualNode(QDomElement *node) { // parse <...> QList builds = parseChildNodes(node); CSameIndividualExpression* exp = nullptr; if (mOntoBuilder) { exp = mOntoBuilder->getSameIndividual(builds); } ++mAxiomNumber; return exp; } CDifferentIndividualsExpression *COWL2QtXMLOntologyParser::parseDifferentIndividualsNode(QDomElement *node) { // parse <...> QList builds = parseChildNodes(node); CDifferentIndividualsExpression* exp = nullptr; if (mOntoBuilder) { exp = mOntoBuilder->getDifferentIndividuals(builds); } ++mAxiomNumber; return exp; } CNamedIndividualExpression *COWL2QtXMLOntologyParser::parseNamedIndividualNode(QDomElement *node) { // parse <...> QString indiNameName = getEntityName(node); CNamedIndividualExpression* exp = nullptr; if (!indiNameName.isEmpty()) { if (mOntoBuilder) { exp = mOntoBuilder->getNamedIndividual(indiNameName); } } return exp; } CAnonymousIndividualExpression *COWL2QtXMLOntologyParser::parseAnonymousIndividualNode(QDomElement *node) { // parse <...> if (mOntologyName.isEmpty()) { mOntologyName = mOntoBuilder->getOntologyName(); } QString indiNameName = node->attribute(QString("nodeID")); CAnonymousIndividualExpression* exp = nullptr; if (!indiNameName.isEmpty()) { if (mOntoBuilder) { exp = mOntoBuilder->getAnonymousIndividual(mOntologyName,indiNameName); } } return exp; } CObjectPropertyAssertionExpression *COWL2QtXMLOntologyParser::parseObjectPropertyAssertionNode(QDomElement *node) { // parse <...> QList builds = parseChildNodes(node); CObjectPropertyAssertionExpression* exp = nullptr; if (mOntoBuilder) { exp = mOntoBuilder->getObjectPropertyAssertion(builds); } ++mAxiomNumber; return exp; } CNegativeObjectPropertyAssertionExpression *COWL2QtXMLOntologyParser::parseNegativeObjectPropertyAssertionNode(QDomElement *node) { // parse <...> QList builds = parseChildNodes(node); CNegativeObjectPropertyAssertionExpression* exp = nullptr; if (mOntoBuilder) { exp = mOntoBuilder->getNegativeObjectPropertyAssertion(builds); } ++mAxiomNumber; return exp; } CDatatypeExpression *COWL2QtXMLOntologyParser::parseDatatypeNode(QDomElement *node) { QString datatypeName = getEntityName(node); CDatatypeExpression* datatypeExpression = nullptr; if (!datatypeName.isEmpty()) { datatypeExpression = mOntoBuilder->getDatatype(datatypeName); } return datatypeExpression; } CDataPropertyExpression* COWL2QtXMLOntologyParser::parseDataPropertyNode(QDomElement* node) { QString dataPropertyName = getEntityName(node); CDataPropertyExpression* dataPropertyExpression = nullptr; if (!dataPropertyName.isEmpty()) { dataPropertyExpression = mOntoBuilder->getDataProberty(dataPropertyName); } return dataPropertyExpression; } CDataSomeValuesFromExpression* COWL2QtXMLOntologyParser::parseDataSomeValuesFromNode(QDomElement* node) { CDataSomeValuesFromExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDataSomeValuesFrom(builds); } return exp; } CDataLiteralExpression* COWL2QtXMLOntologyParser::parseDataLiteralNode(QDomElement* node) { CDataLiteralExpression* exp = nullptr; if (mOntoBuilder) { QDomNode chNode = node->firstChild(); QString lexicalValueString = chNode.nodeValue(); QString appendixString = node->attribute("lang"); if (appendixString.isEmpty()) { appendixString = node->attribute("xml:lang"); } if (!appendixString.isEmpty()) { lexicalValueString = lexicalValueString+"@"+appendixString; } CDataLexicalValueExpression* dataLexValueExp = mOntoBuilder->getDataLexicalValue(lexicalValueString); QString datatypeIRIString = node->attribute("datatypeIRI"); if (datatypeIRIString.isEmpty()) { datatypeIRIString = node->attribute("owl:datatypeIRI"); } CDatatypeExpression* datatypeExp = mOntoBuilder->getDatatype(datatypeIRIString); exp = mOntoBuilder->getDataLiteral(dataLexValueExp,datatypeExp); } return exp; } CDataFacetRestrictionExpression* COWL2QtXMLOntologyParser::parseDataFacetRestrictionNode(QDomElement* node) { CDataFacetRestrictionExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { QString facetIRIString = node->attribute("facet"); if (facetIRIString.isEmpty()) { facetIRIString = node->attribute("owl:facet"); } if (facetIRIString.isEmpty()) { facetIRIString = node->attribute("facetIRI"); } if (facetIRIString.isEmpty()) { facetIRIString = node->attribute("owl:facetIRI"); } CDataFacetExpression* facetExp = mOntoBuilder->getDataFacet(facetIRIString); builds.append(facetExp); exp = mOntoBuilder->getDataFacetRestriction(builds); } return exp; } CDataAllValuesFromExpression* COWL2QtXMLOntologyParser::parseDataAllValuesFromNode(QDomElement* node) { CDataAllValuesFromExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDataAllValuesFrom(builds); } return exp; } CDataHasValueExpression* COWL2QtXMLOntologyParser::parseDataHasValueNode(QDomElement* node) { CDataHasValueExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDataHasValue(builds); } return exp; } CDataIntersectionOfExpression* COWL2QtXMLOntologyParser::parseDataIntersectionOfNode(QDomElement* node) { CDataIntersectionOfExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDataIntersectionOf(builds); } return exp; } CDataOneOfExpression* COWL2QtXMLOntologyParser::parseDataOneOfNode(QDomElement* node) { CDataOneOfExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDataOneOf(builds); } return exp; } CDataUnionOfExpression* COWL2QtXMLOntologyParser::parseDataUnionOfNode(QDomElement* node) { CDataUnionOfExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDataUnionOf(builds); } return exp; } CDataComplementOfExpression* COWL2QtXMLOntologyParser::parseDataComplementOfNode(QDomElement* node) { CDataComplementOfExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDataComplementOf(builds); } return exp; } CDatatypeRestrictionExpression* COWL2QtXMLOntologyParser::parseDatatypeRestrictionNode(QDomElement* node) { CDatatypeRestrictionExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDatatypeRestriction(builds); } return exp; } CDataMaxCardinalityExpression* COWL2QtXMLOntologyParser::parseDataMaxCardinalityNode(QDomElement* node) { CDataMaxCardinalityExpression* exp = nullptr; cint64 cardinality = parseCardinality(node); QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDataMaxCardinality(builds,cardinality); } return exp; } CDataMinCardinalityExpression* COWL2QtXMLOntologyParser::parseDataMinCardinalityNode(QDomElement* node) { CDataMinCardinalityExpression* exp = nullptr; cint64 cardinality = parseCardinality(node); QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDataMinCardinality(builds,cardinality); } return exp; } CDataExactCardinalityExpression* COWL2QtXMLOntologyParser::parseDataExactCardinalityNode(QDomElement* node) { CDataExactCardinalityExpression* exp = nullptr; cint64 cardinality = parseCardinality(node); QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDataExactCardinality(builds,cardinality); } return exp; } CDataPropertyAssertionExpression* COWL2QtXMLOntologyParser::parseDataPropertyAssertionNode(QDomElement* node) { CDataPropertyAssertionExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDataPropertyAssertion(builds); } return exp; } CNegativeDataPropertyAssertionExpression* COWL2QtXMLOntologyParser::parseNegativeDataPropertyAssertionNode(QDomElement* node) { CNegativeDataPropertyAssertionExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getNegativeDataPropertyAssertion(builds); } return exp; } CSubDataPropertyOfExpression* COWL2QtXMLOntologyParser::parseSubDataPropertyOfNode(QDomElement* node) { CSubDataPropertyOfExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getSubDataPropertyOf(builds); } return exp; } CEquivalentDataPropertiesExpression* COWL2QtXMLOntologyParser::parseEquivalentDataPropertiesNode(QDomElement* node) { CEquivalentDataPropertiesExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getEquivalentDataProperties(builds); } return exp; } CDisjointDataPropertiesExpression* COWL2QtXMLOntologyParser::parseDisjointDataPropertiesNode(QDomElement* node) { CDisjointDataPropertiesExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDisjointDataProperties(builds); } return exp; } CDataPropertyDomainExpression* COWL2QtXMLOntologyParser::parseDataPropertyDomainNode(QDomElement* node) { CDataPropertyDomainExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDataPropertyDomainExpression(builds); } return exp; } CDataPropertyRangeExpression* COWL2QtXMLOntologyParser::parseDataPropertyRangeNode(QDomElement* node) { CDataPropertyRangeExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getDataPropertyRangeExpression(builds); } return exp; } CFunctionalDataPropertyExpression* COWL2QtXMLOntologyParser::parseFunctionalDataPropertyNode(QDomElement* node) { CFunctionalDataPropertyExpression* exp = nullptr; QList builds = parseChildNodes(node); if (mOntoBuilder) { exp = mOntoBuilder->getFunctionalDataProperty(builds); } return exp; } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDatatypeNode(QDomElement* node) { return parseDatatypeNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyNode(QDomElement* node) { return parseDataPropertyNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataSomeValuesFromNode(QDomElement* node) { return parseDataSomeValuesFromNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataLiteralNode(QDomElement* node) { return parseDataLiteralNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataAllValuesFromNode(QDomElement* node) { return parseDataAllValuesFromNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataHasValueNode(QDomElement* node) { return parseDataHasValueNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataIntersectionOfNode(QDomElement* node) { return parseDataIntersectionOfNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataOneOfNode(QDomElement* node) { return parseDataOneOfNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataUnionOfNode(QDomElement* node) { return parseDataUnionOfNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataComplementOfNode(QDomElement* node) { return parseDataComplementOfNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDatatypeRestrictionNode(QDomElement* node) { return parseDatatypeRestrictionNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataMaxCardinalityNode(QDomElement* node) { return parseDataMaxCardinalityNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataMinCardinalityNode(QDomElement* node) { return parseDataMinCardinalityNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataExactCardinalityNode(QDomElement* node) { return parseDataExactCardinalityNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyAssertionNode(QDomElement* node) { return parseDataPropertyAssertionNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseNegativeDataPropertyAssertionNode(QDomElement* node) { return parseNegativeDataPropertyAssertionNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseSubDataPropertyOfNode(QDomElement* node) { return parseSubDataPropertyOfNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentDataPropertiesNode(QDomElement* node) { return parseEquivalentDataPropertiesNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDisjointDataPropertiesNode(QDomElement* node) { return parseDisjointDataPropertiesNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyDomainNode(QDomElement* node) { return parseDataPropertyDomainNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyRangeNode(QDomElement* node) { return parseDataPropertyRangeNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseFunctionalDataPropertyNode(QDomElement* node) { return parseFunctionalDataPropertyNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataFacetRestrictionNode(QDomElement* node) { return parseDataFacetRestrictionNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionOntologyNode(QDomElement* node) { parseOntologyNode(node); return nullptr; } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionTellOntologyAxiomNode(QDomElement* node) { parseTellOntologyAxiomNode(node); return nullptr; } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionRetractOntologyAxiomNode(QDomElement* node) { parseRetractOntologyAxiomNode(node); return nullptr; } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParsePrefixNode(QDomElement* node) { parsePrefixNode(node); return nullptr; } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseClassNode(QDomElement* node) { return parseClassNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyNode(QDomElement* node) { return parseObjectPropertyNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseIndividualVariable(QDomElement* node) { return parseIndividualVariableNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDeclarationNode(QDomElement* node) { return parseDeclarationNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentClassesNode(QDomElement* node) { return parseEquivalentClassesNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseSubClassOfNode(QDomElement* node) { return parseSubClassOfNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDisjontClassesNode(QDomElement* node) { return parseDisjontClassesNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDisjontUnionNode(QDomElement* node) { return parseDisjontUnionNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseSubObjectPropertyOfNode(QDomElement* node) { return parseSubObjectPropertyOfNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyChainNode(QDomElement* node) { return parseObjectPropertyChainNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentObjectPropertiesNode(QDomElement* node) { return parseEquivalentObjectPropertiesNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDisjointObjectPropertiesNode(QDomElement* node) { return parseDisjointObjectPropertiesNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectIntersectionOfNode(QDomElement* node) { return parseObjectIntersectionOfNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectUnionOfNode(QDomElement* node) { return parseObjectUnionOfNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectMaxCardinalityNode(QDomElement* node) { return parseObjectMaxCardinalityNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectMinCardinalityNode(QDomElement* node) { return parseObjectMinCardinalityNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectExactlyCardinalityNode(QDomElement* node) { return parseObjectExactlyCardinalityNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectSomeValuesFromNode(QDomElement* node) { return parseObjectSomeValuesFromNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectAllValuesFromNode(QDomElement* node) { return parseObjectAllValuesFromNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectComplementOfNode(QDomElement* node) { return parseObjectComplementOfNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectOneOfNode(QDomElement* node) { return parseObjectOneOfNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectHasValueNode(QDomElement* node) { return parseObjectHasValueNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectHasSelfNode(QDomElement* node) { return parseObjectHasSelfNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseClassAssertionNode(QDomElement* node) { return parseClassAssertionNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseNamedIndividualNode(QDomElement* node) { return parseNamedIndividualNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseAnonymousIndividualNode(QDomElement* node) { return parseAnonymousIndividualNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyAssertionNode(QDomElement* node) { return parseObjectPropertyAssertionNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseNegativeObjectPropertyAssertionNode(QDomElement* node) { return parseNegativeObjectPropertyAssertionNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseSameIndividualNode(QDomElement* node) { return parseSameIndividualNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDifferentIndividualsNode(QDomElement* node) { return parseDifferentIndividualsNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyDomainNode(QDomElement* node) { return parseObjectPropertyDomainNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyRangeNode(QDomElement* node) { return parseObjectPropertyRangeNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseInverseObjectPropertyOfNode(QDomElement* node) { return parseInverseObjectPropertyOfNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseInverseObjectPropertiesNode(QDomElement* node) { return parseInverseObjectPropertiesNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseTransetiveObjectPropertyNode(QDomElement* node) { return parseTransetiveObjectPropertyNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseFunctionalObjectPropertyNode(QDomElement* node) { return parseFunctionalObjectPropertyNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseSymmetricObjectPropertyNode(QDomElement* node) { return parseSymmetricObjectPropertyNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseAsymmetricObjectPropertyNode(QDomElement* node) { return parseAsymmetricObjectPropertyNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseReflexiveObjectPropertyNode(QDomElement* node) { return parseReflexiveObjectPropertyNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseIrreflexiveObjectPropertyNode(QDomElement* node) { return parseIrreflexiveObjectPropertyNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseInverseFunctionalObjectPropertyNode(QDomElement* node) { return parseInverseFunctionalObjectPropertyNode(node); } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseIgnoredNode(QDomElement* node) { return nullptr; } CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseImportNode(QDomElement* node) { QString importIRIString = node->text(); if (!importIRIString.isEmpty()) { mOntoBuilder->addOntologyImport(importIRIString); } return nullptr; } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CParsingHandlingContext.cpp0000644000175000017500000000176312520550740024751 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CParsingHandlingContext.h" namespace Konclude { namespace Parser { CParsingHandlingContext::CParsingHandlingContext() { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLHandlerStackBase.h0000644000175000017500000000600312520550740023510 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CXMLHANDLERSTACKBASE_H #define KONCLUDE_PARSER_CXMLHANDLERSTACKBASE_H // Libraries includes #include #include #include #include // Namespace includes #include "ParserSettings.h" #include "CXMLHandlerStack.h" #include "CXMLHandler.h" // Other includes #include "Logger/CLogIdentifier.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class CXMLHandlerStack * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CXMLHandlerStackBase : public CXMLHandlerStack, public CXMLHandler, public CLogIdentifier { // public methods public: //! Constructor CXMLHandlerStackBase(); bool startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts, CParsingHandlingContext* handlingContext); bool endElement(const QString& namespaceURI, const QString& localName, const QString& qName, CParsingHandlingContext* handlingContext); bool startDocument(CParsingHandlingContext* handlingContext); bool endDocument(CParsingHandlingContext* handlingContext); bool pushStackedHandler(CXMLHandler* handler, bool automaticallyPop, CParsingHandlingContext* handlingContext); bool popStackedHandler(CXMLHandler* handler, CParsingHandlingContext* handlingContext); // protected methods protected: // protected variables protected: class CXMLHandlerData { public: inline CXMLHandlerData(CXMLHandler* handler, bool automatPop, cint64 parseElementLevel) { mHandler = handler; mAutoPop = automatPop; mParseElementLevel = parseElementLevel; mStartDocumentCalled = false; } CXMLHandler* mHandler; bool mAutoPop; cint64 mParseElementLevel; bool mStartDocumentCalled; }; QStack mHandlerDataStack; CXMLHandlerData* mCurrentHandlerData; cint64 mParseElementLevel; // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CXMLHANDLERSTACKBASE_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CQueryBuilder.h0000644000175000017500000001457112520550740022416 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CQUERYBUILDER_H #define KONCLUDE_PARSER_CQUERYBUILDER_H // Libraries includes #include #include #include // Namespace includes #include "Expressions/CBuildExpression.h" #include "Expressions/CClassExpression.h" // Other includes #include "Expressions/CQueryIsClassSatisfiableExpression.h" #include "Expressions/CQueryAreClassesEquivalentExpression.h" #include "Expressions/CQueryAreClassesDisjointExpression.h" #include "Expressions/CQueryIsClassSubsumedByExpression.h" #include "Expressions/CQueryIsInstanceOfExpression.h" #include "Expressions/CQueryGetFlattenedTypesExpression.h" #include "Expressions/CQueryGetFlattenedInstancesExpression.h" #include "Expressions/CQueryGetTypesExpression.h" #include "Expressions/CQueryGetInstancesExpression.h" #include "Expressions/CQueryGetSuperClassesExpression.h" #include "Expressions/CQueryGetSubClassesExpression.h" #include "Expressions/CQueryGetEquivalentClassesExpression.h" #include "Expressions/CQueryIsEntailedExpression.h" #include "Expressions/CQueryGetObjectPropertyTargetsExpression.h" #include "Expressions/CQueryGetFlattenedObjectPropertyTargetsExpression.h" #include "Expressions/CQueryGetDeterministicIndividualsExpression.h" #include "Expressions/CQueryGetNondeterministicIndividualsExpression.h" #include "Expressions/CQueryGetDeterministicClassAssertionsExpression.h" #include "Expressions/CQueryGetNondeterministicClassAssertionsExpression.h" #include "Expressions/CQueryGetSameIndividualsExpression.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { using namespace Expression; /*! * * \class CQueryBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQueryBuilder { // public methods public: //! Constructor CQueryBuilder(); //! Destructor virtual ~CQueryBuilder(); virtual CQueryIsClassSatisfiableExpression* getIsClassSatisfiableQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) = 0; virtual CQueryAreClassesEquivalentExpression* getAreClassesEquivalenceQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) = 0; virtual CQueryAreClassesDisjointExpression* getAreClassesDisjointQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) = 0; virtual CQueryIsClassSubsumedByExpression* getIsClassSubsumedByQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) = 0; virtual CQueryIsInstanceOfExpression* getIsInstanceOfQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) = 0; virtual CQueryGetFlattenedTypesExpression* getGetFlattenedTypesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName) = 0; virtual CQueryGetFlattenedInstancesExpression* getGetFlattenedInstancesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName) = 0; virtual CQueryGetTypesExpression* getGetTypesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName) = 0; virtual CQueryGetSameIndividualsExpression* getGetSameIndividualsQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) = 0; virtual CQueryGetInstancesExpression* getGetInstancesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName) = 0; virtual CQueryGetSubClassesExpression* getGetSubClassesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName) = 0; virtual CQueryGetSuperClassesExpression* getGetSuperClassesQuery(const CEXPRESSIONLIST& testClassExpressions, bool direct, const QString& queryName) = 0; virtual CQueryGetEquivalentClassesExpression* getGetEquivalentClassesQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) = 0; virtual CQueryIsEntailedExpression* getIsEntailedQuery(const CEXPRESSIONLIST& testClassExpressions, const QString& queryName) = 0; virtual CQueryGetObjectPropertyTargetsExpression* getGetObjectPropertyTargetsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName) = 0; virtual CQueryGetFlattenedObjectPropertyTargetsExpression* getGetFlattenedObjectPropertyTargetsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName) = 0; virtual CQueryGetDeterministicIndividualsExpression* getGetDeterministicIndividualsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName) = 0; virtual CQueryGetNondeterministicIndividualsExpression* getGetNondeterministicIndividualsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName) = 0; virtual CQueryGetDeterministicClassAssertionsExpression* getGetDeterministicClassAssertionsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName) = 0; virtual CQueryGetNondeterministicClassAssertionsExpression* getGetNondeterministicClassAssertionsQuery(const CEXPRESSIONLIST& expressions, const QString& queryName) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CQUERYBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CAxiomOntologyBuilder.h0000644000175000017500000000523212520550734024116 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CAXIOMONTOLOGYBUILDER_H #define KONCLUDE_PARSER_CAXIOMONTOLOGYBUILDER_H // Libraries includes #include // Namespace includes // Other includes #include "Expressions/CDeclarationAxiomExpression.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { using namespace Expression; /*! * * \class CAxiomOntologyBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAxiomOntologyBuilder { // public methods public: //! Constructor CAxiomOntologyBuilder(); //! Destructor virtual ~CAxiomOntologyBuilder(); virtual CDeclarationAxiomExpression* getDeclaration(const CEXPRESSIONLIST& expressions) = 0; virtual CDeclarationAxiomExpression* getDeclaration(CBuildExpression* buildExpression) = 0; virtual CDeclarationAxiomExpression* getDeclaration(CExpressionEntity* entity) = 0; virtual bool tellOntologyAxiom(CAxiomExpression* axiom) = 0; virtual bool tellOntologyAxiom(CBuildExpression* axiom); virtual bool retractOntologyAxiom(CAxiomExpression* axiom) = 0; virtual bool addNameAbbreviation(const QString &name, const QString &abbreviatedName) = 0; virtual QString resolveAbbreviationName(const QString& name) = 0; virtual QString resolveAbbreviationName(const QStringRef& name) = 0; virtual bool addOntologyImport(const QStringRef& name) = 0; virtual bool addOntologyImport(const QString& name) = 0; virtual QString getOntologyName() = 0; virtual cint64 getAxiomNumber() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CAXIOMONTOLOGYBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/ParserSettings.h0000644000175000017500000000274312520550742022654 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_PARSERSETTINGS #define KONCLUDE_PARSER_PARSERSETTINGS // Libraries includes // Namespace includes // Other includes #include "KoncludeSettings.h" #include "Utilities/Container/CQtList.h" // Logger includes namespace Konclude { using namespace Utilities; using namespace Utilities::Container; namespace Parser { /*! * * \file ParserSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CParsingHandlingContext; class CXMLHandler; #define CEXPRESSIONLIST CQtList }; // end namespace Parser }; // end namespace Konclude #endif // end KONCLUDE_PARSER_PARSERSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Parser/CKRSSOntologyParser.cpp0000644000175000017500000002566312520550734024036 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CKRSSOntologyParser.h" namespace Konclude { namespace Parser { CKRSSOntologyParser::CKRSSOntologyParser(COntologyBuilder* ontoBuilder) : CLogIdentifier("::Konclude::Parser::KRSSOntologyParser",this),recordRouter(0,this) { mOntoBuilder = ontoBuilder; LOG(INFO,getLogDomain(),logTr("Created KRSS Parser."),this); mDefName = QString("KRSSTestConcept"); mDefNumber = 1; #ifdef KONCLUDE_PARSER_USEPARSEJUMPFUNCTIONHASH initializeParseFunctionJumpHash(); #endif } CKRSSOntologyParser::CKRSSOntologyParser(COntologyBuilder* ontoBuilder, const QString& defNameString, CCommandRecordRouter *commandRecordRouter) : CLogIdentifier("::Konclude::Parser::KRSSOntologyParser",this),recordRouter(*commandRecordRouter,this) { mOntoBuilder = ontoBuilder; LOG(INFO,getLogDomain(),logTr("Created KRSS Parser."),this); mDefName = defNameString; if (mDefName.isEmpty()) { mDefName = "KRSSTestConcept"; } mDefNumber = 1; #ifdef KONCLUDE_PARSER_USEPARSEJUMPFUNCTIONHASH initializeParseFunctionJumpHash(); #endif } CKRSSOntologyParser::~CKRSSOntologyParser() { } bool CKRSSOntologyParser::parseOntologyFile(const QString& filename) { LOG(INFO,getLogDomain(),logTr("Loading KRSS File: '%1'.").arg(filename),this); bool successfullParsed = true; // parse file QFile file(filename); if (file.open(QIODevice::ReadOnly)) { while (!file.atEnd()) { QByteArray krssLine = file.readLine(); parseKRSSLine(krssLine); } file.close(); } else { successfullParsed = false; LOG(ERROR,getLogDomain(),logTr("File '%1' not found or couldn't be opened.").arg(filename),this); } return successfullParsed; } bool CKRSSOntologyParser::parseOntologyText(const QString& text) { bool successfullParsed = false; QStringList list(text.split("\n")); cint64 listCount = list.count(); for (cint64 i = 0; i < listCount; ++i) { QString string = list.at(i); parseKRSSLine(string); } return successfullParsed; } CBuildExpression* CKRSSOntologyParser::parseKRSSLine(const QString& line) { CBuildExpression* buildExpression = nullptr; if (line.startsWith("(")) { cint64 index = 0; buildExpression = parseKRSSExpression(line,index); QString nextDefNameString = QString("%1%2").arg(mDefName).arg(mDefNumber++); CBuildExpression* classExp = mOntoBuilder->getClass(nextDefNameString); parseDeclarationNode(classExp); CAxiomExpression* subClassExp = mOntoBuilder->getSubClassOf(classExp,buildExpression); mOntoBuilder->tellOntologyAxiom(subClassExp); } return buildExpression; } CBuildExpression* CKRSSOntologyParser::parseKRSSExpression(const QString& line, cint64& index) { CBuildExpression* buildExpression = nullptr; cint64 beginIndex = index; cint64 clamInc = 0; while (index < line.size() && line[(uint)index] == QChar('(')) { ++clamInc; ++index; } QString ident = parseIdentifierNode(line,index); ParseFunction function = mParseFunctionJumpHash.value(ident); if (function) { buildExpression = (this->*function)(line,index); } else { buildExpression = mOntoBuilder->getClass(ident); parseDeclarationNode(buildExpression); } index += clamInc; return buildExpression; } bool CKRSSOntologyParser::initializeParseFunctionJumpHash() { mParseFunctionJumpHash.insert("AND",&CKRSSOntologyParser::parseObjectIntersectionOfNode); mParseFunctionJumpHash.insert("OR",&CKRSSOntologyParser::parseObjectUnionOfNode); mParseFunctionJumpHash.insert("SOME",&CKRSSOntologyParser::parseObjectSomeValuesFromNode); mParseFunctionJumpHash.insert("ALL",&CKRSSOntologyParser::parseObjectAllValuesFromNode); mParseFunctionJumpHash.insert("NOT",&CKRSSOntologyParser::parseObjectComplementOfNode); return true; } CDeclarationAxiomExpression* CKRSSOntologyParser::parseDeclarationNode(CBuildExpression* expression) { QList builds; builds.append(expression); CDeclarationAxiomExpression* declarationExpression = mOntoBuilder->getDeclaration(builds); mOntoBuilder->tellOntologyAxiom(declarationExpression); return declarationExpression; } QString CKRSSOntologyParser::parseIdentifierNode(const QString& text, cint64& index) { QString entitiy; cint64 endIdentL = text.indexOf(" ",index); cint64 endIdentC = text.indexOf(")",index); cint64 endIdent = 0; if (endIdentL == -1) { endIdent = endIdentC; } else if (endIdentC == -1) { endIdent = endIdentL; } else { endIdent = qMin(endIdentL,endIdentC); } QString ident = text.mid(index,endIdent-index); index = endIdent; if (endIdent == endIdentL) { ++index; } return ident; } bool CKRSSOntologyParser::checkIdentifierNode(const QString& text, const QString& expectedString, cint64& index) { QString entitiy; cint64 clOff = 0; if (text[(uint)index] == QChar('(')) { ++clOff; } cint64 endIdentL = text.indexOf(" ",index+clOff); cint64 endIdentC = text.indexOf(")",index+clOff); cint64 endIdent = 0; if (endIdentL == -1) { endIdent = endIdentC; } else if (endIdentC == -1) { endIdent = endIdentL; } else { endIdent = qMin(endIdentL,endIdentC); } QString ident = text.mid(index+clOff,endIdent-index-clOff); bool expected = ident == expectedString; if (expected) { index = endIdent; if (endIdent == endIdentL) { ++index; } } return expected; } CObjectPropertyExpression *CKRSSOntologyParser::parseObjectPropertyNode(const QString& text, cint64& index) { CObjectPropertyExpression* propExpression = nullptr; QString ident = parseIdentifierNode(text,index); propExpression = mOntoBuilder->getObjectProberty(ident); parseDeclarationNode(propExpression); return propExpression; } CClassTermExpression *CKRSSOntologyParser::parseClassNode(const QString& text, cint64& index) { CClassTermExpression* classExpression = nullptr; QString ident = parseIdentifierNode(text,index); if (ident == "*BOTTOM*") { classExpression = mOntoBuilder->getBottomClass(); } else if (ident == "*TOP*") { classExpression = mOntoBuilder->getTopClass(); } else { classExpression = mOntoBuilder->getClass(ident); parseDeclarationNode(classExpression); } return classExpression; } QList CKRSSOntologyParser::parseClassChildNodes(const QString& text, cint64& index) { QList builds; while (index < text.size() && text[(uint)index] != QChar(')')) { if (text[(uint)index] == QChar(' ')) { ++index; } else { CBuildExpression *expression = parseKRSSExpression(text,index); if (expression) { builds.append(expression); } } } return builds; } QList CKRSSOntologyParser::parseSpecialClassChildNodes(const QString& text, const QString& identicalChild, cint64& index) { QList builds; cint64 identDepth = 0; while (index < text.size() && (identDepth > 0 || text[(uint)index] != QChar(')'))) { if (text[(uint)index] == QChar(' ')) { ++index; } else if (text[(uint)index] == QChar(')')) { --identDepth; ++index; } else { if (checkIdentifierNode(text,identicalChild,index)) { ++identDepth; } else { CBuildExpression *expression = parseKRSSExpression(text,index); if (expression) { builds.append(expression); } } } } return builds; } QList CKRSSOntologyParser::parsePropertyClassChildNodes(const QString& text, cint64& index) { QList builds; CBuildExpression* properyExp = parseObjectPropertyNode(text,index); CBuildExpression* classExp = parseKRSSExpression(text,index); if (properyExp) { builds.append(properyExp); } if (classExp) { builds.append(classExp); } return builds; } CBuildExpression *CKRSSOntologyParser::parseObjectIntersectionOfNode(const QString& text, cint64& index) { QList builds = parseSpecialClassChildNodes(text,"AND",index); CObjectIntersectionOfExpression *exp = mOntoBuilder->getObjectIntersectionOf(builds); return exp; } CBuildExpression *CKRSSOntologyParser::parseObjectUnionOfNode(const QString& text, cint64& index) { QList builds = parseSpecialClassChildNodes(text,"OR",index); CObjectUnionOfExpression *exp = mOntoBuilder->getObjectUnionOf(builds); return exp; } CBuildExpression *CKRSSOntologyParser::parseObjectSomeValuesFromNode(const QString& text, cint64& index) { QList builds = parsePropertyClassChildNodes(text,index); CObjectSomeValuesFromExpression *exp = mOntoBuilder->getObjectSomeValuesFrom(builds); return exp; } CBuildExpression *CKRSSOntologyParser::parseObjectAllValuesFromNode(const QString& text, cint64& index) { QList builds = parsePropertyClassChildNodes(text,index); CObjectAllValuesFromExpression *exp = mOntoBuilder->getObjectAllValuesFrom(builds); return exp; } CBuildExpression *CKRSSOntologyParser::parseObjectComplementOfNode(const QString& text, cint64& index) { QList builds = parseClassChildNodes(text,index); CObjectComplementOfExpression *exp = mOntoBuilder->getObjectComplementOf(builds); return exp; } CBuildExpression* CKRSSOntologyParser::jumpFunctionParseObjectIntersectionOfNode(const QString& text, cint64& index) { return parseObjectIntersectionOfNode(text,index); } CBuildExpression* CKRSSOntologyParser::jumpFunctionParseObjectUnionOfNode(const QString& text, cint64& index) { return parseObjectUnionOfNode(text,index); } CBuildExpression* CKRSSOntologyParser::jumpFunctionParseObjectSomeValuesFromNode(const QString& text, cint64& index) { return parseObjectSomeValuesFromNode(text,index); } CBuildExpression* CKRSSOntologyParser::jumpFunctionParseObjectAllValuesFromNode(const QString& text, cint64& index) { return parseObjectAllValuesFromNode(text,index); } CBuildExpression* CKRSSOntologyParser::jumpFunctionParseObjectComplementOfNode(const QString& text, cint64& index) { return parseObjectComplementOfNode(text,index); } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CABoxAxiomBuilder.cpp0000644000175000017500000000202012520550734023460 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CABoxAxiomBuilder.h" namespace Konclude { namespace Parser { CABoxAxiomBuilder::CABoxAxiomBuilder() { } CABoxAxiomBuilder::~CABoxAxiomBuilder() { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLTestsuiteCommandParser.cpp0000644000175000017500000002105212520550742025355 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CXMLTestsuiteCommandParser.h" namespace Konclude { namespace Parser { CXMLTestsuiteCommandParser::CXMLTestsuiteCommandParser() : CLogIdentifier("::Konclude::Parser::XMLTestsuiteCommandParser",this) { LOG(INFO,"::Konclude::Parser::XMLTestsuiteCommandParser",logTr("XML Testsuite Parser initialized."),this); command = 0; recorder = 0; delegater = 0; } CXMLTestsuiteCommandParser::~CXMLTestsuiteCommandParser() { } bool CXMLTestsuiteCommandParser::realizeCommand(CParseTestsuiteCommandsCommand *parseCommand, CCommandDelegater *commandDelegater) { delegater = commandDelegater; command = parseCommand; if (command) { recorder = command->getRecorder(); } sourcePath = command->getSourcePath(); CStartProcessCommandRecord::makeRecord(recorder,getLogDomain(),command); QByteArray *byteArray = command->getByteArray(); bool success = parse(*byteArray); CStopProcessCommandRecord::makeRecord(recorder,getLogDomain(),command); CFinishProcessCommandRecord::makeRecord(recorder,getLogDomain(),command); return success; } bool CXMLTestsuiteCommandParser::parse(const QByteArray &content) { bool successfullParsed = true; QDomDocument document; document.setContent(content,true); QDomElement documentElement(document.documentElement()); successfullParsed = parse(&documentElement); return successfullParsed; } bool CXMLTestsuiteCommandParser::parse(QDomElement *node) { bool successfullParsed = true; QDomElement documentElement(*node); QString docElemName = documentElement.tagName(); if (docElemName == "ox:RequestMessage" || docElemName == "RequestMessage") { LOG(INFO,getLogDomain(),logTr("Found OWLlink-Request Node."),this); parseOWLlinkTestsuiteRequestNode(&documentElement); } else { successfullParsed = false; CNotSupportedNodeErrorRecord::makeRecord(docElemName,recorder,getLogDomain(),command); } return successfullParsed; } bool CXMLTestsuiteCommandParser::realizeCommand(CParseTestsuiteXMLNodeCommand *testsuiteNodeCommand, CCommandDelegater *commandDelegater) { delegater = commandDelegater; nodeCommand = testsuiteNodeCommand; if (nodeCommand) { recorder = nodeCommand->getRecorder(); } CStartProcessCommandRecord::makeRecord(recorder,getLogDomain(),nodeCommand); QDomElement testsuiteNode = nodeCommand->getTestsuiteNode(); sourcePath = nodeCommand->getSourcePath(); QString docElemName = testsuiteNode.tagName(); if (docElemName == "ox:TestTestsuite" || docElemName == "TestTestsuite") { CTestTestsuiteCommand *testTestsuiteComm = parseTestTestsuiteNode(&testsuiteNode); nodeCommand->makeToSubCommand(testTestsuiteComm); QDomElement testNode = testsuiteNode.firstChildElement(); while (!testNode.isNull()) { QString testNodeElemName = testNode.tagName(); if (testNodeElemName == "ox:TestTestfileErrors" || testNodeElemName == "TestTestfileErrors") { CTestTestfileCommand *testfileTestComm = parseTestTestfileNode(&testNode,testTestsuiteComm); } testNode = testNode.nextSiblingElement(); } delegater->delegateCommand(testTestsuiteComm); } else { CNotSupportedNodeErrorRecord::makeRecord(docElemName,recorder,getLogDomain(),nodeCommand); CCommand *skipComm = new CSkipUnsupportedCommandCommand(docElemName); delegater->delegateCommand(skipComm); } CStopProcessCommandRecord::makeRecord(recorder,getLogDomain(),nodeCommand); CFinishProcessCommandRecord::makeRecord(recorder,getLogDomain(),nodeCommand); return true; } void CXMLTestsuiteCommandParser::parseOWLlinkTestsuiteRequestNode(QDomElement *requestNode) { QDomElement node = requestNode->firstChildElement(); CPreconditionCommand *lastPreComm = 0; while (!node.isNull()) { // build for each node an expression CPreconditionCommand *preComm; QString docElemName = node.tagName(); if (docElemName == "ox:TestTestsuite" || docElemName == "TestTestsuite") { CTestTestsuiteCommand *testTestsuiteComm = parseTestTestsuiteNode(&node); QDomElement testNode = node.firstChildElement(); while (!testNode.isNull()) { QString testNodeElemName = testNode.tagName(); if (testNodeElemName == "ox:TestTestfileErrors" || testNodeElemName == "TestTestfileErrors") { CTestTestfileCommand *testfileTestComm = parseTestTestfileNode(&testNode,testTestsuiteComm); } testNode = testNode.nextSiblingElement(); } preComm = testTestsuiteComm; } else { CNotSupportedNodeErrorRecord::makeRecord(docElemName,recorder,getLogDomain(),command); preComm = new CSkipUnsupportedCommandCommand(docElemName); } if (preComm) { if (lastPreComm) { preComm->addCommandPrecondition(new CCommandProcessedPrecondition(lastPreComm)); } if (command) { command->makeToSubCommand(preComm); } if (delegater) { delegater->delegateCommand(preComm); } lastPreComm = preComm; } preComm = 0; node = node.nextSiblingElement(); } } CTestTestsuiteCommand *CXMLTestsuiteCommandParser::parseTestTestsuiteNode(QDomElement *node) { QString nameString = node->attribute("name","Unamed Testsuite"); CReasonerTestsuiteTest *testsuiteTest = new CReasonerTestsuiteTest(); CTestTestsuiteCommand *testTestSuiteCommand = new CTestTestsuiteCommand(nameString); testTestSuiteCommand->setTestsuiteTest(testsuiteTest); QFileInfo fiSP(sourcePath); QString loopCountString = node->attribute("defaultTestLoops","1"); bool convSucc = false; qint64 loopCount = loopCountString.toLongLong(&convSucc); if (convSucc) { testsuiteTest->setDefaultTestLoopCount(loopCount); } if (node->hasAttribute("defaultTimeout")) { QString timeoutString = node->attribute("defaultTimeout","0"); convSucc = false; qint64 defTimeout = timeoutString.toLongLong(&convSucc); if (convSucc) { testsuiteTest->setDefaultTimeout(defTimeout); } } if (fiSP.absoluteDir().exists()) { testsuiteTest->setDefaultWorkingDirectory(fiSP.absolutePath()); } if (node->hasAttribute("defaultWorkingDirectory")) { QString workingDir = node->attribute("defaultWorkingDirectory"); testsuiteTest->setDefaultWorkingDirectory(workingDir); } return testTestSuiteCommand; } CTestTestfileCommand *CXMLTestsuiteCommandParser::parseTestTestfileNode(QDomElement *node, CTestTestsuiteCommand *testTestsuiteComm) { CReasonerTestsuiteTest *testsuiteTest = testTestsuiteComm->getTestsuiteTest(); CReasonerTestfileTest *testfileTest = testsuiteTest->createTestfileTest(); CTestTestfileCommand *testTestfileComm = new CTestTestfileCommand(testfileTest,testTestsuiteComm); if (node->hasAttribute("testLoops")) { QString loopCountString = node->attribute("testLoops","1"); bool convSucc = false; qint64 loopCount = loopCountString.toLongLong(&convSucc); if (convSucc) { testfileTest->setTestLoopCount(loopCount); } } if (node->hasAttribute("timeout")) { QString timeoutString = node->attribute("timeout"); bool convSucc = false; qint64 timeout = timeoutString.toLongLong(&convSucc); if (convSucc) { testfileTest->setTimeout(timeout); } } if (node->hasAttribute("workingDirectory")) { QString workingDir = node->attribute("workingDirectory"); testfileTest->setWorkingDirectory(workingDir); } if (node->hasAttribute("requestSource")) { QString requestSource = node->attribute("requestSource"); testfileTest->setTestRequestFile(requestSource); } if (node->hasAttribute("expectedResponseSource")) { QString expResponseSource = node->attribute("expectedResponseSource"); testfileTest->setTestExpectedResponseFile(expResponseSource); } return testTestfileComm; } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/COWL2QtXMLOntologySAXParser.h0000644000175000017500000000530512520550736024677 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_COWL2QTXMLONTOLOGYSAXPARSER_H #define KONCLUDE_PARSER_COWL2QTXMLONTOLOGYSAXPARSER_H // Libraries includes #include #include #include // Namespace includes #include "ParserSettings.h" #include "CXMLHandlerStackBase.h" #include "CXMLParsingHandlingContext.h" #include "CQtXMLContentHandlerConverter.h" #include "CXMLParsingHandlingContextBase.h" #include "COntologyBuilder.h" #include "CXMLOWL2Handler.h" // Other includes #include "Context/CContextBase.h" #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/Memory/CMemoryPoolProvider.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Utilities::Memory; using namespace Context; namespace Parser { /*! * * \class COWL2QtXMLOntologySAXParser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWL2QtXMLOntologySAXParser { // public methods public: //! Constructor COWL2QtXMLOntologySAXParser(COntologyBuilder* ontologyBuilder); virtual ~COWL2QtXMLOntologySAXParser(); bool parseOntology(const QString& fileString); bool parseOntology(QIODevice* ioDevice); // protected methods protected: // protected variables protected: CXMLHandlerStackBase* mHandlerStack; CXMLParsingHandlingContext* mParsingHandlingContext; CXMLOWL2Handler* mOWLXMLStackHandler; COntologyBuilder* mOntologyBuilder; CMemoryPoolAllocationManager* mMemoryPoolAllocationMan; CMemoryPoolProvider* mMemoryPoolProvider; CContextBase* mContextBase; // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_COWL2QTXMLONTOLOGYSAXPARSER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CCommandParser.cpp0000644000175000017500000000200512520550734023060 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCommandParser.h" namespace Konclude { namespace Parser { CCommandParser::CCommandParser() { } CCommandParser::~CCommandParser() { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CParseRuleAtom.cpp0000644000175000017500000000304712520550736023061 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CParseRuleAtom.h" namespace Konclude { namespace Parser { CParseRuleAtom::CParseRuleAtom(ATOMTYPE atomType) { mAtomType = atomType; mAtomExpression = nullptr; } CParseRuleAtom* CParseRuleAtom::addVariableString(const QString& variableString) { if (mVariableName1.isEmpty()) { mVariableName1 = variableString; } else if (mVariableName2.isEmpty()) { mVariableName2 = variableString; } return this; } const QString CParseRuleAtom::getOtherVariable(const QString& variableString, bool& inversed) { if (variableString == mVariableName1) { inversed = false; return mVariableName2; } else { inversed = true; return mVariableName1; } } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/COWLlinkQueryExtensionParser.cpp0000644000175000017500000000211212520550736025745 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLlinkQueryExtensionParser.h" namespace Konclude { namespace Parser { COWLlinkQueryExtensionParser::COWLlinkQueryExtensionParser() { } COWLlinkQueryExtensionParser::~COWLlinkQueryExtensionParser() { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLParsingHandlingContextBase.cpp0000644000175000017500000000261112520550742026120 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CXMLParsingHandlingContextBase.h" namespace Konclude { namespace Parser { CXMLParsingHandlingContextBase::CXMLParsingHandlingContextBase(CXMLHandlerStack* xmlHandlerStack, CMemoryAllocationManager* memAllocManager) { mXMLHandlerStack = xmlHandlerStack; mMemAllocManager = memAllocManager; } CXMLHandlerStack* CXMLParsingHandlingContextBase::getXMLHandlerStack() { return mXMLHandlerStack; } CMemoryAllocationManager* CXMLParsingHandlingContextBase::getMemoryAllocationManager() { return mMemAllocManager; } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/COWL2QtXMLOntologyStreamParser.cpp0000644000175000017500000000631712520550736026036 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWL2QtXMLOntologyStreamParser.h" namespace Konclude { namespace Parser { COWL2QtXMLOntologyStreamParser::COWL2QtXMLOntologyStreamParser(COntologyBuilder* ontologyBuilder) { mOntologyBuilder = ontologyBuilder; mOWLXMLStreamHandler = new CXMLOWL2StreamHandler(ontologyBuilder); mError = false; } COWL2QtXMLOntologyStreamParser::~COWL2QtXMLOntologyStreamParser() { delete mOWLXMLStreamHandler; } bool COWL2QtXMLOntologyStreamParser::parseOntology(const QString& fileString) { QFile file(fileString); mError = false; if (file.open(QIODevice::ReadOnly)) { mError = !parseOntology(&file); file.close(); } else { mErrorString = QString("File '%1' does not exist or cannot be opened.").arg(fileString); mError = true; } return !mError; } bool COWL2QtXMLOntologyStreamParser::parseOntology(QIODevice* ioDevice) { QXmlStreamReader xmlReader(ioDevice); while (!xmlReader.atEnd()) { QXmlStreamReader::TokenType token(xmlReader.readNext()); if (token == QXmlStreamReader::StartDocument) { mOWLXMLStreamHandler->startDocument(); } else if (token == QXmlStreamReader::StartElement) { mOWLXMLStreamHandler->startElement(xmlReader.namespaceUri(),xmlReader.name(),xmlReader.qualifiedName(),xmlReader.attributes()); } else if (token == QXmlStreamReader::EndElement) { mOWLXMLStreamHandler->endElement(xmlReader.namespaceUri(),xmlReader.name(),xmlReader.qualifiedName()); } else if (token == QXmlStreamReader::Characters) { mOWLXMLStreamHandler->readText(xmlReader.text()); } else if (token == QXmlStreamReader::StartDocument) { mOWLXMLStreamHandler->endDocument(); } } if (xmlReader.hasError()) { mErrorString = QString("XML parsing error at %2:%3: '%1'.").arg(xmlReader.errorString()).arg(xmlReader.lineNumber()).arg(xmlReader.columnNumber()); mError = true; LOG(ERROR,"::Konclude::Parser::OWL2QtXMLStreamOntologyParser",mErrorString,this); } else if (!mOWLXMLStreamHandler->hasOntologyNodeFound()) { mErrorString = QString("OWL2/XML Ontology node not found."); mError = true; LOG(ERROR,"::Konclude::Parser::OWL2QtXMLStreamOntologyParser",mErrorString,this); } return !mError; } QString COWL2QtXMLOntologyStreamParser::getErrorString() { return mErrorString; } bool COWL2QtXMLOntologyStreamParser::hasError() { return mError; } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalANTLR/0000755000175000017500000000000012613407252022423 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalANTLR/OWL2FunctionalGrammer.g0000644000175000017500000006047012266271366026674 0ustar jonasjonasgrammar OWL2FunctionalGrammer; options { language = Cpp; k = 2; } tokens { /* Ontology Keywords */ PREFIX = 'Prefix'; ONTOLOGY = 'Ontology'; IMPORT = 'Import'; /* Entities and Literals */ CLASS = 'Class'; DATATYPE = 'Datatype'; OBJECT_PROPERTY = 'ObjectProperty'; DATA_PROPERTY = 'DataProperty'; ANNOTATION_PROPERTY = 'Annotation_Property'; NAMED_INDIVIDUAL = 'NamedIndividual'; /* Declaration */ DECLARATION = 'Declaration'; /* Property Expressions */ OBJECT_INVERSE_OF = 'ObjectInverseOf'; OBJECT_PROPERTY_CHAIN = 'ObjectPropertyChain'; /* Data Ranges */ DATATYPE_RESTRICTION = 'DatatypeRestriction'; /* Class Expressions */ OBJECT_INTERSECTION_OF = 'ObjectIntersectionOf'; OBJECT_UNION_OF = 'ObjectUnionOf'; OBJECT_COMPLEMENT_OF = 'ObjectComplementOf'; OBJECT_ONE_OF = 'ObjectOneOf'; OBJECT_SOME_VALUES_FROM = 'ObjectSomeValuesFrom'; OBJECT_ALL_VALUES_FROM = 'ObjectAllValuesFrom'; OBJECT_HAS_VALUE = 'ObjectHasValue'; OBJECT_HAS_SELF = 'ObjectHasSelf'; OBJECT_MIN_CARDINALITY = 'ObjectMinCardinality'; OBJECT_MAX_CARDINALITY = 'ObjectMaxCardinality'; OBJECT_EXACT_CARDINALITY = 'ObjectExactCardinality'; DATA_INTERSECTION_OF = 'DataIntersectionOf'; DATA_UNION_OF = 'DataUnionOf'; DATA_COMPLEMENT_OF = 'DataComplementOf'; DATA_ONE_OF = 'DataOneOf'; DATA_SOME_VALUES_FROM = 'DataSomeValuesFrom'; DATA_ALL_VALUES_FROM = 'DataAllValuesFrom'; DATA_HAS_VALUE = 'DataHasValue'; DATA_MIN_CARDINALITY = 'DataMinCardinality'; DATA_MAX_CARDINALITY = 'DataMaxCardinality'; DATA_EXACT_CARDINALITY = 'DataExactCardinality'; /* Class Expressions Axioms */ SUB_CLASS_OF = 'SubClassOf'; EQUIVALENT_CLASSES = 'EquivalentClasses'; DISJOINT_CLASSES = 'DisjointClasses'; DISJOINT_UNION = 'DisjointUnion'; /* Object Property Axioms */ SUB_OBJECT_PROPERTY_OF = 'SubObjectPropertyOf'; EQUIVALENT_OBJECT_PROPERTIES = 'EquivalentObjectProperties'; DISJOINT_OBJECT_PROPERTIES = 'DisjointObjectProperties'; OBJECT_PROPERTY_DOMAIN = 'ObjectPropertyDomain'; OBJECT_PROPERTY_RANGE = 'ObjectPropertyRange'; INVERSE_OBJECT_PROPERTIES = 'InverseObjectProperties'; FUNCTIONAL_OBJECT_PROPERTY = 'FunctionalObjectProperty'; INVERSE_FUNCTIONAL_OBJECT_PROPERTY = 'InverseFunctionalObjectProperty'; REFLEXIVE_OBJECT_PROPERTY = 'ReflexiveObjectProperty'; IRREFLEXIVE_OBJECT_PROPERTY = 'IrreflexiveObjectProperty'; SYMMETRIC_OBJECT_PROPERTY = 'SymmetricObjectProperty'; ASYMMETRIC_OBJECT_PROPERTY = 'AsymmetricObjectProperty'; TRANSITIVE_OBJECT_PROPERTY = 'TransitiveObjectProperty'; /* Data Property Axioms */ SUB_DATA_PROPERTY_OF = 'SubDataPropertyOf'; EQUIVALENT_DATA_PROPERTIES = 'EquivalentDataProperties'; DISJOINT_DATA_PROPERTIES = 'DisjointDataProperties'; DATA_PROPERTY_DOMAIN = 'DataPropertyDomain'; DATA_PROPERTY_RANGE = 'DataPropertyRange'; FUNCTIONAL_DATA_PROPERTY = 'FunctionalDataProperty'; DATATYPE_DEFINITION = 'DatatypeDefinition'; /* Keys */ HAS_KEY = 'HasKey'; /* Assertions */ SAME_INDIVIDUAL = 'SameIndividual'; DIFFERENT_INDIVIDUALS = 'DifferentIndividuals'; CLASS_ASSERTION = 'ClassAssertion'; OBJECT_PROPERTY_ASSERTION = 'ObjectPropertyAssertion'; NEGATIVE_OBJECT_PROPERTY_ASSERTION = 'NegativeObjectPropertyAssertion'; DATA_PROPERTY_ASSERTION = 'DataPropertyAssertion'; NEGATIVE_DATA_PROPERTY_ASSERTION = 'NegativeDataPropertyAssertion'; /* Annotations */ ANNOTATION = 'Annotation'; ANNOTATION_ASSERTION = 'AnnotationAssertion'; SUB_ANNOTATION_PROPERTY_OF = 'SubAnnotationPropertyOf'; ANNOTATION_PROPERTY_DOMAIN = 'AnnotationPropertyDomain'; ANNOTATION_PROPERTY_RANGE = 'AnnotationPropertyRange'; } @header { } @members { } /*------------------------------------------------------------------ * LEXER RULES *------------------------------------------------------------------*/ WHITESPACE : ( '\t' | ' ' | '\r' | '\n'| '\u000C' )+ { skip(); } ; NON_NEGATIVE_INTEGER : ('1'..'9') DIGIT* ; fragment DIGIT : '0'..'9' ; REFERENCE : '^^' ; OPEN_BRACE : '(' ; CLOSE_BRACE : ')' ; EQUALS : '=' ; /* a finite sequence of characters in which " (U+22) and \ (U+5C) * occur only in pairs of the form \" (U+5C, U+22) and \\ (U+5C, U+5C), * enclosed in a pair of " (U+22) characters */ QUOTED_STRING : '\"' ( ~('\\'|'\"') | ('\\' ('\"'|'\''|'\\')) )* '\"' ; IRI_REF : '<' ( ~( '<' | '>' | '\"' | '{' | '}' | '|' | '^' | '`' | '\\' | '\u0000'..'\u0020' ) )* '>' ; /* see IRI_REF of [SPARQL] */ PNAME_NS : PN_PREFIX? ':' ; PNAME_LN : PNAME_NS PN_LOCAL ; BLANK_NODE_LABEL : '_:' PN_LOCAL ; LANGTAG : '@' ('a'..'z'|'A'..'Z')+ ('-' ('a'..'z'|'A'..'Z'|DIGIT)+)* ; fragment PN_CHARS_U : PN_CHARS_BASE | '_' ; fragment PN_CHARS : PN_CHARS_U | '-' | DIGIT | '\u00B7' | '\u0300'..'\u036F' | '\u203F'..'\u2040' ; fragment PN_PREFIX : PN_CHARS_BASE ( ( PN_CHARS | '.' )* PN_CHARS )? ; fragment PN_LOCAL : ( PN_CHARS_U | DIGIT ) ( ( PN_CHARS | '.' )* PN_CHARS)? ; fragment PN_CHARS_BASE : 'a'..'z' | 'A'..'Z' | '\u00C0'..'\u00D6' | '\u00D8'..'\u00F6' | '\u00F8'..'\u02FF' | '\u0370'..'\u037D' | '\u037F'..'\u1FFF' | '\u200C'..'\u200D' | '\u2070'..'\u218F' | '\u2C00'..'\u2FEF' | '\u3001'..'\uD7FF' | '\uF900'..'\uFDCF' | '\uFDF0'..'\uFFFD' // | '\u10000'..'\uEFFFF' // not supported by java ; /* 2 Preliminary Definitions */ /* 2.3 Integers, Characters, Strings, Language Tags, and Node IDs */ /* @ (U+40) followed a nonempty sequence of characters matching the * langtag production from [BCP 47] */ languageTag : LANGTAG ; /* See LANGTAG in [SPARQL] */ /* a finite sequence of characters matching the BLANK_NODE_LABEL * production of [SPARQL] */ nodeId : BLANK_NODE_LABEL ; /* 2.3 IRIs */ /* an iri as defined in [RFC3987], enclosed in a pair of < (U+3C) and > * (U+3E) characters */ fullIri : IRI_REF ; /* See IRI_REF in [SPARQL] */ iri : fullIri | abbreviatedIri ; /* a finite sequence of characters matching the PNAME_LN production of * [SPARQL] */ abbreviatedIri : PNAME_LN ; /* a finite sequence of characters matching the as PNAME_NS production of * [SPARQL] */ prefixName : PNAME_NS ; /* 3 Ontologies */ /* 3.5 Ontology Annotations */ ontologyAnnotations : annotation* ; /* 3.7 Functional-Style Syntax */ ontologyDocument : prefixDeclaration* ontology ; prefixDeclaration : PREFIX OPEN_BRACE prefixName EQUALS fullIri CLOSE_BRACE ; ontology : ONTOLOGY OPEN_BRACE ( ontologyIri versionIri? )? directlyImportsDocuments ontologyAnnotations axioms CLOSE_BRACE ; ontologyIri : iri ; versionIri : iri ; directlyImportsDocuments : ( IMPORT OPEN_BRACE iri CLOSE_BRACE )* ; axioms : (axiom)* ; /* 5 Entities and Literals */ /* 5.1 Classes */ class : iri ; /* 5.2 Datatypes */ datatype : iri ; /* 5.3 Object Properties */ objectProperty : iri ; /* 5.4 Data Properties */ dataProperty : iri ; /* 5.5 Annotation Properties */ annotationProperty : iri ; /* 5.6 Individuals */ individual : namedIndividual | anonymousIndividual ; /* 5.6.1 Named Individuals */ namedIndividual : iri ; /* 5.6.2 Anonymous Individuals */ anonymousIndividual : nodeId ; /* 5.7 Literals */ literal : QUOTED_STRING ( REFERENCE datatype | languageTag? ) ; /* 5.8 Entity Declarations and Typing */ declaration : DECLARATION OPEN_BRACE axiomAnnotations entity CLOSE_BRACE ; entity : CLASS OPEN_BRACE class CLOSE_BRACE | DATATYPE OPEN_BRACE datatype CLOSE_BRACE | OBJECT_PROPERTY OPEN_BRACE objectProperty CLOSE_BRACE | DATA_PROPERTY OPEN_BRACE dataProperty CLOSE_BRACE | ANNOTATION_PROPERTY OPEN_BRACE annotationProperty CLOSE_BRACE | NAMED_INDIVIDUAL OPEN_BRACE namedIndividual CLOSE_BRACE ; /* 6 Property Expressions */ objectPropertyExpression : objectProperty | inverseObjectProperty ; /* 6.1.1 Inverse Object Properties */ inverseObjectProperty : OBJECT_INVERSE_OF OPEN_BRACE objectProperty CLOSE_BRACE ; /* 6.2 Data Property Expressions */ dataPropertyExpression : dataProperty ; /* 7 Data Ranges */ dataRange : datatype | dataIntersectionOf | dataUnionOf | dataComplementOf | dataOneOf | dataRangeRestriction ; /* 7.1 Intersection of Data Ranges */ dataIntersectionOf : DATA_INTERSECTION_OF OPEN_BRACE dataRange dataRange+ CLOSE_BRACE ; /* 7.2 Union of Data Ranges */ dataUnionOf : DATA_UNION_OF OPEN_BRACE dataRange dataRange+ CLOSE_BRACE ; /* 7.3 Complement of Data Ranges */ dataComplementOf : DATA_COMPLEMENT_OF OPEN_BRACE dataRange CLOSE_BRACE ; /* 7.4 Enumeration of Literals */ dataOneOf : DATA_ONE_OF OPEN_BRACE literal+ CLOSE_BRACE ; /* 7.5 Datatype Restrictions */ dataRangeRestriction : DATATYPE_RESTRICTION OPEN_BRACE datatype ( dataRangeFacetRestriction )+ CLOSE_BRACE ; dataRangeFacetRestriction : iri literal ; /* 8 Class Expressions */ classExpression : class | objectIntersectionOf | objectUnionOf | objectComplementOf | objectOneOf | objectSomeValuesFrom | objectAllValuesFrom | objectHasValue | objectHasSelf | objectMinCardinality | objectMaxCardinality | objectExactCardinality | dataSomeValuesFrom | dataAllValuesFrom | dataHasValue | dataMinCardinality | dataMaxCardinality | dataExactCardinality ; /* 8.1 Propositional Connectives and Enumeration of Individuals */ /* 8.1.1 Intersection of Class Expressions */ objectIntersectionOf : OBJECT_INTERSECTION_OF OPEN_BRACE classExpression ( classExpression)+ CLOSE_BRACE ; /* 8.1.2 Union of Class Expressions */ objectUnionOf : OBJECT_UNION_OF OPEN_BRACE classExpression classExpression+ CLOSE_BRACE ; /* 8.1.3 Complement of Class Expressions */ objectComplementOf : OBJECT_COMPLEMENT_OF OPEN_BRACE classExpression CLOSE_BRACE ; /* 8.1.4 Enumeration of Individuals */ objectOneOf : OBJECT_ONE_OF OPEN_BRACE individual+ CLOSE_BRACE ; /* 8.2 Object Property Restrictions */ /* 8.2.1 Existential Quantification */ objectSomeValuesFrom : OBJECT_SOME_VALUES_FROM OPEN_BRACE objectPropertyExpression classExpression CLOSE_BRACE ; /* 8.2.2 Universal Quantification */ objectAllValuesFrom : OBJECT_ALL_VALUES_FROM OPEN_BRACE objectPropertyExpression classExpression CLOSE_BRACE ; /* 8.2.3 Individual Value Restriction */ objectHasValue : OBJECT_HAS_VALUE OPEN_BRACE objectPropertyExpression individual CLOSE_BRACE ; /* 8.2.4 Self-Restriction */ objectHasSelf : OBJECT_HAS_SELF OPEN_BRACE objectPropertyExpression CLOSE_BRACE ; /* 8.3 Object Property Cardinality Restrictions */ /* 8.3.1 Minimum Cardinality */ objectMinCardinality : OBJECT_MIN_CARDINALITY OPEN_BRACE NON_NEGATIVE_INTEGER objectPropertyExpression classExpression? CLOSE_BRACE ; /* 8.3.2 Maximum Cardinality */ objectMaxCardinality : OBJECT_MAX_CARDINALITY OPEN_BRACE NON_NEGATIVE_INTEGER objectPropertyExpression classExpression? CLOSE_BRACE ; /* 8.3.3 Exact Cardinality */ objectExactCardinality : OBJECT_EXACT_CARDINALITY OPEN_BRACE NON_NEGATIVE_INTEGER objectPropertyExpression classExpression? CLOSE_BRACE ; /* 8.4 Data Property Restrictions */ /* 8.4.1 Existential Quantification */ dataSomeValuesFrom : DATA_SOME_VALUES_FROM OPEN_BRACE dataPropertyExpression+ dataRange CLOSE_BRACE ; /* 8.4.2 Universal Quantification */ dataAllValuesFrom : DATA_ALL_VALUES_FROM OPEN_BRACE dataPropertyExpression+ dataRange CLOSE_BRACE ; /* 8.4.3 Literal Value Restriction */ dataHasValue : DATA_HAS_VALUE OPEN_BRACE dataPropertyExpression literal CLOSE_BRACE ; /* 8.5 Data Property Cardinality Restrictions */ /* 8.5.1 Minimum Cardinality */ dataMinCardinality : DATA_MIN_CARDINALITY OPEN_BRACE NON_NEGATIVE_INTEGER dataPropertyExpression dataRange? CLOSE_BRACE ; /* 8.5.2 Maximum Cardinality */ dataMaxCardinality : DATA_MAX_CARDINALITY OPEN_BRACE NON_NEGATIVE_INTEGER dataPropertyExpression dataRange? CLOSE_BRACE ; /* 8.5.3 Exact Cardinality */ dataExactCardinality : DATA_EXACT_CARDINALITY OPEN_BRACE NON_NEGATIVE_INTEGER dataPropertyExpression dataRange? CLOSE_BRACE ; /* 9 Axioms */ axiom : declaration | classAxiom | objectPropertyAxiom | dataPropertyAxiom | datatypeDefinition | hasKey | assertion | annotationAxiom ; axiomAnnotations : annotation* ; /* 9.1 Class Expression Axioms */ classAxiom : subClassOf | equivalentClasses | disjointClasses | disjointUnion ; /* 9.1.1 Subclass Axioms */ subClassOf : SUB_CLASS_OF OPEN_BRACE axiomAnnotations subClassExpression superClassExpression CLOSE_BRACE ; subClassExpression : classExpression ; superClassExpression : classExpression ; /* 9.1.2 Equivalent Classes */ equivalentClasses : EQUIVALENT_CLASSES OPEN_BRACE axiomAnnotations classExpression ( classExpression )+ CLOSE_BRACE ; /* 9.1.3 Disjoint Classes */ disjointClasses : DISJOINT_CLASSES OPEN_BRACE axiomAnnotations classExpression classExpression+ CLOSE_BRACE ; /* 9.1.4 Disjoint Union of Class Expressions */ disjointUnion : DISJOINT_UNION OPEN_BRACE axiomAnnotations class disjointClassExpressions CLOSE_BRACE ; disjointClassExpressions : classExpression classExpression+ ; /* 9.2 Object Property Axioms */ objectPropertyAxiom : subObjectPropertyOf | equivalentObjectProperties | disjointObjectProperties | inverseObjectProperties | objectPropertyDomain | objectPropertyRange | functionalObjectProperty | inverseFunctionalObjectProperty | reflexiveObjectProperty | irreflexiveObjectProperty | symmetricObjectProperty | asymmetricObjectProperty | transitiveObjectProperty ; /* 9.2.1 Object Subproperties */ subObjectPropertyOf : SUB_OBJECT_PROPERTY_OF OPEN_BRACE axiomAnnotations ( objectPropertyExpression | propertyExpressionChain ) objectPropertyExpression CLOSE_BRACE ; propertyExpressionChain : OBJECT_PROPERTY_CHAIN OPEN_BRACE objectPropertyExpression ( objectPropertyExpression )+ CLOSE_BRACE ; /* 9.2.2 Equivalent Object Properties */ equivalentObjectProperties : EQUIVALENT_OBJECT_PROPERTIES OPEN_BRACE axiomAnnotations objectPropertyExpression objectPropertyExpression+ CLOSE_BRACE ; /* 9.2.3 Disjoint Object Properties */ disjointObjectProperties : DISJOINT_OBJECT_PROPERTIES OPEN_BRACE axiomAnnotations objectPropertyExpression objectPropertyExpression+ CLOSE_BRACE ; /* 9.2.4 Inverse Object Properties */ inverseObjectProperties : INVERSE_OBJECT_PROPERTIES OPEN_BRACE axiomAnnotations objectPropertyExpression objectPropertyExpression CLOSE_BRACE ; /* 9.2.5 Object Property Domain */ objectPropertyDomain : OBJECT_PROPERTY_DOMAIN OPEN_BRACE axiomAnnotations objectPropertyExpression classExpression CLOSE_BRACE ; /* 9.2.6 Object Property Range */ objectPropertyRange : OBJECT_PROPERTY_RANGE OPEN_BRACE axiomAnnotations objectPropertyExpression classExpression CLOSE_BRACE ; /* 9.2.7 Functional Object Properties */ functionalObjectProperty : FUNCTIONAL_OBJECT_PROPERTY OPEN_BRACE axiomAnnotations objectPropertyExpression CLOSE_BRACE ; /* 9.2.8 Inverse-Functional Object Properties */ inverseFunctionalObjectProperty : INVERSE_FUNCTIONAL_OBJECT_PROPERTY OPEN_BRACE axiomAnnotations objectPropertyExpression CLOSE_BRACE ; /* 9.2.9 Reflexive Object Properties */ reflexiveObjectProperty : REFLEXIVE_OBJECT_PROPERTY OPEN_BRACE axiomAnnotations objectPropertyExpression CLOSE_BRACE ; /* 9.2.10 Irreflexive Object Properties */ irreflexiveObjectProperty : IRREFLEXIVE_OBJECT_PROPERTY OPEN_BRACE axiomAnnotations objectPropertyExpression CLOSE_BRACE ; /* 9.2.11 Symmetric Object Properties */ symmetricObjectProperty : SYMMETRIC_OBJECT_PROPERTY OPEN_BRACE axiomAnnotations objectPropertyExpression CLOSE_BRACE ; /* 9.2.12 Asymmetric Object Properties */ asymmetricObjectProperty : ASYMMETRIC_OBJECT_PROPERTY OPEN_BRACE axiomAnnotations objectPropertyExpression CLOSE_BRACE ; /* 9.2.13 Transitive Object Properties */ transitiveObjectProperty : TRANSITIVE_OBJECT_PROPERTY OPEN_BRACE axiomAnnotations objectPropertyExpression CLOSE_BRACE ; /* 9.3 Data Property Axioms */ dataPropertyAxiom : subDataPropertyOf | equivalentDataProperties | disjointDataProperties | dataPropertyDomain | dataPropertyRange | functionalDataProperty ; /* 9.3.1 Data Subproperties */ subDataPropertyOf : SUB_DATA_PROPERTY_OF OPEN_BRACE axiomAnnotations subDataPropertyExpression superDataPropertyExpression CLOSE_BRACE ; subDataPropertyExpression : dataPropertyExpression ; superDataPropertyExpression : dataPropertyExpression ; /* 9.3.2 Equivalent Data Properties */ equivalentDataProperties : EQUIVALENT_DATA_PROPERTIES OPEN_BRACE axiomAnnotations dataPropertyExpression dataPropertyExpression+ CLOSE_BRACE ; /* 9.3.3 Disjoint Data Properties */ disjointDataProperties : DISJOINT_DATA_PROPERTIES OPEN_BRACE axiomAnnotations dataPropertyExpression dataPropertyExpression+ CLOSE_BRACE ; /* 9.3.4 Data Property Domain */ dataPropertyDomain : DATA_PROPERTY_DOMAIN OPEN_BRACE axiomAnnotations dataPropertyExpression classExpression CLOSE_BRACE ; /* 9.3.5 Data Property Range */ dataPropertyRange : DATA_PROPERTY_RANGE OPEN_BRACE axiomAnnotations dataPropertyExpression dataRange CLOSE_BRACE ; /* 9.3.6 Functional Data Properties */ functionalDataProperty : FUNCTIONAL_DATA_PROPERTY OPEN_BRACE axiomAnnotations dataPropertyExpression CLOSE_BRACE ; /* 9.4 Datatype Definitions */ datatypeDefinition : DATATYPE_DEFINITION OPEN_BRACE axiomAnnotations datatype dataRange CLOSE_BRACE ; /* 9.5 Keys */ hasKey : HAS_KEY OPEN_BRACE axiomAnnotations classExpression OPEN_BRACE objectPropertyExpression* CLOSE_BRACE OPEN_BRACE dataPropertyExpression* CLOSE_BRACE CLOSE_BRACE ; /* 9.6 Assertions */ assertion : sameIndividual | differentIndividuals | classAssertion | objectPropertyAssertion | negativeObjectPropertyAssertion | dataPropertyAssertion | negativeDataPropertyAssertion ; sourceIndividual : individual ; targetIndividual : individual ; targetValue : literal ; /* 9.6.1 Individual Equality */ sameIndividual : SAME_INDIVIDUAL OPEN_BRACE axiomAnnotations individual individual+ CLOSE_BRACE ; /* 9.6.2 Individual Inequality */ differentIndividuals : DIFFERENT_INDIVIDUALS OPEN_BRACE axiomAnnotations individual individual+ CLOSE_BRACE ; /* 9.6.3 Class Assertions */ classAssertion : CLASS_ASSERTION OPEN_BRACE axiomAnnotations classExpression individual CLOSE_BRACE ; /* 9.6.4 Positive Object Property Assertions */ objectPropertyAssertion : OBJECT_PROPERTY_ASSERTION OPEN_BRACE axiomAnnotations objectPropertyExpression sourceIndividual targetIndividual CLOSE_BRACE ; /* 9.6.5 Negative Object Property Assertions */ negativeObjectPropertyAssertion : NEGATIVE_OBJECT_PROPERTY_ASSERTION OPEN_BRACE axiomAnnotations objectPropertyExpression sourceIndividual targetIndividual CLOSE_BRACE ; /* 9.6.6 Positive Data Property Assertions */ dataPropertyAssertion : DATA_PROPERTY_ASSERTION OPEN_BRACE axiomAnnotations dataPropertyExpression sourceIndividual targetValue CLOSE_BRACE ; /* 9.6.7 Negative Data Property Assertions */ negativeDataPropertyAssertion : NEGATIVE_DATA_PROPERTY_ASSERTION OPEN_BRACE axiomAnnotations dataPropertyExpression sourceIndividual targetValue CLOSE_BRACE ; /* 10 Annotations */ /* 10.1 Annotations of Ontologies, Axioms, and other Annotations */ annotation : ANNOTATION OPEN_BRACE annotationAnnotations annotationProperty annotationValue CLOSE_BRACE ; annotationAnnotations : annotation* ; annotationValue : anonymousIndividual | iri | literal ; /* 10.2 Annotation Axioms */ annotationAxiom : annotationAssertion | subAnnotationPropertyOf | annotationPropertyDomain | annotationPropertyRange ; /* 10.2.1 Annotation Assertion */ annotationAssertion : ANNOTATION_ASSERTION OPEN_BRACE axiomAnnotations annotationProperty annotationSubject annotationValue CLOSE_BRACE ; annotationSubject : iri | anonymousIndividual ; /* 10.2.2 Annotation Subproperties */ subAnnotationPropertyOf : SUB_ANNOTATION_PROPERTY_OF OPEN_BRACE axiomAnnotations subAnnotationProperty superAnnotationProperty CLOSE_BRACE ; subAnnotationProperty : annotationProperty ; superAnnotationProperty : annotationProperty ; /* 10.2.3 Annotation Property Domain */ annotationPropertyDomain : ANNOTATION_PROPERTY_DOMAIN OPEN_BRACE axiomAnnotations annotationProperty iri CLOSE_BRACE ; /* 10.2.4 Annotation Property Range */ annotationPropertyRange : ANNOTATION_PROPERTY_RANGE OPEN_BRACE axiomAnnotations annotationProperty iri CLOSE_BRACE ; Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLParsingHandlingContextBase.h0000644000175000017500000000410612520550742025566 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CXMLPARSINGHANDLINGCONTEXTBASE_H #define KONCLUDE_PARSER_CXMLPARSINGHANDLINGCONTEXTBASE_H // Libraries includes // Namespace includes #include "ParserSettings.h" #include "CParsingHandlingContext.h" #include "CXMLParsingHandlingContext.h" // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class CXMLHandlingContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CXMLParsingHandlingContextBase : public CXMLParsingHandlingContext { // public methods public: //! Constructor CXMLParsingHandlingContextBase(CXMLHandlerStack* xmlHandlerStack, CMemoryAllocationManager* memAllocManager); CXMLHandlerStack* getXMLHandlerStack(); virtual CMemoryAllocationManager* getMemoryAllocationManager(); // protected methods protected: // protected variables protected: CXMLHandlerStack* mXMLHandlerStack; CMemoryAllocationManager* mMemAllocManager; // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CXMLPARSINGHANDLINGCONTEXTBASE_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CCommandParser.h0000644000175000017500000000331512520550734022532 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CCOMMANDPARSER_H #define KONCLUDE_PARSER_CCOMMANDPARSER_H // Libraries includes #include #include // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class CCommandParser * \author Andreas Steigmiller * \version 0.1 * \brief Parser for OWL/XML Files * */ class CCommandParser { // public methods public: //! Constructor CCommandParser(); //! Destructor virtual ~CCommandParser(); virtual bool parse(const QByteArray &content) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CCOMMANDPARSER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLOWL2Handler.cpp0000644000175000017500000016247612520550740022747 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CXMLOWL2Handler.h" namespace Konclude { namespace Parser { CXMLOWL2Handler::CXMLOWL2Handler(COntologyBuilder* ontoBuilder) : CLogIdentifier("::Konclude::Parser::OWL2QtXMLOntologyParser",this),recordRouter(0,this) { mOntoBuilder = ontoBuilder; mAxiomNumber = 0; LOG(INFO,getLogDomain(),logTr("Created OWL 2.0 Qt XML Parser."),this); initializeParseFunctionJumpHash(); } CXMLOWL2Handler::CXMLOWL2Handler(COntologyBuilder* ontoBuilder, CCommandRecordRouter *commandRecordRouter) : CLogIdentifier("::Konclude::Parser::OWL2QtXMLOntologyParser",this),recordRouter(*commandRecordRouter,this) { mOntoBuilder = ontoBuilder; mAxiomNumber = 0; LOG(INFO,getLogDomain(),logTr("Created OWL 2.0 Qt XML Parser."),this); initializeParseFunctionJumpHash(); } bool CXMLOWL2Handler::startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts, CParsingHandlingContext* handlingContext) { mStack.push(new CParseStackObject(namespaceURI,localName,qName,atts)); return true; } bool CXMLOWL2Handler::endElement(const QString& namespaceURI, const QString& localName, const QString& qName, CParsingHandlingContext* handlingContext) { CParseStackObject* parseStackObject = mStack.pop(); parseBuildNode(parseStackObject); delete parseStackObject; return true; } bool CXMLOWL2Handler::startDocument(CParsingHandlingContext* handlingContext) { mStack.push(new CParseStackObject("","","",QXmlAttributes())); return true; } bool CXMLOWL2Handler::endDocument(CParsingHandlingContext* handlingContext) { if (mStack.count() > 0) { CParseStackObject* parseStackObject = mStack.pop(); parseTellOntologyAxiomNode(parseStackObject); delete parseStackObject; } return true; } void CXMLOWL2Handler::parseTellOntologyAxiomNode(CParseStackObject* parseStackObj) { if (mOntoBuilder && parseStackObj->hasExpressions()) { QList* expList = parseStackObj->getExpressions(); for (QList::const_iterator it = expList->constBegin(), itEnd = expList->constEnd(); it != itEnd; ++it) { CAxiomExpression* axiomExpression = dynamic_cast(*it); if (axiomExpression) { mOntoBuilder->tellOntologyAxiom(axiomExpression); } } } } void CXMLOWL2Handler::parseRetractOntologyAxiomNode(CParseStackObject* parseStackObj) { if (mOntoBuilder && parseStackObj->hasExpressions()) { QList* expList = parseStackObj->getExpressions(); for (QList::const_iterator it = expList->constBegin(), itEnd = expList->constEnd(); it != itEnd; ++it) { CAxiomExpression* axiomExpression = dynamic_cast(*it); if (axiomExpression) { mOntoBuilder->retractOntologyAxiom(axiomExpression); } } } } void CXMLOWL2Handler::parsePrefixNode(CParseStackObject* parseStackObj) { QString abbName = parseStackObj->mAtts.value(mNameString); QString totalIRIName = parseStackObj->mAtts.value(mIRIString); if (abbName.isEmpty()) { abbName = parseStackObj->mAtts.value(mOWLPrefixNameString); } if (totalIRIName.isEmpty()) { totalIRIName = parseStackObj->mAtts.value(mOWLPrefixIRIString); } if (!totalIRIName.isEmpty()) { mOntoBuilder->addNameAbbreviation(totalIRIName,abbName); } } QString CXMLOWL2Handler::getEntityName(CParseStackObject* parseStackObj) { QString entityName; bool abbreviated = false; QString attrNameString; attrNameString = parseStackObj->mAtts.value(mIRIString); if (attrNameString.isEmpty()) { attrNameString = parseStackObj->mAtts.value(mOWLPrefixIRIString); abbreviated = true; } if (attrNameString.isEmpty()) { attrNameString = parseStackObj->mAtts.value(mAbbreviatedIRIString); abbreviated = true; } if (attrNameString.isEmpty()) { attrNameString = parseStackObj->mAtts.value(mOWLPrefixAbbreviatedIRIString); abbreviated = true; } if (attrNameString.isEmpty()) { attrNameString = parseStackObj->mAtts.value(mURIString); abbreviated = true; } if (attrNameString.isEmpty()) { attrNameString = parseStackObj->mAtts.value(mOWLPrefixURIString); abbreviated = true; } if (abbreviated) { entityName = mOntoBuilder->resolveAbbreviationName(attrNameString); } else { entityName = attrNameString; } return entityName; } QString CXMLOWL2Handler::getCardinality(CParseStackObject* parseStackObj) { QString cardinalityString; cardinalityString = parseStackObj->mAtts.value(mCardinalityString); if (cardinalityString.isEmpty()) { cardinalityString = parseStackObj->mAtts.value(mOWLPrefixCardinalityString); } return cardinalityString; } QString CXMLOWL2Handler::getNodeID(CParseStackObject* parseStackObj) { QString nodeIDString; nodeIDString = parseStackObj->mAtts.value(mNodeIDString); if (nodeIDString.isEmpty()) { nodeIDString = parseStackObj->mAtts.value(mOWLPrefixNodeIDString); } return nodeIDString; } bool CXMLOWL2Handler::initializeParseFunctionJumpHash() { mOWLString = QString("http://www.w3.org/2002/07/owl#"); mOWLPrefixString = QString("owl"); mURIString = QString("URI"); mOWLPrefixURIString = mOWLPrefixString+QString(":")+mURIString; mIRIString = QString("IRI"); mOWLPrefixIRIString = mOWLPrefixString+QString(":")+mIRIString; mAbbreviatedIRIString = QString("abbreviatedIRI"); mOWLPrefixAbbreviatedIRIString = mOWLPrefixString+QString(":")+mAbbreviatedIRIString; mCardinalityString = QString("cardinality"); mOWLPrefixCardinalityString = mOWLPrefixString+QString(":")+mCardinalityString; mNodeIDString = QString("nodeID"); mOWLPrefixNodeIDString = mOWLPrefixString+QString(":")+mNodeIDString; mNameString = QString("name"); mOWLPrefixNameString = mOWLPrefixString+QString(":")+mNameString; mParseFunctionJumpHash.insert("Prefix",&CXMLOWL2Handler::jumpFunctionParsePrefixNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":Prefix",&CXMLOWL2Handler::jumpFunctionParsePrefixNode); mParseFunctionJumpHash.insert("Class",&CXMLOWL2Handler::jumpFunctionParseClassNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":Class",&CXMLOWL2Handler::jumpFunctionParseClassNode); mParseFunctionJumpHash.insert("OWLClass",&CXMLOWL2Handler::jumpFunctionParseClassNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":OWLClass",&CXMLOWL2Handler::jumpFunctionParseClassNode); mParseFunctionJumpHash.insert("ObjectProperty",&CXMLOWL2Handler::jumpFunctionParseObjectPropertyNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectProperty",&CXMLOWL2Handler::jumpFunctionParseObjectPropertyNode); mParseFunctionJumpHash.insert("IndividualVariable",&CXMLOWL2Handler::jumpFunctionParseIndividualVariable); mParseFunctionJumpHash.insert(mOWLPrefixString+":IndividualVariable",&CXMLOWL2Handler::jumpFunctionParseIndividualVariable); mParseFunctionJumpHash.insert("Variable",&CXMLOWL2Handler::jumpFunctionParseIndividualVariable); mParseFunctionJumpHash.insert(mOWLPrefixString+":Variable",&CXMLOWL2Handler::jumpFunctionParseIndividualVariable); mParseFunctionJumpHash.insert("Declaration",&CXMLOWL2Handler::jumpFunctionParseDeclarationNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":Declaration",&CXMLOWL2Handler::jumpFunctionParseDeclarationNode); mParseFunctionJumpHash.insert("SubClassOf",&CXMLOWL2Handler::jumpFunctionParseSubClassOfNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":SubClassOf",&CXMLOWL2Handler::jumpFunctionParseSubClassOfNode); mParseFunctionJumpHash.insert("EquivalentClasses",&CXMLOWL2Handler::jumpFunctionParseEquivalentClassesNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":EquivalentClasses",&CXMLOWL2Handler::jumpFunctionParseEquivalentClassesNode); mParseFunctionJumpHash.insert("DisjointClasses",&CXMLOWL2Handler::jumpFunctionParseDisjontClassesNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":DisjointClasses",&CXMLOWL2Handler::jumpFunctionParseDisjontClassesNode); mParseFunctionJumpHash.insert("DisjointUnion",&CXMLOWL2Handler::jumpFunctionParseDisjontUnionNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":DisjointUnion",&CXMLOWL2Handler::jumpFunctionParseDisjontUnionNode); mParseFunctionJumpHash.insert("SubObjectPropertyOf",&CXMLOWL2Handler::jumpFunctionParseSubObjectPropertyOfNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":SubObjectPropertyOf",&CXMLOWL2Handler::jumpFunctionParseSubObjectPropertyOfNode); mParseFunctionJumpHash.insert("ObjectPropertyChain",&CXMLOWL2Handler::jumpFunctionParseObjectPropertyChainNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectPropertyChain",&CXMLOWL2Handler::jumpFunctionParseObjectPropertyChainNode); mParseFunctionJumpHash.insert("EquivalentObjectProperties",&CXMLOWL2Handler::jumpFunctionParseEquivalentObjectPropertiesNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":EquivalentObjectProperties",&CXMLOWL2Handler::jumpFunctionParseEquivalentObjectPropertiesNode); mParseFunctionJumpHash.insert("DisjointObjectProperties",&CXMLOWL2Handler::jumpFunctionParseDisjointObjectPropertiesNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":DisjointObjectProperties",&CXMLOWL2Handler::jumpFunctionParseDisjointObjectPropertiesNode); mParseFunctionJumpHash.insert("ObjectInverseOf",&CXMLOWL2Handler::jumpFunctionParseInverseObjectPropertyOfNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectInverseOf",&CXMLOWL2Handler::jumpFunctionParseInverseObjectPropertyOfNode); mParseFunctionJumpHash.insert("InverseObjectProperties",&CXMLOWL2Handler::jumpFunctionParseInverseObjectPropertiesNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":InverseObjectProperties",&CXMLOWL2Handler::jumpFunctionParseInverseObjectPropertiesNode); mParseFunctionJumpHash.insert("ObjectPropertyRange",&CXMLOWL2Handler::jumpFunctionParseObjectPropertyRangeNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectPropertyRange",&CXMLOWL2Handler::jumpFunctionParseObjectPropertyRangeNode); mParseFunctionJumpHash.insert("ObjectPropertyDomain",&CXMLOWL2Handler::jumpFunctionParseObjectPropertyDomainNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectPropertyDomain",&CXMLOWL2Handler::jumpFunctionParseObjectPropertyDomainNode); mParseFunctionJumpHash.insert("TransitiveObjectProperty",&CXMLOWL2Handler::jumpFunctionParseTransetiveObjectPropertyNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":TransitiveObjectProperty",&CXMLOWL2Handler::jumpFunctionParseTransetiveObjectPropertyNode); mParseFunctionJumpHash.insert("FunctionalObjectProperty",&CXMLOWL2Handler::jumpFunctionParseFunctionalObjectPropertyNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":FunctionalObjectProperty",&CXMLOWL2Handler::jumpFunctionParseFunctionalObjectPropertyNode); mParseFunctionJumpHash.insert("SymmetricObjectProperty",&CXMLOWL2Handler::jumpFunctionParseSymmetricObjectPropertyNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":SymmetricObjectProperty",&CXMLOWL2Handler::jumpFunctionParseSymmetricObjectPropertyNode); mParseFunctionJumpHash.insert("AsymmetricObjectProperty",&CXMLOWL2Handler::jumpFunctionParseAsymmetricObjectPropertyNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":AsymmetricObjectProperty",&CXMLOWL2Handler::jumpFunctionParseAsymmetricObjectPropertyNode); mParseFunctionJumpHash.insert("ReflexiveObjectProperty",&CXMLOWL2Handler::jumpFunctionParseReflexiveObjectPropertyNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ReflexiveObjectProperty",&CXMLOWL2Handler::jumpFunctionParseReflexiveObjectPropertyNode); mParseFunctionJumpHash.insert("IrreflexiveObjectProperty",&CXMLOWL2Handler::jumpFunctionParseIrreflexiveObjectPropertyNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":IrreflexiveObjectProperty",&CXMLOWL2Handler::jumpFunctionParseIrreflexiveObjectPropertyNode); mParseFunctionJumpHash.insert("InverseFunctionalObjectProperty",&CXMLOWL2Handler::jumpFunctionParseInverseFunctionalObjectPropertyNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":InverseFunctionalObjectProperty",&CXMLOWL2Handler::jumpFunctionParseInverseFunctionalObjectPropertyNode); mParseFunctionJumpHash.insert("ObjectIntersectionOf",&CXMLOWL2Handler::jumpFunctionParseObjectIntersectionOfNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectIntersectionOf",&CXMLOWL2Handler::jumpFunctionParseObjectIntersectionOfNode); mParseFunctionJumpHash.insert("ObjectUnionOf",&CXMLOWL2Handler::jumpFunctionParseObjectUnionOfNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectUnionOf",&CXMLOWL2Handler::jumpFunctionParseObjectUnionOfNode); mParseFunctionJumpHash.insert("ObjectMaxCardinality",&CXMLOWL2Handler::jumpFunctionParseObjectMaxCardinalityNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectMaxCardinality",&CXMLOWL2Handler::jumpFunctionParseObjectMaxCardinalityNode); mParseFunctionJumpHash.insert("ObjectMinCardinality",&CXMLOWL2Handler::jumpFunctionParseObjectMinCardinalityNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectMinCardinality",&CXMLOWL2Handler::jumpFunctionParseObjectMinCardinalityNode); mParseFunctionJumpHash.insert("ObjectExactCardinality",&CXMLOWL2Handler::jumpFunctionParseObjectExactlyCardinalityNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectExactCardinality",&CXMLOWL2Handler::jumpFunctionParseObjectExactlyCardinalityNode); mParseFunctionJumpHash.insert("ObjectSomeValuesFrom",&CXMLOWL2Handler::jumpFunctionParseObjectSomeValuesFromNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectSomeValuesFrom",&CXMLOWL2Handler::jumpFunctionParseObjectSomeValuesFromNode); mParseFunctionJumpHash.insert("ObjectAllValuesFrom",&CXMLOWL2Handler::jumpFunctionParseObjectAllValuesFromNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectAllValuesFrom",&CXMLOWL2Handler::jumpFunctionParseObjectAllValuesFromNode); mParseFunctionJumpHash.insert("ObjectComplementOf",&CXMLOWL2Handler::jumpFunctionParseObjectComplementOfNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectComplementOf",&CXMLOWL2Handler::jumpFunctionParseObjectComplementOfNode); mParseFunctionJumpHash.insert("ObjectOneOf",&CXMLOWL2Handler::jumpFunctionParseObjectOneOfNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectOneOf",&CXMLOWL2Handler::jumpFunctionParseObjectOneOfNode); mParseFunctionJumpHash.insert("ObjectHasValue",&CXMLOWL2Handler::jumpFunctionParseObjectHasValueNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectHasValue",&CXMLOWL2Handler::jumpFunctionParseObjectHasValueNode); mParseFunctionJumpHash.insert("ObjectHasSelf",&CXMLOWL2Handler::jumpFunctionParseObjectHasSelfNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectHasSelf",&CXMLOWL2Handler::jumpFunctionParseObjectHasSelfNode); mParseFunctionJumpHash.insert("NamedIndividual",&CXMLOWL2Handler::jumpFunctionParseNamedIndividualNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":NamedIndividual",&CXMLOWL2Handler::jumpFunctionParseNamedIndividualNode); mParseFunctionJumpHash.insert("AnonymousIndividual",&CXMLOWL2Handler::jumpFunctionParseAnonymousIndividualNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":AnonymousIndividual",&CXMLOWL2Handler::jumpFunctionParseAnonymousIndividualNode); mParseFunctionJumpHash.insert("ClassAssertion",&CXMLOWL2Handler::jumpFunctionParseClassAssertionNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ClassAssertion",&CXMLOWL2Handler::jumpFunctionParseClassAssertionNode); mParseFunctionJumpHash.insert("ObjectPropertyAssertion",&CXMLOWL2Handler::jumpFunctionParseObjectPropertyAssertionNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectPropertyAssertion",&CXMLOWL2Handler::jumpFunctionParseObjectPropertyAssertionNode); mParseFunctionJumpHash.insert("NegativeObjectPropertyAssertion",&CXMLOWL2Handler::jumpFunctionParseNegativeObjectPropertyAssertionNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":NegativeObjectPropertyAssertion",&CXMLOWL2Handler::jumpFunctionParseNegativeObjectPropertyAssertionNode); mParseFunctionJumpHash.insert("SameIndividual",&CXMLOWL2Handler::jumpFunctionParseSameIndividualNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":SameIndividual",&CXMLOWL2Handler::jumpFunctionParseSameIndividualNode); mParseFunctionJumpHash.insert("DifferentIndividuals",&CXMLOWL2Handler::jumpFunctionParseDifferentIndividualsNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":DifferentIndividuals",&CXMLOWL2Handler::jumpFunctionParseDifferentIndividualsNode); mParseFunctionJumpHash.insert("#text",&CXMLOWL2Handler::jumpFunctionParseIgnoredNode); mParseFunctionJumpHash.insert("#comment",&CXMLOWL2Handler::jumpFunctionParseIgnoredNode); mParseFunctionJumpHash.insert("ExpectedResult",&CXMLOWL2Handler::jumpFunctionParseIgnoredNode); mParseFunctionJumpHash.insert("Ontology",&CXMLOWL2Handler::jumpFunctionTellOntologyAxiomNode); mParseFunctionJumpHash.insert("Tell",&CXMLOWL2Handler::jumpFunctionTellOntologyAxiomNode); mParseFunctionJumpHash.insert("Whereby",&CXMLOWL2Handler::jumpFunctionTellOntologyAxiomNode); mParseFunctionJumpHash.insert("Retract",&CXMLOWL2Handler::jumpFunctionRetractOntologyAxiomNode); mParseFunctionJumpHash.insert("DLSafeRule",&CXMLOWL2Handler::jumpFunctionParseRuleNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":DLSafeRule",&CXMLOWL2Handler::jumpFunctionParseRuleNode); mParseFunctionJumpHash.insert("Head",&CXMLOWL2Handler::jumpFunctionParseRuleAtomHeadNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":Head",&CXMLOWL2Handler::jumpFunctionParseRuleAtomHeadNode); mParseFunctionJumpHash.insert("Body",&CXMLOWL2Handler::jumpFunctionParseRuleAtomBodyNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":Body",&CXMLOWL2Handler::jumpFunctionParseRuleAtomBodyNode); mParseFunctionJumpHash.insert("ObjectPropertyAtom",&CXMLOWL2Handler::jumpFunctionParseRulePropertyAtomNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ObjectPropertyAtom",&CXMLOWL2Handler::jumpFunctionParseRulePropertyAtomNode); mParseFunctionJumpHash.insert("ClassAtom",&CXMLOWL2Handler::jumpFunctionParseRuleClassAtomNode); mParseFunctionJumpHash.insert(mOWLPrefixString+":ClassAtom",&CXMLOWL2Handler::jumpFunctionParseRuleClassAtomNode); return true; } CRulePropertyAtomTermExpression* CXMLOWL2Handler::parseRuleObjectPropertyAtomNode(CParseStackObject* parseStackObj) { CRulePropertyAtomTermExpression* rulePropertyAtomExp = nullptr; if (parseStackObj->hasExpressions()) { CParsingExpressionSplitter mParsingExpSpl(parseStackObj->getExpressions()); if (mParsingExpSpl.proofExpressionComposition(0,1,0,2,0)) { rulePropertyAtomExp = new CRulePropertyAtomTermExpression(mParsingExpSpl.getFirstClassVariableTermExpression(),mParsingExpSpl.getSecondClassVariableTermExpression(),mParsingExpSpl.getFirstObjectPropertyTermExpression()); mRuleExpContainer.append(rulePropertyAtomExp); } } return rulePropertyAtomExp; } CRuleClassAtomTermExpression* CXMLOWL2Handler::parseRuleClassAtomNode(CParseStackObject* parseStackObj) { CRuleClassAtomTermExpression* ruleClassAtomExp = nullptr; if (parseStackObj->hasExpressions()) { CParsingExpressionSplitter mParsingExpSpl(parseStackObj->getExpressions()); if (mParsingExpSpl.proofExpressionComposition(2,0,0,1,1)) { ruleClassAtomExp = new CRuleClassAtomTermExpression(mParsingExpSpl.getFirstClassTermExpression(),mParsingExpSpl.getFirstClassVariableTermExpression()); mRuleExpContainer.append(ruleClassAtomExp); } } return ruleClassAtomExp; } CRuleAtomListBodyExpression* CXMLOWL2Handler::parseRuleAtomBodyNode(CParseStackObject* parseStackObj) { CRuleAtomListBodyExpression* ruleAtomBodyExp = nullptr; if (parseStackObj->hasExpressions()) { QList* expList = &parseStackObj->mExpList; QList atomExpList; for (QList::const_iterator it = expList->constBegin(), itEnd = expList->constEnd(); it != itEnd; ++it) { CRuleAtomTermExpression* ruleAtTeExp = dynamic_cast(*it); if (ruleAtTeExp) { atomExpList.append(ruleAtTeExp); } } if (!atomExpList.isEmpty()) { ruleAtomBodyExp = new CRuleAtomListBodyExpression(atomExpList); mRuleExpContainer.append(ruleAtomBodyExp); } } return ruleAtomBodyExp; } CRuleAtomListHeadExpression* CXMLOWL2Handler::parseRuleAtomHeadNode(CParseStackObject* parseStackObj) { CRuleAtomListHeadExpression* ruleAtomHeadExp = nullptr; if (parseStackObj->hasExpressions()) { QList* expList = &parseStackObj->mExpList; QList atomExpList; for (QList::const_iterator it = expList->constBegin(), itEnd = expList->constEnd(); it != itEnd; ++it) { CRuleAtomTermExpression* ruleAtTeExp = dynamic_cast(*it); if (ruleAtTeExp) { atomExpList.append(ruleAtTeExp); } } if (!atomExpList.isEmpty()) { ruleAtomHeadExp = new CRuleAtomListHeadExpression(atomExpList); mRuleExpContainer.append(ruleAtomHeadExp); } } return ruleAtomHeadExp; } QHash CXMLOWL2Handler::createVariableAtomHash(const QList& atomList) { QHash variableAtomHash; foreach (CParseRuleAtom* atom, atomList) { if (!atom->mVariableName1.isEmpty()) { variableAtomHash.insertMulti(atom->mVariableName1,atom); } if (!atom->mVariableName2.isEmpty()) { variableAtomHash.insertMulti(atom->mVariableName2,atom); } } return variableAtomHash; } QMap CXMLOWL2Handler::createVariableCountMap(const QList& atomList) { QHash variableCountHash; foreach (CParseRuleAtom* atom, atomList) { if (!atom->mVariableName1.isEmpty()) { cint64 prevCount = variableCountHash.value(atom->mVariableName1,0); variableCountHash.insert(atom->mVariableName1,prevCount+1); } if (!atom->mVariableName2.isEmpty()) { cint64 prevCount = variableCountHash.value(atom->mVariableName2,0); variableCountHash.insert(atom->mVariableName2,prevCount+1); } } QMap countVariableMap; for (QHash::const_iterator it = variableCountHash.constBegin(), itEnd = variableCountHash.constEnd(); it != itEnd; ++it) { const QString& variableName = it.key(); cint64 variableAtomCount = it.value(); countVariableMap.insertMulti(variableAtomCount,variableName); } return countVariableMap; } QList CXMLOWL2Handler::parseRuleAtomNodes(CParseStackObject* parseStackObj, const CQtList& buildExpList, bool parseHeadAtoms) { QList atomList; for (CQtList::const_iterator it1 = buildExpList.constBegin(), it1End = buildExpList.constEnd(); it1 != it1End; ++it1) { CRuleAtomListExpression* buildListExp = nullptr; CRuleAtomListBodyExpression* buildBodyListExp = dynamic_cast(*it1); CRuleAtomListHeadExpression* buildHeadListExp = dynamic_cast(*it1); if (parseHeadAtoms) { buildListExp = buildHeadListExp; } if (!parseHeadAtoms) { buildListExp = buildBodyListExp; } if (buildListExp) { CEXPRESSIONLIST* ruleAtomExpList = buildListExp->getRuleAtomTermExpressionList(); for (CEXPRESSIONLIST::const_iterator it2 = ruleAtomExpList->constBegin(), it2End = ruleAtomExpList->constEnd(); it2 != it2End; ++it2) { CRuleAtomTermExpression* ruleAtomExp = *it2; CParseRuleAtom* ruleAtom = nullptr; if (ruleAtomExp->getType() == CBuildExpression::BETRULEPROPERTYATOM) { CRulePropertyAtomTermExpression* rulePropertyAtomExp = (CRulePropertyAtomTermExpression*)ruleAtomExp; CEXPRESSIONLIST* varList = rulePropertyAtomExp->getClassVariableTermExpressionList(); ruleAtom = new CParseRuleAtom(CParseRuleAtom::PROPERTYATOM); ruleAtom->mVariableName1 = varList->first()->getName(); ruleAtom->mVariableName2 = varList->last()->getName(); ruleAtom->mAtomExpression = rulePropertyAtomExp->getObjectPropertyTermExpression(); atomList.append(ruleAtom); } else if (ruleAtomExp->getType() == CBuildExpression::BETRULECLASSATOM) { CRuleClassAtomTermExpression* ruleClassAtomExp = (CRuleClassAtomTermExpression*)ruleAtomExp; ruleAtom = new CParseRuleAtom(CParseRuleAtom::CLASSATOM); ruleAtom->mVariableName1 = ruleClassAtomExp->getClassVariableExpression()->getName(); ruleAtom->mAtomExpression = ruleClassAtomExp->getClassTermExpression(); atomList.append(ruleAtom); } } } } return atomList; } void CXMLOWL2Handler::parseRuleNode(CParseStackObject* parseStackObj) { if (parseStackObj->hasExpressions()) { QList expressionList; QHash bodyVariableAtomHash; QHash headVariableAtomHash; CQtList buildExpList(*parseStackObj->getExpressions()); QList bodyVariableAtomList = parseRuleAtomNodes(parseStackObj,buildExpList,false); QList headVariableAtomList = parseRuleAtomNodes(parseStackObj,buildExpList,true); bodyVariableAtomHash = createVariableAtomHash(bodyVariableAtomList); headVariableAtomHash = createVariableAtomHash(headVariableAtomList); QMap headCountVariableMap = createVariableCountMap(headVariableAtomList); QSet headProcessedAtomSet; QList reversHeadCountVariableList; for (QMap::const_iterator it = headCountVariableMap.constBegin(), itEnd = headCountVariableMap.constEnd(); it != itEnd; ++it) { const QString& varString = it.value(); reversHeadCountVariableList.prepend(varString); } for (QList::const_iterator it = reversHeadCountVariableList.constBegin(), itEnd = reversHeadCountVariableList.constEnd(); it != itEnd; ++it) { const QString& varString = *it; QSet processedBodyAtoms; QList headAtomList = headVariableAtomHash.values(varString); QList headExpressionList; foreach (CParseRuleAtom* headAtom, headAtomList) { if (!headProcessedAtomSet.contains(headAtom)) { headProcessedAtomSet.insert(headAtom); if (headAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) { bool inversed = false; QString otherVarString = headAtom->getOtherVariable(varString,inversed); CBuildExpression* otherVarExp = mOntoBuilder->getIndividualVariable(otherVarString,mAxiomNumber); CBuildExpression* someExp = mOntoBuilder->getObjectSomeValuesFrom(getNeighbourAtomObjectPropertyExpression(headAtom,inversed),otherVarExp); headExpressionList.append(someExp); } else if (headAtom->mAtomType == CParseRuleAtom::CLASSATOM) { headExpressionList.append(headAtom->mAtomExpression); } } } if (!headExpressionList.isEmpty()) { CBuildExpression* headExp = nullptr; if (headExpressionList.count() >= 2) { headExp = mOntoBuilder->getObjectIntersectionOf(headExpressionList); } else { headExp = headExpressionList.first(); } CBuildExpression* bodyExp = createBodyExpresions(varString,bodyVariableAtomHash,headVariableAtomHash); CBuildExpression* axiomExp = mOntoBuilder->getSubClassOf(bodyExp,headExp); expressionList.append(axiomExp); } ++mAxiomNumber; } addTemporaryBuildExpressions(&expressionList); } } CBuildExpression* CXMLOWL2Handler::createBodyExpresions(const QString& varString, QHash& bodyVariableAtomHash, QHash& headVariableAtomHash) { QSet processedVarSet; QSet processedAtomSet; QList expList; CBuildExpression* mainExp = createBodyExpresions(varString,true,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash); expList.append(mainExp); for (QHash::const_iterator it = bodyVariableAtomHash.constBegin(), itEnd = bodyVariableAtomHash.constEnd(); it != itEnd; ++it) { QString nextVarString = it.key(); if (!processedVarSet.contains(nextVarString)) { CBuildExpression* topPropExp = mOntoBuilder->getTopObjectProberty(); CBuildExpression* succExp = createBodyExpresions(nextVarString,true,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash); CBuildExpression* someExp = mOntoBuilder->getObjectSomeValuesFrom(topPropExp,succExp); expList.append(someExp); } } if (expList.count() >= 2) { return mOntoBuilder->getObjectIntersectionOf(expList); } return expList.first(); } CBuildExpression* CXMLOWL2Handler::getNeighbourAtomObjectPropertyExpression(CParseRuleAtom* ruleAtom, bool inversed) { if (!inversed) { return ruleAtom->mAtomExpression; } else { return mOntoBuilder->getInverseObjectPropertyOf(ruleAtom->mAtomExpression); } } bool CXMLOWL2Handler::hasBackExpressionLinks(const QString& varString, CParseRuleAtom* notRuleAtom, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash) { QSet backTestProcessedVarSet; QSet backTestProcessedAtomSet; return hasBackExpressionLinks(varString,notRuleAtom,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash,backTestProcessedVarSet,backTestProcessedAtomSet); } bool CXMLOWL2Handler::hasBackExpressionLinks(const QString& varString, CParseRuleAtom* notRuleAtom, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash, QSet& backTestProcessedVarSet, QSet& backTestProcessedAtomSet) { if (processedVarSet.contains(varString)) { return false; } if (!backTestProcessedVarSet.contains(varString)) { backTestProcessedVarSet.insert(varString); QList atomList = bodyVariableAtomHash.values(varString); foreach (CParseRuleAtom* ruleAtom, atomList) { if (ruleAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) { if (ruleAtom != notRuleAtom) { if (processedAtomSet.contains(ruleAtom)) { return true; } if (!backTestProcessedAtomSet.contains(ruleAtom)) { backTestProcessedAtomSet.insert(ruleAtom); bool inversed = false; QString otherVarString = ruleAtom->getOtherVariable(varString,inversed); if (hasBackExpressionLinks(otherVarString,ruleAtom,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash,backTestProcessedVarSet,backTestProcessedAtomSet)) { return true; } } } } } } return false; } CBuildExpression* CXMLOWL2Handler::createBodyExpresions(const QString& varString, bool direct, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash) { QList expList; expList.append(mOntoBuilder->getIndividualVariable(varString,mAxiomNumber)); if (!processedVarSet.contains(varString)) { processedVarSet.insert(varString); QList atomList = bodyVariableAtomHash.values(varString); QList processList; foreach (CParseRuleAtom* ruleAtom, atomList) { if (ruleAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) { if (!processedAtomSet.contains(ruleAtom)) { bool inversed = false; QString otherVarString = ruleAtom->getOtherVariable(varString,inversed); if (direct || !headVariableAtomHash.contains(varString) || !hasBackExpressionLinks(otherVarString,ruleAtom,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash)) { processedAtomSet.insert(ruleAtom); processList.append(ruleAtom); } } } else if (ruleAtom->mAtomType == CParseRuleAtom::CLASSATOM) { processList.append(ruleAtom); } } foreach (CParseRuleAtom* ruleAtom, processList) { if (ruleAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) { bool inversed = false; QString otherVarString = ruleAtom->getOtherVariable(varString,inversed); CBuildExpression* succExp = createBodyExpresions(otherVarString,false,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash); CBuildExpression* someExp = mOntoBuilder->getObjectSomeValuesFrom(getNeighbourAtomObjectPropertyExpression(ruleAtom,inversed),succExp); expList.append(someExp); } else if (ruleAtom->mAtomType == CParseRuleAtom::CLASSATOM) { expList.append(ruleAtom->mAtomExpression); } } } if (expList.count() >= 2) { return mOntoBuilder->getObjectIntersectionOf(expList); } return expList.first(); } void CXMLOWL2Handler::parseBuildNode(CParseStackObject* parseStackObj) { const QString& nodeString(parseStackObj->mQName); ParseFunction function = mParseFunctionJumpHash.value(nodeString); if (function) { (this->*function)(parseStackObj); if (!mStack.isEmpty() && !mTmpExpList.isEmpty()) { CParseStackObject* topParsStackObj = mStack.top(); topParsStackObj->addBuildExpressions(&mTmpExpList); } } else { const QString& notSupportedNodeString(nodeString); CNotSupportedNodeErrorRecord::makeRecord(notSupportedNodeString,&recordRouter); } mTmpExpList.clear(); } CDeclarationAxiomExpression* CXMLOWL2Handler::parseDeclarationNode(CParseStackObject* parseStackObj) { CDeclarationAxiomExpression* declarationExpression = nullptr; if (parseStackObj->hasExpressions()) { declarationExpression = mOntoBuilder->getDeclaration(*parseStackObj->getExpressions()); ++mAxiomNumber; } return declarationExpression; } CObjectPropertyExpression *CXMLOWL2Handler::parseObjectPropertyNode(CParseStackObject* parseStackObj) { const QString& probName = getEntityName(parseStackObj); CObjectPropertyExpression *objectExpression = 0; if (!probName.isEmpty()) { objectExpression = mOntoBuilder->getObjectProberty(probName); } return objectExpression; } CClassExpression *CXMLOWL2Handler::parseClassNode(CParseStackObject* parseStackObj) { const QString& className = getEntityName(parseStackObj); CClassExpression *classExpression = 0; if (!className.isEmpty()) { classExpression = mOntoBuilder->getClass(className); } return classExpression; } CObjectIndividualVariableExpression* CXMLOWL2Handler::parseIndividualVariableNode(CParseStackObject* parseStackObj) { const QString& indiVarName = getEntityName(parseStackObj); CObjectIndividualVariableExpression *indiVarExpression = 0; if (!indiVarName.isEmpty()) { indiVarExpression = mOntoBuilder->getIndividualVariable(indiVarName,mAxiomNumber); } return indiVarExpression; } CEquivalentClassesExpression *CXMLOWL2Handler::parseEquivalentClassesNode(CParseStackObject* parseStackObj) { CEquivalentClassesExpression *ecExp = 0; if (parseStackObj->hasExpressions()) { ecExp = mOntoBuilder->getEquivalentClasses(*parseStackObj->getExpressions()); ++mAxiomNumber; } return ecExp; } CSubClassOfExpression *CXMLOWL2Handler::parseSubClassOfNode(CParseStackObject* parseStackObj) { CSubClassOfExpression *scoExp = 0; if (parseStackObj->hasExpressions()) { scoExp = mOntoBuilder->getSubClassOf(*parseStackObj->getExpressions()); ++mAxiomNumber; } return scoExp; } CObjectPropertyDomainExpression *CXMLOWL2Handler::parseObjectPropertyDomainNode(CParseStackObject* parseStackObj) { CObjectPropertyDomainExpression *obPrDoExp = 0; if (parseStackObj->hasExpressions()) { obPrDoExp = mOntoBuilder->getObjectPropertyDomainExpression(*parseStackObj->getExpressions()); ++mAxiomNumber; } return obPrDoExp; } CObjectPropertyRangeExpression *CXMLOWL2Handler::parseObjectPropertyRangeNode(CParseStackObject* parseStackObj) { CObjectPropertyRangeExpression *obPrRaExp = 0; if (parseStackObj->hasExpressions()) { obPrRaExp = mOntoBuilder->getObjectPropertyRangeExpression(*parseStackObj->getExpressions()); ++mAxiomNumber; } return obPrRaExp; } CSubObjectPropertyOfExpression *CXMLOWL2Handler::parseSubObjectPropertyOfNode(CParseStackObject* parseStackObj) { CSubObjectPropertyOfExpression *sopoExp = 0; if (parseStackObj->hasExpressions()) { sopoExp = mOntoBuilder->getSubObjectPropertyOf(*parseStackObj->getExpressions()); ++mAxiomNumber; } return sopoExp; } CObjectPropertyChainExpression *CXMLOWL2Handler::parseObjectPropertyChainNode(CParseStackObject* parseStackObj) { CObjectPropertyChainExpression *sopoExp = 0; if (parseStackObj->hasExpressions()) { sopoExp = mOntoBuilder->getObjectPropertyChain(*parseStackObj->getExpressions()); } return sopoExp; } CEquivalentObjectPropertiesExpression *CXMLOWL2Handler::parseEquivalentObjectPropertiesNode(CParseStackObject* parseStackObj) { CEquivalentObjectPropertiesExpression *sopoExp = 0; if (parseStackObj->hasExpressions()) { sopoExp = mOntoBuilder->getEquivalentObjectProperties(*parseStackObj->getExpressions()); ++mAxiomNumber; } return sopoExp; } CDisjointObjectPropertiesExpression *CXMLOWL2Handler::parseDisjointObjectPropertiesNode(CParseStackObject* parseStackObj) { CDisjointObjectPropertiesExpression *sopoExp = 0; if (parseStackObj->hasExpressions()) { sopoExp = mOntoBuilder->getDisjointObjectProperties(*parseStackObj->getExpressions()); ++mAxiomNumber; } return sopoExp; } CInverseObjectPropertyOfExpression *CXMLOWL2Handler::parseInverseObjectPropertyOfNode(CParseStackObject* parseStackObj) { CInverseObjectPropertyOfExpression *iopoExp = 0; if (parseStackObj->hasExpressions()) { iopoExp = mOntoBuilder->getInverseObjectPropertyOf(*parseStackObj->getExpressions()); } return iopoExp; } CInverseObjectPropertiesExpression *CXMLOWL2Handler::parseInverseObjectPropertiesNode(CParseStackObject* parseStackObj) { CInverseObjectPropertiesExpression *iopoExp = 0; if (parseStackObj->hasExpressions()) { iopoExp = mOntoBuilder->getInverseObjectProperties(*parseStackObj->getExpressions()); ++mAxiomNumber; } return iopoExp; } CDisjointClassesExpression *CXMLOWL2Handler::parseDisjontClassesNode(CParseStackObject* parseStackObj) { CDisjointClassesExpression *disClassExp = 0; if (parseStackObj->hasExpressions()) { disClassExp = mOntoBuilder->getDisjointClasses(*parseStackObj->getExpressions()); ++mAxiomNumber; } return disClassExp; } CDisjointUnionExpression *CXMLOWL2Handler::parseDisjontUnionNode(CParseStackObject* parseStackObj) { CDisjointUnionExpression *disClassExp = 0; if (parseStackObj->hasExpressions()) { disClassExp = mOntoBuilder->getDisjointUnion(*parseStackObj->getExpressions()); } return disClassExp; } CObjectIntersectionOfExpression *CXMLOWL2Handler::parseObjectIntersectionOfNode(CParseStackObject* parseStackObj) { CObjectIntersectionOfExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectIntersectionOf(*parseStackObj->getExpressions()); } return exp; } CObjectUnionOfExpression *CXMLOWL2Handler::parseObjectUnionOfNode(CParseStackObject* parseStackObj) { CObjectUnionOfExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectUnionOf(*parseStackObj->getExpressions()); } return exp; } CObjectMaxCardinalityExpression *CXMLOWL2Handler::parseObjectMaxCardinalityNode(CParseStackObject* parseStackObj) { QString cardinalityName = getCardinality(parseStackObj); CObjectMaxCardinalityExpression *exp = 0; if (!cardinalityName.isEmpty()) { exp = mOntoBuilder->getObjectMaxCardinality(*parseStackObj->getExpressions(),cardinalityName.toInt()); } return exp; } CObjectMinCardinalityExpression *CXMLOWL2Handler::parseObjectMinCardinalityNode(CParseStackObject* parseStackObj) { QString cardinalityName = getCardinality(parseStackObj); CObjectMinCardinalityExpression *exp = 0; if (!cardinalityName.isEmpty()) { exp = mOntoBuilder->getObjectMinCardinality(*parseStackObj->getExpressions(),cardinalityName.toInt()); } return exp; } CObjectExactlyCardinalityExpression *CXMLOWL2Handler::parseObjectExactlyCardinalityNode(CParseStackObject* parseStackObj) { QString cardinalityName = getCardinality(parseStackObj); CObjectExactlyCardinalityExpression *exp = 0; if (!cardinalityName.isEmpty()) { exp = mOntoBuilder->getObjectExactlyCardinality(*parseStackObj->getExpressions(),cardinalityName.toInt()); } return exp; } CObjectSomeValuesFromExpression *CXMLOWL2Handler::parseObjectSomeValuesFromNode(CParseStackObject* parseStackObj) { CObjectSomeValuesFromExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectSomeValuesFrom(*parseStackObj->getExpressions()); } return exp; } CObjectHasValueExpression* CXMLOWL2Handler::parseObjectHasValueNode(CParseStackObject* parseStackObj) { CObjectHasValueExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectHasValue(*parseStackObj->getExpressions()); } return exp; } CObjectHasSelfExpression* CXMLOWL2Handler::parseObjectHasSelfNode(CParseStackObject* parseStackObj) { CObjectHasSelfExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectHasSelf(*parseStackObj->getExpressions()); } return exp; } CObjectAllValuesFromExpression *CXMLOWL2Handler::parseObjectAllValuesFromNode(CParseStackObject* parseStackObj) { CObjectAllValuesFromExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectAllValuesFrom(*parseStackObj->getExpressions()); } return exp; } CObjectComplementOfExpression *CXMLOWL2Handler::parseObjectComplementOfNode(CParseStackObject* parseStackObj) { CObjectComplementOfExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectComplementOf(*parseStackObj->getExpressions()); } return exp; } CObjectOneOfExpression *CXMLOWL2Handler::parseObjectOneOfNode(CParseStackObject* parseStackObj) { CObjectOneOfExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectOneOf(*parseStackObj->getExpressions()); } return exp; } CTransetiveObjectPropertyExpression *CXMLOWL2Handler::parseTransetiveObjectPropertyNode(CParseStackObject* parseStackObj) { CTransetiveObjectPropertyExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getTransetiveObjectProperty(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CFunctionalObjectPropertyExpression *CXMLOWL2Handler::parseFunctionalObjectPropertyNode(CParseStackObject* parseStackObj) { CFunctionalObjectPropertyExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getFunctionalObjectProperty(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CSymmetricObjectPropertyExpression* CXMLOWL2Handler::parseSymmetricObjectPropertyNode(CParseStackObject* parseStackObj) { CSymmetricObjectPropertyExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getSymmetricObjectProperty(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CAsymmetricObjectPropertyExpression* CXMLOWL2Handler::parseAsymmetricObjectPropertyNode(CParseStackObject* parseStackObj) { CAsymmetricObjectPropertyExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getAsymmetricObjectProperty(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CReflexiveObjectPropertyExpression* CXMLOWL2Handler::parseReflexiveObjectPropertyNode(CParseStackObject* parseStackObj) { CReflexiveObjectPropertyExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getReflexiveObjectProperty(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CIrreflexiveObjectPropertyExpression* CXMLOWL2Handler::parseIrreflexiveObjectPropertyNode(CParseStackObject* parseStackObj) { CIrreflexiveObjectPropertyExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getIrreflexiveObjectProperty(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CInverseFunctionalObjectPropertyExpression* CXMLOWL2Handler::parseInverseFunctionalObjectPropertyNode(CParseStackObject* parseStackObj) { CInverseFunctionalObjectPropertyExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getInverseFunctionalObjectProperty(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CClassAssertionExpression *CXMLOWL2Handler::parseClassAssertionNode(CParseStackObject* parseStackObj) { CClassAssertionExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getClassAssertion(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CSameIndividualExpression *CXMLOWL2Handler::parseSameIndividualNode(CParseStackObject* parseStackObj) { CSameIndividualExpression *exp = 0; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getSameIndividual(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CDifferentIndividualsExpression *CXMLOWL2Handler::parseDifferentIndividualsNode(CParseStackObject* parseStackObj) { CDifferentIndividualsExpression *exp = 0; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getDifferentIndividuals(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CNamedIndividualExpression *CXMLOWL2Handler::parseNamedIndividualNode(CParseStackObject* parseStackObj) { const QString& indiNameName = getEntityName(parseStackObj); CNamedIndividualExpression *exp = 0; if (!indiNameName.isEmpty()) { if (mOntoBuilder) { exp = mOntoBuilder->getNamedIndividual(indiNameName); } } return exp; } CAnonymousIndividualExpression *CXMLOWL2Handler::parseAnonymousIndividualNode(CParseStackObject* parseStackObj) { if (mOntologyName.isEmpty()) { mOntologyName = mOntoBuilder->getOntologyName(); } const QString& indiNameName = getNodeID(parseStackObj); CAnonymousIndividualExpression *exp = 0; if (!indiNameName.isEmpty()) { if (mOntoBuilder) { exp = mOntoBuilder->getAnonymousIndividual(mOntologyName,indiNameName); } } return exp; } CObjectPropertyAssertionExpression *CXMLOWL2Handler::parseObjectPropertyAssertionNode(CParseStackObject* parseStackObj) { CObjectPropertyAssertionExpression *exp = 0; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectPropertyAssertion(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CNegativeObjectPropertyAssertionExpression *CXMLOWL2Handler::parseNegativeObjectPropertyAssertionNode(CParseStackObject* parseStackObj) { CNegativeObjectPropertyAssertionExpression *exp = 0; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getNegativeObjectPropertyAssertion(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } void CXMLOWL2Handler::jumpFunctionParseRuleNode(CParseStackObject* parseStackObj) { parseRuleNode(parseStackObj); } void CXMLOWL2Handler::jumpFunctionParseRulePropertyAtomNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseRuleObjectPropertyAtomNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseRuleClassAtomNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseRuleClassAtomNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseRuleAtomBodyNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseRuleAtomBodyNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseRuleAtomHeadNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseRuleAtomHeadNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionTellOntologyAxiomNode(CParseStackObject* parseStackObj) { parseTellOntologyAxiomNode(parseStackObj); } void CXMLOWL2Handler::jumpFunctionRetractOntologyAxiomNode(CParseStackObject* parseStackObj) { parseRetractOntologyAxiomNode(parseStackObj); } void CXMLOWL2Handler::jumpFunctionParsePrefixNode(CParseStackObject* parseStackObj) { parsePrefixNode(parseStackObj); } void CXMLOWL2Handler::addTemporaryBuildExpression(CBuildExpression* buildExp) { if (buildExp) { mTmpExpList.append(buildExp); } } void CXMLOWL2Handler::addTemporaryBuildExpressions(QList* buildExps) { if (buildExps) { for (QList::const_iterator it = buildExps->constBegin(), itEnd = buildExps->constEnd(); it != itEnd; ++it) { CBuildExpression* buildExp = *it; if (buildExp) { mTmpExpList.append(buildExp); } } } } void CXMLOWL2Handler::jumpFunctionParseClassNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseClassNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectPropertyNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectPropertyNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseIndividualVariable(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseIndividualVariableNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseDeclarationNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDeclarationNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseEquivalentClassesNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseEquivalentClassesNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseSubClassOfNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseSubClassOfNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseDisjontClassesNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDisjontClassesNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseDisjontUnionNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDisjontUnionNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseSubObjectPropertyOfNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseSubObjectPropertyOfNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectPropertyChainNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectPropertyChainNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseEquivalentObjectPropertiesNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseEquivalentObjectPropertiesNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseDisjointObjectPropertiesNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDisjointObjectPropertiesNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectIntersectionOfNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectIntersectionOfNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectUnionOfNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectUnionOfNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectMaxCardinalityNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectMaxCardinalityNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectMinCardinalityNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectMinCardinalityNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectExactlyCardinalityNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectExactlyCardinalityNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectSomeValuesFromNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectSomeValuesFromNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectAllValuesFromNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectAllValuesFromNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectComplementOfNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectComplementOfNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectOneOfNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectOneOfNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectHasValueNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectHasValueNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectHasSelfNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectHasSelfNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseClassAssertionNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseClassAssertionNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseNamedIndividualNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseNamedIndividualNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseAnonymousIndividualNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseAnonymousIndividualNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectPropertyAssertionNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectPropertyAssertionNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseNegativeObjectPropertyAssertionNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseNegativeObjectPropertyAssertionNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseSameIndividualNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseSameIndividualNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseDifferentIndividualsNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDifferentIndividualsNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectPropertyDomainNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectPropertyDomainNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseObjectPropertyRangeNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectPropertyRangeNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseInverseObjectPropertyOfNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseInverseObjectPropertyOfNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseInverseObjectPropertiesNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseInverseObjectPropertiesNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseTransetiveObjectPropertyNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseTransetiveObjectPropertyNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseFunctionalObjectPropertyNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseFunctionalObjectPropertyNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseSymmetricObjectPropertyNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseSymmetricObjectPropertyNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseAsymmetricObjectPropertyNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseAsymmetricObjectPropertyNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseReflexiveObjectPropertyNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseReflexiveObjectPropertyNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseIrreflexiveObjectPropertyNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseIrreflexiveObjectPropertyNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseInverseFunctionalObjectPropertyNode(CParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseInverseFunctionalObjectPropertyNode(parseStackObj)); } void CXMLOWL2Handler::jumpFunctionParseIgnoredNode(CParseStackObject* parseStackObj) { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CRBoxAxiomBuilder.h0000644000175000017500000003023012520550740023147 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CRBOXAXIOMBUILDER_H #define KONCLUDE_PARSER_CRBOXAXIOMBUILDER_H // Libraries includes #include #include // Namespace includes #include "Parser/Expressions/CBuildExpression.h" #include "Parser/Expressions/CObjectPropertyExpression.h" #include "Parser/Expressions/CDataPropertyExpression.h" #include "Parser/Expressions/CSubObjectPropertyOfExpression.h" #include "Parser/Expressions/CInverseObjectPropertyOfExpression.h" #include "Parser/Expressions/CDisjointObjectPropertiesExpression.h" #include "Parser/Expressions/CEquivalentObjectPropertiesExpression.h" #include "Parser/Expressions/CObjectPropertyChainExpression.h" #include "Parser/Expressions/CObjectPropertyDomainExpression.h" #include "Parser/Expressions/CObjectPropertyRangeExpression.h" #include "Parser/Expressions/CInverseObjectPropertiesExpression.h" #include "Parser/Expressions/CTransetiveObjectPropertyExpression.h" #include "Parser/Expressions/CFunctionalObjectPropertyExpression.h" #include "Parser/Expressions/CSymmetricObjectPropertyExpression.h" #include "Parser/Expressions/CAsymmetricObjectPropertyExpression.h" #include "Parser/Expressions/CReflexiveObjectPropertyExpression.h" #include "Parser/Expressions/CIrreflexiveObjectPropertyExpression.h" #include "Parser/Expressions/CInverseFunctionalObjectPropertyExpression.h" #include "Parser/Expressions/CSubDataPropertyOfExpression.h" #include "Parser/Expressions/CFunctionalDataPropertyExpression.h" #include "Parser/Expressions/CDisjointDataPropertiesExpression.h" #include "Parser/Expressions/CEquivalentDataPropertiesExpression.h" #include "Parser/Expressions/CDataPropertyDomainExpression.h" #include "Parser/Expressions/CDataPropertyRangeExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { using namespace Expression; /*! * \class CRBoxAxiomBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CRBoxAxiomBuilder { // public methods public: //! Constructor CRBoxAxiomBuilder(); //! Destructor virtual ~CRBoxAxiomBuilder(); virtual CObjectPropertyExpression* getObjectProberty(const QString& probertyName) = 0; virtual CObjectPropertyExpression* getObjectProberty(const QStringRef& probertyName) = 0; virtual CObjectPropertyTermExpression* getTopObjectProberty() = 0; virtual CDataPropertyExpression* getDataProberty(const QString& dataPropertyName) = 0; virtual CDataPropertyExpression* getDataProberty(const QStringRef& dataPropertyName) = 0; virtual CSubDataPropertyOfExpression* getSubDataPropertyOf(const CEXPRESSIONLIST& expressions) = 0; virtual CSubDataPropertyOfExpression* getSubDataPropertyOf(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CEquivalentDataPropertiesExpression* getEquivalentDataProperties(const CEXPRESSIONLIST& expressions) = 0; virtual CEquivalentDataPropertiesExpression* getEquivalentDataProperties(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CDisjointDataPropertiesExpression* getDisjointDataProperties(const CEXPRESSIONLIST& expressions) = 0; virtual CDisjointDataPropertiesExpression* getDisjointDataProperties(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CDataPropertyDomainExpression* getDataPropertyDomainExpression(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CDataPropertyDomainExpression* getDataPropertyDomainExpression(const CEXPRESSIONLIST& expressions) = 0; virtual CDataPropertyRangeExpression* getDataPropertyRangeExpression(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CDataPropertyRangeExpression* getDataPropertyRangeExpression(const CEXPRESSIONLIST& expressions) = 0; virtual CFunctionalDataPropertyExpression* getFunctionalDataProperty(const CEXPRESSIONLIST& expressions) = 0; virtual CFunctionalDataPropertyExpression* getFunctionalDataProperty(CBuildExpression* expression) = 0; virtual CSubDataPropertyOfExpression* getSubDataPropertyOf(CDataPropertyTermExpression* expression1, CDataPropertyTermExpression* expression2) = 0; virtual CEquivalentDataPropertiesExpression* getEquivalentDataProperties(const CEXPRESSIONLIST& expressions) = 0; virtual CDisjointDataPropertiesExpression* getDisjointDataProperties(const CEXPRESSIONLIST& expressions) = 0; virtual CDataPropertyDomainExpression* getDataPropertyDomainExpression(CDataPropertyTermExpression* expression1, CClassTermExpression* expression2) = 0; virtual CDataPropertyRangeExpression* getDataPropertyRangeExpression(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) = 0; virtual CFunctionalDataPropertyExpression* getFunctionalDataProperty(CDataPropertyTermExpression* expression) = 0; virtual CSubObjectPropertyOfExpression* getSubObjectPropertyOf(const CEXPRESSIONLIST& expressions) = 0; virtual CSubObjectPropertyOfExpression* getSubObjectPropertyOf(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CObjectPropertyChainExpression* getObjectPropertyChain(const CEXPRESSIONLIST& expressions) = 0; virtual CObjectPropertyChainExpression* getObjectPropertyChain(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CEquivalentObjectPropertiesExpression* getEquivalentObjectProperties(const CEXPRESSIONLIST& expressions) = 0; virtual CEquivalentObjectPropertiesExpression* getEquivalentObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CDisjointObjectPropertiesExpression* getDisjointObjectProperties(const CEXPRESSIONLIST& expressions) = 0; virtual CDisjointObjectPropertiesExpression* getDisjointObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CInverseObjectPropertiesExpression* getInverseObjectProperties(const CEXPRESSIONLIST& expressions) = 0; virtual CInverseObjectPropertiesExpression* getInverseObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CObjectPropertyDomainExpression* getObjectPropertyDomainExpression(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CObjectPropertyDomainExpression* getObjectPropertyDomainExpression(const CEXPRESSIONLIST& expressions) = 0; virtual CObjectPropertyRangeExpression* getObjectPropertyRangeExpression(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CObjectPropertyRangeExpression* getObjectPropertyRangeExpression(const CEXPRESSIONLIST& expressions) = 0; virtual CTransetiveObjectPropertyExpression* getTransetiveObjectProperty(const CEXPRESSIONLIST& expressions) = 0; virtual CTransetiveObjectPropertyExpression* getTransetiveObjectProperty(CBuildExpression* expression) = 0; virtual CFunctionalObjectPropertyExpression* getFunctionalObjectProperty(const CEXPRESSIONLIST& expressions) = 0; virtual CFunctionalObjectPropertyExpression* getFunctionalObjectProperty(CBuildExpression* expression) = 0; virtual CInverseFunctionalObjectPropertyExpression* getInverseFunctionalObjectProperty(const CEXPRESSIONLIST& expressions) = 0; virtual CInverseFunctionalObjectPropertyExpression* getInverseFunctionalObjectProperty(CBuildExpression* expression) = 0; virtual CSymmetricObjectPropertyExpression* getSymmetricObjectProperty(const CEXPRESSIONLIST& expressions) = 0; virtual CSymmetricObjectPropertyExpression* getSymmetricObjectProperty(CBuildExpression* expression) = 0; virtual CAsymmetricObjectPropertyExpression* getAsymmetricObjectProperty(const CEXPRESSIONLIST& expressions) = 0; virtual CAsymmetricObjectPropertyExpression* getAsymmetricObjectProperty(CBuildExpression* expression) = 0; virtual CReflexiveObjectPropertyExpression* getReflexiveObjectProperty(const CEXPRESSIONLIST& expressions) = 0; virtual CReflexiveObjectPropertyExpression* getReflexiveObjectProperty(CBuildExpression* expression) = 0; virtual CIrreflexiveObjectPropertyExpression* getIrreflexiveObjectProperty(const CEXPRESSIONLIST& expressions) = 0; virtual CIrreflexiveObjectPropertyExpression* getIrreflexiveObjectProperty(CBuildExpression* expression) = 0; virtual CInverseObjectPropertyOfExpression* getInverseObjectPropertyOf(const CEXPRESSIONLIST& expressions) = 0; virtual CInverseObjectPropertyOfExpression* getInverseObjectPropertyOf(CBuildExpression* expression) = 0; virtual CSubObjectPropertyOfExpression* getSubObjectPropertyOf(const CEXPRESSIONLIST& expressions, CObjectPropertyTermExpression* expression) = 0; virtual CSubObjectPropertyOfExpression* getSubObjectPropertyOf(CObjectPropertyChainExpression* expressions, CObjectPropertyTermExpression* expression) = 0; virtual CObjectPropertyChainExpression* getObjectPropertyChain(const CEXPRESSIONLIST& expressions) = 0; virtual CEquivalentObjectPropertiesExpression* getEquivalentObjectProperties(const CEXPRESSIONLIST& expressions) = 0; virtual CDisjointObjectPropertiesExpression* getDisjointObjectProperties(const CEXPRESSIONLIST& expressions) = 0; virtual CInverseObjectPropertiesExpression* getInverseObjectProperties(CObjectPropertyTermExpression* expression1, CObjectPropertyTermExpression* expression2) = 0; virtual CInverseObjectPropertyOfExpression* getInverseObjectPropertyOf(CObjectPropertyTermExpression* expression) = 0; virtual CObjectPropertyDomainExpression* getObjectPropertyDomainExpression(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) = 0; virtual CObjectPropertyRangeExpression* getObjectPropertyRangeExpression(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) = 0; virtual CTransetiveObjectPropertyExpression* getTransetiveObjectProperty(CObjectPropertyTermExpression* expression) = 0; virtual CFunctionalObjectPropertyExpression* getFunctionalObjectProperty(CObjectPropertyTermExpression* expression) = 0; virtual CInverseFunctionalObjectPropertyExpression* getInverseFunctionalObjectProperty(CObjectPropertyTermExpression* expression) = 0; virtual CSymmetricObjectPropertyExpression* getSymmetricObjectProperty(CObjectPropertyTermExpression* expression) = 0; virtual CAsymmetricObjectPropertyExpression* getAsymmetricObjectProperty(CObjectPropertyTermExpression* expression) = 0; virtual CReflexiveObjectPropertyExpression* getReflexiveObjectProperty(CObjectPropertyTermExpression* expression) = 0; virtual CIrreflexiveObjectPropertyExpression* getIrreflexiveObjectProperty(CObjectPropertyTermExpression* expression) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CRBOXAXIOMBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/COntologyParser.h0000644000175000017500000000401512520550736022766 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CONTOLOGYPARSER_H #define KONCLUDE_PARSER_CONTOLOGYPARSER_H // Libraries includes #include #include // Namespace includes #include "Expressions/CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { using namespace Expression; /*! * * \class COntologyParser * \author Andreas Steigmiller * \version 0.1 * \brief Parser for OWL/XML Files * */ class COntologyParser { // public methods public: //! Constructor COntologyParser(); //! Destructor virtual ~COntologyParser(); virtual bool parseOntologyFile(const QString& filename) = 0; virtual bool parseTellOntologyAxiomNode(QDomElement *ontologyNode) = 0; virtual bool parseRetractOntologyAxiomNode(QDomElement *ontologyNode) = 0; virtual CBuildExpression *getParsedBuildNode(QDomElement *node) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CONTOLOGYPARSER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CContinueParsingWaitingCondition.cpp0000644000175000017500000000215112520550734026631 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CContinueParsingWaitingCondition.h" namespace Konclude { namespace Parser { CContinueParsingWaitingCondition::CContinueParsingWaitingCondition() : CLinkerBase(nullptr) { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLOWL2StreamHandler.cpp0000644000175000017500000026314712520550740024120 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CXMLOWL2StreamHandler.h" namespace Konclude { namespace Parser { CXMLOWL2StreamHandler::CXMLOWL2StreamHandler(COntologyBuilder* ontoBuilder) : CLogIdentifier("::Konclude::Parser::OWL2QtXMLStreamOntologyParser",this),recordRouter(0,this) { mOntoBuilder = ontoBuilder; mAxiomNumber = 0; mHasCurrentXMLBase = false; mIgnoreParsingSubElements = false; mParseIgnoreDepth = 0; mCurrentXMLBaseValidDepth = 0; mCurrentXMLNamespaceValidDepth = 0; mDataTypeReportErrorCount = 100; mAnnotationReportErrorCount = 100; mUnsupportedAnnotationError = false; mUnsupportedImportError = false; mOntologyNodeFound = false; mParseTextElement = false; mPunctChar = QChar('.'); mDoublePunctChar = QChar(':'); initializeParseFunctionJumpHash(); LOG(INFO,getLogDomain(),logTr("OWL 2 XML Qt stream parser initialized."),this); } CXMLOWL2StreamHandler::CXMLOWL2StreamHandler(COntologyBuilder* ontoBuilder, CCommandRecordRouter *commandRecordRouter) : CLogIdentifier("::Konclude::Parser::OWL2QtXMLStreamOntologyParser",this),recordRouter(*commandRecordRouter,this) { mOntoBuilder = ontoBuilder; mAxiomNumber = 0; mHasCurrentXMLBase = false; mIgnoreParsingSubElements = false; mParseIgnoreDepth = 0; mCurrentXMLBaseValidDepth = 0; mCurrentXMLNamespaceValidDepth = 0; mDataTypeReportErrorCount = 100; mAnnotationReportErrorCount = 100; mUnsupportedAnnotationError = false; mUnsupportedImportError = false; mOntologyNodeFound = false; mParseTextElement = false; mPunctChar = QChar('.'); mDoublePunctChar = QChar(':'); initializeParseFunctionJumpHash(); LOG(INFO,getLogDomain(),logTr("OWL 2 XML Qt stream parser initialized."),this); } bool CXMLOWL2StreamHandler::parseXMLAttributs(const QXmlStreamAttributes& atts) { QStringRef xmlBaseStringRef(atts.value("http://www.w3.org/XML/1998/namespace","base")); if (!xmlBaseStringRef.isEmpty()) { if (mHasCurrentXMLBase) { mXMLBaseStack.push(CStreamXMLBaseStackObject(mCurrentXMLBaseValidDepth,mCurrentXMLBase)); } mCurrentXMLBase = xmlBaseStringRef.toString(); mCurrentXMLBaseValidDepth = mStack.count(); mHasCurrentXMLBase = true; } QStringRef xmlNamespaceStringRef(atts.value("http://www.w3.org/XML/1998/namespace","xmlns")); if (!xmlNamespaceStringRef.isEmpty()) { QHash newOWLNamespaceHash; if (!newOWLNamespaceHash.isEmpty()) { CQtHash* newParseHash = new CQtHash(*mCurrentParseFunctionJumpHash); for (QHash::const_iterator it = newOWLNamespaceHash.constBegin(), itEnd = newOWLNamespaceHash.constEnd(); it != itEnd; ++it) { const QString& abbreviationString(it.key()); bool abbreviationAdded(it.value()); if (abbreviationAdded) { extendParsingHashForNamespace(&mBaseParseFunctionJumpHash,newParseHash,abbreviationString); } else { reduceParsingHashForNamespace(&mBaseParseFunctionJumpHash,newParseHash,abbreviationString); } } mXMLNamespaceStack.push(CStreamXMLNamespaceStackObject(mCurrentXMLNamespaceValidDepth,newParseHash)); mCurrentParseFunctionJumpHash = newParseHash; } mCurrentXMLNamespaceValidDepth = mStack.count(); } return true; } bool CXMLOWL2StreamHandler::startElement(const QStringRef& namespaceURI, const QStringRef& localName, const QStringRef& qName, const QXmlStreamAttributes& atts) { mParseTextElement = false; if (mIgnoreParsingSubElements) { mStack.push(&mDummyFunctionData); } else { parseXMLAttributs(atts); const CStreamParseFunctionData& functionData = mCurrentParseFunctionJumpHash->value(qName); if (functionData.mParseDirectFunction) { StreamParseFunctionDirect function = functionData.mParseDirectFunction; (this->*function)(atts); if (!mStack.isEmpty() && !mTmpExpList.isEmpty()) { CStreamParseStackObject* topParsStackObj = mStack.top(); topParsStackObj->addBuildExpressions(&mTmpExpList); } mStack.push(&mDummyFunctionData); } else if (functionData.mParseDelayedFunction) { StreamParseFunctionDelayed function = functionData.mParseDelayedFunction; bool requiredCardinality = functionData.mExtraParsingFlags & CStreamParseFunctionData::EPF_CARDINALITY; bool requiredDatatypeIRI = functionData.mExtraParsingFlags & CStreamParseFunctionData::EPF_DATATYPE_IRI; bool requiredFacetIRI = functionData.mExtraParsingFlags & CStreamParseFunctionData::EPF_FACET_IRI; mParseTextElement = functionData.mExtraParsingFlags & CStreamParseFunctionData::EPF_TEXT_ELEMENT; if (requiredCardinality) { cint64 cardinality = 0; bool cardinalityParsed = getCardinality(&cardinality,atts); mStack.push(new CStreamParseStackObject(function,cardinality)); } else if (requiredDatatypeIRI) { QString datatypeIRI; bool datatypeParsed = getDatatypeIRI(&datatypeIRI,atts); bool appendixParsed = getLiteralAppendix(&mLastTextAppendix,atts); mParseTextElement = true; mStack.push(new CStreamParseStackObject(function,datatypeIRI)); } else if (requiredFacetIRI) { QString facetIRI; bool facetParsed = getFacetIRI(&facetIRI,atts); mStack.push(new CStreamParseStackObject(function,facetIRI)); } else { mStack.push(new CStreamParseStackObject(function)); } } else { mStack.push(&mDummyFunctionData); } } return true; } bool CXMLOWL2StreamHandler::endElement(const QStringRef& namespaceURI, const QStringRef& localName, const QStringRef& qName) { if (!mStack.isEmpty()) { CStreamParseStackObject* parseStackObject = mStack.pop(); if (mIgnoreParsingSubElements && mStack.count() <= mParseIgnoreDepth) { mIgnoreParsingSubElements = false; mParseIgnoreDepth = 0; } else { if (parseStackObject != &mDummyFunctionData) { StreamParseFunctionDelayed function = parseStackObject->mParseFunction; if (function) { (this->*function)(parseStackObject); if (!mStack.isEmpty() && !mTmpExpList.isEmpty()) { CStreamParseStackObject* topParsStackObj = mStack.top(); topParsStackObj->addBuildExpressions(&mTmpExpList); } } delete parseStackObject; } } } mTmpExpList.clear(); mLastReadText.clear(); mLastTextAppendix.clear(); if (mHasCurrentXMLBase) { if (mStack.count() <= mCurrentXMLBaseValidDepth) { if (mXMLBaseStack.isEmpty()) { mHasCurrentXMLBase = false; } else { CStreamXMLBaseStackObject prevXMLBaseObject = mXMLBaseStack.pop(); mCurrentXMLBase = prevXMLBaseObject.mXMLBaseString; mCurrentXMLBaseValidDepth = prevXMLBaseObject.mStackValidDepth; } } } if (mStack.count() <= mCurrentXMLNamespaceValidDepth) { if (mXMLNamespaceStack.isEmpty()) { mCurrentParseFunctionJumpHash = &mBaseParseFunctionJumpHash; } else { CStreamXMLNamespaceStackObject prevXMLNSObject = mXMLNamespaceStack.pop(); mCurrentParseFunctionJumpHash = prevXMLNSObject.mParseHash; mCurrentXMLNamespaceValidDepth = prevXMLNSObject.mStackValidDepth; } } return true; } bool CXMLOWL2StreamHandler::readText(const QStringRef& text) { if (mParseTextElement) { mLastReadText = text.toString(); } return true; } bool CXMLOWL2StreamHandler::startDocument() { mStack.push(&mDummyFunctionData); return true; } bool CXMLOWL2StreamHandler::endDocument() { if (mStack.count() > 0) { CStreamParseStackObject* parseStackObject = mStack.pop(); parseTellOntologyAxiomNode(parseStackObject); delete parseStackObject; } return true; } void CXMLOWL2StreamHandler::parseTellOntologyAxiomNode(CStreamParseStackObject* parseStackObj) { if (mOntoBuilder && parseStackObj->hasExpressions()) { QList* expList = parseStackObj->getExpressions(); for (QList::const_iterator it = expList->constBegin(), itEnd = expList->constEnd(); it != itEnd; ++it) { CAxiomExpression* axiomExpression = dynamic_cast(*it); if (axiomExpression) { mOntoBuilder->tellOntologyAxiom(axiomExpression); } } } } void CXMLOWL2StreamHandler::parseRetractOntologyAxiomNode(CStreamParseStackObject* parseStackObj) { if (mOntoBuilder && parseStackObj->hasExpressions()) { QList* expList = parseStackObj->getExpressions(); for (QList::const_iterator it = expList->constBegin(), itEnd = expList->constEnd(); it != itEnd; ++it) { CAxiomExpression* axiomExpression = dynamic_cast(*it); if (axiomExpression) { mOntoBuilder->retractOntologyAxiom(axiomExpression); } } } } void CXMLOWL2StreamHandler::parsePrefixNode(const QXmlStreamAttributes& attributes) { QStringRef abbName = attributes.value(mNameString); QStringRef totalIRIName = attributes.value(mIRIString); if (abbName.isEmpty()) { abbName = attributes.value(mOWLPrefixNameString); } if (totalIRIName.isEmpty()) { totalIRIName = attributes.value(mOWLPrefixIRIString); } if (!totalIRIName.isEmpty()) { mOntoBuilder->addNameAbbreviation(totalIRIName.toString(),abbName.toString()); } } bool CXMLOWL2StreamHandler::startsWithScheme(const QStringRef& uriString) { for (int i = 0; i < uriString.count()-1; ++i) { const QChar& c = uriString.at(i); if (!c.isLetterOrNumber() && c != mPunctChar) { if (c == mDoublePunctChar) { return i != 0; } return false; } } return false; } CStringRefStringHasher CXMLOWL2StreamHandler::getEntityName(const QXmlStreamAttributes& attributes) { CStringRefStringHasher entityName; bool abbreviated = false; QStringRef attrNameString; attrNameString = attributes.value(mIRIString); if (attrNameString.isEmpty()) { attrNameString = attributes.value(mOWLPrefixIRIString); } if (attrNameString.isEmpty()) { attrNameString = attributes.value(mAbbreviatedIRIString); abbreviated = true; } if (attrNameString.isEmpty()) { attrNameString = attributes.value(mOWLPrefixAbbreviatedIRIString); abbreviated = true; } if (attrNameString.isEmpty()) { attrNameString = attributes.value(mURIString); } if (attrNameString.isEmpty()) { attrNameString = attributes.value(mOWLPrefixURIString); } if (attrNameString.isEmpty()) { abbreviated = false; } if (abbreviated) { entityName = CStringRefStringHasher(mOntoBuilder->resolveAbbreviationName(attrNameString)); } else { if (mHasCurrentXMLBase) { if (!startsWithScheme(attrNameString)) { entityName = CStringRefStringHasher(mCurrentXMLBase+attrNameString.toString()); } } if (entityName.isEmpty()) { entityName = CStringRefStringHasher(attrNameString); } } return entityName; } bool CXMLOWL2StreamHandler::getLiteralAppendix(QString* literalAppendix, const QXmlStreamAttributes& attributes) { QStringRef literalAppendixString; literalAppendixString = attributes.value("lang"); if (literalAppendixString.isEmpty()) { literalAppendixString = attributes.value("xml:lang"); } if (literalAppendix) { *literalAppendix = literalAppendixString.toString(); } return !literalAppendixString.isEmpty(); } bool CXMLOWL2StreamHandler::getDatatypeIRI(QString* datatypeIRI, const QXmlStreamAttributes& attributes) { QStringRef datatypeIRIString; datatypeIRIString = attributes.value(mDatatypeIRIString); if (datatypeIRIString.isEmpty()) { datatypeIRIString = attributes.value(mOWLPrefixDatatypeIRIString); } if (datatypeIRI) { *datatypeIRI = datatypeIRIString.toString(); } return !datatypeIRIString.isEmpty(); } bool CXMLOWL2StreamHandler::getFacetIRI(QString* facetIRI, const QXmlStreamAttributes& attributes) { QStringRef facetIRIString; facetIRIString = attributes.value(mFacetIRIString); if (facetIRIString.isEmpty()) { facetIRIString = attributes.value(mOWLPrefixFacetIRIString); } if (facetIRI) { *facetIRI = facetIRIString.toString(); } return !facetIRIString.isEmpty(); } bool CXMLOWL2StreamHandler::getCardinality(cint64* cardinality, const QXmlStreamAttributes& attributes) { QStringRef cardinalityString; cardinalityString = attributes.value(mCardinalityString); if (cardinalityString.isEmpty()) { cardinalityString = attributes.value(mOWLPrefixCardinalityString); } if (!cardinalityString.isEmpty()) { bool succParsed = false; *cardinality = cardinalityString.toString().toLongLong(&succParsed); return succParsed; } else { bool succParsed = false; *cardinality = cardinalityString.toString().toLongLong(&succParsed); return succParsed; } } QStringRef CXMLOWL2StreamHandler::getNodeID(const QXmlStreamAttributes& attributes) { QStringRef nodeIDString; nodeIDString = attributes.value(mNodeIDString); if (nodeIDString.isEmpty()) { nodeIDString = attributes.value(mOWLPrefixNodeIDString); } return nodeIDString; } bool CXMLOWL2StreamHandler::extendParsingHashForNamespace(CQtHash* baseParseFunctionJumpHash, CQtHash* extendParseFunctionJumpHash, const QString& namespaceExtendString) { bool extendHash = false; for (CQtHash::const_iterator it = baseParseFunctionJumpHash->constBegin(), itEnd = baseParseFunctionJumpHash->constEnd(); it != itEnd; ++it) { const CStringRefStringHasher& stringRefStringHasher(it.key()); const CStreamParseFunctionData& streamParseFunctionData(it.value()); const QString& keyParseString = stringRefStringHasher.getString(); QString extendedKeyParseString = namespaceExtendString+keyParseString; extendParseFunctionJumpHash->insert(CStringRefStringHasher(extendedKeyParseString),streamParseFunctionData); extendHash = true; } return extendHash; } bool CXMLOWL2StreamHandler::reduceParsingHashForNamespace(CQtHash* baseParseFunctionJumpHash, CQtHash* reduceParseFunctionJumpHash, const QString& namespaceReduceString) { bool reducedHash = false; for (CQtHash::const_iterator it = baseParseFunctionJumpHash->constBegin(), itEnd = baseParseFunctionJumpHash->constEnd(); it != itEnd; ++it) { const CStringRefStringHasher& stringRefStringHasher(it.key()); const CStreamParseFunctionData& streamParseFunctionData(it.value()); const QString& keyParseString = stringRefStringHasher.getString(); QString reduceKeyParseString = namespaceReduceString+keyParseString; reduceParseFunctionJumpHash->insert(CStringRefStringHasher(reduceKeyParseString),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseIgnoredNode)); reducedHash = true; } return reducedHash; } bool CXMLOWL2StreamHandler::initializeParseFunctionJumpHash() { mOWLString = QString("http://www.w3.org/2002/07/owl#"); mOWLPrefixString = QString("owl"); mURIString = QString("URI"); mOWLPrefixURIString = mOWLPrefixString+QString(":")+mURIString; mIRIString = QString("IRI"); mOWLPrefixIRIString = mOWLPrefixString+QString(":")+mIRIString; mAbbreviatedIRIString = QString("abbreviatedIRI"); mOWLPrefixAbbreviatedIRIString = mOWLPrefixString+QString(":")+mAbbreviatedIRIString; mCardinalityString = QString("cardinality"); mOWLPrefixCardinalityString = mOWLPrefixString+QString(":")+mCardinalityString; mDatatypeIRIString = QString("datatypeIRI"); mOWLPrefixDatatypeIRIString = mOWLPrefixString+QString(":")+mDatatypeIRIString; mFacetIRIString = QString("facet"); mOWLPrefixFacetIRIString = mOWLPrefixString+QString(":")+mFacetIRIString; mNodeIDString = QString("nodeID"); mOWLPrefixNodeIDString = mOWLPrefixString+QString(":")+mNodeIDString; mNameString = QString("name"); mOWLPrefixNameString = mOWLPrefixString+QString(":")+mNameString; mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("Prefix"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParsePrefixNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("Class"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseClassNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("OWLClass"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseClassNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectProperty"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectPropertyNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("IndividualVariable"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseIndividualVariable)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("Variable"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseIndividualVariable)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("Declaration"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDeclarationNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("SubClassOf"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseSubClassOfNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("EquivalentClasses"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseEquivalentClassesNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DisjointClasses"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDisjontClassesNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DisjointUnion"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDisjontUnionNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("SubObjectPropertyOf"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseSubObjectPropertyOfNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectPropertyChain"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectPropertyChainNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("EquivalentObjectProperties"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseEquivalentObjectPropertiesNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DisjointObjectProperties"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDisjointObjectPropertiesNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectInverseOf"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseInverseObjectPropertyOfNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("InverseObjectProperties"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseInverseObjectPropertiesNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectPropertyRange"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectPropertyRangeNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectPropertyDomain"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectPropertyDomainNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("TransitiveObjectProperty"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseTransetiveObjectPropertyNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("FunctionalObjectProperty"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseFunctionalObjectPropertyNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("SymmetricObjectProperty"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseSymmetricObjectPropertyNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("AsymmetricObjectProperty"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseAsymmetricObjectPropertyNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ReflexiveObjectProperty"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseReflexiveObjectPropertyNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("IrreflexiveObjectProperty"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseIrreflexiveObjectPropertyNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("InverseFunctionalObjectProperty"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseInverseFunctionalObjectPropertyNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectIntersectionOf"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectIntersectionOfNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectUnionOf"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectUnionOfNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectMaxCardinality"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectMaxCardinalityNode,CStreamParseFunctionData::EPF_CARDINALITY)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectMinCardinality"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectMinCardinalityNode,CStreamParseFunctionData::EPF_CARDINALITY)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectExactCardinality"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectExactlyCardinalityNode,CStreamParseFunctionData::EPF_CARDINALITY)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectSomeValuesFrom"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectSomeValuesFromNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectAllValuesFrom"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectAllValuesFromNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectComplementOf"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectComplementOfNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectOneOf"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectOneOfNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectHasValue"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectHasValueNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectHasSelf"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectHasSelfNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("NamedIndividual"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseNamedIndividualNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("AnonymousIndividual"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseAnonymousIndividualNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ClassAssertion"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseClassAssertionNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectPropertyAssertion"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectPropertyAssertionNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher(mOWLPrefixString+":ObjectPropertyAssertion"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseObjectPropertyAssertionNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("NegativeObjectPropertyAssertion"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseNegativeObjectPropertyAssertionNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher(mOWLPrefixString+":NegativeObjectPropertyAssertion"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseNegativeObjectPropertyAssertionNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("SameIndividual"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseSameIndividualNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher(mOWLPrefixString+":SameIndividual"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseSameIndividualNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DifferentIndividuals"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDifferentIndividualsNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher(mOWLPrefixString+":DifferentIndividuals"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDifferentIndividualsNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("#text"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseIgnoredNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("#comment"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseIgnoredNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ExpectedResult"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseIgnoredNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("Datatype"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDatatypeNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DataSomeValuesFrom"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataSomeValuesFromNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("Literal"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataLiteralNode,CStreamParseFunctionData::EPF_DATATYPE_IRI | CStreamParseFunctionData::EPF_LITERAL_APPENDIX | CStreamParseFunctionData::EPF_TEXT_ELEMENT)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DataProperty"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataPropertyNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DataAllValuesFrom"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataAllValuesFromNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DataHasValue"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataHasValueNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DataIntersectionOf"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataIntersectionOfNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DataOneOf"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataOneOfNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DataUnionOf"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataUnionOfNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DataComplementOf"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataComplementOfNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DatatypeRestriction"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDatatypeRestrictionNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DataMinCardinality"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataMinCardinalityNode,CStreamParseFunctionData::EPF_CARDINALITY)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DataMaxCardinality"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataMaxCardinalityNode,CStreamParseFunctionData::EPF_CARDINALITY)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DataExactCardinality"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataExactCardinalityNode,CStreamParseFunctionData::EPF_CARDINALITY)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("SubDataPropertyOf"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseSubDataPropertyOfNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("EquivalentDataProperties"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseEquivalentDataPropertiesNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DisjointDataProperties"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDisjointDataPropertiesNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DataPropertyDomain"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataPropertyDomainNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DataPropertyRange"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataPropertyRangeNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("FunctionalDataProperty"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseFunctionalDataPropertyNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DataPropertyAssertion"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataPropertyAssertionNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("NegativeDataPropertyAssertion"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseNegativeDataPropertyAssertionNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("FacetRestriction"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDataFacetRestrictionNode,CStreamParseFunctionData::EPF_FACET_IRI)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("HasKey"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionUnsupportedDatatypeNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DatatypeDefinition"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionUnsupportedDatatypeNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("Ontology"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionTellOntologyAxiomNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("Tell"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionTellOntologyAxiomNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("Whereby"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionTellOntologyAxiomNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("Retract"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionRetractOntologyAxiomNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DLSafeRule"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseRuleNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("Head"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseRuleAtomHeadNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("Body"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseRuleAtomBodyNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ObjectPropertyAtom"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseRulePropertyAtomNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("ClassAtom"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseRuleClassAtomNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("DifferentIndividualsAtom"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseDifferentIndividualsAtomNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("Import"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionParseImportNode,CStreamParseFunctionData::EPF_TEXT_ELEMENT)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("AnnotationProperty"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionUnsupportedAnnotationNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("AnnotationPropertyRange"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionUnsupportedAnnotationNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("AnnotationPropertyDomain"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionUnsupportedAnnotationNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("SubAnnotationPropertyOf"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionUnsupportedAnnotationNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("AnnotationAssertion"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionUnsupportedAnnotationNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("Annotation"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionUnsupportedAnnotationNode)); mBaseParseFunctionJumpHash.insert(CStringRefStringHasher("RDF"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionUnsupportedRDFNode)); mCurrentParseFunctionJumpHash = &mBaseParseFunctionJumpHash; CQtHash* newParseHash = new CQtHash(*mCurrentParseFunctionJumpHash); extendParsingHashForNamespace(&mBaseParseFunctionJumpHash,newParseHash,mOWLPrefix); mCurrentParseFunctionJumpHash = newParseHash; mCurrentParseFunctionJumpHash->insert(CStringRefStringHasher("rdf:RDF"),CStreamParseFunctionData(&CXMLOWL2StreamHandler::jumpFunctionUnsupportedRDFNode)); return true; } CRuleDifferentIndividualsAtomTermExpression* CXMLOWL2StreamHandler::parseRuleDifferentIndividualsAtomNode(CStreamParseStackObject* parseStackObj) { CRuleDifferentIndividualsAtomTermExpression* ruleDiffIndAtomExp = nullptr; if (parseStackObj->hasExpressions()) { CParsingExpressionSplitter mParsingExpSpl(parseStackObj->getExpressions()); if (mParsingExpSpl.proofExpressionComposition(0,0,0,2,0)) { ruleDiffIndAtomExp = new CRuleDifferentIndividualsAtomTermExpression(mParsingExpSpl.getFirstClassVariableTermExpression(),mParsingExpSpl.getSecondClassVariableTermExpression()); mRuleExpContainer.append(ruleDiffIndAtomExp); } } return ruleDiffIndAtomExp; } CRulePropertyAtomTermExpression* CXMLOWL2StreamHandler::parseRuleObjectPropertyAtomNode(CStreamParseStackObject* parseStackObj) { CRulePropertyAtomTermExpression* rulePropertyAtomExp = nullptr; if (parseStackObj->hasExpressions()) { CParsingExpressionSplitter mParsingExpSpl(parseStackObj->getExpressions()); if (mParsingExpSpl.proofExpressionComposition(0,1,0,2,0)) { rulePropertyAtomExp = new CRulePropertyAtomTermExpression(mParsingExpSpl.getFirstClassVariableTermExpression(),mParsingExpSpl.getSecondClassVariableTermExpression(),mParsingExpSpl.getFirstObjectPropertyTermExpression()); mRuleExpContainer.append(rulePropertyAtomExp); } } return rulePropertyAtomExp; } CRuleClassAtomTermExpression* CXMLOWL2StreamHandler::parseRuleClassAtomNode(CStreamParseStackObject* parseStackObj) { CRuleClassAtomTermExpression* ruleClassAtomExp = nullptr; if (parseStackObj->hasExpressions()) { CParsingExpressionSplitter mParsingExpSpl(parseStackObj->getExpressions()); if (mParsingExpSpl.proofExpressionComposition(2,0,0,1,1)) { ruleClassAtomExp = new CRuleClassAtomTermExpression(mParsingExpSpl.getFirstClassTermExpression(),mParsingExpSpl.getFirstClassVariableTermExpression()); mRuleExpContainer.append(ruleClassAtomExp); } } return ruleClassAtomExp; } CRuleAtomListBodyExpression* CXMLOWL2StreamHandler::parseRuleAtomBodyNode(CStreamParseStackObject* parseStackObj) { CRuleAtomListBodyExpression* ruleAtomBodyExp = nullptr; if (parseStackObj->hasExpressions()) { QList* expList = &parseStackObj->mExpList; QList atomExpList; for (QList::const_iterator it = expList->constBegin(), itEnd = expList->constEnd(); it != itEnd; ++it) { CRuleAtomTermExpression* ruleAtTeExp = dynamic_cast(*it); if (ruleAtTeExp) { atomExpList.append(ruleAtTeExp); } } if (!atomExpList.isEmpty()) { ruleAtomBodyExp = new CRuleAtomListBodyExpression(atomExpList); mRuleExpContainer.append(ruleAtomBodyExp); } } return ruleAtomBodyExp; } CRuleAtomListHeadExpression* CXMLOWL2StreamHandler::parseRuleAtomHeadNode(CStreamParseStackObject* parseStackObj) { CRuleAtomListHeadExpression* ruleAtomHeadExp = nullptr; if (parseStackObj->hasExpressions()) { QList* expList = &parseStackObj->mExpList; QList atomExpList; for (QList::const_iterator it = expList->constBegin(), itEnd = expList->constEnd(); it != itEnd; ++it) { CRuleAtomTermExpression* ruleAtTeExp = dynamic_cast(*it); if (ruleAtTeExp) { atomExpList.append(ruleAtTeExp); } } if (!atomExpList.isEmpty()) { ruleAtomHeadExp = new CRuleAtomListHeadExpression(atomExpList); mRuleExpContainer.append(ruleAtomHeadExp); } } return ruleAtomHeadExp; } QHash CXMLOWL2StreamHandler::createVariableAtomHash(const QList& atomList) { QHash variableAtomHash; foreach (CParseRuleAtom* atom, atomList) { if (!atom->mVariableName1.isEmpty()) { variableAtomHash.insertMulti(atom->mVariableName1,atom); } if (!atom->mVariableName2.isEmpty()) { variableAtomHash.insertMulti(atom->mVariableName2,atom); } } return variableAtomHash; } QMap CXMLOWL2StreamHandler::createVariableCountMap(const QList& atomList) { QHash variableCountHash; foreach (CParseRuleAtom* atom, atomList) { if (!atom->mVariableName1.isEmpty()) { cint64 prevCount = variableCountHash.value(atom->mVariableName1,0); variableCountHash.insert(atom->mVariableName1,prevCount+1); } if (!atom->mVariableName2.isEmpty()) { cint64 prevCount = variableCountHash.value(atom->mVariableName2,0); variableCountHash.insert(atom->mVariableName2,prevCount+1); } } QMap countVariableMap; for (QHash::const_iterator it = variableCountHash.constBegin(), itEnd = variableCountHash.constEnd(); it != itEnd; ++it) { const QString& variableName = it.key(); cint64 variableAtomCount = it.value(); countVariableMap.insertMulti(variableAtomCount,variableName); } return countVariableMap; } QList CXMLOWL2StreamHandler::parseRuleAtomNodes(CStreamParseStackObject* parseStackObj, const CQtList& buildExpList, bool parseHeadAtoms) { QList atomList; for (CQtList::const_iterator it1 = buildExpList.constBegin(), it1End = buildExpList.constEnd(); it1 != it1End; ++it1) { CRuleAtomListExpression* buildListExp = nullptr; CRuleAtomListBodyExpression* buildBodyListExp = dynamic_cast(*it1); CRuleAtomListHeadExpression* buildHeadListExp = dynamic_cast(*it1); if (parseHeadAtoms) { buildListExp = buildHeadListExp; } if (!parseHeadAtoms) { buildListExp = buildBodyListExp; } if (buildListExp) { CEXPRESSIONLIST* ruleAtomExpList = buildListExp->getRuleAtomTermExpressionList(); for (CEXPRESSIONLIST::const_iterator it2 = ruleAtomExpList->constBegin(), it2End = ruleAtomExpList->constEnd(); it2 != it2End; ++it2) { CRuleAtomTermExpression* ruleAtomExp = *it2; CParseRuleAtom* ruleAtom = nullptr; if (ruleAtomExp->getType() == CBuildExpression::BETRULEPROPERTYATOM) { CRulePropertyAtomTermExpression* rulePropertyAtomExp = (CRulePropertyAtomTermExpression*)ruleAtomExp; CEXPRESSIONLIST* varList = rulePropertyAtomExp->getClassVariableTermExpressionList(); ruleAtom = new CParseRuleAtom(CParseRuleAtom::PROPERTYATOM); ruleAtom->mVariableName1 = varList->first()->getName(); ruleAtom->mVariableName2 = varList->last()->getName(); ruleAtom->mAtomExpression = rulePropertyAtomExp->getObjectPropertyTermExpression(); atomList.append(ruleAtom); } else if (ruleAtomExp->getType() == CBuildExpression::BETRULECLASSATOM) { CRuleClassAtomTermExpression* ruleClassAtomExp = (CRuleClassAtomTermExpression*)ruleAtomExp; ruleAtom = new CParseRuleAtom(CParseRuleAtom::CLASSATOM); ruleAtom->mVariableName1 = ruleClassAtomExp->getClassVariableExpression()->getName(); ruleAtom->mAtomExpression = ruleClassAtomExp->getClassTermExpression(); atomList.append(ruleAtom); } else if (ruleAtomExp->getType() == CBuildExpression::BETRULEDIFFERENTINDIVIDUALSATOM) { CRuleDifferentIndividualsAtomTermExpression* diffIndAtomExp = (CRuleDifferentIndividualsAtomTermExpression*)ruleAtomExp; ruleAtom = new CParseRuleAtom(CParseRuleAtom::DIFFERENTINDIVIDUALSATOM); CEXPRESSIONLIST* varList = diffIndAtomExp->getClassVariableTermExpressionList(); ruleAtom->mVariableName1 = varList->first()->getName(); ruleAtom->mVariableName2 = varList->last()->getName(); atomList.append(ruleAtom); } } } } return atomList; } void CXMLOWL2StreamHandler::parseRuleNode(CStreamParseStackObject* parseStackObj) { if (parseStackObj->hasExpressions()) { QList expressionList; QHash bodyVariableAtomHash; QHash headVariableAtomHash; CQtList buildExpList(*parseStackObj->getExpressions()); QList bodyVariableAtomList = parseRuleAtomNodes(parseStackObj,buildExpList,false); QList headVariableAtomList = parseRuleAtomNodes(parseStackObj,buildExpList,true); bodyVariableAtomHash = createVariableAtomHash(bodyVariableAtomList); headVariableAtomHash = createVariableAtomHash(headVariableAtomList); QMap headCountVariableMap = createVariableCountMap(headVariableAtomList); QSet headProcessedAtomSet; QList reversHeadCountVariableList; for (QMap::const_iterator it = headCountVariableMap.constBegin(), itEnd = headCountVariableMap.constEnd(); it != itEnd; ++it) { const QString& varString = it.value(); reversHeadCountVariableList.prepend(varString); } for (QList::const_iterator it = reversHeadCountVariableList.constBegin(), itEnd = reversHeadCountVariableList.constEnd(); it != itEnd; ++it) { const QString& varString = *it; QSet processedBodyAtoms; QList headAtomList = headVariableAtomHash.values(varString); QList headExpressionList; foreach (CParseRuleAtom* headAtom, headAtomList) { if (!headProcessedAtomSet.contains(headAtom)) { headProcessedAtomSet.insert(headAtom); if (headAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) { bool inversed = false; QString otherVarString = headAtom->getOtherVariable(varString,inversed); CBuildExpression* otherVarExp = mOntoBuilder->getIndividualVariable(otherVarString,mAxiomNumber); CBuildExpression* someExp = mOntoBuilder->getObjectSomeValuesFrom(getNeighbourAtomObjectPropertyExpression(headAtom,inversed),otherVarExp); headExpressionList.append(someExp); } else if (headAtom->mAtomType == CParseRuleAtom::CLASSATOM) { headExpressionList.append(headAtom->mAtomExpression); } else if (headAtom->mAtomType == CParseRuleAtom::DIFFERENTINDIVIDUALSATOM) { bool inversed = false; QString otherVarString = headAtom->getOtherVariable(varString,inversed); CBuildExpression* otherVarExp = mOntoBuilder->getIndividualVariable(otherVarString,mAxiomNumber); CBuildExpression* complExp = mOntoBuilder->getObjectComplementOf(otherVarExp); headExpressionList.append(complExp); } } } if (!headExpressionList.isEmpty()) { CBuildExpression* headExp = nullptr; if (headExpressionList.count() >= 2) { headExp = mOntoBuilder->getObjectIntersectionOf(headExpressionList); } else { headExp = headExpressionList.first(); } CBuildExpression* bodyExp = createBodyExpresions(varString,bodyVariableAtomHash,headVariableAtomHash); CBuildExpression* axiomExp = mOntoBuilder->getSubClassOf(bodyExp,headExp); expressionList.append(axiomExp); } ++mAxiomNumber; } addTemporaryBuildExpressions(&expressionList); } } CBuildExpression* CXMLOWL2StreamHandler::createBodyExpresions(const QString& varString, QHash& bodyVariableAtomHash, QHash& headVariableAtomHash) { QSet processedVarSet; QSet processedAtomSet; QList expList; CBuildExpression* mainExp = createBodyExpresions(varString,true,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash); expList.append(mainExp); for (QHash::const_iterator it = bodyVariableAtomHash.constBegin(), itEnd = bodyVariableAtomHash.constEnd(); it != itEnd; ++it) { QString nextVarString = it.key(); if (!processedVarSet.contains(nextVarString)) { CBuildExpression* topPropExp = mOntoBuilder->getTopObjectProberty(); CBuildExpression* succExp = createBodyExpresions(nextVarString,true,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash); CBuildExpression* someExp = mOntoBuilder->getObjectSomeValuesFrom(topPropExp,succExp); expList.append(someExp); } } if (expList.count() >= 2) { return mOntoBuilder->getObjectIntersectionOf(expList); } return expList.first(); } CBuildExpression* CXMLOWL2StreamHandler::getNeighbourAtomObjectPropertyExpression(CParseRuleAtom* ruleAtom, bool inversed) { if (!inversed) { return ruleAtom->mAtomExpression; } else { return mOntoBuilder->getInverseObjectPropertyOf(ruleAtom->mAtomExpression); } } bool CXMLOWL2StreamHandler::hasBackExpressionLinks(const QString& varString, CParseRuleAtom* notRuleAtom, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash) { QSet backTestProcessedVarSet; QSet backTestProcessedAtomSet; return hasBackExpressionLinks(varString,notRuleAtom,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash,backTestProcessedVarSet,backTestProcessedAtomSet); } bool CXMLOWL2StreamHandler::hasBackExpressionLinks(const QString& varString, CParseRuleAtom* notRuleAtom, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash, QSet& backTestProcessedVarSet, QSet& backTestProcessedAtomSet) { if (processedVarSet.contains(varString)) { return false; } if (!backTestProcessedVarSet.contains(varString)) { backTestProcessedVarSet.insert(varString); QList atomList = bodyVariableAtomHash.values(varString); foreach (CParseRuleAtom* ruleAtom, atomList) { if (ruleAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) { if (ruleAtom != notRuleAtom) { if (processedAtomSet.contains(ruleAtom)) { return true; } if (!backTestProcessedAtomSet.contains(ruleAtom)) { backTestProcessedAtomSet.insert(ruleAtom); bool inversed = false; QString otherVarString = ruleAtom->getOtherVariable(varString,inversed); if (hasBackExpressionLinks(otherVarString,ruleAtom,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash,backTestProcessedVarSet,backTestProcessedAtomSet)) { return true; } } } } } } return false; } CBuildExpression* CXMLOWL2StreamHandler::createBodyExpresions(const QString& varString, bool direct, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash) { QList expList; expList.append(mOntoBuilder->getIndividualVariable(varString,mAxiomNumber)); if (!processedVarSet.contains(varString)) { processedVarSet.insert(varString); QList atomList = bodyVariableAtomHash.values(varString); QList processList; foreach (CParseRuleAtom* ruleAtom, atomList) { if (ruleAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) { if (!processedAtomSet.contains(ruleAtom)) { bool inversed = false; QString otherVarString = ruleAtom->getOtherVariable(varString,inversed); if (direct || !headVariableAtomHash.contains(varString) || !hasBackExpressionLinks(otherVarString,ruleAtom,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash)) { processedAtomSet.insert(ruleAtom); processList.append(ruleAtom); } } } else if (ruleAtom->mAtomType == CParseRuleAtom::CLASSATOM) { processList.append(ruleAtom); } else if (ruleAtom->mAtomType == CParseRuleAtom::DIFFERENTINDIVIDUALSATOM) { if (!processedAtomSet.contains(ruleAtom)) { processedAtomSet.insert(ruleAtom); processList.append(ruleAtom); } } } foreach (CParseRuleAtom* ruleAtom, processList) { if (ruleAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) { bool inversed = false; QString otherVarString = ruleAtom->getOtherVariable(varString,inversed); CBuildExpression* succExp = createBodyExpresions(otherVarString,false,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash); CBuildExpression* someExp = mOntoBuilder->getObjectSomeValuesFrom(getNeighbourAtomObjectPropertyExpression(ruleAtom,inversed),succExp); expList.append(someExp); } else if (ruleAtom->mAtomType == CParseRuleAtom::CLASSATOM) { expList.append(ruleAtom->mAtomExpression); } else if (ruleAtom->mAtomType == CParseRuleAtom::DIFFERENTINDIVIDUALSATOM) { bool inversed = false; QString otherVarString = ruleAtom->getOtherVariable(varString,inversed); CBuildExpression* otherVarExp = mOntoBuilder->getIndividualVariable(otherVarString,mAxiomNumber); CBuildExpression* complExp = mOntoBuilder->getObjectComplementOf(otherVarExp); expList.append(complExp); } } } if (expList.count() >= 2) { return mOntoBuilder->getObjectIntersectionOf(expList); } return expList.first(); } CDeclarationAxiomExpression* CXMLOWL2StreamHandler::parseDeclarationNode(CStreamParseStackObject* parseStackObj) { CDeclarationAxiomExpression* declarationExpression = nullptr; if (parseStackObj->hasExpressions()) { declarationExpression = mOntoBuilder->getDeclaration(*parseStackObj->getExpressions()); ++mAxiomNumber; } return declarationExpression; } CObjectPropertyExpression *CXMLOWL2StreamHandler::parseObjectPropertyNode(const QXmlStreamAttributes& attributes) { const CStringRefStringHasher& probName = getEntityName(attributes); CObjectPropertyExpression *objectExpression = 0; if (!probName.isEmpty()) { objectExpression = mOntoBuilder->getObjectProberty(probName.toStringRefernce()); } return objectExpression; } CClassExpression *CXMLOWL2StreamHandler::parseClassNode(const QXmlStreamAttributes& attributes) { const CStringRefStringHasher& className = getEntityName(attributes); CClassExpression *classExpression = 0; if (!className.isEmpty()) { classExpression = mOntoBuilder->getClass(className.toStringRefernce()); } return classExpression; } CObjectIndividualVariableExpression* CXMLOWL2StreamHandler::parseIndividualVariableNode(const QXmlStreamAttributes& attributes) { const CStringRefStringHasher& indiVarName = getEntityName(attributes); CObjectIndividualVariableExpression *indiVarExpression = 0; if (!indiVarName.isEmpty()) { indiVarExpression = mOntoBuilder->getIndividualVariable(indiVarName.toStringRefernce(),mAxiomNumber); } return indiVarExpression; } CEquivalentClassesExpression *CXMLOWL2StreamHandler::parseEquivalentClassesNode(CStreamParseStackObject* parseStackObj) { CEquivalentClassesExpression *ecExp = 0; if (parseStackObj->hasExpressions()) { ecExp = mOntoBuilder->getEquivalentClasses(*parseStackObj->getExpressions()); ++mAxiomNumber; } return ecExp; } CSubClassOfExpression *CXMLOWL2StreamHandler::parseSubClassOfNode(CStreamParseStackObject* parseStackObj) { CSubClassOfExpression *scoExp = 0; if (parseStackObj->hasExpressions()) { scoExp = mOntoBuilder->getSubClassOf(*parseStackObj->getExpressions()); ++mAxiomNumber; } return scoExp; } CObjectPropertyDomainExpression *CXMLOWL2StreamHandler::parseObjectPropertyDomainNode(CStreamParseStackObject* parseStackObj) { CObjectPropertyDomainExpression *obPrDoExp = 0; if (parseStackObj->hasExpressions()) { obPrDoExp = mOntoBuilder->getObjectPropertyDomainExpression(*parseStackObj->getExpressions()); ++mAxiomNumber; } return obPrDoExp; } CObjectPropertyRangeExpression *CXMLOWL2StreamHandler::parseObjectPropertyRangeNode(CStreamParseStackObject* parseStackObj) { CObjectPropertyRangeExpression *obPrRaExp = 0; if (parseStackObj->hasExpressions()) { obPrRaExp = mOntoBuilder->getObjectPropertyRangeExpression(*parseStackObj->getExpressions()); ++mAxiomNumber; } return obPrRaExp; } CSubObjectPropertyOfExpression *CXMLOWL2StreamHandler::parseSubObjectPropertyOfNode(CStreamParseStackObject* parseStackObj) { CSubObjectPropertyOfExpression *sopoExp = 0; if (parseStackObj->hasExpressions()) { sopoExp = mOntoBuilder->getSubObjectPropertyOf(*parseStackObj->getExpressions()); ++mAxiomNumber; } return sopoExp; } CObjectPropertyChainExpression *CXMLOWL2StreamHandler::parseObjectPropertyChainNode(CStreamParseStackObject* parseStackObj) { CObjectPropertyChainExpression *sopoExp = 0; if (parseStackObj->hasExpressions()) { sopoExp = mOntoBuilder->getObjectPropertyChain(*parseStackObj->getExpressions()); } return sopoExp; } CEquivalentObjectPropertiesExpression *CXMLOWL2StreamHandler::parseEquivalentObjectPropertiesNode(CStreamParseStackObject* parseStackObj) { CEquivalentObjectPropertiesExpression *sopoExp = 0; if (parseStackObj->hasExpressions()) { sopoExp = mOntoBuilder->getEquivalentObjectProperties(*parseStackObj->getExpressions()); ++mAxiomNumber; } return sopoExp; } CDisjointObjectPropertiesExpression *CXMLOWL2StreamHandler::parseDisjointObjectPropertiesNode(CStreamParseStackObject* parseStackObj) { CDisjointObjectPropertiesExpression *sopoExp = 0; if (parseStackObj->hasExpressions()) { sopoExp = mOntoBuilder->getDisjointObjectProperties(*parseStackObj->getExpressions()); ++mAxiomNumber; } return sopoExp; } CInverseObjectPropertyOfExpression *CXMLOWL2StreamHandler::parseInverseObjectPropertyOfNode(CStreamParseStackObject* parseStackObj) { CInverseObjectPropertyOfExpression *iopoExp = 0; if (parseStackObj->hasExpressions()) { iopoExp = mOntoBuilder->getInverseObjectPropertyOf(*parseStackObj->getExpressions()); } return iopoExp; } CInverseObjectPropertiesExpression *CXMLOWL2StreamHandler::parseInverseObjectPropertiesNode(CStreamParseStackObject* parseStackObj) { CInverseObjectPropertiesExpression *iopoExp = 0; if (parseStackObj->hasExpressions()) { iopoExp = mOntoBuilder->getInverseObjectProperties(*parseStackObj->getExpressions()); ++mAxiomNumber; } return iopoExp; } CDisjointClassesExpression *CXMLOWL2StreamHandler::parseDisjontClassesNode(CStreamParseStackObject* parseStackObj) { CDisjointClassesExpression *disClassExp = 0; if (parseStackObj->hasExpressions()) { disClassExp = mOntoBuilder->getDisjointClasses(*parseStackObj->getExpressions()); ++mAxiomNumber; } return disClassExp; } CDisjointUnionExpression *CXMLOWL2StreamHandler::parseDisjontUnionNode(CStreamParseStackObject* parseStackObj) { CDisjointUnionExpression *disClassExp = 0; if (parseStackObj->hasExpressions()) { disClassExp = mOntoBuilder->getDisjointUnion(*parseStackObj->getExpressions()); } return disClassExp; } CObjectIntersectionOfExpression *CXMLOWL2StreamHandler::parseObjectIntersectionOfNode(CStreamParseStackObject* parseStackObj) { CObjectIntersectionOfExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectIntersectionOf(*parseStackObj->getExpressions()); } return exp; } CObjectUnionOfExpression *CXMLOWL2StreamHandler::parseObjectUnionOfNode(CStreamParseStackObject* parseStackObj) { CObjectUnionOfExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectUnionOf(*parseStackObj->getExpressions()); } return exp; } CObjectMaxCardinalityExpression *CXMLOWL2StreamHandler::parseObjectMaxCardinalityNode(CStreamParseStackObject* parseStackObj) { cint64 cardinality = parseStackObj->mCardinality; CObjectMaxCardinalityExpression *exp = 0; if (parseStackObj->mCardinalityParsed) { exp = mOntoBuilder->getObjectMaxCardinality(*parseStackObj->getExpressions(),cardinality); } return exp; } CObjectMinCardinalityExpression *CXMLOWL2StreamHandler::parseObjectMinCardinalityNode(CStreamParseStackObject* parseStackObj) { cint64 cardinality = parseStackObj->mCardinality; CObjectMinCardinalityExpression *exp = 0; if (parseStackObj->mCardinalityParsed) { exp = mOntoBuilder->getObjectMinCardinality(*parseStackObj->getExpressions(),cardinality); } return exp; } CObjectExactlyCardinalityExpression *CXMLOWL2StreamHandler::parseObjectExactlyCardinalityNode(CStreamParseStackObject* parseStackObj) { cint64 cardinality = parseStackObj->mCardinality; CObjectExactlyCardinalityExpression *exp = 0; if (parseStackObj->mCardinalityParsed) { exp = mOntoBuilder->getObjectExactlyCardinality(*parseStackObj->getExpressions(),cardinality); } return exp; } CObjectSomeValuesFromExpression *CXMLOWL2StreamHandler::parseObjectSomeValuesFromNode(CStreamParseStackObject* parseStackObj) { CObjectSomeValuesFromExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectSomeValuesFrom(*parseStackObj->getExpressions()); } return exp; } CObjectHasValueExpression* CXMLOWL2StreamHandler::parseObjectHasValueNode(CStreamParseStackObject* parseStackObj) { CObjectHasValueExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectHasValue(*parseStackObj->getExpressions()); } return exp; } CObjectHasSelfExpression* CXMLOWL2StreamHandler::parseObjectHasSelfNode(CStreamParseStackObject* parseStackObj) { CObjectHasSelfExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectHasSelf(*parseStackObj->getExpressions()); } return exp; } CObjectAllValuesFromExpression *CXMLOWL2StreamHandler::parseObjectAllValuesFromNode(CStreamParseStackObject* parseStackObj) { CObjectAllValuesFromExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectAllValuesFrom(*parseStackObj->getExpressions()); } return exp; } CObjectComplementOfExpression *CXMLOWL2StreamHandler::parseObjectComplementOfNode(CStreamParseStackObject* parseStackObj) { CObjectComplementOfExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectComplementOf(*parseStackObj->getExpressions()); } return exp; } CObjectOneOfExpression *CXMLOWL2StreamHandler::parseObjectOneOfNode(CStreamParseStackObject* parseStackObj) { CObjectOneOfExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectOneOf(*parseStackObj->getExpressions()); } return exp; } CTransetiveObjectPropertyExpression *CXMLOWL2StreamHandler::parseTransetiveObjectPropertyNode(CStreamParseStackObject* parseStackObj) { CTransetiveObjectPropertyExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getTransetiveObjectProperty(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CFunctionalObjectPropertyExpression *CXMLOWL2StreamHandler::parseFunctionalObjectPropertyNode(CStreamParseStackObject* parseStackObj) { CFunctionalObjectPropertyExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getFunctionalObjectProperty(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CSymmetricObjectPropertyExpression* CXMLOWL2StreamHandler::parseSymmetricObjectPropertyNode(CStreamParseStackObject* parseStackObj) { CSymmetricObjectPropertyExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getSymmetricObjectProperty(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CAsymmetricObjectPropertyExpression* CXMLOWL2StreamHandler::parseAsymmetricObjectPropertyNode(CStreamParseStackObject* parseStackObj) { CAsymmetricObjectPropertyExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getAsymmetricObjectProperty(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CReflexiveObjectPropertyExpression* CXMLOWL2StreamHandler::parseReflexiveObjectPropertyNode(CStreamParseStackObject* parseStackObj) { CReflexiveObjectPropertyExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getReflexiveObjectProperty(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CIrreflexiveObjectPropertyExpression* CXMLOWL2StreamHandler::parseIrreflexiveObjectPropertyNode(CStreamParseStackObject* parseStackObj) { CIrreflexiveObjectPropertyExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getIrreflexiveObjectProperty(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CInverseFunctionalObjectPropertyExpression* CXMLOWL2StreamHandler::parseInverseFunctionalObjectPropertyNode(CStreamParseStackObject* parseStackObj) { CInverseFunctionalObjectPropertyExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getInverseFunctionalObjectProperty(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CClassAssertionExpression *CXMLOWL2StreamHandler::parseClassAssertionNode(CStreamParseStackObject* parseStackObj) { CClassAssertionExpression *exp = 0; if (parseStackObj->hasExpressions()) { exp = mOntoBuilder->getClassAssertion(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CSameIndividualExpression *CXMLOWL2StreamHandler::parseSameIndividualNode(CStreamParseStackObject* parseStackObj) { CSameIndividualExpression *exp = 0; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getSameIndividual(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CDifferentIndividualsExpression *CXMLOWL2StreamHandler::parseDifferentIndividualsNode(CStreamParseStackObject* parseStackObj) { CDifferentIndividualsExpression *exp = 0; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getDifferentIndividuals(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CNamedIndividualExpression *CXMLOWL2StreamHandler::parseNamedIndividualNode(const QXmlStreamAttributes& attributes) { const CStringRefStringHasher& indiNameName = getEntityName(attributes); CNamedIndividualExpression *exp = 0; if (!indiNameName.isEmpty()) { if (mOntoBuilder) { exp = mOntoBuilder->getNamedIndividual(indiNameName.toStringRefernce()); } } return exp; } CAnonymousIndividualExpression *CXMLOWL2StreamHandler::parseAnonymousIndividualNode(const QXmlStreamAttributes& attributes) { if (mOntologyName.isEmpty()) { mOntologyName = mOntoBuilder->getOntologyName(); } QStringRef indiNameName = getNodeID(attributes); CAnonymousIndividualExpression *exp = 0; if (!indiNameName.isEmpty()) { if (mOntoBuilder) { exp = mOntoBuilder->getAnonymousIndividual(mOntologyName.leftRef(-1),indiNameName); } } return exp; } CObjectPropertyAssertionExpression *CXMLOWL2StreamHandler::parseObjectPropertyAssertionNode(CStreamParseStackObject* parseStackObj) { CObjectPropertyAssertionExpression *exp = 0; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getObjectPropertyAssertion(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CNegativeObjectPropertyAssertionExpression *CXMLOWL2StreamHandler::parseNegativeObjectPropertyAssertionNode(CStreamParseStackObject* parseStackObj) { CNegativeObjectPropertyAssertionExpression *exp = 0; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getNegativeObjectPropertyAssertion(*parseStackObj->getExpressions()); ++mAxiomNumber; } return exp; } CDatatypeExpression *CXMLOWL2StreamHandler::parseDatatypeNode(const QXmlStreamAttributes& attributes) { const CStringRefStringHasher& datatypeIRIName = getEntityName(attributes); CDatatypeExpression* exp = nullptr; if (!datatypeIRIName.isEmpty()) { if (mOntoBuilder) { exp = mOntoBuilder->getDatatype(datatypeIRIName.toStringRefernce()); } } return exp; } CDataSomeValuesFromExpression *CXMLOWL2StreamHandler::parseDataSomeValuesFromNode(CStreamParseStackObject* parseStackObj) { CDataSomeValuesFromExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getDataSomeValuesFrom(*parseStackObj->getExpressions()); } return exp; } CDataAllValuesFromExpression *CXMLOWL2StreamHandler::parseDataAllValuesFromNode(CStreamParseStackObject* parseStackObj) { CDataAllValuesFromExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getDataAllValuesFrom(*parseStackObj->getExpressions()); } return exp; } CDataHasValueExpression *CXMLOWL2StreamHandler::parseDataHasValueNode(CStreamParseStackObject* parseStackObj) { CDataHasValueExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getDataHasValue(*parseStackObj->getExpressions()); } return exp; } CDataIntersectionOfExpression *CXMLOWL2StreamHandler::parseDataIntersectionOfNode(CStreamParseStackObject* parseStackObj) { CDataIntersectionOfExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getDataIntersectionOf(*parseStackObj->getExpressions()); } return exp; } CDataOneOfExpression *CXMLOWL2StreamHandler::parseDataOneOfNode(CStreamParseStackObject* parseStackObj) { CDataOneOfExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getDataOneOf(*parseStackObj->getExpressions()); } return exp; } CDataUnionOfExpression *CXMLOWL2StreamHandler::parseDataUnionOfNode(CStreamParseStackObject* parseStackObj) { CDataUnionOfExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getDataUnionOf(*parseStackObj->getExpressions()); } return exp; } CDataComplementOfExpression *CXMLOWL2StreamHandler::parseDataComplementOfNode(CStreamParseStackObject* parseStackObj) { CDataComplementOfExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getDataComplementOf(*parseStackObj->getExpressions()); } return exp; } CDatatypeRestrictionExpression *CXMLOWL2StreamHandler::parseDatatypeRestrictionNode(CStreamParseStackObject* parseStackObj) { CDatatypeRestrictionExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getDatatypeRestriction(*parseStackObj->getExpressions()); } return exp; } CDataMaxCardinalityExpression *CXMLOWL2StreamHandler::parseDataMaxCardinalityNode(CStreamParseStackObject* parseStackObj) { CDataMaxCardinalityExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions() && parseStackObj->mCardinalityParsed) { exp = mOntoBuilder->getDataMaxCardinality(*parseStackObj->getExpressions(),parseStackObj->mCardinality); } return exp; } CDataMinCardinalityExpression *CXMLOWL2StreamHandler::parseDataMinCardinalityNode(CStreamParseStackObject* parseStackObj) { CDataMinCardinalityExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions() && parseStackObj->mCardinalityParsed) { exp = mOntoBuilder->getDataMinCardinality(*parseStackObj->getExpressions(),parseStackObj->mCardinality); } return exp; } CDataExactCardinalityExpression *CXMLOWL2StreamHandler::parseDataExactCardinalityNode(CStreamParseStackObject* parseStackObj) { CDataExactCardinalityExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions() && parseStackObj->mCardinalityParsed) { exp = mOntoBuilder->getDataExactCardinality(*parseStackObj->getExpressions(),parseStackObj->mCardinality); } return exp; } CDataPropertyAssertionExpression *CXMLOWL2StreamHandler::parseDataPropertyAssertionNode(CStreamParseStackObject* parseStackObj) { CDataPropertyAssertionExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getDataPropertyAssertion(*parseStackObj->getExpressions()); } return exp; } CNegativeDataPropertyAssertionExpression *CXMLOWL2StreamHandler::parseNegativeDataPropertyAssertionNode(CStreamParseStackObject* parseStackObj) { CNegativeDataPropertyAssertionExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getNegativeDataPropertyAssertion(*parseStackObj->getExpressions()); } return exp; } CSubDataPropertyOfExpression *CXMLOWL2StreamHandler::parseSubDataPropertyOfNode(CStreamParseStackObject* parseStackObj) { CSubDataPropertyOfExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getSubDataPropertyOf(*parseStackObj->getExpressions()); } return exp; } CEquivalentDataPropertiesExpression *CXMLOWL2StreamHandler::parseEquivalentDataPropertiesNode(CStreamParseStackObject* parseStackObj) { CEquivalentDataPropertiesExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getEquivalentDataProperties(*parseStackObj->getExpressions()); } return exp; } CDisjointDataPropertiesExpression *CXMLOWL2StreamHandler::parseDisjointDataPropertiesNode(CStreamParseStackObject* parseStackObj) { CDisjointDataPropertiesExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getDisjointDataProperties(*parseStackObj->getExpressions()); } return exp; } CDataPropertyDomainExpression *CXMLOWL2StreamHandler::parseDataPropertyDomainNode(CStreamParseStackObject* parseStackObj) { CDataPropertyDomainExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getDataPropertyDomainExpression(*parseStackObj->getExpressions()); } return exp; } CDataPropertyRangeExpression *CXMLOWL2StreamHandler::parseDataPropertyRangeNode(CStreamParseStackObject* parseStackObj) { CDataPropertyRangeExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getDataPropertyRangeExpression(*parseStackObj->getExpressions()); } return exp; } CFunctionalDataPropertyExpression *CXMLOWL2StreamHandler::parseFunctionalDataPropertyNode(CStreamParseStackObject* parseStackObj) { CFunctionalDataPropertyExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { exp = mOntoBuilder->getFunctionalDataProperty(*parseStackObj->getExpressions()); } return exp; } CDataFacetRestrictionExpression* CXMLOWL2StreamHandler::parseDataFacetRestrictionNode(CStreamParseStackObject* parseStackObj) { CDataFacetRestrictionExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->hasExpressions()) { CQtList expList(*parseStackObj->getExpressions()); CDataFacetExpression* dataFacetExp = mOntoBuilder->getDataFacet(parseStackObj->getParsedIRI()); expList.append(dataFacetExp); exp = mOntoBuilder->getDataFacetRestriction(expList); } return exp; } CDataLiteralExpression *CXMLOWL2StreamHandler::parseDataLiteralNode(CStreamParseStackObject* parseStackObj) { CDataLiteralExpression* exp = nullptr; if (mOntoBuilder && parseStackObj->mIRIParsed) { QString datatypeIRIString = parseStackObj->getParsedIRI(); CDatatypeExpression* datatypeExpression = mOntoBuilder->getDatatype(datatypeIRIString); QString valueString = mLastReadText; if (!mLastTextAppendix.isEmpty()) { valueString = mLastReadText+"@"+mLastTextAppendix; } CDataLexicalValueExpression* dataLexicalValueExpression = mOntoBuilder->getDataLexicalValue(valueString); exp = mOntoBuilder->getDataLiteral(dataLexicalValueExpression,datatypeExpression); } return exp; } CDataPropertyExpression *CXMLOWL2StreamHandler::parseDataPropertyNode(const QXmlStreamAttributes& attributes) { const CStringRefStringHasher& probName = getEntityName(attributes); CDataPropertyExpression *objectExpression = 0; if (!probName.isEmpty()) { objectExpression = mOntoBuilder->getDataProberty(probName.toStringRefernce()); } return objectExpression; } void CXMLOWL2StreamHandler::jumpFunctionParseRuleNode(CStreamParseStackObject* parseStackObj) { parseRuleNode(parseStackObj); } void CXMLOWL2StreamHandler::jumpFunctionParseRulePropertyAtomNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseRuleObjectPropertyAtomNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseRuleClassAtomNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseRuleClassAtomNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDifferentIndividualsAtomNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseRuleDifferentIndividualsAtomNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataPropertyNode(const QXmlStreamAttributes& attributes) { addTemporaryBuildExpression(parseDataPropertyNode(attributes)); } void CXMLOWL2StreamHandler::jumpFunctionParseRuleAtomBodyNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseRuleAtomBodyNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseRuleAtomHeadNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseRuleAtomHeadNode(parseStackObj)); } bool CXMLOWL2StreamHandler::hasOntologyNodeFound() { return mOntologyNodeFound; } void CXMLOWL2StreamHandler::jumpFunctionTellOntologyAxiomNode(CStreamParseStackObject* parseStackObj) { mOntologyNodeFound = true; parseTellOntologyAxiomNode(parseStackObj); } void CXMLOWL2StreamHandler::jumpFunctionRetractOntologyAxiomNode(CStreamParseStackObject* parseStackObj) { parseRetractOntologyAxiomNode(parseStackObj); } void CXMLOWL2StreamHandler::jumpFunctionParsePrefixNode(const QXmlStreamAttributes& attributes) { parsePrefixNode(attributes); } void CXMLOWL2StreamHandler::addTemporaryBuildExpression(CBuildExpression* buildExp) { if (buildExp) { mTmpExpList.append(buildExp); } } void CXMLOWL2StreamHandler::addTemporaryBuildExpressions(QList* buildExps) { if (buildExps) { for (QList::const_iterator it = buildExps->constBegin(), itEnd = buildExps->constEnd(); it != itEnd; ++it) { CBuildExpression* buildExp = *it; if (buildExp) { mTmpExpList.append(buildExp); } } } } void CXMLOWL2StreamHandler::jumpFunctionParseClassNode(const QXmlStreamAttributes& attributes) { addTemporaryBuildExpression(parseClassNode(attributes)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectPropertyNode(const QXmlStreamAttributes& attributes) { addTemporaryBuildExpression(parseObjectPropertyNode(attributes)); } void CXMLOWL2StreamHandler::jumpFunctionParseIndividualVariable(const QXmlStreamAttributes& attributes) { addTemporaryBuildExpression(parseIndividualVariableNode(attributes)); } void CXMLOWL2StreamHandler::jumpFunctionParseDeclarationNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDeclarationNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseEquivalentClassesNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseEquivalentClassesNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseSubClassOfNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseSubClassOfNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDisjontClassesNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDisjontClassesNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDisjontUnionNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDisjontUnionNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseSubObjectPropertyOfNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseSubObjectPropertyOfNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectPropertyChainNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectPropertyChainNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseEquivalentObjectPropertiesNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseEquivalentObjectPropertiesNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDisjointObjectPropertiesNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDisjointObjectPropertiesNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectIntersectionOfNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectIntersectionOfNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectUnionOfNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectUnionOfNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectMaxCardinalityNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectMaxCardinalityNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectMinCardinalityNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectMinCardinalityNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectExactlyCardinalityNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectExactlyCardinalityNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectSomeValuesFromNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectSomeValuesFromNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectAllValuesFromNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectAllValuesFromNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectComplementOfNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectComplementOfNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectOneOfNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectOneOfNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectHasValueNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectHasValueNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectHasSelfNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectHasSelfNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseClassAssertionNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseClassAssertionNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseNamedIndividualNode(const QXmlStreamAttributes& attributes) { addTemporaryBuildExpression(parseNamedIndividualNode(attributes)); } void CXMLOWL2StreamHandler::jumpFunctionParseDatatypeNode(const QXmlStreamAttributes& attributes) { addTemporaryBuildExpression(parseDatatypeNode(attributes)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataSomeValuesFromNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataSomeValuesFromNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataAllValuesFromNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataAllValuesFromNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataHasValueNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataHasValueNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataIntersectionOfNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataIntersectionOfNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataOneOfNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataOneOfNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataUnionOfNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataUnionOfNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataComplementOfNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataComplementOfNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDatatypeRestrictionNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDatatypeRestrictionNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataMaxCardinalityNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataMaxCardinalityNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataMinCardinalityNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataMinCardinalityNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataExactCardinalityNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataExactCardinalityNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataPropertyAssertionNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataPropertyAssertionNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseNegativeDataPropertyAssertionNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseNegativeDataPropertyAssertionNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseSubDataPropertyOfNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseSubDataPropertyOfNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseEquivalentDataPropertiesNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseEquivalentDataPropertiesNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDisjointDataPropertiesNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDisjointDataPropertiesNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataPropertyDomainNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataPropertyDomainNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataPropertyRangeNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataPropertyRangeNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseFunctionalDataPropertyNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseFunctionalDataPropertyNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataFacetRestrictionNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataFacetRestrictionNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDataLiteralNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDataLiteralNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseAnonymousIndividualNode(const QXmlStreamAttributes& attributes) { addTemporaryBuildExpression(parseAnonymousIndividualNode(attributes)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectPropertyAssertionNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectPropertyAssertionNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseNegativeObjectPropertyAssertionNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseNegativeObjectPropertyAssertionNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseSameIndividualNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseSameIndividualNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseDifferentIndividualsNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseDifferentIndividualsNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectPropertyDomainNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectPropertyDomainNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseObjectPropertyRangeNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseObjectPropertyRangeNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseInverseObjectPropertyOfNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseInverseObjectPropertyOfNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseInverseObjectPropertiesNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseInverseObjectPropertiesNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseTransetiveObjectPropertyNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseTransetiveObjectPropertyNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseFunctionalObjectPropertyNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseFunctionalObjectPropertyNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseSymmetricObjectPropertyNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseSymmetricObjectPropertyNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseAsymmetricObjectPropertyNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseAsymmetricObjectPropertyNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseReflexiveObjectPropertyNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseReflexiveObjectPropertyNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseIrreflexiveObjectPropertyNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseIrreflexiveObjectPropertyNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseInverseFunctionalObjectPropertyNode(CStreamParseStackObject* parseStackObj) { addTemporaryBuildExpression(parseInverseFunctionalObjectPropertyNode(parseStackObj)); } void CXMLOWL2StreamHandler::jumpFunctionParseIgnoredNode(CStreamParseStackObject* parseStackObj) { } void CXMLOWL2StreamHandler::jumpFunctionUnsupportedDatatypeNode(CStreamParseStackObject* parseStackObj) { if (mDataTypeReportErrorCount > 0) { --mDataTypeReportErrorCount; LOG(ERROR,getLogDomain(),logTr("Skipped parsing of not supported datatype expression/axiom."),this); } else if (mDataTypeReportErrorCount == 0) { --mDataTypeReportErrorCount; LOG(ERROR,getLogDomain(),logTr("Remaining not supported datatype expressions/axioms are ignored."),this); } } void CXMLOWL2StreamHandler::jumpFunctionUnsupportedRDFNode(CStreamParseStackObject* parseStackObj) { LOG(ERROR,getLogDomain(),logTr("RDF/XML is currently not supported (Protege can be used to convert ontologies into OWL/XML)."),this); } void CXMLOWL2StreamHandler::jumpFunctionParseImportNode(CStreamParseStackObject* parseStackObj) { if (!mLastReadText.isEmpty()) { mOntoBuilder->addOntologyImport(mLastReadText); } } void CXMLOWL2StreamHandler::jumpFunctionUnsupportedImportNode(CStreamParseStackObject* parseStackObj) { if (!mUnsupportedImportError) { mUnsupportedImportError = true; LOG(WARNING,getLogDomain(),logTr("Imports are currently not supported."),this); } } void CXMLOWL2StreamHandler::jumpFunctionUnsupportedAnnotationNode(const QXmlStreamAttributes& attributes) { mIgnoreParsingSubElements = true; mParseIgnoreDepth = mStack.count(); if (!mUnsupportedAnnotationError) { mUnsupportedAnnotationError = true; LOG(WARNING,getLogDomain(),logTr("Annotations are currently not handled."),this); } } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/COWLlinkQtXMLResultParser.h0000644000175000017500000000466112520550736024567 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_COWLLINKQTXMLRESULTPARSER_H #define KONCLUDE_PARSER_COWLLINKQTXMLRESULTPARSER_H // Libraries includes #include #include // Namespace includes #include "CStringPrimitiveConverter.h" // Other includes #include "Reasoner/Query/CBooleanQueryResult.h" #include "Reasoner/Query/CSubClassHierarchyQuery.h" #include "Reasoner/Query/CClassesResult.h" #include "Reasoner/Query/CQueryResult.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; using namespace std; namespace Konclude { using namespace Reasoner::Query; namespace Parser { /*! * * \class COWLlinkQtXMLResultParser * \author Andreas Steigmiller * \version 0.1 * \brief Parser for OWL/XML Files * */ class COWLlinkQtXMLResultParser { // public methods public: //! Constructor COWLlinkQtXMLResultParser(); //! Destructor virtual ~COWLlinkQtXMLResultParser(); CQueryResult *parseQueryResult(QDomElement *node); CBooleanQueryResult *parseBooleanQueryResult(QDomElement *node); CClassesResult *parseClassesResult(QDomElement *node); CClassHierarchyResult *parseClassHierarchyResult(QDomElement *node); CClassSynsetResult *parseClassSynsetResult(QDomElement *node); QStringList parseClassNames(QDomElement *node); // protected methods protected: bool hasTopClass(CClassSynsetResult *classSynset); // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_COWLLINKQTXMLRESULTPARSER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLParsingHandlingContext.h0000644000175000017500000000351112520550742024772 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CXMLPARSINGHANDLINGCONTEXT_H #define KONCLUDE_PARSER_CXMLPARSINGHANDLINGCONTEXT_H // Libraries includes // Namespace includes #include "ParserSettings.h" #include "CParsingHandlingContext.h" #include "CXMLHandlerStack.h" // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class CXMLHandlingContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CXMLParsingHandlingContext : public CParsingHandlingContext { // public methods public: //! Constructor CXMLParsingHandlingContext(); virtual CXMLHandlerStack* getXMLHandlerStack() = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CXMLPARSINGHANDLINGCONTEXT_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CAxiomOntologyBuilder.cpp0000644000175000017500000000241612520550734024452 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAxiomOntologyBuilder.h" namespace Konclude { namespace Parser { CAxiomOntologyBuilder::CAxiomOntologyBuilder() { } CAxiomOntologyBuilder::~CAxiomOntologyBuilder() { } bool CAxiomOntologyBuilder::tellOntologyAxiom(CBuildExpression* axiom) { CAxiomExpression* axiomExp = dynamic_cast(axiom); if (axiomExp) { return tellOntologyAxiom(axiomExp); } return false; } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/COWLlinkQueryParser.h0000644000175000017500000000764612520550736023536 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_COWLlinkQueryParser_H #define KONCLUDE_PARSER_COWLlinkQueryParser_H // Libraries includes #include #include // Namespace includes #include "CQueryParser.h" #include "COntologyParser.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class COWLlinkQueryParser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLlinkQueryParser : public CQueryParser { // public methods public: //! Constructor COWLlinkQueryParser(CQueryBuilder *queryBuilder); //! Destructor virtual ~COWLlinkQueryParser(); virtual bool parseQueryFile(QString filename); virtual CQueryExpression *parseQueryNode(QDomElement *queryNode); // protected methods protected: void parseRequestMessageNode(QDomElement *queryNode); QString getQueryIDNameString(QDomElement* node); CQueryIsClassSatisfiableExpression *parseIsClassSatisfiableNode(QDomElement *node); CQueryAreClassesEquivalentExpression *parseAreClassesEquivalentNode(QDomElement *node); CQueryIsInstanceOfExpression *parseIsInstanceOfNode(QDomElement *node); CQueryIsClassSubsumedByExpression *parseIsClassSubsumedByNode(QDomElement *node); CQueryAreClassesDisjointExpression *parseAreClassesDisjointNode(QDomElement *node); CQueryGetTypesExpression *parseGetTypesNode(QDomElement *node); CQueryGetFlattenedTypesExpression *parseGetFlattenedTypesNode(QDomElement *node); CQueryGetFlattenedInstancesExpression *parseGetFlattenedInstancesNode(QDomElement *node); CQueryGetSameIndividualsExpression* parseGetSameIndividualsNode(QDomElement *node); CQueryGetInstancesExpression *parseGetInstancesNode(QDomElement *node); CQueryGetSubClassesExpression *parseGetSubClassesNode(QDomElement *node); CQueryGetSuperClassesExpression *parseGetSuperClassesNode(QDomElement *node); CQueryGetEquivalentClassesExpression *parseGetEquivalentClassesNode(QDomElement *node); CQueryIsEntailedExpression* parseIsEntailedNode(QDomElement *node); CQueryGetObjectPropertyTargetsExpression* parseGetObjectPropertyTargetsNode(QDomElement *node); CQueryGetFlattenedObjectPropertyTargetsExpression* parseGetFlattenedObjectPropertyTargetsNode(QDomElement *node); CQueryGetDeterministicIndividualsExpression* parseGetDeterministicIndividualsNode(QDomElement *node); CQueryGetNondeterministicIndividualsExpression* parseGetNondeterministicIndividualsNode(QDomElement *node); CQueryGetDeterministicClassAssertionsExpression* parseGetDeterministicClassAssertionsNode(QDomElement *node); CQueryGetNondeterministicClassAssertionsExpression* parseGetNondeterministicClassAssertionsNode(QDomElement *node); virtual QList parseOntologyChildNodes(QDomElement *node) = 0; // protected variables protected: CQueryBuilder *mQueryBuilder; // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_COWLlinkQueryParser_H Konclude-v0.6.2-544-SourceCode/Source/Parser/COWLlinkQtXMLResultParser.cpp0000644000175000017500000001345012520550736025116 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLlinkQtXMLResultParser.h" namespace Konclude { namespace Parser { COWLlinkQtXMLResultParser::COWLlinkQtXMLResultParser() { } COWLlinkQtXMLResultParser::~COWLlinkQtXMLResultParser() { } CQueryResult *COWLlinkQtXMLResultParser::parseQueryResult(QDomElement *resultNode) { QDomElement node = resultNode->firstChildElement(); CQueryResult *queryResult = 0; while (!node.isNull() && !queryResult) { QString docElemName = node.tagName(); if (docElemName == "ox:BooleanResponse" || docElemName == "BooleanResponse") { queryResult = parseBooleanQueryResult(&node); } else if (docElemName == "ox:ClassHierarchy" || docElemName == "ClassHierarchy") { queryResult = parseClassHierarchyResult(&node); } } return queryResult; } CBooleanQueryResult *COWLlinkQtXMLResultParser::parseBooleanQueryResult(QDomElement *node) { CBooleanQueryResult *booleanQueryResult = new CBooleanQueryResult(false); if (node->hasAttribute("result")) { QString resultValueString = node->attribute("result"); if (CStringPrimitiveConverter::convertStringToBoolean(resultValueString,true)) { booleanQueryResult->setResult(true); } } return booleanQueryResult; } bool COWLlinkQtXMLResultParser::hasTopClass(CClassSynsetResult *classSynset) { return classSynset->hasClassName("http://www.w3.org/2002/07/owl#Thing"); } CClassesResult* COWLlinkQtXMLResultParser::parseClassesResult(QDomElement *node) { CClassesResult* classesResult = new CClassesResult(); QStringList classNameList = parseClassNames(node); foreach (const QString& className, classNameList) { classesResult->addClass(className); } return classesResult; } CClassHierarchyResult *COWLlinkQtXMLResultParser::parseClassHierarchyResult(QDomElement *node) { CClassHierarchyResult *classHierResult = 0; QDomElement bottomClassNode = node->firstChildElement("ClassSynset"); CClassSynsetResult *bottomClassSynset = nullptr; if (!bottomClassNode.isNull()) { bottomClassSynset = parseClassSynsetResult(&bottomClassNode); } if (!bottomClassSynset) { bottomClassSynset = new CClassSynsetResult(QStringList()<firstChildElement("ClassSubClassesPair"); bool foundTop = false; while (!subClassNode.isNull()) { CClassSynsetResult *superClass = 0; QDomElement classSynsetElm(subClassNode.firstChildElement("ClassSynset")); QStringList classNames = parseClassNames(&classSynsetElm); if (!classNames.isEmpty()) { superClass = classHierResult->getClassSynset(classNames); if (!foundTop && hasTopClass(superClass)) { classHierResult->setTopClassSynset(superClass); foundTop = true; } QDomElement subClassSynsetNode = subClassNode.firstChildElement("SubClassSynsets"); while (!subClassSynsetNode.isNull()) { QDomElement classSynsetNode = subClassSynsetNode.firstChildElement("ClassSynset"); while (!classSynsetNode.isNull()) { QStringList classNames = parseClassNames(&classSynsetNode); if (!classNames.isEmpty()) { CClassSynsetResult *subClass = classHierResult->getClassSynset(classNames); if (subClass) { classHierResult->addSubClassRelation(superClass,subClass); } } classSynsetNode = classSynsetNode.nextSiblingElement("ClassSynset"); } subClassSynsetNode = subClassSynsetNode.nextSiblingElement("SubClassSynsets"); } } subClassNode = subClassNode.nextSiblingElement("ClassSubClassesPair"); } return classHierResult; } QStringList COWLlinkQtXMLResultParser::parseClassNames(QDomElement *node) { QStringList classNameList; bool err = node->isNull(); QString tagName = node->tagName(); QDomElement classNode = node->firstChildElement(); while (!classNode.isNull()) { if (classNode.tagName() == "Class" || classNode.tagName() == "owl:Class") { QString className = classNode.attribute("IRI"); if (className.isEmpty()) { className = classNode.attribute("abbreviatedIRI"); className = className.replace("owl:","http://www.w3.org/2002/07/owl#"); className = className.replace("xsd:","http://www.w3.org/2001/XMLSchema#"); className = className.replace("rdf:","http://www.w3.org/1999/02/22-rdf-syntax-ns#"); className = className.replace("rdfs:","http://www.w3.org/2000/01/rdf-schema#"); } classNameList.append(className); } classNode = classNode.nextSiblingElement(); } return classNameList; } CClassSynsetResult *COWLlinkQtXMLResultParser::parseClassSynsetResult(QDomElement *node) { QStringList classNameList = parseClassNames(node); CClassSynsetResult *classSynset = nullptr; if (!classNameList.isEmpty()) { classSynset = new CClassSynsetResult(classNameList); } return classSynset; } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CTBoxAxiomBuilder.cpp0000644000175000017500000000202212520550740023502 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTBoxAxiomBuilder.h" namespace Konclude { namespace Parser { CTBoxAxiomBuilder::CTBoxAxiomBuilder() { } CTBoxAxiomBuilder::~CTBoxAxiomBuilder() { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CParsingExpressionSplitter.cpp0000644000175000017500000001500212520550736025542 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CParsingExpressionSplitter.h" namespace Konclude { namespace Parser { CParsingExpressionSplitter::CParsingExpressionSplitter(const CEXPRESSIONLIST& expressions) : mExpressionList(expressions) { splitExpressions(); } CParsingExpressionSplitter::CParsingExpressionSplitter(CEXPRESSIONLIST* expressions) : mExpressionList(*expressions) { splitExpressions(); } CParsingExpressionSplitter::CParsingExpressionSplitter(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) { if (expression1) { mExpressionList.append(expression1); } if (expression2) { mExpressionList.append(expression2); } if (expression3) { mExpressionList.append(expression3); } splitExpressions(); } CParsingExpressionSplitter::~CParsingExpressionSplitter() { } bool CParsingExpressionSplitter::splitExpressions() { FOREACHIT (CBuildExpression* expression, mExpressionList) { CClassTermExpression* classExpression = dynamic_cast(expression); if (classExpression) { mClassList.append(classExpression); CObjectIndividualVariableExpression* varExpression = dynamic_cast(classExpression); if (varExpression) { mObjIndiVarList.append(varExpression); } else { mNotObjIndiVarList.append(varExpression); } } CObjectPropertyTermExpression* objectPropertyExpression = dynamic_cast(expression); if (objectPropertyExpression) { mObjectPropertyList.append(objectPropertyExpression); } CIndividualTermExpression* individualExpression = dynamic_cast(expression); if (individualExpression) { mIndiList.append(individualExpression); } } return true; } bool CParsingExpressionSplitter::proofExpressionComposition(cint64 requiredClassExpressions, cint64 requiredObjectPropertyExpressions, cint64 requiredIndividualExpressions, cint64 requiredVariableExpressions, cint64 requiredNotVariableExpressions) { if (mClassList.count() < requiredClassExpressions) { LOG(ERROR,"::Konclude::Reasoner::Generator::ExpressionSplitter",logTr("Couldn't extract minimal required %1 Class-Expressions, extracted Class-Expressions %2.").arg(requiredClassExpressions).arg(mClassList.count()),this); return false; } if (mObjectPropertyList.count() < requiredObjectPropertyExpressions) { LOG(ERROR,"::Konclude::Reasoner::Generator::ExpressionSplitter",logTr("Couldn't extract minimal required %1 ObjectProperty-Expressions, extracted ObjectProperty-Expressions %2.").arg(requiredObjectPropertyExpressions).arg(mObjectPropertyList.count()),this); return false; } if (mIndiList.count() < requiredIndividualExpressions) { LOG(ERROR,"::Konclude::Reasoner::Generator::ExpressionSplitter",logTr("Couldn't extract minimal required %1 Individual-Expressions, extracted Individual-Expressions %2.").arg(requiredIndividualExpressions).arg(mIndiList.count()),this); return false; } if (mObjIndiVarList.count() < requiredVariableExpressions) { LOG(ERROR,"::Konclude::Reasoner::Generator::ExpressionSplitter",logTr("Couldn't extract minimal required %1 Variable-Expressions, extracted Variable-Expressions %2.").arg(requiredVariableExpressions).arg(mObjIndiVarList.count()),this); return false; } if (mNotObjIndiVarList.count() < requiredNotVariableExpressions) { LOG(ERROR,"::Konclude::Reasoner::Generator::ExpressionSplitter",logTr("Couldn't extract minimal required %1 Non-Variable-Expressions, extracted Non-Variable-Expressions %2.").arg(requiredNotVariableExpressions).arg(mNotObjIndiVarList.count()),this); return false; } return true; } CEXPRESSIONLIST* CParsingExpressionSplitter::getClassTermExpressionList() { return &mClassList; } CEXPRESSIONLIST* CParsingExpressionSplitter::getObjectPropertyTermExpressionList() { return &mObjectPropertyList; } CEXPRESSIONLIST* CParsingExpressionSplitter::getIndividualTermExpressionList() { return &mIndiList; } CEXPRESSIONLIST* CParsingExpressionSplitter::getClassVariableTermExpressionList() { return &mObjIndiVarList; } CEXPRESSIONLIST* CParsingExpressionSplitter::getClassNotVariableTermExpressionList() { return &mNotObjIndiVarList; } CObjectIndividualVariableExpression* CParsingExpressionSplitter::getFirstClassVariableTermExpression() { return mObjIndiVarList.first(); } CObjectIndividualVariableExpression* CParsingExpressionSplitter::getSecondClassVariableTermExpression() { return mObjIndiVarList.at(1); } CClassTermExpression* CParsingExpressionSplitter::getFirstClassTermExpression() { return mClassList.first(); } CClassTermExpression* CParsingExpressionSplitter::getFirstOptionalClassTermExpression() { if (mClassList.isEmpty()) { return nullptr; } return mClassList.first(); } CClassTermExpression* CParsingExpressionSplitter::getSecondClassTermExpression() { return mClassList.at(1); } CObjectPropertyTermExpression* CParsingExpressionSplitter::getFirstObjectPropertyTermExpression() { return mObjectPropertyList.first(); } CObjectPropertyTermExpression* CParsingExpressionSplitter::getSecondObjectPropertyTermExpression() { return mObjectPropertyList.at(1); } CIndividualTermExpression* CParsingExpressionSplitter::getFirstIndividualTermExpression() { return mIndiList.first(); } CIndividualTermExpression* CParsingExpressionSplitter::getSecondIndividualTermExpression() { return mIndiList.at(1); } }; // end namespace Parser }; // end namespace KoncludeKonclude-v0.6.2-544-SourceCode/Source/Parser/CXMLOWL2StreamHandler.h0000644000175000017500000006324712520550740023564 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CXMLOWL2STREAMHANDLER_H #define KONCLUDE_PARSER_CXMLOWL2STREAMHANDLER_H // Libraries includes #include #include #include #include #include // Namespace incldues #include "CParseRuleAtom.h" #include "COntologyBuilder.h" #include "CParsingExpressionSplitter.h" // Other includes #include "Parser/Expressions/CRuleDifferentIndividualsAtomTermExpression.h" #include "Parser/Expressions/CRulePropertyAtomTermExpression.h" #include "Parser/Expressions/CRuleClassAtomTermExpression.h" #include "Parser/Expressions/CRuleAtomListBodyExpression.h" #include "Parser/Expressions/CRuleAtomListHeadExpression.h" #include "Control/Command/CCommandRecordRouter.h" #include "Control/Command/Records/CNotSupportedNodeErrorRecord.h" #include "Logger/CLogIdentifier.h" #include "Utilities/Container/CQtHash.h" #include "Reasoner/Generator/CStringRefStringHasher.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; using namespace std; namespace Konclude { using namespace Utilities; using namespace Container; using namespace Control::Command; using namespace Control::Command::Records; using namespace Reasoner::Generator; namespace Parser { class CXMLOWL2StreamHandler; class CStreamParseStackObject; typedef void (CXMLOWL2StreamHandler::*StreamParseFunctionDelayed) (CStreamParseStackObject* parseStackObj); typedef void (CXMLOWL2StreamHandler::*StreamParseFunctionDirect) (const QXmlStreamAttributes& attributes); class CStreamParseFunctionData { public: CStreamParseFunctionData() { mParseDelayedFunction = nullptr; mParseDirectFunction = nullptr; mExtraParsingFlags = 0; } CStreamParseFunctionData(StreamParseFunctionDelayed parseDelayedFunction, cint64 extraParsingFlags = 0) { mParseDelayedFunction = parseDelayedFunction; mParseDirectFunction = nullptr; mExtraParsingFlags = extraParsingFlags; } CStreamParseFunctionData(StreamParseFunctionDirect parseDirectFunction) { mParseDelayedFunction = nullptr; mParseDirectFunction = parseDirectFunction; mExtraParsingFlags = 0; } StreamParseFunctionDelayed mParseDelayedFunction; StreamParseFunctionDirect mParseDirectFunction; const static cint64 EPF_CARDINALITY = 0x0001; const static cint64 EPF_DATATYPE_IRI = 0x0002; const static cint64 EPF_FACET_IRI = 0x0004; const static cint64 EPF_TEXT_ELEMENT = 0x0008; const static cint64 EPF_LITERAL_APPENDIX = 0x0010; cint64 mExtraParsingFlags; }; class CStreamParseStackObject { public: inline CStreamParseStackObject() : mParseFunction(nullptr),mCardinality(0),mCardinalityParsed(false),mIRIParsed(false) { } inline CStreamParseStackObject(StreamParseFunctionDelayed parseFunction) : mParseFunction(parseFunction),mCardinality(0),mCardinalityParsed(false),mIRIParsed(false) { } inline CStreamParseStackObject(StreamParseFunctionDelayed parseFunction, cint64 cardinality) : mParseFunction(parseFunction),mCardinality(cardinality),mCardinalityParsed(true),mIRIParsed(false) { } inline CStreamParseStackObject(StreamParseFunctionDelayed parseFunction, const QString& parsedIRI) : mParseFunction(parseFunction),mCardinality(0),mCardinalityParsed(false),mIRIParsed(true),mParsedIRI(parsedIRI) { } inline CStreamParseStackObject* addBuildExpression(CBuildExpression* buildExpression) { mExpList.append(buildExpression); return this; } inline CStreamParseStackObject* addBuildExpressions(CQtList* expressions) { if (mExpList.isEmpty()) { mExpList = *expressions; } else { mExpList.append(*expressions); } return this; } inline bool hasExpressions() { return !mExpList.isEmpty(); } inline CQtList* getExpressions() { return &mExpList; } inline QString& getParsedIRI() { return mParsedIRI; } StreamParseFunctionDelayed mParseFunction; cint64 mCardinality; bool mCardinalityParsed; QString mParsedIRI; bool mIRIParsed; CQtList mExpList; }; class CStreamXMLBaseStackObject { public: inline CStreamXMLBaseStackObject() { mStackValidDepth = 0; } inline CStreamXMLBaseStackObject(cint64 stackValidDepth, const QString& xmlBaseString) : mStackValidDepth(stackValidDepth),mXMLBaseString(xmlBaseString) { } cint64 mStackValidDepth; QString mXMLBaseString; }; class CStreamXMLNamespaceStackObject { public: inline CStreamXMLNamespaceStackObject() { mParseHash = nullptr; mStackValidDepth = 0; } inline CStreamXMLNamespaceStackObject(cint64 stackValidDepth, CQtHash* parseHash) : mStackValidDepth(stackValidDepth),mParseHash(parseHash) { } cint64 mStackValidDepth; CQtHash* mParseHash; }; /*! * * \class CXMLOWL2StreamHandler * \author Andreas Steigmiller * \version 0.1 * \brief Parser for OWL/XML Files * */ class CXMLOWL2StreamHandler : public CLogIdentifier { // public methods public: //! Constructor CXMLOWL2StreamHandler(COntologyBuilder* ontoBuilder); CXMLOWL2StreamHandler(COntologyBuilder* ontoBuilder, CCommandRecordRouter *commandRecordRouter); virtual bool startElement(const QStringRef& namespaceURI, const QStringRef& localName, const QStringRef& qName, const QXmlStreamAttributes& atts); virtual bool endElement(const QStringRef& namespaceURI, const QStringRef& localName, const QStringRef& qName); virtual bool readText(const QStringRef& text); virtual bool startDocument(); virtual bool endDocument(); bool hasOntologyNodeFound(); // protected methods protected: bool initializeParseFunctionJumpHash(); CStringRefStringHasher getEntityName(const QXmlStreamAttributes& attributes); bool getCardinality(cint64* cardinality, const QXmlStreamAttributes& attributes); QStringRef getNodeID(const QXmlStreamAttributes& attributes); bool startsWithScheme(const QStringRef& uriString); bool getDatatypeIRI(QString* datatypeIRI, const QXmlStreamAttributes& attributes); bool getFacetIRI(QString* facetIRI, const QXmlStreamAttributes& attributes); bool getLiteralAppendix(QString* literalAppendix, const QXmlStreamAttributes& attributes); virtual bool parseXMLAttributs(const QXmlStreamAttributes& atts); CClassExpression* parseClassNode(const QXmlStreamAttributes& attributes); CObjectPropertyExpression* parseObjectPropertyNode(const QXmlStreamAttributes& attributes); CObjectIndividualVariableExpression* parseIndividualVariableNode(const QXmlStreamAttributes& attributes); CDeclarationAxiomExpression* parseDeclarationNode(CStreamParseStackObject* parseStackObj); CEquivalentClassesExpression* parseEquivalentClassesNode(CStreamParseStackObject* parseStackObj); CSubClassOfExpression* parseSubClassOfNode(CStreamParseStackObject* parseStackObj); CDisjointClassesExpression* parseDisjontClassesNode(CStreamParseStackObject* parseStackObj); CDisjointUnionExpression* parseDisjontUnionNode(CStreamParseStackObject* parseStackObj); CSubObjectPropertyOfExpression* parseSubObjectPropertyOfNode(CStreamParseStackObject* parseStackObj); CObjectPropertyChainExpression* parseObjectPropertyChainNode(CStreamParseStackObject* parseStackObj); CEquivalentObjectPropertiesExpression* parseEquivalentObjectPropertiesNode(CStreamParseStackObject* parseStackObj); CDisjointObjectPropertiesExpression* parseDisjointObjectPropertiesNode(CStreamParseStackObject* parseStackObj); CObjectIntersectionOfExpression* parseObjectIntersectionOfNode(CStreamParseStackObject* parseStackObj); CObjectUnionOfExpression* parseObjectUnionOfNode(CStreamParseStackObject* parseStackObj); CObjectMaxCardinalityExpression* parseObjectMaxCardinalityNode(CStreamParseStackObject* parseStackObj); CObjectMinCardinalityExpression* parseObjectMinCardinalityNode(CStreamParseStackObject* parseStackObj); CObjectExactlyCardinalityExpression* parseObjectExactlyCardinalityNode(CStreamParseStackObject* parseStackObj); CObjectSomeValuesFromExpression* parseObjectSomeValuesFromNode(CStreamParseStackObject* parseStackObj); CObjectAllValuesFromExpression* parseObjectAllValuesFromNode(CStreamParseStackObject* parseStackObj); CObjectComplementOfExpression* parseObjectComplementOfNode(CStreamParseStackObject* parseStackObj); CObjectOneOfExpression* parseObjectOneOfNode(CStreamParseStackObject* parseStackObj); CObjectHasValueExpression* parseObjectHasValueNode(CStreamParseStackObject* parseStackObj); CObjectHasSelfExpression* parseObjectHasSelfNode(CStreamParseStackObject* parseStackObj); CClassAssertionExpression* parseClassAssertionNode(CStreamParseStackObject* parseStackObj); CNamedIndividualExpression* parseNamedIndividualNode(const QXmlStreamAttributes& attributes); CAnonymousIndividualExpression* parseAnonymousIndividualNode(const QXmlStreamAttributes& attributes); CObjectPropertyAssertionExpression* parseObjectPropertyAssertionNode(CStreamParseStackObject* parseStackObj); CNegativeObjectPropertyAssertionExpression* parseNegativeObjectPropertyAssertionNode(CStreamParseStackObject* parseStackObj); CSameIndividualExpression* parseSameIndividualNode(CStreamParseStackObject* parseStackObj); CDifferentIndividualsExpression* parseDifferentIndividualsNode(CStreamParseStackObject* parseStackObj); CObjectPropertyDomainExpression* parseObjectPropertyDomainNode(CStreamParseStackObject* parseStackObj); CObjectPropertyRangeExpression* parseObjectPropertyRangeNode(CStreamParseStackObject* parseStackObj); CInverseObjectPropertyOfExpression* parseInverseObjectPropertyOfNode(CStreamParseStackObject* parseStackObj); CInverseObjectPropertiesExpression* parseInverseObjectPropertiesNode(CStreamParseStackObject* parseStackObj); CTransetiveObjectPropertyExpression* parseTransetiveObjectPropertyNode(CStreamParseStackObject* parseStackObj); CFunctionalObjectPropertyExpression* parseFunctionalObjectPropertyNode(CStreamParseStackObject* parseStackObj); CSymmetricObjectPropertyExpression* parseSymmetricObjectPropertyNode(CStreamParseStackObject* parseStackObj); CAsymmetricObjectPropertyExpression* parseAsymmetricObjectPropertyNode(CStreamParseStackObject* parseStackObj); CReflexiveObjectPropertyExpression* parseReflexiveObjectPropertyNode(CStreamParseStackObject* parseStackObj); CIrreflexiveObjectPropertyExpression* parseIrreflexiveObjectPropertyNode(CStreamParseStackObject* parseStackObj); CInverseFunctionalObjectPropertyExpression* parseInverseFunctionalObjectPropertyNode(CStreamParseStackObject* parseStackObj); CRulePropertyAtomTermExpression* parseRuleObjectPropertyAtomNode(CStreamParseStackObject* parseStackObj); CRuleClassAtomTermExpression* parseRuleClassAtomNode(CStreamParseStackObject* parseStackObj); CRuleAtomListBodyExpression* parseRuleAtomBodyNode(CStreamParseStackObject* parseStackObj); CRuleAtomListHeadExpression* parseRuleAtomHeadNode(CStreamParseStackObject* parseStackObj); CRuleDifferentIndividualsAtomTermExpression* parseRuleDifferentIndividualsAtomNode(CStreamParseStackObject* parseStackObj); void parseRuleNode(CStreamParseStackObject* parseStackObj); QList parseRuleAtomNodes(CStreamParseStackObject* parseStackObj, const CQtList& buildExpList, bool parseHeadAtoms); QHash createVariableAtomHash(const QList& atomList); QMap createVariableCountMap(const QList& atomList); CBuildExpression* createBodyExpresions(const QString& varString, QHash& bodyVariableAtomHash, QHash& headVariableAtomHash); bool hasBackExpressionLinks(const QString& varString, CParseRuleAtom* notRuleAtom, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash, QSet& backTestProcessedVarSet, QSet& backTestProcessedAtomSet); bool hasBackExpressionLinks(const QString& varString, CParseRuleAtom* notRuleAtom, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash); CBuildExpression* createBodyExpresions(const QString& varString, bool direct, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash); CBuildExpression* getNeighbourAtomObjectPropertyExpression(CParseRuleAtom* ruleAtom, bool inversed); void parsePrefixNode(const QXmlStreamAttributes& attributes); void parseTellOntologyAxiomNode(CStreamParseStackObject* parseStackObj); void parseRetractOntologyAxiomNode(CStreamParseStackObject* parseStackObj); void jumpFunctionOntologyNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseRuleNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseRulePropertyAtomNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseRuleClassAtomNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDifferentIndividualsAtomNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseRuleAtomBodyNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseRuleAtomHeadNode(CStreamParseStackObject* parseStackObj); void jumpFunctionTellOntologyAxiomNode(CStreamParseStackObject* parseStackObj); void jumpFunctionRetractOntologyAxiomNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParsePrefixNode(const QXmlStreamAttributes& attributes); void jumpFunctionParseClassNode(const QXmlStreamAttributes& attributes); void jumpFunctionParseObjectPropertyNode(const QXmlStreamAttributes& attributes); void jumpFunctionParseIndividualVariable(const QXmlStreamAttributes& attributes); void jumpFunctionParseDeclarationNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseSubClassOfNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseEquivalentClassesNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDisjontClassesNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDisjontUnionNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseSubObjectPropertyOfNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseObjectPropertyChainNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseEquivalentObjectPropertiesNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDisjointObjectPropertiesNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseObjectIntersectionOfNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseObjectUnionOfNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseObjectMaxCardinalityNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseObjectMinCardinalityNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseObjectExactlyCardinalityNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseObjectSomeValuesFromNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseObjectAllValuesFromNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseObjectComplementOfNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseObjectOneOfNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseObjectHasValueNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseObjectHasSelfNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseClassAssertionNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseNamedIndividualNode(const QXmlStreamAttributes& attributes); void jumpFunctionParseAnonymousIndividualNode(const QXmlStreamAttributes& attributes); void jumpFunctionParseObjectPropertyAssertionNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseNegativeObjectPropertyAssertionNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseSameIndividualNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDifferentIndividualsNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseObjectPropertyDomainNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseObjectPropertyRangeNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseInverseObjectPropertyOfNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseInverseObjectPropertiesNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseTransetiveObjectPropertyNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseFunctionalObjectPropertyNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseSymmetricObjectPropertyNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseAsymmetricObjectPropertyNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseReflexiveObjectPropertyNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseIrreflexiveObjectPropertyNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseInverseFunctionalObjectPropertyNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseIgnoredNode(CStreamParseStackObject* parseStackObj); void jumpFunctionUnsupportedDatatypeNode(CStreamParseStackObject* parseStackObj); void jumpFunctionUnsupportedRDFNode(CStreamParseStackObject* parseStackObj); void jumpFunctionUnsupportedImportNode(CStreamParseStackObject* parseStackObj); void jumpFunctionUnsupportedAnnotationNode(const QXmlStreamAttributes& attributes); void jumpFunctionParseImportNode(CStreamParseStackObject* parseStackObj); CDatatypeExpression* parseDatatypeNode(const QXmlStreamAttributes& attributes); CDataPropertyExpression* parseDataPropertyNode(const QXmlStreamAttributes& attributes); CDataLiteralExpression* parseDataLiteralNode(CStreamParseStackObject* parseStackObj); CDataSomeValuesFromExpression* parseDataSomeValuesFromNode(CStreamParseStackObject* parseStackObj); CDataFacetRestrictionExpression* parseDataFacetRestrictionNode(CStreamParseStackObject* parseStackObj); CDataAllValuesFromExpression* parseDataAllValuesFromNode(CStreamParseStackObject* parseStackObj); CDataHasValueExpression* parseDataHasValueNode(CStreamParseStackObject* parseStackObj); CDataIntersectionOfExpression* parseDataIntersectionOfNode(CStreamParseStackObject* parseStackObj); CDataOneOfExpression* parseDataOneOfNode(CStreamParseStackObject* parseStackObj); CDataUnionOfExpression* parseDataUnionOfNode(CStreamParseStackObject* parseStackObj); CDataComplementOfExpression* parseDataComplementOfNode(CStreamParseStackObject* parseStackObj); CDatatypeRestrictionExpression* parseDatatypeRestrictionNode(CStreamParseStackObject* parseStackObj); CDataMaxCardinalityExpression* parseDataMaxCardinalityNode(CStreamParseStackObject* parseStackObj); CDataMinCardinalityExpression* parseDataMinCardinalityNode(CStreamParseStackObject* parseStackObj); CDataExactCardinalityExpression* parseDataExactCardinalityNode(CStreamParseStackObject* parseStackObj); CDataPropertyAssertionExpression* parseDataPropertyAssertionNode(CStreamParseStackObject* parseStackObj); CNegativeDataPropertyAssertionExpression* parseNegativeDataPropertyAssertionNode(CStreamParseStackObject* parseStackObj); CSubDataPropertyOfExpression* parseSubDataPropertyOfNode(CStreamParseStackObject* parseStackObj); CEquivalentDataPropertiesExpression* parseEquivalentDataPropertiesNode(CStreamParseStackObject* parseStackObj); CDisjointDataPropertiesExpression* parseDisjointDataPropertiesNode(CStreamParseStackObject* parseStackObj); CDataPropertyDomainExpression* parseDataPropertyDomainNode(CStreamParseStackObject* parseStackObj); CDataPropertyRangeExpression* parseDataPropertyRangeNode(CStreamParseStackObject* parseStackObj); CFunctionalDataPropertyExpression* parseFunctionalDataPropertyNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDatatypeNode(const QXmlStreamAttributes& attributes); void jumpFunctionParseDataPropertyNode(const QXmlStreamAttributes& attributes); void jumpFunctionParseDataLiteralNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDataSomeValuesFromNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDataAllValuesFromNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDataHasValueNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDataIntersectionOfNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDataOneOfNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDataUnionOfNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDataComplementOfNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDatatypeRestrictionNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDataMaxCardinalityNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDataMinCardinalityNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDataExactCardinalityNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDataPropertyAssertionNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseNegativeDataPropertyAssertionNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseSubDataPropertyOfNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseEquivalentDataPropertiesNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDisjointDataPropertiesNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDataPropertyDomainNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDataPropertyRangeNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseFunctionalDataPropertyNode(CStreamParseStackObject* parseStackObj); void jumpFunctionParseDataFacetRestrictionNode(CStreamParseStackObject* parseStackObj); void addTemporaryBuildExpression(CBuildExpression* buildExp); void addTemporaryBuildExpressions(QList* buildExps); // protected variables protected: QStack mStack; QStack mXMLBaseStack; QString mCurrentXMLBase; bool mHasCurrentXMLBase; cint64 mCurrentXMLBaseValidDepth; QStack mXMLNamespaceStack; CQtHash* mCurrentParseFunctionJumpHash; cint64 mCurrentXMLNamespaceValidDepth; QString mOWLPrefix; CCommandRecordRouter recordRouter; COntologyBuilder* mOntoBuilder; QString mOntologyName; cint64 mAxiomNumber; CStreamParseStackObject mDummyFunctionData; CQtHash mBaseParseFunctionJumpHash; QList mRuleExpContainer; QString mLastReadText; QString mLastTextAppendix; CQtList mTmpExpList; QString mOWLString; QString mOWLPrefixString; QString mURIString; QString mIRIString; QString mAbbreviatedIRIString; QString mOWLPrefixURIString; QString mOWLPrefixIRIString; QString mOWLPrefixAbbreviatedIRIString; QString mCardinalityString; QString mOWLPrefixCardinalityString; QString mDatatypeIRIString; QString mOWLPrefixDatatypeIRIString; QString mFacetIRIString; QString mOWLPrefixFacetIRIString; QString mNodeIDString; QString mOWLPrefixNodeIDString; QString mNameString; QString mOWLPrefixNameString; QChar mPunctChar; QChar mDoublePunctChar; cint64 mDataTypeReportErrorCount; cint64 mAnnotationReportErrorCount; bool mUnsupportedImportError; bool mUnsupportedAnnotationError; bool mOntologyNodeFound; cint64 mParseIgnoreDepth; bool mIgnoreParsingSubElements; bool mParseTextElement; // private methods private: bool extendParsingHashForNamespace(CQtHash* baseParseFunctionJumpHash, CQtHash* extendParseFunctionJumpHash, const QString& namespaceExtendString); bool reduceParsingHashForNamespace(CQtHash* baseParseFunctionJumpHash, CQtHash* reduceParseFunctionJumpHash, const QString& namespaceReduceString); // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CXMLOWL2STREAMHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/COWL2QtXMLOntologyParser.h0000644000175000017500000003740012520550736024324 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_COWL2QTXMLONTOLOGYPARSER_H #define KONCLUDE_PARSER_COWL2QTXMLONTOLOGYPARSER_H // Libraries includes #include #include #include // Namespace includes #include "COntologyParser.h" #include "COntologyBuilder.h" #include "CParseRuleAtom.h" // Other includes #include "Control/Command/CCommandRecordRouter.h" #include "Control/Command/Records/CNotSupportedNodeErrorRecord.h" #include "Control/Command/Records/CUnspecifiedMessageErrorRecord.h" #include "Logger/CLogIdentifier.h" #include "Utilities/Container/CQtHash.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; using namespace std; namespace Konclude { using namespace Utilities::Container; using namespace Control::Command; using namespace Control::Command::Records; namespace Parser { #define KONCLUDE_PARSER_USEPARSEJUMPFUNCTIONHASH /*! * * \class COWL2QtXMLOntologyParser * \author Andreas Steigmiller * \version 0.1 * \brief Parser for OWL/XML Files * */ class COWL2QtXMLOntologyParser : public COntologyParser, public CLogIdentifier { // public methods public: //! Constructor COWL2QtXMLOntologyParser(COntologyBuilder* ontoBuilder); COWL2QtXMLOntologyParser(COntologyBuilder* ontoBuilder, CCommandRecordRouter* commandRecordRouter); //! Destructor virtual ~COWL2QtXMLOntologyParser(); virtual bool parseOntologyFile(const QString& filename); virtual bool parseOntologyNode(QDomElement* ontologyNode); virtual bool parseTellOntologyAxiomNode(QDomElement* ontologyNode); virtual bool parseRetractOntologyAxiomNode(QDomElement* ontologyNode); virtual CBuildExpression* getParsedBuildNode(QDomElement* node); // protected methods protected: bool initializeParseFunctionJumpHash(); QString getEntityName(QDomElement* node); cint64 parseCardinality(QDomElement* node); CBuildExpression* parseBuildNode(QDomElement* node); QList parseChildNodes(QDomElement* node); CClassExpression* parseClassNode(QDomElement* node); CObjectPropertyExpression* parseObjectPropertyNode(QDomElement* node); CObjectIndividualVariableExpression* parseIndividualVariableNode(QDomElement* node); CDeclarationAxiomExpression* parseDeclarationNode(QDomElement* node); CEquivalentClassesExpression* parseEquivalentClassesNode(QDomElement* node); CSubClassOfExpression* parseSubClassOfNode(QDomElement* node); CDisjointClassesExpression* parseDisjontClassesNode(QDomElement* node); CDisjointUnionExpression* parseDisjontUnionNode(QDomElement* node); CSubObjectPropertyOfExpression* parseSubObjectPropertyOfNode(QDomElement* node); CObjectPropertyChainExpression* parseObjectPropertyChainNode(QDomElement* node); CEquivalentObjectPropertiesExpression* parseEquivalentObjectPropertiesNode(QDomElement* node); CDisjointObjectPropertiesExpression* parseDisjointObjectPropertiesNode(QDomElement* node); CObjectIntersectionOfExpression* parseObjectIntersectionOfNode(QDomElement* node); CObjectUnionOfExpression* parseObjectUnionOfNode(QDomElement* node); CObjectMaxCardinalityExpression* parseObjectMaxCardinalityNode(QDomElement* node); CObjectMinCardinalityExpression* parseObjectMinCardinalityNode(QDomElement* node); CObjectExactlyCardinalityExpression* parseObjectExactlyCardinalityNode(QDomElement* node); CObjectSomeValuesFromExpression* parseObjectSomeValuesFromNode(QDomElement* node); CObjectAllValuesFromExpression* parseObjectAllValuesFromNode(QDomElement* node); CObjectComplementOfExpression* parseObjectComplementOfNode(QDomElement* node); CObjectOneOfExpression* parseObjectOneOfNode(QDomElement* node); CObjectHasValueExpression* parseObjectHasValueNode(QDomElement* node); CObjectHasSelfExpression* parseObjectHasSelfNode(QDomElement* node); CClassAssertionExpression* parseClassAssertionNode(QDomElement* node); CNamedIndividualExpression* parseNamedIndividualNode(QDomElement* node); CAnonymousIndividualExpression* parseAnonymousIndividualNode(QDomElement* node); CObjectPropertyAssertionExpression* parseObjectPropertyAssertionNode(QDomElement* node); CNegativeObjectPropertyAssertionExpression* parseNegativeObjectPropertyAssertionNode(QDomElement* node); CSameIndividualExpression* parseSameIndividualNode(QDomElement* node); CDifferentIndividualsExpression* parseDifferentIndividualsNode(QDomElement* node); CObjectPropertyDomainExpression* parseObjectPropertyDomainNode(QDomElement* node); CObjectPropertyRangeExpression* parseObjectPropertyRangeNode(QDomElement* node); CInverseObjectPropertyOfExpression* parseInverseObjectPropertyOfNode(QDomElement* node); CInverseObjectPropertiesExpression* parseInverseObjectPropertiesNode(QDomElement* node); CTransetiveObjectPropertyExpression* parseTransetiveObjectPropertyNode(QDomElement* node); CFunctionalObjectPropertyExpression* parseFunctionalObjectPropertyNode(QDomElement* node); CSymmetricObjectPropertyExpression* parseSymmetricObjectPropertyNode(QDomElement* node); CAsymmetricObjectPropertyExpression* parseAsymmetricObjectPropertyNode(QDomElement* node); CReflexiveObjectPropertyExpression* parseReflexiveObjectPropertyNode(QDomElement* node); CIrreflexiveObjectPropertyExpression* parseIrreflexiveObjectPropertyNode(QDomElement* node); CInverseFunctionalObjectPropertyExpression* parseInverseFunctionalObjectPropertyNode(QDomElement* node); QList parseRuleNode(QDomElement* node); QHash createVariableAtomHash(const QList& atomList); QMap createVariableCountMap(const QList& atomList); CBuildExpression* createBodyExpresions(const QString& varString, QHash& bodyVariableAtomHash, QHash& headVariableAtomHash); bool hasBackExpressionLinks(const QString& varString, CParseRuleAtom* notRuleAtom, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash, QSet& backTestProcessedVarSet, QSet& backTestProcessedAtomSet); bool hasBackExpressionLinks(const QString& varString, CParseRuleAtom* notRuleAtom, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash); CBuildExpression* createBodyExpresions(const QString& varString, bool direct, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash); CBuildExpression* getNeighbourAtomObjectPropertyExpression(CParseRuleAtom* ruleAtom, bool inversed); QList parseRuleAtomNodes(const QString& ruleNodePrefix, const QDomElement& node); bool parsePrefixNode(QDomElement* node); CBuildExpression* jumpFunctionOntologyNode(QDomElement* node); CBuildExpression* jumpFunctionTellOntologyAxiomNode(QDomElement* node); CBuildExpression* jumpFunctionRetractOntologyAxiomNode(QDomElement* node); CBuildExpression* jumpFunctionParsePrefixNode(QDomElement* node); CBuildExpression* jumpFunctionParseClassNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectPropertyNode(QDomElement* node); CBuildExpression* jumpFunctionParseIndividualVariable(QDomElement* node); CBuildExpression* jumpFunctionParseDeclarationNode(QDomElement* node); CBuildExpression* jumpFunctionParseSubClassOfNode(QDomElement* node); CBuildExpression* jumpFunctionParseEquivalentClassesNode(QDomElement* node); CBuildExpression* jumpFunctionParseDisjontClassesNode(QDomElement* node); CBuildExpression* jumpFunctionParseDisjontUnionNode(QDomElement* node); CBuildExpression* jumpFunctionParseSubObjectPropertyOfNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectPropertyChainNode(QDomElement* node); CBuildExpression* jumpFunctionParseEquivalentObjectPropertiesNode(QDomElement* node); CBuildExpression* jumpFunctionParseDisjointObjectPropertiesNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectIntersectionOfNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectUnionOfNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectMaxCardinalityNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectMinCardinalityNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectExactlyCardinalityNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectSomeValuesFromNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectAllValuesFromNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectComplementOfNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectOneOfNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectHasValueNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectHasSelfNode(QDomElement* node); CBuildExpression* jumpFunctionParseClassAssertionNode(QDomElement* node); CBuildExpression* jumpFunctionParseNamedIndividualNode(QDomElement* node); CBuildExpression* jumpFunctionParseAnonymousIndividualNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectPropertyAssertionNode(QDomElement* node); CBuildExpression* jumpFunctionParseNegativeObjectPropertyAssertionNode(QDomElement* node); CBuildExpression* jumpFunctionParseSameIndividualNode(QDomElement* node); CBuildExpression* jumpFunctionParseDifferentIndividualsNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectPropertyDomainNode(QDomElement* node); CBuildExpression* jumpFunctionParseObjectPropertyRangeNode(QDomElement* node); CBuildExpression* jumpFunctionParseInverseObjectPropertyOfNode(QDomElement* node); CBuildExpression* jumpFunctionParseInverseObjectPropertiesNode(QDomElement* node); CBuildExpression* jumpFunctionParseTransetiveObjectPropertyNode(QDomElement* node); CBuildExpression* jumpFunctionParseFunctionalObjectPropertyNode(QDomElement* node); CBuildExpression* jumpFunctionParseSymmetricObjectPropertyNode(QDomElement* node); CBuildExpression* jumpFunctionParseAsymmetricObjectPropertyNode(QDomElement* node); CBuildExpression* jumpFunctionParseReflexiveObjectPropertyNode(QDomElement* node); CBuildExpression* jumpFunctionParseIrreflexiveObjectPropertyNode(QDomElement* node); CBuildExpression* jumpFunctionParseInverseFunctionalObjectPropertyNode(QDomElement* node); CBuildExpression* jumpFunctionParseIgnoredNode(QDomElement* node); CBuildExpression* jumpFunctionParseImportNode(QDomElement* node); CBuildExpression* jumpFunctionParseDatatypeNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataPropertyNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataSomeValuesFromNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataLiteralNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataAllValuesFromNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataHasValueNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataIntersectionOfNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataOneOfNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataUnionOfNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataComplementOfNode(QDomElement* node); CBuildExpression* jumpFunctionParseDatatypeRestrictionNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataMaxCardinalityNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataMinCardinalityNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataExactCardinalityNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataPropertyAssertionNode(QDomElement* node); CBuildExpression* jumpFunctionParseNegativeDataPropertyAssertionNode(QDomElement* node); CBuildExpression* jumpFunctionParseSubDataPropertyOfNode(QDomElement* node); CBuildExpression* jumpFunctionParseEquivalentDataPropertiesNode(QDomElement* node); CBuildExpression* jumpFunctionParseDisjointDataPropertiesNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataPropertyDomainNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataPropertyRangeNode(QDomElement* node); CBuildExpression* jumpFunctionParseFunctionalDataPropertyNode(QDomElement* node); CBuildExpression* jumpFunctionParseDataFacetRestrictionNode(QDomElement* node); CDatatypeExpression* parseDatatypeNode(QDomElement* node); CDataPropertyExpression* parseDataPropertyNode(QDomElement* node); CDataSomeValuesFromExpression* parseDataSomeValuesFromNode(QDomElement* node); CDataLiteralExpression* parseDataLiteralNode(QDomElement* node); CDataFacetRestrictionExpression* parseDataFacetRestrictionNode(QDomElement* node); CDataAllValuesFromExpression* parseDataAllValuesFromNode(QDomElement* node); CDataHasValueExpression* parseDataHasValueNode(QDomElement* node); CDataIntersectionOfExpression* parseDataIntersectionOfNode(QDomElement* node); CDataOneOfExpression* parseDataOneOfNode(QDomElement* node); CDataUnionOfExpression* parseDataUnionOfNode(QDomElement* node); CDataComplementOfExpression* parseDataComplementOfNode(QDomElement* node); CDatatypeRestrictionExpression* parseDatatypeRestrictionNode(QDomElement* node); CDataMaxCardinalityExpression* parseDataMaxCardinalityNode(QDomElement* node); CDataMinCardinalityExpression* parseDataMinCardinalityNode(QDomElement* node); CDataExactCardinalityExpression* parseDataExactCardinalityNode(QDomElement* node); CDataPropertyAssertionExpression* parseDataPropertyAssertionNode(QDomElement* node); CNegativeDataPropertyAssertionExpression* parseNegativeDataPropertyAssertionNode(QDomElement* node); CSubDataPropertyOfExpression* parseSubDataPropertyOfNode(QDomElement* node); CEquivalentDataPropertiesExpression* parseEquivalentDataPropertiesNode(QDomElement* node); CDisjointDataPropertiesExpression* parseDisjointDataPropertiesNode(QDomElement* node); CDataPropertyDomainExpression* parseDataPropertyDomainNode(QDomElement* node); CDataPropertyRangeExpression* parseDataPropertyRangeNode(QDomElement* node); CFunctionalDataPropertyExpression* parseFunctionalDataPropertyNode(QDomElement* node); // protected variables protected: cint64 mReportErrorCount; CCommandRecordRouter recordRouter; COntologyBuilder* mOntoBuilder; QString mOntologyName; cint64 mAxiomNumber; typedef CBuildExpression* (COWL2QtXMLOntologyParser::*ParseFunction) (QDomElement* node); CQtHash mParseFunctionJumpHash; // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_COWL2QTXMLONTOLOGYPARSER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/COWL2QtXMLOntologyStableStreamParser.cpp0000644000175000017500000001014312520550736027161 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWL2QtXMLOntologyStableStreamParser.h" namespace Konclude { namespace Parser { COWL2QtXMLOntologyStableStreamParser::COWL2QtXMLOntologyStableStreamParser(COntologyBuilder* ontologyBuilder) : COWL2QtXMLOntologyStreamParser(ontologyBuilder) { mReadBufferSize = 10000; mReadBuffer = new char[mReadBufferSize]; } COWL2QtXMLOntologyStableStreamParser::~COWL2QtXMLOntologyStableStreamParser() { delete [] mReadBuffer; } bool COWL2QtXMLOntologyStableStreamParser::addMoreDataToXMLReader(QXmlStreamReader* xmlReader, QIODevice* ioDevice) { if (!ioDevice->atEnd()) { cint64 remainTmpSize = 10; cint64 readDataSize = ioDevice->read(mReadBuffer,mReadBufferSize-remainTmpSize); mReadBuffer[readDataSize] = 0; bool usesUnicodeChars = false; if (readDataSize > 0) { while (!ioDevice->atEnd() && mReadBuffer[readDataSize-1] > 127 && remainTmpSize > 0) { --remainTmpSize; usesUnicodeChars = true; cint64 newReadSize = ioDevice->read(&mReadBuffer[readDataSize],1); readDataSize = readDataSize+newReadSize; mReadBuffer[readDataSize] = 0; } } if (!usesUnicodeChars) { for (cint64 i = 0; !usesUnicodeChars && i < readDataSize; ++i) { if (mReadBuffer[readDataSize] > 127) { usesUnicodeChars = true; } } } if (usesUnicodeChars) { QString dataString = QString::fromUtf8(mReadBuffer,readDataSize); xmlReader->addData(dataString); } else { QByteArray dataByteArray = QByteArray::fromRawData(mReadBuffer,readDataSize); xmlReader->addData(dataByteArray); } return true; } return false; } bool COWL2QtXMLOntologyStableStreamParser::parseOntology(QIODevice* ioDevice) { QXmlStreamReader xmlReader; addMoreDataToXMLReader(&xmlReader,ioDevice); while (!xmlReader.atEnd()) { QXmlStreamReader::TokenType token(xmlReader.readNext()); if (token == QXmlStreamReader::StartDocument) { mOWLXMLStreamHandler->startDocument(); } else if (token == QXmlStreamReader::StartElement) { mOWLXMLStreamHandler->startElement(xmlReader.namespaceUri(),xmlReader.name(),xmlReader.qualifiedName(),xmlReader.attributes()); } else if (token == QXmlStreamReader::EndElement) { mOWLXMLStreamHandler->endElement(xmlReader.namespaceUri(),xmlReader.name(),xmlReader.qualifiedName()); } else if (token == QXmlStreamReader::Characters) { mOWLXMLStreamHandler->readText(xmlReader.text()); } else if (token == QXmlStreamReader::StartDocument) { mOWLXMLStreamHandler->endDocument(); } else if (token == QXmlStreamReader::Invalid) { if (xmlReader.error() == QXmlStreamReader::PrematureEndOfDocumentError) { addMoreDataToXMLReader(&xmlReader,ioDevice); } } } if (xmlReader.hasError()) { mErrorString = QString("XML parsing error at %2:%3: '%1'.").arg(xmlReader.errorString()).arg(xmlReader.lineNumber()).arg(xmlReader.columnNumber()); mError = true; LOG(ERROR,"::Konclude::Parser::OWL2QtXMLStreamOntologyParser",mErrorString,this); } else if (!mOWLXMLStreamHandler->hasOntologyNodeFound()) { mErrorString = QString("OWL2/XML Ontology node not found."); mError = true; LOG(ERROR,"::Konclude::Parser::OWL2QtXMLStreamOntologyParser",mErrorString,this); } return !mError; } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CRBoxAxiomBuilder.cpp0000644000175000017500000000202212520550740023500 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRBoxAxiomBuilder.h" namespace Konclude { namespace Parser { CRBoxAxiomBuilder::CRBoxAxiomBuilder() { } CRBoxAxiomBuilder::~CRBoxAxiomBuilder() { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLOWL2Handler.h0000644000175000017500000003707312520550740022406 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CXMLOWL2HANDLER_H #define KONCLUDE_PARSER_CXMLOWL2HANDLER_H // Libraries includes #include #include #include #include #include // Namespace incldues #include "CXMLHandler.h" #include "CParseRuleAtom.h" #include "COntologyBuilder.h" #include "CParsingExpressionSplitter.h" // Other includes #include "Parser/Expressions/CRulePropertyAtomTermExpression.h" #include "Parser/Expressions/CRuleClassAtomTermExpression.h" #include "Parser/Expressions/CRuleAtomListBodyExpression.h" #include "Parser/Expressions/CRuleAtomListHeadExpression.h" #include "Control/Command/CCommandRecordRouter.h" #include "Control/Command/Records/CNotSupportedNodeErrorRecord.h" #include "Logger/CLogIdentifier.h" #include "Utilities/Container/CQtHash.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; using namespace std; namespace Konclude { using namespace Utilities::Container; using namespace Control::Command; using namespace Control::Command::Records; namespace Parser { class CParseStackObject { public: inline CParseStackObject(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts) : mNamespaceURI(namespaceURI),mLocalName(localName),mQName(qName),mAtts(atts) { } inline CParseStackObject* addBuildExpression(CBuildExpression* buildExpression) { mExpList.append(buildExpression); return this; } inline CParseStackObject* addBuildExpressions(CQtList* expressions) { if (mExpList.isEmpty()) { mExpList = *expressions; } else { mExpList.append(*expressions); } return this; } inline bool hasExpressions() { return !mExpList.isEmpty(); } inline CQtList* getExpressions() { return &mExpList; } const QString mNamespaceURI; const QString mLocalName; const QString mQName; const QXmlAttributes mAtts; CQtList mExpList; }; /*! * * \class CXMLOWL2Handler * \author Andreas Steigmiller * \version 0.1 * \brief Parser for OWL/XML Files * */ class CXMLOWL2Handler : public CXMLHandler, public CLogIdentifier { // public methods public: //! Constructor CXMLOWL2Handler(COntologyBuilder* ontoBuilder); CXMLOWL2Handler(COntologyBuilder* ontoBuilder, CCommandRecordRouter *commandRecordRouter); virtual bool startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts, CParsingHandlingContext* handlingContext); virtual bool endElement(const QString& namespaceURI, const QString& localName, const QString& qName, CParsingHandlingContext* handlingContext); virtual bool startDocument(CParsingHandlingContext* handlingContext); virtual bool endDocument(CParsingHandlingContext* handlingContext); // protected methods protected: bool initializeParseFunctionJumpHash(); QString getEntityName(CParseStackObject* parseStackObj); QString getCardinality(CParseStackObject* parseStackObj); QString getNodeID(CParseStackObject* parseStackObj); void parseBuildNode(CParseStackObject* parseStackObj); CClassExpression* parseClassNode(CParseStackObject* parseStackObj); CObjectPropertyExpression* parseObjectPropertyNode(CParseStackObject* parseStackObj); CObjectIndividualVariableExpression* parseIndividualVariableNode(CParseStackObject* parseStackObj); CDeclarationAxiomExpression* parseDeclarationNode(CParseStackObject* parseStackObj); CEquivalentClassesExpression* parseEquivalentClassesNode(CParseStackObject* parseStackObj); CSubClassOfExpression* parseSubClassOfNode(CParseStackObject* parseStackObj); CDisjointClassesExpression* parseDisjontClassesNode(CParseStackObject* parseStackObj); CDisjointUnionExpression* parseDisjontUnionNode(CParseStackObject* parseStackObj); CSubObjectPropertyOfExpression* parseSubObjectPropertyOfNode(CParseStackObject* parseStackObj); CObjectPropertyChainExpression* parseObjectPropertyChainNode(CParseStackObject* parseStackObj); CEquivalentObjectPropertiesExpression* parseEquivalentObjectPropertiesNode(CParseStackObject* parseStackObj); CDisjointObjectPropertiesExpression* parseDisjointObjectPropertiesNode(CParseStackObject* parseStackObj); CObjectIntersectionOfExpression* parseObjectIntersectionOfNode(CParseStackObject* parseStackObj); CObjectUnionOfExpression* parseObjectUnionOfNode(CParseStackObject* parseStackObj); CObjectMaxCardinalityExpression* parseObjectMaxCardinalityNode(CParseStackObject* parseStackObj); CObjectMinCardinalityExpression* parseObjectMinCardinalityNode(CParseStackObject* parseStackObj); CObjectExactlyCardinalityExpression* parseObjectExactlyCardinalityNode(CParseStackObject* parseStackObj); CObjectSomeValuesFromExpression* parseObjectSomeValuesFromNode(CParseStackObject* parseStackObj); CObjectAllValuesFromExpression* parseObjectAllValuesFromNode(CParseStackObject* parseStackObj); CObjectComplementOfExpression* parseObjectComplementOfNode(CParseStackObject* parseStackObj); CObjectOneOfExpression* parseObjectOneOfNode(CParseStackObject* parseStackObj); CObjectHasValueExpression* parseObjectHasValueNode(CParseStackObject* parseStackObj); CObjectHasSelfExpression* parseObjectHasSelfNode(CParseStackObject* parseStackObj); CClassAssertionExpression* parseClassAssertionNode(CParseStackObject* parseStackObj); CNamedIndividualExpression* parseNamedIndividualNode(CParseStackObject* parseStackObj); CAnonymousIndividualExpression* parseAnonymousIndividualNode(CParseStackObject* parseStackObj); CObjectPropertyAssertionExpression* parseObjectPropertyAssertionNode(CParseStackObject* parseStackObj); CNegativeObjectPropertyAssertionExpression* parseNegativeObjectPropertyAssertionNode(CParseStackObject* parseStackObj); CSameIndividualExpression* parseSameIndividualNode(CParseStackObject* parseStackObj); CDifferentIndividualsExpression* parseDifferentIndividualsNode(CParseStackObject* parseStackObj); CObjectPropertyDomainExpression* parseObjectPropertyDomainNode(CParseStackObject* parseStackObj); CObjectPropertyRangeExpression* parseObjectPropertyRangeNode(CParseStackObject* parseStackObj); CInverseObjectPropertyOfExpression* parseInverseObjectPropertyOfNode(CParseStackObject* parseStackObj); CInverseObjectPropertiesExpression* parseInverseObjectPropertiesNode(CParseStackObject* parseStackObj); CTransetiveObjectPropertyExpression* parseTransetiveObjectPropertyNode(CParseStackObject* parseStackObj); CFunctionalObjectPropertyExpression* parseFunctionalObjectPropertyNode(CParseStackObject* parseStackObj); CSymmetricObjectPropertyExpression* parseSymmetricObjectPropertyNode(CParseStackObject* parseStackObj); CAsymmetricObjectPropertyExpression* parseAsymmetricObjectPropertyNode(CParseStackObject* parseStackObj); CReflexiveObjectPropertyExpression* parseReflexiveObjectPropertyNode(CParseStackObject* parseStackObj); CIrreflexiveObjectPropertyExpression* parseIrreflexiveObjectPropertyNode(CParseStackObject* parseStackObj); CInverseFunctionalObjectPropertyExpression* parseInverseFunctionalObjectPropertyNode(CParseStackObject* parseStackObj); CRulePropertyAtomTermExpression* parseRuleObjectPropertyAtomNode(CParseStackObject* parseStackObj); CRuleClassAtomTermExpression* parseRuleClassAtomNode(CParseStackObject* parseStackObj); CRuleAtomListBodyExpression* parseRuleAtomBodyNode(CParseStackObject* parseStackObj); CRuleAtomListHeadExpression* parseRuleAtomHeadNode(CParseStackObject* parseStackObj); void parseRuleNode(CParseStackObject* parseStackObj); QList parseRuleAtomNodes(CParseStackObject* parseStackObj, const CQtList& buildExpList, bool parseHeadAtoms); QHash createVariableAtomHash(const QList& atomList); QMap createVariableCountMap(const QList& atomList); CBuildExpression* createBodyExpresions(const QString& varString, QHash& bodyVariableAtomHash, QHash& headVariableAtomHash); bool hasBackExpressionLinks(const QString& varString, CParseRuleAtom* notRuleAtom, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash, QSet& backTestProcessedVarSet, QSet& backTestProcessedAtomSet); bool hasBackExpressionLinks(const QString& varString, CParseRuleAtom* notRuleAtom, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash); CBuildExpression* createBodyExpresions(const QString& varString, bool direct, QHash& bodyVariableAtomHash, QSet& processedVarSet, QSet& processedAtomSet, QHash& headVariableAtomHash); CBuildExpression* getNeighbourAtomObjectPropertyExpression(CParseRuleAtom* ruleAtom, bool inversed); void parsePrefixNode(CParseStackObject* parseStackObj); void parseTellOntologyAxiomNode(CParseStackObject* parseStackObj); void parseRetractOntologyAxiomNode(CParseStackObject* parseStackObj); void jumpFunctionOntologyNode(CParseStackObject* parseStackObj); void jumpFunctionParseRuleNode(CParseStackObject* parseStackObj); void jumpFunctionParseRulePropertyAtomNode(CParseStackObject* parseStackObj); void jumpFunctionParseRuleClassAtomNode(CParseStackObject* parseStackObj); void jumpFunctionParseRuleAtomBodyNode(CParseStackObject* parseStackObj); void jumpFunctionParseRuleAtomHeadNode(CParseStackObject* parseStackObj); void jumpFunctionTellOntologyAxiomNode(CParseStackObject* parseStackObj); void jumpFunctionRetractOntologyAxiomNode(CParseStackObject* parseStackObj); void jumpFunctionParsePrefixNode(CParseStackObject* parseStackObj); void jumpFunctionParseClassNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectPropertyNode(CParseStackObject* parseStackObj); void jumpFunctionParseIndividualVariable(CParseStackObject* parseStackObj); void jumpFunctionParseDeclarationNode(CParseStackObject* parseStackObj); void jumpFunctionParseSubClassOfNode(CParseStackObject* parseStackObj); void jumpFunctionParseEquivalentClassesNode(CParseStackObject* parseStackObj); void jumpFunctionParseDisjontClassesNode(CParseStackObject* parseStackObj); void jumpFunctionParseDisjontUnionNode(CParseStackObject* parseStackObj); void jumpFunctionParseSubObjectPropertyOfNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectPropertyChainNode(CParseStackObject* parseStackObj); void jumpFunctionParseEquivalentObjectPropertiesNode(CParseStackObject* parseStackObj); void jumpFunctionParseDisjointObjectPropertiesNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectIntersectionOfNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectUnionOfNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectMaxCardinalityNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectMinCardinalityNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectExactlyCardinalityNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectSomeValuesFromNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectAllValuesFromNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectComplementOfNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectOneOfNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectHasValueNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectHasSelfNode(CParseStackObject* parseStackObj); void jumpFunctionParseClassAssertionNode(CParseStackObject* parseStackObj); void jumpFunctionParseNamedIndividualNode(CParseStackObject* parseStackObj); void jumpFunctionParseAnonymousIndividualNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectPropertyAssertionNode(CParseStackObject* parseStackObj); void jumpFunctionParseNegativeObjectPropertyAssertionNode(CParseStackObject* parseStackObj); void jumpFunctionParseSameIndividualNode(CParseStackObject* parseStackObj); void jumpFunctionParseDifferentIndividualsNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectPropertyDomainNode(CParseStackObject* parseStackObj); void jumpFunctionParseObjectPropertyRangeNode(CParseStackObject* parseStackObj); void jumpFunctionParseInverseObjectPropertyOfNode(CParseStackObject* parseStackObj); void jumpFunctionParseInverseObjectPropertiesNode(CParseStackObject* parseStackObj); void jumpFunctionParseTransetiveObjectPropertyNode(CParseStackObject* parseStackObj); void jumpFunctionParseFunctionalObjectPropertyNode(CParseStackObject* parseStackObj); void jumpFunctionParseSymmetricObjectPropertyNode(CParseStackObject* parseStackObj); void jumpFunctionParseAsymmetricObjectPropertyNode(CParseStackObject* parseStackObj); void jumpFunctionParseReflexiveObjectPropertyNode(CParseStackObject* parseStackObj); void jumpFunctionParseIrreflexiveObjectPropertyNode(CParseStackObject* parseStackObj); void jumpFunctionParseInverseFunctionalObjectPropertyNode(CParseStackObject* parseStackObj); void jumpFunctionParseIgnoredNode(CParseStackObject* parseStackObj); void addTemporaryBuildExpression(CBuildExpression* buildExp); void addTemporaryBuildExpressions(QList* buildExps); // protected variables protected: QStack mStack; QString mOWLPrefix; CCommandRecordRouter recordRouter; COntologyBuilder* mOntoBuilder; QString mOntologyName; cint64 mAxiomNumber; typedef void (CXMLOWL2Handler::*ParseFunction) (CParseStackObject* parseStackObj); CQtHash mParseFunctionJumpHash; QList mRuleExpContainer; CQtList mTmpExpList; QString mOWLString; QString mOWLPrefixString; QString mURIString; QString mIRIString; QString mAbbreviatedIRIString; QString mOWLPrefixURIString; QString mOWLPrefixIRIString; QString mOWLPrefixAbbreviatedIRIString; QString mCardinalityString; QString mOWLPrefixCardinalityString; QString mNodeIDString; QString mOWLPrefixNodeIDString; QString mNameString; QString mOWLPrefixNameString; // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CXMLOWL2HANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/COWLlinkQueryParser.cpp0000644000175000017500000003667512520550736024075 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLlinkQueryParser.h" namespace Konclude { namespace Parser { COWLlinkQueryParser::COWLlinkQueryParser(CQueryBuilder *queryBuilder) { mQueryBuilder = queryBuilder; } COWLlinkQueryParser::~COWLlinkQueryParser() { } bool COWLlinkQueryParser::parseQueryFile(QString filename) { bool successfullParsed = true; // parse file QFile file(filename); if (file.open(QIODevice::ReadOnly)) { QDomDocument document; QString errorMessage; int errorLine = 0, errorColumn = 0; if (document.setContent(file.readAll(),true,&errorMessage,&errorLine,&errorColumn)) { QDomElement documentElement(document.documentElement()); QString docElemName = documentElement.tagName(); if (docElemName == "RequestMessage") { LOG(INFO,"::Konclude::Parser::OWLlinkQueryParser",logTr("Parsing RequestMessage Node."),this); parseRequestMessageNode(&documentElement); } else { successfullParsed = false; LOG(ERROR,"::Konclude::Parser::OWLlinkQueryParser",logTr("Found '%1', but no known Node.").arg(docElemName),this); } LOG(INFO,"::Konclude::Parser::OWLlinkQueryParser",logTr("Parsing of '%1' completed.").arg(filename),this); } else { LOG(ERROR,"::Konclude::Parser::OWLlinkQueryParser",logTr("XML error: %1, file: %2, line: %3, column %4.").arg(errorMessage).arg(filename).arg(errorLine).arg(errorColumn),this); } file.close(); } else { successfullParsed = false; LOG(ERROR,"::Konclude::Parser::OWLlinkQueryParser",logTr("File '%1' not found or couldn't be opened.").arg(filename),this); } return successfullParsed; } void COWLlinkQueryParser::parseRequestMessageNode(QDomElement *queryNode) { QDomElement node = queryNode->firstChildElement(); while (!node.isNull()) { // build for each node an expression parseQueryNode(&node); node = node.nextSiblingElement(); } } CQueryExpression *COWLlinkQueryParser::parseQueryNode(QDomElement *node) { CQueryExpression *expression = 0; QString nodeString(node->tagName()); if (nodeString == "IsClassSatisfiable") { expression = parseIsClassSatisfiableNode(node); } else if (nodeString == "AreClassesEquivalent") { expression = parseAreClassesEquivalentNode(node); } else if (nodeString == "IsInstanceOf") { expression = parseIsInstanceOfNode(node); } else if (nodeString == "IsClassSubsumedBy") { expression = parseIsClassSubsumedByNode(node); } else if (nodeString == "AreClassesDisjoint") { expression = parseAreClassesDisjointNode(node); } else if (nodeString == "GetFlattenedTypes") { expression = parseGetFlattenedTypesNode(node); } else if (nodeString == "GetTypes") { expression = parseGetTypesNode(node); } else if (nodeString == "GetFlattenedInstances") { expression = parseGetFlattenedInstancesNode(node); } else if (nodeString == "GetSameIndividuals") { expression = parseGetSameIndividualsNode(node); } else if (nodeString == "GetInstances") { expression = parseGetInstancesNode(node); } else if (nodeString == "GetSubClasses") { expression = parseGetSubClassesNode(node); } else if (nodeString == "GetSuperClasses") { expression = parseGetSuperClassesNode(node); } else if (nodeString == "GetEquivalentClasses") { expression = parseGetEquivalentClassesNode(node); } else if (nodeString == "IsEntailed") { expression = parseIsEntailedNode(node); } else if (nodeString == "GetObjectPropertyTargets") { expression = parseGetObjectPropertyTargetsNode(node); } else if (nodeString == "GetFlattenedObjectPropertyTargets") { expression = parseGetFlattenedObjectPropertyTargetsNode(node); } else if (nodeString == "GetDeterministicIndividuals") { expression = parseGetDeterministicIndividualsNode(node); } else if (nodeString == "GetNondeterministicIndividuals") { expression = parseGetNondeterministicIndividualsNode(node); } else if (nodeString == "GetDeterministicClassAssertions" || nodeString == "GetKnownClassAssertions") { expression = parseGetDeterministicClassAssertionsNode(node); } else if (nodeString == "GetNondeterministicClassAssertions" || nodeString == "GetPossibleClassAssertions") { expression = parseGetNondeterministicClassAssertionsNode(node); } else if (nodeString == "#text") { // ignoring text nodes } else { QString notSupportedNodeString(nodeString); LOG(WARNING,"::Konclude::Parser::OWLlinkQueryParser",logTr("Not supported XML node: '%1'. Continue with next node.").arg(notSupportedNodeString),this); } return expression; } CQueryIsClassSatisfiableExpression *COWLlinkQueryParser::parseIsClassSatisfiableNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QList builds = parseOntologyChildNodes(node); CQueryIsClassSatisfiableExpression *queryExpression = 0; queryExpression = mQueryBuilder->getIsClassSatisfiableQuery(builds,idName); return queryExpression; } CQueryAreClassesEquivalentExpression *COWLlinkQueryParser::parseAreClassesEquivalentNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QList builds = parseOntologyChildNodes(node); CQueryAreClassesEquivalentExpression *queryExpression = 0; queryExpression = mQueryBuilder->getAreClassesEquivalenceQuery(builds,idName); return queryExpression; } CQueryIsInstanceOfExpression *COWLlinkQueryParser::parseIsInstanceOfNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QList builds = parseOntologyChildNodes(node); CQueryIsInstanceOfExpression *queryExpression = 0; queryExpression = mQueryBuilder->getIsInstanceOfQuery(builds,idName); return queryExpression; } CQueryIsClassSubsumedByExpression *COWLlinkQueryParser::parseIsClassSubsumedByNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QList builds = parseOntologyChildNodes(node); CQueryIsClassSubsumedByExpression *queryExpression = 0; queryExpression = mQueryBuilder->getIsClassSubsumedByQuery(builds,idName); return queryExpression; } CQueryAreClassesDisjointExpression *COWLlinkQueryParser::parseAreClassesDisjointNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QList builds = parseOntologyChildNodes(node); CQueryAreClassesDisjointExpression *queryExpression = 0; queryExpression = mQueryBuilder->getAreClassesDisjointQuery(builds,idName); return queryExpression; } CQueryGetTypesExpression *COWLlinkQueryParser::parseGetTypesNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QString directString = node->attribute("direct"); bool direct = false; if (directString.toUpper() == "TRUE") { direct = true; } QList builds = parseOntologyChildNodes(node); CQueryGetTypesExpression *queryExpression = 0; queryExpression = mQueryBuilder->getGetTypesQuery(builds,direct,idName); return queryExpression; } CQueryGetFlattenedTypesExpression *COWLlinkQueryParser::parseGetFlattenedTypesNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QString directString = node->attribute("direct"); bool direct = false; if (directString.toUpper() == "TRUE") { direct = true; } QList builds = parseOntologyChildNodes(node); CQueryGetFlattenedTypesExpression *queryExpression = 0; queryExpression = mQueryBuilder->getGetFlattenedTypesQuery(builds,direct,idName); return queryExpression; } CQueryGetFlattenedInstancesExpression *COWLlinkQueryParser::parseGetFlattenedInstancesNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QString directString = node->attribute("direct"); bool direct = false; if (directString.toUpper() == "TRUE") { direct = true; } QList builds = parseOntologyChildNodes(node); CQueryGetFlattenedInstancesExpression *queryExpression = 0; queryExpression = mQueryBuilder->getGetFlattenedInstancesQuery(builds,direct,idName); return queryExpression; } CQueryGetSameIndividualsExpression *COWLlinkQueryParser::parseGetSameIndividualsNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QList builds = parseOntologyChildNodes(node); CQueryGetSameIndividualsExpression *queryExpression = 0; queryExpression = mQueryBuilder->getGetSameIndividualsQuery(builds,idName); return queryExpression; } CQueryGetInstancesExpression *COWLlinkQueryParser::parseGetInstancesNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QString directString = node->attribute("direct"); bool direct = false; if (directString.toUpper() == "TRUE") { direct = true; } QList builds = parseOntologyChildNodes(node); CQueryGetInstancesExpression *queryExpression = 0; queryExpression = mQueryBuilder->getGetInstancesQuery(builds,direct,idName); return queryExpression; } CQueryGetSubClassesExpression *COWLlinkQueryParser::parseGetSubClassesNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QString directString = node->attribute("direct"); bool direct = false; if (directString.toUpper() == "TRUE") { direct = true; } QList builds = parseOntologyChildNodes(node); CQueryGetSubClassesExpression *queryExpression = 0; queryExpression = mQueryBuilder->getGetSubClassesQuery(builds,direct,idName); return queryExpression; } CQueryGetSuperClassesExpression *COWLlinkQueryParser::parseGetSuperClassesNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QString directString = node->attribute("direct"); bool direct = false; if (directString.toUpper() == "TRUE") { direct = true; } QList builds = parseOntologyChildNodes(node); CQueryGetSuperClassesExpression *queryExpression = 0; queryExpression = mQueryBuilder->getGetSuperClassesQuery(builds,direct,idName); return queryExpression; } CQueryGetEquivalentClassesExpression* COWLlinkQueryParser::parseGetEquivalentClassesNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QList builds = parseOntologyChildNodes(node); CQueryGetEquivalentClassesExpression *queryExpression = 0; queryExpression = mQueryBuilder->getGetEquivalentClassesQuery(builds,idName); return queryExpression; } CQueryIsEntailedExpression* COWLlinkQueryParser::parseIsEntailedNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QList builds = parseOntologyChildNodes(node); CQueryIsEntailedExpression *queryExpression = 0; queryExpression = mQueryBuilder->getIsEntailedQuery(builds,idName); return queryExpression; } CQueryGetObjectPropertyTargetsExpression *COWLlinkQueryParser::parseGetObjectPropertyTargetsNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QList builds = parseOntologyChildNodes(node); CQueryGetObjectPropertyTargetsExpression *queryExpression = 0; queryExpression = mQueryBuilder->getGetObjectPropertyTargetsQuery(builds,idName); return queryExpression; } QString COWLlinkQueryParser::getQueryIDNameString(QDomElement* node) { QString idName = node->attribute("id"); if (idName.isEmpty()) { idName = node->attribute("name"); } if (idName.isEmpty()) { idName = node->attribute("kb"); if (!idName.isEmpty()) { idName = idName + " KB-Query"; } } return idName; } CQueryGetFlattenedObjectPropertyTargetsExpression *COWLlinkQueryParser::parseGetFlattenedObjectPropertyTargetsNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QList builds = parseOntologyChildNodes(node); CQueryGetFlattenedObjectPropertyTargetsExpression *queryExpression = 0; queryExpression = mQueryBuilder->getGetFlattenedObjectPropertyTargetsQuery(builds,idName); return queryExpression; } CQueryGetDeterministicIndividualsExpression *COWLlinkQueryParser::parseGetDeterministicIndividualsNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QList builds = parseOntologyChildNodes(node); CQueryGetDeterministicIndividualsExpression *queryExpression = 0; queryExpression = mQueryBuilder->getGetDeterministicIndividualsQuery(builds,idName); return queryExpression; } CQueryGetNondeterministicIndividualsExpression *COWLlinkQueryParser::parseGetNondeterministicIndividualsNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QList builds = parseOntologyChildNodes(node); CQueryGetNondeterministicIndividualsExpression *queryExpression = 0; queryExpression = mQueryBuilder->getGetNondeterministicIndividualsQuery(builds,idName); return queryExpression; } CQueryGetDeterministicClassAssertionsExpression *COWLlinkQueryParser::parseGetDeterministicClassAssertionsNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QList builds = parseOntologyChildNodes(node); CQueryGetDeterministicClassAssertionsExpression *queryExpression = 0; queryExpression = mQueryBuilder->getGetDeterministicClassAssertionsQuery(builds,idName); return queryExpression; } CQueryGetNondeterministicClassAssertionsExpression *COWLlinkQueryParser::parseGetNondeterministicClassAssertionsNode(QDomElement *node) { // parse QString idName = getQueryIDNameString(node); QList builds = parseOntologyChildNodes(node); CQueryGetNondeterministicClassAssertionsExpression *queryExpression = 0; queryExpression = mQueryBuilder->getGetNondeterministicClassAssertionsQuery(builds,idName); return queryExpression; } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLHandler.h0000644000175000017500000000416212520550740021733 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CXMLHANDLER_H #define KONCLUDE_PARSER_CXMLHANDLER_H // Libraries includes #include #include // Namespace includes #include "ParserSettings.h" #include "CParsingHandlingContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class CXMLHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CXMLHandler { // public methods public: //! Constructor CXMLHandler(); virtual bool startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts, CParsingHandlingContext* handlingContext) = 0; virtual bool endElement(const QString& namespaceURI, const QString& localName, const QString& qName, CParsingHandlingContext* handlingContext) = 0; virtual bool startDocument(CParsingHandlingContext* handlingContext) = 0; virtual bool endDocument(CParsingHandlingContext* handlingContext) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CXMLHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CQueryBuilder.cpp0000644000175000017500000000177612520550740022754 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryBuilder.h" namespace Konclude { namespace Parser { CQueryBuilder::CQueryBuilder() { } CQueryBuilder::~CQueryBuilder() { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CContinueParsingWaitingCondition.h0000644000175000017500000000344212520550734026302 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CCONTINUEPARSINGWAITINGCONDITION_H #define KONCLUDE_PARSER_CCONTINUEPARSINGWAITINGCONDITION_H // Libraries includes // Namespace includes #include "ParserSettings.h" // Other includes #include "Context/CContext.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class CXMLHandlingContext * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CContinueParsingWaitingCondition : public CLinkerBase { // public methods public: //! Constructor CContinueParsingWaitingCondition(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CCONTINUEPARSINGWAITINGCONDITION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/COWLlinkQtXMLSimpleQueryParser.cpp0000644000175000017500000001153712520550736026123 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLlinkQtXMLSimpleQueryParser.h" namespace Konclude { namespace Parser { COWLlinkQtXMLSimpleQueryParser::COWLlinkQtXMLSimpleQueryParser(CQueryBuilder *queryBuilder, CConcreteOntology* conOntology) : COWLlinkQueryParser(queryBuilder) { mConOntology = conOntology; LOG(INFO,"::Konclude::Parser::OWLlinkQtXMLSimpleQueryParser",logTr("OWLlink Query Parser initialized."),this); } COWLlinkQtXMLSimpleQueryParser::~COWLlinkQtXMLSimpleQueryParser() { } QList COWLlinkQtXMLSimpleQueryParser::parseOntologyChildNodes(QDomElement *node) { QList builds; QDomElement childNode = node->firstChildElement(); while (!childNode.isNull()) { CBuildExpression *expression = nullptr; QString nodeString(childNode.tagName()); if (nodeString == "Class" || nodeString == "owl:Class" ) { QString className(getEntityStringName(&childNode)); CBUILDHASH* classStringBuildHash = mConOntology->getBuildData()->getClassEntityBuildHash(); expression = classStringBuildHash->value(className,nullptr); if (!expression) { LOG(ERROR,"::Konclude::Parser::OWLlinkQtXMLSimpleQueryParser",logTr("Class name '%1' cannot be resolved in ontology '%2'.").arg(className).arg(mConOntology->getOntologyName()),this); } } else if (nodeString == "ObjectProperty" || nodeString == "owl:ObjectProperty" ) { QString objPropName(getEntityStringName(&childNode)); CBUILDHASH* objPropBuildHash = mConOntology->getBuildData()->getObjectPropertyEntityBuildHash(); expression = objPropBuildHash->value(objPropName,nullptr); if (!expression) { LOG(ERROR,"::Konclude::Parser::OWLlinkQtXMLSimpleQueryParser",logTr("Object property name '%1' cannot be resolved in ontology '%2'.").arg(objPropName).arg(mConOntology->getOntologyName()),this); } } else if (nodeString == "NamedIndividual" || nodeString == "owl:NamedIndividual" ) { QString indiName(getEntityStringName(&childNode)); CBUILDHASH* indiStringBuildHash = mConOntology->getBuildData()->getIndividualEntityBuildHash(); expression = indiStringBuildHash->value(indiName,nullptr); if (!expression) { LOG(ERROR,"::Konclude::Parser::OWLlinkQtXMLSimpleQueryParser",logTr("Individual name '%1' cannot be resolved in ontology '%2'.").arg(indiName).arg(mConOntology->getOntologyName()),this); } } if (expression) { builds.append(expression); } childNode = childNode.nextSiblingElement(); } return builds; } QString COWLlinkQtXMLSimpleQueryParser::getEntityStringName(QDomElement *node) { QString entityName; bool abbreviated = false; QString attrName = node->attribute(QString("IRI")); if (attrName.isEmpty()) { attrName = node->attribute(QString("abbreviatedIRI")); abbreviated = true; } if (attrName.isEmpty()) { attrName = node->attribute(QString("owl:IRI")); } if (attrName.isEmpty()) { attrName = node->attribute(QString("owl:abbreviatedIRI")); abbreviated = true; } if (attrName.isEmpty()) { attrName = node->attribute(QString("URI")); } if (attrName.isEmpty()) { attrName = node->attribute(QString("owl:URI")); } if (abbreviated) { entityName = resolveAbbreviationName(attrName); } else { entityName = attrName; } return entityName; } QString COWLlinkQtXMLSimpleQueryParser::resolveAbbreviationName(const QString& name) { QString resolvedString(name); QStringList nameList(name.split(":")); if (nameList.size() > 1) { QString abbName = nameList.first(); QString idName = nameList.last(); CMAPPINGHASH* abbNameHash = mConOntology->getStringMapping()->getAbbreviatedNamePrefixHash(false); CNamePrefix* namePrefix = abbNameHash->value(abbName,nullptr); if (namePrefix) { resolvedString = namePrefix->getPrefixString()+idName; } } return resolvedString; } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/COWL2QtXMLOntologyStreamParser.h0000644000175000017500000000477412520550736025510 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_COWL2QTXMLONTOLOGYSTREAMPARSER_H #define KONCLUDE_PARSER_COWL2QTXMLONTOLOGYSTREAMPARSER_H // Libraries includes #include #include #include // Namespace includes #include "ParserSettings.h" #include "COntologyBuilder.h" #include "CXMLOWL2StreamHandler.h" // Other includes #include "Context/CContextBase.h" #include "Utilities/Memory/CMemoryPoolAllocationManager.h" #include "Utilities/Memory/CMemoryPoolProvider.h" #include "Utilities/Memory/CNewAllocationMemoryPoolProvider.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Utilities::Memory; using namespace Context; namespace Parser { /*! * * \class COWL2QtXMLOntologyStreamParser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWL2QtXMLOntologyStreamParser { // public methods public: //! Constructor COWL2QtXMLOntologyStreamParser(COntologyBuilder* ontologyBuilder); virtual ~COWL2QtXMLOntologyStreamParser(); virtual bool parseOntology(const QString& fileString); virtual bool parseOntology(QIODevice* ioDevice); QString getErrorString(); bool hasError(); // protected methods protected: // protected variables protected: CXMLOWL2StreamHandler* mOWLXMLStreamHandler; COntologyBuilder* mOntologyBuilder; QString mErrorString; bool mError; char* mReadBuffer; cint64 mReadBufferSize; // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_COWL2QTXMLONTOLOGYSTREAMPARSER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLHandlerStack.h0000644000175000017500000000357612520550740022731 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CXMLHANDLERSTACK_H #define KONCLUDE_PARSER_CXMLHANDLERSTACK_H // Libraries includes // Namespace includes #include "ParserSettings.h" #include "CParsingHandlingContext.h" #include "CXMLHandler.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class CXMLHandlerStack * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CXMLHandlerStack { // public methods public: //! Constructor CXMLHandlerStack(); virtual bool pushStackedHandler(CXMLHandler* handler, bool automaticallyPop, CParsingHandlingContext* handlingContext) = 0; virtual bool popStackedHandler(CXMLHandler* handler, CParsingHandlingContext* handlingContext) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CXMLHANDLERSTACK_H Konclude-v0.6.2-544-SourceCode/Source/Parser/COWL2QtXMLOntologySAXParser.cpp0000644000175000017500000000614012520550736025230 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWL2QtXMLOntologySAXParser.h" namespace Konclude { namespace Parser { COWL2QtXMLOntologySAXParser::COWL2QtXMLOntologySAXParser(COntologyBuilder* ontologyBuilder) { mOntologyBuilder = ontologyBuilder; mMemoryPoolProvider = new CNewAllocationMemoryPoolProvider(); mMemoryPoolAllocationMan = new CMemoryPoolAllocationManager(mMemoryPoolProvider); mContextBase = new CContextBase(mMemoryPoolAllocationMan); mHandlerStack = new CXMLHandlerStackBase(); mOWLXMLStackHandler = new CXMLOWL2Handler(mOntologyBuilder); mParsingHandlingContext = new CXMLParsingHandlingContextBase(mHandlerStack,mMemoryPoolAllocationMan); mHandlerStack->pushStackedHandler(mOWLXMLStackHandler,true,mParsingHandlingContext); } COWL2QtXMLOntologySAXParser::~COWL2QtXMLOntologySAXParser() { delete mMemoryPoolAllocationMan; delete mMemoryPoolProvider; delete mHandlerStack; delete mOWLXMLStackHandler; delete mParsingHandlingContext; delete mContextBase; } bool COWL2QtXMLOntologySAXParser::parseOntology(const QString& fileString) { QFile file(fileString); bool succParsed = false; if (file.open(QIODevice::ReadOnly)) { succParsed = parseOntology(&file); file.close(); } return succParsed; } bool COWL2QtXMLOntologySAXParser::parseOntology(QIODevice* ioDevice) { //QHash testHash; //QString testString("test"); //testHash.insert(testString.leftRef(-1),"test"); QXmlSimpleReader xmlReader; QXmlInputSource* source = new QXmlInputSource(ioDevice); CQtXMLContentHandlerConverter* xmlConHanCon = new CQtXMLContentHandlerConverter(mHandlerStack,mParsingHandlingContext); xmlReader.setContentHandler(xmlConHanCon); xmlReader.setErrorHandler(xmlConHanCon); xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); bool succParsed = xmlReader.parse(source); delete xmlConHanCon; delete source; return succParsed; //QStringRef baseNameRef; //QXmlStreamReader xmlReader(ioDevice); //while (!xmlReader.atEnd()) { // QXmlStreamReader::TokenType token(xmlReader.readNext()); // if (token == QXmlStreamReader::StartElement) { // QStringRef nameRef(xmlReader.name()); // baseNameRef = nameRef; // } //} //return true; } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/COWLlinkQtXMLCommandParser.cpp0000644000175000017500000006435512520550736025230 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWLlinkQtXMLCommandParser.h" namespace Konclude { namespace Parser { COWLlinkQtXMLCommandParser::COWLlinkQtXMLCommandParser() : CLogIdentifier("::Konclude::Parser::OWLlinkQtCommandParser",this) { LOG(INFO,"::Konclude::Parser::OWLlinkQtCommandParser",logTr("OWLlink Parser initialized."),this); command = 0; recorder = 0; delegater = 0; } COWLlinkQtXMLCommandParser::~COWLlinkQtXMLCommandParser() { } bool COWLlinkQtXMLCommandParser::realizeCommand(CParseOWLlinkCommandsCommand *parseCommand, CCommandDelegater *commandDelegater) { delegater = commandDelegater; command = parseCommand; if (command) { recorder = command->getRecorder(); } CStartProcessCommandRecord::makeRecord(recorder,getLogDomain(),command); QByteArray *byteArray = command->getByteArray(); bool success = parse(*byteArray); CStopProcessCommandRecord::makeRecord(recorder,getLogDomain(),command); CFinishProcessCommandRecord::makeRecord(recorder,getLogDomain(),command); return success; } bool COWLlinkQtXMLCommandParser::parse(const QByteArray &content) { bool successfullParsed = true; QDomDocument document; document.setContent(content,true); QDomElement documentElement(document.documentElement()); successfullParsed = parse(&documentElement); return successfullParsed; } bool COWLlinkQtXMLCommandParser::parse(QDomElement *node) { bool successfullParsed = true; QDomElement documentElement(*node); QString docElemName = documentElement.tagName(); if (docElemName == "ox:RequestMessage" || docElemName == "RequestMessage") { LOG(INFO,getLogDomain(),logTr("Found OWLlink-Request Node."),this); parseOWLlinkRequestNode(&documentElement); } else { successfullParsed = false; CNotSupportedNodeErrorRecord::makeRecord(docElemName,recorder,getLogDomain(),command); } return successfullParsed; } void COWLlinkQtXMLCommandParser::parseOWLlinkRequestNode(QDomElement *requestNode) { QDomElement node = requestNode->firstChildElement(); CPreconditionCommand *lastPreComm = 0; QLinkedList prevCalcPreCommList; while (!node.isNull()) { // build for each node an expression CPreconditionCommand *preComm; QString namespaceString = node.namespaceURI(); QString docElemName = node.localName(); if (docElemName.isEmpty()) { docElemName = node.tagName(); } if (namespaceString.isEmpty() || namespaceString == "http://www.owllink.org/owllink-xml#" || namespaceString == "http://www.owllink.org/owllink#" || namespaceString == "http://www.owllink.org/ext/retraction#") { if (docElemName == "ImmediatelyExit") { QCoreApplication::exit(); } else if (docElemName == "ox:GetDescription" || docElemName == "GetDescription") { preComm = parseGetDescriptionNode(&node); } else if (docElemName == "ox:CreateKB" || docElemName == "CreateKB") { preComm = parseCreateKnowledgeBaseNode(&node); } else if (docElemName == "ox:InsertResponseComment" || docElemName == "InsertResponseComment") { preComm = parseInsertResponseCommentNode(&node); } else if (docElemName == "ox:Tell" || docElemName == "Tell") { preComm = parseTellKnowledgeBaseNode(&node); } else if (docElemName == "rec:Retract" || docElemName == "Retract") { preComm = parseRectractKnowledgeBaseNode(&node); } else if (docElemName == "ox:LoadKRSSTestConcepts" || docElemName == "LoadKRSSTestConcepts") { preComm = parseLoadKnowledgeBaseKRSSTestConceptNode(&node); } else if (docElemName == "ox:LoadOntology" || docElemName == "LoadOntology") { preComm = parseLoadKnowledgeBaseOntologyNode(&node); } else if (docElemName == "ox:LoadOntologies" || docElemName == "LoadOntologies") { preComm = parseLoadKnowledgeBaseOntologyNode(&node); } else if (docElemName == "ox:SaveExtractedKB" || docElemName == "SaveExtractedKB") { preComm = parseSaveExtractedKnowledgeBaseNode(&node); } else if (docElemName == "ox:SaveExtractedOWLlinkTestCaseKB" || docElemName == "SaveExtractedOWLlinkTestCaseKB") { preComm = parseSaveExtractedOWLlinkTestCaseKnowledgeBaseNode(&node); } else if (docElemName == "ox:IsClassSatisfiable" || docElemName == "IsClassSatisfiable") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:AreClassesEquivalent" || docElemName == "AreClassesEquivalent") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:AreClassesDisjoint" || docElemName == "AreClassesDisjoint") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:IsClassSubsumedBy" || docElemName == "IsClassSubsumedBy") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:IsInstanceOf" || docElemName == "IsInstanceOf") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetFlattenedTypes" || docElemName == "GetFlattenedTypes") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetFlattenedInstances" || docElemName == "GetFlattenedInstances") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetTypes" || docElemName == "GetTypes") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetSameIndividuals" || docElemName == "GetSameIndividuals") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetInstances" || docElemName == "GetInstances") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetObjectPropertyTargets" || docElemName == "GetObjectPropertyTargets") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetFlattenedObjectPropertyTargets" || docElemName == "GetFlattenedObjectPropertyTargets") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetSubClasses" || docElemName == "GetSubClasses") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetSuperClasses" || docElemName == "GetSuperClasses") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetEquivalentClasses" || docElemName == "GetEquivalentClasses") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:IsEntailed" || docElemName == "IsEntailed") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetNondeterministicIndividuals" || docElemName == "GetNondeterministicIndividuals") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetDeterministicIndividuals" || docElemName == "GetDeterministicIndividuals") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetNondeterministicClassAssertions" || docElemName == "GetNondeterministicClassAssertions" || docElemName == "ox:GetPossibleClassAssertions" || docElemName == "GetPossibleClassAssertions") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetDeterministicClassAssertions" || docElemName == "GetDeterministicClassAssertions" || docElemName == "ox:GetKnownClassAssertions" || docElemName == "GetKnownClassAssertions") { preComm = parseProcessQueryNode(&node); } else if (docElemName == "ox:GetSubClassHierarchy" || docElemName == "GetSubClassHierarchy") { preComm = parseGetSubClassHierarchyNode(&node); } else if (docElemName == "ox:IsKBSatisfiable" || docElemName == "IsKBSatisfiable") { preComm = parseIsConsistentNode(&node); } else if (docElemName == "ox:ReleaseKB" || docElemName == "ReleaseKB") { preComm = parseReleaseKnowledgeBaseNode(&node); } else if (docElemName == "ox:GetKBLanguage" || docElemName == "GetKBLanguage") { preComm = parseGetKnowledgeBaseLanguageNode(&node); } else if (docElemName == "ox:GetAllClasses" || docElemName == "GetAllClasses") { preComm = parseGetKnowledgeBaseClassEntitiesNode(&node); } else if (docElemName == "ox:GetAllObjectProperties" || docElemName == "GetAllObjectProperties") { preComm = parseGetKnowledgeBaseObjectPropertyEntitiesNode(&node); } else if (docElemName == "ox:GetAllIndividuals" || docElemName == "GetAllIndividuals") { preComm = parseGetKnowledgeBaseIndividualEntitiesNode(&node); } else if (docElemName == "ox:Classify" || docElemName == "Classify") { preComm = parseKnowledgeBaseClassifyNode(&node); } else if (docElemName == "ox:Realize" || docElemName == "Realize" || docElemName == "ox:Realise" || docElemName == "Realise") { preComm = parseKnowledgeBaseRealizeNode(&node); } else if (docElemName == "ox:TestTestsuite" || docElemName == "TestTestsuite") { preComm = parseTestTestsuiteNode(&node); } else if (docElemName == "ox:EvaluateTestsuite" || docElemName == "EvaluateTestsuite") { preComm = parseEvaluateTestsuiteNode(&node); } else if (docElemName == "ox:GetSetting" || docElemName == "GetSetting") { preComm = parseGetSettingNode(&node); } else if (docElemName == "ox:GetSettings" || docElemName == "GetSettings") { preComm = parseGetSettingsNode(&node); } else if (docElemName == "ox:Set" || docElemName == "Set" || docElemName == "ox:SetSetting" || docElemName == "SetSetting") { preComm = parseSetSettingNode(&node); } else { CNotSupportedNodeErrorRecord::makeRecord(docElemName,recorder,getLogDomain(),command); preComm = new CSkipUnsupportedCommandCommand(docElemName); } } else { QString namespaceNodeName = docElemName; if (!namespaceString.isEmpty()) { namespaceNodeName = namespaceString+":"+docElemName; } CNotSupportedNodeErrorRecord::makeRecord(namespaceNodeName,recorder,getLogDomain(),command); preComm = new CSkipUnsupportedCommandCommand(namespaceNodeName); } if (preComm) { CKnowledgeBaseQueryCommand *queryCommand = dynamic_cast(preComm); if (queryCommand) { parseQueryExtensions(&node,queryCommand); // build default structure for query commands CBuildQueryCommand *buildCommand = 0; CCalculateQueryCommand *calcCommand = 0; buildCommand = queryCommand->getBuildQueryCommand(); if (!buildCommand) { // generate a build query subcommand buildCommand = new CBuildQueryCommand(0,queryCommand); queryCommand->setBuildQueryCommand(buildCommand); } calcCommand = queryCommand->getCalculateQueryCommand(); if (!calcCommand) { calcCommand = new CCalculateQueryCommand(buildCommand,queryCommand); queryCommand->setCalculateQueryCommand(calcCommand); } prevCalcPreCommList.append(queryCommand); } else { foreach (CPreconditionCommand *calcPreComm, prevCalcPreCommList) { if (calcPreComm != lastPreComm) { preComm->addCommandPrecondition(new CCommandProcessedPrecondition(calcPreComm)); } } } if (lastPreComm) { preComm->addCommandPrecondition(new CCommandProcessedPrecondition(lastPreComm)); } if (command) { command->makeToSubCommand(preComm); } if (delegater) { delegater->delegateCommand(preComm); } lastPreComm = preComm; if (queryCommand) { if (queryCommand->getBuildQueryCommand()) { // because of revision management, the system has not to wait until the calculation of a query has finished to continue // with the followed commands lastPreComm = queryCommand->getBuildQueryCommand(); } } } preComm = 0; node = node.nextSiblingElement(); } } CGetDescriptionCommand *COWLlinkQtXMLCommandParser::parseGetDescriptionNode(QDomElement *descriptionNode) { return new CGetDescriptionCommand(); } CInsertResponseCommentCommand *COWLlinkQtXMLCommandParser::parseInsertResponseCommentNode(QDomElement *node) { QString commentString; commentString = node->attribute(QString("commentText")); return new CInsertResponseCommentCommand(commentString); } CCreateKnowledgeBaseCommand *COWLlinkQtXMLCommandParser::parseCreateKnowledgeBaseNode(QDomElement *node) { QString kbName; bool hasKBName = true; if (!node->hasAttribute(QString("kb"))) { hasKBName = false; } else { kbName = node->attribute(QString("kb")); } CCreateKnowledgeBaseCommand* cKCommand = new CCreateKnowledgeBaseCommand(kbName); QDomElement childNode = node->firstChildElement("Prefix"); while (!childNode.isNull()) { QString name = childNode.attribute("name"); QString fullIRI = childNode.attribute("fullIRI"); if (!name.isEmpty() && !fullIRI.isEmpty()) { CNamePrefix* namePrefix = new CNamePrefix(name,fullIRI); cKCommand->addNamePrefix(namePrefix); } childNode = childNode.nextSiblingElement("Prefix"); } return cKCommand; } CReleaseKnowledgeBaseCommand *COWLlinkQtXMLCommandParser::parseReleaseKnowledgeBaseNode(QDomElement *node) { QString kbName; kbName = node->attribute(QString("kb")); return new CReleaseKnowledgeBaseCommand(kbName); } CClassifyQueryCommand* COWLlinkQtXMLCommandParser::parseKnowledgeBaseClassifyNode(QDomElement *node) { QString kbName = node->attribute(QString("kb")); return new CClassifyQueryCommand(kbName); } CRealizeQueryCommand* COWLlinkQtXMLCommandParser::parseKnowledgeBaseRealizeNode(QDomElement *node) { QString kbName = node->attribute(QString("kb")); return new CRealizeQueryCommand(kbName); } CParseTestsuiteXMLNodeCommand *COWLlinkQtXMLCommandParser::parseTestTestsuiteNode(QDomElement *node) { CParseTestsuiteXMLNodeCommand *parseTestsuiteComm = new CParseTestsuiteXMLNodeCommand(*node); if (command) { QString sourcePath = command->getSourcePath(); parseTestsuiteComm->setSourcePath(sourcePath); } return parseTestsuiteComm; } CGetKnowledgeBaseLanguageCommand *COWLlinkQtXMLCommandParser::parseGetKnowledgeBaseLanguageNode(QDomElement *node) { QString kbName; kbName = node->attribute(QString("kb")); return new CGetKnowledgeBaseLanguageCommand(kbName); } CGetKnowledgeBaseClassEntitiesCommand *COWLlinkQtXMLCommandParser::parseGetKnowledgeBaseClassEntitiesNode(QDomElement *node) { QString kbName; kbName = node->attribute(QString("kb")); return new CGetKnowledgeBaseClassEntitiesCommand(kbName); } CGetKnowledgeBaseObjectPropertyEntitiesCommand *COWLlinkQtXMLCommandParser::parseGetKnowledgeBaseObjectPropertyEntitiesNode(QDomElement *node) { QString kbName; kbName = node->attribute(QString("kb")); return new CGetKnowledgeBaseObjectPropertyEntitiesCommand(kbName); } CGetKnowledgeBaseNamedIndividualEntitiesCommand *COWLlinkQtXMLCommandParser::parseGetKnowledgeBaseIndividualEntitiesNode(QDomElement *node) { QString kbName; kbName = node->attribute(QString("kb")); return new CGetKnowledgeBaseNamedIndividualEntitiesCommand(kbName); } CEvaluateTestsuiteCommand* COWLlinkQtXMLCommandParser::parseEvaluateTestsuiteNode(QDomElement* node) { CReasonerEvaluationProgram* evalProg = new CReasonerEvaluationProgram(); QString testName = node->attribute("name"); QString configFile = node->attribute("configFile"); QString inputDir = node->attribute("inputDirectory"); QString outputDir = node->attribute("outputDirectory"); QString analysingDir = node->attribute("analysingDirectory"); evalProg->setConfigFileString(configFile); evalProg->setInputDirectoryString(inputDir); evalProg->setOutputDirectoryString(outputDir); evalProg->setAnalyserDirectoryString(analysingDir); evalProg->setProgramName(testName); QDomElement reasonerChildElm = node->firstChildElement("EvaluateReasoner"); while (!reasonerChildElm.isNull()) { QString initReasonerString = reasonerChildElm.attribute("initFile"); evalProg->appendReasonerString(initReasonerString); reasonerChildElm = reasonerChildElm.nextSiblingElement("EvaluateReasoner"); } QDomElement analyseChildElm = node->firstChildElement("Analysing"); while (!analyseChildElm.isNull()) { QString analyseString = analyseChildElm.attribute("analyseName"); evalProg->appendAnalyserString(analyseString); analyseChildElm = analyseChildElm.nextSiblingElement("Analysing"); } QDomElement filteringChildElm = node->firstChildElement("Filtering"); while (!filteringChildElm.isNull()) { QString filterFileString = filteringChildElm.attribute("filterFile"); evalProg->appendFilterString(filterFileString); filteringChildElm = filteringChildElm.nextSiblingElement("Filtering"); } CEvaluateTestsuiteCommand* evaluateTestsuiteComm = new CEvaluateTestsuiteCommand(testName,evalProg); return evaluateTestsuiteComm; } CTellKnowledgeBaseOWL2XMLNodeCommand *COWLlinkQtXMLCommandParser::parseTellKnowledgeBaseNode(QDomElement *node) { QString kbName; kbName = node->attribute(QString("kb")); return new CTellKnowledgeBaseOWL2XMLNodeCommand(kbName,*node); } CTellKnowledgeBaseOWL2XMLNodeCommand *COWLlinkQtXMLCommandParser::parseRectractKnowledgeBaseNode(QDomElement *node) { QString kbName; kbName = node->attribute(QString("kb")); return new CTellKnowledgeBaseOWL2XMLNodeCommand(kbName,*node); } CLoadKnowledgeBaseKRSSTestConceptCommand *COWLlinkQtXMLCommandParser::parseLoadKnowledgeBaseKRSSTestConceptNode(QDomElement *node) { QString kbName = node->attribute(QString("kb")); QString defNames = node->attribute(QString("testConceptNames")); QString loadIRI = node->attribute(QString("loadIRI")); return new CLoadKnowledgeBaseKRSSTestConceptCommand(kbName,loadIRI,defNames); } CLoadKnowledgeBaseOWLAutoOntologyCommand *COWLlinkQtXMLCommandParser::parseLoadKnowledgeBaseOntologyNode(QDomElement *node) { QString kbName = node->attribute(QString("kb")); QStringList ontoIRIList; QDomElement childElm = node->firstChildElement("ontologyIRI"); while (!childElm.isNull()) { QString ontoIRIString = childElm.attribute("IRI"); ontoIRIList.append(ontoIRIString); childElm = childElm.nextSiblingElement("ontologyIRI"); } childElm = node->firstChildElement("OntologyIRI"); while (!childElm.isNull()) { QString ontoIRIString = childElm.attribute("IRI"); ontoIRIList.append(ontoIRIString); childElm = childElm.nextSiblingElement("OntologyIRI"); } return new CLoadKnowledgeBaseOWLAutoOntologyCommand(kbName,ontoIRIList); } CSaveOWL2XMLExtractedKnowledgeBaseCommand *COWLlinkQtXMLCommandParser::parseSaveExtractedKnowledgeBaseNode(QDomElement *node) { QString kbName = node->attribute(QString("kb")); QStringList entityNames; QDomElement childNode = node->firstChildElement(); while (!childNode.isNull()) { QString entityName = childNode.attribute("IRI"); if (!entityName.isEmpty()) { entityNames.append(entityName); } childNode = childNode.nextSiblingElement(); } QString saveIRI = node->attribute(QString("saveIRI")); return new CSaveOWL2XMLExtractedKnowledgeBaseCommand(kbName,saveIRI,entityNames); } CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand* COWLlinkQtXMLCommandParser::parseSaveExtractedOWLlinkTestCaseKnowledgeBaseNode(QDomElement *node) { QString kbName = node->attribute(QString("kb")); QStringList entityNames; QDomElement childNode = node->firstChildElement(); while (!childNode.isNull()) { QString entityName = childNode.attribute("IRI"); if (!entityName.isEmpty()) { entityNames.append(entityName); } childNode = childNode.nextSiblingElement(); } QString saveIRI = node->attribute(QString("saveIRI")); QString testKBName = node->attribute(QString("testKBName")); return new CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand(kbName,saveIRI,entityNames,testKBName); } CProcessQueryOWL2XMLNodeCommand *COWLlinkQtXMLCommandParser::parseProcessQueryNode(QDomElement *node) { QString kbName; kbName = node->attribute(QString("kb")); return new CProcessQueryOWL2XMLNodeCommand(kbName,*node); } CIsConsistentQueryOWL2XMLNodeCommand* COWLlinkQtXMLCommandParser::parseIsConsistentNode(QDomElement *node) { QString kbName; kbName = node->attribute(QString("kb")); return new CIsConsistentQueryOWL2XMLNodeCommand(kbName,*node); } CGetSubClassHierarchyQueryOWL2XMLNodeCommand *COWLlinkQtXMLCommandParser::parseGetSubClassHierarchyNode(QDomElement *node) { QString kbName; kbName = node->attribute(QString("kb")); return new CGetSubClassHierarchyQueryOWL2XMLNodeCommand(kbName,*node); } void COWLlinkQtXMLCommandParser::parseQueryExtensions(QDomElement *node, CKnowledgeBaseQueryCommand *queryCommand) { CTestExtendedCalculateQueryCommand *testExtCalcQueryComm = dynamic_cast(queryCommand->getCalculateQueryCommand()); if (node->hasAttribute("timing")) { if (CStringPrimitiveConverter::convertStringToBoolean(node->attribute("result"),true)) { if (!testExtCalcQueryComm) { CBuildQueryCommand *buildCommand = queryCommand->getBuildQueryCommand(); if (!buildCommand) { // generate a build query subcommand buildCommand = new CBuildQueryCommand(0,queryCommand); queryCommand->setBuildQueryCommand(buildCommand); } testExtCalcQueryComm = new CTestExtendedCalculateQueryCommand(buildCommand,queryCommand); queryCommand->setCalculateQueryCommand(testExtCalcQueryComm); } testExtCalcQueryComm->setTimingReportLevel(1); } } if (requiresComplexQuery(node)) { queryCommand->setQueryComplexity(true); } parseQueryExpectedResult(node,queryCommand); } void COWLlinkQtXMLCommandParser::parseQueryExpectedResult(QDomElement *node, CKnowledgeBaseQueryCommand *queryCommand) { CTestExtendedCalculateQueryCommand *testExtCalcQueryComm = dynamic_cast(queryCommand->getCalculateQueryCommand()); QDomElement expResNode = node->firstChildElement("ExpectedResult"); if (!expResNode.isNull()) { if (!testExtCalcQueryComm) { CBuildQueryCommand *buildCommand = queryCommand->getBuildQueryCommand(); if (!buildCommand) { // generate a build query subcommand buildCommand = new CBuildQueryCommand(0,queryCommand); queryCommand->setBuildQueryCommand(buildCommand); } testExtCalcQueryComm = new CTestExtendedCalculateQueryCommand(buildCommand,queryCommand); queryCommand->setCalculateQueryCommand(testExtCalcQueryComm); } CQueryResult *expectedResult = 0; expectedResult = parseQueryResult(&expResNode); testExtCalcQueryComm->setExpectedQueryResult(expectedResult); } } bool COWLlinkQtXMLCommandParser::requiresComplexQuery(QDomElement *node) { bool reComplex = false; QDomElement childEl = node->firstChildElement(); while (!reComplex && !childEl.isNull()) { bool childComplex = true; QString elName = childEl.tagName(); if (elName == "Class" || elName == "owl:Class") { childComplex = false; } else if (elName == "NamedIndividual" || elName == "owl:NamedIndividual") { childComplex = false; } else if (elName == "ObjectProperty" || elName == "owl:ObjectProperty") { childComplex = false; } else if (elName == "ExpectedResult") { childComplex = false; } reComplex |= childComplex; childEl = childEl.nextSiblingElement(); } return reComplex; } CQueryResult *COWLlinkQtXMLCommandParser::parseQueryResult(QDomElement *resultNode) { COWLlinkQtXMLResultParser resultParser; QDomElement node = resultNode->firstChildElement(); CQueryResult *queryResult = 0; while (!node.isNull() && !queryResult) { QString docElemName = node.tagName(); if (docElemName == "ox:BooleanResponse" || docElemName == "BooleanResponse") { queryResult = resultParser.parseBooleanQueryResult(&node); } else if (docElemName == "ox:ClassHierarchy" || docElemName == "ClassHierarchy") { queryResult = resultParser.parseClassHierarchyResult(&node); } else { node = node.nextSiblingElement(); } } return queryResult; } CGetConfigCommand *COWLlinkQtXMLCommandParser::parseGetSettingNode(QDomElement *node) { QString kbName = node->attribute(QString("kb"),""); QString propertyName = node->attribute(QString("key"),""); propertyName = getOWLLinkMappedConfigString(propertyName); CGetConfigCommand *confComm = 0; if (!kbName.isEmpty()) { confComm = new CGetKnowledgeBaseConfigCommand(propertyName,kbName); } else { confComm = new CGetConfigCommand(propertyName); } return confComm; } CGetSettingsCommand *COWLlinkQtXMLCommandParser::parseGetSettingsNode(QDomElement *node) { QString kbName = node->attribute(QString("kb"),""); CGetSettingsCommand *confComm = 0; if (!kbName.isEmpty()) { confComm = new CGetKnowledgeBaseSettingsCommand(kbName); } else { confComm = new CGetSettingsCommand(); } return confComm; } CSetConfigCommand *COWLlinkQtXMLCommandParser::parseSetSettingNode(QDomElement *node) { QString kbName = node->attribute(QString("kb"),""); QString propertyName = node->attribute(QString("key"),""); QString propertyValue = node->firstChildElement("Literal").text(); propertyName = getOWLLinkMappedConfigString(propertyName); CSetConfigCommand *confComm = 0; if (!kbName.isEmpty()) { confComm = new CSetKnowledgeBaseConfigCommand(propertyName,propertyValue,kbName); } else { confComm = new CSetConfigCommand(propertyName,propertyValue); } return confComm; } QString COWLlinkQtXMLCommandParser::getOWLLinkMappedConfigString(const QString &keyName) { if (keyName == "abbreviatesIRIs") { return QString("Konclude.OWLlink.AbbreviatedIRIs"); } return keyName; } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLParsingHandlingContext.cpp0000644000175000017500000000177412520550742025336 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CXMLParsingHandlingContext.h" namespace Konclude { namespace Parser { CXMLParsingHandlingContext::CXMLParsingHandlingContext() { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/CABoxAxiomBuilder.h0000644000175000017500000001312012520550734023130 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CABOXAXIOMBUILDER_H #define KONCLUDE_PARSER_CABOXAXIOMBUILDER_H // Libraries includes // Namespace includes // Other includes #include "Parser/Expressions/CNamedIndividualExpression.h" #include "Parser/Expressions/CAnonymousIndividualExpression.h" #include "Parser/Expressions/CClassAssertionExpression.h" #include "Parser/Expressions/CObjectPropertyAssertionExpression.h" #include "Parser/Expressions/CNegativeObjectPropertyAssertionExpression.h" #include "Parser/Expressions/CSameIndividualExpression.h" #include "Parser/Expressions/CDifferentIndividualsExpression.h" #include "Parser/Expressions/CDataPropertyAssertionExpression.h" #include "Parser/Expressions/CNegativeDataPropertyAssertionExpression.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { using namespace Expression; /*! * * \class CABoxAxiomBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CABoxAxiomBuilder { // public methods public: //! Constructor CABoxAxiomBuilder(); //! Destructor virtual ~CABoxAxiomBuilder(); virtual CNamedIndividualExpression* getNamedIndividual(const QString& individualName) = 0; virtual CNamedIndividualExpression* getNamedIndividual(const QStringRef& individualName) = 0; virtual CAnonymousIndividualExpression* getAnonymousIndividual(const QString& ontologyName, const QString& individualName) = 0; virtual CAnonymousIndividualExpression* getAnonymousIndividual(const QStringRef& ontologyName, const QStringRef& individualName) = 0; virtual CClassAssertionExpression* getClassAssertion(const CEXPRESSIONLIST& expressions) = 0; virtual CClassAssertionExpression* getClassAssertion(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CObjectPropertyAssertionExpression* getObjectPropertyAssertion(const CEXPRESSIONLIST& expressions) = 0; virtual CObjectPropertyAssertionExpression* getObjectPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) = 0; virtual CNegativeObjectPropertyAssertionExpression* getNegativeObjectPropertyAssertion(const CEXPRESSIONLIST& expressions) = 0; virtual CNegativeObjectPropertyAssertionExpression* getNegativeObjectPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) = 0; virtual CSameIndividualExpression* getSameIndividual(const CEXPRESSIONLIST& expressions) = 0; virtual CDifferentIndividualsExpression* getDifferentIndividuals(const CEXPRESSIONLIST& expressions) = 0; virtual CDataPropertyAssertionExpression* getDataPropertyAssertion(const CEXPRESSIONLIST& expressions) = 0; virtual CDataPropertyAssertionExpression* getDataPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) = 0; virtual CNegativeDataPropertyAssertionExpression* getNegativeDataPropertyAssertion(const CEXPRESSIONLIST& expressions) = 0; virtual CNegativeDataPropertyAssertionExpression* getNegativeDataPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) = 0; virtual CClassAssertionExpression* getClassAssertion(CIndividualTermExpression* expression1, CClassTermExpression* expression2) = 0; virtual CObjectPropertyAssertionExpression* getObjectPropertyAssertion(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2, CObjectPropertyTermExpression* expression3) = 0; virtual CNegativeObjectPropertyAssertionExpression* getNegativeObjectPropertyAssertion(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2, CObjectPropertyTermExpression* expression3) = 0; virtual CSameIndividualExpression* getSameIndividual(const CEXPRESSIONLIST& expressions) = 0; virtual CDifferentIndividualsExpression* getDifferentIndividuals(const CEXPRESSIONLIST& expressions) = 0; virtual CDataPropertyAssertionExpression* getDataPropertyAssertion(CIndividualTermExpression* expression1, CDataLiteralExpression* expression2, CDataPropertyTermExpression* expression3) = 0; virtual CNegativeDataPropertyAssertionExpression* getNegativeDataPropertyAssertion(CIndividualTermExpression* expression1, CDataLiteralExpression* expression2, CDataPropertyTermExpression* expression3) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CABOXAXIOMBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CTBoxAxiomBuilder.h0000644000175000017500000003532512520550740023163 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CTBOXAXIOMBUILDER_H #define KONCLUDE_PARSER_CTBOXAXIOMBUILDER_H // Libraries includes #include #include // Namespace includes #include "Parser/Expressions/CBuildExpression.h" #include "Parser/Expressions/CClassExpression.h" #include "Parser/Expressions/CObjectIndividualVariableExpression.h" #include "Parser/Expressions/CSubClassOfExpression.h" #include "Parser/Expressions/CEquivalentClassesExpression.h" #include "Parser/Expressions/CDisjointClassesExpression.h" #include "Parser/Expressions/CDisjointUnionExpression.h" #include "Parser/Expressions/CObjectIntersectionOfExpression.h" #include "Parser/Expressions/CObjectUnionOfExpression.h" #include "Parser/Expressions/CObjectComplementOfExpression.h" #include "Parser/Expressions/CObjectMaxCardinalityExpression.h" #include "Parser/Expressions/CObjectMinCardinalityExpression.h" #include "Parser/Expressions/CObjectExactlyCardinalityExpression.h" #include "Parser/Expressions/CObjectAllValuesFromExpression.h" #include "Parser/Expressions/CObjectSomeValuesFromExpression.h" #include "Parser/Expressions/CObjectOneOfExpression.h" #include "Parser/Expressions/CObjectHasValueExpression.h" #include "Parser/Expressions/CObjectHasSelfExpression.h" #include "Parser/Expressions/CDataLiteralExpression.h" #include "Parser/Expressions/CDatatypeExpression.h" #include "Parser/Expressions/CDataLexicalValueExpression.h" #include "Parser/Expressions/CDataSomeValuesFromExpression.h" #include "Parser/Expressions/CDataAllValuesFromExpression.h" #include "Parser/Expressions/CDataIntersectionOfExpression.h" #include "Parser/Expressions/CDataOneOfExpression.h" #include "Parser/Expressions/CDataUnionOfExpression.h" #include "Parser/Expressions/CDataComplementOfExpression.h" #include "Parser/Expressions/CDatatypeRestrictionExpression.h" #include "Parser/Expressions/CDataMaxCardinalityExpression.h" #include "Parser/Expressions/CDataMinCardinalityExpression.h" #include "Parser/Expressions/CDataExactCardinalityExpression.h" #include "Parser/Expressions/CDataHasValueExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { using namespace Expression; /*! * \class CTBoxAxiomBuilder * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CTBoxAxiomBuilder { // public methods public: //! Constructor CTBoxAxiomBuilder(); //! Destructor virtual ~CTBoxAxiomBuilder(); virtual CClassExpression* getClass(const QString &className) = 0; virtual CClassExpression* getClass(const QStringRef &className) = 0; virtual CObjectIndividualVariableExpression* getIndividualVariable(const QStringRef &individualVariableName, cint64 axiomNumber) = 0; virtual CObjectIndividualVariableExpression* getIndividualVariable(const QString &individualVariableName, cint64 axiomNumber) = 0; virtual CDataLiteralExpression* getDataLiteral(CDataLexicalValueExpression* dataLexicalValue, CDatatypeExpression* datatype) = 0; virtual CDatatypeExpression* getDatatype(const QString& datatypeName) = 0; virtual CDatatypeExpression* getDatatype(const QStringRef& datatypeName) = 0; virtual CDataLexicalValueExpression* getDataLexicalValue(const QString& dataLexicalValue) = 0; virtual CDataLexicalValueExpression* getDataLexicalValue(const QStringRef& dataLexicalValue) = 0; virtual CDataFacetRestrictionExpression* getDataFacetRestriction(const CEXPRESSIONLIST& expressions) = 0; virtual CDataFacetRestrictionExpression* getDataFacetRestriction(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CDataSomeValuesFromExpression* getDataSomeValuesFrom(const CEXPRESSIONLIST& expressions) = 0; virtual CDataSomeValuesFromExpression* getDataSomeValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CDataHasValueExpression* getDataHasValue(const CEXPRESSIONLIST& expressions) = 0; virtual CDataHasValueExpression* getDataHasValue(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CDataAllValuesFromExpression* getDataAllValuesFrom(const CEXPRESSIONLIST& expressions) = 0; virtual CDataAllValuesFromExpression* getDataAllValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CDataIntersectionOfExpression* getDataIntersectionOf(const CEXPRESSIONLIST& expressions) = 0; virtual CDataIntersectionOfExpression* getDataIntersectionOf(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CDataOneOfExpression* getDataOneOf(const CEXPRESSIONLIST& expressions) = 0; virtual CDataOneOfExpression* getDataOneOf(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CDataUnionOfExpression* getDataUnionOf(const CEXPRESSIONLIST& expressions) = 0; virtual CDataUnionOfExpression* getDataUnionOf(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CDataComplementOfExpression* getDataComplementOf(const CEXPRESSIONLIST& expressions) = 0; virtual CDataComplementOfExpression* getDataComplementOf(CBuildExpression* expression) = 0; virtual CDatatypeRestrictionExpression* getDatatypeRestriction(const CEXPRESSIONLIST& expressions) = 0; virtual CDatatypeRestrictionExpression* getDatatypeRestriction(CBuildExpression* expression1, CBuildExpression* expression2) = 0; virtual CDataFacetExpression* getDataFacet(const QString& dataFacetIRI) = 0; virtual CDataFacetExpression* getDataFacet(const QStringRef& dataFacetIRI) = 0; virtual CDataFacetRestrictionExpression* getDataFacetRestriction(CDataLiteralExpression* dataLiteralExpression, CDataFacetExpression* dataFacet) = 0; virtual CDataMaxCardinalityExpression* getDataMaxCardinality(const CEXPRESSIONLIST& expressions, int cardinality) = 0; virtual CDataMaxCardinalityExpression* getDataMaxCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) = 0; virtual CDataMinCardinalityExpression* getDataMinCardinality(const CEXPRESSIONLIST& expressions, int cardinality) = 0; virtual CDataMinCardinalityExpression* getDataMinCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) = 0; virtual CDataExactCardinalityExpression* getDataExactCardinality(const CEXPRESSIONLIST& expressions, int cardinality) = 0; virtual CDataExactCardinalityExpression* getDataExactCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) = 0; virtual CDataSomeValuesFromExpression* getDataSomeValuesFrom(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) = 0; virtual CDataHasValueExpression* getDataHasValue(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) = 0; virtual CDataAllValuesFromExpression* getDataAllValuesFrom(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) = 0; virtual CDataIntersectionOfExpression* getDataIntersectionOf(const CEXPRESSIONLIST& expressions) = 0; virtual CDataOneOfExpression* getDataOneOf(const CEXPRESSIONLIST& expressions) = 0; virtual CDataUnionOfExpression* getDataUnionOf(const CEXPRESSIONLIST& expressions) = 0; virtual CDataComplementOfExpression* getDataComplementOf(CDataRangeTermExpression* expressions) = 0; virtual CDatatypeRestrictionExpression* getDatatypeRestriction(CDatatypeExpression* datatypeExpression, const CEXPRESSIONLIST& expressions) = 0; virtual CDataMaxCardinalityExpression* getDataMaxCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality) = 0; virtual CDataMinCardinalityExpression* getDataMinCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality) = 0; virtual CDataExactCardinalityExpression* getDataExactCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality) = 0; virtual CDataRangeTermExpression* getTopDataRange() = 0; virtual CDataRangeTermExpression* getBottomDataRange() = 0; virtual CEquivalentClassesExpression *getEquivalentClasses(const CEXPRESSIONLIST &expressions) = 0; virtual CEquivalentClassesExpression *getEquivalentClasses(CBuildExpression *expression1, CBuildExpression *expression2) = 0; virtual CSubClassOfExpression *getSubClassOf(const CEXPRESSIONLIST &expressions) = 0; virtual CSubClassOfExpression *getSubClassOf(CBuildExpression *expression1, CBuildExpression *expression2) = 0; virtual CDisjointClassesExpression *getDisjointClasses(const CEXPRESSIONLIST &expressions) = 0; virtual CDisjointUnionExpression *getDisjointUnion(const CEXPRESSIONLIST &expressions) = 0; virtual CObjectComplementOfExpression *getObjectComplementOf(CBuildExpression *expression) = 0; virtual CObjectComplementOfExpression *getObjectComplementOf(const CEXPRESSIONLIST &expressions) = 0; virtual CObjectIntersectionOfExpression *getObjectIntersectionOf(const CEXPRESSIONLIST &expressions) = 0; virtual CObjectUnionOfExpression *getObjectUnionOf(const CEXPRESSIONLIST &expressions) = 0; virtual CObjectMaxCardinalityExpression *getObjectMaxCardinality(const CEXPRESSIONLIST &expressions, int cardinality) = 0; virtual CObjectMaxCardinalityExpression *getObjectMaxCardinality(CBuildExpression *expression1, CBuildExpression *expression2, int cardinality) = 0; virtual CObjectMinCardinalityExpression *getObjectMinCardinality(const CEXPRESSIONLIST &expressions, int cardinality) = 0; virtual CObjectMinCardinalityExpression *getObjectMinCardinality(CBuildExpression *expression1, CBuildExpression *expression2, int cardinality) = 0; virtual CObjectExactlyCardinalityExpression *getObjectExactlyCardinality(const CEXPRESSIONLIST &expressions, int cardinality) = 0; virtual CObjectExactlyCardinalityExpression *getObjectExactlyCardinality(CBuildExpression *expression1, CBuildExpression *expression2, int cardinality) = 0; virtual CObjectAllValuesFromExpression *getObjectAllValuesFrom(const CEXPRESSIONLIST &expressions) = 0; virtual CObjectAllValuesFromExpression *getObjectAllValuesFrom(CBuildExpression *expression1, CBuildExpression *expression2) = 0; virtual CObjectSomeValuesFromExpression *getObjectSomeValuesFrom(const CEXPRESSIONLIST &expressions) = 0; virtual CObjectSomeValuesFromExpression *getObjectSomeValuesFrom(CBuildExpression *expression1, CBuildExpression *expression2) = 0; virtual CObjectOneOfExpression *getObjectOneOf(const CEXPRESSIONLIST &expressions) = 0; virtual CObjectHasValueExpression *getObjectHasValue(const CEXPRESSIONLIST &expressions) = 0; virtual CObjectHasValueExpression *getObjectHasValue(CBuildExpression *expression1, CBuildExpression *expression2) = 0; virtual CObjectHasSelfExpression *getObjectHasSelf(const CEXPRESSIONLIST &expressions) = 0; virtual CObjectHasSelfExpression *getObjectHasSelf(CBuildExpression *expression) = 0; virtual CClassTermExpression *getTopClass() = 0; virtual CClassTermExpression *getBottomClass() = 0; virtual CEquivalentClassesExpression* getEquivalentClasses(const CEXPRESSIONLIST& expressions) = 0; virtual CSubClassOfExpression* getSubClassOf(CClassTermExpression* expression1, CClassTermExpression* expression2) = 0; virtual CDisjointClassesExpression* getDisjointClasses(const CEXPRESSIONLIST& expressions) = 0; virtual CDisjointUnionExpression *getDisjointUnion(CClassExpression* classExpression, const CEXPRESSIONLIST& expressions) = 0; virtual CObjectComplementOfExpression* getObjectComplementOf(CClassTermExpression* expression) = 0; virtual CObjectIntersectionOfExpression* getObjectIntersectionOf(const CEXPRESSIONLIST& expressions) = 0; virtual CObjectUnionOfExpression* getObjectUnionOf(const CEXPRESSIONLIST& expressions) = 0; virtual CObjectMaxCardinalityExpression* getObjectMaxCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality) = 0; virtual CObjectMinCardinalityExpression* getObjectMinCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality) = 0; virtual CObjectExactlyCardinalityExpression* getObjectExactlyCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality) = 0; virtual CObjectAllValuesFromExpression* getObjectAllValuesFrom(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) = 0; virtual CObjectSomeValuesFromExpression* getObjectSomeValuesFrom(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) = 0; virtual CObjectOneOfExpression *getObjectOneOf(const CEXPRESSIONLIST &expressions) = 0; virtual CObjectHasValueExpression *getObjectHasValue(CObjectPropertyTermExpression *expression1, CIndividualTermExpression *expression2) = 0; virtual CObjectHasSelfExpression *getObjectHasSelf(CObjectPropertyTermExpression *expression) = 0; // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CTBOXAXIOMBUILDER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CQtXMLContentHandlerConverter.cpp0000644000175000017500000000365612520550740026025 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQtXMLContentHandlerConverter.h" namespace Konclude { namespace Parser { CQtXMLContentHandlerConverter::CQtXMLContentHandlerConverter(CXMLHandlerStackBase* handlerStack, CXMLParsingHandlingContext* parsingHandlingContext) { mHandlerStack = handlerStack; mParsingHandlingContext = parsingHandlingContext; } bool CQtXMLContentHandlerConverter::endElement(const QString& namespaceURI, const QString& localName, const QString& qName) { return mHandlerStack->endElement(namespaceURI,localName,qName,mParsingHandlingContext); return true; } bool CQtXMLContentHandlerConverter::startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts) { return mHandlerStack->startElement(namespaceURI,localName,qName,atts,mParsingHandlingContext); return true; } bool CQtXMLContentHandlerConverter::startDocument() { return mHandlerStack->startDocument(mParsingHandlingContext); } bool CQtXMLContentHandlerConverter::endDocument() { return mHandlerStack->endDocument(mParsingHandlingContext); } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/COWLlinkQueryExtensionParser.h0000644000175000017500000000373012520550736025421 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_COWLlinkQueryExtensionParser_H #define KONCLUDE_PARSER_COWLlinkQueryExtensionParser_H // Libraries includes #include #include // Namespace includes #include "COWLlinkQtXMLResultParser.h" // Other includes #include "Reasoner/Classifier/CClassificationCalculationSupport.h" #include "Reasoner/Ontology/COntology.h" #include "Reasoner/Ontology/CConcreteOntology.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner; using namespace Classifier; using namespace Ontology; namespace Parser { /*! * * \class COWLlinkQueryExtensionParser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWLlinkQueryExtensionParser { // public methods public: //! Constructor COWLlinkQueryExtensionParser(); //! Destructor virtual ~COWLlinkQueryExtensionParser(); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_COWLlinkQueryExtensionParser_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CStringPrimitiveConverter.h0000644000175000017500000000374212520550740025027 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CSTRINGPRIMITIVECONVERTER_H #define KONCLUDE_PARSER_CSTRINGPRIMITIVECONVERTER_H // Libraries includes #include #include // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class CStringPrimitiveConverter * \author Andreas Steigmiller * \version 0.1 * \brief Parser for OWL/XML Files * */ class CStringPrimitiveConverter { // public methods public: //! Constructor CStringPrimitiveConverter(); //! Destructor virtual ~CStringPrimitiveConverter(); static bool convertStringToBoolean(const QString &booleanString, bool defaultValue = 0, bool *parseErrorFlag = 0); static qint64 convertStringToInteger(const QString &integerString, qint64 defaultValue = false, bool *parseErrorFlag = 0); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CSTRINGPRIMITIVECONVERTER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/0000755000175000017500000000000012613407252022042 5ustar jonasjonas././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CInverseFunctionalObjectPropertyExpression.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CInverseFunctionalObjectPropertyExpression.0000644000175000017500000000506412520550714032564 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CInverseFunctionalObjectPropertyExpression.h" namespace Konclude { namespace Parser { namespace Expression { CInverseFunctionalObjectPropertyExpression::CInverseFunctionalObjectPropertyExpression(CObjectPropertyTermExpression *expression) : CObjectPropertyTermExpressionAssociator(expression) { } CInverseFunctionalObjectPropertyExpression::~CInverseFunctionalObjectPropertyExpression() { } CBuildExpression::ExpressionType CInverseFunctionalObjectPropertyExpression::getType() { return BETINVERSEFUNCTIONALPROPERTY; } CObjectPropertyTermExpression *CInverseFunctionalObjectPropertyExpression::getInverseFunctionalObjectPropertyExpression() { return getObjectPropertyTermExpression(); } cint64 CInverseFunctionalObjectPropertyExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CInverseFunctionalObjectPropertyExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CInverseFunctionalObjectPropertyExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CInverseFunctionalObjectPropertyExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CSubClassOfExpression.cpp0000644000175000017500000000473712520550732026747 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSubClassOfExpression.h" namespace Konclude { namespace Parser { namespace Expression { CSubClassOfExpression::CSubClassOfExpression(CClassTermExpression *subClassExpression1, CClassTermExpression *superClassExpression2) : COrderedPairClassTermExpressionAssociator(subClassExpression1,superClassExpression2) { } CSubClassOfExpression::~CSubClassOfExpression() { } CClassTermExpression* CSubClassOfExpression::getSubClassTermExpression() { return getFirstClassTermExpression(); } CClassTermExpression* CSubClassOfExpression::getSuperClassTermExpression() { return getSecondClassTermExpression(); } CBuildExpression::ExpressionType CSubClassOfExpression::getType() { return BETESUBCLASSOF; } cint64 CSubClassOfExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),COrderedPairClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CSubClassOfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CSubClassOfExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return COrderedPairClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CSubClassOfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { COrderedPairClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairDataPropertyTermExpressionAssociator.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairDataPropertyTermExpressionAssoc0000644000175000017500000000337312520550722032534 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COrderedPairDataPropertyTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { COrderedPairDataPropertyTermExpressionAssociator::COrderedPairDataPropertyTermExpressionAssociator(CDataPropertyTermExpression *expression1, CDataPropertyTermExpression *expression2) : COrderedPairExpressionAssociator(expression1,expression2) { } COrderedPairDataPropertyTermExpressionAssociator::~COrderedPairDataPropertyTermExpressionAssociator() { } CDataPropertyTermExpression* COrderedPairDataPropertyTermExpressionAssociator::getFirstDataPropertyTermExpression() { return (CDataPropertyTermExpression*)getFirstExpression(); } CDataPropertyTermExpression* COrderedPairDataPropertyTermExpressionAssociator::getSecondDataPropertyTermExpression() { return (CDataPropertyTermExpression*)getSecondExpression(); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetDeterministicClassAssertionsExpression.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetDeterministicClassAssertionsExpres0000644000175000017500000000302312520550726032611 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetDeterministicClassAssertionsExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetDeterministicClassAssertionsExpression::CQueryGetDeterministicClassAssertionsExpression(const QString& name, const CEXPRESSIONLIST& expressionList) : CQueryGetClassAssertionsExpression(name,expressionList) { } CQueryGetDeterministicClassAssertionsExpression::~CQueryGetDeterministicClassAssertionsExpression() { } CBuildExpression::ExpressionType CQueryGetDeterministicClassAssertionsExpression::getType() { return BETGETDETERMINISTICCLASSASSERTIONS; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairExpressionAssociator.h0000644000175000017500000000420212520550724030624 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIREXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIREXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CBuildExpression.h" #include "CPairExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class COrderedPairExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COrderedPairExpressionAssociator : public CPairExpressionAssociator { // public methods public: //! Constructor COrderedPairExpressionAssociator(CBuildExpression* expression1, CBuildExpression* expression2); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(const COrderedPairExpressionAssociator& orderedPairExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIREXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListExpression.cpp0000644000175000017500000000250512520550716025647 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CListExpression.h" namespace Konclude { namespace Parser { namespace Expression { CListExpression::CListExpression(CBuildExpression *expression1, CBuildExpression *expression2, CBuildExpression *expression3) { if (expression1) { append(expression1); } if (expression2) { append(expression2); } if (expression3) { append(expression3); } } CListExpression::~CListExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CFunctionalObjectPropertyExpression.h0000644000175000017500000000464212520550714031401 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CFUNCTIONALOBJECTPROPERTYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CFUNCTIONALOBJECTPROPERTYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyAxiomExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CFunctionalObjectPropertyExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CFunctionalObjectPropertyExpression : public CObjectPropertyAxiomExpression, public CObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CFunctionalObjectPropertyExpression(CObjectPropertyTermExpression *expression); //! Destructor virtual ~CFunctionalObjectPropertyExpression(); CObjectPropertyTermExpression *getFunctionalObjectPropertyExpression(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual ExpressionType getType(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CFUNCTIONALOBJECTPROPERTYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRuleAtomTermExpression.cpp0000644000175000017500000000215512520550730027311 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRuleAtomTermExpression.h" namespace Konclude { namespace Parser { namespace Expression { CRuleAtomTermExpression::CRuleAtomTermExpression() { } CRuleAtomTermExpression::~CRuleAtomTermExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectSomeValuesFromExpression.cpp0000644000175000017500000000506112520550722030767 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectSomeValuesFromExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectSomeValuesFromExpression::CObjectSomeValuesFromExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2) : CObjectPropertyTermExpressionAssociator(expression1), CClassTermExpressionAssociator(expression2) { } CObjectSomeValuesFromExpression::~CObjectSomeValuesFromExpression() { } CBuildExpression::ExpressionType CObjectSomeValuesFromExpression::getType() { return BETOBJECTSOMEVALUEFROM; } cint64 CObjectSomeValuesFromExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue(),CClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CObjectSomeValuesFromExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectSomeValuesFromExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CObjectSomeValuesFromExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CEquivalentDataPropertiesExpression.h0000644000175000017500000000472212520550712031364 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CEQUIVALENTDATAPROPERTIESEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CEQUIVALENTDATAPROPERTIESEXPRESSION_H // Libraries includes // Namespace includes #include "CDataPropertyAxiomExpression.h" #include "CListDataPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CEquivalentDataPropertiesExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CEquivalentDataPropertiesExpression : public CDataPropertyAxiomExpression, public CListDataPropertyTermExpressionAssociator { // public methods public: //! Constructor CEquivalentDataPropertiesExpression(CDataPropertyTermExpression *expression1, CDataPropertyTermExpression *expression2, CDataPropertyTermExpression *expression3 = nullptr); CEquivalentDataPropertiesExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CEquivalentDataPropertiesExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CEQUIVALENTDATAPROPERTIESEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CAxiomExpression.h0000644000175000017500000000322112520550704025447 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CAXIOMEXPRESSION_H #define KONCLUDE_PARSER_CAXIOMEXPRESSION_H // Libraries includes #include // Namespace includes #include "CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CAxiomExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CAxiomExpression : public CBuildExpression { // public methods public: //! Constructor CAxiomExpression(); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CAXIOMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDisjointClassesExpression.cpp0000644000175000017500000000431112520550712030026 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDisjointClassesExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDisjointClassesExpression::CDisjointClassesExpression(const CEXPRESSIONLIST& expressionList) : CListClassTermExpressionAssociator(expressionList) { } CDisjointClassesExpression::~CDisjointClassesExpression() { } CBuildExpression::ExpressionType CDisjointClassesExpression::getType() { return BETDISJOINTCLASSES; } cint64 CDisjointClassesExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDisjointClassesExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDisjointClassesExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CDisjointClassesExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataPropertyRangeExpression.cpp0000644000175000017500000000503212520550710030317 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataPropertyRangeExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataPropertyRangeExpression::CDataPropertyRangeExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2) : CDataPropertyTermExpressionAssociator(expression1), CDataRangeTermExpressionAssociator(expression2) { } CDataPropertyRangeExpression::~CDataPropertyRangeExpression() { } CBuildExpression::ExpressionType CDataPropertyRangeExpression::getType() { return BETDATAPROPERTYRANGE; } cint64 CDataPropertyRangeExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDataPropertyTermExpressionAssociator::getStructuralHashValue(),CDataRangeTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDataPropertyRangeExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataPropertyRangeExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDataPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CDataRangeTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CDataPropertyRangeExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CDataPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CDataRangeTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataFacetExpressionAssociator.h0000644000175000017500000000424612520550706030250 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAFACETEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CDATAFACETEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CDataFacetExpression.h" #include "CExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDataFacetExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataFacetExpressionAssociator : public CExpressionAssociator { // public methods public: //! Constructor CDataFacetExpressionAssociator(CDataFacetExpression* expression = nullptr); //! Destructor virtual ~CDataFacetExpressionAssociator(); CDataFacetExpression* getDataFacetExpression(); virtual bool compareStructuralEquivalence(const CDataFacetExpressionAssociator& datatypeExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAFACETEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CAnonymousIndividualExpression.cpp0000644000175000017500000000447412520550702030737 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAnonymousIndividualExpression.h" namespace Konclude { namespace Parser { namespace Expression { CAnonymousIndividualExpression::CAnonymousIndividualExpression(const QString& ontologyName, const QString& nodeName) : CExpressionEntity(ontologyName+":"+nodeName){ mOntologyName = ontologyName; mNodeName = nodeName; } CAnonymousIndividualExpression::~CAnonymousIndividualExpression() { } CBuildExpression::ExpressionType CAnonymousIndividualExpression::getType() { return BETANONYMOUSINDIVIDUAL; } cint64 CAnonymousIndividualExpression::getStructuralHashValue() { return (cint64)this; } bool CAnonymousIndividualExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CAnonymousIndividualExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } if (compExpCast != this) { return false; } return true; } const QString& CAnonymousIndividualExpression::getOntologyName() { return mOntologyName; } const QString& CAnonymousIndividualExpression::getNodeName() { return mNodeName; } bool CAnonymousIndividualExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { subExpressionVisitor->visitEntity(this,this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDatatypeExpressionAssociator.h0000644000175000017500000000423212520550710030175 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATATYPEEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CDATATYPEEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CDatatypeExpression.h" #include "CExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDatatypeExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeExpressionAssociator : public CExpressionAssociator { // public methods public: //! Constructor CDatatypeExpressionAssociator(CDatatypeExpression* expression = nullptr); //! Destructor virtual ~CDatatypeExpressionAssociator(); CDatatypeExpression* getDatatypeExpression(); virtual bool compareStructuralEquivalence(const CDatatypeExpressionAssociator& datatypeExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATATYPEEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataRangeTermExpression.cpp0000644000175000017500000000206112520550710027401 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataRangeTermExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataRangeTermExpression::CDataRangeTermExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CInverseObjectPropertyOfExpression.cpp0000644000175000017500000000467412520550714031537 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CInverseObjectPropertyOfExpression.h" namespace Konclude { namespace Parser { namespace Expression { CInverseObjectPropertyOfExpression::CInverseObjectPropertyOfExpression(CObjectPropertyTermExpression *expression) : CObjectPropertyTermExpressionAssociator(expression) { } CInverseObjectPropertyOfExpression::~CInverseObjectPropertyOfExpression() { } CObjectPropertyTermExpression *CInverseObjectPropertyOfExpression::getInverseOfExpression() { return getObjectPropertyTermExpression(); } CBuildExpression::ExpressionType CInverseObjectPropertyOfExpression::getType() { return BETINVERSEOBJECTPROPERTYOF; } cint64 CInverseObjectPropertyOfExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CInverseObjectPropertyOfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CInverseObjectPropertyOfExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CInverseObjectPropertyOfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetObjectPropertyTargetsExpression.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetObjectPropertyTargetsExpression.cp0000644000175000017500000000534212520550726032552 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetObjectPropertyTargetsExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetObjectPropertyTargetsExpression::CQueryGetObjectPropertyTargetsExpression(const QString& name, CObjectPropertyTermExpression* objPropTermExp, CIndividualTermExpression* indiTermExp) : CNameAssociator(name),CObjectPropertyTermExpressionAssociator(objPropTermExp),CIndividualTermExpressionAssociator(indiTermExp) { } CQueryGetObjectPropertyTargetsExpression::~CQueryGetObjectPropertyTargetsExpression() { } CBuildExpression::ExpressionType CQueryGetObjectPropertyTargetsExpression::getType() { return BETGETOBJECTPROPERTYTARGETS; } cint64 CQueryGetObjectPropertyTargetsExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue(),CIndividualTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CQueryGetObjectPropertyTargetsExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryGetObjectPropertyTargetsExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryGetObjectPropertyTargetsExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyTermExpression.h0000644000175000017500000000352212520550722030201 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYTERMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYTERMEXPRESSION_H // Libraries includes #include // Namespace includes #include "CPropertyTermExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectPropertyTermExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectPropertyTermExpression : public CPropertyTermExpression { // public methods public: //! Constructor CObjectPropertyTermExpression(); //! Destructor virtual ~CObjectPropertyTermExpression(); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYTERMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRulePropertyAtomTermExpression.cpp0000644000175000017500000000525312520550732031062 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRulePropertyAtomTermExpression.h" namespace Konclude { namespace Parser { namespace Expression { CRulePropertyAtomTermExpression::CRulePropertyAtomTermExpression(CObjectIndividualVariableExpression* expression1, CObjectIndividualVariableExpression* expression2, CObjectPropertyTermExpression* objectPropExp) : CListClassVariableTermExpressionAssociator(expression1,expression2), CObjectPropertyTermExpressionAssociator(objectPropExp) { } CRulePropertyAtomTermExpression::~CRulePropertyAtomTermExpression() { } CBuildExpression::ExpressionType CRulePropertyAtomTermExpression::getType() { return BETRULEPROPERTYATOM; } cint64 CRulePropertyAtomTermExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListClassVariableTermExpressionAssociator::getStructuralHashValue(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CRulePropertyAtomTermExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CRulePropertyAtomTermExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListClassVariableTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CRulePropertyAtomTermExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListClassVariableTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataRangeTermExpression.h0000644000175000017500000000332712520550710027054 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATARANGETERMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATARANGETERMEXPRESSION_H // Libraries includes // Namespace includes #include "ExpressionSettings.h" #include "CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDataRangeTermExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataRangeTermExpression : public CBuildExpression { // public methods public: //! Constructor CDataRangeTermExpression(); // protected methods protected: // private methods private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATARANGETERMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataOneOfExpression.h0000644000175000017500000000460012520550706026176 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAONEOFEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAONEOFEXPRESSION_H // Libraries includes #include // Namespace includes #include "CNameAssociator.h" #include "CBuildExpression.h" #include "CDataRangeTermExpression.h" #include "CListDataRangeTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDataOneOfExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataOneOfExpression : public CDataRangeTermExpression, public CListDataRangeTermExpressionAssociator { // public methods public: //! Constructor CDataOneOfExpression(CDataRangeTermExpression* expression1 = nullptr, CDataRangeTermExpression* expression2 = nullptr); CDataOneOfExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CDataOneOfExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAONEOFEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CPairExpressionAssociator.h0000644000175000017500000000477112520550724027332 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CPAIREXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CPAIREXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CBuildExpression.h" #include "CListExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CPairExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CPairExpressionAssociator { // public methods public: //! Constructor CPairExpressionAssociator(CBuildExpression* expression1, CBuildExpression* expression2); CPairExpressionAssociator* setFirstExpression(CBuildExpression* expression1); CPairExpressionAssociator* setSecondExpression(CBuildExpression* expression2); CBuildExpression* getFirstExpression() const; CBuildExpression* getSecondExpression() const; virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(const CPairExpressionAssociator& pairExpressionAssociator); virtual bool visitSubExpressions(CBuildExpression* expression, CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // protected variables protected: CBuildExpression* mFirstExpression; CBuildExpression* mSecondExpression; // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CPAIREXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDisjointObjectPropertiesExpression.h0000644000175000017500000000474212520550712031371 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDISJOINTOBJECTPROPERTIESEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDISJOINTOBJECTPROPERTIESEXPRESSION_H // Libraries includes // Namespace includes #include "CObjectPropertyAxiomExpression.h" #include "CListObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDisjointObjectPropertiesExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDisjointObjectPropertiesExpression : public CObjectPropertyAxiomExpression, public CListObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CDisjointObjectPropertiesExpression(CObjectPropertyTermExpression *expression1, CObjectPropertyTermExpression *expression2, CObjectPropertyTermExpression *expression3 = nullptr); CDisjointObjectPropertiesExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CDisjointObjectPropertiesExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDISJOINTOBJECTPROPERTIESEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDifferentIndividualsExpression.h0000644000175000017500000000461412520550712030502 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDIFFERENTINDIVIDUALEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDIFFERENTINDIVIDUALEXPRESSION_H // Libraries includes #include // Namespace includes #include "CAssertionAxiomExpression.h" #include "CListIndividualTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDifferentIndividualsExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDifferentIndividualsExpression : public CAssertionAxiomExpression, public CListIndividualTermExpressionAssociator { // public methods public: //! Constructor CDifferentIndividualsExpression(CIndividualTermExpression *expression1 = 0, CIndividualTermExpression *expression2 = 0); CDifferentIndividualsExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CDifferentIndividualsExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDIFFERENTINDIVIDUALEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyAxiomExpression.cpp0000644000175000017500000000222012520550722030674 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectPropertyAxiomExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectPropertyAxiomExpression::CObjectPropertyAxiomExpression() { } CObjectPropertyAxiomExpression::~CObjectPropertyAxiomExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataMaxCardinalityExpression.h0000644000175000017500000000422112520550706030100 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAMAXCARDINALITYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAMAXCARDINALITYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CDataPropertyTermExpression.h" #include "CDataCardinalityExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDataMaxCardinalityExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDataMaxCardinalityExpression : public CDataCardinalityExpression { // public methods public: //! Constructor CDataMaxCardinalityExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2, cint64 cardinality); //! Destructor virtual ~CDataMaxCardinalityExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAMAXCARDINALITYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataUnionOfExpression.cpp0000644000175000017500000000460012520550710027073 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataUnionOfExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataUnionOfExpression::CDataUnionOfExpression(CDataRangeTermExpression* expression1, CDataRangeTermExpression* expression2) : CListDataRangeTermExpressionAssociator(expression1,expression2) { } CDataUnionOfExpression::CDataUnionOfExpression(const CEXPRESSIONLIST& expressionList) : CListDataRangeTermExpressionAssociator(expressionList) { } CDataUnionOfExpression::~CDataUnionOfExpression() { } CBuildExpression::ExpressionType CDataUnionOfExpression::getType() { return BETDATAUNIONOF; } cint64 CDataUnionOfExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListDataRangeTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDataUnionOfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataUnionOfExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListDataRangeTermExpressionAssociator::compareStructuralEquivalence(*compExpCast);; } bool CDataUnionOfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListDataRangeTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectUnionOfExpression.cpp0000644000175000017500000000457012520550722027441 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectUnionOfExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectUnionOfExpression::CObjectUnionOfExpression(CClassTermExpression *expression1, CClassTermExpression *expression2) : CListClassTermExpressionAssociator(expression1,expression2) { } CObjectUnionOfExpression::CObjectUnionOfExpression(const CEXPRESSIONLIST& expressionList) : CListClassTermExpressionAssociator(expressionList) { } CObjectUnionOfExpression::~CObjectUnionOfExpression() { } CBuildExpression::ExpressionType CObjectUnionOfExpression::getType() { return BETOBJECTUNION; } cint64 CObjectUnionOfExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CObjectUnionOfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectUnionOfExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CObjectUnionOfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CClassExpressionAssociator.h0000644000175000017500000000416412520550704027476 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CCLASSEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CCLASSEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CClassExpression.h" #include "CExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CClassExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassExpressionAssociator : public CExpressionAssociator { // public methods public: //! Constructor CClassExpressionAssociator(CClassExpression* expression = nullptr); //! Destructor virtual ~CClassExpressionAssociator(); CClassExpression* getClassExpression(); virtual bool compareStructuralEquivalence(const CClassExpressionAssociator& classExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CCLASSEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataPropertyAxiomExpression.cpp0000644000175000017500000000220612520550710030340 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataPropertyAxiomExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataPropertyAxiomExpression::CDataPropertyAxiomExpression() { } CDataPropertyAxiomExpression::~CDataPropertyAxiomExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataCardinalityExpression.h0000644000175000017500000000442612520550704027437 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATACARDINALITYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATACARDINALITYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CDataPropertyTermExpression.h" #include "CDataPropertyTermExpressionAssociator.h" #include "CDataRangeTermExpressionAssociator.h" #include "CCardinalityAssociator.h" #include "CClassTermExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDataCardinalityExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDataCardinalityExpression : public CClassTermExpression, public CDataPropertyTermExpressionAssociator, public CDataRangeTermExpressionAssociator, public CCardinalityAssociator { // public methods public: //! Constructor CDataCardinalityExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2, cint64 cardinality); //! Destructor virtual ~CDataCardinalityExpression(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATACARDINALITYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryExpression.cpp0000644000175000017500000000211312520550724026033 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryExpression::CQueryExpression() { } CQueryExpression::~CQueryExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CAxiomExpression.cpp0000644000175000017500000000203112520550704026000 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAxiomExpression.h" namespace Konclude { namespace Parser { namespace Expression { CAxiomExpression::CAxiomExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CClassAxiomExpression.cpp0000644000175000017500000000214312520550704026772 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassAxiomExpression.h" namespace Konclude { namespace Parser { namespace Expression { CClassAxiomExpression::CClassAxiomExpression() { } CClassAxiomExpression::~CClassAxiomExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetDeterministicIndividualsExpression.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetDeterministicIndividualsExpression0000644000175000017500000000522612520550726032644 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetDeterministicIndividualsExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetDeterministicIndividualsExpression::CQueryGetDeterministicIndividualsExpression(const QString& name) : CNameAssociator(name),CListIndividualTermExpressionAssociator() { } CQueryGetDeterministicIndividualsExpression::CQueryGetDeterministicIndividualsExpression(const QString& name, const CEXPRESSIONLIST& expressionList) : CNameAssociator(name),CListIndividualTermExpressionAssociator(expressionList) { } CQueryGetDeterministicIndividualsExpression::~CQueryGetDeterministicIndividualsExpression() { } CBuildExpression::ExpressionType CQueryGetDeterministicIndividualsExpression::getType() { return BETGETDETERMINISTICINDIVIDUALS; } cint64 CQueryGetDeterministicIndividualsExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListIndividualTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CQueryGetDeterministicIndividualsExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryGetDeterministicIndividualsExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryGetDeterministicIndividualsExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataComplementOfExpression.cpp0000644000175000017500000000427512520550704030121 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataComplementOfExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataComplementOfExpression::CDataComplementOfExpression(CDataRangeTermExpression* expression) : CDataRangeTermExpressionAssociator(expression) { } CDataComplementOfExpression::~CDataComplementOfExpression() { } CBuildExpression::ExpressionType CDataComplementOfExpression::getType() { return BETDATACOMPLEMENTOF; } cint64 CDataComplementOfExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDataRangeTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDataComplementOfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataComplementOfExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDataRangeTermExpressionAssociator::compareStructuralEquivalence(*compExpCast);; } bool CDataComplementOfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CDataRangeTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataLexicalValueExpression.h0000644000175000017500000000427312520550706027554 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATALEXICALVALUEEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATALEXICALVALUEEXPRESSION_H // Libraries includes #include // Namespace includes #include "CNameAssociator.h" #include "CBuildExpression.h" #include "CExpressionEntity.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDataLexicalValueExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLexicalValueExpression : public CBuildExpression, public CExpressionEntity { // public methods public: //! Constructor CDataLexicalValueExpression(const QString& lexicalDataValue); //! Destructor virtual ~CDataLexicalValueExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATALEXICALVALUEEXPRESSION_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedListObjectPropertyTermExpressionAssociator.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedListObjectPropertyTermExpressionAss0000644000175000017500000000722712520550722032571 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COrderedListObjectPropertyTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { COrderedListObjectPropertyTermExpressionAssociator::COrderedListObjectPropertyTermExpressionAssociator(CObjectPropertyTermExpression *expression1, CObjectPropertyTermExpression *expression2, CObjectPropertyTermExpression *expression3) : CListExpressionAssociator(expression1,expression2,expression3) { } COrderedListObjectPropertyTermExpressionAssociator::COrderedListObjectPropertyTermExpressionAssociator(const CEXPRESSIONLIST& expressionList) : CListExpressionAssociator(*(CEXPRESSIONLIST*)&expressionList) { } COrderedListObjectPropertyTermExpressionAssociator::~COrderedListObjectPropertyTermExpressionAssociator() { } CEXPRESSIONLIST* COrderedListObjectPropertyTermExpressionAssociator::getOrderedObjectPropertyTermExpressionList() { // bad cast to avoid lot of reimplementation return (CEXPRESSIONLIST*)&mExpressionList; } cint64 COrderedListObjectPropertyTermExpressionAssociator::getStructuralHashValue() { cint64 hashValue = 0; FOREACHIT (CBuildExpression* expression, mExpressionList) { hashValue += CExpressionHashMixer::getHashValueMixed(hashValue,cint64(expression)); } return hashValue; } bool COrderedListObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(const CListExpressionAssociator& listExpressionAssociator) { const CEXPRESSIONLIST* otherListExp = listExpressionAssociator.getConstExpressionList(); if (mExpressionList.count() != otherListExp->count()) { return false; } for (CEXPRESSIONLIST::const_iterator it1 = mExpressionList.constBegin(), it1End = mExpressionList.constEnd(), it2 = otherListExp->constBegin(), it2End = otherListExp->constEnd(); it1 != it1End && it2 != it2End; ++it1,++it2) { if (*it1 != *it2) { return false; } } return true; } bool COrderedListObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(const COrderedListObjectPropertyTermExpressionAssociator& orderedListExpressionAssociator) { const CEXPRESSIONLIST* otherListExp = orderedListExpressionAssociator.getConstExpressionList(); if (mExpressionList.count() != otherListExp->count()) { return false; } for (CEXPRESSIONLIST::const_iterator it1 = mExpressionList.constBegin(), it1End = mExpressionList.constEnd(), it2 = otherListExp->constBegin(), it2End = otherListExp->constEnd(); it1 != it1End && it2 != it2End; ++it1,++it2) { if (*it1 != *it2) { return false; } } return true; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CEntityAssociator.cpp0000644000175000017500000000310212520550712026146 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEntityAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CEntityAssociator::CEntityAssociator(CExpressionEntity* entity) { mEntity = entity; } CEntityAssociator::~CEntityAssociator() { } CExpressionEntity* CEntityAssociator::getEntity() { return mEntity; } CEntityAssociator* CEntityAssociator::setEntity(CExpressionEntity* entity) { mEntity = entity; return this; } cint64 CEntityAssociator::getStructuralHashValue() { return (cint64)mEntity; } bool CEntityAssociator::compareStructuralEquivalence(const CEntityAssociator& entityAssociator) { return entityAssociator.mEntity == mEntity; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CTransetiveObjectPropertyExpression.cpp0000644000175000017500000000472412520550732031757 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTransetiveObjectPropertyExpression.h" namespace Konclude { namespace Parser { namespace Expression { CTransetiveObjectPropertyExpression::CTransetiveObjectPropertyExpression(CObjectPropertyTermExpression *expression) : CObjectPropertyTermExpressionAssociator(expression) { } CTransetiveObjectPropertyExpression::~CTransetiveObjectPropertyExpression() { } CBuildExpression::ExpressionType CTransetiveObjectPropertyExpression::getType() { return BETTRANSITIVEOBJECTPROPERTY; } CObjectPropertyTermExpression *CTransetiveObjectPropertyExpression::getTransetivePropertyExpression() { return getObjectPropertyTermExpression(); } cint64 CTransetiveObjectPropertyExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CTransetiveObjectPropertyExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CTransetiveObjectPropertyExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CTransetiveObjectPropertyExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/ExpressionSettings.h0000644000175000017500000000272412520550732026077 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_EXPRESSION_EXPRESSIONSETTINGS #define KONCLUDE_EXPRESSION_EXPRESSIONSETTINGS // Libraries includes // Namespace includes // Other includes #include "Parser/ParserSettings.h" // Logger includes namespace Konclude { namespace Parser { namespace Expression { /*! * * \file ParserSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations class CBuildExpression; class CExpressionEntity; class CSubExpressionVisitor; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // end KONCLUDE_EXPRESSION_EXPRESSIONSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataExactCardinalityExpression.h0000644000175000017500000000423712520550704030424 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAEXACTCARDINALITYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAEXACTCARDINALITYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CDataPropertyTermExpression.h" #include "CDataCardinalityExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDataExactCardinalityExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDataExactCardinalityExpression : public CDataCardinalityExpression { // public methods public: //! Constructor CDataExactCardinalityExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2, cint64 cardinality); //! Destructor virtual ~CDataExactCardinalityExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAEXACTCARDINALITYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CClassExpression.cpp0000644000175000017500000000360212520550704025775 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassExpression.h" namespace Konclude { namespace Parser { namespace Expression { CClassExpression::CClassExpression(const QString& className) : CExpressionEntity(className) { } CClassExpression::~CClassExpression() { } CBuildExpression::ExpressionType CClassExpression::getType() { return BETCLASS; } cint64 CClassExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType()); return hashValue; } bool CClassExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CClassExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return true; } bool CClassExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { subExpressionVisitor->visitEntity(this,this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedListObjectPropertyTermExpressionAssociator.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedListObjectPropertyTermExpressionAss0000644000175000017500000000546612520550722032574 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CORDEREDLISTOBJECTPROPERTYTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CORDEREDLISTOBJECTPROPERTYTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CObjectPropertyTermExpression.h" #include "CListExpressionAssociator.h" #include "CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class COrderedListObjectPropertyTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COrderedListObjectPropertyTermExpressionAssociator : public CListExpressionAssociator { // public methods public: //! Constructor COrderedListObjectPropertyTermExpressionAssociator(CObjectPropertyTermExpression* expression1 = nullptr, CObjectPropertyTermExpression* expression2 = nullptr, CObjectPropertyTermExpression* expression3 = nullptr); COrderedListObjectPropertyTermExpressionAssociator(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~COrderedListObjectPropertyTermExpressionAssociator(); CEXPRESSIONLIST* getOrderedObjectPropertyTermExpressionList(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(const CListExpressionAssociator& listExpressionAssociator); virtual bool compareStructuralEquivalence(const COrderedListObjectPropertyTermExpressionAssociator& orderedListExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CORDEREDLISTOBJECTPROPERTYTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CNamedIndividualExpression.h0000644000175000017500000000430412520550716027435 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CNAMEDINDIVIDUALEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CNAMEDINDIVIDUALEXPRESSION_H // Libraries includes #include // Namespace includes #include "CIndividualTermExpression.h" #include "CExpressionEntity.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CNamedIndividualExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CNamedIndividualExpression : public CIndividualTermExpression, public CExpressionEntity { // public methods public: //! Constructor CNamedIndividualExpression(const QString& namedIndividual); //! Destructor virtual ~CNamedIndividualExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CNAMEDINDIVIDUALEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CTransetiveObjectPropertyExpression.h0000644000175000017500000000461412520550732031422 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CTRANSETIVEOBJECTPROPERTYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CTRANSETIVEOBJECTPROPERTYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyAxiomExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CTransetiveObjectPropertyExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CTransetiveObjectPropertyExpression : public CObjectPropertyAxiomExpression, public CObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CTransetiveObjectPropertyExpression(CObjectPropertyTermExpression *expression); //! Destructor virtual ~CTransetiveObjectPropertyExpression(); CObjectPropertyTermExpression *getTransetivePropertyExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CTRANSETIVEOBJECTPROPERTYEXPRESSION_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CInverseFunctionalObjectPropertyExpression.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CInverseFunctionalObjectPropertyExpression.0000644000175000017500000000473212520550714032565 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CINVERSEFUNCTIONALOBJECTPROPERTYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CINVERSEFUNCTIONALOBJECTPROPERTYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyAxiomExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CInverseFunctionalObjectPropertyExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CInverseFunctionalObjectPropertyExpression : public CObjectPropertyAxiomExpression, public CObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CInverseFunctionalObjectPropertyExpression(CObjectPropertyTermExpression *expression); //! Destructor virtual ~CInverseFunctionalObjectPropertyExpression(); CObjectPropertyTermExpression *getInverseFunctionalObjectPropertyExpression(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual ExpressionType getType(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CINVERSEFUNCTIONALOBJECTPROPERTYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CSubExpressionVisitor.cpp0000644000175000017500000000205012520550732027036 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSubExpressionVisitor.h" namespace Konclude { namespace Parser { namespace Expression { CSubExpressionVisitor::CSubExpressionVisitor() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CClassTermExpression.cpp0000644000175000017500000000204512520550704026625 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassTermExpression.h" namespace Konclude { namespace Parser { namespace Expression { CClassTermExpression::CClassTermExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataLiteralExpressionAssociator.h0000644000175000017500000000427612520550706030625 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATALITERALEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CDATALITERALEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CDataLiteralExpression.h" #include "CExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDataLiteralExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLiteralExpressionAssociator : public CExpressionAssociator { // public methods public: //! Constructor CDataLiteralExpressionAssociator(CDataLiteralExpression* expression = nullptr); //! Destructor virtual ~CDataLiteralExpressionAssociator(); CDataLiteralExpression* getDataLiteralExpression(); virtual bool compareStructuralEquivalence(const CDataLiteralExpressionAssociator& datatypeExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATALITERALEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListDataRangeTermExpressionAssociator.cpp0000644000175000017500000000415312520550716032277 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CListDataRangeTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CListDataRangeTermExpressionAssociator::CListDataRangeTermExpressionAssociator(CDataRangeTermExpression *expression1, CDataRangeTermExpression *expression2, CDataRangeTermExpression *expression3) : CListExpressionAssociator(expression1,expression2,expression3) { } CListDataRangeTermExpressionAssociator::CListDataRangeTermExpressionAssociator(const CEXPRESSIONLIST& expressionList) : CListExpressionAssociator(*(CEXPRESSIONLIST*)&expressionList) { } CListDataRangeTermExpressionAssociator::~CListDataRangeTermExpressionAssociator() { } CEXPRESSIONLIST* CListDataRangeTermExpressionAssociator::getDataRangeTermExpressionList() { // bad cast to avoid lot of reimplementation return (CEXPRESSIONLIST*)&mExpressionList; } bool CListDataRangeTermExpressionAssociator::compareStructuralEquivalence(const CListDataRangeTermExpressionAssociator& listClassTermExpressionAssociator) { return CListExpressionAssociator::compareStructuralEquivalence(listClassTermExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetFlattenedObjectPropertyTargetsExpression.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetFlattenedObjectPropertyTargetsExpr0000644000175000017500000000511212520550726032552 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYGETFLATTENEDOBJECTPROPERTYTARGETSEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYGETFLATTENEDOBJECTPROPERTYTARGETSEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" #include "CIndividualTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetFlattenedObjectPropertyTargetsExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetFlattenedObjectPropertyTargetsExpression : public CQueryExpression, public CObjectPropertyTermExpressionAssociator, public CIndividualTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryGetFlattenedObjectPropertyTargetsExpression(const QString& name, CObjectPropertyTermExpression* objPropTermExp, CIndividualTermExpression* indiTermExp); //! Destructor virtual ~CQueryGetFlattenedObjectPropertyTargetsExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYGETFLATTENEDOBJECTPROPERTYTARGETSEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataFacetRestrictionExpression.h0000644000175000017500000000467012520550706030447 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAFACETRESTRICTIONEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAFACETRESTRICTIONEXPRESSION_H // Libraries includes #include // Namespace includes #include "CDataRangeTermExpression.h" #include "CDataLiteralExpression.h" #include "CDatatypeExpression.h" #include "CDataLiteralExpressionAssociator.h" #include "CDataFacetExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDataFacetRestrictionExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDataFacetRestrictionExpression : public CBuildExpression, public CDataLiteralExpressionAssociator, public CDataFacetExpressionAssociator { // public methods public: //! Constructor CDataFacetRestrictionExpression(CDataLiteralExpression* dataLiteralExpression = nullptr, CDataFacetExpression* dataFacetExpression = nullptr); //! Destructor virtual ~CDataFacetRestrictionExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDataFacetRestrictionExpression_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CExpressionEntity.cpp0000644000175000017500000000244012520550712026202 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExpressionEntity.h" namespace Konclude { namespace Parser { namespace Expression { CExpressionEntity::CExpressionEntity(const QString& className) : CNameAssociator(className) { mEntityID = 0; } CExpressionEntity* CExpressionEntity::setEntityID(cint64 id) { mEntityID = id; return this; } cint64 CExpressionEntity::getEntityID() { return mEntityID; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataLiteralExpressionAssociator.cpp0000644000175000017500000000324212520550706031150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CDataLiteralExpressionAssociator::CDataLiteralExpressionAssociator(CDataLiteralExpression *expression) : CExpressionAssociator(expression) { } CDataLiteralExpressionAssociator::~CDataLiteralExpressionAssociator() { } CDataLiteralExpression* CDataLiteralExpressionAssociator::getDataLiteralExpression() { // bad cast to avoid lot of reimplementation return (CDataLiteralExpression*)getExpression(); } bool CDataLiteralExpressionAssociator::compareStructuralEquivalence(const CDataLiteralExpressionAssociator& datatypeExpressionAssociator) { return CExpressionAssociator::compareStructuralEquivalence(datatypeExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryAreClassesEquivalentExpression.h0000644000175000017500000000517212520550724031514 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYARECLASSESEQUIVALENTEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYARECLASSESEQUIVALENTEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CListClassTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryAreClassesEquivalentExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryAreClassesEquivalentExpression : public CQueryExpression, public CListClassTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryAreClassesEquivalentExpression(const QString& name, const CEXPRESSIONLIST& classTermExpList); //! Destructor virtual ~CQueryAreClassesEquivalentExpression(); virtual CEXPRESSIONLIST* getConstructedTestClasses(); virtual CQueryAreClassesEquivalentExpression *addConstructedTestClass(CClassTermExpression *conBuildExp); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: CEXPRESSIONLIST mConstructedClassExpList; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYARECLASSESEQUIVALENTEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataComplementOfExpression.h0000644000175000017500000000443212520550704027561 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATACOMPLEMENTOFEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATACOMPLEMENTOFEXPRESSION_H // Libraries includes #include // Namespace includes #include "CNameAssociator.h" #include "CBuildExpression.h" #include "CDataRangeTermExpression.h" #include "CDataRangeTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDataComplementOfExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataComplementOfExpression : public CDataRangeTermExpression, public CDataRangeTermExpressionAssociator { // public methods public: //! Constructor CDataComplementOfExpression(CDataRangeTermExpression* expression = nullptr); //! Destructor virtual ~CDataComplementOfExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATACOMPLEMENTOFEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CExpressionAssociator.cpp0000644000175000017500000000427012520550712027040 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CExpressionAssociator::CExpressionAssociator(CBuildExpression *expression) : mExpression(expression) { } CExpressionAssociator* CExpressionAssociator::setExpression(CBuildExpression *expression) { mExpression = expression; return this; } CBuildExpression *CExpressionAssociator::getExpression() { return mExpression; } cint64 CExpressionAssociator::getStructuralHashValue() { cint64 hashValue = 0; cint64 tmpValue1 = 0; cint64 tmpValue2 = 1; if (mExpression) { tmpValue1 += cint64(mExpression); tmpValue2 *= cint64(mExpression); } hashValue = tmpValue1*tmpValue2; return hashValue; } bool CExpressionAssociator::visitSubExpressions(CBuildExpression* expression, CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { if (mExpression) { subExpressionVisitor->visitSubExpression(expression,mExpression,subExpressionVisitor); return true; } } return false; } bool CExpressionAssociator::compareStructuralEquivalence(const CExpressionAssociator& expressionAssociator) { if (mExpression != expressionAssociator.mExpression) { return false; } return true; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectIndividualVariableExpression.cpp0000644000175000017500000000454512520550720031622 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectIndividualVariableExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectIndividualVariableExpression::CObjectIndividualVariableExpression(const QString& variableName, cint64 axiomNumber) : CExpressionEntity(variableName),mAxiomNumber(axiomNumber) { } CObjectIndividualVariableExpression::~CObjectIndividualVariableExpression() { } CBuildExpression::ExpressionType CObjectIndividualVariableExpression::getType() { return BETINDIVIDUALVARIABLE; } cint64 CObjectIndividualVariableExpression::getAxiomNumber() { return mAxiomNumber; } cint64 CObjectIndividualVariableExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),mAxiomNumber); return hashValue; } bool CObjectIndividualVariableExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectIndividualVariableExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } else { if (mAxiomNumber != compExpCast->getAxiomNumber()) { return false; } } return true; } bool CObjectIndividualVariableExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { subExpressionVisitor->visitEntity(this,this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataPropertyTermExpressionAssociator.cpp0000644000175000017500000000333412520550710032225 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataPropertyTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CDataPropertyTermExpressionAssociator::CDataPropertyTermExpressionAssociator(CDataPropertyTermExpression *expression) : CExpressionAssociator(expression) { } CDataPropertyTermExpressionAssociator::~CDataPropertyTermExpressionAssociator() { } CDataPropertyTermExpression* CDataPropertyTermExpressionAssociator::getDataPropertyTermExpression() { // bad cast to avoid lot of reimplementation return (CDataPropertyTermExpression*)getExpression(); } bool CDataPropertyTermExpressionAssociator::compareStructuralEquivalence(const CDataPropertyTermExpressionAssociator& dataTermExpressionAssociator) { return CExpressionAssociator::compareStructuralEquivalence(dataTermExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CReflexiveObjectPropertyExpression.cpp0000644000175000017500000000470512520550730031561 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CReflexiveObjectPropertyExpression.h" namespace Konclude { namespace Parser { namespace Expression { CReflexiveObjectPropertyExpression::CReflexiveObjectPropertyExpression(CObjectPropertyTermExpression *expression) : CObjectPropertyTermExpressionAssociator(expression) { } CReflexiveObjectPropertyExpression::~CReflexiveObjectPropertyExpression() { } CBuildExpression::ExpressionType CReflexiveObjectPropertyExpression::getType() { return BETREFLEXIVEPROPERTY; } CObjectPropertyTermExpression *CReflexiveObjectPropertyExpression::getReflexiveObjectPropertyExpression() { return getObjectPropertyTermExpression(); } cint64 CReflexiveObjectPropertyExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CReflexiveObjectPropertyExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CReflexiveObjectPropertyExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CReflexiveObjectPropertyExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataPropertyExpression.cpp0000644000175000017500000000373712520550710027354 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataPropertyExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataPropertyExpression::CDataPropertyExpression(const QString& probertyName) : CExpressionEntity(probertyName) { } CDataPropertyExpression::~CDataPropertyExpression() { } cint64 CDataPropertyExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType()); return hashValue; } bool CDataPropertyExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataPropertyExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return true; } CBuildExpression::ExpressionType CDataPropertyExpression::getType() { return BETDATAPROPERTY; } bool CDataPropertyExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { subExpressionVisitor->visitEntity(this,this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyRangeExpression.h0000644000175000017500000000455712520550722030337 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYRANGEEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYRANGEEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyAxiomExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" #include "CClassTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectPropertyRangeExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectPropertyRangeExpression : public CObjectPropertyAxiomExpression, public CObjectPropertyTermExpressionAssociator, public CClassTermExpressionAssociator { // public methods public: //! Constructor CObjectPropertyRangeExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2); //! Destructor virtual ~CObjectPropertyRangeExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYRANGEEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectComplementOfExpression.cpp0000644000175000017500000000447512520550720030456 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectComplementOfExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectComplementOfExpression::CObjectComplementOfExpression(CClassTermExpression *expression) : CClassTermExpressionAssociator(expression) { } CObjectComplementOfExpression::~CObjectComplementOfExpression() { } CClassTermExpression *CObjectComplementOfExpression::getComplementExpression() { return getClassTermExpression(); } CBuildExpression::ExpressionType CObjectComplementOfExpression::getType() { return BETOBJECTCOMPLEMENTOF; } cint64 CObjectComplementOfExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CObjectComplementOfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectComplementOfExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CObjectComplementOfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CIndividualTermExpression.h0000644000175000017500000000350012520550714027313 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CINDIVIDUALTERMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CINDIVIDUALTERMEXPRESSION_H // Libraries includes // Namespace includes #include "CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CIndividualTermExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CIndividualTermExpression : public CBuildExpression { // public methods public: //! Constructor CIndividualTermExpression(); //! Destructor virtual ~CIndividualTermExpression(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CINDIVIDUALTERMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryIsEntailedExpression.h0000644000175000017500000000526212520550730027447 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYISENTAILEDEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYISENTAILEDEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CListAxiomExpressionAssociator.h" #include "CNameAssociator.h" #include "CAxiomExpression.h" #include "CEntailmentAxiomExpressionAssociation.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryIsEntailedExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryIsEntailedExpression : public CQueryExpression, public CListAxiomExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryIsEntailedExpression(const QString& name, const CEXPRESSIONLIST& axiomExpList); //! Destructor virtual ~CQueryIsEntailedExpression(); virtual CEXPRESSIONLIST* getConstructedTestAxiomExpressions(); virtual CQueryIsEntailedExpression* addConstructedTestAxiomExpressions(CEntailmentAxiomExpressionAssociation *conBuildExp); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: CEXPRESSIONLIST mConstructedAxiomExpList; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYISENTAILEDEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CUnorderedPairExpressionAssociator.cpp0000644000175000017500000000243312520550732031525 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CUnorderedPairExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CUnorderedPairExpressionAssociator::CUnorderedPairExpressionAssociator(CBuildExpression *expression1, CBuildExpression *expression2) : CPairExpressionAssociator(expression1,expression2) { } CUnorderedPairExpressionAssociator::~CUnorderedPairExpressionAssociator() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListObjectPropertyTermExpressionAssociator.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListObjectPropertyTermExpressionAssociator0000644000175000017500000000472312520550716032646 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CLISTOBJECTPROPERTYTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CLISTOBJECTPROPERTYTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CObjectPropertyTermExpression.h" #include "CListExpressionAssociator.h" #include "CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CListObjectPropertyTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CListObjectPropertyTermExpressionAssociator : public CListExpressionAssociator { // public methods public: //! Constructor CListObjectPropertyTermExpressionAssociator(CObjectPropertyTermExpression* expression1 = nullptr, CObjectPropertyTermExpression* expression2 = nullptr, CObjectPropertyTermExpression* expression3 = nullptr); CListObjectPropertyTermExpressionAssociator(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CListObjectPropertyTermExpressionAssociator(); CEXPRESSIONLIST* getObjectPropertyTermExpressionList(); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CLISTOBJECTPROPERTYTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListDataPropertyTermExpressionAssociator.h0000644000175000017500000000466512520550716032544 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CLISTDATAPROPERTYTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CLISTDATAPROPERTYTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CDataPropertyTermExpression.h" #include "CListExpressionAssociator.h" #include "CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CListDataPropertyTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CListDataPropertyTermExpressionAssociator : public CListExpressionAssociator { // public methods public: //! Constructor CListDataPropertyTermExpressionAssociator(CDataPropertyTermExpression* expression1 = nullptr, CDataPropertyTermExpression* expression2 = nullptr, CDataPropertyTermExpression* expression3 = nullptr); CListDataPropertyTermExpressionAssociator(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CListDataPropertyTermExpressionAssociator(); CEXPRESSIONLIST* getDataPropertyTermExpressionList(); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CLISTDATAPROPERTYTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDisjointObjectPropertiesExpression.cpp0000644000175000017500000000522412520550712031720 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDisjointObjectPropertiesExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDisjointObjectPropertiesExpression::CDisjointObjectPropertiesExpression(CObjectPropertyTermExpression *expression1, CObjectPropertyTermExpression *expression2, CObjectPropertyTermExpression *expression3) : CListObjectPropertyTermExpressionAssociator(expression1,expression2,expression3) { } CDisjointObjectPropertiesExpression::CDisjointObjectPropertiesExpression(const CEXPRESSIONLIST& expressionList) : CListObjectPropertyTermExpressionAssociator(expressionList) { } CDisjointObjectPropertiesExpression::~CDisjointObjectPropertiesExpression() { } cint64 CDisjointObjectPropertiesExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDisjointObjectPropertiesExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDisjointObjectPropertiesExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } CBuildExpression::ExpressionType CDisjointObjectPropertiesExpression::getType() { return BETDISJOINTOBJECTPROPERTIES; } bool CDisjointObjectPropertiesExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetNondeterministicIndividualsExpression.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetNondeterministicIndividualsExpress0000644000175000017500000000501612520550726032646 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYGETNONDETERMINISTICINDIVIDUALSEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYGETNONDETERMINISTICINDIVIDUALSEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CListIndividualTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetNondeterministicIndividualsExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetNondeterministicIndividualsExpression : public CQueryExpression, public CListIndividualTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryGetNondeterministicIndividualsExpression(const QString& name); CQueryGetNondeterministicIndividualsExpression(const QString& name, const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CQueryGetNondeterministicIndividualsExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYGETNONDETERMINISTICINDIVIDUALSEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataFacetExpression.h0000644000175000017500000000420212520550706026210 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAFACETEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAFACETEXPRESSION_H // Libraries includes #include // Namespace includes #include "CNameAssociator.h" #include "CBuildExpression.h" #include "CExpressionEntity.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDataFacetExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataFacetExpression : public CBuildExpression, public CExpressionEntity { // public methods public: //! Constructor CDataFacetExpression(const QString& facetIRI); //! Destructor virtual ~CDataFacetExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAFACETEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CPrecedentBuildIndividualExpression.h0000644000175000017500000000427212520550724031305 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CPRECEDENTBUILDINDIVIDUALEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CPRECEDENTBUILDINDIVIDUALEXPRESSION_H // Libraries includes #include // Namespace includes #include "CNamedIndividualExpression.h" // Other includes #include "Reasoner/Ontology/CIndividual.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Ontology; namespace Parser { namespace Expression { /*! * \class CPrecedentBuildIndividualExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CPrecedentBuildIndividualExpression : public CNamedIndividualExpression { // public methods public: //! Constructor CPrecedentBuildIndividualExpression(QString individualName, CIndividual *precedentBuildIndividual); //! Destructor virtual ~CPrecedentBuildIndividualExpression(); virtual ExpressionType getType(); virtual CIndividual *getPrecedentBuildIndividual(); // protected methods protected: // protected variables protected: CIndividual *individual; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CPRECEDENTBUILDINDIVIDUALEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CIndividualExpression.h0000644000175000017500000000346612520550714026476 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CINDIVIDUALEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CINDIVIDUALEXPRESSION_H // Libraries includes // Namespace includes #include "CIndividualTermExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CIndividualExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CIndividualExpression : public CIndividualTermExpression { // public methods public: //! Constructor CIndividualExpression(); //! Destructor virtual ~CIndividualExpression(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CINDIVIDUALEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CPrecedentBuildClassExpression.cpp0000644000175000017500000000275612520550724030622 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecedentBuildClassExpression.h" namespace Konclude { namespace Parser { namespace Expression { CPrecedentBuildClassExpression::CPrecedentBuildClassExpression(QString className, CConcept *precedentBuildConcept) : CClassExpression(className) { concept = precedentBuildConcept; } CPrecedentBuildClassExpression::~CPrecedentBuildClassExpression() { } CBuildExpression::ExpressionType CPrecedentBuildClassExpression::getType() { return BETPRECEDENTCLASSBUILD; } CConcept *CPrecedentBuildClassExpression::getPrecedentBuildConcept() { return concept; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetClassAssertionsExpression.cpp0000644000175000017500000000474312520550724031547 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetClassAssertionsExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetClassAssertionsExpression::CQueryGetClassAssertionsExpression(const QString& name) : CNameAssociator(name),CListIndividualTermExpressionAssociator() { } CQueryGetClassAssertionsExpression::CQueryGetClassAssertionsExpression(const QString& name, const CEXPRESSIONLIST& expressionList) : CNameAssociator(name),CListIndividualTermExpressionAssociator(expressionList) { } CQueryGetClassAssertionsExpression::~CQueryGetClassAssertionsExpression() { } cint64 CQueryGetClassAssertionsExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListIndividualTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CQueryGetClassAssertionsExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryGetClassAssertionsExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } if (compExpCast->getType() != getType()) { return false; } return CListIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryGetClassAssertionsExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetSameIndividualsExpression.h0000644000175000017500000000451612520550726031155 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQueryGetSameIndividualsExpression_H #define KONCLUDE_PARSER_EXPRESSION_CQueryGetSameIndividualsExpression_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CIndividualTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetSameIndividualsExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetSameIndividualsExpression : public CQueryExpression, public CIndividualTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryGetSameIndividualsExpression(const QString& name, CIndividualTermExpression* indiTermExp); //! Destructor virtual ~CQueryGetSameIndividualsExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQueryGetSameIndividualsExpression_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CClassExpressionAssociator.cpp0000644000175000017500000000312312520550704030023 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CClassExpressionAssociator::CClassExpressionAssociator(CClassExpression *expression) : CExpressionAssociator(expression) { } CClassExpressionAssociator::~CClassExpressionAssociator() { } CClassExpression* CClassExpressionAssociator::getClassExpression() { // bad cast to avoid lot of reimplementation return (CClassExpression*)getExpression(); } bool CClassExpressionAssociator::compareStructuralEquivalence(const CClassExpressionAssociator& classExpressionAssociator) { return CExpressionAssociator::compareStructuralEquivalence(classExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairClassTermExpressionAssociator.h0000644000175000017500000000435712520550722032453 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIRCLASSTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIRCLASSTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CClassTermExpression.h" #include "COrderedPairExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class COrderedPairClassTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COrderedPairClassTermExpressionAssociator : public COrderedPairExpressionAssociator { // public methods public: //! Constructor COrderedPairClassTermExpressionAssociator(CClassTermExpression* expression1, CClassTermExpression* expression2); //! Destructor virtual ~COrderedPairClassTermExpressionAssociator(); CClassTermExpression* getFirstClassTermExpression(); CClassTermExpression* getSecondClassTermExpression(); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIRCLASSTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CEquivalentObjectPropertiesExpression.cpp0000644000175000017500000000525712520550712032260 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEquivalentObjectPropertiesExpression.h" namespace Konclude { namespace Parser { namespace Expression { CEquivalentObjectPropertiesExpression::CEquivalentObjectPropertiesExpression(CObjectPropertyTermExpression *expression1, CObjectPropertyTermExpression *expression2, CObjectPropertyTermExpression *expression3) : CListObjectPropertyTermExpressionAssociator(expression1,expression2,expression3) { } CEquivalentObjectPropertiesExpression::CEquivalentObjectPropertiesExpression(const CEXPRESSIONLIST& expressionList) : CListObjectPropertyTermExpressionAssociator(expressionList) { } CEquivalentObjectPropertiesExpression::~CEquivalentObjectPropertiesExpression() { } cint64 CEquivalentObjectPropertiesExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CEquivalentObjectPropertiesExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CEquivalentObjectPropertiesExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } CBuildExpression::ExpressionType CEquivalentObjectPropertiesExpression::getType() { return BETEQUIVALENTOBJECTPROPERTIES; } bool CEquivalentObjectPropertiesExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetEquivalentClassesExpression.h0000644000175000017500000000451512520550726031526 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYGETEQUIVALENTCLASSESEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYGETEQUIVALENTCLASSESEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CClassTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetEquivalentClassesExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetEquivalentClassesExpression : public CQueryExpression, public CClassTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryGetEquivalentClassesExpression(const QString& name, CClassTermExpression* classTermExp); //! Destructor virtual ~CQueryGetEquivalentClassesExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYGETEQUIVALENTCLASSESEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CSymmetricObjectPropertyExpression.cpp0000644000175000017500000000470512520550732031606 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSymmetricObjectPropertyExpression.h" namespace Konclude { namespace Parser { namespace Expression { CSymmetricObjectPropertyExpression::CSymmetricObjectPropertyExpression(CObjectPropertyTermExpression *expression) : CObjectPropertyTermExpressionAssociator(expression) { } CSymmetricObjectPropertyExpression::~CSymmetricObjectPropertyExpression() { } CBuildExpression::ExpressionType CSymmetricObjectPropertyExpression::getType() { return BETSYMMETRICPROPERTY; } CObjectPropertyTermExpression *CSymmetricObjectPropertyExpression::getSymmetricObjectPropertyExpression() { return getObjectPropertyTermExpression(); } cint64 CSymmetricObjectPropertyExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CSymmetricObjectPropertyExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CSymmetricObjectPropertyExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CSymmetricObjectPropertyExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListExpression.h0000644000175000017500000000352112520550716025313 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CLISTEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CLISTEXPRESSION_H // Libraries includes #include // Namespace includes #include "CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CListExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CListExpression : public QList { // public methods public: //! Constructor CListExpression(CBuildExpression *expression1 = 0, CBuildExpression *expression2 = 0, CBuildExpression *expression3 = 0); //! Destructor virtual ~CListExpression(); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CLISTEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDeclarationAxiomExpression.cpp0000644000175000017500000000412412520550712030152 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDeclarationAxiomExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDeclarationAxiomExpression::CDeclarationAxiomExpression(CExpressionEntity* entity) : CEntityAssociator(entity) { } CDeclarationAxiomExpression::~CDeclarationAxiomExpression() { } cint64 CDeclarationAxiomExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CEntityAssociator::getStructuralHashValue()); return hashValue; } bool CDeclarationAxiomExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDeclarationAxiomExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CEntityAssociator::compareStructuralEquivalence(*compExpCast); } CBuildExpression::ExpressionType CDeclarationAxiomExpression::getType() { return BETDECLARATION; } bool CDeclarationAxiomExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { subExpressionVisitor->visitEntity(this,mEntity,subExpressionVisitor); } return true; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataMinCardinalityExpression.h0000644000175000017500000000422112520550706030076 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAMINCARDINALITYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAMINCARDINALITYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CDataPropertyTermExpression.h" #include "CDataCardinalityExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDataMinCardinalityExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDataMinCardinalityExpression : public CDataCardinalityExpression { // public methods public: //! Constructor CDataMinCardinalityExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2, cint64 cardinality); //! Destructor virtual ~CDataMinCardinalityExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAMINCARDINALITYEXPRESSION_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairObjectPropertyTermExpressionAssociator.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairObjectPropertyTermExpressionAss0000644000175000017500000000455512520550724032554 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIROBJECTPROPERTYTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIROBJECTPROPERTYTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CObjectPropertyTermExpression.h" #include "COrderedPairExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class COrderedPairObjectPropertyTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COrderedPairObjectPropertyTermExpressionAssociator : public COrderedPairExpressionAssociator { // public methods public: //! Constructor COrderedPairObjectPropertyTermExpressionAssociator(CObjectPropertyTermExpression* expression1, CObjectPropertyTermExpression* expression2); //! Destructor virtual ~COrderedPairObjectPropertyTermExpressionAssociator(); CObjectPropertyTermExpression* getFirstObjectPropertyTermExpression(); CObjectPropertyTermExpression* getSecondObjectPropertyTermExpression(); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIROBJECTPROPERTYTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CExpressionAssociator.h0000644000175000017500000000435112520550712026505 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CBuildExpression.h" #include "CSubExpressionVisitor.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CExpressionAssociator { // public methods public: //! Constructor CExpressionAssociator(CBuildExpression* expression); CExpressionAssociator* setExpression(CBuildExpression* expression); CBuildExpression* getExpression(); virtual cint64 getStructuralHashValue(); virtual bool visitSubExpressions(CBuildExpression* expression, CSubExpressionVisitor* subExpressionVisitor); virtual bool compareStructuralEquivalence(const CExpressionAssociator& expressionAssociator); // protected methods protected: // private methods private: // protected variables protected: CBuildExpression* mExpression; // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRuleAtomListBodyExpression.cpp0000644000175000017500000000432312520550730030132 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRuleAtomListBodyExpression.h" namespace Konclude { namespace Parser { namespace Expression { CRuleAtomListBodyExpression::CRuleAtomListBodyExpression(const CEXPRESSIONLIST& expressionList) : CRuleAtomListExpression(expressionList) { } CRuleAtomListBodyExpression::~CRuleAtomListBodyExpression() { } CBuildExpression::ExpressionType CRuleAtomListBodyExpression::getType() { return BETRULEATOMBODYLIST; } cint64 CRuleAtomListBodyExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListRuleAtomTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CRuleAtomListBodyExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CRuleAtomListBodyExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListRuleAtomTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CRuleAtomListBodyExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListRuleAtomTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetInstancesExpression.h0000644000175000017500000000451412520550726030021 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYGETINSTANCESEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYGETINSTANCESEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CClassTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetInstancesExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetInstancesExpression : public CQueryExpression, public CClassTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryGetInstancesExpression(const QString& name, bool direct, CClassTermExpression* classTermExp); //! Destructor virtual ~CQueryGetInstancesExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); bool isDirect(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: bool mDirect; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYGETINSTANCESEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectComplementOfExpression.h0000644000175000017500000000437012520550720030115 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTCOMPLEMENTOFEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTCOMPLEMENTOFEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassTermExpression.h" #include "CClassTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectComplementOfExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectComplementOfExpression : public CClassTermExpression, public CClassTermExpressionAssociator { // public methods public: //! Constructor CObjectComplementOfExpression(CClassTermExpression *expression); //! Destructor virtual ~CObjectComplementOfExpression(); CClassTermExpression *getComplementExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTCOMPLEMENTOFEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRulePropertyAtomTermExpression.h0000644000175000017500000000474512520550732030534 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CRULEPROPERTYATOMTERMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CRULEPROPERTYATOMTERMEXPRESSION_H // Libraries includes // Namespace includes #include "ExpressionSettings.h" #include "CRuleAtomTermExpression.h" #include "CListClassVariableTermExpressionAssociator.h" #include "CObjectPropertyTermExpressionAssociator.h" #include "CObjectIndividualVariableExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CRulePropertyAtomTermExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRulePropertyAtomTermExpression : public CRuleAtomTermExpression, public CListClassVariableTermExpressionAssociator, public CObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CRulePropertyAtomTermExpression(CObjectIndividualVariableExpression* expression1, CObjectIndividualVariableExpression* expression2, CObjectPropertyTermExpression* objectPropExp); //! Destructor virtual ~CRulePropertyAtomTermExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CRULEPROPERTYATOMTERMEXPRESSION_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairClassTermExpressionAssociator.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairClassTermExpressionAssociator.c0000644000175000017500000000322212520550722032434 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COrderedPairClassTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { COrderedPairClassTermExpressionAssociator::COrderedPairClassTermExpressionAssociator(CClassTermExpression *expression1, CClassTermExpression *expression2) : COrderedPairExpressionAssociator(expression1,expression2) { } COrderedPairClassTermExpressionAssociator::~COrderedPairClassTermExpressionAssociator() { } CClassTermExpression* COrderedPairClassTermExpressionAssociator::getFirstClassTermExpression() { return (CClassTermExpression*)getFirstExpression(); } CClassTermExpression* COrderedPairClassTermExpressionAssociator::getSecondClassTermExpression() { return (CClassTermExpression*)getSecondExpression(); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyDomainExpression.h0000644000175000017500000000456612520550722030512 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYDOMAINEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYDOMAINEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyAxiomExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" #include "CClassTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectPropertyDomainExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectPropertyDomainExpression : public CObjectPropertyAxiomExpression, public CObjectPropertyTermExpressionAssociator, public CClassTermExpressionAssociator { // public methods public: //! Constructor CObjectPropertyDomainExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2); //! Destructor virtual ~CObjectPropertyDomainExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYDOMAINEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CAnonymousIndividualExpression.h0000644000175000017500000000456612520550702030406 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CANONYMOUSINDIVIDUALEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CANONYMOUSINDIVIDUALEXPRESSION_H // Libraries includes #include // Namespace includes #include "CIndividualTermExpression.h" #include "CExpressionEntity.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CAnonymousIndividualExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CAnonymousIndividualExpression : public CIndividualTermExpression, public CExpressionEntity { // public methods public: //! Constructor CAnonymousIndividualExpression(const QString& ontologyName, const QString& nodeName); //! Destructor virtual ~CAnonymousIndividualExpression(); virtual ExpressionType getType(); const QString& getOntologyName(); const QString& getNodeName(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: QString mOntologyName; QString mNodeName; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CANONYMOUSINDIVIDUALEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CExpressionHashMixer.h0000644000175000017500000000404512520550714026270 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CEXPRESSIONHASHMIXER_H #define KONCLUDE_PARSER_EXPRESSION_CEXPRESSIONHASHMIXER_H // Libraries includes // Namespace includes #include "ExpressionSettings.h" #include "CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CExpressionHashMixer * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CExpressionHashMixer { // public methods public: //! Constructor CExpressionHashMixer(); //! Destructor virtual ~CExpressionHashMixer(); static cint64 getHashValueMixed(cint64 hashValue1); static cint64 getHashValueMixed(cint64 hashValue1, cint64 hashValue2); static cint64 getHashValueMixed(cint64 hashValue1, cint64 hashValue2, cint64 hashValue3); static cint64 getHashValueMixed(cint64 hashValue1, cint64 hashValue2, cint64 hashValue3, cint64 hashValue4); // protected methods protected: // private methods private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CEXPRESSIONHASHMIXER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryIsInstanceOfExpression.h0000644000175000017500000000520412520550730027747 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYISINSTANCEOFEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYISINSTANCEOFEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CClassTermExpressionAssociator.h" #include "CIndividualTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryIsInstanceOfExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryIsInstanceOfExpression : public CQueryExpression, public CClassTermExpressionAssociator, public CIndividualTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryIsInstanceOfExpression(const QString& name, CIndividualTermExpression *individualExp, CClassTermExpression *classExp); //! Destructor virtual ~CQueryIsInstanceOfExpression(); virtual ExpressionType getType(); virtual CClassTermExpression* getConstructedTestClassExpression(); virtual CQueryIsInstanceOfExpression *setConstructedTestClassExpression(CClassTermExpression *conBuildExp); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: CClassTermExpression* mConstructedClassExp; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYISINSTANCEOFEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CIrreflexiveObjectPropertyExpression.h0000644000175000017500000000465112520550714031563 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CIRREFLEXIVEOBJECTPROPERTYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CIRREFLEXIVEOBJECTPROPERTYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyAxiomExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CIrreflexiveObjectPropertyExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIrreflexiveObjectPropertyExpression : public CObjectPropertyAxiomExpression, public CObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CIrreflexiveObjectPropertyExpression(CObjectPropertyTermExpression *expression); //! Destructor virtual ~CIrreflexiveObjectPropertyExpression(); CObjectPropertyTermExpression *getIreflexiveObjectPropertyExpression(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual ExpressionType getType(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CIRREFLEXIVEOBJECTPROPERTYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListRuleAtomTermExpressionAssociator.h0000644000175000017500000000477212520550716031655 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CLISTRULEATOMTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CLISTRULEATOMTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CRuleAtomTermExpression.h" #include "CListExpressionAssociator.h" #include "CClassTermExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CListRuleAtomTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CListRuleAtomTermExpressionAssociator : public CListExpressionAssociator { // public methods public: //! Constructor CListRuleAtomTermExpressionAssociator(CRuleAtomTermExpression* expression1 = nullptr, CRuleAtomTermExpression* expression2 = nullptr, CClassTermExpression* expression3 = nullptr); CListRuleAtomTermExpressionAssociator(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CListRuleAtomTermExpressionAssociator(); CEXPRESSIONLIST* getRuleAtomTermExpressionList(); virtual bool compareStructuralEquivalence(const CListRuleAtomTermExpressionAssociator& listClassTermExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CLISTRULEATOMTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyTermExpression.cpp0000644000175000017500000000221312520550722030530 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectPropertyTermExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectPropertyTermExpression::CObjectPropertyTermExpression() { } CObjectPropertyTermExpression::~CObjectPropertyTermExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CUnorderedPairIndividualTermExpressionAssociator.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CUnorderedPairIndividualTermExpressionAssoc0000644000175000017500000000450712520550732032552 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CUNORDEREDPAIRINDIVIDUALTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CUNORDEREDPAIRINDIVIDUALTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CIndividualTermExpression.h" #include "CUnorderedPairExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CUnorderedPairIndividualTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CUnorderedPairIndividualTermExpressionAssociator : public CUnorderedPairExpressionAssociator { // public methods public: //! Constructor CUnorderedPairIndividualTermExpressionAssociator(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2); //! Destructor virtual ~CUnorderedPairIndividualTermExpressionAssociator(); CIndividualTermExpression* getFirstIndividualTermExpression(); CIndividualTermExpression* getSecondIndividualTermExpression(); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CUNORDEREDPAIRINDIVIDUALTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectCardinalityExpression.cpp0000644000175000017500000000334212520550720030321 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectCardinalityExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectCardinalityExpression::CObjectCardinalityExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2, cint64 cardinality) : CObjectPropertyTermExpressionAssociator(expression1), CClassTermExpressionAssociator(expression2), CCardinalityAssociator(cardinality) { } CObjectCardinalityExpression::~CObjectCardinalityExpression() { } bool CObjectCardinalityExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CEquivalentObjectPropertiesExpression.h0000644000175000017500000000476212520550712031725 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CEQUIVALENTOBJECTPROPERTIESEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CEQUIVALENTOBJECTPROPERTIESEXPRESSION_H // Libraries includes // Namespace includes #include "CObjectPropertyAxiomExpression.h" #include "CListObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CEquivalentObjectPropertiesExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CEquivalentObjectPropertiesExpression : public CObjectPropertyAxiomExpression, public CListObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CEquivalentObjectPropertiesExpression(CObjectPropertyTermExpression *expression1, CObjectPropertyTermExpression *expression2, CObjectPropertyTermExpression *expression3 = nullptr); CEquivalentObjectPropertiesExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CEquivalentObjectPropertiesExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CEQUIVALENTOBJECTPROPERTIESEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CEquivalentDataPropertiesExpression.cpp0000644000175000017500000000520212520550712031711 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEquivalentDataPropertiesExpression.h" namespace Konclude { namespace Parser { namespace Expression { CEquivalentDataPropertiesExpression::CEquivalentDataPropertiesExpression(CDataPropertyTermExpression *expression1, CDataPropertyTermExpression *expression2, CDataPropertyTermExpression *expression3) : CListDataPropertyTermExpressionAssociator(expression1,expression2,expression3) { } CEquivalentDataPropertiesExpression::CEquivalentDataPropertiesExpression(const CEXPRESSIONLIST& expressionList) : CListDataPropertyTermExpressionAssociator(expressionList) { } CEquivalentDataPropertiesExpression::~CEquivalentDataPropertiesExpression() { } cint64 CEquivalentDataPropertiesExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListDataPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CEquivalentDataPropertiesExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CEquivalentDataPropertiesExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListDataPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } CBuildExpression::ExpressionType CEquivalentDataPropertiesExpression::getType() { return BETEQUIVALENTDATAPROPERTIES; } bool CEquivalentDataPropertiesExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListDataPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetFlattenedInstancesExpression.h0000644000175000017500000000461312520550726031650 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYGETFLATTENEDINSTANCESEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYGETFLATTENEDINSTANCESEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CClassTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetFlattenedInstancesExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetFlattenedInstancesExpression : public CQueryExpression, public CClassTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryGetFlattenedInstancesExpression(const QString& name, bool direct, CClassTermExpression* classTermExp); //! Destructor virtual ~CQueryGetFlattenedInstancesExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); bool isDirect(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: bool mDirect; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYGETFLATTENEDINSTANCESEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CPropertyTermExpression.cpp0000644000175000017500000000215512520550724027410 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPropertyTermExpression.h" namespace Konclude { namespace Parser { namespace Expression { CPropertyTermExpression::CPropertyTermExpression() { } CPropertyTermExpression::~CPropertyTermExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CNegativeObjectPropertyAssertionExpression.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CNegativeObjectPropertyAssertionExpression.0000644000175000017500000000552512520550716032564 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNegativeObjectPropertyAssertionExpression.h" namespace Konclude { namespace Parser { namespace Expression { CNegativeObjectPropertyAssertionExpression::CNegativeObjectPropertyAssertionExpression(CObjectPropertyTermExpression *propertyExpression1, CIndividualTermExpression *sourceExpression2, CIndividualTermExpression *targetExpression3) : CObjectPropertyTermExpressionAssociator(propertyExpression1),COrderedPairIndividualTermExpressionAssociator(sourceExpression2,targetExpression3) { } CNegativeObjectPropertyAssertionExpression::~CNegativeObjectPropertyAssertionExpression() { } CBuildExpression::ExpressionType CNegativeObjectPropertyAssertionExpression::getType() { return BETNEGATIVEOBJECTPROPERTYASSERTION; } cint64 CNegativeObjectPropertyAssertionExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue(),COrderedPairIndividualTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CNegativeObjectPropertyAssertionExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CNegativeObjectPropertyAssertionExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && COrderedPairIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CNegativeObjectPropertyAssertionExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); COrderedPairIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CEntityAssociator.h0000644000175000017500000000411112520550712025614 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CENTITYASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CENTITYASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CExpressionEntity.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CEntityAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CEntityAssociator { // public methods public: //! Constructor CEntityAssociator(CExpressionEntity* entity); //! Destructor virtual ~CEntityAssociator(); CExpressionEntity* getEntity(); CEntityAssociator* setEntity(CExpressionEntity* entity); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(const CEntityAssociator& entityAssociator); // protected methods protected: // protected variables protected: CExpressionEntity* mEntity; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CENTITYASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CUnorderedPairExpressionAssociator.h0000644000175000017500000000405612520550732031175 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CUNORDEREDPAIREXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CUNORDEREDPAIREXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CBuildExpression.h" #include "CPairExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CUnorderedPairExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CUnorderedPairExpressionAssociator : public CPairExpressionAssociator { // public methods public: //! Constructor CUnorderedPairExpressionAssociator(CBuildExpression* expression1, CBuildExpression* expression2); //! Destructor virtual ~CUnorderedPairExpressionAssociator(); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CUNORDEREDPAIREXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataAllValuesFromExpression.h0000644000175000017500000000457412520550704027714 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAALLVALUESFROMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAALLVALUESFROMEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassTermExpression.h" #include "CDataPropertyTermExpression.h" #include "CDataPropertyTermExpressionAssociator.h" #include "CDataRangeTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDataAllValuesFromExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDataAllValuesFromExpression : public CClassTermExpression, public CDataPropertyTermExpressionAssociator, public CDataRangeTermExpressionAssociator { // public methods public: //! Constructor CDataAllValuesFromExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2); //! Destructor virtual ~CDataAllValuesFromExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAALLVALUESFROMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CEntailmentAxiomExpressionAssociation.h0000644000175000017500000000631212520550712031670 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CEntailmentAxiomExpressionAssociation_H #define KONCLUDE_PARSER_EXPRESSION_CEntailmentAxiomExpressionAssociation_H // Libraries includes // Namespace includes #include "CAxiomExpression.h" #include "CClassTermExpression.h" #include "CObjectPropertyTermExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CEntailmentAxiomExpressionAssociation * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CEntailmentAxiomExpressionAssociation { // public methods public: enum ENTAILMENTAXIOMEXPRESSIONCONSTRUCTIONTYPE { EAECTCONCEPTSATISFIABILITY, EAECTAXIOMSPESIFIC }; //! Constructor CEntailmentAxiomExpressionAssociation(CAxiomExpression* axiomExpression, ENTAILMENTAXIOMEXPRESSIONCONSTRUCTIONTYPE constructionType = EAECTCONCEPTSATISFIABILITY); CClassTermExpression* takeNextConstructedTestClass(); bool hasNextConstructedTestClass(); CEXPRESSIONLIST* getConstructedTestClasses(); CEntailmentAxiomExpressionAssociation* addConstructedTestClass(CClassTermExpression* conBuildExp); bool hasNextConstructedTestObjectProperty(); CObjectPropertyTermExpression* takeNextConstructedTestObjectProperty(); CEXPRESSIONLIST* getConstructedTestObjectProperties(); CEntailmentAxiomExpressionAssociation* addConstructedTestObjectProperties(CObjectPropertyTermExpression* objPropBuildExp); CAxiomExpression* getAxiomExpression(); ENTAILMENTAXIOMEXPRESSIONCONSTRUCTIONTYPE getConstructionType(); CEntailmentAxiomExpressionAssociation* setConstructionType(ENTAILMENTAXIOMEXPRESSIONCONSTRUCTIONTYPE constructionType); // protected methods protected: // protected variables protected: ENTAILMENTAXIOMEXPRESSIONCONSTRUCTIONTYPE mConstructionType; CAxiomExpression* mAxiomExpression; CEXPRESSIONLIST mConstructedClassExpList; CEXPRESSIONLIST mConstructedObjPropExpList; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CEntailmentAxiomExpressionAssociation_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRuleDifferentIndividualsAtomTermExpression.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRuleDifferentIndividualsAtomTermExpression0000644000175000017500000000473612520550730032562 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRuleDifferentIndividualsAtomTermExpression.h" namespace Konclude { namespace Parser { namespace Expression { CRuleDifferentIndividualsAtomTermExpression::CRuleDifferentIndividualsAtomTermExpression(CObjectIndividualVariableExpression* expression1, CObjectIndividualVariableExpression* expression2) : CListClassVariableTermExpressionAssociator(expression1,expression2) { } CRuleDifferentIndividualsAtomTermExpression::~CRuleDifferentIndividualsAtomTermExpression() { } CBuildExpression::ExpressionType CRuleDifferentIndividualsAtomTermExpression::getType() { return BETRULEDIFFERENTINDIVIDUALSATOM; } cint64 CRuleDifferentIndividualsAtomTermExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListClassVariableTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CRuleDifferentIndividualsAtomTermExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CRuleDifferentIndividualsAtomTermExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListClassVariableTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CRuleDifferentIndividualsAtomTermExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListClassVariableTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListClassVariableTermExpressionAssociator.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListClassVariableTermExpressionAssociator.0000644000175000017500000000433112520550714032455 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CListClassVariableTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CListClassVariableTermExpressionAssociator::CListClassVariableTermExpressionAssociator(CObjectIndividualVariableExpression *expression1, CObjectIndividualVariableExpression *expression2, CObjectIndividualVariableExpression *expression3) : CListExpressionAssociator(expression1,expression2,expression3) { } CListClassVariableTermExpressionAssociator::CListClassVariableTermExpressionAssociator(const CEXPRESSIONLIST& expressionList) : CListExpressionAssociator(*(CEXPRESSIONLIST*)&expressionList) { } CListClassVariableTermExpressionAssociator::~CListClassVariableTermExpressionAssociator() { } CEXPRESSIONLIST* CListClassVariableTermExpressionAssociator::getClassVariableTermExpressionList() { // bad cast to avoid lot of reimplementation return (CEXPRESSIONLIST*)&mExpressionList; } bool CListClassVariableTermExpressionAssociator::compareStructuralEquivalence(const CListClassVariableTermExpressionAssociator& listClassTermExpressionAssociator) { return CListExpressionAssociator::compareStructuralEquivalence(listClassTermExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListObjectPropertyTermExpressionAssociator.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListObjectPropertyTermExpressionAssociator0000644000175000017500000000365212520550716032646 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CListObjectPropertyTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CListObjectPropertyTermExpressionAssociator::CListObjectPropertyTermExpressionAssociator(CObjectPropertyTermExpression *expression1, CObjectPropertyTermExpression *expression2, CObjectPropertyTermExpression *expression3) : CListExpressionAssociator(expression1,expression2,expression3) { } CListObjectPropertyTermExpressionAssociator::CListObjectPropertyTermExpressionAssociator(const CEXPRESSIONLIST& expressionList) : CListExpressionAssociator(*(CEXPRESSIONLIST*)&expressionList) { } CListObjectPropertyTermExpressionAssociator::~CListObjectPropertyTermExpressionAssociator() { } CEXPRESSIONLIST* CListObjectPropertyTermExpressionAssociator::getObjectPropertyTermExpressionList() { // bad cast to avoid lot of reimplementation return (CEXPRESSIONLIST*)&mExpressionList; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataIntersectionOfExpression.cpp0000644000175000017500000000474212520550706030465 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataIntersectionOfExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataIntersectionOfExpression::CDataIntersectionOfExpression(CDataRangeTermExpression* expression1, CDataRangeTermExpression* expression2) : CListDataRangeTermExpressionAssociator(expression1,expression2) { } CDataIntersectionOfExpression::CDataIntersectionOfExpression(const CEXPRESSIONLIST& expressionList) : CListDataRangeTermExpressionAssociator(expressionList) { } CDataIntersectionOfExpression::~CDataIntersectionOfExpression() { } CBuildExpression::ExpressionType CDataIntersectionOfExpression::getType() { return BETDATAINTERSECTIONOF; } cint64 CDataIntersectionOfExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListDataRangeTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDataIntersectionOfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataIntersectionOfExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListDataRangeTermExpressionAssociator::compareStructuralEquivalence(*compExpCast);; } bool CDataIntersectionOfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListDataRangeTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CUnorderedPairObjectPropertyTermExpressionAssociator.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CUnorderedPairObjectPropertyTermExpressionA0000644000175000017500000000457712520550732032554 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CUNORDEREDPAIROBJECTPROPERTYTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CUNORDEREDPAIROBJECTPROPERTYTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CObjectPropertyTermExpression.h" #include "CUnorderedPairExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CUnorderedPairObjectPropertyTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CUnorderedPairObjectPropertyTermExpressionAssociator : public CUnorderedPairExpressionAssociator { // public methods public: //! Constructor CUnorderedPairObjectPropertyTermExpressionAssociator(CObjectPropertyTermExpression* expression1, CObjectPropertyTermExpression* expression2); //! Destructor virtual ~CUnorderedPairObjectPropertyTermExpressionAssociator(); CObjectPropertyTermExpression* getFirstObjectPropertyTermExpression(); CObjectPropertyTermExpression* getSecondObjectPropertyTermExpression(); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CUnorderedPairObjectPropertyTermExpressionAssociator_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRuleDifferentIndividualsAtomTermExpression.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRuleDifferentIndividualsAtomTermExpression0000644000175000017500000000473312520550730032557 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CRULEDIFFERENTINDIVIDUALSATOMTERMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CRULEDIFFERENTINDIVIDUALSATOMTERMEXPRESSION_H // Libraries includes // Namespace includes #include "ExpressionSettings.h" #include "CRuleAtomTermExpression.h" #include "CListClassVariableTermExpressionAssociator.h" #include "CObjectPropertyTermExpressionAssociator.h" #include "CObjectIndividualVariableExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CRuleDifferentIndividualsAtomTermExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRuleDifferentIndividualsAtomTermExpression : public CRuleAtomTermExpression, public CListClassVariableTermExpressionAssociator { // public methods public: //! Constructor CRuleDifferentIndividualsAtomTermExpression(CObjectIndividualVariableExpression* expression1, CObjectIndividualVariableExpression* expression2); //! Destructor virtual ~CRuleDifferentIndividualsAtomTermExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CRULEDIFFERENTINDIVIDUALSATOMTERMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataMinCardinalityExpression.cpp0000644000175000017500000000431012520550706030430 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataMinCardinalityExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataMinCardinalityExpression::CDataMinCardinalityExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2, cint64 cardinality) : CDataCardinalityExpression(expression1,expression2,cardinality) { } CDataMinCardinalityExpression::~CDataMinCardinalityExpression() { } CBuildExpression::ExpressionType CDataMinCardinalityExpression::getType() { return BETDATAMINCARDINALITY; } cint64 CDataMinCardinalityExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDataPropertyTermExpressionAssociator::getStructuralHashValue(),CDataRangeTermExpressionAssociator::getStructuralHashValue(),mCard); return hashValue; } bool CDataMinCardinalityExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataMinCardinalityExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDataPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CDataRangeTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && compExpCast->mCard == mCard; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetInstancesExpression.cpp0000644000175000017500000000463412520550726030357 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetInstancesExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetInstancesExpression::CQueryGetInstancesExpression(const QString& name, bool direct, CClassTermExpression* classTermExp) : CNameAssociator(name),CClassTermExpressionAssociator(classTermExp),mDirect(direct) { } CQueryGetInstancesExpression::~CQueryGetInstancesExpression() { } CBuildExpression::ExpressionType CQueryGetInstancesExpression::getType() { return BETGETINDIVIDUALS; } cint64 CQueryGetInstancesExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CClassTermExpressionAssociator::getStructuralHashValue(),(cint64)mDirect); return hashValue; } bool CQueryGetInstancesExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryGetInstancesExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } if (compExpCast->mDirect != mDirect) { return false; } return CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryGetInstancesExpression::isDirect() { return mDirect; } bool CQueryGetInstancesExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataPropertyAssertionExpression.h0000644000175000017500000000516512520550710030706 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYASSERTIONEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYASSERTIONEXPRESSION_H // Libraries includes #include // Namespace includes #include "CAssertionAxiomExpression.h" #include "CIndividualTermExpressionAssociator.h" #include "CDataLiteralExpressionAssociator.h" #include "CDataRangeTermExpressionAssociator.h" #include "CDataPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDataPropertyAssertionExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataPropertyAssertionExpression : public CAssertionAxiomExpression, public CIndividualTermExpressionAssociator, public CDataPropertyTermExpressionAssociator, public CDataLiteralExpressionAssociator { // public methods public: //! Constructor CDataPropertyAssertionExpression(CDataPropertyTermExpression *propertyExpression1, CIndividualTermExpression *sourceExpression2, CDataLiteralExpression *targetExpression3); //! Destructor virtual ~CDataPropertyAssertionExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYASSERTIONEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRuleAtomListHeadExpression.h0000644000175000017500000000404612520550730027545 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CRULEATOMLISTHEADEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CRULEATOMLISTHEADEXPRESSION_H // Libraries includes // Namespace includes #include "ExpressionSettings.h" #include "CRuleAtomListExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CRuleAtomListHeadExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRuleAtomListHeadExpression : public CRuleAtomListExpression { // public methods public: //! Constructor CRuleAtomListHeadExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CRuleAtomListHeadExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CRULEATOMLISTHEADEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataLiteralExpression.h0000644000175000017500000000462612520550706026574 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATALITERALEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATALITERALEXPRESSION_H // Libraries includes #include // Namespace includes #include "CDataRangeTermExpression.h" #include "CDataLexicalValueExpression.h" #include "CDatatypeExpression.h" #include "CDataLexicalValueExpressionAssociator.h" #include "CDatatypeExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDataLiteralExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDataLiteralExpression : public CDataRangeTermExpression, public CDataLexicalValueExpressionAssociator, public CDatatypeExpressionAssociator { // public methods public: //! Constructor CDataLiteralExpression(CDataLexicalValueExpression* dataLexicalValueExpression = nullptr, CDatatypeExpression* dataTypeExpression = nullptr); //! Destructor virtual ~CDataLiteralExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATALITERALEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CExpressionEntity.h0000644000175000017500000000350512520550714025654 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CEXPRESSIONENTITY_H #define KONCLUDE_PARSER_CEXPRESSIONENTITY_H // Libraries includes // Namespace includes #include "CBuildExpression.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CExpressionEntity * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CExpressionEntity : public CNameAssociator { // public methods public: //! Constructor CExpressionEntity(const QString& className); CExpressionEntity* setEntityID(cint64 id); cint64 getEntityID(); // protected methods protected: // private methods private: // protected variables protected: cint64 mEntityID; // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CEXPRESSIONENTITY_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CIrreflexiveObjectPropertyExpression.cpp0000644000175000017500000000474012520550714032115 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIrreflexiveObjectPropertyExpression.h" namespace Konclude { namespace Parser { namespace Expression { CIrreflexiveObjectPropertyExpression::CIrreflexiveObjectPropertyExpression(CObjectPropertyTermExpression *expression) : CObjectPropertyTermExpressionAssociator(expression) { } CIrreflexiveObjectPropertyExpression::~CIrreflexiveObjectPropertyExpression() { } CBuildExpression::ExpressionType CIrreflexiveObjectPropertyExpression::getType() { return BETIRREFLEXIVEPROPERTY; } CObjectPropertyTermExpression *CIrreflexiveObjectPropertyExpression::getIreflexiveObjectPropertyExpression() { return getObjectPropertyTermExpression(); } cint64 CIrreflexiveObjectPropertyExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CIrreflexiveObjectPropertyExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CIrreflexiveObjectPropertyExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CIrreflexiveObjectPropertyExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataPropertyExpression.h0000644000175000017500000000420512520550710027010 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CDataPropertyTermExpression.h" #include "CExpressionEntity.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDataPropertyExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDataPropertyExpression : public CDataPropertyTermExpression, public CExpressionEntity { // public methods public: //! Constructor CDataPropertyExpression(const QString& probertyName); //! Destructor virtual ~CDataPropertyExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataPropertyAssertionExpression.cpp0000644000175000017500000000565212520550706031247 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataPropertyAssertionExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataPropertyAssertionExpression::CDataPropertyAssertionExpression(CDataPropertyTermExpression *propertyExpression1, CIndividualTermExpression *sourceExpression2, CDataLiteralExpression *targetExpression3) : CDataPropertyTermExpressionAssociator(propertyExpression1), CIndividualTermExpressionAssociator(sourceExpression2), CDataLiteralExpressionAssociator(targetExpression3) { } CDataPropertyAssertionExpression::~CDataPropertyAssertionExpression() { } CBuildExpression::ExpressionType CDataPropertyAssertionExpression::getType() { return BETDATAPROPERTYASSERTION; } cint64 CDataPropertyAssertionExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDataPropertyTermExpressionAssociator::getStructuralHashValue(),CIndividualTermExpressionAssociator::getStructuralHashValue(),CDataLiteralExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDataPropertyAssertionExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataPropertyAssertionExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDataPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CDataLiteralExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CDataPropertyAssertionExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CDataPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CDataLiteralExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectOneOfExpression.h0000644000175000017500000000461312520550720026533 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTONEOFEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTONEOFEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassTermExpression.h" #include "CListIndividualTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectOneOfExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectOneOfExpression : public CClassTermExpression, public CListIndividualTermExpressionAssociator { // public methods public: //! Constructor CObjectOneOfExpression(CIndividualTermExpression *expression1 = 0, CIndividualTermExpression *expression2 = 0); CObjectOneOfExpression(const CEXPRESSIONLIST& expressionList); CObjectOneOfExpression* initObjectOneOfExpression(CIndividualTermExpression *expression1 = 0, CIndividualTermExpression *expression2 = 0); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTONEOFEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetSuperClassesExpression.h0000644000175000017500000000454012520550730030500 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYGETSUPERCLASSESEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYGETSUPERCLASSESEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CClassTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetSuperClassesExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetSuperClassesExpression : public CQueryExpression, public CClassTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryGetSuperClassesExpression(const QString& name, bool direct, CClassTermExpression* classTermExp); //! Destructor virtual ~CQueryGetSuperClassesExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); bool isDirect(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: bool mDirect; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYGETSUPERCLASSESEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CEntailmentAxiomExpressionAssociation.cpp0000644000175000017500000000655312520550712032232 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEntailmentAxiomExpressionAssociation.h" namespace Konclude { namespace Parser { namespace Expression { CEntailmentAxiomExpressionAssociation::CEntailmentAxiomExpressionAssociation(CAxiomExpression* axiomExpression, CEntailmentAxiomExpressionAssociation::ENTAILMENTAXIOMEXPRESSIONCONSTRUCTIONTYPE constructionType) { mAxiomExpression = axiomExpression; mConstructionType = constructionType; } CClassTermExpression* CEntailmentAxiomExpressionAssociation::takeNextConstructedTestClass() { if (!mConstructedClassExpList.isEmpty()) { return mConstructedClassExpList.takeFirst(); } return nullptr; } bool CEntailmentAxiomExpressionAssociation::hasNextConstructedTestClass() { return !mConstructedClassExpList.isEmpty(); } CObjectPropertyTermExpression* CEntailmentAxiomExpressionAssociation::takeNextConstructedTestObjectProperty() { if (!mConstructedObjPropExpList.isEmpty()) { return mConstructedObjPropExpList.takeFirst(); } return nullptr; } bool CEntailmentAxiomExpressionAssociation::hasNextConstructedTestObjectProperty() { return !mConstructedObjPropExpList.isEmpty(); } CEXPRESSIONLIST* CEntailmentAxiomExpressionAssociation::getConstructedTestClasses() { return &mConstructedClassExpList; } CEntailmentAxiomExpressionAssociation *CEntailmentAxiomExpressionAssociation::addConstructedTestClass(CClassTermExpression *conBuildExp) { mConstructedClassExpList.append(conBuildExp); return this; } CEXPRESSIONLIST* CEntailmentAxiomExpressionAssociation::getConstructedTestObjectProperties() { return &mConstructedObjPropExpList; } CEntailmentAxiomExpressionAssociation *CEntailmentAxiomExpressionAssociation::addConstructedTestObjectProperties(CObjectPropertyTermExpression *conBuildExp) { mConstructedObjPropExpList.append(conBuildExp); return this; } CAxiomExpression* CEntailmentAxiomExpressionAssociation::getAxiomExpression() { return mAxiomExpression; } CEntailmentAxiomExpressionAssociation::ENTAILMENTAXIOMEXPRESSIONCONSTRUCTIONTYPE CEntailmentAxiomExpressionAssociation::getConstructionType() { return mConstructionType; } CEntailmentAxiomExpressionAssociation* CEntailmentAxiomExpressionAssociation::setConstructionType(CEntailmentAxiomExpressionAssociation::ENTAILMENTAXIOMEXPRESSIONCONSTRUCTIONTYPE constructionType) { mConstructionType = constructionType; return this; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CAssertionAxiomExpression.cpp0000644000175000017500000000206412520550702027674 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAssertionAxiomExpression.h" namespace Konclude { namespace Parser { namespace Expression { CAssertionAxiomExpression::CAssertionAxiomExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListClassTermExpressionAssociator.cpp0000644000175000017500000000404712520550714031516 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CListClassTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CListClassTermExpressionAssociator::CListClassTermExpressionAssociator(CClassTermExpression *expression1, CClassTermExpression *expression2, CClassTermExpression *expression3) : CListExpressionAssociator(expression1,expression2,expression3) { } CListClassTermExpressionAssociator::CListClassTermExpressionAssociator(const CEXPRESSIONLIST& expressionList) : CListExpressionAssociator(*(CEXPRESSIONLIST*)&expressionList) { } CListClassTermExpressionAssociator::~CListClassTermExpressionAssociator() { } CEXPRESSIONLIST* CListClassTermExpressionAssociator::getClassTermExpressionList() { // bad cast to avoid lot of reimplementation return (CEXPRESSIONLIST*)&mExpressionList; } bool CListClassTermExpressionAssociator::compareStructuralEquivalence(const CListClassTermExpressionAssociator& listClassTermExpressionAssociator) { return CListExpressionAssociator::compareStructuralEquivalence(listClassTermExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CPrecedentBuildPropertyExpression.cpp0000644000175000017500000000301112520550724031362 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecedentBuildPropertyExpression.h" namespace Konclude { namespace Parser { namespace Expression { CPrecedentBuildPropertyExpression::CPrecedentBuildPropertyExpression(const QString &probertyName, CRole *precedentBuildRole) : CObjectPropertyExpression(probertyName) { role = precedentBuildRole; } CPrecedentBuildPropertyExpression::~CPrecedentBuildPropertyExpression() { } CBuildExpression::ExpressionType CPrecedentBuildPropertyExpression::getType() { return BETPRECEDENTPROPERTYBUILD; } CRole *CPrecedentBuildPropertyExpression::getPrecedentBuildRole() { return role; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataHasValueExpression.cpp0000644000175000017500000000473412520550706027243 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataHasValueExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataHasValueExpression::CDataHasValueExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2) : CDataPropertyTermExpressionAssociator(expression1), CDataRangeTermExpressionAssociator(expression2) { } CDataHasValueExpression::~CDataHasValueExpression() { } CBuildExpression::ExpressionType CDataHasValueExpression::getType() { return BETDATAHASVALUE; } cint64 CDataHasValueExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDataPropertyTermExpressionAssociator::getStructuralHashValue(),CDataRangeTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDataHasValueExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataHasValueExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDataPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CDataRangeTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CDataHasValueExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CDataPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CDataRangeTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CClassAssertionExpression.cpp0000644000175000017500000000462112520550704027667 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassAssertionExpression.h" namespace Konclude { namespace Parser { namespace Expression { CClassAssertionExpression::CClassAssertionExpression(CIndividualTermExpression *expression1, CClassTermExpression *expression2) : CIndividualTermExpressionAssociator(expression1), CClassTermExpressionAssociator(expression2) { } CBuildExpression::ExpressionType CClassAssertionExpression::getType() { return BETCLASSASSERTION; } cint64 CClassAssertionExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CIndividualTermExpressionAssociator::getStructuralHashValue(),CClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CClassAssertionExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CClassAssertionExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CClassAssertionExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CUnorderedPairObjectPropertyTermExpressionAssociator.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CUnorderedPairObjectPropertyTermExpressionA0000644000175000017500000000345112520550732032542 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CUnorderedPairObjectPropertyTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CUnorderedPairObjectPropertyTermExpressionAssociator::CUnorderedPairObjectPropertyTermExpressionAssociator(CObjectPropertyTermExpression *expression1, CObjectPropertyTermExpression *expression2) : CUnorderedPairExpressionAssociator(expression1,expression2) { } CUnorderedPairObjectPropertyTermExpressionAssociator::~CUnorderedPairObjectPropertyTermExpressionAssociator() { } CObjectPropertyTermExpression* CUnorderedPairObjectPropertyTermExpressionAssociator::getFirstObjectPropertyTermExpression() { return (CObjectPropertyTermExpression*)getFirstExpression(); } CObjectPropertyTermExpression* CUnorderedPairObjectPropertyTermExpressionAssociator::getSecondObjectPropertyTermExpression() { return (CObjectPropertyTermExpression*)getSecondExpression(); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectHasValueExpression.cpp0000644000175000017500000000500312520550720027562 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectHasValueExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectHasValueExpression::CObjectHasValueExpression(CObjectPropertyTermExpression *expression1, CIndividualTermExpression *expression2) : CObjectPropertyTermExpressionAssociator(expression1), CIndividualTermExpressionAssociator(expression2) { } CObjectHasValueExpression::~CObjectHasValueExpression() { } CBuildExpression::ExpressionType CObjectHasValueExpression::getType() { return BETOBJECTHASVALUE; } cint64 CObjectHasValueExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue(),CIndividualTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CObjectHasValueExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectHasValueExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CObjectHasValueExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyAssertionExpression.h0000644000175000017500000000472212520550720031242 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYASSERTIONEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYASSERTIONEXPRESSION_H // Libraries includes #include // Namespace includes #include "CAssertionAxiomExpression.h" #include "COrderedPairIndividualTermExpressionAssociator.h" #include "CObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CObjectPropertyAssertionExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CObjectPropertyAssertionExpression : public CAssertionAxiomExpression, public COrderedPairIndividualTermExpressionAssociator, public CObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CObjectPropertyAssertionExpression(CObjectPropertyTermExpression *propertyExpression1, CIndividualTermExpression *sourceExpression2, CIndividualTermExpression *targetExpression3); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYASSERTIONEXPRESSION_H ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairIndividualTermExpressionAssociator.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairIndividualTermExpressionAssocia0000644000175000017500000000434012520550724032515 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIRINDIVIDUALTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIRINDIVIDUALTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CIndividualTermExpression.h" #include "COrderedPairExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class COrderedPairIndividualTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COrderedPairIndividualTermExpressionAssociator : public COrderedPairExpressionAssociator { // public methods public: //! Constructor COrderedPairIndividualTermExpressionAssociator(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2); CIndividualTermExpression* getFirstIndividualTermExpression(); CIndividualTermExpression* getSecondIndividualTermExpression(); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIRINDIVIDUALTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryIsInstanceOfExpression.cpp0000644000175000017500000000561212520550730030305 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryIsInstanceOfExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryIsInstanceOfExpression::CQueryIsInstanceOfExpression(const QString& name, CIndividualTermExpression *individualExp, CClassTermExpression *classExp) : CNameAssociator(name),CClassTermExpressionAssociator(classExp),CIndividualTermExpressionAssociator(individualExp) { mConstructedClassExp = nullptr; } CQueryIsInstanceOfExpression::~CQueryIsInstanceOfExpression() { } CBuildExpression::ExpressionType CQueryIsInstanceOfExpression::getType() { return BETISINSTANCEOF; } CClassTermExpression *CQueryIsInstanceOfExpression::getConstructedTestClassExpression() { return mConstructedClassExp; } CQueryIsInstanceOfExpression *CQueryIsInstanceOfExpression::setConstructedTestClassExpression(CClassTermExpression *conBuildExp) { mConstructedClassExp = conBuildExp; return this; } cint64 CQueryIsInstanceOfExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CClassTermExpressionAssociator::getStructuralHashValue(),CIndividualTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CQueryIsInstanceOfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryIsInstanceOfExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryIsInstanceOfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CIndividualTermExpression.cpp0000644000175000017500000000217112520550714027651 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualTermExpression.h" namespace Konclude { namespace Parser { namespace Expression { CIndividualTermExpression::CIndividualTermExpression() { } CIndividualTermExpression::~CIndividualTermExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectMinCardinalityExpression.cpp0000644000175000017500000000433212520550720030765 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectMinCardinalityExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectMinCardinalityExpression::CObjectMinCardinalityExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2, cint64 cardinality) : CObjectCardinalityExpression(expression1,expression2,cardinality) { } CObjectMinCardinalityExpression::~CObjectMinCardinalityExpression() { } CBuildExpression::ExpressionType CObjectMinCardinalityExpression::getType() { return BETOBJECTMINCARDINALITY; } cint64 CObjectMinCardinalityExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue(),CClassTermExpressionAssociator::getStructuralHashValue(),mCard); return hashValue; } bool CObjectMinCardinalityExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectMinCardinalityExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && compExpCast->mCard == mCard; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CClassTermExpression.h0000644000175000017500000000327712520550704026302 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CCLASSTERMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CCLASSTERMEXPRESSION_H // Libraries includes // Namespace includes #include "ExpressionSettings.h" #include "CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CClassTermExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassTermExpression : public CBuildExpression { // public methods public: //! Constructor CClassTermExpression(); // protected methods protected: // private methods private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CCLASSTERMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CAsymmetricObjectPropertyExpression.cpp0000644000175000017500000000470012520550702031737 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CAsymmetricObjectPropertyExpression.h" namespace Konclude { namespace Parser { namespace Expression { CAsymmetricObjectPropertyExpression::CAsymmetricObjectPropertyExpression(CObjectPropertyTermExpression *expression) : CObjectPropertyTermExpressionAssociator(expression) { } CAsymmetricObjectPropertyExpression::~CAsymmetricObjectPropertyExpression() { } CBuildExpression::ExpressionType CAsymmetricObjectPropertyExpression::getType() { return BETASYMMETRICPROPERTY; } CObjectPropertyTermExpression *CAsymmetricObjectPropertyExpression::getAsymmetricObjectPropertyExpression() { return getObjectPropertyTermExpression(); } cint64 CAsymmetricObjectPropertyExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CAsymmetricObjectPropertyExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CAsymmetricObjectPropertyExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CAsymmetricObjectPropertyExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryIsClassSubsumedByExpression.cpp0000644000175000017500000000576112520550730031331 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryIsClassSubsumedByExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryIsClassSubsumedByExpression::CQueryIsClassSubsumedByExpression(const QString& name, CClassTermExpression *subsummerClasss, CClassTermExpression *subsumedClass) : CNameAssociator(name),COrderedPairClassTermExpressionAssociator(subsummerClasss,subsumedClass) { } CQueryIsClassSubsumedByExpression::~CQueryIsClassSubsumedByExpression() { } CClassTermExpression* CQueryIsClassSubsumedByExpression::getSubsumerClassExpression() { return getFirstClassTermExpression(); } CClassTermExpression* CQueryIsClassSubsumedByExpression::getSubsumedClassExpression() { return getSecondClassTermExpression(); } CClassTermExpression *CQueryIsClassSubsumedByExpression::getConstructedTestClassExpression() { return mConstructedClassExp; } CQueryIsClassSubsumedByExpression *CQueryIsClassSubsumedByExpression::setConstructedTestClassExpression(CClassTermExpression *conBuildExp) { mConstructedClassExp = conBuildExp; return this; } CBuildExpression::ExpressionType CQueryIsClassSubsumedByExpression::getType() { return BETISCLASSSUBSUMTIONBY; } cint64 CQueryIsClassSubsumedByExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),COrderedPairClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CQueryIsClassSubsumedByExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryIsClassSubsumedByExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return COrderedPairClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryIsClassSubsumedByExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { COrderedPairClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CClassTermExpressionAssociator.cpp0000644000175000017500000000307612520550704030662 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CClassTermExpressionAssociator::CClassTermExpressionAssociator(CClassTermExpression *expression) : CExpressionAssociator(expression) { } CClassTermExpression* CClassTermExpressionAssociator::getClassTermExpression() { // bad cast to avoid lot of reimplementation return (CClassTermExpression*)getExpression(); } bool CClassTermExpressionAssociator::compareStructuralEquivalence(const CClassTermExpressionAssociator& classTermExpressionAssociator) { return CExpressionAssociator::compareStructuralEquivalence(classTermExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectAllValuesFromExpression.h0000644000175000017500000000460512520550720030242 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTALLVALUESFROMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTALLVALUESFROMEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassTermExpression.h" #include "CObjectPropertyTermExpression.h" #include "CClassTermExpressionAssociator.h" #include "CObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectAllValuesFromExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectAllValuesFromExpression : public CClassTermExpression, public CObjectPropertyTermExpressionAssociator, public CClassTermExpressionAssociator { // public methods public: //! Constructor CObjectAllValuesFromExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2); //! Destructor virtual ~CObjectAllValuesFromExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTALLVALUESFROMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryAreClassesDisjointExpression.cpp0000644000175000017500000000527612520550724031522 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryAreClassesDisjointExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryAreClassesDisjointExpression::CQueryAreClassesDisjointExpression(const QString& name, const CEXPRESSIONLIST& classTermExpList) : CNameAssociator(name),CListClassTermExpressionAssociator(classTermExpList) { } CQueryAreClassesDisjointExpression::~CQueryAreClassesDisjointExpression() { } CEXPRESSIONLIST* CQueryAreClassesDisjointExpression::getConstructedTestClasses() { return &mConstructedClassExpList; } CQueryAreClassesDisjointExpression *CQueryAreClassesDisjointExpression::addConstructedTestClass(CClassTermExpression *conBuildExp) { mConstructedClassExpList.append(conBuildExp); return this; } CBuildExpression::ExpressionType CQueryAreClassesDisjointExpression::getType() { return BETARECLASSESDISJOINT; } cint64 CQueryAreClassesDisjointExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CQueryAreClassesDisjointExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryAreClassesDisjointExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryAreClassesDisjointExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CPrecedentBuildClassExpression.h0000644000175000017500000000421512520550724030257 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CPRECEDENTBUILDCLASSEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CPRECEDENTBUILDCLASSEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassExpression.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Ontology; namespace Parser { namespace Expression { /*! * \class CPrecedentBuildClassExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CPrecedentBuildClassExpression : public CClassExpression { // public methods public: //! Constructor CPrecedentBuildClassExpression(QString className, CConcept *precedentBuildConcept); //! Destructor virtual ~CPrecedentBuildClassExpression(); virtual ExpressionType getType(); virtual CConcept *getPrecedentBuildConcept(); // protected methods protected: // protected variables protected: CConcept *concept; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CPRECEDENTBUILDCLASSEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CIndividualExpression.cpp0000644000175000017500000000214512520550714027022 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualExpression.h" namespace Konclude { namespace Parser { namespace Expression { CIndividualExpression::CIndividualExpression() { } CIndividualExpression::~CIndividualExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairIndividualTermExpressionAssociator.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairIndividualTermExpressionAssocia0000644000175000017500000000316012520550724032514 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COrderedPairIndividualTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { COrderedPairIndividualTermExpressionAssociator::COrderedPairIndividualTermExpressionAssociator(CIndividualTermExpression *expression1, CIndividualTermExpression *expression2) : COrderedPairExpressionAssociator(expression1,expression2) { } CIndividualTermExpression* COrderedPairIndividualTermExpressionAssociator::getFirstIndividualTermExpression() { return (CIndividualTermExpression*)getFirstExpression(); } CIndividualTermExpression* COrderedPairIndividualTermExpressionAssociator::getSecondIndividualTermExpression() { return (CIndividualTermExpression*)getSecondExpression(); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetTypesExpression.cpp0000644000175000017500000000461112520550730027522 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetTypesExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetTypesExpression::CQueryGetTypesExpression(const QString& name, bool direct, CIndividualTermExpression* individualTermExp) : CNameAssociator(name),CIndividualTermExpressionAssociator(individualTermExp),mDirect(direct) { } CQueryGetTypesExpression::~CQueryGetTypesExpression() { } CBuildExpression::ExpressionType CQueryGetTypesExpression::getType() { return BETGETTYPES; } cint64 CQueryGetTypesExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CIndividualTermExpressionAssociator::getStructuralHashValue(),(cint64)mDirect); return hashValue; } bool CQueryGetTypesExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryGetTypesExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } if (compExpCast->mDirect != mDirect) { return false; } return CIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryGetTypesExpression::isDirect() { return mDirect; } bool CQueryGetTypesExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectMaxCardinalityExpression.cpp0000644000175000017500000000433212520550720030767 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectMaxCardinalityExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectMaxCardinalityExpression::CObjectMaxCardinalityExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2, cint64 cardinality) : CObjectCardinalityExpression(expression1,expression2,cardinality) { } CObjectMaxCardinalityExpression::~CObjectMaxCardinalityExpression() { } CBuildExpression::ExpressionType CObjectMaxCardinalityExpression::getType() { return BETOBJECTMAXCARDINALITY; } cint64 CObjectMaxCardinalityExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue(),CClassTermExpressionAssociator::getStructuralHashValue(),mCard); return hashValue; } bool CObjectMaxCardinalityExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectMaxCardinalityExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && compExpCast->mCard == mCard; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyAxiomExpression.h0000644000175000017500000000351212520550722030346 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYAXIOMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYAXIOMEXPRESSION_H // Libraries includes #include // Namespace includes #include "CAxiomExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectPropertyAxiomExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectPropertyAxiomExpression : public CAxiomExpression { // public methods public: //! Constructor CObjectPropertyAxiomExpression(); //! Destructor virtual ~CObjectPropertyAxiomExpression(); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYAXIOMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryIsClassSubsumedByExpression.h0000644000175000017500000000535212520550730030772 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYISCLASSSUBSUMEDBYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYISCLASSSUBSUMEDBYEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "COrderedPairClassTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryIsClassSubsumedByExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryIsClassSubsumedByExpression : public CQueryExpression, public COrderedPairClassTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryIsClassSubsumedByExpression(const QString& name, CClassTermExpression *subsummerClasss, CClassTermExpression *subsumedClass); //! Destructor virtual ~CQueryIsClassSubsumedByExpression(); virtual ExpressionType getType(); virtual CClassTermExpression* getSubsumerClassExpression(); virtual CClassTermExpression* getSubsumedClassExpression(); virtual CClassTermExpression* getConstructedTestClassExpression(); virtual CQueryIsClassSubsumedByExpression *setConstructedTestClassExpression(CClassTermExpression *conBuildExp); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: CClassTermExpression* mConstructedClassExp; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQueryIsClassSubsumedByExpression_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectHasSelfExpression.cpp0000644000175000017500000000426212520550720027405 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectHasSelfExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectHasSelfExpression::CObjectHasSelfExpression(CObjectPropertyTermExpression *expression1) : CObjectPropertyTermExpressionAssociator(expression1) { } CObjectHasSelfExpression::~CObjectHasSelfExpression() { } CBuildExpression::ExpressionType CObjectHasSelfExpression::getType() { return BETOBJECTHASSELF; } cint64 CObjectHasSelfExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CObjectHasSelfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectHasSelfExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CObjectHasSelfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListDataPropertyTermExpressionAssociator.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListDataPropertyTermExpressionAssociator.c0000644000175000017500000000361412520550716032530 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CListDataPropertyTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CListDataPropertyTermExpressionAssociator::CListDataPropertyTermExpressionAssociator(CDataPropertyTermExpression *expression1, CDataPropertyTermExpression *expression2, CDataPropertyTermExpression *expression3) : CListExpressionAssociator(expression1,expression2,expression3) { } CListDataPropertyTermExpressionAssociator::CListDataPropertyTermExpressionAssociator(const CEXPRESSIONLIST& expressionList) : CListExpressionAssociator(*(CEXPRESSIONLIST*)&expressionList) { } CListDataPropertyTermExpressionAssociator::~CListDataPropertyTermExpressionAssociator() { } CEXPRESSIONLIST* CListDataPropertyTermExpressionAssociator::getDataPropertyTermExpressionList() { // bad cast to avoid lot of reimplementation return (CEXPRESSIONLIST*)&mExpressionList; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListDataFacetRestrictionExpressionAssociator.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListDataFacetRestrictionExpressionAssociat0000644000175000017500000000434212520550716032541 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CListDataFacetRestrictionExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CListDataFacetRestrictionExpressionAssociator::CListDataFacetRestrictionExpressionAssociator(CDataFacetRestrictionExpression *expression1, CDataFacetRestrictionExpression *expression2, CDataFacetRestrictionExpression *expression3) : CListExpressionAssociator(expression1,expression2,expression3) { } CListDataFacetRestrictionExpressionAssociator::CListDataFacetRestrictionExpressionAssociator(const CEXPRESSIONLIST& expressionList) : CListExpressionAssociator(*(CEXPRESSIONLIST*)&expressionList) { } CListDataFacetRestrictionExpressionAssociator::~CListDataFacetRestrictionExpressionAssociator() { } CEXPRESSIONLIST* CListDataFacetRestrictionExpressionAssociator::getDataFacetRestrictionExpressionList() { // bad cast to avoid lot of reimplementation return (CEXPRESSIONLIST*)&mExpressionList; } bool CListDataFacetRestrictionExpressionAssociator::compareStructuralEquivalence(const CListDataFacetRestrictionExpressionAssociator& listClassTermExpressionAssociator) { return CListExpressionAssociator::compareStructuralEquivalence(listClassTermExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CSameIndividualExpression.cpp0000644000175000017500000000466212520550732027636 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSameIndividualExpression.h" namespace Konclude { namespace Parser { namespace Expression { CSameIndividualExpression::CSameIndividualExpression(CIndividualTermExpression *expression1, CIndividualTermExpression *expression2) : CListIndividualTermExpressionAssociator(expression1,expression2) { } CSameIndividualExpression::CSameIndividualExpression(const CEXPRESSIONLIST& expressionList) : CListIndividualTermExpressionAssociator(expressionList) { } CSameIndividualExpression::~CSameIndividualExpression() { } CBuildExpression::ExpressionType CSameIndividualExpression::getType() { return BETSAMEINDIVIDUAL; } cint64 CSameIndividualExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListIndividualTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CSameIndividualExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CSameIndividualExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CSameIndividualExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListRuleAtomTermExpressionAssociator.cpp0000644000175000017500000000412712520550716032202 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CListRuleAtomTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CListRuleAtomTermExpressionAssociator::CListRuleAtomTermExpressionAssociator(CRuleAtomTermExpression *expression1, CRuleAtomTermExpression *expression2, CClassTermExpression *expression3) : CListExpressionAssociator(expression1,expression2,expression3) { } CListRuleAtomTermExpressionAssociator::CListRuleAtomTermExpressionAssociator(const CEXPRESSIONLIST& expressionList) : CListExpressionAssociator(*(CEXPRESSIONLIST*)&expressionList) { } CListRuleAtomTermExpressionAssociator::~CListRuleAtomTermExpressionAssociator() { } CEXPRESSIONLIST* CListRuleAtomTermExpressionAssociator::getRuleAtomTermExpressionList() { // bad cast to avoid lot of reimplementation return (CEXPRESSIONLIST*)&mExpressionList; } bool CListRuleAtomTermExpressionAssociator::compareStructuralEquivalence(const CListRuleAtomTermExpressionAssociator& listClassTermExpressionAssociator) { return CListExpressionAssociator::compareStructuralEquivalence(listClassTermExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CInverseObjectPropertiesExpression.h0000644000175000017500000000453112520550714031217 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CINVERSEOBJECTPROPERTIESEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CINVERSEOBJECTPROPERTIESEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyAxiomExpression.h" #include "CUnorderedPairObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CInverseObjectPropertiesExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CInverseObjectPropertiesExpression : public CObjectPropertyAxiomExpression, public CUnorderedPairObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CInverseObjectPropertiesExpression(CObjectPropertyTermExpression *expression1, CObjectPropertyTermExpression *expression2); //! Destructor virtual ~CInverseObjectPropertiesExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CINVERSEOBJECTPROPERTIESEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRuleAtomListBodyExpression.h0000644000175000017500000000417312520550730027602 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CRULEATOMLISTBODYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CRULEATOMLISTBODYEXPRESSION_H // Libraries includes // Namespace includes #include "ExpressionSettings.h" #include "CRuleAtomListExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CRuleAtomListBodyExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRuleAtomListBodyExpression : public CRuleAtomListExpression { // public methods public: //! Constructor CRuleAtomListBodyExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CRuleAtomListBodyExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CRULEATOMLISTBODYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataPropertyDomainExpression.h0000644000175000017500000000453612520550710030147 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYDOMAINEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYDOMAINEXPRESSION_H // Libraries includes #include // Namespace includes #include "CDataPropertyAxiomExpression.h" #include "CDataPropertyTermExpressionAssociator.h" #include "CClassTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDataPropertyDomainExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDataPropertyDomainExpression : public CDataPropertyAxiomExpression, public CDataPropertyTermExpressionAssociator, public CClassTermExpressionAssociator { // public methods public: //! Constructor CDataPropertyDomainExpression(CDataPropertyTermExpression *expression1, CClassTermExpression *expression2); //! Destructor virtual ~CDataPropertyDomainExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYDOMAINEXPRESSION_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataFacetRestrictionExpressionAssociator.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataFacetRestrictionExpressionAssociator.c0000644000175000017500000000341612520550706032467 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataFacetRestrictionExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CDataFacetRestrictionExpressionAssociator::CDataFacetRestrictionExpressionAssociator(CDataFacetRestrictionExpression *expression) : CExpressionAssociator(expression) { } CDataFacetRestrictionExpressionAssociator::~CDataFacetRestrictionExpressionAssociator() { } CDataFacetRestrictionExpression* CDataFacetRestrictionExpressionAssociator::getDataFacetRestrictionExpression() { // bad cast to avoid lot of reimplementation return (CDataFacetRestrictionExpression*)getExpression(); } bool CDataFacetRestrictionExpressionAssociator::compareStructuralEquivalence(const CDataFacetRestrictionExpressionAssociator& datatypeExpressionAssociator) { return CExpressionAssociator::compareStructuralEquivalence(datatypeExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CUnorderedPairClassTermExpressionAssociator.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CUnorderedPairClassTermExpressionAssociator0000644000175000017500000000440112520550732032557 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CUNORDEREDPAIRCLASSTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CUNORDEREDPAIRCLASSTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CClassTermExpression.h" #include "CUnorderedPairExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CUnorderedPairClassTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CUnorderedPairClassTermExpressionAssociator : public CUnorderedPairExpressionAssociator { // public methods public: //! Constructor CUnorderedPairClassTermExpressionAssociator(CClassTermExpression* expression1, CClassTermExpression* expression2); //! Destructor virtual ~CUnorderedPairClassTermExpressionAssociator(); CClassTermExpression* getFirstClassTermExpression(); CClassTermExpression* getSecondClassTermExpression(); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CUNORDEREDPAIRCLASSTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataPropertyRangeExpression.h0000644000175000017500000000454312520550710027772 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYRANGEEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYRANGEEXPRESSION_H // Libraries includes #include // Namespace includes #include "CDataPropertyAxiomExpression.h" #include "CDataPropertyTermExpressionAssociator.h" #include "CDataRangeTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDataPropertyRangeExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDataPropertyRangeExpression : public CDataPropertyAxiomExpression, public CDataPropertyTermExpressionAssociator, public CDataRangeTermExpressionAssociator { // public methods public: //! Constructor CDataPropertyRangeExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2); //! Destructor virtual ~CDataPropertyRangeExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDataPropertyRangeExpression_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataLexicalValueExpressionAssociator.h0000644000175000017500000000440212520550706031576 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATALEXICALVALUEEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CDATALEXICALVALUEEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CDataLexicalValueExpression.h" #include "CExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDataLexicalValueExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataLexicalValueExpressionAssociator : public CExpressionAssociator { // public methods public: //! Constructor CDataLexicalValueExpressionAssociator(CDataLexicalValueExpression* expression = nullptr); //! Destructor virtual ~CDataLexicalValueExpressionAssociator(); CDataLexicalValueExpression* getDataLexicalValueExpression(); virtual bool compareStructuralEquivalence(const CDataLexicalValueExpressionAssociator& dataLexicalValueExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATALEXICALVALUEEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataExactCardinalityExpression.cpp0000644000175000017500000000433612520550704030757 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataExactCardinalityExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataExactCardinalityExpression::CDataExactCardinalityExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2, cint64 cardinality) : CDataCardinalityExpression(expression1,expression2,cardinality) { } CDataExactCardinalityExpression::~CDataExactCardinalityExpression() { } CBuildExpression::ExpressionType CDataExactCardinalityExpression::getType() { return BETDATAEXACTCARDINALITY; } cint64 CDataExactCardinalityExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDataPropertyTermExpressionAssociator::getStructuralHashValue(),CDataRangeTermExpressionAssociator::getStructuralHashValue(),mCard); return hashValue; } bool CDataExactCardinalityExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataExactCardinalityExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDataPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CDataRangeTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && compExpCast->mCard == mCard; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairDataPropertyTermExpressionAssociator.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairDataPropertyTermExpressionAssoc0000644000175000017500000000452112520550722032530 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIRDATAPROPERTYTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIRDATAPROPERTYTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CDataPropertyTermExpression.h" #include "COrderedPairExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class COrderedPairDataPropertyTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COrderedPairDataPropertyTermExpressionAssociator : public COrderedPairExpressionAssociator { // public methods public: //! Constructor COrderedPairDataPropertyTermExpressionAssociator(CDataPropertyTermExpression* expression1, CDataPropertyTermExpression* expression2); //! Destructor virtual ~COrderedPairDataPropertyTermExpressionAssociator(); CDataPropertyTermExpression* getFirstDataPropertyTermExpression(); CDataPropertyTermExpression* getSecondDataPropertyTermExpression(); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CORDEREDPAIRDATAPROPERTYTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectExpression.cpp0000644000175000017500000000211712520550720026134 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectExpression::CObjectExpression() { } CObjectExpression::~CObjectExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CPairExpressionAssociator.cpp0000644000175000017500000000627012520550724027661 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPairExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CPairExpressionAssociator::CPairExpressionAssociator(CBuildExpression *expression1, CBuildExpression *expression2) : mFirstExpression(expression1),mSecondExpression(expression2) { } CPairExpressionAssociator* CPairExpressionAssociator::setFirstExpression(CBuildExpression *expression1) { mFirstExpression = expression1; return this; } CBuildExpression *CPairExpressionAssociator::getFirstExpression() const { return mFirstExpression; } CPairExpressionAssociator* CPairExpressionAssociator::setSecondExpression(CBuildExpression *expression2) { mSecondExpression = expression2; return this; } CBuildExpression *CPairExpressionAssociator::getSecondExpression() const { return mSecondExpression; } cint64 CPairExpressionAssociator::getStructuralHashValue() { cint64 hashValue = 0; cint64 tmpValue1 = 0; cint64 tmpValue2 = 1; if (mFirstExpression) { tmpValue1 += cint64(mFirstExpression); tmpValue2 *= cint64(mFirstExpression); } if (mSecondExpression) { tmpValue1 += cint64(mSecondExpression); tmpValue2 *= cint64(mSecondExpression); } hashValue = tmpValue1*tmpValue2; return hashValue; } bool CPairExpressionAssociator::compareStructuralEquivalence(const CPairExpressionAssociator& pairExpressionAssociator) { if (mFirstExpression != pairExpressionAssociator.mFirstExpression) { if (mFirstExpression != pairExpressionAssociator.mSecondExpression) { return false; } if (mSecondExpression != pairExpressionAssociator.mFirstExpression) { return false; } } else { if (mSecondExpression != pairExpressionAssociator.mSecondExpression) { return false; } } return true; } bool CPairExpressionAssociator::visitSubExpressions(CBuildExpression* expression, CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { if (mFirstExpression) { subExpressionVisitor->visitSubExpression(expression,mFirstExpression,subExpressionVisitor); } if (mSecondExpression) { subExpressionVisitor->visitSubExpression(expression,mSecondExpression,subExpressionVisitor); } return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CNameExpression.cpp0000644000175000017500000000236612520550716025621 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNameExpression.h" namespace Konclude { namespace Parser { namespace Expression { CNameExpression::CNameExpression(QString newName) { name = newName; } CNameExpression::~CNameExpression() { } void CNameExpression::setName(QString newName) { name = newName; } QString CNameExpression::getName() { return name; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataFacetRestrictionExpression.cpp0000644000175000017500000000505512520550706031000 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataFacetRestrictionExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataFacetRestrictionExpression::CDataFacetRestrictionExpression(CDataLiteralExpression* dataLiteralExpression, CDataFacetExpression* dataFacetExpression) : CDataLiteralExpressionAssociator(dataLiteralExpression),CDataFacetExpressionAssociator(dataFacetExpression) { } CDataFacetRestrictionExpression::~CDataFacetRestrictionExpression() { } CBuildExpression::ExpressionType CDataFacetRestrictionExpression::getType() { return BETDATAFACETRESTRICION; } cint64 CDataFacetRestrictionExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDataLiteralExpressionAssociator::getStructuralHashValue(),CDataFacetExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDataFacetRestrictionExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataFacetRestrictionExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDataFacetExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CDataLiteralExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CDataFacetRestrictionExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CDataLiteralExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CDataFacetExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CSubDataPropertyOfExpression.cpp0000644000175000017500000000527112520550732030312 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSubDataPropertyOfExpression.h" namespace Konclude { namespace Parser { namespace Expression { CSubDataPropertyOfExpression::CSubDataPropertyOfExpression(CDataPropertyTermExpression *subObjectPropertyExpression1, CDataPropertyTermExpression *superbObjectPropertyExpression2) : COrderedPairDataPropertyTermExpressionAssociator(subObjectPropertyExpression1,superbObjectPropertyExpression2) { } CSubDataPropertyOfExpression::~CSubDataPropertyOfExpression() { } CDataPropertyTermExpression* CSubDataPropertyOfExpression::getSubDataPropertyTermExpression() { return getFirstDataPropertyTermExpression(); } CDataPropertyTermExpression* CSubDataPropertyOfExpression::getSuperDataPropertyTermExpression() { return getSecondDataPropertyTermExpression(); } CBuildExpression::ExpressionType CSubDataPropertyOfExpression::getType() { return BETSUBDATAPROPERTYOF; } cint64 CSubDataPropertyOfExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),COrderedPairDataPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CSubDataPropertyOfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CSubDataPropertyOfExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return COrderedPairDataPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CSubDataPropertyOfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { COrderedPairDataPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetEquivalentClassesExpression.cpp0000644000175000017500000000447512520550726032066 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetEquivalentClassesExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetEquivalentClassesExpression::CQueryGetEquivalentClassesExpression(const QString& name, CClassTermExpression* classTermExp) : CNameAssociator(name),CClassTermExpressionAssociator(classTermExp) { } CQueryGetEquivalentClassesExpression::~CQueryGetEquivalentClassesExpression() { } CBuildExpression::ExpressionType CQueryGetEquivalentClassesExpression::getType() { return BETGETEQUIVALENTCLASSES; } cint64 CQueryGetEquivalentClassesExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CQueryGetEquivalentClassesExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryGetEquivalentClassesExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryGetEquivalentClassesExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CClassAxiomExpression.h0000644000175000017500000000335412520550704026444 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CCLASSAXIOMEXPRESSION_H #define KONCLUDE_PARSER_CCLASSAXIOMEXPRESSION_H // Libraries includes #include // Namespace includes #include "CAxiomExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CClassAxiomExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CClassAxiomExpression : public CAxiomExpression { // public methods public: //! Constructor CClassAxiomExpression(); //! Destructor virtual ~CClassAxiomExpression(); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CCLASSAXIOMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataPropertyTermExpression.h0000644000175000017500000000350412520550710027641 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYTERMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYTERMEXPRESSION_H // Libraries includes #include // Namespace includes #include "CPropertyTermExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDataPropertyTermExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDataPropertyTermExpression : public CPropertyTermExpression { // public methods public: //! Constructor CDataPropertyTermExpression(); //! Destructor virtual ~CDataPropertyTermExpression(); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYTERMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetSuperClassesExpression.cpp0000644000175000017500000000470112520550730031032 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetSuperClassesExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetSuperClassesExpression::CQueryGetSuperClassesExpression(const QString& name, bool direct, CClassTermExpression* classTermExp) : CNameAssociator(name),CClassTermExpressionAssociator(classTermExp),mDirect(direct) { } CQueryGetSuperClassesExpression::~CQueryGetSuperClassesExpression() { } CBuildExpression::ExpressionType CQueryGetSuperClassesExpression::getType() { return BETGETSUPERCLASSES; } cint64 CQueryGetSuperClassesExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CClassTermExpressionAssociator::getStructuralHashValue(),(cint64)mDirect); return hashValue; } bool CQueryGetSuperClassesExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryGetSuperClassesExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } if (compExpCast->mDirect != mDirect) { return false; } return CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryGetSuperClassesExpression::isDirect() { return mDirect; } bool CQueryGetSuperClassesExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDisjointDataPropertiesExpression.cpp0000644000175000017500000000514612520550712031366 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDisjointDataPropertiesExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDisjointDataPropertiesExpression::CDisjointDataPropertiesExpression(CDataPropertyTermExpression *expression1, CDataPropertyTermExpression *expression2, CDataPropertyTermExpression *expression3) : CListDataPropertyTermExpressionAssociator(expression1,expression2,expression3) { } CDisjointDataPropertiesExpression::CDisjointDataPropertiesExpression(const CEXPRESSIONLIST& expressionList) : CListDataPropertyTermExpressionAssociator(expressionList) { } CDisjointDataPropertiesExpression::~CDisjointDataPropertiesExpression() { } cint64 CDisjointDataPropertiesExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListDataPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDisjointDataPropertiesExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDisjointDataPropertiesExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListDataPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } CBuildExpression::ExpressionType CDisjointDataPropertiesExpression::getType() { return BETDISJOINTDATAPROPERTIES; } bool CDisjointDataPropertiesExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListDataPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryAreClassesDisjointExpression.h0000644000175000017500000000515212520550724031160 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYARECLASSESDISJOINTEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYARECLASSESDISJOINTEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CListClassTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryAreClassesDisjointExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryAreClassesDisjointExpression : public CQueryExpression, public CListClassTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryAreClassesDisjointExpression(const QString& name, const CEXPRESSIONLIST& classTermExpList); //! Destructor virtual ~CQueryAreClassesDisjointExpression(); virtual CEXPRESSIONLIST* getConstructedTestClasses(); virtual CQueryAreClassesDisjointExpression *addConstructedTestClass(CClassTermExpression *conBuildExp); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: CEXPRESSIONLIST mConstructedClassExpList; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYARECLASSESDISJOINTEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectIntersectionOfExpression.cpp0000644000175000017500000000473412520550720031017 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectIntersectionOfExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectIntersectionOfExpression::CObjectIntersectionOfExpression(CClassTermExpression *expression1, CClassTermExpression *expression2) : CListClassTermExpressionAssociator(expression1,expression2) { } CObjectIntersectionOfExpression::CObjectIntersectionOfExpression(const CEXPRESSIONLIST& expressionList) : CListClassTermExpressionAssociator(expressionList) { } CObjectIntersectionOfExpression::~CObjectIntersectionOfExpression() { } CBuildExpression::ExpressionType CObjectIntersectionOfExpression::getType() { return BETOBJECTINTERSECTION; } cint64 CObjectIntersectionOfExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CObjectIntersectionOfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectIntersectionOfExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CObjectIntersectionOfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataPropertyTermExpressionAssociator.h0000644000175000017500000000437212520550710031675 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CDataPropertyTermExpression.h" #include "CExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDataPropertyTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataPropertyTermExpressionAssociator : public CExpressionAssociator { // public methods public: //! Constructor CDataPropertyTermExpressionAssociator(CDataPropertyTermExpression* expression = nullptr); //! Destructor virtual ~CDataPropertyTermExpressionAssociator(); CDataPropertyTermExpression* getDataPropertyTermExpression(); virtual bool compareStructuralEquivalence(const CDataPropertyTermExpressionAssociator& dataTermExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDisjointClassesExpression.h0000644000175000017500000000434112520550712027476 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDISJOINTCLASSESEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDISJOINTCLASSESEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassAxiomExpression.h" #include "CListClassTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDisjointClassesExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDisjointClassesExpression : public CClassAxiomExpression, public CListClassTermExpressionAssociator { // public methods public: //! Constructor CDisjointClassesExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CDisjointClassesExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDISJOINTCLASSESEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CBuildExpression.h0000644000175000017500000001063312520550704025436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CBUILDEXPRESSION_H #define KONCLUDE_PARSER_CBUILDEXPRESSION_H // Libraries includes // Namespace includes #include "ExpressionSettings.h" #include "CExpressionHashMixer.h" #include "CSubExpressionVisitor.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CBuildExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CBuildExpression { // public methods public: //! Constructor CBuildExpression(); enum ExpressionType { BETCLASS, BETOBJECTPROPERTY, BETEQUIVALENTCLASSES, BETESUBCLASSOF, BETDISJOINTUNION, BETDISJOINTCLASSES, BETOBJECTSOMEVALUEFROM, BETOBJECTINTERSECTION, BETOBJECTALLVALUEFROM, BETOBJECTEXACTLYCARDINALITY, BETOBJECTHASSELF, BETOBJECTMINCARDINALITY, BETOBJECTMAXCARDINALITY, BETOBJECTCOMPLEMENTOF, BETOBJECTUNION, BETOBJECTONEOF, BETOBJECTHASVALUE, BETSUBOBJECTPROPERTYOF, BETTRANSETIVEPROPERTYOF, BETINVERSEOBJECTPROPERTYOF, BETFUNCTIONALPROPERTYOF, BETOBJECTPROPERTYDOMAIN, BETOBJECTPROPERTYRANGE, BETFUNCTIONALOBJECTPROPERTY, BETTRANSITIVEOBJECTPROPERTY, BETINVERSEOBJECTPROPERTIES, BETEQUIVALENTOBJECTPROPERTIES, BETSYMMETRICPROPERTY, BETASYMMETRICPROPERTY, BETREFLEXIVEPROPERTY, BETIRREFLEXIVEPROPERTY, BETOBJECTPROPERTYCHAIN, BETDISJOINTOBJECTPROPERTIES, BETINVERSEFUNCTIONALPROPERTY, BETCLASSASSERTION, BETOBJECTPROPERTYASSERTION, BETSAMEINDIVIDUAL, BETDIFFERENTINDIVIDUAL, BETNEGATIVEOBJECTPROPERTYASSERTION, BETNAMEDINDIVIDUAL, BETANONYMOUSINDIVIDUAL, BETINDIVIDUALVARIABLE, BETISCLASSSATISFIABLE, BETARECLASSESEQUIVALENCE, BETISCLASSSUBSUMTIONBY, BETARECLASSESDISJOINT, BETISINSTANCEOF, BETPRECEDENTCLASSBUILD, BETPRECEDENTPROPERTYBUILD, BETPRECEDENTINDIVIDUALBUILD, BETGETFLATTENEDTYPES, BETGETFLATTENEDINDIVIDUALS, BETGETINDIVIDUALS, BETGETTYPES, BETGETSUBCLASSES, BETGETSUPERCLASSES, BETGETEQUIVALENTCLASSES, BETISENTAILED, BETGETOBJECTPROPERTYTARGETS, BETGETFLATTENEDOBJECTPROPERTYTARGETS, BETGETSAMEINDIVIDUALS, BETGETDETERMINISTICCLASSASSERTIONS, BETGETNONDETERMINISTICCLASSASSERTIONS, BETGETNONDETERMINISTICINDIVIDUALS, BETGETDETERMINISTICINDIVIDUALS, BETDATATYPE, BETDATALEXICALVALUE, BETDATALITERAL, BETDATAPROPERTY, BETDATAINTERSECTIONOF, BETDATAUNIONOF, BETDATACOMPLEMENTOF, BETDATAONEOF, BETDATAFACETIRI, BETDATAFACETRESTRICION, BETDATATYPERESTRICTION, BETDATASOMEVALUEFROM, BETDATAHASVALUE, BETDATAALLVALUEFROM, BETDATAMINCARDINALITY, BETDATAMAXCARDINALITY, BETDATAEXACTCARDINALITY, BETDATAPROPERTYDOMAIN, BETDATAPROPERTYRANGE, BETSUBDATAPROPERTYOF, BETDISJOINTDATAPROPERTIES, BETEQUIVALENTDATAPROPERTIES, BETFUNCTIONALDATAPROPERTY, BETDATAPROPERTYASSERTION, BETNEGATIVEDATAPROPERTYASSERTION, BETDECLARATION, BETRULECLASSATOM, BETRULEPROPERTYATOM, BETRULEDIFFERENTINDIVIDUALSATOM, BETRULEATOMBODYLIST, BETRULEATOMHEADLIST }; virtual ExpressionType getType() = 0; virtual cint64 getStructuralHashValue() = 0; virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression) = 0; virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CBUILDEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CInverseObjectPropertyOfExpression.h0000644000175000017500000000454312520550714031177 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CINVERSEPROPERTYOFEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CINVERSEPROPERTYOFEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyAxiomExpression.h" #include "CObjectPropertyTermExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CInverseObjectPropertyOfExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CInverseObjectPropertyOfExpression : public CObjectPropertyTermExpression, public CObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CInverseObjectPropertyOfExpression(CObjectPropertyTermExpression *expression); //! Destructor virtual ~CInverseObjectPropertyOfExpression(); CObjectPropertyTermExpression *getInverseOfExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CINVERSEPROPERTYOFEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryExpression.h0000644000175000017500000000340112520550724025501 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYEXPRESSION_H // Libraries includes // Namespace includes #include "CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryExpression : public CBuildExpression { // public methods public: //! Constructor CQueryExpression(); //! Destructor virtual ~CQueryExpression(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYEXPRESSION_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CNegativeObjectPropertyAssertionExpression.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CNegativeObjectPropertyAssertionExpression.0000644000175000017500000000512112520550720032547 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CNEGATIVEOBJECTPROPERTYASSERTIONEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CNEGATIVEOBJECTPROPERTYASSERTIONEXPRESSION_H // Libraries includes #include // Namespace includes #include "CAssertionAxiomExpression.h" #include "COrderedPairIndividualTermExpressionAssociator.h" #include "CObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CNegativeObjectPropertyAssertionExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNegativeObjectPropertyAssertionExpression : public CAssertionAxiomExpression, public COrderedPairIndividualTermExpressionAssociator, public CObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CNegativeObjectPropertyAssertionExpression(CObjectPropertyTermExpression *propertyExpression1, CIndividualTermExpression *sourceExpression2, CIndividualTermExpression *targetExpression3); //! Destructor virtual ~CNegativeObjectPropertyAssertionExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CNEGATIVEOBJECTPROPERTYASSERTIONEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CReflexiveObjectPropertyExpression.h0000644000175000017500000000463212520550730031225 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CREFLEXIVEOBJECTPROPERTYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CREFLEXIVEOBJECTPROPERTYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyAxiomExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CReflexiveObjectPropertyExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CReflexiveObjectPropertyExpression : public CObjectPropertyAxiomExpression, public CObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CReflexiveObjectPropertyExpression(CObjectPropertyTermExpression *expression); //! Destructor virtual ~CReflexiveObjectPropertyExpression(); CObjectPropertyTermExpression *getReflexiveObjectPropertyExpression(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual ExpressionType getType(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CREFLEXIVEOBJECTPROPERTYEXPRESSION_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetDeterministicIndividualsExpression.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetDeterministicIndividualsExpression0000644000175000017500000000476612520550726032654 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYGETDETERMINISTICINDIVIDUALSEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYGETDETERMINISTICINDIVIDUALSEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CListIndividualTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetDeterministicIndividualsExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetDeterministicIndividualsExpression : public CQueryExpression, public CListIndividualTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryGetDeterministicIndividualsExpression(const QString& name); CQueryGetDeterministicIndividualsExpression(const QString& name, const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CQueryGetDeterministicIndividualsExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYGETDETERMINISTICINDIVIDUALSEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CAssertionAxiomExpression.h0000644000175000017500000000342312520550702027341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CASSERTIONEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CASSERTIONEXPRESSION_H // Libraries includes #include // Namespace includes #include "CAxiomExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CAssertionAxiomExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAssertionAxiomExpression : public CAxiomExpression { // public methods public: //! Constructor CAssertionAxiomExpression(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CASSERTIONEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetSameIndividualsExpression.cpp0000644000175000017500000000447412520550726031513 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetSameIndividualsExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetSameIndividualsExpression::CQueryGetSameIndividualsExpression(const QString& name, CIndividualTermExpression* indiTermExp) : CNameAssociator(name),CIndividualTermExpressionAssociator(indiTermExp) { } CQueryGetSameIndividualsExpression::~CQueryGetSameIndividualsExpression() { } CBuildExpression::ExpressionType CQueryGetSameIndividualsExpression::getType() { return BETGETSAMEINDIVIDUALS; } cint64 CQueryGetSameIndividualsExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CIndividualTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CQueryGetSameIndividualsExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryGetSameIndividualsExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryGetSameIndividualsExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListDataRangeTermExpressionAssociator.h0000644000175000017500000000475312520550716031752 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CLISTDATARANGETERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CLISTDATARANGETERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CDataRangeTermExpression.h" #include "CListExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CListDataRangeTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CListDataRangeTermExpressionAssociator : public CListExpressionAssociator { // public methods public: //! Constructor CListDataRangeTermExpressionAssociator(CDataRangeTermExpression* expression1 = nullptr, CDataRangeTermExpression* expression2 = nullptr, CDataRangeTermExpression* expression3 = nullptr); CListDataRangeTermExpressionAssociator(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CListDataRangeTermExpressionAssociator(); CEXPRESSIONLIST* getDataRangeTermExpressionList(); virtual bool compareStructuralEquivalence(const CListDataRangeTermExpressionAssociator& listClassTermExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CLISTDATARANGETERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDatatypeExpression.cpp0000644000175000017500000000365212520550710026505 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDatatypeExpression::CDatatypeExpression(const QString& dataTypeIRI) : CExpressionEntity(dataTypeIRI) { } CDatatypeExpression::~CDatatypeExpression() { } CBuildExpression::ExpressionType CDatatypeExpression::getType() { return BETDATATYPE; } cint64 CDatatypeExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType()); return hashValue; } bool CDatatypeExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDatatypeExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return true; } bool CDatatypeExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { subExpressionVisitor->visitEntity(this,this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRuleClassAtomTermExpression.cpp0000644000175000017500000000500712520550730030276 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRuleClassAtomTermExpression.h" namespace Konclude { namespace Parser { namespace Expression { CRuleClassAtomTermExpression::CRuleClassAtomTermExpression(CClassTermExpression* expression1, CObjectIndividualVariableExpression* expression2) : CClassTermExpressionAssociator(expression1),CClassVariableTermExpressionAssociator(expression2) { } CRuleClassAtomTermExpression::~CRuleClassAtomTermExpression() { } CBuildExpression::ExpressionType CRuleClassAtomTermExpression::getType() { return BETRULECLASSATOM; } cint64 CRuleClassAtomTermExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CClassTermExpressionAssociator::getStructuralHashValue(),CClassVariableTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CRuleClassAtomTermExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CRuleClassAtomTermExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CClassVariableTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CRuleClassAtomTermExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CClassVariableTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDatatypeExpressionAssociator.cpp0000644000175000017500000000317612520550710030536 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CDatatypeExpressionAssociator::CDatatypeExpressionAssociator(CDatatypeExpression *expression) : CExpressionAssociator(expression) { } CDatatypeExpressionAssociator::~CDatatypeExpressionAssociator() { } CDatatypeExpression* CDatatypeExpressionAssociator::getDatatypeExpression() { // bad cast to avoid lot of reimplementation return (CDatatypeExpression*)getExpression(); } bool CDatatypeExpressionAssociator::compareStructuralEquivalence(const CDatatypeExpressionAssociator& datatypeExpressionAssociator) { return CExpressionAssociator::compareStructuralEquivalence(datatypeExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CCardinalityAssociator.h0000644000175000017500000000361112520550704026610 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CCARDINALITYASSOCIATOR_H #define KONCLUDE_PARSER_CCARDINALITYASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CCardinalityAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CCardinalityAssociator { // public methods public: //! Constructor CCardinalityAssociator(cint64 cardinality); //! Destructor virtual ~CCardinalityAssociator(); CCardinalityAssociator* setCardinality(cint64 cardinality); cint64 getCardinality(); // protected methods protected: // protected variables protected: cint64 mCard; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CCARDINALITYASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CSymmetricObjectPropertyExpression.h0000644000175000017500000000463212520550732031252 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CSYMMETRICOBJECTPROPERTYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CSYMMETRICOBJECTPROPERTYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyAxiomExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CSymmetricObjectPropertyExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CSymmetricObjectPropertyExpression : public CObjectPropertyAxiomExpression, public CObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CSymmetricObjectPropertyExpression(CObjectPropertyTermExpression *expression); //! Destructor virtual ~CSymmetricObjectPropertyExpression(); CObjectPropertyTermExpression *getSymmetricObjectPropertyExpression(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual ExpressionType getType(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CSYMMETRICOBJECTPROPERTYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDisjointUnionExpression.h0000644000175000017500000000450112520550712027167 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDISJOINTUNIONEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDISJOINTUNIONEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassAxiomExpression.h" #include "CListClassTermExpressionAssociator.h" #include "CClassExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDisjointUnionExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDisjointUnionExpression : public CClassAxiomExpression, public CClassExpressionAssociator, public CListClassTermExpressionAssociator { // public methods public: //! Constructor CDisjointUnionExpression(CClassExpression* classExpression, const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CDisjointUnionExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDISJOINTUNIONEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CSameIndividualExpression.h0000644000175000017500000000453212520550732027277 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CSAMEINDIVIDUALEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CSAMEINDIVIDUALEXPRESSION_H // Libraries includes #include // Namespace includes #include "CAssertionAxiomExpression.h" #include "CListIndividualTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CSameIndividualExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CSameIndividualExpression : public CAssertionAxiomExpression, public CListIndividualTermExpressionAssociator { // public methods public: //! Constructor CSameIndividualExpression(CIndividualTermExpression *expression1 = 0, CIndividualTermExpression *expression2 = 0); CSameIndividualExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CSameIndividualExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CSAMEINDIVIDUALEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataRangeTermExpressionAssociator.cpp0000644000175000017500000000330212520550710031430 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataRangeTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CDataRangeTermExpressionAssociator::CDataRangeTermExpressionAssociator(CDataRangeTermExpression *expression) : CExpressionAssociator(expression) { } CDataRangeTermExpressionAssociator::~CDataRangeTermExpressionAssociator() { } CDataRangeTermExpression* CDataRangeTermExpressionAssociator::getDataRangeTermExpression() { // bad cast to avoid lot of reimplementation return (CDataRangeTermExpression*)getExpression(); } bool CDataRangeTermExpressionAssociator::compareStructuralEquivalence(const CDataRangeTermExpressionAssociator& dataRangeTermExpressionAssociator) { return CExpressionAssociator::compareStructuralEquivalence(dataRangeTermExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetSubClassesExpression.h0000644000175000017500000000452212520550726030140 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYGETSUBCLASSESEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYGETSUBCLASSESEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CClassTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetSubClassesExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetSubClassesExpression : public CQueryExpression, public CClassTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryGetSubClassesExpression(const QString& name, bool direct, CClassTermExpression* classTermExp); //! Destructor virtual ~CQueryGetSubClassesExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); bool isDirect(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: bool mDirect; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYGETSUBCLASSESEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataHasValueExpression.h0000644000175000017500000000453112520550706026703 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAHASVALUEEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAHASVALUEEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassTermExpression.h" #include "CDataPropertyTermExpression.h" #include "CDataPropertyTermExpressionAssociator.h" #include "CDataRangeTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDataHasValueExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDataHasValueExpression : public CClassTermExpression, public CDataPropertyTermExpressionAssociator, public CDataRangeTermExpressionAssociator { // public methods public: //! Constructor CDataHasValueExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2); //! Destructor virtual ~CDataHasValueExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAHASVALUEEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CSubObjectPropertyOfExpression.h0000644000175000017500000000545612520550732030321 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CSUBOBJECTPROPERTYOFEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CSUBOBJECTPROPERTYOFEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyAxiomExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" #include "COrderedListObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CSubObjectPropertyOfExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CSubObjectPropertyOfExpression : public CObjectPropertyAxiomExpression, public CObjectPropertyTermExpressionAssociator, public COrderedListObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CSubObjectPropertyOfExpression(CObjectPropertyTermExpression *subObjectPropertyExpression1, CObjectPropertyTermExpression *superbObjectPropertyExpression2); CSubObjectPropertyOfExpression(const CEXPRESSIONLIST& subObjectPropertyExpressionList, CObjectPropertyTermExpression *superbObjectPropertyExpression); //! Destructor virtual ~CSubObjectPropertyOfExpression(); virtual ExpressionType getType(); CEXPRESSIONLIST* getSubObjectPropertyTermExpressionList(); CObjectPropertyTermExpression* getSuperObjectPropertyTermExpression(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CSUBOBJECTPROPERTYOFEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CIndividualTermExpressionAssociator.cpp0000644000175000017500000000315712520550714031706 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CIndividualTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CIndividualTermExpressionAssociator::CIndividualTermExpressionAssociator(CIndividualTermExpression *expression) : CExpressionAssociator(expression) { } CIndividualTermExpression* CIndividualTermExpressionAssociator::getIndividualTermExpression() { // bad cast to avoid lot of reimplementation return (CIndividualTermExpression*)getExpression(); } bool CIndividualTermExpressionAssociator::compareStructuralEquivalence(const CIndividualTermExpressionAssociator& indiTermExpressionAssociator) { return CExpressionAssociator::compareStructuralEquivalence(indiTermExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetNondeterministicIndividualsExpression.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetNondeterministicIndividualsExpress0000644000175000017500000000530012520550726032642 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetNondeterministicIndividualsExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetNondeterministicIndividualsExpression::CQueryGetNondeterministicIndividualsExpression(const QString& name) : CNameAssociator(name),CListIndividualTermExpressionAssociator() { } CQueryGetNondeterministicIndividualsExpression::CQueryGetNondeterministicIndividualsExpression(const QString& name, const CEXPRESSIONLIST& expressionList) : CNameAssociator(name),CListIndividualTermExpressionAssociator(expressionList) { } CQueryGetNondeterministicIndividualsExpression::~CQueryGetNondeterministicIndividualsExpression() { } CBuildExpression::ExpressionType CQueryGetNondeterministicIndividualsExpression::getType() { return BETGETNONDETERMINISTICINDIVIDUALS; } cint64 CQueryGetNondeterministicIndividualsExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListIndividualTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CQueryGetNondeterministicIndividualsExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryGetNondeterministicIndividualsExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryGetNondeterministicIndividualsExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataAllValuesFromExpression.cpp0000644000175000017500000000502712520550704030241 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataAllValuesFromExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataAllValuesFromExpression::CDataAllValuesFromExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2) : CDataPropertyTermExpressionAssociator(expression1), CDataRangeTermExpressionAssociator(expression2) { } CDataAllValuesFromExpression::~CDataAllValuesFromExpression() { } CBuildExpression::ExpressionType CDataAllValuesFromExpression::getType() { return BETDATAALLVALUEFROM; } cint64 CDataAllValuesFromExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDataPropertyTermExpressionAssociator::getStructuralHashValue(),CDataRangeTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDataAllValuesFromExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataAllValuesFromExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDataPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CDataRangeTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CDataAllValuesFromExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CDataPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CDataRangeTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectExactlyCardinalityExpression.h0000644000175000017500000000430012520550720031313 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTEXACTLYCARDINALITYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTEXACTLYCARDINALITYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyTermExpression.h" #include "CObjectCardinalityExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectExactlyCardinalityExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectExactlyCardinalityExpression : public CObjectCardinalityExpression { // public methods public: //! Constructor CObjectExactlyCardinalityExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2, cint64 cardinality); //! Destructor virtual ~CObjectExactlyCardinalityExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTEXACTLYCARDINALITYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataOneOfExpression.cpp0000644000175000017500000000454412520550706026540 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataOneOfExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataOneOfExpression::CDataOneOfExpression(CDataRangeTermExpression* expression1, CDataRangeTermExpression* expression2) : CListDataRangeTermExpressionAssociator(expression1,expression2) { } CDataOneOfExpression::CDataOneOfExpression(const CEXPRESSIONLIST& expressionList) : CListDataRangeTermExpressionAssociator(expressionList) { } CDataOneOfExpression::~CDataOneOfExpression() { } CBuildExpression::ExpressionType CDataOneOfExpression::getType() { return BETDATAONEOF; } cint64 CDataOneOfExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListDataRangeTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDataOneOfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataOneOfExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListDataRangeTermExpressionAssociator::compareStructuralEquivalence(*compExpCast);; } bool CDataOneOfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListDataRangeTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyChainExpression.h0000644000175000017500000000510012520550722030306 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYCHAINEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYCHAINEXPRESSION_H // Libraries includes // Namespace includes #include "CBuildExpression.h" #include "COrderedListObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectPropertyChainExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectPropertyChainExpression : public CBuildExpression, public COrderedListObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CObjectPropertyChainExpression(CObjectPropertyTermExpression *objectPropertyExpression1, CObjectPropertyTermExpression *objectPropertyExpression2, CObjectPropertyTermExpression *objectPropertyExpression3); CObjectPropertyChainExpression(const CEXPRESSIONLIST& objectPropertyExpressionList); //! Destructor virtual ~CObjectPropertyChainExpression(); virtual ExpressionType getType(); CEXPRESSIONLIST* getChainObjectPropertyTermExpressionList(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYCHAINEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CInverseObjectPropertiesExpression.cpp0000644000175000017500000000463012520550714031552 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CInverseObjectPropertiesExpression.h" namespace Konclude { namespace Parser { namespace Expression { CInverseObjectPropertiesExpression::CInverseObjectPropertiesExpression(CObjectPropertyTermExpression *expression1, CObjectPropertyTermExpression *expression2) : CUnorderedPairObjectPropertyTermExpressionAssociator(expression1,expression2) { } CInverseObjectPropertiesExpression::~CInverseObjectPropertiesExpression() { } CBuildExpression::ExpressionType CInverseObjectPropertiesExpression::getType() { return BETINVERSEOBJECTPROPERTIES; } cint64 CInverseObjectPropertiesExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CUnorderedPairObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CInverseObjectPropertiesExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CInverseObjectPropertiesExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CUnorderedPairObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CInverseObjectPropertiesExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CUnorderedPairObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetTypesExpression.h0000644000175000017500000000450312520550730027167 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQueryGetTypesExpression_H #define KONCLUDE_PARSER_EXPRESSION_CQueryGetTypesExpression_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CIndividualTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetTypesExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetTypesExpression : public CQueryExpression, public CIndividualTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryGetTypesExpression(const QString& name, bool direct, CIndividualTermExpression* individualTermExp); //! Destructor virtual ~CQueryGetTypesExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); bool isDirect(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: bool mDirect; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQueryGetTypesExpression_H ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CUnorderedPairIndividualTermExpressionAssociator.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CUnorderedPairIndividualTermExpressionAssoc0000644000175000017500000000335512520550732032552 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CUnorderedPairIndividualTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CUnorderedPairIndividualTermExpressionAssociator::CUnorderedPairIndividualTermExpressionAssociator(CIndividualTermExpression *expression1, CIndividualTermExpression *expression2) : CUnorderedPairExpressionAssociator(expression1,expression2) { } CUnorderedPairIndividualTermExpressionAssociator::~CUnorderedPairIndividualTermExpressionAssociator() { } CIndividualTermExpression* CUnorderedPairIndividualTermExpressionAssociator::getFirstIndividualTermExpression() { return (CIndividualTermExpression*)getFirstExpression(); } CIndividualTermExpression* CUnorderedPairIndividualTermExpressionAssociator::getSecondIndividualTermExpression() { return (CIndividualTermExpression*)getSecondExpression(); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyChainExpression.cpp0000644000175000017500000000563712520550722030660 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectPropertyChainExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectPropertyChainExpression::CObjectPropertyChainExpression(CObjectPropertyTermExpression *objectPropertyExpression1, CObjectPropertyTermExpression *objectPropertyExpression2, CObjectPropertyTermExpression *objectPropertyExpression3) : COrderedListObjectPropertyTermExpressionAssociator(objectPropertyExpression1,objectPropertyExpression2,objectPropertyExpression3) { } CObjectPropertyChainExpression::CObjectPropertyChainExpression(const CEXPRESSIONLIST& objectPropertyExpressionList) : COrderedListObjectPropertyTermExpressionAssociator(objectPropertyExpressionList) { } CObjectPropertyChainExpression::~CObjectPropertyChainExpression() { } CEXPRESSIONLIST* CObjectPropertyChainExpression::getChainObjectPropertyTermExpressionList() { return getOrderedObjectPropertyTermExpressionList(); } CBuildExpression::ExpressionType CObjectPropertyChainExpression::getType() { return BETOBJECTPROPERTYCHAIN; } cint64 CObjectPropertyChainExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),COrderedListObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CObjectPropertyChainExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectPropertyChainExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return COrderedListObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CObjectPropertyChainExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { COrderedListObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataMaxCardinalityExpression.cpp0000644000175000017500000000431012520550706030432 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataMaxCardinalityExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataMaxCardinalityExpression::CDataMaxCardinalityExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2, cint64 cardinality) : CDataCardinalityExpression(expression1,expression2,cardinality) { } CDataMaxCardinalityExpression::~CDataMaxCardinalityExpression() { } CBuildExpression::ExpressionType CDataMaxCardinalityExpression::getType() { return BETDATAMAXCARDINALITY; } cint64 CDataMaxCardinalityExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDataPropertyTermExpressionAssociator::getStructuralHashValue(),CDataRangeTermExpressionAssociator::getStructuralHashValue(),mCard); return hashValue; } bool CDataMaxCardinalityExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataMaxCardinalityExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDataPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CDataRangeTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && compExpCast->mCard == mCard; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataLexicalValueExpressionAssociator.cpp0000644000175000017500000000335612520550706032140 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLexicalValueExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CDataLexicalValueExpressionAssociator::CDataLexicalValueExpressionAssociator(CDataLexicalValueExpression *expression) : CExpressionAssociator(expression) { } CDataLexicalValueExpressionAssociator::~CDataLexicalValueExpressionAssociator() { } CDataLexicalValueExpression* CDataLexicalValueExpressionAssociator::getDataLexicalValueExpression() { // bad cast to avoid lot of reimplementation return (CDataLexicalValueExpression*)getExpression(); } bool CDataLexicalValueExpressionAssociator::compareStructuralEquivalence(const CDataLexicalValueExpressionAssociator& dataLexicalValueExpressionAssociator) { return CExpressionAssociator::compareStructuralEquivalence(dataLexicalValueExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataUnionOfExpression.h0000644000175000017500000000462012520550712026544 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAUNIONOFEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAUNIONOFEXPRESSION_H // Libraries includes #include // Namespace includes #include "CNameAssociator.h" #include "CBuildExpression.h" #include "CDataRangeTermExpression.h" #include "CListDataRangeTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDataUnionOfExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataUnionOfExpression : public CDataRangeTermExpression, public CListDataRangeTermExpressionAssociator { // public methods public: //! Constructor CDataUnionOfExpression(CDataRangeTermExpression* expression1 = nullptr, CDataRangeTermExpression* expression2 = nullptr); CDataUnionOfExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CDataUnionOfExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAUNIONOFEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectUnionOfExpression.h0000644000175000017500000000445012520550722027103 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTUNIONOFEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTUNIONOFEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassTermExpression.h" #include "CListClassTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectUnionOfExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectUnionOfExpression : public CClassTermExpression, public CListClassTermExpressionAssociator { // public methods public: //! Constructor CObjectUnionOfExpression(CClassTermExpression *expression1, CClassTermExpression *expression2); CObjectUnionOfExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CObjectUnionOfExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTUNIONOFEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRuleAtomListHeadExpression.cpp0000644000175000017500000000367712520550730030111 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRuleAtomListHeadExpression.h" namespace Konclude { namespace Parser { namespace Expression { CRuleAtomListHeadExpression::CRuleAtomListHeadExpression(const CEXPRESSIONLIST& expressionList) : CRuleAtomListExpression(expressionList) { } CRuleAtomListHeadExpression::~CRuleAtomListHeadExpression() { } CBuildExpression::ExpressionType CRuleAtomListHeadExpression::getType() { return BETRULEATOMHEADLIST; } cint64 CRuleAtomListHeadExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListRuleAtomTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CRuleAtomListHeadExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CRuleAtomListHeadExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListRuleAtomTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectHasSelfExpression.h0000644000175000017500000000434712520550720027056 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTHASSELFEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTHASSELFEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassTermExpression.h" #include "CObjectPropertyTermExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectHasSelfExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectHasSelfExpression : public CClassTermExpression, public CObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CObjectHasSelfExpression(CObjectPropertyTermExpression *expression1); //! Destructor virtual ~CObjectHasSelfExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTHASSELFEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CPairExpression.h0000644000175000017500000000402212520550724025267 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CPAIREXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CPAIREXPRESSION_H // Libraries includes #include // Namespace includes #include "CBuildExpression.h" #include "CListExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CPairExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CPairExpression : public CListExpression { // public methods public: //! Constructor CPairExpression(CBuildExpression *expression1, CBuildExpression *expression2); //! Destructor virtual ~CPairExpression(); void setFirstExpression(CBuildExpression *expression1); void setSecondExpression(CBuildExpression *expression2); CBuildExpression *getFirstExpression(); CBuildExpression *getSecondExpression(); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CPAIREXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryIsClassSatisfiableExpression.h0000644000175000017500000000447512520550730031143 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYISCLASSSATISFIABLEEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYISCLASSSATISFIABLEEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CClassTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryIsClassSatisfiableExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryIsClassSatisfiableExpression : public CQueryExpression, public CClassTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryIsClassSatisfiableExpression(const QString& name, CClassTermExpression* expression); //! Destructor virtual ~CQueryIsClassSatisfiableExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYISCLASSSATISFIABLEEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CPairExpression.cpp0000644000175000017500000000347212520550724025632 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPairExpression.h" namespace Konclude { namespace Parser { namespace Expression { CPairExpression::CPairExpression(CBuildExpression *expression1, CBuildExpression *expression2) : CListExpression() { push_front(expression1); push_back(expression2); } CPairExpression::~CPairExpression() { } void CPairExpression::setFirstExpression(CBuildExpression *expression1) { if (count() > 0) { removeFirst(); } push_front(expression1); } CBuildExpression *CPairExpression::getFirstExpression() { if (count() <= 0) { return 0; } else { return first(); } } void CPairExpression::setSecondExpression(CBuildExpression *expression2) { if (count() > 0) { removeLast(); } push_back(expression2); } CBuildExpression *CPairExpression::getSecondExpression() { if (count() <= 0) { return 0; } else { return last(); } } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataLiteralExpression.cpp0000644000175000017500000000473612520550706027131 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLiteralExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataLiteralExpression::CDataLiteralExpression(CDataLexicalValueExpression* dataLexicalValueExpression, CDatatypeExpression* dataTypeExpression) : CDataLexicalValueExpressionAssociator(dataLexicalValueExpression),CDatatypeExpressionAssociator(dataTypeExpression) { } CDataLiteralExpression::~CDataLiteralExpression() { } CBuildExpression::ExpressionType CDataLiteralExpression::getType() { return BETDATALITERAL; } cint64 CDataLiteralExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDataLexicalValueExpressionAssociator::getStructuralHashValue(),CDatatypeExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDataLiteralExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataLiteralExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDatatypeExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CDataLexicalValueExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CDataLiteralExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CDataLexicalValueExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CDatatypeExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataRangeTermExpressionAssociator.h0000644000175000017500000000433312520550710031102 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATARANGETERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CDATARANGETERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CDataRangeTermExpression.h" #include "CExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDataRangeTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataRangeTermExpressionAssociator : public CExpressionAssociator { // public methods public: //! Constructor CDataRangeTermExpressionAssociator(CDataRangeTermExpression* expression = nullptr); //! Destructor virtual ~CDataRangeTermExpressionAssociator(); CDataRangeTermExpression* getDataRangeTermExpression(); virtual bool compareStructuralEquivalence(const CDataRangeTermExpressionAssociator& dataRangeTermExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATARANGETERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataFacetExpressionAssociator.cpp0000644000175000017500000000321212520550706030573 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataFacetExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CDataFacetExpressionAssociator::CDataFacetExpressionAssociator(CDataFacetExpression *expression) : CExpressionAssociator(expression) { } CDataFacetExpressionAssociator::~CDataFacetExpressionAssociator() { } CDataFacetExpression* CDataFacetExpressionAssociator::getDataFacetExpression() { // bad cast to avoid lot of reimplementation return (CDataFacetExpression*)getExpression(); } bool CDataFacetExpressionAssociator::compareStructuralEquivalence(const CDataFacetExpressionAssociator& datatypeExpressionAssociator) { return CExpressionAssociator::compareStructuralEquivalence(datatypeExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataCardinalityExpression.cpp0000644000175000017500000000333412520550704027767 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataCardinalityExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataCardinalityExpression::CDataCardinalityExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2, cint64 cardinality) : CDataPropertyTermExpressionAssociator(expression1), CDataRangeTermExpressionAssociator(expression2), CCardinalityAssociator(cardinality) { } CDataCardinalityExpression::~CDataCardinalityExpression() { } bool CDataCardinalityExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CDataPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CDataRangeTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetNondeterministicClassAssertionsExpression.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetNondeterministicClassAssertionsExp0000644000175000017500000000422012520550726032612 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYGETNONDETERMINISTICCLASSASSERTIONSEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYGETNONDETERMINISTICCLASSASSERTIONSEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryGetClassAssertionsExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetNondeterministicClassAssertionsExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetNondeterministicClassAssertionsExpression : public CQueryGetClassAssertionsExpression { // public methods public: //! Constructor CQueryGetNondeterministicClassAssertionsExpression(const QString& name, const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CQueryGetNondeterministicClassAssertionsExpression(); virtual ExpressionType getType(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYGETNONDETERMINISTICCLASSASSERTIONSEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataPropertyTermExpression.cpp0000644000175000017500000000220112520550710030165 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataPropertyTermExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataPropertyTermExpression::CDataPropertyTermExpression() { } CDataPropertyTermExpression::~CDataPropertyTermExpression() { } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDisjointUnionExpression.cpp0000644000175000017500000000472212520550712027527 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDisjointUnionExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDisjointUnionExpression::CDisjointUnionExpression(CClassExpression* classExpression, const CEXPRESSIONLIST& expressionList) : CClassExpressionAssociator(classExpression), CListClassTermExpressionAssociator(expressionList) { } CDisjointUnionExpression::~CDisjointUnionExpression() { } CBuildExpression::ExpressionType CDisjointUnionExpression::getType() { return BETDISJOINTUNION; } cint64 CDisjointUnionExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CClassExpressionAssociator::getStructuralHashValue(),CListClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDisjointUnionExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDisjointUnionExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CClassExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CListClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CDisjointUnionExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CClassExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CListClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListExpressionAssociator.cpp0000644000175000017500000001060612520550716027700 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CListExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CListExpressionAssociator::CListExpressionAssociator(CBuildExpression *expression1, CBuildExpression *expression2, CBuildExpression *expression3) { if (expression1) { mExpressionList.append(expression1); } if (expression2) { mExpressionList.append(expression2); } if (expression3) { mExpressionList.append(expression3); } } CListExpressionAssociator::CListExpressionAssociator(const CEXPRESSIONLIST& expressionList) : mExpressionList(expressionList) { } CListExpressionAssociator::CListExpressionAssociator(CEXPRESSIONLIST* expressionList) : mExpressionList(*expressionList) { } CListExpressionAssociator* CListExpressionAssociator::initExpressionAssociator(CBuildExpression *expression1, CBuildExpression *expression2, CBuildExpression *expression3) { if (expression1) { if (mExpressionList.isEmpty()) { mExpressionList.append(expression1); } else { mExpressionList.replace(0,expression1); } if (expression2) { if (mExpressionList.size() < 2) { mExpressionList.append(expression2); } else { mExpressionList.replace(1,expression2); } if (expression3) { if (mExpressionList.size() < 3) { mExpressionList.append(expression3); } else { mExpressionList.replace(2,expression3); } } else { while (mExpressionList.size() > 2) { mExpressionList.removeLast(); } } } else { while (mExpressionList.size() > 1) { mExpressionList.removeLast(); } } } else { mExpressionList.clear(); } return this; } CEXPRESSIONLIST* CListExpressionAssociator::getExpressionList() { return &mExpressionList; } const CEXPRESSIONLIST* CListExpressionAssociator::getConstExpressionList() const { return &mExpressionList; } cint64 CListExpressionAssociator::getExpressionCount() { return mExpressionList.count(); } cint64 CListExpressionAssociator::getStructuralHashValue() { cint64 hashValue = 0; cint64 tmpValue1 = 0; cint64 tmpValue2 = 1; FOREACHIT (CBuildExpression* expression, mExpressionList) { tmpValue1 += cint64(expression); tmpValue2 *= cint64(expression); } hashValue = tmpValue1+tmpValue2; return hashValue; } bool CListExpressionAssociator::compareStructuralEquivalence(const CListExpressionAssociator& listExpressionAssociator) { if (mExpressionList.count() != listExpressionAssociator.mExpressionList.count()) { return false; } FOREACHIT (CBuildExpression* expression, mExpressionList) { cint64 containedCount = listExpressionAssociator.mExpressionList.count(expression); if (containedCount <= 0) { return false; } else if (containedCount > 1) { if (mExpressionList.count(expression) != containedCount) { return false; } } } return true; } bool CListExpressionAssociator::visitSubExpressions(CBuildExpression* expression, CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { for (CEXPRESSIONLIST::const_iterator it = mExpressionList.constBegin(), itEnd = mExpressionList.constEnd(); it != itEnd; ++it) { subExpressionVisitor->visitSubExpression(expression,*it,subExpressionVisitor); } return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetClassAssertionsExpression.h0000644000175000017500000000460612520550724031212 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYGETCLASSASSERTIONSEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYGETCLASSASSERTIONSEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CListIndividualTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetClassAssertionsExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetClassAssertionsExpression : public CQueryExpression, public CListIndividualTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryGetClassAssertionsExpression(const QString& name); CQueryGetClassAssertionsExpression(const QString& name, const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CQueryGetClassAssertionsExpression(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYGETCLASSASSERTIONSEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataSomeValuesFromExpression.cpp0000644000175000017500000000504312520550710030427 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataSomeValuesFromExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataSomeValuesFromExpression::CDataSomeValuesFromExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2) : CDataPropertyTermExpressionAssociator(expression1), CDataRangeTermExpressionAssociator(expression2) { } CDataSomeValuesFromExpression::~CDataSomeValuesFromExpression() { } CBuildExpression::ExpressionType CDataSomeValuesFromExpression::getType() { return BETDATASOMEVALUEFROM; } cint64 CDataSomeValuesFromExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDataPropertyTermExpressionAssociator::getStructuralHashValue(),CDataRangeTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDataSomeValuesFromExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataSomeValuesFromExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDataPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CDataRangeTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CDataSomeValuesFromExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CDataPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CDataRangeTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListClassTermExpressionAssociator.h0000644000175000017500000000465312520550714031166 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CLISTCLASSTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CLISTCLASSTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CClassTermExpression.h" #include "CListExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CListClassTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CListClassTermExpressionAssociator : public CListExpressionAssociator { // public methods public: //! Constructor CListClassTermExpressionAssociator(CClassTermExpression* expression1 = nullptr, CClassTermExpression* expression2 = nullptr, CClassTermExpression* expression3 = nullptr); CListClassTermExpressionAssociator(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CListClassTermExpressionAssociator(); CEXPRESSIONLIST* getClassTermExpressionList(); virtual bool compareStructuralEquivalence(const CListClassTermExpressionAssociator& listClassTermExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CLISTCLASSTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CExpressionHashMixer.cpp0000644000175000017500000000400312520550714026615 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CExpressionHashMixer.h" namespace Konclude { namespace Parser { namespace Expression { CExpressionHashMixer::CExpressionHashMixer() { } CExpressionHashMixer::~CExpressionHashMixer() { } cint64 CExpressionHashMixer::getHashValueMixed(cint64 hashValue1) { cint64 hashValue = hashValue1; return hashValue; } cint64 CExpressionHashMixer::getHashValueMixed(cint64 hashValue1, cint64 hashValue2) { cint64 hashValue = hashValue1; hashValue = ((hashValue*13)-1)^hashValue2; return hashValue; } cint64 CExpressionHashMixer::getHashValueMixed(cint64 hashValue1, cint64 hashValue2, cint64 hashValue3) { cint64 hashValue = hashValue1; hashValue = ((hashValue*13)-1)^hashValue2; hashValue = ((hashValue*13)-1)^hashValue3; return hashValue; } cint64 CExpressionHashMixer::getHashValueMixed(cint64 hashValue1, cint64 hashValue2, cint64 hashValue3, cint64 hashValue4) { cint64 hashValue = hashValue1; hashValue = ((hashValue*13)-1)^hashValue2; hashValue = ((hashValue*13)-1)^hashValue3; hashValue = ((hashValue*13)-1)^hashValue4; return hashValue; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CNegativeDataPropertyAssertionExpression.h0000644000175000017500000000525512520550716032377 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CNEGATIVEDATAPROPERTYASSERTIONEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CNEGATIVEDATAPROPERTYASSERTIONEXPRESSION_H // Libraries includes #include // Namespace includes #include "CAssertionAxiomExpression.h" #include "CIndividualTermExpressionAssociator.h" #include "CDataLiteralExpressionAssociator.h" #include "CDataRangeTermExpressionAssociator.h" #include "CDataPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CNegativeDataPropertyAssertionExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CNegativeDataPropertyAssertionExpression : public CAssertionAxiomExpression, public CIndividualTermExpressionAssociator, public CDataPropertyTermExpressionAssociator, public CDataLiteralExpressionAssociator { // public methods public: //! Constructor CNegativeDataPropertyAssertionExpression(CDataPropertyTermExpression *propertyExpression1, CIndividualTermExpression *sourceExpression2, CDataLiteralExpression *targetExpression3); //! Destructor virtual ~CNegativeDataPropertyAssertionExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CNEGATIVEDATAPROPERTYASSERTIONEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CNameAssociator.h0000644000175000017500000000347612520550716025241 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CNAMEASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CNAMEASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CNameAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CNameAssociator { // public methods public: //! Constructor CNameAssociator(const QString& newName); //! Destructor virtual ~CNameAssociator(); void setName(const QString& newName); const QString& getName(); // protected methods protected: // private methods private: // private variables private: QString name; }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CNAMEASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CPropertyTermExpression.h0000644000175000017500000000343112520550724027053 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CPROPERTYTERMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CPROPERTYTERMEXPRESSION_H // Libraries includes #include // Namespace includes #include "CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CPropertyTermExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CPropertyTermExpression : public CBuildExpression { // public methods public: //! Constructor CPropertyTermExpression(); //! Destructor virtual ~CPropertyTermExpression(); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CPROPERTYTERMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataFacetRestrictionExpressionAssociator.h0000644000175000017500000000445212520550706032475 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAFACETRESTRICTIONEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CDATAFACETRESTRICTIONEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CExpressionAssociator.h" #include "CDataFacetRestrictionExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDataFacetRestrictionExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataFacetRestrictionExpressionAssociator : public CExpressionAssociator { // public methods public: //! Constructor CDataFacetRestrictionExpressionAssociator(CDataFacetRestrictionExpression* expression = nullptr); //! Destructor virtual ~CDataFacetRestrictionExpressionAssociator(); CDataFacetRestrictionExpression* getDataFacetRestrictionExpression(); virtual bool compareStructuralEquivalence(const CDataFacetRestrictionExpressionAssociator& datatypeExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAFACETRESTRICTIONEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CClassTermExpressionAssociator.h0000644000175000017500000000414212520550704030322 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CCLASSTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CCLASSTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CClassTermExpression.h" #include "CExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CClassTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassTermExpressionAssociator : public CExpressionAssociator { // public methods public: //! Constructor CClassTermExpressionAssociator(CClassTermExpression* expression = nullptr); CClassTermExpression* getClassTermExpression(); virtual bool compareStructuralEquivalence(const CClassTermExpressionAssociator& classTermExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CCLASSTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectMaxCardinalityExpression.h0000644000175000017500000000424412520550720030436 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTMAXCARDINALITYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTMAXCARDINALITYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyTermExpression.h" #include "CObjectCardinalityExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectMaxCardinalityExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectMaxCardinalityExpression : public CObjectCardinalityExpression { // public methods public: //! Constructor CObjectMaxCardinalityExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2, cint64 cardinality); //! Destructor virtual ~CObjectMaxCardinalityExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTMAXCARDINALITYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRuleAtomListExpression.h0000644000175000017500000000400712520550730026760 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CRULEATOMLISTEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CRULEATOMLISTEXPRESSION_H // Libraries includes // Namespace includes #include "ExpressionSettings.h" #include "CBuildExpression.h" #include "CListRuleAtomTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CRuleAtomListExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRuleAtomListExpression : public CBuildExpression, public CListRuleAtomTermExpressionAssociator { // public methods public: //! Constructor CRuleAtomListExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CRuleAtomListExpression(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CRULEATOMLISTEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListAxiomExpressionAssociator.cpp0000644000175000017500000000374312520550714030700 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CListAxiomExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CListAxiomExpressionAssociator::CListAxiomExpressionAssociator(CAxiomExpression *expression1, CAxiomExpression *expression2, CAxiomExpression *expression3) : CListExpressionAssociator(expression1,expression2,expression3) { } CListAxiomExpressionAssociator::CListAxiomExpressionAssociator(const CEXPRESSIONLIST& expressionList) : CListExpressionAssociator(*(CEXPRESSIONLIST*)&expressionList) { } CListAxiomExpressionAssociator::~CListAxiomExpressionAssociator() { } CEXPRESSIONLIST* CListAxiomExpressionAssociator::getAxiomExpressionList() { // bad cast to avoid lot of reimplementation return (CEXPRESSIONLIST*)&mExpressionList; } bool CListAxiomExpressionAssociator::compareStructuralEquivalence(const CListAxiomExpressionAssociator& listClassTermExpressionAssociator) { return CListExpressionAssociator::compareStructuralEquivalence(listClassTermExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CFunctionalDataPropertyExpression.h0000644000175000017500000000460612520550714031044 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CFUNCTIONALDATAPROPERTYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CFUNCTIONALDATAPROPERTYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CDataPropertyAxiomExpression.h" #include "CDataPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CFunctionalDataPropertyExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CFunctionalDataPropertyExpression : public CDataPropertyAxiomExpression, public CDataPropertyTermExpressionAssociator { // public methods public: //! Constructor CFunctionalDataPropertyExpression(CDataPropertyTermExpression *expression); //! Destructor virtual ~CFunctionalDataPropertyExpression(); CDataPropertyTermExpression *getFunctionalDataPropertyExpression(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual ExpressionType getType(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CFUNCTIONALDATAPROPERTYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListIndividualTermExpressionAssociator.h0000644000175000017500000000503012520550716032201 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CLISTINDIVIDUALTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CLISTINDIVIDUALTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CIndividualTermExpression.h" #include "CListExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CListIndividualTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CListIndividualTermExpressionAssociator : public CListExpressionAssociator { // public methods public: //! Constructor CListIndividualTermExpressionAssociator(CIndividualTermExpression* expression1 = nullptr, CIndividualTermExpression* expression2 = nullptr, CIndividualTermExpression* expression3 = nullptr); CListIndividualTermExpressionAssociator(const CEXPRESSIONLIST& expressionList); CListIndividualTermExpressionAssociator* initIndividualTermExpressionAssociator(CIndividualTermExpression* expression1 = nullptr, CIndividualTermExpression* expression2 = nullptr, CIndividualTermExpression* expression3 = nullptr); CEXPRESSIONLIST* getIndividualTermExpressionList(); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CLISTINDIVIDUALTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDatatypeRestrictionExpression.cpp0000644000175000017500000000567112520550710030736 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDatatypeRestrictionExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDatatypeRestrictionExpression::CDatatypeRestrictionExpression(CDatatypeExpression* datatypeExpression, CDataFacetRestrictionExpression* expression1, CDataFacetRestrictionExpression* expression2) : CDatatypeExpressionAssociator(datatypeExpression), CListDataFacetRestrictionExpressionAssociator(expression1,expression2) { } CDatatypeRestrictionExpression::CDatatypeRestrictionExpression(CDatatypeExpression* datatypeExpression, const CEXPRESSIONLIST& expressionList) : CDatatypeExpressionAssociator(datatypeExpression), CListDataFacetRestrictionExpressionAssociator(expressionList) { } CDatatypeRestrictionExpression::~CDatatypeRestrictionExpression() { } CBuildExpression::ExpressionType CDatatypeRestrictionExpression::getType() { return BETDATATYPERESTRICTION; } cint64 CDatatypeRestrictionExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDatatypeExpressionAssociator::getStructuralHashValue(),CListDataFacetRestrictionExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDatatypeRestrictionExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDatatypeRestrictionExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDatatypeExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CListDataFacetRestrictionExpressionAssociator::compareStructuralEquivalence(*compExpCast);; } bool CDatatypeRestrictionExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CDatatypeExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CListDataFacetRestrictionExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDisjointDataPropertiesExpression.h0000644000175000017500000000470212520550712031030 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDISJOINTDATAPROPERTIESEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDISJOINTDATAPROPERTIESEXPRESSION_H // Libraries includes // Namespace includes #include "CDataPropertyAxiomExpression.h" #include "CListDataPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDisjointDataPropertiesExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDisjointDataPropertiesExpression : public CDataPropertyAxiomExpression, public CListDataPropertyTermExpressionAssociator { // public methods public: //! Constructor CDisjointDataPropertiesExpression(CDataPropertyTermExpression *expression1, CDataPropertyTermExpression *expression2, CDataPropertyTermExpression *expression3 = nullptr); CDisjointDataPropertiesExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CDisjointDataPropertiesExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDISJOINTDATAPROPERTIESEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetFlattenedTypesExpression.cpp0000644000175000017500000000477612520550726031372 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetFlattenedTypesExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetFlattenedTypesExpression::CQueryGetFlattenedTypesExpression(const QString& name, bool direct, CIndividualTermExpression* individualTermExp) : CNameAssociator(name),CIndividualTermExpressionAssociator(individualTermExp),mDirect(direct) { } CQueryGetFlattenedTypesExpression::~CQueryGetFlattenedTypesExpression() { } CBuildExpression::ExpressionType CQueryGetFlattenedTypesExpression::getType() { return BETGETFLATTENEDTYPES; } cint64 CQueryGetFlattenedTypesExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CIndividualTermExpressionAssociator::getStructuralHashValue(),(cint64)mDirect); return hashValue; } bool CQueryGetFlattenedTypesExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryGetFlattenedTypesExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } if (compExpCast->mDirect != mDirect) { return false; } return CIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryGetFlattenedTypesExpression::isDirect() { return mDirect; } bool CQueryGetFlattenedTypesExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyDomainExpression.cpp0000644000175000017500000000506412520550722031037 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectPropertyDomainExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectPropertyDomainExpression::CObjectPropertyDomainExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2) : CObjectPropertyTermExpressionAssociator(expression1), CClassTermExpressionAssociator(expression2) { } CObjectPropertyDomainExpression::~CObjectPropertyDomainExpression() { } CBuildExpression::ExpressionType CObjectPropertyDomainExpression::getType() { return BETOBJECTPROPERTYDOMAIN; } cint64 CObjectPropertyDomainExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue(),CClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CObjectPropertyDomainExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectPropertyDomainExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CObjectPropertyDomainExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListIndividualTermExpressionAssociator.cpp0000644000175000017500000000417412520550716032544 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CListIndividualTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CListIndividualTermExpressionAssociator::CListIndividualTermExpressionAssociator(CIndividualTermExpression *expression1, CIndividualTermExpression *expression2, CIndividualTermExpression *expression3) : CListExpressionAssociator(expression1,expression2,expression3) { } CListIndividualTermExpressionAssociator::CListIndividualTermExpressionAssociator(const CEXPRESSIONLIST& expressionList) : CListExpressionAssociator(*(CEXPRESSIONLIST*)&expressionList) { } CListIndividualTermExpressionAssociator* CListIndividualTermExpressionAssociator::initIndividualTermExpressionAssociator(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2, CIndividualTermExpression* expression3) { CListExpressionAssociator::initExpressionAssociator(expression1,expression2,expression3); return this; } CEXPRESSIONLIST* CListIndividualTermExpressionAssociator::getIndividualTermExpressionList() { // bad cast to avoid lot of reimplementation return (CEXPRESSIONLIST*)&mExpressionList; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetFlattenedObjectPropertyTargetsExpression.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetFlattenedObjectPropertyTargetsExpr0000644000175000017500000000551612520550726032562 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetFlattenedObjectPropertyTargetsExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetFlattenedObjectPropertyTargetsExpression::CQueryGetFlattenedObjectPropertyTargetsExpression(const QString& name, CObjectPropertyTermExpression* objPropTermExp, CIndividualTermExpression* indiTermExp) : CNameAssociator(name),CObjectPropertyTermExpressionAssociator(objPropTermExp),CIndividualTermExpressionAssociator(indiTermExp) { } CQueryGetFlattenedObjectPropertyTargetsExpression::~CQueryGetFlattenedObjectPropertyTargetsExpression() { } CBuildExpression::ExpressionType CQueryGetFlattenedObjectPropertyTargetsExpression::getType() { return BETGETFLATTENEDOBJECTPROPERTYTARGETS; } cint64 CQueryGetFlattenedObjectPropertyTargetsExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue(),CIndividualTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CQueryGetFlattenedObjectPropertyTargetsExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryGetFlattenedObjectPropertyTargetsExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryGetFlattenedObjectPropertyTargetsExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetFlattenedTypesExpression.h0000644000175000017500000000460212520550726031023 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYGETFLATTENEDTYPESEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYGETFLATTENEDTYPESEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CIndividualTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetFlattenedTypesExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetFlattenedTypesExpression : public CQueryExpression, public CIndividualTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryGetFlattenedTypesExpression(const QString& name, bool direct, CIndividualTermExpression* individualTermExp); //! Destructor virtual ~CQueryGetFlattenedTypesExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); bool isDirect(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: bool mDirect; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYGETFLATTENEDTYPESEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataSomeValuesFromExpression.h0000644000175000017500000000460312520550710030075 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATASOMEVALUESFROMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATASOMEVALUESFROMEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassTermExpression.h" #include "CDataPropertyTermExpression.h" #include "CDataPropertyTermExpressionAssociator.h" #include "CDataRangeTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDataSomeValuesFromExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDataSomeValuesFromExpression : public CClassTermExpression, public CDataPropertyTermExpressionAssociator, public CDataRangeTermExpressionAssociator { // public methods public: //! Constructor CDataSomeValuesFromExpression(CDataPropertyTermExpression *expression1, CDataRangeTermExpression *expression2); //! Destructor virtual ~CDataSomeValuesFromExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATASOMEVALUESFROMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataIntersectionOfExpression.h0000644000175000017500000000471012520550706030125 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAINTERSECTIONOFEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAINTERSECTIONOFEXPRESSION_H // Libraries includes #include // Namespace includes #include "CNameAssociator.h" #include "CBuildExpression.h" #include "CDataRangeTermExpression.h" #include "CListDataRangeTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDataIntersectionOfExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDataIntersectionOfExpression : public CDataRangeTermExpression, public CListDataRangeTermExpressionAssociator { // public methods public: //! Constructor CDataIntersectionOfExpression(CDataRangeTermExpression* expression1 = nullptr, CDataRangeTermExpression* expression2 = nullptr); CDataIntersectionOfExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CDataIntersectionOfExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAINTERSECTIONOFEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectCardinalityExpression.h0000644000175000017500000000444012520550720027766 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTCARDINALITYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTCARDINALITYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyTermExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" #include "CClassTermExpressionAssociator.h" #include "CCardinalityAssociator.h" #include "CClassTermExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectCardinalityExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectCardinalityExpression : public CClassTermExpression, public CObjectPropertyTermExpressionAssociator, public CClassTermExpressionAssociator, public CCardinalityAssociator { // public methods public: //! Constructor CObjectCardinalityExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2, cint64 cardinality); //! Destructor virtual ~CObjectCardinalityExpression(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTCARDINALITYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDatatypeExpression.h0000644000175000017500000000421612520550710026147 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATATYPEEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATATYPEEXPRESSION_H // Libraries includes #include // Namespace includes #include "CNameAssociator.h" #include "CDataRangeTermExpression.h" #include "CExpressionEntity.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDatatypeExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeExpression : public CDataRangeTermExpression, public CExpressionEntity { // public methods public: //! Constructor CDatatypeExpression(const QString& dataTypeIRI); //! Destructor virtual ~CDatatypeExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATATYPEEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectOneOfExpression.cpp0000644000175000017500000000516012520550720027064 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectOneOfExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectOneOfExpression::CObjectOneOfExpression(CIndividualTermExpression *expression1, CIndividualTermExpression *expression2) : CListIndividualTermExpressionAssociator(expression1,expression2) { } CObjectOneOfExpression::CObjectOneOfExpression(const CEXPRESSIONLIST& expressionList) : CListIndividualTermExpressionAssociator(expressionList) { } CObjectOneOfExpression* CObjectOneOfExpression::initObjectOneOfExpression(CIndividualTermExpression *expression1, CIndividualTermExpression *expression2) { CListIndividualTermExpressionAssociator::initIndividualTermExpressionAssociator(expression1,expression2); return this; } CBuildExpression::ExpressionType CObjectOneOfExpression::getType() { return BETOBJECTONEOF; } cint64 CObjectOneOfExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListIndividualTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CObjectOneOfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectOneOfExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CObjectOneOfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectMinCardinalityExpression.h0000644000175000017500000000424312520550720030433 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTMINCARDINALITYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTMINCARDINALITYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyTermExpression.h" #include "CObjectCardinalityExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectMinCardinalityExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectMinCardinalityExpression : public CObjectCardinalityExpression { // public methods public: //! Constructor CObjectMinCardinalityExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2, cint64 cardinality); //! Destructor virtual ~CObjectMinCardinalityExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTMINCARDINALITYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyTermExpressionAssociator.h0000644000175000017500000000430612520550722032232 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CObjectPropertyTermExpression.h" #include "CExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CObjectPropertyTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CObjectPropertyTermExpressionAssociator : public CExpressionAssociator { // public methods public: //! Constructor CObjectPropertyTermExpressionAssociator(CObjectPropertyTermExpression* expression = nullptr); CObjectPropertyTermExpression* getObjectPropertyTermExpression(); virtual bool compareStructuralEquivalence(const CObjectPropertyTermExpressionAssociator& objectTermExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYTERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CEquivalentClassesExpression.cpp0000644000175000017500000000466312520550712030372 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CEquivalentClassesExpression.h" namespace Konclude { namespace Parser { namespace Expression { CEquivalentClassesExpression::CEquivalentClassesExpression(CClassTermExpression *expression1, CClassTermExpression *expression2) : CListClassTermExpressionAssociator(expression1,expression2) { } CEquivalentClassesExpression::CEquivalentClassesExpression(const CEXPRESSIONLIST& expressionList) : CListClassTermExpressionAssociator(expressionList) { } CEquivalentClassesExpression::~CEquivalentClassesExpression() { } cint64 CEquivalentClassesExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CEquivalentClassesExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CEquivalentClassesExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } CBuildExpression::ExpressionType CEquivalentClassesExpression::getType() { return BETEQUIVALENTCLASSES; } bool CEquivalentClassesExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CClassExpression.h0000644000175000017500000000411312520550704025440 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CLASSEXPRESSION_H #define KONCLUDE_PARSER_CLASSEXPRESSION_H // Libraries includes #include // Namespace includes #include "CNameAssociator.h" #include "CClassTermExpression.h" #include "CExpressionEntity.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CClassExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassExpression : public CClassTermExpression, public CExpressionEntity { // public methods public: //! Constructor CClassExpression(const QString& className); //! Destructor virtual ~CClassExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CLASSEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CClassVariableTermExpressionAssociator.cpp0000644000175000017500000000336412520550704032330 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CClassVariableTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CClassVariableTermExpressionAssociator::CClassVariableTermExpressionAssociator(CObjectIndividualVariableExpression *expression) : CExpressionAssociator(expression) { } CClassVariableTermExpressionAssociator::~CClassVariableTermExpressionAssociator() { } CObjectIndividualVariableExpression* CClassVariableTermExpressionAssociator::getClassVariableExpression() { // bad cast to avoid lot of reimplementation return (CObjectIndividualVariableExpression*)getExpression(); } bool CClassVariableTermExpressionAssociator::compareStructuralEquivalence(const CClassVariableTermExpressionAssociator& classExpressionAssociator) { return CExpressionAssociator::compareStructuralEquivalence(classExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyExpression.h0000644000175000017500000000422712520550722027354 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyTermExpression.h" #include "CExpressionEntity.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectPropertyExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectPropertyExpression : public CObjectPropertyTermExpression, public CExpressionEntity { // public methods public: //! Constructor CObjectPropertyExpression(const QString& probertyName); //! Destructor virtual ~CObjectPropertyExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTPROPERTYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListExpressionAssociator.h0000644000175000017500000000534612520550716027352 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CLISTEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CLISTEXPRESSIONASSOCIATOR_H // Libraries includes // Namespace includes #include "ExpressionSettings.h" #include "CBuildExpression.h" #include "CSubExpressionVisitor.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CListExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CListExpressionAssociator { // public methods public: //! Constructor CListExpressionAssociator(CBuildExpression *expression1 = 0, CBuildExpression *expression2 = 0, CBuildExpression *expression3 = 0); CListExpressionAssociator(const CEXPRESSIONLIST& expressionList); CListExpressionAssociator(CEXPRESSIONLIST* expressionList); CListExpressionAssociator* initExpressionAssociator(CBuildExpression *expression1 = 0, CBuildExpression *expression2 = 0, CBuildExpression *expression3 = 0); CEXPRESSIONLIST* getExpressionList(); const CEXPRESSIONLIST* getConstExpressionList() const; cint64 getExpressionCount(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(const CListExpressionAssociator& listExpressionAssociator); virtual bool visitSubExpressions(CBuildExpression* expression, CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: CEXPRESSIONLIST mExpressionList; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CLISTEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CCardinalityAssociator.cpp0000644000175000017500000000255112520550704027145 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CCardinalityAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CCardinalityAssociator::CCardinalityAssociator(cint64 cardinality) { mCard = cardinality; } CCardinalityAssociator::~CCardinalityAssociator() { } CCardinalityAssociator* CCardinalityAssociator::setCardinality(cint64 cardinality) { mCard = cardinality; return this; } cint64 CCardinalityAssociator::getCardinality() { return mCard; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectAllValuesFromExpression.cpp0000644000175000017500000000504712520550720030576 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectAllValuesFromExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectAllValuesFromExpression::CObjectAllValuesFromExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2) : CObjectPropertyTermExpressionAssociator(expression1), CClassTermExpressionAssociator(expression2) { } CObjectAllValuesFromExpression::~CObjectAllValuesFromExpression() { } CBuildExpression::ExpressionType CObjectAllValuesFromExpression::getType() { return BETOBJECTALLVALUEFROM; } cint64 CObjectAllValuesFromExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue(),CClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CObjectAllValuesFromExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectAllValuesFromExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CObjectAllValuesFromExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListAxiomExpressionAssociator.h0000644000175000017500000000455312520550714030345 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CLISTAXIOMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CLISTAXIOMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CAxiomExpression.h" #include "CListExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CListAxiomExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CListAxiomExpressionAssociator : public CListExpressionAssociator { // public methods public: //! Constructor CListAxiomExpressionAssociator(CAxiomExpression* expression1 = nullptr, CAxiomExpression* expression2 = nullptr, CAxiomExpression* expression3 = nullptr); CListAxiomExpressionAssociator(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CListAxiomExpressionAssociator(); CEXPRESSIONLIST* getAxiomExpressionList(); virtual bool compareStructuralEquivalence(const CListAxiomExpressionAssociator& listClassTermExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CLISTAXIOMEXPRESSIONASSOCIATOR_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListDataFacetRestrictionExpressionAssociator.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListDataFacetRestrictionExpressionAssociat0000644000175000017500000000513312520550716032540 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CLISTDATAFACETRESTRICTIONEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CLISTDATAFACETRESTRICTIONEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CDataFacetRestrictionExpression.h" #include "CListExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CListDataFacetRestrictionExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CListDataFacetRestrictionExpressionAssociator : public CListExpressionAssociator { // public methods public: //! Constructor CListDataFacetRestrictionExpressionAssociator(CDataFacetRestrictionExpression* expression1 = nullptr, CDataFacetRestrictionExpression* expression2 = nullptr, CDataFacetRestrictionExpression* expression3 = nullptr); CListDataFacetRestrictionExpressionAssociator(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CListDataFacetRestrictionExpressionAssociator(); CEXPRESSIONLIST* getDataFacetRestrictionExpressionList(); virtual bool compareStructuralEquivalence(const CListDataFacetRestrictionExpressionAssociator& listClassTermExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CLISTDATAFACETRESTRICTIONEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectIndividualVariableExpression.h0000644000175000017500000000450412520550720031262 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTINDIVIDUALVARIABLEEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTINDIVIDUALVARIABLEEXPRESSION_H // Libraries includes #include // Namespace includes #include "CNameAssociator.h" #include "CClassTermExpression.h" #include "CExpressionEntity.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CObjectIndividualVariableExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CObjectIndividualVariableExpression : public CClassTermExpression, public CExpressionEntity { // public methods public: //! Constructor CObjectIndividualVariableExpression(const QString& variableName, cint64 axiomNumber); //! Destructor virtual ~CObjectIndividualVariableExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); cint64 getAxiomNumber(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: cint64 mAxiomNumber; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTINDIVIDUALVARIABLEEXPRESSION_H ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CNegativeDataPropertyAssertionExpression.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CNegativeDataPropertyAssertionExpression.cp0000644000175000017500000000601212520550716032542 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNegativeDataPropertyAssertionExpression.h" namespace Konclude { namespace Parser { namespace Expression { CNegativeDataPropertyAssertionExpression::CNegativeDataPropertyAssertionExpression(CDataPropertyTermExpression *propertyExpression1, CIndividualTermExpression *sourceExpression2, CDataLiteralExpression *targetExpression3) : CDataPropertyTermExpressionAssociator(propertyExpression1), CIndividualTermExpressionAssociator(sourceExpression2), CDataLiteralExpressionAssociator(targetExpression3) { } CNegativeDataPropertyAssertionExpression::~CNegativeDataPropertyAssertionExpression() { } CBuildExpression::ExpressionType CNegativeDataPropertyAssertionExpression::getType() { return BETNEGATIVEDATAPROPERTYASSERTION; } cint64 CNegativeDataPropertyAssertionExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDataPropertyTermExpressionAssociator::getStructuralHashValue(),CIndividualTermExpressionAssociator::getStructuralHashValue(),CDataLiteralExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CNegativeDataPropertyAssertionExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CNegativeDataPropertyAssertionExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDataPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CDataLiteralExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CNegativeDataPropertyAssertionExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CDataPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CDataLiteralExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataFacetExpression.cpp0000644000175000017500000000366312520550704026553 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataFacetExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataFacetExpression::CDataFacetExpression(const QString& facetIRI) : CExpressionEntity(facetIRI) { } CDataFacetExpression::~CDataFacetExpression() { } CBuildExpression::ExpressionType CDataFacetExpression::getType() { return BETDATAFACETIRI; } cint64 CDataFacetExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType()); return hashValue; } bool CDataFacetExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataFacetExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return true; } bool CDataFacetExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { subExpressionVisitor->visitEntity(this,this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CSubExpressionVisitor.h0000644000175000017500000000354212520550732026512 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CSUBEXPRESSIONVISITOR_H #define KONCLUDE_PARSER_CSUBEXPRESSIONVISITOR_H // Libraries includes // Namespace includes #include "ExpressionSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CSubExpressionVisitor * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CSubExpressionVisitor { // public methods public: //! Constructor CSubExpressionVisitor(); virtual bool visitSubExpression(CBuildExpression* expression, CBuildExpression* subExpression, CSubExpressionVisitor* visitor) = 0; virtual bool visitEntity(CBuildExpression* expression, CExpressionEntity* entity, CSubExpressionVisitor* visitor) = 0; // protected methods protected: // private methods private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CSUBEXPRESSIONVISITOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CSubObjectPropertyOfExpression.cpp0000644000175000017500000000665012520550732030651 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CSubObjectPropertyOfExpression.h" namespace Konclude { namespace Parser { namespace Expression { CSubObjectPropertyOfExpression::CSubObjectPropertyOfExpression(CObjectPropertyTermExpression *subObjectPropertyExpression1, CObjectPropertyTermExpression *superbObjectPropertyExpression2) : CObjectPropertyTermExpressionAssociator(superbObjectPropertyExpression2), COrderedListObjectPropertyTermExpressionAssociator(subObjectPropertyExpression1) { } CSubObjectPropertyOfExpression::CSubObjectPropertyOfExpression(const CEXPRESSIONLIST& subObjectPropertyExpressionList, CObjectPropertyTermExpression *superbObjectPropertyExpression) : CObjectPropertyTermExpressionAssociator(superbObjectPropertyExpression), COrderedListObjectPropertyTermExpressionAssociator(subObjectPropertyExpressionList) { } CSubObjectPropertyOfExpression::~CSubObjectPropertyOfExpression() { } CEXPRESSIONLIST* CSubObjectPropertyOfExpression::getSubObjectPropertyTermExpressionList() { return getOrderedObjectPropertyTermExpressionList(); } CObjectPropertyTermExpression* CSubObjectPropertyOfExpression::getSuperObjectPropertyTermExpression() { return getObjectPropertyTermExpression(); } CBuildExpression::ExpressionType CSubObjectPropertyOfExpression::getType() { return BETSUBOBJECTPROPERTYOF; } cint64 CSubObjectPropertyOfExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue(),COrderedListObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CSubObjectPropertyOfExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CSubObjectPropertyOfExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && COrderedListObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CSubObjectPropertyOfExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); COrderedListObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CUnorderedPairClassTermExpressionAssociator.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CUnorderedPairClassTermExpressionAssociator0000644000175000017500000000324212520550732032561 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CUnorderedPairClassTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CUnorderedPairClassTermExpressionAssociator::CUnorderedPairClassTermExpressionAssociator(CClassTermExpression *expression1, CClassTermExpression *expression2) : CUnorderedPairExpressionAssociator(expression1,expression2) { } CUnorderedPairClassTermExpressionAssociator::~CUnorderedPairClassTermExpressionAssociator() { } CClassTermExpression* CUnorderedPairClassTermExpressionAssociator::getFirstClassTermExpression() { return (CClassTermExpression*)getFirstExpression(); } CClassTermExpression* CUnorderedPairClassTermExpressionAssociator::getSecondClassTermExpression() { return (CClassTermExpression*)getSecondExpression(); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CEquivalentClassesExpression.h0000644000175000017500000000453112520550712030031 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CEQUIVALENTCLASSESEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CEQUIVALENTCLASSESEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassAxiomExpression.h" #include "CListClassTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CEquivalentClassesExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CEquivalentClassesExpression : public CClassAxiomExpression, public CListClassTermExpressionAssociator { // public methods public: //! Constructor CEquivalentClassesExpression(CClassTermExpression *expression1, CClassTermExpression *expression2); CEquivalentClassesExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CEquivalentClassesExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CEQUIVALENTCLASSESEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CNameAssociator.cpp0000644000175000017500000000241312520550716025562 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNameAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CNameAssociator::CNameAssociator(const QString& newName) { name = newName; } CNameAssociator::~CNameAssociator() { } void CNameAssociator::setName(const QString& newName) { name = newName; } const QString& CNameAssociator::getName() { return name; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataPropertyAxiomExpression.h0000644000175000017500000000347412520550710030015 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYAXIOMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYAXIOMEXPRESSION_H // Libraries includes #include // Namespace includes #include "CAxiomExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CDataPropertyAxiomExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CDataPropertyAxiomExpression : public CAxiomExpression { // public methods public: //! Constructor CDataPropertyAxiomExpression(); //! Destructor virtual ~CDataPropertyAxiomExpression(); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATAPROPERTYAXIOMEXPRESSION_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetNondeterministicClassAssertionsExpression.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetNondeterministicClassAssertionsExp0000644000175000017500000000305012520550726032612 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetNondeterministicClassAssertionsExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetNondeterministicClassAssertionsExpression::CQueryGetNondeterministicClassAssertionsExpression(const QString& name, const CEXPRESSIONLIST& expressionList) : CQueryGetClassAssertionsExpression(name,expressionList) { } CQueryGetNondeterministicClassAssertionsExpression::~CQueryGetNondeterministicClassAssertionsExpression() { } CBuildExpression::ExpressionType CQueryGetNondeterministicClassAssertionsExpression::getType() { return BETGETNONDETERMINISTICCLASSASSERTIONS; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryAreClassesEquivalentExpression.cpp0000644000175000017500000000533712520550724032052 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryAreClassesEquivalentExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryAreClassesEquivalentExpression::CQueryAreClassesEquivalentExpression(const QString& name, const CEXPRESSIONLIST& classTermExpList) : CNameAssociator(name),CListClassTermExpressionAssociator(classTermExpList) { } CQueryAreClassesEquivalentExpression::~CQueryAreClassesEquivalentExpression() { } CEXPRESSIONLIST* CQueryAreClassesEquivalentExpression::getConstructedTestClasses() { return &mConstructedClassExpList; } CQueryAreClassesEquivalentExpression *CQueryAreClassesEquivalentExpression::addConstructedTestClass(CClassTermExpression *conBuildExp) { mConstructedClassExpList.append(conBuildExp); return this; } CBuildExpression::ExpressionType CQueryAreClassesEquivalentExpression::getType() { return BETARECLASSESEQUIVALENCE; } cint64 CQueryAreClassesEquivalentExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CQueryAreClassesEquivalentExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryAreClassesEquivalentExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryAreClassesEquivalentExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CPrecedentBuildPropertyExpression.h0000644000175000017500000000425412520550724031041 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CPRECEDENTBUILDPROPERTYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CPRECEDENTBUILDPROPERTYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyExpression.h" // Other includes #include "Reasoner/Ontology/CConcept.h" #include "Reasoner/Ontology/CRole.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { using namespace Reasoner::Ontology; namespace Parser { namespace Expression { /*! * \class CPrecedentBuildPropertyExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CPrecedentBuildPropertyExpression : public CObjectPropertyExpression { // public methods public: //! Constructor CPrecedentBuildPropertyExpression(const QString &probertyName, CRole *precedentBuildRole); //! Destructor virtual ~CPrecedentBuildPropertyExpression(); virtual ExpressionType getType(); virtual CRole *getPrecedentBuildRole(); // protected methods protected: // protected variables protected: CRole *role; // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CPRECEDENTBUILDPROPERTYEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CSubDataPropertyOfExpression.h0000644000175000017500000000472512520550732027762 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CSUBDATAPROPERTYOFEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CSUBDATAPROPERTYOFEXPRESSION_H // Libraries includes #include // Namespace includes #include "CDataPropertyAxiomExpression.h" #include "COrderedPairDataPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CSubDataPropertyOfExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CSubDataPropertyOfExpression : public CDataPropertyAxiomExpression, public COrderedPairDataPropertyTermExpressionAssociator { // public methods public: //! Constructor CSubDataPropertyOfExpression(CDataPropertyTermExpression *subObjectPropertyExpression1, CDataPropertyTermExpression *superbObjectPropertyExpression2); //! Destructor virtual ~CSubDataPropertyOfExpression(); virtual ExpressionType getType(); CDataPropertyTermExpression* getSubDataPropertyTermExpression(); CDataPropertyTermExpression* getSuperDataPropertyTermExpression(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CSUBDATAPROPERTYOFEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CFunctionalDataPropertyExpression.cpp0000644000175000017500000000465712520550714031405 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CFunctionalDataPropertyExpression.h" namespace Konclude { namespace Parser { namespace Expression { CFunctionalDataPropertyExpression::CFunctionalDataPropertyExpression(CDataPropertyTermExpression *expression) : CDataPropertyTermExpressionAssociator(expression) { } CFunctionalDataPropertyExpression::~CFunctionalDataPropertyExpression() { } CBuildExpression::ExpressionType CFunctionalDataPropertyExpression::getType() { return BETFUNCTIONALDATAPROPERTY; } CDataPropertyTermExpression *CFunctionalDataPropertyExpression::getFunctionalDataPropertyExpression() { return getDataPropertyTermExpression(); } cint64 CFunctionalDataPropertyExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDataPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CFunctionalDataPropertyExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CFunctionalDataPropertyExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDataPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CFunctionalDataPropertyExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CDataPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectSomeValuesFromExpression.h0000644000175000017500000000461512520550722030440 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTSOMEVALUESFROMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTSOMEVALUESFROMEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassTermExpression.h" #include "CObjectPropertyTermExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" #include "CClassTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectSomeValuesFromExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectSomeValuesFromExpression : public CClassTermExpression, public CObjectPropertyTermExpressionAssociator, public CClassTermExpressionAssociator { // public methods public: //! Constructor CObjectSomeValuesFromExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2); //! Destructor virtual ~CObjectSomeValuesFromExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTSOMEVALUESFROMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectHasValueExpression.h0000644000175000017500000000456312520550720027241 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTHASVALUEEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTHASVALUEEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassTermExpression.h" #include "CObjectPropertyTermExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" #include "CIndividualTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectHasValueExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectHasValueExpression : public CClassTermExpression, public CObjectPropertyTermExpressionAssociator, public CIndividualTermExpressionAssociator { // public methods public: //! Constructor CObjectHasValueExpression(CObjectPropertyTermExpression *expression1, CIndividualTermExpression *expression2); //! Destructor virtual ~CObjectHasValueExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTHASVALUEEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRuleAtomListExpression.cpp0000644000175000017500000000276412520550730027323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CRuleAtomListExpression.h" namespace Konclude { namespace Parser { namespace Expression { CRuleAtomListExpression::CRuleAtomListExpression(const CEXPRESSIONLIST& expressionList) : CListRuleAtomTermExpressionAssociator(expressionList) { } CRuleAtomListExpression::~CRuleAtomListExpression() { } bool CRuleAtomListExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListRuleAtomTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataPropertyDomainExpression.cpp0000644000175000017500000000502212520550710030471 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataPropertyDomainExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataPropertyDomainExpression::CDataPropertyDomainExpression(CDataPropertyTermExpression *expression1, CClassTermExpression *expression2) : CDataPropertyTermExpressionAssociator(expression1), CClassTermExpressionAssociator(expression2) { } CDataPropertyDomainExpression::~CDataPropertyDomainExpression() { } CBuildExpression::ExpressionType CDataPropertyDomainExpression::getType() { return BETDATAPROPERTYDOMAIN; } cint64 CDataPropertyDomainExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CDataPropertyTermExpressionAssociator::getStructuralHashValue(),CClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDataPropertyDomainExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataPropertyDomainExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CDataPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CDataPropertyDomainExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CDataPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDifferentIndividualsExpression.cpp0000644000175000017500000000500312520550712031026 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDifferentIndividualsExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDifferentIndividualsExpression::CDifferentIndividualsExpression(CIndividualTermExpression *expression1, CIndividualTermExpression *expression2) : CListIndividualTermExpressionAssociator(expression1,expression2) { } CDifferentIndividualsExpression::CDifferentIndividualsExpression(const CEXPRESSIONLIST& expressionList) : CListIndividualTermExpressionAssociator(expressionList) { } CDifferentIndividualsExpression::~CDifferentIndividualsExpression() { } CBuildExpression::ExpressionType CDifferentIndividualsExpression::getType() { return BETDIFFERENTINDIVIDUAL; } cint64 CDifferentIndividualsExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListIndividualTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CDifferentIndividualsExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDifferentIndividualsExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CDifferentIndividualsExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectExpression.h0000644000175000017500000000331712520550720025604 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_COBJECTEXPRESSION_H #define KONCLUDE_PARSER_COBJECTEXPRESSION_H // Libraries includes #include // Namespace includes #include "CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectExpression : public CBuildExpression { // public methods public: //! Constructor CObjectExpression(); //! Destructor virtual ~CObjectExpression(); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_COBJECTEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDeclarationAxiomExpression.h0000644000175000017500000000426112520550712027621 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDECLARATIONAXIOMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDECLARATIONAXIOMEXPRESSION_H // Libraries includes // Namespace includes #include "CAxiomExpression.h" #include "CEntityAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDeclarationAxiomExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDeclarationAxiomExpression : public CAxiomExpression, public CEntityAssociator { // public methods public: //! Constructor CDeclarationAxiomExpression(CExpressionEntity* entity); //! Destructor virtual ~CDeclarationAxiomExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDECLARATIONAXIOMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectIntersectionOfExpression.h0000644000175000017500000000455012520550720030460 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_COBJECTINTERSECTIONOFEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_COBJECTINTERSECTIONOFEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassTermExpression.h" #include "CListClassTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CObjectIntersectionOfExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CObjectIntersectionOfExpression : public CClassTermExpression, public CListClassTermExpressionAssociator { // public methods public: //! Constructor CObjectIntersectionOfExpression(CClassTermExpression *expression1 = 0, CClassTermExpression *expression2 = 0); CObjectIntersectionOfExpression(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CObjectIntersectionOfExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_COBJECTINTERSECTIONOFEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyTermExpressionAssociator.cpp0000644000175000017500000000323112520550722032561 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectPropertyTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { CObjectPropertyTermExpressionAssociator::CObjectPropertyTermExpressionAssociator(CObjectPropertyTermExpression *expression) : CExpressionAssociator(expression) { } CObjectPropertyTermExpression* CObjectPropertyTermExpressionAssociator::getObjectPropertyTermExpression() { // bad cast to avoid lot of reimplementation return (CObjectPropertyTermExpression*)getExpression(); } bool CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(const CObjectPropertyTermExpressionAssociator& objectTermExpressionAssociator) { return CExpressionAssociator::compareStructuralEquivalence(objectTermExpressionAssociator); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CAsymmetricObjectPropertyExpression.h0000644000175000017500000000464212520550704031413 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CASYMMETRICOBJECTPROPERTYEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CASYMMETRICOBJECTPROPERTYEXPRESSION_H // Libraries includes #include // Namespace includes #include "CObjectPropertyAxiomExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CAsymmetricObjectPropertyExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CAsymmetricObjectPropertyExpression : public CObjectPropertyAxiomExpression, public CObjectPropertyTermExpressionAssociator { // public methods public: //! Constructor CAsymmetricObjectPropertyExpression(CObjectPropertyTermExpression *expression); //! Destructor virtual ~CAsymmetricObjectPropertyExpression(); CObjectPropertyTermExpression *getAsymmetricObjectPropertyExpression(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual ExpressionType getType(); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CASYMMETRICOBJECTPROPERTYEXPRESSION_H ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairObjectPropertyTermExpressionAssociator.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairObjectPropertyTermExpressionAss0000644000175000017500000000343112520550724032544 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COrderedPairObjectPropertyTermExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { COrderedPairObjectPropertyTermExpressionAssociator::COrderedPairObjectPropertyTermExpressionAssociator(CObjectPropertyTermExpression *expression1, CObjectPropertyTermExpression *expression2) : COrderedPairExpressionAssociator(expression1,expression2) { } COrderedPairObjectPropertyTermExpressionAssociator::~COrderedPairObjectPropertyTermExpressionAssociator() { } CObjectPropertyTermExpression* COrderedPairObjectPropertyTermExpressionAssociator::getFirstObjectPropertyTermExpression() { return (CObjectPropertyTermExpression*)getFirstExpression(); } CObjectPropertyTermExpression* COrderedPairObjectPropertyTermExpressionAssociator::getSecondObjectPropertyTermExpression() { return (CObjectPropertyTermExpression*)getSecondExpression(); } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyExpression.cpp0000644000175000017500000000376712520550722027717 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectPropertyExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectPropertyExpression::CObjectPropertyExpression(const QString& probertyName) : CExpressionEntity(probertyName) { } CObjectPropertyExpression::~CObjectPropertyExpression() { } cint64 CObjectPropertyExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType()); return hashValue; } bool CObjectPropertyExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectPropertyExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return true; } CBuildExpression::ExpressionType CObjectPropertyExpression::getType() { return BETOBJECTPROPERTY; } bool CObjectPropertyExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { subExpressionVisitor->visitEntity(this,this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyRangeExpression.cpp0000644000175000017500000000504612520550722030664 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectPropertyRangeExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectPropertyRangeExpression::CObjectPropertyRangeExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2) : CObjectPropertyTermExpressionAssociator(expression1), CClassTermExpressionAssociator(expression2) { } CObjectPropertyRangeExpression::~CObjectPropertyRangeExpression() { } CBuildExpression::ExpressionType CObjectPropertyRangeExpression::getType() { return BETOBJECTPROPERTYRANGE; } cint64 CObjectPropertyRangeExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue(),CClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CObjectPropertyRangeExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectPropertyRangeExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CObjectPropertyRangeExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryIsClassSatisfiableExpression.cpp0000644000175000017500000000443312520550730031470 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryIsClassSatisfiableExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryIsClassSatisfiableExpression::CQueryIsClassSatisfiableExpression(const QString& name, CClassTermExpression* expression) : CNameAssociator(name),CClassTermExpressionAssociator(expression) { } CQueryIsClassSatisfiableExpression::~CQueryIsClassSatisfiableExpression() { } CBuildExpression::ExpressionType CQueryIsClassSatisfiableExpression::getType() { return BETISCLASSSATISFIABLE; } cint64 CQueryIsClassSatisfiableExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CClassTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CQueryIsClassSatisfiableExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryIsClassSatisfiableExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryIsClassSatisfiableExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetSubClassesExpression.cpp0000644000175000017500000000464712520550726030503 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetSubClassesExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetSubClassesExpression::CQueryGetSubClassesExpression(const QString& name, bool direct, CClassTermExpression* classTermExp) : CNameAssociator(name),CClassTermExpressionAssociator(classTermExp),mDirect(direct) { } CQueryGetSubClassesExpression::~CQueryGetSubClassesExpression() { } CBuildExpression::ExpressionType CQueryGetSubClassesExpression::getType() { return BETGETSUBCLASSES; } cint64 CQueryGetSubClassesExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CClassTermExpressionAssociator::getStructuralHashValue(),(cint64)mDirect); return hashValue; } bool CQueryGetSubClassesExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryGetSubClassesExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } if (compExpCast->mDirect != mDirect) { return false; } return CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryGetSubClassesExpression::isDirect() { return mDirect; } bool CQueryGetSubClassesExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListClassVariableTermExpressionAssociator.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CListClassVariableTermExpressionAssociator.0000644000175000017500000000516712520550714032465 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CLISTCLASSVARIABLETERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CLISTCLASSVARIABLETERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CClassTermExpression.h" #include "CListExpressionAssociator.h" #include "CObjectIndividualVariableExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CListClassVariableTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CListClassVariableTermExpressionAssociator : public CListExpressionAssociator { // public methods public: //! Constructor CListClassVariableTermExpressionAssociator(CObjectIndividualVariableExpression* expression1 = nullptr, CObjectIndividualVariableExpression* expression2 = nullptr, CObjectIndividualVariableExpression* expression3 = nullptr); CListClassVariableTermExpressionAssociator(const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CListClassVariableTermExpressionAssociator(); CEXPRESSIONLIST* getClassVariableTermExpressionList(); virtual bool compareStructuralEquivalence(const CListClassVariableTermExpressionAssociator& listClassTermExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CLISTCLASSVARIABLETERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectPropertyAssertionExpression.cpp0000644000175000017500000000524012520550720031571 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectPropertyAssertionExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectPropertyAssertionExpression::CObjectPropertyAssertionExpression(CObjectPropertyTermExpression *propertyExpression1, CIndividualTermExpression *sourceExpression2, CIndividualTermExpression *targetExpression3) : CObjectPropertyTermExpressionAssociator(propertyExpression1),COrderedPairIndividualTermExpressionAssociator(sourceExpression2,targetExpression3) { } CBuildExpression::ExpressionType CObjectPropertyAssertionExpression::getType() { return BETOBJECTPROPERTYASSERTION; } cint64 CObjectPropertyAssertionExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue(),COrderedPairIndividualTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CObjectPropertyAssertionExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectPropertyAssertionExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && COrderedPairIndividualTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CObjectPropertyAssertionExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); COrderedPairIndividualTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/COrderedPairExpressionAssociator.cpp0000644000175000017500000000341312520550724031162 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COrderedPairExpressionAssociator.h" namespace Konclude { namespace Parser { namespace Expression { COrderedPairExpressionAssociator::COrderedPairExpressionAssociator(CBuildExpression *expression1, CBuildExpression *expression2) : CPairExpressionAssociator(expression1,expression2) { } cint64 COrderedPairExpressionAssociator::getStructuralHashValue() { return CExpressionHashMixer::getHashValueMixed(cint64(getFirstExpression()),cint64(getSecondExpression())); } bool COrderedPairExpressionAssociator::compareStructuralEquivalence(const COrderedPairExpressionAssociator& orderedPairExpressionAssociator) { if (orderedPairExpressionAssociator.getFirstExpression() != getFirstExpression()) { return false; } if (orderedPairExpressionAssociator.getSecondExpression() != getSecondExpression()) { return false; } return true; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRuleAtomTermExpression.h0000644000175000017500000000341612520550730026757 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CRULEATOMTERMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CRULEATOMTERMEXPRESSION_H // Libraries includes // Namespace includes #include "ExpressionSettings.h" #include "CBuildExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CRuleAtomTermExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRuleAtomTermExpression : public CBuildExpression { // public methods public: //! Constructor CRuleAtomTermExpression(); //! Destructor virtual ~CRuleAtomTermExpression(); // protected methods protected: // private methods private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CRULEATOMTERMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetFlattenedInstancesExpression.cpp0000644000175000017500000000502112520550726032175 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryGetFlattenedInstancesExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryGetFlattenedInstancesExpression::CQueryGetFlattenedInstancesExpression(const QString& name, bool direct, CClassTermExpression* classTermExp) : CNameAssociator(name),CClassTermExpressionAssociator(classTermExp),mDirect(direct) { } CQueryGetFlattenedInstancesExpression::~CQueryGetFlattenedInstancesExpression() { } CBuildExpression::ExpressionType CQueryGetFlattenedInstancesExpression::getType() { return BETGETFLATTENEDINDIVIDUALS; } cint64 CQueryGetFlattenedInstancesExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CClassTermExpressionAssociator::getStructuralHashValue(),(cint64)mDirect); return hashValue; } bool CQueryGetFlattenedInstancesExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryGetFlattenedInstancesExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } if (compExpCast->mDirect != mDirect) { return false; } return CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryGetFlattenedInstancesExpression::isDirect() { return mDirect; } bool CQueryGetFlattenedInstancesExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CClassTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDatatypeRestrictionExpression.h0000644000175000017500000000524012520550710030373 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CDATATYPERESTRICTIONEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CDATATYPERESTRICTIONEXPRESSION_H // Libraries includes #include // Namespace includes #include "CNameAssociator.h" #include "CBuildExpression.h" #include "CDataRangeTermExpression.h" #include "CListDataFacetRestrictionExpressionAssociator.h" #include "CDatatypeExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CDatatypeRestrictionExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CDatatypeRestrictionExpression : public CDataRangeTermExpression, public CDatatypeExpressionAssociator, public CListDataFacetRestrictionExpressionAssociator { // public methods public: //! Constructor CDatatypeRestrictionExpression(CDatatypeExpression* datatypeExpression = nullptr, CDataFacetRestrictionExpression* expression1 = nullptr, CDataFacetRestrictionExpression* expression2 = nullptr); CDatatypeRestrictionExpression(CDatatypeExpression* datatypeExpression, const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CDatatypeRestrictionExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CDATATYPERESTRICTIONEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetObjectPropertyTargetsExpression.h0000644000175000017500000000501312520550726032372 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYGETOBJECTPROPERTYTARGETSEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYGETOBJECTPROPERTYTARGETSEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryExpression.h" #include "CObjectPropertyTermExpressionAssociator.h" #include "CIndividualTermExpressionAssociator.h" #include "CNameAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetObjectPropertyTargetsExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetObjectPropertyTargetsExpression : public CQueryExpression, public CObjectPropertyTermExpressionAssociator, public CIndividualTermExpressionAssociator, public CNameAssociator { // public methods public: //! Constructor CQueryGetObjectPropertyTargetsExpression(const QString& name, CObjectPropertyTermExpression* objPropTermExp, CIndividualTermExpression* indiTermExp); //! Destructor virtual ~CQueryGetObjectPropertyTargetsExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYGETOBJECTPROPERTYTARGETSEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CObjectExactlyCardinalityExpression.cpp0000644000175000017500000000440612520550720031655 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CObjectExactlyCardinalityExpression.h" namespace Konclude { namespace Parser { namespace Expression { CObjectExactlyCardinalityExpression::CObjectExactlyCardinalityExpression(CObjectPropertyTermExpression *expression1, CClassTermExpression *expression2, cint64 cardinality) : CObjectCardinalityExpression(expression1,expression2,cardinality) { } CObjectExactlyCardinalityExpression::~CObjectExactlyCardinalityExpression() { } CBuildExpression::ExpressionType CObjectExactlyCardinalityExpression::getType() { return BETOBJECTEXACTLYCARDINALITY; } cint64 CObjectExactlyCardinalityExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue(),CClassTermExpressionAssociator::getStructuralHashValue(),mCard); return hashValue; } bool CObjectExactlyCardinalityExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CObjectExactlyCardinalityExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && CClassTermExpressionAssociator::compareStructuralEquivalence(*compExpCast) && compExpCast->mCard == mCard; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryIsEntailedExpression.cpp0000644000175000017500000000514212520550730027777 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQueryIsEntailedExpression.h" namespace Konclude { namespace Parser { namespace Expression { CQueryIsEntailedExpression::CQueryIsEntailedExpression(const QString& name, const CEXPRESSIONLIST& axiomExpList) : CNameAssociator(name),CListAxiomExpressionAssociator(axiomExpList) { } CQueryIsEntailedExpression::~CQueryIsEntailedExpression() { } CEXPRESSIONLIST* CQueryIsEntailedExpression::getConstructedTestAxiomExpressions() { return &mConstructedAxiomExpList; } CQueryIsEntailedExpression *CQueryIsEntailedExpression::addConstructedTestAxiomExpressions(CEntailmentAxiomExpressionAssociation *conBuildExp) { mConstructedAxiomExpList.append(conBuildExp); return this; } CBuildExpression::ExpressionType CQueryIsEntailedExpression::getType() { return BETISENTAILED; } cint64 CQueryIsEntailedExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CListAxiomExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CQueryIsEntailedExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CQueryIsEntailedExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CListAxiomExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CQueryIsEntailedExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CListAxiomExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CPrecedentBuildIndividualExpression.cpp0000644000175000017500000000307712520550724031642 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CPrecedentBuildIndividualExpression.h" namespace Konclude { namespace Parser { namespace Expression { CPrecedentBuildIndividualExpression::CPrecedentBuildIndividualExpression(QString individualName, CIndividual *precedentBuildIndividual) : CNamedIndividualExpression(individualName) { individual = precedentBuildIndividual; } CPrecedentBuildIndividualExpression::~CPrecedentBuildIndividualExpression() { } CBuildExpression::ExpressionType CPrecedentBuildIndividualExpression::getType() { return BETPRECEDENTINDIVIDUALBUILD; } CIndividual *CPrecedentBuildIndividualExpression::getPrecedentBuildIndividual() { return individual; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CIndividualTermExpressionAssociator.h0000644000175000017500000000423012520550714031344 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CINDIVIDUALTERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CINDIVIDUALTERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CIndividualTermExpression.h" #include "CExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CIndividualTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CIndividualTermExpressionAssociator : public CExpressionAssociator { // public methods public: //! Constructor CIndividualTermExpressionAssociator(CIndividualTermExpression* expression = nullptr); CIndividualTermExpression* getIndividualTermExpression(); virtual bool compareStructuralEquivalence(const CIndividualTermExpressionAssociator& indiTermExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CINDIVIDUALTERMEXPRESSIONASSOCIATOR_H ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetDeterministicClassAssertionsExpression.hKonclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CQueryGetDeterministicClassAssertionsExpres0000644000175000017500000000417312520550726032620 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CQUERYGETDETERMINISTICCLASSASSERTIONSEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CQUERYGETDETERMINISTICCLASSASSERTIONSEXPRESSION_H // Libraries includes // Namespace includes #include "CQueryGetClassAssertionsExpression.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CQueryGetDeterministicClassAssertionsExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CQueryGetDeterministicClassAssertionsExpression : public CQueryGetClassAssertionsExpression { // public methods public: //! Constructor CQueryGetDeterministicClassAssertionsExpression(const QString& name, const CEXPRESSIONLIST& expressionList); //! Destructor virtual ~CQueryGetDeterministicClassAssertionsExpression(); virtual ExpressionType getType(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CQUERYGETDETERMINISTICCLASSASSERTIONSEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CRuleClassAtomTermExpression.h0000644000175000017500000000450012520550730027740 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CRULECLASSATOMTERMEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CRULECLASSATOMTERMEXPRESSION_H // Libraries includes // Namespace includes #include "ExpressionSettings.h" #include "CRuleAtomTermExpression.h" #include "CClassTermExpressionAssociator.h" #include "CClassVariableTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CRuleClassAtomTermExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CRuleClassAtomTermExpression : public CRuleAtomTermExpression, public CClassTermExpressionAssociator, public CClassVariableTermExpressionAssociator { // public methods public: //! Constructor CRuleClassAtomTermExpression(CClassTermExpression* expression1, CObjectIndividualVariableExpression* expression2); //! Destructor virtual ~CRuleClassAtomTermExpression(); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CRULECLASSATOMTERMEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CDataLexicalValueExpression.cpp0000644000175000017500000000402412520550706030101 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CDataLexicalValueExpression.h" namespace Konclude { namespace Parser { namespace Expression { CDataLexicalValueExpression::CDataLexicalValueExpression(const QString& lexicalDataValue) : CExpressionEntity(lexicalDataValue) { } CDataLexicalValueExpression::~CDataLexicalValueExpression() { } CBuildExpression::ExpressionType CDataLexicalValueExpression::getType() { return BETDATALEXICALVALUE; } cint64 CDataLexicalValueExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType()); return hashValue; } bool CDataLexicalValueExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CDataLexicalValueExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return true; } bool CDataLexicalValueExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { subExpressionVisitor->visitEntity(this,this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CBuildExpression.cpp0000644000175000017500000000221512520550704025766 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CBuildExpression.h" namespace Konclude { namespace Parser { namespace Expression { CBuildExpression::CBuildExpression() { } bool CBuildExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CFunctionalObjectPropertyExpression.cpp0000644000175000017500000000473112520550714031733 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CFunctionalObjectPropertyExpression.h" namespace Konclude { namespace Parser { namespace Expression { CFunctionalObjectPropertyExpression::CFunctionalObjectPropertyExpression(CObjectPropertyTermExpression *expression) : CObjectPropertyTermExpressionAssociator(expression) { } CFunctionalObjectPropertyExpression::~CFunctionalObjectPropertyExpression() { } CBuildExpression::ExpressionType CFunctionalObjectPropertyExpression::getType() { return BETFUNCTIONALOBJECTPROPERTY; } CObjectPropertyTermExpression *CFunctionalObjectPropertyExpression::getFunctionalObjectPropertyExpression() { return getObjectPropertyTermExpression(); } cint64 CFunctionalObjectPropertyExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType(),CObjectPropertyTermExpressionAssociator::getStructuralHashValue()); return hashValue; } bool CFunctionalObjectPropertyExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CFunctionalObjectPropertyExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return CObjectPropertyTermExpressionAssociator::compareStructuralEquivalence(*compExpCast); } bool CFunctionalObjectPropertyExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { CObjectPropertyTermExpressionAssociator::visitSubExpressions(this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CClassVariableTermExpressionAssociator.h0000644000175000017500000000442512520550704031774 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CCLASSVARIABLETERMEXPRESSIONASSOCIATOR_H #define KONCLUDE_PARSER_EXPRESSION_CCLASSVARIABLETERMEXPRESSIONASSOCIATOR_H // Libraries includes #include // Namespace includes #include "ExpressionSettings.h" #include "CObjectIndividualVariableExpression.h" #include "CExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CClassVariableTermExpressionAssociator * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassVariableTermExpressionAssociator : public CExpressionAssociator { // public methods public: //! Constructor CClassVariableTermExpressionAssociator(CObjectIndividualVariableExpression* expression = nullptr); //! Destructor virtual ~CClassVariableTermExpressionAssociator(); CObjectIndividualVariableExpression* getClassVariableExpression(); virtual bool compareStructuralEquivalence(const CClassVariableTermExpressionAssociator& classExpressionAssociator); // protected methods protected: // private methods private: // protected variables protected: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CCLASSVARIABLETERMEXPRESSIONASSOCIATOR_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CSubClassOfExpression.h0000644000175000017500000000451112520550732026402 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CSUBCLASSOFEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CSUBCLASSOFEXPRESSION_H // Libraries includes #include // Namespace includes #include "CClassAxiomExpression.h" #include "COrderedPairClassTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CSubClassOfExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CSubClassOfExpression : public CClassAxiomExpression, public COrderedPairClassTermExpressionAssociator { // public methods public: //! Constructor CSubClassOfExpression(CClassTermExpression *subClassExpression1, CClassTermExpression *superClassExpression2); //! Destructor virtual ~CSubClassOfExpression(); virtual ExpressionType getType(); CClassTermExpression* getSubClassTermExpression(); CClassTermExpression* getSuperClassTermExpression(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CSUBCLASSOFEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CNameExpression.h0000644000175000017500000000335112520550716025261 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CNAMEEXPRESSION_H #define KONCLUDE_PARSER_CNAMEEXPRESSION_H // Libraries includes #include // Namespace includes // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * \class CNameExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO */ class CNameExpression { // public methods public: //! Constructor CNameExpression(QString newName); //! Destructor virtual ~CNameExpression(); void setName(QString newName); QString getName(); // protected methods protected: // private methods private: // private variables private: QString name; }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CNAMEEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CNamedIndividualExpression.cpp0000644000175000017500000000401012520550716027762 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CNamedIndividualExpression.h" namespace Konclude { namespace Parser { namespace Expression { CNamedIndividualExpression::CNamedIndividualExpression(const QString& namedIndividual) : CExpressionEntity(namedIndividual) { } CNamedIndividualExpression::~CNamedIndividualExpression() { } CBuildExpression::ExpressionType CNamedIndividualExpression::getType() { return BETNAMEDINDIVIDUAL; } cint64 CNamedIndividualExpression::getStructuralHashValue() { cint64 hashValue = CExpressionHashMixer::getHashValueMixed((cint64)getType()); return hashValue; } bool CNamedIndividualExpression::compareStructuralEquivalence(CBuildExpression* compareExpression) { CNamedIndividualExpression* compExpCast = dynamic_cast(compareExpression); if (!compExpCast) { return false; } return true; } bool CNamedIndividualExpression::visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor) { if (subExpressionVisitor) { subExpressionVisitor->visitEntity(this,this,subExpressionVisitor); return true; } return false; } }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/Expressions/CClassAssertionExpression.h0000644000175000017500000000445512520550704027341 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_EXPRESSION_CCLASSASSERTIONEXPRESSION_H #define KONCLUDE_PARSER_EXPRESSION_CCLASSASSERTIONEXPRESSION_H // Libraries includes #include // Namespace includes #include "CAssertionAxiomExpression.h" #include "CIndividualTermExpressionAssociator.h" #include "CClassTermExpressionAssociator.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace Expression { /*! * * \class CClassAssertionExpression * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CClassAssertionExpression : public CAssertionAxiomExpression, public CIndividualTermExpressionAssociator, public CClassTermExpressionAssociator { // public methods public: //! Constructor CClassAssertionExpression(CIndividualTermExpression *expression1, CClassTermExpression *expression2); virtual ExpressionType getType(); virtual cint64 getStructuralHashValue(); virtual bool compareStructuralEquivalence(CBuildExpression* compareExpression); virtual bool visitSubExpressions(CSubExpressionVisitor* subExpressionVisitor); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace Expression }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_EXPRESSION_CCLASSASSERTIONEXPRESSION_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CQtXMLContentHandlerConverter.h0000644000175000017500000000442612520550740025466 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CQTXMLCONTENTHANDLERCONVERTER_H #define KONCLUDE_PARSER_CQTXMLCONTENTHANDLERCONVERTER_H // Libraries includes #include // Namespace includes #include "ParserSettings.h" #include "CXMLHandlerStackBase.h" #include "CXMLParsingHandlingContext.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { /*! * * \class CQtXMLContentHandlerConverter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtXMLContentHandlerConverter : public QXmlDefaultHandler { // public methods public: //! Constructor CQtXMLContentHandlerConverter(CXMLHandlerStackBase* handlerStack, CXMLParsingHandlingContext* parsingHandlingContext); virtual bool endElement(const QString& namespaceURI, const QString& localName, const QString& qName); virtual bool startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts); virtual bool startDocument(); virtual bool endDocument(); // protected methods protected: // protected variables protected: CXMLHandlerStackBase* mHandlerStack; CXMLParsingHandlingContext* mParsingHandlingContext; // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CQTXMLCONTENTHANDLERCONVERTER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLTestsuiteCommandParser.h0000644000175000017500000000707112520550742025027 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CXMLTESTSUITECOMMANDPARSER_H #define KONCLUDE_PARSER_CXMLTESTSUITECOMMANDPARSER_H // Libraries includes #include #include #include #include // Namespace includes #include "CCommandParser.h" // Other includes #include "Control/Command/Instructions/CParseTestsuiteCommandsCommand.h" #include "Control/Command/Instructions/CTestTestsuiteCommand.h" #include "Control/Command/Instructions/CSkipUnsupportedCommandCommand.h" #include "Control/Command/Instructions/CTestTestfileCommand.h" #include "Control/Command/Instructions/CParseTestsuiteXMLNodeCommand.h" #include "Control/Command/Records/CFinishProcessCommandRecord.h" #include "Control/Command/Records/CStartProcessCommandRecord.h" #include "Control/Command/Records/CStopProcessCommandRecord.h" #include "Control/Command/Records/CNotSupportedNodeErrorRecord.h" #include "Control/Command/CCommandDelegater.h" #include "Control/Command/CCommandProcessedPrecondition.h" #include "Reasoner/Query/CBooleanQueryResult.h" #include "Reasoner/Query/CQueryResult.h" #include "Logger/CLogIdentifier.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; using namespace std; namespace Konclude { using namespace Reasoner::Query; using namespace Control::Command; using namespace Instructions; using namespace Records; namespace Parser { /*! * * \class CXMLTestsuiteCommandParser * \author Andreas Steigmiller * \version 0.1 * \brief Parser for OWL/XML Files * */ class CXMLTestsuiteCommandParser : public CCommandParser, public CLogIdentifier { // public methods public: //! Constructor CXMLTestsuiteCommandParser(); //! Destructor virtual ~CXMLTestsuiteCommandParser(); virtual bool realizeCommand(CParseTestsuiteCommandsCommand *command, CCommandDelegater *commandDelegater); virtual bool realizeCommand(CParseTestsuiteXMLNodeCommand *command, CCommandDelegater *commandDelegater); virtual bool parse(const QByteArray &content); virtual bool parse(QDomElement *node); // protected methods protected: void parseOWLlinkTestsuiteRequestNode(QDomElement *requestNode); CTestTestsuiteCommand *parseTestTestsuiteNode(QDomElement *descriptionNode); CTestTestfileCommand *parseTestTestfileNode(QDomElement *node, CTestTestsuiteCommand *testTestsuiteComm); // protected variables protected: CParseTestsuiteCommandsCommand *command; CParseTestsuiteXMLNodeCommand *nodeCommand; CCommandRecorder *recorder; CCommandDelegater *delegater; QString sourcePath; // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CXMLTESTSUITECOMMANDPARSER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/CXMLHandler.cpp0000644000175000017500000000171712520550740022271 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CXMLHandler.h" namespace Konclude { namespace Parser { CXMLHandler::CXMLHandler() { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/COntologyParser.cpp0000644000175000017500000000200712520550736023320 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COntologyParser.h" namespace Konclude { namespace Parser { COntologyParser::COntologyParser() { } COntologyParser::~COntologyParser() { } }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/0000755000175000017500000000000012613407252022472 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/CJAVACCParser.h0000644000175000017500000000345412520550734025061 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_FUNCTIONALJAVACC_CJAVACCPARSER_H #define KONCLUDE_PARSER_FUNCTIONALJAVACC_CJAVACCPARSER_H // Libraries includes #include // Namespace includes #include "FunctionalJAVACCSettings.h" // Other includes #include "Parser/COntologyBuilder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { using namespace Expression; namespace FunctionalJAVACC { /*! * * \class CJAVACCParser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CJAVACCParser { // public methods public: //! Constructor CJAVACCParser(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_FUNCTIONALJAVACC_CJAVACCPARSER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/Token.cpp0000644000175000017500000000472712315260742024270 0ustar jonasjonas/* Generated By:JavaCC: Do not edit this line. Token.cc Version 6.0 */ /* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,TOKEN_INCLUDES=CTokenBase.h,TOKEN_EXTENDS=CTokenBase */ #include "Token.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { /** * Describes the input token stream. */ /** * An optional attribute value of the Token. * Tokens which are not used as syntactic sugar will often contain * meaningful values that will be used later on by the compiler or * interpreter. This attribute value is often different from the image. * Any subclass of Token that actually wants to return a non-NULL value can * override this method as appropriate. */ void * Token::getValue() { return NULL; } /** * No-argument constructor */ Token::Token() { this->next = NULL; this->specialToken = NULL; } /** * Constructs a new token for the specified Image. */ Token::Token(int kind) { this->kind = kind; this->next = NULL; this->specialToken = NULL; } /** * Constructs a new token for the specified Image and Kind. */ Token::Token(int kind, JAVACC_STRING_TYPE image) { this->kind = kind; this->image = image; this->next = NULL; this->specialToken = NULL; } /** * Returns the image. */ JAVACC_STRING_TYPE Token::toString() { return image; } /** * Returns a new Token object, by default. However, if you want, you * can create and return subclass objects based on the value of ofKind. * Simply add the cases to the switch for all those special cases. * For example, if you have a subclass of Token called IDToken that * you want to create if ofKind is ID, simply add something like : * * case MyParserConstants.ID : return new IDToken(ofKind, image); * * to the following switch statement. Then you can cast matchedToken * variable to the appropriate type and use sit in your lexical actions. */ Token *Token::newToken(int ofKind, JAVACC_STRING_TYPE image) { switch(ofKind) { default : return new Token(ofKind, image); } } Token *Token::newToken(int ofKind) { return newToken(ofKind, JAVACC_STRING_TYPE((JAVACC_CHAR_TYPE*)"")); } Token::~Token() { if (specialToken) delete specialToken; } } } } /* JavaCC - OriginalChecksum=d964ca3869acc778134ca8a3306f6958 (do not edit this line) */ Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/ParseException.h0000644000175000017500000000637612315260742025610 0ustar jonasjonas/* Generated By:JavaCC: Do not edit this line. ParseException.h Version 6.0 */ /* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ #ifndef _PARSE_EXCEPTION_H #define _PARSE_EXCEPTION_H #include "JavaCC.h" #include "Token.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { /** * This exception is thrown when parse errors are encountered. * You can explicitly create objects of this exception type by * calling the method generateParseException in the generated * parser. * * You can modify this class to customize your error reporting * mechanisms so long as you retain the fields. */ class ParseException { public: /** * This constructor is used by the method "generateParseException" * in the generated parser. Calling this constructor generates * a new object of this type with the fields "currentToken", * "expectedTokenSequences", and "tokenImage" set. */ ParseException(Token currentTokenVal, int** expectedTokenSequencesVal, JAVACC_STRING_TYPE* tokenImageVal ); /** * The following constructors are for use by you for whatever * purpose you can think of. Constructing the exception in this * manner makes the exception behave in the normal way - i.e., as * documented in the class "Throwable". The fields "errorToken", * "expectedTokenSequences", and "tokenImage" do not contain * relevant information. The JavaCC generated code does not use * these constructors. */ ParseException(); /** Constructor with message. */ ParseException(JAVACC_STRING_TYPE message); /** * This is the last token that has been consumed successfully. If * this object has been created due to a parse error, the token * followng this token will (therefore) be the first error token. */ Token currentToken; /** * Each entry in this array is an array of integers. Each array * of integers represents a sequence of tokens (by their ordinal * values) that is expected at this point of the parse. */ int** expectedTokenSequences; /** * This is a reference to the "tokenImage" array of the generated * parser within which the parse error occurred. This array is * defined in the generated ...Constants class. */ JAVACC_STRING_TYPE* tokenImage; /** * It uses "currentToken" and "expectedTokenSequences" to generate a parse * error message and returns it. If this object has been created * due to a parse error, and you do not catch it (it gets thrown * from the parser) the correct error message * gets displayed. */ private: JAVACC_STRING_TYPE initialise(Token currentToken, int** expectedTokenSequences, JAVACC_STRING_TYPE* tokenImage); /** * The end of line string for this machine. */ #define eol "\n" /** * Used to convert raw characters to their escaped version * when these raw version cannot be used as part of an ASCII * string literal. */ JAVACC_STRING_TYPE add_escapes(JAVACC_STRING_TYPE str); }; } } } #endif /* JavaCC - OriginalChecksum=9c0f1db15d15cbaaa80670886f32f98a (do not edit this line) */ Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/TokenMgrError.cpp0000644000175000017500000000742112315260742025742 0ustar jonasjonas/* Generated By:JavaCC: Do not edit this line. TokenMgrError.cc Version 6.0 */ /* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ #include "TokenMgrError.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { /** * Returns a detailed message for the Error when it is thrown by the * token manager to indicate a lexical error. * Parameters : * EOFSeen : indicates if EOF caused the lexical error * curLexState : lexical state in which this error occurred * errorLine : line number when the error occurred * errorColumn : column number when the error occurred * errorAfter : prefix that was seen before this error occurred * curJAVACC_CHAR_TYPE : the offending character * Note: You can customize the lexical error message by modifying this method. */ JAVACC_STRING_TYPE TokenMgrError::LexicalError(bool EOFSeen, int lexState, int errorLine, int errorColumn, JAVACC_STRING_TYPE errorAfter, JAVACC_CHAR_TYPE curChar) { #if 0 JAVACC_STRING_TYPE s; stringstream ss; ss << "Lexical error at line " << errorLine << " column " << errorColumn << ". Encountered: " << curChar << "(" << (int)curChar << ") after : \"" << errorAfter.c_str() << "\""; return (JAVACC_STRING_TYPE)ss.rdbuf()->str(); #endif return EMPTY; } /** * You can also modify the body of this method to customize your error messages. * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not * of end-users concern, so you can return something like : * * "Internal Error : Please file a bug report .... " * * from this method for such cases in the release version of your parser. */ JAVACC_STRING_TYPE TokenMgrError::getMessage() { return message; } /* * Constructors of various flavors follow. */ /** No arg constructor. */ TokenMgrError::TokenMgrError() { } /** Constructor with message and reason. */ TokenMgrError::TokenMgrError(JAVACC_STRING_TYPE message, int reason) { errorCode = reason; } /** Full Constructor. */ TokenMgrError::TokenMgrError(bool EOFSeen, int lexState, int errorLine, int errorColumn, JAVACC_STRING_TYPE errorAfter, JAVACC_CHAR_TYPE curChar, int reason) { message = LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar); errorCode = reason; } } } } // i < 16 - guaranteed static char hexChar(int i) { if (i < 10) { return i - '0'; } return 'a' + (i - 10); } /** * Replaces unprintable characters by their escaped (or unicode escaped) * equivalents in the given string */ JAVACC_SIMPLE_STRING addUnicodeEscapes(JAVACC_STRING_TYPE str) { JAVACC_SIMPLE_STRING retval; for (size_t i = 0; i < str.size(); i++) { JAVACC_CHAR_TYPE ch = str[i]; switch (ch) { case 0 : retval += EMPTY[0]; continue; case '\b': retval.append("\\b"); continue; case '\t': retval.append("\\t"); continue; case '\n': retval.append("\\n"); continue; case '\f': retval.append("\\f"); continue; case '\r': retval.append("\\r"); continue; case '\\': retval.append("\\\\"); continue; default: if (ch < 0xff) { retval += ch; continue; } retval.append("\\u"); retval += (hexChar(ch >> 12)); retval += (hexChar((ch & 0x0f00) >> 8)); retval += (hexChar((ch & 0x00f0) >> 4)); retval += (hexChar(ch & 0x000f)); continue; } } return retval; } /* JavaCC - OriginalChecksum=35439b7e26a5e5693053317508794bdf (do not edit this line) */ Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/CConcreteOWL2FunctionalStyleParser.cpp0000644000175000017500000000231512520550732031730 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CConcreteOWL2FunctionalStyleParser.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { CConcreteOWL2FunctionalStyleParser::CConcreteOWL2FunctionalStyleParser(COntologyBuilder* ontologyBuilder,TokenManager *tm) : OWL2FunctionalStyleParser(tm) { mBuilder = ontologyBuilder; } }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/OWL2FunctionalJAVACCGrammer.jj0000644000175000017500000011203412403200176027742 0ustar jonasjonas// OWL 2 Functional Grammer: http://www.w3.org/TR/owl2-syntax/#Appendix:_Complete_Grammar_.28Normative.29 // EBNF Grammer of OWL 2 Functional Style: http://answers.semanticweb.com/questions/19985/ebnf-grammar-for-owl2-functional-style-syntax options { OUTPUT_LANGUAGE = "c++"; UNICODE_INPUT = true; NAMESPACE = "Konclude::Parser::FunctionalJAVACC"; TOKEN_MANAGER_SUPER_CLASS = "CTokenManager"; TOKEN_MANAGER_INCLUDES = "CTokenManager.h"; PARSER_INCLUDES = "CJAVACCParser.h"; PARSER_SUPER_CLASS = "CJAVACCParser"; TOKEN_EXTENDS = "CTokenBase"; TOKEN_INCLUDES = "CTokenBase.h"; // CACHE_TOKENS = true; // OUTPUT_DIRECTORY = "gen"; // STATIC = false; } PARSER_BEGIN(OWL2FunctionalStyleParser) public: inline COntologyBuilder* getBuilder() { return mBuilder; } protected: COntologyBuilder* mBuilder; PARSER_END(OWL2FunctionalStyleParser) SKIP : { " " | "\t" | "\n" | "\r" } TOKEN : { < OPEN_BRACKET: "(" > | < CLOSE_BRACKET: ")" > | < EQUALS: "=" > | < REFERENCE: "^^" > /* Ontology Keywords */ | < PREFIX: "Prefix" > | < ONTOLOGY: "Ontology" > | < IMPORT: "Import" > /* Entities and Literals */ | < CLASS: "Class" > | < DATATYPE: "Datatype" > | < OBJECT_PROPERTY: "ObjectProperty" > | < DATA_PROPERTY: "DataProperty" > | < ANNOTATION_PROPERTY: "AnnotationProperty" > | < NAMED_INDIVIDUAL: "NamedIndividual" > /* Declaration */ | < DECLARATION: "Declaration" > /* Property Expressions */ | < OBJECT_INVERSE_OF: "ObjectInverseOf" > | < OBJECT_PROPERTY_CHAIN: "ObjectPropertyChain" > /* Data Ranges */ | < COMPLEMENT_OF: "ComplementOf" > | < ONE_OF: "OneOf" > | < DATATYPE_RESTRICTION: "DatatypeRestriction" > /* Class Expressions */ | < OBJECT_INTERSECTION_OF: "ObjectIntersectionOf" > | < OBJECT_UNION_OF: "ObjectUnionOf" > | < OBJECT_COMPLEMENT_OF: "ObjectComplementOf" > | < OBJECT_ONE_OF: "ObjectOneOf" > | < OBJECT_SOME_VALUES_FROM: "ObjectSomeValuesFrom" > | < OBJECT_ALL_VALUES_FROM: "ObjectAllValuesFrom" > | < OBJECT_HAS_VALUE: "ObjectHasValue" > | < OBJECT_HAS_SELF: "ObjectHasSelf" > | < OBJECT_MIN_CARDINALITY: "ObjectMinCardinality" > | < OBJECT_MAX_CARDINALITY: "ObjectMaxCardinality" > | < OBJECT_EXACT_CARDINALITY: "ObjectExactCardinality" > | < DATA_INTERSECTION_OF: "DataIntersectionOf" > | < DATA_UNION_OF: "DataUnionOf" > | < DATA_COMPLEMENT_OF: "DataComplementOf" > | < DATA_ONE_OF: "DataOneOf" > | < DATA_SOME_VALUES_FROM: "DataSomeValuesFrom" > | < DATA_ALL_VALUES_FROM: "DataAllValuesFrom" > | < DATA_HAS_VALUE: "DataHasValue" > | < DATA_MIN_CARDINALITY: "DataMinCardinality" > | < DATA_MAX_CARDINALITY: "DataMaxCardinality" > | < DATA_EXACT_CARDINALITY: "DataExactCardinality" > /* Class Expressions Axioms */ | < SUB_CLASS_OF: "SubClassOf" > | < EQUIVALENT_CLASSES: "EquivalentClasses" > | < DISJOINT_CLASSES: "DisjointClasses" > | < DISJOINT_UNION: "DisjointUnion" > /* Object Property Axioms */ | < SUB_OBJECT_PROPERTY_OF: "SubObjectPropertyOf" > | < EQUIVALENT_OBJECT_PROPERTIES: "EquivalentObjectProperties" > | < DISJOINT_OBJECT_PROPERTIES: "DisjointObjectProperties" > | < OBJECT_PROPERTY_DOMAIN: "ObjectPropertyDomain" > | < OBJECT_PROPERTY_RANGE: "ObjectPropertyRange" > | < INVERSE_OBJECT_PROPERTIES: "InverseObjectProperties" > | < FUNCTIONAL_OBJECT_PROPERTY: "FunctionalObjectProperty" > | < INVERSE_FUNCTIONAL_OBJECT_PROPERTY: "InverseFunctionalObjectProperty" > | < REFLEXIVE_OBJECT_PROPERTY: "ReflexiveObjectProperty" > | < IRREFLEXIVE_OBJECT_PROPERTY: "IrreflexiveObjectProperty" > | < SYMMETRIC_OBJECT_PROPERTY: "SymmetricObjectProperty" > | < ASYMMETRIC_OBJECT_PROPERTY: "AsymmetricObjectProperty" > | < TRANSITIVE_OBJECT_PROPERTY: "TransitiveObjectProperty" > /* Data Property Axioms */ | < SUB_DATA_PROPERTY_OF: "SubDataPropertyOf" > | < EQUIVALENT_DATA_PROPERTIES: "EquivalentDataProperties" > | < DISJOINT_DATA_PROPERTIES: "DisjointDataProperties" > | < DATA_PROPERTY_DOMAIN: "DataPropertyDomain" > | < DATA_PROPERTY_RANGE: "DataPropertyRange" > | < FUNCTIONAL_DATA_PROPERTY: "FunctionalDataProperty" > | < DATATYPE_DEFINITION: "DatatypeDefinition" > /* Keys */ | < HAS_KEY: "HasKey" > /* Assertions */ | < SAME_INDIVIDUAL: "SameIndividual" > | < DIFFERENT_INDIVIDUALS: "DifferentIndividuals" > | < CLASS_ASSERTION: "ClassAssertion" > | < OBJECT_PROPERTY_ASSERTION: "ObjectPropertyAssertion" > | < NEGATIVE_OBJECT_PROPERTY_ASSERTION: "NegativeObjectPropertyAssertion" > | < DATA_PROPERTY_ASSERTION: "DataPropertyAssertion" > | < NEGATIVE_DATA_PROPERTY_ASSERTION: "NegativeDataPropertyAssertion" > /* Annotations */ | < ANNOTATION: "Annotation" > | < ANNOTATION_ASSERTION: "AnnotationAssertion" > | < SUB_ANNOTATION_PROPERTY_OF: "SubAnnotationPropertyOf" > | < ANNOTATION_PROPERTY_DOMAIN: "AnnotationPropertyDomain" > | < ANNOTATION_PROPERTY_RANGE: "AnnotationPropertyRange" > | < NON_NEGATIVE_INTEGER: ()+ > | < LANGTAG: "@" ( ["a"-"z","A"-"Z"])+ ("-" (["a"-"z","A"-"Z"]|)+ )* > | < PNAME_NS: ()? ":" > : AfterPrefix | < #PN_PREFIX: ( ( | "." )* )? > | < BLANK_NODE_PREFIX: "_:" > : AfterPrefix // | < PNAME_LN: > // | < BLANK_NODE_LABEL: "_:" > /* Auxiliary character tokens */ | < #DIGIT: ["0"-"9"] > | < #PN_CHARS_U: | "_" > | < #PN_CHARS: | "-" | | "\u00B7" | ["\u0300"-"\u036F"] | ["\u203F"-"\u2040"] > | < #PN_CHARS_BASE: ["a"-"z"] | ["A"-"Z"] | ["\u00C0"-"\u00D6"] | ["\u00D8"-"\u00F6"] | ["\u00F8"-"\u02FF"] | ["\u0370"-"\u037D"] | ["\u037F"-"\u1FFF"] | ["\u200C"-"\u200D"] | ["\u2070"-"\u218F"] | ["\u2C00"-"\u2FEF"] | ["\u3001"-"\uD7FF"] | ["\uF900"-"\uFDCF"] | ["\uFDF0"-"\uFFFD"] > } SKIP : { "<" : FullIri | "\"" : QuotedQString | "#" : Comment } TOKEN : { /* based on IRI_REF of [SPARQL] */ < FULL_IRI: ( ~["<",">","\"","{","}","|","^","`","\\","\u0000"-"\u0020"] )* > : FullIriEnd } SKIP : { ">" : DEFAULT } TOKEN : { < PN_LOCAL: ( | ) ( ( | "." )* )? > : DEFAULT } SKIP : { "" : DEFAULT } TOKEN : { < QUOTED_QString: ( ~["\\","\""] | ("\\" ["\"","\'","\\"]) )* > : QuotedQStringEnd } SKIP : { "\"" : DEFAULT } SKIP : { "\n": DEFAULT | "\r": DEFAULT } SKIP : { < ~[] > } /*------------------------------------------------------------------ * PARSER RULES *------------------------------------------------------------------*/ /* 2 Preliminary Definitions */ /* 2.3 Integers, Characters, QStrings, Language Tags, and Node IDs */ /* @ (U+40) followed a nonempty sequence of characters matching the * langtag production from [BCP 47] */ QString languageTag(): { Token* t; }{ t = { return JAVACC_TO_QSTRING(t->image); } } /* See LANGTAG in [SPARQL] */ /* a finite sequence of characters matching the BLANK_NODE_LABEL * production of [SPARQL] */ QString nodeId(): { Token* t; }{ t = { return JAVACC_TO_QSTRING(t->image); } } /* 2.3 IRIs */ /* An iri as defined in [RFC3987], enclosed in a pair of < (U+3C) and > * (U+3E) characters. See IRI_REF in [SPARQL]. * The function returns only the IRI part of the QString without the * enclosing < >. */ QString fullIri(): { Token* t; }{ t = { return JAVACC_TO_QSTRING(t->image); } } /* Extract the actual IRI from a full IRI or abbreviated IRI */ QString iri(): { QString x; }{ ( x = fullIri() | x = abbreviatedIri() ) { return x; } } /* * A finite sequence of characters matching the PNAME_LN production of * [SPARQL]. The function returns the IRI that the abbreviation encodes * based on the known prefix declarations. */ QString abbreviatedIri(): { Token* t; QString abbName; }{ abbName = prefixName() t = { return getBuilder()->resolveAbbreviationName(abbName+JAVACC_TO_QSTRING(t->image)); } } /* a finite sequence of characters matching the as PNAME_NS production of * [SPARQL] */ QString prefixName(): { Token* t = nullptr; }{ t = { return JAVACC_TO_QSTRING(t->image); } } /* 3 Ontologies */ /* 3.5 Ontology Annotations */ void ontologyAnnotations(): {}{ ( annotation() )* } /* 3.7 Functional-Style Syntax */ void ontologyDocument() : {}{ ( prefixDeclaration() )* ontology() } void prefixDeclaration() : { QString abbName; QString fullName; }{ abbName = prefixName() fullName = fullIri() { if (abbName.endsWith(":")) { abbName = abbName.remove(abbName.length()-1,1); } getBuilder()->addNameAbbreviation(fullName,abbName); } } void ontology() : {}{ ( ontologyIri() ( versionIri() )? )? directlyImportsDocuments() ontologyAnnotations() axioms() } QString ontologyIri(): { QString x; }{ x = iri() { return x; } } QString versionIri(): { QString x; }{ x = iri() { return x; } } void directlyImportsDocuments(): { QString x; }{ ( x = iri() { getBuilder()->addOntologyImport(x); } )* } void axioms() : { CBuildExpressionPtr x; }{ ( x = axiom() { getBuilder()->tellOntologyAxiom(x); } )* } /* 5 Entities and Literals */ /* 5.1 Classes */ CBuildExpressionPtr owlClass(): { QString x; }{ x = iri() { return getBuilder()->getClass(x); } } /* 5.2 Datatypes */ CBuildExpressionPtr datatype(): { QString x; }{ x = iri() { return getBuilder()->getDatatype(x); } } /* 5.3 Object Properties */ CBuildExpressionPtr objectProperty(): { QString x; }{ x = iri() { return getBuilder()->getObjectProberty(x); } } /* 5.4 Data Properties */ CBuildExpressionPtr dataProperty(): { QString x; }{ x = iri() { return getBuilder()->getDataProberty(x); } } /* 5.5 Annotation Properties */ CBuildExpressionPtr annotationProperty(): { QString x; }{ x = iri() { return nullptr; } // | // | // | // | // | // | // | // | // | } /* 5.6 Individuals */ CBuildExpressionPtr individual(): { CBuildExpressionPtr x; }{ ( x = namedIndividual() | x = anonymousIndividual() ) { return x; } } /* 5.6.1 Named Individuals */ CBuildExpressionPtr namedIndividual(): { QString x; }{ x = iri() { return getBuilder()->getNamedIndividual(x); } } /* 5.6.2 Anonymous Individuals */ CBuildExpressionPtr anonymousIndividual(): { QString x; }{ x = nodeId() { return getBuilder()->getAnonymousIndividual(getBuilder()->getOntologyName(),x); } } /* 5.7 Literals */ CBuildExpressionPtr literal(bool annotation): { QString x,l; CBuildExpressionPtr d = nullptr; }{ x = quotedQString() ( d = datatype() | ( l = languageTag() )? ) { if (annotation) { return nullptr; } if (d == nullptr) { d = getBuilder()->getDatatype("http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral"); if (l.isEmpty()) { x += "@"; } else { x += l; } } CBuildExpressionPtr y = getBuilder()->getDataLexicalValue(x); return getBuilder()->getDataLiteral((CDataLexicalValueExpressionPtr)y,(CDatatypeExpressionPtr)d); } } /* Retrieve the content of a quoted QString. */ QString quotedQString(): { Token* t; }{ t = { return JAVACC_TO_QSTRING(t->image); } } /* 5.8 Entity Declarations and Typing */ CBuildExpressionPtr declaration(): { CBuildExpressionPtr x; }{ axiomAnnotations() x = entity() { return getBuilder()->getDeclaration(x); } } CBuildExpressionPtr entity(): { CBuildExpressionPtr x = nullptr; }{ ( x = owlClass() | x = datatype() | x = objectProperty() | x = dataProperty() | x = annotationProperty() | x = namedIndividual() ) { return x; } } /* 6 Property Expressions */ CBuildExpressionPtr objectPropertyExpression(): { CBuildExpressionPtr x; }{ ( x = objectProperty() | x = inverseObjectProperty() ) { return x; } } /* 6.1.1 Inverse Object Properties */ CBuildExpressionPtr inverseObjectProperty(): { CBuildExpressionPtr x; }{ x = objectProperty() { return getBuilder()->getInverseObjectPropertyOf(x); } } /* 6.2 Data Property Expressions */ CBuildExpressionPtr dataPropertyExpression(): { CBuildExpressionPtr x; }{ x = dataProperty() { return x; } } /* 7 Data Ranges */ CBuildExpressionPtr dataRange(): { CBuildExpressionPtr x; }{ ( x = datatype() | x = dataIntersectionOf() | x = dataUnionOf() | x = dataComplementOf() | x = dataOneOf() | x = datatypeRestriction() ) { return x; } } CEXPRESSIONLIST dataRangeList(): { CBuildExpressionPtr x; CEXPRESSIONLIST v; }{ ( x = dataRange() { v.append(x); } )+ { return v; } } /* 7.1 Intersection of Data Ranges */ CBuildExpressionPtr dataIntersectionOf(): { CEXPRESSIONLIST v; }{ v = dataRangeList() { return getBuilder()->getDataIntersectionOf(v); } } /* 7.2 Union of Data Ranges */ CBuildExpressionPtr dataUnionOf(): { CEXPRESSIONLIST v; }{ v = dataRangeList() { return getBuilder()->getDataUnionOf(v); } } /* 7.3 Complement of Data Ranges */ CBuildExpressionPtr dataComplementOf(): { CBuildExpressionPtr x; }{ x = dataRange() { return getBuilder()->getDataComplementOf(x); } } /* 7.4 Enumeration of Literals */ CBuildExpressionPtr dataOneOf(): { CBuildExpressionPtr x; CEXPRESSIONLIST v; }{ ( x = literal(false) { v.append(x); } )+ { return getBuilder()->getDataOneOf(v); } } /* 7.5 Datatype Restrictions */ CBuildExpressionPtr datatypeRestriction(): { CBuildExpressionPtr x; CEXPRESSIONLIST v; }{ x = datatype() v = facetRestrictionList() { v.append(x); return getBuilder()->getDatatypeRestriction(v); } } CEXPRESSIONLIST facetRestrictionList(): { CBuildExpressionPtr x; CEXPRESSIONLIST v; }{ ( x = facetRestriction() { v.append(x); } )+ { return v; } } CBuildExpressionPtr facetRestriction(): { QString f; CBuildExpressionPtr l; }{ f = iri() l = literal(false) { CBuildExpressionPtr x = getBuilder()->getDataFacet(f); return getBuilder()->getDataFacetRestriction(l,x); } } /* 8 Class Expressions */ CBuildExpressionPtr classExpression(): { CBuildExpressionPtr x; }{ ( x = owlClass() | x = objectIntersectionOf() | x = objectUnionOf() | x = objectComplementOf() | x = objectOneOf() | x = objectSomeValuesFrom() | x = objectAllValuesFrom() | x = objectHasValue() | x = objectHasSelf() | x = objectMinCardinality() | x = objectMaxCardinality() | x = objectExactCardinality() | x = dataSomeValuesFrom() | x = dataAllValuesFrom() | x = dataHasValue() | x = dataMinCardinality() | x = dataMaxCardinality() | x = dataExactCardinality() ) { return x; } } /* 8.1 Propositional Connectives and Enumeration of Individuals */ /* 8.1.1 Intersection of Class Expressions */ CBuildExpressionPtr objectIntersectionOf(): { CEXPRESSIONLIST v; }{ v = classExpressionList() { return getBuilder()->getObjectIntersectionOf(v); } } /* 8.1.2 Union of Class Expressions */ CBuildExpressionPtr objectUnionOf(): { CEXPRESSIONLIST v; }{ v = classExpressionList() { return getBuilder()->getObjectUnionOf(v); } } /* 8.1.3 Complement of Class Expressions */ CBuildExpressionPtr objectComplementOf(): { CBuildExpressionPtr x; }{ x = classExpression() { return getBuilder()->getObjectComplementOf(x); } } /* 8.1.4 Enumeration of Individuals */ CBuildExpressionPtr objectOneOf(): { CBuildExpressionPtr x; CEXPRESSIONLIST v; }{ ( x = individual() { v.append(x); } )+ { return getBuilder()->getObjectOneOf(v); } } /* 8.2 Object Property Restrictions */ /* 8.2.1 Existential Quantification */ CBuildExpressionPtr objectSomeValuesFrom(): { CBuildExpressionPtr x; CBuildExpressionPtr y; }{ x = objectPropertyExpression() y = classExpression() { return getBuilder()->getObjectSomeValuesFrom(x,y); } } /* 8.2.2 Universal Quantification */ CBuildExpressionPtr objectAllValuesFrom(): { CBuildExpressionPtr x; CBuildExpressionPtr y; }{ x = objectPropertyExpression() y = classExpression() { return getBuilder()->getObjectAllValuesFrom(x,y); } } /* 8.2.3 Individual Value Restriction */ CBuildExpressionPtr objectHasValue(): { CBuildExpressionPtr x; CBuildExpressionPtr y; }{ x = objectPropertyExpression() y = individual() { return getBuilder()->getObjectHasValue(x,y); } } /* 8.2.4 Self-Restriction */ CBuildExpressionPtr objectHasSelf(): { CBuildExpressionPtr x; }{ x = objectPropertyExpression() { return getBuilder()->getObjectHasSelf(x); } } /* 8.3 Object Property Cardinality Restrictions */ /* 8.3.1 Minimum Cardinality */ CBuildExpressionPtr objectMinCardinality(): { Token* n; CBuildExpressionPtr x; CBuildExpressionPtr y = nullptr; }{ n = x = objectPropertyExpression() ( y = classExpression() )? { if (y == nullptr) { y = getBuilder()->getTopClass(); } cint64 cardinality = JAVACC_TO_QSTRING(n->image).toLongLong(); return getBuilder()->getObjectMinCardinality(x,y,cardinality); } } /* 8.3.2 Maximum Cardinality */ CBuildExpressionPtr objectMaxCardinality(): { Token* n; CBuildExpressionPtr x; CBuildExpressionPtr y = nullptr; }{ n = x = objectPropertyExpression() ( y = classExpression() )? { if (y == nullptr) { y = getBuilder()->getTopClass(); } cint64 cardinality = JAVACC_TO_QSTRING(n->image).toLongLong(); return getBuilder()->getObjectMaxCardinality(x,y,cardinality); } } /* 8.3.3 Exact Cardinality */ CBuildExpressionPtr objectExactCardinality(): { Token* n; CBuildExpressionPtr x; CBuildExpressionPtr y = nullptr; }{ n = x = objectPropertyExpression() ( y = classExpression() )? { if (y == nullptr) { y = getBuilder()->getTopClass(); } cint64 cardinality = JAVACC_TO_QSTRING(n->image).toLongLong(); return getBuilder()->getObjectExactlyCardinality(x,y,cardinality); } } /* 8.4 Data Property Restrictions */ /* 8.4.1 Existential Quantification */ CBuildExpressionPtr dataSomeValuesFrom(): { CBuildExpressionPtr x, y; }{ x = dataProperty() y = dataRange() { if (y == nullptr) { y = getBuilder()->getTopDataRange(); } return getBuilder()->getDataSomeValuesFrom(x,y); } } /* 8.4.2 Universal Quantification */ CBuildExpressionPtr dataAllValuesFrom(): { CBuildExpressionPtr x, y; }{ x = dataProperty() y = dataRange() { return getBuilder()->getDataAllValuesFrom(x,y); } } /* 8.4.3 Literal Value Restriction */ CBuildExpressionPtr dataHasValue(): { CBuildExpressionPtr x, y; }{ x = dataPropertyExpression() y = literal(false) { return getBuilder()->getDataHasValue(x,y); } } /* 8.5 Data Property Cardinality Restrictions */ /* 8.5.1 Minimum Cardinality */ CBuildExpressionPtr dataMinCardinality(): { Token* n; CBuildExpressionPtr x; CBuildExpressionPtr y = nullptr; }{ n = x = dataPropertyExpression() ( y = dataRange() )? { if (y == nullptr) { y = getBuilder()->getTopDataRange(); } cint64 cardinality = JAVACC_TO_QSTRING(n->image).toLongLong(); return getBuilder()->getDataMinCardinality(x,y,cardinality); } } /* 8.5.2 Maximum Cardinality */ CBuildExpressionPtr dataMaxCardinality(): { Token* n; CBuildExpressionPtr x; CBuildExpressionPtr y = nullptr; }{ n = x = dataPropertyExpression() ( y = dataRange() )? { if (y == nullptr) { y = getBuilder()->getTopDataRange(); } cint64 cardinality = JAVACC_TO_QSTRING(n->image).toLongLong(); return getBuilder()->getDataMaxCardinality(x,y,cardinality); } } /* 8.5.3 Exact Cardinality */ CBuildExpressionPtr dataExactCardinality(): { Token* n; CBuildExpressionPtr x; CBuildExpressionPtr y = nullptr; }{ n = x = dataPropertyExpression() ( y = dataRange() )? { if (y == nullptr) { y = getBuilder()->getTopDataRange(); } cint64 cardinality = JAVACC_TO_QSTRING(n->image).toLongLong(); return getBuilder()->getDataExactCardinality(x,y,cardinality); } } /* 9 Axioms */ CBuildExpressionPtr axiom(): { CBuildExpressionPtr x = nullptr; }{ ( x = declaration() | x = classAxiom() | x = objectPropertyAxiom() | x = dataPropertyAxiom() | x = datatypeDefinition() | x = hasKey() | x = assertion() | x = annotationAxiom() ) { return x; } } void axiomAnnotations(): {}{ ( annotation() )* } /* 9.1 Class Expression Axioms */ CBuildExpressionPtr classAxiom(): { CBuildExpressionPtr x; }{ ( x = subClassOf() | x = equivalentClasses() | x = disjointClasses() | x = disjointUnion() ) { return x; } } /* 9.1.1 Subclass Axioms */ CBuildExpressionPtr subClassOf(): { CBuildExpressionPtr x, y; }{ axiomAnnotations() x = classExpression() y = classExpression() { return getBuilder()->getSubClassOf(x,y); } } /* 9.1.2 Equivalent Classes */ CBuildExpressionPtr equivalentClasses(): { CEXPRESSIONLIST v; }{ axiomAnnotations() v = classExpressionList() { return getBuilder()->getEquivalentClasses(v); } } /* 9.1.3 Disjoint Classes */ CBuildExpressionPtr disjointClasses(): { CEXPRESSIONLIST v; }{ axiomAnnotations() v = classExpressionList() { return getBuilder()->getDisjointClasses(v); } } /* 9.1.4 Disjoint Union of Class Expressions */ CBuildExpressionPtr disjointUnion(): { CBuildExpressionPtr x; CEXPRESSIONLIST v; }{ axiomAnnotations() x = owlClass() v = classExpressionList() { v.prepend(x); return getBuilder()->getDisjointUnion(v); } } CEXPRESSIONLIST classExpressionList(): { CBuildExpressionPtr x; CEXPRESSIONLIST v; }{ ( x = classExpression() { v.append(x); } )+ { return v; } } /* 9.2 Object Property Axioms */ CBuildExpressionPtr objectPropertyAxiom(): { CBuildExpressionPtr x; }{ ( x = subObjectPropertyOf() | x = equivalentObjectProperties() | x = disjointObjectProperties() | x = inverseObjectProperties() | x = objectPropertyDomain() | x = objectPropertyRange() | x = functionalObjectProperty() | x = inverseFunctionalObjectProperty() | x = reflexiveObjectProperty() | x = irreflexiveObjectProperty() | x = symmetricObjectProperty() | x = asymmetricObjectProperty() | x = transitiveObjectProperty() ) { return x; } } /* 9.2.1 Object Subproperties */ CBuildExpressionPtr subObjectPropertyOf(): { CBuildExpressionPtr x = nullptr; CBuildExpressionPtr z; }{ axiomAnnotations() ( x = objectPropertyExpression() | x = propertyExpressionChain() ) z = objectPropertyExpression() { return getBuilder()->getSubObjectPropertyOf(x,z); } } CBuildExpressionPtr propertyExpressionChain(): { CEXPRESSIONLIST v; }{ v = objectPropertyExpressionList() { return getBuilder()->getObjectPropertyChain(v); } } /* 9.2.2 Equivalent Object Properties */ CBuildExpressionPtr equivalentObjectProperties(): { CEXPRESSIONLIST v; }{ axiomAnnotations() v = objectPropertyExpressionList() { return getBuilder()->getEquivalentObjectProperties(v); } } /* 9.2.3 Disjoint Object Properties */ CBuildExpressionPtr disjointObjectProperties(): { CEXPRESSIONLIST v; }{ axiomAnnotations() v = objectPropertyExpressionList() { return getBuilder()->getDisjointObjectProperties(v); } } CEXPRESSIONLIST objectPropertyExpressionList(): { CBuildExpressionPtr x; CEXPRESSIONLIST v; }{ ( x = objectPropertyExpression() { v.append(x); } )+ { return v; } } /* 9.2.4 Inverse Object Properties */ CBuildExpressionPtr inverseObjectProperties(): { CBuildExpressionPtr x, y; }{ axiomAnnotations() x = objectPropertyExpression() y = objectPropertyExpression() { return getBuilder()->getInverseObjectProperties(x,y); } } /* 9.2.5 Object Property Domain */ CBuildExpressionPtr objectPropertyDomain(): { CBuildExpressionPtr x, y; }{ axiomAnnotations() x = objectPropertyExpression() y = classExpression() { return getBuilder()->getObjectPropertyDomainExpression(x,y); } } /* 9.2.6 Object Property Range */ CBuildExpressionPtr objectPropertyRange(): { CBuildExpressionPtr x, y; }{ axiomAnnotations() x = objectPropertyExpression() y = classExpression() { return getBuilder()->getObjectPropertyRangeExpression(x,y); } } /* 9.2.7 Functional Object Properties */ CBuildExpressionPtr functionalObjectProperty(): { CBuildExpressionPtr x; }{ axiomAnnotations() x = objectPropertyExpression() { return getBuilder()->getFunctionalObjectProperty(x); } } /* 9.2.8 Inverse-Functional Object Properties */ CBuildExpressionPtr inverseFunctionalObjectProperty(): { CBuildExpressionPtr x; }{ axiomAnnotations() x = objectPropertyExpression() { return getBuilder()->getInverseFunctionalObjectProperty(x); } } /* 9.2.9 Reflexive Object Properties */ CBuildExpressionPtr reflexiveObjectProperty(): { CBuildExpressionPtr x; }{ axiomAnnotations() x = objectPropertyExpression() { return getBuilder()->getReflexiveObjectProperty(x); } } /* 9.2.10 Irreflexive Object Properties */ CBuildExpressionPtr irreflexiveObjectProperty(): { CBuildExpressionPtr x; }{ axiomAnnotations() x = objectPropertyExpression() { return getBuilder()->getIrreflexiveObjectProperty(x); } } /* 9.2.11 Symmetric Object Properties */ CBuildExpressionPtr symmetricObjectProperty(): { CBuildExpressionPtr x; }{ axiomAnnotations() x = objectPropertyExpression() { return getBuilder()->getSymmetricObjectProperty(x); } } /* 9.2.12 Asymmetric Object Properties */ CBuildExpressionPtr asymmetricObjectProperty(): { CBuildExpressionPtr x; }{ axiomAnnotations() x = objectPropertyExpression() { return getBuilder()->getAsymmetricObjectProperty(x); } } /* 9.2.13 Transitive Object Properties */ CBuildExpressionPtr transitiveObjectProperty(): { CBuildExpressionPtr x; }{ axiomAnnotations() x = objectPropertyExpression() { return getBuilder()->getTransetiveObjectProperty(x); } } /* 9.3 Data Property Axioms */ CBuildExpressionPtr dataPropertyAxiom(): { CBuildExpressionPtr x; }{ ( x = subDataPropertyOf() | x = equivalentDataProperties() | x = disjointDataProperties() | x = dataPropertyDomain() | x = dataPropertyRange() | x = functionalDataProperty() ) { return x; } } /* 9.3.1 Data Subproperties */ CBuildExpressionPtr subDataPropertyOf(): { CBuildExpressionPtr x,y; }{ axiomAnnotations() x = dataPropertyExpression() y = dataPropertyExpression() { return getBuilder()->getSubDataPropertyOf(x,y); } } /* 9.3.2 Equivalent Data Properties */ CBuildExpressionPtr equivalentDataProperties(): { CEXPRESSIONLIST v; }{ axiomAnnotations() v = dataPropertyExpressionList() { return getBuilder()->getEquivalentDataProperties(v); } } /* 9.3.3 Disjoint Data Properties */ CBuildExpressionPtr disjointDataProperties(): { CEXPRESSIONLIST v; }{ axiomAnnotations() v = dataPropertyExpressionList() { return getBuilder()->getDisjointDataProperties(v); } } CEXPRESSIONLIST dataPropertyExpressionList(): { CBuildExpressionPtr x; CEXPRESSIONLIST v; }{ ( x = dataPropertyExpression() { v.append(x); } )+ { return v; } } /* 9.3.4 Data Property Domain */ CBuildExpressionPtr dataPropertyDomain(): { CBuildExpressionPtr x, y; }{ axiomAnnotations() x = dataPropertyExpression() y = classExpression() { return getBuilder()->getDataPropertyDomainExpression(x,y); } } /* 9.3.5 Data Property Range */ CBuildExpressionPtr dataPropertyRange(): { CBuildExpressionPtr x, y; }{ axiomAnnotations() x = dataPropertyExpression() y = dataRange() { return getBuilder()->getDataPropertyRangeExpression(x,y); } } /* 9.3.6 Functional Data Properties */ CBuildExpressionPtr functionalDataProperty(): { CBuildExpressionPtr x; }{ axiomAnnotations() x = dataPropertyExpression() { return getBuilder()->getFunctionalDataProperty(x); } } /* 9.4 Datatype Definitions */ CBuildExpressionPtr datatypeDefinition(): { }{ axiomAnnotations() datatype() dataRange() { return nullptr; } } /* 9.5 Keys */ CBuildExpressionPtr hasKey(): { }{ axiomAnnotations() classExpression() ( objectPropertyExpression() )* ( objectPropertyExpression() )* { return nullptr; } } /* 9.6 Assertions */ CBuildExpressionPtr assertion(): { CBuildExpressionPtr x; }{ ( x = sameIndividual() | x = differentIndividuals() | x = classAssertion() | x = objectPropertyAssertion() | x = negativeObjectPropertyAssertion() | x = dataPropertyAssertion() | x = negativeDataPropertyAssertion() ) { return x; } } /* 9.6.1 Individual Equality */ CBuildExpressionPtr sameIndividual(): { CEXPRESSIONLIST v; }{ axiomAnnotations() v = individualList() { return getBuilder()->getSameIndividual(v); } } /* 9.6.2 Individual Inequality */ CBuildExpressionPtr differentIndividuals(): { CEXPRESSIONLIST v; }{ axiomAnnotations() v = individualList() { return getBuilder()->getDifferentIndividuals(v); } } CEXPRESSIONLIST individualList(): { CBuildExpressionPtr x; CEXPRESSIONLIST v; }{ ( x = individual() { v.append(x); } )+ { return v; } } /* 9.6.3 Class Assertions */ CBuildExpressionPtr classAssertion(): { CBuildExpressionPtr x, y; }{ axiomAnnotations() x = classExpression() y = individual() { return getBuilder()->getClassAssertion(x,y); } } /* 9.6.4 Positive Object Property Assertions */ CBuildExpressionPtr objectPropertyAssertion(): { CBuildExpressionPtr x, y, z; }{ axiomAnnotations() x = objectPropertyExpression() y = individual() z = individual() { return getBuilder()->getObjectPropertyAssertion(x,y,z); } } /* 9.6.5 Negative Object Property Assertions */ CBuildExpressionPtr negativeObjectPropertyAssertion(): { CBuildExpressionPtr x, y, z; }{ axiomAnnotations() x = objectPropertyExpression() y = individual() z = individual() { return getBuilder()->getNegativeObjectPropertyAssertion(x,y,z); } } /* 9.6.6 Positive Data Property Assertions */ CBuildExpressionPtr dataPropertyAssertion(): { CBuildExpressionPtr x, y, z; }{ axiomAnnotations() x = dataPropertyExpression() y = individual() z = literal(false) { return getBuilder()->getDataPropertyAssertion(x,y,z); } } /* 9.6.7 Negative Data Property Assertions */ CBuildExpressionPtr negativeDataPropertyAssertion(): { CBuildExpressionPtr x, y, z; }{ axiomAnnotations() x = dataPropertyExpression() y = individual() z = literal(false) { return getBuilder()->getNegativeDataPropertyAssertion(x,y,z); } } /* 10 Annotations */ /* 10.1 Annotations of Ontologies, Axioms, and other Annotations */ CBuildExpressionPtr annotation(): { }{ annotationAnnotations() annotationProperty() annotationValue() { return nullptr; } } void annotationAnnotations(): {}{ ( annotation() )* } CBuildExpressionPtr annotationValue(): { }{ ( anonymousIndividual() | iri() | literal(true) ) { return nullptr; } } /* 10.2 Annotation Axioms */ CBuildExpressionPtr annotationAxiom(): { }{ ( annotationAssertion() | subAnnotationPropertyOf() | annotationPropertyDomain() | annotationPropertyRange() ) { return nullptr; } } /* 10.2.1 Annotation Assertion */ CBuildExpressionPtr annotationAssertion(): { }{ axiomAnnotations() annotationProperty() annotationSubject() annotationValue() { return nullptr; } } CBuildExpressionPtr annotationSubject(): { }{ ( iri() | anonymousIndividual() ) { return nullptr; } } /* 10.2.2 Annotation Subproperties */ CBuildExpressionPtr subAnnotationPropertyOf(): { }{ axiomAnnotations() annotationProperty() annotationProperty() { return nullptr; } } /* 10.2.3 Annotation Property Domain */ CBuildExpressionPtr annotationPropertyDomain(): { }{ axiomAnnotations() annotationProperty() iri() { return nullptr; } } /* 10.2.4 Annotation Property Range */ CBuildExpressionPtr annotationPropertyRange(): { }{ axiomAnnotations() annotationProperty() iri() { return nullptr; } } ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/OWL2FunctionalStyleParserTokenManager.hKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/OWL2FunctionalStyleParserTokenManager.0000644000175000017500000001654212334732576031755 0ustar jonasjonas#ifndef OWL2FUNCTIONALSTYLEPARSERTOKENMANAGER_H #define OWL2FUNCTIONALSTYLEPARSERTOKENMANAGER_H #include "JavaCC.h" #include "CharStream.h" #include "Token.h" #include "TokenManager.h" #include "OWL2FunctionalStyleParserConstants.h" #include "CTokenManager.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { class OWL2FunctionalStyleParser; /** Token Manager. */ class OWL2FunctionalStyleParserTokenManager : public TokenManager, public CTokenManager { public: /** Debug output. */ FILE *debugStream; /** Set debug output. */ void setDebugStream(FILE *ds); int jjStopStringLiteralDfa_0(int pos, unsigned long long active0, unsigned long long active1); int jjStartNfa_0(int pos, unsigned long long active0, unsigned long long active1); int jjStopAtPos(int pos, int kind); int jjMoveStringLiteralDfa0_0(); int jjMoveStringLiteralDfa1_0(unsigned long long active0, unsigned long long active1); int jjMoveStringLiteralDfa2_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa3_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa4_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa5_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa6_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa7_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa8_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa9_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa10_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa11_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa12_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa13_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa14_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa15_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa16_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa17_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa18_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa19_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa20_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa21_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa22_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa23_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa24_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa25_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa26_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa27_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa28_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa29_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjMoveStringLiteralDfa30_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1); int jjStartNfaWithStates_0(int pos, int kind, int state); int jjMoveNfa_0(int startState, int curPos); int jjMoveStringLiteralDfa0_3(); int jjMoveNfa_3(int startState, int curPos); int jjMoveStringLiteralDfa0_5(); int jjMoveStringLiteralDfa0_1(); int jjMoveNfa_1(int startState, int curPos); int jjMoveStringLiteralDfa0_6(); int jjMoveStringLiteralDfa0_2(); int jjMoveStringLiteralDfa0_4(); int jjMoveNfa_4(int startState, int curPos); bool jjCanMove_0(int hiByte, int i1, int i2, unsigned long long l1, unsigned long long l2); bool jjCanMove_1(int hiByte, int i1, int i2, unsigned long long l1, unsigned long long l2); bool jjCanMove_2(int hiByte, int i1, int i2, unsigned long long l1, unsigned long long l2); Token * jjFillToken(); public: int curLexState; public: int jjnewStateCnt; public: int jjround; public: int jjmatchedPos; public: int jjmatchedKind; Token * getNextToken(); void SkipLexicalActions(Token *matchedToken); void TokenLexicalActions(Token *matchedToken); #define jjCheckNAdd(state)\ {\ if (jjrounds[state] != jjround)\ {\ jjstateSet[jjnewStateCnt++] = state;\ jjrounds[state] = jjround;\ }\ } #define jjAddStates(start, end)\ {\ for (int x = start; x <= end; x++) {\ jjstateSet[jjnewStateCnt++] = jjnextStates[x];\ } /*while (start++ != end);*/\ } #define jjCheckNAddTwoStates(state1, state2)\ {\ jjCheckNAdd(state1);\ jjCheckNAdd(state2);\ } #define jjCheckNAddStates(start, end)\ {\ for (int x = start; x <= end; x++) {\ jjCheckNAdd(jjnextStates[x]);\ } /*while (start++ != end);*/\ } #ifndef JAVACC_CHARSTREAM #define JAVACC_CHARSTREAM CharStream #endif private: OWL2FunctionalStyleParser*parser; private: void ReInitRounds(); public: OWL2FunctionalStyleParserTokenManager(JAVACC_CHARSTREAM *stream, int lexState = 0, OWL2FunctionalStyleParser *parserArg = NULL); public: virtual ~OWL2FunctionalStyleParserTokenManager(); void ReInit(JAVACC_CHARSTREAM *stream, int lexState = 0, OWL2FunctionalStyleParser *parserArg = NULL); void SwitchTo(int lexState); const JAVACC_SIMPLE_STRING jjKindsForBitVector(int i, unsigned long long vec); const JAVACC_SIMPLE_STRING jjKindsForStateVector(int lexState, int vec[], int start, int end); JAVACC_CHARSTREAM *input_stream; int jjrounds[9]; int jjstateSet[2 * 9]; JAVACC_STRING_TYPE jjimage; JAVACC_STRING_TYPE image; int jjimageLen; int lengthOfMatch; JAVACC_CHAR_TYPE curChar; }; } } } #endif Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/CConcreteOWL2FunctionalStyleParser.h0000644000175000017500000000357612520550732031407 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_CCONCRETEOWL2FUNCTIONALSTYLEPARSER_H #define KONCLUDE_PARSER_CCONCRETEOWL2FUNCTIONALSTYLEPARSER_H // Libraries includes // Namespace includes #include "OWL2FunctionalStyleParser.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace FunctionalJAVACC { /*! * * \class CConcreteOWL2FunctionalStyleParser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CConcreteOWL2FunctionalStyleParser : public OWL2FunctionalStyleParser { // public methods public: //! Constructor CConcreteOWL2FunctionalStyleParser(COntologyBuilder* ontologyBuilder, TokenManager *tm); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_CCONCRETEOWL2FUNCTIONALSTYLEPARSER_H ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/COWL2FunctionalStyleParserTokenManager.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/COWL2FunctionalStyleParserTokenManager0000644000175000017500000000261712520550734031767 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWL2FunctionalStyleParserTokenManager.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { COWL2FunctionalStyleParserTokenManager::COWL2FunctionalStyleParserTokenManager(JAVACC_CHARSTREAM *stream) : OWL2FunctionalStyleParserTokenManager(stream) { mLexicalError = false; } void COWL2FunctionalStyleParserTokenManager::lexicalError() { mLexicalError = true; } bool COWL2FunctionalStyleParserTokenManager::hasLexicalError() { return mLexicalError; } }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/CharStream.cpp0000644000175000017500000001302212315260742025225 0ustar jonasjonas/* Generated By:JavaCC: Do not edit this line. CharStream.cc Version 6.0 */ /* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ #include "CharStream.h" namespace { template void ArrayCopy(T* src, int src_offset, T* dest, int dest_offset, int len) { for (int i = 0; i < len; i++) { dest[dest_offset + i] = src[src_offset + i]; } } class StringReaderStream : public ReaderStream { public: StringReaderStream(const JAVACC_STRING_TYPE& str) : str_(str), cur_(0), max_(str.size()) {} virtual size_t read(JAVACC_CHAR_TYPE *bufptr, int offset, size_t len) { size_t count = str_.copy(bufptr + offset, len > max_ ? max_ : len, cur_); cur_ += count; max_ -= count; return count; } virtual ~StringReaderStream() {} virtual bool endOfInput() { return max_ == 0; } private: const JAVACC_STRING_TYPE str_; size_t cur_; size_t max_; }; } namespace Konclude { namespace Parser { namespace FunctionalJAVACC { void CharStream::ReInit(const JAVACC_STRING_TYPE& str, int startline, int startcolumn, int buffersize) { StringReaderStream *stream = new StringReaderStream(str); ReInit(stream, startline, startcolumn, buffersize); deleteStream = true; } void CharStream::ReInit(ReaderStream *input_stream, int startline, int startcolumn, int buffersize) { if (deleteStream) { delete inputStream; } if (buffer != NULL) { DeleteBuffers(); } available = bufsize = buffersize; buffer = new JAVACC_CHAR_TYPE[buffersize]; bufline = new int[buffersize]; bufcolumn = new int[buffersize]; column = startcolumn - 1; inputStream = input_stream; line = startline; prevCharIsLF = prevCharIsCR = false; tokenBegin = inBuf = maxNextCharInd = 0; bufpos = -1; deleteStream = false; } void CharStream::DeleteBuffers() { delete[] buffer; delete[] bufline; delete[] bufcolumn; } void CharStream::adjustBeginLineColumn(int newLine, int newCol) { int start = tokenBegin; int len; if (bufpos >= tokenBegin) { len = bufpos - tokenBegin + inBuf + 1; } else { len = bufsize - tokenBegin + bufpos + 1 + inBuf; } int i = 0, j = 0, k = 0; int nextColDiff = 0, columnDiff = 0; while (i < len && bufline[j = start % bufsize] == bufline[k = (start + 1) % bufsize]) { bufline[j] = newLine; nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; bufcolumn[j] = newCol + columnDiff; columnDiff = nextColDiff; i++; start++; } if (i < len) { bufline[j] = newLine++; bufcolumn[j] = newCol + columnDiff; while (i++ < len) { if (bufline[j = start % bufsize] != bufline[(start + 1) % bufsize]) bufline[j] = newLine++; else bufline[j] = newLine; start++; } } line = bufline[j]; column = bufcolumn[j]; } void CharStream::ExpandBuff(bool wrapAround) { JAVACC_CHAR_TYPE *newbuffer = new JAVACC_CHAR_TYPE[bufsize + 2048]; int *newbufline = new int[bufsize + 2048]; int *newbufcolumn = new int[bufsize + 2048]; if (wrapAround) { ArrayCopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); ArrayCopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos); ArrayCopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); ArrayCopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); ArrayCopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); ArrayCopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); bufpos += (bufsize - tokenBegin); } else { ArrayCopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); ArrayCopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); ArrayCopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); bufpos -= tokenBegin; } maxNextCharInd = bufpos; DeleteBuffers(); buffer = newbuffer; bufline = newbufline; bufcolumn = newbufcolumn; bufsize += 2048; available = bufsize; tokenBegin = 0; } void CharStream::FillBuff() { if (maxNextCharInd == available) { if (available == bufsize) { if (tokenBegin > 2048) { bufpos = maxNextCharInd = 0; available = tokenBegin; } else if (tokenBegin < 0) { bufpos = maxNextCharInd = 0; } else { ExpandBuff(false); } } else if (available > tokenBegin) { available = bufsize; } else if ((tokenBegin - available) < 2048) { ExpandBuff(true); } else { available = tokenBegin; } } int i = inputStream->read(buffer, maxNextCharInd, available - maxNextCharInd); if (i > 0) { maxNextCharInd += i; } else { --bufpos; backup(0); if (tokenBegin == -1) { tokenBegin = bufpos; } } } void CharStream::UpdateLineColumn(JAVACC_CHAR_TYPE c) { column++; if (prevCharIsLF) { prevCharIsLF = false; column = 1; line++; } else if (prevCharIsCR) { prevCharIsCR = false; if (c == '\n') { prevCharIsLF = true; } else { column = 1; line++; } } switch (c) { case '\r' : prevCharIsCR = true; break; case '\n' : prevCharIsLF = true; break; case '\t' : column--; column += (tabSize - (column % tabSize)); break; default : break; } bufline[bufpos] = line; bufcolumn[bufpos] = column; } } } } /* JavaCC - OriginalChecksum=6446405b72de5876e9dca3c70b6b1639 (do not edit this line) */ Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/CharStream.h0000644000175000017500000002217712315260742024705 0ustar jonasjonas/* Generated By:JavaCC: Do not edit this line. CharStream.h Version 6.0 */ /* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ #ifndef CHARSTREAM_H #define CHARSTREAM_H #include "JavaCC.h" #ifndef INITIAL_BUFFER_SIZE #define INITIAL_BUFFER_SIZE 4096 #endif namespace Konclude { namespace Parser { namespace FunctionalJAVACC { /** * This class describes a character stream that maintains line and * column number positions of the characters. It also has the capability * to backup the stream to some extent. An implementation of this * class is used in the TokenManager implementation generated by * JavaCCParser. * * All the methods except backup can be implemented in any fashion. backup * needs to be implemented correctly for the correct operation of the lexer. * Rest of the methods are all used to get information like line number, * column number and the string that constitutes a token and are not used * by the lexer. Hence their implementation won't affect the generated lexer's * operation. */ class CharStream { public: void setTabSize(int i) { tabSize = i; } int getTabSize(int i) { return tabSize; } virtual int getColumn() { return trackLineColumn ? bufcolumn[bufpos] : -1; } virtual int getLine() { return trackLineColumn ? bufline[bufpos] : -1; } virtual int getEndColumn() { return trackLineColumn ? bufcolumn[bufpos] : -1; } virtual int getEndLine() { return trackLineColumn ? bufline[bufpos] : -1; } virtual int getBeginColumn() { return trackLineColumn ? bufcolumn[tokenBegin] : -1; } virtual int getBeginLine() { return trackLineColumn ? bufline[tokenBegin] : -1; } virtual bool getTrackLineColumn() { return trackLineColumn; } virtual void setTrackLineColumn(bool val) { trackLineColumn = val; } /** * Backs up the input stream by amount steps. Lexer calls this method if it * had already read some characters, but could not use them to match a * (longer) token. So, they will be used again as the prefix of the next * token and it is the implemetation's responsibility to do this right. */ virtual inline void backup(int amount) { inBuf += amount; bufpos -= amount; if (bufpos < 0) { bufpos += bufsize; } } /** * Returns the next character that marks the beginning of the next token. * All characters must remain in the buffer between two successive calls * to this method to implement backup correctly. */ virtual inline JAVACC_CHAR_TYPE BeginToken() { tokenBegin = -1; JAVACC_CHAR_TYPE c = readChar(); tokenBegin = bufpos; return c; } /** * Returns the next character from the selected input. The method * of selecting the input is the responsibility of the class * implementing this class. */ virtual inline JAVACC_CHAR_TYPE readChar() { if (inBuf > 0) { --inBuf; ++bufpos; if (bufpos == bufsize) { bufpos = 0; } return buffer[bufpos]; } ++bufpos; if (bufpos >= maxNextCharInd) { FillBuff(); } JAVACC_CHAR_TYPE c = buffer[bufpos]; if (trackLineColumn) { UpdateLineColumn(c); } return c; } virtual void ExpandBuff(bool wrapAround); virtual void FillBuff(); /** * Returns a string made up of characters from the marked token beginning * to the current buffer position. Implementations can return * anything that they want to. For example, for efficiency, one might decide * to just return NULL, which is a valid implementation. */ virtual JAVACC_STRING_TYPE GetImage() { if (bufpos >= tokenBegin) return JAVACC_STRING_TYPE(buffer + tokenBegin, bufpos - tokenBegin + 1); else return JAVACC_STRING_TYPE(buffer + tokenBegin, bufsize - tokenBegin) .append(buffer, bufpos + 1); } /** * Returns an array of characters that make up the suffix of length 'len' for * the currently matched token. This is used to build up the matched string * for use in actions in the case of MORE. A simple and inefficient * implementation of this is as follows : */ virtual JAVACC_STRING_TYPE GetSuffix(int len) { if ((bufpos + 1) >= len) { return JAVACC_STRING_TYPE(buffer + bufpos - len + 1, len); } return JAVACC_STRING_TYPE(buffer + bufsize - (len - bufpos - 1), len - bufpos - 1) .append(buffer, bufpos + 1); } /** * The lexer calls this function to indicate that it is done with the stream * and hence implementations can free any resources held by this class. */ virtual void DeleteBuffers(); virtual ~CharStream() { if (deleteStream) { delete inputStream; } DeleteBuffers(); } bool endOfInput() { return inBuf == 0 && bufpos + 1 >= maxNextCharInd && inputStream->endOfInput(); } CharStream(const JAVACC_CHAR_TYPE *buf, int sz, int startline, int startcolumn, int buffersize) : bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false), buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0), prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0), inBuf(0),tabSize(8), trackLineColumn(true) { ReInit(JAVACC_STRING_TYPE(buf, sz), startline, startcolumn, buffersize); } CharStream(const JAVACC_CHAR_TYPE *buf, int sz, int startline, int startcolumn) : bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false), buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0), prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0), inBuf(0),tabSize(8), trackLineColumn(true) { ReInit(JAVACC_STRING_TYPE(buf, sz), startline, startcolumn, INITIAL_BUFFER_SIZE); } CharStream(const JAVACC_STRING_TYPE& str, int startline, int startcolumn, int buffersize) : bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false), buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0), prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0), inBuf(0),tabSize(8), trackLineColumn(true) { ReInit(str, startline, startcolumn, buffersize); } CharStream(const JAVACC_STRING_TYPE& str, int startline, int startcolumn) : bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false), buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0), prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0), inBuf(0) ,tabSize(8), trackLineColumn(true){ ReInit(str, startline, startcolumn, INITIAL_BUFFER_SIZE); } CharStream(ReaderStream *input_stream, int startline, int startcolumn, int buffersize) : bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false), buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0), prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0), inBuf(0),tabSize(8), trackLineColumn(true) { ReInit(input_stream, startline, startcolumn, INITIAL_BUFFER_SIZE); } CharStream(ReaderStream *input_stream, int startline, int startcolumn) : bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false), buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0), prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0), inBuf(0),tabSize(8), trackLineColumn(true) { ReInit(input_stream, startline, startcolumn, INITIAL_BUFFER_SIZE); } CharStream(ReaderStream *input_stream) : bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false), buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0), prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0), inBuf(0),tabSize(8), trackLineColumn(true) { ReInit(input_stream, 1, 1, INITIAL_BUFFER_SIZE); } virtual void ReInit(ReaderStream *input_stream, int startline, int startcolumn, int buffersize); virtual void ReInit(ReaderStream *input_stream, int startline, int startcolumn) { ReInit(input_stream, startline, startcolumn, INITIAL_BUFFER_SIZE); } virtual void ReInit(ReaderStream *input_stream) { ReInit(input_stream, 1, 1, INITIAL_BUFFER_SIZE); } virtual void ReInit(const JAVACC_STRING_TYPE& str, int startline, int startcolumn, int buffersize); virtual void ReInit(const JAVACC_STRING_TYPE& str, int startline, int startcolumn) { ReInit(str, startline, startcolumn, INITIAL_BUFFER_SIZE); } virtual void adjustBeginLineColumn(int newLine, int newCol); protected: virtual void UpdateLineColumn(JAVACC_CHAR_TYPE c); int *bufline; int *bufcolumn; ReaderStream *inputStream; bool deleteStream; JAVACC_CHAR_TYPE * buffer; int bufpos; int bufsize; int tokenBegin; int column; int line; bool prevCharIsCR ; bool prevCharIsLF ; int available; int maxNextCharInd; int inBuf ; int tabSize ; bool trackLineColumn; }; } } } #endif /* JavaCC - OriginalChecksum=d6c3255521401b0bb10012ce9bd724db (do not edit this line) */ Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/CTokenManager.h0000644000175000017500000000335012520550734025323 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_FUNCTIONALJAVACC_CTOKENMANAGER_H #define KONCLUDE_PARSER_FUNCTIONALJAVACC_CTOKENMANAGER_H // Libraries includes #include // Namespace includes #include "FunctionalJAVACCSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace FunctionalJAVACC { /*! * * \class CTokenManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTokenManager { // public methods public: //! Constructor CTokenManager(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_FUNCTIONALJAVACC_CTOKENMANAGER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/CJAVACCParser.cpp0000644000175000017500000000203212520550734025403 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CJAVACCParser.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { CJAVACCParser::CJAVACCParser() { } }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/CTokenBase.cpp0000644000175000017500000000202112520550734025150 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTokenBase.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { CTokenBase::CTokenBase() { } }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/OWL2FunctionalStyleParser.cpp0000644000175000017500000023337512403200102030135 0ustar jonasjonas/* OWL2FunctionalStyleParser.cc */ #include "OWL2FunctionalStyleParser.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { unsigned int jj_la1_0[] = { 0x0,0x0,0x200,0x0,0x0,0x800,0x40000,0x0,0x0,0x100,0x3f000,0x80000,0x800000,0x800000,0x0,0x0,0xff000000,0x0,0xff000000,0xff000000,0xff000000,0x800000,0x800000,0x800000,0x40000,0x0,0x0,0xff000000,0x0,0x180000,0x80000,0x0,0x0,0x80000,0x80000,0x0,0x0,0x0,0x0,0x0,0x0,}; unsigned int jj_la1_1[] = { 0x0,0x0,0x0,0x0,0x0,0x0,0xffffe000,0x0,0x0,0x0,0x0,0x0,0x78,0x78,0x0,0x0,0x1f87,0x0,0x1f87,0x1f87,0x1f87,0x78,0x78,0x78,0xffffe000,0x0,0x1e000,0x1f87,0x3ffe0000,0x0,0x0,0xc0000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; unsigned int jj_la1_2[] = { 0x40100000,0x2000,0x0,0x40100000,0x40100000,0x0,0x3dfff,0x40500000,0x80000,0x0,0x0,0x40100000,0x40100000,0x40100000,0x0,0x40100000,0x40100000,0x40500000,0x40100000,0x40100000,0x40100000,0x40100000,0x40100000,0x40100000,0x3dfff,0x2000,0x0,0x40100000,0x0,0x40100000,0x40100000,0xf,0x40100000,0x40100000,0x40100000,0x1fc0,0x40500000,0x2000,0x40500000,0x3c000,0x40500000,}; unsigned int jj_la1_3[] = { 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0,0x0,}; /** Constructor with user supplied TokenManager. */ QString OWL2FunctionalStyleParser::languageTag() {Token* t;if (!hasError) { t = jj_consume_token(LANGTAG); } return JAVACC_TO_QSTRING(t->image); assert(false); } QString OWL2FunctionalStyleParser::nodeId() {Token* t;if (!hasError) { jj_consume_token(BLANK_NODE_PREFIX); } if (!hasError) { t = jj_consume_token(PN_LOCAL); } return JAVACC_TO_QSTRING(t->image); assert(false); } QString OWL2FunctionalStyleParser::fullIri() {Token* t;if (!hasError) { t = jj_consume_token(FULL_IRI); } return JAVACC_TO_QSTRING(t->image); assert(false); } QString OWL2FunctionalStyleParser::iri() {QString x;if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case FULL_IRI:{if (!hasError) { x = fullIri(); } break; } case PNAME_NS:{if (!hasError) { x = abbreviatedIri(); } break; } default: jj_la1[0] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } return x; assert(false); } QString OWL2FunctionalStyleParser::abbreviatedIri() {Token* t; QString abbName;if (!hasError) { abbName = prefixName(); } if (!hasError) { t = jj_consume_token(PN_LOCAL); } return getBuilder()->resolveAbbreviationName(abbName+JAVACC_TO_QSTRING(t->image)); assert(false); } QString OWL2FunctionalStyleParser::prefixName() {Token* t = nullptr;if (!hasError) { t = jj_consume_token(PNAME_NS); } return JAVACC_TO_QSTRING(t->image); assert(false); } void OWL2FunctionalStyleParser::ontologyAnnotations() {if (!hasError) { while (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case ANNOTATION:{ ; break; } default: jj_la1[1] = jj_gen; goto end_label_1; }if (!hasError) { annotation(); } } end_label_1: ; } } void OWL2FunctionalStyleParser::ontologyDocument() {if (!hasError) { while (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case PREFIX:{ ; break; } default: jj_la1[2] = jj_gen; goto end_label_2; }if (!hasError) { prefixDeclaration(); } } end_label_2: ; } if (!hasError) { ontology(); } } void OWL2FunctionalStyleParser::prefixDeclaration() {QString abbName; QString fullName;if (!hasError) { jj_consume_token(PREFIX); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { abbName = prefixName(); } if (!hasError) { jj_consume_token(EQUALS); } if (!hasError) { fullName = fullIri(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } if (abbName.endsWith(":")) { abbName = abbName.remove(abbName.length()-1,1); } getBuilder()->addNameAbbreviation(fullName,abbName); } void OWL2FunctionalStyleParser::ontology() {if (!hasError) { jj_consume_token(ONTOLOGY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case PNAME_NS: case FULL_IRI:{if (!hasError) { ontologyIri(); } if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case PNAME_NS: case FULL_IRI:{if (!hasError) { versionIri(); } break; } default: jj_la1[3] = jj_gen; ; } } break; } default: jj_la1[4] = jj_gen; ; } } if (!hasError) { directlyImportsDocuments(); } if (!hasError) { ontologyAnnotations(); } if (!hasError) { axioms(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } } QString OWL2FunctionalStyleParser::ontologyIri() {QString x;if (!hasError) { x = iri(); } return x; assert(false); } QString OWL2FunctionalStyleParser::versionIri() {QString x;if (!hasError) { x = iri(); } return x; assert(false); } void OWL2FunctionalStyleParser::directlyImportsDocuments() {QString x;if (!hasError) { while (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case IMPORT:{ ; break; } default: jj_la1[5] = jj_gen; goto end_label_3; }if (!hasError) { jj_consume_token(IMPORT); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = iri(); } if (!hasError) { getBuilder()->addOntologyImport(x); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } } end_label_3: ; } } void OWL2FunctionalStyleParser::axioms() {CBuildExpressionPtr x;if (!hasError) { while (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case DECLARATION: case SUB_CLASS_OF: case EQUIVALENT_CLASSES: case DISJOINT_CLASSES: case DISJOINT_UNION: case SUB_OBJECT_PROPERTY_OF: case EQUIVALENT_OBJECT_PROPERTIES: case DISJOINT_OBJECT_PROPERTIES: case OBJECT_PROPERTY_DOMAIN: case OBJECT_PROPERTY_RANGE: case INVERSE_OBJECT_PROPERTIES: case FUNCTIONAL_OBJECT_PROPERTY: case INVERSE_FUNCTIONAL_OBJECT_PROPERTY: case REFLEXIVE_OBJECT_PROPERTY: case IRREFLEXIVE_OBJECT_PROPERTY: case SYMMETRIC_OBJECT_PROPERTY: case ASYMMETRIC_OBJECT_PROPERTY: case TRANSITIVE_OBJECT_PROPERTY: case SUB_DATA_PROPERTY_OF: case EQUIVALENT_DATA_PROPERTIES: case DISJOINT_DATA_PROPERTIES: case DATA_PROPERTY_DOMAIN: case DATA_PROPERTY_RANGE: case FUNCTIONAL_DATA_PROPERTY: case DATATYPE_DEFINITION: case HAS_KEY: case SAME_INDIVIDUAL: case DIFFERENT_INDIVIDUALS: case CLASS_ASSERTION: case OBJECT_PROPERTY_ASSERTION: case NEGATIVE_OBJECT_PROPERTY_ASSERTION: case DATA_PROPERTY_ASSERTION: case NEGATIVE_DATA_PROPERTY_ASSERTION: case ANNOTATION_ASSERTION: case SUB_ANNOTATION_PROPERTY_OF: case ANNOTATION_PROPERTY_DOMAIN: case ANNOTATION_PROPERTY_RANGE:{ ; break; } default: jj_la1[6] = jj_gen; goto end_label_4; }if (!hasError) { x = axiom(); } if (!hasError) { getBuilder()->tellOntologyAxiom(x); } } end_label_4: ; } } CBuildExpressionPtr OWL2FunctionalStyleParser::owlClass() {QString x;if (!hasError) { x = iri(); } return getBuilder()->getClass(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::datatype() {QString x;if (!hasError) { x = iri(); } return getBuilder()->getDatatype(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectProperty() {QString x;if (!hasError) { x = iri(); } return getBuilder()->getObjectProberty(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataProperty() {QString x;if (!hasError) { x = iri(); } return getBuilder()->getDataProberty(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::annotationProperty() {QString x;if (!hasError) { x = iri(); } return nullptr; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::individual() {CBuildExpressionPtr x;if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case PNAME_NS: case FULL_IRI:{if (!hasError) { x = namedIndividual(); } break; } case BLANK_NODE_PREFIX:{if (!hasError) { x = anonymousIndividual(); } break; } default: jj_la1[7] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } return x; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::namedIndividual() {QString x;if (!hasError) { x = iri(); } return getBuilder()->getNamedIndividual(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::anonymousIndividual() {QString x;if (!hasError) { x = nodeId(); } return getBuilder()->getAnonymousIndividual(getBuilder()->getOntologyName(),x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::literal(bool annotation) {QString x,l; CBuildExpressionPtr d = nullptr;if (!hasError) { x = quotedQString(); } if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case REFERENCE:{if (!hasError) { jj_consume_token(REFERENCE); } if (!hasError) { d = datatype(); } break; } default: jj_la1[9] = jj_gen;if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case LANGTAG:{if (!hasError) { l = languageTag(); } break; } default: jj_la1[8] = jj_gen; ; } } } } if (annotation) { return nullptr; } if (d == nullptr) { d = getBuilder()->getDatatype("http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral"); if (l.isEmpty()) { x += "@"; } else { x += l; } } CBuildExpressionPtr y = getBuilder()->getDataLexicalValue(x); return getBuilder()->getDataLiteral((CDataLexicalValueExpressionPtr)y,(CDatatypeExpressionPtr)d); assert(false); } QString OWL2FunctionalStyleParser::quotedQString() {Token* t;if (!hasError) { t = jj_consume_token(QUOTED_QString); } return JAVACC_TO_QSTRING(t->image); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::declaration() {CBuildExpressionPtr x;if (!hasError) { jj_consume_token(DECLARATION); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = entity(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getDeclaration(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::entity() {CBuildExpressionPtr x = nullptr;if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case CLASS:{if (!hasError) { jj_consume_token(CLASS); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = owlClass(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } break; } case DATATYPE:{if (!hasError) { jj_consume_token(DATATYPE); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = datatype(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } break; } case OBJECT_PROPERTY:{if (!hasError) { jj_consume_token(OBJECT_PROPERTY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = objectProperty(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } break; } case DATA_PROPERTY:{if (!hasError) { jj_consume_token(DATA_PROPERTY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = dataProperty(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } break; } case ANNOTATION_PROPERTY:{if (!hasError) { jj_consume_token(ANNOTATION_PROPERTY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = annotationProperty(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } break; } case NAMED_INDIVIDUAL:{if (!hasError) { jj_consume_token(NAMED_INDIVIDUAL); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = namedIndividual(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } break; } default: jj_la1[10] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } return x; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectPropertyExpression() {CBuildExpressionPtr x;if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case PNAME_NS: case FULL_IRI:{if (!hasError) { x = objectProperty(); } break; } case OBJECT_INVERSE_OF:{if (!hasError) { x = inverseObjectProperty(); } break; } default: jj_la1[11] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } return x; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::inverseObjectProperty() {CBuildExpressionPtr x;if (!hasError) { jj_consume_token(OBJECT_INVERSE_OF); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = objectProperty(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getInverseObjectPropertyOf(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataPropertyExpression() {CBuildExpressionPtr x;if (!hasError) { x = dataProperty(); } return x; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataRange() {CBuildExpressionPtr x;if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case PNAME_NS: case FULL_IRI:{if (!hasError) { x = datatype(); } break; } case DATA_INTERSECTION_OF:{if (!hasError) { x = dataIntersectionOf(); } break; } case DATA_UNION_OF:{if (!hasError) { x = dataUnionOf(); } break; } case DATA_COMPLEMENT_OF:{if (!hasError) { x = dataComplementOf(); } break; } case DATA_ONE_OF:{if (!hasError) { x = dataOneOf(); } break; } case DATATYPE_RESTRICTION:{if (!hasError) { x = datatypeRestriction(); } break; } default: jj_la1[12] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } return x; assert(false); } CEXPRESSIONLIST OWL2FunctionalStyleParser::dataRangeList() {CBuildExpressionPtr x; CEXPRESSIONLIST v;if (!hasError) { while (!hasError) {if (!hasError) { x = dataRange(); } if (!hasError) { v.append(x); } switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case DATATYPE_RESTRICTION: case DATA_INTERSECTION_OF: case DATA_UNION_OF: case DATA_COMPLEMENT_OF: case DATA_ONE_OF: case PNAME_NS: case FULL_IRI:{ ; break; } default: jj_la1[13] = jj_gen; goto end_label_5; } } end_label_5: ; } return v; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataIntersectionOf() {CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(DATA_INTERSECTION_OF); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { v = dataRangeList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getDataIntersectionOf(v); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataUnionOf() {CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(DATA_UNION_OF); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { v = dataRangeList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getDataUnionOf(v); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataComplementOf() {CBuildExpressionPtr x;if (!hasError) { jj_consume_token(DATA_COMPLEMENT_OF); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = dataRange(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getDataComplementOf(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataOneOf() {CBuildExpressionPtr x; CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(DATA_ONE_OF); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { while (!hasError) {if (!hasError) { x = literal(false); } if (!hasError) { v.append(x); } switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case QUOTED_QString:{ ; break; } default: jj_la1[14] = jj_gen; goto end_label_6; } } end_label_6: ; } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getDataOneOf(v); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::datatypeRestriction() {CBuildExpressionPtr x; CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(DATATYPE_RESTRICTION); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = datatype(); } if (!hasError) { v = facetRestrictionList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } v.append(x); return getBuilder()->getDatatypeRestriction(v); assert(false); } CEXPRESSIONLIST OWL2FunctionalStyleParser::facetRestrictionList() {CBuildExpressionPtr x; CEXPRESSIONLIST v;if (!hasError) { while (!hasError) {if (!hasError) { x = facetRestriction(); } if (!hasError) { v.append(x); } switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case PNAME_NS: case FULL_IRI:{ ; break; } default: jj_la1[15] = jj_gen; goto end_label_7; } } end_label_7: ; } return v; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::facetRestriction() {QString f; CBuildExpressionPtr l;if (!hasError) { f = iri(); } if (!hasError) { l = literal(false); } CBuildExpressionPtr x = getBuilder()->getDataFacet(f); return getBuilder()->getDataFacetRestriction(l,x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::classExpression() {CBuildExpressionPtr x;if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case PNAME_NS: case FULL_IRI:{if (!hasError) { x = owlClass(); } break; } case OBJECT_INTERSECTION_OF:{if (!hasError) { x = objectIntersectionOf(); } break; } case OBJECT_UNION_OF:{if (!hasError) { x = objectUnionOf(); } break; } case OBJECT_COMPLEMENT_OF:{if (!hasError) { x = objectComplementOf(); } break; } case OBJECT_ONE_OF:{if (!hasError) { x = objectOneOf(); } break; } case OBJECT_SOME_VALUES_FROM:{if (!hasError) { x = objectSomeValuesFrom(); } break; } case OBJECT_ALL_VALUES_FROM:{if (!hasError) { x = objectAllValuesFrom(); } break; } case OBJECT_HAS_VALUE:{if (!hasError) { x = objectHasValue(); } break; } case OBJECT_HAS_SELF:{if (!hasError) { x = objectHasSelf(); } break; } case OBJECT_MIN_CARDINALITY:{if (!hasError) { x = objectMinCardinality(); } break; } case OBJECT_MAX_CARDINALITY:{if (!hasError) { x = objectMaxCardinality(); } break; } case OBJECT_EXACT_CARDINALITY:{if (!hasError) { x = objectExactCardinality(); } break; } case DATA_SOME_VALUES_FROM:{if (!hasError) { x = dataSomeValuesFrom(); } break; } case DATA_ALL_VALUES_FROM:{if (!hasError) { x = dataAllValuesFrom(); } break; } case DATA_HAS_VALUE:{if (!hasError) { x = dataHasValue(); } break; } case DATA_MIN_CARDINALITY:{if (!hasError) { x = dataMinCardinality(); } break; } case DATA_MAX_CARDINALITY:{if (!hasError) { x = dataMaxCardinality(); } break; } case DATA_EXACT_CARDINALITY:{if (!hasError) { x = dataExactCardinality(); } break; } default: jj_la1[16] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } return x; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectIntersectionOf() {CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(OBJECT_INTERSECTION_OF); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { v = classExpressionList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getObjectIntersectionOf(v); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectUnionOf() {CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(OBJECT_UNION_OF); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { v = classExpressionList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getObjectUnionOf(v); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectComplementOf() {CBuildExpressionPtr x;if (!hasError) { jj_consume_token(OBJECT_COMPLEMENT_OF); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = classExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getObjectComplementOf(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectOneOf() {CBuildExpressionPtr x; CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(OBJECT_ONE_OF); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { while (!hasError) {if (!hasError) { x = individual(); } if (!hasError) { v.append(x); } switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case PNAME_NS: case BLANK_NODE_PREFIX: case FULL_IRI:{ ; break; } default: jj_la1[17] = jj_gen; goto end_label_8; } } end_label_8: ; } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getObjectOneOf(v); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectSomeValuesFrom() {CBuildExpressionPtr x; CBuildExpressionPtr y;if (!hasError) { jj_consume_token(OBJECT_SOME_VALUES_FROM); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { y = classExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getObjectSomeValuesFrom(x,y); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectAllValuesFrom() {CBuildExpressionPtr x; CBuildExpressionPtr y;if (!hasError) { jj_consume_token(OBJECT_ALL_VALUES_FROM); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { y = classExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getObjectAllValuesFrom(x,y); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectHasValue() {CBuildExpressionPtr x; CBuildExpressionPtr y;if (!hasError) { jj_consume_token(OBJECT_HAS_VALUE); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { y = individual(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getObjectHasValue(x,y); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectHasSelf() {CBuildExpressionPtr x;if (!hasError) { jj_consume_token(OBJECT_HAS_SELF); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getObjectHasSelf(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectMinCardinality() {Token* n; CBuildExpressionPtr x; CBuildExpressionPtr y = nullptr;if (!hasError) { jj_consume_token(OBJECT_MIN_CARDINALITY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { n = jj_consume_token(NON_NEGATIVE_INTEGER); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case OBJECT_INTERSECTION_OF: case OBJECT_UNION_OF: case OBJECT_COMPLEMENT_OF: case OBJECT_ONE_OF: case OBJECT_SOME_VALUES_FROM: case OBJECT_ALL_VALUES_FROM: case OBJECT_HAS_VALUE: case OBJECT_HAS_SELF: case OBJECT_MIN_CARDINALITY: case OBJECT_MAX_CARDINALITY: case OBJECT_EXACT_CARDINALITY: case DATA_SOME_VALUES_FROM: case DATA_ALL_VALUES_FROM: case DATA_HAS_VALUE: case DATA_MIN_CARDINALITY: case DATA_MAX_CARDINALITY: case DATA_EXACT_CARDINALITY: case PNAME_NS: case FULL_IRI:{if (!hasError) { y = classExpression(); } break; } default: jj_la1[18] = jj_gen; ; } } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } if (y == nullptr) { y = getBuilder()->getTopClass(); } cint64 cardinality = JAVACC_TO_QSTRING(n->image).toLongLong(); return getBuilder()->getObjectMinCardinality(x,y,cardinality); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectMaxCardinality() {Token* n; CBuildExpressionPtr x; CBuildExpressionPtr y = nullptr;if (!hasError) { jj_consume_token(OBJECT_MAX_CARDINALITY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { n = jj_consume_token(NON_NEGATIVE_INTEGER); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case OBJECT_INTERSECTION_OF: case OBJECT_UNION_OF: case OBJECT_COMPLEMENT_OF: case OBJECT_ONE_OF: case OBJECT_SOME_VALUES_FROM: case OBJECT_ALL_VALUES_FROM: case OBJECT_HAS_VALUE: case OBJECT_HAS_SELF: case OBJECT_MIN_CARDINALITY: case OBJECT_MAX_CARDINALITY: case OBJECT_EXACT_CARDINALITY: case DATA_SOME_VALUES_FROM: case DATA_ALL_VALUES_FROM: case DATA_HAS_VALUE: case DATA_MIN_CARDINALITY: case DATA_MAX_CARDINALITY: case DATA_EXACT_CARDINALITY: case PNAME_NS: case FULL_IRI:{if (!hasError) { y = classExpression(); } break; } default: jj_la1[19] = jj_gen; ; } } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } if (y == nullptr) { y = getBuilder()->getTopClass(); } cint64 cardinality = JAVACC_TO_QSTRING(n->image).toLongLong(); return getBuilder()->getObjectMaxCardinality(x,y,cardinality); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectExactCardinality() {Token* n; CBuildExpressionPtr x; CBuildExpressionPtr y = nullptr;if (!hasError) { jj_consume_token(OBJECT_EXACT_CARDINALITY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { n = jj_consume_token(NON_NEGATIVE_INTEGER); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case OBJECT_INTERSECTION_OF: case OBJECT_UNION_OF: case OBJECT_COMPLEMENT_OF: case OBJECT_ONE_OF: case OBJECT_SOME_VALUES_FROM: case OBJECT_ALL_VALUES_FROM: case OBJECT_HAS_VALUE: case OBJECT_HAS_SELF: case OBJECT_MIN_CARDINALITY: case OBJECT_MAX_CARDINALITY: case OBJECT_EXACT_CARDINALITY: case DATA_SOME_VALUES_FROM: case DATA_ALL_VALUES_FROM: case DATA_HAS_VALUE: case DATA_MIN_CARDINALITY: case DATA_MAX_CARDINALITY: case DATA_EXACT_CARDINALITY: case PNAME_NS: case FULL_IRI:{if (!hasError) { y = classExpression(); } break; } default: jj_la1[20] = jj_gen; ; } } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } if (y == nullptr) { y = getBuilder()->getTopClass(); } cint64 cardinality = JAVACC_TO_QSTRING(n->image).toLongLong(); return getBuilder()->getObjectExactlyCardinality(x,y,cardinality); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataSomeValuesFrom() {CBuildExpressionPtr x, y;if (!hasError) { jj_consume_token(DATA_SOME_VALUES_FROM); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = dataProperty(); } if (!hasError) { y = dataRange(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } if (y == nullptr) { y = getBuilder()->getTopDataRange(); } return getBuilder()->getDataSomeValuesFrom(x,y); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataAllValuesFrom() {CBuildExpressionPtr x, y;if (!hasError) { jj_consume_token(DATA_ALL_VALUES_FROM); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = dataProperty(); } if (!hasError) { y = dataRange(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getDataAllValuesFrom(x,y); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataHasValue() {CBuildExpressionPtr x, y;if (!hasError) { jj_consume_token(DATA_HAS_VALUE); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { x = dataPropertyExpression(); } if (!hasError) { y = literal(false); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getDataHasValue(x,y); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataMinCardinality() {Token* n; CBuildExpressionPtr x; CBuildExpressionPtr y = nullptr;if (!hasError) { jj_consume_token(DATA_MIN_CARDINALITY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { n = jj_consume_token(NON_NEGATIVE_INTEGER); } if (!hasError) { x = dataPropertyExpression(); } if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case DATATYPE_RESTRICTION: case DATA_INTERSECTION_OF: case DATA_UNION_OF: case DATA_COMPLEMENT_OF: case DATA_ONE_OF: case PNAME_NS: case FULL_IRI:{if (!hasError) { y = dataRange(); } break; } default: jj_la1[21] = jj_gen; ; } } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } if (y == nullptr) { y = getBuilder()->getTopDataRange(); } cint64 cardinality = JAVACC_TO_QSTRING(n->image).toLongLong(); return getBuilder()->getDataMinCardinality(x,y,cardinality); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataMaxCardinality() {Token* n; CBuildExpressionPtr x; CBuildExpressionPtr y = nullptr;if (!hasError) { jj_consume_token(DATA_MAX_CARDINALITY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { n = jj_consume_token(NON_NEGATIVE_INTEGER); } if (!hasError) { x = dataPropertyExpression(); } if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case DATATYPE_RESTRICTION: case DATA_INTERSECTION_OF: case DATA_UNION_OF: case DATA_COMPLEMENT_OF: case DATA_ONE_OF: case PNAME_NS: case FULL_IRI:{if (!hasError) { y = dataRange(); } break; } default: jj_la1[22] = jj_gen; ; } } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } if (y == nullptr) { y = getBuilder()->getTopDataRange(); } cint64 cardinality = JAVACC_TO_QSTRING(n->image).toLongLong(); return getBuilder()->getDataMaxCardinality(x,y,cardinality); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataExactCardinality() {Token* n; CBuildExpressionPtr x; CBuildExpressionPtr y = nullptr;if (!hasError) { jj_consume_token(DATA_EXACT_CARDINALITY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { n = jj_consume_token(NON_NEGATIVE_INTEGER); } if (!hasError) { x = dataPropertyExpression(); } if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case DATATYPE_RESTRICTION: case DATA_INTERSECTION_OF: case DATA_UNION_OF: case DATA_COMPLEMENT_OF: case DATA_ONE_OF: case PNAME_NS: case FULL_IRI:{if (!hasError) { y = dataRange(); } break; } default: jj_la1[23] = jj_gen; ; } } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } if (y == nullptr) { y = getBuilder()->getTopDataRange(); } cint64 cardinality = JAVACC_TO_QSTRING(n->image).toLongLong(); return getBuilder()->getDataExactCardinality(x,y,cardinality); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::axiom() {CBuildExpressionPtr x = nullptr;if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case DECLARATION:{if (!hasError) { x = declaration(); } break; } case SUB_CLASS_OF: case EQUIVALENT_CLASSES: case DISJOINT_CLASSES: case DISJOINT_UNION:{if (!hasError) { x = classAxiom(); } break; } case SUB_OBJECT_PROPERTY_OF: case EQUIVALENT_OBJECT_PROPERTIES: case DISJOINT_OBJECT_PROPERTIES: case OBJECT_PROPERTY_DOMAIN: case OBJECT_PROPERTY_RANGE: case INVERSE_OBJECT_PROPERTIES: case FUNCTIONAL_OBJECT_PROPERTY: case INVERSE_FUNCTIONAL_OBJECT_PROPERTY: case REFLEXIVE_OBJECT_PROPERTY: case IRREFLEXIVE_OBJECT_PROPERTY: case SYMMETRIC_OBJECT_PROPERTY: case ASYMMETRIC_OBJECT_PROPERTY: case TRANSITIVE_OBJECT_PROPERTY:{if (!hasError) { x = objectPropertyAxiom(); } break; } case SUB_DATA_PROPERTY_OF: case EQUIVALENT_DATA_PROPERTIES: case DISJOINT_DATA_PROPERTIES: case DATA_PROPERTY_DOMAIN: case DATA_PROPERTY_RANGE: case FUNCTIONAL_DATA_PROPERTY:{if (!hasError) { x = dataPropertyAxiom(); } break; } case DATATYPE_DEFINITION:{if (!hasError) { x = datatypeDefinition(); } break; } case HAS_KEY:{if (!hasError) { x = hasKey(); } break; } case SAME_INDIVIDUAL: case DIFFERENT_INDIVIDUALS: case CLASS_ASSERTION: case OBJECT_PROPERTY_ASSERTION: case NEGATIVE_OBJECT_PROPERTY_ASSERTION: case DATA_PROPERTY_ASSERTION: case NEGATIVE_DATA_PROPERTY_ASSERTION:{if (!hasError) { x = assertion(); } break; } case ANNOTATION_ASSERTION: case SUB_ANNOTATION_PROPERTY_OF: case ANNOTATION_PROPERTY_DOMAIN: case ANNOTATION_PROPERTY_RANGE:{if (!hasError) { x = annotationAxiom(); } break; } default: jj_la1[24] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } return x; assert(false); } void OWL2FunctionalStyleParser::axiomAnnotations() {if (!hasError) { while (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case ANNOTATION:{ ; break; } default: jj_la1[25] = jj_gen; goto end_label_9; }if (!hasError) { annotation(); } } end_label_9: ; } } CBuildExpressionPtr OWL2FunctionalStyleParser::classAxiom() {CBuildExpressionPtr x;if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case SUB_CLASS_OF:{if (!hasError) { x = subClassOf(); } break; } case EQUIVALENT_CLASSES:{if (!hasError) { x = equivalentClasses(); } break; } case DISJOINT_CLASSES:{if (!hasError) { x = disjointClasses(); } break; } case DISJOINT_UNION:{if (!hasError) { x = disjointUnion(); } break; } default: jj_la1[26] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } return x; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::subClassOf() {CBuildExpressionPtr x, y;if (!hasError) { jj_consume_token(SUB_CLASS_OF); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = classExpression(); } if (!hasError) { y = classExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getSubClassOf(x,y); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::equivalentClasses() {CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(EQUIVALENT_CLASSES); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { v = classExpressionList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getEquivalentClasses(v); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::disjointClasses() {CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(DISJOINT_CLASSES); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { v = classExpressionList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getDisjointClasses(v); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::disjointUnion() {CBuildExpressionPtr x; CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(DISJOINT_UNION); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = owlClass(); } if (!hasError) { v = classExpressionList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } v.prepend(x); return getBuilder()->getDisjointUnion(v); assert(false); } CEXPRESSIONLIST OWL2FunctionalStyleParser::classExpressionList() {CBuildExpressionPtr x; CEXPRESSIONLIST v;if (!hasError) { while (!hasError) {if (!hasError) { x = classExpression(); } if (!hasError) { v.append(x); } switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case OBJECT_INTERSECTION_OF: case OBJECT_UNION_OF: case OBJECT_COMPLEMENT_OF: case OBJECT_ONE_OF: case OBJECT_SOME_VALUES_FROM: case OBJECT_ALL_VALUES_FROM: case OBJECT_HAS_VALUE: case OBJECT_HAS_SELF: case OBJECT_MIN_CARDINALITY: case OBJECT_MAX_CARDINALITY: case OBJECT_EXACT_CARDINALITY: case DATA_SOME_VALUES_FROM: case DATA_ALL_VALUES_FROM: case DATA_HAS_VALUE: case DATA_MIN_CARDINALITY: case DATA_MAX_CARDINALITY: case DATA_EXACT_CARDINALITY: case PNAME_NS: case FULL_IRI:{ ; break; } default: jj_la1[27] = jj_gen; goto end_label_10; } } end_label_10: ; } return v; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectPropertyAxiom() {CBuildExpressionPtr x;if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case SUB_OBJECT_PROPERTY_OF:{if (!hasError) { x = subObjectPropertyOf(); } break; } case EQUIVALENT_OBJECT_PROPERTIES:{if (!hasError) { x = equivalentObjectProperties(); } break; } case DISJOINT_OBJECT_PROPERTIES:{if (!hasError) { x = disjointObjectProperties(); } break; } case INVERSE_OBJECT_PROPERTIES:{if (!hasError) { x = inverseObjectProperties(); } break; } case OBJECT_PROPERTY_DOMAIN:{if (!hasError) { x = objectPropertyDomain(); } break; } case OBJECT_PROPERTY_RANGE:{if (!hasError) { x = objectPropertyRange(); } break; } case FUNCTIONAL_OBJECT_PROPERTY:{if (!hasError) { x = functionalObjectProperty(); } break; } case INVERSE_FUNCTIONAL_OBJECT_PROPERTY:{if (!hasError) { x = inverseFunctionalObjectProperty(); } break; } case REFLEXIVE_OBJECT_PROPERTY:{if (!hasError) { x = reflexiveObjectProperty(); } break; } case IRREFLEXIVE_OBJECT_PROPERTY:{if (!hasError) { x = irreflexiveObjectProperty(); } break; } case SYMMETRIC_OBJECT_PROPERTY:{if (!hasError) { x = symmetricObjectProperty(); } break; } case ASYMMETRIC_OBJECT_PROPERTY:{if (!hasError) { x = asymmetricObjectProperty(); } break; } case TRANSITIVE_OBJECT_PROPERTY:{if (!hasError) { x = transitiveObjectProperty(); } break; } default: jj_la1[28] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } return x; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::subObjectPropertyOf() {CBuildExpressionPtr x = nullptr; CBuildExpressionPtr z;if (!hasError) { jj_consume_token(SUB_OBJECT_PROPERTY_OF); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case OBJECT_INVERSE_OF: case PNAME_NS: case FULL_IRI:{if (!hasError) { x = objectPropertyExpression(); } break; } case OBJECT_PROPERTY_CHAIN:{if (!hasError) { x = propertyExpressionChain(); } break; } default: jj_la1[29] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } if (!hasError) { z = objectPropertyExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getSubObjectPropertyOf(x,z); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::propertyExpressionChain() {CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(OBJECT_PROPERTY_CHAIN); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { v = objectPropertyExpressionList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getObjectPropertyChain(v); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::equivalentObjectProperties() {CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(EQUIVALENT_OBJECT_PROPERTIES); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { v = objectPropertyExpressionList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getEquivalentObjectProperties(v); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::disjointObjectProperties() {CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(DISJOINT_OBJECT_PROPERTIES); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { v = objectPropertyExpressionList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getDisjointObjectProperties(v); assert(false); } CEXPRESSIONLIST OWL2FunctionalStyleParser::objectPropertyExpressionList() {CBuildExpressionPtr x; CEXPRESSIONLIST v;if (!hasError) { while (!hasError) {if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { v.append(x); } switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case OBJECT_INVERSE_OF: case PNAME_NS: case FULL_IRI:{ ; break; } default: jj_la1[30] = jj_gen; goto end_label_11; } } end_label_11: ; } return v; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::inverseObjectProperties() {CBuildExpressionPtr x, y;if (!hasError) { jj_consume_token(INVERSE_OBJECT_PROPERTIES); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { y = objectPropertyExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getInverseObjectProperties(x,y); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectPropertyDomain() {CBuildExpressionPtr x, y;if (!hasError) { jj_consume_token(OBJECT_PROPERTY_DOMAIN); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { y = classExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getObjectPropertyDomainExpression(x,y); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectPropertyRange() {CBuildExpressionPtr x, y;if (!hasError) { jj_consume_token(OBJECT_PROPERTY_RANGE); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { y = classExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getObjectPropertyRangeExpression(x,y); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::functionalObjectProperty() {CBuildExpressionPtr x;if (!hasError) { jj_consume_token(FUNCTIONAL_OBJECT_PROPERTY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getFunctionalObjectProperty(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::inverseFunctionalObjectProperty() {CBuildExpressionPtr x;if (!hasError) { jj_consume_token(INVERSE_FUNCTIONAL_OBJECT_PROPERTY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getInverseFunctionalObjectProperty(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::reflexiveObjectProperty() {CBuildExpressionPtr x;if (!hasError) { jj_consume_token(REFLEXIVE_OBJECT_PROPERTY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getReflexiveObjectProperty(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::irreflexiveObjectProperty() {CBuildExpressionPtr x;if (!hasError) { jj_consume_token(IRREFLEXIVE_OBJECT_PROPERTY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getIrreflexiveObjectProperty(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::symmetricObjectProperty() {CBuildExpressionPtr x;if (!hasError) { jj_consume_token(SYMMETRIC_OBJECT_PROPERTY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getSymmetricObjectProperty(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::asymmetricObjectProperty() {CBuildExpressionPtr x;if (!hasError) { jj_consume_token(ASYMMETRIC_OBJECT_PROPERTY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getAsymmetricObjectProperty(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::transitiveObjectProperty() {CBuildExpressionPtr x;if (!hasError) { jj_consume_token(TRANSITIVE_OBJECT_PROPERTY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getTransetiveObjectProperty(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataPropertyAxiom() {CBuildExpressionPtr x;if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case SUB_DATA_PROPERTY_OF:{if (!hasError) { x = subDataPropertyOf(); } break; } case EQUIVALENT_DATA_PROPERTIES:{if (!hasError) { x = equivalentDataProperties(); } break; } case DISJOINT_DATA_PROPERTIES:{if (!hasError) { x = disjointDataProperties(); } break; } case DATA_PROPERTY_DOMAIN:{if (!hasError) { x = dataPropertyDomain(); } break; } case DATA_PROPERTY_RANGE:{if (!hasError) { x = dataPropertyRange(); } break; } case FUNCTIONAL_DATA_PROPERTY:{if (!hasError) { x = functionalDataProperty(); } break; } default: jj_la1[31] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } return x; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::subDataPropertyOf() {CBuildExpressionPtr x,y;if (!hasError) { jj_consume_token(SUB_DATA_PROPERTY_OF); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = dataPropertyExpression(); } if (!hasError) { y = dataPropertyExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getSubDataPropertyOf(x,y); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::equivalentDataProperties() {CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(EQUIVALENT_DATA_PROPERTIES); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { v = dataPropertyExpressionList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getEquivalentDataProperties(v); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::disjointDataProperties() {CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(DISJOINT_DATA_PROPERTIES); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { v = dataPropertyExpressionList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getDisjointDataProperties(v); assert(false); } CEXPRESSIONLIST OWL2FunctionalStyleParser::dataPropertyExpressionList() {CBuildExpressionPtr x; CEXPRESSIONLIST v;if (!hasError) { while (!hasError) {if (!hasError) { x = dataPropertyExpression(); } if (!hasError) { v.append(x); } switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case PNAME_NS: case FULL_IRI:{ ; break; } default: jj_la1[32] = jj_gen; goto end_label_12; } } end_label_12: ; } return v; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataPropertyDomain() {CBuildExpressionPtr x, y;if (!hasError) { jj_consume_token(DATA_PROPERTY_DOMAIN); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = dataPropertyExpression(); } if (!hasError) { y = classExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getDataPropertyDomainExpression(x,y); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataPropertyRange() {CBuildExpressionPtr x, y;if (!hasError) { jj_consume_token(DATA_PROPERTY_RANGE); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = dataPropertyExpression(); } if (!hasError) { y = dataRange(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getDataPropertyRangeExpression(x,y); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::functionalDataProperty() {CBuildExpressionPtr x;if (!hasError) { jj_consume_token(FUNCTIONAL_DATA_PROPERTY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = dataPropertyExpression(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getFunctionalDataProperty(x); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::datatypeDefinition() {if (!hasError) { jj_consume_token(DATATYPE_DEFINITION); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { datatype(); } if (!hasError) { dataRange(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return nullptr; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::hasKey() {if (!hasError) { jj_consume_token(HAS_KEY); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { classExpression(); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { while (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case OBJECT_INVERSE_OF: case PNAME_NS: case FULL_IRI:{ ; break; } default: jj_la1[33] = jj_gen; goto end_label_13; }if (!hasError) { objectPropertyExpression(); } } end_label_13: ; } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { while (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case OBJECT_INVERSE_OF: case PNAME_NS: case FULL_IRI:{ ; break; } default: jj_la1[34] = jj_gen; goto end_label_14; }if (!hasError) { objectPropertyExpression(); } } end_label_14: ; } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return nullptr; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::assertion() {CBuildExpressionPtr x;if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case SAME_INDIVIDUAL:{if (!hasError) { x = sameIndividual(); } break; } case DIFFERENT_INDIVIDUALS:{if (!hasError) { x = differentIndividuals(); } break; } case CLASS_ASSERTION:{if (!hasError) { x = classAssertion(); } break; } case OBJECT_PROPERTY_ASSERTION:{if (!hasError) { x = objectPropertyAssertion(); } break; } case NEGATIVE_OBJECT_PROPERTY_ASSERTION:{if (!hasError) { x = negativeObjectPropertyAssertion(); } break; } case DATA_PROPERTY_ASSERTION:{if (!hasError) { x = dataPropertyAssertion(); } break; } case NEGATIVE_DATA_PROPERTY_ASSERTION:{if (!hasError) { x = negativeDataPropertyAssertion(); } break; } default: jj_la1[35] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } return x; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::sameIndividual() {CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(SAME_INDIVIDUAL); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { v = individualList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getSameIndividual(v); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::differentIndividuals() {CEXPRESSIONLIST v;if (!hasError) { jj_consume_token(DIFFERENT_INDIVIDUALS); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { v = individualList(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getDifferentIndividuals(v); assert(false); } CEXPRESSIONLIST OWL2FunctionalStyleParser::individualList() {CBuildExpressionPtr x; CEXPRESSIONLIST v;if (!hasError) { while (!hasError) {if (!hasError) { x = individual(); } if (!hasError) { v.append(x); } switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case PNAME_NS: case BLANK_NODE_PREFIX: case FULL_IRI:{ ; break; } default: jj_la1[36] = jj_gen; goto end_label_15; } } end_label_15: ; } return v; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::classAssertion() {CBuildExpressionPtr x, y;if (!hasError) { jj_consume_token(CLASS_ASSERTION); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = classExpression(); } if (!hasError) { y = individual(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getClassAssertion(x,y); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::objectPropertyAssertion() {CBuildExpressionPtr x, y, z;if (!hasError) { jj_consume_token(OBJECT_PROPERTY_ASSERTION); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { y = individual(); } if (!hasError) { z = individual(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getObjectPropertyAssertion(x,y,z); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::negativeObjectPropertyAssertion() {CBuildExpressionPtr x, y, z;if (!hasError) { jj_consume_token(NEGATIVE_OBJECT_PROPERTY_ASSERTION); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = objectPropertyExpression(); } if (!hasError) { y = individual(); } if (!hasError) { z = individual(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getNegativeObjectPropertyAssertion(x,y,z); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::dataPropertyAssertion() {CBuildExpressionPtr x, y, z;if (!hasError) { jj_consume_token(DATA_PROPERTY_ASSERTION); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = dataPropertyExpression(); } if (!hasError) { y = individual(); } if (!hasError) { z = literal(false); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getDataPropertyAssertion(x,y,z); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::negativeDataPropertyAssertion() {CBuildExpressionPtr x, y, z;if (!hasError) { jj_consume_token(NEGATIVE_DATA_PROPERTY_ASSERTION); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { x = dataPropertyExpression(); } if (!hasError) { y = individual(); } if (!hasError) { z = literal(false); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return getBuilder()->getNegativeDataPropertyAssertion(x,y,z); assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::annotation() {if (!hasError) { jj_consume_token(ANNOTATION); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { annotationAnnotations(); } if (!hasError) { annotationProperty(); } if (!hasError) { annotationValue(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return nullptr; assert(false); } void OWL2FunctionalStyleParser::annotationAnnotations() {if (!hasError) { while (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case ANNOTATION:{ ; break; } default: jj_la1[37] = jj_gen; goto end_label_16; }if (!hasError) { annotation(); } } end_label_16: ; } } CBuildExpressionPtr OWL2FunctionalStyleParser::annotationValue() {if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case BLANK_NODE_PREFIX:{if (!hasError) { anonymousIndividual(); } break; } case PNAME_NS: case FULL_IRI:{if (!hasError) { iri(); } break; } case QUOTED_QString:{if (!hasError) { literal(true); } break; } default: jj_la1[38] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } return nullptr; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::annotationAxiom() {if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case ANNOTATION_ASSERTION:{if (!hasError) { annotationAssertion(); } break; } case SUB_ANNOTATION_PROPERTY_OF:{if (!hasError) { subAnnotationPropertyOf(); } break; } case ANNOTATION_PROPERTY_DOMAIN:{if (!hasError) { annotationPropertyDomain(); } break; } case ANNOTATION_PROPERTY_RANGE:{if (!hasError) { annotationPropertyRange(); } break; } default: jj_la1[39] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } return nullptr; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::annotationAssertion() {if (!hasError) { jj_consume_token(ANNOTATION_ASSERTION); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { annotationProperty(); } if (!hasError) { annotationSubject(); } if (!hasError) { annotationValue(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return nullptr; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::annotationSubject() {if (!hasError) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case PNAME_NS: case FULL_IRI:{if (!hasError) { iri(); } break; } case BLANK_NODE_PREFIX:{if (!hasError) { anonymousIndividual(); } break; } default: jj_la1[40] = jj_gen; jj_consume_token(-1); errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true; } } return nullptr; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::subAnnotationPropertyOf() {if (!hasError) { jj_consume_token(SUB_ANNOTATION_PROPERTY_OF); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { annotationProperty(); } if (!hasError) { annotationProperty(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return nullptr; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::annotationPropertyDomain() {if (!hasError) { jj_consume_token(ANNOTATION_PROPERTY_DOMAIN); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { annotationProperty(); } if (!hasError) { iri(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return nullptr; assert(false); } CBuildExpressionPtr OWL2FunctionalStyleParser::annotationPropertyRange() {if (!hasError) { jj_consume_token(ANNOTATION_PROPERTY_RANGE); } if (!hasError) { jj_consume_token(OPEN_BRACKET); } if (!hasError) { axiomAnnotations(); } if (!hasError) { annotationProperty(); } if (!hasError) { iri(); } if (!hasError) { jj_consume_token(CLOSE_BRACKET); } return nullptr; assert(false); } OWL2FunctionalStyleParser::OWL2FunctionalStyleParser(TokenManager *tm) : CJAVACCParser() { head = NULL; ReInit(tm); } OWL2FunctionalStyleParser::~OWL2FunctionalStyleParser() { if (token_source) delete token_source; if (head) { Token *next, *t = head; while (t) { next = t->next; delete t; t = next; } } if (errorHandlerCreated) { delete errorHandler; } } void OWL2FunctionalStyleParser::ReInit(TokenManager *tm){ if (head) delete head; errorHandler = new ErrorHandler(); errorHandlerCreated = true; hasError = false; token_source = tm; head = token = new Token(); token->kind = 0; token->next = NULL; jj_lookingAhead = false; jj_rescan = false; jj_done = false; jj_scanpos = jj_lastpos = NULL; jj_gc = 0; jj_kind = -1; trace_indent = 0; trace_enabled = false; jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 41; i++) jj_la1[i] = -1; } Token * OWL2FunctionalStyleParser::jj_consume_token(int kind) { Token *oldToken; if ((oldToken = token)->next != NULL) token = token->next; else token = token->next = token_source->getNextToken(); jj_ntk = -1; if (token->kind == kind) { jj_gen++; return token; } token = oldToken; jj_kind = kind; JAVACC_STRING_TYPE image = kind >= 0 ? tokenImage[kind] : tokenImage[0]; errorHandler->handleUnexpectedToken(kind, image.substr(1, image.size() - 2), getToken(1), this), hasError = true; return token; } /** Get the next Token. */ Token * OWL2FunctionalStyleParser::getNextToken(){ if (token->next != NULL) token = token->next; else token = token->next = token_source->getNextToken(); jj_ntk = -1; jj_gen++; return token; } /** Get the specific Token. */ Token * OWL2FunctionalStyleParser::getToken(int index){ Token *t = token; for (int i = 0; i < index; i++) { if (t->next != NULL) t = t->next; else t = t->next = token_source->getNextToken(); } return t; } int OWL2FunctionalStyleParser::jj_ntk_f(){ if ((jj_nt=token->next) == NULL) return (jj_ntk = (token->next=token_source->getNextToken())->kind); else return (jj_ntk = jj_nt->kind); } void OWL2FunctionalStyleParser::parseError() { fprintf(stderr, "Parse error at: %d:%d, after token: %s encountered: %s\n", token->beginLine, token->beginColumn, addUnicodeEscapes(token->image).c_str(), addUnicodeEscapes(getToken(1)->image).c_str()); } void OWL2FunctionalStyleParser::enable_tracing() { } /** Disable tracing. */ void OWL2FunctionalStyleParser::disable_tracing() { } } } } Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/JavaCC.h0000644000175000017500000000243212334431656023740 0ustar jonasjonas/* Generated By:JavaCC: Do not edit this line. JavaCC.h Version 6.0 */ /* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ #ifndef __JAVACC_H #define __JAVACC_H #include #include #include #include #ifndef JAVACC_CHAR_TYPE #define JAVACC_CHAR_TYPE wchar_t #endif #ifndef JAVACC_STRING_TYPE #define JAVACC_STRING_TYPE std::basic_string #endif #define JAVACC_SIMPLE_STRING std::basic_string #define finally // TODO(Sreeni): Get rid of when we fix jjtree typedef JAVACC_STRING_TYPE StringBuffer; typedef JAVACC_STRING_TYPE String; // Abstraction on stream classes to read a block of data into a buffer. class ReaderStream { public: // Read block of data into a buffer and return the actual number read. virtual size_t read(JAVACC_CHAR_TYPE *bufptr, int offset, size_t len) { return 0; } virtual bool endOfInput() { return true; } virtual ~ReaderStream() {} }; const JAVACC_CHAR_TYPE EMPTY[] = { 0 }; JAVACC_SIMPLE_STRING addUnicodeEscapes(JAVACC_STRING_TYPE str); #ifndef MAX #define MAX(a,b) (a>=b?a:b) #endif #ifndef MAX #define MIN(a,b) (a<=b?a:b) #endif #endif /* JavaCC - OriginalChecksum=39ed6902668940c5163c04b346e709f4 (do not edit this line) */ Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/TokenMgrError.h0000644000175000017500000000527212315260742025411 0ustar jonasjonas/* Generated By:JavaCC: Do not edit this line. TokenMgrError.h Version 6.0 */ /* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ #ifndef _TOKENMGRERROR_H #define _TOKENMGRERROR_H #include "JavaCC.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { enum LexerErrors { /** * Lexical error occurred. */ LEXICAL_ERROR = 0, /** * An attempt was made to create a second instance of a token manager. */ STATIC_LEXER_ERROR = 1, /** * Tried to change to an invalid lexical state. */ INVALID_LEXICAL_STATE = 2, /** * Detected (and bailed out of) an infinite loop in the token manager. */ LOOP_DETECTED = 3, }; class TokenMgrError { public: /* * Ordinals for various reasons why an Error of this type can be thrown. */ /** * Indicates the reason why the exception is thrown. It will have * one of the above 4 values. */ int errorCode; /** * Returns a detailed message for the Error when it is thrown by the * token manager to indicate a lexical error. * Parameters : * EOFSeen : indicates if EOF caused the lexical error * curLexState : lexical state in which this error occurred * errorLine : line number when the error occurred * errorColumn : column number when the error occurred * errorAfter : prefix that was seen before this error occurred * curchar : the offending character * Note: You can customize the lexical error message by modifying this method. */ JAVACC_STRING_TYPE LexicalError(bool EOFSeen, int lexState, int errorLine, int errorColumn, JAVACC_STRING_TYPE errorAfter, JAVACC_CHAR_TYPE curChar); private: JAVACC_STRING_TYPE message; /** * You can also modify the body of this method to customize your error messages. * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not * of end-users concern, so you can return something like : * * "Internal Error : Please file a bug report .... " * * from this method for such cases in the release version of your parser. */ JAVACC_STRING_TYPE getMessage() ; /* * Constructors of various flavors follow. */ /** No arg constructor. */ public: TokenMgrError() ; /** Constructor with message and reason. */ public: TokenMgrError(JAVACC_STRING_TYPE message, int reason) ; /** Full Constructor. */ public: TokenMgrError(bool EOFSeen, int lexState, int errorLine, int errorColumn, JAVACC_STRING_TYPE errorAfter, JAVACC_CHAR_TYPE curChar, int reason) ; }; } } } #endif /* JavaCC - OriginalChecksum=65100ff7bfda78447381f7aed74fe139 (do not edit this line) */ Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/OWL2FunctionalStyleParser.h0000644000175000017500000001502212334732576027621 0ustar jonasjonas#ifndef OWL2FUNCTIONALSTYLEPARSER_H #define OWL2FUNCTIONALSTYLEPARSER_H #include "JavaCC.h" #include "CharStream.h" #include "Token.h" #include "TokenManager.h" #include "OWL2FunctionalStyleParserTokenManager.h" #include "CJAVACCParser.h" #include "OWL2FunctionalStyleParserConstants.h" #include "ErrorHandler.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { struct JJCalls { int gen; Token *first; int arg; JJCalls *next; ~JJCalls() { if (next) delete next; } JJCalls() { next = NULL; arg = 0; gen = -1; first = NULL; } }; class OWL2FunctionalStyleParser : public CJAVACCParser { public: QString languageTag(); QString nodeId(); QString fullIri(); QString iri(); QString abbreviatedIri(); QString prefixName(); void ontologyAnnotations(); void ontologyDocument(); void prefixDeclaration(); void ontology(); QString ontologyIri(); QString versionIri(); void directlyImportsDocuments(); void axioms(); CBuildExpressionPtr owlClass(); CBuildExpressionPtr datatype(); CBuildExpressionPtr objectProperty(); CBuildExpressionPtr dataProperty(); CBuildExpressionPtr annotationProperty(); CBuildExpressionPtr individual(); CBuildExpressionPtr namedIndividual(); CBuildExpressionPtr anonymousIndividual(); CBuildExpressionPtr literal(bool annotation); QString quotedQString(); CBuildExpressionPtr declaration(); CBuildExpressionPtr entity(); CBuildExpressionPtr objectPropertyExpression(); CBuildExpressionPtr inverseObjectProperty(); CBuildExpressionPtr dataPropertyExpression(); CBuildExpressionPtr dataRange(); CEXPRESSIONLIST dataRangeList(); CBuildExpressionPtr dataIntersectionOf(); CBuildExpressionPtr dataUnionOf(); CBuildExpressionPtr dataComplementOf(); CBuildExpressionPtr dataOneOf(); CBuildExpressionPtr datatypeRestriction(); CEXPRESSIONLIST facetRestrictionList(); CBuildExpressionPtr facetRestriction(); CBuildExpressionPtr classExpression(); CBuildExpressionPtr objectIntersectionOf(); CBuildExpressionPtr objectUnionOf(); CBuildExpressionPtr objectComplementOf(); CBuildExpressionPtr objectOneOf(); CBuildExpressionPtr objectSomeValuesFrom(); CBuildExpressionPtr objectAllValuesFrom(); CBuildExpressionPtr objectHasValue(); CBuildExpressionPtr objectHasSelf(); CBuildExpressionPtr objectMinCardinality(); CBuildExpressionPtr objectMaxCardinality(); CBuildExpressionPtr objectExactCardinality(); CBuildExpressionPtr dataSomeValuesFrom(); CBuildExpressionPtr dataAllValuesFrom(); CBuildExpressionPtr dataHasValue(); CBuildExpressionPtr dataMinCardinality(); CBuildExpressionPtr dataMaxCardinality(); CBuildExpressionPtr dataExactCardinality(); CBuildExpressionPtr axiom(); void axiomAnnotations(); CBuildExpressionPtr classAxiom(); CBuildExpressionPtr subClassOf(); CBuildExpressionPtr equivalentClasses(); CBuildExpressionPtr disjointClasses(); CBuildExpressionPtr disjointUnion(); CEXPRESSIONLIST classExpressionList(); CBuildExpressionPtr objectPropertyAxiom(); CBuildExpressionPtr subObjectPropertyOf(); CBuildExpressionPtr propertyExpressionChain(); CBuildExpressionPtr equivalentObjectProperties(); CBuildExpressionPtr disjointObjectProperties(); CEXPRESSIONLIST objectPropertyExpressionList(); CBuildExpressionPtr inverseObjectProperties(); CBuildExpressionPtr objectPropertyDomain(); CBuildExpressionPtr objectPropertyRange(); CBuildExpressionPtr functionalObjectProperty(); CBuildExpressionPtr inverseFunctionalObjectProperty(); CBuildExpressionPtr reflexiveObjectProperty(); CBuildExpressionPtr irreflexiveObjectProperty(); CBuildExpressionPtr symmetricObjectProperty(); CBuildExpressionPtr asymmetricObjectProperty(); CBuildExpressionPtr transitiveObjectProperty(); CBuildExpressionPtr dataPropertyAxiom(); CBuildExpressionPtr subDataPropertyOf(); CBuildExpressionPtr equivalentDataProperties(); CBuildExpressionPtr disjointDataProperties(); CEXPRESSIONLIST dataPropertyExpressionList(); CBuildExpressionPtr dataPropertyDomain(); CBuildExpressionPtr dataPropertyRange(); CBuildExpressionPtr functionalDataProperty(); CBuildExpressionPtr datatypeDefinition(); CBuildExpressionPtr hasKey(); CBuildExpressionPtr assertion(); CBuildExpressionPtr sameIndividual(); CBuildExpressionPtr differentIndividuals(); CEXPRESSIONLIST individualList(); CBuildExpressionPtr classAssertion(); CBuildExpressionPtr objectPropertyAssertion(); CBuildExpressionPtr negativeObjectPropertyAssertion(); CBuildExpressionPtr dataPropertyAssertion(); CBuildExpressionPtr negativeDataPropertyAssertion(); CBuildExpressionPtr annotation(); void annotationAnnotations(); CBuildExpressionPtr annotationValue(); CBuildExpressionPtr annotationAxiom(); CBuildExpressionPtr annotationAssertion(); CBuildExpressionPtr annotationSubject(); CBuildExpressionPtr subAnnotationPropertyOf(); CBuildExpressionPtr annotationPropertyDomain(); CBuildExpressionPtr annotationPropertyRange(); public: TokenManager *token_source; public: CharStream *jj_input_stream; /** Current token. */ public: Token *token; /** Next token. */ public: Token *jj_nt; private: int jj_ntk; private: JJCalls jj_2_rtns[1]; private: bool jj_rescan; private: int jj_gc; private: Token *jj_scanpos, *jj_lastpos; private: int jj_la; /** Whether we are looking ahead. */ private: bool jj_lookingAhead; private: bool jj_semLA; private: int jj_gen; private: int jj_la1[42]; private: ErrorHandler *errorHandler; private: bool errorHandlerCreated; protected: bool hasError; public: void setErrorHandler(ErrorHandler *eh) { if (errorHandlerCreated) delete errorHandler; errorHandler = eh; errorHandlerCreated = false; } Token *head; public: OWL2FunctionalStyleParser(TokenManager *tm); public: virtual ~OWL2FunctionalStyleParser(); void ReInit(TokenManager *tm); Token * jj_consume_token(int kind); Token * getNextToken(); Token * getToken(int index); int jj_ntk_f(); private: int jj_kind; int **jj_expentries; int *jj_expentry; /** Generate ParseException. */ protected: virtual void parseError(); private: int trace_indent; private: bool trace_enabled; /** Enable tracing. */ public: void enable_tracing(); public: void disable_tracing(); public: inline COntologyBuilder* getBuilder() { return mBuilder; } protected: COntologyBuilder* mBuilder;private: bool jj_done; }; } } } #endif Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/ParseException.cpp0000644000175000017500000001471312315260742026135 0ustar jonasjonas/* Generated By:JavaCC: Do not edit this line. ParseException.cc Version 6.0 */ /* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ #include "ParseException.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { /** * This exception is thrown when parse errors are encountered. * You can explicitly create objects of this exception type by * calling the method generate_ParseException in the generated * parser. * * You can modify this class to customize your error reporting * mechanisms so long as you retain the fields. */ /** * This constructor is used by the method "generate_ParseException" * in the generated parser. Calling this constructor generates * a new object of this type with the fields "currentToken", * "expectedTokenSequences", and "tokenImage" set. */ ParseException::ParseException(Token currentTokenVal, int** expectedTokenSequencesVal, JAVACC_STRING_TYPE* tokenImageVal ) { initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal); currentToken = currentTokenVal; expectedTokenSequences = expectedTokenSequencesVal; tokenImage = tokenImageVal; } /** * The following constructors are for use by you for whatever * purpose you can think of. Constructing the exception in this * manner makes the exception behave in the normal way - i.e., as * documented in the class "Throwable". The fields "errorToken", * "expectedTokenSequences", and "tokenImage" do not contain * relevant information. The JavaCC generated code does not use * these constructors. */ ParseException::ParseException() { } /** Constructor with message. */ ParseException::ParseException(JAVACC_STRING_TYPE message) { } /** * This is the last token that has been consumed successfully. If * this object has been created due to a parse error, the token * followng this token will (therefore) be the first error token. */ Token currentToken; /** * Each entry in this array is an array of integers. Each array * of integers represents a sequence of tokens (by their ordinal * values) that is expected at this point of the parse. */ int** expectedTokenSequences; /** * This is a reference to the "tokenImage" array of the generated * parser within which the parse error occurred. This array is * defined in the generated ...Constants class. */ JAVACC_STRING_TYPE* tokenImage; /** * It uses "currentToken" and "expectedTokenSequences" to generate a parse * error message and returns it. If this object has been created * due to a parse error, and you do not catch it (it gets thrown * from the parser) the correct error message * gets displayed. */ JAVACC_STRING_TYPE ParseException::initialise(Token currentToken, int** expectedTokenSequences, JAVACC_STRING_TYPE* tokenImage) { #if 0 //JAVACC_STRING_TYPE eol = System.getProperty("line.separator", "\n"); expected = new JAVACC_STRING_TYPE(); int maxSize = 0; for (int i = 0; i < expectedTokenSequences.length; i++) { if (maxSize < expectedTokenSequences[i].length) { maxSize = expectedTokenSequences[i].length; } for (int j = 0; j < expectedTokenSequences[i].length; j++) { expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' '); } if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) { expected.append((JAVACC_CHAR_TYPE*)"..."); } expected.append(eol).append(" "); } JAVACC_STRING_TYPE retval = (JAVACC_CHAR_TYPE*)"Encountered \""; Token tok = currentToken.next; for (int i = 0; i < maxSize; i++) { if (i != 0) retval += (JAVACC_CHAR_TYPE*)" "; if (tok.kind == 0) { retval += tokenImage[0]; break; } retval += (JAVACC_CHAR_TYPE*)" " + tokenImage[tok.kind]; retval += (JAVACC_CHAR_TYPE*)" \""; retval += add_escapes(tok.image); retval += (JAVACC_CHAR_TYPE*)" \""; tok = tok.next; } retval += (JAVACC_CHAR_TYPE*)"\" at line " + currentToken.next.beginLine + (JAVACC_CHAR_TYPE*)", column " + currentToken.next.beginColumn; retval += (JAVACC_CHAR_TYPE*)"." + eol; if (expectedTokenSequences.length == 1) { retval += (JAVACC_CHAR_TYPE*)"Was expecting:" + eol + (JAVACC_CHAR_TYPE*)" "; } else { retval += (JAVACC_CHAR_TYPE*)"Was expecting one of:" + eol + (JAVACC_CHAR_TYPE*)" "; } retval += expected.toString(); return retval; #endif return (JAVACC_CHAR_TYPE*)"Parse exception"; } /** * The end of line JAVACC_STRING_TYPE for this machine. */ #define eol "\n" /** * Used to convert raw characters to their escaped version * when these raw version cannot be used as part of an ASCII * string literal. */ JAVACC_STRING_TYPE ParseException::add_escapes(JAVACC_STRING_TYPE str) { /* JAVACC_STRING_TYPE *retval = new JAVACC_STRING_TYPE(); JAVACC_CHAR_TYPE ch; for (int i = 0; i < str.length(); i++) { switch (str.charAt(i)) { case 0 : continue; case '\b': retval.append("\\b"); continue; case '\t': retval.append("\\t"); continue; case '\n': retval.append("\\n"); continue; case '\f': retval.append("\\f"); continue; case '\r': retval.append("\\r"); continue; case '\"': retval.append("\\\""); continue; case '\'': retval.append("\\\'"); continue; case '\\': retval.append("\\\\"); continue; default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { JAVACC_STRING_TYPE s = "0000" + Integer.toString(ch, 16); retval.append("\\u" + s.substring(s.length() - 4, s.length())); } else { retval.append(ch); } continue; } } return retval.toString(); */ return str; } } } } /* JavaCC - OriginalChecksum=c2708e5cd23969135595565754679579 (do not edit this line) */ Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/CTokenManager.cpp0000644000175000017500000000203212520550734025652 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CTokenManager.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { CTokenManager::CTokenManager() { } }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/OWL2FunctionalStyleParserConstants.h0000644000175000017500000006037012334732576031524 0ustar jonasjonas/* Generated By: http&JavaCC: Do not edit this line. OWL2FunctionalStyleParserConstants.java */ /** * Token literal values and constants. * Generated by org.javacc.parser.OtherFilesGen#start() */ #ifndef OWL2FUNCTIONALSTYLEPARSERCONSTANTS_H #define OWL2FUNCTIONALSTYLEPARSERCONSTANTS_H namespace Konclude { namespace Parser { namespace FunctionalJAVACC { /** End of File. */ const int _EOF = 0; /** RegularExpression Id. */ const int OPEN_BRACKET = 5; /** RegularExpression Id. */ const int CLOSE_BRACKET = 6; /** RegularExpression Id. */ const int EQUALS = 7; /** RegularExpression Id. */ const int REFERENCE = 8; /** RegularExpression Id. */ const int PREFIX = 9; /** RegularExpression Id. */ const int ONTOLOGY = 10; /** RegularExpression Id. */ const int IMPORT = 11; /** RegularExpression Id. */ const int CLASS = 12; /** RegularExpression Id. */ const int DATATYPE = 13; /** RegularExpression Id. */ const int OBJECT_PROPERTY = 14; /** RegularExpression Id. */ const int DATA_PROPERTY = 15; /** RegularExpression Id. */ const int ANNOTATION_PROPERTY = 16; /** RegularExpression Id. */ const int NAMED_INDIVIDUAL = 17; /** RegularExpression Id. */ const int DECLARATION = 18; /** RegularExpression Id. */ const int OBJECT_INVERSE_OF = 19; /** RegularExpression Id. */ const int OBJECT_PROPERTY_CHAIN = 20; /** RegularExpression Id. */ const int COMPLEMENT_OF = 21; /** RegularExpression Id. */ const int ONE_OF = 22; /** RegularExpression Id. */ const int DATATYPE_RESTRICTION = 23; /** RegularExpression Id. */ const int OBJECT_INTERSECTION_OF = 24; /** RegularExpression Id. */ const int OBJECT_UNION_OF = 25; /** RegularExpression Id. */ const int OBJECT_COMPLEMENT_OF = 26; /** RegularExpression Id. */ const int OBJECT_ONE_OF = 27; /** RegularExpression Id. */ const int OBJECT_SOME_VALUES_FROM = 28; /** RegularExpression Id. */ const int OBJECT_ALL_VALUES_FROM = 29; /** RegularExpression Id. */ const int OBJECT_HAS_VALUE = 30; /** RegularExpression Id. */ const int OBJECT_HAS_SELF = 31; /** RegularExpression Id. */ const int OBJECT_MIN_CARDINALITY = 32; /** RegularExpression Id. */ const int OBJECT_MAX_CARDINALITY = 33; /** RegularExpression Id. */ const int OBJECT_EXACT_CARDINALITY = 34; /** RegularExpression Id. */ const int DATA_INTERSECTION_OF = 35; /** RegularExpression Id. */ const int DATA_UNION_OF = 36; /** RegularExpression Id. */ const int DATA_COMPLEMENT_OF = 37; /** RegularExpression Id. */ const int DATA_ONE_OF = 38; /** RegularExpression Id. */ const int DATA_SOME_VALUES_FROM = 39; /** RegularExpression Id. */ const int DATA_ALL_VALUES_FROM = 40; /** RegularExpression Id. */ const int DATA_HAS_VALUE = 41; /** RegularExpression Id. */ const int DATA_MIN_CARDINALITY = 42; /** RegularExpression Id. */ const int DATA_MAX_CARDINALITY = 43; /** RegularExpression Id. */ const int DATA_EXACT_CARDINALITY = 44; /** RegularExpression Id. */ const int SUB_CLASS_OF = 45; /** RegularExpression Id. */ const int EQUIVALENT_CLASSES = 46; /** RegularExpression Id. */ const int DISJOINT_CLASSES = 47; /** RegularExpression Id. */ const int DISJOINT_UNION = 48; /** RegularExpression Id. */ const int SUB_OBJECT_PROPERTY_OF = 49; /** RegularExpression Id. */ const int EQUIVALENT_OBJECT_PROPERTIES = 50; /** RegularExpression Id. */ const int DISJOINT_OBJECT_PROPERTIES = 51; /** RegularExpression Id. */ const int OBJECT_PROPERTY_DOMAIN = 52; /** RegularExpression Id. */ const int OBJECT_PROPERTY_RANGE = 53; /** RegularExpression Id. */ const int INVERSE_OBJECT_PROPERTIES = 54; /** RegularExpression Id. */ const int FUNCTIONAL_OBJECT_PROPERTY = 55; /** RegularExpression Id. */ const int INVERSE_FUNCTIONAL_OBJECT_PROPERTY = 56; /** RegularExpression Id. */ const int REFLEXIVE_OBJECT_PROPERTY = 57; /** RegularExpression Id. */ const int IRREFLEXIVE_OBJECT_PROPERTY = 58; /** RegularExpression Id. */ const int SYMMETRIC_OBJECT_PROPERTY = 59; /** RegularExpression Id. */ const int ASYMMETRIC_OBJECT_PROPERTY = 60; /** RegularExpression Id. */ const int TRANSITIVE_OBJECT_PROPERTY = 61; /** RegularExpression Id. */ const int SUB_DATA_PROPERTY_OF = 62; /** RegularExpression Id. */ const int EQUIVALENT_DATA_PROPERTIES = 63; /** RegularExpression Id. */ const int DISJOINT_DATA_PROPERTIES = 64; /** RegularExpression Id. */ const int DATA_PROPERTY_DOMAIN = 65; /** RegularExpression Id. */ const int DATA_PROPERTY_RANGE = 66; /** RegularExpression Id. */ const int FUNCTIONAL_DATA_PROPERTY = 67; /** RegularExpression Id. */ const int DATATYPE_DEFINITION = 68; /** RegularExpression Id. */ const int HAS_KEY = 69; /** RegularExpression Id. */ const int SAME_INDIVIDUAL = 70; /** RegularExpression Id. */ const int DIFFERENT_INDIVIDUALS = 71; /** RegularExpression Id. */ const int CLASS_ASSERTION = 72; /** RegularExpression Id. */ const int OBJECT_PROPERTY_ASSERTION = 73; /** RegularExpression Id. */ const int NEGATIVE_OBJECT_PROPERTY_ASSERTION = 74; /** RegularExpression Id. */ const int DATA_PROPERTY_ASSERTION = 75; /** RegularExpression Id. */ const int NEGATIVE_DATA_PROPERTY_ASSERTION = 76; /** RegularExpression Id. */ const int ANNOTATION = 77; /** RegularExpression Id. */ const int ANNOTATION_ASSERTION = 78; /** RegularExpression Id. */ const int SUB_ANNOTATION_PROPERTY_OF = 79; /** RegularExpression Id. */ const int ANNOTATION_PROPERTY_DOMAIN = 80; /** RegularExpression Id. */ const int ANNOTATION_PROPERTY_RANGE = 81; /** RegularExpression Id. */ const int NON_NEGATIVE_INTEGER = 82; /** RegularExpression Id. */ const int LANGTAG = 83; /** RegularExpression Id. */ const int PNAME_NS = 84; /** RegularExpression Id. */ const int PN_PREFIX = 85; /** RegularExpression Id. */ const int BLANK_NODE_PREFIX = 86; /** RegularExpression Id. */ const int DIGIT = 87; /** RegularExpression Id. */ const int PN_CHARS_U = 88; /** RegularExpression Id. */ const int PN_CHARS = 89; /** RegularExpression Id. */ const int PN_CHARS_BASE = 90; /** RegularExpression Id. */ const int FULL_IRI = 94; /** RegularExpression Id. */ const int PN_LOCAL = 96; /** RegularExpression Id. */ const int QUOTED_QString = 98; /** Lexical state. */ const int DEFAULT = 0; /** Lexical state. */ const int FullIri = 1; /** Lexical state. */ const int FullIriEnd = 2; /** Lexical state. */ const int AfterPrefix = 3; /** Lexical state. */ const int QuotedQString = 4; /** Lexical state. */ const int QuotedQStringEnd = 5; /** Lexical state. */ const int Comment = 6; /** Literal token values. */ static JAVACC_CHAR_TYPE tokenImage_arr_0[] = {0x3c, 0x45, 0x4f, 0x46, 0x3e, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_1[] = {0x22, 0x20, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_2[] = {0x22, 0x9, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_3[] = {0x22, 0xa, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_4[] = {0x22, 0xd, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_5[] = {0x22, 0x28, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_6[] = {0x22, 0x29, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_7[] = {0x22, 0x3d, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_8[] = {0x22, 0x5e, 0x5e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_9[] = {0x22, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_10[] = {0x22, 0x4f, 0x6e, 0x74, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_11[] = {0x22, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_12[] = {0x22, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_13[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x74, 0x79, 0x70, 0x65, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_14[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_15[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_16[] = {0x22, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_17[] = {0x22, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_18[] = {0x22, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_19[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_20[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_21[] = {0x22, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_22[] = {0x22, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_23[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x74, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_24[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_25[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_26[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_27[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_28[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x6f, 0x6d, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_29[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_30[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_31[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x53, 0x65, 0x6c, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_32[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x69, 0x6e, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_33[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x78, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_34[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x78, 0x61, 0x63, 0x74, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_35[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_36[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_37[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_38[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_39[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x6d, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_40[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x41, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_41[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x48, 0x61, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_42[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x6e, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_43[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x61, 0x78, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_44[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x45, 0x78, 0x61, 0x63, 0x74, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_45[] = {0x22, 0x53, 0x75, 0x62, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_46[] = {0x22, 0x45, 0x71, 0x75, 0x69, 0x76, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_47[] = {0x22, 0x44, 0x69, 0x73, 0x6a, 0x6f, 0x69, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_48[] = {0x22, 0x44, 0x69, 0x73, 0x6a, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_49[] = {0x22, 0x53, 0x75, 0x62, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_50[] = {0x22, 0x45, 0x71, 0x75, 0x69, 0x76, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_51[] = {0x22, 0x44, 0x69, 0x73, 0x6a, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_52[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_53[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_54[] = {0x22, 0x49, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_55[] = {0x22, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_56[] = {0x22, 0x49, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_57[] = {0x22, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x78, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_58[] = {0x22, 0x49, 0x72, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x78, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_59[] = {0x22, 0x53, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_60[] = {0x22, 0x41, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_61[] = {0x22, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_62[] = {0x22, 0x53, 0x75, 0x62, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_63[] = {0x22, 0x45, 0x71, 0x75, 0x69, 0x76, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_64[] = {0x22, 0x44, 0x69, 0x73, 0x6a, 0x6f, 0x69, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_65[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_66[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_67[] = {0x22, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_68[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x74, 0x79, 0x70, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_69[] = {0x22, 0x48, 0x61, 0x73, 0x4b, 0x65, 0x79, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_70[] = {0x22, 0x53, 0x61, 0x6d, 0x65, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_71[] = {0x22, 0x44, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x73, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_72[] = {0x22, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_73[] = {0x22, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_74[] = {0x22, 0x4e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_75[] = {0x22, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_76[] = {0x22, 0x4e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_77[] = {0x22, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_78[] = {0x22, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_79[] = {0x22, 0x53, 0x75, 0x62, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4f, 0x66, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_80[] = {0x22, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_81[] = {0x22, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_82[] = {0x22, 0x3c, 0x4e, 0x4f, 0x4e, 0x5f, 0x4e, 0x45, 0x47, 0x41, 0x54, 0x49, 0x56, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x47, 0x45, 0x52, 0x3e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_83[] = {0x22, 0x3c, 0x4c, 0x41, 0x4e, 0x47, 0x54, 0x41, 0x47, 0x3e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_84[] = {0x22, 0x3c, 0x50, 0x4e, 0x41, 0x4d, 0x45, 0x5f, 0x4e, 0x53, 0x3e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_85[] = {0x22, 0x3c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x3e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_86[] = {0x22, 0x5f, 0x3a, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_87[] = {0x22, 0x3c, 0x44, 0x49, 0x47, 0x49, 0x54, 0x3e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_88[] = {0x22, 0x3c, 0x50, 0x4e, 0x5f, 0x43, 0x48, 0x41, 0x52, 0x53, 0x5f, 0x55, 0x3e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_89[] = {0x22, 0x3c, 0x50, 0x4e, 0x5f, 0x43, 0x48, 0x41, 0x52, 0x53, 0x3e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_90[] = {0x22, 0x3c, 0x50, 0x4e, 0x5f, 0x43, 0x48, 0x41, 0x52, 0x53, 0x5f, 0x42, 0x41, 0x53, 0x45, 0x3e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_91[] = {0x22, 0x3c, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_92[] = {0x22, 0x22, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_93[] = {0x22, 0x23, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_94[] = {0x22, 0x3c, 0x46, 0x55, 0x4c, 0x4c, 0x5f, 0x49, 0x52, 0x49, 0x3e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_95[] = {0x22, 0x3e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_96[] = {0x22, 0x3c, 0x50, 0x4e, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x3e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_97[] = {0x22, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_98[] = {0x22, 0x3c, 0x51, 0x55, 0x4f, 0x54, 0x45, 0x44, 0x5f, 0x51, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_99[] = {0x22, 0x22, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_100[] = {0x22, 0xa, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_101[] = {0x22, 0xd, 0x22, 0}; static JAVACC_CHAR_TYPE tokenImage_arr_102[] = {0x22, 0x3c, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x20, 0x31, 0x30, 0x32, 0x3e, 0x22, 0}; static JAVACC_STRING_TYPE tokenImage[] = { tokenImage_arr_0, tokenImage_arr_1, tokenImage_arr_2, tokenImage_arr_3, tokenImage_arr_4, tokenImage_arr_5, tokenImage_arr_6, tokenImage_arr_7, tokenImage_arr_8, tokenImage_arr_9, tokenImage_arr_10, tokenImage_arr_11, tokenImage_arr_12, tokenImage_arr_13, tokenImage_arr_14, tokenImage_arr_15, tokenImage_arr_16, tokenImage_arr_17, tokenImage_arr_18, tokenImage_arr_19, tokenImage_arr_20, tokenImage_arr_21, tokenImage_arr_22, tokenImage_arr_23, tokenImage_arr_24, tokenImage_arr_25, tokenImage_arr_26, tokenImage_arr_27, tokenImage_arr_28, tokenImage_arr_29, tokenImage_arr_30, tokenImage_arr_31, tokenImage_arr_32, tokenImage_arr_33, tokenImage_arr_34, tokenImage_arr_35, tokenImage_arr_36, tokenImage_arr_37, tokenImage_arr_38, tokenImage_arr_39, tokenImage_arr_40, tokenImage_arr_41, tokenImage_arr_42, tokenImage_arr_43, tokenImage_arr_44, tokenImage_arr_45, tokenImage_arr_46, tokenImage_arr_47, tokenImage_arr_48, tokenImage_arr_49, tokenImage_arr_50, tokenImage_arr_51, tokenImage_arr_52, tokenImage_arr_53, tokenImage_arr_54, tokenImage_arr_55, tokenImage_arr_56, tokenImage_arr_57, tokenImage_arr_58, tokenImage_arr_59, tokenImage_arr_60, tokenImage_arr_61, tokenImage_arr_62, tokenImage_arr_63, tokenImage_arr_64, tokenImage_arr_65, tokenImage_arr_66, tokenImage_arr_67, tokenImage_arr_68, tokenImage_arr_69, tokenImage_arr_70, tokenImage_arr_71, tokenImage_arr_72, tokenImage_arr_73, tokenImage_arr_74, tokenImage_arr_75, tokenImage_arr_76, tokenImage_arr_77, tokenImage_arr_78, tokenImage_arr_79, tokenImage_arr_80, tokenImage_arr_81, tokenImage_arr_82, tokenImage_arr_83, tokenImage_arr_84, tokenImage_arr_85, tokenImage_arr_86, tokenImage_arr_87, tokenImage_arr_88, tokenImage_arr_89, tokenImage_arr_90, tokenImage_arr_91, tokenImage_arr_92, tokenImage_arr_93, tokenImage_arr_94, tokenImage_arr_95, tokenImage_arr_96, tokenImage_arr_97, tokenImage_arr_98, tokenImage_arr_99, tokenImage_arr_100, tokenImage_arr_101, tokenImage_arr_102, }; } } } #endif ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/COWL2FunctionalJAVACCOntologyStreamParser.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/COWL2FunctionalJAVACCOntologyStreamPar0000644000175000017500000000556712520550734031526 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWL2FunctionalJAVACCOntologyStreamParser.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { COWL2FunctionalJAVACCOntologyStreamParser::COWL2FunctionalJAVACCOntologyStreamParser(COntologyBuilder* ontologyBuilder) : mOntologyBuilder(ontologyBuilder) { mError = false; mParsingError = false; } bool COWL2FunctionalJAVACCOntologyStreamParser::parseOntology(const QString& fileString) { QFile file(fileString); mError = false; if (file.open(QIODevice::ReadOnly)) { mError = !parseOntology(&file); file.close(); } else { mError = true; mErrorString = QString("File '%1' does not exist or cannot be opened.").arg(fileString); } return !mError; } bool COWL2FunctionalJAVACCOntologyStreamParser::parseOntology(QIODevice* ioDevice) { mStreamReader = new CQtIODeviceStreamReader(ioDevice); mCharStream = new CharStream(mStreamReader); mTokenManager = new COWL2FunctionalStyleParserTokenManager(mCharStream); mErrorHandler = new COWL2FunctionalStyleParserErrorHandler(); mParser = new CConcreteOWL2FunctionalStyleParser(mOntologyBuilder,mTokenManager); mParser->setErrorHandler(mErrorHandler); mParser->ontologyDocument(); mError = mParsingError = mErrorHandler->hasError(); mErrorString = mParsingErrorString = mErrorHandler->getErrorString(); if (!mError && mTokenManager->hasLexicalError()) { mError = mParsingError = true; mErrorString = mParsingErrorString = QString("Lexical error encountered"); } delete mParser; return !mParsingError; } QString COWL2FunctionalJAVACCOntologyStreamParser::getParsingErrorString() { return mParsingErrorString; } bool COWL2FunctionalJAVACCOntologyStreamParser::hasParsingError() { return mParsingError; } QString COWL2FunctionalJAVACCOntologyStreamParser::getErrorString() { return mErrorString; } bool COWL2FunctionalJAVACCOntologyStreamParser::hasError() { return mError; } }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/Token.h0000644000175000017500000000743612315260742023735 0ustar jonasjonas/* Generated By:JavaCC: Do not edit this line. Token.h Version 6.0 */ /* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,TOKEN_INCLUDES=CTokenBase.h,TOKEN_EXTENDS=CTokenBase */ #ifndef TOKEN_H #define TOKEN_H #include "JavaCC.h" #include "CTokenBase.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { /** * Describes the input token stream. */ class Token : public CTokenBase { public: /** * An integer that describes the kind of this token. This numbering * system is determined by JavaCCParser, and a table of these numbers is * stored in the file ...Constants.java. */ int kind; /** The line number of the first character of this Token. */ int beginLine; /** The column number of the first character of this Token. */ int beginColumn; /** The line number of the last character of this Token. */ int endLine; /** The column number of the last character of this Token. */ int endColumn; /** * The string image of the token. */ JAVACC_STRING_TYPE image; /** * A reference to the next regular (non-special) token from the input * stream. If this is the last token from the input stream, or if the * token manager has not read tokens beyond this one, this field is * set to NULL. This is true only if this token is also a regular * token. Otherwise, see below for a description of the contents of * this field. */ Token *next; /** * This field is used to access special tokens that occur prior to this * token, but after the immediately preceding regular (non-special) token. * If there are no such special tokens, this field is set to NULL. * When there are more than one such special token, this field refers * to the last of these special tokens, which in turn refers to the next * previous special token through its specialToken field, and so on * until the first special token (whose specialToke_ field is NULL). * The next fields of special tokens refer to other special tokens that * immediately follow it (without an intervening regular token). If there * is no such token, this field is NULL. */ Token *specialToken; /** * An optional attribute value of the Token. * Tokens which are not used as syntactic sugar will often contain * meaningful values that will be used later on by the compiler or * interpreter. This attribute value is often different from the image. * Any subclass of Token that actually wants to return a non-NULL value can * override this method as appropriate. */ void * getValue(); /** * No-argument constructor */ Token(); /** * Constructs a new token for the specified Image. */ Token(int kind); /** * Constructs a new token for the specified Image and Kind. */ Token(int kind, JAVACC_STRING_TYPE image); /** * Returns the image. */ JAVACC_STRING_TYPE toString(); public: virtual ~Token(); /** * Returns a new Token void *, by default. However, if you want, you * can create and return subclass objects based on the value of ofKind. * Simply add the cases to the switch for all those special cases. * For example, if you have a subclass of Token called IDToken that * you want to create if ofKind is ID, simply add something like : * * case MyParserConstants.ID : return new IDToken(ofKind, image); * * to the following switch statement. Then you can cast matchedToken * variable to the appropriate type and use sit in your lexical actions. */ static Token *newToken(int ofKind, JAVACC_STRING_TYPE image); static Token *newToken(int ofKind); }; } } } #endif /* JavaCC - OriginalChecksum=ea420077e2e0b2920ccc7e2bc5dd31de (do not edit this line) */ ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/COWL2FunctionalStyleParserTokenManager.hKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/COWL2FunctionalStyleParserTokenManager0000644000175000017500000000416212520550734031764 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_FUNCTIONALJAVACC_COWL2FUNCTIONALSTYLEPARSERTOKENMANAGER_H #define KONCLUDE_PARSER_FUNCTIONALJAVACC_COWL2FUNCTIONALSTYLEPARSERTOKENMANAGER_H // Libraries includes #include // Namespace includes #include "FunctionalJAVACCSettings.h" #include "OWL2FunctionalStyleParserTokenManager.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { using namespace Expression; namespace FunctionalJAVACC { /*! * * \class COWL2FunctionalStyleParserTokenManager * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWL2FunctionalStyleParserTokenManager : public OWL2FunctionalStyleParserTokenManager { // public methods public: //! Constructor COWL2FunctionalStyleParserTokenManager(JAVACC_CHARSTREAM *stream); virtual void lexicalError(); bool hasLexicalError(); // protected methods protected: // protected variables protected: bool mLexicalError; // private methods private: // private variables private: }; }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_FUNCTIONALJAVACC_COWL2FUNCTIONALSTYLEPARSERTOKENMANAGER_H ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/OWL2FunctionalStyleParserTokenManager.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/OWL2FunctionalStyleParserTokenManager.0000644000175000017500000033343412334752446031755 0ustar jonasjonas/* OWL2FunctionalStyleParserTokenManager.cc */ #include "OWL2FunctionalStyleParserTokenManager.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { static const unsigned long long jjbitVec0[] = { 0xfffe7000fffffff6ULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0x5e00000000ffffffULL }; static const unsigned long long jjbitVec2[] = { 0x0ULL, 0x0ULL, 0x0ULL, 0xff7fffffff7fffffULL }; static const unsigned long long jjbitVec3[] = { 0x0ULL, 0xbfff000000000000ULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL }; static const unsigned long long jjbitVec4[] = { 0x3000ULL, 0xffff000000000000ULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL }; static const unsigned long long jjbitVec5[] = { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffULL, 0x0ULL }; static const unsigned long long jjbitVec6[] = { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffULL }; static const unsigned long long jjbitVec7[] = { 0xfffffffffffffffeULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL }; static const unsigned long long jjbitVec8[] = { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffff00000000ffffULL }; static const unsigned long long jjbitVec9[] = { 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL, 0x3fffffffffffffffULL }; static const unsigned long long jjbitVec10[] = { 0x0ULL, 0x0ULL, 0x80000000000000ULL, 0xff7fffffff7fffffULL }; static const unsigned long long jjbitVec11[] = { 0xffffffffffffffffULL, 0xbfffffffffffffffULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL }; static const unsigned long long jjbitVec12[] = { 0x8000000000003000ULL, 0xffff000000000001ULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL }; static const unsigned long long jjbitVec13[] = { 0x0ULL, 0x0ULL, 0xffffffffffffffffULL, 0xffffffffffffffffULL }; static const int jjnextStates[] = { 6, 7, 8, }; static JAVACC_CHAR_TYPE jjstrLiteralChars_0[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_1[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_2[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_3[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_4[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_5[] = {0x28, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_6[] = {0x29, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_7[] = {0x3d, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_8[] = {0x5e, 0x5e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_9[] = {0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_10[] = {0x4f, 0x6e, 0x74, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_11[] = {0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_12[] = {0x43, 0x6c, 0x61, 0x73, 0x73, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_13[] = {0x44, 0x61, 0x74, 0x61, 0x74, 0x79, 0x70, 0x65, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_14[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_15[] = {0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_16[] = {0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_17[] = {0x4e, 0x61, 0x6d, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_18[] = {0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_19[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_20[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_21[] = {0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_22[] = {0x4f, 0x6e, 0x65, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_23[] = {0x44, 0x61, 0x74, 0x61, 0x74, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_24[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_25[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_26[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_27[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_28[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x6f, 0x6d, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_29[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_30[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_31[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x61, 0x73, 0x53, 0x65, 0x6c, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_32[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x69, 0x6e, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_33[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x61, 0x78, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_34[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x78, 0x61, 0x63, 0x74, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_35[] = {0x44, 0x61, 0x74, 0x61, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_36[] = {0x44, 0x61, 0x74, 0x61, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_37[] = {0x44, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_38[] = {0x44, 0x61, 0x74, 0x61, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_39[] = {0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x6d, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_40[] = {0x44, 0x61, 0x74, 0x61, 0x41, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_41[] = {0x44, 0x61, 0x74, 0x61, 0x48, 0x61, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_42[] = {0x44, 0x61, 0x74, 0x61, 0x4d, 0x69, 0x6e, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_43[] = {0x44, 0x61, 0x74, 0x61, 0x4d, 0x61, 0x78, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_44[] = {0x44, 0x61, 0x74, 0x61, 0x45, 0x78, 0x61, 0x63, 0x74, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_45[] = {0x53, 0x75, 0x62, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_46[] = {0x45, 0x71, 0x75, 0x69, 0x76, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_47[] = {0x44, 0x69, 0x73, 0x6a, 0x6f, 0x69, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_48[] = {0x44, 0x69, 0x73, 0x6a, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_49[] = {0x53, 0x75, 0x62, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_50[] = {0x45, 0x71, 0x75, 0x69, 0x76, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_51[] = {0x44, 0x69, 0x73, 0x6a, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_52[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_53[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_54[] = {0x49, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_55[] = {0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_56[] = {0x49, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_57[] = {0x52, 0x65, 0x66, 0x6c, 0x65, 0x78, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_58[] = {0x49, 0x72, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x78, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_59[] = {0x53, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_60[] = {0x41, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_61[] = {0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_62[] = {0x53, 0x75, 0x62, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_63[] = {0x45, 0x71, 0x75, 0x69, 0x76, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_64[] = {0x44, 0x69, 0x73, 0x6a, 0x6f, 0x69, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_65[] = {0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_66[] = {0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_67[] = {0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_68[] = {0x44, 0x61, 0x74, 0x61, 0x74, 0x79, 0x70, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_69[] = {0x48, 0x61, 0x73, 0x4b, 0x65, 0x79, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_70[] = {0x53, 0x61, 0x6d, 0x65, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_71[] = {0x44, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x73, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_72[] = {0x43, 0x6c, 0x61, 0x73, 0x73, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_73[] = {0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_74[] = {0x4e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_75[] = {0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_76[] = {0x4e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_77[] = {0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_78[] = {0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_79[] = {0x53, 0x75, 0x62, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4f, 0x66, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_80[] = {0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_81[] = {0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_82[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_83[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_84[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_85[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_86[] = {0x5f, 0x3a, 0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_87[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_88[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_89[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_90[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_91[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_92[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_93[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_94[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_95[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_96[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_97[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_98[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_99[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_100[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_101[] = {0}; static JAVACC_CHAR_TYPE jjstrLiteralChars_102[] = {0}; static const JAVACC_STRING_TYPE jjstrLiteralImages[] = { jjstrLiteralChars_0, jjstrLiteralChars_1, jjstrLiteralChars_2, jjstrLiteralChars_3, jjstrLiteralChars_4, jjstrLiteralChars_5, jjstrLiteralChars_6, jjstrLiteralChars_7, jjstrLiteralChars_8, jjstrLiteralChars_9, jjstrLiteralChars_10, jjstrLiteralChars_11, jjstrLiteralChars_12, jjstrLiteralChars_13, jjstrLiteralChars_14, jjstrLiteralChars_15, jjstrLiteralChars_16, jjstrLiteralChars_17, jjstrLiteralChars_18, jjstrLiteralChars_19, jjstrLiteralChars_20, jjstrLiteralChars_21, jjstrLiteralChars_22, jjstrLiteralChars_23, jjstrLiteralChars_24, jjstrLiteralChars_25, jjstrLiteralChars_26, jjstrLiteralChars_27, jjstrLiteralChars_28, jjstrLiteralChars_29, jjstrLiteralChars_30, jjstrLiteralChars_31, jjstrLiteralChars_32, jjstrLiteralChars_33, jjstrLiteralChars_34, jjstrLiteralChars_35, jjstrLiteralChars_36, jjstrLiteralChars_37, jjstrLiteralChars_38, jjstrLiteralChars_39, jjstrLiteralChars_40, jjstrLiteralChars_41, jjstrLiteralChars_42, jjstrLiteralChars_43, jjstrLiteralChars_44, jjstrLiteralChars_45, jjstrLiteralChars_46, jjstrLiteralChars_47, jjstrLiteralChars_48, jjstrLiteralChars_49, jjstrLiteralChars_50, jjstrLiteralChars_51, jjstrLiteralChars_52, jjstrLiteralChars_53, jjstrLiteralChars_54, jjstrLiteralChars_55, jjstrLiteralChars_56, jjstrLiteralChars_57, jjstrLiteralChars_58, jjstrLiteralChars_59, jjstrLiteralChars_60, jjstrLiteralChars_61, jjstrLiteralChars_62, jjstrLiteralChars_63, jjstrLiteralChars_64, jjstrLiteralChars_65, jjstrLiteralChars_66, jjstrLiteralChars_67, jjstrLiteralChars_68, jjstrLiteralChars_69, jjstrLiteralChars_70, jjstrLiteralChars_71, jjstrLiteralChars_72, jjstrLiteralChars_73, jjstrLiteralChars_74, jjstrLiteralChars_75, jjstrLiteralChars_76, jjstrLiteralChars_77, jjstrLiteralChars_78, jjstrLiteralChars_79, jjstrLiteralChars_80, jjstrLiteralChars_81, jjstrLiteralChars_82, jjstrLiteralChars_83, jjstrLiteralChars_84, jjstrLiteralChars_85, jjstrLiteralChars_86, jjstrLiteralChars_87, jjstrLiteralChars_88, jjstrLiteralChars_89, jjstrLiteralChars_90, jjstrLiteralChars_91, jjstrLiteralChars_92, jjstrLiteralChars_93, jjstrLiteralChars_94, jjstrLiteralChars_95, jjstrLiteralChars_96, jjstrLiteralChars_97, jjstrLiteralChars_98, jjstrLiteralChars_99, jjstrLiteralChars_100, jjstrLiteralChars_101, jjstrLiteralChars_102, }; /** Lexer state names. */ static const JAVACC_CHAR_TYPE lexStateNames_arr_0[] = {0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0}; static const JAVACC_CHAR_TYPE lexStateNames_arr_1[] = {0x46, 0x75, 0x6c, 0x6c, 0x49, 0x72, 0x69, 0}; static const JAVACC_CHAR_TYPE lexStateNames_arr_2[] = {0x46, 0x75, 0x6c, 0x6c, 0x49, 0x72, 0x69, 0x45, 0x6e, 0x64, 0}; static const JAVACC_CHAR_TYPE lexStateNames_arr_3[] = {0x41, 0x66, 0x74, 0x65, 0x72, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0}; static const JAVACC_CHAR_TYPE lexStateNames_arr_4[] = {0x51, 0x75, 0x6f, 0x74, 0x65, 0x64, 0x51, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0}; static const JAVACC_CHAR_TYPE lexStateNames_arr_5[] = {0x51, 0x75, 0x6f, 0x74, 0x65, 0x64, 0x51, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x64, 0}; static const JAVACC_CHAR_TYPE lexStateNames_arr_6[] = {0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0}; static const JAVACC_STRING_TYPE lexStateNames[] = { lexStateNames_arr_0, lexStateNames_arr_1, lexStateNames_arr_2, lexStateNames_arr_3, lexStateNames_arr_4, lexStateNames_arr_5, lexStateNames_arr_6, }; /** Lex State array. */ static const int jjnewLexState[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, 3, -1, -1, -1, -1, 1, 4, 6, 2, 0, 0, 0, 5, 0, 0, 0, -1, }; static const unsigned long long jjtoToken[] = { 0xffffffffffffffe1ULL, 0x5405fffffULL, }; static const unsigned long long jjtoSkip[] = { 0x1eULL, 0x7ab8000000ULL, }; void OWL2FunctionalStyleParserTokenManager::setDebugStream(FILE *ds){ debugStream = ds; } int OWL2FunctionalStyleParserTokenManager::jjStopStringLiteralDfa_0(int pos, unsigned long long active0, unsigned long long active1){ switch (pos) { case 0: if ((active0 & 0xfffffffffffffe00ULL) != 0L || (active1 & 0x3ffffULL) != 0L) return 9; return -1; case 1: if ((active0 & 0xfffffffffffffe00ULL) != 0L || (active1 & 0x3ffffULL) != 0L) return 9; return -1; case 2: if ((active0 & 0xfffffffffffffe00ULL) != 0L || (active1 & 0x3ffffULL) != 0L) return 9; return -1; case 3: if ((active0 & 0xfffffffffffffe00ULL) != 0L || (active1 & 0x3ffffULL) != 0L) return 9; return -1; case 4: if ((active0 & 0xfffffffffffffe00ULL) != 0L || (active1 & 0x3ffffULL) != 0L) return 9; return -1; case 5: if ((active0 & 0xffffffffffbfee00ULL) != 0L || (active1 & 0x3ffffULL) != 0L) return 9; return -1; case 6: if ((active0 & 0xffffffffffbfe400ULL) != 0L || (active1 & 0x3ffdfULL) != 0L) return 9; return -1; case 7: if ((active0 & 0xffffffffffbfe400ULL) != 0L || (active1 & 0x3ffdfULL) != 0L) return 9; return -1; case 8: if ((active0 & 0xffffffffffbfc000ULL) != 0L || (active1 & 0x3ffdfULL) != 0L) return 9; return -1; case 9: if ((active0 & 0xffffffbfffbfc000ULL) != 0L || (active1 & 0x3ffdfULL) != 0L) return 9; return -1; case 10: if ((active0 & 0xffffdfbfffbfc000ULL) != 0L || (active1 & 0x3dfdfULL) != 0L) return 9; return -1; case 11: if ((active0 & 0xffffdfaff7bbc000ULL) != 0L || (active1 & 0x3dfdfULL) != 0L) return 9; return -1; case 12: if ((active0 & 0xffffddaff79b4000ULL) != 0L || (active1 & 0x3dfdfULL) != 0L) return 9; return -1; case 13: if ((active0 & 0xfffeddaf759b4000ULL) != 0L || (active1 & 0x3dfdfULL) != 0L) return 9; return -1; case 14: if ((active0 & 0xfffeddaf359b0000ULL) != 0L || (active1 & 0x3de9fULL) != 0L) return 9; return -1; case 15: if ((active0 & 0xfffe5daf35910000ULL) != 0L || (active1 & 0x3de9fULL) != 0L) return 9; return -1; case 16: if ((active0 & 0xfffe5d8f35910000ULL) != 0L || (active1 & 0x3de9fULL) != 0L) return 9; return -1; case 17: if ((active0 & 0xbffe1c8f35910000ULL) != 0L || (active1 & 0x3de9bULL) != 0L) return 9; return -1; case 18: if ((active0 & 0xbffe100731900000ULL) != 0L || (active1 & 0x3de89ULL) != 0L) return 9; return -1; case 19: if ((active0 & 0xbfdc100711000000ULL) != 0L || (active1 & 0x39e89ULL) != 0L) return 9; return -1; case 20: if ((active0 & 0xbfcc000400000000ULL) != 0L || (active1 & 0x39e09ULL) != 0L) return 9; return -1; case 21: if ((active0 & 0xbfcc000400000000ULL) != 0L || (active1 & 0x39609ULL) != 0L) return 9; return -1; case 22: if ((active0 & 0xbfcc000000000000ULL) != 0L || (active1 & 0x39600ULL) != 0L) return 9; return -1; case 23: if ((active0 & 0xb58c000000000000ULL) != 0L || (active1 & 0x11400ULL) != 0L) return 9; return -1; case 24: if ((active0 & 0x504000000000000ULL) != 0L || (active1 & 0x1400ULL) != 0L) return 9; return -1; case 25: if ((active0 & 0x104000000000000ULL) != 0L || (active1 & 0x1400ULL) != 0L) return 9; return -1; case 26: if ((active0 & 0x100000000000000ULL) != 0L || (active1 & 0x1400ULL) != 0L) return 9; return -1; case 27: if ((active0 & 0x100000000000000ULL) != 0L || (active1 & 0x1400ULL) != 0L) return 9; return -1; case 28: if ((active0 & 0x100000000000000ULL) != 0L || (active1 & 0x1400ULL) != 0L) return 9; return -1; case 29: if ((active0 & 0x100000000000000ULL) != 0L || (active1 & 0x400ULL) != 0L) return 9; return -1; default : return -1; } } int OWL2FunctionalStyleParserTokenManager::jjStartNfa_0(int pos, unsigned long long active0, unsigned long long active1){ return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1); } int OWL2FunctionalStyleParserTokenManager::jjStopAtPos(int pos, int kind){ jjmatchedKind = kind; jjmatchedPos = pos; return pos + 1; } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa0_0(){ switch(curChar) { case 34: return jjStopAtPos(0, 92); case 35: return jjStopAtPos(0, 93); case 40: return jjStopAtPos(0, 5); case 41: return jjStopAtPos(0, 6); case 60: return jjStopAtPos(0, 91); case 61: return jjStopAtPos(0, 7); case 65: return jjMoveStringLiteralDfa1_0(0x1000000000010000ULL, 0x36000ULL); case 67: return jjMoveStringLiteralDfa1_0(0x201000ULL, 0x100ULL); case 68: return jjMoveStringLiteralDfa1_0(0x99ff80084a000ULL, 0x897ULL); case 69: return jjMoveStringLiteralDfa1_0(0x8004400000000000ULL, 0x0ULL); case 70: return jjMoveStringLiteralDfa1_0(0x80000000000000ULL, 0x8ULL); case 72: return jjMoveStringLiteralDfa1_0(0x0ULL, 0x20ULL); case 73: return jjMoveStringLiteralDfa1_0(0x540000000000800ULL, 0x0ULL); case 78: return jjMoveStringLiteralDfa1_0(0x20000ULL, 0x1400ULL); case 79: return jjMoveStringLiteralDfa1_0(0x300007ff584400ULL, 0x200ULL); case 80: return jjMoveStringLiteralDfa1_0(0x200ULL, 0x0ULL); case 82: return jjMoveStringLiteralDfa1_0(0x200000000000000ULL, 0x0ULL); case 83: return jjMoveStringLiteralDfa1_0(0x4802200000000000ULL, 0x8040ULL); case 84: return jjMoveStringLiteralDfa1_0(0x2000000000000000ULL, 0x0ULL); case 94: return jjMoveStringLiteralDfa1_0(0x100ULL, 0x0ULL); case 95: return jjMoveStringLiteralDfa1_0(0x0ULL, 0x400000ULL); default : return jjMoveNfa_0(1, 0); } } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa1_0(unsigned long long active0, unsigned long long active1){ if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(0, active0, active1); return 1; } curChar = input_stream->readChar(); switch(curChar) { case 58: if ((active1 & 0x400000ULL) != 0L) return jjStopAtPos(1, 86); break; case 94: if ((active0 & 0x100ULL) != 0L) return jjStopAtPos(1, 8); break; case 97: return jjMoveStringLiteralDfa2_0(active0, 0x1ff80082a000ULL, active1, 0x876ULL); case 98: return jjMoveStringLiteralDfa2_0(active0, 0x300007ff184000ULL, active1, 0x200ULL); case 101: return jjMoveStringLiteralDfa2_0(active0, 0x200000000040000ULL, active1, 0x1400ULL); case 105: return jjMoveStringLiteralDfa2_0(active0, 0x9800000000000ULL, active1, 0x81ULL); case 108: return jjMoveStringLiteralDfa2_0(active0, 0x1000ULL, active1, 0x100ULL); case 109: return jjMoveStringLiteralDfa2_0(active0, 0x800ULL, active1, 0L); case 110: return jjMoveStringLiteralDfa2_0(active0, 0x140000000410400ULL, active1, 0x36000ULL); case 111: return jjMoveStringLiteralDfa2_0(active0, 0x200000ULL, active1, 0L); case 113: return jjMoveStringLiteralDfa2_0(active0, 0x8004400000000000ULL, active1, 0L); case 114: return jjMoveStringLiteralDfa2_0(active0, 0x2400000000000200ULL, active1, 0L); case 115: return jjMoveStringLiteralDfa2_0(active0, 0x1000000000000000ULL, active1, 0L); case 117: return jjMoveStringLiteralDfa2_0(active0, 0x4082200000000000ULL, active1, 0x8008ULL); case 121: return jjMoveStringLiteralDfa2_0(active0, 0x800000000000000ULL, active1, 0L); default : break; } return jjStartNfa_0(0, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa2_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(0, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(1, active0, active1); return 2; } curChar = input_stream->readChar(); switch(curChar) { case 97: return jjMoveStringLiteralDfa3_0(active0, 0x2000000000001000ULL, active1, 0x100ULL); case 98: return jjMoveStringLiteralDfa3_0(active0, 0x4002200000000000ULL, active1, 0x8000ULL); case 99: return jjMoveStringLiteralDfa3_0(active0, 0x40000ULL, active1, 0L); case 101: return jjMoveStringLiteralDfa3_0(active0, 0x400200ULL, active1, 0L); case 102: return jjMoveStringLiteralDfa3_0(active0, 0x200000000000000ULL, active1, 0x80ULL); case 103: return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x1400ULL); case 106: return jjMoveStringLiteralDfa3_0(active0, 0x300007ff184000ULL, active1, 0x200ULL); case 109: return jjMoveStringLiteralDfa3_0(active0, 0x800000000220000ULL, active1, 0x40ULL); case 110: return jjMoveStringLiteralDfa3_0(active0, 0x80000000010000ULL, active1, 0x36008ULL); case 112: return jjMoveStringLiteralDfa3_0(active0, 0x800ULL, active1, 0L); case 114: return jjMoveStringLiteralDfa3_0(active0, 0x400000000000000ULL, active1, 0L); case 115: return jjMoveStringLiteralDfa3_0(active0, 0x9800000000000ULL, active1, 0x21ULL); case 116: return jjMoveStringLiteralDfa3_0(active0, 0x1ff80080a400ULL, active1, 0x816ULL); case 117: return jjMoveStringLiteralDfa3_0(active0, 0x8004400000000000ULL, active1, 0L); case 118: return jjMoveStringLiteralDfa3_0(active0, 0x140000000000000ULL, active1, 0L); case 121: return jjMoveStringLiteralDfa3_0(active0, 0x1000000000000000ULL, active1, 0L); default : break; } return jjStartNfa_0(1, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa3_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(1, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(2, active0, active1); return 3; } curChar = input_stream->readChar(); switch(curChar) { case 65: return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x8000ULL); case 67: return jjMoveStringLiteralDfa4_0(active0, 0x200000000000ULL, active1, 0L); case 68: return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000000ULL, active1, 0L); case 75: return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x20ULL); case 79: return jjMoveStringLiteralDfa4_0(active0, 0x2000000400000ULL, active1, 0L); case 97: return jjMoveStringLiteralDfa4_0(active0, 0x1ff80080a000ULL, active1, 0x1c16ULL); case 99: return jjMoveStringLiteralDfa4_0(active0, 0x80000000000000ULL, active1, 0x8ULL); case 101: return jjMoveStringLiteralDfa4_0(active0, 0x5700007ff1a4000ULL, active1, 0x240ULL); case 102: return jjMoveStringLiteralDfa4_0(active0, 0x200ULL, active1, 0x80ULL); case 105: return jjMoveStringLiteralDfa4_0(active0, 0x8004400000000000ULL, active1, 0L); case 106: return jjMoveStringLiteralDfa4_0(active0, 0x9800000000000ULL, active1, 0x1ULL); case 108: return jjMoveStringLiteralDfa4_0(active0, 0x200000000040000ULL, active1, 0L); case 109: return jjMoveStringLiteralDfa4_0(active0, 0x1800000000000000ULL, active1, 0L); case 110: return jjMoveStringLiteralDfa4_0(active0, 0x2000000000000000ULL, active1, 0L); case 111: return jjMoveStringLiteralDfa4_0(active0, 0x10c00ULL, active1, 0x36000ULL); case 112: return jjMoveStringLiteralDfa4_0(active0, 0x200000ULL, active1, 0L); case 115: return jjMoveStringLiteralDfa4_0(active0, 0x1000ULL, active1, 0x100ULL); default : break; } return jjStartNfa_0(2, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa4_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(2, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(3, active0, active1); return 4; } curChar = input_stream->readChar(); switch(curChar) { case 65: return jjMoveStringLiteralDfa5_0(active0, 0x10000000000ULL, active1, 0L); case 67: return jjMoveStringLiteralDfa5_0(active0, 0x2000000000ULL, active1, 0L); case 69: return jjMoveStringLiteralDfa5_0(active0, 0x100000000000ULL, active1, 0L); case 72: return jjMoveStringLiteralDfa5_0(active0, 0x20000000000ULL, active1, 0L); case 73: return jjMoveStringLiteralDfa5_0(active0, 0x800000000ULL, active1, 0x40ULL); case 77: return jjMoveStringLiteralDfa5_0(active0, 0xc0000000000ULL, active1, 0L); case 79: return jjMoveStringLiteralDfa5_0(active0, 0x4000000000ULL, active1, 0L); case 80: return jjMoveStringLiteralDfa5_0(active0, 0x8000ULL, active1, 0x806ULL); case 83: return jjMoveStringLiteralDfa5_0(active0, 0x8000000000ULL, active1, 0L); case 85: return jjMoveStringLiteralDfa5_0(active0, 0x1000000000ULL, active1, 0L); case 97: return jjMoveStringLiteralDfa5_0(active0, 0x4000000000040000ULL, active1, 0L); case 98: return jjMoveStringLiteralDfa5_0(active0, 0x2000000000000ULL, active1, 0L); case 99: return jjMoveStringLiteralDfa5_0(active0, 0x300007ff184000ULL, active1, 0x200ULL); case 100: return jjMoveStringLiteralDfa5_0(active0, 0x20000ULL, active1, 0L); case 101: return jjMoveStringLiteralDfa5_0(active0, 0xa00000000000000ULL, active1, 0xa0ULL); case 102: if ((active0 & 0x400000ULL) != 0L) return jjStartNfaWithStates_0(4, 22, 9); return jjMoveStringLiteralDfa5_0(active0, 0x400000000000000ULL, active1, 0L); case 105: return jjMoveStringLiteralDfa5_0(active0, 0x200ULL, active1, 0L); case 108: return jjMoveStringLiteralDfa5_0(active0, 0x200000200400ULL, active1, 0L); case 109: return jjMoveStringLiteralDfa5_0(active0, 0x1000000000000000ULL, active1, 0L); case 110: return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x8000ULL); case 111: return jjMoveStringLiteralDfa5_0(active0, 0x9800000000000ULL, active1, 0x1ULL); case 114: return jjMoveStringLiteralDfa5_0(active0, 0x140000000000800ULL, active1, 0L); case 115: if ((active0 & 0x1000ULL) != 0L) { jjmatchedKind = 12; jjmatchedPos = 4; } return jjMoveStringLiteralDfa5_0(active0, 0x2000000000000000ULL, active1, 0x100ULL); case 116: return jjMoveStringLiteralDfa5_0(active0, 0x80000000812000ULL, active1, 0x37418ULL); case 118: return jjMoveStringLiteralDfa5_0(active0, 0x8004400000000000ULL, active1, 0L); default : break; } return jjStartNfa_0(3, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa5_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(3, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(4, active0, active1); return 5; } curChar = input_stream->readChar(); switch(curChar) { case 65: return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x100ULL); case 73: return jjMoveStringLiteralDfa6_0(active0, 0x20000ULL, active1, 0L); case 97: return jjMoveStringLiteralDfa6_0(active0, 0x80046a0000010000ULL, active1, 0x36000ULL); case 101: return jjMoveStringLiteralDfa6_0(active0, 0x1000000000200000ULL, active1, 0L); case 105: return jjMoveStringLiteralDfa6_0(active0, 0x2089840000000000ULL, active1, 0x1409ULL); case 106: return jjMoveStringLiteralDfa6_0(active0, 0x2000000000000ULL, active1, 0L); case 108: return jjMoveStringLiteralDfa6_0(active0, 0x400010000000000ULL, active1, 0L); case 110: return jjMoveStringLiteralDfa6_0(active0, 0x5800000000ULL, active1, 0x8040ULL); case 111: return jjMoveStringLiteralDfa6_0(active0, 0xa000000400ULL, active1, 0L); case 114: return jjMoveStringLiteralDfa6_0(active0, 0x48000ULL, active1, 0x886ULL); case 115: return jjMoveStringLiteralDfa6_0(active0, 0x140000000000000ULL, active1, 0L); case 116: if ((active0 & 0x800ULL) != 0L) return jjStartNfaWithStates_0(5, 11, 9); return jjMoveStringLiteralDfa6_0(active0, 0x48300007ff184000ULL, active1, 0x200ULL); case 120: if ((active0 & 0x200ULL) != 0L) return jjStartNfaWithStates_0(5, 9, 9); return jjMoveStringLiteralDfa6_0(active0, 0x200100000000000ULL, active1, 0L); case 121: if ((active1 & 0x20ULL) != 0L) return jjStartNfaWithStates_0(5, 69, 9); return jjMoveStringLiteralDfa6_0(active0, 0x802000ULL, active1, 0x10ULL); default : break; } return jjStartNfa_0(4, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa6_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(4, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(5, active0, active1); return 6; } curChar = input_stream->readChar(); switch(curChar) { case 65: return jjMoveStringLiteralDfa7_0(active0, 0x20000000ULL, active1, 0L); case 67: return jjMoveStringLiteralDfa7_0(active0, 0x4000000ULL, active1, 0L); case 69: return jjMoveStringLiteralDfa7_0(active0, 0x400000000ULL, active1, 0L); case 72: return jjMoveStringLiteralDfa7_0(active0, 0xc0000000ULL, active1, 0L); case 73: return jjMoveStringLiteralDfa7_0(active0, 0x1080000ULL, active1, 0L); case 77: return jjMoveStringLiteralDfa7_0(active0, 0x300000000ULL, active1, 0L); case 79: return jjMoveStringLiteralDfa7_0(active0, 0x8000000ULL, active1, 0L); case 80: return jjMoveStringLiteralDfa7_0(active0, 0x30000000104000ULL, active1, 0x200ULL); case 83: return jjMoveStringLiteralDfa7_0(active0, 0x10000000ULL, active1, 0L); case 85: return jjMoveStringLiteralDfa7_0(active0, 0x2000000ULL, active1, 0L); case 97: return jjMoveStringLiteralDfa7_0(active0, 0x4000100000040000ULL, active1, 0L); case 100: return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x40ULL); case 101: return jjMoveStringLiteralDfa7_0(active0, 0x542004000000000ULL, active1, 0x80ULL); case 103: return jjMoveStringLiteralDfa7_0(active0, 0x400ULL, active1, 0L); case 105: return jjMoveStringLiteralDfa7_0(active0, 0x200001000000000ULL, active1, 0L); case 108: return jjMoveStringLiteralDfa7_0(active0, 0x8004410000000000ULL, active1, 0L); case 109: return jjMoveStringLiteralDfa7_0(active0, 0xa000200000ULL, active1, 0L); case 110: return jjMoveStringLiteralDfa7_0(active0, 0x9840000020000ULL, active1, 0x1ULL); case 111: return jjMoveStringLiteralDfa7_0(active0, 0x80000000008000ULL, active1, 0x880eULL); case 112: return jjMoveStringLiteralDfa7_0(active0, 0x802000ULL, active1, 0x10ULL); case 114: return jjMoveStringLiteralDfa7_0(active0, 0x800000000000000ULL, active1, 0L); case 115: return jjMoveStringLiteralDfa7_0(active0, 0x220000000000ULL, active1, 0x100ULL); case 116: return jjMoveStringLiteralDfa7_0(active0, 0x3000000800010000ULL, active1, 0x36000ULL); case 118: return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x1400ULL); case 120: return jjMoveStringLiteralDfa7_0(active0, 0x80000000000ULL, active1, 0L); default : break; } return jjStartNfa_0(5, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa7_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(5, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(6, active0, active1); return 7; } curChar = input_stream->readChar(); switch(curChar) { case 67: return jjMoveStringLiteralDfa8_0(active0, 0xc0000000000ULL, active1, 0L); case 70: return jjMoveStringLiteralDfa8_0(active0, 0x100000000000000ULL, active1, 0L); case 79: return jjMoveStringLiteralDfa8_0(active0, 0x40004000000000ULL, active1, 0L); case 80: return jjMoveStringLiteralDfa8_0(active0, 0x4000000000000000ULL, active1, 0L); case 86: return jjMoveStringLiteralDfa8_0(active0, 0x30000000000ULL, active1, 0L); case 97: return jjMoveStringLiteralDfa8_0(active0, 0x2c0000000ULL, active1, 0L); case 99: return jjMoveStringLiteralDfa8_0(active0, 0x2100000000000ULL, active1, 0L); case 100: return jjMoveStringLiteralDfa8_0(active0, 0x20000ULL, active1, 0L); case 101: if ((active0 & 0x2000ULL) != 0L) { jjmatchedKind = 13; jjmatchedPos = 7; } return jjMoveStringLiteralDfa8_0(active0, 0x8004408800a00000ULL, active1, 0x1410ULL); case 105: return jjMoveStringLiteralDfa8_0(active0, 0x2800000100010000ULL, active1, 0x36040ULL); case 108: return jjMoveStringLiteralDfa8_0(active0, 0x20000000ULL, active1, 0L); case 110: return jjMoveStringLiteralDfa8_0(active0, 0x8000000b080000ULL, active1, 0x88ULL); case 111: return jjMoveStringLiteralDfa8_0(active0, 0x1014000000ULL, active1, 0L); case 112: return jjMoveStringLiteralDfa8_0(active0, 0x2000008000ULL, active1, 0x806ULL); case 114: return jjMoveStringLiteralDfa8_0(active0, 0x1030000000104000ULL, active1, 0x200ULL); case 115: return jjMoveStringLiteralDfa8_0(active0, 0x200000000000ULL, active1, 0x100ULL); case 116: return jjMoveStringLiteralDfa8_0(active0, 0x9800000040000ULL, active1, 0x8001ULL); case 118: return jjMoveStringLiteralDfa8_0(active0, 0x200000000000000ULL, active1, 0L); case 120: return jjMoveStringLiteralDfa8_0(active0, 0x400000400000000ULL, active1, 0L); case 121: if ((active0 & 0x400ULL) != 0L) return jjStartNfaWithStates_0(7, 10, 9); break; default : break; } return jjStartNfa_0(6, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa8_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(6, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(7, active0, active1); return 8; } curChar = input_stream->readChar(); switch(curChar) { case 67: return jjMoveStringLiteralDfa9_0(active0, 0x800000000000ULL, active1, 0L); case 68: return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0x1011ULL); case 79: return jjMoveStringLiteralDfa9_0(active0, 0x8200000000000ULL, active1, 0x400ULL); case 82: return jjMoveStringLiteralDfa9_0(active0, 0x800000ULL, active1, 0L); case 85: return jjMoveStringLiteralDfa9_0(active0, 0x1000000000000ULL, active1, 0L); case 86: return jjMoveStringLiteralDfa9_0(active0, 0x8000000000ULL, active1, 0L); case 97: return jjMoveStringLiteralDfa9_0(active0, 0x800f0400000000ULL, active1, 0x8008ULL); case 98: return jjMoveStringLiteralDfa9_0(active0, 0x40000000000000ULL, active1, 0L); case 99: return jjMoveStringLiteralDfa9_0(active0, 0x800000000000000ULL, active1, 0L); case 101: return jjMoveStringLiteralDfa9_0(active0, 0x200000008008000ULL, active1, 0x906ULL); case 102: if ((active0 & 0x4000000000ULL) != 0L) return jjStartNfaWithStates_0(8, 38, 9); break; case 105: return jjMoveStringLiteralDfa9_0(active0, 0x1400000002060000ULL, active1, 0L); case 108: return jjMoveStringLiteralDfa9_0(active0, 0x2020000000ULL, active1, 0L); case 109: return jjMoveStringLiteralDfa9_0(active0, 0x14000000ULL, active1, 0L); case 110: return jjMoveStringLiteralDfa9_0(active0, 0x8004401100200000ULL, active1, 0L); case 111: return jjMoveStringLiteralDfa9_0(active0, 0x30000000114000ULL, active1, 0x36200ULL); case 114: return jjMoveStringLiteralDfa9_0(active0, 0x4000000800000000ULL, active1, 0L); case 115: return jjMoveStringLiteralDfa9_0(active0, 0xc0000000ULL, active1, 0L); case 116: return jjMoveStringLiteralDfa9_0(active0, 0x2100001000000ULL, active1, 0x80ULL); case 117: return jjMoveStringLiteralDfa9_0(active0, 0x100000000000000ULL, active1, 0L); case 118: return jjMoveStringLiteralDfa9_0(active0, 0x2000000000080000ULL, active1, 0x40ULL); case 120: return jjMoveStringLiteralDfa9_0(active0, 0x200000000ULL, active1, 0L); default : break; } return jjStartNfa_0(7, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa9_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(7, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(8, active0, active1); return 9; } curChar = input_stream->readChar(); switch(curChar) { case 67: return jjMoveStringLiteralDfa10_0(active0, 0x100300000000ULL, active1, 0L); case 73: return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x80ULL); case 79: return jjMoveStringLiteralDfa10_0(active0, 0xa00001008000000ULL, active1, 0L); case 80: return jjMoveStringLiteralDfa10_0(active0, 0x2000000000000ULL, active1, 0L); case 83: return jjMoveStringLiteralDfa10_0(active0, 0x80000000ULL, active1, 0L); case 86: return jjMoveStringLiteralDfa10_0(active0, 0x60000000ULL, active1, 0L); case 97: return jjMoveStringLiteralDfa10_0(active0, 0x8000000000ULL, active1, 0x1001ULL); case 98: return jjMoveStringLiteralDfa10_0(active0, 0x8000000000000ULL, active1, 0x400ULL); case 99: return jjMoveStringLiteralDfa10_0(active0, 0x1000000400000000ULL, active1, 0L); case 101: return jjMoveStringLiteralDfa10_0(active0, 0x2000002011880000ULL, active1, 0x10ULL); case 102: if ((active0 & 0x200000000000ULL) != 0L) return jjStartNfaWithStates_0(9, 45, 9); break; case 105: return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x40ULL); case 106: return jjMoveStringLiteralDfa10_0(active0, 0x40000000000000ULL, active1, 0L); case 108: return jjMoveStringLiteralDfa10_0(active0, 0x80830000000000ULL, active1, 0x8ULL); case 110: if ((active1 & 0x2000ULL) != 0L) { jjmatchedKind = 77; jjmatchedPos = 9; } return jjMoveStringLiteralDfa10_0(active0, 0x101000000010000ULL, active1, 0x34000ULL); case 111: return jjMoveStringLiteralDfa10_0(active0, 0x4000000002040000ULL, active1, 0L); case 112: return jjMoveStringLiteralDfa10_0(active0, 0x30000004104000ULL, active1, 0x200ULL); case 114: return jjMoveStringLiteralDfa10_0(active0, 0xc0000008000ULL, active1, 0x906ULL); case 115: return jjMoveStringLiteralDfa10_0(active0, 0x800000000ULL, active1, 0L); case 116: return jjMoveStringLiteralDfa10_0(active0, 0x8004400000200000ULL, active1, 0x8000ULL); case 118: return jjMoveStringLiteralDfa10_0(active0, 0x400000000020000ULL, active1, 0L); default : break; } return jjStartNfa_0(8, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa10_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(8, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(9, active0, active1); return 10; } curChar = input_stream->readChar(); switch(curChar) { case 65: return jjMoveStringLiteralDfa11_0(active0, 0L, active1, 0x4000ULL); case 67: return jjMoveStringLiteralDfa11_0(active0, 0x400000000000ULL, active1, 0L); case 68: return jjMoveStringLiteralDfa11_0(active0, 0x8000000000000000ULL, active1, 0x8ULL); case 79: return jjMoveStringLiteralDfa11_0(active0, 0x3084000000200000ULL, active1, 0L); case 80: return jjMoveStringLiteralDfa11_0(active0, 0x10000ULL, active1, 0x30000ULL); case 86: return jjMoveStringLiteralDfa11_0(active0, 0x10000000ULL, active1, 0L); case 97: return jjMoveStringLiteralDfa11_0(active0, 0x900360000000ULL, active1, 0L); case 98: return jjMoveStringLiteralDfa11_0(active0, 0xa00000000000000ULL, active1, 0L); case 99: return jjMoveStringLiteralDfa11_0(active0, 0x100000000000000ULL, active1, 0L); case 100: return jjMoveStringLiteralDfa11_0(active0, 0xc0000000000ULL, active1, 0x40ULL); case 101: return jjMoveStringLiteralDfa11_0(active0, 0x470000880104000ULL, active1, 0x200ULL); case 102: if ((active0 & 0x8000000ULL) != 0L) return jjStartNfaWithStates_0(10, 27, 9); else if ((active0 & 0x1000000000ULL) != 0L) return jjStartNfaWithStates_0(10, 36, 9); return jjMoveStringLiteralDfa11_0(active0, 0L, active1, 0x10ULL); case 105: return jjMoveStringLiteralDfa11_0(active0, 0x1000000020000ULL, active1, 0x8000ULL); case 106: return jjMoveStringLiteralDfa11_0(active0, 0x8000000000000ULL, active1, 0x400ULL); case 108: return jjMoveStringLiteralDfa11_0(active0, 0x8004000000ULL, active1, 0L); case 109: return jjMoveStringLiteralDfa11_0(active0, 0x2000000000ULL, active1, 0L); case 110: if ((active0 & 0x40000ULL) != 0L) return jjStartNfaWithStates_0(10, 18, 9); return jjMoveStringLiteralDfa11_0(active0, 0x2000000ULL, active1, 0x80ULL); case 112: return jjMoveStringLiteralDfa11_0(active0, 0x4000000000000000ULL, active1, 0L); case 114: return jjMoveStringLiteralDfa11_0(active0, 0x2000001080000ULL, active1, 0L); case 115: return jjMoveStringLiteralDfa11_0(active0, 0x800000ULL, active1, 0L); case 116: return jjMoveStringLiteralDfa11_0(active0, 0x400008000ULL, active1, 0x1907ULL); case 117: return jjMoveStringLiteralDfa11_0(active0, 0x30000000000ULL, active1, 0L); default : break; } return jjStartNfa_0(9, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa11_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(9, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(10, active0, active1); return 11; } curChar = input_stream->readChar(); switch(curChar) { case 67: return jjMoveStringLiteralDfa12_0(active0, 0x400000000ULL, active1, 0L); case 79: return jjMoveStringLiteralDfa12_0(active0, 0x400000002000000ULL, active1, 0L); case 97: return jjMoveStringLiteralDfa12_0(active0, 0x8000000010000000ULL, active1, 0x1009ULL); case 98: return jjMoveStringLiteralDfa12_0(active0, 0x3084000000000000ULL, active1, 0L); case 99: return jjMoveStringLiteralDfa12_0(active0, 0x40000800000000ULL, active1, 0L); case 100: return jjMoveStringLiteralDfa12_0(active0, 0x20000ULL, active1, 0x80ULL); case 101: if ((active0 & 0x20000000000ULL) != 0L) return jjStartNfaWithStates_0(11, 41, 9); return jjMoveStringLiteralDfa12_0(active0, 0x4008012004000000ULL, active1, 0x400ULL); case 102: if ((active0 & 0x200000ULL) != 0L) return jjStartNfaWithStates_0(11, 21, 9); break; case 105: return jjMoveStringLiteralDfa12_0(active0, 0xc0000000000ULL, active1, 0x110ULL); case 106: return jjMoveStringLiteralDfa12_0(active0, 0xa00000000000000ULL, active1, 0L); case 108: return jjMoveStringLiteralDfa12_0(active0, 0x4000e0000000ULL, active1, 0L); case 111: return jjMoveStringLiteralDfa12_0(active0, 0x3000000000000ULL, active1, 0x8000ULL); case 114: return jjMoveStringLiteralDfa12_0(active0, 0x30100300114000ULL, active1, 0x30200ULL); case 115: return jjMoveStringLiteralDfa12_0(active0, 0x800001080000ULL, active1, 0x4000ULL); case 116: return jjMoveStringLiteralDfa12_0(active0, 0x100000000800000ULL, active1, 0L); case 117: return jjMoveStringLiteralDfa12_0(active0, 0x8000000000ULL, active1, 0x40ULL); case 121: if ((active0 & 0x8000ULL) != 0L) { jjmatchedKind = 15; jjmatchedPos = 11; } return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x806ULL); default : break; } return jjStartNfa_0(10, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa12_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(10, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(11, active0, active1); return 12; } curChar = input_stream->readChar(); switch(curChar) { case 65: return jjMoveStringLiteralDfa13_0(active0, 0L, active1, 0x800ULL); case 68: return jjMoveStringLiteralDfa13_0(active0, 0L, active1, 0x2ULL); case 80: return jjMoveStringLiteralDfa13_0(active0, 0L, active1, 0x1001ULL); case 82: return jjMoveStringLiteralDfa13_0(active0, 0L, active1, 0x4ULL); case 97: return jjMoveStringLiteralDfa13_0(active0, 0x400400000000ULL, active1, 0x40ULL); case 98: return jjMoveStringLiteralDfa13_0(active0, 0x400000000000000ULL, active1, 0L); case 99: return jjMoveStringLiteralDfa13_0(active0, 0x8000000000000ULL, active1, 0x400ULL); case 100: return jjMoveStringLiteralDfa13_0(active0, 0x100300000000ULL, active1, 0L); case 101: return jjMoveStringLiteralDfa13_0(active0, 0xa00008001080000ULL, active1, 0L); case 102: if ((active0 & 0x2000000ULL) != 0L) return jjStartNfaWithStates_0(12, 25, 9); else if ((active0 & 0x80000000ULL) != 0L) return jjStartNfaWithStates_0(12, 31, 9); break; case 105: return jjMoveStringLiteralDfa13_0(active0, 0x100000000000000ULL, active1, 0x80ULL); case 106: return jjMoveStringLiteralDfa13_0(active0, 0x3084000000000000ULL, active1, 0L); case 108: return jjMoveStringLiteralDfa13_0(active0, 0x10000000ULL, active1, 0L); case 109: return jjMoveStringLiteralDfa13_0(active0, 0x4000000ULL, active1, 0L); case 110: if ((active0 & 0x1000000000000ULL) != 0L) return jjStartNfaWithStates_0(12, 48, 9); return jjMoveStringLiteralDfa13_0(active0, 0xc2000000000ULL, active1, 0x8010ULL); case 111: return jjMoveStringLiteralDfa13_0(active0, 0x10000ULL, active1, 0x30100ULL); case 112: return jjMoveStringLiteralDfa13_0(active0, 0x2000000000000ULL, active1, 0L); case 114: return jjMoveStringLiteralDfa13_0(active0, 0x4000000000800000ULL, active1, 0L); case 115: return jjMoveStringLiteralDfa13_0(active0, 0x810000000000ULL, active1, 0x4000ULL); case 116: return jjMoveStringLiteralDfa13_0(active0, 0x8070000800104000ULL, active1, 0x208ULL); case 117: return jjMoveStringLiteralDfa13_0(active0, 0x60020000ULL, active1, 0L); default : break; } return jjStartNfa_0(11, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa13_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(11, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(12, active0, active1); return 13; } curChar = input_stream->readChar(); switch(curChar) { case 70: return jjMoveStringLiteralDfa14_0(active0, 0x10000000000ULL, active1, 0L); case 79: return jjMoveStringLiteralDfa14_0(active0, 0x80000ULL, active1, 0L); case 80: return jjMoveStringLiteralDfa14_0(active0, 0x40000000000000ULL, active1, 0x8000ULL); case 97: return jjMoveStringLiteralDfa14_0(active0, 0x80000c0000020000ULL, active1, 0xcULL); case 99: return jjMoveStringLiteralDfa14_0(active0, 0xa00000001000000ULL, active1, 0L); case 101: if ((active0 & 0x40000000ULL) != 0L) return jjStartNfaWithStates_0(13, 30, 9); return jjMoveStringLiteralDfa14_0(active0, 0x3086800024000000ULL, active1, 0x4000ULL); case 105: return jjMoveStringLiteralDfa14_0(active0, 0x100b00800000ULL, active1, 0x10ULL); case 106: return jjMoveStringLiteralDfa14_0(active0, 0x400000000000000ULL, active1, 0L); case 108: if ((active1 & 0x40ULL) != 0L) return jjStartNfaWithStates_0(13, 70, 9); break; case 110: if ((active1 & 0x100ULL) != 0L) return jjStartNfaWithStates_0(13, 72, 9); break; case 111: return jjMoveStringLiteralDfa14_0(active0, 0x100000000000000ULL, active1, 0x2ULL); case 112: return jjMoveStringLiteralDfa14_0(active0, 0x10000ULL, active1, 0x30000ULL); case 114: return jjMoveStringLiteralDfa14_0(active0, 0x400000000ULL, active1, 0x1001ULL); case 115: return jjMoveStringLiteralDfa14_0(active0, 0x408000000000ULL, active1, 0x800ULL); case 116: return jjMoveStringLiteralDfa14_0(active0, 0x4008002000000000ULL, active1, 0x400ULL); case 117: return jjMoveStringLiteralDfa14_0(active0, 0x10000000ULL, active1, 0L); case 118: return jjMoveStringLiteralDfa14_0(active0, 0L, active1, 0x80ULL); case 121: if ((active0 & 0x4000ULL) != 0L) { jjmatchedKind = 14; jjmatchedPos = 13; } return jjMoveStringLiteralDfa14_0(active0, 0x30000000100000ULL, active1, 0x200ULL); default : break; } return jjStartNfa_0(12, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa14_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(12, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(13, active0, active1); return 14; } curChar = input_stream->readChar(); switch(curChar) { case 65: return jjMoveStringLiteralDfa15_0(active0, 0L, active1, 0x200ULL); case 67: return jjMoveStringLiteralDfa15_0(active0, 0x100000ULL, active1, 0L); case 68: return jjMoveStringLiteralDfa15_0(active0, 0x10000000000000ULL, active1, 0L); case 70: return jjMoveStringLiteralDfa15_0(active0, 0x8000000000ULL, active1, 0L); case 79: return jjMoveStringLiteralDfa15_0(active0, 0x2000000000ULL, active1, 0L); case 80: return jjMoveStringLiteralDfa15_0(active0, 0x8008000000000000ULL, active1, 0x408ULL); case 82: return jjMoveStringLiteralDfa15_0(active0, 0x20000000000000ULL, active1, 0L); case 99: return jjMoveStringLiteralDfa15_0(active0, 0x3084000000800000ULL, active1, 0L); case 100: return jjMoveStringLiteralDfa15_0(active0, 0x400000000ULL, active1, 0L); case 101: return jjMoveStringLiteralDfa15_0(active0, 0x400000010010000ULL, active1, 0x30000ULL); case 102: if ((active0 & 0x80000ULL) != 0L) return jjStartNfaWithStates_0(14, 19, 9); break; case 105: return jjMoveStringLiteralDfa15_0(active0, 0L, active1, 0x80ULL); case 108: if ((active0 & 0x20000ULL) != 0L) return jjStartNfaWithStates_0(14, 17, 9); return jjMoveStringLiteralDfa15_0(active0, 0xc0000000000ULL, active1, 0L); case 109: return jjMoveStringLiteralDfa15_0(active0, 0L, active1, 0x2ULL); case 110: return jjMoveStringLiteralDfa15_0(active0, 0x100100304000000ULL, active1, 0x4ULL); case 111: return jjMoveStringLiteralDfa15_0(active0, 0x800000000ULL, active1, 0x1001ULL); case 114: return jjMoveStringLiteralDfa15_0(active0, 0x42010000000000ULL, active1, 0xc000ULL); case 115: if ((active0 & 0x800000000000ULL) != 0L) return jjStartNfaWithStates_0(14, 47, 9); return jjMoveStringLiteralDfa15_0(active0, 0x400020000000ULL, active1, 0x800ULL); case 116: return jjMoveStringLiteralDfa15_0(active0, 0xa00000001000000ULL, active1, 0x10ULL); case 121: return jjMoveStringLiteralDfa15_0(active0, 0x4000000000000000ULL, active1, 0L); default : break; } return jjStartNfa_0(13, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa15_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(13, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(14, active0, active1); return 15; } curChar = input_stream->readChar(); switch(curChar) { case 70: return jjMoveStringLiteralDfa16_0(active0, 0x20000000ULL, active1, 0L); case 79: return jjMoveStringLiteralDfa16_0(active0, 0x4000000000000000ULL, active1, 0L); case 80: return jjMoveStringLiteralDfa16_0(active0, 0xa00000000000000ULL, active1, 0L); case 97: return jjMoveStringLiteralDfa16_0(active0, 0x120100300000000ULL, active1, 0x2ULL); case 99: return jjMoveStringLiteralDfa16_0(active0, 0x400000000000000ULL, active1, 0L); case 100: return jjMoveStringLiteralDfa16_0(active0, 0L, active1, 0x80ULL); case 101: return jjMoveStringLiteralDfa16_0(active0, 0x400000000000ULL, active1, 0x800ULL); case 102: if ((active0 & 0x2000000000ULL) != 0L) return jjStartNfaWithStates_0(15, 37, 9); break; case 103: return jjMoveStringLiteralDfa16_0(active0, 0L, active1, 0x4ULL); case 104: return jjMoveStringLiteralDfa16_0(active0, 0x100000ULL, active1, 0L); case 105: return jjMoveStringLiteralDfa16_0(active0, 0xc0401000000ULL, active1, 0x10ULL); case 110: return jjMoveStringLiteralDfa16_0(active0, 0x800000000ULL, active1, 0L); case 111: return jjMoveStringLiteralDfa16_0(active0, 0x50010000000000ULL, active1, 0x8000ULL); case 112: return jjMoveStringLiteralDfa16_0(active0, 0L, active1, 0x1001ULL); case 114: return jjMoveStringLiteralDfa16_0(active0, 0x8008008000010000ULL, active1, 0x30408ULL); case 115: return jjMoveStringLiteralDfa16_0(active0, 0x10000000ULL, active1, 0x200ULL); case 116: return jjMoveStringLiteralDfa16_0(active0, 0x3086000004800000ULL, active1, 0x4000ULL); default : break; } return jjStartNfa_0(14, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa16_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(14, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(15, active0, active1); return 16; } curChar = input_stream->readChar(); switch(curChar) { case 70: return jjMoveStringLiteralDfa17_0(active0, 0x10000000ULL, active1, 0L); case 79: return jjMoveStringLiteralDfa17_0(active0, 0x804000000ULL, active1, 0L); case 80: return jjMoveStringLiteralDfa17_0(active0, 0x3084000000000000ULL, active1, 0L); case 97: return jjMoveStringLiteralDfa17_0(active0, 0x100000ULL, active1, 0L); case 101: if ((active1 & 0x4ULL) != 0L) return jjStartNfaWithStates_0(16, 66, 9); return jjMoveStringLiteralDfa17_0(active0, 0L, active1, 0x1001ULL); case 102: if ((active0 & 0x4000000000000000ULL) != 0L) return jjStartNfaWithStates_0(16, 62, 9); break; case 105: return jjMoveStringLiteralDfa17_0(active0, 0x800000ULL, active1, 0x4002ULL); case 108: return jjMoveStringLiteralDfa17_0(active0, 0x100100300000000ULL, active1, 0L); case 109: if ((active0 & 0x10000000000ULL) != 0L) return jjStartNfaWithStates_0(16, 40, 9); return jjMoveStringLiteralDfa17_0(active0, 0x10000000000000ULL, active1, 0L); case 110: return jjMoveStringLiteralDfa17_0(active0, 0x20000400000000ULL, active1, 0L); case 111: return jjMoveStringLiteralDfa17_0(active0, 0x8008008001000000ULL, active1, 0x418ULL); case 112: return jjMoveStringLiteralDfa17_0(active0, 0x40000000000000ULL, active1, 0x8000ULL); case 114: return jjMoveStringLiteralDfa17_0(active0, 0xa00000020000000ULL, active1, 0x800ULL); case 115: if ((active0 & 0x400000000000ULL) != 0L) return jjStartNfaWithStates_0(16, 46, 9); return jjMoveStringLiteralDfa17_0(active0, 0L, active1, 0x200ULL); case 116: return jjMoveStringLiteralDfa17_0(active0, 0x4000c0000010000ULL, active1, 0x30000ULL); case 117: return jjMoveStringLiteralDfa17_0(active0, 0L, active1, 0x80ULL); case 121: return jjMoveStringLiteralDfa17_0(active0, 0x2000000000000ULL, active1, 0L); default : break; } return jjStartNfa_0(15, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa17_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(15, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(16, active0, active1); return 17; } curChar = input_stream->readChar(); switch(curChar) { case 79: return jjMoveStringLiteralDfa18_0(active0, 0x102000000000000ULL, active1, 0L); case 80: return jjMoveStringLiteralDfa18_0(active0, 0x400000000000000ULL, active1, 0L); case 97: return jjMoveStringLiteralDfa18_0(active0, 0x10000400000000ULL, active1, 0x80ULL); case 101: return jjMoveStringLiteralDfa18_0(active0, 0x40000000000000ULL, active1, 0x8200ULL); case 102: if ((active0 & 0x4000000ULL) != 0L) return jjStartNfaWithStates_0(17, 26, 9); else if ((active0 & 0x800000000ULL) != 0L) return jjStartNfaWithStates_0(17, 35, 9); break; case 103: return jjMoveStringLiteralDfa18_0(active0, 0x20000000000000ULL, active1, 0L); case 105: return jjMoveStringLiteralDfa18_0(active0, 0x100300100000ULL, active1, 0L); case 109: if ((active0 & 0x8000000000ULL) != 0L) return jjStartNfaWithStates_0(17, 39, 9); break; case 110: if ((active1 & 0x2ULL) != 0L) return jjStartNfaWithStates_0(17, 65, 9); else if ((active1 & 0x10ULL) != 0L) return jjStartNfaWithStates_0(17, 68, 9); return jjMoveStringLiteralDfa18_0(active0, 0x1000000ULL, active1, 0L); case 111: return jjMoveStringLiteralDfa18_0(active0, 0xa00000020800000ULL, active1, 0x4000ULL); case 112: return jjMoveStringLiteralDfa18_0(active0, 0x8008000000000000ULL, active1, 0x408ULL); case 114: return jjMoveStringLiteralDfa18_0(active0, 0x3084000010000000ULL, active1, 0x1001ULL); case 116: return jjMoveStringLiteralDfa18_0(active0, 0L, active1, 0x800ULL); case 121: if ((active0 & 0x10000ULL) != 0L) { jjmatchedKind = 16; jjmatchedPos = 17; } else if ((active0 & 0x40000000000ULL) != 0L) return jjStartNfaWithStates_0(17, 42, 9); else if ((active0 & 0x80000000000ULL) != 0L) return jjStartNfaWithStates_0(17, 43, 9); return jjMoveStringLiteralDfa18_0(active0, 0L, active1, 0x30000ULL); default : break; } return jjStartNfa_0(16, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa18_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(16, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(17, active0, active1); return 18; } curChar = input_stream->readChar(); switch(curChar) { case 68: return jjMoveStringLiteralDfa19_0(active0, 0L, active1, 0x10000ULL); case 79: return jjMoveStringLiteralDfa19_0(active0, 0x1000000ULL, active1, 0L); case 82: return jjMoveStringLiteralDfa19_0(active0, 0L, active1, 0x20000ULL); case 98: return jjMoveStringLiteralDfa19_0(active0, 0x100000000000000ULL, active1, 0L); case 101: if ((active0 & 0x20000000000000ULL) != 0L) return jjStartNfaWithStates_0(18, 53, 9); return jjMoveStringLiteralDfa19_0(active0, 0x8008000000000000ULL, active1, 0x408ULL); case 102: if ((active0 & 0x2000000000000ULL) != 0L) return jjStartNfaWithStates_0(18, 49, 9); break; case 105: return jjMoveStringLiteralDfa19_0(active0, 0x10000000000000ULL, active1, 0x800ULL); case 108: return jjMoveStringLiteralDfa19_0(active0, 0x400000000ULL, active1, 0x80ULL); case 109: if ((active0 & 0x20000000ULL) != 0L) return jjStartNfaWithStates_0(18, 29, 9); break; case 110: if ((active0 & 0x100000ULL) != 0L) return jjStartNfaWithStates_0(18, 20, 9); else if ((active0 & 0x800000ULL) != 0L) return jjStartNfaWithStates_0(18, 23, 9); else if ((active1 & 0x4000ULL) != 0L) return jjStartNfaWithStates_0(18, 78, 9); break; case 111: return jjMoveStringLiteralDfa19_0(active0, 0x3084000010000000ULL, active1, 0L); case 112: return jjMoveStringLiteralDfa19_0(active0, 0xa00000000000000ULL, active1, 0L); case 114: return jjMoveStringLiteralDfa19_0(active0, 0x440000000000000ULL, active1, 0x8200ULL); case 116: return jjMoveStringLiteralDfa19_0(active0, 0x100300000000ULL, active1, 0x1001ULL); default : break; } return jjStartNfa_0(17, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa19_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(17, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(18, active0, active1); return 19; } curChar = input_stream->readChar(); switch(curChar) { case 97: return jjMoveStringLiteralDfa20_0(active0, 0L, active1, 0x20000ULL); case 101: return jjMoveStringLiteralDfa20_0(active0, 0xa00000000000000ULL, active1, 0L); case 102: if ((active0 & 0x1000000ULL) != 0L) return jjStartNfaWithStates_0(19, 24, 9); break; case 105: return jjMoveStringLiteralDfa20_0(active0, 0x400000000ULL, active1, 0x1ULL); case 106: return jjMoveStringLiteralDfa20_0(active0, 0x100000000000000ULL, active1, 0L); case 109: if ((active0 & 0x10000000ULL) != 0L) return jjStartNfaWithStates_0(19, 28, 9); break; case 110: if ((active0 & 0x10000000000000ULL) != 0L) return jjStartNfaWithStates_0(19, 52, 9); break; case 111: return jjMoveStringLiteralDfa20_0(active0, 0x400000000000000ULL, active1, 0x10800ULL); case 112: return jjMoveStringLiteralDfa20_0(active0, 0x3084000000000000ULL, active1, 0L); case 114: return jjMoveStringLiteralDfa20_0(active0, 0x8008000000000000ULL, active1, 0x408ULL); case 115: if ((active1 & 0x80ULL) != 0L) return jjStartNfaWithStates_0(19, 71, 9); break; case 116: return jjMoveStringLiteralDfa20_0(active0, 0x40000000000000ULL, active1, 0x8200ULL); case 121: if ((active0 & 0x100000000ULL) != 0L) return jjStartNfaWithStates_0(19, 32, 9); else if ((active0 & 0x200000000ULL) != 0L) return jjStartNfaWithStates_0(19, 33, 9); else if ((active0 & 0x100000000000ULL) != 0L) return jjStartNfaWithStates_0(19, 44, 9); return jjMoveStringLiteralDfa20_0(active0, 0L, active1, 0x1000ULL); default : break; } return jjStartNfa_0(18, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa20_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(18, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(19, active0, active1); return 20; } curChar = input_stream->readChar(); switch(curChar) { case 65: return jjMoveStringLiteralDfa21_0(active0, 0L, active1, 0x1000ULL); case 101: return jjMoveStringLiteralDfa21_0(active0, 0x3184000000000000ULL, active1, 0x1ULL); case 105: return jjMoveStringLiteralDfa21_0(active0, 0x40000000000000ULL, active1, 0x200ULL); case 109: return jjMoveStringLiteralDfa21_0(active0, 0L, active1, 0x10000ULL); case 110: if ((active1 & 0x800ULL) != 0L) return jjStartNfaWithStates_0(20, 75, 9); return jjMoveStringLiteralDfa21_0(active0, 0L, active1, 0x20000ULL); case 112: return jjMoveStringLiteralDfa21_0(active0, 0x400000000000000ULL, active1, 0L); case 114: return jjMoveStringLiteralDfa21_0(active0, 0xa00000000000000ULL, active1, 0L); case 116: return jjMoveStringLiteralDfa21_0(active0, 0x8008000400000000ULL, active1, 0x408ULL); case 121: return jjMoveStringLiteralDfa21_0(active0, 0L, active1, 0x8000ULL); default : break; } return jjStartNfa_0(19, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa21_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(19, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(20, active0, active1); return 21; } curChar = input_stream->readChar(); switch(curChar) { case 79: return jjMoveStringLiteralDfa22_0(active0, 0L, active1, 0x8000ULL); case 97: return jjMoveStringLiteralDfa22_0(active0, 0L, active1, 0x10000ULL); case 99: return jjMoveStringLiteralDfa22_0(active0, 0x100000000000000ULL, active1, 0L); case 101: return jjMoveStringLiteralDfa22_0(active0, 0x440000000000000ULL, active1, 0L); case 103: return jjMoveStringLiteralDfa22_0(active0, 0L, active1, 0x20000ULL); case 105: return jjMoveStringLiteralDfa22_0(active0, 0x8008000000000000ULL, active1, 0L); case 111: return jjMoveStringLiteralDfa22_0(active0, 0L, active1, 0x200ULL); case 114: return jjMoveStringLiteralDfa22_0(active0, 0x3084000000000000ULL, active1, 0L); case 115: if ((active1 & 0x1ULL) != 0L) return jjStartNfaWithStates_0(21, 64, 9); return jjMoveStringLiteralDfa22_0(active0, 0L, active1, 0x1000ULL); case 116: return jjMoveStringLiteralDfa22_0(active0, 0xa00000000000000ULL, active1, 0L); case 121: if ((active0 & 0x400000000ULL) != 0L) return jjStartNfaWithStates_0(21, 34, 9); else if ((active1 & 0x8ULL) != 0L) return jjStartNfaWithStates_0(21, 67, 9); return jjMoveStringLiteralDfa22_0(active0, 0L, active1, 0x400ULL); default : break; } return jjStartNfa_0(20, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa22_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(20, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(21, active0, active1); return 22; } curChar = input_stream->readChar(); switch(curChar) { case 65: return jjMoveStringLiteralDfa23_0(active0, 0L, active1, 0x400ULL); case 101: if ((active1 & 0x20000ULL) != 0L) return jjStartNfaWithStates_0(22, 81, 9); return jjMoveStringLiteralDfa23_0(active0, 0x8008000000000000ULL, active1, 0L); case 102: if ((active1 & 0x8000ULL) != 0L) return jjStartNfaWithStates_0(22, 79, 9); break; case 105: return jjMoveStringLiteralDfa23_0(active0, 0L, active1, 0x10000ULL); case 110: if ((active1 & 0x200ULL) != 0L) return jjStartNfaWithStates_0(22, 73, 9); break; case 114: return jjMoveStringLiteralDfa23_0(active0, 0x400000000000000ULL, active1, 0L); case 115: if ((active0 & 0x40000000000000ULL) != 0L) return jjStartNfaWithStates_0(22, 54, 9); return jjMoveStringLiteralDfa23_0(active0, 0L, active1, 0x1000ULL); case 116: return jjMoveStringLiteralDfa23_0(active0, 0x3184000000000000ULL, active1, 0L); case 121: if ((active0 & 0x200000000000000ULL) != 0L) return jjStartNfaWithStates_0(22, 57, 9); else if ((active0 & 0x800000000000000ULL) != 0L) return jjStartNfaWithStates_0(22, 59, 9); break; default : break; } return jjStartNfa_0(21, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa23_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(21, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(22, active0, active1); return 23; } curChar = input_stream->readChar(); switch(curChar) { case 80: return jjMoveStringLiteralDfa24_0(active0, 0x100000000000000ULL, active1, 0L); case 101: return jjMoveStringLiteralDfa24_0(active0, 0L, active1, 0x1000ULL); case 105: return jjMoveStringLiteralDfa24_0(active0, 0x4000000000000ULL, active1, 0L); case 110: if ((active1 & 0x10000ULL) != 0L) return jjStartNfaWithStates_0(23, 80, 9); break; case 115: if ((active0 & 0x8000000000000ULL) != 0L) return jjStartNfaWithStates_0(23, 51, 9); else if ((active0 & 0x8000000000000000ULL) != 0L) return jjStartNfaWithStates_0(23, 63, 9); return jjMoveStringLiteralDfa24_0(active0, 0L, active1, 0x400ULL); case 116: return jjMoveStringLiteralDfa24_0(active0, 0x400000000000000ULL, active1, 0L); case 121: if ((active0 & 0x80000000000000ULL) != 0L) return jjStartNfaWithStates_0(23, 55, 9); else if ((active0 & 0x1000000000000000ULL) != 0L) return jjStartNfaWithStates_0(23, 60, 9); else if ((active0 & 0x2000000000000000ULL) != 0L) return jjStartNfaWithStates_0(23, 61, 9); break; default : break; } return jjStartNfa_0(22, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa24_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(22, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(23, active0, active1); return 24; } curChar = input_stream->readChar(); switch(curChar) { case 101: return jjMoveStringLiteralDfa25_0(active0, 0x4000000000000ULL, active1, 0L); case 114: return jjMoveStringLiteralDfa25_0(active0, 0x100000000000000ULL, active1, 0x1000ULL); case 115: return jjMoveStringLiteralDfa25_0(active0, 0L, active1, 0x400ULL); case 121: if ((active0 & 0x400000000000000ULL) != 0L) return jjStartNfaWithStates_0(24, 58, 9); break; default : break; } return jjStartNfa_0(23, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa25_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(23, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(24, active0, active1); return 25; } curChar = input_stream->readChar(); switch(curChar) { case 101: return jjMoveStringLiteralDfa26_0(active0, 0L, active1, 0x400ULL); case 111: return jjMoveStringLiteralDfa26_0(active0, 0x100000000000000ULL, active1, 0L); case 115: if ((active0 & 0x4000000000000ULL) != 0L) return jjStartNfaWithStates_0(25, 50, 9); break; case 116: return jjMoveStringLiteralDfa26_0(active0, 0L, active1, 0x1000ULL); default : break; } return jjStartNfa_0(24, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa26_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(24, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(25, active0, active1); return 26; } curChar = input_stream->readChar(); switch(curChar) { case 105: return jjMoveStringLiteralDfa27_0(active0, 0L, active1, 0x1000ULL); case 112: return jjMoveStringLiteralDfa27_0(active0, 0x100000000000000ULL, active1, 0L); case 114: return jjMoveStringLiteralDfa27_0(active0, 0L, active1, 0x400ULL); default : break; } return jjStartNfa_0(25, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa27_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(25, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(26, active0, active1); return 27; } curChar = input_stream->readChar(); switch(curChar) { case 101: return jjMoveStringLiteralDfa28_0(active0, 0x100000000000000ULL, active1, 0L); case 111: return jjMoveStringLiteralDfa28_0(active0, 0L, active1, 0x1000ULL); case 116: return jjMoveStringLiteralDfa28_0(active0, 0L, active1, 0x400ULL); default : break; } return jjStartNfa_0(26, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa28_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(26, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(27, active0, active1); return 28; } curChar = input_stream->readChar(); switch(curChar) { case 105: return jjMoveStringLiteralDfa29_0(active0, 0L, active1, 0x400ULL); case 110: if ((active1 & 0x1000ULL) != 0L) return jjStartNfaWithStates_0(28, 76, 9); break; case 114: return jjMoveStringLiteralDfa29_0(active0, 0x100000000000000ULL, active1, 0L); default : break; } return jjStartNfa_0(27, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa29_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(27, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(28, active0, active1); return 29; } curChar = input_stream->readChar(); switch(curChar) { case 111: return jjMoveStringLiteralDfa30_0(active0, 0L, active1, 0x400ULL); case 116: return jjMoveStringLiteralDfa30_0(active0, 0x100000000000000ULL, active1, 0L); default : break; } return jjStartNfa_0(28, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa30_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1){ if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(28, old0, old1); if (input_stream->endOfInput()) { jjStopStringLiteralDfa_0(29, active0, active1); return 30; } curChar = input_stream->readChar(); switch(curChar) { case 110: if ((active1 & 0x400ULL) != 0L) return jjStartNfaWithStates_0(30, 74, 9); break; case 121: if ((active0 & 0x100000000000000ULL) != 0L) return jjStartNfaWithStates_0(30, 56, 9); break; default : break; } return jjStartNfa_0(29, active0, active1); } int OWL2FunctionalStyleParserTokenManager::jjStartNfaWithStates_0(int pos, int kind, int state){ jjmatchedKind = kind; jjmatchedPos = pos; if (input_stream->endOfInput()) { return pos + 1; } curChar = input_stream->readChar(); return jjMoveNfa_0(state, pos + 1); } int OWL2FunctionalStyleParserTokenManager::jjMoveNfa_0(int startState, int curPos){ int startsAt = 0; jjnewStateCnt = 9; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { unsigned long long l = 1ULL << curChar; if (l == 1); do { switch(jjstateSet[--i]) { case 9: if ((0x3ff600000000000ULL & l) != 0L) { jjCheckNAddTwoStates(6, 7); } else if (curChar == 58) { if (kind > 84) kind = 84; } if ((0x3ff200000000000ULL & l) != 0L) jjstateSet[jjnewStateCnt++] = 8; break; case 1: if ((0x3ff000000000000ULL & l) != 0L) { if (kind > 82) kind = 82; { jjCheckNAdd(0); } } else if (curChar == 58) { if (kind > 84) kind = 84; } break; case 0: if ((0x3ff000000000000ULL & l) == 0L) break; if (kind > 82) kind = 82; { jjCheckNAdd(0); } break; case 3: if (curChar == 45) { jjCheckNAdd(4); } break; case 4: if ((0x3ff000000000000ULL & l) == 0L) break; if (kind > 83) kind = 83; { jjCheckNAddTwoStates(3, 4); } break; case 6: if ((0x3ff600000000000ULL & l) != 0L) { jjCheckNAddTwoStates(6, 7); } break; case 7: if ((0x3ff200000000000ULL & l) != 0L) jjstateSet[jjnewStateCnt++] = 8; break; case 8: if (curChar == 58) kind = 84; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { unsigned long long l = 1ULL << (curChar & 077); if (l == 1); do { switch(jjstateSet[--i]) { case 9: if ((0x7fffffe87fffffeULL & l) != 0L) { jjCheckNAdd(8); } if ((0x7fffffe87fffffeULL & l) != 0L) { jjCheckNAddTwoStates(6, 7); } break; case 1: if ((0x7fffffe07fffffeULL & l) != 0L) { jjCheckNAddStates(0, 2); } else if (curChar == 64) { jjCheckNAdd(2); } break; case 2: if ((0x7fffffe07fffffeULL & l) == 0L) break; if (kind > 83) kind = 83; { jjCheckNAddTwoStates(2, 3); } break; case 4: if ((0x7fffffe07fffffeULL & l) == 0L) break; if (kind > 83) kind = 83; { jjCheckNAddTwoStates(3, 4); } break; case 5: if ((0x7fffffe07fffffeULL & l) != 0L) { jjCheckNAddStates(0, 2); } break; case 6: if ((0x7fffffe87fffffeULL & l) != 0L) { jjCheckNAddTwoStates(6, 7); } break; case 7: if ((0x7fffffe87fffffeULL & l) != 0L) { jjCheckNAdd(8); } break; default : break; } } while(i != startsAt); } else { int hiByte = (curChar >> 8); int i1 = hiByte >> 6; unsigned long long l1 = 1ULL << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; unsigned long long l2 = 1ULL << (curChar & 077); do { switch(jjstateSet[--i]) { case 9: if (jjCanMove_1(hiByte, i1, i2, l1, l2)) { jjCheckNAddTwoStates(6, 7); } if (jjCanMove_1(hiByte, i1, i2, l1, l2)) { jjCheckNAdd(8); } break; case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { jjCheckNAddStates(0, 2); } break; case 6: if (jjCanMove_1(hiByte, i1, i2, l1, l2)) { jjCheckNAddTwoStates(6, 7); } break; case 7: if (jjCanMove_1(hiByte, i1, i2, l1, l2)) { jjCheckNAdd(8); } break; default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt), (jjnewStateCnt = startsAt), (i == (startsAt = 9 - startsAt))) return curPos; if (input_stream->endOfInput()) { return curPos; } curChar = input_stream->readChar(); } } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa0_3(){ return jjMoveNfa_3(0, 0); } int OWL2FunctionalStyleParserTokenManager::jjMoveNfa_3(int startState, int curPos){ int startsAt = 0; jjnewStateCnt = 3; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { unsigned long long l = 1ULL << curChar; if (l == 1); do { switch(jjstateSet[--i]) { case 0: if ((0x3ff000000000000ULL & l) == 0L) break; if (kind > 96) kind = 96; { jjCheckNAddTwoStates(1, 2); } break; case 1: if ((0x3ff600000000000ULL & l) != 0L) { jjCheckNAddTwoStates(1, 2); } break; case 2: if ((0x3ff200000000000ULL & l) != 0L && kind > 96) kind = 96; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { unsigned long long l = 1ULL << (curChar & 077); if (l == 1); do { switch(jjstateSet[--i]) { case 0: if ((0x7fffffe87fffffeULL & l) == 0L) break; if (kind > 96) kind = 96; { jjCheckNAddTwoStates(1, 2); } break; case 1: if ((0x7fffffe87fffffeULL & l) != 0L) { jjCheckNAddTwoStates(1, 2); } break; case 2: if ((0x7fffffe87fffffeULL & l) != 0L && kind > 96) kind = 96; break; default : break; } } while(i != startsAt); } else { int hiByte = (curChar >> 8); int i1 = hiByte >> 6; unsigned long long l1 = 1ULL << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; unsigned long long l2 = 1ULL << (curChar & 077); do { switch(jjstateSet[--i]) { case 0: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 96) kind = 96; { jjCheckNAddTwoStates(1, 2); } break; case 1: if (jjCanMove_1(hiByte, i1, i2, l1, l2)) { jjCheckNAddTwoStates(1, 2); } break; case 2: if (jjCanMove_1(hiByte, i1, i2, l1, l2) && kind > 96) kind = 96; break; default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt), (jjnewStateCnt = startsAt), (i == (startsAt = 3 - startsAt))) return curPos; if (input_stream->endOfInput()) { return curPos; } curChar = input_stream->readChar(); } } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa0_5(){ switch(curChar) { case 34: return jjStopAtPos(0, 99); default : return 1; } } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa0_1(){ return jjMoveNfa_1(0, 0); } int OWL2FunctionalStyleParserTokenManager::jjMoveNfa_1(int startState, int curPos){ int startsAt = 0; jjnewStateCnt = 1; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { unsigned long long l = 1ULL << curChar; if (l == 1); do { switch(jjstateSet[--i]) { case 0: if ((0xaffffffa00000000ULL & l) == 0L) break; kind = 94; jjstateSet[jjnewStateCnt++] = 0; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { unsigned long long l = 1ULL << (curChar & 077); if (l == 1); do { switch(jjstateSet[--i]) { case 0: if ((0xc7fffffeafffffffULL & l) == 0L) break; kind = 94; jjstateSet[jjnewStateCnt++] = 0; break; default : break; } } while(i != startsAt); } else { int hiByte = (curChar >> 8); int i1 = hiByte >> 6; unsigned long long l1 = 1ULL << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; unsigned long long l2 = 1ULL << (curChar & 077); do { switch(jjstateSet[--i]) { case 0: if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) break; if (kind > 94) kind = 94; jjstateSet[jjnewStateCnt++] = 0; break; default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt), (jjnewStateCnt = startsAt), (i == (startsAt = 1 - startsAt))) return curPos; if (input_stream->endOfInput()) { return curPos; } curChar = input_stream->readChar(); } } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa0_6(){ switch(curChar) { case 10: return jjStopAtPos(0, 100); case 13: return jjStopAtPos(0, 101); default : return 1; } } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa0_2(){ switch(curChar) { case 62: return jjStopAtPos(0, 95); default : return 1; } } int OWL2FunctionalStyleParserTokenManager::jjMoveStringLiteralDfa0_4(){ return jjMoveNfa_4(3, 0); } int OWL2FunctionalStyleParserTokenManager::jjMoveNfa_4(int startState, int curPos){ int startsAt = 0; jjnewStateCnt = 3; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { unsigned long long l = 1ULL << curChar; if (l == 1); do { switch(jjstateSet[--i]) { case 3: case 0: if ((0xfffffffbffffffffULL & l) == 0L) break; if (kind > 98) kind = 98; { jjCheckNAddTwoStates(0, 1); } break; case 2: if ((0x8400000000ULL & l) == 0L) break; if (kind > 98) kind = 98; { jjCheckNAddTwoStates(0, 1); } break; default : break; } } while(i != startsAt); } else if (curChar < 128) { unsigned long long l = 1ULL << (curChar & 077); if (l == 1); do { switch(jjstateSet[--i]) { case 3: if ((0xffffffffefffffffULL & l) != 0L) { if (kind > 98) kind = 98; { jjCheckNAddTwoStates(0, 1); } } else if (curChar == 92) jjstateSet[jjnewStateCnt++] = 2; break; case 0: if ((0xffffffffefffffffULL & l) == 0L) break; kind = 98; { jjCheckNAddTwoStates(0, 1); } break; case 1: if (curChar == 92) jjstateSet[jjnewStateCnt++] = 2; break; case 2: if (curChar != 92) break; if (kind > 98) kind = 98; { jjCheckNAddTwoStates(0, 1); } break; default : break; } } while(i != startsAt); } else { int hiByte = (curChar >> 8); int i1 = hiByte >> 6; unsigned long long l1 = 1ULL << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; unsigned long long l2 = 1ULL << (curChar & 077); do { switch(jjstateSet[--i]) { case 3: case 0: if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) break; if (kind > 98) kind = 98; { jjCheckNAddTwoStates(0, 1); } break; default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt), (jjnewStateCnt = startsAt), (i == (startsAt = 3 - startsAt))) return curPos; if (input_stream->endOfInput()) { return curPos; } curChar = input_stream->readChar(); } } bool OWL2FunctionalStyleParserTokenManager::jjCanMove_0(int hiByte, int i1, int i2, unsigned long long l1, unsigned long long l2){ switch(hiByte) { case 0: return ((jjbitVec2[i2] & l2) != 0L); case 3: return ((jjbitVec3[i2] & l2) != 0L); case 32: return ((jjbitVec4[i2] & l2) != 0L); case 33: return ((jjbitVec5[i2] & l2) != 0L); case 47: return ((jjbitVec6[i2] & l2) != 0L); case 48: return ((jjbitVec7[i2] & l2) != 0L); case 253: return ((jjbitVec8[i2] & l2) != 0L); case 255: return ((jjbitVec9[i2] & l2) != 0L); default : if ((jjbitVec0[i1] & l1) != 0L) return true; return false; } } bool OWL2FunctionalStyleParserTokenManager::jjCanMove_1(int hiByte, int i1, int i2, unsigned long long l1, unsigned long long l2){ switch(hiByte) { case 0: return ((jjbitVec10[i2] & l2) != 0L); case 3: return ((jjbitVec11[i2] & l2) != 0L); case 32: return ((jjbitVec12[i2] & l2) != 0L); case 33: return ((jjbitVec5[i2] & l2) != 0L); case 47: return ((jjbitVec6[i2] & l2) != 0L); case 48: return ((jjbitVec7[i2] & l2) != 0L); case 253: return ((jjbitVec8[i2] & l2) != 0L); case 255: return ((jjbitVec9[i2] & l2) != 0L); default : if ((jjbitVec0[i1] & l1) != 0L) return true; return false; } } bool OWL2FunctionalStyleParserTokenManager::jjCanMove_2(int hiByte, int i1, int i2, unsigned long long l1, unsigned long long l2){ switch(hiByte) { case 0: return ((jjbitVec13[i2] & l2) != 0L); default : if ((jjbitVec7[i1] & l1) != 0L) return true; return false; } } /** Token literal values. */ Token * OWL2FunctionalStyleParserTokenManager::jjFillToken(){ Token *t; JAVACC_STRING_TYPE curTokenImage; int beginLine; int endLine; int beginColumn; int endColumn; if (jjmatchedPos < 0) { curTokenImage = image.c_str(); if (input_stream->getTrackLineColumn()) { beginLine = endLine = input_stream->getEndLine(); beginColumn = endColumn = input_stream->getEndColumn(); } } else { JAVACC_STRING_TYPE im = jjstrLiteralImages[jjmatchedKind]; curTokenImage = (im.length() == 0) ? input_stream->GetImage() : im; if (input_stream->getTrackLineColumn()) { beginLine = input_stream->getBeginLine(); beginColumn = input_stream->getBeginColumn(); endLine = input_stream->getEndLine(); endColumn = input_stream->getEndColumn(); } } t = Token::newToken(jjmatchedKind, curTokenImage); t->specialToken = NULL; t->next = NULL; if (input_stream->getTrackLineColumn()) { t->beginLine = beginLine; t->endLine = endLine; t->beginColumn = beginColumn; t->endColumn = endColumn; } return t; } const int defaultLexState = 0; /** Get the next Token. */ Token * OWL2FunctionalStyleParserTokenManager::getNextToken(){ Token *matchedToken; int curPos = 0; for (;;) { EOFLoop: if (input_stream->endOfInput()) { jjmatchedKind = 0; jjmatchedPos = -1; matchedToken = jjFillToken(); return matchedToken; } curChar = input_stream->BeginToken(); image = jjimage; image.clear(); jjimageLen = 0; switch(curLexState) { case 0: { input_stream->backup(0); while (curChar <= 32 && (0x100002600ULL & (1ULL << curChar)) != 0L) { if (input_stream->endOfInput()) { goto EOFLoop; } curChar = input_stream->BeginToken(); } } jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_0(); break; case 1: jjmatchedKind = 94; jjmatchedPos = -1; curPos = 0; curPos = jjMoveStringLiteralDfa0_1(); break; case 2: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_2(); break; case 3: jjmatchedKind = 97; jjmatchedPos = -1; curPos = 0; curPos = jjMoveStringLiteralDfa0_3(); break; case 4: jjmatchedKind = 98; jjmatchedPos = -1; curPos = 0; curPos = jjMoveStringLiteralDfa0_4(); break; case 5: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_5(); break; case 6: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_6(); if (jjmatchedPos == 0 && jjmatchedKind > 102) { jjmatchedKind = 102; } break; } if (jjmatchedKind != 0x7fffffff) { if (jjmatchedPos + 1 < curPos) input_stream->backup(curPos - jjmatchedPos - 1); if ((jjtoToken[jjmatchedKind >> 6] & (1ULL << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); TokenLexicalActions(matchedToken); if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind]; return matchedToken; } else { SkipLexicalActions(NULL); if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind]; goto EOFLoop; } } int error_line = input_stream->getEndLine(); int error_column = input_stream->getEndColumn(); JAVACC_STRING_TYPE error_after; bool EOFSeen = false; if (input_stream->endOfInput()) { EOFSeen = true; error_after = curPos <= 1 ? EMPTY : input_stream->GetImage(); if (curChar == '\n' || curChar == '\r') { error_line++; error_column = 0; } else error_column++; } if (!EOFSeen) { error_after = curPos <= 1 ? EMPTY : input_stream->GetImage(); } lexicalError(); } } void OWL2FunctionalStyleParserTokenManager::SkipLexicalActions(Token *matchedToken){ switch(jjmatchedKind) { default : break; } } void OWL2FunctionalStyleParserTokenManager::TokenLexicalActions(Token *matchedToken){ switch(jjmatchedKind) { default : break; } } /** Reinitialise parser. */ void OWL2FunctionalStyleParserTokenManager::ReInit(JAVACC_CHARSTREAM *stream, int lexState, OWL2FunctionalStyleParser *parserArg) { if (input_stream) delete input_stream; jjmatchedPos = jjnewStateCnt = 0; curLexState = lexState; input_stream = stream; ReInitRounds(); debugStream = stdout; // init SwitchTo(lexState); parser = parserArg; } void OWL2FunctionalStyleParserTokenManager::ReInitRounds() { int i; jjround = 0x80000001; for (i = 9; i-- > 0;) jjrounds[i] = 0x80000000; } /** Switch to specified lex state. */ void OWL2FunctionalStyleParserTokenManager::SwitchTo(int lexState) { if (lexState >= 7 || lexState < 0) assert(false); //throw 1;//new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); else curLexState = lexState; } /** Constructor. */ OWL2FunctionalStyleParserTokenManager::OWL2FunctionalStyleParserTokenManager (JAVACC_CHARSTREAM *stream, int lexState, OWL2FunctionalStyleParser *parserArg) : CTokenManager() { input_stream = NULL; ReInit(stream, lexState, parserArg); } // Destructor OWL2FunctionalStyleParserTokenManager::~OWL2FunctionalStyleParserTokenManager () { if (input_stream) delete input_stream; } } } } Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/CTokenBase.h0000644000175000017500000000332612520550734024626 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_FUNCTIONALJAVACC_CTOKENBASE_H #define KONCLUDE_PARSER_FUNCTIONALJAVACC_CTOKENBASE_H // Libraries includes #include // Namespace includes #include "FunctionalJAVACCSettings.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace FunctionalJAVACC { /*! * * \class CTokenBase * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CTokenBase { // public methods public: //! Constructor CTokenBase(); // protected methods protected: // protected variables protected: // private methods private: // private variables private: }; }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_FUNCTIONALJAVACC_CTOKENBASE_H Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/ErrorHandler.h0000644000175000017500000000373512315260742025242 0ustar jonasjonas/* Generated By:JavaCC: Do not edit this line. ErrorHandler.h Version 6.0 */ /* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ #ifndef ERRORHANDLER_H #define ERRORHANDLER_H #include #include "JavaCC.h" #include "Token.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { class OWL2FunctionalStyleParser; class ErrorHandler { protected: int error_count; public: // Called when the parser encounters a different token when expecting to // consume a specific kind of token. // expectedKind - token kind that the parser was trying to consume. // expectedToken - the image of the token - tokenImages[expectedKind]. // actual - the actual token that the parser got instead. virtual void handleUnexpectedToken(int expectedKind, JAVACC_STRING_TYPE expectedToken, Token *actual, OWL2FunctionalStyleParser *parser) { error_count++; fprintf(stderr, "Expecting %s at: %d:%d but got %s\n", addUnicodeEscapes(expectedToken).c_str(), actual->beginLine, actual->beginColumn, addUnicodeEscapes(actual->image).c_str()); } // Called when the parser cannot continue parsing. // last - the last token successfully parsed. // unexpected - the token at which the error occurs. // production - the production in which this error occurrs. virtual void handleParseError(Token *last, Token *unexpected, JAVACC_SIMPLE_STRING production, OWL2FunctionalStyleParser *parser) { error_count++; fprintf(stderr, "Encountered: %s at: %d:%d while parsing: %s\n", addUnicodeEscapes(unexpected->image).c_str(), unexpected->beginLine, unexpected->beginColumn, production.c_str()); } virtual int getErrorCount() { return error_count; } virtual ~ErrorHandler() {} ErrorHandler() { error_count = 0; } }; } } } #endif /* JavaCC - OriginalChecksum=0a367742c4600a1642742497f80bb97a (do not edit this line) */ Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/CQtIODeviceStreamReader.h0000644000175000017500000000412312520550734027202 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_FUNCTIONALJAVACC_CQtIODeviceStreamReader_H #define KONCLUDE_PARSER_FUNCTIONALJAVACC_CQtIODeviceStreamReader_H // Libraries includes #include // Namespace includes #include "FunctionalJAVACCSettings.h" #include "CharStream.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace FunctionalJAVACC { /*! * * \class CQtIODeviceStreamReader * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CQtIODeviceStreamReader : public ReaderStream { // public methods public: //! Constructor CQtIODeviceStreamReader(QIODevice* device); // Read block of data into a buffer and return the actual number read. virtual size_t read(JAVACC_CHAR_TYPE *bufptr, int offset, size_t len); virtual bool endOfInput(); // protected methods protected: // protected variables protected: QIODevice* mDevice; QString mConvBuffer; // private methods private: // private variables private: }; }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_FUNCTIONALJAVACC_CQtIODeviceStreamReader_H Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/TokenManager.h0000644000175000017500000000161712315260742025223 0ustar jonasjonas/* Generated By:JavaCC: Do not edit this line. TokenManager.h Version 6.0 */ /* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ #ifndef TOKENMANAGER_H #define TOKENMANAGER_H #include "JavaCC.h" #include "Token.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { /** * An implementation for this interface is generated by * JavaCCParser. The user is free to use any implementation * of their choice. */ class TokenManager { public: /** This gets the next token from the input stream. * A token of kind 0 () should be returned on EOF. */ public: virtual Token *getNextToken() = 0; public: virtual ~TokenManager() { } public: virtual void lexicalError() { fprintf(stderr, "Lexical error encountered"); } }; } } } #endif /* JavaCC - OriginalChecksum=d9157ca0e283dcf3c0c6cbe0c7f08a29 (do not edit this line) */ Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/CQtIODeviceStreamReader.cpp0000644000175000017500000000502612520550734027540 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CQtIODeviceStreamReader.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { CQtIODeviceStreamReader::CQtIODeviceStreamReader(QIODevice* device) : mDevice(device) { } size_t CQtIODeviceStreamReader::read(JAVACC_CHAR_TYPE *bufptr, int offset, size_t len) { int remainingLength = len; size_t readSize = 0; if (!mConvBuffer.isEmpty()) { int length = mConvBuffer.length(); int copyLength = qMin(remainingLength,length); for (int i = 0; i < copyLength; ++i) { bufptr[offset+i] = mConvBuffer[i].unicode(); } remainingLength = remainingLength - copyLength; offset += copyLength; if (copyLength == length) { mConvBuffer.clear(); } else { mConvBuffer = mConvBuffer.mid(copyLength); } readSize += copyLength; } if (!mDevice->atEnd() && remainingLength > 0 && mConvBuffer.isEmpty()) { QByteArray lineByteData(mDevice->readLine()); mConvBuffer = QString::fromUtf8(lineByteData.constData(),lineByteData.length()); if (!mConvBuffer.isEmpty()) { int length = mConvBuffer.length(); int copyLength = qMin(remainingLength,length); for (int i = 0; i < copyLength; ++i) { bufptr[offset+i] = mConvBuffer[i].unicode(); } remainingLength = remainingLength - copyLength; offset += copyLength; if (copyLength == length) { mConvBuffer.clear(); } else { mConvBuffer = mConvBuffer.mid(copyLength); } readSize += copyLength; } } return readSize; } bool CQtIODeviceStreamReader::endOfInput() { return mConvBuffer.isEmpty() && mDevice->atEnd(); } }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/COWL2FunctionalStyleParserErrorHandler.cppKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/COWL2FunctionalStyleParserErrorHandler0000644000175000017500000000414412520550734032000 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "COWL2FunctionalStyleParserErrorHandler.h" namespace Konclude { namespace Parser { namespace FunctionalJAVACC { COWL2FunctionalStyleParserErrorHandler::COWL2FunctionalStyleParserErrorHandler() { } void COWL2FunctionalStyleParserErrorHandler::handleUnexpectedToken(int expectedKind, JAVACC_STRING_TYPE expectedToken, Token *actual, OWL2FunctionalStyleParser *parser) { error_count++; mErrorString = QString("Expecting '%1' at line %2, column %3, but got '%4'.").arg(JAVACC_TO_QSTRING(expectedToken)).arg(actual->beginLine).arg(actual->beginColumn).arg(JAVACC_TO_QSTRING(actual->image)); } void COWL2FunctionalStyleParserErrorHandler::handleParseError(Token *last, Token *unexpected, JAVACC_SIMPLE_STRING production, OWL2FunctionalStyleParser *parser) { error_count++; mErrorString = QString("Encountered %1 at line %2, column %3 while parsing '%4'.").arg(JAVACC_TO_QSTRING(unexpected->image)).arg(unexpected->beginLine).arg(unexpected->beginColumn).arg(QString::fromStdString(production)); } bool COWL2FunctionalStyleParserErrorHandler::hasError() { return error_count >= 1; } QString COWL2FunctionalStyleParserErrorHandler::getErrorString() { return mErrorString; } }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/COWL2FunctionalJAVACCOntologyStreamParser.hKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/COWL2FunctionalJAVACCOntologyStreamPar0000644000175000017500000000522212520550734031512 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_COWL2FUNCTIONALJAVACCONTOLOGYSTREAMPARSER_H #define KONCLUDE_PARSER_COWL2FUNCTIONALJAVACCONTOLOGYSTREAMPARSER_H // Libraries includes // Namespace includes #include "CQtIODeviceStreamReader.h" #include "CConcreteOWL2FunctionalStyleParser.h" #include "COWL2FunctionalStyleParserTokenManager.h" #include "COWL2FunctionalStyleParserErrorHandler.h" // Other includes #include "Parser/COntologyBuilder.h" // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { namespace FunctionalJAVACC { /*! * * \class COWL2FunctionalJAVACCOntologyStreamParser * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWL2FunctionalJAVACCOntologyStreamParser { // public methods public: //! Constructor COWL2FunctionalJAVACCOntologyStreamParser(COntologyBuilder* ontologyBuilder); bool parseOntology(const QString& fileString); bool parseOntology(QIODevice* ioDevice); QString getParsingErrorString(); bool hasParsingError(); QString getErrorString(); bool hasError(); // protected methods protected: // protected variables protected: COntologyBuilder* mOntologyBuilder; CQtIODeviceStreamReader* mStreamReader; CharStream* mCharStream; COWL2FunctionalStyleParserTokenManager* mTokenManager; COWL2FunctionalStyleParserErrorHandler* mErrorHandler; CConcreteOWL2FunctionalStyleParser* mParser; QString mErrorString; QString mParsingErrorString; bool mParsingError; bool mError; // private methods private: // private variables private: }; }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_COWL2FUNCTIONALJAVACCONTOLOGYSTREAMPARSER_H ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootrootKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/COWL2FunctionalStyleParserErrorHandler.hKonclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/COWL2FunctionalStyleParserErrorHandler0000644000175000017500000000447112520550734032003 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_PARSER_FUNCTIONALJAVACC_COWL2FUNCTIONALSTYLEPARSERERRORHANDLER_H #define KONCLUDE_PARSER_FUNCTIONALJAVACC_COWL2FUNCTIONALSTYLEPARSERERRORHANDLER_H // Libraries includes #include // Namespace includes #include "FunctionalJAVACCSettings.h" #include "ErrorHandler.h" // Other includes // Logger includes #include "Logger/CLogger.h" using namespace Konclude::Logger; namespace Konclude { namespace Parser { using namespace Expression; namespace FunctionalJAVACC { /*! * * \class COWL2FunctionalStyleParserErrorHandler * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class COWL2FunctionalStyleParserErrorHandler : public ErrorHandler { // public methods public: //! Constructor COWL2FunctionalStyleParserErrorHandler(); virtual void handleUnexpectedToken(int expectedKind, JAVACC_STRING_TYPE expectedToken, Token *actual, OWL2FunctionalStyleParser *parser); virtual void handleParseError(Token *last, Token *unexpected, JAVACC_SIMPLE_STRING production, OWL2FunctionalStyleParser *parser); bool hasError(); QString getErrorString(); // protected methods protected: // protected variables protected: QString mErrorString; // private methods private: // private variables private: }; }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude #endif // KONCLUDE_PARSER_FUNCTIONALJAVACC_COWL2FUNCTIONALSTYLEPARSERERRORHANDLER_H Konclude-v0.6.2-544-SourceCode/Source/Parser/FunctionalJAVACC/FunctionalJAVACCSettings.h0000644000175000017500000000512312520551410027330 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_EXPRESSION_FUNCTIONALJAVACC_FUNCTIONALJAVACCSETTINGS #define KONCLUDE_EXPRESSION_FUNCTIONALJAVACC_FUNCTIONALJAVACCSETTINGS // Libraries includes // Namespace includes #include "JavaCC.h" // Other includes #include "Parser/ParserSettings.h" #include "Parser/COntologyBuilder.h" #include "Parser/Expressions/CBuildExpression.h" #include "Parser/Expressions/CDatatypeExpression.h" #include "Parser/Expressions/CDataLexicalValueExpression.h" // Logger includes namespace Konclude { namespace Parser { using namespace Expression; namespace FunctionalJAVACC { #ifndef JAVACC_TO_QSTRING_DEFINED #define JAVACC_TO_QSTRING_DEFINED #ifndef EXPLICIT_JAVACC_QSTRING_CONVERTION #define JAVACC_TO_QSTRING(s) QString::fromStdWString(s) #else class JAVACCToQStringConverter { public: static const QString convertJAVACCToQString(JAVACC_STRING_TYPE string) { QString qstring; qstring.reserve(string.size()); for (JAVACC_STRING_TYPE::const_iterator it = string.cbegin(), itEnd = string.cend(); it != itEnd; ++it) { JAVACC_CHAR_TYPE character = *it; uint unicode = (uint)character; qstring.append(QChar(unicode)); } return qstring; } }; #define JAVACC_TO_QSTRING(s) JAVACCToQStringConverter::convertJAVACCToQString(s) #endif #endif /*! * * \file FunctionalJAVACCSettings * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ // forward declarations typedef CBuildExpression* CBuildExpressionPtr; typedef CDatatypeExpression* CDatatypeExpressionPtr; typedef CDataLexicalValueExpression* CDataLexicalValueExpressionPtr; }; // end namespace FunctionalJAVACC }; // end namespace Parser }; // end namespace Konclude #endif // end KONCLUDE_EXPRESSION_FUNCTIONALJAVACC_FUNCTIONALJAVACCSETTINGSKonclude-v0.6.2-544-SourceCode/Source/Parser/CParsingExpressionSplitter.h0000644000175000017500000001001012520550736025201 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #ifndef KONCLUDE_REASONER_GENERATOR_CPARSINGEXPRESSIONSPLITTER_H #define KONCLUDE_REASONER_GENERATOR_CPARSINGEXPRESSIONSPLITTER_H // Libraries includes #include #include #include #include // Namespace includes // Other includes #include "Parser/Expressions/CClassTermExpression.h" #include "Parser/Expressions/CObjectPropertyTermExpression.h" #include "Parser/Expressions/CIndividualTermExpression.h" #include "Parser/Expressions/CObjectIndividualVariableExpression.h" // Logger includes #include "Logger/CLogger.h" namespace Konclude { using namespace Utilities; using namespace Parser::Expression; namespace Parser { /*! * * \class CParsingExpressionSplitter * \author Andreas Steigmiller * \version 0.1 * \brief TODO * */ class CParsingExpressionSplitter { // public methods public: //! Constructor CParsingExpressionSplitter(const CEXPRESSIONLIST& expressions); CParsingExpressionSplitter(CEXPRESSIONLIST* expressions); CParsingExpressionSplitter(CBuildExpression* expression1 = nullptr, CBuildExpression* expression2 = nullptr, CBuildExpression* expression3 = nullptr); //! Destructor virtual ~CParsingExpressionSplitter(); bool proofExpressionComposition(cint64 requiredClassExpressions, cint64 requiredObjectPropertyExpressions = 0, cint64 requiredIndividualExpressions = 0, cint64 requiredVariableExpressions = 0, cint64 requiredNotVariableExpressions = 0); CEXPRESSIONLIST* getClassTermExpressionList(); CEXPRESSIONLIST* getObjectPropertyTermExpressionList(); CEXPRESSIONLIST* getIndividualTermExpressionList(); CEXPRESSIONLIST* getClassVariableTermExpressionList(); CEXPRESSIONLIST* getClassNotVariableTermExpressionList(); CClassTermExpression* getFirstClassTermExpression(); CClassTermExpression* getFirstOptionalClassTermExpression(); CClassTermExpression* getSecondClassTermExpression(); CObjectPropertyTermExpression* getFirstObjectPropertyTermExpression(); CObjectPropertyTermExpression* getSecondObjectPropertyTermExpression(); CIndividualTermExpression* getFirstIndividualTermExpression(); CIndividualTermExpression* getSecondIndividualTermExpression(); CObjectIndividualVariableExpression* getFirstClassVariableTermExpression(); CObjectIndividualVariableExpression* getSecondClassVariableTermExpression(); // protected methods protected: bool splitExpressions(); // protected variables protected: CEXPRESSIONLIST mExpressionList; CEXPRESSIONLIST mClassList; CEXPRESSIONLIST mObjectPropertyList; CEXPRESSIONLIST mIndiList; CEXPRESSIONLIST mObjIndiVarList; CEXPRESSIONLIST mNotObjIndiVarList; // private methods private: // private variables private: }; }; // end namespace Parser }; // end namespace Konclude #endif // end KONCLUDE_REASONER_GENERATOR_CPARSINGEXPRESSIONSPLITTER_H Konclude-v0.6.2-544-SourceCode/Source/CKoncludeInfo.cpp0000644000175000017500000000642112520756430021460 0ustar jonasjonas/* * Copyright (C) 2013, 2014, 2015 by the Konclude Developer Team. * * This file is part of the reasoning system Konclude. * For details and support, see . * * Konclude is free software: you can redistribute it and/or modify it under * the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) * as published by the Free Software Foundation. * * You should have received a copy of the GNU Lesser General Public License * along with Konclude. If not, see . * * Konclude is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more * details, see GNU Lesser General Public License. * */ #include "CKoncludeInfo.h" #include "revision-git.h" namespace Konclude { CKoncludeInfo::CKoncludeInfo() { } QString CKoncludeInfo::getKoncludeName() { return KONCLUDE_NAME; } QString CKoncludeInfo::getKoncludeNameExtension() { return KONCLUDE_NAME_EXTENSION; } QString CKoncludeInfo::getKoncludeDescription() { return KONCLUDE_DESCRIPTION; } QString CKoncludeInfo::getKoncludeVersionString() { return QString(KONCLUDE_VERSION_GIT_TAG_NAME_STRING)+QString("-%1 - ").arg(KONCLUDE_VERSION_GIT_REVISION_NUMBER)+QString(KONCLUDE_VERSION_GIT_REVISION_HASH_STRING); } QString CKoncludeInfo::getKoncludeCompilationDateString() { return QString(__DATE__); } QString CKoncludeInfo::getKoncludeBitPlatformString() { return QString("%1-bit").arg(sizeof(void*)*8); } int CKoncludeInfo::getKoncludeMajorVersionNumber() { int majorVersionNumber = KONCLUDE_VERSION_MAJOR; QStringList splittedList = QString(KONCLUDE_VERSION_GIT_TAG_NAME_STRING).split("."); if (splittedList.count() >= 3) { QString majorVersionString = splittedList.first(); bool successfulConverted = false; int majorVersionNumberConv = majorVersionString.toInt(&successfulConverted); if (successfulConverted) { majorVersionNumber = majorVersionNumberConv; } } return majorVersionNumber; } int CKoncludeInfo::getKoncludeMinorVersionNumber() { int minorVersionNumber = KONCLUDE_VERSION_MINOR; QStringList splittedList = QString(KONCLUDE_VERSION_GIT_TAG_NAME_STRING).split("."); if (splittedList.count() >= 3) { QString minorVersionString = splittedList.at(1); bool successfulConverted = false; int minorVersionNumberConv = minorVersionString.toInt(&successfulConverted); if (successfulConverted) { minorVersionNumber = minorVersionNumberConv; } } return minorVersionNumber; } int CKoncludeInfo::getKoncludeBuildVersionNumber() { int buildVersionNumber = KONCLUDE_VERSION_BUILD; QStringList splittedList = QString(KONCLUDE_VERSION_GIT_TAG_NAME_STRING).split("."); if (splittedList.count() >= 3) { QString buildVersionString = splittedList.at(2); bool successfulConverted = false; int buildVersionNumberConv = buildVersionString.toInt(&successfulConverted); if (successfulConverted) { buildVersionNumber = buildVersionNumberConv; } } return buildVersionNumber; } int CKoncludeInfo::getKoncludeRevisionVersionNumber() { int revisionVersionNumber = KONCLUDE_VERSION_GIT_REVISION_NUMBER; return revisionVersionNumber; } }; // end namespace Konclude Konclude-v0.6.2-544-SourceCode/Readme.txt0000644000175000017500000001655112613407520016770 0ustar jonasjonasOVERVIEW ========== Konclude is a tableau-based reasoner for the Description Logic SROIQV(D) (SROIQ(D) + Nominal Schemas). Konclude is still under active development and the current version probably contains bugs and other errors. If you detect an unexpected/strange behaviour you are cordially invited to report it. See http://konclude.com/feedback.html for details. LICENSING =========== Konclude is released as free software, i.e., you can redistribute it and/or modify it under the terms of version 2.1 of the GNU Lesser General Public License (LGPL2.1) as published by the Free Software Foundation. You should have received a copy of the GNU Lesser General Public License along with Konclude. If not, see http://www.gnu.org/licenses/. Konclude is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details see GNU Lesser General Public License. Konclude uses the following libraries: - Qt 4.8.* or above, released unter LGPL 2.1 (http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html). Note, Konclude uses slightly modified versions of Qt containers (QMap, QHash, QList) for an integrated memory management. USAGE ======= The binaries of Konclude (and possibly some shared libraries) are located in the './Binaries ' directory. However, you can use the starter scripts in the main directory for directly invoking Konclude with "Konclude" (Windows) or "./Konclude" (Linux, Mac). The command line parameter '-h' shows the usage options for Konclude. Some examples are located in the './Tests' directory. See http://konclude.com/ for detailed usage instructions. - COMMAND LINE: Basic reasoning tasks such as classification, consistency, class satisfiability and realisation can be directly invoked with the command line interface. For this, Konclude has to be called with the corresponding command ('classification', 'consistency', 'satisfiability', or 'realisation') and at least the input file has to be specified with '-i FILEPATH'. The output file is optional and can be set with the '-o FILEPATH' parameter. The class satisfiability checking additionally requires the IRI of the class that has to be tested, which has to be specified with '-x IRI'. Please note that Konclude currently only supports ontologies in the OWL 2 XML [1] or in the OWL 2 Functional Style format [2]. For ontologies in other syntaxes, you may use the protege editor [3] for converting ontologies into a supported format. Examples (on Windows you have to omit ./): ./Konclude classification -i Tests/roberts-family-full-D.owl.xml -o roberts-family-full-class-hierarchy.owl.xml ./Konclude satisfiability -i Tests/roberts-family-full-D.owl.xml -x http://www.co-ode.org/roberts/family-tree.owl#Aunt - OWLLINK: Furthermore, Konclude processes OWLlink [4] requests with the XML binding [5]. Konclude is optimised to read/write the OWLlink requests/responses from/to files. For this, Konclude has to be called with the 'owllinkfile' command and at least with the parameter '-i FILEPATH', where FILEPATH specifies the OWLlink request/query file. The OWLlink response file can be specified with the '-o FILEPATH' parameter. Examples (on Windows you have to omit ./): ./Konclude owllinkfile -i Tests/galen-classify-request.xml -o response.xml ./Konclude owllinkfile -i Tests/roberts-family-full-D-classify-realize-request.xml ./Konclude owllinkfile -c Configs/default-config.xml -i Tests/1b-satisfiability-request.xml Currently, Konclude supports only the following subset of OWLlink commands: - GetDescription, CreateKB, GetSettings, Set, ReleaseKB, Tell, LoadOntologies (IRIs must be files), Classify, Realize - GetAllObjectProperties, GetAllIndividuals, GetAllClasses, GetKBLanguage - IsClassSatisfiable, GetSubClassHierarchy, GetSubClasses (only for atomic concepts), GetSuperClasses (only for atomic concepts), GetEquivalentClasses (only for atomic concepts) - GetTypes, GetFlattenedTypes, GetInstances (only for atomic concepts), GetFlattenedInstances (only for atomic concepts) Furthermore, all OWL 2 ontologies/axioms used in LoadOntologies/Tell commands must be in the OWL 2 XML [1] or in the OWL 2 Functional Style [2] format and Konclude does currently NOT process annotations. The protege editor [2] can be used to convert OWL 2 ontologies between different formats. Konclude can also be used as an OWLlink server that answers OWLlink requests sent over HTTP. For this, Konclude has to be called with the 'owllinkserver' command. The listening port can optionally be specified by the parameter '-p', otherwise the default port 8080 is used. Examples (on Windows you have to omit ./): ./Konclude owllinkserver -p 8080 Large ontologies should separately be loaded with the LoadOntologies OWLlink command, because the request files are completely loaded into the main memory of the system. In contrast, the files referenced by the LoadOntologies commands are parsed in a stream-based manner. - CONFIGURATION: Konclude can be configured with configuration files, which are also OWLlink request files where only the 'Set' command is used. 'Set' commands without the specification of a specific knowledge base configure the default settings in Konclude, which are used to instantiate the configurations of newly created knowledge bases. It is highly recommended to NOT change the default configuration of Konclude, because many available configurations are only for debugging, testing and experimenting. However, if Konclude requires too much main memory, then you can try to deactivate the satisfiability or unsatisfiability caching (see example configuration file in './Configs' directory). The parameter '-c FILEPATH' can be used to load a configuration file. REQUIREMENTS, INSTALLATION, BUILD =================================== Konclude requires Qt 4.8 libraries or above [6]. If they are not included in the release (or integrated in the binary), then you should install them manually on your system. On Windows-based platforms it is further necessary to install the .Net Framework 4.0 [7] and the Microsoft Visual C++ 2005 Redistributable Package [8] for the execution of Konclude. Konclude can be built by running qmake (which is part of the Qt Framework) on 'Konclude.pro', e.g., qmake -o Makefile Konclude.pro and then by compiling the sources with the generated makefile, i.e., make has to be executed/called. CHANGELOG =========== Konclude v0.6.2: - Several minor bug fixes. Konclude v0.6.1: - Several bug fixes. - Minor performance improvements. Konclude v0.6.0: - Several fixed bugs and memory leaks. - Many performance improvements (especially for realisation). - Improved error reporting. - Almost complete datatype support. - OWL 2 Functional Style support. - Loading of ontologies via HTTP and FTP. Konclude v0.5.0: - First release of Konclude. REFERENCES ============ [1] http://www.w3.org/TR/owl2-xml-serialization/ [2] http://www.w3.org/TR/owl2-syntax/ [3] http://protege.stanford.edu/ [4] http://www.w3.org/Submission/owllink-structural-specification/ [5] http://www.w3.org/Submission/2010/SUBM-owllink-httpxml-binding-20100701/ [6] http://qt-project.org/downloads [7] http://www.microsoft.com/en-us/download/details.aspx?id=17718 [7] http://www.microsoft.com/en-us/download/details.aspx?id=21254 Konclude-v0.6.2-544-SourceCode/revision-git.h0000644000175000017500000000025112613410202017577 0ustar jonasjonas#define KONCLUDE_VERSION_GIT_REVISION_NUMBER 544 #define KONCLUDE_VERSION_GIT_TAG_NAME_STRING "v0.6.2" #define KONCLUDE_VERSION_GIT_REVISION_HASH_STRING "f07c265" Konclude-v0.6.2-544-SourceCode/LGPL-2.1.txt0000644000175000017500000006364212405710202016623 0ustar jonasjonas GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! Konclude-v0.6.2-544-SourceCode/Konclude-VS05.vcproj0000644000175000017500000211147712603305464020526 0ustar jonasjonas Konclude-v0.6.2-544-SourceCode/Configs/0000755000175000017500000000000012613407246016417 5ustar jonasjonasKonclude-v0.6.2-544-SourceCode/Configs/default-config.xml0000644000175000017500000000164512126634674022044 0ustar jonasjonas true true Konclude-v0.6.2-544-SourceCode/UnixGitBuildScript.sh0000644000175000017500000000071412235423252021114 0ustar jonasjonas#!/bin/bash #revisionCount=`git log --oneline | wc -l` #echo "#define KONCLUDE_VERSION_GIT_REVISION_NUMBER $revisionCount" > revision-git.h #revisionTagName=`git describe --tags --match v*.*.* --abbrev=0` #echo "#define KONCLUDE_VERSION_GIT_TAG_NAME_STRING \"$revisionTagName\"" >> revision-git.h #revisionHashName=`git log --pretty=format:%h -n 1` #echo "#define KONCLUDE_VERSION_GIT_REVISION_HASH_STRING \"$revisionHashName\"" >> revision-git.h Konclude-v0.6.2-544-SourceCode/Konclude.pri0000644000175000017500000101413212574137576017325 0ustar jonasjonas# ---------------------------------------------------- # This file is generated by the Qt Visual Studio Add-in. # ------------------------------------------------------ HEADERS += ./Source/CKoncludeInfo.h \ ./Source/KoncludeSettings.h \ ./revision-git.h \ ./Source/Parser/CABoxAxiomBuilder.h \ ./Source/Parser/CAxiomOntologyBuilder.h \ ./Source/Parser/CCommandParser.h \ ./Source/Parser/CContinueParsingWaitingCondition.h \ ./Source/Parser/CKRSSOntologyParser.h \ ./Source/Parser/COntologyBuilder.h \ ./Source/Parser/COntologyParser.h \ ./Source/Parser/COWL2QtXMLOntologyParser.h \ ./Source/Parser/COWL2QtXMLOntologySAXParser.h \ ./Source/Parser/COWL2QtXMLOntologyStableStreamParser.h \ ./Source/Parser/COWL2QtXMLOntologyStreamParser.h \ ./Source/Parser/COWLlinkQtXMLCommandParser.h \ ./Source/Parser/COWLlinkQtXMLComplexQueryParser.h \ ./Source/Parser/COWLlinkQtXMLResultParser.h \ ./Source/Parser/COWLlinkQtXMLSimpleQueryParser.h \ ./Source/Parser/COWLlinkQueryExtensionParser.h \ ./Source/Parser/COWLlinkQueryParser.h \ ./Source/Parser/CParseRuleAtom.h \ ./Source/Parser/CParsingExpressionSplitter.h \ ./Source/Parser/CParsingHandlingContext.h \ ./Source/Parser/CParsingProgressionRecording.h \ ./Source/Parser/CQtXMLContentHandlerConverter.h \ ./Source/Parser/CQueryBuilder.h \ ./Source/Parser/CQueryParser.h \ ./Source/Parser/CRBoxAxiomBuilder.h \ ./Source/Parser/CStringPrimitiveConverter.h \ ./Source/Parser/CTBoxAxiomBuilder.h \ ./Source/Parser/CXMLHandler.h \ ./Source/Parser/CXMLHandlerStack.h \ ./Source/Parser/CXMLHandlerStackBase.h \ ./Source/Parser/CXMLOWL2Handler.h \ ./Source/Parser/CXMLOWL2StreamHandler.h \ ./Source/Parser/CXMLParsingHandlingContext.h \ ./Source/Parser/CXMLParsingHandlingContextBase.h \ ./Source/Parser/CXMLTestsuiteCommandParser.h \ ./Source/Parser/ParserSettings.h \ ./Source/Parser/Expressions/CAnonymousIndividualExpression.h \ ./Source/Parser/Expressions/CAssertionAxiomExpression.h \ ./Source/Parser/Expressions/CAsymmetricObjectPropertyExpression.h \ ./Source/Parser/Expressions/CAxiomExpression.h \ ./Source/Parser/Expressions/CBuildExpression.h \ ./Source/Parser/Expressions/CCardinalityAssociator.h \ ./Source/Parser/Expressions/CClassAssertionExpression.h \ ./Source/Parser/Expressions/CClassAxiomExpression.h \ ./Source/Parser/Expressions/CClassExpression.h \ ./Source/Parser/Expressions/CClassExpressionAssociator.h \ ./Source/Parser/Expressions/CClassTermExpression.h \ ./Source/Parser/Expressions/CClassTermExpressionAssociator.h \ ./Source/Parser/Expressions/CClassVariableTermExpressionAssociator.h \ ./Source/Parser/Expressions/CDataAllValuesFromExpression.h \ ./Source/Parser/Expressions/CDataCardinalityExpression.h \ ./Source/Parser/Expressions/CDataComplementOfExpression.h \ ./Source/Parser/Expressions/CDataExactCardinalityExpression.h \ ./Source/Parser/Expressions/CDataFacetExpression.h \ ./Source/Parser/Expressions/CDataFacetExpressionAssociator.h \ ./Source/Parser/Expressions/CDataFacetRestrictionExpression.h \ ./Source/Parser/Expressions/CDataFacetRestrictionExpressionAssociator.h \ ./Source/Parser/Expressions/CDataHasValueExpression.h \ ./Source/Parser/Expressions/CDataIntersectionOfExpression.h \ ./Source/Parser/Expressions/CDataLexicalValueExpression.h \ ./Source/Parser/Expressions/CDataLexicalValueExpressionAssociator.h \ ./Source/Parser/Expressions/CDataLiteralExpression.h \ ./Source/Parser/Expressions/CDataLiteralExpressionAssociator.h \ ./Source/Parser/Expressions/CDataMaxCardinalityExpression.h \ ./Source/Parser/Expressions/CDataMinCardinalityExpression.h \ ./Source/Parser/Expressions/CDataOneOfExpression.h \ ./Source/Parser/Expressions/CDataPropertyAssertionExpression.h \ ./Source/Parser/Expressions/CDataPropertyAxiomExpression.h \ ./Source/Parser/Expressions/CDataPropertyDomainExpression.h \ ./Source/Parser/Expressions/CDataPropertyExpression.h \ ./Source/Parser/Expressions/CDataPropertyRangeExpression.h \ ./Source/Parser/Expressions/CDataPropertyTermExpression.h \ ./Source/Parser/Expressions/CDataPropertyTermExpressionAssociator.h \ ./Source/Parser/Expressions/CDataRangeTermExpression.h \ ./Source/Parser/Expressions/CDataRangeTermExpressionAssociator.h \ ./Source/Parser/Expressions/CDataSomeValuesFromExpression.h \ ./Source/Parser/Expressions/CDatatypeExpression.h \ ./Source/Parser/Expressions/CDatatypeExpressionAssociator.h \ ./Source/Parser/Expressions/CDatatypeRestrictionExpression.h \ ./Source/Parser/Expressions/CDataUnionOfExpression.h \ ./Source/Parser/Expressions/CDeclarationAxiomExpression.h \ ./Source/Parser/Expressions/CDifferentIndividualsExpression.h \ ./Source/Parser/Expressions/CDisjointClassesExpression.h \ ./Source/Parser/Expressions/CDisjointDataPropertiesExpression.h \ ./Source/Parser/Expressions/CDisjointObjectPropertiesExpression.h \ ./Source/Parser/Expressions/CDisjointUnionExpression.h \ ./Source/Parser/Expressions/CEntailmentAxiomExpressionAssociation.h \ ./Source/Parser/Expressions/CEntityAssociator.h \ ./Source/Parser/Expressions/CEquivalentClassesExpression.h \ ./Source/Parser/Expressions/CEquivalentDataPropertiesExpression.h \ ./Source/Parser/Expressions/CEquivalentObjectPropertiesExpression.h \ ./Source/Parser/Expressions/CExpressionAssociator.h \ ./Source/Parser/Expressions/CExpressionEntity.h \ ./Source/Parser/Expressions/CExpressionHashMixer.h \ ./Source/Parser/Expressions/CFunctionalDataPropertyExpression.h \ ./Source/Parser/Expressions/CFunctionalObjectPropertyExpression.h \ ./Source/Parser/Expressions/CIndividualExpression.h \ ./Source/Parser/Expressions/CIndividualTermExpression.h \ ./Source/Parser/Expressions/CIndividualTermExpressionAssociator.h \ ./Source/Parser/Expressions/CInverseFunctionalObjectPropertyExpression.h \ ./Source/Parser/Expressions/CInverseObjectPropertiesExpression.h \ ./Source/Parser/Expressions/CInverseObjectPropertyOfExpression.h \ ./Source/Parser/Expressions/CIrreflexiveObjectPropertyExpression.h \ ./Source/Parser/Expressions/CListAxiomExpressionAssociator.h \ ./Source/Parser/Expressions/CListClassTermExpressionAssociator.h \ ./Source/Parser/Expressions/CListClassVariableTermExpressionAssociator.h \ ./Source/Parser/Expressions/CListDataFacetRestrictionExpressionAssociator.h \ ./Source/Parser/Expressions/CListDataPropertyTermExpressionAssociator.h \ ./Source/Parser/Expressions/CListDataRangeTermExpressionAssociator.h \ ./Source/Parser/Expressions/CListExpression.h \ ./Source/Parser/Expressions/CListExpressionAssociator.h \ ./Source/Parser/Expressions/CListIndividualTermExpressionAssociator.h \ ./Source/Parser/Expressions/CListObjectPropertyTermExpressionAssociator.h \ ./Source/Parser/Expressions/CListRuleAtomTermExpressionAssociator.h \ ./Source/Parser/Expressions/CNameAssociator.h \ ./Source/Parser/Expressions/CNamedIndividualExpression.h \ ./Source/Parser/Expressions/CNameExpression.h \ ./Source/Parser/Expressions/CNegativeDataPropertyAssertionExpression.h \ ./Source/Parser/Expressions/CNegativeObjectPropertyAssertionExpression.h \ ./Source/Parser/Expressions/CObjectAllValuesFromExpression.h \ ./Source/Parser/Expressions/CObjectCardinalityExpression.h \ ./Source/Parser/Expressions/CObjectComplementOfExpression.h \ ./Source/Parser/Expressions/CObjectExactlyCardinalityExpression.h \ ./Source/Parser/Expressions/CObjectExpression.h \ ./Source/Parser/Expressions/CObjectHasSelfExpression.h \ ./Source/Parser/Expressions/CObjectHasValueExpression.h \ ./Source/Parser/Expressions/CObjectIndividualVariableExpression.h \ ./Source/Parser/Expressions/CObjectIntersectionOfExpression.h \ ./Source/Parser/Expressions/CObjectMaxCardinalityExpression.h \ ./Source/Parser/Expressions/CObjectMinCardinalityExpression.h \ ./Source/Parser/Expressions/CObjectOneOfExpression.h \ ./Source/Parser/Expressions/CObjectPropertyAssertionExpression.h \ ./Source/Parser/Expressions/CObjectPropertyAxiomExpression.h \ ./Source/Parser/Expressions/CObjectPropertyChainExpression.h \ ./Source/Parser/Expressions/CObjectPropertyDomainExpression.h \ ./Source/Parser/Expressions/CObjectPropertyExpression.h \ ./Source/Parser/Expressions/CObjectPropertyRangeExpression.h \ ./Source/Parser/Expressions/CObjectPropertyTermExpression.h \ ./Source/Parser/Expressions/CObjectPropertyTermExpressionAssociator.h \ ./Source/Parser/Expressions/CObjectSomeValuesFromExpression.h \ ./Source/Parser/Expressions/CObjectUnionOfExpression.h \ ./Source/Parser/Expressions/COrderedListObjectPropertyTermExpressionAssociator.h \ ./Source/Parser/Expressions/COrderedPairClassTermExpressionAssociator.h \ ./Source/Parser/Expressions/COrderedPairDataPropertyTermExpressionAssociator.h \ ./Source/Parser/Expressions/COrderedPairExpressionAssociator.h \ ./Source/Parser/Expressions/COrderedPairIndividualTermExpressionAssociator.h \ ./Source/Parser/Expressions/COrderedPairObjectPropertyTermExpressionAssociator.h \ ./Source/Parser/Expressions/CPairExpression.h \ ./Source/Parser/Expressions/CPairExpressionAssociator.h \ ./Source/Parser/Expressions/CPrecedentBuildClassExpression.h \ ./Source/Parser/Expressions/CPrecedentBuildIndividualExpression.h \ ./Source/Parser/Expressions/CPrecedentBuildPropertyExpression.h \ ./Source/Parser/Expressions/CPropertyTermExpression.h \ ./Source/Parser/Expressions/CQueryAreClassesDisjointExpression.h \ ./Source/Parser/Expressions/CQueryAreClassesEquivalentExpression.h \ ./Source/Parser/Expressions/CQueryExpression.h \ ./Source/Parser/Expressions/CQueryGetClassAssertionsExpression.h \ ./Source/Parser/Expressions/CQueryGetDeterministicClassAssertionsExpression.h \ ./Source/Parser/Expressions/CQueryGetDeterministicIndividualsExpression.h \ ./Source/Parser/Expressions/CQueryGetEquivalentClassesExpression.h \ ./Source/Parser/Expressions/CQueryGetFlattenedInstancesExpression.h \ ./Source/Parser/Expressions/CQueryGetFlattenedObjectPropertyTargetsExpression.h \ ./Source/Parser/Expressions/CQueryGetFlattenedTypesExpression.h \ ./Source/Parser/Expressions/CQueryGetInstancesExpression.h \ ./Source/Parser/Expressions/CQueryGetNondeterministicClassAssertionsExpression.h \ ./Source/Parser/Expressions/CQueryGetNondeterministicIndividualsExpression.h \ ./Source/Parser/Expressions/CQueryGetObjectPropertyTargetsExpression.h \ ./Source/Parser/Expressions/CQueryGetSameIndividualsExpression.h \ ./Source/Parser/Expressions/CQueryGetSubClassesExpression.h \ ./Source/Parser/Expressions/CQueryGetSuperClassesExpression.h \ ./Source/Parser/Expressions/CQueryGetTypesExpression.h \ ./Source/Parser/Expressions/CQueryIsClassSatisfiableExpression.h \ ./Source/Parser/Expressions/CQueryIsClassSubsumedByExpression.h \ ./Source/Parser/Expressions/CQueryIsEntailedExpression.h \ ./Source/Parser/Expressions/CQueryIsInstanceOfExpression.h \ ./Source/Parser/Expressions/CReflexiveObjectPropertyExpression.h \ ./Source/Parser/Expressions/CRuleAtomListBodyExpression.h \ ./Source/Parser/Expressions/CRuleAtomListExpression.h \ ./Source/Parser/Expressions/CRuleAtomListHeadExpression.h \ ./Source/Parser/Expressions/CRuleAtomTermExpression.h \ ./Source/Parser/Expressions/CRuleClassAtomTermExpression.h \ ./Source/Parser/Expressions/CRuleDifferentIndividualsAtomTermExpression.h \ ./Source/Parser/Expressions/CRulePropertyAtomTermExpression.h \ ./Source/Parser/Expressions/CSameIndividualExpression.h \ ./Source/Parser/Expressions/CSubClassOfExpression.h \ ./Source/Parser/Expressions/CSubDataPropertyOfExpression.h \ ./Source/Parser/Expressions/CSubExpressionVisitor.h \ ./Source/Parser/Expressions/CSubObjectPropertyOfExpression.h \ ./Source/Parser/Expressions/CSymmetricObjectPropertyExpression.h \ ./Source/Parser/Expressions/CTransetiveObjectPropertyExpression.h \ ./Source/Parser/Expressions/CUnorderedPairClassTermExpressionAssociator.h \ ./Source/Parser/Expressions/CUnorderedPairExpressionAssociator.h \ ./Source/Parser/Expressions/CUnorderedPairIndividualTermExpressionAssociator.h \ ./Source/Parser/Expressions/CUnorderedPairObjectPropertyTermExpressionAssociator.h \ ./Source/Parser/Expressions/ExpressionSettings.h \ ./Source/Parser/FunctionalJAVACC/CConcreteOWL2FunctionalStyleParser.h \ ./Source/Parser/FunctionalJAVACC/CharStream.h \ ./Source/Parser/FunctionalJAVACC/CJAVACCParser.h \ ./Source/Parser/FunctionalJAVACC/COWL2FunctionalJAVACCOntologyStreamParser.h \ ./Source/Parser/FunctionalJAVACC/COWL2FunctionalStyleParserErrorHandler.h \ ./Source/Parser/FunctionalJAVACC/COWL2FunctionalStyleParserTokenManager.h \ ./Source/Parser/FunctionalJAVACC/CQtIODeviceStreamReader.h \ ./Source/Parser/FunctionalJAVACC/CTokenBase.h \ ./Source/Parser/FunctionalJAVACC/CTokenManager.h \ ./Source/Parser/FunctionalJAVACC/ErrorHandler.h \ ./Source/Parser/FunctionalJAVACC/FunctionalJAVACCSettings.h \ ./Source/Parser/FunctionalJAVACC/JavaCC.h \ ./Source/Parser/FunctionalJAVACC/OWL2FunctionalStyleParser.h \ ./Source/Parser/FunctionalJAVACC/OWL2FunctionalStyleParserConstants.h \ ./Source/Parser/FunctionalJAVACC/OWL2FunctionalStyleParserTokenManager.h \ ./Source/Parser/FunctionalJAVACC/ParseException.h \ ./Source/Parser/FunctionalJAVACC/Token.h \ ./Source/Parser/FunctionalJAVACC/TokenManager.h \ ./Source/Parser/FunctionalJAVACC/TokenMgrError.h \ ./Source/Logger/CAbstractLogObserver.h \ ./Source/Logger/CCallbackRequestLogMessagesContext.h \ ./Source/Logger/CConsolePrintConfigurableLogObserver.h \ ./Source/Logger/CConsolePrintLogObserver.h \ ./Source/Logger/CLogDomain.h \ ./Source/Logger/CLogger.h \ ./Source/Logger/CLogIdentifier.h \ ./Source/Logger/CLogMessage.h \ ./Source/Logger/CLogObserverData.h \ ./Source/Logger/COREConsolePrintLogObserver.h \ ./Source/Logger/COREFilePrintLogObserver.h \ ./Source/Logger/CQtDebugPrintLogObserver.h \ ./Source/Logger/LoggerSettings.h \ ./Source/Logger/Events/CConfigureLoggerEvent.h \ ./Source/Logger/Events/CLoggingEvent.h \ ./Source/Logger/Events/CReleaseLogMessagesEvent.h \ ./Source/Logger/Events/CRequestLogMessagesEvent.h \ ./Source/Logger/Record/CContextRecordData.h \ ./Source/Logger/Record/CContextRecorder.h \ ./Source/Utilities/CAllocationLinker.h \ ./Source/Utilities/CAllocationObject.h \ ./Source/Utilities/CDblLinker.hpp \ ./Source/Utilities/CDblNegLinker.hpp \ ./Source/Utilities/CDynamicExpandingMemoryManager.hpp \ ./Source/Utilities/CDynRefBucket.hpp \ ./Source/Utilities/CDynRefVector.hpp \ ./Source/Utilities/CHashableIntConvertedNTuble.hpp \ ./Source/Utilities/CLinker.hpp \ ./Source/Utilities/CMath.h \ ./Source/Utilities/CMemoryManager.hpp \ ./Source/Utilities/CMemoryReleaser.h \ ./Source/Utilities/CNegLinker.hpp \ ./Source/Utilities/CObjectContainer.h \ ./Source/Utilities/CReverseSort.hpp \ ./Source/Utilities/CSingletonProvider.hpp \ ./Source/Utilities/CSortedDblNegLinker.hpp \ ./Source/Utilities/CSortedLinker.hpp \ ./Source/Utilities/CSortedNegLinker.hpp \ ./Source/Utilities/CStaticExpandingMemoryManager.hpp \ ./Source/Utilities/CTrible.hpp \ ./Source/Utilities/UtilitiesSettings.h \ ./Source/Utilities/Container/CDataArrayMemoryManager.h \ ./Source/Utilities/Container/CDefaultDynamicReferenceVector.h \ ./Source/Utilities/Container/CDynamicReferenceBucket.h \ ./Source/Utilities/Container/CDynamicReferenceVector.h \ ./Source/Utilities/Container/CHash.h \ ./Source/Utilities/Container/CLinker.h \ ./Source/Utilities/Container/CList.h \ ./Source/Utilities/Container/CModelData.h \ ./Source/Utilities/Container/CModelDataArray.h \ ./Source/Utilities/Container/CModelDataLevelArray.h \ ./Source/Utilities/Container/CNegator.h \ ./Source/Utilities/Container/CNegLinker.h \ ./Source/Utilities/Container/ContainerSettings.h \ ./Source/Utilities/Container/CQtHash.h \ ./Source/Utilities/Container/CQtList.h \ ./Source/Utilities/Container/CQtManagedRestrictedModificationHash.h \ ./Source/Utilities/Container/CQtManagedRestrictedModificationHashBase.h \ ./Source/Utilities/Container/CQtManagedRestrictedModificationHashData.h \ ./Source/Utilities/Container/CQtManagedRestrictedModificationList.h \ ./Source/Utilities/Container/CQtManagedRestrictedModificationListBase.h \ ./Source/Utilities/Container/CQtManagedRestrictedModificationListData.h \ ./Source/Utilities/Container/CQtManagedRestrictedModificationMap.h \ ./Source/Utilities/Container/CQtManagedRestrictedModificationMapBase.h \ ./Source/Utilities/Container/CQtManagedRestrictedModificationMapData.h \ ./Source/Utilities/Container/CQtManagedRestrictedModificationSet.h \ ./Source/Utilities/Container/CQtSet.h \ ./Source/Utilities/Container/CQtVector.h \ ./Source/Utilities/Container/CSet.h \ ./Source/Utilities/Container/CSortedLinker.h \ ./Source/Utilities/Container/CSortedNegLinker.h \ ./Source/Utilities/Container/CTemporaryDataArrayMemoryStorer.h \ ./Source/Utilities/Container/CVector.h \ ./Source/Utilities/Memory/CAllocationLimitationProvider.h \ ./Source/Utilities/Memory/CAllocationLimitator.h \ ./Source/Utilities/Memory/CCentralizedAllocationConfigProvidedDependendLimitation.h \ ./Source/Utilities/Memory/CCentralizedAllocationLimitation.h \ ./Source/Utilities/Memory/CCentralizedAllocationLimitator.h \ ./Source/Utilities/Memory/CConsiderateMemoryPoolProvider.h \ ./Source/Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.h \ ./Source/Utilities/Memory/CMemoryAllocationException.h \ ./Source/Utilities/Memory/CMemoryAllocationManager.h \ ./Source/Utilities/Memory/CMemoryAllocator.h \ ./Source/Utilities/Memory/CMemoryPool.h \ ./Source/Utilities/Memory/CMemoryPoolAllocationManager.h \ ./Source/Utilities/Memory/CMemoryPoolContainer.h \ ./Source/Utilities/Memory/CMemoryPoolContainerAllocationManager.h \ ./Source/Utilities/Memory/CMemoryPoolProvider.h \ ./Source/Utilities/Memory/CMemoryTemporaryAllocationManager.h \ ./Source/Utilities/Memory/CNewAllocationMemoryPoolProvider.h \ ./Source/Utilities/Memory/CNewCentralizedLimitedAllocationMemoryPoolProvider.h \ ./Source/Utilities/Memory/CObjectAllocator.h \ ./Source/Utilities/Memory/CObjectMemoryPoolAllocator.h \ ./Source/Utilities/Memory/CObjectParameterizingAllocator.h \ ./Source/Utilities/Memory/CTempMemoryPoolContainerAllocationManager.h \ ./Source/Utilities/Memory/MemorySettings.h \ ./Source/Reasoner/ReasonerSettings.h \ ./Source/Reasoner/Ontology/CAbbreviatedIRIName.h \ ./Source/Reasoner/Ontology/CABox.h \ ./Source/Reasoner/Ontology/CActiveEntityCountItem.h \ ./Source/Reasoner/Ontology/CActiveEntityCountVector.h \ ./Source/Reasoner/Ontology/CActiveEntityIterator.h \ ./Source/Reasoner/Ontology/CBoxContext.h \ ./Source/Reasoner/Ontology/CBranchingTriggerVector.h \ ./Source/Reasoner/Ontology/CCachingTags.h \ ./Source/Reasoner/Ontology/CComputedConsequencesCachingData.h \ ./Source/Reasoner/Ontology/CConcept.h \ ./Source/Reasoner/Ontology/CConceptAssertionLinker.h \ ./Source/Reasoner/Ontology/CConceptCycleData.h \ ./Source/Reasoner/Ontology/CConceptData.h \ ./Source/Reasoner/Ontology/CConceptDataVector.h \ ./Source/Reasoner/Ontology/CConceptDependence.h \ ./Source/Reasoner/Ontology/CConceptDependenceVector.h \ ./Source/Reasoner/Ontology/CConceptNegationPair.h \ ./Source/Reasoner/Ontology/CConceptOperator.h \ ./Source/Reasoner/Ontology/CConceptProcessData.h \ ./Source/Reasoner/Ontology/CConceptReferenceLinking.h \ ./Source/Reasoner/Ontology/CConceptRoleBranchingTrigger.h \ ./Source/Reasoner/Ontology/CConceptSatisfiableReferenceLinkingData.h \ ./Source/Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h \ ./Source/Reasoner/Ontology/CConceptTagComparer.h \ ./Source/Reasoner/Ontology/CConceptTextFormater.h \ ./Source/Reasoner/Ontology/CConceptVector.h \ ./Source/Reasoner/Ontology/CConcreteOntology.h \ ./Source/Reasoner/Ontology/CConcreteOntologyContextBase.h \ ./Source/Reasoner/Ontology/CDataBox.h \ ./Source/Reasoner/Ontology/CDataLiteral.h \ ./Source/Reasoner/Ontology/CDataLiteralBinaryBase64DataValue.h \ ./Source/Reasoner/Ontology/CDataLiteralBinaryDataValue.h \ ./Source/Reasoner/Ontology/CDataLiteralBinaryHexDataValue.h \ ./Source/Reasoner/Ontology/CDataLiteralBooleanValue.h \ ./Source/Reasoner/Ontology/CDataLiteralCompareValue.h \ ./Source/Reasoner/Ontology/CDataLiteralDateTimeValue.h \ ./Source/Reasoner/Ontology/CDataLiteralDoubleValue.h \ ./Source/Reasoner/Ontology/CDataLiteralFloatValue.h \ ./Source/Reasoner/Ontology/CDataLiteralIRIValue.h \ ./Source/Reasoner/Ontology/CDataLiteralRealValue.h \ ./Source/Reasoner/Ontology/CDataLiteralStringValue.h \ ./Source/Reasoner/Ontology/CDataLiteralValue.h \ ./Source/Reasoner/Ontology/CDataLiteralXMLValue.h \ ./Source/Reasoner/Ontology/CDatatype.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryBase64DataTriggers.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryBase64DataType.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryHexDataTriggers.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryHexDataType.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceBooleanTriggers.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceBooleanType.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceCompareTriggers.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceCompareType.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceConceptTriggeringData.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceConceptTriggerLinker.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceDateTimeTriggers.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceDateTimeType.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceDoubleTriggers.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceDoubleType.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceFloatTriggers.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceFloatType.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceIRITriggers.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceIRIType.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceRealTriggers.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceRealType.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpacesTriggers.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceStringTriggers.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceStringType.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringData.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringIterator.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringMap.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringMapArranger.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringMapData.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceTriggers.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceType.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceTypes.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceUnknownType.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceXMLTriggers.h \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceXMLType.h \ ./Source/Reasoner/Ontology/CDatatypeVector.h \ ./Source/Reasoner/Ontology/CExpressionDataBoxMapping.h \ ./Source/Reasoner/Ontology/CExtendedConceptReferenceLinkingData.h \ ./Source/Reasoner/Ontology/CImplicationReplacementVector.h \ ./Source/Reasoner/Ontology/CIndividual.h \ ./Source/Reasoner/Ontology/CIndividualBackendCachingData.h \ ./Source/Reasoner/Ontology/CIndividualData.h \ ./Source/Reasoner/Ontology/CIndividualDependence.h \ ./Source/Reasoner/Ontology/CIndividualDependenceTracking.h \ ./Source/Reasoner/Ontology/CIndividualDependenceVector.h \ ./Source/Reasoner/Ontology/CIndividualProcessData.h \ ./Source/Reasoner/Ontology/CIndividualSaturationReferenceLinkingData.h \ ./Source/Reasoner/Ontology/CIndividualVector.h \ ./Source/Reasoner/Ontology/CIRIName.h \ ./Source/Reasoner/Ontology/CMBox.h \ ./Source/Reasoner/Ontology/CName.h \ ./Source/Reasoner/Ontology/CNamedItem.h \ ./Source/Reasoner/Ontology/CNamePrefix.h \ ./Source/Reasoner/Ontology/CNominalSchemaTemplate.h \ ./Source/Reasoner/Ontology/CNominalSchemaTemplateVector.h \ ./Source/Reasoner/Ontology/COntology.h \ ./Source/Reasoner/Ontology/COntologyBuildConstructFlags.h \ ./Source/Reasoner/Ontology/COntologyBuildData.h \ ./Source/Reasoner/Ontology/COntologyBuildExpressionCounter.h \ ./Source/Reasoner/Ontology/COntologyContext.h \ ./Source/Reasoner/Ontology/COntologyCoreConceptCyclesData.h \ ./Source/Reasoner/Ontology/COntologyDataBoxes.h \ ./Source/Reasoner/Ontology/COntologyExpressivity.h \ ./Source/Reasoner/Ontology/COntologyImportData.h \ ./Source/Reasoner/Ontology/COntologyIncrementalAxiomChangeData.h \ ./Source/Reasoner/Ontology/COntologyIncrementalRevisionData.h \ ./Source/Reasoner/Ontology/COntologyInspector.h \ ./Source/Reasoner/Ontology/COntologyLoadingData.h \ ./Source/Reasoner/Ontology/COntologyProcessingConceptSaturationRequirement.h \ ./Source/Reasoner/Ontology/COntologyProcessingRequirement.h \ ./Source/Reasoner/Ontology/COntologyProcessingRequirementExpander.h \ ./Source/Reasoner/Ontology/COntologyProcessingStatistics.h \ ./Source/Reasoner/Ontology/COntologyProcessingStatus.h \ ./Source/Reasoner/Ontology/COntologyProcessingStep.h \ ./Source/Reasoner/Ontology/COntologyProcessingStepData.h \ ./Source/Reasoner/Ontology/COntologyProcessingStepDataVector.h \ ./Source/Reasoner/Ontology/COntologyProcessingStepRequirement.h \ ./Source/Reasoner/Ontology/COntologyProcessingSteps.h \ ./Source/Reasoner/Ontology/COntologyProcessingStepVector.h \ ./Source/Reasoner/Ontology/COntologyStringMapping.h \ ./Source/Reasoner/Ontology/COntologyStructureSummary.h \ ./Source/Reasoner/Ontology/COntologyTextFormater.h \ ./Source/Reasoner/Ontology/CProcessReference.h \ ./Source/Reasoner/Ontology/CRBox.h \ ./Source/Reasoner/Ontology/CReplacementData.h \ ./Source/Reasoner/Ontology/CReverseRoleAssertionLinker.h \ ./Source/Reasoner/Ontology/CRole.h \ ./Source/Reasoner/Ontology/CRoleAssertionLinker.h \ ./Source/Reasoner/Ontology/CRoleChain.h \ ./Source/Reasoner/Ontology/CRoleChainVector.h \ ./Source/Reasoner/Ontology/CRoleData.h \ ./Source/Reasoner/Ontology/CRoleDependence.h \ ./Source/Reasoner/Ontology/CRoleDependenceVector.h \ ./Source/Reasoner/Ontology/CRoleProcessData.h \ ./Source/Reasoner/Ontology/CRoleTagComparer.h \ ./Source/Reasoner/Ontology/CRoleVector.h \ ./Source/Reasoner/Ontology/CSatisfiableCachingTags.h \ ./Source/Reasoner/Ontology/CTagItem.h \ ./Source/Reasoner/Ontology/CTBox.h \ ./Source/Reasoner/Ontology/CTerminology.h \ ./Source/Reasoner/Ontology/CUnsatisfiableCachingTags.h \ ./Source/Reasoner/Ontology/CVariable.h \ ./Source/Reasoner/Ontology/OntologySettings.h \ ./Source/Reasoner/Ontology/Memory/COntologyContextCollectionMemoryManager.h \ ./Source/Reasoner/Ontology/Memory/COntologyContextCollectionMemoryManagerSingletonProvider.h \ ./Source/Reasoner/Ontology/Memory/COntologyContextMemoryManager.h \ ./Source/Reasoner/Ontology/Memory/COntologyContextMemoryManagerProvider.h \ ./Source/Reasoner/Ontology/Memory/COntologyContextSingleMemoryManager.h \ ./Source/Reasoner/Ontology/Memory/COntologyContextSingleMemoryManagerSingletonProvider.h \ ./Source/Reasoner/Ontology/Memory/MemorySettings.h \ ./Source/Reasoner/Query/CApproximatedSaturationCalculationConstructionConstruct.h \ ./Source/Reasoner/Query/CApproximatedSaturationCalculationJob.h \ ./Source/Reasoner/Query/CApproximatedSaturationCalculationProcessingConstruct.h \ ./Source/Reasoner/Query/CAreAxiomsEntailedQuery.h \ ./Source/Reasoner/Query/CAreClassesDisjointQuery.h \ ./Source/Reasoner/Query/CAreClassesEquivalentQuery.h \ ./Source/Reasoner/Query/CBooleanQueryResult.h \ ./Source/Reasoner/Query/CCalculationJob.h \ ./Source/Reasoner/Query/CCalculationJobQueryData.h \ ./Source/Reasoner/Query/CClassAssertionQuery.h \ ./Source/Reasoner/Query/CClassesResult.h \ ./Source/Reasoner/Query/CClassesResultVisitorGenerator.h \ ./Source/Reasoner/Query/CClassHierarchyResult.h \ ./Source/Reasoner/Query/CClassifyQuery.h \ ./Source/Reasoner/Query/CClassSetResult.h \ ./Source/Reasoner/Query/CClassSubClassesRelationResult.h \ ./Source/Reasoner/Query/CClassSynsetResult.h \ ./Source/Reasoner/Query/CClassSynsetsResult.h \ ./Source/Reasoner/Query/CClassSynsetsResultVisitorGenerator.h \ ./Source/Reasoner/Query/CConsistencePremisingQuery.h \ ./Source/Reasoner/Query/CDeterministicClassAssertionQuery.h \ ./Source/Reasoner/Query/CDeterministicIndividualsQuery.h \ ./Source/Reasoner/Query/CDeterministicNondeterministicIndividualsQuery.h \ ./Source/Reasoner/Query/CEquivalentClassesQuery.h \ ./Source/Reasoner/Query/CFlattenedInstancesQuery.h \ ./Source/Reasoner/Query/CFlattenedObjectPropertyTargetsQuery.h \ ./Source/Reasoner/Query/CFlattenedTypesQuery.h \ ./Source/Reasoner/Query/CIndividualClassAssertionsResult.h \ ./Source/Reasoner/Query/CIndividualsResult.h \ ./Source/Reasoner/Query/CIndividualsResultVisitorGenerator.h \ ./Source/Reasoner/Query/CIndividualSynonymsResult.h \ ./Source/Reasoner/Query/CIndividualSynsetResult.h \ ./Source/Reasoner/Query/CIndividualSynsetsResult.h \ ./Source/Reasoner/Query/CIndividualSynsetsResultVisitorGenerator.h \ ./Source/Reasoner/Query/CInstancesQuery.h \ ./Source/Reasoner/Query/CIsClassSatisfiableQuery.h \ ./Source/Reasoner/Query/CIsClassSubsumedByQuery.h \ ./Source/Reasoner/Query/CIsConsistentQuery.h \ ./Source/Reasoner/Query/CIsInstanceOfQuery.h \ ./Source/Reasoner/Query/CIsTriviallyConsistentQuery.h \ ./Source/Reasoner/Query/CJobProvidedQuery.h \ ./Source/Reasoner/Query/CJobSatisfiableCallbackContextData.h \ ./Source/Reasoner/Query/CJobSatisfiableResult.h \ ./Source/Reasoner/Query/CNondeterministicClassAssertionQuery.h \ ./Source/Reasoner/Query/CNondeterministicIndividualsQuery.h \ ./Source/Reasoner/Query/CObjectPropertyTargetsQuery.h \ ./Source/Reasoner/Query/CQuery.h \ ./Source/Reasoner/Query/CQueryCalculationStatisticsCollection.h \ ./Source/Reasoner/Query/CQueryError.h \ ./Source/Reasoner/Query/CQueryInconsitentOntologyError.h \ ./Source/Reasoner/Query/CQueryResult.h \ ./Source/Reasoner/Query/CQueryStatistics.h \ ./Source/Reasoner/Query/CQueryStatisticsCollectionStrings.h \ ./Source/Reasoner/Query/CQuerySupport.h \ ./Source/Reasoner/Query/CQueryUnspecifiedStringError.h \ ./Source/Reasoner/Query/CQueryWatcher.h \ ./Source/Reasoner/Query/CRealizationPremisingQuery.h \ ./Source/Reasoner/Query/CRealizeQuery.h \ ./Source/Reasoner/Query/CResultInterceptionData.h \ ./Source/Reasoner/Query/CSameIndividualsQuery.h \ ./Source/Reasoner/Query/CSatisfiableCalculationConceptConstruct.h \ ./Source/Reasoner/Query/CSatisfiableCalculationConstruct.h \ ./Source/Reasoner/Query/CSatisfiableCalculationJob.h \ ./Source/Reasoner/Query/CSatisfiableCalculationJobQueryData.h \ ./Source/Reasoner/Query/CSatisfiableCalculationJobsQuery.h \ ./Source/Reasoner/Query/CSaturationCalculationConstruct.h \ ./Source/Reasoner/Query/CSubClassesQuery.h \ ./Source/Reasoner/Query/CSubClassHierarchyQuery.h \ ./Source/Reasoner/Query/CSucceedQueryResult.h \ ./Source/Reasoner/Query/CSuperClassesQuery.h \ ./Source/Reasoner/Query/CTaxonomyPremisingQuery.h \ ./Source/Reasoner/Query/CTaxonomyPremisingQuerySupport.h \ ./Source/Reasoner/Query/CTypesQuery.h \ ./Source/Reasoner/Query/CWriteFunctionalClassSubsumptionsHierarchyQuery.h \ ./Source/Reasoner/Query/CWriteFunctionalIndividualFlattenedTypesQuery.h \ ./Source/Reasoner/Query/CWriteOWLXMLClassSubsumptionsHierarchyQuery.h \ ./Source/Reasoner/Query/CWriteOWLXMLIndividualFlattenedTypesQuery.h \ ./Source/Reasoner/Query/QuerySettings.h \ ./Source/Reasoner/Kernel/KernelSettings.h \ ./Source/Reasoner/Kernel/Cache/CacheSettings.h \ ./Source/Reasoner/Kernel/Cache/CBackendCache.h \ ./Source/Reasoner/Kernel/Cache/CBackendCacheWriteData.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCache.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheContext.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheIndividualAssociationData.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheLabelAssociationWriteData.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheReader.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheSlotItem.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheWriteData.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheWriter.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalityCacheItem.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalityValueLinker.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelCacheItem.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelSignatureResolveCacheItem.h \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelValueLinker.h \ ./Source/Reasoner/Kernel/Cache/CCache.h \ ./Source/Reasoner/Kernel/Cache/CCacheEntry.h \ ./Source/Reasoner/Kernel/Cache/CCacheEntryWriteData.h \ ./Source/Reasoner/Kernel/Cache/CCacheModificationTagSet.h \ ./Source/Reasoner/Kernel/Cache/CCacheStatistics.h \ ./Source/Reasoner/Kernel/Cache/CCacheTaggingPool.h \ ./Source/Reasoner/Kernel/Cache/CCacheValue.h \ ./Source/Reasoner/Kernel/Cache/CCacheValueHasher.h \ ./Source/Reasoner/Kernel/Cache/CCompletionGraphCache.h \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesCache.h \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheContext.h \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheEntry.h \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheReader.h \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheWriteData.h \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheWriter.h \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheWriteTypesData.h \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesTypesCacheEntry.h \ ./Source/Reasoner/Kernel/Cache/CExpanderBranchedLinker.h \ ./Source/Reasoner/Kernel/Cache/CExpanderCacheValueLinker.h \ ./Source/Reasoner/Kernel/Cache/CIncrementalUnsatisfiableCacheReader.h \ ./Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCache.h \ ./Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheEntriesHash.h \ ./Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheEntry.h \ ./Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheReader.h \ ./Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheUpdateSlotItem.h \ ./Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheWriter.h \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCache.h \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheContext.h \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntry.h \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryExpandWriteData.h \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryWriteData.h \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheReader.h \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheSlotItem.h \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheWriter.h \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCompatibilityEntryHash.h \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCompatibilityEntryHashData.h \ ./Source/Reasoner/Kernel/Cache/CSatisfiableCache.h \ ./Source/Reasoner/Kernel/Cache/CSatisfiableCacheReader.h \ ./Source/Reasoner/Kernel/Cache/CSatisfiableCacheWriter.h \ ./Source/Reasoner/Kernel/Cache/CSaturationCache.h \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedConceptExpansion.h \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedConceptLinker.h \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedDependentNominalSet.h \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedDeterministicConceptExpansion.h \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCache.h \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheContext.h \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheEntry.h \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheExpansionWriteData.h \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheReader.h \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData.h \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheWriteData.h \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheWriter.h \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedNondeterministicConceptExpansion.h \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeCacheUpdater.h \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCache.h \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheContext.h \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntry.h \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryExpandWriteData.h \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData.h \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryWriteData.h \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheHasher.h \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheReader.h \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheRedirectionItem.h \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheSlotItem.h \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheWriter.h \ ./Source/Reasoner/Kernel/Cache/CUnsatisfiableCache.h \ ./Source/Reasoner/Kernel/Cache/CUnsatisfiableCacheReader.h \ ./Source/Reasoner/Kernel/Cache/CUnsatisfiableCacheWriter.h \ ./Source/Reasoner/Kernel/Cache/Events/CRetrieveIncompletelyAssociationCachedEvent.h \ ./Source/Reasoner/Kernel/Cache/Events/CWriteBackendAssociationCachedEvent.h \ ./Source/Reasoner/Kernel/Cache/Events/CWriteCachedDataEvent.h \ ./Source/Reasoner/Kernel/Cache/Events/CWriteComputedConcequencesCacheEntryEvent.h \ ./Source/Reasoner/Kernel/Cache/Events/CWriteExpandCachedEvent.h \ ./Source/Reasoner/Kernel/Cache/Events/CWriteSatisfiableBranchCachedEvent.h \ ./Source/Reasoner/Kernel/Cache/Events/CWriteSatisfiableCacheEntryEvent.h \ ./Source/Reasoner/Kernel/Cache/Events/CWriteSaturationCacheDataEvent.h \ ./Source/Reasoner/Kernel/Cache/Events/CWriteUnsatisfiableCacheEntryEvent.h \ ./Source/Reasoner/Kernel/Strategy/CConceptProcessingPriorityStrategy.h \ ./Source/Reasoner/Kernel/Strategy/CConcreteConceptProcessingOperatorPriorityStrategy.h \ ./Source/Reasoner/Kernel/Strategy/CEqualDepthCacheOrientatedProcessingPriorityStrategy.h \ ./Source/Reasoner/Kernel/Strategy/CEqualDepthTaskProcessingPriorityStrategy.h \ ./Source/Reasoner/Kernel/Strategy/CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy.h \ ./Source/Reasoner/Kernel/Strategy/CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy.h \ ./Source/Reasoner/Kernel/Strategy/CIndividualProcessingPriorityStrategy.h \ ./Source/Reasoner/Kernel/Strategy/CTaskProcessingPriorityStrategy.h \ ./Source/Reasoner/Kernel/Strategy/CUnsatisfiableCacheRetrievalStrategy.h \ ./Source/Reasoner/Kernel/Task/CCalculationConfigurationExtension.h \ ./Source/Reasoner/Kernel/Task/CCalculationStatisticsCollector.h \ ./Source/Reasoner/Kernel/Task/CConsistenceTaskData.h \ ./Source/Reasoner/Kernel/Task/CIncrementalConsistenceTaskData.h \ ./Source/Reasoner/Kernel/Task/CSatisfiableCalculationJobInstantiation.h \ ./Source/Reasoner/Kernel/Task/CSatisfiableCalculationTask.h \ ./Source/Reasoner/Kernel/Task/CSatisfiableCalculationTaskJobCallbackExecuter.h \ ./Source/Reasoner/Kernel/Task/CSatisfiableCalculationTaskStatusPropagator.h \ ./Source/Reasoner/Kernel/Task/CSatisfiableTaskClassificationMessageAdapter.h \ ./Source/Reasoner/Kernel/Task/CSatisfiableTaskIncrementalConsistencyTestingAdapter.h \ ./Source/Reasoner/Kernel/Task/CSatisfiableTaskIndividualDependenceTrackingAdapter.h \ ./Source/Reasoner/Kernel/Task/CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter.h \ ./Source/Reasoner/Kernel/Task/CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter.h \ ./Source/Reasoner/Kernel/Task/CSaturationIndividualsAnalysingAdapter.h \ ./Source/Reasoner/Kernel/Task/CSaturationTaskData.h \ ./Source/Reasoner/Kernel/Task/CTaskPreyingAdapter.h \ ./Source/Reasoner/Kernel/Task/CTaskPreyingListner.h \ ./Source/Reasoner/Kernel/Task/TaskSettings.h \ ./Source/Reasoner/Kernel/Algorithm/AlgorithmSettings.h \ ./Source/Reasoner/Kernel/Algorithm/CCalculationAlgorithmContext.h \ ./Source/Reasoner/Kernel/Algorithm/CCalculationAlgorithmContextBase.h \ ./Source/Reasoner/Kernel/Algorithm/CCalculationChooseTaskHandleAlgorithm.h \ ./Source/Reasoner/Kernel/Algorithm/CCalculationClashProcessingException.h \ ./Source/Reasoner/Kernel/Algorithm/CCalculationErrorProcessingException.h \ ./Source/Reasoner/Kernel/Algorithm/CCalculationStopProcessingException.h \ ./Source/Reasoner/Kernel/Algorithm/CCalculationTableauApproximationSaturationTaskHandleAlgorithm.h \ ./Source/Reasoner/Kernel/Algorithm/CCalculationTableauCompletionTaskHandleAlgorithm.h \ ./Source/Reasoner/Kernel/Algorithm/CClashDescriptorFactory.h \ ./Source/Reasoner/Kernel/Algorithm/CCompletionGraphCacheHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CComputedConsequencesCacheHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CConceptNominalSchemaGroundingHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CDatatypeDependencyCollection.h \ ./Source/Reasoner/Kernel/Algorithm/CDatatypeIndividualProcessNodeHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CDatatypeValueTestingCollection.h \ ./Source/Reasoner/Kernel/Algorithm/CDependencyFactory.h \ ./Source/Reasoner/Kernel/Algorithm/CIncrementalCompletionGraphCompatibleExpansionHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualNodeBackendCacheHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualNodeManager.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBinaryBase64DataValueSpaceHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBinaryHexDataValueSpaceHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBooleanValueSpaceHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeCompareValueSpaceHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeDateTimeValueSpaceHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeDoubleValueSpaceHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeFloatValueSpaceHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeIRIValueSpaceHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeRealValueSpaceHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeStringValueSpaceHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeUnknownValueSpaceHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeValueSpaceHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeXMLValueSpaceHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CReuseCompletionGraphCacheHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableConsistencyPreyingAnalyser.h \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableExpanderCacheHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskClassificationMessageAnalyser.h \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskConsistencyPreyingAnalyser.h \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskIncrementalConsistencyPreyingAnalyser.h \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskMarkerIndividualPropagationAnalyser.h \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskPossibleAssertionCollectingAnalyser.h \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskSaturationIndividualsAnalyser.h \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskSaturationPreyingAnalyser.h \ ./Source/Reasoner/Kernel/Algorithm/CSaturationNodeBackendAssociationCacheHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CSaturationNodeExpansionCacheHandler.h \ ./Source/Reasoner/Kernel/Algorithm/CTrackedClashedDependencyLine.h \ ./Source/Reasoner/Kernel/Algorithm/CTrackedClashedDescriptor.h \ ./Source/Reasoner/Kernel/Algorithm/CTrackedClashedDescriptorHasher.h \ ./Source/Reasoner/Kernel/Algorithm/CUnsatisfiableCacheHandler.h \ ./Source/Reasoner/Kernel/Process/CAdditionalProcessRoleAssertionsLinker.h \ ./Source/Reasoner/Kernel/Process/CAnalizedConceptExpansionLinker.h \ ./Source/Reasoner/Kernel/Process/CBackwardPropagationLink.h \ ./Source/Reasoner/Kernel/Process/CBackwardPropagationReapplyDescriptor.h \ ./Source/Reasoner/Kernel/Process/CBackwardSaturationPropagationLink.h \ ./Source/Reasoner/Kernel/Process/CBackwardSaturationPropagationReapplyDescriptor.h \ ./Source/Reasoner/Kernel/Process/CBlockedTestTag.h \ ./Source/Reasoner/Kernel/Process/CBlockingAlternativeData.h \ ./Source/Reasoner/Kernel/Process/CBlockingAlternativeSignatureBlockingCandidateData.h \ ./Source/Reasoner/Kernel/Process/CBlockingFollowSet.h \ ./Source/Reasoner/Kernel/Process/CBlockingFollowUpdateTag.h \ ./Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateData.h \ ./Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateHash.h \ ./Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateIterator.h \ ./Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinkedCandidateData.h \ ./Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinkedCandidateHash.h \ ./Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinker.h \ ./Source/Reasoner/Kernel/Process/CBranchingMergingIndividualNodeCandidateLinker.h \ ./Source/Reasoner/Kernel/Process/CBranchingMergingProcessingRestrictionSpecification.h \ ./Source/Reasoner/Kernel/Process/CBranchingORProcessingRestrictionSpecification.h \ ./Source/Reasoner/Kernel/Process/CBranchingTag.h \ ./Source/Reasoner/Kernel/Process/CClashedConceptDescriptor.h \ ./Source/Reasoner/Kernel/Process/CClashedDatatypeValueSpaceExclusionDescriptor.h \ ./Source/Reasoner/Kernel/Process/CClashedDependencyDescriptor.h \ ./Source/Reasoner/Kernel/Process/CClashedIndividualDistinctDescriptor.h \ ./Source/Reasoner/Kernel/Process/CClashedIndividualLinkDescriptor.h \ ./Source/Reasoner/Kernel/Process/CClashedNegationDisjointLinkDescriptor.h \ ./Source/Reasoner/Kernel/Process/CConceptDescriptor.h \ ./Source/Reasoner/Kernel/Process/CConceptDescriptorDependencyPair.h \ ./Source/Reasoner/Kernel/Process/CConceptDescriptorDependencyReapplyData.h \ ./Source/Reasoner/Kernel/Process/CConceptLabelSet.h \ ./Source/Reasoner/Kernel/Process/CConceptLabelSetIterator.h \ ./Source/Reasoner/Kernel/Process/CConceptLabelSetModificationTag.h \ ./Source/Reasoner/Kernel/Process/CConceptNominalSchemaGroundingData.h \ ./Source/Reasoner/Kernel/Process/CConceptNominalSchemaGroundingHash.h \ ./Source/Reasoner/Kernel/Process/CConceptNominalSchemaGroundingHasher.h \ ./Source/Reasoner/Kernel/Process/CConceptProcessDescriptor.h \ ./Source/Reasoner/Kernel/Process/CConceptProcessingPriorityQueueData.h \ ./Source/Reasoner/Kernel/Process/CConceptProcessingQueue.h \ ./Source/Reasoner/Kernel/Process/CConceptProcessingQueueIterator.h \ ./Source/Reasoner/Kernel/Process/CConceptProcessLinker.h \ ./Source/Reasoner/Kernel/Process/CConceptProcessPriority.h \ ./Source/Reasoner/Kernel/Process/CConceptPropagationBindingSetHash.h \ ./Source/Reasoner/Kernel/Process/CConceptPropagationBindingSetHashData.h \ ./Source/Reasoner/Kernel/Process/CConceptReapplyHash.h \ ./Source/Reasoner/Kernel/Process/CConceptRepresentativePropagationSetHash.h \ ./Source/Reasoner/Kernel/Process/CConceptRepresentativePropagationSetHashData.h \ ./Source/Reasoner/Kernel/Process/CConceptSaturationDescriptor.h \ ./Source/Reasoner/Kernel/Process/CConceptSaturationDescriptorReapplyData.h \ ./Source/Reasoner/Kernel/Process/CConceptSaturationProcessLinker.h \ ./Source/Reasoner/Kernel/Process/CConceptSetSignature.h \ ./Source/Reasoner/Kernel/Process/CConceptSetStructure.h \ ./Source/Reasoner/Kernel/Process/CConceptVariableBindingPathSetHash.h \ ./Source/Reasoner/Kernel/Process/CConceptVariableBindingPathSetHashData.h \ ./Source/Reasoner/Kernel/Process/CCondensedReapplyConceptDescriptor.h \ ./Source/Reasoner/Kernel/Process/CCondensedReapplyQueue.h \ ./Source/Reasoner/Kernel/Process/CCondensedReapplyQueueIterator.h \ ./Source/Reasoner/Kernel/Process/CConnectionSuccessorCorrectionHash.h \ ./Source/Reasoner/Kernel/Process/CConnectionSuccessorSet.h \ ./Source/Reasoner/Kernel/Process/CConnectionSuccessorSetIterator.h \ ./Source/Reasoner/Kernel/Process/CCoreConceptDescriptor.h \ ./Source/Reasoner/Kernel/Process/CCriticalIndividualNodeConceptTestSet.h \ ./Source/Reasoner/Kernel/Process/CCriticalIndividualNodeProcessingQueue.h \ ./Source/Reasoner/Kernel/Process/CCriticalPredecessorRoleCardinalityData.h \ ./Source/Reasoner/Kernel/Process/CCriticalPredecessorRoleCardinalityHash.h \ ./Source/Reasoner/Kernel/Process/CCriticalSaturationConceptQueue.h \ ./Source/Reasoner/Kernel/Process/CCriticalSaturationConceptTypeQueues.h \ ./Source/Reasoner/Kernel/Process/CDatatypeBinaryBase64DataValueSpaceData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeBinaryDataValueSpaceMap.h \ ./Source/Reasoner/Kernel/Process/CDatatypeBinaryHexDataValueSpaceData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeBooleanValueSpaceData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeBooleanValueSpaceMap.h \ ./Source/Reasoner/Kernel/Process/CDatatypeCompareValueData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeCompareValueDataExclusion.h \ ./Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceMap.h \ ./Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceMapArranger.h \ ./Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceMapData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeDateTimeValueSpaceData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeDateTimeValueSpaceMap.h \ ./Source/Reasoner/Kernel/Process/CDatatypeDependencyTrackPointCollection.h \ ./Source/Reasoner/Kernel/Process/CDatatypeDoubleValueSpaceData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeDoubleValueSpaceMap.h \ ./Source/Reasoner/Kernel/Process/CDatatypeFloatValueSpaceData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeFloatValueSpaceMap.h \ ./Source/Reasoner/Kernel/Process/CDatatypeIRIValueSpaceData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeIRIValueSpaceMap.h \ ./Source/Reasoner/Kernel/Process/CDatatypeRealValueData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeRealValueDataExclusion.h \ ./Source/Reasoner/Kernel/Process/CDatatypeRealValueExclusionType.h \ ./Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceMap.h \ ./Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceMapArranger.h \ ./Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceMapData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeStringValueData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeStringValueDataExclusion.h \ ./Source/Reasoner/Kernel/Process/CDatatypeStringValueExclusionType.h \ ./Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceMap.h \ ./Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceMapArranger.h \ ./Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceMapData.h \ ./Source/Reasoner/Kernel/Process/CDatatypesValueSpaceData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeUnknownValueSpaceData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeValueSpaceData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeValueSpaceDependencyCollector.h \ ./Source/Reasoner/Kernel/Process/CDatatypeValueSpaceRealValuesCounter.h \ ./Source/Reasoner/Kernel/Process/CDatatypeValueSpaceStringValuesCounter.h \ ./Source/Reasoner/Kernel/Process/CDatatypeValueSpaceValuesCounter.h \ ./Source/Reasoner/Kernel/Process/CDatatypeXMLValueSpaceData.h \ ./Source/Reasoner/Kernel/Process/CDatatypeXMLValueSpaceMap.h \ ./Source/Reasoner/Kernel/Process/CDependencyTracker.h \ ./Source/Reasoner/Kernel/Process/CDisjointSuccessorRoleHash.h \ ./Source/Reasoner/Kernel/Process/CDisjointSuccessorRoleIterator.h \ ./Source/Reasoner/Kernel/Process/CDistinctEdge.h \ ./Source/Reasoner/Kernel/Process/CDistinctHash.h \ ./Source/Reasoner/Kernel/Process/CDistinctIterator.h \ ./Source/Reasoner/Kernel/Process/CImplicationReapplyConceptSaturationDescriptor.h \ ./Source/Reasoner/Kernel/Process/CIndividualConceptBatchProcessingData.h \ ./Source/Reasoner/Kernel/Process/CIndividualConceptBatchProcessingQueue.h \ ./Source/Reasoner/Kernel/Process/CIndividualCustomPriorityProcessingQueue.h \ ./Source/Reasoner/Kernel/Process/CIndividualDepthConceptProcessDescriptorProcessingQueue.h \ ./Source/Reasoner/Kernel/Process/CIndividualDepthConceptProcessDescriptorProcessingQueueData.h \ ./Source/Reasoner/Kernel/Process/CIndividualDepthPriority.h \ ./Source/Reasoner/Kernel/Process/CIndividualDepthProcessingQueue.h \ ./Source/Reasoner/Kernel/Process/CIndividualLinkEdge.h \ ./Source/Reasoner/Kernel/Process/CIndividualMergingHash.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeAnalizedConceptExpansionData.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeBackendCacheSynchronisationData.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeBlockData.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeBlockingTestData.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeExpressivityViolationFlags.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeIncrementalExpansionData.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeModelData.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableCacheRetrievalData.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableCacheStoringData.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCacheRetrievalData.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCacheStoringData.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeSaturationBlockingData.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeUnsatisfiableCacheRetrievalData.h \ ./Source/Reasoner/Kernel/Process/CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData.h \ ./Source/Reasoner/Kernel/Process/CIndividualProcessingQueue.h \ ./Source/Reasoner/Kernel/Process/CIndividualProcessNode.h \ ./Source/Reasoner/Kernel/Process/CIndividualProcessNodeDescriptor.h \ ./Source/Reasoner/Kernel/Process/CIndividualProcessNodeLinker.h \ ./Source/Reasoner/Kernel/Process/CIndividualProcessNodePriority.h \ ./Source/Reasoner/Kernel/Process/CIndividualProcessNodeReference.h \ ./Source/Reasoner/Kernel/Process/CIndividualProcessNodeVector.h \ ./Source/Reasoner/Kernel/Process/CIndividualReactivationProcessingQueue.h \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNode.h \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeCacheData.h \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeExtensionData.h \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeLinker.h \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeStatusFlags.h \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeStatusUpdateLinker.h \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeVector.h \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationSuccessorLinkDataLinker.h \ ./Source/Reasoner/Kernel/Process/CIndividualUnsortedProcessingQueue.h \ ./Source/Reasoner/Kernel/Process/CLinkEdge.h \ ./Source/Reasoner/Kernel/Process/CLinkedRoleSaturationSuccessorData.h \ ./Source/Reasoner/Kernel/Process/CLinkedRoleSaturationSuccessorHash.h \ ./Source/Reasoner/Kernel/Process/CLinkProcessingRestrictionSpecification.h \ ./Source/Reasoner/Kernel/Process/CLocalizationTag.h \ ./Source/Reasoner/Kernel/Process/CMarkerIndividualNodeHash.h \ ./Source/Reasoner/Kernel/Process/CNegationDisjointEdge.h \ ./Source/Reasoner/Kernel/Process/CNodeEdge.h \ ./Source/Reasoner/Kernel/Process/CNodeSwitchHistory.h \ ./Source/Reasoner/Kernel/Process/CNodeSwitchTag.h \ ./Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationData.h \ ./Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationHash.h \ ./Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationHashData.h \ ./Source/Reasoner/Kernel/Process/CPreviousIndividualIDSet.h \ ./Source/Reasoner/Kernel/Process/CProcessContext.h \ ./Source/Reasoner/Kernel/Process/CProcessContextBase.h \ ./Source/Reasoner/Kernel/Process/CProcessingDataBox.h \ ./Source/Reasoner/Kernel/Process/CProcessingRestrictionSpecification.h \ ./Source/Reasoner/Kernel/Process/CProcessingStatisticDescription.h \ ./Source/Reasoner/Kernel/Process/CProcessingStatisticGathering.h \ ./Source/Reasoner/Kernel/Process/CProcessingStatisticRegistrator.h \ ./Source/Reasoner/Kernel/Process/CProcessingStatistics.h \ ./Source/Reasoner/Kernel/Process/CProcessingTag.h \ ./Source/Reasoner/Kernel/Process/CProcessMemoryPoolAllocationManager.h \ ./Source/Reasoner/Kernel/Process/CProcessTag.h \ ./Source/Reasoner/Kernel/Process/CProcessTagger.h \ ./Source/Reasoner/Kernel/Process/CPropagationBinding.h \ ./Source/Reasoner/Kernel/Process/CPropagationBindingDescriptor.h \ ./Source/Reasoner/Kernel/Process/CPropagationBindingMap.h \ ./Source/Reasoner/Kernel/Process/CPropagationBindingMapData.h \ ./Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptDescriptor.h \ ./Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptHash.h \ ./Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptHashData.h \ ./Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptIterator.h \ ./Source/Reasoner/Kernel/Process/CPropagationBindingSet.h \ ./Source/Reasoner/Kernel/Process/CPropagationRepresentativeTransitionExtension.h \ ./Source/Reasoner/Kernel/Process/CPropagationVariableBindingTransitionExtension.h \ ./Source/Reasoner/Kernel/Process/CReapplyConceptDescriptor.h \ ./Source/Reasoner/Kernel/Process/CReapplyConceptLabelSet.h \ ./Source/Reasoner/Kernel/Process/CReapplyConceptLabelSetIterator.h \ ./Source/Reasoner/Kernel/Process/CReapplyConceptSaturationLabelSet.h \ ./Source/Reasoner/Kernel/Process/CReapplyConceptSaturationLabelSetIterator.h \ ./Source/Reasoner/Kernel/Process/CReapplyQueue.h \ ./Source/Reasoner/Kernel/Process/CReapplyQueueIterator.h \ ./Source/Reasoner/Kernel/Process/CReapplyRoleSuccessorData.h \ ./Source/Reasoner/Kernel/Process/CReapplyRoleSuccessorHash.h \ ./Source/Reasoner/Kernel/Process/CReferredIndividualTrackingData.h \ ./Source/Reasoner/Kernel/Process/CReferredIndividualTrackingVector.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeContainingMap.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeContainingMapData.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeJoiningAllDataExtension.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeJoiningCommonKeyData.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeJoiningCommonKeyMap.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeJoiningData.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeJoiningHash.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeJoiningHashData.h \ ./Source/Reasoner/Kernel/Process/CRepresentativePropagationDescriptor.h \ ./Source/Reasoner/Kernel/Process/CRepresentativePropagationMap.h \ ./Source/Reasoner/Kernel/Process/CRepresentativePropagationMapData.h \ ./Source/Reasoner/Kernel/Process/CRepresentativePropagationSet.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathHash.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyData.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyHash.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyHashData.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyHasher.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathMap.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathMapData.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetData.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetDataSignature.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetHash.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetHashData.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningData.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningHash.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningHashData.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningKeyDataMap.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningKeyMap.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningKeyMapData.h \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetMigrateData.h \ ./Source/Reasoner/Kernel/Process/CReusedIndividualNodeData.h \ ./Source/Reasoner/Kernel/Process/CReusingIndividualNodeConceptExpansionData.h \ ./Source/Reasoner/Kernel/Process/CReusingReviewData.h \ ./Source/Reasoner/Kernel/Process/CRoleBackwardPropagationHash.h \ ./Source/Reasoner/Kernel/Process/CRoleBackwardPropagationHashData.h \ ./Source/Reasoner/Kernel/Process/CRoleBackwardSaturationPropagationHash.h \ ./Source/Reasoner/Kernel/Process/CRoleBackwardSaturationPropagationHashData.h \ ./Source/Reasoner/Kernel/Process/CRoleReapplyHash.h \ ./Source/Reasoner/Kernel/Process/CRoleSaturationProcessLinker.h \ ./Source/Reasoner/Kernel/Process/CRoleSuccessorHash.h \ ./Source/Reasoner/Kernel/Process/CRoleSuccessorIterator.h \ ./Source/Reasoner/Kernel/Process/CRoleSuccessorLinkIterator.h \ ./Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptCountHash.h \ ./Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptCountHashData.h \ ./Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptExtractionData.h \ ./Source/Reasoner/Kernel/Process/CSaturationDisjunctExtractionLinker.h \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeALLConceptsExtensionData.h \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeDatatypeData.h \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionResolveData.h \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionResolveHash.h \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionResolveHashData.h \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeFUNCTIONALConceptsExtensionData.h \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeNominalHandlingData.h \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeProcessingQueue.h \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeSuccessorExtensionData.h \ ./Source/Reasoner/Kernel/Process/CSaturationInfluencedNominalSet.h \ ./Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorIndividualALLConceptsExtensionData.h \ ./Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash.h \ ./Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash.h \ ./Source/Reasoner/Kernel/Process/CSaturationModifiedProcessUpdateLinker.h \ ./Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeData.h \ ./Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeHash.h \ ./Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeHashData.h \ ./Source/Reasoner/Kernel/Process/CSaturationPredecessorFUNCTIONALConceptExtensionData.h \ ./Source/Reasoner/Kernel/Process/CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash.h \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorALLConceptExtensionData.h \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorConceptExtensionMap.h \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorConceptExtensionMapData.h \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorData.h \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorExtensionData.h \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorExtensionIndividualNodeProcessingQueue.h \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorFUNCTIONALConceptExtensionData.h \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorRoleAssertionLinker.h \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingCandidateData.h \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingCandidateHash.h \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingCandidateIterator.h \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandidateData.h \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandidateHash.h \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandidateIterator.h \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeConceptExpansionData.h \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingReviewData.h \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingReviewDataIterator.h \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingReviewSet.h \ ./Source/Reasoner/Kernel/Process/CSignatureIterator.h \ ./Source/Reasoner/Kernel/Process/CSuccessorConnectedNominalSet.h \ ./Source/Reasoner/Kernel/Process/CSuccessorIterator.h \ ./Source/Reasoner/Kernel/Process/CSuccessorRoleHash.h \ ./Source/Reasoner/Kernel/Process/CSuccessorRoleIterator.h \ ./Source/Reasoner/Kernel/Process/CTriggeredImplicationProcessingRestrictionSpecification.h \ ./Source/Reasoner/Kernel/Process/CVariableBinding.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingDescriptor.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingPath.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathDescriptor.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningData.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningHash.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningHashData.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningHasher.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathMap.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathMapData.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathMergingHash.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathMergingHashData.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathSet.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingTriggerData.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingTriggerHash.h \ ./Source/Reasoner/Kernel/Process/CVariableBindingTriggerLinker.h \ ./Source/Reasoner/Kernel/Process/ProcessSettings.h \ ./Source/Reasoner/Kernel/Process/Marker/CMarker.h \ ./Source/Reasoner/Kernel/Process/Dependency/CALLDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CANDDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CATLEASTDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CATMOSTDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CAUTOMATCHOOSEDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CAUTOMATTRANSACTIONDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEALLDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEANDDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATECYCLEDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEGROUNDINGDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEIMPLICATIONDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CBINDVARIABLEDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CBranchingTree.h \ ./Source/Reasoner/Kernel/Process/Dependency/CBranchTreeNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CCONNECTIONDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CDATATYPECONNECTIONDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CDATATYPETRIGGERDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CDependency.h \ ./Source/Reasoner/Kernel/Process/Dependency/CDependencyIterator.h \ ./Source/Reasoner/Kernel/Process/Dependency/CDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.h \ ./Source/Reasoner/Kernel/Process/Dependency/CDeterministicDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CDISTINCTDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CEXPANDEDDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CFUNCTIONALDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CIMPLICATIONDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CIndependentBaseDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CMERGEDCONCEPTDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CMERGEDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CMERGEDIndividualDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CMERGEDLINKDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CNEGVALUEDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CNOMINALDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CNonDeterministicDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CNonDeterministicDependencyTrackPoint.h \ ./Source/Reasoner/Kernel/Process/Dependency/CORDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEBINDINGDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEBINDINGSSUCCESSORDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CPROPAGATECONNECTIONAWAYDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CPROPAGATECONNECTIONDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLEBINDINGDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLECONNECTIONDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CQUALIFYDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEALLDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEANDDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEBINDVARIABLEDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEGROUNDINGDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEIMPLICATIONDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEJOINDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CRepresentativeResolveDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CRepresentativeSelectDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CRESOLVEREPRESENTATIVEDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CREUSECOMPLETIONGRAPHDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CREUSECONCEPTSDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CREUSEINDIVIDUALDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CROLEASSERTIONDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CSELFDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CSOMEDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CVALUEDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEALLDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEANDDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEGROUNDINGDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEIMPLICATIONDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEJOINDependencyNode.h \ ./Source/Reasoner/Kernel/Process/Dependency/CVARBINDVARIABLEDependencyNode.h \ ./Source/Reasoner/Kernel/Calculation/CCalculationEnviroment.h \ ./Source/Reasoner/Kernel/Calculation/CCalculationEnvironmentFactory.h \ ./Source/Reasoner/Kernel/Calculation/CCalculationFactory.h \ ./Source/Reasoner/Kernel/Calculation/CCalculationManager.h \ ./Source/Reasoner/Kernel/Calculation/CConcurrentTaskCalculationEnvironment.h \ ./Source/Reasoner/Kernel/Calculation/CConcurrentTaskCalculationManager.h \ ./Source/Reasoner/Kernel/Calculation/CConfigDependedCalculationEnvironmentFactory.h \ ./Source/Reasoner/Kernel/Calculation/CConfigDependedCalculationFactory.h \ ./Source/Reasoner/Kernel/Calculation/CTaskHandleAlgorithmBuilder.h \ ./Source/Reasoner/Kernel/Manager/CAnalyseReasonerManager.h \ ./Source/Reasoner/Kernel/Manager/CExperimentalReasonerManager.h \ ./Source/Reasoner/Kernel/Manager/COntologyRequirementPair.h \ ./Source/Reasoner/Kernel/Manager/COntologyRequirementPreparingData.h \ ./Source/Reasoner/Kernel/Manager/CPrecomputationManager.h \ ./Source/Reasoner/Kernel/Manager/CPreprocessingManager.h \ ./Source/Reasoner/Kernel/Manager/CRealizationManager.h \ ./Source/Reasoner/Kernel/Manager/CReasonerManager.h \ ./Source/Reasoner/Kernel/Manager/CReasonerManagerThread.h \ ./Source/Reasoner/Kernel/Manager/CReasoningTaskData.h \ ./Source/Reasoner/Kernel/Manager/CRequirementPreparingData.h \ ./Source/Reasoner/Kernel/Manager/ManagerSettings.h \ ./Source/Reasoner/Kernel/Manager/Events/CCalcedQueryEvent.h \ ./Source/Reasoner/Kernel/Manager/Events/CCalcQueryEvent.h \ ./Source/Reasoner/Kernel/Manager/Events/CJobCalculatedSatisfiableCallbackEvent.h \ ./Source/Reasoner/Kernel/Manager/Events/CPrepareOntologyEvent.h \ ./Source/Reasoner/Kernel/Manager/Events/CQueriedTaxonomyComputedCallbackEvent.h \ ./Source/Reasoner/Kernel/Manager/Events/CQueryJobCalculatedSatisfiableCallbackEvent.h \ ./Source/Reasoner/Kernel/Manager/Events/CReasoningSatisfiableCalculationJobEvent.h \ ./Source/Reasoner/Kernel/Manager/Events/CRequirementProcessedCallbackEvent.h \ ./Source/Reasoner/Preprocess/CBranchTriggerPreProcess.h \ ./Source/Reasoner/Preprocess/CCommonDisjunctConceptExtractionPreProcess.h \ ./Source/Reasoner/Preprocess/CConceptRoleIndividualLocator.h \ ./Source/Reasoner/Preprocess/CConceptTriggerLinker.h \ ./Source/Reasoner/Preprocess/CConceptUnambiguousHasher.h \ ./Source/Reasoner/Preprocess/CConcreteOntologyPreProcess.h \ ./Source/Reasoner/Preprocess/CConsistenceCheckerPreProcess.h \ ./Source/Reasoner/Preprocess/CCoreBlockingConceptMarkerPreProcess.h \ ./Source/Reasoner/Preprocess/CCoreOntologyCyclesExtractorPreProcess.h \ ./Source/Reasoner/Preprocess/CDataExtenderPreProcess.h \ ./Source/Reasoner/Preprocess/CDataLiteralNormalizerPreProcess.h \ ./Source/Reasoner/Preprocess/CDatatypeNormalizerPreProcess.h \ ./Source/Reasoner/Preprocess/CDisjunctSortingPreProcess.h \ ./Source/Reasoner/Preprocess/CExtractPropagationIntoCreationDirectionPreProcess.h \ ./Source/Reasoner/Preprocess/CExtractRelevantConceptRolePreProcess.h \ ./Source/Reasoner/Preprocess/CFullNominalSchemaGroundingPreProcess.h \ ./Source/Reasoner/Preprocess/CLexicalNormalisationPreProcess.h \ ./Source/Reasoner/Preprocess/CMappingUpdaterPreProcess.h \ ./Source/Reasoner/Preprocess/CNegationTransformationPreProcess.h \ ./Source/Reasoner/Preprocess/CNominalSchemaAbsorptionBranchLinker.h \ ./Source/Reasoner/Preprocess/CNominalSchemaAbsorptionPathLinker.h \ ./Source/Reasoner/Preprocess/CNominalSchemaTemplateExtractionPreProcess.h \ ./Source/Reasoner/Preprocess/COntologyAssignmentTransformationPreProcess.h \ ./Source/Reasoner/Preprocess/COntologyConfigDependedPreProcesser.h \ ./Source/Reasoner/Preprocess/COntologyPreProcess.h \ ./Source/Reasoner/Preprocess/COntologyPreProcesser.h \ ./Source/Reasoner/Preprocess/COntologyPreprocessingItem.h \ ./Source/Reasoner/Preprocess/COntologyStructureInspectionPreProcess.h \ ./Source/Reasoner/Preprocess/CPrecomputationPreProcess.h \ ./Source/Reasoner/Preprocess/CPreProcess.h \ ./Source/Reasoner/Preprocess/CPreProcessContext.h \ ./Source/Reasoner/Preprocess/CPreProcessContextBase.h \ ./Source/Reasoner/Preprocess/CPreprocessing.h \ ./Source/Reasoner/Preprocess/CPreprocessingCallbackDataContext.h \ ./Source/Reasoner/Preprocess/CPreprocessingContext.h \ ./Source/Reasoner/Preprocess/CPreprocessingTestingItem.h \ ./Source/Reasoner/Preprocess/CPreprocessingTestingStep.h \ ./Source/Reasoner/Preprocess/CPreprocessingThread.h \ ./Source/Reasoner/Preprocess/CPreprocessor.h \ ./Source/Reasoner/Preprocess/CRequirementConfigPreprocessingItem.h \ ./Source/Reasoner/Preprocess/CRequirementConfigPreprocessingThread.h \ ./Source/Reasoner/Preprocess/CReverseRoleAssertionGeneratorPreProcess.h \ ./Source/Reasoner/Preprocess/CRoleChainAutomataTransformationPreProcess.h \ ./Source/Reasoner/Preprocess/CSubroleTransformationPreProcess.h \ ./Source/Reasoner/Preprocess/CTriggeredImplicationBinaryAbsorberPreProcess.h \ ./Source/Reasoner/Preprocess/PreprocessSettings.h \ ./Source/Reasoner/Preprocess/Events/CCallbackPreprocessedOntologyEvent.h \ ./Source/Reasoner/Preprocess/Events/CPreprocessingCalculatedCallbackEvent.h \ ./Source/Reasoner/Preprocess/Events/CPreprocessOntologyEvent.h \ ./Source/Reasoner/Revision/COntologyConfigurationExtension.h \ ./Source/Reasoner/Revision/COntologyRevision.h \ ./Source/Reasoner/Revision/COntologyRevisionManager.h \ ./Source/Reasoner/Revision/CSPOntologyRevisionManager.h \ ./Source/Reasoner/Revision/RevisionSettings.h \ ./Source/Reasoner/Classifier/CClassificationCalculationSupport.h \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModel.h \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModelConceptData.h \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModelConceptMap.h \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModelData.h \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModelDeterministicFlag.h \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModelHash.h \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModelRoleData.h \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModelRoleMap.h \ ./Source/Reasoner/Classifier/CClassificationConceptReferenceLinking.h \ ./Source/Reasoner/Classifier/CClassificationInitializePossibleSubsumptionData.h \ ./Source/Reasoner/Classifier/CClassificationInitializePossibleSubsumptionMessageData.h \ ./Source/Reasoner/Classifier/CClassificationManager.h \ ./Source/Reasoner/Classifier/CClassificationMessageData.h \ ./Source/Reasoner/Classifier/CClassificationMessageDataObserver.h \ ./Source/Reasoner/Classifier/CClassificationProgress.h \ ./Source/Reasoner/Classifier/CClassificationPseudoModelIdentifierMessageData.h \ ./Source/Reasoner/Classifier/CClassificationSatisfiableCalculationConceptReferenceLinking.h \ ./Source/Reasoner/Classifier/CClassificationSatisfiableCalculationData.h \ ./Source/Reasoner/Classifier/CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking.h \ ./Source/Reasoner/Classifier/CClassificationSubsumptionMessageData.h \ ./Source/Reasoner/Classifier/CClassificationUpdatePossibleSubsumptionMessageData.h \ ./Source/Reasoner/Classifier/CClassificationWorkItem.h \ ./Source/Reasoner/Classifier/CClassifiedCallbackDataContext.h \ ./Source/Reasoner/Classifier/CClassifierStatistics.h \ ./Source/Reasoner/Classifier/CClassifyingCallbackDataContext.h \ ./Source/Reasoner/Classifier/CClassPossibleSubsumptionMap.h \ ./Source/Reasoner/Classifier/CClassPossibleSubsumptionMapIterator.h \ ./Source/Reasoner/Classifier/CClassSubsumptionClassifierContext.h \ ./Source/Reasoner/Classifier/CConceptNegationOverRoleTuble.h \ ./Source/Reasoner/Classifier/CConceptSatisfiableObserver.h \ ./Source/Reasoner/Classifier/CConceptSubsumerObserver.h \ ./Source/Reasoner/Classifier/CConfigDependedSubsumptionClassifierFactory.h \ ./Source/Reasoner/Classifier/CIncrementalKPSetClassOntologyClassificationItem.h \ ./Source/Reasoner/Classifier/CIncrementalKPSetClassSubsumptionClassifierThread.h \ ./Source/Reasoner/Classifier/ClassifierSettings.h \ ./Source/Reasoner/Classifier/CNodeBlockedClassificationItem.h \ ./Source/Reasoner/Classifier/CNodeBottomUpTraversalClassificationItem.h \ ./Source/Reasoner/Classifier/CNodeChildrenOrderClassificationItem.h \ ./Source/Reasoner/Classifier/CNodePredecessorPositionClassificationItem.h \ ./Source/Reasoner/Classifier/CNodeTopDownTraversalClassificationItem.h \ ./Source/Reasoner/Classifier/CNodeTraversalOrderClassificationItem.h \ ./Source/Reasoner/Classifier/COntologyClassificationItem.h \ ./Source/Reasoner/Classifier/COptimizedClassExtractedSaturationOntologyClassificationItem.h \ ./Source/Reasoner/Classifier/COptimizedClassExtractedSaturationSatisfiableTestingItem.h \ ./Source/Reasoner/Classifier/COptimizedClassExtractedSaturationSubsumptionClassifierThread.h \ ./Source/Reasoner/Classifier/COptimizedConceptSaturationSatisfiableTestingItem.h \ ./Source/Reasoner/Classifier/COptimizedKPSetClassOntologyClassificationItem.h \ ./Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionData.h \ ./Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionMap.h \ ./Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionMapIterator.h \ ./Source/Reasoner/Classifier/COptimizedKPSetClassSubsumptionClassifierThread.h \ ./Source/Reasoner/Classifier/COptimizedKPSetClassTestingItem.h \ ./Source/Reasoner/Classifier/COptimizedKPSetRoleOntologyClassificationItem.h \ ./Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionData.h \ ./Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionMap.h \ ./Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionMapIterator.h \ ./Source/Reasoner/Classifier/COptimizedKPSetRoleSubsumptionClassifierThread.h \ ./Source/Reasoner/Classifier/COptimizedKPSetRoleTestingItem.h \ ./Source/Reasoner/Classifier/COptimizedSubClassOntologyClassificationItem.h \ ./Source/Reasoner/Classifier/COptimizedSubClassSatisfiableTestingItem.h \ ./Source/Reasoner/Classifier/COptimizedSubClassSubsumptionClassifierThread.h \ ./Source/Reasoner/Classifier/CPartialPruningHierarchyNode.h \ ./Source/Reasoner/Classifier/CPartialPruningTaxonomy.h \ ./Source/Reasoner/Classifier/CPrecomputedSaturationSubsumerExtractor.h \ ./Source/Reasoner/Classifier/CSubsumptionClassifier.h \ ./Source/Reasoner/Classifier/CSubsumptionClassifierFactory.h \ ./Source/Reasoner/Classifier/CSubsumptionClassifierThread.h \ ./Source/Reasoner/Classifier/Events/CCallbackClassifiedOntologyEvent.h \ ./Source/Reasoner/Classifier/Events/CClassifyOntologyEvent.h \ ./Source/Reasoner/Classifier/Events/COntologyTellClassificationMessageEvent.h \ ./Source/Reasoner/Classifier/Events/CTestCalculatedCallbackEvent.h \ ./Source/Reasoner/Taxonomy/CAHierarchyNode.h \ ./Source/Reasoner/Taxonomy/CATaxonomy.h \ ./Source/Reasoner/Taxonomy/CATaxonomyBuilder.h \ ./Source/Reasoner/Taxonomy/CConceptClassesPCPrHierarchyNode.h \ ./Source/Reasoner/Taxonomy/CConceptClassesPCPrTaxonomy.h \ ./Source/Reasoner/Taxonomy/CEATaxonomy.h \ ./Source/Reasoner/Taxonomy/CEATaxonomyBuilder.h \ ./Source/Reasoner/Taxonomy/CHierarchy.h \ ./Source/Reasoner/Taxonomy/CHierarchyDepthTraversalIterator.h \ ./Source/Reasoner/Taxonomy/CHierarchyNode.h \ ./Source/Reasoner/Taxonomy/CHierarchyNodeData.h \ ./Source/Reasoner/Taxonomy/CHierarchyNodeIterator.h \ ./Source/Reasoner/Taxonomy/CLightConceptClassesHierarchyNode.h \ ./Source/Reasoner/Taxonomy/CLightConceptClassesTaxonomy.h \ ./Source/Reasoner/Taxonomy/COntologyTaxonomy.h \ ./Source/Reasoner/Taxonomy/CPCPrHierarchyNode.h \ ./Source/Reasoner/Taxonomy/CPCPrTaxonomy.h \ ./Source/Reasoner/Taxonomy/CTaxonomy.h \ ./Source/Reasoner/Taxonomy/TaxonomySettings.h \ ./Source/Reasoner/Realizer/CIncrementalKPSetOntologyConceptRealizingItem.h \ ./Source/Reasoner/Realizer/CIncrementalKPSetOntologyConceptRealizingThread.h \ ./Source/Reasoner/Realizer/CIndividualConceptInstanceTestingItem.h \ ./Source/Reasoner/Realizer/CIndividualPairRoleInstanceTestingItem.h \ ./Source/Reasoner/Realizer/CIndividualRoleCandidateTestingItem.h \ ./Source/Reasoner/Realizer/CIndividualSameTestingItem.h \ ./Source/Reasoner/Realizer/CIndividualsConsistencyTestingItem.h \ ./Source/Reasoner/Realizer/COntologyRealizingItem.h \ ./Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesData.h \ ./Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesHash.h \ ./Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesHashData.h \ ./Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesItem.h \ ./Source/Reasoner/Realizer/COptimizedKPSetIndividualItem.h \ ./Source/Reasoner/Realizer/COptimizedKPSetIndividualItemPair.h \ ./Source/Reasoner/Realizer/COptimizedKPSetOntologyConceptRealizingItem.h \ ./Source/Reasoner/Realizer/COptimizedKPSetOntologyConceptRealizingThread.h \ ./Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesData.h \ ./Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesHash.h \ ./Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesHashData.h \ ./Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesItem.h \ ./Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesRedirectionItem.h \ ./Source/Reasoner/Realizer/COptimizedKPSetRoleNeighbourInstancesHash.h \ ./Source/Reasoner/Realizer/COptimizedKPSetRoleNeighbourInstancesHashData.h \ ./Source/Reasoner/Realizer/CRealizationMarkerCandidatesMessageData.h \ ./Source/Reasoner/Realizer/CRealizationMessageData.h \ ./Source/Reasoner/Realizer/CRealizationMessageObserver.h \ ./Source/Reasoner/Realizer/CRealizationProgress.h \ ./Source/Reasoner/Realizer/CRealizer.h \ ./Source/Reasoner/Realizer/CRealizerThread.h \ ./Source/Reasoner/Realizer/CRealizingCallbackDataContext.h \ ./Source/Reasoner/Realizer/CRealizingContext.h \ ./Source/Reasoner/Realizer/CRealizingTestingItem.h \ ./Source/Reasoner/Realizer/CRealizingTestingStep.h \ ./Source/Reasoner/Realizer/RealizerSettings.h \ ./Source/Reasoner/Realizer/Events/CCallbackRealizedOntologyEvent.h \ ./Source/Reasoner/Realizer/Events/CRealizationMessageEvent.h \ ./Source/Reasoner/Realizer/Events/CRealizeOntologyEvent.h \ ./Source/Reasoner/Realizer/Events/CRealizingCalculatedCallbackEvent.h \ ./Source/Reasoner/Consistiser/CConceptCyclePrecomputationTestingItem.h \ ./Source/Reasoner/Consistiser/CConsistenceObserver.h \ ./Source/Reasoner/Consistiser/CConsistencePrecomputationTestingItem.h \ ./Source/Reasoner/Consistiser/CConsistiser.h \ ./Source/Reasoner/Consistiser/CDirectBlockedProcessingConsistiser.h \ ./Source/Reasoner/Consistiser/CIncrementalConsistencePrecomputationTestingItem.h \ ./Source/Reasoner/Consistiser/CIncrementalOntologyPrecomputationItem.h \ ./Source/Reasoner/Consistiser/CIncrementalPrecomputationThread.h \ ./Source/Reasoner/Consistiser/CIndividualDependenceTrackingCollector.h \ ./Source/Reasoner/Consistiser/CIndividualDependenceTrackingMarker.h \ ./Source/Reasoner/Consistiser/CIndividualDependenceTrackingObserver.h \ ./Source/Reasoner/Consistiser/ConsistiserSettings.h \ ./Source/Reasoner/Consistiser/COntologyPrecomputationItem.h \ ./Source/Reasoner/Consistiser/CPrecomputationCallbackDataContext.h \ ./Source/Reasoner/Consistiser/CPrecomputationContext.h \ ./Source/Reasoner/Consistiser/CPrecomputationTestingItem.h \ ./Source/Reasoner/Consistiser/CPrecomputationTestingStep.h \ ./Source/Reasoner/Consistiser/CPrecomputationThread.h \ ./Source/Reasoner/Consistiser/CPrecomputator.h \ ./Source/Reasoner/Consistiser/CSaturationCommonDisjunctConceptsExtractor.h \ ./Source/Reasoner/Consistiser/CSaturationConceptDataItem.h \ ./Source/Reasoner/Consistiser/CSaturationConceptReferenceLinking.h \ ./Source/Reasoner/Consistiser/CSaturationIndividualAnalysationObserver.h \ ./Source/Reasoner/Consistiser/CSaturationIndividualDataItem.h \ ./Source/Reasoner/Consistiser/CSaturationIndividualReferenceLinking.h \ ./Source/Reasoner/Consistiser/CSaturationObserver.h \ ./Source/Reasoner/Consistiser/CSaturationPrecomputationTestingItem.h \ ./Source/Reasoner/Consistiser/CTotallyOntologyPrecomputationItem.h \ ./Source/Reasoner/Consistiser/CTotallyPrecomputationThread.h \ ./Source/Reasoner/Consistiser/Events/CCallbackPrecomputedOntologyEvent.h \ ./Source/Reasoner/Consistiser/Events/CPrecomputationCalculatedCallbackEvent.h \ ./Source/Reasoner/Consistiser/Events/CPrecomputeOntologyEvent.h \ ./Source/Reasoner/Consistiser/Events/CSaturationPrecomputationCalculatedCallbackEvent.h \ ./Source/Reasoner/Classification/CClassConceptClassification.h \ ./Source/Reasoner/Classification/CClassification.h \ ./Source/Reasoner/Classification/CClassificationCalculationStatisticsCollection.h \ ./Source/Reasoner/Classification/CClassificationStatistics.h \ ./Source/Reasoner/Classification/CClassificationStatisticsCollectionStrings.h \ ./Source/Reasoner/Classification/ClassificationSettings.h \ ./Source/Reasoner/Realization/CConceptInstanceItem.h \ ./Source/Reasoner/Realization/CConceptInstantiatedItem.h \ ./Source/Reasoner/Realization/CConceptRealization.h \ ./Source/Reasoner/Realization/CConceptRealizationConceptVisitor.h \ ./Source/Reasoner/Realization/CConceptRealizationIndividualVisitor.h \ ./Source/Reasoner/Realization/CConceptRealizationInstanceToIndividualVisitor.h \ ./Source/Reasoner/Realization/CConceptRealizationInstanceVisitor.h \ ./Source/Reasoner/Realization/CConceptRealizationInstantiatedToConceptVisitor.h \ ./Source/Reasoner/Realization/CConceptRealizationInstantiatedVisitor.h \ ./Source/Reasoner/Realization/CIndividualConceptAssertionSetCollector.h \ ./Source/Reasoner/Realization/CPossibleAssertionsCollectionSet.h \ ./Source/Reasoner/Realization/CRealization.h \ ./Source/Reasoner/Realization/CRoleInstanceItem.h \ ./Source/Reasoner/Realization/CRoleInstantiatedItem.h \ ./Source/Reasoner/Realization/CRoleRealization.h \ ./Source/Reasoner/Realization/CRoleRealizationIndividualVisitor.h \ ./Source/Reasoner/Realization/CRoleRealizationInstanceToIndividualVisitor.h \ ./Source/Reasoner/Realization/CRoleRealizationInstanceVisitor.h \ ./Source/Reasoner/Realization/CSameInstanceItem.h \ ./Source/Reasoner/Realization/CSameRealization.h \ ./Source/Reasoner/Realization/CSameRealizationIndividualVisitor.h \ ./Source/Reasoner/Realization/RealizationSettings.h \ ./Source/Reasoner/Consistence/CConsistence.h \ ./Source/Reasoner/Consistence/CConsistenceData.h \ ./Source/Reasoner/Consistence/ConsistenceSettings.h \ ./Source/Reasoner/Consistence/CPrecomputation.h \ ./Source/Reasoner/Consistence/CSaturationData.h \ ./Source/Reasoner/Generator/CActiveEntitySubExpressionVisitorUpdater.h \ ./Source/Reasoner/Generator/CApproximatedSaturationCalculationJobGenerator.h \ ./Source/Reasoner/Generator/CConcreteOntologyBasementBuilder.h \ ./Source/Reasoner/Generator/CConcreteOntologyBuildDataUpdater.h \ ./Source/Reasoner/Generator/CConcreteOntologyEntityCollectorBuilder.h \ ./Source/Reasoner/Generator/CConcreteOntologyInverseRoleBuilder.h \ ./Source/Reasoner/Generator/CConcreteOntologyMergingBuilder.h \ ./Source/Reasoner/Generator/CConcreteOntologyQueryBasicBuilder.h \ ./Source/Reasoner/Generator/CConcreteOntologyQueryExtendedBuilder.h \ ./Source/Reasoner/Generator/CConcreteOntologyQuerySimpleBuilder.h \ ./Source/Reasoner/Generator/CConcreteOntologyUpdateBuilder.h \ ./Source/Reasoner/Generator/CConcreteOntologyUpdateCollectorBuilder.h \ ./Source/Reasoner/Generator/CExpressionHasher.h \ ./Source/Reasoner/Generator/CExpressionSplitter.h \ ./Source/Reasoner/Generator/CGeneratorTaskHandleContextBase.h \ ./Source/Reasoner/Generator/CQueryBuilderGenerator.h \ ./Source/Reasoner/Generator/CQueryGenerator.h \ ./Source/Reasoner/Generator/CSatisfiableCalculationJobGenerator.h \ ./Source/Reasoner/Generator/CSatisfiableCalculationTaskFromCalculationJobGenerator.h \ ./Source/Reasoner/Generator/CStringRefStringHasher.h \ ./Source/Reasoner/Generator/GeneratorSettings.h \ ./Source/Scheduler/CBooleanTaskResult.h \ ./Source/Scheduler/CBooleanTrueResultCancelTaskStatusPropagator.h \ ./Source/Scheduler/CConcreteMemoryPoolDistributor.h \ ./Source/Scheduler/CConcreteTaskScheduleItem.h \ ./Source/Scheduler/CConcreteTaskSchedulerCommunicator.h \ ./Source/Scheduler/CDirectDistributionMemoryPoolReleaser.h \ ./Source/Scheduler/CDistributionMemoryPoolProvider.h \ ./Source/Scheduler/CDistributionMemoryPoolReleaser.h \ ./Source/Scheduler/CEventDistributionMemoryPoolReleaser.h \ ./Source/Scheduler/CEventHandlerVendor.h \ ./Source/Scheduler/CMemoryPoolDistributor.h \ ./Source/Scheduler/CSingleThreadTaskProcessorUnit.h \ ./Source/Scheduler/CTask.h \ ./Source/Scheduler/CTaskAllocator.h \ ./Source/Scheduler/CTaskCallbackExecuter.h \ ./Source/Scheduler/CTaskCompletor.h \ ./Source/Scheduler/CTaskContext.h \ ./Source/Scheduler/CTaskContextBase.h \ ./Source/Scheduler/CTaskDistributionCompletorCommunicator.h \ ./Source/Scheduler/CTaskEventCommunicator.h \ ./Source/Scheduler/CTaskEventHandlerBasedCompletor.h \ ./Source/Scheduler/CTaskEventHandlerBasedDistributionCompletor.h \ ./Source/Scheduler/CTaskEventHandlerBasedProcessor.h \ ./Source/Scheduler/CTaskEventHandlerBasedScheduler.h \ ./Source/Scheduler/CTaskHandleAlgorithm.h \ ./Source/Scheduler/CTaskHandleContext.h \ ./Source/Scheduler/CTaskHandleLimitedReserveMemoryPoolAllocationManager.h \ ./Source/Scheduler/CTaskHandleMemoryAllocationManager.h \ ./Source/Scheduler/CTaskHandleMemoryPoolAllocationManager.h \ ./Source/Scheduler/CTaskMemoryAllocationManager.h \ ./Source/Scheduler/CTaskMemoryPoolAllocationManager.h \ ./Source/Scheduler/CTaskOwner.h \ ./Source/Scheduler/CTaskProcessingStatistics.h \ ./Source/Scheduler/CTaskProcessor.h \ ./Source/Scheduler/CTaskProcessorCommunicator.h \ ./Source/Scheduler/CTaskProcessorCompletorThread.h \ ./Source/Scheduler/CTaskProcessorContext.h \ ./Source/Scheduler/CTaskProcessorContextBase.h \ ./Source/Scheduler/CTaskProcessorSchedulerThread.h \ ./Source/Scheduler/CTaskProcessorThread.h \ ./Source/Scheduler/CTaskProcessorThreadBase.h \ ./Source/Scheduler/CTaskReserveArrayQueue.h \ ./Source/Scheduler/CTaskReserveArrayQueueConsumer.h \ ./Source/Scheduler/CTaskReserveArrayQueueItem.h \ ./Source/Scheduler/CTaskReserveMultiArrayQueue.h \ ./Source/Scheduler/CTaskReserveMultiArrayQueueAdderController.h \ ./Source/Scheduler/CTaskReserveMultiArrayQueueConsumer.h \ ./Source/Scheduler/CTaskReserveQueue.h \ ./Source/Scheduler/CTaskReserveQueueAdder.h \ ./Source/Scheduler/CTaskReserveQueueAdderController.h \ ./Source/Scheduler/CTaskReserveQueueConsumer.h \ ./Source/Scheduler/CTaskResult.h \ ./Source/Scheduler/CTaskScheduleItem.h \ ./Source/Scheduler/CTaskScheduler.h \ ./Source/Scheduler/CTaskSchedulerCommunicator.h \ ./Source/Scheduler/CTaskStatus.h \ ./Source/Scheduler/CTaskStatusPropagator.h \ ./Source/Scheduler/SchedulerSettings.h \ ./Source/Scheduler/Events/CAlignedUpdateTaskStatusEvent.h \ ./Source/Scheduler/Events/CCriticalScheduleTaskEvent.h \ ./Source/Scheduler/Events/CDistributeMemoryPoolEvent.h \ ./Source/Scheduler/Events/CRequestProcessTaskEvent.h \ ./Source/Scheduler/Events/CRequestScheduleTaskEvent.h \ ./Source/Scheduler/Events/CResponseScheduleTaskEvent.h \ ./Source/Scheduler/Events/CSendTaskCompleteEvent.h \ ./Source/Scheduler/Events/CSendTaskProcessEvent.h \ ./Source/Scheduler/Events/CSendTaskScheduleEvent.h \ ./Source/Scheduler/Events/CTaskAdditionalAllocationEvent.h \ ./Source/Scheduler/Events/CTaskDispenseNotificationEvent.h \ ./Source/Scheduler/Events/CTaskStatusUpdatedEvent.h \ ./Source/Scheduler/Events/CUpdateTaskStatusEvent.h \ ./Source/Config/CBooleanConfigType.h \ ./Source/Config/CConfigData.h \ ./Source/Config/CConfigDataReader.h \ ./Source/Config/CConfigDescription.h \ ./Source/Config/CConfigType.h \ ./Source/Config/CConfiguration.h \ ./Source/Config/CConfigurationBase.h \ ./Source/Config/CConfigurationGroup.h \ ./Source/Config/CConfigurationProvider.h \ ./Source/Config/CConvertBooleanConfigType.h \ ./Source/Config/CConvertIntegerConfigType.h \ ./Source/Config/CConvertStringConfigType.h \ ./Source/Config/CGlobalConfigurationBase.h \ ./Source/Config/CGlobalConfigurationProvider.h \ ./Source/Config/CIntegerConfigType.h \ ./Source/Config/CLocalConfigurationExtension.h \ ./Source/Config/CLocalConfigurationFixedExtension.h \ ./Source/Config/CObjectConfigType.h \ ./Source/Config/ConfigSettings.h \ ./Source/Config/CStringConfigType.h \ ./Source/Control/Command/CClassificationManagerConfigType.h \ ./Source/Control/Command/CCommand.h \ ./Source/Control/Command/CCommandBuilder.h \ ./Source/Control/Command/CCommandDelegater.h \ ./Source/Control/Command/CCommanderInitializationFactory.h \ ./Source/Control/Command/CCommanderManager.h \ ./Source/Control/Command/CCommanderManagerConfigType.h \ ./Source/Control/Command/CCommanderManagerThread.h \ ./Source/Control/Command/CCommandExecutedBlocker.h \ ./Source/Control/Command/CCommandPrecondition.h \ ./Source/Control/Command/CCommandProcessedPrecondition.h \ ./Source/Control/Command/CCommandRecordData.h \ ./Source/Control/Command/CCommandRecorder.h \ ./Source/Control/Command/CCommandRecordRouter.h \ ./Source/Control/Command/CConfigManagerReader.h \ ./Source/Control/Command/CDefaultCommanderInitializationFactory.h \ ./Source/Control/Command/CommandSettings.h \ ./Source/Control/Command/COntologyRevisionManagerConfigType.h \ ./Source/Control/Command/CPreconditionCommand.h \ ./Source/Control/Command/CPreconditionSynchronizer.h \ ./Source/Control/Command/CReasonerCommandBuilder.h \ ./Source/Control/Command/CReasonerCommanderGlobalConfiguration.h \ ./Source/Control/Command/CReasonerConfigurationGroup.h \ ./Source/Control/Command/CReasonerManagerConfigType.h \ ./Source/Control/Command/Instructions/CAreClassesDisjointQueryCommand.h \ ./Source/Control/Command/Instructions/CAreClassesDisjointQueryOWL2XMLNodeCommand.h \ ./Source/Control/Command/Instructions/CAreClassesEquivalentQueryCommand.h \ ./Source/Control/Command/Instructions/CAreClassesEquivalentQueryOWL2XMLNodeCommand.h \ ./Source/Control/Command/Instructions/CBuildQueryCommand.h \ ./Source/Control/Command/Instructions/CCalculateQueryCommand.h \ ./Source/Control/Command/Instructions/CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand.h \ ./Source/Control/Command/Instructions/CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand.h \ ./Source/Control/Command/Instructions/CClassifyQueryCommand.h \ ./Source/Control/Command/Instructions/CConstructClassifyQueryCommand.h \ ./Source/Control/Command/Instructions/CConstructClassSatisfiableQueryCommand.h \ ./Source/Control/Command/Instructions/CConstructFlattenedTypesQueryCommand.h \ ./Source/Control/Command/Instructions/CConstructIsConsistentQueryCommand.h \ ./Source/Control/Command/Instructions/CConstructIsTriviallyConsistentQueryCommand.h \ ./Source/Control/Command/Instructions/CConstructRealizeQueryCommand.h \ ./Source/Control/Command/Instructions/CConstructSubClassHirarchyQueryCommand.h \ ./Source/Control/Command/Instructions/CConstructWriteFunctionalIndividualTypesQueryCommand.h \ ./Source/Control/Command/Instructions/CConstructWriteFunctionalSubClassHirarchyQueryCommand.h \ ./Source/Control/Command/Instructions/CConstructWriteXMLIndividualTypesQueryCommand.h \ ./Source/Control/Command/Instructions/CConstructWriteXMLSubClassHirarchyQueryCommand.h \ ./Source/Control/Command/Instructions/CCreateKnowledgeBaseCommand.h \ ./Source/Control/Command/Instructions/CCreateKnowledgeBaseRevisionUpdateCommand.h \ ./Source/Control/Command/Instructions/CEvaluateTestsuiteCommand.h \ ./Source/Control/Command/Instructions/CExtractedKnowledgeBaseEntitiesContainer.h \ ./Source/Control/Command/Instructions/CExtractKnowledgeBaseEntitiesCommand.h \ ./Source/Control/Command/Instructions/CExtractKnowledgeBaseLanguageCommand.h \ ./Source/Control/Command/Instructions/CExtractOntologyCommand.h \ ./Source/Control/Command/Instructions/CExtractToldExpressionsOntologyCommand.h \ ./Source/Control/Command/Instructions/CGenerateQueryCommand.h \ ./Source/Control/Command/Instructions/CGetClassificationManagerCommand.h \ ./Source/Control/Command/Instructions/CGetConfigCommand.h \ ./Source/Control/Command/Instructions/CGetCurrentKnowledgeBaseRevisionCommand.h \ ./Source/Control/Command/Instructions/CGetDescriptionCommand.h \ ./Source/Control/Command/Instructions/CGetFlattenedTypesOWL2XMLNodeCommand.h \ ./Source/Control/Command/Instructions/CGetFlattenedTypesQueryCommand.h \ ./Source/Control/Command/Instructions/CGetKnowledgeBaseClassEntitiesCommand.h \ ./Source/Control/Command/Instructions/CGetKnowledgeBaseConfigCommand.h \ ./Source/Control/Command/Instructions/CGetKnowledgeBaseEntitiesCommand.h \ ./Source/Control/Command/Instructions/CGetKnowledgeBaseLanguageCommand.h \ ./Source/Control/Command/Instructions/CGetKnowledgeBaseNamedIndividualEntitiesCommand.h \ ./Source/Control/Command/Instructions/CGetKnowledgeBaseObjectPropertyEntitiesCommand.h \ ./Source/Control/Command/Instructions/CGetKnowledgeBaseSettingsCommand.h \ ./Source/Control/Command/Instructions/CGetReasonerCommand.h \ ./Source/Control/Command/Instructions/CGetSettingsCommand.h \ ./Source/Control/Command/Instructions/CGetSubClassHierarchyQueryCommand.h \ ./Source/Control/Command/Instructions/CGetSubClassHierarchyQueryOWL2XMLNodeCommand.h \ ./Source/Control/Command/Instructions/CImportKnowledgeBaseOWLAutoOntologyCommand.h \ ./Source/Control/Command/Instructions/CInitializeConfigurationCommand.h \ ./Source/Control/Command/Instructions/CInitializeReasonerCommand.h \ ./Source/Control/Command/Instructions/CInsertResponseCommentCommand.h \ ./Source/Control/Command/Instructions/CInstallKnowledgeBaseRevisionUpdateCommand.h \ ./Source/Control/Command/Instructions/CIsClassSubsumedByQueryCommand.h \ ./Source/Control/Command/Instructions/CIsClassSubsumedByQueryOWL2XMLNodeCommand.h \ ./Source/Control/Command/Instructions/CIsConsistentQueryCommand.h \ ./Source/Control/Command/Instructions/CIsConsistentQueryOWL2XMLNodeCommand.h \ ./Source/Control/Command/Instructions/CIsInstanceOfQueryCommand.h \ ./Source/Control/Command/Instructions/CIsInstanceOfQueryOWL2XMLNodeCommand.h \ ./Source/Control/Command/Instructions/CIsSatisfiableQueryCommand.h \ ./Source/Control/Command/Instructions/CIsSatisfiableQueryOWL2XMLNodeCommand.h \ ./Source/Control/Command/Instructions/CIsTriviallyConsistentQueryCommand.h \ ./Source/Control/Command/Instructions/CKnowledgeBaseClassifyCommand.h \ ./Source/Control/Command/Instructions/CKnowledgeBaseCommand.h \ ./Source/Control/Command/Instructions/CKnowledgeBaseEntitiesExtractionSpecification.h \ ./Source/Control/Command/Instructions/CKnowledgeBaseProcessCommand.h \ ./Source/Control/Command/Instructions/CKnowledgeBaseQueryCommand.h \ ./Source/Control/Command/Instructions/CKnowledgeBaseRealizeCommand.h \ ./Source/Control/Command/Instructions/CKnowledgeBaseRevisionCommandProvider.h \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseAllDownloadedContinuer.h \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseCommand.h \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseData.h \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseFinishDownloadCommand.h \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseKRSSTestConceptCommand.h \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLAutoOntologyCommand.h \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLFunctionalOntologyCommand.h \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLXMLOntologyCommand.h \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseStartDownloadCommand.h \ ./Source/Control/Command/Instructions/CParseCommandsCommand.h \ ./Source/Control/Command/Instructions/CParseKRSSTestConceptOntologyCommand.h \ ./Source/Control/Command/Instructions/CParseOntologyCommand.h \ ./Source/Control/Command/Instructions/CParseOWL2XMLOntologyCommand.h \ ./Source/Control/Command/Instructions/CParseOWL2XMLQueryCommand.h \ ./Source/Control/Command/Instructions/CParseOWLlinkCommandsCommand.h \ ./Source/Control/Command/Instructions/CParseTestsuiteCommandsCommand.h \ ./Source/Control/Command/Instructions/CParseTestsuiteXMLNodeCommand.h \ ./Source/Control/Command/Instructions/CPrepareKnowledgeBaseCommand.h \ ./Source/Control/Command/Instructions/CPrepareKnowledgeBaseForQueryCommand.h \ ./Source/Control/Command/Instructions/CPrepareKnowledgeBaseForRevisionCommand.h \ ./Source/Control/Command/Instructions/CProcessClassNameSatisfiableQueryCommand.h \ ./Source/Control/Command/Instructions/CProcessQueryCommand.h \ ./Source/Control/Command/Instructions/CProcessQueryOWL2XMLNodeCommand.h \ ./Source/Control/Command/Instructions/CQueryCommandProvider.h \ ./Source/Control/Command/Instructions/CQueryGeneratorCommandProvider.h \ ./Source/Control/Command/Instructions/CReadTextCommand.h \ ./Source/Control/Command/Instructions/CReadTextCommandProvider.h \ ./Source/Control/Command/Instructions/CReadXMLCommand.h \ ./Source/Control/Command/Instructions/CReadXMLCommandProvider.h \ ./Source/Control/Command/Instructions/CRealizeQueryCommand.h \ ./Source/Control/Command/Instructions/CReleaseKnowledgeBaseCommand.h \ ./Source/Control/Command/Instructions/CRendererCommandProvider.h \ ./Source/Control/Command/Instructions/CSaveKnowledgeBaseCommand.h \ ./Source/Control/Command/Instructions/CSaveOWL2XMLExtractedKnowledgeBaseCommand.h \ ./Source/Control/Command/Instructions/CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand.h \ ./Source/Control/Command/Instructions/CSAXParseOWL2XMLOntologyCommand.h \ ./Source/Control/Command/Instructions/CSetConfigCommand.h \ ./Source/Control/Command/Instructions/CSetKnowledgeBaseConfigCommand.h \ ./Source/Control/Command/Instructions/CSkipUnsupportedCommandCommand.h \ ./Source/Control/Command/Instructions/CStreamParseOWL2FunctionalOntologyCommand.h \ ./Source/Control/Command/Instructions/CStreamParseOWL2XMLOntologyCommand.h \ ./Source/Control/Command/Instructions/CTellKnowledgeBaseCommand.h \ ./Source/Control/Command/Instructions/CTellKnowledgeBaseOWL2XMLNodeCommand.h \ ./Source/Control/Command/Instructions/CTestExtendedCalculateQueryCommand.h \ ./Source/Control/Command/Instructions/CTestTestfileCommand.h \ ./Source/Control/Command/Instructions/CTestTestsuiteCommand.h \ ./Source/Control/Command/Instructions/CWriteFunctionalIndividualTypesQueryCommand.h \ ./Source/Control/Command/Instructions/CWriteFunctionalSubClassHierarchyQueryCommand.h \ ./Source/Control/Command/Instructions/CWriteOntologyCommand.h \ ./Source/Control/Command/Instructions/CWriteOWL2XMLOntologyCommand.h \ ./Source/Control/Command/Instructions/CWriteOWLlinkOWL2XMLSatisfiableTestCommand.h \ ./Source/Control/Command/Instructions/CWriteXMLIndividualTypesQueryCommand.h \ ./Source/Control/Command/Instructions/CWriteXMLSubClassHierarchyQueryCommand.h \ ./Source/Control/Command/Events/CCommandCalculatedQueryCallbackEvent.h \ ./Source/Control/Command/Events/CCommandPreconditionChangeEvent.h \ ./Source/Control/Command/Events/CCommandProcessedCallbackEvent.h \ ./Source/Control/Command/Events/CInitializeEvent.h \ ./Source/Control/Command/Events/COntologyPreparedCallbackEvent.h \ ./Source/Control/Command/Events/CRealizeCommandEvent.h \ ./Source/Control/Command/Records/CBuildSubCommandRecord.h \ ./Source/Control/Command/Records/CClosureProcessCommandRecord.h \ ./Source/Control/Command/Records/CFinishProcessCommandRecord.h \ ./Source/Control/Command/Records/CNotSupportedNodeErrorRecord.h \ ./Source/Control/Command/Records/CParseSyntaxErrorRecord.h \ ./Source/Control/Command/Records/CProcessErrorRecord.h \ ./Source/Control/Command/Records/CStartProcessCommandRecord.h \ ./Source/Control/Command/Records/CStopProcessCommandRecord.h \ ./Source/Control/Command/Records/CUnspecifiedMessageErrorRecord.h \ ./Source/Control/Command/Records/CUnspecifiedMessageInformationRecord.h \ ./Source/Control/Loader/CAnalyseReasonerLoader.h \ ./Source/Control/Loader/CCLIBatchProcessingLoader.h \ ./Source/Control/Loader/CCLIClassificationBatchProcessingLoader.h \ ./Source/Control/Loader/CCLIConsistencyBatchProcessingLoader.h \ ./Source/Control/Loader/CCLIRealizationBatchProcessingLoader.h \ ./Source/Control/Loader/CCLISatisfiabilityBatchProcessingLoader.h \ ./Source/Control/Loader/CCloser.h \ ./Source/Control/Loader/CCommandLineLoader.h \ ./Source/Control/Loader/CCommandLineTranlatorHelpLoader.h \ ./Source/Control/Loader/CConfigurableCoutLogObserverLoader.h \ ./Source/Control/Loader/CCoutLogObserverLoader.h \ ./Source/Control/Loader/CDefaultLoaderFactory.h \ ./Source/Control/Loader/CDefaultReasonerLoader.h \ ./Source/Control/Loader/CExperimentalReasonerLoader.h \ ./Source/Control/Loader/CLargeJoinTestDataGeneratorLoader.h \ ./Source/Control/Loader/CLoader.h \ ./Source/Control/Loader/CLoaderFactory.h \ ./Source/Control/Loader/CLoggerConfigurationLoader.h \ ./Source/Control/Loader/COREBatchProcessingLoader.h \ ./Source/Control/Loader/CORECoutLogObserverLoader.h \ ./Source/Control/Loader/COWLFilesIncompatibleAxiomChangerLoader.h \ ./Source/Control/Loader/COWLFilesOWLlinkTestcaseGeneratorLoader.h \ ./Source/Control/Loader/COWLlinkBatchFileLoader.h \ ./Source/Control/Loader/COWLlinkHttpServerLoader.h \ ./Source/Control/Loader/CPigenholePrincipleGeneratorLoader.h \ ./Source/Control/Loader/CReasonerEvaluationClassificationTimesComparerLoader.h \ ./Source/Control/Loader/CReasonerEvaluationLoader.h \ ./Source/Control/Loader/CReasonerEvaluationLoadingTimesComparerLoader.h \ ./Source/Control/Loader/CReasonerEvaluationOntologyExtractionLoader.h \ ./Source/Control/Loader/CReasonerEvaluationProgramLoader.h \ ./Source/Control/Loader/CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader.h \ ./Source/Control/Loader/CRecursionTestDataGeneratorLoader.h \ ./Source/Control/Loader/CTestHashModificationLoader.h \ ./Source/Control/Loader/CTestMemoryAccessLoader.h \ ./Source/Control/Loader/CTestOWLlinkAPIBatchFileLoader.h \ ./Source/Control/Loader/CTestQHashVsQMapLoader.h \ ./Source/Control/Loader/CTestTaskThroughputLoader.h \ ./Source/Control/Loader/CTransitiveConnectedELClassesTestDataGeneratorLoader.h \ ./Source/Control/Loader/LoaderSettings.h \ ./Source/Control/Interface/OWLlink/COWLlinkHttpConnectionHandlerProcessor.h \ ./Source/Control/Interface/OWLlink/COWLlinkHttpConnectionHandlerProcessorFactory.h \ ./Source/Control/Interface/OWLlink/COWLlinkProcessor.h \ ./Source/Control/Interface/OWLlink/COWLLinkRecordInterpreter.h \ ./Source/Control/Interface/OWLlink/OWLlinkSettings.h \ ./Source/Control/Interface/CommandLine/CCLIClassificationComandLinePreparationTranslator.h \ ./Source/Control/Interface/CommandLine/CCLIComandLinePreparationTranslator.h \ ./Source/Control/Interface/CommandLine/CCLIConsistencyComandLinePreparationTranslator.h \ ./Source/Control/Interface/CommandLine/CCLIRealizationComandLinePreparationTranslator.h \ ./Source/Control/Interface/CommandLine/CCLISatisfiabilityComandLinePreparationTranslator.h \ ./Source/Control/Interface/CommandLine/CCommandLinePreparationTranslator.h \ ./Source/Control/Interface/CommandLine/CCommandLinePreparationTranslatorSelector.h \ ./Source/Control/Interface/CommandLine/COWLLinkFileComandLinePreparationTranslator.h \ ./Source/Control/Interface/CommandLine/COWLLinkServerComandLinePreparationTranslator.h \ ./Source/Test/CCacheTestReader.h \ ./Source/Test/CCacheTestWriter.h \ ./Source/Test/CConcurrentHashModificationTester.h \ ./Source/Test/CConcurrentMemoryAccessTester.h \ ./Source/Test/CConcurrentOccurenceUnsatisfiableCacheTester.h \ ./Source/Test/CConcurrentThroughputTestTaskTester.h \ ./Source/Test/CHashModificationThread.h \ ./Source/Test/CMemoryAccessThread.h \ ./Source/Test/COWLFileAxiomRemover.h \ ./Source/Test/COWLFileOWLlinkClassifyRequestGenerator.h \ ./Source/Test/COWLFileOWLlinkConsistencyRequestGenerator.h \ ./Source/Test/COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator.h \ ./Source/Test/COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator.h \ ./Source/Test/COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator.h \ ./Source/Test/COWLFileOWLlinkIncrementalAssertionRequestGenerator.h \ ./Source/Test/COWLFileOWLlinkSatisfiabilityRequestGenerator.h \ ./Source/Test/COWLFileOWLlinkTypesRequestGenerator.h \ ./Source/Test/COWLLargeJoinTestDataGenerator.h \ ./Source/Test/COWLlinkAPIReasonerTestfileTester.h \ ./Source/Test/COWLPigeonholePrincipleGenerator.h \ ./Source/Test/COWLRecursionTestDataGenerator.h \ ./Source/Test/COWLTransitiveConnectedELClassesTestDataGenerator.h \ ./Source/Test/CQHashVsQMapTester.h \ ./Source/Test/CReasonerTestfileErrorEvaluator.h \ ./Source/Test/CReasonerTestfileEvaluator.h \ ./Source/Test/CReasonerTestfileTest.h \ ./Source/Test/CReasonerTestfileTester.h \ ./Source/Test/CReasonerTestfileTestResult.h \ ./Source/Test/CReasonerTestsuiteTest.h \ ./Source/Test/CReasonerTestsuiteTester.h \ ./Source/Test/CReasonerTestsuiteTestResult.h \ ./Source/Test/CThroughputTestTask.h \ ./Source/Test/CThroughputTestTaskHandleAlgorithm.h \ ./Source/Test/CThroughputTestTaskTester.h \ ./Source/Test/TestSettings.h \ ./Source/Test/Analyse/AnalyseSettings.h \ ./Source/Test/Analyse/CAnalyseData.h \ ./Source/Test/Analyse/CAnalyseDataCVSFileWriterObserver.h \ ./Source/Test/Analyse/CAnalyseDataDescription.h \ ./Source/Test/Analyse/CAnalyseDataLinker.h \ ./Source/Test/Analyse/CAnalyseDataObserver.h \ ./Source/Test/Analyse/CAnalyseDataSeries.h \ ./Source/Test/Analyse/CAnalyseDataUpdateItem.h \ ./Source/Test/Analyse/CAnalyseDataUpdater.h \ ./Source/Test/Analyse/CAnalyseDescription.h \ ./Source/Test/Analyse/CAnalyseUpdateDescription.h \ ./Source/Test/Analyse/CAnalyseValue.h \ ./Source/Test/Analyse/CAnalyseValueDescription.h \ ./Source/Test/Analyse/CAnalyseValueUpdateReader.h \ ./Source/Test/Analyse/Reader/CCalculationTableauCompletionAlgorithmUpdateReader.h \ ./Source/Test/Analyse/CConvertDoubleAnalyseValue.h \ ./Source/Test/Analyse/CConvertIntegerAnalyseValue.h \ ./Source/Test/Analyse/CConvertStringAnalyseValue.h \ ./Source/Test/Analyse/CDifferenceValueAnalyser.h \ ./Source/Test/Analyse/CDoubleAnalyseValue.h \ ./Source/Test/Analyse/CIntegerAnalyseValue.h \ ./Source/Test/Analyse/CMinMaxAvgCountValueAnalyser.h \ ./Source/Test/Analyse/CMinMaxAvgLimitedCountValueAnalyser.h \ ./Source/Test/Analyse/CMinMaxFixedAvgCountValueAnalyser.h \ ./Source/Test/Analyse/CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser.h \ ./Source/Test/Analyse/CStringAnalyseValue.h \ ./Source/Test/Analyse/CValueAnalyser.h \ ./Source/Test/Analyse/Reader/CAnalyseValueMinMaxAvgExtendedUpdateReader.h \ ./Source/Test/Analyse/Reader/CClassificationProgressUpdateReader.h \ ./Source/Test/Analyse/Reader/CClassificationStatisticsUpdateReader.h \ ./Source/Test/Analyse/Reader/CClassificationStatusUpdateReader.h \ ./Source/Test/Analyse/Reader/CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader.h \ ./Source/Test/Analyse/Reader/CReasonerWorkloadUpdateReader.h \ ./Source/Test/Analyse/Reader/CTaskProcesserBlockingCountUpdateReader.h \ ./Source/Test/Analyse/Reader/CTaskProcessingUpdateReader.h \ ./Source/Test/Analyse/Reader/CTaskReserveQueueUpdateReader.h \ ./Source/Test/Analyse/Reader/CTestTaskThroughputReader.h \ ./Source/Test/Analyse/Reader/CThreadTimesUpdateReader.h \ ./Source/Test/Events/CEvaluateTestfileTestEvent.h \ ./Source/Test/Events/CTestTestfileEvent.h \ ./Source/Test/Evaluation/CConfigDependendReasonerEvaluationFactory.h \ ./Source/Test/Evaluation/CCriticalSystemProcessTester.h \ ./Source/Test/Evaluation/CReasonerEvaluationAnalyseContext.h \ ./Source/Test/Evaluation/CReasonerEvaluationAnalyser.h \ ./Source/Test/Evaluation/CReasonerEvaluationAnalyserChecker.h \ ./Source/Test/Evaluation/CReasonerEvaluationAvaragerSummarizer.h \ ./Source/Test/Evaluation/CReasonerEvaluationClassificationTimeExtractor.h \ ./Source/Test/Evaluation/CReasonerEvaluationCollector.h \ ./Source/Test/Evaluation/CReasonerEvaluationConfigurationLoader.h \ ./Source/Test/Evaluation/CReasonerEvaluationDataValue.h \ ./Source/Test/Evaluation/CReasonerEvaluationDataValueCacher.h \ ./Source/Test/Evaluation/CReasonerEvaluationDataValueGroup.h \ ./Source/Test/Evaluation/CReasonerEvaluationDataValueGroupCollection.h \ ./Source/Test/Evaluation/CReasonerEvaluationDataValueGroupCollectionReasonerComparison.h \ ./Source/Test/Evaluation/CReasonerEvaluationDirectoryStructureSelectorFactory.h \ ./Source/Test/Evaluation/CReasonerEvaluationDoubleDataValue.h \ ./Source/Test/Evaluation/CReasonerEvaluationEvaluatedCallbackContextData.h \ ./Source/Test/Evaluation/CReasonerEvaluationEvaluator.h \ ./Source/Test/Evaluation/CReasonerEvaluationExecutionCallbackContextData.h \ ./Source/Test/Evaluation/CReasonerEvaluationExecutor.h \ ./Source/Test/Evaluation/CReasonerEvaluationExecutorThread.h \ ./Source/Test/Evaluation/CReasonerEvaluationExpressivityRequestSelector.h \ ./Source/Test/Evaluation/CReasonerEvaluationExpressivitySelectorFactory.h \ ./Source/Test/Evaluation/CReasonerEvaluationExtractor.h \ ./Source/Test/Evaluation/CReasonerEvaluationFactory.h \ ./Source/Test/Evaluation/CReasonerEvaluationFilter.h \ ./Source/Test/Evaluation/CReasonerEvaluationFilterCondition.h \ ./Source/Test/Evaluation/CReasonerEvaluationFiltering.h \ ./Source/Test/Evaluation/CReasonerEvaluationFilterIntegerCondition.h \ ./Source/Test/Evaluation/CReasonerEvaluationFilterStringCondition.h \ ./Source/Test/Evaluation/CReasonerEvaluationGNUPlotPlotter.h \ ./Source/Test/Evaluation/CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser.h \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser.h \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser.h \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser.h \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.h \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser.h \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerErrorAnalyser.h \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser.h \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser.h \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser.h \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser.h \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestSelector.h \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser.h \ ./Source/Test/Evaluation/CReasonerEvaluationHighchartPlotter.h \ ./Source/Test/Evaluation/CReasonerEvaluationHTMLNavigationOverviewSummarizer.h \ ./Source/Test/Evaluation/CReasonerEvaluationIntegerDataValue.h \ ./Source/Test/Evaluation/CReasonerEvaluationLoadingTimeExtractor.h \ ./Source/Test/Evaluation/CReasonerEvaluationManager.h \ ./Source/Test/Evaluation/CReasonerEvaluationManagerThread.h \ ./Source/Test/Evaluation/CReasonerEvaluationPathConverter.h \ ./Source/Test/Evaluation/CReasonerEvaluationProfileRequestSelector.h \ ./Source/Test/Evaluation/CReasonerEvaluationProfileSelectorFactory.h \ ./Source/Test/Evaluation/CReasonerEvaluationProgram.h \ ./Source/Test/Evaluation/CReasonerEvaluationProvider.h \ ./Source/Test/Evaluation/CReasonerEvaluationRequestClient.h \ ./Source/Test/Evaluation/CReasonerEvaluationRequestClientThread.h \ ./Source/Test/Evaluation/CReasonerEvaluationRequestResponse.h \ ./Source/Test/Evaluation/CReasonerEvaluationRequestResult.h \ ./Source/Test/Evaluation/CReasonerEvaluationResponseFileExtractor.h \ ./Source/Test/Evaluation/CReasonerEvaluationResponseFileListSummarizer.h \ ./Source/Test/Evaluation/CReasonerEvaluationResponseTimeExtractor.h \ ./Source/Test/Evaluation/CReasonerEvaluationSpecifiedTimeExtractor.h \ ./Source/Test/Evaluation/CReasonerEvaluationStatisticsNameCollectingExtractor.h \ ./Source/Test/Evaluation/CReasonerEvaluationStatisticsValueExtractor.h \ ./Source/Test/Evaluation/CReasonerEvaluationStringListValue.h \ ./Source/Test/Evaluation/CReasonerEvaluationStringMatchGroupSelector.h \ ./Source/Test/Evaluation/CReasonerEvaluationStringValue.h \ ./Source/Test/Evaluation/CReasonerEvaluationSummarizer.h \ ./Source/Test/Evaluation/CReasonerEvaluationTableMultiFormatOutputWriter.h \ ./Source/Test/Evaluation/CReasonerEvaluationTerminationResult.h \ ./Source/Test/Evaluation/CReasonerEvaluationTestsuite.h \ ./Source/Test/Evaluation/CReasonerEvaluationTimeoutErrorExtractor.h \ ./Source/Test/Evaluation/CReasonerEvaluationUpdater.h \ ./Source/Test/Evaluation/CReasonerEvaluationUpdaterThread.h \ ./Source/Test/Evaluation/CReasonerExecutableEvaluationProvider.h \ ./Source/Test/Evaluation/CReasonerKoncludeEvaluationProvider.h \ ./Source/Test/Evaluation/CReasonerOWLlinkEvaluationProvider.h \ ./Source/Test/Evaluation/EvaluationSettings.h \ ./Source/Test/Evaluation/Events/CReasonerEvaluationNextEvent.h \ ./Source/Test/Evaluation/Events/CReasonerEvaluationProgramEvent.h \ ./Source/Test/Evaluation/Events/CReasonerEvaluationProgramFileChangedEvent.h \ ./Source/Test/Evaluation/Events/CReasonerEvaluationStartEvent.h \ ./Source/Test/Evaluation/Events/CReasonerEvaluationTestsuiteEvent.h \ ./Source/Test/Evaluation/Events/CReasonerEvaluationUpdateEvent.h \ ./Source/Concurrent/CEvent.h \ ./Source/Concurrent/CEventAllocator.h \ ./Source/Concurrent/CEventChannel.h \ ./Source/Concurrent/CEventChannelLinker.h \ ./Source/Concurrent/CEventCommunicator.h \ ./Source/Concurrent/CEventHandler.h \ ./Source/Concurrent/CEventLinker.h \ ./Source/Concurrent/CEventLinkerChannel.h \ ./Source/Concurrent/CEventLinkerProvider.h \ ./Source/Concurrent/CEventLinkerQueue.h \ ./Source/Concurrent/CEventProcessor.h \ ./Source/Concurrent/CEventQueue.h \ ./Source/Concurrent/CEventThread.h \ ./Source/Concurrent/CIntervalThread.h \ ./Source/Concurrent/CIntervalThreadData.h \ ./Source/Concurrent/ConcurrentSettings.h \ ./Source/Concurrent/CQueuedLinkedEventHandler.h \ ./Source/Concurrent/CSyncedEventChannel.h \ ./Source/Concurrent/CSyncedFreeEventChannel.h \ ./Source/Concurrent/CThread.h \ ./Source/Concurrent/CThreadActivator.h \ ./Source/Concurrent/CWatchDog.h \ ./Source/Concurrent/CWatchDogThread.h \ ./Source/Concurrent/CWatchDogThreadData.h \ ./Source/Concurrent/Events/CControlEvent.h \ ./Source/Concurrent/Events/CCustomCallbackEvent.h \ ./Source/Concurrent/Events/CCustomEvent.h \ ./Source/Concurrent/Events/CHandleEventsEvent.h \ ./Source/Concurrent/Events/CRequestFeedbackEvent.h \ ./Source/Concurrent/Events/CTimerIntervalEvent.h \ ./Source/Concurrent/Events/CWaitSynchronizationEvent.h \ ./Source/Concurrent/Events/CWatchDogFeedbackEvent.h \ ./Source/Concurrent/Callback/CallbackSettings.h \ ./Source/Concurrent/Callback/CBlockingCallbackData.h \ ./Source/Concurrent/Callback/CCallbackData.h \ ./Source/Concurrent/Callback/CCallbackDataContext.h \ ./Source/Concurrent/Callback/CCallbackListExecuter.h \ ./Source/Concurrent/Callback/CCallbackRememberLinkedExecuter.h \ ./Source/Concurrent/Callback/CSynchronizedCallbackListExecuter.h \ ./Source/Context/CContext.h \ ./Source/Context/CContextBase.h \ ./Source/Context/ContextSettings.h \ ./Source/Network/CNetworkRequest.h \ ./Source/Network/CNetworkResponse.h \ ./Source/Network/NetworkSettings.h \ ./Source/Network/HTTP/CHttpRequest.h \ ./Source/Network/HTTP/CHttpRequestFactory.h \ ./Source/Network/HTTP/CHttpResponse.h \ ./Source/Network/HTTP/CHttpResponseExtractor.h \ ./Source/Network/HTTP/CHttpTransactionManager.h \ ./Source/Network/HTTP/CQtHttpConnectionHandler.h \ ./Source/Network/HTTP/CQtHttpConnectionHandlerFactory.h \ ./Source/Network/HTTP/CQtHttpConnectionHandlerPooledFactory.h \ ./Source/Network/HTTP/CQtHttpConnectionHandlerReleaser.h \ ./Source/Network/HTTP/CQtHttpDownloadFileRequest.h \ ./Source/Network/HTTP/CQtHttpListner.h \ ./Source/Network/HTTP/CQtHttpPooledConnectionHandler.h \ ./Source/Network/HTTP/CQtHttpRequest.h \ ./Source/Network/HTTP/CQtHttpRequestBodyOnlyParser.h \ ./Source/Network/HTTP/CQtHttpRequestParser.h \ ./Source/Network/HTTP/CQtHttpResponse.h \ ./Source/Network/HTTP/CQtHttpTransactionManager.h \ ./Source/Network/HTTP/HttpSettings.h \ ./Source/Network/HTTP/Events/CAddResponseFinishedCallbackEvent.h \ ./Source/Network/HTTP/Events/CConnectionDisconnectedEvent.h \ ./Source/Network/HTTP/Events/CConnectionReadyReadEvent.h \ ./Source/Network/HTTP/Events/CExtractResponseDataCallbackEvent.h \ ./Source/Network/HTTP/Events/CExtractResponseDataEvent.h \ ./Source/Network/HTTP/Events/CHandleIncomingHttpConnectionEvent.h \ ./Source/Network/HTTP/Events/CHttpReplyFinishedEvent.h \ ./Source/Network/HTTP/Events/CHttpRequstEvent.h \ ./Source/Network/HTTP/Events/CInstallRequestFinishedCallbackEvent.h \ ./Source/Network/HTTP/Events/CReleaseResponseEvent.h \ ./Source/Renderer/COntologyEmptyDefaultRenderer.h \ ./Source/Renderer/COntologyExtractionManager.h \ ./Source/Renderer/COntologyOWL2QtXMLRenderer.h \ ./Source/Renderer/COntologyParsedBuildExpressionRenderVisitor.h \ ./Source/Renderer/COntologyRenderer.h \ ./Source/Renderer/COntologyRenderVisitor.h \ ./Source/Renderer/CRenderedItemLinker.h \ ./Source/Renderer/CRenderedQtXMLItemLinker.h \ ./Source/Renderer/CRenderWriteManager.h \ ./Source/Renderer/RendererSettings.h \ ./Source/Test/COWLFileOWLlinkRealizeRequestGenerator.h SOURCES += ./Source/CKoncludeInfo.cpp \ ./Source/mainLoader.cpp \ ./Source/Parser/CABoxAxiomBuilder.cpp \ ./Source/Parser/CAxiomOntologyBuilder.cpp \ ./Source/Parser/CCommandParser.cpp \ ./Source/Parser/CContinueParsingWaitingCondition.cpp \ ./Source/Parser/CKRSSOntologyParser.cpp \ ./Source/Parser/COntologyBuilder.cpp \ ./Source/Parser/COntologyParser.cpp \ ./Source/Parser/COWL2QtXMLOntologyParser.cpp \ ./Source/Parser/COWL2QtXMLOntologySAXParser.cpp \ ./Source/Parser/COWL2QtXMLOntologyStableStreamParser.cpp \ ./Source/Parser/COWL2QtXMLOntologyStreamParser.cpp \ ./Source/Parser/COWLlinkQtXMLCommandParser.cpp \ ./Source/Parser/COWLlinkQtXMLComplexQueryParser.cpp \ ./Source/Parser/COWLlinkQtXMLResultParser.cpp \ ./Source/Parser/COWLlinkQtXMLSimpleQueryParser.cpp \ ./Source/Parser/COWLlinkQueryExtensionParser.cpp \ ./Source/Parser/COWLlinkQueryParser.cpp \ ./Source/Parser/CParseRuleAtom.cpp \ ./Source/Parser/CParsingExpressionSplitter.cpp \ ./Source/Parser/CParsingHandlingContext.cpp \ ./Source/Parser/CParsingProgressionRecording.cpp \ ./Source/Parser/CQtXMLContentHandlerConverter.cpp \ ./Source/Parser/CQueryBuilder.cpp \ ./Source/Parser/CQueryParser.cpp \ ./Source/Parser/CRBoxAxiomBuilder.cpp \ ./Source/Parser/CStringPrimitiveConverter.cpp \ ./Source/Parser/CTBoxAxiomBuilder.cpp \ ./Source/Parser/CXMLHandler.cpp \ ./Source/Parser/CXMLHandlerStack.cpp \ ./Source/Parser/CXMLHandlerStackBase.cpp \ ./Source/Parser/CXMLOWL2Handler.cpp \ ./Source/Parser/CXMLOWL2StreamHandler.cpp \ ./Source/Parser/CXMLParsingHandlingContext.cpp \ ./Source/Parser/CXMLParsingHandlingContextBase.cpp \ ./Source/Parser/CXMLTestsuiteCommandParser.cpp \ ./Source/Parser/Expressions/CAnonymousIndividualExpression.cpp \ ./Source/Parser/Expressions/CAssertionAxiomExpression.cpp \ ./Source/Parser/Expressions/CAsymmetricObjectPropertyExpression.cpp \ ./Source/Parser/Expressions/CAxiomExpression.cpp \ ./Source/Parser/Expressions/CBuildExpression.cpp \ ./Source/Parser/Expressions/CCardinalityAssociator.cpp \ ./Source/Parser/Expressions/CClassAssertionExpression.cpp \ ./Source/Parser/Expressions/CClassAxiomExpression.cpp \ ./Source/Parser/Expressions/CClassExpression.cpp \ ./Source/Parser/Expressions/CClassExpressionAssociator.cpp \ ./Source/Parser/Expressions/CClassTermExpression.cpp \ ./Source/Parser/Expressions/CClassTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CClassVariableTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CDataAllValuesFromExpression.cpp \ ./Source/Parser/Expressions/CDataCardinalityExpression.cpp \ ./Source/Parser/Expressions/CDataComplementOfExpression.cpp \ ./Source/Parser/Expressions/CDataExactCardinalityExpression.cpp \ ./Source/Parser/Expressions/CDataFacetExpression.cpp \ ./Source/Parser/Expressions/CDataFacetExpressionAssociator.cpp \ ./Source/Parser/Expressions/CDataFacetRestrictionExpression.cpp \ ./Source/Parser/Expressions/CDataFacetRestrictionExpressionAssociator.cpp \ ./Source/Parser/Expressions/CDataHasValueExpression.cpp \ ./Source/Parser/Expressions/CDataIntersectionOfExpression.cpp \ ./Source/Parser/Expressions/CDataLexicalValueExpression.cpp \ ./Source/Parser/Expressions/CDataLexicalValueExpressionAssociator.cpp \ ./Source/Parser/Expressions/CDataLiteralExpression.cpp \ ./Source/Parser/Expressions/CDataLiteralExpressionAssociator.cpp \ ./Source/Parser/Expressions/CDataMaxCardinalityExpression.cpp \ ./Source/Parser/Expressions/CDataMinCardinalityExpression.cpp \ ./Source/Parser/Expressions/CDataOneOfExpression.cpp \ ./Source/Parser/Expressions/CDataPropertyAssertionExpression.cpp \ ./Source/Parser/Expressions/CDataPropertyAxiomExpression.cpp \ ./Source/Parser/Expressions/CDataPropertyDomainExpression.cpp \ ./Source/Parser/Expressions/CDataPropertyExpression.cpp \ ./Source/Parser/Expressions/CDataPropertyRangeExpression.cpp \ ./Source/Parser/Expressions/CDataPropertyTermExpression.cpp \ ./Source/Parser/Expressions/CDataPropertyTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CDataRangeTermExpression.cpp \ ./Source/Parser/Expressions/CDataRangeTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CDataSomeValuesFromExpression.cpp \ ./Source/Parser/Expressions/CDatatypeExpression.cpp \ ./Source/Parser/Expressions/CDatatypeExpressionAssociator.cpp \ ./Source/Parser/Expressions/CDatatypeRestrictionExpression.cpp \ ./Source/Parser/Expressions/CDataUnionOfExpression.cpp \ ./Source/Parser/Expressions/CDeclarationAxiomExpression.cpp \ ./Source/Parser/Expressions/CDifferentIndividualsExpression.cpp \ ./Source/Parser/Expressions/CDisjointClassesExpression.cpp \ ./Source/Parser/Expressions/CDisjointDataPropertiesExpression.cpp \ ./Source/Parser/Expressions/CDisjointObjectPropertiesExpression.cpp \ ./Source/Parser/Expressions/CDisjointUnionExpression.cpp \ ./Source/Parser/Expressions/CEntailmentAxiomExpressionAssociation.cpp \ ./Source/Parser/Expressions/CEntityAssociator.cpp \ ./Source/Parser/Expressions/CEquivalentClassesExpression.cpp \ ./Source/Parser/Expressions/CEquivalentDataPropertiesExpression.cpp \ ./Source/Parser/Expressions/CEquivalentObjectPropertiesExpression.cpp \ ./Source/Parser/Expressions/CExpressionAssociator.cpp \ ./Source/Parser/Expressions/CExpressionEntity.cpp \ ./Source/Parser/Expressions/CExpressionHashMixer.cpp \ ./Source/Parser/Expressions/CFunctionalDataPropertyExpression.cpp \ ./Source/Parser/Expressions/CFunctionalObjectPropertyExpression.cpp \ ./Source/Parser/Expressions/CIndividualExpression.cpp \ ./Source/Parser/Expressions/CIndividualTermExpression.cpp \ ./Source/Parser/Expressions/CIndividualTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CInverseFunctionalObjectPropertyExpression.cpp \ ./Source/Parser/Expressions/CInverseObjectPropertiesExpression.cpp \ ./Source/Parser/Expressions/CInverseObjectPropertyOfExpression.cpp \ ./Source/Parser/Expressions/CIrreflexiveObjectPropertyExpression.cpp \ ./Source/Parser/Expressions/CListAxiomExpressionAssociator.cpp \ ./Source/Parser/Expressions/CListClassTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CListClassVariableTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CListDataFacetRestrictionExpressionAssociator.cpp \ ./Source/Parser/Expressions/CListDataPropertyTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CListDataRangeTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CListExpression.cpp \ ./Source/Parser/Expressions/CListExpressionAssociator.cpp \ ./Source/Parser/Expressions/CListIndividualTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CListObjectPropertyTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CListRuleAtomTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CNameAssociator.cpp \ ./Source/Parser/Expressions/CNamedIndividualExpression.cpp \ ./Source/Parser/Expressions/CNameExpression.cpp \ ./Source/Parser/Expressions/CNegativeDataPropertyAssertionExpression.cpp \ ./Source/Parser/Expressions/CNegativeObjectPropertyAssertionExpression.cpp \ ./Source/Parser/Expressions/CObjectAllValuesFromExpression.cpp \ ./Source/Parser/Expressions/CObjectCardinalityExpression.cpp \ ./Source/Parser/Expressions/CObjectComplementOfExpression.cpp \ ./Source/Parser/Expressions/CObjectExactlyCardinalityExpression.cpp \ ./Source/Parser/Expressions/CObjectExpression.cpp \ ./Source/Parser/Expressions/CObjectHasSelfExpression.cpp \ ./Source/Parser/Expressions/CObjectHasValueExpression.cpp \ ./Source/Parser/Expressions/CObjectIndividualVariableExpression.cpp \ ./Source/Parser/Expressions/CObjectIntersectionOfExpression.cpp \ ./Source/Parser/Expressions/CObjectMaxCardinalityExpression.cpp \ ./Source/Parser/Expressions/CObjectMinCardinalityExpression.cpp \ ./Source/Parser/Expressions/CObjectOneOfExpression.cpp \ ./Source/Parser/Expressions/CObjectPropertyAssertionExpression.cpp \ ./Source/Parser/Expressions/CObjectPropertyAxiomExpression.cpp \ ./Source/Parser/Expressions/CObjectPropertyChainExpression.cpp \ ./Source/Parser/Expressions/CObjectPropertyDomainExpression.cpp \ ./Source/Parser/Expressions/CObjectPropertyExpression.cpp \ ./Source/Parser/Expressions/CObjectPropertyRangeExpression.cpp \ ./Source/Parser/Expressions/CObjectPropertyTermExpression.cpp \ ./Source/Parser/Expressions/CObjectPropertyTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CObjectSomeValuesFromExpression.cpp \ ./Source/Parser/Expressions/CObjectUnionOfExpression.cpp \ ./Source/Parser/Expressions/COrderedListObjectPropertyTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/COrderedPairClassTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/COrderedPairDataPropertyTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/COrderedPairExpressionAssociator.cpp \ ./Source/Parser/Expressions/COrderedPairIndividualTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/COrderedPairObjectPropertyTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CPairExpression.cpp \ ./Source/Parser/Expressions/CPairExpressionAssociator.cpp \ ./Source/Parser/Expressions/CPrecedentBuildClassExpression.cpp \ ./Source/Parser/Expressions/CPrecedentBuildIndividualExpression.cpp \ ./Source/Parser/Expressions/CPrecedentBuildPropertyExpression.cpp \ ./Source/Parser/Expressions/CPropertyTermExpression.cpp \ ./Source/Parser/Expressions/CQueryAreClassesDisjointExpression.cpp \ ./Source/Parser/Expressions/CQueryAreClassesEquivalentExpression.cpp \ ./Source/Parser/Expressions/CQueryExpression.cpp \ ./Source/Parser/Expressions/CQueryGetClassAssertionsExpression.cpp \ ./Source/Parser/Expressions/CQueryGetDeterministicClassAssertionsExpression.cpp \ ./Source/Parser/Expressions/CQueryGetDeterministicIndividualsExpression.cpp \ ./Source/Parser/Expressions/CQueryGetEquivalentClassesExpression.cpp \ ./Source/Parser/Expressions/CQueryGetFlattenedInstancesExpression.cpp \ ./Source/Parser/Expressions/CQueryGetFlattenedObjectPropertyTargetsExpression.cpp \ ./Source/Parser/Expressions/CQueryGetFlattenedTypesExpression.cpp \ ./Source/Parser/Expressions/CQueryGetInstancesExpression.cpp \ ./Source/Parser/Expressions/CQueryGetNondeterministicClassAssertionsExpression.cpp \ ./Source/Parser/Expressions/CQueryGetNondeterministicIndividualsExpression.cpp \ ./Source/Parser/Expressions/CQueryGetObjectPropertyTargetsExpression.cpp \ ./Source/Parser/Expressions/CQueryGetSameIndividualsExpression.cpp \ ./Source/Parser/Expressions/CQueryGetSubClassesExpression.cpp \ ./Source/Parser/Expressions/CQueryGetSuperClassesExpression.cpp \ ./Source/Parser/Expressions/CQueryGetTypesExpression.cpp \ ./Source/Parser/Expressions/CQueryIsClassSatisfiableExpression.cpp \ ./Source/Parser/Expressions/CQueryIsClassSubsumedByExpression.cpp \ ./Source/Parser/Expressions/CQueryIsEntailedExpression.cpp \ ./Source/Parser/Expressions/CQueryIsInstanceOfExpression.cpp \ ./Source/Parser/Expressions/CReflexiveObjectPropertyExpression.cpp \ ./Source/Parser/Expressions/CRuleAtomListBodyExpression.cpp \ ./Source/Parser/Expressions/CRuleAtomListExpression.cpp \ ./Source/Parser/Expressions/CRuleAtomListHeadExpression.cpp \ ./Source/Parser/Expressions/CRuleAtomTermExpression.cpp \ ./Source/Parser/Expressions/CRuleClassAtomTermExpression.cpp \ ./Source/Parser/Expressions/CRuleDifferentIndividualsAtomTermExpression.cpp \ ./Source/Parser/Expressions/CRulePropertyAtomTermExpression.cpp \ ./Source/Parser/Expressions/CSameIndividualExpression.cpp \ ./Source/Parser/Expressions/CSubClassOfExpression.cpp \ ./Source/Parser/Expressions/CSubDataPropertyOfExpression.cpp \ ./Source/Parser/Expressions/CSubExpressionVisitor.cpp \ ./Source/Parser/Expressions/CSubObjectPropertyOfExpression.cpp \ ./Source/Parser/Expressions/CSymmetricObjectPropertyExpression.cpp \ ./Source/Parser/Expressions/CTransetiveObjectPropertyExpression.cpp \ ./Source/Parser/Expressions/CUnorderedPairClassTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CUnorderedPairExpressionAssociator.cpp \ ./Source/Parser/Expressions/CUnorderedPairIndividualTermExpressionAssociator.cpp \ ./Source/Parser/Expressions/CUnorderedPairObjectPropertyTermExpressionAssociator.cpp \ ./Source/Parser/FunctionalJAVACC/CConcreteOWL2FunctionalStyleParser.cpp \ ./Source/Parser/FunctionalJAVACC/CharStream.cpp \ ./Source/Parser/FunctionalJAVACC/CJAVACCParser.cpp \ ./Source/Parser/FunctionalJAVACC/COWL2FunctionalJAVACCOntologyStreamParser.cpp \ ./Source/Parser/FunctionalJAVACC/COWL2FunctionalStyleParserErrorHandler.cpp \ ./Source/Parser/FunctionalJAVACC/COWL2FunctionalStyleParserTokenManager.cpp \ ./Source/Parser/FunctionalJAVACC/CQtIODeviceStreamReader.cpp \ ./Source/Parser/FunctionalJAVACC/CTokenBase.cpp \ ./Source/Parser/FunctionalJAVACC/CTokenManager.cpp \ ./Source/Parser/FunctionalJAVACC/OWL2FunctionalStyleParser.cpp \ ./Source/Parser/FunctionalJAVACC/OWL2FunctionalStyleParserTokenManager.cpp \ ./Source/Parser/FunctionalJAVACC/ParseException.cpp \ ./Source/Parser/FunctionalJAVACC/Token.cpp \ ./Source/Parser/FunctionalJAVACC/TokenMgrError.cpp \ ./Source/Logger/CAbstractLogObserver.cpp \ ./Source/Logger/CCallbackRequestLogMessagesContext.cpp \ ./Source/Logger/CConsolePrintConfigurableLogObserver.cpp \ ./Source/Logger/CConsolePrintLogObserver.cpp \ ./Source/Logger/CLogDomain.cpp \ ./Source/Logger/CLogger.cpp \ ./Source/Logger/CLogIdentifier.cpp \ ./Source/Logger/CLogMessage.cpp \ ./Source/Logger/CLogObserverData.cpp \ ./Source/Logger/COREConsolePrintLogObserver.cpp \ ./Source/Logger/COREFilePrintLogObserver.cpp \ ./Source/Logger/CQtDebugPrintLogObserver.cpp \ ./Source/Logger/Events/CConfigureLoggerEvent.cpp \ ./Source/Logger/Events/CLoggingEvent.cpp \ ./Source/Logger/Events/CReleaseLogMessagesEvent.cpp \ ./Source/Logger/Events/CRequestLogMessagesEvent.cpp \ ./Source/Logger/Record/CContextRecordData.cpp \ ./Source/Logger/Record/CContextRecorder.cpp \ ./Source/Utilities/CAllocationLinker.cpp \ ./Source/Utilities/CAllocationObject.cpp \ ./Source/Utilities/CMath.cpp \ ./Source/Utilities/CMemoryReleaser.cpp \ ./Source/Utilities/CObjectContainer.cpp \ ./Source/Utilities/Container/CDataArrayMemoryManager.cpp \ ./Source/Utilities/Container/CDefaultDynamicReferenceVector.cpp \ ./Source/Utilities/Container/CDynamicReferenceBucket.cpp \ ./Source/Utilities/Container/CDynamicReferenceVector.cpp \ ./Source/Utilities/Container/CHash.cpp \ ./Source/Utilities/Container/CLinker.cpp \ ./Source/Utilities/Container/CList.cpp \ ./Source/Utilities/Container/CModelData.cpp \ ./Source/Utilities/Container/CModelDataArray.cpp \ ./Source/Utilities/Container/CModelDataLevelArray.cpp \ ./Source/Utilities/Container/CNegator.cpp \ ./Source/Utilities/Container/CNegLinker.cpp \ ./Source/Utilities/Container/CQtHash.cpp \ ./Source/Utilities/Container/CQtList.cpp \ ./Source/Utilities/Container/CQtManagedRestrictedModificationHash.cpp \ ./Source/Utilities/Container/CQtManagedRestrictedModificationHashBase.cpp \ ./Source/Utilities/Container/CQtManagedRestrictedModificationHashData.cpp \ ./Source/Utilities/Container/CQtManagedRestrictedModificationList.cpp \ ./Source/Utilities/Container/CQtManagedRestrictedModificationListBase.cpp \ ./Source/Utilities/Container/CQtManagedRestrictedModificationListData.cpp \ ./Source/Utilities/Container/CQtManagedRestrictedModificationMap.cpp \ ./Source/Utilities/Container/CQtManagedRestrictedModificationMapBase.cpp \ ./Source/Utilities/Container/CQtManagedRestrictedModificationMapData.cpp \ ./Source/Utilities/Container/CQtManagedRestrictedModificationSet.cpp \ ./Source/Utilities/Container/CQtSet.cpp \ ./Source/Utilities/Container/CQtVector.cpp \ ./Source/Utilities/Container/CSet.cpp \ ./Source/Utilities/Container/CSortedLinker.cpp \ ./Source/Utilities/Container/CSortedNegLinker.cpp \ ./Source/Utilities/Container/CTemporaryDataArrayMemoryStorer.cpp \ ./Source/Utilities/Container/CVector.cpp \ ./Source/Utilities/Memory/CAllocationLimitationProvider.cpp \ ./Source/Utilities/Memory/CAllocationLimitator.cpp \ ./Source/Utilities/Memory/CCentralizedAllocationConfigProvidedDependendLimitation.cpp \ ./Source/Utilities/Memory/CCentralizedAllocationLimitation.cpp \ ./Source/Utilities/Memory/CCentralizedAllocationLimitator.cpp \ ./Source/Utilities/Memory/CConsiderateMemoryPoolProvider.cpp \ ./Source/Utilities/Memory/CLimitedReserveMemoryPoolAllocationManager.cpp \ ./Source/Utilities/Memory/CMemoryAllocationException.cpp \ ./Source/Utilities/Memory/CMemoryAllocationManager.cpp \ ./Source/Utilities/Memory/CMemoryAllocator.cpp \ ./Source/Utilities/Memory/CMemoryPool.cpp \ ./Source/Utilities/Memory/CMemoryPoolAllocationManager.cpp \ ./Source/Utilities/Memory/CMemoryPoolContainer.cpp \ ./Source/Utilities/Memory/CMemoryPoolContainerAllocationManager.cpp \ ./Source/Utilities/Memory/CMemoryPoolProvider.cpp \ ./Source/Utilities/Memory/CMemoryTemporaryAllocationManager.cpp \ ./Source/Utilities/Memory/CNewAllocationMemoryPoolProvider.cpp \ ./Source/Utilities/Memory/CNewCentralizedLimitedAllocationMemoryPoolProvider.cpp \ ./Source/Utilities/Memory/CObjectAllocator.cpp \ ./Source/Utilities/Memory/CObjectMemoryPoolAllocator.cpp \ ./Source/Utilities/Memory/CObjectParameterizingAllocator.cpp \ ./Source/Utilities/Memory/CTempMemoryPoolContainerAllocationManager.cpp \ ./Source/Reasoner/Ontology/CAbbreviatedIRIName.cpp \ ./Source/Reasoner/Ontology/CABox.cpp \ ./Source/Reasoner/Ontology/CActiveEntityCountItem.cpp \ ./Source/Reasoner/Ontology/CActiveEntityCountVector.cpp \ ./Source/Reasoner/Ontology/CActiveEntityIterator.cpp \ ./Source/Reasoner/Ontology/CBoxContext.cpp \ ./Source/Reasoner/Ontology/CBranchingTriggerVector.cpp \ ./Source/Reasoner/Ontology/CCachingTags.cpp \ ./Source/Reasoner/Ontology/CComputedConsequencesCachingData.cpp \ ./Source/Reasoner/Ontology/CConcept.cpp \ ./Source/Reasoner/Ontology/CConceptAssertionLinker.cpp \ ./Source/Reasoner/Ontology/CConceptCycleData.cpp \ ./Source/Reasoner/Ontology/CConceptData.cpp \ ./Source/Reasoner/Ontology/CConceptDataVector.cpp \ ./Source/Reasoner/Ontology/CConceptDependence.cpp \ ./Source/Reasoner/Ontology/CConceptDependenceVector.cpp \ ./Source/Reasoner/Ontology/CConceptNegationPair.cpp \ ./Source/Reasoner/Ontology/CConceptOperator.cpp \ ./Source/Reasoner/Ontology/CConceptProcessData.cpp \ ./Source/Reasoner/Ontology/CConceptReferenceLinking.cpp \ ./Source/Reasoner/Ontology/CConceptRoleBranchingTrigger.cpp \ ./Source/Reasoner/Ontology/CConceptSatisfiableReferenceLinkingData.cpp \ ./Source/Reasoner/Ontology/CConceptSaturationReferenceLinkingData.cpp \ ./Source/Reasoner/Ontology/CConceptTagComparer.cpp \ ./Source/Reasoner/Ontology/CConceptTextFormater.cpp \ ./Source/Reasoner/Ontology/CConceptVector.cpp \ ./Source/Reasoner/Ontology/CConcreteOntology.cpp \ ./Source/Reasoner/Ontology/CConcreteOntologyContextBase.cpp \ ./Source/Reasoner/Ontology/CDataBox.cpp \ ./Source/Reasoner/Ontology/CDataLiteral.cpp \ ./Source/Reasoner/Ontology/CDataLiteralBinaryBase64DataValue.cpp \ ./Source/Reasoner/Ontology/CDataLiteralBinaryDataValue.cpp \ ./Source/Reasoner/Ontology/CDataLiteralBinaryHexDataValue.cpp \ ./Source/Reasoner/Ontology/CDataLiteralBooleanValue.cpp \ ./Source/Reasoner/Ontology/CDataLiteralCompareValue.cpp \ ./Source/Reasoner/Ontology/CDataLiteralDateTimeValue.cpp \ ./Source/Reasoner/Ontology/CDataLiteralDoubleValue.cpp \ ./Source/Reasoner/Ontology/CDataLiteralFloatValue.cpp \ ./Source/Reasoner/Ontology/CDataLiteralIRIValue.cpp \ ./Source/Reasoner/Ontology/CDataLiteralRealValue.cpp \ ./Source/Reasoner/Ontology/CDataLiteralStringValue.cpp \ ./Source/Reasoner/Ontology/CDataLiteralValue.cpp \ ./Source/Reasoner/Ontology/CDataLiteralXMLValue.cpp \ ./Source/Reasoner/Ontology/CDatatype.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryBase64DataTriggers.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryBase64DataType.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryHexDataTriggers.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceBinaryHexDataType.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceBooleanTriggers.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceBooleanType.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceCompareTriggers.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceCompareType.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceConceptTriggeringData.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceConceptTriggerLinker.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceDateTimeTriggers.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceDateTimeType.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceDoubleTriggers.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceDoubleType.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceFloatTriggers.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceFloatType.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceIRITriggers.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceIRIType.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceRealTriggers.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceRealType.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpacesTriggers.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceStringTriggers.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceStringType.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringData.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringIterator.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringMap.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringMapArranger.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceTriggeringMapData.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceTriggers.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceType.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceTypes.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceUnknownType.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceXMLTriggers.cpp \ ./Source/Reasoner/Ontology/CDatatypeValueSpaceXMLType.cpp \ ./Source/Reasoner/Ontology/CDatatypeVector.cpp \ ./Source/Reasoner/Ontology/CExpressionDataBoxMapping.cpp \ ./Source/Reasoner/Ontology/CExtendedConceptReferenceLinkingData.cpp \ ./Source/Reasoner/Ontology/CImplicationReplacementVector.cpp \ ./Source/Reasoner/Ontology/CIndividual.cpp \ ./Source/Reasoner/Ontology/CIndividualBackendCachingData.cpp \ ./Source/Reasoner/Ontology/CIndividualData.cpp \ ./Source/Reasoner/Ontology/CIndividualDependence.cpp \ ./Source/Reasoner/Ontology/CIndividualDependenceTracking.cpp \ ./Source/Reasoner/Ontology/CIndividualDependenceVector.cpp \ ./Source/Reasoner/Ontology/CIndividualProcessData.cpp \ ./Source/Reasoner/Ontology/CIndividualSaturationReferenceLinkingData.cpp \ ./Source/Reasoner/Ontology/CIndividualVector.cpp \ ./Source/Reasoner/Ontology/CIRIName.cpp \ ./Source/Reasoner/Ontology/CMBox.cpp \ ./Source/Reasoner/Ontology/CName.cpp \ ./Source/Reasoner/Ontology/CNamedItem.cpp \ ./Source/Reasoner/Ontology/CNamePrefix.cpp \ ./Source/Reasoner/Ontology/CNominalSchemaTemplate.cpp \ ./Source/Reasoner/Ontology/CNominalSchemaTemplateVector.cpp \ ./Source/Reasoner/Ontology/COntology.cpp \ ./Source/Reasoner/Ontology/COntologyBuildConstructFlags.cpp \ ./Source/Reasoner/Ontology/COntologyBuildData.cpp \ ./Source/Reasoner/Ontology/COntologyBuildExpressionCounter.cpp \ ./Source/Reasoner/Ontology/COntologyContext.cpp \ ./Source/Reasoner/Ontology/COntologyCoreConceptCyclesData.cpp \ ./Source/Reasoner/Ontology/COntologyDataBoxes.cpp \ ./Source/Reasoner/Ontology/COntologyExpressivity.cpp \ ./Source/Reasoner/Ontology/COntologyImportData.cpp \ ./Source/Reasoner/Ontology/COntologyIncrementalAxiomChangeData.cpp \ ./Source/Reasoner/Ontology/COntologyIncrementalRevisionData.cpp \ ./Source/Reasoner/Ontology/COntologyInspector.cpp \ ./Source/Reasoner/Ontology/COntologyLoadingData.cpp \ ./Source/Reasoner/Ontology/COntologyProcessingConceptSaturationRequirement.cpp \ ./Source/Reasoner/Ontology/COntologyProcessingRequirement.cpp \ ./Source/Reasoner/Ontology/COntologyProcessingRequirementExpander.cpp \ ./Source/Reasoner/Ontology/COntologyProcessingStatistics.cpp \ ./Source/Reasoner/Ontology/COntologyProcessingStatus.cpp \ ./Source/Reasoner/Ontology/COntologyProcessingStep.cpp \ ./Source/Reasoner/Ontology/COntologyProcessingStepData.cpp \ ./Source/Reasoner/Ontology/COntologyProcessingStepDataVector.cpp \ ./Source/Reasoner/Ontology/COntologyProcessingStepRequirement.cpp \ ./Source/Reasoner/Ontology/COntologyProcessingSteps.cpp \ ./Source/Reasoner/Ontology/COntologyProcessingStepVector.cpp \ ./Source/Reasoner/Ontology/COntologyStringMapping.cpp \ ./Source/Reasoner/Ontology/COntologyStructureSummary.cpp \ ./Source/Reasoner/Ontology/COntologyTextFormater.cpp \ ./Source/Reasoner/Ontology/CProcessReference.cpp \ ./Source/Reasoner/Ontology/CRBox.cpp \ ./Source/Reasoner/Ontology/CReplacementData.cpp \ ./Source/Reasoner/Ontology/CReverseRoleAssertionLinker.cpp \ ./Source/Reasoner/Ontology/CRole.cpp \ ./Source/Reasoner/Ontology/CRoleAssertionLinker.cpp \ ./Source/Reasoner/Ontology/CRoleChain.cpp \ ./Source/Reasoner/Ontology/CRoleChainVector.cpp \ ./Source/Reasoner/Ontology/CRoleData.cpp \ ./Source/Reasoner/Ontology/CRoleDependence.cpp \ ./Source/Reasoner/Ontology/CRoleDependenceVector.cpp \ ./Source/Reasoner/Ontology/CRoleProcessData.cpp \ ./Source/Reasoner/Ontology/CRoleTagComparer.cpp \ ./Source/Reasoner/Ontology/CRoleVector.cpp \ ./Source/Reasoner/Ontology/CSatisfiableCachingTags.cpp \ ./Source/Reasoner/Ontology/CTagItem.cpp \ ./Source/Reasoner/Ontology/CTBox.cpp \ ./Source/Reasoner/Ontology/CTerminology.cpp \ ./Source/Reasoner/Ontology/CUnsatisfiableCachingTags.cpp \ ./Source/Reasoner/Ontology/CVariable.cpp \ ./Source/Reasoner/Ontology/Memory/COntologyContextCollectionMemoryManager.cpp \ ./Source/Reasoner/Ontology/Memory/COntologyContextCollectionMemoryManagerSingletonProvider.cpp \ ./Source/Reasoner/Ontology/Memory/COntologyContextMemoryManager.cpp \ ./Source/Reasoner/Ontology/Memory/COntologyContextMemoryManagerProvider.cpp \ ./Source/Reasoner/Ontology/Memory/COntologyContextSingleMemoryManager.cpp \ ./Source/Reasoner/Ontology/Memory/COntologyContextSingleMemoryManagerSingletonProvider.cpp \ ./Source/Reasoner/Query/CApproximatedSaturationCalculationConstructionConstruct.cpp \ ./Source/Reasoner/Query/CApproximatedSaturationCalculationJob.cpp \ ./Source/Reasoner/Query/CApproximatedSaturationCalculationProcessingConstruct.cpp \ ./Source/Reasoner/Query/CAreAxiomsEntailedQuery.cpp \ ./Source/Reasoner/Query/CAreClassesDisjointQuery.cpp \ ./Source/Reasoner/Query/CAreClassesEquivalentQuery.cpp \ ./Source/Reasoner/Query/CBooleanQueryResult.cpp \ ./Source/Reasoner/Query/CCalculationJob.cpp \ ./Source/Reasoner/Query/CCalculationJobQueryData.cpp \ ./Source/Reasoner/Query/CClassAssertionQuery.cpp \ ./Source/Reasoner/Query/CClassesResult.cpp \ ./Source/Reasoner/Query/CClassesResultVisitorGenerator.cpp \ ./Source/Reasoner/Query/CClassHierarchyResult.cpp \ ./Source/Reasoner/Query/CClassifyQuery.cpp \ ./Source/Reasoner/Query/CClassSetResult.cpp \ ./Source/Reasoner/Query/CClassSubClassesRelationResult.cpp \ ./Source/Reasoner/Query/CClassSynsetResult.cpp \ ./Source/Reasoner/Query/CClassSynsetsResult.cpp \ ./Source/Reasoner/Query/CClassSynsetsResultVisitorGenerator.cpp \ ./Source/Reasoner/Query/CConsistencePremisingQuery.cpp \ ./Source/Reasoner/Query/CDeterministicClassAssertionQuery.cpp \ ./Source/Reasoner/Query/CDeterministicIndividualsQuery.cpp \ ./Source/Reasoner/Query/CDeterministicNondeterministicIndividualsQuery.cpp \ ./Source/Reasoner/Query/CEquivalentClassesQuery.cpp \ ./Source/Reasoner/Query/CFlattenedInstancesQuery.cpp \ ./Source/Reasoner/Query/CFlattenedObjectPropertyTargetsQuery.cpp \ ./Source/Reasoner/Query/CFlattenedTypesQuery.cpp \ ./Source/Reasoner/Query/CIndividualClassAssertionsResult.cpp \ ./Source/Reasoner/Query/CIndividualsResult.cpp \ ./Source/Reasoner/Query/CIndividualsResultVisitorGenerator.cpp \ ./Source/Reasoner/Query/CIndividualSynonymsResult.cpp \ ./Source/Reasoner/Query/CIndividualSynsetResult.cpp \ ./Source/Reasoner/Query/CIndividualSynsetsResult.cpp \ ./Source/Reasoner/Query/CIndividualSynsetsResultVisitorGenerator.cpp \ ./Source/Reasoner/Query/CInstancesQuery.cpp \ ./Source/Reasoner/Query/CIsClassSatisfiableQuery.cpp \ ./Source/Reasoner/Query/CIsClassSubsumedByQuery.cpp \ ./Source/Reasoner/Query/CIsConsistentQuery.cpp \ ./Source/Reasoner/Query/CIsInstanceOfQuery.cpp \ ./Source/Reasoner/Query/CIsTriviallyConsistentQuery.cpp \ ./Source/Reasoner/Query/CJobProvidedQuery.cpp \ ./Source/Reasoner/Query/CJobSatisfiableCallbackContextData.cpp \ ./Source/Reasoner/Query/CJobSatisfiableResult.cpp \ ./Source/Reasoner/Query/CNondeterministicClassAssertionQuery.cpp \ ./Source/Reasoner/Query/CNondeterministicIndividualsQuery.cpp \ ./Source/Reasoner/Query/CObjectPropertyTargetsQuery.cpp \ ./Source/Reasoner/Query/CQuery.cpp \ ./Source/Reasoner/Query/CQueryCalculationStatisticsCollection.cpp \ ./Source/Reasoner/Query/CQueryError.cpp \ ./Source/Reasoner/Query/CQueryInconsitentOntologyError.cpp \ ./Source/Reasoner/Query/CQueryResult.cpp \ ./Source/Reasoner/Query/CQueryStatistics.cpp \ ./Source/Reasoner/Query/CQueryStatisticsCollectionStrings.cpp \ ./Source/Reasoner/Query/CQuerySupport.cpp \ ./Source/Reasoner/Query/CQueryUnspecifiedStringError.cpp \ ./Source/Reasoner/Query/CQueryWatcher.cpp \ ./Source/Reasoner/Query/CRealizationPremisingQuery.cpp \ ./Source/Reasoner/Query/CRealizeQuery.cpp \ ./Source/Reasoner/Query/CResultInterceptionData.cpp \ ./Source/Reasoner/Query/CSameIndividualsQuery.cpp \ ./Source/Reasoner/Query/CSatisfiableCalculationConceptConstruct.cpp \ ./Source/Reasoner/Query/CSatisfiableCalculationConstruct.cpp \ ./Source/Reasoner/Query/CSatisfiableCalculationJob.cpp \ ./Source/Reasoner/Query/CSatisfiableCalculationJobQueryData.cpp \ ./Source/Reasoner/Query/CSatisfiableCalculationJobsQuery.cpp \ ./Source/Reasoner/Query/CSaturationCalculationConstruct.cpp \ ./Source/Reasoner/Query/CSubClassesQuery.cpp \ ./Source/Reasoner/Query/CSubClassHierarchyQuery.cpp \ ./Source/Reasoner/Query/CSucceedQueryResult.cpp \ ./Source/Reasoner/Query/CSuperClassesQuery.cpp \ ./Source/Reasoner/Query/CTaxonomyPremisingQuery.cpp \ ./Source/Reasoner/Query/CTaxonomyPremisingQuerySupport.cpp \ ./Source/Reasoner/Query/CTypesQuery.cpp \ ./Source/Reasoner/Query/CWriteFunctionalClassSubsumptionsHierarchyQuery.cpp \ ./Source/Reasoner/Query/CWriteFunctionalIndividualFlattenedTypesQuery.cpp \ ./Source/Reasoner/Query/CWriteOWLXMLClassSubsumptionsHierarchyQuery.cpp \ ./Source/Reasoner/Query/CWriteOWLXMLIndividualFlattenedTypesQuery.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendCache.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendCacheWriteData.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCache.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheContext.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheIndividualAssociationData.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheLabelAssociationWriteData.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheReader.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheSlotItem.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryAssociationWriteDataLinker.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryCardinalityWriteDataLinker.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheTemporaryLabelWriteDataLinker.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheWriteData.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCacheWriter.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalityCacheItem.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalitySignatureResolveCacheItem.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryCardinalityValueLinker.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelCacheItem.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelSignatureResolveCacheItem.cpp \ ./Source/Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelValueLinker.cpp \ ./Source/Reasoner/Kernel/Cache/CCache.cpp \ ./Source/Reasoner/Kernel/Cache/CCacheEntry.cpp \ ./Source/Reasoner/Kernel/Cache/CCacheEntryWriteData.cpp \ ./Source/Reasoner/Kernel/Cache/CCacheModificationTagSet.cpp \ ./Source/Reasoner/Kernel/Cache/CCacheStatistics.cpp \ ./Source/Reasoner/Kernel/Cache/CCacheTaggingPool.cpp \ ./Source/Reasoner/Kernel/Cache/CCacheValue.cpp \ ./Source/Reasoner/Kernel/Cache/CCacheValueHasher.cpp \ ./Source/Reasoner/Kernel/Cache/CCompletionGraphCache.cpp \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesCache.cpp \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheContext.cpp \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheEntry.cpp \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheReader.cpp \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheWriteData.cpp \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheWriter.cpp \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesCacheWriteTypesData.cpp \ ./Source/Reasoner/Kernel/Cache/CComputedConsequencesTypesCacheEntry.cpp \ ./Source/Reasoner/Kernel/Cache/CExpanderBranchedLinker.cpp \ ./Source/Reasoner/Kernel/Cache/CExpanderCacheValueLinker.cpp \ ./Source/Reasoner/Kernel/Cache/CIncrementalUnsatisfiableCacheReader.cpp \ ./Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCache.cpp \ ./Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheEntriesHash.cpp \ ./Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheEntry.cpp \ ./Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheReader.cpp \ ./Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheUpdateSlotItem.cpp \ ./Source/Reasoner/Kernel/Cache/COccurrenceUnsatisfiableCacheWriter.cpp \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCache.cpp \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheContext.cpp \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntry.cpp \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryExpandWriteData.cpp \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheEntryWriteData.cpp \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheReader.cpp \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheSlotItem.cpp \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCacheWriter.cpp \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCompatibilityEntryHash.cpp \ ./Source/Reasoner/Kernel/Cache/CReuseCompletionGraphCompatibilityEntryHashData.cpp \ ./Source/Reasoner/Kernel/Cache/CSatisfiableCache.cpp \ ./Source/Reasoner/Kernel/Cache/CSatisfiableCacheReader.cpp \ ./Source/Reasoner/Kernel/Cache/CSatisfiableCacheWriter.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationCache.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedConceptExpansion.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedConceptLinker.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedDependentNominalSet.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedDeterministicConceptExpansion.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCache.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheContext.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheEntry.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheExpansionWriteData.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheReader.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheUnsatisfiabilityWriteData.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheWriteData.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedExpansionCacheWriter.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeAssociatedNondeterministicConceptExpansion.cpp \ ./Source/Reasoner/Kernel/Cache/CSaturationNodeCacheUpdater.cpp \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCache.cpp \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheContext.cpp \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntry.cpp \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryExpandWriteData.cpp \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntrySatisfiableBranchWriteData.cpp \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheEntryWriteData.cpp \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheHasher.cpp \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheReader.cpp \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheRedirectionItem.cpp \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheSlotItem.cpp \ ./Source/Reasoner/Kernel/Cache/CSignatureSatisfiableExpanderCacheWriter.cpp \ ./Source/Reasoner/Kernel/Cache/CUnsatisfiableCache.cpp \ ./Source/Reasoner/Kernel/Cache/CUnsatisfiableCacheReader.cpp \ ./Source/Reasoner/Kernel/Cache/CUnsatisfiableCacheWriter.cpp \ ./Source/Reasoner/Kernel/Cache/Events/CRetrieveIncompletelyAssociationCachedEvent.cpp \ ./Source/Reasoner/Kernel/Cache/Events/CWriteBackendAssociationCachedEvent.cpp \ ./Source/Reasoner/Kernel/Cache/Events/CWriteCachedDataEvent.cpp \ ./Source/Reasoner/Kernel/Cache/Events/CWriteComputedConcequencesCacheEntryEvent.cpp \ ./Source/Reasoner/Kernel/Cache/Events/CWriteExpandCachedEvent.cpp \ ./Source/Reasoner/Kernel/Cache/Events/CWriteSatisfiableBranchCachedEvent.cpp \ ./Source/Reasoner/Kernel/Cache/Events/CWriteSatisfiableCacheEntryEvent.cpp \ ./Source/Reasoner/Kernel/Cache/Events/CWriteSaturationCacheDataEvent.cpp \ ./Source/Reasoner/Kernel/Cache/Events/CWriteUnsatisfiableCacheEntryEvent.cpp \ ./Source/Reasoner/Kernel/Strategy/CConceptProcessingPriorityStrategy.cpp \ ./Source/Reasoner/Kernel/Strategy/CConcreteConceptProcessingOperatorPriorityStrategy.cpp \ ./Source/Reasoner/Kernel/Strategy/CEqualDepthCacheOrientatedProcessingPriorityStrategy.cpp \ ./Source/Reasoner/Kernel/Strategy/CEqualDepthTaskProcessingPriorityStrategy.cpp \ ./Source/Reasoner/Kernel/Strategy/CGenerativeNonDeterministicUnsatisfiableCacheRetrievalStrategy.cpp \ ./Source/Reasoner/Kernel/Strategy/CIndividualAncestorDepthMaximumConceptProcessingPriorityStrategy.cpp \ ./Source/Reasoner/Kernel/Strategy/CIndividualProcessingPriorityStrategy.cpp \ ./Source/Reasoner/Kernel/Strategy/CTaskProcessingPriorityStrategy.cpp \ ./Source/Reasoner/Kernel/Strategy/CUnsatisfiableCacheRetrievalStrategy.cpp \ ./Source/Reasoner/Kernel/Task/CCalculationConfigurationExtension.cpp \ ./Source/Reasoner/Kernel/Task/CCalculationStatisticsCollector.cpp \ ./Source/Reasoner/Kernel/Task/CConsistenceTaskData.cpp \ ./Source/Reasoner/Kernel/Task/CIncrementalConsistenceTaskData.cpp \ ./Source/Reasoner/Kernel/Task/CSatisfiableCalculationJobInstantiation.cpp \ ./Source/Reasoner/Kernel/Task/CSatisfiableCalculationTask.cpp \ ./Source/Reasoner/Kernel/Task/CSatisfiableCalculationTaskJobCallbackExecuter.cpp \ ./Source/Reasoner/Kernel/Task/CSatisfiableCalculationTaskStatusPropagator.cpp \ ./Source/Reasoner/Kernel/Task/CSatisfiableTaskClassificationMessageAdapter.cpp \ ./Source/Reasoner/Kernel/Task/CSatisfiableTaskIncrementalConsistencyTestingAdapter.cpp \ ./Source/Reasoner/Kernel/Task/CSatisfiableTaskIndividualDependenceTrackingAdapter.cpp \ ./Source/Reasoner/Kernel/Task/CSatisfiableTaskRealizationMarkedCandidatesMessageAdapter.cpp \ ./Source/Reasoner/Kernel/Task/CSatisfiableTaskRealizationPossibleAssertionCollectingAdapter.cpp \ ./Source/Reasoner/Kernel/Task/CSaturationIndividualsAnalysingAdapter.cpp \ ./Source/Reasoner/Kernel/Task/CSaturationTaskData.cpp \ ./Source/Reasoner/Kernel/Task/CTaskPreyingAdapter.cpp \ ./Source/Reasoner/Kernel/Task/CTaskPreyingListner.cpp \ ./Source/Reasoner/Kernel/Algorithm/CCalculationAlgorithmContext.cpp \ ./Source/Reasoner/Kernel/Algorithm/CCalculationAlgorithmContextBase.cpp \ ./Source/Reasoner/Kernel/Algorithm/CCalculationChooseTaskHandleAlgorithm.cpp \ ./Source/Reasoner/Kernel/Algorithm/CCalculationClashProcessingException.cpp \ ./Source/Reasoner/Kernel/Algorithm/CCalculationErrorProcessingException.cpp \ ./Source/Reasoner/Kernel/Algorithm/CCalculationStopProcessingException.cpp \ ./Source/Reasoner/Kernel/Algorithm/CCalculationTableauApproximationSaturationTaskHandleAlgorithm.cpp \ ./Source/Reasoner/Kernel/Algorithm/CCalculationTableauCompletionTaskHandleAlgorithm.cpp \ ./Source/Reasoner/Kernel/Algorithm/CClashDescriptorFactory.cpp \ ./Source/Reasoner/Kernel/Algorithm/CCompletionGraphCacheHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CComputedConsequencesCacheHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CConceptNominalSchemaGroundingHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CDatatypeDependencyCollection.cpp \ ./Source/Reasoner/Kernel/Algorithm/CDatatypeIndividualProcessNodeHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CDatatypeValueTestingCollection.cpp \ ./Source/Reasoner/Kernel/Algorithm/CDependencyFactory.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIncrementalCompletionGraphCompatibleExpansionHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualNodeBackendCacheHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualNodeManager.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBinaryBase64DataValueSpaceHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBinaryHexDataValueSpaceHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeBooleanValueSpaceHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeCompareValueSpaceHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeDateTimeValueSpaceHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeDoubleValueSpaceHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeFloatValueSpaceHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeIRIValueSpaceHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeRealValueSpaceHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeStringValueSpaceHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeUnknownValueSpaceHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeValueSpaceHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CIndividualProcessNodeXMLValueSpaceHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CReuseCompletionGraphCacheHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableConsistencyPreyingAnalyser.cpp \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableExpanderCacheHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskClassificationMessageAnalyser.cpp \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskConsistencyPreyingAnalyser.cpp \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskIncrementalConsistencyPreyingAnalyser.cpp \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskMarkerIndividualPropagationAnalyser.cpp \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskPossibleAssertionCollectingAnalyser.cpp \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskSaturationIndividualsAnalyser.cpp \ ./Source/Reasoner/Kernel/Algorithm/CSatisfiableTaskSaturationPreyingAnalyser.cpp \ ./Source/Reasoner/Kernel/Algorithm/CSaturationNodeBackendAssociationCacheHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CSaturationNodeExpansionCacheHandler.cpp \ ./Source/Reasoner/Kernel/Algorithm/CTrackedClashedDependencyLine.cpp \ ./Source/Reasoner/Kernel/Algorithm/CTrackedClashedDescriptor.cpp \ ./Source/Reasoner/Kernel/Algorithm/CTrackedClashedDescriptorHasher.cpp \ ./Source/Reasoner/Kernel/Algorithm/CUnsatisfiableCacheHandler.cpp \ ./Source/Reasoner/Kernel/Process/CAdditionalProcessRoleAssertionsLinker.cpp \ ./Source/Reasoner/Kernel/Process/CAnalizedConceptExpansionLinker.cpp \ ./Source/Reasoner/Kernel/Process/CBackwardPropagationLink.cpp \ ./Source/Reasoner/Kernel/Process/CBackwardPropagationReapplyDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CBackwardSaturationPropagationLink.cpp \ ./Source/Reasoner/Kernel/Process/CBackwardSaturationPropagationReapplyDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CBlockedTestTag.cpp \ ./Source/Reasoner/Kernel/Process/CBlockingAlternativeData.cpp \ ./Source/Reasoner/Kernel/Process/CBlockingAlternativeSignatureBlockingCandidateData.cpp \ ./Source/Reasoner/Kernel/Process/CBlockingFollowSet.cpp \ ./Source/Reasoner/Kernel/Process/CBlockingFollowUpdateTag.cpp \ ./Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateData.cpp \ ./Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateHash.cpp \ ./Source/Reasoner/Kernel/Process/CBlockingIndividualNodeCandidateIterator.cpp \ ./Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinkedCandidateData.cpp \ ./Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinkedCandidateHash.cpp \ ./Source/Reasoner/Kernel/Process/CBlockingIndividualNodeLinker.cpp \ ./Source/Reasoner/Kernel/Process/CBranchingMergingIndividualNodeCandidateLinker.cpp \ ./Source/Reasoner/Kernel/Process/CBranchingMergingProcessingRestrictionSpecification.cpp \ ./Source/Reasoner/Kernel/Process/CBranchingORProcessingRestrictionSpecification.cpp \ ./Source/Reasoner/Kernel/Process/CBranchingTag.cpp \ ./Source/Reasoner/Kernel/Process/CClashedConceptDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CClashedDatatypeValueSpaceExclusionDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CClashedDependencyDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CClashedIndividualDistinctDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CClashedIndividualLinkDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CClashedNegationDisjointLinkDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CConceptDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CConceptDescriptorDependencyPair.cpp \ ./Source/Reasoner/Kernel/Process/CConceptDescriptorDependencyReapplyData.cpp \ ./Source/Reasoner/Kernel/Process/CConceptLabelSet.cpp \ ./Source/Reasoner/Kernel/Process/CConceptLabelSetIterator.cpp \ ./Source/Reasoner/Kernel/Process/CConceptLabelSetModificationTag.cpp \ ./Source/Reasoner/Kernel/Process/CConceptNominalSchemaGroundingData.cpp \ ./Source/Reasoner/Kernel/Process/CConceptNominalSchemaGroundingHash.cpp \ ./Source/Reasoner/Kernel/Process/CConceptNominalSchemaGroundingHasher.cpp \ ./Source/Reasoner/Kernel/Process/CConceptProcessDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CConceptProcessingPriorityQueueData.cpp \ ./Source/Reasoner/Kernel/Process/CConceptProcessingQueue.cpp \ ./Source/Reasoner/Kernel/Process/CConceptProcessingQueueIterator.cpp \ ./Source/Reasoner/Kernel/Process/CConceptProcessLinker.cpp \ ./Source/Reasoner/Kernel/Process/CConceptProcessPriority.cpp \ ./Source/Reasoner/Kernel/Process/CConceptPropagationBindingSetHash.cpp \ ./Source/Reasoner/Kernel/Process/CConceptPropagationBindingSetHashData.cpp \ ./Source/Reasoner/Kernel/Process/CConceptReapplyHash.cpp \ ./Source/Reasoner/Kernel/Process/CConceptRepresentativePropagationSetHash.cpp \ ./Source/Reasoner/Kernel/Process/CConceptRepresentativePropagationSetHashData.cpp \ ./Source/Reasoner/Kernel/Process/CConceptSaturationDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CConceptSaturationDescriptorReapplyData.cpp \ ./Source/Reasoner/Kernel/Process/CConceptSaturationProcessLinker.cpp \ ./Source/Reasoner/Kernel/Process/CConceptSetSignature.cpp \ ./Source/Reasoner/Kernel/Process/CConceptSetStructure.cpp \ ./Source/Reasoner/Kernel/Process/CConceptVariableBindingPathSetHash.cpp \ ./Source/Reasoner/Kernel/Process/CConceptVariableBindingPathSetHashData.cpp \ ./Source/Reasoner/Kernel/Process/CCondensedReapplyConceptDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CCondensedReapplyQueue.cpp \ ./Source/Reasoner/Kernel/Process/CCondensedReapplyQueueIterator.cpp \ ./Source/Reasoner/Kernel/Process/CConnectionSuccessorCorrectionHash.cpp \ ./Source/Reasoner/Kernel/Process/CConnectionSuccessorSet.cpp \ ./Source/Reasoner/Kernel/Process/CConnectionSuccessorSetIterator.cpp \ ./Source/Reasoner/Kernel/Process/CCoreConceptDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CCriticalIndividualNodeConceptTestSet.cpp \ ./Source/Reasoner/Kernel/Process/CCriticalIndividualNodeProcessingQueue.cpp \ ./Source/Reasoner/Kernel/Process/CCriticalPredecessorRoleCardinalityData.cpp \ ./Source/Reasoner/Kernel/Process/CCriticalPredecessorRoleCardinalityHash.cpp \ ./Source/Reasoner/Kernel/Process/CCriticalSaturationConceptQueue.cpp \ ./Source/Reasoner/Kernel/Process/CCriticalSaturationConceptTypeQueues.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeBinaryBase64DataValueSpaceData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeBinaryDataValueSpaceMap.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeBinaryHexDataValueSpaceData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeBooleanValueSpaceData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeBooleanValueSpaceMap.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeCompareValueData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeCompareValueDataExclusion.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceMap.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceMapArranger.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeCompareValueSpaceMapData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeDateTimeValueSpaceData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeDateTimeValueSpaceMap.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeDependencyTrackPointCollection.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeDoubleValueSpaceData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeDoubleValueSpaceMap.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeFloatValueSpaceData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeFloatValueSpaceMap.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeIRIValueSpaceData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeIRIValueSpaceMap.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeRealValueData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeRealValueDataExclusion.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeRealValueExclusionType.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceMap.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceMapArranger.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeRealValueSpaceMapData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeStringValueData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeStringValueDataExclusion.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeStringValueExclusionType.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceMap.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceMapArranger.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeStringValueSpaceMapData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypesValueSpaceData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeUnknownValueSpaceData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeValueSpaceData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeValueSpaceDependencyCollector.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeValueSpaceRealValuesCounter.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeValueSpaceStringValuesCounter.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeValueSpaceValuesCounter.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeXMLValueSpaceData.cpp \ ./Source/Reasoner/Kernel/Process/CDatatypeXMLValueSpaceMap.cpp \ ./Source/Reasoner/Kernel/Process/CDependencyTracker.cpp \ ./Source/Reasoner/Kernel/Process/CDisjointSuccessorRoleHash.cpp \ ./Source/Reasoner/Kernel/Process/CDisjointSuccessorRoleIterator.cpp \ ./Source/Reasoner/Kernel/Process/CDistinctEdge.cpp \ ./Source/Reasoner/Kernel/Process/CDistinctHash.cpp \ ./Source/Reasoner/Kernel/Process/CDistinctIterator.cpp \ ./Source/Reasoner/Kernel/Process/CImplicationReapplyConceptSaturationDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualConceptBatchProcessingData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualConceptBatchProcessingQueue.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualCustomPriorityProcessingQueue.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualDepthConceptProcessDescriptorProcessingQueue.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualDepthConceptProcessDescriptorProcessingQueueData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualDepthPriority.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualDepthProcessingQueue.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualLinkEdge.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualMergingHash.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeAnalizedConceptExpansionData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeBackendCacheSynchronisationData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeBlockData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeBlockingTestData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeExpressivityViolationFlags.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeIncrementalExpansionData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeModelData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeRepresentativeMemoryBackendCacheSynchronisationData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableCacheRetrievalData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableCacheStoringData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCacheRetrievalData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeSatisfiableExpandingCacheStoringData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeSaturationBlockingData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeUnsatisfiableCacheRetrievalData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualNodeUnsatisfiableOccurenceCacheRetrievalData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualProcessingQueue.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualProcessNode.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualProcessNodeDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualProcessNodeLinker.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualProcessNodePriority.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualProcessNodeReference.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualProcessNodeVector.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualReactivationProcessingQueue.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNode.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeCacheData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeExtensionData.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeLinker.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeStatusFlags.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeStatusUpdateLinker.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationProcessNodeVector.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualSaturationSuccessorLinkDataLinker.cpp \ ./Source/Reasoner/Kernel/Process/CIndividualUnsortedProcessingQueue.cpp \ ./Source/Reasoner/Kernel/Process/CLinkEdge.cpp \ ./Source/Reasoner/Kernel/Process/CLinkedRoleSaturationSuccessorData.cpp \ ./Source/Reasoner/Kernel/Process/CLinkedRoleSaturationSuccessorHash.cpp \ ./Source/Reasoner/Kernel/Process/CLinkProcessingRestrictionSpecification.cpp \ ./Source/Reasoner/Kernel/Process/CLocalizationTag.cpp \ ./Source/Reasoner/Kernel/Process/CMarkerIndividualNodeHash.cpp \ ./Source/Reasoner/Kernel/Process/CNegationDisjointEdge.cpp \ ./Source/Reasoner/Kernel/Process/CNodeEdge.cpp \ ./Source/Reasoner/Kernel/Process/CNodeSwitchHistory.cpp \ ./Source/Reasoner/Kernel/Process/CNodeSwitchTag.cpp \ ./Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationData.cpp \ ./Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationHash.cpp \ ./Source/Reasoner/Kernel/Process/CNominalCachingLossReactivationHashData.cpp \ ./Source/Reasoner/Kernel/Process/CPreviousIndividualIDSet.cpp \ ./Source/Reasoner/Kernel/Process/CProcessContext.cpp \ ./Source/Reasoner/Kernel/Process/CProcessContextBase.cpp \ ./Source/Reasoner/Kernel/Process/CProcessingDataBox.cpp \ ./Source/Reasoner/Kernel/Process/CProcessingRestrictionSpecification.cpp \ ./Source/Reasoner/Kernel/Process/CProcessingStatisticDescription.cpp \ ./Source/Reasoner/Kernel/Process/CProcessingStatisticGathering.cpp \ ./Source/Reasoner/Kernel/Process/CProcessingStatisticRegistrator.cpp \ ./Source/Reasoner/Kernel/Process/CProcessingStatistics.cpp \ ./Source/Reasoner/Kernel/Process/CProcessingTag.cpp \ ./Source/Reasoner/Kernel/Process/CProcessMemoryPoolAllocationManager.cpp \ ./Source/Reasoner/Kernel/Process/CProcessTag.cpp \ ./Source/Reasoner/Kernel/Process/CProcessTagger.cpp \ ./Source/Reasoner/Kernel/Process/CPropagationBinding.cpp \ ./Source/Reasoner/Kernel/Process/CPropagationBindingDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CPropagationBindingMap.cpp \ ./Source/Reasoner/Kernel/Process/CPropagationBindingMapData.cpp \ ./Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptHash.cpp \ ./Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptHashData.cpp \ ./Source/Reasoner/Kernel/Process/CPropagationBindingReapplyConceptIterator.cpp \ ./Source/Reasoner/Kernel/Process/CPropagationBindingSet.cpp \ ./Source/Reasoner/Kernel/Process/CPropagationRepresentativeTransitionExtension.cpp \ ./Source/Reasoner/Kernel/Process/CPropagationVariableBindingTransitionExtension.cpp \ ./Source/Reasoner/Kernel/Process/CReapplyConceptDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CReapplyConceptLabelSet.cpp \ ./Source/Reasoner/Kernel/Process/CReapplyConceptLabelSetIterator.cpp \ ./Source/Reasoner/Kernel/Process/CReapplyConceptSaturationLabelSet.cpp \ ./Source/Reasoner/Kernel/Process/CReapplyConceptSaturationLabelSetIterator.cpp \ ./Source/Reasoner/Kernel/Process/CReapplyQueue.cpp \ ./Source/Reasoner/Kernel/Process/CReapplyQueueIterator.cpp \ ./Source/Reasoner/Kernel/Process/CReapplyRoleSuccessorData.cpp \ ./Source/Reasoner/Kernel/Process/CReapplyRoleSuccessorHash.cpp \ ./Source/Reasoner/Kernel/Process/CReferredIndividualTrackingData.cpp \ ./Source/Reasoner/Kernel/Process/CReferredIndividualTrackingVector.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeContainingMap.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeContainingMapData.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeJoiningAllDataExtension.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeJoiningCommonKeyData.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeJoiningCommonKeyMap.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeJoiningData.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeJoiningHash.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeJoiningHashData.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativePropagationDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativePropagationMap.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativePropagationMapData.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativePropagationSet.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathHash.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyData.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyHash.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyHashData.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathJoiningKeyHasher.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathMap.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathMapData.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetData.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetDataSignature.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetHash.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetHashData.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningData.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningHash.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningHashData.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningKeyDataMap.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningKeyMap.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetJoiningKeyMapData.cpp \ ./Source/Reasoner/Kernel/Process/CRepresentativeVariableBindingPathSetMigrateData.cpp \ ./Source/Reasoner/Kernel/Process/CReusedIndividualNodeData.cpp \ ./Source/Reasoner/Kernel/Process/CReusingIndividualNodeConceptExpansionData.cpp \ ./Source/Reasoner/Kernel/Process/CReusingReviewData.cpp \ ./Source/Reasoner/Kernel/Process/CRoleBackwardPropagationHash.cpp \ ./Source/Reasoner/Kernel/Process/CRoleBackwardPropagationHashData.cpp \ ./Source/Reasoner/Kernel/Process/CRoleBackwardSaturationPropagationHash.cpp \ ./Source/Reasoner/Kernel/Process/CRoleBackwardSaturationPropagationHashData.cpp \ ./Source/Reasoner/Kernel/Process/CRoleReapplyHash.cpp \ ./Source/Reasoner/Kernel/Process/CRoleSaturationProcessLinker.cpp \ ./Source/Reasoner/Kernel/Process/CRoleSuccessorHash.cpp \ ./Source/Reasoner/Kernel/Process/CRoleSuccessorIterator.cpp \ ./Source/Reasoner/Kernel/Process/CRoleSuccessorLinkIterator.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptCountHash.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptCountHashData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationDisjunctCommonConceptExtractionData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationDisjunctExtractionLinker.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeALLConceptsExtensionData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeDatatypeData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionResolveData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionResolveHash.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeExtensionResolveHashData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeFUNCTIONALConceptsExtensionData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeNominalHandlingData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeProcessingQueue.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationIndividualNodeSuccessorExtensionData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationInfluencedNominalSet.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorIndividualALLConceptsExtensionData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorIndividualALLConceptsExtensionHash.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationLinkedSuccessorRoleFUNCTIONALConceptsExtensionHash.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationModifiedProcessUpdateLinker.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeHash.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationNominalDependentNodeHashData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationPredecessorFUNCTIONALConceptExtensionData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationPredecessorRoleFUNCTIONALConceptsExtensionHash.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorALLConceptExtensionData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorConceptExtensionMap.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorConceptExtensionMapData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorExtensionData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorExtensionIndividualNodeProcessingQueue.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorFUNCTIONALConceptExtensionData.cpp \ ./Source/Reasoner/Kernel/Process/CSaturationSuccessorRoleAssertionLinker.cpp \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingCandidateData.cpp \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingCandidateHash.cpp \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingCandidateIterator.cpp \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandidateData.cpp \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandidateHash.cpp \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeCandidateIterator.cpp \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingIndividualNodeConceptExpansionData.cpp \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingReviewData.cpp \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingReviewDataIterator.cpp \ ./Source/Reasoner/Kernel/Process/CSignatureBlockingReviewSet.cpp \ ./Source/Reasoner/Kernel/Process/CSignatureIterator.cpp \ ./Source/Reasoner/Kernel/Process/CSuccessorConnectedNominalSet.cpp \ ./Source/Reasoner/Kernel/Process/CSuccessorIterator.cpp \ ./Source/Reasoner/Kernel/Process/CSuccessorRoleHash.cpp \ ./Source/Reasoner/Kernel/Process/CSuccessorRoleIterator.cpp \ ./Source/Reasoner/Kernel/Process/CTriggeredImplicationProcessingRestrictionSpecification.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBinding.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingPath.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathDescriptor.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningData.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningHash.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningHashData.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathJoiningHasher.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathMap.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathMapData.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathMergingHash.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathMergingHashData.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingPathSet.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingTriggerData.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingTriggerHash.cpp \ ./Source/Reasoner/Kernel/Process/CVariableBindingTriggerLinker.cpp \ ./Source/Reasoner/Kernel/Process/Marker/CMarker.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CALLDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CANDDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CATLEASTDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CATMOSTDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CAUTOMATCHOOSEDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CAUTOMATTRANSACTIONDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEALLDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEANDDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATECYCLEDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEGROUNDINGDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CBINDPROPAGATEIMPLICATIONDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CBINDVARIABLEDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CBranchingTree.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CBranchTreeNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CCONNECTIONDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CDATATYPECONNECTIONDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CDATATYPETRIGGERDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CDependency.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CDependencyIterator.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CDependencyTrackPoint.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CDeterministicDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CDISTINCTDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CEXPANDEDDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CFUNCTIONALDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CIMPLICATIONDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CIndependentBaseDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CMERGEDCONCEPTDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CMERGEDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CMERGEDIndividualDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CMERGEDLINKDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CNEGVALUEDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CNOMINALDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CNonDeterministicDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CNonDeterministicDependencyTrackPoint.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CORDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEBINDINGDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEBINDINGSSUCCESSORDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CPROPAGATECONNECTIONAWAYDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CPROPAGATECONNECTIONDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLEBINDINGDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLEBINDINGSSUCCESSORDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CPROPAGATEVARIABLECONNECTIONDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CQUALIFYDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEALLDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEANDDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEBINDVARIABLEDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEGROUNDINGDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEIMPLICATIONDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CREPRESENTATIVEJOINDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CRepresentativeResolveDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CRepresentativeSelectDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CRESOLVEREPRESENTATIVEDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CREUSECOMPLETIONGRAPHDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CREUSECONCEPTSDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CREUSEINDIVIDUALDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CROLEASSERTIONDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CSELFDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CSOMEDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CVALUEDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEALLDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEANDDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEGROUNDINGDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEIMPLICATIONDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CVARBINDPROPAGATEJOINDependencyNode.cpp \ ./Source/Reasoner/Kernel/Process/Dependency/CVARBINDVARIABLEDependencyNode.cpp \ ./Source/Reasoner/Kernel/Calculation/CCalculationEnviroment.cpp \ ./Source/Reasoner/Kernel/Calculation/CCalculationEnvironmentFactory.cpp \ ./Source/Reasoner/Kernel/Calculation/CCalculationFactory.cpp \ ./Source/Reasoner/Kernel/Calculation/CCalculationManager.cpp \ ./Source/Reasoner/Kernel/Calculation/CConcurrentTaskCalculationEnvironment.cpp \ ./Source/Reasoner/Kernel/Calculation/CConcurrentTaskCalculationManager.cpp \ ./Source/Reasoner/Kernel/Calculation/CConfigDependedCalculationEnvironmentFactory.cpp \ ./Source/Reasoner/Kernel/Calculation/CConfigDependedCalculationFactory.cpp \ ./Source/Reasoner/Kernel/Calculation/CTaskHandleAlgorithmBuilder.cpp \ ./Source/Reasoner/Kernel/Manager/CAnalyseReasonerManager.cpp \ ./Source/Reasoner/Kernel/Manager/CExperimentalReasonerManager.cpp \ ./Source/Reasoner/Kernel/Manager/COntologyRequirementPair.cpp \ ./Source/Reasoner/Kernel/Manager/COntologyRequirementPreparingData.cpp \ ./Source/Reasoner/Kernel/Manager/CPrecomputationManager.cpp \ ./Source/Reasoner/Kernel/Manager/CPreprocessingManager.cpp \ ./Source/Reasoner/Kernel/Manager/CRealizationManager.cpp \ ./Source/Reasoner/Kernel/Manager/CReasonerManager.cpp \ ./Source/Reasoner/Kernel/Manager/CReasonerManagerThread.cpp \ ./Source/Reasoner/Kernel/Manager/CReasoningTaskData.cpp \ ./Source/Reasoner/Kernel/Manager/CRequirementPreparingData.cpp \ ./Source/Reasoner/Kernel/Manager/Events/CCalcedQueryEvent.cpp \ ./Source/Reasoner/Kernel/Manager/Events/CCalcQueryEvent.cpp \ ./Source/Reasoner/Kernel/Manager/Events/CJobCalculatedSatisfiableCallbackEvent.cpp \ ./Source/Reasoner/Kernel/Manager/Events/CPrepareOntologyEvent.cpp \ ./Source/Reasoner/Kernel/Manager/Events/CQueriedTaxonomyComputedCallbackEvent.cpp \ ./Source/Reasoner/Kernel/Manager/Events/CQueryJobCalculatedSatisfiableCallbackEvent.cpp \ ./Source/Reasoner/Kernel/Manager/Events/CReasoningSatisfiableCalculationJobEvent.cpp \ ./Source/Reasoner/Kernel/Manager/Events/CRequirementProcessedCallbackEvent.cpp \ ./Source/Reasoner/Preprocess/CBranchTriggerPreProcess.cpp \ ./Source/Reasoner/Preprocess/CCommonDisjunctConceptExtractionPreProcess.cpp \ ./Source/Reasoner/Preprocess/CConceptRoleIndividualLocator.cpp \ ./Source/Reasoner/Preprocess/CConceptTriggerLinker.cpp \ ./Source/Reasoner/Preprocess/CConceptUnambiguousHasher.cpp \ ./Source/Reasoner/Preprocess/CConcreteOntologyPreProcess.cpp \ ./Source/Reasoner/Preprocess/CConsistenceCheckerPreProcess.cpp \ ./Source/Reasoner/Preprocess/CCoreBlockingConceptMarkerPreProcess.cpp \ ./Source/Reasoner/Preprocess/CCoreOntologyCyclesExtractorPreProcess.cpp \ ./Source/Reasoner/Preprocess/CDataExtenderPreProcess.cpp \ ./Source/Reasoner/Preprocess/CDataLiteralNormalizerPreProcess.cpp \ ./Source/Reasoner/Preprocess/CDatatypeNormalizerPreProcess.cpp \ ./Source/Reasoner/Preprocess/CDisjunctSortingPreProcess.cpp \ ./Source/Reasoner/Preprocess/CExtractPropagationIntoCreationDirectionPreProcess.cpp \ ./Source/Reasoner/Preprocess/CExtractRelevantConceptRolePreProcess.cpp \ ./Source/Reasoner/Preprocess/CFullNominalSchemaGroundingPreProcess.cpp \ ./Source/Reasoner/Preprocess/CLexicalNormalisationPreProcess.cpp \ ./Source/Reasoner/Preprocess/CMappingUpdaterPreProcess.cpp \ ./Source/Reasoner/Preprocess/CNegationTransformationPreProcess.cpp \ ./Source/Reasoner/Preprocess/CNominalSchemaAbsorptionBranchLinker.cpp \ ./Source/Reasoner/Preprocess/CNominalSchemaAbsorptionPathLinker.cpp \ ./Source/Reasoner/Preprocess/CNominalSchemaTemplateExtractionPreProcess.cpp \ ./Source/Reasoner/Preprocess/COntologyAssignmentTransformationPreProcess.cpp \ ./Source/Reasoner/Preprocess/COntologyConfigDependedPreProcesser.cpp \ ./Source/Reasoner/Preprocess/COntologyPreProcess.cpp \ ./Source/Reasoner/Preprocess/COntologyPreProcesser.cpp \ ./Source/Reasoner/Preprocess/COntologyPreprocessingItem.cpp \ ./Source/Reasoner/Preprocess/COntologyStructureInspectionPreProcess.cpp \ ./Source/Reasoner/Preprocess/CPrecomputationPreProcess.cpp \ ./Source/Reasoner/Preprocess/CPreProcess.cpp \ ./Source/Reasoner/Preprocess/CPreProcessContext.cpp \ ./Source/Reasoner/Preprocess/CPreProcessContextBase.cpp \ ./Source/Reasoner/Preprocess/CPreprocessing.cpp \ ./Source/Reasoner/Preprocess/CPreprocessingCallbackDataContext.cpp \ ./Source/Reasoner/Preprocess/CPreprocessingContext.cpp \ ./Source/Reasoner/Preprocess/CPreprocessingTestingItem.cpp \ ./Source/Reasoner/Preprocess/CPreprocessingTestingStep.cpp \ ./Source/Reasoner/Preprocess/CPreprocessingThread.cpp \ ./Source/Reasoner/Preprocess/CPreprocessor.cpp \ ./Source/Reasoner/Preprocess/CRequirementConfigPreprocessingItem.cpp \ ./Source/Reasoner/Preprocess/CRequirementConfigPreprocessingThread.cpp \ ./Source/Reasoner/Preprocess/CReverseRoleAssertionGeneratorPreProcess.cpp \ ./Source/Reasoner/Preprocess/CRoleChainAutomataTransformationPreProcess.cpp \ ./Source/Reasoner/Preprocess/CSubroleTransformationPreProcess.cpp \ ./Source/Reasoner/Preprocess/CTriggeredImplicationBinaryAbsorberPreProcess.cpp \ ./Source/Reasoner/Preprocess/Events/CCallbackPreprocessedOntologyEvent.cpp \ ./Source/Reasoner/Preprocess/Events/CPreprocessingCalculatedCallbackEvent.cpp \ ./Source/Reasoner/Preprocess/Events/CPreprocessOntologyEvent.cpp \ ./Source/Reasoner/Revision/COntologyConfigurationExtension.cpp \ ./Source/Reasoner/Revision/COntologyRevision.cpp \ ./Source/Reasoner/Revision/COntologyRevisionManager.cpp \ ./Source/Reasoner/Revision/CSPOntologyRevisionManager.cpp \ ./Source/Reasoner/Classifier/CClassificationCalculationSupport.cpp \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModel.cpp \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModelConceptData.cpp \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModelConceptMap.cpp \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModelData.cpp \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModelDeterministicFlag.cpp \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModelHash.cpp \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModelRoleData.cpp \ ./Source/Reasoner/Classifier/CClassificationClassPseudoModelRoleMap.cpp \ ./Source/Reasoner/Classifier/CClassificationConceptReferenceLinking.cpp \ ./Source/Reasoner/Classifier/CClassificationInitializePossibleSubsumptionData.cpp \ ./Source/Reasoner/Classifier/CClassificationInitializePossibleSubsumptionMessageData.cpp \ ./Source/Reasoner/Classifier/CClassificationManager.cpp \ ./Source/Reasoner/Classifier/CClassificationMessageData.cpp \ ./Source/Reasoner/Classifier/CClassificationMessageDataObserver.cpp \ ./Source/Reasoner/Classifier/CClassificationProgress.cpp \ ./Source/Reasoner/Classifier/CClassificationPseudoModelIdentifierMessageData.cpp \ ./Source/Reasoner/Classifier/CClassificationSatisfiableCalculationConceptReferenceLinking.cpp \ ./Source/Reasoner/Classifier/CClassificationSatisfiableCalculationData.cpp \ ./Source/Reasoner/Classifier/CClassificationSatisfiablePossibleSubsumptionCalculationConceptReferenceLinking.cpp \ ./Source/Reasoner/Classifier/CClassificationSubsumptionMessageData.cpp \ ./Source/Reasoner/Classifier/CClassificationUpdatePossibleSubsumptionMessageData.cpp \ ./Source/Reasoner/Classifier/CClassificationWorkItem.cpp \ ./Source/Reasoner/Classifier/CClassifiedCallbackDataContext.cpp \ ./Source/Reasoner/Classifier/CClassifierStatistics.cpp \ ./Source/Reasoner/Classifier/CClassifyingCallbackDataContext.cpp \ ./Source/Reasoner/Classifier/CClassPossibleSubsumptionMap.cpp \ ./Source/Reasoner/Classifier/CClassPossibleSubsumptionMapIterator.cpp \ ./Source/Reasoner/Classifier/CClassSubsumptionClassifierContext.cpp \ ./Source/Reasoner/Classifier/CConceptNegationOverRoleTuble.cpp \ ./Source/Reasoner/Classifier/CConceptSatisfiableObserver.cpp \ ./Source/Reasoner/Classifier/CConceptSubsumerObserver.cpp \ ./Source/Reasoner/Classifier/CConfigDependedSubsumptionClassifierFactory.cpp \ ./Source/Reasoner/Classifier/CIncrementalKPSetClassOntologyClassificationItem.cpp \ ./Source/Reasoner/Classifier/CIncrementalKPSetClassSubsumptionClassifierThread.cpp \ ./Source/Reasoner/Classifier/CNodeBlockedClassificationItem.cpp \ ./Source/Reasoner/Classifier/CNodeBottomUpTraversalClassificationItem.cpp \ ./Source/Reasoner/Classifier/CNodeChildrenOrderClassificationItem.cpp \ ./Source/Reasoner/Classifier/CNodePredecessorPositionClassificationItem.cpp \ ./Source/Reasoner/Classifier/CNodeTopDownTraversalClassificationItem.cpp \ ./Source/Reasoner/Classifier/CNodeTraversalOrderClassificationItem.cpp \ ./Source/Reasoner/Classifier/COntologyClassificationItem.cpp \ ./Source/Reasoner/Classifier/COptimizedClassExtractedSaturationOntologyClassificationItem.cpp \ ./Source/Reasoner/Classifier/COptimizedClassExtractedSaturationSatisfiableTestingItem.cpp \ ./Source/Reasoner/Classifier/COptimizedClassExtractedSaturationSubsumptionClassifierThread.cpp \ ./Source/Reasoner/Classifier/COptimizedConceptSaturationSatisfiableTestingItem.cpp \ ./Source/Reasoner/Classifier/COptimizedKPSetClassOntologyClassificationItem.cpp \ ./Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionData.cpp \ ./Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionMap.cpp \ ./Source/Reasoner/Classifier/COptimizedKPSetClassPossibleSubsumptionMapIterator.cpp \ ./Source/Reasoner/Classifier/COptimizedKPSetClassSubsumptionClassifierThread.cpp \ ./Source/Reasoner/Classifier/COptimizedKPSetClassTestingItem.cpp \ ./Source/Reasoner/Classifier/COptimizedKPSetRoleOntologyClassificationItem.cpp \ ./Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionData.cpp \ ./Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionMap.cpp \ ./Source/Reasoner/Classifier/COptimizedKPSetRolePossibleSubsumptionMapIterator.cpp \ ./Source/Reasoner/Classifier/COptimizedKPSetRoleSubsumptionClassifierThread.cpp \ ./Source/Reasoner/Classifier/COptimizedKPSetRoleTestingItem.cpp \ ./Source/Reasoner/Classifier/COptimizedSubClassOntologyClassificationItem.cpp \ ./Source/Reasoner/Classifier/COptimizedSubClassSatisfiableTestingItem.cpp \ ./Source/Reasoner/Classifier/COptimizedSubClassSubsumptionClassifierThread.cpp \ ./Source/Reasoner/Classifier/CPartialPruningHierarchyNode.cpp \ ./Source/Reasoner/Classifier/CPartialPruningTaxonomy.cpp \ ./Source/Reasoner/Classifier/CPrecomputedSaturationSubsumerExtractor.cpp \ ./Source/Reasoner/Classifier/CSubsumptionClassifier.cpp \ ./Source/Reasoner/Classifier/CSubsumptionClassifierFactory.cpp \ ./Source/Reasoner/Classifier/CSubsumptionClassifierThread.cpp \ ./Source/Reasoner/Classifier/Events/CCallbackClassifiedOntologyEvent.cpp \ ./Source/Reasoner/Classifier/Events/CClassifyOntologyEvent.cpp \ ./Source/Reasoner/Classifier/Events/COntologyTellClassificationMessageEvent.cpp \ ./Source/Reasoner/Classifier/Events/CTestCalculatedCallbackEvent.cpp \ ./Source/Reasoner/Taxonomy/CAHierarchyNode.cpp \ ./Source/Reasoner/Taxonomy/CATaxonomy.cpp \ ./Source/Reasoner/Taxonomy/CATaxonomyBuilder.cpp \ ./Source/Reasoner/Taxonomy/CConceptClassesPCPrHierarchyNode.cpp \ ./Source/Reasoner/Taxonomy/CConceptClassesPCPrTaxonomy.cpp \ ./Source/Reasoner/Taxonomy/CEATaxonomy.cpp \ ./Source/Reasoner/Taxonomy/CEATaxonomyBuilder.cpp \ ./Source/Reasoner/Taxonomy/CHierarchy.cpp \ ./Source/Reasoner/Taxonomy/CHierarchyDepthTraversalIterator.cpp \ ./Source/Reasoner/Taxonomy/CHierarchyNode.cpp \ ./Source/Reasoner/Taxonomy/CHierarchyNodeData.cpp \ ./Source/Reasoner/Taxonomy/CHierarchyNodeIterator.cpp \ ./Source/Reasoner/Taxonomy/CLightConceptClassesHierarchyNode.cpp \ ./Source/Reasoner/Taxonomy/CLightConceptClassesTaxonomy.cpp \ ./Source/Reasoner/Taxonomy/COntologyTaxonomy.cpp \ ./Source/Reasoner/Taxonomy/CPCPrHierarchyNode.cpp \ ./Source/Reasoner/Taxonomy/CPCPrTaxonomy.cpp \ ./Source/Reasoner/Taxonomy/CTaxonomy.cpp \ ./Source/Reasoner/Realizer/CIncrementalKPSetOntologyConceptRealizingItem.cpp \ ./Source/Reasoner/Realizer/CIncrementalKPSetOntologyConceptRealizingThread.cpp \ ./Source/Reasoner/Realizer/CIndividualConceptInstanceTestingItem.cpp \ ./Source/Reasoner/Realizer/CIndividualPairRoleInstanceTestingItem.cpp \ ./Source/Reasoner/Realizer/CIndividualRoleCandidateTestingItem.cpp \ ./Source/Reasoner/Realizer/CIndividualSameTestingItem.cpp \ ./Source/Reasoner/Realizer/CIndividualsConsistencyTestingItem.cpp \ ./Source/Reasoner/Realizer/COntologyRealizingItem.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesData.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesHash.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesHashData.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetConceptInstancesItem.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetIndividualItem.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetIndividualItemPair.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetOntologyConceptRealizingItem.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetOntologyConceptRealizingThread.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesData.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesHash.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesHashData.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesItem.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetRoleInstancesRedirectionItem.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetRoleNeighbourInstancesHash.cpp \ ./Source/Reasoner/Realizer/COptimizedKPSetRoleNeighbourInstancesHashData.cpp \ ./Source/Reasoner/Realizer/CRealizationMarkerCandidatesMessageData.cpp \ ./Source/Reasoner/Realizer/CRealizationMessageData.cpp \ ./Source/Reasoner/Realizer/CRealizationMessageObserver.cpp \ ./Source/Reasoner/Realizer/CRealizationProgress.cpp \ ./Source/Reasoner/Realizer/CRealizer.cpp \ ./Source/Reasoner/Realizer/CRealizerThread.cpp \ ./Source/Reasoner/Realizer/CRealizingCallbackDataContext.cpp \ ./Source/Reasoner/Realizer/CRealizingContext.cpp \ ./Source/Reasoner/Realizer/CRealizingTestingItem.cpp \ ./Source/Reasoner/Realizer/CRealizingTestingStep.cpp \ ./Source/Reasoner/Realizer/Events/CCallbackRealizedOntologyEvent.cpp \ ./Source/Reasoner/Realizer/Events/CRealizationMessageEvent.cpp \ ./Source/Reasoner/Realizer/Events/CRealizeOntologyEvent.cpp \ ./Source/Reasoner/Realizer/Events/CRealizingCalculatedCallbackEvent.cpp \ ./Source/Reasoner/Consistiser/CConceptCyclePrecomputationTestingItem.cpp \ ./Source/Reasoner/Consistiser/CConsistenceObserver.cpp \ ./Source/Reasoner/Consistiser/CConsistencePrecomputationTestingItem.cpp \ ./Source/Reasoner/Consistiser/CConsistiser.cpp \ ./Source/Reasoner/Consistiser/CDirectBlockedProcessingConsistiser.cpp \ ./Source/Reasoner/Consistiser/CIncrementalConsistencePrecomputationTestingItem.cpp \ ./Source/Reasoner/Consistiser/CIncrementalOntologyPrecomputationItem.cpp \ ./Source/Reasoner/Consistiser/CIncrementalPrecomputationThread.cpp \ ./Source/Reasoner/Consistiser/CIndividualDependenceTrackingCollector.cpp \ ./Source/Reasoner/Consistiser/CIndividualDependenceTrackingMarker.cpp \ ./Source/Reasoner/Consistiser/CIndividualDependenceTrackingObserver.cpp \ ./Source/Reasoner/Consistiser/COntologyPrecomputationItem.cpp \ ./Source/Reasoner/Consistiser/CPrecomputationCallbackDataContext.cpp \ ./Source/Reasoner/Consistiser/CPrecomputationContext.cpp \ ./Source/Reasoner/Consistiser/CPrecomputationTestingItem.cpp \ ./Source/Reasoner/Consistiser/CPrecomputationTestingStep.cpp \ ./Source/Reasoner/Consistiser/CPrecomputationThread.cpp \ ./Source/Reasoner/Consistiser/CPrecomputator.cpp \ ./Source/Reasoner/Consistiser/CSaturationCommonDisjunctConceptsExtractor.cpp \ ./Source/Reasoner/Consistiser/CSaturationConceptDataItem.cpp \ ./Source/Reasoner/Consistiser/CSaturationConceptReferenceLinking.cpp \ ./Source/Reasoner/Consistiser/CSaturationIndividualAnalysationObserver.cpp \ ./Source/Reasoner/Consistiser/CSaturationIndividualDataItem.cpp \ ./Source/Reasoner/Consistiser/CSaturationIndividualReferenceLinking.cpp \ ./Source/Reasoner/Consistiser/CSaturationObserver.cpp \ ./Source/Reasoner/Consistiser/CSaturationPrecomputationTestingItem.cpp \ ./Source/Reasoner/Consistiser/CTotallyOntologyPrecomputationItem.cpp \ ./Source/Reasoner/Consistiser/CTotallyPrecomputationThread.cpp \ ./Source/Reasoner/Consistiser/Events/CCallbackPrecomputedOntologyEvent.cpp \ ./Source/Reasoner/Consistiser/Events/CPrecomputationCalculatedCallbackEvent.cpp \ ./Source/Reasoner/Consistiser/Events/CPrecomputeOntologyEvent.cpp \ ./Source/Reasoner/Consistiser/Events/CSaturationPrecomputationCalculatedCallbackEvent.cpp \ ./Source/Reasoner/Classification/CClassConceptClassification.cpp \ ./Source/Reasoner/Classification/CClassification.cpp \ ./Source/Reasoner/Classification/CClassificationCalculationStatisticsCollection.cpp \ ./Source/Reasoner/Classification/CClassificationStatistics.cpp \ ./Source/Reasoner/Classification/CClassificationStatisticsCollectionStrings.cpp \ ./Source/Reasoner/Realization/CConceptInstanceItem.cpp \ ./Source/Reasoner/Realization/CConceptInstantiatedItem.cpp \ ./Source/Reasoner/Realization/CConceptRealization.cpp \ ./Source/Reasoner/Realization/CConceptRealizationConceptVisitor.cpp \ ./Source/Reasoner/Realization/CConceptRealizationIndividualVisitor.cpp \ ./Source/Reasoner/Realization/CConceptRealizationInstanceToIndividualVisitor.cpp \ ./Source/Reasoner/Realization/CConceptRealizationInstanceVisitor.cpp \ ./Source/Reasoner/Realization/CConceptRealizationInstantiatedToConceptVisitor.cpp \ ./Source/Reasoner/Realization/CConceptRealizationInstantiatedVisitor.cpp \ ./Source/Reasoner/Realization/CIndividualConceptAssertionSetCollector.cpp \ ./Source/Reasoner/Realization/CPossibleAssertionsCollectionSet.cpp \ ./Source/Reasoner/Realization/CRealization.cpp \ ./Source/Reasoner/Realization/CRoleInstanceItem.cpp \ ./Source/Reasoner/Realization/CRoleInstantiatedItem.cpp \ ./Source/Reasoner/Realization/CRoleRealization.cpp \ ./Source/Reasoner/Realization/CRoleRealizationIndividualVisitor.cpp \ ./Source/Reasoner/Realization/CRoleRealizationInstanceToIndividualVisitor.cpp \ ./Source/Reasoner/Realization/CRoleRealizationInstanceVisitor.cpp \ ./Source/Reasoner/Realization/CSameInstanceItem.cpp \ ./Source/Reasoner/Realization/CSameRealization.cpp \ ./Source/Reasoner/Realization/CSameRealizationIndividualVisitor.cpp \ ./Source/Reasoner/Consistence/CConsistence.cpp \ ./Source/Reasoner/Consistence/CConsistenceData.cpp \ ./Source/Reasoner/Consistence/CPrecomputation.cpp \ ./Source/Reasoner/Consistence/CSaturationData.cpp \ ./Source/Reasoner/Generator/CActiveEntitySubExpressionVisitorUpdater.cpp \ ./Source/Reasoner/Generator/CApproximatedSaturationCalculationJobGenerator.cpp \ ./Source/Reasoner/Generator/CConcreteOntologyBasementBuilder.cpp \ ./Source/Reasoner/Generator/CConcreteOntologyBuildDataUpdater.cpp \ ./Source/Reasoner/Generator/CConcreteOntologyEntityCollectorBuilder.cpp \ ./Source/Reasoner/Generator/CConcreteOntologyInverseRoleBuilder.cpp \ ./Source/Reasoner/Generator/CConcreteOntologyMergingBuilder.cpp \ ./Source/Reasoner/Generator/CConcreteOntologyQueryBasicBuilder.cpp \ ./Source/Reasoner/Generator/CConcreteOntologyQueryExtendedBuilder.cpp \ ./Source/Reasoner/Generator/CConcreteOntologyQuerySimpleBuilder.cpp \ ./Source/Reasoner/Generator/CConcreteOntologyUpdateBuilder.cpp \ ./Source/Reasoner/Generator/CConcreteOntologyUpdateCollectorBuilder.cpp \ ./Source/Reasoner/Generator/CExpressionHasher.cpp \ ./Source/Reasoner/Generator/CExpressionSplitter.cpp \ ./Source/Reasoner/Generator/CGeneratorTaskHandleContextBase.cpp \ ./Source/Reasoner/Generator/CQueryBuilderGenerator.cpp \ ./Source/Reasoner/Generator/CQueryGenerator.cpp \ ./Source/Reasoner/Generator/CSatisfiableCalculationJobGenerator.cpp \ ./Source/Reasoner/Generator/CSatisfiableCalculationTaskFromCalculationJobGenerator.cpp \ ./Source/Reasoner/Generator/CStringRefStringHasher.cpp \ ./Source/Scheduler/CBooleanTaskResult.cpp \ ./Source/Scheduler/CBooleanTrueResultCancelTaskStatusPropagator.cpp \ ./Source/Scheduler/CConcreteMemoryPoolDistributor.cpp \ ./Source/Scheduler/CConcreteTaskScheduleItem.cpp \ ./Source/Scheduler/CConcreteTaskSchedulerCommunicator.cpp \ ./Source/Scheduler/CDirectDistributionMemoryPoolReleaser.cpp \ ./Source/Scheduler/CDistributionMemoryPoolProvider.cpp \ ./Source/Scheduler/CDistributionMemoryPoolReleaser.cpp \ ./Source/Scheduler/CEventDistributionMemoryPoolReleaser.cpp \ ./Source/Scheduler/CEventHandlerVendor.cpp \ ./Source/Scheduler/CMemoryPoolDistributor.cpp \ ./Source/Scheduler/CSingleThreadTaskProcessorUnit.cpp \ ./Source/Scheduler/CTask.cpp \ ./Source/Scheduler/CTaskAllocator.cpp \ ./Source/Scheduler/CTaskCallbackExecuter.cpp \ ./Source/Scheduler/CTaskCompletor.cpp \ ./Source/Scheduler/CTaskContext.cpp \ ./Source/Scheduler/CTaskContextBase.cpp \ ./Source/Scheduler/CTaskDistributionCompletorCommunicator.cpp \ ./Source/Scheduler/CTaskEventCommunicator.cpp \ ./Source/Scheduler/CTaskEventHandlerBasedCompletor.cpp \ ./Source/Scheduler/CTaskEventHandlerBasedDistributionCompletor.cpp \ ./Source/Scheduler/CTaskEventHandlerBasedProcessor.cpp \ ./Source/Scheduler/CTaskEventHandlerBasedScheduler.cpp \ ./Source/Scheduler/CTaskHandleAlgorithm.cpp \ ./Source/Scheduler/CTaskHandleContext.cpp \ ./Source/Scheduler/CTaskHandleLimitedReserveMemoryPoolAllocationManager.cpp \ ./Source/Scheduler/CTaskHandleMemoryAllocationManager.cpp \ ./Source/Scheduler/CTaskHandleMemoryPoolAllocationManager.cpp \ ./Source/Scheduler/CTaskMemoryAllocationManager.cpp \ ./Source/Scheduler/CTaskMemoryPoolAllocationManager.cpp \ ./Source/Scheduler/CTaskOwner.cpp \ ./Source/Scheduler/CTaskProcessingStatistics.cpp \ ./Source/Scheduler/CTaskProcessor.cpp \ ./Source/Scheduler/CTaskProcessorCommunicator.cpp \ ./Source/Scheduler/CTaskProcessorCompletorThread.cpp \ ./Source/Scheduler/CTaskProcessorContext.cpp \ ./Source/Scheduler/CTaskProcessorContextBase.cpp \ ./Source/Scheduler/CTaskProcessorSchedulerThread.cpp \ ./Source/Scheduler/CTaskProcessorThread.cpp \ ./Source/Scheduler/CTaskProcessorThreadBase.cpp \ ./Source/Scheduler/CTaskReserveArrayQueue.cpp \ ./Source/Scheduler/CTaskReserveArrayQueueConsumer.cpp \ ./Source/Scheduler/CTaskReserveArrayQueueItem.cpp \ ./Source/Scheduler/CTaskReserveMultiArrayQueue.cpp \ ./Source/Scheduler/CTaskReserveMultiArrayQueueAdderController.cpp \ ./Source/Scheduler/CTaskReserveMultiArrayQueueConsumer.cpp \ ./Source/Scheduler/CTaskReserveQueue.cpp \ ./Source/Scheduler/CTaskReserveQueueAdder.cpp \ ./Source/Scheduler/CTaskReserveQueueAdderController.cpp \ ./Source/Scheduler/CTaskReserveQueueConsumer.cpp \ ./Source/Scheduler/CTaskResult.cpp \ ./Source/Scheduler/CTaskScheduleItem.cpp \ ./Source/Scheduler/CTaskScheduler.cpp \ ./Source/Scheduler/CTaskSchedulerCommunicator.cpp \ ./Source/Scheduler/CTaskStatus.cpp \ ./Source/Scheduler/CTaskStatusPropagator.cpp \ ./Source/Scheduler/Events/CAlignedUpdateTaskStatusEvent.cpp \ ./Source/Scheduler/Events/CCriticalScheduleTaskEvent.cpp \ ./Source/Scheduler/Events/CDistributeMemoryPoolEvent.cpp \ ./Source/Scheduler/Events/CRequestProcessTaskEvent.cpp \ ./Source/Scheduler/Events/CRequestScheduleTaskEvent.cpp \ ./Source/Scheduler/Events/CResponseScheduleTaskEvent.cpp \ ./Source/Scheduler/Events/CSendTaskCompleteEvent.cpp \ ./Source/Scheduler/Events/CSendTaskProcessEvent.cpp \ ./Source/Scheduler/Events/CSendTaskScheduleEvent.cpp \ ./Source/Scheduler/Events/CTaskAdditionalAllocationEvent.cpp \ ./Source/Scheduler/Events/CTaskDispenseNotificationEvent.cpp \ ./Source/Scheduler/Events/CTaskStatusUpdatedEvent.cpp \ ./Source/Scheduler/Events/CUpdateTaskStatusEvent.cpp \ ./Source/Config/CBooleanConfigType.cpp \ ./Source/Config/CConfigData.cpp \ ./Source/Config/CConfigDataReader.cpp \ ./Source/Config/CConfigDescription.cpp \ ./Source/Config/CConfigType.cpp \ ./Source/Config/CConfiguration.cpp \ ./Source/Config/CConfigurationBase.cpp \ ./Source/Config/CConfigurationGroup.cpp \ ./Source/Config/CConfigurationProvider.cpp \ ./Source/Config/CConvertBooleanConfigType.cpp \ ./Source/Config/CConvertIntegerConfigType.cpp \ ./Source/Config/CConvertStringConfigType.cpp \ ./Source/Config/CGlobalConfigurationBase.cpp \ ./Source/Config/CGlobalConfigurationProvider.cpp \ ./Source/Config/CIntegerConfigType.cpp \ ./Source/Config/CLocalConfigurationExtension.cpp \ ./Source/Config/CLocalConfigurationFixedExtension.cpp \ ./Source/Config/CObjectConfigType.cpp \ ./Source/Config/CStringConfigType.cpp \ ./Source/Control/Command/CClassificationManagerConfigType.cpp \ ./Source/Control/Command/CCommand.cpp \ ./Source/Control/Command/CCommandBuilder.cpp \ ./Source/Control/Command/CCommandDelegater.cpp \ ./Source/Control/Command/CCommanderInitializationFactory.cpp \ ./Source/Control/Command/CCommanderManager.cpp \ ./Source/Control/Command/CCommanderManagerConfigType.cpp \ ./Source/Control/Command/CCommanderManagerThread.cpp \ ./Source/Control/Command/CCommandExecutedBlocker.cpp \ ./Source/Control/Command/CCommandPrecondition.cpp \ ./Source/Control/Command/CCommandProcessedPrecondition.cpp \ ./Source/Control/Command/CCommandRecordData.cpp \ ./Source/Control/Command/CCommandRecorder.cpp \ ./Source/Control/Command/CCommandRecordRouter.cpp \ ./Source/Control/Command/CConfigManagerReader.cpp \ ./Source/Control/Command/CDefaultCommanderInitializationFactory.cpp \ ./Source/Control/Command/COntologyRevisionManagerConfigType.cpp \ ./Source/Control/Command/CPreconditionCommand.cpp \ ./Source/Control/Command/CPreconditionSynchronizer.cpp \ ./Source/Control/Command/CReasonerCommandBuilder.cpp \ ./Source/Control/Command/CReasonerCommanderGlobalConfiguration.cpp \ ./Source/Control/Command/CReasonerConfigurationGroup.cpp \ ./Source/Control/Command/CReasonerManagerConfigType.cpp \ ./Source/Control/Command/Instructions/CAreClassesDisjointQueryCommand.cpp \ ./Source/Control/Command/Instructions/CAreClassesDisjointQueryOWL2XMLNodeCommand.cpp \ ./Source/Control/Command/Instructions/CAreClassesEquivalentQueryCommand.cpp \ ./Source/Control/Command/Instructions/CAreClassesEquivalentQueryOWL2XMLNodeCommand.cpp \ ./Source/Control/Command/Instructions/CBuildQueryCommand.cpp \ ./Source/Control/Command/Instructions/CCalculateQueryCommand.cpp \ ./Source/Control/Command/Instructions/CChooseParseInstallKnowledgeBaseOWLAutoOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CChooseParseInstallKnowledgeBaseOWLXMLOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CClassifyQueryCommand.cpp \ ./Source/Control/Command/Instructions/CConstructClassifyQueryCommand.cpp \ ./Source/Control/Command/Instructions/CConstructClassSatisfiableQueryCommand.cpp \ ./Source/Control/Command/Instructions/CConstructFlattenedTypesQueryCommand.cpp \ ./Source/Control/Command/Instructions/CConstructIsConsistentQueryCommand.cpp \ ./Source/Control/Command/Instructions/CConstructIsTriviallyConsistentQueryCommand.cpp \ ./Source/Control/Command/Instructions/CConstructRealizeQueryCommand.cpp \ ./Source/Control/Command/Instructions/CConstructSubClassHirarchyQueryCommand.cpp \ ./Source/Control/Command/Instructions/CConstructWriteFunctionalIndividualTypesQueryCommand.cpp \ ./Source/Control/Command/Instructions/CConstructWriteFunctionalSubClassHirarchyQueryCommand.cpp \ ./Source/Control/Command/Instructions/CConstructWriteXMLIndividualTypesQueryCommand.cpp \ ./Source/Control/Command/Instructions/CConstructWriteXMLSubClassHirarchyQueryCommand.cpp \ ./Source/Control/Command/Instructions/CCreateKnowledgeBaseCommand.cpp \ ./Source/Control/Command/Instructions/CCreateKnowledgeBaseRevisionUpdateCommand.cpp \ ./Source/Control/Command/Instructions/CEvaluateTestsuiteCommand.cpp \ ./Source/Control/Command/Instructions/CExtractedKnowledgeBaseEntitiesContainer.cpp \ ./Source/Control/Command/Instructions/CExtractKnowledgeBaseEntitiesCommand.cpp \ ./Source/Control/Command/Instructions/CExtractKnowledgeBaseLanguageCommand.cpp \ ./Source/Control/Command/Instructions/CExtractOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CExtractToldExpressionsOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CGenerateQueryCommand.cpp \ ./Source/Control/Command/Instructions/CGetClassificationManagerCommand.cpp \ ./Source/Control/Command/Instructions/CGetConfigCommand.cpp \ ./Source/Control/Command/Instructions/CGetCurrentKnowledgeBaseRevisionCommand.cpp \ ./Source/Control/Command/Instructions/CGetDescriptionCommand.cpp \ ./Source/Control/Command/Instructions/CGetFlattenedTypesOWL2XMLNodeCommand.cpp \ ./Source/Control/Command/Instructions/CGetFlattenedTypesQueryCommand.cpp \ ./Source/Control/Command/Instructions/CGetKnowledgeBaseClassEntitiesCommand.cpp \ ./Source/Control/Command/Instructions/CGetKnowledgeBaseConfigCommand.cpp \ ./Source/Control/Command/Instructions/CGetKnowledgeBaseEntitiesCommand.cpp \ ./Source/Control/Command/Instructions/CGetKnowledgeBaseLanguageCommand.cpp \ ./Source/Control/Command/Instructions/CGetKnowledgeBaseNamedIndividualEntitiesCommand.cpp \ ./Source/Control/Command/Instructions/CGetKnowledgeBaseObjectPropertyEntitiesCommand.cpp \ ./Source/Control/Command/Instructions/CGetKnowledgeBaseSettingsCommand.cpp \ ./Source/Control/Command/Instructions/CGetReasonerCommand.cpp \ ./Source/Control/Command/Instructions/CGetSettingsCommand.cpp \ ./Source/Control/Command/Instructions/CGetSubClassHierarchyQueryCommand.cpp \ ./Source/Control/Command/Instructions/CGetSubClassHierarchyQueryOWL2XMLNodeCommand.cpp \ ./Source/Control/Command/Instructions/CImportKnowledgeBaseOWLAutoOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CInitializeConfigurationCommand.cpp \ ./Source/Control/Command/Instructions/CInitializeReasonerCommand.cpp \ ./Source/Control/Command/Instructions/CInsertResponseCommentCommand.cpp \ ./Source/Control/Command/Instructions/CInstallKnowledgeBaseRevisionUpdateCommand.cpp \ ./Source/Control/Command/Instructions/CIsClassSubsumedByQueryCommand.cpp \ ./Source/Control/Command/Instructions/CIsClassSubsumedByQueryOWL2XMLNodeCommand.cpp \ ./Source/Control/Command/Instructions/CIsConsistentQueryCommand.cpp \ ./Source/Control/Command/Instructions/CIsConsistentQueryOWL2XMLNodeCommand.cpp \ ./Source/Control/Command/Instructions/CIsInstanceOfQueryCommand.cpp \ ./Source/Control/Command/Instructions/CIsInstanceOfQueryOWL2XMLNodeCommand.cpp \ ./Source/Control/Command/Instructions/CIsSatisfiableQueryCommand.cpp \ ./Source/Control/Command/Instructions/CIsSatisfiableQueryOWL2XMLNodeCommand.cpp \ ./Source/Control/Command/Instructions/CIsTriviallyConsistentQueryCommand.cpp \ ./Source/Control/Command/Instructions/CKnowledgeBaseClassifyCommand.cpp \ ./Source/Control/Command/Instructions/CKnowledgeBaseCommand.cpp \ ./Source/Control/Command/Instructions/CKnowledgeBaseEntitiesExtractionSpecification.cpp \ ./Source/Control/Command/Instructions/CKnowledgeBaseProcessCommand.cpp \ ./Source/Control/Command/Instructions/CKnowledgeBaseQueryCommand.cpp \ ./Source/Control/Command/Instructions/CKnowledgeBaseRealizeCommand.cpp \ ./Source/Control/Command/Instructions/CKnowledgeBaseRevisionCommandProvider.cpp \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseAllDownloadedContinuer.cpp \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseCommand.cpp \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseData.cpp \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseFinishDownloadCommand.cpp \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseKRSSTestConceptCommand.cpp \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLAutoOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLFunctionalOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseOWLXMLOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CLoadKnowledgeBaseStartDownloadCommand.cpp \ ./Source/Control/Command/Instructions/CParseCommandsCommand.cpp \ ./Source/Control/Command/Instructions/CParseKRSSTestConceptOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CParseOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CParseOWL2XMLOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CParseOWL2XMLQueryCommand.cpp \ ./Source/Control/Command/Instructions/CParseOWLlinkCommandsCommand.cpp \ ./Source/Control/Command/Instructions/CParseTestsuiteCommandsCommand.cpp \ ./Source/Control/Command/Instructions/CParseTestsuiteXMLNodeCommand.cpp \ ./Source/Control/Command/Instructions/CPrepareKnowledgeBaseCommand.cpp \ ./Source/Control/Command/Instructions/CPrepareKnowledgeBaseForQueryCommand.cpp \ ./Source/Control/Command/Instructions/CPrepareKnowledgeBaseForRevisionCommand.cpp \ ./Source/Control/Command/Instructions/CProcessClassNameSatisfiableQueryCommand.cpp \ ./Source/Control/Command/Instructions/CProcessQueryCommand.cpp \ ./Source/Control/Command/Instructions/CProcessQueryOWL2XMLNodeCommand.cpp \ ./Source/Control/Command/Instructions/CQueryCommandProvider.cpp \ ./Source/Control/Command/Instructions/CQueryGeneratorCommandProvider.cpp \ ./Source/Control/Command/Instructions/CReadTextCommand.cpp \ ./Source/Control/Command/Instructions/CReadTextCommandProvider.cpp \ ./Source/Control/Command/Instructions/CReadXMLCommand.cpp \ ./Source/Control/Command/Instructions/CReadXMLCommandProvider.cpp \ ./Source/Control/Command/Instructions/CRealizeQueryCommand.cpp \ ./Source/Control/Command/Instructions/CReleaseKnowledgeBaseCommand.cpp \ ./Source/Control/Command/Instructions/CRendererCommandProvider.cpp \ ./Source/Control/Command/Instructions/CSaveKnowledgeBaseCommand.cpp \ ./Source/Control/Command/Instructions/CSaveOWL2XMLExtractedKnowledgeBaseCommand.cpp \ ./Source/Control/Command/Instructions/CSaveOWLlinkOWL2XMLSatisfiableTestExtractedKnowledgeBaseCommand.cpp \ ./Source/Control/Command/Instructions/CSAXParseOWL2XMLOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CSetConfigCommand.cpp \ ./Source/Control/Command/Instructions/CSetKnowledgeBaseConfigCommand.cpp \ ./Source/Control/Command/Instructions/CSkipUnsupportedCommandCommand.cpp \ ./Source/Control/Command/Instructions/CStreamParseOWL2FunctionalOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CStreamParseOWL2XMLOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CTellKnowledgeBaseCommand.cpp \ ./Source/Control/Command/Instructions/CTellKnowledgeBaseOWL2XMLNodeCommand.cpp \ ./Source/Control/Command/Instructions/CTestExtendedCalculateQueryCommand.cpp \ ./Source/Control/Command/Instructions/CTestTestfileCommand.cpp \ ./Source/Control/Command/Instructions/CTestTestsuiteCommand.cpp \ ./Source/Control/Command/Instructions/CWriteFunctionalIndividualTypesQueryCommand.cpp \ ./Source/Control/Command/Instructions/CWriteFunctionalSubClassHierarchyQueryCommand.cpp \ ./Source/Control/Command/Instructions/CWriteOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CWriteOWL2XMLOntologyCommand.cpp \ ./Source/Control/Command/Instructions/CWriteOWLlinkOWL2XMLSatisfiableTestCommand.cpp \ ./Source/Control/Command/Instructions/CWriteXMLIndividualTypesQueryCommand.cpp \ ./Source/Control/Command/Instructions/CWriteXMLSubClassHierarchyQueryCommand.cpp \ ./Source/Control/Command/Events/CCommandCalculatedQueryCallbackEvent.cpp \ ./Source/Control/Command/Events/CCommandPreconditionChangeEvent.cpp \ ./Source/Control/Command/Events/CCommandProcessedCallbackEvent.cpp \ ./Source/Control/Command/Events/CInitializeEvent.cpp \ ./Source/Control/Command/Events/COntologyPreparedCallbackEvent.cpp \ ./Source/Control/Command/Events/CRealizeCommandEvent.cpp \ ./Source/Control/Command/Records/CBuildSubCommandRecord.cpp \ ./Source/Control/Command/Records/CClosureProcessCommandRecord.cpp \ ./Source/Control/Command/Records/CFinishProcessCommandRecord.cpp \ ./Source/Control/Command/Records/CNotSupportedNodeErrorRecord.cpp \ ./Source/Control/Command/Records/CParseSyntaxErrorRecord.cpp \ ./Source/Control/Command/Records/CProcessErrorRecord.cpp \ ./Source/Control/Command/Records/CStartProcessCommandRecord.cpp \ ./Source/Control/Command/Records/CStopProcessCommandRecord.cpp \ ./Source/Control/Command/Records/CUnspecifiedMessageErrorRecord.cpp \ ./Source/Control/Command/Records/CUnspecifiedMessageInformationRecord.cpp \ ./Source/Control/Loader/CAnalyseReasonerLoader.cpp \ ./Source/Control/Loader/CCLIBatchProcessingLoader.cpp \ ./Source/Control/Loader/CCLIClassificationBatchProcessingLoader.cpp \ ./Source/Control/Loader/CCLIConsistencyBatchProcessingLoader.cpp \ ./Source/Control/Loader/CCLIRealizationBatchProcessingLoader.cpp \ ./Source/Control/Loader/CCLISatisfiabilityBatchProcessingLoader.cpp \ ./Source/Control/Loader/CCloser.cpp \ ./Source/Control/Loader/CCommandLineLoader.cpp \ ./Source/Control/Loader/CCommandLineTranlatorHelpLoader.cpp \ ./Source/Control/Loader/CConfigurableCoutLogObserverLoader.cpp \ ./Source/Control/Loader/CCoutLogObserverLoader.cpp \ ./Source/Control/Loader/CDefaultLoaderFactory.cpp \ ./Source/Control/Loader/CDefaultReasonerLoader.cpp \ ./Source/Control/Loader/CExperimentalReasonerLoader.cpp \ ./Source/Control/Loader/CLargeJoinTestDataGeneratorLoader.cpp \ ./Source/Control/Loader/CLoader.cpp \ ./Source/Control/Loader/CLoaderFactory.cpp \ ./Source/Control/Loader/CLoggerConfigurationLoader.cpp \ ./Source/Control/Loader/COREBatchProcessingLoader.cpp \ ./Source/Control/Loader/CORECoutLogObserverLoader.cpp \ ./Source/Control/Loader/COWLFilesIncompatibleAxiomChangerLoader.cpp \ ./Source/Control/Loader/COWLFilesOWLlinkTestcaseGeneratorLoader.cpp \ ./Source/Control/Loader/COWLlinkBatchFileLoader.cpp \ ./Source/Control/Loader/COWLlinkHttpServerLoader.cpp \ ./Source/Control/Loader/CPigenholePrincipleGeneratorLoader.cpp \ ./Source/Control/Loader/CReasonerEvaluationClassificationTimesComparerLoader.cpp \ ./Source/Control/Loader/CReasonerEvaluationLoader.cpp \ ./Source/Control/Loader/CReasonerEvaluationLoadingTimesComparerLoader.cpp \ ./Source/Control/Loader/CReasonerEvaluationOntologyExtractionLoader.cpp \ ./Source/Control/Loader/CReasonerEvaluationProgramLoader.cpp \ ./Source/Control/Loader/CReasonerEvaluationTestcaseStatisticCollectionGeneratorLoader.cpp \ ./Source/Control/Loader/CRecursionTestDataGeneratorLoader.cpp \ ./Source/Control/Loader/CTestHashModificationLoader.cpp \ ./Source/Control/Loader/CTestMemoryAccessLoader.cpp \ ./Source/Control/Loader/CTestOWLlinkAPIBatchFileLoader.cpp \ ./Source/Control/Loader/CTestQHashVsQMapLoader.cpp \ ./Source/Control/Loader/CTestTaskThroughputLoader.cpp \ ./Source/Control/Loader/CTransitiveConnectedELClassesTestDataGeneratorLoader.cpp \ ./Source/Control/Interface/OWLlink/COWLlinkHttpConnectionHandlerProcessor.cpp \ ./Source/Control/Interface/OWLlink/COWLlinkHttpConnectionHandlerProcessorFactory.cpp \ ./Source/Control/Interface/OWLlink/COWLlinkProcessor.cpp \ ./Source/Control/Interface/OWLlink/COWLLinkRecordInterpreter.cpp \ ./Source/Control/Interface/CommandLine/CCLIClassificationComandLinePreparationTranslator.cpp \ ./Source/Control/Interface/CommandLine/CCLIComandLinePreparationTranslator.cpp \ ./Source/Control/Interface/CommandLine/CCLIConsistencyComandLinePreparationTranslator.cpp \ ./Source/Control/Interface/CommandLine/CCLIRealizationComandLinePreparationTranslator.cpp \ ./Source/Control/Interface/CommandLine/CCLISatisfiabilityComandLinePreparationTranslator.cpp \ ./Source/Control/Interface/CommandLine/CCommandLinePreparationTranslator.cpp \ ./Source/Control/Interface/CommandLine/CCommandLinePreparationTranslatorSelector.cpp \ ./Source/Control/Interface/CommandLine/COWLLinkFileComandLinePreparationTranslator.cpp \ ./Source/Control/Interface/CommandLine/COWLLinkServerComandLinePreparationTranslator.cpp \ ./Source/Test/CCacheTestReader.cpp \ ./Source/Test/CCacheTestWriter.cpp \ ./Source/Test/CConcurrentHashModificationTester.cpp \ ./Source/Test/CConcurrentMemoryAccessTester.cpp \ ./Source/Test/CConcurrentOccurenceUnsatisfiableCacheTester.cpp \ ./Source/Test/CConcurrentThroughputTestTaskTester.cpp \ ./Source/Test/CHashModificationThread.cpp \ ./Source/Test/CMemoryAccessThread.cpp \ ./Source/Test/COWLFileAxiomRemover.cpp \ ./Source/Test/COWLFileOWLlinkClassifyRequestGenerator.cpp \ ./Source/Test/COWLFileOWLlinkConsistencyRequestGenerator.cpp \ ./Source/Test/COWLFileOWLlinkIncrementalAssertionClassificationRequestGenerator.cpp \ ./Source/Test/COWLFileOWLlinkIncrementalAssertionConsistencyRequestGenerator.cpp \ ./Source/Test/COWLFileOWLlinkIncrementalAssertionRealizationRequestGenerator.cpp \ ./Source/Test/COWLFileOWLlinkIncrementalAssertionRequestGenerator.cpp \ ./Source/Test/COWLFileOWLlinkSatisfiabilityRequestGenerator.cpp \ ./Source/Test/COWLFileOWLlinkTypesRequestGenerator.cpp \ ./Source/Test/COWLLargeJoinTestDataGenerator.cpp \ ./Source/Test/COWLlinkAPIReasonerTestfileTester.cpp \ ./Source/Test/COWLPigeonholePrincipleGenerator.cpp \ ./Source/Test/COWLRecursionTestDataGenerator.cpp \ ./Source/Test/COWLTransitiveConnectedELClassesTestDataGenerator.cpp \ ./Source/Test/CQHashVsQMapTester.cpp \ ./Source/Test/CReasonerTestfileErrorEvaluator.cpp \ ./Source/Test/CReasonerTestfileEvaluator.cpp \ ./Source/Test/CReasonerTestfileTest.cpp \ ./Source/Test/CReasonerTestfileTester.cpp \ ./Source/Test/CReasonerTestfileTestResult.cpp \ ./Source/Test/CReasonerTestsuiteTest.cpp \ ./Source/Test/CReasonerTestsuiteTester.cpp \ ./Source/Test/CReasonerTestsuiteTestResult.cpp \ ./Source/Test/CThroughputTestTask.cpp \ ./Source/Test/CThroughputTestTaskHandleAlgorithm.cpp \ ./Source/Test/CThroughputTestTaskTester.cpp \ ./Source/Test/Analyse/CAnalyseData.cpp \ ./Source/Test/Analyse/CAnalyseDataCVSFileWriterObserver.cpp \ ./Source/Test/Analyse/CAnalyseDataDescription.cpp \ ./Source/Test/Analyse/CAnalyseDataLinker.cpp \ ./Source/Test/Analyse/CAnalyseDataObserver.cpp \ ./Source/Test/Analyse/CAnalyseDataSeries.cpp \ ./Source/Test/Analyse/CAnalyseDataUpdateItem.cpp \ ./Source/Test/Analyse/CAnalyseDataUpdater.cpp \ ./Source/Test/Analyse/CAnalyseDescription.cpp \ ./Source/Test/Analyse/CAnalyseUpdateDescription.cpp \ ./Source/Test/Analyse/CAnalyseValue.cpp \ ./Source/Test/Analyse/CAnalyseValueDescription.cpp \ ./Source/Test/Analyse/CAnalyseValueUpdateReader.cpp \ ./Source/Test/Analyse/Reader/CCalculationTableauCompletionAlgorithmUpdateReader.cpp \ ./Source/Test/Analyse/CConvertDoubleAnalyseValue.cpp \ ./Source/Test/Analyse/CConvertIntegerAnalyseValue.cpp \ ./Source/Test/Analyse/CConvertStringAnalyseValue.cpp \ ./Source/Test/Analyse/CDifferenceValueAnalyser.cpp \ ./Source/Test/Analyse/CDoubleAnalyseValue.cpp \ ./Source/Test/Analyse/CIntegerAnalyseValue.cpp \ ./Source/Test/Analyse/CMinMaxAvgCountValueAnalyser.cpp \ ./Source/Test/Analyse/CMinMaxAvgLimitedCountValueAnalyser.cpp \ ./Source/Test/Analyse/CMinMaxFixedAvgCountValueAnalyser.cpp \ ./Source/Test/Analyse/CMinOffsetMaxOffsetAvgLimitedCountValueAnalyser.cpp \ ./Source/Test/Analyse/CStringAnalyseValue.cpp \ ./Source/Test/Analyse/CValueAnalyser.cpp \ ./Source/Test/Analyse/Reader/CAnalyseValueMinMaxAvgExtendedUpdateReader.cpp \ ./Source/Test/Analyse/Reader/CClassificationProgressUpdateReader.cpp \ ./Source/Test/Analyse/Reader/CClassificationStatisticsUpdateReader.cpp \ ./Source/Test/Analyse/Reader/CClassificationStatusUpdateReader.cpp \ ./Source/Test/Analyse/Reader/CConcurrentOccurenceUnsatisfiableCacheTestPerformanceReader.cpp \ ./Source/Test/Analyse/Reader/CReasonerWorkloadUpdateReader.cpp \ ./Source/Test/Analyse/Reader/CTaskProcesserBlockingCountUpdateReader.cpp \ ./Source/Test/Analyse/Reader/CTaskProcessingUpdateReader.cpp \ ./Source/Test/Analyse/Reader/CTaskReserveQueueUpdateReader.cpp \ ./Source/Test/Analyse/Reader/CTestTaskThroughputReader.cpp \ ./Source/Test/Analyse/Reader/CThreadTimesUpdateReader.cpp \ ./Source/Test/Events/CEvaluateTestfileTestEvent.cpp \ ./Source/Test/Events/CTestTestfileEvent.cpp \ ./Source/Test/Evaluation/CConfigDependendReasonerEvaluationFactory.cpp \ ./Source/Test/Evaluation/CCriticalSystemProcessTester.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationAnalyseContext.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationAnalyser.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationAnalyserChecker.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationAvaragerSummarizer.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationClassificationTimeExtractor.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationCollector.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationConfigurationLoader.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationDataValue.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationDataValueCacher.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationDataValueGroup.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationDataValueGroupCollection.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationDataValueGroupCollectionReasonerComparison.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationDirectoryStructureSelectorFactory.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationDoubleDataValue.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationEvaluatedCallbackContextData.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationEvaluator.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationExecutionCallbackContextData.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationExecutor.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationExecutorThread.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationExpressivityRequestSelector.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationExpressivitySelectorFactory.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationExtractor.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationFactory.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationFilter.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationFilterCondition.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationFiltering.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationFilterIntegerCondition.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationFilterStringCondition.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationGNUPlotPlotter.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerAccumulatedCountCSVComparisonAnalyser.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerAccumulatedCSVComparisonAnalyser.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerBucketCSVComparisonAnalyser.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerComparisonAnalyser.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerErrorAnalyser.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerResultDifferenceAnalyser.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerStatisticValueCollectingCSVComparisonAnalyser.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerStatisticValueCSVComparisonAnalyser.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestSelector.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationGroupRequestStatisticsCSVComparisonAnalyser.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationHighchartPlotter.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationHTMLNavigationOverviewSummarizer.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationIntegerDataValue.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationLoadingTimeExtractor.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationManager.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationManagerThread.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationPathConverter.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationProfileRequestSelector.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationProfileSelectorFactory.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationProgram.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationProvider.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationRequestClient.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationRequestClientThread.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationRequestResponse.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationRequestResult.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationResponseFileExtractor.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationResponseFileListSummarizer.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationResponseTimeExtractor.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationSpecifiedTimeExtractor.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationStatisticsNameCollectingExtractor.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationStatisticsValueExtractor.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationStringListValue.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationStringMatchGroupSelector.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationStringValue.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationSummarizer.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationTableMultiFormatOutputWriter.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationTerminationResult.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationTestsuite.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationTimeoutErrorExtractor.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationUpdater.cpp \ ./Source/Test/Evaluation/CReasonerEvaluationUpdaterThread.cpp \ ./Source/Test/Evaluation/CReasonerExecutableEvaluationProvider.cpp \ ./Source/Test/Evaluation/CReasonerKoncludeEvaluationProvider.cpp \ ./Source/Test/Evaluation/CReasonerOWLlinkEvaluationProvider.cpp \ ./Source/Test/Evaluation/Events/CReasonerEvaluationNextEvent.cpp \ ./Source/Test/Evaluation/Events/CReasonerEvaluationProgramEvent.cpp \ ./Source/Test/Evaluation/Events/CReasonerEvaluationProgramFileChangedEvent.cpp \ ./Source/Test/Evaluation/Events/CReasonerEvaluationStartEvent.cpp \ ./Source/Test/Evaluation/Events/CReasonerEvaluationTestsuiteEvent.cpp \ ./Source/Test/Evaluation/Events/CReasonerEvaluationUpdateEvent.cpp \ ./Source/Concurrent/CEvent.cpp \ ./Source/Concurrent/CEventAllocator.cpp \ ./Source/Concurrent/CEventChannel.cpp \ ./Source/Concurrent/CEventChannelLinker.cpp \ ./Source/Concurrent/CEventCommunicator.cpp \ ./Source/Concurrent/CEventHandler.cpp \ ./Source/Concurrent/CEventLinker.cpp \ ./Source/Concurrent/CEventLinkerChannel.cpp \ ./Source/Concurrent/CEventLinkerProvider.cpp \ ./Source/Concurrent/CEventLinkerQueue.cpp \ ./Source/Concurrent/CEventProcessor.cpp \ ./Source/Concurrent/CEventQueue.cpp \ ./Source/Concurrent/CEventThread.cpp \ ./Source/Concurrent/CIntervalThread.cpp \ ./Source/Concurrent/CIntervalThreadData.cpp \ ./Source/Concurrent/CQueuedLinkedEventHandler.cpp \ ./Source/Concurrent/CSyncedEventChannel.cpp \ ./Source/Concurrent/CSyncedFreeEventChannel.cpp \ ./Source/Concurrent/CThread.cpp \ ./Source/Concurrent/CThreadActivator.cpp \ ./Source/Concurrent/CWatchDog.cpp \ ./Source/Concurrent/CWatchDogThread.cpp \ ./Source/Concurrent/CWatchDogThreadData.cpp \ ./Source/Concurrent/Events/CControlEvent.cpp \ ./Source/Concurrent/Events/CCustomCallbackEvent.cpp \ ./Source/Concurrent/Events/CCustomEvent.cpp \ ./Source/Concurrent/Events/CHandleEventsEvent.cpp \ ./Source/Concurrent/Events/CRequestFeedbackEvent.cpp \ ./Source/Concurrent/Events/CTimerIntervalEvent.cpp \ ./Source/Concurrent/Events/CWaitSynchronizationEvent.cpp \ ./Source/Concurrent/Events/CWatchDogFeedbackEvent.cpp \ ./Source/Concurrent/Callback/CBlockingCallbackData.cpp \ ./Source/Concurrent/Callback/CCallbackData.cpp \ ./Source/Concurrent/Callback/CCallbackDataContext.cpp \ ./Source/Concurrent/Callback/CCallbackListExecuter.cpp \ ./Source/Concurrent/Callback/CCallbackRememberLinkedExecuter.cpp \ ./Source/Concurrent/Callback/CSynchronizedCallbackListExecuter.cpp \ ./Source/Context/CContext.cpp \ ./Source/Context/CContextBase.cpp \ ./Source/Network/CNetworkRequest.cpp \ ./Source/Network/CNetworkResponse.cpp \ ./Source/Network/HTTP/CHttpRequest.cpp \ ./Source/Network/HTTP/CHttpRequestFactory.cpp \ ./Source/Network/HTTP/CHttpResponse.cpp \ ./Source/Network/HTTP/CHttpResponseExtractor.cpp \ ./Source/Network/HTTP/CHttpTransactionManager.cpp \ ./Source/Network/HTTP/CQtHttpConnectionHandler.cpp \ ./Source/Network/HTTP/CQtHttpConnectionHandlerFactory.cpp \ ./Source/Network/HTTP/CQtHttpConnectionHandlerPooledFactory.cpp \ ./Source/Network/HTTP/CQtHttpConnectionHandlerReleaser.cpp \ ./Source/Network/HTTP/CQtHttpDownloadFileRequest.cpp \ ./Source/Network/HTTP/CQtHttpListner.cpp \ ./Source/Network/HTTP/CQtHttpPooledConnectionHandler.cpp \ ./Source/Network/HTTP/CQtHttpRequest.cpp \ ./Source/Network/HTTP/CQtHttpRequestBodyOnlyParser.cpp \ ./Source/Network/HTTP/CQtHttpRequestParser.cpp \ ./Source/Network/HTTP/CQtHttpResponse.cpp \ ./Source/Network/HTTP/CQtHttpTransactionManager.cpp \ ./Source/Network/HTTP/Events/CAddResponseFinishedCallbackEvent.cpp \ ./Source/Network/HTTP/Events/CConnectionDisconnectedEvent.cpp \ ./Source/Network/HTTP/Events/CConnectionReadyReadEvent.cpp \ ./Source/Network/HTTP/Events/CExtractResponseDataCallbackEvent.cpp \ ./Source/Network/HTTP/Events/CExtractResponseDataEvent.cpp \ ./Source/Network/HTTP/Events/CHandleIncomingHttpConnectionEvent.cpp \ ./Source/Network/HTTP/Events/CHttpReplyFinishedEvent.cpp \ ./Source/Network/HTTP/Events/CHttpRequstEvent.cpp \ ./Source/Network/HTTP/Events/CInstallRequestFinishedCallbackEvent.cpp \ ./Source/Network/HTTP/Events/CReleaseResponseEvent.cpp \ ./Source/Renderer/COntologyEmptyDefaultRenderer.cpp \ ./Source/Renderer/COntologyExtractionManager.cpp \ ./Source/Renderer/COntologyOWL2QtXMLRenderer.cpp \ ./Source/Renderer/COntologyParsedBuildExpressionRenderVisitor.cpp \ ./Source/Renderer/COntologyRenderer.cpp \ ./Source/Renderer/COntologyRenderVisitor.cpp \ ./Source/Renderer/CRenderedItemLinker.cpp \ ./Source/Renderer/CRenderedQtXMLItemLinker.cpp \ ./Source/Renderer/CRenderWriteManager.cpp \ ./Source/Test/COWLFileOWLlinkRealizeRequestGenerator.cpp Konclude-v0.6.2-544-SourceCode/Konclude.pro0000644000175000017500000000076512235442744017327 0ustar jonasjonas message("Preparing source code of Konclude.") TEMPLATE = app TARGET = Konclude DESTDIR = ./Release QT += xml network CONFIG += release console warn_off DEFINES += QT_XML_LIB QT_NETWORK_LIB KONCLUDE_FORCE_ALL_DEBUG_DEACTIVATED INCLUDEPATH += ./generatedfiles \ ./GeneratedFiles/Release \ ./Source \ . DEPENDPATH += . MOC_DIR += ./GeneratedFiles/release OBJECTS_DIR += release UI_DIR += ./GeneratedFiles RCC_DIR += ./GeneratedFiles #Include file(s) include(Konclude.pri)